text: (window.webpackJsonp=window.webpackJsonp||[]).push([[4],{"/6Yf":function(t,e,n){"use strict";n.d(e,"a",(function(){return o})),n.d(e,"b",(function(){return a})),n.d(e,"c",(function(){return s}));var r=n("O1h7"),i=n("qOnz"),o=function(){function t(t,e,n){this.name=t,this.instanceFactory=e,this.type=n,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY"}return t.prototype.setInstantiationMode=function(t){return this.instantiationMode=t,this},t.prototype.setMultipleInstances=function(t){return this.multipleInstances=t,this},t.prototype.setServiceProps=function(t){return this.serviceProps=t,this},t}(),s=function(){function t(t,e){this.name=t,this.container=e,this.component=null,this.instances=new Map,this.instancesDeferred=new Map}return t.prototype.get=function(t){void 0===t&&(t="[DEFAULT]");var e=this.normalizeInstanceIdentifier(t);if(!this.instancesDeferred.has(e)){var n=new i.a;this.instancesDeferred.set(e,n);try{var r=this.getOrInitializeService(e);r&&n.resolve(r)}catch(o){}}return this.instancesDeferred.get(e).promise},t.prototype.getImmediate=function(t){var e=Object(r.a)({identifier:"[DEFAULT]",optional:!1},t),n=e.optional,i=this.normalizeInstanceIdentifier(e.identifier);try{var o=this.getOrInitializeService(i);if(!o){if(n)return null;throw Error("Service "+this.name+" is not available")}return o}catch(s){if(n)return null;throw s}},t.prototype.getComponent=function(){return this.component},t.prototype.setComponent=function(t){var e,n;if(t.name!==this.name)throw Error("Mismatching Component "+t.name+" for Provider "+this.name+".");if(this.component)throw Error("Component for "+this.name+" has already been provided");if(this.component=t,function(t){return"EAGER"===t.instantiationMode}(t))try{this.getOrInitializeService("[DEFAULT]")}catch(l){}try{for(var i=Object(r.i)(this.instancesDeferred.entries()),o=i.next();!o.done;o=i.next()){var s=Object(r.f)(o.value,2),a=s[1],u=this.normalizeInstanceIdentifier(s[0]);try{var c=this.getOrInitializeService(u);a.resolve(c)}catch(l){}}}catch(h){e={error:h}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}},t.prototype.clearInstance=function(t){void 0===t&&(t="[DEFAULT]"),this.instancesDeferred.delete(t),this.instances.delete(t)},t.prototype.delete=function(){return Object(r.b)(this,void 0,void 0,(function(){var t;return Object(r.e)(this,(function(e){switch(e.label){case 0:return t=Array.from(this.instances.values()),[4,Promise.all(Object(r.g)(t.filter((function(t){return"INTERNAL"in t})).map((function(t){return t.INTERNAL.delete()})),t.filter((function(t){return"_delete"in t})).map((function(t){return t._delete()}))))];case 1:return e.sent(),[2]}}))}))},t.prototype.isComponentSet=function(){return null!=this.component},t.prototype.getOrInitializeService=function(t){var e=this.instances.get(t);return!e&&this.component&&(e=this.component.instanceFactory(this.container,function(t){return"[DEFAULT]"===t?void 0:t}(t)),this.instances.set(t,e)),e||null},t.prototype.normalizeInstanceIdentifier=function(t){return this.component?this.component.multipleInstances?t:"[DEFAULT]":t},t}(),a=function(){function t(t){this.name=t,this.providers=new Map}return t.prototype.addComponent=function(t){var e=this.getProvider(t.name);if(e.isComponentSet())throw new Error("Component "+t.name+" has already been registered with "+this.name);e.setComponent(t)},t.prototype.addOrOverwriteComponent=function(t){this.getProvider(t.name).isComponentSet()&&this.providers.delete(t.name),this.addComponent(t)},t.prototype.getProvider=function(t){if(this.providers.has(t))return this.providers.get(t);var e=new s(t,this);return this.providers.set(t,e),e},t.prototype.getProviders=function(){return Array.from(this.providers.values())},t}()},"/uUt":function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n("7o/Q");function i(t,e){return n=>n.lift(new o(t,e))}class o{constructor(t,e){this.compare=t,this.keySelector=e}call(t,e){return e.subscribe(new s(t,this.compare,this.keySelector))}}class s extends r.a{constructor(t,e,n){super(t),this.keySelector=n,this.hasKey=!1,"function"==typeof e&&(this.compare=e)}compare(t,e){return t===e}_next(t){let e;try{const{keySelector:n}=this;e=n?n(t):t}catch(r){return this.destination.error(r)}let n=!1;if(this.hasKey)try{const{compare:t}=this;n=t(this.key,e)}catch(r){return this.destination.error(r)}else this.hasKey=!0;n||(this.key=e,this.destination.next(t))}}},0:function(t,e,n){t.exports=n("zUnb")},"0EUg":function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n("bHdf");function i(){return Object(r.a)(1)}},"2QA8":function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));const r=(()=>"function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random())()},"2Vo4":function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n("XNiG"),i=n("9ppp");class o extends r.a{constructor(t){super(),this._value=t}get value(){return this.getValue()}_subscribe(t){const e=super._subscribe(t);return e&&!e.closed&&t.next(this._value),e}getValue(){if(this.hasError)throw this.thrownError;if(this.closed)throw new i.a;return this._value}next(t){super.next(this._value=t)}}},"2fFW":function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));let r=!1;const i={Promise:void 0,set useDeprecatedSynchronousErrorHandling(t){if(t){const t=new Error;console.warn("DEPRECATED! RxJS was set to use deprecated synchronous error handling behavior by code at: \n"+t.stack)}else r&&console.log("RxJS: Back to a better error behavior. Thank you. <3");r=t},get useDeprecatedSynchronousErrorHandling(){return r}}},"39oe":function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));const r=t=>{try{if(t instanceof class{constructor(t){this.value=t}})return t.value;if(!s()||"string"!=typeof t||""===t)return t;const e=document.createDocumentFragment(),n=document.createElement("div");e.appendChild(n),n.innerHTML=t,u.forEach(t=>{const n=e.querySelectorAll(t);for(let r=n.length-1;r>=0;r--){const t=n[r];t.parentNode?t.parentNode.removeChild(t):e.removeChild(t);const s=o(t);for(let e=0;e<s.length;e++)i(s[e])}});const r=o(e);for(let t=0;t<r.length;t++)i(r[t]);const a=document.createElement("div");a.appendChild(e);const c=a.querySelector("div");return null!==c?c.innerHTML:a.innerHTML}catch(e){return console.error(e),""}},i=t=>{if(t.nodeType&&1!==t.nodeType)return;for(let n=t.attributes.length-1;n>=0;n--){const e=t.attributes.item(n),r=e.name;if(!a.includes(r.toLowerCase())){t.removeAttribute(r);continue}const i=e.value;null!=i&&i.toLowerCase().includes("javascript:")&&t.removeAttribute(r)}const e=o(t);for(let n=0;n<e.length;n++)i(e[n])},o=t=>null!=t.children?t.children:t.childNodes,s=()=>{const t=window,e=t&&t.Ionic&&t.Ionic.config;return!e||(e.get?e.get("sanitizerEnabled",!0):!0===e.sanitizerEnabled||void 0===e.sanitizerEnabled)},a=["class","id","href","src","name","slot"],u=["script","style","iframe","meta","link","object","embed"]},"3N8a":function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n("quSY");class i extends r.a{constructor(t,e){super()}schedule(t,e=0){return this}}class o extends i{constructor(t,e){super(t,e),this.scheduler=t,this.work=e,this.pending=!1}schedule(t,e=0){if(this.closed)return this;this.state=t;const n=this.id,r=this.scheduler;return null!=n&&(this.id=this.recycleAsyncId(r,n,e)),this.pending=!0,this.delay=e,this.id=this.id||this.requestAsyncId(r,this.id,e),this}requestAsyncId(t,e,n=0){return setInterval(t.flush.bind(t,this),n)}recycleAsyncId(t,e,n=0){if(null!==n&&this.delay===n&&!1===this.pending)return e;clearInterval(e)}execute(t,e){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;const n=this._execute(t,e);if(n)return n;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))}_execute(t,e){let n=!1,r=void 0;try{this.work(t)}catch(i){n=!0,r=!!i&&i||new Error(i)}if(n)return this.unsubscribe(),r}_unsubscribe(){const t=this.id,e=this.scheduler,n=e.actions,r=n.indexOf(this);this.work=null,this.state=null,this.pending=!1,this.scheduler=null,-1!==r&&n.splice(r,1),null!=t&&(this.id=this.recycleAsyncId(e,t,null)),this.delay=null}}},"3Pt+":function(t,e,n){"use strict";n.d(e,"a",(function(){return z})),n.d(e,"b",(function(){return l})),n.d(e,"c",(function(){return g})),n.d(e,"d",(function(){return y})),n.d(e,"e",(function(){return q})),n.d(e,"f",(function(){return H}));var r=n("fXoL"),i=(n("ofXK"),n("HDdC")),o=n("DH7j"),s=n("lJxs"),a=n("XoHu"),u=n("Cfvw");function c(t,e){return new i.a(n=>{const r=t.length;if(0===r)return void n.complete();const i=new Array(r);let o=0,s=0;for(let a=0;a<r;a++){const c=Object(u.a)(t[a]);let l=!1;n.add(c.subscribe({next:t=>{l||(l=!0,s++),i[a]=t},error:t=>n.error(t),complete:()=>{o++,o!==r&&l||(s===r&&n.next(e?e.reduce((t,e,n)=>(t[e]=i[n],t),{}):i),n.complete())}}))}})}const l=new r.q("NgValueAccessor");let h=(()=>{class t{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}reset(t){this.control&&this.control.reset(t)}hasError(t,e){return!!this.control&&this.control.hasError(t,e)}getError(t,e){return this.control?this.control.getError(t,e):null}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275dir=r.Cb({type:t}),t})(),d=(()=>{class t extends h{get formDirective(){return null}get path(){return null}}return t.\u0275fac=function(e){return f(e||t)},t.\u0275dir=r.Cb({type:t,features:[r.vb]}),t})();const f=r.Lb(d);function p(){throw new Error("unimplemented")}class g extends h{constructor(){super(...arguments),this._parent=null,this.name=null,this.valueAccessor=null,this._rawValidators=[],this._rawAsyncValidators=[]}get validator(){return p()}get asyncValidator(){return p()}}let y=(()=>{class t extends class{constructor(t){this._cd=t}get ngClassUntouched(){return!!this._cd.control&&this._cd.control.untouched}get ngClassTouched(){return!!this._cd.control&&this._cd.control.touched}get ngClassPristine(){return!!this._cd.control&&this._cd.control.pristine}get ngClassDirty(){return!!this._cd.control&&this._cd.control.dirty}get ngClassValid(){return!!this._cd.control&&this._cd.control.valid}get ngClassInvalid(){return!!this._cd.control&&this._cd.control.invalid}get ngClassPending(){return!!this._cd.control&&this._cd.control.pending}}{constructor(t){super(t)}}return t.\u0275fac=function(e){return new(e||t)(r.Hb(d,2))},t.\u0275dir=r.Cb({type:t,selectors:[["","formGroupName",""],["","formArrayName",""],["","ngModelGroup",""],["","formGroup",""],["form",3,"ngNoForm",""],["","ngForm",""]],hostVars:14,hostBindings:function(t,e){2&t&&r.zb("ng-untouched",e.ngClassUntouched)("ng-touched",e.ngClassTouched)("ng-pristine",e.ngClassPristine)("ng-dirty",e.ngClassDirty)("ng-valid",e.ngClassValid)("ng-invalid",e.ngClassInvalid)("ng-pending",e.ngClassPending)},features:[r.vb]}),t})();function v(t){return null==t||0===t.length}function m(t){return null!=t&&"number"==typeof t.length}const b=new r.q("NgValidators"),_=new r.q("NgAsyncValidators"),w=/^(?=.{1,254}$)(?=.{1,64}@)[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+)*@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;class E{static min(t){return e=>{if(v(e.value)||v(t))return null;const n=parseFloat(e.value);return!isNaN(n)&&n<t?{min:{min:t,actual:e.value}}:null}}static max(t){return e=>{if(v(e.value)||v(t))return null;const n=parseFloat(e.value);return!isNaN(n)&&n>t?{max:{max:t,actual:e.value}}:null}}static required(t){return v(t.value)?{required:!0}:null}static requiredTrue(t){return!0===t.value?null:{required:!0}}static email(t){return v(t.value)||w.test(t.value)?null:{email:!0}}static minLength(t){return e=>v(e.value)||!m(e.value)?null:e.value.length<t?{minlength:{requiredLength:t,actualLength:e.value.length}}:null}static maxLength(t){return e=>m(e.value)&&e.value.length>t?{maxlength:{requiredLength:t,actualLength:e.value.length}}:null}static pattern(t){if(!t)return E.nullValidator;let e,n;return"string"==typeof t?(n="","^"!==t.charAt(0)&&(n+="^"),n+=t,"$"!==t.charAt(t.length-1)&&(n+="$"),e=new RegExp(n)):(n=t.toString(),e=t),t=>{if(v(t.value))return null;const r=t.value;return e.test(r)?null:{pattern:{requiredPattern:n,actualValue:r}}}}static nullValidator(t){return null}static compose(t){if(!t)return null;const e=t.filter(O);return 0==e.length?null:function(t){return T(S(t,e))}}static composeAsync(t){if(!t)return null;const e=t.filter(O);return 0==e.length?null:function(t){return function(...t){if(1===t.length){const e=t[0];if(Object(o.a)(e))return c(e,null);if(Object(a.a)(e)&&Object.getPrototypeOf(e)===Object.prototype){const t=Object.keys(e);return c(t.map(t=>e[t]),t)}}if("function"==typeof t[t.length-1]){const e=t.pop();return c(t=1===t.length&&Object(o.a)(t[0])?t[0]:t,null).pipe(Object(s.a)(t=>e(...t)))}return c(t,null)}(S(t,e).map(C)).pipe(Object(s.a)(T))}}}function O(t){return null!=t}function C(t){const e=Object(r.qb)(t)?Object(u.a)(t):t;if(!Object(r.pb)(e))throw new Error("Expected validator to return Promise or Observable.");return e}function T(t){let e={};return t.forEach(t=>{e=null!=t?Object.assign(Object.assign({},e),t):e}),0===Object.keys(e).length?null:e}function S(t,e){return e.map(e=>e(t))}function I(t){return t.map(t=>function(t){return!t.validate}(t)?t:e=>t.validate(e))}let j=(()=>{class t{constructor(){this._accessors=[]}add(t,e){this._accessors.push([t,e])}remove(t){for(let e=this._accessors.length-1;e>=0;--e)if(this._accessors[e][1]===t)return void this._accessors.splice(e,1)}select(t){this._accessors.forEach(e=>{this._isSameGroup(e,t)&&e[1]!==t&&e[1].fireUncheck(t.value)})}_isSameGroup(t,e){return!!t[0].control&&t[0]._parent===e._control._parent&&t[1].name===e.name}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=r.Db({token:t,factory:t.\u0275fac}),t})();function x(t,e){t._pendingDirty&&t.markAsDirty(),t.setValue(t._pendingValue,{emitModelToViewChange:!1}),e.viewToModelUpdate(t._pendingValue),t._pendingChange=!1}function A(t,e){let n;throw n=t.path.length>1?`path: '${t.path.join(" -> ")}'`:t.path[0]?`name: '${t.path}'`:"unspecified name attribute",new Error(`${e} ${n}`)}function k(t){return null!=t?E.compose(I(t)):null}function N(t){return null!=t?E.composeAsync(I(t)):null}function R(t){const e=D(t)?t.validators:t;return Array.isArray(e)?k(e):e||null}function P(t,e){const n=D(e)?e.asyncValidators:t;return Array.isArray(n)?N(n):n||null}function D(t){return null!=t&&!Array.isArray(t)&&"object"==typeof t}class L{constructor(t,e){this.validator=t,this.asyncValidator=e,this._onCollectionChange=()=>{},this.pristine=!0,this.touched=!1,this._onDisabledChange=[]}get parent(){return this._parent}get valid(){return"VALID"===this.status}get invalid(){return"INVALID"===this.status}get pending(){return"PENDING"==this.status}get disabled(){return"DISABLED"===this.status}get enabled(){return"DISABLED"!==this.status}get dirty(){return!this.pristine}get untouched(){return!this.touched}get updateOn(){return this._updateOn?this._updateOn:this.parent?this.parent.updateOn:"change"}setValidators(t){this.validator=R(t)}setAsyncValidators(t){this.asyncValidator=P(t)}clearValidators(){this.validator=null}clearAsyncValidators(){this.asyncValidator=null}markAsTouched(t={}){this.touched=!0,this._parent&&!t.onlySelf&&this._parent.markAsTouched(t)}markAllAsTouched(){this.markAsTouched({onlySelf:!0}),this._forEachChild(t=>t.markAllAsTouched())}markAsUntouched(t={}){this.touched=!1,this._pendingTouched=!1,this._forEachChild(t=>{t.markAsUntouched({onlySelf:!0})}),this._parent&&!t.onlySelf&&this._parent._updateTouched(t)}markAsDirty(t={}){this.pristine=!1,this._parent&&!t.onlySelf&&this._parent.markAsDirty(t)}markAsPristine(t={}){this.pristine=!0,this._pendingDirty=!1,this._forEachChild(t=>{t.markAsPristine({onlySelf:!0})}),this._parent&&!t.onlySelf&&this._parent._updatePristine(t)}markAsPending(t={}){this.status="PENDING",!1!==t.emitEvent&&this.statusChanges.emit(this.status),this._parent&&!t.onlySelf&&this._parent.markAsPending(t)}disable(t={}){const e=this._parentMarkedDirty(t.onlySelf);this.status="DISABLED",this.errors=null,this._forEachChild(e=>{e.disable(Object.assign(Object.assign({},t),{onlySelf:!0}))}),this._updateValue(),!1!==t.emitEvent&&(this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._updateAncestors(Object.assign(Object.assign({},t),{skipPristineCheck:e})),this._onDisabledChange.forEach(t=>t(!0))}enable(t={}){const e=this._parentMarkedDirty(t.onlySelf);this.status="VALID",this._forEachChild(e=>{e.enable(Object.assign(Object.assign({},t),{onlySelf:!0}))}),this.updateValueAndValidity({onlySelf:!0,emitEvent:t.emitEvent}),this._updateAncestors(Object.assign(Object.assign({},t),{skipPristineCheck:e})),this._onDisabledChange.forEach(t=>t(!1))}_updateAncestors(t){this._parent&&!t.onlySelf&&(this._parent.updateValueAndValidity(t),t.skipPristineCheck||this._parent._updatePristine(),this._parent._updateTouched())}setParent(t){this._parent=t}updateValueAndValidity(t={}){this._setInitialStatus(),this._updateValue(),this.enabled&&(this._cancelExistingSubscription(),this.errors=this._runValidator(),this.status=this._calculateStatus(),"VALID"!==this.status&&"PENDING"!==this.status||this._runAsyncValidator(t.emitEvent)),!1!==t.emitEvent&&(this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._parent&&!t.onlySelf&&this._parent.updateValueAndValidity(t)}_updateTreeValidity(t={emitEvent:!0}){this._forEachChild(e=>e._updateTreeValidity(t)),this.updateValueAndValidity({onlySelf:!0,emitEvent:t.emitEvent})}_setInitialStatus(){this.status=this._allControlsDisabled()?"DISABLED":"VALID"}_runValidator(){return this.validator?this.validator(this):null}_runAsyncValidator(t){if(this.asyncValidator){this.status="PENDING";const e=C(this.asyncValidator(this));this._asyncValidationSubscription=e.subscribe(e=>this.setErrors(e,{emitEvent:t}))}}_cancelExistingSubscription(){this._asyncValidationSubscription&&this._asyncValidationSubscription.unsubscribe()}setErrors(t,e={}){this.errors=t,this._updateControlsErrors(!1!==e.emitEvent)}get(t){return function(t,e,n){if(null==e)return null;if(Array.isArray(e)||(e=e.split(".")),Array.isArray(e)&&0===e.length)return null;let r=t;return e.forEach(t=>{r=r instanceof F?r.controls.hasOwnProperty(t)?r.controls[t]:null:r instanceof U&&r.at(t)||null}),r}(this,t)}getError(t,e){const n=e?this.get(e):this;return n&&n.errors?n.errors[t]:null}hasError(t,e){return!!this.getError(t,e)}get root(){let t=this;for(;t._parent;)t=t._parent;return t}_updateControlsErrors(t){this.status=this._calculateStatus(),t&&this.statusChanges.emit(this.status),this._parent&&this._parent._updateControlsErrors(t)}_initObservables(){this.valueChanges=new r.n,this.statusChanges=new r.n}_calculateStatus(){return this._allControlsDisabled()?"DISABLED":this.errors?"INVALID":this._anyControlsHaveStatus("PENDING")?"PENDING":this._anyControlsHaveStatus("INVALID")?"INVALID":"VALID"}_anyControlsHaveStatus(t){return this._anyControls(e=>e.status===t)}_anyControlsDirty(){return this._anyControls(t=>t.dirty)}_anyControlsTouched(){return this._anyControls(t=>t.touched)}_updatePristine(t={}){this.pristine=!this._anyControlsDirty(),this._parent&&!t.onlySelf&&this._parent._updatePristine(t)}_updateTouched(t={}){this.touched=this._anyControlsTouched(),this._parent&&!t.onlySelf&&this._parent._updateTouched(t)}_isBoxedValue(t){return"object"==typeof t&&null!==t&&2===Object.keys(t).length&&"value"in t&&"disabled"in t}_registerOnCollectionChange(t){this._onCollectionChange=t}_setUpdateStrategy(t){D(t)&&null!=t.updateOn&&(this._updateOn=t.updateOn)}_parentMarkedDirty(t){return!t&&this._parent&&this._parent.dirty&&!this._parent._anyControlsDirty()}}class M extends L{constructor(t=null,e,n){super(R(e),P(n,e)),this._onChange=[],this._applyFormState(t),this._setUpdateStrategy(e),this.updateValueAndValidity({onlySelf:!0,emitEvent:!1}),this._initObservables()}setValue(t,e={}){this.value=this._pendingValue=t,this._onChange.length&&!1!==e.emitModelToViewChange&&this._onChange.forEach(t=>t(this.value,!1!==e.emitViewToModelChange)),this.updateValueAndValidity(e)}patchValue(t,e={}){this.setValue(t,e)}reset(t=null,e={}){this._applyFormState(t),this.markAsPristine(e),this.markAsUntouched(e),this.setValue(this.value,e),this._pendingChange=!1}_updateValue(){}_anyControls(t){return!1}_allControlsDisabled(){return this.disabled}registerOnChange(t){this._onChange.push(t)}_clearChangeFns(){this._onChange=[],this._onDisabledChange=[],this._onCollectionChange=()=>{}}registerOnDisabledChange(t){this._onDisabledChange.push(t)}_forEachChild(t){}_syncPendingControls(){return!("submit"!==this.updateOn||(this._pendingDirty&&this.markAsDirty(),this._pendingTouched&&this.markAsTouched(),!this._pendingChange)||(this.setValue(this._pendingValue,{onlySelf:!0,emitModelToViewChange:!1}),0))}_applyFormState(t){this._isBoxedValue(t)?(this.value=this._pendingValue=t.value,t.disabled?this.disable({onlySelf:!0,emitEvent:!1}):this.enable({onlySelf:!0,emitEvent:!1})):this.value=this._pendingValue=t}}class F extends L{constructor(t,e,n){super(R(e),P(n,e)),this.controls=t,this._initObservables(),this._setUpdateStrategy(e),this._setUpControls(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!1})}registerControl(t,e){return this.controls[t]?this.controls[t]:(this.controls[t]=e,e.setParent(this),e._registerOnCollectionChange(this._onCollectionChange),e)}addControl(t,e){this.registerControl(t,e),this.updateValueAndValidity(),this._onCollectionChange()}removeControl(t){this.controls[t]&&this.controls[t]._registerOnCollectionChange(()=>{}),delete this.controls[t],this.updateValueAndValidity(),this._onCollectionChange()}setControl(t,e){this.controls[t]&&this.controls[t]._registerOnCollectionChange(()=>{}),delete this.controls[t],e&&this.registerControl(t,e),this.updateValueAndValidity(),this._onCollectionChange()}contains(t){return this.controls.hasOwnProperty(t)&&this.controls[t].enabled}setValue(t,e={}){this._checkAllValuesPresent(t),Object.keys(t).forEach(n=>{this._throwIfControlMissing(n),this.controls[n].setValue(t[n],{onlySelf:!0,emitEvent:e.emitEvent})}),this.updateValueAndValidity(e)}patchValue(t,e={}){Object.keys(t).forEach(n=>{this.controls[n]&&this.controls[n].patchValue(t[n],{onlySelf:!0,emitEvent:e.emitEvent})}),this.updateValueAndValidity(e)}reset(t={},e={}){this._forEachChild((n,r)=>{n.reset(t[r],{onlySelf:!0,emitEvent:e.emitEvent})}),this._updatePristine(e),this._updateTouched(e),this.updateValueAndValidity(e)}getRawValue(){return this._reduceChildren({},(t,e,n)=>(t[n]=e instanceof M?e.value:e.getRawValue(),t))}_syncPendingControls(){let t=this._reduceChildren(!1,(t,e)=>!!e._syncPendingControls()||t);return t&&this.updateValueAndValidity({onlySelf:!0}),t}_throwIfControlMissing(t){if(!Object.keys(this.controls).length)throw new Error("\n        There are no form controls registered with this group yet.  If you're using ngModel,\n        you may want to check next tick (e.g. use setTimeout).\n      ");if(!this.controls[t])throw new Error(`Cannot find form control with name: ${t}.`)}_forEachChild(t){Object.keys(this.controls).forEach(e=>t(this.controls[e],e))}_setUpControls(){this._forEachChild(t=>{t.setParent(this),t._registerOnCollectionChange(this._onCollectionChange)})}_updateValue(){this.value=this._reduceValue()}_anyControls(t){for(const e of Object.keys(this.controls)){const n=this.controls[e];if(this.contains(e)&&t(n))return!0}return!1}_reduceValue(){return this._reduceChildren({},(t,e,n)=>((e.enabled||this.disabled)&&(t[n]=e.value),t))}_reduceChildren(t,e){let n=t;return this._forEachChild((t,r)=>{n=e(n,t,r)}),n}_allControlsDisabled(){for(const t of Object.keys(this.controls))if(this.controls[t].enabled)return!1;return Object.keys(this.controls).length>0||this.disabled}_checkAllValuesPresent(t){this._forEachChild((e,n)=>{if(void 0===t[n])throw new Error(`Must supply a value for form control with name: '${n}'.`)})}}class U extends L{constructor(t,e,n){super(R(e),P(n,e)),this.controls=t,this._initObservables(),this._setUpdateStrategy(e),this._setUpControls(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!1})}at(t){return this.controls[t]}push(t){this.controls.push(t),this._registerControl(t),this.updateValueAndValidity(),this._onCollectionChange()}insert(t,e){this.controls.splice(t,0,e),this._registerControl(e),this.updateValueAndValidity()}removeAt(t){this.controls[t]&&this.controls[t]._registerOnCollectionChange(()=>{}),this.controls.splice(t,1),this.updateValueAndValidity()}setControl(t,e){this.controls[t]&&this.controls[t]._registerOnCollectionChange(()=>{}),this.controls.splice(t,1),e&&(this.controls.splice(t,0,e),this._registerControl(e)),this.updateValueAndValidity(),this._onCollectionChange()}get length(){return this.controls.length}setValue(t,e={}){this._checkAllValuesPresent(t),t.forEach((t,n)=>{this._throwIfControlMissing(n),this.at(n).setValue(t,{onlySelf:!0,emitEvent:e.emitEvent})}),this.updateValueAndValidity(e)}patchValue(t,e={}){t.forEach((t,n)=>{this.at(n)&&this.at(n).patchValue(t,{onlySelf:!0,emitEvent:e.emitEvent})}),this.updateValueAndValidity(e)}reset(t=[],e={}){this._forEachChild((n,r)=>{n.reset(t[r],{onlySelf:!0,emitEvent:e.emitEvent})}),this._updatePristine(e),this._updateTouched(e),this.updateValueAndValidity(e)}getRawValue(){return this.controls.map(t=>t instanceof M?t.value:t.getRawValue())}clear(){this.controls.length<1||(this._forEachChild(t=>t._registerOnCollectionChange(()=>{})),this.controls.splice(0),this.updateValueAndValidity())}_syncPendingControls(){let t=this.controls.reduce((t,e)=>!!e._syncPendingControls()||t,!1);return t&&this.updateValueAndValidity({onlySelf:!0}),t}_throwIfControlMissing(t){if(!this.controls.length)throw new Error("\n        There are no form controls registered with this array yet.  If you're using ngModel,\n        you may want to check next tick (e.g. use setTimeout).\n      ");if(!this.at(t))throw new Error("Cannot find form control at index "+t)}_forEachChild(t){this.controls.forEach((e,n)=>{t(e,n)})}_updateValue(){this.value=this.controls.filter(t=>t.enabled||this.disabled).map(t=>t.value)}_anyControls(t){return this.controls.some(e=>e.enabled&&t(e))}_setUpControls(){this._forEachChild(t=>this._registerControl(t))}_checkAllValuesPresent(t){this._forEachChild((e,n)=>{if(void 0===t[n])throw new Error(`Must supply a value for form control at index: ${n}.`)})}_allControlsDisabled(){for(const t of this.controls)if(t.enabled)return!1;return this.controls.length>0||this.disabled}_registerControl(t){t.setParent(this),t._registerOnCollectionChange(this._onCollectionChange)}}const $={provide:d,useExisting:Object(r.T)(()=>q)},V=(()=>Promise.resolve(null))();let q=(()=>{class t extends d{constructor(t,e){super(),this.submitted=!1,this._directives=[],this.ngSubmit=new r.n,this.form=new F({},k(t),N(e))}ngAfterViewInit(){this._setUpdateStrategy()}get formDirective(){return this}get control(){return this.form}get path(){return[]}get controls(){return this.form.controls}addControl(t){V.then(()=>{const e=this._findContainer(t.path);t.control=e.registerControl(t.name,t.control),function(t,e){t||A(e,"Cannot find control with"),e.valueAccessor||A(e,"No value accessor for form control with"),t.validator=E.compose([t.validator,e.validator]),t.asyncValidator=E.composeAsync([t.asyncValidator,e.asyncValidator]),e.valueAccessor.writeValue(t.value),function(t,e){e.valueAccessor.registerOnChange(n=>{t._pendingValue=n,t._pendingChange=!0,t._pendingDirty=!0,"change"===t.updateOn&&x(t,e)})}(t,e),function(t,e){t.registerOnChange((t,n)=>{e.valueAccessor.writeValue(t),n&&e.viewToModelUpdate(t)})}(t,e),function(t,e){e.valueAccessor.registerOnTouched(()=>{t._pendingTouched=!0,"blur"===t.updateOn&&t._pendingChange&&x(t,e),"submit"!==t.updateOn&&t.markAsTouched()})}(t,e),e.valueAccessor.setDisabledState&&t.registerOnDisabledChange(t=>{e.valueAccessor.setDisabledState(t)}),e._rawValidators.forEach(e=>{e.registerOnValidatorChange&&e.registerOnValidatorChange(()=>t.updateValueAndValidity())}),e._rawAsyncValidators.forEach(e=>{e.registerOnValidatorChange&&e.registerOnValidatorChange(()=>t.updateValueAndValidity())})}(t.control,t),t.control.updateValueAndValidity({emitEvent:!1}),this._directives.push(t)})}getControl(t){return this.form.get(t.path)}removeControl(t){V.then(()=>{const e=this._findContainer(t.path);e&&e.removeControl(t.name),function(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}(this._directives,t)})}addFormGroup(t){V.then(()=>{const e=this._findContainer(t.path),n=new F({});(function(t,e){null==t&&A(e,"Cannot find control with"),t.validator=E.compose([t.validator,e.validator]),t.asyncValidator=E.composeAsync([t.asyncValidator,e.asyncValidator])})(n,t),e.registerControl(t.name,n),n.updateValueAndValidity({emitEvent:!1})})}removeFormGroup(t){V.then(()=>{const e=this._findContainer(t.path);e&&e.removeControl(t.name)})}getFormGroup(t){return this.form.get(t.path)}updateModel(t,e){V.then(()=>{this.form.get(t.path).setValue(e)})}setValue(t){this.control.setValue(t)}onSubmit(t){return this.submitted=!0,e=this._directives,this.form._syncPendingControls(),e.forEach(t=>{const e=t.control;"submit"===e.updateOn&&e._pendingChange&&(t.viewToModelUpdate(e._pendingValue),e._pendingChange=!1)}),this.ngSubmit.emit(t),!1;var e}onReset(){this.resetForm()}resetForm(t){this.form.reset(t),this.submitted=!1}_setUpdateStrategy(){this.options&&null!=this.options.updateOn&&(this.form._updateOn=this.options.updateOn)}_findContainer(t){return t.pop(),t.length?this.form.get(t):this.form}}return t.\u0275fac=function(e){return new(e||t)(r.Hb(b,10),r.Hb(_,10))},t.\u0275dir=r.Cb({type:t,selectors:[["form",3,"ngNoForm","",3,"formGroup",""],["ng-form"],["","ngForm",""]],hostBindings:function(t,e){1&t&&r.Rb("submit",(function(t){return e.onSubmit(t)}))("reset",(function(){return e.onReset()}))},inputs:{options:["ngFormOptions","options"]},outputs:{ngSubmit:"ngSubmit"},exportAs:["ngForm"],features:[r.xb([$]),r.vb]}),t})(),H=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275dir=r.Cb({type:t,selectors:[["form",3,"ngNoForm","",3,"ngNativeValidate",""]],hostAttrs:["novalidate",""]}),t})(),B=(()=>{class t{}return t.\u0275mod=r.Fb({type:t}),t.\u0275inj=r.Eb({factory:function(e){return new(e||t)}}),t})(),z=(()=>{class t{}return t.\u0275mod=r.Fb({type:t}),t.\u0275inj=r.Eb({factory:function(e){return new(e||t)},providers:[j],imports:[B]}),t})()},"3UD+":function(t,e){t.exports=function(t){if(!t.webpackPolyfill){var e=Object.create(t);e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),Object.defineProperty(e,"exports",{enumerable:!0}),e.webpackPolyfill=1}return e}},"4I5i":function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));const r=(()=>{function t(){return Error.call(this),this.message="argument out of range",this.name="ArgumentOutOfRangeError",this}return t.prototype=Object.create(Error.prototype),t})()},"5+tZ":function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var r=n("ZUHj"),i=n("l7GE"),o=n("51Dv"),s=n("lJxs"),a=n("Cfvw");function u(t,e,n=Number.POSITIVE_INFINITY){return"function"==typeof e?r=>r.pipe(u((n,r)=>Object(a.a)(t(n,r)).pipe(Object(s.a)((t,i)=>e(n,t,r,i))),n)):("number"==typeof e&&(n=e),e=>e.lift(new c(t,n)))}class c{constructor(t,e=Number.POSITIVE_INFINITY){this.project=t,this.concurrent=e}call(t,e){return e.subscribe(new l(t,this.project,this.concurrent))}}class l extends i.a{constructor(t,e,n=Number.POSITIVE_INFINITY){super(t),this.project=e,this.concurrent=n,this.hasCompleted=!1,this.buffer=[],this.active=0,this.index=0}_next(t){this.active<this.concurrent?this._tryNext(t):this.buffer.push(t)}_tryNext(t){let e;const n=this.index++;try{e=this.project(t,n)}catch(r){return void this.destination.error(r)}this.active++,this._innerSub(e,t,n)}_innerSub(t,e,n){const i=new o.a(this,e,n),s=this.destination;s.add(i);const a=Object(r.a)(this,t,void 0,void 0,i);a!==i&&s.add(a)}_complete(){this.hasCompleted=!0,0===this.active&&0===this.buffer.length&&this.destination.complete(),this.unsubscribe()}notifyNext(t,e,n,r,i){this.destination.next(e)}notifyComplete(t){const e=this.buffer;this.remove(t),this.active--,e.length>0?this._next(e.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()}}},"51Dv":function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n("7o/Q");class i extends r.a{constructor(t,e,n){super(),this.parent=t,this.outerValue=e,this.outerIndex=n,this.index=0}_next(t){this.parent.notifyNext(this.outerValue,t,this.outerIndex,this.index++,this)}_error(t){this.parent.notifyError(t,this),this.unsubscribe()}_complete(){this.parent.notifyComplete(this),this.unsubscribe()}}},"6Uf2":function(t,e,n){"use strict";(function(t){var e,r=n("zIRd"),i=n("O1h7"),o=n("qOnz"),s=n("q/0M"),a=n("/6Yf"),u=function(){function t(t){this.domStorage_=t,this.prefix_="firebase:"}return t.prototype.set=function(t,e){null==e?this.domStorage_.removeItem(this.prefixedName_(t)):this.domStorage_.setItem(this.prefixedName_(t),Object(o.G)(e))},t.prototype.get=function(t){var e=this.domStorage_.getItem(this.prefixedName_(t));return null==e?null:Object(o.A)(e)},t.prototype.remove=function(t){this.domStorage_.removeItem(this.prefixedName_(t))},t.prototype.prefixedName_=function(t){return this.prefix_+t},t.prototype.toString=function(){return this.domStorage_.toString()},t}(),c=function(){function t(){this.cache_={},this.isInMemoryStorage=!0}return t.prototype.set=function(t,e){null==e?delete this.cache_[t]:this.cache_[t]=e},t.prototype.get=function(t){return Object(o.i)(this.cache_,t)?this.cache_[t]:null},t.prototype.remove=function(t){delete this.cache_[t]},t}(),l=function(t){try{if("undefined"!=typeof window&&void 0!==window[t]){var e=window[t];return e.setItem("firebase:sentinel","cache"),e.removeItem("firebase:sentinel"),new u(e)}}catch(n){}return new c},h=l("localStorage"),d=l("sessionStorage"),f=new s.b("@firebase/database"),p=(e=1,function(){return e++}),g=function(t){var e=Object(o.F)(t),n=new o.d;n.update(e);var r=n.digest();return o.g.encodeByteArray(r)},y=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var n="",r=0;r<t.length;r++){var i=t[r];Array.isArray(i)||i&&"object"==typeof i&&"number"==typeof i.length?n+=y.apply(null,i):n+="object"==typeof i?Object(o.G)(i):i,n+=" "}return n},v=null,m=!0,b=function(t,e){Object(o.e)(!e||!0===t||!1===t,"Can't turn on custom loggers persistently."),!0===t?(f.logLevel=s.a.VERBOSE,v=f.log.bind(f),e&&d.set("logging_enabled",!0)):"function"==typeof t?v=t:(v=null,d.remove("logging_enabled"))},_=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(!0===m&&(m=!1,null===v&&!0===d.get("logging_enabled")&&b(!0)),v){var n=y.apply(null,t);v(n)}},w=function(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];_.apply(void 0,Object(i.g)([t],e))}},E=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n="FIREBASE INTERNAL ERROR: "+y.apply(void 0,Object(i.g)(t));f.error(n)},O=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n="FIREBASE FATAL ERROR: "+y.apply(void 0,Object(i.g)(t));throw f.error(n),new Error(n)},C=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n="FIREBASE WARNING: "+y.apply(void 0,Object(i.g)(t));f.warn(n)},T=function(t){return"number"==typeof t&&(t!=t||t===Number.POSITIVE_INFINITY||t===Number.NEGATIVE_INFINITY)},S="[MIN_NAME]",I="[MAX_NAME]",j=function(t,e){if(t===e)return 0;if(t===S||e===I)return-1;if(e===S||t===I)return 1;var n=W(t),r=W(e);return null!==n?null!==r?n-r==0?t.length-e.length:n-r:-1:null!==r?1:t<e?-1:1},x=function(t,e){return t===e?0:t<e?-1:1},A=function(t,e){if(e&&t in e)return e[t];throw new Error("Missing required key ("+t+") in object: "+Object(o.G)(e))},k=function(t){if("object"!=typeof t||null===t)return Object(o.G)(t);var e=[];for(var n in t)e.push(n);e.sort();for(var r="{",i=0;i<e.length;i++)0!==i&&(r+=","),r+=Object(o.G)(e[i]),r+=":",r+=k(t[e[i]]);return r+"}"},N=function(t,e){var n=t.length;if(n<=e)return[t];for(var r=[],i=0;i<n;i+=e)r.push(t.substring(i,i+e>n?n:i+e));return r};function R(t,e){for(var n in t)t.hasOwnProperty(n)&&e(n,t[n])}var P,D,L,M,F,U,$,V,q,H,B=function(t){var e,n,r,i,s;Object(o.e)(!T(t),"Invalid JSON number"),0===t?(n=0,r=0,e=1/t==-1/0?1:0):(e=t<0,(t=Math.abs(t))>=Math.pow(2,-1022)?(n=(i=Math.min(Math.floor(Math.log(t)/Math.LN2),1023))+1023,r=Math.round(t*Math.pow(2,52-i)-Math.pow(2,52))):(n=0,r=Math.round(t/Math.pow(2,-1074))));var a=[];for(s=52;s;s-=1)a.push(r%2?1:0),r=Math.floor(r/2);for(s=11;s;s-=1)a.push(n%2?1:0),n=Math.floor(n/2);a.push(e?1:0),a.reverse();var u=a.join(""),c="";for(s=0;s<64;s+=8){var l=parseInt(u.substr(s,8),2).toString(16);1===l.length&&(l="0"+l),c+=l}return c.toLowerCase()},z=new RegExp("^-?(0*)\\d{1,10}$"),W=function(t){if(z.test(t)){var e=Number(t);if(e>=-2147483648&&e<=2147483647)return e}return null},G=function(t){try{t()}catch(e){setTimeout((function(){throw C("Exception was thrown by user callback.",e.stack||""),e}),Math.floor(0))}},Q=function(t,e){var n=setTimeout(t,e);return"object"==typeof n&&n.unref&&n.unref(),n},K=function(){function t(t,e){if(void 0===e){this.pieces_=t.split("/");for(var n=0,r=0;r<this.pieces_.length;r++)this.pieces_[r].length>0&&(this.pieces_[n]=this.pieces_[r],n++);this.pieces_.length=n,this.pieceNum_=0}else this.pieces_=t,this.pieceNum_=e}return Object.defineProperty(t,"Empty",{get:function(){return new t("")},enumerable:!1,configurable:!0}),t.prototype.getFront=function(){return this.pieceNum_>=this.pieces_.length?null:this.pieces_[this.pieceNum_]},t.prototype.getLength=function(){return this.pieces_.length-this.pieceNum_},t.prototype.popFront=function(){var e=this.pieceNum_;return e<this.pieces_.length&&e++,new t(this.pieces_,e)},t.prototype.getBack=function(){return this.pieceNum_<this.pieces_.length?this.pieces_[this.pieces_.length-1]:null},t.prototype.toString=function(){for(var t="",e=this.pieceNum_;e<this.pieces_.length;e++)""!==this.pieces_[e]&&(t+="/"+this.pieces_[e]);return t||"/"},t.prototype.toUrlEncodedString=function(){for(var t="",e=this.pieceNum_;e<this.pieces_.length;e++)""!==this.pieces_[e]&&(t+="/"+encodeURIComponent(String(this.pieces_[e])));return t||"/"},t.prototype.slice=function(t){return void 0===t&&(t=0),this.pieces_.slice(this.pieceNum_+t)},t.prototype.parent=function(){if(this.pieceNum_>=this.pieces_.length)return null;for(var e=[],n=this.pieceNum_;n<this.pieces_.length-1;n++)e.push(this.pieces_[n]);return new t(e,0)},t.prototype.child=function(e){for(var n=[],r=this.pieceNum_;r<this.pieces_.length;r++)n.push(this.pieces_[r]);if(e instanceof t)for(r=e.pieceNum_;r<e.pieces_.length;r++)n.push(e.pieces_[r]);else{var i=e.split("/");for(r=0;r<i.length;r++)i[r].length>0&&n.push(i[r])}return new t(n,0)},t.prototype.isEmpty=function(){return this.pieceNum_>=this.pieces_.length},t.relativePath=function(e,n){var r=e.getFront(),i=n.getFront();if(null===r)return n;if(r===i)return t.relativePath(e.popFront(),n.popFront());throw new Error("INTERNAL ERROR: innerPath ("+n+") is not within outerPath ("+e+")")},t.comparePaths=function(t,e){for(var n=t.slice(),r=e.slice(),i=0;i<n.length&&i<r.length;i++){var o=j(n[i],r[i]);if(0!==o)return o}return n.length===r.length?0:n.length<r.length?-1:1},t.prototype.equals=function(t){if(this.getLength()!==t.getLength())return!1;for(var e=this.pieceNum_,n=t.pieceNum_;e<=this.pieces_.length;e++,n++)if(this.pieces_[e]!==t.pieces_[n])return!1;return!0},t.prototype.contains=function(t){var e=this.pieceNum_,n=t.pieceNum_;if(this.getLength()>t.getLength())return!1;for(;e<this.pieces_.length;){if(this.pieces_[e]!==t.pieces_[n])return!1;++e,++n}return!0},t}(),X=function(){function t(t,e){this.errorPrefix_=e,this.parts_=t.slice(),this.byteLength_=Math.max(1,this.parts_.length);for(var n=0;n<this.parts_.length;n++)this.byteLength_+=Object(o.E)(this.parts_[n]);this.checkValid_()}return Object.defineProperty(t,"MAX_PATH_DEPTH",{get:function(){return 32},enumerable:!1,configurable:!0}),Object.defineProperty(t,"MAX_PATH_LENGTH_BYTES",{get:function(){return 768},enumerable:!1,configurable:!0}),t.prototype.push=function(t){this.parts_.length>0&&(this.byteLength_+=1),this.parts_.push(t),this.byteLength_+=Object(o.E)(t),this.checkValid_()},t.prototype.pop=function(){var t=this.parts_.pop();this.byteLength_-=Object(o.E)(t),this.parts_.length>0&&(this.byteLength_-=1)},t.prototype.checkValid_=function(){if(this.byteLength_>t.MAX_PATH_LENGTH_BYTES)throw new Error(this.errorPrefix_+"has a key path longer than "+t.MAX_PATH_LENGTH_BYTES+" bytes ("+this.byteLength_+").");if(this.parts_.length>t.MAX_PATH_DEPTH)throw new Error(this.errorPrefix_+"path specified exceeds the maximum depth that can be written ("+t.MAX_PATH_DEPTH+") or object contains a cycle "+this.toErrorString())},t.prototype.toErrorString=function(){return 0===this.parts_.length?"":"in property '"+this.parts_.join(".")+"'"},t}(),Y=function(){function t(t,e,n,r,i,o,s){void 0===i&&(i=!1),void 0===o&&(o=""),void 0===s&&(s=!1),this.secure=e,this.namespace=n,this.webSocketOnly=r,this.nodeAdmin=i,this.persistenceKey=o,this.includeNamespaceInQueryParams=s,this.host=t.toLowerCase(),this.domain=this.host.substr(this.host.indexOf(".")+1),this.internalHost=h.get("host:"+t)||this.host}return t.prototype.needsQueryParam=function(){return this.host!==this.internalHost||this.isCustomHost()||this.includeNamespaceInQueryParams},t.prototype.isCacheableHost=function(){return"s-"===this.internalHost.substr(0,2)},t.prototype.isDemoHost=function(){return"firebaseio-demo.com"===this.domain},t.prototype.isCustomHost=function(){return"firebaseio.com"!==this.domain&&"firebaseio-demo.com"!==this.domain},t.prototype.updateHost=function(t){t!==this.internalHost&&(this.internalHost=t,this.isCacheableHost()&&h.set("host:"+this.host,this.internalHost))},t.prototype.connectionURL=function(t,e){var n;if(Object(o.e)("string"==typeof t,"typeof type must == string"),Object(o.e)("object"==typeof e,"typeof params must == object"),"websocket"===t)n=(this.secure?"wss://":"ws://")+this.internalHost+"/.ws?";else{if("long_polling"!==t)throw new Error("Unknown connection type: "+t);n=(this.secure?"https://":"http://")+this.internalHost+"/.lp?"}this.needsQueryParam()&&(e.ns=this.namespace);var r=[];return R(e,(function(t,e){r.push(t+"="+e)})),n+r.join("&")},t.prototype.toString=function(){var t=this.toURLString();return this.persistenceKey&&(t+="<"+this.persistenceKey+">"),t},t.prototype.toURLString=function(){return(this.secure?"https://":"http://")+this.host},t}(),J=function(t,e){var n=Z(t),r=n.namespace;return"firebase.com"===n.domain&&O(n.host+" is no longer supported. Please use <YOUR FIREBASE>.firebaseio.com instead"),r&&"undefined"!==r||"localhost"===n.domain||O("Cannot parse Firebase url. Please use https://<YOUR FIREBASE>.firebaseio.com"),n.secure||"undefined"!=typeof window&&window.location&&window.location.protocol&&-1!==window.location.protocol.indexOf("https:")&&C("Insecure Firebase access from a secure page. Please use https in calls to new Firebase()."),{repoInfo:new Y(n.host,n.secure,r,e,"ws"===n.scheme||"wss"===n.scheme,"",r!==n.subdomain),path:new K(n.pathString)}},Z=function(t){var e="",n="",r="",o="",s="",a=!0,u="https",c=443;if("string"==typeof t){var l=t.indexOf("//");l>=0&&(u=t.substring(0,l-1),t=t.substring(l+2));var h=t.indexOf("/");-1===h&&(h=t.length);var d=t.indexOf("?");-1===d&&(d=t.length),e=t.substring(0,Math.min(h,d)),h<d&&(o=function(t){for(var e="",n=t.split("/"),r=0;r<n.length;r++)if(n[r].length>0){var i=n[r];try{i=decodeURIComponent(i.replace(/\+/g," "))}catch(o){}e+="/"+i}return e}(t.substring(h,d)));var f=function(t){var e,n,r={};"?"===t.charAt(0)&&(t=t.substring(1));try{for(var o=Object(i.i)(t.split("&")),s=o.next();!s.done;s=o.next()){var a=s.value;if(0!==a.length){var u=a.split("=");2===u.length?r[decodeURIComponent(u[0])]=decodeURIComponent(u[1]):C("Invalid query segment '"+a+"' in query '"+t+"'")}}}catch(c){e={error:c}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}return r}(t.substring(Math.min(t.length,d)));(l=e.indexOf(":"))>=0?(a="https"===u||"wss"===u,c=parseInt(e.substring(l+1),10)):l=e.length;var p=e.slice(0,l);if("localhost"===p.toLowerCase())n="localhost";else if(p.split(".").length<=2)n=p;else{var g=e.indexOf(".");r=e.substring(0,g).toLowerCase(),n=e.substring(g+1),s=r}"ns"in f&&(s=f.ns)}return{host:e,port:c,domain:n,subdomain:r,secure:a,scheme:u,pathString:o,namespace:s}},tt=/[\[\].#$\/\u0000-\u001F\u007F]/,et=/[\[\].#$\u0000-\u001F\u007F]/,nt=function(t){return"string"==typeof t&&0!==t.length&&!tt.test(t)},rt=function(t){return"string"==typeof t&&0!==t.length&&!et.test(t)},it=function(t){return null===t||"string"==typeof t||"number"==typeof t&&!T(t)||t&&"object"==typeof t&&Object(o.i)(t,".sv")},ot=function(t,e,n,r,i){i&&void 0===n||st(Object(o.m)(t,e,i),n,r)},st=function(t,e,n){var r=n instanceof K?new X(n,t):n;if(void 0===e)throw new Error(t+"contains undefined "+r.toErrorString());if("function"==typeof e)throw new Error(t+"contains a function "+r.toErrorString()+" with contents = "+e.toString());if(T(e))throw new Error(t+"contains "+e.toString()+" "+r.toErrorString());if("string"==typeof e&&e.length>10485760/3&&Object(o.E)(e)>10485760)throw new Error(t+"contains a string greater than 10485760 utf8 bytes "+r.toErrorString()+" ('"+e.substring(0,50)+"...')");if(e&&"object"==typeof e){var i=!1,s=!1;if(R(e,(function(e,n){if(".value"===e)i=!0;else if(".priority"!==e&&".sv"!==e&&(s=!0,!nt(e)))throw new Error(t+" contains an invalid key ("+e+") "+r.toErrorString()+'.  Keys must be non-empty strings and can\'t contain ".", "#", "$", "/", "[", or "]"');r.push(e),st(t,n,r),r.pop()})),i&&s)throw new Error(t+' contains ".value" child '+r.toErrorString()+" in addition to actual children.")}},at=function(t,e,n,r,i){if(!i||void 0!==n){var s=Object(o.m)(t,e,i);if(!n||"object"!=typeof n||Array.isArray(n))throw new Error(s+" must be an object containing the children to replace.");var a=[];R(n,(function(t,e){var n=new K(t);if(st(s,e,r.child(n)),".priority"===n.getBack()&&!it(e))throw new Error(s+"contains an invalid value for '"+n.toString()+"', which must be a valid Firebase priority (a string, finite number, server value, or null).");a.push(n)})),function(t,e){var n,r;for(n=0;n<e.length;n++)for(var i=(r=e[n]).slice(),o=0;o<i.length;o++)if(".priority"===i[o]&&o===i.length-1);else if(!nt(i[o]))throw new Error(t+"contains an invalid key ("+i[o]+") in path "+r.toString()+'. Keys must be non-empty strings and can\'t contain ".", "#", "$", "/", "[", or "]"');e.sort(K.comparePaths);var s=null;for(n=0;n<e.length;n++){if(r=e[n],null!==s&&s.contains(r))throw new Error(t+"contains a path "+s.toString()+" that is ancestor of another path "+r.toString());s=r}}(s,a)}},ut=function(t,e,n,r){if(!r||void 0!==n){if(T(n))throw new Error(Object(o.m)(t,e,r)+"is "+n.toString()+", but must be a valid Firebase priority (a string, finite number, server value, or null).");if(!it(n))throw new Error(Object(o.m)(t,e,r)+"must be a valid Firebase priority (a string, finite number, server value, or null).")}},ct=function(t,e,n,r){if(!r||void 0!==n)switch(n){case"value":case"child_added":case"child_removed":case"child_changed":case"child_moved":break;default:throw new Error(Object(o.m)(t,e,r)+'must be a valid event type = "value", "child_added", "child_removed", "child_changed", or "child_moved".')}},lt=function(t,e,n,r){if(!(r&&void 0===n||nt(n)))throw new Error(Object(o.m)(t,e,r)+'was an invalid key = "'+n+'".  Firebase keys must be non-empty strings and can\'t contain ".", "#", "$", "/", "[", or "]").')},ht=function(t,e,n,r){if(!(r&&void 0===n||rt(n)))throw new Error(Object(o.m)(t,e,r)+'was an invalid path = "'+n+'". Paths must be non-empty strings and can\'t contain ".", "#", "$", "[", or "]"')},dt=function(t,e,n,r){n&&(n=n.replace(/^\/*\.info(\/|$)/,"/")),ht(t,e,n,r)},ft=function(t,e){if(".info"===e.getFront())throw new Error(t+" failed = Can't modify data under /.info/")},pt=function(t,e,n){var r=n.path.toString();if("string"!=typeof n.repoInfo.host||0===n.repoInfo.host.length||!nt(n.repoInfo.namespace)&&"localhost"!==n.repoInfo.host.split(":")[0]||0!==r.length&&!function(t){return t&&(t=t.replace(/^\/*\.info(\/|$)/,"/")),rt(t)}(r))throw new Error(Object(o.m)(t,e,!1)+'must be a valid firebase URL and the path can\'t contain ".", "#", "$", "[", or "]".')},gt=function(t,e,n,r){if((!r||void 0!==n)&&"boolean"!=typeof n)throw new Error(Object(o.m)(t,e,r)+"must be a boolean.")},yt=function(){function t(t,e){this.repo_=t,this.path_=e}return t.prototype.cancel=function(t){Object(o.H)("OnDisconnect.cancel",0,1,arguments.length),Object(o.I)("OnDisconnect.cancel",1,t,!0);var e=new o.a;return this.repo_.onDisconnectCancel(this.path_,e.wrapCallback(t)),e.promise},t.prototype.remove=function(t){Object(o.H)("OnDisconnect.remove",0,1,arguments.length),ft("OnDisconnect.remove",this.path_),Object(o.I)("OnDisconnect.remove",1,t,!0);var e=new o.a;return this.repo_.onDisconnectSet(this.path_,null,e.wrapCallback(t)),e.promise},t.prototype.set=function(t,e){Object(o.H)("OnDisconnect.set",1,2,arguments.length),ft("OnDisconnect.set",this.path_),ot("OnDisconnect.set",1,t,this.path_,!1),Object(o.I)("OnDisconnect.set",2,e,!0);var n=new o.a;return this.repo_.onDisconnectSet(this.path_,t,n.wrapCallback(e)),n.promise},t.prototype.setWithPriority=function(t,e,n){Object(o.H)("OnDisconnect.setWithPriority",2,3,arguments.length),ft("OnDisconnect.setWithPriority",this.path_),ot("OnDisconnect.setWithPriority",1,t,this.path_,!1),ut("OnDisconnect.setWithPriority",2,e,!1),Object(o.I)("OnDisconnect.setWithPriority",3,n,!0);var r=new o.a;return this.repo_.onDisconnectSetWithPriority(this.path_,t,e,r.wrapCallback(n)),r.promise},t.prototype.update=function(t,e){if(Object(o.H)("OnDisconnect.update",1,2,arguments.length),ft("OnDisconnect.update",this.path_),Array.isArray(t)){for(var n={},r=0;r<t.length;++r)n[""+r]=t[r];t=n,C("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.")}at("OnDisconnect.update",1,t,this.path_,!1),Object(o.I)("OnDisconnect.update",2,e,!0);var i=new o.a;return this.repo_.onDisconnectUpdate(this.path_,t,i.wrapCallback(e)),i.promise},t}(),vt=function(){function t(t,e){this.committed=t,this.snapshot=e}return t.prototype.toJSON=function(){return Object(o.H)("TransactionResult.toJSON",0,1,arguments.length),{committed:this.committed,snapshot:this.snapshot.toJSON()}},t}(),mt=(P="-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz",D=0,L=[],function(t){var e,n=t===D;D=t;var r=new Array(8);for(e=7;e>=0;e--)r[e]=P.charAt(t%64),t=Math.floor(t/64);Object(o.e)(0===t,"Cannot push at time == 0");var i=r.join("");if(n){for(e=11;e>=0&&63===L[e];e--)L[e]=0;L[e]++}else for(e=0;e<12;e++)L[e]=Math.floor(64*Math.random());for(e=0;e<12;e++)i+=P.charAt(L[e]);return Object(o.e)(20===i.length,"nextPushId: Length should be 20."),i}),bt=function(){function t(t,e){this.name=t,this.node=e}return t.Wrap=function(e,n){return new t(e,n)},t}(),_t=function(){function t(){}return t.prototype.getCompare=function(){return this.compare.bind(this)},t.prototype.indexedValueChanged=function(t,e){var n=new bt(S,t),r=new bt(S,e);return 0!==this.compare(n,r)},t.prototype.minPost=function(){return bt.MIN},t}(),wt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(i.d)(e,t),Object.defineProperty(e,"__EMPTY_NODE",{get:function(){return M},set:function(t){M=t},enumerable:!1,configurable:!0}),e.prototype.compare=function(t,e){return j(t.name,e.name)},e.prototype.isDefinedOn=function(t){throw Object(o.f)("KeyIndex.isDefinedOn not expected to be called.")},e.prototype.indexedValueChanged=function(t,e){return!1},e.prototype.minPost=function(){return bt.MIN},e.prototype.maxPost=function(){return new bt(I,M)},e.prototype.makePost=function(t,e){return Object(o.e)("string"==typeof t,"KeyIndex indexValue must always be a string."),new bt(t,M)},e.prototype.toString=function(){return".key"},e}(_t),Et=new wt,Ot=function(t){return"number"==typeof t?"number:"+B(t):"string:"+t},Ct=function(t){if(t.isLeafNode()){var e=t.val();Object(o.e)("string"==typeof e||"number"==typeof e||"object"==typeof e&&Object(o.i)(e,".sv"),"Priority must be a string or number.")}else Object(o.e)(t===F||t.isEmpty(),"priority of unexpected type.");Object(o.e)(t===F||t.getPriority().isEmpty(),"Priority nodes can't have a priority of their own.")},Tt=function(){function t(e,n){void 0===n&&(n=t.__childrenNodeConstructor.EMPTY_NODE),this.value_=e,this.priorityNode_=n,this.lazyHash_=null,Object(o.e)(null!=this.value_,"LeafNode shouldn't be created with null/undefined value."),Ct(this.priorityNode_)}return Object.defineProperty(t,"__childrenNodeConstructor",{get:function(){return U},set:function(t){U=t},enumerable:!1,configurable:!0}),t.prototype.isLeafNode=function(){return!0},t.prototype.getPriority=function(){return this.priorityNode_},t.prototype.updatePriority=function(e){return new t(this.value_,e)},t.prototype.getImmediateChild=function(e){return".priority"===e?this.priorityNode_:t.__childrenNodeConstructor.EMPTY_NODE},t.prototype.getChild=function(e){return e.isEmpty()?this:".priority"===e.getFront()?this.priorityNode_:t.__childrenNodeConstructor.EMPTY_NODE},t.prototype.hasChild=function(){return!1},t.prototype.getPredecessorChildName=function(t,e){return null},t.prototype.updateImmediateChild=function(e,n){return".priority"===e?this.updatePriority(n):n.isEmpty()&&".priority"!==e?this:t.__childrenNodeConstructor.EMPTY_NODE.updateImmediateChild(e,n).updatePriority(this.priorityNode_)},t.prototype.updateChild=function(e,n){var r=e.getFront();return null===r?n:n.isEmpty()&&".priority"!==r?this:(Object(o.e)(".priority"!==r||1===e.getLength(),".priority must be the last token in a path"),this.updateImmediateChild(r,t.__childrenNodeConstructor.EMPTY_NODE.updateChild(e.popFront(),n)))},t.prototype.isEmpty=function(){return!1},t.prototype.numChildren=function(){return 0},t.prototype.forEachChild=function(t,e){return!1},t.prototype.val=function(t){return t&&!this.getPriority().isEmpty()?{".value":this.getValue(),".priority":this.getPriority().val()}:this.getValue()},t.prototype.hash=function(){if(null===this.lazyHash_){var t="";this.priorityNode_.isEmpty()||(t+="priority:"+Ot(this.priorityNode_.val())+":");var e=typeof this.value_;t+=e+":",t+="number"===e?B(this.value_):this.value_,this.lazyHash_=g(t)}return this.lazyHash_},t.prototype.getValue=function(){return this.value_},t.prototype.compareTo=function(e){return e===t.__childrenNodeConstructor.EMPTY_NODE?1:e instanceof t.__childrenNodeConstructor?-1:(Object(o.e)(e.isLeafNode(),"Unknown node type"),this.compareToLeafNode_(e))},t.prototype.compareToLeafNode_=function(e){var n=typeof e.value_,r=typeof this.value_,i=t.VALUE_TYPE_ORDER.indexOf(n),s=t.VALUE_TYPE_ORDER.indexOf(r);return Object(o.e)(i>=0,"Unknown leaf type: "+n),Object(o.e)(s>=0,"Unknown leaf type: "+r),i===s?"object"===r?0:this.value_<e.value_?-1:this.value_===e.value_?0:1:s-i},t.prototype.withIndex=function(){return this},t.prototype.isIndexed=function(){return!0},t.prototype.equals=function(t){return t===this||!!t.isLeafNode()&&this.value_===t.value_&&this.priorityNode_.equals(t.priorityNode_)},t.VALUE_TYPE_ORDER=["object","boolean","number","string"],t}(),St=new(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(i.d)(e,t),e.prototype.compare=function(t,e){var n=t.node.getPriority(),r=e.node.getPriority(),i=n.compareTo(r);return 0===i?j(t.name,e.name):i},e.prototype.isDefinedOn=function(t){return!t.getPriority().isEmpty()},e.prototype.indexedValueChanged=function(t,e){return!t.getPriority().equals(e.getPriority())},e.prototype.minPost=function(){return bt.MIN},e.prototype.maxPost=function(){return new bt(I,new Tt("[PRIORITY-POST]",V))},e.prototype.makePost=function(t,e){var n=$(t);return new bt(e,new Tt("[PRIORITY-POST]",n))},e.prototype.toString=function(){return".priority"},e}(_t)),It=function(){function t(t,e,n,r,i){void 0===i&&(i=null),this.isReverse_=r,this.resultGenerator_=i,this.nodeStack_=[];for(var o=1;!t.isEmpty();)if(t=t,o=e?n(t.key,e):1,r&&(o*=-1),o<0)t=this.isReverse_?t.left:t.right;else{if(0===o){this.nodeStack_.push(t);break}this.nodeStack_.push(t),t=this.isReverse_?t.right:t.left}}return t.prototype.getNext=function(){if(0===this.nodeStack_.length)return null;var t,e=this.nodeStack_.pop();if(t=this.resultGenerator_?this.resultGenerator_(e.key,e.value):{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},t.prototype.hasNext=function(){return this.nodeStack_.length>0},t.prototype.peek=function(){if(0===this.nodeStack_.length)return null;var t=this.nodeStack_[this.nodeStack_.length-1];return this.resultGenerator_?this.resultGenerator_(t.key,t.value):{key:t.key,value:t.value}},t}(),jt=function(){function t(e,n,r,i,o){this.key=e,this.value=n,this.color=null!=r?r:t.RED,this.left=null!=i?i:At.EMPTY_NODE,this.right=null!=o?o:At.EMPTY_NODE}return t.prototype.copy=function(e,n,r,i,o){return new t(null!=e?e:this.key,null!=n?n:this.value,null!=r?r:this.color,null!=i?i:this.left,null!=o?o:this.right)},t.prototype.count=function(){return this.left.count()+1+this.right.count()},t.prototype.isEmpty=function(){return!1},t.prototype.inorderTraversal=function(t){return this.left.inorderTraversal(t)||!!t(this.key,this.value)||this.right.inorderTraversal(t)},t.prototype.reverseTraversal=function(t){return this.right.reverseTraversal(t)||t(this.key,this.value)||this.left.reverseTraversal(t)},t.prototype.min_=function(){return this.left.isEmpty()?this:this.left.min_()},t.prototype.minKey=function(){return this.min_().key},t.prototype.maxKey=function(){return this.right.isEmpty()?this.key:this.right.maxKey()},t.prototype.insert=function(t,e,n){var r=this,i=n(t,r.key);return(r=i<0?r.copy(null,null,null,r.left.insert(t,e,n),null):0===i?r.copy(null,e,null,null,null):r.copy(null,null,null,null,r.right.insert(t,e,n))).fixUp_()},t.prototype.removeMin_=function(){if(this.left.isEmpty())return At.EMPTY_NODE;var t=this;return t.left.isRed_()||t.left.left.isRed_()||(t=t.moveRedLeft_()),(t=t.copy(null,null,null,t.left.removeMin_(),null)).fixUp_()},t.prototype.remove=function(t,e){var n,r;if(e(t,(n=this).key)<0)n.left.isEmpty()||n.left.isRed_()||n.left.left.isRed_()||(n=n.moveRedLeft_()),n=n.copy(null,null,null,n.left.remove(t,e),null);else{if(n.left.isRed_()&&(n=n.rotateRight_()),n.right.isEmpty()||n.right.isRed_()||n.right.left.isRed_()||(n=n.moveRedRight_()),0===e(t,n.key)){if(n.right.isEmpty())return At.EMPTY_NODE;r=n.right.min_(),n=n.copy(r.key,r.value,null,null,n.right.removeMin_())}n=n.copy(null,null,null,null,n.right.remove(t,e))}return n.fixUp_()},t.prototype.isRed_=function(){return this.color},t.prototype.fixUp_=function(){var 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},t.prototype.moveRedLeft_=function(){var t=this.colorFlip_();return t.right.left.isRed_()&&(t=(t=(t=t.copy(null,null,null,null,t.right.rotateRight_())).rotateLeft_()).colorFlip_()),t},t.prototype.moveRedRight_=function(){var t=this.colorFlip_();return t.left.left.isRed_()&&(t=(t=t.rotateRight_()).colorFlip_()),t},t.prototype.rotateLeft_=function(){var e=this.copy(null,null,t.RED,null,this.right.left);return this.right.copy(null,null,this.color,e,null)},t.prototype.rotateRight_=function(){var e=this.copy(null,null,t.RED,this.left.right,null);return this.left.copy(null,null,this.color,null,e)},t.prototype.colorFlip_=function(){var t=this.left.copy(null,null,!this.left.color,null,null),e=this.right.copy(null,null,!this.right.color,null,null);return this.copy(null,null,!this.color,t,e)},t.prototype.checkMaxDepth_=function(){var t=this.check_();return Math.pow(2,t)<=this.count()+1},t.prototype.check_=function(){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");var t=this.left.check_();if(t!==this.right.check_())throw new Error("Black depths differ");return t+(this.isRed_()?0:1)},t.RED=!0,t.BLACK=!1,t}(),xt=function(){function t(){}return t.prototype.copy=function(t,e,n,r,i){return this},t.prototype.insert=function(t,e,n){return new jt(t,e,null)},t.prototype.remove=function(t,e){return this},t.prototype.count=function(){return 0},t.prototype.isEmpty=function(){return!0},t.prototype.inorderTraversal=function(t){return!1},t.prototype.reverseTraversal=function(t){return!1},t.prototype.minKey=function(){return null},t.prototype.maxKey=function(){return null},t.prototype.check_=function(){return 0},t.prototype.isRed_=function(){return!1},t}(),At=function(){function t(e,n){void 0===n&&(n=t.EMPTY_NODE),this.comparator_=e,this.root_=n}return t.prototype.insert=function(e,n){return new t(this.comparator_,this.root_.insert(e,n,this.comparator_).copy(null,null,jt.BLACK,null,null))},t.prototype.remove=function(e){return new t(this.comparator_,this.root_.remove(e,this.comparator_).copy(null,null,jt.BLACK,null,null))},t.prototype.get=function(t){for(var e,n=this.root_;!n.isEmpty();){if(0===(e=this.comparator_(t,n.key)))return n.value;e<0?n=n.left:e>0&&(n=n.right)}return null},t.prototype.getPredecessorKey=function(t){for(var e,n=this.root_,r=null;!n.isEmpty();){if(0===(e=this.comparator_(t,n.key))){if(n.left.isEmpty())return r?r.key:null;for(n=n.left;!n.right.isEmpty();)n=n.right;return n.key}e<0?n=n.left:e>0&&(r=n,n=n.right)}throw new Error("Attempted to find predecessor key for a nonexistent key.  What gives?")},t.prototype.isEmpty=function(){return this.root_.isEmpty()},t.prototype.count=function(){return this.root_.count()},t.prototype.minKey=function(){return this.root_.minKey()},t.prototype.maxKey=function(){return this.root_.maxKey()},t.prototype.inorderTraversal=function(t){return this.root_.inorderTraversal(t)},t.prototype.reverseTraversal=function(t){return this.root_.reverseTraversal(t)},t.prototype.getIterator=function(t){return new It(this.root_,null,this.comparator_,!1,t)},t.prototype.getIteratorFrom=function(t,e){return new It(this.root_,t,this.comparator_,!1,e)},t.prototype.getReverseIteratorFrom=function(t,e){return new It(this.root_,t,this.comparator_,!0,e)},t.prototype.getReverseIterator=function(t){return new It(this.root_,null,this.comparator_,!0,t)},t.EMPTY_NODE=new xt,t}(),kt=Math.log(2),Nt=function(){function t(t){this.count=parseInt(Math.log(t+1)/kt,10),this.current_=this.count-1;var e=parseInt(Array(this.count+1).join("1"),2);this.bits_=t+1&e}return t.prototype.nextBitIsOne=function(){var t=!(this.bits_&1<<this.current_);return this.current_--,t},t}(),Rt=function(t,e,n,r){t.sort(e);var i=function(e,r){var o,s,a=r-e;if(0===a)return null;if(1===a)return o=t[e],s=n?n(o):o,new jt(s,o.node,jt.BLACK,null,null);var u=parseInt(a/2,10)+e,c=i(e,u),l=i(u+1,r);return o=t[u],s=n?n(o):o,new jt(s,o.node,jt.BLACK,c,l)},o=function(e){for(var r=null,o=null,s=t.length,a=function(e,r){var o=s-e,a=s;s-=e;var c=i(o+1,a),l=t[o],h=n?n(l):l;u(new jt(h,l.node,r,null,c))},u=function(t){r?(r.left=t,r=t):(o=t,r=t)},c=0;c<e.count;++c){var l=e.nextBitIsOne(),h=Math.pow(2,e.count-(c+1));l?a(h,jt.BLACK):(a(h,jt.BLACK),a(h,jt.RED))}return o}(new Nt(t.length));return new At(r||e,o)},Pt={},Dt=function(){function t(t,e){this.indexes_=t,this.indexSet_=e}return Object.defineProperty(t,"Default",{get:function(){return Object(o.e)(Pt&&St,"ChildrenNode.ts has not been loaded"),q=q||new t({".priority":Pt},{".priority":St})},enumerable:!1,configurable:!0}),t.prototype.get=function(t){var e=Object(o.D)(this.indexes_,t);if(!e)throw new Error("No index defined for "+t);return e instanceof At?e:null},t.prototype.hasIndex=function(t){return Object(o.i)(this.indexSet_,t.toString())},t.prototype.addIndex=function(e,n){Object(o.e)(e!==Et,"KeyIndex always exists and isn't meant to be added to the IndexMap.");for(var r,s=[],a=!1,u=n.getIterator(bt.Wrap),c=u.getNext();c;)a=a||e.isDefinedOn(c.node),s.push(c),c=u.getNext();r=a?Rt(s,e.getCompare()):Pt;var l=e.toString(),h=Object(i.a)({},this.indexSet_);h[l]=e;var d=Object(i.a)({},this.indexes_);return d[l]=r,new t(d,h)},t.prototype.addToIndexes=function(e,n){var r=this;return new t(Object(o.B)(this.indexes_,(function(t,i){var s=Object(o.D)(r.indexSet_,i);if(Object(o.e)(s,"Missing index implementation for "+i),t===Pt){if(s.isDefinedOn(e.node)){for(var a=[],u=n.getIterator(bt.Wrap),c=u.getNext();c;)c.name!==e.name&&a.push(c),c=u.getNext();return a.push(e),Rt(a,s.getCompare())}return Pt}var l=n.get(e.name),h=t;return l&&(h=h.remove(new bt(e.name,l))),h.insert(e,e.node)})),this.indexSet_)},t.prototype.removeFromIndexes=function(e,n){return new t(Object(o.B)(this.indexes_,(function(t){if(t===Pt)return t;var r=n.get(e.name);return r?t.remove(new bt(e.name,r)):t})),this.indexSet_)},t}();function Lt(t,e){return j(t.name,e.name)}function Mt(t,e){return j(t,e)}var Ft=function(){function t(t,e,n){this.children_=t,this.priorityNode_=e,this.indexMap_=n,this.lazyHash_=null,this.priorityNode_&&Ct(this.priorityNode_),this.children_.isEmpty()&&Object(o.e)(!this.priorityNode_||this.priorityNode_.isEmpty(),"An empty node cannot have a priority")}return Object.defineProperty(t,"EMPTY_NODE",{get:function(){return H||(H=new t(new At(Mt),null,Dt.Default))},enumerable:!1,configurable:!0}),t.prototype.isLeafNode=function(){return!1},t.prototype.getPriority=function(){return this.priorityNode_||H},t.prototype.updatePriority=function(e){return this.children_.isEmpty()?this:new t(this.children_,e,this.indexMap_)},t.prototype.getImmediateChild=function(t){if(".priority"===t)return this.getPriority();var e=this.children_.get(t);return null===e?H:e},t.prototype.getChild=function(t){var e=t.getFront();return null===e?this:this.getImmediateChild(e).getChild(t.popFront())},t.prototype.hasChild=function(t){return null!==this.children_.get(t)},t.prototype.updateImmediateChild=function(e,n){if(Object(o.e)(n,"We should always be passing snapshot nodes"),".priority"===e)return this.updatePriority(n);var r=new bt(e,n),i=void 0,s=void 0;n.isEmpty()?(i=this.children_.remove(e),s=this.indexMap_.removeFromIndexes(r,this.children_)):(i=this.children_.insert(e,n),s=this.indexMap_.addToIndexes(r,this.children_));var a=i.isEmpty()?H:this.priorityNode_;return new t(i,a,s)},t.prototype.updateChild=function(t,e){var n=t.getFront();if(null===n)return e;Object(o.e)(".priority"!==t.getFront()||1===t.getLength(),".priority must be the last token in a path");var r=this.getImmediateChild(n).updateChild(t.popFront(),e);return this.updateImmediateChild(n,r)},t.prototype.isEmpty=function(){return this.children_.isEmpty()},t.prototype.numChildren=function(){return this.children_.count()},t.prototype.val=function(e){if(this.isEmpty())return null;var n={},r=0,i=0,o=!0;if(this.forEachChild(St,(function(s,a){n[s]=a.val(e),r++,o&&t.INTEGER_REGEXP_.test(s)?i=Math.max(i,Number(s)):o=!1})),!e&&o&&i<2*r){var s=[];for(var a in n)s[a]=n[a];return s}return e&&!this.getPriority().isEmpty()&&(n[".priority"]=this.getPriority().val()),n},t.prototype.hash=function(){if(null===this.lazyHash_){var t="";this.getPriority().isEmpty()||(t+="priority:"+Ot(this.getPriority().val())+":"),this.forEachChild(St,(function(e,n){var r=n.hash();""!==r&&(t+=":"+e+":"+r)})),this.lazyHash_=""===t?"":g(t)}return this.lazyHash_},t.prototype.getPredecessorChildName=function(t,e,n){var r=this.resolveIndex_(n);if(r){var i=r.getPredecessorKey(new bt(t,e));return i?i.name:null}return this.children_.getPredecessorKey(t)},t.prototype.getFirstChildName=function(t){var e=this.resolveIndex_(t);if(e){var n=e.minKey();return n&&n.name}return this.children_.minKey()},t.prototype.getFirstChild=function(t){var e=this.getFirstChildName(t);return e?new bt(e,this.children_.get(e)):null},t.prototype.getLastChildName=function(t){var e=this.resolveIndex_(t);if(e){var n=e.maxKey();return n&&n.name}return this.children_.maxKey()},t.prototype.getLastChild=function(t){var e=this.getLastChildName(t);return e?new bt(e,this.children_.get(e)):null},t.prototype.forEachChild=function(t,e){var n=this.resolveIndex_(t);return n?n.inorderTraversal((function(t){return e(t.name,t.node)})):this.children_.inorderTraversal(e)},t.prototype.getIterator=function(t){return this.getIteratorFrom(t.minPost(),t)},t.prototype.getIteratorFrom=function(t,e){var n=this.resolveIndex_(e);if(n)return n.getIteratorFrom(t,(function(t){return t}));for(var r=this.children_.getIteratorFrom(t.name,bt.Wrap),i=r.peek();null!=i&&e.compare(i,t)<0;)r.getNext(),i=r.peek();return r},t.prototype.getReverseIterator=function(t){return this.getReverseIteratorFrom(t.maxPost(),t)},t.prototype.getReverseIteratorFrom=function(t,e){var n=this.resolveIndex_(e);if(n)return n.getReverseIteratorFrom(t,(function(t){return t}));for(var r=this.children_.getReverseIteratorFrom(t.name,bt.Wrap),i=r.peek();null!=i&&e.compare(i,t)>0;)r.getNext(),i=r.peek();return r},t.prototype.compareTo=function(t){return this.isEmpty()?t.isEmpty()?0:-1:t.isLeafNode()||t.isEmpty()?1:t===Ut?-1:0},t.prototype.withIndex=function(e){if(e===Et||this.indexMap_.hasIndex(e))return this;var n=this.indexMap_.addIndex(e,this.children_);return new t(this.children_,this.priorityNode_,n)},t.prototype.isIndexed=function(t){return t===Et||this.indexMap_.hasIndex(t)},t.prototype.equals=function(t){if(t===this)return!0;if(t.isLeafNode())return!1;var e=t;if(this.getPriority().equals(e.getPriority())){if(this.children_.count()===e.children_.count()){for(var n=this.getIterator(St),r=e.getIterator(St),i=n.getNext(),o=r.getNext();i&&o;){if(i.name!==o.name||!i.node.equals(o.node))return!1;i=n.getNext(),o=r.getNext()}return null===i&&null===o}return!1}return!1},t.prototype.resolveIndex_=function(t){return t===Et?null:this.indexMap_.get(t.toString())},t.INTEGER_REGEXP_=/^(0|[1-9]\d*)$/,t}(),Ut=new(function(t){function e(){return t.call(this,new At(Mt),Ft.EMPTY_NODE,Dt.Default)||this}return Object(i.d)(e,t),e.prototype.compareTo=function(t){return t===this?0:1},e.prototype.equals=function(t){return t===this},e.prototype.getPriority=function(){return this},e.prototype.getImmediateChild=function(t){return Ft.EMPTY_NODE},e.prototype.isEmpty=function(){return!1},e}(Ft));function $t(t,e){if(void 0===e&&(e=null),null===t)return Ft.EMPTY_NODE;if("object"==typeof t&&".priority"in t&&(e=t[".priority"]),Object(o.e)(null===e||"string"==typeof e||"number"==typeof e||"object"==typeof e&&".sv"in e,"Invalid priority type found: "+typeof e),"object"==typeof t&&".value"in t&&null!==t[".value"]&&(t=t[".value"]),"object"!=typeof t||".sv"in t)return new Tt(t,$t(e));if(t instanceof Array){var n=Ft.EMPTY_NODE;return R(t,(function(e,r){if(Object(o.i)(t,e)&&"."!==e.substring(0,1)){var i=$t(r);!i.isLeafNode()&&i.isEmpty()||(n=n.updateImmediateChild(e,i))}})),n.updatePriority($t(e))}var r=[],i=!1;if(R(t,(function(t,e){if("."!==t.substring(0,1)){var n=$t(e);n.isEmpty()||(i=i||!n.getPriority().isEmpty(),r.push(new bt(t,n)))}})),0===r.length)return Ft.EMPTY_NODE;var s=Rt(r,Lt,(function(t){return t.name}),Mt);if(i){var a=Rt(r,St.getCompare());return new Ft(s,$t(e),new Dt({".priority":a},{".priority":St}))}return new Ft(s,$t(e),Dt.Default)}Object.defineProperties(bt,{MIN:{value:new bt(S,Ft.EMPTY_NODE)},MAX:{value:new bt(I,Ut)}}),wt.__EMPTY_NODE=Ft.EMPTY_NODE,Tt.__childrenNodeConstructor=Ft,F=Ut,function(t){V=t}(Ut),function(t){$=t}($t);var Vt,qt=new(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(i.d)(e,t),e.prototype.compare=function(t,e){var n=t.node.compareTo(e.node);return 0===n?j(t.name,e.name):n},e.prototype.isDefinedOn=function(t){return!0},e.prototype.indexedValueChanged=function(t,e){return!t.equals(e)},e.prototype.minPost=function(){return bt.MIN},e.prototype.maxPost=function(){return bt.MAX},e.prototype.makePost=function(t,e){var n=$t(t);return new bt(e,n)},e.prototype.toString=function(){return".value"},e}(_t)),Ht=function(t){function e(e){var n=t.call(this)||this;return n.indexPath_=e,Object(o.e)(!e.isEmpty()&&".priority"!==e.getFront(),"Can't create PathIndex with empty path or .priority key"),n}return Object(i.d)(e,t),e.prototype.extractChild=function(t){return t.getChild(this.indexPath_)},e.prototype.isDefinedOn=function(t){return!t.getChild(this.indexPath_).isEmpty()},e.prototype.compare=function(t,e){var n=this.extractChild(t.node),r=this.extractChild(e.node),i=n.compareTo(r);return 0===i?j(t.name,e.name):i},e.prototype.makePost=function(t,e){var n=$t(t),r=Ft.EMPTY_NODE.updateChild(this.indexPath_,n);return new bt(e,r)},e.prototype.maxPost=function(){var t=Ft.EMPTY_NODE.updateChild(this.indexPath_,Ut);return new bt(I,t)},e.prototype.toString=function(){return this.indexPath_.slice().join("/")},e}(_t),Bt=function(){function t(t,e,n){this.node_=t,this.ref_=e,this.index_=n}return t.prototype.val=function(){return Object(o.H)("DataSnapshot.val",0,0,arguments.length),this.node_.val()},t.prototype.exportVal=function(){return Object(o.H)("DataSnapshot.exportVal",0,0,arguments.length),this.node_.val(!0)},t.prototype.toJSON=function(){return Object(o.H)("DataSnapshot.toJSON",0,1,arguments.length),this.exportVal()},t.prototype.exists=function(){return Object(o.H)("DataSnapshot.exists",0,0,arguments.length),!this.node_.isEmpty()},t.prototype.child=function(e){Object(o.H)("DataSnapshot.child",0,1,arguments.length),e=String(e),ht("DataSnapshot.child",1,e,!1);var n=new K(e),r=this.ref_.child(n);return new t(this.node_.getChild(n),r,St)},t.prototype.hasChild=function(t){Object(o.H)("DataSnapshot.hasChild",1,1,arguments.length),ht("DataSnapshot.hasChild",1,t,!1);var e=new K(t);return!this.node_.getChild(e).isEmpty()},t.prototype.getPriority=function(){return Object(o.H)("DataSnapshot.getPriority",0,0,arguments.length),this.node_.getPriority().val()},t.prototype.forEach=function(e){var n=this;if(Object(o.H)("DataSnapshot.forEach",1,1,arguments.length),Object(o.I)("DataSnapshot.forEach",1,e,!1),this.node_.isLeafNode())return!1;var r=this.node_;return!!r.forEachChild(this.index_,(function(r,i){return e(new t(i,n.ref_.child(r),St))}))},t.prototype.hasChildren=function(){return Object(o.H)("DataSnapshot.hasChildren",0,0,arguments.length),!this.node_.isLeafNode()&&!this.node_.isEmpty()},Object.defineProperty(t.prototype,"key",{get:function(){return this.ref_.getKey()},enumerable:!1,configurable:!0}),t.prototype.numChildren=function(){return Object(o.H)("DataSnapshot.numChildren",0,0,arguments.length),this.node_.numChildren()},t.prototype.getRef=function(){return Object(o.H)("DataSnapshot.ref",0,0,arguments.length),this.ref_},Object.defineProperty(t.prototype,"ref",{get:function(){return this.getRef()},enumerable:!1,configurable:!0}),t}(),zt=function(){function t(t,e,n,r){this.eventType=t,this.eventRegistration=e,this.snapshot=n,this.prevName=r}return t.prototype.getPath=function(){var t=this.snapshot.getRef();return"value"===this.eventType?t.path:t.getParent().path},t.prototype.getEventType=function(){return this.eventType},t.prototype.getEventRunner=function(){return this.eventRegistration.getEventRunner(this)},t.prototype.toString=function(){return this.getPath().toString()+":"+this.eventType+":"+Object(o.G)(this.snapshot.exportVal())},t}(),Wt=function(){function t(t,e,n){this.eventRegistration=t,this.error=e,this.path=n}return t.prototype.getPath=function(){return this.path},t.prototype.getEventType=function(){return"cancel"},t.prototype.getEventRunner=function(){return this.eventRegistration.getEventRunner(this)},t.prototype.toString=function(){return this.path.toString()+":cancel"},t}(),Gt=function(){function t(t,e,n){this.callback_=t,this.cancelCallback_=e,this.context_=n}return t.prototype.respondsTo=function(t){return"value"===t},t.prototype.createEvent=function(t,e){var n=e.getQueryParams().getIndex();return new zt("value",this,new Bt(t.snapshotNode,e.getRef(),n))},t.prototype.getEventRunner=function(t){var e=this.context_;if("cancel"===t.getEventType()){Object(o.e)(this.cancelCallback_,"Raising a cancel event on a listener with no cancel callback");var n=this.cancelCallback_;return function(){n.call(e,t.error)}}var r=this.callback_;return function(){r.call(e,t.snapshot)}},t.prototype.createCancelEvent=function(t,e){return this.cancelCallback_?new Wt(this,t,e):null},t.prototype.matches=function(e){return e instanceof t&&(!e.callback_||!this.callback_||e.callback_===this.callback_&&e.context_===this.context_)},t.prototype.hasAnyCallback=function(){return null!==this.callback_},t}(),Qt=function(){function t(t,e,n){this.callbacks_=t,this.cancelCallback_=e,this.context_=n}return t.prototype.respondsTo=function(t){var e="children_added"===t?"child_added":t;return e="children_removed"===e?"child_removed":e,Object(o.i)(this.callbacks_,e)},t.prototype.createCancelEvent=function(t,e){return this.cancelCallback_?new Wt(this,t,e):null},t.prototype.createEvent=function(t,e){Object(o.e)(null!=t.childName,"Child events should have a childName.");var n=e.getRef().child(t.childName),r=e.getQueryParams().getIndex();return new zt(t.type,this,new Bt(t.snapshotNode,n,r),t.prevName)},t.prototype.getEventRunner=function(t){var e=this.context_;if("cancel"===t.getEventType()){Object(o.e)(this.cancelCallback_,"Raising a cancel event on a listener with no cancel callback");var n=this.cancelCallback_;return function(){n.call(e,t.error)}}var r=this.callbacks_[t.eventType];return function(){r.call(e,t.snapshot,t.prevName)}},t.prototype.matches=function(e){var n=this;if(e instanceof t){if(!this.callbacks_||!e.callbacks_)return!0;if(this.context_===e.context_){var r=Object.keys(e.callbacks_),i=Object.keys(this.callbacks_),o=r.length;if(o===i.length){if(1===o){var s=r[0],a=i[0];return!(a!==s||e.callbacks_[s]&&this.callbacks_[a]&&e.callbacks_[s]!==this.callbacks_[a])}return i.every((function(t){return e.callbacks_[t]===n.callbacks_[t]}))}}}return!1},t.prototype.hasAnyCallback=function(){return null!==this.callbacks_},t}(),Kt=function(){function t(t,e,n,r){this.repo=t,this.path=e,this.queryParams_=n,this.orderByCalled_=r}return Object.defineProperty(t,"__referenceConstructor",{get:function(){return Object(o.e)(Vt,"Reference.ts has not been loaded"),Vt},set:function(t){Vt=t},enumerable:!1,configurable:!0}),t.validateQueryEndpoints_=function(t){var e=null,n=null;if(t.hasStart()&&(e=t.getIndexStartValue()),t.hasEnd()&&(n=t.getIndexEndValue()),t.getIndex()===Et){var 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(), endAt(),or equalTo() must be a string.";if(t.hasStart()){if(t.getIndexStartName()!==S)throw new Error(r);if("string"!=typeof e)throw new Error(i)}if(t.hasEnd()){if(t.getIndexEndName()!==I)throw new Error(r);if("string"!=typeof n)throw new Error(i)}}else if(t.getIndex()===St){if(null!=e&&!it(e)||null!=n&&!it(n))throw new Error("Query: When ordering by priority, the first argument passed to startAt(), endAt(), or equalTo() must be a valid priority value (null, a number, or a string).")}else if(Object(o.e)(t.getIndex()instanceof Ht||t.getIndex()===qt,"unknown index type."),null!=e&&"object"==typeof e||null!=n&&"object"==typeof n)throw new Error("Query: First argument passed to startAt(), endAt(), or equalTo() cannot be an object.")},t.validateLimit_=function(t){if(t.hasStart()&&t.hasEnd()&&t.hasLimit()&&!t.hasAnchoredLimit())throw new Error("Query: Can't combine startAt(), endAt(), and limit(). Use limitToFirst() or limitToLast() instead.")},t.prototype.validateNoPreviousOrderByCall_=function(t){if(!0===this.orderByCalled_)throw new Error(t+": You can't combine multiple orderBy calls.")},t.prototype.getQueryParams=function(){return this.queryParams_},t.prototype.getRef=function(){return Object(o.H)("Query.ref",0,0,arguments.length),new t.__referenceConstructor(this.repo,this.path)},t.prototype.on=function(e,n,r,i){Object(o.H)("Query.on",2,4,arguments.length),ct("Query.on",1,e,!1),Object(o.I)("Query.on",2,n,!1);var s=t.getCancelAndContextArgs_("Query.on",r,i);if("value"===e)this.onValueEvent(n,s.cancel,s.context);else{var a={};a[e]=n,this.onChildEvent(a,s.cancel,s.context)}return n},t.prototype.onValueEvent=function(t,e,n){var r=new Gt(t,e||null,n||null);this.repo.addEventCallbackForQuery(this,r)},t.prototype.onChildEvent=function(t,e,n){var r=new Qt(t,e,n);this.repo.addEventCallbackForQuery(this,r)},t.prototype.off=function(t,e,n){Object(o.H)("Query.off",0,3,arguments.length),ct("Query.off",1,t,!0),Object(o.I)("Query.off",2,e,!0),Object(o.J)("Query.off",3,n,!0);var r=null,i=null;if("value"===t){var s=e||null;r=new Gt(s,null,n||null)}else t&&(e&&((i={})[t]=e),r=new Qt(i,null,n||null));this.repo.removeEventCallbackForQuery(this,r)},t.prototype.get=function(){return this.repo.getValue(this)},t.prototype.once=function(e,n,r,i){var s=this;Object(o.H)("Query.once",1,4,arguments.length),ct("Query.once",1,e,!1),Object(o.I)("Query.once",2,n,!0);var a=t.getCancelAndContextArgs_("Query.once",r,i),u=!0,c=new o.a;c.promise.catch((function(){}));var l=function(t){u&&(u=!1,s.off(e,l),n&&n.bind(a.context)(t),c.resolve(t))};return this.on(e,l,(function(t){s.off(e,l),a.cancel&&a.cancel.bind(a.context)(t),c.reject(t)})),c.promise},t.prototype.limitToFirst=function(e){if(Object(o.H)("Query.limitToFirst",1,1,arguments.length),"number"!=typeof e||Math.floor(e)!==e||e<=0)throw new Error("Query.limitToFirst: First argument must be a positive integer.");if(this.queryParams_.hasLimit())throw new Error("Query.limitToFirst: Limit was already set (by another call to limit, limitToFirst, or limitToLast).");return new t(this.repo,this.path,this.queryParams_.limitToFirst(e),this.orderByCalled_)},t.prototype.limitToLast=function(e){if(Object(o.H)("Query.limitToLast",1,1,arguments.length),"number"!=typeof e||Math.floor(e)!==e||e<=0)throw new Error("Query.limitToLast: First argument must be a positive integer.");if(this.queryParams_.hasLimit())throw new Error("Query.limitToLast: Limit was already set (by another call to limit, limitToFirst, or limitToLast).");return new t(this.repo,this.path,this.queryParams_.limitToLast(e),this.orderByCalled_)},t.prototype.orderByChild=function(e){if(Object(o.H)("Query.orderByChild",1,1,arguments.length),"$key"===e)throw new Error('Query.orderByChild: "$key" is invalid.  Use Query.orderByKey() instead.');if("$priority"===e)throw new Error('Query.orderByChild: "$priority" is invalid.  Use Query.orderByPriority() instead.');if("$value"===e)throw new Error('Query.orderByChild: "$value" is invalid.  Use Query.orderByValue() instead.');ht("Query.orderByChild",1,e,!1),this.validateNoPreviousOrderByCall_("Query.orderByChild");var n=new K(e);if(n.isEmpty())throw new Error("Query.orderByChild: cannot pass in empty path.  Use Query.orderByValue() instead.");var r=new Ht(n),i=this.queryParams_.orderBy(r);return t.validateQueryEndpoints_(i),new t(this.repo,this.path,i,!0)},t.prototype.orderByKey=function(){Object(o.H)("Query.orderByKey",0,0,arguments.length),this.validateNoPreviousOrderByCall_("Query.orderByKey");var e=this.queryParams_.orderBy(Et);return t.validateQueryEndpoints_(e),new t(this.repo,this.path,e,!0)},t.prototype.orderByPriority=function(){Object(o.H)("Query.orderByPriority",0,0,arguments.length),this.validateNoPreviousOrderByCall_("Query.orderByPriority");var e=this.queryParams_.orderBy(St);return t.validateQueryEndpoints_(e),new t(this.repo,this.path,e,!0)},t.prototype.orderByValue=function(){Object(o.H)("Query.orderByValue",0,0,arguments.length),this.validateNoPreviousOrderByCall_("Query.orderByValue");var e=this.queryParams_.orderBy(qt);return t.validateQueryEndpoints_(e),new t(this.repo,this.path,e,!0)},t.prototype.startAt=function(e,n){void 0===e&&(e=null),Object(o.H)("Query.startAt",0,2,arguments.length),ot("Query.startAt",1,e,this.path,!0),lt("Query.startAt",2,n,!0);var r=this.queryParams_.startAt(e,n);if(t.validateLimit_(r),t.validateQueryEndpoints_(r),this.queryParams_.hasStart())throw new Error("Query.startAt: Starting point was already set (by another call to startAt or equalTo).");return void 0===e&&(e=null,n=null),new t(this.repo,this.path,r,this.orderByCalled_)},t.prototype.endAt=function(e,n){void 0===e&&(e=null),Object(o.H)("Query.endAt",0,2,arguments.length),ot("Query.endAt",1,e,this.path,!0),lt("Query.endAt",2,n,!0);var r=this.queryParams_.endAt(e,n);if(t.validateLimit_(r),t.validateQueryEndpoints_(r),this.queryParams_.hasEnd())throw new Error("Query.endAt: Ending point was already set (by another call to endAt or equalTo).");return new t(this.repo,this.path,r,this.orderByCalled_)},t.prototype.equalTo=function(t,e){if(Object(o.H)("Query.equalTo",1,2,arguments.length),ot("Query.equalTo",1,t,this.path,!1),lt("Query.equalTo",2,e,!0),this.queryParams_.hasStart())throw new Error("Query.equalTo: Starting point was already set (by another call to startAt or equalTo).");if(this.queryParams_.hasEnd())throw new Error("Query.equalTo: Ending point was already set (by another call to endAt or equalTo).");return this.startAt(t,e).endAt(t,e)},t.prototype.toString=function(){return Object(o.H)("Query.toString",0,0,arguments.length),this.repo.toString()+this.path.toUrlEncodedString()},t.prototype.toJSON=function(){return Object(o.H)("Query.toJSON",0,1,arguments.length),this.toString()},t.prototype.queryObject=function(){return this.queryParams_.getQueryObject()},t.prototype.queryIdentifier=function(){var t=this.queryObject(),e=k(t);return"{}"===e?"default":e},t.prototype.isEqual=function(e){if(Object(o.H)("Query.isEqual",1,1,arguments.length),!(e instanceof t)){var n="Query.isEqual failed: First argument must be an instance of firebase.database.Query.";throw new Error(n)}var r=this.repo===e.repo,i=this.path.equals(e.path),s=this.queryIdentifier()===e.queryIdentifier();return r&&i&&s},t.getCancelAndContextArgs_=function(t,e,n){var r={cancel:null,context:null};if(e&&n)r.cancel=e,Object(o.I)(t,3,r.cancel,!0),r.context=n,Object(o.J)(t,4,r.context,!0);else if(e)if("object"==typeof e&&null!==e)r.context=e;else{if("function"!=typeof e)throw new Error(Object(o.m)(t,3,!0)+" must either be a cancel callback or a context object.");r.cancel=e}return r},Object.defineProperty(t.prototype,"ref",{get:function(){return this.getRef()},enumerable:!1,configurable:!0}),t}(),Xt=function(){function t(t){this.node_=t}return t.prototype.getImmediateChild=function(e){return new t(this.node_.getImmediateChild(e))},t.prototype.node=function(){return this.node_},t}(),Yt=function(){function t(t,e){this.syncTree_=t,this.path_=e}return t.prototype.getImmediateChild=function(e){var n=this.path_.child(e);return new t(this.syncTree_,n)},t.prototype.node=function(){return this.syncTree_.calcCompleteEventCache(this.path_)},t}(),Jt=function(t,e,n){return t&&"object"==typeof t?(Object(o.e)(".sv"in t,"Unexpected leaf node or priority contents"),"string"==typeof t[".sv"]?Zt(t[".sv"],e,n):"object"==typeof t[".sv"]?te(t[".sv"],e):void Object(o.e)(!1,"Unexpected server value: "+JSON.stringify(t,null,2))):t},Zt=function(t,e,n){switch(t){case"timestamp":return n.timestamp;default:Object(o.e)(!1,"Unexpected server value: "+t)}},te=function(t,e,n){t.hasOwnProperty("increment")||Object(o.e)(!1,"Unexpected server value: "+JSON.stringify(t,null,2));var r=t.increment;"number"!=typeof r&&Object(o.e)(!1,"Unexpected increment value: "+r);var i=e.node();if(Object(o.e)(null!=i,"Expected ChildrenNode.EMPTY_NODE for nulls"),!i.isLeafNode())return r;var s=i.getValue();return"number"!=typeof s?r:s+r},ee=function(t,e,n,r){return re(e,new Yt(n,t),r)},ne=function(t,e,n){return re(t,new Xt(e),n)};function re(t,e,n){var r,i=t.getPriority().val(),o=Jt(i,e.getImmediateChild(".priority"),n);if(t.isLeafNode()){var s=t,a=Jt(s.getValue(),e,n);return a!==s.getValue()||o!==s.getPriority().val()?new Tt(a,$t(o)):t}var u=t;return r=u,o!==u.getPriority().val()&&(r=r.updatePriority(new Tt(o))),u.forEachChild(St,(function(t,i){var o=re(i,e.getImmediateChild(t),n);o!==i&&(r=r.updateImmediateChild(t,o))})),r}var ie,oe,se=function(){function t(){this.value=null,this.children=new Map}return t.prototype.find=function(t){if(null!=this.value)return this.value.getChild(t);if(!t.isEmpty()&&this.children.size>0){var e=t.getFront();return t=t.popFront(),this.children.has(e)?this.children.get(e).find(t):null}return null},t.prototype.remember=function(e,n){if(e.isEmpty())this.value=n,this.children.clear();else if(null!==this.value)this.value=this.value.updateChild(e,n);else{var r=e.getFront();this.children.has(r)||this.children.set(r,new t);var i=this.children.get(r);e=e.popFront(),i.remember(e,n)}},t.prototype.forget=function(t){if(t.isEmpty())return this.value=null,this.children.clear(),!0;if(null!==this.value){if(this.value.isLeafNode())return!1;var e=this.value;this.value=null;var n=this;return e.forEachChild(St,(function(t,e){n.remember(new K(t),e)})),this.forget(t)}if(this.children.size>0){var r=t.getFront();return t=t.popFront(),this.children.has(r)&&this.children.get(r).forget(t)&&this.children.delete(r),0===this.children.size}return!0},t.prototype.forEachTree=function(t,e){null!==this.value?e(t,this.value):this.forEachChild((function(n,r){var i=new K(t.toString()+"/"+n);r.forEachTree(i,e)}))},t.prototype.forEachChild=function(t){this.children.forEach((function(e,n){t(n,e)}))},t}(),ae=function(t){return t[t.OVERWRITE=0]="OVERWRITE",t[t.MERGE=1]="MERGE",t[t.ACK_USER_WRITE=2]="ACK_USER_WRITE",t[t.LISTEN_COMPLETE=3]="LISTEN_COMPLETE",t}({}),ue=function(){function t(t,e,n,r){this.fromUser=t,this.fromServer=e,this.queryId=n,this.tagged=r,Object(o.e)(!r||e,"Tagged queries must be from server.")}return t.User=new t(!0,!1,null,!1),t.Server=new t(!1,!0,null,!1),t.forServerTaggedQuery=function(e){return new t(!1,!0,e,!0)},t}(),ce=function(){function t(t,e,n){this.path=t,this.affectedTree=e,this.revert=n,this.type=ae.ACK_USER_WRITE,this.source=ue.User}return t.prototype.operationForChild=function(e){if(this.path.isEmpty()){if(null!=this.affectedTree.value)return Object(o.e)(this.affectedTree.children.isEmpty(),"affectedTree should not have overlapping affected paths."),this;var n=this.affectedTree.subtree(new K(e));return new t(K.Empty,n,this.revert)}return Object(o.e)(this.path.getFront()===e,"operationForChild called for unrelated child."),new t(this.path.popFront(),this.affectedTree,this.revert)},t}(),le=function(){function t(t,e){void 0===e&&(ie||(ie=new At(x)),e=ie),this.value=t,this.children=e}return t.fromObject=function(e){var n=t.Empty;return R(e,(function(t,e){n=n.set(new K(t),e)})),n},t.prototype.isEmpty=function(){return null===this.value&&this.children.isEmpty()},t.prototype.findRootMostMatchingPathAndValue=function(t,e){if(null!=this.value&&e(this.value))return{path:K.Empty,value:this.value};if(t.isEmpty())return null;var n=t.getFront(),r=this.children.get(n);if(null!==r){var i=r.findRootMostMatchingPathAndValue(t.popFront(),e);return null!=i?{path:new K(n).child(i.path),value:i.value}:null}return null},t.prototype.findRootMostValueAndPath=function(t){return this.findRootMostMatchingPathAndValue(t,(function(){return!0}))},t.prototype.subtree=function(e){if(e.isEmpty())return this;var n=e.getFront(),r=this.children.get(n);return null!==r?r.subtree(e.popFront()):t.Empty},t.prototype.set=function(e,n){if(e.isEmpty())return new t(n,this.children);var r=e.getFront(),i=(this.children.get(r)||t.Empty).set(e.popFront(),n),o=this.children.insert(r,i);return new t(this.value,o)},t.prototype.remove=function(e){if(e.isEmpty())return this.children.isEmpty()?t.Empty:new t(null,this.children);var n=e.getFront(),r=this.children.get(n);if(r){var i=r.remove(e.popFront()),o=void 0;return o=i.isEmpty()?this.children.remove(n):this.children.insert(n,i),null===this.value&&o.isEmpty()?t.Empty:new t(this.value,o)}return this},t.prototype.get=function(t){if(t.isEmpty())return this.value;var e=t.getFront(),n=this.children.get(e);return n?n.get(t.popFront()):null},t.prototype.setTree=function(e,n){if(e.isEmpty())return n;var r,i=e.getFront(),o=(this.children.get(i)||t.Empty).setTree(e.popFront(),n);return r=o.isEmpty()?this.children.remove(i):this.children.insert(i,o),new t(this.value,r)},t.prototype.fold=function(t){return this.fold_(K.Empty,t)},t.prototype.fold_=function(t,e){var n={};return this.children.inorderTraversal((function(r,i){n[r]=i.fold_(t.child(r),e)})),e(t,this.value,n)},t.prototype.findOnPath=function(t,e){return this.findOnPath_(t,K.Empty,e)},t.prototype.findOnPath_=function(t,e,n){var r=!!this.value&&n(e,this.value);if(r)return r;if(t.isEmpty())return null;var i=t.getFront(),o=this.children.get(i);return o?o.findOnPath_(t.popFront(),e.child(i),n):null},t.prototype.foreachOnPath=function(t,e){return this.foreachOnPath_(t,K.Empty,e)},t.prototype.foreachOnPath_=function(e,n,r){if(e.isEmpty())return this;this.value&&r(n,this.value);var i=e.getFront(),o=this.children.get(i);return o?o.foreachOnPath_(e.popFront(),n.child(i),r):t.Empty},t.prototype.foreach=function(t){this.foreach_(K.Empty,t)},t.prototype.foreach_=function(t,e){this.children.inorderTraversal((function(n,r){r.foreach_(t.child(n),e)})),this.value&&e(t,this.value)},t.prototype.foreachChild=function(t){this.children.inorderTraversal((function(e,n){n.value&&t(e,n.value)}))},t.Empty=new t(null),t}(),he=function(){function t(t,e){this.source=t,this.path=e,this.type=ae.LISTEN_COMPLETE}return t.prototype.operationForChild=function(e){return this.path.isEmpty()?new t(this.source,K.Empty):new t(this.source,this.path.popFront())},t}(),de=function(){function t(t,e,n){this.source=t,this.path=e,this.snap=n,this.type=ae.OVERWRITE}return t.prototype.operationForChild=function(e){return this.path.isEmpty()?new t(this.source,K.Empty,this.snap.getImmediateChild(e)):new t(this.source,this.path.popFront(),this.snap)},t}(),fe=function(){function t(t,e,n){this.source=t,this.path=e,this.children=n,this.type=ae.MERGE}return t.prototype.operationForChild=function(e){if(this.path.isEmpty()){var n=this.children.subtree(new K(e));return n.isEmpty()?null:n.value?new de(this.source,K.Empty,n.value):new t(this.source,K.Empty,n)}return Object(o.e)(this.path.getFront()===e,"Can't get a merge for a child not on the path of the operation"),new t(this.source,this.path.popFront(),this.children)},t.prototype.toString=function(){return"Operation("+this.path+": "+this.source.toString()+" merge: "+this.children.toString()+")"},t}(),pe=function(){function t(t,e,n){this.node_=t,this.fullyInitialized_=e,this.filtered_=n}return t.prototype.isFullyInitialized=function(){return this.fullyInitialized_},t.prototype.isFiltered=function(){return this.filtered_},t.prototype.isCompleteForPath=function(t){if(t.isEmpty())return this.isFullyInitialized()&&!this.filtered_;var e=t.getFront();return this.isCompleteForChild(e)},t.prototype.isCompleteForChild=function(t){return this.isFullyInitialized()&&!this.filtered_||this.node_.hasChild(t)},t.prototype.getNode=function(){return this.node_},t}(),ge=function(){function t(t,e){this.eventCache_=t,this.serverCache_=e}return t.prototype.updateEventSnap=function(e,n,r){return new t(new pe(e,n,r),this.serverCache_)},t.prototype.updateServerSnap=function(e,n,r){return new t(this.eventCache_,new pe(e,n,r))},t.prototype.getEventCache=function(){return this.eventCache_},t.prototype.getCompleteEventSnap=function(){return this.eventCache_.isFullyInitialized()?this.eventCache_.getNode():null},t.prototype.getServerCache=function(){return this.serverCache_},t.prototype.getCompleteServerSnap=function(){return this.serverCache_.isFullyInitialized()?this.serverCache_.getNode():null},t.Empty=new t(new pe(Ft.EMPTY_NODE,!1,!1),new pe(Ft.EMPTY_NODE,!1,!1)),t}(),ye=function(){function t(t,e,n,r,i){this.type=t,this.snapshotNode=e,this.childName=n,this.oldSnap=r,this.prevName=i}return t.valueChange=function(e){return new t(t.VALUE,e)},t.childAddedChange=function(e,n){return new t(t.CHILD_ADDED,n,e)},t.childRemovedChange=function(e,n){return new t(t.CHILD_REMOVED,n,e)},t.childChangedChange=function(e,n,r){return new t(t.CHILD_CHANGED,n,e,r)},t.childMovedChange=function(e,n){return new t(t.CHILD_MOVED,n,e)},t.CHILD_ADDED="child_added",t.CHILD_REMOVED="child_removed",t.CHILD_CHANGED="child_changed",t.CHILD_MOVED="child_moved",t.VALUE="value",t}(),ve=function(){function t(t){this.index_=t}return t.prototype.updateChild=function(t,e,n,r,i,s){Object(o.e)(t.isIndexed(this.index_),"A node must be indexed if only a child is updated");var a=t.getImmediateChild(e);return a.getChild(r).equals(n.getChild(r))&&a.isEmpty()===n.isEmpty()?t:(null!=s&&(n.isEmpty()?t.hasChild(e)?s.trackChildChange(ye.childRemovedChange(e,a)):Object(o.e)(t.isLeafNode(),"A child remove without an old child only makes sense on a leaf node"):a.isEmpty()?s.trackChildChange(ye.childAddedChange(e,n)):s.trackChildChange(ye.childChangedChange(e,n,a))),t.isLeafNode()&&n.isEmpty()?t:t.updateImmediateChild(e,n).withIndex(this.index_))},t.prototype.updateFullNode=function(t,e,n){return null!=n&&(t.isLeafNode()||t.forEachChild(St,(function(t,r){e.hasChild(t)||n.trackChildChange(ye.childRemovedChange(t,r))})),e.isLeafNode()||e.forEachChild(St,(function(e,r){if(t.hasChild(e)){var i=t.getImmediateChild(e);i.equals(r)||n.trackChildChange(ye.childChangedChange(e,r,i))}else n.trackChildChange(ye.childAddedChange(e,r))}))),e.withIndex(this.index_)},t.prototype.updatePriority=function(t,e){return t.isEmpty()?Ft.EMPTY_NODE:t.updatePriority(e)},t.prototype.filtersNodes=function(){return!1},t.prototype.getIndexedFilter=function(){return this},t.prototype.getIndex=function(){return this.index_},t}(),me=function(){function t(){this.changeMap=new Map}return t.prototype.trackChildChange=function(t){var e=t.type,n=t.childName;Object(o.e)(e===ye.CHILD_ADDED||e===ye.CHILD_CHANGED||e===ye.CHILD_REMOVED,"Only child changes supported for tracking"),Object(o.e)(".priority"!==n,"Only non-priority child changes can be tracked.");var r=this.changeMap.get(n);if(r){var i=r.type;if(e===ye.CHILD_ADDED&&i===ye.CHILD_REMOVED)this.changeMap.set(n,ye.childChangedChange(n,t.snapshotNode,r.snapshotNode));else if(e===ye.CHILD_REMOVED&&i===ye.CHILD_ADDED)this.changeMap.delete(n);else if(e===ye.CHILD_REMOVED&&i===ye.CHILD_CHANGED)this.changeMap.set(n,ye.childRemovedChange(n,r.oldSnap));else if(e===ye.CHILD_CHANGED&&i===ye.CHILD_ADDED)this.changeMap.set(n,ye.childAddedChange(n,t.snapshotNode));else{if(e!==ye.CHILD_CHANGED||i!==ye.CHILD_CHANGED)throw Object(o.f)("Illegal combination of changes: "+t+" occurred after "+r);this.changeMap.set(n,ye.childChangedChange(n,t.snapshotNode,r.oldSnap))}}else this.changeMap.set(n,t)},t.prototype.getChanges=function(){return Array.from(this.changeMap.values())},t}(),be=new(function(){function t(){}return t.prototype.getCompleteChild=function(t){return null},t.prototype.getChildAfterChild=function(t,e,n){return null},t}()),_e=function(){function t(t,e,n){void 0===n&&(n=null),this.writes_=t,this.viewCache_=e,this.optCompleteServerCache_=n}return t.prototype.getCompleteChild=function(t){var e=this.viewCache_.getEventCache();if(e.isCompleteForChild(t))return e.getNode().getImmediateChild(t);var n=null!=this.optCompleteServerCache_?new pe(this.optCompleteServerCache_,!0,!1):this.viewCache_.getServerCache();return this.writes_.calcCompleteChild(t,n)},t.prototype.getChildAfterChild=function(t,e,n){var r=null!=this.optCompleteServerCache_?this.optCompleteServerCache_:this.viewCache_.getCompleteServerSnap(),i=this.writes_.calcIndexedSlice(r,e,1,n,t);return 0===i.length?null:i[0]},t}(),we=function(){return function(t,e){this.viewCache=t,this.changes=e}}(),Ee=function(){function t(t){this.filter_=t}return t.prototype.assertIndexed=function(t){Object(o.e)(t.getEventCache().getNode().isIndexed(this.filter_.getIndex()),"Event snap not indexed"),Object(o.e)(t.getServerCache().getNode().isIndexed(this.filter_.getIndex()),"Server snap not indexed")},t.prototype.applyOperation=function(e,n,r,i){var s,a,u=new me;if(n.type===ae.OVERWRITE){var c=n;c.source.fromUser?s=this.applyUserOverwrite_(e,c.path,c.snap,r,i,u):(Object(o.e)(c.source.fromServer,"Unknown source."),a=c.source.tagged||e.getServerCache().isFiltered()&&!c.path.isEmpty(),s=this.applyServerOverwrite_(e,c.path,c.snap,r,i,a,u))}else if(n.type===ae.MERGE){var l=n;l.source.fromUser?s=this.applyUserMerge_(e,l.path,l.children,r,i,u):(Object(o.e)(l.source.fromServer,"Unknown source."),a=l.source.tagged||e.getServerCache().isFiltered(),s=this.applyServerMerge_(e,l.path,l.children,r,i,a,u))}else if(n.type===ae.ACK_USER_WRITE){var h=n;s=h.revert?this.revertUserWrite_(e,h.path,r,i,u):this.ackUserWrite_(e,h.path,h.affectedTree,r,i,u)}else{if(n.type!==ae.LISTEN_COMPLETE)throw Object(o.f)("Unknown operation type: "+n.type);s=this.listenComplete_(e,n.path,r,u)}var d=u.getChanges();return t.maybeAddValueEvent_(e,s,d),new we(s,d)},t.maybeAddValueEvent_=function(t,e,n){var r=e.getEventCache();if(r.isFullyInitialized()){var i=r.getNode().isLeafNode()||r.getNode().isEmpty(),o=t.getCompleteEventSnap();(n.length>0||!t.getEventCache().isFullyInitialized()||i&&!r.getNode().equals(o)||!r.getNode().getPriority().equals(o.getPriority()))&&n.push(ye.valueChange(e.getCompleteEventSnap()))}},t.prototype.generateEventCacheAfterServerEvent_=function(t,e,n,r,i){var s=t.getEventCache();if(null!=n.shadowingWrite(e))return t;var a=void 0,u=void 0;if(e.isEmpty())if(Object(o.e)(t.getServerCache().isFullyInitialized(),"If change path is empty, we must have complete server data"),t.getServerCache().isFiltered()){var c=t.getCompleteServerSnap(),l=n.calcCompleteEventChildren(c instanceof Ft?c:Ft.EMPTY_NODE);a=this.filter_.updateFullNode(t.getEventCache().getNode(),l,i)}else{var h=n.calcCompleteEventCache(t.getCompleteServerSnap());a=this.filter_.updateFullNode(t.getEventCache().getNode(),h,i)}else{var d=e.getFront();if(".priority"===d){Object(o.e)(1===e.getLength(),"Can't have a priority with additional path components");var f=s.getNode();u=t.getServerCache().getNode();var p=n.calcEventCacheAfterServerOverwrite(e,f,u);a=null!=p?this.filter_.updatePriority(f,p):s.getNode()}else{var g=e.popFront(),y=void 0;if(s.isCompleteForChild(d)){u=t.getServerCache().getNode();var v=n.calcEventCacheAfterServerOverwrite(e,s.getNode(),u);y=null!=v?s.getNode().getImmediateChild(d).updateChild(g,v):s.getNode().getImmediateChild(d)}else y=n.calcCompleteChild(d,t.getServerCache());a=null!=y?this.filter_.updateChild(s.getNode(),d,y,g,r,i):s.getNode()}}return t.updateEventSnap(a,s.isFullyInitialized()||e.isEmpty(),this.filter_.filtersNodes())},t.prototype.applyServerOverwrite_=function(t,e,n,r,i,o,s){var a,u=t.getServerCache(),c=o?this.filter_:this.filter_.getIndexedFilter();if(e.isEmpty())a=c.updateFullNode(u.getNode(),n,null);else if(c.filtersNodes()&&!u.isFiltered()){var l=u.getNode().updateChild(e,n);a=c.updateFullNode(u.getNode(),l,null)}else{var h=e.getFront();if(!u.isCompleteForPath(e)&&e.getLength()>1)return t;var d=e.popFront(),f=u.getNode().getImmediateChild(h).updateChild(d,n);a=".priority"===h?c.updatePriority(u.getNode(),f):c.updateChild(u.getNode(),h,f,d,be,null)}var p=t.updateServerSnap(a,u.isFullyInitialized()||e.isEmpty(),c.filtersNodes()),g=new _e(r,p,i);return this.generateEventCacheAfterServerEvent_(p,e,r,g,s)},t.prototype.applyUserOverwrite_=function(t,e,n,r,i,o){var s,a,u=t.getEventCache(),c=new _e(r,t,i);if(e.isEmpty())a=this.filter_.updateFullNode(t.getEventCache().getNode(),n,o),s=t.updateEventSnap(a,!0,this.filter_.filtersNodes());else{var l=e.getFront();if(".priority"===l)a=this.filter_.updatePriority(t.getEventCache().getNode(),n),s=t.updateEventSnap(a,u.isFullyInitialized(),u.isFiltered());else{var h=e.popFront(),d=u.getNode().getImmediateChild(l),f=void 0;if(h.isEmpty())f=n;else{var p=c.getCompleteChild(l);f=null!=p?".priority"===h.getBack()&&p.getChild(h.parent()).isEmpty()?p:p.updateChild(h,n):Ft.EMPTY_NODE}if(d.equals(f))s=t;else{var g=this.filter_.updateChild(u.getNode(),l,f,h,c,o);s=t.updateEventSnap(g,u.isFullyInitialized(),this.filter_.filtersNodes())}}}return s},t.cacheHasChild_=function(t,e){return t.getEventCache().isCompleteForChild(e)},t.prototype.applyUserMerge_=function(e,n,r,i,o,s){var a=this,u=e;return r.foreach((function(r,c){var l=n.child(r);t.cacheHasChild_(e,l.getFront())&&(u=a.applyUserOverwrite_(u,l,c,i,o,s))})),r.foreach((function(r,c){var l=n.child(r);t.cacheHasChild_(e,l.getFront())||(u=a.applyUserOverwrite_(u,l,c,i,o,s))})),u},t.prototype.applyMerge_=function(t,e){return e.foreach((function(e,n){t=t.updateChild(e,n)})),t},t.prototype.applyServerMerge_=function(t,e,n,r,i,o,s){var a=this;if(t.getServerCache().getNode().isEmpty()&&!t.getServerCache().isFullyInitialized())return t;var u,c=t;u=e.isEmpty()?n:le.Empty.setTree(e,n);var l=t.getServerCache().getNode();return u.children.inorderTraversal((function(e,n){if(l.hasChild(e)){var u=t.getServerCache().getNode().getImmediateChild(e),h=a.applyMerge_(u,n);c=a.applyServerOverwrite_(c,new K(e),h,r,i,o,s)}})),u.children.inorderTraversal((function(e,n){var u=!t.getServerCache().isCompleteForChild(e)&&null==n.value;if(!l.hasChild(e)&&!u){var h=t.getServerCache().getNode().getImmediateChild(e),d=a.applyMerge_(h,n);c=a.applyServerOverwrite_(c,new K(e),d,r,i,o,s)}})),c},t.prototype.ackUserWrite_=function(t,e,n,r,i,o){if(null!=r.shadowingWrite(e))return t;var s=t.getServerCache().isFiltered(),a=t.getServerCache();if(null!=n.value){if(e.isEmpty()&&a.isFullyInitialized()||a.isCompleteForPath(e))return this.applyServerOverwrite_(t,e,a.getNode().getChild(e),r,i,s,o);if(e.isEmpty()){var u=le.Empty;return a.getNode().forEachChild(Et,(function(t,e){u=u.set(new K(t),e)})),this.applyServerMerge_(t,e,u,r,i,s,o)}return t}var c=le.Empty;return n.foreach((function(t,n){var r=e.child(t);a.isCompleteForPath(r)&&(c=c.set(t,a.getNode().getChild(r)))})),this.applyServerMerge_(t,e,c,r,i,s,o)},t.prototype.listenComplete_=function(t,e,n,r){var i=t.getServerCache(),o=t.updateServerSnap(i.getNode(),i.isFullyInitialized()||e.isEmpty(),i.isFiltered());return this.generateEventCacheAfterServerEvent_(o,e,n,be,r)},t.prototype.revertUserWrite_=function(t,e,n,r,i){var s;if(null!=n.shadowingWrite(e))return t;var a=new _e(n,t,r),u=t.getEventCache().getNode(),c=void 0;if(e.isEmpty()||".priority"===e.getFront()){var l=void 0;if(t.getServerCache().isFullyInitialized())l=n.calcCompleteEventCache(t.getCompleteServerSnap());else{var h=t.getServerCache().getNode();Object(o.e)(h instanceof Ft,"serverChildren would be complete if leaf node"),l=n.calcCompleteEventChildren(h)}c=this.filter_.updateFullNode(u,l=l,i)}else{var d=e.getFront(),f=n.calcCompleteChild(d,t.getServerCache());null==f&&t.getServerCache().isCompleteForChild(d)&&(f=u.getImmediateChild(d)),(c=null!=f?this.filter_.updateChild(u,d,f,e.popFront(),a,i):t.getEventCache().getNode().hasChild(d)?this.filter_.updateChild(u,d,Ft.EMPTY_NODE,e.popFront(),a,i):u).isEmpty()&&t.getServerCache().isFullyInitialized()&&(s=n.calcCompleteEventCache(t.getCompleteServerSnap())).isLeafNode()&&(c=this.filter_.updateFullNode(c,s,i))}return s=t.getServerCache().isFullyInitialized()||null!=n.shadowingWrite(K.Empty),t.updateEventSnap(c,s,this.filter_.filtersNodes())},t}(),Oe=function(){function t(t){this.query_=t,this.index_=this.query_.getQueryParams().getIndex()}return t.prototype.generateEventsForChanges=function(t,e,n){var r=this,i=[],o=[];return t.forEach((function(t){t.type===ye.CHILD_CHANGED&&r.index_.indexedValueChanged(t.oldSnap,t.snapshotNode)&&o.push(ye.childMovedChange(t.childName,t.snapshotNode))})),this.generateEventsForType_(i,ye.CHILD_REMOVED,t,n,e),this.generateEventsForType_(i,ye.CHILD_ADDED,t,n,e),this.generateEventsForType_(i,ye.CHILD_MOVED,o,n,e),this.generateEventsForType_(i,ye.CHILD_CHANGED,t,n,e),this.generateEventsForType_(i,ye.VALUE,t,n,e),i},t.prototype.generateEventsForType_=function(t,e,n,r,i){var o=this,s=n.filter((function(t){return t.type===e}));s.sort(this.compareChanges_.bind(this)),s.forEach((function(e){var n=o.materializeSingleChange_(e,i);r.forEach((function(r){r.respondsTo(e.type)&&t.push(r.createEvent(n,o.query_))}))}))},t.prototype.materializeSingleChange_=function(t,e){return"value"===t.type||"child_removed"===t.type||(t.prevName=e.getPredecessorChildName(t.childName,t.snapshotNode,this.index_)),t},t.prototype.compareChanges_=function(t,e){if(null==t.childName||null==e.childName)throw Object(o.f)("Should only compare child_ events.");var n=new bt(t.childName,t.snapshotNode),r=new bt(e.childName,e.snapshotNode);return this.index_.compare(n,r)},t}(),Ce=function(){function t(t,e){this.query_=t,this.eventRegistrations_=[];var n=this.query_.getQueryParams(),r=new ve(n.getIndex()),i=n.getNodeFilter();this.processor_=new Ee(i);var o=e.getServerCache(),s=e.getEventCache(),a=r.updateFullNode(Ft.EMPTY_NODE,o.getNode(),null),u=i.updateFullNode(Ft.EMPTY_NODE,s.getNode(),null),c=new pe(a,o.isFullyInitialized(),r.filtersNodes()),l=new pe(u,s.isFullyInitialized(),i.filtersNodes());this.viewCache_=new ge(l,c),this.eventGenerator_=new Oe(this.query_)}return t.prototype.getQuery=function(){return this.query_},t.prototype.getServerCache=function(){return this.viewCache_.getServerCache().getNode()},t.prototype.getCompleteServerCache=function(t){var e=this.viewCache_.getCompleteServerSnap();return e&&(this.query_.getQueryParams().loadsAllData()||!t.isEmpty()&&!e.getImmediateChild(t.getFront()).isEmpty())?e.getChild(t):null},t.prototype.isEmpty=function(){return 0===this.eventRegistrations_.length},t.prototype.addEventRegistration=function(t){this.eventRegistrations_.push(t)},t.prototype.removeEventRegistration=function(t,e){var n=[];if(e){Object(o.e)(null==t,"A cancel should cancel all event registrations.");var r=this.query_.path;this.eventRegistrations_.forEach((function(t){var i=t.createCancelEvent(e=e,r);i&&n.push(i)}))}if(t){for(var i=[],s=0;s<this.eventRegistrations_.length;++s){var a=this.eventRegistrations_[s];if(a.matches(t)){if(t.hasAnyCallback()){i=i.concat(this.eventRegistrations_.slice(s+1));break}}else i.push(a)}this.eventRegistrations_=i}else this.eventRegistrations_=[];return n},t.prototype.applyOperation=function(t,e,n){t.type===ae.MERGE&&null!==t.source.queryId&&(Object(o.e)(this.viewCache_.getCompleteServerSnap(),"We should always have a full cache before handling merges"),Object(o.e)(this.viewCache_.getCompleteEventSnap(),"Missing event cache, even though we have a server cache"));var r=this.viewCache_,i=this.processor_.applyOperation(r,t,e,n);return this.processor_.assertIndexed(i.viewCache),Object(o.e)(i.viewCache.getServerCache().isFullyInitialized()||!r.getServerCache().isFullyInitialized(),"Once a server snap is complete, it should never go back"),this.viewCache_=i.viewCache,this.generateEventsForChanges_(i.changes,i.viewCache.getEventCache().getNode(),null)},t.prototype.getInitialEvents=function(t){var e=this.viewCache_.getEventCache(),n=[];return e.getNode().isLeafNode()||e.getNode().forEachChild(St,(function(t,e){n.push(ye.childAddedChange(t,e))})),e.isFullyInitialized()&&n.push(ye.valueChange(e.getNode())),this.generateEventsForChanges_(n,e.getNode(),t)},t.prototype.generateEventsForChanges_=function(t,e,n){return this.eventGenerator_.generateEventsForChanges(t,e,n?[n]:this.eventRegistrations_)},t}(),Te=function(){function t(){this.views=new Map}return Object.defineProperty(t,"__referenceConstructor",{get:function(){return Object(o.e)(oe,"Reference.ts has not been loaded"),oe},set:function(t){Object(o.e)(!oe,"__referenceConstructor has already been defined"),oe=t},enumerable:!1,configurable:!0}),t.prototype.isEmpty=function(){return 0===this.views.size},t.prototype.applyOperation=function(t,e,n){var r,s,a=t.source.queryId;if(null!==a){var u=this.views.get(a);return Object(o.e)(null!=u,"SyncTree gave us an op for an invalid query."),u.applyOperation(t,e,n)}var c=[];try{for(var l=Object(i.i)(this.views.values()),h=l.next();!h.done;h=l.next())c=c.concat((u=h.value).applyOperation(t,e,n))}catch(d){r={error:d}}finally{try{h&&!h.done&&(s=l.return)&&s.call(l)}finally{if(r)throw r.error}}return c},t.prototype.addEventRegistration=function(t,e,n,r,i){var o=t.queryIdentifier(),s=this.views.get(o);if(!s){var a=n.calcCompleteEventCache(i?r:null),u=!1;a?u=!0:r instanceof Ft?(a=n.calcCompleteEventChildren(r),u=!1):(a=Ft.EMPTY_NODE,u=!1);var c=new ge(new pe(a,u,!1),new pe(r,i,!1));s=new Ce(t,c),this.views.set(o,s)}return s.addEventRegistration(e),s.getInitialEvents(e)},t.prototype.removeEventRegistration=function(e,n,r){var o,s,a=e.queryIdentifier(),u=[],c=[],l=this.hasCompleteView();if("default"===a)try{for(var h=Object(i.i)(this.views.entries()),d=h.next();!d.done;d=h.next()){var f,p=Object(i.f)(d.value,2),g=p[0];c=c.concat((f=p[1]).removeEventRegistration(n,r)),f.isEmpty()&&(this.views.delete(g),f.getQuery().getQueryParams().loadsAllData()||u.push(f.getQuery()))}}catch(y){o={error:y}}finally{try{d&&!d.done&&(s=h.return)&&s.call(h)}finally{if(o)throw o.error}}else(f=this.views.get(a))&&(c=c.concat(f.removeEventRegistration(n,r)),f.isEmpty()&&(this.views.delete(a),f.getQuery().getQueryParams().loadsAllData()||u.push(f.getQuery())));return l&&!this.hasCompleteView()&&u.push(new t.__referenceConstructor(e.repo,e.path)),{removed:u,events:c}},t.prototype.getQueryViews=function(){var t,e,n=[];try{for(var r=Object(i.i)(this.views.values()),o=r.next();!o.done;o=r.next()){var s=o.value;s.getQuery().getQueryParams().loadsAllData()||n.push(s)}}catch(a){t={error:a}}finally{try{o&&!o.done&&(e=r.return)&&e.call(r)}finally{if(t)throw t.error}}return n},t.prototype.getCompleteServerCache=function(t){var e,n,r=null;try{for(var o=Object(i.i)(this.views.values()),s=o.next();!s.done;s=o.next())r=r||s.value.getCompleteServerCache(t)}catch(a){e={error:a}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}return r},t.prototype.viewForQuery=function(t){if(t.getQueryParams().loadsAllData())return this.getCompleteView();var e=t.queryIdentifier();return this.views.get(e)},t.prototype.viewExistsForQuery=function(t){return null!=this.viewForQuery(t)},t.prototype.hasCompleteView=function(){return null!=this.getCompleteView()},t.prototype.getCompleteView=function(){var t,e;try{for(var n=Object(i.i)(this.views.values()),r=n.next();!r.done;r=n.next()){var o=r.value;if(o.getQuery().getQueryParams().loadsAllData())return o}}catch(s){t={error:s}}finally{try{r&&!r.done&&(e=n.return)&&e.call(n)}finally{if(t)throw t.error}}return null},t}(),Se=function(){function t(t){this.writeTree_=t}return t.prototype.addWrite=function(e,n){if(e.isEmpty())return new t(new le(n));var r=this.writeTree_.findRootMostValueAndPath(e);if(null!=r){var i=r.path,o=r.value,s=K.relativePath(i,e);return o=o.updateChild(s,n),new t(this.writeTree_.set(i,o))}var a=new le(n);return new t(this.writeTree_.setTree(e,a))},t.prototype.addWrites=function(t,e){var n=this;return R(e,(function(e,r){n=n.addWrite(t.child(e),r)})),n},t.prototype.removeWrite=function(e){return e.isEmpty()?t.Empty:new t(this.writeTree_.setTree(e,le.Empty))},t.prototype.hasCompleteWrite=function(t){return null!=this.getCompleteNode(t)},t.prototype.getCompleteNode=function(t){var e=this.writeTree_.findRootMostValueAndPath(t);return null!=e?this.writeTree_.get(e.path).getChild(K.relativePath(e.path,t)):null},t.prototype.getCompleteChildren=function(){var t=[],e=this.writeTree_.value;return null!=e?e.isLeafNode()||e.forEachChild(St,(function(e,n){t.push(new bt(e,n))})):this.writeTree_.children.inorderTraversal((function(e,n){null!=n.value&&t.push(new bt(e,n.value))})),t},t.prototype.childCompoundWrite=function(e){if(e.isEmpty())return this;var n=this.getCompleteNode(e);return new t(null!=n?new le(n):this.writeTree_.subtree(e))},t.prototype.isEmpty=function(){return this.writeTree_.isEmpty()},t.prototype.apply=function(t){return function t(e,n,r){if(null!=n.value)return r.updateChild(e,n.value);var i=null;return n.children.inorderTraversal((function(n,s){".priority"===n?(Object(o.e)(null!==s.value,"Priority writes must always be leaf nodes"),i=s.value):r=t(e.child(n),s,r)})),r.getChild(e).isEmpty()||null===i||(r=r.updateChild(e.child(".priority"),i)),r}(K.Empty,this.writeTree_,t)},t.Empty=new t(new le(null)),t}(),Ie=function(){function t(){this.visibleWrites_=Se.Empty,this.allWrites_=[],this.lastWriteId_=-1}return t.prototype.childWrites=function(t){return new je(t,this)},t.prototype.addOverwrite=function(t,e,n,r){Object(o.e)(n>this.lastWriteId_,"Stacking an older write on top of newer ones"),void 0===r&&(r=!0),this.allWrites_.push({path:t,snap:e,writeId:n,visible:r}),r&&(this.visibleWrites_=this.visibleWrites_.addWrite(t,e)),this.lastWriteId_=n},t.prototype.addMerge=function(t,e,n){Object(o.e)(n>this.lastWriteId_,"Stacking an older merge on top of newer ones"),this.allWrites_.push({path:t,children:e,writeId:n,visible:!0}),this.visibleWrites_=this.visibleWrites_.addWrites(t,e),this.lastWriteId_=n},t.prototype.getWrite=function(t){for(var e=0;e<this.allWrites_.length;e++){var n=this.allWrites_[e];if(n.writeId===t)return n}return null},t.prototype.removeWrite=function(t){var e=this,n=this.allWrites_.findIndex((function(e){return e.writeId===t}));Object(o.e)(n>=0,"removeWrite called with nonexistent writeId.");var r=this.allWrites_[n];this.allWrites_.splice(n,1);for(var i=r.visible,s=!1,a=this.allWrites_.length-1;i&&a>=0;){var u=this.allWrites_[a];u.visible&&(a>=n&&this.recordContainsPath_(u,r.path)?i=!1:r.path.contains(u.path)&&(s=!0)),a--}return!!i&&(s?(this.resetTree_(),!0):(r.snap?this.visibleWrites_=this.visibleWrites_.removeWrite(r.path):R(r.children,(function(t){e.visibleWrites_=e.visibleWrites_.removeWrite(r.path.child(t))})),!0))},t.prototype.getCompleteWriteData=function(t){return this.visibleWrites_.getCompleteNode(t)},t.prototype.calcCompleteEventCache=function(e,n,r,i){if(r||i){var o=this.visibleWrites_.childCompoundWrite(e);return!i&&o.isEmpty()?n:i||null!=n||o.hasCompleteWrite(K.Empty)?t.layerTree_(this.allWrites_,(function(t){return(t.visible||i)&&(!r||!~r.indexOf(t.writeId))&&(t.path.contains(e)||e.contains(t.path))}),e).apply(n||Ft.EMPTY_NODE):null}var s=this.visibleWrites_.getCompleteNode(e);if(null!=s)return s;var a=this.visibleWrites_.childCompoundWrite(e);return a.isEmpty()?n:null!=n||a.hasCompleteWrite(K.Empty)?a.apply(n||Ft.EMPTY_NODE):null},t.prototype.calcCompleteEventChildren=function(t,e){var n=Ft.EMPTY_NODE,r=this.visibleWrites_.getCompleteNode(t);if(r)return r.isLeafNode()||r.forEachChild(St,(function(t,e){n=n.updateImmediateChild(t,e)})),n;if(e){var i=this.visibleWrites_.childCompoundWrite(t);return e.forEachChild(St,(function(t,e){var r=i.childCompoundWrite(new K(t)).apply(e);n=n.updateImmediateChild(t,r)})),i.getCompleteChildren().forEach((function(t){n=n.updateImmediateChild(t.name,t.node)})),n}return this.visibleWrites_.childCompoundWrite(t).getCompleteChildren().forEach((function(t){n=n.updateImmediateChild(t.name,t.node)})),n},t.prototype.calcEventCacheAfterServerOverwrite=function(t,e,n,r){Object(o.e)(n||r,"Either existingEventSnap or existingServerSnap must exist");var i=t.child(e);if(this.visibleWrites_.hasCompleteWrite(i))return null;var s=this.visibleWrites_.childCompoundWrite(i);return s.isEmpty()?r.getChild(e):s.apply(r.getChild(e))},t.prototype.calcCompleteChild=function(t,e,n){var r=t.child(e),i=this.visibleWrites_.getCompleteNode(r);return null!=i?i:n.isCompleteForChild(e)?this.visibleWrites_.childCompoundWrite(r).apply(n.getNode().getImmediateChild(e)):null},t.prototype.shadowingWrite=function(t){return this.visibleWrites_.getCompleteNode(t)},t.prototype.calcIndexedSlice=function(t,e,n,r,i,o){var s,a=this.visibleWrites_.childCompoundWrite(t),u=a.getCompleteNode(K.Empty);if(null!=u)s=u;else{if(null==e)return[];s=a.apply(e)}if((s=s.withIndex(o)).isEmpty()||s.isLeafNode())return[];for(var c=[],l=o.getCompare(),h=i?s.getReverseIteratorFrom(n,o):s.getIteratorFrom(n,o),d=h.getNext();d&&c.length<r;)0!==l(d,n)&&c.push(d),d=h.getNext();return c},t.prototype.recordContainsPath_=function(t,e){if(t.snap)return t.path.contains(e);for(var n in t.children)if(t.children.hasOwnProperty(n)&&t.path.child(n).contains(e))return!0;return!1},t.prototype.resetTree_=function(){this.visibleWrites_=t.layerTree_(this.allWrites_,t.DefaultFilter_,K.Empty),this.lastWriteId_=this.allWrites_.length>0?this.allWrites_[this.allWrites_.length-1].writeId:-1},t.DefaultFilter_=function(t){return t.visible},t.layerTree_=function(t,e,n){for(var r=Se.Empty,i=0;i<t.length;++i){var s=t[i];if(e(s)){var a=s.path,u=void 0;if(s.snap)n.contains(a)?(u=K.relativePath(n,a),r=r.addWrite(u,s.snap)):a.contains(n)&&(u=K.relativePath(a,n),r=r.addWrite(K.Empty,s.snap.getChild(u)));else{if(!s.children)throw Object(o.f)("WriteRecord should have .snap or .children");if(n.contains(a))u=K.relativePath(n,a),r=r.addWrites(u,s.children);else if(a.contains(n))if((u=K.relativePath(a,n)).isEmpty())r=r.addWrites(K.Empty,s.children);else{var c=Object(o.D)(s.children,u.getFront());if(c){var l=c.getChild(u.popFront());r=r.addWrite(K.Empty,l)}}}}}return r},t}(),je=function(){function t(t,e){this.treePath_=t,this.writeTree_=e}return t.prototype.calcCompleteEventCache=function(t,e,n){return this.writeTree_.calcCompleteEventCache(this.treePath_,t,e,n)},t.prototype.calcCompleteEventChildren=function(t){return this.writeTree_.calcCompleteEventChildren(this.treePath_,t)},t.prototype.calcEventCacheAfterServerOverwrite=function(t,e,n){return this.writeTree_.calcEventCacheAfterServerOverwrite(this.treePath_,t,e,n)},t.prototype.shadowingWrite=function(t){return this.writeTree_.shadowingWrite(this.treePath_.child(t))},t.prototype.calcIndexedSlice=function(t,e,n,r,i){return this.writeTree_.calcIndexedSlice(this.treePath_,t,e,n,r,i)},t.prototype.calcCompleteChild=function(t,e){return this.writeTree_.calcCompleteChild(this.treePath_,t,e)},t.prototype.child=function(e){return new t(this.treePath_.child(e),this.writeTree_)},t}(),xe=function(){function t(t){this.listenProvider_=t,this.syncPointTree_=le.Empty,this.pendingWriteTree_=new Ie,this.tagToQueryMap=new Map,this.queryToTagMap=new Map}return t.prototype.applyUserOverwrite=function(t,e,n,r){return this.pendingWriteTree_.addOverwrite(t,e,n,r),r?this.applyOperationToSyncPoints_(new de(ue.User,t,e)):[]},t.prototype.applyUserMerge=function(t,e,n){this.pendingWriteTree_.addMerge(t,e,n);var r=le.fromObject(e);return this.applyOperationToSyncPoints_(new fe(ue.User,t,r))},t.prototype.ackUserWrite=function(t,e){void 0===e&&(e=!1);var n=this.pendingWriteTree_.getWrite(t);if(this.pendingWriteTree_.removeWrite(t)){var r=le.Empty;return null!=n.snap?r=r.set(K.Empty,!0):R(n.children,(function(t,e){r=r.set(new K(t),e)})),this.applyOperationToSyncPoints_(new ce(n.path,r,e))}return[]},t.prototype.applyServerOverwrite=function(t,e){return this.applyOperationToSyncPoints_(new de(ue.Server,t,e))},t.prototype.applyServerMerge=function(t,e){var n=le.fromObject(e);return this.applyOperationToSyncPoints_(new fe(ue.Server,t,n))},t.prototype.applyListenComplete=function(t){return this.applyOperationToSyncPoints_(new he(ue.Server,t))},t.prototype.applyTaggedQueryOverwrite=function(e,n,r){var i=this.queryKeyForTag_(r);if(null!=i){var o=t.parseQueryKey_(i),s=o.path,a=o.queryId,u=K.relativePath(s,e),c=new de(ue.forServerTaggedQuery(a),u,n);return this.applyTaggedOperation_(s,c)}return[]},t.prototype.applyTaggedQueryMerge=function(e,n,r){var i=this.queryKeyForTag_(r);if(i){var o=t.parseQueryKey_(i),s=o.path,a=o.queryId,u=K.relativePath(s,e),c=le.fromObject(n),l=new fe(ue.forServerTaggedQuery(a),u,c);return this.applyTaggedOperation_(s,l)}return[]},t.prototype.applyTaggedListenComplete=function(e,n){var r=this.queryKeyForTag_(n);if(r){var i=t.parseQueryKey_(r),o=i.path,s=i.queryId,a=K.relativePath(o,e),u=new he(ue.forServerTaggedQuery(s),a);return this.applyTaggedOperation_(o,u)}return[]},t.prototype.addEventRegistration=function(e,n){var r=e.path,i=null,s=!1;this.syncPointTree_.foreachOnPath(r,(function(t,e){var n=K.relativePath(t,r);i=i||e.getCompleteServerCache(n),s=s||e.hasCompleteView()}));var a,u=this.syncPointTree_.get(r);u?(s=s||u.hasCompleteView(),i=i||u.getCompleteServerCache(K.Empty)):(u=new Te,this.syncPointTree_=this.syncPointTree_.set(r,u)),null!=i?a=!0:(a=!1,i=Ft.EMPTY_NODE,this.syncPointTree_.subtree(r).foreachChild((function(t,e){var n=e.getCompleteServerCache(K.Empty);n&&(i=i.updateImmediateChild(t,n))})));var c=u.viewExistsForQuery(e);if(!c&&!e.getQueryParams().loadsAllData()){var l=t.makeQueryKey_(e);Object(o.e)(!this.queryToTagMap.has(l),"View does not exist, but we have a tag");var h=t.getNextQueryTag_();this.queryToTagMap.set(l,h),this.tagToQueryMap.set(h,l)}var d=this.pendingWriteTree_.childWrites(r),f=u.addEventRegistration(e,n,d,i,a);if(!c&&!s){var p=u.viewForQuery(e);f=f.concat(this.setupListener_(e,p))}return f},t.prototype.removeEventRegistration=function(e,n,r){var i=this,o=e.path,s=this.syncPointTree_.get(o),a=[];if(s&&("default"===e.queryIdentifier()||s.viewExistsForQuery(e))){var u=s.removeEventRegistration(e,n,r);s.isEmpty()&&(this.syncPointTree_=this.syncPointTree_.remove(o));var c=u.removed;a=u.events;var l=-1!==c.findIndex((function(t){return t.getQueryParams().loadsAllData()})),h=this.syncPointTree_.findOnPath(o,(function(t,e){return e.hasCompleteView()}));if(l&&!h){var d=this.syncPointTree_.subtree(o);if(!d.isEmpty())for(var f=this.collectDistinctViewsForSubTree_(d),p=0;p<f.length;++p){var g=f[p],y=g.getQuery(),v=this.createListenerForView_(g);this.listenProvider_.startListening(t.queryForListening_(y),this.tagForQuery_(y),v.hashFn,v.onComplete)}}!h&&c.length>0&&!r&&(l?this.listenProvider_.stopListening(t.queryForListening_(e),null):c.forEach((function(e){var n=i.queryToTagMap.get(t.makeQueryKey_(e));i.listenProvider_.stopListening(t.queryForListening_(e),n)}))),this.removeTags_(c)}return a},t.prototype.calcCompleteEventCache=function(t,e){var n=this.pendingWriteTree_,r=this.syncPointTree_.findOnPath(t,(function(e,n){var r=K.relativePath(e,t),i=n.getCompleteServerCache(r);if(i)return i}));return n.calcCompleteEventCache(t,r,e,!0)},t.prototype.collectDistinctViewsForSubTree_=function(t){return t.fold((function(t,e,n){if(e&&e.hasCompleteView())return[e.getCompleteView()];var r=[];return e&&(r=e.getQueryViews()),R(n,(function(t,e){r=r.concat(e)})),r}))},t.prototype.removeTags_=function(e){for(var n=0;n<e.length;++n){var r=e[n];if(!r.getQueryParams().loadsAllData()){var i=t.makeQueryKey_(r),o=this.queryToTagMap.get(i);this.queryToTagMap.delete(i),this.tagToQueryMap.delete(o)}}},t.queryForListening_=function(t){return t.getQueryParams().loadsAllData()&&!t.getQueryParams().isDefault()?t.getRef():t},t.prototype.setupListener_=function(e,n){var r=e.path,i=this.tagForQuery_(e),s=this.createListenerForView_(n),a=this.listenProvider_.startListening(t.queryForListening_(e),i,s.hashFn,s.onComplete),u=this.syncPointTree_.subtree(r);if(i)Object(o.e)(!u.value.hasCompleteView(),"If we're adding a query, it shouldn't be shadowed");else for(var c=u.fold((function(t,e,n){if(!t.isEmpty()&&e&&e.hasCompleteView())return[e.getCompleteView().getQuery()];var r=[];return e&&(r=r.concat(e.getQueryViews().map((function(t){return t.getQuery()})))),R(n,(function(t,e){r=r.concat(e)})),r})),l=0;l<c.length;++l){var h=c[l];this.listenProvider_.stopListening(t.queryForListening_(h),this.tagForQuery_(h))}return a},t.prototype.createListenerForView_=function(t){var e=this,n=t.getQuery(),r=this.tagForQuery_(n);return{hashFn:function(){return(t.getServerCache()||Ft.EMPTY_NODE).hash()},onComplete:function(t){if("ok"===t)return r?e.applyTaggedListenComplete(n.path,r):e.applyListenComplete(n.path);var i=function(t,e){var n="Unknown Error";"too_big"===t?n="The data requested exceeds the maximum size that can be accessed with a single request.":"permission_denied"===t?n="Client doesn't have permission to access the desired data.":"unavailable"===t&&(n="The service is unavailable");var r=new Error(t+" at "+e.path.toString()+": "+n);return r.code=t.toUpperCase(),r}(t,n);return e.removeEventRegistration(n,null,i)}}},t.makeQueryKey_=function(t){return t.path.toString()+"$"+t.queryIdentifier()},t.parseQueryKey_=function(t){var e=t.indexOf("$");return Object(o.e)(-1!==e&&e<t.length-1,"Bad queryKey."),{queryId:t.substr(e+1),path:new K(t.substr(0,e))}},t.prototype.queryKeyForTag_=function(t){return this.tagToQueryMap.get(t)},t.prototype.tagForQuery_=function(e){var n=t.makeQueryKey_(e);return this.queryToTagMap.get(n)},t.getNextQueryTag_=function(){return t.nextQueryTag_++},t.prototype.applyTaggedOperation_=function(t,e){var n=this.syncPointTree_.get(t);Object(o.e)(n,"Missing sync point for query tag that we're tracking");var r=this.pendingWriteTree_.childWrites(t);return n.applyOperation(e,r,null)},t.prototype.applyOperationToSyncPoints_=function(t){return this.applyOperationHelper_(t,this.syncPointTree_,null,this.pendingWriteTree_.childWrites(K.Empty))},t.prototype.applyOperationHelper_=function(t,e,n,r){if(t.path.isEmpty())return this.applyOperationDescendantsHelper_(t,e,n,r);var i=e.get(K.Empty);null==n&&null!=i&&(n=i.getCompleteServerCache(K.Empty));var o=[],s=t.path.getFront(),a=t.operationForChild(s),u=e.children.get(s);if(u&&a){var c=n?n.getImmediateChild(s):null,l=r.child(s);o=o.concat(this.applyOperationHelper_(a,u,c,l))}return i&&(o=o.concat(i.applyOperation(t,r,n))),o},t.prototype.applyOperationDescendantsHelper_=function(t,e,n,r){var i=this,o=e.get(K.Empty);null==n&&null!=o&&(n=o.getCompleteServerCache(K.Empty));var s=[];return e.children.inorderTraversal((function(e,o){var a=n?n.getImmediateChild(e):null,u=r.child(e),c=t.operationForChild(e);c&&(s=s.concat(i.applyOperationDescendantsHelper_(c,o,a,u)))})),o&&(s=s.concat(o.applyOperation(t,r,n))),s},t.nextQueryTag_=1,t}(),Ae=function(){function t(){this.rootNode_=Ft.EMPTY_NODE}return t.prototype.getNode=function(t){return this.rootNode_.getChild(t)},t.prototype.updateSnapshot=function(t,e){this.rootNode_=this.rootNode_.updateChild(t,e)},t}(),ke=function(){function t(){this.counters_={}}return t.prototype.incrementCounter=function(t,e){void 0===e&&(e=1),Object(o.i)(this.counters_,t)||(this.counters_[t]=0),this.counters_[t]+=e},t.prototype.get=function(){return Object(o.k)(this.counters_)},t}(),Ne=function(){function t(){}return t.getCollection=function(t){var e=t.toString();return this.collections_[e]||(this.collections_[e]=new ke),this.collections_[e]},t.getOrCreateReporter=function(t,e){var n=t.toString();return this.reporters_[n]||(this.reporters_[n]=e()),this.reporters_[n]},t.collections_={},t.reporters_={},t}(),Re=function(){function t(t){this.collection_=t,this.last_=null}return t.prototype.get=function(){var t=this.collection_.get(),e=Object(i.a)({},t);return this.last_&&R(this.last_,(function(t,n){e[t]=e[t]-n})),this.last_=t,e},t}(),Pe=function(){function t(t,e){this.server_=e,this.statsToReport_={},this.statsListener_=new Re(t);var n=1e4+2e4*Math.random();Q(this.reportStats_.bind(this),Math.floor(n))}return t.prototype.includeStat=function(t){this.statsToReport_[t]=!0},t.prototype.reportStats_=function(){var t=this,e=this.statsListener_.get(),n={},r=!1;R(e,(function(e,i){i>0&&Object(o.i)(t.statsToReport_,e)&&(n[e]=i,r=!0)})),r&&this.server_.reportStats(n),Q(this.reportStats_.bind(this),Math.floor(2*Math.random()*3e5))},t}(),De=function(){function t(){this.eventLists_=[],this.recursionDepth_=0}return t.prototype.queueEvents=function(t){for(var e=null,n=0;n<t.length;n++){var r=t[n],i=r.getPath();null===e||i.equals(e.getPath())||(this.eventLists_.push(e),e=null),null===e&&(e=new Le(i)),e.add(r)}e&&this.eventLists_.push(e)},t.prototype.raiseEventsAtPath=function(t,e){this.queueEvents(e),this.raiseQueuedEventsMatchingPredicate_((function(e){return e.equals(t)}))},t.prototype.raiseEventsForChangedPath=function(t,e){this.queueEvents(e),this.raiseQueuedEventsMatchingPredicate_((function(e){return e.contains(t)||t.contains(e)}))},t.prototype.raiseQueuedEventsMatchingPredicate_=function(t){this.recursionDepth_++;for(var e=!0,n=0;n<this.eventLists_.length;n++){var r=this.eventLists_[n];r&&(t(r.getPath())?(this.eventLists_[n].raise(),this.eventLists_[n]=null):e=!1)}e&&(this.eventLists_=[]),this.recursionDepth_--},t}(),Le=function(){function t(t){this.path_=t,this.events_=[]}return t.prototype.add=function(t){this.events_.push(t)},t.prototype.raise=function(){for(var t=0;t<this.events_.length;t++){var e=this.events_[t];if(null!==e){this.events_[t]=null;var n=e.getEventRunner();v&&_("event: "+e.toString()),G(n)}}},t.prototype.getPath=function(){return this.path_},t}(),Me=function(){function t(t){this.allowedEvents_=t,this.listeners_={},Object(o.e)(Array.isArray(t)&&t.length>0,"Requires a non-empty array")}return t.prototype.trigger=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(Array.isArray(this.listeners_[t]))for(var r=Object(i.g)(this.listeners_[t]),o=0;o<r.length;o++)r[o].callback.apply(r[o].context,e)},t.prototype.on=function(t,e,n){this.validateEventType_(t),this.listeners_[t]=this.listeners_[t]||[],this.listeners_[t].push({callback:e,context:n});var r=this.getInitialEvent(t);r&&e.apply(n,r)},t.prototype.off=function(t,e,n){this.validateEventType_(t);for(var r=this.listeners_[t]||[],i=0;i<r.length;i++)if(r[i].callback===e&&(!n||n===r[i].context))return void r.splice(i,1)},t.prototype.validateEventType_=function(t){Object(o.e)(this.allowedEvents_.find((function(e){return e===t})),"Unknown event: "+t)},t}(),Fe=function(t){function e(){var e,n,r=t.call(this,["visible"])||this;return"undefined"!=typeof document&&void 0!==document.addEventListener&&(void 0!==document.hidden?(n="visibilitychange",e="hidden"):void 0!==document.mozHidden?(n="mozvisibilitychange",e="mozHidden"):void 0!==document.msHidden?(n="msvisibilitychange",e="msHidden"):void 0!==document.webkitHidden&&(n="webkitvisibilitychange",e="webkitHidden")),r.visible_=!0,n&&document.addEventListener(n,(function(){var t=!document[e];t!==r.visible_&&(r.visible_=t,r.trigger("visible",t))}),!1),r}return Object(i.d)(e,t),e.getInstance=function(){return new e},e.prototype.getInitialEvent=function(t){return Object(o.e)("visible"===t,"Unknown event type: "+t),[this.visible_]},e}(Me),Ue=function(t){function e(){var e=t.call(this,["online"])||this;return e.online_=!0,"undefined"==typeof window||void 0===window.addEventListener||Object(o.u)()||(window.addEventListener("online",(function(){e.online_||(e.online_=!0,e.trigger("online",!0))}),!1),window.addEventListener("offline",(function(){e.online_&&(e.online_=!1,e.trigger("online",!1))}),!1)),e}return Object(i.d)(e,t),e.getInstance=function(){return new e},e.prototype.getInitialEvent=function(t){return Object(o.e)("online"===t,"Unknown event type: "+t),[this.online_]},e.prototype.currentlyOnline=function(){return this.online_},e}(Me),$e=function(){function t(t){this.onMessage_=t,this.pendingResponses=[],this.currentResponseNum=0,this.closeAfterResponse=-1,this.onClose=null}return t.prototype.closeAfter=function(t,e){this.closeAfterResponse=t,this.onClose=e,this.closeAfterResponse<this.currentResponseNum&&(this.onClose(),this.onClose=null)},t.prototype.handleResponse=function(t,e){var n=this;this.pendingResponses[t]=e;for(var r=function(){var t=i.pendingResponses[i.currentResponseNum];delete i.pendingResponses[i.currentResponseNum];for(var e=function(e){t[e]&&G((function(){n.onMessage_(t[e])}))},r=0;r<t.length;++r)e(r);if(i.currentResponseNum===i.closeAfterResponse)return i.onClose&&(i.onClose(),i.onClose=null),"break";i.currentResponseNum++},i=this;this.pendingResponses[this.currentResponseNum]&&"break"!==r(););},t}(),Ve=function(){function t(t,e,n,r,i){this.connId=t,this.repoInfo=e,this.applicationId=n,this.transportSessionId=r,this.lastSessionId=i,this.bytesSent=0,this.bytesReceived=0,this.everConnected_=!1,this.log_=w(t),this.stats_=Ne.getCollection(e),this.urlFn=function(t){return e.connectionURL("long_polling",t)}}return t.prototype.open=function(t,e){var n=this;this.curSegmentNum=0,this.onDisconnect_=e,this.myPacketOrderer=new $e(t),this.isClosed_=!1,this.connectTimeoutTimer_=setTimeout((function(){n.log_("Timed out trying to connect."),n.onClosed_(),n.connectTimeoutTimer_=null}),Math.floor(3e4)),function(t){if(Object(o.w)()||"complete"===document.readyState)t();else{var e=!1,n=function(){document.body?e||(e=!0,t()):setTimeout(n,Math.floor(10))};document.addEventListener?(document.addEventListener("DOMContentLoaded",n,!1),window.addEventListener("load",n,!1)):document.attachEvent&&(document.attachEvent("onreadystatechange",(function(){"complete"===document.readyState&&n()})),window.attachEvent("onload",n))}}((function(){if(!n.isClosed_){n.scriptTagHolder=new qe((function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=Object(i.f)(t,5),o=r[0],s=r[1],a=r[2];if(n.incrementIncomingBytes_(t),n.scriptTagHolder)if(n.connectTimeoutTimer_&&(clearTimeout(n.connectTimeoutTimer_),n.connectTimeoutTimer_=null),n.everConnected_=!0,"start"===o)n.id=s,n.password=a;else{if("close"!==o)throw new Error("Unrecognized command received: "+o);s?(n.scriptTagHolder.sendNewPolls=!1,n.myPacketOrderer.closeAfter(s,(function(){n.onClosed_()}))):n.onClosed_()}}),(function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=Object(i.f)(t,2),o=r[0],s=r[1];n.incrementIncomingBytes_(t),n.myPacketOrderer.handleResponse(o,s)}),(function(){n.onClosed_()}),n.urlFn);var t={start:"t"};t.ser=Math.floor(1e8*Math.random()),n.scriptTagHolder.uniqueCallbackIdentifier&&(t.cb=n.scriptTagHolder.uniqueCallbackIdentifier),t.v="5",n.transportSessionId&&(t.s=n.transportSessionId),n.lastSessionId&&(t.ls=n.lastSessionId),n.applicationId&&(t.p=n.applicationId),"undefined"!=typeof location&&location.href&&-1!==location.href.indexOf("firebaseio.com")&&(t.r="f");var e=n.urlFn(t);n.log_("Connecting via long-poll to "+e),n.scriptTagHolder.addTag(e,(function(){}))}}))},t.prototype.start=function(){this.scriptTagHolder.startLongPoll(this.id,this.password),this.addDisconnectPingFrame(this.id,this.password)},t.forceAllow=function(){t.forceAllow_=!0},t.forceDisallow=function(){t.forceDisallow_=!0},t.isAvailable=function(){return!(Object(o.w)()||!t.forceAllow_&&(t.forceDisallow_||"undefined"==typeof document||null==document.createElement||"object"==typeof window&&window.chrome&&window.chrome.extension&&!/^chrome/.test(window.location.href)||"object"==typeof Windows&&"object"==typeof Windows.UI))},t.prototype.markConnectionHealthy=function(){},t.prototype.shutdown_=function(){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)},t.prototype.onClosed_=function(){this.isClosed_||(this.log_("Longpoll is closing itself"),this.shutdown_(),this.onDisconnect_&&(this.onDisconnect_(this.everConnected_),this.onDisconnect_=null))},t.prototype.close=function(){this.isClosed_||(this.log_("Longpoll is being closed."),this.shutdown_())},t.prototype.send=function(t){var e=Object(o.G)(t);this.bytesSent+=e.length,this.stats_.incrementCounter("bytes_sent",e.length);for(var n=Object(o.h)(e),r=N(n,1840),i=0;i<r.length;i++)this.scriptTagHolder.enqueueSegment(this.curSegmentNum,r.length,r[i]),this.curSegmentNum++},t.prototype.addDisconnectPingFrame=function(t,e){if(!Object(o.w)()){this.myDisconnFrame=document.createElement("iframe");var n={dframe:"t"};n.id=t,n.pw=e,this.myDisconnFrame.src=this.urlFn(n),this.myDisconnFrame.style.display="none",document.body.appendChild(this.myDisconnFrame)}},t.prototype.incrementIncomingBytes_=function(t){var e=Object(o.G)(t).length;this.bytesReceived+=e,this.stats_.incrementCounter("bytes_received",e)},t}(),qe=function(){function t(e,n,r,i){if(this.onDisconnect=r,this.urlFn=i,this.outstandingRequests=new Set,this.pendingSegs=[],this.currentSerial=Math.floor(1e8*Math.random()),this.sendNewPolls=!0,Object(o.w)())this.commandCB=e,this.onMessageCB=n;else{this.uniqueCallbackIdentifier=p(),window["pLPCommand"+this.uniqueCallbackIdentifier]=e,window["pRTLPCB"+this.uniqueCallbackIdentifier]=n,this.myIFrame=t.createIFrame_();var s="";this.myIFrame.src&&"javascript:"===this.myIFrame.src.substr(0,"javascript:".length)&&(s='<script>document.domain="'+document.domain+'";<\/script>');var a="<html><body>"+s+"</body></html>";try{this.myIFrame.doc.open(),this.myIFrame.doc.write(a),this.myIFrame.doc.close()}catch(u){_("frame writing exception"),u.stack&&_(u.stack),_(u)}}}return t.createIFrame_=function(){var t=document.createElement("iframe");if(t.style.display="none",!document.body)throw"Document body has not initialized. Wait to initialize Firebase until after the document is ready.";document.body.appendChild(t);try{t.contentWindow.document||_("No IE domain setting required")}catch(n){var e=document.domain;t.src="javascript:void((function(){document.open();document.domain='"+e+"';document.close();})())"}return t.contentDocument?t.doc=t.contentDocument:t.contentWindow?t.doc=t.contentWindow.document:t.document&&(t.doc=t.document),t},t.prototype.close=function(){var t=this;this.alive=!1,this.myIFrame&&(this.myIFrame.doc.body.innerHTML="",setTimeout((function(){null!==t.myIFrame&&(document.body.removeChild(t.myIFrame),t.myIFrame=null)}),Math.floor(0)));var e=this.onDisconnect;e&&(this.onDisconnect=null,e())},t.prototype.startLongPoll=function(t,e){for(this.myID=t,this.myPW=e,this.alive=!0;this.newRequest_(););},t.prototype.newRequest_=function(){if(this.alive&&this.sendNewPolls&&this.outstandingRequests.size<(this.pendingSegs.length>0?2:1)){this.currentSerial++;var t={};t.id=this.myID,t.pw=this.myPW,t.ser=this.currentSerial;for(var e=this.urlFn(t),n="",r=0;this.pendingSegs.length>0&&this.pendingSegs[0].d.length+30+n.length<=1870;){var i=this.pendingSegs.shift();n=n+"&seg"+r+"="+i.seg+"&ts"+r+"="+i.ts+"&d"+r+"="+i.d,r++}return this.addLongPollTag_(e+=n,this.currentSerial),!0}return!1},t.prototype.enqueueSegment=function(t,e,n){this.pendingSegs.push({seg:t,ts:e,d:n}),this.alive&&this.newRequest_()},t.prototype.addLongPollTag_=function(t,e){var n=this;this.outstandingRequests.add(e);var r=function(){n.outstandingRequests.delete(e),n.newRequest_()},i=setTimeout(r,Math.floor(25e3));this.addTag(t,(function(){clearTimeout(i),r()}))},t.prototype.addTag=function(t,e){var n=this;Object(o.w)()?this.doNodeLongPoll(t,e):setTimeout((function(){try{if(!n.sendNewPolls)return;var r=n.myIFrame.doc.createElement("script");r.type="text/javascript",r.async=!0,r.src=t,r.onload=r.onreadystatechange=function(){var t=r.readyState;t&&"loaded"!==t&&"complete"!==t||(r.onload=r.onreadystatechange=null,r.parentNode&&r.parentNode.removeChild(r),e())},r.onerror=function(){_("Long-poll script failed to load: "+t),n.sendNewPolls=!1,n.close()},n.myIFrame.doc.body.appendChild(r)}catch(i){}}),Math.floor(1))},t}(),He="";function Be(t){He=t}var ze=null;"undefined"!=typeof MozWebSocket?ze=MozWebSocket:"undefined"!=typeof WebSocket&&(ze=WebSocket);var We=function(){function t(e,n,r,i,o){this.connId=e,this.applicationId=r,this.keepaliveTimer=null,this.frames=null,this.totalFrames=0,this.bytesSent=0,this.bytesReceived=0,this.log_=w(this.connId),this.stats_=Ne.getCollection(n),this.connURL=t.connectionURL_(n,i,o),this.nodeAdmin=n.nodeAdmin}return t.connectionURL_=function(t,e,n){var r={v:"5"};return!Object(o.w)()&&"undefined"!=typeof location&&location.href&&-1!==location.href.indexOf("firebaseio.com")&&(r.r="f"),e&&(r.s=e),n&&(r.ls=n),t.connectionURL("websocket",r)},t.prototype.open=function(t,e){var n=this;this.onDisconnect=e,this.onMessage=t,this.log_("Websocket connecting to "+this.connURL),this.everConnected_=!1,h.set("previous_websocket_failure",!0);try{if(Object(o.w)()){var r={headers:{"User-Agent":"Firebase/5/"+He+"/"+process.platform+"/"+(this.nodeAdmin?"AdminNode":"Node"),"X-Firebase-GMPID":this.applicationId||""}},i=process.env,s=0===this.connURL.indexOf("wss://")?i.HTTPS_PROXY||i.https_proxy:i.HTTP_PROXY||i.http_proxy;s&&(r.proxy={origin:s}),this.mySock=new ze(this.connURL,[],r)}else this.mySock=new ze(this.connURL,[],r={headers:{"X-Firebase-GMPID":this.applicationId||""}})}catch(u){this.log_("Error instantiating WebSocket.");var a=u.message||u.data;return a&&this.log_(a),void this.onClosed_()}this.mySock.onopen=function(){n.log_("Websocket connected."),n.everConnected_=!0},this.mySock.onclose=function(){n.log_("Websocket connection was disconnected."),n.mySock=null,n.onClosed_()},this.mySock.onmessage=function(t){n.handleIncomingFrame(t)},this.mySock.onerror=function(t){n.log_("WebSocket error.  Closing connection.");var e=t.message||t.data;e&&n.log_(e),n.onClosed_()}},t.prototype.start=function(){},t.forceDisallow=function(){t.forceDisallow_=!0},t.isAvailable=function(){var e=!1;if("undefined"!=typeof navigator&&navigator.userAgent){var n=navigator.userAgent.match(/Android ([0-9]{0,}\.[0-9]{0,})/);n&&n.length>1&&parseFloat(n[1])<4.4&&(e=!0)}return!e&&null!==ze&&!t.forceDisallow_},t.previouslyFailed=function(){return h.isInMemoryStorage||!0===h.get("previous_websocket_failure")},t.prototype.markConnectionHealthy=function(){h.remove("previous_websocket_failure")},t.prototype.appendFrame_=function(t){if(this.frames.push(t),this.frames.length===this.totalFrames){var e=this.frames.join("");this.frames=null;var n=Object(o.A)(e);this.onMessage(n)}},t.prototype.handleNewFrameCount_=function(t){this.totalFrames=t,this.frames=[]},t.prototype.extractFrameCount_=function(t){if(Object(o.e)(null===this.frames,"We already have a frame buffer"),t.length<=6){var e=Number(t);if(!isNaN(e))return this.handleNewFrameCount_(e),null}return this.handleNewFrameCount_(1),t},t.prototype.handleIncomingFrame=function(t){if(null!==this.mySock){var e=t.data;if(this.bytesReceived+=e.length,this.stats_.incrementCounter("bytes_received",e.length),this.resetKeepAlive(),null!==this.frames)this.appendFrame_(e);else{var n=this.extractFrameCount_(e);null!==n&&this.appendFrame_(n)}}},t.prototype.send=function(t){this.resetKeepAlive();var e=Object(o.G)(t);this.bytesSent+=e.length,this.stats_.incrementCounter("bytes_sent",e.length);var n=N(e,16384);n.length>1&&this.sendString_(String(n.length));for(var r=0;r<n.length;r++)this.sendString_(n[r])},t.prototype.shutdown_=function(){this.isClosed_=!0,this.keepaliveTimer&&(clearInterval(this.keepaliveTimer),this.keepaliveTimer=null),this.mySock&&(this.mySock.close(),this.mySock=null)},t.prototype.onClosed_=function(){this.isClosed_||(this.log_("WebSocket is closing itself"),this.shutdown_(),this.onDisconnect&&(this.onDisconnect(this.everConnected_),this.onDisconnect=null))},t.prototype.close=function(){this.isClosed_||(this.log_("WebSocket is being closed"),this.shutdown_())},t.prototype.resetKeepAlive=function(){var t=this;clearInterval(this.keepaliveTimer),this.keepaliveTimer=setInterval((function(){t.mySock&&t.sendString_("0"),t.resetKeepAlive()}),Math.floor(45e3))},t.prototype.sendString_=function(t){try{this.mySock.send(t)}catch(e){this.log_("Exception thrown from WebSocket.send():",e.message||e.data,"Closing connection."),setTimeout(this.onClosed_.bind(this),0)}},t.responsesRequiredToBeHealthy=2,t.healthyTimeout=3e4,t}(),Ge=function(){function t(t){this.initTransports_(t)}return Object.defineProperty(t,"ALL_TRANSPORTS",{get:function(){return[Ve,We]},enumerable:!1,configurable:!0}),t.prototype.initTransports_=function(e){var n,r,o=We&&We.isAvailable(),s=o&&!We.previouslyFailed();if(e.webSocketOnly&&(o||C("wss:// URL used, but browser isn't known to support websockets.  Trying anyway."),s=!0),s)this.transports_=[We];else{var a=this.transports_=[];try{for(var u=Object(i.i)(t.ALL_TRANSPORTS),c=u.next();!c.done;c=u.next()){var l=c.value;l&&l.isAvailable()&&a.push(l)}}catch(h){n={error:h}}finally{try{c&&!c.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}}},t.prototype.initialTransport=function(){if(this.transports_.length>0)return this.transports_[0];throw new Error("No transports available")},t.prototype.upgradeTransport=function(){return this.transports_.length>1?this.transports_[1]:null},t}(),Qe=function(){function t(t,e,n,r,i,o,s,a){this.id=t,this.repoInfo_=e,this.applicationId_=n,this.onMessage_=r,this.onReady_=i,this.onDisconnect_=o,this.onKill_=s,this.lastSessionId=a,this.connectionCount=0,this.pendingDataMessages=[],this.state_=0,this.log_=w("c:"+this.id+":"),this.transportManager_=new Ge(e),this.log_("Connection created"),this.start_()}return t.prototype.start_=function(){var t=this,e=this.transportManager_.initialTransport();this.conn_=new e(this.nextTransportId_(),this.repoInfo_,this.applicationId_,void 0,this.lastSessionId),this.primaryResponsesRequired_=e.responsesRequiredToBeHealthy||0;var n=this.connReceiver_(this.conn_),r=this.disconnReceiver_(this.conn_);this.tx_=this.conn_,this.rx_=this.conn_,this.secondaryConn_=null,this.isHealthy_=!1,setTimeout((function(){t.conn_&&t.conn_.open(n,r)}),Math.floor(0));var i=e.healthyTimeout||0;i>0&&(this.healthyTimeout_=Q((function(){t.healthyTimeout_=null,t.isHealthy_||(t.conn_&&t.conn_.bytesReceived>102400?(t.log_("Connection exceeded healthy timeout but has received "+t.conn_.bytesReceived+" bytes.  Marking connection healthy."),t.isHealthy_=!0,t.conn_.markConnectionHealthy()):t.conn_&&t.conn_.bytesSent>10240?t.log_("Connection exceeded healthy timeout but has sent "+t.conn_.bytesSent+" bytes.  Leaving connection alive."):(t.log_("Closing unhealthy connection after timeout."),t.close()))}),Math.floor(i)))},t.prototype.nextTransportId_=function(){return"c:"+this.id+":"+this.connectionCount++},t.prototype.disconnReceiver_=function(t){var e=this;return function(n){t===e.conn_?e.onConnectionLost_(n):t===e.secondaryConn_?(e.log_("Secondary connection lost."),e.onSecondaryConnectionLost_()):e.log_("closing an old connection")}},t.prototype.connReceiver_=function(t){var e=this;return function(n){2!==e.state_&&(t===e.rx_?e.onPrimaryMessageReceived_(n):t===e.secondaryConn_?e.onSecondaryMessageReceived_(n):e.log_("message on old connection"))}},t.prototype.sendRequest=function(t){this.sendData_({t:"d",d:t})},t.prototype.tryCleanupConnection=function(){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)},t.prototype.onSecondaryControl_=function(t){if("t"in t){var e=t.t;"a"===e?this.upgradeIfSecondaryHealthy_():"r"===e?(this.log_("Got a reset on secondary, closing it"),this.secondaryConn_.close(),this.tx_!==this.secondaryConn_&&this.rx_!==this.secondaryConn_||this.close()):"o"===e&&(this.log_("got pong on secondary."),this.secondaryResponsesRequired_--,this.upgradeIfSecondaryHealthy_())}},t.prototype.onSecondaryMessageReceived_=function(t){var e=A("t",t),n=A("d",t);if("c"===e)this.onSecondaryControl_(n);else{if("d"!==e)throw new Error("Unknown protocol layer: "+e);this.pendingDataMessages.push(n)}},t.prototype.upgradeIfSecondaryHealthy_=function(){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:"p",d:{}}}))},t.prototype.proceedWithUpgrade_=function(){this.secondaryConn_.start(),this.log_("sending client ack on secondary"),this.secondaryConn_.send({t:"c",d:{t:"a",d:{}}}),this.log_("Ending transmission on primary"),this.conn_.send({t:"c",d:{t:"n",d:{}}}),this.tx_=this.secondaryConn_,this.tryCleanupConnection()},t.prototype.onPrimaryMessageReceived_=function(t){var e=A("t",t),n=A("d",t);"c"===e?this.onControl_(n):"d"===e&&this.onDataMessage_(n)},t.prototype.onDataMessage_=function(t){this.onPrimaryResponse_(),this.onMessage_(t)},t.prototype.onPrimaryResponse_=function(){this.isHealthy_||(this.primaryResponsesRequired_--,this.primaryResponsesRequired_<=0&&(this.log_("Primary connection is healthy."),this.isHealthy_=!0,this.conn_.markConnectionHealthy()))},t.prototype.onControl_=function(t){var e=A("t",t);if("d"in t){var n=t.d;if("h"===e)this.onHandshake_(n);else if("n"===e){this.log_("recvd end transmission on primary"),this.rx_=this.secondaryConn_;for(var r=0;r<this.pendingDataMessages.length;++r)this.onDataMessage_(this.pendingDataMessages[r]);this.pendingDataMessages=[],this.tryCleanupConnection()}else"s"===e?this.onConnectionShutdown_(n):"r"===e?this.onReset_(n):"e"===e?E("Server Error: "+n):"o"===e?(this.log_("got pong on primary."),this.onPrimaryResponse_(),this.sendPingOnPrimaryIfNecessary_()):E("Unknown control packet command: "+e)}},t.prototype.onHandshake_=function(t){var e=t.ts,n=t.v,r=t.h;this.sessionId=t.s,this.repoInfo_.updateHost(r),0===this.state_&&(this.conn_.start(),this.onConnectionEstablished_(this.conn_,e),"5"!==n&&C("Protocol version mismatch detected"),this.tryStartUpgrade_())},t.prototype.tryStartUpgrade_=function(){var t=this.transportManager_.upgradeTransport();t&&this.startUpgrade_(t)},t.prototype.startUpgrade_=function(t){var e=this;this.secondaryConn_=new t(this.nextTransportId_(),this.repoInfo_,this.applicationId_,this.sessionId),this.secondaryResponsesRequired_=t.responsesRequiredToBeHealthy||0;var n=this.connReceiver_(this.secondaryConn_),r=this.disconnReceiver_(this.secondaryConn_);this.secondaryConn_.open(n,r),Q((function(){e.secondaryConn_&&(e.log_("Timed out trying to upgrade."),e.secondaryConn_.close())}),Math.floor(6e4))},t.prototype.onReset_=function(t){this.log_("Reset packet received.  New host: "+t),this.repoInfo_.updateHost(t),1===this.state_?this.close():(this.closeConnections_(),this.start_())},t.prototype.onConnectionEstablished_=function(t,e){var n=this;this.log_("Realtime connection established."),this.conn_=t,this.state_=1,this.onReady_&&(this.onReady_(e,this.sessionId),this.onReady_=null),0===this.primaryResponsesRequired_?(this.log_("Primary connection is healthy."),this.isHealthy_=!0):Q((function(){n.sendPingOnPrimaryIfNecessary_()}),Math.floor(5e3))},t.prototype.sendPingOnPrimaryIfNecessary_=function(){this.isHealthy_||1!==this.state_||(this.log_("sending ping on primary."),this.sendData_({t:"c",d:{t:"p",d:{}}}))},t.prototype.onSecondaryConnectionLost_=function(){var t=this.secondaryConn_;this.secondaryConn_=null,this.tx_!==t&&this.rx_!==t||this.close()},t.prototype.onConnectionLost_=function(t){this.conn_=null,t||0!==this.state_?1===this.state_&&this.log_("Realtime connection lost."):(this.log_("Realtime connection failed."),this.repoInfo_.isCacheableHost()&&(h.remove("host:"+this.repoInfo_.host),this.repoInfo_.internalHost=this.repoInfo_.host)),this.close()},t.prototype.onConnectionShutdown_=function(t){this.log_("Connection shutdown command received. Shutting down..."),this.onKill_&&(this.onKill_(t),this.onKill_=null),this.onDisconnect_=null,this.close()},t.prototype.sendData_=function(t){if(1!==this.state_)throw"Connection is not connected";this.tx_.send(t)},t.prototype.close=function(){2!==this.state_&&(this.log_("Closing realtime connection."),this.state_=2,this.closeConnections_(),this.onDisconnect_&&(this.onDisconnect_(),this.onDisconnect_=null))},t.prototype.closeConnections_=function(){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)},t}(),Ke=function(){function t(){}return t.prototype.put=function(t,e,n,r){},t.prototype.merge=function(t,e,n,r){},t.prototype.refreshAuthToken=function(t){},t.prototype.onDisconnectPut=function(t,e,n){},t.prototype.onDisconnectMerge=function(t,e,n){},t.prototype.onDisconnectCancel=function(t,e){},t.prototype.reportStats=function(t){},t}(),Xe=function(t){function e(n,r,i,s,a,u,c){var l=t.call(this)||this;if(l.repoInfo_=n,l.applicationId_=r,l.onDataUpdate_=i,l.onConnectStatus_=s,l.onServerInfoUpdate_=a,l.authTokenProvider_=u,l.authOverride_=c,l.id=e.nextPersistentConnectionId_++,l.log_=w("p:"+l.id+":"),l.interruptReasons_={},l.listens=new Map,l.outstandingPuts_=[],l.outstandingGets_=[],l.outstandingPutCount_=0,l.outstandingGetCount_=0,l.onDisconnectRequestQueue_=[],l.connected_=!1,l.reconnectDelay_=1e3,l.maxReconnectDelay_=3e5,l.securityDebugCallback_=null,l.lastSessionId=null,l.establishConnectionTimer_=null,l.visible_=!1,l.requestCBHash_={},l.requestNumber_=0,l.realtime_=null,l.authToken_=null,l.forceTokenRefresh_=!1,l.invalidAuthTokenCount_=0,l.firstConnection_=!0,l.lastConnectionAttemptTime_=null,l.lastConnectionEstablishedTime_=null,c&&!Object(o.w)())throw new Error("Auth override specified in options, but not supported on non Node.js platforms");return l.scheduleConnect_(0),Fe.getInstance().on("visible",l.onVisible_,l),-1===n.host.indexOf("fblocal")&&Ue.getInstance().on("online",l.onOnline_,l),l}return Object(i.d)(e,t),e.prototype.sendRequest=function(t,e,n){var r=++this.requestNumber_,i={r,a:t,b:e};this.log_(Object(o.G)(i)),Object(o.e)(this.connected_,"sendRequest call when we're not connected not allowed."),this.realtime_.sendRequest(i),n&&(this.requestCBHash_[r]=n)},e.prototype.get=function(t){var e=this,n=new o.a,r={p:t.path.toString(),q:t.queryObject()},i={action:"g",request:r,onComplete:function(t){var i=t.d;"ok"===t.s?(e.onDataUpdate_(r.p,i,!1,null),n.resolve(i)):n.reject(i)}};this.outstandingGets_.push(i),this.outstandingGetCount_++;var s=this.outstandingGets_.length-1;return this.connected_||setTimeout((function(){var t=e.outstandingGets_[s];void 0!==t&&i===t&&(delete e.outstandingGets_[s],e.outstandingGetCount_--,0===e.outstandingGetCount_&&(e.outstandingGets_=[]),e.log_("get "+s+" timed out on connection"),n.reject(new Error("Client is offline.")))}),3e3),this.connected_&&this.sendGet_(s),n.promise},e.prototype.listen=function(t,e,n,r){var i=t.queryIdentifier(),s=t.path.toString();this.log_("Listen called for "+s+" "+i),this.listens.has(s)||this.listens.set(s,new Map),Object(o.e)(t.getQueryParams().isDefault()||!t.getQueryParams().loadsAllData(),"listen() called for non-default but complete query"),Object(o.e)(!this.listens.get(s).has(i),"listen() called twice for same path/queryId.");var a={onComplete:r,hashFn:e,query:t,tag:n};this.listens.get(s).set(i,a),this.connected_&&this.sendListen_(a)},e.prototype.sendGet_=function(t){var e=this,n=this.outstandingGets_[t];this.sendRequest("g",n.request,(function(r){delete e.outstandingGets_[t],e.outstandingGetCount_--,0===e.outstandingGetCount_&&(e.outstandingGets_=[]),n.onComplete&&n.onComplete(r)}))},e.prototype.sendListen_=function(t){var n=this,r=t.query,i=r.path.toString(),o=r.queryIdentifier();this.log_("Listen on "+i+" for "+o);var s={p:i};t.tag&&(s.q=r.queryObject(),s.t=t.tag),s.h=t.hashFn(),this.sendRequest("q",s,(function(s){var a=s.d,u=s.s;e.warnOnListenWarnings_(a,r),(n.listens.get(i)&&n.listens.get(i).get(o))===t&&(n.log_("listen response",s),"ok"!==u&&n.removeListen_(i,o),t.onComplete&&t.onComplete(u,a))}))},e.warnOnListenWarnings_=function(t,e){if(t&&"object"==typeof t&&Object(o.i)(t,"w")){var n=Object(o.D)(t,"w");if(Array.isArray(n)&&~n.indexOf("no_index")){var r='".indexOn": "'+e.getQueryParams().getIndex().toString()+'"',i=e.path.toString();C("Using an unspecified index. Your data will be downloaded and filtered on the client. Consider adding "+r+" at "+i+" to your security rules for better performance.")}}},e.prototype.refreshAuthToken=function(t){this.authToken_=t,this.log_("Auth token refreshed"),this.authToken_?this.tryAuth():this.connected_&&this.sendRequest("unauth",{},(function(){})),this.reduceReconnectDelayIfAdminCredential_(t)},e.prototype.reduceReconnectDelayIfAdminCredential_=function(t){(t&&40===t.length||Object(o.o)(t))&&(this.log_("Admin auth credential detected.  Reducing max reconnect time."),this.maxReconnectDelay_=3e4)},e.prototype.tryAuth=function(){var t=this;if(this.connected_&&this.authToken_){var e=this.authToken_,n=Object(o.z)(e)?"auth":"gauth",r={cred:e};null===this.authOverride_?r.noauth=!0:"object"==typeof this.authOverride_&&(r.authvar=this.authOverride_),this.sendRequest(n,r,(function(n){var r=n.s,i=n.d||"error";t.authToken_===e&&("ok"===r?t.invalidAuthTokenCount_=0:t.onAuthRevoked_(r,i))}))}},e.prototype.unlisten=function(t,e){var n=t.path.toString(),r=t.queryIdentifier();this.log_("Unlisten called for "+n+" "+r),Object(o.e)(t.getQueryParams().isDefault()||!t.getQueryParams().loadsAllData(),"unlisten() called for non-default but complete query"),this.removeListen_(n,r)&&this.connected_&&this.sendUnlisten_(n,r,t.queryObject(),e)},e.prototype.sendUnlisten_=function(t,e,n,r){this.log_("Unlisten on "+t+" for "+e);var i={p:t};r&&(i.q=n,i.t=r),this.sendRequest("n",i)},e.prototype.onDisconnectPut=function(t,e,n){this.connected_?this.sendOnDisconnect_("o",t,e,n):this.onDisconnectRequestQueue_.push({pathString:t,action:"o",data:e,onComplete:n})},e.prototype.onDisconnectMerge=function(t,e,n){this.connected_?this.sendOnDisconnect_("om",t,e,n):this.onDisconnectRequestQueue_.push({pathString:t,action:"om",data:e,onComplete:n})},e.prototype.onDisconnectCancel=function(t,e){this.connected_?this.sendOnDisconnect_("oc",t,null,e):this.onDisconnectRequestQueue_.push({pathString:t,action:"oc",data:null,onComplete:e})},e.prototype.sendOnDisconnect_=function(t,e,n,r){var i={p:e,d:n};this.log_("onDisconnect "+t,i),this.sendRequest(t,i,(function(t){r&&setTimeout((function(){r(t.s,t.d)}),Math.floor(0))}))},e.prototype.put=function(t,e,n,r){this.putInternal("p",t,e,n,r)},e.prototype.merge=function(t,e,n,r){this.putInternal("m",t,e,n,r)},e.prototype.putInternal=function(t,e,n,r,i){var o={p:e,d:n};void 0!==i&&(o.h=i),this.outstandingPuts_.push({action:t,request:o,onComplete:r}),this.outstandingPutCount_++,this.connected_?this.sendPut_(this.outstandingPuts_.length-1):this.log_("Buffering put: "+e)},e.prototype.sendPut_=function(t){var e=this,n=this.outstandingPuts_[t].action,r=this.outstandingPuts_[t].request,i=this.outstandingPuts_[t].onComplete;this.outstandingPuts_[t].queued=this.connected_,this.sendRequest(n,r,(function(r){e.log_(n+" response",r),delete e.outstandingPuts_[t],e.outstandingPutCount_--,0===e.outstandingPutCount_&&(e.outstandingPuts_=[]),i&&i(r.s,r.d)}))},e.prototype.reportStats=function(t){var e=this;if(this.connected_){var n={c:t};this.log_("reportStats",n),this.sendRequest("s",n,(function(t){"ok"!==t.s&&e.log_("reportStats","Error sending stats: "+t.d)}))}},e.prototype.onDataMessage_=function(t){if("r"in t){this.log_("from server: "+Object(o.G)(t));var e=t.r,n=this.requestCBHash_[e];n&&(delete this.requestCBHash_[e],n(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)}},e.prototype.onDataPush_=function(t,e){this.log_("handleServerMessage",t,e),"d"===t?this.onDataUpdate_(e.p,e.d,!1,e.t):"m"===t?this.onDataUpdate_(e.p,e.d,!0,e.t):"c"===t?this.onListenRevoked_(e.p,e.q):"ac"===t?this.onAuthRevoked_(e.s,e.d):"sd"===t?this.onSecurityDebugPacket_(e):E("Unrecognized action received from server: "+Object(o.G)(t)+"\nAre you using the latest client?")},e.prototype.onReady_=function(t,e){this.log_("connection ready"),this.connected_=!0,this.lastConnectionEstablishedTime_=(new Date).getTime(),this.handleTimestamp_(t),this.lastSessionId=e,this.firstConnection_&&this.sendConnectStats_(),this.restoreState_(),this.firstConnection_=!1,this.onConnectStatus_(!0)},e.prototype.scheduleConnect_=function(t){var e=this;Object(o.e)(!this.realtime_,"Scheduling a connect when we're already connected/ing?"),this.establishConnectionTimer_&&clearTimeout(this.establishConnectionTimer_),this.establishConnectionTimer_=setTimeout((function(){e.establishConnectionTimer_=null,e.establishConnection_()}),Math.floor(t))},e.prototype.onVisible_=function(t){t&&!this.visible_&&this.reconnectDelay_===this.maxReconnectDelay_&&(this.log_("Window became visible.  Reducing delay."),this.reconnectDelay_=1e3,this.realtime_||this.scheduleConnect_(0)),this.visible_=t},e.prototype.onOnline_=function(t){t?(this.log_("Browser went online."),this.reconnectDelay_=1e3,this.realtime_||this.scheduleConnect_(0)):(this.log_("Browser went offline.  Killing connection."),this.realtime_&&this.realtime_.close())},e.prototype.onRealtimeDisconnect_=function(){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_>3e4&&(this.reconnectDelay_=1e3),this.lastConnectionEstablishedTime_=null):(this.log_("Window isn't visible.  Delaying reconnect."),this.reconnectDelay_=this.maxReconnectDelay_,this.lastConnectionAttemptTime_=(new Date).getTime());var t=(new Date).getTime()-this.lastConnectionAttemptTime_,e=Math.max(0,this.reconnectDelay_-t);e=Math.random()*e,this.log_("Trying to reconnect in "+e+"ms"),this.scheduleConnect_(e),this.reconnectDelay_=Math.min(this.maxReconnectDelay_,1.3*this.reconnectDelay_)}this.onConnectStatus_(!1)},e.prototype.establishConnection_=function(){var t=this;if(this.shouldReconnect_()){this.log_("Making a connection attempt"),this.lastConnectionAttemptTime_=(new Date).getTime(),this.lastConnectionEstablishedTime_=null;var n=this.onDataMessage_.bind(this),r=this.onReady_.bind(this),i=this.onRealtimeDisconnect_.bind(this),s=this.id+":"+e.nextConnectionId_++,a=this,u=this.lastSessionId,c=!1,l=null,h=function(){l?l.close():(c=!0,i())};this.realtime_={close:h,sendRequest:function(t){Object(o.e)(l,"sendRequest call when we're not connected not allowed."),l.sendRequest(t)}};var d=this.forceTokenRefresh_;this.forceTokenRefresh_=!1,this.authTokenProvider_.getToken(d).then((function(t){c?_("getToken() completed but was canceled"):(_("getToken() completed. Creating connection."),a.authToken_=t&&t.accessToken,l=new Qe(s,a.repoInfo_,a.applicationId_,n,r,i,(function(t){C(t+" ("+a.repoInfo_.toString()+")"),a.interrupt("server_kill")}),u))})).then(null,(function(e){a.log_("Failed to get token: "+e),c||(t.repoInfo_.nodeAdmin&&C(e),h())}))}},e.prototype.interrupt=function(t){_("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_())},e.prototype.resume=function(t){_("Resuming connection for reason: "+t),delete this.interruptReasons_[t],Object(o.s)(this.interruptReasons_)&&(this.reconnectDelay_=1e3,this.realtime_||this.scheduleConnect_(0))},e.prototype.handleTimestamp_=function(t){var e=t-(new Date).getTime();this.onServerInfoUpdate_({serverTimeOffset:e})},e.prototype.cancelSentTransactions_=function(){for(var t=0;t<this.outstandingPuts_.length;t++){var e=this.outstandingPuts_[t];e&&"h"in e.request&&e.queued&&(e.onComplete&&e.onComplete("disconnect"),delete this.outstandingPuts_[t],this.outstandingPutCount_--)}0===this.outstandingPutCount_&&(this.outstandingPuts_=[])},e.prototype.onListenRevoked_=function(t,e){var n;n=e?e.map((function(t){return k(t)})).join("$"):"default";var r=this.removeListen_(t,n);r&&r.onComplete&&r.onComplete("permission_denied")},e.prototype.removeListen_=function(t,e){var n,r=new K(t).toString();if(this.listens.has(r)){var i=this.listens.get(r);n=i.get(e),i.delete(e),0===i.size&&this.listens.delete(r)}else n=void 0;return n},e.prototype.onAuthRevoked_=function(t,e){_("Auth token revoked: "+t+"/"+e),this.authToken_=null,this.forceTokenRefresh_=!0,this.realtime_.close(),"invalid_token"!==t&&"permission_denied"!==t||(this.invalidAuthTokenCount_++,this.invalidAuthTokenCount_>=3&&(this.reconnectDelay_=3e4,this.authTokenProvider_.notifyForInvalidToken()))},e.prototype.onSecurityDebugPacket_=function(t){this.securityDebugCallback_?this.securityDebugCallback_(t):"msg"in t&&console.log("FIREBASE: "+t.msg.replace("\n","\nFIREBASE: "))},e.prototype.restoreState_=function(){var t,e,n,r;this.tryAuth();try{for(var o=Object(i.i)(this.listens.values()),s=o.next();!s.done;s=o.next()){var a=s.value;try{for(var u=(n=void 0,Object(i.i)(a.values())),c=u.next();!c.done;c=u.next())this.sendListen_(c.value)}catch(d){n={error:d}}finally{try{c&&!c.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}}}catch(f){t={error:f}}finally{try{s&&!s.done&&(e=o.return)&&e.call(o)}finally{if(t)throw t.error}}for(var l=0;l<this.outstandingPuts_.length;l++)this.outstandingPuts_[l]&&this.sendPut_(l);for(;this.onDisconnectRequestQueue_.length;){var h=this.onDisconnectRequestQueue_.shift();this.sendOnDisconnect_(h.action,h.pathString,h.data,h.onComplete)}for(l=0;l<this.outstandingGets_.length;l++)this.outstandingGets_[l]&&this.sendGet_(l)},e.prototype.sendConnectStats_=function(){var t={},e="js";Object(o.w)()&&(e=this.repoInfo_.nodeAdmin?"admin_node":"node"),t["sdk."+e+"."+He.replace(/\./g,"-")]=1,Object(o.u)()?t["framework.cordova"]=1:Object(o.x)()&&(t["framework.reactnative"]=1),this.reportStats(t)},e.prototype.shouldReconnect_=function(){var t=Ue.getInstance().currentlyOnline();return Object(o.s)(this.interruptReasons_)&&t},e.nextPersistentConnectionId_=0,e.nextConnectionId_=0,e}(Ke),Ye=function(t){function e(e,n,r){var i=t.call(this)||this;return i.repoInfo_=e,i.onDataUpdate_=n,i.authTokenProvider_=r,i.log_=w("p:rest:"),i.listens_={},i}return Object(i.d)(e,t),e.prototype.reportStats=function(t){throw new Error("Method not implemented.")},e.getListenId_=function(t,e){return void 0!==e?"tag$"+e:(Object(o.e)(t.getQueryParams().isDefault(),"should have a tag if it's not a default query."),t.path.toString())},e.prototype.listen=function(t,n,r,i){var s=this,a=t.path.toString();this.log_("Listen called for "+a+" "+t.queryIdentifier());var u=e.getListenId_(t,r),c={};this.listens_[u]=c;var l=t.getQueryParams().toRestQueryStringParameters();this.restRequest_(a+".json",l,(function(t,e){var n=e;404===t&&(n=null,t=null),null===t&&s.onDataUpdate_(a,n,!1,r),Object(o.D)(s.listens_,u)===c&&i(t?401===t?"permission_denied":"rest_error:"+t:"ok",null)}))},e.prototype.unlisten=function(t,n){var r=e.getListenId_(t,n);delete this.listens_[r]},e.prototype.get=function(t){var e=this,n=t.getQueryParams().toRestQueryStringParameters(),r=t.path.toString(),i=new o.a;return this.restRequest_(r+".json",n,(function(t,n){var o=n;404===t&&(o=null,t=null),null===t?(e.onDataUpdate_(r,o,!1,null),i.resolve(o)):i.reject(new Error(o))})),i.promise},e.prototype.refreshAuthToken=function(t){},e.prototype.restRequest_=function(t,e,n){var r=this;void 0===e&&(e={}),e.format="export",this.authTokenProvider_.getToken(!1).then((function(i){var s=i&&i.accessToken;s&&(e.auth=s);var a=(r.repoInfo_.secure?"https://":"http://")+r.repoInfo_.host+t+"?ns="+r.repoInfo_.namespace+Object(o.C)(e);r.log_("Sending REST request for "+a);var u=new XMLHttpRequest;u.onreadystatechange=function(){if(n&&4===u.readyState){r.log_("REST Response for "+a+" received. status:",u.status,"response:",u.responseText);var t=null;if(u.status>=200&&u.status<300){try{t=Object(o.A)(u.responseText)}catch(e){C("Failed to parse JSON response for "+a+": "+u.responseText)}n(null,t)}else 401!==u.status&&404!==u.status&&C("Got unsuccessful REST response for "+a+" Status: "+u.status),n(u.status);n=null}},u.open("GET",a,!0),u.send()}))},e}(Ke),Je=function(){function t(t,e,n,r){this.repoInfo_=t,this.forceRestClient_=e,this.app=n,this.authTokenProvider_=r,this.dataUpdateCount=0,this.statsListener_=null,this.eventQueue_=new De,this.nextWriteId_=1,this.interceptServerDataCallback_=null,this.onDisconnect_=new se,this.persistentConnection_=null,this.key=this.repoInfo_.toURLString()}return t.prototype.start=function(){var t=this;if(this.stats_=Ne.getCollection(this.repoInfo_),this.forceRestClient_||("object"==typeof window&&window.navigator&&window.navigator.userAgent||"").search(/googlebot|google webmaster tools|bingbot|yahoo! slurp|baiduspider|yandexbot|duckduckbot/i)>=0)this.server_=new Ye(this.repoInfo_,this.onDataUpdate_.bind(this),this.authTokenProvider_),setTimeout(this.onConnectStatus_.bind(this,!0),0);else{var e=this.app.options.databaseAuthVariableOverride;if(null!=e){if("object"!=typeof e)throw new Error("Only objects are supported for option databaseAuthVariableOverride");try{Object(o.G)(e)}catch(n){throw new Error("Invalid authOverride provided: "+n)}}this.persistentConnection_=new Xe(this.repoInfo_,this.app.options.appId,this.onDataUpdate_.bind(this),this.onConnectStatus_.bind(this),this.onServerInfoUpdate_.bind(this),this.authTokenProvider_,e),this.server_=this.persistentConnection_}this.authTokenProvider_.addTokenChangeListener((function(e){t.server_.refreshAuthToken(e)})),this.statsReporter_=Ne.getOrCreateReporter(this.repoInfo_,(function(){return new Pe(t.stats_,t.server_)})),this.transactionsInit_(),this.infoData_=new Ae,this.infoSyncTree_=new xe({startListening:function(e,n,r,i){var o=[],s=t.infoData_.getNode(e.path);return s.isEmpty()||(o=t.infoSyncTree_.applyServerOverwrite(e.path,s),setTimeout((function(){i("ok")}),0)),o},stopListening:function(){}}),this.updateInfo_("connected",!1),this.serverSyncTree_=new xe({startListening:function(e,n,r,i){return t.server_.listen(e,r,n,(function(n,r){var o=i(n,r);t.eventQueue_.raiseEventsForChangedPath(e.path,o)})),[]},stopListening:function(e,n){t.server_.unlisten(e,n)}})},t.prototype.toString=function(){return(this.repoInfo_.secure?"https://":"http://")+this.repoInfo_.host},t.prototype.name=function(){return this.repoInfo_.namespace},t.prototype.serverTime=function(){var t=this.infoData_.getNode(new K(".info/serverTimeOffset")).val()||0;return(new Date).getTime()+t},t.prototype.generateServerValues=function(){return(t=(t={timestamp:this.serverTime()})||{}).timestamp=t.timestamp||(new Date).getTime(),t;var t},t.prototype.onDataUpdate_=function(t,e,n,r){this.dataUpdateCount++;var i=new K(t);e=this.interceptServerDataCallback_?this.interceptServerDataCallback_(t,e):e;var s=[];if(r)if(n){var a=Object(o.B)(e,(function(t){return $t(t)}));s=this.serverSyncTree_.applyTaggedQueryMerge(i,a,r)}else{var u=$t(e);s=this.serverSyncTree_.applyTaggedQueryOverwrite(i,u,r)}else if(n){var c=Object(o.B)(e,(function(t){return $t(t)}));s=this.serverSyncTree_.applyServerMerge(i,c)}else{var l=$t(e);s=this.serverSyncTree_.applyServerOverwrite(i,l)}var h=i;s.length>0&&(h=this.rerunTransactions_(i)),this.eventQueue_.raiseEventsForChangedPath(h,s)},t.prototype.interceptServerData_=function(t){this.interceptServerDataCallback_=t},t.prototype.onConnectStatus_=function(t){this.updateInfo_("connected",t),!1===t&&this.runOnDisconnectEvents_()},t.prototype.onServerInfoUpdate_=function(t){var e=this;R(t,(function(t,n){e.updateInfo_(t,n)}))},t.prototype.updateInfo_=function(t,e){var n=new K("/.info/"+t),r=$t(e);this.infoData_.updateSnapshot(n,r);var i=this.infoSyncTree_.applyServerOverwrite(n,r);this.eventQueue_.raiseEventsForChangedPath(n,i)},t.prototype.getNextWriteId_=function(){return this.nextWriteId_++},t.prototype.getValue=function(t){var e=this;return this.server_.get(t).then((function(n){var r=$t(n),i=e.serverSyncTree_.applyServerOverwrite(t.path,r);return e.eventQueue_.raiseEventsAtPath(t.path,i),Promise.resolve(new Bt(r,t.getRef(),t.getQueryParams().getIndex()))}),(function(n){e.log_("get for query "+Object(o.G)(t)+" falling back to cache after error: "+n);var r=e.serverSyncTree_.calcCompleteEventCache(t.path);return r.isEmpty()?Promise.reject(new Error(n)):Promise.resolve(new Bt(r,t.getRef(),t.getQueryParams().getIndex()))}))},t.prototype.setWithPriority=function(t,e,n,r){var i=this;this.log_("set",{path:t.toString(),value:e,priority:n});var o=this.generateServerValues(),s=$t(e,n),a=this.serverSyncTree_.calcCompleteEventCache(t),u=ne(s,a,o),c=this.getNextWriteId_(),l=this.serverSyncTree_.applyUserOverwrite(t,u,c,!0);this.eventQueue_.queueEvents(l),this.server_.put(t.toString(),s.val(!0),(function(e,n){var o="ok"===e;o||C("set at "+t+" failed: "+e);var s=i.serverSyncTree_.ackUserWrite(c,!o);i.eventQueue_.raiseEventsForChangedPath(t,s),i.callOnCompleteCallback(r,e,n)}));var h=this.abortTransactions_(t);this.rerunTransactions_(h),this.eventQueue_.raiseEventsForChangedPath(h,[])},t.prototype.update=function(t,e,n){var r=this;this.log_("update",{path:t.toString(),value:e});var i=!0,o=this.generateServerValues(),s={};if(R(e,(function(e,n){i=!1,s[e]=ee(t.child(e),$t(n),r.serverSyncTree_,o)})),i)_("update() called with empty data.  Don't do anything."),this.callOnCompleteCallback(n,"ok");else{var a=this.getNextWriteId_(),u=this.serverSyncTree_.applyUserMerge(t,s,a);this.eventQueue_.queueEvents(u),this.server_.merge(t.toString(),e,(function(e,i){var o="ok"===e;o||C("update at "+t+" failed: "+e);var s=r.serverSyncTree_.ackUserWrite(a,!o),u=s.length>0?r.rerunTransactions_(t):t;r.eventQueue_.raiseEventsForChangedPath(u,s),r.callOnCompleteCallback(n,e,i)})),R(e,(function(e){var n=r.abortTransactions_(t.child(e));r.rerunTransactions_(n)})),this.eventQueue_.raiseEventsForChangedPath(t,[])}},t.prototype.runOnDisconnectEvents_=function(){var t=this;this.log_("onDisconnectEvents");var e=this.generateServerValues(),n=new se;this.onDisconnect_.forEachTree(K.Empty,(function(r,i){var o=ee(r,i,t.serverSyncTree_,e);n.remember(r,o)}));var r=[];n.forEachTree(K.Empty,(function(e,n){r=r.concat(t.serverSyncTree_.applyServerOverwrite(e,n));var i=t.abortTransactions_(e);t.rerunTransactions_(i)})),this.onDisconnect_=new se,this.eventQueue_.raiseEventsForChangedPath(K.Empty,r)},t.prototype.onDisconnectCancel=function(t,e){var n=this;this.server_.onDisconnectCancel(t.toString(),(function(r,i){"ok"===r&&n.onDisconnect_.forget(t),n.callOnCompleteCallback(e,r,i)}))},t.prototype.onDisconnectSet=function(t,e,n){var r=this,i=$t(e);this.server_.onDisconnectPut(t.toString(),i.val(!0),(function(e,o){"ok"===e&&r.onDisconnect_.remember(t,i),r.callOnCompleteCallback(n,e,o)}))},t.prototype.onDisconnectSetWithPriority=function(t,e,n,r){var i=this,o=$t(e,n);this.server_.onDisconnectPut(t.toString(),o.val(!0),(function(e,n){"ok"===e&&i.onDisconnect_.remember(t,o),i.callOnCompleteCallback(r,e,n)}))},t.prototype.onDisconnectUpdate=function(t,e,n){var r=this;if(Object(o.s)(e))return _("onDisconnect().update() called with empty data.  Don't do anything."),void this.callOnCompleteCallback(n,"ok");this.server_.onDisconnectMerge(t.toString(),e,(function(i,o){"ok"===i&&R(e,(function(e,n){var i=$t(n);r.onDisconnect_.remember(t.child(e),i)})),r.callOnCompleteCallback(n,i,o)}))},t.prototype.addEventCallbackForQuery=function(t,e){var n;n=".info"===t.path.getFront()?this.infoSyncTree_.addEventRegistration(t,e):this.serverSyncTree_.addEventRegistration(t,e),this.eventQueue_.raiseEventsAtPath(t.path,n)},t.prototype.removeEventCallbackForQuery=function(t,e){var n;n=".info"===t.path.getFront()?this.infoSyncTree_.removeEventRegistration(t,e):this.serverSyncTree_.removeEventRegistration(t,e),this.eventQueue_.raiseEventsAtPath(t.path,n)},t.prototype.interrupt=function(){this.persistentConnection_&&this.persistentConnection_.interrupt("repo_interrupt")},t.prototype.resume=function(){this.persistentConnection_&&this.persistentConnection_.resume("repo_interrupt")},t.prototype.stats=function(t){if(void 0===t&&(t=!1),"undefined"!=typeof console){var e;t?(this.statsListener_||(this.statsListener_=new Re(this.stats_)),e=this.statsListener_.get()):e=this.stats_.get();var n=Object.keys(e).reduce((function(t,e){return Math.max(e.length,t)}),0);R(e,(function(t,e){for(var r=t,i=t.length;i<n+2;i++)r+=" ";console.log(r+e)}))}},t.prototype.statsIncrementCounter=function(t){this.stats_.incrementCounter(t),this.statsReporter_.includeStat(t)},t.prototype.log_=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n="";this.persistentConnection_&&(n=this.persistentConnection_.id+":"),_.apply(void 0,Object(i.g)([n],t))},t.prototype.callOnCompleteCallback=function(t,e,n){t&&G((function(){if("ok"===e)t(null);else{var r=(e||"error").toUpperCase(),i=r;n&&(i+=": "+n);var o=new Error(i);o.code=r,t(o)}}))},Object.defineProperty(t.prototype,"database",{get:function(){return this.__database||(this.__database=new hn(this))},enumerable:!1,configurable:!0}),t}(),Ze=function(){function t(e){this.indexedFilter_=new ve(e.getIndex()),this.index_=e.getIndex(),this.startPost_=t.getStartPost_(e),this.endPost_=t.getEndPost_(e)}return t.prototype.getStartPost=function(){return this.startPost_},t.prototype.getEndPost=function(){return this.endPost_},t.prototype.matches=function(t){return this.index_.compare(this.getStartPost(),t)<=0&&this.index_.compare(t,this.getEndPost())<=0},t.prototype.updateChild=function(t,e,n,r,i,o){return this.matches(new bt(e,n))||(n=Ft.EMPTY_NODE),this.indexedFilter_.updateChild(t,e,n,r,i,o)},t.prototype.updateFullNode=function(t,e,n){e.isLeafNode()&&(e=Ft.EMPTY_NODE);var r=e.withIndex(this.index_);r=r.updatePriority(Ft.EMPTY_NODE);var i=this;return e.forEachChild(St,(function(t,e){i.matches(new bt(t,e))||(r=r.updateImmediateChild(t,Ft.EMPTY_NODE))})),this.indexedFilter_.updateFullNode(t,r,n)},t.prototype.updatePriority=function(t,e){return t},t.prototype.filtersNodes=function(){return!0},t.prototype.getIndexedFilter=function(){return this.indexedFilter_},t.prototype.getIndex=function(){return this.index_},t.getStartPost_=function(t){if(t.hasStart()){var e=t.getIndexStartName();return t.getIndex().makePost(t.getIndexStartValue(),e)}return t.getIndex().minPost()},t.getEndPost_=function(t){if(t.hasEnd()){var e=t.getIndexEndName();return t.getIndex().makePost(t.getIndexEndValue(),e)}return t.getIndex().maxPost()},t}(),tn=function(){function t(t){this.rangedFilter_=new Ze(t),this.index_=t.getIndex(),this.limit_=t.getLimit(),this.reverse_=!t.isViewFromLeft()}return t.prototype.updateChild=function(t,e,n,r,i,o){return this.rangedFilter_.matches(new bt(e,n))||(n=Ft.EMPTY_NODE),t.getImmediateChild(e).equals(n)?t:t.numChildren()<this.limit_?this.rangedFilter_.getIndexedFilter().updateChild(t,e,n,r,i,o):this.fullLimitUpdateChild_(t,e,n,i,o)},t.prototype.updateFullNode=function(t,e,n){var r;if(e.isLeafNode()||e.isEmpty())r=Ft.EMPTY_NODE.withIndex(this.index_);else if(2*this.limit_<e.numChildren()&&e.isIndexed(this.index_)){r=Ft.EMPTY_NODE.withIndex(this.index_);var i=void 0;i=this.reverse_?e.getReverseIteratorFrom(this.rangedFilter_.getEndPost(),this.index_):e.getIteratorFrom(this.rangedFilter_.getStartPost(),this.index_);for(var o=0;i.hasNext()&&o<this.limit_;){var s=i.getNext();if(!(this.reverse_?this.index_.compare(this.rangedFilter_.getStartPost(),s)<=0:this.index_.compare(s,this.rangedFilter_.getEndPost())<=0))break;r=r.updateImmediateChild(s.name,s.node),o++}}else{r=(r=e.withIndex(this.index_)).updatePriority(Ft.EMPTY_NODE);var a=void 0,u=void 0,c=void 0;if(i=void 0,this.reverse_){i=r.getReverseIterator(this.index_),a=this.rangedFilter_.getEndPost(),u=this.rangedFilter_.getStartPost();var l=this.index_.getCompare();c=function(t,e){return l(e,t)}}else i=r.getIterator(this.index_),a=this.rangedFilter_.getStartPost(),u=this.rangedFilter_.getEndPost(),c=this.index_.getCompare();o=0;for(var h=!1;i.hasNext();)s=i.getNext(),!h&&c(a,s)<=0&&(h=!0),h&&o<this.limit_&&c(s,u)<=0?o++:r=r.updateImmediateChild(s.name,Ft.EMPTY_NODE)}return this.rangedFilter_.getIndexedFilter().updateFullNode(t,r,n)},t.prototype.updatePriority=function(t,e){return t},t.prototype.filtersNodes=function(){return!0},t.prototype.getIndexedFilter=function(){return this.rangedFilter_.getIndexedFilter()},t.prototype.getIndex=function(){return this.index_},t.prototype.fullLimitUpdateChild_=function(t,e,n,r,i){var s;if(this.reverse_){var a=this.index_.getCompare();s=function(t,e){return a(e,t)}}else s=this.index_.getCompare();var u=t;Object(o.e)(u.numChildren()===this.limit_,"");var c=new bt(e,n),l=this.reverse_?u.getFirstChild(this.index_):u.getLastChild(this.index_),h=this.rangedFilter_.matches(c);if(u.hasChild(e)){for(var d=u.getImmediateChild(e),f=r.getChildAfterChild(this.index_,l,this.reverse_);null!=f&&(f.name===e||u.hasChild(f.name));)f=r.getChildAfterChild(this.index_,f,this.reverse_);var p=null==f?1:s(f,c);if(h&&!n.isEmpty()&&p>=0)return null!=i&&i.trackChildChange(ye.childChangedChange(e,n,d)),u.updateImmediateChild(e,n);null!=i&&i.trackChildChange(ye.childRemovedChange(e,d));var g=u.updateImmediateChild(e,Ft.EMPTY_NODE);return null!=f&&this.rangedFilter_.matches(f)?(null!=i&&i.trackChildChange(ye.childAddedChange(f.name,f.node)),g.updateImmediateChild(f.name,f.node)):g}return n.isEmpty()?t:h&&s(l,c)>=0?(null!=i&&(i.trackChildChange(ye.childRemovedChange(l.name,l.node)),i.trackChildChange(ye.childAddedChange(e,n))),u.updateImmediateChild(e,n).updateImmediateChild(l.name,Ft.EMPTY_NODE)):t},t}(),en=function(){function t(){this.limitSet_=!1,this.startSet_=!1,this.startNameSet_=!1,this.endSet_=!1,this.endNameSet_=!1,this.limit_=0,this.viewFrom_="",this.indexStartValue_=null,this.indexStartName_="",this.indexEndValue_=null,this.indexEndName_="",this.index_=St}return t.prototype.hasStart=function(){return this.startSet_},t.prototype.isViewFromLeft=function(){return""===this.viewFrom_?this.startSet_:this.viewFrom_===t.WIRE_PROTOCOL_CONSTANTS_.VIEW_FROM_LEFT},t.prototype.getIndexStartValue=function(){return Object(o.e)(this.startSet_,"Only valid if start has been set"),this.indexStartValue_},t.prototype.getIndexStartName=function(){return Object(o.e)(this.startSet_,"Only valid if start has been set"),this.startNameSet_?this.indexStartName_:S},t.prototype.hasEnd=function(){return this.endSet_},t.prototype.getIndexEndValue=function(){return Object(o.e)(this.endSet_,"Only valid if end has been set"),this.indexEndValue_},t.prototype.getIndexEndName=function(){return Object(o.e)(this.endSet_,"Only valid if end has been set"),this.endNameSet_?this.indexEndName_:I},t.prototype.hasLimit=function(){return this.limitSet_},t.prototype.hasAnchoredLimit=function(){return this.limitSet_&&""!==this.viewFrom_},t.prototype.getLimit=function(){return Object(o.e)(this.limitSet_,"Only valid if limit has been set"),this.limit_},t.prototype.getIndex=function(){return this.index_},t.prototype.copy_=function(){var e=new t;return e.limitSet_=this.limitSet_,e.limit_=this.limit_,e.startSet_=this.startSet_,e.indexStartValue_=this.indexStartValue_,e.startNameSet_=this.startNameSet_,e.indexStartName_=this.indexStartName_,e.endSet_=this.endSet_,e.indexEndValue_=this.indexEndValue_,e.endNameSet_=this.endNameSet_,e.indexEndName_=this.indexEndName_,e.index_=this.index_,e.viewFrom_=this.viewFrom_,e},t.prototype.limit=function(t){var e=this.copy_();return e.limitSet_=!0,e.limit_=t,e.viewFrom_="",e},t.prototype.limitToFirst=function(e){var n=this.copy_();return n.limitSet_=!0,n.limit_=e,n.viewFrom_=t.WIRE_PROTOCOL_CONSTANTS_.VIEW_FROM_LEFT,n},t.prototype.limitToLast=function(e){var n=this.copy_();return n.limitSet_=!0,n.limit_=e,n.viewFrom_=t.WIRE_PROTOCOL_CONSTANTS_.VIEW_FROM_RIGHT,n},t.prototype.startAt=function(t,e){var n=this.copy_();return n.startSet_=!0,void 0===t&&(t=null),n.indexStartValue_=t,null!=e?(n.startNameSet_=!0,n.indexStartName_=e):(n.startNameSet_=!1,n.indexStartName_=""),n},t.prototype.endAt=function(t,e){var n=this.copy_();return n.endSet_=!0,void 0===t&&(t=null),n.indexEndValue_=t,void 0!==e?(n.endNameSet_=!0,n.indexEndName_=e):(n.endNameSet_=!1,n.indexEndName_=""),n},t.prototype.orderBy=function(t){var e=this.copy_();return e.index_=t,e},t.prototype.getQueryObject=function(){var e=t.WIRE_PROTOCOL_CONSTANTS_,n={};if(this.startSet_&&(n[e.INDEX_START_VALUE]=this.indexStartValue_,this.startNameSet_&&(n[e.INDEX_START_NAME]=this.indexStartName_)),this.endSet_&&(n[e.INDEX_END_VALUE]=this.indexEndValue_,this.endNameSet_&&(n[e.INDEX_END_NAME]=this.indexEndName_)),this.limitSet_){n[e.LIMIT]=this.limit_;var r=this.viewFrom_;""===r&&(r=this.isViewFromLeft()?e.VIEW_FROM_LEFT:e.VIEW_FROM_RIGHT),n[e.VIEW_FROM]=r}return this.index_!==St&&(n[e.INDEX]=this.index_.toString()),n},t.prototype.loadsAllData=function(){return!(this.startSet_||this.endSet_||this.limitSet_)},t.prototype.isDefault=function(){return this.loadsAllData()&&this.index_===St},t.prototype.getNodeFilter=function(){return this.loadsAllData()?new ve(this.getIndex()):this.hasLimit()?new tn(this):new Ze(this)},t.prototype.toRestQueryStringParameters=function(){var e,n=t.REST_QUERY_CONSTANTS_,r={};return this.isDefault()||(this.index_===St?e=n.PRIORITY_INDEX:this.index_===qt?e=n.VALUE_INDEX:this.index_===Et?e=n.KEY_INDEX:(Object(o.e)(this.index_ instanceof Ht,"Unrecognized index type!"),e=this.index_.toString()),r[n.ORDER_BY]=Object(o.G)(e),this.startSet_&&(r[n.START_AT]=Object(o.G)(this.indexStartValue_),this.startNameSet_&&(r[n.START_AT]+=","+Object(o.G)(this.indexStartName_))),this.endSet_&&(r[n.END_AT]=Object(o.G)(this.indexEndValue_),this.endNameSet_&&(r[n.END_AT]+=","+Object(o.G)(this.indexEndName_))),this.limitSet_&&(this.isViewFromLeft()?r[n.LIMIT_TO_FIRST]=this.limit_:r[n.LIMIT_TO_LAST]=this.limit_)),r},t.WIRE_PROTOCOL_CONSTANTS_={INDEX_START_VALUE:"sp",INDEX_START_NAME:"sn",INDEX_END_VALUE:"ep",INDEX_END_NAME:"en",LIMIT:"l",VIEW_FROM:"vf",VIEW_FROM_LEFT:"l",VIEW_FROM_RIGHT:"r",INDEX:"i"},t.REST_QUERY_CONSTANTS_={ORDER_BY:"orderBy",PRIORITY_INDEX:"$priority",VALUE_INDEX:"$value",KEY_INDEX:"$key",START_AT:"startAt",END_AT:"endAt",LIMIT_TO_FIRST:"limitToFirst",LIMIT_TO_LAST:"limitToLast"},t.DEFAULT=new t,t}(),nn=function(t){function e(e,n){if(!(e instanceof Je))throw new Error("new Reference() no longer supported - use app.database().");return t.call(this,e,n,en.DEFAULT,!1)||this}return Object(i.d)(e,t),e.prototype.getKey=function(){return Object(o.H)("Reference.key",0,0,arguments.length),this.path.isEmpty()?null:this.path.getBack()},e.prototype.child=function(t){return Object(o.H)("Reference.child",1,1,arguments.length),"number"==typeof t?t=String(t):t instanceof K||(null===this.path.getFront()?dt("Reference.child",1,t,!1):ht("Reference.child",1,t,!1)),new e(this.repo,this.path.child(t))},e.prototype.getParent=function(){Object(o.H)("Reference.parent",0,0,arguments.length);var t=this.path.parent();return null===t?null:new e(this.repo,t)},e.prototype.getRoot=function(){Object(o.H)("Reference.root",0,0,arguments.length);for(var t=this;null!==t.getParent();)t=t.getParent();return t},e.prototype.databaseProp=function(){return this.repo.database},e.prototype.set=function(t,e){Object(o.H)("Reference.set",1,2,arguments.length),ft("Reference.set",this.path),ot("Reference.set",1,t,this.path,!1),Object(o.I)("Reference.set",2,e,!0);var n=new o.a;return this.repo.setWithPriority(this.path,t,null,n.wrapCallback(e)),n.promise},e.prototype.update=function(t,e){if(Object(o.H)("Reference.update",1,2,arguments.length),ft("Reference.update",this.path),Array.isArray(t)){for(var n={},r=0;r<t.length;++r)n[""+r]=t[r];t=n,C("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.")}at("Reference.update",1,t,this.path,!1),Object(o.I)("Reference.update",2,e,!0);var i=new o.a;return this.repo.update(this.path,t,i.wrapCallback(e)),i.promise},e.prototype.setWithPriority=function(t,e,n){if(Object(o.H)("Reference.setWithPriority",2,3,arguments.length),ft("Reference.setWithPriority",this.path),ot("Reference.setWithPriority",1,t,this.path,!1),ut("Reference.setWithPriority",2,e,!1),Object(o.I)("Reference.setWithPriority",3,n,!0),".length"===this.getKey()||".keys"===this.getKey())throw"Reference.setWithPriority failed: "+this.getKey()+" is a read-only object.";var r=new o.a;return this.repo.setWithPriority(this.path,t,e,r.wrapCallback(n)),r.promise},e.prototype.remove=function(t){return Object(o.H)("Reference.remove",0,1,arguments.length),ft("Reference.remove",this.path),Object(o.I)("Reference.remove",1,t,!0),this.set(null,t)},e.prototype.transaction=function(t,e,n){if(Object(o.H)("Reference.transaction",1,3,arguments.length),ft("Reference.transaction",this.path),Object(o.I)("Reference.transaction",1,t,!1),Object(o.I)("Reference.transaction",2,e,!0),gt("Reference.transaction",3,n,!0),".length"===this.getKey()||".keys"===this.getKey())throw"Reference.transaction failed: "+this.getKey()+" is a read-only object.";void 0===n&&(n=!0);var r=new o.a;"function"==typeof e&&r.promise.catch((function(){}));var i=function(t,n,i){t?r.reject(t):r.resolve(new vt(n,i)),"function"==typeof e&&e(t,n,i)};return this.repo.startTransaction(this.path,t,i,n),r.promise},e.prototype.setPriority=function(t,e){Object(o.H)("Reference.setPriority",1,2,arguments.length),ft("Reference.setPriority",this.path),ut("Reference.setPriority",1,t,!1),Object(o.I)("Reference.setPriority",2,e,!0);var n=new o.a;return this.repo.setWithPriority(this.path.child(".priority"),t,null,n.wrapCallback(e)),n.promise},e.prototype.push=function(t,e){Object(o.H)("Reference.push",0,2,arguments.length),ft("Reference.push",this.path),ot("Reference.push",1,t,this.path,!0),Object(o.I)("Reference.push",2,e,!0);var n,r=this.repo.serverTime(),i=mt(r),s=this.child(i),a=this.child(i);return n=null!=t?s.set(t,e).then((function(){return a})):Promise.resolve(a),s.then=n.then.bind(n),s.catch=n.then.bind(n,void 0),"function"==typeof e&&n.catch((function(){})),s},e.prototype.onDisconnect=function(){return ft("Reference.onDisconnect",this.path),new yt(this.repo,this.path)},Object.defineProperty(e.prototype,"database",{get:function(){return this.databaseProp()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"key",{get:function(){return this.getKey()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parent",{get:function(){return this.getParent()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"root",{get:function(){return this.getRoot()},enumerable:!1,configurable:!0}),e}(Kt);Kt.__referenceConstructor=nn,Te.__referenceConstructor=nn;var rn=function(){return function(){this.children={},this.childCount=0,this.value=null}}(),on=function(){function t(t,e,n){void 0===t&&(t=""),void 0===e&&(e=null),void 0===n&&(n=new rn),this.name_=t,this.parent_=e,this.node_=n}return t.prototype.subTree=function(e){for(var n=e instanceof K?e:new K(e),r=this,i=n.getFront();null!==i;)r=new t(i,r,Object(o.D)(r.node_.children,i)||new rn),i=(n=n.popFront()).getFront();return r},t.prototype.getValue=function(){return this.node_.value},t.prototype.setValue=function(t){Object(o.e)(void 0!==t,"Cannot set value to undefined"),this.node_.value=t,this.updateParents_()},t.prototype.clear=function(){this.node_.value=null,this.node_.children={},this.node_.childCount=0,this.updateParents_()},t.prototype.hasChildren=function(){return this.node_.childCount>0},t.prototype.isEmpty=function(){return null===this.getValue()&&!this.hasChildren()},t.prototype.forEachChild=function(e){var n=this;R(this.node_.children,(function(r,i){e(new t(r,n,i))}))},t.prototype.forEachDescendant=function(t,e,n){e&&!n&&t(this),this.forEachChild((function(e){e.forEachDescendant(t,!0,n)})),e&&n&&t(this)},t.prototype.forEachAncestor=function(t,e){for(var n=e?this:this.parent();null!==n;){if(t(n))return!0;n=n.parent()}return!1},t.prototype.forEachImmediateDescendantWithValue=function(t){this.forEachChild((function(e){null!==e.getValue()?t(e):e.forEachImmediateDescendantWithValue(t)}))},t.prototype.path=function(){return new K(null===this.parent_?this.name_:this.parent_.path()+"/"+this.name_)},t.prototype.name=function(){return this.name_},t.prototype.parent=function(){return this.parent_},t.prototype.updateParents_=function(){null!==this.parent_&&this.parent_.updateChild_(this.name_,this)},t.prototype.updateChild_=function(t,e){var n=e.isEmpty(),r=Object(o.i)(this.node_.children,t);n&&r?(delete this.node_.children[t],this.node_.childCount--,this.updateParents_()):n||r||(this.node_.children[t]=e.node_,this.node_.childCount++,this.updateParents_())},t}(),sn=function(t){return t[t.RUN=0]="RUN",t[t.SENT=1]="SENT",t[t.COMPLETED=2]="COMPLETED",t[t.SENT_NEEDS_ABORT=3]="SENT_NEEDS_ABORT",t[t.NEEDS_ABORT=4]="NEEDS_ABORT",t}({});Je.MAX_TRANSACTION_RETRIES_=25,Je.prototype.transactionsInit_=function(){this.transactionQueueTree_=new on},Je.prototype.startTransaction=function(t,e,n,r){this.log_("transaction on "+t);var i=function(){},s=new nn(this,t);s.on("value",i);var a={path:t,update:e,onComplete:n,status:null,order:p(),applyLocally:r,retryCount:0,unwatcher:function(){s.off("value",i)},abortReason:null,currentWriteId:null,currentInputSnapshot:null,currentOutputSnapshotRaw:null,currentOutputSnapshotResolved:null},u=this.getLatestState_(t);a.currentInputSnapshot=u;var c=a.update(u.val());if(void 0===c){if(a.unwatcher(),a.currentOutputSnapshotRaw=null,a.currentOutputSnapshotResolved=null,a.onComplete){var l=new Bt(a.currentInputSnapshot,new nn(this,a.path),St);a.onComplete(null,!1,l)}}else{st("transaction failed: Data returned ",c,a.path),a.status=sn.RUN;var h=this.transactionQueueTree_.subTree(t),d=h.getValue()||[];d.push(a),h.setValue(d);var f=void 0;"object"==typeof c&&null!==c&&Object(o.i)(c,".priority")?(f=Object(o.D)(c,".priority"),Object(o.e)(it(f),"Invalid priority returned by transaction. Priority must be a valid string, finite number, server value, or null.")):f=(this.serverSyncTree_.calcCompleteEventCache(t)||Ft.EMPTY_NODE).getPriority().val(),f=f;var g=this.generateServerValues(),y=$t(c,f),v=ne(y,u,g);a.currentOutputSnapshotRaw=y,a.currentOutputSnapshotResolved=v,a.currentWriteId=this.getNextWriteId_();var m=this.serverSyncTree_.applyUserOverwrite(t,v,a.currentWriteId,a.applyLocally);this.eventQueue_.raiseEventsForChangedPath(t,m),this.sendReadyTransactions_()}},Je.prototype.getLatestState_=function(t,e){return this.serverSyncTree_.calcCompleteEventCache(t,e)||Ft.EMPTY_NODE},Je.prototype.sendReadyTransactions_=function(t){var e=this;if(void 0===t&&(t=this.transactionQueueTree_),t||this.pruneCompletedTransactionsBelowNode_(t),null!==t.getValue()){var n=this.buildTransactionQueue_(t);Object(o.e)(n.length>0,"Sending zero length transaction queue"),n.every((function(t){return t.status===sn.RUN}))&&this.sendTransactionQueue_(t.path(),n)}else t.hasChildren()&&t.forEachChild((function(t){e.sendReadyTransactions_(t)}))},Je.prototype.sendTransactionQueue_=function(t,e){for(var n=this,r=e.map((function(t){return t.currentWriteId})),i=this.getLatestState_(t,r),s=i,a=i.hash(),u=0;u<e.length;u++){var c=e[u];Object(o.e)(c.status===sn.RUN,"tryToSendTransactionQueue_: items in queue should all be run."),c.status=sn.SENT,c.retryCount++;var l=K.relativePath(t,c.path);s=s.updateChild(l,c.currentOutputSnapshotRaw)}var h=s.val(!0),d=t;this.server_.put(d.toString(),h,(function(r){n.log_("transaction put response",{path:d.toString(),status:r});var i=[];if("ok"===r){for(var o=[],s=0;s<e.length;s++){if(e[s].status=sn.COMPLETED,i=i.concat(n.serverSyncTree_.ackUserWrite(e[s].currentWriteId)),e[s].onComplete){var a=e[s].currentOutputSnapshotResolved,u=new nn(n,e[s].path),c=new Bt(a,u,St);o.push(e[s].onComplete.bind(null,null,!0,c))}e[s].unwatcher()}for(n.pruneCompletedTransactionsBelowNode_(n.transactionQueueTree_.subTree(t)),n.sendReadyTransactions_(),n.eventQueue_.raiseEventsForChangedPath(t,i),s=0;s<o.length;s++)G(o[s])}else{if("datastale"===r)for(s=0;s<e.length;s++)e[s].status=e[s].status===sn.SENT_NEEDS_ABORT?sn.NEEDS_ABORT:sn.RUN;else for(C("transaction at "+d.toString()+" failed: "+r),s=0;s<e.length;s++)e[s].status=sn.NEEDS_ABORT,e[s].abortReason=r;n.rerunTransactions_(t)}}),a)},Je.prototype.rerunTransactions_=function(t){var e=this.getAncestorTransactionNode_(t),n=e.path(),r=this.buildTransactionQueue_(e);return this.rerunTransactionQueue_(r,n),n},Je.prototype.rerunTransactionQueue_=function(t,e){if(0!==t.length){for(var n=[],r=[],i=t.filter((function(t){return t.status===sn.RUN})).map((function(t){return t.currentWriteId})),s=0;s<t.length;s++){var a=t[s],u=K.relativePath(e,a.path),c=!1,l=void 0;if(Object(o.e)(null!==u,"rerunTransactionsUnderNode_: relativePath should not be null."),a.status===sn.NEEDS_ABORT)c=!0,l=a.abortReason,r=r.concat(this.serverSyncTree_.ackUserWrite(a.currentWriteId,!0));else if(a.status===sn.RUN)if(a.retryCount>=Je.MAX_TRANSACTION_RETRIES_)c=!0,l="maxretry",r=r.concat(this.serverSyncTree_.ackUserWrite(a.currentWriteId,!0));else{var h=this.getLatestState_(a.path,i);a.currentInputSnapshot=h;var d=t[s].update(h.val());if(void 0!==d){st("transaction failed: Data returned ",d,a.path);var f=$t(d);"object"==typeof d&&null!=d&&Object(o.i)(d,".priority")||(f=f.updatePriority(h.getPriority()));var p=a.currentWriteId,g=this.generateServerValues(),y=ne(f,h,g);a.currentOutputSnapshotRaw=f,a.currentOutputSnapshotResolved=y,a.currentWriteId=this.getNextWriteId_(),i.splice(i.indexOf(p),1),r=(r=r.concat(this.serverSyncTree_.applyUserOverwrite(a.path,y,a.currentWriteId,a.applyLocally))).concat(this.serverSyncTree_.ackUserWrite(p,!0))}else c=!0,l="nodata",r=r.concat(this.serverSyncTree_.ackUserWrite(a.currentWriteId,!0))}if(this.eventQueue_.raiseEventsForChangedPath(e,r),r=[],c&&(t[s].status=sn.COMPLETED,setTimeout(t[s].unwatcher,Math.floor(0)),t[s].onComplete))if("nodata"===l){var v=new nn(this,t[s].path),m=new Bt(t[s].currentInputSnapshot,v,St);n.push(t[s].onComplete.bind(null,null,!1,m))}else n.push(t[s].onComplete.bind(null,new Error(l),!1,null))}for(this.pruneCompletedTransactionsBelowNode_(this.transactionQueueTree_),s=0;s<n.length;s++)G(n[s]);this.sendReadyTransactions_()}},Je.prototype.getAncestorTransactionNode_=function(t){var e,n=this.transactionQueueTree_;for(e=t.getFront();null!==e&&null===n.getValue();)n=n.subTree(e),e=(t=t.popFront()).getFront();return n},Je.prototype.buildTransactionQueue_=function(t){var e=[];return this.aggregateTransactionQueuesForNode_(t,e),e.sort((function(t,e){return t.order-e.order})),e},Je.prototype.aggregateTransactionQueuesForNode_=function(t,e){var n=this,r=t.getValue();if(null!==r)for(var i=0;i<r.length;i++)e.push(r[i]);t.forEachChild((function(t){n.aggregateTransactionQueuesForNode_(t,e)}))},Je.prototype.pruneCompletedTransactionsBelowNode_=function(t){var e=this,n=t.getValue();if(n){for(var r=0,i=0;i<n.length;i++)n[i].status!==sn.COMPLETED&&(n[r]=n[i],r++);n.length=r,t.setValue(n.length>0?n:null)}t.forEachChild((function(t){e.pruneCompletedTransactionsBelowNode_(t)}))},Je.prototype.abortTransactions_=function(t){var e=this,n=this.getAncestorTransactionNode_(t).path(),r=this.transactionQueueTree_.subTree(t);return r.forEachAncestor((function(t){e.abortTransactionsOnNode_(t)})),this.abortTransactionsOnNode_(r),r.forEachDescendant((function(t){e.abortTransactionsOnNode_(t)})),n},Je.prototype.abortTransactionsOnNode_=function(t){var e=t.getValue();if(null!==e){for(var n=[],r=[],i=-1,s=0;s<e.length;s++)e[s].status===sn.SENT_NEEDS_ABORT||(e[s].status===sn.SENT?(Object(o.e)(i===s-1,"All SENT items should be at beginning of queue."),i=s,e[s].status=sn.SENT_NEEDS_ABORT,e[s].abortReason="set"):(Object(o.e)(e[s].status===sn.RUN,"Unexpected transaction status in abort"),e[s].unwatcher(),r=r.concat(this.serverSyncTree_.ackUserWrite(e[s].currentWriteId,!0)),e[s].onComplete&&n.push(e[s].onComplete.bind(null,new Error("set"),!1,null))));for(-1===i?t.setValue(null):e.length=i+1,this.eventQueue_.raiseEventsForChangedPath(t.path(),r),s=0;s<n.length;s++)G(n[s])}};var an,un=function(){function t(t,e){var n=this;this.app_=t,this.authProvider_=e,this.auth_=null,this.auth_=e.getImmediate({optional:!0}),this.auth_||e.get().then((function(t){return n.auth_=t}))}return t.prototype.getToken=function(t){return this.auth_?this.auth_.getToken(t).catch((function(t){return t&&"auth/token-not-initialized"===t.code?(_("Got auth/token-not-initialized error.  Treating as null token."),null):Promise.reject(t)})):Promise.resolve(null)},t.prototype.addTokenChangeListener=function(t){this.auth_?this.auth_.addAuthTokenListener(t):(setTimeout((function(){return t(null)}),0),this.authProvider_.get().then((function(e){return e.addAuthTokenListener(t)})))},t.prototype.removeTokenChangeListener=function(t){this.authProvider_.get().then((function(e){return e.removeAuthTokenListener(t)}))},t.prototype.notifyForInvalidToken=function(){var t='Provided authentication credentials for the app named "'+this.app_.name+'" are invalid. This usually indicates your app was not initialized correctly. ';C(t+="credential"in this.app_.options?'Make sure the "credential" property provided to initializeApp() is authorized to access the specified "databaseURL" and is from the correct project.':"serviceAccount"in this.app_.options?'Make sure the "serviceAccount" property provided to initializeApp() is authorized to access the specified "databaseURL" and is from the correct project.':'Make sure the "apiKey" and "databaseURL" properties provided to initializeApp() match the values provided for your app at https://console.firebase.google.com/.')},t}(),cn=function(){function t(){}return t.prototype.getToken=function(e){return Promise.resolve({accessToken:t.EMULATOR_AUTH_TOKEN})},t.prototype.addTokenChangeListener=function(e){e(t.EMULATOR_AUTH_TOKEN)},t.prototype.removeTokenChangeListener=function(t){},t.prototype.notifyForInvalidToken=function(){},t.EMULATOR_AUTH_TOKEN="owner",t}(),ln=function(){function t(){this.repos_={},this.useRestClient_=!1}return t.getInstance=function(){return an||(an=new t),an},t.prototype.interrupt=function(){var t,e,n,r;try{for(var o=Object(i.i)(Object.keys(this.repos_)),s=o.next();!s.done;s=o.next()){var a=s.value;try{for(var u=(n=void 0,Object(i.i)(Object.keys(this.repos_[a]))),c=u.next();!c.done;c=u.next())this.repos_[a][c.value].interrupt()}catch(l){n={error:l}}finally{try{c&&!c.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}}}catch(h){t={error:h}}finally{try{s&&!s.done&&(e=o.return)&&e.call(o)}finally{if(t)throw t.error}}},t.prototype.resume=function(){var t,e,n,r;try{for(var o=Object(i.i)(Object.keys(this.repos_)),s=o.next();!s.done;s=o.next()){var a=s.value;try{for(var u=(n=void 0,Object(i.i)(Object.keys(this.repos_[a]))),c=u.next();!c.done;c=u.next())this.repos_[a][c.value].resume()}catch(l){n={error:l}}finally{try{c&&!c.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}}}catch(h){t={error:h}}finally{try{s&&!s.done&&(e=o.return)&&e.call(o)}finally{if(t)throw t.error}}},t.prototype.applyEmulatorSettings=function(t,e,n){t.repoInfo_=new Y(e+":"+n,!1,t.repoInfo_.namespace,t.repoInfo_.webSocketOnly,t.repoInfo_.nodeAdmin,t.repoInfo_.persistenceKey,t.repoInfo_.includeNamespaceInQueryParams),t.repoInfo_.nodeAdmin&&(t.authTokenProvider_=new cn)},t.prototype.databaseFromApp=function(t,e,n,r){var i=n||t.options.databaseURL;void 0===i&&(t.options.projectId||O("Can't determine Firebase Database URL. Be sure to include  a Project ID when calling firebase.initializeApp()."),_("Using default host for project ",t.options.projectId),i=t.options.projectId+"-default-rtdb.firebaseio.com");var o,s=J(i,r),a=s.repoInfo,u=void 0;"undefined"!=typeof process&&(u=process.env.FIREBASE_DATABASE_EMULATOR_HOST),u?(o=!0,a=(s=J(i="http://"+u+"?ns="+a.namespace,r)).repoInfo):o=!s.repoInfo.secure;var c=r&&o?new cn:new un(t,e);return pt("Invalid Firebase Database URL",1,s),s.path.isEmpty()||O("Database URL must point to the root of a Firebase Database (not including a child path)."),this.createRepo(a,t,c).database},t.prototype.deleteRepo=function(t){var e=Object(o.D)(this.repos_,t.app.name);e&&Object(o.D)(e,t.key)===t||O("Database "+t.app.name+"("+t.repoInfo_+") has already been deleted."),t.interrupt(),delete e[t.key]},t.prototype.createRepo=function(t,e,n){var r=Object(o.D)(this.repos_,e.name);r||(this.repos_[e.name]=r={});var i=Object(o.D)(r,t.toURLString());return i&&O("Database initialized multiple times. Please make sure the format of the database URL matches with each database() call."),i=new Je(t,this.useRestClient_,e,n),r[t.toURLString()]=i,i},t.prototype.forceRestClient=function(t){this.useRestClient_=t},t}(),hn=function(){function t(t){var e=this;this.repoInternal_=t,this.instanceStarted_=!1,this.INTERNAL={delete:function(){return Object(i.b)(e,void 0,void 0,(function(){return Object(i.e)(this,(function(t){return this.checkDeleted_("delete"),ln.getInstance().deleteRepo(this.repo_),this.repoInternal_=null,this.rootInternal_=null,[2]}))}))}},t instanceof Je||O("Don't call new Database() directly - please use firebase.database().")}return Object.defineProperty(t.prototype,"repo_",{get:function(){return this.instanceStarted_||(this.repoInternal_.start(),this.instanceStarted_=!0),this.repoInternal_},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"root_",{get:function(){return this.rootInternal_||(this.rootInternal_=new nn(this.repo_,K.Empty)),this.rootInternal_},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"app",{get:function(){return this.repo_.app},enumerable:!1,configurable:!0}),t.prototype.useEmulator=function(t,e){this.checkDeleted_("useEmulator"),this.instanceStarted_?O("Cannot call useEmulator() after instance has already been initialized."):ln.getInstance().applyEmulatorSettings(this.repoInternal_,t,e)},t.prototype.ref=function(t){return this.checkDeleted_("ref"),Object(o.H)("database.ref",0,1,arguments.length),t instanceof nn?this.refFromURL(t.toString()):void 0!==t?this.root_.child(t):this.root_},t.prototype.refFromURL=function(t){var e="database.refFromURL";this.checkDeleted_(e),Object(o.H)(e,1,1,arguments.length);var n=J(t,this.repo_.repoInfo_.nodeAdmin);pt(e,1,n);var r=n.repoInfo;return r.isCustomHost()||r.host===this.repo_.repoInfo_.host||O(e+": Host name does not match the current database: (found "+r.host+" but expected "+this.repo_.repoInfo_.host+")"),this.ref(n.path.toString())},t.prototype.checkDeleted_=function(t){null===this.repoInternal_&&O("Cannot call "+t+" on a deleted database.")},t.prototype.goOffline=function(){Object(o.H)("database.goOffline",0,0,arguments.length),this.checkDeleted_("goOffline"),this.repo_.interrupt()},t.prototype.goOnline=function(){Object(o.H)("database.goOnline",0,0,arguments.length),this.checkDeleted_("goOnline"),this.repo_.resume()},t.ServerValue={TIMESTAMP:{".sv":"timestamp"},increment:function(t){return{".sv":{increment:t}}}},t}(),dn=Object.freeze({__proto__:null,forceLongPolling:function(){We.forceDisallow(),Ve.forceAllow()},forceWebSockets:function(){Ve.forceDisallow()},isWebSocketsAvailable:function(){return We.isAvailable()},setSecurityDebugCallback:function(t,e){t.repo.persistentConnection_.securityDebugCallback_=e},stats:function(t,e){t.repo.stats(e)},statsIncrementCounter:function(t,e){t.repo.statsIncrementCounter(e)},dataUpdateCount:function(t){return t.repo.dataUpdateCount},interceptServerData:function(t,e){return t.repo.interceptServerData_(e)},initStandalone:function(t){var e=t.app,n=t.url,r=t.customAuthImpl,i=t.namespace,o=t.nodeAdmin,s=void 0!==o&&o;Be(t.version);var u=new a.c("auth-internal",new a.b("database-standalone"));return u.setComponent(new a.a("auth-internal",(function(){return r}),"PRIVATE")),{instance:ln.getInstance().databaseFromApp(e,u,n,s),namespace:i}}}),fn=Xe;Xe.prototype.simpleListen=function(t,e){this.sendRequest("q",{p:t},e)},Xe.prototype.echo=function(t,e){this.sendRequest("echo",{d:t},e)};var pn=Object.freeze({__proto__:null,DataConnection:fn,RealTimeConnection:Qe,hijackHash:function(t){var e=Xe.prototype.put;return Xe.prototype.put=function(n,r,i,o){void 0!==o&&(o=t()),e.call(this,n,r,i,o)},function(){Xe.prototype.put=e}},ConnectionTarget:Y,queryIdentifier:function(t){return t.queryIdentifier()},forceRestClient:function(t){ln.getInstance().forceRestClient(t)}}),gn=hn.ServerValue;!function(e){Be(e.SDK_VERSION);var n=e.INTERNAL.registerComponent(new a.a("database",(function(t,e){var n=t.getProvider("app").getImmediate(),r=t.getProvider("auth-internal");return ln.getInstance().databaseFromApp(n,r,e)}),"PUBLIC").setServiceProps({Reference:nn,Query:Kt,Database:hn,DataSnapshot:Bt,enableLogging:b,INTERNAL:dn,ServerValue:gn,TEST_ACCESS:pn}).setMultipleInstances(!0));e.registerVersion("@firebase/database","0.8.1"),Object(o.w)()&&(t.exports=n)}(r.a)}).call(this,n("3UD+")(t))},"6pL8":function(t,e,n){"use strict";n.r(e),n.d(e,"mdTransitionAnimation",(function(){return o})),n("A36C"),n("OMvp");var r=n("btv9"),i=n("fYWy");const o=(t,e)=>{const n="back"===e.direction,o=e.enteringEl,s=e.leavingEl,a=Object(i.g)(o),u=a.querySelector("ion-toolbar"),c=Object(r.a)();if(c.addElement(a).fill("both").beforeRemoveClass("ion-page-invisible"),n?c.duration(e.duration||200).easing("cubic-bezier(0.47,0,0.745,0.715)"):c.duration(e.duration||280).easing("cubic-bezier(0.36,0.66,0.04,1)").fromTo("transform","translateY(40px)","translateY(0px)").fromTo("opacity",.01,1),u){const t=Object(r.a)();t.addElement(u),c.addAnimation(t)}if(s&&n){c.duration(e.duration||200).easing("cubic-bezier(0.47,0,0.745,0.715)");const t=Object(r.a)();t.addElement(Object(i.g)(s)).onFinish(e=>{1===e&&t.elements.length>0&&t.elements[0].style.setProperty("display","none")}).fromTo("transform","translateY(0px)","translateY(40px)").fromTo("opacity",1,0),c.addAnimation(t)}return c}},"7o/Q":function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var r=n("n6bG"),i=n("gRHU"),o=n("quSY"),s=n("2QA8"),a=n("2fFW"),u=n("NJ4a");class c extends o.a{constructor(t,e,n){switch(super(),this.syncErrorValue=null,this.syncErrorThrown=!1,this.syncErrorThrowable=!1,this.isStopped=!1,arguments.length){case 0:this.destination=i.a;break;case 1:if(!t){this.destination=i.a;break}if("object"==typeof t){t instanceof c?(this.syncErrorThrowable=t.syncErrorThrowable,this.destination=t,t.add(this)):(this.syncErrorThrowable=!0,this.destination=new l(this,t));break}default:this.syncErrorThrowable=!0,this.destination=new l(this,t,e,n)}}[s.a](){return this}static create(t,e,n){const r=new c(t,e,n);return r.syncErrorThrowable=!1,r}next(t){this.isStopped||this._next(t)}error(t){this.isStopped||(this.isStopped=!0,this._error(t))}complete(){this.isStopped||(this.isStopped=!0,this._complete())}unsubscribe(){this.closed||(this.isStopped=!0,super.unsubscribe())}_next(t){this.destination.next(t)}_error(t){this.destination.error(t),this.unsubscribe()}_complete(){this.destination.complete(),this.unsubscribe()}_unsubscribeAndRecycle(){const{_parentOrParents:t}=this;return this._parentOrParents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parentOrParents=t,this}}class l extends c{constructor(t,e,n,o){let s;super(),this._parentSubscriber=t;let a=this;Object(r.a)(e)?s=e:e&&(s=e.next,n=e.error,o=e.complete,e!==i.a&&(a=Object.create(e),Object(r.a)(a.unsubscribe)&&this.add(a.unsubscribe.bind(a)),a.unsubscribe=this.unsubscribe.bind(this))),this._context=a,this._next=s,this._error=n,this._complete=o}next(t){if(!this.isStopped&&this._next){const{_parentSubscriber:e}=this;a.a.useDeprecatedSynchronousErrorHandling&&e.syncErrorThrowable?this.__tryOrSetError(e,this._next,t)&&this.unsubscribe():this.__tryOrUnsub(this._next,t)}}error(t){if(!this.isStopped){const{_parentSubscriber:e}=this,{useDeprecatedSynchronousErrorHandling:n}=a.a;if(this._error)n&&e.syncErrorThrowable?(this.__tryOrSetError(e,this._error,t),this.unsubscribe()):(this.__tryOrUnsub(this._error,t),this.unsubscribe());else if(e.syncErrorThrowable)n?(e.syncErrorValue=t,e.syncErrorThrown=!0):Object(u.a)(t),this.unsubscribe();else{if(this.unsubscribe(),n)throw t;Object(u.a)(t)}}}complete(){if(!this.isStopped){const{_parentSubscriber:t}=this;if(this._complete){const e=()=>this._complete.call(this._context);a.a.useDeprecatedSynchronousErrorHandling&&t.syncErrorThrowable?(this.__tryOrSetError(t,e),this.unsubscribe()):(this.__tryOrUnsub(e),this.unsubscribe())}else this.unsubscribe()}}__tryOrUnsub(t,e){try{t.call(this._context,e)}catch(n){if(this.unsubscribe(),a.a.useDeprecatedSynchronousErrorHandling)throw n;Object(u.a)(n)}}__tryOrSetError(t,e,n){if(!a.a.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{e.call(this._context,n)}catch(r){return a.a.useDeprecatedSynchronousErrorHandling?(t.syncErrorValue=r,t.syncErrorThrown=!0,!0):(Object(u.a)(r),!0)}return!1}_unsubscribe(){const{_parentSubscriber:t}=this;this._context=null,this._parentSubscriber=null,t.unsubscribe()}}},"8RMS":function(t,e,n){"use strict";n.r(e),n.d(e,"MENU_BACK_BUTTON_PRIORITY",(function(){return o})),n.d(e,"OVERLAY_BACK_BUTTON_PRIORITY",(function(){return i})),n.d(e,"startHardwareBackButton",(function(){return r}));const r=()=>{const t=document;let e=!1;t.addEventListener("backbutton",()=>{if(e)return;let n=0,r=[];const i=new CustomEvent("ionBackButton",{bubbles:!1,detail:{register(t,e){r.push({priority:t,handler:e,id:n++})}}});t.dispatchEvent(i);const o=()=>{if(r.length>0){let t={priority:Number.MIN_SAFE_INTEGER,handler:()=>{},id:-1};r.forEach(e=>{e.priority>=t.priority&&(t=e)}),e=!0,r=r.filter(e=>e.id!==t.id),(async t=>{try{if(t&&t.handler){const e=t.handler(o);null!=e&&await e}}catch(e){console.error(e)}})(t).then(()=>e=!1)}};o()})},i=100,o=99},"9ppp":function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));const r=(()=>{function t(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}return t.prototype=Object.create(Error.prototype),t})()},A36C:function(t,e,n){"use strict";n.d(e,"a",(function(){return $t})),n.d(e,"b",(function(){return d})),n.d(e,"c",(function(){return R})),n.d(e,"d",(function(){return y})),n.d(e,"e",(function(){return _t})),n.d(e,"f",(function(){return Ut})),n.d(e,"g",(function(){return et})),n.d(e,"h",(function(){return Ft})),n.d(e,"i",(function(){return j})),n.d(e,"j",(function(){return k})),n.d(e,"k",(function(){return tt})),n.d(e,"l",(function(){return ct})),n.d(e,"m",(function(){return wt})),n.d(e,"n",(function(){return p})),n.d(e,"o",(function(){return Ct})),n.d(e,"p",(function(){return I})),n.d(e,"q",(function(){return h}));let r,i,o,s=!1,a=!1,u=!1,c=!1,l=!1;const h="undefined"!=typeof window?window:{},d=h.CSS,f=h.document||{head:{}},p={$flags$:0,$resourcesUrl$:"",jmp:t=>t(),raf:t=>requestAnimationFrame(t),ael:(t,e,n,r)=>t.addEventListener(e,n,r),rel:(t,e,n,r)=>t.removeEventListener(e,n,r),ce:(t,e)=>new CustomEvent(t,e)},g=(()=>(f.head.attachShadow+"").indexOf("[native")>-1)(),y=t=>Promise.resolve(t),v=(()=>{try{return new CSSStyleSheet,!0}catch(t){}return!1})(),m=(t,e,n,r)=>{n&&n.map(([n,r,i])=>{const o=_(t,n),s=b(e,i),a=w(n);p.ael(o,r,s,a),(e.$rmListeners$=e.$rmListeners$||[]).push(()=>p.rel(o,r,s,a))})},b=(t,e)=>n=>{try{256&t.$flags$?t.$lazyInstance$[e](n):(t.$queuedListeners$=t.$queuedListeners$||[]).push([e,n])}catch(r){It(r)}},_=(t,e)=>4&e?f:8&e?h:16&e?f.body:t,w=t=>0!=(2&t),E="http://www.w3.org/1999/xlink",O=new WeakMap,C=(t,e,n)=>{let r=At.get(t);v&&n?(r=r||new CSSStyleSheet,r.replace(e)):r=e,At.set(t,r)},T=(t,e,n,r)=>{let i=S(e,n),o=At.get(i);if(t=11===t.nodeType?t:f,o)if("string"==typeof o){let n,s=O.get(t=t.head||t);if(s||O.set(t,s=new Set),!s.has(i)){if(t.host&&(n=t.querySelector(`[sty-id="${i}"]`)))n.innerHTML=o;else{if(p.$cssShim$){n=p.$cssShim$.createHostStyle(r,i,o,!!(10&e.$flags$));const t=n["s-sc"];t&&(i=t,s=null)}else n=f.createElement("style"),n.innerHTML=o;t.insertBefore(n,t.querySelector("link"))}s&&s.add(i)}}else t.adoptedStyleSheets.includes(o)||(t.adoptedStyleSheets=[...t.adoptedStyleSheets,o]);return i},S=(t,e)=>"sc-"+(e&&32&t.$flags$?t.$tagName$+"-"+e:t.$tagName$),I=t=>kt.push(t),j=t=>Ot(t).$modeName$,x={},A=t=>"object"==(t=typeof t)||"function"===t,k=(t,e,...n)=>{let r=null,i=null,o=null,s=!1,a=!1,u=[];const c=e=>{for(let n=0;n<e.length;n++)r=e[n],Array.isArray(r)?c(r):null!=r&&"boolean"!=typeof r&&((s="function"!=typeof t&&!A(r))&&(r=String(r)),s&&a?u[u.length-1].$text$+=r:u.push(s?N(null,r):r),a=s)};if(c(n),e){e.key&&(i=e.key),e.name&&(o=e.name);{const t=e.className||e.class;t&&(e.class="object"!=typeof t?t:Object.keys(t).filter(e=>t[e]).join(" "))}}if("function"==typeof t)return t(null===e?{}:e,u,P);const l=N(t,null);return l.$attrs$=e,u.length>0&&(l.$children$=u),l.$key$=i,l.$name$=o,l},N=(t,e)=>({$flags$:0,$tag$:t,$text$:e,$elm$:null,$children$:null,$attrs$:null,$key$:null,$name$:null}),R={},P={forEach:(t,e)=>t.map(D).forEach(e),map:(t,e)=>t.map(D).map(e).map(L)},D=t=>({vattrs:t.$attrs$,vchildren:t.$children$,vkey:t.$key$,vname:t.$name$,vtag:t.$tag$,vtext:t.$text$}),L=t=>{if("function"==typeof t.vtag){const e=Object.assign({},t.vattrs);return t.vkey&&(e.key=t.vkey),t.vname&&(e.name=t.vname),k(t.vtag,e,...t.vchildren||[])}const e=N(t.vtag,t.vtext);return e.$attrs$=t.vattrs,e.$children$=t.vchildren,e.$key$=t.vkey,e.$name$=t.vname,e},M=(t,e,n,r,i,o)=>{if(n!==r){let a=St(t,e),u=e.toLowerCase();if("class"===e){const e=t.classList,i=U(n),o=U(r);e.remove(...i.filter(t=>t&&!o.includes(t))),e.add(...o.filter(t=>t&&!i.includes(t)))}else if("style"===e){for(const e in n)r&&null!=r[e]||(e.includes("-")?t.style.removeProperty(e):t.style[e]="");for(const e in r)n&&r[e]===n[e]||(e.includes("-")?t.style.setProperty(e,r[e]):t.style[e]=r[e])}else if("key"===e);else if("ref"===e)r&&r(t);else if(a||"o"!==e[0]||"n"!==e[1]){const c=A(r);if((a||c&&null!==r)&&!i)try{if(t.tagName.includes("-"))t[e]=r;else{let i=null==r?"":r;"list"===e?a=!1:null!=n&&t[e]==i||(t[e]=i)}}catch(s){}let l=!1;u!==(u=u.replace(/^xlink\:?/,""))&&(e=u,l=!0),null==r||!1===r?!1===r&&""!==t.getAttribute(e)||(l?t.removeAttributeNS(E,e):t.removeAttribute(e)):(!a||4&o||i)&&!c&&(r=!0===r?"":r,l?t.setAttributeNS(E,e,r):t.setAttribute(e,r))}else e="-"===e[2]?e.slice(3):St(h,u)?u.slice(2):u[2]+e.slice(3),n&&p.rel(t,e,n,!1),r&&p.ael(t,e,r,!1)}},F=/\s/,U=t=>t?t.split(F):[],$=(t,e,n,r)=>{const i=11===e.$elm$.nodeType&&e.$elm$.host?e.$elm$.host:e.$elm$,o=t&&t.$attrs$||x,s=e.$attrs$||x;for(r in o)r in s||M(i,r,o[r],void 0,n,e.$flags$);for(r in s)M(i,r,o[r],s[r],n,e.$flags$)},V=(t,e,n,a)=>{let l,h,d,p=e.$children$[n],g=0;if(s||(u=!0,"slot"===p.$tag$&&(r&&a.classList.add(r+"-s"),p.$flags$|=p.$children$?2:1)),null!==p.$text$)l=p.$elm$=f.createTextNode(p.$text$);else if(1&p.$flags$)l=p.$elm$=f.createTextNode("");else{if(c||(c="svg"===p.$tag$),l=p.$elm$=f.createElementNS(c?"http://www.w3.org/2000/svg":"http://www.w3.org/1999/xhtml",2&p.$flags$?"slot-fb":p.$tag$),c&&"foreignObject"===p.$tag$&&(c=!1),$(null,p,c),null!=r&&l["s-si"]!==r&&l.classList.add(l["s-si"]=r),p.$children$)for(g=0;g<p.$children$.length;++g)h=V(t,p,g,l),h&&l.appendChild(h);"svg"===p.$tag$?c=!1:"foreignObject"===l.tagName&&(c=!0)}return l["s-hn"]=o,3&p.$flags$&&(l["s-sr"]=!0,l["s-cr"]=i,l["s-sn"]=p.$name$||"",d=t&&t.$children$&&t.$children$[n],d&&d.$tag$===p.$tag$&&t.$elm$&&q(t.$elm$,!1)),l},q=(t,e)=>{p.$flags$|=1;const n=t.childNodes;for(let r=n.length-1;r>=0;r--){const t=n[r];t["s-hn"]!==o&&t["s-ol"]&&(G(t).insertBefore(t,W(t)),t["s-ol"].remove(),t["s-ol"]=void 0,u=!0),e&&q(t,e)}p.$flags$&=-2},H=(t,e,n,r,i,s)=>{let a,u=t["s-cr"]&&t["s-cr"].parentNode||t;for(u.shadowRoot&&u.tagName===o&&(u=u.shadowRoot);i<=s;++i)r[i]&&(a=V(null,n,i,t),a&&(r[i].$elm$=a,u.insertBefore(a,W(e))))},B=(t,e,n,r,i)=>{for(;e<=n;++e)(r=t[e])&&(i=r.$elm$,Z(r),a=!0,i["s-ol"]?i["s-ol"].remove():q(i,!0),i.remove())},z=(t,e)=>t.$tag$===e.$tag$&&("slot"===t.$tag$?t.$name$===e.$name$:t.$key$===e.$key$),W=t=>t&&t["s-ol"]||t,G=t=>(t["s-ol"]?t["s-ol"]:t).parentNode,Q=(t,e)=>{const n=e.$elm$=t.$elm$,r=t.$children$,i=e.$children$,o=e.$tag$,s=e.$text$;let a;null===s?(c="svg"===o||"foreignObject"!==o&&c,"slot"===o||$(t,e,c),null!==r&&null!==i?((t,e,n,r)=>{let i,o,s=0,a=0,u=0,c=0,l=e.length-1,h=e[0],d=e[l],f=r.length-1,p=r[0],g=r[f];for(;s<=l&&a<=f;)if(null==h)h=e[++s];else if(null==d)d=e[--l];else if(null==p)p=r[++a];else if(null==g)g=r[--f];else if(z(h,p))Q(h,p),h=e[++s],p=r[++a];else if(z(d,g))Q(d,g),d=e[--l],g=r[--f];else if(z(h,g))"slot"!==h.$tag$&&"slot"!==g.$tag$||q(h.$elm$.parentNode,!1),Q(h,g),t.insertBefore(h.$elm$,d.$elm$.nextSibling),h=e[++s],g=r[--f];else if(z(d,p))"slot"!==h.$tag$&&"slot"!==g.$tag$||q(d.$elm$.parentNode,!1),Q(d,p),t.insertBefore(d.$elm$,h.$elm$),d=e[--l],p=r[++a];else{for(u=-1,c=s;c<=l;++c)if(e[c]&&null!==e[c].$key$&&e[c].$key$===p.$key$){u=c;break}u>=0?(o=e[u],o.$tag$!==p.$tag$?i=V(e&&e[a],n,u,t):(Q(o,p),e[u]=void 0,i=o.$elm$),p=r[++a]):(i=V(e&&e[a],n,a,t),p=r[++a]),i&&G(h.$elm$).insertBefore(i,W(h.$elm$))}s>l?H(t,null==r[f+1]?null:r[f+1].$elm$,n,r,a,f):a>f&&B(e,s,l)})(n,r,e,i):null!==i?(null!==t.$text$&&(n.textContent=""),H(n,null,e,i,0,i.length-1)):null!==r&&B(r,0,r.length-1),c&&"svg"===o&&(c=!1)):(a=n["s-cr"])?a.parentNode.textContent=s:t.$text$!==s&&(n.data=s)},K=t=>{let e,n,r,i,o,s,a=t.childNodes;for(n=0,r=a.length;n<r;n++)if(e=a[n],1===e.nodeType){if(e["s-sr"])for(o=e["s-sn"],e.hidden=!1,i=0;i<r;i++)if(a[i]["s-hn"]!==e["s-hn"])if(s=a[i].nodeType,""!==o){if(1===s&&o===a[i].getAttribute("slot")){e.hidden=!0;break}}else if(1===s||3===s&&""!==a[i].textContent.trim()){e.hidden=!0;break}K(e)}},X=[],Y=t=>{let e,n,r,i,o,s,u=0,c=t.childNodes,l=c.length;for(;u<l;u++){if(e=c[u],e["s-sr"]&&(n=e["s-cr"]))for(r=n.parentNode.childNodes,i=e["s-sn"],s=r.length-1;s>=0;s--)n=r[s],n["s-cn"]||n["s-nr"]||n["s-hn"]===e["s-hn"]||(J(n,i)?(o=X.find(t=>t.$nodeToRelocate$===n),a=!0,n["s-sn"]=n["s-sn"]||i,o?o.$slotRefNode$=e:X.push({$slotRefNode$:e,$nodeToRelocate$:n}),n["s-sr"]&&X.map(t=>{J(t.$nodeToRelocate$,n["s-sn"])&&(o=X.find(t=>t.$nodeToRelocate$===n),o&&!t.$slotRefNode$&&(t.$slotRefNode$=o.$slotRefNode$))})):X.some(t=>t.$nodeToRelocate$===n)||X.push({$nodeToRelocate$:n}));1===e.nodeType&&Y(e)}},J=(t,e)=>1===t.nodeType?null===t.getAttribute("slot")&&""===e||t.getAttribute("slot")===e:t["s-sn"]===e||""===e,Z=t=>{t.$attrs$&&t.$attrs$.ref&&t.$attrs$.ref(null),t.$children$&&t.$children$.map(Z)},tt=t=>Ot(t).$hostElement$,et=(t,e,n)=>{const r=tt(t);return{emit:t=>nt(r,e,{bubbles:!!(4&n),composed:!!(2&n),cancelable:!!(1&n),detail:t})}},nt=(t,e,n)=>{const r=p.ce(e,n);return t.dispatchEvent(r),r},rt=(t,e)=>{e&&!t.$onRenderResolve$&&e["s-p"]&&e["s-p"].push(new Promise(e=>t.$onRenderResolve$=e))},it=(t,e)=>{if(t.$flags$|=16,!(4&t.$flags$))return rt(t,t.$ancestorComponent$),Ut(()=>ot(t,e));t.$flags$|=512},ot=(t,e)=>{const n=t.$lazyInstance$;let r;return e&&(t.$flags$|=256,t.$queuedListeners$&&(t.$queuedListeners$.map(([t,e])=>ht(n,t,e)),t.$queuedListeners$=null),r=ht(n,"componentWillLoad")),r=dt(r,()=>ht(n,"componentWillRender")),dt(r,()=>st(t,n,e))},st=async(t,e,n)=>{const c=t.$hostElement$,l=c["s-rc"];n&&(t=>{const e=t.$cmpMeta$,n=t.$hostElement$,r=e.$flags$,i=T(g&&n.shadowRoot?n.shadowRoot:n.getRootNode(),e,t.$modeName$,n);10&r&&(n["s-sc"]=i,n.classList.add(i+"-h"),2&r&&n.classList.add(i+"-s"))})(t),((t,e)=>{const n=t.$hostElement$,c=t.$cmpMeta$,l=t.$vnode$||N(null,null),h=(d=e)&&d.$tag$===R?e:k(null,null,e);var d;if(o=n.tagName,c.$attrsToReflect$&&(h.$attrs$=h.$attrs$||{},c.$attrsToReflect$.map(([t,e])=>h.$attrs$[e]=n[t])),h.$tag$=null,h.$flags$|=4,t.$vnode$=h,h.$elm$=l.$elm$=n.shadowRoot||n,r=n["s-sc"],i=n["s-cr"],s=g&&0!=(1&c.$flags$),a=!1,Q(l,h),p.$flags$|=1,u){let t,e,n,r,i,o;Y(h.$elm$);let s=0;for(;s<X.length;s++)t=X[s],e=t.$nodeToRelocate$,e["s-ol"]||(n=f.createTextNode(""),n["s-nr"]=e,e.parentNode.insertBefore(e["s-ol"]=n,e));for(s=0;s<X.length;s++)if(t=X[s],e=t.$nodeToRelocate$,t.$slotRefNode$){for(r=t.$slotRefNode$.parentNode,i=t.$slotRefNode$.nextSibling,n=e["s-ol"];n=n.previousSibling;)if(o=n["s-nr"],o&&o["s-sn"]===e["s-sn"]&&r===o.parentNode&&(o=o.nextSibling,!o||!o["s-nr"])){i=o;break}(!i&&r!==e.parentNode||e.nextSibling!==i)&&e!==i&&(!e["s-hn"]&&e["s-ol"]&&(e["s-hn"]=e["s-ol"].parentNode.nodeName),r.insertBefore(e,i))}else 1===e.nodeType&&(e.hidden=!0)}a&&K(h.$elm$),p.$flags$&=-2,X.length=0})(t,at(t,e)),p.$cssShim$&&p.$cssShim$.updateHost(c),l&&(l.map(t=>t()),c["s-rc"]=void 0);{const e=c["s-p"],n=()=>ut(t);0===e.length?n():(Promise.all(e).then(n),t.$flags$|=4,e.length=0)}},at=(t,e)=>{try{e=e.render&&e.render(),t.$flags$&=-17,t.$flags$|=2}catch(n){It(n,t.$hostElement$)}return e},ut=t=>{const e=t.$hostElement$,n=t.$lazyInstance$,r=t.$ancestorComponent$;64&t.$flags$?ht(n,"componentDidUpdate"):(t.$flags$|=64,ft(e),ht(n,"componentDidLoad"),t.$onReadyResolve$(e),r||lt()),t.$onInstanceResolve$(e),t.$onRenderResolve$&&(t.$onRenderResolve$(),t.$onRenderResolve$=void 0),512&t.$flags$&&Mt(()=>it(t,!1)),t.$flags$&=-517},ct=t=>{{const e=Ot(t),n=e.$hostElement$.isConnected;return n&&2==(18&e.$flags$)&&it(e,!1),n}},lt=t=>{ft(f.documentElement),Mt(()=>nt(h,"appload",{detail:{namespace:"ionic"}}))},ht=(t,e,n)=>{if(t&&t[e])try{return t[e](n)}catch(r){It(r)}},dt=(t,e)=>t&&t.then?t.then(e):e(),ft=t=>t.classList.add("hydrated"),pt=(t,e,n,r,i,o,s)=>{let a,u,c,l;if(1===o.nodeType){for(a=o.getAttribute("c-id"),a&&(u=a.split("."),u[0]!==s&&"0"!==u[0]||(c={$flags$:0,$hostId$:u[0],$nodeId$:u[1],$depth$:u[2],$index$:u[3],$tag$:o.tagName.toLowerCase(),$elm$:o,$attrs$:null,$children$:null,$key$:null,$name$:null,$text$:null},e.push(c),o.removeAttribute("c-id"),t.$children$||(t.$children$=[]),t.$children$[c.$index$]=c,t=c,r&&"0"===c.$depth$&&(r[c.$index$]=c.$elm$))),l=o.childNodes.length-1;l>=0;l--)pt(t,e,n,r,i,o.childNodes[l],s);if(o.shadowRoot)for(l=o.shadowRoot.childNodes.length-1;l>=0;l--)pt(t,e,n,r,i,o.shadowRoot.childNodes[l],s)}else if(8===o.nodeType)u=o.nodeValue.split("."),u[1]!==s&&"0"!==u[1]||(a=u[0],c={$flags$:0,$hostId$:u[1],$nodeId$:u[2],$depth$:u[3],$index$:u[4],$elm$:o,$attrs$:null,$children$:null,$key$:null,$name$:null,$tag$:null,$text$:null},"t"===a?(c.$elm$=o.nextSibling,c.$elm$&&3===c.$elm$.nodeType&&(c.$text$=c.$elm$.textContent,e.push(c),o.remove(),t.$children$||(t.$children$=[]),t.$children$[c.$index$]=c,r&&"0"===c.$depth$&&(r[c.$index$]=c.$elm$))):c.$hostId$===s&&("s"===a?(c.$tag$="slot",o["s-sn"]=u[5]?c.$name$=u[5]:"",o["s-sr"]=!0,r&&(c.$elm$=f.createElement(c.$tag$),c.$name$&&c.$elm$.setAttribute("name",c.$name$),o.parentNode.insertBefore(c.$elm$,o),o.remove(),"0"===c.$depth$&&(r[c.$index$]=c.$elm$)),n.push(c),t.$children$||(t.$children$=[]),t.$children$[c.$index$]=c):"r"===a&&(r?o.remove():(i["s-cr"]=o,o["s-cn"]=!0))));else if(t&&"style"===t.$tag$){const e=N(null,o.textContent);e.$elm$=o,e.$index$="0",t.$children$=[e]}},gt=(t,e)=>{if(1===t.nodeType){let n=0;for(;n<t.childNodes.length;n++)gt(t.childNodes[n],e);if(t.shadowRoot)for(n=0;n<t.shadowRoot.childNodes.length;n++)gt(t.shadowRoot.childNodes[n],e)}else if(8===t.nodeType){const n=t.nodeValue.split(".");"o"===n[0]&&(e.set(n[1]+"."+n[2],t),t.nodeValue="",t["s-en"]=n[3])}},yt=(t,e,n)=>{if(e.$members$){t.watchers&&(e.$watchers$=t.watchers);const r=Object.entries(e.$members$),i=t.prototype;if(r.map(([t,[r]])=>{31&r||2&n&&32&r?Object.defineProperty(i,t,{get(){return e=t,Ot(this).$instanceValues$.get(e);var e},set(n){((t,e,n,r)=>{const i=Ot(this),o=i.$hostElement$,s=i.$instanceValues$.get(e),a=i.$flags$,u=i.$lazyInstance$;var c,l;if(l=r.$members$[e][0],n=null==(c=n)||A(c)?c:4&l?"false"!==c&&(""===c||!!c):2&l?parseFloat(c):1&l?String(c):c,!(8&a&&void 0!==s||n===s)&&(i.$instanceValues$.set(e,n),u)){if(r.$watchers$&&128&a){const t=r.$watchers$[e];t&&t.map(t=>{try{u[t](n,s,e)}catch(r){It(r,o)}})}2==(18&a)&&it(i,!1)}})(0,t,n,e)},configurable:!0,enumerable:!0}):1&n&&64&r&&Object.defineProperty(i,t,{value(...e){const n=Ot(this);return n.$onInstancePromise$.then(()=>n.$lazyInstance$[t](...e))}})}),1&n){const n=new Map;i.attributeChangedCallback=function(t,e,r){p.jmp(()=>{const e=n.get(t);this[e]=(null!==r||"boolean"!=typeof this[e])&&r})},t.observedAttributes=r.filter(([t,e])=>15&e[0]).map(([t,r])=>{const i=r[1]||t;return n.set(i,t),512&r[0]&&e.$attrsToReflect$.push([t,i]),i})}}return t},vt=t=>{ht(t,"connectedCallback")},mt=t=>{if(0==(1&p.$flags$)){const e=Ot(t),r=e.$cmpMeta$,i=()=>{};if(1&e.$flags$)m(t,e,r.$listeners$),vt(e.$lazyInstance$);else{let i;if(e.$flags$|=1,i=t.getAttribute("s-id"),i){if(g&&1&r.$flags$){const e=T(t.shadowRoot,r,t.getAttribute("s-mode"));t.classList.remove(e+"-h",e+"-s")}((t,e,n,r)=>{const i=t.shadowRoot,o=[],s=i?[]:null,a=r.$vnode$=N(e,null);p.$orgLocNodes$||gt(f.body,p.$orgLocNodes$=new Map),t["s-id"]=n,t.removeAttribute("s-id"),pt(a,o,[],s,t,t,n),o.map(t=>{const n=t.$hostId$+"."+t.$nodeId$,r=p.$orgLocNodes$.get(n),o=t.$elm$;r&&g&&""===r["s-en"]&&r.parentNode.insertBefore(o,r.nextSibling),i||(o["s-hn"]=e,r&&(o["s-ol"]=r,o["s-ol"]["s-nr"]=o)),p.$orgLocNodes$.delete(n)}),i&&s.map(t=>{t&&i.appendChild(t)})})(t,r.$tagName$,i,e)}i||12&r.$flags$&&bt(t);{let n=t;for(;n=n.parentNode||n.host;)if(1===n.nodeType&&n.hasAttribute("s-id")&&n["s-p"]||n["s-p"]){rt(e,e.$ancestorComponent$=n);break}}r.$members$&&Object.entries(r.$members$).map(([e,[n]])=>{if(31&n&&t.hasOwnProperty(e)){const n=t[e];delete t[e],t[e]=n}}),Mt(()=>(async(t,e,r,i,o)=>{if(0==(32&e.$flags$)){{if(e.$flags$|=32,(o=xt(r)).then){const t=()=>{};o=await o,t()}o.isProxied||(r.$watchers$=o.watchers,yt(o,r,2),o.isProxied=!0);const t=()=>{};e.$flags$|=8;try{new o(e)}catch(u){It(u)}e.$flags$&=-9,e.$flags$|=128,t(),vt(e.$lazyInstance$)}if(o.style){let i=o.style;"string"!=typeof i&&(i=i[e.$modeName$=(t=>kt.map(e=>e(t)).find(t=>!!t))(t)]);const s=S(r,e.$modeName$);if(!At.has(s)){const t=()=>{};8&r.$flags$&&(i=await n.e(60).then(n.bind(null,"6foE")).then(t=>t.scopeCss(i,s,!1))),C(s,i,!!(1&r.$flags$)),t()}}}const s=e.$ancestorComponent$,a=()=>it(e,!0);s&&s["s-rc"]?s["s-rc"].push(a):a()})(t,e,r))}i()}},bt=t=>{const e=t["s-cr"]=f.createComment("");e["s-cn"]=!0,t.insertBefore(e,t.firstChild)},_t=(t,e={})=>{const n=[],r=e.exclude||[],i=h.customElements,o=f.head,s=o.querySelector("meta[charset]"),a=f.createElement("style"),u=[],c=f.querySelectorAll("[sty-id]");let l,d=!0,y=0;for(Object.assign(p,e),p.$resourcesUrl$=new URL(e.resourcesUrl||"./",f.baseURI).href,p.$flags$|=2;y<c.length;y++)C(c[y].getAttribute("sty-id"),c[y].innerHTML.replace(/\/\*!@([^\/]+)\*\/[^\{]+\{/g,"$1{"),!0);t.map(t=>t[1].map(e=>{const o={$flags$:e[0],$tagName$:e[1],$members$:e[2],$listeners$:e[3]};o.$members$=e[2],o.$listeners$=e[3],o.$attrsToReflect$=[],o.$watchers$={},!g&&1&o.$flags$&&(o.$flags$|=8);const s=o.$tagName$,a=class extends HTMLElement{constructor(t){super(t),Tt(t=this,o),1&o.$flags$&&(g?t.attachShadow({mode:"open",delegatesFocus:!!(16&o.$flags$)}):"shadowRoot"in t||(t.shadowRoot=t))}connectedCallback(){l&&(clearTimeout(l),l=null),d?u.push(this):p.jmp(()=>mt(this))}disconnectedCallback(){p.jmp(()=>(t=>{if(0==(1&p.$flags$)){const e=Ot(t),n=e.$lazyInstance$;e.$rmListeners$&&(e.$rmListeners$.map(t=>t()),e.$rmListeners$=void 0),p.$cssShim$&&p.$cssShim$.removeHost(t),ht(n,"disconnectedCallback")}})(this))}componentOnReady(){return Ot(this).$onReadyPromise$}};o.$lazyBundleId$=t[0],r.includes(s)||i.get(s)||(n.push(s),i.define(s,yt(a,o,1)))})),a.innerHTML=n+"{visibility:hidden}.hydrated{visibility:inherit}",a.setAttribute("data-styles",""),o.insertBefore(a,s?s.nextSibling:o.firstChild),d=!1,u.length?u.map(t=>t.connectedCallback()):p.jmp(()=>l=setTimeout(lt,30))},wt=t=>{const e=new URL(t,p.$resourcesUrl$);return e.origin!==h.location.origin?e.href:e.pathname},Et=new WeakMap,Ot=t=>Et.get(t),Ct=(t,e)=>Et.set(e.$lazyInstance$=t,e),Tt=(t,e)=>{const n={$flags$:0,$hostElement$:t,$cmpMeta$:e,$instanceValues$:new Map};return n.$onInstancePromise$=new Promise(t=>n.$onInstanceResolve$=t),n.$onReadyPromise$=new Promise(t=>n.$onReadyResolve$=t),t["s-p"]=[],t["s-rc"]=[],m(t,n,e.$listeners$),Et.set(t,n)},St=(t,e)=>e in t,It=(t,e)=>(0,console.error)(t,e),jt=new Map,xt=(t,e,r)=>{const i=t.$tagName$.replace(/-/g,"_"),o=t.$lazyBundleId$,s=jt.get(o);return s?s[i]:n("kLfG")(`./${o}.entry.js`).then(t=>(jt.set(o,t),t[i]),It)},At=new Map,kt=[],Nt=[],Rt=[],Pt=(t,e)=>n=>{t.push(n),l||(l=!0,e&&4&p.$flags$?Mt(Lt):p.raf(Lt))},Dt=t=>{for(let n=0;n<t.length;n++)try{t[n](performance.now())}catch(e){It(e)}t.length=0},Lt=()=>{Dt(Nt),Dt(Rt),(l=Nt.length>0)&&p.raf(Lt)},Mt=t=>y().then(t),Ft=Pt(Nt,!1),Ut=Pt(Rt,!0),$t={isDev:!1,isBrowser:!0,isServer:!1,isTesting:!1}},Cfvw:function(t,e,n){"use strict";n.d(e,"a",(function(){return h}));var r=n("HDdC"),i=n("SeVD"),o=n("quSY"),s=n("kJWO"),a=n("jZKg"),u=n("Lhse"),c=n("c2HN"),l=n("I55L");function h(t,e){return e?function(t,e){if(null!=t){if(function(t){return t&&"function"==typeof t[s.a]}(t))return function(t,e){return new r.a(n=>{const r=new o.a;return r.add(e.schedule(()=>{const i=t[s.a]();r.add(i.subscribe({next(t){r.add(e.schedule(()=>n.next(t)))},error(t){r.add(e.schedule(()=>n.error(t)))},complete(){r.add(e.schedule(()=>n.complete()))}}))})),r})}(t,e);if(Object(c.a)(t))return function(t,e){return new r.a(n=>{const r=new o.a;return r.add(e.schedule(()=>t.then(t=>{r.add(e.schedule(()=>{n.next(t),r.add(e.schedule(()=>n.complete()))}))},t=>{r.add(e.schedule(()=>n.error(t)))}))),r})}(t,e);if(Object(l.a)(t))return Object(a.a)(t,e);if(function(t){return t&&"function"==typeof t[u.a]}(t)||"string"==typeof t)return function(t,e){if(!t)throw new Error("Iterable cannot be null");return new r.a(n=>{const r=new o.a;let i;return r.add(()=>{i&&"function"==typeof i.return&&i.return()}),r.add(e.schedule(()=>{i=t[u.a](),r.add(e.schedule((function(){if(n.closed)return;let t,e;try{const n=i.next();t=n.value,e=n.done}catch(r){return void n.error(r)}e?n.complete():(n.next(t),this.schedule())})))})),r})}(t,e)}throw new TypeError((null!==t&&typeof t||t)+" is not observable")}(t,e):t instanceof r.a?t:new r.a(Object(i.a)(t))}},D0XW:function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n("3N8a");const i=new(n("IjjT").a)(r.a)},DH7j:function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));const r=(()=>Array.isArray||(t=>t&&"number"==typeof t.length))()},EY2u:function(t,e,n){"use strict";n.d(e,"a",(function(){return i})),n.d(e,"b",(function(){return o}));var r=n("HDdC");const i=new r.a(t=>t.complete());function o(t){return t?function(t){return new r.a(e=>t.schedule(()=>e.complete()))}(t):i}},GyhO:function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n("LRne"),i=n("0EUg");function o(...t){return Object(i.a)()(Object(r.a)(...t))}},HDdC:function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var r=n("7o/Q"),i=n("2QA8"),o=n("gRHU"),s=n("kJWO"),a=n("SpAZ"),u=n("2fFW");let c=(()=>{class t{constructor(t){this._isScalar=!1,t&&(this._subscribe=t)}lift(e){const n=new t;return n.source=this,n.operator=e,n}subscribe(t,e,n){const{operator:s}=this,a=function(t,e,n){if(t){if(t instanceof r.a)return t;if(t[i.a])return t[i.a]()}return t||e||n?new r.a(t,e,n):new r.a(o.a)}(t,e,n);if(a.add(s?s.call(a,this.source):this.source||u.a.useDeprecatedSynchronousErrorHandling&&!a.syncErrorThrowable?this._subscribe(a):this._trySubscribe(a)),u.a.useDeprecatedSynchronousErrorHandling&&a.syncErrorThrowable&&(a.syncErrorThrowable=!1,a.syncErrorThrown))throw a.syncErrorValue;return a}_trySubscribe(t){try{return this._subscribe(t)}catch(e){u.a.useDeprecatedSynchronousErrorHandling&&(t.syncErrorThrown=!0,t.syncErrorValue=e),function(t){for(;t;){const{closed:e,destination:n,isStopped:i}=t;if(e||i)return!1;t=n&&n instanceof r.a?n:null}return!0}(t)?t.error(e):console.warn(e)}}forEach(t,e){return new(e=l(e))((e,n)=>{let r;r=this.subscribe(e=>{try{t(e)}catch(i){n(i),r&&r.unsubscribe()}},n,e)})}_subscribe(t){const{source:e}=this;return e&&e.subscribe(t)}[s.a](){return this}pipe(...t){return 0===t.length?this:(0===(e=t).length?a.a:1===e.length?e[0]:function(t){return e.reduce((t,e)=>e(t),t)})(this);var e}toPromise(t){return new(t=l(t))((t,e)=>{let n;this.subscribe(t=>n=t,t=>e(t),()=>t(n))})}}return t.create=e=>new t(e),t})();function l(t){if(t||(t=u.a.Promise||Promise),!t)throw new Error("no Promise impl found");return t}},"I/3d":function(t,e,n){"use strict";n.d(e,"a",(function(){return zf})),n.d(e,"b",(function(){return Wf}));var r=n("fXoL"),i=n("D0XW"),o=n("HDdC"),s=n("Cfvw"),a=n("LRne"),u=n("JX91"),c=n("7o/Q");function l(){return t=>t.lift(new h)}class h{call(t,e){return e.subscribe(new d(t))}}class d extends c.a{constructor(t){super(t),this.hasPrev=!1}_next(t){let e;this.hasPrev?e=[this.prev,t]:this.hasPrev=!0,this.prev=t,e&&this.destination.next(e)}}var f=n("lJxs"),p=n("Kqap"),g=n("/uUt"),y=n("pLZG"),v=n("pxpQ"),m=n("spgP"),b=n("ofXK"),_=n("Jgta"),w=n("O1h7"),E=n("zIRd"),O=n("q/0M"),C=n("qOnz"),T=function(t,e){return(T=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)};function S(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}var I,j="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},x=x||{},A=j||self;function k(){}function N(t){var e=typeof t;return"array"==(e="object"!=e?e:t?Array.isArray(t)?"array":e:"null")||"object"==e&&"number"==typeof t.length}function R(t){var e=typeof t;return"object"==e&&null!=t||"function"==e}var P="closure_uid_"+(1e9*Math.random()>>>0),D=0;function L(t,e,n){return t.call.apply(t.bind,arguments)}function M(t,e,n){if(!t)throw Error();if(2<arguments.length){var r=Array.prototype.slice.call(arguments,2);return function(){var n=Array.prototype.slice.call(arguments);return Array.prototype.unshift.apply(n,r),t.apply(e,n)}}return function(){return t.apply(e,arguments)}}function F(t,e,n){return(F=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?L:M).apply(null,arguments)}function U(t,e){var n=Array.prototype.slice.call(arguments,1);return function(){var e=n.slice();return e.push.apply(e,arguments),t.apply(this,e)}}function $(){return Date.now()}function V(t,e){function n(){}n.prototype=e.prototype,t.X=e.prototype,t.prototype=new n,t.prototype.constructor=t,t.Kb=function(t,n,r){for(var i=Array(arguments.length-2),o=2;o<arguments.length;o++)i[o-2]=arguments[o];return e.prototype[n].apply(t,i)}}function q(){this.j=this.j,this.i=this.i}q.prototype.j=!1,q.prototype.ja=function(){!this.j&&(this.j=!0,this.G(),0)&&function(t){Object.prototype.hasOwnProperty.call(t,P)&&t[P]||(t[P]=++D)}(this)},q.prototype.G=function(){if(this.i)for(;this.i.length;)this.i.shift()()};var H=Array.prototype.indexOf?function(t,e){return Array.prototype.indexOf.call(t,e,void 0)}:function(t,e){if("string"==typeof t)return"string"!=typeof e||1!=e.length?-1:t.indexOf(e,0);for(var n=0;n<t.length;n++)if(n in t&&t[n]===e)return n;return-1},B=Array.prototype.forEach?function(t,e,n){Array.prototype.forEach.call(t,e,n)}:function(t,e,n){for(var r=t.length,i="string"==typeof t?t.split(""):t,o=0;o<r;o++)o in i&&e.call(n,i[o],o,t)};function z(t){return Array.prototype.concat.apply([],arguments)}function W(t){var e=t.length;if(0<e){for(var n=Array(e),r=0;r<e;r++)n[r]=t[r];return n}return[]}function G(t){return/^[\s\xa0]*$/.test(t)}var Q,K=String.prototype.trim?function(t){return t.trim()}:function(t){return/^[\s\xa0]*([\s\S]*?)[\s\xa0]*$/.exec(t)[1]};function X(t,e){return-1!=t.indexOf(e)}function Y(t,e){return t<e?-1:t>e?1:0}t:{var J=A.navigator;if(J){var Z=J.userAgent;if(Z){Q=Z;break t}}Q=""}function tt(t,e,n){for(var r in t)e.call(n,t[r],r,t)}function et(t){var e={};for(var n in t)e[n]=t[n];return e}var nt="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");function rt(t,e){for(var n,r,i=1;i<arguments.length;i++){for(n in r=arguments[i])t[n]=r[n];for(var o=0;o<nt.length;o++)n=nt[o],Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}}function it(t){return it[" "](t),t}it[" "]=k;var ot,st,at=X(Q,"Opera"),ut=X(Q,"Trident")||X(Q,"MSIE"),ct=X(Q,"Edge"),lt=ct||ut,ht=X(Q,"Gecko")&&!(X(Q.toLowerCase(),"webkit")&&!X(Q,"Edge"))&&!(X(Q,"Trident")||X(Q,"MSIE"))&&!X(Q,"Edge"),dt=X(Q.toLowerCase(),"webkit")&&!X(Q,"Edge");function ft(){var t=A.document;return t?t.documentMode:void 0}t:{var pt="",gt=(st=Q,ht?/rv:([^\);]+)(\)|;)/.exec(st):ct?/Edge\/([\d\.]+)/.exec(st):ut?/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(st):dt?/WebKit\/(\S+)/.exec(st):at?/(?:Version)[ \/]?(\S+)/.exec(st):void 0);if(gt&&(pt=gt?gt[1]:""),ut){var yt=ft();if(null!=yt&&yt>parseFloat(pt)){ot=String(yt);break t}}ot=pt}var vt={};function mt(t){return function(t,e){var n=vt;return Object.prototype.hasOwnProperty.call(n,t)?n[t]:n[t]=e()}(t,(function(){for(var e=0,n=K(String(ot)).split("."),r=K(String(t)).split("."),i=Math.max(n.length,r.length),o=0;0==e&&o<i;o++){var s=n[o]||"",a=r[o]||"";do{if(s=/(\d*)(\D*)(.*)/.exec(s)||["","","",""],a=/(\d*)(\D*)(.*)/.exec(a)||["","","",""],0==s[0].length&&0==a[0].length)break;e=Y(0==s[1].length?0:parseInt(s[1],10),0==a[1].length?0:parseInt(a[1],10))||Y(0==s[2].length,0==a[2].length)||Y(s[2],a[2]),s=s[3],a=a[3]}while(0==e)}return 0<=e}))}var bt=A.document&&ut&&(ft()||parseInt(ot,10))||void 0,_t=!ut||9<=Number(bt),wt=ut&&!mt("9"),Et=function(){if(!A.addEventListener||!Object.defineProperty)return!1;var t=!1,e=Object.defineProperty({},"passive",{get:function(){t=!0}});try{A.addEventListener("test",k,e),A.removeEventListener("test",k,e)}catch(n){}return t}();function Ot(t,e){this.type=t,this.a=this.target=e,this.defaultPrevented=!1}function Ct(t,e){if(Ot.call(this,t?t.type:""),this.relatedTarget=this.a=this.target=null,this.button=this.screenY=this.screenX=this.clientY=this.clientX=0,this.key="",this.metaKey=this.shiftKey=this.altKey=this.ctrlKey=!1,this.pointerId=0,this.pointerType="",this.c=null,t){var n=this.type=t.type,r=t.changedTouches&&t.changedTouches.length?t.changedTouches[0]:null;if(this.target=t.target||t.srcElement,this.a=e,e=t.relatedTarget){if(ht){t:{try{it(e.nodeName);var i=!0;break t}catch(o){}i=!1}i||(e=null)}}else"mouseover"==n?e=t.fromElement:"mouseout"==n&&(e=t.toElement);this.relatedTarget=e,r?(this.clientX=void 0!==r.clientX?r.clientX:r.pageX,this.clientY=void 0!==r.clientY?r.clientY:r.pageY,this.screenX=r.screenX||0,this.screenY=r.screenY||0):(this.clientX=void 0!==t.clientX?t.clientX:t.pageX,this.clientY=void 0!==t.clientY?t.clientY:t.pageY,this.screenX=t.screenX||0,this.screenY=t.screenY||0),this.button=t.button,this.key=t.key||"",this.ctrlKey=t.ctrlKey,this.altKey=t.altKey,this.shiftKey=t.shiftKey,this.metaKey=t.metaKey,this.pointerId=t.pointerId||0,this.pointerType="string"==typeof t.pointerType?t.pointerType:Tt[t.pointerType]||"",this.c=t,t.defaultPrevented&&this.b()}}Ot.prototype.b=function(){this.defaultPrevented=!0},V(Ct,Ot);var Tt={2:"touch",3:"pen",4:"mouse"};Ct.prototype.b=function(){Ct.X.b.call(this);var t=this.c;if(t.preventDefault)t.preventDefault();else if(t.returnValue=!1,wt)try{(t.ctrlKey||112<=t.keyCode&&123>=t.keyCode)&&(t.keyCode=-1)}catch(e){}};var St="closure_listenable_"+(1e6*Math.random()|0),It=0;function jt(t,e,n,r,i){this.listener=t,this.proxy=null,this.src=e,this.type=n,this.capture=!!r,this.ca=i,this.key=++It,this.Y=this.Z=!1}function xt(t){t.Y=!0,t.listener=null,t.proxy=null,t.src=null,t.ca=null}function At(t){this.src=t,this.a={},this.b=0}function kt(t,e){var n=e.type;if(n in t.a){var r,i=t.a[n],o=H(i,e);(r=0<=o)&&Array.prototype.splice.call(i,o,1),r&&(xt(e),0==t.a[n].length&&(delete t.a[n],t.b--))}}function Nt(t,e,n,r){for(var i=0;i<t.length;++i){var o=t[i];if(!o.Y&&o.listener==e&&o.capture==!!n&&o.ca==r)return i}return-1}At.prototype.add=function(t,e,n,r,i){var o=t.toString();(t=this.a[o])||(t=this.a[o]=[],this.b++);var s=Nt(t,e,r,i);return-1<s?(e=t[s],n||(e.Z=!1)):((e=new jt(e,this.src,o,!!r,i)).Z=n,t.push(e)),e};var Rt="closure_lm_"+(1e6*Math.random()|0),Pt={};function Dt(t,e,n,r,i){if(r&&r.once)return function t(e,n,r,i,o){if(Array.isArray(n)){for(var s=0;s<n.length;s++)t(e,n[s],r,i,o);return null}return r=Ht(r),e&&e[St]?e.wa(n,r,R(i)?!!i.capture:!!i,o):Lt(e,n,r,!0,i,o)}(t,e,n,r,i);if(Array.isArray(e)){for(var o=0;o<e.length;o++)Dt(t,e[o],n,r,i);return null}return n=Ht(n),t&&t[St]?t.va(e,n,R(r)?!!r.capture:!!r,i):Lt(t,e,n,!1,r,i)}function Lt(t,e,n,r,i,o){if(!e)throw Error("Invalid event type");var s=R(i)?!!i.capture:!!i;if(s&&!_t)return null;var a=Vt(t);if(a||(t[Rt]=a=new At(t)),(n=a.add(e,n,r,s,o)).proxy)return n;if(r=function(){var t=$t,e=_t?function(n){return t.call(e.src,e.listener,n)}:function(n){if(!(n=t.call(e.src,e.listener,n)))return n};return e}(),n.proxy=r,r.src=t,r.listener=n,t.addEventListener)Et||(i=s),void 0===i&&(i=!1),t.addEventListener(e.toString(),r,i);else if(t.attachEvent)t.attachEvent(Ft(e.toString()),r);else{if(!t.addListener||!t.removeListener)throw Error("addEventListener and attachEvent are unavailable.");t.addListener(r)}return n}function Mt(t){if("number"!=typeof t&&t&&!t.Y){var e=t.src;if(e&&e[St])kt(e.c,t);else{var n=t.type,r=t.proxy;e.removeEventListener?e.removeEventListener(n,r,t.capture):e.detachEvent?e.detachEvent(Ft(n),r):e.addListener&&e.removeListener&&e.removeListener(r),(n=Vt(e))?(kt(n,t),0==n.b&&(n.src=null,e[Rt]=null)):xt(t)}}}function Ft(t){return t in Pt?Pt[t]:Pt[t]="on"+t}function Ut(t,e){var n=t.listener,r=t.ca||t.src;return t.Z&&Mt(t),n.call(r,e)}function $t(t,e){if(t.Y)return!0;if(!_t){if(!e)t:{e=["window","event"];for(var n=A,r=0;r<e.length;r++)if(null==(n=n[e[r]])){e=null;break t}e=n}return Ut(t,e=new Ct(e,this))}return Ut(t,new Ct(e,this))}function Vt(t){return(t=t[Rt])instanceof At?t:null}var qt="__closure_events_fn_"+(1e9*Math.random()>>>0);function Ht(t){return"function"==typeof t?t:(t[qt]||(t[qt]=function(e){return t.handleEvent(e)}),t[qt])}function Bt(){q.call(this),this.c=new At(this),this.J=this,this.C=null}function zt(t,e){var n,r=t.C;if(r)for(n=[];r;r=r.C)n.push(r);if(t=t.J,r=e.type||e,"string"==typeof e)e=new Ot(e,t);else if(e instanceof Ot)e.target=e.target||t;else{var i=e;rt(e=new Ot(r,t),i)}if(i=!0,n)for(var o=n.length-1;0<=o;o--){var s=e.a=n[o];i=Wt(s,r,!0,e)&&i}if(i=Wt(s=e.a=t,r,!0,e)&&i,i=Wt(s,r,!1,e)&&i,n)for(o=0;o<n.length;o++)i=Wt(s=e.a=n[o],r,!1,e)&&i}function Wt(t,e,n,r){if(!(e=t.c.a[String(e)]))return!0;e=e.concat();for(var i=!0,o=0;o<e.length;++o){var s=e[o];if(s&&!s.Y&&s.capture==n){var a=s.listener,u=s.ca||s.src;s.Z&&kt(t.c,s),i=!1!==a.call(u,r)&&i}}return i&&!r.defaultPrevented}V(Bt,q),Bt.prototype[St]=!0,(I=Bt.prototype).addEventListener=function(t,e,n,r){Dt(this,t,e,n,r)},I.removeEventListener=function(t,e,n,r){!function t(e,n,r,i,o){if(Array.isArray(n))for(var s=0;s<n.length;s++)t(e,n[s],r,i,o);else i=R(i)?!!i.capture:!!i,r=Ht(r),e&&e[St]?(e=e.c,(n=String(n).toString())in e.a&&-1<(r=Nt(s=e.a[n],r,i,o))&&(xt(s[r]),Array.prototype.splice.call(s,r,1),0==s.length&&(delete e.a[n],e.b--))):e&&(e=Vt(e))&&(n=e.a[n.toString()],e=-1,n&&(e=Nt(n,r,i,o)),(r=-1<e?n[e]:null)&&Mt(r))}(this,t,e,n,r)},I.G=function(){if(Bt.X.G.call(this),this.c){var t,e=this.c;for(t in e.a){for(var n=e.a[t],r=0;r<n.length;r++)xt(n[r]);delete e.a[t],e.b--}}this.C=null},I.va=function(t,e,n,r){return this.c.add(String(t),e,!1,n,r)},I.wa=function(t,e,n,r){return this.c.add(String(t),e,!0,n,r)};var Gt=A.JSON.stringify;function Qt(){this.b=this.a=null}var Kt,Xt=new(function(){function t(t,e){this.c=t,this.f=e,this.b=0,this.a=null}return t.prototype.get=function(){var t;return 0<this.b?(this.b--,this.a=(t=this.a).next,t.next=null):t=this.c(),t},t}())((function(){return new Jt}),(function(t){t.reset()}));function Yt(){var t=ne,e=null;return t.a&&(e=t.a,t.a=t.a.next,t.a||(t.b=null),e.next=null),e}function Jt(){this.next=this.b=this.a=null}function Zt(t){A.setTimeout((function(){throw t}),0)}function te(t,e){Kt||function(){var t=A.Promise.resolve(void 0);Kt=function(){t.then(re)}}(),ee||(Kt(),ee=!0),ne.add(t,e)}Qt.prototype.add=function(t,e){var n=Xt.get();n.set(t,e),this.b?this.b.next=n:this.a=n,this.b=n},Jt.prototype.set=function(t,e){this.a=t,this.b=e,this.next=null},Jt.prototype.reset=function(){this.next=this.b=this.a=null};var ee=!1,ne=new Qt;function re(){for(var t;t=Yt();){try{t.a.call(t.b)}catch(n){Zt(n)}var e=Xt;e.f(t),100>e.b&&(e.b++,t.next=e.a,e.a=t)}ee=!1}function ie(t,e){Bt.call(this),this.b=t||1,this.a=e||A,this.f=F(this.Za,this),this.g=$()}function oe(t){t.aa=!1,t.M&&(t.a.clearTimeout(t.M),t.M=null)}function se(t,e,n){if("function"==typeof t)n&&(t=F(t,n));else{if(!t||"function"!=typeof t.handleEvent)throw Error("Invalid listener argument");t=F(t.handleEvent,t)}return 2147483647<Number(e)?-1:A.setTimeout(t,e||0)}function ae(t){t.a=se((function(){t.a=null,t.c&&(t.c=!1,ae(t))}),t.h);var e=t.b;t.b=null,t.g.apply(null,e)}V(ie,Bt),(I=ie.prototype).aa=!1,I.M=null,I.Za=function(){if(this.aa){var t=$()-this.g;0<t&&t<.8*this.b?this.M=this.a.setTimeout(this.f,this.b-t):(this.M&&(this.a.clearTimeout(this.M),this.M=null),zt(this,"tick"),this.aa&&(oe(this),this.start()))}},I.start=function(){this.aa=!0,this.M||(this.M=this.a.setTimeout(this.f,this.b),this.g=$())},I.G=function(){ie.X.G.call(this),oe(this),delete this.a};var ue=function(t){function e(e,n){var r=t.call(this)||this;return r.g=e,r.h=n,r.b=null,r.c=!1,r.a=null,r}return function(t,e){function n(){this.constructor=t}T(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}(e,t),e.prototype.f=function(t){this.b=arguments,this.a?this.c=!0:ae(this)},e.prototype.G=function(){t.prototype.G.call(this),this.a&&(A.clearTimeout(this.a),this.a=null,this.c=!1,this.b=null)},e}(q);function ce(t){q.call(this),this.b=t,this.a={}}V(ce,q);var le=[];function he(t,e,n,r){Array.isArray(n)||(n&&(le[0]=n.toString()),n=le);for(var i=0;i<n.length;i++){var o=Dt(e,n[i],r||t.handleEvent,!1,t.b||t);if(!o)break;t.a[o.key]=o}}function de(t){tt(t.a,(function(t,e){this.a.hasOwnProperty(e)&&Mt(t)}),t),t.a={}}function fe(){this.a=!0}function pe(t,e,n,r){t.info((function(){return"XMLHTTP TEXT ("+e+"): "+function(t,e){if(!t.a)return e;if(!e)return null;try{var n=JSON.parse(e);if(n)for(t=0;t<n.length;t++)if(Array.isArray(n[t])){var r=n[t];if(!(2>r.length)){var i=r[1];if(Array.isArray(i)&&!(1>i.length)){var o=i[0];if("noop"!=o&&"stop"!=o&&"close"!=o)for(var s=1;s<i.length;s++)i[s]=""}}}return Gt(n)}catch(a){return e}}(t,n)+(r?" "+r:"")}))}ce.prototype.G=function(){ce.X.G.call(this),de(this)},ce.prototype.handleEvent=function(){throw Error("EventHandler.handleEvent not implemented")},fe.prototype.info=function(){};var ge={},ye=null;function ve(){return ye=ye||new Bt}function me(t){Ot.call(this,ge.Fa,t)}function be(t){var e=ve();zt(e,new me(e,t))}function _e(t,e){Ot.call(this,ge.STAT_EVENT,t),this.stat=e}function we(t){var e=ve();zt(e,new _e(e,t))}function Ee(t){Ot.call(this,ge.Ga,t)}function Oe(t,e){if("function"!=typeof t)throw Error("Fn must not be null and must be a function");return A.setTimeout((function(){t()}),e)}ge.Fa="serverreachability",V(me,Ot),ge.STAT_EVENT="statevent",V(_e,Ot),ge.Ga="timingevent",V(Ee,Ot);var Ce={NO_ERROR:0,$a:1,nb:2,mb:3,hb:4,lb:5,ob:6,Da:7,TIMEOUT:8,rb:9},Te={fb:"complete",Bb:"success",Ea:"error",Da:"abort",tb:"ready",ub:"readystatechange",TIMEOUT:"timeout",pb:"incrementaldata",sb:"progress",ib:"downloadprogress",Jb:"uploadprogress"};function Se(){}function Ie(){}Se.prototype.a=null;var je,xe={OPEN:"a",eb:"b",Ea:"c",qb:"d"};function Ae(){Ot.call(this,"d")}function ke(){Ot.call(this,"c")}function Ne(){}function Re(t,e,n,r){this.g=t,this.c=e,this.f=n,this.S=r||1,this.J=new ce(this),this.P=Pe,this.R=new ie(t=lt?125:void 0),this.B=null,this.b=!1,this.j=this.l=this.i=this.H=this.u=this.T=this.o=null,this.s=[],this.a=null,this.D=0,this.h=this.m=null,this.N=-1,this.A=!1,this.O=0,this.F=null,this.V=this.C=this.U=this.I=!1}V(Ae,Ot),V(ke,Ot),V(Ne,Se),je=new Ne;var Pe=45e3,De={},Le={};function Me(t,e,n){t.H=1,t.i=sn(Ze(e)),t.j=n,t.I=!0,Fe(t,null)}function Fe(t,e){t.u=$(),Ve(t),t.l=Ze(t.i);var n=t.l,r=t.S;Array.isArray(r)||(r=[String(r)]),bn(n.b,"t",r),t.D=0,t.a=fr(t.g,t.g.C?e:null),0<t.O&&(t.F=new ue(F(t.Ca,t,t.a),t.O)),he(t.J,t.a,"readystatechange",t.Xa),e=t.B?et(t.B):{},t.j?(t.m||(t.m="POST"),e["Content-Type"]="application/x-www-form-urlencoded",t.a.ba(t.l,t.m,t.j,e)):(t.m="GET",t.a.ba(t.l,t.m,null,e)),be(1),function(t,e,n,r,i,o){t.info((function(){if(t.a)if(o)for(var s="",a=o.split("&"),u=0;u<a.length;u++){var c=a[u].split("=");if(1<c.length){var l=c[0];c=c[1];var h=l.split("_");s=2<=h.length&&"type"==h[1]?s+(l+"=")+c+"&":s+(l+"=redacted&")}}else s=null;else s=o;return"XMLHTTP REQ ("+r+") [attempt "+i+"]: "+e+"\n"+n+"\n"+s}))}(t.c,t.m,t.l,t.f,t.S,t.j)}function Ue(t,e,n){for(var r=!0;!t.A&&t.D<n.length;){var i=$e(t,n);if(i==Le){4==e&&(t.h=4,we(14),r=!1),pe(t.c,t.f,null,"[Incomplete Response]");break}if(i==De){t.h=4,we(15),pe(t.c,t.f,n,"[Invalid Chunk]"),r=!1;break}pe(t.c,t.f,i,null),We(t,i)}4==e&&0==n.length&&(t.h=1,we(16),r=!1),t.b=t.b&&r,r?0<n.length&&!t.V&&(t.V=!0,(e=t.g).a==t&&e.U&&!e.F&&(e.c.info("Great, no buffering proxy detected. Bytes received: "+n.length),or(e),e.F=!0,we(11))):(pe(t.c,t.f,n,"[Invalid Chunked Response]"),ze(t),Be(t))}function $e(t,e){var n=t.D,r=e.indexOf("\n",n);return-1==r?Le:(n=Number(e.substring(n,r)),isNaN(n)?De:(r+=1)+n>e.length?Le:(e=e.substr(r,n),t.D=r+n,e))}function Ve(t){t.T=$()+t.P,qe(t,t.P)}function qe(t,e){if(null!=t.o)throw Error("WatchDog timer not null");t.o=Oe(F(t.Va,t),e)}function He(t){t.o&&(A.clearTimeout(t.o),t.o=null)}function Be(t){0==t.g.v||t.A||ur(t.g,t)}function ze(t){He(t);var e=t.F;e&&"function"==typeof e.ja&&e.ja(),t.F=null,oe(t.R),de(t.J),t.a&&(e=t.a,t.a=null,e.abort(),e.ja())}function We(t,e){try{var n=t.g;if(0!=n.v&&(n.a==t||Sn(n.b,t)))if(n.I=t.N,!t.C&&Sn(n.b,t)&&3==n.v){try{var r=n.ka.a.parse(e)}catch(Zd){r=null}if(Array.isArray(r)&&3==r.length){var i=r;if(0==i[0]){t:if(!n.j){if(n.a){if(!(n.a.u+3e3<t.u))break t;ar(n),Xn(n)}ir(n),we(18)}}else n.oa=i[1],0<n.oa-n.P&&37500>i[2]&&n.H&&0==n.o&&!n.m&&(n.m=Oe(F(n.Sa,n),6e3));if(1>=Tn(n.b)&&n.ea){try{n.ea()}catch(Zd){}n.ea=void 0}}else lr(n,11)}else if((t.C||n.a==t)&&ar(n),!G(e))for(e=r=n.ka.a.parse(e),r=0;r<e.length;r++)if(n.P=(i=e[r])[0],i=i[1],2==n.v)if("c"==i[0]){n.J=i[1],n.ga=i[2];var o=i[3];null!=o&&(n.ha=o,n.c.info("VER="+n.ha));var s=i[4];null!=s&&(n.pa=s,n.c.info("SVER="+n.pa));var a=i[5];if(null!=a&&"number"==typeof a&&0<a){var u=1.5*a;n.D=u,n.c.info("backChannelRequestTimeoutMs_="+u)}u=n;var c=t.a;if(c){var l=c.a?c.a.getResponseHeader("X-Client-Wire-Protocol"):null;if(l){var h=u.b;!h.a&&(X(l,"spdy")||X(l,"quic")||X(l,"h2"))&&(h.f=h.g,h.a=new Set,h.b&&(In(h,h.b),h.b=null))}if(u.A){var d=c.a?c.a.getResponseHeader("X-HTTP-Session-Id"):null;d&&(u.na=d,on(u.B,u.A,d))}}n.v=3,n.f&&n.f.ta(),n.U&&(n.N=$()-t.u,n.c.info("Handshake RTT: "+n.N+"ms"));var f=t;if((u=n).la=dr(u,u.C?u.ga:null,u.fa),f.C){jn(u.b,f);var p=f,g=u.D;g&&p.setTimeout(g),p.o&&(He(p),Ve(p)),u.a=f}else rr(u);0<n.g.length&&Zn(n)}else"stop"!=i[0]&&"close"!=i[0]||lr(n,7);else 3==n.v&&("stop"==i[0]||"close"==i[0]?"stop"==i[0]?lr(n,7):Kn(n):"noop"!=i[0]&&n.f&&n.f.sa(i),n.o=0);be(4)}catch(Zd){}}function Ge(t,e){if(t.forEach&&"function"==typeof t.forEach)t.forEach(e,void 0);else if(N(t)||"string"==typeof t)B(t,e,void 0);else{if(t.L&&"function"==typeof t.L)var n=t.L();else if(t.K&&"function"==typeof t.K)n=void 0;else if(N(t)||"string"==typeof t){n=[];for(var r=t.length,i=0;i<r;i++)n.push(i)}else for(i in n=[],r=0,t)n[r++]=i;i=(r=function(t){if(t.K&&"function"==typeof t.K)return t.K();if("string"==typeof t)return t.split("");if(N(t)){for(var e=[],n=t.length,r=0;r<n;r++)e.push(t[r]);return e}for(r in e=[],n=0,t)e[n++]=t[r];return e}(t)).length;for(var o=0;o<i;o++)e.call(void 0,r[o],n&&n[o],t)}}function Qe(t,e){this.b={},this.a=[],this.c=0;var n=arguments.length;if(1<n){if(n%2)throw Error("Uneven number of arguments");for(var r=0;r<n;r+=2)this.set(arguments[r],arguments[r+1])}else if(t)if(t instanceof Qe)for(n=t.L(),r=0;r<n.length;r++)this.set(n[r],t.get(n[r]));else for(r in t)this.set(r,t[r])}function Ke(t){if(t.c!=t.a.length){for(var e=0,n=0;e<t.a.length;){var r=t.a[e];Xe(t.b,r)&&(t.a[n++]=r),e++}t.a.length=n}if(t.c!=t.a.length){var i={};for(n=e=0;e<t.a.length;)Xe(i,r=t.a[e])||(t.a[n++]=r,i[r]=1),e++;t.a.length=n}}function Xe(t,e){return Object.prototype.hasOwnProperty.call(t,e)}(I=Re.prototype).setTimeout=function(t){this.P=t},I.Xa=function(t){t=t.target;var e=this.F;e&&3==zn(t)?e.f():this.Ca(t)},I.Ca=function(t){try{if(t==this.a)t:{var e=zn(this.a),n=this.a.ua(),r=this.a.W();if(!(3>e||3==e&&!lt&&!this.a.$())){this.A||4!=e||7==n||be(8==n||0>=r?3:2),He(this);var i=this.a.W();this.N=i;var o=this.a.$();if(this.b=200==i,function(t,e,n,r,i,o,s){t.info((function(){return"XMLHTTP RESP ("+r+") [ attempt "+i+"]: "+e+"\n"+n+"\n"+o+" "+s}))}(this.c,this.m,this.l,this.f,this.S,e,i),this.b){if(this.U&&!this.C){e:{if(this.a){var s,a=this.a;if((s=a.a?a.a.getResponseHeader("X-HTTP-Initial-Response"):null)&&!G(s)){var u=s;break e}}u=null}if(!u){this.b=!1,this.h=3,we(12),ze(this),Be(this);break t}pe(this.c,this.f,u,"Initial handshake response via X-HTTP-Initial-Response"),this.C=!0,We(this,u)}this.I?(Ue(this,e,o),lt&&this.b&&3==e&&(he(this.J,this.R,"tick",this.Wa),this.R.start())):(pe(this.c,this.f,o,null),We(this,o)),4==e&&ze(this),this.b&&!this.A&&(4==e?ur(this.g,this):(this.b=!1,Ve(this)))}else 400==i&&0<o.indexOf("Unknown SID")?(this.h=3,we(12)):(this.h=0,we(13)),ze(this),Be(this)}}}catch(c){}},I.Wa=function(){if(this.a){var t=zn(this.a),e=this.a.$();this.D<e.length&&(He(this),Ue(this,t,e),this.b&&4!=t&&Ve(this))}},I.cancel=function(){this.A=!0,ze(this)},I.Va=function(){this.o=null;var t=$();0<=t-this.T?(function(t,e){t.info((function(){return"TIMEOUT: "+e}))}(this.c,this.l),2!=this.H&&(be(3),we(17)),ze(this),this.h=2,Be(this)):qe(this,this.T-t)},(I=Qe.prototype).K=function(){Ke(this);for(var t=[],e=0;e<this.a.length;e++)t.push(this.b[this.a[e]]);return t},I.L=function(){return Ke(this),this.a.concat()},I.get=function(t,e){return Xe(this.b,t)?this.b[t]:e},I.set=function(t,e){Xe(this.b,t)||(this.c++,this.a.push(t)),this.b[t]=e},I.forEach=function(t,e){for(var n=this.L(),r=0;r<n.length;r++){var i=n[r],o=this.get(i);t.call(e,o,i,this)}};var Ye=/^(?:([^:/?#.]+):)?(?:\/\/(?:([^\\/?#]*)@)?([^\\/?#]*?)(?::([0-9]+))?(?=[\\/?#]|$))?([^?#]+)?(?:\?([^#]*))?(?:#([\s\S]*))?$/;function Je(t,e){if(this.c=this.j=this.f="",this.h=null,this.i=this.g="",this.a=!1,t instanceof Je){this.a=void 0!==e?e:t.a,tn(this,t.f),this.j=t.j,en(this,t.c),nn(this,t.h),this.g=t.g,e=t.b;var n=new gn;n.c=e.c,e.a&&(n.a=new Qe(e.a),n.b=e.b),rn(this,n),this.i=t.i}else t&&(n=String(t).match(Ye))?(this.a=!!e,tn(this,n[1]||"",!0),this.j=an(n[2]||""),en(this,n[3]||"",!0),nn(this,n[4]),this.g=an(n[5]||"",!0),rn(this,n[6]||"",!0),this.i=an(n[7]||"")):(this.a=!!e,this.b=new gn(null,this.a))}function Ze(t){return new Je(t)}function tn(t,e,n){t.f=n?an(e,!0):e,t.f&&(t.f=t.f.replace(/:$/,""))}function en(t,e,n){t.c=n?an(e,!0):e}function nn(t,e){if(e){if(e=Number(e),isNaN(e)||0>e)throw Error("Bad port number "+e);t.h=e}else t.h=null}function rn(t,e,n){e instanceof gn?(t.b=e,function(t,e){e&&!t.f&&(yn(t),t.c=null,t.a.forEach((function(t,e){var n=e.toLowerCase();e!=n&&(vn(this,e),bn(this,n,t))}),t)),t.f=e}(t.b,t.a)):(n||(e=un(e,fn)),t.b=new gn(e,t.a))}function on(t,e,n){t.b.set(e,n)}function sn(t){return on(t,"zx",Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^$()).toString(36)),t}function an(t,e){return t?e?decodeURI(t.replace(/%25/g,"%2525")):decodeURIComponent(t):""}function un(t,e,n){return"string"==typeof t?(t=encodeURI(t).replace(e,cn),n&&(t=t.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),t):null}function cn(t){return"%"+((t=t.charCodeAt(0))>>4&15).toString(16)+(15&t).toString(16)}Je.prototype.toString=function(){var t=[],e=this.f;e&&t.push(un(e,ln,!0),":");var n=this.c;return(n||"file"==e)&&(t.push("//"),(e=this.j)&&t.push(un(e,ln,!0),"@"),t.push(encodeURIComponent(String(n)).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),null!=(n=this.h)&&t.push(":",String(n))),(n=this.g)&&(this.c&&"/"!=n.charAt(0)&&t.push("/"),t.push(un(n,"/"==n.charAt(0)?dn:hn,!0))),(n=this.b.toString())&&t.push("?",n),(n=this.i)&&t.push("#",un(n,pn)),t.join("")};var ln=/[#\/\?@]/g,hn=/[#\?:]/g,dn=/[#\?]/g,fn=/[#\?@]/g,pn=/#/g;function gn(t,e){this.b=this.a=null,this.c=t||null,this.f=!!e}function yn(t){t.a||(t.a=new Qe,t.b=0,t.c&&function(t,e){if(t){t=t.split("&");for(var n=0;n<t.length;n++){var r=t[n].indexOf("="),i=null;if(0<=r){var o=t[n].substring(0,r);i=t[n].substring(r+1)}else o=t[n];e(o,i?decodeURIComponent(i.replace(/\+/g," ")):"")}}}(t.c,(function(e,n){t.add(decodeURIComponent(e.replace(/\+/g," ")),n)})))}function vn(t,e){yn(t),e=_n(t,e),Xe(t.a.b,e)&&(t.c=null,t.b-=t.a.get(e).length,Xe((t=t.a).b,e)&&(delete t.b[e],t.c--,t.a.length>2*t.c&&Ke(t)))}function mn(t,e){return yn(t),e=_n(t,e),Xe(t.a.b,e)}function bn(t,e,n){vn(t,e),0<n.length&&(t.c=null,t.a.set(_n(t,e),W(n)),t.b+=n.length)}function _n(t,e){return e=String(e),t.f&&(e=e.toLowerCase()),e}(I=gn.prototype).add=function(t,e){yn(this),this.c=null,t=_n(this,t);var n=this.a.get(t);return n||this.a.set(t,n=[]),n.push(e),this.b+=1,this},I.forEach=function(t,e){yn(this),this.a.forEach((function(n,r){B(n,(function(n){t.call(e,n,r,this)}),this)}),this)},I.L=function(){yn(this);for(var t=this.a.K(),e=this.a.L(),n=[],r=0;r<e.length;r++)for(var i=t[r],o=0;o<i.length;o++)n.push(e[r]);return n},I.K=function(t){yn(this);var e=[];if("string"==typeof t)mn(this,t)&&(e=z(e,this.a.get(_n(this,t))));else{t=this.a.K();for(var n=0;n<t.length;n++)e=z(e,t[n])}return e},I.set=function(t,e){return yn(this),this.c=null,mn(this,t=_n(this,t))&&(this.b-=this.a.get(t).length),this.a.set(t,[e]),this.b+=1,this},I.get=function(t,e){return t&&0<(t=this.K(t)).length?String(t[0]):e},I.toString=function(){if(this.c)return this.c;if(!this.a)return"";for(var t=[],e=this.a.L(),n=0;n<e.length;n++){var r=e[n],i=encodeURIComponent(String(r));r=this.K(r);for(var o=0;o<r.length;o++){var s=i;""!==r[o]&&(s+="="+encodeURIComponent(String(r[o]))),t.push(s)}}return this.c=t.join("&")};var wn=function(){return function(t,e){this.b=t,this.a=e}}();function En(t){this.g=t||On,t=A.PerformanceNavigationTiming?0<(t=A.performance.getEntriesByType("navigation")).length&&("hq"==t[0].nextHopProtocol||"h2"==t[0].nextHopProtocol):!!(A.ia&&A.ia.ya&&A.ia.ya()&&A.ia.ya().Lb),this.f=t?this.g:1,this.a=null,1<this.f&&(this.a=new Set),this.b=null,this.c=[]}var On=10;function Cn(t){return!!t.b||!!t.a&&t.a.size>=t.f}function Tn(t){return t.b?1:t.a?t.a.size:0}function Sn(t,e){return t.b?t.b==e:!!t.a&&t.a.has(e)}function In(t,e){t.a?t.a.add(e):t.b=e}function jn(t,e){t.b&&t.b==e?t.b=null:t.a&&t.a.has(e)&&t.a.delete(e)}function xn(t){var e,n;if(null!=t.b)return t.c.concat(t.b.s);if(null!=t.a&&0!==t.a.size){var r=t.c;try{for(var i=S(t.a.values()),o=i.next();!o.done;o=i.next())r=r.concat(o.value.s)}catch(s){e={error:s}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}return r}return W(t.c)}function An(){}function kn(){this.a=new An}function Nn(t,e,n){var r=n||"";try{Ge(t,(function(t,n){var i=t;R(t)&&(i=Gt(t)),e.push(r+n+"="+encodeURIComponent(i))}))}catch(i){throw e.push(r+"type="+encodeURIComponent("_badmap")),i}}function Rn(t,e,n,r,i){try{e.onload=null,e.onerror=null,e.onabort=null,e.ontimeout=null,i(r)}catch(o){}}En.prototype.cancel=function(){var t,e;if(this.c=xn(this),this.b)this.b.cancel(),this.b=null;else if(this.a&&0!==this.a.size){try{for(var n=S(this.a.values()),r=n.next();!r.done;r=n.next())r.value.cancel()}catch(i){t={error:i}}finally{try{r&&!r.done&&(e=n.return)&&e.call(n)}finally{if(t)throw t.error}}this.a.clear()}},An.prototype.stringify=function(t){return A.JSON.stringify(t,void 0)},An.prototype.parse=function(t){return A.JSON.parse(t,void 0)};var Pn=A.JSON.parse;function Dn(t){Bt.call(this),this.headers=new Qe,this.H=t||null,this.b=!1,this.s=this.a=null,this.B="",this.h=0,this.f="",this.g=this.A=this.l=this.u=!1,this.o=0,this.m=null,this.I=Ln,this.D=this.F=!1}V(Dn,Bt);var Ln="",Mn=/^https?$/i,Fn=["POST","PUT"];function Un(t){return"content-type"==t.toLowerCase()}function $n(t,e){t.b=!1,t.a&&(t.g=!0,t.a.abort(),t.g=!1),t.f=e,t.h=5,Vn(t),Hn(t)}function Vn(t){t.u||(t.u=!0,zt(t,"complete"),zt(t,"error"))}function qn(t){if(t.b&&void 0!==x&&(!t.s[1]||4!=zn(t)||2!=t.W()))if(t.l&&4==zn(t))se(t.za,0,t);else if(zt(t,"readystatechange"),4==zn(t)){t.b=!1;try{var e,n=t.W();t:switch(n){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var r=!0;break t;default:r=!1}if(!(e=r)){var i;if(i=0===n){var o=String(t.B).match(Ye)[1]||null;if(!o&&A.self&&A.self.location){var s=A.self.location.protocol;o=s.substr(0,s.length-1)}i=!Mn.test(o?o.toLowerCase():"")}e=i}if(e)zt(t,"complete"),zt(t,"success");else{t.h=6;try{var a=2<zn(t)?t.a.statusText:""}catch(n){a=""}t.f=a+" ["+t.W()+"]",Vn(t)}}finally{Hn(t)}}}function Hn(t,e){if(t.a){Bn(t);var n=t.a,r=t.s[0]?k:null;t.a=null,t.s=null,e||zt(t,"ready");try{n.onreadystatechange=r}catch(i){}}}function Bn(t){t.a&&t.D&&(t.a.ontimeout=null),t.m&&(A.clearTimeout(t.m),t.m=null)}function zn(t){return t.a?t.a.readyState:0}function Wn(t,e,n){t:{for(r in n){var r=!1;break t}r=!0}r||(n=function(t){var e="";return tt(t,(function(t,n){e+=n,e+=":",e+=t,e+="\r\n"})),e}(n),"string"==typeof t?null!=n&&encodeURIComponent(String(n)):on(t,e,n))}function Gn(t,e,n){return n&&n.internalChannelParams&&n.internalChannelParams[t]||e}function Qn(t){this.pa=0,this.g=[],this.c=new fe,this.ga=this.la=this.B=this.fa=this.a=this.na=this.A=this.V=this.i=this.O=this.l=null,this.Oa=this.R=0,this.La=Gn("failFast",!1,t),this.H=this.m=this.j=this.h=this.f=null,this.S=!0,this.I=this.oa=this.P=-1,this.T=this.o=this.u=0,this.Ha=Gn("baseRetryDelayMs",5e3,t),this.Ra=Gn("retryDelaySeedMs",1e4,t),this.Ma=Gn("forwardChannelMaxRetries",2,t),this.ma=Gn("forwardChannelRequestTimeoutMs",2e4,t),this.Na=t&&t.g||void 0,this.D=void 0,this.C=t&&t.supportsCrossDomainXhr||!1,this.J="",this.b=new En(t&&t.concurrentRequestLimit),this.ka=new kn,this.da=t&&t.fastHandshake||!1,this.Ia=t&&t.b||!1,t&&t.f&&(this.c.a=!1),t&&t.forceLongPolling&&(this.S=!1),this.U=!this.da&&this.S&&t&&t.detectBufferingProxy||!1,this.ea=void 0,this.N=0,this.F=!1,this.s=null,(this.Ka=t&&t.c||!1)&&this.c.info("Opt-in to enable Chrome Origin Trials.")}function Kn(t){if(Yn(t),3==t.v){var e=t.R++,n=Ze(t.B);on(n,"SID",t.J),on(n,"RID",e),on(n,"TYPE","terminate"),er(t,n),(e=new Re(t,t.c,e,void 0)).H=2,e.i=sn(Ze(n)),n=!1,A.navigator&&A.navigator.sendBeacon&&(n=A.navigator.sendBeacon(e.i.toString(),"")),!n&&A.Image&&((new Image).src=e.i,n=!0),n||(e.a=fr(e.g,null),e.a.ba(e.i)),e.u=$(),Ve(e)}hr(t)}function Xn(t){t.a&&(or(t),t.a.cancel(),t.a=null)}function Yn(t){Xn(t),t.j&&(A.clearTimeout(t.j),t.j=null),ar(t),t.b.cancel(),t.h&&("number"==typeof t.h&&A.clearTimeout(t.h),t.h=null)}function Jn(t,e){t.g.push(new wn(t.Oa++,e)),3==t.v&&Zn(t)}function Zn(t){Cn(t.b)||t.h||(t.h=!0,te(t.Ba,t),t.u=0)}function tr(t,e){var n;n=e?e.f:t.R++;var r=Ze(t.B);on(r,"SID",t.J),on(r,"RID",n),on(r,"AID",t.P),er(t,r),t.i&&t.l&&Wn(r,t.i,t.l),n=new Re(t,t.c,n,t.u+1),null===t.i&&(n.B=t.l),e&&(t.g=e.s.concat(t.g)),e=nr(t,n,1e3),n.setTimeout(Math.round(.5*t.ma)+Math.round(.5*t.ma*Math.random())),In(t.b,n),Me(n,r,e)}function er(t,e){t.f&&Ge({},(function(t,n){on(e,n,t)}))}function nr(t,e,n){n=Math.min(t.g.length,n);var r=t.f?F(t.f.Ja,t.f,t):null;t:for(var i=t.g,o=-1;;){var s=["count="+n];-1==o?0<n?s.push("ofs="+(o=i[0].b)):o=0:s.push("ofs="+o);for(var a=!0,u=0;u<n;u++){var c=i[u].b,l=i[u].a;if(0>(c-=o))o=Math.max(0,i[u].b-100),a=!1;else try{Nn(l,s,"req"+c+"_")}catch(Wr){r&&r(l)}}if(a){r=s.join("&");break t}}return t=t.g.splice(0,n),e.s=t,r}function rr(t){t.a||t.j||(t.T=1,te(t.Aa,t),t.o=0)}function ir(t){return!(t.a||t.j||3<=t.o||(t.T++,t.j=Oe(F(t.Aa,t),cr(t,t.o)),t.o++,0))}function or(t){null!=t.s&&(A.clearTimeout(t.s),t.s=null)}function sr(t){t.a=new Re(t,t.c,"rpc",t.T),null===t.i&&(t.a.B=t.l),t.a.O=0;var e=Ze(t.la);on(e,"RID","rpc"),on(e,"SID",t.J),on(e,"CI",t.H?"0":"1"),on(e,"AID",t.P),er(t,e),on(e,"TYPE","xmlhttp"),t.i&&t.l&&Wn(e,t.i,t.l),t.D&&t.a.setTimeout(t.D);var n=t.a;t=t.ga,n.H=1,n.i=sn(Ze(e)),n.j=null,n.I=!0,Fe(n,t)}function ar(t){null!=t.m&&(A.clearTimeout(t.m),t.m=null)}function ur(t,e){var n=null;if(t.a==e){ar(t),or(t),t.a=null;var r=2}else{if(!Sn(t.b,e))return;n=e.s,jn(t.b,e),r=1}if(t.I=e.N,0!=t.v)if(e.b)if(1==r){n=e.j?e.j.length:0,e=$()-e.u;var i=t.u;zt(r=ve(),new Ee(r,n,e,i)),Zn(t)}else rr(t);else if(3==(i=e.h)||0==i&&0<t.I||!(1==r&&function(t,e){return!(Tn(t.b)>=t.b.f-(t.h?1:0)||(t.h?(t.g=e.s.concat(t.g),0):1==t.v||2==t.v||t.u>=(t.La?0:t.Ma)||(t.h=Oe(F(t.Ba,t,e),cr(t,t.u)),t.u++,0)))}(t,e)||2==r&&ir(t)))switch(n&&0<n.length&&(e=t.b,e.c=e.c.concat(n)),i){case 1:lr(t,5);break;case 4:lr(t,10);break;case 3:lr(t,6);break;default:lr(t,2)}}function cr(t,e){var n=t.Ha+Math.floor(Math.random()*t.Ra);return t.f||(n*=2),n*e}function lr(t,e){if(t.c.info("Error code "+e),2==e){var n=null;t.f&&(n=null);var r=F(t.Ya,t);n||(n=new Je("//www.google.com/images/cleardot.gif"),A.location&&"http"==A.location.protocol||tn(n,"https"),sn(n)),function(t,e){var n=new fe;if(A.Image){var r=new Image;r.onload=U(Rn,n,r,"TestLoadImage: loaded",!0,e),r.onerror=U(Rn,n,r,"TestLoadImage: error",!1,e),r.onabort=U(Rn,n,r,"TestLoadImage: abort",!1,e),r.ontimeout=U(Rn,n,r,"TestLoadImage: timeout",!1,e),A.setTimeout((function(){r.ontimeout&&r.ontimeout()}),1e4),r.src=t}else e(!1)}(n.toString(),r)}else we(2);t.v=0,t.f&&t.f.ra(e),hr(t),Yn(t)}function hr(t){t.v=0,t.I=-1,t.f&&(0==xn(t.b).length&&0==t.g.length||(t.b.c.length=0,W(t.g),t.g.length=0),t.f.qa())}function dr(t,e,n){var r=function(t){return t instanceof Je?Ze(t):new Je(t,void 0)}(n);if(""!=r.c)e&&en(r,e+"."+r.c),nn(r,r.h);else{var i=A.location;r=function(t,e,n,r){var i=new Je(null,void 0);return t&&tn(i,t),e&&en(i,e),n&&nn(i,n),r&&(i.g=r),i}(i.protocol,e?e+"."+i.hostname:i.hostname,+i.port,n)}return t.V&&tt(t.V,(function(t,e){on(r,e,t)})),n=t.na,(e=t.A)&&n&&on(r,e,n),on(r,"VER",t.ha),er(t,r),r}function fr(t,e){if(e&&!t.C)throw Error("Can't create secondary domain capable XhrIo object.");return(e=new Dn(t.Na)).F=t.C,e}function pr(){}function gr(){if(ut&&!(10<=Number(bt)))throw Error("Environmental error: no available transport.")}function yr(t,e){Bt.call(this),this.a=new Qn(e),this.o=t,this.b=e&&e.messageUrlParams||null,t=e&&e.messageHeaders||null,e&&e.clientProtocolHeaderRequired&&(t?t["X-Client-Protocol"]="webchannel":t={"X-Client-Protocol":"webchannel"}),this.a.l=t,t=e&&e.initMessageHeaders||null,e&&e.messageContentType&&(t?t["X-WebChannel-Content-Type"]=e.messageContentType:t={"X-WebChannel-Content-Type":e.messageContentType}),e&&e.a&&(t?t["X-WebChannel-Client-Profile"]=e.a:t={"X-WebChannel-Client-Profile":e.a}),this.a.O=t,(t=e&&e.httpHeadersOverwriteParam)&&!G(t)&&(this.a.i=t),this.m=e&&e.supportsCrossDomainXhr||!1,this.l=e&&e.sendRawJson||!1,(e=e&&e.httpSessionIdParam)&&!G(e)&&(this.a.A=e,null!==(t=this.b)&&e in t&&e in(t=this.b)&&delete t[e]),this.f=new br(this)}function vr(t){Ae.call(this);var e=t.__sm__;if(e){t:{for(var n in e){t=n;break t}t=void 0}(this.c=t)?(t=this.c,this.data=null!==e&&t in e?e[t]:void 0):this.data=e}else this.data=t}function mr(){ke.call(this),this.status=1}function br(t){this.a=t}(I=Dn.prototype).ba=function(t,e,n,r){if(this.a)throw Error("[goog.net.XhrIo] Object is active with another request="+this.B+"; newUri="+t);e=e?e.toUpperCase():"GET",this.B=t,this.f="",this.h=0,this.u=!1,this.b=!0,this.a=new XMLHttpRequest,this.s=function(t){var e;return(e=t.a)||(e=t.a={}),e}(this.H?this.H:je),this.a.onreadystatechange=F(this.za,this);try{this.A=!0,this.a.open(e,String(t),!0),this.A=!1}catch(o){return void $n(this,o)}t=n||"";var i=new Qe(this.headers);r&&Ge(r,(function(t,e){i.set(e,t)})),r=function(t){t:{for(var e=Un,n=t.length,r="string"==typeof t?t.split(""):t,i=0;i<n;i++)if(i in r&&e.call(void 0,r[i],i,t)){e=i;break t}e=-1}return 0>e?null:"string"==typeof t?t.charAt(e):t[e]}(i.L()),n=A.FormData&&t instanceof A.FormData,!(0<=H(Fn,e))||r||n||i.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8"),i.forEach((function(t,e){this.a.setRequestHeader(e,t)}),this),this.I&&(this.a.responseType=this.I),"withCredentials"in this.a&&this.a.withCredentials!==this.F&&(this.a.withCredentials=this.F);try{Bn(this),0<this.o&&((this.D=function(t){return ut&&mt(9)&&"number"==typeof t.timeout&&void 0!==t.ontimeout}(this.a))?(this.a.timeout=this.o,this.a.ontimeout=F(this.xa,this)):this.m=se(this.xa,this.o,this)),this.l=!0,this.a.send(t),this.l=!1}catch(o){$n(this,o)}},I.xa=function(){void 0!==x&&this.a&&(this.f="Timed out after "+this.o+"ms, aborting",this.h=8,zt(this,"timeout"),this.abort(8))},I.abort=function(t){this.a&&this.b&&(this.b=!1,this.g=!0,this.a.abort(),this.g=!1,this.h=t||7,zt(this,"complete"),zt(this,"abort"),Hn(this))},I.G=function(){this.a&&(this.b&&(this.b=!1,this.g=!0,this.a.abort(),this.g=!1),Hn(this,!0)),Dn.X.G.call(this)},I.za=function(){this.j||(this.A||this.l||this.g?qn(this):this.Ua())},I.Ua=function(){qn(this)},I.W=function(){try{return 2<zn(this)?this.a.status:-1}catch(st){return-1}},I.$=function(){try{return this.a?this.a.responseText:""}catch(st){return""}},I.Pa=function(t){if(this.a){var e=this.a.responseText;return t&&0==e.indexOf(t)&&(e=e.substring(t.length)),Pn(e)}},I.ua=function(){return this.h},I.Qa=function(){return"string"==typeof this.f?this.f:String(this.f)},(I=Qn.prototype).ha=8,I.v=1,I.Ba=function(t){if(this.h)if(this.h=null,1==this.v){if(!t){this.R=Math.floor(1e5*Math.random()),t=this.R++;var e,n=new Re(this,this.c,t,void 0),r=this.l;if(this.O&&(r?rt(r=et(r),this.O):r=this.O),null===this.i&&(n.B=r),this.da)t:{for(var i=e=0;i<this.g.length;i++){var o=this.g[i];if(void 0===(o="__data__"in o.a&&"string"==typeof(o=o.a.__data__)?o.length:void 0))break;if(4096<(e+=o)){e=i;break t}if(4096===e||i===this.g.length-1){e=i+1;break t}}e=1e3}else e=1e3;e=nr(this,n,e),on(i=Ze(this.B),"RID",t),on(i,"CVER",22),this.A&&on(i,"X-HTTP-Session-Id",this.A),er(this,i),this.i&&r&&Wn(i,this.i,r),In(this.b,n),this.Ia&&on(i,"TYPE","init"),this.da?(on(i,"$req",e),on(i,"SID","null"),n.U=!0,Me(n,i,null)):Me(n,i,e),this.v=2}}else 3==this.v&&(t?tr(this,t):0==this.g.length||Cn(this.b)||tr(this))},I.Aa=function(){if(this.j=null,sr(this),this.U&&!(this.F||null==this.a||0>=this.N)){var t=2*this.N;this.c.info("BP detection timer enabled: "+t),this.s=Oe(F(this.Ta,this),t)}},I.Ta=function(){this.s&&(this.s=null,this.c.info("BP detection timeout reached."),this.c.info("Buffering proxy detected and switch to long-polling!"),this.H=!1,this.F=!0,we(10),Xn(this),sr(this))},I.Sa=function(){null!=this.m&&(this.m=null,Xn(this),ir(this),we(19))},I.Ya=function(t){t?(this.c.info("Successfully pinged google.com"),we(2)):(this.c.info("Failed to ping google.com"),we(1))},(I=pr.prototype).ta=function(){},I.sa=function(){},I.ra=function(){},I.qa=function(){},I.Ja=function(){},gr.prototype.a=function(t,e){return new yr(t,e)},V(yr,Bt),yr.prototype.g=function(){this.a.f=this.f,this.m&&(this.a.C=!0);var t=this.a,e=this.o,n=this.b||void 0;we(0),t.fa=e,t.V=n||{},t.H=t.S,t.B=dr(t,null,t.fa),Zn(t)},yr.prototype.close=function(){Kn(this.a)},yr.prototype.h=function(t){if("string"==typeof t){var e={};e.__data__=t,Jn(this.a,e)}else this.l?((e={}).__data__=Gt(t),Jn(this.a,e)):Jn(this.a,t)},yr.prototype.G=function(){this.a.f=null,delete this.f,Kn(this.a),delete this.a,yr.X.G.call(this)},V(vr,Ae),V(mr,ke),V(br,pr),br.prototype.ta=function(){zt(this.a,"a")},br.prototype.sa=function(t){zt(this.a,new vr(t))},br.prototype.ra=function(t){zt(this.a,new mr(t))},br.prototype.qa=function(){zt(this.a,"b")},gr.prototype.createWebChannel=gr.prototype.a,yr.prototype.send=yr.prototype.h,yr.prototype.open=yr.prototype.g,yr.prototype.close=yr.prototype.close,Ce.NO_ERROR=0,Ce.TIMEOUT=8,Ce.HTTP_ERROR=6,Te.COMPLETE="complete",Ie.EventType=xe,xe.OPEN="a",xe.CLOSE="b",xe.ERROR="c",xe.MESSAGE="d",Bt.prototype.listen=Bt.prototype.va,Dn.prototype.listenOnce=Dn.prototype.wa,Dn.prototype.getLastError=Dn.prototype.Qa,Dn.prototype.getLastErrorCode=Dn.prototype.ua,Dn.prototype.getStatus=Dn.prototype.W,Dn.prototype.getResponseJson=Dn.prototype.Pa,Dn.prototype.getResponseText=Dn.prototype.$,Dn.prototype.send=Dn.prototype.ba;var _r=Ce,wr=Te,Er=ge,Or=Ie,Cr=Dn,Tr=n("/6Yf"),Sr=function(t,e,n,r,i,o){this.t=t,this.persistenceKey=e,this.host=n,this.ssl=r,this.forceLongPolling=i,this.i=o},Ir=function(){function t(t,e){this.projectId=t,this.database=e||"(default)"}return Object.defineProperty(t.prototype,"o",{get:function(){return"(default)"===this.database},enumerable:!1,configurable:!0}),t.prototype.isEqual=function(e){return e instanceof t&&e.projectId===this.projectId&&e.database===this.database},t}(),jr=function(){function t(t){this.uid=t}return t.prototype.u=function(){return null!=this.uid},t.prototype.h=function(){return this.u()?"uid:"+this.uid:"anonymous-user"},t.prototype.isEqual=function(t){return t.uid===this.uid},t}();jr.UNAUTHENTICATED=new jr(null),jr.l=new jr("google-credentials-uid"),jr._=new jr("first-party-uid");var xr=new O.b("@firebase/firestore");function Ar(){return xr.logLevel}function kr(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(xr.logLevel<=O.a.DEBUG){var r=e.map(Pr);xr.debug.apply(xr,Object(w.h)(["Firestore (8.1.1): "+t],r))}}function Nr(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(xr.logLevel<=O.a.ERROR){var r=e.map(Pr);xr.error.apply(xr,Object(w.h)(["Firestore (8.1.1): "+t],r))}}function Rr(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(xr.logLevel<=O.a.WARN){var r=e.map(Pr);xr.warn.apply(xr,Object(w.h)(["Firestore (8.1.1): "+t],r))}}function Pr(t){if("string"==typeof t)return t;try{return JSON.stringify(t)}catch(e){return t}}function Dr(t){void 0===t&&(t="Unexpected state");var e="FIRESTORE (8.1.1) INTERNAL ASSERTION FAILED: "+t;throw Nr(e),new Error(e)}function Lr(t,e){t||Dr()}function Mr(t,e){return t}var Fr={OK:"ok",CANCELLED:"cancelled",UNKNOWN:"unknown",INVALID_ARGUMENT:"invalid-argument",DEADLINE_EXCEEDED:"deadline-exceeded",NOT_FOUND:"not-found",ALREADY_EXISTS:"already-exists",PERMISSION_DENIED:"permission-denied",UNAUTHENTICATED:"unauthenticated",RESOURCE_EXHAUSTED:"resource-exhausted",FAILED_PRECONDITION:"failed-precondition",ABORTED:"aborted",OUT_OF_RANGE:"out-of-range",UNIMPLEMENTED:"unimplemented",INTERNAL:"internal",UNAVAILABLE:"unavailable",DATA_LOSS:"data-loss"},Ur=function(t){function e(e,n){var r=this;return(r=t.call(this,n)||this).code=e,r.message=n,r.name="FirebaseError",r.toString=function(){return r.name+": [code="+r.code+"]: "+r.message},r}return Object(w.d)(e,t),e}(Error),$r=function(t,e){this.user=e,this.type="OAuth",this.T={},this.T.Authorization="Bearer "+t},Vr=function(){function t(){this.I=null}return t.prototype.getToken=function(){return Promise.resolve(null)},t.prototype.m=function(){},t.prototype.A=function(t){this.I=t,t(jr.UNAUTHENTICATED)},t.prototype.R=function(){this.I=null},t}(),qr=function(){function t(t){var e=this;this.P=null,this.currentUser=jr.UNAUTHENTICATED,this.g=!1,this.V=0,this.I=null,this.forceRefresh=!1,this.P=function(){e.V++,e.currentUser=e.p(),e.g=!0,e.I&&e.I(e.currentUser)},this.V=0,this.auth=t.getImmediate({optional:!0}),this.auth?this.auth.addAuthTokenListener(this.P):(this.P(null),t.get().then((function(t){e.auth=t,e.P&&e.auth.addAuthTokenListener(e.P)}),(function(){})))}return t.prototype.getToken=function(){var t=this,e=this.V,n=this.forceRefresh;return this.forceRefresh=!1,this.auth?this.auth.getToken(n).then((function(n){return t.V!==e?(kr("FirebaseCredentialsProvider","getToken aborted due to token change."),t.getToken()):n?(Lr("string"==typeof n.accessToken),new $r(n.accessToken,t.currentUser)):null})):Promise.resolve(null)},t.prototype.m=function(){this.forceRefresh=!0},t.prototype.A=function(t){this.I=t,this.g&&t(this.currentUser)},t.prototype.R=function(){this.auth&&this.auth.removeAuthTokenListener(this.P),this.P=null,this.I=null},t.prototype.p=function(){var t=this.auth&&this.auth.getUid();return Lr(null===t||"string"==typeof t),new jr(t)},t}(),Hr=function(){function t(t,e){this.v=t,this.S=e,this.type="FirstParty",this.user=jr._}return Object.defineProperty(t.prototype,"T",{get:function(){var t={"X-Goog-AuthUser":this.S},e=this.v.auth.getAuthHeaderValueForFirstParty([]);return e&&(t.Authorization=e),t},enumerable:!1,configurable:!0}),t}(),Br=function(){function t(t,e){this.v=t,this.S=e}return t.prototype.getToken=function(){return Promise.resolve(new Hr(this.v,this.S))},t.prototype.A=function(t){t(jr._)},t.prototype.R=function(){},t.prototype.m=function(){},t}();function zr(t){var e="undefined"!=typeof self&&(self.crypto||self.msCrypto),n=new Uint8Array(t);if(e&&"function"==typeof e.getRandomValues)e.getRandomValues(n);else for(var r=0;r<t;r++)n[r]=Math.floor(256*Math.random());return n}var Wr=function(){function t(){}return t.D=function(){for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",e=Math.floor(256/t.length)*t.length,n="";n.length<20;)for(var r=zr(40),i=0;i<r.length;++i)n.length<20&&r[i]<e&&(n+=t.charAt(r[i]%t.length));return n},t}();function Gr(t,e){return t<e?-1:t>e?1:0}function Qr(t,e,n){return t.length===e.length&&t.every((function(t,r){return n(t,e[r])}))}function Kr(t){return t+"\0"}var Xr=function(){function t(t,e){if(this.seconds=t,this.nanoseconds=e,e<0)throw new Ur(Fr.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+e);if(e>=1e9)throw new Ur(Fr.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+e);if(t<-62135596800)throw new Ur(Fr.INVALID_ARGUMENT,"Timestamp seconds out of range: "+t);if(t>=253402300800)throw new Ur(Fr.INVALID_ARGUMENT,"Timestamp seconds out of range: "+t)}return t.now=function(){return t.fromMillis(Date.now())},t.fromDate=function(e){return t.fromMillis(e.getTime())},t.fromMillis=function(e){var n=Math.floor(e/1e3);return new t(n,1e6*(e-1e3*n))},t.prototype.toDate=function(){return new Date(this.toMillis())},t.prototype.toMillis=function(){return 1e3*this.seconds+this.nanoseconds/1e6},t.prototype.C=function(t){return this.seconds===t.seconds?Gr(this.nanoseconds,t.nanoseconds):Gr(this.seconds,t.seconds)},t.prototype.isEqual=function(t){return t.seconds===this.seconds&&t.nanoseconds===this.nanoseconds},t.prototype.toString=function(){return"Timestamp(seconds="+this.seconds+", nanoseconds="+this.nanoseconds+")"},t.prototype.toJSON=function(){return{seconds:this.seconds,nanoseconds:this.nanoseconds}},t.prototype.valueOf=function(){return String(this.seconds- -62135596800).padStart(12,"0")+"."+String(this.nanoseconds).padStart(9,"0")},t}(),Yr=function(){function t(t){this.timestamp=t}return t.N=function(e){return new t(e)},t.min=function(){return new t(new Xr(0,0))},t.prototype.F=function(t){return this.timestamp.C(t.timestamp)},t.prototype.isEqual=function(t){return this.timestamp.isEqual(t.timestamp)},t.prototype.O=function(){return 1e6*this.timestamp.seconds+this.timestamp.nanoseconds/1e3},t.prototype.toString=function(){return"SnapshotVersion("+this.timestamp.toString()+")"},t.prototype.M=function(){return this.timestamp},t}(),Jr=function(){function t(t,e,n){void 0===e?e=0:e>t.length&&Dr(),void 0===n?n=t.length-e:n>t.length-e&&Dr(),this.segments=t,this.offset=e,this.k=n}return Object.defineProperty(t.prototype,"length",{get:function(){return this.k},enumerable:!1,configurable:!0}),t.prototype.isEqual=function(e){return 0===t.$(this,e)},t.prototype.child=function(e){var n=this.segments.slice(this.offset,this.limit());return e instanceof t?e.forEach((function(t){n.push(t)})):n.push(e),this.L(n)},t.prototype.limit=function(){return this.offset+this.length},t.prototype.B=function(t){return this.L(this.segments,this.offset+(t=void 0===t?1:t),this.length-t)},t.prototype.q=function(){return this.L(this.segments,this.offset,this.length-1)},t.prototype.U=function(){return this.segments[this.offset]},t.prototype.K=function(){return this.get(this.length-1)},t.prototype.get=function(t){return this.segments[this.offset+t]},t.prototype.W=function(){return 0===this.length},t.prototype.j=function(t){if(t.length<this.length)return!1;for(var e=0;e<this.length;e++)if(this.get(e)!==t.get(e))return!1;return!0},t.prototype.G=function(t){if(this.length+1!==t.length)return!1;for(var e=0;e<this.length;e++)if(this.get(e)!==t.get(e))return!1;return!0},t.prototype.forEach=function(t){for(var e=this.offset,n=this.limit();e<n;e++)t(this.segments[e])},t.prototype.H=function(){return this.segments.slice(this.offset,this.limit())},t.$=function(t,e){for(var n=Math.min(t.length,e.length),r=0;r<n;r++){var i=t.get(r),o=e.get(r);if(i<o)return-1;if(i>o)return 1}return t.length<e.length?-1:t.length>e.length?1:0},t}(),Zr=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(w.d)(e,t),e.prototype.L=function(t,n,r){return new e(t,n,r)},e.prototype.J=function(){return this.H().join("/")},e.prototype.toString=function(){return this.J()},e.Y=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];for(var r=[],i=0,o=t;i<o.length;i++){var s=o[i];if(s.indexOf("//")>=0)throw new Ur(Fr.INVALID_ARGUMENT,"Invalid segment ("+s+"). Paths must not contain // in them.");r.push.apply(r,s.split("/").filter((function(t){return t.length>0})))}return new e(r)},e.X=function(){return new e([])},e}(Jr),ti=/^[_a-zA-Z][_a-zA-Z0-9]*$/,ei=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(w.d)(e,t),e.prototype.L=function(t,n,r){return new e(t,n,r)},e.Z=function(t){return ti.test(t)},e.prototype.J=function(){return this.H().map((function(t){return t=t.replace("\\","\\\\").replace("`","\\`"),e.Z(t)||(t="`"+t+"`"),t})).join(".")},e.prototype.toString=function(){return this.J()},e.prototype.tt=function(){return 1===this.length&&"__name__"===this.get(0)},e.et=function(){return new e(["__name__"])},e.nt=function(t){for(var n=[],r="",i=0,o=function(){if(0===r.length)throw new Ur(Fr.INVALID_ARGUMENT,"Invalid field path ("+t+"). Paths must not be empty, begin with '.', end with '.', or contain '..'");n.push(r),r=""},s=!1;i<t.length;){var a=t[i];if("\\"===a){if(i+1===t.length)throw new Ur(Fr.INVALID_ARGUMENT,"Path has trailing escape character: "+t);var u=t[i+1];if("\\"!==u&&"."!==u&&"`"!==u)throw new Ur(Fr.INVALID_ARGUMENT,"Path has invalid escape sequence: "+t);r+=u,i+=2}else"`"===a?(s=!s,i++):"."!==a||s?(r+=a,i++):(o(),i++)}if(o(),s)throw new Ur(Fr.INVALID_ARGUMENT,"Unterminated ` in path: "+t);return new e(n)},e.X=function(){return new e([])},e}(Jr),ni=function(){function t(t){this.path=t}return t.st=function(e){return new t(Zr.Y(e))},t.it=function(e){return new t(Zr.Y(e).B(5))},t.prototype.rt=function(t){return this.path.length>=2&&this.path.get(this.path.length-2)===t},t.prototype.isEqual=function(t){return null!==t&&0===Zr.$(this.path,t.path)},t.prototype.toString=function(){return this.path.toString()},t.$=function(t,e){return Zr.$(t.path,e.path)},t.ot=function(t){return t.length%2==0},t.ct=function(e){return new t(new Zr(e.slice()))},t}();function ri(t){return null==t}function ii(t){return 0===t&&1/t==-1/0}function oi(t){return"number"==typeof t&&Number.isInteger(t)&&!ii(t)&&t<=Number.MAX_SAFE_INTEGER&&t>=Number.MIN_SAFE_INTEGER}var si=function(t,e,n,r,i,o,s){void 0===e&&(e=null),void 0===n&&(n=[]),void 0===r&&(r=[]),void 0===i&&(i=null),void 0===o&&(o=null),void 0===s&&(s=null),this.path=t,this.collectionGroup=e,this.orderBy=n,this.filters=r,this.limit=i,this.startAt=o,this.endAt=s,this.ut=null};function ai(t,e,n,r,i,o,s){return void 0===e&&(e=null),void 0===n&&(n=[]),void 0===r&&(r=[]),void 0===i&&(i=null),void 0===o&&(o=null),void 0===s&&(s=null),new si(t,e,n,r,i,o,s)}function ui(t){var e=Mr(t);if(null===e.ut){var n=e.path.J();null!==e.collectionGroup&&(n+="|cg:"+e.collectionGroup),n+="|f:",n+=e.filters.map((function(t){return function(t){return t.field.J()+t.op.toString()+no(t.value)}(t)})).join(","),n+="|ob:",n+=e.orderBy.map((function(t){return function(t){return t.field.J()+t.dir}(t)})).join(","),ri(e.limit)||(n+="|l:",n+=e.limit),e.startAt&&(n+="|lb:",n+=ra(e.startAt)),e.endAt&&(n+="|ub:",n+=ra(e.endAt)),e.ut=n}return e.ut}function ci(t,e){if(t.limit!==e.limit)return!1;if(t.orderBy.length!==e.orderBy.length)return!1;for(var n=0;n<t.orderBy.length;n++)if(!ua(t.orderBy[n],e.orderBy[n]))return!1;if(t.filters.length!==e.filters.length)return!1;for(var r=0;r<t.filters.length;r++)if((i=t.filters[r]).op!==(o=e.filters[r]).op||!i.field.isEqual(o.field)||!Ji(i.value,o.value))return!1;var i,o;return t.collectionGroup===e.collectionGroup&&!!t.path.isEqual(e.path)&&!!oa(t.startAt,e.startAt)&&oa(t.endAt,e.endAt)}function li(t){return ni.ot(t.path)&&null===t.collectionGroup&&0===t.filters.length}var hi=function(){function t(t){this.at=t}return t.fromBase64String=function(e){return new t(atob(e))},t.fromUint8Array=function(e){return new t(function(t){for(var e="",n=0;n<t.length;++n)e+=String.fromCharCode(t[n]);return e}(e))},t.prototype.toBase64=function(){return btoa(this.at)},t.prototype.toUint8Array=function(){return function(t){for(var e=new Uint8Array(t.length),n=0;n<t.length;n++)e[n]=t.charCodeAt(n);return e}(this.at)},t.prototype.ht=function(){return 2*this.at.length},t.prototype.F=function(t){return Gr(this.at,t.at)},t.prototype.isEqual=function(t){return this.at===t.at},t}();hi.lt=new hi("");var di,fi,pi=function(){function t(t,e,n,r,i,o,s){void 0===i&&(i=Yr.min()),void 0===o&&(o=Yr.min()),void 0===s&&(s=hi.lt),this.target=t,this.targetId=e,this._t=n,this.sequenceNumber=r,this.ft=i,this.lastLimboFreeSnapshotVersion=o,this.resumeToken=s}return t.prototype.dt=function(e){return new t(this.target,this.targetId,this._t,e,this.ft,this.lastLimboFreeSnapshotVersion,this.resumeToken)},t.prototype.wt=function(e,n){return new t(this.target,this.targetId,this._t,this.sequenceNumber,n,this.lastLimboFreeSnapshotVersion,e)},t.prototype.Et=function(e){return new t(this.target,this.targetId,this._t,this.sequenceNumber,this.ft,e,this.resumeToken)},t}(),gi=function(t){this.count=t};function yi(t){switch(t){case Fr.OK:return Dr();case Fr.CANCELLED:case Fr.UNKNOWN:case Fr.DEADLINE_EXCEEDED:case Fr.RESOURCE_EXHAUSTED:case Fr.INTERNAL:case Fr.UNAVAILABLE:case Fr.UNAUTHENTICATED:return!1;case Fr.INVALID_ARGUMENT:case Fr.NOT_FOUND:case Fr.ALREADY_EXISTS:case Fr.PERMISSION_DENIED:case Fr.FAILED_PRECONDITION:case Fr.ABORTED:case Fr.OUT_OF_RANGE:case Fr.UNIMPLEMENTED:case Fr.DATA_LOSS:return!0;default:return Dr()}}function vi(t){if(void 0===t)return Nr("GRPC error has no .code"),Fr.UNKNOWN;switch(t){case di.OK:return Fr.OK;case di.CANCELLED:return Fr.CANCELLED;case di.UNKNOWN:return Fr.UNKNOWN;case di.DEADLINE_EXCEEDED:return Fr.DEADLINE_EXCEEDED;case di.RESOURCE_EXHAUSTED:return Fr.RESOURCE_EXHAUSTED;case di.INTERNAL:return Fr.INTERNAL;case di.UNAVAILABLE:return Fr.UNAVAILABLE;case di.UNAUTHENTICATED:return Fr.UNAUTHENTICATED;case di.INVALID_ARGUMENT:return Fr.INVALID_ARGUMENT;case di.NOT_FOUND:return Fr.NOT_FOUND;case di.ALREADY_EXISTS:return Fr.ALREADY_EXISTS;case di.PERMISSION_DENIED:return Fr.PERMISSION_DENIED;case di.FAILED_PRECONDITION:return Fr.FAILED_PRECONDITION;case di.ABORTED:return Fr.ABORTED;case di.OUT_OF_RANGE:return Fr.OUT_OF_RANGE;case di.UNIMPLEMENTED:return Fr.UNIMPLEMENTED;case di.DATA_LOSS:return Fr.DATA_LOSS;default:return Dr()}}(fi=di||(di={}))[fi.OK=0]="OK",fi[fi.CANCELLED=1]="CANCELLED",fi[fi.UNKNOWN=2]="UNKNOWN",fi[fi.INVALID_ARGUMENT=3]="INVALID_ARGUMENT",fi[fi.DEADLINE_EXCEEDED=4]="DEADLINE_EXCEEDED",fi[fi.NOT_FOUND=5]="NOT_FOUND",fi[fi.ALREADY_EXISTS=6]="ALREADY_EXISTS",fi[fi.PERMISSION_DENIED=7]="PERMISSION_DENIED",fi[fi.UNAUTHENTICATED=16]="UNAUTHENTICATED",fi[fi.RESOURCE_EXHAUSTED=8]="RESOURCE_EXHAUSTED",fi[fi.FAILED_PRECONDITION=9]="FAILED_PRECONDITION",fi[fi.ABORTED=10]="ABORTED",fi[fi.OUT_OF_RANGE=11]="OUT_OF_RANGE",fi[fi.UNIMPLEMENTED=12]="UNIMPLEMENTED",fi[fi.INTERNAL=13]="INTERNAL",fi[fi.UNAVAILABLE=14]="UNAVAILABLE",fi[fi.DATA_LOSS=15]="DATA_LOSS";var mi=function(){function t(t,e){this.$=t,this.root=e||_i.EMPTY}return t.prototype.Tt=function(e,n){return new t(this.$,this.root.Tt(e,n,this.$).copy(null,null,_i.It,null,null))},t.prototype.remove=function(e){return new t(this.$,this.root.remove(e,this.$).copy(null,null,_i.It,null,null))},t.prototype.get=function(t){for(var e=this.root;!e.W();){var n=this.$(t,e.key);if(0===n)return e.value;n<0?e=e.left:n>0&&(e=e.right)}return null},t.prototype.indexOf=function(t){for(var e=0,n=this.root;!n.W();){var r=this.$(t,n.key);if(0===r)return e+n.left.size;r<0?n=n.left:(e+=n.left.size+1,n=n.right)}return-1},t.prototype.W=function(){return this.root.W()},Object.defineProperty(t.prototype,"size",{get:function(){return this.root.size},enumerable:!1,configurable:!0}),t.prototype.At=function(){return this.root.At()},t.prototype.Rt=function(){return this.root.Rt()},t.prototype.Pt=function(t){return this.root.Pt(t)},t.prototype.forEach=function(t){this.Pt((function(e,n){return t(e,n),!1}))},t.prototype.toString=function(){var t=[];return this.Pt((function(e,n){return t.push(e+":"+n),!1})),"{"+t.join(", ")+"}"},t.prototype.gt=function(t){return this.root.gt(t)},t.prototype.yt=function(){return new bi(this.root,null,this.$,!1)},t.prototype.Vt=function(t){return new bi(this.root,t,this.$,!1)},t.prototype.vt=function(){return new bi(this.root,null,this.$,!0)},t.prototype.bt=function(t){return new bi(this.root,t,this.$,!0)},t}(),bi=function(){function t(t,e,n,r){this.St=r,this.Dt=[];for(var i=1;!t.W();)if(i=e?n(t.key,e):1,r&&(i*=-1),i<0)t=this.St?t.left:t.right;else{if(0===i){this.Dt.push(t);break}this.Dt.push(t),t=this.St?t.right:t.left}}return t.prototype.Ct=function(){var t=this.Dt.pop(),e={key:t.key,value:t.value};if(this.St)for(t=t.left;!t.W();)this.Dt.push(t),t=t.right;else for(t=t.right;!t.W();)this.Dt.push(t),t=t.left;return e},t.prototype.Nt=function(){return this.Dt.length>0},t.prototype.xt=function(){if(0===this.Dt.length)return null;var t=this.Dt[this.Dt.length-1];return{key:t.key,value:t.value}},t}(),_i=function(){function t(e,n,r,i,o){this.key=e,this.value=n,this.color=null!=r?r:t.RED,this.left=null!=i?i:t.EMPTY,this.right=null!=o?o:t.EMPTY,this.size=this.left.size+1+this.right.size}return t.prototype.copy=function(e,n,r,i,o){return new t(null!=e?e:this.key,null!=n?n:this.value,null!=r?r:this.color,null!=i?i:this.left,null!=o?o:this.right)},t.prototype.W=function(){return!1},t.prototype.Pt=function(t){return this.left.Pt(t)||t(this.key,this.value)||this.right.Pt(t)},t.prototype.gt=function(t){return this.right.gt(t)||t(this.key,this.value)||this.left.gt(t)},t.prototype.min=function(){return this.left.W()?this:this.left.min()},t.prototype.At=function(){return this.min().key},t.prototype.Rt=function(){return this.right.W()?this.key:this.right.Rt()},t.prototype.Tt=function(t,e,n){var r=this,i=n(t,r.key);return(r=i<0?r.copy(null,null,null,r.left.Tt(t,e,n),null):0===i?r.copy(null,e,null,null,null):r.copy(null,null,null,null,r.right.Tt(t,e,n))).Ft()},t.prototype.Ot=function(){if(this.left.W())return t.EMPTY;var e=this;return e.left.Mt()||e.left.left.Mt()||(e=e.kt()),(e=e.copy(null,null,null,e.left.Ot(),null)).Ft()},t.prototype.remove=function(e,n){var r,i=this;if(n(e,i.key)<0)i.left.W()||i.left.Mt()||i.left.left.Mt()||(i=i.kt()),i=i.copy(null,null,null,i.left.remove(e,n),null);else{if(i.left.Mt()&&(i=i.$t()),i.right.W()||i.right.Mt()||i.right.left.Mt()||(i=i.Lt()),0===n(e,i.key)){if(i.right.W())return t.EMPTY;r=i.right.min(),i=i.copy(r.key,r.value,null,null,i.right.Ot())}i=i.copy(null,null,null,null,i.right.remove(e,n))}return i.Ft()},t.prototype.Mt=function(){return this.color},t.prototype.Ft=function(){var t=this;return t.right.Mt()&&!t.left.Mt()&&(t=t.Bt()),t.left.Mt()&&t.left.left.Mt()&&(t=t.$t()),t.left.Mt()&&t.right.Mt()&&(t=t.qt()),t},t.prototype.kt=function(){var t=this.qt();return t.right.left.Mt()&&(t=(t=(t=t.copy(null,null,null,null,t.right.$t())).Bt()).qt()),t},t.prototype.Lt=function(){var t=this.qt();return t.left.left.Mt()&&(t=(t=t.$t()).qt()),t},t.prototype.Bt=function(){var e=this.copy(null,null,t.RED,null,this.right.left);return this.right.copy(null,null,this.color,e,null)},t.prototype.$t=function(){var e=this.copy(null,null,t.RED,this.left.right,null);return this.left.copy(null,null,this.color,null,e)},t.prototype.qt=function(){var t=this.left.copy(null,null,!this.left.color,null,null),e=this.right.copy(null,null,!this.right.color,null,null);return this.copy(null,null,!this.color,t,e)},t.prototype.Ut=function(){var t=this.Qt();return Math.pow(2,t)<=this.size+1},t.prototype.Qt=function(){if(this.Mt()&&this.left.Mt())throw Dr();if(this.right.Mt())throw Dr();var t=this.left.Qt();if(t!==this.right.Qt())throw Dr();return t+(this.Mt()?0:1)},t}();_i.EMPTY=null,_i.RED=!0,_i.It=!1,_i.EMPTY=new(function(){function t(){this.size=0}return Object.defineProperty(t.prototype,"key",{get:function(){throw Dr()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){throw Dr()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){throw Dr()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"left",{get:function(){throw Dr()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"right",{get:function(){throw Dr()},enumerable:!1,configurable:!0}),t.prototype.copy=function(t,e,n,r,i){return this},t.prototype.Tt=function(t,e,n){return new _i(t,e)},t.prototype.remove=function(t,e){return this},t.prototype.W=function(){return!0},t.prototype.Pt=function(t){return!1},t.prototype.gt=function(t){return!1},t.prototype.At=function(){return null},t.prototype.Rt=function(){return null},t.prototype.Mt=function(){return!1},t.prototype.Ut=function(){return!0},t.prototype.Qt=function(){return 0},t}());var wi=function(){function t(t){this.$=t,this.data=new mi(this.$)}return t.prototype.has=function(t){return null!==this.data.get(t)},t.prototype.first=function(){return this.data.At()},t.prototype.last=function(){return this.data.Rt()},Object.defineProperty(t.prototype,"size",{get:function(){return this.data.size},enumerable:!1,configurable:!0}),t.prototype.indexOf=function(t){return this.data.indexOf(t)},t.prototype.forEach=function(t){this.data.Pt((function(e,n){return t(e),!1}))},t.prototype.Kt=function(t,e){for(var n=this.data.Vt(t[0]);n.Nt();){var r=n.Ct();if(this.$(r.key,t[1])>=0)return;e(r.key)}},t.prototype.Wt=function(t,e){var n;for(n=void 0!==e?this.data.Vt(e):this.data.yt();n.Nt();)if(!t(n.Ct().key))return},t.prototype.jt=function(t){var e=this.data.Vt(t);return e.Nt()?e.Ct().key:null},t.prototype.yt=function(){return new Ei(this.data.yt())},t.prototype.Vt=function(t){return new Ei(this.data.Vt(t))},t.prototype.add=function(t){return this.copy(this.data.remove(t).Tt(t,!0))},t.prototype.delete=function(t){return this.has(t)?this.copy(this.data.remove(t)):this},t.prototype.W=function(){return this.data.W()},t.prototype.Gt=function(t){var e=this;return e.size<t.size&&(e=t,t=this),t.forEach((function(t){e=e.add(t)})),e},t.prototype.isEqual=function(e){if(!(e instanceof t))return!1;if(this.size!==e.size)return!1;for(var n=this.data.yt(),r=e.data.yt();n.Nt();){var i=n.Ct().key,o=r.Ct().key;if(0!==this.$(i,o))return!1}return!0},t.prototype.H=function(){var t=[];return this.forEach((function(e){t.push(e)})),t},t.prototype.toString=function(){var t=[];return this.forEach((function(e){return t.push(e)})),"SortedSet("+t.toString()+")"},t.prototype.copy=function(e){var n=new t(this.$);return n.data=e,n},t}(),Ei=function(){function t(t){this.zt=t}return t.prototype.Ct=function(){return this.zt.Ct().key},t.prototype.Nt=function(){return this.zt.Nt()},t}(),Oi=new mi(ni.$);function Ci(){return Oi}function Ti(){return Ci()}var Si=new mi(ni.$);function Ii(){return Si}var ji=new mi(ni.$),xi=new wi(ni.$);function Ai(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var n=xi,r=0,i=t;r<i.length;r++){var o=i[r];n=n.add(o)}return n}var ki=new wi(Gr);function Ni(){return ki}var Ri=function(){function t(t){this.$=t?function(e,n){return t(e,n)||ni.$(e.key,n.key)}:function(t,e){return ni.$(t.key,e.key)},this.Ht=Ii(),this.Jt=new mi(this.$)}return t.Yt=function(e){return new t(e.$)},t.prototype.has=function(t){return null!=this.Ht.get(t)},t.prototype.get=function(t){return this.Ht.get(t)},t.prototype.first=function(){return this.Jt.At()},t.prototype.last=function(){return this.Jt.Rt()},t.prototype.W=function(){return this.Jt.W()},t.prototype.indexOf=function(t){var e=this.Ht.get(t);return e?this.Jt.indexOf(e):-1},Object.defineProperty(t.prototype,"size",{get:function(){return this.Jt.size},enumerable:!1,configurable:!0}),t.prototype.forEach=function(t){this.Jt.Pt((function(e,n){return t(e),!1}))},t.prototype.add=function(t){var e=this.delete(t.key);return e.copy(e.Ht.Tt(t.key,t),e.Jt.Tt(t,null))},t.prototype.delete=function(t){var e=this.get(t);return e?this.copy(this.Ht.remove(t),this.Jt.remove(e)):this},t.prototype.isEqual=function(e){if(!(e instanceof t))return!1;if(this.size!==e.size)return!1;for(var n=this.Jt.yt(),r=e.Jt.yt();n.Nt();){var i=n.Ct().key,o=r.Ct().key;if(!i.isEqual(o))return!1}return!0},t.prototype.toString=function(){var t=[];return this.forEach((function(e){t.push(e.toString())})),0===t.length?"DocumentSet ()":"DocumentSet (\n  "+t.join("  \n")+"\n)"},t.prototype.copy=function(e,n){var r=new t;return r.$=this.$,r.Ht=e,r.Jt=n,r},t}(),Pi=function(){function t(){this.Xt=new mi(ni.$)}return t.prototype.track=function(t){var e=t.doc.key,n=this.Xt.get(e);n?0!==t.type&&3===n.type?this.Xt=this.Xt.Tt(e,t):3===t.type&&1!==n.type?this.Xt=this.Xt.Tt(e,{type:n.type,doc:t.doc}):2===t.type&&2===n.type?this.Xt=this.Xt.Tt(e,{type:2,doc:t.doc}):2===t.type&&0===n.type?this.Xt=this.Xt.Tt(e,{type:0,doc:t.doc}):1===t.type&&0===n.type?this.Xt=this.Xt.remove(e):1===t.type&&2===n.type?this.Xt=this.Xt.Tt(e,{type:1,doc:n.doc}):0===t.type&&1===n.type?this.Xt=this.Xt.Tt(e,{type:2,doc:t.doc}):Dr():this.Xt=this.Xt.Tt(e,t)},t.prototype.Zt=function(){var t=[];return this.Xt.Pt((function(e,n){t.push(n)})),t},t}(),Di=function(){function t(t,e,n,r,i,o,s,a){this.query=t,this.docs=e,this.te=n,this.docChanges=r,this.ee=i,this.fromCache=o,this.ne=s,this.se=a}return t.ie=function(e,n,r,i){var o=[];return n.forEach((function(t){o.push({type:0,doc:t})})),new t(e,n,Ri.Yt(n),o,r,i,!0,!1)},Object.defineProperty(t.prototype,"hasPendingWrites",{get:function(){return!this.ee.W()},enumerable:!1,configurable:!0}),t.prototype.isEqual=function(t){if(!(this.fromCache===t.fromCache&&this.ne===t.ne&&this.ee.isEqual(t.ee)&&qs(this.query,t.query)&&this.docs.isEqual(t.docs)&&this.te.isEqual(t.te)))return!1;var e=this.docChanges,n=t.docChanges;if(e.length!==n.length)return!1;for(var r=0;r<e.length;r++)if(e[r].type!==n[r].type||!e[r].doc.isEqual(n[r].doc))return!1;return!0},t}(),Li=function(){function t(t,e,n,r,i){this.ft=t,this.re=e,this.oe=n,this.ce=r,this.ue=i}return t.ae=function(e,n){var r=new Map;return r.set(e,Mi.he(e,n)),new t(Yr.min(),r,Ni(),Ci(),Ai())},t}(),Mi=function(){function t(t,e,n,r,i){this.resumeToken=t,this.le=e,this._e=n,this.fe=r,this.de=i}return t.he=function(e,n){return new t(hi.lt,n,Ai(),Ai(),Ai())},t}(),Fi=function(t,e,n,r){this.we=t,this.removedTargetIds=e,this.key=n,this.Ee=r},Ui=function(t,e){this.targetId=t,this.Te=e},$i=function(t,e,n,r){void 0===n&&(n=hi.lt),void 0===r&&(r=null),this.state=t,this.targetIds=e,this.resumeToken=n,this.cause=r},Vi=function(){function t(){this.Ie=0,this.me=Bi(),this.Ae=hi.lt,this.Re=!1,this.Pe=!0}return Object.defineProperty(t.prototype,"le",{get:function(){return this.Re},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"resumeToken",{get:function(){return this.Ae},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ge",{get:function(){return 0!==this.Ie},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ye",{get:function(){return this.Pe},enumerable:!1,configurable:!0}),t.prototype.Ve=function(t){t.ht()>0&&(this.Pe=!0,this.Ae=t)},t.prototype.pe=function(){var t=Ai(),e=Ai(),n=Ai();return this.me.forEach((function(r,i){switch(i){case 0:t=t.add(r);break;case 2:e=e.add(r);break;case 1:n=n.add(r);break;default:Dr()}})),new Mi(this.Ae,this.Re,t,e,n)},t.prototype.ve=function(){this.Pe=!1,this.me=Bi()},t.prototype.be=function(t,e){this.Pe=!0,this.me=this.me.Tt(t,e)},t.prototype.Se=function(t){this.Pe=!0,this.me=this.me.remove(t)},t.prototype.De=function(){this.Ie+=1},t.prototype.Ce=function(){this.Ie-=1},t.prototype.Ne=function(){this.Pe=!0,this.Re=!0},t}(),qi=function(){function t(t){this.xe=t,this.Fe=new Map,this.Oe=Ci(),this.Me=Hi(),this.ke=new wi(Gr)}return t.prototype.$e=function(t){for(var e=0,n=t.we;e<n.length;e++){var r=n[e];t.Ee instanceof js?this.Le(r,t.Ee):t.Ee instanceof xs&&this.Be(r,t.key,t.Ee)}for(var i=0,o=t.removedTargetIds;i<o.length;i++)this.Be(o[i],t.key,t.Ee)},t.prototype.qe=function(t){var e=this;this.Ue(t,(function(n){var r=e.Qe(n);switch(t.state){case 0:e.Ke(n)&&r.Ve(t.resumeToken);break;case 1:r.Ce(),r.ge||r.ve(),r.Ve(t.resumeToken);break;case 2:r.Ce(),r.ge||e.removeTarget(n);break;case 3:e.Ke(n)&&(r.Ne(),r.Ve(t.resumeToken));break;case 4:e.Ke(n)&&(e.We(n),r.Ve(t.resumeToken));break;default:Dr()}}))},t.prototype.Ue=function(t,e){var n=this;t.targetIds.length>0?t.targetIds.forEach(e):this.Fe.forEach((function(t,r){n.Ke(r)&&e(r)}))},t.prototype.je=function(t){var e=t.targetId,n=t.Te.count,r=this.Ge(e);if(r){var i=r.target;if(li(i))if(0===n){var o=new ni(i.path);this.Be(e,o,new xs(o,Yr.min()))}else Lr(1===n);else this.ze(e)!==n&&(this.We(e),this.ke=this.ke.add(e))}},t.prototype.He=function(t){var e=this,n=new Map;this.Fe.forEach((function(r,i){var o=e.Ge(i);if(o){if(r.le&&li(o.target)){var s=new ni(o.target.path);null!==e.Oe.get(s)||e.Je(i,s)||e.Be(i,s,new xs(s,t))}r.ye&&(n.set(i,r.pe()),r.ve())}}));var r=Ai();this.Me.forEach((function(t,n){var i=!0;n.Wt((function(t){var n=e.Ge(t);return!n||2===n._t||(i=!1,!1)})),i&&(r=r.add(t))}));var i=new Li(t,n,this.ke,this.Oe,r);return this.Oe=Ci(),this.Me=Hi(),this.ke=new wi(Gr),i},t.prototype.Le=function(t,e){if(this.Ke(t)){var n=this.Je(t,e.key)?2:0;this.Qe(t).be(e.key,n),this.Oe=this.Oe.Tt(e.key,e),this.Me=this.Me.Tt(e.key,this.Ye(e.key).add(t))}},t.prototype.Be=function(t,e,n){if(this.Ke(t)){var r=this.Qe(t);this.Je(t,e)?r.be(e,1):r.Se(e),this.Me=this.Me.Tt(e,this.Ye(e).delete(t)),n&&(this.Oe=this.Oe.Tt(e,n))}},t.prototype.removeTarget=function(t){this.Fe.delete(t)},t.prototype.ze=function(t){var e=this.Qe(t).pe();return this.xe.Xe(t).size+e._e.size-e.de.size},t.prototype.De=function(t){this.Qe(t).De()},t.prototype.Qe=function(t){var e=this.Fe.get(t);return e||(e=new Vi,this.Fe.set(t,e)),e},t.prototype.Ye=function(t){var e=this.Me.get(t);return e||(e=new wi(Gr),this.Me=this.Me.Tt(t,e)),e},t.prototype.Ke=function(t){var e=null!==this.Ge(t);return e||kr("WatchChangeAggregator","Detected inactive target",t),e},t.prototype.Ge=function(t){var e=this.Fe.get(t);return e&&e.ge?null:this.xe.Ze(t)},t.prototype.We=function(t){var e=this;this.Fe.set(t,new Vi),this.xe.Xe(t).forEach((function(n){e.Be(t,n,null)}))},t.prototype.Je=function(t,e){return this.xe.Xe(t).has(e)},t}();function Hi(){return new mi(ni.$)}function Bi(){return new mi(ni.$)}function zi(t){var e=0;for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e++;return e}function Wi(t,e){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e(n,t[n])}function Gi(t){for(var e in t)if(Object.prototype.hasOwnProperty.call(t,e))return!1;return!0}function Qi(t){var e,n;return"server_timestamp"===(null===(n=((null===(e=null==t?void 0:t.mapValue)||void 0===e?void 0:e.fields)||{}).__type__)||void 0===n?void 0:n.stringValue)}function Ki(t){var e=ro(t.mapValue.fields.__local_write_time__.timestampValue);return new Xr(e.seconds,e.nanos)}var Xi=new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);function Yi(t){return"nullValue"in t?0:"booleanValue"in t?1:"integerValue"in t||"doubleValue"in t?2:"timestampValue"in t?3:"stringValue"in t?5:"bytesValue"in t?6:"referenceValue"in t?7:"geoPointValue"in t?8:"arrayValue"in t?9:"mapValue"in t?Qi(t)?4:10:Dr()}function Ji(t,e){var n=Yi(t);if(n!==Yi(e))return!1;switch(n){case 0:return!0;case 1:return t.booleanValue===e.booleanValue;case 4:return Ki(t).isEqual(Ki(e));case 3:return function(t,e){if("string"==typeof t.timestampValue&&"string"==typeof e.timestampValue&&t.timestampValue.length===e.timestampValue.length)return t.timestampValue===e.timestampValue;var n=ro(t.timestampValue),r=ro(e.timestampValue);return n.seconds===r.seconds&&n.nanos===r.nanos}(t,e);case 5:return t.stringValue===e.stringValue;case 6:return function(t,e){return oo(t.bytesValue).isEqual(oo(e.bytesValue))}(t,e);case 7:return t.referenceValue===e.referenceValue;case 8:return function(t,e){return io(t.geoPointValue.latitude)===io(e.geoPointValue.latitude)&&io(t.geoPointValue.longitude)===io(e.geoPointValue.longitude)}(t,e);case 2:return function(t,e){if("integerValue"in t&&"integerValue"in e)return io(t.integerValue)===io(e.integerValue);if("doubleValue"in t&&"doubleValue"in e){var n=io(t.doubleValue),r=io(e.doubleValue);return n===r?ii(n)===ii(r):isNaN(n)&&isNaN(r)}return!1}(t,e);case 9:return Qr(t.arrayValue.values||[],e.arrayValue.values||[],Ji);case 10:return function(t,e){var n=t.mapValue.fields||{},r=e.mapValue.fields||{};if(zi(n)!==zi(r))return!1;for(var i in n)if(n.hasOwnProperty(i)&&(void 0===r[i]||!Ji(n[i],r[i])))return!1;return!0}(t,e);default:return Dr()}}function Zi(t,e){return void 0!==(t.values||[]).find((function(t){return Ji(t,e)}))}function to(t,e){var n=Yi(t),r=Yi(e);if(n!==r)return Gr(n,r);switch(n){case 0:return 0;case 1:return Gr(t.booleanValue,e.booleanValue);case 2:return function(t,e){var n=io(t.integerValue||t.doubleValue),r=io(e.integerValue||e.doubleValue);return n<r?-1:n>r?1:n===r?0:isNaN(n)?isNaN(r)?0:-1:1}(t,e);case 3:return eo(t.timestampValue,e.timestampValue);case 4:return eo(Ki(t),Ki(e));case 5:return Gr(t.stringValue,e.stringValue);case 6:return function(t,e){var n=oo(t),r=oo(e);return n.F(r)}(t.bytesValue,e.bytesValue);case 7:return function(t,e){for(var n=t.split("/"),r=e.split("/"),i=0;i<n.length&&i<r.length;i++){var o=Gr(n[i],r[i]);if(0!==o)return o}return Gr(n.length,r.length)}(t.referenceValue,e.referenceValue);case 8:return function(t,e){var n=Gr(io(t.latitude),io(e.latitude));return 0!==n?n:Gr(io(t.longitude),io(e.longitude))}(t.geoPointValue,e.geoPointValue);case 9:return function(t,e){for(var n=t.values||[],r=e.values||[],i=0;i<n.length&&i<r.length;++i){var o=to(n[i],r[i]);if(o)return o}return Gr(n.length,r.length)}(t.arrayValue,e.arrayValue);case 10:return function(t,e){var n=t.fields||{},r=Object.keys(n),i=e.fields||{},o=Object.keys(i);r.sort(),o.sort();for(var s=0;s<r.length&&s<o.length;++s){var a=Gr(r[s],o[s]);if(0!==a)return a;var u=to(n[r[s]],i[o[s]]);if(0!==u)return u}return Gr(r.length,o.length)}(t.mapValue,e.mapValue);default:throw Dr()}}function eo(t,e){if("string"==typeof t&&"string"==typeof e&&t.length===e.length)return Gr(t,e);var n=ro(t),r=ro(e),i=Gr(n.seconds,r.seconds);return 0!==i?i:Gr(n.nanos,r.nanos)}function no(t){return function t(e){return"nullValue"in e?"null":"booleanValue"in e?""+e.booleanValue:"integerValue"in e?""+e.integerValue:"doubleValue"in e?""+e.doubleValue:"timestampValue"in e?function(t){var e=ro(t);return"time("+e.seconds+","+e.nanos+")"}(e.timestampValue):"stringValue"in e?e.stringValue:"bytesValue"in e?oo(e.bytesValue).toBase64():"referenceValue"in e?ni.it(e.referenceValue).toString():"geoPointValue"in e?"geo("+(n=e.geoPointValue).latitude+","+n.longitude+")":"arrayValue"in e?function(e){for(var n="[",r=!0,i=0,o=e.values||[];i<o.length;i++)r?r=!1:n+=",",n+=t(o[i]);return n+"]"}(e.arrayValue):"mapValue"in e?function(e){for(var n="{",r=!0,i=0,o=Object.keys(e.fields||{}).sort();i<o.length;i++){var s=o[i];r?r=!1:n+=",",n+=s+":"+t(e.fields[s])}return n+"}"}(e.mapValue):Dr();var n}(t)}function ro(t){if(Lr(!!t),"string"==typeof t){var e=0,n=Xi.exec(t);if(Lr(!!n),n[1]){var r=n[1];r=(r+"000000000").substr(0,9),e=Number(r)}var i=new Date(t);return{seconds:Math.floor(i.getTime()/1e3),nanos:e}}return{seconds:io(t.seconds),nanos:io(t.nanos)}}function io(t){return"number"==typeof t?t:"string"==typeof t?Number(t):0}function oo(t){return"string"==typeof t?hi.fromBase64String(t):hi.fromUint8Array(t)}function so(t,e){return{referenceValue:"projects/"+t.projectId+"/databases/"+t.database+"/documents/"+e.path.J()}}function ao(t){return!!t&&"integerValue"in t}function uo(t){return!!t&&"arrayValue"in t}function co(t){return!!t&&"nullValue"in t}function lo(t){return!!t&&"doubleValue"in t&&isNaN(Number(t.doubleValue))}function ho(t){return!!t&&"mapValue"in t}var fo={asc:"ASCENDING",desc:"DESCENDING"},po={"<":"LESS_THAN","<=":"LESS_THAN_OR_EQUAL",">":"GREATER_THAN",">=":"GREATER_THAN_OR_EQUAL","==":"EQUAL","!=":"NOT_EQUAL","array-contains":"ARRAY_CONTAINS",in:"IN","not-in":"NOT_IN","array-contains-any":"ARRAY_CONTAINS_ANY"},go=function(t,e){this.t=t,this.tn=e};function yo(t){return{integerValue:""+t}}function vo(t,e){if(t.tn){if(isNaN(e))return{doubleValue:"NaN"};if(e===1/0)return{doubleValue:"Infinity"};if(e===-1/0)return{doubleValue:"-Infinity"}}return{doubleValue:ii(e)?"-0":e}}function mo(t,e){return oi(e)?yo(e):vo(t,e)}function bo(t,e){return t.tn?new Date(1e3*e.seconds).toISOString().replace(/\.\d*/,"").replace("Z","")+"."+("000000000"+e.nanoseconds).slice(-9)+"Z":{seconds:""+e.seconds,nanos:e.nanoseconds}}function _o(t,e){return t.tn?e.toBase64():e.toUint8Array()}function wo(t,e){return bo(t,e.M())}function Eo(t){return Lr(!!t),Yr.N(function(t){var e=ro(t);return new Xr(e.seconds,e.nanos)}(t))}function Oo(t,e){return function(t){return new Zr(["projects",t.projectId,"databases",t.database])}(t).child("documents").child(e).J()}function Co(t){var e=Zr.Y(t);return Lr(Wo(e)),e}function To(t,e){return Oo(t.t,e.path)}function So(t,e){var n=Co(e);if(n.get(1)!==t.t.projectId)throw new Ur(Fr.INVALID_ARGUMENT,"Tried to deserialize key from different project: "+n.get(1)+" vs "+t.t.projectId);if(n.get(3)!==t.t.database)throw new Ur(Fr.INVALID_ARGUMENT,"Tried to deserialize key from different database: "+n.get(3)+" vs "+t.t.database);return new ni(Ao(n))}function Io(t,e){return Oo(t.t,e)}function jo(t){var e=Co(t);return 4===e.length?Zr.X():Ao(e)}function xo(t){return new Zr(["projects",t.t.projectId,"databases",t.t.database]).J()}function Ao(t){return Lr(t.length>4&&"documents"===t.get(4)),t.B(5)}function ko(t,e,n){return{name:To(t,e),fields:n.proto.mapValue.fields}}function No(t,e){var n;if(e instanceof ys)n={update:ko(t,e.key,e.value)};else if(e instanceof Es)n={delete:To(t,e.key)};else if(e instanceof vs)n={update:ko(t,e.key,e.data),updateMask:zo(e.en)};else if(e instanceof bs)n={transform:{document:To(t,e.key),fieldTransforms:e.fieldTransforms.map((function(t){return function(t,e){var n=e.transform;if(n instanceof Yo)return{fieldPath:e.field.J(),setToServerValue:"REQUEST_TIME"};if(n instanceof Jo)return{fieldPath:e.field.J(),appendMissingElements:{values:n.elements}};if(n instanceof ts)return{fieldPath:e.field.J(),removeAllFromArray:{values:n.elements}};if(n instanceof ns)return{fieldPath:e.field.J(),increment:n.nn};throw Dr()}(0,t)}))}};else{if(!(e instanceof Os))return Dr();n={verify:To(t,e.key)}}return e.rn.sn||(n.currentDocument=function(t,e){return void 0!==e.updateTime?{updateTime:wo(t,e.updateTime)}:void 0!==e.exists?{exists:e.exists}:Dr()}(t,e.rn)),n}function Ro(t,e){var n=e.currentDocument?function(t){return void 0!==t.updateTime?us.updateTime(Eo(t.updateTime)):void 0!==t.exists?us.exists(t.exists):us.on()}(e.currentDocument):us.on();if(e.update){var r=So(t,e.update.name),i=new Cs({mapValue:{fields:e.update.fields}});if(e.updateMask){var o=function(t){return new os((t.fieldPaths||[]).map((function(t){return ei.nt(t)})))}(e.updateMask);return new vs(r,i,o,n)}return new ys(r,i,n)}if(e.delete){var s=So(t,e.delete);return new Es(s,n)}if(e.transform){var a=So(t,e.transform.document),u=e.transform.fieldTransforms.map((function(e){return function(t,e){var n=null;"setToServerValue"in e?(Lr("REQUEST_TIME"===e.setToServerValue),n=new Yo):"appendMissingElements"in e?n=new Jo(e.appendMissingElements.values||[]):"removeAllFromArray"in e?n=new ts(e.removeAllFromArray.values||[]):"increment"in e?n=new ns(t,e.increment):Dr();var r=ei.nt(e.fieldPath);return new ss(r,n)}(t,e)}));return Lr(!0===n.exists),new bs(a,u)}if(e.verify){var c=So(t,e.verify);return new Os(c,n)}return Dr()}function Po(t,e){return{documents:[Io(t,e.path)]}}function Do(t,e){var n={structuredQuery:{}},r=e.path;null!==e.collectionGroup?(n.parent=Io(t,r),n.structuredQuery.from=[{collectionId:e.collectionGroup,allDescendants:!0}]):(n.parent=Io(t,r.q()),n.structuredQuery.from=[{collectionId:r.K()}]);var i=function(t){if(0!==t.length){var e=t.map((function(t){return function(t){if("=="===t.op){if(lo(t.value))return{unaryFilter:{field:Vo(t.field),op:"IS_NAN"}};if(co(t.value))return{unaryFilter:{field:Vo(t.field),op:"IS_NULL"}}}else if("!="===t.op){if(lo(t.value))return{unaryFilter:{field:Vo(t.field),op:"IS_NOT_NAN"}};if(co(t.value))return{unaryFilter:{field:Vo(t.field),op:"IS_NOT_NULL"}}}return{fieldFilter:{field:Vo(t.field),op:$o(t.op),value:t.value}}}(t)}));return 1===e.length?e[0]:{compositeFilter:{op:"AND",filters:e}}}}(e.filters);i&&(n.structuredQuery.where=i);var o=function(t){if(0!==t.length)return t.map((function(t){return function(t){return{field:Vo(t.field),direction:Uo(t.dir)}}(t)}))}(e.orderBy);o&&(n.structuredQuery.orderBy=o);var s=function(t,e){return t.tn||ri(e)?e:{value:e}}(t,e.limit);return null!==s&&(n.structuredQuery.limit=s),e.startAt&&(n.structuredQuery.startAt=Mo(e.startAt)),e.endAt&&(n.structuredQuery.endAt=Mo(e.endAt)),n}function Lo(t){var e=jo(t.parent),n=t.structuredQuery,r=n.from?n.from.length:0,i=null;if(r>0){Lr(1===r);var o=n.from[0];o.allDescendants?i=o.collectionId:e=e.child(o.collectionId)}var s=[];n.where&&(s=function t(e){return e?void 0!==e.unaryFilter?[Bo(e)]:void 0!==e.fieldFilter?[Ho(e)]:void 0!==e.compositeFilter?e.compositeFilter.filters.map((function(e){return t(e)})).reduce((function(t,e){return t.concat(e)})):Dr():[]}(n.where));var a=[];n.orderBy&&(a=n.orderBy.map((function(t){return function(t){return new sa(qo(t.field),function(t){switch(t){case"ASCENDING":return"asc";case"DESCENDING":return"desc";default:return}}(t.direction))}(t)})));var u=null;n.limit&&(u=function(t){var e;return ri(e="object"==typeof t?t.value:t)?null:e}(n.limit));var c=null;n.startAt&&(c=Fo(n.startAt));var l=null;return n.endAt&&(l=Fo(n.endAt)),Ns(e,i,a,s,u,"F",c,l)}function Mo(t){return{before:t.before,values:t.position}}function Fo(t){return new na(t.values||[],!!t.before)}function Uo(t){return fo[t]}function $o(t){return po[t]}function Vo(t){return{fieldPath:t.J()}}function qo(t){return ei.nt(t.fieldPath)}function Ho(t){return Gs.create(qo(t.fieldFilter.field),function(t){switch(t){case"EQUAL":return"==";case"NOT_EQUAL":return"!=";case"GREATER_THAN":return">";case"GREATER_THAN_OR_EQUAL":return">=";case"LESS_THAN":return"<";case"LESS_THAN_OR_EQUAL":return"<=";case"ARRAY_CONTAINS":return"array-contains";case"IN":return"in";case"NOT_IN":return"not-in";case"ARRAY_CONTAINS_ANY":return"array-contains-any";case"OPERATOR_UNSPECIFIED":default:return Dr()}}(t.fieldFilter.op),t.fieldFilter.value)}function Bo(t){switch(t.unaryFilter.op){case"IS_NAN":var e=qo(t.unaryFilter.field);return Gs.create(e,"==",{doubleValue:NaN});case"IS_NULL":var n=qo(t.unaryFilter.field);return Gs.create(n,"==",{nullValue:"NULL_VALUE"});case"IS_NOT_NAN":var r=qo(t.unaryFilter.field);return Gs.create(r,"!=",{doubleValue:NaN});case"IS_NOT_NULL":var i=qo(t.unaryFilter.field);return Gs.create(i,"!=",{nullValue:"NULL_VALUE"});case"OPERATOR_UNSPECIFIED":default:return Dr()}}function zo(t){var e=[];return t.fields.forEach((function(t){return e.push(t.J())})),{fieldPaths:e}}function Wo(t){return t.length>=4&&"projects"===t.get(0)&&"databases"===t.get(2)}var Go=function(){this.cn=void 0};function Qo(t,e,n){return t instanceof Yo?function(t,e){var n={fields:{__type__:{stringValue:"server_timestamp"},__local_write_time__:{timestampValue:{seconds:t.seconds,nanos:t.nanoseconds}}}};return e&&(n.fields.__previous_value__=e),{mapValue:n}}(n,e):t instanceof Jo?Zo(t,e):t instanceof ts?es(t,e):function(t,e){var n=Xo(t,e),r=rs(n)+rs(t.nn);return ao(n)&&ao(t.nn)?yo(r):vo(t.serializer,r)}(t,e)}function Ko(t,e,n){return t instanceof Jo?Zo(t,e):t instanceof ts?es(t,e):n}function Xo(t,e){return t instanceof ns?ao(n=e)||function(t){return!!t&&"doubleValue"in t}(n)?e:{integerValue:0}:null;var n}var Yo=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(w.d)(e,t),e}(Go),Jo=function(t){function e(e){var n=this;return(n=t.call(this)||this).elements=e,n}return Object(w.d)(e,t),e}(Go);function Zo(t,e){for(var n=is(e),r=function(t){n.some((function(e){return Ji(e,t)}))||n.push(t)},i=0,o=t.elements;i<o.length;i++)r(o[i]);return{arrayValue:{values:n}}}var ts=function(t){function e(e){var n=this;return(n=t.call(this)||this).elements=e,n}return Object(w.d)(e,t),e}(Go);function es(t,e){for(var n=is(e),r=function(t){n=n.filter((function(e){return!Ji(e,t)}))},i=0,o=t.elements;i<o.length;i++)r(o[i]);return{arrayValue:{values:n}}}var ns=function(t){function e(e,n){var r=this;return(r=t.call(this)||this).serializer=e,r.nn=n,r}return Object(w.d)(e,t),e}(Go);function rs(t){return io(t.integerValue||t.doubleValue)}function is(t){return uo(t)&&t.arrayValue.values?t.arrayValue.values.slice():[]}var os=function(){function t(t){this.fields=t,t.sort(ei.$)}return t.prototype.un=function(t){for(var e=0,n=this.fields;e<n.length;e++)if(n[e].j(t))return!0;return!1},t.prototype.isEqual=function(t){return Qr(this.fields,t.fields,(function(t,e){return t.isEqual(e)}))},t}(),ss=function(t,e){this.field=t,this.transform=e},as=function(t,e){this.version=t,this.transformResults=e},us=function(){function t(t,e){this.updateTime=t,this.exists=e}return t.on=function(){return new t},t.exists=function(e){return new t(void 0,e)},t.updateTime=function(e){return new t(e)},Object.defineProperty(t.prototype,"sn",{get:function(){return void 0===this.updateTime&&void 0===this.exists},enumerable:!1,configurable:!0}),t.prototype.isEqual=function(t){return this.exists===t.exists&&(this.updateTime?!!t.updateTime&&this.updateTime.isEqual(t.updateTime):!t.updateTime)},t}();function cs(t,e){return void 0!==t.updateTime?e instanceof js&&e.version.isEqual(t.updateTime):void 0===t.exists||t.exists===e instanceof js}var ls=function(){};function hs(t,e,n){return t instanceof ys?function(t,e,n){return new js(t.key,n.version,t.value,{hasCommittedMutations:!0})}(t,0,n):t instanceof vs?function(t,e,n){if(!cs(t.rn,e))return new As(t.key,n.version);var r=ms(t,e);return new js(t.key,n.version,r,{hasCommittedMutations:!0})}(t,e,n):t instanceof bs?function(t,e,n){if(Lr(null!=n.transformResults),!cs(t.rn,e))return new As(t.key,n.version);var r=_s(0,e),i=function(t,e,n){var r=[];Lr(t.length===n.length);for(var i=0;i<n.length;i++){var o=t[i],s=o.transform,a=null;e instanceof js&&(a=e.field(o.field)),r.push(Ko(s,a,n[i]))}return r}(t.fieldTransforms,e,n.transformResults),o=n.version,s=ws(t,r.data(),i);return new js(t.key,o,s,{hasCommittedMutations:!0})}(t,e,n):function(t,e,n){return new xs(t.key,n.version,{hasCommittedMutations:!0})}(t,0,n)}function ds(t,e,n,r){return t instanceof ys?function(t,e){if(!cs(t.rn,e))return e;var n=gs(e);return new js(t.key,n,t.value,{an:!0})}(t,e):t instanceof vs?function(t,e){if(!cs(t.rn,e))return e;var n=gs(e),r=ms(t,e);return new js(t.key,n,r,{an:!0})}(t,e):t instanceof bs?function(t,e,n,r){if(!cs(t.rn,e))return e;var i=_s(0,e),o=function(t,e,n,r){for(var i=[],o=0,s=t;o<s.length;o++){var a=s[o],u=a.transform,c=null;n instanceof js&&(c=n.field(a.field)),null===c&&r instanceof js&&(c=r.field(a.field)),i.push(Qo(u,c,e))}return i}(t.fieldTransforms,n,e,r),s=ws(t,i.data(),o);return new js(t.key,i.version,s,{an:!0})}(t,e,r,n):function(t,e){return cs(t.rn,e)?new xs(t.key,Yr.min()):e}(t,e)}function fs(t,e){return t instanceof bs?function(t,e){for(var n=null,r=0,i=t.fieldTransforms;r<i.length;r++){var o=i[r],s=e instanceof js?e.field(o.field):void 0,a=Xo(o.transform,s||null);null!=a&&(n=null==n?(new Ts).set(o.field,a):n.set(o.field,a))}return n?n.hn():null}(t,e):null}function ps(t,e){return t.type===e.type&&!!t.key.isEqual(e.key)&&!!t.rn.isEqual(e.rn)&&(0===t.type?t.value.isEqual(e.value):1===t.type?t.data.isEqual(e.data)&&t.en.isEqual(e.en):2!==t.type||Qr(t.fieldTransforms,t.fieldTransforms,(function(t,e){return function(t,e){return t.field.isEqual(e.field)&&function(t,e){return t instanceof Jo&&e instanceof Jo||t instanceof ts&&e instanceof ts?Qr(t.elements,e.elements,Ji):t instanceof ns&&e instanceof ns?Ji(t.nn,e.nn):t instanceof Yo&&e instanceof Yo}(t.transform,e.transform)}(t,e)})))}function gs(t){return t instanceof js?t.version:Yr.min()}var ys=function(t){function e(e,n,r){var i=this;return(i=t.call(this)||this).key=e,i.value=n,i.rn=r,i.type=0,i}return Object(w.d)(e,t),e}(ls),vs=function(t){function e(e,n,r,i){var o=this;return(o=t.call(this)||this).key=e,o.data=n,o.en=r,o.rn=i,o.type=1,o}return Object(w.d)(e,t),e}(ls);function ms(t,e){return function(t,e){var n=new Ts(e);return t.en.fields.forEach((function(e){if(!e.W()){var r=t.data.field(e);null!==r?n.set(e,r):n.delete(e)}})),n.hn()}(t,e instanceof js?e.data():Cs.empty())}var bs=function(t){function e(e,n){var r=this;return(r=t.call(this)||this).key=e,r.fieldTransforms=n,r.type=2,r.rn=us.exists(!0),r}return Object(w.d)(e,t),e}(ls);function _s(t,e){return e}function ws(t,e,n){for(var r=new Ts(e),i=0;i<t.fieldTransforms.length;i++)r.set(t.fieldTransforms[i].field,n[i]);return r.hn()}var Es=function(t){function e(e,n){var r=this;return(r=t.call(this)||this).key=e,r.rn=n,r.type=3,r}return Object(w.d)(e,t),e}(ls),Os=function(t){function e(e,n){var r=this;return(r=t.call(this)||this).key=e,r.rn=n,r.type=4,r}return Object(w.d)(e,t),e}(ls),Cs=function(){function t(t){this.proto=t}return t.empty=function(){return new t({mapValue:{}})},t.prototype.field=function(t){if(t.W())return this.proto;for(var e=this.proto,n=0;n<t.length-1;++n){if(!e.mapValue.fields)return null;if(!ho(e=e.mapValue.fields[t.get(n)]))return null}return(e=(e.mapValue.fields||{})[t.K()])||null},t.prototype.isEqual=function(t){return Ji(this.proto,t.proto)},t}(),Ts=function(){function t(t){void 0===t&&(t=Cs.empty()),this.ln=t,this._n=new Map}return t.prototype.set=function(t,e){return this.fn(t,e),this},t.prototype.delete=function(t){return this.fn(t,null),this},t.prototype.fn=function(t,e){for(var n=this._n,r=0;r<t.length-1;++r){var i=t.get(r),o=n.get(i);o instanceof Map?n=o:o&&10===Yi(o)?(o=new Map(Object.entries(o.mapValue.fields||{})),n.set(i,o),n=o):(o=new Map,n.set(i,o),n=o)}n.set(t.K(),e)},t.prototype.hn=function(){var t=this.dn(ei.X(),this._n);return null!=t?new Cs(t):this.ln},t.prototype.dn=function(t,e){var n=this,r=!1,i=this.ln.field(t),o=ho(i)?Object.assign({},i.mapValue.fields):{};return e.forEach((function(e,i){if(e instanceof Map){var s=n.dn(t.child(i),e);null!=s&&(o[i]=s,r=!0)}else null!==e?(o[i]=e,r=!0):o.hasOwnProperty(i)&&(delete o[i],r=!0)})),r?{mapValue:{fields:o}}:null},t}();function Ss(t){var e=[];return Wi(t.fields||{},(function(t,n){var r=new ei([t]);if(ho(n)){var i=Ss(n.mapValue).fields;if(0===i.length)e.push(r);else for(var o=0,s=i;o<s.length;o++)e.push(r.child(s[o]))}else e.push(r)})),new os(e)}var Is=function(t,e){this.key=t,this.version=e},js=function(t){function e(e,n,r,i){var o=this;return(o=t.call(this,e,n)||this).wn=r,o.an=!!i.an,o.hasCommittedMutations=!!i.hasCommittedMutations,o}return Object(w.d)(e,t),e.prototype.field=function(t){return this.wn.field(t)},e.prototype.data=function(){return this.wn},e.prototype.En=function(){return this.wn.proto},e.prototype.isEqual=function(t){return t instanceof e&&this.key.isEqual(t.key)&&this.version.isEqual(t.version)&&this.an===t.an&&this.hasCommittedMutations===t.hasCommittedMutations&&this.wn.isEqual(t.wn)},e.prototype.toString=function(){return"Document("+this.key+", "+this.version+", "+this.wn.toString()+", {hasLocalMutations: "+this.an+"}), {hasCommittedMutations: "+this.hasCommittedMutations+"})"},Object.defineProperty(e.prototype,"hasPendingWrites",{get:function(){return this.an||this.hasCommittedMutations},enumerable:!1,configurable:!0}),e}(Is),xs=function(t){function e(e,n,r){var i=this;return(i=t.call(this,e,n)||this).hasCommittedMutations=!(!r||!r.hasCommittedMutations),i}return Object(w.d)(e,t),e.prototype.toString=function(){return"NoDocument("+this.key+", "+this.version+")"},Object.defineProperty(e.prototype,"hasPendingWrites",{get:function(){return this.hasCommittedMutations},enumerable:!1,configurable:!0}),e.prototype.isEqual=function(t){return t instanceof e&&t.hasCommittedMutations===this.hasCommittedMutations&&t.version.isEqual(this.version)&&t.key.isEqual(this.key)},e}(Is),As=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(w.d)(e,t),e.prototype.toString=function(){return"UnknownDocument("+this.key+", "+this.version+")"},Object.defineProperty(e.prototype,"hasPendingWrites",{get:function(){return!0},enumerable:!1,configurable:!0}),e.prototype.isEqual=function(t){return t instanceof e&&t.version.isEqual(this.version)&&t.key.isEqual(this.key)},e}(Is),ks=function(t,e,n,r,i,o,s,a){void 0===e&&(e=null),void 0===n&&(n=[]),void 0===r&&(r=[]),void 0===i&&(i=null),void 0===o&&(o="F"),void 0===s&&(s=null),void 0===a&&(a=null),this.path=t,this.collectionGroup=e,this.Tn=n,this.filters=r,this.limit=i,this.limitType=o,this.startAt=s,this.endAt=a,this.In=null,this.mn=null};function Ns(t,e,n,r,i,o,s,a){return new ks(t,e,n,r,i,o,s,a)}function Rs(t){return new ks(t)}function Ps(t){return!ri(t.limit)&&"F"===t.limitType}function Ds(t){return!ri(t.limit)&&"L"===t.limitType}function Ls(t){return t.Tn.length>0?t.Tn[0].field:null}function Ms(t){for(var e=0,n=t.filters;e<n.length;e++){var r=n[e];if(r.An())return r.field}return null}function Fs(t){return null!==t.collectionGroup}function Us(t){var e=Mr(t);if(null===e.In){e.In=[];var n=Ms(e),r=Ls(e);if(null!==n&&null===r)n.tt()||e.In.push(new sa(n)),e.In.push(new sa(ei.et(),"asc"));else{for(var i=!1,o=0,s=e.Tn;o<s.length;o++){var a=s[o];e.In.push(a),a.field.tt()&&(i=!0)}if(!i){var u=e.Tn.length>0?e.Tn[e.Tn.length-1].dir:"asc";e.In.push(new sa(ei.et(),u))}}}return e.In}function $s(t){var e=Mr(t);if(!e.mn)if("F"===e.limitType)e.mn=ai(e.path,e.collectionGroup,Us(e),e.filters,e.limit,e.startAt,e.endAt);else{for(var n=[],r=0,i=Us(e);r<i.length;r++){var o=i[r];n.push(new sa(o.field,"desc"===o.dir?"asc":"desc"))}var s=e.endAt?new na(e.endAt.position,!e.endAt.before):null,a=e.startAt?new na(e.startAt.position,!e.startAt.before):null;e.mn=ai(e.path,e.collectionGroup,n,e.filters,e.limit,s,a)}return e.mn}function Vs(t,e,n){return new ks(t.path,t.collectionGroup,t.Tn.slice(),t.filters.slice(),e,n,t.startAt,t.endAt)}function qs(t,e){return ci($s(t),$s(e))&&t.limitType===e.limitType}function Hs(t){return ui($s(t))+"|lt:"+t.limitType}function Bs(t){return"Query(target="+function(t){var e=t.path.J();return null!==t.collectionGroup&&(e+=" collectionGroup="+t.collectionGroup),t.filters.length>0&&(e+=", filters: ["+t.filters.map((function(t){return(e=t).field.J()+" "+e.op+" "+no(e.value);var e})).join(", ")+"]"),ri(t.limit)||(e+=", limit: "+t.limit),t.orderBy.length>0&&(e+=", orderBy: ["+t.orderBy.map((function(t){return function(t){return t.field.J()+" ("+t.dir+")"}(t)})).join(", ")+"]"),t.startAt&&(e+=", startAt: "+ra(t.startAt)),t.endAt&&(e+=", endAt: "+ra(t.endAt)),"Target("+e+")"}($s(t))+"; limitType="+t.limitType+")"}function zs(t,e){return function(t,e){var n=e.key.path;return null!==t.collectionGroup?e.key.rt(t.collectionGroup)&&t.path.j(n):ni.ot(t.path)?t.path.isEqual(n):t.path.G(n)}(t,e)&&function(t,e){for(var n=0,r=t.Tn;n<r.length;n++){var i=r[n];if(!i.field.tt()&&null===e.field(i.field))return!1}return!0}(t,e)&&function(t,e){for(var n=0,r=t.filters;n<r.length;n++)if(!r[n].matches(e))return!1;return!0}(t,e)&&function(t,e){return!(t.startAt&&!ia(t.startAt,Us(t),e)||t.endAt&&ia(t.endAt,Us(t),e))}(t,e)}function Ws(t){return function(e,n){for(var r=!1,i=0,o=Us(t);i<o.length;i++){var s=o[i],a=aa(s,e,n);if(0!==a)return a;r=r||s.field.tt()}return 0}}var Gs=function(t){function e(e,n,r){var i=this;return(i=t.call(this)||this).field=e,i.op=n,i.value=r,i}return Object(w.d)(e,t),e.create=function(t,n,r){return t.tt()?"in"===n||"not-in"===n?this.Rn(t,n,r):new Qs(t,n,r):"array-contains"===n?new Js(t,r):"in"===n?new Zs(t,r):"not-in"===n?new ta(t,r):"array-contains-any"===n?new ea(t,r):new e(t,n,r)},e.Rn=function(t,e,n){return"in"===e?new Ks(t,n):new Xs(t,n)},e.prototype.matches=function(t){var e=t.field(this.field);return"!="===this.op?null!==e&&this.Pn(to(e,this.value)):null!==e&&Yi(this.value)===Yi(e)&&this.Pn(to(e,this.value))},e.prototype.Pn=function(t){switch(this.op){case"<":return t<0;case"<=":return t<=0;case"==":return 0===t;case"!=":return 0!==t;case">":return t>0;case">=":return t>=0;default:return Dr()}},e.prototype.An=function(){return["<","<=",">",">=","!=","not-in"].indexOf(this.op)>=0},e}((function(){})),Qs=function(t){function e(e,n,r){var i=this;return(i=t.call(this,e,n,r)||this).key=ni.it(r.referenceValue),i}return Object(w.d)(e,t),e.prototype.matches=function(t){var e=ni.$(t.key,this.key);return this.Pn(e)},e}(Gs),Ks=function(t){function e(e,n){var r=this;return(r=t.call(this,e,"in",n)||this).keys=Ys(0,n),r}return Object(w.d)(e,t),e.prototype.matches=function(t){return this.keys.some((function(e){return e.isEqual(t.key)}))},e}(Gs),Xs=function(t){function e(e,n){var r=this;return(r=t.call(this,e,"not-in",n)||this).keys=Ys(0,n),r}return Object(w.d)(e,t),e.prototype.matches=function(t){return!this.keys.some((function(e){return e.isEqual(t.key)}))},e}(Gs);function Ys(t,e){var n;return((null===(n=e.arrayValue)||void 0===n?void 0:n.values)||[]).map((function(t){return ni.it(t.referenceValue)}))}var Js=function(t){function e(e,n){return t.call(this,e,"array-contains",n)||this}return Object(w.d)(e,t),e.prototype.matches=function(t){var e=t.field(this.field);return uo(e)&&Zi(e.arrayValue,this.value)},e}(Gs),Zs=function(t){function e(e,n){return t.call(this,e,"in",n)||this}return Object(w.d)(e,t),e.prototype.matches=function(t){var e=t.field(this.field);return null!==e&&Zi(this.value.arrayValue,e)},e}(Gs),ta=function(t){function e(e,n){return t.call(this,e,"not-in",n)||this}return Object(w.d)(e,t),e.prototype.matches=function(t){if(Zi(this.value.arrayValue,{nullValue:"NULL_VALUE"}))return!1;var e=t.field(this.field);return null!==e&&!Zi(this.value.arrayValue,e)},e}(Gs),ea=function(t){function e(e,n){return t.call(this,e,"array-contains-any",n)||this}return Object(w.d)(e,t),e.prototype.matches=function(t){var e=this,n=t.field(this.field);return!(!uo(n)||!n.arrayValue.values)&&n.arrayValue.values.some((function(t){return Zi(e.value.arrayValue,t)}))},e}(Gs),na=function(t,e){this.position=t,this.before=e};function ra(t){return(t.before?"b":"a")+":"+t.position.map((function(t){return no(t)})).join(",")}function ia(t,e,n){for(var r=0,i=0;i<t.position.length;i++){var o=e[i],s=t.position[i];if(r=o.field.tt()?ni.$(ni.it(s.referenceValue),n.key):to(s,n.field(o.field)),"desc"===o.dir&&(r*=-1),0!==r)break}return t.before?r<=0:r<0}function oa(t,e){if(null===t)return null===e;if(null===e)return!1;if(t.before!==e.before||t.position.length!==e.position.length)return!1;for(var n=0;n<t.position.length;n++)if(!Ji(t.position[n],e.position[n]))return!1;return!0}var sa=function(t,e){void 0===e&&(e="asc"),this.field=t,this.dir=e};function aa(t,e,n){var r=t.field.tt()?ni.$(e.key,n.key):function(t,e,n){var r=e.field(t),i=n.field(t);return null!==r&&null!==i?to(r,i):Dr()}(t.field,e,n);switch(t.dir){case"asc":return r;case"desc":return-1*r;default:return Dr()}}function ua(t,e){return t.dir===e.dir&&t.field.isEqual(e.field)}var ca=function(){function t(t,e,n,r){this.batchId=t,this.gn=e,this.baseMutations=n,this.mutations=r}return t.prototype.yn=function(t,e,n){for(var r=n.Vn,i=0;i<this.mutations.length;i++){var o=this.mutations[i];o.key.isEqual(t)&&(e=hs(o,e,r[i]))}return e},t.prototype.pn=function(t,e){for(var n=0,r=this.baseMutations;n<r.length;n++){var i=r[n];i.key.isEqual(t)&&(e=ds(i,e,e,this.gn))}for(var o=e,s=0,a=this.mutations;s<a.length;s++){var u=a[s];u.key.isEqual(t)&&(e=ds(u,e,o,this.gn))}return e},t.prototype.vn=function(t){var e=this,n=t;return this.mutations.forEach((function(r){var i=e.pn(r.key,t.get(r.key));i&&(n=n.Tt(r.key,i))})),n},t.prototype.keys=function(){return this.mutations.reduce((function(t,e){return t.add(e.key)}),Ai())},t.prototype.isEqual=function(t){return this.batchId===t.batchId&&Qr(this.mutations,t.mutations,(function(t,e){return ps(t,e)}))&&Qr(this.baseMutations,t.baseMutations,(function(t,e){return ps(t,e)}))},t}(),la=function(){function t(t,e,n,r){this.batch=t,this.bn=e,this.Vn=n,this.Sn=r}return t.from=function(e,n,r){Lr(e.mutations.length===r.length);for(var i=ji,o=e.mutations,s=0;s<o.length;s++)i=i.Tt(o[s].key,r[s].version);return new t(e,n,r,i)},t}(),ha=function(){function t(t,e){this.Dn=t,this.Cn=e,this.Nn={}}return t.prototype.get=function(t){var e=this.Dn(t),n=this.Nn[e];if(void 0!==n)for(var r=0,i=n;r<i.length;r++){var o=i[r],s=o[1];if(this.Cn(o[0],t))return s}},t.prototype.has=function(t){return void 0!==this.get(t)},t.prototype.set=function(t,e){var n=this.Dn(t),r=this.Nn[n];if(void 0!==r){for(var i=0;i<r.length;i++)if(this.Cn(r[i][0],t))return void(r[i]=[t,e]);r.push([t,e])}else this.Nn[n]=[[t,e]]},t.prototype.delete=function(t){var e=this.Dn(t),n=this.Nn[e];if(void 0===n)return!1;for(var r=0;r<n.length;r++)if(this.Cn(n[r][0],t))return 1===n.length?delete this.Nn[e]:n.splice(r,1),!0;return!1},t.prototype.forEach=function(t){Wi(this.Nn,(function(e,n){for(var r=0,i=n;r<i.length;r++){var o=i[r];t(o[0],o[1])}}))},t.prototype.W=function(){return Gi(this.Nn)},t}(),da=function(){function t(t){var e=this;this.xn=null,this.Fn=null,this.result=void 0,this.error=void 0,this.On=!1,this.Mn=!1,t((function(t){e.On=!0,e.result=t,e.xn&&e.xn(t)}),(function(t){e.On=!0,e.error=t,e.Fn&&e.Fn(t)}))}return t.prototype.catch=function(t){return this.next(void 0,t)},t.prototype.next=function(e,n){var r=this;return this.Mn&&Dr(),this.Mn=!0,this.On?this.error?this.kn(n,this.error):this.$n(e,this.result):new t((function(t,i){r.xn=function(n){r.$n(e,n).next(t,i)},r.Fn=function(e){r.kn(n,e).next(t,i)}}))},t.prototype.Ln=function(){var t=this;return new Promise((function(e,n){t.next(e,n)}))},t.prototype.Bn=function(e){try{var n=e();return n instanceof t?n:t.resolve(n)}catch(e){return t.reject(e)}},t.prototype.$n=function(e,n){return e?this.Bn((function(){return e(n)})):t.resolve(n)},t.prototype.kn=function(e,n){return e?this.Bn((function(){return e(n)})):t.reject(n)},t.resolve=function(e){return new t((function(t,n){t(e)}))},t.reject=function(e){return new t((function(t,n){n(e)}))},t.qn=function(e){return new t((function(t,n){var r=0,i=0,o=!1;e.forEach((function(e){++r,e.next((function(){++i,o&&i===r&&t()}),(function(t){return n(t)}))})),o=!0,i===r&&t()}))},t.Un=function(e){for(var n=t.resolve(!1),r=function(e){n=n.next((function(n){return n?t.resolve(n):e()}))},i=0,o=e;i<o.length;i++)r(o[i]);return n},t.forEach=function(t,e){var n=this,r=[];return t.forEach((function(t,i){r.push(e.call(n,t,i))})),this.qn(r)},t}(),fa=function(){function t(){this.Qn=new ha((function(t){return t.toString()}),(function(t,e){return t.isEqual(e)})),this.Kn=!1}return t.prototype.Wn=function(t){var e=this.Qn.get(t);return e?e.readTime:Yr.min()},t.prototype.jn=function(t,e){this.Gn(),this.Qn.set(t.key,{zn:t,readTime:e})},t.prototype.Hn=function(t,e){void 0===e&&(e=null),this.Gn(),this.Qn.set(t,{zn:null,readTime:e})},t.prototype.Jn=function(t,e){this.Gn();var n=this.Qn.get(e);return void 0!==n?da.resolve(n.zn):this.Yn(t,e)},t.prototype.getEntries=function(t,e){return this.Xn(t,e)},t.prototype.apply=function(t){return this.Gn(),this.Kn=!0,this.Zn(t)},t.prototype.Gn=function(){},t}(),pa=function(){var t=this;this.promise=new Promise((function(e,n){t.resolve=e,t.reject=n}))};function ga(t){return new go(t,!0)}function ya(t){return function(t,e){if("object"!=typeof t||null===t)return!1;for(var n=t,r=0,i=["next","error","complete"];r<i.length;r++){var o=i[r];if(o in n&&"function"==typeof n[o])return!0}return!1}(t)}var va="The current tab is not in the required state to perform this operation. It might be necessary to refresh the browser tab.",ma=function(){function t(){this.ts=[]}return t.prototype.es=function(t){this.ts.push(t)},t.prototype.ns=function(){this.ts.forEach((function(t){return t()}))},t}(),ba=function(){function t(t,e,n){this.ss=t,this.rs=e,this.os=n}return t.prototype.cs=function(t,e){var n=this;return this.rs.us(t,e).next((function(r){return n.hs(t,e,r)}))},t.prototype.hs=function(t,e,n){return this.ss.Jn(t,e).next((function(t){for(var r=0,i=n;r<i.length;r++)t=i[r].pn(e,t);return t}))},t.prototype.ls=function(t,e,n){var r=Ti();return e.forEach((function(t,e){for(var i=0,o=n;i<o.length;i++)e=o[i].pn(t,e);r=r.Tt(t,e)})),r},t.prototype._s=function(t,e){var n=this;return this.ss.getEntries(t,e).next((function(e){return n.fs(t,e)}))},t.prototype.fs=function(t,e){var n=this;return this.rs.ds(t,e).next((function(r){var i=n.ls(t,e,r),o=Ci();return i.forEach((function(t,e){e||(e=new xs(t,Yr.min())),o=o.Tt(t,e)})),o}))},t.prototype.ws=function(t,e,n){return function(t){return ni.ot(t.path)&&null===t.collectionGroup&&0===t.filters.length}(e)?this.Es(t,e.path):Fs(e)?this.Ts(t,e,n):this.Is(t,e,n)},t.prototype.Es=function(t,e){return this.cs(t,new ni(e)).next((function(t){var e=Ii();return t instanceof js&&(e=e.Tt(t.key,t)),e}))},t.prototype.Ts=function(t,e,n){var r=this,i=e.collectionGroup,o=Ii();return this.os.As(t,i).next((function(s){return da.forEach(s,(function(s){var a=function(t,e){return new ks(e,null,t.Tn.slice(),t.filters.slice(),t.limit,t.limitType,t.startAt,t.endAt)}(e,s.child(i));return r.Is(t,a,n).next((function(t){t.forEach((function(t,e){o=o.Tt(t,e)}))}))})).next((function(){return o}))}))},t.prototype.Is=function(t,e,n){var r,i,o=this;return this.ss.ws(t,e,n).next((function(n){return r=n,o.rs.Rs(t,e)})).next((function(e){return o.Ps(t,i=e,r).next((function(t){r=t;for(var e=0,n=i;e<n.length;e++)for(var o=n[e],s=0,a=o.mutations;s<a.length;s++){var u=a[s],c=u.key,l=r.get(c),h=ds(u,l,l,o.gn);r=h instanceof js?r.Tt(c,h):r.remove(c)}}))})).next((function(){return r.forEach((function(t,n){zs(e,n)||(r=r.remove(t))})),r}))},t.prototype.Ps=function(t,e,n){for(var r=Ai(),i=0,o=e;i<o.length;i++)for(var s=0,a=o[i].mutations;s<a.length;s++){var u=a[s];u instanceof vs&&null===n.get(u.key)&&(r=r.add(u.key))}var c=n;return this.ss.getEntries(t,r).next((function(t){return t.forEach((function(t,e){null!==e&&e instanceof js&&(c=c.Tt(t,e))})),c}))},t}(),_a=function(){function t(t,e,n,r){this.targetId=t,this.fromCache=e,this.gs=n,this.ys=r}return t.Vs=function(e,n){for(var r=Ai(),i=Ai(),o=0,s=n.docChanges;o<s.length;o++){var a=s[o];switch(a.type){case 0:r=r.add(a.doc.key);break;case 1:i=i.add(a.doc.key)}}return new t(e,n.fromCache,r,i)},t}(),wa=function(){function t(t,e){var n=this;this.previousValue=t,e&&(e.ps=function(t){return n.vs(t)},this.bs=function(t){return e.Ss(t)})}return t.prototype.vs=function(t){return this.previousValue=Math.max(t,this.previousValue),this.previousValue},t.prototype.next=function(){var t=++this.previousValue;return this.bs&&this.bs(t),t},t}();wa.Ds=-1;var Ea=function(){function t(t,e,n,r,i){void 0===n&&(n=1e3),void 0===r&&(r=1.5),void 0===i&&(i=6e4),this.Cs=t,this.Ns=e,this.xs=n,this.Fs=r,this.Os=i,this.Ms=0,this.ks=null,this.$s=Date.now(),this.reset()}return t.prototype.reset=function(){this.Ms=0},t.prototype.Ls=function(){this.Ms=this.Os},t.prototype.Bs=function(t){var e=this;this.cancel();var n=Math.floor(this.Ms+this.qs()),r=Math.max(0,Date.now()-this.$s),i=Math.max(0,n-r);i>0&&kr("ExponentialBackoff","Backing off for "+i+" ms (base delay: "+this.Ms+" ms, delay with jitter: "+n+" ms, last attempt: "+r+" ms ago)"),this.ks=this.Cs.Us(this.Ns,i,(function(){return e.$s=Date.now(),t()})),this.Ms*=this.Fs,this.Ms<this.xs&&(this.Ms=this.xs),this.Ms>this.Os&&(this.Ms=this.Os)},t.prototype.Qs=function(){null!==this.ks&&(this.ks.Ks(),this.ks=null)},t.prototype.cancel=function(){null!==this.ks&&(this.ks.cancel(),this.ks=null)},t.prototype.qs=function(){return(Math.random()-.5)*this.Ms},t}(),Oa=function(){function t(e,n,r){this.name=e,this.version=n,this.Ws=r,12.2===t.js(Object(C.n)())&&Nr("Firestore persistence suffers from a bug in iOS 12.2 Safari that may cause your app to stop working. See https://stackoverflow.com/q/56496296/110915 for details and a potential workaround.")}return t.delete=function(t){return kr("SimpleDb","Removing database:",t),xa(window.indexedDB.deleteDatabase(t)).Ln()},t.Gs=function(){if("undefined"==typeof indexedDB)return!1;if(t.zs())return!0;var e=Object(C.n)(),n=t.js(e),r=0<n&&n<10,i=t.Hs(e),o=0<i&&i<4.5;return!(e.indexOf("MSIE ")>0||e.indexOf("Trident/")>0||e.indexOf("Edge/")>0||r||o)},t.zs=function(){var t;return"undefined"!=typeof process&&"YES"===(null===(t=process.env)||void 0===t?void 0:t.Js)},t.Ys=function(t,e){return t.store(e)},t.js=function(t){var e=t.match(/i(?:phone|pad|pod) os ([\d_]+)/i),n=e?e[1].split("_").slice(0,2).join("."):"-1";return Number(n)},t.Hs=function(t){var e=t.match(/Android ([\d.]+)/i),n=e?e[1].split(".").slice(0,2).join("."):"-1";return Number(n)},t.prototype.Xs=function(t){return Object(w.b)(this,void 0,void 0,(function(){var e,n=this;return Object(w.e)(this,(function(r){switch(r.label){case 0:return this.db?[3,2]:(kr("SimpleDb","Opening database:",this.name),e=this,[4,new Promise((function(e,r){var i=indexedDB.open(n.name,n.version);i.onsuccess=function(t){e(t.target.result)},i.onblocked=function(){r(new Ta(t,"Cannot upgrade IndexedDB schema while another tab is open. Close all tabs that access Firestore and reload this page to proceed."))},i.onerror=function(e){var n=e.target.error;r("VersionError"===n.name?new Ur(Fr.FAILED_PRECONDITION,"A newer version of the Firestore SDK was previously used and so the persisted data is not compatible with the version of the SDK you are now using. The SDK will operate with persistence disabled. If you need persistence, please re-upgrade to a newer version of the SDK or else clear the persisted IndexedDB data for your app to start fresh."):new Ta(t,n))},i.onupgradeneeded=function(t){kr("SimpleDb",'Database "'+n.name+'" requires upgrade from version:',t.oldVersion),n.Ws.createOrUpgrade(t.target.result,i.transaction,t.oldVersion,n.version).next((function(){kr("SimpleDb","Database upgrade to version "+n.version+" complete")}))}}))]);case 1:e.db=r.sent(),r.label=2;case 2:return[2,(this.Zs&&(this.db.onversionchange=function(t){return n.Zs(t)}),this.db)]}}))}))},t.prototype.ti=function(t){this.Zs=t,this.db&&(this.db.onversionchange=function(e){return t(e)})},t.prototype.runTransaction=function(t,e,n,r){return Object(w.b)(this,void 0,void 0,(function(){var i,o,s,a,u;return Object(w.e)(this,(function(c){switch(c.label){case 0:i="readonly"===e,o=0,s=function(){var e,s,u,c,l;return Object(w.e)(this,(function(h){switch(h.label){case 0:++o,h.label=1;case 1:return h.trys.push([1,4,,5]),[4,a.Xs(t)];case 2:return a.db=h.sent(),e=Ia.open(a.db,t,i?"readonly":"readwrite",n),s=r(e).catch((function(t){return e.abort(t),da.reject(t)})).Ln(),u={},s.catch((function(){})),[4,e.ei];case 3:return[2,(u.value=(h.sent(),s),u)];case 4:return kr("SimpleDb","Transaction failed with error:",(c=h.sent()).message,"Retrying:",l="FirebaseError"!==c.name&&o<3),a.close(),l?[3,5]:[2,{value:Promise.reject(c)}];case 5:return[2]}}))},a=this,c.label=1;case 1:return[5,s()];case 2:if("object"==typeof(u=c.sent()))return[2,u.value];c.label=3;case 3:return[3,1];case 4:return[2]}}))}))},t.prototype.close=function(){this.db&&this.db.close(),this.db=void 0},t}(),Ca=function(){function t(t){this.ni=t,this.si=!1,this.ii=null}return Object.defineProperty(t.prototype,"On",{get:function(){return this.si},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ri",{get:function(){return this.ii},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cursor",{set:function(t){this.ni=t},enumerable:!1,configurable:!0}),t.prototype.done=function(){this.si=!0},t.prototype.oi=function(t){this.ii=t},t.prototype.delete=function(){return xa(this.ni.delete())},t}(),Ta=function(t){function e(e,n){var r=this;return(r=t.call(this,Fr.UNAVAILABLE,"IndexedDB transaction '"+e+"' failed: "+n)||this).name="IndexedDbTransactionError",r}return Object(w.d)(e,t),e}(Ur);function Sa(t){return"IndexedDbTransactionError"===t.name}var Ia=function(){function t(t,e){var n=this;this.action=t,this.transaction=e,this.aborted=!1,this.ci=new pa,this.transaction.oncomplete=function(){n.ci.resolve()},this.transaction.onabort=function(){e.error?n.ci.reject(new Ta(t,e.error)):n.ci.resolve()},this.transaction.onerror=function(e){var r=ka(e.target.error);n.ci.reject(new Ta(t,r))}}return t.open=function(e,n,r,i){try{return new t(n,e.transaction(i,r))}catch(e){throw new Ta(n,e)}},Object.defineProperty(t.prototype,"ei",{get:function(){return this.ci.promise},enumerable:!1,configurable:!0}),t.prototype.abort=function(t){t&&this.ci.reject(t),this.aborted||(kr("SimpleDb","Aborting transaction:",t?t.message:"Client-initiated abort"),this.aborted=!0,this.transaction.abort())},t.prototype.store=function(t){var e=this.transaction.objectStore(t);return new ja(e)},t}(),ja=function(){function t(t){this.store=t}return t.prototype.put=function(t,e){var n;return void 0!==e?(kr("SimpleDb","PUT",this.store.name,t,e),n=this.store.put(e,t)):(kr("SimpleDb","PUT",this.store.name,"<auto-key>",t),n=this.store.put(t)),xa(n)},t.prototype.add=function(t){return kr("SimpleDb","ADD",this.store.name,t,t),xa(this.store.add(t))},t.prototype.get=function(t){var e=this;return xa(this.store.get(t)).next((function(n){return void 0===n&&(n=null),kr("SimpleDb","GET",e.store.name,t,n),n}))},t.prototype.delete=function(t){return kr("SimpleDb","DELETE",this.store.name,t),xa(this.store.delete(t))},t.prototype.count=function(){return kr("SimpleDb","COUNT",this.store.name),xa(this.store.count())},t.prototype.ui=function(t,e){var n=this.cursor(this.options(t,e)),r=[];return this.ai(n,(function(t,e){r.push(e)})).next((function(){return r}))},t.prototype.hi=function(t,e){kr("SimpleDb","DELETE ALL",this.store.name);var n=this.options(t,e);n.li=!1;var r=this.cursor(n);return this.ai(r,(function(t,e,n){return n.delete()}))},t.prototype._i=function(t,e){var n;e?n=t:(n={},e=t);var r=this.cursor(n);return this.ai(r,e)},t.prototype.fi=function(t){var e=this.cursor({});return new da((function(n,r){e.onerror=function(t){var e=ka(t.target.error);r(e)},e.onsuccess=function(e){var r=e.target.result;r?t(r.primaryKey,r.value).next((function(t){t?r.continue():n()})):n()}}))},t.prototype.ai=function(t,e){var n=[];return new da((function(r,i){t.onerror=function(t){i(t.target.error)},t.onsuccess=function(t){var i=t.target.result;if(i){var o=new Ca(i),s=e(i.primaryKey,i.value,o);if(s instanceof da){var a=s.catch((function(t){return o.done(),da.reject(t)}));n.push(a)}o.On?r():null===o.ri?i.continue():i.continue(o.ri)}else r()}})).next((function(){return da.qn(n)}))},t.prototype.options=function(t,e){var n=void 0;return void 0!==t&&("string"==typeof t?n=t:e=t),{index:n,range:e}},t.prototype.cursor=function(t){var e="next";if(t.reverse&&(e="prev"),t.index){var n=this.store.index(t.index);return t.li?n.openKeyCursor(t.range,e):n.openCursor(t.range,e)}return this.store.openCursor(t.range,e)},t}();function xa(t){return new da((function(e,n){t.onsuccess=function(t){e(t.target.result)},t.onerror=function(t){var e=ka(t.target.error);n(e)}}))}var Aa=!1;function ka(t){var e=Oa.js(Object(C.n)());if(e>=12.2&&e<13){var n="An internal error was encountered in the Indexed Database server";if(t.message.indexOf(n)>=0){var r=new Ur("internal","IOS_INDEXEDDB_BUG1: IndexedDb has thrown '"+n+"'. This is likely due to an unavoidable bug in iOS. See https://stackoverflow.com/q/56496296/110915 for details and a potential workaround.");return Aa||(Aa=!0,setTimeout((function(){throw r}),0)),r}}return t}function Na(){return"undefined"!=typeof window?window:null}function Ra(){return"undefined"!=typeof document?document:null}var Pa=function(){function t(t,e,n,r,i){this.di=t,this.Ns=e,this.wi=n,this.op=r,this.Ei=i,this.Ti=new pa,this.then=this.Ti.promise.then.bind(this.Ti.promise),this.Ti.promise.catch((function(t){}))}return t.Ii=function(e,n,r,i,o){var s=new t(e,n,Date.now()+r,i,o);return s.start(r),s},t.prototype.start=function(t){var e=this;this.mi=setTimeout((function(){return e.Ai()}),t)},t.prototype.Ks=function(){return this.Ai()},t.prototype.cancel=function(t){null!==this.mi&&(this.clearTimeout(),this.Ti.reject(new Ur(Fr.CANCELLED,"Operation cancelled"+(t?": "+t:""))))},t.prototype.Ai=function(){var t=this;this.di.Ri((function(){return null!==t.mi?(t.clearTimeout(),t.op().then((function(e){return t.Ti.resolve(e)}))):Promise.resolve()}))},t.prototype.clearTimeout=function(){null!==this.mi&&(this.Ei(this),clearTimeout(this.mi),this.mi=null)},t}(),Da=function(){function t(){var t=this;this.Pi=Promise.resolve(),this.gi=[],this.yi=!1,this.Vi=[],this.pi=null,this.vi=!1,this.bi=[],this.Si=new Ea(this,"async_queue_retry"),this.Di=function(){var e=Ra();e&&kr("AsyncQueue","Visibility state changed to "+e.visibilityState),t.Si.Qs()};var e=Ra();e&&"function"==typeof e.addEventListener&&e.addEventListener("visibilitychange",this.Di)}return Object.defineProperty(t.prototype,"Ci",{get:function(){return this.yi},enumerable:!1,configurable:!0}),t.prototype.Ri=function(t){this.enqueue(t)},t.prototype.Ni=function(t){this.xi(),this.Fi(t)},t.prototype.Oi=function(){if(!this.yi){this.yi=!0;var t=Ra();t&&"function"==typeof t.removeEventListener&&t.removeEventListener("visibilitychange",this.Di)}},t.prototype.enqueue=function(t){return this.xi(),this.yi?new Promise((function(t){})):this.Fi(t)},t.prototype.Mi=function(t){var e=this;this.Ri((function(){return e.gi.push(t),e.ki()}))},t.prototype.ki=function(){return Object(w.b)(this,void 0,void 0,(function(){var t,e=this;return Object(w.e)(this,(function(n){switch(n.label){case 0:if(0===this.gi.length)return[3,5];n.label=1;case 1:return n.trys.push([1,3,,4]),[4,this.gi[0]()];case 2:return n.sent(),this.gi.shift(),this.Si.reset(),[3,4];case 3:if(!Sa(t=n.sent()))throw t;return kr("AsyncQueue","Operation failed with retryable error: "+t),[3,4];case 4:this.gi.length>0&&this.Si.Bs((function(){return e.ki()})),n.label=5;case 5:return[2]}}))}))},t.prototype.Fi=function(t){var e=this,n=this.Pi.then((function(){return e.vi=!0,t().catch((function(t){throw e.pi=t,e.vi=!1,Nr("INTERNAL UNHANDLED ERROR: ",function(t){var e=t.message||"";return t.stack&&(e=t.stack.includes(t.message)?t.stack:t.message+"\n"+t.stack),e}(t)),t})).then((function(t){return e.vi=!1,t}))}));return this.Pi=n,n},t.prototype.Us=function(t,e,n){var r=this;this.xi(),this.bi.indexOf(t)>-1&&(e=0);var i=Pa.Ii(this,t,e,n,(function(t){return r.$i(t)}));return this.Vi.push(i),i},t.prototype.xi=function(){this.pi&&Dr()},t.prototype.Li=function(){},t.prototype.Bi=function(){return Object(w.b)(this,void 0,void 0,(function(){var t;return Object(w.e)(this,(function(e){switch(e.label){case 0:return[4,t=this.Pi];case 1:e.sent(),e.label=2;case 2:if(t!==this.Pi)return[3,0];e.label=3;case 3:return[2]}}))}))},t.prototype.qi=function(t){for(var e=0,n=this.Vi;e<n.length;e++)if(n[e].Ns===t)return!0;return!1},t.prototype.Ui=function(t){var e=this;return this.Bi().then((function(){e.Vi.sort((function(t,e){return t.wi-e.wi}));for(var n=0,r=e.Vi;n<r.length;n++){var i=r[n];if(i.Ks(),"all"!==t&&i.Ns===t)break}return e.Bi()}))},t.prototype.Qi=function(t){this.bi.push(t)},t.prototype.$i=function(t){var e=this.Vi.indexOf(t);this.Vi.splice(e,1)},t}();function La(t,e){if(Nr("AsyncQueue",e+": "+t),Sa(t))return new Ur(Fr.UNAVAILABLE,e+": "+t);throw t}function Ma(t,e){var n=t[1],r=e[1],i=Gr(t[0],e[0]);return 0===i?Gr(n,r):i}var Fa=function(){function t(t){this.Ki=t,this.buffer=new wi(Ma),this.Wi=0}return t.prototype.ji=function(){return++this.Wi},t.prototype.Gi=function(t){var e=[t,this.ji()];if(this.buffer.size<this.Ki)this.buffer=this.buffer.add(e);else{var n=this.buffer.last();Ma(e,n)<0&&(this.buffer=this.buffer.delete(n).add(e))}},Object.defineProperty(t.prototype,"maxValue",{get:function(){return this.buffer.last()[0]},enumerable:!1,configurable:!0}),t}(),Ua={zi:!1,Hi:0,Ji:0,Yi:0},$a=function(){function t(t,e,n){this.Xi=t,this.Zi=e,this.tr=n}return t.er=function(e){return new t(e,t.nr,t.sr)},t}();$a.nr=10,$a.sr=1e3,$a.ir=new $a(41943040,$a.nr,$a.sr),$a.rr=new $a(-1,0,0);var Va=function(){function t(t,e){this.cr=t,this.di=e,this.ur=!1,this.ar=null}return t.prototype.start=function(t){-1!==this.cr.params.Xi&&this.hr(t)},t.prototype.stop=function(){this.ar&&(this.ar.cancel(),this.ar=null)},Object.defineProperty(t.prototype,"lr",{get:function(){return null!==this.ar},enumerable:!1,configurable:!0}),t.prototype.hr=function(t){var e=this,n=this.ur?3e5:6e4;kr("LruGarbageCollector","Garbage collection scheduled in "+n+"ms"),this.ar=this.di.Us("lru_garbage_collection",n,(function(){return Object(w.b)(e,void 0,void 0,(function(){var e;return Object(w.e)(this,(function(n){switch(n.label){case 0:this.ar=null,this.ur=!0,n.label=1;case 1:return n.trys.push([1,3,,7]),[4,t._r(this.cr)];case 2:return n.sent(),[3,7];case 3:return Sa(e=n.sent())?(kr("LruGarbageCollector","Ignoring IndexedDB error during garbage collection: ",e),[3,6]):[3,4];case 4:return[4,pc(e)];case 5:n.sent(),n.label=6;case 6:return[3,7];case 7:return[4,this.hr(t)];case 8:return n.sent(),[2]}}))}))}))},t}(),qa=function(){function t(t,e){this.dr=t,this.params=e}return t.prototype.wr=function(t,e){return this.dr.Er(t).next((function(t){return Math.floor(e/100*t)}))},t.prototype.Tr=function(t,e){var n=this;if(0===e)return da.resolve(wa.Ds);var r=new Fa(e);return this.dr.Ue(t,(function(t){return r.Gi(t.sequenceNumber)})).next((function(){return n.dr.Ir(t,(function(t){return r.Gi(t)}))})).next((function(){return r.maxValue}))},t.prototype.mr=function(t,e,n){return this.dr.mr(t,e,n)},t.prototype.Ar=function(t,e){return this.dr.Ar(t,e)},t.prototype.Rr=function(t,e){var n=this;return-1===this.params.Xi?(kr("LruGarbageCollector","Garbage collection skipped; disabled"),da.resolve(Ua)):this.Pr(t).next((function(r){return r<n.params.Xi?(kr("LruGarbageCollector","Garbage collection skipped; Cache size "+r+" is lower than threshold "+n.params.Xi),Ua):n.gr(t,e)}))},t.prototype.Pr=function(t){return this.dr.Pr(t)},t.prototype.gr=function(t,e){var n,r,i,o,s,a,u,c=this,l=Date.now();return this.wr(t,this.params.Zi).next((function(e){return e>c.params.tr?(kr("LruGarbageCollector","Capping sequence numbers to collect down to the maximum of "+c.params.tr+" from "+e),r=c.params.tr):r=e,o=Date.now(),c.Tr(t,r)})).next((function(r){return n=r,s=Date.now(),c.mr(t,n,e)})).next((function(e){return i=e,a=Date.now(),c.Ar(t,n)})).next((function(t){return u=Date.now(),Ar()<=O.a.DEBUG&&kr("LruGarbageCollector","LRU Garbage Collection\n\tCounted targets in "+(o-l)+"ms\n\tDetermined least recently used "+r+" in "+(s-o)+"ms\n\tRemoved "+i+" targets in "+(a-s)+"ms\n\tRemoved "+t+" documents in "+(u-a)+"ms\nTotal Duration: "+(u-l)+"ms"),da.resolve({zi:!0,Hi:r,Ji:i,Yi:t})}))},t}();function Ha(t){for(var e="",n=0;n<t.length;n++)e.length>0&&(e=za(e)),e=Ba(t.get(n),e);return za(e)}function Ba(t,e){for(var n=e,r=t.length,i=0;i<r;i++){var o=t.charAt(i);switch(o){case"\0":n+="\x01\x10";break;case"\x01":n+="\x01\x11";break;default:n+=o}}return n}function za(t){return t+"\x01\x01"}function Wa(t){var e=t.length;if(Lr(e>=2),2===e)return Lr("\x01"===t.charAt(0)&&"\x01"===t.charAt(1)),Zr.X();for(var n=e-2,r=[],i="",o=0;o<e;){var s=t.indexOf("\x01",o);switch((s<0||s>n)&&Dr(),t.charAt(s+1)){case"\x01":var a=t.substring(o,s),u=void 0;0===i.length?u=a:(u=i+=a,i=""),r.push(u);break;case"\x10":i+=t.substring(o,s),i+="\0";break;case"\x11":i+=t.substring(o,s+1);break;default:Dr()}o=s+2}return new Zr(r)}var Ga=function(t){this.yr=t};function Qa(t,e){if(e.document)return function(t,e,n){var r=So(t,e.name),i=Eo(e.updateTime),o=new Cs({mapValue:{fields:e.fields}});return new js(r,i,o,{hasCommittedMutations:!!n})}(t.yr,e.document,!!e.hasCommittedMutations);if(e.noDocument){var n=ni.ct(e.noDocument.path),r=Za(e.noDocument.readTime);return new xs(n,r,{hasCommittedMutations:!!e.hasCommittedMutations})}if(e.unknownDocument){var i=ni.ct(e.unknownDocument.path),o=Za(e.unknownDocument.version);return new As(i,o)}return Dr()}function Ka(t,e,n){var r=Xa(n),i=e.key.path.q().H();if(e instanceof js){var o=function(t,e){return{name:To(t,e.key),fields:e.En().mapValue.fields,updateTime:bo(t,e.version.M())}}(t.yr,e);return new Su(null,null,o,e.hasCommittedMutations,r,i)}if(e instanceof xs){var s=e.key.path.H(),a=Ja(e.version),u=e.hasCommittedMutations;return new Su(null,new Cu(s,a),null,u,r,i)}if(e instanceof As){var c=e.key.path.H(),l=Ja(e.version);return new Su(new Tu(c,l),null,null,!0,r,i)}return Dr()}function Xa(t){var e=t.M();return[e.seconds,e.nanoseconds]}function Ya(t){var e=new Xr(t[0],t[1]);return Yr.N(e)}function Ja(t){var e=t.M();return new bu(e.seconds,e.nanoseconds)}function Za(t){var e=new Xr(t.seconds,t.nanoseconds);return Yr.N(e)}function tu(t,e){var n=(e.baseMutations||[]).map((function(e){return Ro(t.yr,e)})),r=e.mutations.map((function(e){return Ro(t.yr,e)})),i=Xr.fromMillis(e.localWriteTimeMs);return new ca(e.batchId,i,n,r)}function eu(t){var e,n,r=Za(t.readTime),i=void 0!==t.lastLimboFreeSnapshotVersion?Za(t.lastLimboFreeSnapshotVersion):Yr.min();return void 0!==t.query.documents?(Lr(1===(n=t.query).documents.length),e=$s(Rs(jo(n.documents[0])))):e=function(t){return $s(Lo(t))}(t.query),new pi(e,t.targetId,0,t.lastListenSequenceNumber,r,i,hi.fromBase64String(t.resumeToken))}function nu(t,e){var n,r=Ja(e.ft),i=Ja(e.lastLimboFreeSnapshotVersion);n=li(e.target)?Po(t.yr,e.target):Do(t.yr,e.target);var o=e.resumeToken.toBase64();return new ju(e.targetId,ui(e.target),r,o,e.sequenceNumber,i,n)}function ru(t){var e=Lo({parent:t.parent,structuredQuery:t.structuredQuery});return"LAST"===t.limitType?Vs(e,e.limit,"L"):e}var iu=function(){function t(t,e,n,r){this.userId=t,this.serializer=e,this.os=n,this.Vr=r,this.pr={}}return t.vr=function(e,n,r,i){return Lr(""!==e.uid),new t(e.u()?e.uid:"",n,r,i)},t.prototype.br=function(t){var e=!0,n=IDBKeyRange.bound([this.userId,Number.NEGATIVE_INFINITY],[this.userId,Number.POSITIVE_INFINITY]);return au(t)._i({index:Eu.userMutationsIndex,range:n},(function(t,n,r){e=!1,r.done()})).next((function(){return e}))},t.prototype.Sr=function(t,e,n,r){var i=this,o=uu(t),s=au(t);return s.add({}).next((function(a){Lr("number"==typeof a);for(var u=new ca(a,e,n,r),c=function(t,e,n){var r=n.baseMutations.map((function(e){return No(t.yr,e)})),i=n.mutations.map((function(e){return No(t.yr,e)}));return new Eu(e,n.batchId,n.gn.toMillis(),r,i)}(i.serializer,i.userId,u),l=[],h=new wi((function(t,e){return Gr(t.J(),e.J())})),d=0,f=r;d<f.length;d++){var p=f[d],g=Ou.key(i.userId,p.key.path,a);h=h.add(p.key.path.q()),l.push(s.put(c)),l.push(o.put(g,Ou.PLACEHOLDER))}return h.forEach((function(e){l.push(i.os.Dr(t,e))})),t.es((function(){i.pr[a]=u.keys()})),da.qn(l).next((function(){return u}))}))},t.prototype.Cr=function(t,e){var n=this;return au(t).get(e).next((function(t){return t?(Lr(t.userId===n.userId),tu(n.serializer,t)):null}))},t.prototype.Nr=function(t,e){var n=this;return this.pr[e]?da.resolve(this.pr[e]):this.Cr(t,e).next((function(t){if(t){var r=t.keys();return n.pr[e]=r,r}return null}))},t.prototype.Fr=function(t,e){var n=this,r=e+1,i=IDBKeyRange.lowerBound([this.userId,r]),o=null;return au(t)._i({index:Eu.userMutationsIndex,range:i},(function(t,e,i){e.userId===n.userId&&(Lr(e.batchId>=r),o=tu(n.serializer,e)),i.done()})).next((function(){return o}))},t.prototype.Or=function(t){var e=IDBKeyRange.upperBound([this.userId,Number.POSITIVE_INFINITY]),n=-1;return au(t)._i({index:Eu.userMutationsIndex,range:e,reverse:!0},(function(t,e,r){n=e.batchId,r.done()})).next((function(){return n}))},t.prototype.Mr=function(t){var e=this,n=IDBKeyRange.bound([this.userId,-1],[this.userId,Number.POSITIVE_INFINITY]);return au(t).ui(Eu.userMutationsIndex,n).next((function(t){return t.map((function(t){return tu(e.serializer,t)}))}))},t.prototype.us=function(t,e){var n=this,r=Ou.prefixForPath(this.userId,e.path),i=IDBKeyRange.lowerBound(r),o=[];return uu(t)._i({range:i},(function(r,i,s){var a=r[0],u=r[2],c=Wa(r[1]);if(a===n.userId&&e.path.isEqual(c))return au(t).get(u).next((function(t){if(!t)throw Dr();Lr(t.userId===n.userId),o.push(tu(n.serializer,t))}));s.done()})).next((function(){return o}))},t.prototype.ds=function(t,e){var n=this,r=new wi(Gr),i=[];return e.forEach((function(e){var o=Ou.prefixForPath(n.userId,e.path),s=IDBKeyRange.lowerBound(o),a=uu(t)._i({range:s},(function(t,i,o){var s=t[0],a=t[2],u=Wa(t[1]);s===n.userId&&e.path.isEqual(u)?r=r.add(a):o.done()}));i.push(a)})),da.qn(i).next((function(){return n.kr(t,r)}))},t.prototype.Rs=function(t,e){var n=this,r=e.path,i=r.length+1,o=Ou.prefixForPath(this.userId,r),s=IDBKeyRange.lowerBound(o),a=new wi(Gr);return uu(t)._i({range:s},(function(t,e,o){var s=t[0],u=t[2],c=Wa(t[1]);s===n.userId&&r.j(c)?c.length===i&&(a=a.add(u)):o.done()})).next((function(){return n.kr(t,a)}))},t.prototype.kr=function(t,e){var n=this,r=[],i=[];return e.forEach((function(e){i.push(au(t).get(e).next((function(t){if(null===t)throw Dr();Lr(t.userId===n.userId),r.push(tu(n.serializer,t))})))})),da.qn(i).next((function(){return r}))},t.prototype.$r=function(t,e){var n=this;return su(t.Lr,this.userId,e).next((function(r){return t.es((function(){n.Br(e.batchId)})),da.forEach(r,(function(e){return n.Vr.qr(t,e)}))}))},t.prototype.Br=function(t){delete this.pr[t]},t.prototype.Ur=function(t){var e=this;return this.br(t).next((function(n){if(!n)return da.resolve();var r=IDBKeyRange.lowerBound(Ou.prefixForUser(e.userId)),i=[];return uu(t)._i({range:r},(function(t,n,r){if(t[0]===e.userId){var o=Wa(t[1]);i.push(o)}else r.done()})).next((function(){Lr(0===i.length)}))}))},t.prototype.Qr=function(t,e){return ou(t,this.userId,e)},t.prototype.Kr=function(t){var e=this;return cu(t).get(this.userId).next((function(t){return t||new wu(e.userId,-1,"")}))},t}();function ou(t,e,n){var r=Ou.prefixForPath(e,n.path),i=r[1],o=IDBKeyRange.lowerBound(r),s=!1;return uu(t)._i({range:o,li:!0},(function(t,n,r){t[0]===e&&t[1]===i&&(s=!0),r.done()})).next((function(){return s}))}function su(t,e,n){var r=t.store(Eu.store),i=t.store(Ou.store),o=[],s=IDBKeyRange.only(n.batchId),a=0,u=r._i({range:s},(function(t,e,n){return a++,n.delete()}));o.push(u.next((function(){Lr(1===a)})));for(var c=[],l=0,h=n.mutations;l<h.length;l++){var d=h[l],f=Ou.key(e,d.key.path,n.batchId);o.push(i.delete(f)),c.push(d.key)}return da.qn(o).next((function(){return c}))}function au(t){return Ku.Ys(t,Eu.store)}function uu(t){return Ku.Ys(t,Ou.store)}function cu(t){return Ku.Ys(t,wu.store)}var lu=function(){function t(t,e){this.serializer=t,this.os=e}return t.prototype.jn=function(t,e,n){return fu(t).put(pu(e),n)},t.prototype.Hn=function(t,e){var n=fu(t),r=pu(e);return n.delete(r)},t.prototype.updateMetadata=function(t,e){var n=this;return this.getMetadata(t).next((function(r){return r.byteSize+=e,n.Wr(t,r)}))},t.prototype.Jn=function(t,e){var n=this;return fu(t).get(pu(e)).next((function(t){return n.jr(t)}))},t.prototype.Gr=function(t,e){var n=this;return fu(t).get(pu(e)).next((function(t){var e=n.jr(t);return e?{zn:e,size:gu(t)}:null}))},t.prototype.getEntries=function(t,e){var n=this,r=Ti();return this.zr(t,e,(function(t,e){var i=n.jr(e);r=r.Tt(t,i)})).next((function(){return r}))},t.prototype.Hr=function(t,e){var n=this,r=Ti(),i=new mi(ni.$);return this.zr(t,e,(function(t,e){var o=n.jr(e);o?(r=r.Tt(t,o),i=i.Tt(t,gu(e))):(r=r.Tt(t,null),i=i.Tt(t,0))})).next((function(){return{Jr:r,Yr:i}}))},t.prototype.zr=function(t,e,n){if(e.W())return da.resolve();var r=IDBKeyRange.bound(e.first().path.H(),e.last().path.H()),i=e.yt(),o=i.Ct();return fu(t)._i({range:r},(function(t,e,r){for(var s=ni.ct(t);o&&ni.$(o,s)<0;)n(o,null),o=i.Ct();o&&o.isEqual(s)&&(n(o,e),o=i.Nt()?i.Ct():null),o?r.oi(o.path.H()):r.done()})).next((function(){for(;o;)n(o,null),o=i.Nt()?i.Ct():null}))},t.prototype.ws=function(t,e,n){var r=this,i=Ii(),o=e.path.length+1,s={};if(n.isEqual(Yr.min())){var a=e.path.H();s.range=IDBKeyRange.lowerBound(a)}else{var u=e.path.H(),c=Xa(n);s.range=IDBKeyRange.lowerBound([u,c],!0),s.index=Su.collectionReadTimeIndex}return fu(t)._i(s,(function(t,n,s){if(t.length===o){var a=Qa(r.serializer,n);e.path.j(a.key.path)?a instanceof js&&zs(e,a)&&(i=i.Tt(a.key,a)):s.done()}})).next((function(){return i}))},t.prototype.Xr=function(t){return new hu(this,!!t&&t.Zr)},t.prototype.eo=function(t){return this.getMetadata(t).next((function(t){return t.byteSize}))},t.prototype.getMetadata=function(t){return du(t).get(Iu.key).next((function(t){return Lr(!!t),t}))},t.prototype.Wr=function(t,e){return du(t).put(Iu.key,e)},t.prototype.jr=function(t){if(t){var e=Qa(this.serializer,t);return e instanceof xs&&e.version.isEqual(Yr.min())?null:e}return null},t}(),hu=function(t){function e(e,n){var r=this;return(r=t.call(this)||this).no=e,r.Zr=n,r.so=new ha((function(t){return t.toString()}),(function(t,e){return t.isEqual(e)})),r}return Object(w.d)(e,t),e.prototype.Zn=function(t){var e=this,n=[],r=0,i=new wi((function(t,e){return Gr(t.J(),e.J())}));return this.Qn.forEach((function(o,s){var a=e.so.get(o);if(s.zn){var u=Ka(e.no.serializer,s.zn,e.Wn(o));i=i.add(o.path.q());var c=gu(u);r+=c-a,n.push(e.no.jn(t,o,u))}else if(r-=a,e.Zr){var l=Ka(e.no.serializer,new xs(o,Yr.min()),e.Wn(o));n.push(e.no.jn(t,o,l))}else n.push(e.no.Hn(t,o))})),i.forEach((function(r){n.push(e.no.os.Dr(t,r))})),n.push(this.no.updateMetadata(t,r)),da.qn(n)},e.prototype.Yn=function(t,e){var n=this;return this.no.Gr(t,e).next((function(t){return null===t?(n.so.set(e,0),null):(n.so.set(e,t.size),t.zn)}))},e.prototype.Xn=function(t,e){var n=this;return this.no.Hr(t,e).next((function(t){var e=t.Jr;return t.Yr.forEach((function(t,e){n.so.set(t,e)})),e}))},e}(fa);function du(t){return Ku.Ys(t,Iu.store)}function fu(t){return Ku.Ys(t,Su.store)}function pu(t){return t.path.H()}function gu(t){var e;if(t.document)e=t.document;else if(t.unknownDocument)e=t.unknownDocument;else{if(!t.noDocument)throw Dr();e=t.noDocument}return JSON.stringify(e).length}var yu=function(){function t(){this.io=new vu}return t.prototype.Dr=function(t,e){return this.io.add(e),da.resolve()},t.prototype.As=function(t,e){return da.resolve(this.io.getEntries(e))},t}(),vu=function(){function t(){this.index={}}return t.prototype.add=function(t){var e=t.K(),n=t.q(),r=this.index[e]||new wi(Zr.$),i=!r.has(n);return this.index[e]=r.add(n),i},t.prototype.has=function(t){var e=t.K(),n=t.q(),r=this.index[e];return r&&r.has(n)},t.prototype.getEntries=function(t){return(this.index[t]||new wi(Zr.$)).H()},t}(),mu=function(){function t(t){this.serializer=t}return t.prototype.createOrUpgrade=function(t,e,n,r){var i=this;Lr(n<r&&n>=0&&r<=11);var o=new Ia("createOrUpgrade",e);n<1&&r>=1&&(function(t){t.createObjectStore(_u.store)}(t),function(t){t.createObjectStore(wu.store,{keyPath:wu.keyPath}),t.createObjectStore(Eu.store,{keyPath:Eu.keyPath,autoIncrement:!0}).createIndex(Eu.userMutationsIndex,Eu.userMutationsKeyPath,{unique:!0}),t.createObjectStore(Ou.store)}(t),Nu(t),function(t){t.createObjectStore(Su.store)}(t));var s=da.resolve();return n<3&&r>=3&&(0!==n&&(function(t){t.deleteObjectStore(xu.store),t.deleteObjectStore(ju.store),t.deleteObjectStore(Au.store)}(t),Nu(t)),s=s.next((function(){return function(t){var e=t.store(Au.store),n=new Au(0,0,Yr.min().M(),0);return e.put(Au.key,n)}(o)}))),n<4&&r>=4&&(0!==n&&(s=s.next((function(){return function(t,e){return e.store(Eu.store).ui().next((function(n){t.deleteObjectStore(Eu.store),t.createObjectStore(Eu.store,{keyPath:Eu.keyPath,autoIncrement:!0}).createIndex(Eu.userMutationsIndex,Eu.userMutationsKeyPath,{unique:!0});var r=e.store(Eu.store),i=n.map((function(t){return r.put(t)}));return da.qn(i)}))}(t,o)}))),s=s.next((function(){!function(t){t.createObjectStore(Ru.store,{keyPath:Ru.keyPath})}(t)}))),n<5&&r>=5&&(s=s.next((function(){return i.removeAcknowledgedMutations(o)}))),n<6&&r>=6&&(s=s.next((function(){return function(t){t.createObjectStore(Iu.store)}(t),i.addDocumentGlobal(o)}))),n<7&&r>=7&&(s=s.next((function(){return i.ensureSequenceNumbers(o)}))),n<8&&r>=8&&(s=s.next((function(){return i.createCollectionParentIndex(t,o)}))),n<9&&r>=9&&(s=s.next((function(){!function(t){t.objectStoreNames.contains("remoteDocumentChanges")&&t.deleteObjectStore("remoteDocumentChanges")}(t),function(t){var e=t.objectStore(Su.store);e.createIndex(Su.readTimeIndex,Su.readTimeIndexPath,{unique:!1}),e.createIndex(Su.collectionReadTimeIndex,Su.collectionReadTimeIndexPath,{unique:!1})}(e)}))),n<10&&r>=10&&(s=s.next((function(){return i.rewriteCanonicalIds(o)}))),n<11&&r>=11&&(s=s.next((function(){!function(t){t.createObjectStore(Pu.store,{keyPath:Pu.keyPath})}(t),function(t){t.createObjectStore(Du.store,{keyPath:Du.keyPath})}(t)}))),s},t.prototype.addDocumentGlobal=function(t){var e=0;return t.store(Su.store)._i((function(t,n){e+=gu(n)})).next((function(){var n=new Iu(e);return t.store(Iu.store).put(Iu.key,n)}))},t.prototype.removeAcknowledgedMutations=function(t){var e=this,n=t.store(wu.store),r=t.store(Eu.store);return n.ui().next((function(n){return da.forEach(n,(function(n){var i=IDBKeyRange.bound([n.userId,-1],[n.userId,n.lastAcknowledgedBatchId]);return r.ui(Eu.userMutationsIndex,i).next((function(r){return da.forEach(r,(function(r){Lr(r.userId===n.userId);var i=tu(e.serializer,r);return su(t,n.userId,i).next((function(){}))}))}))}))}))},t.prototype.ensureSequenceNumbers=function(t){var e=t.store(xu.store),n=t.store(Su.store);return t.store(Au.store).get(Au.key).next((function(t){var r=[];return n._i((function(n,i){var o=new Zr(n),s=function(t){return[0,Ha(t)]}(o);r.push(e.get(s).next((function(n){return n?da.resolve():function(n){return e.put(new xu(0,Ha(n),t.highestListenSequenceNumber))}(o)})))})).next((function(){return da.qn(r)}))}))},t.prototype.createCollectionParentIndex=function(t,e){t.createObjectStore(ku.store,{keyPath:ku.keyPath});var n=e.store(ku.store),r=new vu,i=function(t){if(r.add(t)){var e=t.K(),i=t.q();return n.put({collectionId:e,parent:Ha(i)})}};return e.store(Su.store)._i({li:!0},(function(t,e){var n=new Zr(t);return i(n.q())})).next((function(){return e.store(Ou.store)._i({li:!0},(function(t,e){var n=Wa(t[1]);return i(n.q())}))}))},t.prototype.rewriteCanonicalIds=function(t){var e=this,n=t.store(ju.store);return n._i((function(t,r){var i=eu(r),o=nu(e.serializer,i);return n.put(o)}))},t}(),bu=function(t,e){this.seconds=t,this.nanoseconds=e},_u=function(t,e,n){this.ownerId=t,this.allowTabSynchronization=e,this.leaseTimestampMs=n};_u.store="owner",_u.key="owner";var wu=function(t,e,n){this.userId=t,this.lastAcknowledgedBatchId=e,this.lastStreamToken=n};wu.store="mutationQueues",wu.keyPath="userId";var Eu=function(t,e,n,r,i){this.userId=t,this.batchId=e,this.localWriteTimeMs=n,this.baseMutations=r,this.mutations=i};Eu.store="mutations",Eu.keyPath="batchId",Eu.userMutationsIndex="userMutationsIndex",Eu.userMutationsKeyPath=["userId","batchId"];var Ou=function(){function t(){}return t.prefixForUser=function(t){return[t]},t.prefixForPath=function(t,e){return[t,Ha(e)]},t.key=function(t,e,n){return[t,Ha(e),n]},t}();Ou.store="documentMutations",Ou.PLACEHOLDER=new Ou;var Cu=function(t,e){this.path=t,this.readTime=e},Tu=function(t,e){this.path=t,this.version=e},Su=function(t,e,n,r,i,o){this.unknownDocument=t,this.noDocument=e,this.document=n,this.hasCommittedMutations=r,this.readTime=i,this.parentPath=o};Su.store="remoteDocuments",Su.readTimeIndex="readTimeIndex",Su.readTimeIndexPath="readTime",Su.collectionReadTimeIndex="collectionReadTimeIndex",Su.collectionReadTimeIndexPath=["parentPath","readTime"];var Iu=function(t){this.byteSize=t};Iu.store="remoteDocumentGlobal",Iu.key="remoteDocumentGlobalKey";var ju=function(t,e,n,r,i,o,s){this.targetId=t,this.canonicalId=e,this.readTime=n,this.resumeToken=r,this.lastListenSequenceNumber=i,this.lastLimboFreeSnapshotVersion=o,this.query=s};ju.store="targets",ju.keyPath="targetId",ju.queryTargetsIndexName="queryTargetsIndex",ju.queryTargetsKeyPath=["canonicalId","targetId"];var xu=function(t,e,n){this.targetId=t,this.path=e,this.sequenceNumber=n};xu.store="targetDocuments",xu.keyPath=["targetId","path"],xu.documentTargetsIndex="documentTargetsIndex",xu.documentTargetsKeyPath=["path","targetId"];var Au=function(t,e,n,r){this.highestTargetId=t,this.highestListenSequenceNumber=e,this.lastRemoteSnapshotVersion=n,this.targetCount=r};Au.key="targetGlobalKey",Au.store="targetGlobal";var ku=function(t,e){this.collectionId=t,this.parent=e};function Nu(t){t.createObjectStore(xu.store,{keyPath:xu.keyPath}).createIndex(xu.documentTargetsIndex,xu.documentTargetsKeyPath,{unique:!0}),t.createObjectStore(ju.store,{keyPath:ju.keyPath}).createIndex(ju.queryTargetsIndexName,ju.queryTargetsKeyPath,{unique:!0}),t.createObjectStore(Au.store)}ku.store="collectionParents",ku.keyPath=["collectionId","parent"];var Ru=function(t,e,n,r){this.clientId=t,this.updateTimeMs=e,this.networkEnabled=n,this.inForeground=r};Ru.store="clientMetadata",Ru.keyPath="clientId";var Pu=function(t,e,n){this.bundleId=t,this.createTime=e,this.version=n};Pu.store="bundles",Pu.keyPath="bundleId";var Du=function(t,e,n){this.name=t,this.readTime=e,this.bundledQuery=n};Du.store="namedQueries",Du.keyPath="name";var Lu=Object(w.h)(Object(w.h)(Object(w.h)(Object(w.h)([wu.store,Eu.store,Ou.store,Su.store,ju.store,_u.store,Au.store,xu.store],[Ru.store]),[Iu.store]),[ku.store]),[Pu.store,Du.store]),Mu=function(){function t(t){this.serializer=t}return t.prototype.ro=function(t,e){return Fu(t).get(e).next((function(t){if(t)return{id:(e=t).bundleId,createTime:Za(e.createTime),version:e.version};var e}))},t.prototype.oo=function(t,e){return Fu(t).put({bundleId:(n=e).id,createTime:Ja(Eo(n.createTime)),version:n.version});var n},t.prototype.co=function(t,e){return Uu(t).get(e).next((function(t){if(t)return{name:(e=t).name,query:ru(e.bundledQuery),readTime:Za(e.readTime)};var e}))},t.prototype.uo=function(t,e){return Uu(t).put(function(t){return{name:t.name,readTime:Ja(Eo(t.readTime)),bundledQuery:t.bundledQuery}}(e))},t}();function Fu(t){return Ku.Ys(t,Pu.store)}function Uu(t){return Ku.Ys(t,Du.store)}var $u=function(){function t(){this.ao=new vu}return t.prototype.Dr=function(t,e){var n=this;if(!this.ao.has(e)){var r=e.K(),i=e.q();t.es((function(){n.ao.add(e)}));var o={collectionId:r,parent:Ha(i)};return Vu(t).put(o)}return da.resolve()},t.prototype.As=function(t,e){var n=[],r=IDBKeyRange.bound([e,""],[Kr(e),""],!1,!0);return Vu(t).ui(r).next((function(t){for(var r=0,i=t;r<i.length;r++){var o=i[r];if(o.collectionId!==e)break;n.push(Wa(o.parent))}return n}))},t}();function Vu(t){return Ku.Ys(t,ku.store)}var qu=function(){function t(t){this.ho=t}return t.prototype.next=function(){return this.ho+=2,this.ho},t.lo=function(){return new t(0)},t._o=function(){return new t(-1)},t}(),Hu=function(){function t(t,e){this.Vr=t,this.serializer=e}return t.prototype.fo=function(t){var e=this;return this.wo(t).next((function(n){var r=new qu(n.highestTargetId);return n.highestTargetId=r.next(),e.Eo(t,n).next((function(){return n.highestTargetId}))}))},t.prototype.To=function(t){return this.wo(t).next((function(t){return Yr.N(new Xr(t.lastRemoteSnapshotVersion.seconds,t.lastRemoteSnapshotVersion.nanoseconds))}))},t.prototype.Io=function(t){return this.wo(t).next((function(t){return t.highestListenSequenceNumber}))},t.prototype.mo=function(t,e,n){var r=this;return this.wo(t).next((function(i){return i.highestListenSequenceNumber=e,n&&(i.lastRemoteSnapshotVersion=n.M()),e>i.highestListenSequenceNumber&&(i.highestListenSequenceNumber=e),r.Eo(t,i)}))},t.prototype.Ao=function(t,e){var n=this;return this.Ro(t,e).next((function(){return n.wo(t).next((function(r){return r.targetCount+=1,n.Po(e,r),n.Eo(t,r)}))}))},t.prototype.yo=function(t,e){return this.Ro(t,e)},t.prototype.Vo=function(t,e){var n=this;return this.po(t,e.targetId).next((function(){return Bu(t).delete(e.targetId)})).next((function(){return n.wo(t)})).next((function(e){return Lr(e.targetCount>0),e.targetCount-=1,n.Eo(t,e)}))},t.prototype.mr=function(t,e,n){var r=this,i=0,o=[];return Bu(t)._i((function(s,a){var u=eu(a);u.sequenceNumber<=e&&null===n.get(u.targetId)&&(i++,o.push(r.Vo(t,u)))})).next((function(){return da.qn(o)})).next((function(){return i}))},t.prototype.Ue=function(t,e){return Bu(t)._i((function(t,n){var r=eu(n);e(r)}))},t.prototype.wo=function(t){return zu(t).get(Au.key).next((function(t){return Lr(null!==t),t}))},t.prototype.Eo=function(t,e){return zu(t).put(Au.key,e)},t.prototype.Ro=function(t,e){return Bu(t).put(nu(this.serializer,e))},t.prototype.Po=function(t,e){var n=!1;return t.targetId>e.highestTargetId&&(e.highestTargetId=t.targetId,n=!0),t.sequenceNumber>e.highestListenSequenceNumber&&(e.highestListenSequenceNumber=t.sequenceNumber,n=!0),n},t.prototype.vo=function(t){return this.wo(t).next((function(t){return t.targetCount}))},t.prototype.bo=function(t,e){var n=ui(e),r=IDBKeyRange.bound([n,Number.NEGATIVE_INFINITY],[n,Number.POSITIVE_INFINITY]),i=null;return Bu(t)._i({range:r,index:ju.queryTargetsIndexName},(function(t,n,r){var o=eu(n);ci(e,o.target)&&(i=o,r.done())})).next((function(){return i}))},t.prototype.So=function(t,e,n){var r=this,i=[],o=Wu(t);return e.forEach((function(e){var s=Ha(e.path);i.push(o.put(new xu(n,s))),i.push(r.Vr.Do(t,n,e))})),da.qn(i)},t.prototype.Co=function(t,e,n){var r=this,i=Wu(t);return da.forEach(e,(function(e){var o=Ha(e.path);return da.qn([i.delete([n,o]),r.Vr.No(t,n,e)])}))},t.prototype.po=function(t,e){var n=Wu(t),r=IDBKeyRange.bound([e],[e+1],!1,!0);return n.delete(r)},t.prototype.xo=function(t,e){var n=IDBKeyRange.bound([e],[e+1],!1,!0),r=Wu(t),i=Ai();return r._i({range:n,li:!0},(function(t,e,n){var r=Wa(t[1]),o=new ni(r);i=i.add(o)})).next((function(){return i}))},t.prototype.Qr=function(t,e){var n=Ha(e.path),r=IDBKeyRange.bound([n],[Kr(n)],!1,!0),i=0;return Wu(t)._i({index:xu.documentTargetsIndex,li:!0,range:r},(function(t,e,n){0!==t[0]&&(i++,n.done())})).next((function(){return i>0}))},t.prototype.Ze=function(t,e){return Bu(t).get(e).next((function(t){return t?eu(t):null}))},t}();function Bu(t){return Ku.Ys(t,ju.store)}function zu(t){return Ku.Ys(t,Au.store)}function Wu(t){return Ku.Ys(t,xu.store)}var Gu="Failed to obtain exclusive access to the persistence layer. To allow shared access, multi-tab synchronization has to be enabled in all tabs. If you are using `experimentalForceOwningTab:true`, make sure that only one tab has persistence enabled at any given time.",Qu=function(t){function e(e,n){var r=this;return(r=t.call(this)||this).Lr=e,r.Fo=n,r}return Object(w.d)(e,t),e}(ma),Ku=function(){function t(e,n,r,i,o,s,a,u,c,l){if(this.allowTabSynchronization=e,this.persistenceKey=n,this.clientId=r,this.Cs=o,this.window=s,this.document=a,this.Oo=c,this.Mo=l,this.ko=null,this.$o=!1,this.isPrimary=!1,this.networkEnabled=!0,this.Lo=null,this.inForeground=!1,this.Bo=null,this.qo=null,this.Uo=Number.NEGATIVE_INFINITY,this.Qo=function(t){return Promise.resolve()},!t.Gs())throw new Ur(Fr.UNIMPLEMENTED,"This platform is either missing IndexedDB or is known to have an incomplete implementation. Offline persistence has been disabled.");this.Vr=new Ju(this,i),this.Ko=n+"main",this.serializer=new Ga(u),this.Wo=new Oa(this.Ko,11,new mu(this.serializer)),this.jo=new Hu(this.Vr,this.serializer),this.os=new $u,this.ss=function(t,e){return new lu(t,e)}(this.serializer,this.os),this.Go=new Mu(this.serializer),this.window&&this.window.localStorage?this.zo=this.window.localStorage:(this.zo=null,!1===l&&Nr("IndexedDbPersistence","LocalStorage is unavailable. As a result, persistence may not work reliably. In particular enablePersistence() could fail immediately after refreshing the page."))}return t.Ys=function(t,e){if(t instanceof Qu)return Oa.Ys(t.Lr,e);throw Dr()},t.prototype.start=function(){var t=this;return this.Ho().then((function(){if(!t.isPrimary&&!t.allowTabSynchronization)throw new Ur(Fr.FAILED_PRECONDITION,Gu);return t.Jo(),t.Yo(),t.Xo(),t.runTransaction("getHighestListenSequenceNumber","readonly",(function(e){return t.jo.Io(e)}))})).then((function(e){t.ko=new wa(e,t.Oo)})).then((function(){t.$o=!0})).catch((function(e){return t.Wo&&t.Wo.close(),Promise.reject(e)}))},t.prototype.Zo=function(t){var e=this;return this.Qo=function(n){return Object(w.b)(e,void 0,void 0,(function(){return Object(w.e)(this,(function(e){return this.lr?[2,t(n)]:[2]}))}))},t(this.isPrimary)},t.prototype.tc=function(t){var e=this;this.Wo.ti((function(n){return Object(w.b)(e,void 0,void 0,(function(){return Object(w.e)(this,(function(e){switch(e.label){case 0:return null===n.newVersion?[4,t()]:[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}}))}))}))},t.prototype.ec=function(t){var e=this;this.networkEnabled!==t&&(this.networkEnabled=t,this.Cs.Ri((function(){return Object(w.b)(e,void 0,void 0,(function(){return Object(w.e)(this,(function(t){switch(t.label){case 0:return this.lr?[4,this.Ho()]:[3,2];case 1:t.sent(),t.label=2;case 2:return[2]}}))}))})))},t.prototype.Ho=function(){var t=this;return this.runTransaction("updateClientMetadataAndTryBecomePrimary","readwrite",(function(e){return Yu(e).put(new Ru(t.clientId,Date.now(),t.networkEnabled,t.inForeground)).next((function(){if(t.isPrimary)return t.nc(e).next((function(e){e||(t.isPrimary=!1,t.Cs.Mi((function(){return t.Qo(!1)})))}))})).next((function(){return t.sc(e)})).next((function(n){return t.isPrimary&&!n?t.ic(e).next((function(){return!1})):!!n&&t.rc(e).next((function(){return!0}))}))})).catch((function(e){if(Sa(e))return kr("IndexedDbPersistence","Failed to extend owner lease: ",e),t.isPrimary;if(!t.allowTabSynchronization)throw e;return kr("IndexedDbPersistence","Releasing owner lease after error during lease refresh",e),!1})).then((function(e){t.isPrimary!==e&&t.Cs.Mi((function(){return t.Qo(e)})),t.isPrimary=e}))},t.prototype.nc=function(t){var e=this;return Xu(t).get(_u.key).next((function(t){return da.resolve(e.oc(t))}))},t.prototype.cc=function(t){return Yu(t).delete(this.clientId)},t.prototype.uc=function(){return Object(w.b)(this,void 0,void 0,(function(){var e,n,r,i=this;return Object(w.e)(this,(function(o){switch(o.label){case 0:return!this.isPrimary||this.ac(this.Uo,18e5)?[3,2]:(this.Uo=Date.now(),[4,this.runTransaction("maybeGarbageCollectMultiClientState","readwrite-primary",(function(e){var n=t.Ys(e,Ru.store);return n.ui().next((function(t){var e=i.hc(t,18e5),r=t.filter((function(t){return-1===e.indexOf(t)}));return da.forEach(r,(function(t){return n.delete(t.clientId)})).next((function(){return r}))}))})).catch((function(){return[]}))]);case 1:if(e=o.sent(),this.zo)for(n=0,r=e;n<r.length;n++)this.zo.removeItem(this.lc(r[n].clientId));o.label=2;case 2:return[2]}}))}))},t.prototype.Xo=function(){var t=this;this.qo=this.Cs.Us("client_metadata_refresh",4e3,(function(){return t.Ho().then((function(){return t.uc()})).then((function(){return t.Xo()}))}))},t.prototype.oc=function(t){return!!t&&t.ownerId===this.clientId},t.prototype.sc=function(t){var e=this;return this.Mo?da.resolve(!0):Xu(t).get(_u.key).next((function(n){if(null!==n&&e.ac(n.leaseTimestampMs,5e3)&&!e._c(n.ownerId)){if(e.oc(n)&&e.networkEnabled)return!0;if(!e.oc(n)){if(!n.allowTabSynchronization)throw new Ur(Fr.FAILED_PRECONDITION,Gu);return!1}}return!(!e.networkEnabled||!e.inForeground)||Yu(t).ui().next((function(t){return void 0===e.hc(t,5e3).find((function(t){return!(e.clientId===t.clientId||!(!e.networkEnabled&&t.networkEnabled||!e.inForeground&&t.inForeground&&e.networkEnabled===t.networkEnabled))}))}))})).next((function(t){return e.isPrimary!==t&&kr("IndexedDbPersistence","Client "+(t?"is":"is not")+" eligible for a primary lease."),t}))},t.prototype.fc=function(){return Object(w.b)(this,void 0,void 0,(function(){var t=this;return Object(w.e)(this,(function(e){switch(e.label){case 0:return this.$o=!1,this.dc(),this.qo&&(this.qo.cancel(),this.qo=null),this.wc(),this.Ec(),[4,this.Wo.runTransaction("shutdown","readwrite",[_u.store,Ru.store],(function(e){var n=new Qu(e,wa.Ds);return t.ic(n).next((function(){return t.cc(n)}))}))];case 1:return e.sent(),this.Wo.close(),this.Tc(),[2]}}))}))},t.prototype.hc=function(t,e){var n=this;return t.filter((function(t){return n.ac(t.updateTimeMs,e)&&!n._c(t.clientId)}))},t.prototype.Ic=function(){var t=this;return this.runTransaction("getActiveClients","readonly",(function(e){return Yu(e).ui().next((function(e){return t.hc(e,18e5).map((function(t){return t.clientId}))}))}))},Object.defineProperty(t.prototype,"lr",{get:function(){return this.$o},enumerable:!1,configurable:!0}),t.prototype.mc=function(t){return iu.vr(t,this.serializer,this.os,this.Vr)},t.prototype.Ac=function(){return this.jo},t.prototype.Rc=function(){return this.ss},t.prototype.Pc=function(){return this.os},t.prototype.gc=function(){return this.Go},t.prototype.runTransaction=function(t,e,n){var r,i=this;return kr("IndexedDbPersistence","Starting transaction:",t),this.Wo.runTransaction(t,"readonly"===e?"readonly":"readwrite",Lu,(function(o){return r=new Qu(o,i.ko?i.ko.next():wa.Ds),"readwrite-primary"===e?i.nc(r).next((function(t){return!!t||i.sc(r)})).next((function(e){if(!e)throw Nr("Failed to obtain primary lease for action '"+t+"'."),i.isPrimary=!1,i.Cs.Mi((function(){return i.Qo(!1)})),new Ur(Fr.FAILED_PRECONDITION,va);return n(r)})).next((function(t){return i.rc(r).next((function(){return t}))})):i.yc(r).next((function(){return n(r)}))})).then((function(t){return r.ns(),t}))},t.prototype.yc=function(t){var e=this;return Xu(t).get(_u.key).next((function(t){if(null!==t&&e.ac(t.leaseTimestampMs,5e3)&&!e._c(t.ownerId)&&!e.oc(t)&&!(e.Mo||e.allowTabSynchronization&&t.allowTabSynchronization))throw new Ur(Fr.FAILED_PRECONDITION,Gu)}))},t.prototype.rc=function(t){var e=new _u(this.clientId,this.allowTabSynchronization,Date.now());return Xu(t).put(_u.key,e)},t.Gs=function(){return Oa.Gs()},t.prototype.ic=function(t){var e=this,n=Xu(t);return n.get(_u.key).next((function(t){return e.oc(t)?(kr("IndexedDbPersistence","Releasing primary lease."),n.delete(_u.key)):da.resolve()}))},t.prototype.ac=function(t,e){var n=Date.now();return!(t<n-e||t>n&&(Nr("Detected an update time that is in the future: "+t+" > "+n),1))},t.prototype.Jo=function(){var t=this;null!==this.document&&"function"==typeof this.document.addEventListener&&(this.Bo=function(){t.Cs.Ri((function(){return t.inForeground="visible"===t.document.visibilityState,t.Ho()}))},this.document.addEventListener("visibilitychange",this.Bo),this.inForeground="visible"===this.document.visibilityState)},t.prototype.wc=function(){this.Bo&&(this.document.removeEventListener("visibilitychange",this.Bo),this.Bo=null)},t.prototype.Yo=function(){var t,e=this;"function"==typeof(null===(t=this.window)||void 0===t?void 0:t.addEventListener)&&(this.Lo=function(){e.dc(),e.Cs.Ri((function(){return e.fc()}))},this.window.addEventListener("unload",this.Lo))},t.prototype.Ec=function(){this.Lo&&(this.window.removeEventListener("unload",this.Lo),this.Lo=null)},t.prototype._c=function(t){var e;try{var n=null!==(null===(e=this.zo)||void 0===e?void 0:e.getItem(this.lc(t)));return kr("IndexedDbPersistence","Client '"+t+"' "+(n?"is":"is not")+" zombied in LocalStorage"),n}catch(t){return Nr("IndexedDbPersistence","Failed to get zombied client id.",t),!1}},t.prototype.dc=function(){if(this.zo)try{this.zo.setItem(this.lc(this.clientId),String(Date.now()))}catch(t){Nr("Failed to set zombie client id.",t)}},t.prototype.Tc=function(){if(this.zo)try{this.zo.removeItem(this.lc(this.clientId))}catch(t){}},t.prototype.lc=function(t){return"firestore_zombie_"+this.persistenceKey+"_"+t},t}();function Xu(t){return Ku.Ys(t,_u.store)}function Yu(t){return Ku.Ys(t,Ru.store)}var Ju=function(){function t(t,e){this.db=t,this.cr=new qa(this,e)}return t.prototype.Er=function(t){var e=this.Vc(t);return this.db.Ac().vo(t).next((function(t){return e.next((function(e){return t+e}))}))},t.prototype.Vc=function(t){var e=0;return this.Ir(t,(function(t){e++})).next((function(){return e}))},t.prototype.Ue=function(t,e){return this.db.Ac().Ue(t,e)},t.prototype.Ir=function(t,e){return this.vc(t,(function(t,n){return e(n)}))},t.prototype.Do=function(t,e,n){return Zu(t,n)},t.prototype.No=function(t,e,n){return Zu(t,n)},t.prototype.mr=function(t,e,n){return this.db.Ac().mr(t,e,n)},t.prototype.qr=function(t,e){return Zu(t,e)},t.prototype.bc=function(t,e){return function(t,e){var n=!1;return cu(t).fi((function(r){return ou(t,r,e).next((function(t){return t&&(n=!0),da.resolve(!t)}))})).next((function(){return n}))}(t,e)},t.prototype.Ar=function(t,e){var n=this,r=this.db.Rc().Xr(),i=[],o=0;return this.vc(t,(function(s,a){if(a<=e){var u=n.bc(t,s).next((function(e){if(!e)return o++,r.Jn(t,s).next((function(){return r.Hn(s),Wu(t).delete([0,Ha(s.path)])}))}));i.push(u)}})).next((function(){return da.qn(i)})).next((function(){return r.apply(t)})).next((function(){return o}))},t.prototype.removeTarget=function(t,e){var n=e.dt(t.Fo);return this.db.Ac().yo(t,n)},t.prototype.Sc=function(t,e){return Zu(t,e)},t.prototype.vc=function(t,e){var n,r=Wu(t),i=wa.Ds;return r._i({index:xu.documentTargetsIndex},(function(t,r){var o=r.path,s=r.sequenceNumber;0===t[0]?(i!==wa.Ds&&e(new ni(Wa(n)),i),i=s,n=o):i=wa.Ds})).next((function(){i!==wa.Ds&&e(new ni(Wa(n)),i)}))},t.prototype.Pr=function(t){return this.db.Rc().eo(t)},t}();function Zu(t,e){return Wu(t).put(function(t,e){return new xu(0,Ha(t.path),e)}(e,t.Fo))}function tc(t,e){var n=t.projectId;return t.o||(n+="."+t.database),"firestore/"+e+"/"+n+"/"}var ec=function(){function t(t,e,n,r){this.persistence=t,this.Dc=e,this.serializer=r,this.Cc=new mi(Gr),this.Nc=new ha((function(t){return ui(t)}),ci),this.xc=Yr.min(),this.rs=t.mc(n),this.Fc=t.Rc(),this.jo=t.Ac(),this.Oc=new ba(this.Fc,this.rs,this.persistence.Pc()),this.Go=t.gc(),this.Dc.Mc(this.Oc)}return t.prototype._r=function(t){var e=this;return this.persistence.runTransaction("Collect garbage","readwrite-primary",(function(n){return t.Rr(n,e.Cc)}))},t}();function nc(t,e,n,r){return new ec(t,e,n,r)}function rc(t,e){return Object(w.b)(this,void 0,void 0,(function(){var n,r,i,o;return Object(w.e)(this,(function(s){switch(s.label){case 0:return n=Mr(t),r=n.rs,i=n.Oc,[4,n.persistence.runTransaction("Handle user change","readonly",(function(t){var o;return n.rs.Mr(t).next((function(s){return o=s,r=n.persistence.mc(e),i=new ba(n.Fc,r,n.persistence.Pc()),r.Mr(t)})).next((function(e){for(var n=[],r=[],s=Ai(),a=0,u=o;a<u.length;a++){var c=u[a];n.push(c.batchId);for(var l=0,h=c.mutations;l<h.length;l++)s=s.add(h[l].key)}for(var d=0,f=e;d<f.length;d++){var p=f[d];r.push(p.batchId);for(var g=0,y=p.mutations;g<y.length;g++)s=s.add(y[g].key)}return i._s(t,s).next((function(t){return{kc:t,$c:n,Lc:r}}))}))}))];case 1:return o=s.sent(),[2,(n.rs=r,n.Oc=i,n.Dc.Mc(n.Oc),o)]}}))}))}function ic(t,e){var n=Mr(t);return n.persistence.runTransaction("Acknowledge batch","readwrite-primary",(function(t){var r=e.batch.keys(),i=n.Fc.Xr({Zr:!0});return function(t,e,n,r){var i=n.batch,o=i.keys(),s=da.resolve();return o.forEach((function(t){s=s.next((function(){return r.Jn(e,t)})).next((function(e){var o=e,s=n.Sn.get(t);Lr(null!==s),(!o||o.version.F(s)<0)&&(o=i.yn(t,o,n))&&r.jn(o,n.bn)}))})),s.next((function(){return t.rs.$r(e,i)}))}(n,t,e,i).next((function(){return i.apply(t)})).next((function(){return n.rs.Ur(t)})).next((function(){return n.Oc._s(t,r)}))}))}function oc(t){var e=Mr(t);return e.persistence.runTransaction("Get last remote snapshot version","readonly",(function(t){return e.jo.To(t)}))}function sc(t,e){var n=Mr(t),r=e.ft,i=n.Cc;return n.persistence.runTransaction("Apply remote event","readwrite-primary",(function(t){var o=n.Fc.Xr({Zr:!0});i=n.Cc;var s=[];e.re.forEach((function(e,o){var a=i.get(o);if(a){s.push(n.jo.Co(t,e.de,o).next((function(){return n.jo.So(t,e._e,o)})));var u=e.resumeToken;if(u.ht()>0){var c=a.wt(u,r).dt(t.Fo);i=i.Tt(o,c),function(t,e,n){return Lr(e.resumeToken.ht()>0),0===t.resumeToken.ht()||e.ft.O()-t.ft.O()>=3e8||n._e.size+n.fe.size+n.de.size>0}(a,c,e)&&s.push(n.jo.yo(t,c))}}}));var a=Ci();if(e.ce.forEach((function(r,i){e.ue.has(r)&&s.push(n.persistence.Vr.Sc(t,r))})),s.push(function(t,e,n,r,i){var o=Ai();return n.forEach((function(t){return o=o.add(t)})),e.getEntries(t,o).next((function(t){var i=Ci();return n.forEach((function(n,o){var s=t.get(n),a=r;o instanceof xs&&o.version.isEqual(Yr.min())?(e.Hn(n,a),i=i.Tt(n,o)):null==s||o.version.F(s.version)>0||0===o.version.F(s.version)&&s.hasPendingWrites?(e.jn(o,a),i=i.Tt(n,o)):kr("LocalStore","Ignoring outdated watch update for ",n,". Current version:",s.version," Watch version:",o.version)})),i}))}(t,o,e.ce,r).next((function(t){a=t}))),!r.isEqual(Yr.min())){var u=n.jo.To(t).next((function(e){return n.jo.mo(t,t.Fo,r)}));s.push(u)}return da.qn(s).next((function(){return o.apply(t)})).next((function(){return n.Oc.fs(t,a)}))})).then((function(t){return n.Cc=i,t}))}function ac(t,e){var n=Mr(t);return n.persistence.runTransaction("Get next mutation batch","readonly",(function(t){return void 0===e&&(e=-1),n.rs.Fr(t,e)}))}function uc(t,e){var n=Mr(t);return n.persistence.runTransaction("Allocate target","readwrite",(function(t){var r;return n.jo.bo(t,e).next((function(i){return i?da.resolve(r=i):n.jo.fo(t).next((function(i){return r=new pi(e,i,0,t.Fo),n.jo.Ao(t,r).next((function(){return r}))}))}))})).then((function(t){var r=n.Cc.get(t.targetId);return(null===r||t.ft.F(r.ft)>0)&&(n.Cc=n.Cc.Tt(t.targetId,t),n.Nc.set(e,t.targetId)),t}))}function cc(t,e,n){return Object(w.b)(this,void 0,void 0,(function(){var r,i,o,s;return Object(w.e)(this,(function(a){switch(a.label){case 0:r=Mr(t),i=r.Cc.get(e),o=n?"readwrite":"readwrite-primary",a.label=1;case 1:return a.trys.push([1,4,,5]),n?[3,3]:[4,r.persistence.runTransaction("Release target",o,(function(t){return r.persistence.Vr.removeTarget(t,i)}))];case 2:a.sent(),a.label=3;case 3:return[3,5];case 4:if(!Sa(s=a.sent()))throw s;return kr("LocalStore","Failed to update sequence numbers for target "+e+": "+s),[3,5];case 5:return r.Cc=r.Cc.remove(e),r.Nc.delete(i.target),[2]}}))}))}function lc(t,e,n){var r=Mr(t),i=Yr.min(),o=Ai();return r.persistence.runTransaction("Execute query","readonly",(function(t){return function(t,e,n){var r=Mr(t),i=r.Nc.get(n);return void 0!==i?da.resolve(r.Cc.get(i)):r.jo.bo(e,n)}(r,t,$s(e)).next((function(e){if(e)return i=e.lastLimboFreeSnapshotVersion,r.jo.xo(t,e.targetId).next((function(t){o=t}))})).next((function(){return r.Dc.ws(t,e,n?i:Yr.min(),n?o:Ai())})).next((function(t){return{documents:t,Bc:o}}))}))}function hc(t,e){var n=Mr(t),r=Mr(n.jo),i=n.Cc.get(e);return i?Promise.resolve(i.target):n.persistence.runTransaction("Get target data","readonly",(function(t){return r.Ze(t,e).next((function(t){return t?t.target:null}))}))}function dc(t){var e=Mr(t);return e.persistence.runTransaction("Get new document changes","readonly",(function(t){return function(t,e,n){var r=Mr(t),i=Ci(),o=Xa(n),s=fu(e),a=IDBKeyRange.lowerBound(o,!0);return s._i({index:Su.readTimeIndex,range:a},(function(t,e){var n=Qa(r.serializer,e);i=i.Tt(n.key,n),o=e.readTime})).next((function(){return{qc:i,readTime:Ya(o)}}))}(e.Fc,t,e.xc)})).then((function(t){var n=t.qc;return e.xc=t.readTime,n}))}function fc(t){return Object(w.b)(this,void 0,void 0,(function(){var e;return Object(w.e)(this,(function(n){return[2,(e=Mr(t)).persistence.runTransaction("Synchronize last document change read time","readonly",(function(t){return function(t){var e=fu(t),n=Yr.min();return e._i({index:Su.readTimeIndex,reverse:!0},(function(t,e,r){e.readTime&&(n=Ya(e.readTime)),r.done()})).next((function(){return n}))}(t)})).then((function(t){e.xc=t}))]}))}))}function pc(t){return Object(w.b)(this,void 0,void 0,(function(){return Object(w.e)(this,(function(e){if(t.code!==Fr.FAILED_PRECONDITION||t.message!==va)throw t;return kr("LocalStore","Unexpectedly lost primary lease"),[2]}))}))}var gc=function(){function t(t,e,n,r,i,o){this.Cs=t,this.Uc=n,this.Qc=r,this.Kc=i,this.listener=o,this.state=0,this.Wc=0,this.jc=null,this.stream=null,this.Si=new Ea(t,e)}return t.prototype.Gc=function(){return 1===this.state||2===this.state||4===this.state},t.prototype.zc=function(){return 2===this.state},t.prototype.start=function(){3!==this.state?this.auth():this.Hc()},t.prototype.stop=function(){return Object(w.b)(this,void 0,void 0,(function(){return Object(w.e)(this,(function(t){switch(t.label){case 0:return this.Gc()?[4,this.close(0)]:[3,2];case 1:t.sent(),t.label=2;case 2:return[2]}}))}))},t.prototype.Jc=function(){this.state=0,this.Si.reset()},t.prototype.Yc=function(){var t=this;this.zc()&&null===this.jc&&(this.jc=this.Cs.Us(this.Uc,6e4,(function(){return t.Xc()})))},t.prototype.Zc=function(t){this.tu(),this.stream.send(t)},t.prototype.Xc=function(){return Object(w.b)(this,void 0,void 0,(function(){return Object(w.e)(this,(function(t){return this.zc()?[2,this.close(0)]:[2]}))}))},t.prototype.tu=function(){this.jc&&(this.jc.cancel(),this.jc=null)},t.prototype.close=function(t,e){return Object(w.b)(this,void 0,void 0,(function(){return Object(w.e)(this,(function(n){switch(n.label){case 0:return this.tu(),this.Si.cancel(),this.Wc++,3!==t?this.Si.reset():e&&e.code===Fr.RESOURCE_EXHAUSTED?(Nr(e.toString()),Nr("Using maximum backoff delay to prevent overloading the backend."),this.Si.Ls()):e&&e.code===Fr.UNAUTHENTICATED&&this.Kc.m(),null!==this.stream&&(this.eu(),this.stream.close(),this.stream=null),this.state=t,[4,this.listener.nu(e)];case 1:return n.sent(),[2]}}))}))},t.prototype.eu=function(){},t.prototype.auth=function(){var t=this;this.state=1;var e=this.su(this.Wc),n=this.Wc;this.Kc.getToken().then((function(e){t.Wc===n&&t.iu(e)}),(function(n){e((function(){var e=new Ur(Fr.UNKNOWN,"Fetching auth token failed: "+n.message);return t.ru(e)}))}))},t.prototype.iu=function(t){var e=this,n=this.su(this.Wc);this.stream=this.ou(t),this.stream.cu((function(){n((function(){return e.state=2,e.listener.cu()}))})),this.stream.nu((function(t){n((function(){return e.ru(t)}))})),this.stream.onMessage((function(t){n((function(){return e.onMessage(t)}))}))},t.prototype.Hc=function(){var t=this;this.state=4,this.Si.Bs((function(){return Object(w.b)(t,void 0,void 0,(function(){return Object(w.e)(this,(function(t){return this.state=0,this.start(),[2]}))}))}))},t.prototype.ru=function(t){return kr("PersistentStream","close with error: "+t),this.stream=null,this.close(3,t)},t.prototype.su=function(t){var e=this;return function(n){e.Cs.Ri((function(){return e.Wc===t?n():(kr("PersistentStream","stream callback skipped by getCloseGuardedDispatcher."),Promise.resolve())}))}},t}(),yc=function(t){function e(e,n,r,i,o){var s=this;return(s=t.call(this,e,"listen_stream_connection_backoff","listen_stream_idle",n,r,o)||this).serializer=i,s}return Object(w.d)(e,t),e.prototype.ou=function(t){return this.Qc.uu("Listen",t)},e.prototype.onMessage=function(t){this.Si.reset();var e=function(t,e){var n;if("targetChange"in e){var r=function(t){return"NO_CHANGE"===t?0:"ADD"===t?1:"REMOVE"===t?2:"CURRENT"===t?3:"RESET"===t?4:Dr()}(e.targetChange.targetChangeType||"NO_CHANGE"),i=e.targetChange.targetIds||[],o=function(t,e){return t.tn?(Lr(void 0===e||"string"==typeof e),hi.fromBase64String(e||"")):(Lr(void 0===e||e instanceof Uint8Array),hi.fromUint8Array(e||new Uint8Array))}(t,e.targetChange.resumeToken),s=e.targetChange.cause,a=s&&function(t){var e=void 0===t.code?Fr.UNKNOWN:vi(t.code);return new Ur(e,t.message||"")}(s);n=new $i(r,i,o,a||null)}else if("documentChange"in e){var u=e.documentChange,c=So(t,u.document.name),l=Eo(u.document.updateTime),h=new Cs({mapValue:{fields:u.document.fields}}),d=new js(c,l,h,{});n=new Fi(u.targetIds||[],u.removedTargetIds||[],d.key,d)}else if("documentDelete"in e){var f=e.documentDelete,p=So(t,f.document),g=f.readTime?Eo(f.readTime):Yr.min(),y=new xs(p,g);n=new Fi([],f.removedTargetIds||[],y.key,y)}else if("documentRemove"in e){var v=e.documentRemove,m=So(t,v.document);n=new Fi([],v.removedTargetIds||[],m,null)}else{if(!("filter"in e))return Dr();var b=e.filter,_=new gi(b.count||0);n=new Ui(b.targetId,_)}return n}(this.serializer,t),n=function(t){if(!("targetChange"in t))return Yr.min();var e=t.targetChange;return e.targetIds&&e.targetIds.length?Yr.min():e.readTime?Eo(e.readTime):Yr.min()}(t);return this.listener.au(e,n)},e.prototype.hu=function(t){var e={};e.database=xo(this.serializer),e.addTarget=function(t,e){var n,r=e.target;return(n=li(r)?{documents:Po(t,r)}:{query:Do(t,r)}).targetId=e.targetId,e.resumeToken.ht()>0?n.resumeToken=_o(t,e.resumeToken):e.ft.F(Yr.min())>0&&(n.readTime=bo(t,e.ft.M())),n}(this.serializer,t);var n=function(t,e){var n=function(t,e){switch(e){case 0:return null;case 1:return"existence-filter-mismatch";case 2:return"limbo-document";default:return Dr()}}(0,e._t);return null==n?null:{"goog-listen-tags":n}}(0,t);n&&(e.labels=n),this.Zc(e)},e.prototype.lu=function(t){var e={};e.database=xo(this.serializer),e.removeTarget=t,this.Zc(e)},e}(gc),vc=function(t){function e(e,n,r,i,o){var s=this;return(s=t.call(this,e,"write_stream_connection_backoff","write_stream_idle",n,r,o)||this).serializer=i,s._u=!1,s}return Object(w.d)(e,t),Object.defineProperty(e.prototype,"fu",{get:function(){return this._u},enumerable:!1,configurable:!0}),e.prototype.start=function(){this._u=!1,this.lastStreamToken=void 0,t.prototype.start.call(this)},e.prototype.eu=function(){this._u&&this.du([])},e.prototype.ou=function(t){return this.Qc.uu("Write",t)},e.prototype.onMessage=function(t){if(Lr(!!t.streamToken),this.lastStreamToken=t.streamToken,this._u){this.Si.reset();var e=function(t,e){return t&&t.length>0?(Lr(void 0!==e),t.map((function(t){return function(t,e){var n=Eo(t.updateTime?t.updateTime:e);n.isEqual(Yr.min())&&(n=Eo(e));var r=null;return t.transformResults&&t.transformResults.length>0&&(r=t.transformResults),new as(n,r)}(t,e)}))):[]}(t.writeResults,t.commitTime),n=Eo(t.commitTime);return this.listener.wu(n,e)}return Lr(!t.writeResults||0===t.writeResults.length),this._u=!0,this.listener.Eu()},e.prototype.Tu=function(){var t={};t.database=xo(this.serializer),this.Zc(t)},e.prototype.du=function(t){var e=this,n={streamToken:this.lastStreamToken,writes:t.map((function(t){return No(e.serializer,t)}))};this.Zc(n)},e}(gc),mc=function(t){function e(e,n,r){var i=this;return(i=t.call(this)||this).credentials=e,i.Qc=n,i.serializer=r,i.Iu=!1,i}return Object(w.d)(e,t),e.prototype.mu=function(){if(this.Iu)throw new Ur(Fr.FAILED_PRECONDITION,"The client has already been terminated.")},e.prototype.Au=function(t,e,n){var r=this;return this.mu(),this.credentials.getToken().then((function(i){return r.Qc.Au(t,e,n,i)})).catch((function(t){throw t.code===Fr.UNAUTHENTICATED&&r.credentials.m(),t}))},e.prototype.Ru=function(t,e,n){var r=this;return this.mu(),this.credentials.getToken().then((function(i){return r.Qc.Ru(t,e,n,i)})).catch((function(t){throw t.code===Fr.UNAUTHENTICATED&&r.credentials.m(),t}))},e.prototype.terminate=function(){this.Iu=!1},e}((function(){})),bc=function(){function t(t,e){this.di=t,this.Pu=e,this.state="Unknown",this.gu=0,this.yu=null,this.Vu=!0}return t.prototype.pu=function(){var t=this;0===this.gu&&(this.vu("Unknown"),this.yu=this.di.Us("online_state_timeout",1e4,(function(){return t.yu=null,t.bu("Backend didn't respond within 10 seconds."),t.vu("Offline"),Promise.resolve()})))},t.prototype.Su=function(t){"Online"===this.state?this.vu("Unknown"):(this.gu++,this.gu>=1&&(this.Du(),this.bu("Connection failed 1 times. Most recent error: "+t.toString()),this.vu("Offline")))},t.prototype.set=function(t){this.Du(),this.gu=0,"Online"===t&&(this.Vu=!1),this.vu(t)},t.prototype.vu=function(t){t!==this.state&&(this.state=t,this.Pu(t))},t.prototype.bu=function(t){var e="Could not reach Cloud Firestore backend. "+t+"\nThis typically indicates that your device does not have a healthy Internet connection at the moment. The client will operate in offline mode until it is able to successfully connect to the backend.";this.Vu?(Nr(e),this.Vu=!1):kr("OnlineStateTracker",e)},t.prototype.Du=function(){null!==this.yu&&(this.yu.cancel(),this.yu=null)},t}(),_c=function(t,e,n,r,i){var o=this;this.Cu=t,this.Nu=e,this.di=n,this.xu={},this.Fu=[],this.Ou=new Map,this.Mu=new Set,this.ku=[],this.$u=i,this.$u.Lu((function(t){n.Ri((function(){return Object(w.b)(o,void 0,void 0,(function(){return Object(w.e)(this,(function(t){switch(t.label){case 0:return xc(this)?(kr("RemoteStore","Restarting streams for network reachability change."),[4,function(t){return Object(w.b)(this,void 0,void 0,(function(){var e;return Object(w.e)(this,(function(n){switch(n.label){case 0:return(e=Mr(t)).Mu.add(4),[4,Ec(e)];case 1:return n.sent(),e.Bu.set("Unknown"),e.Mu.delete(4),[4,wc(e)];case 2:return n.sent(),[2]}}))}))}(this)]):[3,2];case 1:t.sent(),t.label=2;case 2:return[2]}}))}))}))})),this.Bu=new bc(n,r)};function wc(t){return Object(w.b)(this,void 0,void 0,(function(){var e,n;return Object(w.e)(this,(function(r){switch(r.label){case 0:if(!xc(t))return[3,4];e=0,n=t.ku,r.label=1;case 1:return e<n.length?[4,(0,n[e])(!0)]:[3,4];case 2:r.sent(),r.label=3;case 3:return e++,[3,1];case 4:return[2]}}))}))}function Ec(t){return Object(w.b)(this,void 0,void 0,(function(){var e,n;return Object(w.e)(this,(function(r){switch(r.label){case 0:e=0,n=t.ku,r.label=1;case 1:return e<n.length?[4,(0,n[e])(!1)]:[3,4];case 2:r.sent(),r.label=3;case 3:return e++,[3,1];case 4:return[2]}}))}))}function Oc(t,e){var n=Mr(t);n.Ou.has(e.targetId)||(n.Ou.set(e.targetId,e),jc(n)?Ic(n):Bc(n).zc()&&Tc(n,e))}function Cc(t,e){var n=Mr(t),r=Bc(n);n.Ou.delete(e),r.zc()&&Sc(n,e),0===n.Ou.size&&(r.zc()?r.Yc():xc(n)&&n.Bu.set("Unknown"))}function Tc(t,e){t.qu.De(e.targetId),Bc(t).hu(e)}function Sc(t,e){t.qu.De(e),Bc(t).lu(e)}function Ic(t){t.qu=new qi({Xe:function(e){return t.xu.Xe(e)},Ze:function(e){return t.Ou.get(e)||null}}),Bc(t).start(),t.Bu.pu()}function jc(t){return xc(t)&&!Bc(t).Gc()&&t.Ou.size>0}function xc(t){return 0===Mr(t).Mu.size}function Ac(t){t.qu=void 0}function kc(t){return Object(w.b)(this,void 0,void 0,(function(){return Object(w.e)(this,(function(e){return t.Ou.forEach((function(e,n){Tc(t,e)})),[2]}))}))}function Nc(t,e){return Object(w.b)(this,void 0,void 0,(function(){return Object(w.e)(this,(function(n){return Ac(t),jc(t)?(t.Bu.Su(e),Ic(t)):t.Bu.set("Unknown"),[2]}))}))}function Rc(t,e,n){return Object(w.b)(this,void 0,void 0,(function(){var r,i,o;return Object(w.e)(this,(function(s){switch(s.label){case 0:if(t.Bu.set("Online"),!(e instanceof $i&&2===e.state&&e.cause))return[3,6];s.label=1;case 1:return s.trys.push([1,3,,5]),[4,function(t,e){return Object(w.b)(this,void 0,void 0,(function(){var n,r,i,o;return Object(w.e)(this,(function(s){switch(s.label){case 0:n=e.cause,r=0,i=e.targetIds,s.label=1;case 1:return r<i.length?t.Ou.has(o=i[r])?[4,t.xu.Uu(o,n)]:[3,3]:[3,5];case 2:s.sent(),t.Ou.delete(o),t.qu.removeTarget(o),s.label=3;case 3:s.label=4;case 4:return r++,[3,1];case 5:return[2]}}))}))}(t,e)];case 2:return s.sent(),[3,5];case 3:return r=s.sent(),kr("RemoteStore","Failed to remove targets %s: %s ",e.targetIds.join(","),r),[4,Pc(t,r)];case 4:return s.sent(),[3,5];case 5:return[3,13];case 6:if(e instanceof Fi?t.qu.$e(e):e instanceof Ui?t.qu.je(e):t.qu.qe(e),n.isEqual(Yr.min()))return[3,13];s.label=7;case 7:return s.trys.push([7,11,,13]),[4,oc(t.Cu)];case 8:return i=s.sent(),n.F(i)>=0?[4,function(t,e){var n=t.qu.He(e);return n.re.forEach((function(n,r){if(n.resumeToken.ht()>0){var i=t.Ou.get(r);i&&t.Ou.set(r,i.wt(n.resumeToken,e))}})),n.oe.forEach((function(e){var n=t.Ou.get(e);if(n){t.Ou.set(e,n.wt(hi.lt,n.ft)),Sc(t,e);var r=new pi(n.target,e,1,n.sequenceNumber);Tc(t,r)}})),t.xu.Qu(n)}(t,n)]:[3,10];case 9:s.sent(),s.label=10;case 10:return[3,13];case 11:return kr("RemoteStore","Failed to raise snapshot:",o=s.sent()),[4,Pc(t,o)];case 12:return s.sent(),[3,13];case 13:return[2]}}))}))}function Pc(t,e,n){return Object(w.b)(this,void 0,void 0,(function(){var r=this;return Object(w.e)(this,(function(i){switch(i.label){case 0:if(!Sa(e))throw e;return t.Mu.add(1),[4,Ec(t)];case 1:return i.sent(),t.Bu.set("Offline"),n||(n=function(){return oc(t.Cu)}),t.di.Mi((function(){return Object(w.b)(r,void 0,void 0,(function(){return Object(w.e)(this,(function(e){switch(e.label){case 0:return kr("RemoteStore","Retrying IndexedDB access"),[4,n()];case 1:return e.sent(),t.Mu.delete(1),[4,wc(t)];case 2:return e.sent(),[2]}}))}))})),[2]}}))}))}function Dc(t,e){return e().catch((function(n){return Pc(t,n,e)}))}function Lc(t){return Object(w.b)(this,void 0,void 0,(function(){var e,n,r,i,o;return Object(w.e)(this,(function(s){switch(s.label){case 0:e=Mr(t),n=zc(e),r=e.Fu.length>0?e.Fu[e.Fu.length-1].batchId:-1,s.label=1;case 1:if(!function(t){return xc(t)&&t.Fu.length<10}(e))return[3,7];s.label=2;case 2:return s.trys.push([2,4,,6]),[4,ac(e.Cu,r)];case 3:return null===(i=s.sent())?(0===e.Fu.length&&n.Yc(),[3,7]):(r=i.batchId,function(t,e){t.Fu.push(e);var n=zc(t);n.zc()&&n.fu&&n.du(e.mutations)}(e,i),[3,6]);case 4:return o=s.sent(),[4,Pc(e,o)];case 5:return s.sent(),[3,6];case 6:return[3,1];case 7:return Mc(e)&&Fc(e),[2]}}))}))}function Mc(t){return xc(t)&&!zc(t).Gc()&&t.Fu.length>0}function Fc(t){zc(t).start()}function Uc(t){return Object(w.b)(this,void 0,void 0,(function(){return Object(w.e)(this,(function(e){return zc(t).Tu(),[2]}))}))}function $c(t){return Object(w.b)(this,void 0,void 0,(function(){var e,n,r;return Object(w.e)(this,(function(i){for(e=zc(t),n=0,r=t.Fu;n<r.length;n++)e.du(r[n].mutations);return[2]}))}))}function Vc(t,e,n){return Object(w.b)(this,void 0,void 0,(function(){var r,i;return Object(w.e)(this,(function(o){switch(o.label){case 0:return r=t.Fu.shift(),i=la.from(r,e,n),[4,Dc(t,(function(){return t.xu.Ku(i)}))];case 1:return o.sent(),[4,Lc(t)];case 2:return o.sent(),[2]}}))}))}function qc(t,e){return Object(w.b)(this,void 0,void 0,(function(){return Object(w.e)(this,(function(n){switch(n.label){case 0:return e&&zc(t).fu?[4,function(t,e){return Object(w.b)(this,void 0,void 0,(function(){var n,r;return Object(w.e)(this,(function(i){switch(i.label){case 0:return yi(r=e.code)&&r!==Fr.ABORTED?(n=t.Fu.shift(),zc(t).Jc(),[4,Dc(t,(function(){return t.xu.Wu(n.batchId,e)}))]):[3,3];case 1:return i.sent(),[4,Lc(t)];case 2:i.sent(),i.label=3;case 3:return[2]}}))}))}(t,e)]:[3,2];case 1:n.sent(),n.label=2;case 2:return Mc(t)&&Fc(t),[2]}}))}))}function Hc(t,e){return Object(w.b)(this,void 0,void 0,(function(){var n;return Object(w.e)(this,(function(r){switch(r.label){case 0:return n=Mr(t),e?(n.Mu.delete(2),[4,wc(n)]):[3,2];case 1:return r.sent(),[3,5];case 2:return e?[3,4]:(n.Mu.add(2),[4,Ec(n)]);case 3:r.sent(),n.Bu.set("Unknown"),r.label=4;case 4:r.label=5;case 5:return[2]}}))}))}function Bc(t){var e=this;return t.ju||(t.ju=function(t,e,n){var r=Mr(t);return r.mu(),new yc(e,r.Qc,r.credentials,r.serializer,n)}(t.Nu,t.di,{cu:kc.bind(null,t),nu:Nc.bind(null,t),au:Rc.bind(null,t)}),t.ku.push((function(n){return Object(w.b)(e,void 0,void 0,(function(){return Object(w.e)(this,(function(e){switch(e.label){case 0:return n?(t.ju.Jc(),jc(t)?Ic(t):t.Bu.set("Unknown"),[3,3]):[3,1];case 1:return[4,t.ju.stop()];case 2:e.sent(),Ac(t),e.label=3;case 3:return[2]}}))}))}))),t.ju}function zc(t){var e=this;return t.Gu||(t.Gu=function(t,e,n){var r=Mr(t);return r.mu(),new vc(e,r.Qc,r.credentials,r.serializer,n)}(t.Nu,t.di,{cu:Uc.bind(null,t),nu:qc.bind(null,t),Eu:$c.bind(null,t),wu:Vc.bind(null,t)}),t.ku.push((function(n){return Object(w.b)(e,void 0,void 0,(function(){return Object(w.e)(this,(function(e){switch(e.label){case 0:return n?(t.Gu.Jc(),[4,Lc(t)]):[3,2];case 1:return e.sent(),[3,4];case 2:return[4,t.Gu.stop()];case 3:e.sent(),t.Fu.length>0&&(kr("RemoteStore","Stopping write stream with "+t.Fu.length+" pending writes"),t.Fu=[]),e.label=4;case 4:return[2]}}))}))}))),t.Gu}var Wc=function(){this.zu=void 0,this.listeners=[]},Gc=function(){this.queries=new ha((function(t){return Hs(t)}),qs),this.onlineState="Unknown",this.Hu=new Set};function Qc(t,e){return Object(w.b)(this,void 0,void 0,(function(){var n,r,i,o,s,a,u;return Object(w.e)(this,(function(c){switch(c.label){case 0:if(n=Mr(t),i=!1,(o=n.queries.get(r=e.query))||(i=!0,o=new Wc),!i)return[3,4];c.label=1;case 1:return c.trys.push([1,3,,4]),s=o,[4,n.Ju(r)];case 2:return s.zu=c.sent(),[3,4];case 3:return a=c.sent(),u=La(a,"Initialization of query '"+Bs(e.query)+"' failed"),[2,void e.onError(u)];case 4:return n.queries.set(r,o),o.listeners.push(e),e.Yu(n.onlineState),o.zu&&e.Xu(o.zu)&&Jc(n),[2]}}))}))}function Kc(t,e){return Object(w.b)(this,void 0,void 0,(function(){var n,r,i,o,s;return Object(w.e)(this,(function(a){return n=Mr(t),i=!1,(o=n.queries.get(r=e.query))&&(s=o.listeners.indexOf(e))>=0&&(o.listeners.splice(s,1),i=0===o.listeners.length),i?[2,(n.queries.delete(r),n.Zu(r))]:[2]}))}))}function Xc(t,e){for(var n=Mr(t),r=!1,i=0,o=e;i<o.length;i++){var s=o[i],a=n.queries.get(s.query);if(a){for(var u=0,c=a.listeners;u<c.length;u++)c[u].Xu(s)&&(r=!0);a.zu=s}}r&&Jc(n)}function Yc(t,e,n){var r=Mr(t),i=r.queries.get(e);if(i)for(var o=0,s=i.listeners;o<s.length;o++)s[o].onError(n);r.queries.delete(e)}function Jc(t){t.Hu.forEach((function(t){t.next()}))}var Zc=function(){function t(t,e,n){this.query=t,this.ta=e,this.ea=!1,this.na=null,this.onlineState="Unknown",this.options=n||{}}return t.prototype.Xu=function(t){if(!this.options.includeMetadataChanges){for(var e=[],n=0,r=t.docChanges;n<r.length;n++){var i=r[n];3!==i.type&&e.push(i)}t=new Di(t.query,t.docs,t.te,e,t.ee,t.fromCache,t.ne,!0)}var o=!1;return this.ea?this.sa(t)&&(this.ta.next(t),o=!0):this.ia(t,this.onlineState)&&(this.ra(t),o=!0),this.na=t,o},t.prototype.onError=function(t){this.ta.error(t)},t.prototype.Yu=function(t){this.onlineState=t;var e=!1;return this.na&&!this.ea&&this.ia(this.na,t)&&(this.ra(this.na),e=!0),e},t.prototype.ia=function(t,e){return!t.fromCache||!(this.options.oa&&"Offline"!==e||t.docs.W()&&"Offline"!==e)},t.prototype.sa=function(t){return t.docChanges.length>0||!!(t.ne||this.na&&this.na.hasPendingWrites!==t.hasPendingWrites)&&!0===this.options.includeMetadataChanges},t.prototype.ra=function(t){t=Di.ie(t.query,t.docs,t.ee,t.fromCache),this.ea=!0,this.ta.next(t)},t}(),tl=function(){function t(){this.ca=new wi(el.ua),this.aa=new wi(el.ha)}return t.prototype.W=function(){return this.ca.W()},t.prototype.Do=function(t,e){var n=new el(t,e);this.ca=this.ca.add(n),this.aa=this.aa.add(n)},t.prototype.la=function(t,e){var n=this;t.forEach((function(t){return n.Do(t,e)}))},t.prototype.No=function(t,e){this._a(new el(t,e))},t.prototype.fa=function(t,e){var n=this;t.forEach((function(t){return n.No(t,e)}))},t.prototype.da=function(t){var e=this,n=new ni(new Zr([])),r=new el(n,t),i=new el(n,t+1),o=[];return this.aa.Kt([r,i],(function(t){e._a(t),o.push(t.key)})),o},t.prototype.wa=function(){var t=this;this.ca.forEach((function(e){return t._a(e)}))},t.prototype._a=function(t){this.ca=this.ca.delete(t),this.aa=this.aa.delete(t)},t.prototype.Ea=function(t){var e=new ni(new Zr([])),n=new el(e,t),r=new el(e,t+1),i=Ai();return this.aa.Kt([n,r],(function(t){i=i.add(t.key)})),i},t.prototype.Qr=function(t){var e=new el(t,0),n=this.ca.jt(e);return null!==n&&t.isEqual(n.key)},t}(),el=function(){function t(t,e){this.key=t,this.Ta=e}return t.ua=function(t,e){return ni.$(t.key,e.key)||Gr(t.Ta,e.Ta)},t.ha=function(t,e){return Gr(t.Ta,e.Ta)||ni.$(t.key,e.key)},t}();function nl(t,e){return"firestore_clients_"+t+"_"+e}function rl(t,e,n){var r="firestore_mutations_"+t+"_"+n;return e.u()&&(r+="_"+e.uid),r}function il(t,e){return"firestore_targets_"+t+"_"+e}var ol=function(){function t(t,e,n,r){this.user=t,this.batchId=e,this.state=n,this.error=r}return t.Ia=function(e,n,r){var i=JSON.parse(r),o="object"==typeof i&&-1!==["pending","acknowledged","rejected"].indexOf(i.state)&&(void 0===i.error||"object"==typeof i.error),s=void 0;return o&&i.error&&(o="string"==typeof i.error.message&&"string"==typeof i.error.code)&&(s=new Ur(i.error.code,i.error.message)),o?new t(e,n,i.state,s):(Nr("SharedClientState","Failed to parse mutation state for ID '"+n+"': "+r),null)},t.prototype.ma=function(){var t={state:this.state,updateTimeMs:Date.now()};return this.error&&(t.error={code:this.error.code,message:this.error.message}),JSON.stringify(t)},t}(),sl=function(){function t(t,e,n){this.targetId=t,this.state=e,this.error=n}return t.Ia=function(e,n){var r=JSON.parse(n),i="object"==typeof r&&-1!==["not-current","current","rejected"].indexOf(r.state)&&(void 0===r.error||"object"==typeof r.error),o=void 0;return i&&r.error&&(i="string"==typeof r.error.message&&"string"==typeof r.error.code)&&(o=new Ur(r.error.code,r.error.message)),i?new t(e,r.state,o):(Nr("SharedClientState","Failed to parse target state for ID '"+e+"': "+n),null)},t.prototype.ma=function(){var t={state:this.state,updateTimeMs:Date.now()};return this.error&&(t.error={code:this.error.code,message:this.error.message}),JSON.stringify(t)},t}(),al=function(){function t(t,e){this.clientId=t,this.activeTargetIds=e}return t.Ia=function(e,n){for(var r=JSON.parse(n),i="object"==typeof r&&r.activeTargetIds instanceof Array,o=Ni(),s=0;i&&s<r.activeTargetIds.length;++s)i=oi(r.activeTargetIds[s]),o=o.add(r.activeTargetIds[s]);return i?new t(e,o):(Nr("SharedClientState","Failed to parse client data for instance '"+e+"': "+n),null)},t}(),ul=function(){function t(t,e){this.clientId=t,this.onlineState=e}return t.Ia=function(e){var n=JSON.parse(e);return"object"==typeof n&&-1!==["Unknown","Online","Offline"].indexOf(n.onlineState)&&"string"==typeof n.clientId?new t(n.clientId,n.onlineState):(Nr("SharedClientState","Failed to parse online state: "+e),null)},t}(),cl=function(){function t(){this.activeTargetIds=Ni()}return t.prototype.Aa=function(t){this.activeTargetIds=this.activeTargetIds.add(t)},t.prototype.Ra=function(t){this.activeTargetIds=this.activeTargetIds.delete(t)},t.prototype.ma=function(){var t={activeTargetIds:this.activeTargetIds.H(),updateTimeMs:Date.now()};return JSON.stringify(t)},t}(),ll=function(){function t(t,e,n,r,i){this.window=t,this.Cs=e,this.persistenceKey=n,this.Pa=r,this.ga=null,this.Pu=null,this.ps=null,this.ya=this.Va.bind(this),this.pa=new mi(Gr),this.lr=!1,this.va=[];var o=n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");this.storage=this.window.localStorage,this.currentUser=i,this.ba=nl(this.persistenceKey,this.Pa),this.Sa=function(t){return"firestore_sequence_number_"+t}(this.persistenceKey),this.pa=this.pa.Tt(this.Pa,new cl),this.Da=new RegExp("^firestore_clients_"+o+"_([^_]*)$"),this.Ca=new RegExp("^firestore_mutations_"+o+"_(\\d+)(?:_(.*))?$"),this.Na=new RegExp("^firestore_targets_"+o+"_(\\d+)$"),this.xa=function(t){return"firestore_online_state_"+t}(this.persistenceKey),this.Fa=function(t){return"firestore_bundle_loaded_"+t}(this.persistenceKey),this.window.addEventListener("storage",this.ya)}return t.Gs=function(t){return!(!t||!t.localStorage)},t.prototype.start=function(){return Object(w.b)(this,void 0,void 0,(function(){var t,e,n,r,i,o,s,a,u,c,l=this;return Object(w.e)(this,(function(h){switch(h.label){case 0:return[4,this.ga.Ic()];case 1:for(t=h.sent(),e=0,n=t;e<n.length;e++)(r=n[e])!==this.Pa&&(i=this.getItem(nl(this.persistenceKey,r)))&&(o=al.Ia(r,i))&&(this.pa=this.pa.Tt(o.clientId,o));for(this.Oa(),(s=this.storage.getItem(this.xa))&&(a=this.Ma(s))&&this.ka(a),u=0,c=this.va;u<c.length;u++)this.Va(c[u]);return this.va=[],this.window.addEventListener("unload",(function(){return l.fc()})),this.lr=!0,[2]}}))}))},t.prototype.Ss=function(t){this.setItem(this.Sa,JSON.stringify(t))},t.prototype.$a=function(){return this.La(this.pa)},t.prototype.Ba=function(t){var e=!1;return this.pa.forEach((function(n,r){r.activeTargetIds.has(t)&&(e=!0)})),e},t.prototype.qa=function(t){this.Ua(t,"pending")},t.prototype.Qa=function(t,e,n){this.Ua(t,e,n),this.Ka(t)},t.prototype.Wa=function(t){var e="not-current";if(this.Ba(t)){var n=this.storage.getItem(il(this.persistenceKey,t));if(n){var r=sl.Ia(t,n);r&&(e=r.state)}}return this.ja.Aa(t),this.Oa(),e},t.prototype.Ga=function(t){this.ja.Ra(t),this.Oa()},t.prototype.za=function(t){return this.ja.activeTargetIds.has(t)},t.prototype.Ha=function(t){this.removeItem(il(this.persistenceKey,t))},t.prototype.Ja=function(t,e,n){this.Ya(t,e,n)},t.prototype.Xa=function(t,e,n){var r=this;e.forEach((function(t){r.Ka(t)})),this.currentUser=t,n.forEach((function(t){r.qa(t)}))},t.prototype.Za=function(t){this.th(t)},t.prototype.eh=function(){this.nh()},t.prototype.fc=function(){this.lr&&(this.window.removeEventListener("storage",this.ya),this.removeItem(this.ba),this.lr=!1)},t.prototype.getItem=function(t){var e=this.storage.getItem(t);return kr("SharedClientState","READ",t,e),e},t.prototype.setItem=function(t,e){kr("SharedClientState","SET",t,e),this.storage.setItem(t,e)},t.prototype.removeItem=function(t){kr("SharedClientState","REMOVE",t),this.storage.removeItem(t)},t.prototype.Va=function(t){var e=this,n=t;if(n.storageArea===this.storage){if(kr("SharedClientState","EVENT",n.key,n.newValue),n.key===this.ba)return void Nr("Received WebStorage notification for local change. Another client might have garbage-collected our state");this.Cs.Mi((function(){return Object(w.b)(e,void 0,void 0,(function(){var t,e,r,i,o,s;return Object(w.e)(this,(function(a){if(this.lr){if(null!==n.key)if(this.Da.test(n.key)){if(null==n.newValue)return t=this.sh(n.key),[2,this.ih(t,null)];if(e=this.rh(n.key,n.newValue))return[2,this.ih(e.clientId,e)]}else if(this.Ca.test(n.key)){if(null!==n.newValue&&(r=this.oh(n.key,n.newValue)))return[2,this.uh(r)]}else if(this.Na.test(n.key)){if(null!==n.newValue&&(i=this.ah(n.key,n.newValue)))return[2,this.hh(i)]}else if(n.key===this.xa){if(null!==n.newValue&&(o=this.Ma(n.newValue)))return[2,this.ka(o)]}else if(n.key===this.Sa)(s=function(t){var e=wa.Ds;if(null!=t)try{var n=JSON.parse(t);Lr("number"==typeof n),e=n}catch(t){Nr("SharedClientState","Failed to read sequence number from WebStorage",t)}return e}(n.newValue))!==wa.Ds&&this.ps(s);else if(n.key===this.Fa)return[2,this.ga.lh()]}else this.va.push(n);return[2]}))}))}))}},Object.defineProperty(t.prototype,"ja",{get:function(){return this.pa.get(this.Pa)},enumerable:!1,configurable:!0}),t.prototype.Oa=function(){this.setItem(this.ba,this.ja.ma())},t.prototype.Ua=function(t,e,n){var r=new ol(this.currentUser,t,e,n),i=rl(this.persistenceKey,this.currentUser,t);this.setItem(i,r.ma())},t.prototype.Ka=function(t){var e=rl(this.persistenceKey,this.currentUser,t);this.removeItem(e)},t.prototype.th=function(t){this.storage.setItem(this.xa,JSON.stringify({clientId:this.Pa,onlineState:t}))},t.prototype.Ya=function(t,e,n){var r=il(this.persistenceKey,t),i=new sl(t,e,n);this.setItem(r,i.ma())},t.prototype.nh=function(){this.setItem(this.Fa,"value-not-used")},t.prototype.sh=function(t){var e=this.Da.exec(t);return e?e[1]:null},t.prototype.rh=function(t,e){var n=this.sh(t);return al.Ia(n,e)},t.prototype.oh=function(t,e){var n=this.Ca.exec(t),r=Number(n[1]);return ol.Ia(new jr(void 0!==n[2]?n[2]:null),r,e)},t.prototype.ah=function(t,e){var n=this.Na.exec(t),r=Number(n[1]);return sl.Ia(r,e)},t.prototype.Ma=function(t){return ul.Ia(t)},t.prototype.uh=function(t){return Object(w.b)(this,void 0,void 0,(function(){return Object(w.e)(this,(function(e){return t.user.uid===this.currentUser.uid?[2,this.ga._h(t.batchId,t.state,t.error)]:(kr("SharedClientState","Ignoring mutation for non-active user "+t.user.uid),[2])}))}))},t.prototype.hh=function(t){return this.ga.fh(t.targetId,t.state,t.error)},t.prototype.ih=function(t,e){var n=this,r=e?this.pa.Tt(t,e):this.pa.remove(t),i=this.La(this.pa),o=this.La(r),s=[],a=[];return o.forEach((function(t){i.has(t)||s.push(t)})),i.forEach((function(t){o.has(t)||a.push(t)})),this.ga.dh(s,a).then((function(){n.pa=r}))},t.prototype.ka=function(t){this.pa.get(t.clientId)&&this.Pu(t.onlineState)},t.prototype.La=function(t){var e=Ni();return t.forEach((function(t,n){e=e.Gt(n.activeTargetIds)})),e},t}(),hl=function(){function t(){this.wh=new cl,this.Eh={},this.Pu=null,this.ps=null}return t.prototype.qa=function(t){},t.prototype.Qa=function(t,e,n){},t.prototype.Wa=function(t){return this.wh.Aa(t),this.Eh[t]||"not-current"},t.prototype.Ja=function(t,e,n){this.Eh[t]=e},t.prototype.Ga=function(t){this.wh.Ra(t)},t.prototype.za=function(t){return this.wh.activeTargetIds.has(t)},t.prototype.Ha=function(t){delete this.Eh[t]},t.prototype.$a=function(){return this.wh.activeTargetIds},t.prototype.Ba=function(t){return this.wh.activeTargetIds.has(t)},t.prototype.start=function(){return this.wh=new cl,Promise.resolve()},t.prototype.Xa=function(t,e,n){},t.prototype.Za=function(t){},t.prototype.fc=function(){},t.prototype.Ss=function(t){},t.prototype.eh=function(){},t}(),dl=function(t){this.key=t},fl=function(t){this.key=t},pl=function(){function t(t,e){this.query=t,this.Th=e,this.Ih=null,this.le=!1,this.mh=Ai(),this.ee=Ai(),this.Ah=Ws(t),this.Rh=new Ri(this.Ah)}return Object.defineProperty(t.prototype,"Ph",{get:function(){return this.Th},enumerable:!1,configurable:!0}),t.prototype.gh=function(t,e){var n=this,r=e?e.yh:new Pi,i=e?e.Rh:this.Rh,o=e?e.ee:this.ee,s=i,a=!1,u=Ps(this.query)&&i.size===this.query.limit?i.last():null,c=Ds(this.query)&&i.size===this.query.limit?i.first():null;if(t.Pt((function(t,e){var l=i.get(t),h=e instanceof js?e:null;h&&(h=zs(n.query,h)?h:null);var d=!!l&&n.ee.has(l.key),f=!!h&&(h.an||n.ee.has(h.key)&&h.hasCommittedMutations),p=!1;l&&h?l.data().isEqual(h.data())?d!==f&&(r.track({type:3,doc:h}),p=!0):n.Vh(l,h)||(r.track({type:2,doc:h}),p=!0,(u&&n.Ah(h,u)>0||c&&n.Ah(h,c)<0)&&(a=!0)):!l&&h?(r.track({type:0,doc:h}),p=!0):l&&!h&&(r.track({type:1,doc:l}),p=!0,(u||c)&&(a=!0)),p&&(h?(s=s.add(h),o=f?o.add(t):o.delete(t)):(s=s.delete(t),o=o.delete(t)))})),Ps(this.query)||Ds(this.query))for(;s.size>this.query.limit;){var l=Ps(this.query)?s.last():s.first();s=s.delete(l.key),o=o.delete(l.key),r.track({type:1,doc:l})}return{Rh:s,yh:r,ph:a,ee:o}},t.prototype.Vh=function(t,e){return t.an&&e.hasCommittedMutations&&!e.an},t.prototype.Zn=function(t,e,n){var r=this,i=this.Rh;this.Rh=t.Rh,this.ee=t.ee;var o=t.yh.Zt();o.sort((function(t,e){return function(t,e){var n=function(t){switch(t){case 0:return 1;case 2:case 3:return 2;case 1:return 0;default:return Dr()}};return n(t)-n(e)}(t.type,e.type)||r.Ah(t.doc,e.doc)})),this.bh(n);var s=e?this.Sh():[],a=0===this.mh.size&&this.le?1:0,u=a!==this.Ih;return this.Ih=a,0!==o.length||u?{snapshot:new Di(this.query,t.Rh,i,o,t.ee,0===a,u,!1),Dh:s}:{Dh:s}},t.prototype.Yu=function(t){return this.le&&"Offline"===t?(this.le=!1,this.Zn({Rh:this.Rh,yh:new Pi,ee:this.ee,ph:!1},!1)):{Dh:[]}},t.prototype.Ch=function(t){return!this.Th.has(t)&&!!this.Rh.has(t)&&!this.Rh.get(t).an},t.prototype.bh=function(t){var e=this;t&&(t._e.forEach((function(t){return e.Th=e.Th.add(t)})),t.fe.forEach((function(t){})),t.de.forEach((function(t){return e.Th=e.Th.delete(t)})),this.le=t.le)},t.prototype.Sh=function(){var t=this;if(!this.le)return[];var e=this.mh;this.mh=Ai(),this.Rh.forEach((function(e){t.Ch(e.key)&&(t.mh=t.mh.add(e.key))}));var n=[];return e.forEach((function(e){t.mh.has(e)||n.push(new fl(e))})),this.mh.forEach((function(t){e.has(t)||n.push(new dl(t))})),n},t.prototype.Nh=function(t){this.Th=t.Bc,this.mh=Ai();var e=this.gh(t.documents);return this.Zn(e,!0)},t.prototype.xh=function(){return Di.ie(this.query,this.Rh,this.ee,0===this.Ih)},t}(),gl=function(t,e,n){this.query=t,this.targetId=e,this.view=n},yl=function(t){this.key=t,this.Fh=!1},vl=function(){function t(t,e,n,r,i,o){this.Cu=t,this.Oh=e,this.Mh=n,this.kh=r,this.currentUser=i,this.$h=o,this.Lh={},this.Bh=new ha((function(t){return Hs(t)}),qs),this.qh=new Map,this.Uh=[],this.Qh=new mi(ni.$),this.Kh=new Map,this.Wh=new tl,this.jh={},this.Gh=new Map,this.zh=qu._o(),this.onlineState="Unknown",this.Hh=void 0}return Object.defineProperty(t.prototype,"Jh",{get:function(){return!0===this.Hh},enumerable:!1,configurable:!0}),t}();function ml(t,e){return Object(w.b)(this,void 0,void 0,(function(){var n,r,i,o,s;return Object(w.e)(this,(function(a){switch(a.label){case 0:return n=Gl(t),(i=n.Bh.get(e))?(n.kh.Wa(i.targetId),r=i.view.xh(),[3,4]):[3,1];case 1:return[4,uc(n.Cu,$s(e))];case 2:return o=a.sent(),s=n.kh.Wa(o.targetId),[4,bl(n,e,o.targetId,"current"===s)];case 3:r=a.sent(),n.Jh&&Oc(n.Oh,o),a.label=4;case 4:return[2,r]}}))}))}function bl(t,e,n,r){return Object(w.b)(this,void 0,void 0,(function(){var i,o,s,a,u,c;return Object(w.e)(this,(function(l){switch(l.label){case 0:return t.Yh=function(e,n,r){return function(t,e,n,r){return Object(w.b)(this,void 0,void 0,(function(){var i,o,s;return Object(w.e)(this,(function(a){switch(a.label){case 0:return(i=e.view.gh(n)).ph?[4,lc(t.Cu,e.query,!1).then((function(t){return e.view.gh(t.documents,i)}))]:[3,2];case 1:i=a.sent(),a.label=2;case 2:return o=r&&r.re.get(e.targetId),s=e.view.Zn(i,t.Jh,o),[2,(Nl(t,e.targetId,s.Dh),s.snapshot)]}}))}))}(t,e,n,r)},[4,lc(t.Cu,e,!0)];case 1:return i=l.sent(),o=new pl(e,i.Bc),s=o.gh(i.documents),a=Mi.he(n,r&&"Offline"!==t.onlineState),u=o.Zn(s,t.Jh,a),Nl(t,n,u.Dh),c=new gl(e,n,o),[2,(t.Bh.set(e,c),t.qh.has(n)?t.qh.get(n).push(e):t.qh.set(n,[e]),u.snapshot)]}}))}))}function _l(t,e){return Object(w.b)(this,void 0,void 0,(function(){var n,r,i;return Object(w.e)(this,(function(o){switch(o.label){case 0:return n=Mr(t),r=n.Bh.get(e),(i=n.qh.get(r.targetId)).length>1?[2,(n.qh.set(r.targetId,i.filter((function(t){return!qs(t,e)}))),void n.Bh.delete(e))]:n.Jh?(n.kh.Ga(r.targetId),n.kh.Ba(r.targetId)?[3,2]:[4,cc(n.Cu,r.targetId,!1).then((function(){n.kh.Ha(r.targetId),Cc(n.Oh,r.targetId),Al(n,r.targetId)})).catch(pc)]):[3,3];case 1:o.sent(),o.label=2;case 2:return[3,5];case 3:return Al(n,r.targetId),[4,cc(n.Cu,r.targetId,!0)];case 4:o.sent(),o.label=5;case 5:return[2]}}))}))}function wl(t,e,n){return Object(w.b)(this,void 0,void 0,(function(){var r,i,o,s;return Object(w.e)(this,(function(a){switch(a.label){case 0:r=Ql(t),a.label=1;case 1:return a.trys.push([1,5,,6]),[4,function(t,e){var n,r=Mr(t),i=Xr.now(),o=e.reduce((function(t,e){return t.add(e.key)}),Ai());return r.persistence.runTransaction("Locally write mutations","readwrite",(function(t){return r.Oc._s(t,o).next((function(o){n=o;for(var s=[],a=0,u=e;a<u.length;a++){var c=u[a],l=fs(c,n.get(c.key));null!=l&&s.push(new vs(c.key,l,Ss(l.proto.mapValue),us.exists(!0)))}return r.rs.Sr(t,i,s,e)}))})).then((function(t){var e=t.vn(n);return{batchId:t.batchId,Qn:e}}))}(r.Cu,e)];case 2:return i=a.sent(),r.kh.qa(i.batchId),function(t,e,n){var r=t.jh[t.currentUser.h()];r||(r=new mi(Gr)),r=r.Tt(e,n),t.jh[t.currentUser.h()]=r}(r,i.batchId,n),[4,Dl(r,i.Qn)];case 3:return a.sent(),[4,Lc(r.Oh)];case 4:return a.sent(),[3,6];case 5:return o=a.sent(),s=La(o,"Failed to persist write"),n.reject(s),[3,6];case 6:return[2]}}))}))}function El(t,e){return Object(w.b)(this,void 0,void 0,(function(){var n,r;return Object(w.e)(this,(function(i){switch(i.label){case 0:n=Mr(t),i.label=1;case 1:return i.trys.push([1,4,,6]),[4,sc(n.Cu,e)];case 2:return r=i.sent(),e.re.forEach((function(t,e){var r=n.Kh.get(e);r&&(Lr(t._e.size+t.fe.size+t.de.size<=1),t._e.size>0?r.Fh=!0:t.fe.size>0?Lr(r.Fh):t.de.size>0&&(Lr(r.Fh),r.Fh=!1))})),[4,Dl(n,r,e)];case 3:return i.sent(),[3,6];case 4:return[4,pc(i.sent())];case 5:return i.sent(),[3,6];case 6:return[2]}}))}))}function Ol(t,e,n){var r=Mr(t);if(r.Jh&&0===n||!r.Jh&&1===n){var i=[];r.Bh.forEach((function(t,n){var r=n.view.Yu(e);r.snapshot&&i.push(r.snapshot)})),function(t,e){var n=Mr(t);n.onlineState=e;var r=!1;n.queries.forEach((function(t,n){for(var i=0,o=n.listeners;i<o.length;i++)o[i].Yu(e)&&(r=!0)})),r&&Jc(n)}(r.Mh,e),i.length&&r.Lh.au(i),r.onlineState=e,r.Jh&&r.kh.Za(e)}}function Cl(t,e,n){return Object(w.b)(this,void 0,void 0,(function(){var r,i,o,s,a,u;return Object(w.e)(this,(function(c){switch(c.label){case 0:return(r=Mr(t)).kh.Ja(e,"rejected",n),i=r.Kh.get(e),(o=i&&i.key)?(s=(s=new mi(ni.$)).Tt(o,new xs(o,Yr.min())),a=Ai().add(o),u=new Li(Yr.min(),new Map,new wi(Gr),s,a),[4,El(r,u)]):[3,2];case 1:return c.sent(),r.Qh=r.Qh.remove(o),r.Kh.delete(e),Pl(r),[3,4];case 2:return[4,cc(r.Cu,e,!1).then((function(){return Al(r,e,n)})).catch(pc)];case 3:c.sent(),c.label=4;case 4:return[2]}}))}))}function Tl(t,e){return Object(w.b)(this,void 0,void 0,(function(){var n,r,i;return Object(w.e)(this,(function(o){switch(o.label){case 0:n=Mr(t),r=e.batch.batchId,o.label=1;case 1:return o.trys.push([1,4,,6]),[4,ic(n.Cu,e)];case 2:return i=o.sent(),xl(n,r,null),jl(n,r),n.kh.Qa(r,"acknowledged"),[4,Dl(n,i)];case 3:return o.sent(),[3,6];case 4:return[4,pc(o.sent())];case 5:return o.sent(),[3,6];case 6:return[2]}}))}))}function Sl(t,e,n){return Object(w.b)(this,void 0,void 0,(function(){var r,i;return Object(w.e)(this,(function(o){switch(o.label){case 0:r=Mr(t),o.label=1;case 1:return o.trys.push([1,4,,6]),[4,function(t,e){var n=Mr(t);return n.persistence.runTransaction("Reject batch","readwrite-primary",(function(t){var r;return n.rs.Cr(t,e).next((function(e){return Lr(null!==e),r=e.keys(),n.rs.$r(t,e)})).next((function(){return n.rs.Ur(t)})).next((function(){return n.Oc._s(t,r)}))}))}(r.Cu,e)];case 2:return i=o.sent(),xl(r,e,n),jl(r,e),r.kh.Qa(e,"rejected",n),[4,Dl(r,i)];case 3:return o.sent(),[3,6];case 4:return[4,pc(o.sent())];case 5:return o.sent(),[3,6];case 6:return[2]}}))}))}function Il(t,e){return Object(w.b)(this,void 0,void 0,(function(){var n,r,i,o,s;return Object(w.e)(this,(function(a){switch(a.label){case 0:xc((n=Mr(t)).Oh)||kr("SyncEngine","The network is disabled. The task returned by 'awaitPendingWrites()' will not complete until the network is enabled."),a.label=1;case 1:return a.trys.push([1,3,,4]),[4,function(t){var e=Mr(t);return e.persistence.runTransaction("Get highest unacknowledged batch id","readonly",(function(t){return e.rs.Or(t)}))}(n.Cu)];case 2:return-1===(r=a.sent())?[2,void e.resolve()]:((i=n.Gh.get(r)||[]).push(e),n.Gh.set(r,i),[3,4]);case 3:return o=a.sent(),s=La(o,"Initialization of waitForPendingWrites() operation failed"),e.reject(s),[3,4];case 4:return[2]}}))}))}function jl(t,e){(t.Gh.get(e)||[]).forEach((function(t){t.resolve()})),t.Gh.delete(e)}function xl(t,e,n){var r=Mr(t),i=r.jh[r.currentUser.h()];if(i){var o=i.get(e);o&&(n?o.reject(n):o.resolve(),i=i.remove(e)),r.jh[r.currentUser.h()]=i}}function Al(t,e,n){void 0===n&&(n=null),t.kh.Ga(e);for(var r=0,i=t.qh.get(e);r<i.length;r++){var o=i[r];t.Bh.delete(o),n&&t.Lh.Xh(o,n)}t.qh.delete(e),t.Jh&&t.Wh.da(e).forEach((function(e){t.Wh.Qr(e)||kl(t,e)}))}function kl(t,e){var n=t.Qh.get(e);null!==n&&(Cc(t.Oh,n),t.Qh=t.Qh.remove(e),t.Kh.delete(n),Pl(t))}function Nl(t,e,n){for(var r=0,i=n;r<i.length;r++){var o=i[r];o instanceof dl?(t.Wh.Do(o.key,e),Rl(t,o)):o instanceof fl?(kr("SyncEngine","Document no longer in limbo: "+o.key),t.Wh.No(o.key,e),t.Wh.Qr(o.key)||kl(t,o.key)):Dr()}}function Rl(t,e){var n=e.key;t.Qh.get(n)||(kr("SyncEngine","New document in limbo: "+n),t.Uh.push(n),Pl(t))}function Pl(t){for(;t.Uh.length>0&&t.Qh.size<t.$h;){var e=t.Uh.shift(),n=t.zh.next();t.Kh.set(n,new yl(e)),t.Qh=t.Qh.Tt(e,n),Oc(t.Oh,new pi($s(Rs(e.path)),n,2,wa.Ds))}}function Dl(t,e,n){return Object(w.b)(this,void 0,void 0,(function(){var r,i,o,s;return Object(w.e)(this,(function(a){switch(a.label){case 0:return r=Mr(t),i=[],o=[],s=[],r.Bh.W()?[3,3]:(r.Bh.forEach((function(t,a){s.push(r.Yh(a,e,n).then((function(t){if(t){r.Jh&&r.kh.Ja(a.targetId,t.fromCache?"not-current":"current"),i.push(t);var e=_a.Vs(a.targetId,t);o.push(e)}})))})),[4,Promise.all(s)]);case 1:return a.sent(),r.Lh.au(i),[4,function(t,e){return Object(w.b)(this,void 0,void 0,(function(){var n,r,i,o,s,a,u,c;return Object(w.e)(this,(function(l){switch(l.label){case 0:n=Mr(t),l.label=1;case 1:return l.trys.push([1,3,,4]),[4,n.persistence.runTransaction("notifyLocalViewChanges","readwrite",(function(t){return da.forEach(e,(function(e){return da.forEach(e.gs,(function(r){return n.persistence.Vr.Do(t,e.targetId,r)})).next((function(){return da.forEach(e.ys,(function(r){return n.persistence.Vr.No(t,e.targetId,r)}))}))}))}))];case 2:return l.sent(),[3,4];case 3:if(!Sa(r=l.sent()))throw r;return kr("LocalStore","Failed to update sequence numbers: "+r),[3,4];case 4:for(i=0,o=e;i<o.length;i++)a=(s=o[i]).targetId,s.fromCache||(u=n.Cc.get(a),c=u.Et(u.ft),n.Cc=n.Cc.Tt(a,c));return[2]}}))}))}(r.Cu,o)];case 2:a.sent(),a.label=3;case 3:return[2]}}))}))}function Ll(t,e){return Object(w.b)(this,void 0,void 0,(function(){var n,r;return Object(w.e)(this,(function(i){switch(i.label){case 0:return(n=Mr(t)).currentUser.isEqual(e)?[3,3]:(kr("SyncEngine","User change. New user:",e.h()),[4,rc(n.Cu,e)]);case 1:return r=i.sent(),n.currentUser=e,function(t,e){t.Gh.forEach((function(t){t.forEach((function(t){t.reject(new Ur(Fr.CANCELLED,"'waitForPendingWrites' promise is rejected due to a user change."))}))})),t.Gh.clear()}(n),n.kh.Xa(e,r.$c,r.Lc),[4,Dl(n,r.kc)];case 2:i.sent(),i.label=3;case 3:return[2]}}))}))}function Ml(t,e){var n=Mr(t),r=n.Kh.get(e);if(r&&r.Fh)return Ai().add(r.key);var i=Ai(),o=n.qh.get(e);if(!o)return i;for(var s=0,a=o;s<a.length;s++){var u=n.Bh.get(a[s]);i=i.Gt(u.view.Ph)}return i}function Fl(t,e){return Object(w.b)(this,void 0,void 0,(function(){var n,r,i;return Object(w.e)(this,(function(o){switch(o.label){case 0:return[4,lc((n=Mr(t)).Cu,e.query,!0)];case 1:return r=o.sent(),i=e.view.Nh(r),[2,(n.Jh&&Nl(n,e.targetId,i.Dh),i)]}}))}))}function Ul(t){return Object(w.b)(this,void 0,void 0,(function(){var e;return Object(w.e)(this,(function(n){return[2,dc((e=Mr(t)).Cu).then((function(t){return Dl(e,t)}))]}))}))}function $l(t,e,n,r){return Object(w.b)(this,void 0,void 0,(function(){var i,o;return Object(w.e)(this,(function(s){switch(s.label){case 0:return[4,function(t,e){var n=Mr(t),r=Mr(n.rs);return n.persistence.runTransaction("Lookup mutation documents","readonly",(function(t){return r.Nr(t,e).next((function(e){return e?n.Oc._s(t,e):da.resolve(null)}))}))}((i=Mr(t)).Cu,e)];case 1:return null===(o=s.sent())?[3,6]:"pending"!==n?[3,3]:[4,Lc(i.Oh)];case 2:return s.sent(),[3,4];case 3:"acknowledged"===n||"rejected"===n?(xl(i,e,r||null),jl(i,e),function(t,e){Mr(Mr(t).rs).Br(e)}(i.Cu,e)):Dr(),s.label=4;case 4:return[4,Dl(i,o)];case 5:return s.sent(),[3,7];case 6:kr("SyncEngine","Cannot apply mutation batch with id: "+e),s.label=7;case 7:return[2]}}))}))}function Vl(t,e){return Object(w.b)(this,void 0,void 0,(function(){var n,r,i,o,s,a,u;return Object(w.e)(this,(function(c){switch(c.label){case 0:return Gl(n=Mr(t)),Ql(n),!0!==e||!0===n.Hh?[3,3]:(r=n.kh.$a(),[4,ql(n,r.H())]);case 1:return i=c.sent(),n.Hh=!0,[4,Hc(n.Oh,!0)];case 2:for(c.sent(),o=0,s=i;o<s.length;o++)Oc(n.Oh,s[o]);return[3,7];case 3:return!1!==e||!1===n.Hh?[3,7]:(a=[],u=Promise.resolve(),n.qh.forEach((function(t,e){n.kh.za(e)?a.push(e):u=u.then((function(){return Al(n,e),cc(n.Cu,e,!0)})),Cc(n.Oh,e)})),[4,u]);case 4:return c.sent(),[4,ql(n,a)];case 5:return c.sent(),function(t){var e=Mr(t);e.Kh.forEach((function(t,n){Cc(e.Oh,n)})),e.Wh.wa(),e.Kh=new Map,e.Qh=new mi(ni.$)}(n),n.Hh=!1,[4,Hc(n.Oh,!1)];case 6:c.sent(),c.label=7;case 7:return[2]}}))}))}function ql(t,e,n){return Object(w.b)(this,void 0,void 0,(function(){var n,r,i,o,s,a,u,c,l,h,d,f,p;return Object(w.e)(this,(function(g){switch(g.label){case 0:n=Mr(t),r=[],i=[],o=0,s=e,g.label=1;case 1:return o<s.length?(u=void 0,(c=n.qh.get(a=s[o]))&&0!==c.length?[4,uc(n.Cu,$s(c[0]))]:[3,7]):[3,13];case 2:u=g.sent(),l=0,h=c,g.label=3;case 3:return l<h.length?(d=n.Bh.get(h[l]),[4,Fl(n,d)]):[3,6];case 4:(f=g.sent()).snapshot&&i.push(f.snapshot),g.label=5;case 5:return l++,[3,3];case 6:return[3,11];case 7:return[4,hc(n.Cu,a)];case 8:return p=g.sent(),[4,uc(n.Cu,p)];case 9:return u=g.sent(),[4,bl(n,Hl(p),a,!1)];case 10:g.sent(),g.label=11;case 11:r.push(u),g.label=12;case 12:return o++,[3,1];case 13:return[2,(n.Lh.au(i),r)]}}))}))}function Hl(t){return Ns(t.path,t.collectionGroup,t.orderBy,t.filters,t.limit,"F",t.startAt,t.endAt)}function Bl(t){var e=Mr(t);return Mr(Mr(e.Cu).persistence).Ic()}function zl(t,e,n,r){return Object(w.b)(this,void 0,void 0,(function(){var i,o,s;return Object(w.e)(this,(function(a){switch(a.label){case 0:return(i=Mr(t)).Hh?(kr("SyncEngine","Ignoring unexpected query state notification."),[3,8]):[3,1];case 1:if(!i.qh.has(e))return[3,8];switch(n){case"current":case"not-current":return[3,2];case"rejected":return[3,5]}return[3,7];case 2:return[4,dc(i.Cu)];case 3:return o=a.sent(),s=Li.ae(e,"current"===n),[4,Dl(i,o,s)];case 4:return a.sent(),[3,8];case 5:return[4,cc(i.Cu,e,!0)];case 6:return a.sent(),Al(i,e,r),[3,8];case 7:Dr(),a.label=8;case 8:return[2]}}))}))}function Wl(t,e,n){return Object(w.b)(this,void 0,void 0,(function(){var r,i,o,s,a,u,c,l,h;return Object(w.e)(this,(function(d){switch(d.label){case 0:if(!(r=Gl(t)).Hh)return[3,10];i=0,o=e,d.label=1;case 1:return i<o.length?r.qh.has(s=o[i])?(kr("SyncEngine","Adding an already active target "+s),[3,5]):[4,hc(r.Cu,s)]:[3,6];case 2:return a=d.sent(),[4,uc(r.Cu,a)];case 3:return u=d.sent(),[4,bl(r,Hl(a),u.targetId,!1)];case 4:d.sent(),Oc(r.Oh,u),d.label=5;case 5:return i++,[3,1];case 6:c=function(t){return Object(w.e)(this,(function(e){switch(e.label){case 0:return r.qh.has(t)?[4,cc(r.Cu,t,!1).then((function(){Cc(r.Oh,t),Al(r,t)})).catch(pc)]:[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}}))},l=0,h=n,d.label=7;case 7:return l<h.length?[5,c(h[l])]:[3,10];case 8:d.sent(),d.label=9;case 9:return l++,[3,7];case 10:return[2]}}))}))}function Gl(t){var e=Mr(t);return e.Oh.xu.Qu=El.bind(null,e),e.Oh.xu.Xe=Ml.bind(null,e),e.Oh.xu.Uu=Cl.bind(null,e),e.Lh.au=Xc.bind(null,e.Mh),e.Lh.Xh=Yc.bind(null,e.Mh),e}function Ql(t){var e=Mr(t);return e.Oh.xu.Ku=Tl.bind(null,e),e.Oh.xu.Wu=Sl.bind(null,e),e}var Kl=function(){function t(){}return t.prototype.Mc=function(t){this.Zh=t},t.prototype.ws=function(t,e,n,r){var i=this;return function(t){return 0===t.filters.length&&null===t.limit&&null==t.startAt&&null==t.endAt&&(0===t.Tn.length||1===t.Tn.length&&t.Tn[0].field.tt())}(e)||n.isEqual(Yr.min())?this.tl(t,e):this.Zh._s(t,r).next((function(o){var s=i.el(e,o);return(Ps(e)||Ds(e))&&i.ph(e.limitType,s,r,n)?i.tl(t,e):(Ar()<=O.a.DEBUG&&kr("IndexFreeQueryEngine","Re-using previous result from %s to execute query: %s",n.toString(),Bs(e)),i.Zh.ws(t,e,n).next((function(t){return s.forEach((function(e){t=t.Tt(e.key,e)})),t})))}))},t.prototype.el=function(t,e){var n=new wi(Ws(t));return e.forEach((function(e,r){r instanceof js&&zs(t,r)&&(n=n.add(r))})),n},t.prototype.ph=function(t,e,n,r){if(n.size!==e.size)return!0;var i="F"===t?e.last():e.first();return!!i&&(i.hasPendingWrites||i.version.F(r)>0)},t.prototype.tl=function(t,e){return Ar()<=O.a.DEBUG&&kr("IndexFreeQueryEngine","Using full collection scan to execute query:",Bs(e)),this.Zh.ws(t,e,Yr.min())},t}(),Xl=function(){function t(t,e){this.os=t,this.Vr=e,this.rs=[],this.nl=1,this.sl=new wi(el.ua)}return t.prototype.br=function(t){return da.resolve(0===this.rs.length)},t.prototype.Sr=function(t,e,n,r){var i=this.nl;this.nl++;var o=new ca(i,e,n,r);this.rs.push(o);for(var s=0,a=r;s<a.length;s++){var u=a[s];this.sl=this.sl.add(new el(u.key,i)),this.os.Dr(t,u.key.path.q())}return da.resolve(o)},t.prototype.Cr=function(t,e){return da.resolve(this.il(e))},t.prototype.Fr=function(t,e){var n=this.rl(e+1),r=n<0?0:n;return da.resolve(this.rs.length>r?this.rs[r]:null)},t.prototype.Or=function(){return da.resolve(0===this.rs.length?-1:this.nl-1)},t.prototype.Mr=function(t){return da.resolve(this.rs.slice())},t.prototype.us=function(t,e){var n=this,r=new el(e,0),i=new el(e,Number.POSITIVE_INFINITY),o=[];return this.sl.Kt([r,i],(function(t){var e=n.il(t.Ta);o.push(e)})),da.resolve(o)},t.prototype.ds=function(t,e){var n=this,r=new wi(Gr);return e.forEach((function(t){var e=new el(t,0),i=new el(t,Number.POSITIVE_INFINITY);n.sl.Kt([e,i],(function(t){r=r.add(t.Ta)}))})),da.resolve(this.ol(r))},t.prototype.Rs=function(t,e){var n=e.path,r=n.length+1,i=n;ni.ot(i)||(i=i.child(""));var o=new el(new ni(i),0),s=new wi(Gr);return this.sl.Wt((function(t){var e=t.key.path;return!!n.j(e)&&(e.length===r&&(s=s.add(t.Ta)),!0)}),o),da.resolve(this.ol(s))},t.prototype.ol=function(t){var e=this,n=[];return t.forEach((function(t){var r=e.il(t);null!==r&&n.push(r)})),n},t.prototype.$r=function(t,e){var n=this;Lr(0===this.cl(e.batchId,"removed")),this.rs.shift();var r=this.sl;return da.forEach(e.mutations,(function(i){var o=new el(i.key,e.batchId);return r=r.delete(o),n.Vr.qr(t,i.key)})).next((function(){n.sl=r}))},t.prototype.Br=function(t){},t.prototype.Qr=function(t,e){var n=new el(e,0),r=this.sl.jt(n);return da.resolve(e.isEqual(r&&r.key))},t.prototype.Ur=function(t){return da.resolve()},t.prototype.cl=function(t,e){return this.rl(t)},t.prototype.rl=function(t){return 0===this.rs.length?0:t-this.rs[0].batchId},t.prototype.il=function(t){var e=this.rl(t);return e<0||e>=this.rs.length?null:this.rs[e]},t}(),Yl=function(){function t(t,e){this.os=t,this.ul=e,this.docs=new mi(ni.$),this.size=0}return t.prototype.jn=function(t,e,n){var r=e.key,i=this.docs.get(r),o=i?i.size:0,s=this.ul(e);return this.docs=this.docs.Tt(r,{zn:e,size:s,readTime:n}),this.size+=s-o,this.os.Dr(t,r.path.q())},t.prototype.Hn=function(t){var e=this.docs.get(t);e&&(this.docs=this.docs.remove(t),this.size-=e.size)},t.prototype.Jn=function(t,e){var n=this.docs.get(e);return da.resolve(n?n.zn:null)},t.prototype.getEntries=function(t,e){var n=this,r=Ti();return e.forEach((function(t){var e=n.docs.get(t);r=r.Tt(t,e?e.zn:null)})),da.resolve(r)},t.prototype.ws=function(t,e,n){for(var r=Ii(),i=new ni(e.path.child("")),o=this.docs.Vt(i);o.Nt();){var s=o.Ct(),a=s.value,u=a.zn,c=a.readTime;if(!e.path.j(s.key.path))break;c.F(n)<=0||u instanceof js&&zs(e,u)&&(r=r.Tt(u.key,u))}return da.resolve(r)},t.prototype.al=function(t,e){return da.forEach(this.docs,(function(t){return e(t)}))},t.prototype.Xr=function(t){return new Jl(this)},t.prototype.eo=function(t){return da.resolve(this.size)},t}(),Jl=function(t){function e(e){var n=this;return(n=t.call(this)||this).no=e,n}return Object(w.d)(e,t),e.prototype.Zn=function(t){var e=this,n=[];return this.Qn.forEach((function(r,i){i&&i.zn?n.push(e.no.jn(t,i.zn,e.Wn(r))):e.no.Hn(r)})),da.qn(n)},e.prototype.Yn=function(t,e){return this.no.Jn(t,e)},e.prototype.Xn=function(t,e){return this.no.getEntries(t,e)},e}(fa),Zl=function(){function t(t){this.persistence=t,this.hl=new ha((function(t){return ui(t)}),ci),this.lastRemoteSnapshotVersion=Yr.min(),this.highestTargetId=0,this.ll=0,this._l=new tl,this.targetCount=0,this.fl=qu.lo()}return t.prototype.Ue=function(t,e){return this.hl.forEach((function(t,n){return e(n)})),da.resolve()},t.prototype.To=function(t){return da.resolve(this.lastRemoteSnapshotVersion)},t.prototype.Io=function(t){return da.resolve(this.ll)},t.prototype.fo=function(t){return this.highestTargetId=this.fl.next(),da.resolve(this.highestTargetId)},t.prototype.mo=function(t,e,n){return n&&(this.lastRemoteSnapshotVersion=n),e>this.ll&&(this.ll=e),da.resolve()},t.prototype.Ro=function(t){this.hl.set(t.target,t);var e=t.targetId;e>this.highestTargetId&&(this.fl=new qu(e),this.highestTargetId=e),t.sequenceNumber>this.ll&&(this.ll=t.sequenceNumber)},t.prototype.Ao=function(t,e){return this.Ro(e),this.targetCount+=1,da.resolve()},t.prototype.yo=function(t,e){return this.Ro(e),da.resolve()},t.prototype.Vo=function(t,e){return this.hl.delete(e.target),this._l.da(e.targetId),this.targetCount-=1,da.resolve()},t.prototype.mr=function(t,e,n){var r=this,i=0,o=[];return this.hl.forEach((function(s,a){a.sequenceNumber<=e&&null===n.get(a.targetId)&&(r.hl.delete(s),o.push(r.po(t,a.targetId)),i++)})),da.qn(o).next((function(){return i}))},t.prototype.vo=function(t){return da.resolve(this.targetCount)},t.prototype.bo=function(t,e){var n=this.hl.get(e)||null;return da.resolve(n)},t.prototype.So=function(t,e,n){return this._l.la(e,n),da.resolve()},t.prototype.Co=function(t,e,n){this._l.fa(e,n);var r=this.persistence.Vr,i=[];return r&&e.forEach((function(e){i.push(r.qr(t,e))})),da.qn(i)},t.prototype.po=function(t,e){return this._l.da(e),da.resolve()},t.prototype.xo=function(t,e){var n=this._l.Ea(e);return da.resolve(n)},t.prototype.Qr=function(t,e){return da.resolve(this._l.Qr(e))},t}(),th=function(){function t(t){this.serializer=t,this.dl=new Map,this.wl=new Map}return t.prototype.ro=function(t,e){return da.resolve(this.dl.get(e))},t.prototype.oo=function(t,e){var n;return this.dl.set(e.id,{id:(n=e).id,version:n.version,createTime:Eo(n.createTime)}),da.resolve()},t.prototype.co=function(t,e){return da.resolve(this.wl.get(e))},t.prototype.uo=function(t,e){var n;return this.wl.set(e.name,{name:(n=e).name,query:ru(n.bundledQuery),readTime:Eo(n.readTime)}),da.resolve()},t}(),eh=function(){function t(t,e){var n=this;this.El={},this.ko=new wa(0),this.$o=!1,this.$o=!0,this.Vr=t(this),this.jo=new Zl(this),this.os=new yu,this.ss=function(t,e){return new Yl(t,(function(t){return n.Vr.Tl(t)}))}(this.os),this.serializer=new Ga(e),this.Go=new th(this.serializer)}return t.prototype.start=function(){return Promise.resolve()},t.prototype.fc=function(){return this.$o=!1,Promise.resolve()},Object.defineProperty(t.prototype,"lr",{get:function(){return this.$o},enumerable:!1,configurable:!0}),t.prototype.tc=function(){},t.prototype.ec=function(){},t.prototype.Pc=function(){return this.os},t.prototype.mc=function(t){var e=this.El[t.h()];return e||(e=new Xl(this.os,this.Vr),this.El[t.h()]=e),e},t.prototype.Ac=function(){return this.jo},t.prototype.Rc=function(){return this.ss},t.prototype.gc=function(){return this.Go},t.prototype.runTransaction=function(t,e,n){var r=this;kr("MemoryPersistence","Starting transaction:",t);var i=new nh(this.ko.next());return this.Vr.Il(),n(i).next((function(t){return r.Vr.ml(i).next((function(){return t}))})).Ln().then((function(t){return i.ns(),t}))},t.prototype.Al=function(t,e){return da.Un(Object.values(this.El).map((function(n){return function(){return n.Qr(t,e)}})))},t}(),nh=function(t){function e(e){var n=this;return(n=t.call(this)||this).Fo=e,n}return Object(w.d)(e,t),e}(ma),rh=function(){function t(t){this.persistence=t,this.Rl=new tl,this.Pl=null}return t.gl=function(e){return new t(e)},Object.defineProperty(t.prototype,"yl",{get:function(){if(this.Pl)return this.Pl;throw Dr()},enumerable:!1,configurable:!0}),t.prototype.Do=function(t,e,n){return this.Rl.Do(n,e),this.yl.delete(n.toString()),da.resolve()},t.prototype.No=function(t,e,n){return this.Rl.No(n,e),this.yl.add(n.toString()),da.resolve()},t.prototype.qr=function(t,e){return this.yl.add(e.toString()),da.resolve()},t.prototype.removeTarget=function(t,e){var n=this;this.Rl.da(e.targetId).forEach((function(t){return n.yl.add(t.toString())}));var r=this.persistence.Ac();return r.xo(t,e.targetId).next((function(t){t.forEach((function(t){return n.yl.add(t.toString())}))})).next((function(){return r.Vo(t,e)}))},t.prototype.Il=function(){this.Pl=new Set},t.prototype.ml=function(t){var e=this,n=this.persistence.Rc().Xr();return da.forEach(this.yl,(function(r){var i=ni.st(r);return e.Vl(t,i).next((function(t){t||n.Hn(i)}))})).next((function(){return e.Pl=null,n.apply(t)}))},t.prototype.Sc=function(t,e){var n=this;return this.Vl(t,e).next((function(t){t?n.yl.delete(e.toString()):n.yl.add(e.toString())}))},t.prototype.Tl=function(t){return 0},t.prototype.Vl=function(t,e){var n=this;return da.Un([function(){return da.resolve(n.Rl.Qr(e))},function(){return n.persistence.Ac().Qr(t,e)},function(){return n.persistence.Al(t,e)}])},t}(),ih=function(){function t(t){this.pl=t.pl,this.vl=t.vl}return t.prototype.cu=function(t){this.bl=t},t.prototype.nu=function(t){this.Sl=t},t.prototype.onMessage=function(t){this.Dl=t},t.prototype.close=function(){this.vl()},t.prototype.send=function(t){this.pl(t)},t.prototype.Cl=function(){this.bl()},t.prototype.Nl=function(t){this.Sl(t)},t.prototype.xl=function(t){this.Dl(t)},t}(),oh={BatchGetDocuments:"batchGet",Commit:"commit",RunQuery:"runQuery"},sh=function(t){function e(e){var n=this;return(n=t.call(this,e)||this).forceLongPolling=e.forceLongPolling,n.i=e.i,n}return Object(w.d)(e,t),e.prototype.Ll=function(t,e,n,r){return new Promise((function(i,o){var s=new Cr;s.listenOnce(wr.COMPLETE,(function(){try{switch(s.getLastErrorCode()){case _r.NO_ERROR:var e=s.getResponseJson();kr("Connection","XHR received:",JSON.stringify(e)),i(e);break;case _r.TIMEOUT:kr("Connection",'RPC "'+t+'" timed out'),o(new Ur(Fr.DEADLINE_EXCEEDED,"Request time out"));break;case _r.HTTP_ERROR:var n=s.getStatus();if(kr("Connection",'RPC "'+t+'" failed with status:',n,"response text:",s.getResponseText()),n>0){var r=s.getResponseJson().error;if(r&&r.status&&r.message){var a=function(t){var e=t.toLowerCase().replace("_","-");return Object.values(Fr).indexOf(e)>=0?e:Fr.UNKNOWN}(r.status);o(new Ur(a,r.message))}else o(new Ur(Fr.UNKNOWN,"Server responded with status "+s.getStatus()))}else o(new Ur(Fr.UNAVAILABLE,"Connection failed."));break;default:Dr()}}finally{kr("Connection",'RPC "'+t+'" completed.')}}));var a=JSON.stringify(r);s.send(e,"POST",a,n,15)}))},e.prototype.uu=function(t,e){var n=[this.Ol,"/","google.firestore.v1.Firestore","/",t,"/channel"],r=new gr,i=ve(),o={httpSessionIdParam:"gsessionid",initMessageHeaders:{},messageUrlParams:{database:"projects/"+this.t.projectId+"/databases/"+this.t.database},sendRawJson:!0,supportsCrossDomainXhr:!0,internalChannelParams:{forwardChannelRequestTimeoutMs:6e5},forceLongPolling:this.forceLongPolling,detectBufferingProxy:this.i};this.$l(o.initMessageHeaders,e),Object(C.u)()||Object(C.x)()||Object(C.r)()||Object(C.t)()||Object(C.y)()||Object(C.q)()||(o.httpHeadersOverwriteParam="$httpHeaders");var s=n.join("");kr("Connection","Creating WebChannel: "+s,o);var a=r.createWebChannel(s,o),u=!1,c=!1,l=new ih({pl:function(t){c?kr("Connection","Not sending because WebChannel is closed:",t):(u||(kr("Connection","Opening WebChannel transport."),a.open(),u=!0),kr("Connection","WebChannel sending:",t),a.send(t))},vl:function(){return a.close()}}),h=function(t,e,n){t.listen(e,(function(t){try{n(t)}catch(t){setTimeout((function(){throw t}),0)}}))};return h(a,Or.EventType.OPEN,(function(){c||kr("Connection","WebChannel transport opened.")})),h(a,Or.EventType.CLOSE,(function(){c||(c=!0,kr("Connection","WebChannel transport closed"),l.Nl())})),h(a,Or.EventType.ERROR,(function(t){c||(c=!0,Rr("Connection","WebChannel transport errored:",t),l.Nl(new Ur(Fr.UNAVAILABLE,"The operation could not be completed")))})),h(a,Or.EventType.MESSAGE,(function(t){var e;if(!c){var n=t.data[0];Lr(!!n);var r=n.error||(null===(e=n[0])||void 0===e?void 0:e.error);if(r){kr("Connection","WebChannel received error:",r);var i=r.status,o=function(t){var e=di[t];if(void 0!==e)return vi(e)}(i),s=r.message;void 0===o&&(o=Fr.INTERNAL,s="Unknown error status: "+i+" with message "+r.message),c=!0,l.Nl(new Ur(o,s)),a.close()}else kr("Connection","WebChannel received:",n),l.xl(n)}})),h(i,Er.STAT_EVENT,(function(t){10===t.stat?kr("Connection","Detected buffering proxy"):11===t.stat&&kr("Connection","Detected no buffering proxy")})),setTimeout((function(){l.Cl()}),0),l},e}(function(){function t(t){this.Fl=t,this.t=t.t,this.Ol=(t.ssl?"https":"http")+"://"+t.host,this.Ml="projects/"+this.t.projectId+"/databases/"+this.t.database+"/documents"}return t.prototype.Au=function(t,e,n,r){var i=this.kl(t,e);kr("RestConnection","Sending: ",i,n);var o={};return this.$l(o,r),this.Ll(t,i,o,n).then((function(t){return kr("RestConnection","Received: ",t),t}),(function(e){throw Rr("RestConnection",t+" failed with error: ",e,"url: ",i,"request:",n),e}))},t.prototype.Ru=function(t,e,n,r){return this.Au(t,e,n,r)},t.prototype.$l=function(t,e){if(t["X-Goog-Api-Client"]="gl-js/ fire/8.1.1",t["Content-Type"]="text/plain",e)for(var n in e.T)e.T.hasOwnProperty(n)&&(t[n]=e.T[n])},t.prototype.kl=function(t,e){return this.Ol+"/v1/"+e+":"+oh[t]},t}()),ah=function(){function t(){var t=this;this.Bl=function(){return t.ql()},this.Ul=function(){return t.Ql()},this.Kl=[],this.Wl()}return t.prototype.Lu=function(t){this.Kl.push(t)},t.prototype.fc=function(){window.removeEventListener("online",this.Bl),window.removeEventListener("offline",this.Ul)},t.prototype.Wl=function(){window.addEventListener("online",this.Bl),window.addEventListener("offline",this.Ul)},t.prototype.ql=function(){kr("ConnectivityMonitor","Network connectivity changed: AVAILABLE");for(var t=0,e=this.Kl;t<e.length;t++)(0,e[t])(0)},t.prototype.Ql=function(){kr("ConnectivityMonitor","Network connectivity changed: UNAVAILABLE");for(var t=0,e=this.Kl;t<e.length;t++)(0,e[t])(1)},t.Gs=function(){return"undefined"!=typeof window&&void 0!==window.addEventListener&&void 0!==window.removeEventListener},t}(),uh=function(){function t(){}return t.prototype.Lu=function(t){},t.prototype.fc=function(){},t}(),ch=function(){function t(){this.synchronizeTabs=!1}return t.prototype.initialize=function(t){return Object(w.b)(this,void 0,void 0,(function(){return Object(w.e)(this,(function(e){switch(e.label){case 0:return this.serializer=ga(t.Fl.t),this.kh=this.jl(t),this.persistence=this.Gl(t),[4,this.persistence.start()];case 1:return e.sent(),this.zl=this.Hl(t),this.Cu=this.Jl(t),[2]}}))}))},t.prototype.Hl=function(t){return null},t.prototype.Jl=function(t){return nc(this.persistence,new Kl,t.Yl,this.serializer)},t.prototype.Gl=function(t){return new eh(rh.gl,this.serializer)},t.prototype.jl=function(t){return new hl},t.prototype.terminate=function(){return Object(w.b)(this,void 0,void 0,(function(){return Object(w.e)(this,(function(t){switch(t.label){case 0:return this.zl&&this.zl.stop(),[4,this.kh.fc()];case 1:return t.sent(),[4,this.persistence.fc()];case 2:return t.sent(),[2]}}))}))},t}(),lh=function(t){function e(e,n,r){var i=this;return(i=t.call(this)||this).Xl=e,i.cacheSizeBytes=n,i.forceOwnership=r,i.synchronizeTabs=!1,i}return Object(w.d)(e,t),e.prototype.initialize=function(e){return Object(w.b)(this,void 0,void 0,(function(){return Object(w.e)(this,(function(n){switch(n.label){case 0:return[4,t.prototype.initialize.call(this,e)];case 1:return n.sent(),[4,fc(this.Cu)];case 2:return n.sent(),[4,this.Xl.initialize(this,e)];case 3:return n.sent(),[4,Ql(this.Xl.ga)];case 4:return n.sent(),[4,Lc(this.Xl.Oh)];case 5:return n.sent(),[2]}}))}))},e.prototype.Jl=function(t){return nc(this.persistence,new Kl,t.Yl,this.serializer)},e.prototype.Hl=function(t){return new Va(this.persistence.Vr.cr,t.di)},e.prototype.Gl=function(t){var e=tc(t.Fl.t,t.Fl.persistenceKey),n=void 0!==this.cacheSizeBytes?$a.er(this.cacheSizeBytes):$a.ir;return new Ku(this.synchronizeTabs,e,t.clientId,n,t.di,Na(),Ra(),this.serializer,this.kh,!!this.forceOwnership)},e.prototype.jl=function(t){return new hl},e}(ch),hh=function(t){function e(e,n){var r=this;return(r=t.call(this,e,n,!1)||this).Xl=e,r.cacheSizeBytes=n,r.synchronizeTabs=!0,r}return Object(w.d)(e,t),e.prototype.initialize=function(e){return Object(w.b)(this,void 0,void 0,(function(){var n,r=this;return Object(w.e)(this,(function(i){switch(i.label){case 0:return[4,t.prototype.initialize.call(this,e)];case 1:return i.sent(),n=this.Xl.ga,this.kh instanceof ll?(this.kh.ga={_h:$l.bind(null,n),fh:zl.bind(null,n),dh:Wl.bind(null,n),Ic:Bl.bind(null,n),lh:Ul.bind(null,n)},[4,this.kh.start()]):[3,3];case 2:i.sent(),i.label=3;case 3:return[4,this.persistence.Zo((function(t){return Object(w.b)(r,void 0,void 0,(function(){return Object(w.e)(this,(function(e){switch(e.label){case 0:return[4,Vl(this.Xl.ga,t)];case 1:return e.sent(),this.zl&&(t&&!this.zl.lr?this.zl.start(this.Cu):t||this.zl.stop()),[2]}}))}))}))];case 4:return i.sent(),[2]}}))}))},e.prototype.jl=function(t){var e=Na();if(!ll.Gs(e))throw new Ur(Fr.UNIMPLEMENTED,"IndexedDB persistence is only available on platforms that support LocalStorage.");var n=tc(t.Fl.t,t.Fl.persistenceKey);return new ll(e,t.di,n,t.clientId,t.Yl)},e}(lh),dh=function(){function t(){}return t.prototype.initialize=function(t,e){return Object(w.b)(this,void 0,void 0,(function(){var n=this;return Object(w.e)(this,(function(r){switch(r.label){case 0:return this.Cu?[3,2]:(this.Cu=t.Cu,this.kh=t.kh,this.Nu=this.Zl(e),this.Oh=this.t_(e),this.Mh=this.e_(e),this.ga=this.n_(e,!t.synchronizeTabs),this.kh.Pu=function(t){return Ol(n.ga,t,1)},this.Oh.xu.s_=Ll.bind(null,this.ga),[4,Hc(this.Oh,this.ga.Jh)]);case 1:r.sent(),r.label=2;case 2:return[2]}}))}))},t.prototype.e_=function(t){return new Gc},t.prototype.Zl=function(t){var e=ga(t.Fl.t),n=new sh(t.Fl);return function(t,e,n){return new mc(t,e,n)}(t.credentials,n,e)},t.prototype.t_=function(t){var e,n,r,i,o,s=this;return e=this.Cu,n=this.Nu,r=t.di,i=function(t){return Ol(s.ga,t,0)},o=ah.Gs()?new ah:new uh,new _c(e,n,r,i,o)},t.prototype.n_=function(t,e){return function(t,e,n,r,i,o,s){var a=new vl(t,e,n,r,i,o);return s&&(a.Hh=!0),a}(this.Cu,this.Oh,this.Mh,this.kh,t.Yl,t.$h,e)},t.prototype.terminate=function(){return function(t){return Object(w.b)(this,void 0,void 0,(function(){var e;return Object(w.e)(this,(function(n){switch(n.label){case 0:return e=Mr(t),kr("RemoteStore","RemoteStore shutting down."),e.Mu.add(5),[4,Ec(e)];case 1:return n.sent(),e.$u.fc(),e.Bu.set("Unknown"),[2]}}))}))}(this.Oh)},t}(),fh=function(){function t(t){this.observer=t,this.muted=!1}return t.prototype.next=function(t){this.observer.next&&this.i_(this.observer.next,t)},t.prototype.error=function(t){this.observer.error?this.i_(this.observer.error,t):console.error("Uncaught Error in snapshot listener:",t)},t.prototype.r_=function(){this.muted=!0},t.prototype.i_=function(t,e){var n=this;this.muted||setTimeout((function(){n.muted||t(e)}),0)},t}(),ph=function(t){this.o_=t};function gh(t,e,n){if(!n)throw new Ur(Fr.INVALID_ARGUMENT,"Function "+t+"() cannot be called with an empty "+e+".")}function yh(t,e){if(void 0===e)return{merge:!1};if(void 0!==e.mergeFields&&void 0!==e.merge)throw new Ur(Fr.INVALID_ARGUMENT,"Invalid options passed to function "+t+'(): You cannot specify both "merge" and "mergeFields".');return e}function vh(t,e,n,r){if(!0===e&&!0===r)throw new Ur(Fr.INVALID_ARGUMENT,t+" and "+n+" cannot be used together.")}function mh(t){if(!ni.ot(t))throw new Ur(Fr.INVALID_ARGUMENT,"Invalid document reference. Document references must have an even number of segments, but "+t+" has "+t.length+".")}function bh(t){if(ni.ot(t))throw new Ur(Fr.INVALID_ARGUMENT,"Invalid collection reference. Collection references must have an odd number of segments, but "+t+" has "+t.length+".")}function _h(t){if(void 0===t)return"undefined";if(null===t)return"null";if("string"==typeof t)return t.length>20&&(t=t.substring(0,20)+"..."),JSON.stringify(t);if("number"==typeof t||"boolean"==typeof t)return""+t;if("object"==typeof t){if(t instanceof Array)return"an array";var e=function(t){if(t.constructor){var e=/function\s+([^\s(]+)\s*\(/.exec(t.constructor.toString());if(e&&e.length>1)return e[1]}return null}(t);return e?"a custom "+e+" object":"an object"}return"function"==typeof t?"a function":Dr()}function wh(t,e){if(t instanceof ph&&(t=t.o_),!(t instanceof e)){if(e.name===t.constructor.name)throw new Ur(Fr.INVALID_ARGUMENT,"Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?");var n=_h(t);throw new Ur(Fr.INVALID_ARGUMENT,"Expected type '"+e.name+"', but it was: "+n)}return t}function Eh(t,e){if(e<=0)throw new Ur(Fr.INVALID_ARGUMENT,"Function "+t+"() requires a positive number, but it was: "+e+".")}var Oh=function(t){this.c_=t},Ch=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(w.d)(e,t),e.prototype.u_=function(t){if(2!==t.a_)throw t.h_(1===t.a_?this.c_+"() can only appear at the top level of your update data":this.c_+"() cannot be used with set() unless you pass {merge:true}");return t.en.push(t.path),null},e.prototype.isEqual=function(t){return t instanceof e},e}(Oh);function Th(t,e,n){return new jd({a_:3,l_:e.settings.l_,methodName:t.c_,__:n},e.t,e.serializer,e.ignoreUndefinedProperties)}var Sh=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(w.d)(e,t),e.prototype.u_=function(t){return new ss(t.path,new Yo)},e.prototype.isEqual=function(t){return t instanceof e},e}(Oh),Ih=function(t){function e(e,n){var r=this;return(r=t.call(this,e)||this).f_=n,r}return Object(w.d)(e,t),e.prototype.u_=function(t){var e=Th(this,t,!0),n=this.f_.map((function(t){return Pd(t,e)})),r=new Jo(n);return new ss(t.path,r)},e.prototype.isEqual=function(t){return this===t},e}(Oh),jh=function(t){function e(e,n){var r=this;return(r=t.call(this,e)||this).f_=n,r}return Object(w.d)(e,t),e.prototype.u_=function(t){var e=Th(this,t,!0),n=this.f_.map((function(t){return Pd(t,e)})),r=new ts(n);return new ss(t.path,r)},e.prototype.isEqual=function(t){return this===t},e}(Oh),xh=function(t){function e(e,n){var r=this;return(r=t.call(this,e)||this).d_=n,r}return Object(w.d)(e,t),e.prototype.u_=function(t){var e=new ns(t.serializer,mo(t.serializer,this.d_));return new ss(t.path,e)},e.prototype.isEqual=function(t){return this===t},e}(Oh),Ah=function(){function t(t,e){if(!isFinite(t)||t<-90||t>90)throw new Ur(Fr.INVALID_ARGUMENT,"Latitude must be a number between -90 and 90, but was: "+t);if(!isFinite(e)||e<-180||e>180)throw new Ur(Fr.INVALID_ARGUMENT,"Longitude must be a number between -180 and 180, but was: "+e);this.w_=t,this.E_=e}return Object.defineProperty(t.prototype,"latitude",{get:function(){return this.w_},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"longitude",{get:function(){return this.E_},enumerable:!1,configurable:!0}),t.prototype.isEqual=function(t){return this.w_===t.w_&&this.E_===t.E_},t.prototype.toJSON=function(){return{latitude:this.w_,longitude:this.E_}},t.prototype.C=function(t){return Gr(this.w_,t.w_)||Gr(this.E_,t.E_)},t}(),kh=function(){function t(t){this.T_=t}return t.fromBase64String=function(e){try{return new t(hi.fromBase64String(e))}catch(e){throw new Ur(Fr.INVALID_ARGUMENT,"Failed to construct data from Base64 string: "+e)}},t.fromUint8Array=function(e){return new t(hi.fromUint8Array(e))},t.prototype.toBase64=function(){return this.T_.toBase64()},t.prototype.toUint8Array=function(){return this.T_.toUint8Array()},t.prototype.toString=function(){return"Bytes(base64: "+this.toBase64()+")"},t.prototype.isEqual=function(t){return this.T_.isEqual(t.T_)},t}(),Nh=new Map,Rh=function(){function t(t){var e;if(void 0===t.host){if(void 0!==t.ssl)throw new Ur(Fr.INVALID_ARGUMENT,"Can't provide ssl option if host option is not set");this.host="firestore.googleapis.com",this.ssl=!0}else this.host=t.host,this.ssl=null===(e=t.ssl)||void 0===e||e;if(this.credentials=t.credentials,this.ignoreUndefinedProperties=!!t.ignoreUndefinedProperties,void 0===t.cacheSizeBytes)this.cacheSizeBytes=41943040;else{if(-1!==t.cacheSizeBytes&&t.cacheSizeBytes<1048576)throw new Ur(Fr.INVALID_ARGUMENT,"cacheSizeBytes must be at least 1048576");this.cacheSizeBytes=t.cacheSizeBytes}this.experimentalForceLongPolling=!!t.experimentalForceLongPolling,this.experimentalAutoDetectLongPolling=!!t.experimentalAutoDetectLongPolling,vh("experimentalForceLongPolling",t.experimentalForceLongPolling,"experimentalAutoDetectLongPolling",t.experimentalAutoDetectLongPolling)}return t.prototype.isEqual=function(t){return this.host===t.host&&this.ssl===t.ssl&&this.credentials===t.credentials&&this.cacheSizeBytes===t.cacheSizeBytes&&this.experimentalForceLongPolling===t.experimentalForceLongPolling&&this.experimentalAutoDetectLongPolling===t.experimentalAutoDetectLongPolling&&this.ignoreUndefinedProperties===t.ignoreUndefinedProperties},t}(),Ph=function(){function t(t,e){this.I_="(lite)",this.m_=new Rh({}),this.A_=!1,t instanceof Ir?(this.R_=t,this.P_=new Vr):(this.g_=t,this.R_=function(t){if(!Object.prototype.hasOwnProperty.apply(t.options,["projectId"]))throw new Ur(Fr.INVALID_ARGUMENT,'"projectId" not provided in firebase.initializeApp.');return new Ir(t.options.projectId)}(t),this.P_=new qr(e))}return Object.defineProperty(t.prototype,"app",{get:function(){if(!this.g_)throw new Ur(Fr.FAILED_PRECONDITION,"Firestore was not initialized using the Firebase SDK. 'app' is not available");return this.g_},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"y_",{get:function(){return this.A_},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"V_",{get:function(){return void 0!==this.p_},enumerable:!1,configurable:!0}),t.prototype.v_=function(t){if(this.A_)throw new Ur(Fr.FAILED_PRECONDITION,"Firestore has already been started and its settings can no longer be changed. You can only modify settings before calling any other methods on a Firestore object.");this.m_=new Rh(t),void 0!==t.credentials&&(this.P_=function(t){if(!t)return new Vr;switch(t.type){case"gapi":var e=t.client;return Lr(!("object"!=typeof e||null===e||!e.auth||!e.auth.getAuthHeaderValueForFirstParty)),new Br(e,t.sessionIndex||"0");case"provider":return t.client;default:throw new Ur(Fr.INVALID_ARGUMENT,"makeCredentialsProvider failed due to invalid credential type")}}(t.credentials))},t.prototype.b_=function(){return this.m_},t.prototype.S_=function(){return this.A_=!0,this.m_},t.prototype._delete=function(){return this.p_||(this.p_=this.D_()),this.p_},t.prototype.D_=function(){return function(t){var e=Nh.get(t);e&&(kr("ComponentProvider","Removing Datastore"),Nh.delete(t),e.terminate())}(this),Promise.resolve()},t}();function Dh(){if("undefined"==typeof Uint8Array)throw new Ur(Fr.UNIMPLEMENTED,"Uint8Arrays are not available in this environment.")}function Lh(){if("undefined"==typeof atob)throw new Ur(Fr.UNIMPLEMENTED,"Blobs are unavailable in Firestore in this environment.")}var Mh=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(w.d)(e,t),e.fromBase64String=function(t){return Lh(),new e(kh.fromBase64String(t))},e.fromUint8Array=function(t){return Dh(),new e(kh.fromUint8Array(t))},e.prototype.toBase64=function(){return Lh(),this.o_.toBase64()},e.prototype.toUint8Array=function(){return Dh(),this.o_.toUint8Array()},e.prototype.isEqual=function(t){return this.o_.isEqual(t.o_)},e.prototype.toString=function(){return"Blob(base64: "+this.toBase64()+")"},e}(ph),Fh=function(){function t(){}return t.prototype.C_=function(t,e){switch(void 0===e&&(e="none"),Yi(t)){case 0:return null;case 1:return t.booleanValue;case 2:return io(t.integerValue||t.doubleValue);case 3:return this.N_(t.timestampValue);case 4:return this.x_(t,e);case 5:return t.stringValue;case 6:return this.F_(oo(t.bytesValue));case 7:return this.O_(t.referenceValue);case 8:return this.M_(t.geoPointValue);case 9:return this.k_(t.arrayValue,e);case 10:return this.L_(t.mapValue,e);default:throw Dr()}},t.prototype.L_=function(t,e){var n=this,r={};return Wi(t.fields||{},(function(t,i){r[t]=n.C_(i,e)})),r},t.prototype.M_=function(t){return new Ah(io(t.latitude),io(t.longitude))},t.prototype.k_=function(t,e){var n=this;return(t.values||[]).map((function(t){return n.C_(t,e)}))},t.prototype.x_=function(t,e){switch(e){case"previous":var n=function t(e){var n=e.mapValue.fields.__previous_value__;return Qi(n)?t(n):n}(t);return null==n?null:this.C_(n,e);case"estimate":return this.N_(Ki(t));default:return null}},t.prototype.N_=function(t){var e=ro(t);return new Xr(e.seconds,e.nanos)},t.prototype.B_=function(t,e){var n=Zr.Y(t);Lr(Wo(n));var r=new Ir(n.get(1),n.get(3)),i=new ni(n.B(5));return r.isEqual(e)||Nr("Document "+i+" contains a document reference within a different database ("+r.projectId+"/"+r.database+") which is not supported. It will be treated as a reference in the current database ("+e.projectId+"/"+e.database+") instead."),i},t}(),Uh=function(t){function e(e){var n=this;return(n=t.call(this)||this).firestore=e,n}return Object(w.d)(e,t),e.prototype.F_=function(t){return new Mh(new kh(t))},e.prototype.O_=function(t){var e=this.B_(t,this.firestore.R_);return ff.q_(e,this.firestore,null)},e}(Fh),$h=function(){function t(t,e,n,r,i){this.U_=t,this.Q_=e,this.K_=n,this.W_=r,this.j_=i}return Object.defineProperty(t.prototype,"id",{get:function(){return this.K_.path.K()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ref",{get:function(){return new rd(this.U_,this.j_,this.K_)},enumerable:!1,configurable:!0}),t.prototype.exists=function(){return null!==this.W_},t.prototype.data=function(){if(this.W_){if(this.j_){var t=new Vh(this.U_,this.Q_,this.K_,this.W_,null);return this.j_.fromFirestore(t)}return this.Q_.C_(this.W_.En())}},t.prototype.get=function(t){if(this.W_){var e=this.W_.data().field(qh("DocumentSnapshot.get",t));if(null!==e)return this.Q_.C_(e)}},t}(),Vh=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(w.d)(e,t),e.prototype.data=function(){return t.prototype.data.call(this)},e}($h);function qh(t,e){return"string"==typeof e?$d(t,e):e instanceof ph?e.o_.G_:e.G_}var Hh=function(){function t(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var n=0;n<t.length;++n)if(0===t[n].length)throw new Ur(Fr.INVALID_ARGUMENT,"Invalid field name at argument $(i + 1). Field names must not be empty.");this.G_=new ei(t)}return t.prototype.isEqual=function(t){return this.G_.isEqual(t.G_)},t}(),Bh=function(t){function e(e,n){var r=this;return(r=t.call(this,e,n)||this).z_=new Da,r.I_="name"in e?e.name:"[DEFAULT]",r}return Object(w.d)(e,t),e.prototype.D_=function(){return this.H_||lf(this),this.H_.terminate()},e}(Ph);function zh(t,e,n){var r=this,i=new pa;return t.di.enqueue((function(){return Object(w.b)(r,void 0,void 0,(function(){var r;return Object(w.e)(this,(function(o){switch(o.label){case 0:return o.trys.push([0,3,,4]),[4,Wd(t,n)];case 1:return o.sent(),[4,Gd(t,e)];case 2:return o.sent(),i.resolve(),[3,4];case 3:if(!function(t){return"FirebaseError"===t.name?t.code===Fr.FAILED_PRECONDITION||t.code===Fr.UNIMPLEMENTED:!("undefined"!=typeof DOMException&&t instanceof DOMException)||22===t.code||20===t.code||11===t.code}(r=o.sent()))throw r;return console.warn("Error enabling offline persistence. Falling back to persistence disabled: "+r),i.reject(r),[3,4];case 4:return[2]}}))}))})).then((function(){return i.promise}))}function Wh(t){if(t.y_||t.V_)throw new Ur(Fr.FAILED_PRECONDITION,"Firestore has already been started and persistence can no longer be enabled. You can only enable persistence before calling any other methods on a Firestore object.")}var Gh=function(t){function e(e,n,r,i,o,s){var a=this;return(a=t.call(this,e,n,r,i,s)||this).U_=e,a.J_=e,a.metadata=o,a}return Object(w.d)(e,t),e.prototype.exists=function(){return t.prototype.exists.call(this)},e.prototype.data=function(t){if(void 0===t&&(t={}),this.W_){if(this.j_){var e=new Qh(this.U_,this.Q_,this.K_,this.W_,this.metadata,null);return this.j_.fromFirestore(e,t)}return this.Q_.C_(this.W_.En(),t.serverTimestamps)}},e.prototype.get=function(t,e){if(void 0===e&&(e={}),this.W_){var n=this.W_.data().field(qh("DocumentSnapshot.get",t));if(null!==n)return this.Q_.C_(n,e.serverTimestamps)}},e}($h),Qh=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(w.d)(e,t),e.prototype.data=function(e){return void 0===e&&(e={}),t.prototype.data.call(this,e)},e}(Gh),Kh=function(){function t(t,e,n,r){this.U_=t,this.Q_=e,this.Y_=r,this.metadata=new vf(r.hasPendingWrites,r.fromCache),this.query=n}return Object.defineProperty(t.prototype,"docs",{get:function(){var t=[];return this.forEach((function(e){return t.push(e)})),t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){return this.Y_.docs.size},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"empty",{get:function(){return 0===this.size},enumerable:!1,configurable:!0}),t.prototype.forEach=function(t,e){var n=this;this.Y_.docs.forEach((function(r){t.call(e,new Qh(n.U_,n.Q_,r.key,r,new vf(n.Y_.ee.has(r.key),n.Y_.fromCache),n.query.j_))}))},t.prototype.docChanges=function(t){void 0===t&&(t={});var e=!!t.includeMetadataChanges;if(e&&this.Y_.se)throw new Ur(Fr.INVALID_ARGUMENT,"To include metadata changes with your document changes, you must also pass { includeMetadataChanges:true } to onSnapshot().");return this.X_&&this.Z_===e||(this.X_=function(t,e){if(t.Y_.te.W()){var n=0;return t.Y_.docChanges.map((function(e){return{type:"added",doc:new Qh(t.U_,t.Q_,e.doc.key,e.doc,new vf(t.Y_.ee.has(e.doc.key),t.Y_.fromCache),t.query.j_),oldIndex:-1,newIndex:n++}}))}var r=t.Y_.te;return t.Y_.docChanges.filter((function(t){return e||3!==t.type})).map((function(e){var n=new Qh(t.U_,t.Q_,e.doc.key,e.doc,new vf(t.Y_.ee.has(e.doc.key),t.Y_.fromCache),t.query.j_),i=-1,o=-1;return 0!==e.type&&(i=r.indexOf(e.doc.key),r=r.delete(e.doc.key)),1!==e.type&&(o=(r=r.add(e.doc)).indexOf(e.doc.key)),{type:Xh(e.type),doc:n,oldIndex:i,newIndex:o}}))}(this,e),this.Z_=e),this.X_},t}();function Xh(t){switch(t){case 0:return"added";case 2:case 3:return"modified";case 1:return"removed";default:return Dr()}}function Yh(t,e){return t instanceof Gh&&e instanceof Gh?t.U_===e.U_&&t.K_.isEqual(e.K_)&&(null===t.W_?null===e.W_:t.W_.isEqual(e.W_))&&t.j_===e.j_:t instanceof Kh&&e instanceof Kh&&t.U_===e.U_&&Ed(t.query,e.query)&&t.metadata.isEqual(e.metadata)&&t.Y_.isEqual(e.Y_)}var Jh=function(t){function e(e){var n=this;return(n=t.call(this)||this).firestore=e,n}return Object(w.d)(e,t),e.prototype.F_=function(t){return new kh(t)},e.prototype.O_=function(t){var e=this.B_(t,this.firestore.R_);return new rd(this.firestore,null,e)},e}(Fh);function Zh(t,e,n){for(var r=[],i=3;i<arguments.length;i++)r[i-3]=arguments[i];var o=wh(t.firestore,Bh),s=Od(o);return e instanceof ph&&(e=e.o_),ed(o,("string"==typeof e||e instanceof Hh?Nd(s,"updateDoc",t.K_,e,n,r):kd(s,"updateDoc",t.K_,e)).ef(t.K_,us.exists(!0)))}function td(t){for(var e,n,r,i=this,o=[],s=1;s<arguments.length;s++)o[s-1]=arguments[s];var a={includeMetadataChanges:!1},u=0;"object"!=typeof o[u]||ya(o[u])||(a=o[u],u++);var c,l,h,d={includeMetadataChanges:a.includeMetadataChanges};if(ya(o[u])){var f=o[u];o[u]=null===(e=f.next)||void 0===e?void 0:e.bind(f),o[u+1]=null===(n=f.error)||void 0===n?void 0:n.bind(f),o[u+2]=null===(r=f.complete)||void 0===r?void 0:r.bind(f)}if(t instanceof rd)l=wh(t.firestore,Bh),h=Rs(t.K_.path),c={next:function(e){o[u]&&o[u](nd(l,t,e))},error:o[u+1],complete:o[u+2]};else{l=wh(t.firestore,Bh),h=t.tf;var p=new Jh(l);c={next:function(e){o[u]&&o[u](new Kh(l,p,t,e))},error:o[u+1],complete:o[u+2]},yd(t.tf)}var g=cf(l),y=new fh(c),v=new Zc(h,y,d);return l.z_.Ri((function(){return Object(w.b)(i,void 0,void 0,(function(){var t;return Object(w.e)(this,(function(e){switch(e.label){case 0:return t=Qc,[4,tf(g)];case 1:return[2,t.apply(void 0,[e.sent(),v])]}}))}))})),function(){y.r_(),l.z_.Ri((function(){return Object(w.b)(i,void 0,void 0,(function(){var t;return Object(w.e)(this,(function(e){switch(e.label){case 0:return t=Kc,[4,tf(g)];case 1:return[2,t.apply(void 0,[e.sent(),v])]}}))}))}))}}function ed(t,e){return function(t,e){var n=this,r=new pa;return t.di.Ri((function(){return Object(w.b)(n,void 0,void 0,(function(){var n;return Object(w.e)(this,(function(i){switch(i.label){case 0:return n=wl,[4,Zd(t)];case 1:return[2,n.apply(void 0,[i.sent(),e,r])]}}))}))})),r.promise}(cf(t),e)}function nd(t,e,n){var r=n.docs.get(e.K_),i=new Jh(t);return new Gh(t,i,e.K_,r,new vf(n.hasPendingWrites,n.fromCache),e.j_)}var rd=function(){function t(t,e,n){this.j_=e,this.K_=n,this.type="document",this.firestore=t}return Object.defineProperty(t.prototype,"nf",{get:function(){return this.K_.path},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"id",{get:function(){return this.K_.path.K()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"path",{get:function(){return this.K_.path.J()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"parent",{get:function(){return new vd(this.firestore,this.j_,this.K_.path.q())},enumerable:!1,configurable:!0}),t.prototype.withConverter=function(e){return new t(this.firestore,e,this.K_)},t}(),id=function(){function t(t,e,n){this.j_=e,this.tf=n,this.type="query",this.firestore=t}return t.prototype.withConverter=function(e){return new t(this.firestore,e,this.tf)},t}(),od=function(){};function sd(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0,i=e;r<i.length;r++){var o=i[r];t=o.sf(t)}return t}var ad=function(t){function e(e,n,r){var i=this;return(i=t.call(this)||this).rf=e,i.cf=n,i.uf=r,i.type="where",i}return Object(w.d)(e,t),e.prototype.sf=function(t){var e=Od(t.firestore),n=function(t,e,n,r,i,o,s){var a;if(i.tt()){if("array-contains"===o||"array-contains-any"===o)throw new Ur(Fr.INVALID_ARGUMENT,"Invalid Query. You can't perform '"+o+"' queries on FieldPath.documentId().");if("in"===o||"not-in"===o){pd(s,o);for(var u=[],c=0,l=s;c<l.length;c++)u.push(fd(r,t,l[c]));a={arrayValue:{values:u}}}else a=fd(r,t,s)}else"in"!==o&&"not-in"!==o&&"array-contains-any"!==o||pd(s,o),a=Rd(n,"where",s,"in"===o||"not-in"===o);var h=Gs.create(i,o,a);return function(t,e){if(e.An()){var n=Ms(t);if(null!==n&&!n.isEqual(e.field))throw new Ur(Fr.INVALID_ARGUMENT,"Invalid query. All where filters with an inequality (<, <=, >, or >=) must be on the same field. But you have inequality filters on '"+n.toString()+"' and '"+e.field.toString()+"'");var r=Ls(t);null!==r&&gd(0,e.field,r)}var i=function(t,e){for(var n=0,r=t.filters;n<r.length;n++){var i=r[n];if(e.indexOf(i.op)>=0)return i.op}return null}(t,function(t){switch(t){case"!=":return["!=","not-in"];case"array-contains":return["array-contains","array-contains-any","not-in"];case"in":return["array-contains-any","in","not-in"];case"array-contains-any":return["array-contains","array-contains-any","in","not-in"];case"not-in":return["array-contains","array-contains-any","in","not-in","!="];default:return[]}}(e.op));if(null!==i)throw new Ur(Fr.INVALID_ARGUMENT,i===e.op?"Invalid query. You cannot use more than one '"+e.op.toString()+"' filter.":"Invalid query. You cannot use '"+e.op.toString()+"' filters with '"+i.toString()+"' filters.")}(t,h),h}(t.tf,0,e,t.firestore.R_,this.rf,this.cf,this.uf);return new id(t.firestore,t.j_,function(t,e){var n=t.filters.concat([e]);return new ks(t.path,t.collectionGroup,t.Tn.slice(),n,t.limit,t.limitType,t.startAt,t.endAt)}(t.tf,n))},e}(od),ud=function(t){function e(e,n){var r=this;return(r=t.call(this)||this).rf=e,r.af=n,r.type="orderBy",r}return Object(w.d)(e,t),e.prototype.sf=function(t){var e=function(t,e,n){if(null!==t.startAt)throw new Ur(Fr.INVALID_ARGUMENT,"Invalid query. You must not call startAt() or startAfter() before calling orderBy().");if(null!==t.endAt)throw new Ur(Fr.INVALID_ARGUMENT,"Invalid query. You must not call endAt() or endBefore() before calling orderBy().");var r=new sa(e,n);return function(t,e){if(null===Ls(t)){var n=Ms(t);null!==n&&gd(0,n,e.field)}}(t,r),r}(t.tf,this.rf,this.af);return new id(t.firestore,t.j_,function(t,e){var n=t.Tn.concat([e]);return new ks(t.path,t.collectionGroup,n,t.filters.slice(),t.limit,t.limitType,t.startAt,t.endAt)}(t.tf,e))},e}(od),cd=function(t){function e(e,n,r){var i=this;return(i=t.call(this)||this).type=e,i.hf=n,i.lf=r,i}return Object(w.d)(e,t),e.prototype.sf=function(t){return new id(t.firestore,t.j_,Vs(t.tf,this.hf,this.lf))},e}(od),ld=function(t){function e(e,n,r){var i=this;return(i=t.call(this)||this).type=e,i._f=n,i.ff=r,i}return Object(w.d)(e,t),e.prototype.sf=function(t){var e=dd(t,this.type,this._f,this.ff);return new id(t.firestore,t.j_,function(t,e){return new ks(t.path,t.collectionGroup,t.Tn.slice(),t.filters.slice(),t.limit,t.limitType,e,t.endAt)}(t.tf,e))},e}(od),hd=function(t){function e(e,n,r){var i=this;return(i=t.call(this)||this).type=e,i._f=n,i.ff=r,i}return Object(w.d)(e,t),e.prototype.sf=function(t){var e=dd(t,this.type,this._f,this.ff);return new id(t.firestore,t.j_,function(t,e){return new ks(t.path,t.collectionGroup,t.Tn.slice(),t.filters.slice(),t.limit,t.limitType,t.startAt,e)}(t.tf,e))},e}(od);function dd(t,e,n,r){if(n[0]instanceof ph&&(n[0]=n[0].o_),n[0]instanceof $h)return function(t,e,n,r,i){if(!r)throw new Ur(Fr.NOT_FOUND,"Can't use a DocumentSnapshot that doesn't exist for "+n+"().");for(var o=[],s=0,a=Us(t);s<a.length;s++){var u=a[s];if(u.field.tt())o.push(so(e,r.key));else{var c=r.field(u.field);if(Qi(c))throw new Ur(Fr.INVALID_ARGUMENT,'Invalid query. You are trying to start or end a query using a document for which the field "'+u.field+'" is an uncommitted server timestamp. (Since the value of this field is unknown, you cannot start/end a query with it.)');if(null===c){var l=u.field.J();throw new Ur(Fr.INVALID_ARGUMENT,"Invalid query. You are trying to start or end a query using a document for which the field '"+l+"' (used as the orderBy) does not exist.")}o.push(c)}}return new na(o,i)}(t.tf,t.firestore.R_,e,n[0].W_,r);var i=Od(t.firestore);return function(t,e,n,r,i,o){var s=t.Tn;if(i.length>s.length)throw new Ur(Fr.INVALID_ARGUMENT,"Too many arguments provided to "+r+"(). The number of arguments must be less than or equal to the number of orderBy() clauses");for(var a=[],u=0;u<i.length;u++){var c=i[u];if(s[u].field.tt()){if("string"!=typeof c)throw new Ur(Fr.INVALID_ARGUMENT,"Invalid query. Expected a string for document ID in "+r+"(), but got a "+typeof c);if(!Fs(t)&&-1!==c.indexOf("/"))throw new Ur(Fr.INVALID_ARGUMENT,"Invalid query. When querying a collection and ordering by FieldPath.documentId(), the value passed to "+r+"() must be a plain document ID, but '"+c+"' contains a slash.");var l=t.path.child(Zr.Y(c));if(!ni.ot(l))throw new Ur(Fr.INVALID_ARGUMENT,"Invalid query. When querying a collection group and ordering by FieldPath.documentId(), the value passed to "+r+"() must result in a valid document path, but '"+l+"' is not because it contains an odd number of segments.");var h=new ni(l);a.push(so(e,h))}else{var d=Rd(n,r,c);a.push(d)}}return new na(a,o)}(t.tf,t.firestore.R_,i,e,n,r)}function fd(t,e,n){if(n instanceof ph&&(n=n.o_),"string"==typeof n){if(""===n)throw new Ur(Fr.INVALID_ARGUMENT,"Invalid query. When querying with FieldPath.documentId(), you must provide a valid document ID, but it was an empty string.");if(!Fs(e)&&-1!==n.indexOf("/"))throw new Ur(Fr.INVALID_ARGUMENT,"Invalid query. When querying a collection by FieldPath.documentId(), you must provide a plain document ID, but '"+n+"' contains a '/' character.");var r=e.path.child(Zr.Y(n));if(!ni.ot(r))throw new Ur(Fr.INVALID_ARGUMENT,"Invalid query. When querying a collection group by FieldPath.documentId(), the value provided must result in a valid document path, but '"+r+"' is not because it has an odd number of segments ("+r.length+").");return so(t,new ni(r))}if(n instanceof rd)return so(t,n.K_);throw new Ur(Fr.INVALID_ARGUMENT,"Invalid query. When querying with FieldPath.documentId(), you must provide a valid string or a DocumentReference, but it was: "+_h(n)+".")}function pd(t,e){if(!Array.isArray(t)||0===t.length)throw new Ur(Fr.INVALID_ARGUMENT,"Invalid Query. A non-empty array is required for '"+e.toString()+"' filters.");if(t.length>10)throw new Ur(Fr.INVALID_ARGUMENT,"Invalid Query. '"+e.toString()+"' filters support a maximum of 10 elements in the value array.")}function gd(t,e,n){if(!n.isEqual(e))throw new Ur(Fr.INVALID_ARGUMENT,"Invalid query. You have a where filter with an inequality (<, <=, >, or >=) on field '"+e.toString()+"' and so you must also use '"+e.toString()+"' as your first argument to orderBy(), but your first orderBy() is on field '"+n.toString()+"' instead.")}function yd(t){if(Ds(t)&&0===t.Tn.length)throw new Ur(Fr.UNIMPLEMENTED,"limitToLast() queries require specifying at least one orderBy() clause")}var vd=function(t){function e(e,n,r){var i=this;return(i=t.call(this,e,n,Rs(r))||this).firestore=e,i.nf=r,i.type="collection",i}return Object(w.d)(e,t),Object.defineProperty(e.prototype,"id",{get:function(){return this.tf.path.K()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"path",{get:function(){return this.tf.path.J()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parent",{get:function(){var t=this.nf.q();return t.W()?null:new rd(this.firestore,null,new ni(t))},enumerable:!1,configurable:!0}),e.prototype.withConverter=function(t){return new e(this.firestore,t,this.nf)},e}(id);function md(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];if(gh("collection","path",e),t instanceof Ph){var i=Zr.Y.apply(Zr,Object(w.h)([e],n));return bh(i),new vd(t,null,i)}if(!(t instanceof rd||t instanceof vd))throw new Ur(Fr.INVALID_ARGUMENT,"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");var o=Zr.Y.apply(Zr,Object(w.h)([t.path],n)).child(Zr.Y(e));return bh(o),new vd(t.firestore,null,o)}function bd(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];if(1===arguments.length&&(e=Wr.D()),gh("doc","path",e),t instanceof Ph){var i=Zr.Y.apply(Zr,Object(w.h)([e],n));return mh(i),new rd(t,null,new ni(i))}if(!(t instanceof rd||t instanceof vd))throw new Ur(Fr.INVALID_ARGUMENT,"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");var o=t.nf.child(Zr.Y.apply(Zr,Object(w.h)([e],n)));return mh(o),new rd(t.firestore,t instanceof vd?t.j_:null,new ni(o))}var _d=function(t){function e(e){var n=this;return(n=t.call(this)||this).firestore=e,n}return Object(w.d)(e,t),e.prototype.F_=function(t){return new kh(t)},e.prototype.O_=function(t){var e=this.B_(t,this.firestore.R_);return new rd(this.firestore,null,e)},e}(Fh);function wd(t,e){return(t instanceof rd||t instanceof vd)&&(e instanceof rd||e instanceof vd)&&t.firestore===e.firestore&&t.path===e.path&&t.j_===e.j_}function Ed(t,e){return t instanceof id&&e instanceof id&&t.firestore===e.firestore&&qs(t.tf,e.tf)&&t.j_===e.j_}function Od(t){var e=t.S_(),n=ga(t.R_);return new xd(t.R_,!!e.ignoreUndefinedProperties,n)}var Cd=/^__.*__$/,Td=function(){function t(t,e,n){this.data=t,this.en=e,this.fieldTransforms=n}return t.prototype.ef=function(t,e){var n=[];return n.push(null!==this.en?new vs(t,this.data,this.en,e):new ys(t,this.data,e)),this.fieldTransforms.length>0&&n.push(new bs(t,this.fieldTransforms)),n},t}(),Sd=function(){function t(t,e,n){this.data=t,this.en=e,this.fieldTransforms=n}return t.prototype.ef=function(t,e){var n=[new vs(t,this.data,this.en,e)];return this.fieldTransforms.length>0&&n.push(new bs(t,this.fieldTransforms)),n},t}();function Id(t){switch(t){case 0:case 2:case 1:return!0;case 3:case 4:return!1;default:throw Dr()}}var jd=function(){function t(t,e,n,r,i,o){this.settings=t,this.t=e,this.serializer=n,this.ignoreUndefinedProperties=r,void 0===i&&this.df(),this.fieldTransforms=i||[],this.en=o||[]}return Object.defineProperty(t.prototype,"path",{get:function(){return this.settings.path},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"a_",{get:function(){return this.settings.a_},enumerable:!1,configurable:!0}),t.prototype.wf=function(e){return new t(Object.assign(Object.assign({},this.settings),e),this.t,this.serializer,this.ignoreUndefinedProperties,this.fieldTransforms,this.en)},t.prototype.Ef=function(t){var e,n=null===(e=this.path)||void 0===e?void 0:e.child(t),r=this.wf({path:n,__:!1});return r.Tf(t),r},t.prototype.If=function(t){var e,n=null===(e=this.path)||void 0===e?void 0:e.child(t),r=this.wf({path:n,__:!1});return r.df(),r},t.prototype.mf=function(t){return this.wf({path:void 0,__:!0})},t.prototype.h_=function(t){return Vd(t,this.settings.methodName,this.settings.Af||!1,this.path,this.settings.l_)},t.prototype.contains=function(t){return void 0!==this.en.find((function(e){return t.j(e)}))||void 0!==this.fieldTransforms.find((function(e){return t.j(e.field)}))},t.prototype.df=function(){if(this.path)for(var t=0;t<this.path.length;t++)this.Tf(this.path.get(t))},t.prototype.Tf=function(t){if(0===t.length)throw this.h_("Document fields must not be empty");if(Id(this.a_)&&Cd.test(t))throw this.h_('Document fields cannot begin and end with "__"')},t}(),xd=function(){function t(t,e,n){this.t=t,this.ignoreUndefinedProperties=e,this.serializer=n||ga(t)}return t.prototype.Rf=function(t,e,n,r){return void 0===r&&(r=!1),new jd({a_:t,methodName:e,l_:n,path:ei.X(),__:!1,Af:r},this.t,this.serializer,this.ignoreUndefinedProperties)},t}();function Ad(t,e,n,r,i,o){void 0===o&&(o={});var s=t.Rf(o.merge||o.mergeFields?2:0,e,n,i);Md("Data must be an object, but it was:",s,r);var a,u,c=Dd(r,s);if(o.merge)a=new os(s.en),u=s.fieldTransforms;else if(o.mergeFields){for(var l=[],h=0,d=o.mergeFields;h<d.length;h++){var f=Fd(e,d[h],n);if(!s.contains(f))throw new Ur(Fr.INVALID_ARGUMENT,"Field '"+f+"' is specified in your field mask but missing from your input data.");qd(l,f)||l.push(f)}a=new os(l),u=s.fieldTransforms.filter((function(t){return a.un(t.field)}))}else a=null,u=s.fieldTransforms;return new Td(new Cs(c),a,u)}function kd(t,e,n,r){var i=t.Rf(1,e,n);Md("Data must be an object, but it was:",i,r);var o=[],s=new Ts;Wi(r,(function(t,r){var a=$d(e,t,n);r instanceof ph&&(r=r.o_);var u=i.If(a);if(r instanceof Ch)o.push(a);else{var c=Pd(r,u);null!=c&&(o.push(a),s.set(a,c))}}));var a=new os(o);return new Sd(s.hn(),a,i.fieldTransforms)}function Nd(t,e,n,r,i,o){var s=t.Rf(1,e,n),a=[Fd(e,r,n)],u=[i];if(o.length%2!=0)throw new Ur(Fr.INVALID_ARGUMENT,"Function "+e+"() needs to be called with an even number of arguments that alternate between field names and values.");for(var c=0;c<o.length;c+=2)a.push(Fd(e,o[c])),u.push(o[c+1]);for(var l=[],h=new Ts,d=a.length-1;d>=0;--d)if(!qd(l,a[d])){var f=a[d],p=u[d];p instanceof ph&&(p=p.o_);var g=s.If(f);if(p instanceof Ch)l.push(f);else{var y=Pd(p,g);null!=y&&(l.push(f),h.set(f,y))}}var v=new os(l);return new Sd(h.hn(),v,s.fieldTransforms)}function Rd(t,e,n,r){return void 0===r&&(r=!1),Pd(n,t.Rf(r?4:3,e))}function Pd(t,e){if(t instanceof ph&&(t=t.o_),Ld(t))return Md("Unsupported field value:",e,t),Dd(t,e);if(t instanceof Oh)return function(t,e){if(!Id(e.a_))throw e.h_(t.c_+"() can only be used with update() and set()");if(!e.path)throw e.h_(t.c_+"() is not currently supported inside arrays");var n=t.u_(e);n&&e.fieldTransforms.push(n)}(t,e),null;if(e.path&&e.en.push(e.path),t instanceof Array){if(e.settings.__&&4!==e.a_)throw e.h_("Nested arrays are not supported");return function(t,e){for(var n=[],r=0,i=0,o=t;i<o.length;i++){var s=Pd(o[i],e.mf(r));null==s&&(s={nullValue:"NULL_VALUE"}),n.push(s),r++}return{arrayValue:{values:n}}}(t,e)}return function(t,e){if(t instanceof ph&&(t=t.o_),null===t)return{nullValue:"NULL_VALUE"};if("number"==typeof t)return mo(e.serializer,t);if("boolean"==typeof t)return{booleanValue:t};if("string"==typeof t)return{stringValue:t};if(t instanceof Date){var n=Xr.fromDate(t);return{timestampValue:bo(e.serializer,n)}}if(t instanceof Xr){var r=new Xr(t.seconds,1e3*Math.floor(t.nanoseconds/1e3));return{timestampValue:bo(e.serializer,r)}}if(t instanceof Ah)return{geoPointValue:{latitude:t.latitude,longitude:t.longitude}};if(t instanceof kh)return{bytesValue:_o(e.serializer,t.T_)};if(t instanceof rd){var i=e.t,o=t.firestore.R_;if(!o.isEqual(i))throw e.h_("Document reference is for database "+o.projectId+"/"+o.database+" but should be for database "+i.projectId+"/"+i.database);return{referenceValue:Oo(t.firestore.R_||e.t,t.K_.path)}}if(void 0===t&&e.ignoreUndefinedProperties)return null;throw e.h_("Unsupported field value: "+_h(t))}(t,e)}function Dd(t,e){var n={};return Gi(t)?e.path&&e.path.length>0&&e.en.push(e.path):Wi(t,(function(t,r){var i=Pd(r,e.Ef(t));null!=i&&(n[t]=i)})),{mapValue:{fields:n}}}function Ld(t){return!("object"!=typeof t||null===t||t instanceof Array||t instanceof Date||t instanceof Xr||t instanceof Ah||t instanceof kh||t instanceof rd||t instanceof Oh)}function Md(t,e,n){if(!Ld(n)||!function(t){return"object"==typeof t&&null!==t&&(Object.getPrototypeOf(t)===Object.prototype||null===Object.getPrototypeOf(t))}(n)){var r=_h(n);throw e.h_("an object"===r?t+" a custom object":t+" "+r)}}function Fd(t,e,n){if(e instanceof ph&&(e=e.o_),e instanceof Hh)return e.G_;if("string"==typeof e)return $d(t,e);throw Vd("Field path arguments must be of type string or FieldPath.",t,!1,void 0,n)}var Ud=new RegExp("[~\\*/\\[\\]]");function $d(t,e,n){if(e.search(Ud)>=0)throw Vd("Invalid field path ("+e+"). Paths must not contain '~', '*', '/', '[', or ']'",t,!1,void 0,n);try{return(new(Hh.bind.apply(Hh,Object(w.h)([void 0],e.split("."))))).G_}catch(r){throw Vd("Invalid field path ("+e+"). Paths must not be empty, begin with '.', end with '.', or contain '..'",t,!1,void 0,n)}}function Vd(t,e,n,r,i){var o=r&&!r.W(),s=void 0!==i,a="Function "+e+"() called with invalid data";n&&(a+=" (via `toFirestore()`)");var u="";return(o||s)&&(u+=" (found",o&&(u+=" in field "+r),s&&(u+=" in document "+i),u+=")"),new Ur(Fr.INVALID_ARGUMENT,(a+=". ")+t+u)}function qd(t,e){return t.some((function(t){return t.isEqual(e)}))}var Hd=function(){function t(t){this.Nu=t,this.Pf=new Map,this.mutations=[],this.gf=!1,this.yf=null,this.Vf=new Set}return t.prototype.pf=function(t){return Object(w.b)(this,void 0,void 0,(function(){var e,n=this;return Object(w.e)(this,(function(r){switch(r.label){case 0:if(this.vf(),this.mutations.length>0)throw new Ur(Fr.INVALID_ARGUMENT,"Firestore transactions require all reads to be executed before all writes.");return[4,function(t,e){return Object(w.b)(this,void 0,void 0,(function(){var n,r,i,o,s,a;return Object(w.e)(this,(function(u){switch(u.label){case 0:return n=Mr(t),r=xo(n.serializer)+"/documents",i={documents:e.map((function(t){return To(n.serializer,t)}))},[4,n.Ru("BatchGetDocuments",r,i)];case 1:return o=u.sent(),s=new Map,o.forEach((function(t){var e=function(t,e){return"found"in e?function(t,e){Lr(!!e.found);var n=So(t,e.found.name),r=Eo(e.found.updateTime),i=new Cs({mapValue:{fields:e.found.fields}});return new js(n,r,i,{})}(t,e):"missing"in e?function(t,e){Lr(!!e.missing),Lr(!!e.readTime);var n=So(t,e.missing),r=Eo(e.readTime);return new xs(n,r)}(t,e):Dr()}(n.serializer,t);s.set(e.key.toString(),e)})),a=[],[2,(e.forEach((function(t){var e=s.get(t.toString());Lr(!!e),a.push(e)})),a)]}}))}))}(this.Nu,t)];case 1:return[2,((e=r.sent()).forEach((function(t){t instanceof xs||t instanceof js?n.bf(t):Dr()})),e)]}}))}))},t.prototype.set=function(t,e){this.write(e.ef(t,this.rn(t))),this.Vf.add(t.toString())},t.prototype.update=function(t,e){try{this.write(e.ef(t,this.Sf(t)))}catch(t){this.yf=t}this.Vf.add(t.toString())},t.prototype.delete=function(t){this.write([new Es(t,this.rn(t))]),this.Vf.add(t.toString())},t.prototype.commit=function(){return Object(w.b)(this,void 0,void 0,(function(){var t,e=this;return Object(w.e)(this,(function(n){switch(n.label){case 0:if(this.vf(),this.yf)throw this.yf;return t=this.Pf,this.mutations.forEach((function(e){t.delete(e.key.toString())})),t.forEach((function(t,n){var r=ni.st(n);e.mutations.push(new Os(r,e.rn(r)))})),[4,function(t,e){return Object(w.b)(this,void 0,void 0,(function(){var n,r,i;return Object(w.e)(this,(function(o){switch(o.label){case 0:return n=Mr(t),r=xo(n.serializer)+"/documents",i={writes:e.map((function(t){return No(n.serializer,t)}))},[4,n.Au("Commit",r,i)];case 1:return o.sent(),[2]}}))}))}(this.Nu,this.mutations)];case 1:return n.sent(),this.gf=!0,[2]}}))}))},t.prototype.bf=function(t){var e;if(t instanceof js)e=t.version;else{if(!(t instanceof xs))throw Dr();e=Yr.min()}var n=this.Pf.get(t.key.toString());if(n){if(!e.isEqual(n))throw new Ur(Fr.ABORTED,"Document version changed between two reads.")}else this.Pf.set(t.key.toString(),e)},t.prototype.rn=function(t){var e=this.Pf.get(t.toString());return!this.Vf.has(t.toString())&&e?us.updateTime(e):us.on()},t.prototype.Sf=function(t){var e=this.Pf.get(t.toString());if(!this.Vf.has(t.toString())&&e){if(e.isEqual(Yr.min()))throw new Ur(Fr.INVALID_ARGUMENT,"Can't update a document that doesn't exist.");return us.updateTime(e)}return us.exists(!0)},t.prototype.write=function(t){this.vf(),this.mutations=this.mutations.concat(t)},t.prototype.vf=function(){},t}(),Bd=function(){function t(t,e,n,r){this.di=t,this.Nu=e,this.updateFunction=n,this.Ti=r,this.Df=5,this.Si=new Ea(this.di,"transaction_retry")}return t.prototype.run=function(){this.Cf()},t.prototype.Cf=function(){var t=this;this.Si.Bs((function(){return Object(w.b)(t,void 0,void 0,(function(){var t,e,n=this;return Object(w.e)(this,(function(r){return t=new Hd(this.Nu),(e=this.Nf(t))&&e.then((function(e){n.di.Ri((function(){return t.commit().then((function(){n.Ti.resolve(e)})).catch((function(t){n.xf(t)}))}))})).catch((function(t){n.xf(t)})),[2]}))}))}))},t.prototype.Nf=function(t){try{var e=this.updateFunction(t);return!ri(e)&&e.catch&&e.then?e:(this.Ti.reject(Error("Transaction callback must return a Promise")),null)}catch(t){return this.Ti.reject(t),null}},t.prototype.xf=function(t){var e=this;this.Df>0&&this.Ff(t)?(this.Df-=1,this.di.Ri((function(){return e.Cf(),Promise.resolve()}))):this.Ti.reject(t)},t.prototype.Ff=function(t){if("FirebaseError"===t.name){var e=t.code;return"aborted"===e||"failed-precondition"===e||!yi(e)}return!1},t}(),zd=function(){function t(t,e,n){var r=this;this.credentials=t,this.di=e,this.Fl=n,this.user=jr.UNAUTHENTICATED,this.clientId=Wr.D(),this.Of=function(){},this.g=new pa,this.credentials.A((function(t){kr("FirestoreClient","Received user=",t.uid),r.user.isEqual(t)||(r.user=t,r.Of(t)),r.g.resolve()}))}return t.prototype.getConfiguration=function(){return Object(w.b)(this,void 0,void 0,(function(){return Object(w.e)(this,(function(t){switch(t.label){case 0:return[4,this.g.promise];case 1:return[2,(t.sent(),{di:this.di,Fl:this.Fl,clientId:this.clientId,credentials:this.credentials,Yl:this.user,$h:100})]}}))}))},t.prototype.Mf=function(t){var e=this;this.Of=t,this.g.promise.then((function(){return e.Of(e.user)}))},t.prototype.kf=function(){if(this.di.Ci)throw new Ur(Fr.FAILED_PRECONDITION,"The client has already been terminated.")},t.prototype.terminate=function(){var t=this;this.di.Oi();var e=new pa;return this.di.Ni((function(){return Object(w.b)(t,void 0,void 0,(function(){var t,n;return Object(w.e)(this,(function(r){switch(r.label){case 0:return r.trys.push([0,5,,6]),this.$f?[4,this.$f.terminate()]:[3,2];case 1:r.sent(),r.label=2;case 2:return this.Lf?[4,this.Lf.terminate()]:[3,4];case 3:r.sent(),r.label=4;case 4:return this.credentials.R(),e.resolve(),[3,6];case 5:return t=r.sent(),n=La(t,"Failed to shutdown persistence"),e.reject(n),[3,6];case 6:return[2]}}))}))})),e.promise},t}();function Wd(t,e){return Object(w.b)(this,void 0,void 0,(function(){var n,r=this;return Object(w.e)(this,(function(i){switch(i.label){case 0:return t.di.Li(),kr("FirestoreClient","Initializing OfflineComponentProvider"),[4,t.getConfiguration()];case 1:return n=i.sent(),[4,e.initialize(n)];case 2:return i.sent(),t.Mf((function(n){return t.di.Mi((function(){return Object(w.b)(r,void 0,void 0,(function(){return Object(w.e)(this,(function(t){switch(t.label){case 0:return[4,rc(e.Cu,n)];case 1:return t.sent(),[2]}}))}))}))})),e.persistence.tc((function(){return t.terminate()})),t.Lf=e,[2]}}))}))}function Gd(t,e){return Object(w.b)(this,void 0,void 0,(function(){var n,r;return Object(w.e)(this,(function(i){switch(i.label){case 0:return t.di.Li(),[4,Qd(t)];case 1:return n=i.sent(),kr("FirestoreClient","Initializing OnlineComponentProvider"),[4,t.getConfiguration()];case 2:return r=i.sent(),[4,e.initialize(n,r)];case 3:return i.sent(),t.Mf((function(n){return t.di.Mi((function(){return function(t,e){return Object(w.b)(this,void 0,void 0,(function(){var n,r;return Object(w.e)(this,(function(i){switch(i.label){case 0:return(n=Mr(t)).di.Li(),kr("RemoteStore","RemoteStore received new credentials"),r=xc(n),n.Mu.add(3),[4,Ec(n)];case 1:return i.sent(),r&&n.Bu.set("Unknown"),[4,n.xu.s_(e)];case 2:return i.sent(),n.Mu.delete(3),[4,wc(n)];case 3:return i.sent(),[2]}}))}))}(e.Oh,n)}))})),t.$f=e,[2]}}))}))}function Qd(t){return Object(w.b)(this,void 0,void 0,(function(){return Object(w.e)(this,(function(e){switch(e.label){case 0:return t.Lf?[3,2]:(kr("FirestoreClient","Using default OfflineComponentProvider"),[4,Wd(t,new ch)]);case 1:e.sent(),e.label=2;case 2:return[2,t.Lf]}}))}))}function Kd(t){return Object(w.b)(this,void 0,void 0,(function(){return Object(w.e)(this,(function(e){switch(e.label){case 0:return t.$f?[3,2]:(kr("FirestoreClient","Using default OnlineComponentProvider"),[4,Gd(t,new dh)]);case 1:e.sent(),e.label=2;case 2:return[2,t.$f]}}))}))}function Xd(t){return Qd(t).then((function(t){return t.persistence}))}function Yd(t){return Qd(t).then((function(t){return t.Cu}))}function Jd(t){return Kd(t).then((function(t){return t.Oh}))}function Zd(t){return Kd(t).then((function(t){return t.ga}))}function tf(t){return Object(w.b)(this,void 0,void 0,(function(){var e,n;return Object(w.e)(this,(function(r){switch(r.label){case 0:return[4,Kd(t)];case 1:return e=r.sent(),[2,((n=e.Mh).Ju=ml.bind(null,e.ga),n.Zu=_l.bind(null,e.ga),n)]}}))}))}function ef(t,e,n,r,i){var o=new fh({next:function(o){e.Ri((function(){return Kc(t,s)}));var a=o.docs.has(n);!a&&o.fromCache?i.reject(new Ur(Fr.UNAVAILABLE,"Failed to get document because the client is offline.")):a&&o.fromCache&&r&&"server"===r.source?i.reject(new Ur(Fr.UNAVAILABLE,'Failed to get document from server. (However, this document does exist in the local cache. Run again without setting source to "server" to retrieve the cached document.)')):i.resolve(o)},error:function(t){return i.reject(t)}}),s=new Zc(Rs(n.path),o,{includeMetadataChanges:!0,oa:!0});return Qc(t,s)}function nf(t,e,n,r,i){var o=new fh({next:function(n){e.Ri((function(){return Kc(t,s)})),n.fromCache&&"server"===r.source?i.reject(new Ur(Fr.UNAVAILABLE,'Failed to get documents from server. (However, these documents may exist in the local cache. Run again without setting source to "server" to retrieve the cached documents.)')):i.resolve(n)},error:function(t){return i.reject(t)}}),s=new Zc(n,o,{includeMetadataChanges:!0,oa:!0});return Qc(t,s)}var rf=function(){function t(t,e){this.U_=t,this.Bf=e,this.qf=[],this.Uf=!1,this.Qf=Od(t)}return t.prototype.set=function(t,e,n){this.Kf();var r=of(t,this.U_),i=Tf(r.j_,e,n),o=Ad(this.Qf,"WriteBatch.set",r.K_,i,null!==r.j_,n);return this.qf=this.qf.concat(o.ef(r.K_,us.on())),this},t.prototype.update=function(t,e,n){for(var r=[],i=3;i<arguments.length;i++)r[i-3]=arguments[i];this.Kf();var o,s=of(t,this.U_);return e instanceof ph&&(e=e.o_),o="string"==typeof e||e instanceof Hh?Nd(this.Qf,"WriteBatch.update",s.K_,e,n,r):kd(this.Qf,"WriteBatch.update",s.K_,e),this.qf=this.qf.concat(o.ef(s.K_,us.exists(!0))),this},t.prototype.delete=function(t){this.Kf();var e=of(t,this.U_);return this.qf=this.qf.concat(new Es(e.K_,us.on())),this},t.prototype.commit=function(){return this.Kf(),this.Uf=!0,this.qf.length>0?this.Bf(this.qf):Promise.resolve()},t.prototype.Kf=function(){if(this.Uf)throw new Ur(Fr.FAILED_PRECONDITION,"A write batch can no longer be used after commit() has been called.")},t}();function of(t,e){if(t instanceof ph&&(t=t.o_),t.firestore!==e)throw new Ur(Fr.INVALID_ARGUMENT,"Provided document reference is from a different Firestore instance.");return t}var sf=function(t){function e(e,n){var r=this;return(r=t.call(this,e,n)||this).U_=e,r}return Object(w.d)(e,t),e.prototype.get=function(e){var n=this,r=of(e,this.U_),i=new Jh(this.U_);return t.prototype.get.call(this,e).then((function(t){return new Gh(n.U_,i,r.K_,t.W_,new vf(!1,!1),r.j_)}))},e}(function(){function t(t,e){this.U_=t,this.Wf=e,this.Qf=Od(t)}return t.prototype.get=function(t){var e=this,n=of(t,this.U_),r=new _d(this.U_);return this.Wf.pf([n.K_]).then((function(t){if(!t||1!==t.length)return Dr();var i=t[0];if(i instanceof xs)return new $h(e.U_,r,n.K_,null,n.j_);if(i instanceof js)return new $h(e.U_,r,i.key,i,n.j_);throw Dr()}))},t.prototype.set=function(t,e,n){var r=of(t,this.U_),i=Tf(r.j_,e,n),o=Ad(this.Qf,"Transaction.set",r.K_,i,null!==r.j_,n);return this.Wf.set(r.K_,o),this},t.prototype.update=function(t,e,n){for(var r=[],i=3;i<arguments.length;i++)r[i-3]=arguments[i];var o,s=of(t,this.U_);return e instanceof ph&&(e=e.o_),o="string"==typeof e||e instanceof Hh?Nd(this.Qf,"Transaction.update",s.K_,e,n,r):kd(this.Qf,"Transaction.update",s.K_,e),this.Wf.update(s.K_,o),this},t.prototype.delete=function(t){var e=of(t,this.U_);return this.Wf.delete(e.K_),this},t}()),af=function(){function t(){}return t.prototype.enableIndexedDbPersistence=function(t,e){return function(t,e){Wh(t);var n=cf(t),r=t.S_(),i=new dh;return zh(n,i,new lh(i,r.cacheSizeBytes,null==e?void 0:e.forceOwnership))}(t.o_,{forceOwnership:e})},t.prototype.enableMultiTabIndexedDbPersistence=function(t){return function(t){Wh(t);var e=cf(t),n=t.S_(),r=new dh;return zh(e,r,new hh(r,n.cacheSizeBytes))}(t.o_)},t.prototype.clearIndexedDbPersistence=function(t){return function(t){var e=this;if(t.y_&&!t.V_)throw new Ur(Fr.FAILED_PRECONDITION,"Persistence can only be cleared before a Firestore instance is initialized or after it is terminated.");var n=new pa;return t.z_.Ni((function(){return Object(w.b)(e,void 0,void 0,(function(){var e;return Object(w.e)(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,function(t){return Object(w.b)(this,void 0,void 0,(function(){return Object(w.e)(this,(function(e){switch(e.label){case 0:return Oa.Gs()?[4,Oa.delete(t+"main")]:[2,Promise.resolve()];case 1:return e.sent(),[2]}}))}))}(tc(t.R_,t.I_))];case 1:return r.sent(),n.resolve(),[3,3];case 2:return e=r.sent(),n.reject(e),[3,3];case 3:return[2]}}))}))})),n.promise}(t.o_)},t}(),uf=function(t){function e(e,n,r){var i=this;return(i=t.call(this,n)||this).jf=r,i.INTERNAL={delete:function(){return i.terminate()}},e instanceof Ir||(i.Gf=e),i}return Object(w.d)(e,t),Object.defineProperty(e.prototype,"R_",{get:function(){return this.o_.R_},enumerable:!1,configurable:!0}),e.prototype.settings=function(t){t.merge&&delete(t=Object.assign(Object.assign({},this.o_.b_()),t)).merge,this.o_.v_(t)},e.prototype.useEmulator=function(t,e){"firestore.googleapis.com"!==this.o_.b_().host&&Rr("Host has been set in both settings() and useEmulator(), emulator host will be used"),this.settings({host:t+":"+e,ssl:!1,merge:!0})},e.prototype.enableNetwork=function(){return function(t){var e=this;return t.di.enqueue((function(){return Object(w.b)(e,void 0,void 0,(function(){var e,n;return Object(w.e)(this,(function(r){switch(r.label){case 0:return[4,Xd(t)];case 1:return e=r.sent(),[4,Jd(t)];case 2:return n=r.sent(),[2,(e.ec(!0),function(t){var e=Mr(t);return e.Mu.delete(0),wc(e)}(n))]}}))}))}))}(cf(this.o_))},e.prototype.disableNetwork=function(){return function(t){var e=this;return t.di.enqueue((function(){return Object(w.b)(e,void 0,void 0,(function(){var e,n;return Object(w.e)(this,(function(r){switch(r.label){case 0:return[4,Xd(t)];case 1:return e=r.sent(),[4,Jd(t)];case 2:return n=r.sent(),[2,(e.ec(!1),function(t){return Object(w.b)(this,void 0,void 0,(function(){var e;return Object(w.e)(this,(function(n){switch(n.label){case 0:return(e=Mr(t)).Mu.add(0),[4,Ec(e)];case 1:return n.sent(),e.Bu.set("Offline"),[2]}}))}))}(n))]}}))}))}))}(cf(this.o_))},e.prototype.enablePersistence=function(t){var e=!1,n=!1;return t&&vh("synchronizeTabs",e=!!t.synchronizeTabs,"experimentalForceOwningTab",n=!!t.experimentalForceOwningTab),e?this.jf.enableMultiTabIndexedDbPersistence(this):this.jf.enableIndexedDbPersistence(this,n)},e.prototype.clearPersistence=function(){return this.jf.clearIndexedDbPersistence(this)},e.prototype.terminate=function(){return this.app._removeServiceInstance("firestore"),this.app._removeServiceInstance("firestore-exp"),this.o_._delete()},e.prototype.waitForPendingWrites=function(){return function(t){var e=this,n=new pa;return t.di.Ri((function(){return Object(w.b)(e,void 0,void 0,(function(){var e;return Object(w.e)(this,(function(r){switch(r.label){case 0:return e=Il,[4,Zd(t)];case 1:return[2,e.apply(void 0,[r.sent(),n])]}}))}))})),n.promise}(cf(this.o_))},e.prototype.onSnapshotsInSync=function(t){return function(t,e){var n=this,r=cf(t),i=ya(e)?e:{next:e},o=new fh(i);return t.z_.Ri((function(){return Object(w.b)(n,void 0,void 0,(function(){var t;return Object(w.e)(this,(function(e){switch(e.label){case 0:return t=function(t,e){Mr(t).Hu.add(e),e.next()},[4,tf(r)];case 1:return t.apply(void 0,[e.sent(),o]),[2]}}))}))})),function(){o.r_(),t.z_.Ri((function(){return Object(w.b)(n,void 0,void 0,(function(){var t;return Object(w.e)(this,(function(e){switch(e.label){case 0:return t=function(t,e){Mr(t).Hu.delete(e)},[4,tf(r)];case 1:return t.apply(void 0,[e.sent(),o]),[2]}}))}))}))}}(this.o_,t)},Object.defineProperty(e.prototype,"app",{get:function(){if(!this.Gf)throw new Ur(Fr.FAILED_PRECONDITION,"Firestore was not initialized using the Firebase SDK. 'app' is not available");return this.Gf},enumerable:!1,configurable:!0}),e.prototype.collection=function(t){try{return new Of(this,md(this.o_,t))}catch(t){throw pf(t,"collection()","Firestore.collection()")}},e.prototype.doc=function(t){try{return new ff(this,bd(this.o_,t))}catch(t){throw pf(t,"doc()","Firestore.doc()")}},e.prototype.collectionGroup=function(t){try{return new _f(this,function(t,e){if(gh("collectionGroup","collection id",e),e.indexOf("/")>=0)throw new Ur(Fr.INVALID_ARGUMENT,"Invalid collection ID '"+e+"' passed to function collectionGroup(). Collection IDs must not contain '/'.");return new id(t,null,function(t){return new ks(Zr.X(),t)}(e))}(this.o_,t))}catch(t){throw pf(t,"collectionGroup()","Firestore.collectionGroup()")}},e.prototype.runTransaction=function(t){var e=this;return function(t,e){return function(t,e){var n=this,r=new pa;return t.di.Ri((function(){return Object(w.b)(n,void 0,void 0,(function(){var n;return Object(w.e)(this,(function(i){switch(i.label){case 0:return[4,function(t){return Kd(t).then((function(t){return t.Nu}))}(t)];case 1:return n=i.sent(),new Bd(t.di,n,e,r).run(),[2]}}))}))})),r.promise}(cf(t),(function(n){return e(new sf(t,n))}))}(this.o_,(function(n){return t(new hf(e,n))}))},e.prototype.batch=function(){var t=this;return cf(this.o_),new df(new rf(this.o_,(function(e){return ed(t.o_,e)})))},e}(ph);function cf(t){return t.H_||lf(t),t.H_.kf(),t.H_}function lf(t){var e=t.S_(),n=function(t,e,n){return new Sr(t,e,n.host,n.ssl,n.experimentalForceLongPolling,n.experimentalAutoDetectLongPolling)}(t.R_,t.I_,e);t.H_=new zd(t.P_,t.z_,n)}var hf=function(t){function e(e,n){var r=this;return(r=t.call(this,n)||this).U_=e,r}return Object(w.d)(e,t),e.prototype.get=function(t){var e=this,n=Cf(t);return this.o_.get(n).then((function(t){return new mf(e.U_,t)}))},e.prototype.set=function(t,e,n){var r=Cf(t);return n?(yh("Transaction.set",n),this.o_.set(r,e,n)):this.o_.set(r,e),this},e.prototype.update=function(t,e,n){for(var r,i=[],o=3;o<arguments.length;o++)i[o-3]=arguments[o];var s=Cf(t);return 2===arguments.length?this.o_.update(s,e):(r=this.o_).update.apply(r,Object(w.h)([s,e,n],i)),this},e.prototype.delete=function(t){var e=Cf(t);return this.o_.delete(e),this},e}(ph),df=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(w.d)(e,t),e.prototype.set=function(t,e,n){var r=Cf(t);return n?(yh("WriteBatch.set",n),this.o_.set(r,e,n)):this.o_.set(r,e),this},e.prototype.update=function(t,e,n){for(var r,i=[],o=3;o<arguments.length;o++)i[o-3]=arguments[o];var s=Cf(t);return 2===arguments.length?this.o_.update(s,e):(r=this.o_).update.apply(r,Object(w.h)([s,e,n],i)),this},e.prototype.delete=function(t){var e=Cf(t);return this.o_.delete(e),this},e.prototype.commit=function(){return this.o_.commit()},e}(ph),ff=function(t){function e(e,n){var r=this;return(r=t.call(this,n)||this).firestore=e,r.Q_=new Uh(e),r}return Object(w.d)(e,t),e.zf=function(t,n,r){if(t.length%2!=0)throw new Ur(Fr.INVALID_ARGUMENT,"Invalid document reference. Document references must have an even number of segments, but "+t.J()+" has "+t.length);return new e(n,new rd(n.o_,r,new ni(t)))},e.q_=function(t,n,r){return new e(n,new rd(n.o_,r,t))},Object.defineProperty(e.prototype,"id",{get:function(){return this.o_.id},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parent",{get:function(){return new Of(this.firestore,this.o_.parent)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"path",{get:function(){return this.o_.path},enumerable:!1,configurable:!0}),e.prototype.collection=function(t){try{return new Of(this.firestore,md(this.o_,t))}catch(t){throw pf(t,"collection()","DocumentReference.collection()")}},e.prototype.isEqual=function(t){return t instanceof ph&&(t=t.o_),t instanceof rd&&wd(this.o_,t)},e.prototype.set=function(t,e){e=yh("DocumentReference.set",e);try{return function(t,e,n){var r=wh(t.firestore,Bh),i=Tf(t.j_,e,n);return ed(r,Ad(Od(r),"setDoc",t.K_,i,null!==t.j_,n).ef(t.K_,us.on()))}(this.o_,t,e)}catch(t){throw pf(t,"setDoc()","DocumentReference.set()")}},e.prototype.update=function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];try{return 1===arguments.length?Zh(this.o_,t):Zh.apply(void 0,Object(w.h)([this.o_,t,e],n))}catch(t){throw pf(t,"updateDoc()","DocumentReference.update()")}},e.prototype.delete=function(){return ed(wh((t=this.o_).firestore,Bh),[new Es(t.K_,us.on())]);var t},e.prototype.onSnapshot=function(){for(var t=this,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=gf(e),i=yf(e,(function(e){return new mf(t.firestore,new Gh(t.firestore.o_,t.Q_,e.K_,e.W_,e.metadata,t.o_.j_))}));return td(this.o_,r,i)},e.prototype.get=function(t){var e=this;return("cache"===(null==t?void 0:t.source)?function(t){var e=this,n=wh(t.firestore,Bh),r=cf(n),i=new Jh(n),o=new pa;return n.z_.Ri((function(){return Object(w.b)(e,void 0,void 0,(function(){return Object(w.e)(this,(function(e){switch(e.label){case 0:return[4,Yd(r)];case 1:return[4,function(t,e,n){return Object(w.b)(this,void 0,void 0,(function(){var r,i,o;return Object(w.e)(this,(function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),[4,function(t,e){var n=Mr(t);return n.persistence.runTransaction("read document","readonly",(function(t){return n.Oc.cs(t,e)}))}(t,e)];case 1:return(r=s.sent())instanceof js?n.resolve(r):r instanceof xs?n.resolve(null):n.reject(new Ur(Fr.UNAVAILABLE,"Failed to get document from cache. (However, this document may exist on the server. Run again without setting 'source' in the GetOptions to attempt to retrieve the document from the server.)")),[3,3];case 2:return i=s.sent(),o=La(i,"Failed to get document '"+e+" from cache"),n.reject(o),[3,3];case 3:return[2]}}))}))}(e.sent(),t.K_,o)];case 2:return e.sent(),[2]}}))}))})),o.promise.then((function(e){return new Gh(n,i,t.K_,e,new vf(e instanceof js&&e.an,!0),t.j_)}))}(this.o_):"server"===(null==t?void 0:t.source)?function(t){var e=this,n=wh(t.firestore,Bh),r=cf(n),i=new pa;return n.z_.Ri((function(){return Object(w.b)(e,void 0,void 0,(function(){return Object(w.e)(this,(function(e){switch(e.label){case 0:return[4,tf(r)];case 1:return[4,ef(e.sent(),n.z_,t.K_,{source:"server"},i)];case 2:return e.sent(),[2]}}))}))})),i.promise.then((function(e){return nd(n,t,e)}))}(this.o_):function(t){var e=this,n=wh(t.firestore,Bh),r=cf(n),i=new pa;return n.z_.Ri((function(){return Object(w.b)(e,void 0,void 0,(function(){return Object(w.e)(this,(function(e){switch(e.label){case 0:return[4,tf(r)];case 1:return[4,ef(e.sent(),n.z_,t.K_,{source:"default"},i)];case 2:return e.sent(),[2]}}))}))})),i.promise.then((function(e){return nd(n,t,e)}))}(this.o_)).then((function(t){return new mf(e.firestore,new Gh(e.firestore.o_,e.Q_,t.K_,t.W_,t.metadata,e.o_.j_))}))},e.prototype.withConverter=function(t){return new e(this.firestore,this.o_.withConverter(t))},e}(ph);function pf(t,e,n){return t.message=t.message.replace(e,n),t}function gf(t){for(var e=0,n=t;e<n.length;e++){var r=n[e];if("object"==typeof r&&!ya(r))return r}return{}}function yf(t,e){var n,r,i;return{next:function(t){i.next&&i.next(e(t))},error:null===(n=(i=ya(t[0])?t[0]:ya(t[1])?t[1]:"function"==typeof t[0]?{next:t[0],error:t[1],complete:t[2]}:{next:t[1],error:t[2],complete:t[3]}).error)||void 0===n?void 0:n.bind(i),complete:null===(r=i.complete)||void 0===r?void 0:r.bind(i)}}var vf=function(){function t(t,e){this.hasPendingWrites=t,this.fromCache=e}return t.prototype.isEqual=function(t){return this.hasPendingWrites===t.hasPendingWrites&&this.fromCache===t.fromCache},t}(),mf=function(t){function e(e,n){var r=this;return(r=t.call(this,n)||this).U_=e,r}return Object(w.d)(e,t),Object.defineProperty(e.prototype,"ref",{get:function(){return new ff(this.U_,this.o_.ref)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"id",{get:function(){return this.o_.id},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"metadata",{get:function(){return this.o_.metadata},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"exists",{get:function(){return this.o_.exists()},enumerable:!1,configurable:!0}),e.prototype.data=function(t){return this.o_.data(t)},e.prototype.get=function(t,e){return this.o_.get(t,e)},e.prototype.isEqual=function(t){return Yh(this.o_,t.o_)},e}(ph),bf=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(w.d)(e,t),e.prototype.data=function(t){return this.o_.data(t)},e}(mf),_f=function(t){function e(e,n){var r=this;return(r=t.call(this,n)||this).firestore=e,r}return Object(w.d)(e,t),e.prototype.where=function(t,n,r){try{return new e(this.firestore,sd(this.o_,function(t,e,n){var r=e,i=qh("where",t);return new ad(i,r,n)}(t,n,r)))}catch(t){throw pf(t,/(orderBy|where)\(\)/,"Query.$1()")}},e.prototype.orderBy=function(t,n){try{return new e(this.firestore,sd(this.o_,function(t,e){void 0===e&&(e="asc");var n=e,r=qh("orderBy",t);return new ud(r,n)}(t,n)))}catch(t){throw pf(t,/(orderBy|where)\(\)/,"Query.$1()")}},e.prototype.limit=function(t){try{return new e(this.firestore,sd(this.o_,function(t){return Eh("limit",t),new cd("limit",t,"F")}(t)))}catch(t){throw pf(t,"limit()","Query.limit()")}},e.prototype.limitToLast=function(t){try{return new e(this.firestore,sd(this.o_,function(t){return Eh("limitToLast",t),new cd("limitToLast",t,"L")}(t)))}catch(t){throw pf(t,"limitToLast()","Query.limitToLast()")}},e.prototype.startAt=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return new e(this.firestore,sd(this.o_,(function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return new ld("startAt",t,!0)}).apply(void 0,t)))}catch(t){throw pf(t,"startAt()","Query.startAt()")}},e.prototype.startAfter=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return new e(this.firestore,sd(this.o_,(function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return new ld("startAfter",t,!1)}).apply(void 0,t)))}catch(t){throw pf(t,"startAfter()","Query.startAfter()")}},e.prototype.endBefore=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return new e(this.firestore,sd(this.o_,(function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return new hd("endBefore",t,!0)}).apply(void 0,t)))}catch(t){throw pf(t,"endBefore()","Query.endBefore()")}},e.prototype.endAt=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return new e(this.firestore,sd(this.o_,(function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return new hd("endAt",t,!1)}).apply(void 0,t)))}catch(t){throw pf(t,"endAt()","Query.endAt()")}},e.prototype.isEqual=function(t){return Ed(this.o_,t.o_)},e.prototype.get=function(t){var e=this;return("cache"===(null==t?void 0:t.source)?function(t){var e=this,n=wh(t.firestore,Bh),r=cf(n),i=new Jh(n),o=new pa;return n.z_.Ri((function(){return Object(w.b)(e,void 0,void 0,(function(){return Object(w.e)(this,(function(e){switch(e.label){case 0:return[4,Yd(r)];case 1:return[4,function(t,e,n){return Object(w.b)(this,void 0,void 0,(function(){var r,i,o,s,a,u;return Object(w.e)(this,(function(c){switch(c.label){case 0:return c.trys.push([0,2,,3]),[4,lc(t,e,!0)];case 1:return r=c.sent(),i=new pl(e,r.Bc),o=i.gh(r.documents),s=i.Zn(o,!1),n.resolve(s.snapshot),[3,3];case 2:return a=c.sent(),u=La(a,"Failed to execute query '"+e+" against cache"),n.reject(u),[3,3];case 3:return[2]}}))}))}(e.sent(),t.tf,o)];case 2:return e.sent(),[2]}}))}))})),o.promise.then((function(e){return new Kh(n,i,t,e)}))}(this.o_):"server"===(null==t?void 0:t.source)?function(t){var e=this,n=wh(t.firestore,Bh),r=cf(n),i=new Jh(n),o=new pa;return n.z_.Ri((function(){return Object(w.b)(e,void 0,void 0,(function(){return Object(w.e)(this,(function(e){switch(e.label){case 0:return[4,tf(r)];case 1:return[4,nf(e.sent(),n.z_,t.tf,{source:"server"},o)];case 2:return e.sent(),[2]}}))}))})),o.promise.then((function(e){return new Kh(n,i,t,e)}))}(this.o_):function(t){var e=this,n=wh(t.firestore,Bh),r=cf(n),i=new Jh(n);yd(t.tf);var o=new pa;return n.z_.Ri((function(){return Object(w.b)(e,void 0,void 0,(function(){return Object(w.e)(this,(function(e){switch(e.label){case 0:return[4,tf(r)];case 1:return[4,nf(e.sent(),n.z_,t.tf,{source:"default"},o)];case 2:return e.sent(),[2]}}))}))})),o.promise.then((function(e){return new Kh(n,i,t,e)}))}(this.o_)).then((function(t){return new Ef(e.firestore,t)}))},e.prototype.onSnapshot=function(){for(var t=this,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=gf(e),i=yf(e,(function(e){return new Ef(t.firestore,e)}));return td(this.o_,r,i)},e.prototype.withConverter=function(t){return new e(this.firestore,this.o_.withConverter(t))},e}(ph),wf=function(t){function e(e,n){var r=this;return(r=t.call(this,n)||this).U_=e,r}return Object(w.d)(e,t),Object.defineProperty(e.prototype,"type",{get:function(){return this.o_.type},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"doc",{get:function(){return new bf(this.U_,this.o_.doc)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"oldIndex",{get:function(){return this.o_.oldIndex},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"newIndex",{get:function(){return this.o_.newIndex},enumerable:!1,configurable:!0}),e}(ph),Ef=function(t){function e(e,n){var r=this;return(r=t.call(this,n)||this).U_=e,r}return Object(w.d)(e,t),Object.defineProperty(e.prototype,"query",{get:function(){return new _f(this.U_,this.o_.query)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"metadata",{get:function(){return this.o_.metadata},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"size",{get:function(){return this.o_.size},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"empty",{get:function(){return this.o_.empty},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"docs",{get:function(){var t=this;return this.o_.docs.map((function(e){return new bf(t.U_,e)}))},enumerable:!1,configurable:!0}),e.prototype.docChanges=function(t){var e=this;return this.o_.docChanges(t).map((function(t){return new wf(e.U_,t)}))},e.prototype.forEach=function(t,e){var n=this;this.o_.forEach((function(r){t.call(e,new bf(n.U_,r))}))},e.prototype.isEqual=function(t){return Yh(this.o_,t.o_)},e}(ph),Of=function(t){function e(e,n){var r=this;return(r=t.call(this,e,n)||this).firestore=e,r.o_=n,r}return Object(w.d)(e,t),Object.defineProperty(e.prototype,"id",{get:function(){return this.o_.id},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"path",{get:function(){return this.o_.path},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parent",{get:function(){var t=this.o_.parent;return t?new ff(this.firestore,t):null},enumerable:!1,configurable:!0}),e.prototype.doc=function(t){try{return new ff(this.firestore,void 0===t?bd(this.o_):bd(this.o_,t))}catch(t){throw pf(t,"doc()","CollectionReference.doc()")}},e.prototype.add=function(t){var e=this;return function(t,e){var n=wh(t.firestore,Bh),r=bd(t),i=Tf(t.j_,e);return ed(n,Ad(Od(t.firestore),"addDoc",r.K_,i,null!==t.j_,{}).ef(r.K_,us.exists(!1))).then((function(){return r}))}(this.o_,t).then((function(t){return new ff(e.firestore,t)}))},e.prototype.isEqual=function(t){return wd(this.o_,t.o_)},e.prototype.withConverter=function(t){return new e(this.firestore,this.o_.withConverter(t))},e}(_f);function Cf(t){return t instanceof ph&&(t=t.o_),wh(t,rd)}function Tf(t,e,n){return t?n&&(n.merge||n.mergeFields)?t.toFirestore(e,n):t.toFirestore(e):e}var Sf,If=function(t){function e(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return t.call(this,new(Hh.bind.apply(Hh,Object(w.h)([void 0],e))))||this}return Object(w.d)(e,t),e.documentId=function(){return new e(ei.et().J())},e.prototype.isEqual=function(t){return t instanceof ph&&(t=t.o_),t instanceof Hh&&this.o_.G_.isEqual(t.G_)},e}(ph),jf=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(w.d)(e,t),e.serverTimestamp=function(){var t=new Sh("serverTimestamp");return t.c_="FieldValue.serverTimestamp",new e(t)},e.delete=function(){var t=new Ch("deleteField");return t.c_="FieldValue.delete",new e(t)},e.arrayUnion=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r=(function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return new Ih("arrayUnion",t)}).apply(void 0,t);return r.c_="FieldValue.arrayUnion",new e(r)},e.arrayRemove=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r=(function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return new jh("arrayRemove",t)}).apply(void 0,t);return r.c_="FieldValue.arrayRemove",new e(r)},e.increment=function(t){var n=function(t){return new xh("increment",t)}(t);return n.c_="FieldValue.increment",new e(n)},e.prototype.isEqual=function(t){return this.o_.isEqual(t.o_)},e}(ph),xf={Firestore:uf,GeoPoint:Ah,Timestamp:Xr,Blob:Mh,Transaction:hf,WriteBatch:df,DocumentReference:ff,DocumentSnapshot:mf,Query:_f,QueryDocumentSnapshot:bf,QuerySnapshot:Ef,CollectionReference:Of,FieldPath:If,FieldValue:jf,setLogLevel:function(t){xr.setLogLevel(t)},CACHE_SIZE_UNLIMITED:-1};(function(t,e){t.INTERNAL.registerComponent(new Tr.a("firestore",(function(t){return function(t,e){return new uf(t,new Bh(t,e),new af)}(t.getProvider("app").getImmediate(),t.getProvider("auth-internal"))}),"PUBLIC").setServiceProps(Object.assign({},xf)))})(Sf=E.a),Sf.registerVersion("@firebase/firestore","2.0.4");var Af=n("UbJi");function kf(t,e){return function(t,e=i.a){return new o.a(n=>{let r;return null!=e?e.schedule(()=>{r=t.onSnapshot({includeMetadataChanges:!0},n)}):r=t.onSnapshot({includeMetadataChanges:!0},n),()=>{null!=r&&r()}})}(t,e)}function Nf(t,e){return kf(t,e).pipe(Object(f.a)(t=>({payload:t,type:"query"})))}function Rf(t,e){return Nf(t,e).pipe(Object(u.a)(void 0),l(),Object(f.a)(([t,e])=>{const n=e.payload.docChanges(),r=n.map(t=>({type:t.type,payload:t}));return t&&JSON.stringify(t.payload.metadata)!==JSON.stringify(e.payload.metadata)&&e.payload.docs.forEach((e,i)=>{const o=n.find(t=>t.doc.ref.isEqual(e.ref)),s=null==t?void 0:t.payload.docs.find(t=>t.ref.isEqual(e.ref));o&&JSON.stringify(o.doc.metadata)===JSON.stringify(e.metadata)||!o&&s&&JSON.stringify(s.metadata)===JSON.stringify(e.metadata)||r.push({type:"modified",payload:{oldIndex:i,newIndex:i,type:"modified",doc:e}})}),r}))}function Pf(t,e,n){return Rf(t,n).pipe(Object(p.a)((t,n)=>function(t,e,n){return e.forEach(e=>{n.indexOf(e.type)>-1&&(t=function(t,e){switch(e.type){case"added":if(!t[e.newIndex]||!t[e.newIndex].doc.ref.isEqual(e.doc.ref))return Df(t,e.newIndex,0,e);break;case"modified":if(null==t[e.oldIndex]||t[e.oldIndex].doc.ref.isEqual(e.doc.ref)){if(e.oldIndex!==e.newIndex){const n=t.slice();return n.splice(e.oldIndex,1),n.splice(e.newIndex,0,e),n}return Df(t,e.newIndex,1,e)}break;case"removed":if(t[e.oldIndex]&&t[e.oldIndex].doc.ref.isEqual(e.doc.ref))return Df(t,e.oldIndex,1)}return t}(t,e))}),t}(t,n.map(t=>t.payload),e),[]),Object(g.a)(),Object(f.a)(t=>t.map(t=>({type:t.type,payload:t}))))}function Df(t,e,n,...r){const i=t.slice();return i.splice(e,n,...r),i}function Lf(t){return t&&0!==t.length||(t=["added","removed","modified"]),t}class Mf{constructor(t,e,n){this.ref=t,this.query=e,this.afs=n}stateChanges(t){return t&&0!==t.length?Rf(this.query,this.afs.schedulers.outsideAngular).pipe(Object(f.a)(e=>e.filter(e=>t.indexOf(e.type)>-1)),Object(y.a)(t=>t.length>0),this.afs.keepUnstableUntilFirst):Rf(this.query,this.afs.schedulers.outsideAngular).pipe(Object(y.a)(t=>t.length>0),this.afs.keepUnstableUntilFirst)}auditTrail(t){return this.stateChanges(t).pipe(Object(p.a)((t,e)=>[...t,...e],[]))}snapshotChanges(t){const e=Lf(t);return Pf(this.query,e,this.afs.schedulers.outsideAngular).pipe(this.afs.keepUnstableUntilFirst)}valueChanges(t={}){return Nf(this.query,this.afs.schedulers.outsideAngular).pipe(Object(f.a)(e=>e.payload.docs.map(e=>t.idField?Object.assign(Object.assign({},e.data()),{[t.idField]:e.id}):e.data())),this.afs.keepUnstableUntilFirst)}get(t){return Object(s.a)(this.query.get(t)).pipe(Object(v.b)(this.afs.schedulers.insideAngular))}add(t){return this.ref.add(t)}doc(t){return new Ff(this.ref.doc(t),this.afs)}}class Ff{constructor(t,e){this.ref=t,this.afs=e}set(t,e){return this.ref.set(t,e)}update(t){return this.ref.update(t)}delete(){return this.ref.delete()}collection(t,e){const n=this.ref.collection(t),{ref:r,query:i}=Bf(n,e);return new Mf(r,i,this.afs)}snapshotChanges(){return kf(this.ref,this.afs.schedulers.outsideAngular).pipe(Object(u.a)(void 0),l(),Object(f.a)(([t,e])=>e.exists?(null==t?void 0:t.exists)?{payload:e,type:"modified"}:{payload:e,type:"added"}:{payload:e,type:"removed"})).pipe(this.afs.keepUnstableUntilFirst)}valueChanges(t={}){return this.snapshotChanges().pipe(Object(f.a)(({payload:e})=>t.idField?Object.assign(Object.assign({},e.data()),{[t.idField]:e.id}):e.data()))}get(t){return Object(s.a)(this.ref.get(t)).pipe(Object(v.b)(this.afs.schedulers.insideAngular))}}class Uf{constructor(t,e){this.query=t,this.afs=e}stateChanges(t){return t&&0!==t.length?Rf(this.query,this.afs.schedulers.outsideAngular).pipe(Object(f.a)(e=>e.filter(e=>t.indexOf(e.type)>-1)),Object(y.a)(t=>t.length>0),this.afs.keepUnstableUntilFirst):Rf(this.query,this.afs.schedulers.outsideAngular).pipe(this.afs.keepUnstableUntilFirst)}auditTrail(t){return this.stateChanges(t).pipe(Object(p.a)((t,e)=>[...t,...e],[]))}snapshotChanges(t){const e=Lf(t);return Pf(this.query,e,this.afs.schedulers.outsideAngular).pipe(this.afs.keepUnstableUntilFirst)}valueChanges(t={}){return Nf(this.query,this.afs.schedulers.outsideAngular).pipe(Object(f.a)(e=>e.payload.docs.map(e=>t.idField?Object.assign({[t.idField]:e.id},e.data()):e.data())),this.afs.keepUnstableUntilFirst)}get(t){return Object(s.a)(this.query.get(t)).pipe(Object(v.b)(this.afs.schedulers.insideAngular))}}const $f=new r.q("angularfire2.enableFirestorePersistence"),Vf=new r.q("angularfire2.firestore.persistenceSettings"),qf=new r.q("angularfire2.firestore.settings"),Hf=new r.q("angularfire2.firestore.use-emulator");function Bf(t,e=(t=>t)){return{query:e(t),ref:t}}let zf=(()=>{class t{constructor(t,e,n,r,i,o,u,c,l){this.schedulers=new m.d(o),this.keepUnstableUntilFirst=Object(m.h)(this.schedulers);const h=Object(m.g)(t,o,e);!_.a.auth&&l&&Object(m.j)();const d=c;[this.firestore,this.persistenceEnabled$]=Object(m.f)(h.name+".firestore","AngularFirestore",h,()=>{const t=o.runOutsideAngular(()=>h.firestore());if(r&&t.settings(r),d&&t.useEmulator(...d),n&&!Object(b.m)(i)){const e=()=>{try{return Object(s.a)(t.enablePersistence(u||void 0).then(()=>!0,()=>!1))}catch(e){return"undefined"!=typeof console&&console.warn(e),Object(a.a)(!1)}};return[t,o.runOutsideAngular(e)]}return[t,Object(a.a)(!1)]},[r,d,n])}collection(t,e){let n;n="string"==typeof t?this.firestore.collection(t):t;const{ref:r,query:i}=Bf(n,e),o=this.schedulers.ngZone.run(()=>r);return new Mf(o,i,this)}collectionGroup(t,e){const n=e||(t=>t),r=this.firestore.collectionGroup(t);return new Uf(n(r),this)}doc(t){let e;e="string"==typeof t?this.firestore.doc(t):t;const n=this.schedulers.ngZone.run(()=>e);return new Ff(n,this)}createId(){return this.firestore.collection("_").doc().id}}return t.\u0275fac=function(e){return new(e||t)(r.Nb(m.c),r.Nb(m.b,8),r.Nb($f,8),r.Nb(qf,8),r.Nb(r.B),r.Nb(r.z),r.Nb(Vf,8),r.Nb(Hf,8),r.Nb(Af.c,8))},t.\u0275prov=Object(r.Db)({factory:function(){return new t(Object(r.Nb)(m.c),Object(r.Nb)(m.b,8),Object(r.Nb)($f,8),Object(r.Nb)(qf,8),Object(r.Nb)(r.B),Object(r.Nb)(r.z),Object(r.Nb)(Vf,8),Object(r.Nb)(Hf,8),Object(r.Nb)(Af.c,8))},token:t,providedIn:"any"}),t})(),Wf=(()=>{class t{static enablePersistence(e){return{ngModule:t,providers:[{provide:$f,useValue:!0},{provide:Vf,useValue:e}]}}}return t.\u0275mod=r.Fb({type:t}),t.\u0275inj=r.Eb({factory:function(e){return new(e||t)},providers:[zf]}),t})()},I55L:function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));const r=t=>t&&"number"==typeof t.length&&"function"!=typeof t},IjjT:function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));let r=(()=>{class t{constructor(e,n=t.now){this.SchedulerAction=e,this.now=n}schedule(t,e=0,n){return new this.SchedulerAction(this,t).schedule(n,e)}}return t.now=()=>Date.now(),t})();class i extends r{constructor(t,e=r.now){super(t,()=>i.delegate&&i.delegate!==this?i.delegate.now():e()),this.actions=[],this.active=!1,this.scheduled=void 0}schedule(t,e=0,n){return i.delegate&&i.delegate!==this?i.delegate.schedule(t,e,n):super.schedule(t,e,n)}flush(t){const{actions:e}=this;if(this.active)return void e.push(t);let n;this.active=!0;do{if(n=t.execute(t.state,t.delay))break}while(t=e.shift());if(this.active=!1,n){for(;t=e.shift();)t.unsubscribe();throw n}}}},IzEk:function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var r=n("7o/Q"),i=n("4I5i"),o=n("EY2u");function s(t){return e=>0===t?Object(o.b)():e.lift(new a(t))}class a{constructor(t){if(this.total=t,this.total<0)throw new i.a}call(t,e){return e.subscribe(new u(t,this.total))}}class u extends r.a{constructor(t,e){super(t),this.total=e,this.count=0}_next(t){const e=this.total,n=++this.count;n<=e&&(this.destination.next(t),n===e&&(this.destination.complete(),this.unsubscribe()))}}},JX91:function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n("GyhO"),i=n("z+Ro");function o(...t){const e=t[t.length-1];return Object(i.a)(e)?(t.pop(),n=>Object(r.a)(t,n,e)):e=>Object(r.a)(t,e)}},Jgta:function(t,e,n){"use strict";var r=n("zIRd");n.d(e,"a",(function(){return r.a})),r.a.registerVersion("firebase","8.1.1","app")},Kqap:function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n("7o/Q");function i(t,e){let n=!1;return arguments.length>=2&&(n=!0),function(r){return r.lift(new o(t,e,n))}}class o{constructor(t,e,n=!1){this.accumulator=t,this.seed=e,this.hasSeed=n}call(t,e){return e.subscribe(new s(t,this.accumulator,this.seed,this.hasSeed))}}class s extends r.a{constructor(t,e,n,r){super(t),this.accumulator=e,this._seed=n,this.hasSeed=r,this.index=0}get seed(){return this._seed}set seed(t){this.hasSeed=!0,this._seed=t}_next(t){if(this.hasSeed)return this._tryNext(t);this.seed=t,this.destination.next(t)}_tryNext(t){const e=this.index++;let n;try{n=this.accumulator(this.seed,t,e)}catch(r){this.destination.error(r)}this.seed=n,this.destination.next(n)}}},KqfI:function(t,e,n){"use strict";function r(){}n.d(e,"a",(function(){return r}))},LRne:function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var r=n("z+Ro"),i=n("yCtX"),o=n("jZKg");function s(...t){let e=t[t.length-1];return Object(r.a)(e)?(t.pop(),Object(o.a)(t,e)):Object(i.a)(t)}},Lhse:function(t,e,n){"use strict";function r(){return"function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"}n.d(e,"a",(function(){return i}));const i=r()},NJ4a:function(t,e,n){"use strict";function r(t){setTimeout(()=>{throw t},0)}n.d(e,"a",(function(){return r}))},NXyV:function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var r=n("HDdC"),i=n("Cfvw"),o=n("EY2u");function s(t){return new r.a(e=>{let n;try{n=t()}catch(r){return void e.error(r)}return(n?Object(i.a)(n):Object(o.b)()).subscribe(e)})}},O1h7:function(t,e,n){"use strict";n.d(e,"d",(function(){return i})),n.d(e,"a",(function(){return o})),n.d(e,"c",(function(){return s})),n.d(e,"b",(function(){return a})),n.d(e,"e",(function(){return u})),n.d(e,"i",(function(){return c})),n.d(e,"f",(function(){return l})),n.d(e,"g",(function(){return h})),n.d(e,"h",(function(){return d}));var r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function i(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var o=function(){return(o=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};function s(t,e,n,r){var i,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s}function a(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{u(r.next(t))}catch(e){o(e)}}function a(t){try{u(r.throw(t))}catch(e){o(e)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}u((r=r.apply(t,e||[])).next())}))}function u(t,e){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(a){o=[6,a],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}}function c(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function l(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(a){i={error:a}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s}function h(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(l(arguments[e]));return t}function d(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),i=0;for(e=0;e<n;e++)for(var o=arguments[e],s=0,a=o.length;s<a;s++,i++)r[i]=o[s];return r}},OMvp:function(t,e,n){"use strict";n.d(e,"a",(function(){return r})),n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return c})),n.d(e,"d",(function(){return g})),n.d(e,"e",(function(){return l})),n.d(e,"f",(function(){return u})),n.d(e,"g",(function(){return o})),n.d(e,"h",(function(){return a})),n.d(e,"i",(function(){return h})),n.d(e,"j",(function(){return p})),n.d(e,"k",(function(){return y})),n.d(e,"l",(function(){return d})),n.d(e,"m",(function(){return f})),n.d(e,"n",(function(){return s}));const r=(t,e,n,r)=>{if("undefined"!=typeof window){const i=window,o=i&&i.Ionic&&i.Ionic.config;if(o){const i=o.get("_ael");if(i)return i(t,e,n,r);if(o._ael)return o._ael(t,e,n,r)}}return t.addEventListener(e,n,r)},i=(t,e,n,r)=>{if("undefined"!=typeof window){const i=window,o=i&&i.Ionic&&i.Ionic.config;if(o){const i=o.get("_rel");if(i)return i(t,e,n,r);if(o._rel)return o._rel(t,e,n,r)}}return t.removeEventListener(e,n,r)},o=(t,e=t)=>t.shadowRoot||e,s=t=>"function"==typeof __zone_symbol__requestAnimationFrame?__zone_symbol__requestAnimationFrame(t):"function"==typeof requestAnimationFrame?requestAnimationFrame(t):setTimeout(t),a=t=>!!t.shadowRoot&&!!t.attachShadow,u=t=>{const e=t.closest("ion-item");return e?e.querySelector("ion-label"):null},c=(t,e,n,r,i)=>{if(t||a(e)){let t=e.querySelector("input.aux-input");t||(t=e.ownerDocument.createElement("input"),t.type="hidden",t.classList.add("aux-input"),e.appendChild(t)),t.disabled=i,t.name=n,t.value=r||""}},l=(t,e,n)=>Math.max(t,Math.min(e,n)),h=(t,e)=>{if(!t){const t="ASSERT: "+e;throw console.error(t),new Error(t)}},d=t=>t.timeStamp||Date.now(),f=t=>{if(t){const e=t.changedTouches;if(e&&e.length>0){const t=e[0];return{x:t.clientX,y:t.clientY}}if(void 0!==t.pageX)return{x:t.pageX,y:t.pageY}}return{x:0,y:0}},p=t=>{const e="rtl"===document.dir;switch(t){case"start":return e;case"end":return!e;default:throw new Error(`"${t}" is not a valid value for [side]. Use "start" or "end" instead.`)}},g=(t,e)=>{const n=t._original||t;return{_original:t,emit:y(n.emit.bind(n),e)}},y=(t,e=0)=>{let n;return(...r)=>{clearTimeout(n),n=setTimeout(t,e,...r)}}},PFXn:function(t,e,n){"use strict";n.d(e,"a",(function(){return R})),n.d(e,"b",(function(){return c})),n.d(e,"c",(function(){return l})),n.d(e,"d",(function(){return p})),n.d(e,"e",(function(){return O})),n.d(e,"f",(function(){return y})),n.d(e,"g",(function(){return T})),n.d(e,"h",(function(){return j})),n.d(e,"i",(function(){return a})),n.d(e,"j",(function(){return A})),n.d(e,"k",(function(){return h})),n.d(e,"l",(function(){return d})),n.d(e,"m",(function(){return f})),n.d(e,"n",(function(){return N})),n.d(e,"o",(function(){return g}));var r=n("Zgba"),i=n("OMvp"),o=n("8RMS");let s=0;const a=new WeakMap,u=t=>({create:e=>v(t,e),dismiss:(e,n,r)=>w(document,e,n,t,r),getTop:async()=>E(document,t)}),c=u("ion-alert"),l=u("ion-action-sheet"),h=u("ion-loading"),d=u("ion-modal"),f=u("ion-picker"),p=u("ion-popover"),g=u("ion-toast"),y=t=>{"undefined"!=typeof document&&_(document);const e=s++;t.overlayIndex=e,t.hasAttribute("id")||(t.id="ion-overlay-"+e)},v=(t,e)=>"undefined"!=typeof customElements?customElements.whenDefined(t).then(()=>{const n=document.createElement(t);return n.classList.add("overlay-hidden"),Object.assign(n,e),S(document).appendChild(n),n.componentOnReady()}):Promise.resolve(),m='[tabindex]:not([tabindex^="-"]), input:not([type=hidden]):not([tabindex^="-"]), textarea:not([tabindex^="-"]), button:not([tabindex^="-"]), select:not([tabindex^="-"]), .ion-focusable:not([tabindex^="-"])',b="input:not([type=hidden]), textarea, button, select",_=t=>{0===s&&(s=1,t.addEventListener("focus",e=>((t,e)=>{const n=E(e),r=t.target;if(n&&r)if(n===r)n.lastFocus=void 0;else{const t=Object(i.g)(n);if(!t.contains(r))return;const o=t.querySelector(".ion-overlay-wrapper");if(!o)return;if(o.contains(r))n.lastFocus=r;else{const t=n.lastFocus;((t,e)=>{let n=t.querySelector(m);const r=n&&n.shadowRoot;r&&(n=r.querySelector(b)||n),n?n.focus():e.focus()})(o,n),t===e.activeElement&&((t,e)=>{const n=Array.from(t.querySelectorAll(m));let r=n.length>0?n[n.length-1]:null;const i=r&&r.shadowRoot;i&&(r=i.querySelector(b)||r),r?r.focus():e.focus()})(o,n),n.lastFocus=e.activeElement}}})(e,t),!0),t.addEventListener("ionBackButton",e=>{const n=E(t);n&&n.backdropDismiss&&e.detail.register(o.OVERLAY_BACK_BUTTON_PRIORITY,()=>n.dismiss(void 0,R))}),t.addEventListener("keyup",e=>{if("Escape"===e.key){const e=E(t);e&&e.backdropDismiss&&e.dismiss(void 0,R)}}))},w=(t,e,n,r,i)=>{const o=E(t,r,i);return o?o.dismiss(e,n):Promise.reject("overlay does not exist")},E=(t,e,n)=>{const r=((t,e)=>(void 0===e&&(e="ion-alert,ion-action-sheet,ion-loading,ion-modal,ion-picker,ion-popover,ion-toast"),Array.from(t.querySelectorAll(e)).filter(t=>t.overlayIndex>0)))(t,e);return void 0===n?r[r.length-1]:r.find(t=>t.id===n)},O=async(t,e,n,i,o)=>{if(t.presented)return;t.presented=!0,t.willPresent.emit();const s=Object(r.b)(t),a=t.enterAnimation?t.enterAnimation:r.c.get(e,"ios"===s?n:i);await I(t,a,t.el,o)&&t.didPresent.emit(),"ION-TOAST"!==t.el.tagName&&C(t.el),t.keyboardClose&&t.el.focus()},C=async t=>{let e=document.activeElement;if(!e)return;const n=e&&e.shadowRoot;n&&(e=n.querySelector(b)||e),await t.onDidDismiss(),e.focus()},T=async(t,e,n,i,o,s,u)=>{if(!t.presented)return!1;t.presented=!1;try{t.el.style.setProperty("pointer-events","none"),t.willDismiss.emit({data:e,role:n});const c=Object(r.b)(t),l=t.leaveAnimation?t.leaveAnimation:r.c.get(i,"ios"===c?o:s);"gesture"!==n&&await I(t,l,t.el,u),t.didDismiss.emit({data:e,role:n}),a.delete(t)}catch(c){console.error(c)}return t.el.remove(),!0},S=t=>t.querySelector("ion-app")||t.body,I=async(t,e,n,i)=>{n.classList.remove("overlay-hidden");const o=e(n.shadowRoot||t.el,i);t.animated&&r.c.getBoolean("animated",!0)||o.duration(0),t.keyboardClose&&o.beforeAddWrite(()=>{const t=n.ownerDocument.activeElement;t&&t.matches("input, ion-input, ion-textarea")&&t.blur()});const s=a.get(t)||[];return a.set(t,[...s,o]),await o.play(),!0},j=(t,e)=>{let n;const r=new Promise(t=>n=t);return x(t,e,t=>{n(t.detail)}),r},x=(t,e,n)=>{const r=o=>{Object(i.b)(t,e,r),n(o)};Object(i.a)(t,e,r)},A=t=>"cancel"===t||t===R,k=t=>t(),N=(t,e)=>{if("function"==typeof t)return r.c.get("_zoneGate",k)(()=>{try{return t(e)}catch(n){console.error(n)}})},R="backdrop"},SeVD:function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var r=n("ngJS"),i=n("NJ4a"),o=n("Lhse"),s=n("kJWO"),a=n("I55L"),u=n("c2HN"),c=n("XoHu");const l=t=>{if(t&&"function"==typeof t[s.a])return l=t,t=>{const e=l[s.a]();if("function"!=typeof e.subscribe)throw new TypeError("Provided object does not correctly implement Symbol.observable");return e.subscribe(t)};if(Object(a.a)(t))return Object(r.a)(t);if(Object(u.a)(t))return n=t,t=>(n.then(e=>{t.closed||(t.next(e),t.complete())},e=>t.error(e)).then(null,i.a),t);if(t&&"function"==typeof t[o.a])return e=t,t=>{const n=e[o.a]();for(;;){const e=n.next();if(e.done){t.complete();break}if(t.next(e.value),t.closed)break}return"function"==typeof n.return&&t.add(()=>{n.return&&n.return()}),t};{const e=Object(c.a)(t)?"an invalid object":`'${t}'`;throw new TypeError(`You provided ${e} where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.`)}var e,n,l}},SpAZ:function(t,e,n){"use strict";function r(t){return t}n.d(e,"a",(function(){return r}))},SxV6:function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var r=n("sVev"),i=n("pLZG"),o=n("IzEk"),s=n("xbPD"),a=n("XDbj"),u=n("SpAZ");function c(t,e){const n=arguments.length>=2;return c=>c.pipe(t?Object(i.a)((e,n)=>t(e,n,c)):u.a,Object(o.a)(1),n?Object(s.a)(e):Object(a.a)(()=>new r.a))}},"TEn/":function(t,e,n){"use strict";n.d(e,"a",(function(){return jt})),n.d(e,"b",(function(){return U})),n.d(e,"c",(function(){return $})),n.d(e,"d",(function(){return Tt})),n.d(e,"e",(function(){return V})),n.d(e,"f",(function(){return q})),n.d(e,"g",(function(){return H})),n.d(e,"h",(function(){return B})),n.d(e,"i",(function(){return z})),n.d(e,"j",(function(){return W})),n.d(e,"k",(function(){return G})),n.d(e,"l",(function(){return Q})),n.d(e,"m",(function(){return K})),n.d(e,"n",(function(){return X})),n.d(e,"o",(function(){return Y})),n.d(e,"p",(function(){return J})),n.d(e,"q",(function(){return Ot})),n.d(e,"r",(function(){return Z})),n.d(e,"s",(function(){return tt})),n.d(e,"t",(function(){return et})),n.d(e,"u",(function(){return nt})),n.d(e,"v",(function(){return Dt})),n.d(e,"w",(function(){return kt})),n.d(e,"x",(function(){return St})),n.d(e,"y",(function(){return I}));var r=n("O1h7"),i=n("fXoL"),o=n("3Pt+"),s=n("ofXK"),a=n("tyNb"),u=n("A36C"),c=n("Zgba"),l=(n("OMvp"),n("btv9"),n("fYWy")),h=(n("k9ne"),n("6pL8"),n("bC4P"),n("y08P"),n("iWo5"),n("39oe"),n("8RMS"),n("jJkw"),n("PFXn")),d=n("XNiG"),f=n("xgIS"),p=n("2Vo4"),g=n("pLZG"),y=n("eIep"),v=n("/uUt");const m=c.a,b=["*"],_=t=>"function"==typeof __zone_symbol__requestAnimationFrame?__zone_symbol__requestAnimationFrame(t):"function"==typeof requestAnimationFrame?requestAnimationFrame(t):setTimeout(t);let w=(()=>{class t{constructor(t,e){this.injector=t,this.el=e,this.onChange=()=>{},this.onTouched=()=>{}}writeValue(t){this.el.nativeElement.value=this.lastValue=null==t?"":t,E(this.el)}handleChangeEvent(t,e){t===this.el.nativeElement&&(e!==this.lastValue&&(this.lastValue=e,this.onChange(e)),E(this.el))}_handleBlurEvent(t){t===this.el.nativeElement&&(this.onTouched(),E(this.el))}registerOnChange(t){this.onChange=t}registerOnTouched(t){this.onTouched=t}setDisabledState(t){this.el.nativeElement.disabled=t}ngOnDestroy(){this.statusChanges&&this.statusChanges.unsubscribe()}ngAfterViewInit(){let t;try{t=this.injector.get(o.c)}catch(n){}if(!t)return;t.statusChanges&&(this.statusChanges=t.statusChanges.subscribe(()=>E(this.el)));const e=t.control;e&&["markAsTouched","markAllAsTouched","markAsUntouched","markAsDirty","markAsPristine"].forEach(t=>{if(e[t]){const n=e[t].bind(e);e[t]=(...t)=>{n(...t),E(this.el)}}})}}return t.\u0275fac=function(t){i.Qb()},t.\u0275dir=i.Cb({type:t,hostBindings:function(t,e){1&t&&i.Rb("ionBlur",(function(t){return e._handleBlurEvent(t.target)}))}}),t})();const E=t=>{_(()=>{const e=t.nativeElement,n=O(e);C(e,n);const r=e.closest("ion-item");r&&C(r,n)})},O=t=>{const e=t.classList,n=[];for(let r=0;r<e.length;r++){const t=e.item(r);null!==t&&T(t,"ng-")&&n.push("ion-"+t.substr(3))}return n},C=(t,e)=>{const n=t.classList;["ion-valid","ion-invalid","ion-touched","ion-untouched","ion-dirty","ion-pristine"].forEach(t=>n.remove(t)),e.forEach(t=>n.add(t))},T=(t,e)=>t.substr(0,e.length)===e;var S;let I=(()=>{let t=S=class extends w{constructor(t,e){super(t,e)}_handleInputEvent(t){this.handleChangeEvent(t,t.value)}};return t.\u0275fac=function(e){return new(e||t)(i.Hb(i.r),i.Hb(i.l))},t.\u0275dir=i.Cb({type:t,selectors:[["ion-input",3,"type","number"],["ion-textarea"],["ion-searchbar"]],hostBindings:function(t,e){1&t&&i.Rb("ionChange",(function(t){return e._handleInputEvent(t.target)}))},features:[i.xb([{provide:o.b,useExisting:S,multi:!0}]),i.vb]}),t})(),j=(()=>{let t=class{constructor(t,e){this.doc=t,this.backButton=new d.a,this.keyboardDidShow=new d.a,this.keyboardDidHide=new d.a,this.pause=new d.a,this.resume=new d.a,this.resize=new d.a,e.run(()=>{let n;this.win=t.defaultView,this.backButton.subscribeWithPriority=function(t,n){return this.subscribe(r=>r.register(t,t=>e.run(()=>n(t))))},A(this.pause,t,"pause"),A(this.resume,t,"resume"),A(this.backButton,t,"ionBackButton"),A(this.resize,this.win,"resize"),A(this.keyboardDidShow,this.win,"ionKeyboardDidShow"),A(this.keyboardDidHide,this.win,"ionKeyboardDidHide"),this._readyPromise=new Promise(t=>{n=t}),this.win&&this.win.cordova?t.addEventListener("deviceready",()=>{n("cordova")},{once:!0}):n("dom")})}is(t){return Object(c.e)(this.win,t)}platforms(){return Object(c.d)(this.win)}ready(){return this._readyPromise}get isRTL(){return"rtl"===this.doc.dir}getQueryParam(t){return x(this.win.location.href,t)}isLandscape(){return!this.isPortrait()}isPortrait(){return this.win.matchMedia&&this.win.matchMedia("(orientation: portrait)").matches}testUserAgent(t){const e=this.win.navigator;return!!(e&&e.userAgent&&e.userAgent.indexOf(t)>=0)}url(){return this.win.location.href}width(){return this.win.innerWidth}height(){return this.win.innerHeight}};return t.\u0275fac=function(e){return new(e||t)(i.Nb(s.d),i.Nb(i.z))},t.\u0275prov=i.Db({token:t,factory:function(e){return t.\u0275fac(e)},providedIn:"root"}),t.ngInjectableDef=Object(i.Db)({factory:function(){return new t(Object(i.Nb)(s.d),Object(i.Nb)(i.z))},token:t,providedIn:"root"}),t})();const x=(t,e)=>{e=e.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");const n=new RegExp("[\\?&]"+e+"=([^&#]*)").exec(t);return n?decodeURIComponent(n[1].replace(/\+/g," ")):null},A=(t,e,n)=>{e&&e.addEventListener(n,e=>{t.next(null!=e?e.detail:void 0)})};let k=(()=>{let t=class{constructor(t,e,n,r){this.location=e,this.serializer=n,this.router=r,this.direction=R,this.animated=P,this.guessDirection="forward",this.lastNavId=-1,r&&r.events.subscribe(t=>{if(t instanceof a.c){const e=t.restoredState?t.restoredState.navigationId:t.id;this.guessDirection=e<this.lastNavId?"back":"forward",this.guessAnimation=t.restoredState?void 0:this.guessDirection,this.lastNavId="forward"===this.guessDirection?t.id:e}}),t.backButton.subscribeWithPriority(0,t=>{this.pop(),t()})}navigateForward(t,e={}){return this.setDirection("forward",e.animated,e.animationDirection,e.animation),this.navigate(t,e)}navigateBack(t,e={}){return this.setDirection("back",e.animated,e.animationDirection,e.animation),this.navigate(t,e)}navigateRoot(t,e={}){return this.setDirection("root",e.animated,e.animationDirection,e.animation),this.navigate(t,e)}back(t={animated:!0,animationDirection:"back"}){return this.setDirection("back",t.animated,t.animationDirection,t.animation),this.location.back()}pop(){return Object(r.b)(this,void 0,void 0,(function*(){let t=this.topOutlet;for(;t&&!(yield t.pop());)t=t.parentOutlet}))}setDirection(t,e,n,r){this.direction=t,this.animated=N(t,e,n),this.animationBuilder=r}setTopOutlet(t){this.topOutlet=t}consumeTransition(){let t,e="root";const n=this.animationBuilder;return"auto"===this.direction?(e=this.guessDirection,t=this.guessAnimation):(t=this.animated,e=this.direction),this.direction=R,this.animated=P,this.animationBuilder=void 0,{direction:e,animation:t,animationBuilder:n}}navigate(t,e){if(Array.isArray(t))return this.router.navigate(t,e);{const n=this.serializer.parse(t.toString());return void 0!==e.queryParams&&(n.queryParams=Object.assign({},e.queryParams)),void 0!==e.fragment&&(n.fragment=e.fragment),this.router.navigateByUrl(n,e)}}};return t.\u0275fac=function(e){return new(e||t)(i.Nb(j),i.Nb(s.g),i.Nb(a.j),i.Nb(a.g,8))},t.\u0275prov=i.Db({token:t,factory:function(e){return t.\u0275fac(e)},providedIn:"root"}),t.ngInjectableDef=Object(i.Db)({factory:function(){return new t(Object(i.Nb)(j),Object(i.Nb)(s.g),Object(i.Nb)(a.j),Object(i.Nb)(a.g,8))},token:t,providedIn:"root"}),t})();const N=(t,e,n)=>{if(!1!==e)return void 0!==n?n:"forward"===t||"back"===t?t:"root"===t&&!0===e?"forward":void 0},R="auto",P=void 0,D=(t,e)=>{const n=t.prototype;e.forEach(t=>{Object.defineProperty(n,t,{get(){return this.el[t]},set(e){this.z.runOutsideAngular(()=>this.el[t]=e)}})})},L=(t,e)=>{const n=t.prototype;e.forEach(t=>{n[t]=function(){const e=arguments;return this.z.runOutsideAngular(()=>this.el[t].apply(this.el,e))}})},M=(t,e,n)=>{n.forEach(n=>t[n]=Object(f.a)(e,n))};function F(t){return function(e){return t.inputs&&D(e,t.inputs),t.methods&&L(e,t.methods),e}}let U=(()=>{let t=class{constructor(t,e,n){this.z=n,t.detach(),this.el=e.nativeElement}};return t.\u0275fac=function(e){return new(e||t)(i.Hb(i.h),i.Hb(i.l),i.Hb(i.z))},t.\u0275cmp=i.Bb({type:t,selectors:[["ion-app"]],ngContentSelectors:b,decls:1,vars:0,template:function(t,e){1&t&&(i.Ub(),i.Tb(0))},encapsulation:2,changeDetection:0}),t})(),$=(()=>{let t=class{constructor(t,e,n){this.z=n,t.detach(),this.el=e.nativeElement}};return t.\u0275fac=function(e){return new(e||t)(i.Hb(i.h),i.Hb(i.l),i.Hb(i.z))},t.\u0275cmp=i.Bb({type:t,selectors:[["ion-back-button"]],inputs:{color:"color",defaultHref:"defaultHref",disabled:"disabled",icon:"icon",mode:"mode",routerAnimation:"routerAnimation",text:"text",type:"type"},ngContentSelectors:b,decls:1,vars:0,template:function(t,e){1&t&&(i.Ub(),i.Tb(0))},encapsulation:2,changeDetection:0}),t=Object(r.c)([F({inputs:["color","defaultHref","disabled","icon","mode","routerAnimation","text","type"]})],t),t})(),V=(()=>{let t=class{constructor(t,e,n){this.z=n,t.detach(),this.el=e.nativeElement,M(this,this.el,["ionFocus","ionBlur"])}};return t.\u0275fac=function(e){return new(e||t)(i.Hb(i.h),i.Hb(i.l),i.Hb(i.z))},t.\u0275cmp=i.Bb({type:t,selectors:[["ion-button"]],inputs:{buttonType:"buttonType",color:"color",disabled:"disabled",download:"download",expand:"expand",fill:"fill",href:"href",mode:"mode",rel:"rel",routerAnimation:"routerAnimation",routerDirection:"routerDirection",shape:"shape",size:"size",strong:"strong",target:"target",type:"type"},ngContentSelectors:b,decls:1,vars:0,template:function(t,e){1&t&&(i.Ub(),i.Tb(0))},encapsulation:2,changeDetection:0}),t=Object(r.c)([F({inputs:["buttonType","color","disabled","download","expand","fill","href","mode","rel","routerAnimation","routerDirection","shape","size","strong","target","type"]})],t),t})(),q=(()=>{let t=class{constructor(t,e,n){this.z=n,t.detach(),this.el=e.nativeElement}};return t.\u0275fac=function(e){return new(e||t)(i.Hb(i.h),i.Hb(i.l),i.Hb(i.z))},t.\u0275cmp=i.Bb({type:t,selectors:[["ion-card"]],inputs:{button:"button",color:"color",disabled:"disabled",download:"download",href:"href",mode:"mode",rel:"rel",routerAnimation:"routerAnimation",routerDirection:"routerDirection",target:"target",type:"type"},ngContentSelectors:b,decls:1,vars:0,template:function(t,e){1&t&&(i.Ub(),i.Tb(0))},encapsulation:2,changeDetection:0}),t=Object(r.c)([F({inputs:["button","color","disabled","download","href","mode","rel","routerAnimation","routerDirection","target","type"]})],t),t})(),H=(()=>{let t=class{constructor(t,e,n){this.z=n,t.detach(),this.el=e.nativeElement}};return t.\u0275fac=function(e){return new(e||t)(i.Hb(i.h),i.Hb(i.l),i.Hb(i.z))},t.\u0275cmp=i.Bb({type:t,selectors:[["ion-card-content"]],inputs:{mode:"mode"},ngContentSelectors:b,decls:1,vars:0,template:function(t,e){1&t&&(i.Ub(),i.Tb(0))},encapsulation:2,changeDetection:0}),t=Object(r.c)([F({inputs:["mode"]})],t),t})(),B=(()=>{let t=class{constructor(t,e,n){this.z=n,t.detach(),this.el=e.nativeElement}};return t.\u0275fac=function(e){return new(e||t)(i.Hb(i.h),i.Hb(i.l),i.Hb(i.z))},t.\u0275cmp=i.Bb({type:t,selectors:[["ion-card-header"]],inputs:{color:"color",mode:"mode",translucent:"translucent"},ngContentSelectors:b,decls:1,vars:0,template:function(t,e){1&t&&(i.Ub(),i.Tb(0))},encapsulation:2,changeDetection:0}),t=Object(r.c)([F({inputs:["color","mode","translucent"]})],t),t})(),z=(()=>{let t=class{constructor(t,e,n){this.z=n,t.detach(),this.el=e.nativeElement}};return t.\u0275fac=function(e){return new(e||t)(i.Hb(i.h),i.Hb(i.l),i.Hb(i.z))},t.\u0275cmp=i.Bb({type:t,selectors:[["ion-card-title"]],inputs:{color:"color",mode:"mode"},ngContentSelectors:b,decls:1,vars:0,template:function(t,e){1&t&&(i.Ub(),i.Tb(0))},encapsulation:2,changeDetection:0}),t=Object(r.c)([F({inputs:["color","mode"]})],t),t})(),W=(()=>{let t=class{constructor(t,e,n){this.z=n,t.detach(),this.el=e.nativeElement,M(this,this.el,["ionScrollStart","ionScroll","ionScrollEnd"])}};return t.\u0275fac=function(e){return new(e||t)(i.Hb(i.h),i.Hb(i.l),i.Hb(i.z))},t.\u0275cmp=i.Bb({type:t,selectors:[["ion-content"]],inputs:{color:"color",forceOverscroll:"forceOverscroll",fullscreen:"fullscreen",scrollEvents:"scrollEvents",scrollX:"scrollX",scrollY:"scrollY"},ngContentSelectors:b,decls:1,vars:0,template:function(t,e){1&t&&(i.Ub(),i.Tb(0))},encapsulation:2,changeDetection:0}),t=Object(r.c)([F({inputs:["color","forceOverscroll","fullscreen","scrollEvents","scrollX","scrollY"],methods:["getScrollElement","scrollToTop","scrollToBottom","scrollByPoint","scrollToPoint"]})],t),t})(),G=(()=>{let t=class{constructor(t,e,n){this.z=n,t.detach(),this.el=e.nativeElement}};return t.\u0275fac=function(e){return new(e||t)(i.Hb(i.h),i.Hb(i.l),i.Hb(i.z))},t.\u0275cmp=i.Bb({type:t,selectors:[["ion-header"]],inputs:{collapse:"collapse",mode:"mode",translucent:"translucent"},ngContentSelectors:b,decls:1,vars:0,template:function(t,e){1&t&&(i.Ub(),i.Tb(0))},encapsulation:2,changeDetection:0}),t=Object(r.c)([F({inputs:["collapse","mode","translucent"]})],t),t})(),Q=(()=>{let t=class{constructor(t,e,n){this.z=n,t.detach(),this.el=e.nativeElement}};return t.\u0275fac=function(e){return new(e||t)(i.Hb(i.h),i.Hb(i.l),i.Hb(i.z))},t.\u0275cmp=i.Bb({type:t,selectors:[["ion-icon"]],inputs:{ariaLabel:"ariaLabel",color:"color",flipRtl:"flipRtl",icon:"icon",ios:"ios",lazy:"lazy",md:"md",mode:"mode",name:"name",size:"size",src:"src"},ngContentSelectors:b,decls:1,vars:0,template:function(t,e){1&t&&(i.Ub(),i.Tb(0))},encapsulation:2,changeDetection:0}),t=Object(r.c)([F({inputs:["ariaLabel","color","flipRtl","icon","ios","lazy","md","mode","name","size","src"]})],t),t})(),K=(()=>{let t=class{constructor(t,e,n){this.z=n,t.detach(),this.el=e.nativeElement,M(this,this.el,["ionInput","ionChange","ionBlur","ionFocus"])}};return t.\u0275fac=function(e){return new(e||t)(i.Hb(i.h),i.Hb(i.l),i.Hb(i.z))},t.\u0275cmp=i.Bb({type:t,selectors:[["ion-input"]],inputs:{accept:"accept",autocapitalize:"autocapitalize",autocomplete:"autocomplete",autocorrect:"autocorrect",autofocus:"autofocus",clearInput:"clearInput",clearOnEdit:"clearOnEdit",color:"color",debounce:"debounce",disabled:"disabled",enterkeyhint:"enterkeyhint",inputmode:"inputmode",max:"max",maxlength:"maxlength",min:"min",minlength:"minlength",mode:"mode",multiple:"multiple",name:"name",pattern:"pattern",placeholder:"placeholder",readonly:"readonly",required:"required",size:"size",spellcheck:"spellcheck",step:"step",type:"type",value:"value"},ngContentSelectors:b,decls:1,vars:0,template:function(t,e){1&t&&(i.Ub(),i.Tb(0))},encapsulation:2,changeDetection:0}),t=Object(r.c)([F({inputs:["accept","autocapitalize","autocomplete","autocorrect","autofocus","clearInput","clearOnEdit","color","debounce","disabled","enterkeyhint","inputmode","max","maxlength","min","minlength","mode","multiple","name","pattern","placeholder","readonly","required","size","spellcheck","step","type","value"],methods:["setFocus","getInputElement"]})],t),t})(),X=(()=>{let t=class{constructor(t,e,n){this.z=n,t.detach(),this.el=e.nativeElement}};return t.\u0275fac=function(e){return new(e||t)(i.Hb(i.h),i.Hb(i.l),i.Hb(i.z))},t.\u0275cmp=i.Bb({type:t,selectors:[["ion-item"]],inputs:{button:"button",color:"color",detail:"detail",detailIcon:"detailIcon",disabled:"disabled",download:"download",href:"href",lines:"lines",mode:"mode",rel:"rel",routerAnimation:"routerAnimation",routerDirection:"routerDirection",target:"target",type:"type"},ngContentSelectors:b,decls:1,vars:0,template:function(t,e){1&t&&(i.Ub(),i.Tb(0))},encapsulation:2,changeDetection:0}),t=Object(r.c)([F({inputs:["button","color","detail","detailIcon","disabled","download","href","lines","mode","rel","routerAnimation","routerDirection","target","type"]})],t),t})(),Y=(()=>{let t=class{constructor(t,e,n){this.z=n,t.detach(),this.el=e.nativeElement}};return t.\u0275fac=function(e){return new(e||t)(i.Hb(i.h),i.Hb(i.l),i.Hb(i.z))},t.\u0275cmp=i.Bb({type:t,selectors:[["ion-label"]],inputs:{color:"color",mode:"mode",position:"position"},ngContentSelectors:b,decls:1,vars:0,template:function(t,e){1&t&&(i.Ub(),i.Tb(0))},encapsulation:2,changeDetection:0}),t=Object(r.c)([F({inputs:["color","mode","position"]})],t),t})(),J=(()=>{let t=class{constructor(t,e,n){this.z=n,t.detach(),this.el=e.nativeElement}};return t.\u0275fac=function(e){return new(e||t)(i.Hb(i.h),i.Hb(i.l),i.Hb(i.z))},t.\u0275cmp=i.Bb({type:t,selectors:[["ion-list"]],inputs:{inset:"inset",lines:"lines",mode:"mode"},ngContentSelectors:b,decls:1,vars:0,template:function(t,e){1&t&&(i.Ub(),i.Tb(0))},encapsulation:2,changeDetection:0}),t=Object(r.c)([F({inputs:["inset","lines","mode"],methods:["closeSlidingItems"]})],t),t})(),Z=(()=>{let t=class{constructor(t,e,n){this.z=n,t.detach(),this.el=e.nativeElement,M(this,this.el,["ionInput","ionChange","ionCancel","ionClear","ionBlur","ionFocus"])}};return t.\u0275fac=function(e){return new(e||t)(i.Hb(i.h),i.Hb(i.l),i.Hb(i.z))},t.\u0275cmp=i.Bb({type:t,selectors:[["ion-searchbar"]],inputs:{animated:"animated",autocomplete:"autocomplete",autocorrect:"autocorrect",cancelButtonIcon:"cancelButtonIcon",cancelButtonText:"cancelButtonText",clearIcon:"clearIcon",color:"color",debounce:"debounce",disabled:"disabled",enterkeyhint:"enterkeyhint",inputmode:"inputmode",mode:"mode",placeholder:"placeholder",searchIcon:"searchIcon",showCancelButton:"showCancelButton",spellcheck:"spellcheck",type:"type",value:"value"},ngContentSelectors:b,decls:1,vars:0,template:function(t,e){1&t&&(i.Ub(),i.Tb(0))},encapsulation:2,changeDetection:0}),t=Object(r.c)([F({inputs:["animated","autocomplete","autocorrect","cancelButtonIcon","cancelButtonText","clearIcon","color","debounce","disabled","enterkeyhint","inputmode","mode","placeholder","searchIcon","showCancelButton","spellcheck","type","value"],methods:["setFocus","getInputElement"]})],t),t})(),tt=(()=>{let t=class{constructor(t,e,n){this.z=n,t.detach(),this.el=e.nativeElement}};return t.\u0275fac=function(e){return new(e||t)(i.Hb(i.h),i.Hb(i.l),i.Hb(i.z))},t.\u0275cmp=i.Bb({type:t,selectors:[["ion-thumbnail"]],ngContentSelectors:b,decls:1,vars:0,template:function(t,e){1&t&&(i.Ub(),i.Tb(0))},encapsulation:2,changeDetection:0}),t})(),et=(()=>{let t=class{constructor(t,e,n){this.z=n,t.detach(),this.el=e.nativeElement}};return t.\u0275fac=function(e){return new(e||t)(i.Hb(i.h),i.Hb(i.l),i.Hb(i.z))},t.\u0275cmp=i.Bb({type:t,selectors:[["ion-title"]],inputs:{color:"color",size:"size"},ngContentSelectors:b,decls:1,vars:0,template:function(t,e){1&t&&(i.Ub(),i.Tb(0))},encapsulation:2,changeDetection:0}),t=Object(r.c)([F({inputs:["color","size"]})],t),t})(),nt=(()=>{let t=class{constructor(t,e,n){this.z=n,t.detach(),this.el=e.nativeElement}};return t.\u0275fac=function(e){return new(e||t)(i.Hb(i.h),i.Hb(i.l),i.Hb(i.z))},t.\u0275cmp=i.Bb({type:t,selectors:[["ion-toolbar"]],inputs:{color:"color",mode:"mode"},ngContentSelectors:b,decls:1,vars:0,template:function(t,e){1&t&&(i.Ub(),i.Tb(0))},encapsulation:2,changeDetection:0}),t=Object(r.c)([F({inputs:["color","mode"]})],t),t})(),rt=(()=>{let t=class{get(t,e){const n=ot();return n?n.get(t,e):null}getBoolean(t,e){const n=ot();return!!n&&n.getBoolean(t,e)}getNumber(t,e){const n=ot();return n?n.getNumber(t,e):0}set(t,e){console.warn("[DEPRECATION][Config]: The Config.set() method is deprecated and will be removed in Ionic Framework 6.0. Please see https://ionicframework.com/docs/angular/config for alternatives.");const n=ot();n&&n.set(t,e)}};return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=i.Db({token:t,factory:function(e){return t.\u0275fac(e)},providedIn:"root"}),t.ngInjectableDef=Object(i.Db)({factory:function(){return new t},token:t,providedIn:"root"}),t})();const it=new i.q("USERCONFIG"),ot=()=>{if("undefined"!=typeof window){const t=window.Ionic;if(t&&t.config)return t.config}return null};class st{constructor(t={}){this.data=t}get(t){return this.data[t]}}let at=(()=>{let t=class{constructor(t,e){this.zone=t,this.appRef=e}create(t,e,n){return new ut(t,e,n,this.appRef,this.zone)}};return t.\u0275fac=function(e){return new(e||t)(i.Nb(i.z),i.Nb(i.g))},t.\u0275prov=i.Db({token:t,factory:function(e){return t.\u0275fac(e)}}),t})();class ut{constructor(t,e,n,r,i){this.resolver=t,this.injector=e,this.location=n,this.appRef=r,this.zone=i,this.elRefMap=new WeakMap,this.elEventsMap=new WeakMap}attachViewToDom(t,e,n,r){return this.zone.run(()=>new Promise(i=>{i(ct(this.zone,this.resolver,this.injector,this.location,this.appRef,this.elRefMap,this.elEventsMap,t,e,n,r))}))}removeViewFromDom(t,e){return this.zone.run(()=>new Promise(t=>{const n=this.elRefMap.get(e);if(n){n.destroy(),this.elRefMap.delete(e);const t=this.elEventsMap.get(e);t&&(t(),this.elEventsMap.delete(e))}t()}))}}const ct=(t,e,n,r,o,s,a,u,c,l,h)=>{const d=e.resolveComponentFactory(c),f=i.r.create({providers:ft(l),parent:n}),p=r?r.createComponent(d,r.length,f):d.create(f),g=p.instance,y=p.location.nativeElement;if(l&&Object.assign(g,l),h)for(const i of h)y.classList.add(i);const v=ht(t,g,y);return u.appendChild(y),r||o.attachView(p.hostView),p.changeDetectorRef.reattach(),s.set(y,p),a.set(y,v),y},lt=[l.a,l.b,l.c,l.d,l.e],ht=(t,e,n)=>t.run(()=>{const t=lt.filter(t=>"function"==typeof e[t]).map(t=>{const r=n=>e[t](n.detail);return n.addEventListener(t,r),()=>n.removeEventListener(t,r)});return()=>t.forEach(t=>t())}),dt=new i.q("NavParamsToken"),ft=t=>[{provide:dt,useValue:t},{provide:st,useFactory:pt,deps:[dt]}],pt=t=>new st(t),gt=(t,e)=>((t=t.filter(t=>t.stackId!==e.stackId)).push(e),t),yt=(t,e)=>{const n=t.createUrlTree(["."],{relativeTo:e});return t.serializeUrl(n)},vt=(t,e)=>{if(!t)return;const n=mt(e);for(let r=0;r<n.length;r++){if(r>=t.length)return n[r];if(n[r]!==t[r])return}},mt=t=>t.split("/").map(t=>t.trim()).filter(t=>""!==t),bt=t=>{t&&(t.ref.destroy(),t.unlistenEvents())};class _t{constructor(t,e,n,r,i,o){this.containerEl=e,this.router=n,this.navCtrl=r,this.zone=i,this.location=o,this.views=[],this.skipTransition=!1,this.nextId=0,this.tabsPrefix=void 0!==t?mt(t):void 0}createView(t,e){const n=yt(this.router,e),r=t&&t.location&&t.location.nativeElement,i=ht(this.zone,t.instance,r);return{id:this.nextId++,stackId:vt(this.tabsPrefix,n),unlistenEvents:i,element:r,ref:t,url:n}}getExistingView(t){const e=yt(this.router,t),n=this.views.find(t=>t.url===e);return n&&n.ref.changeDetectorRef.reattach(),n}setActive(t){const e=this.navCtrl.consumeTransition();let{direction:n,animation:r,animationBuilder:i}=e;const o=this.activeView,s=((t,e)=>!e||t.stackId!==e.stackId)(t,o);s&&(n="back",r=void 0);const a=this.views.slice();let u;const c=this.router;c.getCurrentNavigation?u=c.getCurrentNavigation():c.navigations&&c.navigations.value&&(u=c.navigations.value),u&&u.extras&&u.extras.replaceUrl&&this.views.length>0&&this.views.splice(-1,1);const l=this.views.includes(t),h=this.insertView(t,n);l||t.ref.changeDetectorRef.detectChanges();const d=t.animationBuilder;return void 0!==i||"back"!==n||s||void 0===d||(i=d),o&&(o.animationBuilder=i),this.zone.runOutsideAngular(()=>this.wait(()=>(o&&o.ref.changeDetectorRef.detach(),t.ref.changeDetectorRef.reattach(),this.transition(t,o,r,this.canGoBack(1),!1,i).then(()=>wt(t,h,a,this.location)).then(()=>({enteringView:t,direction:n,animation:r,tabSwitch:s})))))}canGoBack(t,e=this.getActiveStackId()){return this.getStack(e).length>t}pop(t,e=this.getActiveStackId()){return this.zone.run(()=>{const n=this.getStack(e);if(n.length<=t)return Promise.resolve(!1);const r=n[n.length-t-1];let i=r.url;const o=r.savedData;if(o){const t=o.get("primary");t&&t.route&&t.route._routerState&&t.route._routerState.snapshot&&t.route._routerState.snapshot.url&&(i=t.route._routerState.snapshot.url)}const{animationBuilder:s}=this.navCtrl.consumeTransition();return this.navCtrl.navigateBack(i,Object.assign({},r.savedExtras,{animation:s})).then(()=>!0)})}startBackTransition(){const t=this.activeView;if(t){const e=this.getStack(t.stackId),n=e[e.length-2],r=n.animationBuilder;return this.wait(()=>this.transition(n,t,"back",this.canGoBack(2),!0,r))}return Promise.resolve()}endBackTransition(t){t?(this.skipTransition=!0,this.pop(1)):this.activeView&&Et(this.activeView,this.views,this.views,this.location)}getLastUrl(t){const e=this.getStack(t);return e.length>0?e[e.length-1]:void 0}getRootUrl(t){const e=this.getStack(t);return e.length>0?e[0]:void 0}getActiveStackId(){return this.activeView?this.activeView.stackId:void 0}destroy(){this.containerEl=void 0,this.views.forEach(bt),this.activeView=void 0,this.views=[]}getStack(t){return this.views.filter(e=>e.stackId===t)}insertView(t,e){return this.activeView=t,this.views=((t,e,n)=>"root"===n?gt(t,e):"forward"===n?((t,e)=>(t.indexOf(e)>=0?t=t.filter(t=>t.stackId!==e.stackId||t.id<=e.id):t.push(e),t))(t,e):((t,e)=>t.indexOf(e)>=0?t.filter(t=>t.stackId!==e.stackId||t.id<=e.id):gt(t,e))(t,e))(this.views,t,e),this.views.slice()}transition(t,e,n,r,i,o){if(this.skipTransition)return this.skipTransition=!1,Promise.resolve(!1);if(e===t)return Promise.resolve(!1);const s=t?t.element:void 0,a=e?e.element:void 0,u=this.containerEl;return s&&s!==a&&(s.classList.add("ion-page"),s.classList.add("ion-page-invisible"),s.parentElement!==u&&u.appendChild(s),u.commit)?u.commit(s,a,{deepWait:!0,duration:void 0===n?0:void 0,direction:n,showGoBack:r,progressAnimation:i,animationBuilder:o}):Promise.resolve(!1)}wait(t){return Object(r.b)(this,void 0,void 0,(function*(){return void 0!==this.runningTask&&(yield this.runningTask,this.runningTask=void 0),this.runningTask=t()}))}}const wt=(t,e,n,r)=>"function"==typeof requestAnimationFrame?new Promise(i=>{requestAnimationFrame(()=>{Et(t,e,n,r),i()})}):Promise.resolve(),Et=(t,e,n,r)=>{n.filter(t=>!e.includes(t)).forEach(bt),e.forEach(e=>{const n=r.path().split("?")[0].split("#")[0];if(e!==t&&e.url!==n){const t=e.element;t.setAttribute("aria-hidden","true"),t.classList.add("ion-page-hidden"),e.ref.changeDetectorRef.detach()}})};let Ot=(()=>{let t=class{constructor(t,e,n,r,o,s,u,c,l,h,d,f,g){this.parentContexts=t,this.location=e,this.resolver=n,this.config=s,this.navCtrl=u,this.parentOutlet=g,this.activated=null,this.activatedView=null,this._activatedRoute=null,this.proxyMap=new WeakMap,this.currentActivatedRoute$=new p.a(null),this.stackEvents=new i.n,this.activateEvents=new i.n,this.deactivateEvents=new i.n,this.nativeEl=l.nativeElement,this.name=r||a.d,this.tabsPrefix="true"===o?yt(h,f):void 0,this.stackCtrl=new _t(this.tabsPrefix,this.nativeEl,h,u,d,c),t.onChildOutletCreated(this.name,this)}set animation(t){this.nativeEl.animation=t}set animated(t){this.nativeEl.animated=t}set swipeGesture(t){this._swipeGesture=t,this.nativeEl.swipeHandler=t?{canStart:()=>this.stackCtrl.canGoBack(1),onStart:()=>this.stackCtrl.startBackTransition(),onEnd:t=>this.stackCtrl.endBackTransition(t)}:void 0}ngOnDestroy(){this.stackCtrl.destroy()}getContext(){return this.parentContexts.getContext(this.name)}ngOnInit(){if(!this.activated){const t=this.getContext();t&&t.route&&this.activateWith(t.route,t.resolver||null)}this.nativeEl.componentOnReady&&this.nativeEl.componentOnReady().then(()=>{void 0===this._swipeGesture&&(this.swipeGesture=this.config.getBoolean("swipeBackEnabled","ios"===this.nativeEl.mode))})}get isActivated(){return!!this.activated}get component(){if(!this.activated)throw new Error("Outlet is not activated");return this.activated.instance}get activatedRoute(){if(!this.activated)throw new Error("Outlet is not activated");return this._activatedRoute}get activatedRouteData(){return this._activatedRoute?this._activatedRoute.snapshot.data:{}}detach(){throw new Error("incompatible reuse strategy")}attach(t,e){throw new Error("incompatible reuse strategy")}deactivate(){if(this.activated){if(this.activatedView){this.activatedView.savedData=new Map(this.getContext().children.contexts),this.activatedView.savedExtras={};const t=this.getContext();if(t.route){const e=t.route.snapshot;this.activatedView.savedExtras.queryParams=e.queryParams,this.activatedView.savedExtras.fragment=e.fragment}}const t=this.component;this.activatedView=null,this.activated=null,this._activatedRoute=null,this.deactivateEvents.emit(t)}}activateWith(t,e){if(this.isActivated)throw new Error("Cannot activate an already activated outlet");let n;this._activatedRoute=t;let r=this.stackCtrl.getExistingView(t);if(r){n=this.activated=r.ref;const e=r.savedData;e&&(this.getContext().children.contexts=e),this.updateActivatedRouteProxy(n.instance,t)}else{const i=(e=e||this.resolver).resolveComponentFactory(t._futureSnapshot.routeConfig.component),o=this.parentContexts.getOrCreateContext(this.name).children,s=new p.a(null),a=this.createActivatedRouteProxy(s,t),u=new Ct(a,o,this.location.injector);n=this.activated=this.location.createComponent(i,this.location.length,u),s.next(n.instance),r=this.stackCtrl.createView(this.activated,t),this.proxyMap.set(n.instance,a),this.currentActivatedRoute$.next({component:n.instance,activatedRoute:t})}this.activatedView=r,this.stackCtrl.setActive(r).then(t=>{this.navCtrl.setTopOutlet(this),this.activateEvents.emit(n.instance),this.stackEvents.emit(t)})}canGoBack(t=1,e){return this.stackCtrl.canGoBack(t,e)}pop(t=1,e){return this.stackCtrl.pop(t,e)}getLastUrl(t){const e=this.stackCtrl.getLastUrl(t);return e?e.url:void 0}getLastRouteView(t){return this.stackCtrl.getLastUrl(t)}getRootView(t){return this.stackCtrl.getRootUrl(t)}getActiveStackId(){return this.stackCtrl.getActiveStackId()}createActivatedRouteProxy(t,e){const n=new a.a;return n._futureSnapshot=e._futureSnapshot,n._routerState=e._routerState,n.snapshot=e.snapshot,n.outlet=e.outlet,n.component=e.component,n._paramMap=this.proxyObservable(t,"paramMap"),n._queryParamMap=this.proxyObservable(t,"queryParamMap"),n.url=this.proxyObservable(t,"url"),n.params=this.proxyObservable(t,"params"),n.queryParams=this.proxyObservable(t,"queryParams"),n.fragment=this.proxyObservable(t,"fragment"),n.data=this.proxyObservable(t,"data"),n}proxyObservable(t,e){return t.pipe(Object(g.a)(t=>!!t),Object(y.a)(t=>this.currentActivatedRoute$.pipe(Object(g.a)(e=>null!==e&&e.component===t),Object(y.a)(t=>t&&t.activatedRoute[e]),Object(v.a)())))}updateActivatedRouteProxy(t,e){const n=this.proxyMap.get(t);if(!n)throw new Error("Could not find activated route proxy for view");n._futureSnapshot=e._futureSnapshot,n._routerState=e._routerState,n.snapshot=e.snapshot,n.outlet=e.outlet,n.component=e.component,this.currentActivatedRoute$.next({component:t,activatedRoute:e})}};return t.\u0275fac=function(e){return new(e||t)(i.Hb(a.b),i.Hb(i.P),i.Hb(i.j),i.Ob("name"),i.Ob("tabs"),i.Hb(rt),i.Hb(k),i.Hb(s.g),i.Hb(i.l),i.Hb(a.g),i.Hb(i.z),i.Hb(a.a),i.Hb(t,12))},t.\u0275dir=i.Cb({type:t,selectors:[["ion-router-outlet"]],inputs:{animated:"animated",animation:"animation",swipeGesture:"swipeGesture"},outputs:{stackEvents:"stackEvents",activateEvents:"activate",deactivateEvents:"deactivate"},exportAs:["outlet"]}),t})();class Ct{constructor(t,e,n){this.route=t,this.childContexts=e,this.parent=n}get(t,e){return t===a.a?this.route:t===a.b?this.childContexts:this.parent.get(t,e)}}let Tt=(()=>{let t=class{constructor(t,e,n){this.routerOutlet=t,this.navCtrl=e,this.config=n}onClick(t){const e=this.defaultHref||this.config.get("backButtonDefaultHref");this.routerOutlet&&this.routerOutlet.canGoBack()?(this.navCtrl.setDirection("back",void 0,void 0,this.routerAnimation),this.routerOutlet.pop(),t.preventDefault()):null!=e&&(this.navCtrl.navigateBack(e,{animation:this.routerAnimation}),t.preventDefault())}};return t.\u0275fac=function(e){return new(e||t)(i.Hb(Ot,8),i.Hb(k),i.Hb(rt))},t.\u0275dir=i.Cb({type:t,selectors:[["ion-back-button"]],hostBindings:function(t,e){1&t&&i.Rb("click",(function(t){return e.onClick(t)}))},inputs:{defaultHref:"defaultHref",routerAnimation:"routerAnimation"}}),t})(),St=(()=>{let t=class{constructor(t,e,n,r,i){this.locationStrategy=t,this.navCtrl=e,this.elementRef=n,this.router=r,this.routerLink=i,this.routerDirection="forward"}ngOnInit(){this.updateTargetUrlAndHref()}ngOnChanges(){this.updateTargetUrlAndHref()}ngOnDestroy(){this.subscription&&this.subscription.unsubscribe()}updateTargetUrlAndHref(){if(this.routerLink){const t=this.locationStrategy.prepareExternalUrl(this.router.serializeUrl(this.routerLink.urlTree));this.elementRef.nativeElement.href=t}}onClick(t){this.navCtrl.setDirection(this.routerDirection,void 0,void 0,this.routerAnimation),t.preventDefault()}};return t.\u0275fac=function(e){return new(e||t)(i.Hb(s.h),i.Hb(k),i.Hb(i.l),i.Hb(a.g),i.Hb(a.h,8))},t.\u0275dir=i.Cb({type:t,selectors:[["","routerLink",""]],hostBindings:function(t,e){1&t&&i.Rb("click",(function(t){return e.onClick(t)}))},inputs:{routerDirection:"routerDirection",routerAnimation:"routerAnimation"},features:[i.wb]}),t})();class It{constructor(t){this.ctrl=t}create(t){return this.ctrl.create(t||{})}dismiss(t,e,n){return this.ctrl.dismiss(t,e,n)}getTop(){return this.ctrl.getTop()}}let jt=(()=>{let t=class extends It{constructor(){super(h.b)}};return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=i.Db({token:t,factory:function(e){return t.\u0275fac(e)},providedIn:"root"}),t.ngInjectableDef=Object(i.Db)({factory:function(){return new t},token:t,providedIn:"root"}),t})(),xt=(()=>{let t=class extends It{constructor(t,e,n){super(h.l),this.angularDelegate=t,this.resolver=e,this.injector=n}create(t){return super.create(Object.assign({},t,{delegate:this.angularDelegate.create(this.resolver,this.injector)}))}};return t.\u0275fac=function(e){return new(e||t)(i.Nb(at),i.Nb(i.j),i.Nb(i.r))},t.\u0275prov=i.Db({token:t,factory:function(e){return t.\u0275fac(e)}}),t})(),At=(()=>{let t=class extends It{constructor(t,e,n){super(h.d),this.angularDelegate=t,this.resolver=e,this.injector=n}create(t){return super.create(Object.assign({},t,{delegate:this.angularDelegate.create(this.resolver,this.injector)}))}};return t.\u0275fac=function(e){return new(e||t)(i.Nb(at),i.Nb(i.j),i.Nb(i.r))},t.\u0275prov=i.Db({token:t,factory:function(e){return t.\u0275fac(e)}}),t})();class kt{shouldDetach(t){return!1}shouldAttach(t){return!1}store(t,e){}retrieve(t){return null}shouldReuseRoute(t,e){if(t.routeConfig!==e.routeConfig)return!1;const n=t.params,r=e.params,i=Object.keys(n),o=Object.keys(r);if(i.length!==o.length)return!1;for(const s of i)if(r[s]!==n[s])return!1;return!0}}let Nt=!1;const Rt=(t,e,r)=>()=>{const i=e.defaultView;if(i&&"undefined"!=typeof window){Nt&&console.warn("Ionic Angular was already initialized. Make sure IonicModule.forRoot() is just called once."),Nt=!0,(i.Ionic=i.Ionic||{}).config=Object.assign({},t,{_zoneGate:t=>r.run(t)});const o="__zone_symbol__addEventListener"in e.body?"__zone_symbol__addEventListener":"addEventListener";return function(){var t=[];if("undefined"!=typeof window){var e=window;e.customElements&&(!e.Element||e.Element.prototype.closest&&e.Element.prototype.matches&&e.Element.prototype.remove&&e.Element.prototype.getRootNode)||t.push(n.e(8).then(n.t.bind(null,"QdDj",7))),"function"==typeof Object.assign&&Object.entries&&Array.prototype.find&&Array.prototype.includes&&String.prototype.startsWith&&String.prototype.endsWith&&(!e.NodeList||e.NodeList.prototype.forEach)&&e.fetch&&function(){try{var t=new URL("b","http://a");return t.pathname="c%20d","http://a/c%20d"===t.href&&t.searchParams}catch(e){return!1}}()&&"undefined"!=typeof WeakMap||t.push(n.e(6).then(n.t.bind(null,"t6o4",7)))}return Promise.all(t)}().then(()=>{return t={exclude:["ion-tabs","ion-tab"],syncQueue:!0,raf:_,jmp:t=>r.runOutsideAngular(t),ael(t,e,n,r){t[o](e,n,r)},rel(t,e,n,r){t.removeEventListener(e,n,r)}},"undefined"==typeof window?Promise.resolve():(u.b&&u.b.supports&&u.b.supports("color","var(--c)")?Object(u.d)():n.e(7).then(n.t.bind(null,"PC2G",7)).then(()=>(u.n.$cssShim$=u.q.__cssshim)?u.n.$cssShim$.i():0)).then(()=>(m(),Object(u.e)(JSON.parse('[["ion-select_3",[[2,"ion-select-popover",{"header":[1],"subHeader":[1,"sub-header"],"message":[1],"options":[16]},[[0,"ionChange","onSelect"]]],[33,"ion-select",{"disabled":[4],"cancelText":[1,"cancel-text"],"okText":[1,"ok-text"],"placeholder":[1],"name":[1],"selectedText":[1,"selected-text"],"multiple":[4],"interface":[1],"interfaceOptions":[8,"interface-options"],"compareWith":[1,"compare-with"],"value":[1032],"isExpanded":[32],"open":[64]}],[1,"ion-select-option",{"disabled":[4],"value":[8]}]]],["ion-menu_3",[[33,"ion-menu-button",{"color":[1],"disabled":[4],"menu":[1],"autoHide":[4,"auto-hide"],"type":[1],"visible":[32]},[[16,"ionMenuChange","visibilityChanged"],[16,"ionSplitPaneVisible","visibilityChanged"]]],[33,"ion-menu",{"contentId":[513,"content-id"],"menuId":[513,"menu-id"],"type":[1025],"disabled":[1028],"side":[513],"swipeGesture":[4,"swipe-gesture"],"maxEdgeStart":[2,"max-edge-start"],"isPaneVisible":[32],"isEndSide":[32],"isOpen":[64],"isActive":[64],"open":[64],"close":[64],"toggle":[64],"setOpen":[64]},[[16,"ionSplitPaneVisible","onSplitPaneChanged"],[2,"click","onBackdropClick"]]],[1,"ion-menu-toggle",{"menu":[1],"autoHide":[4,"auto-hide"],"visible":[32]},[[16,"ionMenuChange","visibilityChanged"],[16,"ionSplitPaneVisible","visibilityChanged"]]]]],["ion-action-sheet",[[34,"ion-action-sheet",{"overlayIndex":[2,"overlay-index"],"keyboardClose":[4,"keyboard-close"],"enterAnimation":[16],"leaveAnimation":[16],"buttons":[16],"cssClass":[1,"css-class"],"backdropDismiss":[4,"backdrop-dismiss"],"header":[1],"subHeader":[1,"sub-header"],"translucent":[4],"animated":[4],"present":[64],"dismiss":[64],"onDidDismiss":[64],"onWillDismiss":[64]}]]],["ion-fab_3",[[33,"ion-fab-button",{"color":[1],"activated":[4],"disabled":[4],"download":[1],"href":[1],"rel":[1],"routerDirection":[1,"router-direction"],"routerAnimation":[16],"target":[1],"show":[4],"translucent":[4],"type":[1],"size":[1],"closeIcon":[1,"close-icon"]}],[1,"ion-fab",{"horizontal":[1],"vertical":[1],"edge":[4],"activated":[1028],"close":[64]}],[1,"ion-fab-list",{"activated":[4],"side":[1]}]]],["ion-refresher_2",[[0,"ion-refresher-content",{"pullingIcon":[1025,"pulling-icon"],"pullingText":[1,"pulling-text"],"refreshingSpinner":[1025,"refreshing-spinner"],"refreshingText":[1,"refreshing-text"]}],[32,"ion-refresher",{"pullMin":[2,"pull-min"],"pullMax":[2,"pull-max"],"closeDuration":[1,"close-duration"],"snapbackDuration":[1,"snapback-duration"],"pullFactor":[2,"pull-factor"],"disabled":[4],"nativeRefresher":[32],"state":[32],"complete":[64],"cancel":[64],"getProgress":[64]}]]],["ion-alert",[[34,"ion-alert",{"overlayIndex":[2,"overlay-index"],"keyboardClose":[4,"keyboard-close"],"enterAnimation":[16],"leaveAnimation":[16],"cssClass":[1,"css-class"],"header":[1],"subHeader":[1,"sub-header"],"message":[1],"buttons":[16],"inputs":[1040],"backdropDismiss":[4,"backdrop-dismiss"],"translucent":[4],"animated":[4],"present":[64],"dismiss":[64],"onDidDismiss":[64],"onWillDismiss":[64]},[[4,"keydown","onKeydown"]]]]],["ion-back-button",[[33,"ion-back-button",{"color":[1],"defaultHref":[1025,"default-href"],"disabled":[516],"icon":[1],"text":[1],"type":[1],"routerAnimation":[16]}]]],["ion-loading",[[34,"ion-loading",{"overlayIndex":[2,"overlay-index"],"keyboardClose":[4,"keyboard-close"],"enterAnimation":[16],"leaveAnimation":[16],"message":[1],"cssClass":[1,"css-class"],"duration":[2],"backdropDismiss":[4,"backdrop-dismiss"],"showBackdrop":[4,"show-backdrop"],"spinner":[1025],"translucent":[4],"animated":[4],"present":[64],"dismiss":[64],"onDidDismiss":[64],"onWillDismiss":[64]}]]],["ion-toast",[[33,"ion-toast",{"overlayIndex":[2,"overlay-index"],"color":[1],"enterAnimation":[16],"leaveAnimation":[16],"cssClass":[1,"css-class"],"duration":[2],"header":[1],"message":[1],"keyboardClose":[4,"keyboard-close"],"position":[1],"buttons":[16],"translucent":[4],"animated":[4],"present":[64],"dismiss":[64],"onDidDismiss":[64],"onWillDismiss":[64]}]]],["ion-card_5",[[33,"ion-card",{"color":[1],"button":[4],"type":[1],"disabled":[4],"download":[1],"href":[1],"rel":[1],"routerDirection":[1,"router-direction"],"routerAnimation":[16],"target":[1]}],[32,"ion-card-content"],[33,"ion-card-header",{"color":[1],"translucent":[4]}],[33,"ion-card-subtitle",{"color":[1]}],[33,"ion-card-title",{"color":[1]}]]],["ion-item-option_3",[[33,"ion-item-option",{"color":[1],"disabled":[4],"download":[1],"expandable":[4],"href":[1],"rel":[1],"target":[1],"type":[1]}],[32,"ion-item-options",{"side":[1],"fireSwipeEvent":[64]}],[0,"ion-item-sliding",{"disabled":[4],"state":[32],"getOpenAmount":[64],"getSlidingRatio":[64],"open":[64],"close":[64],"closeOpened":[64]}]]],["ion-infinite-scroll_2",[[32,"ion-infinite-scroll-content",{"loadingSpinner":[1025,"loading-spinner"],"loadingText":[1,"loading-text"]}],[0,"ion-infinite-scroll",{"threshold":[1],"disabled":[4],"position":[1],"isLoading":[32],"complete":[64]}]]],["ion-reorder_2",[[33,"ion-reorder",null,[[2,"click","onClick"]]],[0,"ion-reorder-group",{"disabled":[4],"state":[32],"complete":[64]}]]],["ion-segment_2",[[33,"ion-segment-button",{"disabled":[4],"layout":[1],"type":[1],"value":[1],"checked":[32]}],[33,"ion-segment",{"color":[1],"disabled":[4],"scrollable":[4],"value":[1025],"activated":[32]}]]],["ion-tab-bar_2",[[33,"ion-tab-button",{"disabled":[4],"download":[1],"href":[1],"rel":[1],"layout":[1025],"selected":[1028],"tab":[1],"target":[1]},[[8,"ionTabBarChanged","onTabBarChanged"]]],[33,"ion-tab-bar",{"color":[1],"selectedTab":[1,"selected-tab"],"translucent":[4],"keyboardVisible":[32]},[[8,"keyboardWillHide","onKeyboardWillHide"],[8,"keyboardWillShow","onKeyboardWillShow"]]]]],["ion-chip",[[33,"ion-chip",{"color":[1],"outline":[4]}]]],["ion-modal",[[34,"ion-modal",{"overlayIndex":[2,"overlay-index"],"delegate":[16],"keyboardClose":[4,"keyboard-close"],"enterAnimation":[16],"leaveAnimation":[16],"component":[1],"componentProps":[16],"cssClass":[1,"css-class"],"backdropDismiss":[4,"backdrop-dismiss"],"showBackdrop":[4,"show-backdrop"],"animated":[4],"swipeToClose":[4,"swipe-to-close"],"presentingElement":[16],"present":[64],"dismiss":[64],"onDidDismiss":[64],"onWillDismiss":[64]}]]],["ion-popover",[[34,"ion-popover",{"delegate":[16],"overlayIndex":[2,"overlay-index"],"enterAnimation":[16],"leaveAnimation":[16],"component":[1],"componentProps":[16],"keyboardClose":[4,"keyboard-close"],"cssClass":[1,"css-class"],"backdropDismiss":[4,"backdrop-dismiss"],"event":[8],"showBackdrop":[4,"show-backdrop"],"translucent":[4],"animated":[4],"present":[64],"dismiss":[64],"onDidDismiss":[64],"onWillDismiss":[64]}]]],["ion-searchbar",[[34,"ion-searchbar",{"color":[1],"animated":[4],"autocomplete":[1],"autocorrect":[1],"cancelButtonIcon":[1,"cancel-button-icon"],"cancelButtonText":[1,"cancel-button-text"],"clearIcon":[1,"clear-icon"],"debounce":[2],"disabled":[4],"inputmode":[1],"enterkeyhint":[1],"placeholder":[1],"searchIcon":[1,"search-icon"],"showCancelButton":[1,"show-cancel-button"],"spellcheck":[4],"type":[1],"value":[1025],"focused":[32],"noAnimate":[32],"setFocus":[64],"getInputElement":[64]}]]],["ion-app_8",[[0,"ion-app"],[34,"ion-buttons",{"collapse":[4]}],[1,"ion-content",{"color":[1],"fullscreen":[4],"forceOverscroll":[1028,"force-overscroll"],"scrollX":[4,"scroll-x"],"scrollY":[4,"scroll-y"],"scrollEvents":[4,"scroll-events"],"getScrollElement":[64],"scrollToTop":[64],"scrollToBottom":[64],"scrollByPoint":[64],"scrollToPoint":[64]},[[8,"appload","onAppLoad"],[2,"click","onClick"]]],[36,"ion-footer",{"translucent":[4]}],[36,"ion-header",{"collapse":[1],"translucent":[4]}],[1,"ion-router-outlet",{"mode":[1025],"delegate":[16],"animated":[4],"animation":[16],"swipeHandler":[16],"commit":[64],"setRouteId":[64],"getRouteId":[64]}],[33,"ion-title",{"color":[1],"size":[1]}],[33,"ion-toolbar",{"color":[1]},[[0,"ionStyle","childrenStyle"]]]]],["ion-route_4",[[0,"ion-route",{"url":[1],"component":[1],"componentProps":[16],"beforeLeave":[16],"beforeEnter":[16]}],[0,"ion-route-redirect",{"from":[1],"to":[1]}],[0,"ion-router",{"root":[1],"useHash":[4,"use-hash"],"canTransition":[64],"push":[64],"back":[64],"printDebug":[64],"navChanged":[64]},[[8,"popstate","onPopState"],[4,"ionBackButton","onBackButton"]]],[1,"ion-router-link",{"color":[1],"href":[1],"rel":[1],"routerDirection":[1,"router-direction"],"routerAnimation":[16],"target":[1]}]]],["ion-avatar_3",[[33,"ion-avatar"],[33,"ion-badge",{"color":[1]}],[1,"ion-thumbnail"]]],["ion-col_3",[[1,"ion-col",{"offset":[1],"offsetXs":[1,"offset-xs"],"offsetSm":[1,"offset-sm"],"offsetMd":[1,"offset-md"],"offsetLg":[1,"offset-lg"],"offsetXl":[1,"offset-xl"],"pull":[1],"pullXs":[1,"pull-xs"],"pullSm":[1,"pull-sm"],"pullMd":[1,"pull-md"],"pullLg":[1,"pull-lg"],"pullXl":[1,"pull-xl"],"push":[1],"pushXs":[1,"push-xs"],"pushSm":[1,"push-sm"],"pushMd":[1,"push-md"],"pushLg":[1,"push-lg"],"pushXl":[1,"push-xl"],"size":[1],"sizeXs":[1,"size-xs"],"sizeSm":[1,"size-sm"],"sizeMd":[1,"size-md"],"sizeLg":[1,"size-lg"],"sizeXl":[1,"size-xl"]},[[9,"resize","onResize"]]],[1,"ion-grid",{"fixed":[4]}],[1,"ion-row"]]],["ion-nav_2",[[1,"ion-nav",{"delegate":[16],"swipeGesture":[1028,"swipe-gesture"],"animated":[4],"animation":[16],"rootParams":[16],"root":[1],"push":[64],"insert":[64],"insertPages":[64],"pop":[64],"popTo":[64],"popToRoot":[64],"removeIndex":[64],"setRoot":[64],"setPages":[64],"setRouteId":[64],"getRouteId":[64],"getActive":[64],"getByIndex":[64],"canGoBack":[64],"getPrevious":[64]}],[0,"ion-nav-link",{"component":[1],"componentProps":[16],"routerDirection":[1,"router-direction"],"routerAnimation":[16]}]]],["ion-slide_2",[[0,"ion-slide"],[36,"ion-slides",{"options":[8],"pager":[4],"scrollbar":[4],"update":[64],"updateAutoHeight":[64],"slideTo":[64],"slideNext":[64],"slidePrev":[64],"getActiveIndex":[64],"getPreviousIndex":[64],"length":[64],"isEnd":[64],"isBeginning":[64],"startAutoplay":[64],"stopAutoplay":[64],"lockSwipeToNext":[64],"lockSwipeToPrev":[64],"lockSwipes":[64],"getSwiper":[64]}]]],["ion-tab_2",[[1,"ion-tab",{"active":[1028],"delegate":[16],"tab":[1],"component":[1],"setActive":[64]}],[1,"ion-tabs",{"useRouter":[1028,"use-router"],"selectedTab":[32],"select":[64],"getTab":[64],"getSelected":[64],"setRouteId":[64],"getRouteId":[64]}]]],["ion-checkbox",[[33,"ion-checkbox",{"color":[1],"name":[1],"checked":[1028],"indeterminate":[1028],"disabled":[4],"value":[1]}]]],["ion-img",[[1,"ion-img",{"alt":[1],"src":[1],"loadSrc":[32],"loadError":[32]}]]],["ion-input",[[34,"ion-input",{"fireFocusEvents":[4,"fire-focus-events"],"color":[1],"accept":[1],"autocapitalize":[1],"autocomplete":[1],"autocorrect":[1],"autofocus":[4],"clearInput":[4,"clear-input"],"clearOnEdit":[4,"clear-on-edit"],"debounce":[2],"disabled":[4],"enterkeyhint":[1],"inputmode":[1],"max":[1],"maxlength":[2],"min":[1],"minlength":[2],"multiple":[4],"name":[1],"pattern":[1],"placeholder":[1],"readonly":[4],"required":[4],"spellcheck":[4],"step":[1],"size":[2],"type":[1],"value":[1032],"hasFocus":[32],"setFocus":[64],"setBlur":[64],"getInputElement":[64]}]]],["ion-progress-bar",[[33,"ion-progress-bar",{"type":[1],"reversed":[4],"value":[2],"buffer":[2],"color":[1]}]]],["ion-range",[[33,"ion-range",{"color":[1],"debounce":[2],"name":[1],"dualKnobs":[4,"dual-knobs"],"min":[2],"max":[2],"pin":[4],"snaps":[4],"step":[2],"ticks":[4],"disabled":[4],"value":[1026],"ratioA":[32],"ratioB":[32],"pressedKnob":[32]}]]],["ion-split-pane",[[33,"ion-split-pane",{"contentId":[513,"content-id"],"disabled":[4],"when":[8],"visible":[32]}]]],["ion-text",[[1,"ion-text",{"color":[1]}]]],["ion-textarea",[[34,"ion-textarea",{"fireFocusEvents":[4,"fire-focus-events"],"color":[1],"autocapitalize":[1],"autofocus":[4],"clearOnEdit":[1028,"clear-on-edit"],"debounce":[2],"disabled":[4],"inputmode":[1],"enterkeyhint":[1],"maxlength":[2],"minlength":[2],"name":[1],"placeholder":[1],"readonly":[4],"required":[4],"spellcheck":[4],"cols":[2],"rows":[2],"wrap":[1],"autoGrow":[4,"auto-grow"],"value":[1025],"hasFocus":[32],"setFocus":[64],"setBlur":[64],"getInputElement":[64]}]]],["ion-toggle",[[33,"ion-toggle",{"color":[1],"name":[1],"checked":[1028],"disabled":[4],"value":[1],"activated":[32]}]]],["ion-virtual-scroll",[[0,"ion-virtual-scroll",{"approxItemHeight":[2,"approx-item-height"],"approxHeaderHeight":[2,"approx-header-height"],"approxFooterHeight":[2,"approx-footer-height"],"headerFn":[16],"footerFn":[16],"items":[16],"itemHeight":[16],"headerHeight":[16],"footerHeight":[16],"renderItem":[16],"renderHeader":[16],"renderFooter":[16],"nodeRender":[16],"domRender":[16],"totalHeight":[32],"positionForItem":[64],"checkRange":[64],"checkEnd":[64]},[[9,"resize","onResize"]]]]],["ion-datetime_3",[[34,"ion-picker",{"overlayIndex":[2,"overlay-index"],"keyboardClose":[4,"keyboard-close"],"enterAnimation":[16],"leaveAnimation":[16],"buttons":[16],"columns":[16],"cssClass":[1,"css-class"],"duration":[2],"showBackdrop":[4,"show-backdrop"],"backdropDismiss":[4,"backdrop-dismiss"],"animated":[4],"presented":[32],"present":[64],"dismiss":[64],"onDidDismiss":[64],"onWillDismiss":[64],"getColumn":[64]}],[33,"ion-datetime",{"name":[1],"disabled":[4],"readonly":[4],"min":[1025],"max":[1025],"displayFormat":[1,"display-format"],"displayTimezone":[1,"display-timezone"],"pickerFormat":[1,"picker-format"],"cancelText":[1,"cancel-text"],"doneText":[1,"done-text"],"yearValues":[8,"year-values"],"monthValues":[8,"month-values"],"dayValues":[8,"day-values"],"hourValues":[8,"hour-values"],"minuteValues":[8,"minute-values"],"monthNames":[1,"month-names"],"monthShortNames":[1,"month-short-names"],"dayNames":[1,"day-names"],"dayShortNames":[1,"day-short-names"],"pickerOptions":[16],"placeholder":[1],"value":[1025],"isExpanded":[32],"open":[64]}],[32,"ion-picker-column",{"col":[16]}]]],["ion-radio_2",[[33,"ion-radio",{"color":[1],"name":[1],"disabled":[4],"value":[8],"checked":[32],"buttonTabindex":[32],"setFocus":[64],"setButtonTabindex":[64]}],[0,"ion-radio-group",{"allowEmptySelection":[4,"allow-empty-selection"],"name":[1],"value":[1032]},[[4,"keydown","onKeydown"]]]]],["ion-spinner",[[1,"ion-spinner",{"color":[1],"duration":[2],"name":[1],"paused":[4]}]]],["ion-backdrop",[[33,"ion-backdrop",{"visible":[4],"tappable":[4],"stopPropagation":[4,"stop-propagation"]},[[2,"click","onMouseDown"]]]]],["ion-ripple-effect",[[1,"ion-ripple-effect",{"type":[1],"addRipple":[64]}]]],["ion-button_2",[[33,"ion-button",{"color":[1],"buttonType":[1025,"button-type"],"disabled":[516],"expand":[513],"fill":[1537],"routerDirection":[1,"router-direction"],"routerAnimation":[16],"download":[1],"href":[1],"rel":[1],"shape":[513],"size":[513],"strong":[4],"target":[1],"type":[1]}],[1,"ion-icon",{"mode":[1025],"color":[1],"ariaLabel":[1537,"aria-label"],"ios":[1],"md":[1],"flipRtl":[4,"flip-rtl"],"name":[1],"src":[1],"icon":[8],"size":[1],"lazy":[4],"svgContent":[32],"isVisible":[32]}]]],["ion-item_8",[[33,"ion-item-divider",{"color":[1],"sticky":[4]}],[32,"ion-item-group"],[33,"ion-note",{"color":[1]}],[1,"ion-skeleton-text",{"animated":[4]}],[49,"ion-item",{"color":[1],"button":[4],"detail":[4],"detailIcon":[1,"detail-icon"],"disabled":[4],"download":[1],"href":[1],"rel":[1],"lines":[1],"routerAnimation":[16],"routerDirection":[1,"router-direction"],"target":[1],"type":[1],"multipleInputs":[32]},[[0,"ionColor","labelColorChanged"],[0,"ionStyle","itemStyle"]]],[34,"ion-label",{"color":[1],"position":[1],"noAnimate":[32]}],[32,"ion-list",{"lines":[1],"inset":[4],"closeSlidingItems":[64]}],[33,"ion-list-header",{"color":[1],"lines":[1]}]]]]'),t)));var t})}};var Pt;let Dt=(()=>{let t=Pt=class{static forRoot(t){return{ngModule:Pt,providers:[{provide:it,useValue:t},{provide:i.d,useFactory:Rt,multi:!0,deps:[it,s.d,i.z]}]}}};return t.\u0275mod=i.Fb({type:t}),t.\u0275inj=i.Eb({factory:function(e){return new(e||t)},providers:[at,xt,At],imports:[[s.c]]}),t})()},UXun:function(t,e,n){"use strict";n.d(e,"a",(function(){return h}));var r=n("XNiG"),i=n("qgXg"),o=n("quSY"),s=n("pxpQ"),a=n("9ppp"),u=n("Ylt2");class c extends r.a{constructor(t=Number.POSITIVE_INFINITY,e=Number.POSITIVE_INFINITY,n){super(),this.scheduler=n,this._events=[],this._infiniteTimeWindow=!1,this._bufferSize=t<1?1:t,this._windowTime=e<1?1:e,e===Number.POSITIVE_INFINITY?(this._infiniteTimeWindow=!0,this.next=this.nextInfiniteTimeWindow):this.next=this.nextTimeWindow}nextInfiniteTimeWindow(t){const e=this._events;e.push(t),e.length>this._bufferSize&&e.shift(),super.next(t)}nextTimeWindow(t){this._events.push(new l(this._getNow(),t)),this._trimBufferThenGetEvents(),super.next(t)}_subscribe(t){const e=this._infiniteTimeWindow,n=e?this._events:this._trimBufferThenGetEvents(),r=this.scheduler,i=n.length;let c;if(this.closed)throw new a.a;if(this.isStopped||this.hasError?c=o.a.EMPTY:(this.observers.push(t),c=new u.a(this,t)),r&&t.add(t=new s.a(t,r)),e)for(let o=0;o<i&&!t.closed;o++)t.next(n[o]);else for(let o=0;o<i&&!t.closed;o++)t.next(n[o].value);return this.hasError?t.error(this.thrownError):this.isStopped&&t.complete(),c}_getNow(){return(this.scheduler||i.a).now()}_trimBufferThenGetEvents(){const t=this._getNow(),e=this._bufferSize,n=this._windowTime,r=this._events,i=r.length;let o=0;for(;o<i&&!(t-r[o].time<n);)o++;return i>e&&(o=Math.max(o,i-e)),o>0&&r.splice(0,o),r}}class l{constructor(t,e){this.time=t,this.value=e}}function h(t,e,n){let r;return r=t&&"object"==typeof t?t:{bufferSize:t,windowTime:e,refCount:!1,scheduler:n},t=>t.lift(function({bufferSize:t=Number.POSITIVE_INFINITY,windowTime:e=Number.POSITIVE_INFINITY,refCount:n,scheduler:r}){let i,o,s=0,a=!1,u=!1;return function(l){s++,i&&!a||(a=!1,i=new c(t,e,r),o=l.subscribe({next(t){i.next(t)},error(t){a=!0,i.error(t)},complete(){u=!0,o=void 0,i.complete()}}));const h=i.subscribe(this);this.add(()=>{s--,h.unsubscribe(),o&&!u&&n&&0===s&&(o.unsubscribe(),o=void 0,i=void 0)})}}(r))}},UbJi:function(t,e,n){"use strict";n.d(e,"a",(function(){return T})),n.d(e,"b",(function(){return S})),n.d(e,"c",(function(){return b}));var r=n("fXoL"),i=n("XNiG"),o=n("LRne"),s=n("HDdC"),a=n("Cfvw"),u=n("VRyK"),c=n("pxpQ"),l=n("eIep"),h=n("lJxs"),d=n("UXun"),f=n("SxV6");function p(t,e){return e?Object(l.a)(()=>t,e):Object(l.a)(()=>t)}var g=n("tf+s"),y=n("pLZG"),v=n("spgP"),m=n("ofXK");const b=new r.q("angularfire2.auth.use-emulator"),_=new r.q("angularfire2.auth.settings"),w=new r.q("angularfire2.auth.tenant-id"),E=new r.q("angularfire2.auth.langugage-code"),O=new r.q("angularfire2.auth.use-device-language"),C=new r.q("angularfire.auth.persistence");let T=(()=>{class t{constructor(t,e,r,b,_,w,E,O,C,T){const S=new v.d(b),I=Object(v.h)(S),j=new i.a,x=Object(o.a)(void 0).pipe(Object(c.b)(S.outsideAngular),Object(l.a)(()=>b.runOutsideAngular(()=>n.e(64).then(n.bind(null,"6nsN")))),Object(h.a)(()=>Object(v.g)(t,b,e)),Object(h.a)(t=>b.runOutsideAngular(()=>{const e=_,n=w;return Object(v.f)(t.name+".auth","AngularFireAuth",t,()=>{const r=b.runOutsideAngular(()=>t.auth());return e&&r.useEmulator("http://"+e.join(":")),E&&(r.tenantId=E),r.languageCode=O,C&&r.useDeviceLanguage(),n&&(r.settings=n),T&&r.setPersistence(T),r},[e,E,O,C,n,T])})),Object(d.a)({bufferSize:1,refCount:!1}));if(Object(m.m)(r))this.authState=this.user=this.idToken=this.idTokenResult=this.credential=Object(o.a)(null);else{x.pipe(Object(f.a)()).subscribe();const t=x.pipe(Object(l.a)(t=>t.getRedirectResult().then(t=>t,()=>null)),I,Object(d.a)({bufferSize:1,refCount:!1})),e=t=>new s.a(e=>({unsubscribe:b.runOutsideAngular(()=>t(e))})),n=x.pipe(Object(l.a)(t=>e(t.onAuthStateChanged.bind(t)))),r=x.pipe(Object(l.a)(t=>e(t.onIdTokenChanged.bind(t))));this.authState=t.pipe(p(n),Object(g.a)(S.outsideAngular),Object(c.b)(S.insideAngular)),this.user=t.pipe(p(r),Object(g.a)(S.outsideAngular),Object(c.b)(S.insideAngular)),this.idToken=this.user.pipe(Object(l.a)(t=>t?Object(a.a)(t.getIdToken()):Object(o.a)(null))),this.idTokenResult=this.user.pipe(Object(l.a)(t=>t?Object(a.a)(t.getIdTokenResult()):Object(o.a)(null))),this.credential=Object(u.a)(t,j,this.authState.pipe(Object(y.a)(t=>!t))).pipe(Object(h.a)(t=>(null==t?void 0:t.user)?t:null),Object(g.a)(S.outsideAngular),Object(c.b)(S.insideAngular))}return Object(v.i)(this,x,b,{spy:{apply:(t,e,n)=>{(t.startsWith("signIn")||t.startsWith("createUser"))&&n.then(t=>j.next(t))}}})}}return t.\u0275fac=function(e){return new(e||t)(r.Nb(v.c),r.Nb(v.b,8),r.Nb(r.B),r.Nb(r.z),r.Nb(b,8),r.Nb(_,8),r.Nb(w,8),r.Nb(E,8),r.Nb(O,8),r.Nb(C,8))},t.\u0275prov=Object(r.Db)({factory:function(){return new t(Object(r.Nb)(v.c),Object(r.Nb)(v.b,8),Object(r.Nb)(r.B),Object(r.Nb)(r.z),Object(r.Nb)(b,8),Object(r.Nb)(_,8),Object(r.Nb)(w,8),Object(r.Nb)(E,8),Object(r.Nb)(O,8),Object(r.Nb)(C,8))},token:t,providedIn:"any"}),t})(),S=(()=>{class t{}return t.\u0275mod=r.Fb({type:t}),t.\u0275inj=r.Eb({factory:function(e){return new(e||t)},providers:[T]}),t})()},VRyK:function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var r=n("HDdC"),i=n("z+Ro"),o=n("bHdf"),s=n("yCtX");function a(...t){let e=Number.POSITIVE_INFINITY,n=null,a=t[t.length-1];return Object(i.a)(a)?(n=t.pop(),t.length>1&&"number"==typeof t[t.length-1]&&(e=t.pop())):"number"==typeof a&&(e=t.pop()),null===n&&1===t.length&&t[0]instanceof r.a?t[0]:Object(o.a)(e)(Object(s.a)(t,n))}},WMd4:function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var r=n("EY2u"),i=n("LRne"),o=n("z6cu");let s=(()=>{class t{constructor(t,e,n){this.kind=t,this.value=e,this.error=n,this.hasValue="N"===t}observe(t){switch(this.kind){case"N":return t.next&&t.next(this.value);case"E":return t.error&&t.error(this.error);case"C":return t.complete&&t.complete()}}do(t,e,n){switch(this.kind){case"N":return t&&t(this.value);case"E":return e&&e(this.error);case"C":return n&&n()}}accept(t,e,n){return t&&"function"==typeof t.next?this.observe(t):this.do(t,e,n)}toObservable(){switch(this.kind){case"N":return Object(i.a)(this.value);case"E":return Object(o.a)(this.error);case"C":return Object(r.b)()}throw new Error("unexpected notification kind value")}static createNext(e){return void 0!==e?new t("N",e):t.undefinedValueNotification}static createError(e){return new t("E",void 0,e)}static createComplete(){return t.completeNotification}}return t.completeNotification=new t("C"),t.undefinedValueNotification=new t("N",void 0),t})()},XDbj:function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n("sVev"),i=n("7o/Q");function o(t=u){return e=>e.lift(new s(t))}class s{constructor(t){this.errorFactory=t}call(t,e){return e.subscribe(new a(t,this.errorFactory))}}class a extends i.a{constructor(t,e){super(t),this.errorFactory=e,this.hasValue=!1}_next(t){this.hasValue=!0,this.destination.next(t)}_complete(){if(this.hasValue)return this.destination.complete();{let e;try{e=this.errorFactory()}catch(t){e=t}this.destination.error(e)}}}function u(){return new r.a}},XNiG:function(t,e,n){"use strict";n.d(e,"b",(function(){return c})),n.d(e,"a",(function(){return l}));var r=n("HDdC"),i=n("7o/Q"),o=n("quSY"),s=n("9ppp"),a=n("Ylt2"),u=n("2QA8");class c extends i.a{constructor(t){super(t),this.destination=t}}let l=(()=>{class t extends r.a{constructor(){super(),this.observers=[],this.closed=!1,this.isStopped=!1,this.hasError=!1,this.thrownError=null}[u.a](){return new c(this)}lift(t){const e=new h(this,this);return e.operator=t,e}next(t){if(this.closed)throw new s.a;if(!this.isStopped){const{observers:e}=this,n=e.length,r=e.slice();for(let i=0;i<n;i++)r[i].next(t)}}error(t){if(this.closed)throw new s.a;this.hasError=!0,this.thrownError=t,this.isStopped=!0;const{observers:e}=this,n=e.length,r=e.slice();for(let i=0;i<n;i++)r[i].error(t);this.observers.length=0}complete(){if(this.closed)throw new s.a;this.isStopped=!0;const{observers:t}=this,e=t.length,n=t.slice();for(let r=0;r<e;r++)n[r].complete();this.observers.length=0}unsubscribe(){this.isStopped=!0,this.closed=!0,this.observers=null}_trySubscribe(t){if(this.closed)throw new s.a;return super._trySubscribe(t)}_subscribe(t){if(this.closed)throw new s.a;return this.hasError?(t.error(this.thrownError),o.a.EMPTY):this.isStopped?(t.complete(),o.a.EMPTY):(this.observers.push(t),new a.a(this,t))}asObservable(){const t=new r.a;return t.source=this,t}}return t.create=(t,e)=>new h(t,e),t})();class h extends l{constructor(t,e){super(),this.destination=t,this.source=e}next(t){const{destination:e}=this;e&&e.next&&e.next(t)}error(t){const{destination:e}=this;e&&e.error&&this.destination.error(t)}complete(){const{destination:t}=this;t&&t.complete&&this.destination.complete()}_subscribe(t){const{source:e}=this;return e?this.source.subscribe(t):o.a.EMPTY}}},XoHu:function(t,e,n){"use strict";function r(t){return null!==t&&"object"==typeof t}n.d(e,"a",(function(){return r}))},Ylt2:function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n("quSY");class i extends r.a{constructor(t,e){super(),this.subject=t,this.subscriber=e,this.closed=!1}unsubscribe(){if(this.closed)return;this.closed=!0;const t=this.subject,e=t.observers;if(this.subject=null,!e||0===e.length||t.isStopped||t.closed)return;const n=e.indexOf(this.subscriber);-1!==n&&e.splice(n,1)}}},ZUHj:function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var r=n("51Dv"),i=n("SeVD"),o=n("HDdC");function s(t,e,n,s,a=new r.a(t,n,s)){if(!a.closed)return e instanceof o.a?e.subscribe(a):Object(i.a)(e)(a)}},Zgba:function(t,e,n){"use strict";n.d(e,"a",(function(){return w})),n.d(e,"b",(function(){return _})),n.d(e,"c",(function(){return m})),n.d(e,"d",(function(){return i})),n.d(e,"e",(function(){return o}));var r=n("A36C");const i=t=>s(t),o=(t,e)=>("string"==typeof t&&(e=t,t=void 0),i(t).includes(e)),s=(t=window)=>{if(void 0===t)return[];t.Ionic=t.Ionic||{};let e=t.Ionic.platforms;return null==e&&(e=t.Ionic.platforms=a(t),e.forEach(e=>t.document.documentElement.classList.add("plt-"+e))),e},a=t=>Object.keys(y).filter(e=>y[e](t)),u=t=>!!p(t,/iPad/i)||!(!p(t,/Macintosh/i)||!l(t)),c=t=>p(t,/android|sink/i),l=t=>g(t,"(any-pointer:coarse)"),h=t=>d(t)||f(t),d=t=>!!(t.cordova||t.phonegap||t.PhoneGap),f=t=>{const e=t.Capacitor;return!(!e||!e.isNative)},p=(t,e)=>e.test(t.navigator.userAgent),g=(t,e)=>t.matchMedia(e).matches,y={ipad:u,iphone:t=>p(t,/iPhone/i),ios:t=>p(t,/iPhone|iPod/i)||u(t),android:c,phablet:t=>{const e=t.innerWidth,n=t.innerHeight,r=Math.min(e,n),i=Math.max(e,n);return r>390&&r<520&&i>620&&i<800},tablet:t=>{const e=t.innerWidth,n=t.innerHeight,r=Math.min(e,n),i=Math.max(e,n);return u(t)||(t=>c(t)&&!p(t,/mobile/i))(t)||r>460&&r<820&&i>780&&i<1400},cordova:d,capacitor:f,electron:t=>p(t,/electron/i),pwa:t=>!(!t.matchMedia("(display-mode: standalone)").matches&&!t.navigator.standalone),mobile:l,mobileweb:t=>l(t)&&!h(t),desktop:t=>!l(t),hybrid:h};class v{constructor(){this.m=new Map}reset(t){this.m=new Map(Object.entries(t))}get(t,e){const n=this.m.get(t);return void 0!==n?n:e}getBoolean(t,e=!1){const n=this.m.get(t);return void 0===n?e:"string"==typeof n?"true"===n:!!n}getNumber(t,e){const n=parseFloat(this.m.get(t));return isNaN(n)?void 0!==e?e:NaN:n}set(t,e){this.m.set(t,e)}}const m=new v;let b;const _=t=>t&&Object(r.i)(t)||b,w=()=>{const t=document,e=window,n=e.Ionic=e.Ionic||{};s(e);const i=Object.assign(Object.assign(Object.assign(Object.assign({},(t=>{try{const e=t.sessionStorage.getItem("ionic-persist-config");return null!==e?JSON.parse(e):{}}catch(e){return{}}})(e)),{persistConfig:!1}),n.config),(t=>{const e={};return t.location.search.slice(1).split("&").map(t=>t.split("=")).map(([t,e])=>[decodeURIComponent(t),decodeURIComponent(e)]).filter(([t])=>"ionic:"===t.substr(0,"ionic:".length)).map(([t,e])=>[t.slice("ionic:".length),e]).forEach(([t,n])=>{e[t]=n}),e})(e));m.reset(i),m.getBoolean("persistConfig")&&((t,e)=>{try{t.sessionStorage.setItem("ionic-persist-config",JSON.stringify(e))}catch(n){return}})(e,i),n.config=m,n.mode=b=m.get("mode",t.documentElement.getAttribute("mode")||(o(e,"ios")?"ios":"md")),m.set("mode",b),t.documentElement.setAttribute("mode",b),t.documentElement.classList.add(b),m.getBoolean("_testing")&&m.set("animated",!1);const a=t=>t.tagName&&t.tagName.startsWith("ION-"),u=t=>["ios","md"].includes(t);Object(r.p)(t=>{for(;t;){const e=t.mode||t.getAttribute("mode");if(e){if(u(e))return e;a(t)&&console.warn('Invalid ionic mode: "'+e+'", expected: "ios" or "md"')}t=t.parentElement}return b})}},bC4P:function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));const r=(t,e,n,r,s)=>o(t[1],e[1],n[1],r[1],s).map(o=>i(t[0],e[0],n[0],r[0],o)),i=(t,e,n,r,i)=>i*(3*e*Math.pow(i-1,2)+i*(-3*n*i+3*n+r*i))-t*Math.pow(i-1,3),o=(t,e,n,r,i)=>s((r-=i)-3*(n-=i)+3*(e-=i)-(t-=i),3*n-6*e+3*t,3*e-3*t,t).filter(t=>t>=0&&t<=1),s=(t,e,n,r)=>{if(0===t)return((t,e,n)=>{const r=e*e-4*t*n;return r<0?[]:[(-e+Math.sqrt(r))/(2*t),(-e-Math.sqrt(r))/(2*t)]})(e,n,r);const i=(3*(n/=t)-(e/=t)*e)/3,o=(2*e*e*e-9*e*n+27*(r/=t))/27;if(0===i)return[Math.pow(-o,1/3)];if(0===o)return[Math.sqrt(-i),-Math.sqrt(-i)];const s=Math.pow(o/2,2)+Math.pow(i/3,3);if(0===s)return[Math.pow(o/2,.5)-e/3];if(s>0)return[Math.pow(-o/2+Math.sqrt(s),1/3)-Math.pow(o/2+Math.sqrt(s),1/3)-e/3];const a=Math.sqrt(Math.pow(-i/3,3)),u=Math.acos(-o/(2*Math.sqrt(Math.pow(-i/3,3)))),c=2*Math.pow(a,1/3);return[c*Math.cos(u/3)-e/3,c*Math.cos((u+2*Math.PI)/3)-e/3,c*Math.cos((u+4*Math.PI)/3)-e/3]}},bHdf:function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n("5+tZ"),i=n("SpAZ");function o(t=Number.POSITIVE_INFINITY){return Object(r.a)(i.a,t)}},btv9:function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var r=n("OMvp");let i;const o=t=>{if(void 0===i){const e=void 0!==t.style.webkitAnimationName;i=void 0===t.style.animationName&&e?"-webkit-":""}return i},s=(t,e,n)=>{const r=e.startsWith("animation")?o(t):"";t.style.setProperty(r+e,n)},a=(t,e)=>{const n=e.startsWith("animation")?o(t):"";t.style.removeProperty(n+e)},u=[],c=(t=[],e)=>{if(void 0!==e){const n=Array.isArray(e)?e:[e];return[...t,...n]}return t},l=t=>{let e,n,i,l,h,d,f,p,g,y,v,m,b,_=[],w=[],E=[],O=!1,C={},T=[],S=[],I={},j=0,x=!1,A=!1,k=!0,N=!1,R=!0;const P=t,D=[],L=[],M=[],F=[],U=[],$=[],V=[],q=[],H=[],B=[],z="function"==typeof AnimationEffect||"function"==typeof window.AnimationEffect,W="function"==typeof Element&&"function"==typeof Element.prototype.animate&&z,G=(t,e)=>((e&&e.oneTimeCallback?L:D).push({c:t,o:e}),b),Q=()=>{if(W)B.forEach(t=>{t.cancel()}),B.length=0;else{const t=M.slice();Object(r.n)(()=>{t.forEach(t=>{a(t,"animation-name"),a(t,"animation-duration"),a(t,"animation-timing-function"),a(t,"animation-iteration-count"),a(t,"animation-delay"),a(t,"animation-play-state"),a(t,"animation-fill-mode"),a(t,"animation-direction")})})}},K=()=>{U.forEach(t=>{t&&t.parentNode&&t.parentNode.removeChild(t)}),U.length=0},X=()=>void 0!==h?h:f?f.getFill():"both",Y=()=>void 0!==g?g:void 0!==d?d:f?f.getDirection():"normal",J=()=>x?"linear":void 0!==i?i:f?f.getEasing():"linear",Z=()=>A?0:void 0!==y?y:void 0!==n?n:f?f.getDuration():0,tt=()=>void 0!==l?l:f?f.getIterations():1,et=()=>void 0!==v?v:void 0!==e?e:f?f.getDelay():0,nt=()=>{0!==j&&(j--,0===j&&((()=>{lt(),q.forEach(t=>t()),H.forEach(t=>t());const t=k?1:0,e=T,n=S,r=I;M.forEach(t=>{const i=t.classList;e.forEach(t=>i.add(t)),n.forEach(t=>i.remove(t));for(const e in r)r.hasOwnProperty(e)&&s(t,e,r[e])}),D.forEach(e=>e.c(t,b)),L.forEach(e=>e.c(t,b)),L.length=0,R=!0,k&&(N=!0),k=!0})(),f&&f.animationFinish()))},rt=(e=!0)=>{(()=>{$.forEach(t=>t()),V.forEach(t=>t());const t=w,e=E,n=C;M.forEach(r=>{const i=r.classList;t.forEach(t=>i.add(t)),e.forEach(t=>i.remove(t));for(const t in n)n.hasOwnProperty(t)&&s(r,t,n[t])})})(),_.length>0&&(W?(M.forEach(t=>{const e=t.animate(_,{id:P,delay:et(),duration:Z(),easing:J(),iterations:tt(),fill:X(),direction:Y()});e.pause(),B.push(e)}),B.length>0&&(B[0].onfinish=()=>{nt()})):((e=!0)=>{K();const n=((i=_).forEach(t=>{for(const e in t)if(t.hasOwnProperty(e)){const n=t[e];if("easing"===e)t["animation-timing-function"]=n,delete t[e];else{const r=e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();r!==e&&(t[r]=n,delete t[e])}}}),i);var i;M.forEach(i=>{if(n.length>0){const a=((t=[])=>t.map(t=>{const e=t.offset,n=[];for(const r in t)t.hasOwnProperty(r)&&"offset"!==r&&n.push(`${r}: ${t[r]};`);return`${100*e}% { ${n.join(" ")} }`}).join(" "))(n);m=void 0!==t?t:(t=>{let e=u.indexOf(t);return e<0&&(e=u.push(t)-1),"ion-animation-"+e})(a);const c=((t,e,n)=>{const r=(t=>{const e=t.getRootNode();return e.head||e})(n),i=o(n),s=r.querySelector("#"+t);if(s)return s;const a=(n.ownerDocument||document).createElement("style");return a.id=t,a.textContent=`@${i}keyframes ${t} { ${e} } @${i}keyframes ${t}-alt { ${e} }`,r.appendChild(a),a})(m,a,i);U.push(c),s(i,"animation-duration",Z()+"ms"),s(i,"animation-timing-function",J()),s(i,"animation-delay",et()+"ms"),s(i,"animation-fill-mode",X()),s(i,"animation-direction",Y());const l=tt()===1/0?"infinite":tt().toString();s(i,"animation-iteration-count",l),s(i,"animation-play-state","paused"),e&&s(i,"animation-name",c.id+"-alt"),Object(r.n)(()=>{s(i,"animation-name",c.id||null)})}})})(e)),O=!0},it=t=>{if(t=Math.min(Math.max(t,0),.9999),W)B.forEach(e=>{e.currentTime=e.effect.getComputedTiming().delay+Z()*t,e.pause()});else{const e=`-${Z()*t}ms`;M.forEach(t=>{_.length>0&&(s(t,"animation-delay",e),s(t,"animation-play-state","paused"))})}},ot=t=>{B.forEach(t=>{t.effect.updateTiming({delay:et(),duration:Z(),easing:J(),iterations:tt(),fill:X(),direction:Y()})}),void 0!==t&&it(t)},st=(t=!0,e)=>{Object(r.n)(()=>{M.forEach(n=>{s(n,"animation-name",m||null),s(n,"animation-duration",Z()+"ms"),s(n,"animation-timing-function",J()),s(n,"animation-delay",void 0!==e?`-${e*Z()}ms`:et()+"ms"),s(n,"animation-fill-mode",X()||null),s(n,"animation-direction",Y()||null);const i=tt()===1/0?"infinite":tt().toString();s(n,"animation-iteration-count",i),t&&s(n,"animation-name",m+"-alt"),Object(r.n)(()=>{s(n,"animation-name",m||null)})})})},at=(t=!1,e=!0,n)=>(t&&F.forEach(r=>{r.update(t,e,n)}),W?ot(n):st(e,n),b),ut=()=>{O&&(W?B.forEach(t=>{t.pause()}):M.forEach(t=>{s(t,"animation-play-state","paused")}))},ct=()=>{p=void 0,nt()},lt=()=>{p&&clearTimeout(p)},ht=t=>new Promise(e=>{t&&t.sync&&(A=!0,G(()=>A=!1,{oneTimeCallback:!0})),O||rt(),N&&(W?(it(0),ot()):st(),N=!1),R&&(j=F.length+1,R=!1),G(()=>e(),{oneTimeCallback:!0}),F.forEach(t=>{t.play()}),W?(B.forEach(t=>{t.play()}),0!==_.length&&0!==M.length||nt()):(()=>{if(lt(),Object(r.n)(()=>{M.forEach(t=>{_.length>0&&s(t,"animation-play-state","running")})}),0===_.length||0===M.length)nt();else{const t=et()||0,e=Z()||0,n=tt()||1;isFinite(n)&&(p=setTimeout(ct,t+e*n+100)),((t,e)=>{let n;const i={passive:!0},o=e=>{t===e.target&&(n&&n(),lt(),Object(r.n)(()=>{M.forEach(t=>{a(t,"animation-duration"),a(t,"animation-delay"),a(t,"animation-play-state")}),Object(r.n)(nt)}))};t&&(t.addEventListener("webkitAnimationEnd",o,i),t.addEventListener("animationend",o,i),n=()=>{t.removeEventListener("webkitAnimationEnd",o,i),t.removeEventListener("animationend",o,i)})})(M[0])}})()}),dt=(t,e)=>{const n=_[0];return void 0===n||void 0!==n.offset&&0!==n.offset?_=[{offset:0,[t]:e},..._]:n[t]=e,b};return b={parentAnimation:f,elements:M,childAnimations:F,id:P,animationFinish:nt,from:dt,to:(t,e)=>{const n=_[_.length-1];return void 0===n||void 0!==n.offset&&1!==n.offset?_=[..._,{offset:1,[t]:e}]:n[t]=e,b},fromTo:(t,e,n)=>dt(t,e).to(t,n),parent:t=>(f=t,b),play:ht,pause:()=>(F.forEach(t=>{t.pause()}),ut(),b),stop:()=>{F.forEach(t=>{t.stop()}),O&&(Q(),O=!1),x=!1,A=!1,R=!0,g=void 0,y=void 0,v=void 0,j=0,N=!1,k=!0},destroy:t=>(F.forEach(e=>{e.destroy(t)}),(t=>{Q(),t&&K()})(t),M.length=0,F.length=0,_.length=0,D.length=0,L.length=0,O=!1,R=!0,b),keyframes:t=>(_=t,b),addAnimation:t=>{if(null!=t)if(Array.isArray(t))for(const e of t)e.parent(b),F.push(e);else t.parent(b),F.push(t);return b},addElement:t=>{if(null!=t)if(1===t.nodeType)M.push(t);else if(t.length>=0)for(let e=0;e<t.length;e++)M.push(t[e]);else console.error("Invalid addElement value");return b},update:at,fill:t=>(h=t,at(!0),b),direction:t=>(d=t,at(!0),b),iterations:t=>(l=t,at(!0),b),duration:t=>(W||0!==t||(t=1),n=t,at(!0),b),easing:t=>(i=t,at(!0),b),delay:t=>(e=t,at(!0),b),getWebAnimations:()=>B,getKeyframes:()=>_,getFill:X,getDirection:Y,getDelay:et,getIterations:tt,getEasing:J,getDuration:Z,afterAddRead:t=>(q.push(t),b),afterAddWrite:t=>(H.push(t),b),afterClearStyles:(t=[])=>{for(const e of t)I[e]="";return b},afterStyles:(t={})=>(I=t,b),afterRemoveClass:t=>(S=c(S,t),b),afterAddClass:t=>(T=c(T,t),b),beforeAddRead:t=>($.push(t),b),beforeAddWrite:t=>(V.push(t),b),beforeClearStyles:(t=[])=>{for(const e of t)C[e]="";return b},beforeStyles:(t={})=>(C=t,b),beforeRemoveClass:t=>(E=c(E,t),b),beforeAddClass:t=>(w=c(w,t),b),onFinish:G,progressStart:(t=!1,e)=>(F.forEach(n=>{n.progressStart(t,e)}),ut(),x=t,O?at(!1,!0,e):rt(),b),progressStep:t=>(F.forEach(e=>{e.progressStep(t)}),it(t),b),progressEnd:(t,e,n)=>(x=!1,F.forEach(r=>{r.progressEnd(t,e,n)}),void 0!==n&&(y=n),N=!1,k=!0,0===t?(g="reverse"===Y()?"normal":"reverse","reverse"===g&&(k=!1),W?(at(),it(1-e)):(v=(1-e)*Z()*-1,at(!1,!1))):1===t&&(W?(at(),it(e)):(v=e*Z()*-1,at(!1,!1))),void 0!==t&&(G(()=>{y=void 0,g=void 0,v=void 0},{oneTimeCallback:!0}),f||ht()),b)}}},c2HN:function(t,e,n){"use strict";function r(t){return!!t&&"function"!=typeof t.subscribe&&"function"==typeof t.then}n.d(e,"a",(function(){return r}))},eIep:function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var r=n("l7GE"),i=n("51Dv"),o=n("ZUHj"),s=n("lJxs"),a=n("Cfvw");function u(t,e){return"function"==typeof e?n=>n.pipe(u((n,r)=>Object(a.a)(t(n,r)).pipe(Object(s.a)((t,i)=>e(n,t,r,i))))):e=>e.lift(new c(t))}class c{constructor(t){this.project=t}call(t,e){return e.subscribe(new l(t,this.project))}}class l extends r.a{constructor(t,e){super(t),this.project=e,this.index=0}_next(t){let e;const n=this.index++;try{e=this.project(t,n)}catch(r){return void this.destination.error(r)}this._innerSub(e,t,n)}_innerSub(t,e,n){const r=this.innerSubscription;r&&r.unsubscribe();const s=new i.a(this,e,n),a=this.destination;a.add(s),this.innerSubscription=Object(o.a)(this,t,void 0,void 0,s),this.innerSubscription!==s&&a.add(this.innerSubscription)}_complete(){const{innerSubscription:t}=this;t&&!t.closed||super._complete(),this.unsubscribe()}_unsubscribe(){this.innerSubscription=null}notifyComplete(t){this.destination.remove(t),this.innerSubscription=null,this.isStopped&&super._complete()}notifyNext(t,e,n,r,i){this.destination.next(e)}}},fXoL:function(t,e,n){"use strict";n.d(e,"a",(function(){return co})),n.d(e,"b",(function(){return Ia})),n.d(e,"c",(function(){return Ea})),n.d(e,"d",(function(){return _a})),n.d(e,"e",(function(){return wa})),n.d(e,"f",(function(){return vu})),n.d(e,"g",(function(){return au})),n.d(e,"h",(function(){return zi})),n.d(e,"i",(function(){return Fa})),n.d(e,"j",(function(){return ss})),n.d(e,"k",(function(){return Aa})),n.d(e,"l",(function(){return as})),n.d(e,"m",(function(){return vn})),n.d(e,"n",(function(){return ea})),n.d(e,"o",(function(){return W})),n.d(e,"p",(function(){return l})),n.d(e,"q",(function(){return z})),n.d(e,"r",(function(){return uo})),n.d(e,"s",(function(){return Ss})),n.d(e,"t",(function(){return Is})),n.d(e,"u",(function(){return xa})),n.d(e,"v",(function(){return st})),n.d(e,"w",(function(){return cu})),n.d(e,"x",(function(){return ot})),n.d(e,"y",(function(){return nu})),n.d(e,"z",(function(){return Va})),n.d(e,"A",(function(){return h})),n.d(e,"B",(function(){return Sa})),n.d(e,"C",(function(){return Ta})),n.d(e,"D",(function(){return hs})),n.d(e,"E",(function(){return cs})),n.d(e,"F",(function(){return ls})),n.d(e,"G",(function(){return fs})),n.d(e,"H",(function(){return or})),n.d(e,"I",(function(){return f})),n.d(e,"J",(function(){return du})),n.d(e,"K",(function(){return ks})),n.d(e,"L",(function(){return Ka})),n.d(e,"M",(function(){return Gi})),n.d(e,"N",(function(){return gs})),n.d(e,"O",(function(){return ps})),n.d(e,"P",(function(){return Rs})),n.d(e,"Q",(function(){return gt})),n.d(e,"R",(function(){return ru})),n.d(e,"S",(function(){return Dn})),n.d(e,"T",(function(){return A})),n.d(e,"U",(function(){return Pn})),n.d(e,"V",(function(){return gu})),n.d(e,"W",(function(){return Ja})),n.d(e,"X",(function(){return ja})),n.d(e,"Y",(function(){return Qi})),n.d(e,"Z",(function(){return Ks})),n.d(e,"ab",(function(){return rr})),n.d(e,"bb",(function(){return $n})),n.d(e,"cb",(function(){return Tn})),n.d(e,"db",(function(){return In})),n.d(e,"eb",(function(){return kn})),n.d(e,"fb",(function(){return xn})),n.d(e,"gb",(function(){return jn})),n.d(e,"hb",(function(){return An})),n.d(e,"ib",(function(){return zs})),n.d(e,"jb",(function(){return pu})),n.d(e,"kb",(function(){return Ws})),n.d(e,"lb",(function(){return Gs})),n.d(e,"mb",(function(){return Sn})),n.d(e,"nb",(function(){return M})),n.d(e,"ob",(function(){return po})),n.d(e,"pb",(function(){return Io})),n.d(e,"qb",(function(){return So})),n.d(e,"rb",(function(){return Bs})),n.d(e,"sb",(function(){return zt})),n.d(e,"tb",(function(){return I})),n.d(e,"ub",(function(){return Cn})),n.d(e,"vb",(function(){return zo})),n.d(e,"wb",(function(){return Ut})),n.d(e,"xb",(function(){return rs})),n.d(e,"yb",(function(){return vo})),n.d(e,"zb",(function(){return Mo})),n.d(e,"Ab",(function(){return pa})),n.d(e,"Bb",(function(){return bt})),n.d(e,"Cb",(function(){return St})),n.d(e,"Db",(function(){return v})),n.d(e,"Eb",(function(){return m})),n.d(e,"Fb",(function(){return Ot})),n.d(e,"Gb",(function(){return It})),n.d(e,"Hb",(function(){return mo})),n.d(e,"Ib",(function(){return To})),n.d(e,"Jb",(function(){return Co})),n.d(e,"Kb",(function(){return Oo})),n.d(e,"Lb",(function(){return fn})),n.d(e,"Mb",(function(){return Ho})),n.d(e,"Nb",(function(){return et})),n.d(e,"Ob",(function(){return bo})),n.d(e,"Pb",(function(){return ba})),n.d(e,"Qb",(function(){return _o})),n.d(e,"Rb",(function(){return jo})),n.d(e,"Sb",(function(){return ga})),n.d(e,"Tb",(function(){return Ro})),n.d(e,"Ub",(function(){return No})),n.d(e,"Vb",(function(){return wo})),n.d(e,"Wb",(function(){return da})),n.d(e,"Xb",(function(){return sr})),n.d(e,"Yb",(function(){return Ct})),n.d(e,"Zb",(function(){return qo})),n.d(e,"ac",(function(){return fa}));var r=n("XNiG"),i=n("quSY"),o=n("HDdC"),s=n("VRyK"),a=n("w1tV");function u(t){return{toString:t}.toString()}function c(t,e,n){return u(()=>{const r=function(t){return function(...e){if(t){const n=t(...e);for(const t in n)this[t]=n[t]}}}(e);function i(...t){if(this instanceof i)return r.apply(this,t),this;const e=new i(...t);return n.annotation=e,n;function n(t,n,r){const i=t.hasOwnProperty("__parameters__")?t.__parameters__:Object.defineProperty(t,"__parameters__",{value:[]}).__parameters__;for(;i.length<=r;)i.push(null);return(i[r]=i[r]||[]).push(e),t}}return n&&(i.prototype=Object.create(n.prototype)),i.prototype.ngMetadataName=t,i.annotationCls=i,i})}const l=c("Inject",t=>({token:t})),h=c("Optional"),d=c("Self"),f=c("SkipSelf");var p=function(t){return t[t.Default=0]="Default",t[t.Host=1]="Host",t[t.Self=2]="Self",t[t.SkipSelf=4]="SkipSelf",t[t.Optional=8]="Optional",t}({});function g(t){for(let e in t)if(t[e]===g)return e;throw Error("Could not find renamed property on target object.")}function y(t,e){for(const n in e)e.hasOwnProperty(n)&&!t.hasOwnProperty(n)&&(t[n]=e[n])}function v(t){return{token:t.token,providedIn:t.providedIn||null,factory:t.factory,value:void 0}}function m(t){return{factory:t.factory,providers:t.providers||[],imports:t.imports||[]}}function b(t){return _(t,t[E])||_(t,t[T])}function _(t,e){return e&&e.token===t?e:null}function w(t){return t&&(t.hasOwnProperty(O)||t.hasOwnProperty(S))?t[O]:null}const E=g({\u0275prov:g}),O=g({\u0275inj:g}),C=g({\u0275provFallback:g}),T=g({ngInjectableDef:g}),S=g({ngInjectorDef:g});function I(t){if("string"==typeof t)return t;if(Array.isArray(t))return"["+t.map(I).join(", ")+"]";if(null==t)return""+t;if(t.overriddenName)return""+t.overriddenName;if(t.name)return""+t.name;const e=t.toString();if(null==e)return""+e;const n=e.indexOf("\n");return-1===n?e:e.substring(0,n)}function j(t,e){return null==t||""===t?null===e?"":e:null==e||""===e?t:t+" "+e}const x=g({__forward_ref__:g});function A(t){return t.__forward_ref__=A,t.toString=function(){return I(this())},t}function k(t){return N(t)?t():t}function N(t){return"function"==typeof t&&t.hasOwnProperty(x)&&t.__forward_ref__===A}const R="undefined"!=typeof globalThis&&globalThis,P="undefined"!=typeof window&&window,D="undefined"!=typeof self&&"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&self,L="undefined"!=typeof global&&global,M=R||L||P||D,F=g({\u0275cmp:g}),U=g({\u0275dir:g}),$=g({\u0275pipe:g}),V=g({\u0275mod:g}),q=g({\u0275loc:g}),H=g({\u0275fac:g}),B=g({__NG_ELEMENT_ID__:g});class z{constructor(t,e){this._desc=t,this.ngMetadataName="InjectionToken",this.\u0275prov=void 0,"number"==typeof e?this.__NG_ELEMENT_ID__=e:void 0!==e&&(this.\u0275prov=v({token:this,providedIn:e.providedIn||"root",factory:e.factory}))}toString(){return"InjectionToken "+this._desc}}const W=new z("INJECTOR",-1),G={},Q=/\n/gm,K=g({provide:String,useValue:g});let X,Y=void 0;function J(t){const e=Y;return Y=t,e}function Z(t){const e=X;return X=t,e}function tt(t,e=p.Default){if(void 0===Y)throw new Error("inject() must be called from an injection context");return null===Y?nt(t,void 0,e):Y.get(t,e&p.Optional?null:void 0,e)}function et(t,e=p.Default){return(X||tt)(k(t),e)}function nt(t,e,n){const r=b(t);if(r&&"root"==r.providedIn)return void 0===r.value?r.value=r.factory():r.value;if(n&p.Optional)return null;if(void 0!==e)return e;throw new Error(`Injector: NOT_FOUND [${I(t)}]`)}function rt(t){const e=[];for(let n=0;n<t.length;n++){const r=k(t[n]);if(Array.isArray(r)){if(0===r.length)throw new Error("Arguments array must have arguments.");let t=void 0,n=p.Default;for(let e=0;e<r.length;e++){const i=r[e];i instanceof h||"Optional"===i.ngMetadataName||i===h?n|=p.Optional:i instanceof f||"SkipSelf"===i.ngMetadataName||i===f?n|=p.SkipSelf:i instanceof d||"Self"===i.ngMetadataName||i===d?n|=p.Self:t=i instanceof l||i===l?i.token:i}e.push(et(t,n))}else e.push(et(r))}return e}class it{get(t,e=G){if(e===G){const e=new Error(`NullInjectorError: No provider for ${I(t)}!`);throw e.name="NullInjectorError",e}return e}}class ot{}class st{}function at(t,e){t.forEach(t=>Array.isArray(t)?at(t,e):e(t))}function ut(t,e,n){e>=t.length?t.push(n):t.splice(e,0,n)}function ct(t,e){return e>=t.length-1?t.pop():t.splice(e,1)[0]}function lt(t,e){const n=[];for(let r=0;r<t;r++)n.push(e);return n}function ht(t,e,n){let r=ft(t,e);return r>=0?t[1|r]=n:(r=~r,function(t,e,n,r){let i=t.length;if(i==e)t.push(n,r);else if(1===i)t.push(r,t[0]),t[0]=n;else{for(i--,t.push(t[i-1],t[i]);i>e;)t[i]=t[i-2],i--;t[e]=n,t[e+1]=r}}(t,r,e,n)),r}function dt(t,e){const n=ft(t,e);if(n>=0)return t[1|n]}function ft(t,e){return function(t,e,n){let r=0,i=t.length>>1;for(;i!==r;){const n=r+(i-r>>1),o=t[n<<1];if(e===o)return n<<1;o>e?i=n:r=n+1}return~(i<<1)}(t,e)}var pt=function(t){return t[t.OnPush=0]="OnPush",t[t.Default=1]="Default",t}({}),gt=function(t){return t[t.Emulated=0]="Emulated",t[t.Native=1]="Native",t[t.None=2]="None",t[t.ShadowDom=3]="ShadowDom",t}({});const yt={},vt=[];let mt=0;function bt(t){return u(()=>{const e={},n={type:t.type,providersResolver:null,decls:t.decls,vars:t.vars,factory:null,template:t.template||null,consts:t.consts||null,ngContentSelectors:t.ngContentSelectors,hostBindings:t.hostBindings||null,hostVars:t.hostVars||0,hostAttrs:t.hostAttrs||null,contentQueries:t.contentQueries||null,declaredInputs:e,inputs:null,outputs:null,exportAs:t.exportAs||null,onPush:t.changeDetection===pt.OnPush,directiveDefs:null,pipeDefs:null,selectors:t.selectors||vt,viewQuery:t.viewQuery||null,features:t.features||null,data:t.data||{},encapsulation:t.encapsulation||gt.Emulated,id:"c",styles:t.styles||vt,_:null,setInput:null,schemas:t.schemas||null,tView:null},r=t.directives,i=t.features,o=t.pipes;return n.id+=mt++,n.inputs=Tt(t.inputs,e),n.outputs=Tt(t.outputs),i&&i.forEach(t=>t(n)),n.directiveDefs=r?()=>("function"==typeof r?r():r).map(_t):null,n.pipeDefs=o?()=>("function"==typeof o?o():o).map(wt):null,n})}function _t(t){return jt(t)||function(t){return t[U]||null}(t)}function wt(t){return function(t){return t[$]||null}(t)}const Et={};function Ot(t){const e={type:t.type,bootstrap:t.bootstrap||vt,declarations:t.declarations||vt,imports:t.imports||vt,exports:t.exports||vt,transitiveCompileScopes:null,schemas:t.schemas||null,id:t.id||null};return null!=t.id&&u(()=>{Et[t.id]=t.type}),e}function Ct(t,e){return u(()=>{const n=At(t,!0);n.declarations=e.declarations||vt,n.imports=e.imports||vt,n.exports=e.exports||vt})}function Tt(t,e){if(null==t)return yt;const n={};for(const r in t)if(t.hasOwnProperty(r)){let i=t[r],o=i;Array.isArray(i)&&(o=i[1],i=i[0]),n[i]=r,e&&(e[i]=o)}return n}const St=bt;function It(t){return{type:t.type,name:t.name,factory:null,pure:!1!==t.pure,onDestroy:t.type.prototype.ngOnDestroy||null}}function jt(t){return t[F]||null}function xt(t,e){return t.hasOwnProperty(H)?t[H]:null}function At(t,e){const n=t[V]||null;if(!n&&!0===e)throw new Error(`Type ${I(t)} does not have '\u0275mod' property.`);return n}function kt(t){return Array.isArray(t)&&"object"==typeof t[1]}function Nt(t){return Array.isArray(t)&&!0===t[1]}function Rt(t){return 0!=(8&t.flags)}function Pt(t){return 2==(2&t.flags)}function Dt(t){return 1==(1&t.flags)}function Lt(t){return null!==t.template}function Mt(t){return 0!=(512&t[2])}class Ft{constructor(t,e,n){this.previousValue=t,this.currentValue=e,this.firstChange=n}isFirstChange(){return this.firstChange}}function Ut(){return $t}function $t(t){return t.type.prototype.ngOnChanges&&(t.setInput=qt),Vt}function Vt(){const t=Ht(this),e=null==t?void 0:t.current;if(e){const n=t.previous;if(n===yt)t.previous=e;else for(let t in e)n[t]=e[t];t.current=null,this.ngOnChanges(e)}}function qt(t,e,n,r){const i=Ht(t)||function(t,e){return t.__ngSimpleChanges__=e}(t,{previous:yt,current:null}),o=i.current||(i.current={}),s=i.previous,a=this.declaredInputs[n],u=s[a];o[a]=new Ft(u&&u.currentValue,e,s===yt),t[r]=e}function Ht(t){return t.__ngSimpleChanges__||null}Ut.ngInherit=!0;let Bt=void 0;function zt(t){Bt=t}function Wt(t){return!!t.listen}const Gt={createRenderer:(t,e)=>void 0!==Bt?Bt:"undefined"!=typeof document?document:void 0};function Qt(t){for(;Array.isArray(t);)t=t[0];return t}function Kt(t,e){return Qt(e[t.index])}function Xt(t,e){return t.data[e+20]}function Yt(t,e){const n=e[t];return kt(n)?n:n[0]}function Jt(t){const e=function(t){return t.__ngContext__||null}(t);return e?Array.isArray(e)?e:e.lView:null}function Zt(t){return 4==(4&t[2])}function te(t){return 128==(128&t[2])}function ee(t,e){return null===t||null==e?null:t[e]}function ne(t){t[18]=0}function re(t,e){t[5]+=e;let n=t,r=t[3];for(;null!==r&&(1===e&&1===n[5]||-1===e&&0===n[5]);)r[5]+=e,n=r,r=r[3]}const ie={lFrame:Ee(null),bindingsEnabled:!0,checkNoChangesMode:!1};function oe(){return ie.bindingsEnabled}function se(){return ie.lFrame.lView}function ae(){return ie.lFrame.tView}function ue(){return ie.lFrame.previousOrParentTNode}function ce(t,e){ie.lFrame.previousOrParentTNode=t,ie.lFrame.isParent=e}function le(){return ie.lFrame.isParent}function he(){ie.lFrame.isParent=!1}function de(){return ie.checkNoChangesMode}function fe(t){ie.checkNoChangesMode=t}function pe(){return ie.lFrame.bindingIndex++}function ge(t,e){const n=ie.lFrame;n.bindingIndex=n.bindingRootIndex=t,ye(e)}function ye(t){ie.lFrame.currentDirectiveIndex=t}function ve(){return ie.lFrame.currentQueryIndex}function me(t){ie.lFrame.currentQueryIndex=t}function be(t,e){const n=we();ie.lFrame=n,n.previousOrParentTNode=e,n.lView=t}function _e(t,e){const n=we(),r=t[1];ie.lFrame=n,n.previousOrParentTNode=e,n.lView=t,n.tView=r,n.contextLView=t,n.bindingIndex=r.bindingStartIndex}function we(){const t=ie.lFrame,e=null===t?null:t.child;return null===e?Ee(t):e}function Ee(t){const e={previousOrParentTNode:null,isParent:!0,lView:null,tView:null,selectedIndex:0,contextLView:null,elementDepthCount:0,currentNamespace:null,currentDirectiveIndex:-1,bindingRootIndex:-1,bindingIndex:-1,currentQueryIndex:0,parent:t,child:null};return null!==t&&(t.child=e),e}function Oe(){const t=ie.lFrame;return ie.lFrame=t.parent,t.previousOrParentTNode=null,t.lView=null,t}const Ce=Oe;function Te(){const t=Oe();t.isParent=!0,t.tView=null,t.selectedIndex=0,t.contextLView=null,t.elementDepthCount=0,t.currentDirectiveIndex=-1,t.currentNamespace=null,t.bindingRootIndex=-1,t.bindingIndex=-1,t.currentQueryIndex=0}function Se(){return ie.lFrame.selectedIndex}function Ie(t){ie.lFrame.selectedIndex=t}function je(){const t=ie.lFrame;return Xt(t.tView,t.selectedIndex)}function xe(t,e){for(let n=e.directiveStart,r=e.directiveEnd;n<r;n++){const e=t.data[n].type.prototype,{ngAfterContentInit:r,ngAfterContentChecked:i,ngAfterViewInit:o,ngAfterViewChecked:s,ngOnDestroy:a}=e;r&&(t.contentHooks||(t.contentHooks=[])).push(-n,r),i&&((t.contentHooks||(t.contentHooks=[])).push(n,i),(t.contentCheckHooks||(t.contentCheckHooks=[])).push(n,i)),o&&(t.viewHooks||(t.viewHooks=[])).push(-n,o),s&&((t.viewHooks||(t.viewHooks=[])).push(n,s),(t.viewCheckHooks||(t.viewCheckHooks=[])).push(n,s)),null!=a&&(t.destroyHooks||(t.destroyHooks=[])).push(n,a)}}function Ae(t,e,n){Re(t,e,3,n)}function ke(t,e,n,r){(3&t[2])===n&&Re(t,e,n,r)}function Ne(t,e){let n=t[2];(3&n)===e&&(n&=2047,n+=1,t[2]=n)}function Re(t,e,n,r){const i=null!=r?r:-1;let o=0;for(let s=void 0!==r?65535&t[18]:0;s<e.length;s++)if("number"==typeof e[s+1]){if(o=e[s],null!=r&&o>=r)break}else e[s]<0&&(t[18]+=65536),(o<i||-1==i)&&(Pe(t,n,e,s),t[18]=(4294901760&t[18])+s+2),s++}function Pe(t,e,n,r){const i=n[r]<0,o=n[r+1],s=t[i?-n[r]:n[r]];i?t[2]>>11<t[18]>>16&&(3&t[2])===e&&(t[2]+=2048,o.call(s)):o.call(s)}class De{constructor(t,e,n){this.factory=t,this.resolving=!1,this.canSeeViewProviders=e,this.injectImpl=n}}function Le(t,e,n){const r=Wt(t);let i=0;for(;i<n.length;){const o=n[i];if("number"==typeof o){if(0!==o)break;i++;const s=n[i++],a=n[i++],u=n[i++];r?t.setAttribute(e,a,u,s):e.setAttributeNS(s,a,u)}else{const s=o,a=n[++i];Fe(s)?r&&t.setProperty(e,s,a):r?t.setAttribute(e,s,a):e.setAttribute(s,a),i++}}return i}function Me(t){return 3===t||4===t||6===t}function Fe(t){return 64===t.charCodeAt(0)}function Ue(t,e){if(null===e||0===e.length);else if(null===t||0===t.length)t=e.slice();else{let n=-1;for(let r=0;r<e.length;r++){const i=e[r];"number"==typeof i?n=i:0===n||$e(t,n,i,null,-1===n||2===n?e[++r]:null)}}return t}function $e(t,e,n,r,i){let o=0,s=t.length;if(-1===e)s=-1;else for(;o<t.length;){const n=t[o++];if("number"==typeof n){if(n===e){s=-1;break}if(n>e){s=o-1;break}}}for(;o<t.length;){const e=t[o];if("number"==typeof e)break;if(e===n){if(null===r)return void(null!==i&&(t[o+1]=i));if(r===t[o+1])return void(t[o+2]=i)}o++,null!==r&&o++,null!==i&&o++}-1!==s&&(t.splice(s,0,e),o=s+1),t.splice(o++,0,n),null!==r&&t.splice(o++,0,r),null!==i&&t.splice(o++,0,i)}function Ve(t){return-1!==t}function qe(t){return 32767&t}function He(t){return t>>16}function Be(t,e){let n=He(t),r=e;for(;n>0;)r=r[15],n--;return r}function ze(t){return"string"==typeof t?t:null==t?"":""+t}function We(t){return"function"==typeof t?t.name||t.toString():"object"==typeof t&&null!=t&&"function"==typeof t.type?t.type.name||t.type.toString():ze(t)}const Ge=(()=>("undefined"!=typeof requestAnimationFrame&&requestAnimationFrame||setTimeout).bind(M))();function Qe(t){return t instanceof Function?t():t}let Ke=!0;function Xe(t){const e=Ke;return Ke=t,e}let Ye=0;function Je(t,e){const n=tn(t,e);if(-1!==n)return n;const r=e[1];r.firstCreatePass&&(t.injectorIndex=e.length,Ze(r.data,t),Ze(e,null),Ze(r.blueprint,null));const i=en(t,e),o=t.injectorIndex;if(Ve(i)){const t=qe(i),n=Be(i,e),r=n[1].data;for(let i=0;i<8;i++)e[o+i]=n[t+i]|r[t+i]}return e[o+8]=i,o}function Ze(t,e){t.push(0,0,0,0,0,0,0,0,e)}function tn(t,e){return-1===t.injectorIndex||t.parent&&t.parent.injectorIndex===t.injectorIndex||null==e[t.injectorIndex+8]?-1:t.injectorIndex}function en(t,e){if(t.parent&&-1!==t.parent.injectorIndex)return t.parent.injectorIndex;let n=e[6],r=1;for(;n&&-1===n.injectorIndex;)n=(e=e[15])?e[6]:null,r++;return n?n.injectorIndex|r<<16:-1}function nn(t,e,n){!function(t,e,n){let r;"string"==typeof n?r=n.charCodeAt(0)||0:n.hasOwnProperty(B)&&(r=n[B]),null==r&&(r=n[B]=Ye++);const i=255&r,o=1<<i,s=64&i,a=32&i,u=e.data;128&i?s?a?u[t+7]|=o:u[t+6]|=o:a?u[t+5]|=o:u[t+4]|=o:s?a?u[t+3]|=o:u[t+2]|=o:a?u[t+1]|=o:u[t]|=o}(t,e,n)}function rn(t,e,n,r=p.Default,i){if(null!==t){const i=function(t){if("string"==typeof t)return t.charCodeAt(0)||0;const e=t.hasOwnProperty(B)?t[B]:void 0;return"number"==typeof e&&e>0?255&e:e}(n);if("function"==typeof i){be(e,t);try{const t=i();if(null!=t||r&p.Optional)return t;throw new Error(`No provider for ${We(n)}!`)}finally{Ce()}}else if("number"==typeof i){if(-1===i)return new hn(t,e);let o=null,s=tn(t,e),a=-1,u=r&p.Host?e[16][6]:null;for((-1===s||r&p.SkipSelf)&&(a=-1===s?en(t,e):e[s+8],ln(r,!1)?(o=e[1],s=qe(a),e=Be(a,e)):s=-1);-1!==s;){a=e[s+8];const t=e[1];if(cn(i,s,t.data)){const t=sn(s,e,n,o,r,u);if(t!==on)return t}ln(r,e[1].data[s+8]===u)&&cn(i,s,e)?(o=t,s=qe(a),e=Be(a,e)):s=-1}}}if(r&p.Optional&&void 0===i&&(i=null),0==(r&(p.Self|p.Host))){const t=e[9],o=Z(void 0);try{return t?t.get(n,i,r&p.Optional):nt(n,i,r&p.Optional)}finally{Z(o)}}if(r&p.Optional)return i;throw new Error(`NodeInjector: NOT_FOUND [${We(n)}]`)}const on={};function sn(t,e,n,r,i,o){const s=e[1],a=s.data[t+8],u=an(a,s,n,null==r?Pt(a)&&Ke:r!=s&&3===a.type,i&p.Host&&o===a);return null!==u?un(e,s,u,a):on}function an(t,e,n,r,i){const o=t.providerIndexes,s=e.data,a=1048575&o,u=t.directiveStart,c=o>>20,l=i?a+c:t.directiveEnd;for(let h=r?a:a+c;h<l;h++){const t=s[h];if(h<u&&n===t||h>=u&&t.type===n)return h}if(i){const t=s[u];if(t&&Lt(t)&&t.type===n)return u}return null}function un(t,e,n,r){let i=t[n];const o=e.data;if(i instanceof De){const s=i;if(s.resolving)throw new Error("Circular dep for "+We(o[n]));const a=Xe(s.canSeeViewProviders);let u;s.resolving=!0,s.injectImpl&&(u=Z(s.injectImpl)),be(t,r);try{i=t[n]=s.factory(void 0,o,t,r),e.firstCreatePass&&n>=r.directiveStart&&function(t,e,n){const{ngOnChanges:r,ngOnInit:i,ngDoCheck:o}=e.type.prototype;if(r){const r=$t(e);(n.preOrderHooks||(n.preOrderHooks=[])).push(t,r),(n.preOrderCheckHooks||(n.preOrderCheckHooks=[])).push(t,r)}i&&(n.preOrderHooks||(n.preOrderHooks=[])).push(0-t,i),o&&((n.preOrderHooks||(n.preOrderHooks=[])).push(t,o),(n.preOrderCheckHooks||(n.preOrderCheckHooks=[])).push(t,o))}(n,o[n],e)}finally{s.injectImpl&&Z(u),Xe(a),s.resolving=!1,Ce()}}return i}function cn(t,e,n){const r=64&t,i=32&t;let o;return o=128&t?r?i?n[e+7]:n[e+6]:i?n[e+5]:n[e+4]:r?i?n[e+3]:n[e+2]:i?n[e+1]:n[e],!!(o&1<<t)}function ln(t,e){return!(t&p.Self||t&p.Host&&e)}class hn{constructor(t,e){this._tNode=t,this._lView=e}get(t,e){return rn(this._tNode,this._lView,t,void 0,e)}}function dn(t){const e=t;if(N(t))return()=>{const t=dn(k(e));return t?t():null};let n=xt(e);if(null===n){const t=w(e);n=t&&t.factory}return n||null}function fn(t){return u(()=>{const e=t.prototype.constructor,n=e[H]||dn(e),r=Object.prototype;let i=Object.getPrototypeOf(t.prototype).constructor;for(;i&&i!==r;){const t=i[H]||dn(i);if(t&&t!==n)return t;i=Object.getPrototypeOf(i)}return t=>new t})}function pn(t){return t.ngDebugContext}function gn(t){return t.ngOriginalError}function yn(t,...e){t.error(...e)}class vn{constructor(){this._console=console}handleError(t){const e=this._findOriginalError(t),n=this._findContext(t),r=function(t){return t.ngErrorLogger||yn}(t);r(this._console,"ERROR",t),e&&r(this._console,"ORIGINAL ERROR",e),n&&r(this._console,"ERROR CONTEXT",n)}_findContext(t){return t?pn(t)?pn(t):this._findContext(gn(t)):null}_findOriginalError(t){let e=gn(t);for(;e&&gn(e);)e=gn(e);return e}}class mn{constructor(t){this.changingThisBreaksApplicationSecurity=t}toString(){return"SafeValue must use [property]=binding: "+this.changingThisBreaksApplicationSecurity+" (see http://g.co/ng/security#xss)"}}class bn extends mn{getTypeName(){return"HTML"}}class _n extends mn{getTypeName(){return"Style"}}class wn extends mn{getTypeName(){return"Script"}}class En extends mn{getTypeName(){return"URL"}}class On extends mn{getTypeName(){return"ResourceURL"}}function Cn(t){return t instanceof mn?t.changingThisBreaksApplicationSecurity:t}function Tn(t,e){const n=Sn(t);if(null!=n&&n!==e){if("ResourceURL"===n&&"URL"===e)return!0;throw new Error(`Required a safe ${e}, got a ${n} (see http://g.co/ng/security#xss)`)}return n===e}function Sn(t){return t instanceof mn&&t.getTypeName()||null}function In(t){return new bn(t)}function jn(t){return new _n(t)}function xn(t){return new wn(t)}function An(t){return new En(t)}function kn(t){return new On(t)}let Nn=!0,Rn=!1;function Pn(){return Rn=!0,Nn}function Dn(){if(Rn)throw new Error("Cannot enable prod mode after platform setup.");Nn=!1}class Ln{getInertBodyElement(t){t="<body><remove></remove>"+t;try{const e=(new window.DOMParser).parseFromString(t,"text/html").body;return e.removeChild(e.firstChild),e}catch(e){return null}}}class Mn{constructor(t){if(this.defaultDoc=t,this.inertDocument=this.defaultDoc.implementation.createHTMLDocument("sanitization-inert"),null==this.inertDocument.body){const t=this.inertDocument.createElement("html");this.inertDocument.appendChild(t);const e=this.inertDocument.createElement("body");t.appendChild(e)}}getInertBodyElement(t){const e=this.inertDocument.createElement("template");if("content"in e)return e.innerHTML=t,e;const n=this.inertDocument.createElement("body");return n.innerHTML=t,this.defaultDoc.documentMode&&this.stripCustomNsAttrs(n),n}stripCustomNsAttrs(t){const e=t.attributes;for(let r=e.length-1;0<r;r--){const n=e.item(r).name;"xmlns:ns1"!==n&&0!==n.indexOf("ns1:")||t.removeAttribute(n)}let n=t.firstChild;for(;n;)n.nodeType===Node.ELEMENT_NODE&&this.stripCustomNsAttrs(n),n=n.nextSibling}}const Fn=/^(?:(?:https?|mailto|ftp|tel|file):|[^&:/?#]*(?:[/?#]|$))/gi,Un=/^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+\/]+=*$/i;function $n(t){return(t=String(t)).match(Fn)||t.match(Un)?t:(Pn()&&console.warn(`WARNING: sanitizing unsafe URL value ${t} (see http://g.co/ng/security#xss)`),"unsafe:"+t)}function Vn(t){const e={};for(const n of t.split(","))e[n]=!0;return e}function qn(...t){const e={};for(const n of t)for(const t in n)n.hasOwnProperty(t)&&(e[t]=!0);return e}const Hn=Vn("area,br,col,hr,img,wbr"),Bn=Vn("colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr"),zn=Vn("rp,rt"),Wn=qn(zn,Bn),Gn=qn(Hn,qn(Bn,Vn("address,article,aside,blockquote,caption,center,del,details,dialog,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5,h6,header,hgroup,hr,ins,main,map,menu,nav,ol,pre,section,summary,table,ul")),qn(zn,Vn("a,abbr,acronym,audio,b,bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,picture,q,ruby,rp,rt,s,samp,small,source,span,strike,strong,sub,sup,time,track,tt,u,var,video")),Wn),Qn=Vn("background,cite,href,itemtype,longdesc,poster,src,xlink:href"),Kn=Vn("srcset"),Xn=qn(Qn,Kn,Vn("abbr,accesskey,align,alt,autoplay,axis,bgcolor,border,cellpadding,cellspacing,class,clear,color,cols,colspan,compact,controls,coords,datetime,default,dir,download,face,headers,height,hidden,hreflang,hspace,ismap,itemscope,itemprop,kind,label,lang,language,loop,media,muted,nohref,nowrap,open,preload,rel,rev,role,rows,rowspan,rules,scope,scrolling,shape,size,sizes,span,srclang,start,summary,tabindex,target,title,translate,type,usemap,valign,value,vspace,width"),Vn("aria-activedescendant,aria-atomic,aria-autocomplete,aria-busy,aria-checked,aria-colcount,aria-colindex,aria-colspan,aria-controls,aria-current,aria-describedby,aria-details,aria-disabled,aria-dropeffect,aria-errormessage,aria-expanded,aria-flowto,aria-grabbed,aria-haspopup,aria-hidden,aria-invalid,aria-keyshortcuts,aria-label,aria-labelledby,aria-level,aria-live,aria-modal,aria-multiline,aria-multiselectable,aria-orientation,aria-owns,aria-placeholder,aria-posinset,aria-pressed,aria-readonly,aria-relevant,aria-required,aria-roledescription,aria-rowcount,aria-rowindex,aria-rowspan,aria-selected,aria-setsize,aria-sort,aria-valuemax,aria-valuemin,aria-valuenow,aria-valuetext")),Yn=Vn("script,style,template");class Jn{constructor(){this.sanitizedSomething=!1,this.buf=[]}sanitizeChildren(t){let e=t.firstChild,n=!0;for(;e;)if(e.nodeType===Node.ELEMENT_NODE?n=this.startElement(e):e.nodeType===Node.TEXT_NODE?this.chars(e.nodeValue):this.sanitizedSomething=!0,n&&e.firstChild)e=e.firstChild;else for(;e;){e.nodeType===Node.ELEMENT_NODE&&this.endElement(e);let t=this.checkClobberedElement(e,e.nextSibling);if(t){e=t;break}e=this.checkClobberedElement(e,e.parentNode)}return this.buf.join("")}startElement(t){const e=t.nodeName.toLowerCase();if(!Gn.hasOwnProperty(e))return this.sanitizedSomething=!0,!Yn.hasOwnProperty(e);this.buf.push("<"),this.buf.push(e);const n=t.attributes;for(let i=0;i<n.length;i++){const t=n.item(i),e=t.name,o=e.toLowerCase();if(!Xn.hasOwnProperty(o)){this.sanitizedSomething=!0;continue}let s=t.value;Qn[o]&&(s=$n(s)),Kn[o]&&(r=s,s=(r=String(r)).split(",").map(t=>$n(t.trim())).join(", ")),this.buf.push(" ",e,'="',er(s),'"')}var r;return this.buf.push(">"),!0}endElement(t){const e=t.nodeName.toLowerCase();Gn.hasOwnProperty(e)&&!Hn.hasOwnProperty(e)&&(this.buf.push("</"),this.buf.push(e),this.buf.push(">"))}chars(t){this.buf.push(er(t))}checkClobberedElement(t,e){if(e&&(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_CONTAINED_BY)===Node.DOCUMENT_POSITION_CONTAINED_BY)throw new Error("Failed to sanitize html because the element is clobbered: "+t.outerHTML);return e}}const Zn=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,tr=/([^\#-~ |!])/g;function er(t){return t.replace(/&/g,"&amp;").replace(Zn,(function(t){return"&#"+(1024*(t.charCodeAt(0)-55296)+(t.charCodeAt(1)-56320)+65536)+";"})).replace(tr,(function(t){return"&#"+t.charCodeAt(0)+";"})).replace(/</g,"&lt;").replace(/>/g,"&gt;")}let nr;function rr(t,e){let n=null;try{nr=nr||function(t){return function(){try{return!!(new window.DOMParser).parseFromString("","text/html")}catch(t){return!1}}()?new Ln:new Mn(t)}(t);let r=e?String(e):"";n=nr.getInertBodyElement(r);let i=5,o=r;do{if(0===i)throw new Error("Failed to sanitize html because the input is unstable");i--,r=o,o=n.innerHTML,n=nr.getInertBodyElement(r)}while(r!==o);const s=new Jn,a=s.sanitizeChildren(ir(n)||n);return Pn()&&s.sanitizedSomething&&console.warn("WARNING: sanitizing HTML stripped some content, see http://g.co/ng/security#xss"),a}finally{if(n){const t=ir(n)||n;for(;t.firstChild;)t.removeChild(t.firstChild)}}}function ir(t){return"content"in t&&function(t){return t.nodeType===Node.ELEMENT_NODE&&"TEMPLATE"===t.nodeName}(t)?t.content:null}var or=function(t){return t[t.NONE=0]="NONE",t[t.HTML=1]="HTML",t[t.STYLE=2]="STYLE",t[t.SCRIPT=3]="SCRIPT",t[t.URL=4]="URL",t[t.RESOURCE_URL=5]="RESOURCE_URL",t}({});function sr(t){const e=function(){const t=se();return t&&t[12]}();return e?e.sanitize(or.URL,t)||"":Tn(t,"URL")?Cn(t):$n(ze(t))}function ar(t,e){t.__ngContext__=e}function ur(t){throw new Error("Multiple components match node with tagname "+t.tagName)}function cr(){throw new Error("Cannot mix multi providers and regular providers")}function lr(t,e,n){let r=t.length;for(;;){const i=t.indexOf(e,n);if(-1===i)return i;if(0===i||t.charCodeAt(i-1)<=32){const n=e.length;if(i+n===r||t.charCodeAt(i+n)<=32)return i}n=i+1}}function hr(t,e,n){let r=0;for(;r<t.length;){let i=t[r++];if(n&&"class"===i){if(i=t[r],-1!==lr(i.toLowerCase(),e,0))return!0}else if(1===i){for(;r<t.length&&"string"==typeof(i=t[r++]);)if(i.toLowerCase()===e)return!0;return!1}}return!1}function dr(t){return 0===t.type&&"ng-template"!==t.tagName}function fr(t,e,n){return e===(0!==t.type||n?t.tagName:"ng-template")}function pr(t,e,n){let r=4;const i=t.attrs||[],o=function(t){for(let e=0;e<t.length;e++)if(Me(t[e]))return e;return t.length}(i);let s=!1;for(let a=0;a<e.length;a++){const u=e[a];if("number"!=typeof u){if(!s)if(4&r){if(r=2|1&r,""!==u&&!fr(t,u,n)||""===u&&1===e.length){if(gr(r))return!1;s=!0}}else{const c=8&r?u:e[++a];if(8&r&&null!==t.attrs){if(!hr(t.attrs,c,n)){if(gr(r))return!1;s=!0}continue}const l=yr(8&r?"class":u,i,dr(t),n);if(-1===l){if(gr(r))return!1;s=!0;continue}if(""!==c){let t;t=l>o?"":i[l+1].toLowerCase();const e=8&r?t:null;if(e&&-1!==lr(e,c,0)||2&r&&c!==t){if(gr(r))return!1;s=!0}}}}else{if(!s&&!gr(r)&&!gr(u))return!1;if(s&&gr(u))continue;s=!1,r=u|1&r}}return gr(r)||s}function gr(t){return 0==(1&t)}function yr(t,e,n,r){if(null===e)return-1;let i=0;if(r||!n){let n=!1;for(;i<e.length;){const r=e[i];if(r===t)return i;if(3===r||6===r)n=!0;else{if(1===r||2===r){let t=e[++i];for(;"string"==typeof t;)t=e[++i];continue}if(4===r)break;if(0===r){i+=4;continue}}i+=n?1:2}return-1}return function(t,e){let n=t.indexOf(4);if(n>-1)for(n++;n<t.length;){const r=t[n];if("number"==typeof r)return-1;if(r===e)return n;n++}return-1}(e,t)}function vr(t,e,n=!1){for(let r=0;r<e.length;r++)if(pr(t,e[r],n))return!0;return!1}function mr(t,e){t:for(let n=0;n<e.length;n++){const r=e[n];if(t.length===r.length){for(let e=0;e<t.length;e++)if(t[e]!==r[e])continue t;return!0}}return!1}function br(t,e){return t?":not("+e.trim()+")":e}function _r(t){let e=t[0],n=1,r=2,i="",o=!1;for(;n<t.length;){let s=t[n];if("string"==typeof s)if(2&r){const e=t[++n];i+="["+s+(e.length>0?'="'+e+'"':"")+"]"}else 8&r?i+="."+s:4&r&&(i+=" "+s);else""===i||gr(s)||(e+=br(o,i),i=""),r=s,o=o||!gr(r);n++}return""!==i&&(e+=br(o,i)),e}const wr={};function Er(t){const e=t[3];return Nt(e)?e[3]:e}function Or(t){return Tr(t[13])}function Cr(t){return Tr(t[4])}function Tr(t){for(;null!==t&&!Nt(t);)t=t[4];return t}function Sr(t,e){return t<<17|e<<2}function Ir(t){return t>>17&32767}function jr(t){return 2|t}function xr(t){return(131068&t)>>2}function Ar(t,e){return-131069&t|e<<2}function kr(t){return 1|t}function Nr(t,e){const n=t.contentQueries;if(null!==n)for(let r=0;r<n.length;r+=2){const i=n[r],o=n[r+1];if(-1!==o){const n=t.data[o];me(i),n.contentQueries(2,e[o],o)}}}function Rr(t,e,n){return Wt(e)?e.createElement(t,n):null===n?e.createElement(t):e.createElementNS(n,t)}function Pr(t,e,n,r,i,o,s,a,u,c){const l=e.blueprint.slice();return l[0]=i,l[2]=140|r,ne(l),l[3]=l[15]=t,l[8]=n,l[10]=s||t&&t[10],l[11]=a||t&&t[11],l[12]=u||t&&t[12]||null,l[9]=c||t&&t[9]||null,l[6]=o,l[16]=2==e.type?t[16]:l,l}function Dr(t,e,n,r,i,o){const s=n+20,a=t.data[s]||function(t,e,n,r,i,o){const s=ue(),a=le(),u=a?s:s&&s.parent,c=t.data[n]=Hr(0,u&&u!==e?u:null,r,n,i,o);return null===t.firstChild&&(t.firstChild=c),s&&(!a||null!=s.child||null===c.parent&&2!==s.type?a||(s.next=c):s.child=c),c}(t,e,s,r,i,o);return ce(a,!0),a}function Lr(t,e,n){_e(e,e[6]);try{const r=t.viewQuery;null!==r&&ci(1,r,n);const i=t.template;null!==i&&Ur(t,e,i,1,n),t.firstCreatePass&&(t.firstCreatePass=!1),t.staticContentQueries&&Nr(t,e),t.staticViewQueries&&ci(2,t.viewQuery,n);const o=t.components;null!==o&&function(t,e){for(let n=0;n<e.length;n++)ii(t,e[n])}(e,o)}catch(r){throw t.firstCreatePass&&(t.incompleteFirstPass=!0),r}finally{e[2]&=-5,Te()}}function Mr(t,e,n,r){const i=e[2];if(256==(256&i))return;_e(e,e[6]);const o=de();try{ne(e),ie.lFrame.bindingIndex=t.bindingStartIndex,null!==n&&Ur(t,e,n,2,r);const s=3==(3&i);if(!o)if(s){const n=t.preOrderCheckHooks;null!==n&&Ae(e,n,null)}else{const n=t.preOrderHooks;null!==n&&ke(e,n,0,null),Ne(e,0)}if(function(t){for(let e=Or(t);null!==e;e=Cr(e)){if(!e[2])continue;const t=e[9];for(let e=0;e<t.length;e++){const n=t[e],r=n[3];0==(1024&n[2])&&re(r,1),n[2]|=1024}}}(e),function(t){for(let e=Or(t);null!==e;e=Cr(e))for(let t=10;t<e.length;t++){const n=e[t],r=n[1];te(n)&&Mr(r,n,r.template,n[8])}}(e),null!==t.contentQueries&&Nr(t,e),!o)if(s){const n=t.contentCheckHooks;null!==n&&Ae(e,n)}else{const n=t.contentHooks;null!==n&&ke(e,n,1),Ne(e,1)}!function(t,e){try{const n=t.expandoInstructions;if(null!==n){let r=t.expandoStartIndex,i=-1,o=-1;for(let t=0;t<n.length;t++){const s=n[t];"number"==typeof s?s<=0?(o=0-s,Ie(o),r+=9+n[++t],i=r):r+=s:(null!==s&&(ge(r,i),s(2,e[i])),i++)}}}finally{Ie(-1)}}(t,e);const a=t.components;null!==a&&function(t,e){for(let n=0;n<e.length;n++)ri(t,e[n])}(e,a);const u=t.viewQuery;if(null!==u&&ci(2,u,r),!o)if(s){const n=t.viewCheckHooks;null!==n&&Ae(e,n)}else{const n=t.viewHooks;null!==n&&ke(e,n,2),Ne(e,2)}!0===t.firstUpdatePass&&(t.firstUpdatePass=!1),o||(e[2]&=-73),1024&e[2]&&(e[2]&=-1025,re(e[3],-1))}finally{Te()}}function Fr(t,e,n,r){const i=e[10],o=!de(),s=Zt(e);try{o&&!s&&i.begin&&i.begin(),s&&Lr(t,e,r),Mr(t,e,n,r)}finally{o&&!s&&i.end&&i.end()}}function Ur(t,e,n,r,i){const o=Se();try{Ie(-1),2&r&&e.length>20&&function(t,e,n,r){if(!r)if(3==(3&e[2])){const n=t.preOrderCheckHooks;null!==n&&Ae(e,n,0)}else{const n=t.preOrderHooks;null!==n&&ke(e,n,0,0)}Ie(0)}(t,e,0,de()),n(r,i)}finally{Ie(o)}}function $r(t){const e=t.tView;return null===e||e.incompleteFirstPass?t.tView=Vr(1,-1,t.template,t.decls,t.vars,t.directiveDefs,t.pipeDefs,t.viewQuery,t.schemas,t.consts):e}function Vr(t,e,n,r,i,o,s,a,u,c){const l=20+r,h=l+i,d=function(t,e){const n=[];for(let r=0;r<e;r++)n.push(r<t?null:wr);return n}(l,h);return d[1]={type:t,id:e,blueprint:d,template:n,queries:null,viewQuery:a,node:null,data:d.slice().fill(null,l),bindingStartIndex:l,expandoStartIndex:h,expandoInstructions: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:"function"==typeof o?o():o,pipeRegistry:"function"==typeof s?s():s,firstChild:null,schemas:u,consts:c,incompleteFirstPass:!1}}function qr(t,e,n,r){const i=hi(e);i.push(n),t.firstCreatePass&&function(t){return t.cleanup||(t.cleanup=[])}(t).push(r,i.length-1)}function Hr(t,e,n,r,i,o){return{type:n,index:r,injectorIndex:e?e.injectorIndex:-1,directiveStart:-1,directiveEnd:-1,directiveStylingLast:-1,propertyBindings:null,flags:0,providerIndexes:0,tagName:i,attrs:o,mergedAttrs:null,localNames:null,initialInputs:void 0,inputs:null,outputs:null,tViews:null,next: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}}function Br(t,e,n){for(let r in t)if(t.hasOwnProperty(r)){const i=t[r];(n=null===n?{}:n).hasOwnProperty(r)?n[r].push(e,i):n[r]=[e,i]}return n}function zr(t,e,n,r,i,o,s,a){const u=Kt(e,n);let c,l=e.inputs;!a&&null!=l&&(c=l[r])?(fi(t,n,c,r,i),Pt(e)&&function(t,e){const n=Yt(e,t);16&n[2]||(n[2]|=64)}(n,e.index)):3===e.type&&(r=function(t){return"class"===t?"className":"for"===t?"htmlFor":"formaction"===t?"formAction":"innerHtml"===t?"innerHTML":"readonly"===t?"readOnly":"tabindex"===t?"tabIndex":t}(r),i=null!=s?s(i,e.tagName||"",r):i,Wt(o)?o.setProperty(u,r,i):Fe(r)||(u.setProperty?u.setProperty(r,i):u[r]=i))}function Wr(t,e){const n=t.expandoInstructions;n.push(e.hostBindings),0!==e.hostVars&&n.push(e.hostVars)}function Gr(t,e,n){for(let r=0;r<n;r++)e.push(wr),t.blueprint.push(wr),t.data.push(null)}function Qr(t,e){null!==t.hostBindings&&t.hostBindings(1,e)}function Kr(t,e,n){const r=20-e.index,i=t.data.length-(1048575&e.providerIndexes);(t.expandoInstructions||(t.expandoInstructions=[])).push(r,i,n)}function Xr(t,e){e.flags|=2,(t.components||(t.components=[])).push(e.index)}function Yr(t,e,n){if(n){if(e.exportAs)for(let r=0;r<e.exportAs.length;r++)n[e.exportAs[r]]=t;Lt(e)&&(n[""]=t)}}function Jr(t,e,n){t.flags|=1,t.directiveStart=e,t.directiveEnd=e+n,t.providerIndexes=e}function Zr(t,e,n){t.data.push(n);const r=n.factory||(n.factory=xt(n.type)),i=new De(r,Lt(n),null);t.blueprint.push(i),e.push(i)}function ti(t,e,n){const r=Kt(e,t),i=$r(n),o=t[10],s=oi(t,Pr(t,i,null,n.onPush?64:16,r,e,o,o.createRenderer(r,n)));t[e.index]=s}function ei(t,e,n,r,i,o){const s=o[e];if(null!==s){const t=r.setInput;for(let e=0;e<s.length;){const i=s[e++],o=s[e++],a=s[e++];null!==t?r.setInput(n,a,i,o):n[o]=a}}}function ni(t,e){let n=null,r=0;for(;r<e.length;){const i=e[r];if(0!==i)if(5!==i){if("number"==typeof i)break;t.hasOwnProperty(i)&&(null===n&&(n=[]),n.push(i,t[i],e[r+1])),r+=2}else r+=2;else r+=4}return n}function ri(t,e){const n=Yt(e,t);if(te(n)){const t=n[1];80&n[2]?Mr(t,n,t.template,n[8]):n[5]>0&&function t(e){for(let r=Or(e);null!==r;r=Cr(r))for(let e=10;e<r.length;e++){const n=r[e];if(1024&n[2]){const t=n[1];Mr(t,n,t.template,n[8])}else n[5]>0&&t(n)}const n=e[1].components;if(null!==n)for(let r=0;r<n.length;r++){const i=Yt(n[r],e);te(i)&&i[5]>0&&t(i)}}(n)}}function ii(t,e){const n=Yt(e,t),r=n[1];!function(t,e){for(let n=e.length;n<t.blueprint.length;n++)e.push(t.blueprint[n])}(r,n),Lr(r,n,n[8])}function oi(t,e){return t[13]?t[14][4]=e:t[13]=e,t[14]=e,e}function si(t){for(;t;){t[2]|=64;const e=Er(t);if(Mt(t)&&!e)return t;t=e}return null}function ai(t,e,n){const r=e[10];r.begin&&r.begin();try{Mr(t,e,t.template,n)}catch(i){throw di(e,i),i}finally{r.end&&r.end()}}function ui(t){!function(t){for(let e=0;e<t.components.length;e++){const n=t.components[e],r=Jt(n),i=r[1];Fr(i,r,i.template,n)}}(t[8])}function ci(t,e,n){me(0),e(t,n)}const li=(()=>Promise.resolve(null))();function hi(t){return t[7]||(t[7]=[])}function di(t,e){const n=t[9],r=n?n.get(vn,null):null;r&&r.handleError(e)}function fi(t,e,n,r,i){for(let o=0;o<n.length;){const s=n[o++],a=n[o++],u=e[s],c=t.data[s];null!==c.setInput?c.setInput(u,i,r,a):u[a]=i}}function pi(t,e){const n=e[3];return-1===t.index?Nt(n)?n:null:n}function gi(t,e){const n=pi(t,e);return n?Ii(e[11],n[7]):null}function yi(t,e,n,r,i){if(null!=r){let o,s=!1;Nt(r)?o=r:kt(r)&&(s=!0,r=r[0]);const a=Qt(r);0===t&&null!==n?null==i?Ti(e,n,a):Ci(e,n,a,i||null):1===t&&null!==n?Ci(e,n,a,i||null):2===t?function(t,e,n){const r=Ii(t,e);r&&function(t,e,n,r){Wt(t)?t.removeChild(e,n,r):e.removeChild(n)}(t,r,e,n)}(e,a,s):3===t&&e.destroyNode(a),null!=o&&function(t,e,n,r,i){const o=n[7];o!==Qt(n)&&yi(e,t,r,o,i);for(let s=10;s<n.length;s++){const i=n[s];Ni(i[1],i,t,e,r,o)}}(e,t,o,n,i)}}function vi(t,e,n,r){const i=gi(t.node,e);i&&Ni(t,e,e[11],n?1:2,i,r)}function mi(t,e){const n=t[9],r=n.indexOf(e);1024&e[2]&&re(e[3],-1),n.splice(r,1)}function bi(t,e){if(t.length<=10)return;const n=10+e,r=t[n];if(r){const i=r[17];null!==i&&i!==t&&mi(i,r),e>0&&(t[n-1][4]=r[4]);const o=ct(t,10+e);vi(r[1],r,!1,null);const s=o[19];null!==s&&s.detachView(o[1]),r[3]=null,r[4]=null,r[2]&=-129}return r}function _i(t,e){if(!(256&e[2])){const n=e[11];Wt(n)&&n.destroyNode&&Ni(t,e,n,3,null,null),function(t){let e=t[13];if(!e)return Ei(t[1],t);for(;e;){let n=null;if(kt(e))n=e[13];else{const t=e[10];t&&(n=t)}if(!n){for(;e&&!e[4]&&e!==t;)kt(e)&&Ei(e[1],e),e=wi(e,t);null===e&&(e=t),kt(e)&&Ei(e[1],e),n=e&&e[4]}e=n}}(e)}}function wi(t,e){let n;return kt(t)&&(n=t[6])&&2===n.type?pi(n,t):t[3]===e?null:t[3]}function Ei(t,e){if(!(256&e[2])){e[2]&=-129,e[2]|=256,function(t,e){let n;if(null!=t&&null!=(n=t.destroyHooks))for(let r=0;r<n.length;r+=2){const t=e[n[r]];if(!(t instanceof De)){const e=n[r+1];if(Array.isArray(e))for(let n=0;n<e.length;n+=2)e[n+1].call(t[e[n]]);else e.call(t)}}}(t,e),function(t,e){const n=t.cleanup;if(null!==n){const t=e[7];for(let r=0;r<n.length-1;r+=2)if("string"==typeof n[r]){const i=n[r+1],o="function"==typeof i?i(e):Qt(e[i]),s=t[n[r+2]],a=n[r+3];"boolean"==typeof a?o.removeEventListener(n[r],s,a):a>=0?t[a]():t[-a].unsubscribe(),r+=2}else n[r].call(t[n[r+1]]);e[7]=null}}(t,e);const n=e[6];n&&3===n.type&&Wt(e[11])&&e[11].destroy();const r=e[17];if(null!==r&&Nt(e[3])){r!==e[3]&&mi(r,e);const n=e[19];null!==n&&n.detachView(t)}}}function Oi(t,e,n){let r=e.parent;for(;null!=r&&(4===r.type||5===r.type);)r=(e=r).parent;if(null==r){const t=n[6];return 2===t.type?gi(t,n):n[0]}if(e&&5===e.type&&4&e.flags)return Kt(e,n).parentNode;if(2&r.flags){const e=t.data,n=e[e[r.index].directiveStart].encapsulation;if(n!==gt.ShadowDom&&n!==gt.Native)return null}return Kt(r,n)}function Ci(t,e,n,r){Wt(t)?t.insertBefore(e,n,r):e.insertBefore(n,r,!0)}function Ti(t,e,n){Wt(t)?t.appendChild(e,n):e.appendChild(n)}function Si(t,e,n,r){null!==r?Ci(t,e,n,r):Ti(t,e,n)}function Ii(t,e){return Wt(t)?t.parentNode(e):e.parentNode}function ji(t,e){if(2===t.type){const n=pi(t,e);return null===n?null:Ai(n.indexOf(e,10)-10,n)}return 4===t.type||5===t.type?Kt(t,e):null}function xi(t,e,n,r){const i=Oi(t,r,e);if(null!=i){const t=e[11],o=ji(r.parent||e[6],e);if(Array.isArray(n))for(let e=0;e<n.length;e++)Si(t,i,n[e],o);else Si(t,i,n,o)}}function Ai(t,e){const n=10+t+1;if(n<e.length){const t=e[n],r=t[1].firstChild;if(null!==r)return function t(e,n){if(null!==n){const r=n.type;if(3===r)return Kt(n,e);if(0===r)return Ai(-1,e[n.index]);if(4===r||5===r){const r=n.child;if(null!==r)return t(e,r);{const t=e[n.index];return Nt(t)?Ai(-1,t):Qt(t)}}{const r=e[16],i=r[6],o=Er(r),s=i.projection[n.projection];return null!=s?t(o,s):t(e,n.next)}}return null}(t,r)}return e[7]}function ki(t,e,n,r,i,o,s){for(;null!=n;){const a=r[n.index],u=n.type;s&&0===e&&(a&&ar(Qt(a),r),n.flags|=4),64!=(64&n.flags)&&(4===u||5===u?(ki(t,e,n.child,r,i,o,!1),yi(e,t,i,a,o)):1===u?Ri(t,e,r,n,i,o):yi(e,t,i,a,o)),n=s?n.projectionNext:n.next}}function Ni(t,e,n,r,i,o){ki(n,r,t.node.child,e,i,o,!1)}function Ri(t,e,n,r,i,o){const s=n[16],a=s[6].projection[r.projection];if(Array.isArray(a))for(let u=0;u<a.length;u++)yi(e,t,i,a[u],o);else ki(t,e,a,s[3],i,o,!0)}function Pi(t,e,n){Wt(t)?t.setAttribute(e,"style",n):e.style.cssText=n}function Di(t,e,n){Wt(t)?""===n?t.removeAttribute(e,"class"):t.setAttribute(e,"class",n):e.className=n}class Li{constructor(t,e){this._lView=t,this._cdRefInjectingView=e,this._appRef=null,this._viewContainerRef=null}get rootNodes(){const t=this._lView;return null==t[0]?function t(e,n,r,i,o=!1){for(;null!==r;){const s=n[r.index];if(null!==s&&i.push(Qt(s)),Nt(s))for(let e=10;e<s.length;e++){const n=s[e],r=n[1].firstChild;null!==r&&t(n[1],n,r,i)}const a=r.type;if(4===a||5===a)t(e,n,r.child,i);else if(1===a){const e=n[16],o=e[6].projection[r.projection];if(Array.isArray(o))i.push(...o);else{const n=Er(e);t(n[1],n,o,i,!0)}}r=o?r.projectionNext:r.next}return i}(t[1],t,t[6].child,[]):[]}get context(){return this._lView[8]}get destroyed(){return 256==(256&this._lView[2])}destroy(){if(this._appRef)this._appRef.detachView(this);else if(this._viewContainerRef){const t=this._viewContainerRef.indexOf(this);t>-1&&this._viewContainerRef.detach(t),this._viewContainerRef=null}_i(this._lView[1],this._lView)}onDestroy(t){qr(this._lView[1],this._lView,null,t)}markForCheck(){si(this._cdRefInjectingView||this._lView)}detach(){this._lView[2]&=-129}reattach(){this._lView[2]|=128}detectChanges(){ai(this._lView[1],this._lView,this.context)}checkNoChanges(){!function(t,e,n){fe(!0);try{ai(t,e,n)}finally{fe(!1)}}(this._lView[1],this._lView,this.context)}attachToViewContainerRef(t){if(this._appRef)throw new Error("This view is already attached directly to the ApplicationRef!");this._viewContainerRef=t}detachFromAppRef(){var t;this._appRef=null,Ni(this._lView[1],t=this._lView,t[11],2,null,null)}attachToAppRef(t){if(this._viewContainerRef)throw new Error("This view is already attached to a ViewContainer!");this._appRef=t}}class Mi extends Li{constructor(t){super(t),this._view=t}detectChanges(){ui(this._view)}checkNoChanges(){!function(t){fe(!0);try{ui(t)}finally{fe(!1)}}(this._view)}get context(){return null}}let Fi,Ui,$i;function Vi(t,e,n){return Fi||(Fi=class extends t{}),new Fi(Kt(e,n))}function qi(t,e,n,r){return Ui||(Ui=class extends t{constructor(t,e,n){super(),this._declarationView=t,this._declarationTContainer=e,this.elementRef=n}createEmbeddedView(t){const e=this._declarationTContainer.tViews,n=Pr(this._declarationView,e,t,16,null,e.node);n[17]=this._declarationView[this._declarationTContainer.index];const r=this._declarationView[19];return null!==r&&(n[19]=r.createEmbeddedView(e)),Lr(e,n,t),new Li(n)}}),0===n.type?new Ui(r,n,Vi(e,n,r)):null}function Hi(t,e,n,r){let i;$i||($i=class extends t{constructor(t,e,n){super(),this._lContainer=t,this._hostTNode=e,this._hostView=n}get element(){return Vi(e,this._hostTNode,this._hostView)}get injector(){return new hn(this._hostTNode,this._hostView)}get parentInjector(){const t=en(this._hostTNode,this._hostView),e=Be(t,this._hostView),n=function(t,e,n){if(n.parent&&-1!==n.parent.injectorIndex){const t=n.parent.injectorIndex;let e=n.parent;for(;null!=e.parent&&t==e.parent.injectorIndex;)e=e.parent;return e}let r=He(t),i=e,o=e[6];for(;r>1;)i=i[15],o=i[6],r--;return o}(t,this._hostView,this._hostTNode);return Ve(t)&&null!=n?new hn(n,e):new hn(null,this._hostView)}clear(){for(;this.length>0;)this.remove(this.length-1)}get(t){return null!==this._lContainer[8]&&this._lContainer[8][t]||null}get length(){return this._lContainer.length-10}createEmbeddedView(t,e,n){const r=t.createEmbeddedView(e||{});return this.insert(r,n),r}createComponent(t,e,n,r,i){const o=n||this.parentInjector;if(!i&&null==t.ngModule&&o){const t=o.get(ot,null);t&&(i=t)}const s=t.create(o,r,void 0,i);return this.insert(s.hostView,e),s}insert(t,e){const n=t._lView,r=n[1];if(t.destroyed)throw new Error("Cannot insert a destroyed View in a ViewContainer!");if(this.allocateContainerIfNeeded(),Nt(n[3])){const e=this.indexOf(t);if(-1!==e)this.detach(e);else{const e=n[3],r=new $i(e,e[6],e[3]);r.detach(r.indexOf(t))}}const i=this._adjustIndex(e);return function(t,e,n,r){const i=10+r,o=n.length;r>0&&(n[i-1][4]=e),r<o-10?(e[4]=n[i],ut(n,10+r,e)):(n.push(e),e[4]=null),e[3]=n;const s=e[17];null!==s&&n!==s&&function(t,e){const n=t[9];e[16]!==e[3][3][16]&&(t[2]=!0),null===n?t[9]=[e]:n.push(e)}(s,e);const a=e[19];null!==a&&a.insertView(t),e[2]|=128}(r,n,this._lContainer,i),vi(r,n,!0,Ai(i,this._lContainer)),t.attachToViewContainerRef(this),ut(this._lContainer[8],i,t),t}move(t,e){if(t.destroyed)throw new Error("Cannot move a destroyed View in a ViewContainer!");return this.insert(t,e)}indexOf(t){const e=this._lContainer[8];return null!==e?e.indexOf(t):-1}remove(t){this.allocateContainerIfNeeded();const e=this._adjustIndex(t,-1),n=bi(this._lContainer,e);n&&(ct(this._lContainer[8],e),_i(n[1],n))}detach(t){this.allocateContainerIfNeeded();const e=this._adjustIndex(t,-1),n=bi(this._lContainer,e);return n&&null!=ct(this._lContainer[8],e)?new Li(n):null}_adjustIndex(t,e=0){return null==t?this.length+e:t}allocateContainerIfNeeded(){null===this._lContainer[8]&&(this._lContainer[8]=[])}});const o=r[n.index];if(Nt(o))i=o;else{let t;if(4===n.type)t=Qt(o);else if(t=r[11].createComment(""),Mt(r)){const e=r[11],i=Kt(n,r);Ci(e,Ii(e,i),t,function(t,e){return Wt(t)?t.nextSibling(e):e.nextSibling}(e,i))}else xi(r[1],r,t,n);r[n.index]=i=new Array(o,!0,!1,r,null,0,n,t,null,null),oi(r,i)}return new $i(i,n,r)}function Bi(t=!1){return function(t,e,n){if(!n&&Pt(t)){const n=Yt(t.index,e);return new Li(n,n)}return 3===t.type||0===t.type||4===t.type||5===t.type?new Li(e[16],e):null}(ue(),se(),t)}let zi=(()=>{class t{}return t.__NG_ELEMENT_ID__=()=>Wi(),t})();const Wi=Bi,Gi=Function,Qi=new z("Set Injector scope."),Ki={},Xi={},Yi=[];let Ji=void 0;function Zi(){return void 0===Ji&&(Ji=new it),Ji}function to(t,e=null,n=null,r){return new eo(t,n,e||Zi(),r)}class eo{constructor(t,e,n,r=null){this.parent=n,this.records=new Map,this.injectorDefTypes=new Set,this.onDestroy=new Set,this._destroyed=!1;const i=[];e&&at(e,n=>this.processProvider(n,t,e)),at([t],t=>this.processInjectorType(t,[],i)),this.records.set(W,io(void 0,this));const o=this.records.get(Qi);this.scope=null!=o?o.value:null,this.source=r||("object"==typeof t?null:I(t))}get destroyed(){return this._destroyed}destroy(){this.assertNotDestroyed(),this._destroyed=!0;try{this.onDestroy.forEach(t=>t.ngOnDestroy())}finally{this.records.clear(),this.onDestroy.clear(),this.injectorDefTypes.clear()}}get(t,e=G,n=p.Default){this.assertNotDestroyed();const r=J(this);try{if(!(n&p.SkipSelf)){let e=this.records.get(t);if(void 0===e){const n=("function"==typeof(i=t)||"object"==typeof i&&i instanceof z)&&b(t);e=n&&this.injectableDefInScope(n)?io(no(t),Ki):null,this.records.set(t,e)}if(null!=e)return this.hydrate(t,e)}return(n&p.Self?Zi():this.parent).get(t,e=n&p.Optional&&e===G?null:e)}catch(o){if("NullInjectorError"===o.name){if((o.ngTempTokenPath=o.ngTempTokenPath||[]).unshift(I(t)),r)throw o;return function(t,e,n,r){const i=t.ngTempTokenPath;throw e.__source&&i.unshift(e.__source),t.message=function(t,e,n,r=null){t=t&&"\n"===t.charAt(0)&&"\u0275"==t.charAt(1)?t.substr(2):t;let i=I(e);if(Array.isArray(e))i=e.map(I).join(" -> ");else if("object"==typeof e){let t=[];for(let n in e)if(e.hasOwnProperty(n)){let r=e[n];t.push(n+":"+("string"==typeof r?JSON.stringify(r):I(r)))}i=`{${t.join(", ")}}`}return`${n}${r?"("+r+")":""}[${i}]: ${t.replace(Q,"\n  ")}`}("\n"+t.message,i,n,r),t.ngTokenPath=i,t.ngTempTokenPath=null,t}(o,t,"R3InjectorError",this.source)}throw o}finally{J(r)}var i}_resolveInjectorDefTypes(){this.injectorDefTypes.forEach(t=>this.get(t))}toString(){const t=[];return this.records.forEach((e,n)=>t.push(I(n))),`R3Injector[${t.join(", ")}]`}assertNotDestroyed(){if(this._destroyed)throw new Error("Injector has already been destroyed.")}processInjectorType(t,e,n){if(!(t=k(t)))return!1;let r=w(t);const i=null==r&&t.ngModule||void 0,o=void 0===i?t:i,s=-1!==n.indexOf(o);if(void 0!==i&&(r=w(i)),null==r)return!1;if(null!=r.imports&&!s){let t;n.push(o);try{at(r.imports,r=>{this.processInjectorType(r,e,n)&&(void 0===t&&(t=[]),t.push(r))})}finally{}if(void 0!==t)for(let e=0;e<t.length;e++){const{ngModule:n,providers:r}=t[e];at(r,t=>this.processProvider(t,n,r||Yi))}}this.injectorDefTypes.add(o),this.records.set(o,io(r.factory,Ki));const a=r.providers;if(null!=a&&!s){const e=t;at(a,t=>this.processProvider(t,e,a))}return void 0!==i&&void 0!==t.providers}processProvider(t,e,n){let r=so(t=k(t))?t:k(t&&t.provide);const i=function(t,e,n){return oo(t)?io(void 0,t.useValue):io(ro(t,e,n),Ki)}(t,e,n);if(so(t)||!0!==t.multi){const t=this.records.get(r);t&&void 0!==t.multi&&cr()}else{let e=this.records.get(r);e?void 0===e.multi&&cr():(e=io(void 0,Ki,!0),e.factory=()=>rt(e.multi),this.records.set(r,e)),r=t,e.multi.push(t)}this.records.set(r,i)}hydrate(t,e){var n;return e.value===Xi?function(t){throw new Error("Cannot instantiate cyclic dependency! "+t)}(I(t)):e.value===Ki&&(e.value=Xi,e.value=e.factory()),"object"==typeof e.value&&e.value&&null!==(n=e.value)&&"object"==typeof n&&"function"==typeof n.ngOnDestroy&&this.onDestroy.add(e.value),e.value}injectableDefInScope(t){return!!t.providedIn&&("string"==typeof t.providedIn?"any"===t.providedIn||t.providedIn===this.scope:this.injectorDefTypes.has(t.providedIn))}}function no(t){const e=b(t),n=null!==e?e.factory:xt(t);if(null!==n)return n;const r=w(t);if(null!==r)return r.factory;if(t instanceof z)throw new Error(`Token ${I(t)} is missing a \u0275prov definition.`);if(t instanceof Function)return function(t){const e=t.length;if(e>0){const n=lt(e,"?");throw new Error(`Can't resolve all parameters for ${I(t)}: (${n.join(", ")}).`)}const n=function(t){const e=t&&(t[E]||t[T]||t[C]&&t[C]());if(e){const n=function(t){if(t.hasOwnProperty("name"))return t.name;const e=(""+t).match(/^function\s*([^\s(]+)/);return null===e?"":e[1]}(t);return console.warn(`DEPRECATED: DI is instantiating a token "${n}" that inherits its @Injectable decorator but does not provide one itself.\nThis will become an error in a future version of Angular. Please add @Injectable() to the "${n}" class.`),e}return null}(t);return null!==n?()=>n.factory(t):()=>new t}(t);throw new Error("unreachable")}function ro(t,e,n){let r=void 0;if(so(t)){const e=k(t);return xt(e)||no(e)}if(oo(t))r=()=>k(t.useValue);else if((i=t)&&i.useFactory)r=()=>t.useFactory(...rt(t.deps||[]));else if(function(t){return!(!t||!t.useExisting)}(t))r=()=>et(k(t.useExisting));else{const i=k(t&&(t.useClass||t.provide));if(i||function(t,e,n){let r="";throw t&&e&&(r=` - only instances of Provider and Type are allowed, got: [${e.map(t=>t==n?"?"+n+"?":"...").join(", ")}]`),new Error(`Invalid provider for the NgModule '${I(t)}'`+r)}(e,n,t),!function(t){return!!t.deps}(t))return xt(i)||no(i);r=()=>new i(...rt(t.deps))}var i;return r}function io(t,e,n=!1){return{factory:t,value:e,multi:n?[]:void 0}}function oo(t){return null!==t&&"object"==typeof t&&K in t}function so(t){return"function"==typeof t}const ao=function(t,e,n){return function(t,e=null,n=null,r){const i=to(t,e,n,r);return i._resolveInjectorDefTypes(),i}({name:n},e,t,n)};let uo=(()=>{class t{static create(t,e){return Array.isArray(t)?ao(t,e,""):ao(t.providers,t.parent,t.name||"")}}return t.THROW_IF_NOT_FOUND=G,t.NULL=new it,t.\u0275prov=v({token:t,providedIn:"any",factory:()=>et(W)}),t.__NG_ELEMENT_ID__=-1,t})();const co=new z("AnalyzeForEntryComponents");function lo(t,e,n){let r=n?t.styles:null,i=n?t.classes:null,o=0;if(null!==e)for(let s=0;s<e.length;s++){const t=e[s];"number"==typeof t?o=t:1==o?i=j(i,t):2==o&&(r=j(r,t+": "+e[++s]+";"))}n?t.styles=r:t.stylesWithoutHost=r,n?t.classes=i:t.classesWithoutHost=i}let ho=null;function fo(){if(!ho){const t=M.Symbol;if(t&&t.iterator)ho=t.iterator;else{const t=Object.getOwnPropertyNames(Map.prototype);for(let e=0;e<t.length;++e){const n=t[e];"entries"!==n&&"size"!==n&&Map.prototype[n]===Map.prototype.entries&&(ho=n)}}}return ho}function po(t){return!!go(t)&&(Array.isArray(t)||!(t instanceof Map)&&fo()in t)}function go(t){return null!==t&&("function"==typeof t||"object"==typeof t)}function yo(t,e,n){return!Object.is(t[e],n)&&(t[e]=n,!0)}function vo(t,e,n,r){const i=se();return yo(i,pe(),e)&&(ae(),function(t,e,n,r,i,o){const s=Kt(t,e),a=e[11];if(null==r)Wt(a)?a.removeAttribute(s,n,o):s.removeAttribute(n);else{const e=null==i?ze(r):i(r,t.tagName||"",n);Wt(a)?a.setAttribute(s,n,e,o):o?s.setAttributeNS(o,n,e):s.setAttribute(n,e)}}(je(),i,t,e,n,r)),vo}function mo(t,e=p.Default){const n=se();return null==n?et(t,e):rn(ue(),n,k(t),e)}function bo(t){return function(t,e){if("class"===e)return t.classes;if("style"===e)return t.styles;const n=t.attrs;if(n){const t=n.length;let r=0;for(;r<t;){const i=n[r];if(Me(i))break;if(0===i)r+=2;else if("number"==typeof i)for(r++;r<t&&"string"==typeof n[r];)r++;else{if(i===e)return n[r+1];r+=2}}}return null}(ue(),t)}function _o(){throw new Error("invalid")}function wo(t,e,n){const r=se();return yo(r,pe(),e)&&zr(ae(),je(),r,t,e,r[11],n,!1),wo}function Eo(t,e,n,r,i){const o=i?"class":"style";fi(t,n,e.inputs[o],o,r)}function Oo(t,e,n,r){const i=se(),o=ae(),s=20+t,a=i[11],u=i[s]=Rr(e,a,ie.lFrame.currentNamespace),c=o.firstCreatePass?function(t,e,n,r,i,o,s){const a=e.consts,u=ee(a,o),c=Dr(e,n[6],t,3,i,u);return function(t,e,n,r){let i=!1;if(oe()){const o=function(t,e,n){const r=t.directiveRegistry;let i=null;if(r)for(let o=0;o<r.length;o++){const s=r[o];vr(n,s.selectors,!1)&&(i||(i=[]),nn(Je(n,e),t,s.type),Lt(s)?(2&n.flags&&ur(n),Xr(t,n),i.unshift(s)):i.push(s))}return i}(t,e,n),s=null===r?null:{"":-1};if(null!==o){let r=0;i=!0,Jr(n,t.data.length,o.length);for(let t=0;t<o.length;t++){const e=o[t];e.providersResolver&&e.providersResolver(e)}Kr(t,n,o.length);let a=!1,u=!1;for(let i=0;i<o.length;i++){const c=o[i];n.mergedAttrs=Ue(n.mergedAttrs,c.hostAttrs),Zr(t,e,c),Yr(t.data.length-1,c,s),null!==c.contentQueries&&(n.flags|=8),null===c.hostBindings&&null===c.hostAttrs&&0===c.hostVars||(n.flags|=128);const l=c.type.prototype;!a&&(l.ngOnChanges||l.ngOnInit||l.ngDoCheck)&&((t.preOrderHooks||(t.preOrderHooks=[])).push(n.index-20),a=!0),u||!l.ngOnChanges&&!l.ngDoCheck||((t.preOrderCheckHooks||(t.preOrderCheckHooks=[])).push(n.index-20),u=!0),Wr(t,c),r+=c.hostVars}!function(t,e){const n=e.directiveEnd,r=t.data,i=e.attrs,o=[];let s=null,a=null;for(let u=e.directiveStart;u<n;u++){const t=r[u],n=t.inputs,c=null===i||dr(e)?null:ni(n,i);o.push(c),s=Br(n,u,s),a=Br(t.outputs,u,a)}null!==s&&(s.hasOwnProperty("class")&&(e.flags|=16),s.hasOwnProperty("style")&&(e.flags|=32)),e.initialInputs=o,e.inputs=s,e.outputs=a}(t,n),Gr(t,e,r)}s&&function(t,e,n){if(e){const r=t.localNames=[];for(let t=0;t<e.length;t+=2){const i=n[e[t+1]];if(null==i)throw new Error(`Export of name '${e[t+1]}' not found!`);r.push(e[t],i)}}}(n,r,s)}n.mergedAttrs=Ue(n.mergedAttrs,n.attrs)}(e,n,c,ee(a,s)),null!==c.attrs&&lo(c,c.attrs,!1),null!==c.mergedAttrs&&lo(c,c.mergedAttrs,!0),null!==e.queries&&e.queries.elementStart(e,c),c}(t,o,i,0,e,n,r):o.data[s];ce(c,!0);const l=c.mergedAttrs;null!==l&&Le(a,u,l);const h=c.classes;null!==h&&Di(a,u,h);const d=c.styles;null!==d&&Pi(a,u,d),xi(o,i,u,c),0===ie.lFrame.elementDepthCount&&ar(u,i),ie.lFrame.elementDepthCount++,Dt(c)&&(function(t,e,n){oe()&&(function(t,e,n,r){const i=n.directiveStart,o=n.directiveEnd;t.firstCreatePass||Je(n,e),ar(r,e);const s=n.initialInputs;for(let a=i;a<o;a++){const r=t.data[a],o=Lt(r);o&&ti(e,n,r);const u=un(e,t,a,n);ar(u,e),null!==s&&ei(0,a-i,u,r,0,s),o&&(Yt(n.index,e)[8]=u)}}(t,e,n,Kt(n,e)),128==(128&n.flags)&&function(t,e,n){const r=n.directiveStart,i=n.directiveEnd,o=t.expandoInstructions,s=t.firstCreatePass,a=n.index-20,u=ie.lFrame.currentDirectiveIndex;try{Ie(a);for(let n=r;n<i;n++){const r=t.data[n],i=e[n];ye(n),null!==r.hostBindings||0!==r.hostVars||null!==r.hostAttrs?Qr(r,i):s&&o.push(null)}}finally{Ie(-1),ye(u)}}(t,e,n))}(o,i,c),function(t,e,n){if(Rt(e)){const r=e.directiveEnd;for(let i=e.directiveStart;i<r;i++){const e=t.data[i];e.contentQueries&&e.contentQueries(1,n[i],i)}}}(o,c,i)),null!==r&&function(t,e,n=Kt){const r=e.localNames;if(null!==r){let i=e.index+1;for(let o=0;o<r.length;o+=2){const s=r[o+1],a=-1===s?n(e,t):t[s];t[i++]=a}}}(i,c)}function Co(){let t=ue();le()?he():(t=t.parent,ce(t,!1));const e=t;ie.lFrame.elementDepthCount--;const n=ae();n.firstCreatePass&&(xe(n,t),Rt(t)&&n.queries.elementEnd(t)),null!=e.classesWithoutHost&&function(t){return 0!=(16&t.flags)}(e)&&Eo(n,e,se(),e.classesWithoutHost,!0),null!=e.stylesWithoutHost&&function(t){return 0!=(32&t.flags)}(e)&&Eo(n,e,se(),e.stylesWithoutHost,!1)}function To(t,e,n,r){Oo(t,e,n,r),Co()}function So(t){return!!t&&"function"==typeof t.then}function Io(t){return!!t&&"function"==typeof t.subscribe}function jo(t,e,n=!1,r){const i=se(),o=ae(),s=ue();return function(t,e,n,r,i,o,s=!1,a){const u=Dt(r),c=t.firstCreatePass&&(t.cleanup||(t.cleanup=[])),l=hi(e);let h=!0;if(3===r.type){const d=Kt(r,e),f=a?a(d):yt,p=f.target||d,g=l.length,y=a?t=>a(Qt(t[r.index])).target:r.index;if(Wt(n)){let s=null;if(!a&&u&&(s=function(t,e,n,r){const i=t.cleanup;if(null!=i)for(let o=0;o<i.length-1;o+=2){const t=i[o];if(t===n&&i[o+1]===r){const t=e[7],n=i[o+2];return t.length>n?t[n]:null}"string"==typeof t&&(o+=2)}return null}(t,e,i,r.index)),null!==s)(s.__ngLastListenerFn__||s).__ngNextListenerFn__=o,s.__ngLastListenerFn__=o,h=!1;else{o=Ao(r,e,o,!1);const t=n.listen(f.name||p,i,o);l.push(o,t),c&&c.push(i,y,g,g+1)}}else o=Ao(r,e,o,!0),p.addEventListener(i,o,s),l.push(o),c&&c.push(i,y,g,s)}const d=r.outputs;let f;if(h&&null!==d&&(f=d[i])){const t=f.length;if(t)for(let n=0;n<t;n+=2){const t=e[f[n]][f[n+1]].subscribe(o),s=l.length;l.push(o,t),c&&c.push(i,r.index,s,-(s+1))}}}(o,i,i[11],s,t,e,n,r),jo}function xo(t,e,n){try{return!1!==e(n)}catch(r){return di(t,r),!1}}function Ao(t,e,n,r){return function i(o){if(o===Function)return n;const s=2&t.flags?Yt(t.index,e):e;0==(32&e[2])&&si(s);let a=xo(e,n,o),u=i.__ngNextListenerFn__;for(;u;)a=xo(e,u,o)&&a,u=u.__ngNextListenerFn__;return r&&!1===a&&(o.preventDefault(),o.returnValue=!1),a}}function ko(t,e){let n=null;const r=function(t){const e=t.attrs;if(null!=e){const t=e.indexOf(5);if(0==(1&t))return e[t+1]}return null}(t);for(let i=0;i<e.length;i++){const o=e[i];if("*"!==o){if(null===r?vr(t,o,!0):mr(r,o))return i}else n=i}return n}function No(t){const e=se()[16][6];if(!e.projection){const n=e.projection=lt(t?t.length:1,null),r=n.slice();let i=e.child;for(;null!==i;){const e=t?ko(i,t):0;null!==e&&(r[e]?r[e].projectionNext=i:n[e]=i,r[e]=i),i=i.next}}}function Ro(t,e=0,n){const r=se(),i=ae(),o=Dr(i,r[6],t,1,null,n||null);null===o.projection&&(o.projection=e),he(),function(t,e,n){Ri(e[11],0,e,n,Oi(t,n,e),ji(n.parent||e[6],e))}(i,r,o)}const Po=[];function Do(t,e,n,r,i){const o=t[n+1],s=null===e;let a=r?Ir(o):xr(o),u=!1;for(;0!==a&&(!1===u||s);){const n=t[a+1];Lo(t[a],e)&&(u=!0,t[a+1]=r?kr(n):jr(n)),a=r?Ir(n):xr(n)}u&&(t[n+1]=r?jr(o):kr(o))}function Lo(t,e){return null===t||null==e||(Array.isArray(t)?t[1]:t)===e||!(!Array.isArray(t)||"string"!=typeof e)&&ft(t,e)>=0}function Mo(t,e){return function(t,e,n,r){const i=se(),o=ae(),s=function(t){const e=ie.lFrame,n=e.bindingIndex;return e.bindingIndex=e.bindingIndex+2,n}();o.firstUpdatePass&&function(t,e,n,r){const i=t.data;if(null===i[n+1]){const r=i[Se()+20],o=function(t,e){return e>=t.expandoStartIndex}(t,n);(function(t,e){return 0!=(16&t.flags)})(r)&&null===e&&!o&&(e=!1),e=function(t,e,n,r){const i=function(t){const e=ie.lFrame.currentDirectiveIndex;return-1===e?null:t[e]}(t);let o=e.residualClasses;if(null===i)0===e.classBindings&&(n=Uo(n=Fo(null,t,e,n,!0),e.attrs,!0),o=null);else{const r=e.directiveStylingLast;if(-1===r||t[r]!==i)if(n=Fo(i,t,e,n,!0),null===o){let n=function(t,e,n){const r=e.classBindings;if(0!==xr(r))return t[Ir(r)]}(t,e);void 0!==n&&Array.isArray(n)&&(n=Fo(null,t,e,n[1],!0),n=Uo(n,e.attrs,!0),function(t,e,n,r){t[Ir(e.classBindings)]=r}(t,e,0,n))}else o=function(t,e,n){let r=void 0;const i=e.directiveEnd;for(let o=1+e.directiveStylingLast;o<i;o++)r=Uo(r,t[o].hostAttrs,!0);return Uo(r,e.attrs,!0)}(t,e)}return void 0!==o&&(e.residualClasses=o),n}(i,r,e),function(t,e,n,r,i,o){let s=e.classBindings,a=Ir(s),u=xr(s);t[r]=n;let c,l=!1;if(Array.isArray(n)){const t=n;c=t[1],(null===c||ft(t,c)>0)&&(l=!0)}else c=n;if(i)if(0!==u){const e=Ir(t[a+1]);t[r+1]=Sr(e,a),0!==e&&(t[e+1]=Ar(t[e+1],r)),t[a+1]=131071&t[a+1]|r<<17}else t[r+1]=Sr(a,0),0!==a&&(t[a+1]=Ar(t[a+1],r)),a=r;else t[r+1]=Sr(u,0),0===a?a=r:t[u+1]=Ar(t[u+1],r),u=r;l&&(t[r+1]=jr(t[r+1])),Do(t,c,r,!0),Do(t,c,r,!1),function(t,e,n,r,i){const o=t.residualClasses;null!=o&&"string"==typeof e&&ft(o,e)>=0&&(n[r+1]=kr(n[r+1]))}(e,c,t,r),s=Sr(a,u),e.classBindings=s}(i,r,e,n,o)}}(o,t,s),e!==wr&&yo(i,s,e)&&function(t,e,n,r,i,o,s,a){if(3!==e.type)return;const u=t.data,c=u[a+1];Vo(1==(1&c)?$o(u,e,n,i,xr(c),!0):void 0)||(Vo(o)||function(t){return 2==(2&t)}(c)&&(o=$o(u,null,n,i,a,!0)),function(t,e,n,r,i){const o=Wt(t);i?o?t.addClass(n,r):n.classList.add(r):o?t.removeClass(n,r):n.classList.remove(r)}(r,0,function(t,e){return Qt(e[t+20])}(Se(),n),i,o))}(o,o.data[Se()+20],i,i[11],t,i[s+1]=function(t,e){return null==t||"object"==typeof t&&(t=I(Cn(t))),t}(e),0,s)}(t,e),Mo}function Fo(t,e,n,r,i){let o=null;const s=n.directiveEnd;let a=n.directiveStylingLast;for(-1===a?a=n.directiveStart:a++;a<s&&(o=e[a],r=Uo(r,o.hostAttrs,i),o!==t);)a++;return null!==t&&(n.directiveStylingLast=a),r}function Uo(t,e,n){const r=n?1:2;let i=-1;if(null!==e)for(let o=0;o<e.length;o++){const s=e[o];"number"==typeof s?i=s:i===r&&(Array.isArray(t)||(t=void 0===t?[]:["",t]),ht(t,s,!!n||e[++o]))}return void 0===t?null:t}function $o(t,e,n,r,i,o){const s=null===e;let a=void 0;for(;i>0;){const e=t[i],o=Array.isArray(e),u=o?e[1]:e,c=null===u;let l=n[i+1];l===wr&&(l=c?Po:void 0);let h=c?dt(l,r):u===r?l:void 0;if(o&&!Vo(h)&&(h=dt(e,r)),Vo(h)&&(a=h,s))return a;const d=t[i+1];i=s?Ir(d):xr(d)}if(null!==e){let t=o?e.residualClasses:e.residualStyles;null!=t&&(a=dt(t,r))}return a}function Vo(t){return void 0!==t}function qo(t,e=""){const n=se(),r=ae(),i=t+20,o=r.firstCreatePass?Dr(r,n[6],t,3,null,null):r.data[i],s=n[i]=function(t,e){return Wt(e)?e.createText(t):e.createTextNode(t)}(e,n[11]);xi(r,n,s,o),ce(o,!1)}function Ho(t,e,n){const r=se();return yo(r,pe(),e)&&zr(ae(),je(),r,t,e,r[11],n,!0),Ho}function Bo(t,e){const n=Jt(t)[1],r=n.data.length-1;xe(n,{directiveStart:r,directiveEnd:r+1})}function zo(t){let e=Object.getPrototypeOf(t.type.prototype).constructor,n=!0;const r=[t];for(;e;){let i=void 0;if(Lt(t))i=e.\u0275cmp||e.\u0275dir;else{if(e.\u0275cmp)throw new Error("Directives cannot inherit Components");i=e.\u0275dir}if(i){if(n){r.push(i);const e=t;e.inputs=Wo(t.inputs),e.declaredInputs=Wo(t.declaredInputs),e.outputs=Wo(t.outputs);const n=i.hostBindings;n&&Ko(t,n);const o=i.viewQuery,s=i.contentQueries;if(o&&Go(t,o),s&&Qo(t,s),y(t.inputs,i.inputs),y(t.declaredInputs,i.declaredInputs),y(t.outputs,i.outputs),Lt(i)&&i.data.animation){const e=t.data;e.animation=(e.animation||[]).concat(i.data.animation)}}const e=i.features;if(e)for(let r=0;r<e.length;r++){const i=e[r];i&&i.ngInherit&&i(t),i===zo&&(n=!1)}}e=Object.getPrototypeOf(e)}!function(t){let e=0,n=null;for(let r=t.length-1;r>=0;r--){const i=t[r];i.hostVars=e+=i.hostVars,i.hostAttrs=Ue(i.hostAttrs,n=Ue(n,i.hostAttrs))}}(r)}function Wo(t){return t===yt?{}:t===vt?[]:t}function Go(t,e){const n=t.viewQuery;t.viewQuery=n?(t,r)=>{e(t,r),n(t,r)}:e}function Qo(t,e){const n=t.contentQueries;t.contentQueries=n?(t,r,i)=>{e(t,r,i),n(t,r,i)}:e}function Ko(t,e){const n=t.hostBindings;t.hostBindings=n?(t,r)=>{e(t,r),n(t,r)}:e}function Xo(t,e,n,r,i){if(t=k(t),Array.isArray(t))for(let o=0;o<t.length;o++)Xo(t[o],e,n,r,i);else{const o=ae(),s=se();let a=so(t)?t:k(t.provide),u=ro(t);const c=ue(),l=1048575&c.providerIndexes,h=c.directiveStart,d=c.providerIndexes>>20;if(so(t)||!t.multi){const r=new De(u,i,mo),f=Zo(a,e,i?l:l+d,h);-1===f?(nn(Je(c,s),o,a),Yo(o,t,e.length),e.push(a),c.directiveStart++,c.directiveEnd++,i&&(c.providerIndexes+=1048576),n.push(r),s.push(r)):(n[f]=r,s[f]=r)}else{const f=Zo(a,e,l+d,h),p=Zo(a,e,l,l+d),g=f>=0&&n[f],y=p>=0&&n[p];if(i&&!y||!i&&!g){nn(Je(c,s),o,a);const l=function(t,e,n,r,i){const o=new De(t,n,mo);return o.multi=[],o.index=e,o.componentProviders=0,Jo(o,i,r&&!n),o}(i?es:ts,n.length,i,r,u);!i&&y&&(n[p].providerFactory=l),Yo(o,t,e.length,0),e.push(a),c.directiveStart++,c.directiveEnd++,i&&(c.providerIndexes+=1048576),n.push(l),s.push(l)}else Yo(o,t,f>-1?f:p,Jo(n[i?p:f],u,!i&&r));!i&&r&&y&&n[p].componentProviders++}}}function Yo(t,e,n,r){const i=so(e);if(i||e.useClass){const o=(e.useClass||e).prototype.ngOnDestroy;if(o){const s=t.destroyHooks||(t.destroyHooks=[]);if(!i&&e.multi){const t=s.indexOf(n);-1===t?s.push(n,[r,o]):s[t+1].push(r,o)}else s.push(n,o)}}}function Jo(t,e,n){return n&&t.componentProviders++,t.multi.push(e)-1}function Zo(t,e,n,r){for(let i=n;i<r;i++)if(e[i]===t)return i;return-1}function ts(t,e,n,r){return ns(this.multi,[])}function es(t,e,n,r){const i=this.multi;let o;if(this.providerFactory){const t=this.providerFactory.componentProviders,e=un(n,n[1],this.providerFactory.index,r);o=e.slice(0,t),ns(i,o);for(let n=t;n<e.length;n++)o.push(e[n])}else o=[],ns(i,o);return o}function ns(t,e){for(let n=0;n<t.length;n++)e.push((0,t[n])());return e}function rs(t,e=[]){return n=>{n.providersResolver=(n,r)=>function(t,e,n){const r=ae();if(r.firstCreatePass){const i=Lt(t);Xo(n,r.data,r.blueprint,i,!0),Xo(e,r.data,r.blueprint,i,!1)}}(n,r?r(t):t,e)}}class is{}class os{resolveComponentFactory(t){throw function(t){const e=Error(`No component factory found for ${I(t)}. Did you add it to @NgModule.entryComponents?`);return e.ngComponent=t,e}(t)}}let ss=(()=>{class t{}return t.NULL=new os,t})(),as=(()=>{class t{constructor(t){this.nativeElement=t}}return t.__NG_ELEMENT_ID__=()=>us(t),t})();const us=function(t){return Vi(t,ue(),se())};class cs{}var ls=function(t){return t[t.Important=1]="Important",t[t.DashCase=2]="DashCase",t}({});let hs=(()=>{class t{}return t.__NG_ELEMENT_ID__=()=>ds(),t})();const ds=function(){const t=se(),e=Yt(ue().index,t);return function(t){const e=t[11];if(Wt(e))return e;throw new Error("Cannot inject Renderer2 when the application uses Renderer3!")}(kt(e)?e:t)};let fs=(()=>{class t{}return t.\u0275prov=v({token:t,providedIn:"root",factory:()=>null}),t})();class ps{constructor(t){this.full=t,this.major=t.split(".")[0],this.minor=t.split(".")[1],this.patch=t.split(".").slice(2).join(".")}}const gs=new ps("10.0.14");class ys{constructor(){}supports(t){return po(t)}create(t){return new ms(t)}}const vs=(t,e)=>e;class ms{constructor(t){this.length=0,this._linkedRecords=null,this._unlinkedRecords=null,this._previousItHead=null,this._itHead=null,this._itTail=null,this._additionsHead=null,this._additionsTail=null,this._movesHead=null,this._movesTail=null,this._removalsHead=null,this._removalsTail=null,this._identityChangesHead=null,this._identityChangesTail=null,this._trackByFn=t||vs}forEachItem(t){let e;for(e=this._itHead;null!==e;e=e._next)t(e)}forEachOperation(t){let e=this._itHead,n=this._removalsHead,r=0,i=null;for(;e||n;){const o=!n||e&&e.currentIndex<Es(n,r,i)?e:n,s=Es(o,r,i),a=o.currentIndex;if(o===n)r--,n=n._nextRemoved;else if(e=e._next,null==o.previousIndex)r++;else{i||(i=[]);const t=s-r,e=a-r;if(t!=e){for(let n=0;n<t;n++){const r=n<i.length?i[n]:i[n]=0,o=r+n;e<=o&&o<t&&(i[n]=r+1)}i[o.previousIndex]=e-t}}s!==a&&t(o,s,a)}}forEachPreviousItem(t){let e;for(e=this._previousItHead;null!==e;e=e._nextPrevious)t(e)}forEachAddedItem(t){let e;for(e=this._additionsHead;null!==e;e=e._nextAdded)t(e)}forEachMovedItem(t){let e;for(e=this._movesHead;null!==e;e=e._nextMoved)t(e)}forEachRemovedItem(t){let e;for(e=this._removalsHead;null!==e;e=e._nextRemoved)t(e)}forEachIdentityChange(t){let e;for(e=this._identityChangesHead;null!==e;e=e._nextIdentityChange)t(e)}diff(t){if(null==t&&(t=[]),!po(t))throw new Error(`Error trying to diff '${I(t)}'. Only arrays and iterables are allowed`);return this.check(t)?this:null}onDestroy(){}check(t){this._reset();let e,n,r,i=this._itHead,o=!1;if(Array.isArray(t)){this.length=t.length;for(let e=0;e<this.length;e++)n=t[e],r=this._trackByFn(e,n),null!==i&&Object.is(i.trackById,r)?(o&&(i=this._verifyReinsertion(i,n,r,e)),Object.is(i.item,n)||this._addIdentityChange(i,n)):(i=this._mismatch(i,n,r,e),o=!0),i=i._next}else e=0,function(t,e){if(Array.isArray(t))for(let n=0;n<t.length;n++)e(t[n]);else{const n=t[fo()]();let r;for(;!(r=n.next()).done;)e(r.value)}}(t,t=>{r=this._trackByFn(e,t),null!==i&&Object.is(i.trackById,r)?(o&&(i=this._verifyReinsertion(i,t,r,e)),Object.is(i.item,t)||this._addIdentityChange(i,t)):(i=this._mismatch(i,t,r,e),o=!0),i=i._next,e++}),this.length=e;return this._truncate(i),this.collection=t,this.isDirty}get isDirty(){return null!==this._additionsHead||null!==this._movesHead||null!==this._removalsHead||null!==this._identityChangesHead}_reset(){if(this.isDirty){let t,e;for(t=this._previousItHead=this._itHead;null!==t;t=t._next)t._nextPrevious=t._next;for(t=this._additionsHead;null!==t;t=t._nextAdded)t.previousIndex=t.currentIndex;for(this._additionsHead=this._additionsTail=null,t=this._movesHead;null!==t;t=e)t.previousIndex=t.currentIndex,e=t._nextMoved;this._movesHead=this._movesTail=null,this._removalsHead=this._removalsTail=null,this._identityChangesHead=this._identityChangesTail=null}}_mismatch(t,e,n,r){let i;return null===t?i=this._itTail:(i=t._prev,this._remove(t)),null!==(t=null===this._linkedRecords?null:this._linkedRecords.get(n,r))?(Object.is(t.item,e)||this._addIdentityChange(t,e),this._moveAfter(t,i,r)):null!==(t=null===this._unlinkedRecords?null:this._unlinkedRecords.get(n,null))?(Object.is(t.item,e)||this._addIdentityChange(t,e),this._reinsertAfter(t,i,r)):t=this._addAfter(new bs(e,n),i,r),t}_verifyReinsertion(t,e,n,r){let i=null===this._unlinkedRecords?null:this._unlinkedRecords.get(n,null);return null!==i?t=this._reinsertAfter(i,t._prev,r):t.currentIndex!=r&&(t.currentIndex=r,this._addToMoves(t,r)),t}_truncate(t){for(;null!==t;){const e=t._next;this._addToRemovals(this._unlink(t)),t=e}null!==this._unlinkedRecords&&this._unlinkedRecords.clear(),null!==this._additionsTail&&(this._additionsTail._nextAdded=null),null!==this._movesTail&&(this._movesTail._nextMoved=null),null!==this._itTail&&(this._itTail._next=null),null!==this._removalsTail&&(this._removalsTail._nextRemoved=null),null!==this._identityChangesTail&&(this._identityChangesTail._nextIdentityChange=null)}_reinsertAfter(t,e,n){null!==this._unlinkedRecords&&this._unlinkedRecords.remove(t);const r=t._prevRemoved,i=t._nextRemoved;return null===r?this._removalsHead=i:r._nextRemoved=i,null===i?this._removalsTail=r:i._prevRemoved=r,this._insertAfter(t,e,n),this._addToMoves(t,n),t}_moveAfter(t,e,n){return this._unlink(t),this._insertAfter(t,e,n),this._addToMoves(t,n),t}_addAfter(t,e,n){return this._insertAfter(t,e,n),this._additionsTail=null===this._additionsTail?this._additionsHead=t:this._additionsTail._nextAdded=t,t}_insertAfter(t,e,n){const r=null===e?this._itHead:e._next;return t._next=r,t._prev=e,null===r?this._itTail=t:r._prev=t,null===e?this._itHead=t:e._next=t,null===this._linkedRecords&&(this._linkedRecords=new ws),this._linkedRecords.put(t),t.currentIndex=n,t}_remove(t){return this._addToRemovals(this._unlink(t))}_unlink(t){null!==this._linkedRecords&&this._linkedRecords.remove(t);const e=t._prev,n=t._next;return null===e?this._itHead=n:e._next=n,null===n?this._itTail=e:n._prev=e,t}_addToMoves(t,e){return t.previousIndex===e||(this._movesTail=null===this._movesTail?this._movesHead=t:this._movesTail._nextMoved=t),t}_addToRemovals(t){return null===this._unlinkedRecords&&(this._unlinkedRecords=new ws),this._unlinkedRecords.put(t),t.currentIndex=null,t._nextRemoved=null,null===this._removalsTail?(this._removalsTail=this._removalsHead=t,t._prevRemoved=null):(t._prevRemoved=this._removalsTail,this._removalsTail=this._removalsTail._nextRemoved=t),t}_addIdentityChange(t,e){return t.item=e,this._identityChangesTail=null===this._identityChangesTail?this._identityChangesHead=t:this._identityChangesTail._nextIdentityChange=t,t}}class bs{constructor(t,e){this.item=t,this.trackById=e,this.currentIndex=null,this.previousIndex=null,this._nextPrevious=null,this._prev=null,this._next=null,this._prevDup=null,this._nextDup=null,this._prevRemoved=null,this._nextRemoved=null,this._nextAdded=null,this._nextMoved=null,this._nextIdentityChange=null}}class _s{constructor(){this._head=null,this._tail=null}add(t){null===this._head?(this._head=this._tail=t,t._nextDup=null,t._prevDup=null):(this._tail._nextDup=t,t._prevDup=this._tail,t._nextDup=null,this._tail=t)}get(t,e){let n;for(n=this._head;null!==n;n=n._nextDup)if((null===e||e<=n.currentIndex)&&Object.is(n.trackById,t))return n;return null}remove(t){const e=t._prevDup,n=t._nextDup;return null===e?this._head=n:e._nextDup=n,null===n?this._tail=e:n._prevDup=e,null===this._head}}class ws{constructor(){this.map=new Map}put(t){const e=t.trackById;let n=this.map.get(e);n||(n=new _s,this.map.set(e,n)),n.add(t)}get(t,e){const n=this.map.get(t);return n?n.get(t,e):null}remove(t){const e=t.trackById;return this.map.get(e).remove(t)&&this.map.delete(e),t}get isEmpty(){return 0===this.map.size}clear(){this.map.clear()}}function Es(t,e,n){const r=t.previousIndex;if(null===r)return r;let i=0;return n&&r<n.length&&(i=n[r]),r+e+i}class Os{constructor(){}supports(t){return t instanceof Map||go(t)}create(){return new Cs}}class Cs{constructor(){this._records=new Map,this._mapHead=null,this._appendAfter=null,this._previousMapHead=null,this._changesHead=null,this._changesTail=null,this._additionsHead=null,this._additionsTail=null,this._removalsHead=null,this._removalsTail=null}get isDirty(){return null!==this._additionsHead||null!==this._changesHead||null!==this._removalsHead}forEachItem(t){let e;for(e=this._mapHead;null!==e;e=e._next)t(e)}forEachPreviousItem(t){let e;for(e=this._previousMapHead;null!==e;e=e._nextPrevious)t(e)}forEachChangedItem(t){let e;for(e=this._changesHead;null!==e;e=e._nextChanged)t(e)}forEachAddedItem(t){let e;for(e=this._additionsHead;null!==e;e=e._nextAdded)t(e)}forEachRemovedItem(t){let e;for(e=this._removalsHead;null!==e;e=e._nextRemoved)t(e)}diff(t){if(t){if(!(t instanceof Map||go(t)))throw new Error(`Error trying to diff '${I(t)}'. Only maps and objects are allowed`)}else t=new Map;return this.check(t)?this:null}onDestroy(){}check(t){this._reset();let e=this._mapHead;if(this._appendAfter=null,this._forEach(t,(t,n)=>{if(e&&e.key===n)this._maybeAddToChanges(e,t),this._appendAfter=e,e=e._next;else{const r=this._getOrCreateRecordForKey(n,t);e=this._insertBeforeOrAppend(e,r)}}),e){e._prev&&(e._prev._next=null),this._removalsHead=e;for(let t=e;null!==t;t=t._nextRemoved)t===this._mapHead&&(this._mapHead=null),this._records.delete(t.key),t._nextRemoved=t._next,t.previousValue=t.currentValue,t.currentValue=null,t._prev=null,t._next=null}return this._changesTail&&(this._changesTail._nextChanged=null),this._additionsTail&&(this._additionsTail._nextAdded=null),this.isDirty}_insertBeforeOrAppend(t,e){if(t){const n=t._prev;return e._next=t,e._prev=n,t._prev=e,n&&(n._next=e),t===this._mapHead&&(this._mapHead=e),this._appendAfter=t,t}return this._appendAfter?(this._appendAfter._next=e,e._prev=this._appendAfter):this._mapHead=e,this._appendAfter=e,null}_getOrCreateRecordForKey(t,e){if(this._records.has(t)){const n=this._records.get(t);this._maybeAddToChanges(n,e);const r=n._prev,i=n._next;return r&&(r._next=i),i&&(i._prev=r),n._next=null,n._prev=null,n}const n=new Ts(t);return this._records.set(t,n),n.currentValue=e,this._addToAdditions(n),n}_reset(){if(this.isDirty){let t;for(this._previousMapHead=this._mapHead,t=this._previousMapHead;null!==t;t=t._next)t._nextPrevious=t._next;for(t=this._changesHead;null!==t;t=t._nextChanged)t.previousValue=t.currentValue;for(t=this._additionsHead;null!=t;t=t._nextAdded)t.previousValue=t.currentValue;this._changesHead=this._changesTail=null,this._additionsHead=this._additionsTail=null,this._removalsHead=null}}_maybeAddToChanges(t,e){Object.is(e,t.currentValue)||(t.previousValue=t.currentValue,t.currentValue=e,this._addToChanges(t))}_addToAdditions(t){null===this._additionsHead?this._additionsHead=this._additionsTail=t:(this._additionsTail._nextAdded=t,this._additionsTail=t)}_addToChanges(t){null===this._changesHead?this._changesHead=this._changesTail=t:(this._changesTail._nextChanged=t,this._changesTail=t)}_forEach(t,e){t instanceof Map?t.forEach(e):Object.keys(t).forEach(n=>e(t[n],n))}}class Ts{constructor(t){this.key=t,this.previousValue=null,this.currentValue=null,this._nextPrevious=null,this._next=null,this._prev=null,this._nextAdded=null,this._nextRemoved=null,this._nextChanged=null}}let Ss=(()=>{class t{constructor(t){this.factories=t}static create(e,n){if(null!=n){const t=n.factories.slice();e=e.concat(t)}return new t(e)}static extend(e){return{provide:t,useFactory:n=>{if(!n)throw new Error("Cannot extend IterableDiffers without a parent injector");return t.create(e,n)},deps:[[t,new f,new h]]}}find(t){const e=this.factories.find(e=>e.supports(t));if(null!=e)return e;throw new Error(`Cannot find a differ supporting object '${t}' of type '${n=t,n.name||typeof n}'`);var n}}return t.\u0275prov=v({token:t,providedIn:"root",factory:()=>new t([new ys])}),t})(),Is=(()=>{class t{constructor(t){this.factories=t}static create(e,n){if(n){const t=n.factories.slice();e=e.concat(t)}return new t(e)}static extend(e){return{provide:t,useFactory:n=>{if(!n)throw new Error("Cannot extend KeyValueDiffers without a parent injector");return t.create(e,n)},deps:[[t,new f,new h]]}}find(t){const e=this.factories.find(e=>e.supports(t));if(e)return e;throw new Error(`Cannot find a differ supporting object '${t}'`)}}return t.\u0275prov=v({token:t,providedIn:"root",factory:()=>new t([new Os])}),t})();const js=[new Os],xs=new Ss([new ys]),As=new Is(js);let ks=(()=>{class t{}return t.__NG_ELEMENT_ID__=()=>Ns(t,as),t})();const Ns=function(t,e){return qi(t,e,ue(),se())};let Rs=(()=>{class t{}return t.__NG_ELEMENT_ID__=()=>Ps(t,as),t})();const Ps=function(t,e){return Hi(t,e,ue(),se())},Ds={};class Ls extends ss{constructor(t){super(),this.ngModule=t}resolveComponentFactory(t){const e=jt(t);return new Us(e,this.ngModule)}}function Ms(t){const e=[];for(let n in t)t.hasOwnProperty(n)&&e.push({propName:t[n],templateName:n});return e}const Fs=new z("SCHEDULER_TOKEN",{providedIn:"root",factory:()=>Ge});class Us extends is{constructor(t,e){super(),this.componentDef=t,this.ngModule=e,this.componentType=t.type,this.selector=t.selectors.map(_r).join(","),this.ngContentSelectors=t.ngContentSelectors?t.ngContentSelectors:[],this.isBoundToModule=!!e}get inputs(){return Ms(this.componentDef.inputs)}get outputs(){return Ms(this.componentDef.outputs)}create(t,e,n,r){const i=(r=r||this.ngModule)?function(t,e){return{get:(n,r,i)=>{const o=t.get(n,Ds,i);return o!==Ds||r===Ds?o:e.get(n,r,i)}}}(t,r.injector):t,o=i.get(cs,Gt),s=i.get(fs,null),a=o.createRenderer(null,this.componentDef),u=this.componentDef.selectors[0][0]||"div",c=n?function(t,e,n){if(Wt(t))return t.selectRootElement(e,n===gt.ShadowDom);let r="string"==typeof e?t.querySelector(e):e;return r.textContent="",r}(a,n,this.componentDef.encapsulation):Rr(u,o.createRenderer(null,this.componentDef),function(t){const e=t.toLowerCase();return"svg"===e?"http://www.w3.org/2000/svg":"math"===e?"http://www.w3.org/1998/MathML/":null}(u)),l=this.componentDef.onPush?576:528,h={components:[],scheduler:Ge,clean:li,playerHandler:null,flags:0},d=Vr(0,-1,null,1,0,null,null,null,null,null),f=Pr(null,d,h,l,null,null,o,a,s,i);let p,g;_e(f,null);try{const t=function(t,e,n,r,i,o){const s=n[1];n[20]=t;const a=Dr(s,null,0,3,null,null),u=a.mergedAttrs=e.hostAttrs;null!==u&&(lo(a,u,!0),null!==t&&(Le(i,t,u),null!==a.classes&&Di(i,t,a.classes),null!==a.styles&&Pi(i,t,a.styles)));const c=r.createRenderer(t,e),l=Pr(n,$r(e),null,e.onPush?64:16,n[20],a,r,c,void 0);return s.firstCreatePass&&(nn(Je(a,n),s,e.type),Xr(s,a),Jr(a,n.length,1)),oi(n,l),n[20]=l}(c,this.componentDef,f,o,a);if(c)if(n)Le(a,c,["ng-version",gs.full]);else{const{attrs:t,classes:e}=function(t){const e=[],n=[];let r=1,i=2;for(;r<t.length;){let o=t[r];if("string"==typeof o)2===i?""!==o&&e.push(o,t[++r]):8===i&&n.push(o);else{if(!gr(i))break;i=o}r++}return{attrs:e,classes:n}}(this.componentDef.selectors[0]);t&&Le(a,c,t),e&&e.length>0&&Di(a,c,e.join(" "))}if(g=Xt(d,0),void 0!==e){const t=g.projection=[];for(let n=0;n<this.ngContentSelectors.length;n++){const r=e[n];t.push(null!=r?Array.from(r):null)}}p=function(t,e,n,r,i){const o=n[1],s=function(t,e,n){const r=ue();t.firstCreatePass&&(n.providersResolver&&n.providersResolver(n),Kr(t,r,1),Zr(t,e,n));const i=un(e,t,e.length-1,r);ar(i,e);const o=Kt(r,e);return o&&ar(o,e),i}(o,n,e);r.components.push(s),t[8]=s,i&&i.forEach(t=>t(s,e)),e.contentQueries&&e.contentQueries(1,s,n.length-1);const a=ue();if(o.firstCreatePass&&(null!==e.hostBindings||null!==e.hostAttrs)){Ie(a.index-20);const t=n[1];Wr(t,e),Gr(t,n,e.hostVars),Qr(e,s)}return s}(t,this.componentDef,f,h,[Bo]),Lr(d,f,null)}finally{Te()}const y=new $s(this.componentType,p,Vi(as,g,f),f,g);return d.node.child=g,y}}class $s extends class{}{constructor(t,e,n,r,i){super(),this.location=n,this._rootLView=r,this._tNode=i,this.destroyCbs=[],this.instance=e,this.hostView=this.changeDetectorRef=new Mi(r),function(t,e,n,r){let i=t.node;null==i&&(t.node=i=Hr(0,null,2,-1,null,null)),r[6]=i}(r[1],0,0,r),this.componentType=t}get injector(){return new hn(this._tNode,this._rootLView)}destroy(){this.destroyCbs&&(this.destroyCbs.forEach(t=>t()),this.destroyCbs=null,!this.hostView.destroyed&&this.hostView.destroy())}onDestroy(t){this.destroyCbs&&this.destroyCbs.push(t)}}const Vs=void 0;var qs=["en",[["a","p"],["AM","PM"],Vs],[["AM","PM"],Vs,Vs],[["S","M","T","W","T","F","S"],["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],["Su","Mo","Tu","We","Th","Fr","Sa"]],Vs,[["J","F","M","A","M","J","J","A","S","O","N","D"],["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],["January","February","March","April","May","June","July","August","September","October","November","December"]],Vs,[["B","A"],["BC","AD"],["Before Christ","Anno Domini"]],0,[6,0],["M/d/yy","MMM d, y","MMMM d, y","EEEE, MMMM d, y"],["h:mm a","h:mm:ss a","h:mm:ss a z","h:mm:ss a zzzz"],["{1}, {0}",Vs,"{1} 'at' {0}",Vs],[".",",",";","%","+","-","E","\xd7","\u2030","\u221e","NaN",":"],["#,##0.###","#,##0%","\xa4#,##0.00","#E0"],"USD","$","US Dollar",{},"ltr",function(t){let e=Math.floor(Math.abs(t)),n=t.toString().replace(/^[^.]*\.?/,"").length;return 1===e&&0===n?1:5}];let Hs={};function Bs(t,e,n){"string"!=typeof e&&(n=e,e=t[Ks.LocaleId]),e=e.toLowerCase().replace(/_/g,"-"),Hs[e]=t,n&&(Hs[e][Ks.ExtraData]=n)}function zs(t){const e=function(t){return t.toLowerCase().replace(/_/g,"-")}(t);let n=Qs(e);if(n)return n;const r=e.split("-")[0];if(n=Qs(r),n)return n;if("en"===r)return qs;throw new Error(`Missing locale data for the locale "${t}".`)}function Ws(t){return zs(t)[Ks.CurrencyCode]||null}function Gs(t){return zs(t)[Ks.PluralCase]}function Qs(t){return t in Hs||(Hs[t]=M.ng&&M.ng.common&&M.ng.common.locales&&M.ng.common.locales[t]),Hs[t]}var Ks=function(t){return t[t.LocaleId=0]="LocaleId",t[t.DayPeriodsFormat=1]="DayPeriodsFormat",t[t.DayPeriodsStandalone=2]="DayPeriodsStandalone",t[t.DaysFormat=3]="DaysFormat",t[t.DaysStandalone=4]="DaysStandalone",t[t.MonthsFormat=5]="MonthsFormat",t[t.MonthsStandalone=6]="MonthsStandalone",t[t.Eras=7]="Eras",t[t.FirstDayOfWeek=8]="FirstDayOfWeek",t[t.WeekendRange=9]="WeekendRange",t[t.DateFormat=10]="DateFormat",t[t.TimeFormat=11]="TimeFormat",t[t.DateTimeFormat=12]="DateTimeFormat",t[t.NumberSymbols=13]="NumberSymbols",t[t.NumberFormats=14]="NumberFormats",t[t.CurrencyCode=15]="CurrencyCode",t[t.CurrencySymbol=16]="CurrencySymbol",t[t.CurrencyName=17]="CurrencyName",t[t.Currencies=18]="Currencies",t[t.Directionality=19]="Directionality",t[t.PluralCase=20]="PluralCase",t[t.ExtraData=21]="ExtraData",t}({});let Xs="en-US";function Ys(t){var e,n;n="Expected localeId to be defined",null==(e=t)&&function(t,e,n,r){throw new Error("ASSERTION ERROR: "+t+` [Expected=> null != ${e} <=Actual]`)}(n,e),"string"==typeof t&&(Xs=t.toLowerCase().replace(/_/g,"-"))}const Js=new Map;class Zs extends ot{constructor(t,e){super(),this._parent=e,this._bootstrapComponents=[],this.injector=this,this.destroyCbs=[],this.componentFactoryResolver=new Ls(this);const n=At(t),r=t[q]||null;r&&Ys(r),this._bootstrapComponents=Qe(n.bootstrap),this._r3Injector=to(t,e,[{provide:ot,useValue:this},{provide:ss,useValue:this.componentFactoryResolver}],I(t)),this._r3Injector._resolveInjectorDefTypes(),this.instance=this.get(t)}get(t,e=uo.THROW_IF_NOT_FOUND,n=p.Default){return t===uo||t===ot||t===W?this:this._r3Injector.get(t,e,n)}destroy(){const t=this._r3Injector;!t.destroyed&&t.destroy(),this.destroyCbs.forEach(t=>t()),this.destroyCbs=null}onDestroy(t){this.destroyCbs.push(t)}}class ta extends st{constructor(t){super(),this.moduleType=t,null!==At(t)&&function t(e){if(null!==e.\u0275mod.id){const t=e.\u0275mod.id;(function(t,e,n){if(e&&e!==n)throw new Error(`Duplicate module registered for ${t} - ${I(e)} vs ${I(e.name)}`)})(t,Js.get(t),e),Js.set(t,e)}let n=e.\u0275mod.imports;n instanceof Function&&(n=n()),n&&n.forEach(e=>t(e))}(t)}create(t){return new Zs(this.moduleType,t)}}const ea=class extends r.a{constructor(t=!1){super(),this.__isAsync=t}emit(t){super.next(t)}subscribe(t,e,n){let r,o=t=>null,s=()=>null;t&&"object"==typeof t?(r=this.__isAsync?e=>{setTimeout(()=>t.next(e))}:e=>{t.next(e)},t.error&&(o=this.__isAsync?e=>{setTimeout(()=>t.error(e))}:e=>{t.error(e)}),t.complete&&(s=this.__isAsync?()=>{setTimeout(()=>t.complete())}:()=>{t.complete()})):(r=this.__isAsync?e=>{setTimeout(()=>t(e))}:e=>{t(e)},e&&(o=this.__isAsync?t=>{setTimeout(()=>e(t))}:t=>{e(t)}),n&&(s=this.__isAsync?()=>{setTimeout(()=>n())}:()=>{n()}));const a=super.subscribe(r,o,s);return t instanceof i.a&&t.add(a),a}};function na(){return this._results[fo()]()}class ra{constructor(){this.dirty=!0,this._results=[],this.changes=new ea,this.length=0;const t=fo(),e=ra.prototype;e[t]||(e[t]=na)}map(t){return this._results.map(t)}filter(t){return this._results.filter(t)}find(t){return this._results.find(t)}reduce(t,e){return this._results.reduce(t,e)}forEach(t){this._results.forEach(t)}some(t){return this._results.some(t)}toArray(){return this._results.slice()}toString(){return this._results.toString()}reset(t){this._results=function t(e,n){void 0===n&&(n=e);for(let r=0;r<e.length;r++){let i=e[r];Array.isArray(i)?(n===e&&(n=e.slice(0,r)),t(i,n)):n!==e&&n.push(i)}return n}(t),this.dirty=!1,this.length=this._results.length,this.last=this._results[this.length-1],this.first=this._results[0]}notifyOnChanges(){this.changes.emit(this)}setDirty(){this.dirty=!0}destroy(){this.changes.complete(),this.changes.unsubscribe()}}class ia{constructor(t){this.queryList=t,this.matches=null}clone(){return new ia(this.queryList)}setDirty(){this.queryList.setDirty()}}class oa{constructor(t=[]){this.queries=t}createEmbeddedView(t){const e=t.queries;if(null!==e){const n=null!==t.contentQueries?t.contentQueries[0]:e.length,r=[];for(let t=0;t<n;t++){const n=e.getByIndex(t);r.push(this.queries[n.indexInDeclarationView].clone())}return new oa(r)}return null}insertView(t){this.dirtyQueriesWithMatches(t)}detachView(t){this.dirtyQueriesWithMatches(t)}dirtyQueriesWithMatches(t){for(let e=0;e<this.queries.length;e++)null!==ma(t,e).matches&&this.queries[e].setDirty()}}class sa{constructor(t,e,n,r=null){this.predicate=t,this.descendants=e,this.isStatic=n,this.read=r}}class aa{constructor(t=[]){this.queries=t}elementStart(t,e){for(let n=0;n<this.queries.length;n++)this.queries[n].elementStart(t,e)}elementEnd(t){for(let e=0;e<this.queries.length;e++)this.queries[e].elementEnd(t)}embeddedTView(t){let e=null;for(let n=0;n<this.length;n++){const r=null!==e?e.length:0,i=this.getByIndex(n).embeddedTView(t,r);i&&(i.indexInDeclarationView=n,null!==e?e.push(i):e=[i])}return null!==e?new aa(e):null}template(t,e){for(let n=0;n<this.queries.length;n++)this.queries[n].template(t,e)}getByIndex(t){return this.queries[t]}get length(){return this.queries.length}track(t){this.queries.push(t)}}class ua{constructor(t,e=-1){this.metadata=t,this.matches=null,this.indexInDeclarationView=-1,this.crossesNgTemplate=!1,this._appliesToNextNode=!0,this._declarationNodeIndex=e}elementStart(t,e){this.isApplyingToNode(e)&&this.matchTNode(t,e)}elementEnd(t){this._declarationNodeIndex===t.index&&(this._appliesToNextNode=!1)}template(t,e){this.elementStart(t,e)}embeddedTView(t,e){return this.isApplyingToNode(t)?(this.crossesNgTemplate=!0,this.addMatch(-t.index,e),new ua(this.metadata)):null}isApplyingToNode(t){if(this._appliesToNextNode&&!1===this.metadata.descendants){const e=this._declarationNodeIndex;let n=t.parent;for(;null!==n&&4===n.type&&n.index!==e;)n=n.parent;return e===(null!==n?n.index:-1)}return this._appliesToNextNode}matchTNode(t,e){const n=this.metadata.predicate;if(Array.isArray(n))for(let r=0;r<n.length;r++){const i=n[r];this.matchTNodeWithReadOption(t,e,ca(e,i)),this.matchTNodeWithReadOption(t,e,an(e,t,i,!1,!1))}else n===ks?0===e.type&&this.matchTNodeWithReadOption(t,e,-1):this.matchTNodeWithReadOption(t,e,an(e,t,n,!1,!1))}matchTNodeWithReadOption(t,e,n){if(null!==n){const r=this.metadata.read;if(null!==r)if(r===as||r===Rs||r===ks&&0===e.type)this.addMatch(e.index,-2);else{const n=an(e,t,r,!1,!1);null!==n&&this.addMatch(e.index,n)}else this.addMatch(e.index,n)}}addMatch(t,e){null===this.matches?this.matches=[t,e]:this.matches.push(t,e)}}function ca(t,e){const n=t.localNames;if(null!==n)for(let r=0;r<n.length;r+=2)if(n[r]===e)return n[r+1];return null}function la(t,e,n,r){return-1===n?function(t,e){return 3===t.type||4===t.type?Vi(as,t,e):0===t.type?qi(ks,as,t,e):null}(e,t):-2===n?function(t,e,n){return n===as?Vi(as,e,t):n===ks?qi(ks,as,e,t):n===Rs?Hi(Rs,as,e,t):void 0}(t,e,r):un(t,t[1],n,e)}function ha(t,e,n,r){const i=e[19].queries[r];if(null===i.matches){const r=t.data,o=n.matches,s=[];for(let t=0;t<o.length;t+=2){const i=o[t];s.push(i<0?null:la(e,r[i],o[t+1],n.metadata.read))}i.matches=s}return i.matches}function da(t){const e=se(),n=ae(),r=ve();me(r+1);const i=ma(n,r);if(t.dirty&&Zt(e)===i.metadata.isStatic){if(null===i.matches)t.reset([]);else{const o=i.crossesNgTemplate?function t(e,n,r,i){const o=e.queries.getByIndex(r),s=o.matches;if(null!==s){const a=ha(e,n,o,r);for(let e=0;e<s.length;e+=2){const r=s[e];if(r>0)i.push(a[e/2]);else{const o=s[e+1],a=n[-r];for(let e=10;e<a.length;e++){const n=a[e];n[17]===n[3]&&t(n[1],n,o,i)}if(null!==a[9]){const e=a[9];for(let n=0;n<e.length;n++){const r=e[n];t(r[1],r,o,i)}}}}}return i}(n,e,r,[]):ha(n,e,i,r);t.reset(o),t.notifyOnChanges()}return!0}return!1}function fa(t,e,n){!function(t,e,n,r,i,o){t.firstCreatePass&&va(t,new sa(n,r,!1,i),-1),ya(t,e)}(ae(),se(),t,e,n)}function pa(t,e,n,r){!function(t,e,n,r,i,o,s,a){t.firstCreatePass&&(va(t,new sa(n,r,!1,i),s.index),function(t,e){const n=t.contentQueries||(t.contentQueries=[]);e!==(t.contentQueries.length?n[n.length-1]:-1)&&n.push(t.queries.length-1,e)}(t,a)),ya(t,e)}(ae(),se(),e,n,r,0,ue(),t)}function ga(){return t=se(),e=ve(),t[19].queries[e].queryList;var t,e}function ya(t,e){const n=new ra;qr(t,e,n,n.destroy),null===e[19]&&(e[19]=new oa),e[19].queries.push(new ia(n))}function va(t,e,n){null===t.queries&&(t.queries=new aa),t.queries.track(new ua(e,n))}function ma(t,e){return t.queries.getByIndex(e)}function ba(t=p.Default){const e=Bi(!0);if(null!=e||t&p.Optional)return e;throw new Error("No provider for ChangeDetectorRef!")}const _a=new z("Application Initializer");let wa=(()=>{class t{constructor(t){this.appInits=t,this.initialized=!1,this.done=!1,this.donePromise=new Promise((t,e)=>{this.resolve=t,this.reject=e})}runInitializers(){if(this.initialized)return;const t=[],e=()=>{this.done=!0,this.resolve()};if(this.appInits)for(let n=0;n<this.appInits.length;n++){const e=this.appInits[n]();So(e)&&t.push(e)}Promise.all(t).then(()=>{e()}).catch(t=>{this.reject(t)}),0===t.length&&e(),this.initialized=!0}}return t.\u0275fac=function(e){return new(e||t)(et(_a,8))},t.\u0275prov=v({token:t,factory:t.\u0275fac}),t})();const Ea=new z("AppId"),Oa={provide:Ea,useFactory:function(){return`${Ca()}${Ca()}${Ca()}`},deps:[]};function Ca(){return String.fromCharCode(97+Math.floor(25*Math.random()))}const Ta=new z("Platform Initializer"),Sa=new z("Platform ID"),Ia=new z("appBootstrapListener");let ja=(()=>{class t{log(t){console.log(t)}warn(t){console.warn(t)}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=v({token:t,factory:t.\u0275fac}),t})();const xa=new z("LocaleId"),Aa=new z("DefaultCurrencyCode");class ka{constructor(t,e){this.ngModuleFactory=t,this.componentFactories=e}}const Na=function(t){return new ta(t)},Ra=Na,Pa=function(t){return Promise.resolve(Na(t))},Da=function(t){const e=Na(t),n=Qe(At(t).declarations).reduce((t,e)=>{const n=jt(e);return n&&t.push(new Us(n)),t},[]);return new ka(e,n)},La=Da,Ma=function(t){return Promise.resolve(Da(t))};let Fa=(()=>{class t{constructor(){this.compileModuleSync=Ra,this.compileModuleAsync=Pa,this.compileModuleAndAllComponentsSync=La,this.compileModuleAndAllComponentsAsync=Ma}clearCache(){}clearCacheFor(t){}getModuleId(t){}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=v({token:t,factory:t.\u0275fac}),t})();const Ua=(()=>Promise.resolve(0))();function $a(t){"undefined"==typeof Zone?Ua.then(()=>{t&&t.apply(null,null)}):Zone.current.scheduleMicroTask("scheduleMicrotask",t)}class Va{constructor({enableLongStackTrace:t=!1,shouldCoalesceEventChangeDetection:e=!1}){if(this.hasPendingMacrotasks=!1,this.hasPendingMicrotasks=!1,this.isStable=!0,this.onUnstable=new ea(!1),this.onMicrotaskEmpty=new ea(!1),this.onStable=new ea(!1),this.onError=new ea(!1),"undefined"==typeof Zone)throw new Error("In this configuration Angular requires Zone.js");Zone.assertZonePatched(),this._nesting=0,this._outer=this._inner=Zone.current,Zone.wtfZoneSpec&&(this._inner=this._inner.fork(Zone.wtfZoneSpec)),Zone.TaskTrackingZoneSpec&&(this._inner=this._inner.fork(new Zone.TaskTrackingZoneSpec)),t&&Zone.longStackTraceZoneSpec&&(this._inner=this._inner.fork(Zone.longStackTraceZoneSpec)),this.shouldCoalesceEventChangeDetection=e,this.lastRequestAnimationFrameId=-1,this.nativeRequestAnimationFrame=function(){let t=M.requestAnimationFrame,e=M.cancelAnimationFrame;if("undefined"!=typeof Zone&&t&&e){const n=t[Zone.__symbol__("OriginalDelegate")];n&&(t=n);const r=e[Zone.__symbol__("OriginalDelegate")];r&&(e=r)}return{nativeRequestAnimationFrame:t,nativeCancelAnimationFrame:e}}().nativeRequestAnimationFrame,function(t){const e=!!t.shouldCoalesceEventChangeDetection&&t.nativeRequestAnimationFrame&&(()=>{!function(t){-1===t.lastRequestAnimationFrameId&&(t.lastRequestAnimationFrameId=t.nativeRequestAnimationFrame.call(M,()=>{t.fakeTopEventTask||(t.fakeTopEventTask=Zone.root.scheduleEventTask("fakeTopEventTask",()=>{t.lastRequestAnimationFrameId=-1,za(t),Ba(t)},void 0,()=>{},()=>{})),t.fakeTopEventTask.invoke()}),za(t))}(t)});t._inner=t._inner.fork({name:"angular",properties:{isAngularZone:!0,maybeDelayChangeDetection:e},onInvokeTask:(n,r,i,o,s,a)=>{try{return Wa(t),n.invokeTask(i,o,s,a)}finally{e&&"eventTask"===o.type&&e(),Ga(t)}},onInvoke:(e,n,r,i,o,s,a)=>{try{return Wa(t),e.invoke(r,i,o,s,a)}finally{Ga(t)}},onHasTask:(e,n,r,i)=>{e.hasTask(r,i),n===r&&("microTask"==i.change?(t._hasPendingMicrotasks=i.microTask,za(t),Ba(t)):"macroTask"==i.change&&(t.hasPendingMacrotasks=i.macroTask))},onHandleError:(e,n,r,i)=>(e.handleError(r,i),t.runOutsideAngular(()=>t.onError.emit(i)),!1)})}(this)}static isInAngularZone(){return!0===Zone.current.get("isAngularZone")}static assertInAngularZone(){if(!Va.isInAngularZone())throw new Error("Expected to be in Angular Zone, but it is not!")}static assertNotInAngularZone(){if(Va.isInAngularZone())throw new Error("Expected to not be in Angular Zone, but it is!")}run(t,e,n){return this._inner.run(t,e,n)}runTask(t,e,n,r){const i=this._inner,o=i.scheduleEventTask("NgZoneEvent: "+r,t,Ha,qa,qa);try{return i.runTask(o,e,n)}finally{i.cancelTask(o)}}runGuarded(t,e,n){return this._inner.runGuarded(t,e,n)}runOutsideAngular(t){return this._outer.run(t)}}function qa(){}const Ha={};function Ba(t){if(0==t._nesting&&!t.hasPendingMicrotasks&&!t.isStable)try{t._nesting++,t.onMicrotaskEmpty.emit(null)}finally{if(t._nesting--,!t.hasPendingMicrotasks)try{t.runOutsideAngular(()=>t.onStable.emit(null))}finally{t.isStable=!0}}}function za(t){t.hasPendingMicrotasks=!!(t._hasPendingMicrotasks||t.shouldCoalesceEventChangeDetection&&-1!==t.lastRequestAnimationFrameId)}function Wa(t){t._nesting++,t.isStable&&(t.isStable=!1,t.onUnstable.emit(null))}function Ga(t){t._nesting--,Ba(t)}class Qa{constructor(){this.hasPendingMicrotasks=!1,this.hasPendingMacrotasks=!1,this.isStable=!0,this.onUnstable=new ea,this.onMicrotaskEmpty=new ea,this.onStable=new ea,this.onError=new ea}run(t,e,n){return t.apply(e,n)}runGuarded(t,e,n){return t.apply(e,n)}runOutsideAngular(t){return t()}runTask(t,e,n,r){return t.apply(e,n)}}let Ka=(()=>{class t{constructor(t){this._ngZone=t,this._pendingCount=0,this._isZoneStable=!0,this._didWork=!1,this._callbacks=[],this.taskTrackingZone=null,this._watchAngularEvents(),t.run(()=>{this.taskTrackingZone="undefined"==typeof Zone?null:Zone.current.get("TaskTrackingZone")})}_watchAngularEvents(){this._ngZone.onUnstable.subscribe({next:()=>{this._didWork=!0,this._isZoneStable=!1}}),this._ngZone.runOutsideAngular(()=>{this._ngZone.onStable.subscribe({next:()=>{Va.assertNotInAngularZone(),$a(()=>{this._isZoneStable=!0,this._runCallbacksIfReady()})}})})}increasePendingRequestCount(){return this._pendingCount+=1,this._didWork=!0,this._pendingCount}decreasePendingRequestCount(){if(this._pendingCount-=1,this._pendingCount<0)throw new Error("pending async requests below zero");return this._runCallbacksIfReady(),this._pendingCount}isStable(){return this._isZoneStable&&0===this._pendingCount&&!this._ngZone.hasPendingMacrotasks}_runCallbacksIfReady(){if(this.isStable())$a(()=>{for(;0!==this._callbacks.length;){let t=this._callbacks.pop();clearTimeout(t.timeoutId),t.doneCb(this._didWork)}this._didWork=!1});else{let t=this.getPendingTasks();this._callbacks=this._callbacks.filter(e=>!e.updateCb||!e.updateCb(t)||(clearTimeout(e.timeoutId),!1)),this._didWork=!0}}getPendingTasks(){return this.taskTrackingZone?this.taskTrackingZone.macroTasks.map(t=>({source:t.source,creationLocation:t.creationLocation,data:t.data})):[]}addCallback(t,e,n){let r=-1;e&&e>0&&(r=setTimeout(()=>{this._callbacks=this._callbacks.filter(t=>t.timeoutId!==r),t(this._didWork,this.getPendingTasks())},e)),this._callbacks.push({doneCb:t,timeoutId:r,updateCb:n})}whenStable(t,e,n){if(n&&!this.taskTrackingZone)throw new Error('Task tracking zone is required when passing an update callback to whenStable(). Is "zone.js/dist/task-tracking.js" loaded?');this.addCallback(t,e,n),this._runCallbacksIfReady()}getPendingRequestCount(){return this._pendingCount}findProviders(t,e,n){return[]}}return t.\u0275fac=function(e){return new(e||t)(et(Va))},t.\u0275prov=v({token:t,factory:t.\u0275fac}),t})(),Xa=(()=>{class t{constructor(){this._applications=new Map,tu.addToWindow(this)}registerApplication(t,e){this._applications.set(t,e)}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,e=!0){return tu.findTestabilityInTree(this,t,e)}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=v({token:t,factory:t.\u0275fac}),t})();class Ya{addToWindow(t){}findTestabilityInTree(t,e,n){return null}}function Ja(t){tu=t}let Za,tu=new Ya;const eu=new z("AllowMultipleToken");class nu{constructor(t,e){this.name=t,this.token=e}}function ru(t,e,n=[]){const r="Platform: "+e,i=new z(r);return(e=[])=>{let o=iu();if(!o||o.injector.get(eu,!1))if(t)t(n.concat(e).concat({provide:i,useValue:!0}));else{const t=n.concat(e).concat({provide:i,useValue:!0},{provide:Qi,useValue:"platform"});!function(t){if(Za&&!Za.destroyed&&!Za.injector.get(eu,!1))throw new Error("There can be only one platform. Destroy the previous one to create a new one.");Za=t.get(ou);const e=t.get(Ta,null);e&&e.forEach(t=>t())}(uo.create({providers:t,name:r}))}return function(t){const e=iu();if(!e)throw new Error("No platform exists!");if(!e.injector.get(t,null))throw new Error("A platform with a different configuration has been created. Please destroy it first.");return e}(i)}}function iu(){return Za&&!Za.destroyed?Za:null}let ou=(()=>{class t{constructor(t){this._injector=t,this._modules=[],this._destroyListeners=[],this._destroyed=!1}bootstrapModuleFactory(t,e){const n=function(t,e){let n;return n="noop"===t?new Qa:("zone.js"===t?void 0:t)||new Va({enableLongStackTrace:Pn(),shouldCoalesceEventChangeDetection:e}),n}(e?e.ngZone:void 0,e&&e.ngZoneEventCoalescing||!1),r=[{provide:Va,useValue:n}];return n.run(()=>{const e=uo.create({providers:r,parent:this.injector,name:t.moduleType.name}),i=t.create(e),o=i.injector.get(vn,null);if(!o)throw new Error("No ErrorHandler. Is platform module (BrowserModule) included?");return i.onDestroy(()=>uu(this._modules,i)),n.runOutsideAngular(()=>n.onError.subscribe({next:t=>{o.handleError(t)}})),function(t,e,n){try{const r=n();return So(r)?r.catch(n=>{throw e.runOutsideAngular(()=>t.handleError(n)),n}):r}catch(r){throw e.runOutsideAngular(()=>t.handleError(r)),r}}(o,n,()=>{const t=i.injector.get(wa);return t.runInitializers(),t.donePromise.then(()=>(Ys(i.injector.get(xa,"en-US")||"en-US"),this._moduleDoBootstrap(i),i))})})}bootstrapModule(t,e=[]){const n=su({},e);return function(t,e,n){const r=new ta(n);return Promise.resolve(r)}(0,0,t).then(t=>this.bootstrapModuleFactory(t,n))}_moduleDoBootstrap(t){const e=t.injector.get(au);if(t._bootstrapComponents.length>0)t._bootstrapComponents.forEach(t=>e.bootstrap(t));else{if(!t.instance.ngDoBootstrap)throw new Error(`The module ${I(t.instance.constructor)} was bootstrapped, but it does not declare "@NgModule.bootstrap" components nor a "ngDoBootstrap" method. Please define one of these.`);t.instance.ngDoBootstrap(e)}this._modules.push(t)}onDestroy(t){this._destroyListeners.push(t)}get injector(){return this._injector}destroy(){if(this._destroyed)throw new Error("The platform has already been destroyed!");this._modules.slice().forEach(t=>t.destroy()),this._destroyListeners.forEach(t=>t()),this._destroyed=!0}get destroyed(){return this._destroyed}}return t.\u0275fac=function(e){return new(e||t)(et(uo))},t.\u0275prov=v({token:t,factory:t.\u0275fac}),t})();function su(t,e){return Array.isArray(e)?e.reduce(su,t):Object.assign(Object.assign({},t),e)}let au=(()=>{class t{constructor(t,e,n,r,i,u){this._zone=t,this._console=e,this._injector=n,this._exceptionHandler=r,this._componentFactoryResolver=i,this._initStatus=u,this._bootstrapListeners=[],this._views=[],this._runningTick=!1,this._enforceNoNewChanges=!1,this._stable=!0,this.componentTypes=[],this.components=[],this._enforceNoNewChanges=Pn(),this._zone.onMicrotaskEmpty.subscribe({next:()=>{this._zone.run(()=>{this.tick()})}});const c=new o.a(t=>{this._stable=this._zone.isStable&&!this._zone.hasPendingMacrotasks&&!this._zone.hasPendingMicrotasks,this._zone.runOutsideAngular(()=>{t.next(this._stable),t.complete()})}),l=new o.a(t=>{let e;this._zone.runOutsideAngular(()=>{e=this._zone.onStable.subscribe(()=>{Va.assertNotInAngularZone(),$a(()=>{this._stable||this._zone.hasPendingMacrotasks||this._zone.hasPendingMicrotasks||(this._stable=!0,t.next(!0))})})});const n=this._zone.onUnstable.subscribe(()=>{Va.assertInAngularZone(),this._stable&&(this._stable=!1,this._zone.runOutsideAngular(()=>{t.next(!1)}))});return()=>{e.unsubscribe(),n.unsubscribe()}});this.isStable=Object(s.a)(c,l.pipe(Object(a.a)()))}bootstrap(t,e){if(!this._initStatus.done)throw new Error("Cannot bootstrap as there are still asynchronous initializers running. Bootstrap components in the `ngDoBootstrap` method of the root module.");let n;n=t instanceof is?t:this._componentFactoryResolver.resolveComponentFactory(t),this.componentTypes.push(n.componentType);const r=n.isBoundToModule?void 0:this._injector.get(ot),i=n.create(uo.NULL,[],e||n.selector,r);i.onDestroy(()=>{this._unloadComponent(i)});const o=i.injector.get(Ka,null);return o&&i.injector.get(Xa).registerApplication(i.location.nativeElement,o),this._loadComponent(i),Pn()&&this._console.log("Angular is running in development mode. Call enableProdMode() to enable production mode."),i}tick(){if(this._runningTick)throw new Error("ApplicationRef.tick is called recursively");try{this._runningTick=!0;for(let t of this._views)t.detectChanges();if(this._enforceNoNewChanges)for(let t of this._views)t.checkNoChanges()}catch(t){this._zone.runOutsideAngular(()=>this._exceptionHandler.handleError(t))}finally{this._runningTick=!1}}attachView(t){const e=t;this._views.push(e),e.attachToAppRef(this)}detachView(t){const e=t;uu(this._views,e),e.detachFromAppRef()}_loadComponent(t){this.attachView(t.hostView),this.tick(),this.components.push(t),this._injector.get(Ia,[]).concat(this._bootstrapListeners).forEach(e=>e(t))}_unloadComponent(t){this.detachView(t.hostView),uu(this.components,t)}ngOnDestroy(){this._views.slice().forEach(t=>t.destroy())}get viewCount(){return this._views.length}}return t.\u0275fac=function(e){return new(e||t)(et(Va),et(ja),et(uo),et(vn),et(ss),et(wa))},t.\u0275prov=v({token:t,factory:t.\u0275fac}),t})();function uu(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}class cu{}class lu{}const hu={factoryPathPrefix:"",factoryPathSuffix:".ngfactory"};let du=(()=>{class t{constructor(t,e){this._compiler=t,this._config=e||hu}load(t){return this.loadAndCompile(t)}loadAndCompile(t){let[e,r]=t.split("#");return void 0===r&&(r="default"),n("zn8P")(e).then(t=>t[r]).then(t=>fu(t,e,r)).then(t=>this._compiler.compileModuleAsync(t))}loadFactory(t){let[e,r]=t.split("#"),i="NgFactory";return void 0===r&&(r="default",i=""),n("zn8P")(this._config.factoryPathPrefix+e+this._config.factoryPathSuffix).then(t=>t[r+i]).then(t=>fu(t,e,r))}}return t.\u0275fac=function(e){return new(e||t)(et(Fa),et(lu,8))},t.\u0275prov=v({token:t,factory:t.\u0275fac}),t})();function fu(t,e,n){if(!t)throw new Error(`Cannot find '${n}' in '${e}'`);return t}const pu=function(t){return null},gu=ru(null,"core",[{provide:Sa,useValue:"unknown"},{provide:ou,deps:[uo]},{provide:Xa,deps:[]},{provide:ja,deps:[]}]),yu=[{provide:au,useClass:au,deps:[Va,ja,uo,vn,ss,wa]},{provide:Fs,deps:[Va],useFactory:function(t){let e=[];return t.onStable.subscribe(()=>{for(;e.length;)e.pop()()}),function(t){e.push(t)}}},{provide:wa,useClass:wa,deps:[[new h,_a]]},{provide:Fa,useClass:Fa,deps:[]},Oa,{provide:Ss,useFactory:function(){return xs},deps:[]},{provide:Is,useFactory:function(){return As},deps:[]},{provide:xa,useFactory:function(t){return Ys(t=t||"undefined"!=typeof $localize&&$localize.locale||"en-US"),t},deps:[[new l(xa),new h,new f]]},{provide:Aa,useValue:"USD"}];let vu=(()=>{class t{constructor(t){}}return t.\u0275mod=Ot({type:t}),t.\u0275inj=m({factory:function(e){return new(e||t)(et(au))},providers:yu}),t})()},fYWy:function(t,e,n){"use strict";n.d(e,"a",(function(){return i})),n.d(e,"b",(function(){return o})),n.d(e,"c",(function(){return s})),n.d(e,"d",(function(){return a})),n.d(e,"e",(function(){return u})),n.d(e,"f",(function(){return O})),n.d(e,"g",(function(){return S})),n.d(e,"h",(function(){return w})),n.d(e,"i",(function(){return C})),n.d(e,"j",(function(){return c}));var r=n("A36C");const i="ionViewWillEnter",o="ionViewDidEnter",s="ionViewWillLeave",a="ionViewDidLeave",u="ionViewWillUnload",c=t=>new Promise((e,n)=>{Object(r.f)(()=>{l(t),h(t).then(n=>{n.animation&&n.animation.destroy(),d(t),e(n)},e=>{d(t),n(e)})})}),l=t=>{const e=t.enteringEl,n=t.leavingEl;T(e,n,t.direction),t.showGoBack?e.classList.add("can-go-back"):e.classList.remove("can-go-back"),C(e,!1),n&&C(n,!1)},h=async t=>{const e=await f(t);return e&&r.a.isBrowser?p(e,t):g(t)},d=t=>{const e=t.leavingEl;t.enteringEl.classList.remove("ion-page-invisible"),void 0!==e&&e.classList.remove("ion-page-invisible")},f=async t=>{if(t.leavingEl&&t.animated&&0!==t.duration)return t.animationBuilder?t.animationBuilder:"ios"===t.mode?(await Promise.resolve().then(n.bind(null,"k9ne"))).iosTransitionAnimation:(await Promise.resolve().then(n.bind(null,"6pL8"))).mdTransitionAnimation},p=async(t,e)=>{await y(e,!0);const n=t(e.baseEl,e);b(e.enteringEl,e.leavingEl);const r=await m(n,e);return e.progressCallback&&e.progressCallback(void 0),r&&_(e.enteringEl,e.leavingEl),{hasCompleted:r,animation:n}},g=async t=>{const e=t.enteringEl,n=t.leavingEl;return await y(t,!1),b(e,n),_(e,n),{hasCompleted:!0}},y=async(t,e)=>{const n=(void 0!==t.deepWait?t.deepWait:e)?[O(t.enteringEl),O(t.leavingEl)]:[E(t.enteringEl),E(t.leavingEl)];await Promise.all(n),await v(t.viewIsReady,t.enteringEl)},v=async(t,e)=>{t&&await t(e)},m=(t,e)=>{const n=e.progressCallback,r=new Promise(e=>{t.onFinish(t=>e(1===t))});return n?(t.progressStart(!0),n(t)):t.play(),r},b=(t,e)=>{w(e,s),w(t,i)},_=(t,e)=>{w(t,o),w(e,a)},w=(t,e)=>{if(t){const n=new CustomEvent(e,{bubbles:!1,cancelable:!1});t.dispatchEvent(n)}},E=t=>t&&t.componentOnReady?t.componentOnReady():Promise.resolve(),O=async t=>{const e=t;if(e){if(null!=e.componentOnReady&&null!=await e.componentOnReady())return;await Promise.all(Array.from(e.children).map(O))}},C=(t,e)=>{e?(t.setAttribute("aria-hidden","true"),t.classList.add("ion-page-hidden")):(t.hidden=!1,t.removeAttribute("aria-hidden"),t.classList.remove("ion-page-hidden"))},T=(t,e,n)=>{void 0!==t&&(t.style.zIndex="back"===n?"99":"101"),void 0!==e&&(e.style.zIndex="100")},S=t=>t.classList.contains("ion-page")?t:t.querySelector(":scope > .ion-page, :scope > ion-nav, :scope > ion-tabs")||t},gRHU:function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n("2fFW"),i=n("NJ4a");const o={closed:!0,next(t){},error(t){if(r.a.useDeprecatedSynchronousErrorHandling)throw t;Object(i.a)(t)},complete(){}}},iWo5:function(t,e,n){"use strict";n.r(e),n.d(e,"createGesture",(function(){return u}));var r=n("y08P");n.d(e,"GESTURE_CONTROLLER",(function(){return r.a}));const i=(t,e,n,r)=>{const i=o(t)?{capture:!!r.capture,passive:!!r.passive}:!!r.capture;let s,a;return t.__zone_symbol__addEventListener?(s="__zone_symbol__addEventListener",a="__zone_symbol__removeEventListener"):(s="addEventListener",a="removeEventListener"),t[s](e,n,i),()=>{t[a](e,n,i)}},o=t=>{if(void 0===s)try{const e=Object.defineProperty({},"passive",{get:()=>{s=!0}});t.addEventListener("optsTest",()=>{},e)}catch(e){s=!1}return!!s};let s;const a=t=>t instanceof Document?t:t.ownerDocument,u=t=>{let e=!1,n=!1,o=!0,s=!1;const u=Object.assign({disableScroll:!1,direction:"x",gesturePriority:0,passive:!0,maxAngle:40,threshold:10},t),d=u.canStart,f=u.onWillStart,p=u.onStart,g=u.onEnd,y=u.notCaptured,v=u.onMove,m=u.threshold,b=u.passive,_=u.blurOnStart,w={type:"pan",startX:0,startY:0,startTime:0,currentX:0,currentY:0,velocityX:0,velocityY:0,deltaX:0,deltaY:0,currentTime:0,event:void 0,data:void 0},E=((t,e,n)=>{const r=n*(Math.PI/180),i="x"===t,o=Math.cos(r),s=e*e;let a=0,u=0,c=!1,l=0;return{start(t,e){a=t,u=e,l=0,c=!0},detect(t,e){if(!c)return!1;const n=t-a,r=e-u,h=n*n+r*r;if(h<s)return!1;const d=Math.sqrt(h),f=(i?n:r)/d;return l=f>o?1:f<-o?-1:0,c=!1,!0},isGesture:()=>0!==l,getDirection:()=>l}})(u.direction,u.threshold,u.maxAngle),O=r.a.createGesture({name:t.gestureName,priority:t.gesturePriority,disableScroll:t.disableScroll}),C=()=>{e&&(s=!1,v&&v(w))},T=()=>!(O&&!O.capture()||(e=!0,o=!1,w.startX=w.currentX,w.startY=w.currentY,w.startTime=w.currentTime,f?f(w).then(S):S(),0)),S=()=>{_&&(()=>{if("undefined"!=typeof document){const t=document.activeElement;null!==t&&t.blur&&t.blur()}})(),p&&p(w),o=!0},I=()=>{e=!1,n=!1,s=!1,o=!0,O.release()},j=t=>{const n=e,r=o;I(),r&&(c(w,t),n?g&&g(w):y&&y(w))},x=((t,e,n,r,o)=>{let s,u,c,l,h,d,f,p=0;const g=r=>{p=Date.now()+2e3,e(r)&&(!u&&n&&(u=i(t,"touchmove",n,o)),c||(c=i(t,"touchend",v,o)),l||(l=i(t,"touchcancel",v,o)))},y=r=>{p>Date.now()||e(r)&&(!d&&n&&(d=i(a(t),"mousemove",n,o)),f||(f=i(a(t),"mouseup",m,o)))},v=t=>{b(),r&&r(t)},m=t=>{_(),r&&r(t)},b=()=>{u&&u(),c&&c(),l&&l(),u=c=l=void 0},_=()=>{d&&d(),f&&f(),d=f=void 0},w=()=>{b(),_()},E=(e=!0)=>{e?(s||(s=i(t,"touchstart",g,o)),h||(h=i(t,"mousedown",y,o))):(s&&s(),h&&h(),s=h=void 0,w())};return{enable:E,stop:w,destroy:()=>{E(!1),r=n=e=void 0}}})(u.el,t=>{const e=h(t);return!(n||!o)&&(l(t,w),w.startX=w.currentX,w.startY=w.currentY,w.startTime=w.currentTime=e,w.velocityX=w.velocityY=w.deltaX=w.deltaY=0,w.event=t,(!d||!1!==d(w))&&(O.release(),!!O.start()&&(n=!0,0===m?T():(E.start(w.startX,w.startY),!0))))},t=>{e?!s&&o&&(s=!0,c(w,t),requestAnimationFrame(C)):(c(w,t),E.detect(w.currentX,w.currentY)&&(E.isGesture()&&T()||A()))},j,{capture:!1,passive:b}),A=()=>{I(),x.stop(),y&&y(w)};return{enable(t=!0){t||(e&&j(void 0),I()),x.enable(t)},destroy(){O.destroy(),x.destroy()}}},c=(t,e)=>{if(!e)return;const n=t.currentX,r=t.currentY,i=t.currentTime;l(e,t);const o=t.currentX,s=t.currentY,a=(t.currentTime=h(e))-i;if(a>0&&a<100){const e=(s-r)/a;t.velocityX=(o-n)/a*.7+.3*t.velocityX,t.velocityY=.7*e+.3*t.velocityY}t.deltaX=o-t.startX,t.deltaY=s-t.startY,t.event=e},l=(t,e)=>{let n=0,r=0;if(t){const e=t.changedTouches;if(e&&e.length>0){const t=e[0];n=t.clientX,r=t.clientY}else void 0!==t.pageX&&(n=t.pageX,r=t.pageY)}e.currentX=n,e.currentY=r},h=t=>t.timeStamp||Date.now()},jJkw:function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var r=n("Zgba"),i=n("btv9"),o=n("8RMS");const s=t=>Object(i.a)().duration(t?400:300),a=t=>{let e,n;const o=t.width+8,a=Object(i.a)(),u=Object(i.a)();t.isEndSide?(e=o+"px",n="0px"):(e=-o+"px",n="0px"),a.addElement(t.menuInnerEl).fromTo("transform",`translateX(${e})`,`translateX(${n})`);const c="ios"===Object(r.b)(t),l=c?.2:.25;return u.addElement(t.backdropEl).fromTo("opacity",.01,l),s(c).addAnimation([a,u])},u=t=>{let e,n;const o=Object(r.b)(t),a=t.width;t.isEndSide?(e=-a+"px",n=a+"px"):(e=a+"px",n=-a+"px");const u=Object(i.a)().addElement(t.menuInnerEl).fromTo("transform",`translateX(${n})`,"translateX(0px)"),c=Object(i.a)().addElement(t.contentEl).fromTo("transform","translateX(0px)",`translateX(${e})`),l=Object(i.a)().addElement(t.backdropEl).fromTo("opacity",.01,.32);return s("ios"===o).addAnimation([u,c,l])},c=t=>{const e=Object(r.b)(t),n=t.width*(t.isEndSide?-1:1)+"px",o=Object(i.a)().addElement(t.contentEl).fromTo("transform","translateX(0px)",`translateX(${n})`);return s("ios"===e).addAnimation(o)},l=(()=>{const t=new Map,e=[],n=async t=>(await f(),"start"===t||"end"===t?d(e=>e.side===t&&!e.disabled)||d(e=>e.side===t):null!=t?d(e=>e.menuId===t):d(t=>!t.disabled)||(e.length>0?e[0].el:void 0)),r=async()=>(await f(),l()),i=(e,n)=>{t.set(e,n)},s=t=>{const n=t.side;e.filter(e=>e.side===n&&e!==t).forEach(t=>t.disabled=!0)},l=()=>d(t=>t._isOpen),h=()=>e.some(t=>t.isAnimating),d=t=>{const n=e.find(t);if(void 0!==n)return n.el},f=()=>Promise.all(Array.from(document.querySelectorAll("ion-menu")).map(t=>t.componentOnReady()));return i("reveal",c),i("push",u),i("overlay",a),"undefined"!=typeof document&&document.addEventListener("ionBackButton",t=>{const e=l();e&&t.detail.register(o.MENU_BACK_BUTTON_PRIORITY,()=>e.close())}),{registerAnimation:i,get:n,getMenus:async()=>(await f(),e.map(t=>t.el)),getOpen:r,isEnabled:async t=>{const e=await n(t);return!!e&&!e.disabled},swipeGesture:async(t,e)=>{const r=await n(e);return r&&(r.swipeGesture=t),r},isAnimating:async()=>(await f(),h()),isOpen:async t=>{if(null!=t){const e=await n(t);return void 0!==e&&e.isOpen()}return void 0!==await r()},enable:async(t,e)=>{const r=await n(e);return r&&(r.disabled=!t),r},toggle:async t=>{const e=await n(t);return!!e&&e.toggle()},close:async t=>{const e=await(void 0!==t?n(t):r());return void 0!==e&&e.close()},open:async t=>{const e=await n(t);return!!e&&e.open()},_getOpenSync:l,_createAnimation:(e,n)=>{const r=t.get(e);if(!r)throw new Error("animation not registered");return r(n)},_register:t=>{e.indexOf(t)<0&&(t.disabled||s(t),e.push(t))},_unregister:t=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},_setOpen:async(t,e,n)=>{if(h())return!1;if(e){const e=await r();e&&t.el!==e&&await e.setOpen(!1,!1)}return t._setOpen(e,n)},_setActiveMenu:s}})()},jZKg:function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n("HDdC"),i=n("quSY");function o(t,e){return new r.a(n=>{const r=new i.a;let o=0;return r.add(e.schedule((function(){o!==t.length?(n.next(t[o++]),n.closed||r.add(this.schedule())):n.complete()}))),r})}},k9ne:function(t,e,n){"use strict";n.r(e),n.d(e,"iosTransitionAnimation",(function(){return h})),n.d(e,"shadow",(function(){return s})),n("A36C"),n("OMvp");var r=n("btv9"),i=n("fYWy");const o=t=>document.querySelector(t+".ion-cloned-element"),s=t=>t.shadowRoot||t,a=t=>{const e="ION-TABS"===t.tagName?t:t.querySelector("ion-tabs"),n="ion-header:not(.header-collapse-condense-inactive) ion-title.title-large";if(null!=e){const t=e.querySelector("ion-tab:not(.tab-hidden), .ion-page:not(.ion-page-hidden)");return null!=t?t.querySelector(n):null}return t.querySelector(n)},u=(t,e)=>{const n="ION-TABS"===t.tagName?t:t.querySelector("ion-tabs");let r=[];if(null!=n){const t=n.querySelector("ion-tab:not(.tab-hidden), .ion-page:not(.ion-page-hidden)");null!=t&&(r=t.querySelectorAll("ion-buttons"))}else r=t.querySelectorAll("ion-buttons");for(const i of r){const t=i.closest("ion-header"),n=t&&!t.classList.contains("header-collapse-condense-inactive"),r=i.querySelector("ion-back-button"),o=i.classList.contains("buttons-collapse"),s="start"===i.slot||""===i.slot;if(null!==r&&s&&(o&&n&&e||!o))return r}return null},c=(t,e,n,i,a,u)=>{const c=e?`calc(100% - ${u.right+4}px)`:u.left-4+"px",l=e?"7px":"-7px",h=e?"-4px":"4px",d=e?"-4px":"4px",f=e?"right":"left",p=e?"left":"right",g=n?[{offset:0,opacity:1,transform:`translate3d(${h}, ${u.top-46}px, 0) scale(1)`},{offset:.6,opacity:0},{offset:1,opacity:0,transform:`translate3d(${l}, ${a.top-40}px, 0) scale(2.1)`}]:[{offset:0,opacity:0,transform:`translate3d(${l}, ${a.top-40}px, 0) scale(2.1)`},{offset:1,opacity:1,transform:`translate3d(${h}, ${u.top-46}px, 0) scale(1)`}],y=n?[{offset:0,opacity:1,transform:`translate3d(${d}, ${u.top-46}px, 0) scale(1)`},{offset:.2,opacity:0,transform:`translate3d(${d}, ${u.top-41}px, 0) scale(0.6)`},{offset:1,opacity:0,transform:`translate3d(${d}, ${u.top-41}px, 0) scale(0.6)`}]:[{offset:0,opacity:0,transform:`translate3d(${d}, ${u.top-41}px, 0) scale(0.6)`},{offset:1,opacity:1,transform:`translate3d(${d}, ${u.top-46}px, 0) scale(1)`}],v=Object(r.a)(),m=Object(r.a)(),b=o("ion-back-button"),_=s(b).querySelector(".button-text"),w=s(b).querySelector("ion-icon");b.text=i.text,b.mode=i.mode,b.icon=i.icon,b.color=i.color,b.disabled=i.disabled,b.style.setProperty("display","block"),b.style.setProperty("position","fixed"),m.addElement(w),v.addElement(_),v.beforeStyles({"transform-origin":f+" center"}).beforeAddWrite(()=>{i.style.setProperty("display","none"),b.style.setProperty(f,c)}).afterAddWrite(()=>{i.style.setProperty("display",""),b.style.setProperty("display","none"),b.style.removeProperty(f)}).keyframes(g),m.beforeStyles({"transform-origin":p+" center"}).keyframes(y),t.addAnimation([v,m])},l=(t,e,n,i,s,a)=>{const u=e?`calc(100% - ${s.right}px)`:s.left+"px",c=e?"-18px":"18px",l=e?"right":"left",h=n?[{offset:0,opacity:0,transform:`translate3d(${c}, ${a.top-4}px, 0) scale(0.49)`},{offset:.1,opacity:0},{offset:1,opacity:1,transform:`translate3d(0, ${s.top-2}px, 0) scale(1)`}]:[{offset:0,opacity:.99,transform:`translate3d(0, ${s.top-2}px, 0) scale(1)`},{offset:.6,opacity:0},{offset:1,opacity:0,transform:`translate3d(${c}, ${a.top-4}px, 0) scale(0.5)`}],d=o("ion-title"),f=Object(r.a)();d.innerText=i.innerText,d.size=i.size,d.color=i.color,f.addElement(d),f.beforeStyles({"transform-origin":l+" center",height:"46px",display:"",position:"relative",[l]:u}).beforeAddWrite(()=>{i.style.setProperty("display","none")}).afterAddWrite(()=>{i.style.setProperty("display",""),d.style.setProperty("display","none")}).keyframes(h),t.addAnimation(f)},h=(t,e)=>{try{const n="cubic-bezier(0.32,0.72,0,1)",o="opacity",h="transform",d="0%",f=.8,p="rtl"===t.ownerDocument.dir,g=p?"-99.5%":"99.5%",y=p?"33%":"-33%",v=e.enteringEl,m=e.leavingEl,b="back"===e.direction,_=v.querySelector(":scope > ion-content"),w=v.querySelectorAll(":scope > ion-header > *:not(ion-toolbar), :scope > ion-footer > *"),E=v.querySelectorAll(":scope > ion-header > ion-toolbar"),O=Object(r.a)(),C=Object(r.a)();if(O.addElement(v).duration(e.duration||540).easing(e.easing||n).fill("both").beforeRemoveClass("ion-page-invisible"),m&&t){const e=Object(r.a)();e.addElement(t),O.addAnimation(e)}if(_||0!==E.length||0!==w.length?(C.addElement(_),C.addElement(w)):C.addElement(v.querySelector(":scope > .ion-page, :scope > ion-nav, :scope > ion-tabs")),O.addAnimation(C),b?C.beforeClearStyles([o]).fromTo("transform",`translateX(${y})`,`translateX(${d})`).fromTo(o,f,1):C.beforeClearStyles([o]).fromTo("transform",`translateX(${g})`,`translateX(${d})`),_){const t=s(_).querySelector(".transition-effect");if(t){const e=t.querySelector(".transition-cover"),n=t.querySelector(".transition-shadow"),i=Object(r.a)(),s=Object(r.a)(),a=Object(r.a)();i.addElement(t).beforeStyles({opacity:"1",display:"block"}).afterStyles({opacity:"",display:""}),s.addElement(e).beforeClearStyles([o]).fromTo(o,0,.1),a.addElement(n).beforeClearStyles([o]).fromTo(o,.03,.7),i.addAnimation([s,a]),C.addAnimation([i])}}const T=v.querySelector("ion-header.header-collapse-condense"),{forward:S,backward:I}=((t,e,n,r,i)=>{const o=u(r,n),s=a(i),h=a(r),d=u(i,n),f=null!==o&&null!==s&&!n,p=null!==h&&null!==d&&n;if(f){const r=s.getBoundingClientRect(),i=o.getBoundingClientRect();l(t,e,n,s,r,i),c(t,e,n,o,r,i)}else if(p){const r=h.getBoundingClientRect(),i=d.getBoundingClientRect();l(t,e,n,h,r,i),c(t,e,n,d,r,i)}return{forward:f,backward:p}})(O,p,b,v,m);if(E.forEach(t=>{const e=Object(r.a)();e.addElement(t),O.addAnimation(e);const n=Object(r.a)();n.addElement(t.querySelector("ion-title"));const i=Object(r.a)(),a=Array.from(t.querySelectorAll("ion-buttons,[menuToggle]")),u=t.closest("ion-header"),c=u&&u.classList.contains("header-collapse-condense-inactive");let l;l=a.filter(b?t=>{const e=t.classList.contains("buttons-collapse");return e&&!c||!e}:t=>!t.classList.contains("buttons-collapse")),i.addElement(l);const h=Object(r.a)();h.addElement(t.querySelectorAll(":scope > *:not(ion-title):not(ion-buttons):not([menuToggle])"));const f=Object(r.a)();f.addElement(s(t).querySelector(".toolbar-background"));const v=Object(r.a)(),m=t.querySelector("ion-back-button");if(m&&v.addElement(m),e.addAnimation([n,i,h,f,v]),i.fromTo(o,.01,1),h.fromTo(o,.01,1),b)c||n.fromTo("transform",`translateX(${y})`,`translateX(${d})`).fromTo(o,.01,1),h.fromTo("transform",`translateX(${y})`,`translateX(${d})`),v.fromTo(o,.01,1);else if(T||n.fromTo("transform",`translateX(${g})`,`translateX(${d})`).fromTo(o,.01,1),h.fromTo("transform",`translateX(${g})`,`translateX(${d})`),f.beforeClearStyles([o,"transform"]),(null==u?void 0:u.translucent)?f.fromTo("transform",p?"translateX(-100%)":"translateX(100%)","translateX(0px)"):f.fromTo(o,.01,"var(--opacity)"),S||v.fromTo(o,.01,1),m&&!S){const t=Object(r.a)();t.addElement(s(m).querySelector(".button-text")).fromTo("transform",p?"translateX(-100px)":"translateX(100px)","translateX(0px)"),e.addAnimation(t)}}),m){const t=Object(r.a)(),e=m.querySelector(":scope > ion-content"),n=m.querySelectorAll(":scope > ion-header > ion-toolbar"),a=m.querySelectorAll(":scope > ion-header > *:not(ion-toolbar), :scope > ion-footer > *");if(e||0!==n.length||0!==a.length?(t.addElement(e),t.addElement(a)):t.addElement(m.querySelector(":scope > .ion-page, :scope > ion-nav, :scope > ion-tabs")),O.addAnimation(t),b){t.beforeClearStyles([o]).fromTo("transform",`translateX(${d})`,p?"translateX(-100%)":"translateX(100%)");const e=Object(i.g)(m);O.afterAddWrite(()=>{"normal"===O.getDirection()&&e.style.setProperty("display","none")})}else t.fromTo("transform",`translateX(${d})`,`translateX(${y})`).fromTo(o,1,f);if(e){const n=s(e).querySelector(".transition-effect");if(n){const e=n.querySelector(".transition-cover"),i=n.querySelector(".transition-shadow"),s=Object(r.a)(),a=Object(r.a)(),u=Object(r.a)();s.addElement(n).beforeStyles({opacity:"1",display:"block"}).afterStyles({opacity:"",display:""}),a.addElement(e).beforeClearStyles([o]).fromTo(o,.1,0),u.addElement(i).beforeClearStyles([o]).fromTo(o,.7,.03),s.addAnimation([a,u]),t.addAnimation([s])}}n.forEach(t=>{const e=Object(r.a)();e.addElement(t);const n=Object(r.a)();n.addElement(t.querySelector("ion-title"));const i=Object(r.a)(),a=t.querySelectorAll("ion-buttons,[menuToggle]"),u=t.closest("ion-header"),c=u&&u.classList.contains("header-collapse-condense-inactive"),l=Array.from(a).filter(t=>{const e=t.classList.contains("buttons-collapse");return e&&!c||!e});i.addElement(l);const f=Object(r.a)(),g=t.querySelectorAll(":scope > *:not(ion-title):not(ion-buttons):not([menuToggle])");g.length>0&&f.addElement(g);const v=Object(r.a)();v.addElement(s(t).querySelector(".toolbar-background"));const m=Object(r.a)(),_=t.querySelector("ion-back-button");if(_&&m.addElement(_),e.addAnimation([n,i,f,m,v]),O.addAnimation(e),m.fromTo(o,.99,0),i.fromTo(o,.99,0),f.fromTo(o,.99,0),b){if(c||n.fromTo("transform",`translateX(${d})`,p?"translateX(-100%)":"translateX(100%)").fromTo(o,.99,0),f.fromTo("transform",`translateX(${d})`,p?"translateX(-100%)":"translateX(100%)"),v.beforeClearStyles([o,"transform"]),(null==u?void 0:u.translucent)?v.fromTo("transform","translateX(0px)",p?"translateX(-100%)":"translateX(100%)"):v.fromTo(o,"var(--opacity)",0),_&&!I){const t=Object(r.a)();t.addElement(s(_).querySelector(".button-text")).fromTo("transform",`translateX(${d})`,`translateX(${(p?-124:124)+"px"})`),e.addAnimation(t)}}else c||n.fromTo("transform",`translateX(${d})`,`translateX(${y})`).fromTo(o,.99,0).afterClearStyles([h,o]),f.fromTo("transform",`translateX(${d})`,`translateX(${y})`).afterClearStyles([h,o]),m.afterClearStyles([o]),n.afterClearStyles([o]),i.afterClearStyles([o])})}return O}catch(n){throw n}}},kJWO:function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));const r=(()=>"function"==typeof Symbol&&Symbol.observable||"@@observable")()},kLfG:function(t,e,n){var r={"./ion-action-sheet.entry.js":["dUtr",0,16],"./ion-alert.entry.js":["Q8AI",0,17],"./ion-app_8.entry.js":["hgI1",0,18],"./ion-avatar_3.entry.js":["CfoV",0,19],"./ion-back-button.entry.js":["Nt02",0,20],"./ion-backdrop.entry.js":["Q2Bp",21],"./ion-button_2.entry.js":["0Pbj",0,22],"./ion-card_5.entry.js":["ydQj",0,23],"./ion-checkbox.entry.js":["4fMi",0,24],"./ion-chip.entry.js":["czK9",0,25],"./ion-col_3.entry.js":["/CAe",26],"./ion-datetime_3.entry.js":["WgF3",0,27],"./ion-fab_3.entry.js":["uQcF",0,28],"./ion-img.entry.js":["wHD8",29],"./ion-infinite-scroll_2.entry.js":["2lz6",30],"./ion-input.entry.js":["ercB",0,31],"./ion-item-option_3.entry.js":["MGMP",0,32],"./ion-item_8.entry.js":["9bur",0,33],"./ion-loading.entry.js":["cABk",0,34],"./ion-menu_3.entry.js":["kyFE",0,35],"./ion-modal.entry.js":["TvZU",0,36],"./ion-nav_2.entry.js":["vnES",0,37],"./ion-popover.entry.js":["qCuA",0,38],"./ion-progress-bar.entry.js":["0tOe",0,39],"./ion-radio_2.entry.js":["h11V",0,40],"./ion-range.entry.js":["XGij",0,41],"./ion-refresher_2.entry.js":["nYbb",0,42],"./ion-reorder_2.entry.js":["smMY",0,43],"./ion-ripple-effect.entry.js":["STjf",44],"./ion-route_4.entry.js":["k5eQ",0,45],"./ion-searchbar.entry.js":["OR5t",0,46],"./ion-segment_2.entry.js":["fSgp",0,47],"./ion-select_3.entry.js":["lfGF",0,48],"./ion-slide_2.entry.js":["5xYT",49],"./ion-spinner.entry.js":["nI0H",0,50],"./ion-split-pane.entry.js":["NAQR",51],"./ion-tab-bar_2.entry.js":["knkW",0,52],"./ion-tab_2.entry.js":["TpdJ",0,53],"./ion-text.entry.js":["ISmu",0,54],"./ion-textarea.entry.js":["U7LX",0,55],"./ion-toast.entry.js":["L3sA",0,56],"./ion-toggle.entry.js":["IUOf",0,57],"./ion-virtual-scroll.entry.js":["8Mb5",58]};function i(t){if(!n.o(r,t))return Promise.resolve().then((function(){var e=new Error("Cannot find module '"+t+"'");throw e.code="MODULE_NOT_FOUND",e}));var e=r[t],i=e[0];return Promise.all(e.slice(1).map(n.e)).then((function(){return n(i)}))}i.keys=function(){return Object.keys(r)},i.id="kLfG",t.exports=i},l7GE:function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n("7o/Q");class i extends r.a{notifyNext(t,e,n,r,i){this.destination.next(e)}notifyError(t,e){this.destination.error(t)}notifyComplete(t){this.destination.complete()}}},lJxs:function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n("7o/Q");function i(t,e){return function(n){if("function"!=typeof t)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return n.lift(new o(t,e))}}class o{constructor(t,e){this.project=t,this.thisArg=e}call(t,e){return e.subscribe(new s(t,this.project,this.thisArg))}}class s extends r.a{constructor(t,e,n){super(t),this.project=e,this.count=0,this.thisArg=n||this}_next(t){let e;try{e=this.project.call(this.thisArg,t,this.count++)}catch(n){return void this.destination.error(n)}this.destination.next(e)}}},n6bG:function(t,e,n){"use strict";function r(t){return"function"==typeof t}n.d(e,"a",(function(){return r}))},ngJS:function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));const r=t=>e=>{for(let n=0,r=t.length;n<r&&!e.closed;n++)e.next(t[n]);e.complete()}},oB13:function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var r=n("XNiG"),i=n("HDdC"),o=(n("7o/Q"),n("quSY")),s=n("x+ZX");class a extends i.a{constructor(t,e){super(),this.source=t,this.subjectFactory=e,this._refCount=0,this._isComplete=!1}_subscribe(t){return this.getSubject().subscribe(t)}getSubject(){const t=this._subject;return t&&!t.isStopped||(this._subject=this.subjectFactory()),this._subject}connect(){let t=this._connection;return t||(this._isComplete=!1,t=this._connection=new o.a,t.add(this.source.subscribe(new c(this.getSubject(),this))),t.closed&&(this._connection=null,t=o.a.EMPTY)),t}refCount(){return Object(s.a)()(this)}}const u=(()=>{const t=a.prototype;return{operator:{value:null},_refCount:{value:0,writable:!0},_subject:{value:null,writable:!0},_connection:{value:null,writable:!0},_subscribe:{value:t._subscribe},_isComplete:{value:t._isComplete,writable:!0},getSubject:{value:t.getSubject},connect:{value:t.connect},refCount:{value:t.refCount}}})();class c extends r.b{constructor(t,e){super(t),this.connectable=e}_error(t){this._unsubscribe(),super._error(t)}_complete(){this.connectable._isComplete=!0,this._unsubscribe(),super._complete()}_unsubscribe(){const t=this.connectable;if(t){this.connectable=null;const e=t._connection;t._refCount=0,t._subject=null,t._connection=null,e&&e.unsubscribe()}}}function l(t,e){return function(n){let r;if(r="function"==typeof t?t:function(){return t},"function"==typeof e)return n.lift(new h(r,e));const i=Object.create(n,u);return i.source=n,i.subjectFactory=r,i}}class h{constructor(t,e){this.subjectFactory=t,this.selector=e}call(t,e){const{selector:n}=this,r=this.subjectFactory(),i=n(r).subscribe(t);return i.add(e.subscribe(r)),i}}},ofXK:function(t,e,n){"use strict";n.d(e,"a",(function(){return _})),n.d(e,"b",(function(){return D})),n.d(e,"c",(function(){return L})),n.d(e,"d",(function(){return u})),n.d(e,"e",(function(){return E})),n.d(e,"f",(function(){return h})),n.d(e,"g",(function(){return O})),n.d(e,"h",(function(){return m})),n.d(e,"i",(function(){return w})),n.d(e,"j",(function(){return c})),n.d(e,"k",(function(){return $})),n.d(e,"l",(function(){return F})),n.d(e,"m",(function(){return U})),n.d(e,"n",(function(){return a})),n.d(e,"o",(function(){return M})),n.d(e,"p",(function(){return o})),n.d(e,"q",(function(){return A})),n.d(e,"r",(function(){return s}));var r=n("fXoL");let i=null;function o(){return i}function s(t){i||(i=t)}class a{}const u=new r.q("DocumentToken");let c=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=Object(r.Db)({factory:l,token:t,providedIn:"platform"}),t})();function l(){return Object(r.Nb)(d)}const h=new r.q("Location Initialized");let d=(()=>{class t extends c{constructor(t){super(),this._doc=t,this._init()}_init(){this.location=o().getLocation(),this._history=o().getHistory()}getBaseHrefFromDOM(){return o().getBaseHref(this._doc)}onPopState(t){o().getGlobalEventTarget(this._doc,"window").addEventListener("popstate",t,!1)}onHashChange(t){o().getGlobalEventTarget(this._doc,"window").addEventListener("hashchange",t,!1)}get href(){return this.location.href}get protocol(){return this.location.protocol}get hostname(){return this.location.hostname}get port(){return this.location.port}get pathname(){return this.location.pathname}get search(){return this.location.search}get hash(){return this.location.hash}set pathname(t){this.location.pathname=t}pushState(t,e,n){f()?this._history.pushState(t,e,n):this.location.hash=n}replaceState(t,e,n){f()?this._history.replaceState(t,e,n):this.location.hash=n}forward(){this._history.forward()}back(){this._history.back()}getState(){return this._history.state}}return t.\u0275fac=function(e){return new(e||t)(r.Nb(u))},t.\u0275prov=Object(r.Db)({factory:p,token:t,providedIn:"platform"}),t})();function f(){return!!window.history.pushState}function p(){return new d(Object(r.Nb)(u))}function g(t,e){if(0==t.length)return e;if(0==e.length)return t;let n=0;return t.endsWith("/")&&n++,e.startsWith("/")&&n++,2==n?t+e.substring(1):1==n?t+e:t+"/"+e}function y(t){const e=t.match(/#|\?|$/),n=e&&e.index||t.length;return t.slice(0,n-("/"===t[n-1]?1:0))+t.slice(n)}function v(t){return t&&"?"!==t[0]?"?"+t:t}let m=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=Object(r.Db)({factory:b,token:t,providedIn:"root"}),t})();function b(t){const e=Object(r.Nb)(u).location;return new w(Object(r.Nb)(c),e&&e.origin||"")}const _=new r.q("appBaseHref");let w=(()=>{class t extends m{constructor(t,e){if(super(),this._platformLocation=t,null==e&&(e=this._platformLocation.getBaseHrefFromDOM()),null==e)throw new Error("No base href set. Please provide a value for the APP_BASE_HREF token or add a base element to the document.");this._baseHref=e}onPopState(t){this._platformLocation.onPopState(t),this._platformLocation.onHashChange(t)}getBaseHref(){return this._baseHref}prepareExternalUrl(t){return g(this._baseHref,t)}path(t=!1){const e=this._platformLocation.pathname+v(this._platformLocation.search),n=this._platformLocation.hash;return n&&t?`${e}${n}`:e}pushState(t,e,n,r){const i=this.prepareExternalUrl(n+v(r));this._platformLocation.pushState(t,e,i)}replaceState(t,e,n,r){const i=this.prepareExternalUrl(n+v(r));this._platformLocation.replaceState(t,e,i)}forward(){this._platformLocation.forward()}back(){this._platformLocation.back()}}return t.\u0275fac=function(e){return new(e||t)(r.Nb(c),r.Nb(_,8))},t.\u0275prov=r.Db({token:t,factory:t.\u0275fac}),t})(),E=(()=>{class t extends m{constructor(t,e){super(),this._platformLocation=t,this._baseHref="",null!=e&&(this._baseHref=e)}onPopState(t){this._platformLocation.onPopState(t),this._platformLocation.onHashChange(t)}getBaseHref(){return this._baseHref}path(t=!1){let e=this._platformLocation.hash;return null==e&&(e="#"),e.length>0?e.substring(1):e}prepareExternalUrl(t){const e=g(this._baseHref,t);return e.length>0?"#"+e:e}pushState(t,e,n,r){let i=this.prepareExternalUrl(n+v(r));0==i.length&&(i=this._platformLocation.pathname),this._platformLocation.pushState(t,e,i)}replaceState(t,e,n,r){let i=this.prepareExternalUrl(n+v(r));0==i.length&&(i=this._platformLocation.pathname),this._platformLocation.replaceState(t,e,i)}forward(){this._platformLocation.forward()}back(){this._platformLocation.back()}}return t.\u0275fac=function(e){return new(e||t)(r.Nb(c),r.Nb(_,8))},t.\u0275prov=r.Db({token:t,factory:t.\u0275fac}),t})(),O=(()=>{class t{constructor(t,e){this._subject=new r.n,this._urlChangeListeners=[],this._platformStrategy=t;const n=this._platformStrategy.getBaseHref();this._platformLocation=e,this._baseHref=y(T(n)),this._platformStrategy.onPopState(t=>{this._subject.emit({url:this.path(!0),pop:!0,state:t.state,type:t.type})})}path(t=!1){return this.normalize(this._platformStrategy.path(t))}getState(){return this._platformLocation.getState()}isCurrentPathEqualTo(t,e=""){return this.path()==this.normalize(t+v(e))}normalize(e){return t.stripTrailingSlash(function(t,e){return t&&e.startsWith(t)?e.substring(t.length):e}(this._baseHref,T(e)))}prepareExternalUrl(t){return t&&"/"!==t[0]&&(t="/"+t),this._platformStrategy.prepareExternalUrl(t)}go(t,e="",n=null){this._platformStrategy.pushState(n,"",t,e),this._notifyUrlChangeListeners(this.prepareExternalUrl(t+v(e)),n)}replaceState(t,e="",n=null){this._platformStrategy.replaceState(n,"",t,e),this._notifyUrlChangeListeners(this.prepareExternalUrl(t+v(e)),n)}forward(){this._platformStrategy.forward()}back(){this._platformStrategy.back()}onUrlChange(t){this._urlChangeListeners.push(t),this._urlChangeSubscription||(this._urlChangeSubscription=this.subscribe(t=>{this._notifyUrlChangeListeners(t.url,t.state)}))}_notifyUrlChangeListeners(t="",e){this._urlChangeListeners.forEach(n=>n(t,e))}subscribe(t,e,n){return this._subject.subscribe({next:t,error:e,complete:n})}}return t.\u0275fac=function(e){return new(e||t)(r.Nb(m),r.Nb(c))},t.normalizeQueryParams=v,t.joinWithSlash=g,t.stripTrailingSlash=y,t.\u0275prov=Object(r.Db)({factory:C,token:t,providedIn:"root"}),t})();function C(){return new O(Object(r.Nb)(m),Object(r.Nb)(c))}function T(t){return t.replace(/\/index.html$/,"")}var S=function(t){return t[t.Zero=0]="Zero",t[t.One=1]="One",t[t.Two=2]="Two",t[t.Few=3]="Few",t[t.Many=4]="Many",t[t.Other=5]="Other",t}({});const I=r.lb;class j{}let x=(()=>{class t extends j{constructor(t){super(),this.locale=t}getPluralCategory(t,e){switch(I(e||this.locale)(t)){case S.Zero:return"zero";case S.One:return"one";case S.Two:return"two";case S.Few:return"few";case S.Many:return"many";default:return"other"}}}return t.\u0275fac=function(e){return new(e||t)(r.Nb(r.u))},t.\u0275prov=r.Db({token:t,factory:t.\u0275fac}),t})();function A(t,e){e=encodeURIComponent(e);for(const n of t.split(";")){const t=n.indexOf("="),[r,i]=-1==t?[n,""]:[n.slice(0,t),n.slice(t+1)];if(r.trim()===e)return decodeURIComponent(i)}return null}class k{createSubscription(t,e){return t.subscribe({next:e,error:t=>{throw t}})}dispose(t){t.unsubscribe()}onDestroy(t){t.unsubscribe()}}class N{createSubscription(t,e){return t.then(e,t=>{throw t})}dispose(t){}onDestroy(t){}}const R=new N,P=new k;let D=(()=>{class t{constructor(t){this._ref=t,this._latestValue=null,this._subscription=null,this._obj=null,this._strategy=null}ngOnDestroy(){this._subscription&&this._dispose()}transform(t){return this._obj?t!==this._obj?(this._dispose(),this.transform(t)):this._latestValue:(t&&this._subscribe(t),this._latestValue)}_subscribe(t){this._obj=t,this._strategy=this._selectStrategy(t),this._subscription=this._strategy.createSubscription(t,e=>this._updateLatestValue(t,e))}_selectStrategy(e){if(Object(r.qb)(e))return R;if(Object(r.pb)(e))return P;throw n=t,Error(`InvalidPipeArgument: '${e}' for pipe '${Object(r.tb)(n)}'`);var n}_dispose(){this._strategy.dispose(this._subscription),this._latestValue=null,this._subscription=null,this._obj=null}_updateLatestValue(t,e){t===this._obj&&(this._latestValue=e,this._ref.markForCheck())}}return t.\u0275fac=function(e){return new(e||t)(r.Pb())},t.\u0275pipe=r.Gb({name:"async",type:t,pure:!1}),t})(),L=(()=>{class t{}return t.\u0275mod=r.Fb({type:t}),t.\u0275inj=r.Eb({factory:function(e){return new(e||t)},providers:[{provide:j,useClass:x}]}),t})();const M="browser";function F(t){return t===M}function U(t){return"server"===t}let $=(()=>{class t{}return t.\u0275prov=Object(r.Db)({token:t,providedIn:"root",factory:()=>new V(Object(r.Nb)(u),window,Object(r.Nb)(r.m))}),t})();class V{constructor(t,e,n){this.document=t,this.window=e,this.errorHandler=n,this.offset=()=>[0,0]}setOffset(t){this.offset=Array.isArray(t)?()=>t:t}getScrollPosition(){return this.supportsScrolling()?[this.window.scrollX,this.window.scrollY]:[0,0]}scrollToPosition(t){this.supportsScrolling()&&this.window.scrollTo(t[0],t[1])}scrollToAnchor(t){if(this.supportsScrolling()){const e=this.document.getElementById(t)||this.document.getElementsByName(t)[0];e&&this.scrollToElement(e)}}setHistoryScrollRestoration(t){if(this.supportScrollRestoration()){const e=this.window.history;e&&e.scrollRestoration&&(e.scrollRestoration=t)}}scrollToElement(t){const e=t.getBoundingClientRect(),n=e.left+this.window.pageXOffset,r=e.top+this.window.pageYOffset,i=this.offset();this.window.scrollTo(n-i[0],r-i[1])}supportScrollRestoration(){try{if(!this.window||!this.window.scrollTo)return!1;const t=q(this.window.history)||q(Object.getPrototypeOf(this.window.history));return!(!t||!t.writable&&!t.set)}catch(t){return!1}}supportsScrolling(){try{return!!this.window.scrollTo}catch(t){return!1}}}function q(t){return Object.getOwnPropertyDescriptor(t,"scrollRestoration")}},pLZG:function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n("7o/Q");function i(t,e){return function(n){return n.lift(new o(t,e))}}class o{constructor(t,e){this.predicate=t,this.thisArg=e}call(t,e){return e.subscribe(new s(t,this.predicate,this.thisArg))}}class s extends r.a{constructor(t,e,n){super(t),this.predicate=e,this.thisArg=n,this.count=0}_next(t){let e;try{e=this.predicate.call(this.thisArg,t,this.count++)}catch(n){return void this.destination.error(n)}e&&this.destination.next(t)}}},pxpQ:function(t,e,n){"use strict";n.d(e,"b",(function(){return o})),n.d(e,"a",(function(){return a}));var r=n("7o/Q"),i=n("WMd4");function o(t,e=0){return function(n){return n.lift(new s(t,e))}}class s{constructor(t,e=0){this.scheduler=t,this.delay=e}call(t,e){return e.subscribe(new a(t,this.scheduler,this.delay))}}class a extends r.a{constructor(t,e,n=0){super(t),this.scheduler=e,this.delay=n}static dispatch(t){const{notification:e,destination:n}=t;e.observe(n),this.unsubscribe()}scheduleMessage(t){this.destination.add(this.scheduler.schedule(a.dispatch,this.delay,new u(t,this.destination)))}_next(t){this.scheduleMessage(i.a.createNext(t))}_error(t){this.scheduleMessage(i.a.createError(t)),this.unsubscribe()}_complete(){this.scheduleMessage(i.a.createComplete()),this.unsubscribe()}}class u{constructor(t,e){this.notification=t,this.destination=e}}},"q/0M":function(t,e,n){"use strict";function r(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),i=0;for(e=0;e<n;e++)for(var o=arguments[e],s=0,a=o.length;s<a;s++,i++)r[i]=o[s];return r}var i;n.d(e,"a",(function(){return s})),n.d(e,"b",(function(){return h})),n.d(e,"c",(function(){return d})),n.d(e,"d",(function(){return f}));var o=[],s=function(t){return t[t.DEBUG=0]="DEBUG",t[t.VERBOSE=1]="VERBOSE",t[t.INFO=2]="INFO",t[t.WARN=3]="WARN",t[t.ERROR=4]="ERROR",t[t.SILENT=5]="SILENT",t}({}),a={debug:s.DEBUG,verbose:s.VERBOSE,info:s.INFO,warn:s.WARN,error:s.ERROR,silent:s.SILENT},u=s.INFO,c=((i={})[s.DEBUG]="log",i[s.VERBOSE]="log",i[s.INFO]="info",i[s.WARN]="warn",i[s.ERROR]="error",i),l=function(t,e){for(var n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];if(!(e<t.logLevel)){var o=(new Date).toISOString(),s=c[e];if(!s)throw new Error("Attempted to log a message with an invalid logType (value: "+e+")");console[s].apply(console,r(["["+o+"]  "+t.name+":"],n))}},h=function(){function t(t){this.name=t,this._logLevel=u,this._logHandler=l,this._userLogHandler=null,o.push(this)}return Object.defineProperty(t.prototype,"logLevel",{get:function(){return this._logLevel},set:function(t){if(!(t in s))throw new TypeError('Invalid value "'+t+'" assigned to `logLevel`');this._logLevel=t},enumerable:!1,configurable:!0}),t.prototype.setLogLevel=function(t){this._logLevel="string"==typeof t?a[t]:t},Object.defineProperty(t.prototype,"logHandler",{get:function(){return this._logHandler},set:function(t){if("function"!=typeof t)throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"userLogHandler",{get:function(){return this._userLogHandler},set:function(t){this._userLogHandler=t},enumerable:!1,configurable:!0}),t.prototype.debug=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this._userLogHandler&&this._userLogHandler.apply(this,r([this,s.DEBUG],t)),this._logHandler.apply(this,r([this,s.DEBUG],t))},t.prototype.log=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this._userLogHandler&&this._userLogHandler.apply(this,r([this,s.VERBOSE],t)),this._logHandler.apply(this,r([this,s.VERBOSE],t))},t.prototype.info=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this._userLogHandler&&this._userLogHandler.apply(this,r([this,s.INFO],t)),this._logHandler.apply(this,r([this,s.INFO],t))},t.prototype.warn=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this._userLogHandler&&this._userLogHandler.apply(this,r([this,s.WARN],t)),this._logHandler.apply(this,r([this,s.WARN],t))},t.prototype.error=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this._userLogHandler&&this._userLogHandler.apply(this,r([this,s.ERROR],t)),this._logHandler.apply(this,r([this,s.ERROR],t))},t}();function d(t){o.forEach((function(e){e.setLogLevel(t)}))}function f(t,e){for(var n=function(n){var r=null;e&&e.level&&(r=a[e.level]),n.userLogHandler=null===t?null:function(e,n){for(var i=[],o=2;o<arguments.length;o++)i[o-2]=arguments[o];var a=i.map((function(t){if(null==t)return null;if("string"==typeof t)return t;if("number"==typeof t||"boolean"==typeof t)return t.toString();if(t instanceof Error)return t.message;try{return JSON.stringify(t)}catch(e){return null}})).filter((function(t){return t})).join(" ");n>=(null!=r?r:e.logLevel)&&t({level:s[n].toLowerCase(),message:a,args:i,type:e.name})}},r=0,i=o;r<i.length;r++)n(i[r])}},qOnz:function(t,e,n){"use strict";n.d(e,"a",(function(){return d})),n.d(e,"b",(function(){return C})),n.d(e,"c",(function(){return O})),n.d(e,"d",(function(){return M})),n.d(e,"e",(function(){return i})),n.d(e,"f",(function(){return o})),n.d(e,"g",(function(){return a})),n.d(e,"h",(function(){return u})),n.d(e,"i",(function(){return N})),n.d(e,"j",(function(){return F})),n.d(e,"k",(function(){return l})),n.d(e,"l",(function(){return h})),n.d(e,"m",(function(){return q})),n.d(e,"n",(function(){return f})),n.d(e,"o",(function(){return k})),n.d(e,"p",(function(){return y})),n.d(e,"q",(function(){return v})),n.d(e,"r",(function(){return b})),n.d(e,"s",(function(){return P})),n.d(e,"t",(function(){return _})),n.d(e,"u",(function(){return p})),n.d(e,"v",(function(){return g})),n.d(e,"w",(function(){return E})),n.d(e,"x",(function(){return m})),n.d(e,"y",(function(){return w})),n.d(e,"z",(function(){return A})),n.d(e,"A",(function(){return I})),n.d(e,"B",(function(){return D})),n.d(e,"C",(function(){return L})),n.d(e,"D",(function(){return R})),n.d(e,"E",(function(){return W})),n.d(e,"F",(function(){return z})),n.d(e,"G",(function(){return j})),n.d(e,"H",(function(){return V})),n.d(e,"I",(function(){return H})),n.d(e,"J",(function(){return B}));var r=n("O1h7"),i=function(t,e){if(!t)throw o(e)},o=function(t){return new Error("Firebase Database (${JSCORE_VERSION}) INTERNAL ASSERT FAILED: "+t)},s=function(t){for(var e=[],n=0,r=0;r<t.length;r++){var i=t.charCodeAt(r);i<128?e[n++]=i:i<2048?(e[n++]=i>>6|192,e[n++]=63&i|128):55296==(64512&i)&&r+1<t.length&&56320==(64512&t.charCodeAt(r+1))?(i=65536+((1023&i)<<10)+(1023&t.charCodeAt(++r)),e[n++]=i>>18|240,e[n++]=i>>12&63|128,e[n++]=i>>6&63|128,e[n++]=63&i|128):(e[n++]=i>>12|224,e[n++]=i>>6&63|128,e[n++]=63&i|128)}return e},a={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:"function"==typeof atob,encodeByteArray:function(t,e){if(!Array.isArray(t))throw Error("encodeByteArray takes an array as a parameter");this.init_();for(var n=e?this.byteToCharMapWebSafe_:this.byteToCharMap_,r=[],i=0;i<t.length;i+=3){var o=t[i],s=i+1<t.length,a=s?t[i+1]:0,u=i+2<t.length,c=u?t[i+2]:0,l=(15&a)<<2|c>>6,h=63&c;u||(h=64,s||(l=64)),r.push(n[o>>2],n[(3&o)<<4|a>>4],n[l],n[h])}return r.join("")},encodeString:function(t,e){return this.HAS_NATIVE_SUPPORT&&!e?btoa(t):this.encodeByteArray(s(t),e)},decodeString:function(t,e){return this.HAS_NATIVE_SUPPORT&&!e?atob(t):function(t){for(var e=[],n=0,r=0;n<t.length;){var i=t[n++];if(i<128)e[r++]=String.fromCharCode(i);else if(i>191&&i<224){var o=t[n++];e[r++]=String.fromCharCode((31&i)<<6|63&o)}else if(i>239&&i<365){var s=((7&i)<<18|(63&(o=t[n++]))<<12|(63&(a=t[n++]))<<6|63&t[n++])-65536;e[r++]=String.fromCharCode(55296+(s>>10)),e[r++]=String.fromCharCode(56320+(1023&s))}else{o=t[n++];var a=t[n++];e[r++]=String.fromCharCode((15&i)<<12|(63&o)<<6|63&a)}}return e.join("")}(this.decodeStringToByteArray(t,e))},decodeStringToByteArray:function(t,e){this.init_();for(var n=e?this.charToByteMapWebSafe_:this.charToByteMap_,r=[],i=0;i<t.length;){var o=n[t.charAt(i++)],s=i<t.length?n[t.charAt(i)]:0,a=++i<t.length?n[t.charAt(i)]:64,u=++i<t.length?n[t.charAt(i)]:64;if(++i,null==o||null==s||null==a||null==u)throw Error();r.push(o<<2|s>>4),64!==a&&(r.push(s<<4&240|a>>2),64!==u&&r.push(a<<6&192|u))}return r},init_:function(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(var t=0;t<this.ENCODED_VALS.length;t++)this.byteToCharMap_[t]=this.ENCODED_VALS.charAt(t),this.charToByteMap_[this.byteToCharMap_[t]]=t,this.byteToCharMapWebSafe_[t]=this.ENCODED_VALS_WEBSAFE.charAt(t),this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[t]]=t,t>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(t)]=t,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(t)]=t)}}},u=function(t){var e=s(t);return a.encodeByteArray(e,!0)},c=function(t){try{return a.decodeString(t,!0)}catch(e){console.error("base64Decode failed: ",e)}return null};function l(t){return h(void 0,t)}function h(t,e){if(!(e instanceof Object))return e;switch(e.constructor){case Date:return new Date(e.getTime());case Object:void 0===t&&(t={});break;case Array:t=[];break;default:return e}for(var n in e)e.hasOwnProperty(n)&&"__proto__"!==n&&(t[n]=h(t[n],e[n]));return t}var d=function(){function t(){var t=this;this.reject=function(){},this.resolve=function(){},this.promise=new Promise((function(e,n){t.resolve=e,t.reject=n}))}return t.prototype.wrapCallback=function(t){var e=this;return function(n,r){n?e.reject(n):e.resolve(r),"function"==typeof t&&(e.promise.catch((function(){})),1===t.length?t(n):t(n,r))}},t}();function f(){return"undefined"!=typeof navigator&&"string"==typeof navigator.userAgent?navigator.userAgent:""}function p(){return"undefined"!=typeof window&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(f())}function g(){try{return"[object process]"===Object.prototype.toString.call(global.process)}catch(t){return!1}}function y(){return"object"==typeof self&&self.self===self}function v(){var t="object"==typeof chrome?chrome.runtime:"object"==typeof browser?browser.runtime:void 0;return"object"==typeof t&&void 0!==t.id}function m(){return"object"==typeof navigator&&"ReactNative"===navigator.product}function b(){return f().indexOf("Electron/")>=0}function _(){var t=f();return t.indexOf("MSIE ")>=0||t.indexOf("Trident/")>=0}function w(){return f().indexOf("MSAppHost/")>=0}function E(){return!1}var O=function(t){function e(n,r,i){var o=t.call(this,r)||this;return o.code=n,o.customData=i,o.name="FirebaseError",Object.setPrototypeOf(o,e.prototype),Error.captureStackTrace&&Error.captureStackTrace(o,C.prototype.create),o}return Object(r.d)(e,t),e}(Error),C=function(){function t(t,e,n){this.service=t,this.serviceName=e,this.errors=n}return t.prototype.create=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var r=e[0]||{},i=this.service+"/"+t,o=this.errors[t],s=o?T(o,r):"Error",a=this.serviceName+": "+s+" ("+i+").",u=new O(i,a,r);return u},t}();function T(t,e){return t.replace(S,(function(t,n){var r=e[n];return null!=r?String(r):"<"+n+"?>"}))}var S=/\{\$([^}]+)}/g;function I(t){return JSON.parse(t)}function j(t){return JSON.stringify(t)}var x=function(t){var e={},n={},r={},i="";try{var o=t.split(".");e=I(c(o[0])||""),n=I(c(o[1])||""),i=o[2],r=n.d||{},delete n.d}catch(s){}return{header:e,claims:n,data:r,signature:i}},A=function(t){var e=x(t).claims;return!!e&&"object"==typeof e&&e.hasOwnProperty("iat")},k=function(t){var e=x(t).claims;return"object"==typeof e&&!0===e.admin};function N(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function R(t,e){return Object.prototype.hasOwnProperty.call(t,e)?t[e]:void 0}function P(t){for(var e in t)if(Object.prototype.hasOwnProperty.call(t,e))return!1;return!0}function D(t,e,n){var r={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(r[i]=e.call(n,t[i],i,t));return r}function L(t){for(var e=[],n=function(t,n){Array.isArray(n)?n.forEach((function(n){e.push(encodeURIComponent(t)+"="+encodeURIComponent(n))})):e.push(encodeURIComponent(t)+"="+encodeURIComponent(n))},r=0,i=Object.entries(t);r<i.length;r++){var o=i[r];n(o[0],o[1])}return e.length?"&"+e.join("&"):""}var M=function(){function t(){this.chain_=[],this.buf_=[],this.W_=[],this.pad_=[],this.inbuf_=0,this.total_=0,this.blockSize=64,this.pad_[0]=128;for(var t=1;t<this.blockSize;++t)this.pad_[t]=0;this.reset()}return t.prototype.reset=function(){this.chain_[0]=1732584193,this.chain_[1]=4023233417,this.chain_[2]=2562383102,this.chain_[3]=271733878,this.chain_[4]=3285377520,this.inbuf_=0,this.total_=0},t.prototype.compress_=function(t,e){e||(e=0);var n=this.W_;if("string"==typeof t)for(var r=0;r<16;r++)n[r]=t.charCodeAt(e)<<24|t.charCodeAt(e+1)<<16|t.charCodeAt(e+2)<<8|t.charCodeAt(e+3),e+=4;else for(r=0;r<16;r++)n[r]=t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3],e+=4;for(r=16;r<80;r++)n[r]=4294967295&((h=n[r-3]^n[r-8]^n[r-14]^n[r-16])<<1|h>>>31);var i,o,s=this.chain_[0],a=this.chain_[1],u=this.chain_[2],c=this.chain_[3],l=this.chain_[4];for(r=0;r<80;r++){r<40?r<20?(i=c^a&(u^c),o=1518500249):(i=a^u^c,o=1859775393):r<60?(i=a&u|c&(a|u),o=2400959708):(i=a^u^c,o=3395469782);var h=(s<<5|s>>>27)+i+l+o+n[r]&4294967295;l=c,c=u,u=4294967295&(a<<30|a>>>2),a=s,s=h}this.chain_[0]=this.chain_[0]+s&4294967295,this.chain_[1]=this.chain_[1]+a&4294967295,this.chain_[2]=this.chain_[2]+u&4294967295,this.chain_[3]=this.chain_[3]+c&4294967295,this.chain_[4]=this.chain_[4]+l&4294967295},t.prototype.update=function(t,e){if(null!=t){void 0===e&&(e=t.length);for(var n=e-this.blockSize,r=0,i=this.buf_,o=this.inbuf_;r<e;){if(0===o)for(;r<=n;)this.compress_(t,r),r+=this.blockSize;if("string"==typeof t){for(;r<e;)if(i[o]=t.charCodeAt(r),++r,++o===this.blockSize){this.compress_(i),o=0;break}}else for(;r<e;)if(i[o]=t[r],++r,++o===this.blockSize){this.compress_(i),o=0;break}}this.inbuf_=o,this.total_+=e}},t.prototype.digest=function(){var t=[],e=8*this.total_;this.update(this.pad_,this.inbuf_<56?56-this.inbuf_:this.blockSize-(this.inbuf_-56));for(var n=this.blockSize-1;n>=56;n--)this.buf_[n]=255&e,e/=256;this.compress_(this.buf_);var r=0;for(n=0;n<5;n++)for(var i=24;i>=0;i-=8)t[r]=this.chain_[n]>>i&255,++r;return t},t}();function F(t,e){var n=new U(t,e);return n.subscribe.bind(n)}var U=function(){function t(t,e){var n=this;this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=e,this.task.then((function(){t(n)})).catch((function(t){n.error(t)}))}return t.prototype.next=function(t){this.forEachObserver((function(e){e.next(t)}))},t.prototype.error=function(t){this.forEachObserver((function(e){e.error(t)})),this.close(t)},t.prototype.complete=function(){this.forEachObserver((function(t){t.complete()})),this.close()},t.prototype.subscribe=function(t,e,n){var r,i=this;if(void 0===t&&void 0===e&&void 0===n)throw new Error("Missing Observer.");void 0===(r=function(t,e){if("object"!=typeof t||null===t)return!1;for(var n=0,r=["next","error","complete"];n<r.length;n++){var i=r[n];if(i in t&&"function"==typeof t[i])return!0}return!1}(t)?t:{next:t,error:e,complete:n}).next&&(r.next=$),void 0===r.error&&(r.error=$),void 0===r.complete&&(r.complete=$);var o=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then((function(){try{i.finalError?r.error(i.finalError):r.complete()}catch(t){}})),this.observers.push(r),o},t.prototype.unsubscribeOne=function(t){void 0!==this.observers&&void 0!==this.observers[t]&&(delete this.observers[t],this.observerCount-=1,0===this.observerCount&&void 0!==this.onNoObservers&&this.onNoObservers(this))},t.prototype.forEachObserver=function(t){if(!this.finalized)for(var e=0;e<this.observers.length;e++)this.sendOne(e,t)},t.prototype.sendOne=function(t,e){var n=this;this.task.then((function(){if(void 0!==n.observers&&void 0!==n.observers[t])try{e(n.observers[t])}catch(r){"undefined"!=typeof console&&console.error&&console.error(r)}}))},t.prototype.close=function(t){var e=this;this.finalized||(this.finalized=!0,void 0!==t&&(this.finalError=t),this.task.then((function(){e.observers=void 0,e.onNoObservers=void 0})))},t}();function $(){}var V=function(t,e,n,r){var i;if(r<e?i="at least "+e:r>n&&(i=0===n?"none":"no more than "+n),i)throw new Error(t+" failed: Was called with "+r+(1===r?" argument.":" arguments.")+" Expects "+i+".")};function q(t,e,n){var r="";switch(e){case 1:r=n?"first":"First";break;case 2:r=n?"second":"Second";break;case 3:r=n?"third":"Third";break;case 4:r=n?"fourth":"Fourth";break;default:throw new Error("errorPrefix called with argumentNumber > 4.  Need to update it?")}return t+" failed: "+r+" argument "}function H(t,e,n,r){if((!r||n)&&"function"!=typeof n)throw new Error(q(t,e,r)+"must be a valid function.")}function B(t,e,n,r){if((!r||n)&&("object"!=typeof n||null===n))throw new Error(q(t,e,r)+"must be a valid context object.")}var z=function(t){for(var e=[],n=0,r=0;r<t.length;r++){var o=t.charCodeAt(r);if(o>=55296&&o<=56319){var s=o-55296;r++,i(r<t.length,"Surrogate pair missing trail surrogate."),o=65536+(s<<10)+(t.charCodeAt(r)-56320)}o<128?e[n++]=o:o<2048?(e[n++]=o>>6|192,e[n++]=63&o|128):o<65536?(e[n++]=o>>12|224,e[n++]=o>>6&63|128,e[n++]=63&o|128):(e[n++]=o>>18|240,e[n++]=o>>12&63|128,e[n++]=o>>6&63|128,e[n++]=63&o|128)}return e},W=function(t){for(var e=0,n=0;n<t.length;n++){var r=t.charCodeAt(n);r<128?e++:r<2048?e+=2:r>=55296&&r<=56319?(e+=4,n++):e+=3}return e}},qgXg:function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var r=n("3N8a");class i extends r.a{constructor(t,e){super(t,e),this.scheduler=t,this.work=e}schedule(t,e=0){return e>0?super.schedule(t,e):(this.delay=e,this.state=t,this.scheduler.flush(this),this)}execute(t,e){return e>0||this.closed?super.execute(t,e):this._execute(t,e)}requestAsyncId(t,e,n=0){return null!==n&&n>0||null===n&&this.delay>0?super.requestAsyncId(t,e,n):t.flush(this)}}var o=n("IjjT");class s extends o.a{}const a=new s(i)},quSY:function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var r=n("DH7j"),i=n("XoHu"),o=n("n6bG");const s=(()=>{function t(t){return Error.call(this),this.message=t?`${t.length} errors occurred during unsubscription:\n${t.map((t,e)=>`${e+1}) ${t.toString()}`).join("\n  ")}`:"",this.name="UnsubscriptionError",this.errors=t,this}return t.prototype=Object.create(Error.prototype),t})();let a=(()=>{class t{constructor(t){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,t&&(this._unsubscribe=t)}unsubscribe(){let e;if(this.closed)return;let{_parentOrParents:n,_unsubscribe:a,_subscriptions:c}=this;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,n instanceof t)n.remove(this);else if(null!==n)for(let t=0;t<n.length;++t)n[t].remove(this);if(Object(o.a)(a))try{a.call(this)}catch(l){e=l instanceof s?u(l.errors):[l]}if(Object(r.a)(c)){let t=-1,n=c.length;for(;++t<n;){const n=c[t];if(Object(i.a)(n))try{n.unsubscribe()}catch(l){e=e||[],l instanceof s?e=e.concat(u(l.errors)):e.push(l)}}}if(e)throw new s(e)}add(e){let n=e;if(!e)return t.EMPTY;switch(typeof e){case"function":n=new t(e);case"object":if(n===this||n.closed||"function"!=typeof n.unsubscribe)return n;if(this.closed)return n.unsubscribe(),n;if(!(n instanceof t)){const e=n;n=new t,n._subscriptions=[e]}break;default:throw new Error("unrecognized teardown "+e+" added to Subscription.")}let{_parentOrParents:r}=n;if(null===r)n._parentOrParents=this;else if(r instanceof t){if(r===this)return n;n._parentOrParents=[r,this]}else{if(-1!==r.indexOf(this))return n;r.push(this)}const i=this._subscriptions;return null===i?this._subscriptions=[n]:i.push(n),n}remove(t){const e=this._subscriptions;if(e){const n=e.indexOf(t);-1!==n&&e.splice(n,1)}}}var e;return t.EMPTY=((e=new t).closed=!0,e),t})();function u(t){return t.reduce((t,e)=>t.concat(e instanceof s?e.errors:e),[])}},sVev:function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));const r=(()=>{function t(){return Error.call(this),this.message="no elements in sequence",this.name="EmptyError",this}return t.prototype=Object.create(Error.prototype),t})()},spgP:function(t,e,n){"use strict";(function(t){n.d(e,"a",(function(){return S})),n.d(e,"b",(function(){return b})),n.d(e,"c",(function(){return m})),n.d(e,"d",(function(){return f})),n.d(e,"e",(function(){return v})),n.d(e,"f",(function(){return C})),n.d(e,"g",(function(){return w})),n.d(e,"h",(function(){return p})),n.d(e,"i",(function(){return y})),n.d(e,"j",(function(){return E}));var r=n("qgXg"),i=n("D0XW"),o=n("vkgz"),s=n("tf+s"),a=n("pxpQ"),u=n("fXoL"),c=n("Jgta");function l(){}class h{constructor(t,e=r.a){this.zone=t,this.delegate=e}now(){return this.delegate.now()}schedule(t,e,n){const r=this.zone;return this.delegate.schedule((function(e){r.runGuarded(()=>{t.apply(this,[e])})}),e,n)}}class d{constructor(t){this.zone=t,this.task=null}call(t,e){const n=this.unscheduleTask.bind(this);return this.task=this.zone.run(()=>Zone.current.scheduleMacroTask("firebaseZoneBlock",l,{},l,l)),e.pipe(Object(o.a)({next:n,complete:n,error:n})).subscribe(t).add(n)}unscheduleTask(){setTimeout(()=>{null!=this.task&&"scheduled"===this.task.state&&(this.task.invoke(),this.task=null)},10)}}class f{constructor(t){this.ngZone=t,this.outsideAngular=t.runOutsideAngular(()=>new h(Zone.current)),this.insideAngular=t.run(()=>new h(Zone.current,i.a))}}function p(t){return function(e){return(e=e.lift(new d(t.ngZone))).pipe(Object(s.a)(t.outsideAngular),Object(a.b)(t.insideAngular))}}const g=["ngOnDestroy"],y=(t,e,n,r={})=>new Proxy(t,{get:(i,o)=>n.runOutsideAngular(()=>{var i;if(t[o])return(null===(i=null==r?void 0:r.spy)||void 0===i?void 0:i.get)&&r.spy.get(o,t[o]),t[o];if(g.indexOf(o)>-1)return()=>{};const s=e.toPromise().then(t=>{const e=t&&t[o];return"function"==typeof e?e.bind(t):e&&e.then?e.then(t=>n.run(()=>t)):n.run(()=>e)});return new Proxy(()=>{},{get:(t,e)=>s[e],apply:(t,e,n)=>s.then(t=>{var e;const i=t&&t(...n);return(null===(e=null==r?void 0:r.spy)||void 0===e?void 0:e.apply)&&r.spy.apply(o,n,i),i})})})}),v=(t,e)=>{e.forEach(e=>{Object.getOwnPropertyNames(e.prototype||e).forEach(n=>{Object.defineProperty(t.prototype,n,Object.getOwnPropertyDescriptor(e.prototype||e,n))})})},m=new u.q("angularfire2.app.options"),b=new u.q("angularfire2.app.nameOrConfig"),_=new u.O("6.1.2");function w(e,n,r){const i="object"==typeof r&&r||{};i.name=i.name||"string"==typeof r&&r||"[DEFAULT]";const o=c.a.apps.filter(t=>t&&t.name===i.name)[0]||n.runOutsideAngular(()=>c.a.initializeApp(e,i));try{JSON.stringify(e)!==JSON.stringify(o.options)&&O("error",`${o.name} Firebase App already initialized with different options${t.hot?", you may need to reload as Firebase is not HMR aware.":"."}`)}catch(s){}return o}const E=()=>{O("warn","You may need to import 'firebase/auth' manually in your component rather than rely on AngularFireAuth's dynamic import, when using the emulator suite https://github.com/angular/angularfire/issues/2656")},O=(t,...e)=>{Object(u.U)()&&"undefined"!=typeof console&&console[t](...e)};function C(e,n,r,i,o){const[s,...a]=globalThis.\u0275AngularfireInstanceCache.get(e)||[];if(s){try{o.some((t,e)=>{const n=a[e];return t&&"object"==typeof t?JSON.stringify(t)!==JSON.stringify(n):t!==n})&&O("error",`${n} was already initialized on the ${r.name} Firebase App instance with different settings.${t.hot?" You may need to reload as Firebase is not HMR aware.":""}`)}catch(u){}return s}{const t=i();return globalThis.\u0275AngularfireInstanceCache.set(e,[t,...o]),t}}globalThis.\u0275AngularfireInstanceCache||(globalThis.\u0275AngularfireInstanceCache=new Map);const T={provide:class{},useFactory:w,deps:[m,u.z,[new u.A,b]]};let S=(()=>{class t{constructor(t){c.a.registerVersion("angularfire",_.full,t.toString()),c.a.registerVersion("angular",u.N.full)}static initializeApp(e,n){return{ngModule:t,providers:[{provide:m,useValue:e},{provide:b,useValue:n}]}}}return t.\u0275mod=u.Fb({type:t}),t.\u0275inj=u.Eb({factory:function(e){return new(e||t)(u.Nb(u.B))},providers:[T]}),t})()}).call(this,n("3UD+")(t))},"tf+s":function(t,e,n){"use strict";n.d(e,"a",(function(){return y}));var r=n("HDdC");let i=1;const o=(()=>Promise.resolve())(),s={};function a(t){return t in s&&(delete s[t],!0)}const u={setImmediate(t){const e=i++;return s[e]=!0,o.then(()=>a(e)&&t()),e},clearImmediate(t){a(t)}};var c=n("3N8a");class l extends c.a{constructor(t,e){super(t,e),this.scheduler=t,this.work=e}requestAsyncId(t,e,n=0){return null!==n&&n>0?super.requestAsyncId(t,e,n):(t.actions.push(this),t.scheduled||(t.scheduled=u.setImmediate(t.flush.bind(t,null))))}recycleAsyncId(t,e,n=0){if(null!==n&&n>0||null===n&&this.delay>0)return super.recycleAsyncId(t,e,n);0===t.actions.length&&(u.clearImmediate(e),t.scheduled=void 0)}}var h=n("IjjT");class d extends h.a{flush(t){this.active=!0,this.scheduled=void 0;const{actions:e}=this;let n,r=-1,i=e.length;t=t||e.shift();do{if(n=t.execute(t.state,t.delay))break}while(++r<i&&(t=e.shift()));if(this.active=!1,n){for(;++r<i&&(t=e.shift());)t.unsubscribe();throw n}}}const f=new d(l);var p=n("DH7j");class g extends r.a{constructor(t,e=0,n=f){var r;super(),this.source=t,this.delayTime=e,this.scheduler=n,r=e,(Object(p.a)(r)||!(r-parseFloat(r)+1>=0)||e<0)&&(this.delayTime=0),n&&"function"==typeof n.schedule||(this.scheduler=f)}static create(t,e=0,n=f){return new g(t,e,n)}static dispatch(t){const{source:e,subscriber:n}=t;return this.add(e.subscribe(n))}_subscribe(t){return this.scheduler.schedule(g.dispatch,this.delayTime,{source:this.source,subscriber:t})}}function y(t,e=0){return function(n){return n.lift(new v(t,e))}}class v{constructor(t,e){this.scheduler=t,this.delay=e}call(t,e){return new g(e,this.delay,this.scheduler).subscribe(t)}}},tyNb:function(t,e,n){"use strict";n.d(e,"a",(function(){return Jt})),n.d(e,"b",(function(){return ln})),n.d(e,"c",(function(){return Y})),n.d(e,"d",(function(){return ft})),n.d(e,"e",(function(){return wn})),n.d(e,"f",(function(){return Ze})),n.d(e,"g",(function(){return gn})),n.d(e,"h",(function(){return yn})),n.d(e,"i",(function(){return xn})),n.d(e,"j",(function(){return At}));var r=n("ofXK"),i=n("fXoL"),o=n("LRne"),s=n("Cfvw"),a=n("2Vo4"),u=n("HDdC"),c=n("sVev"),l=n("z+Ro"),h=n("DH7j"),d=n("l7GE"),f=n("ZUHj"),p=n("yCtX");const g={};class y{constructor(t){this.resultSelector=t}call(t,e){return e.subscribe(new v(t,this.resultSelector))}}class v extends d.a{constructor(t,e){super(t),this.resultSelector=e,this.active=0,this.values=[],this.observables=[]}_next(t){this.values.push(g),this.observables.push(t)}_complete(){const t=this.observables,e=t.length;if(0===e)this.destination.complete();else{this.active=e,this.toRespond=e;for(let n=0;n<e;n++){const e=t[n];this.add(Object(f.a)(this,e,e,n))}}}notifyComplete(t){0==(this.active-=1)&&this.destination.complete()}notifyNext(t,e,n,r,i){const o=this.values,s=this.toRespond?o[n]===g?--this.toRespond:this.toRespond:0;o[n]=e,0===s&&(this.resultSelector?this._tryResultSelector(o):this.destination.next(o.slice()))}_tryResultSelector(t){let e;try{e=this.resultSelector.apply(this,t)}catch(n){return void this.destination.error(n)}this.destination.next(e)}}var m=n("NXyV"),b=n("EY2u"),_=n("XNiG"),w=n("lJxs"),E=n("0EUg"),O=n("pLZG"),C=n("7o/Q"),T=n("4I5i");function S(t){return function(e){return 0===t?Object(b.b)():e.lift(new I(t))}}class I{constructor(t){if(this.total=t,this.total<0)throw new T.a}call(t,e){return e.subscribe(new j(t,this.total))}}class j extends C.a{constructor(t,e){super(t),this.total=e,this.ring=new Array,this.count=0}_next(t){const e=this.ring,n=this.total,r=this.count++;e.length<n?e.push(t):e[r%n]=t}_complete(){const t=this.destination;let e=this.count;if(e>0){const n=this.count>=this.total?this.total:this.count,r=this.ring;for(let i=0;i<n;i++){const i=e++%n;t.next(r[i])}}t.complete()}}var x=n("XDbj"),A=n("xbPD"),k=n("SpAZ"),N=n("51Dv");function R(t){return function(e){const n=new P(t),r=e.lift(n);return n.caught=r}}class P{constructor(t){this.selector=t}call(t,e){return e.subscribe(new D(t,this.selector,this.caught))}}class D extends d.a{constructor(t,e,n){super(t),this.selector=e,this.caught=n}error(t){if(!this.isStopped){let n;try{n=this.selector(t,this.caught)}catch(e){return void super.error(e)}this._unsubscribeAndRecycle();const r=new N.a(this,void 0,void 0);this.add(r);const i=Object(f.a)(this,n,void 0,void 0,r);i!==r&&this.add(i)}}}var L=n("SxV6"),M=n("5+tZ"),F=n("vkgz");class U{constructor(t,e,n){this.predicate=t,this.thisArg=e,this.source=n}call(t,e){return e.subscribe(new $(t,this.predicate,this.thisArg,this.source))}}class $ extends C.a{constructor(t,e,n,r){super(t),this.predicate=e,this.thisArg=n,this.source=r,this.index=0,this.thisArg=n||this}notifyComplete(t){this.destination.next(t),this.destination.complete()}_next(t){let e=!1;try{e=this.predicate.call(this.thisArg,t,this.index++,this.source)}catch(n){return void this.destination.error(n)}e||this.notifyComplete(!1)}_complete(){this.notifyComplete(!0)}}var V=n("eIep"),q=n("IzEk"),H=n("JX91"),B=n("Kqap");function z(t,e){return Object(M.a)(t,e,1)}var W=n("quSY");class G{constructor(t){this.callback=t}call(t,e){return e.subscribe(new Q(t,this.callback))}}class Q extends C.a{constructor(t,e){super(t),this.add(new W.a(e))}}var K=n("bHdf");class X{constructor(t,e){this.id=t,this.url=e}}class Y extends X{constructor(t,e,n="imperative",r=null){super(t,e),this.navigationTrigger=n,this.restoredState=r}toString(){return`NavigationStart(id: ${this.id}, url: '${this.url}')`}}class J extends X{constructor(t,e,n){super(t,e),this.urlAfterRedirects=n}toString(){return`NavigationEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}')`}}class Z extends X{constructor(t,e,n){super(t,e),this.reason=n}toString(){return`NavigationCancel(id: ${this.id}, url: '${this.url}')`}}class tt extends X{constructor(t,e,n){super(t,e),this.error=n}toString(){return`NavigationError(id: ${this.id}, url: '${this.url}', error: ${this.error})`}}class et extends X{constructor(t,e,n,r){super(t,e),this.urlAfterRedirects=n,this.state=r}toString(){return`RoutesRecognized(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class nt extends X{constructor(t,e,n,r){super(t,e),this.urlAfterRedirects=n,this.state=r}toString(){return`GuardsCheckStart(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class rt extends X{constructor(t,e,n,r,i){super(t,e),this.urlAfterRedirects=n,this.state=r,this.shouldActivate=i}toString(){return`GuardsCheckEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state}, shouldActivate: ${this.shouldActivate})`}}class it extends X{constructor(t,e,n,r){super(t,e),this.urlAfterRedirects=n,this.state=r}toString(){return`ResolveStart(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class ot extends X{constructor(t,e,n,r){super(t,e),this.urlAfterRedirects=n,this.state=r}toString(){return`ResolveEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class st{constructor(t){this.route=t}toString(){return`RouteConfigLoadStart(path: ${this.route.path})`}}class at{constructor(t){this.route=t}toString(){return`RouteConfigLoadEnd(path: ${this.route.path})`}}class ut{constructor(t){this.snapshot=t}toString(){return`ChildActivationStart(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class ct{constructor(t){this.snapshot=t}toString(){return`ChildActivationEnd(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class lt{constructor(t){this.snapshot=t}toString(){return`ActivationStart(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class ht{constructor(t){this.snapshot=t}toString(){return`ActivationEnd(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class dt{constructor(t,e,n){this.routerEvent=t,this.position=e,this.anchor=n}toString(){return`Scroll(anchor: '${this.anchor}', position: '${this.position?`${this.position[0]}, ${this.position[1]}`:null}')`}}const ft="primary";class pt{constructor(t){this.params=t||{}}has(t){return Object.prototype.hasOwnProperty.call(this.params,t)}get(t){if(this.has(t)){const e=this.params[t];return Array.isArray(e)?e[0]:e}return null}getAll(t){if(this.has(t)){const e=this.params[t];return Array.isArray(e)?e:[e]}return[]}get keys(){return Object.keys(this.params)}}function gt(t){return new pt(t)}function yt(t){const e=Error("NavigationCancelingError: "+t);return e.ngNavigationCancelingError=!0,e}function vt(t,e,n){const r=n.path.split("/");if(r.length>t.length)return null;if("full"===n.pathMatch&&(e.hasChildren()||r.length<t.length))return null;const i={};for(let o=0;o<r.length;o++){const e=r[o],n=t[o];if(e.startsWith(":"))i[e.substring(1)]=n;else if(e!==n.path)return null}return{consumed:t.slice(0,r.length),posParams:i}}function mt(t,e){const n=Object.keys(t),r=Object.keys(e);if(!n||!r||n.length!=r.length)return!1;let i;for(let o=0;o<n.length;o++)if(i=n[o],!bt(t[i],e[i]))return!1;return!0}function bt(t,e){return Array.isArray(t)&&Array.isArray(e)?t.length==e.length&&t.every(t=>e.indexOf(t)>-1):t===e}function _t(t){return Array.prototype.concat.apply([],t)}function wt(t){return t.length>0?t[t.length-1]:null}function Et(t,e){for(const n in t)t.hasOwnProperty(n)&&e(t[n],n)}function Ot(t){return Object(i.pb)(t)?t:Object(i.qb)(t)?Object(s.a)(Promise.resolve(t)):Object(o.a)(t)}function Ct(t,e,n){return n?function(t,e){return mt(t,e)}(t.queryParams,e.queryParams)&&function t(e,n){if(!jt(e.segments,n.segments))return!1;if(e.numberOfChildren!==n.numberOfChildren)return!1;for(const r in n.children){if(!e.children[r])return!1;if(!t(e.children[r],n.children[r]))return!1}return!0}(t.root,e.root):function(t,e){return Object.keys(e).length<=Object.keys(t).length&&Object.keys(e).every(n=>bt(t[n],e[n]))}(t.queryParams,e.queryParams)&&function t(e,n){return function e(n,r,i){if(n.segments.length>i.length)return!!jt(n.segments.slice(0,i.length),i)&&!r.hasChildren();if(n.segments.length===i.length){if(!jt(n.segments,i))return!1;for(const e in r.children){if(!n.children[e])return!1;if(!t(n.children[e],r.children[e]))return!1}return!0}{const t=i.slice(0,n.segments.length),o=i.slice(n.segments.length);return!!jt(n.segments,t)&&!!n.children[ft]&&e(n.children[ft],r,o)}}(e,n,n.segments)}(t.root,e.root)}class Tt{constructor(t,e,n){this.root=t,this.queryParams=e,this.fragment=n}get queryParamMap(){return this._queryParamMap||(this._queryParamMap=gt(this.queryParams)),this._queryParamMap}toString(){return Nt.serialize(this)}}class St{constructor(t,e){this.segments=t,this.children=e,this.parent=null,Et(e,(t,e)=>t.parent=this)}hasChildren(){return this.numberOfChildren>0}get numberOfChildren(){return Object.keys(this.children).length}toString(){return Rt(this)}}class It{constructor(t,e){this.path=t,this.parameters=e}get parameterMap(){return this._parameterMap||(this._parameterMap=gt(this.parameters)),this._parameterMap}toString(){return Ut(this)}}function jt(t,e){return t.length===e.length&&t.every((t,n)=>t.path===e[n].path)}function xt(t,e){let n=[];return Et(t.children,(t,r)=>{r===ft&&(n=n.concat(e(t,r)))}),Et(t.children,(t,r)=>{r!==ft&&(n=n.concat(e(t,r)))}),n}class At{}class kt{parse(t){const e=new Bt(t);return new Tt(e.parseRootSegment(),e.parseQueryParams(),e.parseFragment())}serialize(t){return`${"/"+function t(e,n){if(!e.hasChildren())return Rt(e);if(n){const n=e.children[ft]?t(e.children[ft],!1):"",r=[];return Et(e.children,(e,n)=>{n!==ft&&r.push(`${n}:${t(e,!1)}`)}),r.length>0?`${n}(${r.join("//")})`:n}{const n=xt(e,(n,r)=>r===ft?[t(e.children[ft],!1)]:[`${r}:${t(n,!1)}`]);return`${Rt(e)}/(${n.join("//")})`}}(t.root,!0)}${function(t){const e=Object.keys(t).map(e=>{const n=t[e];return Array.isArray(n)?n.map(t=>`${Dt(e)}=${Dt(t)}`).join("&"):`${Dt(e)}=${Dt(n)}`});return e.length?"?"+e.join("&"):""}(t.queryParams)}${"string"==typeof t.fragment?"#"+encodeURI(t.fragment):""}`}}const Nt=new kt;function Rt(t){return t.segments.map(t=>Ut(t)).join("/")}function Pt(t){return encodeURIComponent(t).replace(/%40/g,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",")}function Dt(t){return Pt(t).replace(/%3B/gi,";")}function Lt(t){return Pt(t).replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/%26/gi,"&")}function Mt(t){return decodeURIComponent(t)}function Ft(t){return Mt(t.replace(/\+/g,"%20"))}function Ut(t){return`${Lt(t.path)}${e=t.parameters,Object.keys(e).map(t=>`;${Lt(t)}=${Lt(e[t])}`).join("")}`;var e}const $t=/^[^\/()?;=#]+/;function Vt(t){const e=t.match($t);return e?e[0]:""}const qt=/^[^=?&#]+/,Ht=/^[^?&#]+/;class Bt{constructor(t){this.url=t,this.remaining=t}parseRootSegment(){return this.consumeOptional("/"),""===this.remaining||this.peekStartsWith("?")||this.peekStartsWith("#")?new St([],{}):new St([],this.parseChildren())}parseQueryParams(){const t={};if(this.consumeOptional("?"))do{this.parseQueryParam(t)}while(this.consumeOptional("&"));return t}parseFragment(){return this.consumeOptional("#")?decodeURIComponent(this.remaining):null}parseChildren(){if(""===this.remaining)return{};this.consumeOptional("/");const t=[];for(this.peekStartsWith("(")||t.push(this.parseSegment());this.peekStartsWith("/")&&!this.peekStartsWith("//")&&!this.peekStartsWith("/(");)this.capture("/"),t.push(this.parseSegment());let e={};this.peekStartsWith("/(")&&(this.capture("/"),e=this.parseParens(!0));let n={};return this.peekStartsWith("(")&&(n=this.parseParens(!1)),(t.length>0||Object.keys(e).length>0)&&(n[ft]=new St(t,e)),n}parseSegment(){const t=Vt(this.remaining);if(""===t&&this.peekStartsWith(";"))throw new Error(`Empty path url segment cannot have parameters: '${this.remaining}'.`);return this.capture(t),new It(Mt(t),this.parseMatrixParams())}parseMatrixParams(){const t={};for(;this.consumeOptional(";");)this.parseParam(t);return t}parseParam(t){const e=Vt(this.remaining);if(!e)return;this.capture(e);let n="";if(this.consumeOptional("=")){const t=Vt(this.remaining);t&&(n=t,this.capture(n))}t[Mt(e)]=Mt(n)}parseQueryParam(t){const e=function(t){const e=t.match(qt);return e?e[0]:""}(this.remaining);if(!e)return;this.capture(e);let n="";if(this.consumeOptional("=")){const t=function(t){const e=t.match(Ht);return e?e[0]:""}(this.remaining);t&&(n=t,this.capture(n))}const r=Ft(e),i=Ft(n);if(t.hasOwnProperty(r)){let e=t[r];Array.isArray(e)||(e=[e],t[r]=e),e.push(i)}else t[r]=i}parseParens(t){const e={};for(this.capture("(");!this.consumeOptional(")")&&this.remaining.length>0;){const n=Vt(this.remaining),r=this.remaining[n.length];if("/"!==r&&")"!==r&&";"!==r)throw new Error(`Cannot parse url '${this.url}'`);let i=void 0;n.indexOf(":")>-1?(i=n.substr(0,n.indexOf(":")),this.capture(i),this.capture(":")):t&&(i=ft);const o=this.parseChildren();e[i]=1===Object.keys(o).length?o[ft]:new St([],o),this.consumeOptional("//")}return e}peekStartsWith(t){return this.remaining.startsWith(t)}consumeOptional(t){return!!this.peekStartsWith(t)&&(this.remaining=this.remaining.substring(t.length),!0)}capture(t){if(!this.consumeOptional(t))throw new Error(`Expected "${t}".`)}}class zt{constructor(t){this._root=t}get root(){return this._root.value}parent(t){const e=this.pathFromRoot(t);return e.length>1?e[e.length-2]:null}children(t){const e=Wt(t,this._root);return e?e.children.map(t=>t.value):[]}firstChild(t){const e=Wt(t,this._root);return e&&e.children.length>0?e.children[0].value:null}siblings(t){const e=Gt(t,this._root);return e.length<2?[]:e[e.length-2].children.map(t=>t.value).filter(e=>e!==t)}pathFromRoot(t){return Gt(t,this._root).map(t=>t.value)}}function Wt(t,e){if(t===e.value)return e;for(const n of e.children){const e=Wt(t,n);if(e)return e}return null}function Gt(t,e){if(t===e.value)return[e];for(const n of e.children){const r=Gt(t,n);if(r.length)return r.unshift(e),r}return[]}class Qt{constructor(t,e){this.value=t,this.children=e}toString(){return`TreeNode(${this.value})`}}function Kt(t){const e={};return t&&t.children.forEach(t=>e[t.value.outlet]=t),e}class Xt extends zt{constructor(t,e){super(t),this.snapshot=e,ne(this,t)}toString(){return this.snapshot.toString()}}function Yt(t,e){const n=function(t,e){const n=new te([],{},{},"",{},ft,e,null,t.root,-1,{});return new ee("",new Qt(n,[]))}(t,e),r=new a.a([new It("",{})]),i=new a.a({}),o=new a.a({}),s=new a.a({}),u=new a.a(""),c=new Jt(r,i,s,u,o,ft,e,n.root);return c.snapshot=n.root,new Xt(new Qt(c,[]),n)}class Jt{constructor(t,e,n,r,i,o,s,a){this.url=t,this.params=e,this.queryParams=n,this.fragment=r,this.data=i,this.outlet=o,this.component=s,this._futureSnapshot=a}get routeConfig(){return this._futureSnapshot.routeConfig}get root(){return this._routerState.root}get parent(){return this._routerState.parent(this)}get firstChild(){return this._routerState.firstChild(this)}get children(){return this._routerState.children(this)}get pathFromRoot(){return this._routerState.pathFromRoot(this)}get paramMap(){return this._paramMap||(this._paramMap=this.params.pipe(Object(w.a)(t=>gt(t)))),this._paramMap}get queryParamMap(){return this._queryParamMap||(this._queryParamMap=this.queryParams.pipe(Object(w.a)(t=>gt(t)))),this._queryParamMap}toString(){return this.snapshot?this.snapshot.toString():`Future(${this._futureSnapshot})`}}function Zt(t,e="emptyOnly"){const n=t.pathFromRoot;let r=0;if("always"!==e)for(r=n.length-1;r>=1;){const t=n[r],e=n[r-1];if(t.routeConfig&&""===t.routeConfig.path)r--;else{if(e.component)break;r--}}return function(t){return t.reduce((t,e)=>({params:Object.assign(Object.assign({},t.params),e.params),data:Object.assign(Object.assign({},t.data),e.data),resolve:Object.assign(Object.assign({},t.resolve),e._resolvedData)}),{params:{},data:{},resolve:{}})}(n.slice(r))}class te{constructor(t,e,n,r,i,o,s,a,u,c,l){this.url=t,this.params=e,this.queryParams=n,this.fragment=r,this.data=i,this.outlet=o,this.component=s,this.routeConfig=a,this._urlSegment=u,this._lastPathIndex=c,this._resolve=l}get root(){return this._routerState.root}get parent(){return this._routerState.parent(this)}get firstChild(){return this._routerState.firstChild(this)}get children(){return this._routerState.children(this)}get pathFromRoot(){return this._routerState.pathFromRoot(this)}get paramMap(){return this._paramMap||(this._paramMap=gt(this.params)),this._paramMap}get queryParamMap(){return this._queryParamMap||(this._queryParamMap=gt(this.queryParams)),this._queryParamMap}toString(){return`Route(url:'${this.url.map(t=>t.toString()).join("/")}', path:'${this.routeConfig?this.routeConfig.path:""}')`}}class ee extends zt{constructor(t,e){super(e),this.url=t,ne(this,e)}toString(){return re(this._root)}}function ne(t,e){e.value._routerState=t,e.children.forEach(e=>ne(t,e))}function re(t){const e=t.children.length>0?` { ${t.children.map(re).join(", ")} } `:"";return`${t.value}${e}`}function ie(t){if(t.snapshot){const e=t.snapshot,n=t._futureSnapshot;t.snapshot=n,mt(e.queryParams,n.queryParams)||t.queryParams.next(n.queryParams),e.fragment!==n.fragment&&t.fragment.next(n.fragment),mt(e.params,n.params)||t.params.next(n.params),function(t,e){if(t.length!==e.length)return!1;for(let n=0;n<t.length;++n)if(!mt(t[n],e[n]))return!1;return!0}(e.url,n.url)||t.url.next(n.url),mt(e.data,n.data)||t.data.next(n.data)}else t.snapshot=t._futureSnapshot,t.data.next(t._futureSnapshot.data)}function oe(t,e){var n,r;return mt(t.params,e.params)&&jt(n=t.url,r=e.url)&&n.every((t,e)=>mt(t.parameters,r[e].parameters))&&!(!t.parent!=!e.parent)&&(!t.parent||oe(t.parent,e.parent))}function se(t){return"object"==typeof t&&null!=t&&!t.outlets&&!t.segmentPath}function ae(t,e,n,r,i){let o={};return r&&Et(r,(t,e)=>{o[e]=Array.isArray(t)?t.map(t=>""+t):""+t}),new Tt(n.root===t?e:function t(e,n,r){const i={};return Et(e.children,(e,o)=>{i[o]=e===n?r:t(e,n,r)}),new St(e.segments,i)}(n.root,t,e),o,i)}class ue{constructor(t,e,n){if(this.isAbsolute=t,this.numberOfDoubleDots=e,this.commands=n,t&&n.length>0&&se(n[0]))throw new Error("Root segment cannot have matrix parameters");const r=n.find(t=>"object"==typeof t&&null!=t&&t.outlets);if(r&&r!==wt(n))throw new Error("{outlets:{}} has to be the last command")}toRoot(){return this.isAbsolute&&1===this.commands.length&&"/"==this.commands[0]}}class ce{constructor(t,e,n){this.segmentGroup=t,this.processChildren=e,this.index=n}}function le(t){return"object"==typeof t&&null!=t&&t.outlets?t.outlets[ft]:""+t}function he(t,e,n){if(t||(t=new St([],{})),0===t.segments.length&&t.hasChildren())return de(t,e,n);const r=function(t,e,n){let r=0,i=e;const o={match:!1,pathIndex:0,commandIndex:0};for(;i<t.segments.length;){if(r>=n.length)return o;const e=t.segments[i],s=le(n[r]),a=r<n.length-1?n[r+1]:null;if(i>0&&void 0===s)break;if(s&&a&&"object"==typeof a&&void 0===a.outlets){if(!ye(s,a,e))return o;r+=2}else{if(!ye(s,{},e))return o;r++}i++}return{match:!0,pathIndex:i,commandIndex:r}}(t,e,n),i=n.slice(r.commandIndex);if(r.match&&r.pathIndex<t.segments.length){const e=new St(t.segments.slice(0,r.pathIndex),{});return e.children[ft]=new St(t.segments.slice(r.pathIndex),t.children),de(e,0,i)}return r.match&&0===i.length?new St(t.segments,{}):r.match&&!t.hasChildren()?fe(t,e,n):r.match?de(t,0,i):fe(t,e,n)}function de(t,e,n){if(0===n.length)return new St(t.segments,{});{const r=function(t){return"object"==typeof t[0]&&null!==t[0]&&t[0].outlets?t[0].outlets:{[ft]:t}}(n),i={};return Et(r,(n,r)=>{null!==n&&(i[r]=he(t.children[r],e,n))}),Et(t.children,(t,e)=>{void 0===r[e]&&(i[e]=t)}),new St(t.segments,i)}}function fe(t,e,n){const r=t.segments.slice(0,e);let i=0;for(;i<n.length;){if("object"==typeof n[i]&&null!==n[i]&&void 0!==n[i].outlets){const t=pe(n[i].outlets);return new St(r,t)}if(0===i&&se(n[0])){r.push(new It(t.segments[e].path,n[0])),i++;continue}const o=le(n[i]),s=i<n.length-1?n[i+1]:null;o&&s&&se(s)?(r.push(new It(o,ge(s))),i+=2):(r.push(new It(o,{})),i++)}return new St(r,{})}function pe(t){const e={};return Et(t,(t,n)=>{null!==t&&(e[n]=fe(new St([],{}),0,t))}),e}function ge(t){const e={};return Et(t,(t,n)=>e[n]=""+t),e}function ye(t,e,n){return t==n.path&&mt(e,n.parameters)}class ve{constructor(t,e,n,r){this.routeReuseStrategy=t,this.futureState=e,this.currState=n,this.forwardEvent=r}activate(t){const e=this.futureState._root,n=this.currState?this.currState._root:null;this.deactivateChildRoutes(e,n,t),ie(this.futureState.root),this.activateChildRoutes(e,n,t)}deactivateChildRoutes(t,e,n){const r=Kt(e);t.children.forEach(t=>{const e=t.value.outlet;this.deactivateRoutes(t,r[e],n),delete r[e]}),Et(r,(t,e)=>{this.deactivateRouteAndItsChildren(t,n)})}deactivateRoutes(t,e,n){const r=t.value,i=e?e.value:null;if(r===i)if(r.component){const i=n.getContext(r.outlet);i&&this.deactivateChildRoutes(t,e,i.children)}else this.deactivateChildRoutes(t,e,n);else i&&this.deactivateRouteAndItsChildren(e,n)}deactivateRouteAndItsChildren(t,e){this.routeReuseStrategy.shouldDetach(t.value.snapshot)?this.detachAndStoreRouteSubtree(t,e):this.deactivateRouteAndOutlet(t,e)}detachAndStoreRouteSubtree(t,e){const n=e.getContext(t.value.outlet);if(n&&n.outlet){const e=n.outlet.detach(),r=n.children.onOutletDeactivated();this.routeReuseStrategy.store(t.value.snapshot,{componentRef:e,route:t,contexts:r})}}deactivateRouteAndOutlet(t,e){const n=e.getContext(t.value.outlet);if(n){const r=Kt(t),i=t.value.component?n.children:e;Et(r,(t,e)=>this.deactivateRouteAndItsChildren(t,i)),n.outlet&&(n.outlet.deactivate(),n.children.onOutletDeactivated())}}activateChildRoutes(t,e,n){const r=Kt(e);t.children.forEach(t=>{this.activateRoutes(t,r[t.value.outlet],n),this.forwardEvent(new ht(t.value.snapshot))}),t.children.length&&this.forwardEvent(new ct(t.value.snapshot))}activateRoutes(t,e,n){const r=t.value,i=e?e.value:null;if(ie(r),r===i)if(r.component){const i=n.getOrCreateContext(r.outlet);this.activateChildRoutes(t,e,i.children)}else this.activateChildRoutes(t,e,n);else if(r.component){const e=n.getOrCreateContext(r.outlet);if(this.routeReuseStrategy.shouldAttach(r.snapshot)){const t=this.routeReuseStrategy.retrieve(r.snapshot);this.routeReuseStrategy.store(r.snapshot,null),e.children.onOutletReAttached(t.contexts),e.attachRef=t.componentRef,e.route=t.route.value,e.outlet&&e.outlet.attach(t.componentRef,t.route.value),me(t.route)}else{const n=function(t){for(let e=t.parent;e;e=e.parent){const t=e.routeConfig;if(t&&t._loadedConfig)return t._loadedConfig;if(t&&t.component)return null}return null}(r.snapshot),i=n?n.module.componentFactoryResolver:null;e.attachRef=null,e.route=r,e.resolver=i,e.outlet&&e.outlet.activateWith(r,i),this.activateChildRoutes(t,null,e.children)}}else this.activateChildRoutes(t,null,n)}}function me(t){ie(t.value),t.children.forEach(me)}class be{constructor(t,e){this.routes=t,this.module=e}}function _e(t){return"function"==typeof t}function we(t){return t instanceof Tt}class Ee{constructor(t){this.segmentGroup=t||null}}class Oe{constructor(t){this.urlTree=t}}function Ce(t){return new u.a(e=>e.error(new Ee(t)))}function Te(t){return new u.a(e=>e.error(new Oe(t)))}function Se(t){return new u.a(e=>e.error(new Error(`Only absolute redirects can have named outlets. redirectTo: '${t}'`)))}class Ie{constructor(t,e,n,r,o){this.configLoader=e,this.urlSerializer=n,this.urlTree=r,this.config=o,this.allowRedirects=!0,this.ngModule=t.get(i.x)}apply(){return this.expandSegmentGroup(this.ngModule,this.config,this.urlTree.root,ft).pipe(Object(w.a)(t=>this.createUrlTree(t,this.urlTree.queryParams,this.urlTree.fragment))).pipe(R(t=>{if(t instanceof Oe)return this.allowRedirects=!1,this.match(t.urlTree);if(t instanceof Ee)throw this.noMatchError(t);throw t}))}match(t){return this.expandSegmentGroup(this.ngModule,this.config,t.root,ft).pipe(Object(w.a)(e=>this.createUrlTree(e,t.queryParams,t.fragment))).pipe(R(t=>{if(t instanceof Ee)throw this.noMatchError(t);throw t}))}noMatchError(t){return new Error(`Cannot match any routes. URL Segment: '${t.segmentGroup}'`)}createUrlTree(t,e,n){const r=t.segments.length>0?new St([],{[ft]:t}):t;return new Tt(r,e,n)}expandSegmentGroup(t,e,n,r){return 0===n.segments.length&&n.hasChildren()?this.expandChildren(t,e,n).pipe(Object(w.a)(t=>new St([],t))):this.expandSegment(t,n,e,n.segments,r,!0)}expandChildren(t,e,n){return function(t,e){if(0===Object.keys(t).length)return Object(o.a)({});const n=[],r=[],i={};return Et(t,(t,o)=>{const s=e(o,t).pipe(Object(w.a)(t=>i[o]=t));o===ft?n.push(s):r.push(s)}),o.a.apply(null,n.concat(r)).pipe(Object(E.a)(),function(t,e){const n=arguments.length>=2;return r=>r.pipe(t?Object(O.a)((e,n)=>t(e,n,r)):k.a,S(1),n?Object(A.a)(e):Object(x.a)(()=>new c.a))}(),Object(w.a)(()=>i))}(n.children,(n,r)=>this.expandSegmentGroup(t,e,r,n))}expandSegment(t,e,n,r,i,s){return Object(o.a)(...n).pipe(Object(w.a)(a=>this.expandSegmentAgainstRoute(t,e,n,a,r,i,s).pipe(R(t=>{if(t instanceof Ee)return Object(o.a)(null);throw t}))),Object(E.a)(),Object(L.a)(t=>!!t),R((t,n)=>{if(t instanceof c.a||"EmptyError"===t.name){if(this.noLeftoversInUrl(e,r,i))return Object(o.a)(new St([],{}));throw new Ee(e)}throw t}))}noLeftoversInUrl(t,e,n){return 0===e.length&&!t.children[n]}expandSegmentAgainstRoute(t,e,n,r,i,o,s){return ke(r)!==o?Ce(e):void 0===r.redirectTo?this.matchSegmentAgainstRoute(t,e,r,i):s&&this.allowRedirects?this.expandSegmentAgainstRouteUsingRedirect(t,e,n,r,i,o):Ce(e)}expandSegmentAgainstRouteUsingRedirect(t,e,n,r,i,o){return"**"===r.path?this.expandWildCardWithParamsAgainstRouteUsingRedirect(t,n,r,o):this.expandRegularSegmentAgainstRouteUsingRedirect(t,e,n,r,i,o)}expandWildCardWithParamsAgainstRouteUsingRedirect(t,e,n,r){const i=this.applyRedirectCommands([],n.redirectTo,{});return n.redirectTo.startsWith("/")?Te(i):this.lineralizeSegments(n,i).pipe(Object(M.a)(n=>{const i=new St(n,{});return this.expandSegment(t,i,e,n,r,!1)}))}expandRegularSegmentAgainstRouteUsingRedirect(t,e,n,r,i,o){const{matched:s,consumedSegments:a,lastChild:u,positionalParamSegments:c}=je(e,r,i);if(!s)return Ce(e);const l=this.applyRedirectCommands(a,r.redirectTo,c);return r.redirectTo.startsWith("/")?Te(l):this.lineralizeSegments(r,l).pipe(Object(M.a)(r=>this.expandSegment(t,e,n,r.concat(i.slice(u)),o,!1)))}matchSegmentAgainstRoute(t,e,n,r){if("**"===n.path)return n.loadChildren?this.configLoader.load(t.injector,n).pipe(Object(w.a)(t=>(n._loadedConfig=t,new St(r,{})))):Object(o.a)(new St(r,{}));const{matched:i,consumedSegments:s,lastChild:a}=je(e,n,r);if(!i)return Ce(e);const u=r.slice(a);return this.getChildConfig(t,n,r).pipe(Object(M.a)(t=>{const n=t.module,r=t.routes,{segmentGroup:i,slicedSegments:a}=function(t,e,n,r){return n.length>0&&function(t,e,n){return n.some(n=>Ae(t,e,n)&&ke(n)!==ft)}(t,n,r)?{segmentGroup:xe(new St(e,function(t,e){const n={};n[ft]=e;for(const r of t)""===r.path&&ke(r)!==ft&&(n[ke(r)]=new St([],{}));return n}(r,new St(n,t.children)))),slicedSegments:[]}:0===n.length&&function(t,e,n){return n.some(n=>Ae(t,e,n))}(t,n,r)?{segmentGroup:xe(new St(t.segments,function(t,e,n,r){const i={};for(const o of n)Ae(t,e,o)&&!r[ke(o)]&&(i[ke(o)]=new St([],{}));return Object.assign(Object.assign({},r),i)}(t,n,r,t.children))),slicedSegments:n}:{segmentGroup:t,slicedSegments:n}}(e,s,u,r);return 0===a.length&&i.hasChildren()?this.expandChildren(n,r,i).pipe(Object(w.a)(t=>new St(s,t))):0===r.length&&0===a.length?Object(o.a)(new St(s,{})):this.expandSegment(n,i,r,a,ft,!0).pipe(Object(w.a)(t=>new St(s.concat(t.segments),t.children)))}))}getChildConfig(t,e,n){return e.children?Object(o.a)(new be(e.children,t)):e.loadChildren?void 0!==e._loadedConfig?Object(o.a)(e._loadedConfig):this.runCanLoadGuards(t.injector,e,n).pipe(Object(M.a)(n=>n?this.configLoader.load(t.injector,e).pipe(Object(w.a)(t=>(e._loadedConfig=t,t))):function(t){return new u.a(e=>e.error(yt(`Cannot load children because the guard of the route "path: '${t.path}'" returned false`)))}(e))):Object(o.a)(new be([],t))}runCanLoadGuards(t,e,n){const r=e.canLoad;return r&&0!==r.length?Object(s.a)(r).pipe(Object(w.a)(r=>{const i=t.get(r);let o;if(function(t){return t&&_e(t.canLoad)}(i))o=i.canLoad(e,n);else{if(!_e(i))throw new Error("Invalid CanLoad guard");o=i(e,n)}return Ot(o)})).pipe(Object(E.a)(),Object(F.a)(t=>{if(!we(t))return;const e=yt(`Redirecting to "${this.urlSerializer.serialize(t)}"`);throw e.url=t,e}),(i=t=>!0===t,t=>t.lift(new U(i,void 0,t)))):Object(o.a)(!0);var i}lineralizeSegments(t,e){let n=[],r=e.root;for(;;){if(n=n.concat(r.segments),0===r.numberOfChildren)return Object(o.a)(n);if(r.numberOfChildren>1||!r.children[ft])return Se(t.redirectTo);r=r.children[ft]}}applyRedirectCommands(t,e,n){return this.applyRedirectCreatreUrlTree(e,this.urlSerializer.parse(e),t,n)}applyRedirectCreatreUrlTree(t,e,n,r){const i=this.createSegmentGroup(t,e.root,n,r);return new Tt(i,this.createQueryParams(e.queryParams,this.urlTree.queryParams),e.fragment)}createQueryParams(t,e){const n={};return Et(t,(t,r)=>{if("string"==typeof t&&t.startsWith(":")){const i=t.substring(1);n[r]=e[i]}else n[r]=t}),n}createSegmentGroup(t,e,n,r){const i=this.createSegments(t,e.segments,n,r);let o={};return Et(e.children,(e,i)=>{o[i]=this.createSegmentGroup(t,e,n,r)}),new St(i,o)}createSegments(t,e,n,r){return e.map(e=>e.path.startsWith(":")?this.findPosParam(t,e,r):this.findOrReturn(e,n))}findPosParam(t,e,n){const r=n[e.path.substring(1)];if(!r)throw new Error(`Cannot redirect to '${t}'. Cannot find '${e.path}'.`);return r}findOrReturn(t,e){let n=0;for(const r of e){if(r.path===t.path)return e.splice(n),r;n++}return t}}function je(t,e,n){if(""===e.path)return"full"===e.pathMatch&&(t.hasChildren()||n.length>0)?{matched:!1,consumedSegments:[],lastChild:0,positionalParamSegments:{}}:{matched:!0,consumedSegments:[],lastChild:0,positionalParamSegments:{}};const r=(e.matcher||vt)(n,t,e);return r?{matched:!0,consumedSegments:r.consumed,lastChild:r.consumed.length,positionalParamSegments:r.posParams}:{matched:!1,consumedSegments:[],lastChild:0,positionalParamSegments:{}}}function xe(t){if(1===t.numberOfChildren&&t.children[ft]){const e=t.children[ft];return new St(t.segments.concat(e.segments),e.children)}return t}function Ae(t,e,n){return(!(t.hasChildren()||e.length>0)||"full"!==n.pathMatch)&&""===n.path&&void 0!==n.redirectTo}function ke(t){return t.outlet||ft}class Ne{constructor(t){this.path=t,this.route=this.path[this.path.length-1]}}class Re{constructor(t,e){this.component=t,this.route=e}}function Pe(t,e,n){const r=t._root;return function t(e,n,r,i,o={canDeactivateChecks:[],canActivateChecks:[]}){const s=Kt(n);return e.children.forEach(e=>{!function(e,n,r,i,o={canDeactivateChecks:[],canActivateChecks:[]}){const s=e.value,a=n?n.value:null,u=r?r.getContext(e.value.outlet):null;if(a&&s.routeConfig===a.routeConfig){const c=function(t,e,n){if("function"==typeof n)return n(t,e);switch(n){case"pathParamsChange":return!jt(t.url,e.url);case"pathParamsOrQueryParamsChange":return!jt(t.url,e.url)||!mt(t.queryParams,e.queryParams);case"always":return!0;case"paramsOrQueryParamsChange":return!oe(t,e)||!mt(t.queryParams,e.queryParams);case"paramsChange":default:return!oe(t,e)}}(a,s,s.routeConfig.runGuardsAndResolvers);c?o.canActivateChecks.push(new Ne(i)):(s.data=a.data,s._resolvedData=a._resolvedData),t(e,n,s.component?u?u.children:null:r,i,o),c&&o.canDeactivateChecks.push(new Re(u&&u.outlet&&u.outlet.component||null,a))}else a&&Le(n,u,o),o.canActivateChecks.push(new Ne(i)),t(e,null,s.component?u?u.children:null:r,i,o)}(e,s[e.value.outlet],r,i.concat([e.value]),o),delete s[e.value.outlet]}),Et(s,(t,e)=>Le(t,r.getContext(e),o)),o}(r,e?e._root:null,n,[r.value])}function De(t,e,n){const r=function(t){if(!t)return null;for(let e=t.parent;e;e=e.parent){const t=e.routeConfig;if(t&&t._loadedConfig)return t._loadedConfig}return null}(e);return(r?r.module.injector:n).get(t)}function Le(t,e,n){const r=Kt(t),i=t.value;Et(r,(t,r)=>{Le(t,i.component?e?e.children.getContext(r):null:e,n)}),n.canDeactivateChecks.push(new Re(i.component&&e&&e.outlet&&e.outlet.isActivated?e.outlet.component:null,i))}const Me=Symbol("INITIAL_VALUE");function Fe(){return Object(V.a)(t=>function(...t){let e=null,n=null;return Object(l.a)(t[t.length-1])&&(n=t.pop()),"function"==typeof t[t.length-1]&&(e=t.pop()),1===t.length&&Object(h.a)(t[0])&&(t=t[0]),Object(p.a)(t,n).lift(new y(e))}(...t.map(t=>t.pipe(Object(q.a)(1),Object(H.a)(Me)))).pipe(Object(B.a)((t,e)=>{let n=!1;return e.reduce((t,r,i)=>{if(t!==Me)return t;if(r===Me&&(n=!0),!n){if(!1===r)return r;if(i===e.length-1||we(r))return r}return t},t)},Me),Object(O.a)(t=>t!==Me),Object(w.a)(t=>we(t)?t:!0===t),Object(q.a)(1)))}function Ue(t,e){return null!==t&&e&&e(new lt(t)),Object(o.a)(!0)}function $e(t,e){return null!==t&&e&&e(new ut(t)),Object(o.a)(!0)}function Ve(t,e,n){const r=e.routeConfig?e.routeConfig.canActivate:null;if(!r||0===r.length)return Object(o.a)(!0);const i=r.map(r=>Object(m.a)(()=>{const i=De(r,e,n);let o;if(function(t){return t&&_e(t.canActivate)}(i))o=Ot(i.canActivate(e,t));else{if(!_e(i))throw new Error("Invalid CanActivate guard");o=Ot(i(e,t))}return o.pipe(Object(L.a)())}));return Object(o.a)(i).pipe(Fe())}function qe(t,e,n){const r=e[e.length-1],i=e.slice(0,e.length-1).reverse().map(t=>function(t){const e=t.routeConfig?t.routeConfig.canActivateChild:null;return e&&0!==e.length?{node:t,guards:e}:null}(t)).filter(t=>null!==t).map(e=>Object(m.a)(()=>{const i=e.guards.map(i=>{const o=De(i,e.node,n);let s;if(function(t){return t&&_e(t.canActivateChild)}(o))s=Ot(o.canActivateChild(r,t));else{if(!_e(o))throw new Error("Invalid CanActivateChild guard");s=Ot(o(r,t))}return s.pipe(Object(L.a)())});return Object(o.a)(i).pipe(Fe())}));return Object(o.a)(i).pipe(Fe())}class He{}class Be{constructor(t,e,n,r,i,o){this.rootComponentType=t,this.config=e,this.urlTree=n,this.url=r,this.paramsInheritanceStrategy=i,this.relativeLinkResolution=o}recognize(){try{const t=Ge(this.urlTree.root,[],[],this.config,this.relativeLinkResolution).segmentGroup,e=this.processSegmentGroup(this.config,t,ft),n=new te([],Object.freeze({}),Object.freeze(Object.assign({},this.urlTree.queryParams)),this.urlTree.fragment,{},ft,this.rootComponentType,null,this.urlTree.root,-1,{}),r=new Qt(n,e),i=new ee(this.url,r);return this.inheritParamsAndData(i._root),Object(o.a)(i)}catch(t){return new u.a(e=>e.error(t))}}inheritParamsAndData(t){const e=t.value,n=Zt(e,this.paramsInheritanceStrategy);e.params=Object.freeze(n.params),e.data=Object.freeze(n.data),t.children.forEach(t=>this.inheritParamsAndData(t))}processSegmentGroup(t,e,n){return 0===e.segments.length&&e.hasChildren()?this.processChildren(t,e):this.processSegment(t,e,e.segments,n)}processChildren(t,e){const n=xt(e,(e,n)=>this.processSegmentGroup(t,e,n));return function(t){const e={};t.forEach(t=>{const n=e[t.value.outlet];if(n){const e=n.url.map(t=>t.toString()).join("/"),r=t.value.url.map(t=>t.toString()).join("/");throw new Error(`Two segments cannot have the same outlet name: '${e}' and '${r}'.`)}e[t.value.outlet]=t.value})}(n),n.sort((t,e)=>t.value.outlet===ft?-1:e.value.outlet===ft?1:t.value.outlet.localeCompare(e.value.outlet)),n}processSegment(t,e,n,r){for(const o of t)try{return this.processSegmentAgainstRoute(o,e,n,r)}catch(i){if(!(i instanceof He))throw i}if(this.noLeftoversInUrl(e,n,r))return[];throw new He}noLeftoversInUrl(t,e,n){return 0===e.length&&!t.children[n]}processSegmentAgainstRoute(t,e,n,r){if(t.redirectTo)throw new He;if((t.outlet||ft)!==r)throw new He;let i,o=[],s=[];if("**"===t.path){const o=n.length>0?wt(n).parameters:{};i=new te(n,o,Object.freeze(Object.assign({},this.urlTree.queryParams)),this.urlTree.fragment,Xe(t),r,t.component,t,ze(e),We(e)+n.length,Ye(t))}else{const a=function(t,e,n){if(""===e.path){if("full"===e.pathMatch&&(t.hasChildren()||n.length>0))throw new He;return{consumedSegments:[],lastChild:0,parameters:{}}}const r=(e.matcher||vt)(n,t,e);if(!r)throw new He;const i={};Et(r.posParams,(t,e)=>{i[e]=t.path});const o=r.consumed.length>0?Object.assign(Object.assign({},i),r.consumed[r.consumed.length-1].parameters):i;return{consumedSegments:r.consumed,lastChild:r.consumed.length,parameters:o}}(e,t,n);o=a.consumedSegments,s=n.slice(a.lastChild),i=new te(o,a.parameters,Object.freeze(Object.assign({},this.urlTree.queryParams)),this.urlTree.fragment,Xe(t),r,t.component,t,ze(e),We(e)+o.length,Ye(t))}const a=function(t){return t.children?t.children:t.loadChildren?t._loadedConfig.routes:[]}(t),{segmentGroup:u,slicedSegments:c}=Ge(e,o,s,a,this.relativeLinkResolution);if(0===c.length&&u.hasChildren()){const t=this.processChildren(a,u);return[new Qt(i,t)]}if(0===a.length&&0===c.length)return[new Qt(i,[])];const l=this.processSegment(a,u,c,ft);return[new Qt(i,l)]}}function ze(t){let e=t;for(;e._sourceSegment;)e=e._sourceSegment;return e}function We(t){let e=t,n=e._segmentIndexShift?e._segmentIndexShift:0;for(;e._sourceSegment;)e=e._sourceSegment,n+=e._segmentIndexShift?e._segmentIndexShift:0;return n-1}function Ge(t,e,n,r,i){if(n.length>0&&function(t,e,n){return n.some(n=>Qe(t,e,n)&&Ke(n)!==ft)}(t,n,r)){const i=new St(e,function(t,e,n,r){const i={};i[ft]=r,r._sourceSegment=t,r._segmentIndexShift=e.length;for(const o of n)if(""===o.path&&Ke(o)!==ft){const n=new St([],{});n._sourceSegment=t,n._segmentIndexShift=e.length,i[Ke(o)]=n}return i}(t,e,r,new St(n,t.children)));return i._sourceSegment=t,i._segmentIndexShift=e.length,{segmentGroup:i,slicedSegments:[]}}if(0===n.length&&function(t,e,n){return n.some(n=>Qe(t,e,n))}(t,n,r)){const o=new St(t.segments,function(t,e,n,r,i,o){const s={};for(const a of r)if(Qe(t,n,a)&&!i[Ke(a)]){const n=new St([],{});n._sourceSegment=t,n._segmentIndexShift="legacy"===o?t.segments.length:e.length,s[Ke(a)]=n}return Object.assign(Object.assign({},i),s)}(t,e,n,r,t.children,i));return o._sourceSegment=t,o._segmentIndexShift=e.length,{segmentGroup:o,slicedSegments:n}}const o=new St(t.segments,t.children);return o._sourceSegment=t,o._segmentIndexShift=e.length,{segmentGroup:o,slicedSegments:n}}function Qe(t,e,n){return(!(t.hasChildren()||e.length>0)||"full"!==n.pathMatch)&&""===n.path&&void 0===n.redirectTo}function Ke(t){return t.outlet||ft}function Xe(t){return t.data||{}}function Ye(t){return t.resolve||{}}function Je(t){return function(e){return e.pipe(Object(V.a)(e=>{const n=t(e);return n?Object(s.a)(n).pipe(Object(w.a)(()=>e)):Object(s.a)([e])}))}}class Ze{}class tn{shouldDetach(t){return!1}store(t,e){}shouldAttach(t){return!1}retrieve(t){return null}shouldReuseRoute(t,e){return t.routeConfig===e.routeConfig}}let en=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=i.Bb({type:t,selectors:[["ng-component"]],decls:1,vars:0,template:function(t,e){1&t&&i.Ib(0,"router-outlet")},directives:function(){return[mn]},encapsulation:2}),t})();function nn(t,e=""){for(let n=0;n<t.length;n++){const r=t[n];rn(r,on(e,r))}}function rn(t,e){if(!t)throw new Error(`\n      Invalid configuration of route '${e}': Encountered undefined route.\n      The reason might be an extra comma.\n\n      Example:\n      const routes: Routes = [\n        { path: '', redirectTo: '/dashboard', pathMatch: 'full' },\n        { path: 'dashboard',  component: DashboardComponent },, << two commas\n        { path: 'detail/:id', component: HeroDetailComponent }\n      ];\n    `);if(Array.isArray(t))throw new Error(`Invalid configuration of route '${e}': Array cannot be specified`);if(!t.component&&!t.children&&!t.loadChildren&&t.outlet&&t.outlet!==ft)throw new Error(`Invalid configuration of route '${e}': a componentless route without children or loadChildren cannot have a named outlet set`);if(t.redirectTo&&t.children)throw new Error(`Invalid configuration of route '${e}': redirectTo and children cannot be used together`);if(t.redirectTo&&t.loadChildren)throw new Error(`Invalid configuration of route '${e}': redirectTo and loadChildren cannot be used together`);if(t.children&&t.loadChildren)throw new Error(`Invalid configuration of route '${e}': children and loadChildren cannot be used together`);if(t.redirectTo&&t.component)throw new Error(`Invalid configuration of route '${e}': redirectTo and component cannot be used together`);if(t.path&&t.matcher)throw new Error(`Invalid configuration of route '${e}': path and matcher cannot be used together`);if(void 0===t.redirectTo&&!t.component&&!t.children&&!t.loadChildren)throw new Error(`Invalid configuration of route '${e}'. One of the following must be provided: component, redirectTo, children or loadChildren`);if(void 0===t.path&&void 0===t.matcher)throw new Error(`Invalid configuration of route '${e}': routes must have either a path or a matcher specified`);if("string"==typeof t.path&&"/"===t.path.charAt(0))throw new Error(`Invalid configuration of route '${e}': path cannot start with a slash`);if(""===t.path&&void 0!==t.redirectTo&&void 0===t.pathMatch)throw new Error(`Invalid configuration of route '{path: "${e}", redirectTo: "${t.redirectTo}"}': please provide 'pathMatch'. The default value of 'pathMatch' is 'prefix', but often the intent is to use 'full'.`);if(void 0!==t.pathMatch&&"full"!==t.pathMatch&&"prefix"!==t.pathMatch)throw new Error(`Invalid configuration of route '${e}': pathMatch can only be set to 'prefix' or 'full'`);t.children&&nn(t.children,e)}function on(t,e){return e?t||e.path?t&&!e.path?t+"/":!t&&e.path?e.path:`${t}/${e.path}`:"":t}function sn(t){const e=t.children&&t.children.map(sn),n=e?Object.assign(Object.assign({},t),{children:e}):Object.assign({},t);return!n.component&&(e||n.loadChildren)&&n.outlet&&n.outlet!==ft&&(n.component=en),n}const an=new i.q("ROUTES");class un{constructor(t,e,n,r){this.loader=t,this.compiler=e,this.onLoadStartListener=n,this.onLoadEndListener=r}load(t,e){return this.onLoadStartListener&&this.onLoadStartListener(e),this.loadModuleFactory(e.loadChildren).pipe(Object(w.a)(n=>{this.onLoadEndListener&&this.onLoadEndListener(e);const r=n.create(t);return new be(_t(r.injector.get(an)).map(sn),r)}))}loadModuleFactory(t){return"string"==typeof t?Object(s.a)(this.loader.load(t)):Ot(t()).pipe(Object(M.a)(t=>t instanceof i.v?Object(o.a)(t):Object(s.a)(this.compiler.compileModuleAsync(t))))}}class cn{constructor(){this.outlet=null,this.route=null,this.resolver=null,this.children=new ln,this.attachRef=null}}class ln{constructor(){this.contexts=new Map}onChildOutletCreated(t,e){const n=this.getOrCreateContext(t);n.outlet=e,this.contexts.set(t,n)}onChildOutletDestroyed(t){const e=this.getContext(t);e&&(e.outlet=null)}onOutletDeactivated(){const t=this.contexts;return this.contexts=new Map,t}onOutletReAttached(t){this.contexts=t}getOrCreateContext(t){let e=this.getContext(t);return e||(e=new cn,this.contexts.set(t,e)),e}getContext(t){return this.contexts.get(t)||null}}class hn{shouldProcessUrl(t){return!0}extract(t){return t}merge(t,e){return t}}function dn(t){throw t}function fn(t,e,n){return e.parse("/")}function pn(t,e){return Object(o.a)(null)}let gn=(()=>{class t{constructor(t,e,n,r,o,s,u,c){this.rootComponentType=t,this.urlSerializer=e,this.rootContexts=n,this.location=r,this.config=c,this.lastSuccessfulNavigation=null,this.currentNavigation=null,this.navigationId=0,this.isNgZoneEnabled=!1,this.events=new _.a,this.errorHandler=dn,this.malformedUriErrorHandler=fn,this.navigated=!1,this.lastSuccessfulId=-1,this.hooks={beforePreactivation:pn,afterPreactivation:pn},this.urlHandlingStrategy=new hn,this.routeReuseStrategy=new tn,this.onSameUrlNavigation="ignore",this.paramsInheritanceStrategy="emptyOnly",this.urlUpdateStrategy="deferred",this.relativeLinkResolution="legacy",this.ngModule=o.get(i.x),this.console=o.get(i.X);const l=o.get(i.z);this.isNgZoneEnabled=l instanceof i.z,this.resetConfig(c),this.currentUrlTree=new Tt(new St([],{}),{},null),this.rawUrlTree=this.currentUrlTree,this.browserUrlTree=this.currentUrlTree,this.configLoader=new un(s,u,t=>this.triggerEvent(new st(t)),t=>this.triggerEvent(new at(t))),this.routerState=Yt(this.currentUrlTree,this.rootComponentType),this.transitions=new a.a({id:0,currentUrlTree:this.currentUrlTree,currentRawUrl:this.currentUrlTree,extractedUrl:this.urlHandlingStrategy.extract(this.currentUrlTree),urlAfterRedirects:this.urlHandlingStrategy.extract(this.currentUrlTree),rawUrl:this.currentUrlTree,extras:{},resolve:null,reject:null,promise:Promise.resolve(!0),source:"imperative",restoredState:null,currentSnapshot:this.routerState.snapshot,targetSnapshot:null,currentRouterState:this.routerState,targetRouterState:null,guards:{canActivateChecks:[],canDeactivateChecks:[]},guardsResult:null}),this.navigations=this.setupNavigations(this.transitions),this.processNavigations()}setupNavigations(t){const e=this.events;return t.pipe(Object(O.a)(t=>0!==t.id),Object(w.a)(t=>Object.assign(Object.assign({},t),{extractedUrl:this.urlHandlingStrategy.extract(t.rawUrl)})),Object(V.a)(t=>{let n=!1,r=!1;return Object(o.a)(t).pipe(Object(F.a)(t=>{this.currentNavigation={id:t.id,initialUrl:t.currentRawUrl,extractedUrl:t.extractedUrl,trigger:t.source,extras:t.extras,previousNavigation:this.lastSuccessfulNavigation?Object.assign(Object.assign({},this.lastSuccessfulNavigation),{previousNavigation:null}):null}}),Object(V.a)(t=>{const n=!this.navigated||t.extractedUrl.toString()!==this.browserUrlTree.toString();if(("reload"===this.onSameUrlNavigation||n)&&this.urlHandlingStrategy.shouldProcessUrl(t.rawUrl))return Object(o.a)(t).pipe(Object(V.a)(t=>{const n=this.transitions.getValue();return e.next(new Y(t.id,this.serializeUrl(t.extractedUrl),t.source,t.restoredState)),n!==this.transitions.getValue()?b.a:[t]}),Object(V.a)(t=>Promise.resolve(t)),(r=this.ngModule.injector,i=this.configLoader,s=this.urlSerializer,a=this.config,function(t){return t.pipe(Object(V.a)(t=>function(t,e,n,r,i){return new Ie(t,e,n,r,i).apply()}(r,i,s,t.extractedUrl,a).pipe(Object(w.a)(e=>Object.assign(Object.assign({},t),{urlAfterRedirects:e})))))}),Object(F.a)(t=>{this.currentNavigation=Object.assign(Object.assign({},this.currentNavigation),{finalUrl:t.urlAfterRedirects})}),function(t,e,n,r,i){return function(o){return o.pipe(Object(M.a)(o=>function(t,e,n,r,i="emptyOnly",o="legacy"){return new Be(t,e,n,r,i,o).recognize()}(t,e,o.urlAfterRedirects,n(o.urlAfterRedirects),r,i).pipe(Object(w.a)(t=>Object.assign(Object.assign({},o),{targetSnapshot:t})))))}}(this.rootComponentType,this.config,t=>this.serializeUrl(t),this.paramsInheritanceStrategy,this.relativeLinkResolution),Object(F.a)(t=>{"eager"===this.urlUpdateStrategy&&(t.extras.skipLocationChange||this.setBrowserUrl(t.urlAfterRedirects,!!t.extras.replaceUrl,t.id,t.extras.state),this.browserUrlTree=t.urlAfterRedirects)}),Object(F.a)(t=>{const n=new et(t.id,this.serializeUrl(t.extractedUrl),this.serializeUrl(t.urlAfterRedirects),t.targetSnapshot);e.next(n)}));var r,i,s,a;if(n&&this.rawUrlTree&&this.urlHandlingStrategy.shouldProcessUrl(this.rawUrlTree)){const{id:n,extractedUrl:r,source:i,restoredState:s,extras:a}=t,u=new Y(n,this.serializeUrl(r),i,s);e.next(u);const c=Yt(r,this.rootComponentType).snapshot;return Object(o.a)(Object.assign(Object.assign({},t),{targetSnapshot:c,urlAfterRedirects:r,extras:Object.assign(Object.assign({},a),{skipLocationChange:!1,replaceUrl:!1})}))}return this.rawUrlTree=t.rawUrl,this.browserUrlTree=t.urlAfterRedirects,t.resolve(null),b.a}),Je(t=>{const{targetSnapshot:e,id:n,extractedUrl:r,rawUrl:i,extras:{skipLocationChange:o,replaceUrl:s}}=t;return this.hooks.beforePreactivation(e,{navigationId:n,appliedUrlTree:r,rawUrlTree:i,skipLocationChange:!!o,replaceUrl:!!s})}),Object(F.a)(t=>{const e=new nt(t.id,this.serializeUrl(t.extractedUrl),this.serializeUrl(t.urlAfterRedirects),t.targetSnapshot);this.triggerEvent(e)}),Object(w.a)(t=>Object.assign(Object.assign({},t),{guards:Pe(t.targetSnapshot,t.currentSnapshot,this.rootContexts)})),function(t,e){return function(n){return n.pipe(Object(M.a)(n=>{const{targetSnapshot:r,currentSnapshot:i,guards:{canActivateChecks:a,canDeactivateChecks:u}}=n;return 0===u.length&&0===a.length?Object(o.a)(Object.assign(Object.assign({},n),{guardsResult:!0})):function(t,e,n,r){return Object(s.a)(t).pipe(Object(M.a)(t=>function(t,e,n,r,i){const s=e&&e.routeConfig?e.routeConfig.canDeactivate:null;if(!s||0===s.length)return Object(o.a)(!0);const a=s.map(o=>{const s=De(o,e,i);let a;if(function(t){return t&&_e(t.canDeactivate)}(s))a=Ot(s.canDeactivate(t,e,n,r));else{if(!_e(s))throw new Error("Invalid CanDeactivate guard");a=Ot(s(t,e,n,r))}return a.pipe(Object(L.a)())});return Object(o.a)(a).pipe(Fe())}(t.component,t.route,n,e,r)),Object(L.a)(t=>!0!==t,!0))}(u,r,i,t).pipe(Object(M.a)(n=>n&&"boolean"==typeof n?function(t,e,n,r){return Object(s.a)(e).pipe(z(e=>Object(s.a)([$e(e.route.parent,r),Ue(e.route,r),qe(t,e.path,n),Ve(t,e.route,n)]).pipe(Object(E.a)(),Object(L.a)(t=>!0!==t,!0))),Object(L.a)(t=>!0!==t,!0))}(r,a,t,e):Object(o.a)(n)),Object(w.a)(t=>Object.assign(Object.assign({},n),{guardsResult:t})))}))}}(this.ngModule.injector,t=>this.triggerEvent(t)),Object(F.a)(t=>{if(we(t.guardsResult)){const e=yt(`Redirecting to "${this.serializeUrl(t.guardsResult)}"`);throw e.url=t.guardsResult,e}}),Object(F.a)(t=>{const e=new rt(t.id,this.serializeUrl(t.extractedUrl),this.serializeUrl(t.urlAfterRedirects),t.targetSnapshot,!!t.guardsResult);this.triggerEvent(e)}),Object(O.a)(t=>{if(!t.guardsResult){this.resetUrlToCurrentUrlTree();const n=new Z(t.id,this.serializeUrl(t.extractedUrl),"");return e.next(n),t.resolve(!1),!1}return!0}),Je(t=>{if(t.guards.canActivateChecks.length)return Object(o.a)(t).pipe(Object(F.a)(t=>{const e=new it(t.id,this.serializeUrl(t.extractedUrl),this.serializeUrl(t.urlAfterRedirects),t.targetSnapshot);this.triggerEvent(e)}),Object(V.a)(t=>{let n=!1;return Object(o.a)(t).pipe((r=this.paramsInheritanceStrategy,i=this.ngModule.injector,function(t){return t.pipe(Object(M.a)(t=>{const{targetSnapshot:e,guards:{canActivateChecks:n}}=t;if(!n.length)return Object(o.a)(t);let a=0;return Object(s.a)(n).pipe(z(t=>function(t,e,n,r){return function(t,e,n,r){const i=Object.keys(t);if(0===i.length)return Object(o.a)({});const a={};return Object(s.a)(i).pipe(Object(M.a)(i=>function(t,e,n,r){const i=De(t,e,r);return Ot(i.resolve?i.resolve(e,n):i(e,n))}(t[i],e,n,r).pipe(Object(F.a)(t=>{a[i]=t}))),S(1),Object(M.a)(()=>Object.keys(a).length===i.length?Object(o.a)(a):b.a))}(t._resolve,t,e,r).pipe(Object(w.a)(e=>(t._resolvedData=e,t.data=Object.assign(Object.assign({},t.data),Zt(t,n).resolve),null)))}(t.route,e,r,i)),Object(F.a)(()=>a++),S(1),Object(M.a)(e=>a===n.length?Object(o.a)(t):b.a))}))}),Object(F.a)({next:()=>n=!0,complete:()=>{if(!n){const n=new Z(t.id,this.serializeUrl(t.extractedUrl),"At least one route resolver didn't emit any value.");e.next(n),t.resolve(!1)}}}));var r,i}),Object(F.a)(t=>{const e=new ot(t.id,this.serializeUrl(t.extractedUrl),this.serializeUrl(t.urlAfterRedirects),t.targetSnapshot);this.triggerEvent(e)}))}),Je(t=>{const{targetSnapshot:e,id:n,extractedUrl:r,rawUrl:i,extras:{skipLocationChange:o,replaceUrl:s}}=t;return this.hooks.afterPreactivation(e,{navigationId:n,appliedUrlTree:r,rawUrlTree:i,skipLocationChange:!!o,replaceUrl:!!s})}),Object(w.a)(t=>{const e=function(t,e,n){const r=function t(e,n,r){if(r&&e.shouldReuseRoute(n.value,r.value.snapshot)){const i=r.value;i._futureSnapshot=n.value;const o=function(e,n,r){return n.children.map(n=>{for(const i of r.children)if(e.shouldReuseRoute(i.value.snapshot,n.value))return t(e,n,i);return t(e,n)})}(e,n,r);return new Qt(i,o)}{const r=e.retrieve(n.value);if(r){const t=r.route;return function t(e,n){if(e.value.routeConfig!==n.value.routeConfig)throw new Error("Cannot reattach ActivatedRouteSnapshot created from a different route");if(e.children.length!==n.children.length)throw new Error("Cannot reattach ActivatedRouteSnapshot with a different number of children");n.value._futureSnapshot=e.value;for(let r=0;r<e.children.length;++r)t(e.children[r],n.children[r])}(n,t),t}{const r=new Jt(new a.a((i=n.value).url),new a.a(i.params),new a.a(i.queryParams),new a.a(i.fragment),new a.a(i.data),i.outlet,i.component,i),o=n.children.map(n=>t(e,n));return new Qt(r,o)}}var i}(t,e._root,n?n._root:void 0);return new Xt(r,e)}(this.routeReuseStrategy,t.targetSnapshot,t.currentRouterState);return Object.assign(Object.assign({},t),{targetRouterState:e})}),Object(F.a)(t=>{this.currentUrlTree=t.urlAfterRedirects,this.rawUrlTree=this.urlHandlingStrategy.merge(this.currentUrlTree,t.rawUrl),this.routerState=t.targetRouterState,"deferred"===this.urlUpdateStrategy&&(t.extras.skipLocationChange||this.setBrowserUrl(this.rawUrlTree,!!t.extras.replaceUrl,t.id,t.extras.state),this.browserUrlTree=t.urlAfterRedirects)}),(u=this.rootContexts,c=this.routeReuseStrategy,l=t=>this.triggerEvent(t),Object(w.a)(t=>(new ve(c,t.targetRouterState,t.currentRouterState,l).activate(u),t))),Object(F.a)({next(){n=!0},complete(){n=!0}}),(i=()=>{if(!n&&!r){this.resetUrlToCurrentUrlTree();const n=new Z(t.id,this.serializeUrl(t.extractedUrl),`Navigation ID ${t.id} is not equal to the current navigation id ${this.navigationId}`);e.next(n),t.resolve(!1)}this.currentNavigation=null},t=>t.lift(new G(i))),R(n=>{if(r=!0,(i=n)&&i.ngNavigationCancelingError){const r=we(n.url);r||(this.navigated=!0,this.resetStateAndUrl(t.currentRouterState,t.currentUrlTree,t.rawUrl));const i=new Z(t.id,this.serializeUrl(t.extractedUrl),n.message);e.next(i),r?setTimeout(()=>{const e=this.urlHandlingStrategy.merge(n.url,this.rawUrlTree);return this.scheduleNavigation(e,"imperative",null,{skipLocationChange:t.extras.skipLocationChange,replaceUrl:"eager"===this.urlUpdateStrategy},{resolve:t.resolve,reject:t.reject,promise:t.promise})},0):t.resolve(!1)}else{this.resetStateAndUrl(t.currentRouterState,t.currentUrlTree,t.rawUrl);const r=new tt(t.id,this.serializeUrl(t.extractedUrl),n);e.next(r);try{t.resolve(this.errorHandler(n))}catch(o){t.reject(o)}}var i;return b.a}));var i,u,c,l}))}resetRootComponentType(t){this.rootComponentType=t,this.routerState.root.component=this.rootComponentType}getTransition(){const t=this.transitions.value;return t.urlAfterRedirects=this.browserUrlTree,t}setTransition(t){this.transitions.next(Object.assign(Object.assign({},this.getTransition()),t))}initialNavigation(){this.setUpLocationChangeListener(),0===this.navigationId&&this.navigateByUrl(this.location.path(!0),{replaceUrl:!0})}setUpLocationChangeListener(){this.locationSubscription||(this.locationSubscription=this.location.subscribe(t=>{let e=this.parseUrl(t.url);const n="popstate"===t.type?"popstate":"hashchange",r=t.state&&t.state.navigationId?t.state:null;setTimeout(()=>{this.scheduleNavigation(e,n,r,{replaceUrl:!0})},0)}))}get url(){return this.serializeUrl(this.currentUrlTree)}getCurrentNavigation(){return this.currentNavigation}triggerEvent(t){this.events.next(t)}resetConfig(t){nn(t),this.config=t.map(sn),this.navigated=!1,this.lastSuccessfulId=-1}ngOnDestroy(){this.dispose()}dispose(){this.locationSubscription&&(this.locationSubscription.unsubscribe(),this.locationSubscription=null)}createUrlTree(t,e={}){const{relativeTo:n,queryParams:r,fragment:o,preserveQueryParams:s,queryParamsHandling:a,preserveFragment:u}=e;Object(i.U)()&&s&&console&&console.warn&&console.warn("preserveQueryParams is deprecated, use queryParamsHandling instead.");const c=n||this.routerState.root,l=u?this.currentUrlTree.fragment:o;let h=null;if(a)switch(a){case"merge":h=Object.assign(Object.assign({},this.currentUrlTree.queryParams),r);break;case"preserve":h=this.currentUrlTree.queryParams;break;default:h=r||null}else h=s?this.currentUrlTree.queryParams:r||null;return null!==h&&(h=this.removeEmptyProps(h)),function(t,e,n,r,i){if(0===n.length)return ae(e.root,e.root,e,r,i);const o=function(t){if("string"==typeof t[0]&&1===t.length&&"/"===t[0])return new ue(!0,0,t);let e=0,n=!1;const r=t.reduce((t,r,i)=>{if("object"==typeof r&&null!=r){if(r.outlets){const e={};return Et(r.outlets,(t,n)=>{e[n]="string"==typeof t?t.split("/"):t}),[...t,{outlets:e}]}if(r.segmentPath)return[...t,r.segmentPath]}return"string"!=typeof r?[...t,r]:0===i?(r.split("/").forEach((r,i)=>{0==i&&"."===r||(0==i&&""===r?n=!0:".."===r?e++:""!=r&&t.push(r))}),t):[...t,r]},[]);return new ue(n,e,r)}(n);if(o.toRoot())return ae(e.root,new St([],{}),e,r,i);const s=function(t,e,n){if(t.isAbsolute)return new ce(e.root,!0,0);if(-1===n.snapshot._lastPathIndex){const t=n.snapshot._urlSegment;return new ce(t,t===e.root,0)}const r=se(t.commands[0])?0:1;return function(t,e,n){let r=t,i=e,o=n;for(;o>i;){if(o-=i,r=r.parent,!r)throw new Error("Invalid number of '../'");i=r.segments.length}return new ce(r,!1,i-o)}(n.snapshot._urlSegment,n.snapshot._lastPathIndex+r,t.numberOfDoubleDots)}(o,e,t),a=s.processChildren?de(s.segmentGroup,s.index,o.commands):he(s.segmentGroup,s.index,o.commands);return ae(s.segmentGroup,a,e,r,i)}(c,this.currentUrlTree,t,h,l)}navigateByUrl(t,e={skipLocationChange:!1}){Object(i.U)()&&this.isNgZoneEnabled&&!i.z.isInAngularZone()&&this.console.warn("Navigation triggered outside Angular zone, did you forget to call 'ngZone.run()'?");const n=we(t)?t:this.parseUrl(t),r=this.urlHandlingStrategy.merge(n,this.rawUrlTree);return this.scheduleNavigation(r,"imperative",null,e)}navigate(t,e={skipLocationChange:!1}){return function(t){for(let e=0;e<t.length;e++){const n=t[e];if(null==n)throw new Error(`The requested path contains ${n} segment at index ${e}`)}}(t),this.navigateByUrl(this.createUrlTree(t,e),e)}serializeUrl(t){return this.urlSerializer.serialize(t)}parseUrl(t){let e;try{e=this.urlSerializer.parse(t)}catch(n){e=this.malformedUriErrorHandler(n,this.urlSerializer,t)}return e}isActive(t,e){if(we(t))return Ct(this.currentUrlTree,t,e);const n=this.parseUrl(t);return Ct(this.currentUrlTree,n,e)}removeEmptyProps(t){return Object.keys(t).reduce((e,n)=>{const r=t[n];return null!=r&&(e[n]=r),e},{})}processNavigations(){this.navigations.subscribe(t=>{this.navigated=!0,this.lastSuccessfulId=t.id,this.events.next(new J(t.id,this.serializeUrl(t.extractedUrl),this.serializeUrl(this.currentUrlTree))),this.lastSuccessfulNavigation=this.currentNavigation,this.currentNavigation=null,t.resolve(!0)},t=>{this.console.warn("Unhandled Navigation Error: ")})}scheduleNavigation(t,e,n,r,i){const o=this.getTransition();if(o&&"imperative"!==e&&"imperative"===o.source&&o.rawUrl.toString()===t.toString())return Promise.resolve(!0);if(o&&"hashchange"==e&&"popstate"===o.source&&o.rawUrl.toString()===t.toString())return Promise.resolve(!0);if(o&&"popstate"==e&&"hashchange"===o.source&&o.rawUrl.toString()===t.toString())return Promise.resolve(!0);let s,a,u;i?(s=i.resolve,a=i.reject,u=i.promise):u=new Promise((t,e)=>{s=t,a=e});const c=++this.navigationId;return this.setTransition({id:c,source:e,restoredState:n,currentUrlTree:this.currentUrlTree,currentRawUrl:this.rawUrlTree,rawUrl:t,extras:r,resolve:s,reject:a,promise:u,currentSnapshot:this.routerState.snapshot,currentRouterState:this.routerState}),u.catch(t=>Promise.reject(t))}setBrowserUrl(t,e,n,r){const i=this.urlSerializer.serialize(t);r=r||{},this.location.isCurrentPathEqualTo(i)||e?this.location.replaceState(i,"",Object.assign(Object.assign({},r),{navigationId:n})):this.location.go(i,"",Object.assign(Object.assign({},r),{navigationId:n}))}resetStateAndUrl(t,e,n){this.routerState=t,this.currentUrlTree=e,this.rawUrlTree=this.urlHandlingStrategy.merge(this.currentUrlTree,n),this.resetUrlToCurrentUrlTree()}resetUrlToCurrentUrlTree(){this.location.replaceState(this.urlSerializer.serialize(this.rawUrlTree),"",{navigationId:this.lastSuccessfulId})}}return t.\u0275fac=function(e){return new(e||t)(i.Nb(i.M),i.Nb(At),i.Nb(ln),i.Nb(r.g),i.Nb(i.r),i.Nb(i.w),i.Nb(i.i),i.Nb(void 0))},t.\u0275prov=i.Db({token:t,factory:t.\u0275fac}),t})(),yn=(()=>{class t{constructor(t,e,n,r,i){this.router=t,this.route=e,this.commands=[],this.onChanges=new _.a,null==n&&r.setAttribute(i.nativeElement,"tabindex","0")}ngOnChanges(t){this.onChanges.next(this)}set routerLink(t){this.commands=null!=t?Array.isArray(t)?t:[t]:[]}set preserveQueryParams(t){Object(i.U)()&&console&&console.warn&&console.warn("preserveQueryParams is deprecated!, use queryParamsHandling instead."),this.preserve=t}onClick(){const t={skipLocationChange:vn(this.skipLocationChange),replaceUrl:vn(this.replaceUrl),state:this.state};return this.router.navigateByUrl(this.urlTree,t),!0}get urlTree(){return this.router.createUrlTree(this.commands,{relativeTo:this.route,queryParams:this.queryParams,fragment:this.fragment,preserveQueryParams:vn(this.preserve),queryParamsHandling:this.queryParamsHandling,preserveFragment:vn(this.preserveFragment)})}}return t.\u0275fac=function(e){return new(e||t)(i.Hb(gn),i.Hb(Jt),i.Ob("tabindex"),i.Hb(i.D),i.Hb(i.l))},t.\u0275dir=i.Cb({type:t,selectors:[["","routerLink","",5,"a",5,"area"]],hostBindings:function(t,e){1&t&&i.Rb("click",(function(){return e.onClick()}))},inputs:{routerLink:"routerLink",preserveQueryParams:"preserveQueryParams",queryParams:"queryParams",fragment:"fragment",queryParamsHandling:"queryParamsHandling",preserveFragment:"preserveFragment",skipLocationChange:"skipLocationChange",replaceUrl:"replaceUrl",state:"state"},features:[i.wb]}),t})();function vn(t){return""===t||!!t}let mn=(()=>{class t{constructor(t,e,n,r,o){this.parentContexts=t,this.location=e,this.resolver=n,this.changeDetector=o,this.activated=null,this._activatedRoute=null,this.activateEvents=new i.n,this.deactivateEvents=new i.n,this.name=r||ft,t.onChildOutletCreated(this.name,this)}ngOnDestroy(){this.parentContexts.onChildOutletDestroyed(this.name)}ngOnInit(){if(!this.activated){const t=this.parentContexts.getContext(this.name);t&&t.route&&(t.attachRef?this.attach(t.attachRef,t.route):this.activateWith(t.route,t.resolver||null))}}get isActivated(){return!!this.activated}get component(){if(!this.activated)throw new Error("Outlet is not activated");return this.activated.instance}get activatedRoute(){if(!this.activated)throw new Error("Outlet is not activated");return this._activatedRoute}get activatedRouteData(){return this._activatedRoute?this._activatedRoute.snapshot.data:{}}detach(){if(!this.activated)throw new Error("Outlet is not activated");this.location.detach();const t=this.activated;return this.activated=null,this._activatedRoute=null,t}attach(t,e){this.activated=t,this._activatedRoute=e,this.location.insert(t.hostView)}deactivate(){if(this.activated){const t=this.component;this.activated.destroy(),this.activated=null,this._activatedRoute=null,this.deactivateEvents.emit(t)}}activateWith(t,e){if(this.isActivated)throw new Error("Cannot activate an already activated outlet");this._activatedRoute=t;const n=(e=e||this.resolver).resolveComponentFactory(t._futureSnapshot.routeConfig.component),r=this.parentContexts.getOrCreateContext(this.name).children,i=new bn(t,r,this.location.injector);this.activated=this.location.createComponent(n,this.location.length,i),this.changeDetector.markForCheck(),this.activateEvents.emit(this.activated.instance)}}return t.\u0275fac=function(e){return new(e||t)(i.Hb(ln),i.Hb(i.P),i.Hb(i.j),i.Ob("name"),i.Hb(i.h))},t.\u0275dir=i.Cb({type:t,selectors:[["router-outlet"]],outputs:{activateEvents:"activate",deactivateEvents:"deactivate"},exportAs:["outlet"]}),t})();class bn{constructor(t,e,n){this.route=t,this.childContexts=e,this.parent=n}get(t,e){return t===Jt?this.route:t===ln?this.childContexts:this.parent.get(t,e)}}class _n{}class wn{preload(t,e){return e().pipe(R(()=>Object(o.a)(null)))}}class En{preload(t,e){return Object(o.a)(null)}}let On=(()=>{class t{constructor(t,e,n,r,i){this.router=t,this.injector=r,this.preloadingStrategy=i,this.loader=new un(e,n,e=>t.triggerEvent(new st(e)),e=>t.triggerEvent(new at(e)))}setUpPreloading(){this.subscription=this.router.events.pipe(Object(O.a)(t=>t instanceof J),z(()=>this.preload())).subscribe(()=>{})}preload(){const t=this.injector.get(i.x);return this.processRoutes(t,this.router.config)}ngOnDestroy(){this.subscription&&this.subscription.unsubscribe()}processRoutes(t,e){const n=[];for(const r of e)if(r.loadChildren&&!r.canLoad&&r._loadedConfig){const t=r._loadedConfig;n.push(this.processRoutes(t.module,t.routes))}else r.loadChildren&&!r.canLoad?n.push(this.preloadConfig(t,r)):r.children&&n.push(this.processRoutes(t,r.children));return Object(s.a)(n).pipe(Object(K.a)(),Object(w.a)(t=>{}))}preloadConfig(t,e){return this.preloadingStrategy.preload(e,()=>this.loader.load(t.injector,e).pipe(Object(M.a)(t=>(e._loadedConfig=t,this.processRoutes(t.module,t.routes)))))}}return t.\u0275fac=function(e){return new(e||t)(i.Nb(gn),i.Nb(i.w),i.Nb(i.i),i.Nb(i.r),i.Nb(_n))},t.\u0275prov=i.Db({token:t,factory:t.\u0275fac}),t})(),Cn=(()=>{class t{constructor(t,e,n={}){this.router=t,this.viewportScroller=e,this.options=n,this.lastId=0,this.lastSource="imperative",this.restoredId=0,this.store={},n.scrollPositionRestoration=n.scrollPositionRestoration||"disabled",n.anchorScrolling=n.anchorScrolling||"disabled"}init(){"disabled"!==this.options.scrollPositionRestoration&&this.viewportScroller.setHistoryScrollRestoration("manual"),this.routerEventsSubscription=this.createScrollEvents(),this.scrollEventsSubscription=this.consumeScrollEvents()}createScrollEvents(){return this.router.events.subscribe(t=>{t instanceof Y?(this.store[this.lastId]=this.viewportScroller.getScrollPosition(),this.lastSource=t.navigationTrigger,this.restoredId=t.restoredState?t.restoredState.navigationId:0):t instanceof J&&(this.lastId=t.id,this.scheduleScrollEvent(t,this.router.parseUrl(t.urlAfterRedirects).fragment))})}consumeScrollEvents(){return this.router.events.subscribe(t=>{t instanceof dt&&(t.position?"top"===this.options.scrollPositionRestoration?this.viewportScroller.scrollToPosition([0,0]):"enabled"===this.options.scrollPositionRestoration&&this.viewportScroller.scrollToPosition(t.position):t.anchor&&"enabled"===this.options.anchorScrolling?this.viewportScroller.scrollToAnchor(t.anchor):"disabled"!==this.options.scrollPositionRestoration&&this.viewportScroller.scrollToPosition([0,0]))})}scheduleScrollEvent(t,e){this.router.triggerEvent(new dt(t,"popstate"===this.lastSource?this.store[this.restoredId]:null,e))}ngOnDestroy(){this.routerEventsSubscription&&this.routerEventsSubscription.unsubscribe(),this.scrollEventsSubscription&&this.scrollEventsSubscription.unsubscribe()}}return t.\u0275fac=function(e){return new(e||t)(i.Nb(gn),i.Nb(r.k),i.Nb(void 0))},t.\u0275prov=i.Db({token:t,factory:t.\u0275fac}),t})();const Tn=new i.q("ROUTER_CONFIGURATION"),Sn=new i.q("ROUTER_FORROOT_GUARD"),In=[r.g,{provide:At,useClass:kt},{provide:gn,useFactory:function(t,e,n,i,o,s,a,u={},c,l){const h=new gn(null,t,e,n,i,o,s,_t(a));if(c&&(h.urlHandlingStrategy=c),l&&(h.routeReuseStrategy=l),u.errorHandler&&(h.errorHandler=u.errorHandler),u.malformedUriErrorHandler&&(h.malformedUriErrorHandler=u.malformedUriErrorHandler),u.enableTracing){const t=Object(r.p)();h.events.subscribe(e=>{t.logGroup("Router Event: "+e.constructor.name),t.log(e.toString()),t.log(e),t.logGroupEnd()})}return u.onSameUrlNavigation&&(h.onSameUrlNavigation=u.onSameUrlNavigation),u.paramsInheritanceStrategy&&(h.paramsInheritanceStrategy=u.paramsInheritanceStrategy),u.urlUpdateStrategy&&(h.urlUpdateStrategy=u.urlUpdateStrategy),u.relativeLinkResolution&&(h.relativeLinkResolution=u.relativeLinkResolution),h},deps:[At,ln,r.g,i.r,i.w,i.i,an,Tn,[class{},new i.A],[Ze,new i.A]]},ln,{provide:Jt,useFactory:function(t){return t.routerState.root},deps:[gn]},{provide:i.w,useClass:i.J},On,En,wn,{provide:Tn,useValue:{enableTracing:!1}}];function jn(){return new i.y("Router",gn)}let xn=(()=>{class t{constructor(t,e){}static forRoot(e,n){return{ngModule:t,providers:[In,Rn(e),{provide:Sn,useFactory:Nn,deps:[[gn,new i.A,new i.I]]},{provide:Tn,useValue:n||{}},{provide:r.h,useFactory:kn,deps:[r.j,[new i.p(r.a),new i.A],Tn]},{provide:Cn,useFactory:An,deps:[gn,r.k,Tn]},{provide:_n,useExisting:n&&n.preloadingStrategy?n.preloadingStrategy:En},{provide:i.y,multi:!0,useFactory:jn},[Pn,{provide:i.d,multi:!0,useFactory:Dn,deps:[Pn]},{provide:Mn,useFactory:Ln,deps:[Pn]},{provide:i.b,multi:!0,useExisting:Mn}]]}}static forChild(e){return{ngModule:t,providers:[Rn(e)]}}}return t.\u0275mod=i.Fb({type:t}),t.\u0275inj=i.Eb({factory:function(e){return new(e||t)(i.Nb(Sn,8),i.Nb(gn,8))}}),t})();function An(t,e,n){return n.scrollOffset&&e.setOffset(n.scrollOffset),new Cn(t,e,n)}function kn(t,e,n={}){return n.useHash?new r.e(t,e):new r.i(t,e)}function Nn(t){if(t)throw new Error("RouterModule.forRoot() called twice. Lazy loaded modules should use RouterModule.forChild() instead.");return"guarded"}function Rn(t){return[{provide:i.a,multi:!0,useValue:t},{provide:an,multi:!0,useValue:t}]}let Pn=(()=>{class t{constructor(t){this.injector=t,this.initNavigation=!1,this.resultOfPreactivationDone=new _.a}appInitializer(){return this.injector.get(r.f,Promise.resolve(null)).then(()=>{let t=null;const e=new Promise(e=>t=e),n=this.injector.get(gn),r=this.injector.get(Tn);if(this.isLegacyDisabled(r)||this.isLegacyEnabled(r))t(!0);else if("disabled"===r.initialNavigation)n.setUpLocationChangeListener(),t(!0);else{if("enabled"!==r.initialNavigation)throw new Error(`Invalid initialNavigation options: '${r.initialNavigation}'`);n.hooks.afterPreactivation=()=>this.initNavigation?Object(o.a)(null):(this.initNavigation=!0,t(!0),this.resultOfPreactivationDone),n.initialNavigation()}return e})}bootstrapListener(t){const e=this.injector.get(Tn),n=this.injector.get(On),r=this.injector.get(Cn),o=this.injector.get(gn),s=this.injector.get(i.g);t===s.components[0]&&(this.isLegacyEnabled(e)?o.initialNavigation():this.isLegacyDisabled(e)&&o.setUpLocationChangeListener(),n.setUpPreloading(),r.init(),o.resetRootComponentType(s.componentTypes[0]),this.resultOfPreactivationDone.next(null),this.resultOfPreactivationDone.complete())}isLegacyEnabled(t){return"legacy_enabled"===t.initialNavigation||!0===t.initialNavigation||void 0===t.initialNavigation}isLegacyDisabled(t){return"legacy_disabled"===t.initialNavigation||!1===t.initialNavigation}}return t.\u0275fac=function(e){return new(e||t)(i.Nb(i.r))},t.\u0275prov=i.Db({token:t,factory:t.\u0275fac}),t})();function Dn(t){return t.appInitializer.bind(t)}function Ln(t){return t.bootstrapListener.bind(t)}const Mn=new i.q("Router Initializer")},vkgz:function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var r=n("7o/Q"),i=n("KqfI"),o=n("n6bG");function s(t,e,n){return function(r){return r.lift(new a(t,e,n))}}class a{constructor(t,e,n){this.nextOrObserver=t,this.error=e,this.complete=n}call(t,e){return e.subscribe(new u(t,this.nextOrObserver,this.error,this.complete))}}class u extends r.a{constructor(t,e,n,r){super(t),this._tapNext=i.a,this._tapError=i.a,this._tapComplete=i.a,this._tapError=n||i.a,this._tapComplete=r||i.a,Object(o.a)(e)?(this._context=this,this._tapNext=e):e&&(this._context=e,this._tapNext=e.next||i.a,this._tapError=e.error||i.a,this._tapComplete=e.complete||i.a)}_next(t){try{this._tapNext.call(this._context,t)}catch(e){return void this.destination.error(e)}this.destination.next(t)}_error(t){try{this._tapError.call(this._context,t)}catch(t){return void this.destination.error(t)}this.destination.error(t)}_complete(){try{this._tapComplete.call(this._context)}catch(t){return void this.destination.error(t)}return this.destination.complete()}}},w1tV:function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var r=n("oB13"),i=n("x+ZX"),o=n("XNiG");function s(){return new o.a}function a(){return t=>Object(i.a)()(Object(r.a)(s)(t))}},"x+ZX":function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n("7o/Q");function i(){return function(t){return t.lift(new o(t))}}class o{constructor(t){this.connectable=t}call(t,e){const{connectable:n}=this;n._refCount++;const r=new s(t,n),i=e.subscribe(r);return r.closed||(r.connection=n.connect()),i}}class s extends r.a{constructor(t,e){super(t),this.connectable=e}_unsubscribe(){const{connectable:t}=this;if(!t)return void(this.connection=null);this.connectable=null;const e=t._refCount;if(e<=0)return void(this.connection=null);if(t._refCount=e-1,e>1)return void(this.connection=null);const{connection:n}=this,r=t._connection;this.connection=null,!r||n&&r!==n||r.unsubscribe()}}},xbPD:function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n("7o/Q");function i(t=null){return e=>e.lift(new o(t))}class o{constructor(t){this.defaultValue=t}call(t,e){return e.subscribe(new s(t,this.defaultValue))}}class s extends r.a{constructor(t,e){super(t),this.defaultValue=e,this.isEmpty=!0}_next(t){this.isEmpty=!1,this.destination.next(t)}_complete(){this.isEmpty&&this.destination.next(this.defaultValue),this.destination.complete()}}},xgIS:function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var r=n("HDdC"),i=n("DH7j"),o=n("n6bG"),s=n("lJxs");function a(t,e,n,u){return Object(o.a)(n)&&(u=n,n=void 0),u?a(t,e,n).pipe(Object(s.a)(t=>Object(i.a)(t)?u(...t):u(t))):new r.a(r=>{!function t(e,n,r,i,o){let s;if(function(t){return t&&"function"==typeof t.addEventListener&&"function"==typeof t.removeEventListener}(e)){const t=e;e.addEventListener(n,r,o),s=()=>t.removeEventListener(n,r,o)}else if(function(t){return t&&"function"==typeof t.on&&"function"==typeof t.off}(e)){const t=e;e.on(n,r),s=()=>t.off(n,r)}else if(function(t){return t&&"function"==typeof t.addListener&&"function"==typeof t.removeListener}(e)){const t=e;e.addListener(n,r),s=()=>t.removeListener(n,r)}else{if(!e||!e.length)throw new TypeError("Invalid event target");for(let s=0,a=e.length;s<a;s++)t(e[s],n,r,i,o)}i.add(s)}(t,e,(function(t){r.next(arguments.length>1?Array.prototype.slice.call(arguments):t)}),r,n)})}},y08P:function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));class r{constructor(t,e,n,r,i){this.id=e,this.name=n,this.disableScroll=i,this.priority=1e6*r+e,this.ctrl=t}canStart(){return!!this.ctrl&&this.ctrl.canStart(this.name)}start(){return!!this.ctrl&&this.ctrl.start(this.name,this.id,this.priority)}capture(){if(!this.ctrl)return!1;const t=this.ctrl.capture(this.name,this.id,this.priority);return t&&this.disableScroll&&this.ctrl.disableScroll(this.id),t}release(){this.ctrl&&(this.ctrl.release(this.id),this.disableScroll&&this.ctrl.enableScroll(this.id))}destroy(){this.release(),this.ctrl=void 0}}class i{constructor(t,e,n,r){this.id=e,this.disable=n,this.disableScroll=r,this.ctrl=t}block(){if(this.ctrl){if(this.disable)for(const t of this.disable)this.ctrl.disableGesture(t,this.id);this.disableScroll&&this.ctrl.disableScroll(this.id)}}unblock(){if(this.ctrl){if(this.disable)for(const t of this.disable)this.ctrl.enableGesture(t,this.id);this.disableScroll&&this.ctrl.enableScroll(this.id)}}destroy(){this.unblock(),this.ctrl=void 0}}const o=new class{constructor(){this.gestureId=0,this.requestedStart=new Map,this.disabledGestures=new Map,this.disabledScroll=new Set}createGesture(t){return new r(this,this.newID(),t.name,t.priority||0,!!t.disableScroll)}createBlocker(t={}){return new i(this,this.newID(),t.disable,!!t.disableScroll)}start(t,e,n){return this.canStart(t)?(this.requestedStart.set(e,n),!0):(this.requestedStart.delete(e),!1)}capture(t,e,n){if(!this.start(t,e,n))return!1;const r=this.requestedStart;let i=-1e4;if(r.forEach(t=>{i=Math.max(i,t)}),i===n){this.capturedId=e,r.clear();const n=new CustomEvent("ionGestureCaptured",{detail:{gestureName:t}});return document.dispatchEvent(n),!0}return r.delete(e),!1}release(t){this.requestedStart.delete(t),this.capturedId===t&&(this.capturedId=void 0)}disableGesture(t,e){let n=this.disabledGestures.get(t);void 0===n&&(n=new Set,this.disabledGestures.set(t,n)),n.add(e)}enableGesture(t,e){const n=this.disabledGestures.get(t);void 0!==n&&n.delete(e)}disableScroll(t){this.disabledScroll.add(t),1===this.disabledScroll.size&&document.body.classList.add("backdrop-no-scroll")}enableScroll(t){this.disabledScroll.delete(t),0===this.disabledScroll.size&&document.body.classList.remove("backdrop-no-scroll")}canStart(t){return void 0===this.capturedId&&!this.isDisabled(t)}isCaptured(){return void 0!==this.capturedId}isScrollDisabled(){return this.disabledScroll.size>0}isDisabled(t){const e=this.disabledGestures.get(t);return!!(e&&e.size>0)}newID(){return this.gestureId++,this.gestureId}}},yCtX:function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var r=n("HDdC"),i=n("ngJS"),o=n("jZKg");function s(t,e){return e?Object(o.a)(t,e):new r.a(Object(i.a)(t))}},"z+Ro":function(t,e,n){"use strict";function r(t){return t&&"function"==typeof t.schedule}n.d(e,"a",(function(){return r}))},z6cu:function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n("HDdC");function i(t,e){return new r.a(e?n=>e.schedule(o,0,{error:t,subscriber:n}):e=>e.error(t))}function o({error:t,subscriber:e}){e.error(t)}},zIRd:function(t,e,n){"use strict";var r,i,o=n("O1h7"),s=n("qOnz"),a=n("/6Yf"),u=n("q/0M"),c=((r={})["no-app"]="No Firebase App '{$appName}' has been created - call Firebase App.initializeApp()",r["bad-app-name"]="Illegal App name: '{$appName}",r["duplicate-app"]="Firebase App named '{$appName}' already exists",r["app-deleted"]="Firebase App named '{$appName}' already deleted",r["invalid-app-argument"]="firebase.{$appName}() takes either no argument or a Firebase App instance.",r["invalid-log-argument"]="First argument to `onLog` must be null or a function.",r),l=new s.b("app","Firebase",c),h=((i={})["@firebase/app"]="fire-core",i["@firebase/analytics"]="fire-analytics",i["@firebase/auth"]="fire-auth",i["@firebase/database"]="fire-rtdb",i["@firebase/functions"]="fire-fn",i["@firebase/installations"]="fire-iid",i["@firebase/messaging"]="fire-fcm",i["@firebase/performance"]="fire-perf",i["@firebase/remote-config"]="fire-rc",i["@firebase/storage"]="fire-gcs",i["@firebase/firestore"]="fire-fst",i["fire-js"]="fire-js",i["firebase-wrapper"]="fire-js-all",i),d=new u.b("@firebase/app"),f=function(){function t(t,e,n){var r,i,u=this;this.firebase_=n,this.isDeleted_=!1,this.name_=e.name,this.automaticDataCollectionEnabled_=e.automaticDataCollectionEnabled||!1,this.options_=Object(s.k)(t),this.container=new a.b(e.name),this._addComponent(new a.a("app",(function(){return u}),"PUBLIC"));try{for(var c=Object(o.i)(this.firebase_.INTERNAL.components.values()),l=c.next();!l.done;l=c.next())this._addComponent(l.value)}catch(h){r={error:h}}finally{try{l&&!l.done&&(i=c.return)&&i.call(c)}finally{if(r)throw r.error}}}return Object.defineProperty(t.prototype,"automaticDataCollectionEnabled",{get:function(){return this.checkDestroyed_(),this.automaticDataCollectionEnabled_},set:function(t){this.checkDestroyed_(),this.automaticDataCollectionEnabled_=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"name",{get:function(){return this.checkDestroyed_(),this.name_},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"options",{get:function(){return this.checkDestroyed_(),this.options_},enumerable:!1,configurable:!0}),t.prototype.delete=function(){var t=this;return new Promise((function(e){t.checkDestroyed_(),e()})).then((function(){return t.firebase_.INTERNAL.removeApp(t.name_),Promise.all(t.container.getProviders().map((function(t){return t.delete()})))})).then((function(){t.isDeleted_=!0}))},t.prototype._getService=function(t,e){return void 0===e&&(e="[DEFAULT]"),this.checkDestroyed_(),this.container.getProvider(t).getImmediate({identifier:e})},t.prototype._removeServiceInstance=function(t,e){void 0===e&&(e="[DEFAULT]"),this.container.getProvider(t).clearInstance(e)},t.prototype._addComponent=function(t){try{this.container.addComponent(t)}catch(e){d.debug("Component "+t.name+" failed to register with FirebaseApp "+this.name,e)}},t.prototype._addOrOverwriteComponent=function(t){this.container.addOrOverwriteComponent(t)},t.prototype.checkDestroyed_=function(){if(this.isDeleted_)throw l.create("app-deleted",{appName:this.name_})},t}();f.prototype.name&&f.prototype.options||f.prototype.delete||console.log("dc");var p=function t(){var e=function(t){var e={},n=new Map,r={__esModule:!0,initializeApp:function(n,i){void 0===i&&(i={}),"object"==typeof i&&null!==i||(i={name:i});var o=i;void 0===o.name&&(o.name="[DEFAULT]");var a=o.name;if("string"!=typeof a||!a)throw l.create("bad-app-name",{appName:String(a)});if(Object(s.i)(e,a))throw l.create("duplicate-app",{appName:a});var u=new t(n,o,r);return e[a]=u,u},app:i,registerVersion:function(t,e,n){var r,i=null!==(r=h[t])&&void 0!==r?r:t;n&&(i+="-"+n);var o=i.match(/\s|\//),s=e.match(/\s|\//);if(o||s){var u=['Unable to register library "'+i+'" with version "'+e+'":'];return o&&u.push('library name "'+i+'" contains illegal characters (whitespace or "/")'),o&&s&&u.push("and"),s&&u.push('version name "'+e+'" contains illegal characters (whitespace or "/")'),void d.warn(u.join(" "))}c(new a.a(i+"-version",(function(){return{library:i,version:e}}),"VERSION"))},setLogLevel:u.c,onLog:function(t,e){if(null!==t&&"function"!=typeof t)throw l.create("invalid-log-argument",{appName:name});Object(u.d)(t,e)},apps:null,SDK_VERSION:"8.0.1",INTERNAL:{registerComponent:c,removeApp:function(t){delete e[t]},components:n,useAsService:function(t,e){return"serverAuth"===e?null:e}}};function i(t){if(t=t||"[DEFAULT]",!Object(s.i)(e,t))throw l.create("no-app",{appName:t});return e[t]}function c(a){var u,c,h=a.name;if(n.has(h))return d.debug("There were multiple attempts to register component "+h+"."),"PUBLIC"===a.type?r[h]:null;if(n.set(h,a),"PUBLIC"===a.type){var f=function(t){if(void 0===t&&(t=i()),"function"!=typeof t[h])throw l.create("invalid-app-argument",{appName:h});return t[h]()};void 0!==a.serviceProps&&Object(s.l)(f,a.serviceProps),r[h]=f,t.prototype[h]=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=this._getService.bind(this,h);return n.apply(this,a.multipleInstances?t:[])}}try{for(var p=Object(o.i)(Object.keys(e)),g=p.next();!g.done;g=p.next())e[g.value]._addComponent(a)}catch(y){u={error:y}}finally{try{g&&!g.done&&(c=p.return)&&c.call(p)}finally{if(u)throw u.error}}return"PUBLIC"===a.type?r[h]:null}return r.default=r,Object.defineProperty(r,"apps",{get:function(){return Object.keys(e).map((function(t){return e[t]}))}}),i.App=t,r}(f);return e.INTERNAL=Object(o.a)(Object(o.a)({},e.INTERNAL),{createFirebaseNamespace:t,extendNamespace:function(t){Object(s.l)(e,t)},createSubscribe:s.j,ErrorFactory:s.b,deepExtend:s.l}),e}(),g=function(){function t(t){this.container=t}return t.prototype.getPlatformInfoString=function(){return this.container.getProviders().map((function(t){if(function(t){var e=t.getComponent();return"VERSION"===(null==e?void 0:e.type)}(t)){var e=t.getImmediate();return e.library+"/"+e.version}return null})).filter((function(t){return t})).join(" ")},t}();if(Object(s.p)()&&void 0!==self.firebase){d.warn("\n    Warning: Firebase is already defined in the global scope. Please make sure\n    Firebase library is only loaded once.\n  ");var y=self.firebase.SDK_VERSION;y&&y.indexOf("LITE")>=0&&d.warn("\n    Warning: You are trying to load Firebase while using Firebase Performance standalone script.\n    You should load Firebase Performance with this instance of Firebase to avoid loading duplicate code.\n    ")}var v=p.initializeApp;p.initializeApp=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Object(s.v)()&&d.warn('\n      Warning: This is a browser-targeted Firebase bundle but it appears it is being\n      run in a Node environment.  If running in a Node environment, make sure you\n      are using the bundle specified by the "main" field in package.json.\n      \n      If you are using Webpack, you can specify "main" as the first item in\n      "resolve.mainFields":\n      https://webpack.js.org/configuration/resolve/#resolvemainfields\n      \n      If using Rollup, use the @rollup/plugin-node-resolve plugin and specify "main"\n      as the first item in "mainFields", e.g. [\'main\', \'module\'].\n      https://github.com/rollup/@rollup/plugin-node-resolve\n      '),v.apply(void 0,t)};var m=p;!function(t,e){t.INTERNAL.registerComponent(new a.a("platform-logger",(function(t){return new g(t)}),"PRIVATE")),t.registerVersion("@firebase/app","0.6.13",void 0),t.registerVersion("fire-js","")}(m),e.a=m},zUnb:function(t,e,n){"use strict";n.r(e);var r=n("fXoL");const i={apiKey:"AIzaSyCC4ECHJZ2bAkIHmUYqZeaiZFft3Nrst4k",authDomain:"n322-finalks.firebaseapp.com",databaseURL:"https://n322-finalks.firebaseio.com",projectId:"n322-finalks",storageBucket:"n322-finalks.appspot.com",messagingSenderId:"616522235137",appId:"1:616522235137:web:ba7bcb5fd2ff8760b0ef00",measurementId:"G-J1K3EE1ZD9"};var o=n("ofXK");class s extends o.n{constructor(){super()}supportsDOMEvents(){return!0}}class a extends s{static makeCurrent(){Object(o.r)(new a)}getProperty(t,e){return t[e]}log(t){window.console&&window.console.log&&window.console.log(t)}logGroup(t){window.console&&window.console.group&&window.console.group(t)}logGroupEnd(){window.console&&window.console.groupEnd&&window.console.groupEnd()}onAndCancel(t,e,n){return t.addEventListener(e,n,!1),()=>{t.removeEventListener(e,n,!1)}}dispatchEvent(t,e){t.dispatchEvent(e)}remove(t){return t.parentNode&&t.parentNode.removeChild(t),t}getValue(t){return t.value}createElement(t,e){return(e=e||this.getDefaultDocument()).createElement(t)}createHtmlDocument(){return document.implementation.createHTMLDocument("fakeTitle")}getDefaultDocument(){return document}isElementNode(t){return t.nodeType===Node.ELEMENT_NODE}isShadowRoot(t){return t instanceof DocumentFragment}getGlobalEventTarget(t,e){return"window"===e?window:"document"===e?t:"body"===e?t.body:null}getHistory(){return window.history}getLocation(){return window.location}getBaseHref(t){const e=c||(c=document.querySelector("base"),c)?c.getAttribute("href"):null;return null==e?null:(n=e,u||(u=document.createElement("a")),u.setAttribute("href",n),"/"===u.pathname.charAt(0)?u.pathname:"/"+u.pathname);var n}resetBaseElement(){c=null}getUserAgent(){return window.navigator.userAgent}performanceNow(){return window.performance&&window.performance.now?window.performance.now():(new Date).getTime()}supportsCookies(){return!0}getCookie(t){return Object(o.q)(document.cookie,t)}}let u,c=null;const l=new r.q("TRANSITION_ID"),h=[{provide:r.d,useFactory:function(t,e,n){return()=>{n.get(r.e).donePromise.then(()=>{const n=Object(o.p)();Array.prototype.slice.apply(e.querySelectorAll("style[ng-transition]")).filter(e=>e.getAttribute("ng-transition")===t).forEach(t=>n.remove(t))})}},deps:[l,o.d,r.r],multi:!0}];class d{static init(){Object(r.W)(new d)}addToWindow(t){r.nb.getAngularTestability=(e,n=!0)=>{const r=t.findTestabilityInTree(e,n);if(null==r)throw new Error("Could not find testability for element.");return r},r.nb.getAllAngularTestabilities=()=>t.getAllTestabilities(),r.nb.getAllAngularRootElements=()=>t.getAllRootElements(),r.nb.frameworkStabilizers||(r.nb.frameworkStabilizers=[]),r.nb.frameworkStabilizers.push(t=>{const e=r.nb.getAllAngularTestabilities();let n=e.length,i=!1;const o=function(e){i=i||e,n--,0==n&&t(i)};e.forEach((function(t){t.whenStable(o)}))})}findTestabilityInTree(t,e,n){if(null==e)return null;const r=t.getTestability(e);return null!=r?r:n?Object(o.p)().isShadowRoot(e)?this.findTestabilityInTree(t,e.host,!0):this.findTestabilityInTree(t,e.parentElement,!0):null}}const f=new r.q("EventManagerPlugins");let p=(()=>{class t{constructor(t,e){this._zone=e,this._eventNameToPlugin=new Map,t.forEach(t=>t.manager=this),this._plugins=t.slice().reverse()}addEventListener(t,e,n){return this._findPluginFor(e).addEventListener(t,e,n)}addGlobalEventListener(t,e,n){return this._findPluginFor(e).addGlobalEventListener(t,e,n)}getZone(){return this._zone}_findPluginFor(t){const e=this._eventNameToPlugin.get(t);if(e)return e;const n=this._plugins;for(let r=0;r<n.length;r++){const e=n[r];if(e.supports(t))return this._eventNameToPlugin.set(t,e),e}throw new Error("No event manager plugin found for event "+t)}}return t.\u0275fac=function(e){return new(e||t)(r.Nb(f),r.Nb(r.z))},t.\u0275prov=r.Db({token:t,factory:t.\u0275fac}),t})();class g{constructor(t){this._doc=t}addGlobalEventListener(t,e,n){const r=Object(o.p)().getGlobalEventTarget(this._doc,t);if(!r)throw new Error(`Unsupported event target ${r} for event ${e}`);return this.addEventListener(r,e,n)}}let y=(()=>{class t{constructor(){this._stylesSet=new Set}addStyles(t){const e=new Set;t.forEach(t=>{this._stylesSet.has(t)||(this._stylesSet.add(t),e.add(t))}),this.onStylesAdded(e)}onStylesAdded(t){}getAllStyles(){return Array.from(this._stylesSet)}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=r.Db({token:t,factory:t.\u0275fac}),t})(),v=(()=>{class t extends y{constructor(t){super(),this._doc=t,this._hostNodes=new Set,this._styleNodes=new Set,this._hostNodes.add(t.head)}_addStylesToHost(t,e){t.forEach(t=>{const n=this._doc.createElement("style");n.textContent=t,this._styleNodes.add(e.appendChild(n))})}addHost(t){this._addStylesToHost(this._stylesSet,t),this._hostNodes.add(t)}removeHost(t){this._hostNodes.delete(t)}onStylesAdded(t){this._hostNodes.forEach(e=>this._addStylesToHost(t,e))}ngOnDestroy(){this._styleNodes.forEach(t=>Object(o.p)().remove(t))}}return t.\u0275fac=function(e){return new(e||t)(r.Nb(o.d))},t.\u0275prov=r.Db({token:t,factory:t.\u0275fac}),t})();const m={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},b=/%COMP%/g;function _(t,e,n){for(let r=0;r<e.length;r++){let i=e[r];Array.isArray(i)?_(t,i,n):(i=i.replace(b,t),n.push(i))}return n}function w(t){return e=>{if("__ngUnwrap__"===e)return t;!1===t(e)&&(e.preventDefault(),e.returnValue=!1)}}let E=(()=>{class t{constructor(t,e,n){this.eventManager=t,this.sharedStylesHost=e,this.appId=n,this.rendererByCompId=new Map,this.defaultRenderer=new O(t)}createRenderer(t,e){if(!t||!e)return this.defaultRenderer;switch(e.encapsulation){case r.Q.Emulated:{let n=this.rendererByCompId.get(e.id);return n||(n=new C(this.eventManager,this.sharedStylesHost,e,this.appId),this.rendererByCompId.set(e.id,n)),n.applyToHost(t),n}case r.Q.Native:case r.Q.ShadowDom:return new T(this.eventManager,this.sharedStylesHost,t,e);default:if(!this.rendererByCompId.has(e.id)){const t=_(e.id,e.styles,[]);this.sharedStylesHost.addStyles(t),this.rendererByCompId.set(e.id,this.defaultRenderer)}return this.defaultRenderer}}begin(){}end(){}}return t.\u0275fac=function(e){return new(e||t)(r.Nb(p),r.Nb(v),r.Nb(r.c))},t.\u0275prov=r.Db({token:t,factory:t.\u0275fac}),t})();class O{constructor(t){this.eventManager=t,this.data=Object.create(null)}destroy(){}createElement(t,e){return e?document.createElementNS(m[e]||e,t):document.createElement(t)}createComment(t){return document.createComment(t)}createText(t){return document.createTextNode(t)}appendChild(t,e){t.appendChild(e)}insertBefore(t,e,n){t&&t.insertBefore(e,n)}removeChild(t,e){t&&t.removeChild(e)}selectRootElement(t,e){let n="string"==typeof t?document.querySelector(t):t;if(!n)throw new Error(`The selector "${t}" did not match any elements`);return e||(n.textContent=""),n}parentNode(t){return t.parentNode}nextSibling(t){return t.nextSibling}setAttribute(t,e,n,r){if(r){e=r+":"+e;const i=m[r];i?t.setAttributeNS(i,e,n):t.setAttribute(e,n)}else t.setAttribute(e,n)}removeAttribute(t,e,n){if(n){const r=m[n];r?t.removeAttributeNS(r,e):t.removeAttribute(`${n}:${e}`)}else t.removeAttribute(e)}addClass(t,e){t.classList.add(e)}removeClass(t,e){t.classList.remove(e)}setStyle(t,e,n,i){i&r.F.DashCase?t.style.setProperty(e,n,i&r.F.Important?"important":""):t.style[e]=n}removeStyle(t,e,n){n&r.F.DashCase?t.style.removeProperty(e):t.style[e]=""}setProperty(t,e,n){t[e]=n}setValue(t,e){t.nodeValue=e}listen(t,e,n){return"string"==typeof t?this.eventManager.addGlobalEventListener(t,e,w(n)):this.eventManager.addEventListener(t,e,w(n))}}class C extends O{constructor(t,e,n,r){super(t),this.component=n;const i=_(r+"-"+n.id,n.styles,[]);e.addStyles(i),this.contentAttr="_ngcontent-%COMP%".replace(b,r+"-"+n.id),this.hostAttr=function(t){return"_nghost-%COMP%".replace(b,t)}(r+"-"+n.id)}applyToHost(t){super.setAttribute(t,this.hostAttr,"")}createElement(t,e){const n=super.createElement(t,e);return super.setAttribute(n,this.contentAttr,""),n}}class T extends O{constructor(t,e,n,i){super(t),this.sharedStylesHost=e,this.hostEl=n,this.component=i,this.shadowRoot=i.encapsulation===r.Q.ShadowDom?n.attachShadow({mode:"open"}):n.createShadowRoot(),this.sharedStylesHost.addHost(this.shadowRoot);const o=_(i.id,i.styles,[]);for(let r=0;r<o.length;r++){const t=document.createElement("style");t.textContent=o[r],this.shadowRoot.appendChild(t)}}nodeOrShadowRoot(t){return t===this.hostEl?this.shadowRoot:t}destroy(){this.sharedStylesHost.removeHost(this.shadowRoot)}appendChild(t,e){return super.appendChild(this.nodeOrShadowRoot(t),e)}insertBefore(t,e,n){return super.insertBefore(this.nodeOrShadowRoot(t),e,n)}removeChild(t,e){return super.removeChild(this.nodeOrShadowRoot(t),e)}parentNode(t){return this.nodeOrShadowRoot(super.parentNode(this.nodeOrShadowRoot(t)))}}let S=(()=>{class t extends g{constructor(t){super(t)}supports(t){return!0}addEventListener(t,e,n){return t.addEventListener(e,n,!1),()=>this.removeEventListener(t,e,n)}removeEventListener(t,e,n){return t.removeEventListener(e,n)}}return t.\u0275fac=function(e){return new(e||t)(r.Nb(o.d))},t.\u0275prov=r.Db({token:t,factory:t.\u0275fac}),t})();const I=["alt","control","meta","shift"],j={"\b":"Backspace","\t":"Tab","\x7f":"Delete","\x1b":"Escape",Del:"Delete",Esc:"Escape",Left:"ArrowLeft",Right:"ArrowRight",Up:"ArrowUp",Down:"ArrowDown",Menu:"ContextMenu",Scroll:"ScrollLock",Win:"OS"},x={A:"1",B:"2",C:"3",D:"4",E:"5",F:"6",G:"7",H:"8",I:"9",J:"*",K:"+",M:"-",N:".",O:"/","`":"0","\x90":"NumLock"},A={alt:t=>t.altKey,control:t=>t.ctrlKey,meta:t=>t.metaKey,shift:t=>t.shiftKey};let k=(()=>{class t extends g{constructor(t){super(t)}supports(e){return null!=t.parseEventName(e)}addEventListener(e,n,r){const i=t.parseEventName(n),s=t.eventCallback(i.fullKey,r,this.manager.getZone());return this.manager.getZone().runOutsideAngular(()=>Object(o.p)().onAndCancel(e,i.domEventName,s))}static parseEventName(e){const n=e.toLowerCase().split("."),r=n.shift();if(0===n.length||"keydown"!==r&&"keyup"!==r)return null;const i=t._normalizeKey(n.pop());let o="";if(I.forEach(t=>{const e=n.indexOf(t);e>-1&&(n.splice(e,1),o+=t+".")}),o+=i,0!=n.length||0===i.length)return null;const s={};return s.domEventName=r,s.fullKey=o,s}static getEventFullKey(t){let e="",n=function(t){let e=t.key;if(null==e){if(e=t.keyIdentifier,null==e)return"Unidentified";e.startsWith("U+")&&(e=String.fromCharCode(parseInt(e.substring(2),16)),3===t.location&&x.hasOwnProperty(e)&&(e=x[e]))}return j[e]||e}(t);return n=n.toLowerCase()," "===n?n="space":"."===n&&(n="dot"),I.forEach(r=>{r!=n&&(0,A[r])(t)&&(e+=r+".")}),e+=n,e}static eventCallback(e,n,r){return i=>{t.getEventFullKey(i)===e&&r.runGuarded(()=>n(i))}}static _normalizeKey(t){switch(t){case"esc":return"escape";default:return t}}}return t.\u0275fac=function(e){return new(e||t)(r.Nb(o.d))},t.\u0275prov=r.Db({token:t,factory:t.\u0275fac}),t})();const N=[{provide:r.B,useValue:o.o},{provide:r.C,useValue:function(){a.makeCurrent(),d.init()},multi:!0},{provide:o.d,useFactory:function(){return Object(r.sb)(document),document},deps:[]}],R=Object(r.R)(r.V,"browser",N),P=[[],{provide:r.Y,useValue:"root"},{provide:r.m,useFactory:function(){return new r.m},deps:[]},{provide:f,useClass:S,multi:!0,deps:[o.d,r.z,r.B]},{provide:f,useClass:k,multi:!0,deps:[o.d]},[],{provide:E,useClass:E,deps:[p,v,r.c]},{provide:r.E,useExisting:E},{provide:y,useExisting:v},{provide:v,useClass:v,deps:[o.d]},{provide:r.L,useClass:r.L,deps:[r.z]},{provide:p,useClass:p,deps:[f,r.z]},[]];let D=(()=>{class t{constructor(t){if(t)throw new Error("BrowserModule has already been loaded. If you need access to common directives such as NgIf and NgFor from a lazy loaded module, import CommonModule instead.")}static withServerTransition(e){return{ngModule:t,providers:[{provide:r.c,useValue:e.appId},{provide:l,useExisting:r.c},h]}}}return t.\u0275mod=r.Fb({type:t}),t.\u0275inj=r.Eb({factory:function(e){return new(e||t)(r.Nb(t,12))},providers:P,imports:[o.c,r.f]}),t})();"undefined"!=typeof window&&window;var L=n("tyNb"),M=n("TEn/"),F=function(t){return t.Prompt="PROMPT",t.Camera="CAMERA",t.Photos="PHOTOS",t}({}),U=function(t){return t.Rear="REAR",t.Front="FRONT",t}({}),$=function(t){return t.Uri="uri",t.Base64="base64",t.DataUrl="dataUrl",t}({}),V=function(t){return t.Documents="DOCUMENTS",t.Data="DATA",t.Cache="CACHE",t.External="EXTERNAL",t.ExternalStorage="EXTERNAL_STORAGE",t}({}),q=function(t){return t.Camera="camera",t.Photos="photos",t.Geolocation="geolocation",t.Notifications="notifications",t.ClipboardRead="clipboard-read",t.ClipboardWrite="clipboard-write",t.Microphone="microphone",t}({}),H=function(){function t(){var t=this;this.platform="web",this.isNative=!1,this.Plugins={},"undefined"!=typeof Proxy&&(this.Plugins=new Proxy(this.Plugins,{get:function(e,n){if(void 0===e[n]){var r=t;return new Proxy({},{get:function(t,e){return void 0===t[e]?r.pluginMethodNoop.bind(r,t,e,n):t[e]}})}return e[n]}}))}return t.prototype.pluginMethodNoop=function(t,e,n){return Promise.reject(n+" does not have web implementation.")},t.prototype.getPlatform=function(){return this.platform},t.prototype.isPluginAvailable=function(t){return this.Plugins.hasOwnProperty(t)},t.prototype.convertFileSrc=function(t){return t},t.prototype.handleError=function(t){console.error(t)},t}(),B=function(t){return t.Capacitor=t.Capacitor||new H}("undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{}).Plugins,z=new(function(){function t(){this.plugins={},this.loadedPlugins={}}return t.prototype.addPlugin=function(t){this.plugins[t.config.name]=t},t.prototype.getPlugin=function(t){return this.plugins[t]},t.prototype.loadPlugin=function(t){var e=this.getPlugin(t);e?e.load():console.error("Unable to load web plugin "+t+", no such plugin found.")},t.prototype.getPlugins=function(){var t=[];for(var e in this.plugins)t.push(this.plugins[e]);return t},t}()),W=function(){function t(t,e){this.config=t,this.loaded=!1,this.listeners={},this.windowListeners={},e?e.addPlugin(this):z.addPlugin(this)}return t.prototype.addWindowListener=function(t){window.addEventListener(t.windowEventName,t.handler),t.registered=!0},t.prototype.removeWindowListener=function(t){t&&(window.removeEventListener(t.windowEventName,t.handler),t.registered=!1)},t.prototype.addListener=function(t,e){var n=this;this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push(e);var r=this.windowListeners[t];return r&&!r.registered&&this.addWindowListener(r),{remove:function(){n.removeListener(t,e)}}},t.prototype.removeListener=function(t,e){var n=this.listeners[t];if(n){var r=n.indexOf(e);this.listeners[t].splice(r,1),this.listeners[t].length||this.removeWindowListener(this.windowListeners[t])}},t.prototype.removeAllListeners=function(){for(var t in this.listeners={},this.windowListeners)this.removeWindowListener(this.windowListeners[t]);this.windowListeners={}},t.prototype.notifyListeners=function(t,e){var n=this.listeners[t];n&&n.forEach((function(t){return t(e)}))},t.prototype.hasListeners=function(t){return!!this.listeners[t].length},t.prototype.registerWindowListener=function(t,e){var n=this;this.windowListeners[e]={registered:!1,windowEventName:t,pluginEventName:e,handler:function(t){n.notifyListeners(e,t)}}},t.prototype.requestPermissions=function(){return Capacitor.isNative?Capacitor.nativePromise(this.config.name,"requestPermissions",{}):Promise.resolve({results:[]})},t.prototype.load=function(){this.loaded=!0},t}(),G=function(t,e){t.hasOwnProperty(e.config.name)&&!function(t){return t.config.platforms&&t.config.platforms.indexOf(Capacitor.platform)>=0}(e)||(t[e.config.name]=e)},Q=n("O1h7"),K=(new(function(t){function e(){return t.call(this,{name:"Accessibility",platforms:["web"]})||this}return Object(Q.d)(e,t),e.prototype.isScreenReaderEnabled=function(){throw new Error("Feature not available in the browser")},e.prototype.speak=function(t){if(!("speechSynthesis"in window))return Promise.reject("Browser does not support the Speech Synthesis API");var e=new SpeechSynthesisUtterance(t.value);return t.language&&(e.lang=t.language),window.speechSynthesis.speak(e),Promise.resolve()},e}(W)),new(function(t){function e(){var e=t.call(this,{name:"App",platforms:["web"]})||this;return"undefined"!=typeof document&&document.addEventListener("visibilitychange",e.handleVisibilityChange.bind(e),!1),e}return Object(Q.d)(e,t),e.prototype.exitApp=function(){throw new Error("Method not implemented.")},e.prototype.canOpenUrl=function(t){return Promise.resolve({value:!0})},e.prototype.openUrl=function(t){return Promise.resolve({completed:!0})},e.prototype.getLaunchUrl=function(){return Promise.resolve({url:""})},e.prototype.getState=function(){return Promise.resolve({isActive:!0!==document.hidden})},e.prototype.handleVisibilityChange=function(){var t={isActive:!0!==document.hidden};this.notifyListeners("appStateChange",t)},e}(W)),new(function(t){function e(){return t.call(this,{name:"Browser",platforms:["web"]})||this}return Object(Q.d)(e,t),e.prototype.open=function(t){return Object(Q.b)(this,void 0,void 0,(function(){return Object(Q.e)(this,(function(e){return this._lastWindow=window.open(t.url,t.windowName||"_blank"),[2,Promise.resolve()]}))}))},e.prototype.prefetch=function(t){return Object(Q.b)(this,void 0,void 0,(function(){return Object(Q.e)(this,(function(t){return[2,Promise.resolve()]}))}))},e.prototype.close=function(){return Object(Q.b)(this,void 0,void 0,(function(){return Object(Q.e)(this,(function(t){return this._lastWindow&&this._lastWindow.close(),[2,Promise.resolve()]}))}))},e}(W)),new(function(t){function e(){return t.call(this,{name:"Camera",platforms:["web"]})||this}return Object(Q.d)(e,t),e.prototype.getPhoto=function(t){return Object(Q.b)(this,void 0,void 0,(function(){var e=this;return Object(Q.e)(this,(function(n){return[2,new Promise((function(n,r){return Object(Q.b)(e,void 0,void 0,(function(){var e,i=this;return Object(Q.e)(this,(function(o){switch(o.label){case 0:return t.webUseInput?(this.fileInputExperience(t,n),[3,7]):[3,1];case 1:if(!customElements.get("pwa-camera-modal"))return[3,6];e=document.createElement("pwa-camera-modal"),document.body.appendChild(e),o.label=2;case 2:return o.trys.push([2,4,,5]),[4,e.componentOnReady()];case 3:return o.sent(),e.addEventListener("onPhoto",(function(o){return Object(Q.b)(i,void 0,void 0,(function(){var i,s;return Object(Q.e)(this,(function(a){switch(a.label){case 0:return null!==(i=o.detail)?[3,1]:(r("User cancelled photos app"),[3,4]);case 1:return i instanceof Error?(r(i.message),[3,4]):[3,2];case 2:return s=n,[4,this._getCameraPhoto(i,t)];case 3:s.apply(void 0,[a.sent()]),a.label=4;case 4:return e.dismiss(),document.body.removeChild(e),[2]}}))}))})),e.present(),[3,5];case 4:return o.sent(),this.fileInputExperience(t,n),[3,5];case 5:return[3,7];case 6:console.error("Unable to load PWA Element 'pwa-camera-modal'. See the docs: https://capacitorjs.com/docs/pwa-elements."),this.fileInputExperience(t,n),o.label=7;case 7:return[2]}}))}))}))]}))}))},e.prototype.fileInputExperience=function(t,e){var n=document.querySelector("#_capacitor-camera-input"),r=function(){n.parentNode&&n.parentNode.removeChild(n)};n||((n=document.createElement("input")).id="_capacitor-camera-input",n.type="file",document.body.appendChild(n)),n.accept="image/*",n.capture=!0,t.source===F.Photos||t.source===F.Prompt?n.removeAttribute("capture"):t.direction===U.Front?n.capture="user":t.direction===U.Rear&&(n.capture="environment"),n.addEventListener("change",(function(i){var o=n.files[0],s="jpeg";if("image/png"===o.type?s="png":"image/gif"===o.type&&(s="gif"),t.resultType===$.DataUrl||t.resultType===$.Base64){var a=new FileReader;a.addEventListener("load",(function(){if(t.resultType===$.DataUrl)e({dataUrl:a.result,format:s});else if(t.resultType===$.Base64){var n=a.result.split(",")[1];e({base64String:n,format:s})}r()})),a.readAsDataURL(o)}else e({webPath:URL.createObjectURL(o),format:s}),r()})),n.click()},e.prototype._getCameraPhoto=function(t,e){return new Promise((function(n,r){var i=new FileReader,o=t.type.split("/")[1];e.resultType===$.Uri?n({webPath:URL.createObjectURL(t),format:o}):(i.readAsDataURL(t),i.onloadend=function(){var t=i.result;n(e.resultType===$.DataUrl?{dataUrl:t,format:o}:{base64String:t.split(",")[1],format:o})},i.onerror=function(t){r(t)})}))},e}(W)),new(function(t){function e(){return t.call(this,{name:"Clipboard",platforms:["web"]})||this}return Object(Q.d)(e,t),e.prototype.write=function(t){return Object(Q.b)(this,void 0,void 0,(function(){var e,n,r;return Object(Q.e)(this,(function(i){switch(i.label){case 0:return navigator.clipboard?void 0!==t.string||t.url?navigator.clipboard.writeText?[4,navigator.clipboard.writeText(void 0!==t.string?t.string:t.url)]:[2,Promise.reject("Writting to clipboard not supported in this browser")]:[3,2]:[2,Promise.reject("Clipboard API not available in this browser")];case 1:return i.sent(),[3,10];case 2:if(!t.image)return[3,9];if(!navigator.clipboard.write)return[2,Promise.reject("Setting images not supported in this browser")];i.label=3;case 3:return i.trys.push([3,7,,8]),[4,fetch(t.image)];case 4:return[4,i.sent().blob()];case 5:return e=i.sent(),n=new ClipboardItem(((r={})[e.type]=e,r)),[4,navigator.clipboard.write([n])];case 6:return i.sent(),[3,8];case 7:return i.sent(),[2,Promise.reject("Failed to write image")];case 8:return[3,10];case 9:return[2,Promise.reject("Nothing to write")];case 10:return[2,Promise.resolve()]}}))}))},e.prototype.read=function(){return Object(Q.b)(this,void 0,void 0,(function(){var t,e,n,r;return Object(Q.e)(this,(function(i){switch(i.label){case 0:return navigator.clipboard?navigator.clipboard.read?[3,1]:navigator.clipboard.readText?[2,this.readText()]:[2,Promise.reject("Reading from clipboard not supported in this browser")]:[2,Promise.reject("Clipboard API not available in this browser")];case 1:return i.trys.push([1,5,,6]),[4,navigator.clipboard.read()];case 2:return[4,(t=i.sent())[0].getType(e=t[0].types[0])];case 3:return n=i.sent(),[4,this._getBlobData(n,e)];case 4:return r=i.sent(),[2,Promise.resolve({value:r,type:e})];case 5:return i.sent(),[2,this.readText()];case 6:return[2]}}))}))},e.prototype.readText=function(){return Object(Q.b)(this,void 0,void 0,(function(){var t;return Object(Q.e)(this,(function(e){switch(e.label){case 0:return[4,navigator.clipboard.readText()];case 1:return t=e.sent(),[2,Promise.resolve({value:t,type:"text/plain"})]}}))}))},e.prototype._getBlobData=function(t,e){return new Promise((function(n,r){var i=new FileReader;e.includes("image")?i.readAsDataURL(t):i.readAsText(t),i.onloadend=function(){n(i.result)},i.onerror=function(t){r(t)}}))},e}(W)),new(function(t){function e(){var e=t.call(this,{name:"Filesystem",platforms:["web"]})||this;return e.DEFAULT_DIRECTORY=V.Data,e.DB_VERSION=1,e.DB_NAME="Disc",e._writeCmds=["add","put","delete"],e}return Object(Q.d)(e,t),e.prototype.initDb=function(){return Object(Q.b)(this,void 0,void 0,(function(){var t=this;return Object(Q.e)(this,(function(n){if(void 0!==this._db)return[2,this._db];if(!("indexedDB"in window))throw new Error("This browser doesn't support IndexedDB");return[2,new Promise((function(n,r){var i=indexedDB.open(t.DB_NAME,t.DB_VERSION);i.onupgradeneeded=e.doUpgrade,i.onsuccess=function(){t._db=i.result,n(i.result)},i.onerror=function(){return r(i.error)},i.onblocked=function(){console.warn("db blocked")}}))]}))}))},e.doUpgrade=function(t){var e=t.target.result;switch(t.oldVersion){case 0:case 1:default:e.objectStoreNames.contains("FileStorage")&&e.deleteObjectStore("FileStorage"),e.createObjectStore("FileStorage",{keyPath:"path"}).createIndex("by_folder","folder")}},e.prototype.dbRequest=function(t,e){return Object(Q.b)(this,void 0,void 0,(function(){var n;return Object(Q.e)(this,(function(r){return n=-1!==this._writeCmds.indexOf(t)?"readwrite":"readonly",[2,this.initDb().then((function(r){return new Promise((function(i,o){var s=r.transaction(["FileStorage"],n).objectStore("FileStorage"),a=s[t].apply(s,e);a.onsuccess=function(){return i(a.result)},a.onerror=function(){return o(a.error)}}))}))]}))}))},e.prototype.dbIndexRequest=function(t,e,n){return Object(Q.b)(this,void 0,void 0,(function(){var r;return Object(Q.e)(this,(function(i){return r=-1!==this._writeCmds.indexOf(e)?"readwrite":"readonly",[2,this.initDb().then((function(i){return new Promise((function(o,s){var a=i.transaction(["FileStorage"],r).objectStore("FileStorage").index(t),u=a[e].apply(a,n);u.onsuccess=function(){return o(u.result)},u.onerror=function(){return s(u.error)}}))}))]}))}))},e.prototype.getPath=function(t,e){t=t||this.DEFAULT_DIRECTORY;var n=void 0!==e?e.replace(/^[/]+|[/]+$/g,""):"",r="/"+t;return""!==e&&(r+="/"+n),r},e.prototype.clear=function(){return Object(Q.b)(this,void 0,void 0,(function(){return Object(Q.e)(this,(function(t){switch(t.label){case 0:return[4,this.initDb()];case 1:return t.sent().transaction(["FileStorage"],"readwrite").objectStore("FileStorage").clear(),[2,{}]}}))}))},e.prototype.readFile=function(t){return Object(Q.b)(this,void 0,void 0,(function(){var e,n;return Object(Q.e)(this,(function(r){switch(r.label){case 0:return e=this.getPath(t.directory,t.path),[4,this.dbRequest("get",[e])];case 1:if(void 0===(n=r.sent()))throw Error("File does not exist.");return[2,{data:n.content}]}}))}))},e.prototype.writeFile=function(t){return Object(Q.b)(this,void 0,void 0,(function(){var e,n,r,i,o,s,a,u,c,l;return Object(Q.e)(this,(function(h){switch(h.label){case 0:return e=this.getPath(t.directory,t.path),n=t.data,r=t.recursive,[4,this.dbRequest("get",[e])];case 1:if((i=h.sent())&&"directory"===i.type)throw"The supplied path is a directory.";return o=t.encoding,s=e.substr(0,e.lastIndexOf("/")),[4,this.dbRequest("get",[s])];case 2:return void 0!==h.sent()||-1===(a=s.indexOf("/",1))?[3,4]:(u=s.substr(a),[4,this.mkdir({path:u,directory:t.directory,recursive:r})]);case 3:h.sent(),h.label=4;case 4:return c=Date.now(),l={path:e,folder:s,type:"file",size:n.length,ctime:c,mtime:c,content:!o&&n.indexOf(",")>=0?n.split(",")[1]:n},[4,this.dbRequest("put",[l])];case 5:return h.sent(),[2,{uri:l.path}]}}))}))},e.prototype.appendFile=function(t){return Object(Q.b)(this,void 0,void 0,(function(){var e,n,r,i,o,s,a,u;return Object(Q.e)(this,(function(c){switch(c.label){case 0:return e=this.getPath(t.directory,t.path),n=t.data,r=e.substr(0,e.lastIndexOf("/")),i=Date.now(),o=i,[4,this.dbRequest("get",[e])];case 1:if((s=c.sent())&&"directory"===s.type)throw"The supplied path is a directory.";return[4,this.dbRequest("get",[r])];case 2:return void 0!==c.sent()||-1===(a=r.indexOf("/",1))?[3,4]:(u=r.substr(a),[4,this.mkdir({path:u,directory:t.directory,recursive:!0})]);case 3:c.sent(),c.label=4;case 4:return void 0!==s&&(n=s.content+n,o=s.ctime),[4,this.dbRequest("put",[{path:e,folder:r,type:"file",size:n.length,ctime:o,mtime:i,content:n}])];case 5:return c.sent(),[2,{}]}}))}))},e.prototype.deleteFile=function(t){return Object(Q.b)(this,void 0,void 0,(function(){var e;return Object(Q.e)(this,(function(n){switch(n.label){case 0:return e=this.getPath(t.directory,t.path),[4,this.dbRequest("get",[e])];case 1:if(void 0===n.sent())throw Error("File does not exist.");return[4,this.dbIndexRequest("by_folder","getAllKeys",[IDBKeyRange.only(e)])];case 2:if(0!==n.sent().length)throw Error("Folder is not empty.");return[4,this.dbRequest("delete",[e])];case 3:return n.sent(),[2,{}]}}))}))},e.prototype.mkdir=function(t){return Object(Q.b)(this,void 0,void 0,(function(){var e,n,r,i,o,s,a,u;return Object(Q.e)(this,(function(c){switch(c.label){case 0:return e=this.getPath(t.directory,t.path),n=t.recursive,r=e.substr(0,e.lastIndexOf("/")),i=(e.match(/\//g)||[]).length,[4,this.dbRequest("get",[r])];case 1:return o=c.sent(),[4,this.dbRequest("get",[e])];case 2:if(s=c.sent(),1===i)throw Error("Cannot create Root directory");if(void 0!==s)throw Error("Current directory does already exist.");if(!n&&2!==i&&void 0===o)throw Error("Parent directory must exist");return n&&2!==i&&void 0===o?(a=r.substr(r.indexOf("/",1)),[4,this.mkdir({path:a,directory:t.directory,recursive:n})]):[3,4];case 3:c.sent(),c.label=4;case 4:return u=Date.now(),[4,this.dbRequest("put",[{path:e,folder:r,type:"directory",size:0,ctime:u,mtime:u}])];case 5:return c.sent(),[2,{}]}}))}))},e.prototype.rmdir=function(t){return Object(Q.b)(this,void 0,void 0,(function(){var e,n,r,i,o,s,a,u,c;return Object(Q.e)(this,(function(l){switch(l.label){case 0:return r=t.recursive,i=this.getPath(n=t.directory,e=t.path),[4,this.dbRequest("get",[i])];case 1:if(void 0===(o=l.sent()))throw Error("Folder does not exist.");if("directory"!==o.type)throw Error("Requested path is not a directory");return[4,this.readdir({path:e,directory:n})];case 2:if(0!==(s=l.sent()).files.length&&!r)throw Error("Folder is not empty");a=0,u=s.files,l.label=3;case 3:return a<u.length?[4,this.stat({path:c=e+"/"+u[a],directory:n})]:[3,9];case 4:return"file"!==l.sent().type?[3,6]:[4,this.deleteFile({path:c,directory:n})];case 5:return l.sent(),[3,8];case 6:return[4,this.rmdir({path:c,directory:n,recursive:r})];case 7:l.sent(),l.label=8;case 8:return a++,[3,3];case 9:return[4,this.dbRequest("delete",[i])];case 10:return l.sent(),[2,{}]}}))}))},e.prototype.readdir=function(t){return Object(Q.b)(this,void 0,void 0,(function(){var e,n;return Object(Q.e)(this,(function(r){switch(r.label){case 0:return e=this.getPath(t.directory,t.path),[4,this.dbRequest("get",[e])];case 1:if(n=r.sent(),""!==t.path&&void 0===n)throw Error("Folder does not exist.");return[4,this.dbIndexRequest("by_folder","getAllKeys",[IDBKeyRange.only(e)])];case 2:return[2,{files:r.sent().map((function(t){return t.substring(e.length+1)}))}]}}))}))},e.prototype.getUri=function(t){return Object(Q.b)(this,void 0,void 0,(function(){var e,n;return Object(Q.e)(this,(function(r){switch(r.label){case 0:return e=this.getPath(t.directory,t.path),[4,this.dbRequest("get",[e])];case 1:return void 0!==(n=r.sent())?[3,3]:[4,this.dbRequest("get",[e+"/"])];case 2:n=r.sent(),r.label=3;case 3:if(void 0===n)throw Error("Entry does not exist.");return[2,{uri:n.path}]}}))}))},e.prototype.stat=function(t){return Object(Q.b)(this,void 0,void 0,(function(){var e,n;return Object(Q.e)(this,(function(r){switch(r.label){case 0:return e=this.getPath(t.directory,t.path),[4,this.dbRequest("get",[e])];case 1:return void 0!==(n=r.sent())?[3,3]:[4,this.dbRequest("get",[e+"/"])];case 2:n=r.sent(),r.label=3;case 3:if(void 0===n)throw Error("Entry does not exist.");return[2,{type:n.type,size:n.size,ctime:n.ctime,mtime:n.mtime,uri:n.path}]}}))}))},e.prototype.rename=function(t){return Object(Q.b)(this,void 0,void 0,(function(){return Object(Q.e)(this,(function(e){return[2,this._copy(t,!0)]}))}))},e.prototype.copy=function(t){return Object(Q.b)(this,void 0,void 0,(function(){return Object(Q.e)(this,(function(e){return[2,this._copy(t,!1)]}))}))},e.prototype._copy=function(t,e){return void 0===e&&(e=!1),Object(Q.b)(this,void 0,void 0,(function(){var n,r,i,o,s,a,u,c,l,h,d,f,p,g,y,v,m=this;return Object(Q.e)(this,(function(b){switch(b.label){case 0:if(r=t.from,i=t.directory,o=t.toDirectory,!(n=t.to)||!r)throw Error("Both to and from must be provided");if(o||(o=i),s=this.getPath(i,r),a=this.getPath(o,n),s===a)return[2,{}];if(a.startsWith(s))throw Error("To path cannot contain the from path");b.label=1;case 1:return b.trys.push([1,3,,6]),[4,this.stat({path:n,directory:o})];case 2:return u=b.sent(),[3,6];case 3:return b.sent(),(c=n.split("/")).pop(),l=c.join("/"),c.length>0?[4,this.stat({path:l,directory:o})]:[3,5];case 4:if("directory"!==b.sent().type)throw new Error("Parent directory of the to path is a file");b.label=5;case 5:return[3,6];case 6:if(u&&"directory"===u.type)throw new Error("Cannot overwrite a directory with a file");return[4,this.stat({path:r,directory:i})];case 7:switch(h=b.sent(),d=function(t,e,n){return Object(Q.b)(m,void 0,void 0,(function(){var r,i;return Object(Q.e)(this,(function(s){switch(s.label){case 0:return r=this.getPath(o,t),[4,this.dbRequest("get",[r])];case 1:return(i=s.sent()).ctime=e,i.mtime=n,[4,this.dbRequest("put",[i])];case 2:return s.sent(),[2]}}))}))},h.type){case"file":return[3,8];case"directory":return[3,15]}return[3,28];case 8:return[4,this.readFile({path:r,directory:i})];case 9:return f=b.sent(),e?[4,this.deleteFile({path:r,directory:i})]:[3,11];case 10:b.sent(),b.label=11;case 11:return[4,this.writeFile({path:n,directory:o,data:f.data})];case 12:return b.sent(),e?[4,d(n,h.ctime,h.mtime)]:[3,14];case 13:b.sent(),b.label=14;case 14:return[2,{}];case 15:if(u)throw Error("Cannot move a directory over an existing object");b.label=16;case 16:return b.trys.push([16,20,,21]),[4,this.mkdir({path:n,directory:o,recursive:!1})];case 17:return b.sent(),e?[4,d(n,h.ctime,h.mtime)]:[3,19];case 18:b.sent(),b.label=19;case 19:return[3,21];case 20:return b.sent(),[3,21];case 21:return[4,this.readdir({path:r,directory:i})];case 22:p=b.sent().files,g=0,y=p,b.label=23;case 23:return g<y.length?[4,this._copy({from:r+"/"+(v=y[g]),to:n+"/"+v,directory:i,toDirectory:o},e)]:[3,26];case 24:b.sent(),b.label=25;case 25:return g++,[3,23];case 26:return e?[4,this.rmdir({path:r,directory:i})]:[3,28];case 27:b.sent(),b.label=28;case 28:return[2,{}]}}))}))},e._debug=!0,e}(W)),function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return e.forEach((function(e){if(e&&"object"==typeof e)for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})),t});new(function(t){function e(){return t.call(this,{name:"Geolocation",platforms:["web"]})||this}return Object(Q.d)(e,t),e.prototype.getCurrentPosition=function(t){var e=this;return new Promise((function(n,r){return e.requestPermissions().then((function(e){window.navigator.geolocation.getCurrentPosition((function(t){n(t)}),(function(t){r(t)}),K({enableHighAccuracy:!0,timeout:1e4,maximumAge:0},t))}))}))},e.prototype.watchPosition=function(t,e){return""+window.navigator.geolocation.watchPosition((function(t){e(t)}),(function(t){e(null,t)}),K({enableHighAccuracy:!0,timeout:1e4,maximumAge:0},t))},e.prototype.clearWatch=function(t){return window.navigator.geolocation.clearWatch(parseInt(t.id,10)),Promise.resolve()},e}(W)),new(function(t){function e(){return t.call(this,{name:"Device",platforms:["web"]})||this}return Object(Q.d)(e,t),e.prototype.getInfo=function(){return Object(Q.b)(this,void 0,void 0,(function(){var t,e;return Object(Q.e)(this,(function(n){return t=navigator.userAgent,e=this.parseUa(t),[2,Promise.resolve({model:e.model,platform:"web",appVersion:"",appBuild:"",appId:"",appName:"",operatingSystem:e.operatingSystem,osVersion:e.osVersion,manufacturer:navigator.vendor,isVirtual:!1,uuid:this.getUid()})]}))}))},e.prototype.getBatteryInfo=function(){return Object(Q.b)(this,void 0,void 0,(function(){var t;return Object(Q.e)(this,(function(e){switch(e.label){case 0:t={},e.label=1;case 1:return e.trys.push([1,3,,4]),[4,navigator.getBattery()];case 2:return t=e.sent(),[3,4];case 3:return e.sent(),[3,4];case 4:return[2,Promise.resolve({batteryLevel:t.level,isCharging:t.charging})]}}))}))},e.prototype.getLanguageCode=function(){return Object(Q.b)(this,void 0,void 0,(function(){return Object(Q.e)(this,(function(t){return[2,{value:navigator.language}]}))}))},e.prototype.parseUa=function(t){var e={},n=t.indexOf("(")+1,r=t.indexOf(") AppleWebKit");-1!==t.indexOf(") Gecko")&&(r=t.indexOf(") Gecko"));var i=t.substring(n,r);if(-1!==t.indexOf("Android"))e.model=i.replace("; wv","").split("; ").pop().split(" Build")[0],e.osVersion=i.split("; ")[1];else if(e.model=i.split("; ")[0],navigator.oscpu)e.osVersion=navigator.oscpu;else if(-1!==t.indexOf("Windows"))e.osVersion=i;else{var o=i.split("; ").pop().replace(" like Mac OS X","").split(" ");e.osVersion=o[o.length-1].replace(/_/g,".")}return e.operatingSystem=/android/i.test(t)?"android":/iPad|iPhone|iPod/.test(t)&&!window.MSStream?"ios":/Win/.test(t)?"windows":/Mac/i.test(t)?"mac":"unknown",e},e.prototype.getUid=function(){var t=window.localStorage.getItem("_capuid");return t||(t="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)})),window.localStorage.setItem("_capuid",t),t)},e}(W)),new(function(t){function e(){var e=t.call(this,{name:"LocalNotifications",platforms:["web"]})||this;return e.pending=[],e}return Object(Q.d)(e,t),e.prototype.createChannel=function(t){throw new Error("Feature not available in the browser. "+t.id)},e.prototype.deleteChannel=function(t){throw new Error("Feature not available in the browser. "+t.id)},e.prototype.listChannels=function(){throw new Error("Feature not available in the browser")},e.prototype.sendPending=function(){var t=this,e=[],n=+new Date;this.pending.forEach((function(r){r.schedule&&r.schedule.at&&+r.schedule.at<=n&&(t.buildNotification(r),e.push(r))})),console.log("Sent pending, removing",e),this.pending=this.pending.filter((function(t){return!e.find((function(e){return e===t}))}))},e.prototype.sendNotification=function(t){var e=this,n=t;if(t.schedule&&t.schedule.at){var r=+t.schedule.at-+new Date;return this.pending.push(n),void setTimeout((function(){e.sendPending()}),r)}this.buildNotification(t)},e.prototype.buildNotification=function(t){return new Notification(t.title,{body:t.body})},e.prototype.schedule=function(t){var e=this,n=[];return t.notifications.forEach((function(t){n.push(e.sendNotification(t))})),Promise.resolve({notifications:t.notifications.map((function(t){return{id:""+t.id}}))})},e.prototype.getPending=function(){return Promise.resolve({notifications:this.pending.map((function(t){return{id:""+t.id}}))})},e.prototype.registerActionTypes=function(t){throw new Error("Method not implemented.")},e.prototype.cancel=function(t){return console.log("Cancel these",t),this.pending=this.pending.filter((function(e){return!t.notifications.find((function(t){return t.id===""+e.id}))})),Promise.resolve()},e.prototype.areEnabled=function(){return Promise.resolve({value:"granted"===Notification.permission})},e.prototype.requestPermission=function(){return new Promise((function(t){Notification.requestPermission((function(e){var n=!0;"denied"!==e&&"default"!==e||(n=!1),t({granted:n})}))}))},e.prototype.requestPermissions=function(){return new Promise((function(t,e){Notification.requestPermission((function(n){"denied"!==n&&"default"!==n?t({results:[n]}):e(n)}))}))},e}(W)),new(function(t){function e(){return t.call(this,{name:"Share",platforms:["web"]})||this}return Object(Q.d)(e,t),e.prototype.share=function(t){return navigator.share?navigator.share({title:t.title,text:t.text,url:t.url}):Promise.reject("Web Share API not available")},e}(W)),new(function(t){function e(){return t.call(this,{name:"Modals",platforms:["web"]})||this}return Object(Q.d)(e,t),e.prototype.alert=function(t){return Object(Q.b)(this,void 0,void 0,(function(){return Object(Q.e)(this,(function(e){return window.alert(t.message),[2,Promise.resolve()]}))}))},e.prototype.prompt=function(t){return Object(Q.b)(this,void 0,void 0,(function(){var e;return Object(Q.e)(this,(function(n){return e=window.prompt(t.message,t.inputText||""),[2,Promise.resolve({value:e,cancelled:null===e})]}))}))},e.prototype.confirm=function(t){return Object(Q.b)(this,void 0,void 0,(function(){var e;return Object(Q.e)(this,(function(n){return e=window.confirm(t.message),[2,Promise.resolve({value:e})]}))}))},e.prototype.showActions=function(t){return Object(Q.b)(this,void 0,void 0,(function(){var e=this;return Object(Q.e)(this,(function(n){return[2,new Promise((function(n,r){return Object(Q.b)(e,void 0,void 0,(function(){var e,r=this;return Object(Q.e)(this,(function(i){return(e=document.querySelector("pwa-action-sheet"))||(e=document.createElement("pwa-action-sheet"),document.body.appendChild(e)),e.header=t.title,e.cancelable=!1,e.options=t.options,e.addEventListener("onSelection",(function(t){return Object(Q.b)(r,void 0,void 0,(function(){return Object(Q.e)(this,(function(e){return n({index:t.detail}),[2]}))}))})),[2]}))}))}))]}))}))},e}(W)),new(function(t){function e(){var e=t.call(this,{name:"Motion"})||this;return e.registerWindowListener("devicemotion","accel"),e.registerWindowListener("deviceorientation","orientation"),e}return Object(Q.d)(e,t),e}(W)),new(function(t){function e(){var e=t.call(this,{name:"Network",platforms:["web"]})||this;return e.listenerFunction=null,e}return Object(Q.d)(e,t),e.prototype.getStatus=function(){return new Promise((function(t,e){if(window.navigator){var n=window.navigator.onLine,r=window.navigator.connection||window.navigator.mozConnection||window.navigator.webkitConnection;t({connected:n,connectionType:n?r?r.type||r.effectiveType:"wifi":"none"})}else e("Network info not available")}))},e.prototype.addListener=function(t,e){var n=window.navigator.connection||window.navigator.mozConnection||window.navigator.webkitConnection,r=e.bind(this,{connected:!0,connectionType:n?n.type||n.effectiveType:"wifi"}),i=e.bind(this,{connected:!1,connectionType:"none"});if(0===t.localeCompare("networkStatusChange"))return window.addEventListener("online",r),window.addEventListener("offline",i),{remove:function(){window.removeEventListener("online",r),window.removeEventListener("offline",i)}}},e}(W)),new(function(t){function e(){return t.call(this,{name:"Permissions"})||this}return Object(Q.d)(e,t),e.prototype.query=function(t){return Object(Q.b)(this,void 0,void 0,(function(){var e;return Object(Q.e)(this,(function(n){switch(n.label){case 0:return(e=window.navigator).permissions?[4,e.permissions.query({name:t.name===q.Photos?"camera":t.name})]:[2,Promise.reject("This browser does not support the Permissions API")];case 1:return[2,{state:n.sent().state}]}}))}))},e}(W)),new(function(t){function e(){return t.call(this,{name:"SplashScreen",platforms:["web"]})||this}return Object(Q.d)(e,t),e.prototype.show=function(t,e){return Promise.resolve()},e.prototype.hide=function(t,e){return Promise.resolve()},e}(W)),new(function(t){function e(){var e=t.call(this,{name:"Storage",platforms:["web"]})||this;return e.KEY_PREFIX="_cap_",e}return Object(Q.d)(e,t),e.prototype.get=function(t){var e=this;return new Promise((function(n,r){n({value:window.localStorage.getItem(e.makeKey(t.key))})}))},e.prototype.set=function(t){var e=this;return new Promise((function(n,r){window.localStorage.setItem(e.makeKey(t.key),t.value),n()}))},e.prototype.remove=function(t){var e=this;return new Promise((function(n,r){window.localStorage.removeItem(e.makeKey(t.key)),n()}))},e.prototype.keys=function(){var t=this;return new Promise((function(e,n){e({keys:Object.keys(localStorage).filter((function(e){return t.isKey(e)})).map((function(e){return t.getKey(e)}))})}))},e.prototype.clear=function(){var t=this;return new Promise((function(e,n){Object.keys(localStorage).filter((function(e){return t.isKey(e)})).forEach((function(t){return window.localStorage.removeItem(t)})),e()}))},e.prototype.makeKey=function(t){return this.KEY_PREFIX+t},e.prototype.isKey=function(t){return 0===t.indexOf(this.KEY_PREFIX)},e.prototype.getKey=function(t){return t.substr(this.KEY_PREFIX.length)},e}(W)),new(function(t){function e(){return t.call(this,{name:"Toast",platforms:["web"]})||this}return Object(Q.d)(e,t),e.prototype.show=function(t){return Object(Q.b)(this,void 0,void 0,(function(){var e,n;return Object(Q.e)(this,(function(r){return e=2e3,t.duration&&(e="long"===t.duration?3500:2e3),(n=document.createElement("pwa-toast")).duration=e,n.message=t.text,document.body.appendChild(n),[2]}))}))},e}(W)),function(t){for(var e=0,n=z.getPlugins();e<n.length;e++)G(t,n[e])}(B);const{SplashScreen:X,StatusBar:Y}=B;let J=(()=>{class t{constructor(){X.hide().catch(t=>{console.warn(t)}),Y.hide().catch(t=>{console.warn(t)})}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=r.Bb({type:t,selectors:[["app-root"]],decls:2,vars:0,template:function(t,e){1&t&&(r.Kb(0,"ion-app"),r.Ib(1,"ion-router-outlet"),r.Jb())},directives:[M.b,M.q],styles:[""]}),t})();const Z=[{path:"home",loadChildren:()=>Promise.all([n.e(2),n.e(11)]).then(n.bind(null,"ct+p")).then(t=>t.HomePageModule)},{path:"",redirectTo:"home",pathMatch:"full"},{path:"movies",loadChildren:()=>Promise.all([n.e(2),n.e(13)]).then(n.bind(null,"EA54")).then(t=>t.MoviesPageModule)},{path:"login",loadChildren:()=>Promise.all([n.e(2),n.e(12)]).then(n.bind(null,"X3zk")).then(t=>t.LoginPageModule)}];let tt=(()=>{class t{}return t.\u0275mod=r.Fb({type:t}),t.\u0275inj=r.Eb({factory:function(e){return new(e||t)},imports:[[L.i.forRoot(Z,{preloadingStrategy:L.e})],L.i]}),t})();var et=n("spgP"),nt=n("UbJi"),rt=n("D0XW"),it=n("HDdC"),ot=n("LRne"),st=n("VRyK"),at=n("lJxs"),ut=n("w1tV"),ct=n("eIep"),lt=n("Kqap"),ht=n("/uUt"),dt=n("l7GE"),ft=n("ZUHj");class pt{constructor(t,e){this.observables=t,this.project=e}call(t,e){return e.subscribe(new gt(t,this.observables,this.project))}}class gt extends dt.a{constructor(t,e,n){super(t),this.observables=e,this.project=n,this.toRespond=[];const r=e.length;this.values=new Array(r);for(let i=0;i<r;i++)this.toRespond.push(i);for(let i=0;i<r;i++){let t=e[i];this.add(Object(ft.a)(this,t,t,i))}}notifyNext(t,e,n,r,i){this.values[n]=e;const o=this.toRespond;if(o.length>0){const t=o.indexOf(n);-1!==t&&o.splice(t,1)}}notifyComplete(){}_next(t){if(0===this.toRespond.length){const e=[t,...this.values];this.project?this._tryProject(e):this.destination.next(e)}}_tryProject(t){let e;try{e=this.project.apply(this,t)}catch(n){return void this.destination.error(n)}this.destination.next(e)}}var yt=n("7o/Q");class vt{constructor(t){this.predicate=t}call(t,e){return e.subscribe(new mt(t,this.predicate))}}class mt extends yt.a{constructor(t,e){super(t),this.predicate=e,this.skipping=!0,this.index=0}_next(t){const e=this.destination;this.skipping&&this.tryCallPredicate(t),this.skipping||e.next(t)}tryCallPredicate(t){try{const e=this.predicate(t,this.index++);this.skipping=Boolean(e)}catch(e){this.destination.error(e)}}}n("6Uf2");var bt=n("Jgta");function _t(t){return null==t}function wt(t){return"function"==typeof t.set}function Et(t,e){return wt(e)?e:t.ref(e)}function Ot(t,e){if("string"==typeof t)return e.stringCase();if(wt(t))return e.firebaseCase();if(function(t){return"function"==typeof t.exportVal}(t))return e.snapshotCase();throw new Error("Expects a string, snapshot, or reference. Got: "+typeof t)}function Ct(t,e,n="on",r=rt.a){return new it.a(i=>{let o=null;return o=t[n](e,(t,e)=>{r.schedule(()=>{i.next({snapshot:t,prevKey:e})}),"once"===n&&r.schedule(()=>i.complete())},t=>{r.schedule(()=>i.error(t))}),"on"===n?{unsubscribe(){null!=o&&t.off(e,o)}}:{unsubscribe(){}}}).pipe(Object(at.a)(t=>{const{snapshot:n,prevKey:r}=t;let i=null;return n.exists()&&(i=n.key),{type:e,payload:n,prevKey:r,key:i}}),Object(ut.a)())}function Tt(t,e){const n=t.length;for(let r=0;r<n;r++)if(t[r].payload.key===e)return r;return-1}function St(t,e){const{payload:n,prevKey:r,key:i}=e,o=Tt(t,i),s=function(t,e){if(_t(e))return 0;{const n=Tt(t,e);return-1===n?t.length:n+1}}(t,r);switch(e.type){case"value":if(e.payload&&e.payload.exists()){let n=null;e.payload.forEach(e=>{const r={payload:e,type:"value",prevKey:n,key:e.key};return n=e.key,t=[...t,r],!1})}return t;case"child_added":if(o>-1){const i=t[o-1];(i&&i.key||null)!==r&&(t=t.filter(t=>t.payload.key!==n.key)).splice(s,0,e)}else{if(null==r)return[e,...t];(t=t.slice()).splice(s,0,e)}return t;case"child_removed":return t.filter(t=>t.payload.key!==n.key);case"child_changed":return t.map(t=>t.payload.key===i?e:t);case"child_moved":if(o>-1){const e=t.splice(o,1)[0];return(t=t.slice()).splice(s,0,e),t}return t;default:return t}}function It(t){return(_t(t)||0===t.length)&&(t=["child_added","child_removed","child_changed","child_moved"]),t}function jt(t,e,n){return function(t,e,n){return Ct(t,"value","once",n).pipe(Object(ct.a)(r=>{const i=[Object(ot.a)(r)];return e.forEach(e=>i.push(Ct(t,e,"on",n))),Object(st.a)(...i).pipe(Object(lt.a)(St,[]))}),Object(ht.a)())}(t,e=It(e),n)}function xt(t,e,n){const r=(e=It(e)).map(e=>Ct(t,e,"on",n));return Object(st.a)(...r)}function At(t,e){return function(n,r){return Ot(n,{stringCase:()=>t.child(n)[e](r),firebaseCase:()=>n[e](r),snapshotCase:()=>n.ref[e](r)})}}function kt(t,e){return function(){return Ct(t,"value","on",e)}}const Nt=new r.q("angularfire2.realtimeDatabaseURL"),Rt=new r.q("angularfire2.database.use-emulator");let Pt=(()=>{class t{constructor(t,e,n,r,i,o,s){this.schedulers=new et.d(i),this.keepUnstableUntilFirst=Object(et.h)(this.schedulers);const a=o,u=Object(et.g)(t,i,e);!bt.a.auth&&s&&Object(et.j)(),this.database=Object(et.f)(`${u.name}.database.${n}`,"AngularFireDatabase",u,()=>{const t=i.runOutsideAngular(()=>u.database(n||void 0));return a&&t.useEmulator(...a),t},[a])}list(t,e){const n=this.schedulers.ngZone.runOutsideAngular(()=>Et(this.database,t));let r=n;return e&&(r=e(n)),function(t,e){const n=e.schedulers.outsideAngular,r=e.schedulers.ngZone.run(()=>t.ref);return{query:t,update:At(r,"update"),set:At(r,"set"),push:t=>r.push(t),remove:(i=r,function(t){return t?Ot(t,{stringCase:()=>i.child(t).remove(),firebaseCase:()=>t.remove(),snapshotCase:()=>t.ref.remove()}):i.remove()}),snapshotChanges:r=>jt(t,r,n).pipe(e.keepUnstableUntilFirst),stateChanges:r=>xt(t,r,n).pipe(e.keepUnstableUntilFirst),auditTrail:r=>function(t,e,n){return function(t,e,n){return function(t,e){return Ct(t,"value","on",e).pipe(Object(at.a)(t=>{let e;return t.payload.forEach(t=>(e=t.key,!1)),{data:t,lastKeyToLoad:e}}))}(t,n).pipe(function(...t){return e=>{let n;return"function"==typeof t[t.length-1]&&(n=t.pop()),e.lift(new pt(t,n))}}(e),Object(at.a)(([t,e])=>{const n=t.lastKeyToLoad,r=e.map(t=>t.key);return{actions:e,lastKeyToLoad:n,loadedKeys:r}}),(r=t=>-1===t.loadedKeys.indexOf(t.lastKeyToLoad),t=>t.lift(new vt(r))),Object(at.a)(t=>t.actions));var r}(t,xt(t,e).pipe(Object(lt.a)((t,e)=>[...t,e],[])),n)}(t,r,n).pipe(e.keepUnstableUntilFirst),valueChanges:(r,i)=>jt(t,r,n).pipe(Object(at.a)(t=>t.map(t=>i&&i.idField?Object.assign(Object.assign({},t.payload.val()),{[i.idField]:t.key}):t.payload.val())),e.keepUnstableUntilFirst)};var i}(r,this)}object(t){const e=this.schedulers.ngZone.runOutsideAngular(()=>Et(this.database,t));return r=this,{query:n=e,snapshotChanges:()=>kt(n,r.schedulers.outsideAngular)().pipe(r.keepUnstableUntilFirst),update:t=>n.ref.update(t),set:t=>n.ref.set(t),remove:()=>n.ref.remove(),valueChanges:()=>kt(n,r.schedulers.outsideAngular)().pipe(r.keepUnstableUntilFirst,Object(at.a)(t=>t.payload.exists()?t.payload.val():null))};var n,r}createPushId(){return this.schedulers.ngZone.runOutsideAngular(()=>this.database.ref()).push().key}}return t.\u0275fac=function(e){return new(e||t)(r.Nb(et.c),r.Nb(et.b,8),r.Nb(Nt,8),r.Nb(r.B),r.Nb(r.z),r.Nb(Rt,8),r.Nb(nt.c,8))},t.\u0275prov=Object(r.Db)({factory:function(){return new t(Object(r.Nb)(et.c),Object(r.Nb)(et.b,8),Object(r.Nb)(Nt,8),Object(r.Nb)(r.B),Object(r.Nb)(r.z),Object(r.Nb)(Rt,8),Object(r.Nb)(nt.c,8))},token:t,providedIn:"any"}),t})(),Dt=(()=>{class t{}return t.\u0275mod=r.Fb({type:t}),t.\u0275inj=r.Eb({factory:function(e){return new(e||t)},providers:[Pt]}),t})();var Lt=n("Cfvw"),Mt=n("UXun"),Ft=n("pxpQ"),Ut=n("zIRd"),$t=n("qOnz"),Vt=n("/6Yf"),qt=function(t){function e(n,r){var i=t.call(this,Ht(n),"Firebase Storage: "+r+" ("+Ht(n)+")")||this;return i.customData={serverResponse:null},Object.setPrototypeOf(i,e.prototype),i}return Object(Q.d)(e,t),e.prototype.codeEquals=function(t){return Ht(t)===this.code},Object.defineProperty(e.prototype,"message",{get:function(){return this.customData.serverResponse?this.message+"\n"+this.customData.serverResponse:this.message},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"serverResponse",{get:function(){return this.customData.serverResponse},set:function(t){this.customData.serverResponse=t},enumerable:!1,configurable:!0}),e}($t.c);function Ht(t){return"storage/"+t}function Bt(){return new qt("unknown","An unknown error occurred, please check the error payload for server response.")}function zt(){return new qt("canceled","User canceled the upload/download.")}function Wt(){return new qt("cannot-slice-blob","Cannot slice blob for upload. Please retry the upload.")}function Gt(t){return new qt("invalid-argument",t)}function Qt(){return new qt("app-deleted","The Firebase app was deleted.")}function Kt(t){return new qt("invalid-root-operation","The operation '"+t+"' cannot be performed on a root reference, create a non-root reference using child, such as .child('file.png').")}function Xt(t,e){return new qt("invalid-format","String does not match format '"+t+"': "+e)}function Yt(t){throw new qt("internal-error","Internal error: "+t)}var Jt={RAW:"raw",BASE64:"base64",BASE64URL:"base64url",DATA_URL:"data_url"},Zt=function(){return function(t,e){this.data=t,this.contentType=e||null}}();function te(t,e){switch(t){case Jt.RAW:return new Zt(ee(e));case Jt.BASE64:case Jt.BASE64URL:return new Zt(ne(t,e));case Jt.DATA_URL:return new Zt((n=new re(e)).base64?ne(Jt.BASE64,n.rest):function(t){var e;try{e=decodeURIComponent(t)}catch(n){throw Xt(Jt.DATA_URL,"Malformed data URL.")}return ee(e)}(n.rest),function(t){return new re(t).contentType}(e))}var n;throw Bt()}function ee(t){for(var e=[],n=0;n<t.length;n++){var r=t.charCodeAt(n);if(r<=127)e.push(r);else if(r<=2047)e.push(192|r>>6,128|63&r);else if(55296==(64512&r))if(n<t.length-1&&56320==(64512&t.charCodeAt(n+1))){var i=r,o=t.charCodeAt(++n);e.push(240|(r=65536|(1023&i)<<10|1023&o)>>18,128|r>>12&63,128|r>>6&63,128|63&r)}else e.push(239,191,189);else 56320==(64512&r)?e.push(239,191,189):e.push(224|r>>12,128|r>>6&63,128|63&r)}return new Uint8Array(e)}function ne(t,e){switch(t){case Jt.BASE64:var n=-1!==e.indexOf("-"),r=-1!==e.indexOf("_");if(n||r)throw Xt(t,"Invalid character '"+(n?"-":"_")+"' found: is it base64url encoded?");break;case Jt.BASE64URL:var i=-1!==e.indexOf("+"),o=-1!==e.indexOf("/");if(i||o)throw Xt(t,"Invalid character '"+(i?"+":"/")+"' found: is it base64 encoded?");e=e.replace(/-/g,"+").replace(/_/g,"/")}var s;try{s=atob(e)}catch(c){throw Xt(t,"Invalid character found")}for(var a=new Uint8Array(s.length),u=0;u<s.length;u++)a[u]=s.charCodeAt(u);return a}var re=function(){return function(t){this.base64=!1,this.contentType=null;var e=t.match(/^data:([^,]+)?,/);if(null===e)throw Xt(Jt.DATA_URL,"Must be formatted 'data:[<mediatype>][;base64],<data>");var n,r=e[1]||null;null!=r&&(this.base64=(n=r).length>=";base64".length&&";base64"===n.substring(n.length-";base64".length),this.contentType=this.base64?r.substring(0,r.length-";base64".length):r),this.rest=t.substring(t.indexOf(",")+1)}}(),ie={RUNNING:"running",PAUSED:"paused",SUCCESS:"success",CANCELED:"canceled",ERROR:"error"};function oe(t){switch(t){case"running":case"pausing":case"canceling":return ie.RUNNING;case"paused":return ie.PAUSED;case"success":return ie.SUCCESS;case"canceled":return ie.CANCELED;case"error":default:return ie.ERROR}}var se=function(t){return t[t.NO_ERROR=0]="NO_ERROR",t[t.NETWORK_ERROR=1]="NETWORK_ERROR",t[t.ABORT=2]="ABORT",t}({}),ae=function(){function t(){var t=this;this.sent_=!1,this.xhr_=new XMLHttpRequest,this.errorCode_=se.NO_ERROR,this.sendPromise_=new Promise((function(e){t.xhr_.addEventListener("abort",(function(){t.errorCode_=se.ABORT,e(t)})),t.xhr_.addEventListener("error",(function(){t.errorCode_=se.NETWORK_ERROR,e(t)})),t.xhr_.addEventListener("load",(function(){e(t)}))}))}return t.prototype.send=function(t,e,n,r){if(this.sent_)throw Yt("cannot .send() more than once");if(this.sent_=!0,this.xhr_.open(e,t,!0),void 0!==r)for(var i in r)r.hasOwnProperty(i)&&this.xhr_.setRequestHeader(i,r[i].toString());return void 0!==n?this.xhr_.send(n):this.xhr_.send(),this.sendPromise_},t.prototype.getErrorCode=function(){if(!this.sent_)throw Yt("cannot .getErrorCode() before sending");return this.errorCode_},t.prototype.getStatus=function(){if(!this.sent_)throw Yt("cannot .getStatus() before sending");try{return this.xhr_.status}catch(t){return-1}},t.prototype.getResponseText=function(){if(!this.sent_)throw Yt("cannot .getResponseText() before sending");return this.xhr_.responseText},t.prototype.abort=function(){this.xhr_.abort()},t.prototype.getResponseHeader=function(t){return this.xhr_.getResponseHeader(t)},t.prototype.addUploadProgressListener=function(t){null!=this.xhr_.upload&&this.xhr_.upload.addEventListener("progress",t)},t.prototype.removeUploadProgressListener=function(t){null!=this.xhr_.upload&&this.xhr_.upload.removeEventListener("progress",t)},t}(),ue=function(){function t(){}return t.prototype.createXhrIo=function(){return new ae},t}();function ce(t){return"string"==typeof t||t instanceof String}function le(t){return he()&&t instanceof Blob}function he(){return"undefined"!=typeof Blob}function de(t,e,n,r){if(r<e)throw new qt("invalid-argument","Invalid value for '"+t+"'. Expected "+e+" or greater.");if(r>n)throw new qt("invalid-argument","Invalid value for '"+t+"'. Expected "+n+" or less.")}function fe(){return"undefined"!=typeof BlobBuilder?BlobBuilder:"undefined"!=typeof WebKitBlobBuilder?WebKitBlobBuilder:void 0}function pe(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=fe();if(void 0!==n){for(var r=new n,i=0;i<t.length;i++)r.append(t[i]);return r.getBlob()}if(he())return new Blob(t);throw new qt("unsupported-environment","This browser doesn't seem to support creating Blobs")}var ge=function(){function t(t,e){var n=0,r="";le(t)?(this.data_=t,n=t.size,r=t.type):t instanceof ArrayBuffer?(e?this.data_=new Uint8Array(t):(this.data_=new Uint8Array(t.byteLength),this.data_.set(new Uint8Array(t))),n=this.data_.length):t instanceof Uint8Array&&(e?this.data_=t:(this.data_=new Uint8Array(t.length),this.data_.set(t)),n=t.length),this.size_=n,this.type_=r}return t.prototype.size=function(){return this.size_},t.prototype.type=function(){return this.type_},t.prototype.slice=function(e,n){if(le(this.data_)){var r=(o=e,s=n,(i=this.data_).webkitSlice?i.webkitSlice(o,s):i.mozSlice?i.mozSlice(o,s):i.slice?i.slice(o,s):null);return null===r?null:new t(r)}var i,o,s;return new t(new Uint8Array(this.data_.buffer,e,n-e),!0)},t.getBlob=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];if(he()){var r=e.map((function(e){return e instanceof t?e.data_:e}));return new t(pe.apply(null,r))}var i=e.map((function(t){return ce(t)?te(Jt.RAW,t).data:t.data_})),o=0;i.forEach((function(t){o+=t.byteLength}));var s=new Uint8Array(o),a=0;return i.forEach((function(t){for(var e=0;e<t.length;e++)s[a++]=t[e]})),new t(s,!0)},t.prototype.uploadData=function(){return this.data_},t}(),ye=function(){function t(t,e){this.bucket=t,this.path_=e}return Object.defineProperty(t.prototype,"path",{get:function(){return this.path_},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isRoot",{get:function(){return 0===this.path.length},enumerable:!1,configurable:!0}),t.prototype.fullServerUrl=function(){var t=encodeURIComponent;return"/b/"+t(this.bucket)+"/o/"+t(this.path)},t.prototype.bucketOnlyServerUrl=function(){return"/b/"+encodeURIComponent(this.bucket)+"/o"},t.makeFromBucketSpec=function(e){var n;try{n=t.makeFromUrl(e)}catch(r){return new t(e,"")}if(""===n.path)return n;throw new qt("invalid-default-bucket","Invalid default bucket '"+e+"'.")},t.makeFromUrl=function(e){var n=null,r=new RegExp("^gs://([A-Za-z0-9.\\-_]+)(/(.*))?$","i");function i(t){t.path_=decodeURIComponent(t.path)}for(var o="firebasestorage.googleapis.com".replace(/[.]/g,"\\."),s=[{regex:r,indices:{bucket:1,path:3},postModify:function(t){"/"===t.path.charAt(t.path.length-1)&&(t.path_=t.path_.slice(0,-1))}},{regex:new RegExp("^https?://"+o+"/v[A-Za-z0-9_]+/b/([A-Za-z0-9.\\-_]+)/o(/([^?#]*).*)?$","i"),indices:{bucket:1,path:3},postModify:i},{regex:new RegExp("^https?://(?:storage.googleapis.com|storage.cloud.google.com)/([A-Za-z0-9.\\-_]+)/([^?#]*)","i"),indices:{bucket:1,path:2},postModify:i}],a=0;a<s.length;a++){var u=s[a],c=u.regex.exec(e);if(c){var l=c[u.indices.path];l||(l=""),n=new t(c[u.indices.bucket],l),u.postModify(n);break}}if(null==n)throw function(t){return new qt("invalid-url","Invalid URL '"+t+"'.")}(e);return n},t}();function ve(t){var e,n;try{e=JSON.parse(t)}catch(r){return null}return"object"!=typeof(n=e)||Array.isArray(n)?null:e}function me(t){var e=t.lastIndexOf("/",t.length-2);return-1===e?t:t.slice(e+1)}function be(t){return"https://firebasestorage.googleapis.com/v0"+t}function _e(t){var e=encodeURIComponent,n="?";for(var r in t)t.hasOwnProperty(r)&&(n=n+(e(r)+"=")+e(t[r])+"&");return n.slice(0,-1)}function we(t,e){return e}var Ee=function(){return function(t,e,n,r){this.server=t,this.local=e||t,this.writable=!!n,this.xform=r||we}}(),Oe=null;function Ce(){if(Oe)return Oe;var t=[];t.push(new Ee("bucket")),t.push(new Ee("generation")),t.push(new Ee("metageneration")),t.push(new Ee("name","fullPath",!0));var e=new Ee("name");e.xform=function(t,e){return function(t){return!ce(t)||t.length<2?t:me(t)}(e)},t.push(e);var n=new Ee("size");return n.xform=function(t,e){return void 0!==e?Number(e):e},t.push(n),t.push(new Ee("timeCreated")),t.push(new Ee("updated")),t.push(new Ee("md5Hash",null,!0)),t.push(new Ee("cacheControl",null,!0)),t.push(new Ee("contentDisposition",null,!0)),t.push(new Ee("contentEncoding",null,!0)),t.push(new Ee("contentLanguage",null,!0)),t.push(new Ee("contentType",null,!0)),t.push(new Ee("metadata","customMetadata",!0)),Oe=t}function Te(t,e,n){var r=ve(e);return null===r?null:function(t,e,n){for(var r={type:"file"},i=n.length,o=0;o<i;o++){var s=n[o];r[s.local]=s.xform(r,e[s.server])}return function(t,e){Object.defineProperty(t,"ref",{get:function(){var n=new ye(t.bucket,t.fullPath);return e.makeStorageReference(n)}})}(r,t),r}(t,r,n)}function Se(t,e){for(var n={},r=e.length,i=0;i<r;i++){var o=e[i];o.writable&&(n[o.server]=t[o.local])}return JSON.stringify(n)}var Ie=function(){return function(t,e,n,r){this.url=t,this.method=e,this.handler=n,this.timeout=r,this.urlParams={},this.headers={},this.body=null,this.errorHandler=null,this.progressCallback=null,this.successCodes=[200],this.additionalRetryCodes=[]}}();function je(t){if(!t)throw Bt()}function xe(t,e){return function(n,r){var i=Te(t,r,e);return je(null!==i),i}}function Ae(t){return function(e,n){var r;return(r=401===e.getStatus()?new qt("unauthenticated","User is not authenticated, please authenticate using Firebase Authentication and try again."):402===e.getStatus()?new qt("quota-exceeded","Quota for bucket '"+t.bucket+"' exceeded, please view quota on https://firebase.google.com/pricing/."):403===e.getStatus()?new qt("unauthorized","User does not have permission to access '"+t.path+"'."):n).serverResponse=n.serverResponse,r}}function ke(t){var e=Ae(t);return function(n,r){var i=e(n,r);return 404===n.getStatus()&&(i=new qt("object-not-found","Object '"+t.path+"' does not exist.")),i.serverResponse=r.serverResponse,i}}function Ne(t,e,n){var r=be(e.fullServerUrl()),i=t.maxOperationRetryTime,o=new Ie(r,"GET",xe(t,n),i);return o.errorHandler=ke(e),o}function Re(t,e,n){var r=Object.assign({},n);return r.fullPath=t.path,r.size=e.size(),r.contentType||(r.contentType=function(t,e){return e&&e.type()||"application/octet-stream"}(0,e)),r}var Pe=function(){return function(t,e,n,r){this.current=t,this.total=e,this.finalized=!!n,this.metadata=r||null}}();function De(t,e){var n=null;try{n=t.getResponseHeader("X-Goog-Upload-Status")}catch(r){je(!1)}return je(!!n&&-1!==(e||["active"]).indexOf(n)),n}var Le=function(){return function(t,e,n){if("function"==typeof t||null!=e||null!=n)this.next=t,this.error=e,this.complete=n;else{var r=t;this.next=r.next,this.error=r.error,this.complete=r.complete}}}(),Me=function(){return function(t,e,n,r,i,o){this.bytesTransferred=t,this.totalBytes=e,this.state=n,this.metadata=r,this.task=i,this.ref=o}}();function Fe(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];Promise.resolve().then((function(){return t.apply(void 0,e)}))}}var Ue=function(){function t(t,e,n){var r=this;void 0===n&&(n=null),this._transferred=0,this._needToFetchStatus=!1,this._needToFetchMetadata=!1,this._observers=[],this._error=void 0,this._uploadUrl=void 0,this._request=void 0,this._chunkMultiplier=1,this._resolve=void 0,this._reject=void 0,this._ref=t,this._blob=e,this._metadata=n,this._mappings=Ce(),this._resumable=this._shouldDoResumable(this._blob),this._state="running",this._errorHandler=function(t){r._request=void 0,r._chunkMultiplier=1,t.codeEquals("canceled")?(r._needToFetchStatus=!0,r.completeTransitions_()):(r._error=t,r._transition("error"))},this._metadataErrorHandler=function(t){r._request=void 0,t.codeEquals("canceled")?r.completeTransitions_():(r._error=t,r._transition("error"))},this._promise=new Promise((function(t,e){r._resolve=t,r._reject=e,r._start()})),this._promise.then(null,(function(){}))}return t.prototype._makeProgressCallback=function(){var t=this,e=this._transferred;return function(n){return t._updateProgress(e+n)}},t.prototype._shouldDoResumable=function(t){return t.size()>262144},t.prototype._start=function(){"running"===this._state&&void 0===this._request&&(this._resumable?void 0===this._uploadUrl?this._createResumable():this._needToFetchStatus?this._fetchStatus():this._needToFetchMetadata?this._fetchMetadata():this._continueUpload():this._oneShotUpload())},t.prototype._resolveToken=function(t){var e=this;this._ref.storage.getAuthToken().then((function(n){switch(e._state){case"running":t(n);break;case"canceling":e._transition("canceled");break;case"pausing":e._transition("paused")}}))},t.prototype._createResumable=function(){var t=this;this._resolveToken((function(e){var n=function(t,e,n,r,i){var o=e.bucketOnlyServerUrl(),s=Re(e,r,i),a={name:s.fullPath},u=be(o),c={"X-Goog-Upload-Protocol":"resumable","X-Goog-Upload-Command":"start","X-Goog-Upload-Header-Content-Length":r.size(),"X-Goog-Upload-Header-Content-Type":s.contentType,"Content-Type":"application/json; charset=utf-8"},l=Se(s,n),h=new Ie(u,"POST",(function(t){var e;De(t);try{e=t.getResponseHeader("X-Goog-Upload-URL")}catch(n){je(!1)}return je(ce(e)),e}),t.maxUploadRetryTime);return h.urlParams=a,h.headers=c,h.body=l,h.errorHandler=Ae(e),h}(t._ref.storage,t._ref._location,t._mappings,t._blob,t._metadata),r=t._ref.storage.makeRequest(n,e);t._request=r,r.getPromise().then((function(e){t._request=void 0,t._uploadUrl=e,t._needToFetchStatus=!1,t.completeTransitions_()}),t._errorHandler)}))},t.prototype._fetchStatus=function(){var t=this,e=this._uploadUrl;this._resolveToken((function(n){var r=function(t,e,n,r){var i=new Ie(n,"POST",(function(t){var e=De(t,["active","final"]),n=null;try{n=t.getResponseHeader("X-Goog-Upload-Size-Received")}catch(o){je(!1)}n||je(!1);var i=Number(n);return je(!isNaN(i)),new Pe(i,r.size(),"final"===e)}),t.maxUploadRetryTime);return i.headers={"X-Goog-Upload-Command":"query"},i.errorHandler=Ae(e),i}(t._ref.storage,t._ref._location,e,t._blob),i=t._ref.storage.makeRequest(r,n);t._request=i,i.getPromise().then((function(e){e=e,t._request=void 0,t._updateProgress(e.current),t._needToFetchStatus=!1,e.finalized&&(t._needToFetchMetadata=!0),t.completeTransitions_()}),t._errorHandler)}))},t.prototype._continueUpload=function(){var t=this,e=262144*this._chunkMultiplier,n=new Pe(this._transferred,this._blob.size()),r=this._uploadUrl;this._resolveToken((function(i){var o;try{o=function(t,e,n,r,i,o,s,a){var u=new Pe(0,0);if(s?(u.current=s.current,u.total=s.total):(u.current=0,u.total=r.size()),r.size()!==u.total)throw new qt("server-file-wrong-size","Server recorded incorrect upload file size, please retry the upload.");var c=u.total-u.current,l=c;i>0&&(l=Math.min(l,i));var h=u.current,d={"X-Goog-Upload-Command":l===c?"upload, finalize":"upload","X-Goog-Upload-Offset":u.current},f=r.slice(h,h+l);if(null===f)throw Wt();var p=new Ie(n,"POST",(function(t,n){var i,s=De(t,["active","final"]),a=u.current+l,c=r.size();return i="final"===s?xe(e,o)(t,n):null,new Pe(a,c,"final"===s,i)}),e.maxUploadRetryTime);return p.headers=d,p.body=f.uploadData(),p.progressCallback=a||null,p.errorHandler=Ae(t),p}(t._ref._location,t._ref.storage,r,t._blob,e,t._mappings,n,t._makeProgressCallback())}catch(a){return t._error=a,void t._transition("error")}var s=t._ref.storage.makeRequest(o,i);t._request=s,s.getPromise().then((function(e){t._increaseMultiplier(),t._request=void 0,t._updateProgress(e.current),e.finalized?(t._metadata=e.metadata,t._transition("success")):t.completeTransitions_()}),t._errorHandler)}))},t.prototype._increaseMultiplier=function(){262144*this._chunkMultiplier<33554432&&(this._chunkMultiplier*=2)},t.prototype._fetchMetadata=function(){var t=this;this._resolveToken((function(e){var n=Ne(t._ref.storage,t._ref._location,t._mappings),r=t._ref.storage.makeRequest(n,e);t._request=r,r.getPromise().then((function(e){t._request=void 0,t._metadata=e,t._transition("success")}),t._metadataErrorHandler)}))},t.prototype._oneShotUpload=function(){var t=this;this._resolveToken((function(e){var n=function(t,e,n,r,i){var o=e.bucketOnlyServerUrl(),s={"X-Goog-Upload-Protocol":"multipart"},a=function(){for(var t="",e=0;e<2;e++)t+=Math.random().toString().slice(2);return t}();s["Content-Type"]="multipart/related; boundary="+a;var u=Re(e,r,i),c=Se(u,n),l=ge.getBlob("--"+a+"\r\nContent-Type: application/json; charset=utf-8\r\n\r\n"+c+"\r\n--"+a+"\r\nContent-Type: "+u.contentType+"\r\n\r\n",r,"\r\n--"+a+"--");if(null===l)throw Wt();var h={name:u.fullPath},d=be(o),f=t.maxUploadRetryTime,p=new Ie(d,"POST",xe(t,n),f);return p.urlParams=h,p.headers=s,p.body=l.uploadData(),p.errorHandler=Ae(e),p}(t._ref.storage,t._ref._location,t._mappings,t._blob,t._metadata),r=t._ref.storage.makeRequest(n,e);t._request=r,r.getPromise().then((function(e){t._request=void 0,t._metadata=e,t._updateProgress(t._blob.size()),t._transition("success")}),t._errorHandler)}))},t.prototype._updateProgress=function(t){var e=this._transferred;this._transferred=t,this._transferred!==e&&this._notifyObservers()},t.prototype._transition=function(t){if(this._state!==t)switch(t){case"canceling":case"pausing":this._state=t,void 0!==this._request&&this._request.cancel();break;case"running":var e="paused"===this._state;this._state=t,e&&(this._notifyObservers(),this._start());break;case"paused":this._state=t,this._notifyObservers();break;case"canceled":this._error=zt(),this._state=t,this._notifyObservers();break;case"error":case"success":this._state=t,this._notifyObservers()}},t.prototype.completeTransitions_=function(){switch(this._state){case"pausing":this._transition("paused");break;case"canceling":this._transition("canceled");break;case"running":this._start()}},Object.defineProperty(t.prototype,"snapshot",{get:function(){var t=oe(this._state);return new Me(this._transferred,this._blob.size(),t,this._metadata,this,this._ref)},enumerable:!1,configurable:!0}),t.prototype.on=function(t,e,n,r){var i=this,o=new Le(e,n,r);return this._addObserver(o),function(){i._removeObserver(o)}},t.prototype.then=function(t,e){return this._promise.then(t,e)},t.prototype.catch=function(t){return this.then(null,t)},t.prototype._addObserver=function(t){this._observers.push(t),this._notifyObserver(t)},t.prototype._removeObserver=function(t){var e=this._observers.indexOf(t);-1!==e&&this._observers.splice(e,1)},t.prototype._notifyObservers=function(){var t=this;this._finishPromise(),this._observers.slice().forEach((function(e){t._notifyObserver(e)}))},t.prototype._finishPromise=function(){if(void 0!==this._resolve){var t=!0;switch(oe(this._state)){case ie.SUCCESS:Fe(this._resolve.bind(null,this.snapshot))();break;case ie.CANCELED:case ie.ERROR:Fe(this._reject.bind(null,this._error))();break;default:t=!1}t&&(this._resolve=void 0,this._reject=void 0)}},t.prototype._notifyObserver=function(t){switch(oe(this._state)){case ie.RUNNING:case ie.PAUSED:t.next&&Fe(t.next.bind(t,this.snapshot))();break;case ie.SUCCESS:t.complete&&Fe(t.complete.bind(t))();break;case ie.CANCELED:case ie.ERROR:t.error&&Fe(t.error.bind(t,this._error))();break;default:t.error&&Fe(t.error.bind(t,this._error))()}},t.prototype.resume=function(){var t="paused"===this._state||"pausing"===this._state;return t&&this._transition("running"),t},t.prototype.pause=function(){var t="running"===this._state;return t&&this._transition("pausing"),t},t.prototype.cancel=function(){var t="running"===this._state||"pausing"===this._state;return t&&this._transition("canceling"),t},t}(),$e=function(){function t(t,e){this._service=t,this._location=e instanceof ye?e:ye.makeFromUrl(e)}return t.prototype.toString=function(){return"gs://"+this._location.bucket+"/"+this._location.path},t.prototype.newRef=function(e,n){return new t(e,n)},Object.defineProperty(t.prototype,"root",{get:function(){var t=new ye(this._location.bucket,"");return this.newRef(this._service,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"bucket",{get:function(){return this._location.bucket},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fullPath",{get:function(){return this._location.path},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"name",{get:function(){return me(this._location.path)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"storage",{get:function(){return this._service},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"parent",{get:function(){var e=function(t){if(0===t.length)return null;var e=t.lastIndexOf("/");return-1===e?"":t.slice(0,e)}(this._location.path);if(null===e)return null;var n=new ye(this._location.bucket,e);return new t(this._service,n)},enumerable:!1,configurable:!0}),t.prototype._throwIfRoot=function(t){if(""===this._location.path)throw Kt(t)},t}();function Ve(t,e){return Object(Q.b)(this,void 0,void 0,(function(){var n,r,i;return Object(Q.e)(this,(function(o){switch(o.label){case 0:return null!=e&&"number"==typeof e.maxResults&&de("options.maxResults",1,1e3,e.maxResults),[4,t.storage.getAuthToken()];case 1:return n=o.sent(),i=function(t,e,n,r,i){var o={};o.prefix=e.isRoot?"":e.path+"/",n&&n.length>0&&(o.delimiter=n),r&&(o.pageToken=r),i&&(o.maxResults=i);var s=be(e.bucketOnlyServerUrl()),a=t.maxOperationRetryTime,u=new Ie(s,"GET",function(t,e){return function(n,r){var i=function(t,e,n){var r=ve(n);return null===r?null:function(t,e,n){var r={prefixes:[],items:[],nextPageToken:n.nextPageToken};if(n.prefixes)for(var i=0,o=n.prefixes;i<o.length;i++){var s=o[i].replace(/\/$/,""),a=t.makeStorageReference(new ye(e,s));r.prefixes.push(a)}if(n.items)for(var u=0,c=n.items;u<c.length;u++)a=t.makeStorageReference(new ye(e,c[u].name)),r.items.push(a);return r}(t,e,r)}(t,e,r);return je(null!==i),i}}(t,e.bucket),a);return u.urlParams=o,u.errorHandler=Ae(e),u}(t.storage,t._location,"/",(r=e||{}).pageToken,r.maxResults),[2,t.storage.makeRequest(i,n).getPromise()]}}))}))}function qe(t,e){var n=function(t,e){var n=e.split("/").filter((function(t){return t.length>0})).join("/");return 0===t.length?n:t+"/"+n}(t._location.path,e),r=new ye(t._location.bucket,n);return new $e(t.storage,r)}var He=function(){function t(t,e,n){this._delegate=t,this.task=e,this.ref=n}return Object.defineProperty(t.prototype,"bytesTransferred",{get:function(){return this._delegate.bytesTransferred},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"metadata",{get:function(){return this._delegate.metadata},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"state",{get:function(){return this._delegate.state},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"totalBytes",{get:function(){return this._delegate.totalBytes},enumerable:!1,configurable:!0}),t}(),Be=function(){function t(t,e){this._delegate=t,this._ref=e,this.cancel=this._delegate.cancel.bind(this._delegate),this.catch=this._delegate.catch.bind(this._delegate),this.pause=this._delegate.pause.bind(this._delegate),this.resume=this._delegate.resume.bind(this._delegate),this._snapshot=new He(this._delegate.snapshot,this,this._ref)}return Object.defineProperty(t.prototype,"snapshot",{get:function(){return this._snapshot},enumerable:!1,configurable:!0}),t.prototype.then=function(t,e){var n=this;return this._delegate.then((function(e){if(t)return t(new He(e,n,n._ref))}),e)},t.prototype.on=function(t,e,n,r){var i=this,o=void 0;return e&&(o="function"==typeof e?function(t){return e(new He(t,i,i._ref))}:{next:e.next?function(t){return e.next(new He(t,i,i._ref))}:void 0,complete:e.complete||void 0,error:e.error||void 0}),this._delegate.on(t,o,n||void 0,r||void 0)},t}(),ze=function(){function t(t,e){this._delegate=t,this._service=e}return Object.defineProperty(t.prototype,"prefixes",{get:function(){var t=this;return this._delegate.prefixes.map((function(e){return new We(e,t._service)}))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"items",{get:function(){var t=this;return this._delegate.items.map((function(e){return new We(e,t._service)}))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"nextPageToken",{get:function(){return this._delegate.nextPageToken||null},enumerable:!1,configurable:!0}),t}(),We=function(){function t(t,e){this._delegate=t,this.storage=e}return Object.defineProperty(t.prototype,"name",{get:function(){return this._delegate.name},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"bucket",{get:function(){return this._delegate.bucket},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fullPath",{get:function(){return this._delegate.fullPath},enumerable:!1,configurable:!0}),t.prototype.toString=function(){return this._delegate.toString()},t.prototype.child=function(e){return new t(qe(this._delegate,e),this.storage)},Object.defineProperty(t.prototype,"root",{get:function(){return new t(this._delegate.root,this.storage)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"parent",{get:function(){var e=this._delegate.parent;return null==e?null:new t(e,this.storage)},enumerable:!1,configurable:!0}),t.prototype.put=function(t,e){return this._throwIfRoot("put"),new Be(function(t,e,n){return void 0===n&&(n=null),t._throwIfRoot("uploadBytesResumable"),new Ue(t,new ge(e),n)}(this._delegate,t,e),this)},t.prototype.putString=function(t,e,n){return void 0===e&&(e=Jt.RAW),this._throwIfRoot("putString"),new Be(function(t,e,n,r){void 0===n&&(n=Jt.RAW),t._throwIfRoot("putString");var i=te(n,e),o=Object(Q.a)({},r);return null==o.contentType&&null!=i.contentType&&(o.contentType=i.contentType),new Ue(t,new ge(i.data,!0),o)}(this._delegate,t,e,n),this)},t.prototype.listAll=function(){var t,e,n=this;return(t=this._delegate,e={prefixes:[],items:[]},function t(e,n,r){return Object(Q.b)(this,void 0,void 0,(function(){var i,o,s;return Object(Q.e)(this,(function(a){switch(a.label){case 0:return[4,Ve(e,{pageToken:r})];case 1:return i=a.sent(),(o=n.prefixes).push.apply(o,i.prefixes),(s=n.items).push.apply(s,i.items),null==i.nextPageToken?[3,3]:[4,t(e,n,i.nextPageToken)];case 2:a.sent(),a.label=3;case 3:return[2]}}))}))}(t,e).then((function(){return e}))).then((function(t){return new ze(t,n.storage)}))},t.prototype.list=function(t){var e=this;return Ve(this._delegate,t).then((function(t){return new ze(t,e.storage)}))},t.prototype.getMetadata=function(){return function(t){return Object(Q.b)(this,void 0,void 0,(function(){var e,n;return Object(Q.e)(this,(function(r){switch(r.label){case 0:return t._throwIfRoot("getMetadata"),[4,t.storage.getAuthToken()];case 1:return e=r.sent(),n=Ne(t.storage,t._location,Ce()),[2,t.storage.makeRequest(n,e).getPromise()]}}))}))}(this._delegate)},t.prototype.updateMetadata=function(t){return function(t,e){return Object(Q.b)(this,void 0,void 0,(function(){var n,r;return Object(Q.e)(this,(function(i){switch(i.label){case 0:return t._throwIfRoot("updateMetadata"),[4,t.storage.getAuthToken()];case 1:return n=i.sent(),r=function(t,e,n,r){var i=be(e.fullServerUrl()),o=Se(n,r),s=t.maxOperationRetryTime,a=new Ie(i,"PATCH",xe(t,r),s);return a.headers={"Content-Type":"application/json; charset=utf-8"},a.body=o,a.errorHandler=ke(e),a}(t.storage,t._location,e,Ce()),[2,t.storage.makeRequest(r,n).getPromise()]}}))}))}(this._delegate,t)},t.prototype.getDownloadURL=function(){return function(t){return Object(Q.b)(this,void 0,void 0,(function(){var e,n;return Object(Q.e)(this,(function(r){switch(r.label){case 0:return t._throwIfRoot("getDownloadURL"),[4,t.storage.getAuthToken()];case 1:return e=r.sent(),n=function(t,e,n){var r=be(e.fullServerUrl()),i=t.maxOperationRetryTime,o=new Ie(r,"GET",function(t,e){return function(n,r){var i=Te(t,r,e);return je(null!==i),function(t,e){var n=ve(e);if(null===n)return null;if(!ce(n.downloadTokens))return null;var r=n.downloadTokens;if(0===r.length)return null;var i=encodeURIComponent;return r.split(",").map((function(e){var n=t.fullPath;return be("/b/"+i(t.bucket)+"/o/"+i(n))+_e({alt:"media",token:e})}))[0]}(i,r)}}(t,n),i);return o.errorHandler=ke(e),o}(t.storage,t._location,Ce()),[2,t.storage.makeRequest(n,e).getPromise().then((function(t){if(null===t)throw new qt("no-download-url","The given file does not have any download URLs.");return t}))]}}))}))}(this._delegate)},t.prototype.delete=function(){return this._throwIfRoot("delete"),function(t){return Object(Q.b)(this,void 0,void 0,(function(){var e,n;return Object(Q.e)(this,(function(r){switch(r.label){case 0:return t._throwIfRoot("deleteObject"),[4,t.storage.getAuthToken()];case 1:return e=r.sent(),n=function(t,e){var n=be(e.fullServerUrl()),r=new Ie(n,"DELETE",(function(t,e){}),t.maxOperationRetryTime);return r.successCodes=[200,204],r.errorHandler=ke(e),r}(t.storage,t._location),[2,t.storage.makeRequest(n,e).getPromise()]}}))}))}(this._delegate)},t.prototype._throwIfRoot=function(t){if(""===this._delegate._location.path)throw Kt(t)},t}(),Ge=function(){function t(t){this.promise_=Promise.reject(t)}return t.prototype.getPromise=function(){return this.promise_},t.prototype.cancel=function(t){},t}(),Qe=function(){function t(t,e,n,r,i,o,s,a,u,c,l){var h=this;this.pendingXhr_=null,this.backoffId_=null,this.canceled_=!1,this.appDelete_=!1,this.url_=t,this.method_=e,this.headers_=n,this.body_=r,this.successCodes_=i.slice(),this.additionalRetryCodes_=o.slice(),this.callback_=s,this.errorCallback_=a,this.progressCallback_=c,this.timeout_=u,this.pool_=l,this.promise_=new Promise((function(t,e){h.resolve_=t,h.reject_=e,h.start_()}))}return t.prototype.start_=function(){var t=this;function e(e,n){var r,i=t.resolve_,o=t.reject_,s=n.xhr;if(n.wasSuccessCode)try{var a=t.callback_(s,s.getResponseText());void 0!==a?i(a):i()}catch(u){o(u)}else null!==s?((r=Bt()).serverResponse=s.getResponseText(),o(t.errorCallback_?t.errorCallback_(s,r):r)):o(r=n.canceled?t.appDelete_?Qt():zt():new qt("retry-limit-exceeded","Max retry time for operation exceeded, please try again."))}this.canceled_?e(0,new Ke(!1,null,!0)):this.backoffId_=function(e,n,r){var i=1,o=null,s=!1,a=0;function u(){return 2===a}var c=!1;function l(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];c||(c=!0,n.apply(null,t))}function h(e){o=setTimeout((function(){o=null,function(e,n){if(n)e(!1,new Ke(!1,null,!0));else{var r=t.pool_.createXhrIo();t.pendingXhr_=r,null!==t.progressCallback_&&r.addUploadProgressListener(i),r.send(t.url_,t.method_,t.body_,t.headers_).then((function(n){null!==t.progressCallback_&&n.removeUploadProgressListener(i),t.pendingXhr_=null;var r=(n=n).getErrorCode()===se.NO_ERROR,o=n.getStatus();if(r&&!t.isRetryStatusCode_(o)){var s=-1!==t.successCodes_.indexOf(o);e(!0,new Ke(s,n))}else{var a=n.getErrorCode()===se.ABORT;e(!1,new Ke(!1,null,a))}}))}function i(e){null!==t.progressCallback_&&t.progressCallback_(e.loaded,e.lengthComputable?e.total:-1)}}(d,u())}),e)}function d(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(!c)if(t)l.call.apply(l,Object(Q.h)([null,t],e));else{var r,o=u()||s;o?l.call.apply(l,Object(Q.h)([null,t],e)):(i<64&&(i*=2),1===a?(a=2,r=0):r=1e3*(i+Math.random()),h(r))}}var f=!1;function p(t){f||(f=!0,c||(null!==o?(t||(a=2),clearTimeout(o),h(0)):t||(a=1)))}return h(0),setTimeout((function(){s=!0,p(!0)}),r),p}(0,e,this.timeout_)},t.prototype.getPromise=function(){return this.promise_},t.prototype.cancel=function(t){this.canceled_=!0,this.appDelete_=t||!1,null!==this.backoffId_&&(0,this.backoffId_)(!1),null!==this.pendingXhr_&&this.pendingXhr_.abort()},t.prototype.isRetryStatusCode_=function(t){var e=t>=500&&t<600,n=-1!==[408,429].indexOf(t),r=-1!==this.additionalRetryCodes_.indexOf(t);return e||n||r},t}(),Ke=function(){return function(t,e,n){this.wasSuccessCode=t,this.xhr=e,this.canceled=!!n}}();function Xe(t){return/^[A-Za-z]+:\/\//.test(t)}function Ye(t,e){if(e&&Xe(e)){if(t instanceof tn)return new $e(t,e);throw Gt("To use ref(service, url), the first argument must be a Storage instance.")}return function t(e,n){if(e instanceof tn){var r=e;if(null==r._bucket)throw new qt("no-default-bucket","No default bucket found. Did you set the 'storageBucket' property when initializing the app?");var i=new $e(r,r._bucket);return null!=n?t(i,n):i}if(void 0!==n){if(n.includes(".."))throw Gt('`path` param cannot contain ".."');return qe(e,n)}return e}(t,e)}var Je,Ze,tn=function(){function t(t,e,n,r){var i,o;this.app=t,this._authProvider=e,this._pool=n,this._url=r,this._bucket=null,this._appId=null,this._deleted=!1,this._maxOperationRetryTime=12e4,this._maxUploadRetryTime=6e5,this._requests=new Set,this._bucket=null!=r?ye.makeFromBucketSpec(r):null==(o=null==(i=this.app.options)?void 0:i.storageBucket)?null:ye.makeFromBucketSpec(o)}return Object.defineProperty(t.prototype,"maxUploadRetryTime",{get:function(){return this._maxUploadRetryTime},set:function(t){de("time",0,Number.POSITIVE_INFINITY,t),this._maxUploadRetryTime=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"maxOperationRetryTime",{get:function(){return this._maxOperationRetryTime},set:function(t){de("time",0,Number.POSITIVE_INFINITY,t),this._maxOperationRetryTime=t},enumerable:!1,configurable:!0}),t.prototype.getAuthToken=function(){return Object(Q.b)(this,void 0,void 0,(function(){var t,e;return Object(Q.e)(this,(function(n){switch(n.label){case 0:return(t=this._authProvider.getImmediate({optional:!0}))?[4,t.getToken()]:[3,2];case 1:if(null!==(e=n.sent()))return[2,e.accessToken];n.label=2;case 2:return[2,null]}}))}))},t.prototype._delete=function(){return this._deleted=!0,this._requests.forEach((function(t){return t.cancel()})),this._requests.clear(),Promise.resolve()},t.prototype.makeStorageReference=function(t){return new $e(this,t)},t.prototype.makeRequest=function(t,e){var n=this;if(this._deleted)return new Ge(Qt());var r=function(t,e,n,r){var i=_e(t.urlParams),o=t.url+i,s=Object.assign({},t.headers);return function(t,e){e&&(t["X-Firebase-GMPID"]=e)}(s,e),function(t,e){null!==e&&e.length>0&&(t.Authorization="Firebase "+e)}(s,n),function(t){t["X-Firebase-Storage-Version"]="webjs/"+(void 0!==Ut.a?Ut.a.SDK_VERSION:"AppManager")}(s),new Qe(o,t.method,s,t.body,t.successCodes,t.additionalRetryCodes,t.handler,t.errorHandler,t.timeout,t.progressCallback,r)}(t,this._appId,e,this._pool);return this._requests.add(r),r.getPromise().then((function(){return n._requests.delete(r)}),(function(){return n._requests.delete(r)})),r},t}(),en=function(){function t(t,e){var n=this;this.app=t,this._delegate=e,this.INTERNAL={delete:function(){return n._delegate._delete()}}}return Object.defineProperty(t.prototype,"maxOperationRetryTime",{get:function(){return this._delegate.maxOperationRetryTime},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"maxUploadRetryTime",{get:function(){return this._delegate.maxUploadRetryTime},enumerable:!1,configurable:!0}),t.prototype.ref=function(t){if(Xe(t))throw Gt("ref() expected a child path but got a URL, use refFromURL instead.");return new We(Ye(this._delegate,t),this)},t.prototype.refFromURL=function(t){if(!Xe(t))throw Gt("refFromURL() expected a full URL but got a child path, use ref() instead.");try{ye.makeFromUrl(t)}catch(e){throw Gt("refFromUrl() expected a valid full URL but got an invalid one.")}return new We(Ye(this._delegate,t),this)},t.prototype.setMaxUploadRetryTime=function(t){this._delegate.maxUploadRetryTime=t},t.prototype.setMaxOperationRetryTime=function(t){this._delegate.maxOperationRetryTime=t},t}();function nn(t){const e=function(t){return new it.a(e=>{const n=t=>e.next(t);t.on("state_changed",n,r=>{n(t.snapshot),(t=>{e.error(t)})(r)},()=>{n(t.snapshot),e.complete()})}).pipe(Object(Mt.a)({bufferSize:1,refCount:!1}))}(t);return{task:t,then:t.then.bind(t),catch:t.catch.bind(t),pause:t.pause.bind(t),cancel:t.cancel.bind(t),resume:t.resume.bind(t),snapshotChanges:()=>e,percentageChanges:()=>e.pipe(Object(at.a)(t=>t.bytesTransferred/t.totalBytes*100))}}function rn(t,e,n){return{getDownloadURL:()=>Object(ot.a)(void 0).pipe(Object(Ft.b)(e.outsideAngular),Object(ct.a)(()=>t.getDownloadURL()),n),getMetadata:()=>Object(ot.a)(void 0).pipe(Object(Ft.b)(e.outsideAngular),Object(ct.a)(()=>t.getMetadata()),n),delete:()=>Object(Lt.a)(t.delete()),child:r=>rn(t.child(r),e,n),updateMetadata:e=>Object(Lt.a)(t.updateMetadata(e)),put:(e,n)=>nn(t.put(e,n)),putString:(e,n,r)=>nn(t.putString(e,n,r)),listAll:()=>Object(Lt.a)(t.listAll())}}Ze={TaskState:ie,TaskEvent:{STATE_CHANGED:"state_changed"},StringFormat:Jt,Storage:tn,Reference:We},(Je=Ut.a).INTERNAL.registerComponent(new Vt.a("storage",(function(t,e){var n=t.getProvider("app").getImmediate(),r=t.getProvider("auth-internal");return new en(n,new tn(n,r,new ue,e))}),"PUBLIC").setServiceProps(Ze).setMultipleInstances(!0)),Je.registerVersion("@firebase/storage","0.4.2");const on=new r.q("angularfire2.storageBucket"),sn=new r.q("angularfire2.storage.maxUploadRetryTime"),an=new r.q("angularfire2.storage.maxOperationRetryTime");let un=(()=>{class t{constructor(t,e,n,r,i,o,s){this.schedulers=new et.d(i),this.keepUnstableUntilFirst=Object(et.h)(this.schedulers);const a=Object(et.g)(t,i,e);this.storage=Object(et.f)(`${a.name}.storage.${n}`,"AngularFireStorage",a,()=>{const t=i.runOutsideAngular(()=>a.storage(n||void 0));return o&&t.setMaxUploadRetryTime(o),s&&t.setMaxOperationRetryTime(s),t},[o,s])}ref(t){return rn(this.storage.ref(t),this.schedulers,this.keepUnstableUntilFirst)}refFromURL(t){return rn(this.storage.refFromURL(t),this.schedulers,this.keepUnstableUntilFirst)}upload(t,e,n){return rn(this.storage.ref(t),this.schedulers,this.keepUnstableUntilFirst).put(e,n)}}return t.\u0275fac=function(e){return new(e||t)(r.Nb(et.c),r.Nb(et.b,8),r.Nb(on,8),r.Nb(r.B),r.Nb(r.z),r.Nb(sn,8),r.Nb(an,8))},t.\u0275prov=Object(r.Db)({factory:function(){return new t(Object(r.Nb)(et.c),Object(r.Nb)(et.b,8),Object(r.Nb)(on,8),Object(r.Nb)(r.B),Object(r.Nb)(r.z),Object(r.Nb)(sn,8),Object(r.Nb)(an,8))},token:t,providedIn:"any"}),t})(),cn=(()=>{class t{}return t.\u0275mod=r.Fb({type:t}),t.\u0275inj=r.Eb({factory:function(e){return new(e||t)}}),t})(),ln=(()=>{class t{}return t.\u0275mod=r.Fb({type:t}),t.\u0275inj=r.Eb({factory:function(e){return new(e||t)},providers:[un],imports:[cn]}),t})();var hn=n("I/3d"),dn=n("NXyV"),fn=n("z6cu"),pn=n("xgIS"),gn=n("GyhO"),yn=n("XNiG"),vn=n("KqfI");const mn=new it.a(vn.a);var bn=n("pLZG"),_n=n("oB13"),wn=n("IzEk"),En=n("vkgz"),On=n("WMd4");class Cn{constructor(t,e){this.delay=t,this.scheduler=e}call(t,e){return e.subscribe(new Tn(t,this.delay,this.scheduler))}}class Tn extends yt.a{constructor(t,e,n){super(t),this.delay=e,this.scheduler=n,this.queue=[],this.active=!1,this.errored=!1}static dispatch(t){const e=t.source,n=e.queue,r=t.scheduler,i=t.destination;for(;n.length>0&&n[0].time-r.now()<=0;)n.shift().notification.observe(i);if(n.length>0){const e=Math.max(0,n[0].time-r.now());this.schedule(t,e)}else this.unsubscribe(),e.active=!1}_schedule(t){this.active=!0,this.destination.add(t.schedule(Tn.dispatch,this.delay,{source:this,destination:this.destination,scheduler:t}))}scheduleNotification(t){if(!0===this.errored)return;const e=this.scheduler,n=new Sn(e.now()+this.delay,t);this.queue.push(n),!1===this.active&&this._schedule(e)}_next(t){this.scheduleNotification(On.a.createNext(t))}_error(t){this.errored=!0,this.queue=[],this.destination.error(t),this.unsubscribe()}_complete(){this.scheduleNotification(On.a.createComplete()),this.unsubscribe()}}class Sn{constructor(t,e){this.time=t,this.notification=e}}const In="Service workers are disabled or not supported by this browser";class jn{constructor(t){if(this.serviceWorker=t,t){const e=Object(pn.a)(t,"controllerchange").pipe(Object(at.a)(()=>t.controller)),n=Object(dn.a)(()=>Object(ot.a)(t.controller)),r=Object(gn.a)(n,e);this.worker=r.pipe(Object(bn.a)(t=>!!t)),this.registration=this.worker.pipe(Object(ct.a)(()=>t.getRegistration()));const i=Object(pn.a)(t,"message").pipe(Object(at.a)(t=>t.data)).pipe(Object(bn.a)(t=>t&&t.type)).pipe(Object(_n.a)(new yn.a));i.connect(),this.events=i}else this.worker=this.events=this.registration=Object(dn.a)(()=>Object(fn.a)(new Error("Service workers are disabled or not supported by this browser")))}postMessage(t,e){return this.worker.pipe(Object(wn.a)(1),Object(En.a)(n=>{n.postMessage(Object.assign({action:t},e))})).toPromise().then(()=>{})}postMessageWithStatus(t,e,n){const r=this.waitForStatus(n),i=this.postMessage(t,e);return Promise.all([r,i]).then(()=>{})}generateNonce(){return Math.round(1e7*Math.random())}eventsOfType(t){return this.events.pipe(Object(bn.a)(e=>e.type===t))}nextEventOfType(t){return this.eventsOfType(t).pipe(Object(wn.a)(1))}waitForStatus(t){return this.eventsOfType("STATUS").pipe(Object(bn.a)(e=>e.nonce===t),Object(wn.a)(1),Object(at.a)(t=>{if(!t.status)throw new Error(t.error)})).toPromise()}get isEnabled(){return!!this.serviceWorker}}let xn=(()=>{class t{constructor(t){if(this.sw=t,this.subscriptionChanges=new yn.a,!t.isEnabled)return this.messages=mn,this.notificationClicks=mn,void(this.subscription=mn);this.messages=this.sw.eventsOfType("PUSH").pipe(Object(at.a)(t=>t.data)),this.notificationClicks=this.sw.eventsOfType("NOTIFICATION_CLICK").pipe(Object(at.a)(t=>t.data)),this.pushManager=this.sw.registration.pipe(Object(at.a)(t=>t.pushManager));const e=this.pushManager.pipe(Object(ct.a)(t=>t.getSubscription()));this.subscription=Object(st.a)(e,this.subscriptionChanges)}get isEnabled(){return this.sw.isEnabled}requestSubscription(t){if(!this.sw.isEnabled)return Promise.reject(new Error(In));const e={userVisibleOnly:!0};let n=this.decodeBase64(t.serverPublicKey.replace(/_/g,"/").replace(/-/g,"+")),r=new Uint8Array(new ArrayBuffer(n.length));for(let i=0;i<n.length;i++)r[i]=n.charCodeAt(i);return e.applicationServerKey=r,this.pushManager.pipe(Object(ct.a)(t=>t.subscribe(e)),Object(wn.a)(1)).toPromise().then(t=>(this.subscriptionChanges.next(t),t))}unsubscribe(){return this.sw.isEnabled?this.subscription.pipe(Object(wn.a)(1),Object(ct.a)(t=>{if(null===t)throw new Error("Not subscribed to push notifications.");return t.unsubscribe().then(t=>{if(!t)throw new Error("Unsubscribe failed!");this.subscriptionChanges.next(null)})})).toPromise():Promise.reject(new Error(In))}decodeBase64(t){return atob(t)}}return t.\u0275fac=function(e){return new(e||t)(r.Nb(jn))},t.\u0275prov=r.Db({token:t,factory:t.\u0275fac}),t})(),An=(()=>{class t{constructor(t){if(this.sw=t,!t.isEnabled)return this.available=mn,void(this.activated=mn);this.available=this.sw.eventsOfType("UPDATE_AVAILABLE"),this.activated=this.sw.eventsOfType("UPDATE_ACTIVATED")}get isEnabled(){return this.sw.isEnabled}checkForUpdate(){if(!this.sw.isEnabled)return Promise.reject(new Error(In));const t=this.sw.generateNonce();return this.sw.postMessageWithStatus("CHECK_FOR_UPDATES",{statusNonce:t},t)}activateUpdate(){if(!this.sw.isEnabled)return Promise.reject(new Error(In));const t=this.sw.generateNonce();return this.sw.postMessageWithStatus("ACTIVATE_UPDATE",{statusNonce:t},t)}}return t.\u0275fac=function(e){return new(e||t)(r.Nb(jn))},t.\u0275prov=r.Db({token:t,factory:t.\u0275fac}),t})();class kn{}const Nn=new r.q("NGSW_REGISTER_SCRIPT");function Rn(t,e,n,i){return()=>{if(!Object(o.l)(i)||!("serviceWorker"in navigator)||!1===n.enabled)return;let s;if(navigator.serviceWorker.addEventListener("controllerchange",()=>{null!==navigator.serviceWorker.controller&&navigator.serviceWorker.controller.postMessage({action:"INITIALIZE"})}),"function"==typeof n.registrationStrategy)s=n.registrationStrategy();else{const[e,...r]=(n.registrationStrategy||"registerWhenStable:30000").split(":");switch(e){case"registerImmediately":s=Object(ot.a)(null);break;case"registerWithDelay":s=Pn(+r[0]||0);break;case"registerWhenStable":s=r[0]?Object(st.a)(Dn(t),Pn(+r[0])):Dn(t);break;default:throw new Error("Unknown ServiceWorker registration strategy: "+n.registrationStrategy)}}t.get(r.z).runOutsideAngular(()=>s.pipe(Object(wn.a)(1)).subscribe(()=>navigator.serviceWorker.register(e,{scope:n.scope}).catch(t=>console.error("Service worker registration failed with:",t))))}}function Pn(t){return Object(ot.a)(null).pipe(function(t,e=rt.a){var n;const r=(n=t)instanceof Date&&!isNaN(+n)?+t-e.now():Math.abs(t);return t=>t.lift(new Cn(r,e))}(t))}function Dn(t){return t.get(r.g).isStable.pipe(Object(bn.a)(t=>t))}function Ln(t,e){return new jn(Object(o.l)(e)&&!1!==t.enabled?navigator.serviceWorker:void 0)}let Mn=(()=>{class t{static register(e,n={}){return{ngModule:t,providers:[{provide:Nn,useValue:e},{provide:kn,useValue:n},{provide:jn,useFactory:Ln,deps:[kn,r.B]},{provide:r.d,useFactory:Rn,deps:[r.r,Nn,kn,r.B],multi:!0}]}}}return t.\u0275mod=r.Fb({type:t}),t.\u0275inj=r.Eb({factory:function(e){return new(e||t)},providers:[xn,An]}),t})(),Fn=(()=>{class t{}return t.\u0275mod=r.Fb({type:t,bootstrap:[J]}),t.\u0275inj=r.Eb({factory:function(e){return new(e||t)},providers:[{provide:L.f,useClass:M.w}],imports:[[D,M.v.forRoot(),tt,et.a.initializeApp(i),nt.b,Dt,ln,hn.b,Mn.register("ngsw-worker.js",{enabled:!0})]]}),t})();Object(r.S)(),R().bootstrapModule(Fn).catch(t=>console.log(t))},zn8P:function(t,e){function n(t){return Promise.resolve().then((function(){var e=new Error("Cannot find module '"+t+"'");throw e.code="MODULE_NOT_FOUND",e}))}n.keys=function(){return[]},n.resolve=n,t.exports=n,n.id="zn8P"}},[[0,1]]]);