Files
kanban2/main-OM4ZYGBB.js
2026-04-16 23:45:47 +03:00

14 lines
482 KiB
JavaScript

import{$ as zu,A as d_,B as f_,C as dt,D as Nn,E as ia,F as oo,G as h_,H as p_,I as g_,J as S,K as Ze,L as be,M as Uu,N as m_,O as so,P as __,Q as Fe,R as fn,S as oa,T as $u,U as y_,V as qr,W as ao,X as sa,Y as v_,Z as D_,_ as w_,a as H,aa,b as de,ba as Rn,c as Jm,ca as Xe,d as Ne,e as e_,f as ta,g as t_,h as n_,i as y,j as Gr,k as na,l as r_,m as i_,n as o_,o as ve,p as ju,q as s_,r as a_,s as l_,t as Bu,u as c_,v as Ht,w as Hu,x as u_,y as ra,z as De}from"./chunk-QXY4AZ67.js";function Ku(n,e){return Object.is(n,e)}var Ie=null,la=!1,Qu=1,Tt=Symbol("SIGNAL");function F(n){let e=Ie;return Ie=n,e}function Yu(){return Ie}var co={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 ua(n){if(la)throw new Error("");if(Ie===null)return;Ie.consumerOnSignalRead(n);let e=Ie.nextProducerIndex++;if(ha(Ie),e<Ie.producerNode.length&&Ie.producerNode[e]!==n&&lo(Ie)){let t=Ie.producerNode[e];fa(t,Ie.producerIndexOfThis[e])}Ie.producerNode[e]!==n&&(Ie.producerNode[e]=n,Ie.producerIndexOfThis[e]=lo(Ie)?E_(n,Ie,e):0),Ie.producerLastReadVersion[e]=n.version}function C_(){Qu++}function Zu(n){if(!(lo(n)&&!n.dirty)&&!(!n.dirty&&n.lastCleanEpoch===Qu)){if(!n.producerMustRecompute(n)&&!td(n)){qu(n);return}n.producerRecomputeValue(n),qu(n)}}function Xu(n){if(n.liveConsumerNode===void 0)return;let e=la;la=!0;try{for(let t of n.liveConsumerNode)t.dirty||rS(t)}finally{la=e}}function Ju(){return Ie?.consumerAllowSignalWrites!==!1}function rS(n){n.dirty=!0,Xu(n),n.consumerMarkedDirty?.(n)}function qu(n){n.dirty=!1,n.lastCleanEpoch=Qu}function da(n){return n&&(n.nextProducerIndex=0),F(n)}function ed(n,e){if(F(e),!(!n||n.producerNode===void 0||n.producerIndexOfThis===void 0||n.producerLastReadVersion===void 0)){if(lo(n))for(let t=n.nextProducerIndex;t<n.producerNode.length;t++)fa(n.producerNode[t],n.producerIndexOfThis[t]);for(;n.producerNode.length>n.nextProducerIndex;)n.producerNode.pop(),n.producerLastReadVersion.pop(),n.producerIndexOfThis.pop()}}function td(n){ha(n);for(let e=0;e<n.producerNode.length;e++){let t=n.producerNode[e],r=n.producerLastReadVersion[e];if(r!==t.version||(Zu(t),r!==t.version))return!0}return!1}function nd(n){if(ha(n),lo(n))for(let e=0;e<n.producerNode.length;e++)fa(n.producerNode[e],n.producerIndexOfThis[e]);n.producerNode.length=n.producerLastReadVersion.length=n.producerIndexOfThis.length=0,n.liveConsumerNode&&(n.liveConsumerNode.length=n.liveConsumerIndexOfThis.length=0)}function E_(n,e,t){if(b_(n),n.liveConsumerNode.length===0&&I_(n))for(let r=0;r<n.producerNode.length;r++)n.producerIndexOfThis[r]=E_(n.producerNode[r],n,r);return n.liveConsumerIndexOfThis.push(t),n.liveConsumerNode.push(e)-1}function fa(n,e){if(b_(n),n.liveConsumerNode.length===1&&I_(n))for(let r=0;r<n.producerNode.length;r++)fa(n.producerNode[r],n.producerIndexOfThis[r]);let t=n.liveConsumerNode.length-1;if(n.liveConsumerNode[e]=n.liveConsumerNode[t],n.liveConsumerIndexOfThis[e]=n.liveConsumerIndexOfThis[t],n.liveConsumerNode.length--,n.liveConsumerIndexOfThis.length--,e<n.liveConsumerNode.length){let r=n.liveConsumerIndexOfThis[e],i=n.liveConsumerNode[e];ha(i),i.producerIndexOfThis[r]=e}}function lo(n){return n.consumerIsAlwaysLive||(n?.liveConsumerNode?.length??0)>0}function ha(n){n.producerNode??=[],n.producerIndexOfThis??=[],n.producerLastReadVersion??=[]}function b_(n){n.liveConsumerNode??=[],n.liveConsumerIndexOfThis??=[]}function I_(n){return n.producerNode!==void 0}function rd(n,e){let t=Object.create(iS);t.computation=n,e!==void 0&&(t.equal=e);let r=()=>{if(Zu(t),ua(t),t.value===ca)throw t.error;return t.value};return r[Tt]=t,r}var Wu=Symbol("UNSET"),Gu=Symbol("COMPUTING"),ca=Symbol("ERRORED"),iS=de(H({},co),{value:Wu,dirty:!0,error:null,equal:Ku,kind:"computed",producerMustRecompute(n){return n.value===Wu||n.value===Gu},producerRecomputeValue(n){if(n.value===Gu)throw new Error("Detected cycle in computations.");let e=n.value;n.value=Gu;let t=da(n),r,i=!1;try{r=n.computation(),F(null),i=e!==Wu&&e!==ca&&r!==ca&&n.equal(e,r)}catch(o){r=ca,n.error=o}finally{ed(n,t)}if(i){n.value=e;return}n.value=r,n.version++}});function oS(){throw new Error}var S_=oS;function T_(n){S_(n)}function id(n){S_=n}var sS=null;function od(n,e){let t=Object.create(ad);t.value=n,e!==void 0&&(t.equal=e);let r=()=>(ua(t),t.value);return r[Tt]=t,r}function pa(n,e){Ju()||T_(n),n.equal(n.value,e)||(n.value=e,aS(n))}function sd(n,e){Ju()||T_(n),pa(n,e(n.value))}var ad=de(H({},co),{equal:Ku,value:void 0,kind:"signal"});function aS(n){n.version++,C_(),Xu(n),sS?.()}function ld(n){let e=F(null);try{return n()}finally{F(e)}}var cd;function uo(){return cd}function hn(n){let e=cd;return cd=n,e}var ga=Symbol("NotFound");function U(n){return typeof n=="function"}function Kr(n){let t=n(r=>{Error.call(r),r.stack=new Error().stack});return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}var ma=Kr(n=>function(t){n(this),this.message=t?`${t.length} errors occurred during unsubscription:
${t.map((r,i)=>`${i+1}) ${r.toString()}`).join(`
`)}`:"",this.name="UnsubscriptionError",this.errors=t});function ur(n,e){if(n){let t=n.indexOf(e);0<=t&&n.splice(t,1)}}var ce=class n{constructor(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}unsubscribe(){let e;if(!this.closed){this.closed=!0;let{_parentage:t}=this;if(t)if(this._parentage=null,Array.isArray(t))for(let o of t)o.remove(this);else t.remove(this);let{initialTeardown:r}=this;if(U(r))try{r()}catch(o){e=o instanceof ma?o.errors:[o]}let{_finalizers:i}=this;if(i){this._finalizers=null;for(let o of i)try{M_(o)}catch(s){e=e??[],s instanceof ma?e=[...e,...s.errors]:e.push(s)}}if(e)throw new ma(e)}}add(e){var t;if(e&&e!==this)if(this.closed)M_(e);else{if(e instanceof n){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=(t=this._finalizers)!==null&&t!==void 0?t:[]).push(e)}}_hasParent(e){let{_parentage:t}=this;return t===e||Array.isArray(t)&&t.includes(e)}_addParent(e){let{_parentage:t}=this;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e}_removeParent(e){let{_parentage:t}=this;t===e?this._parentage=null:Array.isArray(t)&&ur(t,e)}remove(e){let{_finalizers:t}=this;t&&ur(t,e),e instanceof n&&e._removeParent(this)}};ce.EMPTY=(()=>{let n=new ce;return n.closed=!0,n})();var ud=ce.EMPTY;function _a(n){return n instanceof ce||n&&"closed"in n&&U(n.remove)&&U(n.add)&&U(n.unsubscribe)}function M_(n){U(n)?n():n.unsubscribe()}var Mt={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1};var Qr={setTimeout(n,e,...t){let{delegate:r}=Qr;return r?.setTimeout?r.setTimeout(n,e,...t):setTimeout(n,e,...t)},clearTimeout(n){let{delegate:e}=Qr;return(e?.clearTimeout||clearTimeout)(n)},delegate:void 0};function ya(n){Qr.setTimeout(()=>{let{onUnhandledError:e}=Mt;if(e)e(n);else throw n})}function dr(){}var x_=dd("C",void 0,void 0);function A_(n){return dd("E",void 0,n)}function N_(n){return dd("N",n,void 0)}function dd(n,e,t){return{kind:n,value:e,error:t}}var fr=null;function Yr(n){if(Mt.useDeprecatedSynchronousErrorHandling){let e=!fr;if(e&&(fr={errorThrown:!1,error:null}),n(),e){let{errorThrown:t,error:r}=fr;if(fr=null,t)throw r}}else n()}function R_(n){Mt.useDeprecatedSynchronousErrorHandling&&fr&&(fr.errorThrown=!0,fr.error=n)}var hr=class extends ce{constructor(e){super(),this.isStopped=!1,e?(this.destination=e,_a(e)&&e.add(this)):this.destination=hS}static create(e,t,r){return new pn(e,t,r)}next(e){this.isStopped?hd(N_(e),this):this._next(e)}error(e){this.isStopped?hd(A_(e),this):(this.isStopped=!0,this._error(e))}complete(){this.isStopped?hd(x_,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()}}},dS=Function.prototype.bind;function fd(n,e){return dS.call(n,e)}var pd=class{constructor(e){this.partialObserver=e}next(e){let{partialObserver:t}=this;if(t.next)try{t.next(e)}catch(r){va(r)}}error(e){let{partialObserver:t}=this;if(t.error)try{t.error(e)}catch(r){va(r)}else va(e)}complete(){let{partialObserver:e}=this;if(e.complete)try{e.complete()}catch(t){va(t)}}},pn=class extends hr{constructor(e,t,r){super();let i;if(U(e)||!e)i={next:e??void 0,error:t??void 0,complete:r??void 0};else{let o;this&&Mt.useDeprecatedNextContext?(o=Object.create(e),o.unsubscribe=()=>this.unsubscribe(),i={next:e.next&&fd(e.next,o),error:e.error&&fd(e.error,o),complete:e.complete&&fd(e.complete,o)}):i=e}this.destination=new pd(i)}};function va(n){Mt.useDeprecatedSynchronousErrorHandling?R_(n):ya(n)}function fS(n){throw n}function hd(n,e){let{onStoppedNotification:t}=Mt;t&&Qr.setTimeout(()=>t(n,e))}var hS={closed:!0,next:dr,error:fS,complete:dr};var Zr=typeof Symbol=="function"&&Symbol.observable||"@@observable";function ft(n){return n}function k_(n){return n.length===0?ft:n.length===1?n[0]:function(t){return n.reduce((r,i)=>i(r),t)}}var G=(()=>{class n{constructor(t){t&&(this._subscribe=t)}lift(t){let r=new n;return r.source=this,r.operator=t,r}subscribe(t,r,i){let o=gS(t)?t:new pn(t,r,i);return Yr(()=>{let{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 r=P_(r),new r((i,o)=>{let s=new pn({next:a=>{try{t(a)}catch(l){o(l),s.unsubscribe()}},error:o,complete:i});this.subscribe(s)})}_subscribe(t){var r;return(r=this.source)===null||r===void 0?void 0:r.subscribe(t)}[Zr](){return this}pipe(...t){return k_(t)(this)}toPromise(t){return t=P_(t),new t((r,i)=>{let o;this.subscribe(s=>o=s,s=>i(s),()=>r(o))})}}return n.create=e=>new n(e),n})();function P_(n){var e;return(e=n??Mt.Promise)!==null&&e!==void 0?e:Promise}function pS(n){return n&&U(n.next)&&U(n.error)&&U(n.complete)}function gS(n){return n&&n instanceof hr||pS(n)&&_a(n)}function mS(n){return U(n?.lift)}function q(n){return e=>{if(mS(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 K(n,e,t,r,i){return new gd(n,e,t,r,i)}var gd=class extends hr{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()){let{closed:t}=this;super.unsubscribe(),!t&&((e=this.onFinalize)===null||e===void 0||e.call(this))}}};var Xr={schedule(n){let e=requestAnimationFrame,t=cancelAnimationFrame,{delegate:r}=Xr;r&&(e=r.requestAnimationFrame,t=r.cancelAnimationFrame);let i=e(o=>{t=void 0,n(o)});return new ce(()=>t?.(i))},requestAnimationFrame(...n){let{delegate:e}=Xr;return(e?.requestAnimationFrame||requestAnimationFrame)(...n)},cancelAnimationFrame(...n){let{delegate:e}=Xr;return(e?.cancelAnimationFrame||cancelAnimationFrame)(...n)},delegate:void 0};var O_=Kr(n=>function(){n(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"});var L=(()=>{class n extends G{constructor(){super(),this.closed=!1,this.currentObservers=null,this.observers=[],this.isStopped=!1,this.hasError=!1,this.thrownError=null}lift(t){let r=new Da(this,this);return r.operator=t,r}_throwIfClosed(){if(this.closed)throw new O_}next(t){Yr(()=>{if(this._throwIfClosed(),!this.isStopped){this.currentObservers||(this.currentObservers=Array.from(this.observers));for(let r of this.currentObservers)r.next(t)}})}error(t){Yr(()=>{if(this._throwIfClosed(),!this.isStopped){this.hasError=this.isStopped=!0,this.thrownError=t;let{observers:r}=this;for(;r.length;)r.shift().error(t)}})}complete(){Yr(()=>{if(this._throwIfClosed(),!this.isStopped){this.isStopped=!0;let{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((t=this.observers)===null||t===void 0?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){let{hasError:r,isStopped:i,observers:o}=this;return r||i?ud:(this.currentObservers=null,o.push(t),new ce(()=>{this.currentObservers=null,ur(o,t)}))}_checkFinalizedStatuses(t){let{hasError:r,thrownError:i,isStopped:o}=this;r?t.error(i):o&&t.complete()}asObservable(){let t=new G;return t.source=this,t}}return n.create=(e,t)=>new Da(e,t),n})(),Da=class extends L{constructor(e,t){super(),this.destination=e,this.source=t}next(e){var t,r;(r=(t=this.destination)===null||t===void 0?void 0:t.next)===null||r===void 0||r.call(t,e)}error(e){var t,r;(r=(t=this.destination)===null||t===void 0?void 0:t.error)===null||r===void 0||r.call(t,e)}complete(){var e,t;(t=(e=this.destination)===null||e===void 0?void 0:e.complete)===null||t===void 0||t.call(e)}_subscribe(e){var t,r;return(r=(t=this.source)===null||t===void 0?void 0:t.subscribe(e))!==null&&r!==void 0?r:ud}};var pr=class extends L{constructor(e){super(),this._value=e}get value(){return this.getValue()}_subscribe(e){let t=super._subscribe(e);return!t.closed&&e.next(this._value),t}getValue(){let{hasError:e,thrownError:t,_value:r}=this;if(e)throw t;return this._throwIfClosed(),r}next(e){super.next(this._value=e)}};var fo={now(){return(fo.delegate||Date).now()},delegate:void 0};var ho=class extends L{constructor(e=1/0,t=1/0,r=fo){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){let{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();let t=this._innerSubscribe(e),{_infiniteTimeWindow:r,_buffer:i}=this,o=i.slice();for(let s=0;s<o.length&&!e.closed;s+=r?1:2)e.next(o[s]);return this._checkFinalizedStatuses(e),t}_trimBuffer(){let{_bufferSize:e,_timestampProvider:t,_buffer:r,_infiniteTimeWindow:i}=this,o=(i?1:2)*e;if(e<1/0&&o<r.length&&r.splice(0,r.length-o),!i){let s=t.now(),a=0;for(let l=1;l<r.length&&r[l]<=s;l+=2)a=l;a&&r.splice(0,a+1)}}};var wa=class extends ce{constructor(e,t){super()}schedule(e,t=0){return this}};var po={setInterval(n,e,...t){let{delegate:r}=po;return r?.setInterval?r.setInterval(n,e,...t):setInterval(n,e,...t)},clearInterval(n){let{delegate:e}=po;return(e?.clearInterval||clearInterval)(n)},delegate:void 0};var kn=class extends wa{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;let i=this.id,o=this.scheduler;return i!=null&&(this.id=this.recycleAsyncId(o,i,t)),this.pending=!0,this.delay=t,this.id=(r=this.id)!==null&&r!==void 0?r:this.requestAsyncId(o,this.id,t),this}requestAsyncId(e,t,r=0){return po.setInterval(e.flush.bind(e,this),r)}recycleAsyncId(e,t,r=0){if(r!=null&&this.delay===r&&this.pending===!1)return t;t!=null&&po.clearInterval(t)}execute(e,t){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;let r=this._execute(e,t);if(r)return r;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))}_execute(e,t){let r=!1,i;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){let{id:e,scheduler:t}=this,{actions:r}=t;this.work=this.state=this.scheduler=null,this.pending=!1,ur(r,this),e!=null&&(this.id=this.recycleAsyncId(t,e,null)),this.delay=null,super.unsubscribe()}}};var Jr=class n{constructor(e,t=n.now){this.schedulerActionCtor=e,this.now=t}schedule(e,t=0,r){return new this.schedulerActionCtor(this,e).schedule(r,t)}};Jr.now=fo.now;var Pn=class extends Jr{constructor(e,t=Jr.now){super(e,t),this.actions=[],this._active=!1}flush(e){let{actions:t}=this;if(this._active){t.push(e);return}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}}};var Ut=new Pn(kn),md=Ut;var Ca=class extends kn{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 r!=null&&r>0||r==null&&this.delay>0?super.requestAsyncId(e,t,r):(e.flush(this),0)}};var Ea=class extends Pn{};var _d=new Ea(Ca);var ba=class extends kn{constructor(e,t){super(e,t),this.scheduler=e,this.work=t}requestAsyncId(e,t,r=0){return r!==null&&r>0?super.requestAsyncId(e,t,r):(e.actions.push(this),e._scheduled||(e._scheduled=Xr.requestAnimationFrame(()=>e.flush(void 0))))}recycleAsyncId(e,t,r=0){var i;if(r!=null?r>0:this.delay>0)return super.recycleAsyncId(e,t,r);let{actions:o}=e;t!=null&&t===e._scheduled&&((i=o[o.length-1])===null||i===void 0?void 0:i.id)!==t&&(Xr.cancelAnimationFrame(t),e._scheduled=void 0)}};var Ia=class extends Pn{flush(e){this._active=!0;let t;e?t=e.id:(t=this._scheduled,this._scheduled=void 0);let{actions:r}=this,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}}};var Sa=new Ia(ba);var Ta=new G(n=>n.complete());function Ma(n){return n&&U(n.schedule)}function yd(n){return n[n.length-1]}function xa(n){return U(yd(n))?n.pop():void 0}function On(n){return Ma(yd(n))?n.pop():void 0}function F_(n,e){return typeof yd(n)=="number"?n.pop():e}var Aa=n=>n&&typeof n.length=="number"&&typeof n!="function";function Na(n){return U(n?.then)}function Ra(n){return U(n[Zr])}function ka(n){return Symbol.asyncIterator&&U(n?.[Symbol.asyncIterator])}function Pa(n){return new TypeError(`You provided ${n!==null&&typeof n=="object"?"an invalid object":`'${n}'`} where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.`)}function _S(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var Oa=_S();function Fa(n){return U(n?.[Oa])}function La(n){return t_(this,arguments,function*(){let t=n.getReader();try{for(;;){let{value:r,done:i}=yield ta(t.read());if(i)return yield ta(void 0);yield yield ta(r)}}finally{t.releaseLock()}})}function Va(n){return U(n?.getReader)}function fe(n){if(n instanceof G)return n;if(n!=null){if(Ra(n))return yS(n);if(Aa(n))return vS(n);if(Na(n))return DS(n);if(ka(n))return L_(n);if(Fa(n))return wS(n);if(Va(n))return CS(n)}throw Pa(n)}function yS(n){return new G(e=>{let t=n[Zr]();if(U(t.subscribe))return t.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function vS(n){return new G(e=>{for(let t=0;t<n.length&&!e.closed;t++)e.next(n[t]);e.complete()})}function DS(n){return new G(e=>{n.then(t=>{e.closed||(e.next(t),e.complete())},t=>e.error(t)).then(null,ya)})}function wS(n){return new G(e=>{for(let t of n)if(e.next(t),e.closed)return;e.complete()})}function L_(n){return new G(e=>{ES(n,e).catch(t=>e.error(t))})}function CS(n){return L_(La(n))}function ES(n,e){var t,r,i,o;return e_(this,void 0,void 0,function*(){try{for(t=n_(n);r=yield t.next(),!r.done;){let s=r.value;if(e.next(s),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()})}function ht(n,e,t,r=0,i=!1){let o=e.schedule(function(){t(),i?n.add(this.schedule(null,r)):this.unsubscribe()},r);if(n.add(o),!i)return o}function $t(n,e=0){return q((t,r)=>{t.subscribe(K(r,i=>ht(r,n,()=>r.next(i),e),()=>ht(r,n,()=>r.complete(),e),i=>ht(r,n,()=>r.error(i),e)))})}function gn(n,e=0){return q((t,r)=>{r.add(n.schedule(()=>t.subscribe(r),e))})}function V_(n,e){return fe(n).pipe(gn(e),$t(e))}function j_(n,e){return fe(n).pipe(gn(e),$t(e))}function B_(n,e){return new G(t=>{let r=0;return e.schedule(function(){r===n.length?t.complete():(t.next(n[r++]),t.closed||this.schedule())})})}function H_(n,e){return new G(t=>{let r;return ht(t,e,()=>{r=n[Oa](),ht(t,e,()=>{let i,o;try{({value:i,done:o}=r.next())}catch(s){t.error(s);return}o?t.complete():t.next(i)},0,!0)}),()=>U(r?.return)&&r.return()})}function ja(n,e){if(!n)throw new Error("Iterable cannot be null");return new G(t=>{ht(t,e,()=>{let r=n[Symbol.asyncIterator]();ht(t,e,()=>{r.next().then(i=>{i.done?t.complete():t.next(i.value)})},0,!0)})})}function U_(n,e){return ja(La(n),e)}function $_(n,e){if(n!=null){if(Ra(n))return V_(n,e);if(Aa(n))return B_(n,e);if(Na(n))return j_(n,e);if(ka(n))return ja(n,e);if(Fa(n))return H_(n,e);if(Va(n))return U_(n,e)}throw Pa(n)}function pt(n,e){return e?$_(n,e):fe(n)}function zt(...n){let e=On(n);return pt(n,e)}var Ba=Kr(n=>function(){n(this),this.name="EmptyError",this.message="no elements in sequence"});function z_(n){return n instanceof Date&&!isNaN(n)}function oe(n,e){return q((t,r)=>{let i=0;t.subscribe(K(r,o=>{r.next(n.call(e,o,i++))}))})}var{isArray:bS}=Array;function IS(n,e){return bS(e)?n(...e):n(e)}function W_(n){return oe(e=>IS(n,e))}var{isArray:SS}=Array,{getPrototypeOf:TS,prototype:MS,keys:xS}=Object;function G_(n){if(n.length===1){let e=n[0];if(SS(e))return{args:e,keys:null};if(AS(e)){let t=xS(e);return{args:t.map(r=>e[r]),keys:t}}}return{args:n,keys:null}}function AS(n){return n&&typeof n=="object"&&TS(n)===MS}function q_(n,e){return n.reduce((t,r,i)=>(t[r]=e[i],t),{})}function K_(n,e,t,r,i,o,s,a){let l=[],c=0,u=0,d=!1,f=()=>{d&&!l.length&&!c&&e.complete()},h=g=>c<r?p(g):l.push(g),p=g=>{o&&e.next(g),c++;let _=!1;fe(t(g,u++)).subscribe(K(e,D=>{i?.(D),o?h(D):e.next(D)},()=>{_=!0},void 0,()=>{if(_)try{for(c--;l.length&&c<r;){let D=l.shift();s?ht(e,s,()=>p(D)):p(D)}f()}catch(D){e.error(D)}}))};return n.subscribe(K(e,h,()=>{d=!0,f()})),()=>{a?.()}}function vd(n,e,t=1/0){return U(e)?vd((r,i)=>oe((o,s)=>e(r,o,i,s))(fe(n(r,i))),t):(typeof e=="number"&&(t=e),q((r,i)=>K_(r,i,n,t)))}function Ha(n=1/0){return vd(ft,n)}function Q_(){return Ha(1)}function Dd(...n){return Q_()(pt(n,On(n)))}function wd(...n){let e=xa(n),{args:t,keys:r}=G_(n),i=new G(o=>{let{length:s}=t;if(!s){o.complete();return}let a=new Array(s),l=s,c=s;for(let u=0;u<s;u++){let d=!1;fe(t[u]).subscribe(K(o,f=>{d||(d=!0,c--),a[u]=f},()=>l--,void 0,()=>{(!l||!d)&&(c||o.next(r?q_(r,a):a),o.complete())}))}});return e?i.pipe(W_(e)):i}function Ua(n=0,e,t=md){let r=-1;return e!=null&&(Ma(e)?t=e:r=e),new G(i=>{let o=z_(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)})}function Cd(n=0,e=Ut){return n<0&&(n=0),Ua(n,n,e)}function Wt(...n){let e=On(n),t=F_(n,1/0),r=n;return r.length?r.length===1?fe(r[0]):Ha(t)(pt(r,e)):Ta}function gr(n,e){return q((t,r)=>{let i=0;t.subscribe(K(r,o=>n.call(e,o,i++)&&r.next(o)))})}function Y_(n){return q((e,t)=>{let r=!1,i=null,o=null,s=!1,a=()=>{if(o?.unsubscribe(),o=null,r){r=!1;let c=i;i=null,t.next(c)}s&&t.complete()},l=()=>{o=null,s&&t.complete()};e.subscribe(K(t,c=>{r=!0,i=c,o||fe(n(c)).subscribe(o=K(t,a,l))},()=>{s=!0,(!r||!o||o.closed)&&t.complete()}))})}function $a(n,e=Ut){return Y_(()=>Ua(n,e))}function Z_(n,e,t,r,i){return(o,s)=>{let a=t,l=e,c=0;o.subscribe(K(s,u=>{let d=c++;l=a?n(l,u,d):(a=!0,u),r&&s.next(l)},i&&(()=>{a&&s.next(l),s.complete()})))}}function X_(n){return q((e,t)=>{let r=!1;e.subscribe(K(t,i=>{r=!0,t.next(i)},()=>{r||t.next(n),t.complete()}))})}function go(n){return n<=0?()=>Ta:q((e,t)=>{let r=0;e.subscribe(K(t,i=>{++r<=n&&(t.next(i),n<=r&&t.complete())}))})}function za(n,e=ft){return n=n??NS,q((t,r)=>{let i,o=!0;t.subscribe(K(r,s=>{let a=e(s);(o||!n(i,a))&&(o=!1,i=a,r.next(s))}))})}function NS(n,e){return n===e}function J_(n=RS){return q((e,t)=>{let r=!1;e.subscribe(K(t,i=>{r=!0,t.next(i)},()=>r?t.complete():t.error(n())))})}function RS(){return new Ba}function Ed(n,e){let t=arguments.length>=2;return r=>r.pipe(n?gr((i,o)=>n(i,o,r)):ft,go(1),t?X_(e):J_(()=>new Ba))}function Wa(n,e){return q(Z_(n,e,arguments.length>=2,!0))}function mo(n={}){let{connector:e=()=>new L,resetOnError:t=!0,resetOnComplete:r=!0,resetOnRefCountZero:i=!0}=n;return o=>{let s,a,l,c=0,u=!1,d=!1,f=()=>{a?.unsubscribe(),a=void 0},h=()=>{f(),s=l=void 0,u=d=!1},p=()=>{let g=s;h(),g?.unsubscribe()};return q((g,_)=>{c++,!d&&!u&&f();let D=l=l??e();_.add(()=>{c--,c===0&&!d&&!u&&(a=bd(p,i))}),D.subscribe(_),!s&&c>0&&(s=new pn({next:M=>D.next(M),error:M=>{d=!0,f(),a=bd(h,t,M),D.error(M)},complete:()=>{u=!0,f(),a=bd(h,r),D.complete()}}),fe(g).subscribe(s))})(o)}}function bd(n,e,...t){if(e===!0){n();return}if(e===!1)return;let r=new pn({next:()=>{r.unsubscribe(),n()}});return fe(e(...t)).subscribe(r)}function _o(n,e,t){let r,i=!1;return n&&typeof n=="object"?{bufferSize:r=1/0,windowTime:e=1/0,refCount:i=!1,scheduler:t}=n:r=n??1/0,mo({connector:()=>new ho(r,e,t),resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:i})}function Id(n){return q((e,t)=>{let r=!1,i=0;e.subscribe(K(t,o=>(r||(r=!n(o,i++)))&&t.next(o)))})}function yo(...n){let e=On(n);return q((t,r)=>{(e?Dd(n,t,e):Dd(n,t)).subscribe(r)})}function Le(n,e){return q((t,r)=>{let i=null,o=0,s=!1,a=()=>s&&!i&&r.complete();t.subscribe(K(r,l=>{i?.unsubscribe();let c=0,u=o++;fe(n(l,u)).subscribe(i=K(r,d=>r.next(e?e(l,d,u,c++):d),()=>{i=null,a()}))},()=>{s=!0,a()}))})}function Ga(n,e){return U(e)?Le(()=>n,e):Le(()=>n)}function mr(n){return q((e,t)=>{fe(n).subscribe(K(t,()=>t.complete(),dr)),!t.closed&&e.subscribe(t)})}function Sd(n,e,t){let r=U(n)||e||t?{next:n,error:e,complete:t}:n;return r?q((i,o)=>{var s;(s=r.subscribe)===null||s===void 0||s.call(r);let a=!0;i.subscribe(K(o,l=>{var c;(c=r.next)===null||c===void 0||c.call(r,l),o.next(l)},()=>{var l;a=!1,(l=r.complete)===null||l===void 0||l.call(r),o.complete()},l=>{var c;a=!1,(c=r.error)===null||c===void 0||c.call(r,l),o.error(l)},()=>{var l,c;a&&((l=r.unsubscribe)===null||l===void 0||l.call(r)),(c=r.finalize)===null||c===void 0||c.call(r)}))}):ft}function Td(...n){let e=xa(n);return q((t,r)=>{let i=n.length,o=new Array(i),s=n.map(()=>!1),a=!1;for(let l=0;l<i;l++)fe(n[l]).subscribe(K(r,c=>{o[l]=c,!a&&!s[l]&&(s[l]=!0,(a=s.every(ft))&&(s=null))},dr));t.subscribe(K(r,l=>{if(a){let c=[l,...o];r.next(e?e(...c):c)}}))})}var kS="https://angular.dev/best-practices/security#preventing-cross-site-scripting-xss",v=class extends Error{code;constructor(e,t){super(OS(e,t)),this.code=e}};function PS(n){return`NG0${Math.abs(n)}`}function OS(n,e){return`${PS(n)}${e?": "+e:""}`}function Ro(n){return{toString:n}.toString()}var qa="__parameters__";function FS(n){return function(...t){if(n){let r=n(...t);for(let i in r)this[i]=r[i]}}}function LS(n,e,t){return Ro(()=>{let r=FS(e);function i(...o){if(this instanceof i)return r.apply(this,o),this;let s=new i(...o);return a.annotation=s,a;function a(l,c,u){let d=l.hasOwnProperty(qa)?l[qa]:Object.defineProperty(l,qa,{value:[]})[qa];for(;d.length<=u;)d.push(null);return(d[u]=d[u]||[]).push(s),l}}return i.prototype.ngMetadataName=n,i.annotationCls=i,i})}var Hn=globalThis;function he(n){for(let e in n)if(n[e]===he)return e;throw Error("Could not find renamed property on target object.")}function VS(n,e){for(let t in e)e.hasOwnProperty(t)&&!n.hasOwnProperty(t)&&(n[t]=e[t])}function _t(n){if(typeof n=="string")return n;if(Array.isArray(n))return`[${n.map(_t).join(", ")}]`;if(n==null)return""+n;let e=n.overriddenName||n.name;if(e)return`${e}`;let t=n.toString();if(t==null)return""+t;let r=t.indexOf(`
`);return r>=0?t.slice(0,r):t}function ey(n,e){return n?e?`${n} ${e}`:n:e||""}var jS=he({__forward_ref__:he});function Un(n){return n.__forward_ref__=Un,n.toString=function(){return _t(this())},n}function He(n){return jy(n)?n():n}function jy(n){return typeof n=="function"&&n.hasOwnProperty(jS)&&n.__forward_ref__===Un}function I(n){return{token:n.token,providedIn:n.providedIn||null,factory:n.factory,value:void 0}}function we(n){return{providers:n.providers||[],imports:n.imports||[]}}function Rf(n){return ty(n,By)||ty(n,Hy)}function ty(n,e){return n.hasOwnProperty(e)?n[e]:null}function BS(n){let e=n&&(n[By]||n[Hy]);return e||null}function ny(n){return n&&(n.hasOwnProperty(ry)||n.hasOwnProperty(HS))?n[ry]:null}var By=he({\u0275prov:he}),ry=he({\u0275inj:he}),Hy=he({ngInjectableDef:he}),HS=he({ngInjectorDef:he}),E=class{_desc;ngMetadataName="InjectionToken";\u0275prov;constructor(e,t){this._desc=e,this.\u0275prov=void 0,typeof t=="number"?this.__NG_ELEMENT_ID__=t:t!==void 0&&(this.\u0275prov=I({token:this,providedIn:t.providedIn||"root",factory:t.factory}))}get multi(){return this}toString(){return`InjectionToken ${this._desc}`}};function Uy(n){return n&&!!n.\u0275providers}var US=he({\u0275cmp:he}),$S=he({\u0275dir:he}),zS=he({\u0275pipe:he});var el=he({\u0275fac:he}),Co=he({__NG_ELEMENT_ID__:he}),iy=he({__NG_ENV_ID__:he});function kf(n){return typeof n=="string"?n:n==null?"":String(n)}function WS(n){return typeof n=="function"?n.name||n.toString():typeof n=="object"&&n!=null&&typeof n.type=="function"?n.type.name||n.type.toString():kf(n)}function $y(n,e){throw new v(-200,n)}function Pf(n,e){throw new v(-201,!1)}var $=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}($||{}),Ud;function zy(){return Ud}function gt(n){let e=Ud;return Ud=n,e}function Wy(n,e,t){let r=Rf(n);if(r&&r.providedIn=="root")return r.value===void 0?r.value=r.factory():r.value;if(t&$.Optional)return null;if(e!==void 0)return e;Pf(n,"Injector")}var GS={},_r=GS,$d="__NG_DI_FLAG__",tl=class{injector;constructor(e){this.injector=e}retrieve(e,t){let r=t;return this.injector.get(e,r.optional?ga:_r,r)}},nl="ngTempTokenPath",qS="ngTokenPath",KS=/\n/gm,QS="\u0275",oy="__source";function YS(n,e=$.Default){if(uo()===void 0)throw new v(-203,!1);if(uo()===null)return Wy(n,void 0,e);{let t=uo(),r;return t instanceof tl?r=t.injector:r=t,r.get(n,e&$.Optional?null:void 0,e)}}function w(n,e=$.Default){return(zy()||YS)(He(n),e)}function m(n,e=$.Default){return w(n,Il(e))}function Il(n){return typeof n>"u"||typeof n=="number"?n:0|(n.optional&&8)|(n.host&&1)|(n.self&&2)|(n.skipSelf&&4)}function zd(n){let e=[];for(let t=0;t<n.length;t++){let r=He(n[t]);if(Array.isArray(r)){if(r.length===0)throw new v(900,!1);let i,o=$.Default;for(let s=0;s<r.length;s++){let a=r[s],l=XS(a);typeof l=="number"?l===-1?i=a.token:o|=l:i=a}e.push(w(i,o))}else e.push(w(r))}return e}function ZS(n,e){return n[$d]=e,n.prototype[$d]=e,n}function XS(n){return n[$d]}function JS(n,e,t,r){let i=n[nl];throw e[oy]&&i.unshift(e[oy]),n.message=eT(`
`+n.message,i,t,r),n[qS]=i,n[nl]=null,n}function eT(n,e,t,r=null){n=n&&n.charAt(0)===`
`&&n.charAt(1)==QS?n.slice(2):n;let i=_t(e);if(Array.isArray(e))i=e.map(_t).join(" -> ");else if(typeof e=="object"){let o=[];for(let s in e)if(e.hasOwnProperty(s)){let a=e[s];o.push(s+":"+(typeof a=="string"?JSON.stringify(a):_t(a)))}i=`{${o.join(", ")}}`}return`${t}${r?"("+r+")":""}[${i}]: ${n.replace(KS,`
`)}`}var Of=ZS(LS("Optional"),8);function si(n,e){let t=n.hasOwnProperty(el);return t?n[el]:null}function Ff(n,e){n.forEach(t=>Array.isArray(t)?Ff(t,e):e(t))}function Gy(n,e,t){e>=n.length?n.push(t):n.splice(e,0,t)}function rl(n,e){return e>=n.length-1?n.pop():n.splice(e,1)[0]}function tT(n,e,t,r){let i=n.length;if(i==e)n.push(t,r);else if(i===1)n.push(r,n[0]),n[0]=t;else{for(i--,n.push(n[i-1],n[i]);i>e;){let o=i-2;n[i]=n[o],i--}n[e]=t,n[e+1]=r}}function nT(n,e,t){let r=ko(n,e);return r>=0?n[r|1]=t:(r=~r,tT(n,r,e,t)),r}function Md(n,e){let t=ko(n,e);if(t>=0)return n[t|1]}function ko(n,e){return rT(n,e,1)}function rT(n,e,t){let r=0,i=n.length>>t;for(;i!==r;){let o=r+(i-r>>1),s=n[o<<t];if(e===s)return o<<t;s>e?i=o:r=o+1}return~(i<<t)}var vr={},mt=[],il=new E(""),qy=new E("",-1),Ky=new E(""),ol=class{get(e,t=_r){if(t===_r){let r=new Error(`NullInjectorError: No provider for ${_t(e)}!`);throw r.name="NullInjectorError",r}return t}};function ai(n){return n[US]||null}function iT(n){return n[$S]||null}function oT(n){return n[zS]||null}function Lf(...n){return{\u0275providers:Qy(!0,n),\u0275fromNgModule:!0}}function Qy(n,...e){let t=[],r=new Set,i,o=s=>{t.push(s)};return Ff(e,s=>{let a=s;Wd(a,o,[],r)&&(i||=[],i.push(a))}),i!==void 0&&Yy(i,o),t}function Yy(n,e){for(let t=0;t<n.length;t++){let{ngModule:r,providers:i}=n[t];Vf(i,o=>{e(o,r)})}}function Wd(n,e,t,r){if(n=He(n),!n)return!1;let i=null,o=ny(n),s=!o&&ai(n);if(!o&&!s){let l=n.ngModule;if(o=ny(l),o)i=l;else return!1}else{if(s&&!s.standalone)return!1;i=n}let a=r.has(i);if(s){if(a)return!1;if(r.add(i),s.dependencies){let l=typeof s.dependencies=="function"?s.dependencies():s.dependencies;for(let c of l)Wd(c,e,t,r)}}else if(o){if(o.imports!=null&&!a){r.add(i);let c;try{Ff(o.imports,u=>{Wd(u,e,t,r)&&(c||=[],c.push(u))})}finally{}c!==void 0&&Yy(c,e)}if(!a){let c=si(i)||(()=>new i);e({provide:i,useFactory:c,deps:mt},i),e({provide:Ky,useValue:i,multi:!0},i),e({provide:il,useValue:()=>w(i),multi:!0},i)}let l=o.providers;if(l!=null&&!a){let c=n;Vf(l,u=>{e(u,c)})}}else return!1;return i!==n&&n.providers!==void 0}function Vf(n,e){for(let t of n)Uy(t)&&(t=t.\u0275providers),Array.isArray(t)?Vf(t,e):e(t)}var sT=he({provide:String,useValue:he});function Zy(n){return n!==null&&typeof n=="object"&&sT in n}function aT(n){return!!(n&&n.useExisting)}function lT(n){return!!(n&&n.useFactory)}function li(n){return typeof n=="function"}function cT(n){return!!n.useClass}var Sl=new E(""),Qa={},sy={},xd;function Tl(){return xd===void 0&&(xd=new ol),xd}var $e=class{},Eo=class extends $e{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,qd(e,s=>this.processProvider(s)),this.records.set(qy,ei(void 0,this)),i.has("environment")&&this.records.set($e,ei(void 0,this));let o=this.records.get(Sl);o!=null&&typeof o.value=="string"&&this.scopes.add(o.value),this.injectorDefTypes=new Set(this.get(Ky,mt,$.Self))}retrieve(e,t){let r=t;return this.get(e,r.optional?ga:_r,r)}destroy(){Do(this),this._destroyed=!0;let e=F(null);try{for(let r of this._ngOnDestroyHooks)r.ngOnDestroy();let t=this._onDestroyHooks;this._onDestroyHooks=[];for(let r of t)r()}finally{this.records.clear(),this._ngOnDestroyHooks.clear(),this.injectorDefTypes.clear(),F(e)}}onDestroy(e){return Do(this),this._onDestroyHooks.push(e),()=>this.removeOnDestroy(e)}runInContext(e){Do(this);let t=hn(this),r=gt(void 0),i;try{return e()}finally{hn(t),gt(r)}}get(e,t=_r,r=$.Default){if(Do(this),e.hasOwnProperty(iy))return e[iy](this);r=Il(r);let i,o=hn(this),s=gt(void 0);try{if(!(r&$.SkipSelf)){let l=this.records.get(e);if(l===void 0){let c=pT(e)&&Rf(e);c&&this.injectableDefInScope(c)?l=ei(Gd(e),Qa):l=null,this.records.set(e,l)}if(l!=null)return this.hydrate(e,l,r)}let a=r&$.Self?Tl():this.parent;return t=r&$.Optional&&t===_r?null:t,a.get(e,t)}catch(a){if(a.name==="NullInjectorError"){if((a[nl]=a[nl]||[]).unshift(_t(e)),o)throw a;return JS(a,e,"R3InjectorError",this.source)}else throw a}finally{gt(s),hn(o)}}resolveInjectorInitializers(){let e=F(null),t=hn(this),r=gt(void 0),i;try{let o=this.get(il,mt,$.Self);for(let s of o)s()}finally{hn(t),gt(r),F(e)}}toString(){let e=[],t=this.records;for(let r of t.keys())e.push(_t(r));return`R3Injector[${e.join(", ")}]`}processProvider(e){e=He(e);let t=li(e)?e:He(e&&e.provide),r=dT(e);if(!li(e)&&e.multi===!0){let i=this.records.get(t);i||(i=ei(void 0,Qa,!0),i.factory=()=>zd(i.multi),this.records.set(t,i)),t=e,i.multi.push(e)}this.records.set(t,r)}hydrate(e,t,r){let i=F(null);try{return t.value===sy?$y(_t(e)):t.value===Qa&&(t.value=sy,t.value=t.factory(void 0,r)),typeof t.value=="object"&&t.value&&hT(t.value)&&this._ngOnDestroyHooks.add(t.value),t.value}finally{F(i)}}injectableDefInScope(e){if(!e.providedIn)return!1;let t=He(e.providedIn);return typeof t=="string"?t==="any"||this.scopes.has(t):this.injectorDefTypes.has(t)}removeOnDestroy(e){let t=this._onDestroyHooks.indexOf(e);t!==-1&&this._onDestroyHooks.splice(t,1)}};function Gd(n){let e=Rf(n),t=e!==null?e.factory:si(n);if(t!==null)return t;if(n instanceof E)throw new v(204,!1);if(n instanceof Function)return uT(n);throw new v(204,!1)}function uT(n){if(n.length>0)throw new v(204,!1);let t=BS(n);return t!==null?()=>t.factory(n):()=>new n}function dT(n){if(Zy(n))return ei(void 0,n.useValue);{let e=Xy(n);return ei(e,Qa)}}function Xy(n,e,t){let r;if(li(n)){let i=He(n);return si(i)||Gd(i)}else if(Zy(n))r=()=>He(n.useValue);else if(lT(n))r=()=>n.useFactory(...zd(n.deps||[]));else if(aT(n))r=(i,o)=>w(He(n.useExisting),o!==void 0&&o&$.Optional?$.Optional:void 0);else{let i=He(n&&(n.useClass||n.provide));if(fT(n))r=()=>new i(...zd(n.deps));else return si(i)||Gd(i)}return r}function Do(n){if(n.destroyed)throw new v(205,!1)}function ei(n,e,t=!1){return{factory:n,value:e,multi:t?[]:void 0}}function fT(n){return!!n.deps}function hT(n){return n!==null&&typeof n=="object"&&typeof n.ngOnDestroy=="function"}function pT(n){return typeof n=="function"||typeof n=="object"&&n instanceof E}function qd(n,e){for(let t of n)Array.isArray(t)?qd(t,e):t&&Uy(t)?qd(t.\u0275providers,e):e(t)}function gi(n,e){let t;n instanceof Eo?(Do(n),t=n):t=new tl(n);let r,i=hn(t),o=gt(void 0);try{return e()}finally{hn(i),gt(o)}}function jf(){return zy()!==void 0||uo()!=null}function Bf(n){if(!jf())throw new v(-203,!1)}function gT(n){return typeof n=="function"}var mn=0,z=1,N=2,ze=3,At=4,Rt=5,bo=6,sl=7,Se=8,ci=9,Vn=10,Te=11,Io=12,ay=13,mi=14,Nt=15,ui=16,ti=17,di=18,Ml=19,Jy=20,Fn=21,Ad=22,al=23,yt=24,ii=25,vt=26,ev=1;var Dr=7,ll=8,cl=9,Ue=10;function Ln(n){return Array.isArray(n)&&typeof n[ev]=="object"}function _n(n){return Array.isArray(n)&&n[ev]===!0}function tv(n){return(n.flags&4)!==0}function _i(n){return n.componentOffset>-1}function Hf(n){return(n.flags&1)===1}function qt(n){return!!n.template}function ul(n){return(n[N]&512)!==0}function yi(n){return(n[N]&256)===256}var Kd=class{previousValue;currentValue;firstChange;constructor(e,t,r){this.previousValue=e,this.currentValue=t,this.firstChange=r}isFirstChange(){return this.firstChange}};function nv(n,e,t,r){e!==null?e.applyValueToInputSignal(e,r):n[t]=r}var vi=(()=>{let n=()=>rv;return n.ngInherit=!0,n})();function rv(n){return n.type.prototype.ngOnChanges&&(n.setInput=_T),mT}function mT(){let n=ov(this),e=n?.current;if(e){let t=n.previous;if(t===vr)n.previous=e;else for(let r in e)t[r]=e[r];n.current=null,this.ngOnChanges(e)}}function _T(n,e,t,r,i){let o=this.declaredInputs[r],s=ov(n)||yT(n,{previous:vr,current:null}),a=s.current||(s.current={}),l=s.previous,c=l[o];a[o]=new Kd(c&&c.currentValue,t,l===vr),nv(n,e,i,t)}var iv="__ngSimpleChanges__";function ov(n){return n[iv]||null}function yT(n,e){return n[iv]=e}var ly=null;var re=function(n,e=null,t){ly?.(n,e,t)},vT="svg",DT="math";function Kt(n){for(;Array.isArray(n);)n=n[mn];return n}function sv(n,e){return Kt(e[n])}function Xt(n,e){return Kt(e[n.index])}function Uf(n,e){return n.data[e]}function Qt(n,e){let t=e[n];return Ln(t)?t:t[mn]}function $f(n){return(n[N]&128)===128}function wT(n){return _n(n[ze])}function fi(n,e){return e==null?null:n[e]}function av(n){n[ti]=0}function lv(n){n[N]&1024||(n[N]|=1024,$f(n)&&Po(n))}function CT(n,e){for(;n>0;)e=e[mi],n--;return e}function xl(n){return!!(n[N]&9216||n[yt]?.dirty)}function Qd(n){n[Vn].changeDetectionScheduler?.notify(8),n[N]&64&&(n[N]|=1024),xl(n)&&Po(n)}function Po(n){n[Vn].changeDetectionScheduler?.notify(0);let e=wr(n);for(;e!==null&&!(e[N]&8192||(e[N]|=8192,!$f(e)));)e=wr(e)}function cv(n,e){if(yi(n))throw new v(911,!1);n[Fn]===null&&(n[Fn]=[]),n[Fn].push(e)}function ET(n,e){if(n[Fn]===null)return;let t=n[Fn].indexOf(e);t!==-1&&n[Fn].splice(t,1)}function wr(n){let e=n[ze];return _n(e)?e[ze]:e}function uv(n){return n[sl]??=[]}function dv(n){return n.cleanup??=[]}var Q={lFrame:vv(null),bindingsEnabled:!0,skipHydrationRootTNode:null};var Yd=!1;function bT(){return Q.lFrame.elementDepthCount}function IT(){Q.lFrame.elementDepthCount++}function ST(){Q.lFrame.elementDepthCount--}function fv(){return Q.bindingsEnabled}function TT(){return Q.skipHydrationRootTNode!==null}function MT(n){return Q.skipHydrationRootTNode===n}function xT(){Q.skipHydrationRootTNode=null}function se(){return Q.lFrame.lView}function et(){return Q.lFrame.tView}function Y(n){return Q.lFrame.contextLView=n,n[Se]}function Z(n){return Q.lFrame.contextLView=null,n}function Dt(){let n=hv();for(;n!==null&&n.type===64;)n=n.parent;return n}function hv(){return Q.lFrame.currentTNode}function AT(){let n=Q.lFrame,e=n.currentTNode;return n.isParent?e:e.parent}function Oo(n,e){let t=Q.lFrame;t.currentTNode=n,t.isParent=e}function pv(){return Q.lFrame.isParent}function NT(){Q.lFrame.isParent=!1}function gv(){return Yd}function cy(n){let e=Yd;return Yd=n,e}function RT(n){return Q.lFrame.bindingIndex=n}function Di(){return Q.lFrame.bindingIndex++}function kT(n){let e=Q.lFrame,t=e.bindingIndex;return e.bindingIndex=e.bindingIndex+n,t}function PT(){return Q.lFrame.inI18n}function OT(n,e){let t=Q.lFrame;t.bindingIndex=t.bindingRootIndex=n,Zd(e)}function FT(){return Q.lFrame.currentDirectiveIndex}function Zd(n){Q.lFrame.currentDirectiveIndex=n}function LT(n){let e=Q.lFrame.currentDirectiveIndex;return e===-1?null:n[e]}function mv(n){Q.lFrame.currentQueryIndex=n}function VT(n){let e=n[z];return e.type===2?e.declTNode:e.type===1?n[Rt]:null}function _v(n,e,t){if(t&$.SkipSelf){let i=e,o=n;for(;i=i.parent,i===null&&!(t&$.Host);)if(i=VT(o),i===null||(o=o[mi],i.type&10))break;if(i===null)return!1;e=i,n=o}let r=Q.lFrame=yv();return r.currentTNode=e,r.lView=n,!0}function zf(n){let e=yv(),t=n[z];Q.lFrame=e,e.currentTNode=t.firstChild,e.lView=n,e.tView=t,e.contextLView=n,e.bindingIndex=t.bindingStartIndex,e.inI18n=!1}function yv(){let n=Q.lFrame,e=n===null?null:n.child;return e===null?vv(n):e}function vv(n){let 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 n!==null&&(n.child=e),e}function Dv(){let n=Q.lFrame;return Q.lFrame=n.parent,n.currentTNode=null,n.lView=null,n}var wv=Dv;function Wf(){let n=Dv();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 jT(n){return(Q.lFrame.contextLView=CT(n,Q.lFrame.contextLView))[Se]}function Sr(){return Q.lFrame.selectedIndex}function Cr(n){Q.lFrame.selectedIndex=n}function Gf(){let n=Q.lFrame;return Uf(n.tView,n.selectedIndex)}function BT(){return Q.lFrame.currentNamespace}var Cv=!0;function qf(){return Cv}function Kf(n){Cv=n}function HT(n,e,t){let{ngOnChanges:r,ngOnInit:i,ngDoCheck:o}=e.type.prototype;if(r){let s=rv(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))}function Ev(n,e){for(let t=e.directiveStart,r=e.directiveEnd;t<r;t++){let o=n.data[t].type.prototype,{ngAfterContentInit:s,ngAfterContentChecked:a,ngAfterViewInit:l,ngAfterViewChecked:c,ngOnDestroy:u}=o;s&&(n.contentHooks??=[]).push(-t,s),a&&((n.contentHooks??=[]).push(t,a),(n.contentCheckHooks??=[]).push(t,a)),l&&(n.viewHooks??=[]).push(-t,l),c&&((n.viewHooks??=[]).push(t,c),(n.viewCheckHooks??=[]).push(t,c)),u!=null&&(n.destroyHooks??=[]).push(t,u)}}function Ya(n,e,t){bv(n,e,3,t)}function Za(n,e,t,r){(n[N]&3)===t&&bv(n,e,t,r)}function Nd(n,e){let t=n[N];(t&3)===e&&(t&=16383,t+=1,n[N]=t)}function bv(n,e,t,r){let i=r!==void 0?n[ti]&65535:0,o=r??-1,s=e.length-1,a=0;for(let l=i;l<s;l++)if(typeof e[l+1]=="number"){if(a=e[l],r!=null&&a>=r)break}else e[l]<0&&(n[ti]+=65536),(a<o||o==-1)&&(UT(n,t,e,l),n[ti]=(n[ti]&4294901760)+l+2),l++}function uy(n,e){re(4,n,e);let t=F(null);try{e.call(n)}finally{F(t),re(5,n,e)}}function UT(n,e,t,r){let i=t[r]<0,o=t[r+1],s=i?-t[r]:t[r],a=n[s];i?n[N]>>14<n[ti]>>16&&(n[N]&3)===e&&(n[N]+=16384,uy(a,o)):uy(a,o)}var oi=-1,Er=class{factory;injectImpl;resolving=!1;canSeeViewProviders;multi;componentProviders;index;providerFactory;constructor(e,t,r){this.factory=e,this.canSeeViewProviders=t,this.injectImpl=r}};function $T(n){return(n.flags&8)!==0}function zT(n){return(n.flags&16)!==0}function WT(n,e,t){let r=0;for(;r<t.length;){let i=t[r];if(typeof i=="number"){if(i!==0)break;r++;let o=t[r++],s=t[r++],a=t[r++];n.setAttribute(e,s,a,o)}else{let o=i,s=t[++r];qT(o)?n.setProperty(e,o,s):n.setAttribute(e,o,s),r++}}return r}function GT(n){return n===3||n===4||n===6}function qT(n){return n.charCodeAt(0)===64}function So(n,e){if(!(e===null||e.length===0))if(n===null||n.length===0)n=e.slice();else{let t=-1;for(let r=0;r<e.length;r++){let i=e[r];typeof i=="number"?t=i:t===0||(t===-1||t===2?dy(n,t,i,null,e[++r]):dy(n,t,i,null,null))}}return n}function dy(n,e,t,r,i){let o=0,s=n.length;if(e===-1)s=-1;else for(;o<n.length;){let a=n[o++];if(typeof a=="number"){if(a===e){s=-1;break}else if(a>e){s=o-1;break}}}for(;o<n.length;){let a=n[o];if(typeof a=="number")break;if(a===t){i!==null&&(n[o+1]=i);return}o++,i!==null&&o++}s!==-1&&(n.splice(s,0,e),o=s+1),n.splice(o++,0,t),i!==null&&n.splice(o++,0,i)}function Iv(n){return n!==oi}function dl(n){return n&32767}function KT(n){return n>>16}function fl(n,e){let t=KT(n),r=e;for(;t>0;)r=r[mi],t--;return r}var Xd=!0;function fy(n){let e=Xd;return Xd=n,e}var QT=256,Sv=QT-1,Tv=5,YT=0,Gt={};function ZT(n,e,t){let r;typeof t=="string"?r=t.charCodeAt(0)||0:t.hasOwnProperty(Co)&&(r=t[Co]),r==null&&(r=t[Co]=YT++);let i=r&Sv,o=1<<i;e.data[n+(i>>Tv)]|=o}function hl(n,e){let t=Mv(n,e);if(t!==-1)return t;let r=e[z];r.firstCreatePass&&(n.injectorIndex=e.length,Rd(r.data,n),Rd(e,null),Rd(r.blueprint,null));let i=Qf(n,e),o=n.injectorIndex;if(Iv(i)){let s=dl(i),a=fl(i,e),l=a[z].data;for(let c=0;c<8;c++)e[o+c]=a[s+c]|l[s+c]}return e[o+8]=i,o}function Rd(n,e){n.push(0,0,0,0,0,0,0,0,e)}function Mv(n,e){return n.injectorIndex===-1||n.parent&&n.parent.injectorIndex===n.injectorIndex||e[n.injectorIndex+8]===null?-1:n.injectorIndex}function Qf(n,e){if(n.parent&&n.parent.injectorIndex!==-1)return n.parent.injectorIndex;let t=0,r=null,i=e;for(;i!==null;){if(r=kv(i),r===null)return oi;if(t++,i=i[mi],r.injectorIndex!==-1)return r.injectorIndex|t<<16}return oi}function Jd(n,e,t){ZT(n,e,t)}function xv(n,e,t){if(t&$.Optional||n!==void 0)return n;Pf(e,"NodeInjector")}function Av(n,e,t,r){if(t&$.Optional&&r===void 0&&(r=null),(t&($.Self|$.Host))===0){let i=n[ci],o=gt(void 0);try{return i?i.get(e,r,t&$.Optional):Wy(e,r,t&$.Optional)}finally{gt(o)}}return xv(r,e,t)}function Nv(n,e,t,r=$.Default,i){if(n!==null){if(e[N]&2048&&!(r&$.Self)){let s=n0(n,e,t,r,Gt);if(s!==Gt)return s}let o=Rv(n,e,t,r,Gt);if(o!==Gt)return o}return Av(e,t,r,i)}function Rv(n,e,t,r,i){let o=e0(t);if(typeof o=="function"){if(!_v(e,n,r))return r&$.Host?xv(i,t,r):Av(e,t,r,i);try{let s;if(s=o(r),s==null&&!(r&$.Optional))Pf(t);else return s}finally{wv()}}else if(typeof o=="number"){let s=null,a=Mv(n,e),l=oi,c=r&$.Host?e[Nt][Rt]:null;for((a===-1||r&$.SkipSelf)&&(l=a===-1?Qf(n,e):e[a+8],l===oi||!py(r,!1)?a=-1:(s=e[z],a=dl(l),e=fl(l,e)));a!==-1;){let u=e[z];if(hy(o,a,u.data)){let d=XT(a,e,t,s,r,c);if(d!==Gt)return d}l=e[a+8],l!==oi&&py(r,e[z].data[a+8]===c)&&hy(o,a,e)?(s=u,a=dl(l),e=fl(l,e)):a=-1}}return i}function XT(n,e,t,r,i,o){let s=e[z],a=s.data[n+8],l=r==null?_i(a)&&Xd:r!=s&&(a.type&3)!==0,c=i&$.Host&&o===a,u=JT(a,s,t,l,c);return u!==null?pl(e,s,u,a,i):Gt}function JT(n,e,t,r,i){let o=n.providerIndexes,s=e.data,a=o&1048575,l=n.directiveStart,c=n.directiveEnd,u=o>>20,d=r?a:a+u,f=i?a+u:c;for(let h=d;h<f;h++){let p=s[h];if(h<l&&t===p||h>=l&&p.type===t)return h}if(i){let h=s[l];if(h&&qt(h)&&h.type===t)return l}return null}function pl(n,e,t,r,i){let o=n[t],s=e.data;if(o instanceof Er){let a=o;a.resolving&&$y(WS(s[t]));let l=fy(a.canSeeViewProviders);a.resolving=!0;let c,u=a.injectImpl?gt(a.injectImpl):null,d=_v(n,r,$.Default);try{o=n[t]=a.factory(void 0,i,s,n,r),e.firstCreatePass&&t>=r.directiveStart&&HT(t,s[t],e)}finally{u!==null&&gt(u),fy(l),a.resolving=!1,wv()}}return o}function e0(n){if(typeof n=="string")return n.charCodeAt(0)||0;let e=n.hasOwnProperty(Co)?n[Co]:void 0;return typeof e=="number"?e>=0?e&Sv:t0:e}function hy(n,e,t){let r=1<<n;return!!(t[e+(n>>Tv)]&r)}function py(n,e){return!(n&$.Self)&&!(n&$.Host&&e)}var yr=class{_tNode;_lView;constructor(e,t){this._tNode=e,this._lView=t}get(e,t,r){return Nv(this._tNode,this._lView,e,Il(r),t)}};function t0(){return new yr(Dt(),se())}function Yf(n){return Ro(()=>{let e=n.prototype.constructor,t=e[el]||ef(e),r=Object.prototype,i=Object.getPrototypeOf(n.prototype).constructor;for(;i&&i!==r;){let o=i[el]||ef(i);if(o&&o!==t)return o;i=Object.getPrototypeOf(i)}return o=>new o})}function ef(n){return jy(n)?()=>{let e=ef(He(n));return e&&e()}:si(n)}function n0(n,e,t,r,i){let o=n,s=e;for(;o!==null&&s!==null&&s[N]&2048&&!ul(s);){let a=Rv(o,s,t,r|$.Self,Gt);if(a!==Gt)return a;let l=o.parent;if(!l){let c=s[Jy];if(c){let u=c.get(t,Gt,r);if(u!==Gt)return u}l=kv(s),s=s[mi]}o=l}return i}function kv(n){let e=n[z],t=e.type;return t===2?e.declTNode:t===1?n[Rt]:null}function gy(n,e=null,t=null,r){let i=r0(n,e,t,r);return i.resolveInjectorInitializers(),i}function r0(n,e=null,t=null,r,i=new Set){let o=[t||mt,Lf(n)];return r=r||(typeof n=="object"?void 0:_t(n)),new Eo(o,e||Tl(),r||null,i)}var Ve=class n{static THROW_IF_NOT_FOUND=_r;static NULL=new ol;static create(e,t){if(Array.isArray(e))return gy({name:""},t,e,"");{let r=e.name??"";return gy({name:r},e.parent,e.providers,r)}}static \u0275prov=I({token:n,providedIn:"any",factory:()=>w(qy)});static __NG_ELEMENT_ID__=-1};var i0=new E("");i0.__NG_ELEMENT_ID__=n=>{let e=Dt();if(e===null)throw new v(204,!1);if(e.type&2)return e.value;if(n&$.Optional)return null;throw new v(204,!1)};var Pv=!1,Fo=(()=>{class n{static __NG_ELEMENT_ID__=o0;static __NG_ENV_ID__=t=>t}return n})(),tf=class extends Fo{_lView;constructor(e){super(),this._lView=e}onDestroy(e){let t=this._lView;return yi(t)?(e(),()=>{}):(cv(t,e),()=>ET(t,e))}};function o0(){return new tf(se())}var br=class{},Ov=new E("",{providedIn:"root",factory:()=>!1});var Fv=new E(""),Lv=new E(""),Lo=(()=>{class n{taskId=0;pendingTasks=new Set;get _hasPendingTasks(){return this.hasPendingTasks.value}hasPendingTasks=new pr(!1);add(){this._hasPendingTasks||this.hasPendingTasks.next(!0);let t=this.taskId++;return this.pendingTasks.add(t),t}has(t){return this.pendingTasks.has(t)}remove(t){this.pendingTasks.delete(t),this.pendingTasks.size===0&&this._hasPendingTasks&&this.hasPendingTasks.next(!1)}ngOnDestroy(){this.pendingTasks.clear(),this._hasPendingTasks&&this.hasPendingTasks.next(!1)}static \u0275prov=I({token:n,providedIn:"root",factory:()=>new n})}return n})(),Zf=(()=>{class n{internalPendingTasks=m(Lo);scheduler=m(br);add(){let t=this.internalPendingTasks.add();return()=>{this.internalPendingTasks.has(t)&&(this.scheduler.notify(11),this.internalPendingTasks.remove(t))}}run(t){return Ne(this,null,function*(){let r=this.add();try{return yield t()}finally{r()}})}static \u0275prov=I({token:n,providedIn:"root",factory:()=>new n})}return n})(),nf=class extends L{__isAsync;destroyRef=void 0;pendingTasks=void 0;constructor(e=!1){super(),this.__isAsync=e,jf()&&(this.destroyRef=m(Fo,{optional:!0})??void 0,this.pendingTasks=m(Lo,{optional:!0})??void 0)}emit(e){let t=F(null);try{super.next(e)}finally{F(t)}}subscribe(e,t,r){let i=e,o=t||(()=>null),s=r;if(e&&typeof e=="object"){let 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)));let a=super.subscribe({next:i,error:o,complete:s});return e instanceof ce&&e.add(a),a}wrapInTimeout(e){return t=>{let r=this.pendingTasks?.add();setTimeout(()=>{try{e(t)}finally{r!==void 0&&this.pendingTasks?.remove(r)}})}}},ie=nf;function gl(...n){}function Vv(n){let e,t;function r(){n=gl;try{t!==void 0&&typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(t),e!==void 0&&clearTimeout(e)}catch{}}return e=setTimeout(()=>{n(),r()}),typeof requestAnimationFrame=="function"&&(t=requestAnimationFrame(()=>{n(),r()})),()=>r()}function my(n){return queueMicrotask(()=>n()),()=>{n=gl}}var Xf="isAngularZone",ml=Xf+"_ID",s0=0,k=class n{hasPendingMacrotasks=!1;hasPendingMicrotasks=!1;isStable=!0;onUnstable=new ie(!1);onMicrotaskEmpty=new ie(!1);onStable=new ie(!1);onError=new ie(!1);constructor(e){let{enableLongStackTrace:t=!1,shouldCoalesceEventChangeDetection:r=!1,shouldCoalesceRunChangeDetection:i=!1,scheduleInRootZone:o=Pv}=e;if(typeof Zone>"u")throw new v(908,!1);Zone.assertZonePatched();let 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,c0(s)}static isInAngularZone(){return typeof Zone<"u"&&Zone.current.get(Xf)===!0}static assertInAngularZone(){if(!n.isInAngularZone())throw new v(909,!1)}static assertNotInAngularZone(){if(n.isInAngularZone())throw new v(909,!1)}run(e,t,r){return this._inner.run(e,t,r)}runTask(e,t,r,i){let o=this._inner,s=o.scheduleEventTask("NgZoneEvent: "+i,e,a0,gl,gl);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)}},a0={};function Jf(n){if(n._nesting==0&&!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 l0(n){if(n.isCheckStableRunning||n.callbackScheduled)return;n.callbackScheduled=!0;function e(){Vv(()=>{n.callbackScheduled=!1,rf(n),n.isCheckStableRunning=!0,Jf(n),n.isCheckStableRunning=!1})}n.scheduleInRootZone?Zone.root.run(()=>{e()}):n._outer.run(()=>{e()}),rf(n)}function c0(n){let e=()=>{l0(n)},t=s0++;n._inner=n._inner.fork({name:"angular",properties:{[Xf]:!0,[ml]:t,[ml+t]:!0},onInvokeTask:(r,i,o,s,a,l)=>{if(u0(l))return r.invokeTask(o,s,a,l);try{return _y(n),r.invokeTask(o,s,a,l)}finally{(n.shouldCoalesceEventChangeDetection&&s.type==="eventTask"||n.shouldCoalesceRunChangeDetection)&&e(),yy(n)}},onInvoke:(r,i,o,s,a,l,c)=>{try{return _y(n),r.invoke(o,s,a,l,c)}finally{n.shouldCoalesceRunChangeDetection&&!n.callbackScheduled&&!d0(l)&&e(),yy(n)}},onHasTask:(r,i,o,s)=>{r.hasTask(o,s),i===o&&(s.change=="microTask"?(n._hasPendingMicrotasks=s.microTask,rf(n),Jf(n)):s.change=="macroTask"&&(n.hasPendingMacrotasks=s.macroTask))},onHandleError:(r,i,o,s)=>(r.handleError(o,s),n.runOutsideAngular(()=>n.onError.emit(s)),!1)})}function rf(n){n._hasPendingMicrotasks||(n.shouldCoalesceEventChangeDetection||n.shouldCoalesceRunChangeDetection)&&n.callbackScheduled===!0?n.hasPendingMicrotasks=!0:n.hasPendingMicrotasks=!1}function _y(n){n._nesting++,n.isStable&&(n.isStable=!1,n.onUnstable.emit(null))}function yy(n){n._nesting--,Jf(n)}var of=class{hasPendingMicrotasks=!1;hasPendingMacrotasks=!1;isStable=!0;onUnstable=new ie;onMicrotaskEmpty=new ie;onStable=new ie;onError=new ie;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 u0(n){return jv(n,"__ignore_ng_zone__")}function d0(n){return jv(n,"__scheduler_tick__")}function jv(n,e){return!Array.isArray(n)||n.length!==1?!1:n[0]?.data?.[e]===!0}var Yt=class{_console=console;handleError(e){this._console.error("ERROR",e)}},f0=new E("",{providedIn:"root",factory:()=>{let n=m(k),e=m(Yt);return t=>n.runOutsideAngular(()=>e.handleError(t))}});function h0(){return eh(Dt(),se())}function eh(n,e){return new kt(Xt(n,e))}var kt=(()=>{class n{nativeElement;constructor(t){this.nativeElement=t}static __NG_ELEMENT_ID__=h0}return n})();function p0(n){return typeof n=="function"&&n[Tt]!==void 0}function yn(n,e){let t=od(n,e?.equal),r=t[Tt];return t.set=i=>pa(r,i),t.update=i=>sd(r,i),t.asReadonly=g0.bind(t),t}function g0(){let n=this[Tt];if(n.readonlyFn===void 0){let e=()=>this();e[Tt]=n,n.readonlyFn=e}return n.readonlyFn}function Bv(n){return p0(n)&&typeof n.set=="function"}function Hv(n){return(n.flags&128)===128}var Uv=function(n){return n[n.OnPush=0]="OnPush",n[n.Default=1]="Default",n}(Uv||{}),$v=new Map,m0=0;function _0(){return m0++}function y0(n){$v.set(n[Ml],n)}function sf(n){$v.delete(n[Ml])}var vy="__ngContext__";function Vo(n,e){Ln(e)?(n[vy]=e[Ml],y0(e)):n[vy]=e}function zv(n){return Gv(n[Io])}function Wv(n){return Gv(n[At])}function Gv(n){for(;n!==null&&!_n(n);)n=n[At];return n}var af;function qv(n){af=n}function v0(){if(af!==void 0)return af;if(typeof document<"u")return document;throw new v(210,!1)}var jo=new E("",{providedIn:"root",factory:()=>D0}),D0="ng",th=new E(""),ot=new E("",{providedIn:"platform",factory:()=>"unknown"});var nh=new E(""),rh=new E("",{providedIn:"root",factory:()=>v0().body?.querySelector("[ngCspNonce]")?.getAttribute("ngCspNonce")||null});var w0="h",C0="b";var Kv=!1,E0=new E("",{providedIn:"root",factory:()=>Kv});var ih=function(n){return n[n.CHANGE_DETECTION=0]="CHANGE_DETECTION",n[n.AFTER_NEXT_RENDER=1]="AFTER_NEXT_RENDER",n}(ih||{}),wi=new E(""),Dy=new Set;function Bo(n){Dy.has(n)||(Dy.add(n),performance?.mark?.("mark_feature_usage",{detail:{feature:n}}))}var Qv=(()=>{class n{view;node;constructor(t,r){this.view=t,this.node=r}static __NG_ELEMENT_ID__=b0}return n})();function b0(){return new Qv(se(),Dt())}var ni=function(n){return n[n.EarlyRead=0]="EarlyRead",n[n.Write=1]="Write",n[n.MixedReadWrite=2]="MixedReadWrite",n[n.Read=3]="Read",n}(ni||{}),Yv=(()=>{class n{impl=null;execute(){this.impl?.execute()}static \u0275prov=I({token:n,providedIn:"root",factory:()=>new n})}return n})(),I0=[ni.EarlyRead,ni.Write,ni.MixedReadWrite,ni.Read],S0=(()=>{class n{ngZone=m(k);scheduler=m(br);errorHandler=m(Yt,{optional:!0});sequences=new Set;deferredRegistrations=new Set;executing=!1;constructor(){m(wi,{optional:!0})}execute(){let t=this.sequences.size>0;t&&re(16),this.executing=!0;for(let r of I0)for(let i of this.sequences)if(!(i.erroredOrDestroyed||!i.hooks[r]))try{i.pipelinedValue=this.ngZone.runOutsideAngular(()=>this.maybeTrace(()=>{let o=i.hooks[r];return o(i.pipelinedValue)},i.snapshot))}catch(o){i.erroredOrDestroyed=!0,this.errorHandler?.handleError(o)}this.executing=!1;for(let r of this.sequences)r.afterRun(),r.once&&(this.sequences.delete(r),r.destroy());for(let r of this.deferredRegistrations)this.sequences.add(r);this.deferredRegistrations.size>0&&this.scheduler.notify(7),this.deferredRegistrations.clear(),t&&re(17)}register(t){let{view:r}=t;r!==void 0?((r[ii]??=[]).push(t),Po(r),r[N]|=8192):this.executing?this.deferredRegistrations.add(t):this.addSequence(t)}addSequence(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(ih.AFTER_NEXT_RENDER,t):t()}static \u0275prov=I({token:n,providedIn:"root",factory:()=>new n})}return n})(),lf=class{impl;hooks;view;once;snapshot;erroredOrDestroyed=!1;pipelinedValue=void 0;unregisterOnDestroy;constructor(e,t,r,i,o,s=null){this.impl=e,this.hooks=t,this.view=r,this.once=i,this.snapshot=s,this.unregisterOnDestroy=o?.onDestroy(()=>this.destroy())}afterRun(){this.erroredOrDestroyed=!1,this.pipelinedValue=void 0,this.snapshot?.dispose(),this.snapshot=null}destroy(){this.impl.unregister(this),this.unregisterOnDestroy?.();let e=this.view?.[ii];e&&(this.view[ii]=e.filter(t=>t!==this))}};function Al(n,e){!e?.injector&&Bf(Al);let t=e?.injector??m(Ve);return Bo("NgAfterNextRender"),M0(n,t,e,!0)}function T0(n,e){if(n instanceof Function){let t=[void 0,void 0,void 0,void 0];return t[e]=n,t}else return[n.earlyRead,n.write,n.mixedReadWrite,n.read]}function M0(n,e,t,r){let i=e.get(Yv);i.impl??=e.get(S0);let o=e.get(wi,null,{optional:!0}),s=t?.phase??ni.MixedReadWrite,a=t?.manualCleanup!==!0?e.get(Fo):null,l=e.get(Qv,null,{optional:!0}),c=new lf(i.impl,T0(n,s),l?.view,r,a,o?.snapshot(null));return i.impl.register(c),c}var x0=(n,e,t,r)=>{};function A0(n,e,t,r){x0(n,e,t,r)}var N0=()=>null;function Zv(n,e,t=!1){return N0(n,e,t)}function Xv(n,e){let t=n.contentQueries;if(t!==null){let r=F(null);try{for(let i=0;i<t.length;i+=2){let o=t[i],s=t[i+1];if(s!==-1){let a=n.data[s];mv(o),a.contentQueries(2,e[s],s)}}}finally{F(r)}}}function cf(n,e,t){mv(0);let r=F(null);try{e(n,t)}finally{F(r)}}function Jv(n,e,t){if(tv(e)){let r=F(null);try{let i=e.directiveStart,o=e.directiveEnd;for(let s=i;s<o;s++){let a=n.data[s];if(a.contentQueries){let l=t[s];a.contentQueries(1,l,s)}}}finally{F(r)}}}var Zt=function(n){return n[n.Emulated=0]="Emulated",n[n.None=2]="None",n[n.ShadowDom=3]="ShadowDom",n}(Zt||{});var uf=class{changingThisBreaksApplicationSecurity;constructor(e){this.changingThisBreaksApplicationSecurity=e}toString(){return`SafeValue must use [property]=binding: ${this.changingThisBreaksApplicationSecurity} (see ${kS})`}};function R0(n){return n instanceof uf?n.changingThisBreaksApplicationSecurity:n}function k0(n,e){return n.createText(e)}function P0(n,e,t){n.setValue(e,t)}function eD(n,e,t){return n.createElement(e,t)}function _l(n,e,t,r,i){n.insertBefore(e,t,r,i)}function tD(n,e,t){n.appendChild(e,t)}function wy(n,e,t,r,i){r!==null?_l(n,e,t,r,i):tD(n,e,t)}function O0(n,e,t){n.removeChild(null,e,t)}function F0(n,e,t){n.setAttribute(e,"style",t)}function L0(n,e,t){t===""?n.removeAttribute(e,"class"):n.setAttribute(e,"class",t)}function nD(n,e,t){let{mergedAttrs:r,classes:i,styles:o}=t;r!==null&&WT(n,e,r),i!==null&&L0(n,e,i),o!==null&&F0(n,e,o)}function rD(n){return n.ownerDocument}function V0(n,e,t){let r=n.length;for(;;){let i=n.indexOf(e,t);if(i===-1)return i;if(i===0||n.charCodeAt(i-1)<=32){let o=e.length;if(i+o===r||n.charCodeAt(i+o)<=32)return i}t=i+1}}var iD="ng-template";function j0(n,e,t,r){let i=0;if(r){for(;i<e.length&&typeof e[i]=="string";i+=2)if(e[i]==="class"&&V0(e[i+1].toLowerCase(),t,0)!==-1)return!0}else if(oh(n))return!1;if(i=e.indexOf(1,i),i>-1){let o;for(;++i<e.length&&typeof(o=e[i])=="string";)if(o.toLowerCase()===t)return!0}return!1}function oh(n){return n.type===4&&n.value!==iD}function B0(n,e,t){let r=n.type===4&&!t?iD:n.value;return e===r}function H0(n,e,t){let r=4,i=n.attrs,o=i!==null?z0(i):0,s=!1;for(let a=0;a<e.length;a++){let l=e[a];if(typeof l=="number"){if(!s&&!xt(r)&&!xt(l))return!1;if(s&&xt(l))continue;s=!1,r=l|r&1;continue}if(!s)if(r&4){if(r=2|r&1,l!==""&&!B0(n,l,t)||l===""&&e.length===1){if(xt(r))return!1;s=!0}}else if(r&8){if(i===null||!j0(n,i,l,t)){if(xt(r))return!1;s=!0}}else{let c=e[++a],u=U0(l,i,oh(n),t);if(u===-1){if(xt(r))return!1;s=!0;continue}if(c!==""){let d;if(u>o?d="":d=i[u+1].toLowerCase(),r&2&&c!==d){if(xt(r))return!1;s=!0}}}}return xt(r)||s}function xt(n){return(n&1)===0}function U0(n,e,t,r){if(e===null)return-1;let i=0;if(r||!t){let o=!1;for(;i<e.length;){let s=e[i];if(s===n)return i;if(s===3||s===6)o=!0;else if(s===1||s===2){let a=e[++i];for(;typeof a=="string";)a=e[++i];continue}else{if(s===4)break;if(s===0){i+=4;continue}}i+=o?1:2}return-1}else return W0(e,n)}function $0(n,e,t=!1){for(let r=0;r<e.length;r++)if(H0(n,e[r],t))return!0;return!1}function z0(n){for(let e=0;e<n.length;e++){let t=n[e];if(GT(t))return e}return n.length}function W0(n,e){let t=n.indexOf(4);if(t>-1)for(t++;t<n.length;){let r=n[t];if(typeof r=="number")return-1;if(r===e)return t;t++}return-1}function Cy(n,e){return n?":not("+e.trim()+")":e}function G0(n){let e=n[0],t=1,r=2,i="",o=!1;for(;t<n.length;){let s=n[t];if(typeof s=="string")if(r&2){let a=n[++t];i+="["+s+(a.length>0?'="'+a+'"':"")+"]"}else r&8?i+="."+s:r&4&&(i+=" "+s);else i!==""&&!xt(s)&&(e+=Cy(o,i),i=""),r=s,o=o||!xt(r);t++}return i!==""&&(e+=Cy(o,i)),e}function q0(n){return n.map(G0).join(",")}function K0(n){let e=[],t=[],r=1,i=2;for(;r<n.length;){let o=n[r];if(typeof o=="string")i===2?o!==""&&e.push(o,n[++r]):i===8&&t.push(o);else{if(!xt(i))break;i=o}r++}return t.length&&e.push(1,...t),e}var Tr={};function sh(n,e,t,r,i,o,s,a,l,c,u){let d=vt+r,f=d+i,h=Q0(d,f),p=typeof c=="function"?c():c;return h[z]={type:n,blueprint:h,template:t,queries:null,viewQuery:a,declTNode:e,data:h.slice().fill(null,d),bindingStartIndex:d,expandoStartIndex:f,hostBindingOpCodes:null,firstCreatePass:!0,firstUpdatePass:!0,staticViewQueries:!1,staticContentQueries:!1,preOrderHooks:null,preOrderCheckHooks:null,contentHooks:null,contentCheckHooks:null,viewHooks:null,viewCheckHooks:null,destroyHooks:null,cleanup:null,contentQueries:null,components:null,directiveRegistry:typeof o=="function"?o():o,pipeRegistry:typeof s=="function"?s():s,firstChild:null,schemas:l,consts:p,incompleteFirstPass:!1,ssrId:u}}function Q0(n,e){let t=[];for(let r=0;r<e;r++)t.push(r<n?null:Tr);return t}function Y0(n){let e=n.tView;return e===null||e.incompleteFirstPass?n.tView=sh(1,null,n.template,n.decls,n.vars,n.directiveDefs,n.pipeDefs,n.viewQuery,n.schemas,n.consts,n.id):e}function ah(n,e,t,r,i,o,s,a,l,c,u){let d=e.blueprint.slice();return d[mn]=i,d[N]=r|4|128|8|64|1024,(c!==null||n&&n[N]&2048)&&(d[N]|=2048),av(d),d[ze]=d[mi]=n,d[Se]=t,d[Vn]=s||n&&n[Vn],d[Te]=a||n&&n[Te],d[ci]=l||n&&n[ci]||null,d[Rt]=o,d[Ml]=_0(),d[bo]=u,d[Jy]=c,d[Nt]=e.type==2?n[Nt]:d,d}function Z0(n,e,t){let r=Xt(e,n),i=Y0(t),o=n[Vn].rendererFactory,s=lh(n,ah(n,i,null,oD(t),r,e,null,o.createRenderer(r,t),null,null,null));return n[e.index]=s}function oD(n){let e=16;return n.signals?e=4096:n.onPush&&(e=64),e}function sD(n,e,t,r){if(t===0)return-1;let i=e.length;for(let o=0;o<t;o++)e.push(r),n.blueprint.push(r),n.data.push(null);return i}function lh(n,e){return n[Io]?n[ay][At]=e:n[Io]=e,n[ay]=e,e}function ne(n=1){aD(et(),se(),Sr()+n,!1)}function aD(n,e,t,r){if(!r)if((e[N]&3)===3){let o=n.preOrderCheckHooks;o!==null&&Ya(e,o,t)}else{let o=n.preOrderHooks;o!==null&&Za(e,o,0,t)}Cr(t)}var Nl=function(n){return n[n.None=0]="None",n[n.SignalBased=1]="SignalBased",n[n.HasDecoratorInputTransform=2]="HasDecoratorInputTransform",n}(Nl||{});function df(n,e,t,r){let i=F(null);try{let[o,s,a]=n.inputs[t],l=null;(s&Nl.SignalBased)!==0&&(l=e[o][Tt]),l!==null&&l.transformFn!==void 0?r=l.transformFn(r):a!==null&&(r=a.call(e,r)),n.setInput!==null?n.setInput(e,l,r,t,o):nv(e,l,o,r)}finally{F(i)}}function lD(n,e,t,r,i){let o=Sr(),s=r&2;try{Cr(-1),s&&e.length>vt&&aD(n,e,vt,!1),re(s?2:0,i),t(r,i)}finally{Cr(o),re(s?3:1,i)}}function ch(n,e,t){rM(n,e,t),(t.flags&64)===64&&iM(n,e,t)}function cD(n,e,t=Xt){let r=e.localNames;if(r!==null){let i=e.index+1;for(let o=0;o<r.length;o+=2){let s=r[o+1],a=s===-1?t(e,n):n[s];n[i++]=a}}}function X0(n,e,t,r){let o=r.get(E0,Kv)||t===Zt.ShadowDom,s=n.selectRootElement(e,o);return J0(s),s}function J0(n){eM(n)}var eM=()=>null;function tM(n){return n==="class"?"className":n==="for"?"htmlFor":n==="formaction"?"formAction":n==="innerHtml"?"innerHTML":n==="readonly"?"readOnly":n==="tabindex"?"tabIndex":n}function uD(n,e,t,r,i,o,s,a){if(!a&&uh(e,n,t,r,i)){_i(e)&&nM(t,e.index);return}if(e.type&3){let l=Xt(e,t);r=tM(r),i=s!=null?s(i,e.value||"",r):i,o.setProperty(l,r,i)}else e.type&12}function nM(n,e){let t=Qt(e,n);t[N]&16||(t[N]|=64)}function rM(n,e,t){let r=t.directiveStart,i=t.directiveEnd;_i(t)&&Z0(e,t,n.data[r+t.componentOffset]),n.firstCreatePass||hl(t,e);let o=t.initialInputs;for(let s=r;s<i;s++){let a=n.data[s],l=pl(e,n,s,t);if(Vo(l,e),o!==null&&lM(e,s-r,l,a,t,o),qt(a)){let c=Qt(t.index,e);c[Se]=pl(e,n,s,t)}}}function iM(n,e,t){let r=t.directiveStart,i=t.directiveEnd,o=t.index,s=FT();try{Cr(o);for(let a=r;a<i;a++){let l=n.data[a],c=e[a];Zd(a),(l.hostBindings!==null||l.hostVars!==0||l.hostAttrs!==null)&&oM(l,c)}}finally{Cr(-1),Zd(s)}}function oM(n,e){n.hostBindings!==null&&n.hostBindings(1,e)}function dD(n,e){let t=n.directiveRegistry,r=null;if(t)for(let i=0;i<t.length;i++){let o=t[i];$0(e,o.selectors,!1)&&(r??=[],qt(o)?r.unshift(o):r.push(o))}return r}function sM(n,e,t,r,i,o){let s=Xt(n,e);aM(e[Te],s,o,n.value,t,r,i)}function aM(n,e,t,r,i,o,s){if(o==null)n.removeAttribute(e,i,t);else{let a=s==null?kf(o):s(o,r||"",i);n.setAttribute(e,i,a,t)}}function lM(n,e,t,r,i,o){let s=o[e];if(s!==null)for(let a=0;a<s.length;a+=2){let l=s[a],c=s[a+1];df(r,t,l,c)}}function cM(n,e){let t=n[ci],r=t?t.get(Yt,null):null;r&&r.handleError(e)}function uh(n,e,t,r,i){let o=n.inputs?.[r],s=n.hostDirectiveInputs?.[r],a=!1;if(s)for(let l=0;l<s.length;l+=2){let c=s[l],u=s[l+1],d=e.data[c];df(d,t[c],u,i),a=!0}if(o)for(let l of o){let c=t[l],u=e.data[l];df(u,c,r,i),a=!0}return a}function uM(n,e){let t=Qt(e,n),r=t[z];dM(r,t);let i=t[mn];i!==null&&t[bo]===null&&(t[bo]=Zv(i,t[ci])),re(18),dh(r,t,t[Se]),re(19,t[Se])}function dM(n,e){for(let t=e.length;t<n.blueprint.length;t++)e.push(n.blueprint[t])}function dh(n,e,t){zf(e);try{let r=n.viewQuery;r!==null&&cf(1,r,t);let i=n.template;i!==null&&lD(n,e,i,1,t),n.firstCreatePass&&(n.firstCreatePass=!1),e[di]?.finishViewCreation(n),n.staticContentQueries&&Xv(n,e),n.staticViewQueries&&cf(2,n.viewQuery,t);let o=n.components;o!==null&&fM(e,o)}catch(r){throw n.firstCreatePass&&(n.incompleteFirstPass=!0,n.firstCreatePass=!1),r}finally{e[N]&=-5,Wf()}}function fM(n,e){for(let t=0;t<e.length;t++)uM(n,e[t])}function fh(n,e,t,r){let i=F(null);try{let o=e.tView,a=n[N]&4096?4096:16,l=ah(n,o,t,a,null,e,null,null,r?.injector??null,r?.embeddedViewInjector??null,r?.dehydratedView??null),c=n[e.index];l[ui]=c;let u=n[di];return u!==null&&(l[di]=u.createEmbeddedView(o)),dh(o,l,t),l}finally{F(i)}}function To(n,e){return!e||e.firstChild===null||Hv(n)}var hM;function hh(n,e){return hM(n,e)}var jn=function(n){return n[n.Important=1]="Important",n[n.DashCase=2]="DashCase",n}(jn||{});function fD(n){return(n.flags&32)===32}function ri(n,e,t,r,i){if(r!=null){let o,s=!1;_n(r)?o=r:Ln(r)&&(s=!0,r=r[mn]);let a=Kt(r);n===0&&t!==null?i==null?tD(e,t,a):_l(e,t,a,i||null,!0):n===1&&t!==null?_l(e,t,a,i||null,!0):n===2?O0(e,a,s):n===3&&e.destroyNode(a),o!=null&&IM(e,n,o,t,i)}}function pM(n,e){hD(n,e),e[mn]=null,e[Rt]=null}function gM(n,e,t,r,i,o){r[mn]=i,r[Rt]=e,kl(n,r,t,1,i,o)}function hD(n,e){e[Vn].changeDetectionScheduler?.notify(9),kl(n,e,e[Te],2,null,null)}function mM(n){let e=n[Io];if(!e)return kd(n[z],n);for(;e;){let t=null;if(Ln(e))t=e[Io];else{let r=e[Ue];r&&(t=r)}if(!t){for(;e&&!e[At]&&e!==n;)Ln(e)&&kd(e[z],e),e=e[ze];e===null&&(e=n),Ln(e)&&kd(e[z],e),t=e&&e[At]}e=t}}function ph(n,e){let t=n[cl],r=t.indexOf(e);t.splice(r,1)}function Rl(n,e){if(yi(e))return;let t=e[Te];t.destroyNode&&kl(n,e,t,3,null,null),mM(e)}function kd(n,e){if(yi(e))return;let t=F(null);try{e[N]&=-129,e[N]|=256,e[yt]&&nd(e[yt]),yM(n,e),_M(n,e),e[z].type===1&&e[Te].destroy();let r=e[ui];if(r!==null&&_n(e[ze])){r!==e[ze]&&ph(r,e);let i=e[di];i!==null&&i.detachView(n)}sf(e)}finally{F(t)}}function _M(n,e){let t=n.cleanup,r=e[sl];if(t!==null)for(let s=0;s<t.length-1;s+=2)if(typeof t[s]=="string"){let a=t[s+3];a>=0?r[a]():r[-a].unsubscribe(),s+=2}else{let a=r[t[s+1]];t[s].call(a)}r!==null&&(e[sl]=null);let i=e[Fn];if(i!==null){e[Fn]=null;for(let s=0;s<i.length;s++){let a=i[s];a()}}let o=e[al];if(o!==null){e[al]=null;for(let s of o)s.destroy()}}function yM(n,e){let t;if(n!=null&&(t=n.destroyHooks)!=null)for(let r=0;r<t.length;r+=2){let i=e[t[r]];if(!(i instanceof Er)){let o=t[r+1];if(Array.isArray(o))for(let s=0;s<o.length;s+=2){let a=i[o[s]],l=o[s+1];re(4,a,l);try{l.call(a)}finally{re(5,a,l)}}else{re(4,i,o);try{o.call(i)}finally{re(5,i,o)}}}}}function vM(n,e,t){return DM(n,e.parent,t)}function DM(n,e,t){let r=e;for(;r!==null&&r.type&168;)e=r,r=e.parent;if(r===null)return t[mn];if(_i(r)){let{encapsulation:i}=n.data[r.directiveStart+r.componentOffset];if(i===Zt.None||i===Zt.Emulated)return null}return Xt(r,t)}function wM(n,e,t){return EM(n,e,t)}function CM(n,e,t){return n.type&40?Xt(n,t):null}var EM=CM,Ey;function gh(n,e,t,r){let i=vM(n,r,e),o=e[Te],s=r.parent||e[Rt],a=wM(s,r,e);if(i!=null)if(Array.isArray(t))for(let l=0;l<t.length;l++)wy(o,i,t[l],a,!1);else wy(o,i,t,a,!1);Ey!==void 0&&Ey(o,r,e,t,i)}function wo(n,e){if(e!==null){let t=e.type;if(t&3)return Xt(e,n);if(t&4)return ff(-1,n[e.index]);if(t&8){let r=e.child;if(r!==null)return wo(n,r);{let i=n[e.index];return _n(i)?ff(-1,i):Kt(i)}}else{if(t&128)return wo(n,e.next);if(t&32)return hh(e,n)()||Kt(n[e.index]);{let r=pD(n,e);if(r!==null){if(Array.isArray(r))return r[0];let i=wr(n[Nt]);return wo(i,r)}else return wo(n,e.next)}}}return null}function pD(n,e){if(e!==null){let r=n[Nt][Rt],i=e.projection;return r.projection[i]}return null}function ff(n,e){let t=Ue+n+1;if(t<e.length){let r=e[t],i=r[z].firstChild;if(i!==null)return wo(r,i)}return e[Dr]}function mh(n,e,t,r,i,o,s){for(;t!=null;){if(t.type===128){t=t.next;continue}let a=r[t.index],l=t.type;if(s&&e===0&&(a&&Vo(Kt(a),r),t.flags|=2),!fD(t))if(l&8)mh(n,e,t.child,r,i,o,!1),ri(e,n,i,a,o);else if(l&32){let c=hh(t,r),u;for(;u=c();)ri(e,n,i,u,o);ri(e,n,i,a,o)}else l&16?bM(n,e,r,t,i,o):ri(e,n,i,a,o);t=s?t.projectionNext:t.next}}function kl(n,e,t,r,i,o){mh(t,r,n.firstChild,e,i,o,!1)}function bM(n,e,t,r,i,o){let s=t[Nt],l=s[Rt].projection[r.projection];if(Array.isArray(l))for(let c=0;c<l.length;c++){let u=l[c];ri(e,n,i,u,o)}else{let c=l,u=s[ze];Hv(r)&&(c.flags|=128),mh(n,e,c,u,i,o,!0)}}function IM(n,e,t,r,i){let o=t[Dr],s=Kt(t);o!==s&&ri(e,n,r,o,i);for(let a=Ue;a<t.length;a++){let l=t[a];kl(l[z],l,n,e,r,o)}}function SM(n,e,t,r,i){if(e)i?n.addClass(t,r):n.removeClass(t,r);else{let o=r.indexOf("-")===-1?void 0:jn.DashCase;i==null?n.removeStyle(t,r,o):(typeof i=="string"&&i.endsWith("!important")&&(i=i.slice(0,-10),o|=jn.Important),n.setStyle(t,r,i,o))}}function yl(n,e,t,r,i=!1){for(;t!==null;){if(t.type===128){t=i?t.projectionNext:t.next;continue}let o=e[t.index];o!==null&&r.push(Kt(o)),_n(o)&&TM(o,r);let s=t.type;if(s&8)yl(n,e,t.child,r);else if(s&32){let a=hh(t,e),l;for(;l=a();)r.push(l)}else if(s&16){let a=pD(e,t);if(Array.isArray(a))r.push(...a);else{let l=wr(e[Nt]);yl(l[z],l,a,r,!0)}}t=i?t.projectionNext:t.next}return r}function TM(n,e){for(let t=Ue;t<n.length;t++){let r=n[t],i=r[z].firstChild;i!==null&&yl(r[z],r,i,e)}n[Dr]!==n[mn]&&e.push(n[Dr])}function gD(n){if(n[ii]!==null){for(let e of n[ii])e.impl.addSequence(e);n[ii].length=0}}var mD=[];function MM(n){return n[yt]??xM(n)}function xM(n){let e=mD.pop()??Object.create(NM);return e.lView=n,e}function AM(n){n.lView[yt]!==n&&(n.lView=null,mD.push(n))}var NM=de(H({},co),{consumerIsAlwaysLive:!0,kind:"template",consumerMarkedDirty:n=>{Po(n.lView)},consumerOnSignalRead(){this.lView[yt]=this}});function RM(n){let e=n[yt]??Object.create(kM);return e.lView=n,e}var kM=de(H({},co),{consumerIsAlwaysLive:!0,kind:"template",consumerMarkedDirty:n=>{let e=wr(n.lView);for(;e&&!_D(e[z]);)e=wr(e);e&&lv(e)},consumerOnSignalRead(){this.lView[yt]=this}});function _D(n){return n.type!==2}function yD(n){if(n[al]===null)return;let e=!0;for(;e;){let t=!1;for(let r of n[al])r.dirty&&(t=!0,r.zone===null||Zone.current===r.zone?r.run():r.zone.run(()=>r.run()));e=t&&!!(n[N]&8192)}}var PM=100;function vD(n,e=!0,t=0){let i=n[Vn].rendererFactory,o=!1;o||i.begin?.();try{OM(n,t)}catch(s){throw e&&cM(n,s),s}finally{o||i.end?.()}}function OM(n,e){let t=gv();try{cy(!0),hf(n,e);let r=0;for(;xl(n);){if(r===PM)throw new v(103,!1);r++,hf(n,1)}}finally{cy(t)}}function FM(n,e,t,r){if(yi(e))return;let i=e[N],o=!1,s=!1;zf(e);let a=!0,l=null,c=null;o||(_D(n)?(c=MM(e),l=da(c)):Yu()===null?(a=!1,c=RM(e),l=da(c)):e[yt]&&(nd(e[yt]),e[yt]=null));try{av(e),RT(n.bindingStartIndex),t!==null&&lD(n,e,t,2,r);let u=(i&3)===3;if(!o)if(u){let h=n.preOrderCheckHooks;h!==null&&Ya(e,h,null)}else{let h=n.preOrderHooks;h!==null&&Za(e,h,0,null),Nd(e,0)}if(s||LM(e),yD(e),DD(e,0),n.contentQueries!==null&&Xv(n,e),!o)if(u){let h=n.contentCheckHooks;h!==null&&Ya(e,h)}else{let h=n.contentHooks;h!==null&&Za(e,h,1),Nd(e,1)}jM(n,e);let d=n.components;d!==null&&CD(e,d,0);let f=n.viewQuery;if(f!==null&&cf(2,f,r),!o)if(u){let h=n.viewCheckHooks;h!==null&&Ya(e,h)}else{let h=n.viewHooks;h!==null&&Za(e,h,2),Nd(e,2)}if(n.firstUpdatePass===!0&&(n.firstUpdatePass=!1),e[Ad]){for(let h of e[Ad])h();e[Ad]=null}o||(gD(e),e[N]&=-73)}catch(u){throw o||Po(e),u}finally{c!==null&&(ed(c,l),a&&AM(c)),Wf()}}function DD(n,e){for(let t=zv(n);t!==null;t=Wv(t))for(let r=Ue;r<t.length;r++){let i=t[r];wD(i,e)}}function LM(n){for(let e=zv(n);e!==null;e=Wv(e)){if(!(e[N]&2))continue;let t=e[cl];for(let r=0;r<t.length;r++){let i=t[r];lv(i)}}}function VM(n,e,t){re(18);let r=Qt(e,n);wD(r,t),re(19,r[Se])}function wD(n,e){$f(n)&&hf(n,e)}function hf(n,e){let r=n[z],i=n[N],o=n[yt],s=!!(e===0&&i&16);if(s||=!!(i&64&&e===0),s||=!!(i&1024),s||=!!(o?.dirty&&td(o)),s||=!1,o&&(o.dirty=!1),n[N]&=-9217,s)FM(r,n,r.template,n[Se]);else if(i&8192){yD(n),DD(n,1);let a=r.components;a!==null&&CD(n,a,1),gD(n)}}function CD(n,e,t){for(let r=0;r<e.length;r++)VM(n,e[r],t)}function jM(n,e){let t=n.hostBindingOpCodes;if(t!==null)try{for(let r=0;r<t.length;r++){let i=t[r];if(i<0)Cr(~i);else{let o=i,s=t[++r],a=t[++r];OT(s,o);let l=e[o];re(24,l),a(2,l),re(25,l)}}}finally{Cr(-1)}}function _h(n,e){let t=gv()?64:1088;for(n[Vn].changeDetectionScheduler?.notify(e);n;){n[N]|=t;let r=wr(n);if(ul(n)&&!r)return n;n=r}return null}function ED(n,e,t,r){return[n,!0,0,e,null,r,null,t,null,null]}function bD(n,e){let t=Ue+e;if(t<n.length)return n[t]}function Pl(n,e,t,r=!0){let i=e[z];if(BM(i,e,n,t),r){let s=ff(t,n),a=e[Te],l=a.parentNode(n[Dr]);l!==null&&gM(i,n[Rt],a,e,l,s)}let o=e[bo];o!==null&&o.firstChild!==null&&(o.firstChild=null)}function ID(n,e){let t=Mo(n,e);return t!==void 0&&Rl(t[z],t),t}function Mo(n,e){if(n.length<=Ue)return;let t=Ue+e,r=n[t];if(r){let i=r[ui];i!==null&&i!==n&&ph(i,r),e>0&&(n[t-1][At]=r[At]);let o=rl(n,Ue+e);pM(r[z],r);let s=o[di];s!==null&&s.detachView(o[z]),r[ze]=null,r[At]=null,r[N]&=-129}return r}function BM(n,e,t,r){let i=Ue+r,o=t.length;r>0&&(t[i-1][At]=e),r<o-Ue?(e[At]=t[i],Gy(t,Ue+r,e)):(t.push(e),e[At]=null),e[ze]=t;let s=e[ui];s!==null&&t!==s&&SD(s,e);let a=e[di];a!==null&&a.insertView(n),Qd(e),e[N]|=128}function SD(n,e){let t=n[cl],r=e[ze];if(Ln(r))n[N]|=2;else{let i=r[ze][Nt];e[Nt]!==i&&(n[N]|=2)}t===null?n[cl]=[e]:t.push(e)}var vl=class{_lView;_cdRefInjectingView;notifyErrorHandler;_appRef=null;_attachedToViewContainer=!1;get rootNodes(){let e=this._lView,t=e[z];return yl(t,e,t.firstChild,[])}constructor(e,t,r=!0){this._lView=e,this._cdRefInjectingView=t,this.notifyErrorHandler=r}get context(){return this._lView[Se]}set context(e){this._lView[Se]=e}get destroyed(){return yi(this._lView)}destroy(){if(this._appRef)this._appRef.detachView(this);else if(this._attachedToViewContainer){let e=this._lView[ze];if(_n(e)){let t=e[ll],r=t?t.indexOf(this):-1;r>-1&&(Mo(e,r),rl(t,r))}this._attachedToViewContainer=!1}Rl(this._lView[z],this._lView)}onDestroy(e){cv(this._lView,e)}markForCheck(){_h(this._cdRefInjectingView||this._lView,4)}detach(){this._lView[N]&=-129}reattach(){Qd(this._lView),this._lView[N]|=128}detectChanges(){this._lView[N]|=1024,vD(this._lView,this.notifyErrorHandler)}checkNoChanges(){}attachToViewContainerRef(){if(this._appRef)throw new v(902,!1);this._attachedToViewContainer=!0}detachFromAppRef(){this._appRef=null;let e=ul(this._lView),t=this._lView[ui];t!==null&&!e&&ph(t,this._lView),hD(this._lView[z],this._lView)}attachToAppRef(e){if(this._attachedToViewContainer)throw new v(902,!1);this._appRef=e;let t=ul(this._lView),r=this._lView[ui];r!==null&&!t&&SD(r,this._lView),Qd(this._lView)}};function yh(n,e,t,r,i){let o=n.data[e];if(o===null)o=HM(n,e,t,r,i),PT()&&(o.flags|=32);else if(o.type&64){o.type=t,o.value=r,o.attrs=i;let s=AT();o.injectorIndex=s===null?-1:s.injectorIndex}return Oo(o,!0),o}function HM(n,e,t,r,i){let o=hv(),s=pv(),a=s?o:o&&o.parent,l=n.data[e]=$M(n,a,t,e,r,i);return UM(n,l,o,s),l}function UM(n,e,t,r){n.firstChild===null&&(n.firstChild=e),t!==null&&(r?t.child==null&&e.parent!==null&&(t.child=e):t.next===null&&(t.next=e,e.prev=t))}function $M(n,e,t,r,i,o){let s=e?e.injectorIndex:-1,a=0;return TT()&&(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:null,inputs:null,hostDirectiveInputs:null,outputs:null,hostDirectiveOutputs:null,directiveToIndex: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}}var FH=new RegExp(`^(\\d+)*(${C0}|${w0})*(.*)`);var zM=()=>null;function xo(n,e){return zM(n,e)}var WM=class{},TD=class{},pf=class{resolveComponentFactory(e){throw Error(`No component factory found for ${_t(e)}.`)}},vh=class{static NULL=new pf},Je=class{},Ho=(()=>{class n{destroyNode=null;static __NG_ELEMENT_ID__=()=>GM()}return n})();function GM(){let n=se(),e=Dt(),t=Qt(e.index,n);return(Ln(t)?t:n)[Te]}var qM=(()=>{class n{static \u0275prov=I({token:n,providedIn:"root",factory:()=>null})}return n})();var Pd={},gf=class{injector;parentInjector;constructor(e,t){this.injector=e,this.parentInjector=t}get(e,t,r){r=Il(r);let i=this.injector.get(e,Pd,r);return i!==Pd||t===Pd?i:this.parentInjector.get(e,t,r)}};function by(n,e,t){let r=t?n.styles:null,i=t?n.classes:null,o=0;if(e!==null)for(let s=0;s<e.length;s++){let a=e[s];if(typeof a=="number")o=a;else if(o==1)i=ey(i,a);else if(o==2){let l=a,c=e[++s];r=ey(r,l+": "+c+";")}}t?n.styles=r:n.stylesWithoutHost=r,t?n.classes=i:n.classesWithoutHost=i}function _e(n,e=$.Default){let t=se();if(t===null)return w(n,e);let r=Dt();return Nv(r,t,He(n),e)}function MD(n,e,t,r,i){let o=r===null?null:{"":-1},s=i(n,t);if(s!==null){let a,l=null,c=null,u=QM(s);u===null?a=s:[a,l,c]=u,XM(n,e,t,a,o,l,c)}o!==null&&r!==null&&KM(t,r,o)}function KM(n,e,t){let r=n.localNames=[];for(let i=0;i<e.length;i+=2){let o=t[e[i+1]];if(o==null)throw new v(-301,!1);r.push(e[i],o)}}function QM(n){let e=null,t=!1;for(let s=0;s<n.length;s++){let a=n[s];if(s===0&&qt(a)&&(e=a),a.findHostDirectiveDefs!==null){t=!0;break}}if(!t)return null;let r=null,i=null,o=null;for(let s of n)s.findHostDirectiveDefs!==null&&(r??=[],i??=new Map,o??=new Map,YM(s,r,o,i)),s===e&&(r??=[],r.push(s));return r!==null?(r.push(...e===null?n:n.slice(1)),[r,i,o]):null}function YM(n,e,t,r){let i=e.length;n.findHostDirectiveDefs(n,e,r),t.set(n,[i,e.length-1])}function ZM(n,e,t){e.componentOffset=t,(n.components??=[]).push(e.index)}function XM(n,e,t,r,i,o,s){let a=r.length,l=!1;for(let f=0;f<a;f++){let h=r[f];!l&&qt(h)&&(l=!0,ZM(n,t,f)),Jd(hl(t,e),n,h.type)}ix(t,n.data.length,a);for(let f=0;f<a;f++){let h=r[f];h.providersResolver&&h.providersResolver(h)}let c=!1,u=!1,d=sD(n,e,a,null);a>0&&(t.directiveToIndex=new Map);for(let f=0;f<a;f++){let h=r[f];if(t.mergedAttrs=So(t.mergedAttrs,h.hostAttrs),ex(n,t,e,d,h),rx(d,h,i),s!==null&&s.has(h)){let[g,_]=s.get(h);t.directiveToIndex.set(h.type,[d,g+t.directiveStart,_+t.directiveStart])}else(o===null||!o.has(h))&&t.directiveToIndex.set(h.type,d);h.contentQueries!==null&&(t.flags|=4),(h.hostBindings!==null||h.hostAttrs!==null||h.hostVars!==0)&&(t.flags|=64);let p=h.type.prototype;!c&&(p.ngOnChanges||p.ngOnInit||p.ngDoCheck)&&((n.preOrderHooks??=[]).push(t.index),c=!0),!u&&(p.ngOnChanges||p.ngDoCheck)&&((n.preOrderCheckHooks??=[]).push(t.index),u=!0),d++}JM(n,t,o)}function JM(n,e,t){for(let r=e.directiveStart;r<e.directiveEnd;r++){let i=n.data[r];if(t===null||!t.has(i))Iy(0,e,i,r),Iy(1,e,i,r),Ty(e,r,!1);else{let o=t.get(i);Sy(0,e,o,r),Sy(1,e,o,r),Ty(e,r,!0)}}}function Iy(n,e,t,r){let i=n===0?t.inputs:t.outputs;for(let o in i)if(i.hasOwnProperty(o)){let s;n===0?s=e.inputs??={}:s=e.outputs??={},s[o]??=[],s[o].push(r),xD(e,o)}}function Sy(n,e,t,r){let i=n===0?t.inputs:t.outputs;for(let o in i)if(i.hasOwnProperty(o)){let s=i[o],a;n===0?a=e.hostDirectiveInputs??={}:a=e.hostDirectiveOutputs??={},a[s]??=[],a[s].push(r,o),xD(e,s)}}function xD(n,e){e==="class"?n.flags|=8:e==="style"&&(n.flags|=16)}function Ty(n,e,t){let{attrs:r,inputs:i,hostDirectiveInputs:o}=n;if(r===null||!t&&i===null||t&&o===null||oh(n)){n.initialInputs??=[],n.initialInputs.push(null);return}let s=null,a=0;for(;a<r.length;){let l=r[a];if(l===0){a+=4;continue}else if(l===5){a+=2;continue}else if(typeof l=="number")break;if(!t&&i.hasOwnProperty(l)){let c=i[l];for(let u of c)if(u===e){s??=[],s.push(l,r[a+1]);break}}else if(t&&o.hasOwnProperty(l)){let c=o[l];for(let u=0;u<c.length;u+=2)if(c[u]===e){s??=[],s.push(c[u+1],r[a+1]);break}}a+=2}n.initialInputs??=[],n.initialInputs.push(s)}function ex(n,e,t,r,i){n.data[r]=i;let o=i.factory||(i.factory=si(i.type,!0)),s=new Er(o,qt(i),_e);n.blueprint[r]=s,t[r]=s,tx(n,e,r,sD(n,t,i.hostVars,Tr),i)}function tx(n,e,t,r,i){let o=i.hostBindings;if(o){let s=n.hostBindingOpCodes;s===null&&(s=n.hostBindingOpCodes=[]);let a=~e.index;nx(s)!=a&&s.push(a),s.push(t,r,o)}}function nx(n){let e=n.length;for(;e>0;){let t=n[--e];if(typeof t=="number"&&t<0)return t}return 0}function rx(n,e,t){if(t){if(e.exportAs)for(let r=0;r<e.exportAs.length;r++)t[e.exportAs[r]]=n;qt(e)&&(t[""]=n)}}function ix(n,e,t){n.flags|=1,n.directiveStart=e,n.directiveEnd=e+t,n.providerIndexes=e}function AD(n,e,t,r,i,o,s,a){let l=e.consts,c=fi(l,s),u=yh(e,n,2,r,c);return o&&MD(e,t,u,fi(l,a),i),u.mergedAttrs=So(u.mergedAttrs,u.attrs),u.attrs!==null&&by(u,u.attrs,!1),u.mergedAttrs!==null&&by(u,u.mergedAttrs,!0),e.queries!==null&&e.queries.elementStart(e,u),u}function ND(n,e){Ev(n,e),tv(e)&&n.queries.elementEnd(e)}var mf=class extends vh{ngModule;constructor(e){super(),this.ngModule=e}resolveComponentFactory(e){let t=ai(e);return new Ao(t,this.ngModule)}};function ox(n){return Object.keys(n).map(e=>{let[t,r,i]=n[e],o={propName:t,templateName:e,isSignal:(r&Nl.SignalBased)!==0};return i&&(o.transform=i),o})}function sx(n){return Object.keys(n).map(e=>({propName:n[e],templateName:e}))}function ax(n,e,t){let r=e instanceof $e?e:e?.injector;return r&&n.getStandaloneInjector!==null&&(r=n.getStandaloneInjector(r)||r),r?new gf(t,r):t}function lx(n){let e=n.get(Je,null);if(e===null)throw new v(407,!1);let t=n.get(qM,null),r=n.get(br,null);return{rendererFactory:e,sanitizer:t,changeDetectionScheduler:r}}function cx(n,e){let t=(n.selectors[0][0]||"div").toLowerCase();return eD(e,t,t==="svg"?vT:t==="math"?DT:null)}var Ao=class extends TD{componentDef;ngModule;selector;componentType;ngContentSelectors;isBoundToModule;cachedInputs=null;cachedOutputs=null;get inputs(){return this.cachedInputs??=ox(this.componentDef.inputs),this.cachedInputs}get outputs(){return this.cachedOutputs??=sx(this.componentDef.outputs),this.cachedOutputs}constructor(e,t){super(),this.componentDef=e,this.ngModule=t,this.componentType=e.type,this.selector=q0(e.selectors),this.ngContentSelectors=e.ngContentSelectors??[],this.isBoundToModule=!!t}create(e,t,r,i){re(22);let o=F(null);try{let s=this.componentDef,a=r?["ng-version","19.2.21"]:K0(this.componentDef.selectors[0]),l=sh(0,null,null,1,0,null,null,null,null,[a],null),c=ax(s,i||this.ngModule,e),u=lx(c),d=u.rendererFactory.createRenderer(null,s),f=r?X0(d,r,s.encapsulation,c):cx(s,d),h=ah(null,l,null,512|oD(s),null,null,u,d,c,null,Zv(f,c,!0));h[vt]=f,zf(h);let p=null;try{let g=AD(vt,l,h,"#host",()=>[this.componentDef],!0,0);f&&(nD(d,f,g),Vo(f,h)),ch(l,h,g),Jv(l,g,h),ND(l,g),t!==void 0&&ux(g,this.ngContentSelectors,t),p=Qt(g.index,h),h[Se]=p[Se],dh(l,h,null)}catch(g){throw p!==null&&sf(p),sf(h),g}finally{re(23),Wf()}return new _f(this.componentType,h)}finally{F(o)}}},_f=class extends WM{_rootLView;instance;hostView;changeDetectorRef;componentType;location;previousInputValues=null;_tNode;constructor(e,t){super(),this._rootLView=t,this._tNode=Uf(t[z],vt),this.location=eh(this._tNode,t),this.instance=Qt(this._tNode.index,t)[Se],this.hostView=this.changeDetectorRef=new vl(t,void 0,!1),this.componentType=e}setInput(e,t){let r=this._tNode;if(this.previousInputValues??=new Map,this.previousInputValues.has(e)&&Object.is(this.previousInputValues.get(e),t))return;let i=this._rootLView,o=uh(r,i[z],i,e,t);this.previousInputValues.set(e,t);let s=Qt(r.index,i);_h(s,1)}get injector(){return new yr(this._tNode,this._rootLView)}destroy(){this.hostView.destroy()}onDestroy(e){this.hostView.onDestroy(e)}};function ux(n,e,t){let r=n.projection=[];for(let i=0;i<e.length;i++){let o=t[i];r.push(o!=null&&o.length?Array.from(o):null)}}var Uo=(()=>{class n{static __NG_ELEMENT_ID__=dx}return n})();function dx(){let n=Dt();return hx(n,se())}var fx=Uo,RD=class extends fx{_lContainer;_hostTNode;_hostLView;constructor(e,t,r){super(),this._lContainer=e,this._hostTNode=t,this._hostLView=r}get element(){return eh(this._hostTNode,this._hostLView)}get injector(){return new yr(this._hostTNode,this._hostLView)}get parentInjector(){let e=Qf(this._hostTNode,this._hostLView);if(Iv(e)){let t=fl(e,this._hostLView),r=dl(e),i=t[z].data[r+8];return new yr(i,t)}else return new yr(null,this._hostLView)}clear(){for(;this.length>0;)this.remove(this.length-1)}get(e){let t=My(this._lContainer);return t!==null&&t[e]||null}get length(){return this._lContainer.length-Ue}createEmbeddedView(e,t,r){let i,o;typeof r=="number"?i=r:r!=null&&(i=r.index,o=r.injector);let s=xo(this._lContainer,e.ssrId),a=e.createEmbeddedViewImpl(t||{},o,s);return this.insertImpl(a,i,To(this._hostTNode,s)),a}createComponent(e,t,r,i,o){let s=e&&!gT(e),a;if(s)a=t;else{let p=t||{};a=p.index,r=p.injector,i=p.projectableNodes,o=p.environmentInjector||p.ngModuleRef}let l=s?e:new Ao(ai(e)),c=r||this.parentInjector;if(!o&&l.ngModule==null){let g=(s?c:this.parentInjector).get($e,null);g&&(o=g)}let u=ai(l.componentType??{}),d=xo(this._lContainer,u?.id??null),f=d?.firstChild??null,h=l.create(c,i,f,o);return this.insertImpl(h.hostView,a,To(this._hostTNode,d)),h}insert(e,t){return this.insertImpl(e,t,!0)}insertImpl(e,t,r){let i=e._lView;if(wT(i)){let a=this.indexOf(e);if(a!==-1)this.detach(a);else{let l=i[ze],c=new RD(l,l[Rt],l[ze]);c.detach(c.indexOf(e))}}let o=this._adjustIndex(t),s=this._lContainer;return Pl(s,i,o,r),e.attachToViewContainerRef(),Gy(Od(s),o,e),e}move(e,t){return this.insert(e,t)}indexOf(e){let t=My(this._lContainer);return t!==null?t.indexOf(e):-1}remove(e){let t=this._adjustIndex(e,-1),r=Mo(this._lContainer,t);r&&(rl(Od(this._lContainer),t),Rl(r[z],r))}detach(e){let t=this._adjustIndex(e,-1),r=Mo(this._lContainer,t);return r&&rl(Od(this._lContainer),t)!=null?new vl(r):null}_adjustIndex(e,t=0){return e??this.length+t}};function My(n){return n[ll]}function Od(n){return n[ll]||(n[ll]=[])}function hx(n,e){let t,r=e[n.index];return _n(r)?t=r:(t=ED(r,e,null,n),e[n.index]=t,lh(e,t)),gx(t,e,n,r),new RD(t,n,e)}function px(n,e){let t=n[Te],r=t.createComment(""),i=Xt(e,n),o=t.parentNode(i);return _l(t,o,r,t.nextSibling(i),!1),r}var gx=yx,mx=()=>!1;function _x(n,e,t){return mx(n,e,t)}function yx(n,e,t,r){if(n[Dr])return;let i;t.type&8?i=Kt(r):i=px(e,t),n[Dr]=i}var yf=class{};var Dl=class extends yf{injector;componentFactoryResolver=new mf(this);instance=null;constructor(e){super();let t=new Eo([...e.providers,{provide:yf,useValue:this},{provide:vh,useValue:this.componentFactoryResolver}],e.parent||Tl(),e.debugName,new Set(["environment"]));this.injector=t,e.runEnvironmentInitializers&&t.resolveInjectorInitializers()}destroy(){this.injector.destroy()}onDestroy(e){this.injector.onDestroy(e)}};function vx(n,e,t=null){return new Dl({providers:n,parent:e,debugName:t,runEnvironmentInitializers:!0}).injector}var Dx=(()=>{class n{_injector;cachedInjectors=new Map;constructor(t){this._injector=t}getOrCreateStandaloneInjector(t){if(!t.standalone)return null;if(!this.cachedInjectors.has(t)){let r=Qy(!1,t.type),i=r.length>0?vx([r],this._injector,`Standalone[${t.type.name}]`):null;this.cachedInjectors.set(t,i)}return this.cachedInjectors.get(t)}ngOnDestroy(){try{for(let t of this.cachedInjectors.values())t!==null&&t.destroy()}finally{this.cachedInjectors.clear()}}static \u0275prov=I({token:n,providedIn:"environment",factory:()=>new n(w($e))})}return n})();function vn(n){return Ro(()=>{let e=kD(n),t=de(H({},e),{decls:n.decls,vars:n.vars,template:n.template,consts:n.consts||null,ngContentSelectors:n.ngContentSelectors,onPush:n.changeDetection===Uv.OnPush,directiveDefs:null,pipeDefs:null,dependencies:e.standalone&&n.dependencies||null,getStandaloneInjector:e.standalone?i=>i.get(Dx).getOrCreateStandaloneInjector(t):null,getExternalStyles:null,signals:n.signals??!1,data:n.data||{},encapsulation:n.encapsulation||Zt.Emulated,styles:n.styles||mt,_:null,schemas:n.schemas||null,tView:null,id:""});e.standalone&&Bo("NgStandalone"),PD(t);let r=n.dependencies;return t.directiveDefs=xy(r,!1),t.pipeDefs=xy(r,!0),t.id=Ix(t),t})}function wx(n){return ai(n)||iT(n)}function Cx(n){return n!==null}function Ce(n){return Ro(()=>({type:n.type,bootstrap:n.bootstrap||mt,declarations:n.declarations||mt,imports:n.imports||mt,exports:n.exports||mt,transitiveCompileScopes:null,schemas:n.schemas||null,id:n.id||null}))}function Ex(n,e){if(n==null)return vr;let t={};for(let r in n)if(n.hasOwnProperty(r)){let i=n[r],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=Nl.None,l=null),t[o]=[r,a,l],e[o]=s}return t}function bx(n){if(n==null)return vr;let e={};for(let t in n)n.hasOwnProperty(t)&&(e[n[t]]=t);return e}function We(n){return Ro(()=>{let e=kD(n);return PD(e),e})}function kD(n){let 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||vr,exportAs:n.exportAs||null,standalone:n.standalone??!0,signals:n.signals===!0,selectors:n.selectors||mt,viewQuery:n.viewQuery||null,features:n.features||null,setInput:null,findHostDirectiveDefs:null,hostDirectives:null,inputs:Ex(n.inputs,e),outputs:bx(n.outputs),debugInfo:null}}function PD(n){n.features?.forEach(e=>e(n))}function xy(n,e){if(!n)return null;let t=e?oT:wx;return()=>(typeof n=="function"?n():n).map(r=>t(r)).filter(Cx)}function Ix(n){let e=0,t=typeof n.consts=="function"?"":n.consts,r=[n.selectors,n.ngContentSelectors,n.hostVars,n.hostAttrs,t,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(let o of r.join("|"))e=Math.imul(31,e)+o.charCodeAt(0)<<0;return e+=2147483648,"c"+e}function Sx(n){return Object.getPrototypeOf(n.prototype).constructor}function Jt(n){let e=Sx(n.type),t=!0,r=[n];for(;e;){let i;if(qt(n))i=e.\u0275cmp||e.\u0275dir;else{if(e.\u0275cmp)throw new v(903,!1);i=e.\u0275dir}if(i){if(t){r.push(i);let s=n;s.inputs=Fd(n.inputs),s.declaredInputs=Fd(n.declaredInputs),s.outputs=Fd(n.outputs);let a=i.hostBindings;a&&Nx(n,a);let l=i.viewQuery,c=i.contentQueries;if(l&&xx(n,l),c&&Ax(n,c),Tx(n,i),VS(n.outputs,i.outputs),qt(i)&&i.data.animation){let u=n.data;u.animation=(u.animation||[]).concat(i.data.animation)}}let o=i.features;if(o)for(let s=0;s<o.length;s++){let a=o[s];a&&a.ngInherit&&a(n),a===Jt&&(t=!1)}}e=Object.getPrototypeOf(e)}Mx(r)}function Tx(n,e){for(let t in e.inputs){if(!e.inputs.hasOwnProperty(t)||n.inputs.hasOwnProperty(t))continue;let r=e.inputs[t];r!==void 0&&(n.inputs[t]=r,n.declaredInputs[t]=e.declaredInputs[t])}}function Mx(n){let e=0,t=null;for(let r=n.length-1;r>=0;r--){let i=n[r];i.hostVars=e+=i.hostVars,i.hostAttrs=So(i.hostAttrs,t=So(t,i.hostAttrs))}}function Fd(n){return n===vr?{}:n===mt?[]:n}function xx(n,e){let t=n.viewQuery;t?n.viewQuery=(r,i)=>{e(r,i),t(r,i)}:n.viewQuery=e}function Ax(n,e){let t=n.contentQueries;t?n.contentQueries=(r,i,o)=>{e(r,i,o),t(r,i,o)}:n.contentQueries=e}function Nx(n,e){let t=n.hostBindings;t?n.hostBindings=(r,i)=>{e(r,i),t(r,i)}:n.hostBindings=e}function Mr(n,e,t){let r=n[e];return Object.is(r,t)?!1:(n[e]=t,!0)}function Rx(n,e,t,r,i,o,s,a,l){let c=e.consts,u=yh(e,n,4,s||null,a||null);fv()&&MD(e,t,u,fi(c,l),dD),u.mergedAttrs=So(u.mergedAttrs,u.attrs),Ev(e,u);let d=u.tView=sh(2,u,r,i,o,e.directiveRegistry,e.pipeRegistry,null,e.schemas,c,null);return e.queries!==null&&(e.queries.template(e,u),d.queries=e.queries.embeddedTView(u)),u}function vf(n,e,t,r,i,o,s,a,l,c){let u=t+vt,d=e.firstCreatePass?Rx(u,e,n,r,i,o,s,a,l):e.data[u];Oo(d,!1);let f=kx(e,n,d,t);qf()&&gh(e,n,f,d),Vo(f,n);let h=ED(f,n,f,d);return n[u]=h,lh(n,h),_x(h,d,n),Hf(d)&&ch(e,n,d),l!=null&&cD(n,d,c),d}function Dn(n,e,t,r,i,o,s,a){let l=se(),c=et(),u=fi(c.consts,o);return vf(l,c,n,e,t,r,i,u,s,a),Dn}var kx=Px;function Px(n,e,t,r){return Kf(!0),e[Te].createComment("")}var Dh=new E(""),$o=new E(""),Ol=(()=>{class n{_ngZone;registry;_isZoneStable=!0;_callbacks=[];_taskTrackingZone=null;_destroyRef;constructor(t,r,i){this._ngZone=t,this.registry=r,jf()&&(this._destroyRef=m(Fo,{optional:!0})??void 0),wh||(Ox(i),i.addToWindow(r)),this._watchAngularEvents(),t.run(()=>{this._taskTrackingZone=typeof Zone>"u"?null:Zone.current.get("TaskTrackingZone")})}_watchAngularEvents(){let t=this._ngZone.onUnstable.subscribe({next:()=>{this._isZoneStable=!1}}),r=this._ngZone.runOutsideAngular(()=>this._ngZone.onStable.subscribe({next:()=>{k.assertNotInAngularZone(),queueMicrotask(()=>{this._isZoneStable=!0,this._runCallbacksIfReady()})}}));this._destroyRef?.onDestroy(()=>{t.unsubscribe(),r.unsubscribe()})}isStable(){return this._isZoneStable&&!this._ngZone.hasPendingMacrotasks}_runCallbacksIfReady(){if(this.isStable())queueMicrotask(()=>{for(;this._callbacks.length!==0;){let t=this._callbacks.pop();clearTimeout(t.timeoutId),t.doneCb()}});else{let t=this.getPendingTasks();this._callbacks=this._callbacks.filter(r=>r.updateCb&&r.updateCb(t)?(clearTimeout(r.timeoutId),!1):!0)}}getPendingTasks(){return this._taskTrackingZone?this._taskTrackingZone.macroTasks.map(t=>({source:t.source,creationLocation:t.creationLocation,data:t.data})):[]}addCallback(t,r,i){let o=-1;r&&r>0&&(o=setTimeout(()=>{this._callbacks=this._callbacks.filter(s=>s.timeoutId!==o),t()},r)),this._callbacks.push({doneCb:t,timeoutId:o,updateCb:i})}whenStable(t,r,i){if(i&&!this._taskTrackingZone)throw new Error('Task tracking zone is required when passing an update callback to whenStable(). Is "zone.js/plugins/task-tracking" loaded?');this.addCallback(t,r,i),this._runCallbacksIfReady()}registerApplication(t){this.registry.registerApplication(t,this)}unregisterApplication(t){this.registry.unregisterApplication(t)}findProviders(t,r,i){return[]}static \u0275fac=function(r){return new(r||n)(w(k),w(Fl),w($o))};static \u0275prov=I({token:n,factory:n.\u0275fac})}return n})(),Fl=(()=>{class n{_applications=new Map;registerApplication(t,r){this._applications.set(t,r)}unregisterApplication(t){this._applications.delete(t)}unregisterAllApplications(){this._applications.clear()}getTestability(t){return this._applications.get(t)||null}getAllTestabilities(){return Array.from(this._applications.values())}getAllRootElements(){return Array.from(this._applications.keys())}findTestabilityInTree(t,r=!0){return wh?.findTestabilityInTree(this,t,r)??null}static \u0275fac=function(r){return new(r||n)};static \u0275prov=I({token:n,factory:n.\u0275fac,providedIn:"platform"})}return n})();function Ox(n){wh=n}var wh,Fx=(()=>{class n{static \u0275prov=I({token:n,providedIn:"root",factory:()=>new Df})}return n})(),Df=class{queuedEffectCount=0;queues=new Map;schedule(e){this.enqueue(e)}remove(e){let t=e.zone,r=this.queues.get(t);r.has(e)&&(r.delete(e),this.queuedEffectCount--)}enqueue(e){let t=e.zone;this.queues.has(t)||this.queues.set(t,new Set);let r=this.queues.get(t);r.has(e)||(this.queuedEffectCount++,r.add(e))}flush(){for(;this.queuedEffectCount>0;)for(let[e,t]of this.queues)e===null?this.flushQueue(t):e.run(()=>this.flushQueue(t))}flushQueue(e){for(let t of e)e.delete(t),this.queuedEffectCount--,t.run()}};function Ll(n){return!!n&&typeof n.then=="function"}function Lx(n){return!!n&&typeof n.subscribe=="function"}var Vx=new E("");var OD=(()=>{class n{resolve;reject;initialized=!1;done=!1;donePromise=new Promise((t,r)=>{this.resolve=t,this.reject=r});appInits=m(Vx,{optional:!0})??[];injector=m(Ve);constructor(){}runInitializers(){if(this.initialized)return;let t=[];for(let i of this.appInits){let o=gi(this.injector,i);if(Ll(o))t.push(o);else if(Lx(o)){let s=new Promise((a,l)=>{o.subscribe({complete:a,error:l})});t.push(s)}}let r=()=>{this.done=!0,this.resolve()};Promise.all(t).then(()=>{r()}).catch(i=>{this.reject(i)}),t.length===0&&r(),this.initialized=!0}static \u0275fac=function(r){return new(r||n)};static \u0275prov=I({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})(),jx=new E("");function Bx(){id(()=>{throw new v(600,!1)})}function Hx(n){return n.isBoundToModule}var Ux=10;var Bn=(()=>{class n{_runningTick=!1;_destroyed=!1;_destroyListeners=[];_views=[];internalErrorHandler=m(f0);afterRenderManager=m(Yv);zonelessEnabled=m(Ov);rootEffectScheduler=m(Fx);dirtyFlags=0;tracingSnapshot=null;externalTestViews=new Set;afterTick=new L;get allViews(){return[...this.externalTestViews.keys(),...this._views]}get destroyed(){return this._destroyed}componentTypes=[];components=[];isStable=m(Lo).hasPendingTasks.pipe(oe(t=>!t));constructor(){m(wi,{optional:!0})}whenStable(){let t;return new Promise(r=>{t=this.isStable.subscribe({next:i=>{i&&r()}})}).finally(()=>{t.unsubscribe()})}_injector=m($e);_rendererFactory=null;get injector(){return this._injector}bootstrap(t,r){return this.bootstrapImpl(t,r)}bootstrapImpl(t,r,i=Ve.NULL){re(10);let o=t instanceof TD;if(!this._injector.get(OD).done){let h="";throw new v(405,h)}let a;o?a=t:a=this._injector.get(vh).resolveComponentFactory(t),this.componentTypes.push(a.componentType);let l=Hx(a)?void 0:this._injector.get(yf),c=r||a.selector,u=a.create(i,[],c,l),d=u.location.nativeElement,f=u.injector.get(Dh,null);return f?.registerApplication(d),u.onDestroy(()=>{this.detachView(u.hostView),Xa(this.components,u),f?.unregisterApplication(d)}),this._loadComponent(u),re(11,u),u}tick(){this.zonelessEnabled||(this.dirtyFlags|=1),this._tick()}_tick(){re(12),this.tracingSnapshot!==null?this.tracingSnapshot.run(ih.CHANGE_DETECTION,this.tickImpl):this.tickImpl()}tickImpl=()=>{if(this._runningTick)throw new v(101,!1);let t=F(null);try{this._runningTick=!0,this.synchronize()}catch(r){this.internalErrorHandler(r)}finally{this._runningTick=!1,this.tracingSnapshot?.dispose(),this.tracingSnapshot=null,F(t),this.afterTick.next(),re(13)}};synchronize(){this._rendererFactory===null&&!this._injector.destroyed&&(this._rendererFactory=this._injector.get(Je,null,{optional:!0}));let t=0;for(;this.dirtyFlags!==0&&t++<Ux;)re(14),this.synchronizeOnce(),re(15)}synchronizeOnce(){if(this.dirtyFlags&16&&(this.dirtyFlags&=-17,this.rootEffectScheduler.flush()),this.dirtyFlags&7){let t=!!(this.dirtyFlags&1);this.dirtyFlags&=-8,this.dirtyFlags|=8;for(let{_lView:r,notifyErrorHandler:i}of this.allViews)$x(r,i,t,this.zonelessEnabled);if(this.dirtyFlags&=-5,this.syncDirtyFlagsWithViews(),this.dirtyFlags&23)return}else this._rendererFactory?.begin?.(),this._rendererFactory?.end?.();this.dirtyFlags&8&&(this.dirtyFlags&=-9,this.afterRenderManager.execute()),this.syncDirtyFlagsWithViews()}syncDirtyFlagsWithViews(){if(this.allViews.some(({_lView:t})=>xl(t))){this.dirtyFlags|=2;return}else this.dirtyFlags&=-8}attachView(t){let r=t;this._views.push(r),r.attachToAppRef(this)}detachView(t){let r=t;Xa(this._views,r),r.detachFromAppRef()}_loadComponent(t){this.attachView(t.hostView),this.tick(),this.components.push(t),this._injector.get(jx,[]).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),()=>Xa(this._destroyListeners,t)}destroy(){if(this._destroyed)throw new v(406,!1);let 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=I({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();function Xa(n,e){let t=n.indexOf(e);t>-1&&n.splice(t,1)}function $x(n,e,t,r){if(!t&&!xl(n))return;vD(n,e,t&&!r?0:1)}function Vl(n,e,t,r){let i=se(),o=Di();if(Mr(i,o,e)){let s=et(),a=Gf();sM(a,i,n,e,t,r)}return Vl}function zx(n,e,t,r){return Mr(n,Di(),t)?e+kf(t)+r:Tr}function Ka(n,e){return n<<17|e<<2}function Ir(n){return n>>17&32767}function Wx(n){return(n&2)==2}function Gx(n,e){return n&131071|e<<17}function wf(n){return n|2}function hi(n){return(n&131068)>>2}function Ld(n,e){return n&-131069|e<<2}function qx(n){return(n&1)===1}function Cf(n){return n|1}function Kx(n,e,t,r,i,o){let s=o?e.classBindings:e.styleBindings,a=Ir(s),l=hi(s);n[r]=t;let c=!1,u;if(Array.isArray(t)){let d=t;u=d[1],(u===null||ko(d,u)>0)&&(c=!0)}else u=t;if(i)if(l!==0){let f=Ir(n[a+1]);n[r+1]=Ka(f,a),f!==0&&(n[f+1]=Ld(n[f+1],r)),n[a+1]=Gx(n[a+1],r)}else n[r+1]=Ka(a,0),a!==0&&(n[a+1]=Ld(n[a+1],r)),a=r;else n[r+1]=Ka(l,0),a===0?a=r:n[l+1]=Ld(n[l+1],r),l=r;c&&(n[r+1]=wf(n[r+1])),Ay(n,u,r,!0),Ay(n,u,r,!1),Qx(e,u,n,r,o),s=Ka(a,l),o?e.classBindings=s:e.styleBindings=s}function Qx(n,e,t,r,i){let o=i?n.residualClasses:n.residualStyles;o!=null&&typeof e=="string"&&ko(o,e)>=0&&(t[r+1]=Cf(t[r+1]))}function Ay(n,e,t,r){let i=n[t+1],o=e===null,s=r?Ir(i):hi(i),a=!1;for(;s!==0&&(a===!1||o);){let l=n[s],c=n[s+1];Yx(l,e)&&(a=!0,n[s+1]=r?Cf(c):wf(c)),s=r?Ir(c):hi(c)}a&&(n[t+1]=r?wf(i):Cf(i))}function Yx(n,e){return n===null||e==null||(Array.isArray(n)?n[1]:n)===e?!0:Array.isArray(n)&&typeof e=="string"?ko(n,e)>=0:!1}function xr(n,e,t){let r=se(),i=Di();if(Mr(r,i,e)){let o=et(),s=Gf();uD(o,s,r,n,e,r[Te],t,!1)}return xr}function Ny(n,e,t,r,i){uh(e,n,t,i?"class":"style",r)}function Ar(n,e,t){return FD(n,e,t,!1),Ar}function en(n,e){return FD(n,e,null,!0),en}function FD(n,e,t,r){let i=se(),o=et(),s=kT(2);if(o.firstUpdatePass&&Xx(o,n,s,r),e!==Tr&&Mr(i,s,e)){let a=o.data[Sr()];rA(o,a,i,i[Te],n,i[s+1]=iA(e,t),r,s)}}function Zx(n,e){return e>=n.expandoStartIndex}function Xx(n,e,t,r){let i=n.data;if(i[t+1]===null){let o=i[Sr()],s=Zx(n,t);oA(o,r)&&e===null&&!s&&(e=!1),e=Jx(i,o,e,r),Kx(i,o,e,t,s,r)}}function Jx(n,e,t,r){let i=LT(n),o=r?e.residualClasses:e.residualStyles;if(i===null)(r?e.classBindings:e.styleBindings)===0&&(t=Vd(null,n,e,t,r),t=No(t,e.attrs,r),o=null);else{let s=e.directiveStylingLast;if(s===-1||n[s]!==i)if(t=Vd(i,n,e,t,r),o===null){let l=eA(n,e,r);l!==void 0&&Array.isArray(l)&&(l=Vd(null,n,e,l[1],r),l=No(l,e.attrs,r),tA(n,e,r,l))}else o=nA(n,e,r)}return o!==void 0&&(r?e.residualClasses=o:e.residualStyles=o),t}function eA(n,e,t){let r=t?e.classBindings:e.styleBindings;if(hi(r)!==0)return n[Ir(r)]}function tA(n,e,t,r){let i=t?e.classBindings:e.styleBindings;n[Ir(i)]=r}function nA(n,e,t){let r,i=e.directiveEnd;for(let o=1+e.directiveStylingLast;o<i;o++){let s=n[o].hostAttrs;r=No(r,s,t)}return No(r,e.attrs,t)}function Vd(n,e,t,r,i){let o=null,s=t.directiveEnd,a=t.directiveStylingLast;for(a===-1?a=t.directiveStart:a++;a<s&&(o=e[a],r=No(r,o.hostAttrs,i),o!==n);)a++;return n!==null&&(t.directiveStylingLast=a),r}function No(n,e,t){let r=t?1:2,i=-1;if(e!==null)for(let o=0;o<e.length;o++){let s=e[o];typeof s=="number"?i=s:i===r&&(Array.isArray(n)||(n=n===void 0?[]:["",n]),nT(n,s,t?!0:e[++o]))}return n===void 0?null:n}function rA(n,e,t,r,i,o,s,a){if(!(e.type&3))return;let l=n.data,c=l[a+1],u=qx(c)?Ry(l,e,t,i,hi(c),s):void 0;if(!wl(u)){wl(o)||Wx(c)&&(o=Ry(l,null,t,i,a,s));let d=sv(Sr(),t);SM(r,s,d,i,o)}}function Ry(n,e,t,r,i,o){let s=e===null,a;for(;i>0;){let l=n[i],c=Array.isArray(l),u=c?l[1]:l,d=u===null,f=t[i+1];f===Tr&&(f=d?mt:void 0);let h=d?Md(f,r):u===r?f:void 0;if(c&&!wl(h)&&(h=Md(l,r)),wl(h)&&(a=h,s))return a;let p=n[i+1];i=s?Ir(p):hi(p)}if(e!==null){let l=o?e.residualClasses:e.residualStyles;l!=null&&(a=Md(l,r))}return a}function wl(n){return n!==void 0}function iA(n,e){return n==null||n===""||(typeof e=="string"?n=n+e:typeof n=="object"&&(n=_t(R0(n)))),n}function oA(n,e){return(n.flags&(e?8:16))!==0}var Ef=class{destroy(e){}updateValue(e,t){}swap(e,t){let r=Math.min(e,t),i=Math.max(e,t),o=this.detach(i);if(i-r>1){let 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 jd(n,e,t,r,i){return n===t&&Object.is(e,r)?1:Object.is(i(n,e),i(t,r))?-1:0}function sA(n,e,t){let r,i,o=0,s=n.length-1,a=void 0;if(Array.isArray(e)){let l=e.length-1;for(;o<=s&&o<=l;){let c=n.at(o),u=e[o],d=jd(o,c,o,u,t);if(d!==0){d<0&&n.updateValue(o,u),o++;continue}let f=n.at(s),h=e[l],p=jd(s,f,l,h,t);if(p!==0){p<0&&n.updateValue(s,h),s--,l--;continue}let g=t(o,c),_=t(s,f),D=t(o,u);if(Object.is(D,_)){let M=t(l,h);Object.is(M,g)?(n.swap(o,s),n.updateValue(s,h),l--,s--):n.move(s,o),n.updateValue(o,u),o++;continue}if(r??=new Cl,i??=Py(n,o,s,t),bf(n,r,o,D))n.updateValue(o,u),o++,s++;else if(i.has(D))r.set(g,n.detach(o)),s--;else{let M=n.create(o,e[o]);n.attach(o,M),o++,s++}}for(;o<=l;)ky(n,r,t,o,e[o]),o++}else if(e!=null){let l=e[Symbol.iterator](),c=l.next();for(;!c.done&&o<=s;){let u=n.at(o),d=c.value,f=jd(o,u,o,d,t);if(f!==0)f<0&&n.updateValue(o,d),o++,c=l.next();else{r??=new Cl,i??=Py(n,o,s,t);let h=t(o,d);if(bf(n,r,o,h))n.updateValue(o,d),o++,s++,c=l.next();else if(!i.has(h))n.attach(o,n.create(o,d)),o++,s++,c=l.next();else{let p=t(o,u);r.set(p,n.detach(o)),s--}}}for(;!c.done;)ky(n,r,t,n.length,c.value),c=l.next()}for(;o<=s;)n.destroy(n.detach(s--));r?.forEach(l=>{n.destroy(l)})}function bf(n,e,t,r){return e!==void 0&&e.has(r)?(n.attach(t,e.get(r)),e.delete(r),!0):!1}function ky(n,e,t,r,i){if(bf(n,e,r,t(r,i)))n.updateValue(r,i);else{let o=n.create(r,i);n.attach(r,o)}}function Py(n,e,t,r){let i=new Set;for(let o=e;o<=t;o++)i.add(r(o,n.at(o)));return i}var Cl=class{kvMap=new Map;_vMap=void 0;has(e){return this.kvMap.has(e)}delete(e){if(!this.has(e))return!1;let t=this.kvMap.get(e);return this._vMap!==void 0&&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);this._vMap===void 0&&(this._vMap=new Map);let 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),this._vMap!==void 0){let i=this._vMap;for(;i.has(r);)r=i.get(r),e(r,t)}}};function tn(n,e){Bo("NgControlFlow");let t=se(),r=Di(),i=t[r]!==Tr?t[r]:-1,o=i!==-1?El(t,vt+i):void 0,s=0;if(Mr(t,r,n)){let a=F(null);try{if(o!==void 0&&ID(o,s),n!==-1){let l=vt+n,c=El(t,l),u=Mf(t[z],l),d=xo(c,u.tView.ssrId),f=fh(t,u,e,{dehydratedView:d});Pl(c,f,s,To(u,d))}}finally{F(a)}}else if(o!==void 0){let a=bD(o,s);a!==void 0&&(a[Se]=e)}}var If=class{lContainer;$implicit;$index;constructor(e,t,r){this.lContainer=e,this.$implicit=t,this.$index=r}get $count(){return this.lContainer.length-Ue}};var Sf=class{hasEmptyBlock;trackByFn;liveCollection;constructor(e,t,r){this.hasEmptyBlock=e,this.trackByFn=t,this.liveCollection=r}};function Ci(n,e,t,r,i,o,s,a,l,c,u,d,f){Bo("NgControlFlow");let h=se(),p=et(),g=l!==void 0,_=se(),D=a?s.bind(_[Nt][Se]):s,M=new Sf(g,D);_[vt+n]=M,vf(h,p,n+1,e,t,r,i,fi(p.consts,o)),g&&vf(h,p,n+2,l,c,u,d,fi(p.consts,f))}var Tf=class extends Ef{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-Ue}at(e){return this.getLView(e)[Se].$implicit}attach(e,t){let r=t[bo];this.needsIndexUpdate||=e!==this.length,Pl(this.lContainer,t,e,To(this.templateTNode,r))}detach(e){return this.needsIndexUpdate||=e!==this.length-1,aA(this.lContainer,e)}create(e,t){let r=xo(this.lContainer,this.templateTNode.tView.ssrId),i=fh(this.hostLView,this.templateTNode,new If(this.lContainer,t,e),{dehydratedView:r});return this.operationsCounter?.recordCreate(),i}destroy(e){Rl(e[z],e),this.operationsCounter?.recordDestroy()}updateValue(e,t){this.getLView(e)[Se].$implicit=t}reset(){this.needsIndexUpdate=!1,this.operationsCounter?.reset()}updateIndexes(){if(this.needsIndexUpdate)for(let e=0;e<this.length;e++)this.getLView(e)[Se].$index=e}getLView(e){return lA(this.lContainer,e)}};function Ei(n){let e=F(null),t=Sr();try{let r=se(),i=r[z],o=r[t],s=t+1,a=El(r,s);if(o.liveCollection===void 0){let c=Mf(i,s);o.liveCollection=new Tf(a,r,c)}else o.liveCollection.reset();let l=o.liveCollection;if(sA(l,n,o.trackByFn),l.updateIndexes(),o.hasEmptyBlock){let c=Di(),u=l.length===0;if(Mr(r,c,u)){let d=t+2,f=El(r,d);if(u){let h=Mf(i,d),p=xo(f,h.tView.ssrId),g=fh(r,h,void 0,{dehydratedView:p});Pl(f,g,0,To(h,p))}else ID(f,0)}}}finally{F(e)}}function El(n,e){return n[e]}function aA(n,e){return Mo(n,e)}function lA(n,e){return bD(n,e)}function Mf(n,e){return Uf(n,e)}function x(n,e,t,r){let i=se(),o=et(),s=vt+n,a=i[Te],l=o.firstCreatePass?AD(s,o,i,e,dD,fv(),t,r):o.data[s],c=cA(o,i,l,a,e,n);i[s]=c;let u=Hf(l);return Oo(l,!0),nD(a,c,l),!fD(l)&&qf()&&gh(o,i,c,l),(bT()===0||u)&&Vo(c,i),IT(),u&&(ch(o,i,l),Jv(o,l,i)),r!==null&&cD(i,l),x}function O(){let n=Dt();pv()?NT():(n=n.parent,Oo(n,!1));let e=n;MT(e)&&xT(),ST();let t=et();return t.firstCreatePass&&ND(t,e),e.classesWithoutHost!=null&&$T(e)&&Ny(t,e,se(),e.classesWithoutHost,!0),e.stylesWithoutHost!=null&&zT(e)&&Ny(t,e,se(),e.stylesWithoutHost,!1),O}function wt(n,e,t,r){return x(n,e,t,r),O(),wt}var cA=(n,e,t,r,i,o)=>(Kf(!0),eD(r,i,BT()));function nn(){return se()}var bl="en-US";var uA=bl;function dA(n){typeof n=="string"&&(uA=n.toLowerCase().replace(/_/g,"-"))}function Oy(n,e,t){return function r(i){if(i===Function)return t;let o=_i(n)?Qt(n.index,e):e;_h(o,5);let s=e[Se],a=Fy(e,s,t,i),l=r.__ngNextListenerFn__;for(;l;)a=Fy(e,s,l,i)&&a,l=l.__ngNextListenerFn__;return a}}function Fy(n,e,t,r){let i=F(null);try{return re(6,e,t),t(r)!==!1}catch(o){return fA(n,o),!1}finally{re(7,e,t),F(i)}}function fA(n,e){let t=n[ci],r=t?t.get(Yt,null):null;r&&r.handleError(e)}function Ly(n,e,t,r,i,o){let s=e[t],a=e[z],c=a.data[t].outputs[r],u=s[c],d=a.firstCreatePass?dv(a):null,f=uv(e),h=u.subscribe(o),p=f.length;f.push(o,h),d&&d.push(i,n.index,p,-(p+1))}function ae(n,e,t,r){let i=se(),o=et(),s=Dt();return LD(o,i,i[Te],s,n,e,r),ae}function hA(n,e,t,r){let i=n.cleanup;if(i!=null)for(let o=0;o<i.length-1;o+=2){let s=i[o];if(s===t&&i[o+1]===r){let a=e[sl],l=i[o+2];return a.length>l?a[l]:null}typeof s=="string"&&(o+=2)}return null}function LD(n,e,t,r,i,o,s){let a=Hf(r),c=n.firstCreatePass?dv(n):null,u=uv(e),d=!0;if(r.type&3||s){let f=Xt(r,e),h=s?s(f):f,p=u.length,g=s?D=>s(Kt(D[r.index])):r.index,_=null;if(!s&&a&&(_=hA(n,e,i,r.index)),_!==null){let D=_.__ngLastListenerFn__||_;D.__ngNextListenerFn__=o,_.__ngLastListenerFn__=o,d=!1}else{o=Oy(r,e,o),A0(e,h,i,o);let D=t.listen(h,i,o);u.push(o,D),c&&c.push(i,g,p,p+1)}}else o=Oy(r,e,o);if(d){let f=r.outputs?.[i],h=r.hostDirectiveOutputs?.[i];if(h&&h.length)for(let p=0;p<h.length;p+=2){let g=h[p],_=h[p+1];Ly(r,e,g,_,i,o)}if(f&&f.length)for(let p of f)Ly(r,e,p,i,i,o)}}function P(n=1){return jT(n)}function ye(n,e=""){let t=se(),r=et(),i=n+vt,o=r.firstCreatePass?yh(r,i,1,e,null):r.data[i],s=pA(r,t,o,e,n);t[i]=s,qf()&&gh(r,t,s,o),Oo(o,!1)}var pA=(n,e,t,r,i)=>(Kf(!0),k0(e[Te],r));function $n(n){return zn("",n,""),$n}function zn(n,e,t){let r=se(),i=zx(r,n,e,t);return i!==Tr&&gA(r,Sr(),i),zn}function gA(n,e,t){let r=sv(e,n);P0(n[Te],r,t)}function wn(n,e,t){Bv(e)&&(e=e());let r=se(),i=Di();if(Mr(r,i,e)){let o=et(),s=Gf();uD(o,s,r,n,e,r[Te],t,!1)}return wn}function Wn(n,e){let t=Bv(n);return t&&n.set(e),t}function Cn(n,e){let t=se(),r=et(),i=Dt();return LD(r,t,t[Te],i,n,e),Cn}function mA(n,e,t){let r=et();if(r.firstCreatePass){let i=qt(n);xf(t,r.data,r.blueprint,i,!0),xf(e,r.data,r.blueprint,i,!1)}}function xf(n,e,t,r,i){if(n=He(n),Array.isArray(n))for(let o=0;o<n.length;o++)xf(n[o],e,t,r,i);else{let o=et(),s=se(),a=Dt(),l=li(n)?n:He(n.provide),c=Xy(n),u=a.providerIndexes&1048575,d=a.directiveStart,f=a.providerIndexes>>20;if(li(n)||!n.multi){let h=new Er(c,i,_e),p=Hd(l,e,i?u:u+f,d);p===-1?(Jd(hl(a,s),o,l),Bd(o,n,e.length),e.push(l),a.directiveStart++,a.directiveEnd++,i&&(a.providerIndexes+=1048576),t.push(h),s.push(h)):(t[p]=h,s[p]=h)}else{let h=Hd(l,e,u+f,d),p=Hd(l,e,u,u+f),g=h>=0&&t[h],_=p>=0&&t[p];if(i&&!_||!i&&!g){Jd(hl(a,s),o,l);let D=vA(i?yA:_A,t.length,i,r,c);!i&&_&&(t[p].providerFactory=D),Bd(o,n,e.length,0),e.push(l),a.directiveStart++,a.directiveEnd++,i&&(a.providerIndexes+=1048576),t.push(D),s.push(D)}else{let D=VD(t[i?p:h],c,!i&&r);Bd(o,n,h>-1?h:p,D)}!i&&r&&_&&t[p].componentProviders++}}}function Bd(n,e,t,r){let i=li(e),o=cT(e);if(i||o){let l=(o?He(e.useClass):e).prototype.ngOnDestroy;if(l){let c=n.destroyHooks||(n.destroyHooks=[]);if(!i&&e.multi){let u=c.indexOf(t);u===-1?c.push(t,[r,l]):c[u+1].push(r,l)}else c.push(t,l)}}}function VD(n,e,t){return t&&n.componentProviders++,n.multi.push(e)-1}function Hd(n,e,t,r){for(let i=t;i<r;i++)if(e[i]===n)return i;return-1}function _A(n,e,t,r,i){return Af(this.multi,[])}function yA(n,e,t,r,i){let o=this.multi,s;if(this.providerFactory){let a=this.providerFactory.componentProviders,l=pl(r,r[z],this.providerFactory.index,i);s=l.slice(0,a),Af(o,s);for(let c=a;c<l.length;c++)s.push(l[c])}else s=[],Af(o,s);return s}function Af(n,e){for(let t=0;t<n.length;t++){let r=n[t];e.push(r())}return e}function vA(n,e,t,r,i){let o=new Er(n,t,_e);return o.multi=[],o.index=e,o.componentProviders=0,VD(o,i,r&&!t),o}function En(n,e=[]){return t=>{t.providersResolver=(r,i)=>mA(r,i?i(n):n,e)}}var pi=class{full;major;minor;patch;constructor(e){this.full=e;let t=e.split(".");this.major=t[0],this.minor=t[1],this.patch=t.slice(2).join(".")}},zo=new pi("19.2.21");var DA=(()=>{class n{zone=m(k);changeDetectionScheduler=m(br);applicationRef=m(Bn);_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=I({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();function wA({ngZoneFactory:n,ignoreChangesOutsideZone:e,scheduleInRootZone:t}){return n??=()=>new k(de(H({},CA()),{scheduleInRootZone:t})),[{provide:k,useFactory:n},{provide:il,multi:!0,useFactory:()=>{let r=m(DA,{optional:!0});return()=>r.initialize()}},{provide:il,multi:!0,useFactory:()=>{let r=m(EA);return()=>{r.initialize()}}},e===!0?{provide:Fv,useValue:!0}:[],{provide:Lv,useValue:t??Pv}]}function CA(n){return{enableLongStackTrace:!1,shouldCoalesceEventChangeDetection:n?.eventCoalescing??!1,shouldCoalesceRunChangeDetection:n?.runCoalescing??!1}}var EA=(()=>{class n{subscription=new ce;initialized=!1;zone=m(k);pendingTasks=m(Lo);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(()=>{k.assertNotInAngularZone(),queueMicrotask(()=>{t!==null&&!this.zone.hasPendingMacrotasks&&!this.zone.hasPendingMicrotasks&&(this.pendingTasks.remove(t),t=null)})}))}),this.subscription.add(this.zone.onUnstable.subscribe(()=>{k.assertInAngularZone(),t??=this.pendingTasks.add()}))}ngOnDestroy(){this.subscription.unsubscribe()}static \u0275fac=function(r){return new(r||n)};static \u0275prov=I({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var bA=(()=>{class n{appRef=m(Bn);taskService=m(Lo);ngZone=m(k);zonelessEnabled=m(Ov);tracing=m(wi,{optional:!0});disableScheduling=m(Fv,{optional:!0})??!1;zoneIsDefined=typeof Zone<"u"&&!!Zone.root.run;schedulerTickApplyArgs=[{data:{__scheduler_tick__:!0}}];subscriptions=new ce;angularZoneId=this.zoneIsDefined?this.ngZone._inner?.get(ml):null;scheduleInRootZone=!this.zonelessEnabled&&this.zoneIsDefined&&(m(Lv,{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 of||!this.zoneIsDefined)}notify(t){if(!this.zonelessEnabled&&t===5)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 6:{this.appRef.dirtyFlags|=2,r=!0;break}case 12:{this.appRef.dirtyFlags|=16,r=!0;break}case 13:{this.appRef.dirtyFlags|=2,r=!0;break}case 11:{r=!0;break}case 9:case 8:case 7:case 10:default:this.appRef.dirtyFlags|=8}if(this.appRef.tracingSnapshot=this.tracing?.snapshot(this.appRef.tracingSnapshot)??null,!this.shouldScheduleTick(r))return;let i=this.useMicrotaskScheduler?my:Vv;this.pendingRenderTaskId=this.taskService.add(),this.scheduleInRootZone?this.cancelScheduledCallback=Zone.root.run(()=>i(()=>this.tick())):this.cancelScheduledCallback=this.ngZone.runOutsideAngular(()=>i(()=>this.tick()))}shouldScheduleTick(t){return!(this.disableScheduling&&!t||this.appRef.destroyed||this.pendingRenderTaskId!==null||this.runningTick||this.appRef._runningTick||!this.zonelessEnabled&&this.zoneIsDefined&&Zone.current.get(ml+this.angularZoneId))}tick(){if(this.runningTick||this.appRef.destroyed)return;if(this.appRef.dirtyFlags===0){this.cleanup();return}!this.zonelessEnabled&&this.appRef.dirtyFlags&7&&(this.appRef.dirtyFlags|=1);let 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,my(()=>{this.useMicrotaskScheduler=!1,this.taskService.remove(t)})}ngOnDestroy(){this.subscriptions.unsubscribe(),this.cleanup()}cleanup(){if(this.runningTick=!1,this.cancelScheduledCallback?.(),this.cancelScheduledCallback=null,this.pendingRenderTaskId!==null){let t=this.pendingRenderTaskId;this.pendingRenderTaskId=null,this.taskService.remove(t)}}static \u0275fac=function(r){return new(r||n)};static \u0275prov=I({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();function IA(){return typeof $localize<"u"&&$localize.locale||bl}var jD=new E("",{providedIn:"root",factory:()=>m(jD,$.Optional|$.SkipSelf)||IA()});var Nf=new E(""),SA=new E("");function vo(n){return!n.moduleRef}function TA(n){let e=vo(n)?n.r3Injector:n.moduleRef.injector,t=e.get(k);return t.run(()=>{vo(n)?n.r3Injector.resolveInjectorInitializers():n.moduleRef.resolveInjectorInitializers();let r=e.get(Yt,null),i;if(t.runOutsideAngular(()=>{i=t.onError.subscribe({next:o=>{r.handleError(o)}})}),vo(n)){let o=()=>e.destroy(),s=n.platformInjector.get(Nf);s.add(o),e.onDestroy(()=>{i.unsubscribe(),s.delete(o)})}else{let o=()=>n.moduleRef.destroy(),s=n.platformInjector.get(Nf);s.add(o),n.moduleRef.onDestroy(()=>{Xa(n.allPlatformModules,n.moduleRef),i.unsubscribe(),s.delete(o)})}return xA(r,t,()=>{let o=e.get(OD);return o.runInitializers(),o.donePromise.then(()=>{let s=e.get(jD,bl);if(dA(s||bl),!e.get(SA,!0))return vo(n)?e.get(Bn):(n.allPlatformModules.push(n.moduleRef),n.moduleRef);if(vo(n)){let l=e.get(Bn);return n.rootComponent!==void 0&&l.bootstrap(n.rootComponent),l}else return MA(n.moduleRef,n.allPlatformModules),n.moduleRef})})})}function MA(n,e){let t=n.injector.get(Bn);if(n._bootstrapComponents.length>0)n._bootstrapComponents.forEach(r=>t.bootstrap(r));else if(n.instance.ngDoBootstrap)n.instance.ngDoBootstrap(t);else throw new v(-403,!1);e.push(n)}function xA(n,e,t){try{let r=t();return Ll(r)?r.catch(i=>{throw e.runOutsideAngular(()=>n.handleError(i)),i}):r}catch(r){throw e.runOutsideAngular(()=>n.handleError(r)),r}}var Ja=null;function AA(n=[],e){return Ve.create({name:e,providers:[{provide:Sl,useValue:"platform"},{provide:Nf,useValue:new Set([()=>Ja=null])},...n]})}function NA(n=[]){if(Ja)return Ja;let e=AA(n);return Ja=e,Bx(),RA(e),e}function RA(n){let e=n.get(th,null);gi(n,()=>{e?.forEach(t=>t())})}function Wo(){return!1}var Nr=(()=>{class n{static __NG_ELEMENT_ID__=kA}return n})();function kA(n){return PA(Dt(),se(),(n&16)===16)}function PA(n,e,t){if(_i(n)&&!t){let r=Qt(n.index,e);return new vl(r,r)}else if(n.type&175){let r=e[Nt];return new vl(r,e)}return null}var BD=(()=>{class n{constructor(t){}static \u0275fac=function(r){return new(r||n)(w(Bn))};static \u0275mod=Ce({type:n});static \u0275inj=we({})}return n})();function HD(n){let{rootComponent:e,appProviders:t,platformProviders:r,platformRef:i}=n;re(8);try{let o=i?.injector??NA(r),s=[wA({}),{provide:br,useExisting:bA},...t||[]],a=new Dl({providers:s,parent:o,debugName:"",runEnvironmentInitializers:!1});return TA({r3Injector:a.injector,platformInjector:o,rootComponent:e})}catch(o){return Promise.reject(o)}finally{re(9)}}function Gn(n){return typeof n=="boolean"?n:n!=null&&n!=="false"}function UD(n,e=NaN){return!isNaN(parseFloat(n))&&!isNaN(Number(n))?Number(n):e}function bn(n){return ld(n)}function bi(n,e){return rd(n,e?.equal)}var Vy=class{[Tt];constructor(e){this[Tt]=e}destroy(){this[Tt].destroy()}};function $D(n,e){let t=ai(n),r=e.elementInjector||Tl();return new Ao(t).create(r,e.projectableNodes,e.hostElement,e.environmentInjector)}var Me=new E("");var zD=null;function In(){return zD}function Ch(n){zD??=n}var Go=class{};var Eh=(()=>{class n{static \u0275fac=function(r){return new(r||n)};static \u0275mod=Ce({type:n});static \u0275inj=we({})}return n})();function bh(n,e){e=encodeURIComponent(e);for(let t of n.split(";")){let r=t.indexOf("="),[i,o]=r==-1?[t,""]:[t.slice(0,r),t.slice(r+1)];if(i.trim()===e)return decodeURIComponent(o)}return null}var jl="browser",GD="server";function Ih(n){return n===jl}function Ii(n){return n===GD}var qo=class{};var Ul=new E(""),xh=(()=>{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 v(5101,!1);return this._eventNameToPlugin.set(t,r),r}static \u0275fac=function(r){return new(r||n)(w(Ul),w(k))};static \u0275prov=I({token:n,factory:n.\u0275fac})}return n})(),Ko=class{_doc;constructor(e){this._doc=e}manager},Bl="ng-app-id";function qD(n){for(let e of n)e.remove()}function KD(n,e){let t=e.createElement("style");return t.textContent=n,t}function LA(n,e,t,r){let i=n.head?.querySelectorAll(`style[${Bl}="${e}"],link[${Bl}="${e}"]`);if(i)for(let o of i)o.removeAttribute(Bl),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]})}function Th(n,e){let t=e.createElement("link");return t.setAttribute("rel","stylesheet"),t.setAttribute("href",n),t}var Ah=(()=>{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=Ii(o),LA(t,r,this.inline,this.external),this.hosts.add(t.head)}addStyles(t,r){for(let i of t)this.addUsage(i,this.inline,KD);r?.forEach(i=>this.addUsage(i,this.external,Th))}removeStyles(t,r){for(let i of t)this.removeUsage(i,this.inline);r?.forEach(i=>this.removeUsage(i,this.external))}addUsage(t,r,i){let 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){let i=r.get(t);i&&(i.usage--,i.usage<=0&&(qD(i.elements),r.delete(t)))}ngOnDestroy(){for(let[,{elements:t}]of[...this.inline,...this.external])qD(t);this.hosts.clear()}addHost(t){this.hosts.add(t);for(let[r,{elements:i}]of this.inline)i.push(this.addElement(t,KD(r,this.doc)));for(let[r,{elements:i}]of this.external)i.push(this.addElement(t,Th(r,this.doc)))}removeHost(t){this.hosts.delete(t)}addElement(t,r){return this.nonce&&r.setAttribute("nonce",this.nonce),this.isServer&&r.setAttribute(Bl,this.appId),t.appendChild(r)}static \u0275fac=function(r){return new(r||n)(w(Me),w(jo),w(rh,8),w(ot))};static \u0275prov=I({token:n,factory:n.\u0275fac})}return n})(),Sh={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"},Nh=/%COMP%/g;var YD="%COMP%",VA=`_nghost-${YD}`,jA=`_ngcontent-${YD}`,BA=!0,HA=new E("",{providedIn:"root",factory:()=>BA});function UA(n){return jA.replace(Nh,n)}function $A(n){return VA.replace(Nh,n)}function ZD(n,e){return e.map(t=>t.replace(Nh,n))}var Zo=(()=>{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=Ii(a),this.defaultRenderer=new Qo(t,s,l,this.platformIsServer,this.tracingService)}createRenderer(t,r){if(!t||!r)return this.defaultRenderer;this.platformIsServer&&r.encapsulation===Zt.ShadowDom&&(r=de(H({},r),{encapsulation:Zt.Emulated}));let i=this.getOrCreateRenderer(t,r);return i instanceof Hl?i.applyToHost(t):i instanceof Yo&&i.applyStyles(),i}getOrCreateRenderer(t,r){let i=this.rendererByCompId,o=i.get(r.id);if(!o){let 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 Zt.Emulated:o=new Hl(l,c,r,this.appId,u,s,a,d,f);break;case Zt.ShadowDom:return new Mh(l,c,t,r,s,a,this.nonce,d,f);default:o=new Yo(l,c,r,u,s,a,d,f);break}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)(w(xh),w(Ah),w(jo),w(HA),w(Me),w(ot),w(k),w(rh),w(wi,8))};static \u0275prov=I({token:n,factory:n.\u0275fac})}return n})(),Qo=class{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(Sh[t]||t,e):this.doc.createElement(e)}createComment(e){return this.doc.createComment(e)}createText(e){return this.doc.createTextNode(e)}appendChild(e,t){(QD(e)?e.content:e).appendChild(t)}insertBefore(e,t,r){e&&(QD(e)?e.content:e).insertBefore(t,r)}removeChild(e,t){t.remove()}selectRootElement(e,t){let r=typeof e=="string"?this.doc.querySelector(e):e;if(!r)throw new v(-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;let o=Sh[i];o?e.setAttributeNS(o,t,r):e.setAttribute(t,r)}else e.setAttribute(t,r)}removeAttribute(e,t,r){if(r){let i=Sh[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&(jn.DashCase|jn.Important)?e.style.setProperty(t,r,i&jn.Important?"important":""):e.style[t]=r}removeStyle(e,t,r){r&jn.DashCase?e.style.removeProperty(t):e.style[t]=""}setProperty(e,t,r){e!=null&&(e[t]=r)}setValue(e,t){e.nodeValue=t}listen(e,t,r,i){if(typeof e=="string"&&(e=In().getGlobalEventTarget(this.doc,e),!e))throw new v(5102,!1);let o=this.decoratePreventDefault(r);return this.tracingService?.wrapEventListener&&(o=this.tracingService.wrapEventListener(e,t,o)),this.eventManager.addEventListener(e,t,o,i)}decoratePreventDefault(e){return t=>{if(t==="__ngUnwrap__")return e;(this.platformIsServer?this.ngZone.runGuarded(()=>e(t)):e(t))===!1&&t.preventDefault()}}};function QD(n){return n.tagName==="TEMPLATE"&&n.content!==void 0}var Mh=class extends Qo{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=ZD(i.id,u);for(let f of u){let h=document.createElement("style");a&&h.setAttribute("nonce",a),h.textContent=f,this.shadowRoot.appendChild(h)}let d=i.getExternalStyles?.();if(d)for(let f of d){let h=Th(f,o);a&&h.setAttribute("nonce",a),this.shadowRoot.appendChild(h)}}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)}},Yo=class extends Qo{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?ZD(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)}},Hl=class extends Yo{contentAttr;hostAttr;constructor(e,t,r,i,o,s,a,l,c){let u=i+"-"+r.id;super(e,t,r,o,s,a,l,c,u),this.contentAttr=UA(u),this.hostAttr=$A(u)}applyToHost(e){this.applyStyles(),this.setAttribute(e,this.hostAttr,"")}createElement(e,t){let r=super.createElement(e,t);return super.setAttribute(r,this.contentAttr,""),r}};var $l=class n extends Go{supportsDOMEvents=!0;static makeCurrent(){Ch(new n)}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(),t.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 t==="window"?window:t==="document"?e:t==="body"?e.body:null}getBaseHref(e){let t=zA();return t==null?null:WA(t)}resetBaseElement(){Xo=null}getUserAgent(){return window.navigator.userAgent}getCookie(e){return bh(document.cookie,e)}},Xo=null;function zA(){return Xo=Xo||document.head.querySelector("base"),Xo?Xo.getAttribute("href"):null}function WA(n){return new URL(n,document.baseURI).pathname}var zl=class{addToWindow(e){Hn.getAngularTestability=(r,i=!0)=>{let o=e.findTestabilityInTree(r,i);if(o==null)throw new v(5103,!1);return o},Hn.getAllAngularTestabilities=()=>e.getAllTestabilities(),Hn.getAllAngularRootElements=()=>e.getAllRootElements();let t=r=>{let i=Hn.getAllAngularTestabilities(),o=i.length,s=function(){o--,o==0&&r()};i.forEach(a=>{a.whenStable(s)})};Hn.frameworkStabilizers||(Hn.frameworkStabilizers=[]),Hn.frameworkStabilizers.push(t)}findTestabilityInTree(e,t,r){if(t==null)return null;let i=e.getTestability(t);return i??(r?In().isShadowRoot(t)?this.findTestabilityInTree(e,t.host,!0):this.findTestabilityInTree(e,t.parentElement,!0):null)}},GA=(()=>{class n{build(){return new XMLHttpRequest}static \u0275fac=function(r){return new(r||n)};static \u0275prov=I({token:n,factory:n.\u0275fac})}return n})(),JD=(()=>{class n extends Ko{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)(w(Me))};static \u0275prov=I({token:n,factory:n.\u0275fac})}return n})(),XD=["alt","control","meta","shift"],qA={"\b":"Backspace"," ":"Tab","\x7F":"Delete","\x1B":"Escape",Del:"Delete",Esc:"Escape",Left:"ArrowLeft",Right:"ArrowRight",Up:"ArrowUp",Down:"ArrowDown",Menu:"ContextMenu",Scroll:"ScrollLock",Win:"OS"},KA={alt:n=>n.altKey,control:n=>n.ctrlKey,meta:n=>n.metaKey,shift:n=>n.shiftKey},ew=(()=>{class n extends Ko{constructor(t){super(t)}supports(t){return n.parseEventName(t)!=null}addEventListener(t,r,i,o){let s=n.parseEventName(r),a=n.eventCallback(s.fullKey,i,this.manager.getZone());return this.manager.getZone().runOutsideAngular(()=>In().onAndCancel(t,s.domEventName,a,o))}static parseEventName(t){let r=t.toLowerCase().split("."),i=r.shift();if(r.length===0||!(i==="keydown"||i==="keyup"))return null;let o=n._normalizeKey(r.pop()),s="",a=r.indexOf("code");if(a>-1&&(r.splice(a,1),s="code."),XD.forEach(c=>{let u=r.indexOf(c);u>-1&&(r.splice(u,1),s+=c+".")}),s+=o,r.length!=0||o.length===0)return null;let l={};return l.domEventName=i,l.fullKey=s,l}static matchEventFullKeyCode(t,r){let i=qA[t.key]||t.key,o="";return r.indexOf("code.")>-1&&(i=t.code,o="code."),i==null||!i?!1:(i=i.toLowerCase(),i===" "?i="space":i==="."&&(i="dot"),XD.forEach(s=>{if(s!==i){let a=KA[s];a(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 t==="esc"?"escape":t}static \u0275fac=function(r){return new(r||n)(w(Me))};static \u0275prov=I({token:n,factory:n.\u0275fac})}return n})();function Rh(n,e,t){return HD(H({rootComponent:n,platformRef:t?.platformRef},QA(e)))}function QA(n){return{appProviders:[...tw,...n?.providers??[]],platformProviders:JA}}function YA(){$l.makeCurrent()}function ZA(){return new Yt}function XA(){return qv(document),document}var JA=[{provide:ot,useValue:jl},{provide:th,useValue:YA,multi:!0},{provide:Me,useFactory:XA}];var eN=[{provide:$o,useClass:zl},{provide:Dh,useClass:Ol,deps:[k,Fl,$o]},{provide:Ol,useClass:Ol,deps:[k,Fl,$o]}],tw=[{provide:Sl,useValue:"root"},{provide:Yt,useFactory:ZA},{provide:Ul,useClass:JD,multi:!0,deps:[Me]},{provide:Ul,useClass:ew,multi:!0,deps:[Me]},Zo,Ah,xh,{provide:Je,useExisting:Zo},{provide:qo,useClass:GA},[]],kh=(()=>{class n{constructor(){}static \u0275fac=function(r){return new(r||n)};static \u0275mod=Ce({type:n});static \u0275inj=we({providers:[...tw,...eN],imports:[Eh,BD]})}return n})();var V=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}(V||{}),Pt="*";function nw(n,e=null){return{type:V.Sequence,steps:n,options:e}}function Ph(n){return{type:V.Style,styles:n,offset:null}}var Sn=class{_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){let t=e=="start"?this._onStartFns:this._onDoneFns;t.forEach(r=>r()),t.length=0}},Si=class{_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,o=this.players.length;o==0?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){let t=e*this.totalTime;this.players.forEach(r=>{let i=r.totalTime?Math.min(1,t/r.totalTime):1;r.setPosition(i)})}getPosition(){let e=this.players.reduce((t,r)=>t===null||r.totalTime>t.totalTime?r:t,null);return e!=null?e.getPosition():0}beforeDestroy(){this.players.forEach(e=>{e.beforeDestroy&&e.beforeDestroy()})}triggerCallback(e){let t=e=="start"?this._onStartFns:this._onDoneFns;t.forEach(r=>r()),t.length=0}},Jo="!";function rw(n){return new v(3e3,!1)}function tN(){return new v(3100,!1)}function nN(){return new v(3101,!1)}function rN(n){return new v(3001,!1)}function iN(n){return new v(3003,!1)}function oN(n){return new v(3004,!1)}function ow(n,e){return new v(3005,!1)}function sw(){return new v(3006,!1)}function aw(){return new v(3007,!1)}function lw(n,e){return new v(3008,!1)}function cw(n){return new v(3002,!1)}function uw(n,e,t,r,i){return new v(3010,!1)}function dw(){return new v(3011,!1)}function fw(){return new v(3012,!1)}function hw(){return new v(3200,!1)}function pw(){return new v(3202,!1)}function gw(){return new v(3013,!1)}function mw(n){return new v(3014,!1)}function _w(n){return new v(3015,!1)}function yw(n){return new v(3016,!1)}function vw(n,e){return new v(3404,!1)}function sN(n){return new v(3502,!1)}function Dw(n){return new v(3503,!1)}function ww(){return new v(3300,!1)}function Cw(n){return new v(3504,!1)}function Ew(n){return new v(3301,!1)}function bw(n,e){return new v(3302,!1)}function Iw(n){return new v(3303,!1)}function Sw(n,e){return new v(3400,!1)}function Tw(n){return new v(3401,!1)}function Mw(n){return new v(3402,!1)}function xw(n,e){return new v(3505,!1)}function Tn(n){switch(n.length){case 0:return new Sn;case 1:return n[0];default:return new Si(n)}}function Vh(n,e,t=new Map,r=new Map){let i=[],o=[],s=-1,a=null;if(e.forEach(l=>{let c=l.get("offset"),u=c==s,d=u&&a||new Map;l.forEach((f,h)=>{let p=h,g=f;if(h!=="offset")switch(p=n.normalizePropertyName(p,i),g){case Jo:g=t.get(h);break;case Pt:g=r.get(h);break;default:g=n.normalizeStyleValue(h,p,g,i);break}d.set(p,g)}),u||o.push(d),a=d,s=c}),i.length)throw sN(i);return o}function Wl(n,e,t,r){switch(e){case"start":n.onStart(()=>r(t&&Oh(t,"start",n)));break;case"done":n.onDone(()=>r(t&&Oh(t,"done",n)));break;case"destroy":n.onDestroy(()=>r(t&&Oh(t,"destroy",n)));break}}function Oh(n,e,t){let r=t.totalTime,i=!!t.disabled,o=Gl(n.element,n.triggerName,n.fromState,n.toState,e||n.phaseName,r??n.totalTime,i),s=n._data;return s!=null&&(o._data=s),o}function Gl(n,e,t,r,i="",o=0,s){return{element:n,triggerName:e,fromState:t,toState:r,phaseName:i,totalTime:o,disabled:!!s}}function tt(n,e,t){let r=n.get(e);return r||n.set(e,r=t),r}function jh(n){let e=n.indexOf(":"),t=n.substring(1,e),r=n.slice(e+1);return[t,r]}var aN=typeof document>"u"?null:document.documentElement;function ql(n){let e=n.parentNode||n.host||null;return e===aN?null:e}function lN(n){return n.substring(1,6)=="ebkit"}var Rr=null,iw=!1;function Aw(n){Rr||(Rr=cN()||{},iw=Rr.style?"WebkitAppearance"in Rr.style:!1);let e=!0;return Rr.style&&!lN(n)&&(e=n in Rr.style,!e&&iw&&(e="Webkit"+n.charAt(0).toUpperCase()+n.slice(1)in Rr.style)),e}function cN(){return typeof document<"u"?document.body:null}function Bh(n,e){for(;e;){if(e===n)return!0;e=ql(e)}return!1}function Hh(n,e,t){if(t)return Array.from(n.querySelectorAll(e));let r=n.querySelector(e);return r?[r]:[]}var uN=1e3,Uh="{{",dN="}}",$h="ng-enter",Kl="ng-leave",es="ng-trigger",ts=".ng-trigger",zh="ng-animating",Ql=".ng-animating";function rn(n){if(typeof n=="number")return n;let e=n.match(/^(-?[\.\d]+)(m?s)/);return!e||e.length<2?0:Fh(parseFloat(e[1]),e[2])}function Fh(n,e){switch(e){case"s":return n*uN;default:return n}}function ns(n,e,t){return n.hasOwnProperty("duration")?n:fN(n,e,t)}function fN(n,e,t){let r=/^(-?[\.\d]+)(m?s)(?:\s+(-?[\.\d]+)(m?s))?(?:\s+([-a-z]+(?:\(.+?\))?))?$/i,i,o=0,s="";if(typeof n=="string"){let a=n.match(r);if(a===null)return e.push(rw(n)),{duration:0,delay:0,easing:""};i=Fh(parseFloat(a[1]),a[2]);let l=a[3];l!=null&&(o=Fh(parseFloat(l),a[4]));let c=a[5];c&&(s=c)}else i=n;if(!t){let a=!1,l=e.length;i<0&&(e.push(tN()),a=!0),o<0&&(e.push(nN()),a=!0),a&&e.splice(l,0,rw(n))}return{duration:i,delay:o,easing:s}}function Nw(n){return n.length?n[0]instanceof Map?n:n.map(e=>new Map(Object.entries(e))):[]}function Ot(n,e,t){e.forEach((r,i)=>{let o=Yl(i);t&&!t.has(i)&&t.set(i,n.style[o]),n.style[o]=r})}function qn(n,e){e.forEach((t,r)=>{let i=Yl(r);n.style[i]=""})}function Ti(n){return Array.isArray(n)?n.length==1?n[0]:nw(n):n}function Rw(n,e,t){let r=e.params||{},i=Wh(n);i.length&&i.forEach(o=>{r.hasOwnProperty(o)||t.push(rN(o))})}var Lh=new RegExp(`${Uh}\\s*(.+?)\\s*${dN}`,"g");function Wh(n){let e=[];if(typeof n=="string"){let t;for(;t=Lh.exec(n);)e.push(t[1]);Lh.lastIndex=0}return e}function Mi(n,e,t){let r=`${n}`,i=r.replace(Lh,(o,s)=>{let a=e[s];return a==null&&(t.push(iN(s)),a=""),a.toString()});return i==r?n:i}var hN=/-+([a-z0-9])/g;function Yl(n){return n.replace(hN,(...e)=>e[1].toUpperCase())}function kw(n,e){return n===0||e===0}function Pw(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;o<e.length;o++){let s=e[o];i.forEach(a=>s.set(a,Zl(n,a)))}}return e}function nt(n,e,t){switch(e.type){case V.Trigger:return n.visitTrigger(e,t);case V.State:return n.visitState(e,t);case V.Transition:return n.visitTransition(e,t);case V.Sequence:return n.visitSequence(e,t);case V.Group:return n.visitGroup(e,t);case V.Animate:return n.visitAnimate(e,t);case V.Keyframes:return n.visitKeyframes(e,t);case V.Style:return n.visitStyle(e,t);case V.Reference:return n.visitReference(e,t);case V.AnimateChild:return n.visitAnimateChild(e,t);case V.AnimateRef:return n.visitAnimateRef(e,t);case V.Query:return n.visitQuery(e,t);case V.Stagger:return n.visitStagger(e,t);default:throw oN(e.type)}}function Zl(n,e){return window.getComputedStyle(n)[e]}var lp=(()=>{class n{validateStyleProperty(t){return Aw(t)}containsElement(t,r){return Bh(t,r)}getParentElement(t){return ql(t)}query(t,r,i){return Hh(t,r,i)}computeStyle(t,r,i){return i||""}animate(t,r,i,o,s,a=[],l){return new Sn(i,o)}static \u0275fac=function(r){return new(r||n)};static \u0275prov=I({token:n,factory:n.\u0275fac})}return n})(),Pr=class{static NOOP=new lp},Or=class{};var pN=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"]),nc=class extends Or{normalizePropertyName(e,t){return Yl(e)}normalizeStyleValue(e,t,r,i){let o="",s=r.toString().trim();if(pN.has(t)&&r!==0&&r!=="0")if(typeof r=="number")o="px";else{let a=r.match(/^[+-]?[\d\.]+([a-z]*)$/);a&&a[1].length==0&&i.push(ow(e,r))}return s+o}};var rc="*";function gN(n,e){let t=[];return typeof n=="string"?n.split(/\s*,\s*/).forEach(r=>mN(r,t,e)):t.push(n),t}function mN(n,e,t){if(n[0]==":"){let l=_N(n,t);if(typeof l=="function"){e.push(l);return}n=l}let r=n.match(/^(\*|[-\w]+)\s*(<?[=-]>)\s*(\*|[-\w]+)$/);if(r==null||r.length<4)return t.push(_w(n)),e;let i=r[1],o=r[2],s=r[3];e.push(Ow(i,s));let a=i==rc&&s==rc;o[0]=="<"&&!a&&e.push(Ow(s,i))}function _N(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)<parseFloat(t);default:return e.push(yw(n)),"* => *"}}var Xl=new Set(["true","1"]),Jl=new Set(["false","0"]);function Ow(n,e){let t=Xl.has(n)||Jl.has(n),r=Xl.has(e)||Jl.has(e);return(i,o)=>{let s=n==rc||n==i,a=e==rc||e==o;return!s&&t&&typeof i=="boolean"&&(s=i?Xl.has(n):Jl.has(n)),!a&&r&&typeof o=="boolean"&&(a=o?Xl.has(e):Jl.has(e)),s&&a}}var Ww=":self",yN=new RegExp(`s*${Ww}s*,?`,"g");function Gw(n,e,t,r){return new Zh(n).build(e,t,r)}var Fw="",Zh=class{_driver;constructor(e){this._driver=e}build(e,t,r){let i=new Xh(t);return this._resetContextStyleTimingState(i),nt(this,Ti(e),i)}_resetContextStyleTimingState(e){e.currentQuerySelector=Fw,e.collectedStyles=new Map,e.collectedStyles.set(Fw,new Map),e.currentTime=0}visitTrigger(e,t){let r=t.queryCount=0,i=t.depCount=0,o=[],s=[];return e.name.charAt(0)=="@"&&t.errors.push(sw()),e.definitions.forEach(a=>{if(this._resetContextStyleTimingState(t),a.type==V.State){let 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==V.Transition){let l=this.visitTransition(a,t);r+=l.queryCount,i+=l.depCount,s.push(l)}else t.errors.push(aw())}),{type:V.Trigger,name:e.name,states:o,transitions:s,queryCount:r,depCount:i,options:null}}visitState(e,t){let r=this.visitStyle(e.styles,t),i=e.options&&e.options.params||null;if(r.containsDynamicStyles){let o=new Set,s=i||{};r.styles.forEach(a=>{a instanceof Map&&a.forEach(l=>{Wh(l).forEach(c=>{s.hasOwnProperty(c)||o.add(c)})})}),o.size&&t.errors.push(lw(e.name,[...o.values()]))}return{type:V.State,name:e.name,style:r,options:i?{params:i}:null}}visitTransition(e,t){t.queryCount=0,t.depCount=0;let r=nt(this,Ti(e.animation),t),i=gN(e.expr,t.errors);return{type:V.Transition,matchers:i,animation:r,queryCount:t.queryCount,depCount:t.depCount,options:kr(e.options)}}visitSequence(e,t){return{type:V.Sequence,steps:e.steps.map(r=>nt(this,r,t)),options:kr(e.options)}}visitGroup(e,t){let r=t.currentTime,i=0,o=e.steps.map(s=>{t.currentTime=r;let a=nt(this,s,t);return i=Math.max(i,t.currentTime),a});return t.currentTime=i,{type:V.Group,steps:o,options:kr(e.options)}}visitAnimate(e,t){let r=CN(e.timings,t.errors);t.currentAnimateTimings=r;let i,o=e.styles?e.styles:Ph({});if(o.type==V.Keyframes)i=this.visitKeyframes(o,t);else{let s=e.styles,a=!1;if(!s){a=!0;let c={};r.easing&&(c.easing=r.easing),s=Ph(c)}t.currentTime+=r.duration+r.delay;let l=this.visitStyle(s,t);l.isEmptyStep=a,i=l}return t.currentAnimateTimings=null,{type:V.Animate,timings:r,style:i,options:null}}visitStyle(e,t){let r=this._makeStyleAst(e,t);return this._validateStyleAst(r,t),r}_makeStyleAst(e,t){let r=[],i=Array.isArray(e.styles)?e.styles:[e.styles];for(let a of i)typeof a=="string"?a===Pt?r.push(a):t.errors.push(cw(a)):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(Uh)>=0){o=!0;break}}}),{type:V.Style,styles:r,easing:s,offset:e.offset,containsDynamicStyles:o,options:null}}_validateStyleAst(e,t){let r=t.currentAnimateTimings,i=t.currentTime,o=t.currentTime;r&&o>0&&(o-=r.duration+r.delay),e.styles.forEach(s=>{typeof s!="string"&&s.forEach((a,l)=>{let c=t.collectedStyles.get(t.currentQuerySelector),u=c.get(l),d=!0;u&&(o!=i&&o>=u.startTime&&i<=u.endTime&&(t.errors.push(uw(l,u.startTime,u.endTime,o,i)),d=!1),o=u.startTime),d&&c.set(l,{startTime:o,endTime:i}),t.options&&Rw(a,t.options,t.errors)})})}visitKeyframes(e,t){let r={type:V.Keyframes,styles:[],options:null};if(!t.currentAnimateTimings)return t.errors.push(dw()),r;let i=1,o=0,s=[],a=!1,l=!1,c=0,u=e.steps.map(D=>{let M=this._makeStyleAst(D,t),A=M.offset!=null?M.offset:wN(M.styles),J=0;return A!=null&&(o++,J=M.offset=A),l=l||J<0||J>1,a=a||J<c,c=J,s.push(J),M});l&&t.errors.push(fw()),a&&t.errors.push(hw());let d=e.steps.length,f=0;o>0&&o<d?t.errors.push(pw()):o==0&&(f=i/(d-1));let h=d-1,p=t.currentTime,g=t.currentAnimateTimings,_=g.duration;return u.forEach((D,M)=>{let A=f>0?M==h?1:f*M:s[M],J=A*_;t.currentTime=p+g.delay+J,g.duration=J,this._validateStyleAst(D,t),D.offset=A,r.styles.push(D)}),r}visitReference(e,t){return{type:V.Reference,animation:nt(this,Ti(e.animation),t),options:kr(e.options)}}visitAnimateChild(e,t){return t.depCount++,{type:V.AnimateChild,options:kr(e.options)}}visitAnimateRef(e,t){return{type:V.AnimateRef,animation:this.visitReference(e.animation,t),options:kr(e.options)}}visitQuery(e,t){let r=t.currentQuerySelector,i=e.options||{};t.queryCount++,t.currentQuery=e;let[o,s]=vN(e.selector);t.currentQuerySelector=r.length?r+" "+o:o,tt(t.collectedStyles,t.currentQuerySelector,new Map);let a=nt(this,Ti(e.animation),t);return t.currentQuery=null,t.currentQuerySelector=r,{type:V.Query,selector:o,limit:i.limit||0,optional:!!i.optional,includeSelf:s,animation:a,originalSelector:e.selector,options:kr(e.options)}}visitStagger(e,t){t.currentQuery||t.errors.push(gw());let r=e.timings==="full"?{duration:0,delay:0,easing:"full"}:ns(e.timings,t.errors,!0);return{type:V.Stagger,animation:nt(this,Ti(e.animation),t),timings:r,options:null}}};function vN(n){let e=!!n.split(/\s*,\s*/).find(t=>t==Ww);return e&&(n=n.replace(yN,"")),n=n.replace(/@\*/g,ts).replace(/@\w+/g,t=>ts+"-"+t.slice(1)).replace(/:animating/g,Ql),[n,e]}function DN(n){return n?H({},n):null}var Xh=class{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 wN(n){if(typeof n=="string")return null;let e=null;if(Array.isArray(n))n.forEach(t=>{if(t instanceof Map&&t.has("offset")){let r=t;e=parseFloat(r.get("offset")),r.delete("offset")}});else if(n instanceof Map&&n.has("offset")){let t=n;e=parseFloat(t.get("offset")),t.delete("offset")}return e}function CN(n,e){if(n.hasOwnProperty("duration"))return n;if(typeof n=="number"){let o=ns(n,e).duration;return Gh(o,0,"")}let t=n;if(t.split(/\s+/).some(o=>o.charAt(0)=="{"&&o.charAt(1)=="{")){let o=Gh(0,0,"");return o.dynamic=!0,o.strValue=t,o}let i=ns(t,e);return Gh(i.duration,i.delay,i.easing)}function kr(n){return n?(n=H({},n),n.params&&(n.params=DN(n.params))):n={},n}function Gh(n,e,t){return{duration:n,delay:e,easing:t}}function cp(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}}var is=class{_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()}},EN=1,bN=":enter",IN=new RegExp(bN,"g"),SN=":leave",TN=new RegExp(SN,"g");function qw(n,e,t,r,i,o=new Map,s=new Map,a,l,c=[]){return new Jh().buildKeyframes(n,e,t,r,i,o,s,a,l,c)}var Jh=class{buildKeyframes(e,t,r,i,o,s,a,l,c,u=[]){c=c||new is;let d=new ep(e,t,c,i,o,u,[]);d.options=l;let f=l.delay?rn(l.delay):0;d.currentTimeline.delayNextStep(f),d.currentTimeline.setStyles([s],null,d.errors,l),nt(this,r,d);let h=d.timelines.filter(p=>p.containsAnimation());if(h.length&&a.size){let p;for(let g=h.length-1;g>=0;g--){let _=h[g];if(_.element===t){p=_;break}}p&&!p.allowOnlyTimelineStyles()&&p.setStyles([a],null,d.errors,l)}return h.length?h.map(p=>p.buildKeyframes()):[cp(t,[],[],[],0,f,"",!1)]}visitTrigger(e,t){}visitState(e,t){}visitTransition(e,t){}visitAnimateChild(e,t){let r=t.subInstructions.get(t.element);if(r){let 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){let 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(let i of e){let o=i?.delay;if(o){let s=typeof o=="number"?o:rn(Mi(o,i?.params??{},t.errors));r.delayNextStep(s)}}}_visitSubInstructions(e,t,r){let o=t.currentTimeline.currentTime,s=r.duration!=null?rn(r.duration):null,a=r.delay!=null?rn(r.delay):null;return s!==0&&e.forEach(l=>{let c=t.appendInstructionToTimeline(l,s,a);o=Math.max(o,c.duration+c.delay)}),o}visitReference(e,t){t.updateOptions(e.options,!0),nt(this,e.animation,t),t.previousNode=e}visitSequence(e,t){let r=t.subContextCount,i=t,o=e.options;if(o&&(o.params||o.delay)&&(i=t.createSubContext(o),i.transformIntoNewTimeline(),o.delay!=null)){i.previousNode.type==V.Style&&(i.currentTimeline.snapshotCurrentStyles(),i.previousNode=ic);let s=rn(o.delay);i.delayNextStep(s)}e.steps.length&&(e.steps.forEach(s=>nt(this,s,i)),i.currentTimeline.applyStylesToKeyframe(),i.subContextCount>r&&i.transformIntoNewTimeline()),t.previousNode=e}visitGroup(e,t){let r=[],i=t.currentTimeline.currentTime,o=e.options&&e.options.delay?rn(e.options.delay):0;e.steps.forEach(s=>{let a=t.createSubContext(e.options);o&&a.delayNextStep(o),nt(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){let r=e.strValue,i=t.params?Mi(r,t.params,t.errors):r;return ns(i,t.errors)}else return{duration:e.duration,delay:e.delay,easing:e.easing}}visitAnimate(e,t){let r=t.currentAnimateTimings=this._visitTiming(e.timings,t),i=t.currentTimeline;r.delay&&(t.incrementTime(r.delay),i.snapshotCurrentStyles());let o=e.style;o.type==V.Keyframes?this.visitKeyframes(o,t):(t.incrementTime(r.duration),this.visitStyle(o,t),i.applyStylesToKeyframe()),t.currentAnimateTimings=null,t.previousNode=e}visitStyle(e,t){let r=t.currentTimeline,i=t.currentAnimateTimings;!i&&r.hasCurrentStyleProperties()&&r.forwardFrame();let 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){let r=t.currentAnimateTimings,i=t.currentTimeline.duration,o=r.duration,a=t.createSubContext().currentTimeline;a.easing=r.easing,e.styles.forEach(l=>{let c=l.offset||0;a.forwardTime(c*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){let r=t.currentTimeline.currentTime,i=e.options||{},o=i.delay?rn(i.delay):0;o&&(t.previousNode.type===V.Style||r==0&&t.currentTimeline.hasCurrentStyleProperties())&&(t.currentTimeline.snapshotCurrentStyles(),t.previousNode=ic);let s=r,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;let d=t.createSubContext(e.options,c);o&&d.delayNextStep(o),c===t.element&&(l=d.currentTimeline),nt(this,e.animation,d),d.currentTimeline.applyStylesToKeyframe();let f=d.currentTimeline.currentTime;s=Math.max(s,f)}),t.currentQueryIndex=0,t.currentQueryTotal=0,t.transformIntoNewTimeline(s),l&&(t.currentTimeline.mergeTimelineCollectedStyles(l),t.currentTimeline.snapshotCurrentStyles()),t.previousNode=e}visitStagger(e,t){let r=t.parentContext,i=t.currentTimeline,o=e.timings,s=Math.abs(o.duration),a=s*(t.currentQueryTotal-1),l=s*t.currentQueryIndex;switch(o.duration<0?"reverse":o.easing){case"reverse":l=a-l;break;case"full":l=r.currentStaggerTime;break}let u=t.currentTimeline;l&&u.delayNextStep(l);let d=u.currentTime;nt(this,e.animation,t),t.previousNode=e,r.currentStaggerTime=i.currentTime-d+(i.startTime-r.currentTimeline.startTime)}},ic={},ep=class n{_driver;element;subInstructions;_enterClassName;_leaveClassName;errors;timelines;parentContext=null;currentTimeline;currentAnimateTimings=null;previousNode=ic;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 oc(this._driver,t,0),a.push(this.currentTimeline)}get params(){return this.options.params}updateOptions(e,t){if(!e)return;let r=e,i=this.options;r.duration!=null&&(i.duration=rn(r.duration)),r.delay!=null&&(i.delay=rn(r.delay));let 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]=Mi(o[a],s,this.errors))})}}_copyOptions(){let e={};if(this.options){let t=this.options.params;if(t){let r=e.params={};Object.keys(t).forEach(i=>{r[i]=t[i]})}}return e}createSubContext(e=null,t,r){let i=t||this.element,o=new n(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=ic,this.currentTimeline=this.currentTimeline.fork(this.element,e),this.timelines.push(this.currentTimeline),this.currentTimeline}appendInstructionToTimeline(e,t,r){let i={duration:t??e.duration,delay:this.currentTimeline.currentTime+(r??0)+e.delay,easing:""},o=new tp(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.replace(IN,"."+this._enterClassName),e=e.replace(TN,"."+this._leaveClassName);let l=r!=1,c=this._driver.query(this.element,e,l);r!==0&&(c=r<0?c.slice(c.length+r,c.length):c.slice(0,r)),a.push(...c)}return!o&&a.length==0&&s.push(mw(t)),a}},oc=class n{_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){let t=this._keyframes.size===1&&this._pendingStyles.size;this.duration||t?(this.forwardTime(this.currentTime+e),t&&this.snapshotCurrentStyles()):this.startTime+=e}fork(e,t){return this.applyStylesToKeyframe(),new n(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+=EN,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||Pt),this._currentKeyframe.set(t,Pt);this._currentEmptyStepKeyframe=this._currentKeyframe}setStyles(e,t,r,i){t&&this._previousKeyframe.set("easing",t);let o=i&&i.params||{},s=MN(e,this._globalTimelineStyles);for(let[a,l]of s){let c=Mi(l,o,r);this._pendingStyles.set(a,c),this._localTimelineStyles.has(a)||this._backFill.set(a,this._globalTimelineStyles.get(a)??Pt),this._updateStyle(a,c)}}applyStylesToKeyframe(){this._pendingStyles.size!=0&&(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(){let e=[];for(let t in this._currentKeyframe)e.push(t);return e}mergeTimelineCollectedStyles(e){e._styleSummary.forEach((t,r)=>{let i=this._styleSummary.get(r);(!i||t.time>i.time)&&this._updateStyle(r,t.value)})}buildKeyframes(){this.applyStylesToKeyframe();let e=new Set,t=new Set,r=this._keyframes.size===1&&this.duration===0,i=[];this._keyframes.forEach((a,l)=>{let c=new Map([...this._backFill,...a]);c.forEach((u,d)=>{u===Jo?e.add(d):u===Pt&&t.add(d)}),r||c.set("offset",l/this.duration),i.push(c)});let o=[...e.values()],s=[...t.values()];if(r){let a=i[0],l=new Map(a);a.set("offset",0),l.set("offset",1),i=[a,l]}return cp(this.element,i,o,s,this.duration,this.startTime,this.easing,!1)}},tp=class extends oc{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){let o=[],s=r+t,a=t/s,l=new Map(e[0]);l.set("offset",0),o.push(l);let c=new Map(e[0]);c.set("offset",Lw(a)),o.push(c);let u=e.length-1;for(let d=1;d<=u;d++){let f=new Map(e[d]),h=f.get("offset"),p=t+h*r;f.set("offset",Lw(p/s)),o.push(f)}r=s,t=0,i="",e=o}return cp(this.element,e,this.preStyleProps,this.postStyleProps,r,t,i,!0)}};function Lw(n,e=3){let t=Math.pow(10,e-1);return Math.round(n*t)/t}function MN(n,e){let t=new Map,r;return n.forEach(i=>{if(i==="*"){r??=e.keys();for(let o of r)t.set(o,Pt)}else for(let[o,s]of i)t.set(o,s)}),t}function Vw(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}}var qh={},sc=class{_triggerName;ast;_stateStyles;constructor(e,t,r){this._triggerName=e,this.ast=t,this._stateStyles=r}match(e,t,r,i){return xN(this.ast.matchers,e,t,r,i)}buildStyles(e,t,r){let i=this._stateStyles.get("*");return e!==void 0&&(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){let d=[],f=this.ast.options&&this.ast.options.params||qh,h=a&&a.params||qh,p=this.buildStyles(r,h,d),g=l&&l.params||qh,_=this.buildStyles(i,g,d),D=new Set,M=new Map,A=new Map,J=i==="void",Pe={params:Kw(g,f),delay:this.ast.options?.delay},jt=u?[]:qw(e,t,this.ast.animation,o,s,p,_,Pe,c,d),Be=0;return jt.forEach(Ye=>{Be=Math.max(Ye.duration+Ye.delay,Be)}),d.length?Vw(t,this._triggerName,r,i,J,p,_,[],[],M,A,Be,d):(jt.forEach(Ye=>{let ar=Ye.element,Wr=tt(M,ar,new Set);Ye.preStyleProps.forEach(lr=>Wr.add(lr));let Qm=tt(A,ar,new Set);Ye.postStyleProps.forEach(lr=>Qm.add(lr)),ar!==t&&D.add(ar)}),Vw(t,this._triggerName,r,i,J,p,_,jt,[...D.values()],M,A,Be))}};function xN(n,e,t,r,i){return n.some(o=>o(e,t,r,i))}function Kw(n,e){let t=H({},e);return Object.entries(n).forEach(([r,i])=>{i!=null&&(t[r]=i)}),t}var np=class{styles;defaultParams;normalizer;constructor(e,t,r){this.styles=e,this.defaultParams=t,this.normalizer=r}buildStyles(e,t){let r=new Map,i=Kw(e,this.defaultParams);return this.styles.styles.forEach(o=>{typeof o!="string"&&o.forEach((s,a)=>{s&&(s=Mi(s,i,t));let l=this.normalizer.normalizePropertyName(a,t);s=this.normalizer.normalizeStyleValue(a,l,s,t),r.set(a,s)})}),r}};function AN(n,e,t){return new rp(n,e,t)}var rp=class{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=>{let o=i.options&&i.options.params||{};this.states.set(i.name,new np(i.style,o,r))}),jw(this.states,"true","1"),jw(this.states,"false","0"),t.transitions.forEach(i=>{this.transitionFactories.push(new sc(e,i,this.states))}),this.fallbackTransition=NN(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 NN(n,e,t){let r=[(s,a)=>!0],i={type:V.Sequence,steps:[],options:null},o={type:V.Transition,animation:i,matchers:r,options:null,queryCount:0,depCount:0};return new sc(n,o,e)}function jw(n,e,t){n.has(e)?n.has(t)||n.set(t,n.get(e)):n.has(t)&&n.set(e,n.get(t))}var RN=new is,ip=class{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){let r=[],i=[],o=Gw(this._driver,t,r,i);if(r.length)throw Dw(r);this._animations.set(e,o)}_buildPlayer(e,t,r){let i=e.element,o=Vh(this._normalizer,e.keyframes,t,r);return this._driver.animate(i,o,e.duration,e.delay,e.easing,[],!0)}create(e,t,r={}){let i=[],o=this._animations.get(e),s,a=new Map;if(o?(s=qw(this._driver,t,o,$h,Kl,new Map,new Map,r,RN,i),s.forEach(u=>{let d=tt(a,u.element,new Map);u.postStyleProps.forEach(f=>d.set(f,null))})):(i.push(ww()),s=[]),i.length)throw Cw(i);a.forEach((u,d)=>{u.forEach((f,h)=>{u.set(h,this._driver.computeStyle(d,h,Pt))})});let l=s.map(u=>{let d=a.get(u.element);return this._buildPlayer(u,new Map,d)}),c=Tn(l);return this._playersById.set(e,c),c.onDestroy(()=>this.destroy(e)),this.players.push(c),c}destroy(e){let t=this._getPlayer(e);t.destroy(),this._playersById.delete(e);let r=this.players.indexOf(t);r>=0&&this.players.splice(r,1)}_getPlayer(e){let t=this._playersById.get(e);if(!t)throw Ew(e);return t}listen(e,t,r,i){let o=Gl(t,"","","");return Wl(this._getPlayer(e),r,o,i),()=>{}}command(e,t,r,i){if(r=="register"){this.register(e,i[0]);return}if(r=="create"){let s=i[0]||{};this.create(e,t,s);return}let 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);break}}},Bw="ng-animate-queued",kN=".ng-animate-queued",Kh="ng-animate-disabled",PN=".ng-animate-disabled",ON="ng-star-inserted",FN=".ng-star-inserted",LN=[],Qw={namespaceId:"",setForRemoval:!1,setForMove:!1,hasAnimation:!1,removedBeforeQueried:!1},VN={namespaceId:"",setForMove:!1,setForRemoval:!1,hasAnimation:!1,removedBeforeQueried:!0},Ft="__ng_removed",os=class{namespaceId;value;options;get params(){return this.options.params}constructor(e,t=""){this.namespaceId=t;let r=e&&e.hasOwnProperty("value"),i=r?e.value:e;if(this.value=BN(i),r){let o=e,{value:s}=o,a=Jm(o,["value"]);this.options=a}else this.options={};this.options.params||(this.options.params={})}absorbOptions(e){let t=e.params;if(t){let r=this.options.params;Object.keys(t).forEach(i=>{r[i]==null&&(r[i]=t[i])})}}},rs="void",Qh=new os(rs),op=class{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,Ct(t,this._hostClassName)}listen(e,t,r,i){if(!this._triggers.has(t))throw bw(r,t);if(r==null||r.length==0)throw Iw(t);if(!HN(r))throw Sw(r,t);let o=tt(this._elementListeners,e,[]),s={name:t,phase:r,callback:i};o.push(s);let a=tt(this._engine.statesByElement,e,new Map);return a.has(t)||(Ct(e,es),Ct(e,es+"-"+t),a.set(t,Qh)),()=>{this._engine.afterFlush(()=>{let 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)?!1:(this._triggers.set(e,t),!0)}_getTrigger(e){let t=this._triggers.get(e);if(!t)throw Tw(e);return t}trigger(e,t,r,i=!0){let o=this._getTrigger(t),s=new ss(this.id,t,e),a=this._engine.statesByElement.get(e);a||(Ct(e,es),Ct(e,es+"-"+t),this._engine.statesByElement.set(e,a=new Map));let l=a.get(t),c=new os(r,this.id);if(!(r&&r.hasOwnProperty("value"))&&l&&c.absorbOptions(l.options),a.set(t,c),l||(l=Qh),!(c.value===rs)&&l.value===c.value){if(!zN(l.params,c.params)){let g=[],_=o.matchStyles(l.value,l.params,g),D=o.matchStyles(c.value,c.params,g);g.length?this._engine.reportError(g):this._engine.afterFlush(()=>{qn(e,_),Ot(e,D)})}return}let f=tt(this._engine.playersByElement,e,[]);f.forEach(g=>{g.namespaceId==this.id&&g.triggerName==t&&g.queued&&g.destroy()});let h=o.matchTransition(l.value,c.value,e,c.params),p=!1;if(!h){if(!i)return;h=o.fallbackTransition,p=!0}return this._engine.totalQueuedPlayers++,this._queue.push({element:e,triggerName:t,transition:h,fromState:l,toState:c,player:s,isFallbackTransition:p}),p||(Ct(e,Bw),s.onStart(()=>{xi(e,Bw)})),s.onDone(()=>{let g=this.players.indexOf(s);g>=0&&this.players.splice(g,1);let _=this._engine.playersByElement.get(e);if(_){let D=_.indexOf(s);D>=0&&_.splice(D,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);let t=this._engine.playersByElement.get(e);t&&(t.forEach(r=>r.destroy()),this._engine.playersByElement.delete(e))}_signalRemovalForInnerTriggers(e,t){let r=this._engine.driver.query(e,ts,!0);r.forEach(i=>{if(i[Ft])return;let 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){let o=this._engine.statesByElement.get(e),s=new Map;if(o){let a=[];if(o.forEach((l,c)=>{if(s.set(c,l.value),this._triggers.has(c)){let u=this.trigger(e,c,rs,i);u&&a.push(u)}}),a.length)return this._engine.markElementAsRemoved(this.id,e,!0,t,s),r&&Tn(a).onDone(()=>this._engine.processLeaveNode(e)),!0}return!1}prepareLeaveAnimationListeners(e){let t=this._elementListeners.get(e),r=this._engine.statesByElement.get(e);if(t&&r){let i=new Set;t.forEach(o=>{let s=o.name;if(i.has(s))return;i.add(s);let l=this._triggers.get(s).fallbackTransition,c=r.get(s)||Qh,u=new os(rs),d=new ss(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){let r=this._engine;if(e.childElementCount&&this._signalRemovalForInnerTriggers(e,t),this.triggerLeaveAnimation(e,t,!0))return;let i=!1;if(r.totalAnimations){let 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{let o=e[Ft];(!o||o===Qw)&&(r.afterFlush(()=>this.clearElementCache(e)),r.destroyInnerAnimations(e),r._onRemovalComplete(e,t))}}insertNode(e,t){Ct(e,this._hostClassName)}drainQueuedTransitions(e){let t=[];return this._queue.forEach(r=>{let i=r.player;if(i.destroyed)return;let o=r.element,s=this._elementListeners.get(o);s&&s.forEach(a=>{if(a.name==r.triggerName){let l=Gl(o,r.triggerName,r.fromState.value,r.toState.value);l._data=e,Wl(r.player,a.phase,l,a.callback)}}),i.markedForDestroy?this._engine.afterFlush(()=>{i.destroy()}):t.push(r)}),this._queue=[],t.sort((r,i)=>{let o=r.transition.ast.depCount,s=i.transition.ast.depCount;return o==0||s==0?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)}},sp=class{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(){let e=[];return this._namespaceList.forEach(t=>{t.players.forEach(r=>{r.queued&&e.push(r)})}),e}createNamespace(e,t){let r=new op(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){let r=this._namespaceList,i=this.namespacesByHostElement;if(r.length-1>=0){let s=!1,a=this.driver.getParentElement(t);for(;a;){let l=i.get(a);if(l){let 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(()=>{let r=this._fetchNamespace(e);this.namespacesByHostElement.delete(r.hostElement);let 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){let t=new Set,r=this.statesByElement.get(e);if(r){for(let i of r.values())if(i.namespaceId){let o=this._fetchNamespace(i.namespaceId);o&&t.add(o)}}return t}trigger(e,t,r,i){if(ec(t)){let o=this._fetchNamespace(e);if(o)return o.trigger(t,r,i),!0}return!1}insertNode(e,t,r,i){if(!ec(t))return;let o=t[Ft];if(o&&o.setForRemoval){o.setForRemoval=!1,o.setForMove=!0;let s=this.collectedLeaveElements.indexOf(t);s>=0&&this.collectedLeaveElements.splice(s,1)}if(e){let 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),Ct(e,Kh)):this.disabledNodes.has(e)&&(this.disabledNodes.delete(e),xi(e,Kh))}removeNode(e,t,r){if(ec(t)){let i=e?this._fetchNamespace(e):null;i?i.removeNode(t,r):this.markElementAsRemoved(e,t,!1,r);let 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[Ft]={namespaceId:e,setForRemoval:i,hasAnimation:r,removedBeforeQueried:!1,previousTriggersValues:o}}listen(e,t,r,i,o){return ec(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,ts,!0);t.forEach(r=>this.destroyActiveAnimationsForElement(r)),this.playersByQueriedElement.size!=0&&(t=this.driver.query(e,Ql,!0),t.forEach(r=>this.finishActiveQueriedAnimationOnElement(r)))}destroyActiveAnimationsForElement(e){let t=this.playersByElement.get(e);t&&t.forEach(r=>{r.queued?r.markedForDestroy=!0:r.destroy()})}finishActiveQueriedAnimationOnElement(e){let t=this.playersByQueriedElement.get(e);t&&t.forEach(r=>r.finish())}whenRenderingDone(){return new Promise(e=>{if(this.players.length)return Tn(this.players).onDone(()=>e());e()})}processLeaveNode(e){let t=e[Ft];if(t&&t.setForRemoval){if(e[Ft]=Qw,t.namespaceId){this.destroyInnerAnimations(e);let r=this._fetchNamespace(t.namespaceId);r&&r.clearElementCache(e)}this._onRemovalComplete(e,t.setForRemoval)}e.classList?.contains(Kh)&&this.markElementAsDisabled(e,!1),this.driver.query(e,PN,!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;r<this.collectedEnterElements.length;r++){let i=this.collectedEnterElements[r];Ct(i,ON)}if(this._namespaceList.length&&(this.totalQueuedPlayers||this.collectedLeaveElements.length)){let r=[];try{t=this._flushAnimations(r,e)}finally{for(let i=0;i<r.length;i++)r[i]()}}else for(let r=0;r<this.collectedLeaveElements.length;r++){let i=this.collectedLeaveElements[r];this.processLeaveNode(i)}if(this.totalQueuedPlayers=0,this.collectedEnterElements.length=0,this.collectedLeaveElements.length=0,this._flushFns.forEach(r=>r()),this._flushFns=[],this._whenQuietFns.length){let r=this._whenQuietFns;this._whenQuietFns=[],t.length?Tn(t).onDone(()=>{r.forEach(i=>i())}):r.forEach(i=>i())}}reportError(e){throw Mw(e)}_flushAnimations(e,t){let r=new is,i=[],o=new Map,s=[],a=new Map,l=new Map,c=new Map,u=new Set;this.disabledNodes.forEach(C=>{u.add(C);let b=this.driver.query(C,kN,!0);for(let T=0;T<b.length;T++)u.add(b[T])});let d=this.bodyNode,f=Array.from(this.statesByElement.keys()),h=$w(f,this.collectedEnterElements),p=new Map,g=0;h.forEach((C,b)=>{let T=$h+g++;p.set(b,T),C.forEach(X=>Ct(X,T))});let _=[],D=new Set,M=new Set;for(let C=0;C<this.collectedLeaveElements.length;C++){let b=this.collectedLeaveElements[C],T=b[Ft];T&&T.setForRemoval&&(_.push(b),D.add(b),T.hasAnimation?this.driver.query(b,FN,!0).forEach(X=>D.add(X)):M.add(b))}let A=new Map,J=$w(f,Array.from(D));J.forEach((C,b)=>{let T=Kl+g++;A.set(b,T),C.forEach(X=>Ct(X,T))}),e.push(()=>{h.forEach((C,b)=>{let T=p.get(b);C.forEach(X=>xi(X,T))}),J.forEach((C,b)=>{let T=A.get(b);C.forEach(X=>xi(X,T))}),_.forEach(C=>{this.processLeaveNode(C)})});let Pe=[],jt=[];for(let C=this._namespaceList.length-1;C>=0;C--)this._namespaceList[C].drainQueuedTransitions(t).forEach(T=>{let X=T.player,Ae=T.element;if(Pe.push(X),this.collectedEnterElements.length){let Oe=Ae[Ft];if(Oe&&Oe.setForMove){if(Oe.previousTriggersValues&&Oe.previousTriggersValues.has(T.triggerName)){let cr=Oe.previousTriggersValues.get(T.triggerName),ut=this.statesByElement.get(T.element);if(ut&&ut.has(T.triggerName)){let ea=ut.get(T.triggerName);ea.value=cr,ut.set(T.triggerName,ea)}}X.destroy();return}}let Bt=!d||!this.driver.containsElement(d,Ae),it=A.get(Ae),An=p.get(Ae),ge=this._buildInstruction(T,r,An,it,Bt);if(ge.errors&&ge.errors.length){jt.push(ge);return}if(Bt){X.onStart(()=>qn(Ae,ge.fromStyles)),X.onDestroy(()=>Ot(Ae,ge.toStyles)),i.push(X);return}if(T.isFallbackTransition){X.onStart(()=>qn(Ae,ge.fromStyles)),X.onDestroy(()=>Ot(Ae,ge.toStyles)),i.push(X);return}let Xm=[];ge.timelines.forEach(Oe=>{Oe.stretchStartingKeyframe=!0,this.disabledNodes.has(Oe.element)||Xm.push(Oe)}),ge.timelines=Xm,r.append(Ae,ge.timelines);let nS={instruction:ge,player:X,element:Ae};s.push(nS),ge.queriedElements.forEach(Oe=>tt(a,Oe,[]).push(X)),ge.preStyleProps.forEach((Oe,cr)=>{if(Oe.size){let ut=l.get(cr);ut||l.set(cr,ut=new Set),Oe.forEach((ea,Vu)=>ut.add(Vu))}}),ge.postStyleProps.forEach((Oe,cr)=>{let ut=c.get(cr);ut||c.set(cr,ut=new Set),Oe.forEach((ea,Vu)=>ut.add(Vu))})});if(jt.length){let C=[];jt.forEach(b=>{C.push(xw(b.triggerName,b.errors))}),Pe.forEach(b=>b.destroy()),this.reportError(C)}let Be=new Map,Ye=new Map;s.forEach(C=>{let b=C.element;r.has(b)&&(Ye.set(b,b),this._beforeAnimationBuild(C.player.namespaceId,C.instruction,Be))}),i.forEach(C=>{let b=C.element;this._getPreviousPlayers(b,!1,C.namespaceId,C.triggerName,null).forEach(X=>{tt(Be,b,[]).push(X),X.destroy()})});let ar=_.filter(C=>zw(C,l,c)),Wr=new Map;Uw(Wr,this.driver,M,c,Pt).forEach(C=>{zw(C,l,c)&&ar.push(C)});let lr=new Map;h.forEach((C,b)=>{Uw(lr,this.driver,new Set(C),l,Jo)}),ar.forEach(C=>{let b=Wr.get(C),T=lr.get(C);Wr.set(C,new Map([...b?.entries()??[],...T?.entries()??[]]))});let Lu=[],Ym=[],Zm={};s.forEach(C=>{let{element:b,player:T,instruction:X}=C;if(r.has(b)){if(u.has(b)){T.onDestroy(()=>Ot(b,X.toStyles)),T.disabled=!0,T.overrideTotalTime(X.totalTime),i.push(T);return}let Ae=Zm;if(Ye.size>1){let it=b,An=[];for(;it=it.parentNode;){let ge=Ye.get(it);if(ge){Ae=ge;break}An.push(it)}An.forEach(ge=>Ye.set(ge,Ae))}let Bt=this._buildAnimation(T.namespaceId,X,Be,o,lr,Wr);if(T.setRealPlayer(Bt),Ae===Zm)Lu.push(T);else{let it=this.playersByElement.get(Ae);it&&it.length&&(T.parentPlayer=Tn(it)),i.push(T)}}else qn(b,X.fromStyles),T.onDestroy(()=>Ot(b,X.toStyles)),Ym.push(T),u.has(b)&&i.push(T)}),Ym.forEach(C=>{let b=o.get(C.element);if(b&&b.length){let T=Tn(b);C.setRealPlayer(T)}}),i.forEach(C=>{C.parentPlayer?C.syncPlayerEvents(C.parentPlayer):C.destroy()});for(let C=0;C<_.length;C++){let b=_[C],T=b[Ft];if(xi(b,Kl),T&&T.hasAnimation)continue;let X=[];if(a.size){let Bt=a.get(b);Bt&&Bt.length&&X.push(...Bt);let it=this.driver.query(b,Ql,!0);for(let An=0;An<it.length;An++){let ge=a.get(it[An]);ge&&ge.length&&X.push(...ge)}}let Ae=X.filter(Bt=>!Bt.destroyed);Ae.length?UN(this,b,Ae):this.processLeaveNode(b)}return _.length=0,Lu.forEach(C=>{this.players.push(C),C.onDone(()=>{C.destroy();let b=this.players.indexOf(C);this.players.splice(b,1)}),C.play()}),Lu}afterFlush(e){this._flushFns.push(e)}afterFlushAnimationsDone(e){this._whenQuietFns.push(e)}_getPreviousPlayers(e,t,r,i,o){let s=[];if(t){let a=this.playersByQueriedElement.get(e);a&&(s=a)}else{let a=this.playersByElement.get(e);if(a){let l=!o||o==rs;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){let i=t.triggerName,o=t.element,s=t.isRemovalTransition?void 0:e,a=t.isRemovalTransition?void 0:i;for(let l of t.timelines){let c=l.element,u=c!==o,d=tt(r,c,[]);this._getPreviousPlayers(c,u,s,a,t.toState).forEach(h=>{let p=h.getRealPlayer();p.beforeDestroy&&p.beforeDestroy(),h.destroy(),d.push(h)})}qn(o,t.fromStyles)}_buildAnimation(e,t,r,i,o,s){let a=t.triggerName,l=t.element,c=[],u=new Set,d=new Set,f=t.timelines.map(p=>{let g=p.element;u.add(g);let _=g[Ft];if(_&&_.removedBeforeQueried)return new Sn(p.duration,p.delay);let D=g!==l,M=$N((r.get(g)||LN).map(Be=>Be.getRealPlayer())).filter(Be=>{let Ye=Be;return Ye.element?Ye.element===g:!1}),A=o.get(g),J=s.get(g),Pe=Vh(this._normalizer,p.keyframes,A,J),jt=this._buildPlayer(p,Pe,M);if(p.subTimeline&&i&&d.add(g),D){let Be=new ss(e,a,g);Be.setRealPlayer(jt),c.push(Be)}return jt});c.forEach(p=>{tt(this.playersByQueriedElement,p.element,[]).push(p),p.onDone(()=>jN(this.playersByQueriedElement,p.element,p))}),u.forEach(p=>Ct(p,zh));let h=Tn(f);return h.onDestroy(()=>{u.forEach(p=>xi(p,zh)),Ot(l,t.toStyles)}),d.forEach(p=>{tt(i,p,[]).push(h)}),h}_buildPlayer(e,t,r){return t.length>0?this.driver.animate(e.element,t,e.duration,e.delay,e.easing,r):new Sn(e.duration,e.delay)}},ss=class{namespaceId;triggerName;element;_player=new Sn;_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=>Wl(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){let t=this._player;t.triggerCallback&&e.onStart(()=>t.triggerCallback("start")),e.onDone(()=>this.finish()),e.onDestroy(()=>this.destroy())}_queueEvent(e,t){tt(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?!1: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){let t=this._player;t.triggerCallback&&t.triggerCallback(e)}};function jN(n,e,t){let r=n.get(e);if(r){if(r.length){let i=r.indexOf(t);r.splice(i,1)}r.length==0&&n.delete(e)}return r}function BN(n){return n??null}function ec(n){return n&&n.nodeType===1}function HN(n){return n=="start"||n=="done"}function Hw(n,e){let t=n.style.display;return n.style.display=e??"none",t}function Uw(n,e,t,r,i){let o=[];t.forEach(l=>o.push(Hw(l)));let s=[];r.forEach((l,c)=>{let u=new Map;l.forEach(d=>{let f=e.computeStyle(c,d,i);u.set(d,f),(!f||f.length==0)&&(c[Ft]=VN,s.push(c))}),n.set(c,u)});let a=0;return t.forEach(l=>Hw(l,o[a++])),s}function $w(n,e){let t=new Map;if(n.forEach(a=>t.set(a,[])),e.length==0)return t;let r=1,i=new Set(e),o=new Map;function s(a){if(!a)return r;let l=o.get(a);if(l)return l;let c=a.parentNode;return t.has(c)?l=c:i.has(c)?l=r:l=s(c),o.set(a,l),l}return e.forEach(a=>{let l=s(a);l!==r&&t.get(l).push(a)}),t}function Ct(n,e){n.classList?.add(e)}function xi(n,e){n.classList?.remove(e)}function UN(n,e,t){Tn(t).onDone(()=>n.processLeaveNode(e))}function $N(n){let e=[];return Yw(n,e),e}function Yw(n,e){for(let t=0;t<n.length;t++){let r=n[t];r instanceof Si?Yw(r.players,e):e.push(r)}}function zN(n,e){let t=Object.keys(n),r=Object.keys(e);if(t.length!=r.length)return!1;for(let i=0;i<t.length;i++){let o=t[i];if(!e.hasOwnProperty(o)||n[o]!==e[o])return!1}return!0}function zw(n,e,t){let r=t.get(n);if(!r)return!1;let i=e.get(n);return i?r.forEach(o=>i.add(o)):e.set(n,r),t.delete(n),!0}var Ai=class{_driver;_normalizer;_transitionEngine;_timelineEngine;_triggerCache={};onRemovalComplete=(e,t)=>{};constructor(e,t,r){this._driver=t,this._normalizer=r,this._transitionEngine=new sp(e.body,t,r),this._timelineEngine=new ip(e.body,t,r),this._transitionEngine.onRemovalComplete=(i,o)=>this.onRemovalComplete(i,o)}registerTrigger(e,t,r,i,o){let s=e+"-"+i,a=this._triggerCache[s];if(!a){let l=[],c=[],u=Gw(this._driver,o,l,c);if(l.length)throw vw(i,l);a=AN(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)=="@"){let[o,s]=jh(r),a=i;this._timelineEngine.command(o,t,s,a)}else this._transitionEngine.trigger(e,t,r,i)}listen(e,t,r,i,o){if(r.charAt(0)=="@"){let[s,a]=jh(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)}};function WN(n,e){let t=null,r=null;return Array.isArray(e)&&e.length?(t=Yh(e[0]),e.length>1&&(r=Yh(e[e.length-1]))):e instanceof Map&&(t=Yh(e)),t||r?new GN(n,t,r):null}var GN=(()=>{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&&Ot(this._element,this._startStyles,this._initialStyles),this._state=1)}finish(){this.start(),this._state<2&&(Ot(this._element,this._initialStyles),this._endStyles&&(Ot(this._element,this._endStyles),this._endStyles=null),this._state=1)}destroy(){this.finish(),this._state<3&&(n.initialStylesByElement.delete(this._element),this._startStyles&&(qn(this._element,this._startStyles),this._endStyles=null),this._endStyles&&(qn(this._element,this._endStyles),this._endStyles=null),Ot(this._element,this._initialStyles),this._state=3)}}return n})();function Yh(n){let e=null;return n.forEach((t,r)=>{qN(r)&&(e=e||new Map,e.set(r,t))}),e}function qN(n){return n==="display"||n==="position"}var ac=class{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;let e=this.keyframes;this.domPlayer=this._triggerWebAnimation(this.element,e,this.options),this._finalKeyframe=e.length?e[e.length-1]:new Map;let 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){let 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){this.domPlayer===void 0&&this.init(),this.domPlayer.currentTime=e*this.time}getPosition(){return+(this.domPlayer.currentTime??0)/this.time}get totalTime(){return this._delay+this._duration}beforeDestroy(){let e=new Map;this.hasStarted()&&this._finalKeyframe.forEach((r,i)=>{i!=="offset"&&e.set(i,this._finished?r:Zl(this.element,i))}),this.currentSnapshot=e}triggerCallback(e){let t=e==="start"?this._onStartFns:this._onDoneFns;t.forEach(r=>r()),t.length=0}},lc=class{validateStyleProperty(e){return!0}validateAnimatableStyleProperty(e){return!0}containsElement(e,t){return Bh(e,t)}getParentElement(e){return ql(e)}query(e,t,r){return Hh(e,t,r)}computeStyle(e,t,r){return Zl(e,t)}animate(e,t,r,i,o,s=[]){let a=i==0?"both":"forwards",l={duration:r,delay:i,fill:a};o&&(l.easing=o);let c=new Map,u=s.filter(h=>h instanceof ac);kw(r,i)&&u.forEach(h=>{h.currentSnapshot.forEach((p,g)=>c.set(g,p))});let d=Nw(t).map(h=>new Map(h));d=Pw(e,d,c);let f=WN(e,d);return new ac(e,d,l,f)}};var tc="@",Zw="@.disabled",cc=class{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)==tc&&t==Zw?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)}},ap=class extends cc{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)==tc?t.charAt(1)=="."&&t==Zw?(r=r===void 0?!0:!!r,this.disableAnimations(e,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)==tc){let o=KN(e),s=t.slice(1),a="";return s.charAt(0)!=tc&&([s,a]=QN(s)),this.engine.listen(this.namespaceId,o,s,a,l=>{let c=l._data||-1;this.factory.scheduleListenerCallback(c,r,l)})}return this.delegate.listen(e,t,r,i)}};function KN(n){switch(n){case"body":return document.body;case"document":return document;case"window":return window;default:return n}}function QN(n){let e=n.indexOf("."),t=n.substring(0,e),r=n.slice(e+1);return[t,r]}var uc=class{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){let r="",i=this.delegate.createRenderer(e,t);if(!e||!t?.data?.animation){let c=this._rendererCache,u=c.get(i);if(!u){let d=()=>c.delete(i);u=new cc(r,i,this.engine,d),c.set(i,u)}return u}let o=t.id,s=t.id+"-"+this._currentId;this._currentId++,this.engine.register(s,e);let a=c=>{Array.isArray(c)?c.forEach(a):this.engine.registerTrigger(o,s,e,c.name,c)};return t.data.animation.forEach(a),new ap(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&&e<this._microtaskId){this._zone.run(()=>t(r));return}let i=this._animationCallbacksBuffer;i.length==0&&queueMicrotask(()=>{this._zone.run(()=>{i.forEach(o=>{let[s,a]=o;s(a)}),this._animationCallbacksBuffer=[]})}),i.push([t,r])}end(){this._cdRecurDepth--,this._cdRecurDepth==0&&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)}};var ZN=(()=>{class n extends Ai{constructor(t,r,i){super(t,r,i)}ngOnDestroy(){this.flush()}static \u0275fac=function(r){return new(r||n)(w(Me),w(Pr),w(Or))};static \u0275prov=I({token:n,factory:n.\u0275fac})}return n})();function XN(){return new nc}function JN(n,e,t){return new uc(n,e,t)}var Jw=[{provide:Or,useFactory:XN},{provide:Ai,useClass:ZN},{provide:Je,useFactory:JN,deps:[Zo,Ai,k]}],eR=[{provide:Pr,useClass:lp},{provide:nh,useValue:"NoopAnimations"},...Jw],Xw=[{provide:Pr,useFactory:()=>new lc},{provide:nh,useFactory:()=>"BrowserAnimations"},...Jw],eC=(()=>{class n{static withConfig(t){return{ngModule:n,providers:t.disableAnimations?eR:Xw}}static \u0275fac=function(r){return new(r||n)};static \u0275mod=Ce({type:n});static \u0275inj=we({providers:Xw,imports:[kh]})}return n})();var lC=(()=>{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)(_e(Ho),_e(kt))};static \u0275dir=We({type:n})}return n})(),cC=(()=>{class n extends lC{static \u0275fac=(()=>{let t;return function(i){return(t||(t=Yf(n)))(i||n)}})();static \u0275dir=We({type:n,features:[Jt]})}return n})(),hp=new E(""),tR={provide:hp,useExisting:Un(()=>pp),multi:!0},pp=(()=>{class n extends cC{writeValue(t){this.setProperty("checked",t)}static \u0275fac=(()=>{let t;return function(i){return(t||(t=Yf(n)))(i||n)}})();static \u0275dir=We({type:n,selectors:[["input","type","checkbox","formControlName",""],["input","type","checkbox","formControl",""],["input","type","checkbox","ngModel",""]],hostBindings:function(r,i){r&1&&ae("change",function(s){return i.onChange(s.target.checked)})("blur",function(){return i.onTouched()})},standalone:!1,features:[En([tR]),Jt]})}return n})(),nR={provide:hp,useExisting:Un(()=>Pi),multi:!0};function rR(){let n=In()?In().getUserAgent():"";return/android (\d+)/.test(n.toLowerCase())}var iR=new E(""),Pi=(()=>{class n extends lC{_compositionMode;_composing=!1;constructor(t,r,i){super(t,r),this._compositionMode=i,this._compositionMode==null&&(this._compositionMode=!rR())}writeValue(t){let r=t??"";this.setProperty("value",r)}_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)(_e(Ho),_e(kt),_e(iR,8))};static \u0275dir=We({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){r&1&&ae("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:[En([nR]),Jt]})}return n})();var uC=new E(""),dC=new E("");function fC(n){return n!=null}function hC(n){return Ll(n)?pt(n):n}function pC(n){let e={};return n.forEach(t=>{e=t!=null?H(H({},e),t):e}),Object.keys(e).length===0?null:e}function gC(n,e){return e.map(t=>t(n))}function oR(n){return!n.validate}function mC(n){return n.map(e=>oR(e)?e:t=>e.validate(t))}function sR(n){if(!n)return null;let e=n.filter(fC);return e.length==0?null:function(t){return pC(gC(t,e))}}function gp(n){return n!=null?sR(mC(n)):null}function aR(n){if(!n)return null;let e=n.filter(fC);return e.length==0?null:function(t){let r=gC(t,e).map(hC);return wd(r).pipe(oe(pC))}}function mp(n){return n!=null?aR(mC(n)):null}function tC(n,e){return n===null?[e]:Array.isArray(n)?[...n,e]:[n,e]}function lR(n){return n._rawValidators}function cR(n){return n._rawAsyncValidators}function up(n){return n?Array.isArray(n)?n:[n]:[]}function fc(n,e){return Array.isArray(n)?n.includes(e):n===e}function nC(n,e){let t=up(e);return up(n).forEach(i=>{fc(t,i)||t.push(i)}),t}function rC(n,e){return up(e).filter(t=>!fc(n,t))}var hc=class{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=gp(this._rawValidators)}_setAsyncValidators(e){this._rawAsyncValidators=e||[],this._composedAsyncValidatorFn=mp(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):!1}getError(e,t){return this.control?this.control.getError(e,t):null}},ki=class extends hc{name;get formDirective(){return null}get path(){return null}},fs=class extends hc{_parent=null;name=null;valueAccessor=null},pc=class{_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}},uR={"[class.ng-untouched]":"isUntouched","[class.ng-touched]":"isTouched","[class.ng-pristine]":"isPristine","[class.ng-dirty]":"isDirty","[class.ng-valid]":"isValid","[class.ng-invalid]":"isInvalid","[class.ng-pending]":"isPending"},Iz=de(H({},uR),{"[class.ng-submitted]":"isSubmitted"}),yc=(()=>{class n extends pc{constructor(t){super(t)}static \u0275fac=function(r){return new(r||n)(_e(fs,2))};static \u0275dir=We({type:n,selectors:[["","formControlName",""],["","ngModel",""],["","formControl",""]],hostVars:14,hostBindings:function(r,i){r&2&&en("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:[Jt]})}return n})(),_C=(()=>{class n extends pc{constructor(t){super(t)}static \u0275fac=function(r){return new(r||n)(_e(ki,10))};static \u0275dir=We({type:n,selectors:[["","formGroupName",""],["","formArrayName",""],["","ngModelGroup",""],["","formGroup",""],["form",3,"ngNoForm",""],["","ngForm",""]],hostVars:16,hostBindings:function(r,i){r&2&&en("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:[Jt]})}return n})();var as="VALID",dc="INVALID",Ni="PENDING",ls="DISABLED",Kn=class{},gc=class extends Kn{value;source;constructor(e,t){super(),this.value=e,this.source=t}},us=class extends Kn{pristine;source;constructor(e,t){super(),this.pristine=e,this.source=t}},ds=class extends Kn{touched;source;constructor(e,t){super(),this.touched=e,this.source=t}},Ri=class extends Kn{status;source;constructor(e,t){super(),this.status=e,this.source=t}},dp=class extends Kn{source;constructor(e){super(),this.source=e}},fp=class extends Kn{source;constructor(e){super(),this.source=e}};function yC(n){return(vc(n)?n.validators:n)||null}function dR(n){return Array.isArray(n)?gp(n):n||null}function vC(n,e){return(vc(e)?e.asyncValidators:n)||null}function fR(n){return Array.isArray(n)?mp(n):n||null}function vc(n){return n!=null&&!Array.isArray(n)&&typeof n=="object"}function hR(n,e,t){let r=n.controls;if(!(e?Object.keys(r):r).length)throw new v(1e3,"");if(!r[t])throw new v(1001,"")}function pR(n,e,t){n._forEachChild((r,i)=>{if(t[i]===void 0)throw new v(1002,"")})}var mc=class{_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 bn(this.statusReactive)}set status(e){bn(()=>this.statusReactive.set(e))}_status=bi(()=>this.statusReactive());statusReactive=yn(void 0);get valid(){return this.status===as}get invalid(){return this.status===dc}get pending(){return this.status==Ni}get disabled(){return this.status===ls}get enabled(){return this.status!==ls}errors;get pristine(){return bn(this.pristineReactive)}set pristine(e){bn(()=>this.pristineReactive.set(e))}_pristine=bi(()=>this.pristineReactive());pristineReactive=yn(!0);get dirty(){return!this.pristine}get touched(){return bn(this.touchedReactive)}set touched(e){bn(()=>this.touchedReactive.set(e))}_touched=bi(()=>this.touchedReactive());touchedReactive=yn(!1);get untouched(){return!this.touched}_events=new L;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(nC(e,this._rawValidators))}addAsyncValidators(e){this.setAsyncValidators(nC(e,this._rawAsyncValidators))}removeValidators(e){this.setValidators(rC(e,this._rawValidators))}removeAsyncValidators(e){this.setAsyncValidators(rC(e,this._rawAsyncValidators))}hasValidator(e){return fc(this._rawValidators,e)}hasAsyncValidator(e){return fc(this._rawAsyncValidators,e)}clearValidators(){this.validator=null}clearAsyncValidators(){this.asyncValidator=null}markAsTouched(e={}){let t=this.touched===!1;this.touched=!0;let r=e.sourceControl??this;this._parent&&!e.onlySelf&&this._parent.markAsTouched(de(H({},e),{sourceControl:r})),t&&e.emitEvent!==!1&&this._events.next(new ds(!0,r))}markAllAsTouched(e={}){this.markAsTouched({onlySelf:!0,emitEvent:e.emitEvent,sourceControl:this}),this._forEachChild(t=>t.markAllAsTouched(e))}markAsUntouched(e={}){let t=this.touched===!0;this.touched=!1,this._pendingTouched=!1;let 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&&e.emitEvent!==!1&&this._events.next(new ds(!1,r))}markAsDirty(e={}){let t=this.pristine===!0;this.pristine=!1;let r=e.sourceControl??this;this._parent&&!e.onlySelf&&this._parent.markAsDirty(de(H({},e),{sourceControl:r})),t&&e.emitEvent!==!1&&this._events.next(new us(!1,r))}markAsPristine(e={}){let t=this.pristine===!1;this.pristine=!0,this._pendingDirty=!1;let r=e.sourceControl??this;this._forEachChild(i=>{i.markAsPristine({onlySelf:!0,emitEvent:e.emitEvent})}),this._parent&&!e.onlySelf&&this._parent._updatePristine(e,r),t&&e.emitEvent!==!1&&this._events.next(new us(!0,r))}markAsPending(e={}){this.status=Ni;let t=e.sourceControl??this;e.emitEvent!==!1&&(this._events.next(new Ri(this.status,t)),this.statusChanges.emit(this.status)),this._parent&&!e.onlySelf&&this._parent.markAsPending(de(H({},e),{sourceControl:t}))}disable(e={}){let t=this._parentMarkedDirty(e.onlySelf);this.status=ls,this.errors=null,this._forEachChild(i=>{i.disable(de(H({},e),{onlySelf:!0}))}),this._updateValue();let r=e.sourceControl??this;e.emitEvent!==!1&&(this._events.next(new gc(this.value,r)),this._events.next(new Ri(this.status,r)),this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._updateAncestors(de(H({},e),{skipPristineCheck:t}),this),this._onDisabledChange.forEach(i=>i(!0))}enable(e={}){let t=this._parentMarkedDirty(e.onlySelf);this.status=as,this._forEachChild(r=>{r.enable(de(H({},e),{onlySelf:!0}))}),this.updateValueAndValidity({onlySelf:!0,emitEvent:e.emitEvent}),this._updateAncestors(de(H({},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){let r=this._cancelExistingSubscription();this.errors=this._runValidator(),this.status=this._calculateStatus(),(this.status===as||this.status===Ni)&&this._runAsyncValidator(r,e.emitEvent)}let t=e.sourceControl??this;e.emitEvent!==!1&&(this._events.next(new gc(this.value,t)),this._events.next(new Ri(this.status,t)),this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._parent&&!e.onlySelf&&this._parent.updateValueAndValidity(de(H({},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()?ls:as}_runValidator(){return this.validator?this.validator(this):null}_runAsyncValidator(e,t){if(this.asyncValidator){this.status=Ni,this._hasOwnPendingAsyncValidator={emitEvent:t!==!1};let r=hC(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();let e=this._hasOwnPendingAsyncValidator?.emitEvent??!1;return this._hasOwnPendingAsyncValidator=null,e}return!1}setErrors(e,t={}){this.errors=e,this._updateControlsErrors(t.emitEvent!==!1,this,t.shouldHaveEmitted)}get(e){let t=e;return t==null||(Array.isArray(t)||(t=t.split(".")),t.length===0)?null:t.reduce((r,i)=>r&&r._find(i),this)}getError(e,t){let 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 Ri(this.status,t)),this._parent&&this._parent._updateControlsErrors(e,t,r)}_initObservables(){this.valueChanges=new ie,this.statusChanges=new ie}_calculateStatus(){return this._allControlsDisabled()?ls:this.errors?dc:this._hasOwnPendingAsyncValidator||this._anyControlsHaveStatus(Ni)?Ni:this._anyControlsHaveStatus(dc)?dc:as}_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){let r=!this._anyControlsDirty(),i=this.pristine!==r;this.pristine=r,this._parent&&!e.onlySelf&&this._parent._updatePristine(e,t),i&&this._events.next(new us(this.pristine,t))}_updateTouched(e={},t){this.touched=this._anyControlsTouched(),this._events.next(new ds(this.touched,t)),this._parent&&!e.onlySelf&&this._parent._updateTouched(e,t)}_onDisabledChange=[];_registerOnCollectionChange(e){this._onCollectionChange=e}_setUpdateStrategy(e){vc(e)&&e.updateOn!=null&&(this._updateOn=e.updateOn)}_parentMarkedDirty(e){let t=this._parent&&this._parent.dirty;return!e&&!!t&&!this._parent._anyControlsDirty()}_find(e){return null}_assignValidators(e){this._rawValidators=Array.isArray(e)?e.slice():e,this._composedValidatorFn=dR(this._rawValidators)}_assignAsyncValidators(e){this._rawAsyncValidators=Array.isArray(e)?e.slice():e,this._composedAsyncValidatorFn=fR(this._rawAsyncValidators)}},_c=class extends mc{constructor(e,t,r){super(yC(t),vC(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={}){pR(this,!0,e),Object.keys(e).forEach(r=>{hR(this,!0,r),this.controls[r].setValue(e[r],{onlySelf:!0,emitEvent:t.emitEvent})}),this.updateValueAndValidity(t)}patchValue(e,t={}){e!=null&&(Object.keys(e).forEach(r=>{let 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()?!0:t);return e&&this.updateValueAndValidity({onlySelf:!0}),e}_forEachChild(e){Object.keys(this.controls).forEach(t=>{let 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(let[t,r]of Object.entries(this.controls))if(this.contains(t)&&e(r))return!0;return!1}_reduceValue(){let e={};return this._reduceChildren(e,(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(let 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}};var Dc=new E("",{providedIn:"root",factory:()=>wc}),wc="always";function gR(n,e){return[...e.path,n]}function DC(n,e,t=wc){wC(n,e),e.valueAccessor.writeValue(n.value),(n.disabled||t==="always")&&e.valueAccessor.setDisabledState?.(n.disabled),_R(n,e),vR(n,e),yR(n,e),mR(n,e)}function iC(n,e){n.forEach(t=>{t.registerOnValidatorChange&&t.registerOnValidatorChange(e)})}function mR(n,e){if(e.valueAccessor.setDisabledState){let t=r=>{e.valueAccessor.setDisabledState(r)};n.registerOnDisabledChange(t),e._registerOnDestroy(()=>{n._unregisterOnDisabledChange(t)})}}function wC(n,e){let t=lR(n);e.validator!==null?n.setValidators(tC(t,e.validator)):typeof t=="function"&&n.setValidators([t]);let r=cR(n);e.asyncValidator!==null?n.setAsyncValidators(tC(r,e.asyncValidator)):typeof r=="function"&&n.setAsyncValidators([r]);let i=()=>n.updateValueAndValidity();iC(e._rawValidators,i),iC(e._rawAsyncValidators,i)}function _R(n,e){e.valueAccessor.registerOnChange(t=>{n._pendingValue=t,n._pendingChange=!0,n._pendingDirty=!0,n.updateOn==="change"&&CC(n,e)})}function yR(n,e){e.valueAccessor.registerOnTouched(()=>{n._pendingTouched=!0,n.updateOn==="blur"&&n._pendingChange&&CC(n,e),n.updateOn!=="submit"&&n.markAsTouched()})}function CC(n,e){n._pendingDirty&&n.markAsDirty(),n.setValue(n._pendingValue,{emitModelToViewChange:!1}),e.viewToModelUpdate(n._pendingValue),n._pendingChange=!1}function vR(n,e){let t=(r,i)=>{e.valueAccessor.writeValue(r),i&&e.viewToModelUpdate(r)};n.registerOnChange(t),e._registerOnDestroy(()=>{n._unregisterOnChange(t)})}function DR(n,e){n==null,wC(n,e)}function wR(n,e){if(!n.hasOwnProperty("model"))return!1;let t=n.model;return t.isFirstChange()?!0:!Object.is(e,t.currentValue)}function CR(n){return Object.getPrototypeOf(n.constructor)===cC}function ER(n,e){n._syncPendingControls(),e.forEach(t=>{let r=t.control;r.updateOn==="submit"&&r._pendingChange&&(t.viewToModelUpdate(r._pendingValue),r._pendingChange=!1)})}function bR(n,e){if(!e)return null;Array.isArray(e);let t,r,i;return e.forEach(o=>{o.constructor===Pi?t=o:CR(o)?r=o:i=o}),i||r||t||null}var IR={provide:ki,useExisting:Un(()=>_p)},cs=Promise.resolve(),_p=(()=>{class n extends ki{callSetDisabledState;get submitted(){return bn(this.submittedReactive)}_submitted=bi(()=>this.submittedReactive());submittedReactive=yn(!1);_directives=new Set;form;ngSubmit=new ie;options;constructor(t,r,i){super(),this.callSetDisabledState=i,this.form=new _c({},gp(t),mp(r))}ngAfterViewInit(){this._setUpdateStrategy()}get formDirective(){return this}get control(){return this.form}get path(){return[]}get controls(){return this.form.controls}addControl(t){cs.then(()=>{let r=this._findContainer(t.path);t.control=r.registerControl(t.name,t.control),DC(t.control,t,this.callSetDisabledState),t.control.updateValueAndValidity({emitEvent:!1}),this._directives.add(t)})}getControl(t){return this.form.get(t.path)}removeControl(t){cs.then(()=>{let r=this._findContainer(t.path);r&&r.removeControl(t.name),this._directives.delete(t)})}addFormGroup(t){cs.then(()=>{let r=this._findContainer(t.path),i=new _c({});DR(i,t),r.registerControl(t.name,i),i.updateValueAndValidity({emitEvent:!1})})}removeFormGroup(t){cs.then(()=>{let r=this._findContainer(t.path);r&&r.removeControl(t.name)})}getFormGroup(t){return this.form.get(t.path)}updateModel(t,r){cs.then(()=>{this.form.get(t.path).setValue(r)})}setValue(t){this.control.setValue(t)}onSubmit(t){return this.submittedReactive.set(!0),ER(this.form,this._directives),this.ngSubmit.emit(t),this.form._events.next(new dp(this.control)),t?.target?.method==="dialog"}onReset(){this.resetForm()}resetForm(t=void 0){this.form.reset(t),this.submittedReactive.set(!1),this.form._events.next(new fp(this.form))}_setUpdateStrategy(){this.options&&this.options.updateOn!=null&&(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)(_e(uC,10),_e(dC,10),_e(Dc,8))};static \u0275dir=We({type:n,selectors:[["form",3,"ngNoForm","",3,"formGroup",""],["ng-form"],["","ngForm",""]],hostBindings:function(r,i){r&1&&ae("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:[En([IR]),Jt]})}return n})();function oC(n,e){let t=n.indexOf(e);t>-1&&n.splice(t,1)}function sC(n){return typeof n=="object"&&n!==null&&Object.keys(n).length===2&&"value"in n&&"disabled"in n}var SR=class extends mc{defaultValue=null;_onChange=[];_pendingValue;_pendingChange=!1;constructor(e=null,t,r){super(yC(t),vC(r,t)),this._applyFormState(e),this._setUpdateStrategy(t),this._initObservables(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator}),vc(t)&&(t.nonNullable||t.initialValueIsDefault)&&(sC(e)?this.defaultValue=e.value:this.defaultValue=e)}setValue(e,t={}){this.value=this._pendingValue=e,this._onChange.length&&t.emitModelToViewChange!==!1&&this._onChange.forEach(r=>r(this.value,t.emitViewToModelChange!==!1)),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){oC(this._onChange,e)}registerOnDisabledChange(e){this._onDisabledChange.push(e)}_unregisterOnDisabledChange(e){oC(this._onDisabledChange,e)}_forEachChild(e){}_syncPendingControls(){return this.updateOn==="submit"&&(this._pendingDirty&&this.markAsDirty(),this._pendingTouched&&this.markAsTouched(),this._pendingChange)?(this.setValue(this._pendingValue,{onlySelf:!0,emitModelToViewChange:!1}),!0):!1}_applyFormState(e){sC(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}};var TR={provide:fs,useExisting:Un(()=>hs)},aC=Promise.resolve(),hs=(()=>{class n extends fs{_changeDetectorRef;callSetDisabledState;control=new SR;static ngAcceptInputType_isDisabled;_registered=!1;viewModel;name="";isDisabled;model;options;update=new ie;constructor(t,r,i,o,s,a){super(),this._changeDetectorRef=s,this.callSetDisabledState=a,this._parent=t,this._setValidators(r),this._setAsyncValidators(i),this.valueAccessor=bR(this,o)}ngOnChanges(t){if(this._checkForErrors(),!this._registered||"name"in t){if(this._registered&&(this._checkName(),this.formDirective)){let r=t.name.previousValue;this.formDirective.removeControl({name:r,path:this._getPath(r)})}this._setUpControl()}"isDisabled"in t&&this._updateDisabled(t),wR(t,this.viewModel)&&(this._updateValue(this.model),this.viewModel=this.model)}ngOnDestroy(){this.formDirective&&this.formDirective.removeControl(this)}get path(){return this._getPath(this.name)}get formDirective(){return this._parent?this._parent.formDirective:null}viewToModelUpdate(t){this.viewModel=t,this.update.emit(t)}_setUpControl(){this._setUpdateStrategy(),this._isStandalone()?this._setUpStandalone():this.formDirective.addControl(this),this._registered=!0}_setUpdateStrategy(){this.options&&this.options.updateOn!=null&&(this.control._updateOn=this.options.updateOn)}_isStandalone(){return!this._parent||!!(this.options&&this.options.standalone)}_setUpStandalone(){DC(this.control,this,this.callSetDisabledState),this.control.updateValueAndValidity({emitEvent:!1})}_checkForErrors(){this._checkName()}_checkName(){this.options&&this.options.name&&(this.name=this.options.name),!this._isStandalone()&&this.name}_updateValue(t){aC.then(()=>{this.control.setValue(t,{emitViewToModelChange:!1}),this._changeDetectorRef?.markForCheck()})}_updateDisabled(t){let r=t.isDisabled.currentValue,i=r!==0&&Gn(r);aC.then(()=>{i&&!this.control.disabled?this.control.disable():!i&&this.control.disabled&&this.control.enable(),this._changeDetectorRef?.markForCheck()})}_getPath(t){return this._parent?gR(t,this._parent):[t]}static \u0275fac=function(r){return new(r||n)(_e(ki,9),_e(uC,10),_e(dC,10),_e(hp,10),_e(Nr,8),_e(Dc,8))};static \u0275dir=We({type:n,selectors:[["","ngModel","",3,"formControlName","",3,"formControl",""]],inputs:{name:"name",isDisabled:[0,"disabled","isDisabled"],model:[0,"ngModel","model"],options:[0,"ngModelOptions","options"]},outputs:{update:"ngModelChange"},exportAs:["ngModel"],standalone:!1,features:[En([TR]),Jt,vi]})}return n})();var EC=(()=>{class n{static \u0275fac=function(r){return new(r||n)};static \u0275dir=We({type:n,selectors:[["form",3,"ngNoForm","",3,"ngNativeValidate",""]],hostAttrs:["novalidate",""],standalone:!1})}return n})();var MR=new E("");var bC=(()=>{class n{static \u0275fac=function(r){return new(r||n)};static \u0275mod=Ce({type:n});static \u0275inj=we({})}return n})();var Oi=(()=>{class n{static withConfig(t){return{ngModule:n,providers:[{provide:Dc,useValue:t.callSetDisabledState??wc}]}}static \u0275fac=function(r){return new(r||n)};static \u0275mod=Ce({type:n});static \u0275inj=we({imports:[bC]})}return n})(),IC=(()=>{class n{static withConfig(t){return{ngModule:n,providers:[{provide:MR,useValue:t.warnOnNgModelWithFormControl??"always"},{provide:Dc,useValue:t.callSetDisabledState??wc}]}}static \u0275fac=function(r){return new(r||n)};static \u0275mod=Ce({type:n});static \u0275inj=we({imports:[bC]})}return n})();var xR="firebase",AR="11.10.0";Rn(xR,AR,"app");function on(n){n===void 0&&(Bf(on),n=m(Ve));let e=n.get(Zf);return t=>new G(r=>{let i=e.add(),o=!1;function s(){o||(i(),o=!0)}let 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})}var Fi=new pi("ANGULARFIRE2_VERSION");var TC=(n,e)=>{let t=e?[e]:aa(),r=[];return t.forEach(i=>{i.container.getProvider(n).instances.forEach(s=>{r.includes(s)||r.push(s)})}),r},yp=function(n){return n[n.SILENT=0]="SILENT",n[n.WARN=1]="WARN",n[n.VERBOSE=2]="VERBOSE",n}(yp||{}),zz=Wo()&&typeof Zone<"u"?yp.WARN:yp.SILENT;var Cc=class{zone;delegate;constructor(e,t=_d){this.zone=e,this.delegate=t}now(){return this.delegate.now()}schedule(e,t,r){let i=this.zone,o=function(s){i?i.runGuarded(()=>{e.apply(this,[s])}):e.apply(this,[s])};return this.delegate.schedule(o,t,r)}},ps=(()=>{class n{outsideAngular;insideAngular;constructor(){let t=m(k);this.outsideAngular=t.runOutsideAngular(()=>new Cc(typeof Zone>"u"?void 0:Zone.current)),this.insideAngular=t.run(()=>new Cc(typeof Zone>"u"?void 0:Zone.current,Ut))}static \u0275fac=function(r){return new(r||n)};static \u0275prov=I({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var NR="firebase",RR="11.10.0";Xe.registerVersion(NR,RR,"app-compat");var kR=["ngOnDestroy"],AC=(n,e,t,r={})=>new Proxy(n,{get:(i,o)=>t.runOutsideAngular(()=>{if(n[o])return r?.spy?.get&&r.spy.get(o,n[o]),n[o];if(kR.indexOf(o)>-1)return()=>{};let s=e.toPromise().then(a=>{let l=a?.[o];return typeof l=="function"?l.bind(a):l?.then?l.then(c=>t.run(()=>c)):t.run(()=>l)});return new Proxy(()=>{},{get:(a,l)=>s[l],apply:(a,l,c)=>s.then(u=>{let d=u?.(...c);return r?.spy?.apply&&r.spy.apply(o,c,d),d})})})});var Ec=class{constructor(e){return e}},Li=new E("angularfire2.app.options"),Vi=new E("angularfire2.app.name");function gs(n,e,t){let r=typeof t=="string"&&t||"[DEFAULT]",i=typeof t=="object"&&t||{};i.name=i.name||r;let s=Xe.apps.filter(a=>a&&a.name===i.name)[0]||e.runOutsideAngular(()=>Xe.initializeApp(n,i));try{if(JSON.stringify(n)!==JSON.stringify(s.options)){let a=!!module.hot;PR("error",`${s.name} Firebase App already initialized with different options${a?", you may need to reload as Firebase is not HMR aware.":"."}`)}}catch{}return new Ec(s)}var PR=(n,...e)=>{Wo()&&typeof console<"u"&&console[n](...e)},OR={provide:Ec,useFactory:gs,deps:[Li,k,[new Of,Vi]]},NC=(()=>{class n{static initializeApp(t,r){return{ngModule:n,providers:[{provide:Li,useValue:t},{provide:Vi,useValue:r}]}}constructor(t){Xe.registerVersion("angularfire",Fi.full,"core"),Xe.registerVersion("angularfire",Fi.full,"app-compat"),Xe.registerVersion("angular",zo.full,t.toString())}static \u0275fac=function(r){return new(r||n)(w(ot))};static \u0275mod=Ce({type:n});static \u0275inj=we({providers:[OR]})}return n})();function bc(n,e,t,r,i){let[,o,s]=globalThis.\u0275AngularfireInstanceCache.find(a=>a[0]===n)||[];if(o)return FR(i,s)||(xC("error",`${e} was already initialized on the ${t} Firebase App with different settings.${LR?" You may need to reload as Firebase is not HMR aware.":""}`),xC("warn",{is:i,was:s})),o;{let a=r();return globalThis.\u0275AngularfireInstanceCache.push([n,a,i]),a}}function FR(n,e){try{return n.toString()===e.toString()}catch{return n===e}}var LR=typeof module<"u"&&!!module.hot,xC=(n,...e)=>{Wo()&&typeof console<"u"&&console[n](...e)};globalThis.\u0275AngularfireInstanceCache||=[];var wp=new Map,LC={activated:!1,tokenObservers:[]},VR={initialized:!1,enabled:!1};function xe(n){return wp.get(n)||Object.assign({},LC)}function jR(n,e){return wp.set(n,e),wp.get(n)}function Mc(){return VR}var VC="https://content-firebaseappcheck.googleapis.com/v1",BR="exchangeRecaptchaV3Token";var HR="exchangeDebugToken",RC={OFFSET_DURATION:5*60*1e3,RETRIAL_MIN_WAIT:30*1e3,RETRIAL_MAX_WAIT:16*60*1e3},UR=24*60*60*1e3;var Cp=class{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){return Ne(this,null,function*(){this.stop();try{this.pending=new ve,this.pending.promise.catch(t=>{}),yield $R(this.getNextRun(e)),this.pending.resolve(),yield this.pending.promise,this.pending=new ve,this.pending.promise.catch(t=>{}),yield this.operation(),this.pending.resolve(),yield this.pending.promise,this.process(!0).catch(()=>{})}catch(t){this.retryPolicy(t)?this.process(!1).catch(()=>{}):this.stop()}})}getNextRun(e){if(e)return this.nextErrorWaitInterval=this.lowerBound,this.getWaitDuration();{let t=this.nextErrorWaitInterval;return this.nextErrorWaitInterval*=2,this.nextErrorWaitInterval>this.upperBound&&(this.nextErrorWaitInterval=this.upperBound),t}}};function $R(n){return new Promise(e=>{setTimeout(e,n)})}var zR={"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.","initial-throttle":"{$httpStatus} error. Attempts allowed again after {$time}",throttled:"Requests throttled due to previous {$httpStatus} error. Attempts allowed again after {$time}"},rt=new u_("appCheck","AppCheck",zR);function kC(n=!1){var e;return n?(e=self.grecaptcha)===null||e===void 0?void 0:e.enterprise:self.grecaptcha}function Ip(n){if(!xe(n).activated)throw rt.create("use-before-activation",{appName:n.name})}function jC(n){let e=Math.round(n/1e3),t=Math.floor(e/(3600*24)),r=Math.floor((e-t*3600*24)/3600),i=Math.floor((e-t*3600*24-r*3600)/60),o=e-t*3600*24-r*3600-i*60,s="";return t&&(s+=Ic(t)+"d:"),r&&(s+=Ic(r)+"h:"),s+=Ic(i)+"m:"+Ic(o)+"s",s}function Ic(n){return n===0?"00":n>=10?n.toString():"0"+n}function Sp(r,i){return Ne(this,arguments,function*({url:n,body:e},t){let o={"Content-Type":"application/json"},s=t.getImmediate({optional:!0});if(s){let h=yield s.getHeartbeatsHeader();h&&(o["X-Firebase-Client"]=h)}let a={method:"POST",body:JSON.stringify(e),headers:o},l;try{l=yield fetch(n,a)}catch(h){throw rt.create("fetch-network-error",{originalErrorMessage:h?.message})}if(l.status!==200)throw rt.create("fetch-status-error",{httpStatus:l.status});let c;try{c=yield l.json()}catch(h){throw rt.create("fetch-parse-error",{originalErrorMessage:h?.message})}let u=c.ttl.match(/^([\d.]+)(s)$/);if(!u||!u[2]||isNaN(Number(u[1])))throw rt.create("fetch-parse-error",{originalErrorMessage:`ttl field (timeToLive) is not in standard Protobuf Duration format: ${c.ttl}`});let d=Number(u[1])*1e3,f=Date.now();return{token:c.token,expireTimeMillis:f+d,issuedAtTimeMillis:f}})}function WR(n,e){let{projectId:t,appId:r,apiKey:i}=n.options;return{url:`${VC}/projects/${t}/apps/${r}:${BR}?key=${i}`,body:{recaptcha_v3_token:e}}}function BC(n,e){let{projectId:t,appId:r,apiKey:i}=n.options;return{url:`${VC}/projects/${t}/apps/${r}:${HR}?key=${i}`,body:{debug_token:e}}}var GR="firebase-app-check-database",qR=1,ms="firebase-app-check-store",HC="debug-token",Sc=null;function UC(){return Sc||(Sc=new Promise((n,e)=>{try{let t=indexedDB.open(GR,qR);t.onsuccess=r=>{n(r.target.result)},t.onerror=r=>{var i;e(rt.create("storage-open",{originalErrorMessage:(i=r.target.error)===null||i===void 0?void 0:i.message}))},t.onupgradeneeded=r=>{let i=r.target.result;switch(r.oldVersion){case 0:i.createObjectStore(ms,{keyPath:"compositeKey"})}}}catch(t){e(rt.create("storage-open",{originalErrorMessage:t?.message}))}}),Sc)}function KR(n){return zC(WC(n))}function QR(n,e){return $C(WC(n),e)}function YR(n){return $C(HC,n)}function ZR(){return zC(HC)}function $C(n,e){return Ne(this,null,function*(){let r=(yield UC()).transaction(ms,"readwrite"),o=r.objectStore(ms).put({compositeKey:n,value:e});return new Promise((s,a)=>{o.onsuccess=l=>{s()},r.onerror=l=>{var c;a(rt.create("storage-set",{originalErrorMessage:(c=l.target.error)===null||c===void 0?void 0:c.message}))}})})}function zC(n){return Ne(this,null,function*(){let t=(yield UC()).transaction(ms,"readonly"),i=t.objectStore(ms).get(n);return new Promise((o,s)=>{i.onsuccess=a=>{let l=a.target.result;o(l?l.value:void 0)},t.onerror=a=>{var l;s(rt.create("storage-get",{originalErrorMessage:(l=a.target.error)===null||l===void 0?void 0:l.message}))}})})}function WC(n){return`${n.options.appId}-${n.name}`}var Qn=new qr("@firebase/app-check");function XR(n){return Ne(this,null,function*(){if(Hu()){let e;try{e=yield KR(n)}catch(t){Qn.warn(`Failed to read token from IndexedDB. Error: ${t}`)}return e}})}function vp(n,e){return Hu()?QR(n,e).catch(t=>{Qn.warn(`Failed to write token to IndexedDB. Error: ${t}`)}):Promise.resolve()}function JR(){return Ne(this,null,function*(){let n;try{n=yield ZR()}catch{}if(n)return n;{let e=crypto.randomUUID();return YR(e).catch(t=>Qn.warn(`Failed to persist debug token to IndexedDB. Error: ${t}`)),e}})}function Tp(){return Mc().enabled}function Mp(){return Ne(this,null,function*(){let n=Mc();if(n.enabled&&n.token)return n.token.promise;throw Error(`
Can't get debug token in production mode.
`)})}function ek(){let n=o_(),e=Mc();if(e.initialized=!0,typeof n.FIREBASE_APPCHECK_DEBUG_TOKEN!="string"&&n.FIREBASE_APPCHECK_DEBUG_TOKEN!==!0)return;e.enabled=!0;let t=new ve;e.token=t,typeof n.FIREBASE_APPCHECK_DEBUG_TOKEN=="string"?t.resolve(n.FIREBASE_APPCHECK_DEBUG_TOKEN):t.resolve(JR())}var tk={error:"UNKNOWN_ERROR"};function nk(n){return na.encodeString(JSON.stringify(n),!1)}function Ep(n,e=!1,t=!1){return Ne(this,null,function*(){let r=n.app;Ip(r);let i=xe(r),o=i.token,s;if(o&&!ji(o)&&(i.token=void 0,o=void 0),!o){let c=yield i.cachedTokenPromise;c&&(ji(c)?o=c:yield vp(r,void 0))}if(!e&&o&&ji(o))return{token:o.token};let a=!1;if(Tp())try{i.exchangeTokenPromise||(i.exchangeTokenPromise=Sp(BC(r,yield Mp()),n.heartbeatServiceProvider).finally(()=>{i.exchangeTokenPromise=void 0}),a=!0);let c=yield i.exchangeTokenPromise;return yield vp(r,c),i.token=c,{token:c.token}}catch(c){return c.code==="appCheck/throttled"||c.code==="appCheck/initial-throttle"?Qn.warn(c.message):t&&Qn.error(c),Dp(c)}try{i.exchangeTokenPromise||(i.exchangeTokenPromise=i.provider.getToken().finally(()=>{i.exchangeTokenPromise=void 0}),a=!0),o=yield xe(r).exchangeTokenPromise}catch(c){c.code==="appCheck/throttled"||c.code==="appCheck/initial-throttle"?Qn.warn(c.message):t&&Qn.error(c),s=c}let l;return o?s?ji(o)?l={token:o.token,internalError:s}:l=Dp(s):(l={token:o.token},i.token=o,yield vp(r,o)):l=Dp(s),a&&KC(r,l),l})}function rk(n){return Ne(this,null,function*(){let e=n.app;Ip(e);let{provider:t}=xe(e);if(Tp()){let r=yield Mp(),{token:i}=yield Sp(BC(e,r),n.heartbeatServiceProvider);return{token:i}}else{let{token:r}=yield t.getToken();return{token:r}}})}function GC(n,e,t,r){let{app:i}=n,o=xe(i),s={next:t,error:r,type:e};if(o.tokenObservers=[...o.tokenObservers,s],o.token&&ji(o.token)){let a=o.token;Promise.resolve().then(()=>{t({token:a.token}),PC(n)}).catch(()=>{})}o.cachedTokenPromise.then(()=>PC(n))}function qC(n,e){let t=xe(n),r=t.tokenObservers.filter(i=>i.next!==e);r.length===0&&t.tokenRefresher&&t.tokenRefresher.isRunning()&&t.tokenRefresher.stop(),t.tokenObservers=r}function PC(n){let{app:e}=n,t=xe(e),r=t.tokenRefresher;r||(r=ik(n),t.tokenRefresher=r),!r.isRunning()&&t.isTokenAutoRefreshEnabled&&r.start()}function ik(n){let{app:e}=n;return new Cp(()=>Ne(null,null,function*(){let t=xe(e),r;if(t.token?r=yield Ep(n,!0):r=yield Ep(n),r.error)throw r.error;if(r.internalError)throw r.internalError}),()=>!0,()=>{let t=xe(e);if(t.token){let r=t.token.issuedAtTimeMillis+(t.token.expireTimeMillis-t.token.issuedAtTimeMillis)*.5+3e5,i=t.token.expireTimeMillis-5*60*1e3;return r=Math.min(r,i),Math.max(0,r-Date.now())}else return 0},RC.RETRIAL_MIN_WAIT,RC.RETRIAL_MAX_WAIT)}function KC(n,e){let t=xe(n).tokenObservers;for(let r of t)try{r.type==="EXTERNAL"&&e.error!=null?r.error(e.error):r.next(e)}catch{}}function ji(n){return n.expireTimeMillis-Date.now()>0}function Dp(n){return{token:nk(tk),error:n}}var bp=class{constructor(e,t){this.app=e,this.heartbeatServiceProvider=t}_delete(){let{tokenObservers:e}=xe(this.app);for(let t of e)qC(this.app,t.next);return Promise.resolve()}};function ok(n,e){return new bp(n,e)}function sk(n){return{getToken:e=>Ep(n,e),getLimitedUseToken:()=>rk(n),addTokenListener:e=>GC(n,"INTERNAL",e),removeTokenListener:e=>qC(n.app,e)}}var ak="@firebase/app-check",lk="0.10.1";var ck="https://www.google.com/recaptcha/api.js";function uk(n,e){let t=new ve,r=xe(n);r.reCAPTCHAState={initialized:t};let i=dk(n),o=kC(!1);return o?OC(n,e,o,i,t):pk(()=>{let s=kC(!1);if(!s)throw new Error("no recaptcha");OC(n,e,s,i,t)}),t.promise}function OC(n,e,t,r,i){t.ready(()=>{hk(n,e,t,r),i.resolve(t)})}function dk(n){let e=`fire_app_check_${n.name}`,t=document.createElement("div");return t.id=e,t.style.display="none",document.body.appendChild(t),e}function fk(n){return Ne(this,null,function*(){Ip(n);let t=yield xe(n).reCAPTCHAState.initialized.promise;return new Promise((r,i)=>{let o=xe(n).reCAPTCHAState;t.ready(()=>{r(t.execute(o.widgetId,{action:"fire_app_check"}))})})})}function hk(n,e,t,r){let i=t.render(r,{sitekey:e,size:"invisible",callback:()=>{xe(n).reCAPTCHAState.succeeded=!0},"error-callback":()=>{xe(n).reCAPTCHAState.succeeded=!1}}),o=xe(n);o.reCAPTCHAState=Object.assign(Object.assign({},o.reCAPTCHAState),{widgetId:i})}function pk(n){let e=document.createElement("script");e.src=ck,e.onload=n,document.head.appendChild(e)}var Tc=class n{constructor(e){this._siteKey=e,this._throttleData=null}getToken(){return Ne(this,null,function*(){var e,t,r;mk(this._throttleData);let i=yield fk(this._app).catch(s=>{throw rt.create("recaptcha-error")});if(!(!((e=xe(this._app).reCAPTCHAState)===null||e===void 0)&&e.succeeded))throw rt.create("recaptcha-error");let o;try{o=yield Sp(WR(this._app,i),this._heartbeatServiceProvider)}catch(s){throw!((t=s.code)===null||t===void 0)&&t.includes("fetch-status-error")?(this._throttleData=gk(Number((r=s.customData)===null||r===void 0?void 0:r.httpStatus),this._throttleData),rt.create("initial-throttle",{time:jC(this._throttleData.allowRequestsAfter-Date.now()),httpStatus:this._throttleData.httpStatus})):s}return this._throttleData=null,o})}initialize(e){this._app=e,this._heartbeatServiceProvider=sa(e,"heartbeat"),uk(e,this._siteKey).catch(()=>{})}isEqual(e){return e instanceof n?this._siteKey===e._siteKey:!1}};function gk(n,e){if(n===404||n===403)return{backoffCount:1,allowRequestsAfter:Date.now()+UR,httpStatus:n};{let t=e?e.backoffCount:0,r=__(t,1e3,2);return{backoffCount:t+1,allowRequestsAfter:Date.now()+r,httpStatus:n}}}function mk(n){if(n&&Date.now()-n.allowRequestsAfter<=0)throw rt.create("throttled",{time:jC(n.allowRequestsAfter-Date.now()),httpStatus:n.httpStatus})}function xp(n=zu(),e){n=Fe(n);let t=sa(n,"app-check");if(Mc().initialized||ek(),Tp()&&Mp().then(i=>console.log(`App Check debug token: ${i}. You will need to add it to your app's App Check settings in the Firebase console for it to work.`)),t.isInitialized()){let i=t.getImmediate(),o=t.getOptions();if(o.isTokenAutoRefreshEnabled===e.isTokenAutoRefreshEnabled&&o.provider.isEqual(e.provider))return i;throw rt.create("already-initialized",{appName:n.name})}let r=t.initialize({options:e});return _k(n,e.provider,e.isTokenAutoRefreshEnabled),xe(n).isTokenAutoRefreshEnabled&&GC(r,"INTERNAL",()=>{}),r}function _k(n,e,t=!1){let r=jR(n,Object.assign({},LC));r.activated=!0,r.provider=e,r.cachedTokenPromise=XR(n).then(i=>(i&&ji(i)&&(r.token=i,KC(n,{token:i.token})),i)),r.isTokenAutoRefreshEnabled=t&&n.automaticDataCollectionEnabled,!n.automaticDataCollectionEnabled&&t&&Qn.warn("`isTokenAutoRefreshEnabled` is true but `automaticDataCollectionEnabled` was set to false during `initializeApp()`. This blocks automatic token refresh."),r.provider.initialize(n)}var yk="app-check",FC="app-check-internal";function vk(){ao(new fn(yk,n=>{let e=n.getProvider("app").getImmediate(),t=n.getProvider("heartbeat");return ok(e,t)},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((n,e,t)=>{n.getProvider(FC).initialize()})),ao(new fn(FC,n=>{let e=n.getProvider("app-check").getImmediate();return sk(e)},"PUBLIC").setInstantiationMode("EXPLICIT")),Rn(ak,lk)}vk();var Dk="app-check";var Bi=class{constructor(){return TC(Dk)}};var wk=["localhost","0.0.0.0","127.0.0.1"],yW=typeof window<"u"&&wk.includes(window.location.hostname);var Ap=new E("angularfire2.auth.use-emulator"),Np=new E("angularfire2.auth.settings"),Rp=new E("angularfire2.auth.tenant-id"),kp=new E("angularfire2.auth.langugage-code"),Pp=new E("angularfire2.auth.use-device-language"),Op=new E("angularfire.auth.persistence"),Fp=(n,e,t,r,i,o,s,a)=>bc(`${n.name}.auth`,"AngularFireAuth",n.name,()=>{let l=e.runOutsideAngular(()=>n.auth());if(t&&l.useEmulator(...t),r&&(l.tenantId=r),l.languageCode=i,o&&l.useDeviceLanguage(),s)for(let[c,u]of Object.entries(s))l.settings[c]=u;return a&&l.setPersistence(a),l},[t,r,i,o,s,a]),YC=(()=>{class n{injector=m($e);authState;idToken;user;idTokenResult;credential;constructor(t,r,i,o,s,a,l,c,u,d,f,h){let p=new L,g=zt(void 0).pipe($t(s.outsideAngular),Le(()=>o.runOutsideAngular(()=>import("./chunk-DYAY3L3B.js"))),oe(()=>gs(t,o,r)),oe(_=>Fp(_,o,a,c,u,d,l,f)),_o({bufferSize:1,refCount:!1}));if(Ii(i))this.authState=this.user=this.idToken=this.idTokenResult=this.credential=zt(null);else{g.pipe(Ed()).subscribe();let _=g.pipe(Le(A=>A.getRedirectResult().then(J=>J,()=>null)),on(this.injector),_o({bufferSize:1,refCount:!1})),D=g.pipe(Le(A=>new G(J=>({unsubscribe:o.runOutsideAngular(()=>A.onAuthStateChanged(Pe=>J.next(Pe),Pe=>J.error(Pe),()=>J.complete()))})))),M=g.pipe(Le(A=>new G(J=>({unsubscribe:o.runOutsideAngular(()=>A.onIdTokenChanged(Pe=>J.next(Pe),Pe=>J.error(Pe),()=>J.complete()))}))));this.authState=_.pipe(Ga(D),gn(s.outsideAngular),$t(s.insideAngular)),this.user=_.pipe(Ga(M),gn(s.outsideAngular),$t(s.insideAngular)),this.idToken=this.user.pipe(Le(A=>A?pt(A.getIdToken()):zt(null))),this.idTokenResult=this.user.pipe(Le(A=>A?pt(A.getIdTokenResult()):zt(null))),this.credential=Wt(_,p,this.authState.pipe(gr(A=>!A))).pipe(oe(A=>A?.user?A:null),gn(s.outsideAngular),$t(s.insideAngular))}return AC(this,g,o,{spy:{apply:(_,D,M)=>{(_.startsWith("signIn")||_.startsWith("createUser"))&&M.then(A=>p.next(A))}}})}static \u0275fac=function(r){return new(r||n)(w(Li),w(Vi,8),w(ot),w(k),w(ps),w(Ap,8),w(Np,8),w(Rp,8),w(kp,8),w(Pp,8),w(Op,8),w(Bi,8))};static \u0275prov=I({token:n,factory:n.\u0275fac,providedIn:"any"})}return n})();var ZC="@firebase/database",XC="1.0.20";var Kg="";function Qg(n){Kg=n}var zp=class{constructor(e){this.domStorage_=e,this.prefix_="firebase:"}set(e,t){t==null?this.domStorage_.removeItem(this.prefixedName_(e)):this.domStorage_.setItem(this.prefixedName_(e),De(t))}get(e){let t=this.domStorage_.getItem(this.prefixedName_(e));return t==null?null:ra(t)}remove(e){this.domStorage_.removeItem(this.prefixedName_(e))}prefixedName_(e){return this.prefix_+e}toString(){return this.domStorage_.toString()}};var Wp=class{constructor(){this.cache_={},this.isInMemoryStorage=!0}set(e,t){t==null?delete this.cache_[e]:this.cache_[e]=t}get(e){return dt(this.cache_,e)?this.cache_[e]:null}remove(e){delete this.cache_[e]}};var xE=function(n){try{if(typeof window<"u"&&typeof window[n]<"u"){let e=window[n];return e.setItem("firebase:sentinel","cache"),e.removeItem("firebase:sentinel"),new zp(e)}}catch{}return new Wp},Lr=xE("localStorage"),Gp=xE("sessionStorage");var zi=new qr("@firebase/database"),AE=function(){let n=1;return function(){return n++}}(),NE=function(n){let e=m_(n),t=new g_;t.update(e);let r=t.digest();return na.encodeByteArray(r)},Bs=function(...n){let e="";for(let t=0;t<n.length;t++){let r=n[t];Array.isArray(r)||r&&typeof r=="object"&&typeof r.length=="number"?e+=Bs.apply(null,r):typeof r=="object"?e+=De(r):e+=r,e+=" "}return e},Vr=null,JC=!0,RE=function(n,e){y(!e||n===!0||n===!1,"Can't turn on custom loggers persistently."),n===!0?(zi.logLevel=y_.VERBOSE,Vr=zi.log.bind(zi),e&&Gp.set("logging_enabled",!0)):typeof n=="function"?Vr=n:(Vr=null,Gp.remove("logging_enabled"))},Re=function(...n){if(JC===!0&&(JC=!1,Vr===null&&Gp.get("logging_enabled")===!0&&RE(!0)),Vr){let e=Bs.apply(null,n);Vr(e)}},Hs=function(n){return function(...e){Re(n,...e)}},qp=function(...n){let e="FIREBASE INTERNAL ERROR: "+Bs(...n);zi.error(e)},ln=function(...n){let e=`FIREBASE FATAL ERROR: ${Bs(...n)}`;throw zi.error(e),new Error(e)},je=function(...n){let e="FIREBASE WARNING: "+Bs(...n);zi.warn(e)},Ek=function(){typeof window<"u"&&window.location&&window.location.protocol&&window.location.protocol.indexOf("https:")!==-1&&je("Insecure Firebase access from a secure page. Please use https in calls to new Firebase().")},nu=function(n){return typeof n=="number"&&(n!==n||n===Number.POSITIVE_INFINITY||n===Number.NEGATIVE_INFINITY)},bk=function(n){if(Ht()||document.readyState==="complete")n();else{let e=!1,t=function(){if(!document.body){setTimeout(t,Math.floor(10));return}e||(e=!0,n())};document.addEventListener?(document.addEventListener("DOMContentLoaded",t,!1),window.addEventListener("load",t,!1)):document.attachEvent&&(document.attachEvent("onreadystatechange",()=>{document.readyState==="complete"&&t()}),window.attachEvent("onload",t))}},Jn="[MIN_NAME]",Mn="[MAX_NAME]",Br=function(n,e){if(n===e)return 0;if(n===Jn||e===Mn)return-1;if(e===Jn||n===Mn)return 1;{let t=eE(n),r=eE(e);return t!==null?r!==null?t-r===0?n.length-e.length:t-r:-1:r!==null?1:n<e?-1:1}},Ik=function(n,e){return n===e?0:n<e?-1:1},_s=function(n,e){if(e&&n in e)return e[n];throw new Error("Missing required key ("+n+") in object: "+De(e))},Yg=function(n){if(typeof n!="object"||n===null)return De(n);let e=[];for(let r in n)e.push(r);e.sort();let t="{";for(let r=0;r<e.length;r++)r!==0&&(t+=","),t+=De(e[r]),t+=":",t+=Yg(n[e[r]]);return t+="}",t},kE=function(n,e){let t=n.length;if(t<=e)return[n];let r=[];for(let i=0;i<t;i+=e)i+e>t?r.push(n.substring(i,t)):r.push(n.substring(i,i+e));return r};function ke(n,e){for(let t in n)n.hasOwnProperty(t)&&e(t,n[t])}var PE=function(n){y(!nu(n),"Invalid JSON number");let e=11,t=52,r=(1<<e-1)-1,i,o,s,a,l;n===0?(o=0,s=0,i=1/n===-1/0?1:0):(i=n<0,n=Math.abs(n),n>=Math.pow(2,1-r)?(a=Math.min(Math.floor(Math.log(n)/Math.LN2),r),o=a+r,s=Math.round(n*Math.pow(2,t-a)-Math.pow(2,t))):(o=0,s=Math.round(n/Math.pow(2,1-r-t))));let c=[];for(l=t;l;l-=1)c.push(s%2?1:0),s=Math.floor(s/2);for(l=e;l;l-=1)c.push(o%2?1:0),o=Math.floor(o/2);c.push(i?1:0),c.reverse();let u=c.join(""),d="";for(l=0;l<64;l+=8){let f=parseInt(u.substr(l,8),2).toString(16);f.length===1&&(f="0"+f),d=d+f}return d.toLowerCase()},Sk=function(){return!!(typeof window=="object"&&window.chrome&&window.chrome.extension&&!/^chrome/.test(window.location.href))},Tk=function(){return typeof Windows=="object"&&typeof Windows.UI=="object"};function Mk(n,e){let t="Unknown Error";n==="too_big"?t="The data requested exceeds the maximum size that can be accessed with a single request.":n==="permission_denied"?t="Client doesn't have permission to access the desired data.":n==="unavailable"&&(t="The service is unavailable");let r=new Error(n+" at "+e._path.toString()+": "+t);return r.code=n.toUpperCase(),r}var xk=new RegExp("^-?(0*)\\d{1,10}$"),Ak=-2147483648,Nk=2147483647,eE=function(n){if(xk.test(n)){let e=Number(n);if(e>=Ak&&e<=Nk)return e}return null},Ji=function(n){try{n()}catch(e){setTimeout(()=>{let t=e.stack||"";throw je("Exception was thrown by user callback.",t),e},Math.floor(0))}},Rk=function(){return(typeof window=="object"&&window.navigator&&window.navigator.userAgent||"").search(/googlebot|google webmaster tools|bingbot|yahoo! slurp|baiduspider|yandexbot|duckduckbot/i)>=0},ws=function(n,e){let t=setTimeout(n,e);return typeof t=="number"&&typeof Deno<"u"&&Deno.unrefTimer?Deno.unrefTimer(t):typeof t=="object"&&t.unref&&t.unref(),t};var Kp=class{constructor(e,t){this.appCheckProvider=t,this.appName=e.name,v_(e)&&e.settings.appCheckToken&&(this.serverAppAppCheckToken=e.settings.appCheckToken),this.appCheck=t?.getImmediate({optional:!0}),this.appCheck||t?.get().then(r=>this.appCheck=r)}getToken(e){if(this.serverAppAppCheckToken){if(e)throw new Error("Attempted reuse of `FirebaseServerApp.appCheckToken` after previous usage failed.");return Promise.resolve({token:this.serverAppAppCheckToken})}return this.appCheck?this.appCheck.getToken(e):new Promise((t,r)=>{setTimeout(()=>{this.appCheck?this.getToken(e).then(t,r):t(null)},0)})}addTokenChangeListener(e){var t;(t=this.appCheckProvider)===null||t===void 0||t.get().then(r=>r.addTokenListener(e))}notifyForInvalidToken(){je(`Provided AppCheck credentials for the app named "${this.appName}" are invalid. This usually indicates your app was not initialized correctly.`)}};var Qp=class{constructor(e,t,r){this.appName_=e,this.firebaseOptions_=t,this.authProvider_=r,this.auth_=null,this.auth_=r.getImmediate({optional:!0}),this.auth_||r.onInit(i=>this.auth_=i)}getToken(e){return this.auth_?this.auth_.getToken(e).catch(t=>t&&t.code==="auth/token-not-initialized"?(Re("Got auth/token-not-initialized error. Treating as null token."),null):Promise.reject(t)):new Promise((t,r)=>{setTimeout(()=>{this.auth_?this.getToken(e).then(t,r):t(null)},0)})}addTokenChangeListener(e){this.auth_?this.auth_.addAuthTokenListener(e):this.authProvider_.get().then(t=>t.addAuthTokenListener(e))}removeTokenChangeListener(e){this.authProvider_.get().then(t=>t.removeAuthTokenListener(e))}notifyForInvalidToken(){let e='Provided authentication credentials for the app named "'+this.appName_+'" are invalid. This usually indicates your app was not initialized correctly. ';"credential"in this.firebaseOptions_?e+='Make sure the "credential" property provided to initializeApp() is authorized to access the specified "databaseURL" and is from the correct project.':"serviceAccount"in this.firebaseOptions_?e+='Make sure the "serviceAccount" property provided to initializeApp() is authorized to access the specified "databaseURL" and is from the correct project.':e+='Make sure the "apiKey" and "databaseURL" properties provided to initializeApp() match the values provided for your app at https://console.firebase.google.com/.',je(e)}},Cs=(()=>{class n{constructor(t){this.accessToken=t}getToken(t){return Promise.resolve({accessToken:this.accessToken})}addTokenChangeListener(t){t(this.accessToken)}removeTokenChangeListener(t){}notifyForInvalidToken(){}}n.OWNER="owner";return n})(),Ac="5",OE="v",FE="s",LE="r",VE="f",jE=/(console\.firebase|firebase-console-\w+\.corp|firebase\.corp)\.google\.com/,BE="ls",HE="p",Yp="ac",UE="websocket",$E="long_polling";var Nc=class{constructor(e,t,r,i,o=!1,s="",a=!1,l=!1,c=null){this.secure=t,this.namespace=r,this.webSocketOnly=i,this.nodeAdmin=o,this.persistenceKey=s,this.includeNamespaceInQueryParams=a,this.isUsingEmulator=l,this.emulatorOptions=c,this._host=e.toLowerCase(),this._domain=this._host.substr(this._host.indexOf(".")+1),this.internalHost=Lr.get("host:"+e)||this._host}isCacheableHost(){return this.internalHost.substr(0,2)==="s-"}isCustomHost(){return this._domain!=="firebaseio.com"&&this._domain!=="firebaseio-demo.com"}get host(){return this._host}set host(e){e!==this.internalHost&&(this.internalHost=e,this.isCacheableHost()&&Lr.set("host:"+this._host,this.internalHost))}toString(){let e=this.toURLString();return this.persistenceKey&&(e+="<"+this.persistenceKey+">"),e}toURLString(){let e=this.secure?"https://":"http://",t=this.includeNamespaceInQueryParams?`?ns=${this.namespace}`:"";return`${e}${this.host}/${t}`}};function kk(n){return n.host!==n.internalHost||n.isCustomHost()||n.includeNamespaceInQueryParams}function zE(n,e,t){y(typeof e=="string","typeof type must == string"),y(typeof t=="object","typeof params must == object");let r;if(e===UE)r=(n.secure?"wss://":"ws://")+n.internalHost+"/.ws?";else if(e===$E)r=(n.secure?"https://":"http://")+n.internalHost+"/.lp?";else throw new Error("Unknown connection type: "+e);kk(n)&&(t.ns=n.namespace);let i=[];return ke(t,(o,s)=>{i.push(o+"="+s)}),r+i.join("&")}var Zp=class{constructor(){this.counters_={}}incrementCounter(e,t=1){dt(this.counters_,e)||(this.counters_[e]=0),this.counters_[e]+=t}get(){return i_(this.counters_)}};var Lp={},Vp={};function Zg(n){let e=n.toString();return Lp[e]||(Lp[e]=new Zp),Lp[e]}function Pk(n,e){let t=n.toString();return Vp[t]||(Vp[t]=e()),Vp[t]}var Xp=class{constructor(e){this.onMessage_=e,this.pendingResponses=[],this.currentResponseNum=0,this.closeAfterResponse=-1,this.onClose=null}closeAfter(e,t){this.closeAfterResponse=e,this.onClose=t,this.closeAfterResponse<this.currentResponseNum&&(this.onClose(),this.onClose=null)}handleResponse(e,t){for(this.pendingResponses[e]=t;this.pendingResponses[this.currentResponseNum];){let r=this.pendingResponses[this.currentResponseNum];delete this.pendingResponses[this.currentResponseNum];for(let i=0;i<r.length;++i)r[i]&&Ji(()=>{this.onMessage_(r[i])});if(this.currentResponseNum===this.closeAfterResponse){this.onClose&&(this.onClose(),this.onClose=null);break}this.currentResponseNum++}}};var tE="start",Ok="close",Fk="pLPCommand",Lk="pRTLPCB",WE="id",GE="pw",qE="ser",Vk="cb",jk="seg",Bk="ts",Hk="d",Uk="dframe",KE=1870,QE=30,$k=KE-QE,zk=25e3,Wk=3e4,Ss=class n{constructor(e,t,r,i,o,s,a){this.connId=e,this.repoInfo=t,this.applicationId=r,this.appCheckToken=i,this.authToken=o,this.transportSessionId=s,this.lastSessionId=a,this.bytesSent=0,this.bytesReceived=0,this.everConnected_=!1,this.log_=Hs(e),this.stats_=Zg(t),this.urlFn=l=>(this.appCheckToken&&(l[Yp]=this.appCheckToken),zE(t,$E,l))}open(e,t){this.curSegmentNum=0,this.onDisconnect_=t,this.myPacketOrderer=new Xp(e),this.isClosed_=!1,this.connectTimeoutTimer_=setTimeout(()=>{this.log_("Timed out trying to connect."),this.onClosed_(),this.connectTimeoutTimer_=null},Math.floor(Wk)),bk(()=>{if(this.isClosed_)return;this.scriptTagHolder=new Jp((...o)=>{let[s,a,l,c,u]=o;if(this.incrementIncomingBytes_(o),!!this.scriptTagHolder)if(this.connectTimeoutTimer_&&(clearTimeout(this.connectTimeoutTimer_),this.connectTimeoutTimer_=null),this.everConnected_=!0,s===tE)this.id=a,this.password=l;else if(s===Ok)a?(this.scriptTagHolder.sendNewPolls=!1,this.myPacketOrderer.closeAfter(a,()=>{this.onClosed_()})):this.onClosed_();else throw new Error("Unrecognized command received: "+s)},(...o)=>{let[s,a]=o;this.incrementIncomingBytes_(o),this.myPacketOrderer.handleResponse(s,a)},()=>{this.onClosed_()},this.urlFn);let r={};r[tE]="t",r[qE]=Math.floor(Math.random()*1e8),this.scriptTagHolder.uniqueCallbackIdentifier&&(r[Vk]=this.scriptTagHolder.uniqueCallbackIdentifier),r[OE]=Ac,this.transportSessionId&&(r[FE]=this.transportSessionId),this.lastSessionId&&(r[BE]=this.lastSessionId),this.applicationId&&(r[HE]=this.applicationId),this.appCheckToken&&(r[Yp]=this.appCheckToken),typeof location<"u"&&location.hostname&&jE.test(location.hostname)&&(r[LE]=VE);let i=this.urlFn(r);this.log_("Connecting via long-poll to "+i),this.scriptTagHolder.addTag(i,()=>{})})}start(){this.scriptTagHolder.startLongPoll(this.id,this.password),this.addDisconnectPingFrame(this.id,this.password)}static forceAllow(){n.forceAllow_=!0}static forceDisallow(){n.forceDisallow_=!0}static isAvailable(){return Ht()?!1:n.forceAllow_?!0:!n.forceDisallow_&&typeof document<"u"&&document.createElement!=null&&!Sk()&&!Tk()}markConnectionHealthy(){}shutdown_(){this.isClosed_=!0,this.scriptTagHolder&&(this.scriptTagHolder.close(),this.scriptTagHolder=null),this.myDisconnFrame&&(document.body.removeChild(this.myDisconnFrame),this.myDisconnFrame=null),this.connectTimeoutTimer_&&(clearTimeout(this.connectTimeoutTimer_),this.connectTimeoutTimer_=null)}onClosed_(){this.isClosed_||(this.log_("Longpoll is closing itself"),this.shutdown_(),this.onDisconnect_&&(this.onDisconnect_(this.everConnected_),this.onDisconnect_=null))}close(){this.isClosed_||(this.log_("Longpoll is being closed."),this.shutdown_())}send(e){let t=De(e);this.bytesSent+=t.length,this.stats_.incrementCounter("bytes_sent",t.length);let r=r_(t),i=kE(r,$k);for(let o=0;o<i.length;o++)this.scriptTagHolder.enqueueSegment(this.curSegmentNum,i.length,i[o]),this.curSegmentNum++}addDisconnectPingFrame(e,t){if(Ht())return;this.myDisconnFrame=document.createElement("iframe");let r={};r[Uk]="t",r[WE]=e,r[GE]=t,this.myDisconnFrame.src=this.urlFn(r),this.myDisconnFrame.style.display="none",document.body.appendChild(this.myDisconnFrame)}incrementIncomingBytes_(e){let t=De(e).length;this.bytesReceived+=t,this.stats_.incrementCounter("bytes_received",t)}},Jp=class n{constructor(e,t,r,i){if(this.onDisconnect=r,this.urlFn=i,this.outstandingRequests=new Set,this.pendingSegs=[],this.currentSerial=Math.floor(Math.random()*1e8),this.sendNewPolls=!0,Ht())this.commandCB=e,this.onMessageCB=t;else{this.uniqueCallbackIdentifier=AE(),window[Fk+this.uniqueCallbackIdentifier]=e,window[Lk+this.uniqueCallbackIdentifier]=t,this.myIFrame=n.createIFrame_();let o="";this.myIFrame.src&&this.myIFrame.src.substr(0,11)==="javascript:"&&(o='<script>document.domain="'+document.domain+'";<\/script>');let s="<html><body>"+o+"</body></html>";try{this.myIFrame.doc.open(),this.myIFrame.doc.write(s),this.myIFrame.doc.close()}catch(a){Re("frame writing exception"),a.stack&&Re(a.stack),Re(a)}}}static createIFrame_(){let e=document.createElement("iframe");if(e.style.display="none",document.body){document.body.appendChild(e);try{e.contentWindow.document||Re("No IE domain setting required")}catch{let r=document.domain;e.src="javascript:void((function(){document.open();document.domain='"+r+"';document.close();})())"}}else throw"Document body has not initialized. Wait to initialize Firebase until after the document is ready.";return e.contentDocument?e.doc=e.contentDocument:e.contentWindow?e.doc=e.contentWindow.document:e.document&&(e.doc=e.document),e}close(){this.alive=!1,this.myIFrame&&(this.myIFrame.doc.body.textContent="",setTimeout(()=>{this.myIFrame!==null&&(document.body.removeChild(this.myIFrame),this.myIFrame=null)},Math.floor(0)));let e=this.onDisconnect;e&&(this.onDisconnect=null,e())}startLongPoll(e,t){for(this.myID=e,this.myPW=t,this.alive=!0;this.newRequest_(););}newRequest_(){if(this.alive&&this.sendNewPolls&&this.outstandingRequests.size<(this.pendingSegs.length>0?2:1)){this.currentSerial++;let e={};e[WE]=this.myID,e[GE]=this.myPW,e[qE]=this.currentSerial;let t=this.urlFn(e),r="",i=0;for(;this.pendingSegs.length>0&&this.pendingSegs[0].d.length+QE+r.length<=KE;){let s=this.pendingSegs.shift();r=r+"&"+jk+i+"="+s.seg+"&"+Bk+i+"="+s.ts+"&"+Hk+i+"="+s.d,i++}return t=t+r,this.addLongPollTag_(t,this.currentSerial),!0}else return!1}enqueueSegment(e,t,r){this.pendingSegs.push({seg:e,ts:t,d:r}),this.alive&&this.newRequest_()}addLongPollTag_(e,t){this.outstandingRequests.add(t);let r=()=>{this.outstandingRequests.delete(t),this.newRequest_()},i=setTimeout(r,Math.floor(zk)),o=()=>{clearTimeout(i),r()};this.addTag(e,o)}addTag(e,t){Ht()?this.doNodeLongPoll(e,t):setTimeout(()=>{try{if(!this.sendNewPolls)return;let r=this.myIFrame.doc.createElement("script");r.type="text/javascript",r.async=!0,r.src=e,r.onload=r.onreadystatechange=function(){let i=r.readyState;(!i||i==="loaded"||i==="complete")&&(r.onload=r.onreadystatechange=null,r.parentNode&&r.parentNode.removeChild(r),t())},r.onerror=()=>{Re("Long-poll script failed to load: "+e),this.sendNewPolls=!1,this.close()},this.myIFrame.doc.body.appendChild(r)}catch{}},Math.floor(1))}};var Gk=16384,qk=45e3,Rc=null;typeof MozWebSocket<"u"?Rc=MozWebSocket:typeof WebSocket<"u"&&(Rc=WebSocket);var Ui=(()=>{class n{constructor(t,r,i,o,s,a,l){this.connId=t,this.applicationId=i,this.appCheckToken=o,this.authToken=s,this.keepaliveTimer=null,this.frames=null,this.totalFrames=0,this.bytesSent=0,this.bytesReceived=0,this.log_=Hs(this.connId),this.stats_=Zg(r),this.connURL=n.connectionURL_(r,a,l,o,i),this.nodeAdmin=r.nodeAdmin}static connectionURL_(t,r,i,o,s){let a={};return a[OE]=Ac,!Ht()&&typeof location<"u"&&location.hostname&&jE.test(location.hostname)&&(a[LE]=VE),r&&(a[FE]=r),i&&(a[BE]=i),o&&(a[Yp]=o),s&&(a[HE]=s),zE(t,UE,a)}open(t,r){this.onDisconnect=r,this.onMessage=t,this.log_("Websocket connecting to "+this.connURL),this.everConnected_=!1,Lr.set("previous_websocket_failure",!0);try{let i;if(Ht()){let o=this.nodeAdmin?"AdminNode":"Node";i={headers:{"User-Agent":`Firebase/${Ac}/${Kg}/${process.platform}/${o}`,"X-Firebase-GMPID":this.applicationId||""}},this.authToken&&(i.headers.Authorization=`Bearer ${this.authToken}`),this.appCheckToken&&(i.headers["X-Firebase-AppCheck"]=this.appCheckToken);let s=process.env,a=this.connURL.indexOf("wss://")===0?s.HTTPS_PROXY||s.https_proxy:s.HTTP_PROXY||s.http_proxy;a&&(i.proxy={origin:a})}this.mySock=new Rc(this.connURL,[],i)}catch(i){this.log_("Error instantiating WebSocket.");let o=i.message||i.data;o&&this.log_(o),this.onClosed_();return}this.mySock.onopen=()=>{this.log_("Websocket connected."),this.everConnected_=!0},this.mySock.onclose=()=>{this.log_("Websocket connection was disconnected."),this.mySock=null,this.onClosed_()},this.mySock.onmessage=i=>{this.handleIncomingFrame(i)},this.mySock.onerror=i=>{this.log_("WebSocket error. Closing connection.");let o=i.message||i.data;o&&this.log_(o),this.onClosed_()}}start(){}static forceDisallow(){n.forceDisallow_=!0}static isAvailable(){let t=!1;if(typeof navigator<"u"&&navigator.userAgent){let r=/Android ([0-9]{0,}\.[0-9]{0,})/,i=navigator.userAgent.match(r);i&&i.length>1&&parseFloat(i[1])<4.4&&(t=!0)}return!t&&Rc!==null&&!n.forceDisallow_}static previouslyFailed(){return Lr.isInMemoryStorage||Lr.get("previous_websocket_failure")===!0}markConnectionHealthy(){Lr.remove("previous_websocket_failure")}appendFrame_(t){if(this.frames.push(t),this.frames.length===this.totalFrames){let r=this.frames.join("");this.frames=null;let i=ra(r);this.onMessage(i)}}handleNewFrameCount_(t){this.totalFrames=t,this.frames=[]}extractFrameCount_(t){if(y(this.frames===null,"We already have a frame buffer"),t.length<=6){let r=Number(t);if(!isNaN(r))return this.handleNewFrameCount_(r),null}return this.handleNewFrameCount_(1),t}handleIncomingFrame(t){if(this.mySock===null)return;let r=t.data;if(this.bytesReceived+=r.length,this.stats_.incrementCounter("bytes_received",r.length),this.resetKeepAlive(),this.frames!==null)this.appendFrame_(r);else{let i=this.extractFrameCount_(r);i!==null&&this.appendFrame_(i)}}send(t){this.resetKeepAlive();let r=De(t);this.bytesSent+=r.length,this.stats_.incrementCounter("bytes_sent",r.length);let i=kE(r,Gk);i.length>1&&this.sendString_(String(i.length));for(let o=0;o<i.length;o++)this.sendString_(i[o])}shutdown_(){this.isClosed_=!0,this.keepaliveTimer&&(clearInterval(this.keepaliveTimer),this.keepaliveTimer=null),this.mySock&&(this.mySock.close(),this.mySock=null)}onClosed_(){this.isClosed_||(this.log_("WebSocket is closing itself"),this.shutdown_(),this.onDisconnect&&(this.onDisconnect(this.everConnected_),this.onDisconnect=null))}close(){this.isClosed_||(this.log_("WebSocket is being closed"),this.shutdown_())}resetKeepAlive(){clearInterval(this.keepaliveTimer),this.keepaliveTimer=setInterval(()=>{this.mySock&&this.sendString_("0"),this.resetKeepAlive()},Math.floor(qk))}sendString_(t){try{this.mySock.send(t)}catch(r){this.log_("Exception thrown from WebSocket.send():",r.message||r.data,"Closing connection."),setTimeout(this.onClosed_.bind(this),0)}}}n.responsesRequiredToBeHealthy=2,n.healthyTimeout=3e4;return n})(),YE=(()=>{class n{static get ALL_TRANSPORTS(){return[Ss,Ui]}static get IS_TRANSPORT_INITIALIZED(){return this.globalTransportInitialized_}constructor(t){this.initTransports_(t)}initTransports_(t){let r=Ui&&Ui.isAvailable(),i=r&&!Ui.previouslyFailed();if(t.webSocketOnly&&(r||je("wss:// URL used, but browser isn't known to support websockets. Trying anyway."),i=!0),i)this.transports_=[Ui];else{let o=this.transports_=[];for(let s of n.ALL_TRANSPORTS)s&&s.isAvailable()&&o.push(s);n.globalTransportInitialized_=!0}}initialTransport(){if(this.transports_.length>0)return this.transports_[0];throw new Error("No transports available")}upgradeTransport(){return this.transports_.length>1?this.transports_[1]:null}}n.globalTransportInitialized_=!1;return n})(),Kk=6e4,Qk=5e3,Yk=10*1024,Zk=100*1024,jp="t",nE="d",Xk="s",rE="r",Jk="e",iE="o",oE="a",sE="n",aE="p",eP="h",eg=class{constructor(e,t,r,i,o,s,a,l,c,u){this.id=e,this.repoInfo_=t,this.applicationId_=r,this.appCheckToken_=i,this.authToken_=o,this.onMessage_=s,this.onReady_=a,this.onDisconnect_=l,this.onKill_=c,this.lastSessionId=u,this.connectionCount=0,this.pendingDataMessages=[],this.state_=0,this.log_=Hs("c:"+this.id+":"),this.transportManager_=new YE(t),this.log_("Connection created"),this.start_()}start_(){let e=this.transportManager_.initialTransport();this.conn_=new e(this.nextTransportId_(),this.repoInfo_,this.applicationId_,this.appCheckToken_,this.authToken_,null,this.lastSessionId),this.primaryResponsesRequired_=e.responsesRequiredToBeHealthy||0;let t=this.connReceiver_(this.conn_),r=this.disconnReceiver_(this.conn_);this.tx_=this.conn_,this.rx_=this.conn_,this.secondaryConn_=null,this.isHealthy_=!1,setTimeout(()=>{this.conn_&&this.conn_.open(t,r)},Math.floor(0));let i=e.healthyTimeout||0;i>0&&(this.healthyTimeout_=ws(()=>{this.healthyTimeout_=null,this.isHealthy_||(this.conn_&&this.conn_.bytesReceived>Zk?(this.log_("Connection exceeded healthy timeout but has received "+this.conn_.bytesReceived+" bytes. Marking connection healthy."),this.isHealthy_=!0,this.conn_.markConnectionHealthy()):this.conn_&&this.conn_.bytesSent>Yk?this.log_("Connection exceeded healthy timeout but has sent "+this.conn_.bytesSent+" bytes. Leaving connection alive."):(this.log_("Closing unhealthy connection after timeout."),this.close()))},Math.floor(i)))}nextTransportId_(){return"c:"+this.id+":"+this.connectionCount++}disconnReceiver_(e){return t=>{e===this.conn_?this.onConnectionLost_(t):e===this.secondaryConn_?(this.log_("Secondary connection lost."),this.onSecondaryConnectionLost_()):this.log_("closing an old connection")}}connReceiver_(e){return t=>{this.state_!==2&&(e===this.rx_?this.onPrimaryMessageReceived_(t):e===this.secondaryConn_?this.onSecondaryMessageReceived_(t):this.log_("message on old connection"))}}sendRequest(e){let t={t:"d",d:e};this.sendData_(t)}tryCleanupConnection(){this.tx_===this.secondaryConn_&&this.rx_===this.secondaryConn_&&(this.log_("cleaning up and promoting a connection: "+this.secondaryConn_.connId),this.conn_=this.secondaryConn_,this.secondaryConn_=null)}onSecondaryControl_(e){if(jp in e){let t=e[jp];t===oE?this.upgradeIfSecondaryHealthy_():t===rE?(this.log_("Got a reset on secondary, closing it"),this.secondaryConn_.close(),(this.tx_===this.secondaryConn_||this.rx_===this.secondaryConn_)&&this.close()):t===iE&&(this.log_("got pong on secondary."),this.secondaryResponsesRequired_--,this.upgradeIfSecondaryHealthy_())}}onSecondaryMessageReceived_(e){let t=_s("t",e),r=_s("d",e);if(t==="c")this.onSecondaryControl_(r);else if(t==="d")this.pendingDataMessages.push(r);else throw new Error("Unknown protocol layer: "+t)}upgradeIfSecondaryHealthy_(){this.secondaryResponsesRequired_<=0?(this.log_("Secondary connection is healthy."),this.isHealthy_=!0,this.secondaryConn_.markConnectionHealthy(),this.proceedWithUpgrade_()):(this.log_("sending ping on secondary."),this.secondaryConn_.send({t:"c",d:{t:aE,d:{}}}))}proceedWithUpgrade_(){this.secondaryConn_.start(),this.log_("sending client ack on secondary"),this.secondaryConn_.send({t:"c",d:{t:oE,d:{}}}),this.log_("Ending transmission on primary"),this.conn_.send({t:"c",d:{t:sE,d:{}}}),this.tx_=this.secondaryConn_,this.tryCleanupConnection()}onPrimaryMessageReceived_(e){let t=_s("t",e),r=_s("d",e);t==="c"?this.onControl_(r):t==="d"&&this.onDataMessage_(r)}onDataMessage_(e){this.onPrimaryResponse_(),this.onMessage_(e)}onPrimaryResponse_(){this.isHealthy_||(this.primaryResponsesRequired_--,this.primaryResponsesRequired_<=0&&(this.log_("Primary connection is healthy."),this.isHealthy_=!0,this.conn_.markConnectionHealthy()))}onControl_(e){let t=_s(jp,e);if(nE in e){let r=e[nE];if(t===eP){let i=Object.assign({},r);this.repoInfo_.isUsingEmulator&&(i.h=this.repoInfo_.host),this.onHandshake_(i)}else if(t===sE){this.log_("recvd end transmission on primary"),this.rx_=this.secondaryConn_;for(let i=0;i<this.pendingDataMessages.length;++i)this.onDataMessage_(this.pendingDataMessages[i]);this.pendingDataMessages=[],this.tryCleanupConnection()}else t===Xk?this.onConnectionShutdown_(r):t===rE?this.onReset_(r):t===Jk?qp("Server Error: "+r):t===iE?(this.log_("got pong on primary."),this.onPrimaryResponse_(),this.sendPingOnPrimaryIfNecessary_()):qp("Unknown control packet command: "+t)}}onHandshake_(e){let t=e.ts,r=e.v,i=e.h;this.sessionId=e.s,this.repoInfo_.host=i,this.state_===0&&(this.conn_.start(),this.onConnectionEstablished_(this.conn_,t),Ac!==r&&je("Protocol version mismatch detected"),this.tryStartUpgrade_())}tryStartUpgrade_(){let e=this.transportManager_.upgradeTransport();e&&this.startUpgrade_(e)}startUpgrade_(e){this.secondaryConn_=new e(this.nextTransportId_(),this.repoInfo_,this.applicationId_,this.appCheckToken_,this.authToken_,this.sessionId),this.secondaryResponsesRequired_=e.responsesRequiredToBeHealthy||0;let t=this.connReceiver_(this.secondaryConn_),r=this.disconnReceiver_(this.secondaryConn_);this.secondaryConn_.open(t,r),ws(()=>{this.secondaryConn_&&(this.log_("Timed out trying to upgrade."),this.secondaryConn_.close())},Math.floor(Kk))}onReset_(e){this.log_("Reset packet received. New host: "+e),this.repoInfo_.host=e,this.state_===1?this.close():(this.closeConnections_(),this.start_())}onConnectionEstablished_(e,t){this.log_("Realtime connection established."),this.conn_=e,this.state_=1,this.onReady_&&(this.onReady_(t,this.sessionId),this.onReady_=null),this.primaryResponsesRequired_===0?(this.log_("Primary connection is healthy."),this.isHealthy_=!0):ws(()=>{this.sendPingOnPrimaryIfNecessary_()},Math.floor(Qk))}sendPingOnPrimaryIfNecessary_(){!this.isHealthy_&&this.state_===1&&(this.log_("sending ping on primary."),this.sendData_({t:"c",d:{t:aE,d:{}}}))}onSecondaryConnectionLost_(){let e=this.secondaryConn_;this.secondaryConn_=null,(this.tx_===e||this.rx_===e)&&this.close()}onConnectionLost_(e){this.conn_=null,!e&&this.state_===0?(this.log_("Realtime connection failed."),this.repoInfo_.isCacheableHost()&&(Lr.remove("host:"+this.repoInfo_.host),this.repoInfo_.internalHost=this.repoInfo_.host)):this.state_===1&&this.log_("Realtime connection lost."),this.close()}onConnectionShutdown_(e){this.log_("Connection shutdown command received. Shutting down..."),this.onKill_&&(this.onKill_(e),this.onKill_=null),this.onDisconnect_=null,this.close()}sendData_(e){if(this.state_!==1)throw"Connection is not connected";this.tx_.send(e)}close(){this.state_!==2&&(this.log_("Closing realtime connection."),this.state_=2,this.closeConnections_(),this.onDisconnect_&&(this.onDisconnect_(),this.onDisconnect_=null))}closeConnections_(){this.log_("Shutting down all connections"),this.conn_&&(this.conn_.close(),this.conn_=null),this.secondaryConn_&&(this.secondaryConn_.close(),this.secondaryConn_=null),this.healthyTimeout_&&(clearTimeout(this.healthyTimeout_),this.healthyTimeout_=null)}};var kc=class{put(e,t,r,i){}merge(e,t,r,i){}refreshAuthToken(e){}refreshAppCheckToken(e){}onDisconnectPut(e,t,r){}onDisconnectMerge(e,t,r){}onDisconnectCancel(e,t){}reportStats(e){}};var Pc=class{constructor(e){this.allowedEvents_=e,this.listeners_={},y(Array.isArray(e)&&e.length>0,"Requires a non-empty array")}trigger(e,...t){if(Array.isArray(this.listeners_[e])){let r=[...this.listeners_[e]];for(let i=0;i<r.length;i++)r[i].callback.apply(r[i].context,t)}}on(e,t,r){this.validateEventType_(e),this.listeners_[e]=this.listeners_[e]||[],this.listeners_[e].push({callback:t,context:r});let i=this.getInitialEvent(e);i&&t.apply(r,i)}off(e,t,r){this.validateEventType_(e);let i=this.listeners_[e]||[];for(let o=0;o<i.length;o++)if(i[o].callback===t&&(!r||r===i[o].context)){i.splice(o,1);return}}validateEventType_(e){y(this.allowedEvents_.find(t=>t===e),"Unknown event: "+e)}};var Oc=class n extends Pc{static getInstance(){return new n}constructor(){super(["online"]),this.online_=!0,typeof window<"u"&&typeof window.addEventListener<"u"&&!Bu()&&(window.addEventListener("online",()=>{this.online_||(this.online_=!0,this.trigger("online",!0))},!1),window.addEventListener("offline",()=>{this.online_&&(this.online_=!1,this.trigger("online",!1))},!1))}getInitialEvent(e){return y(e==="online","Unknown event type: "+e),[this.online_]}currentlyOnline(){return this.online_}};var lE=32,cE=768,te=class{constructor(e,t){if(t===void 0){this.pieces_=e.split("/");let r=0;for(let i=0;i<this.pieces_.length;i++)this.pieces_[i].length>0&&(this.pieces_[r]=this.pieces_[i],r++);this.pieces_.length=r,this.pieceNum_=0}else this.pieces_=e,this.pieceNum_=t}toString(){let e="";for(let t=this.pieceNum_;t<this.pieces_.length;t++)this.pieces_[t]!==""&&(e+="/"+this.pieces_[t]);return e||"/"}};function ee(){return new te("")}function j(n){return n.pieceNum_>=n.pieces_.length?null:n.pieces_[n.pieceNum_]}function er(n){return n.pieces_.length-n.pieceNum_}function le(n){let e=n.pieceNum_;return e<n.pieces_.length&&e++,new te(n.pieces_,e)}function Xg(n){return n.pieceNum_<n.pieces_.length?n.pieces_[n.pieces_.length-1]:null}function tP(n){let e="";for(let t=n.pieceNum_;t<n.pieces_.length;t++)n.pieces_[t]!==""&&(e+="/"+encodeURIComponent(String(n.pieces_[t])));return e||"/"}function Ts(n,e=0){return n.pieces_.slice(n.pieceNum_+e)}function ZE(n){if(n.pieceNum_>=n.pieces_.length)return null;let e=[];for(let t=n.pieceNum_;t<n.pieces_.length-1;t++)e.push(n.pieces_[t]);return new te(e,0)}function pe(n,e){let t=[];for(let r=n.pieceNum_;r<n.pieces_.length;r++)t.push(n.pieces_[r]);if(e instanceof te)for(let r=e.pieceNum_;r<e.pieces_.length;r++)t.push(e.pieces_[r]);else{let r=e.split("/");for(let i=0;i<r.length;i++)r[i].length>0&&t.push(r[i])}return new te(t,0)}function B(n){return n.pieceNum_>=n.pieces_.length}function Ge(n,e){let t=j(n),r=j(e);if(t===null)return e;if(t===r)return Ge(le(n),le(e));throw new Error("INTERNAL ERROR: innerPath ("+e+") is not within outerPath ("+n+")")}function nP(n,e){let t=Ts(n,0),r=Ts(e,0);for(let i=0;i<t.length&&i<r.length;i++){let o=Br(t[i],r[i]);if(o!==0)return o}return t.length===r.length?0:t.length<r.length?-1:1}function Jg(n,e){if(er(n)!==er(e))return!1;for(let t=n.pieceNum_,r=e.pieceNum_;t<=n.pieces_.length;t++,r++)if(n.pieces_[t]!==e.pieces_[r])return!1;return!0}function Et(n,e){let t=n.pieceNum_,r=e.pieceNum_;if(er(n)>er(e))return!1;for(;t<n.pieces_.length;){if(n.pieces_[t]!==e.pieces_[r])return!1;++t,++r}return!0}var tg=class{constructor(e,t){this.errorPrefix_=t,this.parts_=Ts(e,0),this.byteLength_=Math.max(1,this.parts_.length);for(let r=0;r<this.parts_.length;r++)this.byteLength_+=so(this.parts_[r]);XE(this)}};function rP(n,e){n.parts_.length>0&&(n.byteLength_+=1),n.parts_.push(e),n.byteLength_+=so(e),XE(n)}function iP(n){let e=n.parts_.pop();n.byteLength_-=so(e),n.parts_.length>0&&(n.byteLength_-=1)}function XE(n){if(n.byteLength_>cE)throw new Error(n.errorPrefix_+"has a key path longer than "+cE+" bytes ("+n.byteLength_+").");if(n.parts_.length>lE)throw new Error(n.errorPrefix_+"path specified exceeds the maximum depth that can be written ("+lE+") or object contains a cycle "+Fr(n))}function Fr(n){return n.parts_.length===0?"":"in property '"+n.parts_.join(".")+"'"}var ng=class n extends Pc{static getInstance(){return new n}constructor(){super(["visible"]);let e,t;typeof document<"u"&&typeof document.addEventListener<"u"&&(typeof document.hidden<"u"?(t="visibilitychange",e="hidden"):typeof document.mozHidden<"u"?(t="mozvisibilitychange",e="mozHidden"):typeof document.msHidden<"u"?(t="msvisibilitychange",e="msHidden"):typeof document.webkitHidden<"u"&&(t="webkitvisibilitychange",e="webkitHidden")),this.visible_=!0,t&&document.addEventListener(t,()=>{let r=!document[e];r!==this.visible_&&(this.visible_=r,this.trigger("visible",r))},!1)}getInitialEvent(e){return y(e==="visible","Unknown event type: "+e),[this.visible_]}};var ys=1e3,oP=60*5*1e3,uE=30*1e3,sP=1.3,aP=3e4,lP="server_kill",dE=3,em=(()=>{class n extends kc{constructor(t,r,i,o,s,a,l,c){if(super(),this.repoInfo_=t,this.applicationId_=r,this.onDataUpdate_=i,this.onConnectStatus_=o,this.onServerInfoUpdate_=s,this.authTokenProvider_=a,this.appCheckTokenProvider_=l,this.authOverride_=c,this.id=n.nextPersistentConnectionId_++,this.log_=Hs("p:"+this.id+":"),this.interruptReasons_={},this.listens=new Map,this.outstandingPuts_=[],this.outstandingGets_=[],this.outstandingPutCount_=0,this.outstandingGetCount_=0,this.onDisconnectRequestQueue_=[],this.connected_=!1,this.reconnectDelay_=ys,this.maxReconnectDelay_=oP,this.securityDebugCallback_=null,this.lastSessionId=null,this.establishConnectionTimer_=null,this.visible_=!1,this.requestCBHash_={},this.requestNumber_=0,this.realtime_=null,this.authToken_=null,this.appCheckToken_=null,this.forceTokenRefresh_=!1,this.invalidAuthTokenCount_=0,this.invalidAppCheckTokenCount_=0,this.firstConnection_=!0,this.lastConnectionAttemptTime_=null,this.lastConnectionEstablishedTime_=null,c&&!Ht())throw new Error("Auth override specified in options, but not supported on non Node.js platforms");ng.getInstance().on("visible",this.onVisible_,this),t.host.indexOf("fblocal")===-1&&Oc.getInstance().on("online",this.onOnline_,this)}sendRequest(t,r,i){let o=++this.requestNumber_,s={r:o,a:t,b:r};this.log_(De(s)),y(this.connected_,"sendRequest call when we're not connected not allowed."),this.realtime_.sendRequest(s),i&&(this.requestCBHash_[o]=i)}get(t){this.initConnection_();let r=new ve,o={action:"g",request:{p:t._path.toString(),q:t._queryObject},onComplete:a=>{let l=a.d;a.s==="ok"?r.resolve(l):r.reject(l)}};this.outstandingGets_.push(o),this.outstandingGetCount_++;let s=this.outstandingGets_.length-1;return this.connected_&&this.sendGet_(s),r.promise}listen(t,r,i,o){this.initConnection_();let s=t._queryIdentifier,a=t._path.toString();this.log_("Listen called for "+a+" "+s),this.listens.has(a)||this.listens.set(a,new Map),y(t._queryParams.isDefault()||!t._queryParams.loadsAllData(),"listen() called for non-default but complete query"),y(!this.listens.get(a).has(s),"listen() called twice for same path/queryId.");let l={onComplete:o,hashFn:r,query:t,tag:i};this.listens.get(a).set(s,l),this.connected_&&this.sendListen_(l)}sendGet_(t){let r=this.outstandingGets_[t];this.sendRequest("g",r.request,i=>{delete this.outstandingGets_[t],this.outstandingGetCount_--,this.outstandingGetCount_===0&&(this.outstandingGets_=[]),r.onComplete&&r.onComplete(i)})}sendListen_(t){let r=t.query,i=r._path.toString(),o=r._queryIdentifier;this.log_("Listen on "+i+" for "+o);let s={p:i},a="q";t.tag&&(s.q=r._queryObject,s.t=t.tag),s.h=t.hashFn(),this.sendRequest(a,s,l=>{let c=l.d,u=l.s;n.warnOnListenWarnings_(c,r),(this.listens.get(i)&&this.listens.get(i).get(o))===t&&(this.log_("listen response",l),u!=="ok"&&this.removeListen_(i,o),t.onComplete&&t.onComplete(u,c))})}static warnOnListenWarnings_(t,r){if(t&&typeof t=="object"&&dt(t,"w")){let i=Nn(t,"w");if(Array.isArray(i)&&~i.indexOf("no_index")){let o='".indexOn": "'+r._queryParams.getIndex().toString()+'"',s=r._path.toString();je(`Using an unspecified index. Your data will be downloaded and filtered on the client. Consider adding ${o} at ${s} to your security rules for better performance.`)}}}refreshAuthToken(t){this.authToken_=t,this.log_("Auth token refreshed"),this.authToken_?this.tryAuth():this.connected_&&this.sendRequest("unauth",{},()=>{}),this.reduceReconnectDelayIfAdminCredential_(t)}reduceReconnectDelayIfAdminCredential_(t){(t&&t.length===40||f_(t))&&(this.log_("Admin auth credential detected. Reducing max reconnect time."),this.maxReconnectDelay_=uE)}refreshAppCheckToken(t){this.appCheckToken_=t,this.log_("App check token refreshed"),this.appCheckToken_?this.tryAppCheck():this.connected_&&this.sendRequest("unappeck",{},()=>{})}tryAuth(){if(this.connected_&&this.authToken_){let t=this.authToken_,r=d_(t)?"auth":"gauth",i={cred:t};this.authOverride_===null?i.noauth=!0:typeof this.authOverride_=="object"&&(i.authvar=this.authOverride_),this.sendRequest(r,i,o=>{let s=o.s,a=o.d||"error";this.authToken_===t&&(s==="ok"?this.invalidAuthTokenCount_=0:this.onAuthRevoked_(s,a))})}}tryAppCheck(){this.connected_&&this.appCheckToken_&&this.sendRequest("appcheck",{token:this.appCheckToken_},t=>{let r=t.s,i=t.d||"error";r==="ok"?this.invalidAppCheckTokenCount_=0:this.onAppCheckRevoked_(r,i)})}unlisten(t,r){let i=t._path.toString(),o=t._queryIdentifier;this.log_("Unlisten called for "+i+" "+o),y(t._queryParams.isDefault()||!t._queryParams.loadsAllData(),"unlisten() called for non-default but complete query"),this.removeListen_(i,o)&&this.connected_&&this.sendUnlisten_(i,o,t._queryObject,r)}sendUnlisten_(t,r,i,o){this.log_("Unlisten on "+t+" for "+r);let s={p:t},a="n";o&&(s.q=i,s.t=o),this.sendRequest(a,s)}onDisconnectPut(t,r,i){this.initConnection_(),this.connected_?this.sendOnDisconnect_("o",t,r,i):this.onDisconnectRequestQueue_.push({pathString:t,action:"o",data:r,onComplete:i})}onDisconnectMerge(t,r,i){this.initConnection_(),this.connected_?this.sendOnDisconnect_("om",t,r,i):this.onDisconnectRequestQueue_.push({pathString:t,action:"om",data:r,onComplete:i})}onDisconnectCancel(t,r){this.initConnection_(),this.connected_?this.sendOnDisconnect_("oc",t,null,r):this.onDisconnectRequestQueue_.push({pathString:t,action:"oc",data:null,onComplete:r})}sendOnDisconnect_(t,r,i,o){let s={p:r,d:i};this.log_("onDisconnect "+t,s),this.sendRequest(t,s,a=>{o&&setTimeout(()=>{o(a.s,a.d)},Math.floor(0))})}put(t,r,i,o){this.putInternal("p",t,r,i,o)}merge(t,r,i,o){this.putInternal("m",t,r,i,o)}putInternal(t,r,i,o,s){this.initConnection_();let a={p:r,d:i};s!==void 0&&(a.h=s),this.outstandingPuts_.push({action:t,request:a,onComplete:o}),this.outstandingPutCount_++;let l=this.outstandingPuts_.length-1;this.connected_?this.sendPut_(l):this.log_("Buffering put: "+r)}sendPut_(t){let r=this.outstandingPuts_[t].action,i=this.outstandingPuts_[t].request,o=this.outstandingPuts_[t].onComplete;this.outstandingPuts_[t].queued=this.connected_,this.sendRequest(r,i,s=>{this.log_(r+" response",s),delete this.outstandingPuts_[t],this.outstandingPutCount_--,this.outstandingPutCount_===0&&(this.outstandingPuts_=[]),o&&o(s.s,s.d)})}reportStats(t){if(this.connected_){let r={c:t};this.log_("reportStats",r),this.sendRequest("s",r,i=>{if(i.s!=="ok"){let s=i.d;this.log_("reportStats","Error sending stats: "+s)}})}}onDataMessage_(t){if("r"in t){this.log_("from server: "+De(t));let r=t.r,i=this.requestCBHash_[r];i&&(delete this.requestCBHash_[r],i(t.b))}else{if("error"in t)throw"A server-side error has occurred: "+t.error;"a"in t&&this.onDataPush_(t.a,t.b)}}onDataPush_(t,r){this.log_("handleServerMessage",t,r),t==="d"?this.onDataUpdate_(r.p,r.d,!1,r.t):t==="m"?this.onDataUpdate_(r.p,r.d,!0,r.t):t==="c"?this.onListenRevoked_(r.p,r.q):t==="ac"?this.onAuthRevoked_(r.s,r.d):t==="apc"?this.onAppCheckRevoked_(r.s,r.d):t==="sd"?this.onSecurityDebugPacket_(r):qp("Unrecognized action received from server: "+De(t)+`
Are you using the latest client?`)}onReady_(t,r){this.log_("connection ready"),this.connected_=!0,this.lastConnectionEstablishedTime_=new Date().getTime(),this.handleTimestamp_(t),this.lastSessionId=r,this.firstConnection_&&this.sendConnectStats_(),this.restoreState_(),this.firstConnection_=!1,this.onConnectStatus_(!0)}scheduleConnect_(t){y(!this.realtime_,"Scheduling a connect when we're already connected/ing?"),this.establishConnectionTimer_&&clearTimeout(this.establishConnectionTimer_),this.establishConnectionTimer_=setTimeout(()=>{this.establishConnectionTimer_=null,this.establishConnection_()},Math.floor(t))}initConnection_(){!this.realtime_&&this.firstConnection_&&this.scheduleConnect_(0)}onVisible_(t){t&&!this.visible_&&this.reconnectDelay_===this.maxReconnectDelay_&&(this.log_("Window became visible. Reducing delay."),this.reconnectDelay_=ys,this.realtime_||this.scheduleConnect_(0)),this.visible_=t}onOnline_(t){t?(this.log_("Browser went online."),this.reconnectDelay_=ys,this.realtime_||this.scheduleConnect_(0)):(this.log_("Browser went offline. Killing connection."),this.realtime_&&this.realtime_.close())}onRealtimeDisconnect_(){if(this.log_("data client disconnected"),this.connected_=!1,this.realtime_=null,this.cancelSentTransactions_(),this.requestCBHash_={},this.shouldReconnect_()){this.visible_?this.lastConnectionEstablishedTime_&&(new Date().getTime()-this.lastConnectionEstablishedTime_>aP&&(this.reconnectDelay_=ys),this.lastConnectionEstablishedTime_=null):(this.log_("Window isn't visible. Delaying reconnect."),this.reconnectDelay_=this.maxReconnectDelay_,this.lastConnectionAttemptTime_=new Date().getTime());let t=Math.max(0,new Date().getTime()-this.lastConnectionAttemptTime_),r=Math.max(0,this.reconnectDelay_-t);r=Math.random()*r,this.log_("Trying to reconnect in "+r+"ms"),this.scheduleConnect_(r),this.reconnectDelay_=Math.min(this.maxReconnectDelay_,this.reconnectDelay_*sP)}this.onConnectStatus_(!1)}establishConnection_(){return Ne(this,null,function*(){if(this.shouldReconnect_()){this.log_("Making a connection attempt"),this.lastConnectionAttemptTime_=new Date().getTime(),this.lastConnectionEstablishedTime_=null;let t=this.onDataMessage_.bind(this),r=this.onReady_.bind(this),i=this.onRealtimeDisconnect_.bind(this),o=this.id+":"+n.nextConnectionId_++,s=this.lastSessionId,a=!1,l=null,c=function(){l?l.close():(a=!0,i())},u=function(f){y(l,"sendRequest call when we're not connected not allowed."),l.sendRequest(f)};this.realtime_={close:c,sendRequest:u};let d=this.forceTokenRefresh_;this.forceTokenRefresh_=!1;try{let[f,h]=yield Promise.all([this.authTokenProvider_.getToken(d),this.appCheckTokenProvider_.getToken(d)]);a?Re("getToken() completed but was canceled"):(Re("getToken() completed. Creating connection."),this.authToken_=f&&f.accessToken,this.appCheckToken_=h&&h.token,l=new eg(o,this.repoInfo_,this.applicationId_,this.appCheckToken_,this.authToken_,t,r,i,p=>{je(p+" ("+this.repoInfo_.toString()+")"),this.interrupt(lP)},s))}catch(f){this.log_("Failed to get token: "+f),a||(this.repoInfo_.nodeAdmin&&je(f),c())}}})}interrupt(t){Re("Interrupting connection for reason: "+t),this.interruptReasons_[t]=!0,this.realtime_?this.realtime_.close():(this.establishConnectionTimer_&&(clearTimeout(this.establishConnectionTimer_),this.establishConnectionTimer_=null),this.connected_&&this.onRealtimeDisconnect_())}resume(t){Re("Resuming connection for reason: "+t),delete this.interruptReasons_[t],ia(this.interruptReasons_)&&(this.reconnectDelay_=ys,this.realtime_||this.scheduleConnect_(0))}handleTimestamp_(t){let r=t-new Date().getTime();this.onServerInfoUpdate_({serverTimeOffset:r})}cancelSentTransactions_(){for(let t=0;t<this.outstandingPuts_.length;t++){let r=this.outstandingPuts_[t];r&&"h"in r.request&&r.queued&&(r.onComplete&&r.onComplete("disconnect"),delete this.outstandingPuts_[t],this.outstandingPutCount_--)}this.outstandingPutCount_===0&&(this.outstandingPuts_=[])}onListenRevoked_(t,r){let i;r?i=r.map(s=>Yg(s)).join("$"):i="default";let o=this.removeListen_(t,i);o&&o.onComplete&&o.onComplete("permission_denied")}removeListen_(t,r){let i=new te(t).toString(),o;if(this.listens.has(i)){let s=this.listens.get(i);o=s.get(r),s.delete(r),s.size===0&&this.listens.delete(i)}else o=void 0;return o}onAuthRevoked_(t,r){Re("Auth token revoked: "+t+"/"+r),this.authToken_=null,this.forceTokenRefresh_=!0,this.realtime_.close(),(t==="invalid_token"||t==="permission_denied")&&(this.invalidAuthTokenCount_++,this.invalidAuthTokenCount_>=dE&&(this.reconnectDelay_=uE,this.authTokenProvider_.notifyForInvalidToken()))}onAppCheckRevoked_(t,r){Re("App check token revoked: "+t+"/"+r),this.appCheckToken_=null,this.forceTokenRefresh_=!0,(t==="invalid_token"||t==="permission_denied")&&(this.invalidAppCheckTokenCount_++,this.invalidAppCheckTokenCount_>=dE&&this.appCheckTokenProvider_.notifyForInvalidToken())}onSecurityDebugPacket_(t){this.securityDebugCallback_?this.securityDebugCallback_(t):"msg"in t&&console.log("FIREBASE: "+t.msg.replace(`
`,`
FIREBASE: `))}restoreState_(){this.tryAuth(),this.tryAppCheck();for(let t of this.listens.values())for(let r of t.values())this.sendListen_(r);for(let t=0;t<this.outstandingPuts_.length;t++)this.outstandingPuts_[t]&&this.sendPut_(t);for(;this.onDisconnectRequestQueue_.length;){let t=this.onDisconnectRequestQueue_.shift();this.sendOnDisconnect_(t.action,t.pathString,t.data,t.onComplete)}for(let t=0;t<this.outstandingGets_.length;t++)this.outstandingGets_[t]&&this.sendGet_(t)}sendConnectStats_(){let t={},r="js";Ht()&&(this.repoInfo_.nodeAdmin?r="admin_node":r="node"),t["sdk."+r+"."+Kg.replace(/\./g,"-")]=1,Bu()?t["framework.cordova"]=1:c_()&&(t["framework.reactnative"]=1),this.reportStats(t)}shouldReconnect_(){let t=Oc.getInstance().currentlyOnline();return ia(this.interruptReasons_)&&t}}n.nextPersistentConnectionId_=0,n.nextConnectionId_=0;return n})(),W=class n{constructor(e,t){this.name=e,this.node=t}static Wrap(e,t){return new n(e,t)}};var Wi=class{getCompare(){return this.compare.bind(this)}indexedValueChanged(e,t){let r=new W(Jn,e),i=new W(Jn,t);return this.compare(r,i)!==0}minPost(){return W.MIN}};var xc,Fc=class extends Wi{static get __EMPTY_NODE(){return xc}static set __EMPTY_NODE(e){xc=e}compare(e,t){return Br(e.name,t.name)}isDefinedOn(e){throw Gr("KeyIndex.isDefinedOn not expected to be called.")}indexedValueChanged(e,t){return!1}minPost(){return W.MIN}maxPost(){return new W(Mn,xc)}makePost(e,t){return y(typeof e=="string","KeyIndex indexValue must always be a string."),new W(e,xc)}toString(){return".key"}},an=new Fc;var $i=class{constructor(e,t,r,i,o=null){this.isReverse_=i,this.resultGenerator_=o,this.nodeStack_=[];let s=1;for(;!e.isEmpty();)if(e=e,s=t?r(e.key,t):1,i&&(s*=-1),s<0)this.isReverse_?e=e.left:e=e.right;else if(s===0){this.nodeStack_.push(e);break}else this.nodeStack_.push(e),this.isReverse_?e=e.right:e=e.left}getNext(){if(this.nodeStack_.length===0)return null;let e=this.nodeStack_.pop(),t;if(this.resultGenerator_?t=this.resultGenerator_(e.key,e.value):t={key:e.key,value:e.value},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(this.nodeStack_.length===0)return null;let e=this.nodeStack_[this.nodeStack_.length-1];return this.resultGenerator_?this.resultGenerator_(e.key,e.value):{key:e.key,value:e.value}}},Lt=(()=>{class n{constructor(t,r,i,o,s){this.key=t,this.value=r,this.color=i??n.RED,this.left=o??bt.EMPTY_NODE,this.right=s??bt.EMPTY_NODE}copy(t,r,i,o,s){return new n(t??this.key,r??this.value,i??this.color,o??this.left,s??this.right)}count(){return this.left.count()+1+this.right.count()}isEmpty(){return!1}inorderTraversal(t){return this.left.inorderTraversal(t)||!!t(this.key,this.value)||this.right.inorderTraversal(t)}reverseTraversal(t){return this.right.reverseTraversal(t)||t(this.key,this.value)||this.left.reverseTraversal(t)}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(t,r,i){let o=this,s=i(t,o.key);return s<0?o=o.copy(null,null,null,o.left.insert(t,r,i),null):s===0?o=o.copy(null,r,null,null,null):o=o.copy(null,null,null,null,o.right.insert(t,r,i)),o.fixUp_()}removeMin_(){if(this.left.isEmpty())return bt.EMPTY_NODE;let t=this;return!t.left.isRed_()&&!t.left.left.isRed_()&&(t=t.moveRedLeft_()),t=t.copy(null,null,null,t.left.removeMin_(),null),t.fixUp_()}remove(t,r){let i,o;if(i=this,r(t,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(t,r),null);else{if(i.left.isRed_()&&(i=i.rotateRight_()),!i.right.isEmpty()&&!i.right.isRed_()&&!i.right.left.isRed_()&&(i=i.moveRedRight_()),r(t,i.key)===0){if(i.right.isEmpty())return bt.EMPTY_NODE;o=i.right.min_(),i=i.copy(o.key,o.value,null,null,i.right.removeMin_())}i=i.copy(null,null,null,null,i.right.remove(t,r))}return i.fixUp_()}isRed_(){return this.color}fixUp_(){let t=this;return t.right.isRed_()&&!t.left.isRed_()&&(t=t.rotateLeft_()),t.left.isRed_()&&t.left.left.isRed_()&&(t=t.rotateRight_()),t.left.isRed_()&&t.right.isRed_()&&(t=t.colorFlip_()),t}moveRedLeft_(){let t=this.colorFlip_();return t.right.left.isRed_()&&(t=t.copy(null,null,null,null,t.right.rotateRight_()),t=t.rotateLeft_(),t=t.colorFlip_()),t}moveRedRight_(){let t=this.colorFlip_();return t.left.left.isRed_()&&(t=t.rotateRight_(),t=t.colorFlip_()),t}rotateLeft_(){let t=this.copy(null,null,n.RED,null,this.right.left);return this.right.copy(null,null,this.color,t,null)}rotateRight_(){let t=this.copy(null,null,n.RED,this.left.right,null);return this.left.copy(null,null,this.color,null,t)}colorFlip_(){let t=this.left.copy(null,null,!this.left.color,null,null),r=this.right.copy(null,null,!this.right.color,null,null);return this.copy(null,null,!this.color,t,r)}checkMaxDepth_(){let t=this.check_();return Math.pow(2,t)<=this.count()+1}check_(){if(this.isRed_()&&this.left.isRed_())throw new Error("Red node has red child("+this.key+","+this.value+")");if(this.right.isRed_())throw new Error("Right child of ("+this.key+","+this.value+") is red");let t=this.left.check_();if(t!==this.right.check_())throw new Error("Black depths differ");return t+(this.isRed_()?0:1)}}return n.RED=!0,n.BLACK=!1,n})(),rg=class{copy(e,t,r,i,o){return this}insert(e,t,r){return new Lt(e,t,null)}remove(e,t){return this}count(){return 0}isEmpty(){return!0}inorderTraversal(e){return!1}reverseTraversal(e){return!1}minKey(){return null}maxKey(){return null}check_(){return 0}isRed_(){return!1}},bt=class n{constructor(e,t=n.EMPTY_NODE){this.comparator_=e,this.root_=t}insert(e,t){return new n(this.comparator_,this.root_.insert(e,t,this.comparator_).copy(null,null,Lt.BLACK,null,null))}remove(e){return new n(this.comparator_,this.root_.remove(e,this.comparator_).copy(null,null,Lt.BLACK,null,null))}get(e){let t,r=this.root_;for(;!r.isEmpty();){if(t=this.comparator_(e,r.key),t===0)return r.value;t<0?r=r.left:t>0&&(r=r.right)}return null}getPredecessorKey(e){let t,r=this.root_,i=null;for(;!r.isEmpty();)if(t=this.comparator_(e,r.key),t===0){if(r.left.isEmpty())return i?i.key:null;for(r=r.left;!r.right.isEmpty();)r=r.right;return r.key}else t<0?r=r.left:t>0&&(i=r,r=r.right);throw new Error("Attempted to find predecessor key for a nonexistent key. What gives?")}isEmpty(){return this.root_.isEmpty()}count(){return this.root_.count()}minKey(){return this.root_.minKey()}maxKey(){return this.root_.maxKey()}inorderTraversal(e){return this.root_.inorderTraversal(e)}reverseTraversal(e){return this.root_.reverseTraversal(e)}getIterator(e){return new $i(this.root_,null,this.comparator_,!1,e)}getIteratorFrom(e,t){return new $i(this.root_,e,this.comparator_,!1,t)}getReverseIteratorFrom(e,t){return new $i(this.root_,e,this.comparator_,!0,t)}getReverseIterator(e){return new $i(this.root_,null,this.comparator_,!0,e)}};bt.EMPTY_NODE=new rg;function cP(n,e){return Br(n.name,e.name)}function tm(n,e){return Br(n,e)}var ig;function uP(n){ig=n}var JE=function(n){return typeof n=="number"?"number:"+PE(n):"string:"+n},eb=function(n){if(n.isLeafNode()){let e=n.val();y(typeof e=="string"||typeof e=="number"||typeof e=="object"&&dt(e,".sv"),"Priority must be a string or number.")}else y(n===ig||n.isEmpty(),"priority of unexpected type.");y(n===ig||n.getPriority().isEmpty(),"Priority nodes can't have a priority of their own.")};var fE,Gi=(()=>{class n{static set __childrenNodeConstructor(t){fE=t}static get __childrenNodeConstructor(){return fE}constructor(t,r=n.__childrenNodeConstructor.EMPTY_NODE){this.value_=t,this.priorityNode_=r,this.lazyHash_=null,y(this.value_!==void 0&&this.value_!==null,"LeafNode shouldn't be created with null/undefined value."),eb(this.priorityNode_)}isLeafNode(){return!0}getPriority(){return this.priorityNode_}updatePriority(t){return new n(this.value_,t)}getImmediateChild(t){return t===".priority"?this.priorityNode_:n.__childrenNodeConstructor.EMPTY_NODE}getChild(t){return B(t)?this:j(t)===".priority"?this.priorityNode_:n.__childrenNodeConstructor.EMPTY_NODE}hasChild(){return!1}getPredecessorChildName(t,r){return null}updateImmediateChild(t,r){return t===".priority"?this.updatePriority(r):r.isEmpty()&&t!==".priority"?this:n.__childrenNodeConstructor.EMPTY_NODE.updateImmediateChild(t,r).updatePriority(this.priorityNode_)}updateChild(t,r){let i=j(t);return i===null?r:r.isEmpty()&&i!==".priority"?this:(y(i!==".priority"||er(t)===1,".priority must be the last token in a path"),this.updateImmediateChild(i,n.__childrenNodeConstructor.EMPTY_NODE.updateChild(le(t),r)))}isEmpty(){return!1}numChildren(){return 0}forEachChild(t,r){return!1}val(t){return t&&!this.getPriority().isEmpty()?{".value":this.getValue(),".priority":this.getPriority().val()}:this.getValue()}hash(){if(this.lazyHash_===null){let t="";this.priorityNode_.isEmpty()||(t+="priority:"+JE(this.priorityNode_.val())+":");let r=typeof this.value_;t+=r+":",r==="number"?t+=PE(this.value_):t+=this.value_,this.lazyHash_=NE(t)}return this.lazyHash_}getValue(){return this.value_}compareTo(t){return t===n.__childrenNodeConstructor.EMPTY_NODE?1:t instanceof n.__childrenNodeConstructor?-1:(y(t.isLeafNode(),"Unknown node type"),this.compareToLeafNode_(t))}compareToLeafNode_(t){let r=typeof t.value_,i=typeof this.value_,o=n.VALUE_TYPE_ORDER.indexOf(r),s=n.VALUE_TYPE_ORDER.indexOf(i);return y(o>=0,"Unknown leaf type: "+r),y(s>=0,"Unknown leaf type: "+i),o===s?i==="object"?0:this.value_<t.value_?-1:this.value_===t.value_?0:1:s-o}withIndex(){return this}isIndexed(){return!0}equals(t){if(t===this)return!0;if(t.isLeafNode()){let r=t;return this.value_===r.value_&&this.priorityNode_.equals(r.priorityNode_)}else return!1}}n.VALUE_TYPE_ORDER=["object","boolean","number","string"];return n})(),tb,nb;function dP(n){tb=n}function fP(n){nb=n}var og=class extends Wi{compare(e,t){let r=e.node.getPriority(),i=t.node.getPriority(),o=r.compareTo(i);return o===0?Br(e.name,t.name):o}isDefinedOn(e){return!e.getPriority().isEmpty()}indexedValueChanged(e,t){return!e.getPriority().equals(t.getPriority())}minPost(){return W.MIN}maxPost(){return new W(Mn,new Gi("[PRIORITY-POST]",nb))}makePost(e,t){let r=tb(e);return new W(t,new Gi("[PRIORITY-POST]",r))}toString(){return".priority"}},ue=new og;var hP=Math.log(2),sg=class{constructor(e){let t=o=>parseInt(Math.log(o)/hP,10),r=o=>parseInt(Array(o+1).join("1"),2);this.count=t(e+1),this.current_=this.count-1;let i=r(this.count);this.bits_=e+1&i}nextBitIsOne(){let e=!(this.bits_&1<<this.current_);return this.current_--,e}},Lc=function(n,e,t,r){n.sort(e);let i=function(l,c){let u=c-l,d,f;if(u===0)return null;if(u===1)return d=n[l],f=t?t(d):d,new Lt(f,d.node,Lt.BLACK,null,null);{let h=parseInt(u/2,10)+l,p=i(l,h),g=i(h+1,c);return d=n[h],f=t?t(d):d,new Lt(f,d.node,Lt.BLACK,p,g)}},o=function(l){let c=null,u=null,d=n.length,f=function(p,g){let _=d-p,D=d;d-=p;let M=i(_+1,D),A=n[_],J=t?t(A):A;h(new Lt(J,A.node,g,null,M))},h=function(p){c?(c.left=p,c=p):(u=p,c=p)};for(let p=0;p<l.count;++p){let g=l.nextBitIsOne(),_=Math.pow(2,l.count-(p+1));g?f(_,Lt.BLACK):(f(_,Lt.BLACK),f(_,Lt.RED))}return u},s=new sg(n.length),a=o(s);return new bt(r||e,a)};var Bp,Hi={},qi=class n{static get Default(){return y(Hi&&ue,"ChildrenNode.ts has not been loaded"),Bp=Bp||new n({".priority":Hi},{".priority":ue}),Bp}constructor(e,t){this.indexes_=e,this.indexSet_=t}get(e){let t=Nn(this.indexes_,e);if(!t)throw new Error("No index defined for "+e);return t instanceof bt?t:null}hasIndex(e){return dt(this.indexSet_,e.toString())}addIndex(e,t){y(e!==an,"KeyIndex always exists and isn't meant to be added to the IndexMap.");let r=[],i=!1,o=t.getIterator(W.Wrap),s=o.getNext();for(;s;)i=i||e.isDefinedOn(s.node),r.push(s),s=o.getNext();let a;i?a=Lc(r,e.getCompare()):a=Hi;let l=e.toString(),c=Object.assign({},this.indexSet_);c[l]=e;let u=Object.assign({},this.indexes_);return u[l]=a,new n(u,c)}addToIndexes(e,t){let r=oo(this.indexes_,(i,o)=>{let s=Nn(this.indexSet_,o);if(y(s,"Missing index implementation for "+o),i===Hi)if(s.isDefinedOn(e.node)){let a=[],l=t.getIterator(W.Wrap),c=l.getNext();for(;c;)c.name!==e.name&&a.push(c),c=l.getNext();return a.push(e),Lc(a,s.getCompare())}else return Hi;else{let a=t.get(e.name),l=i;return a&&(l=l.remove(new W(e.name,a))),l.insert(e,e.node)}});return new n(r,this.indexSet_)}removeFromIndexes(e,t){let r=oo(this.indexes_,i=>{if(i===Hi)return i;{let o=t.get(e.name);return o?i.remove(new W(e.name,o)):i}});return new n(r,this.indexSet_)}};var vs,R=(()=>{class n{static get EMPTY_NODE(){return vs||(vs=new n(new bt(tm),null,qi.Default))}constructor(t,r,i){this.children_=t,this.priorityNode_=r,this.indexMap_=i,this.lazyHash_=null,this.priorityNode_&&eb(this.priorityNode_),this.children_.isEmpty()&&y(!this.priorityNode_||this.priorityNode_.isEmpty(),"An empty node cannot have a priority")}isLeafNode(){return!1}getPriority(){return this.priorityNode_||vs}updatePriority(t){return this.children_.isEmpty()?this:new n(this.children_,t,this.indexMap_)}getImmediateChild(t){if(t===".priority")return this.getPriority();{let r=this.children_.get(t);return r===null?vs:r}}getChild(t){let r=j(t);return r===null?this:this.getImmediateChild(r).getChild(le(t))}hasChild(t){return this.children_.get(t)!==null}updateImmediateChild(t,r){if(y(r,"We should always be passing snapshot nodes"),t===".priority")return this.updatePriority(r);{let i=new W(t,r),o,s;r.isEmpty()?(o=this.children_.remove(t),s=this.indexMap_.removeFromIndexes(i,this.children_)):(o=this.children_.insert(t,r),s=this.indexMap_.addToIndexes(i,this.children_));let a=o.isEmpty()?vs:this.priorityNode_;return new n(o,a,s)}}updateChild(t,r){let i=j(t);if(i===null)return r;{y(j(t)!==".priority"||er(t)===1,".priority must be the last token in a path");let o=this.getImmediateChild(i).updateChild(le(t),r);return this.updateImmediateChild(i,o)}}isEmpty(){return this.children_.isEmpty()}numChildren(){return this.children_.count()}val(t){if(this.isEmpty())return null;let r={},i=0,o=0,s=!0;if(this.forEachChild(ue,(a,l)=>{r[a]=l.val(t),i++,s&&n.INTEGER_REGEXP_.test(a)?o=Math.max(o,Number(a)):s=!1}),!t&&s&&o<2*i){let a=[];for(let l in r)a[l]=r[l];return a}else return t&&!this.getPriority().isEmpty()&&(r[".priority"]=this.getPriority().val()),r}hash(){if(this.lazyHash_===null){let t="";this.getPriority().isEmpty()||(t+="priority:"+JE(this.getPriority().val())+":"),this.forEachChild(ue,(r,i)=>{let o=i.hash();o!==""&&(t+=":"+r+":"+o)}),this.lazyHash_=t===""?"":NE(t)}return this.lazyHash_}getPredecessorChildName(t,r,i){let o=this.resolveIndex_(i);if(o){let s=o.getPredecessorKey(new W(t,r));return s?s.name:null}else return this.children_.getPredecessorKey(t)}getFirstChildName(t){let r=this.resolveIndex_(t);if(r){let i=r.minKey();return i&&i.name}else return this.children_.minKey()}getFirstChild(t){let r=this.getFirstChildName(t);return r?new W(r,this.children_.get(r)):null}getLastChildName(t){let r=this.resolveIndex_(t);if(r){let i=r.maxKey();return i&&i.name}else return this.children_.maxKey()}getLastChild(t){let r=this.getLastChildName(t);return r?new W(r,this.children_.get(r)):null}forEachChild(t,r){let i=this.resolveIndex_(t);return i?i.inorderTraversal(o=>r(o.name,o.node)):this.children_.inorderTraversal(r)}getIterator(t){return this.getIteratorFrom(t.minPost(),t)}getIteratorFrom(t,r){let i=this.resolveIndex_(r);if(i)return i.getIteratorFrom(t,o=>o);{let o=this.children_.getIteratorFrom(t.name,W.Wrap),s=o.peek();for(;s!=null&&r.compare(s,t)<0;)o.getNext(),s=o.peek();return o}}getReverseIterator(t){return this.getReverseIteratorFrom(t.maxPost(),t)}getReverseIteratorFrom(t,r){let i=this.resolveIndex_(r);if(i)return i.getReverseIteratorFrom(t,o=>o);{let o=this.children_.getReverseIteratorFrom(t.name,W.Wrap),s=o.peek();for(;s!=null&&r.compare(s,t)>0;)o.getNext(),s=o.peek();return o}}compareTo(t){return this.isEmpty()?t.isEmpty()?0:-1:t.isLeafNode()||t.isEmpty()?1:t===Us?-1:0}withIndex(t){if(t===an||this.indexMap_.hasIndex(t))return this;{let r=this.indexMap_.addIndex(t,this.children_);return new n(this.children_,this.priorityNode_,r)}}isIndexed(t){return t===an||this.indexMap_.hasIndex(t)}equals(t){if(t===this)return!0;if(t.isLeafNode())return!1;{let r=t;if(this.getPriority().equals(r.getPriority()))if(this.children_.count()===r.children_.count()){let i=this.getIterator(ue),o=r.getIterator(ue),s=i.getNext(),a=o.getNext();for(;s&&a;){if(s.name!==a.name||!s.node.equals(a.node))return!1;s=i.getNext(),a=o.getNext()}return s===null&&a===null}else return!1;else return!1}}resolveIndex_(t){return t===an?null:this.indexMap_.get(t.toString())}}return n.INTEGER_REGEXP_=/^(0|[1-9]\d*)$/,n})(),ag=class extends R{constructor(){super(new bt(tm),R.EMPTY_NODE,qi.Default)}compareTo(e){return e===this?0:1}equals(e){return e===this}getPriority(){return this}getImmediateChild(e){return R.EMPTY_NODE}isEmpty(){return!1}},Us=new ag;Object.defineProperties(W,{MIN:{value:new W(Jn,R.EMPTY_NODE)},MAX:{value:new W(Mn,Us)}});Fc.__EMPTY_NODE=R.EMPTY_NODE;Gi.__childrenNodeConstructor=R;uP(Us);fP(Us);var pP=!0;function me(n,e=null){if(n===null)return R.EMPTY_NODE;if(typeof n=="object"&&".priority"in n&&(e=n[".priority"]),y(e===null||typeof e=="string"||typeof e=="number"||typeof e=="object"&&".sv"in e,"Invalid priority type found: "+typeof e),typeof n=="object"&&".value"in n&&n[".value"]!==null&&(n=n[".value"]),typeof n!="object"||".sv"in n){let t=n;return new Gi(t,me(e))}if(!(n instanceof Array)&&pP){let t=[],r=!1;if(ke(n,(s,a)=>{if(s.substring(0,1)!=="."){let l=me(a);l.isEmpty()||(r=r||!l.getPriority().isEmpty(),t.push(new W(s,l)))}}),t.length===0)return R.EMPTY_NODE;let o=Lc(t,cP,s=>s.name,tm);if(r){let s=Lc(t,ue.getCompare());return new R(o,me(e),new qi({".priority":s},{".priority":ue}))}else return new R(o,me(e),qi.Default)}else{let t=R.EMPTY_NODE;return ke(n,(r,i)=>{if(dt(n,r)&&r.substring(0,1)!=="."){let o=me(i);(o.isLeafNode()||!o.isEmpty())&&(t=t.updateImmediateChild(r,o))}}),t.updatePriority(me(e))}}dP(me);var Ms=class extends Wi{constructor(e){super(),this.indexPath_=e,y(!B(e)&&j(e)!==".priority","Can't create PathIndex with empty path or .priority key")}extractChild(e){return e.getChild(this.indexPath_)}isDefinedOn(e){return!e.getChild(this.indexPath_).isEmpty()}compare(e,t){let r=this.extractChild(e.node),i=this.extractChild(t.node),o=r.compareTo(i);return o===0?Br(e.name,t.name):o}makePost(e,t){let r=me(e),i=R.EMPTY_NODE.updateChild(this.indexPath_,r);return new W(t,i)}maxPost(){let e=R.EMPTY_NODE.updateChild(this.indexPath_,Us);return new W(Mn,e)}toString(){return Ts(this.indexPath_,0).join("/")}};var lg=class extends Wi{compare(e,t){let r=e.node.compareTo(t.node);return r===0?Br(e.name,t.name):r}isDefinedOn(e){return!0}indexedValueChanged(e,t){return!e.equals(t)}minPost(){return W.MIN}maxPost(){return W.MAX}makePost(e,t){let r=me(e);return new W(t,r)}toString(){return".value"}},nm=new lg;function rb(n){return{type:"value",snapshotNode:n}}function Ki(n,e){return{type:"child_added",snapshotNode:e,childName:n}}function xs(n,e){return{type:"child_removed",snapshotNode:e,childName:n}}function As(n,e,t){return{type:"child_changed",snapshotNode:e,childName:n,oldSnap:t}}function gP(n,e){return{type:"child_moved",snapshotNode:e,childName:n}}var Ns=class{constructor(e){this.index_=e}updateChild(e,t,r,i,o,s){y(e.isIndexed(this.index_),"A node must be indexed if only a child is updated");let a=e.getImmediateChild(t);return a.getChild(i).equals(r.getChild(i))&&a.isEmpty()===r.isEmpty()||(s!=null&&(r.isEmpty()?e.hasChild(t)?s.trackChildChange(xs(t,a)):y(e.isLeafNode(),"A child remove without an old child only makes sense on a leaf node"):a.isEmpty()?s.trackChildChange(Ki(t,r)):s.trackChildChange(As(t,r,a))),e.isLeafNode()&&r.isEmpty())?e:e.updateImmediateChild(t,r).withIndex(this.index_)}updateFullNode(e,t,r){return r!=null&&(e.isLeafNode()||e.forEachChild(ue,(i,o)=>{t.hasChild(i)||r.trackChildChange(xs(i,o))}),t.isLeafNode()||t.forEachChild(ue,(i,o)=>{if(e.hasChild(i)){let s=e.getImmediateChild(i);s.equals(o)||r.trackChildChange(As(i,o,s))}else r.trackChildChange(Ki(i,o))})),t.withIndex(this.index_)}updatePriority(e,t){return e.isEmpty()?R.EMPTY_NODE:e.updatePriority(t)}filtersNodes(){return!1}getIndexedFilter(){return this}getIndex(){return this.index_}};var Vc=class n{constructor(e){this.indexedFilter_=new Ns(e.getIndex()),this.index_=e.getIndex(),this.startPost_=n.getStartPost_(e),this.endPost_=n.getEndPost_(e),this.startIsInclusive_=!e.startAfterSet_,this.endIsInclusive_=!e.endBeforeSet_}getStartPost(){return this.startPost_}getEndPost(){return this.endPost_}matches(e){let t=this.startIsInclusive_?this.index_.compare(this.getStartPost(),e)<=0:this.index_.compare(this.getStartPost(),e)<0,r=this.endIsInclusive_?this.index_.compare(e,this.getEndPost())<=0:this.index_.compare(e,this.getEndPost())<0;return t&&r}updateChild(e,t,r,i,o,s){return this.matches(new W(t,r))||(r=R.EMPTY_NODE),this.indexedFilter_.updateChild(e,t,r,i,o,s)}updateFullNode(e,t,r){t.isLeafNode()&&(t=R.EMPTY_NODE);let i=t.withIndex(this.index_);i=i.updatePriority(R.EMPTY_NODE);let o=this;return t.forEachChild(ue,(s,a)=>{o.matches(new W(s,a))||(i=i.updateImmediateChild(s,R.EMPTY_NODE))}),this.indexedFilter_.updateFullNode(e,i,r)}updatePriority(e,t){return e}filtersNodes(){return!0}getIndexedFilter(){return this.indexedFilter_}getIndex(){return this.index_}static getStartPost_(e){if(e.hasStart()){let t=e.getIndexStartName();return e.getIndex().makePost(e.getIndexStartValue(),t)}else return e.getIndex().minPost()}static getEndPost_(e){if(e.hasEnd()){let t=e.getIndexEndName();return e.getIndex().makePost(e.getIndexEndValue(),t)}else return e.getIndex().maxPost()}};var cg=class{constructor(e){this.withinDirectionalStart=t=>this.reverse_?this.withinEndPost(t):this.withinStartPost(t),this.withinDirectionalEnd=t=>this.reverse_?this.withinStartPost(t):this.withinEndPost(t),this.withinStartPost=t=>{let r=this.index_.compare(this.rangedFilter_.getStartPost(),t);return this.startIsInclusive_?r<=0:r<0},this.withinEndPost=t=>{let r=this.index_.compare(t,this.rangedFilter_.getEndPost());return this.endIsInclusive_?r<=0:r<0},this.rangedFilter_=new Vc(e),this.index_=e.getIndex(),this.limit_=e.getLimit(),this.reverse_=!e.isViewFromLeft(),this.startIsInclusive_=!e.startAfterSet_,this.endIsInclusive_=!e.endBeforeSet_}updateChild(e,t,r,i,o,s){return this.rangedFilter_.matches(new W(t,r))||(r=R.EMPTY_NODE),e.getImmediateChild(t).equals(r)?e:e.numChildren()<this.limit_?this.rangedFilter_.getIndexedFilter().updateChild(e,t,r,i,o,s):this.fullLimitUpdateChild_(e,t,r,o,s)}updateFullNode(e,t,r){let i;if(t.isLeafNode()||t.isEmpty())i=R.EMPTY_NODE.withIndex(this.index_);else if(this.limit_*2<t.numChildren()&&t.isIndexed(this.index_)){i=R.EMPTY_NODE.withIndex(this.index_);let o;this.reverse_?o=t.getReverseIteratorFrom(this.rangedFilter_.getEndPost(),this.index_):o=t.getIteratorFrom(this.rangedFilter_.getStartPost(),this.index_);let s=0;for(;o.hasNext()&&s<this.limit_;){let a=o.getNext();if(this.withinDirectionalStart(a))if(this.withinDirectionalEnd(a))i=i.updateImmediateChild(a.name,a.node),s++;else break;else continue}}else{i=t.withIndex(this.index_),i=i.updatePriority(R.EMPTY_NODE);let o;this.reverse_?o=i.getReverseIterator(this.index_):o=i.getIterator(this.index_);let s=0;for(;o.hasNext();){let a=o.getNext();s<this.limit_&&this.withinDirectionalStart(a)&&this.withinDirectionalEnd(a)?s++:i=i.updateImmediateChild(a.name,R.EMPTY_NODE)}}return this.rangedFilter_.getIndexedFilter().updateFullNode(e,i,r)}updatePriority(e,t){return e}filtersNodes(){return!0}getIndexedFilter(){return this.rangedFilter_.getIndexedFilter()}getIndex(){return this.index_}fullLimitUpdateChild_(e,t,r,i,o){let s;if(this.reverse_){let d=this.index_.getCompare();s=(f,h)=>d(h,f)}else s=this.index_.getCompare();let a=e;y(a.numChildren()===this.limit_,"");let l=new W(t,r),c=this.reverse_?a.getFirstChild(this.index_):a.getLastChild(this.index_),u=this.rangedFilter_.matches(l);if(a.hasChild(t)){let d=a.getImmediateChild(t),f=i.getChildAfterChild(this.index_,c,this.reverse_);for(;f!=null&&(f.name===t||a.hasChild(f.name));)f=i.getChildAfterChild(this.index_,f,this.reverse_);let h=f==null?1:s(f,l);if(u&&!r.isEmpty()&&h>=0)return o?.trackChildChange(As(t,r,d)),a.updateImmediateChild(t,r);{o?.trackChildChange(xs(t,d));let g=a.updateImmediateChild(t,R.EMPTY_NODE);return f!=null&&this.rangedFilter_.matches(f)?(o?.trackChildChange(Ki(f.name,f.node)),g.updateImmediateChild(f.name,f.node)):g}}else return r.isEmpty()?e:u&&s(c,l)>=0?(o!=null&&(o.trackChildChange(xs(c.name,c.node)),o.trackChildChange(Ki(t,r))),a.updateImmediateChild(t,r).updateImmediateChild(c.name,R.EMPTY_NODE)):e}};var Rs=class n{constructor(){this.limitSet_=!1,this.startSet_=!1,this.startNameSet_=!1,this.startAfterSet_=!1,this.endSet_=!1,this.endNameSet_=!1,this.endBeforeSet_=!1,this.limit_=0,this.viewFrom_="",this.indexStartValue_=null,this.indexStartName_="",this.indexEndValue_=null,this.indexEndName_="",this.index_=ue}hasStart(){return this.startSet_}isViewFromLeft(){return this.viewFrom_===""?this.startSet_:this.viewFrom_==="l"}getIndexStartValue(){return y(this.startSet_,"Only valid if start has been set"),this.indexStartValue_}getIndexStartName(){return y(this.startSet_,"Only valid if start has been set"),this.startNameSet_?this.indexStartName_:Jn}hasEnd(){return this.endSet_}getIndexEndValue(){return y(this.endSet_,"Only valid if end has been set"),this.indexEndValue_}getIndexEndName(){return y(this.endSet_,"Only valid if end has been set"),this.endNameSet_?this.indexEndName_:Mn}hasLimit(){return this.limitSet_}hasAnchoredLimit(){return this.limitSet_&&this.viewFrom_!==""}getLimit(){return y(this.limitSet_,"Only valid if limit has been set"),this.limit_}getIndex(){return this.index_}loadsAllData(){return!(this.startSet_||this.endSet_||this.limitSet_)}isDefault(){return this.loadsAllData()&&this.index_===ue}copy(){let e=new n;return e.limitSet_=this.limitSet_,e.limit_=this.limit_,e.startSet_=this.startSet_,e.startAfterSet_=this.startAfterSet_,e.indexStartValue_=this.indexStartValue_,e.startNameSet_=this.startNameSet_,e.indexStartName_=this.indexStartName_,e.endSet_=this.endSet_,e.endBeforeSet_=this.endBeforeSet_,e.indexEndValue_=this.indexEndValue_,e.endNameSet_=this.endNameSet_,e.indexEndName_=this.indexEndName_,e.index_=this.index_,e.viewFrom_=this.viewFrom_,e}};function mP(n){return n.loadsAllData()?new Ns(n.getIndex()):n.hasLimit()?new cg(n):new Vc(n)}function _P(n,e){let t=n.copy();return t.limitSet_=!0,t.limit_=e,t.viewFrom_="l",t}function yP(n,e){let t=n.copy();return t.limitSet_=!0,t.limit_=e,t.viewFrom_="r",t}function ug(n,e,t){let r=n.copy();return r.startSet_=!0,e===void 0&&(e=null),r.indexStartValue_=e,t!=null?(r.startNameSet_=!0,r.indexStartName_=t):(r.startNameSet_=!1,r.indexStartName_=""),r}function vP(n,e,t){let r;return n.index_===an||t?r=ug(n,e,t):r=ug(n,e,Mn),r.startAfterSet_=!0,r}function dg(n,e,t){let r=n.copy();return r.endSet_=!0,e===void 0&&(e=null),r.indexEndValue_=e,t!==void 0?(r.endNameSet_=!0,r.indexEndName_=t):(r.endNameSet_=!1,r.indexEndName_=""),r}function DP(n,e,t){let r;return n.index_===an||t?r=dg(n,e,t):r=dg(n,e,Jn),r.endBeforeSet_=!0,r}function ru(n,e){let t=n.copy();return t.index_=e,t}function hE(n){let e={};if(n.isDefault())return e;let t;if(n.index_===ue?t="$priority":n.index_===nm?t="$value":n.index_===an?t="$key":(y(n.index_ instanceof Ms,"Unrecognized index type!"),t=n.index_.toString()),e.orderBy=De(t),n.startSet_){let r=n.startAfterSet_?"startAfter":"startAt";e[r]=De(n.indexStartValue_),n.startNameSet_&&(e[r]+=","+De(n.indexStartName_))}if(n.endSet_){let r=n.endBeforeSet_?"endBefore":"endAt";e[r]=De(n.indexEndValue_),n.endNameSet_&&(e[r]+=","+De(n.indexEndName_))}return n.limitSet_&&(n.isViewFromLeft()?e.limitToFirst=n.limit_:e.limitToLast=n.limit_),e}function pE(n){let e={};if(n.startSet_&&(e.sp=n.indexStartValue_,n.startNameSet_&&(e.sn=n.indexStartName_),e.sin=!n.startAfterSet_),n.endSet_&&(e.ep=n.indexEndValue_,n.endNameSet_&&(e.en=n.indexEndName_),e.ein=!n.endBeforeSet_),n.limitSet_){e.l=n.limit_;let t=n.viewFrom_;t===""&&(n.isViewFromLeft()?t="l":t="r"),e.vf=t}return n.index_!==ue&&(e.i=n.index_.toString()),e}var fg=class n extends kc{reportStats(e){throw new Error("Method not implemented.")}static getListenId_(e,t){return t!==void 0?"tag$"+t:(y(e._queryParams.isDefault(),"should have a tag if it's not a default query."),e._path.toString())}constructor(e,t,r,i){super(),this.repoInfo_=e,this.onDataUpdate_=t,this.authTokenProvider_=r,this.appCheckTokenProvider_=i,this.log_=Hs("p:rest:"),this.listens_={}}listen(e,t,r,i){let o=e._path.toString();this.log_("Listen called for "+o+" "+e._queryIdentifier);let s=n.getListenId_(e,r),a={};this.listens_[s]=a;let l=hE(e._queryParams);this.restRequest_(o+".json",l,(c,u)=>{let d=u;if(c===404&&(d=null,c=null),c===null&&this.onDataUpdate_(o,d,!1,r),Nn(this.listens_,s)===a){let f;c?c===401?f="permission_denied":f="rest_error:"+c:f="ok",i(f,null)}})}unlisten(e,t){let r=n.getListenId_(e,t);delete this.listens_[r]}get(e){let t=hE(e._queryParams),r=e._path.toString(),i=new ve;return this.restRequest_(r+".json",t,(o,s)=>{let a=s;o===404&&(a=null,o=null),o===null?(this.onDataUpdate_(r,a,!1,null),i.resolve(a)):i.reject(new Error(a))}),i.promise}refreshAuthToken(e){}restRequest_(e,t={},r){return t.format="export",Promise.all([this.authTokenProvider_.getToken(!1),this.appCheckTokenProvider_.getToken(!1)]).then(([i,o])=>{i&&i.accessToken&&(t.auth=i.accessToken),o&&o.token&&(t.ac=o.token);let s=(this.repoInfo_.secure?"https://":"http://")+this.repoInfo_.host+e+"?ns="+this.repoInfo_.namespace+p_(t);this.log_("Sending REST request for "+s);let a=new XMLHttpRequest;a.onreadystatechange=()=>{if(r&&a.readyState===4){this.log_("REST Response for "+s+" received. status:",a.status,"response:",a.responseText);let l=null;if(a.status>=200&&a.status<300){try{l=ra(a.responseText)}catch{je("Failed to parse JSON response for "+s+": "+a.responseText)}r(null,l)}else a.status!==401&&a.status!==404&&je("Got unsuccessful REST response for "+s+" Status: "+a.status),r(a.status);r=null}},a.open("GET",s,!0),a.send()})}};var hg=class{constructor(){this.rootNode_=R.EMPTY_NODE}getNode(e){return this.rootNode_.getChild(e)}updateSnapshot(e,t){this.rootNode_=this.rootNode_.updateChild(e,t)}};function jc(){return{value:null,children:new Map}}function eo(n,e,t){if(B(e))n.value=t,n.children.clear();else if(n.value!==null)n.value=n.value.updateChild(e,t);else{let r=j(e);n.children.has(r)||n.children.set(r,jc());let i=n.children.get(r);e=le(e),eo(i,e,t)}}function pg(n,e){if(B(e))return n.value=null,n.children.clear(),!0;if(n.value!==null){if(n.value.isLeafNode())return!1;{let t=n.value;return n.value=null,t.forEachChild(ue,(r,i)=>{eo(n,new te(r),i)}),pg(n,e)}}else if(n.children.size>0){let t=j(e);return e=le(e),n.children.has(t)&&pg(n.children.get(t),e)&&n.children.delete(t),n.children.size===0}else return!0}function gg(n,e,t){n.value!==null?t(e,n.value):wP(n,(r,i)=>{let o=new te(e.toString()+"/"+r);gg(i,o,t)})}function wP(n,e){n.children.forEach((t,r)=>{e(r,t)})}var mg=class{constructor(e){this.collection_=e,this.last_=null}get(){let e=this.collection_.get(),t=Object.assign({},e);return this.last_&&ke(this.last_,(r,i)=>{t[r]=t[r]-i}),this.last_=e,t}};var gE=10*1e3,CP=30*1e3,EP=5*60*1e3,_g=class{constructor(e,t){this.server_=t,this.statsToReport_={},this.statsListener_=new mg(e);let r=gE+(CP-gE)*Math.random();ws(this.reportStats_.bind(this),Math.floor(r))}reportStats_(){let e=this.statsListener_.get(),t={},r=!1;ke(e,(i,o)=>{o>0&&dt(this.statsToReport_,i)&&(t[i]=o,r=!0)}),r&&this.server_.reportStats(t),ws(this.reportStats_.bind(this),Math.floor(Math.random()*2*EP))}};var sn=function(n){return n[n.OVERWRITE=0]="OVERWRITE",n[n.MERGE=1]="MERGE",n[n.ACK_USER_WRITE=2]="ACK_USER_WRITE",n[n.LISTEN_COMPLETE=3]="LISTEN_COMPLETE",n}(sn||{});function rm(){return{fromUser:!0,fromServer:!1,queryId:null,tagged:!1}}function im(){return{fromUser:!1,fromServer:!0,queryId:null,tagged:!1}}function om(n){return{fromUser:!1,fromServer:!0,queryId:n,tagged:!0}}var yg=class n{constructor(e,t,r){this.path=e,this.affectedTree=t,this.revert=r,this.type=sn.ACK_USER_WRITE,this.source=rm()}operationForChild(e){if(B(this.path)){if(this.affectedTree.value!=null)return y(this.affectedTree.children.isEmpty(),"affectedTree should not have overlapping affected paths."),this;{let t=this.affectedTree.subtree(new te(e));return new n(ee(),t,this.revert)}}else return y(j(this.path)===e,"operationForChild called for unrelated child."),new n(le(this.path),this.affectedTree,this.revert)}};var Bc=class n{constructor(e,t){this.source=e,this.path=t,this.type=sn.LISTEN_COMPLETE}operationForChild(e){return B(this.path)?new n(this.source,ee()):new n(this.source,le(this.path))}};var Qi=class n{constructor(e,t,r){this.source=e,this.path=t,this.snap=r,this.type=sn.OVERWRITE}operationForChild(e){return B(this.path)?new n(this.source,ee(),this.snap.getImmediateChild(e)):new n(this.source,le(this.path),this.snap)}};var ks=class n{constructor(e,t,r){this.source=e,this.path=t,this.children=r,this.type=sn.MERGE}operationForChild(e){if(B(this.path)){let t=this.children.subtree(new te(e));return t.isEmpty()?null:t.value?new Qi(this.source,ee(),t.value):new n(this.source,ee(),t)}else return y(j(this.path)===e,"Can't get a merge for a child not on the path of the operation"),new n(this.source,le(this.path),this.children)}toString(){return"Operation("+this.path+": "+this.source.toString()+" merge: "+this.children.toString()+")"}};var cn=class{constructor(e,t,r){this.node_=e,this.fullyInitialized_=t,this.filtered_=r}isFullyInitialized(){return this.fullyInitialized_}isFiltered(){return this.filtered_}isCompleteForPath(e){if(B(e))return this.isFullyInitialized()&&!this.filtered_;let t=j(e);return this.isCompleteForChild(t)}isCompleteForChild(e){return this.isFullyInitialized()&&!this.filtered_||this.node_.hasChild(e)}getNode(){return this.node_}};var vg=class{constructor(e){this.query_=e,this.index_=this.query_._queryParams.getIndex()}};function bP(n,e,t,r){let i=[],o=[];return e.forEach(s=>{s.type==="child_changed"&&n.index_.indexedValueChanged(s.oldSnap,s.snapshotNode)&&o.push(gP(s.childName,s.snapshotNode))}),Ds(n,i,"child_removed",e,r,t),Ds(n,i,"child_added",e,r,t),Ds(n,i,"child_moved",o,r,t),Ds(n,i,"child_changed",e,r,t),Ds(n,i,"value",e,r,t),i}function Ds(n,e,t,r,i,o){let s=r.filter(a=>a.type===t);s.sort((a,l)=>SP(n,a,l)),s.forEach(a=>{let l=IP(n,a,o);i.forEach(c=>{c.respondsTo(a.type)&&e.push(c.createEvent(l,n.query_))})})}function IP(n,e,t){return e.type==="value"||e.type==="child_removed"||(e.prevName=t.getPredecessorChildName(e.childName,e.snapshotNode,n.index_)),e}function SP(n,e,t){if(e.childName==null||t.childName==null)throw Gr("Should only compare child_ events.");let r=new W(e.childName,e.snapshotNode),i=new W(t.childName,t.snapshotNode);return n.index_.compare(r,i)}function iu(n,e){return{eventCache:n,serverCache:e}}function Es(n,e,t,r){return iu(new cn(e,t,r),n.serverCache)}function ib(n,e,t,r){return iu(n.eventCache,new cn(e,t,r))}function Hc(n){return n.eventCache.isFullyInitialized()?n.eventCache.getNode():null}function jr(n){return n.serverCache.isFullyInitialized()?n.serverCache.getNode():null}var Hp,TP=()=>(Hp||(Hp=new bt(Ik)),Hp),qe=class n{static fromObject(e){let t=new n(null);return ke(e,(r,i)=>{t=t.set(new te(r),i)}),t}constructor(e,t=TP()){this.value=e,this.children=t}isEmpty(){return this.value===null&&this.children.isEmpty()}findRootMostMatchingPathAndValue(e,t){if(this.value!=null&&t(this.value))return{path:ee(),value:this.value};if(B(e))return null;{let r=j(e),i=this.children.get(r);if(i!==null){let o=i.findRootMostMatchingPathAndValue(le(e),t);return o!=null?{path:pe(new te(r),o.path),value:o.value}:null}else return null}}findRootMostValueAndPath(e){return this.findRootMostMatchingPathAndValue(e,()=>!0)}subtree(e){if(B(e))return this;{let t=j(e),r=this.children.get(t);return r!==null?r.subtree(le(e)):new n(null)}}set(e,t){if(B(e))return new n(t,this.children);{let r=j(e),o=(this.children.get(r)||new n(null)).set(le(e),t),s=this.children.insert(r,o);return new n(this.value,s)}}remove(e){if(B(e))return this.children.isEmpty()?new n(null):new n(null,this.children);{let t=j(e),r=this.children.get(t);if(r){let i=r.remove(le(e)),o;return i.isEmpty()?o=this.children.remove(t):o=this.children.insert(t,i),this.value===null&&o.isEmpty()?new n(null):new n(this.value,o)}else return this}}get(e){if(B(e))return this.value;{let t=j(e),r=this.children.get(t);return r?r.get(le(e)):null}}setTree(e,t){if(B(e))return t;{let r=j(e),o=(this.children.get(r)||new n(null)).setTree(le(e),t),s;return o.isEmpty()?s=this.children.remove(r):s=this.children.insert(r,o),new n(this.value,s)}}fold(e){return this.fold_(ee(),e)}fold_(e,t){let r={};return this.children.inorderTraversal((i,o)=>{r[i]=o.fold_(pe(e,i),t)}),t(e,this.value,r)}findOnPath(e,t){return this.findOnPath_(e,ee(),t)}findOnPath_(e,t,r){let i=this.value?r(t,this.value):!1;if(i)return i;if(B(e))return null;{let o=j(e),s=this.children.get(o);return s?s.findOnPath_(le(e),pe(t,o),r):null}}foreachOnPath(e,t){return this.foreachOnPath_(e,ee(),t)}foreachOnPath_(e,t,r){if(B(e))return this;{this.value&&r(t,this.value);let i=j(e),o=this.children.get(i);return o?o.foreachOnPath_(le(e),pe(t,i),r):new n(null)}}foreach(e){this.foreach_(ee(),e)}foreach_(e,t){this.children.inorderTraversal((r,i)=>{i.foreach_(pe(e,r),t)}),this.value&&t(e,this.value)}foreachChild(e){this.children.inorderTraversal((t,r)=>{r.value&&e(t,r.value)})}};var Vt=class n{constructor(e){this.writeTree_=e}static empty(){return new n(new qe(null))}};function bs(n,e,t){if(B(e))return new Vt(new qe(t));{let r=n.writeTree_.findRootMostValueAndPath(e);if(r!=null){let i=r.path,o=r.value,s=Ge(i,e);return o=o.updateChild(s,t),new Vt(n.writeTree_.set(i,o))}else{let i=new qe(t),o=n.writeTree_.setTree(e,i);return new Vt(o)}}}function Dg(n,e,t){let r=n;return ke(t,(i,o)=>{r=bs(r,pe(e,i),o)}),r}function mE(n,e){if(B(e))return Vt.empty();{let t=n.writeTree_.setTree(e,new qe(null));return new Vt(t)}}function wg(n,e){return Hr(n,e)!=null}function Hr(n,e){let t=n.writeTree_.findRootMostValueAndPath(e);return t!=null?n.writeTree_.get(t.path).getChild(Ge(t.path,e)):null}function _E(n){let e=[],t=n.writeTree_.value;return t!=null?t.isLeafNode()||t.forEachChild(ue,(r,i)=>{e.push(new W(r,i))}):n.writeTree_.children.inorderTraversal((r,i)=>{i.value!=null&&e.push(new W(r,i.value))}),e}function Zn(n,e){if(B(e))return n;{let t=Hr(n,e);return t!=null?new Vt(new qe(t)):new Vt(n.writeTree_.subtree(e))}}function Cg(n){return n.writeTree_.isEmpty()}function Yi(n,e){return ob(ee(),n.writeTree_,e)}function ob(n,e,t){if(e.value!=null)return t.updateChild(n,e.value);{let r=null;return e.children.inorderTraversal((i,o)=>{i===".priority"?(y(o.value!==null,"Priority writes must always be leaf nodes"),r=o.value):t=ob(pe(n,i),o,t)}),!t.getChild(n).isEmpty()&&r!==null&&(t=t.updateChild(pe(n,".priority"),r)),t}}function ou(n,e){return cb(e,n)}function MP(n,e,t,r,i){y(r>n.lastWriteId,"Stacking an older write on top of newer ones"),i===void 0&&(i=!0),n.allWrites.push({path:e,snap:t,writeId:r,visible:i}),i&&(n.visibleWrites=bs(n.visibleWrites,e,t)),n.lastWriteId=r}function xP(n,e,t,r){y(r>n.lastWriteId,"Stacking an older merge on top of newer ones"),n.allWrites.push({path:e,children:t,writeId:r,visible:!0}),n.visibleWrites=Dg(n.visibleWrites,e,t),n.lastWriteId=r}function AP(n,e){for(let t=0;t<n.allWrites.length;t++){let r=n.allWrites[t];if(r.writeId===e)return r}return null}function NP(n,e){let t=n.allWrites.findIndex(a=>a.writeId===e);y(t>=0,"removeWrite called with nonexistent writeId.");let r=n.allWrites[t];n.allWrites.splice(t,1);let i=r.visible,o=!1,s=n.allWrites.length-1;for(;i&&s>=0;){let a=n.allWrites[s];a.visible&&(s>=t&&RP(a,r.path)?i=!1:Et(r.path,a.path)&&(o=!0)),s--}if(i){if(o)return kP(n),!0;if(r.snap)n.visibleWrites=mE(n.visibleWrites,r.path);else{let a=r.children;ke(a,l=>{n.visibleWrites=mE(n.visibleWrites,pe(r.path,l))})}return!0}else return!1}function RP(n,e){if(n.snap)return Et(n.path,e);for(let t in n.children)if(n.children.hasOwnProperty(t)&&Et(pe(n.path,t),e))return!0;return!1}function kP(n){n.visibleWrites=sb(n.allWrites,PP,ee()),n.allWrites.length>0?n.lastWriteId=n.allWrites[n.allWrites.length-1].writeId:n.lastWriteId=-1}function PP(n){return n.visible}function sb(n,e,t){let r=Vt.empty();for(let i=0;i<n.length;++i){let o=n[i];if(e(o)){let s=o.path,a;if(o.snap)Et(t,s)?(a=Ge(t,s),r=bs(r,a,o.snap)):Et(s,t)&&(a=Ge(s,t),r=bs(r,ee(),o.snap.getChild(a)));else if(o.children){if(Et(t,s))a=Ge(t,s),r=Dg(r,a,o.children);else if(Et(s,t))if(a=Ge(s,t),B(a))r=Dg(r,ee(),o.children);else{let l=Nn(o.children,j(a));if(l){let c=l.getChild(le(a));r=bs(r,ee(),c)}}}else throw Gr("WriteRecord should have .snap or .children")}}return r}function ab(n,e,t,r,i){if(!r&&!i){let o=Hr(n.visibleWrites,e);if(o!=null)return o;{let s=Zn(n.visibleWrites,e);if(Cg(s))return t;if(t==null&&!wg(s,ee()))return null;{let a=t||R.EMPTY_NODE;return Yi(s,a)}}}else{let o=Zn(n.visibleWrites,e);if(!i&&Cg(o))return t;if(!i&&t==null&&!wg(o,ee()))return null;{let s=function(c){return(c.visible||i)&&(!r||!~r.indexOf(c.writeId))&&(Et(c.path,e)||Et(e,c.path))},a=sb(n.allWrites,s,e),l=t||R.EMPTY_NODE;return Yi(a,l)}}}function OP(n,e,t){let r=R.EMPTY_NODE,i=Hr(n.visibleWrites,e);if(i)return i.isLeafNode()||i.forEachChild(ue,(o,s)=>{r=r.updateImmediateChild(o,s)}),r;if(t){let o=Zn(n.visibleWrites,e);return t.forEachChild(ue,(s,a)=>{let l=Yi(Zn(o,new te(s)),a);r=r.updateImmediateChild(s,l)}),_E(o).forEach(s=>{r=r.updateImmediateChild(s.name,s.node)}),r}else{let o=Zn(n.visibleWrites,e);return _E(o).forEach(s=>{r=r.updateImmediateChild(s.name,s.node)}),r}}function FP(n,e,t,r,i){y(r||i,"Either existingEventSnap or existingServerSnap must exist");let o=pe(e,t);if(wg(n.visibleWrites,o))return null;{let s=Zn(n.visibleWrites,o);return Cg(s)?i.getChild(t):Yi(s,i.getChild(t))}}function LP(n,e,t,r){let i=pe(e,t),o=Hr(n.visibleWrites,i);if(o!=null)return o;if(r.isCompleteForChild(t)){let s=Zn(n.visibleWrites,i);return Yi(s,r.getNode().getImmediateChild(t))}else return null}function VP(n,e){return Hr(n.visibleWrites,e)}function jP(n,e,t,r,i,o,s){let a,l=Zn(n.visibleWrites,e),c=Hr(l,ee());if(c!=null)a=c;else if(t!=null)a=Yi(l,t);else return[];if(a=a.withIndex(s),!a.isEmpty()&&!a.isLeafNode()){let u=[],d=s.getCompare(),f=o?a.getReverseIteratorFrom(r,s):a.getIteratorFrom(r,s),h=f.getNext();for(;h&&u.length<i;)d(h,r)!==0&&u.push(h),h=f.getNext();return u}else return[]}function BP(){return{visibleWrites:Vt.empty(),allWrites:[],lastWriteId:-1}}function Uc(n,e,t,r){return ab(n.writeTree,n.treePath,e,t,r)}function sm(n,e){return OP(n.writeTree,n.treePath,e)}function yE(n,e,t,r){return FP(n.writeTree,n.treePath,e,t,r)}function $c(n,e){return VP(n.writeTree,pe(n.treePath,e))}function HP(n,e,t,r,i,o){return jP(n.writeTree,n.treePath,e,t,r,i,o)}function am(n,e,t){return LP(n.writeTree,n.treePath,e,t)}function lb(n,e){return cb(pe(n.treePath,e),n.writeTree)}function cb(n,e){return{treePath:n,writeTree:e}}var Eg=class{constructor(){this.changeMap=new Map}trackChildChange(e){let t=e.type,r=e.childName;y(t==="child_added"||t==="child_changed"||t==="child_removed","Only child changes supported for tracking"),y(r!==".priority","Only non-priority child changes can be tracked.");let i=this.changeMap.get(r);if(i){let o=i.type;if(t==="child_added"&&o==="child_removed")this.changeMap.set(r,As(r,e.snapshotNode,i.snapshotNode));else if(t==="child_removed"&&o==="child_added")this.changeMap.delete(r);else if(t==="child_removed"&&o==="child_changed")this.changeMap.set(r,xs(r,i.oldSnap));else if(t==="child_changed"&&o==="child_added")this.changeMap.set(r,Ki(r,e.snapshotNode));else if(t==="child_changed"&&o==="child_changed")this.changeMap.set(r,As(r,e.snapshotNode,i.oldSnap));else throw Gr("Illegal combination of changes: "+e+" occurred after "+i)}else this.changeMap.set(r,e)}getChanges(){return Array.from(this.changeMap.values())}};var bg=class{getCompleteChild(e){return null}getChildAfterChild(e,t,r){return null}},ub=new bg,Ps=class{constructor(e,t,r=null){this.writes_=e,this.viewCache_=t,this.optCompleteServerCache_=r}getCompleteChild(e){let t=this.viewCache_.eventCache;if(t.isCompleteForChild(e))return t.getNode().getImmediateChild(e);{let r=this.optCompleteServerCache_!=null?new cn(this.optCompleteServerCache_,!0,!1):this.viewCache_.serverCache;return am(this.writes_,e,r)}}getChildAfterChild(e,t,r){let i=this.optCompleteServerCache_!=null?this.optCompleteServerCache_:jr(this.viewCache_),o=HP(this.writes_,i,t,1,r,e);return o.length===0?null:o[0]}};function UP(n){return{filter:n}}function $P(n,e){y(e.eventCache.getNode().isIndexed(n.filter.getIndex()),"Event snap not indexed"),y(e.serverCache.getNode().isIndexed(n.filter.getIndex()),"Server snap not indexed")}function zP(n,e,t,r,i){let o=new Eg,s,a;if(t.type===sn.OVERWRITE){let c=t;c.source.fromUser?s=Ig(n,e,c.path,c.snap,r,i,o):(y(c.source.fromServer,"Unknown source."),a=c.source.tagged||e.serverCache.isFiltered()&&!B(c.path),s=zc(n,e,c.path,c.snap,r,i,a,o))}else if(t.type===sn.MERGE){let c=t;c.source.fromUser?s=GP(n,e,c.path,c.children,r,i,o):(y(c.source.fromServer,"Unknown source."),a=c.source.tagged||e.serverCache.isFiltered(),s=Sg(n,e,c.path,c.children,r,i,a,o))}else if(t.type===sn.ACK_USER_WRITE){let c=t;c.revert?s=QP(n,e,c.path,r,i,o):s=qP(n,e,c.path,c.affectedTree,r,i,o)}else if(t.type===sn.LISTEN_COMPLETE)s=KP(n,e,t.path,r,o);else throw Gr("Unknown operation type: "+t.type);let l=o.getChanges();return WP(e,s,l),{viewCache:s,changes:l}}function WP(n,e,t){let r=e.eventCache;if(r.isFullyInitialized()){let i=r.getNode().isLeafNode()||r.getNode().isEmpty(),o=Hc(n);(t.length>0||!n.eventCache.isFullyInitialized()||i&&!r.getNode().equals(o)||!r.getNode().getPriority().equals(o.getPriority()))&&t.push(rb(Hc(e)))}}function db(n,e,t,r,i,o){let s=e.eventCache;if($c(r,t)!=null)return e;{let a,l;if(B(t))if(y(e.serverCache.isFullyInitialized(),"If change path is empty, we must have complete server data"),e.serverCache.isFiltered()){let c=jr(e),u=c instanceof R?c:R.EMPTY_NODE,d=sm(r,u);a=n.filter.updateFullNode(e.eventCache.getNode(),d,o)}else{let c=Uc(r,jr(e));a=n.filter.updateFullNode(e.eventCache.getNode(),c,o)}else{let c=j(t);if(c===".priority"){y(er(t)===1,"Can't have a priority with additional path components");let u=s.getNode();l=e.serverCache.getNode();let d=yE(r,t,u,l);d!=null?a=n.filter.updatePriority(u,d):a=s.getNode()}else{let u=le(t),d;if(s.isCompleteForChild(c)){l=e.serverCache.getNode();let f=yE(r,t,s.getNode(),l);f!=null?d=s.getNode().getImmediateChild(c).updateChild(u,f):d=s.getNode().getImmediateChild(c)}else d=am(r,c,e.serverCache);d!=null?a=n.filter.updateChild(s.getNode(),c,d,u,i,o):a=s.getNode()}}return Es(e,a,s.isFullyInitialized()||B(t),n.filter.filtersNodes())}}function zc(n,e,t,r,i,o,s,a){let l=e.serverCache,c,u=s?n.filter:n.filter.getIndexedFilter();if(B(t))c=u.updateFullNode(l.getNode(),r,null);else if(u.filtersNodes()&&!l.isFiltered()){let h=l.getNode().updateChild(t,r);c=u.updateFullNode(l.getNode(),h,null)}else{let h=j(t);if(!l.isCompleteForPath(t)&&er(t)>1)return e;let p=le(t),_=l.getNode().getImmediateChild(h).updateChild(p,r);h===".priority"?c=u.updatePriority(l.getNode(),_):c=u.updateChild(l.getNode(),h,_,p,ub,null)}let d=ib(e,c,l.isFullyInitialized()||B(t),u.filtersNodes()),f=new Ps(i,d,o);return db(n,d,t,i,f,a)}function Ig(n,e,t,r,i,o,s){let a=e.eventCache,l,c,u=new Ps(i,e,o);if(B(t))c=n.filter.updateFullNode(e.eventCache.getNode(),r,s),l=Es(e,c,!0,n.filter.filtersNodes());else{let d=j(t);if(d===".priority")c=n.filter.updatePriority(e.eventCache.getNode(),r),l=Es(e,c,a.isFullyInitialized(),a.isFiltered());else{let f=le(t),h=a.getNode().getImmediateChild(d),p;if(B(f))p=r;else{let g=u.getCompleteChild(d);g!=null?Xg(f)===".priority"&&g.getChild(ZE(f)).isEmpty()?p=g:p=g.updateChild(f,r):p=R.EMPTY_NODE}if(h.equals(p))l=e;else{let g=n.filter.updateChild(a.getNode(),d,p,f,u,s);l=Es(e,g,a.isFullyInitialized(),n.filter.filtersNodes())}}}return l}function vE(n,e){return n.eventCache.isCompleteForChild(e)}function GP(n,e,t,r,i,o,s){let a=e;return r.foreach((l,c)=>{let u=pe(t,l);vE(e,j(u))&&(a=Ig(n,a,u,c,i,o,s))}),r.foreach((l,c)=>{let u=pe(t,l);vE(e,j(u))||(a=Ig(n,a,u,c,i,o,s))}),a}function DE(n,e,t){return t.foreach((r,i)=>{e=e.updateChild(r,i)}),e}function Sg(n,e,t,r,i,o,s,a){if(e.serverCache.getNode().isEmpty()&&!e.serverCache.isFullyInitialized())return e;let l=e,c;B(t)?c=r:c=new qe(null).setTree(t,r);let u=e.serverCache.getNode();return c.children.inorderTraversal((d,f)=>{if(u.hasChild(d)){let h=e.serverCache.getNode().getImmediateChild(d),p=DE(n,h,f);l=zc(n,l,new te(d),p,i,o,s,a)}}),c.children.inorderTraversal((d,f)=>{let h=!e.serverCache.isCompleteForChild(d)&&f.value===null;if(!u.hasChild(d)&&!h){let p=e.serverCache.getNode().getImmediateChild(d),g=DE(n,p,f);l=zc(n,l,new te(d),g,i,o,s,a)}}),l}function qP(n,e,t,r,i,o,s){if($c(i,t)!=null)return e;let a=e.serverCache.isFiltered(),l=e.serverCache;if(r.value!=null){if(B(t)&&l.isFullyInitialized()||l.isCompleteForPath(t))return zc(n,e,t,l.getNode().getChild(t),i,o,a,s);if(B(t)){let c=new qe(null);return l.getNode().forEachChild(an,(u,d)=>{c=c.set(new te(u),d)}),Sg(n,e,t,c,i,o,a,s)}else return e}else{let c=new qe(null);return r.foreach((u,d)=>{let f=pe(t,u);l.isCompleteForPath(f)&&(c=c.set(u,l.getNode().getChild(f)))}),Sg(n,e,t,c,i,o,a,s)}}function KP(n,e,t,r,i){let o=e.serverCache,s=ib(e,o.getNode(),o.isFullyInitialized()||B(t),o.isFiltered());return db(n,s,t,r,ub,i)}function QP(n,e,t,r,i,o){let s;if($c(r,t)!=null)return e;{let a=new Ps(r,e,i),l=e.eventCache.getNode(),c;if(B(t)||j(t)===".priority"){let u;if(e.serverCache.isFullyInitialized())u=Uc(r,jr(e));else{let d=e.serverCache.getNode();y(d instanceof R,"serverChildren would be complete if leaf node"),u=sm(r,d)}u=u,c=n.filter.updateFullNode(l,u,o)}else{let u=j(t),d=am(r,u,e.serverCache);d==null&&e.serverCache.isCompleteForChild(u)&&(d=l.getImmediateChild(u)),d!=null?c=n.filter.updateChild(l,u,d,le(t),a,o):e.eventCache.getNode().hasChild(u)?c=n.filter.updateChild(l,u,R.EMPTY_NODE,le(t),a,o):c=l,c.isEmpty()&&e.serverCache.isFullyInitialized()&&(s=Uc(r,jr(e)),s.isLeafNode()&&(c=n.filter.updateFullNode(c,s,o)))}return s=e.serverCache.isFullyInitialized()||$c(r,ee())!=null,Es(e,c,s,n.filter.filtersNodes())}}var Tg=class{constructor(e,t){this.query_=e,this.eventRegistrations_=[];let r=this.query_._queryParams,i=new Ns(r.getIndex()),o=mP(r);this.processor_=UP(o);let s=t.serverCache,a=t.eventCache,l=i.updateFullNode(R.EMPTY_NODE,s.getNode(),null),c=o.updateFullNode(R.EMPTY_NODE,a.getNode(),null),u=new cn(l,s.isFullyInitialized(),i.filtersNodes()),d=new cn(c,a.isFullyInitialized(),o.filtersNodes());this.viewCache_=iu(d,u),this.eventGenerator_=new vg(this.query_)}get query(){return this.query_}};function YP(n){return n.viewCache_.serverCache.getNode()}function ZP(n){return Hc(n.viewCache_)}function XP(n,e){let t=jr(n.viewCache_);return t&&(n.query._queryParams.loadsAllData()||!B(e)&&!t.getImmediateChild(j(e)).isEmpty())?t.getChild(e):null}function wE(n){return n.eventRegistrations_.length===0}function JP(n,e){n.eventRegistrations_.push(e)}function CE(n,e,t){let r=[];if(t){y(e==null,"A cancel should cancel all event registrations.");let i=n.query._path;n.eventRegistrations_.forEach(o=>{let s=o.createCancelEvent(t,i);s&&r.push(s)})}if(e){let i=[];for(let o=0;o<n.eventRegistrations_.length;++o){let s=n.eventRegistrations_[o];if(!s.matches(e))i.push(s);else if(e.hasAnyCallback()){i=i.concat(n.eventRegistrations_.slice(o+1));break}}n.eventRegistrations_=i}else n.eventRegistrations_=[];return r}function EE(n,e,t,r){e.type===sn.MERGE&&e.source.queryId!==null&&(y(jr(n.viewCache_),"We should always have a full cache before handling merges"),y(Hc(n.viewCache_),"Missing event cache, even though we have a server cache"));let i=n.viewCache_,o=zP(n.processor_,i,e,t,r);return $P(n.processor_,o.viewCache),y(o.viewCache.serverCache.isFullyInitialized()||!i.serverCache.isFullyInitialized(),"Once a server snap is complete, it should never go back"),n.viewCache_=o.viewCache,fb(n,o.changes,o.viewCache.eventCache.getNode(),null)}function eO(n,e){let t=n.viewCache_.eventCache,r=[];return t.getNode().isLeafNode()||t.getNode().forEachChild(ue,(o,s)=>{r.push(Ki(o,s))}),t.isFullyInitialized()&&r.push(rb(t.getNode())),fb(n,r,t.getNode(),e)}function fb(n,e,t,r){let i=r?[r]:n.eventRegistrations_;return bP(n.eventGenerator_,e,t,i)}var Wc,Gc=class{constructor(){this.views=new Map}};function tO(n){y(!Wc,"__referenceConstructor has already been defined"),Wc=n}function nO(){return y(Wc,"Reference.ts has not been loaded"),Wc}function rO(n){return n.views.size===0}function lm(n,e,t,r){let i=e.source.queryId;if(i!==null){let o=n.views.get(i);return y(o!=null,"SyncTree gave us an op for an invalid query."),EE(o,e,t,r)}else{let o=[];for(let s of n.views.values())o=o.concat(EE(s,e,t,r));return o}}function hb(n,e,t,r,i){let o=e._queryIdentifier,s=n.views.get(o);if(!s){let a=Uc(t,i?r:null),l=!1;a?l=!0:r instanceof R?(a=sm(t,r),l=!1):(a=R.EMPTY_NODE,l=!1);let c=iu(new cn(a,l,!1),new cn(r,i,!1));return new Tg(e,c)}return s}function iO(n,e,t,r,i,o){let s=hb(n,e,r,i,o);return n.views.has(e._queryIdentifier)||n.views.set(e._queryIdentifier,s),JP(s,t),eO(s,t)}function oO(n,e,t,r){let i=e._queryIdentifier,o=[],s=[],a=tr(n);if(i==="default")for(let[l,c]of n.views.entries())s=s.concat(CE(c,t,r)),wE(c)&&(n.views.delete(l),c.query._queryParams.loadsAllData()||o.push(c.query));else{let l=n.views.get(i);l&&(s=s.concat(CE(l,t,r)),wE(l)&&(n.views.delete(i),l.query._queryParams.loadsAllData()||o.push(l.query)))}return a&&!tr(n)&&o.push(new(nO())(e._repo,e._path)),{removed:o,events:s}}function pb(n){let e=[];for(let t of n.views.values())t.query._queryParams.loadsAllData()||e.push(t);return e}function Xn(n,e){let t=null;for(let r of n.views.values())t=t||XP(r,e);return t}function gb(n,e){if(e._queryParams.loadsAllData())return su(n);{let r=e._queryIdentifier;return n.views.get(r)}}function mb(n,e){return gb(n,e)!=null}function tr(n){return su(n)!=null}function su(n){for(let e of n.views.values())if(e.query._queryParams.loadsAllData())return e;return null}var qc;function sO(n){y(!qc,"__referenceConstructor has already been defined"),qc=n}function aO(){return y(qc,"Reference.ts has not been loaded"),qc}var lO=1,Kc=class{constructor(e){this.listenProvider_=e,this.syncPointTree_=new qe(null),this.pendingWriteTree_=BP(),this.tagToQueryMap=new Map,this.queryToTagMap=new Map}};function cm(n,e,t,r,i){return MP(n.pendingWriteTree_,e,t,r,i),i?to(n,new Qi(rm(),e,t)):[]}function cO(n,e,t,r){xP(n.pendingWriteTree_,e,t,r);let i=qe.fromObject(t);return to(n,new ks(rm(),e,i))}function Yn(n,e,t=!1){let r=AP(n.pendingWriteTree_,e);if(NP(n.pendingWriteTree_,e)){let o=new qe(null);return r.snap!=null?o=o.set(ee(),!0):ke(r.children,s=>{o=o.set(new te(s),!0)}),to(n,new yg(r.path,o,t))}else return[]}function $s(n,e,t){return to(n,new Qi(im(),e,t))}function uO(n,e,t){let r=qe.fromObject(t);return to(n,new ks(im(),e,r))}function dO(n,e){return to(n,new Bc(im(),e))}function fO(n,e,t){let r=um(n,t);if(r){let i=dm(r),o=i.path,s=i.queryId,a=Ge(o,e),l=new Bc(om(s),a);return fm(n,o,l)}else return[]}function Qc(n,e,t,r,i=!1){let o=e._path,s=n.syncPointTree_.get(o),a=[];if(s&&(e._queryIdentifier==="default"||mb(s,e))){let l=oO(s,e,t,r);rO(s)&&(n.syncPointTree_=n.syncPointTree_.remove(o));let c=l.removed;if(a=l.events,!i){let u=c.findIndex(f=>f._queryParams.loadsAllData())!==-1,d=n.syncPointTree_.findOnPath(o,(f,h)=>tr(h));if(u&&!d){let f=n.syncPointTree_.subtree(o);if(!f.isEmpty()){let h=gO(f);for(let p=0;p<h.length;++p){let g=h[p],_=g.query,D=Db(n,g);n.listenProvider_.startListening(Is(_),Os(n,_),D.hashFn,D.onComplete)}}}!d&&c.length>0&&!r&&(u?n.listenProvider_.stopListening(Is(e),null):c.forEach(f=>{let h=n.queryToTagMap.get(lu(f));n.listenProvider_.stopListening(Is(f),h)}))}mO(n,c)}return a}function _b(n,e,t,r){let i=um(n,r);if(i!=null){let o=dm(i),s=o.path,a=o.queryId,l=Ge(s,e),c=new Qi(om(a),l,t);return fm(n,s,c)}else return[]}function hO(n,e,t,r){let i=um(n,r);if(i){let o=dm(i),s=o.path,a=o.queryId,l=Ge(s,e),c=qe.fromObject(t),u=new ks(om(a),l,c);return fm(n,s,u)}else return[]}function Mg(n,e,t,r=!1){let i=e._path,o=null,s=!1;n.syncPointTree_.foreachOnPath(i,(f,h)=>{let p=Ge(f,i);o=o||Xn(h,p),s=s||tr(h)});let a=n.syncPointTree_.get(i);a?(s=s||tr(a),o=o||Xn(a,ee())):(a=new Gc,n.syncPointTree_=n.syncPointTree_.set(i,a));let l;o!=null?l=!0:(l=!1,o=R.EMPTY_NODE,n.syncPointTree_.subtree(i).foreachChild((h,p)=>{let g=Xn(p,ee());g&&(o=o.updateImmediateChild(h,g))}));let c=mb(a,e);if(!c&&!e._queryParams.loadsAllData()){let f=lu(e);y(!n.queryToTagMap.has(f),"View does not exist, but we have a tag");let h=_O();n.queryToTagMap.set(f,h),n.tagToQueryMap.set(h,f)}let u=ou(n.pendingWriteTree_,i),d=iO(a,e,t,u,o,l);if(!c&&!s&&!r){let f=gb(a,e);d=d.concat(yO(n,e,f))}return d}function au(n,e,t){let i=n.pendingWriteTree_,o=n.syncPointTree_.findOnPath(e,(s,a)=>{let l=Ge(s,e),c=Xn(a,l);if(c)return c});return ab(i,e,o,t,!0)}function pO(n,e){let t=e._path,r=null;n.syncPointTree_.foreachOnPath(t,(c,u)=>{let d=Ge(c,t);r=r||Xn(u,d)});let i=n.syncPointTree_.get(t);i?r=r||Xn(i,ee()):(i=new Gc,n.syncPointTree_=n.syncPointTree_.set(t,i));let o=r!=null,s=o?new cn(r,!0,!1):null,a=ou(n.pendingWriteTree_,e._path),l=hb(i,e,a,o?s.getNode():R.EMPTY_NODE,o);return ZP(l)}function to(n,e){return yb(e,n.syncPointTree_,null,ou(n.pendingWriteTree_,ee()))}function yb(n,e,t,r){if(B(n.path))return vb(n,e,t,r);{let i=e.get(ee());t==null&&i!=null&&(t=Xn(i,ee()));let o=[],s=j(n.path),a=n.operationForChild(s),l=e.children.get(s);if(l&&a){let c=t?t.getImmediateChild(s):null,u=lb(r,s);o=o.concat(yb(a,l,c,u))}return i&&(o=o.concat(lm(i,n,r,t))),o}}function vb(n,e,t,r){let i=e.get(ee());t==null&&i!=null&&(t=Xn(i,ee()));let o=[];return e.children.inorderTraversal((s,a)=>{let l=t?t.getImmediateChild(s):null,c=lb(r,s),u=n.operationForChild(s);u&&(o=o.concat(vb(u,a,l,c)))}),i&&(o=o.concat(lm(i,n,r,t))),o}function Db(n,e){let t=e.query,r=Os(n,t);return{hashFn:()=>(YP(e)||R.EMPTY_NODE).hash(),onComplete:i=>{if(i==="ok")return r?fO(n,t._path,r):dO(n,t._path);{let o=Mk(i,t);return Qc(n,t,null,o)}}}}function Os(n,e){let t=lu(e);return n.queryToTagMap.get(t)}function lu(n){return n._path.toString()+"$"+n._queryIdentifier}function um(n,e){return n.tagToQueryMap.get(e)}function dm(n){let e=n.indexOf("$");return y(e!==-1&&e<n.length-1,"Bad queryKey."),{queryId:n.substr(e+1),path:new te(n.substr(0,e))}}function fm(n,e,t){let r=n.syncPointTree_.get(e);y(r,"Missing sync point for query tag that we're tracking");let i=ou(n.pendingWriteTree_,e);return lm(r,t,i,null)}function gO(n){return n.fold((e,t,r)=>{if(t&&tr(t))return[su(t)];{let i=[];return t&&(i=pb(t)),ke(r,(o,s)=>{i=i.concat(s)}),i}})}function Is(n){return n._queryParams.loadsAllData()&&!n._queryParams.isDefault()?new(aO())(n._repo,n._path):n}function mO(n,e){for(let t=0;t<e.length;++t){let r=e[t];if(!r._queryParams.loadsAllData()){let i=lu(r),o=n.queryToTagMap.get(i);n.queryToTagMap.delete(i),n.tagToQueryMap.delete(o)}}}function _O(){return lO++}function yO(n,e,t){let r=e._path,i=Os(n,e),o=Db(n,t),s=n.listenProvider_.startListening(Is(e),i,o.hashFn,o.onComplete),a=n.syncPointTree_.subtree(r);if(i)y(!tr(a.value),"If we're adding a query, it shouldn't be shadowed");else{let l=a.fold((c,u,d)=>{if(!B(c)&&u&&tr(u))return[su(u).query];{let f=[];return u&&(f=f.concat(pb(u).map(h=>h.query))),ke(d,(h,p)=>{f=f.concat(p)}),f}});for(let c=0;c<l.length;++c){let u=l[c];n.listenProvider_.stopListening(Is(u),Os(n,u))}}return s}var xg=class n{constructor(e){this.node_=e}getImmediateChild(e){let t=this.node_.getImmediateChild(e);return new n(t)}node(){return this.node_}},Ag=class n{constructor(e,t){this.syncTree_=e,this.path_=t}getImmediateChild(e){let t=pe(this.path_,e);return new n(this.syncTree_,t)}node(){return au(this.syncTree_,this.path_)}},vO=function(n){return n=n||{},n.timestamp=n.timestamp||new Date().getTime(),n},bE=function(n,e,t){if(!n||typeof n!="object")return n;if(y(".sv"in n,"Unexpected leaf node or priority contents"),typeof n[".sv"]=="string")return DO(n[".sv"],e,t);if(typeof n[".sv"]=="object")return wO(n[".sv"],e);y(!1,"Unexpected server value: "+JSON.stringify(n,null,2))},DO=function(n,e,t){switch(n){case"timestamp":return t.timestamp;default:y(!1,"Unexpected server value: "+n)}},wO=function(n,e,t){n.hasOwnProperty("increment")||y(!1,"Unexpected server value: "+JSON.stringify(n,null,2));let r=n.increment;typeof r!="number"&&y(!1,"Unexpected increment value: "+r);let i=e.node();if(y(i!==null&&typeof i<"u","Expected ChildrenNode.EMPTY_NODE for nulls"),!i.isLeafNode())return r;let s=i.getValue();return typeof s!="number"?r:s+r},wb=function(n,e,t,r){return pm(e,new Ag(t,n),r)},hm=function(n,e,t){return pm(n,new xg(e),t)};function pm(n,e,t){let r=n.getPriority().val(),i=bE(r,e.getImmediateChild(".priority"),t),o;if(n.isLeafNode()){let s=n,a=bE(s.getValue(),e,t);return a!==s.getValue()||i!==s.getPriority().val()?new Gi(a,me(i)):n}else{let s=n;return o=s,i!==s.getPriority().val()&&(o=o.updatePriority(new Gi(i))),s.forEachChild(ue,(a,l)=>{let c=pm(l,e.getImmediateChild(a),t);c!==l&&(o=o.updateImmediateChild(a,c))}),o}}var Fs=class{constructor(e="",t=null,r={children:{},childCount:0}){this.name=e,this.parent=t,this.node=r}};function cu(n,e){let t=e instanceof te?e:new te(e),r=n,i=j(t);for(;i!==null;){let o=Nn(r.node.children,i)||{children:{},childCount:0};r=new Fs(i,r,o),t=le(t),i=j(t)}return r}function Ur(n){return n.node.value}function gm(n,e){n.node.value=e,Ng(n)}function Cb(n){return n.node.childCount>0}function CO(n){return Ur(n)===void 0&&!Cb(n)}function uu(n,e){ke(n.node.children,(t,r)=>{e(new Fs(t,n,r))})}function Eb(n,e,t,r){t&&!r&&e(n),uu(n,i=>{Eb(i,e,!0,r)}),t&&r&&e(n)}function EO(n,e,t){let r=t?n:n.parent;for(;r!==null;){if(e(r))return!0;r=r.parent}return!1}function zs(n){return new te(n.parent===null?n.name:zs(n.parent)+"/"+n.name)}function Ng(n){n.parent!==null&&bO(n.parent,n.name,n)}function bO(n,e,t){let r=CO(t),i=dt(n.node.children,e);r&&i?(delete n.node.children[e],n.node.childCount--,Ng(n)):!r&&!i&&(n.node.children[e]=t.node,n.node.childCount++,Ng(n))}var IO=/[\[\].#$\/\u0000-\u001F\u007F]/,SO=/[\[\].#$\u0000-\u001F\u007F]/,Up=10*1024*1024,du=function(n){return typeof n=="string"&&n.length!==0&&!IO.test(n)},bb=function(n){return typeof n=="string"&&n.length!==0&&!SO.test(n)},TO=function(n){return n&&(n=n.replace(/^\/*\.info(\/|$)/,"/")),bb(n)},Ls=function(n){return n===null||typeof n=="string"||typeof n=="number"&&!nu(n)||n&&typeof n=="object"&&dt(n,".sv")},un=function(n,e,t,r){r&&e===void 0||Ws(Ze(n,"value"),e,t)},Ws=function(n,e,t){let r=t instanceof te?new tg(t,n):t;if(e===void 0)throw new Error(n+"contains undefined "+Fr(r));if(typeof e=="function")throw new Error(n+"contains a function "+Fr(r)+" with contents = "+e.toString());if(nu(e))throw new Error(n+"contains "+e.toString()+" "+Fr(r));if(typeof e=="string"&&e.length>Up/3&&so(e)>Up)throw new Error(n+"contains a string greater than "+Up+" utf8 bytes "+Fr(r)+" ('"+e.substring(0,50)+"...')");if(e&&typeof e=="object"){let i=!1,o=!1;if(ke(e,(s,a)=>{if(s===".value")i=!0;else if(s!==".priority"&&s!==".sv"&&(o=!0,!du(s)))throw new Error(n+" contains an invalid key ("+s+") "+Fr(r)+`. Keys must be non-empty strings and can't contain ".", "#", "$", "/", "[", or "]"`);rP(r,s),Ws(n,a,r),iP(r)}),i&&o)throw new Error(n+' contains ".value" child '+Fr(r)+" in addition to actual children.")}},MO=function(n,e){let t,r;for(t=0;t<e.length;t++){r=e[t];let o=Ts(r);for(let s=0;s<o.length;s++)if(!(o[s]===".priority"&&s===o.length-1)){if(!du(o[s]))throw new Error(n+"contains an invalid key ("+o[s]+") in path "+r.toString()+`. Keys must be non-empty strings and can't contain ".", "#", "$", "/", "[", or "]"`)}}e.sort(nP);let i=null;for(t=0;t<e.length;t++){if(r=e[t],i!==null&&Et(i,r))throw new Error(n+"contains a path "+i.toString()+" that is ancestor of another path "+r.toString());i=r}},Ib=function(n,e,t,r){if(r&&e===void 0)return;let i=Ze(n,"values");if(!(e&&typeof e=="object")||Array.isArray(e))throw new Error(i+" must be an object containing the children to replace.");let o=[];ke(e,(s,a)=>{let l=new te(s);if(Ws(i,a,pe(t,l)),Xg(l)===".priority"&&!Ls(a))throw new Error(i+"contains an invalid value for '"+l.toString()+"', which must be a valid Firebase priority (a string, finite number, server value, or null).");o.push(l)}),MO(i,o)},mm=function(n,e,t){if(!(t&&e===void 0)){if(nu(e))throw new Error(Ze(n,"priority")+"is "+e.toString()+", but must be a valid Firebase priority (a string, finite number, server value, or null).");if(!Ls(e))throw new Error(Ze(n,"priority")+"must be a valid Firebase priority (a string, finite number, server value, or null).")}},Gs=function(n,e,t,r){if(!(r&&t===void 0)&&!du(t))throw new Error(Ze(n,e)+'was an invalid key = "'+t+`". Firebase keys must be non-empty strings and can't contain ".", "#", "$", "/", "[", or "]").`)},no=function(n,e,t,r){if(!(r&&t===void 0)&&!bb(t))throw new Error(Ze(n,e)+'was an invalid path = "'+t+`". Paths must be non-empty strings and can't contain ".", "#", "$", "[", or "]"`)},xO=function(n,e,t,r){t&&(t=t.replace(/^\/*\.info(\/|$)/,"/")),no(n,e,t,r)},st=function(n,e){if(j(e)===".info")throw new Error(n+" failed = Can't modify data under /.info/")},Sb=function(n,e){let t=e.path.toString();if(typeof e.repoInfo.host!="string"||e.repoInfo.host.length===0||!du(e.repoInfo.namespace)&&e.repoInfo.host.split(":")[0]!=="localhost"||t.length!==0&&!TO(t))throw new Error(Ze(n,"url")+`must be a valid firebase URL and the path can't contain ".", "#", "$", "[", or "]".`)};var Rg=class{constructor(){this.eventLists_=[],this.recursionDepth_=0}};function fu(n,e){let t=null;for(let r=0;r<e.length;r++){let i=e[r],o=i.getPath();t!==null&&!Jg(o,t.path)&&(n.eventLists_.push(t),t=null),t===null&&(t={events:[],path:o}),t.events.push(i)}t&&n.eventLists_.push(t)}function Tb(n,e,t){fu(n,t),Mb(n,r=>Jg(r,e))}function at(n,e,t){fu(n,t),Mb(n,r=>Et(r,e)||Et(e,r))}function Mb(n,e){n.recursionDepth_++;let t=!0;for(let r=0;r<n.eventLists_.length;r++){let i=n.eventLists_[r];if(i){let o=i.path;e(o)?(AO(n.eventLists_[r]),n.eventLists_[r]=null):t=!1}}t&&(n.eventLists_=[]),n.recursionDepth_--}function AO(n){for(let e=0;e<n.events.length;e++){let t=n.events[e];if(t!==null){n.events[e]=null;let r=t.getEventRunner();Vr&&Re("event: "+t.toString()),Ji(r)}}}var xb="repo_interrupt",NO=25,kg=class{constructor(e,t,r,i){this.repoInfo_=e,this.forceRestClient_=t,this.authTokenProvider_=r,this.appCheckProvider_=i,this.dataUpdateCount=0,this.statsListener_=null,this.eventQueue_=new Rg,this.nextWriteId_=1,this.interceptServerDataCallback_=null,this.onDisconnect_=jc(),this.transactionQueueTree_=new Fs,this.persistentConnection_=null,this.key=this.repoInfo_.toURLString()}toString(){return(this.repoInfo_.secure?"https://":"http://")+this.repoInfo_.host}};function RO(n,e,t){if(n.stats_=Zg(n.repoInfo_),n.forceRestClient_||Rk())n.server_=new fg(n.repoInfo_,(r,i,o,s)=>{IE(n,r,i,o,s)},n.authTokenProvider_,n.appCheckProvider_),setTimeout(()=>SE(n,!0),0);else{if(typeof t<"u"&&t!==null){if(typeof t!="object")throw new Error("Only objects are supported for option databaseAuthVariableOverride");try{De(t)}catch(r){throw new Error("Invalid authOverride provided: "+r)}}n.persistentConnection_=new em(n.repoInfo_,e,(r,i,o,s)=>{IE(n,r,i,o,s)},r=>{SE(n,r)},r=>{kO(n,r)},n.authTokenProvider_,n.appCheckProvider_,t),n.server_=n.persistentConnection_}n.authTokenProvider_.addTokenChangeListener(r=>{n.server_.refreshAuthToken(r)}),n.appCheckProvider_.addTokenChangeListener(r=>{n.server_.refreshAppCheckToken(r.token)}),n.statsReporter_=Pk(n.repoInfo_,()=>new _g(n.stats_,n.server_)),n.infoData_=new hg,n.infoSyncTree_=new Kc({startListening:(r,i,o,s)=>{let a=[],l=n.infoData_.getNode(r._path);return l.isEmpty()||(a=$s(n.infoSyncTree_,r._path,l),setTimeout(()=>{s("ok")},0)),a},stopListening:()=>{}}),_m(n,"connected",!1),n.serverSyncTree_=new Kc({startListening:(r,i,o,s)=>(n.server_.listen(r,o,i,(a,l)=>{let c=s(a,l);at(n.eventQueue_,r._path,c)}),[]),stopListening:(r,i)=>{n.server_.unlisten(r,i)}})}function Ab(n){let t=n.infoData_.getNode(new te(".info/serverTimeOffset")).val()||0;return new Date().getTime()+t}function qs(n){return vO({timestamp:Ab(n)})}function IE(n,e,t,r,i){n.dataUpdateCount++;let o=new te(e);t=n.interceptServerDataCallback_?n.interceptServerDataCallback_(e,t):t;let s=[];if(i)if(r){let l=oo(t,c=>me(c));s=hO(n.serverSyncTree_,o,l,i)}else{let l=me(t);s=_b(n.serverSyncTree_,o,l,i)}else if(r){let l=oo(t,c=>me(c));s=uO(n.serverSyncTree_,o,l)}else{let l=me(t);s=$s(n.serverSyncTree_,o,l)}let a=o;s.length>0&&(a=Zi(n,o)),at(n.eventQueue_,a,s)}function SE(n,e){_m(n,"connected",e),e===!1&&FO(n)}function kO(n,e){ke(e,(t,r)=>{_m(n,t,r)})}function _m(n,e,t){let r=new te("/.info/"+e),i=me(t);n.infoData_.updateSnapshot(r,i);let o=$s(n.infoSyncTree_,r,i);at(n.eventQueue_,r,o)}function hu(n){return n.nextWriteId_++}function PO(n,e,t){let r=pO(n.serverSyncTree_,e);return r!=null?Promise.resolve(r):n.server_.get(e).then(i=>{let o=me(i).withIndex(e._queryParams.getIndex());Mg(n.serverSyncTree_,e,t,!0);let s;if(e._queryParams.loadsAllData())s=$s(n.serverSyncTree_,e._path,o);else{let a=Os(n.serverSyncTree_,e);s=_b(n.serverSyncTree_,e._path,o,a)}return at(n.eventQueue_,e._path,s),Qc(n.serverSyncTree_,e,t,null,!0),o},i=>(ro(n,"get for query "+De(e)+" failed: "+i),Promise.reject(new Error(i))))}function ym(n,e,t,r,i){ro(n,"set",{path:e.toString(),value:t,priority:r});let o=qs(n),s=me(t,r),a=au(n.serverSyncTree_,e),l=hm(s,a,o),c=hu(n),u=cm(n.serverSyncTree_,e,l,c,!0);fu(n.eventQueue_,u),n.server_.put(e.toString(),s.val(!0),(f,h)=>{let p=f==="ok";p||je("set at "+e+" failed: "+f);let g=Yn(n.serverSyncTree_,c,!p);at(n.eventQueue_,e,g),nr(n,i,f,h)});let d=Dm(n,e);Zi(n,d),at(n.eventQueue_,d,[])}function OO(n,e,t,r){ro(n,"update",{path:e.toString(),value:t});let i=!0,o=qs(n),s={};if(ke(t,(a,l)=>{i=!1,s[a]=wb(pe(e,a),me(l),n.serverSyncTree_,o)}),i)Re("update() called with empty data. Don't do anything."),nr(n,r,"ok",void 0);else{let a=hu(n),l=cO(n.serverSyncTree_,e,s,a);fu(n.eventQueue_,l),n.server_.merge(e.toString(),t,(c,u)=>{let d=c==="ok";d||je("update at "+e+" failed: "+c);let f=Yn(n.serverSyncTree_,a,!d),h=f.length>0?Zi(n,e):e;at(n.eventQueue_,h,f),nr(n,r,c,u)}),ke(t,c=>{let u=Dm(n,pe(e,c));Zi(n,u)}),at(n.eventQueue_,e,[])}}function FO(n){ro(n,"onDisconnectEvents");let e=qs(n),t=jc();gg(n.onDisconnect_,ee(),(i,o)=>{let s=wb(i,o,n.serverSyncTree_,e);eo(t,i,s)});let r=[];gg(t,ee(),(i,o)=>{r=r.concat($s(n.serverSyncTree_,i,o));let s=Dm(n,i);Zi(n,s)}),n.onDisconnect_=jc(),at(n.eventQueue_,ee(),r)}function LO(n,e,t){n.server_.onDisconnectCancel(e.toString(),(r,i)=>{r==="ok"&&pg(n.onDisconnect_,e),nr(n,t,r,i)})}function TE(n,e,t,r){let i=me(t);n.server_.onDisconnectPut(e.toString(),i.val(!0),(o,s)=>{o==="ok"&&eo(n.onDisconnect_,e,i),nr(n,r,o,s)})}function VO(n,e,t,r,i){let o=me(t,r);n.server_.onDisconnectPut(e.toString(),o.val(!0),(s,a)=>{s==="ok"&&eo(n.onDisconnect_,e,o),nr(n,i,s,a)})}function jO(n,e,t,r){if(ia(t)){Re("onDisconnect().update() called with empty data. Don't do anything."),nr(n,r,"ok",void 0);return}n.server_.onDisconnectMerge(e.toString(),t,(i,o)=>{i==="ok"&&ke(t,(s,a)=>{let l=me(a);eo(n.onDisconnect_,pe(e,s),l)}),nr(n,r,i,o)})}function BO(n,e,t){let r;j(e._path)===".info"?r=Mg(n.infoSyncTree_,e,t):r=Mg(n.serverSyncTree_,e,t),Tb(n.eventQueue_,e._path,r)}function Pg(n,e,t){let r;j(e._path)===".info"?r=Qc(n.infoSyncTree_,e,t):r=Qc(n.serverSyncTree_,e,t),Tb(n.eventQueue_,e._path,r)}function Nb(n){n.persistentConnection_&&n.persistentConnection_.interrupt(xb)}function HO(n){n.persistentConnection_&&n.persistentConnection_.resume(xb)}function ro(n,...e){let t="";n.persistentConnection_&&(t=n.persistentConnection_.id+":"),Re(t,...e)}function nr(n,e,t,r){e&&Ji(()=>{if(t==="ok")e(null);else{let i=(t||"error").toUpperCase(),o=i;r&&(o+=": "+r);let s=new Error(o);s.code=i,e(s)}})}function UO(n,e,t,r,i,o){ro(n,"transaction on "+e);let s={path:e,update:t,onComplete:r,status:null,order:AE(),applyLocally:o,retryCount:0,unwatcher:i,abortReason:null,currentWriteId:null,currentInputSnapshot:null,currentOutputSnapshotRaw:null,currentOutputSnapshotResolved:null},a=vm(n,e,void 0);s.currentInputSnapshot=a;let l=s.update(a.val());if(l===void 0)s.unwatcher(),s.currentOutputSnapshotRaw=null,s.currentOutputSnapshotResolved=null,s.onComplete&&s.onComplete(null,!1,s.currentInputSnapshot);else{Ws("transaction failed: Data returned ",l,s.path),s.status=0;let c=cu(n.transactionQueueTree_,e),u=Ur(c)||[];u.push(s),gm(c,u);let d;typeof l=="object"&&l!==null&&dt(l,".priority")?(d=Nn(l,".priority"),y(Ls(d),"Invalid priority returned by transaction. Priority must be a valid string, finite number, server value, or null.")):d=(au(n.serverSyncTree_,e)||R.EMPTY_NODE).getPriority().val();let f=qs(n),h=me(l,d),p=hm(h,a,f);s.currentOutputSnapshotRaw=h,s.currentOutputSnapshotResolved=p,s.currentWriteId=hu(n);let g=cm(n.serverSyncTree_,e,p,s.currentWriteId,s.applyLocally);at(n.eventQueue_,e,g),pu(n,n.transactionQueueTree_)}}function vm(n,e,t){return au(n.serverSyncTree_,e,t)||R.EMPTY_NODE}function pu(n,e=n.transactionQueueTree_){if(e||gu(n,e),Ur(e)){let t=kb(n,e);y(t.length>0,"Sending zero length transaction queue"),t.every(i=>i.status===0)&&$O(n,zs(e),t)}else Cb(e)&&uu(e,t=>{pu(n,t)})}function $O(n,e,t){let r=t.map(c=>c.currentWriteId),i=vm(n,e,r),o=i,s=i.hash();for(let c=0;c<t.length;c++){let u=t[c];y(u.status===0,"tryToSendTransactionQueue_: items in queue should all be run."),u.status=1,u.retryCount++;let d=Ge(e,u.path);o=o.updateChild(d,u.currentOutputSnapshotRaw)}let a=o.val(!0),l=e;n.server_.put(l.toString(),a,c=>{ro(n,"transaction put response",{path:l.toString(),status:c});let u=[];if(c==="ok"){let d=[];for(let f=0;f<t.length;f++)t[f].status=2,u=u.concat(Yn(n.serverSyncTree_,t[f].currentWriteId)),t[f].onComplete&&d.push(()=>t[f].onComplete(null,!0,t[f].currentOutputSnapshotResolved)),t[f].unwatcher();gu(n,cu(n.transactionQueueTree_,e)),pu(n,n.transactionQueueTree_),at(n.eventQueue_,e,u);for(let f=0;f<d.length;f++)Ji(d[f])}else{if(c==="datastale")for(let d=0;d<t.length;d++)t[d].status===3?t[d].status=4:t[d].status=0;else{je("transaction at "+l.toString()+" failed: "+c);for(let d=0;d<t.length;d++)t[d].status=4,t[d].abortReason=c}Zi(n,e)}},s)}function Zi(n,e){let t=Rb(n,e),r=zs(t),i=kb(n,t);return zO(n,i,r),r}function zO(n,e,t){if(e.length===0)return;let r=[],i=[],s=e.filter(a=>a.status===0).map(a=>a.currentWriteId);for(let a=0;a<e.length;a++){let l=e[a],c=Ge(t,l.path),u=!1,d;if(y(c!==null,"rerunTransactionsUnderNode_: relativePath should not be null."),l.status===4)u=!0,d=l.abortReason,i=i.concat(Yn(n.serverSyncTree_,l.currentWriteId,!0));else if(l.status===0)if(l.retryCount>=NO)u=!0,d="maxretry",i=i.concat(Yn(n.serverSyncTree_,l.currentWriteId,!0));else{let f=vm(n,l.path,s);l.currentInputSnapshot=f;let h=e[a].update(f.val());if(h!==void 0){Ws("transaction failed: Data returned ",h,l.path);let p=me(h);typeof h=="object"&&h!=null&&dt(h,".priority")||(p=p.updatePriority(f.getPriority()));let _=l.currentWriteId,D=qs(n),M=hm(p,f,D);l.currentOutputSnapshotRaw=p,l.currentOutputSnapshotResolved=M,l.currentWriteId=hu(n),s.splice(s.indexOf(_),1),i=i.concat(cm(n.serverSyncTree_,l.path,M,l.currentWriteId,l.applyLocally)),i=i.concat(Yn(n.serverSyncTree_,_,!0))}else u=!0,d="nodata",i=i.concat(Yn(n.serverSyncTree_,l.currentWriteId,!0))}at(n.eventQueue_,t,i),i=[],u&&(e[a].status=2,function(f){setTimeout(f,Math.floor(0))}(e[a].unwatcher),e[a].onComplete&&(d==="nodata"?r.push(()=>e[a].onComplete(null,!1,e[a].currentInputSnapshot)):r.push(()=>e[a].onComplete(new Error(d),!1,null))))}gu(n,n.transactionQueueTree_);for(let a=0;a<r.length;a++)Ji(r[a]);pu(n,n.transactionQueueTree_)}function Rb(n,e){let t,r=n.transactionQueueTree_;for(t=j(e);t!==null&&Ur(r)===void 0;)r=cu(r,t),e=le(e),t=j(e);return r}function kb(n,e){let t=[];return Pb(n,e,t),t.sort((r,i)=>r.order-i.order),t}function Pb(n,e,t){let r=Ur(e);if(r)for(let i=0;i<r.length;i++)t.push(r[i]);uu(e,i=>{Pb(n,i,t)})}function gu(n,e){let t=Ur(e);if(t){let r=0;for(let i=0;i<t.length;i++)t[i].status!==2&&(t[r]=t[i],r++);t.length=r,gm(e,t.length>0?t:void 0)}uu(e,r=>{gu(n,r)})}function Dm(n,e){let t=zs(Rb(n,e)),r=cu(n.transactionQueueTree_,e);return EO(r,i=>{$p(n,i)}),$p(n,r),Eb(r,i=>{$p(n,i)}),t}function $p(n,e){let t=Ur(e);if(t){let r=[],i=[],o=-1;for(let s=0;s<t.length;s++)t[s].status===3||(t[s].status===1?(y(o===s-1,"All SENT items should be at beginning of queue."),o=s,t[s].status=3,t[s].abortReason="set"):(y(t[s].status===0,"Unexpected transaction status in abort"),t[s].unwatcher(),i=i.concat(Yn(n.serverSyncTree_,t[s].currentWriteId,!0)),t[s].onComplete&&r.push(t[s].onComplete.bind(null,new Error("set"),!1,null))));o===-1?gm(e,void 0):t.length=o+1,at(n.eventQueue_,zs(e),i);for(let s=0;s<r.length;s++)Ji(r[s])}}function WO(n){let e="",t=n.split("/");for(let r=0;r<t.length;r++)if(t[r].length>0){let i=t[r];try{i=decodeURIComponent(i.replace(/\+/g," "))}catch{}e+="/"+i}return e}function GO(n){let e={};n.charAt(0)==="?"&&(n=n.substring(1));for(let t of n.split("&")){if(t.length===0)continue;let r=t.split("=");r.length===2?e[decodeURIComponent(r[0])]=decodeURIComponent(r[1]):je(`Invalid query segment '${t}' in query '${n}'`)}return e}var Og=function(n,e){let t=qO(n),r=t.namespace;t.domain==="firebase.com"&&ln(t.host+" is no longer supported. Please use <YOUR FIREBASE>.firebaseio.com instead"),(!r||r==="undefined")&&t.domain!=="localhost"&&ln("Cannot parse Firebase url. Please use https://<YOUR FIREBASE>.firebaseio.com"),t.secure||Ek();let i=t.scheme==="ws"||t.scheme==="wss";return{repoInfo:new Nc(t.host,t.secure,r,i,e,"",r!==t.subdomain),path:new te(t.pathString)}},qO=function(n){let e="",t="",r="",i="",o="",s=!0,a="https",l=443;if(typeof n=="string"){let c=n.indexOf("//");c>=0&&(a=n.substring(0,c-1),n=n.substring(c+2));let u=n.indexOf("/");u===-1&&(u=n.length);let d=n.indexOf("?");d===-1&&(d=n.length),e=n.substring(0,Math.min(u,d)),u<d&&(i=WO(n.substring(u,d)));let f=GO(n.substring(Math.min(n.length,d)));c=e.indexOf(":"),c>=0?(s=a==="https"||a==="wss",l=parseInt(e.substring(c+1),10)):c=e.length;let h=e.slice(0,c);if(h.toLowerCase()==="localhost")t="localhost";else if(h.split(".").length<=2)t=h;else{let p=e.indexOf(".");r=e.substring(0,p).toLowerCase(),t=e.substring(p+1),o=r}"ns"in f&&(o=f.ns)}return{host:e,port:l,domain:t,subdomain:r,secure:s,scheme:a,pathString:i,namespace:o}};var ME="-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz",KO=function(){let n=0,e=[];return function(t){let r=t===n;n=t;let i,o=new Array(8);for(i=7;i>=0;i--)o[i]=ME.charAt(t%64),t=Math.floor(t/64);y(t===0,"Cannot push at time == 0");let s=o.join("");if(r){for(i=11;i>=0&&e[i]===63;i--)e[i]=0;e[i]++}else for(i=0;i<12;i++)e[i]=Math.floor(Math.random()*64);for(i=0;i<12;i++)s+=ME.charAt(e[i]);return y(s.length===20,"nextPushId: Length should be 20."),s}}();var Yc=class{constructor(e,t,r,i){this.eventType=e,this.eventRegistration=t,this.snapshot=r,this.prevName=i}getPath(){let e=this.snapshot.ref;return this.eventType==="value"?e._path:e.parent._path}getEventType(){return this.eventType}getEventRunner(){return this.eventRegistration.getEventRunner(this)}toString(){return this.getPath().toString()+":"+this.eventType+":"+De(this.snapshot.exportVal())}},Zc=class{constructor(e,t,r){this.eventRegistration=e,this.error=t,this.path=r}getPath(){return this.path}getEventType(){return"cancel"}getEventRunner(){return this.eventRegistration.getEventRunner(this)}toString(){return this.path.toString()+":cancel"}};var Vs=class{constructor(e,t){this.snapshotCallback=e,this.cancelCallback=t}onValue(e,t){this.snapshotCallback.call(null,e,t)}onCancel(e){return y(this.hasCancelCallback,"Raising a cancel event on a listener with no cancel callback"),this.cancelCallback.call(null,e)}get hasCancelCallback(){return!!this.cancelCallback}matches(e){return this.snapshotCallback===e.snapshotCallback||this.snapshotCallback.userCallback!==void 0&&this.snapshotCallback.userCallback===e.snapshotCallback.userCallback&&this.snapshotCallback.context===e.snapshotCallback.context}};var Xc=class{constructor(e,t){this._repo=e,this._path=t}cancel(){let e=new ve;return LO(this._repo,this._path,e.wrapCallback(()=>{})),e.promise}remove(){st("OnDisconnect.remove",this._path);let e=new ve;return TE(this._repo,this._path,null,e.wrapCallback(()=>{})),e.promise}set(e){st("OnDisconnect.set",this._path),un("OnDisconnect.set",e,this._path,!1);let t=new ve;return TE(this._repo,this._path,e,t.wrapCallback(()=>{})),t.promise}setWithPriority(e,t){st("OnDisconnect.setWithPriority",this._path),un("OnDisconnect.setWithPriority",e,this._path,!1),mm("OnDisconnect.setWithPriority",t,!1);let r=new ve;return VO(this._repo,this._path,e,t,r.wrapCallback(()=>{})),r.promise}update(e){st("OnDisconnect.update",this._path),Ib("OnDisconnect.update",e,this._path,!1);let t=new ve;return jO(this._repo,this._path,e,t.wrapCallback(()=>{})),t.promise}};var Ke=class n{constructor(e,t,r,i){this._repo=e,this._path=t,this._queryParams=r,this._orderByCalled=i}get key(){return B(this._path)?null:Xg(this._path)}get ref(){return new lt(this._repo,this._path)}get _queryIdentifier(){let e=pE(this._queryParams),t=Yg(e);return t==="{}"?"default":t}get _queryObject(){return pE(this._queryParams)}isEqual(e){if(e=Fe(e),!(e instanceof n))return!1;let t=this._repo===e._repo,r=Jg(this._path,e._path),i=this._queryIdentifier===e._queryIdentifier;return t&&r&&i}toJSON(){return this.toString()}toString(){return this._repo.toString()+tP(this._path)}};function mu(n,e){if(n._orderByCalled===!0)throw new Error(e+": You can't combine multiple orderBy calls.")}function ir(n){let e=null,t=null;if(n.hasStart()&&(e=n.getIndexStartValue()),n.hasEnd()&&(t=n.getIndexEndValue()),n.getIndex()===an){let r="Query: When ordering by key, you may only pass one argument to startAt(), endAt(), or equalTo().",i="Query: When ordering by key, the argument passed to startAt(), startAfter(), endAt(), endBefore(), or equalTo() must be a string.";if(n.hasStart()){if(n.getIndexStartName()!==Jn)throw new Error(r);if(typeof e!="string")throw new Error(i)}if(n.hasEnd()){if(n.getIndexEndName()!==Mn)throw new Error(r);if(typeof t!="string")throw new Error(i)}}else if(n.getIndex()===ue){if(e!=null&&!Ls(e)||t!=null&&!Ls(t))throw new Error("Query: When ordering by priority, the first argument passed to startAt(), startAfter() endAt(), endBefore(), or equalTo() must be a valid priority value (null, a number, or a string).")}else if(y(n.getIndex()instanceof Ms||n.getIndex()===nm,"unknown index type."),e!=null&&typeof e=="object"||t!=null&&typeof t=="object")throw new Error("Query: First argument passed to startAt(), startAfter(), endAt(), endBefore(), or equalTo() cannot be an object.")}function _u(n){if(n.hasStart()&&n.hasEnd()&&n.hasLimit()&&!n.hasAnchoredLimit())throw new Error("Query: Can't combine startAt(), startAfter(), endAt(), endBefore(), and limit(). Use limitToFirst() or limitToLast() instead.")}var lt=class n extends Ke{constructor(e,t){super(e,t,new Rs,!1)}get parent(){let e=ZE(this._path);return e===null?null:new n(this._repo,e)}get root(){let e=this;for(;e.parent!==null;)e=e.parent;return e}},Xi=class n{constructor(e,t,r){this._node=e,this.ref=t,this._index=r}get priority(){return this._node.getPriority().val()}get key(){return this.ref.key}get size(){return this._node.numChildren()}child(e){let t=new te(e),r=rr(this.ref,e);return new n(this._node.getChild(t),r,ue)}exists(){return!this._node.isEmpty()}exportVal(){return this._node.val(!0)}forEach(e){return this._node.isLeafNode()?!1:!!this._node.forEachChild(this._index,(r,i)=>e(new n(i,rr(this.ref,r),ue)))}hasChild(e){let t=new te(e);return!this._node.getChild(t).isEmpty()}hasChildren(){return this._node.isLeafNode()?!1:!this._node.isEmpty()}toJSON(){return this.exportVal()}val(){return this._node.val()}};function wm(n,e){return n=Fe(n),n._checkNotDeleted("ref"),e!==void 0?rr(n._root,e):n._root}function Cm(n,e){n=Fe(n),n._checkNotDeleted("refFromURL");let t=Og(e,n._repo.repoInfo_.nodeAdmin);Sb("refFromURL",t);let r=t.repoInfo;return!n._repo.repoInfo_.isCustomHost()&&r.host!==n._repo.repoInfo_.host&&ln("refFromURL: Host name does not match the current database: (found "+r.host+" but expected "+n._repo.repoInfo_.host+")"),wm(n,t.path.toString())}function rr(n,e){return n=Fe(n),j(n._path)===null?xO("child","path",e,!1):no("child","path",e,!1),new lt(n._repo,pe(n._path,e))}function Ob(n,e){n=Fe(n),st("push",n._path),un("push",e,n._path,!0);let t=Ab(n._repo),r=KO(t),i=rr(n,r),o=rr(n,r),s;return e!=null?s=yu(o,e).then(()=>o):s=Promise.resolve(o),i.then=s.then.bind(s),i.catch=s.then.bind(s,void 0),i}function Fb(n){return st("remove",n._path),yu(n,null)}function yu(n,e){n=Fe(n),st("set",n._path),un("set",e,n._path,!1);let t=new ve;return ym(n._repo,n._path,e,null,t.wrapCallback(()=>{})),t.promise}function Lb(n,e){n=Fe(n),st("setPriority",n._path),mm("setPriority",e,!1);let t=new ve;return ym(n._repo,pe(n._path,".priority"),e,null,t.wrapCallback(()=>{})),t.promise}function Vb(n,e,t){if(st("setWithPriority",n._path),un("setWithPriority",e,n._path,!1),mm("setWithPriority",t,!1),n.key===".length"||n.key===".keys")throw"setWithPriority failed: "+n.key+" is a read-only object.";let r=new ve;return ym(n._repo,n._path,e,t,r.wrapCallback(()=>{})),r.promise}function jb(n,e){Ib("update",e,n._path,!1);let t=new ve;return OO(n._repo,n._path,e,t.wrapCallback(()=>{})),t.promise}function Bb(n){n=Fe(n);let e=new Vs(()=>{}),t=new js(e);return PO(n._repo,n,t).then(r=>new Xi(r,new lt(n._repo,n._path),n._queryParams.getIndex()))}var js=class n{constructor(e){this.callbackContext=e}respondsTo(e){return e==="value"}createEvent(e,t){let r=t._queryParams.getIndex();return new Yc("value",this,new Xi(e.snapshotNode,new lt(t._repo,t._path),r))}getEventRunner(e){return e.getEventType()==="cancel"?()=>this.callbackContext.onCancel(e.error):()=>this.callbackContext.onValue(e.snapshot,null)}createCancelEvent(e,t){return this.callbackContext.hasCancelCallback?new Zc(this,e,t):null}matches(e){return e instanceof n?!e.callbackContext||!this.callbackContext?!0:e.callbackContext.matches(this.callbackContext):!1}hasAnyCallback(){return this.callbackContext!==null}},Jc=class n{constructor(e,t){this.eventType=e,this.callbackContext=t}respondsTo(e){let t=e==="children_added"?"child_added":e;return t=t==="children_removed"?"child_removed":t,this.eventType===t}createCancelEvent(e,t){return this.callbackContext.hasCancelCallback?new Zc(this,e,t):null}createEvent(e,t){y(e.childName!=null,"Child events should have a childName.");let r=rr(new lt(t._repo,t._path),e.childName),i=t._queryParams.getIndex();return new Yc(e.type,this,new Xi(e.snapshotNode,r,i),e.prevName)}getEventRunner(e){return e.getEventType()==="cancel"?()=>this.callbackContext.onCancel(e.error):()=>this.callbackContext.onValue(e.snapshot,e.prevName)}matches(e){return e instanceof n?this.eventType===e.eventType&&(!this.callbackContext||!e.callbackContext||this.callbackContext.matches(e.callbackContext)):!1}hasAnyCallback(){return!!this.callbackContext}};function Ks(n,e,t,r,i){let o;if(typeof r=="object"&&(o=void 0,i=r),typeof r=="function"&&(o=r),i&&i.onlyOnce){let l=t,c=(u,d)=>{Pg(n._repo,n,a),l(u,d)};c.userCallback=t.userCallback,c.context=t.context,t=c}let s=new Vs(t,o||void 0),a=e==="value"?new js(s):new Jc(e,s);return BO(n._repo,n,a),()=>Pg(n._repo,n,a)}function vu(n,e,t,r){return Ks(n,"value",e,t,r)}function Em(n,e,t,r){return Ks(n,"child_added",e,t,r)}function bm(n,e,t,r){return Ks(n,"child_changed",e,t,r)}function Im(n,e,t,r){return Ks(n,"child_moved",e,t,r)}function Sm(n,e,t,r){return Ks(n,"child_removed",e,t,r)}function Tm(n,e,t){let r=null,i=t?new Vs(t):null;e==="value"?r=new js(i):e&&(r=new Jc(e,i)),Pg(n._repo,n,r)}var ct=class{},eu=class extends ct{constructor(e,t){super(),this._value=e,this._key=t,this.type="endAt"}_apply(e){un("endAt",this._value,e._path,!0);let t=dg(e._queryParams,this._value,this._key);if(_u(t),ir(t),e._queryParams.hasEnd())throw new Error("endAt: Starting point was already set (by another call to endAt, endBefore or equalTo).");return new Ke(e._repo,e._path,t,e._orderByCalled)}};function Hb(n,e){return Gs("endAt","key",e,!0),new eu(n,e)}var Fg=class extends ct{constructor(e,t){super(),this._value=e,this._key=t,this.type="endBefore"}_apply(e){un("endBefore",this._value,e._path,!1);let t=DP(e._queryParams,this._value,this._key);if(_u(t),ir(t),e._queryParams.hasEnd())throw new Error("endBefore: Starting point was already set (by another call to endAt, endBefore or equalTo).");return new Ke(e._repo,e._path,t,e._orderByCalled)}};function Ub(n,e){return Gs("endBefore","key",e,!0),new Fg(n,e)}var tu=class extends ct{constructor(e,t){super(),this._value=e,this._key=t,this.type="startAt"}_apply(e){un("startAt",this._value,e._path,!0);let t=ug(e._queryParams,this._value,this._key);if(_u(t),ir(t),e._queryParams.hasStart())throw new Error("startAt: Starting point was already set (by another call to startAt, startBefore or equalTo).");return new Ke(e._repo,e._path,t,e._orderByCalled)}};function $b(n=null,e){return Gs("startAt","key",e,!0),new tu(n,e)}var Lg=class extends ct{constructor(e,t){super(),this._value=e,this._key=t,this.type="startAfter"}_apply(e){un("startAfter",this._value,e._path,!1);let t=vP(e._queryParams,this._value,this._key);if(_u(t),ir(t),e._queryParams.hasStart())throw new Error("startAfter: Starting point was already set (by another call to startAt, startAfter, or equalTo).");return new Ke(e._repo,e._path,t,e._orderByCalled)}};function zb(n,e){return Gs("startAfter","key",e,!0),new Lg(n,e)}var Vg=class extends ct{constructor(e){super(),this._limit=e,this.type="limitToFirst"}_apply(e){if(e._queryParams.hasLimit())throw new Error("limitToFirst: Limit was already set (by another call to limitToFirst or limitToLast).");return new Ke(e._repo,e._path,_P(e._queryParams,this._limit),e._orderByCalled)}};function Wb(n){if(typeof n!="number"||Math.floor(n)!==n||n<=0)throw new Error("limitToFirst: First argument must be a positive integer.");return new Vg(n)}var jg=class extends ct{constructor(e){super(),this._limit=e,this.type="limitToLast"}_apply(e){if(e._queryParams.hasLimit())throw new Error("limitToLast: Limit was already set (by another call to limitToFirst or limitToLast).");return new Ke(e._repo,e._path,yP(e._queryParams,this._limit),e._orderByCalled)}};function Gb(n){if(typeof n!="number"||Math.floor(n)!==n||n<=0)throw new Error("limitToLast: First argument must be a positive integer.");return new jg(n)}var Bg=class extends ct{constructor(e){super(),this._path=e,this.type="orderByChild"}_apply(e){mu(e,"orderByChild");let t=new te(this._path);if(B(t))throw new Error("orderByChild: cannot pass in empty path. Use orderByValue() instead.");let r=new Ms(t),i=ru(e._queryParams,r);return ir(i),new Ke(e._repo,e._path,i,!0)}};function qb(n){if(n==="$key")throw new Error('orderByChild: "$key" is invalid. Use orderByKey() instead.');if(n==="$priority")throw new Error('orderByChild: "$priority" is invalid. Use orderByPriority() instead.');if(n==="$value")throw new Error('orderByChild: "$value" is invalid. Use orderByValue() instead.');return no("orderByChild","path",n,!1),new Bg(n)}var Hg=class extends ct{constructor(){super(...arguments),this.type="orderByKey"}_apply(e){mu(e,"orderByKey");let t=ru(e._queryParams,an);return ir(t),new Ke(e._repo,e._path,t,!0)}};function Kb(){return new Hg}var Ug=class extends ct{constructor(){super(...arguments),this.type="orderByPriority"}_apply(e){mu(e,"orderByPriority");let t=ru(e._queryParams,ue);return ir(t),new Ke(e._repo,e._path,t,!0)}};function Qb(){return new Ug}var $g=class extends ct{constructor(){super(...arguments),this.type="orderByValue"}_apply(e){mu(e,"orderByValue");let t=ru(e._queryParams,nm);return ir(t),new Ke(e._repo,e._path,t,!0)}};function Yb(){return new $g}var zg=class extends ct{constructor(e,t){super(),this._value=e,this._key=t,this.type="equalTo"}_apply(e){if(un("equalTo",this._value,e._path,!1),e._queryParams.hasStart())throw new Error("equalTo: Starting point was already set (by another call to startAt/startAfter or equalTo).");if(e._queryParams.hasEnd())throw new Error("equalTo: Ending point was already set (by another call to endAt/endBefore or equalTo).");return new eu(this._value,this._key)._apply(new tu(this._value,this._key)._apply(e))}};function Zb(n,e){return Gs("equalTo","key",e,!0),new zg(n,e)}function It(n,...e){let t=Fe(n);for(let r of e)t=r._apply(t);return t}tO(lt);sO(lt);var QO="FIREBASE_DATABASE_EMULATOR_HOST",Wg={},YO=!1;function ZO(n,e,t,r){let i=e.lastIndexOf(":"),o=e.substring(0,i),s=ju(o);n.repoInfo_=new Nc(e,s,n.repoInfo_.namespace,n.repoInfo_.webSocketOnly,n.repoInfo_.nodeAdmin,n.repoInfo_.persistenceKey,n.repoInfo_.includeNamespaceInQueryParams,!0,t),r&&(n.authTokenProvider_=r)}function Mm(n,e,t,r,i){let o=r||n.options.databaseURL;o===void 0&&(n.options.projectId||ln("Can't determine Firebase Database URL. Be sure to include a Project ID when calling firebase.initializeApp()."),Re("Using default host for project ",n.options.projectId),o=`${n.options.projectId}-default-rtdb.firebaseio.com`);let s=Og(o,i),a=s.repoInfo,l,c;typeof process<"u"&&process.env&&(c=process.env[QO]),c?(l=!0,o=`http://${c}?ns=${a.namespace}`,s=Og(o,i),a=s.repoInfo):l=!s.repoInfo.secure;let u=i&&l?new Cs(Cs.OWNER):new Qp(n.name,n.options,e);Sb("Invalid Firebase Database URL",s),B(s.path)||ln("Database URL must point to the root of a Firebase Database (not including a child path).");let d=JO(a,n,u,new Kp(n,t));return new Gg(d,n)}function XO(n,e){let t=Wg[e];(!t||t[n.key]!==n)&&ln(`Database ${e}(${n.repoInfo_}) has already been deleted.`),Nb(n),delete t[n.key]}function JO(n,e,t,r){let i=Wg[e.name];i||(i={},Wg[e.name]=i);let o=i[n.toURLString()];return o&&ln("Database initialized multiple times. Please make sure the format of the database URL matches with each database() call."),o=new kg(n,YO,t,r),i[n.toURLString()]=o,o}var Gg=class{constructor(e,t){this._repoInternal=e,this.app=t,this.type="database",this._instanceStarted=!1}get _repo(){return this._instanceStarted||(RO(this._repoInternal,this.app.options.appId,this.app.options.databaseAuthVariableOverride),this._instanceStarted=!0),this._repoInternal}get _root(){return this._rootInternal||(this._rootInternal=new lt(this._repo,ee())),this._rootInternal}_delete(){return this._rootInternal!==null&&(XO(this._repo,this.app.name),this._repoInternal=null,this._rootInternal=null),Promise.resolve()}_checkNotDeleted(e){this._rootInternal===null&&ln("Cannot call "+e+" on a deleted database.")}};function Xb(){YE.IS_TRANSPORT_INITIALIZED&&je("Transport has already been initialized. Please call this function before calling ref or setting up a listener")}function Jb(){Xb(),Ss.forceDisallow()}function eI(){Xb(),Ui.forceDisallow(),Ss.forceAllow()}function tI(n,e,t,r={}){n=Fe(n),n._checkNotDeleted("useEmulator");let i=`${e}:${t}`,o=n._repoInternal;if(n._instanceStarted){if(i===n._repoInternal.repoInfo_.host&&h_(r,o.repoInfo_.emulatorOptions))return;ln("connectDatabaseEmulator() cannot initialize or alter the emulator configuration after the database instance has started.")}let s;if(o.repoInfo_.nodeAdmin)r.mockUserToken&&ln('mockUserToken is not supported by the Admin SDK. For client access with mock users, please use the "firebase" package instead of "firebase-admin".'),s=new Cs(Cs.OWNER);else if(r.mockUserToken){let a=typeof r.mockUserToken=="string"?r.mockUserToken:a_(r.mockUserToken,n.app.options.projectId);s=new Cs(a)}ju(e)&&(s_(e),l_("Database",!0)),ZO(o,i,r,s)}function nI(n){n=Fe(n),n._checkNotDeleted("goOffline"),Nb(n._repo)}function rI(n){n=Fe(n),n._checkNotDeleted("goOnline"),HO(n._repo)}function iI(n,e){RE(n,e)}function eF(n){Qg(D_),ao(new fn("database",(e,{instanceIdentifier:t})=>{let r=e.getProvider("app").getImmediate(),i=e.getProvider("auth-internal"),o=e.getProvider("app-check-internal");return Mm(r,i,o,t)},"PUBLIC").setMultipleInstances(!0)),Rn(ZC,XC,n),Rn(ZC,XC,"esm2017")}var tF={".sv":"timestamp"};function oI(){return tF}function sI(n){return{".sv":{increment:n}}}var qg=class{constructor(e,t){this.committed=e,this.snapshot=t}toJSON(){return{committed:this.committed,snapshot:this.snapshot.toJSON()}}};function aI(n,e,t){var r;if(n=Fe(n),st("Reference.transaction",n._path),n.key===".length"||n.key===".keys")throw"Reference.transaction failed: "+n.key+" is a read-only object.";let i=(r=t?.applyLocally)!==null&&r!==void 0?r:!0,o=new ve,s=(l,c,u)=>{let d=null;l?o.reject(l):(d=new Xi(u,new lt(n._repo,n._path),ue),o.resolve(new qg(c,d)))},a=vu(n,()=>{});return UO(n._repo,n._path,e,s,a,i),o.promise}em.prototype.simpleListen=function(n,e){this.sendRequest("q",{p:n},e)};em.prototype.echo=function(n,e){this.sendRequest("echo",{d:n},e)};eF();var nF="@firebase/database-compat",rF="2.0.11";var iF=new qr("@firebase/database-compat"),lI=function(n){let e="FIREBASE WARNING: "+n;iF.warn(e)};var oF=function(n,e,t,r){if(!(r&&t===void 0)&&typeof t!="boolean")throw new Error(Ze(n,e)+"must be a boolean.")},sF=function(n,e,t){if(!(t&&e===void 0))switch(e){case"value":case"child_added":case"child_removed":case"child_changed":case"child_moved":break;default:throw new Error(Ze(n,"eventType")+'must be a valid event type = "value", "child_added", "child_removed", "child_changed", or "child_moved".')}};var xm=class{constructor(e){this._delegate=e}cancel(e){S("OnDisconnect.cancel",0,1,arguments.length),be("OnDisconnect.cancel","onComplete",e,!0);let t=this._delegate.cancel();return e&&t.then(()=>e(null),r=>e(r)),t}remove(e){S("OnDisconnect.remove",0,1,arguments.length),be("OnDisconnect.remove","onComplete",e,!0);let t=this._delegate.remove();return e&&t.then(()=>e(null),r=>e(r)),t}set(e,t){S("OnDisconnect.set",1,2,arguments.length),be("OnDisconnect.set","onComplete",t,!0);let r=this._delegate.set(e);return t&&r.then(()=>t(null),i=>t(i)),r}setWithPriority(e,t,r){S("OnDisconnect.setWithPriority",2,3,arguments.length),be("OnDisconnect.setWithPriority","onComplete",r,!0);let i=this._delegate.setWithPriority(e,t);return r&&i.then(()=>r(null),o=>r(o)),i}update(e,t){if(S("OnDisconnect.update",1,2,arguments.length),Array.isArray(e)){let i={};for(let o=0;o<e.length;++o)i[""+o]=e[o];e=i,lI("Passing an Array to firebase.database.onDisconnect().update() is deprecated. Use set() if you want to overwrite the existing data, or an Object with integer keys if you really do want to only update some of the children.")}be("OnDisconnect.update","onComplete",t,!0);let r=this._delegate.update(e);return t&&r.then(()=>t(null),i=>t(i)),r}};var Am=class{constructor(e,t){this.committed=e,this.snapshot=t}toJSON(){return S("TransactionResult.toJSON",0,1,arguments.length),{committed:this.committed,snapshot:this.snapshot.toJSON()}}};var $r=class n{constructor(e,t){this._database=e,this._delegate=t}val(){return S("DataSnapshot.val",0,0,arguments.length),this._delegate.val()}exportVal(){return S("DataSnapshot.exportVal",0,0,arguments.length),this._delegate.exportVal()}toJSON(){return S("DataSnapshot.toJSON",0,1,arguments.length),this._delegate.toJSON()}exists(){return S("DataSnapshot.exists",0,0,arguments.length),this._delegate.exists()}child(e){return S("DataSnapshot.child",0,1,arguments.length),e=String(e),no("DataSnapshot.child","path",e,!1),new n(this._database,this._delegate.child(e))}hasChild(e){return S("DataSnapshot.hasChild",1,1,arguments.length),no("DataSnapshot.hasChild","path",e,!1),this._delegate.hasChild(e)}getPriority(){return S("DataSnapshot.getPriority",0,0,arguments.length),this._delegate.priority}forEach(e){return S("DataSnapshot.forEach",1,1,arguments.length),be("DataSnapshot.forEach","action",e,!1),this._delegate.forEach(t=>e(new n(this._database,t)))}hasChildren(){return S("DataSnapshot.hasChildren",0,0,arguments.length),this._delegate.hasChildren()}get key(){return this._delegate.key}numChildren(){return S("DataSnapshot.numChildren",0,0,arguments.length),this._delegate.size}getRef(){return S("DataSnapshot.ref",0,0,arguments.length),new xn(this._database,this._delegate.ref)}get ref(){return this.getRef()}},Du=class n{constructor(e,t){this.database=e,this._delegate=t}on(e,t,r,i){var o;S("Query.on",2,4,arguments.length),be("Query.on","callback",t,!1);let s=n.getCancelAndContextArgs_("Query.on",r,i),a=(c,u)=>{t.call(s.context,new $r(this.database,c),u)};a.userCallback=t,a.context=s.context;let l=(o=s.cancel)===null||o===void 0?void 0:o.bind(s.context);switch(e){case"value":return vu(this._delegate,a,l),t;case"child_added":return Em(this._delegate,a,l),t;case"child_removed":return Sm(this._delegate,a,l),t;case"child_changed":return bm(this._delegate,a,l),t;case"child_moved":return Im(this._delegate,a,l),t;default:throw new Error(Ze("Query.on","eventType")+'must be a valid event type = "value", "child_added", "child_removed", "child_changed", or "child_moved".')}}off(e,t,r){if(S("Query.off",0,3,arguments.length),sF("Query.off",e,!0),be("Query.off","callback",t,!0),Uu("Query.off","context",r,!0),t){let i=()=>{};i.userCallback=t,i.context=r,Tm(this._delegate,e,i)}else Tm(this._delegate,e)}get(){return Bb(this._delegate).then(e=>new $r(this.database,e))}once(e,t,r,i){S("Query.once",1,4,arguments.length),be("Query.once","callback",t,!0);let o=n.getCancelAndContextArgs_("Query.once",r,i),s=new ve,a=(c,u)=>{let d=new $r(this.database,c);t&&t.call(o.context,d,u),s.resolve(d)};a.userCallback=t,a.context=o.context;let l=c=>{o.cancel&&o.cancel.call(o.context,c),s.reject(c)};switch(e){case"value":vu(this._delegate,a,l,{onlyOnce:!0});break;case"child_added":Em(this._delegate,a,l,{onlyOnce:!0});break;case"child_removed":Sm(this._delegate,a,l,{onlyOnce:!0});break;case"child_changed":bm(this._delegate,a,l,{onlyOnce:!0});break;case"child_moved":Im(this._delegate,a,l,{onlyOnce:!0});break;default:throw new Error(Ze("Query.once","eventType")+'must be a valid event type = "value", "child_added", "child_removed", "child_changed", or "child_moved".')}return s.promise}limitToFirst(e){return S("Query.limitToFirst",1,1,arguments.length),new n(this.database,It(this._delegate,Wb(e)))}limitToLast(e){return S("Query.limitToLast",1,1,arguments.length),new n(this.database,It(this._delegate,Gb(e)))}orderByChild(e){return S("Query.orderByChild",1,1,arguments.length),new n(this.database,It(this._delegate,qb(e)))}orderByKey(){return S("Query.orderByKey",0,0,arguments.length),new n(this.database,It(this._delegate,Kb()))}orderByPriority(){return S("Query.orderByPriority",0,0,arguments.length),new n(this.database,It(this._delegate,Qb()))}orderByValue(){return S("Query.orderByValue",0,0,arguments.length),new n(this.database,It(this._delegate,Yb()))}startAt(e=null,t){return S("Query.startAt",0,2,arguments.length),new n(this.database,It(this._delegate,$b(e,t)))}startAfter(e=null,t){return S("Query.startAfter",0,2,arguments.length),new n(this.database,It(this._delegate,zb(e,t)))}endAt(e=null,t){return S("Query.endAt",0,2,arguments.length),new n(this.database,It(this._delegate,Hb(e,t)))}endBefore(e=null,t){return S("Query.endBefore",0,2,arguments.length),new n(this.database,It(this._delegate,Ub(e,t)))}equalTo(e,t){return S("Query.equalTo",1,2,arguments.length),new n(this.database,It(this._delegate,Zb(e,t)))}toString(){return S("Query.toString",0,0,arguments.length),this._delegate.toString()}toJSON(){return S("Query.toJSON",0,1,arguments.length),this._delegate.toJSON()}isEqual(e){if(S("Query.isEqual",1,1,arguments.length),!(e instanceof n)){let t="Query.isEqual failed: First argument must be an instance of firebase.database.Query.";throw new Error(t)}return this._delegate.isEqual(e._delegate)}static getCancelAndContextArgs_(e,t,r){let i={cancel:void 0,context:void 0};if(t&&r)i.cancel=t,be(e,"cancel",i.cancel,!0),i.context=r,Uu(e,"context",i.context,!0);else if(t)if(typeof t=="object"&&t!==null)i.context=t;else if(typeof t=="function")i.cancel=t;else throw new Error(Ze(e,"cancelOrContext")+" must either be a cancel callback or a context object.");return i}get ref(){return new xn(this.database,new lt(this._delegate._repo,this._delegate._path))}},xn=class n extends Du{constructor(e,t){super(e,new Ke(t._repo,t._path,new Rs,!1)),this.database=e,this._delegate=t}getKey(){return S("Reference.key",0,0,arguments.length),this._delegate.key}child(e){return S("Reference.child",1,1,arguments.length),typeof e=="number"&&(e=String(e)),new n(this.database,rr(this._delegate,e))}getParent(){S("Reference.parent",0,0,arguments.length);let e=this._delegate.parent;return e?new n(this.database,e):null}getRoot(){return S("Reference.root",0,0,arguments.length),new n(this.database,this._delegate.root)}set(e,t){S("Reference.set",1,2,arguments.length),be("Reference.set","onComplete",t,!0);let r=yu(this._delegate,e);return t&&r.then(()=>t(null),i=>t(i)),r}update(e,t){if(S("Reference.update",1,2,arguments.length),Array.isArray(e)){let i={};for(let o=0;o<e.length;++o)i[""+o]=e[o];e=i,lI("Passing an Array to Firebase.update() is deprecated. Use set() if you want to overwrite the existing data, or an Object with integer keys if you really do want to only update some of the children.")}st("Reference.update",this._delegate._path),be("Reference.update","onComplete",t,!0);let r=jb(this._delegate,e);return t&&r.then(()=>t(null),i=>t(i)),r}setWithPriority(e,t,r){S("Reference.setWithPriority",2,3,arguments.length),be("Reference.setWithPriority","onComplete",r,!0);let i=Vb(this._delegate,e,t);return r&&i.then(()=>r(null),o=>r(o)),i}remove(e){S("Reference.remove",0,1,arguments.length),be("Reference.remove","onComplete",e,!0);let t=Fb(this._delegate);return e&&t.then(()=>e(null),r=>e(r)),t}transaction(e,t,r){S("Reference.transaction",1,3,arguments.length),be("Reference.transaction","transactionUpdate",e,!1),be("Reference.transaction","onComplete",t,!0),oF("Reference.transaction","applyLocally",r,!0);let i=aI(this._delegate,e,{applyLocally:r}).then(o=>new Am(o.committed,new $r(this.database,o.snapshot)));return t&&i.then(o=>t(null,o.committed,o.snapshot),o=>t(o,!1,null)),i}setPriority(e,t){S("Reference.setPriority",1,2,arguments.length),be("Reference.setPriority","onComplete",t,!0);let r=Lb(this._delegate,e);return t&&r.then(()=>t(null),i=>t(i)),r}push(e,t){S("Reference.push",0,2,arguments.length),be("Reference.push","onComplete",t,!0);let r=Ob(this._delegate,e),i=r.then(s=>new n(this.database,s));t&&i.then(()=>t(null),s=>t(s));let o=new n(this.database,r);return o.then=i.then.bind(i),o.catch=i.catch.bind(i,void 0),o}onDisconnect(){return st("Reference.onDisconnect",this._delegate._path),new xm(new Xc(this._delegate._repo,this._delegate._path))}get key(){return this.getKey()}get parent(){return this.getParent()}get root(){return this.getRoot()}};var zr=class{constructor(e,t){this._delegate=e,this.app=t,this.INTERNAL={delete:()=>this._delegate._delete(),forceWebSockets:Jb,forceLongPolling:eI}}useEmulator(e,t,r={}){tI(this._delegate,e,t,r)}ref(e){if(S("database.ref",0,1,arguments.length),e instanceof xn){let t=Cm(this._delegate,e.toString());return new xn(this,t)}else{let t=wm(this._delegate,e);return new xn(this,t)}}refFromURL(e){S("database.refFromURL",1,1,arguments.length);let r=Cm(this._delegate,e);return new xn(this,r)}goOffline(){return S("database.goOffline",0,0,arguments.length),nI(this._delegate)}goOnline(){return S("database.goOnline",0,0,arguments.length),rI(this._delegate)}};zr.ServerValue={TIMESTAMP:oI(),increment:n=>sI(n)};function aF({app:n,url:e,version:t,customAuthImpl:r,customAppCheckImpl:i,namespace:o,nodeAdmin:s=!1}){Qg(t);let a=new $u("database-standalone"),l=new oa("auth-internal",a);l.setComponent(new fn("auth-internal",()=>r,"PRIVATE"));let c;return i&&(c=new oa("app-check-internal",a),c.setComponent(new fn("app-check-internal",()=>i,"PRIVATE"))),{instance:new zr(Mm(n,l,c,e,s),n),namespace:o}}var lF=Object.freeze({__proto__:null,initStandalone:aF});var cF=zr.ServerValue;function uF(n){n.INTERNAL.registerComponent(new fn("database-compat",(e,{instanceIdentifier:t})=>{let r=e.getProvider("app-compat").getImmediate(),i=e.getProvider("database").getImmediate({identifier:t});return new zr(i,r)},"PUBLIC").setServiceProps({Reference:xn,Query:Du,Database:zr,DataSnapshot:$r,enableLogging:iI,INTERNAL:lF,ServerValue:cF}).setMultipleInstances(!0)),n.registerVersion(nF,rF)}uF(Xe);function Qs(n,e,t="on",r=Ut){return new G(i=>{let o=null;return o=n[t](e,(s,a)=>{r.schedule(()=>{i.next({snapshot:s,prevKey:a})}),t==="once"&&r.schedule(()=>i.complete())},s=>{r.schedule(()=>i.error(s))}),t==="on"?{unsubscribe(){o!=null&&n.off(e,o)}}:{unsubscribe(){}}}).pipe(oe(i=>{let{snapshot:o,prevKey:s}=i,a=null;return o.exists()&&(a=o.key),{type:e,payload:o,prevKey:s,key:a}}),mo())}function dF(n){return typeof n=="string"}function fF(n){return typeof n.exportVal=="function"}function hI(n){return n==null}function pI(n){return typeof n.set=="function"}function cI(n,e){return pI(e)?e:n.ref(e)}function gI(n,e){if(dF(n))return e.stringCase();if(pI(n))return e.firebaseCase();if(fF(n))return e.snapshotCase();throw new Error(`Expects a string, snapshot, or reference. Got: ${typeof n}`)}function mI(n){return(hI(n)||n.length===0)&&(n=["child_added","child_removed","child_changed","child_moved"]),n}function _I(n,e,t){e=mI(e);let r=e.map(i=>Qs(n,i,"on",t));return Wt(...r)}function hF(n,e,t){let r=_I(n,e).pipe(Wa((i,o)=>[...i,o],[]));return gF(n,r,t)}function pF(n,e){return Qs(n,"value","on",e).pipe(oe(t=>{let r;return t.payload.forEach(i=>(r=i.key,!1)),{data:t,lastKeyToLoad:r}}))}function gF(n,e,t){return pF(n,t).pipe(Td(e),oe(([i,o])=>{let s=i.lastKeyToLoad,a=o.map(l=>l.key);return{actions:o,lastKeyToLoad:s,loadedKeys:a}}),Id(i=>i.loadedKeys.indexOf(i.lastKeyToLoad)===-1),oe(i=>i.actions))}function uI(n,e){return function(r,i){return gI(r,{stringCase:()=>n.child(r)[e](i),firebaseCase:()=>r[e](i),snapshotCase:()=>r.ref[e](i)})}}function mF(n){return function(t){return t?gI(t,{stringCase:()=>n.child(t).remove(),firebaseCase:()=>t.remove(),snapshotCase:()=>t.ref.remove()}):n.remove()}}function _F(n,e,t){return Qs(n,"value","once",t).pipe(Le(r=>{let i=[zt(r)];return e.forEach(o=>i.push(Qs(n,o,"on",t))),Wt(...i).pipe(Wa(vF,[]))}),za())}function yI(n,e){let t=n.length;for(let r=0;r<t;r++)if(n[r].payload.key===e)return r;return-1}function yF(n,e){if(hI(e))return 0;{let t=yI(n,e);return t===-1?n.length:t+1}}function vF(n,e){let{payload:t,prevKey:r,key:i}=e,o=yI(n,i),s=yF(n,r);switch(e.type){case"value":if(e.payload?.exists()){let a=null;e.payload.forEach(l=>{let c={payload:l,type:"value",prevKey:a,key:l.key};return a=l.key,n=[...n,c],!1})}return n;case"child_added":if(o>-1)(n[o-1]?.key||null)!==r&&(n=n.filter(l=>l.payload.key!==t.key),n.splice(s,0,e));else{if(r==null)return[e,...n];n=n.slice(),n.splice(s,0,e)}return n;case"child_removed":return n.filter(a=>a.payload.key!==t.key);case"child_changed":return n.map(a=>a.payload.key===i?e:a);case"child_moved":if(o>-1){let a=n.splice(o,1)[0];return n=n.slice(),n.splice(s,0,a),n}return n;default:return n}}function dI(n,e,t){return e=mI(e),_F(n,e,t)}function DF(n,e,t){let r=e.schedulers.outsideAngular,i=m(k).run(()=>n.ref);return{query:n,update:uI(i,"update"),set:uI(i,"set"),push:o=>i.push(o),remove:mF(i),snapshotChanges(o){return dI(n,o,r).pipe(on(t))},stateChanges(o){return _I(n,o,r).pipe(on(t))},auditTrail(o){return hF(n,o,r).pipe(on(t))},valueChanges(o,s){return dI(n,o,r).pipe(oe(l=>l.map(c=>s&&s.idField?de(H({},c.payload.val()),{[s.idField]:c.key}):c.payload.val())),on(t))}}}function fI(n,e){return function(){return Qs(n,"value","on",e)}}function wF(n,e,t){return{query:n,snapshotChanges(){return fI(n,e.schedulers.outsideAngular)().pipe(on(t))},update(r){return n.ref.update(r)},set(r){return n.ref.set(r)},remove(){return n.ref.remove()},valueChanges(){return fI(n,e.schedulers.outsideAngular)().pipe(on(t),oe(i=>i.payload.exists()?i.payload.val():null))}}}var CF=new E("angularfire2.realtimeDatabaseURL"),EF=new E("angularfire2.database.use-emulator"),Nm=(()=>{class n{schedulers;database;injector=m($e);constructor(t,r,i,o,s,a,l,c,u,d,f,h,p,g,_){this.schedulers=a;let D=l,M=gs(t,s,r);c&&Fp(M,s,u,f,h,p,d,g),this.database=bc(`${M.name}.database.${i}`,"AngularFireDatabase",M.name,()=>{let A=s.runOutsideAngular(()=>M.database(i||void 0));return D&&A.useEmulator(...D),A},[D])}list(t,r){let i=m(k).runOutsideAngular(()=>cI(this.database,t)),o=i;return r&&(o=r(i)),DF(o,this,this.injector)}object(t){let r=m(k).runOutsideAngular(()=>cI(this.database,t));return wF(r,this,this.injector)}createPushId(){return m(k).runOutsideAngular(()=>this.database.ref()).push().key}static \u0275fac=function(r){return new(r||n)(w(Li),w(Vi,8),w(CF,8),w(ot),w(k),w(ps),w(EF,8),w(YC,8),w(Ap,8),w(Np,8),w(Rp,8),w(kp,8),w(Pp,8),w(Op,8),w(Bi,8))};static \u0275prov=I({token:n,factory:n.\u0275fac,providedIn:"any"})}return n})(),vI=(()=>{class n{constructor(){Xe.registerVersion("angularfire",Fi.full,"rtdb-compat")}static \u0275fac=function(r){return new(r||n)};static \u0275mod=Ce({type:n});static \u0275inj=we({providers:[Nm]})}return n})();var Rm;function bF(){if(Rm==null){let n=typeof document<"u"?document.head:null;Rm=!!(n&&(n.createShadowRoot||n.attachShadow))}return Rm}function wu(n){if(bF()){let e=n.getRootNode?n.getRootNode():null;if(typeof ShadowRoot<"u"&&ShadowRoot&&e instanceof ShadowRoot)return e}return null}function Ys(n){return n.composedPath?n.composedPath()[0]:n.target}function DI(n){return n.buttons===0||n.detail===0}function wI(n){let e=n.touches&&n.touches[0]||n.changedTouches&&n.changedTouches[0];return!!e&&e.identifier===-1&&(e.radiusX==null||e.radiusX===1)&&(e.radiusY==null||e.radiusY===1)}function Cu(n,e=0){return IF(n)?Number(n):arguments.length===2?e:0}function IF(n){return!isNaN(parseFloat(n))&&!isNaN(Number(n))}function dn(n){return n instanceof kt?n.nativeElement:n}function or(n,e,t,r,i){let o=parseInt(zo.major),s=parseInt(zo.minor);return o>19||o===19&&s>0||o===0&&s===0?n.listen(e,t,r,i):(e.addEventListener(t,r,i),()=>{e.removeEventListener(t,r,i)})}var Eu=new WeakMap,CI=(()=>{class n{_appRef;_injector=m(Ve);_environmentInjector=m($e);load(t){let r=this._appRef=this._appRef||this._injector.get(Bn),i=Eu.get(r);i||(i={loaders:new Set,refs:[]},Eu.set(r,i),r.onDestroy(()=>{Eu.get(r)?.refs.forEach(o=>o.destroy()),Eu.delete(r)})),i.loaders.has(t)||(i.loaders.add(t),i.refs.push($D(t,{environmentInjector:this._environmentInjector})))}static \u0275fac=function(r){return new(r||n)};static \u0275prov=I({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var km;try{km=typeof Intl<"u"&&Intl.v8BreakIterator}catch{km=!1}var Pm=(()=>{class n{_platformId=m(ot);isBrowser=this._platformId?Ih(this._platformId):typeof document=="object"&&!!document;EDGE=this.isBrowser&&/(edge)/i.test(navigator.userAgent);TRIDENT=this.isBrowser&&/(msie|trident)/i.test(navigator.userAgent);BLINK=this.isBrowser&&!!(window.chrome||km)&&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=I({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var SF=new E("cdk-dir-doc",{providedIn:"root",factory:TF});function TF(){return m(Me)}var MF=/^(ar|ckb|dv|he|iw|fa|nqo|ps|sd|ug|ur|yi|.*[-_](Adlm|Arab|Hebr|Nkoo|Rohg|Thaa))(?!.*[-_](Latn|Cyrl)($|-|_))($|-|_)/i;function xF(n){let e=n?.toLowerCase()||"";return e==="auto"&&typeof navigator<"u"&&navigator?.language?MF.test(navigator.language)?"rtl":"ltr":e==="rtl"?"rtl":"ltr"}var Om=(()=>{class n{value="ltr";change=new ie;constructor(){let t=m(SF,{optional:!0});if(t){let r=t.body?t.body.dir:null,i=t.documentElement?t.documentElement.dir:null;this.value=xF(r||i||"ltr")}}ngOnDestroy(){this.change.complete()}static \u0275fac=function(r){return new(r||n)};static \u0275prov=I({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var AF=20,EI=(()=>{class n{_ngZone=m(k);_platform=m(Pm);_renderer=m(Je).createRenderer(null,null);_cleanupGlobalListener;constructor(){}_scrolled=new L;_scrolledCount=0;scrollContainers=new Map;register(t){this.scrollContainers.has(t)||this.scrollContainers.set(t,t.elementScrolled().subscribe(()=>this._scrolled.next(t)))}deregister(t){let r=this.scrollContainers.get(t);r&&(r.unsubscribe(),this.scrollContainers.delete(t))}scrolled(t=AF){return this._platform.isBrowser?new G(r=>{this._cleanupGlobalListener||(this._cleanupGlobalListener=this._ngZone.runOutsideAngular(()=>this._renderer.listen("document","scroll",()=>this._scrolled.next())));let i=t>0?this._scrolled.pipe($a(t)).subscribe(r):this._scrolled.subscribe(r);return this._scrolledCount++,()=>{i.unsubscribe(),this._scrolledCount--,this._scrolledCount||(this._cleanupGlobalListener?.(),this._cleanupGlobalListener=void 0)}}):zt()}ngOnDestroy(){this._cleanupGlobalListener?.(),this._cleanupGlobalListener=void 0,this.scrollContainers.forEach((t,r)=>this.deregister(r)),this._scrolled.complete()}ancestorScrolled(t,r){let i=this.getAncestorScrollContainers(t);return this.scrolled(r).pipe(gr(o=>!o||i.indexOf(o)>-1))}getAncestorScrollContainers(t){let r=[];return this.scrollContainers.forEach((i,o)=>{this._scrollableContainsElement(o,t)&&r.push(o)}),r}_scrollableContainsElement(t,r){let i=dn(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=I({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var NF=20,bI=(()=>{class n{_platform=m(Pm);_listeners;_viewportSize;_change=new L;_document=m(Me,{optional:!0});constructor(){let t=m(k),r=m(Je).createRenderer(null,null);t.runOutsideAngular(()=>{if(this._platform.isBrowser){let 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();let t={width:this._viewportSize.width,height:this._viewportSize.height};return this._platform.isBrowser||(this._viewportSize=null),t}getViewportRect(){let 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};let t=this._document,r=this._getWindow(),i=t.documentElement,o=i.getBoundingClientRect(),s=-o.top||t.body.scrollTop||r.scrollY||i.scrollTop||0,a=-o.left||t.body.scrollLeft||r.scrollX||i.scrollLeft||0;return{top:s,left:a}}change(t=NF){return t>0?this._change.pipe($a(t)):this._change}_getWindow(){return this._document.defaultView||window}_updateViewportSize(){let 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=I({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var II=(()=>{class n{static \u0275fac=function(r){return new(r||n)};static \u0275mod=Ce({type:n});static \u0275inj=we({})}return n})();var Fm={},SI=(()=>{class n{_appId=m(jo);getId(t){return this._appId!=="ng"&&(t+=this._appId),Fm.hasOwnProperty(t)||(Fm[t]=0),`${t}${Fm[t]++}`}static \u0275fac=function(r){return new(r||n)};static \u0275prov=I({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();function TI(n){return Array.isArray(n)?n:[n]}function UI(n){let e=n.cloneNode(!0),t=e.querySelectorAll("[id]"),r=n.nodeName.toLowerCase();e.removeAttribute("id");for(let i=0;i<t.length;i++)t[i].removeAttribute("id");return r==="canvas"?AI(n,e):(r==="input"||r==="select"||r==="textarea")&&xI(n,e),MI("canvas",n,e,AI),MI("input, textarea, select",n,e,xI),e}function MI(n,e,t,r){let i=e.querySelectorAll(n);if(i.length){let o=t.querySelectorAll(n);for(let s=0;s<i.length;s++)r(i[s],o[s])}}var RF=0;function xI(n,e){e.type!=="file"&&(e.value=n.value),e.type==="radio"&&e.name&&(e.name=`mat-clone-${e.name}-${RF++}`)}function AI(n,e){let t=e.getContext("2d");if(t)try{t.drawImage(n,0,0)}catch{}}function zm(n){let e=n.getBoundingClientRect();return{top:e.top,right:e.right,bottom:e.bottom,left:e.left,width:e.width,height:e.height,x:e.x,y:e.y}}function jm(n,e,t){let{top:r,bottom:i,left:o,right:s}=n;return t>=r&&t<=i&&e>=o&&e<=s}function Js(n,e,t){n.top+=e,n.bottom=n.top+n.height,n.left+=t,n.right=n.left+n.width}function NI(n,e,t,r){let{top:i,right:o,bottom:s,left:a,width:l,height:c}=n,u=l*e,d=c*e;return r>i-d&&r<s+d&&t>a-u&&t<o+u}var bu=class{_document;positions=new Map;constructor(e){this._document=e}clear(){this.positions.clear()}cache(e){this.clear(),this.positions.set(this._document,{scrollPosition:this.getViewportScrollPosition()}),e.forEach(t=>{this.positions.set(t,{scrollPosition:{top:t.scrollTop,left:t.scrollLeft},clientRect:zm(t)})})}handleScroll(e){let t=Ys(e),r=this.positions.get(t);if(!r)return null;let i=r.scrollPosition,o,s;if(t===this._document){let c=this.getViewportScrollPosition();o=c.top,s=c.left}else o=t.scrollTop,s=t.scrollLeft;let a=i.top-o,l=i.left-s;return this.positions.forEach((c,u)=>{c.clientRect&&t!==u&&t.contains(u)&&Js(c.clientRect,a,l)}),i.top=o,i.left=s,{top:a,left:l}}getViewportScrollPosition(){return{top:window.scrollY,left:window.scrollX}}};function $I(n,e){let t=n.rootNodes;if(t.length===1&&t[0].nodeType===e.ELEMENT_NODE)return t[0];let r=e.createElement("div");return t.forEach(i=>r.appendChild(i)),r}function Wm(n,e,t){for(let r in e)if(e.hasOwnProperty(r)){let i=e[r];i?n.setProperty(r,i,t?.has(r)?"important":""):n.removeProperty(r)}return n}function io(n,e){let t=e?"":"none";Wm(n.style,{"touch-action":e?"":"none","-webkit-user-drag":e?"":"none","-webkit-tap-highlight-color":e?"":"transparent","user-select":t,"-ms-user-select":t,"-webkit-user-select":t,"-moz-user-select":t})}function RI(n,e,t){Wm(n.style,{position:e?"":"fixed",top:e?"":"0",opacity:e?"":"0",left:e?"":"-999em"},t)}function Iu(n,e){return e&&e!="none"?n+" "+e:n}function kI(n,e){n.style.width=`${e.width}px`,n.style.height=`${e.height}px`,n.style.transform=Su(e.left,e.top)}function Su(n,e){return`translate3d(${Math.round(n)}px, ${Math.round(e)}px, 0)`}function PI(n){let e=n.toLowerCase().indexOf("ms")>-1?1:1e3;return parseFloat(n)*e}function kF(n){let e=getComputedStyle(n),t=Lm(e,"transition-property"),r=t.find(a=>a==="transform"||a==="all");if(!r)return 0;let i=t.indexOf(r),o=Lm(e,"transition-duration"),s=Lm(e,"transition-delay");return PI(o[i])+PI(s[i])}function Lm(n,e){return n.getPropertyValue(e).split(",").map(r=>r.trim())}var PF=new Set(["position"]),Bm=class{_document;_rootElement;_direction;_initialDomRect;_previewTemplate;_previewClass;_pickupPositionOnPage;_initialTransform;_zIndex;_renderer;_previewEmbeddedView;_preview;get element(){return this._preview}constructor(e,t,r,i,o,s,a,l,c,u){this._document=e,this._rootElement=t,this._direction=r,this._initialDomRect=i,this._previewTemplate=o,this._previewClass=s,this._pickupPositionOnPage=a,this._initialTransform=l,this._zIndex=c,this._renderer=u}attach(e){this._preview=this._createPreview(),e.appendChild(this._preview),OI(this._preview)&&this._preview.showPopover()}destroy(){this._preview.remove(),this._previewEmbeddedView?.destroy(),this._preview=this._previewEmbeddedView=null}setTransform(e){this._preview.style.transform=e}getBoundingClientRect(){return this._preview.getBoundingClientRect()}addClass(e){this._preview.classList.add(e)}getTransitionDuration(){return kF(this._preview)}addEventListener(e,t){return this._renderer.listen(this._preview,e,t)}_createPreview(){let e=this._previewTemplate,t=this._previewClass,r=e?e.template:null,i;if(r&&e){let o=e.matchSize?this._initialDomRect:null,s=e.viewContainer.createEmbeddedView(r,e.context);s.detectChanges(),i=$I(s,this._document),this._previewEmbeddedView=s,e.matchSize?kI(i,o):i.style.transform=Su(this._pickupPositionOnPage.x,this._pickupPositionOnPage.y)}else i=UI(this._rootElement),kI(i,this._initialDomRect),this._initialTransform&&(i.style.transform=this._initialTransform);return Wm(i.style,{"pointer-events":"none",margin:OI(i)?"0 auto 0 0":"0",position:"fixed",top:"0",left:"0","z-index":this._zIndex+""},PF),io(i,!1),i.classList.add("cdk-drag-preview"),i.setAttribute("popover","manual"),i.setAttribute("dir",this._direction),t&&(Array.isArray(t)?t.forEach(o=>i.classList.add(o)):i.classList.add(t)),i}};function OI(n){return"showPopover"in n}var OF={passive:!0},FI={passive:!1},FF={passive:!1,capture:!0},LF=800,LI=new Set(["position"]),Hm=class{_config;_document;_ngZone;_viewportRuler;_dragDropRegistry;_renderer;_rootElementCleanups;_cleanupShadowRootSelectStart;_preview;_previewContainer;_placeholderRef;_placeholder;_pickupPositionInElement;_pickupPositionOnPage;_anchor;_passiveTransform={x:0,y:0};_activeTransform={x:0,y:0};_initialTransform;_hasStartedDragging=yn(!1);_hasMoved;_initialContainer;_initialIndex;_parentPositions;_moveEvents=new L;_pointerDirectionDelta;_pointerPositionAtLastDirectionChange;_lastKnownPointerPosition;_rootElement;_ownerSVGElement;_rootElementTapHighlight;_pointerMoveSubscription=ce.EMPTY;_pointerUpSubscription=ce.EMPTY;_scrollSubscription=ce.EMPTY;_resizeSubscription=ce.EMPTY;_lastTouchEventTime;_dragStartTime;_boundaryElement=null;_nativeInteractionsEnabled=!0;_initialDomRect;_previewRect;_boundaryRect;_previewTemplate;_placeholderTemplate;_handles=[];_disabledHandles=new Set;_dropContainer;_direction="ltr";_parentDragRef;_cachedShadowRoot;lockAxis;dragStartDelay=0;previewClass;scale=1;get disabled(){return this._disabled||!!(this._dropContainer&&this._dropContainer.disabled)}set disabled(e){e!==this._disabled&&(this._disabled=e,this._toggleNativeDragInteractions(),this._handles.forEach(t=>io(t,e)))}_disabled=!1;beforeStarted=new L;started=new L;released=new L;ended=new L;entered=new L;exited=new L;dropped=new L;moved=this._moveEvents;data;constrainPosition;constructor(e,t,r,i,o,s,a){this._config=t,this._document=r,this._ngZone=i,this._viewportRuler=o,this._dragDropRegistry=s,this._renderer=a,this.withRootElement(e).withParent(t.parentDragRef||null),this._parentPositions=new bu(r),s.registerDragItem(this)}getPlaceholderElement(){return this._placeholder}getRootElement(){return this._rootElement}getVisibleElement(){return this.isDragging()?this.getPlaceholderElement():this.getRootElement()}withHandles(e){this._handles=e.map(r=>dn(r)),this._handles.forEach(r=>io(r,this.disabled)),this._toggleNativeDragInteractions();let t=new Set;return this._disabledHandles.forEach(r=>{this._handles.indexOf(r)>-1&&t.add(r)}),this._disabledHandles=t,this}withPreviewTemplate(e){return this._previewTemplate=e,this}withPlaceholderTemplate(e){return this._placeholderTemplate=e,this}withRootElement(e){let t=dn(e);return t!==this._rootElement&&(this._removeRootElementListeners(),this._rootElementCleanups=this._ngZone.runOutsideAngular(()=>[or(this._renderer,t,"mousedown",this._pointerDown,FI),or(this._renderer,t,"touchstart",this._pointerDown,OF),or(this._renderer,t,"dragstart",this._nativeDragStart,FI)]),this._initialTransform=void 0,this._rootElement=t),typeof SVGElement<"u"&&this._rootElement instanceof SVGElement&&(this._ownerSVGElement=this._rootElement.ownerSVGElement),this}withBoundaryElement(e){return this._boundaryElement=e?dn(e):null,this._resizeSubscription.unsubscribe(),e&&(this._resizeSubscription=this._viewportRuler.change(10).subscribe(()=>this._containInsideBoundaryOnResize())),this}withParent(e){return this._parentDragRef=e,this}dispose(){this._removeRootElementListeners(),this.isDragging()&&this._rootElement?.remove(),this._anchor?.remove(),this._destroyPreview(),this._destroyPlaceholder(),this._dragDropRegistry.removeDragItem(this),this._removeListeners(),this.beforeStarted.complete(),this.started.complete(),this.released.complete(),this.ended.complete(),this.entered.complete(),this.exited.complete(),this.dropped.complete(),this._moveEvents.complete(),this._handles=[],this._disabledHandles.clear(),this._dropContainer=void 0,this._resizeSubscription.unsubscribe(),this._parentPositions.clear(),this._boundaryElement=this._rootElement=this._ownerSVGElement=this._placeholderTemplate=this._previewTemplate=this._anchor=this._parentDragRef=null}isDragging(){return this._hasStartedDragging()&&this._dragDropRegistry.isDragging(this)}reset(){this._rootElement.style.transform=this._initialTransform||"",this._activeTransform={x:0,y:0},this._passiveTransform={x:0,y:0}}disableHandle(e){!this._disabledHandles.has(e)&&this._handles.indexOf(e)>-1&&(this._disabledHandles.add(e),io(e,!0))}enableHandle(e){this._disabledHandles.has(e)&&(this._disabledHandles.delete(e),io(e,this.disabled))}withDirection(e){return this._direction=e,this}_withDropContainer(e){this._dropContainer=e}getFreeDragPosition(){let e=this.isDragging()?this._activeTransform:this._passiveTransform;return{x:e.x,y:e.y}}setFreeDragPosition(e){return this._activeTransform={x:0,y:0},this._passiveTransform.x=e.x,this._passiveTransform.y=e.y,this._dropContainer||this._applyRootElementTransform(e.x,e.y),this}withPreviewContainer(e){return this._previewContainer=e,this}_sortFromLastPointerPosition(){let e=this._lastKnownPointerPosition;e&&this._dropContainer&&this._updateActiveDropContainer(this._getConstrainedPointerPosition(e),e)}_removeListeners(){this._pointerMoveSubscription.unsubscribe(),this._pointerUpSubscription.unsubscribe(),this._scrollSubscription.unsubscribe(),this._cleanupShadowRootSelectStart?.(),this._cleanupShadowRootSelectStart=void 0}_destroyPreview(){this._preview?.destroy(),this._preview=null}_destroyPlaceholder(){this._placeholder?.remove(),this._placeholderRef?.destroy(),this._placeholder=this._placeholderRef=null}_pointerDown=e=>{if(this.beforeStarted.next(),this._handles.length){let t=this._getTargetHandle(e);t&&!this._disabledHandles.has(t)&&!this.disabled&&this._initializeDragSequence(t,e)}else this.disabled||this._initializeDragSequence(this._rootElement,e)};_pointerMove=e=>{let t=this._getPointerPositionOnPage(e);if(!this._hasStartedDragging()){let i=Math.abs(t.x-this._pickupPositionOnPage.x),o=Math.abs(t.y-this._pickupPositionOnPage.y);if(i+o>=this._config.dragStartThreshold){let a=Date.now()>=this._dragStartTime+this._getDragStartDelay(e),l=this._dropContainer;if(!a){this._endDragSequence(e);return}(!l||!l.isDragging()&&!l.isReceiving())&&(e.cancelable&&e.preventDefault(),this._hasStartedDragging.set(!0),this._ngZone.run(()=>this._startDragSequence(e)))}return}e.cancelable&&e.preventDefault();let r=this._getConstrainedPointerPosition(t);if(this._hasMoved=!0,this._lastKnownPointerPosition=t,this._updatePointerDirectionDelta(r),this._dropContainer)this._updateActiveDropContainer(r,t);else{let i=this.constrainPosition?this._initialDomRect:this._pickupPositionOnPage,o=this._activeTransform;o.x=r.x-i.x+this._passiveTransform.x,o.y=r.y-i.y+this._passiveTransform.y,this._applyRootElementTransform(o.x,o.y)}this._moveEvents.observers.length&&this._ngZone.run(()=>{this._moveEvents.next({source:this,pointerPosition:r,event:e,distance:this._getDragDistance(r),delta:this._pointerDirectionDelta})})};_pointerUp=e=>{this._endDragSequence(e)};_endDragSequence(e){if(this._dragDropRegistry.isDragging(this)&&(this._removeListeners(),this._dragDropRegistry.stopDragging(this),this._toggleNativeDragInteractions(),this._handles&&(this._rootElement.style.webkitTapHighlightColor=this._rootElementTapHighlight),!!this._hasStartedDragging()))if(this.released.next({source:this,event:e}),this._dropContainer)this._dropContainer._stopScrolling(),this._animatePreviewToPlaceholder().then(()=>{this._cleanupDragArtifacts(e),this._cleanupCachedDimensions(),this._dragDropRegistry.stopDragging(this)});else{this._passiveTransform.x=this._activeTransform.x;let t=this._getPointerPositionOnPage(e);this._passiveTransform.y=this._activeTransform.y,this._ngZone.run(()=>{this.ended.next({source:this,distance:this._getDragDistance(t),dropPoint:t,event:e})}),this._cleanupCachedDimensions(),this._dragDropRegistry.stopDragging(this)}}_startDragSequence(e){Zs(e)&&(this._lastTouchEventTime=Date.now()),this._toggleNativeDragInteractions();let t=this._getShadowRoot(),r=this._dropContainer;if(t&&this._ngZone.runOutsideAngular(()=>{this._cleanupShadowRootSelectStart=or(this._renderer,t,"selectstart",VF,FF)}),r){let i=this._rootElement,o=i.parentNode,s=this._placeholder=this._createPlaceholderElement(),a=this._anchor=this._anchor||this._document.createComment("");o.insertBefore(a,i),this._initialTransform=i.style.transform||"",this._preview=new Bm(this._document,this._rootElement,this._direction,this._initialDomRect,this._previewTemplate||null,this.previewClass||null,this._pickupPositionOnPage,this._initialTransform,this._config.zIndex||1e3,this._renderer),this._preview.attach(this._getPreviewInsertionPoint(o,t)),RI(i,!1,LI),this._document.body.appendChild(o.replaceChild(s,i)),this.started.next({source:this,event:e}),r.start(),this._initialContainer=r,this._initialIndex=r.getItemIndex(this)}else this.started.next({source:this,event:e}),this._initialContainer=this._initialIndex=void 0;this._parentPositions.cache(r?r.getScrollableParents():[])}_initializeDragSequence(e,t){this._parentDragRef&&t.stopPropagation();let r=this.isDragging(),i=Zs(t),o=!i&&t.button!==0,s=this._rootElement,a=Ys(t),l=!i&&this._lastTouchEventTime&&this._lastTouchEventTime+LF>Date.now(),c=i?wI(t):DI(t);if(a&&a.draggable&&t.type==="mousedown"&&t.preventDefault(),r||o||l||c)return;if(this._handles.length){let f=s.style;this._rootElementTapHighlight=f.webkitTapHighlightColor||"",f.webkitTapHighlightColor="transparent"}this._hasMoved=!1,this._hasStartedDragging.set(this._hasMoved),this._removeListeners(),this._initialDomRect=this._rootElement.getBoundingClientRect(),this._pointerMoveSubscription=this._dragDropRegistry.pointerMove.subscribe(this._pointerMove),this._pointerUpSubscription=this._dragDropRegistry.pointerUp.subscribe(this._pointerUp),this._scrollSubscription=this._dragDropRegistry.scrolled(this._getShadowRoot()).subscribe(f=>this._updateOnScroll(f)),this._boundaryElement&&(this._boundaryRect=zm(this._boundaryElement));let u=this._previewTemplate;this._pickupPositionInElement=u&&u.template&&!u.matchSize?{x:0,y:0}:this._getPointerPositionInElement(this._initialDomRect,e,t);let d=this._pickupPositionOnPage=this._lastKnownPointerPosition=this._getPointerPositionOnPage(t);this._pointerDirectionDelta={x:0,y:0},this._pointerPositionAtLastDirectionChange={x:d.x,y:d.y},this._dragStartTime=Date.now(),this._dragDropRegistry.startDragging(this,t)}_cleanupDragArtifacts(e){RI(this._rootElement,!0,LI),this._anchor.parentNode.replaceChild(this._rootElement,this._anchor),this._destroyPreview(),this._destroyPlaceholder(),this._initialDomRect=this._boundaryRect=this._previewRect=this._initialTransform=void 0,this._ngZone.run(()=>{let t=this._dropContainer,r=t.getItemIndex(this),i=this._getPointerPositionOnPage(e),o=this._getDragDistance(i),s=t._isOverContainer(i.x,i.y);this.ended.next({source:this,distance:o,dropPoint:i,event:e}),this.dropped.next({item:this,currentIndex:r,previousIndex:this._initialIndex,container:t,previousContainer:this._initialContainer,isPointerOverContainer:s,distance:o,dropPoint:i,event:e}),t.drop(this,r,this._initialIndex,this._initialContainer,s,o,i,e),this._dropContainer=this._initialContainer})}_updateActiveDropContainer({x:e,y:t},{x:r,y:i}){let o=this._initialContainer._getSiblingContainerFromPosition(this,e,t);!o&&this._dropContainer!==this._initialContainer&&this._initialContainer._isOverContainer(e,t)&&(o=this._initialContainer),o&&o!==this._dropContainer&&this._ngZone.run(()=>{this.exited.next({item:this,container:this._dropContainer}),this._dropContainer.exit(this),this._dropContainer=o,this._dropContainer.enter(this,e,t,o===this._initialContainer&&o.sortingDisabled?this._initialIndex:void 0),this.entered.next({item:this,container:o,currentIndex:o.getItemIndex(this)})}),this.isDragging()&&(this._dropContainer._startScrollingIfNecessary(r,i),this._dropContainer._sortItem(this,e,t,this._pointerDirectionDelta),this.constrainPosition?this._applyPreviewTransform(e,t):this._applyPreviewTransform(e-this._pickupPositionInElement.x,t-this._pickupPositionInElement.y))}_animatePreviewToPlaceholder(){if(!this._hasMoved)return Promise.resolve();let e=this._placeholder.getBoundingClientRect();this._preview.addClass("cdk-drag-animating"),this._applyPreviewTransform(e.left,e.top);let t=this._preview.getTransitionDuration();return t===0?Promise.resolve():this._ngZone.runOutsideAngular(()=>new Promise(r=>{let i=a=>{(!a||this._preview&&Ys(a)===this._preview.element&&a.propertyName==="transform")&&(s(),r(),clearTimeout(o))},o=setTimeout(i,t*1.5),s=this._preview.addEventListener("transitionend",i)}))}_createPlaceholderElement(){let e=this._placeholderTemplate,t=e?e.template:null,r;return t?(this._placeholderRef=e.viewContainer.createEmbeddedView(t,e.context),this._placeholderRef.detectChanges(),r=$I(this._placeholderRef,this._document)):r=UI(this._rootElement),r.style.pointerEvents="none",r.classList.add("cdk-drag-placeholder"),r}_getPointerPositionInElement(e,t,r){let i=t===this._rootElement?null:t,o=i?i.getBoundingClientRect():e,s=Zs(r)?r.targetTouches[0]:r,a=this._getViewportScrollPosition(),l=s.pageX-o.left-a.left,c=s.pageY-o.top-a.top;return{x:o.left-e.left+l,y:o.top-e.top+c}}_getPointerPositionOnPage(e){let t=this._getViewportScrollPosition(),r=Zs(e)?e.touches[0]||e.changedTouches[0]||{pageX:0,pageY:0}:e,i=r.pageX-t.left,o=r.pageY-t.top;if(this._ownerSVGElement){let s=this._ownerSVGElement.getScreenCTM();if(s){let a=this._ownerSVGElement.createSVGPoint();return a.x=i,a.y=o,a.matrixTransform(s.inverse())}}return{x:i,y:o}}_getConstrainedPointerPosition(e){let t=this._dropContainer?this._dropContainer.lockAxis:null,{x:r,y:i}=this.constrainPosition?this.constrainPosition(e,this,this._initialDomRect,this._pickupPositionInElement):e;if(this.lockAxis==="x"||t==="x"?i=this._pickupPositionOnPage.y-(this.constrainPosition?this._pickupPositionInElement.y:0):(this.lockAxis==="y"||t==="y")&&(r=this._pickupPositionOnPage.x-(this.constrainPosition?this._pickupPositionInElement.x:0)),this._boundaryRect){let{x:o,y:s}=this.constrainPosition?{x:0,y:0}:this._pickupPositionInElement,a=this._boundaryRect,{width:l,height:c}=this._getPreviewRect(),u=a.top+s,d=a.bottom-(c-s),f=a.left+o,h=a.right-(l-o);r=VI(r,f,h),i=VI(i,u,d)}return{x:r,y:i}}_updatePointerDirectionDelta(e){let{x:t,y:r}=e,i=this._pointerDirectionDelta,o=this._pointerPositionAtLastDirectionChange,s=Math.abs(t-o.x),a=Math.abs(r-o.y);return s>this._config.pointerDirectionChangeThreshold&&(i.x=t>o.x?1:-1,o.x=t),a>this._config.pointerDirectionChangeThreshold&&(i.y=r>o.y?1:-1,o.y=r),i}_toggleNativeDragInteractions(){if(!this._rootElement||!this._handles)return;let e=this._handles.length>0||!this.isDragging();e!==this._nativeInteractionsEnabled&&(this._nativeInteractionsEnabled=e,io(this._rootElement,e))}_removeRootElementListeners(){this._rootElementCleanups?.forEach(e=>e()),this._rootElementCleanups=void 0}_applyRootElementTransform(e,t){let r=1/this.scale,i=Su(e*r,t*r),o=this._rootElement.style;this._initialTransform==null&&(this._initialTransform=o.transform&&o.transform!="none"?o.transform:""),o.transform=Iu(i,this._initialTransform)}_applyPreviewTransform(e,t){let r=this._previewTemplate?.template?void 0:this._initialTransform,i=Su(e,t);this._preview.setTransform(Iu(i,r))}_getDragDistance(e){let t=this._pickupPositionOnPage;return t?{x:e.x-t.x,y:e.y-t.y}:{x:0,y:0}}_cleanupCachedDimensions(){this._boundaryRect=this._previewRect=void 0,this._parentPositions.clear()}_containInsideBoundaryOnResize(){let{x:e,y:t}=this._passiveTransform;if(e===0&&t===0||this.isDragging()||!this._boundaryElement)return;let r=this._rootElement.getBoundingClientRect(),i=this._boundaryElement.getBoundingClientRect();if(i.width===0&&i.height===0||r.width===0&&r.height===0)return;let o=i.left-r.left,s=r.right-i.right,a=i.top-r.top,l=r.bottom-i.bottom;i.width>r.width?(o>0&&(e+=o),s>0&&(e-=s)):e=0,i.height>r.height?(a>0&&(t+=a),l>0&&(t-=l)):t=0,(e!==this._passiveTransform.x||t!==this._passiveTransform.y)&&this.setFreeDragPosition({y:t,x:e})}_getDragStartDelay(e){let t=this.dragStartDelay;return typeof t=="number"?t:Zs(e)?t.touch:t?t.mouse:0}_updateOnScroll(e){let t=this._parentPositions.handleScroll(e);if(t){let r=Ys(e);this._boundaryRect&&r!==this._boundaryElement&&r.contains(this._boundaryElement)&&Js(this._boundaryRect,t.top,t.left),this._pickupPositionOnPage.x+=t.left,this._pickupPositionOnPage.y+=t.top,this._dropContainer||(this._activeTransform.x-=t.left,this._activeTransform.y-=t.top,this._applyRootElementTransform(this._activeTransform.x,this._activeTransform.y))}}_getViewportScrollPosition(){return this._parentPositions.positions.get(this._document)?.scrollPosition||this._parentPositions.getViewportScrollPosition()}_getShadowRoot(){return this._cachedShadowRoot===void 0&&(this._cachedShadowRoot=wu(this._rootElement)),this._cachedShadowRoot}_getPreviewInsertionPoint(e,t){let r=this._previewContainer||"global";if(r==="parent")return e;if(r==="global"){let i=this._document;return t||i.fullscreenElement||i.webkitFullscreenElement||i.mozFullScreenElement||i.msFullscreenElement||i.body}return dn(r)}_getPreviewRect(){return(!this._previewRect||!this._previewRect.width&&!this._previewRect.height)&&(this._previewRect=this._preview?this._preview.getBoundingClientRect():this._initialDomRect),this._previewRect}_nativeDragStart=e=>{if(this._handles.length){let t=this._getTargetHandle(e);t&&!this._disabledHandles.has(t)&&!this.disabled&&e.preventDefault()}else this.disabled||e.preventDefault()};_getTargetHandle(e){return this._handles.find(t=>e.target&&(e.target===t||t.contains(e.target)))}};function VI(n,e,t){return Math.max(e,Math.min(t,n))}function Zs(n){return n.type[0]==="t"}function VF(n){n.preventDefault()}function xu(n,e,t){let r=Tu(e,n.length-1),i=Tu(t,n.length-1);if(r===i)return;let o=n[r],s=i<r?-1:1;for(let a=r;a!==i;a+=s)n[a]=n[a+s];n[i]=o}function zI(n,e,t,r){let i=Tu(t,n.length-1),o=Tu(r,e.length);n.length&&e.splice(o,0,n.splice(i,1)[0])}function Tu(n,e){return Math.max(0,Math.min(e,n))}var Mu=class{_dragDropRegistry;_element;_sortPredicate;_itemPositions=[];_activeDraggables;orientation="vertical";direction;constructor(e){this._dragDropRegistry=e}_previousSwap={drag:null,delta:0,overlaps:!1};start(e){this.withItems(e)}sort(e,t,r,i){let o=this._itemPositions,s=this._getItemIndexFromPointerPosition(e,t,r,i);if(s===-1&&o.length>0)return null;let a=this.orientation==="horizontal",l=o.findIndex(_=>_.drag===e),c=o[s],u=o[l].clientRect,d=c.clientRect,f=l>s?1:-1,h=this._getItemOffsetPx(u,d,f),p=this._getSiblingOffsetPx(l,o,f),g=o.slice();return xu(o,l,s),o.forEach((_,D)=>{if(g[D]===_)return;let M=_.drag===e,A=M?h:p,J=M?e.getPlaceholderElement():_.drag.getRootElement();_.offset+=A;let Pe=Math.round(_.offset*(1/_.drag.scale));a?(J.style.transform=Iu(`translate3d(${Pe}px, 0, 0)`,_.initialTransform),Js(_.clientRect,0,A)):(J.style.transform=Iu(`translate3d(0, ${Pe}px, 0)`,_.initialTransform),Js(_.clientRect,A,0))}),this._previousSwap.overlaps=jm(d,t,r),this._previousSwap.drag=c.drag,this._previousSwap.delta=a?i.x:i.y,{previousIndex:l,currentIndex:s}}enter(e,t,r,i){let o=i==null||i<0?this._getItemIndexFromPointerPosition(e,t,r):i,s=this._activeDraggables,a=s.indexOf(e),l=e.getPlaceholderElement(),c=s[o];if(c===e&&(c=s[o+1]),!c&&(o==null||o===-1||o<s.length-1)&&this._shouldEnterAsFirstChild(t,r)&&(c=s[0]),a>-1&&s.splice(a,1),c&&!this._dragDropRegistry.isDragging(c)){let u=c.getRootElement();u.parentElement.insertBefore(l,u),s.splice(o,0,e)}else this._element.appendChild(l),s.push(e);l.style.transform="",this._cacheItemPositions()}withItems(e){this._activeDraggables=e.slice(),this._cacheItemPositions()}withSortPredicate(e){this._sortPredicate=e}reset(){this._activeDraggables?.forEach(e=>{let t=e.getRootElement();if(t){let r=this._itemPositions.find(i=>i.drag===e)?.initialTransform;t.style.transform=r||""}}),this._itemPositions=[],this._activeDraggables=[],this._previousSwap.drag=null,this._previousSwap.delta=0,this._previousSwap.overlaps=!1}getActiveItemsSnapshot(){return this._activeDraggables}getItemIndex(e){return(this.orientation==="horizontal"&&this.direction==="rtl"?this._itemPositions.slice().reverse():this._itemPositions).findIndex(r=>r.drag===e)}updateOnScroll(e,t){this._itemPositions.forEach(({clientRect:r})=>{Js(r,e,t)}),this._itemPositions.forEach(({drag:r})=>{this._dragDropRegistry.isDragging(r)&&r._sortFromLastPointerPosition()})}withElementContainer(e){this._element=e}_cacheItemPositions(){let e=this.orientation==="horizontal";this._itemPositions=this._activeDraggables.map(t=>{let r=t.getVisibleElement();return{drag:t,offset:0,initialTransform:r.style.transform||"",clientRect:zm(r)}}).sort((t,r)=>e?t.clientRect.left-r.clientRect.left:t.clientRect.top-r.clientRect.top)}_getItemOffsetPx(e,t,r){let i=this.orientation==="horizontal",o=i?t.left-e.left:t.top-e.top;return r===-1&&(o+=i?t.width-e.width:t.height-e.height),o}_getSiblingOffsetPx(e,t,r){let i=this.orientation==="horizontal",o=t[e].clientRect,s=t[e+r*-1],a=o[i?"width":"height"]*r;if(s){let l=i?"left":"top",c=i?"right":"bottom";r===-1?a-=s.clientRect[l]-o[c]:a+=o[l]-s.clientRect[c]}return a}_shouldEnterAsFirstChild(e,t){if(!this._activeDraggables.length)return!1;let r=this._itemPositions,i=this.orientation==="horizontal";if(r[0].drag!==this._activeDraggables[0]){let s=r[r.length-1].clientRect;return i?e>=s.right:t>=s.bottom}else{let s=r[0].clientRect;return i?e<=s.left:t<=s.top}}_getItemIndexFromPointerPosition(e,t,r,i){let o=this.orientation==="horizontal",s=this._itemPositions.findIndex(({drag:a,clientRect:l})=>{if(a===e)return!1;if(i){let c=o?i.x:i.y;if(a===this._previousSwap.drag&&this._previousSwap.overlaps&&c===this._previousSwap.delta)return!1}return o?t>=Math.floor(l.left)&&t<Math.floor(l.right):r>=Math.floor(l.top)&&r<Math.floor(l.bottom)});return s===-1||!this._sortPredicate(s,e)?-1:s}},Um=class{_document;_dragDropRegistry;_element;_sortPredicate;_rootNode;_activeItems;_previousSwap={drag:null,deltaX:0,deltaY:0,overlaps:!1};_relatedNodes=[];constructor(e,t){this._document=e,this._dragDropRegistry=t}start(e){let t=this._element.childNodes;this._relatedNodes=[];for(let r=0;r<t.length;r++){let i=t[r];this._relatedNodes.push([i,i.nextSibling])}this.withItems(e)}sort(e,t,r,i){let o=this._getItemIndexFromPointerPosition(e,t,r),s=this._previousSwap;if(o===-1||this._activeItems[o]===e)return null;let a=this._activeItems[o];if(s.drag===a&&s.overlaps&&s.deltaX===i.x&&s.deltaY===i.y)return null;let l=this.getItemIndex(e),c=e.getPlaceholderElement(),u=a.getRootElement();o>l?u.after(c):u.before(c),xu(this._activeItems,l,o);let d=this._getRootNode().elementFromPoint(t,r);return s.deltaX=i.x,s.deltaY=i.y,s.drag=a,s.overlaps=u===d||u.contains(d),{previousIndex:l,currentIndex:o}}enter(e,t,r,i){let o=i==null||i<0?this._getItemIndexFromPointerPosition(e,t,r):i;o===-1&&(o=this._getClosestItemIndexToPointer(e,t,r));let s=this._activeItems[o],a=this._activeItems.indexOf(e);a>-1&&this._activeItems.splice(a,1),s&&!this._dragDropRegistry.isDragging(s)?(this._activeItems.splice(o,0,e),s.getRootElement().before(e.getPlaceholderElement())):(this._activeItems.push(e),this._element.appendChild(e.getPlaceholderElement()))}withItems(e){this._activeItems=e.slice()}withSortPredicate(e){this._sortPredicate=e}reset(){let e=this._element,t=this._previousSwap;for(let r=this._relatedNodes.length-1;r>-1;r--){let[i,o]=this._relatedNodes[r];i.parentNode===e&&i.nextSibling!==o&&(o===null?e.appendChild(i):o.parentNode===e&&e.insertBefore(i,o))}this._relatedNodes=[],this._activeItems=[],t.drag=null,t.deltaX=t.deltaY=0,t.overlaps=!1}getActiveItemsSnapshot(){return this._activeItems}getItemIndex(e){return this._activeItems.indexOf(e)}updateOnScroll(){this._activeItems.forEach(e=>{this._dragDropRegistry.isDragging(e)&&e._sortFromLastPointerPosition()})}withElementContainer(e){e!==this._element&&(this._element=e,this._rootNode=void 0)}_getItemIndexFromPointerPosition(e,t,r){let i=this._getRootNode().elementFromPoint(Math.floor(t),Math.floor(r)),o=i?this._activeItems.findIndex(s=>{let a=s.getRootElement();return i===a||a.contains(i)}):-1;return o===-1||!this._sortPredicate(o,e)?-1:o}_getRootNode(){return this._rootNode||(this._rootNode=wu(this._element)||this._document),this._rootNode}_getClosestItemIndexToPointer(e,t,r){if(this._activeItems.length===0)return-1;if(this._activeItems.length===1)return 0;let i=1/0,o=-1;for(let s=0;s<this._activeItems.length;s++){let a=this._activeItems[s];if(a!==e){let{x:l,y:c}=a.getRootElement().getBoundingClientRect(),u=Math.hypot(t-l,r-c);u<i&&(i=u,o=s)}}return o}},jI=.05,WI=.05,St=function(n){return n[n.NONE=0]="NONE",n[n.UP=1]="UP",n[n.DOWN=2]="DOWN",n}(St||{}),Qe=function(n){return n[n.NONE=0]="NONE",n[n.LEFT=1]="LEFT",n[n.RIGHT=2]="RIGHT",n}(Qe||{}),$m=class{_dragDropRegistry;_ngZone;_viewportRuler;element;disabled=!1;sortingDisabled=!1;lockAxis;autoScrollDisabled=!1;autoScrollStep=2;enterPredicate=()=>!0;sortPredicate=()=>!0;beforeStarted=new L;entered=new L;exited=new L;dropped=new L;sorted=new L;receivingStarted=new L;receivingStopped=new L;data;_container;_isDragging=!1;_parentPositions;_sortStrategy;_domRect;_draggables=[];_siblings=[];_activeSiblings=new Set;_viewportScrollSubscription=ce.EMPTY;_verticalScrollDirection=St.NONE;_horizontalScrollDirection=Qe.NONE;_scrollNode;_stopScrollTimers=new L;_cachedShadowRoot=null;_document;_scrollableElements=[];_initialScrollSnap;_direction="ltr";constructor(e,t,r,i,o){this._dragDropRegistry=t,this._ngZone=i,this._viewportRuler=o;let s=this.element=dn(e);this._document=r,this.withOrientation("vertical").withElementContainer(s),t.registerDropContainer(this),this._parentPositions=new bu(r)}dispose(){this._stopScrolling(),this._stopScrollTimers.complete(),this._viewportScrollSubscription.unsubscribe(),this.beforeStarted.complete(),this.entered.complete(),this.exited.complete(),this.dropped.complete(),this.sorted.complete(),this.receivingStarted.complete(),this.receivingStopped.complete(),this._activeSiblings.clear(),this._scrollNode=null,this._parentPositions.clear(),this._dragDropRegistry.removeDropContainer(this)}isDragging(){return this._isDragging}start(){this._draggingStarted(),this._notifyReceivingSiblings()}enter(e,t,r,i){this._draggingStarted(),i==null&&this.sortingDisabled&&(i=this._draggables.indexOf(e)),this._sortStrategy.enter(e,t,r,i),this._cacheParentPositions(),this._notifyReceivingSiblings(),this.entered.next({item:e,container:this,currentIndex:this.getItemIndex(e)})}exit(e){this._reset(),this.exited.next({item:e,container:this})}drop(e,t,r,i,o,s,a,l={}){this._reset(),this.dropped.next({item:e,currentIndex:t,previousIndex:r,container:this,previousContainer:i,isPointerOverContainer:o,distance:s,dropPoint:a,event:l})}withItems(e){let t=this._draggables;return this._draggables=e,e.forEach(r=>r._withDropContainer(this)),this.isDragging()&&(t.filter(i=>i.isDragging()).every(i=>e.indexOf(i)===-1)?this._reset():this._sortStrategy.withItems(this._draggables)),this}withDirection(e){return this._direction=e,this._sortStrategy instanceof Mu&&(this._sortStrategy.direction=e),this}connectedTo(e){return this._siblings=e.slice(),this}withOrientation(e){if(e==="mixed")this._sortStrategy=new Um(this._document,this._dragDropRegistry);else{let t=new Mu(this._dragDropRegistry);t.direction=this._direction,t.orientation=e,this._sortStrategy=t}return this._sortStrategy.withElementContainer(this._container),this._sortStrategy.withSortPredicate((t,r)=>this.sortPredicate(t,r,this)),this}withScrollableParents(e){let t=this._container;return this._scrollableElements=e.indexOf(t)===-1?[t,...e]:e.slice(),this}withElementContainer(e){if(e===this._container)return this;let t=dn(this.element),r=this._scrollableElements.indexOf(this._container),i=this._scrollableElements.indexOf(e);return r>-1&&this._scrollableElements.splice(r,1),i>-1&&this._scrollableElements.splice(i,1),this._sortStrategy&&this._sortStrategy.withElementContainer(e),this._cachedShadowRoot=null,this._scrollableElements.unshift(e),this._container=e,this}getScrollableParents(){return this._scrollableElements}getItemIndex(e){return this._isDragging?this._sortStrategy.getItemIndex(e):this._draggables.indexOf(e)}isReceiving(){return this._activeSiblings.size>0}_sortItem(e,t,r,i){if(this.sortingDisabled||!this._domRect||!NI(this._domRect,jI,t,r))return;let o=this._sortStrategy.sort(e,t,r,i);o&&this.sorted.next({previousIndex:o.previousIndex,currentIndex:o.currentIndex,container:this,item:e})}_startScrollingIfNecessary(e,t){if(this.autoScrollDisabled)return;let r,i=St.NONE,o=Qe.NONE;if(this._parentPositions.positions.forEach((s,a)=>{a===this._document||!s.clientRect||r||NI(s.clientRect,jI,e,t)&&([i,o]=jF(a,s.clientRect,this._direction,e,t),(i||o)&&(r=a))}),!i&&!o){let{width:s,height:a}=this._viewportRuler.getViewportSize(),l={width:s,height:a,top:0,right:s,bottom:a,left:0};i=GI(l,t),o=qI(l,e),r=window}r&&(i!==this._verticalScrollDirection||o!==this._horizontalScrollDirection||r!==this._scrollNode)&&(this._verticalScrollDirection=i,this._horizontalScrollDirection=o,this._scrollNode=r,(i||o)&&r?this._ngZone.runOutsideAngular(this._startScrollInterval):this._stopScrolling())}_stopScrolling(){this._stopScrollTimers.next()}_draggingStarted(){let e=this._container.style;this.beforeStarted.next(),this._isDragging=!0,this._initialScrollSnap=e.msScrollSnapType||e.scrollSnapType||"",e.scrollSnapType=e.msScrollSnapType="none",this._sortStrategy.start(this._draggables),this._cacheParentPositions(),this._viewportScrollSubscription.unsubscribe(),this._listenToScrollEvents()}_cacheParentPositions(){this._parentPositions.cache(this._scrollableElements),this._domRect=this._parentPositions.positions.get(this._container).clientRect}_reset(){this._isDragging=!1;let e=this._container.style;e.scrollSnapType=e.msScrollSnapType=this._initialScrollSnap,this._siblings.forEach(t=>t._stopReceiving(this)),this._sortStrategy.reset(),this._stopScrolling(),this._viewportScrollSubscription.unsubscribe(),this._parentPositions.clear()}_startScrollInterval=()=>{this._stopScrolling(),Cd(0,Sa).pipe(mr(this._stopScrollTimers)).subscribe(()=>{let e=this._scrollNode,t=this.autoScrollStep;this._verticalScrollDirection===St.UP?e.scrollBy(0,-t):this._verticalScrollDirection===St.DOWN&&e.scrollBy(0,t),this._horizontalScrollDirection===Qe.LEFT?e.scrollBy(-t,0):this._horizontalScrollDirection===Qe.RIGHT&&e.scrollBy(t,0)})};_isOverContainer(e,t){return this._domRect!=null&&jm(this._domRect,e,t)}_getSiblingContainerFromPosition(e,t,r){return this._siblings.find(i=>i._canReceive(e,t,r))}_canReceive(e,t,r){if(!this._domRect||!jm(this._domRect,t,r)||!this.enterPredicate(e,this))return!1;let i=this._getShadowRoot().elementFromPoint(t,r);return i?i===this._container||this._container.contains(i):!1}_startReceiving(e,t){let r=this._activeSiblings;!r.has(e)&&t.every(i=>this.enterPredicate(i,this)||this._draggables.indexOf(i)>-1)&&(r.add(e),this._cacheParentPositions(),this._listenToScrollEvents(),this.receivingStarted.next({initiator:e,receiver:this,items:t}))}_stopReceiving(e){this._activeSiblings.delete(e),this._viewportScrollSubscription.unsubscribe(),this.receivingStopped.next({initiator:e,receiver:this})}_listenToScrollEvents(){this._viewportScrollSubscription=this._dragDropRegistry.scrolled(this._getShadowRoot()).subscribe(e=>{if(this.isDragging()){let t=this._parentPositions.handleScroll(e);t&&this._sortStrategy.updateOnScroll(t.top,t.left)}else this.isReceiving()&&this._cacheParentPositions()})}_getShadowRoot(){if(!this._cachedShadowRoot){let e=wu(this._container);this._cachedShadowRoot=e||this._document}return this._cachedShadowRoot}_notifyReceivingSiblings(){let e=this._sortStrategy.getActiveItemsSnapshot().filter(t=>t.isDragging());this._siblings.forEach(t=>t._startReceiving(this,e))}};function GI(n,e){let{top:t,bottom:r,height:i}=n,o=i*WI;return e>=t-o&&e<=t+o?St.UP:e>=r-o&&e<=r+o?St.DOWN:St.NONE}function qI(n,e){let{left:t,right:r,width:i}=n,o=i*WI;return e>=t-o&&e<=t+o?Qe.LEFT:e>=r-o&&e<=r+o?Qe.RIGHT:Qe.NONE}function jF(n,e,t,r,i){let o=GI(e,i),s=qI(e,r),a=St.NONE,l=Qe.NONE;if(o){let c=n.scrollTop;o===St.UP?c>0&&(a=St.UP):n.scrollHeight-c>n.clientHeight&&(a=St.DOWN)}if(s){let c=n.scrollLeft;t==="rtl"?s===Qe.RIGHT?c<0&&(l=Qe.RIGHT):n.scrollWidth+c>n.clientWidth&&(l=Qe.LEFT):s===Qe.LEFT?c>0&&(l=Qe.LEFT):n.scrollWidth-c>n.clientWidth&&(l=Qe.RIGHT)}return[a,l]}var Xs={capture:!0},Vm={passive:!1,capture:!0},BF=(()=>{class n{static \u0275fac=function(r){return new(r||n)};static \u0275cmp=vn({type:n,selectors:[["ng-component"]],hostAttrs:["cdk-drag-resets-container",""],decls:0,vars:0,template:function(r,i){},styles:[`@layer cdk-resets{.cdk-drag-preview{background:none;border:none;padding:0;color:inherit;inset:auto}}.cdk-drag-placeholder *,.cdk-drag-preview *{pointer-events:none !important}
`],encapsulation:2,changeDetection:0})}return n})(),KI=(()=>{class n{_ngZone=m(k);_document=m(Me);_styleLoader=m(CI);_renderer=m(Je).createRenderer(null,null);_cleanupDocumentTouchmove;_dropInstances=new Set;_dragInstances=new Set;_activeDragInstances=yn([]);_globalListeners;_draggingPredicate=t=>t.isDragging();_domNodesToDirectives=null;pointerMove=new L;pointerUp=new L;scroll=new L;constructor(){}registerDropContainer(t){this._dropInstances.has(t)||this._dropInstances.add(t)}registerDragItem(t){this._dragInstances.add(t),this._dragInstances.size===1&&this._ngZone.runOutsideAngular(()=>{this._cleanupDocumentTouchmove?.(),this._cleanupDocumentTouchmove=or(this._renderer,this._document,"touchmove",this._persistentTouchmoveListener,Vm)})}removeDropContainer(t){this._dropInstances.delete(t)}removeDragItem(t){this._dragInstances.delete(t),this.stopDragging(t),this._dragInstances.size===0&&this._cleanupDocumentTouchmove?.()}startDragging(t,r){if(!(this._activeDragInstances().indexOf(t)>-1)&&(this._styleLoader.load(BF),this._activeDragInstances.update(i=>[...i,t]),this._activeDragInstances().length===1)){let i=r.type.startsWith("touch"),o=a=>this.pointerUp.next(a),s=[["scroll",a=>this.scroll.next(a),Xs],["selectstart",this._preventDefaultWhileDragging,Vm]];i?s.push(["touchend",o,Xs],["touchcancel",o,Xs]):s.push(["mouseup",o,Xs]),i||s.push(["mousemove",a=>this.pointerMove.next(a),Vm]),this._ngZone.runOutsideAngular(()=>{this._globalListeners=s.map(([a,l,c])=>or(this._renderer,this._document,a,l,c))})}}stopDragging(t){this._activeDragInstances.update(r=>{let i=r.indexOf(t);return i>-1?(r.splice(i,1),[...r]):r}),this._activeDragInstances().length===0&&this._clearGlobalListeners()}isDragging(t){return this._activeDragInstances().indexOf(t)>-1}scrolled(t){let r=[this.scroll];return t&&t!==this._document&&r.push(new G(i=>this._ngZone.runOutsideAngular(()=>{let o=or(this._renderer,t,"scroll",s=>{this._activeDragInstances().length&&i.next(s)},Xs);return()=>{o()}}))),Wt(...r)}registerDirectiveNode(t,r){this._domNodesToDirectives??=new WeakMap,this._domNodesToDirectives.set(t,r)}removeDirectiveNode(t){this._domNodesToDirectives?.delete(t)}getDragDirectiveForNode(t){return this._domNodesToDirectives?.get(t)||null}ngOnDestroy(){this._dragInstances.forEach(t=>this.removeDragItem(t)),this._dropInstances.forEach(t=>this.removeDropContainer(t)),this._domNodesToDirectives=null,this._clearGlobalListeners(),this.pointerMove.complete(),this.pointerUp.complete()}_preventDefaultWhileDragging=t=>{this._activeDragInstances().length>0&&t.preventDefault()};_persistentTouchmoveListener=t=>{this._activeDragInstances().length>0&&(this._activeDragInstances().some(this._draggingPredicate)&&t.preventDefault(),this.pointerMove.next(t))};_clearGlobalListeners(){this._globalListeners?.forEach(t=>t()),this._globalListeners=void 0}static \u0275fac=function(r){return new(r||n)};static \u0275prov=I({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})(),HF={dragStartThreshold:5,pointerDirectionChangeThreshold:5},Gm=(()=>{class n{_document=m(Me);_ngZone=m(k);_viewportRuler=m(bI);_dragDropRegistry=m(KI);_renderer=m(Je).createRenderer(null,null);constructor(){}createDrag(t,r=HF){return new Hm(t,r,this._document,this._ngZone,this._viewportRuler,this._dragDropRegistry,this._renderer)}createDropList(t){return new $m(t,this._dragDropRegistry,this._document,this._ngZone,this._viewportRuler)}static \u0275fac=function(r){return new(r||n)};static \u0275prov=I({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})(),BI=new E("CDK_DRAG_PARENT");var UF=new E("CdkDragHandle");var QI=new E("CDK_DRAG_CONFIG"),YI=new E("CdkDropList"),ZI=(()=>{class n{element=m(kt);dropContainer=m(YI,{optional:!0,skipSelf:!0});_ngZone=m(k);_viewContainerRef=m(Uo);_dir=m(Om,{optional:!0});_changeDetectorRef=m(Nr);_selfHandle=m(UF,{optional:!0,self:!0});_parentDrag=m(BI,{optional:!0,skipSelf:!0});_dragDropRegistry=m(KI);_destroyed=new L;_handles=new pr([]);_previewTemplate;_placeholderTemplate;_dragRef;data;lockAxis;rootElementSelector;boundaryElement;dragStartDelay;freeDragPosition;get disabled(){return this._disabled||!!(this.dropContainer&&this.dropContainer.disabled)}set disabled(t){this._disabled=t,this._dragRef.disabled=this._disabled}_disabled;constrainPosition;previewClass;previewContainer;scale=1;started=new ie;released=new ie;ended=new ie;entered=new ie;exited=new ie;dropped=new ie;moved=new G(t=>{let r=this._dragRef.moved.pipe(oe(i=>({source:this,pointerPosition:i.pointerPosition,event:i.event,delta:i.delta,distance:i.distance}))).subscribe(t);return()=>{r.unsubscribe()}});_injector=m(Ve);constructor(){let t=this.dropContainer,r=m(QI,{optional:!0}),i=m(Gm);this._dragRef=i.createDrag(this.element,{dragStartThreshold:r&&r.dragStartThreshold!=null?r.dragStartThreshold:5,pointerDirectionChangeThreshold:r&&r.pointerDirectionChangeThreshold!=null?r.pointerDirectionChangeThreshold:5,zIndex:r?.zIndex}),this._dragRef.data=this,this._dragDropRegistry.registerDirectiveNode(this.element.nativeElement,this),r&&this._assignDefaults(r),t&&(this._dragRef._withDropContainer(t._dropListRef),t.addItem(this),t._dropListRef.beforeStarted.pipe(mr(this._destroyed)).subscribe(()=>{this._dragRef.scale=this.scale})),this._syncInputs(this._dragRef),this._handleEvents(this._dragRef)}getPlaceholderElement(){return this._dragRef.getPlaceholderElement()}getRootElement(){return this._dragRef.getRootElement()}reset(){this._dragRef.reset()}getFreeDragPosition(){return this._dragRef.getFreeDragPosition()}setFreeDragPosition(t){this._dragRef.setFreeDragPosition(t)}ngAfterViewInit(){Al(()=>{this._updateRootElement(),this._setupHandlesListener(),this._dragRef.scale=this.scale,this.freeDragPosition&&this._dragRef.setFreeDragPosition(this.freeDragPosition)},{injector:this._injector})}ngOnChanges(t){let r=t.rootElementSelector,i=t.freeDragPosition;r&&!r.firstChange&&this._updateRootElement(),this._dragRef.scale=this.scale,i&&!i.firstChange&&this.freeDragPosition&&this._dragRef.setFreeDragPosition(this.freeDragPosition)}ngOnDestroy(){this.dropContainer&&this.dropContainer.removeItem(this),this._dragDropRegistry.removeDirectiveNode(this.element.nativeElement),this._ngZone.runOutsideAngular(()=>{this._handles.complete(),this._destroyed.next(),this._destroyed.complete(),this._dragRef.dispose()})}_addHandle(t){let r=this._handles.getValue();r.push(t),this._handles.next(r)}_removeHandle(t){let r=this._handles.getValue(),i=r.indexOf(t);i>-1&&(r.splice(i,1),this._handles.next(r))}_setPreviewTemplate(t){this._previewTemplate=t}_resetPreviewTemplate(t){t===this._previewTemplate&&(this._previewTemplate=null)}_setPlaceholderTemplate(t){this._placeholderTemplate=t}_resetPlaceholderTemplate(t){t===this._placeholderTemplate&&(this._placeholderTemplate=null)}_updateRootElement(){let t=this.element.nativeElement,r=t;this.rootElementSelector&&(r=t.closest!==void 0?t.closest(this.rootElementSelector):t.parentElement?.closest(this.rootElementSelector)),this._dragRef.withRootElement(r||t)}_getBoundaryElement(){let t=this.boundaryElement;return t?typeof t=="string"?this.element.nativeElement.closest(t):dn(t):null}_syncInputs(t){t.beforeStarted.subscribe(()=>{if(!t.isDragging()){let r=this._dir,i=this.dragStartDelay,o=this._placeholderTemplate?{template:this._placeholderTemplate.templateRef,context:this._placeholderTemplate.data,viewContainer:this._viewContainerRef}:null,s=this._previewTemplate?{template:this._previewTemplate.templateRef,context:this._previewTemplate.data,matchSize:this._previewTemplate.matchSize,viewContainer:this._viewContainerRef}:null;t.disabled=this.disabled,t.lockAxis=this.lockAxis,t.scale=this.scale,t.dragStartDelay=typeof i=="object"&&i?i:Cu(i),t.constrainPosition=this.constrainPosition,t.previewClass=this.previewClass,t.withBoundaryElement(this._getBoundaryElement()).withPlaceholderTemplate(o).withPreviewTemplate(s).withPreviewContainer(this.previewContainer||"global"),r&&t.withDirection(r.value)}}),t.beforeStarted.pipe(go(1)).subscribe(()=>{if(this._parentDrag){t.withParent(this._parentDrag._dragRef);return}let r=this.element.nativeElement.parentElement;for(;r;){let i=this._dragDropRegistry.getDragDirectiveForNode(r);if(i){t.withParent(i._dragRef);break}r=r.parentElement}})}_handleEvents(t){t.started.subscribe(r=>{this.started.emit({source:this,event:r.event}),this._changeDetectorRef.markForCheck()}),t.released.subscribe(r=>{this.released.emit({source:this,event:r.event})}),t.ended.subscribe(r=>{this.ended.emit({source:this,distance:r.distance,dropPoint:r.dropPoint,event:r.event}),this._changeDetectorRef.markForCheck()}),t.entered.subscribe(r=>{this.entered.emit({container:r.container.data,item:this,currentIndex:r.currentIndex})}),t.exited.subscribe(r=>{this.exited.emit({container:r.container.data,item:this})}),t.dropped.subscribe(r=>{this.dropped.emit({previousIndex:r.previousIndex,currentIndex:r.currentIndex,previousContainer:r.previousContainer.data,container:r.container.data,isPointerOverContainer:r.isPointerOverContainer,item:this,distance:r.distance,dropPoint:r.dropPoint,event:r.event})})}_assignDefaults(t){let{lockAxis:r,dragStartDelay:i,constrainPosition:o,previewClass:s,boundaryElement:a,draggingDisabled:l,rootElementSelector:c,previewContainer:u}=t;this.disabled=l??!1,this.dragStartDelay=i||0,r&&(this.lockAxis=r),o&&(this.constrainPosition=o),s&&(this.previewClass=s),a&&(this.boundaryElement=a),c&&(this.rootElementSelector=c),u&&(this.previewContainer=u)}_setupHandlesListener(){this._handles.pipe(Sd(t=>{let r=t.map(i=>i.element);this._selfHandle&&this.rootElementSelector&&r.push(this.element),this._dragRef.withHandles(r)}),Le(t=>Wt(...t.map(r=>r._stateChanges.pipe(yo(r))))),mr(this._destroyed)).subscribe(t=>{let r=this._dragRef,i=t.element.nativeElement;t.disabled?r.disableHandle(i):r.enableHandle(i)})}static \u0275fac=function(r){return new(r||n)};static \u0275dir=We({type:n,selectors:[["","cdkDrag",""]],hostAttrs:[1,"cdk-drag"],hostVars:4,hostBindings:function(r,i){r&2&&en("cdk-drag-disabled",i.disabled)("cdk-drag-dragging",i._dragRef.isDragging())},inputs:{data:[0,"cdkDragData","data"],lockAxis:[0,"cdkDragLockAxis","lockAxis"],rootElementSelector:[0,"cdkDragRootElement","rootElementSelector"],boundaryElement:[0,"cdkDragBoundary","boundaryElement"],dragStartDelay:[0,"cdkDragStartDelay","dragStartDelay"],freeDragPosition:[0,"cdkDragFreeDragPosition","freeDragPosition"],disabled:[2,"cdkDragDisabled","disabled",Gn],constrainPosition:[0,"cdkDragConstrainPosition","constrainPosition"],previewClass:[0,"cdkDragPreviewClass","previewClass"],previewContainer:[0,"cdkDragPreviewContainer","previewContainer"],scale:[2,"cdkDragScale","scale",UD]},outputs:{started:"cdkDragStarted",released:"cdkDragReleased",ended:"cdkDragEnded",entered:"cdkDragEntered",exited:"cdkDragExited",dropped:"cdkDragDropped",moved:"cdkDragMoved"},exportAs:["cdkDrag"],features:[En([{provide:BI,useExisting:n}]),vi]})}return n})(),HI=new E("CdkDropListGroup");var XI=(()=>{class n{element=m(kt);_changeDetectorRef=m(Nr);_scrollDispatcher=m(EI);_dir=m(Om,{optional:!0});_group=m(HI,{optional:!0,skipSelf:!0});_latestSortedRefs;_destroyed=new L;_scrollableParentsResolved;static _dropLists=[];_dropListRef;connectedTo=[];data;orientation;id=m(SI).getId("cdk-drop-list-");lockAxis;get disabled(){return this._disabled||!!this._group&&this._group.disabled}set disabled(t){this._dropListRef.disabled=this._disabled=t}_disabled;sortingDisabled;enterPredicate=()=>!0;sortPredicate=()=>!0;autoScrollDisabled;autoScrollStep;elementContainerSelector;dropped=new ie;entered=new ie;exited=new ie;sorted=new ie;_unsortedItems=new Set;constructor(){let t=m(Gm),r=m(QI,{optional:!0});this._dropListRef=t.createDropList(this.element),this._dropListRef.data=this,r&&this._assignDefaults(r),this._dropListRef.enterPredicate=(i,o)=>this.enterPredicate(i.data,o.data),this._dropListRef.sortPredicate=(i,o,s)=>this.sortPredicate(i,o.data,s.data),this._setupInputSyncSubscription(this._dropListRef),this._handleEvents(this._dropListRef),n._dropLists.push(this),this._group&&this._group._items.add(this)}addItem(t){this._unsortedItems.add(t),this._dropListRef.isDragging()&&this._syncItemsWithRef(this.getSortedItems().map(r=>r._dragRef))}removeItem(t){if(this._unsortedItems.delete(t),this._latestSortedRefs){let r=this._latestSortedRefs.indexOf(t._dragRef);r>-1&&(this._latestSortedRefs.splice(r,1),this._syncItemsWithRef(this._latestSortedRefs))}}getSortedItems(){return Array.from(this._unsortedItems).sort((t,r)=>t._dragRef.getVisibleElement().compareDocumentPosition(r._dragRef.getVisibleElement())&Node.DOCUMENT_POSITION_FOLLOWING?-1:1)}ngOnDestroy(){let t=n._dropLists.indexOf(this);t>-1&&n._dropLists.splice(t,1),this._group&&this._group._items.delete(this),this._latestSortedRefs=void 0,this._unsortedItems.clear(),this._dropListRef.dispose(),this._destroyed.next(),this._destroyed.complete()}_setupInputSyncSubscription(t){this._dir&&this._dir.change.pipe(yo(this._dir.value),mr(this._destroyed)).subscribe(r=>t.withDirection(r)),t.beforeStarted.subscribe(()=>{let r=TI(this.connectedTo).map(i=>{if(typeof i=="string"){let o=n._dropLists.find(s=>s.id===i);return o}return i});if(this._group&&this._group._items.forEach(i=>{r.indexOf(i)===-1&&r.push(i)}),!this._scrollableParentsResolved){let i=this._scrollDispatcher.getAncestorScrollContainers(this.element).map(o=>o.getElementRef().nativeElement);this._dropListRef.withScrollableParents(i),this._scrollableParentsResolved=!0}if(this.elementContainerSelector){let i=this.element.nativeElement.querySelector(this.elementContainerSelector);t.withElementContainer(i)}t.disabled=this.disabled,t.lockAxis=this.lockAxis,t.sortingDisabled=this.sortingDisabled,t.autoScrollDisabled=this.autoScrollDisabled,t.autoScrollStep=Cu(this.autoScrollStep,2),t.connectedTo(r.filter(i=>i&&i!==this).map(i=>i._dropListRef)).withOrientation(this.orientation)})}_handleEvents(t){t.beforeStarted.subscribe(()=>{this._syncItemsWithRef(this.getSortedItems().map(r=>r._dragRef)),this._changeDetectorRef.markForCheck()}),t.entered.subscribe(r=>{this.entered.emit({container:this,item:r.item.data,currentIndex:r.currentIndex})}),t.exited.subscribe(r=>{this.exited.emit({container:this,item:r.item.data}),this._changeDetectorRef.markForCheck()}),t.sorted.subscribe(r=>{this.sorted.emit({previousIndex:r.previousIndex,currentIndex:r.currentIndex,container:this,item:r.item.data})}),t.dropped.subscribe(r=>{this.dropped.emit({previousIndex:r.previousIndex,currentIndex:r.currentIndex,previousContainer:r.previousContainer.data,container:r.container.data,item:r.item.data,isPointerOverContainer:r.isPointerOverContainer,distance:r.distance,dropPoint:r.dropPoint,event:r.event}),this._changeDetectorRef.markForCheck()}),Wt(t.receivingStarted,t.receivingStopped).subscribe(()=>this._changeDetectorRef.markForCheck())}_assignDefaults(t){let{lockAxis:r,draggingDisabled:i,sortingDisabled:o,listAutoScrollDisabled:s,listOrientation:a}=t;this.disabled=i??!1,this.sortingDisabled=o??!1,this.autoScrollDisabled=s??!1,this.orientation=a||"vertical",r&&(this.lockAxis=r)}_syncItemsWithRef(t){this._latestSortedRefs=t,this._dropListRef.withItems(t)}static \u0275fac=function(r){return new(r||n)};static \u0275dir=We({type:n,selectors:[["","cdkDropList",""],["cdk-drop-list"]],hostAttrs:[1,"cdk-drop-list"],hostVars:7,hostBindings:function(r,i){r&2&&(Vl("id",i.id),en("cdk-drop-list-disabled",i.disabled)("cdk-drop-list-dragging",i._dropListRef.isDragging())("cdk-drop-list-receiving",i._dropListRef.isReceiving()))},inputs:{connectedTo:[0,"cdkDropListConnectedTo","connectedTo"],data:[0,"cdkDropListData","data"],orientation:[0,"cdkDropListOrientation","orientation"],id:"id",lockAxis:[0,"cdkDropListLockAxis","lockAxis"],disabled:[2,"cdkDropListDisabled","disabled",Gn],sortingDisabled:[2,"cdkDropListSortingDisabled","sortingDisabled",Gn],enterPredicate:[0,"cdkDropListEnterPredicate","enterPredicate"],sortPredicate:[0,"cdkDropListSortPredicate","sortPredicate"],autoScrollDisabled:[2,"cdkDropListAutoScrollDisabled","autoScrollDisabled",Gn],autoScrollStep:[0,"cdkDropListAutoScrollStep","autoScrollStep"],elementContainerSelector:[0,"cdkDropListElementContainer","elementContainerSelector"]},outputs:{dropped:"cdkDropListDropped",entered:"cdkDropListEntered",exited:"cdkDropListExited",sorted:"cdkDropListSorted"},exportAs:["cdkDropList"],features:[En([{provide:HI,useValue:void 0},{provide:YI,useExisting:n}])]})}return n})();var JI=(()=>{class n{static \u0275fac=function(r){return new(r||n)};static \u0275mod=Ce({type:n});static \u0275inj=we({providers:[Gm],imports:[II]})}return n})();var eS={production:!1};var qm={apiKey:"AIzaSyAlzAyyZ02MwgF52AuZ2scAoOUM9IyLMFc",authDomain:"kanban2-d5e2a.firebaseapp.com",databaseURL:"https://kanban2-d5e2a.firebaseio.com",projectId:"kanban2-d5e2a",storageBucket:"kanban2-d5e2a.firebasestorage.app",messagingSenderId:"457968597991",appId:"1:457968597991:web:a42f246fd5f881c93b5b42"},Km="6Lc9F7ssAAAAAPkiKN9sao2S5nYcMiWAtW99Y6xP";var sr=class n{db=m(Nm);injector=m(Ve);projectsRef;cardlistsRef;cardsRef;tasksRef;constructor(){this.projectsRef=this.db.list("/projects"),this.cardlistsRef=this.db.list("/cardlist",e=>e.orderByChild("order")),this.cardsRef=this.db.list("/cards"),this.tasksRef=this.db.list("/tasks")}stripKey(e){let t=H({},e);return delete t.$key,t}queryList(e,t){return gi(this.injector,()=>this.db.list(e,t).snapshotChanges().pipe(oe(i=>i.map(o=>H({$key:o.payload.key},o.payload.val())))))}snapshotsWithKey(e){return e.snapshotChanges().pipe(oe(t=>t.map(r=>H({$key:r.payload.key},r.payload.val()))))}getProjects(){return this.snapshotsWithKey(this.projectsRef)}addProject(e){return this.projectsRef.push(this.stripKey(e))}getCardLists(){return this.snapshotsWithKey(this.cardlistsRef)}getCardListsById(e){return this.db.object(`/cardlist/${e}`).snapshotChanges().pipe(oe(t=>H({$key:t.payload.key},t.payload.val())))}getCardListsByOrder(e){return this.queryList("/cardlist",t=>t.orderByChild("order").equalTo(e))}getCardListsByProject(e){return this.queryList("/cardlist",t=>t.orderByChild("projectId").equalTo(e))}addCardList(e){return this.cardlistsRef.push(this.stripKey(e))}getCards(){return this.snapshotsWithKey(this.cardsRef)}getCardsByListId(e){return this.queryList("/cards",t=>t.orderByChild("cardListId").equalTo(e)).pipe(oe(t=>t.sort((r,i)=>(r.order??0)-(i.order??0))))}addCard(e){return this.cardsRef.push(this.stripKey(e))}updateCard(e,t){return this.cardsRef.update(e,this.stripKey(t))}getTasks(){return this.snapshotsWithKey(this.tasksRef)}getTasksByCardId(e){return this.queryList("/tasks",t=>t.orderByChild("cardId").equalTo(e))}addTask(e){return this.tasksRef.push(this.stripKey(e))}updateTask(e,t){return this.tasksRef.update(e,this.stripKey(t))}deleteTask(e){return gi(this.injector,()=>this.db.object("/tasks/"+e).remove())}static \u0275fac=function(t){return new(t||n)};static \u0275prov=I({token:n,factory:n.\u0275fac,providedIn:"root"})};var Au=class{$key;name;created_at};var Nu=class{$key;name;projectId;color;order;created_at};var Ru=class{$key;name;description;cardListId;isExpanded;order;created_at};var ku=class{$key;description;isCompleted=!1;cardId;order;created_at};var $F=(n,e)=>e.$key;function zF(n,e){n&1&&wt(0,"i",2)}function WF(n,e){n&1&&wt(0,"i",3)}function GF(n,e){if(n&1){let t=nn();x(0,"input",6),Cn("ngModelChange",function(i){Y(t);let o=P();return Wn(o.editTitle,i)||(o.editTitle=i),Z(i)}),ae("blur",function(){Y(t);let i=P();return Z(i.saveTitle())})("keydown.enter",function(){Y(t);let i=P();return Z(i.saveTitle())})("keydown.escape",function(){Y(t);let i=P();return Z(i.cancelEditTitle())}),O()}if(n&2){let t=P();wn("ngModel",t.editTitle)}}function qF(n,e){if(n&1&&ye(0),n&2){let t=P(2);zn(" ",t.item.name," ")}}function KF(n,e){n&1&&(x(0,"span",8),ye(1,"Click to add title"),O())}function QF(n,e){if(n&1){let t=nn();x(0,"div",7),ae("click",function(){Y(t);let i=P();return Z(i.startEditTitle())})("keydown.enter",function(){Y(t);let i=P();return Z(i.startEditTitle())}),Dn(1,qF,1,1)(2,KF,2,0,"span",8),O()}if(n&2){let t=P();ne(),tn(t.item.name?1:2)}}function YF(n,e){if(n&1){let t=nn();x(0,"textarea",16),Cn("ngModelChange",function(i){Y(t);let o=P(2);return Wn(o.editDesc,i)||(o.editDesc=i),Z(i)}),ae("blur",function(){Y(t);let i=P(2);return Z(i.saveDesc())})("keydown.escape",function(){Y(t);let i=P(2);return Z(i.cancelEditDesc())}),ye(1," "),O()}if(n&2){let t=P(2);wn("ngModel",t.editDesc)}}function ZF(n,e){if(n&1){let t=nn();x(0,"div",17),ae("click",function(){Y(t);let i=P(2);return Z(i.startEditDesc())})("keydown.enter",function(){Y(t);let i=P(2);return Z(i.startEditDesc())}),ye(1),O()}if(n&2){let t=P(2);ne(),zn(" ",t.item.description," ")}}function XF(n,e){if(n&1){let t=nn();x(0,"div",18)(1,"input",19),Cn("ngModelChange",function(i){let o=Y(t).$implicit;return Wn(o.isCompleted,i)||(o.isCompleted=i),Z(i)}),ae("ngModelChange",function(){let i=Y(t).$implicit,o=P(2);return Z(o.changeTaskCompleted(i))}),O(),x(2,"span",20),ye(3),O(),x(4,"span",21),ae("click",function(){let i=Y(t).$implicit,o=P(2);return Z(o.deleteTask(i))})("keydown.enter",function(){let i=Y(t).$implicit,o=P(2);return Z(o.deleteTask(i))}),O()()}if(n&2){let t=e.$implicit;en("completed",t.isCompleted),ne(),wn("ngModel",t.isCompleted),ne(2),$n(t.description)}}function JF(n,e){if(n&1){let t=nn();x(0,"div"),Dn(1,YF,2,1,"textarea",9)(2,ZF,2,1,"div",10),x(3,"div",11),Ci(4,XF,5,4,"div",12,$F),O(),x(6,"div",13)(7,"form",14),ae("submit",function(){Y(t);let i=P();return Z(i.addNewTask())}),x(8,"input",15),Cn("ngModelChange",function(i){Y(t);let o=P();return Wn(o.newtaskdesc,i)||(o.newtaskdesc=i),Z(i)}),O()()()()}if(n&2){let t=P();ne(),tn(t.editingDesc?1:2),ne(3),Ei(t.tasks),ne(4),wn("ngModel",t.newtaskdesc)}}function e1(n,e){if(n&1){let t=nn();x(0,"div",22),ae("click",function(){Y(t);let i=P();return Z(i.hideModal())})("mousedown",function(i){return Y(t),Z(i.stopPropagation())})("keydown.enter",function(){Y(t);let i=P();return Z(i.hideModal())}),O(),x(1,"div",23),ae("mousedown",function(i){return Y(t),Z(i.stopPropagation())}),x(2,"div",24)(3,"div",25)(4,"h4",26),ye(5,"Delete subtask"),O(),x(6,"button",27),ae("click",function(){Y(t);let i=P();return Z(i.hideModal())}),x(7,"span",28),ye(8,"\xD7"),O()()(),x(9,"div",29)(10,"p"),ye(11),O(),x(12,"div",30)(13,"button",31),ae("click",function(){Y(t);let i=P();return Z(i.confirmDeleteTask())}),ye(14,"Delete"),O(),x(15,"button",32),ae("click",function(){Y(t);let i=P();return Z(i.hideModal())}),ye(16,"Cancel"),O()()()()()}if(n&2){let t=P();ne(11),zn('Delete "',t.taskToDelete==null?null:t.taskToDelete.description,'"?')}}var Pu=class n{item;tasks=[];showModal=!1;taskToDelete=null;newtaskdesc="";editingTitle=!1;editTitle="";editingDesc=!1;editDesc="";dataService=m(sr);onEscape(){this.showModal&&this.hideModal()}ngOnInit(){this.dataService.getTasksByCardId(this.item.$key).subscribe(e=>{this.tasks=e})}startEditTitle(){this.editTitle=this.item.name??"",this.editingTitle=!0}saveTitle(){if(!this.editingTitle)return;this.editingTitle=!1;let e=this.editTitle.trim();e&&e!==this.item.name&&(this.item.name=e,this.dataService.updateCard(this.item.$key,this.item))}cancelEditTitle(){this.editingTitle=!1}startEditDesc(){this.editDesc=this.item.description??"",this.editingDesc=!0}saveDesc(){if(!this.editingDesc)return;this.editingDesc=!1;let e=this.editDesc.trim();e!==this.item.description&&(this.item.description=e,this.dataService.updateCard(this.item.$key,this.item))}cancelEditDesc(){this.editingDesc=!1}addNewTask(){let e=new ku;e.cardId=this.item.$key,e.description=this.newtaskdesc,e.isCompleted=!1,e.order=0,e.created_at=new Date().toString(),this.dataService.addTask(e).then(()=>{this.newtaskdesc=""})}deleteTask(e){this.taskToDelete=e,this.showModal=!0}hideModal(){this.showModal=!1,this.taskToDelete=null}confirmDeleteTask(){this.taskToDelete?.$key&&this.dataService.deleteTask(this.taskToDelete.$key),this.hideModal()}changeTaskCompleted(e){this.dataService.updateTask(e.$key,e)}clickCarret(){this.item.isExpanded=!this.item.isExpanded,this.dataService.updateCard(this.item.$key,this.item)}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=vn({type:n,selectors:[["app-card"]],hostBindings:function(t,r){t&1&&ae("keydown.escape",function(){return r.onEscape()},!1,rD)},inputs:{item:"item"},decls:8,vars:5,consts:[[1,"cardTitle"],["tabindex","0","role","button",1,"carret",3,"click","keydown.enter","keydown.space"],[1,"fa","fa-caret-right"],[1,"fa","fa-caret-down"],[1,"edit-input","title-input",3,"ngModel"],["tabindex","0","role","button",1,"titleText"],[1,"edit-input","title-input",3,"ngModelChange","blur","keydown.enter","keydown.escape","ngModel"],["tabindex","0","role","button",1,"titleText",3,"click","keydown.enter"],[1,"placeholder"],["rows","3",1,"edit-input","desc-input",3,"ngModel"],["tabindex","0","role","button",1,"cardDesc"],[1,"tasklist"],[1,"task-item",3,"completed"],[1,"newtask-input"],[3,"submit"],["type","text","id","newtask","placeholder","Add subtask and hit enter","name","newtask",3,"ngModelChange","ngModel"],["rows","3",1,"edit-input","desc-input",3,"ngModelChange","blur","keydown.escape","ngModel"],["tabindex","0","role","button",1,"cardDesc",3,"click","keydown.enter"],[1,"task-item"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"task-text"],["tabindex","0","role","button",1,"task-trash","fa","fa-trash",3,"click","keydown.enter"],["tabindex","0","role","button",1,"modal-backdrop-overlay",3,"click","mousedown","keydown.enter"],[1,"delete-modal-overlay",3,"mousedown"],[1,"create-card-modal"],[1,"modal-header"],[1,"modal-title","pull-left"],["type","button","aria-label","Close",1,"close","pull-right",3,"click"],["aria-hidden","true"],[1,"modal-body",2,"padding","16px"],[1,"modal-actions"],["type","button",1,"btn-delete",3,"click"],["type","button",1,"btn-cancel",3,"click"]],template:function(t,r){t&1&&(x(0,"div",0)(1,"div",1),ae("click",function(){return r.clickCarret()})("keydown.enter",function(){return r.clickCarret()})("keydown.space",function(){return r.clickCarret()}),Dn(2,zF,1,0,"i",2)(3,WF,1,0,"i",3),O(),Dn(4,GF,1,1,"input",4)(5,QF,3,1,"div",5),O(),Dn(6,JF,9,2,"div")(7,e1,17,1)),t&2&&(ne(2),tn(r.item.isExpanded?-1:2),ne(),tn(r.item.isExpanded?3:-1),ne(),tn(r.editingTitle?4:5),ne(2),tn(r.item.isExpanded?6:-1),ne(),tn(r.showModal?7:-1))},dependencies:[Oi,EC,Pi,pp,yc,_C,hs,_p],styles:[".cardTitle[_ngcontent-%COMP%]{display:flex;align-items:center;gap:6px;font-size:.9rem;font-weight:600;color:#172b4d}.carret[_ngcontent-%COMP%]{display:inline-block;cursor:pointer;color:#5e6c84;font-size:.85rem;padding:2px;border-radius:3px}.carret[_ngcontent-%COMP%]:hover{background-color:#091e4214}.titleText[_ngcontent-%COMP%]{flex:1;cursor:pointer;padding:2px 4px;border-radius:4px;line-height:1.3}.titleText[_ngcontent-%COMP%]:hover{background-color:#091e4214}.placeholder[_ngcontent-%COMP%]{color:#b0b8c4;font-style:italic;font-weight:400}.cardDesc[_ngcontent-%COMP%]{margin:6px 0 0 18px;font-size:.82rem;color:#5e6c84;cursor:pointer;padding:3px 5px;border-radius:4px;line-height:1.4}.cardDesc[_ngcontent-%COMP%]:hover{background-color:#091e4214}.edit-input[_ngcontent-%COMP%]{width:100%;padding:5px 7px;border:2px solid #5ba4cf;border-radius:4px;font-size:inherit;font-family:inherit;box-sizing:border-box;outline:none}.title-input[_ngcontent-%COMP%]{font-weight:600}.desc-input[_ngcontent-%COMP%]{resize:vertical;margin-top:6px}.tasklist[_ngcontent-%COMP%]{margin:8px 0 4px 18px}.task-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:6px;padding:3px 0;font-size:.82rem;color:#172b4d}.task-item.completed[_ngcontent-%COMP%] .task-text[_ngcontent-%COMP%]{text-decoration:line-through;color:#b0b8c4}.task-text[_ngcontent-%COMP%]{flex:1}.task-trash[_ngcontent-%COMP%]{color:#b0b8c4;cursor:pointer;font-size:.75rem;padding:2px 4px;border-radius:3px;opacity:0;transition:opacity .15s,color .15s}.task-item[_ngcontent-%COMP%]:hover .task-trash[_ngcontent-%COMP%]{opacity:1}.task-trash[_ngcontent-%COMP%]:hover{color:#e44}.newtask-input[_ngcontent-%COMP%]{margin-top:6px;margin-left:18px}.newtask-input[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{border:none;border-bottom:1px solid #dfe1e6;border-radius:0;font-size:.82rem;padding:4px 2px;background:transparent;width:100%;box-sizing:border-box}.newtask-input[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:focus{border-bottom-color:#5ba4cf;outline:none}.modal-backdrop-overlay[_ngcontent-%COMP%]{position:fixed;inset:0;background:#0006;z-index:100;cursor:default}.delete-modal-overlay[_ngcontent-%COMP%]{position:fixed;inset:0;display:flex;align-items:center;justify-content:center;z-index:101;pointer-events:none;cursor:default}.delete-modal-overlay[_ngcontent-%COMP%] .create-card-modal[_ngcontent-%COMP%]{pointer-events:auto;width:340px;background:#fff;border-radius:12px;box-shadow:0 8px 30px #00000040;overflow:hidden;cursor:default}.modal-header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:12px 16px;background-color:#e44;border-top-left-radius:12px;border-top-right-radius:12px;color:#fff;font-weight:700}.modal-header[_ngcontent-%COMP%] h4[_ngcontent-%COMP%]{margin:0;font-size:.95rem}.modal-header[_ngcontent-%COMP%] .close[_ngcontent-%COMP%]{color:#fff;opacity:.8;font-size:1rem;width:28px;height:28px;border-radius:50%;border:none;background:#fff3;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:background-color .15s}.modal-header[_ngcontent-%COMP%] .close[_ngcontent-%COMP%]:hover{background:#ffffff59;opacity:1}.modal-header[_ngcontent-%COMP%] .close[_ngcontent-%COMP%]:hover{opacity:1}.modal-body[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0 0 12px;color:#172b4d;font-size:.9rem}.modal-actions[_ngcontent-%COMP%]{display:flex;gap:8px}.btn-delete[_ngcontent-%COMP%]{background:#e44;color:#fff;border:none;border-radius:6px;padding:8px 20px;font-weight:600;font-size:.85rem;cursor:pointer;transition:background-color .15s}.btn-delete[_ngcontent-%COMP%]:hover{background:#d33}.btn-cancel[_ngcontent-%COMP%]{background:#f4f5f7;color:#5e6c84;border:none;border-radius:6px;padding:8px 20px;font-weight:600;font-size:.85rem;cursor:pointer;transition:background-color .15s}.btn-cancel[_ngcontent-%COMP%]:hover{background:#ebecf0}"]})};var t1=(n,e)=>e.$key;function n1(n,e){if(n&1&&(x(0,"li",11),wt(1,"app-card",12),O()),n&2){let t=e.$implicit,r=P();Ar("border-left-color",r.item.color),xr("cdkDragData",t),ne(),xr("item",t)}}function r1(n,e){if(n&1){let t=nn();x(0,"div",13),ae("click",function(){Y(t);let i=P();return Z(i.cancelAddCard())})("keydown.enter",function(){Y(t);let i=P();return Z(i.cancelAddCard())}),O(),x(1,"div",14)(2,"div",15)(3,"div",16)(4,"h4",17),ye(5),O(),x(6,"div",18),ae("click",function(){Y(t);let i=P();return Z(i.cancelAddCard())})("keydown.enter",function(){Y(t);let i=P();return Z(i.cancelAddCard())}),wt(7,"i",19),O()(),x(8,"div",20)(9,"div",21)(10,"label",22),ye(11,"Name"),O(),x(12,"input",23),Cn("ngModelChange",function(i){Y(t);let o=P();return Wn(o.cardname,i)||(o.cardname=i),Z(i)}),O()(),x(13,"div",21)(14,"label",24),ye(15,"Description"),O(),x(16,"textarea",25),Cn("ngModelChange",function(i){Y(t);let o=P();return Wn(o.carddescription,i)||(o.carddescription=i),Z(i)}),O()(),x(17,"div",26)(18,"button",27),ae("click",function(){Y(t);let i=P();return Z(i.saveAddCard())}),ye(19,"Create"),O(),x(20,"button",28),ae("click",function(){Y(t);let i=P();return Z(i.cancelAddCard())}),ye(21,"Cancel"),O()()()()()}if(n&2){let t=P();ne(3),Ar("background-color",t.item.color),ne(2),zn("New task - ",t.item.name,""),ne(7),wn("ngModel",t.cardname),ne(4),wn("ngModel",t.carddescription)}}var Ou=class n{item;connectedDropLists=[];cardDropped=new ie;cards=[];toShowAddCard=!1;cardname="";carddescription="";dataService=m(sr);ngOnInit(){this.dataService.getCardsByListId(this.item.$key).subscribe(e=>{this.cards=e})}showAddCard(){this.cardname="",this.carddescription="",this.toShowAddCard=!0}cancelAddCard(){this.toShowAddCard=!1}saveAddCard(){this.addCard(this.cardname,this.carddescription,!0,this.item.$key,0),this.toShowAddCard=!1}addCard(e,t,r,i,o){let s=new Date().toString(),a=new Ru;a.name=e,a.description=t,a.cardListId=i,a.isExpanded=r,a.order=o,a.created_at=s,this.dataService.addCard(a)}onCardDrop(e){e.previousContainer===e.container?xu(e.container.data,e.previousIndex,e.currentIndex):zI(e.previousContainer.data,e.container.data,e.previousIndex,e.currentIndex),this.cards.forEach((t,r)=>{t.cardListId=this.item.$key,t.order=r,this.dataService.updateCard(t.$key,t)})}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=vn({type:n,selectors:[["app-cardlist"]],inputs:{item:"item",connectedDropLists:"connectedDropLists"},outputs:{cardDropped:"cardDropped"},decls:15,vars:10,consts:[["cdkDropList","",1,"column-panel",3,"cdkDropListDropped","id","cdkDropListData","cdkDropListConnectedTo"],[1,"column-header"],[1,"column-header-left"],["aria-hidden","true",1,"fa","fa-circle","column-dot"],[1,"column-title"],[1,"column-count"],["type","button","title","Add card",1,"add-card-btn",3,"click"],[1,"fa","fa-plus"],[1,"card-drop-zone"],[1,"card-list"],["cdkDrag","",1,"card-item",3,"border-left-color","cdkDragData"],["cdkDrag","",1,"card-item",3,"cdkDragData"],[3,"item"],["tabindex","0","role","button",1,"modal-backdrop-overlay",3,"click","keydown.enter"],[1,"modal-overlay"],[1,"create-card-modal"],[1,"modal-header-bar"],[1,"modal-title-text"],["tabindex","0","role","button",1,"modal-close-btn",3,"click","keydown.enter"],[1,"fa","fa-window-close"],[1,"modal-form"],[1,"form-group"],["for","taskname"],["type","text","id","taskname","placeholder","Task name",1,"form-control",3,"ngModelChange","ngModel"],["for","taskdescription"],["id","taskdescription","rows","4","placeholder","Description",1,"form-control",3,"ngModelChange","ngModel"],[1,"modal-actions"],["type","button",1,"btn-create",3,"click"],["type","button",1,"btn-cancel",3,"click"]],template:function(t,r){t&1&&(x(0,"div",0),ae("cdkDropListDropped",function(o){return r.onCardDrop(o)}),x(1,"div",1)(2,"div",2),wt(3,"i",3),x(4,"span",4),ye(5),O(),x(6,"span",5),ye(7),O()(),x(8,"button",6),ae("click",function(){return r.showAddCard()}),wt(9,"i",7),O()(),x(10,"div",8)(11,"ul",9),Ci(12,n1,2,4,"li",10,t1),O()()(),Dn(14,r1,22,5)),t&2&&(xr("id",r.item.$key)("cdkDropListData",r.cards)("cdkDropListConnectedTo",r.connectedDropLists),ne(),Ar("border-top-color",r.item.color),ne(2),Ar("color",r.item.color),ne(2),$n(r.item.name),ne(2),$n(r.cards.length),ne(5),Ei(r.cards),ne(2),tn(r.toShowAddCard?14:-1))},dependencies:[Oi,Pi,yc,hs,XI,ZI,Pu],styles:[".column-panel[_ngcontent-%COMP%]{background:#ebecf0;border-radius:12px;max-height:calc(100vh - 140px);display:flex;flex-direction:column}.column-header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:10px 12px 6px;border-top:3px solid #ccc;border-radius:12px 12px 0 0}.column-header-left[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px}.column-dot[_ngcontent-%COMP%]{font-size:.55rem}.column-title[_ngcontent-%COMP%]{font-weight:700;font-size:.95rem;color:#172b4d}.column-count[_ngcontent-%COMP%]{background:#091e4214;color:#5e6c84;border-radius:10px;padding:1px 8px;font-size:.75rem;font-weight:600}.add-card-btn[_ngcontent-%COMP%]{background:none;border:none;color:#5e6c84;cursor:pointer;padding:4px 8px;border-radius:6px;font-size:.85rem;transition:background-color .15s,color .15s}.add-card-btn[_ngcontent-%COMP%]:hover{background-color:#091e4214;color:#172b4d}.card-drop-zone[_ngcontent-%COMP%]{flex:1;overflow-y:auto;padding:4px 8px 8px;min-height:60px}.card-list[_ngcontent-%COMP%]{list-style:none;margin:0;padding:0}.card-item[_ngcontent-%COMP%]{background:#fff;border-radius:8px;border-left-width:4px;border-left-style:solid;padding:8px 10px;margin-bottom:8px;cursor:grab;box-shadow:0 1px 2px #091e421a;transition:box-shadow .15s}.card-item[_ngcontent-%COMP%]:hover{box-shadow:0 4px 12px #091e4226}.modal-backdrop-overlay[_ngcontent-%COMP%]{position:fixed;inset:0;background:#0006;z-index:100}.modal-overlay[_ngcontent-%COMP%]{position:fixed;inset:0;display:flex;align-items:center;justify-content:center;z-index:101;pointer-events:none}.create-card-modal[_ngcontent-%COMP%]{background:#fff;border-radius:12px;width:400px;max-width:90vw;box-shadow:0 8px 30px #0003;overflow:hidden;pointer-events:auto}.modal-header-bar[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:14px 16px;color:#fff}.modal-title-text[_ngcontent-%COMP%]{font-size:1rem;font-weight:600;margin:0}.modal-close-btn[_ngcontent-%COMP%]{cursor:pointer;opacity:.85;font-size:1.1rem}.modal-close-btn[_ngcontent-%COMP%]:hover{opacity:1}.modal-form[_ngcontent-%COMP%]{padding:16px}.modal-form[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{font-size:.8rem;font-weight:600;color:#5e6c84;display:block;margin-bottom:4px}.modal-form[_ngcontent-%COMP%] .form-control[_ngcontent-%COMP%]{border:2px solid #dfe1e6;border-radius:6px;font-size:.9rem;padding:8px 10px;transition:border-color .15s}.modal-form[_ngcontent-%COMP%] .form-control[_ngcontent-%COMP%]:focus{border-color:#5ba4cf;box-shadow:0 0 0 1px #5ba4cf;outline:none}.modal-form[_ngcontent-%COMP%] .form-group[_ngcontent-%COMP%] + .form-group[_ngcontent-%COMP%]{margin-top:12px}.modal-actions[_ngcontent-%COMP%]{display:flex;gap:8px;margin-top:16px}.btn-create[_ngcontent-%COMP%]{background:#5ba4cf;color:#fff;border:none;border-radius:6px;padding:8px 20px;font-weight:600;font-size:.85rem;cursor:pointer;transition:background-color .15s}.btn-create[_ngcontent-%COMP%]:hover{background:#4a93be}.btn-cancel[_ngcontent-%COMP%]{background:#f4f5f7;color:#5e6c84;border:none;border-radius:6px;padding:8px 20px;font-weight:600;font-size:.85rem;cursor:pointer;transition:background-color .15s}.btn-cancel[_ngcontent-%COMP%]:hover{background:#ebecf0}.cdk-drop-list-receiving[_ngcontent-%COMP%] .card-drop-zone[_ngcontent-%COMP%]{background-color:#5ba4cf1a;border:2px dashed rgba(91,164,207,.5);border-radius:6px}.cdk-drag-preview[_ngcontent-%COMP%]{opacity:.9;box-shadow:0 8px 25px #0003;border-radius:8px}.cdk-drag-placeholder[_ngcontent-%COMP%]{opacity:.2;border:2px dashed #dfe1e6;border-radius:8px;background:#f4f5f7}.cdk-drag-animating[_ngcontent-%COMP%], .cdk-drop-list-dragging[_ngcontent-%COMP%] .cdk-drag[_ngcontent-%COMP%]{transition:transform .2s cubic-bezier(0,0,.2,1)}"]})};var i1=(n,e)=>e.$key;function o1(n,e){if(n&1&&(x(0,"div",2),wt(1,"app-cardlist",3),O()),n&2){let t=e.$implicit,r=P();ne(),xr("item",t)("connectedDropLists",r.getConnectedDropLists(t.$key))}}var Fu=class n{title="The Kanban Board";projects=[];cardlists=[];dataService=m(sr);ngOnInit(){this.dataService.getProjects().subscribe(e=>{this.projects=e}),this.dataService.getCardLists().subscribe(e=>this.cardlists=e),this.dataService.getCards(),this.dataService.getTasks()}addProject(e){let t=new Date().toString(),r=new Au;r.name=e,r.created_at=t,this.dataService.addProject(r)}getConnectedDropLists(e){return this.cardlists.filter(t=>t.$key!==e).map(t=>t.$key)}addCardList(e,t,r,i){let o=new Date().toString(),s=new Nu;s.name=e,s.projectId=t,s.color=r,s.order=i,s.created_at=o,this.dataService.addCardList(s)}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=vn({type:n,selectors:[["app-root"]],decls:6,vars:1,consts:[[1,"container","board-header"],[1,"container","board"],[1,"board-col"],[3,"item","connectedDropLists"]],template:function(t,r){t&1&&(x(0,"div",0)(1,"h1"),ye(2),O()(),x(3,"div",1),Ci(4,o1,2,2,"div",2,i1),O()),t&2&&(ne(2),$n(r.title),ne(2),Ei(r.cardlists))},dependencies:[Ou],styles:["[_nghost-%COMP%]{display:block;height:100%}.board-header[_ngcontent-%COMP%]{padding:16px 0 12px;border-bottom:3px solid #5ba4cf;margin-bottom:0}.board-header[_ngcontent-%COMP%] h1[_ngcontent-%COMP%]{font-size:1.4rem;font-weight:600;color:#172b4d;margin:0}.board[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:16px;padding:20px 0;overflow-x:auto;height:calc(100% - 60px)}.board-col[_ngcontent-%COMP%]{flex:0 0 320px;max-height:100%}"]})};eS.production&&void 0;if(aa().length===0){let n=w_(qm);Km&&xp(n,{provider:new Tc(Km),isTokenAutoRefreshEnabled:!0})}Rh(Fu,{providers:[Lf(eC,Oi,IC,NC.initializeApp(qm),vI,JI)]}).catch(n=>console.error(n));