pwa-auth 3.7.5 → 3.7.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,7 +4,7 @@
4
4
  * Licensed under MIT
5
5
  */
6
6
 
7
- const t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,n=Symbol(),s=new WeakMap;let r=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==n)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const n=this.t;if(e&&void 0===t){const e=void 0!==n&&1===n.length;e&&(t=s.get(n)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),e&&s.set(n,t))}return t}toString(){return this.cssText}};const i=(t,...e)=>{const s=1===t.length?t[0]:e.reduce((e,n,s)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+t[s+1],t[0]);return new r(s,t,n)},o=e?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const n of t.cssRules)e+=n.cssText;return(t=>new r("string"==typeof t?t:t+"",void 0,n))(e)})(t):t,{is:a,defineProperty:B,getOwnPropertyDescriptor:c,getOwnPropertyNames:l,getOwnPropertySymbols:u,getPrototypeOf:h}=Object,d=globalThis,p=d.trustedTypes,f=p?p.emptyScript:"",C=d.reactiveElementPolyfillSupport,g=(t,e)=>t,m={toAttribute(t,e){switch(e){case Boolean:t=t?f:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let n=t;switch(e){case Boolean:n=null!==t;break;case Number:n=null===t?null:Number(t);break;case Object:case Array:try{n=JSON.parse(t)}catch(t){n=null}}return n}},w=(t,e)=>!a(t,e),y={attribute:!0,type:String,converter:m,reflect:!1,useDefault:!1,hasChanged:w};Symbol.metadata??=Symbol("metadata"),d.litPropertyMetadata??=new WeakMap;let E=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=y){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){const n=Symbol(),s=this.getPropertyDescriptor(t,n,e);void 0!==s&&B(this.prototype,t,s)}}static getPropertyDescriptor(t,e,n){const{get:s,set:r}=c(this.prototype,t)??{get(){return this[e]},set(t){this[e]=t}};return{get:s,set(e){const i=s?.call(this);r?.call(this,e),this.requestUpdate(t,i,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??y}static _$Ei(){if(this.hasOwnProperty(g("elementProperties")))return;const t=h(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(g("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(g("properties"))){const t=this.properties,e=[...l(t),...u(t)];for(const n of e)this.createProperty(n,t[n])}const t=this[Symbol.metadata];if(null!==t){const e=litPropertyMetadata.get(t);if(void 0!==e)for(const[t,n]of e)this.elementProperties.set(t,n)}this._$Eh=new Map;for(const[t,e]of this.elementProperties){const n=this._$Eu(t,e);void 0!==n&&this._$Eh.set(n,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const n=new Set(t.flat(1/0).reverse());for(const t of n)e.unshift(o(t))}else void 0!==t&&e.push(o(t));return e}static _$Eu(t,e){const n=e.attribute;return!1===n?void 0:"string"==typeof n?n:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const n of e.keys())this.hasOwnProperty(n)&&(t.set(n,this[n]),delete this[n]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const n=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((n,s)=>{if(e)n.adoptedStyleSheets=s.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const e of s){const s=document.createElement("style"),r=t.litNonce;void 0!==r&&s.setAttribute("nonce",r),s.textContent=e.cssText,n.appendChild(s)}})(n,this.constructor.elementStyles),n}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,n){this._$AK(t,n)}_$ET(t,e){const n=this.constructor.elementProperties.get(t),s=this.constructor._$Eu(t,n);if(void 0!==s&&!0===n.reflect){const r=(void 0!==n.converter?.toAttribute?n.converter:m).toAttribute(e,n.type);this._$Em=t,null==r?this.removeAttribute(s):this.setAttribute(s,r),this._$Em=null}}_$AK(t,e){const n=this.constructor,s=n._$Eh.get(t);if(void 0!==s&&this._$Em!==s){const t=n.getPropertyOptions(s),r="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:m;this._$Em=s;const i=r.fromAttribute(e,t.type);this[s]=i??this._$Ej?.get(s)??i,this._$Em=null}}requestUpdate(t,e,n){if(void 0!==t){const s=this.constructor,r=this[t];if(n??=s.getPropertyOptions(t),!((n.hasChanged??w)(r,e)||n.useDefault&&n.reflect&&r===this._$Ej?.get(t)&&!this.hasAttribute(s._$Eu(t,n))))return;this.C(t,e,n)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(t,e,{useDefault:n,reflect:s,wrapped:r},i){n&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,i??e??this[t]),!0!==r||void 0!==i)||(this._$AL.has(t)||(this.hasUpdated||n||(e=void 0),this._$AL.set(t,e)),!0===s&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,e]of this._$Ep)this[t]=e;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[e,n]of t){const{wrapped:t}=n,s=this[e];!0!==t||this._$AL.has(e)||void 0===s||this.C(e,void 0,n,s)}}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(t=>t.hostUpdate?.()),this.update(e)):this._$EM()}catch(e){throw t=!1,this._$EM(),e}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(t=>t.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&=this._$Eq.forEach(t=>this._$ET(t,this[t])),this._$EM()}updated(t){}firstUpdated(t){}};E.elementStyles=[],E.shadowRootOptions={mode:"open"},E[g("elementProperties")]=new Map,E[g("finalized")]=new Map,C?.({ReactiveElement:E}),(d.reactiveElementVersions??=[]).push("2.1.1");const D=globalThis,_=D.trustedTypes,b=_?_.createPolicy("lit-html",{createHTML:t=>t}):void 0,v="$lit$",I=`lit$${Math.random().toFixed(9).slice(2)}$`,T="?"+I,O=`<${T}>`,A=document,S=()=>A.createComment(""),R=t=>null===t||"object"!=typeof t&&"function"!=typeof t,N=Array.isArray,x="[ \t\n\f\r]",k=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,L=/-->/g,F=/>/g,P=RegExp(`>|${x}(?:([^\\s"'>=/]+)(${x}*=${x}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),M=/'/g,G=/"/g,H=/^(?:script|style|textarea|title)$/i,U=(t=>(e,...n)=>({_$litType$:t,strings:e,values:n}))(1),V=Symbol.for("lit-noChange"),j=Symbol.for("lit-nothing"),$=new WeakMap,J=A.createTreeWalker(A,129);function q(t,e){if(!N(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==b?b.createHTML(e):e}const z=(t,e)=>{const n=t.length-1,s=[];let r,i=2===e?"<svg>":3===e?"<math>":"",o=k;for(let e=0;e<n;e++){const n=t[e];let a,B,c=-1,l=0;for(;l<n.length&&(o.lastIndex=l,B=o.exec(n),null!==B);)l=o.lastIndex,o===k?"!--"===B[1]?o=L:void 0!==B[1]?o=F:void 0!==B[2]?(H.test(B[2])&&(r=RegExp("</"+B[2],"g")),o=P):void 0!==B[3]&&(o=P):o===P?">"===B[0]?(o=r??k,c=-1):void 0===B[1]?c=-2:(c=o.lastIndex-B[2].length,a=B[1],o=void 0===B[3]?P:'"'===B[3]?G:M):o===G||o===M?o=P:o===L||o===F?o=k:(o=P,r=void 0);const u=o===P&&t[e+1].startsWith("/>")?" ":"";i+=o===k?n+O:c>=0?(s.push(a),n.slice(0,c)+v+n.slice(c)+I+u):n+I+(-2===c?e:u)}return[q(t,i+(t[n]||"<?>")+(2===e?"</svg>":3===e?"</math>":"")),s]};class K{constructor({strings:t,_$litType$:e},n){let s;this.parts=[];let r=0,i=0;const o=t.length-1,a=this.parts,[B,c]=z(t,e);if(this.el=K.createElement(B,n),J.currentNode=this.el.content,2===e||3===e){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(s=J.nextNode())&&a.length<o;){if(1===s.nodeType){if(s.hasAttributes())for(const t of s.getAttributeNames())if(t.endsWith(v)){const e=c[i++],n=s.getAttribute(t).split(I),o=/([.?@])?(.*)/.exec(e);a.push({type:1,index:r,name:o[2],strings:n,ctor:"."===o[1]?Z:"?"===o[1]?tt:"@"===o[1]?et:X}),s.removeAttribute(t)}else t.startsWith(I)&&(a.push({type:6,index:r}),s.removeAttribute(t));if(H.test(s.tagName)){const t=s.textContent.split(I),e=t.length-1;if(e>0){s.textContent=_?_.emptyScript:"";for(let n=0;n<e;n++)s.append(t[n],S()),J.nextNode(),a.push({type:2,index:++r});s.append(t[e],S())}}}else if(8===s.nodeType)if(s.data===T)a.push({type:2,index:r});else{let t=-1;for(;-1!==(t=s.data.indexOf(I,t+1));)a.push({type:7,index:r}),t+=I.length-1}r++}}static createElement(t,e){const n=A.createElement("template");return n.innerHTML=t,n}}function Q(t,e,n=t,s){if(e===V)return e;let r=void 0!==s?n._$Co?.[s]:n._$Cl;const i=R(e)?void 0:e._$litDirective$;return r?.constructor!==i&&(r?._$AO?.(!1),void 0===i?r=void 0:(r=new i(t),r._$AT(t,n,s)),void 0!==s?(n._$Co??=[])[s]=r:n._$Cl=r),void 0!==r&&(e=Q(t,r._$AS(t,e.values),r,s)),e}let W=class{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:n}=this._$AD,s=(t?.creationScope??A).importNode(e,!0);J.currentNode=s;let r=J.nextNode(),i=0,o=0,a=n[0];for(;void 0!==a;){if(i===a.index){let e;2===a.type?e=new Y(r,r.nextSibling,this,t):1===a.type?e=new a.ctor(r,a.name,a.strings,this,t):6===a.type&&(e=new nt(r,this,t)),this._$AV.push(e),a=n[++o]}i!==a?.index&&(r=J.nextNode(),i++)}return J.currentNode=A,s}p(t){let e=0;for(const n of this._$AV)void 0!==n&&(void 0!==n.strings?(n._$AI(t,n,e),e+=n.strings.length-2):n._$AI(t[e])),e++}},Y=class t{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,n,s){this.type=2,this._$AH=j,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=n,this.options=s,this._$Cv=s?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===t?.nodeType&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=Q(this,t,e),R(t)?t===j||null==t||""===t?(this._$AH!==j&&this._$AR(),this._$AH=j):t!==this._$AH&&t!==V&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):(t=>N(t)||"function"==typeof t?.[Symbol.iterator])(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==j&&R(this._$AH)?this._$AA.nextSibling.data=t:this.T(A.createTextNode(t)),this._$AH=t}$(t){const{values:e,_$litType$:n}=t,s="number"==typeof n?this._$AC(t):(void 0===n.el&&(n.el=K.createElement(q(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===s)this._$AH.p(e);else{const t=new W(s,this),n=t.u(this.options);t.p(e),this.T(n),this._$AH=t}}_$AC(t){let e=$.get(t.strings);return void 0===e&&$.set(t.strings,e=new K(t)),e}k(e){N(this._$AH)||(this._$AH=[],this._$AR());const n=this._$AH;let s,r=0;for(const i of e)r===n.length?n.push(s=new t(this.O(S()),this.O(S()),this,this.options)):s=n[r],s._$AI(i),r++;r<n.length&&(this._$AR(s&&s._$AB.nextSibling,r),n.length=r)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t))}},X=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,n,s,r){this.type=1,this._$AH=j,this._$AN=void 0,this.element=t,this.name=e,this._$AM=s,this.options=r,n.length>2||""!==n[0]||""!==n[1]?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=j}_$AI(t,e=this,n,s){const r=this.strings;let i=!1;if(void 0===r)t=Q(this,t,e,0),i=!R(t)||t!==this._$AH&&t!==V,i&&(this._$AH=t);else{const s=t;let o,a;for(t=r[0],o=0;o<r.length-1;o++)a=Q(this,s[n+o],e,o),a===V&&(a=this._$AH[o]),i||=!R(a)||a!==this._$AH[o],a===j?t=j:t!==j&&(t+=(a??"")+r[o+1]),this._$AH[o]=a}i&&!s&&this.j(t)}j(t){t===j?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}};class Z extends X{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===j?void 0:t}}let tt=class extends X{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==j)}},et=class extends X{constructor(t,e,n,s,r){super(t,e,n,s,r),this.type=5}_$AI(t,e=this){if((t=Q(this,t,e,0)??j)===V)return;const n=this._$AH,s=t===j&&n!==j||t.capture!==n.capture||t.once!==n.once||t.passive!==n.passive,r=t!==j&&(n===j||s);s&&this.element.removeEventListener(this.name,this,n),r&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}};class nt{constructor(t,e,n){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(t){Q(this,t)}}const st=D.litHtmlPolyfillSupport;st?.(K,Y),(D.litHtmlVersions??=[]).push("3.3.1");const rt=globalThis;let it=class extends E{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=((t,e,n)=>{const s=n?.renderBefore??e;let r=s._$litPart$;if(void 0===r){const t=n?.renderBefore??null;s._$litPart$=r=new Y(e.insertBefore(S(),t),t,void 0,n??{})}return r._$AI(t),r})(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return V}};it._$litElement$=!0,it.finalized=!0,rt.litElementHydrateSupport?.({LitElement:it});const ot=rt.litElementPolyfillSupport;ot?.({LitElement:it}),(rt.litElementVersions??=[]).push("4.2.1");const at=t=>(e,n)=>{void 0!==n?n.addInitializer(()=>{customElements.define(t,e)}):customElements.define(t,e)},Bt={attribute:!0,type:String,converter:m,reflect:!1,hasChanged:w},ct=(t=Bt,e,n)=>{const{kind:s,metadata:r}=n;let i=globalThis.litPropertyMetadata.get(r);if(void 0===i&&globalThis.litPropertyMetadata.set(r,i=new Map),"setter"===s&&((t=Object.create(t)).wrapped=!0),i.set(n.name,t),"accessor"===s){const{name:s}=n;return{set(n){const r=e.get.call(this);e.set.call(this,n),this.requestUpdate(s,r,t)},init(e){return void 0!==e&&this.C(s,void 0,t,e),e}}}if("setter"===s){const{name:s}=n;return function(n){const r=this[s];e.call(this,n),this.requestUpdate(s,r,t)}}throw Error("Unsupported decorator location: "+s)};function lt(t){return(e,n)=>"object"==typeof n?ct(t,e,n):((t,e,n)=>{const s=e.hasOwnProperty(n);return e.constructor.createProperty(n,t),s?Object.getOwnPropertyDescriptor(e,n):void 0})(t,e,n)}function ut(t){return lt({...t,state:!0,attribute:!1})}const ht=1,dt=t=>(...e)=>({_$litDirective$:t,values:e});let pt=class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,n){this._$Ct=t,this._$AM=e,this._$Ci=n}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}};const ft=dt(class extends pt{constructor(t){if(super(t),t.type!==ht||"class"!==t.name||t.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return" "+Object.keys(t).filter(e=>t[e]).join(" ")+" "}update(t,[e]){if(void 0===this.st){this.st=new Set,void 0!==t.strings&&(this.nt=new Set(t.strings.join(" ").split(/\s/).filter(t=>""!==t)));for(const t in e)e[t]&&!this.nt?.has(t)&&this.st.add(t);return this.render(e)}const n=t.element.classList;for(const t of this.st)t in e||(n.remove(t),this.st.delete(t));for(const t in e){const s=!!e[t];s===this.st.has(t)||this.nt?.has(t)||(s?(n.add(t),this.st.add(t)):(n.remove(t),this.st.delete(t)))}return V}}),Ct="important",gt=" !"+Ct,mt=dt(class extends pt{constructor(t){if(super(t),t.type!==ht||"style"!==t.name||t.strings?.length>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(t){return Object.keys(t).reduce((e,n)=>{const s=t[n];return null==s?e:e+`${n=n.includes("-")?n:n.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${s};`},"")}update(t,[e]){const{style:n}=t.element;if(void 0===this.ft)return this.ft=new Set(Object.keys(e)),this.render(e);for(const t of this.ft)null==e[t]&&(this.ft.delete(t),t.includes("-")?n.removeProperty(t):n[t]=null);for(const t in e){const s=e[t];if(null!=s){this.ft.add(t);const e="string"==typeof s&&s.endsWith(gt);t.includes("-")||e?n.setProperty(t,e?s.slice(0,-11):s,e?Ct:""):n[t]=s}}return V}}),wt=t=>e=>class extends e{connectedCallback(){super.connectedCallback&&super.connectedCallback(),this._storeUnsubscribe=t.subscribe(()=>this.stateChanged(t.getState())),this.stateChanged(t.getState())}disconnectedCallback(){this._storeUnsubscribe(),super.disconnectedCallback&&super.disconnectedCallback()}stateChanged(t){}};function yt(t){return`Minified Redux error #${t}; visit https://redux.js.org/Errors?code=${t} for the full message or use the non-minified dev environment for full errors. `}var Et=(()=>"function"==typeof Symbol&&Symbol.observable||"@@observable")(),Dt=()=>Math.random().toString(36).substring(7).split("").join("."),_t={INIT:`@@redux/INIT${Dt()}`,REPLACE:`@@redux/REPLACE${Dt()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Dt()}`};function bt(t){if("object"!=typeof t||null===t)return!1;let e=t;for(;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e||null===Object.getPrototypeOf(t)}function vt(t,e,n){if("function"!=typeof t)throw new Error(yt(2));if("function"==typeof e&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw new Error(yt(0));if("function"==typeof e&&void 0===n&&(n=e,e=void 0),void 0!==n){if("function"!=typeof n)throw new Error(yt(1));return n(vt)(t,e)}let s=t,r=e,i=new Map,o=i,a=0,B=!1;function c(){o===i&&(o=new Map,i.forEach((t,e)=>{o.set(e,t)}))}function l(){if(B)throw new Error(yt(3));return r}function u(t){if("function"!=typeof t)throw new Error(yt(4));if(B)throw new Error(yt(5));let e=!0;c();const n=a++;return o.set(n,t),function(){if(e){if(B)throw new Error(yt(6));e=!1,c(),o.delete(n),i=null}}}function h(t){if(!bt(t))throw new Error(yt(7));if(void 0===t.type)throw new Error(yt(8));if("string"!=typeof t.type)throw new Error(yt(17));if(B)throw new Error(yt(9));try{B=!0,r=s(r,t)}finally{B=!1}return(i=o).forEach(t=>{t()}),t}h({type:_t.INIT});return{dispatch:h,subscribe:u,getState:l,replaceReducer:function(t){if("function"!=typeof t)throw new Error(yt(10));s=t,h({type:_t.REPLACE})},[Et]:function(){const t=u;return{subscribe(e){if("object"!=typeof e||null===e)throw new Error(yt(11));function n(){const t=e;t.next&&t.next(l())}n();return{unsubscribe:t(n)}},[Et](){return this}}}}}function It(t){const e=Object.keys(t),n={};for(let s=0;s<e.length;s++){const r=e[s];"function"==typeof t[r]&&(n[r]=t[r])}const s=Object.keys(n);let r;try{!function(t){Object.keys(t).forEach(e=>{const n=t[e];if(void 0===n(void 0,{type:_t.INIT}))throw new Error(yt(12));if(void 0===n(void 0,{type:_t.PROBE_UNKNOWN_ACTION()}))throw new Error(yt(13))})}(n)}catch(t){r=t}return function(t={},e){if(r)throw r;let i=!1;const o={};for(let r=0;r<s.length;r++){const a=s[r],B=n[a],c=t[a],l=B(c,e);if(void 0===l)throw e&&e.type,new Error(yt(14));o[a]=l,i=i||l!==c}return i=i||s.length!==Object.keys(t).length,i?o:t}}function Tt(...t){return 0===t.length?t=>t:1===t.length?t[0]:t.reduce((t,e)=>(...n)=>t(e(...n)))}var Ot=Symbol.for("immer-nothing"),At=Symbol.for("immer-draftable"),St=Symbol.for("immer-state");function Rt(t,...e){throw new Error(`[Immer] minified error nr: ${t}. Full error at: https://bit.ly/3cXEKWf`)}var Nt=Object,xt=Nt.getPrototypeOf,kt="constructor",Lt="prototype",Ft="configurable",Pt="enumerable",Mt="writable",Gt="value",Ht=t=>!!t&&!!t[St];function Ut(t){return!!t&&($t(t)||Wt(t)||!!t[At]||!!t[kt]?.[At]||Yt(t)||Xt(t))}var Vt=Nt[Lt][kt].toString(),jt=new WeakMap;function $t(t){if(!t||!Zt(t))return!1;const e=xt(t);if(null===e||e===Nt[Lt])return!0;const n=Nt.hasOwnProperty.call(e,kt)&&e[kt];if(n===Object)return!0;if(!te(n))return!1;let s=jt.get(n);return void 0===s&&(s=Function.toString.call(n),jt.set(n,s)),s===Vt}function Jt(t,e,n=!0){if(0===qt(t)){(n?Reflect.ownKeys(t):Nt.keys(t)).forEach(n=>{e(n,t[n],t)})}else t.forEach((n,s)=>e(s,n,t))}function qt(t){const e=t[St];return e?e.type_:Wt(t)?1:Yt(t)?2:Xt(t)?3:0}var zt=(t,e,n=qt(t))=>2===n?t.has(e):Nt[Lt].hasOwnProperty.call(t,e),Kt=(t,e,n=qt(t))=>2===n?t.get(e):t[e],Qt=(t,e,n,s=qt(t))=>{2===s?t.set(e,n):3===s?t.add(n):t[e]=n};var Wt=Array.isArray,Yt=t=>t instanceof Map,Xt=t=>t instanceof Set,Zt=t=>"object"==typeof t,te=t=>"function"==typeof t,ee=t=>"boolean"==typeof t;var ne=t=>t.copy_||t.base_,se=t=>t.modified_?t.copy_:t.base_;function re(t,e){if(Yt(t))return new Map(t);if(Xt(t))return new Set(t);if(Wt(t))return Array[Lt].slice.call(t);const n=$t(t);if(!0===e||"class_only"===e&&!n){const e=Nt.getOwnPropertyDescriptors(t);delete e[St];let n=Reflect.ownKeys(e);for(let s=0;s<n.length;s++){const r=n[s],i=e[r];!1===i[Mt]&&(i[Mt]=!0,i[Ft]=!0),(i.get||i.set)&&(e[r]={[Ft]:!0,[Mt]:!0,[Pt]:i[Pt],[Gt]:t[r]})}return Nt.create(xt(t),e)}{const e=xt(t);if(null!==e&&n)return{...t};const s=Nt.create(e);return Nt.assign(s,t)}}function ie(t,e=!1){return ae(t)||Ht(t)||!Ut(t)||(qt(t)>1&&Nt.defineProperties(t,{set:oe,add:oe,clear:oe,delete:oe}),Nt.freeze(t),e&&Jt(t,(t,e)=>{ie(e,!0)},!1)),t}var oe={[Gt]:function(){Rt(2)}};function ae(t){return null===t||!Zt(t)||Nt.isFrozen(t)}var Be="MapSet",ce="Patches",le="ArrayMethods",ue={};function he(t){const e=ue[t];return e||Rt(0),e}var de,pe=t=>!!ue[t],fe=()=>de;function Ce(t,e){e&&(t.patchPlugin_=he(ce),t.patches_=[],t.inversePatches_=[],t.patchListener_=e)}function ge(t){me(t),t.drafts_.forEach(ye),t.drafts_=null}function me(t){t===de&&(de=t.parent_)}var we=t=>de={drafts_:[],parent_:de,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:pe(Be)?he(Be):void 0,arrayMethodsPlugin_:pe(le)?he(le):void 0};function ye(t){const e=t[St];0===e.type_||1===e.type_?e.revoke_():e.revoked_=!0}function Ee(t,e){e.unfinalizedDrafts_=e.drafts_.length;const n=e.drafts_[0];if(void 0!==t&&t!==n){n[St].modified_&&(ge(e),Rt(4)),Ut(t)&&(t=De(e,t));const{patchPlugin_:s}=e;s&&s.generateReplacementPatches_(n[St].base_,t,e)}else t=De(e,n);return function(t,e,n=!1){!t.parent_&&t.immer_.autoFreeze_&&t.canAutoFreeze_&&ie(e,n)}(e,t,!0),ge(e),e.patches_&&e.patchListener_(e.patches_,e.inversePatches_),t!==Ot?t:void 0}function De(t,e){if(ae(e))return e;const n=e[St];if(!n){return Oe(e,t.handledSet_,t)}if(!be(n,t))return e;if(!n.modified_)return n.base_;if(!n.finalized_){const{callbacks_:e}=n;if(e)for(;e.length>0;){e.pop()(t)}Te(n,t)}return n.copy_}function _e(t){t.finalized_=!0,t.scope_.unfinalizedDrafts_--}var be=(t,e)=>t.scope_===e,ve=[];function Ie(t,e,n,s){const r=ne(t),i=t.type_;if(void 0!==s){if(Kt(r,s,i)===e)return void Qt(r,s,n,i)}if(!t.draftLocations_){const e=t.draftLocations_=new Map;Jt(r,(t,n)=>{if(Ht(n)){const s=e.get(n)||[];s.push(t),e.set(n,s)}})}const o=t.draftLocations_.get(e)??ve;for(const t of o)Qt(r,t,n,i)}function Te(t,e){if(t.modified_&&!t.finalized_&&(3===t.type_||1===t.type_&&t.allIndicesReassigned_||(t.assigned_?.size??0)>0)){const{patchPlugin_:n}=e;if(n){const s=n.getPath(t);s&&n.generatePatches_(t,s,e)}_e(t)}}function Oe(t,e,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||Ht(t)||e.has(t)||!Ut(t)||ae(t)||(e.add(t),Jt(t,(s,r)=>{if(Ht(r)){const e=r[St];if(be(e,n)){const n=se(e);Qt(t,s,n,t.type_),_e(e)}}else Ut(r)&&Oe(r,e,n)})),t}var Ae={get(t,e){if(e===St)return t;let n=t.scope_.arrayMethodsPlugin_;const s=1===t.type_&&"string"==typeof e;if(s&&n?.isArrayOperationMethod(e))return n.createMethodInterceptor(t,e);const r=ne(t);if(!zt(r,e,t.type_))return function(t,e,n){const s=Ne(e,n);return s?Gt in s?s[Gt]:s.get?.call(t.draft_):void 0}(t,r,e);const i=r[e];if(t.finalized_||!Ut(i))return i;if(s&&t.operationMethod&&n?.isMutatingArrayMethod(t.operationMethod)&&function(t){const e=+t;return Number.isInteger(e)&&String(e)===t}(e))return i;if(i===Re(t.base_,e)){ke(t);const n=1===t.type_?+e:e,s=Le(t.scope_,i,t,n);return t.copy_[n]=s}return i},has:(t,e)=>e in ne(t),ownKeys:t=>Reflect.ownKeys(ne(t)),set(t,e,n){const s=Ne(ne(t),e);if(s?.set)return s.set.call(t.draft_,n),!0;if(!t.modified_){const s=Re(ne(t),e),r=s?.[St];if(r&&r.base_===n)return t.copy_[e]=n,t.assigned_.set(e,!1),!0;if(function(t,e){return t===e?0!==t||1/t==1/e:t!=t&&e!=e}(n,s)&&(void 0!==n||zt(t.base_,e,t.type_)))return!0;ke(t),xe(t)}return t.copy_[e]===n&&(void 0!==n||e in t.copy_)||Number.isNaN(n)&&Number.isNaN(t.copy_[e])||(t.copy_[e]=n,t.assigned_.set(e,!0),function(t,e,n){const{scope_:s}=t;if(Ht(n)){const r=n[St];be(r,s)&&r.callbacks_.push(function(){ke(t);const s=se(r);Ie(t,n,s,e)})}else Ut(n)&&t.callbacks_.push(function(){const r=ne(t);3===t.type_?r.has(n)&&Oe(n,s.handledSet_,s):Kt(r,e,t.type_)===n&&s.drafts_.length>1&&!0===(t.assigned_.get(e)??!1)&&t.copy_&&Oe(Kt(t.copy_,e,t.type_),s.handledSet_,s)})}(t,e,n)),!0},deleteProperty:(t,e)=>(ke(t),void 0!==Re(t.base_,e)||e in t.base_?(t.assigned_.set(e,!1),xe(t)):t.assigned_.delete(e),t.copy_&&delete t.copy_[e],!0),getOwnPropertyDescriptor(t,e){const n=ne(t),s=Reflect.getOwnPropertyDescriptor(n,e);return s?{[Mt]:!0,[Ft]:1!==t.type_||"length"!==e,[Pt]:s[Pt],[Gt]:n[e]}:s},defineProperty(){Rt(11)},getPrototypeOf:t=>xt(t.base_),setPrototypeOf(){Rt(12)}},Se={};for(let t in Ae){let e=Ae[t];Se[t]=function(){const t=arguments;return t[0]=t[0][0],e.apply(this,t)}}function Re(t,e){const n=t[St];return(n?ne(n):t)[e]}function Ne(t,e){if(!(e in t))return;let n=xt(t);for(;n;){const t=Object.getOwnPropertyDescriptor(n,e);if(t)return t;n=xt(n)}}function xe(t){t.modified_||(t.modified_=!0,t.parent_&&xe(t.parent_))}function ke(t){t.copy_||(t.assigned_=new Map,t.copy_=re(t.base_,t.scope_.immer_.useStrictShallowCopy_))}Se.deleteProperty=function(t,e){return Se.set.call(this,t,e,void 0)},Se.set=function(t,e,n){return Ae.set.call(this,t[0],e,n,t[0])};function Le(t,e,n,s){const[r,i]=Yt(e)?he(Be).proxyMap_(e,n):Xt(e)?he(Be).proxySet_(e,n):function(t,e){const n=Wt(t),s={type_:n?1:0,scope_:e?e.scope_:fe(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:e,base_:t,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0};let r=s,i=Ae;n&&(r=[s],i=Se);const{revoke:o,proxy:a}=Proxy.revocable(r,i);return s.draft_=a,s.revoke_=o,[a,s]}(e,n);return(n?.scope_??fe()).drafts_.push(r),i.callbacks_=n?.callbacks_??[],i.key_=s,n&&void 0!==s?function(t,e,n){t.callbacks_.push(function(s){const r=e;if(!r||!be(r,s))return;s.mapSetPlugin_?.fixSetContents(r);const i=se(r);Ie(t,r.draft_??r,i,n),Te(r,s)})}(n,i,s):i.callbacks_.push(function(t){t.mapSetPlugin_?.fixSetContents(i);const{patchPlugin_:e}=t;i.modified_&&e&&e.generatePatches_(i,[],t)}),r}function Fe(t){if(!Ut(t)||ae(t))return t;const e=t[St];let n,s=!0;if(e){if(!e.modified_)return e.base_;e.finalized_=!0,n=re(t,e.scope_.immer_.useStrictShallowCopy_),s=e.scope_.immer_.shouldUseStrictIteration()}else n=re(t,!0);return Jt(n,(t,e)=>{Qt(n,t,Fe(e))},s),e&&(e.finalized_=!1),n}var Pe=new class{constructor(t){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(t,e,n)=>{if(te(t)&&!te(e)){const n=e;e=t;const s=this;return function(t=n,...r){return s.produce(t,t=>e.call(this,t,...r))}}let s;if(te(e)||Rt(6),void 0===n||te(n)||Rt(7),Ut(t)){const r=we(this),i=Le(r,t,void 0);let o=!0;try{s=e(i),o=!1}finally{o?ge(r):me(r)}return Ce(r,n),Ee(s,r)}if(!t||!Zt(t)){if(s=e(t),void 0===s&&(s=t),s===Ot&&(s=void 0),this.autoFreeze_&&ie(s,!0),n){const e=[],r=[];he(ce).generateReplacementPatches_(t,s,{patches_:e,inversePatches_:r}),n(e,r)}return s}Rt(1)},this.produceWithPatches=(t,e)=>{if(te(t))return(e,...n)=>this.produceWithPatches(e,e=>t(e,...n));let n,s;const r=this.produce(t,e,(t,e)=>{n=t,s=e});return[r,n,s]},ee(t?.autoFreeze)&&this.setAutoFreeze(t.autoFreeze),ee(t?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(t.useStrictShallowCopy),ee(t?.useStrictIteration)&&this.setUseStrictIteration(t.useStrictIteration)}createDraft(t){Ut(t)||Rt(8),Ht(t)&&(t=function(t){Ht(t)||Rt(10);return Fe(t)}(t));const e=we(this),n=Le(e,t,void 0);return n[St].isManual_=!0,me(e),n}finishDraft(t,e){const n=t&&t[St];n&&n.isManual_||Rt(9);const{scope_:s}=n;return Ce(s,e),Ee(void 0,s)}setAutoFreeze(t){this.autoFreeze_=t}setUseStrictShallowCopy(t){this.useStrictShallowCopy_=t}setUseStrictIteration(t){this.useStrictIteration_=t}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(t,e){let n;for(n=e.length-1;n>=0;n--){const s=e[n];if(0===s.path.length&&"replace"===s.op){t=s.value;break}}n>-1&&(e=e.slice(n+1));const s=he(ce).applyPatches_;return Ht(t)?s(t,e):this.produce(t,t=>s(t,e))}},Me=Pe.produce;function Ge(t){return({dispatch:e,getState:n})=>s=>r=>"function"==typeof r?r(e,n,t):s(r)}var He=Ge(),Ue=Ge;const Ve="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(0!==arguments.length)return"object"==typeof arguments[0]?Tt:Tt.apply(null,arguments)};function je(t,e){function n(...n){if(e){let s=e(...n);if(!s)throw new Error(nn(0));return{type:t,payload:s.payload,..."meta"in s&&{meta:s.meta},..."error"in s&&{error:s.error}}}return{type:t,payload:n[0]}}return n.toString=()=>`${t}`,n.type=t,n.match=e=>function(t){return bt(t)&&"type"in t&&"string"==typeof t.type}(e)&&e.type===t,n}var $e=class t extends Array{constructor(...e){super(...e),Object.setPrototypeOf(this,t.prototype)}static get[Symbol.species](){return t}concat(...t){return super.concat.apply(this,t)}prepend(...e){return 1===e.length&&Array.isArray(e[0])?new t(...e[0].concat(this)):new t(...e.concat(this))}};function Je(t){return Ut(t)?Me(t,()=>{}):t}function qe(t,e,n){return t.has(e)?t.get(e):t.set(e,n(e)).get(e)}const ze=t=>e=>{setTimeout(e,t)},Ke=(t={type:"raf"})=>e=>(...n)=>{const s=e(...n);let r=!0,i=!1,o=!1;const a=new Set,B="tick"===t.type?queueMicrotask:"raf"===t.type?"undefined"!=typeof window&&window.requestAnimationFrame?(c=window.requestAnimationFrame,l=100,t=>{let e,n,s=!1;const r=()=>{s||(s=!0,cancelAnimationFrame(e),clearTimeout(n),t())};e=c(r),n=setTimeout(r,l)}):ze(10):"callback"===t.type?t.queueNotification:ze(t.timeout);var c,l;const u=()=>{o=!1,i&&(i=!1,a.forEach(t=>t()))};return Object.assign({},s,{subscribe(t){const e=s.subscribe(()=>r&&t());return a.add(t),()=>{e(),a.delete(t)}},dispatch(t){try{return r=!t?.meta?.RTK_autoBatch,i=!r,i&&(o||(o=!0,B(u))),s.dispatch(t)}finally{r=!0}}})};function Qe(t){const e={},n=[];let s;const r={addCase(t,n){const s="string"==typeof t?t:t.type;if(!s)throw new Error(nn(28));if(s in e)throw new Error(nn(29));return e[s]=n,r},addAsyncThunk:(t,s)=>(s.pending&&(e[t.pending.type]=s.pending),s.rejected&&(e[t.rejected.type]=s.rejected),s.fulfilled&&(e[t.fulfilled.type]=s.fulfilled),s.settled&&n.push({matcher:t.settled,reducer:s.settled}),r),addMatcher:(t,e)=>(n.push({matcher:t,reducer:e}),r),addDefaultCase:t=>(s=t,r)};return t(r),[e,n,s]}const We=Symbol.for("rtk-slice-createasyncthunk");function Ye(t,e){return`${t}/${e}`}function Xe({creators:t}={}){const e=t?.asyncThunk?.[We];return function(t){const{name:n,reducerPath:s=n}=t;if(!n)throw new Error(nn(11));const r=("function"==typeof t.reducers?t.reducers(function(){function t(t,e){return{_reducerDefinitionType:"asyncThunk",payloadCreator:t,...e}}return t.withTypes=()=>t,{reducer:t=>Object.assign({[t.name]:(...e)=>t(...e)}[t.name],{_reducerDefinitionType:"reducer"}),preparedReducer:(t,e)=>({_reducerDefinitionType:"reducerWithPrepare",prepare:t,reducer:e}),asyncThunk:t}}()):t.reducers)||{},i=Object.keys(r),o={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},a={addCase(t,e){const n="string"==typeof t?t:t.type;if(!n)throw new Error(nn(12));if(n in o.sliceCaseReducersByType)throw new Error(nn(13));return o.sliceCaseReducersByType[n]=e,a},addMatcher:(t,e)=>(o.sliceMatchers.push({matcher:t,reducer:e}),a),exposeAction:(t,e)=>(o.actionCreators[t]=e,a),exposeCaseReducer:(t,e)=>(o.sliceCaseReducersByName[t]=e,a)};function B(){const[e={},n=[],s]="function"==typeof t.extraReducers?Qe(t.extraReducers):[t.extraReducers],r={...e,...o.sliceCaseReducersByType};return function(t,e){let n,[s,r,i]=Qe(e);if(function(t){return"function"==typeof t}(t))n=()=>Je(t());else{const e=Je(t);n=()=>e}function o(t=n(),e){let o=[s[e.type],...r.filter(({matcher:t})=>t(e)).map(({reducer:t})=>t)];return 0===o.filter(t=>!!t).length&&(o=[i]),o.reduce((t,n)=>{if(n){if(Ht(t)){const s=n(t,e);return void 0===s?t:s}if(Ut(t))return Me(t,t=>n(t,e));{const s=n(t,e);if(void 0===s){if(null===t)return t;throw new Error(nn(9))}return s}}return t},t)}return o.getInitialState=n,o}(t.initialState,t=>{for(let e in r)t.addCase(e,r[e]);for(let e of o.sliceMatchers)t.addMatcher(e.matcher,e.reducer);for(let e of n)t.addMatcher(e.matcher,e.reducer);s&&t.addDefaultCase(s)})}i.forEach(s=>{const i=r[s],o={reducerName:s,type:Ye(n,s),createNotation:"function"==typeof t.reducers};!function(t){return"asyncThunk"===t._reducerDefinitionType}(i)?function({type:t,reducerName:e,createNotation:n},s,r){let i,o;if("reducer"in s){if(n&&!function(t){return"reducerWithPrepare"===t._reducerDefinitionType}(s))throw new Error(nn(17));i=s.reducer,o=s.prepare}else i=s;r.addCase(t,i).exposeCaseReducer(e,i).exposeAction(e,o?je(t,o):je(t))}(o,i,a):function({type:t,reducerName:e},n,s,r){if(!r)throw new Error(nn(18));const{payloadCreator:i,fulfilled:o,pending:a,rejected:B,settled:c,options:l}=n,u=r(t,i,l);s.exposeAction(e,u),o&&s.addCase(u.fulfilled,o);a&&s.addCase(u.pending,a);B&&s.addCase(u.rejected,B);c&&s.addMatcher(u.settled,c);s.exposeCaseReducer(e,{fulfilled:o||en,pending:a||en,rejected:B||en,settled:c||en})}(o,i,a,e)});const c=t=>t,l=new Map,u=new WeakMap;let h;function d(t,e){return h||(h=B()),h(t,e)}function p(){return h||(h=B()),h.getInitialState()}function f(e,n=!1){function s(t){let r=t[e];return void 0===r&&n&&(r=qe(u,s,p)),r}function r(e=c){return qe(qe(l,n,()=>new WeakMap),e,()=>{const s={};for(const[r,i]of Object.entries(t.selectors??{}))s[r]=Ze(i,e,()=>qe(u,e,p),n);return s})}return{reducerPath:e,getSelectors:r,get selectors(){return r(s)},selectSlice:s}}const C={name:n,reducer:d,actions:o.actionCreators,caseReducers:o.sliceCaseReducersByName,getInitialState:p,...f(s),injectInto(t,{reducerPath:e,...n}={}){const r=e??s;return t.inject({reducerPath:r,reducer:d},n),{...C,...f(r,!0)}}};return C}}function Ze(t,e,n,s){function r(r,...i){let o=e(r);return void 0===o&&s&&(o=n()),t(o,...i)}return r.unwrapped=t,r}const tn=Xe();function en(){}function nn(t){return`Minified Redux Toolkit error #${t}; visit https://redux-toolkit.js.org/Errors?code=${t} for the full message or use the non-minified dev environment for full errors. `}const sn=new Set(["profile","verification","password","delete"]),rn=tn({name:"session",initialState:{login:!1,drawer:!1,registerOne:!1,registerTwo:!1,settings:"profile",verified:!1,name:"",email:"",photoURL:""},reducers:{navigateAuth(t,e){t.settings=sn.has(e.payload)?e.payload:"profile"},userAuth(t,e){t.login=e.payload},toggleSign(t){t.drawer=!t.drawer},openSign(t){t.drawer=!0},closeSign(t){t.drawer=!1},universalToggle(t,e){"drawer"===e.payload?t.registerOne=!t.registerOne:t.registerTwo=!t.registerTwo},accName(t,e){t.name=e.payload},accEmail(t,e){t.email=e.payload},accImage(t,e){t.photoURL=e.payload},accVerified(t,e){t.verified=e.payload}}}),{navigateAuth:on,userAuth:an,toggleSign:Bn,openSign:cn,closeSign:ln,universalToggle:un,accName:hn,accEmail:dn,accImage:pn,accVerified:fn}=rn.actions,Cn=function(t){const e=function(t){const{thunk:e=!0,immutableCheck:n=!0,serializableCheck:s=!0,actionCreatorCheck:r=!0}=t??{};let i=new $e;return e&&(function(t){return"boolean"==typeof t}(e)?i.push(He):i.push(Ue(e.extraArgument))),i},{reducer:n,middleware:s,devTools:r=!0,preloadedState:i,enhancers:o}=t||{};let a,B;if("function"==typeof n)a=n;else{if(!bt(n))throw new Error(nn(1));a=It(n)}B="function"==typeof s?s(e):e();let c=Tt;r&&(c=Ve({trace:!1,..."object"==typeof r&&r}));const l=function(...t){return e=>(n,s)=>{const r=e(n,s);let i=()=>{throw new Error(yt(15))};const o={getState:r.getState,dispatch:(t,...e)=>i(t,...e)},a=t.map(t=>t(o));return i=Tt(...a)(r.dispatch),{...r,dispatch:i}}}(...B),u=(t=>function(e){const{autoBatch:n=!0}=e??{};let s=new $e(t);return n&&s.push(Ke("object"==typeof n?n:void 0)),s})(l);return vt(a,i,c(..."function"==typeof o?o(u):u()))}({reducer:{session:rn.reducer},devTools:!0}),gn=i`
7
+ const t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,n=Symbol(),s=new WeakMap;let r=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==n)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const n=this.t;if(e&&void 0===t){const e=void 0!==n&&1===n.length;e&&(t=s.get(n)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),e&&s.set(n,t))}return t}toString(){return this.cssText}};const i=(t,...e)=>{const s=1===t.length?t[0]:e.reduce((e,n,s)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+t[s+1],t[0]);return new r(s,t,n)},o=e?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const n of t.cssRules)e+=n.cssText;return(t=>new r("string"==typeof t?t:t+"",void 0,n))(e)})(t):t,{is:a,defineProperty:B,getOwnPropertyDescriptor:c,getOwnPropertyNames:l,getOwnPropertySymbols:u,getPrototypeOf:h}=Object,d=globalThis,p=d.trustedTypes,f=p?p.emptyScript:"",C=d.reactiveElementPolyfillSupport,g=(t,e)=>t,m={toAttribute(t,e){switch(e){case Boolean:t=t?f:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let n=t;switch(e){case Boolean:n=null!==t;break;case Number:n=null===t?null:Number(t);break;case Object:case Array:try{n=JSON.parse(t)}catch(t){n=null}}return n}},w=(t,e)=>!a(t,e),y={attribute:!0,type:String,converter:m,reflect:!1,useDefault:!1,hasChanged:w};Symbol.metadata??=Symbol("metadata"),d.litPropertyMetadata??=new WeakMap;let E=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=y){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){const n=Symbol(),s=this.getPropertyDescriptor(t,n,e);void 0!==s&&B(this.prototype,t,s)}}static getPropertyDescriptor(t,e,n){const{get:s,set:r}=c(this.prototype,t)??{get(){return this[e]},set(t){this[e]=t}};return{get:s,set(e){const i=s?.call(this);r?.call(this,e),this.requestUpdate(t,i,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??y}static _$Ei(){if(this.hasOwnProperty(g("elementProperties")))return;const t=h(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(g("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(g("properties"))){const t=this.properties,e=[...l(t),...u(t)];for(const n of e)this.createProperty(n,t[n])}const t=this[Symbol.metadata];if(null!==t){const e=litPropertyMetadata.get(t);if(void 0!==e)for(const[t,n]of e)this.elementProperties.set(t,n)}this._$Eh=new Map;for(const[t,e]of this.elementProperties){const n=this._$Eu(t,e);void 0!==n&&this._$Eh.set(n,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const n=new Set(t.flat(1/0).reverse());for(const t of n)e.unshift(o(t))}else void 0!==t&&e.push(o(t));return e}static _$Eu(t,e){const n=e.attribute;return!1===n?void 0:"string"==typeof n?n:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const n of e.keys())this.hasOwnProperty(n)&&(t.set(n,this[n]),delete this[n]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const n=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((n,s)=>{if(e)n.adoptedStyleSheets=s.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const e of s){const s=document.createElement("style"),r=t.litNonce;void 0!==r&&s.setAttribute("nonce",r),s.textContent=e.cssText,n.appendChild(s)}})(n,this.constructor.elementStyles),n}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,n){this._$AK(t,n)}_$ET(t,e){const n=this.constructor.elementProperties.get(t),s=this.constructor._$Eu(t,n);if(void 0!==s&&!0===n.reflect){const r=(void 0!==n.converter?.toAttribute?n.converter:m).toAttribute(e,n.type);this._$Em=t,null==r?this.removeAttribute(s):this.setAttribute(s,r),this._$Em=null}}_$AK(t,e){const n=this.constructor,s=n._$Eh.get(t);if(void 0!==s&&this._$Em!==s){const t=n.getPropertyOptions(s),r="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:m;this._$Em=s;const i=r.fromAttribute(e,t.type);this[s]=i??this._$Ej?.get(s)??i,this._$Em=null}}requestUpdate(t,e,n){if(void 0!==t){const s=this.constructor,r=this[t];if(n??=s.getPropertyOptions(t),!((n.hasChanged??w)(r,e)||n.useDefault&&n.reflect&&r===this._$Ej?.get(t)&&!this.hasAttribute(s._$Eu(t,n))))return;this.C(t,e,n)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(t,e,{useDefault:n,reflect:s,wrapped:r},i){n&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,i??e??this[t]),!0!==r||void 0!==i)||(this._$AL.has(t)||(this.hasUpdated||n||(e=void 0),this._$AL.set(t,e)),!0===s&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,e]of this._$Ep)this[t]=e;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[e,n]of t){const{wrapped:t}=n,s=this[e];!0!==t||this._$AL.has(e)||void 0===s||this.C(e,void 0,n,s)}}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(t=>t.hostUpdate?.()),this.update(e)):this._$EM()}catch(e){throw t=!1,this._$EM(),e}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(t=>t.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&=this._$Eq.forEach(t=>this._$ET(t,this[t])),this._$EM()}updated(t){}firstUpdated(t){}};E.elementStyles=[],E.shadowRootOptions={mode:"open"},E[g("elementProperties")]=new Map,E[g("finalized")]=new Map,C?.({ReactiveElement:E}),(d.reactiveElementVersions??=[]).push("2.1.1");const _=globalThis,D=_.trustedTypes,b=D?D.createPolicy("lit-html",{createHTML:t=>t}):void 0,v="$lit$",I=`lit$${Math.random().toFixed(9).slice(2)}$`,T="?"+I,O=`<${T}>`,A=document,S=()=>A.createComment(""),R=t=>null===t||"object"!=typeof t&&"function"!=typeof t,N=Array.isArray,x="[ \t\n\f\r]",k=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,L=/-->/g,F=/>/g,P=RegExp(`>|${x}(?:([^\\s"'>=/]+)(${x}*=${x}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),M=/'/g,G=/"/g,H=/^(?:script|style|textarea|title)$/i,U=(t=>(e,...n)=>({_$litType$:t,strings:e,values:n}))(1),V=Symbol.for("lit-noChange"),j=Symbol.for("lit-nothing"),$=new WeakMap,J=A.createTreeWalker(A,129);function q(t,e){if(!N(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==b?b.createHTML(e):e}const z=(t,e)=>{const n=t.length-1,s=[];let r,i=2===e?"<svg>":3===e?"<math>":"",o=k;for(let e=0;e<n;e++){const n=t[e];let a,B,c=-1,l=0;for(;l<n.length&&(o.lastIndex=l,B=o.exec(n),null!==B);)l=o.lastIndex,o===k?"!--"===B[1]?o=L:void 0!==B[1]?o=F:void 0!==B[2]?(H.test(B[2])&&(r=RegExp("</"+B[2],"g")),o=P):void 0!==B[3]&&(o=P):o===P?">"===B[0]?(o=r??k,c=-1):void 0===B[1]?c=-2:(c=o.lastIndex-B[2].length,a=B[1],o=void 0===B[3]?P:'"'===B[3]?G:M):o===G||o===M?o=P:o===L||o===F?o=k:(o=P,r=void 0);const u=o===P&&t[e+1].startsWith("/>")?" ":"";i+=o===k?n+O:c>=0?(s.push(a),n.slice(0,c)+v+n.slice(c)+I+u):n+I+(-2===c?e:u)}return[q(t,i+(t[n]||"<?>")+(2===e?"</svg>":3===e?"</math>":"")),s]};class K{constructor({strings:t,_$litType$:e},n){let s;this.parts=[];let r=0,i=0;const o=t.length-1,a=this.parts,[B,c]=z(t,e);if(this.el=K.createElement(B,n),J.currentNode=this.el.content,2===e||3===e){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(s=J.nextNode())&&a.length<o;){if(1===s.nodeType){if(s.hasAttributes())for(const t of s.getAttributeNames())if(t.endsWith(v)){const e=c[i++],n=s.getAttribute(t).split(I),o=/([.?@])?(.*)/.exec(e);a.push({type:1,index:r,name:o[2],strings:n,ctor:"."===o[1]?Z:"?"===o[1]?tt:"@"===o[1]?et:X}),s.removeAttribute(t)}else t.startsWith(I)&&(a.push({type:6,index:r}),s.removeAttribute(t));if(H.test(s.tagName)){const t=s.textContent.split(I),e=t.length-1;if(e>0){s.textContent=D?D.emptyScript:"";for(let n=0;n<e;n++)s.append(t[n],S()),J.nextNode(),a.push({type:2,index:++r});s.append(t[e],S())}}}else if(8===s.nodeType)if(s.data===T)a.push({type:2,index:r});else{let t=-1;for(;-1!==(t=s.data.indexOf(I,t+1));)a.push({type:7,index:r}),t+=I.length-1}r++}}static createElement(t,e){const n=A.createElement("template");return n.innerHTML=t,n}}function Q(t,e,n=t,s){if(e===V)return e;let r=void 0!==s?n._$Co?.[s]:n._$Cl;const i=R(e)?void 0:e._$litDirective$;return r?.constructor!==i&&(r?._$AO?.(!1),void 0===i?r=void 0:(r=new i(t),r._$AT(t,n,s)),void 0!==s?(n._$Co??=[])[s]=r:n._$Cl=r),void 0!==r&&(e=Q(t,r._$AS(t,e.values),r,s)),e}let W=class{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:n}=this._$AD,s=(t?.creationScope??A).importNode(e,!0);J.currentNode=s;let r=J.nextNode(),i=0,o=0,a=n[0];for(;void 0!==a;){if(i===a.index){let e;2===a.type?e=new Y(r,r.nextSibling,this,t):1===a.type?e=new a.ctor(r,a.name,a.strings,this,t):6===a.type&&(e=new nt(r,this,t)),this._$AV.push(e),a=n[++o]}i!==a?.index&&(r=J.nextNode(),i++)}return J.currentNode=A,s}p(t){let e=0;for(const n of this._$AV)void 0!==n&&(void 0!==n.strings?(n._$AI(t,n,e),e+=n.strings.length-2):n._$AI(t[e])),e++}},Y=class t{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,n,s){this.type=2,this._$AH=j,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=n,this.options=s,this._$Cv=s?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===t?.nodeType&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=Q(this,t,e),R(t)?t===j||null==t||""===t?(this._$AH!==j&&this._$AR(),this._$AH=j):t!==this._$AH&&t!==V&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):(t=>N(t)||"function"==typeof t?.[Symbol.iterator])(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==j&&R(this._$AH)?this._$AA.nextSibling.data=t:this.T(A.createTextNode(t)),this._$AH=t}$(t){const{values:e,_$litType$:n}=t,s="number"==typeof n?this._$AC(t):(void 0===n.el&&(n.el=K.createElement(q(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===s)this._$AH.p(e);else{const t=new W(s,this),n=t.u(this.options);t.p(e),this.T(n),this._$AH=t}}_$AC(t){let e=$.get(t.strings);return void 0===e&&$.set(t.strings,e=new K(t)),e}k(e){N(this._$AH)||(this._$AH=[],this._$AR());const n=this._$AH;let s,r=0;for(const i of e)r===n.length?n.push(s=new t(this.O(S()),this.O(S()),this,this.options)):s=n[r],s._$AI(i),r++;r<n.length&&(this._$AR(s&&s._$AB.nextSibling,r),n.length=r)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t))}},X=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,n,s,r){this.type=1,this._$AH=j,this._$AN=void 0,this.element=t,this.name=e,this._$AM=s,this.options=r,n.length>2||""!==n[0]||""!==n[1]?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=j}_$AI(t,e=this,n,s){const r=this.strings;let i=!1;if(void 0===r)t=Q(this,t,e,0),i=!R(t)||t!==this._$AH&&t!==V,i&&(this._$AH=t);else{const s=t;let o,a;for(t=r[0],o=0;o<r.length-1;o++)a=Q(this,s[n+o],e,o),a===V&&(a=this._$AH[o]),i||=!R(a)||a!==this._$AH[o],a===j?t=j:t!==j&&(t+=(a??"")+r[o+1]),this._$AH[o]=a}i&&!s&&this.j(t)}j(t){t===j?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}};class Z extends X{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===j?void 0:t}}let tt=class extends X{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==j)}},et=class extends X{constructor(t,e,n,s,r){super(t,e,n,s,r),this.type=5}_$AI(t,e=this){if((t=Q(this,t,e,0)??j)===V)return;const n=this._$AH,s=t===j&&n!==j||t.capture!==n.capture||t.once!==n.once||t.passive!==n.passive,r=t!==j&&(n===j||s);s&&this.element.removeEventListener(this.name,this,n),r&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}};class nt{constructor(t,e,n){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(t){Q(this,t)}}const st=_.litHtmlPolyfillSupport;st?.(K,Y),(_.litHtmlVersions??=[]).push("3.3.1");const rt=globalThis;let it=class extends E{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=((t,e,n)=>{const s=n?.renderBefore??e;let r=s._$litPart$;if(void 0===r){const t=n?.renderBefore??null;s._$litPart$=r=new Y(e.insertBefore(S(),t),t,void 0,n??{})}return r._$AI(t),r})(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return V}};it._$litElement$=!0,it.finalized=!0,rt.litElementHydrateSupport?.({LitElement:it});const ot=rt.litElementPolyfillSupport;ot?.({LitElement:it}),(rt.litElementVersions??=[]).push("4.2.1");const at=t=>(e,n)=>{void 0!==n?n.addInitializer(()=>{customElements.define(t,e)}):customElements.define(t,e)},Bt={attribute:!0,type:String,converter:m,reflect:!1,hasChanged:w},ct=(t=Bt,e,n)=>{const{kind:s,metadata:r}=n;let i=globalThis.litPropertyMetadata.get(r);if(void 0===i&&globalThis.litPropertyMetadata.set(r,i=new Map),"setter"===s&&((t=Object.create(t)).wrapped=!0),i.set(n.name,t),"accessor"===s){const{name:s}=n;return{set(n){const r=e.get.call(this);e.set.call(this,n),this.requestUpdate(s,r,t)},init(e){return void 0!==e&&this.C(s,void 0,t,e),e}}}if("setter"===s){const{name:s}=n;return function(n){const r=this[s];e.call(this,n),this.requestUpdate(s,r,t)}}throw Error("Unsupported decorator location: "+s)};function lt(t){return(e,n)=>"object"==typeof n?ct(t,e,n):((t,e,n)=>{const s=e.hasOwnProperty(n);return e.constructor.createProperty(n,t),s?Object.getOwnPropertyDescriptor(e,n):void 0})(t,e,n)}function ut(t){return lt({...t,state:!0,attribute:!1})}const ht=1,dt=t=>(...e)=>({_$litDirective$:t,values:e});let pt=class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,n){this._$Ct=t,this._$AM=e,this._$Ci=n}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}};const ft=dt(class extends pt{constructor(t){if(super(t),t.type!==ht||"class"!==t.name||t.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return" "+Object.keys(t).filter(e=>t[e]).join(" ")+" "}update(t,[e]){if(void 0===this.st){this.st=new Set,void 0!==t.strings&&(this.nt=new Set(t.strings.join(" ").split(/\s/).filter(t=>""!==t)));for(const t in e)e[t]&&!this.nt?.has(t)&&this.st.add(t);return this.render(e)}const n=t.element.classList;for(const t of this.st)t in e||(n.remove(t),this.st.delete(t));for(const t in e){const s=!!e[t];s===this.st.has(t)||this.nt?.has(t)||(s?(n.add(t),this.st.add(t)):(n.remove(t),this.st.delete(t)))}return V}}),Ct="important",gt=" !"+Ct,mt=dt(class extends pt{constructor(t){if(super(t),t.type!==ht||"style"!==t.name||t.strings?.length>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(t){return Object.keys(t).reduce((e,n)=>{const s=t[n];return null==s?e:e+`${n=n.includes("-")?n:n.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${s};`},"")}update(t,[e]){const{style:n}=t.element;if(void 0===this.ft)return this.ft=new Set(Object.keys(e)),this.render(e);for(const t of this.ft)null==e[t]&&(this.ft.delete(t),t.includes("-")?n.removeProperty(t):n[t]=null);for(const t in e){const s=e[t];if(null!=s){this.ft.add(t);const e="string"==typeof s&&s.endsWith(gt);t.includes("-")||e?n.setProperty(t,e?s.slice(0,-11):s,e?Ct:""):n[t]=s}}return V}}),wt=t=>e=>class extends e{connectedCallback(){super.connectedCallback&&super.connectedCallback(),this._storeUnsubscribe=t.subscribe(()=>this.stateChanged(t.getState())),this.stateChanged(t.getState())}disconnectedCallback(){this._storeUnsubscribe(),super.disconnectedCallback&&super.disconnectedCallback()}stateChanged(t){}};function yt(t){return`Minified Redux error #${t}; visit https://redux.js.org/Errors?code=${t} for the full message or use the non-minified dev environment for full errors. `}var Et=(()=>"function"==typeof Symbol&&Symbol.observable||"@@observable")(),_t=()=>Math.random().toString(36).substring(7).split("").join("."),Dt={INIT:`@@redux/INIT${_t()}`,REPLACE:`@@redux/REPLACE${_t()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${_t()}`};function bt(t){if("object"!=typeof t||null===t)return!1;let e=t;for(;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e||null===Object.getPrototypeOf(t)}function vt(t,e,n){if("function"!=typeof t)throw new Error(yt(2));if("function"==typeof e&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw new Error(yt(0));if("function"==typeof e&&void 0===n&&(n=e,e=void 0),void 0!==n){if("function"!=typeof n)throw new Error(yt(1));return n(vt)(t,e)}let s=t,r=e,i=new Map,o=i,a=0,B=!1;function c(){o===i&&(o=new Map,i.forEach((t,e)=>{o.set(e,t)}))}function l(){if(B)throw new Error(yt(3));return r}function u(t){if("function"!=typeof t)throw new Error(yt(4));if(B)throw new Error(yt(5));let e=!0;c();const n=a++;return o.set(n,t),function(){if(e){if(B)throw new Error(yt(6));e=!1,c(),o.delete(n),i=null}}}function h(t){if(!bt(t))throw new Error(yt(7));if(void 0===t.type)throw new Error(yt(8));if("string"!=typeof t.type)throw new Error(yt(17));if(B)throw new Error(yt(9));try{B=!0,r=s(r,t)}finally{B=!1}return(i=o).forEach(t=>{t()}),t}h({type:Dt.INIT});return{dispatch:h,subscribe:u,getState:l,replaceReducer:function(t){if("function"!=typeof t)throw new Error(yt(10));s=t,h({type:Dt.REPLACE})},[Et]:function(){const t=u;return{subscribe(e){if("object"!=typeof e||null===e)throw new Error(yt(11));function n(){const t=e;t.next&&t.next(l())}n();return{unsubscribe:t(n)}},[Et](){return this}}}}}function It(t){const e=Object.keys(t),n={};for(let s=0;s<e.length;s++){const r=e[s];"function"==typeof t[r]&&(n[r]=t[r])}const s=Object.keys(n);let r;try{!function(t){Object.keys(t).forEach(e=>{const n=t[e];if(void 0===n(void 0,{type:Dt.INIT}))throw new Error(yt(12));if(void 0===n(void 0,{type:Dt.PROBE_UNKNOWN_ACTION()}))throw new Error(yt(13))})}(n)}catch(t){r=t}return function(t={},e){if(r)throw r;let i=!1;const o={};for(let r=0;r<s.length;r++){const a=s[r],B=n[a],c=t[a],l=B(c,e);if(void 0===l)throw e&&e.type,new Error(yt(14));o[a]=l,i=i||l!==c}return i=i||s.length!==Object.keys(t).length,i?o:t}}function Tt(...t){return 0===t.length?t=>t:1===t.length?t[0]:t.reduce((t,e)=>(...n)=>t(e(...n)))}var Ot=Symbol.for("immer-nothing"),At=Symbol.for("immer-draftable"),St=Symbol.for("immer-state");function Rt(t,...e){throw new Error(`[Immer] minified error nr: ${t}. Full error at: https://bit.ly/3cXEKWf`)}var Nt=Object,xt=Nt.getPrototypeOf,kt="constructor",Lt="prototype",Ft="configurable",Pt="enumerable",Mt="writable",Gt="value",Ht=t=>!!t&&!!t[St];function Ut(t){return!!t&&($t(t)||Wt(t)||!!t[At]||!!t[kt]?.[At]||Yt(t)||Xt(t))}var Vt=Nt[Lt][kt].toString(),jt=new WeakMap;function $t(t){if(!t||!Zt(t))return!1;const e=xt(t);if(null===e||e===Nt[Lt])return!0;const n=Nt.hasOwnProperty.call(e,kt)&&e[kt];if(n===Object)return!0;if(!te(n))return!1;let s=jt.get(n);return void 0===s&&(s=Function.toString.call(n),jt.set(n,s)),s===Vt}function Jt(t,e,n=!0){if(0===qt(t)){(n?Reflect.ownKeys(t):Nt.keys(t)).forEach(n=>{e(n,t[n],t)})}else t.forEach((n,s)=>e(s,n,t))}function qt(t){const e=t[St];return e?e.type_:Wt(t)?1:Yt(t)?2:Xt(t)?3:0}var zt=(t,e,n=qt(t))=>2===n?t.has(e):Nt[Lt].hasOwnProperty.call(t,e),Kt=(t,e,n=qt(t))=>2===n?t.get(e):t[e],Qt=(t,e,n,s=qt(t))=>{2===s?t.set(e,n):3===s?t.add(n):t[e]=n};var Wt=Array.isArray,Yt=t=>t instanceof Map,Xt=t=>t instanceof Set,Zt=t=>"object"==typeof t,te=t=>"function"==typeof t,ee=t=>"boolean"==typeof t;var ne=t=>t.copy_||t.base_,se=t=>t.modified_?t.copy_:t.base_;function re(t,e){if(Yt(t))return new Map(t);if(Xt(t))return new Set(t);if(Wt(t))return Array[Lt].slice.call(t);const n=$t(t);if(!0===e||"class_only"===e&&!n){const e=Nt.getOwnPropertyDescriptors(t);delete e[St];let n=Reflect.ownKeys(e);for(let s=0;s<n.length;s++){const r=n[s],i=e[r];!1===i[Mt]&&(i[Mt]=!0,i[Ft]=!0),(i.get||i.set)&&(e[r]={[Ft]:!0,[Mt]:!0,[Pt]:i[Pt],[Gt]:t[r]})}return Nt.create(xt(t),e)}{const e=xt(t);if(null!==e&&n)return{...t};const s=Nt.create(e);return Nt.assign(s,t)}}function ie(t,e=!1){return ae(t)||Ht(t)||!Ut(t)||(qt(t)>1&&Nt.defineProperties(t,{set:oe,add:oe,clear:oe,delete:oe}),Nt.freeze(t),e&&Jt(t,(t,e)=>{ie(e,!0)},!1)),t}var oe={[Gt]:function(){Rt(2)}};function ae(t){return null===t||!Zt(t)||Nt.isFrozen(t)}var Be="MapSet",ce="Patches",le="ArrayMethods",ue={};function he(t){const e=ue[t];return e||Rt(0),e}var de,pe=t=>!!ue[t],fe=()=>de;function Ce(t,e){e&&(t.patchPlugin_=he(ce),t.patches_=[],t.inversePatches_=[],t.patchListener_=e)}function ge(t){me(t),t.drafts_.forEach(ye),t.drafts_=null}function me(t){t===de&&(de=t.parent_)}var we=t=>de={drafts_:[],parent_:de,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:pe(Be)?he(Be):void 0,arrayMethodsPlugin_:pe(le)?he(le):void 0};function ye(t){const e=t[St];0===e.type_||1===e.type_?e.revoke_():e.revoked_=!0}function Ee(t,e){e.unfinalizedDrafts_=e.drafts_.length;const n=e.drafts_[0];if(void 0!==t&&t!==n){n[St].modified_&&(ge(e),Rt(4)),Ut(t)&&(t=_e(e,t));const{patchPlugin_:s}=e;s&&s.generateReplacementPatches_(n[St].base_,t,e)}else t=_e(e,n);return function(t,e,n=!1){!t.parent_&&t.immer_.autoFreeze_&&t.canAutoFreeze_&&ie(e,n)}(e,t,!0),ge(e),e.patches_&&e.patchListener_(e.patches_,e.inversePatches_),t!==Ot?t:void 0}function _e(t,e){if(ae(e))return e;const n=e[St];if(!n){return Oe(e,t.handledSet_,t)}if(!be(n,t))return e;if(!n.modified_)return n.base_;if(!n.finalized_){const{callbacks_:e}=n;if(e)for(;e.length>0;){e.pop()(t)}Te(n,t)}return n.copy_}function De(t){t.finalized_=!0,t.scope_.unfinalizedDrafts_--}var be=(t,e)=>t.scope_===e,ve=[];function Ie(t,e,n,s){const r=ne(t),i=t.type_;if(void 0!==s){if(Kt(r,s,i)===e)return void Qt(r,s,n,i)}if(!t.draftLocations_){const e=t.draftLocations_=new Map;Jt(r,(t,n)=>{if(Ht(n)){const s=e.get(n)||[];s.push(t),e.set(n,s)}})}const o=t.draftLocations_.get(e)??ve;for(const t of o)Qt(r,t,n,i)}function Te(t,e){if(t.modified_&&!t.finalized_&&(3===t.type_||1===t.type_&&t.allIndicesReassigned_||(t.assigned_?.size??0)>0)){const{patchPlugin_:n}=e;if(n){const s=n.getPath(t);s&&n.generatePatches_(t,s,e)}De(t)}}function Oe(t,e,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||Ht(t)||e.has(t)||!Ut(t)||ae(t)||(e.add(t),Jt(t,(s,r)=>{if(Ht(r)){const e=r[St];if(be(e,n)){const n=se(e);Qt(t,s,n,t.type_),De(e)}}else Ut(r)&&Oe(r,e,n)})),t}var Ae={get(t,e){if(e===St)return t;let n=t.scope_.arrayMethodsPlugin_;const s=1===t.type_&&"string"==typeof e;if(s&&n?.isArrayOperationMethod(e))return n.createMethodInterceptor(t,e);const r=ne(t);if(!zt(r,e,t.type_))return function(t,e,n){const s=Ne(e,n);return s?Gt in s?s[Gt]:s.get?.call(t.draft_):void 0}(t,r,e);const i=r[e];if(t.finalized_||!Ut(i))return i;if(s&&t.operationMethod&&n?.isMutatingArrayMethod(t.operationMethod)&&function(t){const e=+t;return Number.isInteger(e)&&String(e)===t}(e))return i;if(i===Re(t.base_,e)){ke(t);const n=1===t.type_?+e:e,s=Le(t.scope_,i,t,n);return t.copy_[n]=s}return i},has:(t,e)=>e in ne(t),ownKeys:t=>Reflect.ownKeys(ne(t)),set(t,e,n){const s=Ne(ne(t),e);if(s?.set)return s.set.call(t.draft_,n),!0;if(!t.modified_){const s=Re(ne(t),e),r=s?.[St];if(r&&r.base_===n)return t.copy_[e]=n,t.assigned_.set(e,!1),!0;if(function(t,e){return t===e?0!==t||1/t==1/e:t!=t&&e!=e}(n,s)&&(void 0!==n||zt(t.base_,e,t.type_)))return!0;ke(t),xe(t)}return t.copy_[e]===n&&(void 0!==n||e in t.copy_)||Number.isNaN(n)&&Number.isNaN(t.copy_[e])||(t.copy_[e]=n,t.assigned_.set(e,!0),function(t,e,n){const{scope_:s}=t;if(Ht(n)){const r=n[St];be(r,s)&&r.callbacks_.push(function(){ke(t);const s=se(r);Ie(t,n,s,e)})}else Ut(n)&&t.callbacks_.push(function(){const r=ne(t);3===t.type_?r.has(n)&&Oe(n,s.handledSet_,s):Kt(r,e,t.type_)===n&&s.drafts_.length>1&&!0===(t.assigned_.get(e)??!1)&&t.copy_&&Oe(Kt(t.copy_,e,t.type_),s.handledSet_,s)})}(t,e,n)),!0},deleteProperty:(t,e)=>(ke(t),void 0!==Re(t.base_,e)||e in t.base_?(t.assigned_.set(e,!1),xe(t)):t.assigned_.delete(e),t.copy_&&delete t.copy_[e],!0),getOwnPropertyDescriptor(t,e){const n=ne(t),s=Reflect.getOwnPropertyDescriptor(n,e);return s?{[Mt]:!0,[Ft]:1!==t.type_||"length"!==e,[Pt]:s[Pt],[Gt]:n[e]}:s},defineProperty(){Rt(11)},getPrototypeOf:t=>xt(t.base_),setPrototypeOf(){Rt(12)}},Se={};for(let t in Ae){let e=Ae[t];Se[t]=function(){const t=arguments;return t[0]=t[0][0],e.apply(this,t)}}function Re(t,e){const n=t[St];return(n?ne(n):t)[e]}function Ne(t,e){if(!(e in t))return;let n=xt(t);for(;n;){const t=Object.getOwnPropertyDescriptor(n,e);if(t)return t;n=xt(n)}}function xe(t){t.modified_||(t.modified_=!0,t.parent_&&xe(t.parent_))}function ke(t){t.copy_||(t.assigned_=new Map,t.copy_=re(t.base_,t.scope_.immer_.useStrictShallowCopy_))}Se.deleteProperty=function(t,e){return Se.set.call(this,t,e,void 0)},Se.set=function(t,e,n){return Ae.set.call(this,t[0],e,n,t[0])};function Le(t,e,n,s){const[r,i]=Yt(e)?he(Be).proxyMap_(e,n):Xt(e)?he(Be).proxySet_(e,n):function(t,e){const n=Wt(t),s={type_:n?1:0,scope_:e?e.scope_:fe(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:e,base_:t,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0};let r=s,i=Ae;n&&(r=[s],i=Se);const{revoke:o,proxy:a}=Proxy.revocable(r,i);return s.draft_=a,s.revoke_=o,[a,s]}(e,n);return(n?.scope_??fe()).drafts_.push(r),i.callbacks_=n?.callbacks_??[],i.key_=s,n&&void 0!==s?function(t,e,n){t.callbacks_.push(function(s){const r=e;if(!r||!be(r,s))return;s.mapSetPlugin_?.fixSetContents(r);const i=se(r);Ie(t,r.draft_??r,i,n),Te(r,s)})}(n,i,s):i.callbacks_.push(function(t){t.mapSetPlugin_?.fixSetContents(i);const{patchPlugin_:e}=t;i.modified_&&e&&e.generatePatches_(i,[],t)}),r}function Fe(t){if(!Ut(t)||ae(t))return t;const e=t[St];let n,s=!0;if(e){if(!e.modified_)return e.base_;e.finalized_=!0,n=re(t,e.scope_.immer_.useStrictShallowCopy_),s=e.scope_.immer_.shouldUseStrictIteration()}else n=re(t,!0);return Jt(n,(t,e)=>{Qt(n,t,Fe(e))},s),e&&(e.finalized_=!1),n}var Pe=new class{constructor(t){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(t,e,n)=>{if(te(t)&&!te(e)){const n=e;e=t;const s=this;return function(t=n,...r){return s.produce(t,t=>e.call(this,t,...r))}}let s;if(te(e)||Rt(6),void 0===n||te(n)||Rt(7),Ut(t)){const r=we(this),i=Le(r,t,void 0);let o=!0;try{s=e(i),o=!1}finally{o?ge(r):me(r)}return Ce(r,n),Ee(s,r)}if(!t||!Zt(t)){if(s=e(t),void 0===s&&(s=t),s===Ot&&(s=void 0),this.autoFreeze_&&ie(s,!0),n){const e=[],r=[];he(ce).generateReplacementPatches_(t,s,{patches_:e,inversePatches_:r}),n(e,r)}return s}Rt(1)},this.produceWithPatches=(t,e)=>{if(te(t))return(e,...n)=>this.produceWithPatches(e,e=>t(e,...n));let n,s;const r=this.produce(t,e,(t,e)=>{n=t,s=e});return[r,n,s]},ee(t?.autoFreeze)&&this.setAutoFreeze(t.autoFreeze),ee(t?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(t.useStrictShallowCopy),ee(t?.useStrictIteration)&&this.setUseStrictIteration(t.useStrictIteration)}createDraft(t){Ut(t)||Rt(8),Ht(t)&&(t=function(t){Ht(t)||Rt(10);return Fe(t)}(t));const e=we(this),n=Le(e,t,void 0);return n[St].isManual_=!0,me(e),n}finishDraft(t,e){const n=t&&t[St];n&&n.isManual_||Rt(9);const{scope_:s}=n;return Ce(s,e),Ee(void 0,s)}setAutoFreeze(t){this.autoFreeze_=t}setUseStrictShallowCopy(t){this.useStrictShallowCopy_=t}setUseStrictIteration(t){this.useStrictIteration_=t}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(t,e){let n;for(n=e.length-1;n>=0;n--){const s=e[n];if(0===s.path.length&&"replace"===s.op){t=s.value;break}}n>-1&&(e=e.slice(n+1));const s=he(ce).applyPatches_;return Ht(t)?s(t,e):this.produce(t,t=>s(t,e))}},Me=Pe.produce;function Ge(t){return({dispatch:e,getState:n})=>s=>r=>"function"==typeof r?r(e,n,t):s(r)}var He=Ge(),Ue=Ge;const Ve="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(0!==arguments.length)return"object"==typeof arguments[0]?Tt:Tt.apply(null,arguments)};function je(t,e){function n(...n){if(e){let s=e(...n);if(!s)throw new Error(nn(0));return{type:t,payload:s.payload,..."meta"in s&&{meta:s.meta},..."error"in s&&{error:s.error}}}return{type:t,payload:n[0]}}return n.toString=()=>`${t}`,n.type=t,n.match=e=>function(t){return bt(t)&&"type"in t&&"string"==typeof t.type}(e)&&e.type===t,n}var $e=class t extends Array{constructor(...e){super(...e),Object.setPrototypeOf(this,t.prototype)}static get[Symbol.species](){return t}concat(...t){return super.concat.apply(this,t)}prepend(...e){return 1===e.length&&Array.isArray(e[0])?new t(...e[0].concat(this)):new t(...e.concat(this))}};function Je(t){return Ut(t)?Me(t,()=>{}):t}function qe(t,e,n){return t.has(e)?t.get(e):t.set(e,n(e)).get(e)}const ze=t=>e=>{setTimeout(e,t)},Ke=(t={type:"raf"})=>e=>(...n)=>{const s=e(...n);let r=!0,i=!1,o=!1;const a=new Set,B="tick"===t.type?queueMicrotask:"raf"===t.type?"undefined"!=typeof window&&window.requestAnimationFrame?(c=window.requestAnimationFrame,l=100,t=>{let e,n,s=!1;const r=()=>{s||(s=!0,cancelAnimationFrame(e),clearTimeout(n),t())};e=c(r),n=setTimeout(r,l)}):ze(10):"callback"===t.type?t.queueNotification:ze(t.timeout);var c,l;const u=()=>{o=!1,i&&(i=!1,a.forEach(t=>t()))};return Object.assign({},s,{subscribe(t){const e=s.subscribe(()=>r&&t());return a.add(t),()=>{e(),a.delete(t)}},dispatch(t){try{return r=!t?.meta?.RTK_autoBatch,i=!r,i&&(o||(o=!0,B(u))),s.dispatch(t)}finally{r=!0}}})};function Qe(t){const e={},n=[];let s;const r={addCase(t,n){const s="string"==typeof t?t:t.type;if(!s)throw new Error(nn(28));if(s in e)throw new Error(nn(29));return e[s]=n,r},addAsyncThunk:(t,s)=>(s.pending&&(e[t.pending.type]=s.pending),s.rejected&&(e[t.rejected.type]=s.rejected),s.fulfilled&&(e[t.fulfilled.type]=s.fulfilled),s.settled&&n.push({matcher:t.settled,reducer:s.settled}),r),addMatcher:(t,e)=>(n.push({matcher:t,reducer:e}),r),addDefaultCase:t=>(s=t,r)};return t(r),[e,n,s]}const We=Symbol.for("rtk-slice-createasyncthunk");function Ye(t,e){return`${t}/${e}`}function Xe({creators:t}={}){const e=t?.asyncThunk?.[We];return function(t){const{name:n,reducerPath:s=n}=t;if(!n)throw new Error(nn(11));const r=("function"==typeof t.reducers?t.reducers(function(){function t(t,e){return{_reducerDefinitionType:"asyncThunk",payloadCreator:t,...e}}return t.withTypes=()=>t,{reducer:t=>Object.assign({[t.name]:(...e)=>t(...e)}[t.name],{_reducerDefinitionType:"reducer"}),preparedReducer:(t,e)=>({_reducerDefinitionType:"reducerWithPrepare",prepare:t,reducer:e}),asyncThunk:t}}()):t.reducers)||{},i=Object.keys(r),o={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},a={addCase(t,e){const n="string"==typeof t?t:t.type;if(!n)throw new Error(nn(12));if(n in o.sliceCaseReducersByType)throw new Error(nn(13));return o.sliceCaseReducersByType[n]=e,a},addMatcher:(t,e)=>(o.sliceMatchers.push({matcher:t,reducer:e}),a),exposeAction:(t,e)=>(o.actionCreators[t]=e,a),exposeCaseReducer:(t,e)=>(o.sliceCaseReducersByName[t]=e,a)};function B(){const[e={},n=[],s]="function"==typeof t.extraReducers?Qe(t.extraReducers):[t.extraReducers],r={...e,...o.sliceCaseReducersByType};return function(t,e){let n,[s,r,i]=Qe(e);if(function(t){return"function"==typeof t}(t))n=()=>Je(t());else{const e=Je(t);n=()=>e}function o(t=n(),e){let o=[s[e.type],...r.filter(({matcher:t})=>t(e)).map(({reducer:t})=>t)];return 0===o.filter(t=>!!t).length&&(o=[i]),o.reduce((t,n)=>{if(n){if(Ht(t)){const s=n(t,e);return void 0===s?t:s}if(Ut(t))return Me(t,t=>n(t,e));{const s=n(t,e);if(void 0===s){if(null===t)return t;throw new Error(nn(9))}return s}}return t},t)}return o.getInitialState=n,o}(t.initialState,t=>{for(let e in r)t.addCase(e,r[e]);for(let e of o.sliceMatchers)t.addMatcher(e.matcher,e.reducer);for(let e of n)t.addMatcher(e.matcher,e.reducer);s&&t.addDefaultCase(s)})}i.forEach(s=>{const i=r[s],o={reducerName:s,type:Ye(n,s),createNotation:"function"==typeof t.reducers};!function(t){return"asyncThunk"===t._reducerDefinitionType}(i)?function({type:t,reducerName:e,createNotation:n},s,r){let i,o;if("reducer"in s){if(n&&!function(t){return"reducerWithPrepare"===t._reducerDefinitionType}(s))throw new Error(nn(17));i=s.reducer,o=s.prepare}else i=s;r.addCase(t,i).exposeCaseReducer(e,i).exposeAction(e,o?je(t,o):je(t))}(o,i,a):function({type:t,reducerName:e},n,s,r){if(!r)throw new Error(nn(18));const{payloadCreator:i,fulfilled:o,pending:a,rejected:B,settled:c,options:l}=n,u=r(t,i,l);s.exposeAction(e,u),o&&s.addCase(u.fulfilled,o);a&&s.addCase(u.pending,a);B&&s.addCase(u.rejected,B);c&&s.addMatcher(u.settled,c);s.exposeCaseReducer(e,{fulfilled:o||en,pending:a||en,rejected:B||en,settled:c||en})}(o,i,a,e)});const c=t=>t,l=new Map,u=new WeakMap;let h;function d(t,e){return h||(h=B()),h(t,e)}function p(){return h||(h=B()),h.getInitialState()}function f(e,n=!1){function s(t){let r=t[e];return void 0===r&&n&&(r=qe(u,s,p)),r}function r(e=c){return qe(qe(l,n,()=>new WeakMap),e,()=>{const s={};for(const[r,i]of Object.entries(t.selectors??{}))s[r]=Ze(i,e,()=>qe(u,e,p),n);return s})}return{reducerPath:e,getSelectors:r,get selectors(){return r(s)},selectSlice:s}}const C={name:n,reducer:d,actions:o.actionCreators,caseReducers:o.sliceCaseReducersByName,getInitialState:p,...f(s),injectInto(t,{reducerPath:e,...n}={}){const r=e??s;return t.inject({reducerPath:r,reducer:d},n),{...C,...f(r,!0)}}};return C}}function Ze(t,e,n,s){function r(r,...i){let o=e(r);return void 0===o&&s&&(o=n()),t(o,...i)}return r.unwrapped=t,r}const tn=Xe();function en(){}function nn(t){return`Minified Redux Toolkit error #${t}; visit https://redux-toolkit.js.org/Errors?code=${t} for the full message or use the non-minified dev environment for full errors. `}const sn=new Set(["profile","verification","password","delete"]),rn=tn({name:"session",initialState:{login:!1,drawer:!1,registerOne:!1,registerTwo:!1,settings:"profile",verified:!1,name:"",email:"",photoURL:""},reducers:{navigateAuth(t,e){t.settings=sn.has(e.payload)?e.payload:"profile"},userAuth(t,e){t.login=e.payload},toggleSign(t){t.drawer=!t.drawer},openSign(t){t.drawer=!0},closeSign(t){t.drawer=!1},universalToggle(t,e){"drawer"===e.payload?t.registerOne=!t.registerOne:t.registerTwo=!t.registerTwo},accName(t,e){t.name=e.payload},accEmail(t,e){t.email=e.payload},accImage(t,e){t.photoURL=e.payload},accVerified(t,e){t.verified=e.payload}}}),{navigateAuth:on,userAuth:an,toggleSign:Bn,openSign:cn,closeSign:ln,universalToggle:un,accName:hn,accEmail:dn,accImage:pn,accVerified:fn}=rn.actions,Cn=function(t){const e=function(t){const{thunk:e=!0,immutableCheck:n=!0,serializableCheck:s=!0,actionCreatorCheck:r=!0}=t??{};let i=new $e;return e&&(function(t){return"boolean"==typeof t}(e)?i.push(He):i.push(Ue(e.extraArgument))),i},{reducer:n,middleware:s,devTools:r=!0,preloadedState:i,enhancers:o}=t||{};let a,B;if("function"==typeof n)a=n;else{if(!bt(n))throw new Error(nn(1));a=It(n)}B="function"==typeof s?s(e):e();let c=Tt;r&&(c=Ve({trace:!1,..."object"==typeof r&&r}));const l=function(...t){return e=>(n,s)=>{const r=e(n,s);let i=()=>{throw new Error(yt(15))};const o={getState:r.getState,dispatch:(t,...e)=>i(t,...e)},a=t.map(t=>t(o));return i=Tt(...a)(r.dispatch),{...r,dispatch:i}}}(...B),u=(t=>function(e){const{autoBatch:n=!0}=e??{};let s=new $e(t);return n&&s.push(Ke("object"==typeof n?n:void 0)),s})(l);return vt(a,i,c(..."function"==typeof o?o(u):u()))}({reducer:{session:rn.reducer},devTools:!0}),gn=i`
8
8
 
9
9
  :host {
10
10
  /* Required - this host's clock. It does not inherit onto a sibling component. */
@@ -147,10 +147,15 @@ const t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow
147
147
  }
148
148
 
149
149
  h2 {
150
+ box-sizing: border-box;
151
+ width: 100%;
152
+ justify-self: stretch;
150
153
  margin: 0;
154
+ margin-inline: 0;
151
155
  padding: 18px var(--pwa_inset, 0px) 14px;
152
156
  font-size: 1.15rem;
153
157
  font-weight: 600;
158
+ text-align: center;
154
159
  border-bottom: 1px solid var(--pwa_line_color, #e3daca);
155
160
  }
156
161
 
@@ -171,7 +176,7 @@ const t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow
171
176
  text-align: center;
172
177
  }
173
178
 
174
- `,Dn=i`
179
+ `,_n=i`
175
180
 
176
181
  ul {
177
182
  list-style-type: none;
@@ -191,7 +196,7 @@ const t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow
191
196
  margin: 0;
192
197
  }
193
198
 
194
- `,_n=function(t){const e=[];let n=0;for(let s=0;s<t.length;s++){let r=t.charCodeAt(s);r<128?e[n++]=r:r<2048?(e[n++]=r>>6|192,e[n++]=63&r|128):55296==(64512&r)&&s+1<t.length&&56320==(64512&t.charCodeAt(s+1))?(r=65536+((1023&r)<<10)+(1023&t.charCodeAt(++s)),e[n++]=r>>18|240,e[n++]=r>>12&63|128,e[n++]=r>>6&63|128,e[n++]=63&r|128):(e[n++]=r>>12|224,e[n++]=r>>6&63|128,e[n++]=63&r|128)}return e},bn={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(t,e){if(!Array.isArray(t))throw Error("encodeByteArray takes an array as a parameter");this.init_();const n=e?this.byteToCharMapWebSafe_:this.byteToCharMap_,s=[];for(let e=0;e<t.length;e+=3){const r=t[e],i=e+1<t.length,o=i?t[e+1]:0,a=e+2<t.length,B=a?t[e+2]:0,c=r>>2,l=(3&r)<<4|o>>4;let u=(15&o)<<2|B>>6,h=63&B;a||(h=64,i||(u=64)),s.push(n[c],n[l],n[u],n[h])}return s.join("")},encodeString(t,e){return this.HAS_NATIVE_SUPPORT&&!e?btoa(t):this.encodeByteArray(_n(t),e)},decodeString(t,e){return this.HAS_NATIVE_SUPPORT&&!e?atob(t):function(t){const e=[];let n=0,s=0;for(;n<t.length;){const r=t[n++];if(r<128)e[s++]=String.fromCharCode(r);else if(r>191&&r<224){const i=t[n++];e[s++]=String.fromCharCode((31&r)<<6|63&i)}else if(r>239&&r<365){const i=((7&r)<<18|(63&t[n++])<<12|(63&t[n++])<<6|63&t[n++])-65536;e[s++]=String.fromCharCode(55296+(i>>10)),e[s++]=String.fromCharCode(56320+(1023&i))}else{const i=t[n++],o=t[n++];e[s++]=String.fromCharCode((15&r)<<12|(63&i)<<6|63&o)}}return e.join("")}(this.decodeStringToByteArray(t,e))},decodeStringToByteArray(t,e){this.init_();const n=e?this.charToByteMapWebSafe_:this.charToByteMap_,s=[];for(let e=0;e<t.length;){const r=n[t.charAt(e++)],i=e<t.length?n[t.charAt(e)]:0;++e;const o=e<t.length?n[t.charAt(e)]:64;++e;const a=e<t.length?n[t.charAt(e)]:64;if(++e,null==r||null==i||null==o||null==a)throw new vn;const B=r<<2|i>>4;if(s.push(B),64!==o){const t=i<<4&240|o>>2;if(s.push(t),64!==a){const t=o<<6&192|a;s.push(t)}}}return s},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let 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)}}};class vn extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}}const In=function(t){return function(t){const e=_n(t);return bn.encodeByteArray(e,!0)}(t).replace(/\./g,"")},Tn=function(t){try{return bn.decodeString(t,!0)}catch(t){}return null};const On=()=>function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if("undefined"!=typeof global)return global;throw new Error("Unable to locate global object.")}().__FIREBASE_DEFAULTS__,An=()=>{try{return On()||(()=>{if("undefined"==typeof process||void 0===process.env)return;const t=process.env.__FIREBASE_DEFAULTS__;return t?JSON.parse(t):void 0})()||(()=>{if("undefined"==typeof document)return;let t;try{t=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch(t){return}const e=t&&Tn(t[1]);return e&&JSON.parse(e)})()}catch(t){return}},Sn=t=>An()?.emulatorHosts?.[t],Rn=t=>{const e=Sn(t);if(!e)return;const n=e.lastIndexOf(":");if(n<=0||n+1===e.length)throw new Error(`Invalid host ${e} with no separate hostname and port!`);const s=parseInt(e.substring(n+1),10);return"["===e[0]?[e.substring(1,n-1),s]:[e.substring(0,n),s]},Nn=()=>An()?.config,xn=t=>An()?.[`_${t}`];class kn{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise((t,e)=>{this.resolve=t,this.reject=e})}wrapCallback(t){return(e,n)=>{e?this.reject(e):this.resolve(n),"function"==typeof t&&(this.promise.catch(()=>{}),1===t.length?t(e):t(e,n))}}}function Ln(t,e){if(t.uid)throw new Error('The "uid" field is no longer supported by mockUserToken. Please use "sub" instead for Firebase Auth User ID.');const n=e||"demo-project",s=t.iat||0,r=t.sub||t.user_id;if(!r)throw new Error("mockUserToken must contain 'sub' or 'user_id' field!");const i={iss:`https://securetoken.google.com/${n}`,aud:n,iat:s,exp:s+3600,auth_time:s,sub:r,user_id:r,firebase:{sign_in_provider:"custom",identities:{}},...t};return[In(JSON.stringify({alg:"none",type:"JWT"})),In(JSON.stringify(i)),""].join(".")}function Fn(){return"undefined"!=typeof navigator&&"string"==typeof navigator.userAgent?navigator.userAgent:""}function Pn(){const t="object"==typeof chrome?chrome.runtime:"object"==typeof browser?browser.runtime:void 0;return"object"==typeof t&&void 0!==t.id}function Mn(){return!function(){const t=An()?.forceEnvironment;if("node"===t)return!0;if("browser"===t)return!1;try{return"[object process]"===Object.prototype.toString.call(global.process)}catch(t){return!1}}()&&!!navigator.userAgent&&navigator.userAgent.includes("Safari")&&!navigator.userAgent.includes("Chrome")}function Gn(){try{return"object"==typeof indexedDB}catch(t){return!1}}function Hn(){return new Promise((t,e)=>{try{let n=!0;const s="validate-browser-context-for-indexeddb-analytics-module",r=self.indexedDB.open(s);r.onsuccess=()=>{r.result.close(),n||self.indexedDB.deleteDatabase(s),t(!0)},r.onupgradeneeded=()=>{n=!1},r.onerror=()=>{e(r.error?.message||"")}}catch(t){e(t)}})}function Un(){return!("undefined"==typeof navigator||!navigator.cookieEnabled)}class Vn extends Error{constructor(t,e,n){super(e),this.code=t,this.customData=n,this.name="FirebaseError",Object.setPrototypeOf(this,Vn.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,jn.prototype.create)}}class jn{constructor(t,e,n){this.service=t,this.serviceName=e,this.errors=n}create(t,...e){const n=e[0]||{},s=`${this.service}/${t}`,r=this.errors[t],i=r?function(t,e){try{let n=0,s="";for(;n<t.length;){const r=t.indexOf("{$",n);if(-1===r){s+=t.substring(n);break}const i=t.indexOf("}",r+2);if(-1===i){s+=t.substring(n);break}const o=t.substring(r+2,i),a=e[o];s+=t.substring(n,r)+(null!=a?String(a):`<${o}?>`),n=i+1}return s}catch(e){return t}}(r,n):"Error",o=`${this.serviceName}: ${i} (${s}).`;return new Vn(s,o,n)}}function $n(t,e){if(t===e)return!0;const n=Object.keys(t),s=Object.keys(e);for(const r of n){if(!s.includes(r))return!1;const n=t[r],i=e[r];if(Jn(n)&&Jn(i)){if(!$n(n,i))return!1}else if(n!==i)return!1}for(const t of s)if(!n.includes(t))return!1;return!0}function Jn(t){return null!==t&&"object"==typeof t}function qn(t){const e=[];for(const[n,s]of Object.entries(t))Array.isArray(s)?s.forEach(t=>{e.push(encodeURIComponent(n)+"="+encodeURIComponent(t))}):e.push(encodeURIComponent(n)+"="+encodeURIComponent(s));return e.length?"&"+e.join("&"):""}function zn(t){const e={};return t.replace(/^\?/,"").split("&").forEach(t=>{if(t){const[n,s]=t.split("=");e[decodeURIComponent(n)]=decodeURIComponent(s)}}),e}function Kn(t){const e=t.indexOf("?");if(!e)return"";const n=t.indexOf("#",e);return t.substring(e,n>0?n:void 0)}class Qn{constructor(t,e){this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=e,this.task.then(()=>{t(this)}).catch(t=>{this.error(t)})}next(t){this.forEachObserver(e=>{e.next(t)})}error(t){this.forEachObserver(e=>{e.error(t)}),this.close(t)}complete(){this.forEachObserver(t=>{t.complete()}),this.close()}subscribe(t,e,n){let s;if(void 0===t&&void 0===e&&void 0===n)throw new Error("Missing Observer.");s=function(t,e){if("object"!=typeof t||null===t)return!1;for(const n of e)if(n in t&&"function"==typeof t[n])return!0;return!1}(t,["next","error","complete"])?t:{next:t,error:e,complete:n},void 0===s.next&&(s.next=Wn),void 0===s.error&&(s.error=Wn),void 0===s.complete&&(s.complete=Wn);const r=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then(()=>{try{this.finalError?s.error(this.finalError):s.complete()}catch(t){}}),this.observers.push(s),r}unsubscribeOne(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))}forEachObserver(t){if(!this.finalized)for(let e=0;e<this.observers.length;e++)this.sendOne(e,t)}sendOne(t,e){this.task.then(()=>{if(void 0!==this.observers&&void 0!==this.observers[t])try{e(this.observers[t])}catch(t){"undefined"!=typeof console&&console.error}})}close(t){this.finalized||(this.finalized=!0,void 0!==t&&(this.finalError=t),this.task.then(()=>{this.observers=void 0,this.onNoObservers=void 0}))}}function Wn(){}function Yn(t,e=1e3,n=2){const s=e*Math.pow(n,t),r=Math.round(.5*s*(Math.random()-.5)*2);return Math.min(144e5,s+r)}function Xn(t){return t&&t._delegate?t._delegate:t}function Zn(t){try{return(t.startsWith("http://")||t.startsWith("https://")?new URL(t).hostname:t).endsWith(".cloudworkstations.dev")}catch{return!1}}async function ts(t){return(await fetch(t,{credentials:"include"})).ok}class es{constructor(t,e,n){this.name=t,this.instanceFactory=e,this.type=n,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}setInstantiationMode(t){return this.instantiationMode=t,this}setMultipleInstances(t){return this.multipleInstances=t,this}setServiceProps(t){return this.serviceProps=t,this}setInstanceCreatedCallback(t){return this.onInstanceCreated=t,this}}const ns="[DEFAULT]";class ss{constructor(t,e){this.name=t,this.container=e,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}get(t){const e=this.normalizeInstanceIdentifier(t);if(!this.instancesDeferred.has(e)){const t=new kn;if(this.instancesDeferred.set(e,t),this.isInitialized(e)||this.shouldAutoInitialize())try{const n=this.getOrInitializeService({instanceIdentifier:e});n&&t.resolve(n)}catch(t){}}return this.instancesDeferred.get(e).promise}getImmediate(t){const e=this.normalizeInstanceIdentifier(t?.identifier),n=t?.optional??!1;if(!this.isInitialized(e)&&!this.shouldAutoInitialize()){if(n)return null;throw Error(`Service ${this.name} is not available`)}try{return this.getOrInitializeService({instanceIdentifier:e})}catch(t){if(n)return null;throw t}}getComponent(){return this.component}setComponent(t){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,this.shouldAutoInitialize()){if(function(t){return"EAGER"===t.instantiationMode}(t))try{this.getOrInitializeService({instanceIdentifier:ns})}catch(t){}for(const[t,e]of this.instancesDeferred.entries()){const n=this.normalizeInstanceIdentifier(t);try{const t=this.getOrInitializeService({instanceIdentifier:n});e.resolve(t)}catch(t){}}}}clearInstance(t=ns){this.instancesDeferred.delete(t),this.instancesOptions.delete(t),this.instances.delete(t)}async delete(){const t=Array.from(this.instances.values());await Promise.all([...t.filter(t=>"INTERNAL"in t).map(t=>t.INTERNAL.delete()),...t.filter(t=>"_delete"in t).map(t=>t._delete())])}isComponentSet(){return null!=this.component}isInitialized(t=ns){return this.instances.has(t)}getOptions(t=ns){return this.instancesOptions.get(t)||{}}initialize(t={}){const{options:e={}}=t,n=this.normalizeInstanceIdentifier(t.instanceIdentifier);if(this.isInitialized(n))throw Error(`${this.name}(${n}) has already been initialized`);if(!this.isComponentSet())throw Error(`Component ${this.name} has not been registered yet`);const s=this.getOrInitializeService({instanceIdentifier:n,options:e});for(const[t,e]of this.instancesDeferred.entries()){n===this.normalizeInstanceIdentifier(t)&&e.resolve(s)}return s}onInit(t,e){const n=this.normalizeInstanceIdentifier(e),s=this.onInitCallbacks.get(n)??new Set;s.add(t),this.onInitCallbacks.set(n,s);const r=this.instances.get(n);return r&&t(r,n),()=>{s.delete(t)}}invokeOnInitCallbacks(t,e){const n=this.onInitCallbacks.get(e);if(n)for(const s of n)try{s(t,e)}catch{}}getOrInitializeService({instanceIdentifier:t,options:e={}}){let n=this.instances.get(t);if(!n&&this.component&&(n=this.component.instanceFactory(this.container,{instanceIdentifier:(s=t,s===ns?void 0:s),options:e}),this.instances.set(t,n),this.instancesOptions.set(t,e),this.invokeOnInitCallbacks(n,t),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,t,n)}catch{}var s;return n||null}normalizeInstanceIdentifier(t=ns){return this.component?this.component.multipleInstances?t:ns:t}shouldAutoInitialize(){return!!this.component&&"EXPLICIT"!==this.component.instantiationMode}}class rs{constructor(t){this.name=t,this.providers=new Map}addComponent(t){const e=this.getProvider(t.name);if(e.isComponentSet())throw new Error(`Component ${t.name} has already been registered with ${this.name}`);e.setComponent(t)}addOrOverwriteComponent(t){this.getProvider(t.name).isComponentSet()&&this.providers.delete(t.name),this.addComponent(t)}getProvider(t){if(this.providers.has(t))return this.providers.get(t);const e=new ss(t,this);return this.providers.set(t,e),e}getProviders(){return Array.from(this.providers.values())}}var is;!function(t){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"}(is||(is={}));const os={debug:is.DEBUG,verbose:is.VERBOSE,info:is.INFO,warn:is.WARN,error:is.ERROR,silent:is.SILENT},as=is.INFO,Bs={[is.DEBUG]:"log",[is.VERBOSE]:"log",[is.INFO]:"info",[is.WARN]:"warn",[is.ERROR]:"error"},cs=(t,e,...n)=>{if(e<t.logLevel)return;(new Date).toISOString();if(!Bs[e])throw new Error(`Attempted to log a message with an invalid logType (value: ${e})`)};class ls{constructor(t){this.name=t,this._logLevel=as,this._logHandler=cs,this._userLogHandler=null}get logLevel(){return this._logLevel}set logLevel(t){if(!(t in is))throw new TypeError(`Invalid value "${t}" assigned to \`logLevel\``);this._logLevel=t}setLogLevel(t){this._logLevel="string"==typeof t?os[t]:t}get logHandler(){return this._logHandler}set logHandler(t){if("function"!=typeof t)throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=t}get userLogHandler(){return this._userLogHandler}set userLogHandler(t){this._userLogHandler=t}debug(...t){this._userLogHandler&&this._userLogHandler(this,is.DEBUG,...t),this._logHandler(this,is.DEBUG,...t)}log(...t){this._userLogHandler&&this._userLogHandler(this,is.VERBOSE,...t),this._logHandler(this,is.VERBOSE,...t)}info(...t){this._userLogHandler&&this._userLogHandler(this,is.INFO,...t),this._logHandler(this,is.INFO,...t)}warn(...t){this._userLogHandler&&this._userLogHandler(this,is.WARN,...t),this._logHandler(this,is.WARN,...t)}error(...t){this._userLogHandler&&this._userLogHandler(this,is.ERROR,...t),this._logHandler(this,is.ERROR,...t)}}let us,hs;const ds=new WeakMap,ps=new WeakMap,fs=new WeakMap,Cs=new WeakMap,gs=new WeakMap;let ms={get(t,e,n){if(t instanceof IDBTransaction){if("done"===e)return ps.get(t);if("objectStoreNames"===e)return t.objectStoreNames||fs.get(t);if("store"===e)return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return Es(t[e])},set:(t,e,n)=>(t[e]=n,!0),has:(t,e)=>t instanceof IDBTransaction&&("done"===e||"store"===e)||e in t};function ws(t){return t!==IDBDatabase.prototype.transaction||"objectStoreNames"in IDBTransaction.prototype?(hs||(hs=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(t)?function(...e){return t.apply(Ds(this),e),Es(ds.get(this))}:function(...e){return Es(t.apply(Ds(this),e))}:function(e,...n){const s=t.call(Ds(this),e,...n);return fs.set(s,e.sort?e.sort():[e]),Es(s)}}function ys(t){return"function"==typeof t?ws(t):(t instanceof IDBTransaction&&function(t){if(ps.has(t))return;const e=new Promise((e,n)=>{const s=()=>{t.removeEventListener("complete",r),t.removeEventListener("error",i),t.removeEventListener("abort",i)},r=()=>{e(),s()},i=()=>{n(t.error||new DOMException("AbortError","AbortError")),s()};t.addEventListener("complete",r),t.addEventListener("error",i),t.addEventListener("abort",i)});ps.set(t,e)}(t),e=t,(us||(us=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])).some(t=>e instanceof t)?new Proxy(t,ms):t);var e}function Es(t){if(t instanceof IDBRequest)return function(t){const e=new Promise((e,n)=>{const s=()=>{t.removeEventListener("success",r),t.removeEventListener("error",i)},r=()=>{e(Es(t.result)),s()},i=()=>{n(t.error),s()};t.addEventListener("success",r),t.addEventListener("error",i)});return e.then(e=>{e instanceof IDBCursor&&ds.set(e,t)}).catch(()=>{}),gs.set(e,t),e}(t);if(Cs.has(t))return Cs.get(t);const e=ys(t);return e!==t&&(Cs.set(t,e),gs.set(e,t)),e}const Ds=t=>gs.get(t);function _s(t,e,{blocked:n,upgrade:s,blocking:r,terminated:i}={}){const o=indexedDB.open(t,e),a=Es(o);return s&&o.addEventListener("upgradeneeded",t=>{s(Es(o.result),t.oldVersion,t.newVersion,Es(o.transaction),t)}),n&&o.addEventListener("blocked",t=>n(t.oldVersion,t.newVersion,t)),a.then(t=>{i&&t.addEventListener("close",()=>i()),r&&t.addEventListener("versionchange",t=>r(t.oldVersion,t.newVersion,t))}).catch(()=>{}),a}const bs=["get","getKey","getAll","getAllKeys","count"],vs=["put","add","delete","clear"],Is=new Map;function Ts(t,e){if(!(t instanceof IDBDatabase)||e in t||"string"!=typeof e)return;if(Is.get(e))return Is.get(e);const n=e.replace(/FromIndex$/,""),s=e!==n,r=vs.includes(n);if(!(n in(s?IDBIndex:IDBObjectStore).prototype)||!r&&!bs.includes(n))return;const i=async function(t,...e){const i=this.transaction(t,r?"readwrite":"readonly");let o=i.store;return s&&(o=o.index(e.shift())),(await Promise.all([o[n](...e),r&&i.done]))[0]};return Is.set(e,i),i}ms=(t=>({...t,get:(e,n,s)=>Ts(e,n)||t.get(e,n,s),has:(e,n)=>!!Ts(e,n)||t.has(e,n)}))(ms);class Os{constructor(t){this.container=t}getPlatformInfoString(){return this.container.getProviders().map(t=>{if(function(t){const e=t.getComponent();return"VERSION"===e?.type}(t)){const e=t.getImmediate();return`${e.library}/${e.version}`}return null}).filter(t=>t).join(" ")}}const As="@firebase/app",Ss="0.16.2",Rs=new ls("@firebase/app"),Ns="@firebase/app-compat",xs="@firebase/analytics-compat",ks="@firebase/analytics",Ls="@firebase/app-check-compat",Fs="@firebase/app-check",Ps="@firebase/auth",Ms="@firebase/auth-compat",Gs="@firebase/database",Hs="@firebase/data-connect",Us="@firebase/database-compat",Vs="@firebase/functions",js="@firebase/functions-compat",$s="@firebase/installations",Js="@firebase/installations-compat",qs="@firebase/messaging",zs="@firebase/messaging-compat",Ks="@firebase/performance",Qs="@firebase/performance-compat",Ws="@firebase/remote-config",Ys="@firebase/remote-config-compat",Xs="@firebase/storage",Zs="@firebase/storage-compat",tr="@firebase/firestore",er="@firebase/ai",nr="@firebase/firestore-compat",sr="firebase",rr="[DEFAULT]",ir={[As]:"fire-core",[Ns]:"fire-core-compat",[ks]:"fire-analytics",[xs]:"fire-analytics-compat",[Fs]:"fire-app-check",[Ls]:"fire-app-check-compat",[Ps]:"fire-auth",[Ms]:"fire-auth-compat",[Gs]:"fire-rtdb",[Hs]:"fire-data-connect",[Us]:"fire-rtdb-compat",[Vs]:"fire-fn",[js]:"fire-fn-compat",[$s]:"fire-iid",[Js]:"fire-iid-compat",[qs]:"fire-fcm",[zs]:"fire-fcm-compat",[Ks]:"fire-perf",[Qs]:"fire-perf-compat",[Ws]:"fire-rc",[Ys]:"fire-rc-compat",[Xs]:"fire-gcs",[Zs]:"fire-gcs-compat",[tr]:"fire-fst",[nr]:"fire-fst-compat",[er]:"fire-vertex","fire-js":"fire-js",[sr]:"fire-js-all"},or=new Map,ar=new Map,Br=new Map;function cr(t,e){try{t.container.addComponent(e)}catch(n){Rs.debug(`Component ${e.name} failed to register with FirebaseApp ${t.name}`,n)}}function lr(t){const e=t.name;if(Br.has(e))return Rs.debug(`There were multiple attempts to register component ${e}.`),!1;Br.set(e,t);for(const e of or.values())cr(e,t);for(const e of ar.values())cr(e,t);return!0}function ur(t,e){const n=t.container.getProvider("heartbeat").getImmediate({optional:!0});return n&&n.triggerHeartbeat(),t.container.getProvider(e)}function hr(t){return null!=t&&void 0!==t.settings}const dr=new jn("app","Firebase",{"no-app":"No Firebase App '{$appName}' has been created - call initializeApp() first","bad-app-name":"Illegal App name: '{$appName}'","duplicate-app":"Firebase App named '{$appName}' already exists with different {$mismatchedParam}. Existing: '{$oldValue}'. New: '{$newValue}'.","app-deleted":"Firebase App named '{$appName}' already deleted","server-app-deleted":"Firebase Server App has been deleted","no-options":"Need to provide options, when not being deployed to hosting via source.","invalid-app-argument":"firebase.{$appName}() takes either no argument or a Firebase App instance.","invalid-log-argument":"First argument to `onLog` must be null or a function.","idb-open":"Error thrown when opening IndexedDB. Original error: {$originalErrorMessage}.","idb-get":"Error thrown when reading from IndexedDB. Original error: {$originalErrorMessage}.","idb-set":"Error thrown when writing to IndexedDB. Original error: {$originalErrorMessage}.","idb-delete":"Error thrown when deleting from IndexedDB. Original error: {$originalErrorMessage}.","finalization-registry-not-supported":"FirebaseServerApp deleteOnDeref field defined but the JS runtime does not support FinalizationRegistry.","invalid-server-app-environment":"FirebaseServerApp is not for use in browser environments."});class pr{constructor(t,e,n){this._isDeleted=!1,this._options={...t},this._config={...e},this._name=e.name,this._automaticDataCollectionEnabled=e.automaticDataCollectionEnabled,this._container=n,this.container.addComponent(new es("app",()=>this,"PUBLIC"))}get automaticDataCollectionEnabled(){return this.checkDestroyed(),this._automaticDataCollectionEnabled}set automaticDataCollectionEnabled(t){this.checkDestroyed(),this._automaticDataCollectionEnabled=t}get name(){return this.checkDestroyed(),this._name}get options(){return this.checkDestroyed(),this._options}get config(){return this.checkDestroyed(),this._config}get container(){return this._container}get isDeleted(){return this._isDeleted}set isDeleted(t){this._isDeleted=t}checkDestroyed(){if(this.isDeleted)throw dr.create("app-deleted",{appName:this._name})}}const fr="12.19.0";function Cr(t,e={}){let n=t;if("object"!=typeof e){e={name:e}}const s={name:rr,automaticDataCollectionEnabled:!0,...e},r=s.name;if("string"!=typeof r||!r)throw dr.create("bad-app-name",{appName:String(r)});if(n||(n=Nn()),!n)throw dr.create("no-options");const i=or.get(r);if(i){if($n(n,i.options)){if($n(s,i.config))return i;throw dr.create("duplicate-app",{appName:r,mismatchedParam:"config",oldValue:JSON.stringify(i.config),newValue:JSON.stringify(s)})}throw dr.create("duplicate-app",{appName:r,mismatchedParam:"options",oldValue:JSON.stringify(i.options),newValue:JSON.stringify(n)})}const o=new rs(r);for(const t of Br.values())o.addComponent(t);const a=new pr(n,s,o);return or.set(r,a),a}function gr(t=rr){const e=or.get(t);if(!e&&t===rr&&Nn())return Cr();if(!e)throw dr.create("no-app",{appName:t});return e}function mr(t,e,n){let s=ir[t]??t;n&&(s+=`-${n}`);const r=s.match(/\s|\//),i=e.match(/\s|\//);if(r||i){const t=[`Unable to register library "${s}" with version "${e}":`];return r&&t.push(`library name "${s}" contains illegal characters (whitespace or "/")`),r&&i&&t.push("and"),i&&t.push(`version name "${e}" contains illegal characters (whitespace or "/")`),void Rs.warn(t.join(" "))}lr(new es(`${s}-version`,()=>({library:s,version:e}),"VERSION"))}const wr="firebase-heartbeat-store";let yr=null;function Er(){return yr||(yr=_s("firebase-heartbeat-database",1,{upgrade:(t,e)=>{if(0===e)try{t.createObjectStore(wr)}catch(t){}}}).catch(t=>{throw dr.create("idb-open",{originalErrorMessage:t.message})})),yr}async function Dr(t,e){try{const n=(await Er()).transaction(wr,"readwrite"),s=n.objectStore(wr);await s.put(e,_r(t)),await n.done}catch(t){if(t instanceof Vn)Rs.warn(t.message);else{const e=dr.create("idb-set",{originalErrorMessage:t?.message});Rs.warn(e.message)}}}function _r(t){return`${t.name}!${t.options.appId}`}class br{constructor(t){this.container=t,this._heartbeatsCache=null;const e=this.container.getProvider("app").getImmediate();this._storage=new Ir(e),this._heartbeatsCachePromise=this._storage.read().then(t=>(this._heartbeatsCache=t,t))}async triggerHeartbeat(){try{const t=this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(),e=vr();if(null==this._heartbeatsCache?.heartbeats&&(this._heartbeatsCache=await this._heartbeatsCachePromise,null==this._heartbeatsCache?.heartbeats))return;if(this._heartbeatsCache.lastSentHeartbeatDate===e||this._heartbeatsCache.heartbeats.some(t=>t.date===e))return;if(this._heartbeatsCache.heartbeats.push({date:e,agent:t}),this._heartbeatsCache.heartbeats.length>30){const t=function(t){if(0===t.length)return-1;let e=0,n=t[0].date;for(let s=1;s<t.length;s++)t[s].date<n&&(n=t[s].date,e=s);return e}(this._heartbeatsCache.heartbeats);this._heartbeatsCache.heartbeats.splice(t,1)}return this._storage.overwrite(this._heartbeatsCache)}catch(t){Rs.warn(t)}}async getHeartbeatsHeader(){try{if(null===this._heartbeatsCache&&await this._heartbeatsCachePromise,null==this._heartbeatsCache?.heartbeats||0===this._heartbeatsCache.heartbeats.length)return"";const t=vr(),{heartbeatsToSend:e,unsentEntries:n}=function(t,e=1024){const n=[];let s=t.slice();for(const r of t){const t=n.find(t=>t.agent===r.agent);if(t){if(t.dates.push(r.date),Tr(n)>e){t.dates.pop();break}}else if(n.push({agent:r.agent,dates:[r.date]}),Tr(n)>e){n.pop();break}s=s.slice(1)}return{heartbeatsToSend:n,unsentEntries:s}}(this._heartbeatsCache.heartbeats),s=In(JSON.stringify({version:2,heartbeats:e}));return this._heartbeatsCache.lastSentHeartbeatDate=t,n.length>0?(this._heartbeatsCache.heartbeats=n,await this._storage.overwrite(this._heartbeatsCache)):(this._heartbeatsCache.heartbeats=[],this._storage.overwrite(this._heartbeatsCache)),s}catch(t){return Rs.warn(t),""}}}function vr(){return(new Date).toISOString().substring(0,10)}class Ir{constructor(t){this.app=t,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}async runIndexedDBEnvironmentCheck(){return!!Gn()&&Hn().then(()=>!0).catch(()=>!1)}async read(){if(await this._canUseIndexedDBPromise){const t=await async function(t){try{const e=(await Er()).transaction(wr),n=await e.objectStore(wr).get(_r(t));return await e.done,n}catch(t){if(t instanceof Vn)Rs.warn(t.message);else{const e=dr.create("idb-get",{originalErrorMessage:t?.message});Rs.warn(e.message)}}}(this.app);return t?.heartbeats?t:{heartbeats:[]}}return{heartbeats:[]}}async overwrite(t){if(await this._canUseIndexedDBPromise){const e=await this.read();return Dr(this.app,{lastSentHeartbeatDate:t.lastSentHeartbeatDate??e.lastSentHeartbeatDate,heartbeats:t.heartbeats})}}async add(t){if(await this._canUseIndexedDBPromise){const e=await this.read();return Dr(this.app,{lastSentHeartbeatDate:t.lastSentHeartbeatDate??e.lastSentHeartbeatDate,heartbeats:[...e.heartbeats,...t.heartbeats]})}}}function Tr(t){return In(JSON.stringify({version:2,heartbeats:t})).length}var Or;function Ar(){return{"dependent-sdk-initialized-before-auth":"Another Firebase SDK was initialized and is trying to use Auth before Auth is initialized. Please be sure to call `initializeAuth` or `getAuth` before starting any other Firebase SDK."}}Or="",lr(new es("platform-logger",t=>new Os(t),"PRIVATE")),lr(new es("heartbeat",t=>new br(t),"PRIVATE")),mr(As,Ss,Or),mr(As,Ss,"esm2020"),mr("fire-js","");const Sr=Ar,Rr=new jn("auth","Firebase",{"dependent-sdk-initialized-before-auth":"Another Firebase SDK was initialized and is trying to use Auth before Auth is initialized. Please be sure to call `initializeAuth` or `getAuth` before starting any other Firebase SDK."}),Nr=new ls("@firebase/auth");function xr(t,...e){Nr.logLevel<=is.WARN&&Nr.warn(`Auth (${fr}): ${t}`,...e)}function kr(t,...e){Nr.logLevel<=is.ERROR&&Nr.error(`Auth (${fr}): ${t}`,...e)}function Lr(t,...e){throw Hr(t,...e)}function Fr(t,...e){return Hr(t,...e)}function Pr(t,e,n){const s={...Sr(),[e]:n};return new jn("auth","Firebase",s).create(e,{appName:t.name})}function Mr(t){return Pr(t,"operation-not-supported-in-this-environment","Operations that alter the current user are not supported in conjunction with FirebaseServerApp")}function Gr(t,e,n){if(!(e instanceof n))throw n.name!==e.constructor.name&&Lr(t,"argument-error"),Pr(t,"argument-error",`Type of ${e.constructor.name} does not match expected instance.Did you pass a reference from a different Auth SDK?`)}function Hr(t,...e){if("string"!=typeof t){const n=e[0],s=[...e.slice(1)];return s[0]&&(s[0].appName=t.name),t._errorFactory.create(n,...s)}return Rr.create(t,...e)}function Ur(t,e,...n){if(!t)throw Hr(e,...n)}function Vr(t){const e="INTERNAL ASSERTION FAILED: "+t;throw kr(e),new Error(e)}function jr(t,e){t||Vr(e)}function $r(){return"undefined"!=typeof self&&self.location?.href||""}function Jr(){return"undefined"!=typeof self&&self.location?.protocol||null}function qr(){return"undefined"==typeof navigator||!navigator||!("onLine"in navigator)||"boolean"!=typeof navigator.onLine||"http:"!==Jr()&&"https:"!==Jr()&&!Pn()&&!("connection"in navigator)||navigator.onLine}class zr{constructor(t,e){this.shortDelay=t,this.longDelay=e,jr(e>t,"Short delay should be less than long delay!"),this.isMobile="undefined"!=typeof window&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(Fn())||"object"==typeof navigator&&"ReactNative"===navigator.product}get(){return qr()?this.isMobile?this.longDelay:this.shortDelay:Math.min(5e3,this.shortDelay)}}function Kr(t,e){jr(t.emulator,"Emulator should always be set here");const{url:n}=t.emulator;return e?`${n}${e.startsWith("/")?e.slice(1):e}`:n}class Qr{static initialize(t,e,n){this.fetchImpl=t,e&&(this.headersImpl=e),n&&(this.responseImpl=n)}static fetch(){return this.fetchImpl?this.fetchImpl:"undefined"!=typeof self&&"fetch"in self?self.fetch:"undefined"!=typeof globalThis&&globalThis.fetch?globalThis.fetch:"undefined"!=typeof fetch?fetch:void Vr("Could not find fetch implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static headers(){return this.headersImpl?this.headersImpl:"undefined"!=typeof self&&"Headers"in self?self.Headers:"undefined"!=typeof globalThis&&globalThis.Headers?globalThis.Headers:"undefined"!=typeof Headers?Headers:void Vr("Could not find Headers implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static response(){return this.responseImpl?this.responseImpl:"undefined"!=typeof self&&"Response"in self?self.Response:"undefined"!=typeof globalThis&&globalThis.Response?globalThis.Response:"undefined"!=typeof Response?Response:void Vr("Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}}const Wr={CREDENTIAL_MISMATCH:"custom-token-mismatch",MISSING_CUSTOM_TOKEN:"internal-error",INVALID_IDENTIFIER:"invalid-email",MISSING_CONTINUE_URI:"internal-error",INVALID_PASSWORD:"wrong-password",MISSING_PASSWORD:"missing-password",INVALID_LOGIN_CREDENTIALS:"invalid-credential",EMAIL_EXISTS:"email-already-in-use",PASSWORD_LOGIN_DISABLED:"operation-not-allowed",INVALID_IDP_RESPONSE:"invalid-credential",INVALID_PENDING_TOKEN:"invalid-credential",FEDERATED_USER_ID_ALREADY_LINKED:"credential-already-in-use",MISSING_REQ_TYPE:"internal-error",EMAIL_NOT_FOUND:"user-not-found",RESET_PASSWORD_EXCEED_LIMIT:"too-many-requests",EXPIRED_OOB_CODE:"expired-action-code",INVALID_OOB_CODE:"invalid-action-code",MISSING_OOB_CODE:"internal-error",CREDENTIAL_TOO_OLD_LOGIN_AGAIN:"requires-recent-login",INVALID_ID_TOKEN:"invalid-user-token",TOKEN_EXPIRED:"user-token-expired",USER_NOT_FOUND:"user-token-expired",TOO_MANY_ATTEMPTS_TRY_LATER:"too-many-requests",PASSWORD_DOES_NOT_MEET_REQUIREMENTS:"password-does-not-meet-requirements",INVALID_CODE:"invalid-verification-code",INVALID_SESSION_INFO:"invalid-verification-id",INVALID_TEMPORARY_PROOF:"invalid-credential",MISSING_SESSION_INFO:"missing-verification-id",SESSION_EXPIRED:"code-expired",MISSING_ANDROID_PACKAGE_NAME:"missing-android-pkg-name",UNAUTHORIZED_DOMAIN:"unauthorized-continue-uri",INVALID_OAUTH_CLIENT_ID:"invalid-oauth-client-id",ADMIN_ONLY_OPERATION:"admin-restricted-operation",INVALID_MFA_PENDING_CREDENTIAL:"invalid-multi-factor-session",MFA_ENROLLMENT_NOT_FOUND:"multi-factor-info-not-found",MISSING_MFA_ENROLLMENT_ID:"missing-multi-factor-info",MISSING_MFA_PENDING_CREDENTIAL:"missing-multi-factor-session",SECOND_FACTOR_EXISTS:"second-factor-already-in-use",SECOND_FACTOR_LIMIT_EXCEEDED:"maximum-second-factor-count-exceeded",BLOCKING_FUNCTION_ERROR_RESPONSE:"internal-error",RECAPTCHA_NOT_ENABLED:"recaptcha-not-enabled",MISSING_RECAPTCHA_TOKEN:"missing-recaptcha-token",INVALID_RECAPTCHA_TOKEN:"invalid-recaptcha-token",INVALID_RECAPTCHA_ACTION:"invalid-recaptcha-action",MISSING_CLIENT_TYPE:"missing-client-type",MISSING_RECAPTCHA_VERSION:"missing-recaptcha-version",INVALID_RECAPTCHA_VERSION:"invalid-recaptcha-version",INVALID_REQ_TYPE:"invalid-req-type"},Yr=["/v1/accounts:signInWithCustomToken","/v1/accounts:signInWithEmailLink","/v1/accounts:signInWithIdp","/v1/accounts:signInWithPassword","/v1/accounts:signInWithPhoneNumber","/v1/token"],Xr=new zr(3e4,6e4);function Zr(t,e){return t.tenantId&&!e.tenantId?{...e,tenantId:t.tenantId}:e}async function ti(t,e,n,s,r={}){return ei(t,r,async()=>{let r={},i={};s&&("GET"===e?i=s:r={body:JSON.stringify(s)});const o=qn({...i,key:t.config.apiKey}).slice(1),a=await t._getAdditionalHeaders();a["Content-Type"]="application/json",t.languageCode&&(a["X-Firebase-Locale"]=t.languageCode);const B={method:e,headers:a,...r};return"undefined"!=typeof navigator&&"Cloudflare-Workers"===navigator.userAgent||(B.referrerPolicy="strict-origin-when-cross-origin"),t.emulatorConfig&&Zn(t.emulatorConfig.host)&&(B.credentials="include"),Qr.fetch()(await si(t,t.config.apiHost,n,o),B)})}async function ei(t,e,n){t._canInitEmulator=!1;const s={...Wr,...e};try{const e=new ii(t),r=await Promise.race([n(),e.promise]);e.clearNetworkTimeout();const i=await r.json();if("needConfirmation"in i)throw oi(t,"account-exists-with-different-credential",i);if(r.ok&&!("errorMessage"in i))return i;{const e=r.ok?i.errorMessage:i.error.message,[n,o]=e.split(" : ");if("FEDERATED_USER_ID_ALREADY_LINKED"===n)throw oi(t,"credential-already-in-use",i);if("EMAIL_EXISTS"===n)throw oi(t,"email-already-in-use",i);if("USER_DISABLED"===n)throw oi(t,"user-disabled",i);const a=s[n]||n.toLowerCase().replace(/[_\s]+/g,"-");if(o)throw Pr(t,a,o);Lr(t,a)}}catch(e){if(e instanceof Vn)throw e;Lr(t,"network-request-failed",{message:String(e)})}}async function ni(t,e,n,s,r={}){const i=await ti(t,e,n,s,r);return"mfaPendingCredential"in i&&Lr(t,"multi-factor-auth-required",{_serverResponse:i}),i}async function si(t,e,n,s){const r=`${e}${n}?${s}`,i=t,o=i.config.emulator?Kr(t.config,r):`${t.config.apiScheme}://${r}`;if(Yr.includes(n)&&(await i._persistenceManagerAvailable,"COOKIE"===i._getPersistenceType())){return i._getPersistence()._getFinalTarget(o).toString()}return o}function ri(t){switch(t){case"ENFORCE":return"ENFORCE";case"AUDIT":return"AUDIT";case"OFF":return"OFF";default:return"ENFORCEMENT_STATE_UNSPECIFIED"}}class ii{clearNetworkTimeout(){clearTimeout(this.timer)}constructor(t){this.auth=t,this.timer=null,this.promise=new Promise((t,e)=>{this.timer=setTimeout(()=>e(Fr(this.auth,"network-request-failed")),Xr.get())})}}function oi(t,e,n){const s={appName:t.name};n.email&&(s.email=n.email),n.phoneNumber&&(s.phoneNumber=n.phoneNumber);const r=Fr(t,e,s);return r.customData._tokenResponse=n,r}function ai(t){return void 0!==t&&void 0!==t.enterprise}class Bi{constructor(t){if(this.siteKey="",this.recaptchaEnforcementState=[],void 0===t.recaptchaKey)throw new Error("recaptchaKey undefined");this.siteKey=t.recaptchaKey.split("/")[3],this.recaptchaEnforcementState=t.recaptchaEnforcementState}getProviderEnforcementState(t){if(!this.recaptchaEnforcementState||0===this.recaptchaEnforcementState.length)return null;for(const e of this.recaptchaEnforcementState)if(e.provider&&e.provider===t)return ri(e.enforcementState);return null}isProviderEnabled(t){return"ENFORCE"===this.getProviderEnforcementState(t)||"AUDIT"===this.getProviderEnforcementState(t)}isAnyProviderEnabled(){return this.isProviderEnabled("EMAIL_PASSWORD_PROVIDER")||this.isProviderEnabled("PHONE_PROVIDER")}}async function ci(t,e){return ti(t,"POST","/v1/accounts:lookup",e)}function li(t){if(t)try{const e=new Date(Number(t));if(!isNaN(e.getTime()))return e.toUTCString()}catch(t){}}function ui(t){return 1e3*Number(t)}function hi(t){const[e,n,s]=t.split(".");if(void 0===e||void 0===n||void 0===s)return kr("JWT malformed, contained fewer than 3 sections"),null;try{const t=Tn(n);return t?JSON.parse(t):(kr("Failed to decode base64 JWT payload"),null)}catch(t){return kr("Caught error parsing JWT payload as JSON",t?.toString()),null}}function di(t){const e=hi(t);return Ur(e,"internal-error"),Ur(void 0!==e.exp,"internal-error"),Ur(void 0!==e.iat,"internal-error"),Number(e.exp)-Number(e.iat)}async function pi(t,e,n=!1){if(n)return e;try{return await e}catch(e){throw e instanceof Vn&&function({code:t}){return"auth/user-disabled"===t||"auth/user-token-expired"===t}(e)&&t.auth.currentUser===t&&await t.auth.signOut(),e}}class fi{constructor(t){this.user=t,this.isRunning=!1,this.timerId=null,this.errorBackoff=3e4}_start(){this.isRunning||(this.isRunning=!0,this.schedule())}_stop(){this.isRunning&&(this.isRunning=!1,null!==this.timerId&&clearTimeout(this.timerId))}getInterval(t){if(t){const t=this.errorBackoff;return this.errorBackoff=Math.min(2*this.errorBackoff,96e4),t}{this.errorBackoff=3e4;const t=(this.user.stsTokenManager.expirationTime??0)-Date.now()-3e5;return Math.max(0,t)}}schedule(t=!1){if(!this.isRunning)return;const e=this.getInterval(t);this.timerId=setTimeout(async()=>{await this.iteration()},e)}async iteration(){try{await this.user.getIdToken(!0)}catch(t){return void("auth/network-request-failed"===t?.code&&this.schedule(!0))}this.schedule()}}class Ci{constructor(t,e){this.createdAt=t,this.lastLoginAt=e,this._initializeTime()}_initializeTime(){this.lastSignInTime=li(this.lastLoginAt),this.creationTime=li(this.createdAt)}_copy(t){this.createdAt=t.createdAt,this.lastLoginAt=t.lastLoginAt,this._initializeTime()}toJSON(){return{createdAt:this.createdAt,lastLoginAt:this.lastLoginAt}}}async function gi(t){const e=t.auth,n=await t.getIdToken(),s=await pi(t,ci(e,{idToken:n}));Ur(s?.users.length,e,"internal-error");const r=s.users[0];t._notifyReloadListener(r);const i=r.providerUserInfo?.length?mi(r.providerUserInfo):[],o=function(t,e){const n=t.filter(t=>!e.some(e=>e.providerId===t.providerId));return[...n,...e]}(t.providerData,i),a=t.isAnonymous,B=!(t.email&&r.passwordHash||o?.length),c=!!a&&B,l={uid:r.localId,displayName:r.displayName||null,photoURL:r.photoUrl||null,email:r.email||null,emailVerified:r.emailVerified||!1,phoneNumber:r.phoneNumber||null,tenantId:r.tenantId||null,providerData:o,metadata:new Ci(r.createdAt,r.lastLoginAt),isAnonymous:c};Object.assign(t,l)}function mi(t){return t.map(({providerId:t,...e})=>({providerId:t,uid:e.rawId||"",displayName:e.displayName||null,email:e.email||null,phoneNumber:e.phoneNumber||null,photoURL:e.photoUrl||null}))}class wi{constructor(){this.refreshToken=null,this.accessToken=null,this.expirationTime=null}get isExpired(){return!this.expirationTime||Date.now()>this.expirationTime-3e4}updateFromServerResponse(t){Ur(t.idToken,"internal-error"),Ur(void 0!==t.idToken,"internal-error"),Ur(void 0!==t.refreshToken,"internal-error");const e="expiresIn"in t&&void 0!==t.expiresIn?Number(t.expiresIn):di(t.idToken);this.updateTokensAndExpiration(t.idToken,t.refreshToken,e)}updateFromIdToken(t){Ur(0!==t.length,"internal-error");const e=di(t);this.updateTokensAndExpiration(t,null,e)}async getToken(t,e=!1){return e||!this.accessToken||this.isExpired?(Ur(this.refreshToken,t,"user-token-expired"),this.refreshToken?(await this.refresh(t,this.refreshToken),this.accessToken):null):this.accessToken}clearRefreshToken(){this.refreshToken=null}async refresh(t,e){const{accessToken:n,refreshToken:s,expiresIn:r}=await async function(t,e){const n=await ei(t,{},async()=>{const n=qn({grant_type:"refresh_token",refresh_token:e}).slice(1),{tokenApiHost:s,apiKey:r}=t.config,i=await si(t,s,"/v1/token",`key=${r}`),o=await t._getAdditionalHeaders();o["Content-Type"]="application/x-www-form-urlencoded";const a={method:"POST",headers:o,body:n};return t.emulatorConfig&&Zn(t.emulatorConfig.host)&&(a.credentials="include"),Qr.fetch()(i,a)});return{accessToken:n.access_token,expiresIn:n.expires_in,refreshToken:n.refresh_token}}(t,e);this.updateTokensAndExpiration(n,s,Number(r))}updateTokensAndExpiration(t,e,n){this.refreshToken=e||null,this.accessToken=t||null,this.expirationTime=Date.now()+1e3*n}static fromJSON(t,e){const{refreshToken:n,accessToken:s,expirationTime:r}=e,i=new wi;return n&&(Ur("string"==typeof n,"internal-error",{appName:t}),i.refreshToken=n),s&&(Ur("string"==typeof s,"internal-error",{appName:t}),i.accessToken=s),r&&(Ur("number"==typeof r,"internal-error",{appName:t}),i.expirationTime=r),i}toJSON(){return{refreshToken:this.refreshToken,accessToken:this.accessToken,expirationTime:this.expirationTime}}_assign(t){this.accessToken=t.accessToken,this.refreshToken=t.refreshToken,this.expirationTime=t.expirationTime}_clone(){return Object.assign(new wi,this.toJSON())}_performRefresh(){return Vr("not implemented")}}function yi(t,e){Ur("string"==typeof t||void 0===t,"internal-error",{appName:e})}class Ei{constructor({uid:t,auth:e,stsTokenManager:n,...s}){this.providerId="firebase",this.proactiveRefresh=new fi(this),this.reloadUserInfo=null,this.reloadListener=null,this.uid=t,this.auth=e,this.stsTokenManager=n,this.accessToken=n.accessToken,this.displayName=s.displayName||null,this.email=s.email||null,this.emailVerified=s.emailVerified||!1,this.phoneNumber=s.phoneNumber||null,this.photoURL=s.photoURL||null,this.isAnonymous=s.isAnonymous||!1,this.tenantId=s.tenantId||null,this.providerData=s.providerData?[...s.providerData]:[],this.metadata=new Ci(s.createdAt||void 0,s.lastLoginAt||void 0)}async getIdToken(t){const e=await pi(this,this.stsTokenManager.getToken(this.auth,t));return Ur(e,this.auth,"internal-error"),this.accessToken!==e&&(this.accessToken=e,await this.auth._persistUserIfCurrent(this),this.auth._notifyListenersIfCurrent(this)),e}getIdTokenResult(t){return async function(t,e=!1){const n=Xn(t),s=await n.getIdToken(e),r=hi(s);Ur(r&&r.exp&&r.auth_time&&r.iat,n.auth,"internal-error");const i="object"==typeof r.firebase?r.firebase:void 0,o=i?.sign_in_provider;return{claims:r,token:s,authTime:li(ui(r.auth_time)),issuedAtTime:li(ui(r.iat)),expirationTime:li(ui(r.exp)),signInProvider:o||null,signInSecondFactor:i?.sign_in_second_factor||null}}(this,t)}reload(){return async function(t){const e=Xn(t);await gi(e),await e.auth._persistUserIfCurrent(e),e.auth._notifyListenersIfCurrent(e)}(this)}_assign(t){this!==t&&(Ur(this.uid===t.uid,this.auth,"internal-error"),this.displayName=t.displayName,this.photoURL=t.photoURL,this.email=t.email,this.emailVerified=t.emailVerified,this.phoneNumber=t.phoneNumber,this.isAnonymous=t.isAnonymous,this.tenantId=t.tenantId,this.providerData=t.providerData.map(t=>({...t})),this.metadata._copy(t.metadata),this.stsTokenManager._assign(t.stsTokenManager))}_clone(t){const e=new Ei({...this,auth:t,stsTokenManager:this.stsTokenManager._clone()});return e.metadata._copy(this.metadata),e}_onReload(t){Ur(!this.reloadListener,this.auth,"internal-error"),this.reloadListener=t,this.reloadUserInfo&&(this._notifyReloadListener(this.reloadUserInfo),this.reloadUserInfo=null)}_notifyReloadListener(t){this.reloadListener?this.reloadListener(t):this.reloadUserInfo=t}_startProactiveRefresh(){this.proactiveRefresh._start()}_stopProactiveRefresh(){this.proactiveRefresh._stop()}async _updateTokensIfNecessary(t,e=!1){let n=!1;t.idToken&&t.idToken!==this.stsTokenManager.accessToken&&(this.stsTokenManager.updateFromServerResponse(t),n=!0),e&&await gi(this),await this.auth._persistUserIfCurrent(this),n&&this.auth._notifyListenersIfCurrent(this)}async delete(){if(hr(this.auth.app))return Promise.reject(Mr(this.auth));const t=await this.getIdToken();return await pi(this,async function(t,e){return ti(t,"POST","/v1/accounts:delete",e)}(this.auth,{idToken:t})),this.stsTokenManager.clearRefreshToken(),this.auth.signOut()}toJSON(){return{uid:this.uid,email:this.email||void 0,emailVerified:this.emailVerified,displayName:this.displayName||void 0,isAnonymous:this.isAnonymous,photoURL:this.photoURL||void 0,phoneNumber:this.phoneNumber||void 0,tenantId:this.tenantId||void 0,providerData:this.providerData.map(t=>({...t})),stsTokenManager:this.stsTokenManager.toJSON(),_redirectEventId:this._redirectEventId,...this.metadata.toJSON(),apiKey:this.auth.config.apiKey,appName:this.auth.name}}get refreshToken(){return this.stsTokenManager.refreshToken||""}static _fromJSON(t,e){const n=e.displayName??void 0,s=e.email??void 0,r=e.phoneNumber??void 0,i=e.photoURL??void 0,o=e.tenantId??void 0,a=e._redirectEventId??void 0,B=e.createdAt??void 0,c=e.lastLoginAt??void 0,{uid:l,emailVerified:u,isAnonymous:h,providerData:d,stsTokenManager:p}=e;Ur(l&&p,t,"internal-error");const f=wi.fromJSON(this.name,p);Ur("string"==typeof l,t,"internal-error"),yi(n,t.name),yi(s,t.name),Ur("boolean"==typeof u,t,"internal-error"),Ur("boolean"==typeof h,t,"internal-error"),yi(r,t.name),yi(i,t.name),yi(o,t.name),yi(a,t.name),yi(B,t.name),yi(c,t.name);const C=new Ei({uid:l,auth:t,email:s,emailVerified:u,displayName:n,isAnonymous:h,photoURL:i,phoneNumber:r,tenantId:o,stsTokenManager:f,createdAt:B,lastLoginAt:c});return d&&Array.isArray(d)&&(C.providerData=d.map(t=>({...t}))),a&&(C._redirectEventId=a),C}static async _fromIdTokenResponse(t,e,n=!1){const s=new wi;s.updateFromServerResponse(e);const r=new Ei({uid:e.localId,auth:t,stsTokenManager:s,isAnonymous:n});return await gi(r),r}static async _fromGetAccountInfoResponse(t,e,n){const s=e.users[0];Ur(void 0!==s.localId,"internal-error");const r=void 0!==s.providerUserInfo?mi(s.providerUserInfo):[],i=!(s.email&&s.passwordHash||r?.length),o=new wi;o.updateFromIdToken(n);const a=new Ei({uid:s.localId,auth:t,stsTokenManager:o,isAnonymous:i}),B={uid:s.localId,displayName:s.displayName||null,photoURL:s.photoUrl||null,email:s.email||null,emailVerified:s.emailVerified||!1,phoneNumber:s.phoneNumber||null,tenantId:s.tenantId||null,providerData:r,metadata:new Ci(s.createdAt,s.lastLoginAt),isAnonymous:!(s.email&&s.passwordHash||r?.length)};return Object.assign(a,B),a}}const Di=new Map;function _i(t){jr(t instanceof Function,"Expected a class definition");let e=Di.get(t);return e?(jr(e instanceof t,"Instance stored in cache mismatched with class"),e):(e=new t,Di.set(t,e),e)}class bi{constructor(){this.type="NONE",this.storage={}}async _isAvailable(){return!0}async _set(t,e){this.storage[t]=e}async _get(t){const e=this.storage[t];return void 0===e?null:e}async _remove(t){delete this.storage[t]}_addListener(t,e){}_removeListener(t,e){}}bi.type="NONE";const vi=bi;function Ii(t,e,n){return`firebase:${t}:${e}:${n}`}class Ti{constructor(t,e,n){this.persistence=t,this.auth=e,this.userKey=n;const{config:s,name:r}=this.auth;this.fullUserKey=Ii(this.userKey,s.apiKey,r),this.fullPersistenceKey=Ii("persistence",s.apiKey,r),this.boundEventHandler=e._onStorageEvent.bind(e);try{this.persistence._addListener(this.fullUserKey,this.boundEventHandler)}catch{}}setCurrentUser(t){return this.persistence._set(this.fullUserKey,t.toJSON())}async getCurrentUser(){const t=await this.persistence._get(this.fullUserKey);if(!t)return null;if("string"==typeof t){const e=await ci(this.auth,{idToken:t}).catch(()=>{});return e?Ei._fromGetAccountInfoResponse(this.auth,e,t):null}return Ei._fromJSON(this.auth,t)}removeCurrentUser(){return this.persistence._remove(this.fullUserKey)}savePersistenceForRedirect(){return this.persistence._set(this.fullPersistenceKey,this.persistence.type)}async setPersistence(t){if(this.persistence===t)return;const e=await this.getCurrentUser();return await this.removeCurrentUser(),this.persistence=t,e?this.setCurrentUser(e):void 0}delete(){try{this.persistence._removeListener(this.fullUserKey,this.boundEventHandler)}catch{}}static async create(t,e,n="authUser"){if(!e.length)return new Ti(_i(vi),t,n);const s=(await Promise.all(e.map(async t=>{try{if(await t._isAvailable())return t}catch{return}}))).filter(t=>t);let r=s[0]||_i(vi);const i=Ii(n,t.config.apiKey,t.name);let o=null;for(const n of e)try{const e=await n._get(i);if(e){let s;if("string"==typeof e){const n=await ci(t,{idToken:e}).catch(()=>{});if(!n)break;s=await Ei._fromGetAccountInfoResponse(t,n,e)}else s=Ei._fromJSON(t,e);n!==r&&(o=s),r=n;break}}catch{}const a=s.filter(t=>t._shouldAllowMigration);return r._shouldAllowMigration&&a.length?(r=a[0],o&&await r._set(i,o.toJSON()),await Promise.all(e.map(async t=>{if(t!==r)try{await t._remove(i)}catch{}})),new Ti(r,t,n)):new Ti(r,t,n)}}function Oi(t){const e=t.toLowerCase();if(e.includes("opera/")||e.includes("opr/")||e.includes("opios/"))return"Opera";if(Ni(e))return"IEMobile";if(e.includes("msie")||e.includes("trident/"))return"IE";if(e.includes("edge/"))return"Edge";if(Ai(e))return"Firefox";if(e.includes("silk/"))return"Silk";if(ki(e))return"Blackberry";if(Li(e))return"Webos";if(Si(e))return"Safari";if((e.includes("chrome/")||Ri(e))&&!e.includes("edge/"))return"Chrome";if(xi(e))return"Android";{const e=/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/,n=t.match(e);if(2===n?.length)return n[1]}return"Other"}function Ai(t=Fn()){return/firefox\//i.test(t)}function Si(t=Fn()){const e=t.toLowerCase();return e.includes("safari/")&&!e.includes("chrome/")&&!e.includes("crios/")&&!e.includes("android")}function Ri(t=Fn()){return/crios\//i.test(t)}function Ni(t=Fn()){return/iemobile/i.test(t)}function xi(t=Fn()){return/android/i.test(t)}function ki(t=Fn()){return/blackberry/i.test(t)}function Li(t=Fn()){return/webos/i.test(t)}function Fi(t=Fn()){return/iphone|ipad|ipod/i.test(t)||/macintosh/i.test(t)&&/mobile/i.test(t)}function Pi(){return function(){const t=Fn();return t.indexOf("MSIE ")>=0||t.indexOf("Trident/")>=0}()&&10===document.documentMode}function Mi(t=Fn()){return Fi(t)||xi(t)||Li(t)||ki(t)||/windows phone/i.test(t)||Ni(t)}function Gi(t,e=[]){let n;switch(t){case"Browser":n=Oi(Fn());break;case"Worker":n=`${Oi(Fn())}-${t}`;break;default:n=t}const s=e.length?e.join(","):"FirebaseCore-web";return`${n}/JsCore/${fr}/${s}`}class Hi{constructor(t){this.auth=t,this.queue=[]}pushCallback(t,e){const n=e=>new Promise((n,s)=>{try{n(t(e))}catch(t){s(t)}});n.onAbort=e,this.queue.push(n);const s=this.queue.length-1;return()=>{this.queue[s]=()=>Promise.resolve()}}async runMiddleware(t){if(this.auth.currentUser===t)return;const e=[];try{for(const n of this.queue)await n(t),n.onAbort&&e.push(n.onAbort)}catch(t){e.reverse();for(const t of e)try{t()}catch(t){}throw this.auth._errorFactory.create("login-blocked",{originalMessage:t?.message})}}}class Ui{constructor(t){const e=t.customStrengthOptions;this.customStrengthOptions={},this.customStrengthOptions.minPasswordLength=e.minPasswordLength??6,e.maxPasswordLength&&(this.customStrengthOptions.maxPasswordLength=e.maxPasswordLength),void 0!==e.containsLowercaseCharacter&&(this.customStrengthOptions.containsLowercaseLetter=e.containsLowercaseCharacter),void 0!==e.containsUppercaseCharacter&&(this.customStrengthOptions.containsUppercaseLetter=e.containsUppercaseCharacter),void 0!==e.containsNumericCharacter&&(this.customStrengthOptions.containsNumericCharacter=e.containsNumericCharacter),void 0!==e.containsNonAlphanumericCharacter&&(this.customStrengthOptions.containsNonAlphanumericCharacter=e.containsNonAlphanumericCharacter),this.enforcementState=t.enforcementState,"ENFORCEMENT_STATE_UNSPECIFIED"===this.enforcementState&&(this.enforcementState="OFF"),this.allowedNonAlphanumericCharacters=t.allowedNonAlphanumericCharacters?.join("")??"",this.forceUpgradeOnSignin=t.forceUpgradeOnSignin??!1,this.schemaVersion=t.schemaVersion}validatePassword(t){const e={isValid:!0,passwordPolicy:this};return this.validatePasswordLengthOptions(t,e),this.validatePasswordCharacterOptions(t,e),e.isValid&&(e.isValid=e.meetsMinPasswordLength??!0),e.isValid&&(e.isValid=e.meetsMaxPasswordLength??!0),e.isValid&&(e.isValid=e.containsLowercaseLetter??!0),e.isValid&&(e.isValid=e.containsUppercaseLetter??!0),e.isValid&&(e.isValid=e.containsNumericCharacter??!0),e.isValid&&(e.isValid=e.containsNonAlphanumericCharacter??!0),e}validatePasswordLengthOptions(t,e){const n=this.customStrengthOptions.minPasswordLength,s=this.customStrengthOptions.maxPasswordLength;n&&(e.meetsMinPasswordLength=t.length>=n),s&&(e.meetsMaxPasswordLength=t.length<=s)}validatePasswordCharacterOptions(t,e){let n;this.updatePasswordCharacterOptionsStatuses(e,!1,!1,!1,!1);for(let s=0;s<t.length;s++)n=t.charAt(s),this.updatePasswordCharacterOptionsStatuses(e,n>="a"&&n<="z",n>="A"&&n<="Z",n>="0"&&n<="9",this.allowedNonAlphanumericCharacters.includes(n))}updatePasswordCharacterOptionsStatuses(t,e,n,s,r){this.customStrengthOptions.containsLowercaseLetter&&(t.containsLowercaseLetter||(t.containsLowercaseLetter=e)),this.customStrengthOptions.containsUppercaseLetter&&(t.containsUppercaseLetter||(t.containsUppercaseLetter=n)),this.customStrengthOptions.containsNumericCharacter&&(t.containsNumericCharacter||(t.containsNumericCharacter=s)),this.customStrengthOptions.containsNonAlphanumericCharacter&&(t.containsNonAlphanumericCharacter||(t.containsNonAlphanumericCharacter=r))}}class Vi{constructor(t,e,n,s){this.app=t,this.heartbeatServiceProvider=e,this.appCheckServiceProvider=n,this.config=s,this.currentUser=null,this.emulatorConfig=null,this.operations=Promise.resolve(),this.authStateSubscription=new $i(this),this.idTokenSubscription=new $i(this),this.beforeStateQueue=new Hi(this),this.redirectUser=null,this.isProactiveRefreshEnabled=!1,this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION=1,this._canInitEmulator=!0,this._isInitialized=!1,this._deleted=!1,this._initializationPromise=null,this._popupRedirectResolver=null,this._errorFactory=Rr,this._agentRecaptchaConfig=null,this._tenantRecaptchaConfigs={},this._projectPasswordPolicy=null,this._tenantPasswordPolicies={},this._resolvePersistenceManagerAvailable=void 0,this.lastNotifiedUid=void 0,this.languageCode=null,this.tenantId=null,this.settings={appVerificationDisabledForTesting:!1},this.frameworks=[],this.name=t.name,this.clientVersion=s.sdkClientVersion,this._persistenceManagerAvailable=new Promise(t=>this._resolvePersistenceManagerAvailable=t)}_initializeWithPersistence(t,e){return e&&(this._popupRedirectResolver=_i(e)),this._initializationPromise=this.queue(async()=>{if(!this._deleted){try{this.persistenceManager=await Ti.create(this,t)}catch(t){xr(`Failed to initialize persistence: ${t}`),this.persistenceManager=await Ti.create(this,[])}finally{this._resolvePersistenceManagerAvailable?.()}if(!this._deleted){if(this._popupRedirectResolver?._shouldInitProactively)try{await this._popupRedirectResolver._initialize(this)}catch(t){}try{await this.initializeCurrentUser(e)}catch(t){xr(`Failed to initialize current user: ${t}`),await this.directlySetCurrentUser(null).catch(()=>{})}this.lastNotifiedUid=this.currentUser?.uid||null,this._deleted||(this._isInitialized=!0)}}}),this._initializationPromise}async _onStorageEvent(){if(this._deleted)return;const t=await this.assertedPersistence.getCurrentUser();return this.currentUser||t?this.currentUser&&t&&this.currentUser.uid===t.uid?(this._currentUser._assign(t),void await this.currentUser.getIdToken()):void await this._updateCurrentUser(t,!0):void 0}async initializeCurrentUserFromIdToken(t){try{const e=await ci(this,{idToken:t}),n=await Ei._fromGetAccountInfoResponse(this,e,t);await this.directlySetCurrentUser(n)}catch(t){await this.directlySetCurrentUser(null)}}async initializeCurrentUser(t){if(hr(this.app)){const t=this.app.settings.authIdToken;return t?new Promise(e=>{setTimeout(()=>this.initializeCurrentUserFromIdToken(t).then(e,e))}):this.directlySetCurrentUser(null)}const e=await this.assertedPersistence.getCurrentUser();let n=e,s=!1;if(t&&this.config.authDomain){await this.getOrInitRedirectPersistenceManager();const e=this.redirectUser?._redirectEventId,r=n?._redirectEventId,i=await this.tryRedirectSignIn(t);e&&e!==r||!i?.user||(n=i.user,s=!0)}if(!n)return this.directlySetCurrentUser(null);if(!n._redirectEventId){if(s)try{await this.beforeStateQueue.runMiddleware(n)}catch(t){n=e,this._popupRedirectResolver._overrideRedirectResult(this,()=>Promise.reject(t))}return n?this.reloadAndSetCurrentUserOrClear(n):this.directlySetCurrentUser(null)}return Ur(this._popupRedirectResolver,this,"argument-error"),await this.getOrInitRedirectPersistenceManager(),this.redirectUser&&this.redirectUser._redirectEventId===n._redirectEventId?this.directlySetCurrentUser(n):this.reloadAndSetCurrentUserOrClear(n)}async tryRedirectSignIn(t){let e=null;try{e=await this._popupRedirectResolver._completeRedirectFn(this,t,!0)}catch(t){await this._setRedirectUser(null)}return e}async reloadAndSetCurrentUserOrClear(t){try{await gi(t)}catch(t){if("auth/network-request-failed"!==t?.code)return this.directlySetCurrentUser(null)}return this.directlySetCurrentUser(t)}useDeviceLanguage(){this.languageCode=function(){if("undefined"==typeof navigator)return null;const t=navigator;return t.languages&&t.languages[0]||t.language||null}()}async _delete(){this._deleted=!0}async updateCurrentUser(t){if(hr(this.app))return Promise.reject(Mr(this));const e=t?Xn(t):null;return e&&Ur(e.auth.config.apiKey===this.config.apiKey,this,"invalid-user-token"),this._updateCurrentUser(e&&e._clone(this))}async _updateCurrentUser(t,e=!1){if(!this._deleted)return t&&Ur(this.tenantId===t.tenantId,this,"tenant-id-mismatch"),e||await this.beforeStateQueue.runMiddleware(t),this.queue(async()=>{await this.directlySetCurrentUser(t),this.notifyAuthListeners()})}async signOut(){return hr(this.app)?Promise.reject(Mr(this)):(await this.beforeStateQueue.runMiddleware(null),(this.redirectPersistenceManager||this._popupRedirectResolver)&&await this._setRedirectUser(null),this._updateCurrentUser(null,!0))}setPersistence(t){return hr(this.app)?Promise.reject(Mr(this)):this.queue(async()=>{await this.assertedPersistence.setPersistence(_i(t))})}_getRecaptchaConfig(){return null==this.tenantId?this._agentRecaptchaConfig:this._tenantRecaptchaConfigs[this.tenantId]}async validatePassword(t){this._getPasswordPolicyInternal()||await this._updatePasswordPolicy();const e=this._getPasswordPolicyInternal();return e.schemaVersion!==this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION?Promise.reject(this._errorFactory.create("unsupported-password-policy-schema-version",{})):e.validatePassword(t)}_getPasswordPolicyInternal(){return null===this.tenantId?this._projectPasswordPolicy:this._tenantPasswordPolicies[this.tenantId]}async _updatePasswordPolicy(){const t=await async function(t,e={}){return ti(t,"GET","/v2/passwordPolicy",Zr(t,e))}(this),e=new Ui(t);null===this.tenantId?this._projectPasswordPolicy=e:this._tenantPasswordPolicies[this.tenantId]=e}_getPersistenceType(){return this.assertedPersistence.persistence.type}_getPersistence(){return this.assertedPersistence.persistence}_updateErrorMap(t){this._errorFactory=new jn("auth","Firebase",t())}onAuthStateChanged(t,e,n){return this.registerStateListener(this.authStateSubscription,t,e,n)}beforeAuthStateChanged(t,e){return this.beforeStateQueue.pushCallback(t,e)}onIdTokenChanged(t,e,n){return this.registerStateListener(this.idTokenSubscription,t,e,n)}authStateReady(){return new Promise((t,e)=>{if(this.currentUser)t();else{const n=this.onAuthStateChanged(()=>{n(),t()},e)}})}async revokeAccessToken(t){if(this.currentUser){const e={providerId:"apple.com",tokenType:"ACCESS_TOKEN",token:t,idToken:await this.currentUser.getIdToken()};null!=this.tenantId&&(e.tenantId=this.tenantId),await async function(t,e){return ti(t,"POST","/v2/accounts:revokeToken",Zr(t,e))}(this,e)}}toJSON(){return{apiKey:this.config.apiKey,authDomain:this.config.authDomain,appName:this.name,currentUser:this._currentUser?.toJSON()}}async _setRedirectUser(t,e){const n=await this.getOrInitRedirectPersistenceManager(e);return null===t?n.removeCurrentUser():n.setCurrentUser(t)}async getOrInitRedirectPersistenceManager(t){if(!this.redirectPersistenceManager){const e=t&&_i(t)||this._popupRedirectResolver;Ur(e,this,"argument-error"),this.redirectPersistenceManager=await Ti.create(this,[_i(e._redirectPersistence)],"redirectUser"),this.redirectUser=await this.redirectPersistenceManager.getCurrentUser()}return this.redirectPersistenceManager}async _redirectUserForId(t){return this._isInitialized&&await this.queue(async()=>{}),this._currentUser?._redirectEventId===t?this._currentUser:this.redirectUser?._redirectEventId===t?this.redirectUser:null}async _persistUserIfCurrent(t){if(t===this.currentUser)return this.queue(async()=>this.directlySetCurrentUser(t))}_notifyListenersIfCurrent(t){t===this.currentUser&&this.notifyAuthListeners()}_key(){return`${this.config.authDomain}:${this.config.apiKey}:${this.name}`}_startProactiveRefresh(){this.isProactiveRefreshEnabled=!0,this.currentUser&&this._currentUser._startProactiveRefresh()}_stopProactiveRefresh(){this.isProactiveRefreshEnabled=!1,this.currentUser&&this._currentUser._stopProactiveRefresh()}get _currentUser(){return this.currentUser}notifyAuthListeners(){if(!this._isInitialized)return;this.idTokenSubscription.next(this.currentUser);const t=this.currentUser?.uid??null;this.lastNotifiedUid!==t&&(this.lastNotifiedUid=t,this.authStateSubscription.next(this.currentUser))}registerStateListener(t,e,n,s){if(this._deleted)return()=>{};const r="function"==typeof e?e:e.next.bind(e);let i=!1;const o=this._isInitialized?Promise.resolve():this._initializationPromise;if(Ur(o,this,"internal-error"),o.then(()=>{i||r(this.currentUser)}).catch(t=>{if(!i)if("function"!=typeof e&&e.error)e.error(t);else{if(!n)throw t;n(t)}}),"function"==typeof e){const r=t.addObserver(e,n,s);return()=>{i=!0,r()}}{const n=t.addObserver(e);return()=>{i=!0,n()}}}async directlySetCurrentUser(t){if(this.currentUser&&this.currentUser!==t&&this._currentUser._stopProactiveRefresh(),t&&this.isProactiveRefreshEnabled&&t._startProactiveRefresh(),this.currentUser=t,this.persistenceManager)try{t?await this.persistenceManager.setCurrentUser(t):await this.persistenceManager.removeCurrentUser()}catch(t){const e=Pr(this,"internal-error",`An internal AuthError has occurred: ${t?.message||String(t)}`);throw e.customData={originalError:t},e}}queue(t){return this.operations=this.operations.then(t,t),this.operations}get assertedPersistence(){return Ur(this.persistenceManager,this,"internal-error"),this.persistenceManager}_logFramework(t){t&&!this.frameworks.includes(t)&&(this.frameworks.push(t),this.frameworks.sort(),this.clientVersion=Gi(this.config.clientPlatform,this._getFrameworks()))}_getFrameworks(){return this.frameworks}async _getAdditionalHeaders(){const t={"X-Client-Version":this.clientVersion};this.app.options.appId&&(t["X-Firebase-gmpid"]=this.app.options.appId);const e=await(this.heartbeatServiceProvider.getImmediate({optional:!0})?.getHeartbeatsHeader());e&&(t["X-Firebase-Client"]=e);const n=await this._getAppCheckToken();return n&&(t["X-Firebase-AppCheck"]=n),t}async _getAppCheckToken(){if(hr(this.app)&&this.app.settings.appCheckToken)return this.app.settings.appCheckToken;const t=await(this.appCheckServiceProvider.getImmediate({optional:!0})?.getToken());return t?.error&&xr(`Error while retrieving App Check token: ${t.error}`),t?.token}}function ji(t){return Xn(t)}class $i{constructor(t){this.auth=t,this.observer=null,this.addObserver=function(t,e){const n=new Qn(t,e);return n.subscribe.bind(n)}(t=>this.observer=t)}get next(){return Ur(this.observer,this.auth,"internal-error"),this.observer.next.bind(this.observer)}}let Ji={async loadJS(){throw new Error("Unable to load external scripts")},recaptchaV2Script:"",recaptchaEnterpriseScript:"",gapiScript:""};function qi(t){return Ji.loadJS(t)}class zi{constructor(){this.enterprise=new Ki}ready(t){t()}execute(t,e){return Promise.resolve("token")}render(t,e){return""}}class Ki{ready(t){t()}execute(t,e){return Promise.resolve("token")}render(t,e){return""}}const Qi="NO_RECAPTCHA",Wi="onFirebaseAuthREInstanceReady";class Yi{constructor(t){this.type="recaptcha-enterprise",this.auth=ji(t)}async verify(t="verify",e=!1){async function n(t){if(!e){if(null==t.tenantId&&null!=t._agentRecaptchaConfig)return t._agentRecaptchaConfig.siteKey;if(null!=t.tenantId&&void 0!==t._tenantRecaptchaConfigs[t.tenantId])return t._tenantRecaptchaConfigs[t.tenantId].siteKey}return new Promise(async(e,n)=>{(async function(t,e){return ti(t,"GET","/v2/recaptchaConfig",Zr(t,e))})(t,{clientType:"CLIENT_TYPE_WEB",version:"RECAPTCHA_ENTERPRISE"}).then(s=>{if(void 0!==s.recaptchaKey){const n=new Bi(s);return null==t.tenantId?t._agentRecaptchaConfig=n:t._tenantRecaptchaConfigs[t.tenantId]=n,e(n.siteKey)}n(new Error("recaptcha Enterprise site key undefined"))}).catch(t=>{n(t)})})}function s(e,n,s){const r=window.grecaptcha;ai(r)?r.enterprise.ready(()=>{r.enterprise.execute(e,{action:t}).then(t=>{n(t)}).catch(()=>{n(Qi)})}):s(Error("No reCAPTCHA enterprise script loaded."))}if(this.auth.settings.appVerificationDisabledForTesting){return(new zi).execute("siteKey",{action:"verify"})}return new Promise((t,r)=>{n(this.auth).then(async n=>{if(!e&&ai(window.grecaptcha)&&Yi.scriptInjectionDeferred)await Yi.scriptInjectionDeferred.promise,s(n,t,r);else{if("undefined"==typeof window)return void r(new Error("RecaptchaVerifier is only supported in browser"));let e=Ji.recaptchaEnterpriseScript;0!==e.length&&(e+=n+`&onload=${Wi}`),Yi.scriptInjectionDeferred=new kn,window[Wi]=()=>{Yi.scriptInjectionDeferred?.resolve()},qi(e).then(()=>Yi.scriptInjectionDeferred?.promise).then(()=>{s(n,t,r)}).catch(t=>{r(t)})}}).catch(t=>{r(t)})})}}async function Xi(t,e,n,s=!1,r=!1){const i=new Yi(t);let o;if(r)o=Qi;else try{o=await i.verify(n)}catch(t){o=await i.verify(n,!0)}const a={...e};if("mfaSmsEnrollment"===n||"mfaSmsSignIn"===n){if("phoneEnrollmentInfo"in a){const t=a.phoneEnrollmentInfo.phoneNumber,e=a.phoneEnrollmentInfo.recaptchaToken;Object.assign(a,{phoneEnrollmentInfo:{phoneNumber:t,recaptchaToken:e,captchaResponse:o,clientType:"CLIENT_TYPE_WEB",recaptchaVersion:"RECAPTCHA_ENTERPRISE"}})}else if("phoneSignInInfo"in a){const t=a.phoneSignInInfo.recaptchaToken;Object.assign(a,{phoneSignInInfo:{recaptchaToken:t,captchaResponse:o,clientType:"CLIENT_TYPE_WEB",recaptchaVersion:"RECAPTCHA_ENTERPRISE"}})}return a}return s?Object.assign(a,{captchaResp:o}):Object.assign(a,{captchaResponse:o}),Object.assign(a,{clientType:"CLIENT_TYPE_WEB"}),Object.assign(a,{recaptchaVersion:"RECAPTCHA_ENTERPRISE"}),a}async function Zi(t,e,n,s,r){if(t._getRecaptchaConfig()?.isProviderEnabled("EMAIL_PASSWORD_PROVIDER")){const r=await Xi(t,e,n,"getOobCode"===n);return s(t,r)}return s(t,e).catch(async r=>{if("auth/missing-recaptcha-token"===r.code){const r=await Xi(t,e,n,"getOobCode"===n);return s(t,r)}return Promise.reject(r)})}function to(t,e,n){const s=ji(t);Ur(/^https?:\/\//.test(e),s,"invalid-emulator-scheme");const r=eo(e),{host:i,port:o}=function(t){const e=eo(t),n=/(\/\/)?([^?#/]+)/.exec(t.substr(e.length));if(!n)return{host:"",port:null};const s=n[2].split("@").pop()||"",r=/^(\[[^\]]+\])(:|$)/.exec(s);if(r){const t=r[1];return{host:t,port:no(s.substr(t.length+1))}}{const[t,e]=s.split(":");return{host:t,port:no(e)}}}(e),a=null===o?"":`:${o}`,B={url:`${r}//${i}${a}/`},c=Object.freeze({host:i,port:o,protocol:r.replace(":",""),options:Object.freeze({disableWarnings:!1})});if(!s._canInitEmulator)return Ur(s.config.emulator&&s.emulatorConfig,s,"emulator-config-failed"),void Ur($n(B,s.config.emulator)&&$n(c,s.emulatorConfig),s,"emulator-config-failed");s.config.emulator=B,s.emulatorConfig=c,s.settings.appVerificationDisabledForTesting=!0,Zn(i)?ts(`${r}//${i}${a}`):function(){function t(){const t=document.createElement("p"),e=t.style;t.innerText="Running in emulator mode. Do not use with production credentials.",e.position="fixed",e.width="100%",e.backgroundColor="#ffffff",e.border=".1em solid #000000",e.color="#b50000",e.bottom="0px",e.left="0px",e.margin="0px",e.zIndex="10000",e.textAlign="center",t.classList.add("firebase-emulator-warning"),document.body.appendChild(t)}"undefined"!=typeof console&&console.info;"undefined"!=typeof window&&"undefined"!=typeof document&&("loading"===document.readyState?window.addEventListener("DOMContentLoaded",t):t())}()}function eo(t){const e=t.indexOf(":");return e<0?"":t.substr(0,e+1)}function no(t){if(!t)return null;const e=Number(t);return isNaN(e)?null:e}Yi.scriptInjectionDeferred=null;class so{constructor(t,e){this.providerId=t,this.signInMethod=e}toJSON(){return Vr("not implemented")}_getIdTokenResponse(t){return Vr("not implemented")}_linkToIdToken(t,e){return Vr("not implemented")}_getReauthenticationResolver(t){return Vr("not implemented")}}async function ro(t,e){return ti(t,"POST","/v1/accounts:signUp",e)}async function io(t,e){return ni(t,"POST","/v1/accounts:signInWithPassword",Zr(t,e))}async function oo(t,e){return ti(t,"POST","/v1/accounts:sendOobCode",Zr(t,e))}async function ao(t,e){return oo(t,e)}class Bo extends so{constructor(t,e,n,s=null){super("password",n),this._email=t,this._password=e,this._tenantId=s}static _fromEmailAndPassword(t,e){return new Bo(t,e,"password")}static _fromEmailAndCode(t,e,n=null){return new Bo(t,e,"emailLink",n)}toJSON(){return{email:this._email,password:this._password,signInMethod:this.signInMethod,tenantId:this._tenantId}}static fromJSON(t){const e="string"==typeof t?JSON.parse(t):t;if(e?.email&&e?.password){if("password"===e.signInMethod)return this._fromEmailAndPassword(e.email,e.password);if("emailLink"===e.signInMethod)return this._fromEmailAndCode(e.email,e.password,e.tenantId)}return null}async _getIdTokenResponse(t){switch(this.signInMethod){case"password":return Zi(t,{returnSecureToken:!0,email:this._email,password:this._password,clientType:"CLIENT_TYPE_WEB"},"signInWithPassword",io);case"emailLink":return async function(t,e){return ni(t,"POST","/v1/accounts:signInWithEmailLink",Zr(t,e))}(t,{email:this._email,oobCode:this._password});default:Lr(t,"internal-error")}}async _linkToIdToken(t,e){switch(this.signInMethod){case"password":return Zi(t,{idToken:e,returnSecureToken:!0,email:this._email,password:this._password,clientType:"CLIENT_TYPE_WEB"},"signUpPassword",ro);case"emailLink":return async function(t,e){return ni(t,"POST","/v1/accounts:signInWithEmailLink",Zr(t,e))}(t,{idToken:e,email:this._email,oobCode:this._password});default:Lr(t,"internal-error")}}_getReauthenticationResolver(t){return this._getIdTokenResponse(t)}}async function co(t,e){return ni(t,"POST","/v1/accounts:signInWithIdp",Zr(t,e))}class lo extends so{constructor(){super(...arguments),this.pendingToken=null}static _fromParams(t){const e=new lo(t.providerId,t.signInMethod);return t.idToken||t.accessToken?(t.idToken&&(e.idToken=t.idToken),t.accessToken&&(e.accessToken=t.accessToken),t.nonce&&!t.pendingToken&&(e.nonce=t.nonce),t.pendingToken&&(e.pendingToken=t.pendingToken)):t.oauthToken&&t.oauthTokenSecret?(e.accessToken=t.oauthToken,e.secret=t.oauthTokenSecret):Lr("argument-error"),e}toJSON(){return{idToken:this.idToken,accessToken:this.accessToken,secret:this.secret,nonce:this.nonce,pendingToken:this.pendingToken,providerId:this.providerId,signInMethod:this.signInMethod}}static fromJSON(t){const e="string"==typeof t?JSON.parse(t):t,{providerId:n,signInMethod:s,...r}=e;if(!n||!s)return null;const i=new lo(n,s);return i.idToken=r.idToken||void 0,i.accessToken=r.accessToken||void 0,i.secret=r.secret,i.nonce=r.nonce,i.pendingToken=r.pendingToken||null,i}_getIdTokenResponse(t){return co(t,this.buildRequest())}_linkToIdToken(t,e){const n=this.buildRequest();return n.idToken=e,co(t,n)}_getReauthenticationResolver(t){const e=this.buildRequest();return e.autoCreate=!1,co(t,e)}buildRequest(){const t={requestUri:"http://localhost",returnSecureToken:!0};if(this.pendingToken)t.pendingToken=this.pendingToken;else{const e={};this.idToken&&(e.id_token=this.idToken),this.accessToken&&(e.access_token=this.accessToken),this.secret&&(e.oauth_token_secret=this.secret),e.providerId=this.providerId,this.nonce&&!this.pendingToken&&(e.nonce=this.nonce),t.postBody=qn(e)}return t}}class uo{constructor(t){const e=zn(Kn(t)),n=e.apiKey??null,s=e.oobCode??null,r=function(t){switch(t){case"recoverEmail":return"RECOVER_EMAIL";case"resetPassword":return"PASSWORD_RESET";case"signIn":return"EMAIL_SIGNIN";case"verifyEmail":return"VERIFY_EMAIL";case"verifyAndChangeEmail":return"VERIFY_AND_CHANGE_EMAIL";case"revertSecondFactorAddition":return"REVERT_SECOND_FACTOR_ADDITION";default:return null}}(e.mode??null);Ur(n&&s&&r,"argument-error"),this.apiKey=n,this.operation=r,this.code=s,this.continueUrl=e.continueUrl??null,this.languageCode=e.lang??null,this.tenantId=e.tenantId??null}static parseLink(t){const e=function(t){const e=zn(Kn(t)).link,n=e?zn(Kn(e)).deep_link_id:null,s=zn(Kn(t)).deep_link_id;return(s?zn(Kn(s)).link:null)||s||n||e||t}(t);try{return new uo(e)}catch{return null}}}class ho{constructor(){this.providerId=ho.PROVIDER_ID}static credential(t,e){return Bo._fromEmailAndPassword(t,e)}static credentialWithLink(t,e){const n=uo.parseLink(e);return Ur(n,"argument-error"),Bo._fromEmailAndCode(t,n.code,n.tenantId)}}ho.PROVIDER_ID="password",ho.EMAIL_PASSWORD_SIGN_IN_METHOD="password",ho.EMAIL_LINK_SIGN_IN_METHOD="emailLink";class po{constructor(t){this.providerId=t,this.defaultLanguageCode=null,this.customParameters={}}setDefaultLanguage(t){this.defaultLanguageCode=t}setCustomParameters(t){return this.customParameters=t,this}getCustomParameters(){return this.customParameters}}class fo extends po{constructor(){super(...arguments),this.scopes=[]}addScope(t){return this.scopes.includes(t)||this.scopes.push(t),this}getScopes(){return[...this.scopes]}}class Co extends fo{constructor(){super("facebook.com")}static credential(t){return lo._fromParams({providerId:Co.PROVIDER_ID,signInMethod:Co.FACEBOOK_SIGN_IN_METHOD,accessToken:t})}static credentialFromResult(t){return Co.credentialFromTaggedObject(t)}static credentialFromError(t){return Co.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t||!("oauthAccessToken"in t))return null;if(!t.oauthAccessToken)return null;try{return Co.credential(t.oauthAccessToken)}catch{return null}}}Co.FACEBOOK_SIGN_IN_METHOD="facebook.com",Co.PROVIDER_ID="facebook.com";class go extends fo{constructor(){super("google.com"),this.addScope("profile")}static credential(t,e){return lo._fromParams({providerId:go.PROVIDER_ID,signInMethod:go.GOOGLE_SIGN_IN_METHOD,idToken:t,accessToken:e})}static credentialFromResult(t){return go.credentialFromTaggedObject(t)}static credentialFromError(t){return go.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t)return null;const{oauthIdToken:e,oauthAccessToken:n}=t;if(!e&&!n)return null;try{return go.credential(e,n)}catch{return null}}}go.GOOGLE_SIGN_IN_METHOD="google.com",go.PROVIDER_ID="google.com";class mo extends fo{constructor(){super("github.com")}static credential(t){return lo._fromParams({providerId:mo.PROVIDER_ID,signInMethod:mo.GITHUB_SIGN_IN_METHOD,accessToken:t})}static credentialFromResult(t){return mo.credentialFromTaggedObject(t)}static credentialFromError(t){return mo.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t||!("oauthAccessToken"in t))return null;if(!t.oauthAccessToken)return null;try{return mo.credential(t.oauthAccessToken)}catch{return null}}}mo.GITHUB_SIGN_IN_METHOD="github.com",mo.PROVIDER_ID="github.com";class wo extends fo{constructor(){super("twitter.com")}static credential(t,e){return lo._fromParams({providerId:wo.PROVIDER_ID,signInMethod:wo.TWITTER_SIGN_IN_METHOD,oauthToken:t,oauthTokenSecret:e})}static credentialFromResult(t){return wo.credentialFromTaggedObject(t)}static credentialFromError(t){return wo.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t)return null;const{oauthAccessToken:e,oauthTokenSecret:n}=t;if(!e||!n)return null;try{return wo.credential(e,n)}catch{return null}}}async function yo(t,e){return ni(t,"POST","/v1/accounts:signUp",Zr(t,e))}wo.TWITTER_SIGN_IN_METHOD="twitter.com",wo.PROVIDER_ID="twitter.com";class Eo{constructor(t){this.user=t.user,this.providerId=t.providerId,this._tokenResponse=t._tokenResponse,this.operationType=t.operationType}static async _fromIdTokenResponse(t,e,n,s=!1){const r=await Ei._fromIdTokenResponse(t,n,s),i=Do(n);return new Eo({user:r,providerId:i,_tokenResponse:n,operationType:e})}static async _forOperation(t,e,n){await t._updateTokensIfNecessary(n,!0);const s=Do(n);return new Eo({user:t,providerId:s,_tokenResponse:n,operationType:e})}}function Do(t){return t.providerId?t.providerId:"phoneNumber"in t?"phone":null}class _o extends Vn{constructor(t,e,n,s){super(e.code,e.message),this.operationType=n,this.user=s,Object.setPrototypeOf(this,_o.prototype),this.customData={appName:t.name,tenantId:t.tenantId??void 0,_serverResponse:e.customData._serverResponse,operationType:n}}static _fromErrorAndOperation(t,e,n,s){return new _o(t,e,n,s)}}function bo(t,e,n,s){return("reauthenticate"===e?n._getReauthenticationResolver(t):n._getIdTokenResponse(t)).catch(n=>{if("auth/multi-factor-auth-required"===n.code)throw _o._fromErrorAndOperation(t,n,e,s);throw n})}async function vo(t,e,n=!1){const{auth:s}=t;if(hr(s.app))return Promise.reject(Mr(s));const r="reauthenticate";try{const i=await pi(t,bo(s,r,e,t),n);Ur(i.idToken,s,"internal-error");const o=hi(i.idToken);Ur(o,s,"internal-error");const{sub:a}=o;return Ur(t.uid===a,s,"user-mismatch"),Eo._forOperation(t,r,i)}catch(t){throw"auth/user-not-found"===t?.code&&Lr(s,"user-mismatch"),t}}async function Io(t,e,n=!1){if(hr(t.app))return Promise.reject(Mr(t));const s="signIn",r=await bo(t,s,e),i=await Eo._fromIdTokenResponse(t,s,r);return n||await t._updateCurrentUser(i.user),i}function To(t,e,n){Ur(n.url?.length>0,t,"invalid-continue-uri"),Ur(void 0===n.dynamicLinkDomain||n.dynamicLinkDomain.length>0,t,"invalid-dynamic-link-domain"),Ur(void 0===n.linkDomain||n.linkDomain.length>0,t,"invalid-hosting-link-domain"),e.continueUrl=n.url,e.dynamicLinkDomain=n.dynamicLinkDomain,e.linkDomain=n.linkDomain,e.canHandleCodeInApp=n.handleCodeInApp,n.iOS&&(Ur(n.iOS.bundleId.length>0,t,"missing-ios-bundle-id"),e.iOSBundleId=n.iOS.bundleId),n.android&&(Ur(n.android.packageName.length>0,t,"missing-android-pkg-name"),e.androidInstallApp=n.android.installApp,e.androidMinimumVersionCode=n.android.minimumVersion,e.androidPackageName=n.android.packageName)}async function Oo(t){const e=ji(t);e._getPasswordPolicyInternal()&&await e._updatePasswordPolicy()}async function Ao(t,e,n){const s=ji(t),r={requestType:"PASSWORD_RESET",email:e,clientType:"CLIENT_TYPE_WEB"};await Zi(s,r,"getOobCode",ao)}function So(t,e,n){return hr(t.app)?Promise.reject(Mr(t)):async function(t,e){return Io(ji(t),e)}(Xn(t),ho.credential(e,n)).catch(async e=>{throw"auth/password-does-not-meet-requirements"===e.code&&Oo(t),e})}async function Ro(t,e){const n=Xn(t),s={requestType:"VERIFY_EMAIL",idToken:await t.getIdToken()};e&&To(n.auth,s,e);const{email:r}=await async function(t,e){return oo(t,e)}(n.auth,s);r!==t.email&&await t.reload()}async function No(t,e,n){const s=Xn(t),r={requestType:"VERIFY_AND_CHANGE_EMAIL",idToken:await t.getIdToken(),newEmail:e};n&&To(s.auth,r,n);const{email:i}=await async function(t,e){return oo(t,e)}(s.auth,r);i!==t.email&&await t.reload()}async function xo(t,e){const{displayName:n,photoURL:s}=e;if(void 0===n&&void 0===s)return;const r=Xn(t),i={idToken:await r.getIdToken(),displayName:n,photoUrl:s,returnSecureToken:!0},o=await pi(r,async function(t,e){return ti(t,"POST","/v1/accounts:update",e)}(r.auth,i));r.displayName=o.displayName||null,r.photoURL=o.photoUrl||null;const a=r.providerData.find(({providerId:t})=>"password"===t);a&&(a.displayName=r.displayName,a.photoURL=r.photoURL),await r._updateTokensIfNecessary(o)}function ko(t,e){return async function(t,e,n){const{auth:s}=t,r=await t.getIdToken(),i={idToken:r,returnSecureToken:!0};n&&(i.password=n);const o=await pi(t,async function(t,e){return ti(t,"POST","/v1/accounts:update",e)}(s,i));await t._updateTokensIfNecessary(o,!0)}(Xn(t),0,e)}function Lo(t,e,n,s){return Xn(t).onAuthStateChanged(e,n,s)}const Fo="__sak";class Po{constructor(t,e){this.storageRetriever=t,this.type=e}_isAvailable(){try{return this.storage?(this.storage.setItem(Fo,"1"),this.storage.removeItem(Fo),Promise.resolve(!0)):Promise.resolve(!1)}catch{return Promise.resolve(!1)}}_set(t,e){return this.storage.setItem(t,JSON.stringify(e)),Promise.resolve()}_get(t){const e=this.storage.getItem(t);return Promise.resolve(e?JSON.parse(e):null)}_remove(t){return this.storage.removeItem(t),Promise.resolve()}get storage(){return this.storageRetriever()}}class Mo extends Po{constructor(){super(()=>window.localStorage,"LOCAL"),this.boundEventHandler=(t,e)=>this.onStorageEvent(t,e),this.listeners={},this.localCache={},this.pollTimer=null,this.fallbackToPolling=Mi(),this._shouldAllowMigration=!0}forAllChangedKeys(t){for(const e of Object.keys(this.listeners)){const n=this.storage.getItem(e),s=this.localCache[e];n!==s&&t(e,s,n)}}onStorageEvent(t,e=!1){if(!t.key)return void this.forAllChangedKeys((t,e,n)=>{this.notifyListeners(t,n)});const n=t.key;e?this.detachListener():this.stopPolling();const s=()=>{const t=this.storage.getItem(n);(e||this.localCache[n]!==t)&&this.notifyListeners(n,t)},r=this.storage.getItem(n);Pi()&&r!==t.newValue&&t.newValue!==t.oldValue?setTimeout(s,10):s()}notifyListeners(t,e){this.localCache[t]=e;const n=this.listeners[t];if(n)for(const t of Array.from(n))t(e?JSON.parse(e):e)}startPolling(){this.stopPolling(),this.pollTimer=setInterval(()=>{this.forAllChangedKeys((t,e,n)=>{this.onStorageEvent(new StorageEvent("storage",{key:t,oldValue:e,newValue:n}),!0)})},1e3)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}attachListener(){window.addEventListener("storage",this.boundEventHandler)}detachListener(){window.removeEventListener("storage",this.boundEventHandler)}_addListener(t,e){0===Object.keys(this.listeners).length&&(this.fallbackToPolling?this.startPolling():this.attachListener()),this.listeners[t]||(this.listeners[t]=new Set,this.localCache[t]=this.storage.getItem(t)),this.listeners[t].add(e)}_removeListener(t,e){this.listeners[t]&&(this.listeners[t].delete(e),0===this.listeners[t].size&&delete this.listeners[t]),0===Object.keys(this.listeners).length&&(this.detachListener(),this.stopPolling())}async _set(t,e){await super._set(t,e),this.localCache[t]=JSON.stringify(e)}async _get(t){const e=await super._get(t);return this.localCache[t]=JSON.stringify(e),e}async _remove(t){await super._remove(t),delete this.localCache[t]}}Mo.type="LOCAL";const Go=Mo;class Ho extends Po{constructor(){super(()=>window.sessionStorage,"SESSION")}_addListener(t,e){}_removeListener(t,e){}}Ho.type="SESSION";const Uo=Ho;class Vo{constructor(t){this.eventTarget=t,this.handlersMap={},this.boundEventHandler=this.handleEvent.bind(this)}static _getInstance(t){const e=this.receivers.find(e=>e.isListeningto(t));if(e)return e;const n=new Vo(t);return this.receivers.push(n),n}isListeningto(t){return this.eventTarget===t}async handleEvent(t){const e=t,{eventId:n,eventType:s,data:r}=e.data,i=this.handlersMap[s];if(!i?.size)return;e.ports[0].postMessage({status:"ack",eventId:n,eventType:s});const o=Array.from(i).map(async t=>t(e.origin,r)),a=await function(t){return Promise.all(t.map(async t=>{try{return{fulfilled:!0,value:await t}}catch(t){return{fulfilled:!1,reason:t}}}))}(o);e.ports[0].postMessage({status:"done",eventId:n,eventType:s,response:a})}_subscribe(t,e){0===Object.keys(this.handlersMap).length&&this.eventTarget.addEventListener("message",this.boundEventHandler),this.handlersMap[t]||(this.handlersMap[t]=new Set),this.handlersMap[t].add(e)}_unsubscribe(t,e){this.handlersMap[t]&&e&&this.handlersMap[t].delete(e),e&&0!==this.handlersMap[t].size||delete this.handlersMap[t],0===Object.keys(this.handlersMap).length&&this.eventTarget.removeEventListener("message",this.boundEventHandler)}}function jo(t="",e=10){let n="";for(let t=0;t<e;t++)n+=Math.floor(10*Math.random());return t+n}Vo.receivers=[];class $o{constructor(t){this.target=t,this.handlers=new Set}removeMessageHandler(t){t.messageChannel&&(t.messageChannel.port1.removeEventListener("message",t.onMessage),t.messageChannel.port1.close()),this.handlers.delete(t)}async _send(t,e,n=50){const s="undefined"!=typeof MessageChannel?new MessageChannel:null;if(!s)throw new Error("connection_unavailable");let r,i;return new Promise((o,a)=>{const B=jo("",20);s.port1.start();const c=setTimeout(()=>{a(new Error("unsupported_event"))},n);i={messageChannel:s,onMessage(t){const e=t;if(e.data.eventId===B)switch(e.data.status){case"ack":clearTimeout(c),r=setTimeout(()=>{a(new Error("timeout"))},3e3);break;case"done":clearTimeout(r),o(e.data.response);break;default:clearTimeout(c),clearTimeout(r),a(new Error("invalid_response"))}}},this.handlers.add(i),s.port1.addEventListener("message",i.onMessage),this.target.postMessage({eventType:t,eventId:B,data:e},[s.port2])}).finally(()=>{i&&this.removeMessageHandler(i)})}}function Jo(){return window}function qo(){return void 0!==Jo().WorkerGlobalScope&&"function"==typeof Jo().importScripts}const zo="firebaseLocalStorageDb",Ko="firebaseLocalStorage",Qo="fbase_key";class Wo{constructor(t){this.request=t}toPromise(){return new Promise((t,e)=>{this.request.addEventListener("success",()=>{t(this.request.result)}),this.request.addEventListener("error",()=>{e(this.request.error)})})}}function Yo(t,e){return t.transaction([Ko],e?"readwrite":"readonly").objectStore(Ko)}function Xo(){const t=indexedDB.open(zo,1);return new Promise((e,n)=>{t.addEventListener("error",()=>{n(t.error)}),t.addEventListener("upgradeneeded",()=>{const e=t.result;try{e.createObjectStore(Ko,{keyPath:Qo})}catch(t){n(t)}}),t.addEventListener("success",async()=>{const n=t.result;n.objectStoreNames.contains(Ko)?e(n):(n.close(),await function(){const t=indexedDB.deleteDatabase(zo);return new Wo(t).toPromise()}(),e(await Xo()))})})}async function Zo(t,e,n){const s=Yo(t,!0).put({[Qo]:e,value:n});return new Wo(s).toPromise()}function ta(t,e){const n=Yo(t,!0).delete(e);return new Wo(n).toPromise()}class ea{registerLifecycleListeners(){"undefined"!=typeof window&&"function"==typeof window.addEventListener&&(window.addEventListener("pagehide",this.onPageHide),window.addEventListener("pageshow",this.onPageShow))}unregisterLifecycleListeners(){"undefined"!=typeof window&&"function"==typeof window.removeEventListener&&(window.removeEventListener("pagehide",this.onPageHide),window.removeEventListener("pageshow",this.onPageShow))}constructor(){this.type="LOCAL",this.dbPromise=null,this._shouldAllowMigration=!0,this.listeners={},this.localCache={},this.pollTimer=null,this.isClosing=!1,this.pendingWrites=0,this.receiver=null,this.sender=null,this.serviceWorkerReceiverAvailable=!1,this.activeServiceWorker=null,this.onPageHide=()=>{this.isClosing=!0,this.stopPolling(),this.dbPromise&&(this.dbPromise.then(t=>t.close()).catch(()=>{}),this.dbPromise=null)},this.onPageShow=()=>{this.isClosing&&(this.isClosing=!1,Object.keys(this.listeners).length>0&&this.startPolling())},this._workerInitializationPromise=this.initializeServiceWorkerMessaging().then(()=>{},()=>{})}async _openDb(){return this.dbPromise||(this.dbPromise=Xo(),this.dbPromise.catch(()=>{this.dbPromise=null})),this.dbPromise}async _withRetries(t){let e=0;for(;;)try{const e=await this._openDb();return await t(e)}catch(t){if(e++>3)throw t;if(this.dbPromise){const t=this.dbPromise;this.dbPromise=null;try{(await t).close()}catch{}}}}async initializeServiceWorkerMessaging(){return qo()?this.initializeReceiver():this.initializeSender()}async initializeReceiver(){this.receiver=Vo._getInstance(qo()?self:null),this.receiver._subscribe("keyChanged",async(t,e)=>({keyProcessed:(await this._poll()).includes(e.key)})),this.receiver._subscribe("ping",async(t,e)=>["keyChanged"])}async initializeSender(){if(this.activeServiceWorker=await async function(){if(!navigator?.serviceWorker)return null;try{return(await navigator.serviceWorker.ready).active}catch{return null}}(),!this.activeServiceWorker)return;this.sender=new $o(this.activeServiceWorker);const t=await this.sender._send("ping",{},800);t&&t[0]?.fulfilled&&t[0]?.value.includes("keyChanged")&&(this.serviceWorkerReceiverAvailable=!0)}async notifyServiceWorker(t){if(this.sender&&this.activeServiceWorker&&(navigator?.serviceWorker?.controller||null)===this.activeServiceWorker)try{await this.sender._send("keyChanged",{key:t},this.serviceWorkerReceiverAvailable?800:50)}catch{}}async _isAvailable(){try{return!!indexedDB&&(await this._withRetries(async t=>{await Zo(t,Fo,"1"),await ta(t,Fo)}),!0)}catch{}return!1}async _withPendingWrite(t){this.pendingWrites++;try{await t()}finally{this.pendingWrites--}}async _set(t,e){return this._withPendingWrite(async()=>(await this._withRetries(n=>Zo(n,t,e)),this.localCache[t]=e,this.notifyServiceWorker(t)))}async _get(t){const e=await this._withRetries(e=>async function(t,e){const n=Yo(t,!1).get(e),s=await new Wo(n).toPromise();return void 0===s?null:s.value}(e,t));return this.localCache[t]=e,e}async _remove(t){return this._withPendingWrite(async()=>(await this._withRetries(e=>ta(e,t)),delete this.localCache[t],this.notifyServiceWorker(t)))}async _poll(){if(this.isClosing)return[];try{const t=await this._withRetries(t=>{const e=Yo(t,!1).getAll();return new Wo(e).toPromise()});if(this.isClosing)return[];if(!t)return[];if(0!==this.pendingWrites)return[];const e=[],n=new Set;if(0!==t.length)for(const{fbase_key:s,value:r}of t)n.add(s),JSON.stringify(this.localCache[s])!==JSON.stringify(r)&&(this.notifyListeners(s,r),e.push(s));for(const t of Object.keys(this.localCache))this.localCache[t]&&!n.has(t)&&(this.notifyListeners(t,null),e.push(t));return e}catch(t){return this.isClosing||xr(`Firebase Auth cross-tab polling failed with error: ${t}`),[]}}notifyListeners(t,e){this.localCache[t]=e;const n=this.listeners[t];if(n)for(const t of Array.from(n))t(e)}startPolling(){this.stopPolling(),this.pollTimer=setInterval(async()=>this._poll(),800)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}_addListener(t,e){0===Object.keys(this.listeners).length&&(this.startPolling(),this.registerLifecycleListeners()),this.listeners[t]||(this.listeners[t]=new Set,this._get(t)),this.listeners[t].add(e)}_removeListener(t,e){this.listeners[t]&&(this.listeners[t].delete(e),0===this.listeners[t].size&&delete this.listeners[t]),0===Object.keys(this.listeners).length&&(this.stopPolling(),this.unregisterLifecycleListeners())}}ea.type="LOCAL";const na=ea;function sa(t,e){return e?_i(e):(Ur(t._popupRedirectResolver,t,"argument-error"),t._popupRedirectResolver)}new zr(3e4,6e4);class ra extends so{constructor(t){super("custom","custom"),this.params=t}_getIdTokenResponse(t){return co(t,this._buildIdpRequest())}_linkToIdToken(t,e){return co(t,this._buildIdpRequest(e))}_getReauthenticationResolver(t){return co(t,this._buildIdpRequest())}_buildIdpRequest(t){const e={requestUri:this.params.requestUri,sessionId:this.params.sessionId,postBody:this.params.postBody,tenantId:this.params.tenantId,pendingToken:this.params.pendingToken,returnSecureToken:!0,returnIdpCredential:!0};return t&&(e.idToken=t),e}}function ia(t){return Io(t.auth,new ra(t),t.bypassAuthState)}function oa(t){const{auth:e,user:n}=t;return Ur(n,e,"internal-error"),vo(n,new ra(t),t.bypassAuthState)}async function aa(t){const{auth:e,user:n}=t;return Ur(n,e,"internal-error"),async function(t,e,n=!1){const s=await pi(t,e._linkToIdToken(t.auth,await t.getIdToken()),n);return Eo._forOperation(t,"link",s)}(n,new ra(t),t.bypassAuthState)}class Ba{constructor(t,e,n,s,r=!1){this.auth=t,this.resolver=n,this.user=s,this.bypassAuthState=r,this.pendingPromise=null,this.eventManager=null,this.filter=Array.isArray(e)?e:[e]}execute(){return new Promise(async(t,e)=>{this.pendingPromise={resolve:t,reject:e};try{this.eventManager=await this.resolver._initialize(this.auth),await this.onExecution(),this.eventManager.registerConsumer(this)}catch(t){this.reject(t)}})}async onAuthEvent(t){const{urlResponse:e,sessionId:n,postBody:s,tenantId:r,error:i,type:o}=t;if(i)return void this.reject(i);const a={auth:this.auth,requestUri:e,sessionId:n,tenantId:r||void 0,postBody:s||void 0,user:this.user,bypassAuthState:this.bypassAuthState};try{this.resolve(await this.getIdpTask(o)(a))}catch(t){this.reject(t)}}onError(t){this.reject(t)}getIdpTask(t){switch(t){case"signInViaPopup":case"signInViaRedirect":return ia;case"linkViaPopup":case"linkViaRedirect":return aa;case"reauthViaPopup":case"reauthViaRedirect":return oa;default:Lr(this.auth,"internal-error")}}resolve(t){jr(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.resolve(t),this.unregisterAndCleanUp()}reject(t){jr(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.reject(t),this.unregisterAndCleanUp()}unregisterAndCleanUp(){this.eventManager&&this.eventManager.unregisterConsumer(this),this.pendingPromise=null,this.cleanUp()}}const ca=new zr(2e3,1e4);class la extends Ba{constructor(t,e,n,s,r){super(t,e,s,r),this.provider=n,this.authWindow=null,this.pollId=null,la.currentPopupAction&&la.currentPopupAction.cancel(),la.currentPopupAction=this}async executeNotNull(){const t=await this.execute();return Ur(t,this.auth,"internal-error"),t}async onExecution(){jr(1===this.filter.length,"Popup operations only handle one event");const t=jo();this.authWindow=await this.resolver._openPopup(this.auth,this.provider,this.filter[0],t),this.authWindow.associatedEvent=t,this.resolver._originValidation(this.auth).catch(t=>{this.reject(t)}),this.resolver._isIframeWebStorageSupported(this.auth,t=>{t||this.reject(Fr(this.auth,"web-storage-unsupported"))}),this.pollUserCancellation()}get eventId(){return this.authWindow?.associatedEvent||null}cancel(){this.reject(Fr(this.auth,"cancelled-popup-request"))}cleanUp(){this.authWindow&&this.authWindow.close(),this.pollId&&window.clearTimeout(this.pollId),this.authWindow=null,this.pollId=null,la.currentPopupAction=null}pollUserCancellation(){const t=()=>{this.authWindow?.window?.closed?this.pollId=window.setTimeout(()=>{this.pollId=null,this.reject(Fr(this.auth,"popup-closed-by-user"))},8e3):this.pollId=window.setTimeout(t,ca.get())};t()}}la.currentPopupAction=null;const ua=new Map;class ha extends Ba{constructor(t,e,n=!1){super(t,["signInViaRedirect","linkViaRedirect","reauthViaRedirect","unknown"],e,void 0,n),this.eventId=null}async execute(){let t=ua.get(this.auth._key());if(!t){try{const e=await async function(t,e){const n=fa(e),s=pa(t);if(!await s._isAvailable())return!1;const r="true"===await s._get(n);return await s._remove(n),r}(this.resolver,this.auth),n=e?await super.execute():null;t=()=>Promise.resolve(n)}catch(e){t=()=>Promise.reject(e)}ua.set(this.auth._key(),t)}return this.bypassAuthState||ua.set(this.auth._key(),()=>Promise.resolve(null)),t()}async onAuthEvent(t){if("signInViaRedirect"===t.type)return super.onAuthEvent(t);if("unknown"!==t.type){if(t.eventId){const e=await this.auth._redirectUserForId(t.eventId);if(e)return this.user=e,super.onAuthEvent(t);this.resolve(null)}}else this.resolve(null)}async onExecution(){}cleanUp(){}}function da(t,e){ua.set(t._key(),e)}function pa(t){return _i(t._redirectPersistence)}function fa(t){return Ii("pendingRedirect",t.config.apiKey,t.name)}function Ca(t,e,n){return async function(t,e,n){if(hr(t.app))return Promise.reject(Mr(t));const s=ji(t);Gr(t,e,po),await s._initializationPromise;const r=sa(s,n);return await async function(t,e){return pa(t)._set(fa(e),"true")}(r,s),r._openRedirect(s,e,"signInViaRedirect")}(t,e,n)}async function ga(t,e,n=!1){if(hr(t.app))return Promise.reject(Mr(t));const s=ji(t),r=sa(s,e),i=new ha(s,r,n),o=await i.execute();return o&&!n&&(delete o.user._redirectEventId,await s._persistUserIfCurrent(o.user),await s._setRedirectUser(null,e)),o}class ma{constructor(t){this.auth=t,this.cachedEventUids=new Set,this.consumers=new Set,this.queuedRedirectEvent=null,this.hasHandledPotentialRedirect=!1,this.lastProcessedEventTime=Date.now()}registerConsumer(t){this.consumers.add(t),this.queuedRedirectEvent&&this.isEventForConsumer(this.queuedRedirectEvent,t)&&(this.sendToConsumer(this.queuedRedirectEvent,t),this.saveEventToCache(this.queuedRedirectEvent),this.queuedRedirectEvent=null)}unregisterConsumer(t){this.consumers.delete(t)}onEvent(t){if(this.hasEventBeenHandled(t))return!1;let e=!1;return this.consumers.forEach(n=>{this.isEventForConsumer(t,n)&&(e=!0,this.sendToConsumer(t,n),this.saveEventToCache(t))}),this.hasHandledPotentialRedirect||!function(t){switch(t.type){case"signInViaRedirect":case"linkViaRedirect":case"reauthViaRedirect":return!0;case"unknown":return ya(t);default:return!1}}(t)||(this.hasHandledPotentialRedirect=!0,e||(this.queuedRedirectEvent=t,e=!0)),e}sendToConsumer(t,e){if(t.error&&!ya(t)){const n=t.error.code?.split("auth/")[1]||"internal-error";e.onError(Fr(this.auth,n))}else e.onAuthEvent(t)}isEventForConsumer(t,e){const n=null===e.eventId||!!t.eventId&&t.eventId===e.eventId;return e.filter.includes(t.type)&&n}hasEventBeenHandled(t){return Date.now()-this.lastProcessedEventTime>=6e5&&this.cachedEventUids.clear(),this.cachedEventUids.has(wa(t))}saveEventToCache(t){this.cachedEventUids.add(wa(t)),this.lastProcessedEventTime=Date.now()}}function wa(t){return[t.type,t.eventId,t.sessionId,t.tenantId].filter(t=>t).join("-")}function ya({type:t,error:e}){return"unknown"===t&&"auth/no-auth-event"===e?.code}const Ea=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,Da=/^https?/;async function _a(t){if(t.config.emulator)return;const{authorizedDomains:e}=await async function(t,e={}){return ti(t,"GET","/v1/projects",e)}(t);for(const t of e)try{if(ba(t))return}catch{}Lr(t,"unauthorized-domain")}function ba(t){const e=$r(),{protocol:n,hostname:s}=new URL(e);if(t.startsWith("chrome-extension://")){const r=new URL(t);return""===r.hostname&&""===s?"chrome-extension:"===n&&t.replace("chrome-extension://","")===e.replace("chrome-extension://",""):"chrome-extension:"===n&&r.hostname===s}if(!Da.test(n))return!1;if(Ea.test(t))return s===t;const r=t.replace(/\./g,"\\.");return new RegExp("^(.+\\."+r+"|"+r+")$","i").test(s)}const va=new zr(3e4,6e4);function Ia(){const t=Jo().___jsl;if(t?.H)for(const e of Object.keys(t.H))if(t.H[e].r=t.H[e].r||[],t.H[e].L=t.H[e].L||[],t.H[e].r=[...t.H[e].L],t.CP)for(let e=0;e<t.CP.length;e++)t.CP[e]=null}function Ta(t){return new Promise((e,n)=>{function s(){Ia(),gapi.load("gapi.iframes",{callback:()=>{e(gapi.iframes.getContext())},ontimeout:()=>{Ia(),n(Fr(t,"network-request-failed"))},timeout:va.get()})}if(Jo().gapi?.iframes?.Iframe)e(gapi.iframes.getContext());else{if(!Jo().gapi?.load){const e=`__${"iframefcb"}${Math.floor(1e6*Math.random())}`;return Jo()[e]=()=>{gapi.load?s():n(Fr(t,"network-request-failed"))},qi(`${Ji.gapiScript}?onload=${e}`).catch(t=>n(t))}s()}}).catch(t=>{throw Oa=null,t})}let Oa=null;const Aa=new zr(5e3,15e3),Sa={style:{position:"absolute",top:"-100px",width:"1px",height:"1px"},"aria-hidden":"true",tabindex:"-1"},Ra=new Map([["identitytoolkit.googleapis.com","p"],["staging-identitytoolkit.sandbox.googleapis.com","s"],["test-identitytoolkit.sandbox.googleapis.com","t"]]);function Na(t){const e=t.config;Ur(e.authDomain,t,"auth-domain-config-required");const n=e.emulator?Kr(e,"emulator/auth/iframe"):`https://${t.config.authDomain}/__/auth/iframe`,s={apiKey:e.apiKey,appName:t.name,v:fr},r=Ra.get(t.config.apiHost);r&&(s.eid=r);const i=t._getFrameworks();return i.length&&(s.fw=i.join(",")),`${n}?${qn(s).slice(1)}`}async function xa(t){const e=await function(t){return Oa=Oa||Ta(t),Oa}(t),n=Jo().gapi;return Ur(n,t,"internal-error"),e.open({where:document.body,url:Na(t),messageHandlersFilter:n.iframes.CROSS_ORIGIN_IFRAMES_FILTER,attributes:Sa,dontclear:!0},e=>new Promise(async(n,s)=>{await e.restyle({setHideOnLeave:!1});const r=Fr(t,"network-request-failed"),i=Jo().setTimeout(()=>{s(r)},Aa.get());function o(){Jo().clearTimeout(i),n(e)}e.ping(o).then(o,()=>{s(r)})}))}const ka={location:"yes",resizable:"yes",statusbar:"yes",toolbar:"no"};class La{constructor(t){this.window=t,this.associatedEvent=null}close(){if(this.window)try{this.window.close()}catch(t){}}}function Fa(t,e,n,s=500,r=600){const i=Math.max((window.screen.availHeight-r)/2,0).toString(),o=Math.max((window.screen.availWidth-s)/2,0).toString();let a="";const B={...ka,width:s.toString(),height:r.toString(),top:i,left:o},c=Fn().toLowerCase();n&&(a=Ri(c)?"_blank":n),Ai(c)&&(e=e||"http://localhost",B.scrollbars="yes");const l=Object.entries(B).reduce((t,[e,n])=>`${t}${e}=${n},`,"");if(function(t=Fn()){return Fi(t)&&!!window.navigator?.standalone}(c)&&"_self"!==a)return function(t,e){const n=document.createElement("a");n.href=t,n.target=e;const s=document.createEvent("MouseEvent");s.initMouseEvent("click",!0,!0,window,1,0,0,0,0,!1,!1,!1,!1,1,null),n.dispatchEvent(s)}(e||"",a),new La(null);const u=window.open(e||"",a,l);Ur(u,t,"popup-blocked");try{u.focus()}catch(t){}return new La(u)}const Pa="__/auth/handler",Ma="emulator/auth/handler",Ga=encodeURIComponent("fac");async function Ha(t,e,n,s,r,i){Ur(t.config.authDomain,t,"auth-domain-config-required"),Ur(t.config.apiKey,t,"invalid-api-key");const o={apiKey:t.config.apiKey,appName:t.name,authType:n,redirectUrl:s,v:fr,eventId:r};if(e instanceof po){e.setDefaultLanguage(t.languageCode),o.providerId=e.providerId||"",function(t){for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e))return!1;return!0}(e.getCustomParameters())||(o.customParameters=JSON.stringify(e.getCustomParameters()));for(const[t,e]of Object.entries({}))o[t]=e}if(e instanceof fo){const t=e.getScopes().filter(t=>""!==t);t.length>0&&(o.scopes=t.join(","))}t.tenantId&&(o.tid=t.tenantId);const a=o;for(const t of Object.keys(a))void 0===a[t]&&delete a[t];const B=await t._getAppCheckToken(),c=B?`#${Ga}=${encodeURIComponent(B)}`:"";return`${function({config:t}){if(!t.emulator)return`https://${t.authDomain}/${Pa}`;return Kr(t,Ma)}(t)}?${qn(a).slice(1)}${c}`}const Ua="webStorageSupport";const Va=class{constructor(){this.eventManagers={},this.iframes={},this.originValidationPromises={},this._redirectPersistence=Uo,this._completeRedirectFn=ga,this._overrideRedirectResult=da}async _openPopup(t,e,n,s){jr(this.eventManagers[t._key()]?.manager,"_initialize() not called before _openPopup()");return Fa(t,await Ha(t,e,n,$r(),s),jo())}async _openRedirect(t,e,n,s){await this._originValidation(t);return function(t){Jo().location.href=t}(await Ha(t,e,n,$r(),s)),new Promise(()=>{})}_initialize(t){const e=t._key();if(this.eventManagers[e]){const{manager:t,promise:n}=this.eventManagers[e];return t?Promise.resolve(t):(jr(n,"If manager is not set, promise should be"),n)}const n=this.initAndGetManager(t);return this.eventManagers[e]={promise:n},n.catch(()=>{delete this.eventManagers[e]}),n}async initAndGetManager(t){const e=await xa(t),n=new ma(t);return e.register("authEvent",e=>{Ur(e?.authEvent,t,"invalid-auth-event");return{status:n.onEvent(e.authEvent)?"ACK":"ERROR"}},gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER),this.eventManagers[t._key()]={manager:n},this.iframes[t._key()]=e,n}_isIframeWebStorageSupported(t,e){this.iframes[t._key()].send(Ua,{type:Ua},n=>{const s=n?.[0]?.[Ua];void 0!==s&&e(!!s),Lr(t,"internal-error")},gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER)}_originValidation(t){const e=t._key();return this.originValidationPromises[e]||(this.originValidationPromises[e]=_a(t)),this.originValidationPromises[e]}get _shouldInitProactively(){return Mi()||Si()||Fi()}};var ja="@firebase/auth",$a="1.13.6";class Ja{constructor(t){this.auth=t,this.internalListeners=new Map}getUid(){return this.assertAuthConfigured(),this.auth.currentUser?.uid||null}async getToken(t){if(this.assertAuthConfigured(),await this.auth._initializationPromise,!this.auth.currentUser)return null;return{accessToken:await this.auth.currentUser.getIdToken(t)}}addAuthTokenListener(t){if(this.assertAuthConfigured(),this.internalListeners.has(t))return;const e=this.auth.onIdTokenChanged(e=>{t(e?.stsTokenManager.accessToken||null)});this.internalListeners.set(t,e),this.updateProactiveRefresh()}removeAuthTokenListener(t){this.assertAuthConfigured();const e=this.internalListeners.get(t);e&&(this.internalListeners.delete(t),e(),this.updateProactiveRefresh())}assertAuthConfigured(){Ur(this.auth._initializationPromise,"dependent-sdk-initialized-before-auth")}updateProactiveRefresh(){this.internalListeners.size>0?this.auth._startProactiveRefresh():this.auth._stopProactiveRefresh()}}const qa=xn("authIdTokenMaxAge")||300;let za=null;function Ka(t=gr()){const e=ur(t,"auth");if(e.isInitialized())return e.getImmediate();const n=function(t,e){const n=ur(t,"auth");if(n.isInitialized()){const t=n.getImmediate();if($n(n.getOptions(),e??{}))return t;Lr(t,"already-initialized")}return n.initialize({options:e})}(t,{popupRedirectResolver:Va,persistence:[na,Go,Uo]}),s=xn("authTokenSyncURL");if(s&&"boolean"==typeof isSecureContext&&isSecureContext){const t=new URL(s,location.origin);if(location.origin===t.origin){const e=(r=t.toString(),async t=>{const e=t&&await t.getIdTokenResult(),n=e&&((new Date).getTime()-Date.parse(e.issuedAtTime))/1e3;if(n&&n>qa)return;const s=e?.token;za!==s&&(za=s,await fetch(r,{method:s?"POST":"DELETE",headers:s?{Authorization:`Bearer ${s}`}:{}}))});!function(t,e,n){Xn(t).beforeAuthStateChanged(e,n)}(n,e,()=>e(n.currentUser)),function(t,e,n,s){Xn(t).onIdTokenChanged(e,n,s)}(n,t=>e(t))}}var r;const i=Sn("auth");return i&&to(n,`http://${i}`),n}var Qa;!function(t){Ji=t}({loadJS:t=>new Promise((e,n)=>{const s=document.createElement("script");s.setAttribute("src",t),s.onload=e,s.onerror=t=>{const e=Fr("internal-error");e.customData=t,n(e)},s.type="text/javascript",s.charset="UTF-8",(document.getElementsByTagName("head")?.[0]??document).appendChild(s)}),gapiScript:"https://apis.google.com/js/api.js",recaptchaV2Script:"https://www.google.com/recaptcha/api.js",recaptchaEnterpriseScript:"https://www.google.com/recaptcha/enterprise.js?render="}),Qa="Browser",lr(new es("auth",(t,{options:e})=>{const n=t.getProvider("app").getImmediate(),s=t.getProvider("heartbeat"),r=t.getProvider("app-check-internal"),{apiKey:i,authDomain:o}=n.options;Ur(i&&!i.includes(":"),"invalid-api-key",{appName:n.name});const a={apiKey:i,authDomain:o,clientPlatform:Qa,apiHost:"identitytoolkit.googleapis.com",tokenApiHost:"securetoken.googleapis.com",apiScheme:"https",sdkClientVersion:Gi(Qa)},B=new Vi(n,s,r,a);return function(t,e){const n=e?.persistence||[],s=(Array.isArray(n)?n:[n]).map(_i);e?.errorMap&&t._updateErrorMap(e.errorMap),t._initializeWithPersistence(s,e?.popupRedirectResolver)}(B,e),B},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((t,e,n)=>{t.getProvider("auth-internal").initialize()})),lr(new es("auth-internal",t=>(t=>new Ja(t))(ji(t.getProvider("auth").getImmediate())),"PRIVATE").setInstantiationMode("EXPLICIT")),mr(ja,$a,function(t){switch(t){case"Node":return"node";case"ReactNative":return"rn";case"Worker":return"webworker";case"Cordova":return"cordova";case"WebExtension":return"web-extension";default:return}}(Qa)),mr(ja,$a,"esm2020");mr("firebase","12.19.0","app");var Wa,Ya="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};(function(){var t;function e(){this.blockSize=-1,this.blockSize=64,this.g=Array(4),this.C=Array(this.blockSize),this.o=this.h=0,this.u()}function n(t,e,n){n||(n=0);const s=Array(16);if("string"==typeof e)for(var r=0;r<16;++r)s[r]=e.charCodeAt(n++)|e.charCodeAt(n++)<<8|e.charCodeAt(n++)<<16|e.charCodeAt(n++)<<24;else for(r=0;r<16;++r)s[r]=e[n++]|e[n++]<<8|e[n++]<<16|e[n++]<<24;e=t.g[0],n=t.g[1],r=t.g[2];let i,o=t.g[3];i=e+(o^n&(r^o))+s[0]+3614090360&4294967295,i=o+(r^(e=n+(i<<7&4294967295|i>>>25))&(n^r))+s[1]+3905402710&4294967295,o=e+(i<<12&4294967295|i>>>20),i=r+(n^o&(e^n))+s[2]+606105819&4294967295,i=n+(e^(r=o+(i<<17&4294967295|i>>>15))&(o^e))+s[3]+3250441966&4294967295,i=e+(o^(n=r+(i<<22&4294967295|i>>>10))&(r^o))+s[4]+4118548399&4294967295,i=o+(r^(e=n+(i<<7&4294967295|i>>>25))&(n^r))+s[5]+1200080426&4294967295,o=e+(i<<12&4294967295|i>>>20),i=r+(n^o&(e^n))+s[6]+2821735955&4294967295,i=n+(e^(r=o+(i<<17&4294967295|i>>>15))&(o^e))+s[7]+4249261313&4294967295,i=e+(o^(n=r+(i<<22&4294967295|i>>>10))&(r^o))+s[8]+1770035416&4294967295,i=o+(r^(e=n+(i<<7&4294967295|i>>>25))&(n^r))+s[9]+2336552879&4294967295,o=e+(i<<12&4294967295|i>>>20),i=r+(n^o&(e^n))+s[10]+4294925233&4294967295,i=n+(e^(r=o+(i<<17&4294967295|i>>>15))&(o^e))+s[11]+2304563134&4294967295,i=e+(o^(n=r+(i<<22&4294967295|i>>>10))&(r^o))+s[12]+1804603682&4294967295,i=o+(r^(e=n+(i<<7&4294967295|i>>>25))&(n^r))+s[13]+4254626195&4294967295,o=e+(i<<12&4294967295|i>>>20),i=r+(n^o&(e^n))+s[14]+2792965006&4294967295,i=n+(e^(r=o+(i<<17&4294967295|i>>>15))&(o^e))+s[15]+1236535329&4294967295,i=e+(r^o&((n=r+(i<<22&4294967295|i>>>10))^r))+s[1]+4129170786&4294967295,i=o+(n^r&((e=n+(i<<5&4294967295|i>>>27))^n))+s[6]+3225465664&4294967295,o=e+(i<<9&4294967295|i>>>23),i=r+(e^n&(o^e))+s[11]+643717713&4294967295,i=n+(o^e&((r=o+(i<<14&4294967295|i>>>18))^o))+s[0]+3921069994&4294967295,i=e+(r^o&((n=r+(i<<20&4294967295|i>>>12))^r))+s[5]+3593408605&4294967295,i=o+(n^r&((e=n+(i<<5&4294967295|i>>>27))^n))+s[10]+38016083&4294967295,o=e+(i<<9&4294967295|i>>>23),i=r+(e^n&(o^e))+s[15]+3634488961&4294967295,i=n+(o^e&((r=o+(i<<14&4294967295|i>>>18))^o))+s[4]+3889429448&4294967295,i=e+(r^o&((n=r+(i<<20&4294967295|i>>>12))^r))+s[9]+568446438&4294967295,i=o+(n^r&((e=n+(i<<5&4294967295|i>>>27))^n))+s[14]+3275163606&4294967295,o=e+(i<<9&4294967295|i>>>23),i=r+(e^n&(o^e))+s[3]+4107603335&4294967295,i=n+(o^e&((r=o+(i<<14&4294967295|i>>>18))^o))+s[8]+1163531501&4294967295,i=e+(r^o&((n=r+(i<<20&4294967295|i>>>12))^r))+s[13]+2850285829&4294967295,i=o+(n^r&((e=n+(i<<5&4294967295|i>>>27))^n))+s[2]+4243563512&4294967295,o=e+(i<<9&4294967295|i>>>23),i=r+(e^n&(o^e))+s[7]+1735328473&4294967295,i=n+(o^e&((r=o+(i<<14&4294967295|i>>>18))^o))+s[12]+2368359562&4294967295,i=e+((n=r+(i<<20&4294967295|i>>>12))^r^o)+s[5]+4294588738&4294967295,i=o+((e=n+(i<<4&4294967295|i>>>28))^n^r)+s[8]+2272392833&4294967295,o=e+(i<<11&4294967295|i>>>21),i=r+(o^e^n)+s[11]+1839030562&4294967295,i=n+((r=o+(i<<16&4294967295|i>>>16))^o^e)+s[14]+4259657740&4294967295,i=e+((n=r+(i<<23&4294967295|i>>>9))^r^o)+s[1]+2763975236&4294967295,i=o+((e=n+(i<<4&4294967295|i>>>28))^n^r)+s[4]+1272893353&4294967295,o=e+(i<<11&4294967295|i>>>21),i=r+(o^e^n)+s[7]+4139469664&4294967295,i=n+((r=o+(i<<16&4294967295|i>>>16))^o^e)+s[10]+3200236656&4294967295,i=e+((n=r+(i<<23&4294967295|i>>>9))^r^o)+s[13]+681279174&4294967295,i=o+((e=n+(i<<4&4294967295|i>>>28))^n^r)+s[0]+3936430074&4294967295,o=e+(i<<11&4294967295|i>>>21),i=r+(o^e^n)+s[3]+3572445317&4294967295,i=n+((r=o+(i<<16&4294967295|i>>>16))^o^e)+s[6]+76029189&4294967295,i=e+((n=r+(i<<23&4294967295|i>>>9))^r^o)+s[9]+3654602809&4294967295,i=o+((e=n+(i<<4&4294967295|i>>>28))^n^r)+s[12]+3873151461&4294967295,o=e+(i<<11&4294967295|i>>>21),i=r+(o^e^n)+s[15]+530742520&4294967295,i=n+((r=o+(i<<16&4294967295|i>>>16))^o^e)+s[2]+3299628645&4294967295,i=e+(r^((n=r+(i<<23&4294967295|i>>>9))|~o))+s[0]+4096336452&4294967295,i=o+(n^((e=n+(i<<6&4294967295|i>>>26))|~r))+s[7]+1126891415&4294967295,o=e+(i<<10&4294967295|i>>>22),i=r+(e^(o|~n))+s[14]+2878612391&4294967295,i=n+(o^((r=o+(i<<15&4294967295|i>>>17))|~e))+s[5]+4237533241&4294967295,i=e+(r^((n=r+(i<<21&4294967295|i>>>11))|~o))+s[12]+1700485571&4294967295,i=o+(n^((e=n+(i<<6&4294967295|i>>>26))|~r))+s[3]+2399980690&4294967295,o=e+(i<<10&4294967295|i>>>22),i=r+(e^(o|~n))+s[10]+4293915773&4294967295,i=n+(o^((r=o+(i<<15&4294967295|i>>>17))|~e))+s[1]+2240044497&4294967295,i=e+(r^((n=r+(i<<21&4294967295|i>>>11))|~o))+s[8]+1873313359&4294967295,i=o+(n^((e=n+(i<<6&4294967295|i>>>26))|~r))+s[15]+4264355552&4294967295,o=e+(i<<10&4294967295|i>>>22),i=r+(e^(o|~n))+s[6]+2734768916&4294967295,i=n+(o^((r=o+(i<<15&4294967295|i>>>17))|~e))+s[13]+1309151649&4294967295,i=e+(r^((n=r+(i<<21&4294967295|i>>>11))|~o))+s[4]+4149444226&4294967295,i=o+(n^((e=n+(i<<6&4294967295|i>>>26))|~r))+s[11]+3174756917&4294967295,o=e+(i<<10&4294967295|i>>>22),i=r+(e^(o|~n))+s[2]+718787259&4294967295,i=n+(o^((r=o+(i<<15&4294967295|i>>>17))|~e))+s[9]+3951481745&4294967295,t.g[0]=t.g[0]+e&4294967295,t.g[1]=t.g[1]+(r+(i<<21&4294967295|i>>>11))&4294967295,t.g[2]=t.g[2]+r&4294967295,t.g[3]=t.g[3]+o&4294967295}function s(t,e){this.h=e;const n=[];let s=!0;for(let r=t.length-1;r>=0;r--){const i=0|t[r];s&&i==e||(n[r]=i,s=!1)}this.g=n}!function(t,e){function n(){}n.prototype=e.prototype,t.F=e.prototype,t.prototype=new n,t.prototype.constructor=t,t.D=function(t,n,s){for(var r=Array(arguments.length-2),i=2;i<arguments.length;i++)r[i-2]=arguments[i];return e.prototype[n].apply(t,r)}}(e,function(){this.blockSize=-1}),e.prototype.u=function(){this.g[0]=1732584193,this.g[1]=4023233417,this.g[2]=2562383102,this.g[3]=271733878,this.o=this.h=0},e.prototype.v=function(t,e){void 0===e&&(e=t.length);const s=e-this.blockSize,r=this.C;let i=this.h,o=0;for(;o<e;){if(0==i)for(;o<=s;)n(this,t,o),o+=this.blockSize;if("string"==typeof t){for(;o<e;)if(r[i++]=t.charCodeAt(o++),i==this.blockSize){n(this,r),i=0;break}}else for(;o<e;)if(r[i++]=t[o++],i==this.blockSize){n(this,r),i=0;break}}this.h=i,this.o+=e},e.prototype.A=function(){var t=Array((this.h<56?this.blockSize:2*this.blockSize)-this.h);t[0]=128;for(var e=1;e<t.length-8;++e)t[e]=0;e=8*this.o;for(var n=t.length-8;n<t.length;++n)t[n]=255&e,e/=256;for(this.v(t),t=Array(16),e=0,n=0;n<4;++n)for(let s=0;s<32;s+=8)t[e++]=this.g[n]>>>s&255;return t};var r={};function i(t){return-128<=t&&t<128?function(t,e){var n=r;return Object.prototype.hasOwnProperty.call(n,t)?n[t]:n[t]=e(t)}(t,function(t){return new s([0|t],t<0?-1:0)}):new s([0|t],t<0?-1:0)}function o(t){if(isNaN(t)||!isFinite(t))return a;if(t<0)return h(o(-t));const e=[];let n=1;for(let s=0;t>=n;s++)e[s]=t/n|0,n*=4294967296;return new s(e,0)}var a=i(0),B=i(1),c=i(16777216);function l(t){if(0!=t.h)return!1;for(let e=0;e<t.g.length;e++)if(0!=t.g[e])return!1;return!0}function u(t){return-1==t.h}function h(t){const e=t.g.length,n=[];for(let s=0;s<e;s++)n[s]=~t.g[s];return new s(n,~t.h).add(B)}function d(t,e){return t.add(h(e))}function p(t,e){for(;(65535&t[e])!=t[e];)t[e+1]+=t[e]>>>16,t[e]&=65535,e++}function f(t,e){this.g=t,this.h=e}function C(t,e){if(l(e))throw Error("division by zero");if(l(t))return new f(a,a);if(u(t))return e=C(h(t),e),new f(h(e.g),h(e.h));if(u(e))return e=C(t,h(e)),new f(h(e.g),e.h);if(t.g.length>30){if(u(t)||u(e))throw Error("slowDivide_ only works with positive integers.");for(var n=B,s=e;s.l(t)<=0;)n=g(n),s=g(s);var r=m(n,1),i=m(s,1);for(s=m(s,2),n=m(n,2);!l(s);){var c=i.add(s);c.l(t)<=0&&(r=r.add(n),i=c),s=m(s,1),n=m(n,1)}return e=d(t,r.j(e)),new f(r,e)}for(r=a;t.l(e)>=0;){for(n=Math.max(1,Math.floor(t.m()/e.m())),s=(s=Math.ceil(Math.log(n)/Math.LN2))<=48?1:Math.pow(2,s-48),c=(i=o(n)).j(e);u(c)||c.l(t)>0;)c=(i=o(n-=s)).j(e);l(i)&&(i=B),r=r.add(i),t=d(t,c)}return new f(r,t)}function g(t){const e=t.g.length+1,n=[];for(let s=0;s<e;s++)n[s]=t.i(s)<<1|t.i(s-1)>>>31;return new s(n,t.h)}function m(t,e){const n=e>>5;e%=32;const r=t.g.length-n,i=[];for(let s=0;s<r;s++)i[s]=e>0?t.i(s+n)>>>e|t.i(s+n+1)<<32-e:t.i(s+n);return new s(i,t.h)}(t=s.prototype).m=function(){if(u(this))return-h(this).m();let t=0,e=1;for(let n=0;n<this.g.length;n++){const s=this.i(n);t+=(s>=0?s:4294967296+s)*e,e*=4294967296}return t},t.toString=function(t){if((t=t||10)<2||36<t)throw Error("radix out of range: "+t);if(l(this))return"0";if(u(this))return"-"+h(this).toString(t);const e=o(Math.pow(t,6));var n=this;let s="";for(;;){const r=C(n,e).g;let i=(((n=d(n,r.j(e))).g.length>0?n.g[0]:n.h)>>>0).toString(t);if(l(n=r))return i+s;for(;i.length<6;)i="0"+i;s=i+s}},t.i=function(t){return t<0?0:t<this.g.length?this.g[t]:this.h},t.l=function(t){return u(t=d(this,t))?-1:l(t)?0:1},t.abs=function(){return u(this)?h(this):this},t.add=function(t){const e=Math.max(this.g.length,t.g.length),n=[];let r=0;for(let s=0;s<=e;s++){let e=r+(65535&this.i(s))+(65535&t.i(s)),i=(e>>>16)+(this.i(s)>>>16)+(t.i(s)>>>16);r=i>>>16,e&=65535,i&=65535,n[s]=i<<16|e}return new s(n,-2147483648&n[n.length-1]?-1:0)},t.j=function(t){if(l(this)||l(t))return a;if(u(this))return u(t)?h(this).j(h(t)):h(h(this).j(t));if(u(t))return h(this.j(h(t)));if(this.l(c)<0&&t.l(c)<0)return o(this.m()*t.m());const e=this.g.length+t.g.length,n=[];for(var r=0;r<2*e;r++)n[r]=0;for(r=0;r<this.g.length;r++)for(let e=0;e<t.g.length;e++){const s=this.i(r)>>>16,i=65535&this.i(r),o=t.i(e)>>>16,a=65535&t.i(e);n[2*r+2*e]+=i*a,p(n,2*r+2*e),n[2*r+2*e+1]+=s*a,p(n,2*r+2*e+1),n[2*r+2*e+1]+=i*o,p(n,2*r+2*e+1),n[2*r+2*e+2]+=s*o,p(n,2*r+2*e+2)}for(t=0;t<e;t++)n[t]=n[2*t+1]<<16|n[2*t];for(t=e;t<2*e;t++)n[t]=0;return new s(n,0)},t.B=function(t){return C(this,t).h},t.and=function(t){const e=Math.max(this.g.length,t.g.length),n=[];for(let s=0;s<e;s++)n[s]=this.i(s)&t.i(s);return new s(n,this.h&t.h)},t.or=function(t){const e=Math.max(this.g.length,t.g.length),n=[];for(let s=0;s<e;s++)n[s]=this.i(s)|t.i(s);return new s(n,this.h|t.h)},t.xor=function(t){const e=Math.max(this.g.length,t.g.length),n=[];for(let s=0;s<e;s++)n[s]=this.i(s)^t.i(s);return new s(n,this.h^t.h)},e.prototype.digest=e.prototype.A,e.prototype.reset=e.prototype.u,e.prototype.update=e.prototype.v,s.prototype.add=s.prototype.add,s.prototype.multiply=s.prototype.j,s.prototype.modulo=s.prototype.B,s.prototype.compare=s.prototype.l,s.prototype.toNumber=s.prototype.m,s.prototype.toString=s.prototype.toString,s.prototype.getBits=s.prototype.i,s.fromNumber=o,s.fromString=function t(e,n){if(0==e.length)throw Error("number format error: empty string");if((n=n||10)<2||36<n)throw Error("radix out of range: "+n);if("-"==e.charAt(0))return h(t(e.substring(1),n));if(e.indexOf("-")>=0)throw Error('number format error: interior "-" character');const s=o(Math.pow(n,8));let r=a;for(let t=0;t<e.length;t+=8){var i=Math.min(8,e.length-t);const a=parseInt(e.substring(t,t+i),n);i<8?(i=o(Math.pow(n,i)),r=r.j(i).add(o(a))):(r=r.j(s),r=r.add(o(a)))}return r},Wa=s}).apply(void 0!==Ya?Ya:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{});var Xa,Za,tB,eB,nB,sB,rB,iB,oB="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};(function(){var t,e=Object.defineProperty;var n=function(t){t=["object"==typeof globalThis&&globalThis,t,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof oB&&oB];for(var e=0;e<t.length;++e){var n=t[e];if(n&&n.Math==Math)return n}throw Error("Cannot find global object")}(this);function s(t,s){if(s)t:{var r=n;t=t.split(".");for(var i=0;i<t.length-1;i++){var o=t[i];if(!(o in r))break t;r=r[o]}(s=s(i=r[t=t[t.length-1]]))!=i&&null!=s&&e(r,t,{configurable:!0,writable:!0,value:s})}}s("Symbol.dispose",function(t){return t||Symbol("Symbol.dispose")}),s("Array.prototype.values",function(t){return t||function(){return this[Symbol.iterator]()}}),s("Object.entries",function(t){return t||function(t){var e,n=[];for(e in t)Object.prototype.hasOwnProperty.call(t,e)&&n.push([e,t[e]]);return n}});var r=r||{},i=this||self;function o(t){var e=typeof t;return"object"==e&&null!=t||"function"==e}function a(t,e,n){return t.call.apply(t.bind,arguments)}function B(t,e,n){return(B=a).apply(null,arguments)}function c(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 l(t,e){function n(){}n.prototype=e.prototype,t.Z=e.prototype,t.prototype=new n,t.prototype.constructor=t,t.Ob=function(t,n,s){for(var r=Array(arguments.length-2),i=2;i<arguments.length;i++)r[i-2]=arguments[i];return e.prototype[n].apply(t,r)}}var u="undefined"!=typeof AsyncContext&&"function"==typeof AsyncContext.Snapshot?t=>t&&AsyncContext.Snapshot.wrap(t):t=>t;function h(t){const e=t.length;if(e>0){const n=Array(e);for(let s=0;s<e;s++)n[s]=t[s];return n}return[]}function d(t,e){for(let e=1;e<arguments.length;e++){const s=arguments[e];var n=typeof s;if("array"==(n="object"!=n?n:s?Array.isArray(s)?"array":n:"null")||"object"==n&&"number"==typeof s.length){n=t.length||0;const e=s.length||0;t.length=n+e;for(let r=0;r<e;r++)t[n+r]=s[r]}else t.push(s)}}function p(t){i.setTimeout(()=>{throw t},0)}function f(){var t=y;let e=null;return t.g&&(e=t.g,t.g=t.g.next,t.g||(t.h=null),e.next=null),e}var C=new class{constructor(t,e){this.i=t,this.j=e,this.h=0,this.g=null}get(){let t;return this.h>0?(this.h--,t=this.g,this.g=t.next,t.next=null):t=this.i(),t}}(()=>new g,t=>t.reset());class g{constructor(){this.next=this.g=this.h=null}set(t,e){this.h=t,this.g=e,this.next=null}reset(){this.next=this.g=this.h=null}}let m,w=!1,y=new class{constructor(){this.h=this.g=null}add(t,e){const n=C.get();n.set(t,e),this.h?this.h.next=n:this.g=n,this.h=n}},E=()=>{const t=Promise.resolve(void 0);m=()=>{t.then(D)}};function D(){for(var t;t=f();){try{t.h.call(t.g)}catch(t){p(t)}var e=C;e.j(t),e.h<100&&(e.h++,t.next=e.g,e.g=t)}w=!1}function _(){this.u=this.u,this.C=this.C}function b(t,e){this.type=t,this.g=this.target=e,this.defaultPrevented=!1}_.prototype.u=!1,_.prototype.dispose=function(){this.u||(this.u=!0,this.N())},_.prototype[Symbol.dispose]=function(){this.dispose()},_.prototype.N=function(){if(this.C)for(;this.C.length;)this.C.shift()()},b.prototype.h=function(){this.defaultPrevented=!0};var v=function(){if(!i.addEventListener||!Object.defineProperty)return!1;var t=!1,e=Object.defineProperty({},"passive",{get:function(){t=!0}});try{const t=()=>{};i.addEventListener("test",t,e),i.removeEventListener("test",t,e)}catch(t){}return t}();function I(t){return/^[\s\xa0]*$/.test(t)}function T(t,e){b.call(this,t?t.type:""),this.relatedTarget=this.g=this.target=null,this.button=this.screenY=this.screenX=this.clientY=this.clientX=0,this.key="",this.metaKey=this.shiftKey=this.altKey=this.ctrlKey=!1,this.state=null,this.pointerId=0,this.pointerType="",this.i=null,t&&this.init(t,e)}l(T,b),T.prototype.init=function(t,e){const n=this.type=t.type,s=t.changedTouches&&t.changedTouches.length?t.changedTouches[0]:null;this.target=t.target||t.srcElement,this.g=e,(e=t.relatedTarget)||("mouseover"==n?e=t.fromElement:"mouseout"==n&&(e=t.toElement)),this.relatedTarget=e,s?(this.clientX=void 0!==s.clientX?s.clientX:s.pageX,this.clientY=void 0!==s.clientY?s.clientY:s.pageY,this.screenX=s.screenX||0,this.screenY=s.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=t.pointerType,this.state=t.state,this.i=t,t.defaultPrevented&&T.Z.h.call(this)},T.prototype.h=function(){T.Z.h.call(this);const t=this.i;t.preventDefault?t.preventDefault():t.returnValue=!1};var O="closure_listenable_"+(1e6*Math.random()|0),A=0;function S(t,e,n,s,r){this.listener=t,this.proxy=null,this.src=e,this.type=n,this.capture=!!s,this.ha=r,this.key=++A,this.da=this.fa=!1}function R(t){t.da=!0,t.listener=null,t.proxy=null,t.src=null,t.ha=null}function N(t,e,n){for(const s in t)e.call(n,t[s],s,t)}function x(t){const e={};for(const n in t)e[n]=t[n];return e}const k="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");function L(t,e){let n,s;for(let e=1;e<arguments.length;e++){for(n in s=arguments[e],s)t[n]=s[n];for(let e=0;e<k.length;e++)n=k[e],Object.prototype.hasOwnProperty.call(s,n)&&(t[n]=s[n])}}function F(t){this.src=t,this.g={},this.h=0}function P(t,e){const n=e.type;if(n in t.g){var s,r=t.g[n],i=Array.prototype.indexOf.call(r,e,void 0);(s=i>=0)&&Array.prototype.splice.call(r,i,1),s&&(R(e),0==t.g[n].length&&(delete t.g[n],t.h--))}}function M(t,e,n,s){for(let r=0;r<t.length;++r){const i=t[r];if(!i.da&&i.listener==e&&i.capture==!!n&&i.ha==s)return r}return-1}F.prototype.add=function(t,e,n,s,r){const i=t.toString();(t=this.g[i])||(t=this.g[i]=[],this.h++);const o=M(t,e,s,r);return o>-1?(e=t[o],n||(e.fa=!1)):((e=new S(e,this.src,i,!!s,r)).fa=n,t.push(e)),e};var G="closure_lm_"+(1e6*Math.random()|0),H={};function U(t,e,n,s,r){if(Array.isArray(e)){for(let i=0;i<e.length;i++)U(t,e[i],n,s,r);return null}return n=K(n),t&&t[O]?t.J(e,n,!!o(s)&&!!s.capture,r):function(t,e,n,s,r,i){if(!e)throw Error("Invalid event type");const a=o(r)?!!r.capture:!!r;let B=q(t);if(B||(t[G]=B=new F(t)),n=B.add(e,n,s,a,i),n.proxy)return n;if(s=function(){function t(n){return e.call(t.src,t.listener,n)}const e=J;return t}(),n.proxy=s,s.src=t,s.listener=n,t.addEventListener)v||(r=a),void 0===r&&(r=!1),t.addEventListener(e.toString(),s,r);else if(t.attachEvent)t.attachEvent($(e.toString()),s);else{if(!t.addListener||!t.removeListener)throw Error("addEventListener and attachEvent are unavailable.");t.addListener(s)}return n}(t,e,n,!1,s,r)}function V(t,e,n,s,r){if(Array.isArray(e))for(var i=0;i<e.length;i++)V(t,e[i],n,s,r);else s=o(s)?!!s.capture:!!s,n=K(n),t&&t[O]?(t=t.i,(i=String(e).toString())in t.g&&((n=M(e=t.g[i],n,s,r))>-1&&(R(e[n]),Array.prototype.splice.call(e,n,1),0==e.length&&(delete t.g[i],t.h--)))):t&&(t=q(t))&&(e=t.g[e.toString()],t=-1,e&&(t=M(e,n,s,r)),(n=t>-1?e[t]:null)&&j(n))}function j(t){if("number"!=typeof t&&t&&!t.da){var e=t.src;if(e&&e[O])P(e.i,t);else{var n=t.type,s=t.proxy;e.removeEventListener?e.removeEventListener(n,s,t.capture):e.detachEvent?e.detachEvent($(n),s):e.addListener&&e.removeListener&&e.removeListener(s),(n=q(e))?(P(n,t),0==n.h&&(n.src=null,e[G]=null)):R(t)}}}function $(t){return t in H?H[t]:H[t]="on"+t}function J(t,e){if(t.da)t=!0;else{e=new T(e,this);const n=t.listener,s=t.ha||t.src;t.fa&&j(t),t=n.call(s,e)}return t}function q(t){return(t=t[G])instanceof F?t:null}var z="__closure_events_fn_"+(1e9*Math.random()>>>0);function K(t){return"function"==typeof t?t:(t[z]||(t[z]=function(e){return t.handleEvent(e)}),t[z])}function Q(){_.call(this),this.i=new F(this),this.M=this,this.G=null}function W(t,e){var n,s=t.G;if(s)for(n=[];s;s=s.G)n.push(s);if(t=t.M,s=e.type||e,"string"==typeof e)e=new b(e,t);else if(e instanceof b)e.target=e.target||t;else{var r=e;L(e=new b(s,t),r)}let i,o;if(r=!0,n)for(o=n.length-1;o>=0;o--)i=e.g=n[o],r=Y(i,s,!0,e)&&r;if(i=e.g=t,r=Y(i,s,!0,e)&&r,r=Y(i,s,!1,e)&&r,n)for(o=0;o<n.length;o++)i=e.g=n[o],r=Y(i,s,!1,e)&&r}function Y(t,e,n,s){if(!(e=t.i.g[String(e)]))return!0;e=e.concat();let r=!0;for(let i=0;i<e.length;++i){const o=e[i];if(o&&!o.da&&o.capture==n){const e=o.listener,n=o.ha||o.src;o.fa&&P(t.i,o),r=!1!==e.call(n,s)&&r}}return r&&!s.defaultPrevented}function X(t){t.g=function(t,e){if("function"!=typeof t){if(!t||"function"!=typeof t.handleEvent)throw Error("Invalid listener argument");t=B(t.handleEvent,t)}return Number(e)>2147483647?-1:i.setTimeout(t,e||0)}(()=>{t.g=null,t.i&&(t.i=!1,X(t))},t.l);const e=t.h;t.h=null,t.m.apply(null,e)}l(Q,_),Q.prototype[O]=!0,Q.prototype.removeEventListener=function(t,e,n,s){V(this,t,e,n,s)},Q.prototype.N=function(){if(Q.Z.N.call(this),this.i){var t=this.i;for(const e in t.g){const n=t.g[e];for(let t=0;t<n.length;t++)R(n[t]);delete t.g[e],t.h--}}this.G=null},Q.prototype.J=function(t,e,n,s){return this.i.add(String(t),e,!1,n,s)},Q.prototype.K=function(t,e,n,s){return this.i.add(String(t),e,!0,n,s)};class Z extends _{constructor(t,e){super(),this.m=t,this.l=e,this.h=null,this.i=!1,this.g=null}j(t){this.h=arguments,this.g?this.i=!0:X(this)}N(){super.N(),this.g&&(i.clearTimeout(this.g),this.g=null,this.i=!1,this.h=null)}}function tt(t){_.call(this),this.h=t,this.g={}}l(tt,_);var et=[];function nt(t){N(t.g,function(t,e){this.g.hasOwnProperty(e)&&j(t)},t),t.g={}}tt.prototype.N=function(){tt.Z.N.call(this),nt(this)},tt.prototype.handleEvent=function(){throw Error("EventHandler.handleEvent not implemented")};var st=i.JSON.stringify,rt=i.JSON.parse,it=class{stringify(t){return i.JSON.stringify(t,void 0)}parse(t){return i.JSON.parse(t,void 0)}};function ot(){}function at(){}var Bt={OPEN:"a",hb:"b",ERROR:"c",tb:"d"};function ct(){b.call(this,"d")}function lt(){b.call(this,"c")}l(ct,b),l(lt,b);var ut={},ht=null;function dt(){return ht=ht||new Q}function pt(t){b.call(this,ut.Ia,t)}function ft(t){const e=dt();W(e,new pt(e))}function Ct(t,e){b.call(this,ut.STAT_EVENT,t),this.stat=e}function gt(t){const e=dt();W(e,new Ct(e,t))}function mt(t,e){b.call(this,ut.Ja,t),this.size=e}function wt(t,e){if("function"!=typeof t)throw Error("Fn must not be null and must be a function");return i.setTimeout(function(){t()},e)}function yt(){this.g=!0}function Et(t,e,n,s){t.info(function(){return"XMLHTTP TEXT ("+e+"): "+function(t,e){if(!t.g)return e;if(!e)return null;try{const i=JSON.parse(e);if(i)for(t=0;t<i.length;t++)if(Array.isArray(i[t])){var n=i[t];if(!(n.length<2)){var s=n[1];if(Array.isArray(s)&&!(s.length<1)){var r=s[0];if("noop"!=r&&"stop"!=r&&"close"!=r)for(let t=1;t<s.length;t++)s[t]=""}}}return st(i)}catch(t){return e}}(t,n)+(s?" "+s:"")})}ut.Ia="serverreachability",l(pt,b),ut.STAT_EVENT="statevent",l(Ct,b),ut.Ja="timingevent",l(mt,b),yt.prototype.ua=function(){this.g=!1},yt.prototype.info=function(){};var Dt,_t={NO_ERROR:0,cb:1,qb:2,pb:3,kb:4,ob:5,rb:6,Ga:7,TIMEOUT:8,ub:9},bt={ib:"complete",Fb:"success",ERROR:"error",Ga:"abort",xb:"ready",yb:"readystatechange",TIMEOUT:"timeout",sb:"incrementaldata",wb:"progress",lb:"downloadprogress",Nb:"uploadprogress"};function vt(){}function It(t){return encodeURIComponent(String(t))}function Tt(t){var e=1;t=t.split(":");const n=[];for(;e>0&&t.length;)n.push(t.shift()),e--;return t.length&&n.push(t.join(":")),n}function Ot(t,e,n,s){this.j=t,this.i=e,this.l=n,this.S=s||1,this.V=new tt(this),this.H=45e3,this.J=null,this.o=!1,this.u=this.B=this.A=this.M=this.F=this.T=this.D=null,this.G=[],this.g=null,this.C=0,this.m=this.v=null,this.X=-1,this.K=!1,this.P=0,this.O=null,this.W=this.L=this.U=this.R=!1,this.h=new At}function At(){this.i=null,this.g="",this.h=!1}l(vt,ot),vt.prototype.g=function(){return new XMLHttpRequest},Dt=new vt;var St={},Rt={};function Nt(t,e,n){t.M=1,t.A=se(Xt(e)),t.u=n,t.R=!0,xt(t,null)}function xt(t,e){t.F=Date.now(),Ft(t),t.B=Xt(t.A);var n=t.B,s=t.S;Array.isArray(s)||(s=[String(s)]),ge(n.i,"t",s),t.C=0,n=t.j.L,t.h=new At,t.g=sn(t.j,n?e:null,!t.u),t.P>0&&(t.O=new Z(B(t.Y,t,t.g),t.P)),e=t.V,n=t.g,s=t.ba;var r="readystatechange";Array.isArray(r)||(r&&(et[0]=r.toString()),r=et);for(let t=0;t<r.length;t++){const i=U(n,r[t],s||e.handleEvent,!1,e.h||e);if(!i)break;e.g[i.key]=i}e=t.J?x(t.J):{},t.u?(t.v||(t.v="POST"),e["Content-Type"]="application/x-www-form-urlencoded",t.g.ea(t.B,t.v,t.u,e)):(t.v="GET",t.g.ea(t.B,t.v,null,e)),ft(),function(t,e,n,s,r,i){t.info(function(){if(t.g)if(i){var o="",a=i.split("&");for(let t=0;t<a.length;t++){var B=a[t].split("=");if(B.length>1){const t=B[0];B=B[1];const e=t.split("_");o=e.length>=2&&"type"==e[1]?o+(t+"=")+B+"&":o+(t+"=redacted&")}}}else o=null;else o=i;return"XMLHTTP REQ ("+s+") [attempt "+r+"]: "+e+"\n"+n+"\n"+o})}(t.i,t.v,t.B,t.l,t.S,t.u)}function kt(t){return!!t.g&&("GET"==t.v&&2!=t.M&&t.j.Aa)}function Lt(t,e){var n=t.C,s=e.indexOf("\n",n);return-1==s?Rt:(n=Number(e.substring(n,s)),isNaN(n)?St:(s+=1)+n>e.length?Rt:(e=e.slice(s,s+n),t.C=s+n,e))}function Ft(t){t.T=Date.now()+t.H,Pt(t,t.H)}function Pt(t,e){if(null!=t.D)throw Error("WatchDog timer not null");t.D=wt(B(t.aa,t),e)}function Mt(t){t.D&&(i.clearTimeout(t.D),t.D=null)}function Gt(t){0==t.j.I||t.K||Xe(t.j,t)}function Ht(t){Mt(t);var e=t.O;e&&"function"==typeof e.dispose&&e.dispose(),t.O=null,nt(t.V),t.g&&(e=t.g,t.g=null,e.abort(),e.dispose())}function Ut(t,e){try{var n=t.j;if(0!=n.I&&(n.g==t||qt(n.h,t)))if(!t.L&&qt(n.h,t)&&3==n.I){try{var s=n.Ba.g.parse(e)}catch(t){s=null}if(Array.isArray(s)&&3==s.length){var r=s;if(0==r[0]){t:if(!n.v){if(n.g){if(!(n.g.F+3e3<t.F))break t;Ye(n),Ue(n)}Ke(n),gt(18)}}else n.xa=r[1],0<n.xa-n.K&&r[2]<37500&&n.F&&0==n.A&&!n.C&&(n.C=wt(B(n.Va,n),6e3));Jt(n.h)<=1&&n.ta&&(n.ta=void 0)}else tn(n,11)}else if((t.L||n.g==t)&&Ye(n),!I(e))for(r=n.Ba.g.parse(e),e=0;e<r.length;e++){let B=r[e];const l=B[0];if(!(l<=n.K))if(n.K=l,B=B[1],2==n.I)if("c"==B[0]){n.M=B[1],n.ba=B[2];const e=B[3];null!=e&&(n.ka=e,n.j.info("VER="+n.ka));const r=B[4];null!=r&&(n.za=r,n.j.info("SVER="+n.za));const l=B[5];null!=l&&"number"==typeof l&&l>0&&(s=1.5*l,n.O=s,n.j.info("backChannelRequestTimeoutMs_="+s)),s=n;const u=t.g;if(u){const t=u.g?u.g.getResponseHeader("X-Client-Wire-Protocol"):null;if(t){var i=s.h;i.g||-1==t.indexOf("spdy")&&-1==t.indexOf("quic")&&-1==t.indexOf("h2")||(i.j=i.l,i.g=new Set,i.h&&(zt(i,i.h),i.h=null))}if(s.G){const t=u.g?u.g.getResponseHeader("X-HTTP-Session-Id"):null;t&&(s.wa=t,ne(s.J,s.G,t))}}n.I=3,n.l&&n.l.ra(),n.aa&&(n.T=Date.now()-t.F,n.j.info("Handshake RTT: "+n.T+"ms"));var o=t;if((s=n).na=nn(s,s.L?s.ba:null,s.W),o.L){Kt(s.h,o);var a=o,c=s.O;c&&(a.H=c),a.D&&(Mt(a),Ft(a)),s.g=o}else ze(s);n.i.length>0&&je(n)}else"stop"!=B[0]&&"close"!=B[0]||tn(n,7);else 3==n.I&&("stop"==B[0]||"close"==B[0]?"stop"==B[0]?tn(n,7):He(n):"noop"!=B[0]&&n.l&&n.l.qa(B),n.A=0)}ft()}catch(t){}}Ot.prototype.ba=function(t){t=t.target;const e=this.O;e&&3==Fe(t)?e.j():this.Y(t)},Ot.prototype.Y=function(t){try{if(t==this.g)t:{const B=Fe(this.g),c=this.g.ya();this.g.ca();if(!(B<3)&&(3!=B||this.g&&(this.h.h||this.g.la()||Pe(this.g)))){this.K||4!=B||7==c||ft(),Mt(this);var e=this.g.ca();this.X=e;var n=function(t){if(!kt(t))return t.g.la();const e=Pe(t.g);if(""===e)return"";let n="";const s=e.length,r=4==Fe(t.g);if(!t.h.i){if("undefined"==typeof TextDecoder)return Ht(t),Gt(t),"";t.h.i=new i.TextDecoder}for(let i=0;i<s;i++)t.h.h=!0,n+=t.h.i.decode(e[i],{stream:!(r&&i==s-1)});return e.length=0,t.h.g+=n,t.C=0,t.h.g}(this);if(this.o=200==e,function(t,e,n,s,r,i,o){t.info(function(){return"XMLHTTP RESP ("+s+") [ attempt "+r+"]: "+e+"\n"+n+"\n"+i+" "+o})}(this.i,this.v,this.B,this.l,this.S,B,e),this.o){if(this.U&&!this.L){e:{if(this.g){var s,r=this.g;if((s=r.g?r.g.getResponseHeader("X-HTTP-Initial-Response"):null)&&!I(s)){var o=s;break e}}o=null}if(!(t=o)){this.o=!1,this.m=3,gt(12),Ht(this),Gt(this);break t}Et(this.i,this.l,t,"Initial handshake response via X-HTTP-Initial-Response"),this.L=!0,Ut(this,t)}if(this.R){let e;for(t=!0;!this.K&&this.C<n.length;){if(e=Lt(this,n),e==Rt){4==B&&(this.m=4,gt(14),t=!1),Et(this.i,this.l,null,"[Incomplete Response]");break}if(e==St){this.m=4,gt(15),Et(this.i,this.l,n,"[Invalid Chunk]"),t=!1;break}Et(this.i,this.l,e,null),Ut(this,e)}if(kt(this)&&0!=this.C&&(this.h.g=this.h.g.slice(this.C),this.C=0),4!=B||0!=n.length||this.h.h||(this.m=1,gt(16),t=!1),this.o=this.o&&t,t){if(n.length>0&&!this.W){this.W=!0;var a=this.j;a.g==this&&a.aa&&!a.P&&(a.j.info("Great, no buffering proxy detected. Bytes received: "+n.length),Qe(a),a.P=!0,gt(11))}}else Et(this.i,this.l,n,"[Invalid Chunked Response]"),Ht(this),Gt(this)}else Et(this.i,this.l,n,null),Ut(this,n);4==B&&Ht(this),this.o&&!this.K&&(4==B?Xe(this.j,this):(this.o=!1,Ft(this)))}else(function(t){const e={};t=(t.g&&Fe(t)>=2&&t.g.getAllResponseHeaders()||"").split("\r\n");for(let s=0;s<t.length;s++){if(I(t[s]))continue;var n=Tt(t[s]);const r=n[0];if("string"!=typeof(n=n[1]))continue;n=n.trim();const i=e[r]||[];e[r]=i,i.push(n)}!function(t,e){for(const n in t)e.call(void 0,t[n],n,t)}(e,function(t){return t.join(", ")})})(this.g),400==e&&n.indexOf("Unknown SID")>0?(this.m=3,gt(12)):(this.m=0,gt(13)),Ht(this),Gt(this)}}}catch(t){}},Ot.prototype.cancel=function(){this.K=!0,Ht(this)},Ot.prototype.aa=function(){this.D=null;const t=Date.now();t-this.T>=0?(function(t,e){t.info(function(){return"TIMEOUT: "+e})}(this.i,this.B),2!=this.M&&(ft(),gt(17)),Ht(this),this.m=2,Gt(this)):Pt(this,this.T-t)};var Vt=class{constructor(t,e){this.g=t,this.map=e}};function jt(t){this.l=t||10,i.PerformanceNavigationTiming?t=(t=i.performance.getEntriesByType("navigation")).length>0&&("hq"==t[0].nextHopProtocol||"h2"==t[0].nextHopProtocol):t=!!(i.chrome&&i.chrome.loadTimes&&i.chrome.loadTimes()&&i.chrome.loadTimes().wasFetchedViaSpdy),this.j=t?this.l:1,this.g=null,this.j>1&&(this.g=new Set),this.h=null,this.i=[]}function $t(t){return!!t.h||!!t.g&&t.g.size>=t.j}function Jt(t){return t.h?1:t.g?t.g.size:0}function qt(t,e){return t.h?t.h==e:!!t.g&&t.g.has(e)}function zt(t,e){t.g?t.g.add(e):t.h=e}function Kt(t,e){t.h&&t.h==e?t.h=null:t.g&&t.g.has(e)&&t.g.delete(e)}function Qt(t){if(null!=t.h)return t.i.concat(t.h.G);if(null!=t.g&&0!==t.g.size){let e=t.i;for(const n of t.g.values())e=e.concat(n.G);return e}return h(t.i)}jt.prototype.cancel=function(){if(this.i=Qt(this),this.h)this.h.cancel(),this.h=null;else if(this.g&&0!==this.g.size){for(const t of this.g.values())t.cancel();this.g.clear()}};var Wt=RegExp("^(?:([^:/?#.]+):)?(?://(?:([^\\\\/?#]*)@)?([^\\\\/?#]*?)(?::([0-9]+))?(?=[\\\\/?#]|$))?([^?#]+)?(?:\\?([^#]*))?(?:#([\\s\\S]*))?$");function Yt(t){let e;this.g=this.o=this.j="",this.u=null,this.m=this.h="",this.l=!1,t instanceof Yt?(this.l=t.l,Zt(this,t.j),this.o=t.o,this.g=t.g,te(this,t.u),this.h=t.h,ee(this,me(t.i)),this.m=t.m):t&&(e=String(t).match(Wt))?(this.l=!1,Zt(this,e[1]||"",!0),this.o=re(e[2]||""),this.g=re(e[3]||"",!0),te(this,e[4]),this.h=re(e[5]||"",!0),ee(this,e[6]||"",!0),this.m=re(e[7]||"")):(this.l=!1,this.i=new he(null,this.l))}function Xt(t){return new Yt(t)}function Zt(t,e,n){t.j=n?re(e,!0):e,t.j&&(t.j=t.j.replace(/:$/,""))}function te(t,e){if(e){if(e=Number(e),isNaN(e)||e<0)throw Error("Bad port number "+e);t.u=e}else t.u=null}function ee(t,e,n){e instanceof he?(t.i=e,function(t,e){e&&!t.j&&(de(t),t.i=null,t.g.forEach(function(t,e){const n=e.toLowerCase();e!=n&&(pe(this,e),ge(this,n,t))},t)),t.j=e}(t.i,t.l)):(n||(e=ie(e,le)),t.i=new he(e,t.l))}function ne(t,e,n){t.i.set(e,n)}function se(t){return ne(t,"zx",Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^Date.now()).toString(36)),t}function re(t,e){return t?e?decodeURI(t.replace(/%25/g,"%2525")):decodeURIComponent(t):""}function ie(t,e,n){return"string"==typeof t?(t=encodeURI(t).replace(e,oe),n&&(t=t.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),t):null}function oe(t){return"%"+((t=t.charCodeAt(0))>>4&15).toString(16)+(15&t).toString(16)}Yt.prototype.toString=function(){const t=[];var e=this.j;e&&t.push(ie(e,ae,!0),":");var n=this.g;return(n||"file"==e)&&(t.push("//"),(e=this.o)&&t.push(ie(e,ae,!0),"@"),t.push(It(n).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),null!=(n=this.u)&&t.push(":",String(n))),(n=this.h)&&(this.g&&"/"!=n.charAt(0)&&t.push("/"),t.push(ie(n,"/"==n.charAt(0)?ce:Be,!0))),(n=this.i.toString())&&t.push("?",n),(n=this.m)&&t.push("#",ie(n,ue)),t.join("")},Yt.prototype.resolve=function(t){const e=Xt(this);let n=!!t.j;n?Zt(e,t.j):n=!!t.o,n?e.o=t.o:n=!!t.g,n?e.g=t.g:n=null!=t.u;var s=t.h;if(n)te(e,t.u);else if(n=!!t.h){if("/"!=s.charAt(0))if(this.g&&!this.h)s="/"+s;else{var r=e.h.lastIndexOf("/");-1!=r&&(s=e.h.slice(0,r+1)+s)}if(".."==(r=s)||"."==r)s="";else if(-1!=r.indexOf("./")||-1!=r.indexOf("/.")){s=0==r.lastIndexOf("/",0),r=r.split("/");const t=[];for(let e=0;e<r.length;){const n=r[e++];"."==n?s&&e==r.length&&t.push(""):".."==n?((t.length>1||1==t.length&&""!=t[0])&&t.pop(),s&&e==r.length&&t.push("")):(t.push(n),s=!0)}s=t.join("/")}else s=r}return n?e.h=s:n=""!==t.i.toString(),n?ee(e,me(t.i)):n=!!t.m,n&&(e.m=t.m),e};var ae=/[#\/\?@]/g,Be=/[#\?:]/g,ce=/[#\?]/g,le=/[#\?@]/g,ue=/#/g;function he(t,e){this.h=this.g=null,this.i=t||null,this.j=!!e}function de(t){t.g||(t.g=new Map,t.h=0,t.i&&function(t,e){if(t){t=t.split("&");for(let n=0;n<t.length;n++){const s=t[n].indexOf("=");let r,i=null;s>=0?(r=t[n].substring(0,s),i=t[n].substring(s+1)):r=t[n],e(r,i?decodeURIComponent(i.replace(/\+/g," ")):"")}}}(t.i,function(e,n){t.add(decodeURIComponent(e.replace(/\+/g," ")),n)}))}function pe(t,e){de(t),e=we(t,e),t.g.has(e)&&(t.i=null,t.h-=t.g.get(e).length,t.g.delete(e))}function fe(t,e){return de(t),e=we(t,e),t.g.has(e)}function Ce(t,e){de(t);let n=[];if("string"==typeof e)fe(t,e)&&(n=n.concat(t.g.get(we(t,e))));else for(t=Array.from(t.g.values()),e=0;e<t.length;e++)n=n.concat(t[e]);return n}function ge(t,e,n){pe(t,e),n.length>0&&(t.i=null,t.g.set(we(t,e),h(n)),t.h+=n.length)}function me(t){const e=new he;return e.i=t.i,t.g&&(e.g=new Map(t.g),e.h=t.h),e}function we(t,e){return e=String(e),t.j&&(e=e.toLowerCase()),e}function ye(t,e,n,s,r){try{r&&(r.onload=null,r.onerror=null,r.onabort=null,r.ontimeout=null),s(n)}catch(t){}}function Ee(){this.g=new it}function De(t){this.i=t.Sb||null,this.h=t.ab||!1}function _e(t,e){Q.call(this),this.H=t,this.o=e,this.m=void 0,this.status=this.readyState=0,this.responseType=this.responseText=this.response=this.statusText="",this.onreadystatechange=null,this.A=new Headers,this.h=null,this.F="GET",this.D="",this.g=!1,this.B=this.j=this.l=null,this.v=new AbortController}function be(t){t.j.read().then(t.Ma.bind(t)).catch(t.ga.bind(t))}function ve(t){t.readyState=4,t.l=null,t.j=null,t.B=null,Ie(t)}function Ie(t){t.onreadystatechange&&t.onreadystatechange.call(t)}function Te(t){let e="";return N(t,function(t,n){e+=n,e+=":",e+=t,e+="\r\n"}),e}function Oe(t,e,n){t:{for(s in n){var s=!1;break t}s=!0}s||(n=Te(n),"string"==typeof t?null!=n&&It(n):ne(t,e,n))}function Ae(t){Q.call(this),this.headers=new Map,this.L=t||null,this.h=!1,this.g=null,this.D="",this.o=0,this.l="",this.j=this.B=this.v=this.A=!1,this.m=null,this.F="",this.H=!1}(t=he.prototype).add=function(t,e){de(this),this.i=null,t=we(this,t);let n=this.g.get(t);return n||this.g.set(t,n=[]),n.push(e),this.h+=1,this},t.forEach=function(t,e){de(this),this.g.forEach(function(n,s){n.forEach(function(n){t.call(e,n,s,this)},this)},this)},t.set=function(t,e){return de(this),this.i=null,fe(this,t=we(this,t))&&(this.h-=this.g.get(t).length),this.g.set(t,[e]),this.h+=1,this},t.get=function(t,e){return t&&(t=Ce(this,t)).length>0?String(t[0]):e},t.toString=function(){if(this.i)return this.i;if(!this.g)return"";const t=[],e=Array.from(this.g.keys());for(let s=0;s<e.length;s++){var n=e[s];const r=It(n);n=Ce(this,n);for(let e=0;e<n.length;e++){let s=r;""!==n[e]&&(s+="="+It(n[e])),t.push(s)}}return this.i=t.join("&")},l(De,ot),De.prototype.g=function(){return new _e(this.i,this.h)},l(_e,Q),(t=_e.prototype).open=function(t,e){if(0!=this.readyState)throw this.abort(),Error("Error reopening a connection");this.F=t,this.D=e,this.readyState=1,Ie(this)},t.send=function(t){if(1!=this.readyState)throw this.abort(),Error("need to call open() first. ");if(this.v.signal.aborted)throw this.abort(),Error("Request was aborted.");this.g=!0;const e={headers:this.A,method:this.F,credentials:this.m,cache:void 0,signal:this.v.signal};t&&(e.body=t),(this.H||i).fetch(new Request(this.D,e)).then(this.Pa.bind(this),this.ga.bind(this))},t.abort=function(){this.response=this.responseText="",this.A=new Headers,this.status=0,this.v.abort(),this.j&&this.j.cancel("Request was aborted.").catch(()=>{}),this.readyState>=1&&this.g&&4!=this.readyState&&(this.g=!1,ve(this)),this.readyState=0},t.Pa=function(t){if(this.g&&(this.l=t,this.h||(this.status=this.l.status,this.statusText=this.l.statusText,this.h=t.headers,this.readyState=2,Ie(this)),this.g&&(this.readyState=3,Ie(this),this.g)))if("arraybuffer"===this.responseType)t.arrayBuffer().then(this.Na.bind(this),this.ga.bind(this));else if(void 0!==i.ReadableStream&&"body"in t){if(this.j=t.body.getReader(),this.o){if(this.responseType)throw Error('responseType must be empty for "streamBinaryChunks" mode responses.');this.response=[]}else this.response=this.responseText="",this.B=new TextDecoder;be(this)}else t.text().then(this.Oa.bind(this),this.ga.bind(this))},t.Ma=function(t){if(this.g){if(this.o&&t.value)this.response.push(t.value);else if(!this.o){var e=t.value?t.value:new Uint8Array(0);(e=this.B.decode(e,{stream:!t.done}))&&(this.response=this.responseText+=e)}t.done?ve(this):Ie(this),3==this.readyState&&be(this)}},t.Oa=function(t){this.g&&(this.response=this.responseText=t,ve(this))},t.Na=function(t){this.g&&(this.response=t,ve(this))},t.ga=function(){this.g&&ve(this)},t.setRequestHeader=function(t,e){this.A.append(t,e)},t.getResponseHeader=function(t){return this.h&&this.h.get(t.toLowerCase())||""},t.getAllResponseHeaders=function(){if(!this.h)return"";const t=[],e=this.h.entries();for(var n=e.next();!n.done;)n=n.value,t.push(n[0]+": "+n[1]),n=e.next();return t.join("\r\n")},Object.defineProperty(_e.prototype,"withCredentials",{get:function(){return"include"===this.m},set:function(t){this.m=t?"include":"same-origin"}}),l(Ae,Q);var Se=/^https?$/i,Re=["POST","PUT"];function Ne(t,e){t.h=!1,t.g&&(t.j=!0,t.g.abort(),t.j=!1),t.l=e,t.o=5,xe(t),Le(t)}function xe(t){t.A||(t.A=!0,W(t,"complete"),W(t,"error"))}function ke(t){if(t.h&&void 0!==r)if(t.v&&4==Fe(t))setTimeout(t.Ca.bind(t),0);else if(W(t,"readystatechange"),4==Fe(t)){t.h=!1;try{const r=t.ca();t:switch(r){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var e=!0;break t;default:e=!1}var n;if(!(n=e)){var s;if(s=0===r){let e=String(t.D).match(Wt)[1]||null;!e&&i.self&&i.self.location&&(e=i.self.location.protocol.slice(0,-1)),s=!Se.test(e?e.toLowerCase():"")}n=s}if(n)W(t,"complete"),W(t,"success");else{t.o=6;try{var o=Fe(t)>2?t.g.statusText:""}catch(t){o=""}t.l=o+" ["+t.ca()+"]",xe(t)}}finally{Le(t)}}}function Le(t,e){if(t.g){t.m&&(clearTimeout(t.m),t.m=null);const n=t.g;t.g=null,e||W(t,"ready");try{n.onreadystatechange=null}catch(t){}}}function Fe(t){return t.g?t.g.readyState:0}function Pe(t){try{if(!t.g)return null;if("response"in t.g)return t.g.response;switch(t.F){case"":case"text":return t.g.responseText;case"arraybuffer":if("mozResponseArrayBuffer"in t.g)return t.g.mozResponseArrayBuffer}return null}catch(t){return null}}function Me(t,e,n){return n&&n.internalChannelParams&&n.internalChannelParams[t]||e}function Ge(t){this.za=0,this.i=[],this.j=new yt,this.ba=this.na=this.J=this.W=this.g=this.wa=this.G=this.H=this.u=this.U=this.o=null,this.Ya=this.V=0,this.Sa=Me("failFast",!1,t),this.F=this.C=this.v=this.m=this.l=null,this.X=!0,this.xa=this.K=-1,this.Y=this.A=this.D=0,this.Qa=Me("baseRetryDelayMs",5e3,t),this.Za=Me("retryDelaySeedMs",1e4,t),this.Ta=Me("forwardChannelMaxRetries",2,t),this.va=Me("forwardChannelRequestTimeoutMs",2e4,t),this.ma=t&&t.xmlHttpFactory||void 0,this.Ua=t&&t.Rb||void 0,this.Aa=t&&t.useFetchStreams||!1,this.O=void 0,this.L=t&&t.supportsCrossDomainXhr||!1,this.M="",this.h=new jt(t&&t.concurrentRequestLimit),this.Ba=new Ee,this.S=t&&t.fastHandshake||!1,this.R=t&&t.encodeInitMessageHeaders||!1,this.S&&this.R&&(this.R=!1),this.Ra=t&&t.Pb||!1,t&&t.ua&&this.j.ua(),t&&t.forceLongPolling&&(this.X=!1),this.aa=!this.S&&this.X&&t&&t.detectBufferingProxy||!1,this.ia=void 0,t&&t.longPollingTimeout&&t.longPollingTimeout>0&&(this.ia=t.longPollingTimeout),this.ta=void 0,this.T=0,this.P=!1,this.ja=this.B=null}function He(t){if(Ve(t),3==t.I){var e=t.V++,n=Xt(t.J);if(ne(n,"SID",t.M),ne(n,"RID",e),ne(n,"TYPE","terminate"),Je(t,n),(e=new Ot(t,t.j,e)).M=2,e.A=se(Xt(n)),n=!1,i.navigator&&i.navigator.sendBeacon)try{n=i.navigator.sendBeacon(e.A.toString(),"")}catch(t){}!n&&i.Image&&((new Image).src=e.A,n=!0),n||(e.g=sn(e.j,null),e.g.ea(e.A)),e.F=Date.now(),Ft(e)}en(t)}function Ue(t){t.g&&(Qe(t),t.g.cancel(),t.g=null)}function Ve(t){Ue(t),t.v&&(i.clearTimeout(t.v),t.v=null),Ye(t),t.h.cancel(),t.m&&("number"==typeof t.m&&i.clearTimeout(t.m),t.m=null)}function je(t){if(!$t(t.h)&&!t.m){t.m=!0;var e=t.Ea;m||E(),w||(m(),w=!0),y.add(e,t),t.D=0}}function $e(t,e){var n;n=e?e.l:t.V++;const s=Xt(t.J);ne(s,"SID",t.M),ne(s,"RID",n),ne(s,"AID",t.K),Je(t,s),t.u&&t.o&&Oe(s,t.u,t.o),n=new Ot(t,t.j,n,t.D+1),null===t.u&&(n.J=t.o),e&&(t.i=e.G.concat(t.i)),e=qe(t,n,1e3),n.H=Math.round(.5*t.va)+Math.round(.5*t.va*Math.random()),zt(t.h,n),Nt(n,s,e)}function Je(t,e){t.H&&N(t.H,function(t,n){ne(e,n,t)}),t.l&&N({},function(t,n){ne(e,n,t)})}function qe(t,e,n){n=Math.min(t.i.length,n);const s=t.l?B(t.l.Ka,t.l,t):null;t:{var r=t.i;let e=-1;for(;;){const t=["count="+n];-1==e?n>0?(e=r[0].g,t.push("ofs="+e)):e=0:t.push("ofs="+e);let B=!0;for(let c=0;c<n;c++){var i=r[c].g;const n=r[c].map;if((i-=e)<0)e=Math.max(0,r[c].g-100),B=!1;else try{i="req"+i+"_"||"";try{var a=n instanceof Map?n:Object.entries(n);for(const[e,n]of a){let s=n;o(n)&&(s=st(n)),t.push(i+e+"="+encodeURIComponent(s))}}catch(e){throw t.push(i+"type="+encodeURIComponent("_badmap")),e}}catch(t){s&&s(n)}}if(B){a=t.join("&");break t}}a=void 0}return t=t.i.splice(0,n),e.G=t,a}function ze(t){if(!t.g&&!t.v){t.Y=1;var e=t.Da;m||E(),w||(m(),w=!0),y.add(e,t),t.A=0}}function Ke(t){return!(t.g||t.v||t.A>=3)&&(t.Y++,t.v=wt(B(t.Da,t),Ze(t,t.A)),t.A++,!0)}function Qe(t){null!=t.B&&(i.clearTimeout(t.B),t.B=null)}function We(t){t.g=new Ot(t,t.j,"rpc",t.Y),null===t.u&&(t.g.J=t.o),t.g.P=0;var e=Xt(t.na);ne(e,"RID","rpc"),ne(e,"SID",t.M),ne(e,"AID",t.K),ne(e,"CI",t.F?"0":"1"),!t.F&&t.ia&&ne(e,"TO",t.ia),ne(e,"TYPE","xmlhttp"),Je(t,e),t.u&&t.o&&Oe(e,t.u,t.o),t.O&&(t.g.H=t.O);var n=t.g;t=t.ba,n.M=1,n.A=se(Xt(e)),n.u=null,n.R=!0,xt(n,t)}function Ye(t){null!=t.C&&(i.clearTimeout(t.C),t.C=null)}function Xe(t,e){var n=null;if(t.g==e){Ye(t),Qe(t),t.g=null;var s=2}else{if(!qt(t.h,e))return;n=e.G,Kt(t.h,e),s=1}if(0!=t.I)if(e.o)if(1==s){n=e.u?e.u.length:0,e=Date.now()-e.F;var r=t.D;W(s=dt(),new mt(s,n)),je(t)}else ze(t);else if(3==(r=e.m)||0==r&&e.X>0||!(1==s&&function(t,e){return!(Jt(t.h)>=t.h.j-(t.m?1:0)||(t.m?(t.i=e.G.concat(t.i),0):1==t.I||2==t.I||t.D>=(t.Sa?0:t.Ta)||(t.m=wt(B(t.Ea,t,e),Ze(t,t.D)),t.D++,0)))}(t,e)||2==s&&Ke(t)))switch(n&&n.length>0&&(e=t.h,e.i=e.i.concat(n)),r){case 1:tn(t,5);break;case 4:tn(t,10);break;case 3:tn(t,6);break;default:tn(t,2)}}function Ze(t,e){let n=t.Qa+Math.floor(Math.random()*t.Za);return t.isActive()||(n*=2),n*e}function tn(t,e){if(t.j.info("Error code "+e),2==e){var n=B(t.bb,t),s=t.Ua;const e=!s;s=new Yt(s||"//www.google.com/images/cleardot.gif"),i.location&&"http"==i.location.protocol||Zt(s,"https"),se(s),e?function(t,e){const n=new yt;if(i.Image){const s=new Image;s.onload=c(ye,n,"TestLoadImage: loaded",!0,e,s),s.onerror=c(ye,n,"TestLoadImage: error",!1,e,s),s.onabort=c(ye,n,"TestLoadImage: abort",!1,e,s),s.ontimeout=c(ye,n,"TestLoadImage: timeout",!1,e,s),i.setTimeout(function(){s.ontimeout&&s.ontimeout()},1e4),s.src=t}else e(!1)}(s.toString(),n):function(t,e){new yt;const n=new AbortController,s=setTimeout(()=>{n.abort(),ye(0,0,!1,e)},1e4);fetch(t,{signal:n.signal}).then(t=>{clearTimeout(s),t.ok?ye(0,0,!0,e):ye(0,0,!1,e)}).catch(()=>{clearTimeout(s),ye(0,0,!1,e)})}(s.toString(),n)}else gt(2);t.I=0,t.l&&t.l.pa(e),en(t),Ve(t)}function en(t){if(t.I=0,t.ja=[],t.l){const e=Qt(t.h);0==e.length&&0==t.i.length||(d(t.ja,e),d(t.ja,t.i),t.h.i.length=0,h(t.i),t.i.length=0),t.l.oa()}}function nn(t,e,n){var s=n instanceof Yt?Xt(n):new Yt(n);if(""!=s.g)e&&(s.g=e+"."+s.g),te(s,s.u);else{var r=i.location;s=r.protocol,e=e?e+"."+r.hostname:r.hostname,r=+r.port;const t=new Yt(null);s&&Zt(t,s),e&&(t.g=e),r&&te(t,r),n&&(t.h=n),s=t}return n=t.G,e=t.wa,n&&e&&ne(s,n,e),ne(s,"VER",t.ka),Je(t,s),s}function sn(t,e,n){if(e&&!t.L)throw Error("Can't create secondary domain capable XhrIo object.");return(e=t.Aa&&!t.ma?new Ae(new De({ab:n})):new Ae(t.ma)).Fa(t.L),e}function rn(){}function on(){}function an(t,e){Q.call(this),this.g=new Ge(e),this.l=t,this.h=e&&e.messageUrlParams||null,t=e&&e.messageHeaders||null,e&&e.clientProtocolHeaderRequired&&(t?t["X-Client-Protocol"]="webchannel":t={"X-Client-Protocol":"webchannel"}),this.g.o=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.sa&&(t?t["X-WebChannel-Client-Profile"]=e.sa:t={"X-WebChannel-Client-Profile":e.sa}),this.g.U=t,(t=e&&e.Qb)&&!I(t)&&(this.g.u=t),this.A=e&&e.supportsCrossDomainXhr||!1,this.v=e&&e.sendRawJson||!1,(e=e&&e.httpSessionIdParam)&&!I(e)&&(this.g.G=e,null!==(t=this.h)&&e in t&&(e in(t=this.h)&&delete t[e])),this.j=new ln(this)}function Bn(t){ct.call(this),t.__headers__&&(this.headers=t.__headers__,this.statusCode=t.__status__,delete t.__headers__,delete t.__status__);var e=t.__sm__;if(e){t:{for(const n in e){t=n;break t}t=void 0}(this.i=t)&&(t=this.i,e=null!==e&&t in e?e[t]:void 0),this.data=e}else this.data=t}function cn(){lt.call(this),this.status=1}function ln(t){this.g=t}(t=Ae.prototype).Fa=function(t){this.H=t},t.ea=function(t,e,n,s){if(this.g)throw Error("[goog.net.XhrIo] Object is active with another request="+this.D+"; newUri="+t);e=e?e.toUpperCase():"GET",this.D=t,this.l="",this.o=0,this.A=!1,this.h=!0,this.g=this.L?this.L.g():Dt.g(),this.g.onreadystatechange=u(B(this.Ca,this));try{this.B=!0,this.g.open(e,String(t),!0),this.B=!1}catch(t){return void Ne(this,t)}if(t=n||"",n=new Map(this.headers),s)if(Object.getPrototypeOf(s)===Object.prototype)for(var r in s)n.set(r,s[r]);else{if("function"!=typeof s.keys||"function"!=typeof s.get)throw Error("Unknown input type for opt_headers: "+String(s));for(const t of s.keys())n.set(t,s.get(t))}s=Array.from(n.keys()).find(t=>"content-type"==t.toLowerCase()),r=i.FormData&&t instanceof i.FormData,!(Array.prototype.indexOf.call(Re,e,void 0)>=0)||s||r||n.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8");for(const[t,e]of n)this.g.setRequestHeader(t,e);this.F&&(this.g.responseType=this.F),"withCredentials"in this.g&&this.g.withCredentials!==this.H&&(this.g.withCredentials=this.H);try{this.m&&(clearTimeout(this.m),this.m=null),this.v=!0,this.g.send(t),this.v=!1}catch(t){Ne(this,t)}},t.abort=function(t){this.g&&this.h&&(this.h=!1,this.j=!0,this.g.abort(),this.j=!1,this.o=t||7,W(this,"complete"),W(this,"abort"),Le(this))},t.N=function(){this.g&&(this.h&&(this.h=!1,this.j=!0,this.g.abort(),this.j=!1),Le(this,!0)),Ae.Z.N.call(this)},t.Ca=function(){this.u||(this.B||this.v||this.j?ke(this):this.Xa())},t.Xa=function(){ke(this)},t.isActive=function(){return!!this.g},t.ca=function(){try{return Fe(this)>2?this.g.status:-1}catch(t){return-1}},t.la=function(){try{return this.g?this.g.responseText:""}catch(t){return""}},t.La=function(t){if(this.g){var e=this.g.responseText;return t&&0==e.indexOf(t)&&(e=e.substring(t.length)),rt(e)}},t.ya=function(){return this.o},t.Ha=function(){return"string"==typeof this.l?this.l:String(this.l)},(t=Ge.prototype).ka=8,t.I=1,t.connect=function(t,e,n,s){gt(0),this.W=t,this.H=e||{},n&&void 0!==s&&(this.H.OSID=n,this.H.OAID=s),this.F=this.X,this.J=nn(this,null,this.W),je(this)},t.Ea=function(t){if(this.m)if(this.m=null,1==this.I){if(!t){this.V=Math.floor(1e5*Math.random()),t=this.V++;const r=new Ot(this,this.j,t);let i=this.o;if(this.U&&(i?(i=x(i),L(i,this.U)):i=this.U),null!==this.u||this.R||(r.J=i,i=null),this.S)t:{for(var e=0,n=0;n<this.i.length;n++){var s=this.i[n];if(void 0===(s="__data__"in s.map&&"string"==typeof(s=s.map.__data__)?s.length:void 0))break;if((e+=s)>4096){e=n;break t}if(4096===e||n===this.i.length-1){e=n+1;break t}}e=1e3}else e=1e3;e=qe(this,r,e),ne(n=Xt(this.J),"RID",t),ne(n,"CVER",22),this.G&&ne(n,"X-HTTP-Session-Id",this.G),Je(this,n),i&&(this.R?e="headers="+It(Te(i))+"&"+e:this.u&&Oe(n,this.u,i)),zt(this.h,r),this.Ra&&ne(n,"TYPE","init"),this.S?(ne(n,"$req",e),ne(n,"SID","null"),r.U=!0,Nt(r,n,null)):Nt(r,n,e),this.I=2}}else 3==this.I&&(t?$e(this,t):0==this.i.length||$t(this.h)||$e(this))},t.Da=function(){if(this.v=null,We(this),this.aa&&!(this.P||null==this.g||this.T<=0)){var t=4*this.T;this.j.info("BP detection timer enabled: "+t),this.B=wt(B(this.Wa,this),t)}},t.Wa=function(){this.B&&(this.B=null,this.j.info("BP detection timeout reached."),this.j.info("Buffering proxy detected and switch to long-polling!"),this.F=!1,this.P=!0,gt(10),Ue(this),We(this))},t.Va=function(){null!=this.C&&(this.C=null,Ue(this),Ke(this),gt(19))},t.bb=function(t){t?(this.j.info("Successfully pinged google.com"),gt(2)):(this.j.info("Failed to ping google.com"),gt(1))},t.isActive=function(){return!!this.l&&this.l.isActive(this)},(t=rn.prototype).ra=function(){},t.qa=function(){},t.pa=function(){},t.oa=function(){},t.isActive=function(){return!0},t.Ka=function(){},on.prototype.g=function(t,e){return new an(t,e)},l(an,Q),an.prototype.m=function(){this.g.l=this.j,this.A&&(this.g.L=!0),this.g.connect(this.l,this.h||void 0)},an.prototype.close=function(){He(this.g)},an.prototype.o=function(t){var e=this.g;if("string"==typeof t){var n={};n.__data__=t,t=n}else this.v&&((n={}).__data__=st(t),t=n);e.i.push(new Vt(e.Ya++,t)),3==e.I&&je(e)},an.prototype.N=function(){this.g.l=null,delete this.j,He(this.g),delete this.g,an.Z.N.call(this)},l(Bn,ct),l(cn,lt),l(ln,rn),ln.prototype.ra=function(){W(this.g,"a")},ln.prototype.qa=function(t){W(this.g,new Bn(t))},ln.prototype.pa=function(t){W(this.g,new cn)},ln.prototype.oa=function(){W(this.g,"b")},on.prototype.createWebChannel=on.prototype.g,an.prototype.send=an.prototype.o,an.prototype.open=an.prototype.m,an.prototype.close=an.prototype.close,iB=function(){return new on},rB=function(){return dt()},sB=ut,nB={jb:0,mb:1,nb:2,Hb:3,Mb:4,Jb:5,Kb:6,Ib:7,Gb:8,Lb:9,PROXY:10,NOPROXY:11,Eb:12,Ab:13,Bb:14,zb:15,Cb:16,Db:17,fb:18,eb:19,gb:20},_t.NO_ERROR=0,_t.TIMEOUT=8,_t.HTTP_ERROR=6,eB=_t,bt.COMPLETE="complete",tB=bt,at.EventType=Bt,Bt.OPEN="a",Bt.CLOSE="b",Bt.ERROR="c",Bt.MESSAGE="d",Q.prototype.listen=Q.prototype.J,Za=at,Ae.prototype.listenOnce=Ae.prototype.K,Ae.prototype.getLastError=Ae.prototype.Ha,Ae.prototype.getLastErrorCode=Ae.prototype.ya,Ae.prototype.getStatus=Ae.prototype.ca,Ae.prototype.getResponseJson=Ae.prototype.La,Ae.prototype.getResponseText=Ae.prototype.la,Ae.prototype.send=Ae.prototype.ea,Ae.prototype.setWithCredentials=Ae.prototype.Fa,Xa=Ae}).apply(void 0!==oB?oB:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{});var aB=class t{static FOLD_CASE=1;static LITERAL=2;static CLASS_NL=4;static DOT_NL=8;static ONE_LINE=16;static NON_GREEDY=32;static PERL_X=64;static UNICODE_GROUPS=128;static WAS_DOLLAR=256;static LOOKBEHIND=512;static MATCH_NL=t.CLASS_NL|t.DOT_NL;static PERL=t.CLASS_NL|t.ONE_LINE|t.PERL_X|t.UNICODE_GROUPS;static POSIX=0;static UNANCHORED=0;static ANCHOR_START=1;static ANCHOR_BOTH=2};const BB=1,cB=2,lB=4,uB=8,hB=16,dB=512,pB=128,fB=new Int32Array(pB),CB=new Int32Array(pB),gB=65535;for(let t=0;t<pB;t++)fB[t]=t>=97&&t<=122?t-32:t,CB[t]=t>=65&&t<=90?t+32:t;var mB=class{static CODES=Object.freeze({"":7,"\b":8,"\t":9,"\n":10,"\v":11,"\f":12,"\r":13," ":32,'"':34,$:36,"&":38,"'":39,"(":40,")":41,"*":42,"+":43,"-":45,".":46,0:48,1:49,2:50,3:51,4:52,5:53,6:54,7:55,8:56,9:57,":":58,"<":60,">":62,"?":63,A:65,B:66,C:67,F:70,P:80,Q:81,U:85,Z:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,a:97,b:98,f:102,i:105,m:109,n:110,r:114,s:115,t:116,v:118,x:120,z:122,"{":123,"|":124,"}":125});static toUpperCase(t){if(t<pB)return fB[t];const e=String.fromCodePoint(t).toUpperCase(),n=e.codePointAt(0)>gB?2:1;if(e.length>n)return t;const s=String.fromCodePoint(e.codePointAt(0)).toLowerCase(),r=s.codePointAt(0)>gB?2:1;return s.length>r||s.codePointAt(0)!==t?t:e.codePointAt(0)}static toLowerCase(t){if(t<pB)return CB[t];const e=String.fromCodePoint(t).toLowerCase(),n=e.codePointAt(0)>gB?2:1;if(e.length>n)return t;const s=String.fromCodePoint(e.codePointAt(0)).toUpperCase(),r=s.codePointAt(0)>gB?2:1;return s.length>r||s.codePointAt(0)!==t?t:e.codePointAt(0)}},wB=class{constructor(t,e=!1){this.data=t,this.isStride1=e,this.SIZE=e?2:3}getLo(t){return this.data[t*this.SIZE]}getHi(t){return this.data[t*this.SIZE+1]}getStride(t){return this.isStride1?1:this.data[t*this.SIZE+2]}get length(){return this.data.length/this.SIZE}};const yB=new Uint8Array(256);for(let t=0;t<64;t++)yB["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-".charCodeAt(t)]=t;const EB=t=>{const e=[];let n=0,s=0;for(let r=0;r<t.length;r++){const i=yB[t.charCodeAt(r)];n|=(31&i)<<s,32&i?s+=5:(e.push(n),n=0,s=0)}return e},DB=(t,e)=>{const n=EB(t),s=e?n.length/2:n.length/3,r=new Uint32Array(3*s);let i=0,o=0;for(let t=0;t<s;t++)i+=n[o++],r[3*t]=i,i+=n[o++],r[3*t+1]=i,r[3*t+2]=e?1:n[o++];return r};var _B=class{constructor(t){this.initializer=t,this.cache=new Map}has(t){return t in this.initializer}get(t){if(this.cache.has(t))return this.cache.get(t);const e=this.initializer[t],n=e?e():null;return this.cache.set(t,n),n}},bB=class{static _CASE_ORBIT=null;static get CASE_ORBIT(){return this._CASE_ORBIT||(this._CASE_ORBIT=(t=>{const e=EB(t),n=new Map;let s=0;for(let t=0;t<e.length;t+=2){s+=e[t];const r=e[t+1],i=r>>>1^-(1&r);n.set(s,s+i)}return n})("rCgCIgCY+rQI4QiCuuBLgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCCgCBgCBgCBgCBgCBgCBgCB+7OB-BB-BB-BB-BB-BBskQB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BC-BB-BB-BB-BB-BB-BB-BByHBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBDCBBBCBBBCBBCCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBCCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBxHBCBBBCBBBCBBB3SBmMBkNBCBBBCBBB8MBCBBB6MB6MBCBBC+EB0MB2MBCBBB6MB+MBiGBmNBiNBCBBBmKBikzCBmNBqNBkIBsNBCBBBCBBBCBBB0NBCBBB0NDCBBB0NBCBBByNByNBCBBBCBBB2NBCBBDCBBCwDFCBCBDBCBCBDBCBCBDBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBB9EBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBCCBCBDBCBBBhGBvDBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBjICCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBH2iVBCBBBlKBwiVB+jVB+jVBCBBBlMBqEBuEBCBBBCBBBCBBBCBBBCBBB+hVB4hVB8hVBjNB7MC5MB5MCzMC1MB+0yCE5MB20yCC9MBu2yCBwyyCBo0yCChNBlNBo0yCBu-UBi0yCDlNC6-UBpNDrNIu+UDzNCm0yCBzNE0yyCBzNBpEBxNBxNBtEG1NLqxyCBkxyCnFoFrBCBBBCBBDCBBEkIBkIBkICoHHsCCqCBqCBqCCgEC+DB+DBmkOBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCC+BBgCBgCBgCBgCBgCBgCBgCBgCBrCBpCBpCBpCBmjOB-BB8BB-BB-BBgEB-BB-BByBBqgOBsDB-BBtwBB-BB-BB-BBsBBgDBCB-BB-BB-BBeB-BB-BB61OB-BB-BB-DB9DB9DBQB7DBmCE9CBrDBPBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBrFB-EBOBnHB3FB-FCCBBBNBCBBCjIBjIBjIBgFBgFBgFBgFBgFBgFBgFBgFBgFBgFBgFBgFBgFBgFBgFBgFBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCB-BB-BB8kMB-BB6kMB-BB-BB-BB-BB-BB-BB-BB-BB-BBokMB-BB-BBkkMBkkMB-BB-BB-BB-BB-BB-BB-BB4jMB-BB-BB-BB-BB-BB-EB-EB-EB-EB-EB-EB-EB-EB-EB-EB-EB-EB-EB-EB-EB-EBCBBBCBoiMBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBJCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBeBCBBBCBBBCBBBCBBBCBBBCBBBCBBBdBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBCgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDL-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-C64CgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOCgmOGgmODg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FDg8FBg8FBg8FhVg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBQBQBQBQBQBQDPBPBPBPBPBPjkC7mMB5mMBnmMBjmMBCBlmMB3lMBpiMBk8kCBCBBG-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FD-7FB-7FB-7F6FoglCEsuHRwjlCyDCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCB0DBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBG1DD97OCCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBQBQBQBQBQBQBQBQBPBPBPBPBPBPBPBPBQBQBQBQBQBQDPBPBPBPBPBPDQBQBQBQBQBQBQBQBPBPBPBPBPBPBPBPBQBQBQBQBQBQBQBQBPBPBPBPBPBPBPBPBQBQBQBQBQBQDPBPBPBPBPBPEQCQCQCQCPCPCPCPBQBQBQBQBQBQBQBQBPBPBPBPBPBPBPBPB0EB0EBsFBsFBsFBsFBoGBoGBgIBgIBgHBgHB8HB8HDQBQBQBQBQBQBQBQBPBPBPBPBPBPBPBPBQBQBQBQBQBQBQBQBPBPBPBPBPBPBPBPBQBQBQBQBQBQBQBQBPBPBPBPBPBPBPBPBQBQCSFPBPBzEBzEBRCxnOFSFrFBrFBrFBrFBREQBQClkOFPBPBnGBnGFQBQCljOCODPBPB-GB-GBNHSF-HB-HB7HB7HBRqJ53OE9tQBrmQH4Bc3BSgBBgBBgBBgBBgBBgBBgBBgBBgBBgBBgBBgBBgBBgBBgBBgBBfBfBfBfBfBfBfBfBfBfBfBfBfBfBfBfECBByZ0BB0BB0BB0BB0BB0BB0BB0BB0BB0BB0BB0BB0BB0BB0BB0BB0BB0BB0BB0BB0BB0BB0BB0BB0BB0BBzBBzBBzBBzBBzBBzBBzBBzBBzBBzBBzBBzBBzBBzBBzBBzBBzBBzBBzBBzBBzBBzBBzBBzBBzBBzB34BgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CBCBBBt-UBruHBt+UB1iVBviVBCBBBCBBBCBBB3hVB5-UB9hVB7hVCCBBCCBBI9jVB9jVBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBICBBBCBBECBBN-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOC-lOG-lOzoeCBBBCBBBCBBBCBBBCBBBCBl8kCBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBTCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBnECBBBCBBBCBBBCBBBCBBBCBBBCBBDCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBKCBBBCBBBnglCBCBBBCBBBCBBBCBBBCBBECBBBvyyCDCBBBCBBBgDCCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBn0yCB90yCB10yCBh0yCBn0yCCjxyCBzyyCBpxyCBg6BBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBB-CBl0yCBvjlCBCBBBCBBBt2yCBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBhkzCZCBB9a-5Bd-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCm6TCBB7gBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCH-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BmlBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvChDwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCFvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvC1DuCBuCBuCBuCBuCBuCBuCBuCBuCBuCBuCCuCBuCBuCBuCBuCBuCBuCBuCBuCBuCBuCBuCBuCBuCBuCCuCBuCBuCBuCBuCBuCBuCCuCBuCCtCBtCBtCBtCBtCBtCBtCBtCBtCBtCBtCCtCBtCBtCBtCBtCBtCBtCBtCBtCBtCBtCBtCBtCBtCBtCCtCBtCBtCBtCBtCBtCBtCCtCBtCk2BgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEO-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-D+CgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCL-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-B74CgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BhrVgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BhB2BB2BB2BB2BB2BB2BB2BB2BB2BB2BB2BB2BB2BB2BB2BB2BB2BB2BB2BB2BB2BB2BB2BB2BB2BD1BB1BB1BB1BB1BB1BB1BB1BB1BB1BB1BB1BB1BB1BB1BB1BB1BB1BB1BB1BB1BB1BB1BB1BB1BtxekCBkCBkCBkCBkCBkCBkCBkCBkCBkCBkCBkCBkCBkCBkCBkCBkCBkCBkCBkCBkCBkCBkCBkCBkCBkCBkCBkCBkCBkCBkCBkCBkCBkCBjCBjCBjCBjCBjCBjCBjCBjCBjCBjCBjCBjCBjCBjCBjCBjCBjCBjCBjCBjCBjCBjCBjCBjCBjCBjCBjCBjCBjCBjCBjCBjCBjCBjC")),this._CASE_ORBIT}static _Print=null;static get Print(){return this._Print||(this._Print=new wB(DB("hB9CBjBLBCpWBDFBFGBCCCBSBCsMBClBBDxBBDCBC2BBJaBFFBSVBC-FBCvBBD6BBDkDBP6BBDwBBDOBCbBDCCBJBGfBIqCBCgFBCHBDBBDVBCGBCEEBCBDIBDBBDDBJFFBCCBDBDYBDCBCFBFBBDVBCGBCBBCBBCBBDCCBDBFBBDCBEIIBCBCIIBPBLCBCIBCCBCVBCGBCBBCEBDJBCCBCCBDQQBCBDLBIGBCCBCHBDBBDVBCGBCBBCEBDIBDBBDCBICBFBBCEBDRBLBBCFBECBCDBEBBCCCBEEBEEBBBELBFEBECBCDBDHHPUBGMBCCBCWBCPBDIBCCBCDBIBBCCBCBBDDBDJBIVBCCBCWBCJBCEBDIBCCBCDBIBBGCBCDBDJBCCBNMBCCBCyBBCCBCFBFPBDZBCCBCRBEXBCIBCDDBFBEFFBEBCCCBGBHJBDCBN5BBFcBmBBBCCCBDBCXBCCCBVBDEBCCCBFBCJBDDBhBnCBCjBBFmBBCjBBCOBCMBmBlGBCGGD4LBCDBDGBCCCBCBDoBBCDBDgBBCDBDGBCCCBCBDOBC4BBCDBDiCBDfBEZBH1CBDFBD-TBCbBE4CBIVBKXBKTBNMBCCBCBBN9CBDJBHJBHNBCKBH4CBIqBBGlCBLeBCLBFLBFEEBoBBDEBMrBBFZBHKBE9BBDgCBCcBDKBHJBHNBDtBBDLBVsCBClFBJ7BBEOBE9BBGqBBDKBJqBBG1QBDFBDlBBDFBDHBCGCBdBD0BBCOBCNBDFBCSBDCBCIBSXBJuBBSBBDaBCMBEhBBPgBBQrEBF5UBXKBWz4BBD9LBGsBBCGGD3BBIBBPXBKGBCGBCGBCGBCGBCGBCGBCGBC9DBjBZBC4CBN1GBbPBC+BBC1CBDmDBGqBBC9CBC1CBKvBBCszcBE2BBK7KBV3FBJ8GBV7BBEJBH3BBJlCBJLBHzDBMdBEtCBCKBFgBBC2BBKNBDJBDmDBZbBLFBDFBDFBKGBCGBC7BBF9DBDJBHj9KBNWBFwBBloItLBDpDBnBGBNEBGZBCEBCCCBCCBCCBoUBhBpBBHyBBCSBCDBFEBCmEBF9FBEFBDFBDFBDCBEGBCGBOBBDLBCZBCSBCBBCOBDNBjB6DBGCBFsBBE3CBCMBEwBwBBsBBjEcBEwBBQbBFjBBKdBGqBBGdBCkBBFNBrB9EBDJBHjBBFjBBFnBBJzBBMLBCOBCGBCBBCKBCOBCGBCBBEzBBN2JBKVBLHBZFBCpBBCIBmCFBDCCBqBBCBBEDDBVBCnCBJIBxBSBCBBGgBBEaBGaBnB3BBFTBDxBBCBBGHBCCBCcBDCBFJBIIBI-BBhBmBBFLBK1BBEcBDaBGZBIDBNGBxCoCB4ByBBOyBBItBBJJBHlBBEcBJBBxGeBCpBBCCBDBBRFBJIBiBtBBJpBBXZBnBbBVWBKtCBFjBBK9BBCEBOYBIJBH0BBCRBJmBBK-CBCTBMRBCuBB-BGBCCCBCBCOBCKBH6BBGJBHDBCHBDBBDVBCGBCBBCEBCJBDBBDCBDHHGGBDGBEEBMJBCDDClBBCJBCDDCDBCJBCBBJBBe7CBCEBfnCBJJBnF1BBDlBBjBkCBMJBHMBU5BBHJBHTBdaBDOBFWB6F7BBlDyCBNHBDDDBGBCBBCdBCBBDLBKJBnCHBDtBBDKBcnCBJyCBOoCBIJB3CHB5ChBBPJBHIBCsBBCNBLcBEfBDVBCNBqCGBCBBCrBBECCBCCBHBJJBHFBCBBCkBBCBBCFBIJBHrBBFJB3HYBIQBCoBBEcB2CQQBwBBO6cBnDuDBCEBMjGBtyCiDBOvhBBRVBL68DBGmSB61G5BBn2B4RBIeBCJBFwCBCJBHdBDFBLlCBLJBCGBCUBGSBxN5BBnG6CBGYBDYBtBqCBF4BBIQBhCEBMGBK1mHBqBfBiDyDB+vIDBCGBCBBCiJBQeeBBBDPPBCBJrMBloCqDBGMBEIBIJBDDBh7D8HBEzNBHWBQQBQtBBDWBKzDB9B1HBLmBBDpCBJvDBWlCB7DTBNTBN2CBKYBoE0CBCmCBCBBDDDBDDBCBCLBCCCBFBCgCBCDBDHBCGBCbBCDBCEBCEEBFBCzKBDjJBD9VBQEBCOBxiBeBHFB2GGBCQBDGBCBBCEBG9BBiBxDxDBrBBENBDJBFBBhKeBS5BBGxOxOBoBB3GqBBFhGhGBdBCVBJBBhHGBCDBCBBCOBCkGBDPBqBrCBFJBFBByYjCBtC8BBjGDBCaBCBBCDDCJBCDBCCCHFFCECBBBCBBCDDCICBCCDDBCGBCDBCDBCCCBIBCQBGCBCEBCQB1BBBvIrBBFjDBNOBDOBCOBCkBBLtFB5BcBOrBBFIBIBBPFB7E4eBEQBEMBE5GBHLBFQQBKBF3BBJJBHnBBJdBDLBFBBPIBoB3KBJNBDMBEKBE4BBCFFBOBDLBFJBIyEBCmDBmgB-2pBBhB9oEBDt0FBDwpHBQtTBjtC9QBjvBq6EBGppIBnkzVvHB",!1))),this._Print}static CATEGORIES=new _B({C:()=>new wB(DB("AfBgDgBBOrWrWBHHBCBICCVuMuMnBBBzBBBE4B4BBGBcDBHQBXhGhGxBBB8BBBmDNB8BBByBBBQddBCCMEBhBGBsCiFiFJBBDBBXIICCBFBBKBBDBBFHBCDBDGGBaaBEEHDBDBBXIIDGDBCCGDBDBBECBCGBFCCBFBSJBEKKEXXIDDGBBLIEBCCBNBFBBNGBIEEJBBDBBXIIDGGBKKBDDBEEBFBEDBDGGBTTBIBDHHBBBEFFBBBDCCDCBDCBECBNDBGCBEFFBCCBEBCNBWEBOEEYRRBKKEFFBFBDEEDBBFBBLGBXEEYLLGBBKEEFGBDEBEFFBLLELBOEE0BEEHDBRBBbEETCBZKKCBBICBCDBHCCJFBLBBELB7BDBekBBDCCGZZCYYBGGCIILBBFfBpClBlBBCBoBlBlBQOOBjBBnGCCBDBCBB6LFFBIICFFBqBqBFBBiBFFBIICFFBQQ6BFFBkCkCBhBhBBBBbFB3CBBHBB+UCB6CGBXIBZIBVLBOEEDLB-CBBLFBLFBPMMBEB6CGBsBEBnCJBgBNNBCBNDBCCBrBBBGKBtBDBbFBMCB-BBBiCeeBMMBEBLFBPBBvBBBNTBuCnFnFBGB9BCBQCB-BEBsBBBMHBsBEB3QBBHBBnBBBHBBJGCgBBB2BQQPBBHUUBEEKMMBDBbEByBPBDBBcOOBBBjBNBiBOBtEDB7UVBMUB14BBB-LEBuBCCBDBCBB5BGBDNBZIBI4BI-DhBBb6C6CBKB3GZBxC3C3CBoDoDBDBsB-C-C3CIBxBuzcuzcBBB4BIB9KTB5FHB+GTB9BCBLFB5BHBnCHBNFB1DKBfCBvCMMBCBiB4B4BBHBPBBLBBoDXBdJBHBBHBBHIBIII9BDB-DBBLFBl9KLBYDByBjoIBvLBBrDlBBILBGEBbGGCGDrUfBrBFB0BUUFDBGoEoEBCB-FCBHBBHBBHBBECBIIIBLBDBBNbbUDDQBBPhBB8DEBEDBuBCB5COOBBBCuBBvBhEBeCByBOBdDBlBIBfEBsBEBfmBmBBCBPpBB-EBBLFBlBDBlBDBpBHB1BKBNQQIDDMQQIDDBBB1BLB4JIBXJBJXBHrBrBKkCBHBBCtBtBDCBCBBYpCpCBGBKvBBUDDBDBiBCBcEBclBB5BDBVBBzBDDBDBJEEeBBEDBLGBKGBhCfBoBDBNIB3BCBeBBcEBbGBFLBIvCBqC2BB0BMB0BGBvBHBLFBnBCBeHBDvGBgBrBrBEBBDPBHHBKgBBvBHBrBVBblBBdTBYIBvCDBlBIB-BGGBLBaGBLFB2BTTBGBoBIBhDVVBJBTwBwBB8BBICCFQQMFB8BEBLFBFJJBDDBXXIDDGLLBDDBEEBCCBEBCEBIBBICBGKBLCCBCCnBLLCBBCFFLDDBGBDcB9CGGBcBpCHBLlFB3BBBnBhBBmCKBLFBOSB7BFBLFBVbBcBBQDBY4FB9BjDB0CLBJBBCBBJDDfDDBNNBHBLlCBJBBvBBBMaBpCHB0CMBqCGBL1CBJ3CBjBNBLFBKuBuBPJBeCBhBBBXPPBnCBIDDtBCBCDDKHBLFBHDDmBDDHGBLFBtBDBL1HBaGBSqBqBBBBe0CBCOBzBMB8clDBwDGGBJBlGryCBkDMBxhBPBXJB88DEBoS41GB7Bl2BB6RGBgBLLBCByCLLBEBfBBHJBnCJBLIIWEBUvNB7BlGB8CEBaBBarBBsCDB6BGBS-BBGKBIIB3mHoBBhBgDB0D8vIBFIIDkJkJBNBCcBEBBCNBFHBtMjoCBsDEBOCBKGBLBBF-6DB+HCB1NFBYOBSOBvBBBYIB1D7BB3HJBoBBBrCHBxDUBnC5DBVLBVLB4CIBamEB2CoCoCDBBCBBDBBFNNCIIiCFFBJJIddFGGCCBI1K1KBlJlJB-V-VBNBGQQBuiBBgBFBH0GBISSBIIDGGBDB-BgBBCvDBuBCBPBBLDBD-JBgBQB7BEBCvOBrB1GBsBDBC-FBgBXXBGBD-GBIFFDQQmGBBRoBBtCDBLDBDwYBlCrCB+BhGBFccDCCBCCLFFCCCBEBCDBCECEDDCBBCICDCCBFFIKFCLLSEBEGGSzBBDtIBtBDBlDLBQBBQQQmBJBvF3BBeMBtBDBKGBDNBH5EB6eCBSCBOCB7GFBNDBCOBNDB5BHBLFBpBHBfBBNDBDNBKmBB5KHBPBBOCBMCB6BCCBCBRBBNDBLGB0EoDoDBjgBBh3pBfB-oEBBv0FBBypHOBvThtCB-QhvBBs6EEBrpIlkzVBxHvw-FB",!1)),Cc:()=>new wB(DB("AfgDgB",!0)),Cf:()=>new wB(DB("tFzqBzqBBEBXhGhGyBhMhMBxCxCs5D9-B9-BBDBbEByBEBCJBw03B6H6HBBBimEQQj7IPBhjiBDBwmFHBn0rYffB+CB",!1)),Cn:()=>new wB(DB("4bBBHDBICCVuMuMnBBBzBBBE4B4BBGBcDBHKBvI9B9BBmDmDBMB8BBByBBBQddBCCMEBjBEBuHJJBDDBXXICCBBBFBBKBBDBBFHBCDBDGGBaaBEEHDBDBBXIIDGDBCCGDBDBBECBCGBFCCBFBSJBEKKEXXIDDGBBLIEBCCBNBFBBNGBIEEJBBDBBXIIDGGBKKBDDBEEBFBEDBDGGBTTBIBDHHBBBEFFBBBDCCDCBDCBECBNDBGCBEFFBCCBEBCNBWEBOEEYRRBKKEFFBFBDEEDBBFBBLGBXEEYLLGBBKEEFGBDEBEFFBLLELBOEE0BEEHDBRBBbEETCBZKKCBBICBCDBHCCJFBLBBELB7BDBekBBDCCGZZCYYBGGCIILBBFfBpClBlBBCBoBlBlBQOOBjBBnGCCBDBCBB6LFFBIICFFBqBqBFBBiBFFBIICFFBQQ6BFFBkCkCBhBhBBBBbFB3CBBHBB+UCB6CGBXIBZIBVLBOEEDLB-CBBLFBLFBbFB6CGBsBEBnCJBgBNNBCBNDBCCBrBBBGKBtBDBbFBMCB-BBBiCeeBMMBEBLFBPBBvBBBNTBuCnFnFBGB9BCBQCB-BEBsBBBMHBsBEB3QBBHBBnBBBHBBJGCgBBB2BQQPBBHUUBEEKmDmDNBBcOOBBBjBNBiBOBtEDB7UVBMUB14BBB-LEBuBCCBDBCBB5BGBDNBZIBI4BI-DhBBb6C6CBKB3GZBxC3C3CBoDoDBDBsB-C-C3CIBxBuzcuzcBBB4BIB9KTB5FHB+GTB9BCBLFB5BHBnCHBNFB1DKBfCBvCMMBCBiB4B4BBHBPBBLBBoDXBdJBHBBHBBHIBIII9BDB-DBBLFBl9KLBYDByBDBvzIBBrDlBBILBGEBbGGCGDrUfBrBFB0BUUFDBGoEoEBCC-FCBHBBHBBHBBECBIIIBIBGBBNbbUDDQBBPhBB8DEBEDBuBCB5COOBBBCuBBvBhEBeCByBOBdDBlBIBfEBsBEBfmBmBBCBPpBB-EBBLFBlBDBlBDBpBHB1BKBNQQIDDMQQIDDBBB1BLB4JIBXJBJXBHrBrBKkCBHBBCtBtBDCBCBBYpCpCBGBKvBBUDDBDBiBCBcEBclBB5BDBVBBzBDDBDBJEEeBBEDBLGBKGBhCfBoBDBNIB3BCBeBBcEBbGBFLBIvCBqC2BB0BMB0BGBvBHBLFBnBCBeHBDvGBgBrBrBEBBDPBHHBKgBBvBHBrBVBblBBdTBYIBvCDBlBIBlCJBCBBaGBLFB2BTTBGBoBIBhDVVBJBTwBwBB8BBICCFQQMFB8BEBLFBFJJBDDBXXIDDGLLBDDBEEBCCBEBCEBIBBICBGKBLCCBCCnBLLCBBCFFLDDBGBDcB9CGGBcBpCHBLlFB3BBBnBhBBmCKBLFBOSB7BFBLFBVbBcBBQDBY4FB9BjDB0CLBJBBCBBJDDfDDBNNBHBLlCBJBBvBBBMaBpCHB0CMBqCGBL1CBJ3CBjBNBLFBKuBuBPJBeCBhBBBXPPBnCBIDDtBCBCDDKHBLFBHDDmBDDHGBLFBtBDBL1HBaGBSqBqBBBBe0CBCOBzBMB8clDBwDGGBJBlGryCBkDMB3iBJB88DEBoS41GB7Bl2BB6RGBgBLLBCByCLLBEBfBBHJBnCJBLIIWEBUvNB7BlGB8CEBaBBarBBsCDB6BGBS-BBGKBIIB3mHoBBhBgDB0D8vIBFIIDkJkJBNBCcBEBBCNBFHBtMjoCBsDEBOCBKGBLBBJ76DB+HCB1NFBYOBSOBvBBBYIB1D7BB3HJBoBBBjGUBnC5DBVLBVLB4CIBamEB2CoCoCDBBCBBDBBFNNCIIiCFFBJJIddFGGCCBI1K1KBlJlJB-V-VBNBGQQBuiBBgBFBH0GBISSBIIDGGBDB-BgBBCvDBuBCBPBBLDBD-JBgBQB7BEBCvOBrB1GBsBDBC-FBgBXXBGBD-GBIFFDQQmGBBRoBBtCDBLDBDwYBlCrCB+BhGBFccDCCBCCLFFCCCBEBCDBCECEDDCBBCICDCCBFFIKFCLLSEBEGGSzBBDtIBtBDBlDLBQBBQQQmBJBvF3BBeMBtBDBKGBDNBH5EB6eCBSCBOCB7GFBNDBCOBNDB5BHBLFBpBHBfBBNDBDNBKmBB5KHBPBBOCBMCB6BCCBCBRBBNDBLGB0EoDoDBjgBBh3pBfB-oEBBv0FBBypHOBvThtCB-QhvBBs6EEBrpIm8yVBCdBhD-DBxHvw-BB---BBB---BBB",!1)),Co:()=>new wB(DB("gg4B-nGh4hc9--BD9--B",!0)),Cs:()=>new wB(DB("gg2B--B",!0)),L:()=>new wB(DB("hCZBHZBwBLLFGGBVBCeBCpOBFLBPEBICCiEEBCBBDDBCHHCCBCCCBSBCyCBCqEBJlFBClBBDHHBnBBoCaBFDBuBqBBkBBBCiDBCQQBIIBLLBBBDRRCdBe4CBMZZBfBKBBFGGBUBFKKEYYBXBIKBGXBCGBRpBB7B1BBETTIJBQPBFHBDBBDVBCGBCEEBCBERROBBCCBPBBLJJBEBFBBDVBCGBCBBCBBCBBgBDBCUUBBBRIBCCBCVBCGBCBBCEBETTQBBYMMBGBDBBDVBCGBCBBCEBEffBCCBBBQSSCFBECBCDBEBBCCCBEEBEEBBBELBX1B1BBGBCCBCWBCPBEbbBBBCBBDBBfFFBGBCCBCWBCJBCEBEffBBBCBBQBBSIBCCBCoBBDRRGCBJCBZFBGRBEXBCIBCDDBFB7BvBBCBBNGB7BBBCCCBDBCXBCCCBIBCBBKDDBDBCWWBCBhBgCgCBGBCjBBcEB0DqBBVRRBEBFDBEEEBIIBBBFMBNSSBkBBCGGDqBBCsKBCDBDGBCCCBCBDoBBCDBDgBBCDBDGBCCCBCBDOBC4BBCDBDiCBmBPBR1CBDFBErTBDQBCZBGqCBHHBIRBOSBPRBPMBCCBQzBBkBFFkC4CBIEBDhBBCGGBkCBLeByBdBDEBMrBBFZB3BWBK0BBzC+C+CBtBBSHB3BdBOBBLrBBbjBBqBCBLjBBDKBGqBBDCBqBDBCFBCBBEGGB+FBhC1IBDFBDlBBDFBDHBCGCBdBD0BBCGBCEEBBBCGBEDBDFBFMBGCBCGB1DOORMBmDFFDJBCEEBDBHGCBCBCKBDDBGEBF1B1BB8zC8zCBjHBHDBEBBNlBBCGGD3BBIRRBVBKGBCGBCGBCGBCGBCGBCGBCGBxC2O2OBrBrBBDBGBBF1CBHCBC5CBCDBGqBBC9CBSfBxBPBhQ-tGBhCs0VBkCtBBDsIBEPBLBBVuBBReBDlCByBIBDmDBDxCBVQBCCBCDBCWBezBBPxBB-BFBECCBMMBaBLWBacBIuBBdRRBDBCJBLEBCoBBYCBCHBVWBEEEBwBBCEEBDDBDBDCCZCBDKBICBNFBDFBDFBKGBCGBCqBBCNBHyDBej9KBNWBFwBBloItLBDpDBnBGBNEBGCCBIBCMBCEBCCCBCCBCCBqDBiBqLBT-BBD1BBpBLB1DEBCmEBlBZBHZBM4CBEFBDFBDFBDCBkBLBCZBCSBCBBCOBDNBjB6DBmMcBEwBBwBfBOTBCHBHlBBLdBDjBBFHBxB9EBTjBBFjBBFnBBJzBBNKBCOBCGBCBBCKBCOBCGBCBBEzBBN2JBKVBLHBZFBCpBBCIBmCFBDCCBqBBCBBEDDBVBLWBKeBiCSBCBBLVBLZBHZBnB3BBHBBhCQQBCBCCBCcBrBcBEcBkBHBCbBc1BBLVBLSBORBvDoCB4ByBBOyBBOjBBnBbBKWB7HpBBHBBRFB5BcBLJJBUBrBRBvBUBcWBN0BB6BBBDOOBrBBhBYBbjBBeDDJiBBENNBuBBPDBWCCkBRBCYBUBBgCGBCCCBCBCOBCJBIuBBnBHBDBBDVBCGBCBBCEBETTNEBfJBCDDClBBCaaCtBtBBzBBTDBVCBfvBBVBBC5F5FBtBBqBDBlBvBBV8B8BBpBBOoCoCBZBmBGB6FrBB1D-BBgBHBDDDBGBCBBCXBQCC-CHBDmBBRCCdLLBmBBIWWMtBBUTTBnCBoGgBBgBIBCkBBSyByBBcBxDGBCBBClBBWaaBEBCBBCfBPYYBqBBlISBQCCBLBChBB9DwCwCB4cBnHjGBtyCgDBQvhBBSFBa68DBGmSB61GdBj3B4RBIeBSuCBSdBTvBBRDBgBUBGSBxNsBB0G-BBhBYBDYBtBqCBGjCjCBLBhCBBCPPBNNB0mHBqBfBiDyDB+vIDBCGBCBBCiJBQeeBBBDPPBCBJrMBloCqDBGMBEIBIJBn7F0CBCmCBCBBDDDBDDBCBCLBCCCBFBCgCBCDBDHBCGBCbBCDBCEBCEEBFBCzKBDYBCYBCeBCYBCeBCYBCeBCYBCeBCYBCHB15BeBHFBmI9BBzEsBBLGBRiKiKBcBTrBBlPbBlHdBDwGwGBdBCCBCBBCGBDEBKBBhHGBCDBCBBCOBCkGB8BjCBI1lB1lBBCBCaBCBBCDDCJBCDBCCCHFFCECBBBCBBCDDCICBCCDDBCGBCDBCDBCCCBIBCQBGCBCEBCQBlqE-2pBBhB9oEBDt0FBDwpHBQtTBjtC9QBjvBq6EBGppIB",!1)),LC:()=>new wB(DB("hCZBHZB7BLLBVBCeBCiGBCDBFvGBDZBhGDBDBBECBCHHCCBCCCBSBCyCBCqEBJlFBClBBKoBB44ClBBCGGDqBBDCBhV1CBDFBjkCKBGqBBDCBhCrBBgCMBChBBmD1IBDFBDlBBDFBDHBCGCBdBD0BBCGBCEEBBBCGBEDBDFBFMBGCBCGBmIFFDJBCEEBDBHGCBCBCFBFDDBCBGEBF1B1BB8zC8zCB6DBDmDBHDBEBBNlBBCGGzoetBBTbBnEtCBCWBEDBCsCBZBBE2Z2ZBpBBGIBIvCBh6TGBNEBqgBZBHZBmlBvCBhDjBBFjBB1DKBCOBCGBCBBCKBCOBCGBCBBk2ByBBOyBB+CVBLVB74C-BBhrV-BBhBYBDYBtpZ0CBCmCBCBBDDDBDDBCBCLBCCCBFBCgCBCDBDHBCGBCbBCDBCEBCEEBFBCzKBDYBCYBCeBCYBCeBCYBCeBCYBCeBCYBCHB15BJBCTBHFB2uCjCB",!1)),Ll:()=>new wB(DB("hDZB7BqBqBBWBCHBC2BCBQCBuBCDECBBBDCCDEEBFFDEEBBBDDDCCCDCCBCCDEECDDBDDBBBHGDCOCBSCBDDCEEC4BCBFBDDDBCCFICBjCBDZBiGCCEEEBBBTccBhBBCBBECBCWCBDBCGDB0B0BBuBBCgBCK0BCDMCBgDCxBoBBo6CqBBDCB5XFBjkCIBC2D2DBqBBgCMBChBBnD0ECBHBCgDCBHBJFBLHBJHBJFBLHBJHBJNBDHBJHBJHBJEBCBBHEEBBBCBBJDBDBBJHBLCBCBBzIEEBEEcKFDBBJDBF2B2Bs1CvBBCEEBGCFCCBCCBEBGiDCBIICFFNlBBCGG0oesBCUaCoEMCBBBC+BCBGBCCCDICFCCDCCBBBCSCGGGCMCFCCDOCbEE2ZqBBGIBIvCBh6TGBNEBqhBZBumBnBBpEjBB8EKBCOBCGBCBBk4ByBB+DVB75CfBhsVfB8BYBnqZZBbGBCRBbZBbDBCCCBFBCKBbZBbZBbZBbZBbZBbZBbZBbZBbbBdYBCFBbYBCFBbYBCFBbYBCFBbYBCFBC15B15BBIBCTBHFB4vChBB",!1)),Lm:()=>new wB(DB("wVRBFLBPEBICCmEGG-OnHnHlFBBuIBBFgBgBKEEhFoFoF1mBgEgE2R72B72BsDkTkTxOFBvF+BBOjBjBBjBByVOORMBg-CBByHgGgG2OsBsBBDBGiDiDB+C+CBBB34bjnBjnBBEBvIzDzDdBB6DIBxCYYpDDBEBB2OXXqEtDtDWBBoDDBKngVngVuBBBh-BFBCpBBCIB0sBhBhB2K04D04DnrTDB9PCBpBBBnRMBhCBBCPPB9-P9-PBCBCGBCBByhM9BBqGGBud0Q0QsSAB",!1)),Lo:()=>new wB(DB("qFQQhIFFBCBxGBB7ZaBFDBuBfBCJBkBBBCiDBCZZBLLBBBDRRCdBe4CBMZZBfBWVBrBYBIKBGXBCGBRoBB8B1BBETTIJBROBFHBDBBDVBCGBCEEBCBERROBBCCBPBBLJJBEBFBBDVBCGBCBBCBBCBBgBDBCUUBBBRIBCCBCVBCGBCBBCEBETTQBBYMMBGBDBBDVBCGBCBBCEBEffBCCBBBQSSCFBECBCDBEBBCCCBEEBEEBBBELBX1B1BBGBCCBCWBCPBEbbBBBCBBDBBfFFBGBCCBCWBCJBCEBEffBBBCBBQBBSIBCCBCoBBDRRGCBJCBZFBGRBEXBCIBCDDBFB7BvBBCBBNFB8BBBCCCBDBCXBCCCBIBCBBKDDBDBYDBhBgCgCBGBCjBBcEB0DqBBVRRBEBFDBEEEBIIBBBFMBNyDyDBnKBCDBDGBCCCBCBDoBBCDBDgBBCDBDGBCCCBCBDOBC4BBCDBDiCBmBPByDrTBDQBCZBGqCBHHBIRBOSBPRBPMBCCBQzBBpBkCkCBhBBC0BBIEBDhBBCGGBkCBLeByBdBDEBMrBBFZB3BWBK0BBxFuBBSHB3BdBOBBLrBBbjBBqBCBLdByDDBCFBCBBE7hB7hBBCB4-C3BBZWBKGBCGBCGBCGBCGBCGBCGBCGBoR2B2BF1CBJCCB4CBFGGBpBBC9CBSfBxBPBhQ-tGBhC0wUBC2jBBkCnBBJrIBFPBLBBjCyByBBkCBqFoDoDEGBCCBCDBCWBezBBPxBB-BFBECCBMMBaBLWBacBIuBBuBEBDIBLEBCoBBYCBCHBVPBCFBEEEBwBBCEEBDDBDBDCCZBBEKBIPPBEBDFBDFBKGBCGByEiBBej9KBNWBFwBBloItLBDpDBkCCCBIBCMBCEBCCCBCCBCCBqDBiBqLBT-BBD1BBpBLB1DEBCmEBqDJBCsBBDeBEFBDFBDFBDCBkBLBCZBCSBCBBCOBDNBjB6DBmMcBEwBBwBfBOTBCHBHlBBLdBDjBBFHBhEtCBjDnBBJzBB9CzBBN2JBKVBLHB5EFBDCCBqBBCBBEDDBVBLWBKeBiCSBCBBLVBLZBHZBnB3BBHBBhCQQBCBCCBCcBrBcBEcBkBHBCbBc1BBLVBLSBORBvDoCB4FjBBnBDBCxJxJBoBBHBBRCBCBB5BcBLJJBUBrBRBvBUBcWBN0BB6BBBDOOBrBBhBYBbjBBeDDJiBBENNBuBBPDBWCCkBRBCYBUBBgCGBCCCBCBCOBCJBIuBBnBHBDBBDVBCGBCBBCEBETTNEBfJBCDDClBBCaaCtBtBBzBBTDBVCBfvBBVBBC5F5FBtBBqBDBlBvBBV8B8BBpBBOoCoCBZBmBGB6FrBB0GHBDDDBGBCBBCXBQCC-CHBDmBBRCCdLLBmBBIWWMtBBUTTBnCBoGgBBgBIBCkBBSyByBBcBxDGBCBBClBBWaaBEBCBBCfBPYYBnBBCBBlISBQCCBLBChBB9DwCwCB4cBnHjGBtyCgDBQvhBBSFBa68DBGmSB61GdBj3B4RBIeBSuCBSdBTvBB0BUBGSB0NnBB2MqCBGwFwFB0mHBqBfBiDyDBuwIiJBQeeBBBDPPBCBJrMBloCqDBGMBEIBIJBxzI2P2PBrBBiBiKiKBcBTrBBlPaBmHdBDwGwGBdBCCBCBBCGBDEBKiHiHBFBCDBCBBCOBCkGB8pBDBCaBCBBCDDCJBCDBCCCHFFCECBBBCBBCDDCICBCCDDBCGBCDBCDBCCCBIBCQBGCBCEBCQBlqE-2pBBhB9oEBDt0FBDwpHBQtTBjtC9QBjvBq6EBGppIB",!1)),Lt:()=>new wB(DB("lOGDnB2sH2sHBGBJHBJHBNQQwBAB",!1)),Lu:()=>new wB(DB("hCZBmDWBCGBiB2BCDOCDuBCBECEBBCCCBCCBBBDDBCBBCCBEBBCBBCECBCCDCCBCCBBBCCCBEEIJDCMCDQCDDDCCBC4BCIBBCBBDCCBCBCGCiJCCEJJHCCBBBCCCBCCBPBCIBkBDDBBBEWCGDDCBBDyBBxBgBCK2BCBMCD+CCDlBBq6ClBBCGGzW1CB0kCHHBpBBDCBhK0ECKgDCKHBJFBLHBJHBJFBMGCJHBpCDBNDBNDBNEBMDBnIFFECBDCBDEEBDBHGCBCBDDBLBBG+B+B9zCvBBxBCCBBBDGCBCBCDDJCBCgDCJCCFuqeuqeCqBCUaCoEMCE8BCLECBICFCCDCCEUCBDBCEBCOCBCBCCCBQCZs5Vs5VBYBmmBnBBpEjBB9EKBCOBCGBCBBr3ByBB+EVB75CfBhsVfBhCYBoqZZBbZBbZBbCCBGDBDDBCBCHBbZBbBBCDBDHBCGBcBBCDBCEBCEEBFBcZBbZBbZBbZBbZBbZBfYBiBYBiBYBiBYBiBYBiB2pE2pEBgBB",!1)),M:()=>new wB(DB("gYvDB0IGBoIsBBCCCBCCBCCpCKBxBUBRmDmDBFBDFBDBBCDBkBffBZB8CKB7BIBKZZBCBCIBCCBCEBsBCB8BIBrBXBCgBB3BCBCRBCGBLBBeCB5BCCBFBDBBDCBKLLBbbDCB5BCCBDBFBBDCBEffBEEMCB5BCCBGBCCBCCBVBBXFBCCB5BCCBFBDBBDCBICBLBBf8B8BBDBECBCDBKpBpBBDB4BCCBFBCCBCDBIBBMBBeCB5BCCBFBCCBCDBIBBMBBQNNBCB4BBBCGBCCBCDBKLLBeeBBBnCFFBEBCCCBGBTBB+BDDBFBNHBjDDDBHBMGBqCBBcECFBByBTBCBBGKBCjBBKlDlDBSBYDBFCBCCBDGBEDBOLBCLLBCBgWCBzdDBdCBeBBfBBhCfBKuBuBBBBC2D2DBjBjB3DLBFLB8GEB6BJBCcBDxBxBBsBBDLBVEBwBQBnBIBNCBfMB5BNBxBTB5ECBCUBFHHDCBnG-BBxWgBB--CCBuEhDhDBeBrRFBqDBB1udDBCJBhBBBxCBBxIEEFYYBDBF0C0CBzBzBBQBbRBOnBnBBGBaMBtBDBwBNBlBkCkCBMBNJJBuBuBBBBzBCCBBBDBBGBBCqBqBBDBGBBtHHBCBBx5TiXiXBOBRPBuejHjH2EEBn0BCBCBBGDBpBCBFmFmFB+R+RBCBiCEB+JBBuCFBnCKByBDB7DCB2BOBqBDDBLLBCBuBKBI+B+BBBBlBNBRBBtBNNBBBxBNBJDBCBB9CLBHDD+ELBWDB4BBBCGBDBBDCBKLLBDDBFBEEBkCIBCDDCDBCEBCPPBzCzCBQBYyCyCBSBsHGBDIBcBBzCQBrDMBmDOBhIOB2HFBCBBDDBCCCBuEuEBFBDGBEddBIBpBGBCDBJKKBJBvBPBnGHBoGHBCHBzCVBCNB7DFBECCBCCBFBCjCjCBDBCBBCEB8KDBKBBCxBxBBFBEEBYmnFmnFHOBpmLRBhuCEB8BGB5gBCCB1BBIDByCMMBslTslTBizEizEBsBBDWB-QEBEFBJHBDGBfDB1ECB89B2BBFxBBJPPXEBCOBxqBGBCQBDGBCBBCEBlDhFhFBFB4L+B+BBCB9PDB-HBB0HDDIBBG7O7OBFBuDGB29lYvHB",!1)),Mc:()=>new wB(DB("joC4B4BDCBJDBCBBzBBB7BCBHBBDBBLsBsB7BCBjC7B7BBBBJCCB2B2BB7B7BCHHBDDBLLnDBBCBBECBCCBLqBqBBBB+BDB+BBB7BCCBDBDBBCBBKBBdPPB7B7BBBBGCBCCBLrBrBBsCsCBBBHHBTBBrKBBgCsFsFBFFHDDBaaBLLBBBDGBWBBDFBDLLBBB5zBffiEIIBGBCBB7KDBDCBFBBCFBhHBB7BCCKCCBJJBEByExBxBGCCBDBCBB+BffFBBD9B9BDCBCEEBxBxBBGBJBBsFWW35EBB0-dBBD5C5CBzBzBBOBvEBBwBxBxBBFFBDDBBBvDBBDBBZuBuBCuDuDDBBGuHuHBCCBCCBCC0gZCCgEuBuBBBBFBB0DZZB8B8BxBCBKBBO+C+CBBBEBBCrFrFBBBgBBB7BBBCDBDBBDCBKLLB1C1CBBBIDDCDBCBBCmDmDBBBJBBErDrDBBBHCCBCBDuHuHBBBHDBDyDyDBBBJBBCuDuDCBBHoDoDCBBFmImIBBBK4H4HBEBCBBFDDCvEvEBBBJDBF1C1CeBB-BqGqGECCoGPPrDIID2G2GBDBFBBC-K-KBNNxBBBJBBCpvQpvQBBBlxD2BBpDBB0rYBBHFB",!1)),Me:()=>new wB(DB("okBBB1xF-wB-wBBCBCCBsshBCB",!1)),Mn:()=>new wB(DB("gYvDB0IEBqIsBBCCCBCCBCCpCKBxBUBRmDmDBFBDFBDBBCDBkBffBZB8CKB7BIBKZZBCBCIBCCBCEBsBCB8BIBrBXBCfB4BCCFHBFEEBFBLBBe7B7BFDBJVVBbbDBB6BFFBFFBDDBBBEffBEEMBB6BFFBDBCBBFVVBXXBEBC7B7BDCCBCBJIIBMMBff+BNNzBEE4BCCBBBGCBCDBIBBMBBe7B7BDHHGBBVBBdBB6BBBFDBJVVBeepCIIBBBC7C7CDGBNHBjDDDBHBMGBqCBBcEC4BNBCEBCBBGKBCjBBKnDnDBCBCFBCBBDBBaBBFCBRDBODDBHHQgWgWBBBzdCBeBBfBBfBBhCBBCGBJDDBJBKuBuBBBBC2D2DBjBjB3DCBFBBKHHBBB8GBBD7B7BCGBCCCDHBHJBDxBxBBMBCeBDLBVDBxBCCBDBCGGpBIBNBBhBDBDBBCCB5BCCBEECCB7BHBDBB5ECBCMBCGBFHHEBBnG-BBxWMBFEEBKB--CCBuEhDhDBeBrRDBsDBB1udFFBIBhBBBxCBBxIEEFaaBGG4EBBbRBOnBnBBGBaKBvBCBxBDDBCBDBBoBkCkCBEBDBBDBBNJJwB0B0BCCBDBBGBBCrBrBBJJvHDDFx5Tx5TiXPBRPBuejHjH2EEBn0BCBCBBGDBpBCBFmFmFB+R+RBCBiCEB+JBBuCFBnCKByBDB8D3B3BBNBqBDDBLLBBByBDBDBBI+B+BBBBlBEBCHB-BNNB1B1BBHBLDBDgDgDBBBDCCBHHD+E+EEHBWBB6BBBEmBmBBFBEEBnCFBOECPBB2CHBDCBCYY1CFBCFFBCCBvHvHBCBHBBCBBcBB2CHBDCCBrDrDCDDBEBCmDmDCDDBCBCEBkIIBCBBhIBBCFFxEDBDBBFhBhBBIBpBFBDDBJKKBEBDCBvBMBCBBnGCCBBBCqGqGBFBCFBCzCzCBUBDGBCBBCBB7DFBECCBCCBFBCpCpCBEEC8K8KBMMB1B1BBDBGCCYmnFmnFHOBpmLLBECBhuCEB8BGB5gBgCgCBCByC5lT5lTBizEizEBsBBDWBhRCBSHBDGBfDB1ECB89B2BBFxBBJPPXEBCOBxqBGBCQBDGBCBBCEBlDhFhFBFB4L+B+BBCB9PDB-HBB0HDDIBBG7O7OBFBuDGB29lYvHB",!1)),N:()=>new wB(DB("wBJB5DBBGDDBBBitBJBnEJBnGJB9MJB3DJBFFBtDJB3DJB3DJBDFBvDMB0DJBJGBoDJBpDGBISBuDJBhDJB3DJBnCTBtIJBnCJBwWTBybCBwHJBHJBXJBtJJBhEKBmFJBHJB3FJB3CJBnEJBHJB3gBEEBEBHJBnGyBBDEB3W7BBvCVB3TdBqrBqYqYaIBPCB4KDBrEJBfHBCOBhBJBoBOBh7cJB9FJBhKFB7EJBnBJBnGJBXJB3CJB3MJB34UJBuPsBBN4BBSBB2KaBlBDBeJJnEEBrGJBvdHBaGBoBIBsCEBXFBhFBBDPBDtBBhCIB1BBBfCBsCEBpDHBZHBqBGBrKFBxBJBHJB3IeB-EJBrBDBxDGBnEdBhEJB9BJBxEJBITB8HJB3KJB3DJB3LJBnDJBHTBtCLBlNSB+CJB3UJB3CcBkHJBnCJB3BJBnLJBnDUBshBuDBimPJBnpCJB3CJBnEJBCGBvQJBnIWB+KCB6nXJBnuBTBNTBtDYB2iBxBBhqCJBnNJB3PJB4HJBtWIBhEJB4Y6BBCCBCDBtCsBBCOBjeMBk3CJB",!1)),Nd:()=>new wB(DB("wBJnxBJnEJnGJ9MJ3DJ3DJ3DJ3DJ3DJ3DJ3DJ3DJ3DJhDJ3DJnCJ3IJnCJn6BJnBJtJJhEJnFJHJ3FJ3CJnEJHJnuiBJnVJnBJnGJXJ3CJ3MJ34UJnsBJnkCJHJ9YJhEJ9BJxEJ3IJ3KJ3DJ3LJnDJHTtCJnNJnDJ3UJ3CJ3HJnCJ3BJnLJ3uQJnpCJ3CJnEJ3QJ37XJ12CxBhqCJnNJ3PJ4HJ2aJ30EJ",!0)),Nl:()=>new wB(DB("u3FCBwzCiBBDDB-zDaaBHBPCBs1dJBxyW0BBtOJJnEEBrhIuDBm8SCB",!1)),No:()=>new wB(DB("yFBBGDDBBB2pCFB5LFB5DCBmEGB6GGBSIByNJB2hBTB0jBJBhP20B20BEFBHJBnGPBqB3W3WB6BBvCVB3TdBqrB1kB1kBBCBrEJBfHBCOBhBJBoBOBxrdFBymWsBBiCDBSBB2KaBlBDB1pBHBaGBoBIBsCEBXFBhFBBDPBDtBBhCIB1BBBfCBsCEBpDHBZHBqBGBrKFBhLeB-EJBrBDBxDGBnETB8LTBmqBBBvNIBobSB0aUBn8SGB-YWBqhZTBNTBtDYBvqFIBid6BBCCBCDBtCsBBCOBjeMB",!1)),P:()=>new wB(DB("hBCBCFBCDBLBBEBBbCBCccCkBkBGEELBBEEE-VJJzOFBqBBB0BCCDDDtBBBVBBCBBOCCBBBrCDBnDsBsBBMBqHCB3BOBgBmImIBLLtE5D5D6DnMnMNwLwL7CLLBpFpFBNBCmBmBBCBoCrCrCBDBFBBwDFBsFlTlTBHB4EuTuTtBBBvCCBoCBB+ECBCCBmBKB6JBB5GBBhEGBCFBhFBBLGBdCB9DDB8BEB-BBBhCHBM9Z9ZBWBJTBCMBCLBfBBPBB6TDBeBB+hBNBwCBBgBJB0MVBgCDBhBBB8XDBCBBxDwEwEBtBBCfBDLBkNCBFJBDLBRNNjD7C7CjgdBBuICBkDLL0DFB9LDB3CBBpBCBCyByBBwBwBiDMBRBB9DDB-DBBRBB6HzqUzqUBxGxGBIBXiBBCNBCFFCBB2ECBCFBCDBLBBEBBbCBCccCCCBFB7MCB9UxBxB-MoXoXoGgBgBxIIBnBxDxDBFBjCGB6CDByO-J-JjBlElEBDBtBDB+FGBuDBBCDB-DDBxBBBwCDBFOOCCB5CFBsDrJrJBCCBzDzDBDBLBBCpDpD7HWBqDCBdMBtCjEjEBBB9HpIpIBBB8E9C9CBGB0CCBCEB+CJB4GgDgDBDBrBBBmUBBrCMBwFxjBxjBBDB97CBB8zOBBmEiCiCBDBJpRpRBBBoJDBoK9lT9lTovHEB07C-a-aBAB",!1)),Pc:()=>new wB(DB("-Cg-Hg-HBUU-u3BBBZCBwHAB",!1)),Pd:()=>new wB(DB("tB9qB9qB0BiyDiyDmgBqgCqgCBEBiwDDDgBBBFdd-NUUwDxszBxszBBmBmBLqFqFhzD-J-J",!1)),Pe:()=>new wB(DB("pB0B0BgB+1D+1DC-6B-6BqtC4B4BQ7T7TCff-hBMCxChBhBCGC1MUChCCCiBmhBmhBCECtBGCtNICEGCDBB-ozB6G6GeOCESSCCCrF0B0BgBGD",!1)),Pf:()=>new wB(DB("7F+6H+6HEddpuDCCFDDQEE",!1)),Pi:()=>new wB(DB("rFt7Ht7HDBBDaapuDCCFDDQEE",!1)),Po:()=>new wB(DB("hBCBCCBDECBLLBEEBcclCGGPBBI-V-VJzOzOBEBqB3B3BDDDtBBBVBBCBBOCCBBBrCDBnDsBsBBMBqHCB3BOBgBmImIBLLtE5D5D6DnMnMNwLwL7CLLBpFpFBNBCxDxDrCEBFBBwDFBsFlTlTBHBmY9D9DBBBoCBB+ECBCCBmBFBCDB6JBB5GBBhEGBCFBhFBBLGBdCB9DDB8BEB-BBBhCHBMjajaBJJBGBJIBDDBDCBEKBCCCBIB7kDDBCBBxDwEwEBFFBBBDDDBHBCBBCDDBLLBDBCJBDDBCCCBLBDCBtNCB6B+F+FjgdBBuICBkDLL0DFB9LDB3CBBpBCBCyByBBwBwBiDMBRBB9DDB-DBBRBB6HlxUlxUBFBDXXVBBDDBECBCDBICBHCCB2E2EBBBCCBDECBLLBEEBcclBDDB7M7MBBB9UxBxB-MoXoXoGgBgBxIIBnBxDxDBFBjCGB6CDB0ZlElEBDBtBDB+FGBuDBBCDB-DDBxBBBwCDBFOOCCB5CFBsDrJrJBCCBzDzDBDBLBBCpDpD7HWBqDCBdMBtCjEjEBBB9HpIpIBBB8E9C9CBGB0CCBCEB+CJB4GgDgDBDBrBBBmUBBrCMBwFxjBxjBBDB97CBB8zOBBmEiCiCBDBJpRpRBBBoJDBoK9lT9lTovHEB07C-a-aBAB",!1)),Ps:()=>new wB(DB("oBzBzBgB-1D-1DC-6B-6B-rCEEnB4B4BQ7T7TCff-hBMCxChBhBCGC1MUChCCCiBmhBmhBCECaTTCECtNICEGCDipzBipzB4GeeCMCESSCCCrFzBzBgBEEDAB",!1)),S:()=>new wB(DB("kBHHRCBgBCCcCCkBEBCBBDCCBCBDEEfgBgBrODBNNBGGBCCCBPB2DPPBxDxDsErIrIBBB3DCBDDDBvGvGLUUB4H4HIBBpEqLqLBHHB2H2H-DjEjEBGBlEwGwGqBmGmGiGCBQCCBBBDFBVECmEHBCFBCBBGDBmGBBxXJB0WuLuLlL+E+EBgBBiLJBKIBhiBCCBBBMCBOCBOCBOBBmCOOoBCBOCBUhBB-BBBCDBCBBLCCBBBGFBCECFMMBFFBDBGDBC7B7BBFFB2LBFcBD+HBXKByCtCBXnTBtBwBBDeBLyMBX+BBFfBD1LBDpEBmHFBmLBBvBZBC4CBN1GBbPBFOOBNNWBBHBB8CBB0HBBFJBhBlBBKRRBdBMdBJQQBeBLmBBQ-JBhuG-BBx0V2BB6RWBKBBoDBB+EDBLDB+RCBiHPPB+9T+9TpEgBBuLPBhCBB3BHBtBDBjDCCBBBD7E7EHRRBBBgBCCcCCiEGBCGBOBB6JIB6BQBDCBCMBEwBwBBrBB7zBBBwSmWmWBiKiKBGBnjC2kC2kCBbBr6SDBG3qU3qUk7DvHBLCBEzNBHWBQQBgDzDB9B1HBLmBBD7BBGCBXBBIdBF8BBWhCBE7F7FB1CBrbaagBaagBaagBaagBaa9B-PB4BDBzBHBCNBCBBp2BwNwNttCEE+DiOiOBvIvIBqBBFjDBNOBDOBCOBCkBBYgFB5BcBOrBBFIBIBBPFB7E4eBEQBEMBE5GBHLBFQQBKBF3BBJJBHnBBJdBDLBFBBPIBoB3KBJNBDMBEKBE4BBCFFBOBDLBFJBIyEBC7CBLAB",!1)),Sc:()=>new wB(DB("kB+D+DBCBqnB8D8DzPBBzPBBI2H2HoImSmS8sClmClmCBgBB37hBkuVkuVtD7E7E8GBBEBB3-HDB-4wBxtCxtC",!1)),Sk:()=>new wB(DB("+CCCoCHHFEEqQDBNNBGGBCCCBPB2DPPBjoBjoB15FCCBBBMCBOCBOCBOBB9kEBBkzdWBKBBoDBBxePPBniUniUBPB8bCCjF4g9B4g9BBDB",!1)),Sm:()=>new wB(DB("rBRRBBB+BCCuBFFmBgBgB-XwQwQBBB8xGOOoBCBOCBsEoBoBBDBHlClCBDBGBBFGDIgBgBBDDCgBgBBqIBhBBB7CffBXBpBFB2OKK3BHBwDxKxKBDBDeBLPBhIiEBX+BBFfBDhIBxBUBDFB9+zB5Z5ZCCBlFRRBBB+BCCkEHHBCBitDBBhrwBx+Bx+BagBgBagBgBagBgBagBgBat5Ft5FB-uC-uCBHB",!1)),So:()=>new wB(DB("mFDDFCCyerIrIBgEgEBvGvGLUUB4H4HkQ2L2LjEFBClElEwGqBqBoMCBQCCBBBDFBVECmEHBCFBCBBGDBmGBBxXJB0WzWzW+EhBBiLJBKIBksBBBCDBCBBLCCBHHBEBCECFMMBPPCBBC7B7BBKKBDBDDBCBBCBBCGBCeBDBBCCCBdBtIHBFTBDGBDwCBCdBanBBHnCBXKByCtCBX2FBCIBC1BBJuDBC3HBtBrBBhC-HBhQvBBWBBHmBBDpEBmHFBmLBBvBZBC4CBN1GBbPBFOOBNNWBBHBBxKBBFJBhBlBBKRRBdBMdBJQQBeBLmBBQ-JBhuG-BBx0V2BBibDBLBBC+R+RBBBqqUPBuLPBhCBB3BHBuBCBlPEEFBBOBB6JIB6BQBDCBCMBEwBwBBrBB7zBBBwSpgBpgBBGBnjC2kC2kCBGBFQBr6SDBG3qU3qUk7DvHBLCBEzNBHWBQPBhDzDB9B1HBLmBBD7BBGCBXBBIdBF8BBWhCBE7F7FB1CBqlB-PB4BDBzBHBCNBCBBp2B96C96CiEyWyWBqBBFjDBNOBDOBCOBCkBBYgFB5BcBOrBBFIBIBBPFB7E6HBG4WBEQBEMBE5GBHLBFQQBKBF3BBJJBHnBBJdBDLBFBB-B3KBJNBDMBEKBE4BBCFFBOBDLBFJBIyEBC7CBLAB",!1)),Z:()=>new wB(DB("gBgEgEgvFgsCgsCBJBeBBGwBwBh9DAB",!1)),Zl:()=>new wB(DB("ohIA",!0)),Zp:()=>new wB(DB("phIA",!0)),Zs:()=>new wB(DB("gBgEgEgvFgsCgsCBJBlBwBwBh9DAB",!1)),ASCII_Hex_Digit:()=>new wB(DB("wBJIFbF",!0)),Alphabetic:()=>new wB(DB("hCZBHZBwBLLFGGBVBCeBCpOBFLBPEBICC3CeeBQBCBBDDBCHHCCBCCCBSBCyCBCqEBJlFBClBBDHHBnBBoBNBCCCBCCBCCJaBFDBeKBG3BBCGBPlDBCHBFHBFCBLCBDRRBuBBOkDBZgBBKBBFGGBWBDSBUYBIKBGXBCGBIJJBoBBLLBEGBHrCBCPBCCBFOBOSBCHBDBBDVBCGBCEEBCBEHBDBBDBBCJJFBBCEBNBBLFFBBBCFBFBBDVBCGBCBBCBBCBBFEBFBBDBBFIIBCBCSSBEBMCBCIBCCBCVBCGBCBBCEBEIBCCBCBBEQQBCBWDBFCBCHBDBBDVBCGBCBBCEBEHBDBBDBBKBBFBBCEBORRBCCBEBECBCDBEBBCCCBEEBEEBBBELBFEBECBCCBEHHpBMBCCBCWBCPBEHBCCBCCBJBBCCBCBBDDBdDBCHBCCBCWBCJBCEBEHBCCBCCBJBBGCBCDBOCBNMBCCBCoBBDHBCCBCCBCGGBCBIEBXFBCCBCRBEXBCIBCDDBFBJFBCCCBGBTBBO5BBGGBH0B0BBECBDBCXBCCCBRBCCBDEBCHHPDBhBgCgCBGBCjBBFSBFPBCjBBkC2BBCDDBDBR-BBLDBDlBBCGGDqBBCsKBCDBDGBCCCBCBDoBBCDBDgBBCDBDGBCCCBCBDOBC4BBCDBDiCBmBPBR1CBDFBErTBDQBCZBGqCBEKBITBMUBNTBNMBCCBCBBNzBBDSBPFFkC4CBIqBBGlCBLeBCLBFIBYdBDEBMrBBFZB3BbBF+BBDTBzBYYBMMBBByBzBBCOBCHB0BpBBDDBLrBBCKBP2BBXCBLjBBDKBGqBBDCBqBDBCFBCBBEGGB+FBUhBBM1IBDFBDlBBDFBDHBCGCBdBD0BBCGBCEEBBBCGBEDBDFBFMBGCBCGB1DOORMBmDFFDJBCEEBDBHGCBCBCKBDDBGEBFSSBnBBuZzBB34BkHBHDBEBBNlBBCGGD3BBIRRBVBKGBCGBCGBCGBCGBCGBCGBCGBCfBwB2O2OBBBaIBIEBDEBF1CBHCBC5CBCDBGqBBC9CBSfBxBPBhQ-tGBhCs0VBkCtBBDsIBEPBLBBVuBBGHBEwDBoBIBDmDBDxCBVUBCgBBZzBBNjCBCtBtBBEBECCBBBLgBBGiBBOcBEyBBCLBQRRBOBLEBC2BBKNBTWBEkCBCCCZCBDPBDDBMFBDFBDFBKGBCGBCqBBCNBH6DBWj9KBNWBFwBBloItLBDpDBnBGBNEBGLBCMBCEBCCCBCCBCCBqDBiBqLBT-BBD1BBpBLB1DEBCmEBlBZBHZBM4CBEFBDFBDFBDCBkBLBCZBCSBCBBCOBDNBjB6DBmC0BBsIcBEwBBwBfBOdBGqBBGdBDjBBFHBCEBrB9EBTjBBFjBBFnBBJzBBNKBCOBCGBCBBCKBCOBCGBCBBEzBBN2JBKVBLHBZFBCpBBCIBmCFBDCCBqBBCBBEDDBVBLWBKeBiCSBCBBLVBLZBHZBnB3BBHBBhCDBCBBGHBCCBCcBrBcBEcBkBHBCbBc1BBLVBLSBORBvDoCB4ByBBOyBBOnBBjBbBEGGBVB7HpBBCBBEBBRFBzBCBEcBLJJBUBrBRBvBUBcWBKlCBsBEBL4BBKOOBXBYyBBSDBJiBBEKKB+BBCDBKBBLCCkBRBChBBDHHBCB-BGBCCCBCBCOBCJBI4BBYDBCHBDBBDVBCGBCBBCEBEHBDBBDBBEHHGGBdJBCDDClBBCJBCDDCDBCBBECCtBhCBCCBCDBVCBfhCBDBBC5F5FB0BBDGBaFBjB+BBCEE8B1BBDoCoCBZBDNBWGB6F4BBoD-BBgBHBDDDBGBCBBCdBCBBDBBDDB+CHBDtBBDFBCCCBccBxBBDJBSnCBGTTBnCBoDHB5CgBBgBIBCsBBCGBCyByBBcBDVBCNBqCGBCBBCrBBECCBCCBBBCDDBZZBEBCBBCkBBCBBCDBCYYBqBBlIWBKQBCoBBECBwDwCwCB4cBnDuDBSjGBtyCgDBQvhBBSFBa68DBGmSB61GuBBy2B4RBIeBSuCBSdBTvBBRDBgBUBGSBxNsBB0G-BBhBYBDYBtBqCBF4BBIQBhCBBCNNBFBK1mHBqBfBiDyDB+vIDBCGBCBBCiJBQeeBBBDPPBCBJrMBloCqDBGMBEIBIJBFi7Fi7FBzCBCmCBCBBDDDBDDBCBCLBCCCBFBCgCBCDBDHBCGBCbBCDBCEBCEEBFBCzKBDYBCYBCeBCYBCeBCYBCeBCYBCeBCYBCHB15BeBHFB2GGBCQBDGBCBBCEBG9BBiBxDxDBrBBLGBRiKiKBcBTrBBlPbBlHdBDwGwGBdBCVBJBBhHGBCDBCBBCOBCkGB8BjCBEEE1lBDBCaBCBBCDDCJBCDBCCCHFFCECBBBCBBCDDCICBCCDDBCGBCDBCDBCCCBIBCQBGCBCEBCQB1TZBHZBHZB3zD-2pBBhB9oEBDt0FBDwpHBQtTBjtC9QBjvBq6EBGppIB",!1)),Dash:()=>new wB(DB("tB9qB9qB0BiyDiyDmgBqgCqgCBEB+BoBoBQnMnMlgDDDgBBBFdd-NUUwDxszBxszBBmBmBLqFqFhzD-J-J",!1)),Emoji:()=>new wB(DB("jBHHGJBwDFFu8HNN5GXX7CFBQBBwLBBNnFnFaKBFCBoGoHoHBLLK7B7BBCBCEBKGDBDDFDDCBBDIEBJJBBBGCCGLBMBBDCCBCCTDDBTTBEBCCCBEEBGGDBBFBBMBBGBBDGGBECBVVBGGBEBCDBDFFDDDBEBCDDCCCHEEHLLBQQDFFCFFBBBCMMBxBxBBBBKeP1LBBwOCBUBB0BFF7mBNN6SCCrrvDrGrGhFBBNBBPDDBIBsCZBCBBYVVDIBWBBvFhBBDvDBDBBCCBDyCBDCBCmIBC+BBMFBCXBIBBDHBNDDBCBDFFBOOBDDJBBKGGBBBNCBJCBDCCFHHEHHB0CBxBlCBGHBDDBEJBECCBEEDJBkHLBF8I8IBtBBCJBC4FBxDMBEKBE4BBCFFBOBDLBFJB",!1)),Emoji_Component:()=>new wB(DB("jBHHGJB0+H2G2Gsp3B3+8B3+8BBYB8PEBxtBDBtzhY-CB",!1)),Emoji_Modifier:()=>new wB(DB("7-8DE",!0)),Emoji_Modifier_Base:()=>new wB(DB("9wJ8G8GRDB4jzD9B9BBBBDDDBBB2DBBDKBWSBEFFBBBCCBICCZqGqGBFFWFFBvFvFBBBEEB0CRRBBBKMMgSDDJHBHKKBIBDCB5B+B+BBCCBCCSCBCMBmHCBrBIB",!1)),Emoji_Presentation:()=>new wB(DB("64IBBuGDBEDDqQBBWBBzBLBsBUUOJJBSSBGGBJJGWWIBBCFFDIIFBBdkBkBCFFBBBC+B+BBBBZPP8aBB0BFFvlxDrGrG-FDDBIBsCZBCZZVDDBDBCCBWBBvFgBBNIBClCBCVBNqBBFEBNQBEEEBlCBCCCB5FBD+BBODBCXBTbbBOO3C0CBxBlCBHEEBBBDDBEDBMBBIIBkHLBF8I8IBtBBCJBC4FBxDMBEKBE4BBCFFBOBDLBFJB",!1)),Extended_Pictographic:()=>new wB(DB("pFFFu8HNN5GXX7CFBQBBwLBBNnFnFaKBFCBoGoHoHBLLK7B7BBCBCEBKGDBDDFDDCBBDIEBJJBBBGCCGLBMBBDCCBCCTDDBTTBEBCCCBEEBGGDBBFBBMBBGBBDGGBECBVVBGGBEBCDBDFFDDDBEBCDDCCCHEEHLLBQQDFFCFFBBBCMMBxBxBBBBKeP1LBBwOCBUBB0BFF7mBNN6SCCrrvDoBoBBCBlDLBQBBQPPBmBmBBIBxDBBNBBPDDBIBU3BBcOBLVVDIBCDBKWBH7FBDvDBDBBCCBDyCBDCBCDBG9HBC+BBMFBCXBIBBDHBNDDBCBDFFBOOBDDJBBKGGBBBNCBJCBDCCFHHEHHB0CBxBlCBGHBDQBECCBEBDMB7GlBBNDB5BHBLFBpBHBfBBNDBDNBKmBBNuBBCJBC4FB5CHBPxEBhI9fB",!1)),Hex_Digit:()=>new wB(DB("wBJIFbFq1-BJIFbF",!0)),Lowercase:()=>new wB(DB("hDZBwBLLFlBlBBWBCHBC2BCBQCBuBCDECBBBDCCDEEBFFDEEBBBDDDCCCDCCBCCDEECDDBDDBBBHGDCOCBSCBDDCEEC4BCBFBDDDBCCFICBjCBDiBBIBBfEBhDsBsBCEEDDBTccBhBBCBBECBCWCBDBCGDB0B0BBuBBCgBCK0BCDMCBgDCxBoBBo6CqBBCDB5XFBjkCIBC2D2DB+FBiC0ECBHBCgDCBHBJFBLHBJHBJFBLHBJHBJNBDHBJHBJHBJEBCBBHEEBBBCBBJDBDBBJHBLCBCBB6DOORMBuDEEBEEcKFDBBJDBFiBiBBOBFsasaBYBn6BvBBCEEBGCFCCBCCBGBEiDCBIICFFNlBBCGG0oesBCUaCBBBmEMCBBBC8BCBIBCCCDICFCCDCCBBBCSCGGGCMCFCCDOCWDBCCCBBB2ZqBBCNBHvCBh6TGBNEBqhBZBumBnBBpEjBB8EKBCOBCGBCBBkODDBBBCpBBCIBmoByBB+DVB75CfBhsVfB8BYBnqZZBbGBCRBbZBbDBCCCBFBCKBbZBbZBbZBbZBbZBbZBbZBbZBbbBdYBCFBbYBCFBbYBCFBbYBCFBbYBCFBC15B15BBIBCTBHFBmI9BB1lChBB",!1)),Math:()=>new wB(DB("rBRRBBBgBeeCuBuBFmBmBgB5W5WBBBDbbBDDBBBwQCBuwGccBBBMEEOPPBCBWEBMEBiCMBFEEBFFBDBTFFDJBCDDBEBHEEBDDBCCBBBCFBENBClClCBWBCFBCBBFBBFfBCHHBPPBqIBJDBVBB7CffBZBCZZMGB+NBBNJBFFBFBBDBBEEBPCCDFBMHBGBB6BCCeDBKCBxK-BBhI-PBxBUBDFB9+zB4Z4ZBEBCjFjFRCBeCCeCCkEHHBCBitDBBhrwBwoBwoBBzCBCmCBCBBDDDBDDBCBCLBCCCBFBCgCBCDBDHBCGBCbBCDBCEBCEEBFBCzKBDjJBDxBBhwFDBCaBCBBCDDCJBCDBCCCHFFCECBBBCBBCDDCICBCCDDBCGBCDBCDBCCCBIBCQBGCBCEBCQB1BBB-uCIB",!1)),Quotation_Mark:()=>new wB(DB("iBFFkEQQ96HHBaBBowDqOqOBCBOCBixzBDB+FFF7CBB",!1)),Terminal_Punctuation:()=>new wB(DB("hBLLCMMBEE-ZJJiQ6B6BpCPPCCB1FsBsBBJBCsHsHB3B3BBEBCHBgBmImIB1nB1nBBtFtFFFB4JBB2YHBmY9D9DBBBoCBB+ECBEoBoBBCBDBB7JBBjLDBjFBBLBBCCBeCB8FEB-BBBldYYBKKBBBwlDCBzJOOFLLCBBEBBtNBB8ndBBuICBkHEB-LBB3CBBgD4E4EBBB0ECBgERRB6H6HnxUDDB6B6BBBBCDBqFLLCMMBEEiCDD7hBxBxBnkBoGoG3JBB5EFBlCFB6CDB5dEBtBDB+FGBxDDBgECBiEBBHRRB5C5CBDBtDrJrJB2D2DBBBNBBnLDBEOBqDBB6HCBmQCC8HBB4CBBFBB-MCBuBmUmUBrCrCBspBspBBDB6vRBBmEiCiCBBBLqRqRBoJoJBnwTnwTovHDB",!1)),Uppercase:()=>new wB(DB("hCZBmDWBCGBiB2BCDOCDuBCBECEBBCCCBCCBBBDDBCBBCCBEBBCBBCECBCCDCCBCCBBBCCCBEEIJDCMCDQCDDDCCBC4BCIBBCBBDCCBCBCGCiJCCEJJHCCBBBCCCBCCBPBCIBkBDDBBBEWCGDDCBBDyBBxBgBCK2BCBMCD+CCDlBBq6ClBBCGGzW1CB0kCHHBpBBDCBhK0ECKgDCKHBJFBLHBJHBJFBMGCJHBpCDBNDBNDBNEBMDBnIFFECBDCBDEEBDBHGCBCBDDBLBBGbbBOBUzZzZBYBx5BvBBxBCCBBBDGCBCBCDDJCBCgDCJCCFuqeuqeCqBCUaCoEMCE8BCLECBICFCCDCCEUCBDBCEBCOCBCBCCCBQCZs5Vs5VBYBmmBnBBpEjBB9EKBCOBCGBCBBr3ByBB+EVB75CfBhsVfBhCYBoqZZBbZBbZBbCCBGDBDDBCBCHBbZBbBBCDBDHBCGBcBBCDBCEBCEEBFBcZBbZBbZBbZBbZBbZBfYBiBYBiBYBiBYBiBYBiB2pE2pEBgBBvgCZBHZBHZB",!1)),White_Space:()=>new wB(DB("JEBTlDlDbgvFgvFgsCKBeBBGwBwBh9DAB",!1))});static SCRIPTS=new _B({Adlam:()=>new wB(DB("go6DrCFJFB",!0)),Ahom:()=>new wB(DB("g4lCaDOFW",!0)),Anatolian_Hieroglyphs:()=>new wB(DB("ggxCmS",!0)),Arabic:()=>new wB(DB("gwBEBCFBCNBCCBCfBCJBMZBCrDBChBBxCvBBxHhBBGqCBCcBxy8BtPBDvEBhBPBxDEBCmEBk7DeBkCFBJIBiBFBh43BDBCaBCBBCDDCJBCDBCCCHFFCECBBBCBBCDDCICBCCDDBCGBCDBCDBCCCBIBCQBGCBCEBCQB1BBB",!1)),Armenian:()=>new wB(DB("xpBlBDxBDCks9BE",!0)),Avestan:()=>new wB(DB("g4iC1BEG",!0)),Balinese:()=>new wB(DB("g4GsCCxB",!0)),Bamum:()=>new wB(DB("g1pB3CpowB4R",!0)),Bassa_Vah:()=>new wB(DB("w26CdDF",!0)),Batak:()=>new wB(DB("g+GzBJD",!0)),Bengali:()=>new wB(DB("gsCDBCHBDBBDVBCGBCEEBCBDIBDBBDDBJFFBCCBDBDYB",!1)),Beria_Erfe:()=>new wB(DB("g17CYDY",!0)),Bhaiksuki:()=>new wB(DB("ggnCICsBCNLc",!0)),Bopomofo:()=>new wB(DB("qXB6wLqBxDf",!0)),Brahmi:()=>new wB(DB("ggkCtCFjBKA",!0)),Braille:()=>new wB(DB("ggK-H",!0)),Buginese:()=>new wB(DB("gwGbDB",!0)),Buhid:()=>new wB(DB("g6FT",!0)),Canadian_Aboriginal:()=>new wB(DB("ggF-TxRlC7tgCP",!0)),Carian:()=>new wB(DB("g1gCwB",!0)),Caucasian_Albanian:()=>new wB(DB("wphCzBMA",!0)),Chakma:()=>new wB(DB("gokC0BCR",!0)),Cham:()=>new wB(DB("gwqB2BKNDJDD",!0)),Cherokee:()=>new wB(DB("g9E1CDFz7lBvC",!0)),Chorasmian:()=>new wB(DB("w9jCb",!0)),Common:()=>new wB(DB("AgCBbFBbuBBCOBCEBYgBgBiOmBBGEBDTB1DKKHCC+THHPEEhB9E9ElQiEiEB6mB6mB2MDBjJwvBwvBBBBoCBBsGBBCumBumBOIIBCBCFBCCBDmYmYBKBD2CBCKBEKBCOBShBB-BlBBCCBDFBCaBCQBqBCBF5UBXKBW-cBhIzTBDpEBhQ9CBzMUBCCCBXBQHBFDB8CBBE7C7CB0E0EBOBhBlBBKxBxBB+BBgBwCBwB5C5CBmFBhuG-BBhoWhBBnDCBmFJB1HhFhFsMPPBzuUzuUBxGxGBIBXiBBCSBCDB0ECCBeBbFBbKBLuBuBBhChCBFBCGBLEBjICBFsBBEIBxCMB0BsBBlHaBltuBDB96D8HBEzNBHWBQQBgDzDB9B1HBLmBBD9BBEQBJBBIdBF8BB2GTBNTBN2CBKYBoE0CBCmCBCBBDDDBDDBCBCLBCCCBFBCgCBCDBDHBCGBCbBCDBCEBCEEBFBCzKBDjJBDxBByjFjCBtC8BBjWrBBFjDBNOBDOBCOBCkBBLtFB5BZBCBBOrBBFIBIBBPFB7E4eBEQBEMBE5GBHLBFQQBKBF3BBJJBHnBBJdBDLBFBBPIBoB3KBJNBDMBEKBE4BBCFFBOBDLBFJBIyEBCmDBnghYffB+CB",!1)),Coptic:()=>new wB(DB("ifNxkKzDGG",!0)),Cuneiform:()=>new wB(DB("ggoC5cnDuDCEMjG",!0)),Cypriot:()=>new wB(DB("ggiCFBDCCBqBBCBBEDD",!1)),Cypro_Minoan:()=>new wB(DB("w8rCiD",!0)),Cyrillic:()=>new wB(DB("ggBkEBDoFBx6FKBhFtCtCojEfBhie-CBv8VBBhw4B9BBiBAB",!1)),Deseret:()=>new wB(DB("gghCvC",!0)),Devanagari:()=>new wB(DB("goCwCFODZh7nBfhwcJ",!0)),Dives_Akuru:()=>new wB(DB("gomCGBDDDBGBCBBCdBCBBDLBKJB",!1)),Dogra:()=>new wB(DB("ggmC7B",!0)),Duployan:()=>new wB(DB("ggvDqDGMEIIJDD",!0)),Egyptian_Hieroglyphs:()=>new wB(DB("ggsC1iBL68D",!0)),Elbasan:()=>new wB(DB("gohCnB",!0)),Elymaic:()=>new wB(DB("g-jCW",!0)),Ethiopic:()=>new wB(DB("gwEoCBCDBDGBCCCBCBDoBBCDBDgBBCDBDGBCCCBCBDOBC4BBCDBDiCBDfBEZBnvGWBKGBCGBCGBCGBCGBCGBCGBCGBjpfFBDFBDFBKGBCGBylvCGBCDBCBBCOB",!1)),Garay:()=>new wB(DB("gqjClBEcJB",!0)),Georgian:()=>new wB(DB("glElBBCGGDqBBCDBx8CqBBDCBhiElBBCGG",!1)),Glagolitic:()=>new wB(DB("ggL-Ch9sDGCQDGCBCE",!0)),Gothic:()=>new wB(DB("w5gCa",!0)),Grantha:()=>new wB(DB("g4kCDBCHBDBBDVBCGBCBBCEBDIBDBBDCBDHHGGBDGBEEB",!1)),Greek:()=>new wB(DB("wbDBCCBDDBCFFCCCBBBCCCBSBC+BBPPBnpGEBzBEBFEB1ChKhKBUBDFBDlBBDFBDHBCGCBdBD0BBCOBCNBDFBCSBDCBCIBoJ-xiB-xiB7uVuCBSgj0Bgj0BBkCB",!1)),Gujarati:()=>new wB(DB("h0CCBCIBCCBCVBCGBCBBCEBDJBCCBCCBDQQBCBDLBIGB",!1)),Gunjala_Gondi:()=>new wB(DB("grnCFCBCkBCBCFIJ",!0)),Gurmukhi:()=>new wB(DB("hwCCBCFBFBBDVBCGBCBBCBBCBBDCCBDBFBBDCBEIIBCBCIIBPB",!1)),Gurung_Khema:()=>new wB(DB("go4C5B",!0)),Han:()=>new wB(DB("g0LZBC4CBN1GBwBCCaIBPDBle-tGBhC-vUBhoWtLBDpDBpodBBNGBqgkB-2pBBhB9oEBDt0FBDwpHBQtTBjtC9QBjvBq6EBGppIB",!1)),Hangul:()=>new wB(DB("goE-HvxHBiI9CyDeiCei3dckUj9KNWFwBl9JeEFDFDFDC",!0)),Hanifi_Rohingya:()=>new wB(DB("gojCnBJJ",!0)),Hanunoo:()=>new wB(DB("g5FU",!0)),Hatran:()=>new wB(DB("gniCSCBGE",!0)),Hebrew:()=>new wB(DB("xsB2BBJaBFFBpp9BZBCEBCCCBCCBCCBIB",!1)),Hiragana:()=>new wB(DB("hiM1CBHCBi7-C+IBTeeBBBulQAB",!1)),Imperial_Aramaic:()=>new wB(DB("giiCVCI",!0)),Inherited:()=>new wB(DB("gYvDB2IBBlOKBbhXhXBCB8qEtBBDLBlPCBCMBCGBFHHEBBnG-BBtQBBjGgBB65DDBsDBBmrzBPBRNBwejHjH7iEl+uBl+uBBsBBDWBhRCBSHBDGBfDBz6rYvHB",!1)),Inscriptional_Pahlavi:()=>new wB(DB("g7iCSGH",!0)),Inscriptional_Parthian:()=>new wB(DB("g6iCVDH",!0)),Javanese:()=>new wB(DB("gsqBtCDJFB",!0)),Kaithi:()=>new wB(DB("gkkCiCLA",!0)),Kannada:()=>new wB(DB("gkDMCCCWCJCEDICCCDIBGCCDDJCC",!0)),Katakana:()=>new wB(DB("hlM5CBDCBxHPBxGuBBC3CBvgzBJBCsBBzisBDBCGBCBBCgJgJBBBzBPPBCB",!1)),Kawi:()=>new wB(DB("g4nCQCoBEc",!0)),Kayah_Li:()=>new wB(DB("goqBtBCA",!0)),Kharoshthi:()=>new wB(DB("gwiCDCBGHCCCcDCFJII",!0)),Khitan_Small_Script:()=>new wB(DB("k-7C84G84GB0OBqBAB",!1)),Khmer:()=>new wB(DB("g8F9CDJHJnPf",!0)),Khojki:()=>new wB(DB("gwkCRCuB",!0)),Khudawadi:()=>new wB(DB("w1kC6BGJ",!0)),Kirat_Rai:()=>new wB(DB("gq7C5B",!0)),Lao:()=>new wB(DB("h0DBBCCCBDBCXBCCCBVBDEBCCCBFBCJBDDB",!1)),Latin:()=>new wB(DB("hCZBHZBwBQQGWBCeBCgOBoBEB8wGlBBHwBBGDBGMBClCBiC-HByLOORMBuEBBHccSoBB42CfBj1elDBExCBVOBxZqBBCIBCDB38TGB7gBZBHZBmhCFBCpBBCIBm61BeBHFB",!1)),Lepcha:()=>new wB(DB("ggH3BEOEC",!0)),Limbu:()=>new wB(DB("goGeBCLBFLBFEEBKB",!1)),Linear_A:()=>new wB(DB("gwhC2JKVLH",!0)),Linear_B:()=>new wB(DB("gggCLCZCSCBCODNjB6D",!0)),Lisu:()=>new wB(DB("wmpBvBx1eA",!0)),Lycian:()=>new wB(DB("g0gCc",!0)),Lydian:()=>new wB(DB("gpiCZGA",!0)),Mahajani:()=>new wB(DB("wqkCmB",!0)),Makasar:()=>new wB(DB("g3nCY",!0)),Malayalam:()=>new wB(DB("goDMCCCyBCCCFFPDZ",!0)),Mandaic:()=>new wB(DB("giCbDA",!0)),Manichaean:()=>new wB(DB("g2iCmBFL",!0)),Marchen:()=>new wB(DB("wjnCfDVCN",!0)),Masaram_Gondi:()=>new wB(DB("gonCGBCBBCrBBECCBCCBHBJJB",!1)),Medefaidrin:()=>new wB(DB("gy7C6C",!0)),Meetei_Mayek:()=>new wB(DB("g3qBWqGtBDJ",!0)),Mende_Kikakui:()=>new wB(DB("gg6DkGDP",!0)),Meroitic_Cursive:()=>new wB(DB("gtiCXFTDtB",!0)),Meroitic_Hieroglyphs:()=>new wB(DB("gsiCf",!0)),Miao:()=>new wB(DB("g47CqCF4BIQ",!0)),Modi:()=>new wB(DB("gwlCkCMJ",!0)),Mongolian:()=>new wB(DB("ggGBBDCCBSBH4CBIqBB2t-BMB",!1)),Mro:()=>new wB(DB("gy6CeCJFB",!0)),Multani:()=>new wB(DB("g0kCGBCCCBCBCOBCKB",!1)),Myanmar:()=>new wB(DB("ggE-EhqmBeiDfxibT",!0)),Nabataean:()=>new wB(DB("gkiCeJI",!0)),Nag_Mundari:()=>new wB(DB("wm5DpB",!0)),Nandinagari:()=>new wB(DB("gtmCHDtBDK",!0)),New_Tai_Lue:()=>new wB(DB("gsGrBFZHKEB",!0)),Newa:()=>new wB(DB("gglC7CCE",!0)),Nko:()=>new wB(DB("g+B6BDC",!0)),Nushu:()=>new wB(DB("h-7CvsQvsQBqMB",!1)),Nyiakeng_Puachue_Hmong:()=>new wB(DB("go4DsBENDJFB",!0)),Ogham:()=>new wB(DB("g0Fc",!0)),Ol_Chiki:()=>new wB(DB("wiHvB",!0)),Ol_Onal:()=>new wB(DB("wu5DqBFA",!0)),Old_Hungarian:()=>new wB(DB("gkjCyBOyBIF",!0)),Old_Italic:()=>new wB(DB("g4gCjBKC",!0)),Old_North_Arabian:()=>new wB(DB("g0iCf",!0)),Old_Permic:()=>new wB(DB("w6gCqB",!0)),Old_Persian:()=>new wB(DB("g9gCjBFN",!0)),Old_Sogdian:()=>new wB(DB("g4jCnB",!0)),Old_South_Arabian:()=>new wB(DB("gziCf",!0)),Old_Turkic:()=>new wB(DB("ggjCoC",!0)),Old_Uyghur:()=>new wB(DB("w7jCZ",!0)),Oriya:()=>new wB(DB("h4CCCHDBDVCGCBCEDIDBDCICFBCEDR",!0)),Osage:()=>new wB(DB("wlhCjBFjB",!0)),Osmanya:()=>new wB(DB("gkhCdDJ",!0)),Pahawh_Hmong:()=>new wB(DB("g46ClCLJCGCUGS",!0)),Palmyrene:()=>new wB(DB("gjiCf",!0)),Pau_Cin_Hau:()=>new wB(DB("g2mC4B",!0)),Phags_Pa:()=>new wB(DB("giqB3B",!0)),Phoenician:()=>new wB(DB("goiCbEA",!0)),Psalter_Pahlavi:()=>new wB(DB("g8iCRIDNG",!0)),Rejang:()=>new wB(DB("wpqBjBMA",!0)),Runic:()=>new wB(DB("g1FqCEK",!0)),Samaritan:()=>new wB(DB("ggCtBDO",!0)),Saurashtra:()=>new wB(DB("gkqBlCJL",!0)),Sharada:()=>new wB(DB("gskC-ChsCH",!0)),Shavian:()=>new wB(DB("wihCvB",!0)),Siddham:()=>new wB(DB("gslC1BDlB",!0)),Sidetic:()=>new wB(DB("gqiCZ",!0)),SignWriting:()=>new wB(DB("gg2DrUQECO",!0)),Sinhala:()=>new wB(DB("hsDCBCRBEXBCIBCDDBFBEFFBEBCCCBGBHJBDCBt-gCTB",!1)),Sogdian:()=>new wB(DB("w5jCpB",!0)),Sora_Sompeng:()=>new wB(DB("wmkCYIJ",!0)),Soyombo:()=>new wB(DB("wymCyC",!0)),Sundanese:()=>new wB(DB("g8G-BhIH",!0)),Sunuwar:()=>new wB(DB("g+mChBPJ",!0)),Syloti_Nagri:()=>new wB(DB("ggqBsB",!0)),Syriac:()=>new wB(DB("g4BNC7BDCxIK",!0)),Tagalog:()=>new wB(DB("g4FVKA",!0)),Tagbanwa:()=>new wB(DB("g7FMCCCB",!0)),Tai_Le:()=>new wB(DB("wqGdDE",!0)),Tai_Tham:()=>new wB(DB("gxG+BCcDKHJHN",!0)),Tai_Viet:()=>new wB(DB("g0qBiCZE",!0)),Tai_Yo:()=>new wB(DB("g25DeCVJB",!0)),Takri:()=>new wB(DB("g0lC5BHJ",!0)),Tamil:()=>new wB(DB("i8CBBCFBECBCDBEBBCCCBEEBEEBBBELBFEBECBCDBDHHPUBm+kCxBBOAB",!1)),Tangsa:()=>new wB(DB("wz6CuCCJ",!0)),Tangut:()=>new wB(DB("g-7CgBgBB+3GBhQeBiDyDB",!1)),Telugu:()=>new wB(DB("ggDMCCCWCPDICCCDIBCCCBDDDJII",!0)),Thaana:()=>new wB(DB("g8BxB",!0)),Thai:()=>new wB(DB("hwD5BGb",!0)),Tibetan:()=>new wB(DB("g4DnCCjBFmBCjBCOCGFB",!0)),Tifinagh:()=>new wB(DB("wpL3BIBPA",!0)),Tirhuta:()=>new wB(DB("gklCnCJJ",!0)),Todhri:()=>new wB(DB("guhCzB",!0)),Tolong_Siki:()=>new wB(DB("wtnCrBFJ",!0)),Toto:()=>new wB(DB("w04De",!0)),Tulu_Tigalari:()=>new wB(DB("g8kCJBCDDClBBCJBCDDCDBCJBCBBJBB",!1)),Ugaritic:()=>new wB(DB("g8gCdCA",!0)),Unknown:()=>new wB(DB("4bBBHDBICCVuMuMnBBBzBBBE4B4BBGBcDBHKBvI9B9BBmDmDBMB8BBByBBBQddBCCMEBjBEBuHJJBDDBXXICCBBBFBBKBBDBBFHBCDBDGGBaaBEEHDBDBBXIIDGDBCCGDBDBBECBCGBFCCBFBSJBEKKEXXIDDGBBLIEBCCBNBFBBNGBIEEJBBDBBXIIDGGBKKBDDBEEBFBEDBDGGBTTBIBDHHBBBEFFBBBDCCDCBDCBECBNDBGCBEFFBCCBEBCNBWEBOEEYRRBKKEFFBFBDEEDBBFBBLGBXEEYLLGBBKEEFGBDEBEFFBLLELBOEE0BEEHDBRBBbEETCBZKKCBBICBCDBHCCJFBLBBELB7BDBekBBDCCGZZCYYBGGCIILBBFfBpClBlBBCBoBlBlBQOOBjBBnGCCBDBCBB6LFFBIICFFBqBqBFBBiBFFBIICFFBQQ6BFFBkCkCBhBhBBBBbFB3CBBHBB+UCB6CGBXIBZIBVLBOEEDLB-CBBLFBLFBbFB6CGBsBEBnCJBgBNNBCBNDBCCBrBBBGKBtBDBbFBMCB-BBBiCeeBMMBEBLFBPBBvBBBNTBuCnFnFBGB9BCBQCB-BEBsBBBMHBsBEB3QBBHBBnBBBHBBJGCgBBB2BQQPBBHUUBEEKmDmDNBBcOOBBBjBNBiBOBtEDB7UVBMUB14BBB-LEBuBCCBDBCBB5BGBDNBZIBI4BI-DhBBb6C6CBKB3GZBxC3C3CBoDoDBDBsB-C-C3CIBxBuzcuzcBBB4BIB9KTB5FHB+GTB9BCBLFB5BHBnCHBNFB1DKBfCBvCMMBCBiB4B4BBHBPBBLBBoDXBdJBHBBHBBHIBIII9BDB-DBBLFBl9KLBYDByBjoIBvLBBrDlBBILBGEBbGGCGDrUfBrBFB0BUUFDBGoEoEBCC-FCBHBBHBBHBBECBIIIBIBGBBNbbUDDQBBPhBB8DEBEDBuBCB5COOBBBCuBBvBhEBeCByBOBdDBlBIBfEBsBEBfmBmBBCBPpBB-EBBLFBlBDBlBDBpBHB1BKBNQQIDDMQQIDDBBB1BLB4JIBXJBJXBHrBrBKkCBHBBCtBtBDCBCBBYpCpCBGBKvBBUDDBDBiBCBcEBclBB5BDBVBBzBDDBDBJEEeBBEDBLGBKGBhCfBoBDBNIB3BCBeBBcEBbGBFLBIvCBqC2BB0BMB0BGBvBHBLFBnBCBeHBDvGBgBrBrBEBBDPBHHBKgBBvBHBrBVBblBBdTBYIBvCDBlBIBlCJBCBBaGBLFB2BTTBGBoBIBhDVVBJBTwBwBB8BBICCFQQMFB8BEBLFBFJJBDDBXXIDDGLLBDDBEEBCCBEBCEBIBBICBGKBLCCBCCnBLLCBBCFFLDDBGBDcB9CGGBcBpCHBLlFB3BBBnBhBBmCKBLFBOSB7BFBLFBVbBcBBQDBY4FB9BjDB0CLBJBBCBBJDDfDDBNNBHBLlCBJBBvBBBMaBpCHB0CMBqCGBL1CBJ3CBjBNBLFBKuBuBPJBeCBhBBBXPPBnCBIDDtBCBCDDKHBLFBHDDmBDDHGBLFBtBDBL1HBaGBSqBqBBBBe0CBCOBzBMB8clDBwDGGBJBlGryCBkDMB3iBJB88DEBoS41GB7Bl2BB6RGBgBLLBCByCLLBEBfBBHJBnCJBLIIWEBUvNB7BlGB8CEBaBBarBBsCDB6BGBS-BBGKBIIB3mHoBBhBgDB0D8vIBFIIDkJkJBNBCcBEBBCNBFHBtMjoCBsDEBOCBKGBLBBJ76DB+HCB1NFBYOBSOBvBBBYIB1D7BB3HJBoBBBjGUBnC5DBVLBVLB4CIBamEB2CoCoCDBBCBBDBBFNNCIIiCFFBJJIddFGGCCBI1K1KBlJlJB-V-VBNBGQQBuiBBgBFBH0GBISSBIIDGGBDB-BgBBCvDBuBCBPBBLDBD-JBgBQB7BEBCvOBrB1GBsBDBC-FBgBXXBGBD-GBIFFDQQmGBBRoBBtCDBLDBDwYBlCrCB+BhGBFccDCCBCCLFFCCCBEBCDBCECEDDCBBCICDCCBFFIKFCLLSEBEGGSzBBDtIBtBDBlDLBQBBQQQmBJBvF3BBeMBtBDBKGBDNBH5EB6eCBSCBOCB7GFBNDBCOBNDB5BHBLFBpBHBfBBNDBDNBKmBB5KHBPBBOCBMCB6BCCBCBRBBNDBLGB0EoDoDBjgBBh3pBfB-oEBBv0FBBypHOBvThtCB-QhvBBs6EEBrpIm8yVBCdBhD-DBxHvw-FB",!1)),Vai:()=>new wB(DB("gopBrJ",!0)),Vithkuqi:()=>new wB(DB("wrhCKCOCGCBCKCOCGCB",!0)),Wancho:()=>new wB(DB("g24D5BGA",!0)),Warang_Citi:()=>new wB(DB("glmCyCNA",!0)),Yezidi:()=>new wB(DB("g0jCpBCCDB",!0)),Yi:()=>new wB(DB("ggoBskBE2B",!0)),Zanabazar_Square:()=>new wB(DB("gwmCnC",!0))});static FOLD_CATEGORIES=new _B({L:()=>new wB(DB("laA",!0)),LC:()=>new wB(DB("laA",!0)),Ll:()=>new wB(DB("hCZBmDWBCGBiBuBCEECDOCDuBCBECEBBCCCBCCBBBDDBCBBCCBEBBCBBCECBCCDCCBCCBBBCCCBEEIBBCBBCBBCOCDQCDBBCCCBBBC4BCIBBCBBDCCBCBCGC3HrBrBCEEJHHCCBCCCBCCBPBCIBkBJJCUCGDDCBBDyBBxBgBCK2BCBMCD+CCDlBBq6ClBBCGGzW1CB0kCHHBpBBDCBhK0ECKgDCKHBJFBLHBJHBJFBMGCJHBZHBJHBJHBJEBMEBMDBNEBMEBqJEEBHHxC9zC9zCBuBBxBCCBBBDGCBCBCDDJCBCgDCJCCFuqeuqeCqBCUaCoEMCE8BCLECBICFCCDCCEUCBDBCEBCOCBCBCCCBQCZs5Vs5VBYBmmBnBBpEjBB9EKBCOBCGBCBBr3ByBB+EVB75CfBhsVfBhCYBoyehBB",!1)),Lt:()=>new wB(DB("kOCCBCCBCClBCCtsHHBJHBJHBMQQwBAB",!1)),Lu:()=>new wB(DB("hDZB7BqBqBBWBCHBCuBCEECDOCDsBCDECBBBDCCDEEGDDECBDDDCCCDFFDEECDDECCGBBCBBCBBCOCBSCDBBCEECkBCEQCJDDBCCFICBEBCBBCCCBEEBCCBCBCEBDCCBDDIDDCBBEFBGLLBnFnFsBCCEEEBBBvBDBCdBCBBECBCWCBDBCGD1BvBBCgBCK0BCDMCBgDCyBlBBq6CqBBDCB5XFBjkCIBCvHvHERRzD0ECGGGC8CCBHBJFBLHBJHBJFBMGCJHBJNBzBBBNSSBPPBEEpL2B2Bs1CvBBCEEBGCHDDLiDCJCCFNNBkBBCGG0oesBCUaCoEMCE8BCLCCDICFFFCBBDSCMOCFCCDOCb9a9advCBi8UZBumBnBBpEjBB8EKBCOBCGBCBBk4ByBB+DVB75CfBhsVfB8BYBvyehBB",!1)),M:()=>new wB(DB("5cgBgBlgHAB",!1)),Mn:()=>new wB(DB("5cgBgBlgHAB",!1)),Emoji:()=>new wB(DB("8mJA",!0)),Extended_Pictographic:()=>new wB(DB("8mJA",!0)),Lowercase:()=>new wB(DB("hCZBmDWBCGBiBuBCEECDOCDuBCBECEBBCCCBCCBBBDDBCBBCCBEBBCBBCECBCCDCCBCCBBBCCCBEEIBBCBBCBBCOCDQCDBBCCCBBBC4BCIBBCBBDCCBCBCGCiJCCEJJHCCBBBCCCBCCBPBCIBkBJJCUCGDDCBBDyBBxBgBCK2BCBMCD+CCDlBBq6ClBBCGGzW1CB0kCHHBpBBDCBhK0ECKgDCKHBJFBLHBJHBJFBMGCJHBZHBJHBJHBJEBMEBMDBNEBMEBqJEEBHHuBPBUzZzZBYBx5BvBBxBCCBBBDGCBCBCDDJCBCgDCJCCFuqeuqeCqBCUaCoEMCE8BCLECBICFCCDCCEUCBDBCEBCOCBCBCCCBQCZs5Vs5VBYBmmBnBBpEjBB9EKBCOBCGBCBBr3ByBB+EVB75CfBhsVfBhCYBoyehBB",!1)),Math:()=>new wB(DB("ycGDCHHFMMDDDCHHFAB",!1)),Uppercase:()=>new wB(DB("hDZB7BqBqBBWBCHBCuBCEECDOCDsBCDECBBBDCCDEEGDDECBDDDCCCDFFDEECDDECCGBBCBBCBBCOCBSCDBBCEECkBCEQCJDDBCCFICBEBCBBCCCBEEBCCBCBCEBDCCBDDIDDCBBEFBGLLBnFnFsBCCEEEBBBvBDBCdBCBBECBCWCBDBCGD1BvBBCgBCK0BCDMCBgDCyBlBBq6CqBBDCB5XFBjkCIBCvHvHERRzD0ECGGGC8CCBHBJFBLHBJHBJFBMGCJHBJNBzBBBNSSBPPBEEpLiBiBBOBFsasaBYBn6BvBBCEEBGCHDDLiDCJCCFNNBkBBCGG0oesBCUaCoEMCE8BCLCCDICFFFCBBDSCMOCFCCDOCb9a9advCBi8UZBumBnBBpEjBB8EKBCOBCGBCBBk4ByBB+DVB75CfBhsVfB8BYBvyehBB",!1))});static FOLD_SCRIPT=new _B({Common:()=>new wB(DB("8cgBgB",!1)),Greek:()=>new wB(DB("1FwUwU",!1)),Inherited:()=>new wB(DB("5cgBgBlgHAB",!1))})},vB=class t{static MAX_RUNE=1114111;static RUNE_ERROR=65533;static isUnsearchable(e){return e===t.RUNE_ERROR||e>=t.MIN_HIGH_SURROGATE&&e<=t.MAX_LOW_SURROGATE}static MAX_ASCII=127;static MAX_LATIN1=255;static MAX_BMP=65535;static MIN_FOLD=65;static MAX_FOLD=125251;static MIN_HIGH_SURROGATE=55296;static MAX_HIGH_SURROGATE=56319;static MIN_LOW_SURROGATE=56320;static MAX_LOW_SURROGATE=57343;static MIN_SUPPLEMENTARY_CODE_POINT=65536;static is32(t,e){let n=0,s=t.length;for(;n<s;){const r=n+Math.floor((s-n)/2),i=t.getLo(r),o=t.getHi(r);if(i<=e&&e<=o){return(e-i)%t.getStride(r)===0}e<i?s=r:n=r+1}return!1}static is(e,n){if(n<=t.MAX_LATIN1){for(let t=0;t<e.length;t++){if(n>e.getHi(t))continue;const s=e.getLo(t);if(n<s)return!1;return(n-s)%e.getStride(t)===0}return!1}return e.length>0&&n>=e.getLo(0)&&t.is32(e,n)}static isPrint(e){return e<=t.MAX_LATIN1?e>=32&&e<t.MAX_ASCII||e>=161&&173!==e:t.is(bB.Print,e)}static simpleFold(e){if(bB.CASE_ORBIT.has(e))return bB.CASE_ORBIT.get(e);if(e<=t.MAX_ASCII){const t=mB.toLowerCase(e);return t!==e?t:mB.toUpperCase(e)}return e}static equalsIgnoreCase(e,n){if(e===n)return!0;if(e<0||n<0)return!1;if(e<=t.MAX_ASCII&&n<=t.MAX_ASCII)return 65<=e&&e<=90&&(e|=32),65<=n&&n<=90&&(n|=32),e===n;for(let s=t.simpleFold(e);s!==e;s=t.simpleFold(s))if(s===n)return!0;return!1}};const IB=new Uint8Array(256);for(let t=0;t<256;t++)IB[t]=97<=t&&t<=122||65<=t&&t<=90||48<=t&&t<=57||95===t?1:0;let TB=null,OB=null;var AB=class t{static METACHARACTERS="\\.+*?()|[]{}^$";static EMPTY_BEGIN_LINE=1;static EMPTY_END_LINE=2;static EMPTY_BEGIN_TEXT=4;static EMPTY_END_TEXT=8;static EMPTY_WORD_BOUNDARY=16;static EMPTY_NO_WORD_BOUNDARY=32;static EMPTY_ALL=-1;static emptyInts(){return[]}static isByteArray(t){return Array.isArray(t)||"[object Uint8Array]"===Object.prototype.toString.call(t)}static isalnum(t){return mB.CODES[0]<=t&&t<=mB.CODES[9]||mB.CODES.a<=t&&t<=mB.CODES.z||mB.CODES.A<=t&&t<=mB.CODES.Z}static unhex(t){return mB.CODES[0]<=t&&t<=mB.CODES[9]?t-mB.CODES[0]:mB.CODES.a<=t&&t<=mB.CODES.f?t-mB.CODES.a+10:mB.CODES.A<=t&&t<=mB.CODES.F?t-mB.CODES.A+10:-1}static escapeRune(e){let n="";if(vB.isPrint(e))t.METACHARACTERS.indexOf(String.fromCodePoint(e))>=0&&(n+="\\"),n+=String.fromCodePoint(e);else switch(e){case mB.CODES['"']:n+='\\"';break;case mB.CODES["\\"]:n+="\\\\";break;case mB.CODES["\t"]:n+="\\t";break;case mB.CODES["\n"]:n+="\\n";break;case mB.CODES["\r"]:n+="\\r";break;case mB.CODES["\b"]:n+="\\b";break;case mB.CODES["\f"]:n+="\\f";break;default:{let t=e.toString(16);e<256?(n+="\\x",1===t.length&&(n+="0"),n+=t):n+=`\\x{${t}}`;break}}return n}static stringToRunes(t){const e=String(t),n=[];let s=0;for(;s<e.length;){const t=e.codePointAt(s);n.push(t),s+=t>vB.MAX_BMP?2:1}return new Int32Array(n)}static runeToString(t){return String.fromCodePoint(t)}static isWordRune(t){return t<256&&1===IB[t]}static emptyOpContext(e,n){let s=0;return e<0&&(s|=t.EMPTY_BEGIN_TEXT|t.EMPTY_BEGIN_LINE),10===e&&(s|=t.EMPTY_BEGIN_LINE),n<0&&(s|=t.EMPTY_END_TEXT|t.EMPTY_END_LINE),10===n&&(s|=t.EMPTY_END_LINE),t.isWordRune(e)!==t.isWordRune(n)?s|=t.EMPTY_WORD_BOUNDARY:s|=t.EMPTY_NO_WORD_BOUNDARY,s}static quoteMeta(e){return e.split("").map(e=>t.METACHARACTERS.indexOf(e)>=0?`\\${e}`:e).join("")}static charCount(t){return t>vB.MAX_BMP?2:1}static toArray(t){const e=t.length,n=new Array(e);for(let s=0;s<e;s++)n[s]=t[s];return n}static stringToUtf8ByteArray(t){if(globalThis.TextEncoder)return TB||(TB=new TextEncoder),TB.encode(t);{let e=[],n=0;for(let s=0;s<t.length;s++){let r=t.charCodeAt(s);r<128?e[n++]=r:r<2048?(e[n++]=r>>6|192,e[n++]=63&r|128):(64512&r)===vB.MIN_HIGH_SURROGATE&&s+1<t.length&&(64512&t.charCodeAt(s+1))===vB.MIN_LOW_SURROGATE?(r=vB.MIN_SUPPLEMENTARY_CODE_POINT+((1023&r)<<10)+(1023&t.charCodeAt(++s)),e[n++]=r>>18|240,e[n++]=r>>12&63|128,e[n++]=r>>6&63|128,e[n++]=63&r|128):(e[n++]=r>>12|224,e[n++]=r>>6&63|128,e[n++]=63&r|128)}return e}}static utf8ByteArrayToString(t){if(globalThis.TextDecoder){OB||(OB=new TextDecoder("utf-8"));const e=t instanceof Uint8Array?t:new Uint8Array(t);return OB.decode(e)}{let e=[],n=0,s=0;for(;n<t.length;){let r=t[n++];if(r<128)e[s++]=String.fromCharCode(r);else if(r>191&&r<224){let i=t[n++];e[s++]=String.fromCharCode((31&r)<<6|63&i)}else if(r>239&&r<365){let i=((7&r)<<18|(63&t[n++])<<12|(63&t[n++])<<6|63&t[n++])-vB.MIN_SUPPLEMENTARY_CODE_POINT;e[s++]=String.fromCharCode(vB.MIN_HIGH_SURROGATE+(i>>10)),e[s++]=String.fromCharCode(vB.MIN_LOW_SURROGATE+(1023&i))}else{let i=t[n++],o=t[n++];e[s++]=String.fromCharCode((15&r)<<12|(63&i)<<6|63&o)}}return e.join("")}}};const SB=(t=[],e=0)=>{const n=Object.create(null);for(let s=0;s<t.length;s++){const r=t[s],i=e+s;n[r]=i,n[i]=r}return Object.freeze(n)};var RB=class t{static Encoding=SB(["UTF_16","UTF_8"]);getEncoding(){throw Error("not implemented")}asCharSequence(){throw Error("not implemented")}asBytes(){throw Error("not implemented")}length(){throw Error("not implemented")}isUTF8Encoding(){return this.getEncoding()===t.Encoding.UTF_8}isUTF16Encoding(){return this.getEncoding()===t.Encoding.UTF_16}},NB=class extends RB{constructor(t=null){super(),this.bytes=t}getEncoding(){return RB.Encoding.UTF_8}asCharSequence(){return AB.utf8ByteArrayToString(this.bytes)}asBytes(){return this.bytes}length(){return this.bytes.length}},xB=class extends RB{constructor(t=null){super(),this.charSequence=t}getEncoding(){return RB.Encoding.UTF_16}asCharSequence(){return this.charSequence}asBytes(){return AB.stringToUtf8ByteArray(this.charSequence.toString())}length(){return this.charSequence.length}},kB=class{static utf16(t){return new xB(t)}static utf8(t){return AB.isByteArray(t)?new NB(t):new NB(AB.stringToUtf8ByteArray(t))}},LB=class{static EOF(){return-8}constructor(){this.start=0,this.end=0}canCheckPrefix(){return!0}endPos(){return this.end-this.start}hasString(){return!1}hasAnyString(){return!1}prefixLength(){return 0}},FB=class t extends LB{static RUNE_ERROR_STEP=vB.RUNE_ERROR<<3|1;constructor(t,e=0,n=t.length){super(),this.bytes=t,this.start=e,this.end=n}hasString(t,e){const n=t.bytes;if(0===n.length)return!0;const s=this.indexOf(this.bytes,n,this.start+e);return-1!==s&&s<=this.end-n.length}hasAnyString(t,e){return t.automaton8().searchUTF8(this.bytes,this.start+e,this.end)}step(e){if((e+=this.start)>=this.end)return LB.EOF();const n=255&this.bytes[e];if(n<128)return n<<3|1;let s,r,i=128,o=191;if(n>=194&&n<=223)s=2,r=31&n;else if(n>=224&&n<=239)s=3,r=15&n,224===n?i=160:237===n&&(o=159);else{if(!(n>=240&&n<=244))return t.RUNE_ERROR_STEP;s=4,r=7&n,240===n?i=144:244===n&&(o=143)}if(e+s>this.end)return t.RUNE_ERROR_STEP;const a=255&this.bytes[e+1];if(a<i||a>o)return t.RUNE_ERROR_STEP;if(r=r<<6|63&a,s>2){const n=255&this.bytes[e+2];if(128!=(192&n))return t.RUNE_ERROR_STEP;if(r=r<<6|63&n,s>3){const n=255&this.bytes[e+3];if(128!=(192&n))return t.RUNE_ERROR_STEP;r=r<<6|63&n}}return r<<3|s}index(t,e){e+=this.start;const n=this.indexOf(this.bytes,t.prefixUTF8,e);return n<0?n:n-e}context(t){let e=-1;if((t+=this.start)>this.start&&t<=this.end){let n=t-1;if(e=this.bytes[n--],e>=128){let s=t-4;for(s<this.start&&(s=this.start);n>=s&&128==(192&this.bytes[n]);)n--;n<this.start&&(n=this.start);const r=this.step(n-this.start);e=n+(7&r)===t?r>>3:vB.RUNE_ERROR}}const n=t<this.end?this.step(t-this.start)>>3:-1;return AB.emptyOpContext(e,n)}indexOf(t,e,n=0){let s=e.length;if(0===s)return n<=this.end?n:-1;const r=e[0];let i=this.end-s;const o="function"==typeof t.indexOf;let a=n;for(;a<=i;){if(o){if(a=t.indexOf(r,a),-1===a||a>i)return-1}else{for(;a<=i&&t[a]!==r;)a++;if(a>i)return-1}let n=!0;for(let r=1;r<s;r++)if(t[a+r]!==e[r]){n=!1;break}if(n)return a;a++}return-1}prefixLength(t){return t.prefixUTF8.length}},PB=class extends LB{constructor(t,e=0,n=t.length){super(),this.charSequence=t,this.start=e,this.end=n}hasString(t,e){const n=this.charSequence.indexOf(t.str,this.start+e);return-1!==n&&n<=this.end-t.str.length}hasAnyString(t,e){return t.automaton16().searchUTF16(this.charSequence,this.start+e,this.end)}step(t){if((t+=this.start)>=this.end)return LB.EOF();const e=this.charSequence.charCodeAt(t);if(e<vB.MIN_HIGH_SURROGATE||e>vB.MAX_HIGH_SURROGATE||t+1>=this.end)return e<<3|1;const n=this.charSequence.charCodeAt(t+1);return n>=vB.MIN_LOW_SURROGATE&&n<=vB.MAX_LOW_SURROGATE?1024*(e-vB.MIN_HIGH_SURROGATE)+(n-vB.MIN_LOW_SURROGATE)+vB.MIN_SUPPLEMENTARY_CODE_POINT<<3|2:e<<3|1}index(t,e){e+=this.start;const n=this.charSequence.indexOf(t.prefix,e);return n<0||n>this.end-t.prefix.length?-1:n-e}context(t){const e=(t+=this.start)>this.start&&t<=this.end?this.charSequence.charCodeAt(t-1):-1,n=t<this.end?this.charSequence.charCodeAt(t):-1;return AB.emptyOpContext(e,n)}prefixLength(t){return t.prefix.length}},MB=class{static fromUTF8(t,e=0,n=t.length){return new FB(t,e,n)}static fromUTF16(t,e=0,n=t.length){return new PB(t,e,n)}},GB=class extends Error{constructor(t){super(t),this.name="RE2JSException"}},HB=class extends GB{constructor(t,e=null){let n=`error parsing regexp: ${t}`;e&&(n+=`: \`${e}\``),super(n),this.name="RE2JSSyntaxException",this.message=n,this.error=t,this.input=e}getDescription(){return this.error}getPattern(){return this.input}},UB=class extends GB{constructor(t){super(t),this.name="RE2JSCompileException"}},VB=class extends GB{constructor(t){super(t),this.name="RE2JSGroupException"}},jB=class extends GB{constructor(t){super(t),this.name="RE2JSFlagsException"}},$B=class extends GB{constructor(t){super(t),this.name="RE2JSInternalException"}},JB=class t{static MAX_REPLACER_ARGS=65535;static quoteReplacement(t,e=!1){return e?t.indexOf("\\")<0&&t.indexOf("$")<0?t:t.split("").map(t=>{const e=t.codePointAt(0);return e===mB.CODES["\\"]||e===mB.CODES.$?`\\${t}`:t}).join(""):t.indexOf("$")<0?t:t.split("").map(t=>t.codePointAt(0)===mB.CODES.$?"$$":t).join("")}constructor(t,e){if(null===t)throw new Error("pattern is null");this.patternInput=t;const n=this.patternInput.re2();this.patternGroupCount=n.numberOfCapturingGroups(),this.groups=[],this.namedGroups=n.namedGroups,this.hasNamedGroups=Object.keys(this.namedGroups).length>0,this.numberOfInstructions=n.numberOfInstructions(),this.lookbehindState=null,e instanceof RB?this.resetMatcherInput(e):AB.isByteArray(e)?this.resetMatcherInput(kB.utf8(e)):this.resetMatcherInput(kB.utf16(e))}pattern(){return this.patternInput}reset(){return this.matcherInputLength=this.matcherInput.length(),this.appendPos=0,this.hasMatch=!1,this.hasGroups=!1,this.anchorFlag=0,this}resetMatcherInput(t){if(null===t)throw new Error("input is null");return t instanceof RB||(t=AB.isByteArray(t)?kB.utf8(t):kB.utf16(t)),this.matcherInput=t,null!==this.lookbehindState?this.lookbehindState.reset():this.lookbehindState=this.patternInput.re2().createLookbehindState(),this.reset(),this}start(t=0){if("string"==typeof t){const e=this.namedGroups[t];if(!Number.isFinite(e))throw new VB(`group '${t}' not found`);t=e}return this.loadGroup(t),this.groups[2*t]}end(t=0){if("string"==typeof t){const e=this.namedGroups[t];if(!Number.isFinite(e))throw new VB(`group '${t}' not found`);t=e}return this.loadGroup(t),this.groups[2*t+1]}programSize(){return this.numberOfInstructions}group(t=0){if("string"==typeof t){const e=this.namedGroups[t];if(!Number.isFinite(e))throw new VB(`group '${t}' not found`);t=e}const e=this.start(t),n=this.end(t);return e<0&&n<0?null:this.substring(e,n)}getNamedGroups(){if(!this.hasMatch)throw new VB("perhaps no match attempted");const t=Object.create(null);for(const e of Object.keys(this.namedGroups))t[e]=this.group(e);return t}groupCount(){return this.patternGroupCount}loadGroup(t){if(!Number.isInteger(t)||t<0||t>this.patternGroupCount)throw new VB(`Group index out of bounds: ${t}`);if(!this.hasMatch)throw new VB("perhaps no match attempted");if(0===t||this.hasGroups)return;const e=this.matcherInputLength,n=this.patternInput.re2().matchMachineInput(this.matcherInput,this.groups[0],e,this.anchorFlag,1+this.patternGroupCount,this.lookbehindState);if(!n[0])throw new VB("inconsistency in matching group data");this.groups=n[1],this.hasGroups=!0}matches(){return this.genMatch(0,aB.ANCHOR_BOTH)}lookingAt(){return this.genMatch(0,aB.ANCHOR_START)}find(t=null){if(null!==t){if(!Number.isInteger(t)||t<0||t>this.matcherInputLength)throw new VB(`start index out of bounds: ${t}`);return this.reset(),this.genMatch(t,0)}if(t=0,this.hasMatch&&(t=this.groups[1],this.groups[0]===this.groups[1])){const e=(this.matcherInput.isUTF16Encoding()?MB.fromUTF16(this.matcherInput.asCharSequence(),0,this.matcherInputLength):MB.fromUTF8(this.matcherInput.asBytes(),0,this.matcherInputLength)).step(t);e<0?t++:t+=7&e}return this.genMatch(t,aB.UNANCHORED)}genMatch(t,e){const n=this.patternInput.re2().matchMachineInput(this.matcherInput,t,this.matcherInputLength,e,1,this.lookbehindState);return n[0]?(this.groups=n[1],this.hasMatch=!0,this.hasGroups=0===this.patternGroupCount,this.anchorFlag=e,!0):(this.hasMatch=!1,!1)}substring(t,e){return this.matcherInput.isUTF8Encoding()?AB.utf8ByteArrayToString(this.matcherInput.asBytes().slice(t,e)):this.matcherInput.asCharSequence().substring(t,e).toString()}inputLength(){return this.matcherInputLength}appendReplacement(t,e=!1){let n="";const s=this.start(),r=this.end();return this.appendPos<s&&(n+=this.substring(this.appendPos,s)),this.appendPos=r,n+=e?this.appendReplacementInternalJava(t):this.appendReplacementInternalJs(t),n}appendReplacementInternalJava(t){let e="",n=0;const s=t.length;let r=0;for(;r<s;){const i=t.codePointAt(r);if(i!==mB.CODES["\\"]){if(i===mB.CODES.$){if(n<r&&(e+=t.substring(n,r)),r+1>=s)throw new VB("Illegal group reference: group index is missing");const i=t.codePointAt(r+1);if(mB.CODES[0]<=i&&i<=mB.CODES[9]){let o=i-mB.CODES[0],a=r+2;for(;a<s;a++){const e=t.codePointAt(a);if(e<mB.CODES[0]||e>mB.CODES[9]||10*o+e-mB.CODES[0]>this.patternGroupCount)break;o=10*o+e-mB.CODES[0]}if(o>this.patternGroupCount)throw new VB(`n > number of groups: ${o}`);const B=this.group(o);null!==B&&(e+=B),r=a,n=r}else{if(i!==mB.CODES["{"])throw new VB("Illegal group reference");{let i=r+2;for(;i<s&&t.codePointAt(i)!==mB.CODES["}"];)i++;if(i>=s)throw new VB("named capture group is missing trailing '}'");const o=t.substring(r+2,i),a=this.group(o);null!==a&&(e+=a),r=i+1,n=r}}continue}r++}else{if(n<r&&(e+=t.substring(n,r)),r++,r>=s)throw new VB("character to be escaped is missing");n=r,r++}}return n<s&&(e+=t.substring(n,s)),e}appendReplacementInternalJs(t){const e=t=>t>=48&&t<=57,n=this.patternGroupCount;let s="",r=0;for(;r<t.length;){const i=t.indexOf("$",r);if(i<0)break;s+=t.substring(r,i),r=i;const o=t.charCodeAt(r+1);if(o===mB.CODES.$)s+="$",r+=2;else if(o===mB.CODES["&"])s+=this.group(0),r+=2;else if(o===mB.CODES["`"])s+=this.substring(0,this.start(0)),r+=2;else if(o===mB.CODES["'"])s+=this.substring(this.end(0),this.matcherInputLength),r+=2;else if(e(o)){let i=1,a=o-48;const B=t.charCodeAt(r+2);if(e(B)&&10*a+B-48<=n&&(i=2,a=10*a+B-48),a>=1&&a<=n){const t=this.group(a);null!==t&&(s+=t)}else s+=t.substring(r,r+1+i);r+=1+i}else if(o===mB.CODES["<"]&&this.hasNamedGroups){const e=t.indexOf(">",r+2);if(e<0)s+="$<",r+=2;else{const n=t.substring(r+2,e);if(Object.prototype.hasOwnProperty.call(this.namedGroups,n)){const t=this.group(n);null!==t&&(s+=t)}r=e+1}}else s+="$",r+=1}return s+t.substring(r)}appendTail(){return this.substring(this.appendPos,this.matcherInputLength)}replaceAll(t,e=!1){return this.replace(t,!0,e)}replaceFirst(t,e=!1){return this.replace(t,!1,e)}replace(e,n=!0,s=!1){let r="";this.reset();const i="function"==typeof e;let o=null;if(i){if(this.groupCount()>=t.MAX_REPLACER_ARGS)throw new VB("Too many capture groups to safely invoke replacer function");o=this.matcherInput.isUTF8Encoding()?this.matcherInput.asBytes():this.matcherInput.asCharSequence()}for(;this.find()&&(r+=i?this.appendReplacementFunc(e,o):this.appendReplacement(e,s),n););return r+=this.appendTail(),r}appendReplacementFunc(t,e){let n="";const s=this.start(),r=this.end();this.appendPos<s&&(n+=this.substring(this.appendPos,s)),this.appendPos=r;const i=this.matchArray();return i.push(s,e),this.hasNamedGroups&&i.push(this.namedGroupsObject()),n+=String(t(...i)),n}matchArray(){const t=[this.group(0)];for(let e=1;e<=this.patternGroupCount;e++){const n=this.group(e);t.push(null===n?void 0:n)}return t}namedGroupsObject(){if(!this.hasNamedGroups)return;const t=this.getNamedGroups();for(const e in t)null===t[e]&&(t[e]=void 0);return t}},qB=class t{static ALT=1;static ALT_MATCH=2;static CAPTURE=3;static EMPTY_WIDTH=4;static FAIL=5;static MATCH=6;static NOP=7;static RUNE=8;static RUNE1=9;static RUNE_ANY=10;static RUNE_ANY_NOT_NL=11;static LB_WRITE=12;static LB_CHECK=13;static isRuneOp(e){return t.RUNE<=e&&e<=t.RUNE_ANY_NOT_NL}static escapeRunes(t){let e='"';for(let n of t)e+=AB.escapeRune(n);return e+='"',e}constructor(t){this.op=t,this.out=0,this.arg=0,this.runes=new Int32Array(0),this.next=null}matchRune(t){if(1===this.runes.length){const e=this.runes[0];return 0!==(this.arg&aB.FOLD_CASE)?vB.equalsIgnoreCase(e,t):t===e}const e=this.runes.length;if(0===e)return!1;if(2===e||4===e||6===e||8===e){for(let n=0;n<e;n+=2){if(t<this.runes[n])return!1;if(t<=this.runes[n+1])return!0}return!1}let n=0,s=e>>1;for(;s>1;){const e=s>>1;n+=this.runes[n+e<<1]<=t?e:0,s-=e}n+=this.runes[n<<1]<=t?1:0;const r=n-1;return r>=0&&t<=this.runes[r<<1|1]}matchRunePos(t){if(1===this.runes.length){const e=this.runes[0];return 0!==(this.arg&aB.FOLD_CASE)?vB.equalsIgnoreCase(e,t)?0:-1:t===e?0:-1}const e=this.runes.length;if(0===e)return-1;if(2===e||4===e||6===e||8===e){for(let n=0;n<e;n+=2){if(t<this.runes[n])return-1;if(t<=this.runes[n+1])return Math.floor(n/2)}return-1}let n=0,s=e>>1;for(;s>1;){const e=s>>1;n+=this.runes[n+e<<1]<=t?e:0,s-=e}n+=this.runes[n<<1]<=t?1:0;const r=n-1;return r>=0&&t<=this.runes[r<<1|1]?r:-1}toString(){switch(this.op){case t.ALT:return`alt -> ${this.out}, ${this.arg}`;case t.ALT_MATCH:return`altmatch -> ${this.out}, ${this.arg}`;case t.CAPTURE:return`cap ${this.arg} -> ${this.out}`;case t.EMPTY_WIDTH:return`empty ${this.arg} -> ${this.out}`;case t.MATCH:return"match"+(0!==this.arg?` ${this.arg}`:"");case t.FAIL:return"fail";case t.NOP:return`nop -> ${this.out}`;case t.LB_WRITE:return`lbwrite ${this.arg} -> ${this.out}`;case t.LB_CHECK:return`lbcheck ${this.arg} -> ${this.out}`;case t.RUNE:return null===this.runes?"rune <null>":["rune ",t.escapeRunes(this.runes),0!==(this.arg&aB.FOLD_CASE)?"/i":""," -> ",this.out].join("");case t.RUNE1:return`rune1 ${t.escapeRunes(this.runes)} -> ${this.out}`;case t.RUNE_ANY:return`any -> ${this.out}`;case t.RUNE_ANY_NOT_NL:return`anynotnl -> ${this.out}`;default:throw new Error("unhandled case in Inst.toString")}}},zB=class t{constructor(t){this.sparse=new Int32Array(t),this.densePcs=new Int32Array(t),this.denseCaps=null,this.size=0,this.ncap=0,this.mainThreads=0}static INITIAL_THREADS=32;init(e){this.ncap=e;const n=Math.min(this.densePcs.length,t.INITIAL_THREADS)*e;(!this.denseCaps||this.denseCaps.length<n)&&(this.denseCaps=new Int32Array(n))}growCaps(t){const e=this.densePcs.length*this.ncap,n=new Int32Array(Math.min(e,Math.max(t,2*this.denseCaps.length)));n.set(this.denseCaps),this.denseCaps=n}contains(t){const e=this.sparse[t];return e<this.size&&this.densePcs[e]===t}isEmpty(){return 0===this.size}add(t){const e=this.size++;return this.sparse[t]=e,this.densePcs[e]=t,e}clear(){this.size=0,this.mainThreads=0}toString(){let t="{";for(let e=0;e<this.size;e++)0!==e&&(t+=", "),t+=this.densePcs[e];return t+="}",t}},KB=class{constructor(t){this.pos=-1,this.pcs=new Int32Array(t.numInst()),this.size=0,this.lbTable=new Int32Array(t.numLb+1)}reset(){this.pos=-1,this.size=0}},QB=class t{static fromRE2(e){const n=new t;return n.prog=e.prog,n.re2=e,n.q0=new zB(n.prog.numInst()),n.q1=new zB(n.prog.numInst()),n.addStack=new Int32Array(2*(n.prog.numInst()+1)),n.matched=!1,n.matchcap=new Int32Array(n.prog.numCap<2?2:n.prog.numCap),n.ncap=0,n}constructor(){this.prog=null,this.re2=null,this.q0=null,this.q1=null,this.addStack=null,this.matched=!1,this.matchcap=null,this.ncap=0,this.lbTable=null}init(t){this.ncap=t,t>this.matchcap.length?this.matchcap=new Int32Array(t).fill(-1):this.matchcap.fill(-1),this.q0.init(t),this.q1.init(t),this.prog.numLb>0&&((!this.lbTable||this.lbTable.length<this.prog.numLb+1)&&(this.lbTable=new Int32Array(this.prog.numLb+1)),this.lbTable.fill(-1))}submatches(){return 0===this.ncap?AB.emptyInts():AB.toArray(this.matchcap.subarray(0,this.ncap))}match(t,e,n,s=null){const r=this.re2.cond;if(r===AB.EMPTY_ALL)return!1;if((n===aB.ANCHOR_START||n===aB.ANCHOR_BOTH)&&0!==e)return!1;this.matched=!1,this.matchcap.fill(-1);const i=this.prog.numLb>0,o=e;let a=e,B=!1;i&&(null!==s&&s.pos>=0&&s.pos<=e?(a=s.pos,B=!0):a=0);let c,l=i&&null!==s,u=this.q0,h=this.q1,d=t.step(a),p=d>>3,f=7&d,C=-1,g=0;for(d!==LB.EOF()&&(d=t.step(a+f),C=d>>3,g=7&d),c=0===a?AB.emptyOpContext(-1,p):t.context(a),i&&(B?this.restoreLookbehinds(s,u,c):this.spawnLookbehinds(u,a,c));;){if(0===u.mainThreads){if(0!==(r&AB.EMPTY_BEGIN_TEXT)&&0!==a)break;if((n===aB.ANCHOR_START||n===aB.ANCHOR_BOTH)&&0!==a)break;if(this.matched)break;if(0===this.prog.numLb&&u.isEmpty()&&0!==this.re2.prefix.length&&C!==this.re2.prefixRune&&t.canCheckPrefix()){const e=t.index(this.re2,a);if(e<0)break;a+=e,d=t.step(a),p=d>>3,f=7&d,d=t.step(a+f),C=d>>3,g=7&d,c=t.context(a)}}a>=o&&(l&&(this.saveLookbehinds(s,u,a),l=!1),this.matched||0!==a&&n!==aB.UNANCHORED||(this.ncap>0&&(this.matchcap[0]=a),this.add(u,this.prog.start,a,this.matchcap,0,c)));const e=a+f;if(c=t.context(e),this.step(u,h,a,e,p,c,n,a===t.endPos()),0===f)break;if(0===this.ncap&&this.matched)break;a+=f,p=C,f=g,-1!==p&&(d=t.step(a+f),C=d>>3,g=7&d);const i=u;u=h,h=i}return u.clear(),h.clear(),this.matched}matchSet(t,e,n){const s=this.re2.cond;if(s===AB.EMPTY_ALL)return[];if((n===aB.ANCHOR_START||n===aB.ANCHOR_BOTH)&&0!==e)return[];let r=this.prog.numLb>0?0:e,i=e,o=this.q0,a=this.q1,B=t.step(r),c=B>>3,l=7&B,u=-1,h=0;B!==LB.EOF()&&(B=t.step(r+l),u=B>>3,h=7&B);let d=0===r?AB.emptyOpContext(-1,c):t.context(r);const p=new Set;for(this.prog.numLb>0&&this.spawnLookbehinds(o,r,d);;){if(0===o.mainThreads){if(0!==(s&AB.EMPTY_BEGIN_TEXT)&&0!==r)break;if((n===aB.ANCHOR_START||n===aB.ANCHOR_BOTH)&&0!==r)break}0!==r&&n!==aB.UNANCHORED||r>=i&&this.add(o,this.prog.start,r,this.matchcap,0,d);const e=r+l;d=t.context(e);for(let s=0;s<o.size;s++){const i=o.densePcs[s],B=this.prog.inst[i],l=s*this.ncap;let u=!1;switch(B.op){case qB.MATCH:if(n===aB.ANCHOR_BOTH&&r!==t.endPos())break;p.add(B.arg);break;case qB.RUNE:u=B.matchRune(c);break;case qB.RUNE1:u=c===B.runes[0];break;case qB.RUNE_ANY:u=!0;break;case qB.RUNE_ANY_NOT_NL:u=10!==c;break;default:continue}u&&this.add(a,B.out,e,o.denseCaps,l,d)}if(o.clear(),0===l)break;r+=l,c=u,l=h,-1!==c&&(B=t.step(r+l),u=B>>3,h=7&B);const f=o;o=a,a=f}return a.clear(),Array.from(p).sort((t,e)=>t-e)}step(t,e,n,s,r,i,o,a){const B=this.re2.longest;for(let c=0;c<t.size;c++){const l=t.densePcs[c],u=c*this.ncap;if(B&&this.matched&&this.ncap>0&&this.matchcap[0]<t.denseCaps[u])continue;const h=this.prog.inst[l];let d=!1;switch(h.op){case qB.MATCH:if(o===aB.ANCHOR_BOTH&&!a)break;if(this.ncap>0&&(!B||!this.matched||this.matchcap[1]<n)){t.denseCaps[u+1]=n;for(let e=0;e<this.ncap;e++)this.matchcap[e]=t.denseCaps[u+e]}B||(t.size=0),this.matched=!0;break;case qB.RUNE:d=h.matchRune(r);break;case qB.RUNE1:d=r===h.runes[0];break;case qB.RUNE_ANY:d=!0;break;case qB.RUNE_ANY_NOT_NL:d=10!==r;break;default:continue}d&&this.add(e,h.out,s,t.denseCaps,u,i)}t.clear()}spawnLookbehinds(t,e,n){for(let s=0;s<this.prog.lbStarts.length;s++)this.add(t,this.prog.lbStarts[s],e,this.matchcap,0,n)}restoreLookbehinds(t,e,n){this.lbTable.set(t.lbTable);for(let s=0;s<t.size;s++)this.add(e,t.pcs[s],t.pos,this.matchcap,0,n)}saveLookbehinds(t,e,n){let s=0;for(let n=0;n<e.size;n++){const r=e.densePcs[n];1===this.prog.lbInst[r]&&qB.isRuneOp(this.prog.inst[r].op)&&(t.pcs[s++]=r)}t.size=s,t.pos=n,t.lbTable.set(this.lbTable)}add(t,e,n,s,r,i){const o=this.addStack;let a=0;for(;;){for(;0!==e&&!t.contains(e);){const B=t.add(e),c=this.prog.inst[e];switch(c.op){case qB.FAIL:e=0;break;case qB.ALT:case qB.ALT_MATCH:o[a++]=c.arg,o[a++]=0,e=c.out;break;case qB.EMPTY_WIDTH:e=0===(c.arg&~i)?c.out:0;break;case qB.NOP:e=c.out;break;case qB.CAPTURE:c.arg<this.ncap&&(o[a++]=-c.arg-1,o[a++]=s[r+c.arg],s[r+c.arg]=n),e=c.out;break;case qB.LB_WRITE:this.lbTable[Math.abs(c.arg)]=n,e=c.out;break;case qB.LB_CHECK:e=c.arg>0?this.lbTable[c.arg]===n?c.out:0:this.lbTable[-c.arg]!==n?c.out:0;break;case qB.MATCH:case qB.RUNE:case qB.RUNE1:case qB.RUNE_ANY:case qB.RUNE_ANY_NOT_NL:if(0===this.prog.lbInst[e]&&t.mainThreads++,this.ncap>0){const e=B*this.ncap;e+this.ncap>t.denseCaps.length&&t.growCaps(e+this.ncap);for(let n=0;n<this.ncap;n++)t.denseCaps[e+n]=s[r+n]}e=0;break;default:throw new $B("unhandled")}}if(0===a)return;a-=2;const B=o[a];B<0?(s[r-B-1]=o[a+1],e=0):e=B}}};const WB=(t,e)=>{if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0},YB=(t,e,n,s)=>t.flag===n&&WB(t.nfaStates,e)&&WB(t.matchIDs,s),XB=[];var ZB=class{constructor(t,e,n){this.nfaStates=t,this.flag=e,this.isMatch=0!==(e&tc.FLAG_MATCH),this.matchIDs=n,this.next=null,this.nextAnchored=null}},tc=class t{static FLAG_EMPTY_MASK=255;static FLAG_MATCH=256;static FLAG_LAST_WORD=512;static FLAG_NEED_SHIFT=16;static STATE_OVERHEAD=150;static ARRAY_OVERHEAD=40;static ELEMENT_SIZE=8;static TABLE_OVERHEAD=48;static PROGRESS_PER_STATE=10;constructor(t,e=8388608){this.prog=t,this.maxMem=e,this.stateCache=new Map,this.stateCount=0,this.startStates=new Map,this.failed=!1;for(let e=0;e<t.numInst();e++){const n=t.getInst(e).op;if(n===qB.LB_WRITE||n===qB.LB_CHECK){this.failed=!0;break}}this.computeRuneClasses(),this.stateBudget=e,this.memBudget=e}computeRuneClasses(){const t=new Set,e=(e,n)=>{t.add(e),t.add(n+1)};for(let t=0;t<this.prog.numInst();t++){const n=this.prog.getInst(t);switch(n.op){case qB.RUNE:case qB.RUNE1:if(1===n.runes.length){if(e(n.runes[0],n.runes[0]),0!==(n.arg&aB.FOLD_CASE))for(let t=vB.simpleFold(n.runes[0]);t!==n.runes[0];t=vB.simpleFold(t))e(t,t)}else for(let t=0;t<n.runes.length;t+=2)e(n.runes[t],n.runes[t+1]);break;case qB.RUNE_ANY_NOT_NL:e(10,10);break;case qB.EMPTY_WIDTH:0!==(n.arg&(AB.EMPTY_BEGIN_LINE|AB.EMPTY_END_LINE))&&e(10,10),0!==(n.arg&(AB.EMPTY_WORD_BOUNDARY|AB.EMPTY_NO_WORD_BOUNDARY))&&(e(48,57),e(65,90),e(95,95),e(97,122))}}t.delete(0),this.classBounds=Int32Array.from(t).sort(),this.numClasses=this.classBounds.length+1;const n=new Int32Array(vB.MAX_LATIN1+1);for(let t=0;t<=vB.MAX_LATIN1;t++)n[t]=this.searchClass(t);this.latin1Class=n}runeClass(t){return t<=vB.MAX_LATIN1?this.latin1Class[t]:this.searchClass(t)}searchClass(t){const e=this.classBounds;let n=0,s=e.length;for(;n<s;){const r=n+s>>1;e[r]<=t?n=r+1:s=r}return n}closure(t,e){const n=new Set,s=Array.from(t);let r=0;for(;s.length>0;){const t=s.pop();if(0===t||n.has(t))continue;n.add(t);const i=this.prog.getInst(t);switch(i.op){case qB.ALT:case qB.ALT_MATCH:s.push(i.out),s.push(i.arg);break;case qB.NOP:case qB.CAPTURE:s.push(i.out);break;case qB.EMPTY_WIDTH:r|=i.arg,0===(i.arg&~e)&&s.push(i.out)}}return{pcs:Array.from(n).sort((t,e)=>t-e),needflags:r}}getState(e,n,s){const r=((t,e,n)=>{let s=-2128831035;for(let e=0;e<t.length;e++)s^=t[e],s=Math.imul(s,16777619);s^=e,s=Math.imul(s,16777619);for(let t=0;t<n.length;t++)s^=n[t],s=Math.imul(s,16777619);return s})(e,n,s),i=this.stateCache.get(r);if(i instanceof ZB){if(YB(i,e,n,s))return i}else if(void 0!==i)for(let t=0;t<i.length;t++)if(YB(i[t],e,n,s))return i[t];const o=t.stateCost(e,s);if(this.memBudget<o)return null;this.memBudget-=o;const a=new ZB(e,n,s);return void 0===i?this.stateCache.set(r,a):i instanceof ZB?this.stateCache.set(r,[i,a]):i.push(a),this.stateCount++,a}static stateCost(e,n){const s=0===n.length?0:t.ARRAY_OVERHEAD+t.ELEMENT_SIZE*n.length;return t.STATE_OVERHEAD+t.ELEMENT_SIZE*e.length+s}*cachedStates(){for(const t of this.stateCache.values())t instanceof ZB?yield t:yield*t}makeState(e,n,s){const r=this.closure(e,n&t.FLAG_EMPTY_MASK);let i=n;return 0===r.needflags&&(i&=t.FLAG_MATCH),i|=r.needflags<<t.FLAG_NEED_SHIFT,this.getState(r.pcs,i,s)}allocTable(e,n){const s=this.numClasses+1,r=t.TABLE_OVERHEAD+t.ELEMENT_SIZE*s;if(this.memBudget<r)return null;this.memBudget-=r;const i=new Array(s).fill(null);return n===aB.UNANCHORED?e.next=i:e.nextAnchored=i,i}clearCache(){this.stateCache.clear(),this.stateCount=0,this.startStates.clear(),this.memBudget=this.stateBudget}resetCache(t){return this.clearCache(),this.getState(t.nfaStates,t.flag,t.matchIDs)}step(e,n,s,r){let i=r===aB.UNANCHORED?e.next:e.nextAnchored;if(null!==i){const t=i[n];if(null!==t)return t}else if(i=this.allocTable(e,r),null===i)return null;const o=e.flag>>>t.FLAG_NEED_SHIFT,a=e.flag&t.FLAG_EMPTY_MASK;let B=a,c=0;10===s&&(B|=AB.EMPTY_END_LINE,c|=AB.EMPTY_BEGIN_LINE),-1===s&&(B|=AB.EMPTY_END_LINE|AB.EMPTY_END_TEXT);const l=0!==(e.flag&t.FLAG_LAST_WORD),u=-1!==s&&AB.isWordRune(s);B|=u===l?AB.EMPTY_NO_WORD_BOUNDARY:AB.EMPTY_WORD_BOUNDARY;let h=e.nfaStates;0!==(B&~a&o)&&(h=this.closure(h,B).pcs);const d=[];let p=!1,f=XB;for(let t=0;t<h.length;t++){const e=this.prog.getInst(h[t]);e.op===qB.MATCH?(p||(p=!0,f=[]),f.push(e.arg)):-1!==s&&qB.isRuneOp(e.op)&&e.matchRune(s)&&d.push(e.out)}f.length>1&&f.sort((t,e)=>t-e),r===aB.UNANCHORED&&-1!==s&&d.push(this.prog.start);let C=c;p&&(C|=t.FLAG_MATCH),u&&(C|=t.FLAG_LAST_WORD);const g=this.makeState(d,C,f);return null===g?null:(i[n]=g,g)}start(e,n){const s=e.context(n);let r;if(0!==(s&AB.EMPTY_BEGIN_TEXT))r=AB.EMPTY_BEGIN_TEXT|AB.EMPTY_BEGIN_LINE;else if(0!==(s&AB.EMPTY_BEGIN_LINE))r=AB.EMPTY_BEGIN_LINE;else{const i=e.step(n),o=i>=0&&AB.isWordRune(i>>3);r=0!==(s&AB.EMPTY_WORD_BOUNDARY)!==o?t.FLAG_LAST_WORD:0}let i=this.startStates.get(r);if(void 0===i){if(i=this.makeState([this.prog.start],r,XB),null===i&&(this.clearCache(),i=this.makeState([this.prog.start],r,XB),null===i))return null;this.startStates.set(r,i)}return i}stepOrReset(e,n,s,r,i,o){let a=this.step(e,n,s,r);if(null!==a)return a;if(o.resetPos>=0&&i-o.resetPos<t.PROGRESS_PER_STATE*this.stateCount)return null;o.resetPos=i;const B=this.resetCache(e);return null===B?null:(a=this.step(B,n,s,r),a)}run(t,e,n,s,r){const i=t.endPos(),o=this.latin1Class,a=n===aB.UNANCHORED,B={resetPos:-1};let c=e;for(;c<i;){const e=t.step(c),i=e>>3,l=7&e;if(0===l)break;const u=i<=vB.MAX_LATIN1?o[i]:this.runeClass(i);let h=a&&null!==s.next?s.next[u]:null;if(null===h&&(h=this.stepOrReset(s,u,i,n,c,B),null===h))return null;if((s=h).isMatch&&r(s,!1))return!0;if(!a&&0===s.nfaStates.length)return!1;c+=l}return null===(s=this.stepOrReset(s,this.numClasses,-1,n,c,B))?null:s.isMatch&&r(s,!0)}match(t,e,n){if(this.failed)return null;if((n===aB.ANCHOR_START||n===aB.ANCHOR_BOTH)&&0!==e)return!1;const s=this.start(t,e);return null===s?null:this.run(t,e,n,s,(t,e)=>n!==aB.ANCHOR_BOTH||e)}matchSet(t,e,n){if(this.failed)return null;if((n===aB.ANCHOR_START||n===aB.ANCHOR_BOTH)&&0!==e)return[];const s=this.start(t,e);if(null===s)return null;const r=new Set;return null===this.run(t,e,n,s,(t,e)=>{if(n!==aB.ANCHOR_BOTH||e)for(let e=0;e<t.matchIDs.length;e++)r.add(t.matchIDs[e]);return!1})?null:Array.from(r).sort((t,e)=>t-e)}};var ec=class{constructor(){this.end=0,this.cap=new Int32Array(0),this.matchcap=new Int32Array(0),this.ncap=0,this.jobPc=new Int32Array(256),this.jobArg=new Uint8Array(256),this.jobPos=new Int32Array(256),this.jobLen=0,this.visited=new Uint32Array(0)}reset(t,e,n){this.end=e,this.jobLen=0,this.ncap=n;const s=t.numInst()*(e+1)+32-1>>>5;this.visited.length<s?this.visited=new Uint32Array(s):this.visited.fill(0,0,s),this.cap.length<n?this.cap=new Int32Array(n).fill(-1):this.cap.fill(-1,0,n),this.matchcap.length<n?this.matchcap=new Int32Array(n).fill(-1):this.matchcap.fill(-1,0,n)}shouldVisit(t,e){const n=t*(this.end+1)+e,s=n>>>5,r=1<<(31&n);return 0===(this.visited[s]&r)&&(this.visited[s]|=r,!0)}push(t,e,n,s){if(t.prog.getInst(e).op!==qB.FAIL&&(s||this.shouldVisit(e,n))){if(this.jobLen>=this.jobPc.length){const t=2*this.jobPc.length,e=new Int32Array(t);e.set(this.jobPc),this.jobPc=e;const n=new Uint8Array(t);n.set(this.jobArg),this.jobArg=n;const s=new Int32Array(t);s.set(this.jobPos),this.jobPos=s}this.jobPc[this.jobLen]=e,this.jobArg[this.jobLen]=s?1:0,this.jobPos[this.jobLen]=n,this.jobLen++}}tryBacktrack(t,e,n,s,r){const i=t.longest;for(this.push(t,n,s,!1);this.jobLen>0;){this.jobLen--;let n=this.jobPc[this.jobLen],s=1===this.jobArg[this.jobLen],o=this.jobPos[this.jobLen],a=!0;for(;a||this.shouldVisit(n,o);){a=!1;const B=t.prog.getInst(n);switch(B.op){case qB.FAIL:break;case qB.ALT:if(s){s=!1,n=B.arg;continue}this.push(t,n,o,!0),n=B.out;continue;case qB.ALT_MATCH:{const e=t.prog.getInst(B.out);if(qB.isRuneOp(e.op)){this.push(t,B.arg,o,!1),n=B.arg,o=this.end;continue}this.push(t,B.out,this.end,!1),n=B.out;continue}case qB.RUNE:{const t=e.step(o);if(t===LB.EOF())break;if(!B.matchRune(t>>3))break;o+=7&t,n=B.out;continue}case qB.RUNE1:{const t=e.step(o);if(t===LB.EOF())break;if(t>>3!==B.runes[0])break;o+=7&t,n=B.out;continue}case qB.RUNE_ANY_NOT_NL:{const t=e.step(o);if(t===LB.EOF())break;if(t>>3==10)break;o+=7&t,n=B.out;continue}case qB.RUNE_ANY:{const t=e.step(o);if(t===LB.EOF())break;o+=7&t,n=B.out;continue}case qB.CAPTURE:if(s){this.cap[B.arg]=o;break}B.arg<this.ncap&&(this.push(t,n,this.cap[B.arg],!0),this.cap[B.arg]=o),n=B.out;continue;case qB.EMPTY_WIDTH:{const t=e.context(o);if(0!==(B.arg&~t))break;n=B.out;continue}case qB.NOP:n=B.out;continue;case qB.MATCH:{if(r===aB.ANCHOR_BOTH&&o!==this.end)break;if(0===this.ncap)return!0;this.ncap>1&&(this.cap[1]=o);const t=this.matchcap[1];if((-1===t||i&&o>0&&o>t)&&this.matchcap.set(this.cap),!i)return!0;if(o===this.end)return!0;break}case qB.LB_WRITE:case qB.LB_CHECK:throw new $B("Backtracker cannot evaluate Lookbehind instructions");default:throw new $B("bad inst")}break}}return i&&this.matchcap.length>1&&this.matchcap[1]>=0}};const nc=[];var sc=class t{static shouldBacktrack(t){return t.numInst()<=500}static maxBitStateLen(e){return t.shouldBacktrack(e)?Math.floor(262144/e.numInst()):0}static execute(t,e,n,s,r){const i=t.cond;if(i===AB.EMPTY_ALL)return null;if((s===aB.ANCHOR_START||s===aB.ANCHOR_BOTH)&&0!==n)return null;if(0!==(i&AB.EMPTY_BEGIN_TEXT)&&0!==n)return null;const o=nc.length>0?nc.pop():new ec,a=e.endPos();o.reset(t.prog,a,r);let B=!1;if(0!==(i&AB.EMPTY_BEGIN_TEXT)||s===aB.ANCHOR_START||s===aB.ANCHOR_BOTH)o.ncap>0&&(o.cap[0]=n),o.tryBacktrack(t,e,t.prog.start,n,s)&&(B=!0);else{let r=-1;for(;n<=a&&0!==r;n+=r){if(t.prefix.length>0){const s=e.index(t,n);if(s<0)break;n+=s}if(o.ncap>0&&(o.cap[0]=n),o.tryBacktrack(t,e,t.prog.start,n,s)){B=!0;break}const i=e.step(n);r=i===LB.EOF()?0:7&i}}if(!B)return nc.push(o),null;const c=0===r?[]:AB.toArray(o.matchcap.subarray(0,r));return nc.push(o),c}},rc=class{constructor(t){this.sparse=new Uint32Array(t),this.dense=new Uint32Array(t),this.size=0,this.nextIndex=0}empty(){return this.nextIndex>=this.size}next(){return this.dense[this.nextIndex++]}clear(){this.size=0,this.nextIndex=0}contains(t){return t<this.sparse.length&&this.sparse[t]<this.size&&this.dense[this.sparse[t]]===t}insert(t){this.contains(t)||this.insertNew(t)}insertNew(t){t>=this.sparse.length||(this.sparse[t]=this.size,this.dense[this.size]=t,this.size++)}};var ic=class{constructor(t){this.start=t.start,this.numCap=t.numCap,this.inst=new Array(t.inst.length);for(let e=0;e<t.inst.length;e++){const n=t.inst[e],s=new qB(n.op);s.out=n.out,s.arg=n.arg,s.runes=n.runes?new Int32Array(n.runes):new Int32Array(0),s.next=null,this.inst[e]=s}}};var oc=class t{static compile(t){if(0===t.start)return null;if(t.numLb>0)return null;const e=t.inst[t.start];if(e.op!==qB.EMPTY_WIDTH||0===(e.arg&AB.EMPTY_BEGIN_TEXT))return null;let n=!1;for(let e=0;e<t.inst.length;e++)if(t.inst[e].op===qB.ALT||t.inst[e].op===qB.ALT_MATCH){n=!0;break}for(let e=0;e<t.inst.length;e++){const s=t.inst[e],r=t.inst[s.out].op;switch(s.op){case qB.ALT:case qB.ALT_MATCH:if(r===qB.MATCH||t.inst[s.arg].op===qB.MATCH)return null;break;case qB.EMPTY_WIDTH:if(r===qB.MATCH){if((s.arg&AB.EMPTY_END_TEXT)===AB.EMPTY_END_TEXT)continue;return null}break;default:if(r===qB.MATCH&&n)return null}}let s=(t=>{const e=new ic(t);for(let t=0;t<e.inst.length;t++){const n=e.inst[t];if(n.op!==qB.ALT&&n.op!==qB.ALT_MATCH)continue;let s="out",r="arg",i=e.inst[n[r]];if(i.op!==qB.ALT&&i.op!==qB.ALT_MATCH&&(s="arg",r="out",i=e.inst[n[r]],i.op!==qB.ALT&&i.op!==qB.ALT_MATCH))continue;const o=e.inst[n[s]];if(o.op===qB.ALT||o.op===qB.ALT_MATCH)continue;let a="out",B="arg",c=!1;i.out===t?c=!0:i.arg===t&&(c=!0,a="arg",B="out"),c&&(i[a]=n[s]),n[s]===i[a]&&(n[r]=i[B])}return e})(t);return s=(t=>{if(t.inst.length>=1e3)return null;const e=new rc(t.inst.length),n=new rc(t.inst.length),s=new Array(t.inst.length),r=new Array(t.inst.length).fill(!1),i=o=>{let a=!0;const B=t.inst[o];if(n.contains(o))return!0;switch(n.insert(o),B.op){case qB.ALT:case qB.ALT_MATCH:{a=i(B.out)&&i(B.arg);let t=r[B.out],e=r[B.arg];if(t&&e)return!1;if(e){const n=B.out;B.out=B.arg,B.arg=n;const s=t;t=e,e=s}t&&(r[o]=!0,B.op=qB.ALT_MATCH);const n=((t,e,n,s)=>{const r=t.length,i=e.length;let o=0,a=0;const B=[],c=[];let l=!0,u=-1;const h=r=>{const i=r?t:e,l=r?o:a,h=r?n:s;return!(u>0&&i[l]<=B[u]||(B.push(i[l],i[l+1]),r?o+=2:a+=2,u+=2,c.push(h),0))};for(;o<r||a<i;)if(l=a>=i?h(!0):o>=r||e[a]<t[o]?h(!1):h(!0),!l)return null;return{merged:B,next:c}})(s[B.out]||[],s[B.arg]||[],B.out,B.arg);if(!n)return!1;s[o]=new Int32Array(n.merged),B.next=new Uint32Array(n.next);break}case qB.CAPTURE:case qB.EMPTY_WIDTH:case qB.NOP:a=i(B.out),r[o]=r[B.out],s[o]=s[B.out]?new Int32Array(s[B.out]):new Int32Array(0),B.next=new Uint32Array(Math.floor(s[o].length/2)+1).fill(B.out);break;case qB.MATCH:case qB.FAIL:r[o]=B.op===qB.MATCH;break;case qB.RUNE:{if(r[o]=!1,B.next&&B.next.length>0)break;if(e.insert(B.out),!B.runes||0===B.runes.length){s[o]=new Int32Array(0),B.next=new Uint32Array([B.out]);break}let t=[];if(1===B.runes.length&&0!==(B.arg&aB.FOLD_CASE)){const e=B.runes[0];t.push(e,e);for(let n=vB.simpleFold(e);n!==e;n=vB.simpleFold(n))t.push(n,n);t.sort((t,e)=>t-e)}else for(let e=0;e<B.runes.length;e++)t.push(B.runes[e]);s[o]=new Int32Array(t),B.next=new Uint32Array(Math.floor(t.length/2)+1).fill(B.out),B.op=qB.RUNE;break}case qB.RUNE1:{if(r[o]=!1,B.next&&B.next.length>0)break;e.insert(B.out);let t=[];if(0!==(B.arg&aB.FOLD_CASE)){const e=B.runes[0];t.push(e,e);for(let n=vB.simpleFold(e);n!==e;n=vB.simpleFold(n))t.push(n,n);t.sort((t,e)=>t-e)}else t.push(B.runes[0],B.runes[0]);s[o]=new Int32Array(t),B.next=new Uint32Array(Math.floor(t.length/2)+1).fill(B.out),B.op=qB.RUNE;break}case qB.RUNE_ANY:if(r[o]=!1,B.next&&B.next.length>0)break;e.insert(B.out),s[o]=new Int32Array([0,vB.MAX_RUNE]),B.next=new Uint32Array([B.out]);break;case qB.RUNE_ANY_NOT_NL:if(r[o]=!1,B.next&&B.next.length>0)break;e.insert(B.out),s[o]=new Int32Array([0,9,11,vB.MAX_RUNE]),B.next=new Uint32Array(Math.floor(s[o].length/2)+1).fill(B.out)}return a};for(e.clear(),e.insert(t.start);!e.empty();)if(n.clear(),!i(e.next()))return null;for(let e=0;e<t.inst.length;e++)s[e]&&(t.inst[e].runes=s[e]);return t})(s),null!==s&&((t,e)=>{for(let n=0;n<e.inst.length;n++){const s=e.inst[n];switch(s.op){case qB.ALT:case qB.ALT_MATCH:case qB.RUNE:break;case qB.CAPTURE:case qB.EMPTY_WIDTH:case qB.NOP:case qB.MATCH:case qB.FAIL:t.inst[n].next=null;break;case qB.RUNE1:case qB.RUNE_ANY:case qB.RUNE_ANY_NOT_NL:t.inst[n].next=null,t.inst[n].op=s.op,t.inst[n].runes=s.runes?new Int32Array(s.runes):new Int32Array(0)}}})(s,t),s}static next(t,e){const n=t.matchRunePos(e);return n>=0?t.next[n]:t.op===qB.ALT_MATCH?t.out:0}static execute(e,n,s,r,i){const o=e.onepass;if(!o)return null;const a=new Int32Array(i).fill(-1);let B=!1,c=n.step(s),l=c>>3,u=7&c,h=LB.EOF(),d=-1,p=0;c!==LB.EOF()&&(h=n.step(s+u),h!==LB.EOF()&&(d=h>>3,p=7&h));let f,C=0===s?AB.emptyOpContext(-1,l):n.context(s),g=o.start;for(;;){switch(f=o.inst[g],g=f.out,f.op){case qB.MATCH:return r===aB.ANCHOR_BOTH&&s!==n.endPos()?null:(B=!0,a.length>0&&(a[0]=0,a[1]=s),0===i?[]:AB.toArray(a));case qB.RUNE:if(!f.matchRune(l))return null;break;case qB.RUNE1:if(l!==f.runes[0])return null;break;case qB.RUNE_ANY:break;case qB.RUNE_ANY_NOT_NL:if(10===l)return null;break;case qB.ALT:case qB.ALT_MATCH:g=t.next(f,l);continue;case qB.FAIL:return null;case qB.NOP:continue;case qB.EMPTY_WIDTH:if(0!==(f.arg&~C))return null;continue;case qB.CAPTURE:f.arg<a.length&&(a[f.arg]=s);continue;default:throw new $B("bad inst")}if(0===u)break;C=AB.emptyOpContext(l,d),s+=u,l=d,u=p,-1!==l&&(h=n.step(s+u),h!==LB.EOF()?(d=h>>3,p=7&h):(d=-1,p=0))}return B?0===i?[]:AB.toArray(a):null}},ac=class t{static Op=SB(["NO_MATCH","EMPTY_MATCH","LITERAL","CHAR_CLASS","ANY_CHAR_NOT_NL","ANY_CHAR","BEGIN_LINE","END_LINE","BEGIN_TEXT","END_TEXT","WORD_BOUNDARY","NO_WORD_BOUNDARY","CAPTURE","STAR","PLUS","QUEST","REPEAT","CONCAT","ALTERNATE","PLB","NLB","LEFT_PAREN","VERTICAL_BAR"]);static isPseudoOp(e){return e>=t.Op.LEFT_PAREN}static emptySubs(){return[]}static quoteIfHyphen(t){return t===mB.CODES["-"]?"\\":""}static fromRegexp(e){const n=new t(e.op);return n.flags=e.flags,n.subs=e.subs,n.runes=e.runes,n.cap=e.cap,n.min=e.min,n.max=e.max,n.name=e.name,n.namedGroups=e.namedGroups,n.lb=e.lb,n}constructor(e){this.op=e,this.flags=0,this.subs=t.emptySubs(),this.runes=new Int32Array(0),this.min=0,this.max=0,this.cap=0,this.name=null,this.namedGroups=Object.create(null),this.lb=0}reinit(){this.flags=0,this.subs=t.emptySubs(),this.runes=new Int32Array(0),this.cap=0,this.min=0,this.max=0,this.name=null,this.namedGroups=Object.create(null),this.lb=0}toString(){return this.appendTo()}appendTo(){let e="";switch(this.op){case t.Op.NO_MATCH:e+="[^\\x00-\\x{10FFFF}]";break;case t.Op.EMPTY_MATCH:e+="(?:)";break;case t.Op.STAR:case t.Op.PLUS:case t.Op.QUEST:case t.Op.REPEAT:{const n=this.subs[0];switch(n.op>t.Op.CAPTURE||n.op===t.Op.LITERAL&&n.runes.length>1?e+=`(?:${n.appendTo()})`:e+=n.appendTo(),this.op){case t.Op.STAR:e+="*";break;case t.Op.PLUS:e+="+";break;case t.Op.QUEST:e+="?";break;case t.Op.REPEAT:e+=`{${this.min}`,this.min!==this.max&&(e+=",",this.max>=0&&(e+=this.max)),e+="}"}0!==(this.flags&aB.NON_GREEDY)&&(e+="?");break}case t.Op.CONCAT:for(let n of this.subs)n.op===t.Op.ALTERNATE?e+=`(?:${n.appendTo()})`:e+=n.appendTo();break;case t.Op.ALTERNATE:{let t="";for(let n of this.subs)e+=t,t="|",e+=n.appendTo();break}case t.Op.LITERAL:0!==(this.flags&aB.FOLD_CASE)&&(e+="(?i:");for(let t of this.runes)e+=AB.escapeRune(t);0!==(this.flags&aB.FOLD_CASE)&&(e+=")");break;case t.Op.ANY_CHAR_NOT_NL:e+="(?-s:.)";break;case t.Op.ANY_CHAR:e+="(?s:.)";break;case t.Op.PLB:e+=`(?<=${this.subs[0].appendTo()})`;break;case t.Op.NLB:e+=`(?<!${this.subs[0].appendTo()})`;break;case t.Op.CAPTURE:null===this.name||0===this.name.length?e+="(":e+=`(?P<${this.name}>`,this.subs[0].op!==t.Op.EMPTY_MATCH&&(e+=this.subs[0].appendTo()),e+=")";break;case t.Op.BEGIN_TEXT:e+="\\A";break;case t.Op.END_TEXT:0!==(this.flags&aB.WAS_DOLLAR)?e+="(?-m:$)":e+="\\z";break;case t.Op.BEGIN_LINE:e+="^";break;case t.Op.END_LINE:e+="$";break;case t.Op.WORD_BOUNDARY:e+="\\b";break;case t.Op.NO_WORD_BOUNDARY:e+="\\B";break;case t.Op.CHAR_CLASS:if(this.runes.length%2!=0){e+="[invalid char class]";break}if(e+="[",0===this.runes.length)e+="^\\x00-\\x{10FFFF}";else if(0===this.runes[0]&&this.runes[this.runes.length-1]===vB.MAX_RUNE){e+="^";for(let n=1;n<this.runes.length-1;n+=2){const s=this.runes[n]+1,r=this.runes[n+1]-1;e+=t.quoteIfHyphen(s),e+=AB.escapeRune(s),s!==r&&(e+="-",e+=t.quoteIfHyphen(r),e+=AB.escapeRune(r))}}else for(let n=0;n<this.runes.length;n+=2){const s=this.runes[n],r=this.runes[n+1];e+=t.quoteIfHyphen(s),e+=AB.escapeRune(s),s!==r&&(e+="-",e+=t.quoteIfHyphen(r),e+=AB.escapeRune(r))}e+="]";break;default:e+=this.op}return e}maxCap(){let e=0;if(this.op===t.Op.CAPTURE&&(e=this.cap),null!==this.subs)for(let t of this.subs){const n=t.maxCap();e<n&&(e=n)}return e}equals(e){if(!(null!==e&&e instanceof t))return!1;if(this.op!==e.op)return!1;switch(this.op){case t.Op.END_TEXT:if((this.flags&aB.WAS_DOLLAR)!==(e.flags&aB.WAS_DOLLAR))return!1;break;case t.Op.LITERAL:case t.Op.CHAR_CLASS:if((this.flags&aB.FOLD_CASE)!==(e.flags&aB.FOLD_CASE))return!1;if(null===this.runes&&null===e.runes)break;if(null===this.runes||null===e.runes)return!1;if(this.runes.length!==e.runes.length)return!1;for(let t=0;t<this.runes.length;t++)if(this.runes[t]!==e.runes[t])return!1;break;case t.Op.ALTERNATE:case t.Op.CONCAT:if(this.subs.length!==e.subs.length)return!1;for(let t=0;t<this.subs.length;++t)if(!this.subs[t].equals(e.subs[t]))return!1;break;case t.Op.STAR:case t.Op.PLUS:case t.Op.QUEST:if((this.flags&aB.NON_GREEDY)!==(e.flags&aB.NON_GREEDY)||!this.subs[0].equals(e.subs[0]))return!1;break;case t.Op.REPEAT:if((this.flags&aB.NON_GREEDY)!==(e.flags&aB.NON_GREEDY)||this.min!==e.min||this.max!==e.max||!this.subs[0].equals(e.subs[0]))return!1;break;case t.Op.CAPTURE:if(this.cap!==e.cap||(null===this.name?null!==e.name:this.name!==e.name)||!this.subs[0].equals(e.subs[0]))return!1;break;case t.Op.PLB:case t.Op.NLB:if(this.lb!==e.lb||!this.subs[0].equals(e.subs[0]))return!1}return!0}},Bc=class{static walk(t,e){const n=[];let s,r=t;for(;;){if(0===r.subs.length)s=e.leaf(r);else{const t=e.enter(r);if(void 0===t.result){n.push({re:r,state:t,i:0}),r=r.subs[0];continue}s=t.result}for(;;){if(0===n.length)return s;const t=n[n.length-1];if(e.child(t.re,t.state,s,t.i),t.i++,void 0===t.state.result&&t.i<t.re.subs.length){r=t.re.subs[t.i];break}n.pop(),s=void 0!==t.state.result?t.state.result:e.leave(t.re,t.state)}}}},cc=class{constructor(t,e){const n=new Map,s=[0],r=[0],i=[0],o=[0];for(const a of t){let t=0;for(let B=0;B<a.length;B++){const c=t*e+a[B];let l=n.get(c);void 0===l&&(l=s.length,n.set(c,l),s.push(t),r.push(a[B]),i.push(i[t]+1),o.push(0)),t=l}o[t]=1}const a=s.length,B=new Int32Array(a-1);for(let t=1;t<a;t++)B[t-1]=t;B.sort((t,e)=>s[t]-s[e]||r[t]-r[e]);const c=new Int32Array(a+1);for(let t=1;t<a;t++)c[s[t]+1]++;for(let t=0;t<a;t++)c[t+1]+=c[t];const l=new Int32Array(a-1);for(let t=0;t<B.length;t++)l[t]=r[B[t]];this.childStart=c,this.childUnit=l,this.childNode=B;const u=new Int32Array(a);for(let t=0;t<a;t++)u[t]=t;u.sort((t,e)=>i[t]-i[e]);const h=new Int32Array(a),d=Uint8Array.from(o);for(let t=1;t<a;t++){const e=u[t],n=s[e];if(0!==n){let t=h[n],s=this.next(t,r[e]);for(;s<0&&0!==t;)t=h[t],s=this.next(t,r[e]);h[e]=s>=0?s:0}d[e]|=d[h[e]]}this.fail=h,this.match=d}next(t,e){let n=this.childStart[t],s=this.childStart[t+1];const r=this.childUnit;for(;n<s;){const t=n+s>>1,i=r[t];if(i===e)return this.childNode[t];i<e?n=t+1:s=t}return-1}advance(t,e){for(;;){const n=this.next(t,e);if(n>=0)return n;if(0===t)return 0;t=this.fail[t]}}searchUTF16(t,e,n){let s=0;for(let r=e;r<n;r++)if(s=this.advance(s,t.charCodeAt(r)),1===this.match[s])return!0;return!1}searchUTF8(t,e,n){let s=0;for(let r=e;r<n;r++)if(s=this.advance(s,t[r]),1===this.match[s])return!0;return!1}},lc=class t{static Type={NONE:0,EXACT:1,AND:2,OR:3};static MAX_SCANS=32;static MAX_AC_UNITS=1<<18;constructor(e){this.type=e,this.subs=[],this.str="",this.bytes=null,this.cost=e===t.Type.EXACT?1:0,this.allExact=!1,this.ac16=null,this.ac8=null}automaton16(){if(null===this.ac16){const t=this.subs.map(t=>{const e=new Array(t.str.length);for(let n=0;n<t.str.length;n++)e[n]=t.str.charCodeAt(n);return e});this.ac16=new cc(t,65536)}return this.ac16}automaton8(){return null===this.ac8&&(this.ac8=new cc(this.subs.map(t=>t.bytes),256)),this.ac8}eval(e,n){switch(this.type){case t.Type.NONE:return!0;case t.Type.EXACT:return e.hasString(this,n);case t.Type.AND:for(let t=0;t<this.subs.length;t++)if(!this.subs[t].eval(e,n))return!1;return!0;case t.Type.OR:if(this.allExact)return e.hasAnyString(this,n);for(let t=0;t<this.subs.length;t++)if(this.subs[t].eval(e,n))return!0;return!1;default:return!0}}},uc=class t{static build(e){return e?Bc.walk(e,t.WALKER):new lc(lc.Type.NONE)}static WALKER={leaf:e=>t.leaf(e),enter:e=>t.enter(e),child:(e,n,s)=>t.child(e,n,s),leave:(e,n)=>t.leave(e,n)};static leaf(t){if(t.op!==ac.Op.LITERAL)return new lc(lc.Type.NONE);if(0===t.runes.length||0!==(t.flags&aB.FOLD_CASE))return new lc(lc.Type.NONE);let e="";for(let n=0;n<t.runes.length;n++){if(vB.isUnsearchable(t.runes[n]))return new lc(lc.Type.NONE);e+=String.fromCodePoint(t.runes[n])}const n=new lc(lc.Type.EXACT);return n.str=e,n.bytes=AB.stringToUtf8ByteArray(n.str),n}static enter(t){switch(t.op){case ac.Op.CAPTURE:case ac.Op.PLUS:return{sub:null};case ac.Op.REPEAT:return t.min>=1?{sub:null}:{result:new lc(lc.Type.NONE)};case ac.Op.CONCAT:return{pf:new lc(lc.Type.AND),subs:[]};case ac.Op.ALTERNATE:return{pf:new lc(lc.Type.OR),subs:[]};default:return{result:new lc(lc.Type.NONE)}}}static child(t,e,n){if(void 0!==e.subs)if(e.pf.type!==lc.Type.AND)if(n.type!==lc.Type.NONE)if(n.type!==lc.Type.OR)e.subs.push(n);else for(let t=0;t<n.subs.length;t++)e.subs.push(n.subs[t]);else e.result=new lc(lc.Type.NONE);else{if(n.type===lc.Type.NONE)return;if(n.type===lc.Type.AND){for(let t=0;t<n.subs.length;t++)e.subs.push(n.subs[t]);return}e.subs.push(n)}else e.sub=n}static leave(t,e){if(void 0===e.subs)return e.sub;const n=e.pf,s=new Set,r=[];for(const t of e.subs){if(t.type===lc.Type.EXACT){if(s.has(t.str))continue;s.add(t.str)}r.push(t)}if(n.type===lc.Type.AND){const t=[];let e=0;for(const n of r)e+n.cost>lc.MAX_SCANS||(t.push(n),e+=n.cost);return 0===t.length?new lc(lc.Type.NONE):1===t.length?t[0]:(n.subs=t,n.cost=e,n)}if(0===r.length)return new lc(lc.Type.NONE);if(1===r.length)return r[0];n.subs=r;let i=!0,o=0,a=0;for(const t of r)t.type!==lc.Type.EXACT?i=!1:a+=t.bytes.length,o+=t.cost;return i?a>lc.MAX_AC_UNITS?new lc(lc.Type.NONE):(n.allExact=!0,n.cost=1,n):o>lc.MAX_SCANS?new lc(lc.Type.NONE):(n.cost=o,n)}},hc=class{constructor(t=0,e=0){this.head=t,this.tail=e}},dc=class{constructor(){this.inst=[],this.start=0,this.numCap=2,this.lbStarts=[],this.numLb=0,this.lbInst=null}getInst(t){return this.inst[t]}numInst(){return this.inst.length}addInst(t){this.inst.push(new qB(t))}markLookbehindInsts(){const t=new Uint8Array(this.inst.length),e=this.lbStarts.slice();for(;e.length>0;){const n=e.pop();if(0===n||1===t[n])continue;t[n]=1;const s=this.inst[n];switch(s.op){case qB.ALT:case qB.ALT_MATCH:e.push(s.out,s.arg);break;case qB.MATCH:case qB.FAIL:break;default:e.push(s.out)}}this.lbInst=t}skipNop(t){let e=this.inst[t];for(;e.op===qB.NOP||e.op===qB.CAPTURE;)e=this.inst[t],t=e.out;return e}prefix(){let t="",e=this.skipNop(this.start);if(!qB.isRuneOp(e.op)||1!==e.runes.length)return[e.op===qB.MATCH,t];for(;qB.isRuneOp(e.op)&&1===e.runes.length&&0===(e.arg&aB.FOLD_CASE)&&!vB.isUnsearchable(e.runes[0]);)t+=String.fromCodePoint(e.runes[0]),e=this.skipNop(e.out);return[e.op===qB.MATCH,t]}startCond(){let t=0,e=this.start;t:for(;;){const n=this.inst[e];switch(n.op){case qB.EMPTY_WIDTH:t|=n.arg;break;case qB.FAIL:return-1;case qB.CAPTURE:case qB.NOP:break;default:break t}e=n.out}return t}patch(t,e){let n=t.head;for(;0!==n;){const t=this.inst[n>>1];1&n?(n=t.arg,t.arg=e):(n=t.out,t.out=e)}}append(t,e){if(0===t.head)return e;if(0===e.head)return t;const n=this.inst[t.tail>>1];return 1&t.tail?n.arg=e.head:n.out=e.head,new hc(t.head,e.tail)}toString(){let t="";for(let e=0;e<this.inst.length;e++){const n=t.length;t+=e,e===this.start&&(t+="*"),t+=" ".substring(t.length-n),t+=this.inst[e],t+="\n"}return t}};const pc=new Int32Array([0,mB.CODES["\n"]-1,mB.CODES["\n"]+1,vB.MAX_RUNE]),fc=new Int32Array([0,vB.MAX_RUNE]);var Cc=class{constructor(t=0,e=new hc,n=!1){this.i=t,this.out=e,this.nullable=n}},gc=class t{static compileRegexp(e){const n=new t,s=n.compile(e);return n.prog.patch(s.out,n.newInst(qB.MATCH).i),n.prog.start=s.i,n.prog.markLookbehindInsts(),n.prog}static compileSet(e){const n=new t;if(0===e.length)return n.prog.start=n.newInst(qB.FAIL).i,n.prog.markLookbehindInsts(),n.prog;let s=[];for(let t=0;t<e.length;t++){n.lbOffset=n.prog.numLb;const r=n.compile(e[t]),i=n.newInst(qB.MATCH);n.prog.getInst(i.i).arg=t,n.prog.patch(r.out,i.i),s.push(r.i)}let r=s[0];for(let t=1;t<s.length;t++){const e=n.newInst(qB.ALT),i=n.prog.getInst(e.i);i.out=r,i.arg=s[t],r=e.i}return n.prog.start=r,n.prog.markLookbehindInsts(),n.prog}constructor(){this.prog=new dc,this.newInst(qB.FAIL),this.lbOffset=0,this.runeCache=new Map,this.walker={leaf:t=>this.leaf(t),enter:t=>this.enter(t),child:(t,e,n)=>this.child(t,e,n),leave:(t,e)=>this.leave(t,e)}}newInst(t){return this.prog.addInst(t),new Cc(this.prog.numInst()-1,new hc,!0)}nop(){const t=this.newInst(qB.NOP);return t.out=new hc(t.i<<1,t.i<<1),t}fail(){return new Cc}cap(t){const e=this.newInst(qB.CAPTURE);return e.out=new hc(e.i<<1,e.i<<1),this.prog.getInst(e.i).arg=t,this.prog.numCap<t+1&&(this.prog.numCap=t+1),e}cat(t,e){return 0===t.i||0===e.i?(this.prog.patch(t.out,0),this.prog.patch(e.out,0),this.fail()):(this.prog.patch(t.out,e.i),new Cc(t.i,e.out,t.nullable&&e.nullable))}alt(t,e){if(0===t.i)return e;if(0===e.i)return t;const n=this.newInst(qB.ALT),s=this.prog.getInst(n.i);return s.out=t.i,s.arg=e.i,n.out=this.prog.append(t.out,e.out),n.nullable=t.nullable||e.nullable,n}loop(t,e){const n=this.newInst(qB.ALT),s=this.prog.getInst(n.i);return e?(s.arg=t.i,n.out=new hc(n.i<<1,n.i<<1)):(s.out=t.i,n.out=new hc(n.i<<1|1,n.i<<1|1)),this.prog.patch(t.out,n.i),n}quest(t,e){if(0===t.i)return this.nop();const n=this.newInst(qB.ALT),s=this.prog.getInst(n.i);return e?(s.arg=t.i,n.out=new hc(n.i<<1,n.i<<1)):(s.out=t.i,n.out=new hc(n.i<<1|1,n.i<<1|1)),n.out=this.prog.append(n.out,t.out),n}star(t,e){return 0===t.i?this.nop():t.nullable?this.quest(this.plus(t,e),e):this.loop(t,e)}plus(t,e){return 0===t.i?this.fail():new Cc(t.i,this.loop(t,e).out,t.nullable)}empty(t){const e=this.newInst(qB.EMPTY_WIDTH);return this.prog.getInst(e.i).arg=t,e.out=new hc(e.i<<1,e.i<<1),e}rune(t,e){const n=this.newInst(qB.RUNE);n.nullable=!1;const s=this.prog.getInst(n.i);return s.runes=t,e&=aB.FOLD_CASE,1===t.length&&vB.simpleFold(t[0])!==t[0]||(e&=-2),s.arg=e,n.out=new hc(n.i<<1,n.i<<1),0===(e&aB.FOLD_CASE)&&1===t.length||2===t.length&&t[0]===t[1]?s.op=qB.RUNE1:2===t.length&&0===t[0]&&t[1]===vB.MAX_RUNE?s.op=qB.RUNE_ANY:4===t.length&&0===t[0]&&t[1]===mB.CODES["\n"]-1&&t[2]===mB.CODES["\n"]+1&&t[3]===vB.MAX_RUNE&&(s.op=qB.RUNE_ANY_NOT_NL),n}lookBehind(t,e){const n=Math.sign(e)*(Math.abs(e)+this.lbOffset),s=this.newInst(qB.LB_WRITE);this.prog.getInst(s.i).arg=n;const r=this.rune(fc,0),i=this.star(r,!0),o=this.cat(i,t);this.prog.patch(o.out,s.i);const a=this.newInst(qB.LB_CHECK);return this.prog.getInst(a.i).arg=n,this.prog.lbStarts.push(o.i),Math.abs(n)>this.prog.numLb&&(this.prog.numLb=Math.abs(n)),a.out=new hc(a.i<<1,a.i<<1),a}compile(t){return Bc.walk(t,this.walker)}leaf(t){switch(t.op){case ac.Op.NO_MATCH:return this.fail();case ac.Op.EMPTY_MATCH:return this.nop();case ac.Op.LITERAL:{if(0===t.runes.length)return this.nop();let e=null;for(let n of t.runes){let s=this.runeCache.get(n);void 0===s&&(s=new Int32Array([n]),this.runeCache.set(n,s));const r=this.rune(s,t.flags);e=null===e?r:this.cat(e,r)}return e}case ac.Op.CHAR_CLASS:return this.rune(t.runes,t.flags);case ac.Op.ANY_CHAR_NOT_NL:return this.rune(pc,0);case ac.Op.ANY_CHAR:return this.rune(fc,0);case ac.Op.BEGIN_LINE:return this.empty(AB.EMPTY_BEGIN_LINE);case ac.Op.END_LINE:return this.empty(AB.EMPTY_END_LINE);case ac.Op.BEGIN_TEXT:return this.empty(AB.EMPTY_BEGIN_TEXT);case ac.Op.END_TEXT:return this.empty(AB.EMPTY_END_TEXT);case ac.Op.WORD_BOUNDARY:return this.empty(AB.EMPTY_WORD_BOUNDARY);case ac.Op.NO_WORD_BOUNDARY:return this.empty(AB.EMPTY_NO_WORD_BOUNDARY);case ac.Op.CONCAT:case ac.Op.ALTERNATE:return this.nop();default:throw new UB("regexp: unhandled case in compile")}}enter(t){switch(t.op){case ac.Op.PLB:case ac.Op.NLB:case ac.Op.STAR:case ac.Op.PLUS:case ac.Op.QUEST:return{sub:null};case ac.Op.CAPTURE:return{bra:this.cap(t.cap<<1),sub:null};case ac.Op.CONCAT:case ac.Op.ALTERNATE:return{f:null};default:throw new UB("regexp: unhandled case in compile")}}child(t,e,n){t.op===ac.Op.CONCAT?e.f=null===e.f?n:this.cat(e.f,n):t.op===ac.Op.ALTERNATE?e.f=null===e.f?n:this.alt(e.f,n):e.sub=n}leave(t,e){switch(t.op){case ac.Op.PLB:case ac.Op.NLB:return this.lookBehind(e.sub,t.lb);case ac.Op.CAPTURE:{const n=this.cap(t.cap<<1|1);return this.cat(this.cat(e.bra,e.sub),n)}case ac.Op.STAR:return this.star(e.sub,0!==(t.flags&aB.NON_GREEDY));case ac.Op.PLUS:return this.plus(e.sub,0!==(t.flags&aB.NON_GREEDY));case ac.Op.QUEST:return this.quest(e.sub,0!==(t.flags&aB.NON_GREEDY));case ac.Op.CONCAT:case ac.Op.ALTERNATE:return e.f;default:throw new UB("regexp: unhandled case in compile")}}},mc=class t{static simplify(e){return null===e?null:Bc.walk(e,t.WALKER)}static WALKER={leaf:e=>t.leaf(e),enter:e=>t.enter(e),child:(e,n,s,r)=>t.child(e,n,s,r),leave:(e,n)=>t.leave(e,n)};static leaf(t){if(t.op===ac.Op.CHAR_CLASS){if(null===t.runes)return t;if(0===t.runes.length)return new ac(ac.Op.NO_MATCH);if(2===t.runes.length&&0===t.runes[0]&&t.runes[1]===vB.MAX_RUNE)return new ac(ac.Op.ANY_CHAR);if(4===t.runes.length&&0===t.runes[0]&&t.runes[1]===mB.CODES["\n"]-1&&t.runes[2]===mB.CODES["\n"]+1&&t.runes[3]===vB.MAX_RUNE)return new ac(ac.Op.ANY_CHAR_NOT_NL)}return t}static enter(t){switch(t.op){case ac.Op.PLB:case ac.Op.NLB:case ac.Op.CAPTURE:case ac.Op.STAR:case ac.Op.PLUS:case ac.Op.QUEST:return{sub:null};case ac.Op.CONCAT:case ac.Op.ALTERNATE:return{subs:[],changed:!1};case ac.Op.REPEAT:return 0===t.min&&0===t.max?{result:new ac(ac.Op.EMPTY_MATCH)}:{sub:null};default:return{result:t}}}static child(t,e,n,s){if(void 0!==e.subs){if(n!==t.subs[s]&&(e.changed=!0),t.op===ac.Op.CONCAT){if(n.op===ac.Op.NO_MATCH)return void(e.result=new ac(ac.Op.NO_MATCH));if(n.op===ac.Op.EMPTY_MATCH)return void(e.changed=!0);if(n.op===ac.Op.CONCAT){e.changed=!0;for(let t=0;t<n.subs.length;t++)e.subs.push(n.subs[t]);return}}else{if(n.op===ac.Op.NO_MATCH)return void(e.changed=!0);if(n.op===ac.Op.ALTERNATE){e.changed=!0;for(let t=0;t<n.subs.length;t++)e.subs.push(n.subs[t]);return}}e.subs.push(n)}else e.sub=n}static leave(e,n){switch(e.op){case ac.Op.PLB:case ac.Op.NLB:case ac.Op.CAPTURE:{const t=n.sub;if(t!==e.subs[0]){const n=ac.fromRegexp(e);return n.runes=new Int32Array(0),n.subs=[t],n}return e}case ac.Op.CONCAT:case ac.Op.ALTERNATE:if(n.changed){const t=n.subs;if(0===t.length)return new ac(e.op===ac.Op.CONCAT?ac.Op.EMPTY_MATCH:ac.Op.NO_MATCH);if(1===t.length)return t[0];const s=ac.fromRegexp(e);return s.runes=new Int32Array(0),s.subs=t,s}return e;case ac.Op.STAR:case ac.Op.PLUS:case ac.Op.QUEST:return t.simplify1(e.op,e.flags,n.sub,e);case ac.Op.REPEAT:return t.simplifyRepeat(e,n.sub);default:return e}}static simplifyRepeat(e,n){if(-1===e.max){if(0===e.min)return t.simplify1(ac.Op.STAR,e.flags,n,null);if(1===e.min)return t.simplify1(ac.Op.PLUS,e.flags,n,null);const s=[];for(let t=0;t<e.min-1;t++)s.push(n);return s.push(t.simplify1(ac.Op.PLUS,e.flags,n,null)),t.concat(s)}if(1===e.min&&1===e.max)return n;let s=null;if(e.min>0){s=[];for(let t=0;t<e.min;t++)s.push(n)}if(e.max>e.min){let r=t.simplify1(ac.Op.QUEST,e.flags,n,null);for(let s=e.min+1;s<e.max;s++)r=t.simplify1(ac.Op.QUEST,e.flags,t.concat([n,r]),null);if(null===s)return r;s.push(r)}return null!==s?t.concat(s):new ac(ac.Op.NO_MATCH)}static concat(t){const e=[];for(let n=0;n<t.length;n++){const s=t[n];if(s.op===ac.Op.NO_MATCH)return new ac(ac.Op.NO_MATCH);if(s.op!==ac.Op.EMPTY_MATCH)if(s.op!==ac.Op.CONCAT)e.push(s);else for(let t=0;t<s.subs.length;t++)e.push(s.subs[t])}if(0===e.length)return new ac(ac.Op.EMPTY_MATCH);if(1===e.length)return e[0];const n=new ac(ac.Op.CONCAT);return n.subs=e,n}static simplify1(t,e,n,s){if(n.op===ac.Op.EMPTY_MATCH)return n;if(n.op===ac.Op.NO_MATCH)return t===ac.Op.PLUS?n:new ac(ac.Op.EMPTY_MATCH);if(t===n.op&&(e&aB.NON_GREEDY)===(n.flags&aB.NON_GREEDY))return n;if(null!==s&&s.op===t&&(s.flags&aB.NON_GREEDY)===(e&aB.NON_GREEDY)&&n===s.subs[0])return s;const r=new ac(t);return r.flags=e,r.subs=[n],r}},wc=class{constructor(t,e){this.sign=t,this.cls=e}};const yc=[48,57],Ec=[9,10,12,13,32,32],Dc=[48,57,65,90,95,95,97,122],_c=new Map([["\\d",new wc(1,yc)],["\\D",new wc(-1,yc)],["\\s",new wc(1,Ec)],["\\S",new wc(-1,Ec)],["\\w",new wc(1,Dc)],["\\W",new wc(-1,Dc)]]),bc=[48,57,65,90,97,122],vc=[65,90,97,122],Ic=[0,127],Tc=[9,9,32,32],Oc=[0,31,127,127],Ac=[48,57],Sc=[33,126],Rc=[97,122],Nc=[32,126],xc=[33,47,58,64,91,96,123,126],kc=[9,13,32,32],Lc=[65,90],Fc=[48,57,65,90,95,95,97,122],Pc=[48,57,65,70,97,102],Mc=new Map([["[:alnum:]",new wc(1,bc)],["[:^alnum:]",new wc(-1,bc)],["[:alpha:]",new wc(1,vc)],["[:^alpha:]",new wc(-1,vc)],["[:ascii:]",new wc(1,Ic)],["[:^ascii:]",new wc(-1,Ic)],["[:blank:]",new wc(1,Tc)],["[:^blank:]",new wc(-1,Tc)],["[:cntrl:]",new wc(1,Oc)],["[:^cntrl:]",new wc(-1,Oc)],["[:digit:]",new wc(1,Ac)],["[:^digit:]",new wc(-1,Ac)],["[:graph:]",new wc(1,Sc)],["[:^graph:]",new wc(-1,Sc)],["[:lower:]",new wc(1,Rc)],["[:^lower:]",new wc(-1,Rc)],["[:print:]",new wc(1,Nc)],["[:^print:]",new wc(-1,Nc)],["[:punct:]",new wc(1,xc)],["[:^punct:]",new wc(-1,xc)],["[:space:]",new wc(1,kc)],["[:^space:]",new wc(-1,kc)],["[:upper:]",new wc(1,Lc)],["[:^upper:]",new wc(-1,Lc)],["[:word:]",new wc(1,Fc)],["[:^word:]",new wc(-1,Fc)],["[:xdigit:]",new wc(1,Pc)],["[:^xdigit:]",new wc(-1,Pc)]]);var Gc=class t{static charClassToString(t,e){let n="[";for(let s=0;s<e;s+=2){s>0&&(n+=" ");const e=t[s],r=t[s+1];n+=e===r?`0x${e.toString(16)}`:`0x${e.toString(16)}-0x${r.toString(16)}`}return n+="]",n}static sortRanges(t,e){const n=e>>1,s=new Array(n);for(let t=0;t<n;t++)s[t]=t;s.sort((e,n)=>t[2*e]-t[2*n]||t[2*n+1]-t[2*e+1]);const r=t.slice(0,e);for(let e=0;e<n;e++)t[2*e]=r[2*s[e]],t[2*e+1]=r[2*s[e]+1]}constructor(t=AB.emptyInts()){this.r=t,this.len=t.length}toArray(){return this.r instanceof Int32Array?this.len===this.r.length?this.r:this.r.subarray(0,this.len):new Int32Array(this.len===this.r.length?this.r:this.r.slice(0,this.len))}toGrowableArray(){return Array.isArray(this.r)?(this.r.length=this.len,this.r):Array.from(this.r.subarray(0,this.len))}cleanClass(){if(this.len<4)return this;t.sortRanges(this.r,this.len);let e=2;for(let t=2;t<this.len;t+=2){const n=this.r[t],s=this.r[t+1];n<=this.r[e-1]+1?s>this.r[e-1]&&(this.r[e-1]=s):(this.r[e]=n,this.r[e+1]=s,e+=2)}return this.len=e,this}appendLiteral(t,e){return 0!==(e&aB.FOLD_CASE)?this.appendFoldedRange(t,t):this.appendRange(t,t)}appendRange(t,e){if(this.len>0)for(let n=2;n<=4;n+=2)if(this.len>=n){const s=this.r[this.len-n],r=this.r[this.len-n+1];if(t<=r+1&&s<=e+1)return t<s&&(this.r[this.len-n]=t),e>r&&(this.r[this.len-n+1]=e),this}return this.r[this.len++]=t,this.r[this.len++]=e,this}appendFoldedRange(t,e){if(t<=vB.MIN_FOLD&&e>=vB.MAX_FOLD)return this.appendRange(t,e);if(e<vB.MIN_FOLD||t>vB.MAX_FOLD)return this.appendRange(t,e);t<vB.MIN_FOLD&&(this.appendRange(t,vB.MIN_FOLD-1),t=vB.MIN_FOLD),e>vB.MAX_FOLD&&(this.appendRange(vB.MAX_FOLD+1,e),e=vB.MAX_FOLD);for(let n=t;n<=e;n++){this.appendRange(n,n);for(let t=vB.simpleFold(n);t!==n;t=vB.simpleFold(t))this.appendRange(t,t)}return this}appendClass(t){for(let e=0;e<t.length;e+=2)this.appendRange(t[e],t[e+1]);return this}appendFoldedClass(t){for(let e=0;e<t.length;e+=2)this.appendFoldedRange(t[e],t[e+1]);return this}appendNegatedClass(t){let e=0;for(let n=0;n<t.length;n+=2){const s=t[n],r=t[n+1];e<=s-1&&this.appendRange(e,s-1),e=r+1}return e<=vB.MAX_RUNE&&this.appendRange(e,vB.MAX_RUNE),this}appendTable(t){for(let e=0;e<t.length;++e){const n=t.getLo(e),s=t.getHi(e),r=t.getStride(e);if(1!==r)for(let t=n;t<=s;t+=r)this.appendRange(t,t);else this.appendRange(n,s)}return this}appendNegatedTable(t){let e=0;for(let n=0;n<t.length;++n){const s=t.getLo(n),r=t.getHi(n),i=t.getStride(n);if(1!==i)for(let t=s;t<=r;t+=i)e<=t-1&&this.appendRange(e,t-1),e=t+1;else e<=s-1&&this.appendRange(e,s-1),e=r+1}return e<=vB.MAX_RUNE&&this.appendRange(e,vB.MAX_RUNE),this}appendTableWithSign(t,e){return e<0?this.appendNegatedTable(t):this.appendTable(t)}negateClass(){let t=0,e=0;for(let n=0;n<this.len;n+=2){const s=this.r[n],r=this.r[n+1];t<=s-1&&(this.r[e]=t,this.r[e+1]=s-1,e+=2),t=r+1}return this.len=e,t<=vB.MAX_RUNE&&(this.r[this.len++]=t,this.r[this.len++]=vB.MAX_RUNE),this}appendClassWithSign(t,e){return e<0?this.appendNegatedClass(t):this.appendClass(t)}appendGroup(e,n){let s=e.cls;return n&&(s=(new t).appendFoldedClass(s).cleanClass().toArray()),this.appendClassWithSign(s,e.sign)}toString(){return t.charClassToString(this.r,this.len)}},Hc=class{constructor(t){this.str=t,this.position=0}pos(){return this.position}rewindTo(t){this.position=t}more(){return this.position<this.str.length}peek(){return this.str.codePointAt(this.position)}skip(t){this.position+=t}skipString(t){this.position+=t.length}pop(){const t=this.str.codePointAt(this.position);return this.position+=AB.charCount(t),t}lookingAt(t){return this.str.startsWith(t,this.position)}rest(){return this.str.substring(this.position)}from(t){return this.str.substring(t,this.position)}toString(){return this.rest()}},Uc=class t{static ERR_INTERNAL_ERROR="regexp/syntax: internal error";static ERR_INVALID_CHAR_RANGE="invalid character class range";static ERR_INVALID_ESCAPE="invalid escape sequence";static ERR_INVALID_NAMED_CAPTURE="invalid named capture";static ERR_INVALID_PERL_OP="invalid or unsupported Perl syntax";static ERR_INVALID_REPEAT_OP="invalid nested repetition operator";static ERR_INVALID_REPEAT_SIZE="invalid repeat count";static ERR_MISSING_BRACKET="missing closing ]";static ERR_MISSING_PAREN="missing closing )";static ERR_MISSING_REPEAT_ARGUMENT="missing argument to repetition operator";static ERR_TRAILING_BACKSLASH="trailing backslash at end of expression";static ERR_DUPLICATE_NAMED_CAPTURE="duplicate capture group name";static ERR_UNEXPECTED_PAREN="unexpected )";static ERR_NESTING_DEPTH="expression nests too deeply";static ERR_LARGE="expression too large";static ERR_INVALID_CAPTURE_IN_LOOKBEHIND="invalid capture in lookbehind";static MAX_HEIGHT=1e3;static MAX_SIZE=1398101;static MAX_RUNES=33554432;static ANY_TABLE=new wB(new Uint32Array([0,vB.MAX_RUNE,1]));static ASCII_TABLE=new wB(new Uint32Array([0,127,1]));static ASCII_FOLD_TABLE=new wB(new Uint32Array([0,127,1,383,383,1,8490,8490,1]));static unicodeTable(e){return"Any"===e?{tab:t.ANY_TABLE,fold:t.ANY_TABLE,sign:1}:"Ascii"===e?{tab:t.ASCII_TABLE,fold:t.ASCII_FOLD_TABLE,sign:1}:"Assigned"===e?{tab:bB.CATEGORIES.get("Cn"),fold:bB.CATEGORIES.get("Cn"),sign:-1}:"Lc"===e?{tab:bB.CATEGORIES.get("LC"),fold:bB.FOLD_CATEGORIES.get("LC"),sign:1}:bB.CATEGORIES.has(e)?{tab:bB.CATEGORIES.get(e),fold:bB.FOLD_CATEGORIES.get(e),sign:1}:bB.SCRIPTS.has(e)?{tab:bB.SCRIPTS.get(e),fold:bB.FOLD_SCRIPT.get(e),sign:1}:null}static minFoldRune(t){if(t<vB.MIN_FOLD||t>vB.MAX_FOLD)return t;let e=t;const n=t;for(t=vB.simpleFold(t);t!==n;t=vB.simpleFold(t))e>t&&(e=t);return e}static leadingRegexp(t){if(t.op===ac.Op.EMPTY_MATCH)return null;if(t.op===ac.Op.CONCAT&&t.subs.length>0){const e=t.subs[0];return e.op===ac.Op.EMPTY_MATCH?null:e}return t}static literalRegexp(t,e){const n=new ac(ac.Op.LITERAL);return n.flags=e,n.runes=AB.stringToRunes(t),n}static parse(e,n){return new t(e,n).parseInternal()}static parseRepeat(e){const n=e.pos();if(!e.more()||!e.lookingAt("{"))return-1;e.skip(1);const s=t.parseInt(e);if(-1===s)return-1;if(!e.more())return-1;let r;if(e.lookingAt(",")){if(e.skip(1),!e.more())return-1;if(e.lookingAt("}"))r=-1;else if(-1===(r=t.parseInt(e)))return-1}else r=s;if(!e.more()||!e.lookingAt("}"))return-1;if(e.skip(1),s<0||s>1e3||-2===r||r>1e3||r>=0&&s>r)throw new HB(t.ERR_INVALID_REPEAT_SIZE,e.from(n));return s<<16|r&vB.MAX_BMP}static isValidCaptureName(t){if(0===t.length)return!1;for(let e=0;e<t.length;e++){const n=t.codePointAt(e);if(n!==mB.CODES._&&!AB.isalnum(n))return!1}return!0}static parseInt(t){const e=t.pos();for(;t.more()&&t.peek()>=mB.CODES[0]&&t.peek()<=mB.CODES[9];)t.skip(1);const n=t.from(e);return 0===n.length||n.length>1&&n.codePointAt(0)===mB.CODES[0]?-1:n.length>8?-2:parseInt(n,10)}static isCharClass(t){return t.op===ac.Op.LITERAL&&1===t.runes.length||t.op===ac.Op.CHAR_CLASS||t.op===ac.Op.ANY_CHAR_NOT_NL||t.op===ac.Op.ANY_CHAR}static matchRune(t,e){switch(t.op){case ac.Op.LITERAL:return 1===t.runes.length&&t.runes[0]===e;case ac.Op.CHAR_CLASS:for(let n=0;n<t.runes.length;n+=2)if(t.runes[n]<=e&&e<=t.runes[n+1])return!0;return!1;case ac.Op.ANY_CHAR_NOT_NL:return e!==mB.CODES["\n"];case ac.Op.ANY_CHAR:return!0}return!1}static mergeCharClass(e,n){switch(e.op){case ac.Op.ANY_CHAR:break;case ac.Op.ANY_CHAR_NOT_NL:t.matchRune(n,mB.CODES["\n"])&&(e.op=ac.Op.ANY_CHAR);break;case ac.Op.CHAR_CLASS:{const t=new Gc(Array.isArray(e.runes)?e.runes:Array.from(e.runes));n.op===ac.Op.LITERAL?t.appendLiteral(n.runes[0],n.flags):t.appendClass(n.runes),e.runes=t.toGrowableArray();break}case ac.Op.LITERAL:if(n.runes[0]===e.runes[0]&&n.flags===e.flags)break;e.op=ac.Op.CHAR_CLASS,e.runes=(new Gc).appendLiteral(e.runes[0],e.flags).appendLiteral(n.runes[0],n.flags).toGrowableArray()}}static parseEscape(e){const n=e.pos();if(e.skip(1),!e.more())throw new HB(t.ERR_TRAILING_BACKSLASH);let s=e.pop();t:switch(s){case mB.CODES[1]:case mB.CODES[2]:case mB.CODES[3]:case mB.CODES[4]:case mB.CODES[5]:case mB.CODES[6]:case mB.CODES[7]:if(!e.more()||e.peek()<mB.CODES[0]||e.peek()>mB.CODES[7])break;case mB.CODES[0]:{let t=s-mB.CODES[0];for(let n=1;n<3&&!(!e.more()||e.peek()<mB.CODES[0]||e.peek()>mB.CODES[7]);n++)t=8*t+e.peek()-mB.CODES[0],e.skip(1);return t}case mB.CODES.x:{if(!e.more())break;if(s=e.pop(),s===mB.CODES["{"]){let t=0,n=0;for(;;){if(!e.more())break t;if(s=e.pop(),s===mB.CODES["}"])break;const r=AB.unhex(s);if(r<0)break t;if(n=16*n+r,n>vB.MAX_RUNE)break t;t++}if(0===t)break t;return n}const t=AB.unhex(s);if(!e.more())break;s=e.pop();const n=AB.unhex(s);if(t<0||n<0)break;return 16*t+n}case mB.CODES.a:return mB.CODES[""];case mB.CODES.f:return mB.CODES["\f"];case mB.CODES.n:return mB.CODES["\n"];case mB.CODES.r:return mB.CODES["\r"];case mB.CODES.t:return mB.CODES["\t"];case mB.CODES.v:return mB.CODES["\v"];default:if(s<=vB.MAX_ASCII&&!AB.isalnum(s))return s}throw new HB(t.ERR_INVALID_ESCAPE,e.from(n))}static parseClassChar(e,n){if(!e.more())throw new HB(t.ERR_MISSING_BRACKET,e.from(n));return e.lookingAt("\\")?t.parseEscape(e):e.pop()}static hasCapture(e){if(null===e)return!1;if(e.op===ac.Op.CAPTURE)return!0;if(e.subs)for(let n of e.subs)if(t.hasCapture(n))return!0;return!1}constructor(t,e=0){this.wholeRegexp=t,this.flags=e,this.numCap=0,this.namedGroups=Object.create(null),this.stack=[],this.free=null,this.numRegexp=0,this.numRunes=0,this.repeats=0,this.height=null,this.size=null,this.nlb=0}newRegexp(t){let e=this.free;return null!==e&&null!==e.subs&&e.subs.length>0?(this.free=e.subs[0],e.reinit(),e.op=t):(e=new ac(t),this.numRegexp+=1),e}reuse(t){null!==this.height&&this.height.has(t)&&this.height.delete(t),null!==t.subs&&t.subs.length>0&&(t.subs[0]=this.free),this.free=t}checkLimits(e){if(this.numRunes>t.MAX_RUNES)throw new HB(t.ERR_LARGE);this.checkSize(e),this.checkHeight(e)}checkSize(e){if(null===this.size){if(0===this.repeats&&(this.repeats=1),e.op===ac.Op.REPEAT){let n=e.max;-1===n&&(n=e.min),n<=0&&(n=1),n>Math.floor(t.MAX_SIZE/this.repeats)?this.repeats=t.MAX_SIZE:this.repeats*=n}if(this.numRegexp<Math.floor(t.MAX_SIZE/this.repeats))return;this.size=new Map;for(let t of this.stack)this.checkSize(t)}if(this.calcSize(e,!0)>t.MAX_SIZE)throw new HB(t.ERR_LARGE)}calcSize(t,e=!1){if(!e&&null!==this.size&&this.size.has(t))return this.size.get(t);let n=0;switch(t.op){case ac.Op.LITERAL:n=t.runes.length;break;case ac.Op.PLB:case ac.Op.NLB:case ac.Op.CAPTURE:case ac.Op.STAR:n=2+this.calcSize(t.subs[0]);break;case ac.Op.PLUS:case ac.Op.QUEST:n=1+this.calcSize(t.subs[0]);break;case ac.Op.CONCAT:for(let e of t.subs)n+=this.calcSize(e);break;case ac.Op.ALTERNATE:for(let e of t.subs)n+=this.calcSize(e);t.subs.length>1&&(n=n+t.subs.length-1);break;case ac.Op.REPEAT:{let e=this.calcSize(t.subs[0]);if(-1===t.max){n=0===t.min?2+e:1+t.min*e;break}n=t.max*e+(t.max-t.min);break}}return n=Math.max(1,n),null===this.size&&(this.size=new Map),this.size.set(t,n),n}checkHeight(e){if(!(this.numRegexp<t.MAX_HEIGHT)){if(null===this.height){this.height=new Map;for(let t of this.stack)this.checkHeight(t)}if(this.calcHeight(e,!0)>t.MAX_HEIGHT)throw new HB(t.ERR_NESTING_DEPTH)}}calcHeight(t,e=!1){if(!e&&null!==this.height&&this.height.has(t))return this.height.get(t);let n=1;for(let e of t.subs){const t=this.calcHeight(e);n<1+t&&(n=1+t)}return null===this.height&&(this.height=new Map),this.height.set(t,n),n}pop(){return this.stack.pop()}popToPseudo(){const t=this.stack.length;let e=t;for(;e>0&&!ac.isPseudoOp(this.stack[e-1].op);)e--;return this.stack.splice(e,t-e)}push(t){if(this.numRunes+=t.runes.length,t.op===ac.Op.CHAR_CLASS&&2===t.runes.length&&t.runes[0]===t.runes[1]){if(this.maybeConcat(t.runes[0],-2&this.flags))return null;t.op=ac.Op.LITERAL,t.runes=[t.runes[0]],t.flags=-2&this.flags}else if(t.op===ac.Op.CHAR_CLASS&&4===t.runes.length&&t.runes[0]===t.runes[1]&&t.runes[2]===t.runes[3]&&vB.simpleFold(t.runes[0])===t.runes[2]&&vB.simpleFold(t.runes[2])===t.runes[0]||t.op===ac.Op.CHAR_CLASS&&2===t.runes.length&&t.runes[0]+1===t.runes[1]&&vB.simpleFold(t.runes[0])===t.runes[1]&&vB.simpleFold(t.runes[1])===t.runes[0]){if(this.maybeConcat(t.runes[0],this.flags|aB.FOLD_CASE))return null;t.op=ac.Op.LITERAL,t.runes=[t.runes[0]],t.flags=this.flags|aB.FOLD_CASE}else this.maybeConcat(-1,0);return this.stack.push(t),this.checkLimits(t),t}maybeConcat(t,e){const n=this.stack.length;if(n<2)return!1;const s=this.stack[n-1],r=this.stack[n-2];if(s.op!==ac.Op.LITERAL||r.op!==ac.Op.LITERAL||(s.flags&aB.FOLD_CASE)!==(r.flags&aB.FOLD_CASE))return!1;Array.isArray(r.runes)||(r.runes=Array.from(r.runes));for(let t=0;t<s.runes.length;t++)r.runes.push(s.runes[t]);return t>=0?(s.runes=[t],s.flags=e,!0):(this.pop(),this.reuse(s),!1)}newLiteral(e,n){const s=this.newRegexp(ac.Op.LITERAL);return s.flags=n,0!==(n&aB.FOLD_CASE)&&(e=t.minFoldRune(e)),s.runes=[e],s}literal(t){this.push(this.newLiteral(t,this.flags))}op(t){const e=this.newRegexp(t);return e.flags=this.flags,this.push(e)}repeat(e,n,s,r,i,o){let a=this.flags;if(0!==(a&aB.PERL_X)&&(i.more()&&i.lookingAt("?")&&(i.skip(1),a^=aB.NON_GREEDY),-1!==o))throw new HB(t.ERR_INVALID_REPEAT_OP,i.from(o));const B=this.stack.length;if(0===B)throw new HB(t.ERR_MISSING_REPEAT_ARGUMENT,i.from(r));const c=this.stack[B-1];if(ac.isPseudoOp(c.op))throw new HB(t.ERR_MISSING_REPEAT_ARGUMENT,i.from(r));const l=this.newRegexp(e);if(l.min=n,l.max=s,l.flags=a,l.subs=[c],this.stack[B-1]=l,this.checkLimits(l),e===ac.Op.REPEAT&&(n>=2||s>=2)&&!this.repeatIsValid(l,1e3))throw new HB(t.ERR_INVALID_REPEAT_SIZE,i.from(r))}repeatIsValid(t,e){if(t.op===ac.Op.REPEAT){let n=t.max;if(0===n)return!0;if(n<0&&(n=t.min),n>e)return!1;n>0&&(e=Math.trunc(e/n))}for(let n of t.subs)if(!this.repeatIsValid(n,e))return!1;return!0}concat(){this.maybeConcat(-1,0);const t=this.popToPseudo();return 0===t.length?this.push(this.newRegexp(ac.Op.EMPTY_MATCH)):this.push(this.collapse(t,ac.Op.CONCAT))}alternate(){const t=this.popToPseudo();return t.length>0&&this.cleanAlt(t[t.length-1]),0===t.length?this.push(this.newRegexp(ac.Op.NO_MATCH)):this.push(this.collapse(t,ac.Op.ALTERNATE))}cleanAlt(t){t.op===ac.Op.CHAR_CLASS&&(t.runes=new Gc(Array.from(t.runes)).cleanClass().toArray(),2===t.runes.length&&0===t.runes[0]&&t.runes[1]===vB.MAX_RUNE?(t.runes=new Int32Array(0),t.op=ac.Op.ANY_CHAR):4===t.runes.length&&0===t.runes[0]&&t.runes[1]===mB.CODES["\n"]-1&&t.runes[2]===mB.CODES["\n"]+1&&t.runes[3]===vB.MAX_RUNE&&(t.runes=new Int32Array(0),t.op=ac.Op.ANY_CHAR_NOT_NL))}collapse(t,e){if(1===t.length)return t[0];let n=0;for(let s of t)n+=s.op===e?s.subs.length:1;let s=new Array(n).fill(null),r=0;for(let n of t)if(n.op===e){for(let t=0;t<n.subs.length;t++)s[r++]=n.subs[t];this.reuse(n)}else s[r++]=n;let i=this.newRegexp(e);if(i.subs=s,e===ac.Op.ALTERNATE&&(i.subs=this.factor(i.subs),1===i.subs.length)){const t=i;i=i.subs[0],this.reuse(t)}return i}factor(e){if(e.length<2)return e;let n=0,s=e.length,r=0,i=null,o=0,a=0,B=0;for(let t=0;t<=s;t++){let c=null,l=0,u=0;if(t<s){let s=e[n+t];if(s.op===ac.Op.CONCAT&&s.subs.length>0&&(s=s.subs[0]),s.op===ac.Op.LITERAL&&(c=s.runes,l=s.runes.length,u=s.flags&aB.FOLD_CASE),u===a){let t=0;for(;t<o&&t<l&&i[t]===c[t];)t++;if(t>0){o=t;continue}}}if(t===B);else if(t===B+1)e[r++]=e[n+B];else{const s=this.newRegexp(ac.Op.LITERAL);s.flags=a,s.runes=i.slice(0,o);for(let s=B;s<t;s++)e[n+s]=this.removeLeadingString(e[n+s],o),this.checkLimits(e[n+s]);const c=this.collapse(e.slice(n+B,n+t),ac.Op.ALTERNATE),l=this.newRegexp(ac.Op.CONCAT);l.subs=[s,c],e[r++]=l}B=t,i=c,o=l,a=u}s=r,n=0,B=0,r=0;let c=null;for(let i=0;i<=s;i++){let o=null;if(!(i<s&&(o=t.leadingRegexp(e[n+i]),null!==c&&c.equals(o)&&(t.isCharClass(c)||c.op===ac.Op.REPEAT&&c.min===c.max&&t.isCharClass(c.subs[0]))))){if(i===B);else if(i===B+1)e[r++]=e[n+B];else{const t=c;for(let t=B;t<i;t++){const s=t!==B;e[n+t]=this.removeLeadingRegexp(e[n+t],s),this.checkLimits(e[n+t])}const s=this.collapse(e.slice(n+B,n+i),ac.Op.ALTERNATE),o=this.newRegexp(ac.Op.CONCAT);o.subs=[t,s],e[r++]=o}B=i,c=o}}s=r,n=0,B=0,r=0;for(let i=0;i<=s;i++)if(!(i<s&&t.isCharClass(e[n+i]))){if(i===B);else if(i===B+1)e[r++]=e[n+B];else{let s=B;for(let t=B+1;t<i;t++){const r=e[n+s],i=e[n+t];(r.op<i.op||r.op===i.op&&(null!==r.runes?r.runes.length:0)<(null!==i.runes?i.runes.length:0))&&(s=t)}const o=e[n+B];e[n+B]=e[n+s],e[n+s]=o;for(let s=B+1;s<i;s++)t.mergeCharClass(e[n+B],e[n+s]),this.reuse(e[n+s]);this.cleanAlt(e[n+B]),e[r++]=e[n+B]}i<s&&(e[r++]=e[n+i]),B=i+1}s=r,n=0,B=0,r=0;for(let t=0;t<s;++t)t+1<s&&e[n+t].op===ac.Op.EMPTY_MATCH&&e[n+t+1].op===ac.Op.EMPTY_MATCH||(e[r++]=e[n+t]);return s=r,n=0,e.slice(n,s)}removeLeadingString(t,e){if(t.op===ac.Op.CONCAT&&t.subs.length>0){const n=this.removeLeadingString(t.subs[0],e);if(t.subs[0]=n,n.op===ac.Op.EMPTY_MATCH)switch(this.reuse(n),t.subs.length){case 0:case 1:t.op=ac.Op.EMPTY_MATCH,t.subs=ac.emptySubs();break;case 2:{const e=t;t=t.subs[1],this.reuse(e);break}default:t.subs=t.subs.slice(1,t.subs.length)}return t}return t.op===ac.Op.LITERAL&&(t.runes=t.runes.slice(e,t.runes.length),0===t.runes.length&&(t.op=ac.Op.EMPTY_MATCH)),t}removeLeadingRegexp(t,e){if(t.op===ac.Op.CONCAT&&t.subs.length>0){switch(e&&this.reuse(t.subs[0]),t.subs=t.subs.slice(1,t.subs.length),t.subs.length){case 0:t.op=ac.Op.EMPTY_MATCH,t.subs=ac.emptySubs();break;case 1:{const e=t;t=t.subs[0],this.reuse(e);break}}return t}return e&&this.reuse(t),this.newRegexp(ac.Op.EMPTY_MATCH)}parseInternal(){if(0!==(this.flags&aB.LITERAL))return t.literalRegexp(this.wholeRegexp,this.flags);let e=-1,n=-1,s=-1;const r=new Hc(this.wholeRegexp);for(;r.more();){let i=-1;t:switch(r.peek()){case mB.CODES["("]:if(0!==(this.flags&aB.LOOKBEHIND)){if(r.lookingAt("(?<=")){this.parsePosLookBehind(),r.skip(4);break}if(r.lookingAt("(?<!")){this.parseNegLookBehind(),r.skip(4);break}}if(0!==(this.flags&aB.PERL_X)&&r.lookingAt("(?")){this.parsePerlFlags(r);break}this.op(ac.Op.LEFT_PAREN).cap=++this.numCap,r.skip(1);break;case mB.CODES["|"]:this.parseVerticalBar(),r.skip(1);break;case mB.CODES[")"]:this.parseRightParen(),r.skip(1);break;case mB.CODES["^"]:0!==(this.flags&aB.ONE_LINE)?this.op(ac.Op.BEGIN_TEXT):this.op(ac.Op.BEGIN_LINE),r.skip(1);break;case mB.CODES.$:0!==(this.flags&aB.ONE_LINE)?this.op(ac.Op.END_TEXT).flags|=aB.WAS_DOLLAR:this.op(ac.Op.END_LINE),r.skip(1);break;case mB.CODES["."]:0!==(this.flags&aB.DOT_NL)?this.op(ac.Op.ANY_CHAR):this.op(ac.Op.ANY_CHAR_NOT_NL),r.skip(1);break;case mB.CODES["["]:this.parseClass(r);break;case mB.CODES["*"]:case mB.CODES["+"]:case mB.CODES["?"]:{i=r.pos();let t=null;switch(r.pop()){case mB.CODES["*"]:t=ac.Op.STAR;break;case mB.CODES["+"]:t=ac.Op.PLUS;break;case mB.CODES["?"]:t=ac.Op.QUEST}this.repeat(t,n,s,i,r,e);break}case mB.CODES["{"]:{const o=r.pos(),a=t.parseRepeat(r);if(a<0){r.rewindTo(o),this.literal(r.pop());break}i=o,n=a>>16,s=(a&vB.MAX_BMP)<<16>>16,this.repeat(ac.Op.REPEAT,n,s,i,r,e);break}case mB.CODES["\\"]:{const e=r.pos();if(r.skip(1),0!==(this.flags&aB.PERL_X)&&r.more())switch(r.pop()){case mB.CODES.A:this.op(ac.Op.BEGIN_TEXT);break t;case mB.CODES.b:this.op(ac.Op.WORD_BOUNDARY);break t;case mB.CODES.B:this.op(ac.Op.NO_WORD_BOUNDARY);break t;case mB.CODES.C:throw new HB(t.ERR_INVALID_ESCAPE,"\\C");case mB.CODES.Q:{let t=r.rest();const e=t.indexOf("\\E");e>=0?(t=t.substring(0,e),r.skipString(t),r.skipString("\\E")):r.skipString(t);let n=0;for(;n<t.length;){const e=t.codePointAt(n);this.literal(e),n+=AB.charCount(e)}break t}case mB.CODES.z:this.op(ac.Op.END_TEXT);break t;default:r.rewindTo(e)}else r.rewindTo(e);const n=this.newRegexp(ac.Op.CHAR_CLASS);if(n.flags=this.flags,r.lookingAt("\\p")||r.lookingAt("\\P")){const t=new Gc;if(this.parseUnicodeClass(r,t)){n.runes=t.toArray(),this.push(n);break t}}const s=new Gc;if(this.parsePerlClassEscape(r,s)){n.runes=s.toArray(),this.push(n);break t}r.rewindTo(e),this.reuse(n),this.literal(t.parseEscape(r));break}default:this.literal(r.pop())}e=i}if(this.concat(),this.swapVerticalBar()&&this.pop(),this.alternate(),1!==this.stack.length)throw new HB(t.ERR_MISSING_PAREN,this.wholeRegexp);return this.stack[0].namedGroups=this.namedGroups,this.stack[0]}parsePerlFlags(e){const n=e.pos(),s=e.rest();if(s.startsWith("(?P<")||s.startsWith("(?<")){const n="P"===s.charAt(2)?4:3,r=s.indexOf(">");if(r<0)throw new HB(t.ERR_INVALID_NAMED_CAPTURE,s);const i=s.substring(n,r);if(e.skipString(i),e.skip(n+1),!t.isValidCaptureName(i))throw new HB(t.ERR_INVALID_NAMED_CAPTURE,s.substring(0,r+1));const o=this.op(ac.Op.LEFT_PAREN);if(o.cap=++this.numCap,this.namedGroups[i])throw new HB(t.ERR_DUPLICATE_NAMED_CAPTURE,i);return this.namedGroups[i]=this.numCap,void(o.name=i)}e.skip(2);let r=this.flags,i=1,o=!1;t:for(;e.more();){const t=e.pop();switch(t){case mB.CODES.i:r|=aB.FOLD_CASE,o=!0;break;case mB.CODES.m:r&=-17,o=!0;break;case mB.CODES.s:r|=aB.DOT_NL,o=!0;break;case mB.CODES.U:r|=aB.NON_GREEDY,o=!0;break;case mB.CODES["-"]:if(i<0)break t;i=-1,r=~r,o=!1;break;case mB.CODES[":"]:case mB.CODES[")"]:if(i<0){if(!o)break t;r=~r}return t===mB.CODES[":"]&&this.op(ac.Op.LEFT_PAREN),void(this.flags=r);default:break t}}throw new HB(t.ERR_INVALID_PERL_OP,e.from(n))}parsePosLookBehind(){const t=this.newRegexp(ac.Op.LEFT_PAREN);return t.flags=this.flags,t.lb=++this.nlb,this.push(t)}parseNegLookBehind(){const t=this.newRegexp(ac.Op.LEFT_PAREN);return t.flags=this.flags,t.lb=-++this.nlb,this.push(t)}parseVerticalBar(){this.concat(),this.swapVerticalBar()||this.op(ac.Op.VERTICAL_BAR)}swapVerticalBar(){const e=this.stack.length;if(e>=3&&this.stack[e-2].op===ac.Op.VERTICAL_BAR&&t.isCharClass(this.stack[e-1])&&t.isCharClass(this.stack[e-3])){let n=this.stack[e-1],s=this.stack[e-3];if(n.op>s.op){const t=s;s=n,n=t,this.stack[e-3]=s}return t.mergeCharClass(s,n),this.reuse(n),this.pop(),!0}if(e>=2){const t=this.stack[e-1],n=this.stack[e-2];if(n.op===ac.Op.VERTICAL_BAR)return e>=3&&this.cleanAlt(this.stack[e-3]),this.stack[e-2]=t,this.stack[e-1]=n,!0}return!1}parseRightParen(){if(this.concat(),this.swapVerticalBar()&&this.pop(),this.alternate(),this.stack.length<2)throw new HB(t.ERR_UNEXPECTED_PAREN,this.wholeRegexp);const e=this.pop(),n=this.pop();if(n.op!==ac.Op.LEFT_PAREN)throw new HB(t.ERR_UNEXPECTED_PAREN,this.wholeRegexp);if(this.flags=n.flags,0!==n.lb){if(t.hasCapture(e))throw new HB(t.ERR_INVALID_CAPTURE_IN_LOOKBEHIND,this.wholeRegexp);return n.lb>0?n.op=ac.Op.PLB:n.op=ac.Op.NLB,n.subs=[e],void this.push(n)}0===n.cap?this.push(e):(n.op=ac.Op.CAPTURE,n.subs=[e],this.push(n))}parsePerlClassEscape(t,e){const n=t.pos();if(0===(this.flags&aB.PERL_X)||!t.more()||t.pop()!==mB.CODES["\\"]||!t.more())return!1;t.pop();const s=t.from(n),r=_c.has(s)?_c.get(s):null;return null!==r&&(e.appendGroup(r,0!==(this.flags&aB.FOLD_CASE)),!0)}parseNamedClass(e,n){const s=e.rest(),r=s.indexOf(":]");if(r<0)return!1;const i=s.substring(0,r+2);e.skipString(i);const o=Mc.has(i)?Mc.get(i):null;if(null===o)throw new HB(t.ERR_INVALID_CHAR_RANGE,i);return n.appendGroup(o,0!==(this.flags&aB.FOLD_CASE)),!0}parseUnicodeClass(e,n){const s=e.pos();if(0===(this.flags&aB.UNICODE_GROUPS)||!e.lookingAt("\\p")&&!e.lookingAt("\\P"))return!1;e.skip(1);let r,i=1,o=e.pop();if(o===mB.CODES.P&&(i=-1),!e.more())throw e.rewindTo(s),new HB(t.ERR_INVALID_CHAR_RANGE,e.rest());if(o=e.pop(),o!==mB.CODES["{"])r=AB.runeToString(o);else{const n=e.rest(),i=n.indexOf("}");if(i<0)throw e.rewindTo(s),new HB(t.ERR_INVALID_CHAR_RANGE,e.rest());r=n.substring(0,i),e.skipString(r),e.skip(1)}0!==r.length&&r.codePointAt(0)===mB.CODES["^"]&&(i=0-i,r=r.substring(1));const a=t.unicodeTable(r);if(null===a)throw new HB(t.ERR_INVALID_CHAR_RANGE,e.from(s));a.sign<0&&(i=0-i);const B=a.tab,c=a.fold;if(0===(this.flags&aB.FOLD_CASE)||null===c)n.appendTableWithSign(B,i);else{const t=(new Gc).appendTable(B).appendTable(c).cleanClass().toArray();n.appendClassWithSign(Array.from(t),i)}return!0}parseClass(e){const n=e.pos();e.skip(1);const s=this.newRegexp(ac.Op.CHAR_CLASS);s.flags=this.flags;const r=new Gc;let i=1;e.more()&&e.lookingAt("^")&&(i=-1,e.skip(1),0===(this.flags&aB.CLASS_NL)&&r.appendRange(mB.CODES["\n"],mB.CODES["\n"]));let o=!0;for(;!e.more()||e.peek()!==mB.CODES["]"]||o;){if(e.more()&&e.lookingAt("-")&&0===(this.flags&aB.PERL_X)&&!o){const s=e.rest();if("-"===s||!s.startsWith("-]"))throw e.rewindTo(n),new HB(t.ERR_INVALID_CHAR_RANGE,e.rest())}o=!1;const s=e.pos();if(e.lookingAt("[:")){if(this.parseNamedClass(e,r))continue;e.rewindTo(s)}if(this.parseUnicodeClass(e,r))continue;if(this.parsePerlClassEscape(e,r))continue;e.rewindTo(s);const i=t.parseClassChar(e,n);let a=i;if(e.more()&&e.lookingAt("-"))if(e.skip(1),e.more()&&e.lookingAt("]"))e.skip(-1);else if(a=t.parseClassChar(e,n),a<i)throw new HB(t.ERR_INVALID_CHAR_RANGE,e.from(s));0===(this.flags&aB.FOLD_CASE)?r.appendRange(i,a):r.appendFoldedRange(i,a)}e.skip(1),r.cleanClass(),i<0&&r.negateClass(),s.runes=r.toArray(),this.push(s)}},Vc=class t{static initTest(e){const n=t.compile(e),s=new t(n.expr,n.prog,n.numSubexp,n.longest);return s.cond=n.cond,s.prefix=n.prefix,s.prefixUTF8=n.prefixUTF8,s.prefixComplete=n.prefixComplete,s.prefixRune=n.prefixRune,s.prefilter=n.prefilter,s.namedGroups=n.namedGroups,s}static compile(e){return t.compileImpl(e,aB.PERL,!1)}static compilePOSIX(e){return t.compileImpl(e,aB.POSIX,!0)}static compileImpl(e,n,s){let r=Uc.parse(e,n);const i=r.maxCap(),o=r.namedGroups;r=mc.simplify(r);const a=uc.build(r),B=gc.compileRegexp(r),c=new t(e,B,i,s);c.prefilter=a.type===lc.Type.NONE?null:a;const[l,u]=B.prefix();return c.prefixComplete=l,c.prefix=u,c.prefixUTF8=AB.stringToUtf8ByteArray(c.prefix),c.prefix.length>0&&(c.prefixRune=c.prefix.codePointAt(0)),c.namedGroups=o,c}static match(e,n){return t.compile(e).match(n)}constructor(t,e,n=0,s=0){this.expr=t,this.prog=e,this.numSubexp=n,this.longest=s,this.cond=e.startCond(),this.prefix=null,this.prefixUTF8=null,this.prefixComplete=!1,this.prefixRune=0,this.namedGroups=Object.create(null),this.machinePool=[],this.lazyDFA=null,this.onepass=oc.compile(this.prog),this.prefilter=null}get dfa(){return null===this.lazyDFA&&(this.lazyDFA=new tc(this.prog)),this.lazyDFA}matchPrefixComplete(t,e,n,s){if((n===aB.ANCHOR_START||n===aB.ANCHOR_BOTH)&&0!==e)return null;let r=-1,i=-1;const o=t.prefixLength(this);if(n===aB.UNANCHORED){const n=t.index(this,e);if(n<0)return null;r=e+n,i=r+o}else if(n===aB.ANCHOR_BOTH){if(t.endPos()!==o)return null;if(0!==t.index(this,0))return null;r=0,i=o}else if(n===aB.ANCHOR_START){if(0!==t.index(this,0))return null;r=0,i=o}if(r<0)return null;if(s>0){const t=new Int32Array(s).fill(-1);return t[0]=r,t[1]=i,Array.from(t)}return[]}createLookbehindState(){return this.prog.numLb>0?new KB(this.prog):null}executeEngine(t,e,n,s,r=null){if(this.prefixComplete&&(0===s||0===this.numSubexp))return this.matchPrefixComplete(t,e,n,s);if(null!==this.prefilter&&n===aB.UNANCHORED&&!this.prefilter.eval(t,e))return null;if(null!==this.onepass)return oc.execute(this,t,e,n,s);if(s>0)return 0===this.prog.numLb&&t.endPos()<=sc.maxBitStateLen(this.prog)?sc.execute(this,t,e,n,s):this.doExecuteNFA(t,e,n,s,r);if(0===this.prog.numLb){const r=this.dfa.match(t,e,n);if(null!==r)return r?[]:null;if(t.endPos()<=sc.maxBitStateLen(this.prog))return sc.execute(this,t,e,n,s)}return this.doExecuteNFA(t,e,n,s,r)}numberOfCapturingGroups(){return this.numSubexp}numberOfInstructions(){return this.prog.numInst()}get(){return this.machinePool.length>0?this.machinePool.pop():null}reset(){this.machinePool.length=0}put(t){this.machinePool.push(t)}toString(){return this.expr}doExecuteNFA(t,e,n,s,r=null){let i=this.get();i||(i=QB.fromRE2(this)),i.init(s);const o=i.match(t,e,n,r)?i.submatches():null;return this.put(i),o}match(t){return null!==this.executeEngine(MB.fromUTF16(t),0,aB.UNANCHORED,0)}matchWithGroup(t,e,n,s,r,i=null){return t instanceof RB||(t=AB.isByteArray(t)?kB.utf8(t):kB.utf16(t)),this.matchMachineInput(t,e,n,s,r,i)}matchMachineInput(t,e,n,s,r,i=null){if(e>n)return[!1,null];const o=t.isUTF16Encoding()?MB.fromUTF16(t.asCharSequence(),0,n):MB.fromUTF8(t.asBytes(),0,n),a=this.executeEngine(o,e,s,2*r,i);return null===a?[!1,null]:[!0,a]}matchUTF8(t){return null!==this.executeEngine(MB.fromUTF8(t),0,aB.UNANCHORED,0)}replaceAll(t,e){return this.replaceAllFunc(t,()=>e,2*t.length+1)}replaceFirst(t,e){return this.replaceAllFunc(t,()=>e,1)}replaceAllFunc(t,e,n){let s=0,r=0,i="";const o=MB.fromUTF16(t),a=this.createLookbehindState();let B=0;for(;r<=t.length;){const c=this.executeEngine(o,r,aB.UNANCHORED,2,a);if(null===c||0===c.length)break;i+=t.substring(s,c[0]),(c[1]>s||0===c[0])&&(i+=e(t.substring(c[0],c[1])),B++),s=c[1];const l=7&o.step(r);if(r+l>c[1]?r+=l:r+1>c[1]?r++:r=c[1],B>=n)break}return i+=t.substring(s),i}pad(t){if(null===t)return null;let e=2*(1+this.numSubexp);if(t.length<e){let n=new Array(e).fill(-1);for(let e=0;e<t.length;e++)n[e]=t[e];t=n}return t}allMatches(t,e,n=t=>t){let s=[];const r=t.endPos();e<0&&(e=r+1);let i=0,o=0,a=-1;const B=this.createLookbehindState();for(;o<e&&i<=r;){const e=this.executeEngine(t,i,aB.UNANCHORED,this.prog.numCap,B);if(null===e||0===e.length)break;let c=!0;if(e[1]===i){e[0]===a&&(c=!1);const n=t.step(i);n<0?i=r+1:i+=7&n}else i=e[1];a=e[1],c&&(s.push(n(this.pad(e))),o++)}return s}findUTF8(t){const e=this.executeEngine(MB.fromUTF8(t),0,aB.UNANCHORED,2);return null===e?null:t.slice(e[0],e[1])}findUTF8Index(t){const e=this.executeEngine(MB.fromUTF8(t),0,aB.UNANCHORED,2);return null===e?null:e.slice(0,2)}find(t){const e=this.executeEngine(MB.fromUTF16(t),0,aB.UNANCHORED,2);return null===e?"":t.substring(e[0],e[1])}findIndex(t){return this.executeEngine(MB.fromUTF16(t),0,aB.UNANCHORED,2)}findUTF8Submatch(t){const e=this.executeEngine(MB.fromUTF8(t),0,aB.UNANCHORED,this.prog.numCap);if(null===e)return null;const n=new Array(1+this.numSubexp).fill(null);for(let s=0;s<n.length;s++)2*s<e.length&&e[2*s]>=0&&(n[s]=t.slice(e[2*s],e[2*s+1]));return n}findUTF8SubmatchIndex(t){return this.pad(this.executeEngine(MB.fromUTF8(t),0,aB.UNANCHORED,this.prog.numCap))}findSubmatch(t){const e=this.executeEngine(MB.fromUTF16(t),0,aB.UNANCHORED,this.prog.numCap);if(null===e)return null;const n=new Array(1+this.numSubexp).fill(null);for(let s=0;s<n.length;s++)2*s<e.length&&e[2*s]>=0&&(n[s]=t.substring(e[2*s],e[2*s+1]));return n}findSubmatchIndex(t){return this.pad(this.executeEngine(MB.fromUTF16(t),0,aB.UNANCHORED,this.prog.numCap))}findAllUTF8(t,e){const n=this.allMatches(MB.fromUTF8(t),e,e=>t.slice(e[0],e[1]));return 0===n.length?null:n}findAllUTF8Index(t,e){const n=this.allMatches(MB.fromUTF8(t),e,t=>t.slice(0,2));return 0===n.length?null:n}findAll(t,e){const n=this.allMatches(MB.fromUTF16(t),e,e=>t.substring(e[0],e[1]));return 0===n.length?null:n}findAllIndex(t,e){const n=this.allMatches(MB.fromUTF16(t),e,t=>t.slice(0,2));return 0===n.length?null:n}findAllUTF8Submatch(t,e){const n=this.allMatches(MB.fromUTF8(t),e,e=>{let n=new Array(e.length/2|0).fill(null);for(let s=0;s<n.length;s++)e[2*s]>=0&&(n[s]=t.slice(e[2*s],e[2*s+1]));return n});return 0===n.length?null:n}findAllUTF8SubmatchIndex(t,e){const n=this.allMatches(MB.fromUTF8(t),e);return 0===n.length?null:n}findAllSubmatch(t,e){const n=this.allMatches(MB.fromUTF16(t),e,e=>{let n=new Array(e.length/2|0).fill(null);for(let s=0;s<n.length;s++)e[2*s]>=0&&(n[s]=t.substring(e[2*s],e[2*s+1]));return n});return 0===n.length?null:n}findAllSubmatchIndex(t,e){const n=this.allMatches(MB.fromUTF16(t),e);return 0===n.length?null:n}},jc=class t{static isHexadecimal(t){return"0"<=t&&t<="9"||"A"<=t&&t<="F"||"a"<=t&&t<="f"}static translate(e){let n="";if(e instanceof RegExp&&(e.ignoreCase&&(n+="i"),e.multiline&&(n+="m"),e.dotAll&&(n+="s"),e=e.source),"string"!=typeof e)return e;let s="",r=!1,i=e.length;0===i&&(s="(?:)",r=!0);let o=!1,a=0;for(;a<i;){let n=e[a];if("\\"===n){if(a+1<i)switch(n=e[a+1],n){case"\\":s+="\\\\",a+=2;continue;case"c":if(a+2<i){let t=e[a+2].charCodeAt(0);if(t>=65&&t<=90||t>=97&&t<=122){let e=t%32;s+="\\x",s+=(e>>4).toString(16).toUpperCase(),s+=(15&e).toString(16).toUpperCase(),a+=3,r=!0;continue}}s+="c",a+=2,r=!0;continue;case"u":if(a+2<i)if("{"===e[a+2]){let n=a+3,o=!1,B=!1;for(;n<i;){const s=e[n];if("}"===s){B=!0;break}if(!t.isHexadecimal(s))break;o=!0,n++}if(B&&o){s+="\\x",a+=2,r=!0;continue}}else if(a+5<i){let n=!0;for(let s=0;s<4;s++)if(!t.isHexadecimal(e[a+2+s])){n=!1;break}if(n){s+="\\x{"+e.substring(a+2,a+6)+"}",a+=6,r=!0;continue}}s+="u",a+=2,r=!0;continue;case"x":{let n=!1;if(a+2<i&&"{"===e[a+2]){let s=a+3,r=!1,o=!1;for(;s<i;){const n=e[s];if("}"===n){o=!0;break}if(!t.isHexadecimal(n))break;r=!0,s++}o&&r&&(n=!0)}else a+3<i&&t.isHexadecimal(e[a+2])&&t.isHexadecimal(e[a+3])&&(n=!0);n?(s+="\\x",a+=2):(s+="x",a+=2,r=!0);continue}case"n":case"r":case"t":case"a":case"f":case"v":case"d":case"D":case"s":case"S":case"w":case"W":case"b":case"B":case"p":case"P":case"A":case"z":case"Q":case"E":case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":s+="\\"+n,a+=2;continue;default:{let t=e.codePointAt(a+1);if(t>=48&&t<=57||t>=65&&t<=90||t>=97&&t<=122){let n=AB.charCount(t);s+=e.substring(a+1,a+1+n),a+=n+1,r=!0}else{s+="\\";let n=AB.charCount(t);s+=e.substring(a+1,a+1+n),a+=n+1}continue}}}else{if("/"===n){s+="\\/",a+=1,r=!0;continue}if("["===n){if(!o&&"]"===e[a+1]){s+="[^\\x00-\\x{10FFFF}]",a+=2,r=!0;continue}if(!o&&"^"===e[a+1]&&"]"===e[a+2]){s+="[\\x00-\\x{10FFFF}]",a+=3,r=!0;continue}o=!0}else if("]"===n)o=!1;else if(!o&&"("===n&&a+2<i&&"?"===e[a+1]&&"<"===e[a+2]&&a+3<i&&!"=!>)".includes(e[a+3])){s+="(?P<",a+=3,r=!0;continue}}let B=e.codePointAt(a),c=AB.charCount(B);s+=e.substring(a,a+c),a+=c}const B=r?s:e;return n.length>0?`(?${n})${B}`:B}};const $c=(t,e)=>{const n=t.matchArray();return n.index=t.start(0),n.input=e,n.groups=t.namedGroupsObject(),n};var Jc=class t{static CASE_INSENSITIVE=BB;static DOTALL=cB;static MULTILINE=lB;static DISABLE_UNICODE_GROUPS=uB;static LONGEST_MATCH=hB;static LOOKBEHINDS=dB;static quote(t){return AB.quoteMeta(t)}static quoteReplacement(t,e=!1){return JB.quoteReplacement(t,e)}static translateRegExp(t){return jc.translate(t)}static compile(e,n=0){let s=e;if(0!==(n&t.CASE_INSENSITIVE)&&(s=`(?i)${s}`),0!==(n&t.DOTALL)&&(s=`(?s)${s}`),0!==(n&t.MULTILINE)&&(s=`(?m)${s}`),-544&n)throw new jB("Flags should only be a combination of MULTILINE, DOTALL, CASE_INSENSITIVE, DISABLE_UNICODE_GROUPS, LONGEST_MATCH, LOOKBEHINDS");let r=aB.PERL;0!==(n&t.DISABLE_UNICODE_GROUPS)&&(r&=-129),0!==(n&t.LOOKBEHINDS)&&(r|=aB.LOOKBEHIND);const i=new t(e,n);return i.re2Input=Vc.compileImpl(s,r,0!==(n&t.LONGEST_MATCH)),i}static matches(e,n){return t.compile(e).testExact(n)}static initTest(e,n,s){if(null==e)throw new Error("pattern is null");if(null==s)throw new Error("re2 is null");const r=new t(e,n);return r.re2Input=s,r}constructor(t,e){this.patternInput=t,this.flagsInput=e,this.re2Input=null}reset(){this.re2Input.reset()}flags(){return this.flagsInput}pattern(){return this.patternInput}re2(){return this.re2Input}matches(t){return this.testExact(t)}matcher(t){return AB.isByteArray(t)&&(t=kB.utf8(t)),new JB(this,t)}test(t){return AB.isByteArray(t)?this.re2Input.matchUTF8(t):this.re2Input.match(t)}testExact(t){const e=AB.isByteArray(t)?MB.fromUTF8(t):MB.fromUTF16(t);return null!==this.re2Input.executeEngine(e,0,aB.ANCHOR_BOTH,0)}exec(t){const e=this.matcher(t);return e.find()?$c(e,t):null}split(t,e=0){const n=this.matcher(t),s=[];let r=0,i=0;for(;n.find();)if(0!==i||0!==n.end()){if(e>0&&s.length===e-1)break;if(i===n.start()){if(0===e){r+=1,i=n.end();continue}}else for(;r>0;)s.push(""),r-=1;s.push(n.substring(i,n.start())),i=n.end()}else i=n.end();if(0===e&&i!==n.inputLength()){for(;r>0;)s.push(""),r-=1;s.push(n.substring(i,n.inputLength()))}return 0===e&&(0!==s.length||i===n.inputLength()&&i>0)||s.push(n.substring(i,n.inputLength())),s}*matchAll(t){const e=this.matcher(t);for(;e.find();)yield $c(e,t)}toString(){return this.patternInput}programSize(){return this.re2Input.numberOfInstructions()}groupCount(){return this.re2Input.numberOfCapturingGroups()}namedGroups(){return this.re2Input.namedGroups}equals(t){return this===t||null!==t&&this.constructor===t.constructor&&(this.flagsInput===t.flagsInput&&this.patternInput===t.patternInput)}};let qc="12.19.0";const zc=new ls("@firebase/firestore");function Kc(){return zc.logLevel}function Qc(t,...e){if(zc.logLevel<=is.DEBUG){const n=e.map(Xc);zc.debug(`Firestore (${qc}): ${t}`,...n)}}function Wc(t,...e){if(zc.logLevel<=is.ERROR){const n=e.map(Xc);zc.error(`Firestore (${qc}): ${t}`,...n)}}function Yc(t,...e){if(zc.logLevel<=is.WARN){const n=e.map(Xc);zc.warn(`Firestore (${qc}): ${t}`,...n)}}function Xc(t){if("string"==typeof t)return t;try{return function(t){return JSON.stringify(t)}(t)}catch(e){return t}}function Zc(t,e,n){let s="Unexpected state";"string"==typeof e?s=e:n=e,tl(t,s,n)}function tl(t,e,n){let s=`FIRESTORE (${qc}) INTERNAL ASSERTION FAILED: ${e} (ID: ${t.toString(16)})`;if(void 0!==n)try{s+=" CONTEXT: "+JSON.stringify(n)}catch(t){s+=" CONTEXT: "+n}throw Wc(s),new Error(s)}function el(t,e,n,s){let r="Unexpected state";"string"==typeof n?r=n:s=n,t||tl(e,r,s)}function nl(t,e){return t}function sl(t){const e="undefined"!=typeof self&&(self.crypto||self.msCrypto),n=new Uint8Array(t);if(e&&"function"==typeof e.getRandomValues)e.getRandomValues(n);else for(let e=0;e<t;e++)n[e]=Math.floor(256*Math.random());return n}class rl{static newId(){const t=62*Math.floor(256/62);let e="";for(;e.length<20;){const n=sl(40);for(let s=0;s<n.length;++s)e.length<20&&n[s]<t&&(e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".charAt(n[s]%62))}return e}}function il(t,e){return t<e?-1:t>e?1:0}function ol(t,e){const n=Math.min(t.length,e.length);for(let s=0;s<n;s++){const n=t.charAt(s),r=e.charAt(s);if(n!==r)return cl(n)===cl(r)?il(n,r):cl(n)?1:-1}return il(t.length,e.length)}const al=55296,Bl=57343;function cl(t){const e=t.charCodeAt(0);return e>=al&&e<=Bl}function ll(t,e,n){return t.length===e.length&&t.every((t,s)=>n(t,e[s]))}class ul{constructor(t,e){this.comparator=t,this.root=e||dl.EMPTY}insert(t,e){return new ul(this.comparator,this.root.insert(t,e,this.comparator).copy(null,null,dl.BLACK,null,null))}remove(t){return new ul(this.comparator,this.root.remove(t,this.comparator).copy(null,null,dl.BLACK,null,null))}get(t){let e=this.root;for(;!e.isEmpty();){const n=this.comparator(t,e.key);if(0===n)return e.value;n<0?e=e.left:n>0&&(e=e.right)}return null}indexOf(t){let e=0,n=this.root;for(;!n.isEmpty();){const s=this.comparator(t,n.key);if(0===s)return e+n.left.size;s<0?n=n.left:(e+=n.left.size+1,n=n.right)}return-1}isEmpty(){return this.root.isEmpty()}get size(){return this.root.size}minKey(){return this.root.minKey()}maxKey(){return this.root.maxKey()}inorderTraversal(t){return this.root.inorderTraversal(t)}forEach(t){this.inorderTraversal((e,n)=>(t(e,n),!1))}toString(){const t=[];return this.inorderTraversal((e,n)=>(t.push(`${e}:${n}`),!1)),`{${t.join(", ")}}`}reverseTraversal(t){return this.root.reverseTraversal(t)}getIterator(){return new hl(this.root,null,this.comparator,!1)}getIteratorFrom(t){return new hl(this.root,t,this.comparator,!1)}getReverseIterator(){return new hl(this.root,null,this.comparator,!0)}getReverseIteratorFrom(t){return new hl(this.root,t,this.comparator,!0)}}class hl{constructor(t,e,n,s){this.isReverse=s,this.nodeStack=[];let r=1;for(;!t.isEmpty();)if(r=e?n(t.key,e):1,e&&s&&(r*=-1),r<0)t=this.isReverse?t.left:t.right;else{if(0===r){this.nodeStack.push(t);break}this.nodeStack.push(t),t=this.isReverse?t.right:t.left}}getNext(){let t=this.nodeStack.pop();const e={key:t.key,value:t.value};if(this.isReverse)for(t=t.left;!t.isEmpty();)this.nodeStack.push(t),t=t.right;else for(t=t.right;!t.isEmpty();)this.nodeStack.push(t),t=t.left;return e}hasNext(){return this.nodeStack.length>0}peek(){if(0===this.nodeStack.length)return null;const t=this.nodeStack[this.nodeStack.length-1];return{key:t.key,value:t.value}}}class dl{constructor(t,e,n,s,r){this.key=t,this.value=e,this.color=null!=n?n:dl.RED,this.left=null!=s?s:dl.EMPTY,this.right=null!=r?r:dl.EMPTY,this.size=this.left.size+1+this.right.size}copy(t,e,n,s,r){return new dl(null!=t?t:this.key,null!=e?e:this.value,null!=n?n:this.color,null!=s?s:this.left,null!=r?r:this.right)}isEmpty(){return!1}inorderTraversal(t){return this.left.inorderTraversal(t)||t(this.key,this.value)||this.right.inorderTraversal(t)}reverseTraversal(t){return this.right.reverseTraversal(t)||t(this.key,this.value)||this.left.reverseTraversal(t)}min(){return this.left.isEmpty()?this:this.left.min()}minKey(){return this.min().key}maxKey(){return this.right.isEmpty()?this.key:this.right.maxKey()}insert(t,e,n){let s=this;const r=n(t,s.key);return s=r<0?s.copy(null,null,null,s.left.insert(t,e,n),null):0===r?s.copy(null,e,null,null,null):s.copy(null,null,null,null,s.right.insert(t,e,n)),s.fixUp()}removeMin(){if(this.left.isEmpty())return dl.EMPTY;let t=this;return t.left.isRed()||t.left.left.isRed()||(t=t.moveRedLeft()),t=t.copy(null,null,null,t.left.removeMin(),null),t.fixUp()}remove(t,e){let n,s=this;if(e(t,s.key)<0)s.left.isEmpty()||s.left.isRed()||s.left.left.isRed()||(s=s.moveRedLeft()),s=s.copy(null,null,null,s.left.remove(t,e),null);else{if(s.left.isRed()&&(s=s.rotateRight()),s.right.isEmpty()||s.right.isRed()||s.right.left.isRed()||(s=s.moveRedRight()),0===e(t,s.key)){if(s.right.isEmpty())return dl.EMPTY;n=s.right.min(),s=s.copy(n.key,n.value,null,null,s.right.removeMin())}s=s.copy(null,null,null,null,s.right.remove(t,e))}return s.fixUp()}isRed(){return this.color}fixUp(){let t=this;return t.right.isRed()&&!t.left.isRed()&&(t=t.rotateLeft()),t.left.isRed()&&t.left.left.isRed()&&(t=t.rotateRight()),t.left.isRed()&&t.right.isRed()&&(t=t.colorFlip()),t}moveRedLeft(){let t=this.colorFlip();return t.right.left.isRed()&&(t=t.copy(null,null,null,null,t.right.rotateRight()),t=t.rotateLeft(),t=t.colorFlip()),t}moveRedRight(){let t=this.colorFlip();return t.left.left.isRed()&&(t=t.rotateRight(),t=t.colorFlip()),t}rotateLeft(){const t=this.copy(null,null,dl.RED,null,this.right.left);return this.right.copy(null,null,this.color,t,null)}rotateRight(){const t=this.copy(null,null,dl.RED,this.left.right,null);return this.left.copy(null,null,this.color,null,t)}colorFlip(){const 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)}checkMaxDepth(){const t=this.check();return Math.pow(2,t)<=this.size+1}check(){if(this.isRed()&&this.left.isRed())throw Zc(43730,{key:this.key,value:this.value});if(this.right.isRed())throw Zc(14113,{key:this.key,value:this.value});const t=this.left.check();if(t!==this.right.check())throw Zc(27949);return t+(this.isRed()?0:1)}}dl.EMPTY=null,dl.RED=!0,dl.BLACK=!1,dl.EMPTY=new class{constructor(){this.size=0}get key(){throw Zc(57766)}get value(){throw Zc(16141)}get color(){throw Zc(16727)}get left(){throw Zc(29726)}get right(){throw Zc(36894)}copy(t,e,n,s,r){return this}insert(t,e,n){return new dl(t,e)}remove(t,e){return this}isEmpty(){return!0}inorderTraversal(t){return!1}reverseTraversal(t){return!1}minKey(){return null}maxKey(){return null}isRed(){return!1}checkMaxDepth(){return!0}check(){return 0}};class pl{constructor(t){this.comparator=t,this.data=new ul(this.comparator)}has(t){return null!==this.data.get(t)}first(){return this.data.minKey()}last(){return this.data.maxKey()}get size(){return this.data.size}indexOf(t){return this.data.indexOf(t)}forEach(t){this.data.inorderTraversal((e,n)=>(t(e),!1))}forEachInRange(t,e){const n=this.data.getIteratorFrom(t[0]);for(;n.hasNext();){const s=n.getNext();if(this.comparator(s.key,t[1])>=0)return;e(s.key)}}forEachWhile(t,e){let n;for(n=void 0!==e?this.data.getIteratorFrom(e):this.data.getIterator();n.hasNext();)if(!t(n.getNext().key))return}firstAfterOrEqual(t){const e=this.data.getIteratorFrom(t);return e.hasNext()?e.getNext().key:null}getIterator(){return new fl(this.data.getIterator())}getIteratorFrom(t){return new fl(this.data.getIteratorFrom(t))}add(t){return this.copy(this.data.remove(t).insert(t,!0))}delete(t){return this.has(t)?this.copy(this.data.remove(t)):this}isEmpty(){return this.data.isEmpty()}unionWith(t){let e=this;return e.size<t.size&&(e=t,t=this),t.forEach(t=>{e=e.add(t)}),e}isEqual(t){if(!(t instanceof pl))return!1;if(this.size!==t.size)return!1;const e=this.data.getIterator(),n=t.data.getIterator();for(;e.hasNext();){const t=e.getNext().key,s=n.getNext().key;if(0!==this.comparator(t,s))return!1}return!0}toArray(){const t=[];return this.forEach(e=>{t.push(e)}),t}toString(){const t=[];return this.forEach(e=>t.push(e)),"SortedSet("+t.toString()+")"}copy(t){const e=new pl(this.comparator);return e.data=t,e}}class fl{constructor(t){this.iter=t}getNext(){return this.iter.getNext().key}hasNext(){return this.iter.hasNext()}}const Cl={OK:"ok",CANCELLED:"cancelled",UNKNOWN:"unknown",INVALID_ARGUMENT:"invalid-argument",DEADLINE_EXCEEDED:"deadline-exceeded",NOT_FOUND:"not-found",ALREADY_EXISTS:"already-exists",PERMISSION_DENIED:"permission-denied",UNAUTHENTICATED:"unauthenticated",RESOURCE_EXHAUSTED:"resource-exhausted",FAILED_PRECONDITION:"failed-precondition",ABORTED:"aborted",OUT_OF_RANGE:"out-of-range",UNIMPLEMENTED:"unimplemented",INTERNAL:"internal",UNAVAILABLE:"unavailable",DATA_LOSS:"data-loss"};class gl extends Vn{constructor(t,e){super(t,e),this.code=t,this.message=e,this.toString=()=>`${this.name}: [code=${this.code}]: ${this.message}`}}const ml="__name__";class wl{constructor(t,e,n){void 0===e?e=0:e>t.length&&Zc(637,{offset:e,range:t.length}),void 0===n?n=t.length-e:n>t.length-e&&Zc(1746,{length:n,range:t.length-e}),this.segments=t,this.offset=e,this.len=n}get length(){return this.len}isEqual(t){return 0===wl.comparator(this,t)}child(t){const e=this.segments.slice(this.offset,this.limit());return t instanceof wl?t.forEach(t=>{e.push(t)}):e.push(t),this.construct(e)}limit(){return this.offset+this.length}popFirst(t){return t=void 0===t?1:t,this.construct(this.segments,this.offset+t,this.length-t)}popLast(){return this.construct(this.segments,this.offset,this.length-1)}firstSegment(){return this.segments[this.offset]}lastSegment(){return this.get(this.length-1)}get(t){return this.segments[this.offset+t]}isEmpty(){return 0===this.length}isPrefixOf(t){if(t.length<this.length)return!1;for(let e=0;e<this.length;e++)if(this.get(e)!==t.get(e))return!1;return!0}isImmediateParentOf(t){if(this.length+1!==t.length)return!1;for(let e=0;e<this.length;e++)if(this.get(e)!==t.get(e))return!1;return!0}forEach(t){for(let e=this.offset,n=this.limit();e<n;e++)t(this.segments[e])}toArray(){return this.segments.slice(this.offset,this.limit())}static comparator(t,e){const n=Math.min(t.length,e.length);for(let s=0;s<n;s++){const n=wl.compareSegments(t.get(s),e.get(s));if(0!==n)return n}return il(t.length,e.length)}static compareSegments(t,e){const n=wl.isNumericId(t),s=wl.isNumericId(e);return n&&!s?-1:!n&&s?1:n&&s?wl.extractNumericId(t).compare(wl.extractNumericId(e)):ol(t,e)}static isNumericId(t){return t.startsWith("__id")&&t.endsWith("__")}static extractNumericId(t){return Wa.fromString(t.substring(4,t.length-2))}}class yl extends wl{construct(t,e,n){return new yl(t,e,n)}canonicalString(){return this.toArray().join("/")}toString(){return this.canonicalString()}toStringWithLeadingSlash(){return`/${this.canonicalString()}`}toUriEncodedString(){return this.toArray().map(encodeURIComponent).join("/")}static fromString(...t){const e=[];for(const n of t){if(n.indexOf("//")>=0)throw new gl(Cl.INVALID_ARGUMENT,`Invalid segment (${n}). Paths must not contain // in them.`);e.push(...n.split("/").filter(t=>t.length>0))}return new yl(e)}static emptyPath(){return new yl([])}}const El=/^[_a-zA-Z][_a-zA-Z0-9]*$/;let Dl=class t extends wl{construct(e,n,s){return new t(e,n,s)}static isValidIdentifier(t){return El.test(t)}canonicalString(){return this.toArray().map(e=>(e=e.replace(/\\/g,"\\\\").replace(/`/g,"\\`"),t.isValidIdentifier(e)||(e="`"+e+"`"),e)).join(".")}toString(){return this.canonicalString()}isKeyField(){return 1===this.length&&this.get(0)===ml}static keyField(){return new t([ml])}static fromServerFormat(e){const n=[];let s="",r=0;const i=()=>{if(0===s.length)throw new gl(Cl.INVALID_ARGUMENT,`Invalid field path (${e}). Paths must not be empty, begin with '.', end with '.', or contain '..'`);n.push(s),s=""};let o=!1;for(;r<e.length;){const t=e[r];if("\\"===t){if(r+1===e.length)throw new gl(Cl.INVALID_ARGUMENT,"Path has trailing escape character: "+e);const t=e[r+1];if("\\"!==t&&"."!==t&&"`"!==t)throw new gl(Cl.INVALID_ARGUMENT,"Path has invalid escape sequence: "+e);s+=t,r+=2}else"`"===t?(o=!o,r++):"."!==t||o?(s+=t,r++):(i(),r++)}if(i(),o)throw new gl(Cl.INVALID_ARGUMENT,"Unterminated ` in path: "+e);return new t(n)}static emptyPath(){return new t([])}};class _l{constructor(t){this.fields=t,t.sort(Dl.comparator)}static empty(){return new _l([])}unionWith(t){let e=new pl(Dl.comparator);for(const t of this.fields)e=e.add(t);for(const n of t)e=e.add(n);return new _l(e.toArray())}covers(t){for(const e of this.fields)if(e.isPrefixOf(t))return!0;return!1}isEqual(t){return ll(this.fields,t.fields,(t,e)=>t.isEqual(e))}}function bl(t){let e=0;for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&e++;return e}function vl(t,e){for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&e(n,t[n])}function Il(t){for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e))return!1;return!0}class Tl{constructor(t){this.path=t}static fromPath(t){return new Tl(yl.fromString(t))}static fromName(t){return new Tl(yl.fromString(t).popFirst(5))}static empty(){return new Tl(yl.emptyPath())}get collectionGroup(){return this.path.popLast().lastSegment()}hasCollectionId(t){return this.path.length>=2&&this.path.get(this.path.length-2)===t}getCollectionGroup(){return this.path.get(this.path.length-2)}getCollectionPath(){return this.path.popLast()}isEqual(t){return null!==t&&0===yl.comparator(this.path,t.path)}toString(){return this.path.toString()}static comparator(t,e){return yl.comparator(t.path,e.path)}static isDocumentKey(t){return t.length%2==0}static fromSegments(t){return new Tl(new yl(t.slice()))}}function Ol(t){if(!Tl.isDocumentKey(t))throw new gl(Cl.INVALID_ARGUMENT,`Invalid document reference. Document references must have an even number of segments, but ${t} has ${t.length}.`)}function Al(t){return"object"==typeof t&&null!==t&&(Object.getPrototypeOf(t)===Object.prototype||null===Object.getPrototypeOf(t))}function Sl(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";{const e=function(t){return t.constructor?t.constructor.name:null}(t);return e?`a custom ${e} object`:"an object"}}return"function"==typeof t?"a function":Zc(12329,{type:typeof t})}function Rl(t,e){if("_delegate"in t&&(t=t._delegate),!(t instanceof e)){if(e.name===t.constructor.name)throw new gl(Cl.INVALID_ARGUMENT,"Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?");{const n=Sl(t);throw new gl(Cl.INVALID_ARGUMENT,`Expected type '${e.name}', but it was: ${n}`)}}return t}function Nl(t,e){const n={typeString:t};return e&&(n.value=e),n}function xl(t,e){if(!Al(t))throw new gl(Cl.INVALID_ARGUMENT,"JSON must be an object");let n;for(const s in e)if(e[s]){const r=e[s].typeString,i="value"in e[s]?{value:e[s].value}:void 0;if(!(s in t)){n=`JSON missing required field: '${s}'`;break}const o=t[s];if(r&&typeof o!==r){n=`JSON field '${s}' must be a ${r}.`;break}if(void 0!==i&&o!==i.value){n=`Expected '${s}' field to equal '${i.value}'`;break}}if(n)throw new gl(Cl.INVALID_ARGUMENT,n);return!0}const kl=-62135596800,Ll=1e6;class Fl{static now(){return Fl.fromMillis(Date.now())}static fromDate(t){return Fl.fromMillis(t.getTime())}static fromMillis(t){const e=Math.floor(t/1e3),n=Math.floor((t-1e3*e)*Ll);return new Fl(e,n)}static fromInstant(t){if(!t||"bigint"!=typeof t.t)throw new gl(Cl.INVALID_ARGUMENT,"Invalid Temporal.Instant object provided.");return Fl._fromEpochNanoseconds(t.t)}static _fromEpochNanoseconds(t){let e,n;if(t>=0n)e=Number(t/1000000000n),n=Number(t%1000000000n);else{const s=t%1000000000n;0n===s?(e=Number(t/1000000000n),n=0):(e=Number(t/1000000000n-1n),n=Number(s+1000000000n))}return new Fl(e,n)}constructor(t,e){if(this.seconds=t,this.nanoseconds=e,e<0)throw new gl(Cl.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+e);if(e>=1e9)throw new gl(Cl.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+e);if(t<kl)throw new gl(Cl.INVALID_ARGUMENT,"Timestamp seconds out of range: "+t);if(t>=253402300800)throw new gl(Cl.INVALID_ARGUMENT,"Timestamp seconds out of range: "+t)}toDate(){return new Date(this.toMillis())}toMillis(){return 1e3*this.seconds+this.nanoseconds/Ll}toInstant(){if("undefined"==typeof Temporal||!Temporal.Instant)throw new gl(Cl.FAILED_PRECONDITION,"The Temporal object is not available in the current environment.");const t=1000000000n*BigInt(this.seconds)+BigInt(this.nanoseconds);return Temporal.Instant.__PRIVATE_fromEpochNanoseconds(t)}_compareTo(t){return this.seconds===t.seconds?il(this.nanoseconds,t.nanoseconds):il(this.seconds,t.seconds)}isEqual(t){return t.seconds===this.seconds&&t.nanoseconds===this.nanoseconds}toString(){return"Timestamp(seconds="+this.seconds+", nanoseconds="+this.nanoseconds+")"}toJSON(){return{type:Fl._jsonSchemaVersion,seconds:this.seconds,nanoseconds:this.nanoseconds}}static fromJSON(t){if(xl(t,Fl._jsonSchema))return new Fl(t.seconds,t.nanoseconds)}valueOf(){const t=this.seconds-kl;return String(t).padStart(12,"0")+"."+String(this.nanoseconds).padStart(9,"0")}}Fl._jsonSchemaVersion="firestore/timestamp/1.0",Fl._jsonSchema={type:Nl("string",Fl._jsonSchemaVersion),seconds:Nl("number"),nanoseconds:Nl("number")};class Pl extends Error{constructor(){super(...arguments),this.name="Base64DecodeError"}}class Ml{constructor(t){this.binaryString=t}static fromBase64String(t){const e=function(t){try{return atob(t)}catch(t){throw"undefined"!=typeof DOMException&&t instanceof DOMException?new Pl("Invalid base64 string: "+t):t}}(t);return new Ml(e)}static fromUint8Array(t){const e=function(t){let e="";for(let n=0;n<t.length;++n)e+=String.fromCharCode(t[n]);return e}(t);return new Ml(e)}[Symbol.iterator](){let t=0;return{next:()=>t<this.binaryString.length?{value:this.binaryString.charCodeAt(t++),done:!1}:{value:void 0,done:!0}}}toBase64(){return function(t){return btoa(t)}(this.binaryString)}toUint8Array(){return function(t){const e=new Uint8Array(t.length);for(let n=0;n<t.length;n++)e[n]=t.charCodeAt(n);return e}(this.binaryString)}approximateByteSize(){return 2*this.binaryString.length}compareTo(t){return il(this.binaryString,t.binaryString)}isEqual(t){return this.binaryString===t.binaryString}}Ml.EMPTY_BYTE_STRING=new Ml("");const Gl=new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);function Hl(t){if(el(!!t,39018),"string"==typeof t){let e=0;const n=Gl.exec(t);if(el(!!n,46558,{timestamp:t}),n[1]){let t=n[1];t=(t+"000000000").substr(0,9),e=Number(t)}const s=new Date(t);return{seconds:Math.floor(s.getTime()/1e3),nanos:e}}return{seconds:Ul(t.seconds),nanos:Ul(t.nanos)}}function Ul(t){return"number"==typeof t?t:"string"==typeof t?Number(t):0}function Vl(t){return"string"==typeof t?Ml.fromBase64String(t):Ml.fromUint8Array(t)}const jl="server_timestamp",$l="__type__",Jl="__previous_value__",ql="__local_write_time__";function zl(t){const e=(t?.mapValue?.fields||{})[$l]?.stringValue;return e===jl}function Kl(t){const e=t.mapValue.fields[Jl];return zl(e)?Kl(e):e}function Ql(t){const e=Hl(t.mapValue.fields[ql].timestampValue);return new Fl(e.seconds,e.nanos)}class Wl{constructor(t,e,n,s,r,i,o,a,B,c,l,u,h){this.databaseId=t,this.appId=e,this.persistenceKey=n,this.host=s,this.ssl=r,this.forceLongPolling=i,this.autoDetectLongPolling=o,this.longPollingOptions=a,this.useFetchStreams=B,this.isUsingEmulator=c,this.apiKey=l,this._customHeaders=u,this.grpcFlowControlWindow=h}}const Yl="(default)";class Xl{constructor(t,e){this.projectId=t,this.database=e||Yl}static empty(){return new Xl("","")}get isDefaultDatabase(){return this.database===Yl}isEqual(t){return t instanceof Xl&&t.projectId===this.projectId&&t.database===this.database}}function Zl(t,e){if(!Object.prototype.hasOwnProperty.apply(t.options,["projectId"]))throw new gl(Cl.INVALID_ARGUMENT,'"projectId" not provided in firebase.initializeApp.');return new Xl(t.options.projectId,e)}function tu(t){return null==t}function eu(t){return 0===t&&1/t==-1/0}const nu="__type__",su="__max__",ru={},iu="__vector__",ou="value",au={nullValue:"NULL_VALUE"},Bu={booleanValue:!0},cu={booleanValue:!1};function lu(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?zl(t)?4:function(t){return(((t.mapValue||{}).fields||{}).__type__||{}).stringValue===su}(t)?9007199254740991:Iu(t)?10:11:Zc(28295,{value:t})}function uu(t,e,n){if(t===e)return!0;const s=lu(t);if(s!==lu(e))return!1;switch(s){case 0:case 9007199254740991:return!0;case 1:return t.booleanValue===e.booleanValue;case 4:return Ql(t).isEqual(Ql(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;const n=Hl(t.timestampValue),s=Hl(e.timestampValue);return n.seconds===s.seconds&&n.nanos===s.nanos}(t,e);case 5:return t.stringValue===e.stringValue;case 6:return function(t,e){return Vl(t.bytesValue).isEqual(Vl(e.bytesValue))}(t,e);case 7:return t.referenceValue===e.referenceValue;case 8:return function(t,e){return Ul(t.geoPointValue.latitude)===Ul(e.geoPointValue.latitude)&&Ul(t.geoPointValue.longitude)===Ul(e.geoPointValue.longitude)}(t,e);case 2:return function(t,e,n){if("integerValue"in t&&"integerValue"in e)return Ul(t.integerValue)===Ul(e.integerValue);let s,r;if("doubleValue"in t&&"doubleValue"in e)s=Ul(t.doubleValue),r=Ul(e.doubleValue);else{if(!n?.i)return!1;s=Ul(t.integerValue??t.doubleValue),r=Ul(e.integerValue??e.doubleValue)}return s===r?!!n?.o||eu(s)===eu(r):!(void 0!==n&&!n.u)&&isNaN(s)&&isNaN(r)}(t,e,n);case 9:return ll(t.arrayValue.values||[],e.arrayValue.values||[],(t,e)=>uu(t,e,n));case 10:case 11:return function(t,e,n){const s=t.mapValue.fields||{},r=e.mapValue.fields||{};if(bl(s)!==bl(r))return!1;for(const t in s)if(s.hasOwnProperty(t)&&(void 0===r[t]||!uu(s[t],r[t],n)))return!1;return!0}(t,e,n);default:return Zc(52216,{left:t})}}function hu(t,e){return void 0!==(t.values||[]).find(t=>uu(t,e))}function du(t,e){if(t===e)return 0;const n=lu(t),s=lu(e);if(n!==s)return il(n,s);switch(n){case 0:case 9007199254740991:return 0;case 1:return il(t.booleanValue,e.booleanValue);case 2:return function(t,e){const n=Ul(t.integerValue||t.doubleValue),s=Ul(e.integerValue||e.doubleValue);return n<s?-1:n>s?1:n===s?0:isNaN(n)?isNaN(s)?0:-1:1}(t,e);case 3:return pu(t.timestampValue,e.timestampValue);case 4:return pu(Ql(t),Ql(e));case 5:return ol(t.stringValue,e.stringValue);case 6:return function(t,e){const n=Vl(t),s=Vl(e);return n.compareTo(s)}(t.bytesValue,e.bytesValue);case 7:return function(t,e){const n=t.split("/"),s=e.split("/");for(let t=0;t<n.length&&t<s.length;t++){const e=il(n[t],s[t]);if(0!==e)return e}return il(n.length,s.length)}(t.referenceValue,e.referenceValue);case 8:return function(t,e){const n=il(Ul(t.latitude),Ul(e.latitude));return 0!==n?n:il(Ul(t.longitude),Ul(e.longitude))}(t.geoPointValue,e.geoPointValue);case 9:return fu(t.arrayValue,e.arrayValue);case 10:return function(t,e){const n=t.fields||{},s=e.fields||{},r=n[ou]?.arrayValue,i=s[ou]?.arrayValue,o=il(r?.values?.length||0,i?.values?.length||0);return 0!==o?o:fu(r,i)}(t.mapValue,e.mapValue);case 11:return function(t,e){if(t===ru&&e===ru)return 0;if(t===ru)return 1;if(e===ru)return-1;const n=t.fields||{},s=Object.keys(n),r=e.fields||{},i=Object.keys(r);s.sort(),i.sort();for(let t=0;t<s.length&&t<i.length;++t){const e=ol(s[t],i[t]);if(0!==e)return e;const o=du(n[s[t]],r[i[t]]);if(0!==o)return o}return il(s.length,i.length)}(t.mapValue,e.mapValue);default:throw Zc(23264,{l:n})}}function pu(t,e){if("string"==typeof t&&"string"==typeof e&&t.length===e.length)return il(t,e);const n=Hl(t),s=Hl(e),r=il(n.seconds,s.seconds);return 0!==r?r:il(n.nanos,s.nanos)}function fu(t,e){const n=t.values||[],s=e.values||[];for(let t=0;t<n.length&&t<s.length;++t){const e=du(n[t],s[t]);if(void 0!==e&&0!==e)return e}return il(n.length,s.length)}function Cu(t){return gu(t)}function gu(t){return"nullValue"in t?"null":"booleanValue"in t?""+t.booleanValue:"integerValue"in t?""+t.integerValue:"doubleValue"in t?""+t.doubleValue:"timestampValue"in t?function(t){const e=Hl(t);return`time(${e.seconds},${e.nanos})`}(t.timestampValue):"stringValue"in t?t.stringValue:"bytesValue"in t?function(t){return Vl(t).toBase64()}(t.bytesValue):"referenceValue"in t?function(t){return Tl.fromName(t).toString()}(t.referenceValue):"geoPointValue"in t?function(t){return`geo(${t.latitude},${t.longitude})`}(t.geoPointValue):"arrayValue"in t?function(t){let e="[",n=!0;for(const s of t.values||[])n?n=!1:e+=",",e+=gu(s);return e+"]"}(t.arrayValue):"mapValue"in t?function(t){const e=Object.keys(t.fields||{}).sort();let n="{",s=!0;for(const r of e)s?s=!1:n+=",",n+=`${r}:${gu(t.fields[r])}`;return n+"}"}(t.mapValue):Zc(61005,{value:t})}function mu(t){switch(lu(t)){case 0:case 1:return 4;case 2:return 8;case 3:case 8:return 16;case 4:const e=Kl(t);return e?16+mu(e):16;case 5:return 2*t.stringValue.length;case 6:return Vl(t.bytesValue).approximateByteSize();case 7:return t.referenceValue.length;case 9:return function(t){return(t.values||[]).reduce((t,e)=>t+mu(e),0)}(t.arrayValue);case 10:case 11:return function(t){let e=0;return vl(t.fields,(t,n)=>{e+=t.length+mu(n)}),e}(t.mapValue);default:throw Zc(13486,{value:t})}}function wu(t){return!!t&&"integerValue"in t}function yu(t){return!!t&&"doubleValue"in t}function Eu(t){return wu(t)||yu(t)}function Du(t){return!!t&&"arrayValue"in t}function _u(t){return!!t&&"nullValue"in t}function bu(t){return!!t&&"doubleValue"in t&&isNaN(Number(t.doubleValue))}function vu(t){return!!t&&"mapValue"in t}function Iu(t){const e=(t?.mapValue?.fields||{})[nu]?.stringValue;return e===iu}function Tu(t){return(t?.mapValue?.fields||{})[ou]?.arrayValue}function Ou(t){if(t.geoPointValue)return{geoPointValue:{...t.geoPointValue}};if(t.timestampValue&&"object"==typeof t.timestampValue)return{timestampValue:{...t.timestampValue}};if(t.mapValue){const e={mapValue:{fields:{}}};return vl(t.mapValue.fields,(t,n)=>e.mapValue.fields[t]=Ou(n)),e}if(t.arrayValue){const e={arrayValue:{values:[]}};for(let n=0;n<(t.arrayValue.values||[]).length;++n)e.arrayValue.values[n]=Ou(t.arrayValue.values[n]);return e}return{...t}}class Au{constructor(t){this.value=t}static empty(){return new Au({mapValue:{}})}field(t){if(t.isEmpty())return this.value;{let e=this.value;for(let n=0;n<t.length-1;++n)if(e=(e.mapValue.fields||{})[t.get(n)],!vu(e))return null;return e=(e.mapValue.fields||{})[t.lastSegment()],e||null}}set(t,e){this.getFieldsMap(t.popLast())[t.lastSegment()]=Ou(e)}setAll(t){let e=Dl.emptyPath(),n={},s=[];t.forEach((t,r)=>{if(!e.isImmediateParentOf(r)){const t=this.getFieldsMap(e);this.applyChanges(t,n,s),n={},s=[],e=r.popLast()}t?n[r.lastSegment()]=Ou(t):s.push(r.lastSegment())});const r=this.getFieldsMap(e);this.applyChanges(r,n,s)}delete(t){const e=this.field(t.popLast());vu(e)&&e.mapValue.fields&&delete e.mapValue.fields[t.lastSegment()]}isEqual(t){return uu(this.value,t.value)}getFieldsMap(t){let e=this.value;e.mapValue.fields||(e.mapValue={fields:{}});for(let n=0;n<t.length;++n){let s=e.mapValue.fields[t.get(n)];vu(s)&&s.mapValue.fields||(s={mapValue:{fields:{}}},e.mapValue.fields[t.get(n)]=s),e=s}return e.mapValue.fields}applyChanges(t,e,n){vl(e,(e,n)=>t[e]=n);for(const e of n)delete t[e]}clone(){return new Au(Ou(this.value))}}function Su(t){const e=[];return vl(t.fields,(t,n)=>{const s=new Dl([t]);if(vu(n)){const t=Su(n.mapValue).fields;if(0===t.length)e.push(s);else for(const n of t)e.push(s.child(n))}else e.push(s)}),new _l(e)}function Ru(t,e){if(t.useProto3Json){if(isNaN(e))return{doubleValue:"NaN"};if(e===1/0)return{doubleValue:"Infinity"};if(e===-1/0)return{doubleValue:"-Infinity"}}return{doubleValue:eu(e)?"-0":e}}function Nu(t){return{integerValue:""+t}}function xu(t,e,n){return function(t){return"number"==typeof t&&Number.isInteger(t)&&!eu(t)&&t<=Number.MAX_SAFE_INTEGER&&t>=Number.MIN_SAFE_INTEGER}(e)?Nu(e):Ru(t,e)}class ku{constructor(){this._=void 0}}function Lu(t,e,n){return t instanceof Mu?function(t,e){const n={fields:{[$l]:{stringValue:jl},[ql]:{timestampValue:{seconds:t.seconds,nanos:t.nanoseconds}}}};return e&&zl(e)&&(e=Kl(e)),e&&(n.fields[Jl]=e),{mapValue:n}}(n,e):t instanceof Gu?Hu(t,e):t instanceof Uu?Vu(t,e):t instanceof $u?function(t,e){const n=Pu(t,e),s=Ku(n)+Ku(t.h);return wu(n)&&wu(t.h)?Nu(s):Ru(t.serializer,s)}(t,e):t instanceof Ju?function(t,e){return zu(t,e,Math.min)}(t,e):t instanceof qu?function(t,e){return zu(t,e,Math.max)}(t,e):void 0}function Fu(t,e,n){return t instanceof Gu?Hu(t,e):t instanceof Uu?Vu(t,e):n}function Pu(t,e){return t instanceof $u?Eu(e)?e:{integerValue:0}:null}class Mu extends ku{}class Gu extends ku{constructor(t){super(),this.elements=t}}function Hu(t,e){const n=Qu(e);for(const e of t.elements)n.some(t=>uu(t,e))||n.push(e);return{arrayValue:{values:n}}}class Uu extends ku{constructor(t){super(),this.elements=t}}function Vu(t,e){let n=Qu(e);for(const e of t.elements)n=n.filter(t=>!uu(t,e));return{arrayValue:{values:n}}}class ju extends ku{constructor(t,e){super(),this.serializer=t,this.h=e}}class $u extends ju{}class Ju extends ju{}class qu extends ju{}function zu(t,e,n){if(!Eu(e))return t.h;const s=n(Ku(e),Ku(t.h));return wu(e)&&wu(t.h)?Nu(s):Ru(t.serializer,s)}function Ku(t){return Ul(t.integerValue||t.doubleValue)}function Qu(t){return Du(t)&&t.arrayValue.values?t.arrayValue.values.slice():[]}class Wu{constructor(t,e){this.version=t,this.transformResults=e}}class Yu{constructor(t,e){this.updateTime=t,this.exists=e}static none(){return new Yu}static exists(t){return new Yu(void 0,t)}static updateTime(t){return new Yu(t)}get isNone(){return void 0===this.updateTime&&void 0===this.exists}isEqual(t){return this.exists===t.exists&&(this.updateTime?!!t.updateTime&&this.updateTime.isEqual(t.updateTime):!t.updateTime)}}function Xu(t,e){return void 0!==t.updateTime?e.isFoundDocument()&&e.version.isEqual(t.updateTime):void 0===t.exists||t.exists===e.isFoundDocument()}class Zu{}function th(t,e){if(!t.hasLocalMutations||e&&0===e.fields.length)return null;if(null===e)return t.isNoDocument()?new lh(t.key,Yu.none()):new ih(t.key,t.data,Yu.none());{const n=t.data,s=Au.empty();let r=new pl(Dl.comparator);for(let t of e.fields)if(!r.has(t)){let e=n.field(t);null===e&&t.length>1&&(t=t.popLast(),e=n.field(t)),null===e?s.delete(t):s.set(t,e),r=r.add(t)}return new oh(t.key,s,new _l(r.toArray()),Yu.none())}}function eh(t,e,n){t instanceof ih?function(t,e,n){const s=t.value.clone(),r=Bh(t.fieldTransforms,e,n.transformResults);s.setAll(r),e.convertToFoundDocument(n.version,s).setHasCommittedMutations()}(t,e,n):t instanceof oh?function(t,e,n){if(!Xu(t.precondition,e))return void e.convertToUnknownDocument(n.version);const s=Bh(t.fieldTransforms,e,n.transformResults),r=e.data;r.setAll(ah(t)),r.setAll(s),e.convertToFoundDocument(n.version,r).setHasCommittedMutations()}(t,e,n):function(t,e,n){e.convertToNoDocument(n.version).setHasCommittedMutations()}(0,e,n)}function nh(t,e,n,s){return t instanceof ih?function(t,e,n,s){if(!Xu(t.precondition,e))return n;const r=t.value.clone(),i=ch(t.fieldTransforms,s,e);return r.setAll(i),e.convertToFoundDocument(e.version,r).setHasLocalMutations(),null}(t,e,n,s):t instanceof oh?function(t,e,n,s){if(!Xu(t.precondition,e))return n;const r=ch(t.fieldTransforms,s,e),i=e.data;return i.setAll(ah(t)),i.setAll(r),e.convertToFoundDocument(e.version,i).setHasLocalMutations(),null===n?null:n.unionWith(t.fieldMask.fields).unionWith(t.fieldTransforms.map(t=>t.field))}(t,e,n,s):function(t,e,n){return Xu(t.precondition,e)?(e.convertToNoDocument(e.version).setHasLocalMutations(),null):n}(t,e,n)}function sh(t,e){let n=null;for(const s of t.fieldTransforms){const t=e.data.field(s.field),r=Pu(s.transform,t||null);null!=r&&(null===n&&(n=Au.empty()),n.set(s.field,r))}return n||null}function rh(t,e){return t.type===e.type&&!!t.key.isEqual(e.key)&&!!t.precondition.isEqual(e.precondition)&&!!function(t,e){return void 0===t&&void 0===e||!(!t||!e)&&ll(t,e,(t,e)=>function(t,e){return t.field.isEqual(e.field)&&function(t,e){return t instanceof Gu&&e instanceof Gu||t instanceof Uu&&e instanceof Uu?ll(t.elements,e.elements,uu):t instanceof $u&&e instanceof $u||t instanceof Ju&&e instanceof Ju||t instanceof qu&&e instanceof qu?uu(t.h,e.h):t instanceof Mu&&e instanceof Mu}(t.transform,e.transform)}(t,e))}(t.fieldTransforms,e.fieldTransforms)&&(0===t.type?t.value.isEqual(e.value):1!==t.type||t.data.isEqual(e.data)&&t.fieldMask.isEqual(e.fieldMask))}class ih extends Zu{constructor(t,e,n,s=[]){super(),this.key=t,this.value=e,this.precondition=n,this.fieldTransforms=s,this.type=0}getFieldMask(){return null}}class oh extends Zu{constructor(t,e,n,s,r=[]){super(),this.key=t,this.data=e,this.fieldMask=n,this.precondition=s,this.fieldTransforms=r,this.type=1}getFieldMask(){return this.fieldMask}}function ah(t){const e=new Map;return t.fieldMask.fields.forEach(n=>{if(!n.isEmpty()){const s=t.data.field(n);e.set(n,s)}}),e}function Bh(t,e,n){const s=new Map;el(t.length===n.length,32656,{T:n.length,P:t.length});for(let r=0;r<n.length;r++){const i=t[r],o=i.transform,a=e.data.field(i.field);s.set(i.field,Fu(o,a,n[r]))}return s}function ch(t,e,n){const s=new Map;for(const r of t){const t=r.transform,i=n.data.field(r.field);s.set(r.field,Lu(t,i,e))}return s}class lh extends Zu{constructor(t,e){super(),this.key=t,this.precondition=e,this.type=2,this.fieldTransforms=[]}getFieldMask(){return null}}class uh extends Zu{constructor(t,e){super(),this.key=t,this.precondition=e,this.type=3,this.fieldTransforms=[]}getFieldMask(){return null}}class hh{constructor(t,e){this.position=t,this.inclusive=e}}function dh(t,e,n){let s=0;for(let r=0;r<t.position.length;r++){const i=e[r],o=t.position[r];if(s=i.field.isKeyField()?Tl.comparator(Tl.fromName(o.referenceValue),n.key):du(o,n.data.field(i.field)),"desc"===i.dir&&(s*=-1),0!==s)break}return s}function ph(t,e){if(null===t)return null===e;if(null===e)return!1;if(t.inclusive!==e.inclusive||t.position.length!==e.position.length)return!1;for(let n=0;n<t.position.length;n++)if(!uu(t.position[n],e.position[n]))return!1;return!0}class fh{}class Ch extends fh{constructor(t,e,n){super(),this.field=t,this.op=e,this.value=n}static create(t,e,n){return t.isKeyField()?"in"===e||"not-in"===e?this.createKeyFieldInFilter(t,e,n):new _h(t,e,n):"array-contains"===e?new Th(t,n):"in"===e?new Oh(t,n):"not-in"===e?new Ah(t,n):"array-contains-any"===e?new Sh(t,n):new Ch(t,e,n)}static createKeyFieldInFilter(t,e,n){return"in"===e?new bh(t,n):new vh(t,n)}matches(t){const e=t.data.field(this.field);return"!="===this.op?null!==e&&void 0===e.nullValue&&this.matchesComparison(du(e,this.value)):null!==e&&lu(this.value)===lu(e)&&this.matchesComparison(du(e,this.value))}matchesComparison(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 Zc(47266,{operator:this.op})}}isInequality(){return["<","<=",">",">=","!=","not-in"].indexOf(this.op)>=0}getFlattenedFilters(){return[this]}getFilters(){return[this]}}class gh extends fh{constructor(t,e){super(),this.filters=t,this.op=e,this.I=null}static create(t,e){return new gh(t,e)}matches(t){return mh(this)?void 0===this.filters.find(e=>!e.matches(t)):void 0!==this.filters.find(e=>e.matches(t))}getFlattenedFilters(){return null!==this.I||(this.I=this.filters.reduce((t,e)=>t.concat(e.getFlattenedFilters()),[])),this.I}getFilters(){return Object.assign([],this.filters)}}function mh(t){return"and"===t.op}function wh(t){return function(t){for(const e of t.filters)if(e instanceof gh)return!1;return!0}(t)&&mh(t)}function yh(t){if(t instanceof Ch)return t.field.canonicalString()+t.op.toString()+Cu(t.value);if(wh(t))return t.filters.map(t=>yh(t)).join(",");{const e=t.filters.map(t=>yh(t)).join(",");return`${t.op}(${e})`}}function Eh(t,e){return t instanceof Ch?function(t,e){return e instanceof Ch&&t.op===e.op&&t.field.isEqual(e.field)&&uu(t.value,e.value)}(t,e):t instanceof gh?function(t,e){return e instanceof gh&&t.op===e.op&&t.filters.length===e.filters.length&&t.filters.reduce((t,n,s)=>t&&Eh(n,e.filters[s]),!0)}(t,e):void Zc(19439)}function Dh(t){return t instanceof Ch?function(t){return`${t.field.canonicalString()} ${t.op} ${Cu(t.value)}`}(t):t instanceof gh?function(t){return t.op.toString()+" {"+t.getFilters().map(Dh).join(" ,")+"}"}(t):"Filter"}class _h extends Ch{constructor(t,e,n){super(t,e,n),this.key=Tl.fromName(n.referenceValue)}matches(t){const e=Tl.comparator(t.key,this.key);return this.matchesComparison(e)}}class bh extends Ch{constructor(t,e){super(t,"in",e),this.keys=Ih("in",e)}matches(t){return this.keys.some(e=>e.isEqual(t.key))}}class vh extends Ch{constructor(t,e){super(t,"not-in",e),this.keys=Ih("not-in",e)}matches(t){return!this.keys.some(e=>e.isEqual(t.key))}}function Ih(t,e){return(e.arrayValue?.values||[]).map(t=>Tl.fromName(t.referenceValue))}class Th extends Ch{constructor(t,e){super(t,"array-contains",e)}matches(t){const e=t.data.field(this.field);return Du(e)&&hu(e.arrayValue,this.value)}}class Oh extends Ch{constructor(t,e){super(t,"in",e)}matches(t){const e=t.data.field(this.field);return null!==e&&hu(this.value.arrayValue,e)}}class Ah extends Ch{constructor(t,e){super(t,"not-in",e)}matches(t){if(hu(this.value.arrayValue,{nullValue:"NULL_VALUE"}))return!1;const e=t.data.field(this.field);return null!==e&&void 0===e.nullValue&&!hu(this.value.arrayValue,e)}}class Sh extends Ch{constructor(t,e){super(t,"array-contains-any",e)}matches(t){const e=t.data.field(this.field);return!(!Du(e)||!e.arrayValue.values)&&e.arrayValue.values.some(t=>hu(this.value.arrayValue,t))}}class Rh{constructor(t,e="asc"){this.field=t,this.dir=e}}function Nh(t,e){return t.dir===e.dir&&t.field.isEqual(e.field)}class xh{static fromTimestamp(t){return new xh(t)}static min(){return new xh(new Fl(0,0))}static max(){return new xh(new Fl(253402300799,999999999))}constructor(t){this.timestamp=t}compareTo(t){return this.timestamp._compareTo(t.timestamp)}isEqual(t){return this.timestamp.isEqual(t.timestamp)}toMicroseconds(){return 1e6*this.timestamp.seconds+this.timestamp.nanoseconds/1e3}toString(){return"SnapshotVersion("+this.timestamp.toString()+")"}toTimestamp(){return this.timestamp}}class kh{constructor(t,e,n,s,r,i,o){this.key=t,this.documentType=e,this.version=n,this.readTime=s,this.createTime=r,this.data=i,this.documentState=o}static newInvalidDocument(t){return new kh(t,0,xh.min(),xh.min(),xh.min(),Au.empty(),0)}static newFoundDocument(t,e,n,s){return new kh(t,1,e,xh.min(),n,s,0)}static newNoDocument(t,e){return new kh(t,2,e,xh.min(),xh.min(),Au.empty(),0)}static newUnknownDocument(t,e){return new kh(t,3,e,xh.min(),xh.min(),Au.empty(),2)}convertToFoundDocument(t,e){return!this.createTime.isEqual(xh.min())||2!==this.documentType&&0!==this.documentType||(this.createTime=t),this.version=t,this.documentType=1,this.data=e,this.documentState=0,this}convertToNoDocument(t){return this.version=t,this.documentType=2,this.data=Au.empty(),this.documentState=0,this}convertToUnknownDocument(t){return this.version=t,this.documentType=3,this.data=Au.empty(),this.documentState=2,this}setHasCommittedMutations(){return this.documentState=2,this}setHasLocalMutations(){return this.documentState=1,this.version=xh.min(),this}setReadTime(t){return this.readTime=t,this}get hasLocalMutations(){return 1===this.documentState}get hasCommittedMutations(){return 2===this.documentState}get hasPendingWrites(){return this.hasLocalMutations||this.hasCommittedMutations}isValidDocument(){return 0!==this.documentType}isFoundDocument(){return 1===this.documentType}isNoDocument(){return 2===this.documentType}isUnknownDocument(){return 3===this.documentType}isEqual(t){return t instanceof kh&&this.key.isEqual(t.key)&&this.version.isEqual(t.version)&&this.documentType===t.documentType&&this.documentState===t.documentState&&this.data.isEqual(t.data)}mutableCopy(){return new kh(this.key,this.documentType,this.version,this.readTime,this.createTime,this.data.clone(),this.documentState)}toString(){return`Document(${this.key}, ${this.version}, ${JSON.stringify(this.data.value)}, {createTime: ${this.createTime}}), {documentType: ${this.documentType}}), {documentState: ${this.documentState}})`}}function Lh(t){return new Fh(t.readTime,t.key,-1)}class Fh{constructor(t,e,n){this.readTime=t,this.documentKey=e,this.largestBatchId=n}static min(){return new Fh(xh.min(),Tl.empty(),-1)}static max(){return new Fh(xh.max(),Tl.empty(),-1)}}function Ph(t,e){let n=t.readTime.compareTo(e.readTime);return 0!==n?n:(n=Tl.comparator(t.documentKey,e.documentKey),0!==n?n:il(t.largestBatchId,e.largestBatchId))}class Mh{constructor(t,e=null,n=[],s=[],r=null,i=null,o=null){this.path=t,this.collectionGroup=e,this.orderBy=n,this.filters=s,this.limit=r,this.startAt=i,this.endAt=o,this.R=null}}function Gh(t,e=null,n=[],s=[],r=null,i=null,o=null){return new Mh(t,e,n,s,r,i,o)}function Hh(t){const e=nl(t);if(null===e.R){let t=e.path.canonicalString();null!==e.collectionGroup&&(t+="|cg:"+e.collectionGroup),t+="|f:",t+=e.filters.map(t=>yh(t)).join(","),t+="|ob:",t+=e.orderBy.map(t=>function(t){return t.field.canonicalString()+t.dir}(t)).join(","),tu(e.limit)||(t+="|l:",t+=e.limit),e.startAt&&(t+="|lb:",t+=e.startAt.inclusive?"b:":"a:",t+=e.startAt.position.map(t=>Cu(t)).join(",")),e.endAt&&(t+="|ub:",t+=e.endAt.inclusive?"a:":"b:",t+=e.endAt.position.map(t=>Cu(t)).join(",")),e.R=t}return e.R}function Uh(t,e){if(t.limit!==e.limit)return!1;if(t.orderBy.length!==e.orderBy.length)return!1;for(let n=0;n<t.orderBy.length;n++)if(!Nh(t.orderBy[n],e.orderBy[n]))return!1;if(t.filters.length!==e.filters.length)return!1;for(let n=0;n<t.filters.length;n++)if(!Eh(t.filters[n],e.filters[n]))return!1;return t.collectionGroup===e.collectionGroup&&!!t.path.isEqual(e.path)&&!!ph(t.startAt,e.startAt)&&ph(t.endAt,e.endAt)}class Vh{constructor(t,e=null,n=[],s=[],r=null,i="F",o=null,a=null){this.path=t,this.collectionGroup=e,this.explicitOrderBy=n,this.filters=s,this.limit=r,this.limitType=i,this.startAt=o,this.endAt=a,this.A=null,this.V=null,this.m=null,this.startAt,this.endAt}}function jh(t){return 0===t.filters.length&&null===t.limit&&null==t.startAt&&null==t.endAt&&(0===t.explicitOrderBy.length||1===t.explicitOrderBy.length&&t.explicitOrderBy[0].field.isKeyField())}function $h(t){const e=nl(t);if(null===e.A){e.A=[];const t=new Set;for(const n of e.explicitOrderBy)e.A.push(n),t.add(n.field.canonicalString());const n=e.explicitOrderBy.length>0?e.explicitOrderBy[e.explicitOrderBy.length-1].dir:"asc",s=function(t){let e=new pl(Dl.comparator);return t.filters.forEach(t=>{t.getFlattenedFilters().forEach(t=>{t.isInequality()&&(e=e.add(t.field))})}),e}(e);s.forEach(s=>{t.has(s.canonicalString())||s.isKeyField()||e.A.push(new Rh(s,n))}),t.has(Dl.keyField().canonicalString())||e.A.push(new Rh(Dl.keyField(),n))}return e.A}function Jh(t){const e=nl(t);return e.V||(e.V=function(t,e){if("F"===t.limitType)return Gh(t.path,t.collectionGroup,e,t.filters,t.limit,t.startAt,t.endAt);{e=e.map(t=>{const e="desc"===t.dir?"asc":"desc";return new Rh(t.field,e)});const n=t.endAt?new hh(t.endAt.position,t.endAt.inclusive):null,s=t.startAt?new hh(t.startAt.position,t.startAt.inclusive):null;return Gh(t.path,t.collectionGroup,e,t.filters,t.limit,n,s)}}(e,$h(t))),e.V}function qh(t,e,n){return new Vh(t.path,t.collectionGroup,t.explicitOrderBy.slice(),t.filters.slice(),e,n,t.startAt,t.endAt)}function zh(t){return`Query(target=${function(t){let e=t.path.canonicalString();return null!==t.collectionGroup&&(e+=" collectionGroup="+t.collectionGroup),t.filters.length>0&&(e+=`, filters: [${t.filters.map(t=>Dh(t)).join(", ")}]`),tu(t.limit)||(e+=", limit: "+t.limit),t.orderBy.length>0&&(e+=`, orderBy: [${t.orderBy.map(t=>function(t){return`${t.field.canonicalString()} (${t.dir})`}(t)).join(", ")}]`),t.startAt&&(e+=", startAt: ",e+=t.startAt.inclusive?"b:":"a:",e+=t.startAt.position.map(t=>Cu(t)).join(",")),t.endAt&&(e+=", endAt: ",e+=t.endAt.inclusive?"a:":"b:",e+=t.endAt.position.map(t=>Cu(t)).join(",")),`Target(${e})`}(Jh(t))}; limitType=${t.limitType})`}function Kh(t,e){return e.isFoundDocument()&&function(t,e){const n=e.key.path;return null!==t.collectionGroup?e.key.hasCollectionId(t.collectionGroup)&&t.path.isPrefixOf(n):Tl.isDocumentKey(t.path)?t.path.isEqual(n):t.path.isImmediateParentOf(n)}(t,e)&&function(t,e){for(const n of $h(t))if(!n.field.isKeyField()&&null===e.data.field(n.field))return!1;return!0}(t,e)&&function(t,e){for(const n of t.filters)if(!n.matches(e))return!1;return!0}(t,e)&&function(t,e){return!(t.startAt&&!function(t,e,n){const s=dh(t,e,n);return t.inclusive?s<=0:s<0}(t.startAt,$h(t),e))&&!(t.endAt&&!function(t,e,n){const s=dh(t,e,n);return t.inclusive?s>=0:s>0}(t.endAt,$h(t),e))}(t,e)}function Qh(t){return(e,n)=>{let s=!1;for(const r of $h(t)){const t=Wh(r,e,n);if(0!==t)return t;s=s||r.field.isKeyField()}return 0}}function Wh(t,e,n){const s=t.field.isKeyField()?Tl.comparator(e.key,n.key):function(t,e,n){const s=e.data.field(t),r=n.data.field(t);return null!==s&&null!==r?du(s,r):Zc(42886)}(t.field,e,n);switch(t.dir){case"asc":return s;case"desc":return-1*s;default:return Zc(19790,{direction:t.dir})}}var Yh,Xh;function Zh(t){if(void 0===t)return Wc("GRPC error has no .code"),Cl.UNKNOWN;switch(t){case Yh.OK:return Cl.OK;case Yh.CANCELLED:return Cl.CANCELLED;case Yh.UNKNOWN:return Cl.UNKNOWN;case Yh.DEADLINE_EXCEEDED:return Cl.DEADLINE_EXCEEDED;case Yh.RESOURCE_EXHAUSTED:return Cl.RESOURCE_EXHAUSTED;case Yh.INTERNAL:return Cl.INTERNAL;case Yh.UNAVAILABLE:return Cl.UNAVAILABLE;case Yh.UNAUTHENTICATED:return Cl.UNAUTHENTICATED;case Yh.INVALID_ARGUMENT:return Cl.INVALID_ARGUMENT;case Yh.NOT_FOUND:return Cl.NOT_FOUND;case Yh.ALREADY_EXISTS:return Cl.ALREADY_EXISTS;case Yh.PERMISSION_DENIED:return Cl.PERMISSION_DENIED;case Yh.FAILED_PRECONDITION:return Cl.FAILED_PRECONDITION;case Yh.ABORTED:return Cl.ABORTED;case Yh.OUT_OF_RANGE:return Cl.OUT_OF_RANGE;case Yh.UNIMPLEMENTED:return Cl.UNIMPLEMENTED;case Yh.DATA_LOSS:return Cl.DATA_LOSS;default:return Zc(39323,{code:t})}}(Xh=Yh||(Yh={}))[Xh.OK=0]="OK",Xh[Xh.CANCELLED=1]="CANCELLED",Xh[Xh.UNKNOWN=2]="UNKNOWN",Xh[Xh.INVALID_ARGUMENT=3]="INVALID_ARGUMENT",Xh[Xh.DEADLINE_EXCEEDED=4]="DEADLINE_EXCEEDED",Xh[Xh.NOT_FOUND=5]="NOT_FOUND",Xh[Xh.ALREADY_EXISTS=6]="ALREADY_EXISTS",Xh[Xh.PERMISSION_DENIED=7]="PERMISSION_DENIED",Xh[Xh.UNAUTHENTICATED=16]="UNAUTHENTICATED",Xh[Xh.RESOURCE_EXHAUSTED=8]="RESOURCE_EXHAUSTED",Xh[Xh.FAILED_PRECONDITION=9]="FAILED_PRECONDITION",Xh[Xh.ABORTED=10]="ABORTED",Xh[Xh.OUT_OF_RANGE=11]="OUT_OF_RANGE",Xh[Xh.UNIMPLEMENTED=12]="UNIMPLEMENTED",Xh[Xh.INTERNAL=13]="INTERNAL",Xh[Xh.UNAVAILABLE=14]="UNAVAILABLE",Xh[Xh.DATA_LOSS=15]="DATA_LOSS";class td{constructor(t,e){this.mapKeyFn=t,this.equalsFn=e,this.inner={},this.innerSize=0}get(t){const e=this.mapKeyFn(t),n=this.inner[e];if(void 0!==n)for(const[e,s]of n)if(this.equalsFn(e,t))return s}has(t){return void 0!==this.get(t)}set(t,e){const n=this.mapKeyFn(t),s=this.inner[n];if(void 0===s)return this.inner[n]=[[t,e]],void this.innerSize++;for(let n=0;n<s.length;n++)if(this.equalsFn(s[n][0],t))return void(s[n]=[t,e]);s.push([t,e]),this.innerSize++}delete(t){const e=this.mapKeyFn(t),n=this.inner[e];if(void 0===n)return!1;for(let s=0;s<n.length;s++)if(this.equalsFn(n[s][0],t))return 1===n.length?delete this.inner[e]:n.splice(s,1),this.innerSize--,!0;return!1}forEach(t){vl(this.inner,(e,n)=>{for(const[e,s]of n)t(e,s)})}isEmpty(){return Il(this.inner)}size(){return this.innerSize}}const ed=new ul(Tl.comparator);function nd(){return ed}const sd=new ul(Tl.comparator);function rd(...t){let e=sd;for(const n of t)e=e.insert(n.key,n);return e}function id(t){let e=sd;return t.forEach((t,n)=>e=e.insert(t,n.overlayedDocument)),e}function od(){return Bd()}function ad(){return Bd()}function Bd(){return new td(t=>t.toString(),(t,e)=>t.isEqual(e))}const cd=new ul(Tl.comparator),ld=new pl(Tl.comparator);function ud(...t){let e=ld;for(const n of t)e=e.add(n);return e}const hd=new pl(il);new Wa([4294967295,4294967295],0);class dd{constructor(t,e){this.databaseId=t,this.useProto3Json=e}}function pd(t,e){return t.useProto3Json?`${new Date(1e3*e.seconds).toISOString().replace(/\.\d*/,"").replace("Z","")}.${("000000000"+e.nanoseconds).slice(-9)}Z`:{seconds:""+e.seconds,nanos:e.nanoseconds}}function fd(t){const e=Hl(t);return new Fl(e.seconds,e.nanos)}function Cd(t,e){return t.useProto3Json?e.toBase64():e.toUint8Array()}function gd(t,e){return pd(t,e.toTimestamp())}function md(t){return el(!!t,49232),xh.fromTimestamp(fd(t))}function wd(t,e){return yd(t,e).canonicalString()}function yd(t,e){const n=function(t){return new yl(["projects",t.projectId,"databases",t.database])}(t).child("documents");return void 0===e?n:n.child(e)}function Ed(t,e){return wd(t.databaseId,e.path)}function Dd(t){const e=function(t){const e=yl.fromString(t);return el(function(t){return t.length>=4&&"projects"===t.get(0)&&"databases"===t.get(2)}(e),10190,{key:e.toString()}),e}(t);return 4===e.length?yl.emptyPath():function(t){return el(t.length>4&&"documents"===t.get(4),29091,{key:t.toString()}),t.popFirst(5)}(e)}function _d(t,e,n){return{name:Ed(t,e),fields:n.value.mapValue.fields}}function bd(t){let e=Dd(t.parent);const n=t.structuredQuery,s=n.from?n.from.length:0;let r=null;if(s>0){el(1===s,65062);const t=n.from[0];t.allDescendants?r=t.collectionId:e=e.child(t.collectionId)}let i=[];n.where&&(i=function(t){const e=vd(t);return e instanceof gh&&wh(e)?e.getFilters():[e]}(n.where));let o=[];n.orderBy&&(o=function(t){return t.map(t=>function(t){return new Rh(Id(t.field),function(t){switch(t){case"ASCENDING":return"asc";case"DESCENDING":return"desc";default:return}}(t.direction))}(t))}(n.orderBy));let a=null;n.limit&&(a=function(t){let e;return e="object"==typeof t?t.value:t,tu(e)?null:e}(n.limit));let B=null;n.startAt&&(B=function(t){const e=!!t.before,n=t.values||[];return new hh(n,e)}(n.startAt));let c=null;return n.endAt&&(c=function(t){const e=!t.before,n=t.values||[];return new hh(n,e)}(n.endAt)),function(t,e,n,s,r,i,o,a){return new Vh(t,e,n,s,r,i,o,a)}(e,r,o,i,a,"F",B,c)}function vd(t){return void 0!==t.unaryFilter?function(t){switch(t.unaryFilter.op){case"IS_NAN":const e=Id(t.unaryFilter.field);return Ch.create(e,"==",{doubleValue:NaN});case"IS_NULL":const n=Id(t.unaryFilter.field);return Ch.create(n,"==",{nullValue:"NULL_VALUE"});case"IS_NOT_NAN":const s=Id(t.unaryFilter.field);return Ch.create(s,"!=",{doubleValue:NaN});case"IS_NOT_NULL":const r=Id(t.unaryFilter.field);return Ch.create(r,"!=",{nullValue:"NULL_VALUE"});case"OPERATOR_UNSPECIFIED":return Zc(61313);default:return Zc(60726)}}(t):void 0!==t.fieldFilter?function(t){return Ch.create(Id(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":return Zc(58110);default:return Zc(50506)}}(t.fieldFilter.op),t.fieldFilter.value)}(t):void 0!==t.compositeFilter?function(t){return gh.create(t.compositeFilter.filters.map(t=>vd(t)),function(t){switch(t){case"AND":return"and";case"OR":return"or";default:return Zc(1026)}}(t.compositeFilter.op))}(t):Zc(30097,{filter:t})}function Id(t){return Dl.fromServerFormat(t.fieldPath)}function Td(t){const e=[];return t.fields.forEach(t=>e.push(t.canonicalString())),{fieldPaths:e}}function Od(t){return!!t&&"function"==typeof t._toProto&&"ProtoValue"===t._protoValueType}function Ad(t,e){const n={fields:{}};return e.forEach((e,s)=>{if("string"!=typeof s)throw new Error(`Cannot encode map with non-string key: ${s}`);n.fields[s]=e._toProto(t)}),{mapValue:n}}function Sd(t){return{stringValue:t}}function Rd(t){return new dd(t,!0)}class Nd{constructor(t){this._byteString=t}static fromBase64String(t){try{return new Nd(Ml.fromBase64String(t))}catch(t){throw new gl(Cl.INVALID_ARGUMENT,"Failed to construct data from Base64 string: "+t)}}static fromUint8Array(t){return new Nd(Ml.fromUint8Array(t))}toBase64(){return this._byteString.toBase64()}toUint8Array(){return this._byteString.toUint8Array()}toString(){return"Bytes(base64: "+this.toBase64()+")"}isEqual(t){return this._byteString.isEqual(t._byteString)}toJSON(){return{type:Nd._jsonSchemaVersion,bytes:this.toBase64()}}static fromJSON(t){if(xl(t,Nd._jsonSchema))return Nd.fromBase64String(t.bytes)}}Nd._jsonSchemaVersion="firestore/bytes/1.0",Nd._jsonSchema={type:Nl("string",Nd._jsonSchemaVersion),bytes:Nl("string")};class xd{constructor(...t){for(let e=0;e<t.length;++e)if(0===t[e].length)throw new gl(Cl.INVALID_ARGUMENT,"Invalid field name at argument $(i + 1). Field names must not be empty.");this._internalPath=new Dl(t)}isEqual(t){return this._internalPath.isEqual(t._internalPath)}}class kd{constructor(t){this._methodName=t}}class Ld{constructor(t,e){if(!isFinite(t)||t<-90||t>90)throw new gl(Cl.INVALID_ARGUMENT,"Latitude must be a number between -90 and 90, but was: "+t);if(!isFinite(e)||e<-180||e>180)throw new gl(Cl.INVALID_ARGUMENT,"Longitude must be a number between -180 and 180, but was: "+e);this._lat=t,this._long=e}get latitude(){return this._lat}get longitude(){return this._long}isEqual(t){return this._lat===t._lat&&this._long===t._long}_compareTo(t){return il(this._lat,t._lat)||il(this._long,t._long)}toJSON(){return{latitude:this._lat,longitude:this._long,type:Ld._jsonSchemaVersion}}static fromJSON(t){if(xl(t,Ld._jsonSchema))return new Ld(t.latitude,t.longitude)}}Ld._jsonSchemaVersion="firestore/geoPoint/1.0",Ld._jsonSchema={type:Nl("string",Ld._jsonSchemaVersion),latitude:Nl("number"),longitude:Nl("number")};class Fd{constructor(t){this.uid=t}isAuthenticated(){return null!=this.uid}toKey(){return this.isAuthenticated()?"uid:"+this.uid:"anonymous-user"}isEqual(t){return t.uid===this.uid}}Fd.UNAUTHENTICATED=new Fd(null),Fd.GOOGLE_CREDENTIALS=new Fd("google-credentials-uid"),Fd.FIRST_PARTY=new Fd("first-party-uid"),Fd.MOCK_USER=new Fd("mock-user");class Pd{constructor(){this.promise=new Promise((t,e)=>{this.resolve=t,this.reject=e})}}class Md{constructor(t,e){this.user=e,this.type="OAuth",this.headers=new Map,this.headers.set("Authorization",`Bearer ${t}`)}}class Gd{getToken(){return Promise.resolve(null)}invalidateToken(){}start(t,e){t.enqueueRetryable(()=>e(Fd.UNAUTHENTICATED))}shutdown(){}}class Hd{constructor(t){this.token=t,this.changeListener=null}getToken(){return Promise.resolve(this.token)}invalidateToken(){}start(t,e){this.changeListener=e,t.enqueueRetryable(()=>e(this.token.user))}shutdown(){this.changeListener=null}}class Ud{constructor(t){this.De=t,this.currentUser=Fd.UNAUTHENTICATED,this.xe=0,this.forceRefresh=!1,this.auth=null}start(t,e){el(void 0===this.Ce,42304);let n=this.xe;const s=t=>this.xe!==n?(n=this.xe,e(t)):Promise.resolve();let r=new Pd;this.Ce=()=>{this.xe++,this.currentUser=this.Fe(),r.resolve(),r=new Pd,t.enqueueRetryable(()=>s(this.currentUser))};const i=()=>{const e=r;t.enqueueRetryable(async()=>{await e.promise,await s(this.currentUser)})},o=t=>{Qc("FirebaseAuthCredentialsProvider","Auth detected"),this.auth=t,this.Ce&&(this.auth.addAuthTokenListener(this.Ce),i())};this.De.onInit(t=>o(t)),setTimeout(()=>{if(!this.auth){const t=this.De.getImmediate({optional:!0});t?o(t):(Qc("FirebaseAuthCredentialsProvider","Auth not yet detected"),r.resolve(),r=new Pd)}},0),i()}getToken(){const t=this.xe,e=this.forceRefresh;return this.forceRefresh=!1,this.auth?this.auth.getToken(e).then(e=>this.xe!==t?(Qc("FirebaseAuthCredentialsProvider","getToken aborted due to token change."),this.getToken()):e?(el("string"==typeof e.accessToken,31837,{Oe:e}),new Md(e.accessToken,this.currentUser)):null):Promise.resolve(null)}invalidateToken(){this.forceRefresh=!0}shutdown(){this.auth&&this.Ce&&this.auth.removeAuthTokenListener(this.Ce),this.Ce=void 0}Fe(){const t=this.auth&&this.auth.getUid();return el(null===t||"string"==typeof t,2055,{Me:t}),new Fd(t)}}class Vd{constructor(t,e,n){this.Ne=t,this.Le=e,this.Be=n,this.type="FirstParty",this.user=Fd.FIRST_PARTY,this.Ue=new Map}ke(){return this.Be?this.Be():null}get headers(){this.Ue.set("X-Goog-AuthUser",this.Ne);const t=this.ke();return t&&this.Ue.set("Authorization",t),this.Le&&this.Ue.set("X-Goog-Iam-Authorization-Token",this.Le),this.Ue}}class jd{constructor(t,e,n){this.Ne=t,this.Le=e,this.Be=n}getToken(){return Promise.resolve(new Vd(this.Ne,this.Le,this.Be))}start(t,e){t.enqueueRetryable(()=>e(Fd.FIRST_PARTY))}shutdown(){}invalidateToken(){}}class $d{constructor(t){this.value=t,this.type="AppCheck",this.headers=new Map,t&&t.length>0&&this.headers.set("x-firebase-appcheck",this.value)}}class Jd{constructor(t,e){this.qe=e,this.forceRefresh=!1,this.appCheck=null,this.$e=null,this.Ke=null,hr(t)&&t.settings.appCheckToken&&(this.Ke=t.settings.appCheckToken)}start(t,e){el(void 0===this.Ce,3512);const n=t=>{null!=t.error&&Qc("FirebaseAppCheckTokenProvider",`Error getting App Check token; using placeholder token instead. Error: ${t.error.message}`);const n=t.token!==this.$e;return this.$e=t.token,Qc("FirebaseAppCheckTokenProvider",`Received ${n?"new":"existing"} token.`),n?e(t.token):Promise.resolve()};this.Ce=e=>{t.enqueueRetryable(()=>n(e))};const s=t=>{Qc("FirebaseAppCheckTokenProvider","AppCheck detected"),this.appCheck=t,this.Ce&&this.appCheck.addTokenListener(this.Ce)};this.qe.onInit(t=>s(t)),setTimeout(()=>{if(!this.appCheck){const t=this.qe.getImmediate({optional:!0});t?s(t):Qc("FirebaseAppCheckTokenProvider","AppCheck not yet detected")}},0)}getToken(){if(this.Ke)return Promise.resolve(new $d(this.Ke));const t=this.forceRefresh;return this.forceRefresh=!1,this.appCheck?this.appCheck.getToken(t).then(t=>t?(el("string"==typeof t.token,44558,{tokenResult:t}),this.$e=t.token,new $d(t.token)):null):Promise.resolve(null)}invalidateToken(){this.forceRefresh=!0}shutdown(){this.appCheck&&this.Ce&&this.appCheck.removeTokenListener(this.Ce),this.Ce=void 0}}function qd(t){const e={};return void 0!==t.timeoutSeconds&&(e.timeoutSeconds=t.timeoutSeconds),e}class zd{Qe(t){}shutdown(){}}const Kd="ConnectivityMonitor";class Qd{constructor(){this.We=()=>this.Ge(),this.ze=()=>this.je(),this.He=[],this.Je()}Qe(t){this.He.push(t)}shutdown(){window.removeEventListener("online",this.We),window.removeEventListener("offline",this.ze)}Je(){window.addEventListener("online",this.We),window.addEventListener("offline",this.ze)}Ge(){Qc(Kd,"Network connectivity changed: AVAILABLE");for(const t of this.He)t(0)}je(){Qc(Kd,"Network connectivity changed: UNAVAILABLE");for(const t of this.He)t(1)}static Ye(){return"undefined"!=typeof window&&void 0!==window.addEventListener&&void 0!==window.removeEventListener}}let Wd=null;function Yd(){return null===Wd?Wd=268435456+Math.round(2147483648*Math.random()):Wd++,"0x"+Wd.toString(16)}const Xd="RestConnection",Zd={BatchGetDocuments:"batchGet",Commit:"commit",RunQuery:"runQuery",RunAggregationQuery:"runAggregationQuery",ExecutePipeline:"executePipeline"};class tp{get Ze(){return!1}constructor(t){this.databaseInfo=t,this.databaseId=t.databaseId;const e=t.ssl?"https":"http",n=encodeURIComponent(this.databaseId.projectId),s=encodeURIComponent(this.databaseId.database);this.Xe=e+"://"+t.host,this.et=`projects/${n}/databases/${s}`,this.tt=this.databaseId.database===Yl?`project_id=${n}`:`project_id=${n}&database_id=${s}`}nt(t,e,n,s,r){const i=Yd(),o=this.rt(t,e.toUriEncodedString());Qc(Xd,`Sending RPC '${t}' ${i}:`,o,n);const a={"google-cloud-resource-prefix":this.et,"x-goog-request-params":this.tt};this.it(a,s,r);const{host:B}=new URL(o),c=Zn(B);return this.st(t,o,a,n,c).then(e=>(Qc(Xd,`Received RPC '${t}' ${i}: `,e),e),e=>{throw Yc(Xd,`RPC '${t}' ${i} failed with error: `,e,"url: ",o,"request:",n),e})}_t(t,e,n,s,r,i){return this.nt(t,e,n,s,r)}it(t,e,n){if(t["X-Goog-Api-Client"]="gl-js/ fire/"+qc,t["Content-Type"]="text/plain",this.databaseInfo.appId&&(t["X-Firebase-GMPID"]=this.databaseInfo.appId),e&&e.headers.forEach((e,n)=>t[n]=e),n&&n.headers.forEach((e,n)=>t[n]=e),this.databaseInfo._customHeaders)for(const e of Object.keys(this.databaseInfo._customHeaders))t[e]=this.databaseInfo._customHeaders[e]}rt(t,e){const n=Zd[t];let s=`${this.Xe}/v1/${e}:${n}`;return this.databaseInfo.apiKey&&(s=`${s}?key=${encodeURIComponent(this.databaseInfo.apiKey)}`),s}terminate(){}}class ep{constructor(t){this.ot=t.ot,this.ut=t.ut}ct(t){this.lt=t}Et(t){this.ht=t}Tt(t){this.Pt=t}onMessage(t){this.It=t}close(){this.ut()}send(t){this.ot(t)}Rt(){this.lt()}At(){this.ht()}Vt(t){this.Pt(t)}dt(t){this.It(t)}}const np="WebChannelConnection",sp=(t,e,n)=>{t.listen(e,t=>{try{n(t)}catch(t){setTimeout(()=>{throw t},0)}})};class rp extends tp{constructor(t){super(t),this.ft=[],this.forceLongPolling=t.forceLongPolling,this.autoDetectLongPolling=t.autoDetectLongPolling,this.useFetchStreams=t.useFetchStreams,this.longPollingOptions=t.longPollingOptions}static gt(){if(!rp.yt){const t=rB();sp(t,sB.STAT_EVENT,t=>{t.stat===nB.PROXY?Qc(np,"STAT_EVENT: detected buffering proxy"):t.stat===nB.NOPROXY&&Qc(np,"STAT_EVENT: detected no buffering proxy")}),rp.yt=!0}}st(t,e,n,s,r){const i=Yd();return new Promise((r,o)=>{const a=new Xa;a.setWithCredentials(!0),a.listenOnce(tB.COMPLETE,()=>{try{switch(a.getLastErrorCode()){case eB.NO_ERROR:const e=a.getResponseJson();Qc(np,`XHR for RPC '${t}' ${i} received:`,JSON.stringify(e)),r(e);break;case eB.TIMEOUT:Qc(np,`RPC '${t}' ${i} timed out`),o(new gl(Cl.DEADLINE_EXCEEDED,"Request time out"));break;case eB.HTTP_ERROR:const n=a.getStatus();if(Qc(np,`RPC '${t}' ${i} failed with status:`,n,"response text:",a.getResponseText()),n>0){let t=a.getResponseJson();Array.isArray(t)&&(t=t[0]);const e=t?.error;if(e&&e.status&&e.message){const t=function(t){const e=t.toLowerCase().replace(/_/g,"-");return Object.values(Cl).indexOf(e)>=0?e:Cl.UNKNOWN}(e.status);o(new gl(t,e.message))}else o(new gl(Cl.UNKNOWN,"Server responded with status "+a.getStatus()))}else o(new gl(Cl.UNAVAILABLE,"Connection failed."));break;default:Zc(9055,{wt:t,streamId:i,bt:a.getLastErrorCode(),St:a.getLastError()})}}finally{Qc(np,`RPC '${t}' ${i} completed.`)}});const B=JSON.stringify(s);Qc(np,`RPC '${t}' ${i} sending request:`,s),a.send(e,"POST",B,n,15)})}vt(t,e,n){const s=Yd(),r=[this.Xe,"/","google.firestore.v1.Firestore","/",t,"/channel"],i=this.createWebChannelTransport(),o={httpSessionIdParam:"gsessionid",initMessageHeaders:{},messageUrlParams:{database:`projects/${this.databaseId.projectId}/databases/${this.databaseId.database}`},sendRawJson:!0,supportsCrossDomainXhr:!0,internalChannelParams:{forwardChannelRequestTimeoutMs:6e5},forceLongPolling:this.forceLongPolling,detectBufferingProxy:this.autoDetectLongPolling},a=this.longPollingOptions.timeoutSeconds;void 0!==a&&(o.longPollingTimeout=Math.round(1e3*a)),this.useFetchStreams&&(o.useFetchStreams=!0),this.it(o.initMessageHeaders,e,n),o.encodeInitMessageHeaders=!0;const B=r.join("");Qc(np,`Creating RPC '${t}' stream ${s}: ${B}`,o);const c=i.createWebChannel(B,o);this.Dt(c);let l=!1,u=!1;const h=new ep({ot:e=>{u?Qc(np,`Not sending because RPC '${t}' stream ${s} is closed:`,e):(l||(Qc(np,`Opening RPC '${t}' stream ${s} transport.`),c.open(),l=!0),Qc(np,`RPC '${t}' stream ${s} sending:`,e),c.send(e))},ut:()=>c.close()});return sp(c,Za.EventType.OPEN,()=>{u||(Qc(np,`RPC '${t}' stream ${s} transport opened.`),h.Rt())}),sp(c,Za.EventType.CLOSE,()=>{u||(u=!0,Qc(np,`RPC '${t}' stream ${s} transport closed`),h.Vt(),this.xt(c))}),sp(c,Za.EventType.ERROR,e=>{u||(u=!0,Yc(np,`RPC '${t}' stream ${s} transport errored. Name:`,e.name,"Message:",e.message),h.Vt(new gl(Cl.UNAVAILABLE,"The operation could not be completed")))}),sp(c,Za.EventType.MESSAGE,e=>{if(!u){const n=e.data[0];el(!!n,16349);const r=n,i=r?.error||r[0]?.error;if(i){Qc(np,`RPC '${t}' stream ${s} received error:`,i);const e=i.status;let n=function(t){const e=Yh[t];if(void 0!==e)return Zh(e)}(e),r=i.message;"NOT_FOUND"===e&&r.includes("database")&&r.includes("does not exist")&&r.includes(this.databaseId.database)&&Yc(`Database '${this.databaseId.database}' not found. Please check your project configuration.`),void 0===n&&(n=Cl.INTERNAL,r="Unknown error status: "+e+" with message "+i.message),u=!0,h.Vt(new gl(n,r)),c.close()}else Qc(np,`RPC '${t}' stream ${s} received:`,n),h.dt(n)}}),rp.gt(),setTimeout(()=>{h.At()},0),h}terminate(){this.ft.forEach(t=>t.close()),this.ft=[]}Dt(t){this.ft.push(t)}xt(t){this.ft=this.ft.filter(e=>e===t)}it(t,e,n){super.it(t,e,n),this.databaseInfo.apiKey&&(t["x-goog-api-key"]=this.databaseInfo.apiKey)}createWebChannelTransport(){return iB()}}rp.yt=!1;class ip{constructor(t,e,n=1e3,s=1.5,r=6e4){this.Ct=t,this.timerId=e,this.Ft=n,this.Ot=s,this.Mt=r,this.Nt=0,this.Lt=null,this.Bt=Date.now(),this.reset()}reset(){this.Nt=0}Ut(){this.Nt=this.Mt}kt(t){this.cancel();const e=Math.floor(this.Nt+this.qt()),n=Math.max(0,Date.now()-this.Bt),s=Math.max(0,e-n);s>0&&Qc("ExponentialBackoff",`Backing off for ${s} ms (base delay: ${this.Nt} ms, delay with jitter: ${e} ms, last attempt: ${n} ms ago)`),this.Lt=this.Ct.enqueueAfterDelay(this.timerId,s,()=>(this.Bt=Date.now(),t())),this.Nt*=this.Ot,this.Nt<this.Ft&&(this.Nt=this.Ft),this.Nt>this.Mt&&(this.Nt=this.Mt)}$t(){null!==this.Lt&&(this.Lt.skipDelay(),this.Lt=null)}cancel(){null!==this.Lt&&(this.Lt.cancel(),this.Lt=null)}qt(){return(Math.random()-.5)*this.Nt}}const op="PersistentStream";class ap{constructor(t,e,n,s,r,i,o,a){this.Ct=t,this.Kt=n,this.Qt=s,this.connection=r,this.authCredentialsProvider=i,this.appCheckCredentialsProvider=o,this.listener=a,this.state=0,this.Wt=0,this.Gt=null,this.zt=null,this.stream=null,this.jt=0,this.Ht=new ip(t,e)}Jt(){return 1===this.state||5===this.state||this.Yt()}Yt(){return 2===this.state||3===this.state}start(){this.jt=0,4!==this.state?this.auth():this.Zt()}async stop(){this.Jt()&&await this.close(0)}Xt(){this.state=0,this.Ht.reset()}en(){this.Yt()&&null===this.Gt&&(this.Gt=this.Ct.enqueueAfterDelay(this.Kt,6e4,()=>this.tn()))}nn(t){this.rn(),this.stream.send(t)}async tn(){if(this.Yt())return this.close(0)}rn(){this.Gt&&(this.Gt.cancel(),this.Gt=null)}sn(){this.zt&&(this.zt.cancel(),this.zt=null)}async close(t,e){this.rn(),this.sn(),this.Ht.cancel(),this.Wt++,4!==t?this.Ht.reset():e&&e.code===Cl.RESOURCE_EXHAUSTED?(Wc(e.toString()),Wc("Using maximum backoff delay to prevent overloading the backend."),this.Ht.Ut()):e&&e.code===Cl.UNAUTHENTICATED&&3!==this.state&&(this.authCredentialsProvider.invalidateToken(),this.appCheckCredentialsProvider.invalidateToken()),null!==this.stream&&(this._n(),this.stream.close(),this.stream=null),this.state=t,await this.listener.Tt(e)}_n(){}auth(){this.state=1;const t=this.an(this.Wt),e=this.Wt;Promise.all([this.authCredentialsProvider.getToken(),this.appCheckCredentialsProvider.getToken()]).then(([t,n])=>{this.Wt===e&&this.un(t,n)},e=>{t(()=>{const t=new gl(Cl.UNKNOWN,"Fetching auth token failed: "+e.message);return this.cn(t)})})}un(t,e){const n=this.an(this.Wt);this.stream=this.En(t,e),this.stream.ct(()=>{n(()=>this.listener.ct())}),this.stream.Et(()=>{n(()=>(this.state=2,this.zt=this.Ct.enqueueAfterDelay(this.Qt,1e4,()=>(this.Yt()&&(this.state=3),Promise.resolve())),this.listener.Et()))}),this.stream.Tt(t=>{n(()=>this.cn(t))}),this.stream.onMessage(t=>{n(()=>1==++this.jt?this.hn(t):this.onNext(t))})}Zt(){this.state=5,this.Ht.kt(async()=>{this.state=0,this.start()})}cn(t){return Qc(op,`close with error: ${t}`),this.stream=null,this.close(4,t)}an(t){return e=>{this.Ct.enqueueAndForget(()=>this.Wt===t?e():(Qc(op,"stream callback skipped by getCloseGuardedDispatcher."),Promise.resolve()))}}}class Bp extends ap{constructor(t,e,n,s,r,i){super(t,"write_stream_connection_backoff","write_stream_idle","health_check_timeout",e,n,s,i),this.serializer=r}get Rn(){return this.jt>0}start(){this.lastStreamToken=void 0,super.start()}_n(){this.Rn&&this.An([])}En(t,e){return this.connection.vt("Write",t,e)}hn(t){return el(!!t.streamToken,31322),this.lastStreamToken=t.streamToken,el(!t.writeResults||0===t.writeResults.length,55816),this.listener.Vn()}onNext(t){el(!!t.streamToken,12678),this.lastStreamToken=t.streamToken,this.Ht.reset();const e=function(t,e){return t&&t.length>0?(el(void 0!==e,14353),t.map(t=>function(t,e){let n=t.updateTime?md(t.updateTime):md(e);return n.isEqual(xh.min())&&(n=md(e)),new Wu(n,t.transformResults||[])}(t,e))):[]}(t.writeResults,t.commitTime),n=md(t.commitTime);return this.listener.dn(n,e)}fn(){const t={};t.database=function(t){return new yl(["projects",t.databaseId.projectId,"databases",t.databaseId.database]).canonicalString()}(this.serializer),this.nn(t)}An(t){const e={streamToken:this.lastStreamToken,writes:t.map(t=>function(t,e){let n;if(e instanceof ih)n={update:_d(t,e.key,e.value)};else if(e instanceof lh)n={delete:Ed(t,e.key)};else if(e instanceof oh)n={update:_d(t,e.key,e.data),updateMask:Td(e.fieldMask)};else{if(!(e instanceof uh))return Zc(16599,{be:e.type});n={verify:Ed(t,e.key)}}return e.fieldTransforms.length>0&&(n.updateTransforms=e.fieldTransforms.map(t=>function(t,e){const n=e.transform;if(n instanceof Mu)return{fieldPath:e.field.canonicalString(),setToServerValue:"REQUEST_TIME"};if(n instanceof Gu)return{fieldPath:e.field.canonicalString(),appendMissingElements:{values:n.elements}};if(n instanceof Uu)return{fieldPath:e.field.canonicalString(),removeAllFromArray:{values:n.elements}};if(n instanceof $u)return{fieldPath:e.field.canonicalString(),increment:n.h};if(n instanceof Ju)return{fieldPath:e.field.canonicalString(),minimum:n.h};if(n instanceof qu)return{fieldPath:e.field.canonicalString(),maximum:n.h};throw Zc(20930,{transform:e.transform})}(0,t))),e.precondition.isNone||(n.currentDocument=function(t,e){return void 0!==e.updateTime?{updateTime:gd(t,e.updateTime)}:void 0!==e.exists?{exists:e.exists}:Zc(27497)}(t,e.precondition)),n}(this.serializer,t))};this.nn(e)}}class cp{}class lp extends cp{constructor(t,e,n,s){super(),this.authCredentials=t,this.appCheckCredentials=e,this.connection=n,this.serializer=s,this.mn=!1}pn(){if(this.mn)throw new gl(Cl.FAILED_PRECONDITION,"The client has already been terminated.")}nt(t,e,n,s){return this.pn(),Promise.all([this.authCredentials.getToken(),this.appCheckCredentials.getToken()]).then(([r,i])=>this.connection.nt(t,yd(e,n),s,r,i)).catch(t=>{throw"FirebaseError"===t.name?(t.code===Cl.UNAUTHENTICATED&&(this.authCredentials.invalidateToken(),this.appCheckCredentials.invalidateToken()),t):new gl(Cl.UNKNOWN,t.toString())})}_t(t,e,n,s,r){return this.pn(),Promise.all([this.authCredentials.getToken(),this.appCheckCredentials.getToken()]).then(([i,o])=>this.connection._t(t,yd(e,n),s,i,o,r)).catch(t=>{throw"FirebaseError"===t.name?(t.code===Cl.UNAUTHENTICATED&&(this.authCredentials.invalidateToken(),this.appCheckCredentials.invalidateToken()),t):new gl(Cl.UNKNOWN,t.toString())})}terminate(){this.mn=!0,this.connection.terminate()}}const up=new Map;const hp={didRun:!1,sequenceNumbersCollected:0,targetsRemoved:0,documentsRemoved:0},dp=41943040;class pp{static withCacheSize(t){return new pp(t,pp.DEFAULT_COLLECTION_PERCENTILE,pp.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT)}constructor(t,e,n){this.cacheSizeCollectionThreshold=t,this.percentileToCollect=e,this.maximumSequenceNumbersToCollect=n}}pp.DEFAULT_COLLECTION_PERCENTILE=10,pp.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT=1e3,pp.DEFAULT=new pp(dp,pp.DEFAULT_COLLECTION_PERCENTILE,pp.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT),pp.DISABLED=new pp(-1,0,0);class fp{constructor(t,e){this.previousValue=t,e&&(e.sequenceNumberHandler=t=>this.gn(t),this.yn=t=>e.writeSequenceNumber(t))}gn(t){return this.previousValue=Math.max(t,this.previousValue),this.previousValue}next(){const t=++this.previousValue;return this.yn&&this.yn(t),t}}fp.wn=-1;class Cp{constructor(){this.onCommittedListeners=[]}addOnCommittedListener(t){this.onCommittedListeners.push(t)}raiseOnCommittedEvent(){this.onCommittedListeners.forEach(t=>t())}}async function gp(t){if(t.code!==Cl.FAILED_PRECONDITION||"The current tab is not in the required state to perform this operation. It might be necessary to refresh the browser tab."!==t.message)throw t;Qc("LocalStore","Unexpectedly lost primary lease")}class mp{constructor(t){this.nextCallback=null,this.catchCallback=null,this.result=void 0,this.error=void 0,this.isDone=!1,this.callbackAttached=!1,t(t=>{this.isDone=!0,this.result=t,this.nextCallback&&this.nextCallback(t)},t=>{this.isDone=!0,this.error=t,this.catchCallback&&this.catchCallback(t)})}catch(t){return this.next(void 0,t)}next(t,e){return this.callbackAttached&&Zc(59440),this.callbackAttached=!0,this.isDone?this.error?this.wrapFailure(e,this.error):this.wrapSuccess(t,this.result):new mp((n,s)=>{this.nextCallback=e=>{this.wrapSuccess(t,e).next(n,s)},this.catchCallback=t=>{this.wrapFailure(e,t).next(n,s)}})}toPromise(){return new Promise((t,e)=>{this.next(t,e)})}wrapUserFunction(t){try{const e=t();return e instanceof mp?e:mp.resolve(e)}catch(t){return mp.reject(t)}}wrapSuccess(t,e){return t?this.wrapUserFunction(()=>t(e)):mp.resolve(e)}wrapFailure(t,e){return t?this.wrapUserFunction(()=>t(e)):mp.reject(e)}static resolve(t){return new mp((e,n)=>{e(t)})}static reject(t){return new mp((e,n)=>{n(t)})}static waitFor(t){return new mp((e,n)=>{let s=0,r=0,i=!1;t.forEach(t=>{++s,t.next(()=>{++r,i&&r===s&&e()},t=>n(t))}),i=!0,r===s&&e()})}static or(t){let e=mp.resolve(!1);for(const n of t)e=e.next(t=>t?mp.resolve(t):n());return e}static forEach(t,e){const n=[];return t.forEach((t,s)=>{n.push(e.call(this,t,s))}),this.waitFor(n)}static mapArray(t,e){return new mp((n,s)=>{const r=t.length,i=new Array(r);let o=0;for(let a=0;a<r;a++){const B=a;e(t[B]).next(t=>{i[B]=t,++o,o===r&&n(i)},t=>s(t))}})}static doWhile(t,e){return new mp((n,s)=>{const r=()=>{!0===t()?e().next(()=>{r()},s):n()};r()})}}function wp(t){return"IndexedDbTransactionError"===t.name}const yp="LruGarbageCollector";function Ep([t,e],[n,s]){const r=il(t,n);return 0===r?il(e,s):r}class Dp{constructor(t){this.Yn=t,this.buffer=new pl(Ep),this.Zn=0}Xn(){return++this.Zn}er(t){const e=[t,this.Xn()];if(this.buffer.size<this.Yn)this.buffer=this.buffer.add(e);else{const t=this.buffer.last();Ep(e,t)<0&&(this.buffer=this.buffer.delete(t).add(e))}}get maxValue(){return this.buffer.last()[0]}}class _p{constructor(t,e,n){this.garbageCollector=t,this.asyncQueue=e,this.localStore=n,this.tr=null}start(){-1!==this.garbageCollector.params.cacheSizeCollectionThreshold&&this.nr(6e4)}stop(){this.tr&&(this.tr.cancel(),this.tr=null)}get started(){return null!==this.tr}nr(t){Qc(yp,`Garbage collection scheduled in ${t}ms`),this.tr=this.asyncQueue.enqueueAfterDelay("lru_garbage_collection",t,async()=>{this.tr=null;try{await this.localStore.collectGarbage(this.garbageCollector)}catch(t){wp(t)?Qc(yp,"Ignoring IndexedDB error during garbage collection: ",t):await gp(t)}await this.nr(3e5)})}}class bp{constructor(t,e){this.rr=t,this.params=e}calculateTargetCount(t,e){return this.rr.ir(t).next(t=>Math.floor(e/100*t))}nthSequenceNumber(t,e){if(0===e)return mp.resolve(fp.wn);const n=new Dp(e);return this.rr.forEachTarget(t,t=>n.er(t.sequenceNumber)).next(()=>this.rr.sr(t,t=>n.er(t))).next(()=>n.maxValue)}removeTargets(t,e,n){return this.rr.removeTargets(t,e,n)}removeOrphanedDocuments(t,e){return this.rr.removeOrphanedDocuments(t,e)}collect(t,e){return-1===this.params.cacheSizeCollectionThreshold?(Qc("LruGarbageCollector","Garbage collection skipped; disabled"),mp.resolve(hp)):this.getCacheSize(t).next(n=>n<this.params.cacheSizeCollectionThreshold?(Qc("LruGarbageCollector",`Garbage collection skipped; Cache size ${n} is lower than threshold ${this.params.cacheSizeCollectionThreshold}`),hp):this._r(t,e))}getCacheSize(t){return this.rr.getCacheSize(t)}_r(t,e){let n,s,r,i,o,a,B;const c=Date.now();return this.calculateTargetCount(t,this.params.percentileToCollect).next(e=>(e>this.params.maximumSequenceNumbersToCollect?(Qc("LruGarbageCollector",`Capping sequence numbers to collect down to the maximum of ${this.params.maximumSequenceNumbersToCollect} from ${e}`),s=this.params.maximumSequenceNumbersToCollect):s=e,i=Date.now(),this.nthSequenceNumber(t,s))).next(s=>(n=s,o=Date.now(),this.removeTargets(t,n,e))).next(e=>(r=e,a=Date.now(),this.removeOrphanedDocuments(t,n))).next(t=>(B=Date.now(),Kc()<=is.DEBUG&&Qc("LruGarbageCollector",`LRU Garbage Collection\n\tCounted targets in ${i-c}ms\n\tDetermined least recently used ${s} in `+(o-i)+"ms\n"+`\tRemoved ${r} targets in `+(a-o)+"ms\n"+`\tRemoved ${t} documents in `+(B-a)+"ms\n"+`Total Duration: ${B-c}ms`),mp.resolve({didRun:!0,sequenceNumbersCollected:s,targetsRemoved:r,documentsRemoved:t})))}}const vp="firestore.googleapis.com",Ip=!0;class Tp{constructor(t){if(void 0===t.host){if(void 0!==t.ssl)throw new gl(Cl.INVALID_ARGUMENT,"Can't provide ssl option if host option is not set");this.host=vp,this.ssl=Ip}else this.host=t.host,this.ssl=t.ssl??Ip;if(this.isUsingEmulator=void 0!==t.emulatorOptions,this.credentials=t.credentials,this.ignoreUndefinedProperties=!!t.ignoreUndefinedProperties,this.localCache=t.localCache,t._customHeaders&&(this._customHeaders={...t._customHeaders}),void 0===t.cacheSizeBytes)this.cacheSizeBytes=dp;else{if(-1!==t.cacheSizeBytes&&t.cacheSizeBytes<1048576)throw new gl(Cl.INVALID_ARGUMENT,"cacheSizeBytes must be at least 1048576");this.cacheSizeBytes=t.cacheSizeBytes}if(function(t,e,n,s){if(!0===e&&!0===s)throw new gl(Cl.INVALID_ARGUMENT,`${t} and ${n} cannot be used together.`)}("experimentalForceLongPolling",t.experimentalForceLongPolling,"experimentalAutoDetectLongPolling",t.experimentalAutoDetectLongPolling),this.experimentalForceLongPolling=!!t.experimentalForceLongPolling,this.experimentalForceLongPolling?this.experimentalAutoDetectLongPolling=!1:void 0===t.experimentalAutoDetectLongPolling?this.experimentalAutoDetectLongPolling=!0:this.experimentalAutoDetectLongPolling=!!t.experimentalAutoDetectLongPolling,this.experimentalLongPollingOptions=qd(t.experimentalLongPollingOptions??{}),function(t){if(void 0!==t.timeoutSeconds){if(isNaN(t.timeoutSeconds))throw new gl(Cl.INVALID_ARGUMENT,`invalid long polling timeout: ${t.timeoutSeconds} (must not be NaN)`);if(t.timeoutSeconds<5)throw new gl(Cl.INVALID_ARGUMENT,`invalid long polling timeout: ${t.timeoutSeconds} (minimum allowed value is 5)`);if(t.timeoutSeconds>30)throw new gl(Cl.INVALID_ARGUMENT,`invalid long polling timeout: ${t.timeoutSeconds} (maximum allowed value is 30)`)}}(this.experimentalLongPollingOptions),this.useFetchStreams=!!t.useFetchStreams,void 0!==t.grpcFlowControlWindow){if("number"!=typeof t.grpcFlowControlWindow||t.grpcFlowControlWindow<=0||t.grpcFlowControlWindow>2147483647||!Number.isInteger(t.grpcFlowControlWindow))throw new gl(Cl.INVALID_ARGUMENT,"grpcFlowControlWindow must be a positive integer and cannot exceed 2147483647");this.grpcFlowControlWindow=t.grpcFlowControlWindow}}isEqual(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&&function(t,e){return t.timeoutSeconds===e.timeoutSeconds}(this.experimentalLongPollingOptions,t.experimentalLongPollingOptions)&&this.ignoreUndefinedProperties===t.ignoreUndefinedProperties&&this.useFetchStreams===t.useFetchStreams&&this.grpcFlowControlWindow===t.grpcFlowControlWindow&&function(t,e){if(t===e)return!0;if(!t||!e)return!1;const n=Object.keys(t),s=Object.keys(e);if(n.length!==s.length)return!1;for(const s of n)if(t[s]!==e[s])return!1;return!0}(this._customHeaders,t._customHeaders)}}let Op=class{constructor(t,e,n,s){this._authCredentials=t,this._appCheckCredentials=e,this._databaseId=n,this._app=s,this.type="firestore-lite",this._persistenceKey="(lite)",this._settings=new Tp({}),this._settingsFrozen=!1,this._emulatorOptions={},this._terminateTask="notTerminated"}get app(){if(!this._app)throw new gl(Cl.FAILED_PRECONDITION,"Firestore was not initialized using the Firebase SDK. 'app' is not available");return this._app}get _initialized(){return this._settingsFrozen}get _terminated(){return"notTerminated"!==this._terminateTask}_setSettings(t){if(this._settingsFrozen)throw new gl(Cl.FAILED_PRECONDITION,"Firestore has already been started and its settings can no longer be changed. You can only modify settings before calling any other methods on a Firestore object.");this._settings=new Tp(t),this._emulatorOptions=t.emulatorOptions||{},void 0!==t.credentials&&(this._authCredentials=function(t){if(!t)return new Gd;switch(t.type){case"firstParty":return new jd(t.sessionIndex||"0",t.iamToken||null,t.authTokenFactory||null);case"provider":return t.client;default:throw new gl(Cl.INVALID_ARGUMENT,"makeAuthCredentialsProvider failed due to invalid credential type")}}(t.credentials))}_getSettings(){return this._settings}_getEmulatorOptions(){return this._emulatorOptions}_freezeSettings(){return this._settingsFrozen=!0,this._settings}_delete(){return"notTerminated"===this._terminateTask&&(this._terminateTask=this._terminate()),this._terminateTask}async _restart(){"notTerminated"===this._terminateTask?await this._terminate():this._terminateTask="notTerminated"}toJSON(){return{app:this._app,databaseId:this._databaseId,settings:this._settings}}_terminate(){return function(t){const e=up.get(t);e&&(Qc("ComponentProvider","Removing Datastore"),up.delete(t),e.terminate())}(this),Promise.resolve()}};function Ap(t,e,n,s={}){t=Rl(t,Op);const r=Zn(e),i=t._getSettings(),o={...i,emulatorOptions:t._getEmulatorOptions()},a=`${e}:${n}`;r&&ts(`https://${a}`),i.host!==vp&&i.host!==a&&Yc("Host has been set in both settings() and connectFirestoreEmulator(), emulator host will be used.");const B={...i,host:a,ssl:r,emulatorOptions:s};if(!$n(B,o)&&(t._setSettings(B),s.mockUserToken)){let e,n;if("string"==typeof s.mockUserToken)e=s.mockUserToken,n=Fd.MOCK_USER;else{e=Ln(s.mockUserToken,t._app?.options.projectId);const r=s.mockUserToken.sub||s.mockUserToken.user_id;if(!r)throw new gl(Cl.INVALID_ARGUMENT,"mockUserToken must contain 'sub' or 'user_id' field!");n=new Fd(r)}t._authCredentials=new Hd(new Md(e,n))}}class Sp{constructor(t,e,n){this.converter=e,this._query=n,this.type="query",this.firestore=t}withConverter(t){return new Sp(this.firestore,t,this._query)}}class Rp{constructor(t,e,n){this.converter=e,this._key=n,this.type="document",this.firestore=t}get _path(){return this._key.path}get id(){return this._key.path.lastSegment()}get path(){return this._key.path.canonicalString()}get parent(){return new Np(this.firestore,this.converter,this._key.path.popLast())}withConverter(t){return new Rp(this.firestore,t,this._key)}toJSON(){return{type:Rp._jsonSchemaVersion,referencePath:this._key.toString()}}static fromJSON(t,e,n){if(xl(e,Rp._jsonSchema))return new Rp(t,n||null,new Tl(yl.fromString(e.referencePath)))}}Rp._jsonSchemaVersion="firestore/documentReference/1.0",Rp._jsonSchema={type:Nl("string",Rp._jsonSchemaVersion),referencePath:Nl("string")};class Np extends Sp{constructor(t,e,n){super(t,e,function(t){return new Vh(t)}(n)),this._path=n,this.type="collection"}get id(){return this._query.path.lastSegment()}get path(){return this._query.path.canonicalString()}get parent(){const t=this._path.popLast();return t.isEmpty()?null:new Rp(this.firestore,null,new Tl(t))}withConverter(t){return new Np(this.firestore,t,this._path)}}function xp(t,e,...n){if(t=Xn(t),1===arguments.length&&(e=rl.newId()),function(t,e,n){if(!n)throw new gl(Cl.INVALID_ARGUMENT,`Function ${t}() cannot be called with an empty ${e}.`)}("doc","path",e),t instanceof Op){const s=yl.fromString(e,...n);return Ol(s),new Rp(t,null,new Tl(s))}{if(!(t instanceof Rp||t instanceof Np))throw new gl(Cl.INVALID_ARGUMENT,"Expected first argument to doc() to be a CollectionReference, a DocumentReference or FirebaseFirestore");const s=t._path.child(yl.fromString(e,...n));return Ol(s),new Rp(t.firestore,t instanceof Np?t.converter:null,new Tl(s))}}class kp{constructor(t){this._values=(t||[]).map(t=>t)}toArray(){return this._values.map(t=>t)}isEqual(t){return function(t,e){if(t.length!==e.length)return!1;for(let n=0;n<t.length;++n)if(t[n]!==e[n])return!1;return!0}(this._values,t._values)}toJSON(){return{type:kp._jsonSchemaVersion,vectorValues:this._values}}static fromJSON(t){if(xl(t,kp._jsonSchema)){if(Array.isArray(t.vectorValues)&&t.vectorValues.every(t=>"number"==typeof t))return new kp(t.vectorValues);throw new gl(Cl.INVALID_ARGUMENT,"Expected 'vectorValues' field to be a number array")}}}function Lp(t,e,n){if(Pp(t=Xn(t)))return function(t,e,n){if(!Pp(n)||!Al(n)){const s=Sl(n);throw"an object"===s?e.createError(t+" a custom object"):e.createError(t+" "+s)}}("Unsupported field value:",e,t),function(t,e){const n={};return Il(t)?e.path&&e.path.length>0&&e.fieldMask.push(e.path):vl(t,(t,s)=>{const r=Lp(s,e.childContextForField(t));null!=r&&(n[t]=r)}),{mapValue:{fields:n}}}(t,e);if(t instanceof kd)return function(t,e){if(!function(t){switch(t){case 0:case 2:case 1:return!0;case 3:case 4:return!1;default:throw Zc(40011,{dataSource:t})}}(e.dataSource))throw e.createError(`${t._methodName}() can only be used with update() and set()`);if(!e.path)throw e.createError(`${t._methodName}() is not currently supported inside arrays`);const n=t._toFieldTransform(e);n&&e.fieldTransforms.push(n)}(t,e),null;if(void 0===t&&e.ignoreUndefinedProperties)return null;if(e.path&&e.fieldMask.push(e.path),t instanceof Array){if(e.settings.arrayElement&&4!==e.dataSource)throw e.createError("Nested arrays are not supported");return function(t,e){const n=[];let s=0;for(const r of t){let t=Lp(r,e.childContextForArray(s));null==t&&(t={nullValue:"NULL_VALUE"}),n.push(t),s++}return{arrayValue:{values:n}}}(t,e)}return function(t,e){if(null===(t=Xn(t)))return{nullValue:"NULL_VALUE"};if("number"==typeof t)return xu(e.serializer,t);if("boolean"==typeof t)return{booleanValue:t};if("string"==typeof t)return{stringValue:t};if(t instanceof Date){const n=Fl.fromDate(t);return{timestampValue:pd(e.serializer,n)}}if(t instanceof Fl){const n=new Fl(t.seconds,1e3*Math.floor(t.nanoseconds/1e3));return{timestampValue:pd(e.serializer,n)}}if(Fp(t)){const n=Fl.fromInstant(t),s=new Fl(n.seconds,1e3*Math.floor(n.nanoseconds/1e3));return{timestampValue:pd(e.serializer,s)}}if(t instanceof Ld)return{geoPointValue:{latitude:t.latitude,longitude:t.longitude}};if(t instanceof Nd)return{bytesValue:Cd(e.serializer,t._byteString)};if(t instanceof Rp){const n=e.databaseId,s=t.firestore._databaseId;if(!s.isEqual(n))throw e.createError(`Document reference is for database ${s.projectId}/${s.database} but should be for database ${n.projectId}/${n.database}`);return{referenceValue:wd(t.firestore._databaseId||e.databaseId,t._key.path)}}if(t instanceof kp)return function(t,e){const n=t instanceof kp?t.toArray():t,s={fields:{[nu]:{stringValue:iu},[ou]:{arrayValue:{values:n.map(t=>{if("number"!=typeof t)throw e.createError("VectorValues must only contain numeric values.");return Ru(e.serializer,t)})}}}};return{mapValue:s}}(t,e);if(Od(t))return t._toProto(e.serializer);throw e.createError(`Unsupported field value: ${Sl(t)}`)}(t,e)}function Fp(t){if("object"!=typeof t||null===t)return!1;if("undefined"!=typeof Temporal&&"function"==typeof Temporal.Instant&&t instanceof Temporal.Instant)return!0;const e=t;return"Temporal.Instant"===e[Symbol.toStringTag]&&"bigint"==typeof e.t}function Pp(t){return!("object"!=typeof t||null===t||t instanceof Array||t instanceof Date||t instanceof Fl||t instanceof Ld||t instanceof Nd||t instanceof Rp||t instanceof kd||t instanceof kp||Fp(t)||Od(t))}function Mp(t,e,n){if((e=Xn(e))instanceof xd)return e._internalPath;if("string"==typeof e)return function(t,e){if(e.search(Gp)>=0)throw Hp(`Invalid field path (${e}). Paths must not contain '~', '*', '/', '[', or ']'`,t);try{return new xd(...e.split("."))._internalPath}catch(n){throw Hp(`Invalid field path (${e}). Paths must not be empty, begin with '.', end with '.', or contain '..'`,t)}}(t,e);throw Hp("Field path arguments must be of type string or ",t)}kp._jsonSchemaVersion="firestore/vectorValue/1.0",kp._jsonSchema={type:Nl("string",kp._jsonSchemaVersion),vectorValues:Nl("object")};const Gp=new RegExp("[~\\*/\\[\\]]");function Hp(t,e,n,s,r){let i=`Function ${e}() called with invalid data`;i+=". ";return new gl(Cl.INVALID_ARGUMENT,i+t+"")}class Up{constructor(t){this.optionDefinitions=t}_getKnownOptions(t,e){const n=Au.empty();for(const s in this.optionDefinitions)if(this.optionDefinitions.hasOwnProperty(s)){const r=this.optionDefinitions[s];if(s in t){const i=t[s];let o;r.nestedOptions&&Al(i)?o={mapValue:{fields:new Up(r.nestedOptions).getOptionsProto(e,i)}}:i&&(o=Lp(i,e)??void 0),o&&n.set(Dl.fromServerFormat(r.serverName),o)}}return n}getOptionsProto(t,e,n){const s=this._getKnownOptions(e,t);if(n){const e=new Map(function(t,e){const n=[];for(const s in t)Object.prototype.hasOwnProperty.call(t,s)&&n.push(e(t[s],s,t));return n}(n,(e,n)=>[Dl.fromServerFormat(n),void 0!==e?Lp(e,t):null]));s.setAll(e)}return s.value.mapValue.fields??{}}}function Vp(t){let e;return t instanceof Jp?t:(e=Al(t)?function(t){const e=[];for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)){const s=t[n];e.push(Xp(n)),e.push(Vp(s))}return new tf("map",e,"map")}(t):t instanceof Array?function(t){return function(t,e){return new tf("array",t.map(t=>Vp(t)),e)}(t,"array")}(t):Zp(t,void 0),e)}function jp(t){if(t instanceof Jp)return t;if(t instanceof kp)return Xp(t);if(Array.isArray(t))return Xp(function(t){return new kp(t)}(t));throw new Error("Unsupported value: "+typeof t)}function $p(t){return function(t){return"string"==typeof t}(t)?function(t){return function(t,e){return new Wp("string"==typeof t?ml===t?new xd(ml)._internalPath:Mp("field",t):t._internalPath,e)}(t,"field")}(t):Vp(t)}class Jp{constructor(){this._protoValueType="ProtoValue"}add(t){return new tf("add",[this,Vp(t)],"add")}asBoolean(){if(this instanceof ef)return this;if(this instanceof Yp)return new sf(this);if(this instanceof Wp)return new rf(this);if(this instanceof tf)return new nf(this);throw new gl("invalid-argument",`Conversion of type ${typeof this} to BooleanExpression not supported.`)}subtract(t){return new tf("subtract",[this,Vp(t)],"subtract")}multiply(t){return new tf("multiply",[this,Vp(t)],"multiply")}divide(t){return new tf("divide",[this,Vp(t)],"divide")}mod(t){return new tf("mod",[this,Vp(t)],"mod")}equal(t){return new tf("equal",[this,Vp(t)],"equal").asBoolean()}notEqual(t){return new tf("not_equal",[this,Vp(t)],"notEqual").asBoolean()}lessThan(t){return new tf("less_than",[this,Vp(t)],"lessThan").asBoolean()}lessThanOrEqual(t){return new tf("less_than_or_equal",[this,Vp(t)],"lessThanOrEqual").asBoolean()}greaterThan(t){return new tf("greater_than",[this,Vp(t)],"greaterThan").asBoolean()}greaterThanOrEqual(t){return new tf("greater_than_or_equal",[this,Vp(t)],"greaterThanOrEqual").asBoolean()}arrayConcat(t,...e){const n=[t,...e].map(t=>Vp(t));return new tf("array_concat",[this,...n],"arrayConcat")}arrayContains(t){return new tf("array_contains",[this,Vp(t)],"arrayContains").asBoolean()}arrayContainsAll(t){const e=Array.isArray(t)?new Qp(t.map(Vp),"arrayContainsAll"):t;return new tf("array_contains_all",[this,e],"arrayContainsAll").asBoolean()}arrayContainsAny(t){const e=Array.isArray(t)?new Qp(t.map(Vp),"arrayContainsAny"):t;return new tf("array_contains_any",[this,e],"arrayContainsAny").asBoolean()}arrayReverse(){return new tf("array_reverse",[this])}arrayLength(){return new tf("array_length",[this],"arrayLength")}equalAny(t){const e=Array.isArray(t)?new Qp(t.map(Vp),"equalAny"):t;return new tf("equal_any",[this,e],"equalAny").asBoolean()}notEqualAny(t){const e=Array.isArray(t)?new Qp(t.map(Vp),"notEqualAny"):t;return new tf("not_equal_any",[this,e],"notEqualAny").asBoolean()}exists(){return new tf("exists",[this],"exists").asBoolean()}charLength(){return new tf("char_length",[this],"charLength")}like(t){return new tf("like",[this,Vp(t)],"like").asBoolean()}regexContains(t){return new tf("regex_contains",[this,Vp(t)],"regexContains").asBoolean()}regexFind(t){return new tf("regex_find",[this,Vp(t)],"regexFind")}regexFindAll(t){return new tf("regex_find_all",[this,Vp(t)],"regexFindAll")}regexMatch(t){return new tf("regex_match",[this,Vp(t)],"regexMatch").asBoolean()}stringContains(t){return new tf("string_contains",[this,Vp(t)],"stringContains").asBoolean()}startsWith(t){return new tf("starts_with",[this,Vp(t)],"startsWith").asBoolean()}endsWith(t){return new tf("ends_with",[this,Vp(t)],"endsWith").asBoolean()}toLower(){return new tf("to_lower",[this],"toLower")}toUpper(){return new tf("to_upper",[this],"toUpper")}trim(t){const e=[this];return t&&e.push(Vp(t)),new tf("trim",e,"trim")}ltrim(t){const e=[this];return t&&e.push(Vp(t)),new tf("ltrim",e,"ltrim")}rtrim(t){const e=[this];return t&&e.push(Vp(t)),new tf("rtrim",e,"rtrim")}type(){return new tf("type",[this])}isType(t){return new tf("is_type",[this,Xp(t)],"isType").asBoolean()}stringConcat(t,...e){const n=[t,...e].map(Vp);return new tf("string_concat",[this,...n],"stringConcat")}stringIndexOf(t){return new tf("string_index_of",[this,Vp(t)],"stringIndexOf")}stringRepeat(t){return new tf("string_repeat",[this,Vp(t)],"stringRepeat")}stringReplaceAll(t,e){return new tf("string_replace_all",[this,Vp(t),Vp(e)],"stringReplaceAll")}stringReplaceOne(t,e){return new tf("string_replace_one",[this,Vp(t),Vp(e)],"stringReplaceOne")}concat(t,...e){const n=[t,...e].map(Vp);return new tf("concat",[this,...n],"concat")}reverse(){return new tf("reverse",[this],"reverse")}arrayFilter(t,e){return new tf("array_filter",[this,Vp(t),e],"arrayFilter")}arrayTransform(t,e){return new tf("array_transform",[this,Vp(t),e],"arrayTransform")}arrayTransformWithIndex(t,e,n){return new tf("array_transform",[this,Vp(t),Vp(e),n],"arrayTransformWithIndex")}arraySlice(t,e){const n=[this,Vp(t)];return void 0!==e&&n.push(Vp(e)),new tf("array_slice",n,"arraySlice")}arrayFirst(){return new tf("array_first",[this],"arrayFirst")}arrayFirstN(t){return new tf("array_first_n",[this,Vp(t)],"arrayFirstN")}arrayLast(){return new tf("array_last",[this],"arrayLast")}arrayLastN(t){return new tf("array_last_n",[this,Vp(t)],"arrayLastN")}arrayMaximum(){return new tf("maximum",[this],"arrayMaximum")}arrayMaximumN(t){return new tf("maximum_n",[this,Vp(t)],"arrayMaximumN")}arrayMinimum(){return new tf("minimum",[this],"arrayMinimum")}arrayMinimumN(t){return new tf("minimum_n",[this,Vp(t)],"arrayMinimumN")}arrayIndexOf(t){return new tf("array_index_of",[this,Vp(t),Vp("first")],"arrayIndexOf")}arrayLastIndexOf(t){return new tf("array_index_of",[this,Vp(t),Vp("last")],"arrayLastIndexOf")}arrayIndexOfAll(t){return new tf("array_index_of_all",[this,Vp(t)],"arrayIndexOfAll")}byteLength(){return new tf("byte_length",[this],"byteLength")}ceil(){return new tf("ceil",[this])}floor(){return new tf("floor",[this])}abs(){return new tf("abs",[this])}exp(){return new tf("exp",[this])}mapGet(t){return new tf("map_get",[this,Xp(t)],"mapGet")}mapSet(t,e,...n){const s=[this,Vp(t),Vp(e),...n.map(Vp)];return new tf("map_set",s,"mapSet")}mapKeys(){return new tf("map_keys",[this],"mapKeys")}mapValues(){return new tf("map_values",[this],"mapValues")}mapEntries(){return new tf("map_entries",[this],"mapEntries")}getField(t){return new tf("get_field",[this,Vp(t)],"get_field")}count(){return qp._create("count",[this],"count")}sum(){return qp._create("sum",[this],"sum")}average(){return qp._create("average",[this],"average")}minimum(){return qp._create("minimum",[this],"minimum")}maximum(){return qp._create("maximum",[this],"maximum")}first(){return qp._create("first",[this],"first")}last(){return qp._create("last",[this],"last")}arrayAgg(){return qp._create("array_agg",[this],"arrayAgg")}arrayAggDistinct(){return qp._create("array_agg_distinct",[this],"arrayAggDistinct")}countDistinct(){return qp._create("count_distinct",[this],"countDistinct")}logicalMaximum(t,...e){const n=[t,...e];return new tf("maximum",[this,...n.map(Vp)],"logicalMaximum")}logicalMinimum(t,...e){const n=[t,...e];return new tf("minimum",[this,...n.map(Vp)],"minimum")}vectorLength(){return new tf("vector_length",[this],"vectorLength")}cosineDistance(t){return new tf("cosine_distance",[this,jp(t)],"cosineDistance")}dotProduct(t){return new tf("dot_product",[this,jp(t)],"dotProduct")}euclideanDistance(t){return new tf("euclidean_distance",[this,jp(t)],"euclideanDistance")}unixMicrosToTimestamp(){return new tf("unix_micros_to_timestamp",[this],"unixMicrosToTimestamp")}timestampToUnixMicros(){return new tf("timestamp_to_unix_micros",[this],"timestampToUnixMicros")}unixMillisToTimestamp(){return new tf("unix_millis_to_timestamp",[this],"unixMillisToTimestamp")}timestampToUnixMillis(){return new tf("timestamp_to_unix_millis",[this],"timestampToUnixMillis")}unixSecondsToTimestamp(){return new tf("unix_seconds_to_timestamp",[this],"unixSecondsToTimestamp")}timestampToUnixSeconds(){return new tf("timestamp_to_unix_seconds",[this],"timestampToUnixSeconds")}timestampAdd(t,e){return new tf("timestamp_add",[this,Vp(t),Vp(e)],"timestampAdd")}timestampSubtract(t,e){return new tf("timestamp_subtract",[this,Vp(t),Vp(e)],"timestampSubtract")}timestampDiff(t,e){return new tf("timestamp_diff",[this,$p(t),Vp(e)],"timestampDiff")}timestampExtract(t,e){const n=[this,Vp(t)];return e&&n.push(Vp(e)),new tf("timestamp_extract",n,"timestampExtract")}documentId(){return new tf("document_id",[this],"documentId")}parent(){return new tf("parent",[this],"parent")}substring(t,e){const n=Vp(t);return new tf("substring",void 0===e?[this,n]:[this,n,Vp(e)],"substring")}arrayGet(t){return new tf("array_get",[this,Vp(t)],"arrayGet")}isError(){return new tf("is_error",[this],"isError").asBoolean()}ifError(t){const e=new tf("if_error",[this,Vp(t)],"ifError");return t instanceof ef?e.asBoolean():e}isAbsent(){return new tf("is_absent",[this],"isAbsent").asBoolean()}mapRemove(t){return new tf("map_remove",[this,Vp(t)],"mapRemove")}mapMerge(t,...e){const n=Vp(t),s=e.map(Vp);return new tf("map_merge",[this,n,...s],"mapMerge")}pow(t){return new tf("pow",[this,Vp(t)])}trunc(t){return void 0===t?new tf("trunc",[this]):new tf("trunc",[this,Vp(t)],"trunc")}round(t){return void 0===t?new tf("round",[this]):new tf("round",[this,Vp(t)],"round")}collectionId(){return new tf("collection_id",[this])}length(){return new tf("length",[this])}ln(){return new tf("ln",[this])}sqrt(){return new tf("sqrt",[this])}stringReverse(){return new tf("string_reverse",[this])}ifAbsent(t){return new tf("if_absent",[this,Vp(t)],"ifAbsent")}ifNull(t){return new tf("if_null",[this,Vp(t)],"ifNull")}coalesce(t,...e){return new tf("coalesce",[this,Vp(t),...e.map(Vp)],"coalesce")}join(t){return new tf("join",[this,Vp(t)],"join")}log10(){return new tf("log10",[this])}arraySum(){return new tf("sum",[this])}split(t){return new tf("split",[this,Vp(t)])}timestampTruncate(t,e){const n=[this,Vp(t)];return e&&n.push(Vp(e)),new tf("timestamp_trunc",n)}ascending(){return function(t){return new of($p(t),"ascending","ascending")}(this)}descending(){return function(t){return new of($p(t),"descending","descending")}(this)}as(t){return new Kp(this,t,"as")}}class qp{constructor(t,e){this.name=t,this.params=e,this.exprType="AggregateFunction",this._protoValueType="ProtoValue"}static _create(t,e,n){const s=new qp(t,e);return s._methodName=n,s}as(t){return new zp(this,t,"as")}_toProto(t){return{functionValue:{name:this.name,args:this.params.map(e=>e._toProto(t))}}}_readUserData(t){t=this._methodName?t.contextWith({methodName:this._methodName}):t,this.params.forEach(e=>e._readUserData(t))}}class zp{constructor(t,e,n){this.aggregate=t,this.alias=e,this._methodName=n}_readUserData(t){this.aggregate._readUserData(t)}}class Kp{constructor(t,e,n){this.expr=t,this.alias=e,this._methodName=n,this.exprType="AliasedExpression",this.selectable=!0}_readUserData(t){this.expr._readUserData(t)}}class Qp extends Jp{constructor(t,e){super(),this.cr=t,this._methodName=e,this.expressionType="ListOfExpressions"}_toProto(t){return{arrayValue:{values:this.cr.map(e=>e._toProto(t))}}}_readUserData(t){this.cr.forEach(e=>e._readUserData(t))}}class Wp extends Jp{constructor(t,e){super(),this.fieldPath=t,this._methodName=e,this.expressionType="Field",this.selectable=!0}get _fieldPath(){return this.fieldPath}get fieldName(){return this.fieldPath.canonicalString()}get alias(){return this.fieldName}get expr(){return this}geoDistance(t){return new tf("geo_distance",[this,Vp(t)],"geoDistance")}_toProto(t){return{fieldReferenceValue:this.fieldPath.canonicalString()}}_readUserData(t){}}class Yp extends Jp{constructor(t,e){super(),this.value=t,this._methodName=e,this.expressionType="Constant"}static _fromProto(t){const e=new Yp(t,void 0);return e._protoValue=t,e}_toProto(t){return el(void 0!==this._protoValue,237),this._protoValue}_getValue(){return this._protoValue}_readUserData(t){t=this._methodName?t.contextWith({methodName:this._methodName}):t,function(t){return"object"==typeof t&&null!==t&&!!("nullValue"in t&&(null===t.nullValue||"NULL_VALUE"===t.nullValue)||"booleanValue"in t&&(null===t.booleanValue||"boolean"==typeof t.booleanValue)||"integerValue"in t&&(null===t.integerValue||"number"==typeof t.integerValue||"string"==typeof t.integerValue)||"doubleValue"in t&&(null===t.doubleValue||"number"==typeof t.doubleValue)||"timestampValue"in t&&(null===t.timestampValue||function(t){return"object"==typeof t&&null!==t&&"seconds"in t&&(null===t.seconds||"number"==typeof t.seconds||"string"==typeof t.seconds)&&"nanos"in t&&(null===t.nanos||"number"==typeof t.nanos)}(t.timestampValue))||"stringValue"in t&&(null===t.stringValue||"string"==typeof t.stringValue)||"bytesValue"in t&&(null===t.bytesValue||t.bytesValue instanceof Uint8Array)||"referenceValue"in t&&(null===t.referenceValue||"string"==typeof t.referenceValue)||"geoPointValue"in t&&(null===t.geoPointValue||function(t){return"object"==typeof t&&null!==t&&"latitude"in t&&(null===t.latitude||"number"==typeof t.latitude)&&"longitude"in t&&(null===t.longitude||"number"==typeof t.longitude)}(t.geoPointValue))||"arrayValue"in t&&(null===t.arrayValue||function(t){return"object"==typeof t&&null!==t&&!(!("values"in t)||null!==t.values&&!Array.isArray(t.values))}(t.arrayValue))||"mapValue"in t&&(null===t.mapValue||function(t){return"object"==typeof t&&null!==t&&!(!("fields"in t)||null!==t.fields&&!Al(t.fields))}(t.mapValue))||"fieldReferenceValue"in t&&(null===t.fieldReferenceValue||"string"==typeof t.fieldReferenceValue)||"functionValue"in t&&(null===t.functionValue||function(t){return"object"==typeof t&&null!==t&&!(!("name"in t)||null!==t.name&&"string"!=typeof t.name||!("args"in t)||null!==t.args&&!Array.isArray(t.args))}(t.functionValue))||"pipelineValue"in t&&(null===t.pipelineValue||function(t){return"object"==typeof t&&null!==t&&!(!("stages"in t)||null!==t.stages&&!Array.isArray(t.stages))}(t.pipelineValue)))}(this._protoValue)||(this._protoValue=Lp(this.value,t))}}function Xp(t,e){return Zp(t,"constant")}function Zp(t,e){const n=new Yp(t,e);return"boolean"==typeof t?new sf(n):n}class tf extends Jp{constructor(t,e,n,s){super(),this.name=t,this.params=e,this.expressionType="Function",this._optionsProto=void 0,void 0!==n&&(this._methodName=n),void 0!==s&&(this._options=s)}get _optionsUtil(){return new Up({})}_toProto(t){const e={functionValue:{name:this.name,args:this.params.map(e=>e._toProto(t))}};return this._optionsProto&&(e.functionValue.options=this._optionsProto),e}_readUserData(t){t=this._methodName?t.contextWith({methodName:this._methodName}):t,this.params.forEach(e=>e._readUserData(t)),this._options&&(this._optionsProto=this._optionsUtil.getOptionsProto(t,this._options))}}class ef extends Jp{get _methodName(){return this._expr._methodName}countIf(){return qp._create("count_if",[this],"countIf")}not(){return new tf("not",[this],"not").asBoolean()}conditional(t,e){return new tf("conditional",[this,t,e],"conditional")}ifError(t){const e=Vp(t),n=new tf("if_error",[this,e],"ifError");return e instanceof ef?n.asBoolean():n}_toProto(t){return this._expr._toProto(t)}_readUserData(t){this._expr._readUserData(t)}}class nf extends ef{constructor(t){super(),this._expr=t,this.expressionType="Function"}}class sf extends ef{constructor(t){super(),this._expr=t,this.expressionType="Constant"}_getValue(){return this._expr._getValue()}}class rf extends ef{constructor(t){super(),this._expr=t,this.expressionType="Field"}}class of{constructor(t,e,n){this.expr=t,this.direction=e,this._methodName=n,this._protoValueType="ProtoValue"}_toProto(t){return{mapValue:{fields:{direction:Sd(this.direction),expression:this.expr._toProto(t)}}}}_readUserData(t){this.expr._readUserData(t)}}class af{constructor(t){this.optionsProto=void 0,({rawOptions:this.rawOptions,...this.knownOptions}=t)}_readUserData(t){this.optionsProto=this._optionsUtil.getOptionsProto(t,this.knownOptions,this.rawOptions)}_toProto(t){return{name:this._name,options:this.optionsProto}}}class Bf extends af{get _name(){return"add_fields"}get _optionsUtil(){return new Up({})}constructor(t,e){super(e),this.fields=t}_toProto(t){return{...super._toProto(t),args:[Ad(t,this.fields)]}}_readUserData(t){super._readUserData(t),Ef(this.fields,t)}}class cf extends af{get _name(){return"aggregate"}get _optionsUtil(){return new Up({})}constructor(t,e,n){super(n),this.groups=t,this.accumulators=e}_toProto(t){return{...super._toProto(t),args:[Ad(t,this.accumulators),Ad(t,this.groups)]}}_readUserData(t){super._readUserData(t),Ef(this.groups,t),Ef(this.accumulators,t)}}class lf extends af{get _name(){return"distinct"}get _optionsUtil(){return new Up({})}constructor(t,e){super(e),this.groups=t}_toProto(t){return{...super._toProto(t),args:[Ad(t,this.groups)]}}_readUserData(t){super._readUserData(t),Ef(this.groups,t)}}class uf extends af{get _name(){return"collection"}get _optionsUtil(){return new Up({forceIndex:{serverName:"force_index"}})}constructor(t,e){super(e),this.hr=t.startsWith("/")?t:"/"+t}_toProto(t){return{...super._toProto(t),args:[{referenceValue:this.hr}]}}_readUserData(t){super._readUserData(t)}}class hf extends af{get _name(){return"collection_group"}get _optionsUtil(){return new Up({forceIndex:{serverName:"force_index"}})}constructor(t,e){super(e),this.collectionId=t}_toProto(t){return{...super._toProto(t),args:[{referenceValue:""},{stringValue:this.collectionId}]}}_readUserData(t){super._readUserData(t)}}class df extends af{get _name(){return"database"}get _optionsUtil(){return new Up({})}_toProto(t){return{...super._toProto(t)}}_readUserData(t){super._readUserData(t)}}class pf extends af{get _name(){return"documents"}get _optionsUtil(){return new Up({})}constructor(t,e){if(super(e),!t||0===t.length)throw new gl(Cl.INVALID_ARGUMENT,"Empty document paths are not allowed in DocumentsSource");const n=t.map(t=>t.startsWith("/")?t:"/"+t),s=new Set(n);if(s.size!==n.length)throw new gl(Cl.INVALID_ARGUMENT,"Duplicate document paths are not allowed in DocumentsSource");this.Tr=n,this.Pr=s}_toProto(t){return{...super._toProto(t),args:this.Tr.map(t=>({referenceValue:t}))}}_readUserData(t){super._readUserData(t)}}class ff extends af{get _name(){return"where"}get _optionsUtil(){return new Up({})}constructor(t,e){super(e),this.condition=t}_toProto(t){return{...super._toProto(t),args:[this.condition._toProto(t)]}}_readUserData(t){super._readUserData(t),Ef(this.condition,t)}}class Cf extends af{get _name(){return"limit"}get _optionsUtil(){return new Up({})}constructor(t,e){el(!isNaN(t)&&t!==1/0&&t!==-1/0,34860),super(e),this.limit=t}_toProto(t){return{...super._toProto(t),args:[xu(t,this.limit)]}}}class gf extends af{get _name(){return"offset"}get _optionsUtil(){return new Up({})}constructor(t,e){super(e),this.offset=t}_toProto(t){return{...super._toProto(t),args:[xu(t,this.offset)]}}}class mf extends af{get _name(){return"select"}get _optionsUtil(){return new Up({})}constructor(t,e){super(e),this.selections=t}_toProto(t){return{...super._toProto(t),args:[Ad(t,this.selections)]}}_readUserData(t){super._readUserData(t),Ef(this.selections,t)}}class wf extends af{get _name(){return"sort"}get _optionsUtil(){return new Up({})}constructor(t,e){super(e),this.orderings=t}_toProto(t){return{...super._toProto(t),args:this.orderings.map(e=>e._toProto(t))}}_readUserData(t){super._readUserData(t),Ef(this.orderings,t)}}class yf extends af{get _name(){return"replace_with"}get _optionsUtil(){return new Up({})}constructor(t,e){super(e),this.map=t}_toProto(t){return{...super._toProto(t),args:[this.map._toProto(t),Sd(yf.Ir)]}}_readUserData(t){super._readUserData(t),Ef(this.map,t)}}function Ef(t,e){return function(t){return"function"==typeof t._readUserData}(t)?t._readUserData(e):Array.isArray(t)||t instanceof Map?t.forEach(t=>t._readUserData(e)):Object.values(t).forEach(t=>t._readUserData(e)),t}yf.Ir="full_replace";class Df{constructor(t,e,n){this.serializer=t,this.stages=e,this.listenOptions=n,this.isCorePipeline=!0}getPipelineCollection(){return bf(this)}getPipelineCollectionGroup(){return vf(this)}getPipelineCollectionId(){return function(t){switch(_f(t)){case"collection":return yl.fromString(bf(t)).lastSegment();case"collection_group":return vf(t);default:return}}(this)}getPipelineDocuments(){return If(this)}getPipelineFlavor(){return function(t){let e="exact";return t.stages.forEach((n,s)=>{n._name!==lf.name&&n._name!==cf.name||(e="keyless"),n._name===mf.name&&"exact"===e&&(e="augmented"),n._name===Bf.name&&s<t.stages.length-1&&"exact"===e&&(e="augmented")}),e}(this)}getPipelineSourceType(){return _f(this)}}function _f(t){const e=t.stages[0];return e instanceof uf||e instanceof hf||e instanceof df||e instanceof pf?e._name:"unknown"}function bf(t){if("collection"===_f(t))return t.stages[0].hr}function vf(t){if("collection_group"===_f(t))return t.stages[0].collectionId}function If(t){if("documents"===_f(t))return t.stages[0].Tr}class Tf{constructor(t,e){this.type=t,this.value=e}static mr(){return new Tf("ERROR",void 0)}static pr(){return new Tf("UNSET",void 0)}static gr(){return new Tf("NULL",au)}static newValue(t){return _u(t)?new Tf("NULL",au):function(t){return!!t&&"booleanValue"in t}(t)?new Tf("BOOLEAN",t):wu(t)?new Tf("INT",t):yu(t)?new Tf("DOUBLE",t):function(t){return!!t&&"timestampValue"in t&&!!t.timestampValue}(t)?new Tf("TIMESTAMP",t):function(t){return!!t&&"stringValue"in t}(t)?new Tf("STRING",t):function(t){return!!t&&"bytesValue"in t}(t)?new Tf("BYTES",t):t.referenceValue?new Tf("REFERENCE",t):t.geoPointValue?new Tf("GEO_POINT",t):Du(t)?new Tf("ARRAY",t):Iu(t)?new Tf("VECTOR",t):vu(t)?new Tf("MAP",t):new Tf("ERROR",void 0)}yr(){return"ERROR"===this.type||"UNSET"===this.type}wr(){return"NULL"===this.type}}function Of(t){if(!t.yr())return t.value}function Af(t){return t instanceof ef?t._expr:t}function Sf(t){if((t=Af(t))instanceof Wp)return new Rf(t);if(t instanceof Yp)return new Nf(t);if(t instanceof Qp)return new xf(t);if(t instanceof tf){if("add"===t.name)return new Hf(t);if("subtract"===t.name)return new Uf(t);if("multiply"===t.name)return new Vf(t);if("divide"===t.name)return new jf(t);if("mod"===t.name)return new $f(t);if("and"===t.name)return new Jf(t);if("equal"===t.name)return new aC(t);if("not_equal"===t.name)return new BC(t);if("less_than"===t.name)return new cC(t);if("less_than_or_equal"===t.name)return new lC(t);if("greater_than"===t.name)return new uC(t);if("greater_than_or_equal"===t.name)return new hC(t);if("array_concat"===t.name)return new dC(t);if("array_reverse"===t.name)return new pC(t);if("array_contains"===t.name)return new fC(t);if("array_contains_all"===t.name)return new CC(t);if("array_contains_any"===t.name)return new gC(t);if("array_length"===t.name)return new mC(t);if("array_element"===t.name)return new wC(t);if("equal_any"===t.name)return new Qf(t);if("not_equal_any"===t.name)return new Wf(t);if("is_nan"===t.name)return new Yf(t);if("is_not_nan"===t.name)return new Xf(t);if("is_null"===t.name)return new Zf(t);if("is_not_null"===t.name)return new tC(t);if("is_error"===t.name)return new eC(t);if("exists"===t.name)return new nC(t);if("not"===t.name)return new qf(t);if("or"===t.name)return new zf(t);if("xor"===t.name)return new Kf(t);if("conditional"===t.name)return new sC(t);if("maximum"===t.name)return new rC(t);if("minimum"===t.name)return new iC(t);if("reverse"===t.name)return new yC(t);if("replace_first"===t.name)return new EC(t);if("replace_all"===t.name)return new DC(t);if("char_length"===t.name)return new _C(t);if("byte_length"===t.name)return new bC(t);if("like"===t.name)return new IC(t);if("regex_contains"===t.name)return new TC(t);if("regex_match"===t.name)return new OC(t);if("string_contains"===t.name)return new AC(t);if("starts_with"===t.name)return new SC(t);if("ends_with"===t.name)return new RC(t);if("to_lower"===t.name)return new NC(t);if("to_upper"===t.name)return new xC(t);if("trim"===t.name)return new kC(t);if("string_concat"===t.name)return new LC(t);if("map_get"===t.name)return new FC(t);if("cosine_distance"===t.name)return new MC(t);if("dot_product"===t.name)return new GC(t);if("euclidean_distance"===t.name)return new HC(t);if("vector_length"===t.name)return new UC(t);if("unix_micros_to_timestamp"===t.name)return new ng(t);if("timestamp_to_unix_micros"===t.name)return new og(t);if("unix_millis_to_timestamp"===t.name)return new sg(t);if("timestamp_to_unix_millis"===t.name)return new ag(t);if("unix_seconds_to_timestamp"===t.name)return new rg(t);if("timestamp_to_unix_seconds"===t.name)return new Bg(t);if("timestamp_add"===t.name)return new lg(t);if("timestamp_subtract"===t.name)return new ug(t)}throw new Error(`Unknown Expr : ${t}`)}class Rf{constructor(t){this.expr=t}evaluate(t,e){if(this.expr.fieldName===ml)return Tf.newValue({referenceValue:Ed(t.serializer,e.key)});if("__update_time__"===this.expr.fieldName)return Tf.newValue({timestampValue:gd(t.serializer,e.version)});if("__create_time__"===this.expr.fieldName)return Tf.newValue({timestampValue:gd(t.serializer,e.createTime)});const n=e.data.field(this.expr._fieldPath);return n?zl(n)?Tf.newValue(function(t,e){if("estimate"===t.serverTimestampBehavior)return{timestampValue:gd(t.serializer,xh.fromTimestamp(Ql(e)))};if("previous"===t.serverTimestampBehavior){const t=Kl(e);if(t)return t}return{nullValue:"NULL_VALUE"}}(t,n)):Tf.newValue(n):Tf.pr()}}class Nf{constructor(t){this.expr=t}evaluate(t,e){return Tf.newValue(this.expr._getValue())}}class xf{constructor(t){this.expr=t}evaluate(t,e){const n=this.expr.cr.map(n=>Sf(n).evaluate(t,e));return n.some(t=>t.yr())?Tf.mr():Tf.newValue({arrayValue:{values:n.map(t=>t.value)}})}}function kf(t){return yu(t)?Number(t.doubleValue):Number(t.integerValue)}function Lf(t){return BigInt(t.integerValue)}const Ff=BigInt("0x7fffffffffffffff"),Pf=-BigInt("0x8000000000000000");class Mf{constructor(t){this.expr=t}evaluate(t,e){el(this.expr.params.length>=2,24778);const n=Sf(this.expr.params[0]).evaluate(t,e),s=Sf(this.expr.params[1]).evaluate(t,e);let r=this.br(n,s);for(const n of this.expr.params.slice(2)){const s=Sf(n).evaluate(t,e);r=this.br(r,s)}return r}br(t,e){if(t.yr()||e.yr())return Tf.mr();if(t.wr()||e.wr())return Tf.gr();const n=t.value,s=e.value;if(!yu(n)&&!wu(n)||!yu(s)&&!wu(s))return Tf.mr();if(yu(n)||yu(s)){const t=this.Sr(n,s);return t?Tf.newValue(t):Tf.mr()}if(wu(n)&&wu(s)){const t=this.vr(n,s);return void 0===t?Tf.mr():"number"==typeof t?Tf.newValue({doubleValue:t}):t<Pf||t>Ff?Tf.mr():Tf.newValue({integerValue:`${t}`})}return Tf.mr()}}function Gf(t,e){return lu(t)!==lu(e)?"TYPE_MISMATCH":bu(t)||bu(e)?"NOT_EQ":_u(t)&&_u(e)?"EQ":_u(t)||_u(e)?"NULL":Du(t)&&Du(e)?function(t,e){if(t.values?.length!==e.values?.length)return"NOT_EQ";let n=!1;for(let s=0;s<(t.values?.length??0);s++){const r=t.values[s],i=e.values[s];switch(Gf(r,i)){case"EQ":break;case"NOT_EQ":case"TYPE_MISMATCH":return"NOT_EQ";case"NULL":n=!0;break;default:Zc(44609,{Dr:r,Cr:i})}}return n?"NULL":"EQ"}(t.arrayValue,e.arrayValue):Iu(t)&&Iu(e)||vu(t)&&vu(e)?function(t,e){const n=t.fields||{},s=e.fields||{};if(bl(n)!==bl(s))return"NOT_EQ";let r=!1;for(const t in n)if(n.hasOwnProperty(t)){if(void 0===s[t])return"NOT_EQ";switch(Gf(n[t],s[t])){case"NOT_EQ":case"TYPE_MISMATCH":return"NOT_EQ";case"NULL":r=!0}}return r?"NULL":"EQ"}(t.mapValue,e.mapValue):function(t,e){return uu(t,e,{u:!1,i:!0,o:!0})}(t,e)?"EQ":"NOT_EQ"}class Hf extends Mf{vr(t,e){return Lf(t)+Lf(e)}Sr(t,e){return{doubleValue:kf(t)+kf(e)}}}class Uf extends Mf{constructor(t){super(t),this.expr=t}vr(t,e){return Lf(t)-Lf(e)}Sr(t,e){return{doubleValue:kf(t)-kf(e)}}}class Vf extends Mf{constructor(t){super(t),this.expr=t}vr(t,e){return Lf(t)*Lf(e)}Sr(t,e){return{doubleValue:kf(t)*kf(e)}}}class jf extends Mf{constructor(t){super(t),this.expr=t}vr(t,e){const n=Lf(e);if(n!==BigInt(0))return Lf(t)/n}Sr(t,e){const n=kf(e);return 0===n?{doubleValue:eu(n)?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY}:{doubleValue:kf(t)/n}}}class $f extends Mf{constructor(t){super(t),this.expr=t}vr(t,e){const n=Lf(e);if(n!==BigInt(0))return Lf(t)%n}Sr(t,e){const n=kf(e);if(0!==n)return{doubleValue:kf(t)%n}}}class Jf{constructor(t){this.expr=t}evaluate(t,e){let n=!1,s=!1;for(const r of this.expr.params){const i=Sf(r).evaluate(t,e);switch(i.type){case"BOOLEAN":if(!i.value?.booleanValue)return Tf.newValue(cu);break;case"NULL":s=!0;break;default:n=!0}}return n?Tf.mr():s?Tf.gr():Tf.newValue(Bu)}}class qf{constructor(t){this.expr=t}evaluate(t,e){el(1===this.expr.params.length,9634);const n=Sf(this.expr.params[0]).evaluate(t,e);switch(n.type){case"BOOLEAN":return Tf.newValue({booleanValue:!n.value?.booleanValue});case"NULL":return Tf.gr();default:return Tf.mr()}}}class zf{constructor(t){this.expr=t}evaluate(t,e){let n=!1,s=!1;for(const r of this.expr.params){const i=Sf(r).evaluate(t,e);switch(i.type){case"BOOLEAN":if(i.value?.booleanValue)return Tf.newValue(Bu);break;case"NULL":s=!0;break;default:n=!0}}return n?Tf.mr():s?Tf.gr():Tf.newValue(cu)}}class Kf{constructor(t){this.expr=t}evaluate(t,e){let n=!1,s=!1;for(const r of this.expr.params){const i=Sf(r).evaluate(t,e);switch(i.type){case"BOOLEAN":n=Kf.xor(n,!!i.value?.booleanValue);break;case"NULL":s=!0;break;default:return Tf.mr()}}return s?Tf.gr():Tf.newValue({booleanValue:n})}static xor(t,e){return(t||e)&&!(t&&e)}}class Qf{constructor(t){this.expr=t}evaluate(t,e){el(2===this.expr.params.length,55094);let n=!1;const s=Sf(this.expr.params[0]).evaluate(t,e);switch(s.type){case"NULL":n=!0;break;case"ERROR":case"UNSET":return Tf.mr()}const r=Sf(this.expr.params[1]).evaluate(t,e);switch(r.type){case"ARRAY":break;case"NULL":n=!0;break;default:return Tf.mr()}if(n)return Tf.gr();for(const t of r.value?.arrayValue?.values??[])switch(_u(s.value)&&_u(t)?"EQ":Gf(s.value,t)){case"EQ":return Tf.newValue(Bu);case"NOT_EQ":case"TYPE_MISMATCH":break;case"NULL":n=!0;break;default:Zc(44608,{value:s.value,candidate:t})}return n?Tf.gr():Tf.newValue(cu)}}class Wf{constructor(t){this.expr=t}evaluate(t,e){return new qf(new tf("not",[new tf("equal_any",this.expr.params)])).evaluate(t,e)}}class Yf{constructor(t){this.expr=t}evaluate(t,e){el(1===this.expr.params.length,23322);const n=Sf(this.expr.params[0]).evaluate(t,e);switch(n.type){case"INT":return Tf.newValue(cu);case"DOUBLE":return Tf.newValue({booleanValue:isNaN(kf(n.value))});case"NULL":return Tf.gr();default:return Tf.mr()}}}class Xf{constructor(t){this.expr=t}evaluate(t,e){return el(1===this.expr.params.length,50406),new qf(new tf("not",[new tf("is_nan",this.expr.params)])).evaluate(t,e)}}class Zf{constructor(t){this.expr=t}evaluate(t,e){switch(el(1===this.expr.params.length,23123),Sf(this.expr.params[0]).evaluate(t,e).type){case"NULL":return Tf.newValue(Bu);case"UNSET":case"ERROR":return Tf.mr();default:return Tf.newValue(cu)}}}class tC{constructor(t){this.expr=t}evaluate(t,e){return el(1===this.expr.params.length,23167),new qf(new tf("not",[new tf("is_null",this.expr.params)])).evaluate(t,e)}}class eC{constructor(t){this.expr=t}evaluate(t,e){return el(1===this.expr.params.length,5228),"ERROR"===Sf(this.expr.params[0]).evaluate(t,e).type?Tf.newValue(Bu):Tf.newValue(cu)}}class nC{constructor(t){this.expr=t}evaluate(t,e){switch(el(1===this.expr.params.length,6877),Sf(this.expr.params[0]).evaluate(t,e).type){case"ERROR":return Tf.mr();case"UNSET":return Tf.newValue(cu);default:return Tf.newValue(Bu)}}}class sC{constructor(t){this.expr=t}evaluate(t,e){el(3===this.expr.params.length,11706);const n=Sf(this.expr.params[0]).evaluate(t,e);switch(n.type){case"BOOLEAN":return n.value?.booleanValue?Sf(this.expr.params[1]).evaluate(t,e):Sf(this.expr.params[2]).evaluate(t,e);case"NULL":return Sf(this.expr.params[2]).evaluate(t,e);default:return Tf.mr()}}}class rC{constructor(t){this.expr=t}evaluate(t,e){const n=this.expr.params.map(n=>Sf(n).evaluate(t,e));let s;for(const t of n)switch(t.type){case"ERROR":case"UNSET":case"NULL":continue;default:s=void 0===s||du(t.value,s.value)>0?t:s}return void 0===s?Tf.gr():s}}class iC{constructor(t){this.expr=t}evaluate(t,e){const n=this.expr.params.map(n=>Sf(n).evaluate(t,e));let s;for(const t of n)switch(t.type){case"ERROR":case"UNSET":case"NULL":continue;default:s=void 0===s||du(t.value,s.value)<0?t:s}return void 0===s?Tf.gr():s}}class oC{constructor(t){this.expr=t}evaluate(t,e){el(2===this.expr.params.length,31033,`${this.expr.name}() function should have exactly 2 params`);const n=Sf(this.expr.params[0]).evaluate(t,e);switch(n.type){case"ERROR":case"UNSET":return Tf.mr()}const s=Sf(this.expr.params[1]).evaluate(t,e);switch(s.type){case"ERROR":case"UNSET":return Tf.mr()}return this.Fr(n,s)}}class aC extends oC{constructor(t){super(t),this.expr=t}Fr(t,e){if(t.wr()&&e.wr())return Tf.newValue(Bu);if(t.wr()||e.wr())return Tf.newValue(cu);if(bu(t.value)||bu(e.value))return Tf.newValue(cu);if(lu(t.value)!==lu(e.value))return Tf.newValue(cu);switch(Gf(t.value,e.value)){case"EQ":return Tf.newValue(Bu);case"NOT_EQ":return Tf.newValue(cu);case"NULL":return Tf.gr();default:Zc(44615,{left:t,right:e})}}}class BC extends oC{constructor(t){super(t),this.expr=t}Fr(t,e){switch(Gf(t.value,e.value)){case"EQ":return Tf.newValue(cu);case"NOT_EQ":case"TYPE_MISMATCH":return Tf.newValue(Bu);case"NULL":return Tf.gr();default:Zc(44614,{left:t,right:e})}}}class cC extends oC{constructor(t){super(t),this.expr=t}Fr(t,e){return lu(t.value)!==lu(e.value)||bu(t.value)||bu(e.value)?Tf.newValue(cu):Tf.newValue({booleanValue:du(t.value,e.value)<0})}}class lC extends oC{constructor(t){super(t),this.expr=t}Fr(t,e){return lu(t.value)!==lu(e.value)||bu(t.value)||bu(e.value)?Tf.newValue(cu):"EQ"===Gf(t.value,e.value)?Tf.newValue(Bu):Tf.newValue({booleanValue:du(t.value,e.value)<0})}}class uC extends oC{constructor(t){super(t),this.expr=t}Fr(t,e){return lu(t.value)!==lu(e.value)||bu(t.value)||bu(e.value)?Tf.newValue(cu):Tf.newValue({booleanValue:du(t.value,e.value)>0})}}class hC extends oC{constructor(t){super(t),this.expr=t}Fr(t,e){return lu(t.value)!==lu(e.value)||bu(t.value)||bu(e.value)?Tf.newValue(cu):"EQ"===Gf(t.value,e.value)?Tf.newValue(Bu):Tf.newValue({booleanValue:du(t.value,e.value)>0})}}class dC{constructor(t){this.expr=t}evaluate(t,e){throw new Error("Unimplemented")}}class pC{constructor(t){this.expr=t}evaluate(t,e){el(1===this.expr.params.length,216);const n=Sf(this.expr.params[0]).evaluate(t,e);switch(n.type){case"NULL":return Tf.gr();case"ARRAY":{const t=n.value.arrayValue?.values??[];return Tf.newValue({arrayValue:{values:[...t].reverse()}})}default:return Tf.mr()}}}class fC{constructor(t){this.expr=t}evaluate(t,e){return el(2===this.expr.params.length,52884),new Qf(new tf("eq_any",[this.expr.params[1],this.expr.params[0]])).evaluate(t,e)}}class CC{constructor(t){this.expr=t}evaluate(t,e){el(2===this.expr.params.length,1392);let n=!1;const s=Sf(this.expr.params[0]).evaluate(t,e);switch(s.type){case"ARRAY":break;case"NULL":n=!0;break;default:return Tf.mr()}const r=Sf(this.expr.params[1]).evaluate(t,e);switch(r.type){case"ARRAY":break;case"NULL":n=!0;break;default:return Tf.mr()}if(n)return Tf.gr();const i=r.value?.arrayValue?.values??[],o=s.value?.arrayValue?.values??[];for(const t of i){let e=!1;n=!1;for(const s of o){switch(_u(t)&&_u(s)?"EQ":Gf(t,s)){case"EQ":e=!0;break;case"NOT_EQ":case"TYPE_MISMATCH":break;case"NULL":n=!0;break;default:Zc(44613,{value:s,search:t})}if(e)break}if(!e)return Tf.newValue(cu)}return Tf.newValue(Bu)}}class gC{constructor(t){this.expr=t}evaluate(t,e){el(2===this.expr.params.length,2680);let n=!1;const s=Sf(this.expr.params[0]).evaluate(t,e);switch(s.type){case"ARRAY":break;case"NULL":n=!0;break;default:return Tf.mr()}const r=Sf(this.expr.params[1]).evaluate(t,e);switch(r.type){case"ARRAY":break;case"NULL":n=!0;break;default:return Tf.mr()}if(n)return Tf.gr();const i=r.value?.arrayValue?.values??[],o=s.value?.arrayValue?.values??[];for(const t of o)for(const e of i)switch(_u(t)&&_u(e)?"EQ":Gf(t,e)){case"EQ":return Tf.newValue(Bu);case"NOT_EQ":case"TYPE_MISMATCH":break;case"NULL":n=!0;break;default:Zc(60403,{value:t,search:e})}return n?Tf.gr():Tf.newValue(cu)}}class mC{constructor(t){this.expr=t}evaluate(t,e){el(1===this.expr.params.length,38605);const n=Sf(this.expr.params[0]).evaluate(t,e);switch(n.type){case"NULL":return Tf.gr();case"ARRAY":return Tf.newValue({integerValue:`${n.value?.arrayValue?.values?.length??0}`});default:return Tf.mr()}}}class wC{constructor(t){this.expr=t}evaluate(t,e){throw new Error("Unimplemented")}}class yC{constructor(t){this.expr=t}evaluate(t,e){el(1===this.expr.params.length,1508);const n=Sf(this.expr.params[0]).evaluate(t,e);switch(n.type){case"NULL":return Tf.gr();case"BYTES":{const t=n.value?.bytesValue;if("string"==typeof t){const e=Ml.fromBase64String(t).toUint8Array();return e.reverse(),Tf.newValue({bytesValue:Ml.fromUint8Array(e).toBase64()})}return Tf.newValue({bytesValue:new Uint8Array(t).reverse()})}case"STRING":{const t=n.value?.stringValue,e=new Intl.__PRIVATE_Segmenter(void 0,{granularity:"grapheme"}).segment(t),s=Array.from(e,t=>t.segment).reverse();return Tf.newValue({stringValue:s.join("")})}default:return Tf.mr()}}}class EC{constructor(t){this.expr=t}evaluate(t,e){throw new Error("Unimplemented")}}class DC{constructor(t){this.expr=t}evaluate(t,e){throw new Error("Unimplemented")}}class _C{constructor(t){this.expr=t}evaluate(t,e){el(1===this.expr.params.length,19400);const n=Sf(this.expr.params[0]).evaluate(t,e);switch(n.type){case"NULL":return Tf.gr();case"STRING":{const t=function(t){let e=0;for(let n=0;n<t.length;n++){const s=t.codePointAt(n);if(void 0===s)return;if(s<=65535)if(s>=55296&&s<=57343)if(s<=56319){const s=t.codePointAt(n+1);void 0!==s&&s>=56320&&s<=57343?(e+=1,n++):e+=1}else e+=1;else e+=1;else{if(!(s<=1114111))return;e+=1,n++}}return e}(n.value.stringValue);return void 0===t?Tf.mr():Tf.newValue({integerValue:t})}default:return Tf.mr()}}}class bC{constructor(t){this.expr=t}evaluate(t,e){el(1===this.expr.params.length,8486);const n=Sf(this.expr.params[0]).evaluate(t,e);switch(n.type){case"BYTES":{const t=n.value?.bytesValue;return"string"==typeof t?Tf.newValue({integerValue:Ml.fromBase64String(t).toUint8Array().length}):Tf.newValue({integerValue:new Uint8Array(t).length})}case"STRING":{const t=function(t){let e=0;for(let n=0;n<t.length;n++){const s=t.codePointAt(n);if(void 0===s)return;if(s>=55296&&s<=57343){if(!(s<=56319))return;{const s=t.codePointAt(n+1);if(void 0===s||!(s>=56320&&s<=57343))return;e+=4,n++}}else if(s<=127)e+=1;else if(s<=2047)e+=2;else if(s<=65535)e+=3;else{if(!(s<=1114111))return;e+=4,n++}}return e}(n.value?.stringValue);return void 0===t?Tf.mr():Tf.newValue({integerValue:t})}case"NULL":return Tf.gr();default:return Tf.mr()}}}class vC{constructor(t){this.expr=t}evaluate(t,e){el(2===this.expr.params.length,39773,`${this.expr.name}() function should have exactly two parameters`);let n=!1;const s=Sf(this.expr.params[0]).evaluate(t,e);switch(s.type){case"STRING":break;case"NULL":n=!0;break;default:return Tf.mr()}const r=Sf(this.expr.params[1]).evaluate(t,e);switch(r.type){case"STRING":break;case"NULL":n=!0;break;default:return Tf.mr()}return n?Tf.gr():this.Or(s.value?.stringValue,r.value?.stringValue)}}class IC extends vC{Or(t,e){try{const n=function(t){let e="";for(let n=0;n<t.length;n++){const s=t.charAt(n);switch(s){case"_":e+=".";break;case"%":e+=".*";break;case"\\":case".":case"*":case"?":case"+":case"^":case"$":case"|":case"(":case")":case"[":case"]":case"{":case"}":e+="\\"+s;break;default:e+=s}}return"^"+e+"$"}(e),s=Jc.compile(n);return Tf.newValue({booleanValue:s.matches(t)})}catch(t){return Yc(`Invalid LIKE pattern converted to regex: ${e}, returning error. Error: ${t}`),Tf.mr()}}}class TC extends vC{Or(t,e){try{const n=Jc.compile(e);return Tf.newValue({booleanValue:n.test(t)})}catch(t){return Yc(`Invalid regex pattern found in regex_contains: ${e}, returning error`),Tf.mr()}}}class OC extends vC{Or(t,e){try{return Tf.newValue({booleanValue:Jc.compile(e).matches(t)})}catch(t){return Yc(`Invalid regex pattern found in regex_match: ${e}, returning error`),Tf.mr()}}}class AC extends vC{Or(t,e){return Tf.newValue({booleanValue:t.includes(e)})}}class SC extends vC{Or(t,e){return Tf.newValue({booleanValue:t.startsWith(e)})}}class RC extends vC{Or(t,e){return Tf.newValue({booleanValue:t.endsWith(e)})}}class NC{constructor(t){this.expr=t}evaluate(t,e){el(1===this.expr.params.length,29079);const n=Sf(this.expr.params[0]).evaluate(t,e);switch(n.type){case"STRING":return Tf.newValue({stringValue:n.value?.stringValue?.toLowerCase()});case"NULL":return Tf.gr();default:return Tf.mr()}}}class xC{constructor(t){this.expr=t}evaluate(t,e){el(1===this.expr.params.length,60487);const n=Sf(this.expr.params[0]).evaluate(t,e);switch(n.type){case"STRING":return Tf.newValue({stringValue:n.value?.stringValue?.toUpperCase()});case"NULL":return Tf.gr();default:return Tf.mr()}}}class kC{constructor(t){this.expr=t}evaluate(t,e){el(1===this.expr.params.length,28544);const n=Sf(this.expr.params[0]).evaluate(t,e);switch(n.type){case"STRING":return Tf.newValue({stringValue:n.value?.stringValue?.trim()});case"NULL":return Tf.gr();default:return Tf.mr()}}}class LC{constructor(t){this.expr=t}evaluate(t,e){const n=this.expr.params.map(n=>Sf(n).evaluate(t,e));let s="",r=!1;for(const t of n)switch(t.type){case"STRING":s+=t.value.stringValue;break;case"NULL":r=!0;break;default:return Tf.mr()}return r?Tf.gr():Tf.newValue({stringValue:s})}}class FC{constructor(t){this.expr=t}evaluate(t,e){el(2===this.expr.params.length,4483);const n=Sf(this.expr.params[0]).evaluate(t,e);switch(n.type){case"UNSET":return Tf.pr();case"MAP":break;default:return Tf.mr()}const s=Sf(this.expr.params[1]).evaluate(t,e);if("STRING"!==s.type)return Tf.mr();const r=n.value?.mapValue?.fields?.[s.value?.stringValue];return void 0===r?Tf.pr():Tf.newValue(r)}}class PC{constructor(t){this.expr=t}evaluate(t,e){el(2===this.expr.params.length,25231,`${this.expr.name}() function should have exactly 2 params`);let n=!1;const s=Sf(this.expr.params[0]).evaluate(t,e);switch(s.type){case"VECTOR":break;case"NULL":n=!0;break;default:return Tf.mr()}const r=Sf(this.expr.params[1]).evaluate(t,e);switch(r.type){case"VECTOR":break;case"NULL":n=!0;break;default:return Tf.mr()}if(n)return Tf.gr();const i=Tu(s.value),o=Tu(r.value);if(void 0===i||void 0===o||i.values?.length!==o.values?.length)return Tf.mr();const a=this.Mr(i,o);return void 0===a||isNaN(a)?Tf.mr():Tf.newValue({doubleValue:a})}}class MC extends PC{Mr(t,e){const n=t?.values??[],s=e?.values??[];if(0===n.length)return;let r=0,i=0,o=0;for(let t=0;t<n.length;t++){if(!Eu(n[t])||!Eu(s[t]))return;const e=kf(n[t]),a=kf(s[t]);r+=e*a,i+=e*e,o+=a*a}const a=Math.sqrt(i)*Math.sqrt(o);return 0!==a?1-Math.max(-1,Math.min(1,r/a)):void 0}}class GC extends PC{Mr(t,e){const n=t?.values??[],s=e?.values??[];if(0===n.length)return 0;let r=0;for(let t=0;t<n.length;t++){if(!Eu(n[t])||!Eu(s[t]))return;r+=kf(n[t])*kf(s[t])}return r}}class HC extends PC{Mr(t,e){const n=t?.values??[],s=e?.values??[];if(0===n.length)return 0;let r=0;for(let t=0;t<n.length;t++){if(!Eu(n[t])||!Eu(s[t]))return;const e=kf(n[t]),i=kf(s[t]);r+=Math.pow(e-i,2)}return Math.sqrt(r)}}class UC{constructor(t){this.expr=t}evaluate(t,e){el(1===this.expr.params.length,39044);const n=Sf(this.expr.params[0]).evaluate(t,e);switch(n.type){case"VECTOR":{const t=Tu(n.value);return Tf.newValue({integerValue:t?.values?.length??0})}case"NULL":return Tf.gr();default:return Tf.mr()}}}const VC=BigInt(-62135596800),jC=BigInt(253402300799),$C=BigInt(1e3),JC=BigInt(1e6),qC=VC*$C,zC=jC*$C+BigInt(999),KC=VC*JC,QC=jC*JC+BigInt(999999);function WC(t){return t>=KC&&t<=QC}function YC(t){return t>=VC&&t<=jC}function XC(t,e){const n=BigInt(t);return!(n<VC||n>jC||e<0||e>=1e9||n===VC&&0!==e||n===jC&&e>999999999)}function ZC(t,e){return e<0?{seconds:t-1,nanos:e+1e9}:{seconds:t,nanos:e}}function tg(t){return BigInt(t.seconds)*JC+BigInt(Math.trunc(t.nanoseconds/1e3))}class eg{constructor(t){this.expr=t}evaluate(t,e){el(1===this.expr.params.length,49262,`${this.expr.name}() function should have exactly one parameter`);const n=Sf(this.expr.params[0]).evaluate(t,e);switch(n.type){case"INT":return this.toTimestamp(BigInt(n.value.integerValue));case"NULL":return Tf.gr();default:return Tf.mr()}}}class ng extends eg{toTimestamp(t){if(!WC(t))return Tf.mr();let e=Number(t/JC),n=Number(t%JC*BigInt(1e3));const s=ZC(e,n);return e=s.seconds,n=s.nanos,XC(e,n)?Tf.newValue({timestampValue:{seconds:e,nanos:n}}):Tf.mr()}}class sg extends eg{toTimestamp(t){if(!function(t){return t>=qC&&t<=zC}(t))return Tf.mr();let e=Number(t/$C),n=Number(t%$C*BigInt(1e6));const s=ZC(e,n);return e=s.seconds,n=s.nanos,XC(e,n)?Tf.newValue({timestampValue:{seconds:e,nanos:n}}):Tf.mr()}}class rg extends eg{toTimestamp(t){if(!YC(t))return Tf.mr();const e=Number(t);return Tf.newValue({timestampValue:{seconds:e,nanos:0}})}}class ig{constructor(t){this.expr=t}evaluate(t,e){el(1===this.expr.params.length,1265,`${this.expr.name}() function should have exactly one parameter`);const n=Sf(this.expr.params[0]).evaluate(t,e);switch(n.type){case"TIMESTAMP":break;case"NULL":return Tf.gr();default:return Tf.mr()}const s=fd(n.value.timestampValue);return XC(s.seconds,s.nanoseconds)?this.Nr(s):Tf.mr()}}class og extends ig{Nr(t){const e=tg(t);return WC(e)?Tf.newValue({integerValue:`${e.toString()}`}):Tf.mr()}}class ag extends ig{Nr(t){const e=tg(t),n=e/BigInt(1e3),s=e%BigInt(1e3);return n>BigInt(0)||s===BigInt(0)?Tf.newValue({integerValue:n.toString()}):Tf.newValue({integerValue:(n-BigInt(1)).toString()})}}class Bg extends ig{Nr(t){const e=BigInt(t.seconds);return YC(e)?Tf.newValue({integerValue:e.toString()}):Tf.mr()}}class cg{constructor(t){this.expr=t}evaluate(t,e){el(3===this.expr.params.length,2775,`${this.expr.name}() function should have exactly 3 parameters`);let n=!1;const s=Sf(this.expr.params[0]).evaluate(t,e);switch(s.type){case"TIMESTAMP":break;case"NULL":n=!0;break;default:return Tf.mr()}const r=Sf(this.expr.params[1]).evaluate(t,e);let i;switch(r.type){case"STRING":if(i=function(t){switch(t){case"microsecond":return"microsecond";case"millisecond":return"millisecond";case"second":return"second";case"minute":return"minute";case"hour":return"hour";case"day":return"day";default:return}}(r.value.stringValue),void 0===i)return Tf.mr();break;case"NULL":n=!0;break;default:return Tf.mr()}const o=Sf(this.expr.params[2]).evaluate(t,e);switch(o.type){case"INT":break;case"NULL":n=!0;break;default:return Tf.mr()}if(n)return Tf.gr();const a=BigInt(o.value.integerValue);let B;try{switch(i){case"microsecond":B=a;break;case"millisecond":B=a*BigInt(1e3);break;case"second":B=a*BigInt(1e6);break;case"minute":B=a*BigInt(6e7);break;case"hour":B=a*BigInt(36e8);break;case"day":B=a*BigInt(864e8);break;default:return Tf.mr()}if("microsecond"!==i&&a!==BigInt(0)&&B/a!==BigInt(this.Lr(i)))return Tf.mr()}catch(t){return Yc(`Error during timestamp arithmetic: ${t}`),Tf.mr()}const c=fd(s.value.timestampValue);if(!XC(c.seconds,c.nanoseconds))return Tf.mr();const l=tg(c),u=this.Br(l,B);if(!WC(u))return Tf.mr();const h=Number(u/JC),d=u%JC,p=Number((d<0?d+JC:d)*BigInt(1e3)),f=d<0?h-1:h;return XC(f,p)?Tf.newValue({timestampValue:{seconds:f,nanos:p}}):Tf.mr()}Lr(t){switch(t){case"millisecond":return 1e3;case"second":return 1e6;case"minute":return 6e7;case"hour":return 36e8;case"day":return 864e8;default:return 1}}}class lg extends cg{Br(t,e){return t+e}}class ug extends cg{Br(t,e){return t-e}}function hg(t){if((t=Af(t))instanceof Wp)return`fld(${t.fieldName})`;if(t instanceof Yp)return`cst(${function(t){return null===t?"null":"number"==typeof t?t.toString():"string"==typeof t?`"${t}"`:t instanceof Rp?`ref(${t.path})`:t instanceof kp?`vec(${JSON.stringify(t)})`:JSON.stringify(t)}(t.value)})`;if(t instanceof tf)return`fn(${t.name},[${t.params.map(hg).join(",")}])`;if("ListOfExpressions"===t.expressionType)return`list([${t.cr.map(hg).join(",")}])`;throw new Error(`Unrecognized expr ${JSON.stringify(t,null,2)}`)}function dg(t){return`${Array.from(t.entries()).sort().map(([t,e])=>`${t}=${hg(e)}`).join(",")}`}function pg(t){return t.stages.map(t=>function(t){if(t instanceof Bf)return`${t._name}(${dg(t.fields)})`;if(t instanceof cf){let e=`${t._name}(${dg(t.accumulators)})`;return t.groups.size>0&&(e+=`grouping(${dg(t.groups)})`),e}if(t instanceof lf)return`${t._name}(${dg(t.groups)})`;if(t instanceof uf)return`${t._name}(${t.hr})`;if(t instanceof hf)return`${t._name}(${t.collectionId})`;if(t instanceof df)return`${t._name}()`;if(t instanceof pf)return`${t._name}(${t.Tr.sort()})`;if(t instanceof ff)return`${t._name}(${hg(t.condition)})`;if(t instanceof Cf)return`${t._name}(${t.limit})`;if(t instanceof wf)return`${t._name}(${function(t){return t.map(t=>`${hg(t.expr)}${t.direction}`).join(",")}(t.orderings)})`;throw new Error(`Unrecognized stage ${t._name}`)}(t)).join("|")}function fg(t,e){return pg(t)===pg(e)}function Cg(t){return t instanceof Df}function gg(t){return Cg(t)?pg(t):zh(t)}function mg(t){return Cg(t)?pg(t):function(t){return`${Hh(Jh(t))}|lt:${t.limitType}`}(t)}function wg(t,e){return t instanceof Df&&e instanceof Df?fg(t,e):!(t instanceof Df&&!(e instanceof Df)||!(t instanceof Df)&&e instanceof Df)&&function(t,e){return Uh(Jh(t),Jh(e))&&t.limitType===e.limitType}(t,e)}function yg(t){return function(t){return!!t.isCorePipeline}(t)?pg(t):Hh(t)}function Eg(t,e){return t instanceof Df&&e instanceof Df?fg(t,e):!(t instanceof Df&&!(e instanceof Df)||!(t instanceof Df)&&e instanceof Df)&&Uh(t,e)}class Dg{constructor(t,e,n,s){this.batchId=t,this.localWriteTime=e,this.baseMutations=n,this.mutations=s}applyToRemoteDocument(t,e){const n=e.mutationResults;for(let e=0;e<this.mutations.length;e++){const s=this.mutations[e];s.key.isEqual(t.key)&&eh(s,t,n[e])}}applyToLocalView(t,e){for(const n of this.baseMutations)n.key.isEqual(t.key)&&(e=nh(n,t,e,this.localWriteTime));for(const n of this.mutations)n.key.isEqual(t.key)&&(e=nh(n,t,e,this.localWriteTime));return e}applyToLocalDocumentSet(t,e){const n=ad();return this.mutations.forEach(s=>{const r=t.get(s.key),i=r.overlayedDocument;let o=this.applyToLocalView(i,r.mutatedFields);o=e.has(s.key)?null:o;const a=th(i,o);null!==a&&n.set(s.key,a),i.isValidDocument()||i.convertToNoDocument(xh.min())}),n}keys(){return this.mutations.reduce((t,e)=>t.add(e.key),ud())}isEqual(t){return this.batchId===t.batchId&&ll(this.mutations,t.mutations,(t,e)=>rh(t,e))&&ll(this.baseMutations,t.baseMutations,(t,e)=>rh(t,e))}}class _g{constructor(t,e,n,s){this.batch=t,this.commitVersion=e,this.mutationResults=n,this.docVersions=s}static from(t,e,n){el(t.mutations.length===n.length,58842,{Ur:t.mutations.length,kr:n.length});let s=cd;const r=t.mutations;for(let t=0;t<r.length;t++)s=s.insert(r[t].key,n[t].version);return new _g(t,e,n,s)}}function bg(t,e){let n=e;const s=t.length;for(let e=0;e<s;e++){const s=t.charAt(e);switch(s){case"\0":n+="";break;case"":n+="";break;default:n+=s}}return n}function vg(t){return t+""}class Ig{constructor(t,e){this.largestBatchId=t,this.mutation=e}getKey(){return this.mutation.key}isEqual(t){return null!==t&&this.mutation===t.mutation}toString(){return`Overlay{\n largestBatchId: ${this.largestBatchId},\n mutation: ${this.mutation.toString()}\n }`}}class Tg{constructor(t){this.$r=t}}function Og(t){const e=bd({parent:t.parent,structuredQuery:t.structuredQuery});return"LAST"===t.limitType?qh(e,e.limit,"L"):e}class Ag{constructor(){this.Zi=new Sg}addToCollectionParentIndex(t,e){return this.Zi.add(e),mp.resolve()}getCollectionParents(t,e){return mp.resolve(this.Zi.getEntries(e))}addFieldIndex(t,e){return mp.resolve()}deleteFieldIndex(t,e){return mp.resolve()}deleteAllFieldIndexes(t){return mp.resolve()}createTargetIndexes(t,e){return mp.resolve()}getDocumentsMatchingTarget(t,e){return mp.resolve(null)}getIndexType(t,e){return mp.resolve(0)}getFieldIndexes(t,e){return mp.resolve([])}getNextCollectionGroupToUpdate(t){return mp.resolve(null)}getMinOffset(t,e){return mp.resolve(Fh.min())}getMinOffsetFromCollectionGroup(t,e){return mp.resolve(Fh.min())}updateCollectionGroup(t,e,n){return mp.resolve()}updateIndexEntries(t,e){return mp.resolve()}}class Sg{constructor(){this.index={}}add(t){const e=t.lastSegment(),n=t.popLast(),s=this.index[e]||new pl(yl.comparator),r=!s.has(n);return this.index[e]=s.add(n),r}has(t){const e=t.lastSegment(),n=t.popLast(),s=this.index[e];return s&&s.has(n)}getEntries(t){return(this.index[t]||new pl(yl.comparator)).toArray()}}class Rg{constructor(t){this.ys=t}next(){return this.ys+=2,this.ys}static ws(){return new Rg(0)}static bs(){return new Rg(-1)}}function Ng(t,e){return function(t,e){let n=e;for(const e of t.stages)n=xg({serializer:t.serializer,serverTimestampBehavior:t.listenOptions?.serverTimestampBehavior},e,n);return n}(t,[e]).length>0}function xg(t,e,n){if(e instanceof uf)return function(t,e,n){return n.filter(t=>t.isFoundDocument()&&`/${t.key.getCollectionPath().canonicalString()}`===e.hr)}(0,e,n);if(e instanceof ff)return function(t,e,n){return n.filter(n=>{const s=Of(Sf(e.condition).evaluate(t,n));return void 0!==s&&uu(s,Bu)})}(t,e,n);if(e instanceof hf)return function(t,e,n){return n.filter(t=>t.isFoundDocument()&&t.key.getCollectionPath().lastSegment()===e.collectionId)}(0,e,n);if(e instanceof df)return function(t,e,n){return n.filter(t=>t.isFoundDocument())}(0,0,n);if(e instanceof pf)return function(t,e,n){return n.filter(t=>t.isFoundDocument()&&e.Pr.has(t.key.path.toStringWithLeadingSlash()))}(0,e,n);if(e instanceof Cf)return function(t,e,n){return n.slice(0,e.limit)}(0,e,n);if(e instanceof wf)return function(t,e,n){const s=e.orderings.map(t=>({Ms:Sf(t.expr),direction:t.direction}));return[...n].sort((e,n)=>{for(const{Ms:r,direction:i}of s){const s=Of(r.evaluate(t,e)),o=Of(r.evaluate(t,n)),a=du(s??au,o??au);if(0!==a)return"ascending"===i?a:-a}return 0})}(t,e,n);throw new Error(`Unknown stage: ${e._name}`)}class kg{constructor(){this.changes=new td(t=>t.toString(),(t,e)=>t.isEqual(e)),this.changesApplied=!1}addEntry(t){this.assertNotApplied(),this.changes.set(t.key,t)}removeEntry(t,e){this.assertNotApplied(),this.changes.set(t,kh.newInvalidDocument(t).setReadTime(e))}getEntry(t,e){this.assertNotApplied();const n=this.changes.get(e);return void 0!==n?mp.resolve(n):this.getFromCache(t,e)}getEntries(t,e){return this.getAllFromCache(t,e)}apply(t){return this.assertNotApplied(),this.changesApplied=!0,this.applyChanges(t)}assertNotApplied(){}}class Lg{constructor(t,e){this.overlayedDocument=t,this.mutatedFields=e}}class Fg{constructor(t,e,n,s){this.remoteDocumentCache=t,this.mutationQueue=e,this.documentOverlayCache=n,this.indexManager=s}getDocument(t,e){let n=null;return this.documentOverlayCache.getOverlay(t,e).next(s=>(n=s,this.remoteDocumentCache.getEntry(t,e))).next(t=>(null!==n&&nh(n.mutation,t,_l.empty(),Fl.now()),t))}getDocuments(t,e){return this.remoteDocumentCache.getEntries(t,e).next(e=>this.getLocalViewOfDocuments(t,e,ud()).next(()=>e))}getLocalViewOfDocuments(t,e,n=ud()){const s=od();return this.populateOverlays(t,s,e).next(()=>this.computeViews(t,e,s,n).next(t=>{let e=rd();return t.forEach((t,n)=>{e=e.insert(t,n.overlayedDocument)}),e}))}getOverlayedDocuments(t,e){const n=od();return this.populateOverlays(t,n,e).next(()=>this.computeViews(t,e,n,ud()))}populateOverlays(t,e,n){const s=[];return n.forEach(t=>{e.has(t)||s.push(t)}),this.documentOverlayCache.getOverlays(t,s).next(t=>{t.forEach((t,n)=>{e.set(t,n)})})}computeViews(t,e,n,s){let r=nd();const i=Bd(),o=Bd();return e.forEach((t,e)=>{const o=n.get(e.key);s.has(e.key)&&(void 0===o||o.mutation instanceof oh)?r=r.insert(e.key,e):void 0!==o?(i.set(e.key,o.mutation.getFieldMask()),nh(o.mutation,e,o.mutation.getFieldMask(),Fl.now())):i.set(e.key,_l.empty())}),this.recalculateAndSaveOverlays(t,r).next(t=>(t.forEach((t,e)=>i.set(t,e)),e.forEach((t,e)=>o.set(t,new Lg(e,i.get(t)??null))),o))}recalculateAndSaveOverlays(t,e){const n=Bd();let s=new ul((t,e)=>t-e),r=ud();return this.mutationQueue.getAllMutationBatchesAffectingDocumentKeys(t,e).next(t=>{for(const r of t)r.keys().forEach(t=>{const i=e.get(t);if(null===i)return;let o=n.get(t)||_l.empty();o=r.applyToLocalView(i,o),n.set(t,o);const a=(s.get(r.batchId)||ud()).add(t);s=s.insert(r.batchId,a)})}).next(()=>{const i=[],o=s.getReverseIterator();for(;o.hasNext();){const s=o.getNext(),a=s.key,B=s.value,c=ad();B.forEach(t=>{if(!r.has(t)){const s=th(e.get(t),n.get(t));null!==s&&c.set(t,s),r=r.add(t)}}),i.push(this.documentOverlayCache.saveOverlays(t,a,c))}return mp.waitFor(i)}).next(()=>n)}recalculateAndSaveOverlaysForDocumentKeys(t,e){return this.remoteDocumentCache.getEntries(t,e).next(e=>this.recalculateAndSaveOverlays(t,e))}getDocumentsMatchingQuery(t,e,n,s){return Cg(e)?this.getDocumentsMatchingPipeline(t,e,n,s):function(t){return Tl.isDocumentKey(t.path)&&null===t.collectionGroup&&0===t.filters.length}(e)?this.getDocumentsMatchingDocumentQuery(t,e.path):function(t){return null!==t.collectionGroup}(e)?this.getDocumentsMatchingCollectionGroupQuery(t,e,n,s):this.getDocumentsMatchingCollectionQuery(t,e,n,s)}getNextDocuments(t,e,n,s){return this.remoteDocumentCache.getAllFromCollectionGroup(t,e,n,s).next(r=>{const i=s-r.size>0?this.documentOverlayCache.getOverlaysForCollectionGroup(t,e,n.largestBatchId,s-r.size):mp.resolve(od());let o=-1,a=r;return i.next(e=>mp.forEach(e,(e,n)=>(o<n.largestBatchId&&(o=n.largestBatchId),r.get(e)?mp.resolve():this.remoteDocumentCache.getEntry(t,e).next(t=>{a=a.insert(e,t)}))).next(()=>this.populateOverlays(t,e,r)).next(()=>this.computeViews(t,a,e,ud())).next(t=>({batchId:o,changes:id(t)})))})}getDocumentsMatchingDocumentQuery(t,e){return this.getDocument(t,new Tl(e)).next(t=>{let e=rd();return t.isFoundDocument()&&(e=e.insert(t.key,t)),e})}getDocumentsMatchingCollectionGroupQuery(t,e,n,s){const r=e.collectionGroup;let i=rd();return this.indexManager.getCollectionParents(t,r).next(o=>mp.forEach(o,o=>{const a=function(t,e){return new Vh(e,null,t.explicitOrderBy.slice(),t.filters.slice(),t.limit,t.limitType,t.startAt,t.endAt)}(e,o.child(r));return this.getDocumentsMatchingCollectionQuery(t,a,n,s).next(t=>{t.forEach((t,e)=>{i=i.insert(t,e)})})}).next(()=>i))}getDocumentsMatchingCollectionQuery(t,e,n,s){let r;return this.documentOverlayCache.getOverlaysForCollection(t,e.path,n.largestBatchId).next(i=>(r=i,this.remoteDocumentCache.getDocumentsMatchingQuery(t,e,n,r,s))).next(t=>this.retrieveMatchingLocalDocuments(r,t,t=>Kh(e,t)))}getDocumentsMatchingPipeline(t,e,n,s){if("collection_group"===_f(e)){const r=vf(e);let i=rd();return this.indexManager.getCollectionParents(t,r).next(o=>mp.forEach(o,o=>{const a=function(t,e){const n=t.stages.map(t=>t instanceof hf?new uf(e.canonicalString(),{}):t);return new Df(t.serializer,n)}(e,o.child(r));return this.getDocumentsMatchingPipeline(t,a,n,s).next(t=>{t.forEach((t,e)=>{i=i.insert(t,e)})})}).next(()=>i))}{let r;return this.getOverlaysForPipeline(t,e,n.largestBatchId).next(i=>{switch(r=i,_f(e)){case"collection":return this.remoteDocumentCache.getDocumentsMatchingQuery(t,e,n,r,s);case"documents":let i=ud();for(const t of If(e))i=i.add(Tl.fromPath(t));return this.remoteDocumentCache.getEntries(t,i);case"database":return this.remoteDocumentCache.getAllEntries(t);default:throw new gl("invalid-argument",`Invalid pipeline source to execute offline: ${pg(e)}`)}}).next(t=>this.retrieveMatchingLocalDocuments(r,t,t=>Ng(e,t)))}}retrieveMatchingLocalDocuments(t,e,n){t.forEach((t,n)=>{const s=n.getKey();null===e.get(s)&&(e=e.insert(s,kh.newInvalidDocument(s)))});let s=rd();return e.forEach((e,r)=>{const i=t.get(e);void 0!==i&&nh(i.mutation,r,_l.empty(),Fl.now()),n(r)&&(s=s.insert(e,r))}),s}getOverlaysForPipeline(t,e,n){switch(_f(e)){case"collection":return this.documentOverlayCache.getOverlaysForCollection(t,yl.fromString(bf(e)),n);case"collection_group":throw new gl("invalid-argument",`Unexpected collection group pipeline: ${pg(e)}`);case"documents":return this.documentOverlayCache.getOverlays(t,If(e).map(t=>Tl.fromPath(t)));case"database":return this.documentOverlayCache.getAllOverlays(t,n);default:throw new gl("invalid-argument",`Failed to get overlays for pipeline: ${pg(e)}`)}}}class Pg{constructor(t){this.serializer=t,this.Qs=new Map,this.Ws=new Map}getBundleMetadata(t,e){return mp.resolve(this.Qs.get(e))}saveBundleMetadata(t,e){return this.Qs.set(e.id,function(t){return{id:t.id,version:t.version,createTime:md(t.createTime)}}(e)),mp.resolve()}getNamedQuery(t,e){return mp.resolve(this.Ws.get(e))}saveNamedQuery(t,e){return this.Ws.set(e.name,function(t){return{name:t.name,query:Og(t.bundledQuery),readTime:md(t.readTime)}}(e)),mp.resolve()}}class Mg{constructor(){this.overlays=new ul(Tl.comparator),this.Gs=new Map}getOverlay(t,e){return mp.resolve(this.overlays.get(e))}getOverlays(t,e){const n=od();return mp.forEach(e,e=>this.getOverlay(t,e).next(t=>{null!==t&&n.set(e,t)})).next(()=>n)}getAllOverlays(t,e){const n=od();return this.overlays.forEach((t,s)=>{s.largestBatchId>e&&n.set(t,s)}),mp.resolve(n)}saveOverlays(t,e,n){return n.forEach((n,s)=>{this.Zr(t,e,s)}),mp.resolve()}removeOverlaysForBatchId(t,e,n){const s=this.Gs.get(n);return void 0!==s&&(s.forEach(t=>this.overlays=this.overlays.remove(t)),this.Gs.delete(n)),mp.resolve()}getOverlaysForCollection(t,e,n){const s=od(),r=e.length+1,i=new Tl(e.child("")),o=this.overlays.getIteratorFrom(i);for(;o.hasNext();){const t=o.getNext().value,i=t.getKey();if(!e.isPrefixOf(i.path))break;i.path.length===r&&t.largestBatchId>n&&s.set(t.getKey(),t)}return mp.resolve(s)}getOverlaysForCollectionGroup(t,e,n,s){let r=new ul((t,e)=>t-e);const i=this.overlays.getIterator();for(;i.hasNext();){const t=i.getNext().value;if(t.getKey().getCollectionGroup()===e&&t.largestBatchId>n){let e=r.get(t.largestBatchId);null===e&&(e=od(),r=r.insert(t.largestBatchId,e)),e.set(t.getKey(),t)}}const o=od(),a=r.getIterator();for(;a.hasNext()&&(a.getNext().value.forEach((t,e)=>o.set(t,e)),!(o.size()>=s)););return mp.resolve(o)}Zr(t,e,n){const s=this.overlays.get(n.key);if(null!==s){const t=this.Gs.get(s.largestBatchId).delete(n.key);this.Gs.set(s.largestBatchId,t)}this.overlays=this.overlays.insert(n.key,new Ig(e,n));let r=this.Gs.get(e);void 0===r&&(r=ud(),this.Gs.set(e,r)),this.Gs.set(e,r.add(n.key))}}class Gg{constructor(){this.sessionToken=Ml.EMPTY_BYTE_STRING}getSessionToken(t){return mp.resolve(this.sessionToken)}setSessionToken(t,e){return this.sessionToken=e,mp.resolve()}}class Hg{constructor(){this.zs=new pl(Ug.js),this.Hs=new pl(Ug.Js)}isEmpty(){return this.zs.isEmpty()}addReference(t,e){const n=new Ug(t,e);this.zs=this.zs.add(n),this.Hs=this.Hs.add(n)}Ys(t,e){t.forEach(t=>this.addReference(t,e))}removeReference(t,e){this.Zs(new Ug(t,e))}Xs(t,e){t.forEach(t=>this.removeReference(t,e))}e_(t){const e=new Tl(new yl([])),n=new Ug(e,t),s=new Ug(e,t+1),r=[];return this.Hs.forEachInRange([n,s],t=>{this.Zs(t),r.push(t.key)}),r}t_(){this.zs.forEach(t=>this.Zs(t))}Zs(t){this.zs=this.zs.delete(t),this.Hs=this.Hs.delete(t)}n_(t){const e=new Tl(new yl([])),n=new Ug(e,t),s=new Ug(e,t+1);let r=ud();return this.Hs.forEachInRange([n,s],t=>{r=r.add(t.key)}),r}containsKey(t){const e=new Ug(t,0),n=this.zs.firstAfterOrEqual(e);return null!==n&&t.isEqual(n.key)}}class Ug{constructor(t,e){this.key=t,this.r_=e}static js(t,e){return Tl.comparator(t.key,e.key)||il(t.r_,e.r_)}static Js(t,e){return il(t.r_,e.r_)||Tl.comparator(t.key,e.key)}}class Vg{constructor(t,e){this.indexManager=t,this.referenceDelegate=e,this.mutationQueue=[],this.Gr=1,this.i_=new pl(Ug.js)}checkEmpty(t){return mp.resolve(0===this.mutationQueue.length)}addMutationBatch(t,e,n,s){const r=this.Gr;this.Gr++,this.mutationQueue.length>0&&this.mutationQueue[this.mutationQueue.length-1];const i=new Dg(r,e,n,s);this.mutationQueue.push(i);for(const e of s)this.i_=this.i_.add(new Ug(e.key,r)),this.indexManager.addToCollectionParentIndex(t,e.key.path.popLast());return mp.resolve(i)}lookupMutationBatch(t,e){return mp.resolve(this.s_(e))}getNextMutationBatchAfterBatchId(t,e){const n=e+1,s=this.__(n),r=s<0?0:s;return mp.resolve(this.mutationQueue.length>r?this.mutationQueue[r]:null)}getHighestUnacknowledgedBatchId(){return mp.resolve(0===this.mutationQueue.length?-1:this.Gr-1)}getAllMutationBatches(t){return mp.resolve(this.mutationQueue.slice())}getAllMutationBatchesAffectingDocumentKey(t,e){const n=new Ug(e,0),s=new Ug(e,Number.POSITIVE_INFINITY),r=[];return this.i_.forEachInRange([n,s],t=>{const e=this.s_(t.r_);r.push(e)}),mp.resolve(r)}getAllMutationBatchesAffectingDocumentKeys(t,e){let n=new pl(il);return e.forEach(t=>{const e=new Ug(t,0),s=new Ug(t,Number.POSITIVE_INFINITY);this.i_.forEachInRange([e,s],t=>{n=n.add(t.r_)})}),mp.resolve(this.o_(n))}getAllMutationBatchesAffectingQuery(t,e){const n=e.path,s=n.length+1;let r=n;Tl.isDocumentKey(r)||(r=r.child(""));const i=new Ug(new Tl(r),0);let o=new pl(il);return this.i_.forEachWhile(t=>{const e=t.key.path;return!!n.isPrefixOf(e)&&(e.length===s&&(o=o.add(t.r_)),!0)},i),mp.resolve(this.o_(o))}o_(t){const e=[];return t.forEach(t=>{const n=this.s_(t);null!==n&&e.push(n)}),e}removeMutationBatch(t,e){el(0===this.a_(e.batchId,"removed"),55003),this.mutationQueue.shift();let n=this.i_;return mp.forEach(e.mutations,s=>{const r=new Ug(s.key,e.batchId);return n=n.delete(r),this.referenceDelegate.markPotentiallyOrphaned(t,s.key)}).next(()=>{this.i_=n})}Hr(t){}containsKey(t,e){const n=new Ug(e,0),s=this.i_.firstAfterOrEqual(n);return mp.resolve(e.isEqual(s&&s.key))}performConsistencyCheck(t){return this.mutationQueue.length,mp.resolve()}a_(t,e){return this.__(t)}__(t){return 0===this.mutationQueue.length?0:t-this.mutationQueue[0].batchId}s_(t){const e=this.__(t);return e<0||e>=this.mutationQueue.length?null:this.mutationQueue[e]}}class jg{constructor(t){this.u_=t,this.docs=new ul(Tl.comparator),this.size=0}setIndexManager(t){this.indexManager=t}addEntry(t,e){const n=e.key,s=this.docs.get(n),r=s?s.size:0,i=this.u_(e);return this.docs=this.docs.insert(n,{document:e.mutableCopy(),size:i}),this.size+=i-r,this.indexManager.addToCollectionParentIndex(t,n.path.popLast())}removeEntry(t){const e=this.docs.get(t);e&&(this.docs=this.docs.remove(t),this.size-=e.size)}getEntry(t,e){const n=this.docs.get(e);return mp.resolve(n?n.document.mutableCopy():kh.newInvalidDocument(e))}getEntries(t,e){let n=nd();return e.forEach(t=>{const e=this.docs.get(t);n=n.insert(t,e?e.document.mutableCopy():kh.newInvalidDocument(t))}),mp.resolve(n)}getAllEntries(t){let e=nd();return this.docs.forEach((t,n)=>{e=e.insert(t,n.document)}),mp.resolve(e)}getDocumentsMatchingQuery(t,e,n,s){let r,i;Cg(e)?(r=yl.fromString(bf(e)),i=t=>Ng(e,t)):(r=e.path,i=t=>Kh(e,t));let o=nd();const a=new Tl(r.child("__id-9223372036854775808__")),B=this.docs.getIteratorFrom(a);for(;B.hasNext();){const{key:t,value:{document:e}}=B.getNext();if(!r.isPrefixOf(t.path))break;t.path.length>r.length+1||Ph(Lh(e),n)<=0||(s.has(e.key)||i(e))&&(o=o.insert(e.key,e.mutableCopy()))}return mp.resolve(o)}getAllFromCollectionGroup(t,e,n,s){Zc(9500)}c_(t,e){return mp.forEach(this.docs,t=>e(t))}newChangeBuffer(t){return new $g(this)}getSize(t){return mp.resolve(this.size)}}class $g extends kg{constructor(t){super(),this.$s=t}applyChanges(t){const e=[];return this.changes.forEach((n,s)=>{s.isValidDocument()?e.push(this.$s.addEntry(t,s)):this.$s.removeEntry(n)}),mp.waitFor(e)}getFromCache(t,e){return this.$s.getEntry(t,e)}getAllFromCache(t,e){return this.$s.getEntries(t,e)}}class Jg{constructor(t){this.persistence=t,this.l_=new td(t=>yg(t),Eg),this.lastRemoteSnapshotVersion=xh.min(),this.highestTargetId=0,this.E_=0,this.h_=new Hg,this.targetCount=0,this.T_=Rg.ws()}forEachTarget(t,e){return this.l_.forEach((t,n)=>e(n)),mp.resolve()}getLastRemoteSnapshotVersion(t){return mp.resolve(this.lastRemoteSnapshotVersion)}getHighestSequenceNumber(t){return mp.resolve(this.E_)}allocateTargetId(t){return this.highestTargetId=this.T_.next(),mp.resolve(this.highestTargetId)}setTargetsMetadata(t,e,n){return n&&(this.lastRemoteSnapshotVersion=n),e>this.E_&&(this.E_=e),mp.resolve()}Ds(t){this.l_.set(t.target,t);const e=t.targetId;e>this.highestTargetId&&(this.T_=new Rg(e),this.highestTargetId=e),t.sequenceNumber>this.E_&&(this.E_=t.sequenceNumber)}addTargetData(t,e){return this.Ds(e),this.targetCount+=1,mp.resolve()}updateTargetData(t,e){return this.Ds(e),mp.resolve()}removeTargetData(t,e){return this.l_.delete(e.target),this.h_.e_(e.targetId),this.targetCount-=1,mp.resolve()}removeTargets(t,e,n){let s=0;const r=[];return this.l_.forEach((i,o)=>{o.sequenceNumber<=e&&null===n.get(o.targetId)&&(this.l_.delete(i),r.push(this.removeMatchingKeysForTargetId(t,o.targetId)),s++)}),mp.waitFor(r).next(()=>s)}getTargetCount(t){return mp.resolve(this.targetCount)}getTargetData(t,e){const n=this.l_.get(e)||null;return mp.resolve(n)}addMatchingKeys(t,e,n){return this.h_.Ys(e,n),mp.resolve()}removeMatchingKeys(t,e,n){this.h_.Xs(e,n);const s=this.persistence.referenceDelegate,r=[];return s&&e.forEach(e=>{r.push(s.markPotentiallyOrphaned(t,e))}),mp.waitFor(r)}removeMatchingKeysForTargetId(t,e){return this.h_.e_(e),mp.resolve()}getMatchingKeysForTargetId(t,e){const n=this.h_.n_(e);return mp.resolve(n)}containsKey(t,e){return mp.resolve(this.h_.containsKey(e))}}class qg{constructor(t,e){this.P_={},this.overlays={},this.I_=new fp(0),this.R_=!1,this.R_=!0,this.A_=new Gg,this.referenceDelegate=t(this),this.V_=new Jg(this),this.indexManager=new Ag,this.remoteDocumentCache=function(t){return new jg(t)}(t=>this.referenceDelegate.d_(t)),this.serializer=new Tg(e),this.f_=new Pg(this.serializer)}start(){return Promise.resolve()}shutdown(){return this.R_=!1,Promise.resolve()}get started(){return this.R_}setDatabaseDeletedListener(){}setNetworkEnabled(){}getIndexManager(t){return this.indexManager}getDocumentOverlayCache(t){let e=this.overlays[t.toKey()];return e||(e=new Mg,this.overlays[t.toKey()]=e),e}getMutationQueue(t,e){let n=this.P_[t.toKey()];return n||(n=new Vg(e,this.referenceDelegate),this.P_[t.toKey()]=n),n}getGlobalsCache(){return this.A_}getTargetCache(){return this.V_}getRemoteDocumentCache(){return this.remoteDocumentCache}getBundleCache(){return this.f_}runTransaction(t,e,n){Qc("MemoryPersistence","Starting transaction:",t);const s=new zg(this.I_.next());return this.referenceDelegate.m_(),n(s).next(t=>this.referenceDelegate.p_(s).next(()=>t)).toPromise().then(t=>(s.raiseOnCommittedEvent(),t))}g_(t,e){return mp.or(Object.values(this.P_).map(n=>()=>n.containsKey(t,e)))}}class zg extends Cp{constructor(t){super(),this.currentSequenceNumber=t}}class Kg{constructor(t){this.persistence=t,this.y_=new Hg,this.w_=null}static b_(t){return new Kg(t)}get S_(){if(this.w_)return this.w_;throw Zc(60996)}addReference(t,e,n){return this.y_.addReference(n,e),this.S_.delete(n.toString()),mp.resolve()}removeReference(t,e,n){return this.y_.removeReference(n,e),this.S_.add(n.toString()),mp.resolve()}markPotentiallyOrphaned(t,e){return this.S_.add(e.toString()),mp.resolve()}removeTarget(t,e){this.y_.e_(e.targetId).forEach(t=>this.S_.add(t.toString()));const n=this.persistence.getTargetCache();return n.getMatchingKeysForTargetId(t,e.targetId).next(t=>{t.forEach(t=>this.S_.add(t.toString()))}).next(()=>n.removeTargetData(t,e))}m_(){this.w_=new Set}p_(t){const e=this.persistence.getRemoteDocumentCache().newChangeBuffer();return mp.forEach(this.S_,n=>{const s=Tl.fromPath(n);return this.v_(t,s).next(t=>{t||e.removeEntry(s,xh.min())})}).next(()=>(this.w_=null,e.apply(t)))}updateLimboDocument(t,e){return this.v_(t,e).next(t=>{t?this.S_.delete(e.toString()):this.S_.add(e.toString())})}d_(t){return 0}v_(t,e){return mp.or([()=>mp.resolve(this.y_.containsKey(e)),()=>this.persistence.getTargetCache().containsKey(t,e),()=>this.persistence.g_(t,e)])}}class Qg{constructor(t,e){this.persistence=t,this.D_=new td(t=>function(t){let e="";for(let n=0;n<t.length;n++)e.length>0&&(e=vg(e)),e=bg(t.get(n),e);return vg(e)}(t.path),(t,e)=>t.isEqual(e)),this.garbageCollector=function(t,e){return new bp(t,e)}(this,e)}static b_(t,e){return new Qg(t,e)}m_(){}p_(t){return mp.resolve()}forEachTarget(t,e){return this.persistence.getTargetCache().forEachTarget(t,e)}ir(t){const e=this.Cs(t);return this.persistence.getTargetCache().getTargetCount(t).next(t=>e.next(e=>t+e))}Cs(t){let e=0;return this.sr(t,t=>{e++}).next(()=>e)}sr(t,e){return mp.forEach(this.D_,(n,s)=>this.Os(t,n,s).next(t=>t?mp.resolve():e(s)))}removeTargets(t,e,n){return this.persistence.getTargetCache().removeTargets(t,e,n)}removeOrphanedDocuments(t,e){let n=0;const s=this.persistence.getRemoteDocumentCache(),r=s.newChangeBuffer();return s.c_(t,s=>this.Os(t,s,e).next(t=>{t||(n++,r.removeEntry(s,xh.min()))})).next(()=>r.apply(t)).next(()=>n)}markPotentiallyOrphaned(t,e){return this.D_.set(e,t.currentSequenceNumber),mp.resolve()}removeTarget(t,e){const n=e.withSequenceNumber(t.currentSequenceNumber);return this.persistence.getTargetCache().updateTargetData(t,n)}addReference(t,e,n){return this.D_.set(n,t.currentSequenceNumber),mp.resolve()}removeReference(t,e,n){return this.D_.set(n,t.currentSequenceNumber),mp.resolve()}updateLimboDocument(t,e){return this.D_.set(e,t.currentSequenceNumber),mp.resolve()}d_(t){let e=t.key.toString().length;return t.isFoundDocument()&&(e+=mu(t.data.value)),e}Os(t,e,n){return mp.or([()=>this.persistence.g_(t,e),()=>this.persistence.getTargetCache().containsKey(t,e),()=>{const t=this.D_.get(e);return mp.resolve(void 0!==t&&t>n)}])}getCacheSize(t){return this.persistence.getRemoteDocumentCache().getSize(t)}}class Wg{constructor(t,e,n,s){this.targetId=t,this.fromCache=e,this.Vo=n,this.fo=s}static mo(t,e){let n=ud(),s=ud();for(const t of e.docChanges)switch(t.type){case 0:n=n.add(t.doc.key);break;case 1:s=s.add(t.doc.key)}return new Wg(t,e.fromCache,n,s)}}function Yg(t,e){return Tl.comparator(t.key,e.key)}class Xg{constructor(){this._documentReadCount=0}get documentReadCount(){return this._documentReadCount}incrementDocumentReadCount(t){this._documentReadCount+=t}}class Zg{constructor(){this.po=!1,this.yo=!1,this.wo=100,this.bo=Mn()?8:function(t){const e=t.match(/Android ([\d.]+)/i),n=e?e[1].split(".").slice(0,2).join("."):"-1";return Number(n)}(Fn())>0?6:4}initialize(t,e){this.So=t,this.indexManager=e,this.po=!0}getDocumentsMatchingQuery(t,e,n,s){const r={result:null};return this.vo(t,e).next(t=>{r.result=t}).next(()=>{if(!r.result)return this.Do(t,e,s,n).next(t=>{r.result=t})}).next(()=>{if(r.result)return;const n=new Xg;return this.xo(t,e,n).next(s=>{if(r.result=s,this.yo)return this.Co(t,e,n,s.size)})}).next(()=>r.result)}Co(t,e,n,s){return Cg(e)?mp.resolve():n.documentReadCount<this.wo?(Kc()<=is.DEBUG&&Qc("QueryEngine","SDK will not create cache indexes for query:",zh(e),"since it only creates cache indexes for collection contains","more than or equal to",this.wo,"documents"),mp.resolve()):(Kc()<=is.DEBUG&&Qc("QueryEngine","Query:",zh(e),"scans",n.documentReadCount,"local documents and returns",s,"documents as results."),n.documentReadCount>this.bo*s?(Kc()<=is.DEBUG&&Qc("QueryEngine","The SDK decides to create cache indexes for query:",zh(e),"as using cache indexes may help improve performance."),this.indexManager.createTargetIndexes(t,Jh(e))):mp.resolve())}vo(t,e){if(Cg(e))return mp.resolve(null);let n=e;if(jh(n))return mp.resolve(null);let s=Jh(n);return this.indexManager.getIndexType(t,s).next(e=>0===e?null:(null!==n.limit&&1===e&&(n=qh(n,null,"F"),s=Jh(n)),this.indexManager.getDocumentsMatchingTarget(t,s).next(e=>{const r=ud(...e);return this.So.getDocuments(t,r).next(e=>this.indexManager.getMinOffset(t,s).next(s=>{const i=this.Fo(n,e);return this.Oo(n,i,r,s.readTime)?this.vo(t,qh(n,null,"F")):this.Mo(t,i,n,s)}))})))}Do(t,e,n,s){return(Cg(e)?function(t){for(const e of t.stages){if(e instanceof Cf||e instanceof gf)return!1;if(e instanceof ff){if(e.condition instanceof nf&&"exists"===e.condition._expr.name&&e.condition._expr.params[0]instanceof Wp&&e.condition._expr.params[0].fieldName===ml)continue;return!1}}return!0}(e):jh(e))||s.isEqual(xh.min())?mp.resolve(null):this.So.getDocuments(t,n).next(r=>{const i=this.Fo(e,r);return this.Oo(e,i,n,s)?mp.resolve(null):(Kc()<=is.DEBUG&&Qc("QueryEngine","Re-using previous result from %s to execute query: %s",s.toString(),gg(e)),this.Mo(t,i,e,function(t,e){const n=t.toTimestamp().seconds,s=t.toTimestamp().nanoseconds+1,r=xh.fromTimestamp(1e9===s?new Fl(n+1,0):new Fl(n,s));return new Fh(r,Tl.empty(),e)}(s,-1)).next(t=>t))})}Fo(t,e){let n,s;return Cg(t)?(n=new pl(Yg),s=e=>Ng(t,e)):(n=new pl(Qh(t)),s=e=>Kh(t,e)),e.forEach((t,e)=>{s(e)&&(n=n.add(e))}),n}Oo(t,e,n,s){if(Cg(t))return function(t){return t.stages.some(t=>t instanceof Cf||t instanceof gf)}(t);if(null===t.limit)return!1;if(n.size!==e.size)return!0;const r="F"===t.limitType?e.last():e.first();return!!r&&(r.hasPendingWrites||r.version.compareTo(s)>0)}xo(t,e,n){return Kc()<=is.DEBUG&&Qc("QueryEngine","Using full collection scan to execute query:",gg(e)),this.So.getDocumentsMatchingQuery(t,e,Fh.min(),n)}Mo(t,e,n,s){return this.So.getDocumentsMatchingQuery(t,n,s).next(t=>(e.forEach(e=>{t=t.insert(e.key,e)}),t))}}class tm{constructor(t,e,n,s){this.persistence=t,this.No=e,this.serializer=s,this.Lo=new ul(il),this.Bo=new td(t=>yg(t),Eg),this.Uo=new Map,this.ko=t.getRemoteDocumentCache(),this.V_=t.getTargetCache(),this.f_=t.getBundleCache(),this.qo(n)}qo(t){this.documentOverlayCache=this.persistence.getDocumentOverlayCache(t),this.indexManager=this.persistence.getIndexManager(t),this.mutationQueue=this.persistence.getMutationQueue(t,this.indexManager),this.localDocuments=new Fg(this.ko,this.mutationQueue,this.documentOverlayCache,this.indexManager),this.ko.setIndexManager(this.indexManager),this.No.initialize(this.localDocuments,this.indexManager)}collectGarbage(t){return this.persistence.runTransaction("Collect garbage","readwrite-primary",e=>t.collect(e,this.Lo))}}async function em(t,e){const n=nl(t);return await n.persistence.runTransaction("Handle user change","readonly",t=>{let s;return n.mutationQueue.getAllMutationBatches(t).next(r=>(s=r,n.qo(e),n.mutationQueue.getAllMutationBatches(t))).next(e=>{const r=[],i=[];let o=ud();for(const t of s){r.push(t.batchId);for(const e of t.mutations)o=o.add(e.key)}for(const t of e){i.push(t.batchId);for(const e of t.mutations)o=o.add(e.key)}return n.localDocuments.getDocuments(t,o).next(t=>({$o:t,removedBatchIds:r,addedBatchIds:i}))})})}function nm(t,e){const n=nl(t);return n.persistence.runTransaction("Get next mutation batch","readonly",t=>(void 0===e&&(e=-1),n.mutationQueue.getNextMutationBatchAfterBatchId(t,e)))}class sm{constructor(t,e){this.asyncQueue=t,this.onlineStateHandler=e,this.state="Unknown",this.Yo=0,this.Zo=null,this.Xo=!0}ea(){0===this.Yo&&(this.ta("Unknown"),this.Zo=this.asyncQueue.enqueueAfterDelay("online_state_timeout",1e4,()=>(this.Zo=null,this.na("Backend didn't respond within 10 seconds."),this.ta("Offline"),Promise.resolve())))}ra(t){"Online"===this.state?this.ta("Unknown"):(this.Yo++,this.Yo>=1&&(this.ia(),this.na(`Connection failed 1 times. Most recent error: ${t.toString()}`),this.ta("Offline")))}set(t){this.ia(),this.Yo=0,"Online"===t&&(this.Xo=!1),this.ta(t)}ta(t){t!==this.state&&(this.state=t,this.onlineStateHandler(t))}na(t){const 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.Xo?(Wc(e),this.Xo=!1):Qc("OnlineStateTracker",e)}ia(){null!==this.Zo&&(this.Zo.cancel(),this.Zo=null)}}const rm="RemoteStore";class im{constructor(t,e,n,s,r){this.localStore=t,this.datastore=e,this.asyncQueue=n,this.remoteSyncer={},this.sa=[],this._a=new Map,this.oa=new Map,this.aa=new Map,this.ua=new Rg(1e3),this.ca=new Rg(1001),this.la=new Set,this.Ea=[],this.ha=r,this.ha.Qe(t=>{n.enqueueAndForget(async()=>{Bm(this)&&(Qc(rm,"Restarting streams for network reachability change."),await async function(t){const e=nl(t);e.la.add(4),await am(e),e.Ta.set("Unknown"),e.la.delete(4),await om(e)}(this))})}),this.Ta=new sm(n,s)}}async function om(t){if(Bm(t))for(const e of t.Ea)await e(!0)}async function am(t){for(const e of t.Ea)await e(!1)}function Bm(t){return 0===nl(t).la.size}async function cm(t,e,n){if(!wp(e))throw e;t.la.add(1),await am(t),t.Ta.set("Offline"),n||(n=()=>function(t){const e=nl(t);return e.persistence.runTransaction("Get last remote snapshot version","readonly",t=>e.V_.getLastRemoteSnapshotVersion(t))}(t.localStore)),t.asyncQueue.enqueueRetryable(async()=>{Qc(rm,"Retrying IndexedDB access"),await n(),t.la.delete(1),await om(t)})}function lm(t,e){return e().catch(n=>cm(t,n,e))}async function um(t){const e=nl(t),n=Em(e);let s=e.sa.length>0?e.sa[e.sa.length-1].batchId:-1;for(;hm(e);)try{const t=await nm(e.localStore,s);if(null===t){0===e.sa.length&&n.en();break}s=t.batchId,dm(e,t)}catch(t){await cm(e,t)}pm(e)&&fm(e)}function hm(t){return Bm(t)&&t.sa.length<10}function dm(t,e){t.sa.push(e);const n=Em(t);n.Yt()&&n.Rn&&n.An(e.mutations)}function pm(t){return Bm(t)&&!Em(t).Jt()&&t.sa.length>0}function fm(t){Em(t).start()}async function Cm(t){Em(t).fn()}async function gm(t){const e=Em(t);for(const n of t.sa)e.An(n.mutations)}async function mm(t,e,n){const s=t.sa.shift(),r=_g.from(s,e,n);await lm(t,()=>t.remoteSyncer.applySuccessfulWrite(r)),await um(t)}async function wm(t,e){e&&Em(t).Rn&&await async function(t,e){if(function(t){return function(t){switch(t){case Cl.OK:return Zc(64938);case Cl.CANCELLED:case Cl.UNKNOWN:case Cl.DEADLINE_EXCEEDED:case Cl.RESOURCE_EXHAUSTED:case Cl.INTERNAL:case Cl.UNAVAILABLE:case Cl.UNAUTHENTICATED:return!1;case Cl.INVALID_ARGUMENT:case Cl.NOT_FOUND:case Cl.ALREADY_EXISTS:case Cl.PERMISSION_DENIED:case Cl.FAILED_PRECONDITION:case Cl.ABORTED:case Cl.OUT_OF_RANGE:case Cl.UNIMPLEMENTED:case Cl.DATA_LOSS:return!0;default:return Zc(15467,{code:t})}}(t)&&t!==Cl.ABORTED}(e.code)){const n=t.sa.shift();Em(t).Xt(),await lm(t,()=>t.remoteSyncer.rejectFailedWrite(n.batchId,e)),await um(t)}}(t,e),pm(t)&&fm(t)}async function ym(t,e){const n=nl(t);n.asyncQueue.verifyOperationInProgress(),Qc(rm,"RemoteStore received new credentials");const s=Bm(n);n.la.add(3),await am(n),s&&n.Ta.set("Unknown"),await n.remoteSyncer.handleCredentialChange(e),n.la.delete(3),await om(n)}function Em(t){return t.Ra||(t.Ra=function(t,e,n){const s=nl(t);return s.pn(),new Bp(e,s.connection,s.authCredentials,s.appCheckCredentials,s.serializer,n)}(t.datastore,t.asyncQueue,{ct:()=>Promise.resolve(),Et:Cm.bind(null,t),Tt:wm.bind(null,t),Vn:gm.bind(null,t),dn:mm.bind(null,t)}),t.Ea.push(async e=>{e?(t.Ra.Xt(),await um(t)):(await t.Ra.stop(),t.sa.length>0&&(Qc(rm,`Stopping write stream with ${t.sa.length} pending writes`),t.sa=[]))})),t.Ra}class Dm{constructor(t,e,n,s,r){this.asyncQueue=t,this.timerId=e,this.targetTimeMs=n,this.op=s,this.removalCallback=r,this.deferred=new Pd,this.then=this.deferred.promise.then.bind(this.deferred.promise),this.deferred.promise.catch(t=>{})}get promise(){return this.deferred.promise}static createAndSchedule(t,e,n,s,r){const i=Date.now()+n,o=new Dm(t,e,i,s,r);return o.start(n),o}start(t){this.timerHandle=setTimeout(()=>this.handleDelayElapsed(),t)}skipDelay(){return this.handleDelayElapsed()}cancel(t){null!==this.timerHandle&&(this.clearTimeout(),this.deferred.reject(new gl(Cl.CANCELLED,"Operation cancelled"+(t?": "+t:""))))}handleDelayElapsed(){this.asyncQueue.enqueueAndForget(()=>null!==this.timerHandle?(this.clearTimeout(),this.op().then(t=>this.deferred.resolve(t))):Promise.resolve())}clearTimeout(){null!==this.timerHandle&&(this.removalCallback(this),clearTimeout(this.timerHandle),this.timerHandle=null)}}function _m(t,e){if(Wc("AsyncQueue",`${e}: ${t}`),wp(t))return new gl(Cl.UNAVAILABLE,`${e}: ${t}`);throw t}class bm{constructor(){this.activeTargetIds=hd}Ba(t){this.activeTargetIds=this.activeTargetIds.add(t)}Ua(t){this.activeTargetIds=this.activeTargetIds.delete(t)}La(){const t={activeTargetIds:this.activeTargetIds.toArray(),updateTimeMs:Date.now()};return JSON.stringify(t)}}class vm{constructor(){this.fu=new bm,this.mu={},this.onlineStateHandler=null,this.sequenceNumberHandler=null}addPendingMutation(t){}updateMutationState(t,e,n){}addLocalQueryTarget(t,e=!0){return e&&this.fu.Ba(t),this.mu[t]||"not-current"}updateQueryState(t,e,n){this.mu[t]=e}removeLocalQueryTarget(t){this.fu.Ua(t)}isLocalQueryTarget(t){return this.fu.activeTargetIds.has(t)}clearQueryState(t){delete this.mu[t]}getAllActiveQueryTargets(){return this.fu.activeTargetIds}isActiveQueryTarget(t){return this.fu.activeTargetIds.has(t)}start(){return this.fu=new bm,Promise.resolve()}handleUserChange(t,e,n){}setOnlineState(t){}shutdown(){}writeSequenceNumber(t){}notifyBundleLoaded(t){}}function Im(){return"undefined"!=typeof document?document:null}class Tm{constructor(){this.queries=Om(),this.onlineState="Unknown",this.Du=new Set}terminate(){!function(t,e){const n=nl(t),s=n.queries;n.queries=Om(),s.forEach((t,n)=>{for(const t of n.bu)t.onError(e)})}(this,new gl(Cl.ABORTED,"Firestore shutting down"))}}function Om(){return new td(t=>mg(t),wg)}var Am;!function(t){t.Default="default",t.Cache="cache"}(Am||(Am={}));class Sm{constructor(t,e,n,s,r,i){this.localStore=t,this.remoteStore=e,this.eventManager=n,this.sharedClientState=s,this.currentUser=r,this.maxConcurrentLimboResolutions=i,this.hc={},this.Tc=new td(t=>mg(t),wg),this.Pc=new Map,this.Ic=new Set,this.Rc=new ul(Tl.comparator),this.Ac=new Map,this.Vc=new Hg,this.dc={},this.fc=new Map,this.mc=Rg.bs(),this.onlineState="Unknown",this.gc=void 0}get isPrimaryClient(){return!0===this.gc}}async function Rm(t,e,n){const s=function(t){const e=nl(t);return e.remoteStore.remoteSyncer.applySuccessfulWrite=xm.bind(null,e),e.remoteStore.remoteSyncer.rejectFailedWrite=km.bind(null,e),e}(t);try{const t=await function(t,e){const n=nl(t),s=Fl.now(),r=e.reduce((t,e)=>t.add(e.key),ud());let i,o;return n.persistence.runTransaction("Locally write mutations","readwrite",t=>{let a=nd(),B=ud();return n.ko.getEntries(t,r).next(t=>{a=t,a.forEach((t,e)=>{e.isValidDocument()||(B=B.add(t))})}).next(()=>n.localDocuments.getOverlayedDocuments(t,a)).next(r=>{i=r;const o=[];for(const t of e){const e=sh(t,i.get(t.key).overlayedDocument);null!=e&&o.push(new oh(t.key,e,Su(e.value.mapValue),Yu.exists(!0)))}return n.mutationQueue.addMutationBatch(t,s,o,e)}).next(e=>{o=e;const s=e.applyToLocalDocumentSet(i,B);return n.documentOverlayCache.saveOverlays(t,e.batchId,s)})}).then(()=>({batchId:o.batchId,changes:id(i)}))}(s.localStore,e);s.sharedClientState.addPendingMutation(t.batchId),function(t,e,n){let s=t.dc[t.currentUser.toKey()];s||(s=new ul(il)),s=s.insert(e,n),t.dc[t.currentUser.toKey()]=s}(s,t.batchId,n),await Pm(s,t.changes),await um(s.remoteStore)}catch(t){const e=_m(t,"Failed to persist write");n.reject(e)}}function Nm(t,e,n){const s=nl(t);if(s.isPrimaryClient&&0===n||!s.isPrimaryClient&&1===n){const t=[];s.Tc.forEach((n,s)=>{const r=s.view.xu(e);r.snapshot&&t.push(r.snapshot)}),function(t,e){const n=nl(t);n.onlineState=e;let s=!1;n.queries.forEach((t,n)=>{for(const t of n.bu)t.xu(e)&&(s=!0)}),s&&function(t){t.Du.forEach(t=>{t.next()})}(n)}(s.eventManager,e),t.length&&s.hc.Tn(t),s.onlineState=e,s.isPrimaryClient&&s.sharedClientState.setOnlineState(e)}}async function xm(t,e){const n=nl(t),s=e.batch.batchId;try{const t=await function(t,e){const n=nl(t);return n.persistence.runTransaction("Acknowledge batch","readwrite-primary",t=>{const s=e.batch.keys(),r=n.ko.newChangeBuffer({trackRemovals:!0});return function(t,e,n,s){const r=n.batch,i=r.keys();let o=mp.resolve();return i.forEach(t=>{o=o.next(()=>s.getEntry(e,t)).next(e=>{const i=n.docVersions.get(t);el(null!==i,48541),e.version.compareTo(i)<0&&(r.applyToRemoteDocument(e,n),e.isValidDocument()&&(e.setReadTime(n.commitVersion),s.addEntry(e)))})}),o.next(()=>t.mutationQueue.removeMutationBatch(e,r))}(n,t,e,r).next(()=>r.apply(t)).next(()=>n.mutationQueue.performConsistencyCheck(t)).next(()=>n.documentOverlayCache.removeOverlaysForBatchId(t,s,e.batch.batchId)).next(()=>n.localDocuments.recalculateAndSaveOverlaysForDocumentKeys(t,function(t){let e=ud();for(let n=0;n<t.mutationResults.length;++n)t.mutationResults[n].transformResults.length>0&&(e=e.add(t.batch.mutations[n].key));return e}(e))).next(()=>n.localDocuments.getDocuments(t,s))})}(n.localStore,e);Fm(n,s,null),Lm(n,s),n.sharedClientState.updateMutationState(s,"acknowledged"),await Pm(n,t)}catch(t){await gp(t)}}async function km(t,e,n){const s=nl(t);try{const t=await function(t,e){const n=nl(t);return n.persistence.runTransaction("Reject batch","readwrite-primary",t=>{let s;return n.mutationQueue.lookupMutationBatch(t,e).next(e=>(el(null!==e,37113),s=e.keys(),n.mutationQueue.removeMutationBatch(t,e))).next(()=>n.mutationQueue.performConsistencyCheck(t)).next(()=>n.documentOverlayCache.removeOverlaysForBatchId(t,s,e)).next(()=>n.localDocuments.recalculateAndSaveOverlaysForDocumentKeys(t,s)).next(()=>n.localDocuments.getDocuments(t,s))})}(s.localStore,e);Fm(s,e,n),Lm(s,e),s.sharedClientState.updateMutationState(e,"rejected",n),await Pm(s,t)}catch(n){await gp(n)}}function Lm(t,e){(t.fc.get(e)||[]).forEach(t=>{t.resolve()}),t.fc.delete(e)}function Fm(t,e,n){const s=nl(t);let r=s.dc[s.currentUser.toKey()];if(r){const t=r.get(e);t&&(n?t.reject(n):t.resolve(),r=r.remove(e)),s.dc[s.currentUser.toKey()]=r}}async function Pm(t,e,n){const s=nl(t),r=[],i=[],o=[];s.Tc.isEmpty()||(s.Tc.forEach((t,a)=>{o.push(s.yc(a,e,n).then(t=>{if((t||n)&&s.isPrimaryClient){const e=t?!t.fromCache:n?.targetChanges.get(a.targetId)?.current;s.sharedClientState.updateQueryState(a.targetId,e?"current":"not-current")}if(t){r.push(t);const e=Wg.mo(a.targetId,t);i.push(e)}}))}),await Promise.all(o),s.hc.Tn(r),await async function(t,e){const n=nl(t);try{await n.persistence.runTransaction("notifyLocalViewChanges","readwrite",t=>mp.forEach(e,e=>mp.forEach(e.Vo,s=>n.persistence.referenceDelegate.addReference(t,e.targetId,s)).next(()=>mp.forEach(e.fo,s=>n.persistence.referenceDelegate.removeReference(t,e.targetId,s)))))}catch(t){if(!wp(t))throw t;Qc("LocalStore","Failed to update sequence numbers: "+t)}for(const t of e){const e=t.targetId;if(!t.fromCache){const t=n.Lo.get(e),s=t.snapshotVersion,r=t.withLastLimboFreeSnapshotVersion(s);n.Lo=n.Lo.insert(e,r)}}}(s.localStore,i))}async function Mm(t,e){const n=nl(t);if(!n.currentUser.isEqual(e)){Qc("SyncEngine","User change. New user:",e.toKey());const t=await em(n.localStore,e);n.currentUser=e,function(t,e){t.fc.forEach(t=>{t.forEach(t=>{t.reject(new gl(Cl.CANCELLED,e))})}),t.fc.clear()}(n,"'waitForPendingWrites' promise is rejected due to a user change."),n.sharedClientState.handleUserChange(e,t.removedBatchIds,t.addedBatchIds),await Pm(n,t.$o)}}class Gm{constructor(){this.kind="memory",this.synchronizeTabs=!1}async initialize(t){this.serializer=Rd(t.databaseInfo.databaseId),this.sharedClientState=this.vc(t),this.persistence=this.Dc(t),await this.persistence.start(),this.localStore=this.xc(t),this.gcScheduler=this.Cc(t,this.localStore),this.indexBackfillerScheduler=this.Fc(t,this.localStore)}Cc(t,e){return null}Fc(t,e){return null}xc(t){return function(t,e,n,s){return new tm(t,e,n,s)}(this.persistence,new Zg,t.initialUser,this.serializer)}Dc(t){return new qg(Kg.b_,this.serializer)}vc(t){return new vm}async terminate(){this.gcScheduler?.stop(),this.indexBackfillerScheduler?.stop(),this.sharedClientState.shutdown(),await this.persistence.shutdown()}}Gm.provider={build:()=>new Gm};class Hm extends Gm{constructor(t){super(),this.cacheSizeBytes=t}Cc(t,e){el(this.persistence.referenceDelegate instanceof Qg,46915);const n=this.persistence.referenceDelegate.garbageCollector;return new _p(n,t.asyncQueue,e)}Dc(t){const e=void 0!==this.cacheSizeBytes?pp.withCacheSize(this.cacheSizeBytes):pp.DEFAULT;return new qg(t=>Qg.b_(t,e),this.serializer)}}class Um{async initialize(t,e){this.localStore||(this.localStore=t.localStore,this.sharedClientState=t.sharedClientState,this.datastore=this.createDatastore(e),this.remoteStore=this.createRemoteStore(e),this.eventManager=this.createEventManager(e),this.syncEngine=this.createSyncEngine(e,!t.synchronizeTabs),this.sharedClientState.onlineStateHandler=t=>Nm(this.syncEngine,t,1),this.remoteStore.remoteSyncer.handleCredentialChange=Mm.bind(null,this.syncEngine),await async function(t,e){const n=nl(t);e?(n.la.delete(2),await om(n)):e||(n.la.add(2),await am(n),n.Ta.set("Unknown"))}(this.remoteStore,this.syncEngine.isPrimaryClient))}createEventManager(t){return new Tm}createDatastore(t){const e=Rd(t.databaseInfo.databaseId),n=function(t){return new rp(t)}(t.databaseInfo);return function(t,e,n,s){return new lp(t,e,n,s)}(t.authCredentials,t.appCheckCredentials,n,e)}createRemoteStore(t){return function(t,e,n,s,r){return new im(t,e,n,s,r)}(this.localStore,this.datastore,t.asyncQueue,t=>Nm(this.syncEngine,t,0),Qd.Ye()?new Qd:new zd)}createSyncEngine(t,e){return function(t,e,n,s,r,i,o){const a=new Sm(t,e,n,s,r,i);return o&&(a.gc=!0),a}(this.localStore,this.remoteStore,this.eventManager,this.sharedClientState,t.initialUser,t.maxConcurrentLimboResolutions,e)}async terminate(){await async function(t){const e=nl(t);Qc(rm,"RemoteStore shutting down."),e.la.add(5),await am(e),e.ha.shutdown(),e.Ta.set("Unknown")}(this.remoteStore),this.datastore?.terminate(),this.eventManager?.terminate()}}Um.provider={build:()=>new Um};const Vm="FirestoreClient";class jm{constructor(t,e,n,s,r){this.authCredentials=t,this.appCheckCredentials=e,this.asyncQueue=n,this._databaseInfo=s,this.user=Fd.UNAUTHENTICATED,this.clientId=rl.newId(),this.authCredentialListener=()=>Promise.resolve(),this.appCheckCredentialListener=()=>Promise.resolve(),this._uninitializedComponentsProvider=r,this.authCredentials.start(n,async t=>{Qc(Vm,"Received user=",t.uid),await this.authCredentialListener(t),this.user=t}),this.appCheckCredentials.start(n,t=>(Qc(Vm,"Received new app check token=",t),this.appCheckCredentialListener(t,this.user)))}get configuration(){return{asyncQueue:this.asyncQueue,databaseInfo:this._databaseInfo,clientId:this.clientId,authCredentials:this.authCredentials,appCheckCredentials:this.appCheckCredentials,initialUser:this.user,maxConcurrentLimboResolutions:100}}setCredentialChangeListener(t){this.authCredentialListener=t}setAppCheckTokenChangeListener(t){this.appCheckCredentialListener=t}terminate(){this.asyncQueue.enterRestrictedMode();const t=new Pd;return this.asyncQueue.enqueueAndForgetEvenWhileRestricted(async()=>{try{this._onlineComponents&&await this._onlineComponents.terminate(),this._offlineComponents&&await this._offlineComponents.terminate(),this.authCredentials.shutdown(),this.appCheckCredentials.shutdown(),t.resolve()}catch(e){const n=_m(e,"Failed to shutdown persistence");t.reject(n)}}),t.promise}}async function $m(t,e){t.asyncQueue.verifyOperationInProgress(),Qc(Vm,"Initializing OfflineComponentProvider");const n=t.configuration;await e.initialize(n);let s=n.initialUser;t.setCredentialChangeListener(async t=>{s.isEqual(t)||(await em(e.localStore,t),s=t)}),e.persistence.setDatabaseDeletedListener(()=>t.terminate()),t._offlineComponents=e}async function Jm(t,e){t.asyncQueue.verifyOperationInProgress();const n=await async function(t){if(!t._offlineComponents)if(t._uninitializedComponentsProvider){Qc(Vm,"Using user provided OfflineComponentProvider");try{await $m(t,t._uninitializedComponentsProvider._offline)}catch(e){const n=e;if(!function(t){return"FirebaseError"===t.name?t.code===Cl.FAILED_PRECONDITION||t.code===Cl.UNIMPLEMENTED:!("undefined"!=typeof DOMException&&t instanceof DOMException)||22===t.code||20===t.code||11===t.code}(n))throw n;Yc("Error using user provided cache. Falling back to memory cache: "+n),await $m(t,new Gm)}}else Qc(Vm,"Using default OfflineComponentProvider"),await $m(t,new Hm(void 0));return t._offlineComponents}(t);Qc(Vm,"Initializing OnlineComponentProvider"),await e.initialize(n,t.configuration),t.setCredentialChangeListener(t=>ym(e.remoteStore,t)),t.setAppCheckTokenChangeListener((t,n)=>ym(e.remoteStore,n)),t._onlineComponents=e}function qm(t){return async function(t){return t._onlineComponents||(t._uninitializedComponentsProvider?(Qc(Vm,"Using user provided OnlineComponentProvider"),await Jm(t,t._uninitializedComponentsProvider._online)):(Qc(Vm,"Using default OnlineComponentProvider"),await Jm(t,new Um))),t._onlineComponents}(t).then(t=>t.syncEngine)}let zm=class{constructor(t,e,n,s,r){this._firestore=t,this._userDataWriter=e,this._key=n,this._document=s,this._converter=r}get id(){return this._key.path.lastSegment()}get ref(){return new Rp(this._firestore,this._converter,this._key)}exists(){return null!==this._document}data(){if(this._document){if(this._converter){const t=new Km(this._firestore,this._userDataWriter,this._key,this._document,null);return this._converter.fromFirestore(t)}return this._userDataWriter.convertValue(this._document.data.value)}}_fieldsProto(){return this._document?.data.clone().value.mapValue.fields??void 0}get(t){if(this._document){const e=this._document.data.field(Mp("DocumentSnapshot.get",t));if(null!==e)return this._userDataWriter.convertValue(e)}}},Km=class extends zm{data(){return super.data()}};const Qm="AsyncQueue";class Wm{constructor(t=Promise.resolve()){this.$c=[],this.Kc=!1,this.Qc=[],this.Wc=null,this.Gc=!1,this.zc=!1,this.jc=[],this.Ht=new ip(this,"async_queue_retry"),this.Hc=()=>{const t=Im();t&&Qc(Qm,"Visibility state changed to "+t.visibilityState),this.Ht.$t()},this.Jc=t;const e=Im();e&&"function"==typeof e.addEventListener&&e.addEventListener("visibilitychange",this.Hc)}get isShuttingDown(){return this.Kc}enqueueAndForget(t){this.enqueue(t)}enqueueAndForgetEvenWhileRestricted(t){this.Yc(),this.Zc(t)}enterRestrictedMode(t){if(!this.Kc){this.Kc=!0,this.zc=t||!1;const e=Im();e&&"function"==typeof e.removeEventListener&&e.removeEventListener("visibilitychange",this.Hc)}}enqueue(t){if(this.Yc(),this.Kc)return new Promise(()=>{});const e=new Pd;return this.Zc(()=>this.Kc&&this.zc?Promise.resolve():(t().then(e.resolve,e.reject),e.promise)).then(()=>e.promise)}enqueueRetryable(t){this.enqueueAndForget(()=>(this.$c.push(t),this.Xc()))}async Xc(){if(0!==this.$c.length){try{await this.$c[0](),this.$c.shift(),this.Ht.reset()}catch(t){if(!wp(t))throw t;Qc(Qm,"Operation failed with retryable error: "+t)}this.$c.length>0&&this.Ht.kt(()=>this.Xc())}}Zc(t){const e=this.Jc.then(()=>(this.Gc=!0,t().catch(t=>{throw this.Wc=t,this.Gc=!1,Wc("INTERNAL UNHANDLED ERROR: ",Ym(t)),t}).then(t=>(this.Gc=!1,t))));return this.Jc=e,e}enqueueAfterDelay(t,e,n){this.Yc(),this.jc.indexOf(t)>-1&&(e=0);const s=Dm.createAndSchedule(this,t,e,n,t=>this.el(t));return this.Qc.push(s),s}Yc(){this.Wc&&Zc(47125,{tl:Ym(this.Wc)})}verifyOperationInProgress(){}async nl(){let t;do{t=this.Jc,await t}while(t!==this.Jc)}rl(t){for(const e of this.Qc)if(e.timerId===t)return!0;return!1}il(t){return this.nl().then(()=>{this.Qc.sort((t,e)=>t.targetTimeMs-e.targetTimeMs);for(const e of this.Qc)if(e.skipDelay(),"all"!==t&&e.timerId===t)break;return this.nl()})}sl(t){this.jc.push(t)}el(t){const e=this.Qc.indexOf(t);this.Qc.splice(e,1)}}function Ym(t){let e=t.message||"";return t.stack&&(e=t.stack.includes(t.message)?t.stack:t.message+"\n"+t.stack),e}class Xm extends Op{constructor(t,e,n,s){super(t,e,n,s),this.type="firestore",this._queue=new Wm,this._persistenceKey=s?.name||"[DEFAULT]"}async _terminate(){if(this._firestoreClient){const t=this._firestoreClient.terminate();this._queue=new Wm(t),this._firestoreClient=void 0,await t}}}function Zm(t){if(t._terminated)throw new gl(Cl.FAILED_PRECONDITION,"The client has already been terminated.");return t._firestoreClient||function(t){const e=t._freezeSettings(),n=function(t,e,n,s,r){return new Wl(t,e,n,r.host,r.ssl,r.experimentalForceLongPolling,r.experimentalAutoDetectLongPolling,qd(r.experimentalLongPollingOptions),r.useFetchStreams,r.isUsingEmulator,s,r._customHeaders,r.grpcFlowControlWindow)}(t._databaseId,t._app?.options.appId||"",t._persistenceKey,t._app?.options.apiKey,e);t._componentsProvider||e.localCache?._offlineComponentProvider&&e.localCache?._onlineComponentProvider&&(t._componentsProvider={_offline:e.localCache._offlineComponentProvider,_online:e.localCache._onlineComponentProvider}),t._firestoreClient=new jm(t._authCredentials,t._appCheckCredentials,t._queue,n,t._componentsProvider&&function(t){const e=t?._online.build();return{_offline:t?._offline.build(e),_online:e}}(t._componentsProvider))}(t),t._firestoreClient}class tw{constructor(t,e){this.hasPendingWrites=t,this.fromCache=e}isEqual(t){return this.hasPendingWrites===t.hasPendingWrites&&this.fromCache===t.fromCache}}class ew extends zm{constructor(t,e,n,s,r,i){super(t,e,n,s,i),this._firestore=t,this._firestoreImpl=t,this.metadata=r}exists(){return super.exists()}data(t={}){if(this._document){if(this._converter){const e=new nw(this._firestore,this._userDataWriter,this._key,this._document,this.metadata,null);return this._converter.fromFirestore(e,t)}return this._userDataWriter.convertValue(this._document.data.value,t.serverTimestamps)}}get(t,e={}){if(this._document){const n=this._document.data.field(Mp("DocumentSnapshot.get",t));if(null!==n)return this._userDataWriter.convertValue(n,e.serverTimestamps)}}toJSON(){if(this.metadata.hasPendingWrites)throw new gl(Cl.FAILED_PRECONDITION,"DocumentSnapshot.toJSON() attempted to serialize a document with pending writes. Await waitForPendingWrites() before invoking toJSON().");const t=this._document,e={};return e.type=ew._jsonSchemaVersion,e.bundle="",e.bundleSource="DocumentSnapshot",e.bundleName=this._key.toString(),t&&t.isValidDocument()&&t.isFoundDocument()?(this._userDataWriter.convertObjectMap(t.data.value.mapValue.fields,"previous"),e.bundle=(this._firestore,this.ref.path,"NOT SUPPORTED"),e):e}}ew._jsonSchemaVersion="firestore/documentSnapshot/1.0",ew._jsonSchema={type:Nl("string",ew._jsonSchemaVersion),bundleSource:Nl("string","DocumentSnapshot"),bundleName:Nl("string"),bundle:Nl("string")};class nw extends ew{data(t={}){return super.data(t)}}class sw{constructor(t,e,n,s){this._firestore=t,this._userDataWriter=e,this._snapshot=s,this.metadata=new tw(s.hasPendingWrites,s.fromCache),this.query=n}get docs(){const t=[];return this.forEach(e=>t.push(e)),t}get size(){return this._snapshot.docs.size}get empty(){return 0===this.size}forEach(t,e){this._snapshot.docs.forEach(n=>{t.call(e,new nw(this._firestore,this._userDataWriter,n.key,n,new tw(this._snapshot.mutatedKeys.has(n.key),this._snapshot.fromCache),this.query.converter))})}docChanges(t={}){const e=!!t.includeMetadataChanges;if(e&&this._snapshot.excludesMetadataChanges)throw new gl(Cl.INVALID_ARGUMENT,"To include metadata changes with your document changes, you must also pass { includeMetadataChanges:true } to onSnapshot().");return this._cachedChanges&&this._cachedChangesIncludeMetadataChanges===e||(this._cachedChanges=function(t,e){if(t._snapshot.oldDocs.isEmpty()){let e=0;return t._snapshot.docChanges.map(n=>{Cg(t._snapshot.query)?function(t){const e=function(t){for(let e=t.stages.length-1;e>=0;e--){const n=t.stages[e];if(n instanceof wf)return n.orderings}throw new Error("Pipeline must contain at least one Sort stage")}(t)}(t._snapshot.query):Qh(t.query._query);const s=new nw(t._firestore,t._userDataWriter,n.doc.key,n.doc,new tw(t._snapshot.mutatedKeys.has(n.doc.key),t._snapshot.fromCache),t.query.converter);return n.doc,{type:"added",doc:s,oldIndex:-1,newIndex:e++}})}{let n=t._snapshot.oldDocs;return t._snapshot.docChanges.filter(t=>e||3!==t.type).map(e=>{const s=new nw(t._firestore,t._userDataWriter,e.doc.key,e.doc,new tw(t._snapshot.mutatedKeys.has(e.doc.key),t._snapshot.fromCache),t.query.converter);let r=-1,i=-1;return 0!==e.type&&(r=n.indexOf(e.doc.key),n=n.delete(e.doc.key)),1!==e.type&&(n=n.add(e.doc),i=n.indexOf(e.doc.key)),{type:rw(e.type),doc:s,oldIndex:r,newIndex:i}})}}(this,e),this._cachedChangesIncludeMetadataChanges=e),this._cachedChanges}toJSON(){if(this.metadata.hasPendingWrites)throw new gl(Cl.FAILED_PRECONDITION,"QuerySnapshot.toJSON() attempted to serialize a document with pending writes. Await waitForPendingWrites() before invoking toJSON().");const t={};t.type=sw._jsonSchemaVersion,t.bundleSource="QuerySnapshot",t.bundleName=rl.newId(),this._firestore._databaseId.database,this._firestore._databaseId.projectId;const e=[],n=[],s=[];return this.docs.forEach(t=>{null!==t._document&&(e.push(t._document),n.push(this._userDataWriter.convertObjectMap(t._document.data.value.mapValue.fields,"previous")),s.push(t.ref.path))}),t.bundle=(this._firestore,this.query._query,t.bundleName,"NOT SUPPORTED"),t}}function rw(t){switch(t){case 0:return"added";case 2:case 3:return"modified";case 1:return"removed";default:return Zc(61501,{type:t})}}function iw(t){return function(t,e){const n=Zm(t);return function(t,e){const n=new Pd;return t.asyncQueue.enqueueAndForget(async()=>Rm(await qm(t),e,n)),n.promise}(n,e)}(Rl(t.firestore,Xm),[new lh(t._key,Yu.none())])}sw._jsonSchemaVersion="firestore/querySnapshot/1.0",sw._jsonSchema={type:Nl("string",sw._jsonSchemaVersion),bundleSource:Nl("string","QuerySnapshot"),bundleName:Nl("string"),bundle:Nl("string")};const ow="@firebase/firestore",aw="4.17.2";!function(t,e=!0){(function(t){qc=t})(fr),lr(new es("firestore",(t,{instanceIdentifier:n,options:s})=>{const r=t.getProvider("app").getImmediate(),i=new Xm(new Ud(t.getProvider("auth-internal")),new Jd(r,t.getProvider("app-check-internal")),Zl(r,n),r);return s={useFetchStreams:e,...s},i._setSettings(s),i},"PUBLIC").setMultipleInstances(!0)),mr(ow,aw,t),mr(ow,aw,"esm2020")}();const Bw="firebasestorage.googleapis.com",cw="storageBucket";class lw extends Vn{constructor(t,e,n=0){super(dw(t),`Firebase Storage: ${e} (${dw(t)})`),this.status_=n,this.customData={serverResponse:null},this._baseMessage=this.message,Object.setPrototypeOf(this,lw.prototype)}get status(){return this.status_}set status(t){this.status_=t}_codeEquals(t){return dw(t)===this.code}get serverResponse(){return this.customData.serverResponse}set serverResponse(t){this.customData.serverResponse=t,this.customData.serverResponse?this.message=`${this._baseMessage}\n${this.customData.serverResponse}`:this.message=this._baseMessage}}var uw,hw;function dw(t){return"storage/"+t}function pw(){return new lw(uw.UNKNOWN,"An unknown error occurred, please check the error payload for server response.")}function fw(){return new lw(uw.RETRY_LIMIT_EXCEEDED,"Max retry time for operation exceeded, please try again.")}function Cw(){return new lw(uw.CANCELED,"User canceled the upload/download.")}function gw(){return new lw(uw.CANNOT_SLICE_BLOB,"Cannot slice blob for upload. Please retry the upload.")}function mw(t){return new lw(uw.INVALID_ARGUMENT,t)}function ww(){return new lw(uw.APP_DELETED,"The Firebase app was deleted.")}function yw(t,e){return new lw(uw.INVALID_FORMAT,"String does not match format '"+t+"': "+e)}function Ew(t){throw new lw(uw.INTERNAL_ERROR,"Internal error: "+t)}!function(t){t.UNKNOWN="unknown",t.OBJECT_NOT_FOUND="object-not-found",t.BUCKET_NOT_FOUND="bucket-not-found",t.PROJECT_NOT_FOUND="project-not-found",t.QUOTA_EXCEEDED="quota-exceeded",t.UNAUTHENTICATED="unauthenticated",t.UNAUTHORIZED="unauthorized",t.UNAUTHORIZED_APP="unauthorized-app",t.RETRY_LIMIT_EXCEEDED="retry-limit-exceeded",t.INVALID_CHECKSUM="invalid-checksum",t.CANCELED="canceled",t.INVALID_EVENT_NAME="invalid-event-name",t.INVALID_URL="invalid-url",t.INVALID_DEFAULT_BUCKET="invalid-default-bucket",t.NO_DEFAULT_BUCKET="no-default-bucket",t.CANNOT_SLICE_BLOB="cannot-slice-blob",t.SERVER_FILE_WRONG_SIZE="server-file-wrong-size",t.NO_DOWNLOAD_URL="no-download-url",t.INVALID_ARGUMENT="invalid-argument",t.INVALID_ARGUMENT_COUNT="invalid-argument-count",t.APP_DELETED="app-deleted",t.INVALID_ROOT_OPERATION="invalid-root-operation",t.INVALID_FORMAT="invalid-format",t.INTERNAL_ERROR="internal-error",t.UNSUPPORTED_ENVIRONMENT="unsupported-environment"}(uw||(uw={}));class Dw{constructor(t,e){this.bucket=t,this.path_=e}get path(){return this.path_}get isRoot(){return 0===this.path.length}fullServerUrl(){const t=encodeURIComponent;return"/b/"+t(this.bucket)+"/o/"+t(this.path)}bucketOnlyServerUrl(){return"/b/"+encodeURIComponent(this.bucket)+"/o"}static makeFromBucketSpec(t,e){let n;try{n=Dw.makeFromUrl(t,e)}catch(e){return new Dw(t,"")}if(""===n.path)return n;throw s=t,new lw(uw.INVALID_DEFAULT_BUCKET,"Invalid default bucket '"+s+"'.");var s}static makeFromUrl(t,e){let n=null;const s="([A-Za-z0-9.\\-_]+)";const r=new RegExp("^gs://"+s+"(/(.*))?$","i");function i(t){t.path_=decodeURIComponent(t.path)}const o=e.replace(/[.]/g,"\\."),a=[{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/${s}/o(/([^?#]*).*)?$`,"i"),indices:{bucket:1,path:3},postModify:i},{regex:new RegExp(`^https?://${e===Bw?"(?:storage.googleapis.com|storage.cloud.google.com)":e}/${s}/([^?#]*)`,"i"),indices:{bucket:1,path:2},postModify:i}];for(let e=0;e<a.length;e++){const s=a[e],r=s.regex.exec(t);if(r){const t=r[s.indices.bucket];let e=r[s.indices.path];e||(e=""),n=new Dw(t,e),s.postModify(n);break}}if(null==n)throw function(t){return new lw(uw.INVALID_URL,"Invalid URL '"+t+"'.")}(t);return n}}class _w{constructor(t){this.promise_=Promise.reject(t)}getPromise(){return this.promise_}cancel(t=!1){}}function bw(t){return"string"==typeof t||t instanceof String}function vw(t){return Iw()&&t instanceof Blob}function Iw(){return"undefined"!=typeof Blob}function Tw(t,e,n,s){if(s<e)throw mw(`Invalid value for '${t}'. Expected ${e} or greater.`);if(s>n)throw mw(`Invalid value for '${t}'. Expected ${n} or less.`)}function Ow(t,e,n){let s=e;return null==n&&(s=`https://${e}`),`${n}://${s}/v0${t}`}function Aw(t){const e=encodeURIComponent;let n="?";for(const s in t)if(t.hasOwnProperty(s)){n=n+(e(s)+"="+e(t[s]))+"&"}return n=n.slice(0,-1),n}function Sw(t,e){const n=t>=500&&t<600,s=-1!==[408,429].indexOf(t),r=-1!==e.indexOf(t);return n||s||r}!function(t){t[t.NO_ERROR=0]="NO_ERROR",t[t.NETWORK_ERROR=1]="NETWORK_ERROR",t[t.ABORT=2]="ABORT"}(hw||(hw={}));class Rw{constructor(t,e,n,s,r,i,o,a,B,c,l,u=!0,h=!1){this.url_=t,this.method_=e,this.headers_=n,this.body_=s,this.successCodes_=r,this.additionalRetryCodes_=i,this.callback_=o,this.errorCallback_=a,this.timeout_=B,this.progressCallback_=c,this.connectionFactory_=l,this.retry=u,this.isUsingEmulator=h,this.pendingConnection_=null,this.backoffId_=null,this.canceled_=!1,this.appDelete_=!1,this.promise_=new Promise((t,e)=>{this.resolve_=t,this.reject_=e,this.start_()})}start_(){const t=(t,e)=>{if(e)return void t(!1,new Nw(!1,null,!0));const n=this.connectionFactory_();this.pendingConnection_=n;const s=t=>{const e=t.loaded,n=t.lengthComputable?t.total:-1;null!==this.progressCallback_&&this.progressCallback_(e,n)};null!==this.progressCallback_&&n.addUploadProgressListener(s),n.send(this.url_,this.method_,this.isUsingEmulator,this.body_,this.headers_).then(()=>{null!==this.progressCallback_&&n.removeUploadProgressListener(s),this.pendingConnection_=null;const e=n.getErrorCode()===hw.NO_ERROR,r=n.getStatus();if(!e||Sw(r,this.additionalRetryCodes_)&&this.retry){const e=n.getErrorCode()===hw.ABORT;return void t(!1,new Nw(!1,null,e))}const i=-1!==this.successCodes_.indexOf(r);t(!0,new Nw(i,n))})},e=(t,e)=>{const n=this.resolve_,s=this.reject_,r=e.connection;if(e.wasSuccessCode)try{const t=this.callback_(r,r.getResponse());!function(t){return void 0!==t}(t)?n():n(t)}catch(t){s(t)}else if(null!==r){const t=pw();t.serverResponse=r.getErrorText(),this.errorCallback_?s(this.errorCallback_(r,t)):s(t)}else if(e.canceled){s(this.appDelete_?ww():Cw())}else{s(fw())}};this.canceled_?e(0,new Nw(!1,null,!0)):this.backoffId_=function(t,e,n){let s=1,r=null,i=null,o=!1,a=0;function B(){return 2===a}let c=!1;function l(...t){c||(c=!0,e.apply(null,t))}function u(e){r=setTimeout(()=>{r=null,t(d,B())},e)}function h(){i&&clearTimeout(i)}function d(t,...e){if(c)return void h();if(t)return h(),void l.call(null,t,...e);if(B()||o)return h(),void l.call(null,t,...e);let n;s<64&&(s*=2),1===a?(a=2,n=0):n=1e3*(s+Math.random()),u(n)}let p=!1;function f(t){p||(p=!0,h(),c||(null!==r?(t||(a=2),clearTimeout(r),u(0)):t||(a=1)))}return u(0),i=setTimeout(()=>{o=!0,f(!0)},n),f}(t,e,this.timeout_)}getPromise(){return this.promise_}cancel(t){this.canceled_=!0,this.appDelete_=t||!1,null!==this.backoffId_&&(0,this.backoffId_)(!1),null!==this.pendingConnection_&&this.pendingConnection_.abort()}}class Nw{constructor(t,e,n){this.wasSuccessCode=t,this.connection=e,this.canceled=!!n}}function xw(){return"undefined"!=typeof BlobBuilder?BlobBuilder:"undefined"!=typeof WebKitBlobBuilder?WebKitBlobBuilder:void 0}function kw(...t){const e=xw();if(void 0!==e){const n=new e;for(let e=0;e<t.length;e++)n.append(t[e]);return n.getBlob()}if(Iw())return new Blob(t);throw new lw(uw.UNSUPPORTED_ENVIRONMENT,"This browser doesn't seem to support creating Blobs")}function Lw(t){if("undefined"==typeof atob)throw e="base-64",new lw(uw.UNSUPPORTED_ENVIRONMENT,`${e} is missing. Make sure to install the required polyfills. See https://firebase.google.com/docs/web/environments-js-sdk#polyfills for more information.`);var e;return atob(t)}const Fw="raw",Pw="base64",Mw="base64url",Gw="data_url";class Hw{constructor(t,e){this.data=t,this.contentType=e||null}}function Uw(t,e){switch(t){case Fw:return new Hw(Vw(e));case Pw:case Mw:return new Hw(jw(t,e));case Gw:return new Hw(function(t){const e=new $w(t);return e.base64?jw(Pw,e.rest):function(t){let e;try{e=decodeURIComponent(t)}catch(t){throw yw(Gw,"Malformed data URL.")}return Vw(e)}(e.rest)}(e),new $w(e).contentType)}throw pw()}function Vw(t){const e=[];for(let n=0;n<t.length;n++){let s=t.charCodeAt(n);if(s<=127)e.push(s);else if(s<=2047)e.push(192|s>>6,128|63&s);else if(55296==(64512&s)){if(n<t.length-1&&56320==(64512&t.charCodeAt(n+1))){s=65536|(1023&s)<<10|1023&t.charCodeAt(++n),e.push(240|s>>18,128|s>>12&63,128|s>>6&63,128|63&s)}else e.push(239,191,189)}else 56320==(64512&s)?e.push(239,191,189):e.push(224|s>>12,128|s>>6&63,128|63&s)}return new Uint8Array(e)}function jw(t,e){switch(t){case Pw:{const n=-1!==e.indexOf("-"),s=-1!==e.indexOf("_");if(n||s){throw yw(t,"Invalid character '"+(n?"-":"_")+"' found: is it base64url encoded?")}break}case Mw:{const n=-1!==e.indexOf("+"),s=-1!==e.indexOf("/");if(n||s){throw yw(t,"Invalid character '"+(n?"+":"/")+"' found: is it base64 encoded?")}e=e.replace(/-/g,"+").replace(/_/g,"/");break}}let n;try{n=Lw(e)}catch(e){if(e.message.includes("polyfill"))throw e;throw yw(t,"Invalid character found")}const s=new Uint8Array(n.length);for(let t=0;t<n.length;t++)s[t]=n.charCodeAt(t);return s}class $w{constructor(t){this.base64=!1,this.contentType=null;const e=t.match(/^data:([^,]+)?,/);if(null===e)throw yw(Gw,"Must be formatted 'data:[<mediatype>][;base64],<data>");const n=e[1]||null;null!=n&&(this.base64=function(t,e){const n=t.length>=e.length;if(!n)return!1;return t.substring(t.length-e.length)===e}(n,";base64"),this.contentType=this.base64?n.substring(0,n.length-7):n),this.rest=t.substring(t.indexOf(",")+1)}}class Jw{constructor(t,e){let n=0,s="";vw(t)?(this.data_=t,n=t.size,s=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_=s}size(){return this.size_}type(){return this.type_}slice(t,e){if(vw(this.data_)){const n=function(t,e,n){return t.webkitSlice?t.webkitSlice(e,n):t.mozSlice?t.mozSlice(e,n):t.slice?t.slice(e,n):null}(this.data_,t,e);return null===n?null:new Jw(n)}{const n=new Uint8Array(this.data_.buffer,t,e-t);return new Jw(n,!0)}}static getBlob(...t){if(Iw()){const e=t.map(t=>t instanceof Jw?t.data_:t);return new Jw(kw.apply(null,e))}{const e=t.map(t=>bw(t)?Uw(Fw,t).data:t.data_);let n=0;e.forEach(t=>{n+=t.byteLength});const s=new Uint8Array(n);let r=0;return e.forEach(t=>{for(let e=0;e<t.length;e++)s[r++]=t[e]}),new Jw(s,!0)}}uploadData(){return this.data_}}function qw(t){let e;try{e=JSON.parse(t)}catch(t){return null}return function(t){return"object"==typeof t&&!Array.isArray(t)}(e)?e:null}function zw(t){const e=t.lastIndexOf("/",t.length-2);return-1===e?t:t.slice(e+1)}function Kw(t,e){return e}class Qw{constructor(t,e,n,s){this.server=t,this.local=e||t,this.writable=!!n,this.xform=s||Kw}}let Ww=null;function Yw(){if(Ww)return Ww;const t=[];t.push(new Qw("bucket")),t.push(new Qw("generation")),t.push(new Qw("metageneration")),t.push(new Qw("name","fullPath",!0));const e=new Qw("name");e.xform=function(t,e){return function(t){return!bw(t)||t.length<2?t:zw(t)}(e)},t.push(e);const n=new Qw("size");return n.xform=function(t,e){return void 0!==e?Number(e):e},t.push(n),t.push(new Qw("timeCreated")),t.push(new Qw("updated")),t.push(new Qw("md5Hash",null,!0)),t.push(new Qw("cacheControl",null,!0)),t.push(new Qw("contentDisposition",null,!0)),t.push(new Qw("contentEncoding",null,!0)),t.push(new Qw("contentLanguage",null,!0)),t.push(new Qw("contentType",null,!0)),t.push(new Qw("metadata","customMetadata",!0)),Ww=t,Ww}function Xw(t,e,n){const s={type:"file"},r=n.length;for(let t=0;t<r;t++){const r=n[t];s[r.local]=r.xform(s,e[r.server])}return function(t,e){Object.defineProperty(t,"ref",{get:function(){const n=t.bucket,s=t.fullPath,r=new Dw(n,s);return e._makeStorageReference(r)}})}(s,t),s}function Zw(t,e,n){const s=qw(e);if(null===s)return null;return Xw(t,s,n)}function ty(t,e){const n={},s=e.length;for(let r=0;r<s;r++){const s=e[r];s.writable&&(n[s.server]=t[s.local])}return JSON.stringify(n)}const ey="prefixes",ny="items";function sy(t,e,n){const s=qw(n);if(null===s)return null;return function(t,e,n){const s={prefixes:[],items:[],nextPageToken:n.nextPageToken};if(n[ey])for(const r of n[ey]){const n=r.replace(/\/$/,""),i=t._makeStorageReference(new Dw(e,n));s.prefixes.push(i)}if(n[ny])for(const r of n[ny]){const n=t._makeStorageReference(new Dw(e,r.name));s.items.push(n)}return s}(t,e,s)}class ry{constructor(t,e,n,s){this.url=t,this.method=e,this.handler=n,this.timeout=s,this.urlParams={},this.headers={},this.body=null,this.errorHandler=null,this.progressCallback=null,this.successCodes=[200],this.additionalRetryCodes=[]}}function iy(t){if(!t)throw pw()}function oy(t,e){return function(n,s){const r=Zw(t,s,e);return iy(null!==r),r}}function ay(t,e){return function(n,s){const r=Zw(t,s,e);return iy(null!==r),function(t,e,n,s){const r=qw(e);if(null===r)return null;if(!bw(r.downloadTokens))return null;const i=r.downloadTokens;if(0===i.length)return null;const o=encodeURIComponent;return i.split(",").map(e=>{const r=t.bucket,i=t.fullPath;return Ow("/b/"+o(r)+"/o/"+o(i),n,s)+Aw({alt:"media",token:e})})[0]}(r,s,t.host,t._protocol)}}function By(t){return function(e,n){let s;var r,i;return 401===e.getStatus()?s=e.getErrorText().includes("Firebase App Check token is invalid")?new lw(uw.UNAUTHORIZED_APP,"This app does not have permission to access Firebase Storage on this project."):new lw(uw.UNAUTHENTICATED,"User is not authenticated, please authenticate using Firebase Authentication and try again."):402===e.getStatus()?(i=t.bucket,s=new lw(uw.QUOTA_EXCEEDED,"Quota for bucket '"+i+"' exceeded, please view quota on https://firebase.google.com/pricing/.")):403===e.getStatus()?(r=t.path,s=new lw(uw.UNAUTHORIZED,"User does not have permission to access '"+r+"'.")):s=n,s.status=e.getStatus(),s.serverResponse=n.serverResponse,s}}function cy(t){const e=By(t);return function(n,s){let r=e(n,s);var i;return 404===n.getStatus()&&(i=t.path,r=new lw(uw.OBJECT_NOT_FOUND,"Object '"+i+"' does not exist.")),r.serverResponse=s.serverResponse,r}}function ly(t,e,n,s,r){const i={};e.isRoot?i.prefix="":i.prefix=e.path+"/",n.length>0&&(i.delimiter=n),s&&(i.pageToken=s),r&&(i.maxResults=r);const o=Ow(e.bucketOnlyServerUrl(),t.host,t._protocol),a=t.maxOperationRetryTime,B=new ry(o,"GET",function(t,e){return function(n,s){const r=sy(t,e,s);return iy(null!==r),r}}(t,e.bucket),a);return B.urlParams=i,B.errorHandler=By(e),B}function uy(t,e,n){const s=Object.assign({},n);return s.fullPath=t.path,s.size=e.size(),s.contentType||(s.contentType=function(t,e){return t&&t.contentType||e&&e.type()||"application/octet-stream"}(null,e)),s}class hy{constructor(t,e,n,s){this.current=t,this.total=e,this.finalized=!!n,this.metadata=s||null}}function dy(t,e){let n=null;try{n=t.getResponseHeader("X-Goog-Upload-Status")}catch(t){iy(!1)}return iy(!!n&&-1!==(e||["active"]).indexOf(n)),n}const py=262144;function fy(t,e,n,s,r,i,o,a){const B=new hy(0,0);if(o?(B.current=o.current,B.total=o.total):(B.current=0,B.total=s.size()),s.size()!==B.total)throw new lw(uw.SERVER_FILE_WRONG_SIZE,"Server recorded incorrect upload file size, please retry the upload.");const c=B.total-B.current;let l=c;r>0&&(l=Math.min(l,r));const u=B.current,h=u+l;let d="";d=0===l?"finalize":c===l?"upload, finalize":"upload";const p={"X-Goog-Upload-Command":d,"X-Goog-Upload-Offset":`${B.current}`},f=s.slice(u,h);if(null===f)throw gw();const C=e.maxUploadRetryTime,g=new ry(n,"POST",function(t,n){const r=dy(t,["active","final"]),o=B.current+l,a=s.size();let c;return c="final"===r?oy(e,i)(t,n):null,new hy(o,a,"final"===r,c)},C);return g.headers=p,g.body=f.uploadData(),g.progressCallback=a||null,g.errorHandler=By(t),g}const Cy="running",gy="paused",my="success",wy="canceled",yy="error";function Ey(t){switch(t){case"running":case"pausing":case"canceling":return Cy;case"paused":return gy;case"success":return my;case"canceled":return wy;default:return yy}}class Dy{constructor(t,e,n){const s=function(t){return"function"==typeof t}(t)||null!=e||null!=n;if(s)this.next=t,this.error=e??void 0,this.complete=n??void 0;else{const e=t;this.next=e.next,this.error=e.error,this.complete=e.complete}}}function _y(t){return(...e)=>{Promise.resolve().then(()=>t(...e))}}class by{constructor(){this.sent_=!1,this.xhr_=new XMLHttpRequest,this.initXhr(),this.errorCode_=hw.NO_ERROR,this.sendPromise_=new Promise(t=>{this.xhr_.addEventListener("abort",()=>{this.errorCode_=hw.ABORT,t()}),this.xhr_.addEventListener("error",()=>{this.errorCode_=hw.NETWORK_ERROR,t()}),this.xhr_.addEventListener("load",()=>{t()})})}send(t,e,n,s,r){if(this.sent_)throw Ew("cannot .send() more than once");if(Zn(t)&&n&&(this.xhr_.withCredentials=!0),this.sent_=!0,this.xhr_.open(e,t,!0),void 0!==r)for(const t in r)r.hasOwnProperty(t)&&this.xhr_.setRequestHeader(t,r[t].toString());return void 0!==s?this.xhr_.send(s):this.xhr_.send(),this.sendPromise_}getErrorCode(){if(!this.sent_)throw Ew("cannot .getErrorCode() before sending");return this.errorCode_}getStatus(){if(!this.sent_)throw Ew("cannot .getStatus() before sending");try{return this.xhr_.status}catch(t){return-1}}getResponse(){if(!this.sent_)throw Ew("cannot .getResponse() before sending");return this.xhr_.response}getErrorText(){if(!this.sent_)throw Ew("cannot .getErrorText() before sending");return this.xhr_.statusText}abort(){this.xhr_.abort()}getResponseHeader(t){return this.xhr_.getResponseHeader(t)}addUploadProgressListener(t){null!=this.xhr_.upload&&this.xhr_.upload.addEventListener("progress",t)}removeUploadProgressListener(t){null!=this.xhr_.upload&&this.xhr_.upload.removeEventListener("progress",t)}}class vy extends by{initXhr(){this.xhr_.responseType="text"}}function Iy(){return new vy}class Ty{isExponentialBackoffExpired(){return this.sleepTime>this.maxSleepTime}constructor(t,e,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=Yw(),this._resumable=this._shouldDoResumable(this._blob),this._state="running",this._errorHandler=t=>{if(this._request=void 0,this._chunkMultiplier=1,t._codeEquals(uw.CANCELED))this._needToFetchStatus=!0,this.completeTransitions_();else{const e=this.isExponentialBackoffExpired();if(Sw(t.status,[])){if(!e)return this.sleepTime=Math.max(2*this.sleepTime,1e3),this._needToFetchStatus=!0,void this.completeTransitions_();t=fw()}this._error=t,this._transition("error")}},this._metadataErrorHandler=t=>{this._request=void 0,t._codeEquals(uw.CANCELED)?this.completeTransitions_():(this._error=t,this._transition("error"))},this.sleepTime=0,this.maxSleepTime=this._ref.storage.maxUploadRetryTime,this._promise=new Promise((t,e)=>{this._resolve=t,this._reject=e,this._start()}),this._promise.then(null,()=>{})}_makeProgressCallback(){const t=this._transferred;return e=>this._updateProgress(t+e)}_shouldDoResumable(t){return t.size()>262144}_start(){"running"===this._state&&void 0===this._request&&(this._resumable?void 0===this._uploadUrl?this._createResumable():this._needToFetchStatus?this._fetchStatus():this._needToFetchMetadata?this._fetchMetadata():this.pendingTimeout=setTimeout(()=>{this.pendingTimeout=void 0,this._continueUpload()},this.sleepTime):this._oneShotUpload())}_resolveToken(t){Promise.all([this._ref.storage._getAuthToken(),this._ref.storage._getAppCheckToken()]).then(([e,n])=>{switch(this._state){case"running":t(e,n);break;case"canceling":this._transition("canceled");break;case"pausing":this._transition("paused")}})}_createResumable(){this._resolveToken((t,e)=>{const n=function(t,e,n,s,r){const i=e.bucketOnlyServerUrl(),o=uy(e,s,r),a={name:o.fullPath},B=Ow(i,t.host,t._protocol),c={"X-Goog-Upload-Protocol":"resumable","X-Goog-Upload-Command":"start","X-Goog-Upload-Header-Content-Length":`${s.size()}`,"X-Goog-Upload-Header-Content-Type":o.contentType,"Content-Type":"application/json; charset=utf-8"},l=ty(o,n),u=t.maxUploadRetryTime,h=new ry(B,"POST",function(t){let e;dy(t);try{e=t.getResponseHeader("X-Goog-Upload-URL")}catch(t){iy(!1)}return iy(bw(e)),e},u);return h.urlParams=a,h.headers=c,h.body=l,h.errorHandler=By(e),h}(this._ref.storage,this._ref._location,this._mappings,this._blob,this._metadata),s=this._ref.storage._makeRequest(n,Iy,t,e);this._request=s,s.getPromise().then(t=>{this._request=void 0,this._uploadUrl=t,this._needToFetchStatus=!1,this.completeTransitions_()},this._errorHandler)})}_fetchStatus(){const t=this._uploadUrl;this._resolveToken((e,n)=>{const s=function(t,e,n,s){const r=t.maxUploadRetryTime,i=new ry(n,"POST",function(t){const e=dy(t,["active","final"]);let n=null;try{n=t.getResponseHeader("X-Goog-Upload-Size-Received")}catch(t){iy(!1)}n||iy(!1);const r=Number(n);return iy(!isNaN(r)),new hy(r,s.size(),"final"===e)},r);return i.headers={"X-Goog-Upload-Command":"query"},i.errorHandler=By(e),i}(this._ref.storage,this._ref._location,t,this._blob),r=this._ref.storage._makeRequest(s,Iy,e,n);this._request=r,r.getPromise().then(t=>{this._request=void 0,this._updateProgress(t.current),this._needToFetchStatus=!1,t.finalized&&(this._needToFetchMetadata=!0),this.completeTransitions_()},this._errorHandler)})}_continueUpload(){const t=py*this._chunkMultiplier,e=new hy(this._transferred,this._blob.size()),n=this._uploadUrl;this._resolveToken((s,r)=>{let i;try{i=fy(this._ref._location,this._ref.storage,n,this._blob,t,this._mappings,e,this._makeProgressCallback())}catch(t){return this._error=t,void this._transition("error")}const o=this._ref.storage._makeRequest(i,Iy,s,r,!1);this._request=o,o.getPromise().then(t=>{this._increaseMultiplier(),this._request=void 0,this._updateProgress(t.current),t.finalized?(this._metadata=t.metadata,this._transition("success")):this.completeTransitions_()},this._errorHandler)})}_increaseMultiplier(){2*(py*this._chunkMultiplier)<33554432&&(this._chunkMultiplier*=2)}_fetchMetadata(){this._resolveToken((t,e)=>{const n=function(t,e,n){const s=Ow(e.fullServerUrl(),t.host,t._protocol),r=t.maxOperationRetryTime,i=new ry(s,"GET",oy(t,n),r);return i.errorHandler=cy(e),i}(this._ref.storage,this._ref._location,this._mappings),s=this._ref.storage._makeRequest(n,Iy,t,e);this._request=s,s.getPromise().then(t=>{this._request=void 0,this._metadata=t,this._transition("success")},this._metadataErrorHandler)})}_oneShotUpload(){this._resolveToken((t,e)=>{const n=function(t,e,n,s,r){const i=e.bucketOnlyServerUrl(),o={"X-Goog-Upload-Protocol":"multipart"},a=function(){let t="";for(let e=0;e<2;e++)t+=Math.random().toString().slice(2);return t}();o["Content-Type"]="multipart/related; boundary="+a;const B=uy(e,s,r),c="--"+a+"\r\nContent-Type: application/json; charset=utf-8\r\n\r\n"+ty(B,n)+"\r\n--"+a+"\r\nContent-Type: "+B.contentType+"\r\n\r\n",l="\r\n--"+a+"--",u=Jw.getBlob(c,s,l);if(null===u)throw gw();const h={name:B.fullPath},d=Ow(i,t.host,t._protocol),p=t.maxUploadRetryTime,f=new ry(d,"POST",oy(t,n),p);return f.urlParams=h,f.headers=o,f.body=u.uploadData(),f.errorHandler=By(e),f}(this._ref.storage,this._ref._location,this._mappings,this._blob,this._metadata),s=this._ref.storage._makeRequest(n,Iy,t,e);this._request=s,s.getPromise().then(t=>{this._request=void 0,this._metadata=t,this._updateProgress(this._blob.size()),this._transition("success")},this._errorHandler)})}_updateProgress(t){const e=this._transferred;this._transferred=t,this._transferred!==e&&this._notifyObservers()}_transition(t){if(this._state!==t)switch(t){case"canceling":case"pausing":this._state=t,void 0!==this._request?this._request.cancel():this.pendingTimeout&&(clearTimeout(this.pendingTimeout),this.pendingTimeout=void 0,this.completeTransitions_());break;case"running":const e="paused"===this._state;this._state=t,e&&(this._notifyObservers(),this._start());break;case"paused":case"error":case"success":this._state=t,this._notifyObservers();break;case"canceled":this._error=Cw(),this._state=t,this._notifyObservers()}}completeTransitions_(){switch(this._state){case"pausing":this._transition("paused");break;case"canceling":this._transition("canceled");break;case"running":this._start()}}get snapshot(){const t=Ey(this._state);return{bytesTransferred:this._transferred,totalBytes:this._blob.size(),state:t,metadata:this._metadata,task:this,ref:this._ref}}on(t,e,n,s){const r=new Dy(e||void 0,n||void 0,s||void 0);return this._addObserver(r),()=>{this._removeObserver(r)}}then(t,e){return this._promise.then(t,e)}catch(t){return this.then(null,t)}_addObserver(t){this._observers.push(t),this._notifyObserver(t)}_removeObserver(t){const e=this._observers.indexOf(t);-1!==e&&this._observers.splice(e,1)}_notifyObservers(){this._finishPromise();this._observers.slice().forEach(t=>{this._notifyObserver(t)})}_finishPromise(){if(void 0!==this._resolve){let t=!0;switch(Ey(this._state)){case my:_y(this._resolve.bind(null,this.snapshot))();break;case wy:case yy:_y(this._reject.bind(null,this._error))();break;default:t=!1}t&&(this._resolve=void 0,this._reject=void 0)}}_notifyObserver(t){switch(Ey(this._state)){case Cy:case gy:t.next&&_y(t.next.bind(t,this.snapshot))();break;case my:t.complete&&_y(t.complete.bind(t))();break;default:t.error&&_y(t.error.bind(t,this._error))()}}resume(){const t="paused"===this._state||"pausing"===this._state;return t&&this._transition("running"),t}pause(){const t="running"===this._state;return t&&this._transition("pausing"),t}cancel(){const t="running"===this._state||"pausing"===this._state;return t&&this._transition("canceling"),t}}class Oy{constructor(t,e){this._service=t,this._location=e instanceof Dw?e:Dw.makeFromUrl(e,t.host)}toString(){return"gs://"+this._location.bucket+"/"+this._location.path}_newRef(t,e){return new Oy(t,e)}get root(){const t=new Dw(this._location.bucket,"");return this._newRef(this._service,t)}get bucket(){return this._location.bucket}get fullPath(){return this._location.path}get name(){return zw(this._location.path)}get storage(){return this._service}get parent(){const t=function(t){if(0===t.length)return null;const e=t.lastIndexOf("/");return-1===e?"":t.slice(0,e)}(this._location.path);if(null===t)return null;const e=new Dw(this._location.bucket,t);return new Oy(this._service,e)}_throwIfRoot(t){if(""===this._location.path)throw function(t){return new lw(uw.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').")}(t)}}function Ay(t){const e={prefixes:[],items:[]};return Sy(t,e).then(()=>e)}async function Sy(t,e,n){const s={pageToken:n},r=await function(t,e){null!=e&&"number"==typeof e.maxResults&&Tw("options.maxResults",1,1e3,e.maxResults);const n=e||{},s=ly(t.storage,t._location,"/",n.pageToken,n.maxResults);return t.storage.makeRequestWithTokens(s,Iy)}(t,s);e.prefixes.push(...r.prefixes),e.items.push(...r.items),null!=r.nextPageToken&&await Sy(t,e,r.nextPageToken)}function Ry(t){t._throwIfRoot("getDownloadURL");const e=function(t,e,n){const s=Ow(e.fullServerUrl(),t.host,t._protocol),r=t.maxOperationRetryTime,i=new ry(s,"GET",ay(t,n),r);return i.errorHandler=cy(e),i}(t.storage,t._location,Yw());return t.storage.makeRequestWithTokens(e,Iy).then(t=>{if(null===t)throw new lw(uw.NO_DOWNLOAD_URL,"The given file does not have any download URLs.");return t})}function Ny(t){t._throwIfRoot("deleteObject");const e=function(t,e){const n=Ow(e.fullServerUrl(),t.host,t._protocol),s=t.maxOperationRetryTime,r=new ry(n,"DELETE",function(t,e){},s);return r.successCodes=[200,204],r.errorHandler=cy(e),r}(t.storage,t._location);return t.storage.makeRequestWithTokens(e,Iy)}function xy(t,e){if(t instanceof Fy){const n=t;if(null==n._bucket)throw new lw(uw.NO_DEFAULT_BUCKET,"No default bucket found. Did you set the '"+cw+"' property when initializing the app?");const s=new Oy(n,n._bucket);return null!=e?xy(s,e):s}return void 0!==e?function(t,e){const n=function(t,e){const n=e.split("/").filter(t=>t.length>0).join("/");return 0===t.length?n:t+"/"+n}(t._location.path,e),s=new Dw(t._location.bucket,n);return new Oy(t.storage,s)}(t,e):t}function ky(t,e){if(e&&/^[A-Za-z]+:\/\//.test(e)){if(t instanceof Fy)return new Oy(t,e);throw mw("To use ref(service, url), the first argument must be a Storage instance.")}return xy(t,e)}function Ly(t,e){const n=e?.[cw];return null==n?null:Dw.makeFromBucketSpec(n,t)}class Fy{constructor(t,e,n,s,r,i=!1){this.app=t,this._authProvider=e,this._appCheckProvider=n,this._url=s,this._firebaseVersion=r,this._isUsingEmulator=i,this._bucket=null,this._host=Bw,this._protocol="https",this._appId=null,this._deleted=!1,this._maxOperationRetryTime=12e4,this._maxUploadRetryTime=6e5,this._requests=new Set,this._bucket=null!=s?Dw.makeFromBucketSpec(s,this._host):Ly(this._host,this.app.options)}get host(){return this._host}set host(t){this._host=t,null!=this._url?this._bucket=Dw.makeFromBucketSpec(this._url,t):this._bucket=Ly(t,this.app.options)}get maxUploadRetryTime(){return this._maxUploadRetryTime}set maxUploadRetryTime(t){Tw("time",0,Number.POSITIVE_INFINITY,t),this._maxUploadRetryTime=t}get maxOperationRetryTime(){return this._maxOperationRetryTime}set maxOperationRetryTime(t){Tw("time",0,Number.POSITIVE_INFINITY,t),this._maxOperationRetryTime=t}async _getAuthToken(){if(this._overrideAuthToken)return this._overrideAuthToken;const t=this._authProvider.getImmediate({optional:!0});if(t){const e=await t.getToken();if(null!==e)return e.accessToken}return null}async _getAppCheckToken(){if(hr(this.app)&&this.app.settings.appCheckToken)return this.app.settings.appCheckToken;const t=this._appCheckProvider.getImmediate({optional:!0});if(t){return(await t.getToken()).token}return null}_delete(){return this._deleted||(this._deleted=!0,this._requests.forEach(t=>t.cancel()),this._requests.clear()),Promise.resolve()}_makeStorageReference(t){return new Oy(this,t)}_makeRequest(t,e,n,s,r=!0){if(this._deleted)return new _w(ww());{const i=function(t,e,n,s,r,i,o=!0,a=!1){const B=Aw(t.urlParams),c=t.url+B,l=Object.assign({},t.headers);return function(t,e){e&&(t["X-Firebase-GMPID"]=e)}(l,e),function(t,e){null!==e&&e.length>0&&(t.Authorization="Firebase "+e)}(l,n),function(t,e){t["X-Firebase-Storage-Version"]="webjs/"+(e??"AppManager")}(l,i),function(t,e){null!==e&&(t["X-Firebase-AppCheck"]=e)}(l,s),new Rw(c,t.method,l,t.body,t.successCodes,t.additionalRetryCodes,t.handler,t.errorHandler,t.timeout,t.progressCallback,r,o,a)}(t,this._appId,n,s,e,this._firebaseVersion,r,this._isUsingEmulator);return this._requests.add(i),i.getPromise().then(()=>this._requests.delete(i),()=>this._requests.delete(i)),i}}async makeRequestWithTokens(t,e){const[n,s]=await Promise.all([this._getAuthToken(),this._getAppCheckToken()]);return this._makeRequest(t,e,n,s).getPromise()}}const Py="@firebase/storage",My="0.14.5",Gy="storage";function Hy(t,e,n){return function(t,e,n){return t._throwIfRoot("uploadBytesResumable"),new Ty(t,new Jw(e),n)}(t=Xn(t),e,n)}function Uy(t){return Ay(t=Xn(t))}function Vy(t){return Ny(t=Xn(t))}function jy(t,e){return ky(t=Xn(t),e)}function $y(t=gr(),e){const n=ur(t=Xn(t),Gy).getImmediate({identifier:e}),s=Rn("storage");return s&&function(t,e,n,s={}){!function(t,e,n,s={}){t.host=`${e}:${n}`;const r=Zn(e);r&&ts(`https://${t.host}/b`),t._isUsingEmulator=!0,t._protocol=r?"https":"http";const{mockUserToken:i}=s;i&&(t._overrideAuthToken="string"==typeof i?i:Ln(i,t.app.options.projectId))}(t,e,n,s)}(n,...s),n}function Jy(t,{instanceIdentifier:e}){const n=t.getProvider("app").getImmediate(),s=t.getProvider("auth-internal"),r=t.getProvider("app-check-internal");return new Fy(n,s,r,e,fr)}lr(new es(Gy,Jy,"PUBLIC").setMultipleInstances(!0)),mr(Py,My,""),mr(Py,My,"esm2020");let qy,zy,Ky,Qy,Wy={},Yy=null,Xy=!1;const Zy=[];let tE;function eE(){return tE}function nE(){return Xy}function sE(t){Xy?t():Zy.push(t)}function rE(){const t="undefined"==typeof process?void 0:process.env,e=t?.FIREBASE_CONFIG;if(!e)return null;const n=JSON.parse(e);return n&&n.apiKey?n:null}function iE(t){if(t&&Object.prototype.hasOwnProperty.call(t,"actionCodeSettings")&&(tE=t.actionCodeSettings),Xy){if(t?.app&&t.app!==qy)throw new Error("pwa-auth: Firebase app is already set");return qy}if(t?.app)qy=t.app,Wy=qy.options;else{const e=t?.config??rE();if(!e)throw new Error("pwa-auth: pass initialize({ config }) or set window.process.env.FIREBASE_CONFIG");Wy=e,qy=Cr(Wy)}return zy=function(t){const e="object"==typeof t?t:gr(),n="string"==typeof t?t:Yl,s=ur(e,"firestore").getImmediate({identifier:n});if(!s._initialized){const t=Rn("firestore");t&&Ap(s,...t)}return s}(qy),Ky=$y(qy),Qy=Ka(qy),Yy=Qy.currentUser,Xy=!0,Zy.splice(0).forEach(t=>t()),qy}const oE=rE();oE&&iE({config:oE});const aE={bubbles:!0,composed:!0};function BE(t){return t?{uid:t.uid,displayName:t.displayName,email:t.email,photoURL:t.photoURL,emailVerified:!0===t.emailVerified}:null}function cE(t,e){window.dispatchEvent(new CustomEvent(t,{...aE,detail:e}))}function lE(t){if("object"==typeof t&&null!==t&&"code"in t){const e=String(t.code);return{code:e,message:t instanceof Error?t.message:e}}return{code:"pwa/unknown",message:t instanceof Error?t.message:"Authentication failed"}}const uE=new Set(["auth/popup-closed-by-user","auth/cancelled-popup-request","auth/user-cancelled"]);let hE=null,dE=!1;function pE(){const t=hE;return hE=null,t}function fE(){return new go}async function CE(t){if(function(t){return/Android|iPhone|iPad|iPod/i.test(t)}("undefined"==typeof navigator?"":navigator.userAgent))return await Ca(Qy,fE()),"redirect";try{return await async function(t,e,n){if(hr(t.app))return Promise.reject(Fr(t,"operation-not-supported-in-this-environment"));const s=ji(t);Gr(t,e,po);const r=sa(s,n);return new la(s,"signInViaPopup",e,r).executeNotNull()}(Qy,fE()),"ok"}catch(t){const e=lE(t).code;if(uE.has(e))return"quiet";if("auth/popup-blocked"===e)return await Ca(Qy,fE()),"redirect";throw t}}function gE(){dE||(dE=!0,sE(()=>{(async function(t,e){return await ji(t)._initializationPromise,ga(t,e,!1)})(Qy).catch(t=>{!function(t){hE=lE(t)}(t)})}))}const mE="pwa-auth-changed",wE="pwa-login",yE="pwa-logout",EE="pwa-signup",DE="pwa-account-deleted",_E="pwa-profile-updated",bE="pwa-email-changed",vE="pwa-password-changed",IE="pwa-reset-sent",TE="pwa-drawer-toggle",OE="pwa-settings",AE="pwa-auth-error",SE="pwa-verification-sent",RE="pwa-email-verified",NE={authChanged:mE,login:wE,logout:yE,signup:EE,accountDeleted:DE,profileUpdated:_E,emailChanged:bE,passwordChanged:vE,resetSent:IE,drawerToggle:TE,settings:OE,authError:AE,verificationSent:SE,emailVerified:RE},xE=128,kE="At least 8 characters. A passphrase works well.",LE="Use at least 8 characters.",FE="Use at most 128 characters.",PE="Passwords don't match.";function ME(t){return t.length<8?{code:"pwa/short-password",message:LE}:t.length>xE?{code:"pwa/long-password",message:FE}:null}const GE={"auth/invalid-email":"Enter a valid email address.","auth/user-not-found":"No account uses that email.","auth/wrong-password":"That password is wrong.","auth/invalid-credential":"That email or password is wrong.","auth/invalid-login-credentials":"That email or password is wrong.","auth/user-token-expired":"This account is no longer available.","auth/invalid-user-token":"This account is no longer available.","auth/user-disabled":"This account is disabled.","auth/email-already-in-use":"An account already uses that email.","auth/account-exists-with-different-credential":"That email already has an account. Sign in with email and password.","auth/weak-password":LE,"auth/too-many-requests":"Too many tries. Wait and try again.","auth/network-request-failed":"Network problem. Try again.","auth/requires-recent-login":"Sign in again, then retry.","pwa/missing-email":"Enter an email address.","pwa/invalid-email":"Enter a valid email address.","pwa/missing-password":"Enter a password.","pwa/short-password":LE,"pwa/long-password":FE,"pwa/current-password":"Enter your current password.","pwa/password-mismatch":PE,"pwa/weak-password":LE,"pwa/signed-out":"Sign in first.","pwa/missing-file":"Choose a photo first.","pwa/not-image":"Choose an image file.","pwa/photo-too-large":"Choose an image under 5 MB.","pwa/photo-unreadable":"That image could not be prepared. Try another.","pwa/not-ready":"Sign-in is not ready yet.","pwa/unknown":"Something went wrong. Try again."};function HE(t){const e=lE(t);return GE[e.code]??"Something went wrong. Try again."}const UE=i`
199
+ `,Dn=function(t){const e=[];let n=0;for(let s=0;s<t.length;s++){let r=t.charCodeAt(s);r<128?e[n++]=r:r<2048?(e[n++]=r>>6|192,e[n++]=63&r|128):55296==(64512&r)&&s+1<t.length&&56320==(64512&t.charCodeAt(s+1))?(r=65536+((1023&r)<<10)+(1023&t.charCodeAt(++s)),e[n++]=r>>18|240,e[n++]=r>>12&63|128,e[n++]=r>>6&63|128,e[n++]=63&r|128):(e[n++]=r>>12|224,e[n++]=r>>6&63|128,e[n++]=63&r|128)}return e},bn={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(t,e){if(!Array.isArray(t))throw Error("encodeByteArray takes an array as a parameter");this.init_();const n=e?this.byteToCharMapWebSafe_:this.byteToCharMap_,s=[];for(let e=0;e<t.length;e+=3){const r=t[e],i=e+1<t.length,o=i?t[e+1]:0,a=e+2<t.length,B=a?t[e+2]:0,c=r>>2,l=(3&r)<<4|o>>4;let u=(15&o)<<2|B>>6,h=63&B;a||(h=64,i||(u=64)),s.push(n[c],n[l],n[u],n[h])}return s.join("")},encodeString(t,e){return this.HAS_NATIVE_SUPPORT&&!e?btoa(t):this.encodeByteArray(Dn(t),e)},decodeString(t,e){return this.HAS_NATIVE_SUPPORT&&!e?atob(t):function(t){const e=[];let n=0,s=0;for(;n<t.length;){const r=t[n++];if(r<128)e[s++]=String.fromCharCode(r);else if(r>191&&r<224){const i=t[n++];e[s++]=String.fromCharCode((31&r)<<6|63&i)}else if(r>239&&r<365){const i=((7&r)<<18|(63&t[n++])<<12|(63&t[n++])<<6|63&t[n++])-65536;e[s++]=String.fromCharCode(55296+(i>>10)),e[s++]=String.fromCharCode(56320+(1023&i))}else{const i=t[n++],o=t[n++];e[s++]=String.fromCharCode((15&r)<<12|(63&i)<<6|63&o)}}return e.join("")}(this.decodeStringToByteArray(t,e))},decodeStringToByteArray(t,e){this.init_();const n=e?this.charToByteMapWebSafe_:this.charToByteMap_,s=[];for(let e=0;e<t.length;){const r=n[t.charAt(e++)],i=e<t.length?n[t.charAt(e)]:0;++e;const o=e<t.length?n[t.charAt(e)]:64;++e;const a=e<t.length?n[t.charAt(e)]:64;if(++e,null==r||null==i||null==o||null==a)throw new vn;const B=r<<2|i>>4;if(s.push(B),64!==o){const t=i<<4&240|o>>2;if(s.push(t),64!==a){const t=o<<6&192|a;s.push(t)}}}return s},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let 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)}}};class vn extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}}const In=function(t){return function(t){const e=Dn(t);return bn.encodeByteArray(e,!0)}(t).replace(/\./g,"")},Tn=function(t){try{return bn.decodeString(t,!0)}catch(t){}return null};const On=()=>function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if("undefined"!=typeof global)return global;throw new Error("Unable to locate global object.")}().__FIREBASE_DEFAULTS__,An=()=>{try{return On()||(()=>{if("undefined"==typeof process||void 0===process.env)return;const t=process.env.__FIREBASE_DEFAULTS__;return t?JSON.parse(t):void 0})()||(()=>{if("undefined"==typeof document)return;let t;try{t=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch(t){return}const e=t&&Tn(t[1]);return e&&JSON.parse(e)})()}catch(t){return}},Sn=t=>An()?.emulatorHosts?.[t],Rn=t=>{const e=Sn(t);if(!e)return;const n=e.lastIndexOf(":");if(n<=0||n+1===e.length)throw new Error(`Invalid host ${e} with no separate hostname and port!`);const s=parseInt(e.substring(n+1),10);return"["===e[0]?[e.substring(1,n-1),s]:[e.substring(0,n),s]},Nn=()=>An()?.config,xn=t=>An()?.[`_${t}`];class kn{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise((t,e)=>{this.resolve=t,this.reject=e})}wrapCallback(t){return(e,n)=>{e?this.reject(e):this.resolve(n),"function"==typeof t&&(this.promise.catch(()=>{}),1===t.length?t(e):t(e,n))}}}function Ln(t,e){if(t.uid)throw new Error('The "uid" field is no longer supported by mockUserToken. Please use "sub" instead for Firebase Auth User ID.');const n=e||"demo-project",s=t.iat||0,r=t.sub||t.user_id;if(!r)throw new Error("mockUserToken must contain 'sub' or 'user_id' field!");const i={iss:`https://securetoken.google.com/${n}`,aud:n,iat:s,exp:s+3600,auth_time:s,sub:r,user_id:r,firebase:{sign_in_provider:"custom",identities:{}},...t};return[In(JSON.stringify({alg:"none",type:"JWT"})),In(JSON.stringify(i)),""].join(".")}function Fn(){return"undefined"!=typeof navigator&&"string"==typeof navigator.userAgent?navigator.userAgent:""}function Pn(){const t="object"==typeof chrome?chrome.runtime:"object"==typeof browser?browser.runtime:void 0;return"object"==typeof t&&void 0!==t.id}function Mn(){return!function(){const t=An()?.forceEnvironment;if("node"===t)return!0;if("browser"===t)return!1;try{return"[object process]"===Object.prototype.toString.call(global.process)}catch(t){return!1}}()&&!!navigator.userAgent&&navigator.userAgent.includes("Safari")&&!navigator.userAgent.includes("Chrome")}function Gn(){try{return"object"==typeof indexedDB}catch(t){return!1}}function Hn(){return new Promise((t,e)=>{try{let n=!0;const s="validate-browser-context-for-indexeddb-analytics-module",r=self.indexedDB.open(s);r.onsuccess=()=>{r.result.close(),n||self.indexedDB.deleteDatabase(s),t(!0)},r.onupgradeneeded=()=>{n=!1},r.onerror=()=>{e(r.error?.message||"")}}catch(t){e(t)}})}function Un(){return!("undefined"==typeof navigator||!navigator.cookieEnabled)}class Vn extends Error{constructor(t,e,n){super(e),this.code=t,this.customData=n,this.name="FirebaseError",Object.setPrototypeOf(this,Vn.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,jn.prototype.create)}}class jn{constructor(t,e,n){this.service=t,this.serviceName=e,this.errors=n}create(t,...e){const n=e[0]||{},s=`${this.service}/${t}`,r=this.errors[t],i=r?function(t,e){try{let n=0,s="";for(;n<t.length;){const r=t.indexOf("{$",n);if(-1===r){s+=t.substring(n);break}const i=t.indexOf("}",r+2);if(-1===i){s+=t.substring(n);break}const o=t.substring(r+2,i),a=e[o];s+=t.substring(n,r)+(null!=a?String(a):`<${o}?>`),n=i+1}return s}catch(e){return t}}(r,n):"Error",o=`${this.serviceName}: ${i} (${s}).`;return new Vn(s,o,n)}}function $n(t,e){if(t===e)return!0;const n=Object.keys(t),s=Object.keys(e);for(const r of n){if(!s.includes(r))return!1;const n=t[r],i=e[r];if(Jn(n)&&Jn(i)){if(!$n(n,i))return!1}else if(n!==i)return!1}for(const t of s)if(!n.includes(t))return!1;return!0}function Jn(t){return null!==t&&"object"==typeof t}function qn(t){const e=[];for(const[n,s]of Object.entries(t))Array.isArray(s)?s.forEach(t=>{e.push(encodeURIComponent(n)+"="+encodeURIComponent(t))}):e.push(encodeURIComponent(n)+"="+encodeURIComponent(s));return e.length?"&"+e.join("&"):""}function zn(t){const e={};return t.replace(/^\?/,"").split("&").forEach(t=>{if(t){const[n,s]=t.split("=");e[decodeURIComponent(n)]=decodeURIComponent(s)}}),e}function Kn(t){const e=t.indexOf("?");if(!e)return"";const n=t.indexOf("#",e);return t.substring(e,n>0?n:void 0)}class Qn{constructor(t,e){this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=e,this.task.then(()=>{t(this)}).catch(t=>{this.error(t)})}next(t){this.forEachObserver(e=>{e.next(t)})}error(t){this.forEachObserver(e=>{e.error(t)}),this.close(t)}complete(){this.forEachObserver(t=>{t.complete()}),this.close()}subscribe(t,e,n){let s;if(void 0===t&&void 0===e&&void 0===n)throw new Error("Missing Observer.");s=function(t,e){if("object"!=typeof t||null===t)return!1;for(const n of e)if(n in t&&"function"==typeof t[n])return!0;return!1}(t,["next","error","complete"])?t:{next:t,error:e,complete:n},void 0===s.next&&(s.next=Wn),void 0===s.error&&(s.error=Wn),void 0===s.complete&&(s.complete=Wn);const r=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then(()=>{try{this.finalError?s.error(this.finalError):s.complete()}catch(t){}}),this.observers.push(s),r}unsubscribeOne(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))}forEachObserver(t){if(!this.finalized)for(let e=0;e<this.observers.length;e++)this.sendOne(e,t)}sendOne(t,e){this.task.then(()=>{if(void 0!==this.observers&&void 0!==this.observers[t])try{e(this.observers[t])}catch(t){"undefined"!=typeof console&&console.error}})}close(t){this.finalized||(this.finalized=!0,void 0!==t&&(this.finalError=t),this.task.then(()=>{this.observers=void 0,this.onNoObservers=void 0}))}}function Wn(){}function Yn(t,e=1e3,n=2){const s=e*Math.pow(n,t),r=Math.round(.5*s*(Math.random()-.5)*2);return Math.min(144e5,s+r)}function Xn(t){return t&&t._delegate?t._delegate:t}function Zn(t){try{return(t.startsWith("http://")||t.startsWith("https://")?new URL(t).hostname:t).endsWith(".cloudworkstations.dev")}catch{return!1}}async function ts(t){return(await fetch(t,{credentials:"include"})).ok}class es{constructor(t,e,n){this.name=t,this.instanceFactory=e,this.type=n,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}setInstantiationMode(t){return this.instantiationMode=t,this}setMultipleInstances(t){return this.multipleInstances=t,this}setServiceProps(t){return this.serviceProps=t,this}setInstanceCreatedCallback(t){return this.onInstanceCreated=t,this}}const ns="[DEFAULT]";class ss{constructor(t,e){this.name=t,this.container=e,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}get(t){const e=this.normalizeInstanceIdentifier(t);if(!this.instancesDeferred.has(e)){const t=new kn;if(this.instancesDeferred.set(e,t),this.isInitialized(e)||this.shouldAutoInitialize())try{const n=this.getOrInitializeService({instanceIdentifier:e});n&&t.resolve(n)}catch(t){}}return this.instancesDeferred.get(e).promise}getImmediate(t){const e=this.normalizeInstanceIdentifier(t?.identifier),n=t?.optional??!1;if(!this.isInitialized(e)&&!this.shouldAutoInitialize()){if(n)return null;throw Error(`Service ${this.name} is not available`)}try{return this.getOrInitializeService({instanceIdentifier:e})}catch(t){if(n)return null;throw t}}getComponent(){return this.component}setComponent(t){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,this.shouldAutoInitialize()){if(function(t){return"EAGER"===t.instantiationMode}(t))try{this.getOrInitializeService({instanceIdentifier:ns})}catch(t){}for(const[t,e]of this.instancesDeferred.entries()){const n=this.normalizeInstanceIdentifier(t);try{const t=this.getOrInitializeService({instanceIdentifier:n});e.resolve(t)}catch(t){}}}}clearInstance(t=ns){this.instancesDeferred.delete(t),this.instancesOptions.delete(t),this.instances.delete(t)}async delete(){const t=Array.from(this.instances.values());await Promise.all([...t.filter(t=>"INTERNAL"in t).map(t=>t.INTERNAL.delete()),...t.filter(t=>"_delete"in t).map(t=>t._delete())])}isComponentSet(){return null!=this.component}isInitialized(t=ns){return this.instances.has(t)}getOptions(t=ns){return this.instancesOptions.get(t)||{}}initialize(t={}){const{options:e={}}=t,n=this.normalizeInstanceIdentifier(t.instanceIdentifier);if(this.isInitialized(n))throw Error(`${this.name}(${n}) has already been initialized`);if(!this.isComponentSet())throw Error(`Component ${this.name} has not been registered yet`);const s=this.getOrInitializeService({instanceIdentifier:n,options:e});for(const[t,e]of this.instancesDeferred.entries()){n===this.normalizeInstanceIdentifier(t)&&e.resolve(s)}return s}onInit(t,e){const n=this.normalizeInstanceIdentifier(e),s=this.onInitCallbacks.get(n)??new Set;s.add(t),this.onInitCallbacks.set(n,s);const r=this.instances.get(n);return r&&t(r,n),()=>{s.delete(t)}}invokeOnInitCallbacks(t,e){const n=this.onInitCallbacks.get(e);if(n)for(const s of n)try{s(t,e)}catch{}}getOrInitializeService({instanceIdentifier:t,options:e={}}){let n=this.instances.get(t);if(!n&&this.component&&(n=this.component.instanceFactory(this.container,{instanceIdentifier:(s=t,s===ns?void 0:s),options:e}),this.instances.set(t,n),this.instancesOptions.set(t,e),this.invokeOnInitCallbacks(n,t),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,t,n)}catch{}var s;return n||null}normalizeInstanceIdentifier(t=ns){return this.component?this.component.multipleInstances?t:ns:t}shouldAutoInitialize(){return!!this.component&&"EXPLICIT"!==this.component.instantiationMode}}class rs{constructor(t){this.name=t,this.providers=new Map}addComponent(t){const e=this.getProvider(t.name);if(e.isComponentSet())throw new Error(`Component ${t.name} has already been registered with ${this.name}`);e.setComponent(t)}addOrOverwriteComponent(t){this.getProvider(t.name).isComponentSet()&&this.providers.delete(t.name),this.addComponent(t)}getProvider(t){if(this.providers.has(t))return this.providers.get(t);const e=new ss(t,this);return this.providers.set(t,e),e}getProviders(){return Array.from(this.providers.values())}}var is;!function(t){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"}(is||(is={}));const os={debug:is.DEBUG,verbose:is.VERBOSE,info:is.INFO,warn:is.WARN,error:is.ERROR,silent:is.SILENT},as=is.INFO,Bs={[is.DEBUG]:"log",[is.VERBOSE]:"log",[is.INFO]:"info",[is.WARN]:"warn",[is.ERROR]:"error"},cs=(t,e,...n)=>{if(e<t.logLevel)return;(new Date).toISOString();if(!Bs[e])throw new Error(`Attempted to log a message with an invalid logType (value: ${e})`)};class ls{constructor(t){this.name=t,this._logLevel=as,this._logHandler=cs,this._userLogHandler=null}get logLevel(){return this._logLevel}set logLevel(t){if(!(t in is))throw new TypeError(`Invalid value "${t}" assigned to \`logLevel\``);this._logLevel=t}setLogLevel(t){this._logLevel="string"==typeof t?os[t]:t}get logHandler(){return this._logHandler}set logHandler(t){if("function"!=typeof t)throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=t}get userLogHandler(){return this._userLogHandler}set userLogHandler(t){this._userLogHandler=t}debug(...t){this._userLogHandler&&this._userLogHandler(this,is.DEBUG,...t),this._logHandler(this,is.DEBUG,...t)}log(...t){this._userLogHandler&&this._userLogHandler(this,is.VERBOSE,...t),this._logHandler(this,is.VERBOSE,...t)}info(...t){this._userLogHandler&&this._userLogHandler(this,is.INFO,...t),this._logHandler(this,is.INFO,...t)}warn(...t){this._userLogHandler&&this._userLogHandler(this,is.WARN,...t),this._logHandler(this,is.WARN,...t)}error(...t){this._userLogHandler&&this._userLogHandler(this,is.ERROR,...t),this._logHandler(this,is.ERROR,...t)}}let us,hs;const ds=new WeakMap,ps=new WeakMap,fs=new WeakMap,Cs=new WeakMap,gs=new WeakMap;let ms={get(t,e,n){if(t instanceof IDBTransaction){if("done"===e)return ps.get(t);if("objectStoreNames"===e)return t.objectStoreNames||fs.get(t);if("store"===e)return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return Es(t[e])},set:(t,e,n)=>(t[e]=n,!0),has:(t,e)=>t instanceof IDBTransaction&&("done"===e||"store"===e)||e in t};function ws(t){return t!==IDBDatabase.prototype.transaction||"objectStoreNames"in IDBTransaction.prototype?(hs||(hs=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(t)?function(...e){return t.apply(_s(this),e),Es(ds.get(this))}:function(...e){return Es(t.apply(_s(this),e))}:function(e,...n){const s=t.call(_s(this),e,...n);return fs.set(s,e.sort?e.sort():[e]),Es(s)}}function ys(t){return"function"==typeof t?ws(t):(t instanceof IDBTransaction&&function(t){if(ps.has(t))return;const e=new Promise((e,n)=>{const s=()=>{t.removeEventListener("complete",r),t.removeEventListener("error",i),t.removeEventListener("abort",i)},r=()=>{e(),s()},i=()=>{n(t.error||new DOMException("AbortError","AbortError")),s()};t.addEventListener("complete",r),t.addEventListener("error",i),t.addEventListener("abort",i)});ps.set(t,e)}(t),e=t,(us||(us=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])).some(t=>e instanceof t)?new Proxy(t,ms):t);var e}function Es(t){if(t instanceof IDBRequest)return function(t){const e=new Promise((e,n)=>{const s=()=>{t.removeEventListener("success",r),t.removeEventListener("error",i)},r=()=>{e(Es(t.result)),s()},i=()=>{n(t.error),s()};t.addEventListener("success",r),t.addEventListener("error",i)});return e.then(e=>{e instanceof IDBCursor&&ds.set(e,t)}).catch(()=>{}),gs.set(e,t),e}(t);if(Cs.has(t))return Cs.get(t);const e=ys(t);return e!==t&&(Cs.set(t,e),gs.set(e,t)),e}const _s=t=>gs.get(t);function Ds(t,e,{blocked:n,upgrade:s,blocking:r,terminated:i}={}){const o=indexedDB.open(t,e),a=Es(o);return s&&o.addEventListener("upgradeneeded",t=>{s(Es(o.result),t.oldVersion,t.newVersion,Es(o.transaction),t)}),n&&o.addEventListener("blocked",t=>n(t.oldVersion,t.newVersion,t)),a.then(t=>{i&&t.addEventListener("close",()=>i()),r&&t.addEventListener("versionchange",t=>r(t.oldVersion,t.newVersion,t))}).catch(()=>{}),a}const bs=["get","getKey","getAll","getAllKeys","count"],vs=["put","add","delete","clear"],Is=new Map;function Ts(t,e){if(!(t instanceof IDBDatabase)||e in t||"string"!=typeof e)return;if(Is.get(e))return Is.get(e);const n=e.replace(/FromIndex$/,""),s=e!==n,r=vs.includes(n);if(!(n in(s?IDBIndex:IDBObjectStore).prototype)||!r&&!bs.includes(n))return;const i=async function(t,...e){const i=this.transaction(t,r?"readwrite":"readonly");let o=i.store;return s&&(o=o.index(e.shift())),(await Promise.all([o[n](...e),r&&i.done]))[0]};return Is.set(e,i),i}ms=(t=>({...t,get:(e,n,s)=>Ts(e,n)||t.get(e,n,s),has:(e,n)=>!!Ts(e,n)||t.has(e,n)}))(ms);class Os{constructor(t){this.container=t}getPlatformInfoString(){return this.container.getProviders().map(t=>{if(function(t){const e=t.getComponent();return"VERSION"===e?.type}(t)){const e=t.getImmediate();return`${e.library}/${e.version}`}return null}).filter(t=>t).join(" ")}}const As="@firebase/app",Ss="0.16.2",Rs=new ls("@firebase/app"),Ns="@firebase/app-compat",xs="@firebase/analytics-compat",ks="@firebase/analytics",Ls="@firebase/app-check-compat",Fs="@firebase/app-check",Ps="@firebase/auth",Ms="@firebase/auth-compat",Gs="@firebase/database",Hs="@firebase/data-connect",Us="@firebase/database-compat",Vs="@firebase/functions",js="@firebase/functions-compat",$s="@firebase/installations",Js="@firebase/installations-compat",qs="@firebase/messaging",zs="@firebase/messaging-compat",Ks="@firebase/performance",Qs="@firebase/performance-compat",Ws="@firebase/remote-config",Ys="@firebase/remote-config-compat",Xs="@firebase/storage",Zs="@firebase/storage-compat",tr="@firebase/firestore",er="@firebase/ai",nr="@firebase/firestore-compat",sr="firebase",rr="[DEFAULT]",ir={[As]:"fire-core",[Ns]:"fire-core-compat",[ks]:"fire-analytics",[xs]:"fire-analytics-compat",[Fs]:"fire-app-check",[Ls]:"fire-app-check-compat",[Ps]:"fire-auth",[Ms]:"fire-auth-compat",[Gs]:"fire-rtdb",[Hs]:"fire-data-connect",[Us]:"fire-rtdb-compat",[Vs]:"fire-fn",[js]:"fire-fn-compat",[$s]:"fire-iid",[Js]:"fire-iid-compat",[qs]:"fire-fcm",[zs]:"fire-fcm-compat",[Ks]:"fire-perf",[Qs]:"fire-perf-compat",[Ws]:"fire-rc",[Ys]:"fire-rc-compat",[Xs]:"fire-gcs",[Zs]:"fire-gcs-compat",[tr]:"fire-fst",[nr]:"fire-fst-compat",[er]:"fire-vertex","fire-js":"fire-js",[sr]:"fire-js-all"},or=new Map,ar=new Map,Br=new Map;function cr(t,e){try{t.container.addComponent(e)}catch(n){Rs.debug(`Component ${e.name} failed to register with FirebaseApp ${t.name}`,n)}}function lr(t){const e=t.name;if(Br.has(e))return Rs.debug(`There were multiple attempts to register component ${e}.`),!1;Br.set(e,t);for(const e of or.values())cr(e,t);for(const e of ar.values())cr(e,t);return!0}function ur(t,e){const n=t.container.getProvider("heartbeat").getImmediate({optional:!0});return n&&n.triggerHeartbeat(),t.container.getProvider(e)}function hr(t){return null!=t&&void 0!==t.settings}const dr=new jn("app","Firebase",{"no-app":"No Firebase App '{$appName}' has been created - call initializeApp() first","bad-app-name":"Illegal App name: '{$appName}'","duplicate-app":"Firebase App named '{$appName}' already exists with different {$mismatchedParam}. Existing: '{$oldValue}'. New: '{$newValue}'.","app-deleted":"Firebase App named '{$appName}' already deleted","server-app-deleted":"Firebase Server App has been deleted","no-options":"Need to provide options, when not being deployed to hosting via source.","invalid-app-argument":"firebase.{$appName}() takes either no argument or a Firebase App instance.","invalid-log-argument":"First argument to `onLog` must be null or a function.","idb-open":"Error thrown when opening IndexedDB. Original error: {$originalErrorMessage}.","idb-get":"Error thrown when reading from IndexedDB. Original error: {$originalErrorMessage}.","idb-set":"Error thrown when writing to IndexedDB. Original error: {$originalErrorMessage}.","idb-delete":"Error thrown when deleting from IndexedDB. Original error: {$originalErrorMessage}.","finalization-registry-not-supported":"FirebaseServerApp deleteOnDeref field defined but the JS runtime does not support FinalizationRegistry.","invalid-server-app-environment":"FirebaseServerApp is not for use in browser environments."});class pr{constructor(t,e,n){this._isDeleted=!1,this._options={...t},this._config={...e},this._name=e.name,this._automaticDataCollectionEnabled=e.automaticDataCollectionEnabled,this._container=n,this.container.addComponent(new es("app",()=>this,"PUBLIC"))}get automaticDataCollectionEnabled(){return this.checkDestroyed(),this._automaticDataCollectionEnabled}set automaticDataCollectionEnabled(t){this.checkDestroyed(),this._automaticDataCollectionEnabled=t}get name(){return this.checkDestroyed(),this._name}get options(){return this.checkDestroyed(),this._options}get config(){return this.checkDestroyed(),this._config}get container(){return this._container}get isDeleted(){return this._isDeleted}set isDeleted(t){this._isDeleted=t}checkDestroyed(){if(this.isDeleted)throw dr.create("app-deleted",{appName:this._name})}}const fr="12.19.0";function Cr(t,e={}){let n=t;if("object"!=typeof e){e={name:e}}const s={name:rr,automaticDataCollectionEnabled:!0,...e},r=s.name;if("string"!=typeof r||!r)throw dr.create("bad-app-name",{appName:String(r)});if(n||(n=Nn()),!n)throw dr.create("no-options");const i=or.get(r);if(i){if($n(n,i.options)){if($n(s,i.config))return i;throw dr.create("duplicate-app",{appName:r,mismatchedParam:"config",oldValue:JSON.stringify(i.config),newValue:JSON.stringify(s)})}throw dr.create("duplicate-app",{appName:r,mismatchedParam:"options",oldValue:JSON.stringify(i.options),newValue:JSON.stringify(n)})}const o=new rs(r);for(const t of Br.values())o.addComponent(t);const a=new pr(n,s,o);return or.set(r,a),a}function gr(t=rr){const e=or.get(t);if(!e&&t===rr&&Nn())return Cr();if(!e)throw dr.create("no-app",{appName:t});return e}function mr(t,e,n){let s=ir[t]??t;n&&(s+=`-${n}`);const r=s.match(/\s|\//),i=e.match(/\s|\//);if(r||i){const t=[`Unable to register library "${s}" with version "${e}":`];return r&&t.push(`library name "${s}" contains illegal characters (whitespace or "/")`),r&&i&&t.push("and"),i&&t.push(`version name "${e}" contains illegal characters (whitespace or "/")`),void Rs.warn(t.join(" "))}lr(new es(`${s}-version`,()=>({library:s,version:e}),"VERSION"))}const wr="firebase-heartbeat-store";let yr=null;function Er(){return yr||(yr=Ds("firebase-heartbeat-database",1,{upgrade:(t,e)=>{if(0===e)try{t.createObjectStore(wr)}catch(t){}}}).catch(t=>{throw dr.create("idb-open",{originalErrorMessage:t.message})})),yr}async function _r(t,e){try{const n=(await Er()).transaction(wr,"readwrite"),s=n.objectStore(wr);await s.put(e,Dr(t)),await n.done}catch(t){if(t instanceof Vn)Rs.warn(t.message);else{const e=dr.create("idb-set",{originalErrorMessage:t?.message});Rs.warn(e.message)}}}function Dr(t){return`${t.name}!${t.options.appId}`}class br{constructor(t){this.container=t,this._heartbeatsCache=null;const e=this.container.getProvider("app").getImmediate();this._storage=new Ir(e),this._heartbeatsCachePromise=this._storage.read().then(t=>(this._heartbeatsCache=t,t))}async triggerHeartbeat(){try{const t=this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(),e=vr();if(null==this._heartbeatsCache?.heartbeats&&(this._heartbeatsCache=await this._heartbeatsCachePromise,null==this._heartbeatsCache?.heartbeats))return;if(this._heartbeatsCache.lastSentHeartbeatDate===e||this._heartbeatsCache.heartbeats.some(t=>t.date===e))return;if(this._heartbeatsCache.heartbeats.push({date:e,agent:t}),this._heartbeatsCache.heartbeats.length>30){const t=function(t){if(0===t.length)return-1;let e=0,n=t[0].date;for(let s=1;s<t.length;s++)t[s].date<n&&(n=t[s].date,e=s);return e}(this._heartbeatsCache.heartbeats);this._heartbeatsCache.heartbeats.splice(t,1)}return this._storage.overwrite(this._heartbeatsCache)}catch(t){Rs.warn(t)}}async getHeartbeatsHeader(){try{if(null===this._heartbeatsCache&&await this._heartbeatsCachePromise,null==this._heartbeatsCache?.heartbeats||0===this._heartbeatsCache.heartbeats.length)return"";const t=vr(),{heartbeatsToSend:e,unsentEntries:n}=function(t,e=1024){const n=[];let s=t.slice();for(const r of t){const t=n.find(t=>t.agent===r.agent);if(t){if(t.dates.push(r.date),Tr(n)>e){t.dates.pop();break}}else if(n.push({agent:r.agent,dates:[r.date]}),Tr(n)>e){n.pop();break}s=s.slice(1)}return{heartbeatsToSend:n,unsentEntries:s}}(this._heartbeatsCache.heartbeats),s=In(JSON.stringify({version:2,heartbeats:e}));return this._heartbeatsCache.lastSentHeartbeatDate=t,n.length>0?(this._heartbeatsCache.heartbeats=n,await this._storage.overwrite(this._heartbeatsCache)):(this._heartbeatsCache.heartbeats=[],this._storage.overwrite(this._heartbeatsCache)),s}catch(t){return Rs.warn(t),""}}}function vr(){return(new Date).toISOString().substring(0,10)}class Ir{constructor(t){this.app=t,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}async runIndexedDBEnvironmentCheck(){return!!Gn()&&Hn().then(()=>!0).catch(()=>!1)}async read(){if(await this._canUseIndexedDBPromise){const t=await async function(t){try{const e=(await Er()).transaction(wr),n=await e.objectStore(wr).get(Dr(t));return await e.done,n}catch(t){if(t instanceof Vn)Rs.warn(t.message);else{const e=dr.create("idb-get",{originalErrorMessage:t?.message});Rs.warn(e.message)}}}(this.app);return t?.heartbeats?t:{heartbeats:[]}}return{heartbeats:[]}}async overwrite(t){if(await this._canUseIndexedDBPromise){const e=await this.read();return _r(this.app,{lastSentHeartbeatDate:t.lastSentHeartbeatDate??e.lastSentHeartbeatDate,heartbeats:t.heartbeats})}}async add(t){if(await this._canUseIndexedDBPromise){const e=await this.read();return _r(this.app,{lastSentHeartbeatDate:t.lastSentHeartbeatDate??e.lastSentHeartbeatDate,heartbeats:[...e.heartbeats,...t.heartbeats]})}}}function Tr(t){return In(JSON.stringify({version:2,heartbeats:t})).length}var Or;function Ar(){return{"dependent-sdk-initialized-before-auth":"Another Firebase SDK was initialized and is trying to use Auth before Auth is initialized. Please be sure to call `initializeAuth` or `getAuth` before starting any other Firebase SDK."}}Or="",lr(new es("platform-logger",t=>new Os(t),"PRIVATE")),lr(new es("heartbeat",t=>new br(t),"PRIVATE")),mr(As,Ss,Or),mr(As,Ss,"esm2020"),mr("fire-js","");const Sr=Ar,Rr=new jn("auth","Firebase",{"dependent-sdk-initialized-before-auth":"Another Firebase SDK was initialized and is trying to use Auth before Auth is initialized. Please be sure to call `initializeAuth` or `getAuth` before starting any other Firebase SDK."}),Nr=new ls("@firebase/auth");function xr(t,...e){Nr.logLevel<=is.WARN&&Nr.warn(`Auth (${fr}): ${t}`,...e)}function kr(t,...e){Nr.logLevel<=is.ERROR&&Nr.error(`Auth (${fr}): ${t}`,...e)}function Lr(t,...e){throw Hr(t,...e)}function Fr(t,...e){return Hr(t,...e)}function Pr(t,e,n){const s={...Sr(),[e]:n};return new jn("auth","Firebase",s).create(e,{appName:t.name})}function Mr(t){return Pr(t,"operation-not-supported-in-this-environment","Operations that alter the current user are not supported in conjunction with FirebaseServerApp")}function Gr(t,e,n){if(!(e instanceof n))throw n.name!==e.constructor.name&&Lr(t,"argument-error"),Pr(t,"argument-error",`Type of ${e.constructor.name} does not match expected instance.Did you pass a reference from a different Auth SDK?`)}function Hr(t,...e){if("string"!=typeof t){const n=e[0],s=[...e.slice(1)];return s[0]&&(s[0].appName=t.name),t._errorFactory.create(n,...s)}return Rr.create(t,...e)}function Ur(t,e,...n){if(!t)throw Hr(e,...n)}function Vr(t){const e="INTERNAL ASSERTION FAILED: "+t;throw kr(e),new Error(e)}function jr(t,e){t||Vr(e)}function $r(){return"undefined"!=typeof self&&self.location?.href||""}function Jr(){return"undefined"!=typeof self&&self.location?.protocol||null}function qr(){return"undefined"==typeof navigator||!navigator||!("onLine"in navigator)||"boolean"!=typeof navigator.onLine||"http:"!==Jr()&&"https:"!==Jr()&&!Pn()&&!("connection"in navigator)||navigator.onLine}class zr{constructor(t,e){this.shortDelay=t,this.longDelay=e,jr(e>t,"Short delay should be less than long delay!"),this.isMobile="undefined"!=typeof window&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(Fn())||"object"==typeof navigator&&"ReactNative"===navigator.product}get(){return qr()?this.isMobile?this.longDelay:this.shortDelay:Math.min(5e3,this.shortDelay)}}function Kr(t,e){jr(t.emulator,"Emulator should always be set here");const{url:n}=t.emulator;return e?`${n}${e.startsWith("/")?e.slice(1):e}`:n}class Qr{static initialize(t,e,n){this.fetchImpl=t,e&&(this.headersImpl=e),n&&(this.responseImpl=n)}static fetch(){return this.fetchImpl?this.fetchImpl:"undefined"!=typeof self&&"fetch"in self?self.fetch:"undefined"!=typeof globalThis&&globalThis.fetch?globalThis.fetch:"undefined"!=typeof fetch?fetch:void Vr("Could not find fetch implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static headers(){return this.headersImpl?this.headersImpl:"undefined"!=typeof self&&"Headers"in self?self.Headers:"undefined"!=typeof globalThis&&globalThis.Headers?globalThis.Headers:"undefined"!=typeof Headers?Headers:void Vr("Could not find Headers implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static response(){return this.responseImpl?this.responseImpl:"undefined"!=typeof self&&"Response"in self?self.Response:"undefined"!=typeof globalThis&&globalThis.Response?globalThis.Response:"undefined"!=typeof Response?Response:void Vr("Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}}const Wr={CREDENTIAL_MISMATCH:"custom-token-mismatch",MISSING_CUSTOM_TOKEN:"internal-error",INVALID_IDENTIFIER:"invalid-email",MISSING_CONTINUE_URI:"internal-error",INVALID_PASSWORD:"wrong-password",MISSING_PASSWORD:"missing-password",INVALID_LOGIN_CREDENTIALS:"invalid-credential",EMAIL_EXISTS:"email-already-in-use",PASSWORD_LOGIN_DISABLED:"operation-not-allowed",INVALID_IDP_RESPONSE:"invalid-credential",INVALID_PENDING_TOKEN:"invalid-credential",FEDERATED_USER_ID_ALREADY_LINKED:"credential-already-in-use",MISSING_REQ_TYPE:"internal-error",EMAIL_NOT_FOUND:"user-not-found",RESET_PASSWORD_EXCEED_LIMIT:"too-many-requests",EXPIRED_OOB_CODE:"expired-action-code",INVALID_OOB_CODE:"invalid-action-code",MISSING_OOB_CODE:"internal-error",CREDENTIAL_TOO_OLD_LOGIN_AGAIN:"requires-recent-login",INVALID_ID_TOKEN:"invalid-user-token",TOKEN_EXPIRED:"user-token-expired",USER_NOT_FOUND:"user-token-expired",TOO_MANY_ATTEMPTS_TRY_LATER:"too-many-requests",PASSWORD_DOES_NOT_MEET_REQUIREMENTS:"password-does-not-meet-requirements",INVALID_CODE:"invalid-verification-code",INVALID_SESSION_INFO:"invalid-verification-id",INVALID_TEMPORARY_PROOF:"invalid-credential",MISSING_SESSION_INFO:"missing-verification-id",SESSION_EXPIRED:"code-expired",MISSING_ANDROID_PACKAGE_NAME:"missing-android-pkg-name",UNAUTHORIZED_DOMAIN:"unauthorized-continue-uri",INVALID_OAUTH_CLIENT_ID:"invalid-oauth-client-id",ADMIN_ONLY_OPERATION:"admin-restricted-operation",INVALID_MFA_PENDING_CREDENTIAL:"invalid-multi-factor-session",MFA_ENROLLMENT_NOT_FOUND:"multi-factor-info-not-found",MISSING_MFA_ENROLLMENT_ID:"missing-multi-factor-info",MISSING_MFA_PENDING_CREDENTIAL:"missing-multi-factor-session",SECOND_FACTOR_EXISTS:"second-factor-already-in-use",SECOND_FACTOR_LIMIT_EXCEEDED:"maximum-second-factor-count-exceeded",BLOCKING_FUNCTION_ERROR_RESPONSE:"internal-error",RECAPTCHA_NOT_ENABLED:"recaptcha-not-enabled",MISSING_RECAPTCHA_TOKEN:"missing-recaptcha-token",INVALID_RECAPTCHA_TOKEN:"invalid-recaptcha-token",INVALID_RECAPTCHA_ACTION:"invalid-recaptcha-action",MISSING_CLIENT_TYPE:"missing-client-type",MISSING_RECAPTCHA_VERSION:"missing-recaptcha-version",INVALID_RECAPTCHA_VERSION:"invalid-recaptcha-version",INVALID_REQ_TYPE:"invalid-req-type"},Yr=["/v1/accounts:signInWithCustomToken","/v1/accounts:signInWithEmailLink","/v1/accounts:signInWithIdp","/v1/accounts:signInWithPassword","/v1/accounts:signInWithPhoneNumber","/v1/token"],Xr=new zr(3e4,6e4);function Zr(t,e){return t.tenantId&&!e.tenantId?{...e,tenantId:t.tenantId}:e}async function ti(t,e,n,s,r={}){return ei(t,r,async()=>{let r={},i={};s&&("GET"===e?i=s:r={body:JSON.stringify(s)});const o=qn({...i,key:t.config.apiKey}).slice(1),a=await t._getAdditionalHeaders();a["Content-Type"]="application/json",t.languageCode&&(a["X-Firebase-Locale"]=t.languageCode);const B={method:e,headers:a,...r};return"undefined"!=typeof navigator&&"Cloudflare-Workers"===navigator.userAgent||(B.referrerPolicy="strict-origin-when-cross-origin"),t.emulatorConfig&&Zn(t.emulatorConfig.host)&&(B.credentials="include"),Qr.fetch()(await si(t,t.config.apiHost,n,o),B)})}async function ei(t,e,n){t._canInitEmulator=!1;const s={...Wr,...e};try{const e=new ii(t),r=await Promise.race([n(),e.promise]);e.clearNetworkTimeout();const i=await r.json();if("needConfirmation"in i)throw oi(t,"account-exists-with-different-credential",i);if(r.ok&&!("errorMessage"in i))return i;{const e=r.ok?i.errorMessage:i.error.message,[n,o]=e.split(" : ");if("FEDERATED_USER_ID_ALREADY_LINKED"===n)throw oi(t,"credential-already-in-use",i);if("EMAIL_EXISTS"===n)throw oi(t,"email-already-in-use",i);if("USER_DISABLED"===n)throw oi(t,"user-disabled",i);const a=s[n]||n.toLowerCase().replace(/[_\s]+/g,"-");if(o)throw Pr(t,a,o);Lr(t,a)}}catch(e){if(e instanceof Vn)throw e;Lr(t,"network-request-failed",{message:String(e)})}}async function ni(t,e,n,s,r={}){const i=await ti(t,e,n,s,r);return"mfaPendingCredential"in i&&Lr(t,"multi-factor-auth-required",{_serverResponse:i}),i}async function si(t,e,n,s){const r=`${e}${n}?${s}`,i=t,o=i.config.emulator?Kr(t.config,r):`${t.config.apiScheme}://${r}`;if(Yr.includes(n)&&(await i._persistenceManagerAvailable,"COOKIE"===i._getPersistenceType())){return i._getPersistence()._getFinalTarget(o).toString()}return o}function ri(t){switch(t){case"ENFORCE":return"ENFORCE";case"AUDIT":return"AUDIT";case"OFF":return"OFF";default:return"ENFORCEMENT_STATE_UNSPECIFIED"}}class ii{clearNetworkTimeout(){clearTimeout(this.timer)}constructor(t){this.auth=t,this.timer=null,this.promise=new Promise((t,e)=>{this.timer=setTimeout(()=>e(Fr(this.auth,"network-request-failed")),Xr.get())})}}function oi(t,e,n){const s={appName:t.name};n.email&&(s.email=n.email),n.phoneNumber&&(s.phoneNumber=n.phoneNumber);const r=Fr(t,e,s);return r.customData._tokenResponse=n,r}function ai(t){return void 0!==t&&void 0!==t.enterprise}class Bi{constructor(t){if(this.siteKey="",this.recaptchaEnforcementState=[],void 0===t.recaptchaKey)throw new Error("recaptchaKey undefined");this.siteKey=t.recaptchaKey.split("/")[3],this.recaptchaEnforcementState=t.recaptchaEnforcementState}getProviderEnforcementState(t){if(!this.recaptchaEnforcementState||0===this.recaptchaEnforcementState.length)return null;for(const e of this.recaptchaEnforcementState)if(e.provider&&e.provider===t)return ri(e.enforcementState);return null}isProviderEnabled(t){return"ENFORCE"===this.getProviderEnforcementState(t)||"AUDIT"===this.getProviderEnforcementState(t)}isAnyProviderEnabled(){return this.isProviderEnabled("EMAIL_PASSWORD_PROVIDER")||this.isProviderEnabled("PHONE_PROVIDER")}}async function ci(t,e){return ti(t,"POST","/v1/accounts:lookup",e)}function li(t){if(t)try{const e=new Date(Number(t));if(!isNaN(e.getTime()))return e.toUTCString()}catch(t){}}function ui(t){return 1e3*Number(t)}function hi(t){const[e,n,s]=t.split(".");if(void 0===e||void 0===n||void 0===s)return kr("JWT malformed, contained fewer than 3 sections"),null;try{const t=Tn(n);return t?JSON.parse(t):(kr("Failed to decode base64 JWT payload"),null)}catch(t){return kr("Caught error parsing JWT payload as JSON",t?.toString()),null}}function di(t){const e=hi(t);return Ur(e,"internal-error"),Ur(void 0!==e.exp,"internal-error"),Ur(void 0!==e.iat,"internal-error"),Number(e.exp)-Number(e.iat)}async function pi(t,e,n=!1){if(n)return e;try{return await e}catch(e){throw e instanceof Vn&&function({code:t}){return"auth/user-disabled"===t||"auth/user-token-expired"===t}(e)&&t.auth.currentUser===t&&await t.auth.signOut(),e}}class fi{constructor(t){this.user=t,this.isRunning=!1,this.timerId=null,this.errorBackoff=3e4}_start(){this.isRunning||(this.isRunning=!0,this.schedule())}_stop(){this.isRunning&&(this.isRunning=!1,null!==this.timerId&&clearTimeout(this.timerId))}getInterval(t){if(t){const t=this.errorBackoff;return this.errorBackoff=Math.min(2*this.errorBackoff,96e4),t}{this.errorBackoff=3e4;const t=(this.user.stsTokenManager.expirationTime??0)-Date.now()-3e5;return Math.max(0,t)}}schedule(t=!1){if(!this.isRunning)return;const e=this.getInterval(t);this.timerId=setTimeout(async()=>{await this.iteration()},e)}async iteration(){try{await this.user.getIdToken(!0)}catch(t){return void("auth/network-request-failed"===t?.code&&this.schedule(!0))}this.schedule()}}class Ci{constructor(t,e){this.createdAt=t,this.lastLoginAt=e,this._initializeTime()}_initializeTime(){this.lastSignInTime=li(this.lastLoginAt),this.creationTime=li(this.createdAt)}_copy(t){this.createdAt=t.createdAt,this.lastLoginAt=t.lastLoginAt,this._initializeTime()}toJSON(){return{createdAt:this.createdAt,lastLoginAt:this.lastLoginAt}}}async function gi(t){const e=t.auth,n=await t.getIdToken(),s=await pi(t,ci(e,{idToken:n}));Ur(s?.users.length,e,"internal-error");const r=s.users[0];t._notifyReloadListener(r);const i=r.providerUserInfo?.length?mi(r.providerUserInfo):[],o=function(t,e){const n=t.filter(t=>!e.some(e=>e.providerId===t.providerId));return[...n,...e]}(t.providerData,i),a=t.isAnonymous,B=!(t.email&&r.passwordHash||o?.length),c=!!a&&B,l={uid:r.localId,displayName:r.displayName||null,photoURL:r.photoUrl||null,email:r.email||null,emailVerified:r.emailVerified||!1,phoneNumber:r.phoneNumber||null,tenantId:r.tenantId||null,providerData:o,metadata:new Ci(r.createdAt,r.lastLoginAt),isAnonymous:c};Object.assign(t,l)}function mi(t){return t.map(({providerId:t,...e})=>({providerId:t,uid:e.rawId||"",displayName:e.displayName||null,email:e.email||null,phoneNumber:e.phoneNumber||null,photoURL:e.photoUrl||null}))}class wi{constructor(){this.refreshToken=null,this.accessToken=null,this.expirationTime=null}get isExpired(){return!this.expirationTime||Date.now()>this.expirationTime-3e4}updateFromServerResponse(t){Ur(t.idToken,"internal-error"),Ur(void 0!==t.idToken,"internal-error"),Ur(void 0!==t.refreshToken,"internal-error");const e="expiresIn"in t&&void 0!==t.expiresIn?Number(t.expiresIn):di(t.idToken);this.updateTokensAndExpiration(t.idToken,t.refreshToken,e)}updateFromIdToken(t){Ur(0!==t.length,"internal-error");const e=di(t);this.updateTokensAndExpiration(t,null,e)}async getToken(t,e=!1){return e||!this.accessToken||this.isExpired?(Ur(this.refreshToken,t,"user-token-expired"),this.refreshToken?(await this.refresh(t,this.refreshToken),this.accessToken):null):this.accessToken}clearRefreshToken(){this.refreshToken=null}async refresh(t,e){const{accessToken:n,refreshToken:s,expiresIn:r}=await async function(t,e){const n=await ei(t,{},async()=>{const n=qn({grant_type:"refresh_token",refresh_token:e}).slice(1),{tokenApiHost:s,apiKey:r}=t.config,i=await si(t,s,"/v1/token",`key=${r}`),o=await t._getAdditionalHeaders();o["Content-Type"]="application/x-www-form-urlencoded";const a={method:"POST",headers:o,body:n};return t.emulatorConfig&&Zn(t.emulatorConfig.host)&&(a.credentials="include"),Qr.fetch()(i,a)});return{accessToken:n.access_token,expiresIn:n.expires_in,refreshToken:n.refresh_token}}(t,e);this.updateTokensAndExpiration(n,s,Number(r))}updateTokensAndExpiration(t,e,n){this.refreshToken=e||null,this.accessToken=t||null,this.expirationTime=Date.now()+1e3*n}static fromJSON(t,e){const{refreshToken:n,accessToken:s,expirationTime:r}=e,i=new wi;return n&&(Ur("string"==typeof n,"internal-error",{appName:t}),i.refreshToken=n),s&&(Ur("string"==typeof s,"internal-error",{appName:t}),i.accessToken=s),r&&(Ur("number"==typeof r,"internal-error",{appName:t}),i.expirationTime=r),i}toJSON(){return{refreshToken:this.refreshToken,accessToken:this.accessToken,expirationTime:this.expirationTime}}_assign(t){this.accessToken=t.accessToken,this.refreshToken=t.refreshToken,this.expirationTime=t.expirationTime}_clone(){return Object.assign(new wi,this.toJSON())}_performRefresh(){return Vr("not implemented")}}function yi(t,e){Ur("string"==typeof t||void 0===t,"internal-error",{appName:e})}class Ei{constructor({uid:t,auth:e,stsTokenManager:n,...s}){this.providerId="firebase",this.proactiveRefresh=new fi(this),this.reloadUserInfo=null,this.reloadListener=null,this.uid=t,this.auth=e,this.stsTokenManager=n,this.accessToken=n.accessToken,this.displayName=s.displayName||null,this.email=s.email||null,this.emailVerified=s.emailVerified||!1,this.phoneNumber=s.phoneNumber||null,this.photoURL=s.photoURL||null,this.isAnonymous=s.isAnonymous||!1,this.tenantId=s.tenantId||null,this.providerData=s.providerData?[...s.providerData]:[],this.metadata=new Ci(s.createdAt||void 0,s.lastLoginAt||void 0)}async getIdToken(t){const e=await pi(this,this.stsTokenManager.getToken(this.auth,t));return Ur(e,this.auth,"internal-error"),this.accessToken!==e&&(this.accessToken=e,await this.auth._persistUserIfCurrent(this),this.auth._notifyListenersIfCurrent(this)),e}getIdTokenResult(t){return async function(t,e=!1){const n=Xn(t),s=await n.getIdToken(e),r=hi(s);Ur(r&&r.exp&&r.auth_time&&r.iat,n.auth,"internal-error");const i="object"==typeof r.firebase?r.firebase:void 0,o=i?.sign_in_provider;return{claims:r,token:s,authTime:li(ui(r.auth_time)),issuedAtTime:li(ui(r.iat)),expirationTime:li(ui(r.exp)),signInProvider:o||null,signInSecondFactor:i?.sign_in_second_factor||null}}(this,t)}reload(){return async function(t){const e=Xn(t);await gi(e),await e.auth._persistUserIfCurrent(e),e.auth._notifyListenersIfCurrent(e)}(this)}_assign(t){this!==t&&(Ur(this.uid===t.uid,this.auth,"internal-error"),this.displayName=t.displayName,this.photoURL=t.photoURL,this.email=t.email,this.emailVerified=t.emailVerified,this.phoneNumber=t.phoneNumber,this.isAnonymous=t.isAnonymous,this.tenantId=t.tenantId,this.providerData=t.providerData.map(t=>({...t})),this.metadata._copy(t.metadata),this.stsTokenManager._assign(t.stsTokenManager))}_clone(t){const e=new Ei({...this,auth:t,stsTokenManager:this.stsTokenManager._clone()});return e.metadata._copy(this.metadata),e}_onReload(t){Ur(!this.reloadListener,this.auth,"internal-error"),this.reloadListener=t,this.reloadUserInfo&&(this._notifyReloadListener(this.reloadUserInfo),this.reloadUserInfo=null)}_notifyReloadListener(t){this.reloadListener?this.reloadListener(t):this.reloadUserInfo=t}_startProactiveRefresh(){this.proactiveRefresh._start()}_stopProactiveRefresh(){this.proactiveRefresh._stop()}async _updateTokensIfNecessary(t,e=!1){let n=!1;t.idToken&&t.idToken!==this.stsTokenManager.accessToken&&(this.stsTokenManager.updateFromServerResponse(t),n=!0),e&&await gi(this),await this.auth._persistUserIfCurrent(this),n&&this.auth._notifyListenersIfCurrent(this)}async delete(){if(hr(this.auth.app))return Promise.reject(Mr(this.auth));const t=await this.getIdToken();return await pi(this,async function(t,e){return ti(t,"POST","/v1/accounts:delete",e)}(this.auth,{idToken:t})),this.stsTokenManager.clearRefreshToken(),this.auth.signOut()}toJSON(){return{uid:this.uid,email:this.email||void 0,emailVerified:this.emailVerified,displayName:this.displayName||void 0,isAnonymous:this.isAnonymous,photoURL:this.photoURL||void 0,phoneNumber:this.phoneNumber||void 0,tenantId:this.tenantId||void 0,providerData:this.providerData.map(t=>({...t})),stsTokenManager:this.stsTokenManager.toJSON(),_redirectEventId:this._redirectEventId,...this.metadata.toJSON(),apiKey:this.auth.config.apiKey,appName:this.auth.name}}get refreshToken(){return this.stsTokenManager.refreshToken||""}static _fromJSON(t,e){const n=e.displayName??void 0,s=e.email??void 0,r=e.phoneNumber??void 0,i=e.photoURL??void 0,o=e.tenantId??void 0,a=e._redirectEventId??void 0,B=e.createdAt??void 0,c=e.lastLoginAt??void 0,{uid:l,emailVerified:u,isAnonymous:h,providerData:d,stsTokenManager:p}=e;Ur(l&&p,t,"internal-error");const f=wi.fromJSON(this.name,p);Ur("string"==typeof l,t,"internal-error"),yi(n,t.name),yi(s,t.name),Ur("boolean"==typeof u,t,"internal-error"),Ur("boolean"==typeof h,t,"internal-error"),yi(r,t.name),yi(i,t.name),yi(o,t.name),yi(a,t.name),yi(B,t.name),yi(c,t.name);const C=new Ei({uid:l,auth:t,email:s,emailVerified:u,displayName:n,isAnonymous:h,photoURL:i,phoneNumber:r,tenantId:o,stsTokenManager:f,createdAt:B,lastLoginAt:c});return d&&Array.isArray(d)&&(C.providerData=d.map(t=>({...t}))),a&&(C._redirectEventId=a),C}static async _fromIdTokenResponse(t,e,n=!1){const s=new wi;s.updateFromServerResponse(e);const r=new Ei({uid:e.localId,auth:t,stsTokenManager:s,isAnonymous:n});return await gi(r),r}static async _fromGetAccountInfoResponse(t,e,n){const s=e.users[0];Ur(void 0!==s.localId,"internal-error");const r=void 0!==s.providerUserInfo?mi(s.providerUserInfo):[],i=!(s.email&&s.passwordHash||r?.length),o=new wi;o.updateFromIdToken(n);const a=new Ei({uid:s.localId,auth:t,stsTokenManager:o,isAnonymous:i}),B={uid:s.localId,displayName:s.displayName||null,photoURL:s.photoUrl||null,email:s.email||null,emailVerified:s.emailVerified||!1,phoneNumber:s.phoneNumber||null,tenantId:s.tenantId||null,providerData:r,metadata:new Ci(s.createdAt,s.lastLoginAt),isAnonymous:!(s.email&&s.passwordHash||r?.length)};return Object.assign(a,B),a}}const _i=new Map;function Di(t){jr(t instanceof Function,"Expected a class definition");let e=_i.get(t);return e?(jr(e instanceof t,"Instance stored in cache mismatched with class"),e):(e=new t,_i.set(t,e),e)}class bi{constructor(){this.type="NONE",this.storage={}}async _isAvailable(){return!0}async _set(t,e){this.storage[t]=e}async _get(t){const e=this.storage[t];return void 0===e?null:e}async _remove(t){delete this.storage[t]}_addListener(t,e){}_removeListener(t,e){}}bi.type="NONE";const vi=bi;function Ii(t,e,n){return`firebase:${t}:${e}:${n}`}class Ti{constructor(t,e,n){this.persistence=t,this.auth=e,this.userKey=n;const{config:s,name:r}=this.auth;this.fullUserKey=Ii(this.userKey,s.apiKey,r),this.fullPersistenceKey=Ii("persistence",s.apiKey,r),this.boundEventHandler=e._onStorageEvent.bind(e);try{this.persistence._addListener(this.fullUserKey,this.boundEventHandler)}catch{}}setCurrentUser(t){return this.persistence._set(this.fullUserKey,t.toJSON())}async getCurrentUser(){const t=await this.persistence._get(this.fullUserKey);if(!t)return null;if("string"==typeof t){const e=await ci(this.auth,{idToken:t}).catch(()=>{});return e?Ei._fromGetAccountInfoResponse(this.auth,e,t):null}return Ei._fromJSON(this.auth,t)}removeCurrentUser(){return this.persistence._remove(this.fullUserKey)}savePersistenceForRedirect(){return this.persistence._set(this.fullPersistenceKey,this.persistence.type)}async setPersistence(t){if(this.persistence===t)return;const e=await this.getCurrentUser();return await this.removeCurrentUser(),this.persistence=t,e?this.setCurrentUser(e):void 0}delete(){try{this.persistence._removeListener(this.fullUserKey,this.boundEventHandler)}catch{}}static async create(t,e,n="authUser"){if(!e.length)return new Ti(Di(vi),t,n);const s=(await Promise.all(e.map(async t=>{try{if(await t._isAvailable())return t}catch{return}}))).filter(t=>t);let r=s[0]||Di(vi);const i=Ii(n,t.config.apiKey,t.name);let o=null;for(const n of e)try{const e=await n._get(i);if(e){let s;if("string"==typeof e){const n=await ci(t,{idToken:e}).catch(()=>{});if(!n)break;s=await Ei._fromGetAccountInfoResponse(t,n,e)}else s=Ei._fromJSON(t,e);n!==r&&(o=s),r=n;break}}catch{}const a=s.filter(t=>t._shouldAllowMigration);return r._shouldAllowMigration&&a.length?(r=a[0],o&&await r._set(i,o.toJSON()),await Promise.all(e.map(async t=>{if(t!==r)try{await t._remove(i)}catch{}})),new Ti(r,t,n)):new Ti(r,t,n)}}function Oi(t){const e=t.toLowerCase();if(e.includes("opera/")||e.includes("opr/")||e.includes("opios/"))return"Opera";if(Ni(e))return"IEMobile";if(e.includes("msie")||e.includes("trident/"))return"IE";if(e.includes("edge/"))return"Edge";if(Ai(e))return"Firefox";if(e.includes("silk/"))return"Silk";if(ki(e))return"Blackberry";if(Li(e))return"Webos";if(Si(e))return"Safari";if((e.includes("chrome/")||Ri(e))&&!e.includes("edge/"))return"Chrome";if(xi(e))return"Android";{const e=/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/,n=t.match(e);if(2===n?.length)return n[1]}return"Other"}function Ai(t=Fn()){return/firefox\//i.test(t)}function Si(t=Fn()){const e=t.toLowerCase();return e.includes("safari/")&&!e.includes("chrome/")&&!e.includes("crios/")&&!e.includes("android")}function Ri(t=Fn()){return/crios\//i.test(t)}function Ni(t=Fn()){return/iemobile/i.test(t)}function xi(t=Fn()){return/android/i.test(t)}function ki(t=Fn()){return/blackberry/i.test(t)}function Li(t=Fn()){return/webos/i.test(t)}function Fi(t=Fn()){return/iphone|ipad|ipod/i.test(t)||/macintosh/i.test(t)&&/mobile/i.test(t)}function Pi(){return function(){const t=Fn();return t.indexOf("MSIE ")>=0||t.indexOf("Trident/")>=0}()&&10===document.documentMode}function Mi(t=Fn()){return Fi(t)||xi(t)||Li(t)||ki(t)||/windows phone/i.test(t)||Ni(t)}function Gi(t,e=[]){let n;switch(t){case"Browser":n=Oi(Fn());break;case"Worker":n=`${Oi(Fn())}-${t}`;break;default:n=t}const s=e.length?e.join(","):"FirebaseCore-web";return`${n}/JsCore/${fr}/${s}`}class Hi{constructor(t){this.auth=t,this.queue=[]}pushCallback(t,e){const n=e=>new Promise((n,s)=>{try{n(t(e))}catch(t){s(t)}});n.onAbort=e,this.queue.push(n);const s=this.queue.length-1;return()=>{this.queue[s]=()=>Promise.resolve()}}async runMiddleware(t){if(this.auth.currentUser===t)return;const e=[];try{for(const n of this.queue)await n(t),n.onAbort&&e.push(n.onAbort)}catch(t){e.reverse();for(const t of e)try{t()}catch(t){}throw this.auth._errorFactory.create("login-blocked",{originalMessage:t?.message})}}}class Ui{constructor(t){const e=t.customStrengthOptions;this.customStrengthOptions={},this.customStrengthOptions.minPasswordLength=e.minPasswordLength??6,e.maxPasswordLength&&(this.customStrengthOptions.maxPasswordLength=e.maxPasswordLength),void 0!==e.containsLowercaseCharacter&&(this.customStrengthOptions.containsLowercaseLetter=e.containsLowercaseCharacter),void 0!==e.containsUppercaseCharacter&&(this.customStrengthOptions.containsUppercaseLetter=e.containsUppercaseCharacter),void 0!==e.containsNumericCharacter&&(this.customStrengthOptions.containsNumericCharacter=e.containsNumericCharacter),void 0!==e.containsNonAlphanumericCharacter&&(this.customStrengthOptions.containsNonAlphanumericCharacter=e.containsNonAlphanumericCharacter),this.enforcementState=t.enforcementState,"ENFORCEMENT_STATE_UNSPECIFIED"===this.enforcementState&&(this.enforcementState="OFF"),this.allowedNonAlphanumericCharacters=t.allowedNonAlphanumericCharacters?.join("")??"",this.forceUpgradeOnSignin=t.forceUpgradeOnSignin??!1,this.schemaVersion=t.schemaVersion}validatePassword(t){const e={isValid:!0,passwordPolicy:this};return this.validatePasswordLengthOptions(t,e),this.validatePasswordCharacterOptions(t,e),e.isValid&&(e.isValid=e.meetsMinPasswordLength??!0),e.isValid&&(e.isValid=e.meetsMaxPasswordLength??!0),e.isValid&&(e.isValid=e.containsLowercaseLetter??!0),e.isValid&&(e.isValid=e.containsUppercaseLetter??!0),e.isValid&&(e.isValid=e.containsNumericCharacter??!0),e.isValid&&(e.isValid=e.containsNonAlphanumericCharacter??!0),e}validatePasswordLengthOptions(t,e){const n=this.customStrengthOptions.minPasswordLength,s=this.customStrengthOptions.maxPasswordLength;n&&(e.meetsMinPasswordLength=t.length>=n),s&&(e.meetsMaxPasswordLength=t.length<=s)}validatePasswordCharacterOptions(t,e){let n;this.updatePasswordCharacterOptionsStatuses(e,!1,!1,!1,!1);for(let s=0;s<t.length;s++)n=t.charAt(s),this.updatePasswordCharacterOptionsStatuses(e,n>="a"&&n<="z",n>="A"&&n<="Z",n>="0"&&n<="9",this.allowedNonAlphanumericCharacters.includes(n))}updatePasswordCharacterOptionsStatuses(t,e,n,s,r){this.customStrengthOptions.containsLowercaseLetter&&(t.containsLowercaseLetter||(t.containsLowercaseLetter=e)),this.customStrengthOptions.containsUppercaseLetter&&(t.containsUppercaseLetter||(t.containsUppercaseLetter=n)),this.customStrengthOptions.containsNumericCharacter&&(t.containsNumericCharacter||(t.containsNumericCharacter=s)),this.customStrengthOptions.containsNonAlphanumericCharacter&&(t.containsNonAlphanumericCharacter||(t.containsNonAlphanumericCharacter=r))}}class Vi{constructor(t,e,n,s){this.app=t,this.heartbeatServiceProvider=e,this.appCheckServiceProvider=n,this.config=s,this.currentUser=null,this.emulatorConfig=null,this.operations=Promise.resolve(),this.authStateSubscription=new $i(this),this.idTokenSubscription=new $i(this),this.beforeStateQueue=new Hi(this),this.redirectUser=null,this.isProactiveRefreshEnabled=!1,this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION=1,this._canInitEmulator=!0,this._isInitialized=!1,this._deleted=!1,this._initializationPromise=null,this._popupRedirectResolver=null,this._errorFactory=Rr,this._agentRecaptchaConfig=null,this._tenantRecaptchaConfigs={},this._projectPasswordPolicy=null,this._tenantPasswordPolicies={},this._resolvePersistenceManagerAvailable=void 0,this.lastNotifiedUid=void 0,this.languageCode=null,this.tenantId=null,this.settings={appVerificationDisabledForTesting:!1},this.frameworks=[],this.name=t.name,this.clientVersion=s.sdkClientVersion,this._persistenceManagerAvailable=new Promise(t=>this._resolvePersistenceManagerAvailable=t)}_initializeWithPersistence(t,e){return e&&(this._popupRedirectResolver=Di(e)),this._initializationPromise=this.queue(async()=>{if(!this._deleted){try{this.persistenceManager=await Ti.create(this,t)}catch(t){xr(`Failed to initialize persistence: ${t}`),this.persistenceManager=await Ti.create(this,[])}finally{this._resolvePersistenceManagerAvailable?.()}if(!this._deleted){if(this._popupRedirectResolver?._shouldInitProactively)try{await this._popupRedirectResolver._initialize(this)}catch(t){}try{await this.initializeCurrentUser(e)}catch(t){xr(`Failed to initialize current user: ${t}`),await this.directlySetCurrentUser(null).catch(()=>{})}this.lastNotifiedUid=this.currentUser?.uid||null,this._deleted||(this._isInitialized=!0)}}}),this._initializationPromise}async _onStorageEvent(){if(this._deleted)return;const t=await this.assertedPersistence.getCurrentUser();return this.currentUser||t?this.currentUser&&t&&this.currentUser.uid===t.uid?(this._currentUser._assign(t),void await this.currentUser.getIdToken()):void await this._updateCurrentUser(t,!0):void 0}async initializeCurrentUserFromIdToken(t){try{const e=await ci(this,{idToken:t}),n=await Ei._fromGetAccountInfoResponse(this,e,t);await this.directlySetCurrentUser(n)}catch(t){await this.directlySetCurrentUser(null)}}async initializeCurrentUser(t){if(hr(this.app)){const t=this.app.settings.authIdToken;return t?new Promise(e=>{setTimeout(()=>this.initializeCurrentUserFromIdToken(t).then(e,e))}):this.directlySetCurrentUser(null)}const e=await this.assertedPersistence.getCurrentUser();let n=e,s=!1;if(t&&this.config.authDomain){await this.getOrInitRedirectPersistenceManager();const e=this.redirectUser?._redirectEventId,r=n?._redirectEventId,i=await this.tryRedirectSignIn(t);e&&e!==r||!i?.user||(n=i.user,s=!0)}if(!n)return this.directlySetCurrentUser(null);if(!n._redirectEventId){if(s)try{await this.beforeStateQueue.runMiddleware(n)}catch(t){n=e,this._popupRedirectResolver._overrideRedirectResult(this,()=>Promise.reject(t))}return n?this.reloadAndSetCurrentUserOrClear(n):this.directlySetCurrentUser(null)}return Ur(this._popupRedirectResolver,this,"argument-error"),await this.getOrInitRedirectPersistenceManager(),this.redirectUser&&this.redirectUser._redirectEventId===n._redirectEventId?this.directlySetCurrentUser(n):this.reloadAndSetCurrentUserOrClear(n)}async tryRedirectSignIn(t){let e=null;try{e=await this._popupRedirectResolver._completeRedirectFn(this,t,!0)}catch(t){await this._setRedirectUser(null)}return e}async reloadAndSetCurrentUserOrClear(t){try{await gi(t)}catch(t){if("auth/network-request-failed"!==t?.code)return this.directlySetCurrentUser(null)}return this.directlySetCurrentUser(t)}useDeviceLanguage(){this.languageCode=function(){if("undefined"==typeof navigator)return null;const t=navigator;return t.languages&&t.languages[0]||t.language||null}()}async _delete(){this._deleted=!0}async updateCurrentUser(t){if(hr(this.app))return Promise.reject(Mr(this));const e=t?Xn(t):null;return e&&Ur(e.auth.config.apiKey===this.config.apiKey,this,"invalid-user-token"),this._updateCurrentUser(e&&e._clone(this))}async _updateCurrentUser(t,e=!1){if(!this._deleted)return t&&Ur(this.tenantId===t.tenantId,this,"tenant-id-mismatch"),e||await this.beforeStateQueue.runMiddleware(t),this.queue(async()=>{await this.directlySetCurrentUser(t),this.notifyAuthListeners()})}async signOut(){return hr(this.app)?Promise.reject(Mr(this)):(await this.beforeStateQueue.runMiddleware(null),(this.redirectPersistenceManager||this._popupRedirectResolver)&&await this._setRedirectUser(null),this._updateCurrentUser(null,!0))}setPersistence(t){return hr(this.app)?Promise.reject(Mr(this)):this.queue(async()=>{await this.assertedPersistence.setPersistence(Di(t))})}_getRecaptchaConfig(){return null==this.tenantId?this._agentRecaptchaConfig:this._tenantRecaptchaConfigs[this.tenantId]}async validatePassword(t){this._getPasswordPolicyInternal()||await this._updatePasswordPolicy();const e=this._getPasswordPolicyInternal();return e.schemaVersion!==this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION?Promise.reject(this._errorFactory.create("unsupported-password-policy-schema-version",{})):e.validatePassword(t)}_getPasswordPolicyInternal(){return null===this.tenantId?this._projectPasswordPolicy:this._tenantPasswordPolicies[this.tenantId]}async _updatePasswordPolicy(){const t=await async function(t,e={}){return ti(t,"GET","/v2/passwordPolicy",Zr(t,e))}(this),e=new Ui(t);null===this.tenantId?this._projectPasswordPolicy=e:this._tenantPasswordPolicies[this.tenantId]=e}_getPersistenceType(){return this.assertedPersistence.persistence.type}_getPersistence(){return this.assertedPersistence.persistence}_updateErrorMap(t){this._errorFactory=new jn("auth","Firebase",t())}onAuthStateChanged(t,e,n){return this.registerStateListener(this.authStateSubscription,t,e,n)}beforeAuthStateChanged(t,e){return this.beforeStateQueue.pushCallback(t,e)}onIdTokenChanged(t,e,n){return this.registerStateListener(this.idTokenSubscription,t,e,n)}authStateReady(){return new Promise((t,e)=>{if(this.currentUser)t();else{const n=this.onAuthStateChanged(()=>{n(),t()},e)}})}async revokeAccessToken(t){if(this.currentUser){const e={providerId:"apple.com",tokenType:"ACCESS_TOKEN",token:t,idToken:await this.currentUser.getIdToken()};null!=this.tenantId&&(e.tenantId=this.tenantId),await async function(t,e){return ti(t,"POST","/v2/accounts:revokeToken",Zr(t,e))}(this,e)}}toJSON(){return{apiKey:this.config.apiKey,authDomain:this.config.authDomain,appName:this.name,currentUser:this._currentUser?.toJSON()}}async _setRedirectUser(t,e){const n=await this.getOrInitRedirectPersistenceManager(e);return null===t?n.removeCurrentUser():n.setCurrentUser(t)}async getOrInitRedirectPersistenceManager(t){if(!this.redirectPersistenceManager){const e=t&&Di(t)||this._popupRedirectResolver;Ur(e,this,"argument-error"),this.redirectPersistenceManager=await Ti.create(this,[Di(e._redirectPersistence)],"redirectUser"),this.redirectUser=await this.redirectPersistenceManager.getCurrentUser()}return this.redirectPersistenceManager}async _redirectUserForId(t){return this._isInitialized&&await this.queue(async()=>{}),this._currentUser?._redirectEventId===t?this._currentUser:this.redirectUser?._redirectEventId===t?this.redirectUser:null}async _persistUserIfCurrent(t){if(t===this.currentUser)return this.queue(async()=>this.directlySetCurrentUser(t))}_notifyListenersIfCurrent(t){t===this.currentUser&&this.notifyAuthListeners()}_key(){return`${this.config.authDomain}:${this.config.apiKey}:${this.name}`}_startProactiveRefresh(){this.isProactiveRefreshEnabled=!0,this.currentUser&&this._currentUser._startProactiveRefresh()}_stopProactiveRefresh(){this.isProactiveRefreshEnabled=!1,this.currentUser&&this._currentUser._stopProactiveRefresh()}get _currentUser(){return this.currentUser}notifyAuthListeners(){if(!this._isInitialized)return;this.idTokenSubscription.next(this.currentUser);const t=this.currentUser?.uid??null;this.lastNotifiedUid!==t&&(this.lastNotifiedUid=t,this.authStateSubscription.next(this.currentUser))}registerStateListener(t,e,n,s){if(this._deleted)return()=>{};const r="function"==typeof e?e:e.next.bind(e);let i=!1;const o=this._isInitialized?Promise.resolve():this._initializationPromise;if(Ur(o,this,"internal-error"),o.then(()=>{i||r(this.currentUser)}).catch(t=>{if(!i)if("function"!=typeof e&&e.error)e.error(t);else{if(!n)throw t;n(t)}}),"function"==typeof e){const r=t.addObserver(e,n,s);return()=>{i=!0,r()}}{const n=t.addObserver(e);return()=>{i=!0,n()}}}async directlySetCurrentUser(t){if(this.currentUser&&this.currentUser!==t&&this._currentUser._stopProactiveRefresh(),t&&this.isProactiveRefreshEnabled&&t._startProactiveRefresh(),this.currentUser=t,this.persistenceManager)try{t?await this.persistenceManager.setCurrentUser(t):await this.persistenceManager.removeCurrentUser()}catch(t){const e=Pr(this,"internal-error",`An internal AuthError has occurred: ${t?.message||String(t)}`);throw e.customData={originalError:t},e}}queue(t){return this.operations=this.operations.then(t,t),this.operations}get assertedPersistence(){return Ur(this.persistenceManager,this,"internal-error"),this.persistenceManager}_logFramework(t){t&&!this.frameworks.includes(t)&&(this.frameworks.push(t),this.frameworks.sort(),this.clientVersion=Gi(this.config.clientPlatform,this._getFrameworks()))}_getFrameworks(){return this.frameworks}async _getAdditionalHeaders(){const t={"X-Client-Version":this.clientVersion};this.app.options.appId&&(t["X-Firebase-gmpid"]=this.app.options.appId);const e=await(this.heartbeatServiceProvider.getImmediate({optional:!0})?.getHeartbeatsHeader());e&&(t["X-Firebase-Client"]=e);const n=await this._getAppCheckToken();return n&&(t["X-Firebase-AppCheck"]=n),t}async _getAppCheckToken(){if(hr(this.app)&&this.app.settings.appCheckToken)return this.app.settings.appCheckToken;const t=await(this.appCheckServiceProvider.getImmediate({optional:!0})?.getToken());return t?.error&&xr(`Error while retrieving App Check token: ${t.error}`),t?.token}}function ji(t){return Xn(t)}class $i{constructor(t){this.auth=t,this.observer=null,this.addObserver=function(t,e){const n=new Qn(t,e);return n.subscribe.bind(n)}(t=>this.observer=t)}get next(){return Ur(this.observer,this.auth,"internal-error"),this.observer.next.bind(this.observer)}}let Ji={async loadJS(){throw new Error("Unable to load external scripts")},recaptchaV2Script:"",recaptchaEnterpriseScript:"",gapiScript:""};function qi(t){return Ji.loadJS(t)}class zi{constructor(){this.enterprise=new Ki}ready(t){t()}execute(t,e){return Promise.resolve("token")}render(t,e){return""}}class Ki{ready(t){t()}execute(t,e){return Promise.resolve("token")}render(t,e){return""}}const Qi="NO_RECAPTCHA",Wi="onFirebaseAuthREInstanceReady";class Yi{constructor(t){this.type="recaptcha-enterprise",this.auth=ji(t)}async verify(t="verify",e=!1){async function n(t){if(!e){if(null==t.tenantId&&null!=t._agentRecaptchaConfig)return t._agentRecaptchaConfig.siteKey;if(null!=t.tenantId&&void 0!==t._tenantRecaptchaConfigs[t.tenantId])return t._tenantRecaptchaConfigs[t.tenantId].siteKey}return new Promise(async(e,n)=>{(async function(t,e){return ti(t,"GET","/v2/recaptchaConfig",Zr(t,e))})(t,{clientType:"CLIENT_TYPE_WEB",version:"RECAPTCHA_ENTERPRISE"}).then(s=>{if(void 0!==s.recaptchaKey){const n=new Bi(s);return null==t.tenantId?t._agentRecaptchaConfig=n:t._tenantRecaptchaConfigs[t.tenantId]=n,e(n.siteKey)}n(new Error("recaptcha Enterprise site key undefined"))}).catch(t=>{n(t)})})}function s(e,n,s){const r=window.grecaptcha;ai(r)?r.enterprise.ready(()=>{r.enterprise.execute(e,{action:t}).then(t=>{n(t)}).catch(()=>{n(Qi)})}):s(Error("No reCAPTCHA enterprise script loaded."))}if(this.auth.settings.appVerificationDisabledForTesting){return(new zi).execute("siteKey",{action:"verify"})}return new Promise((t,r)=>{n(this.auth).then(async n=>{if(!e&&ai(window.grecaptcha)&&Yi.scriptInjectionDeferred)await Yi.scriptInjectionDeferred.promise,s(n,t,r);else{if("undefined"==typeof window)return void r(new Error("RecaptchaVerifier is only supported in browser"));let e=Ji.recaptchaEnterpriseScript;0!==e.length&&(e+=n+`&onload=${Wi}`),Yi.scriptInjectionDeferred=new kn,window[Wi]=()=>{Yi.scriptInjectionDeferred?.resolve()},qi(e).then(()=>Yi.scriptInjectionDeferred?.promise).then(()=>{s(n,t,r)}).catch(t=>{r(t)})}}).catch(t=>{r(t)})})}}async function Xi(t,e,n,s=!1,r=!1){const i=new Yi(t);let o;if(r)o=Qi;else try{o=await i.verify(n)}catch(t){o=await i.verify(n,!0)}const a={...e};if("mfaSmsEnrollment"===n||"mfaSmsSignIn"===n){if("phoneEnrollmentInfo"in a){const t=a.phoneEnrollmentInfo.phoneNumber,e=a.phoneEnrollmentInfo.recaptchaToken;Object.assign(a,{phoneEnrollmentInfo:{phoneNumber:t,recaptchaToken:e,captchaResponse:o,clientType:"CLIENT_TYPE_WEB",recaptchaVersion:"RECAPTCHA_ENTERPRISE"}})}else if("phoneSignInInfo"in a){const t=a.phoneSignInInfo.recaptchaToken;Object.assign(a,{phoneSignInInfo:{recaptchaToken:t,captchaResponse:o,clientType:"CLIENT_TYPE_WEB",recaptchaVersion:"RECAPTCHA_ENTERPRISE"}})}return a}return s?Object.assign(a,{captchaResp:o}):Object.assign(a,{captchaResponse:o}),Object.assign(a,{clientType:"CLIENT_TYPE_WEB"}),Object.assign(a,{recaptchaVersion:"RECAPTCHA_ENTERPRISE"}),a}async function Zi(t,e,n,s,r){if(t._getRecaptchaConfig()?.isProviderEnabled("EMAIL_PASSWORD_PROVIDER")){const r=await Xi(t,e,n,"getOobCode"===n);return s(t,r)}return s(t,e).catch(async r=>{if("auth/missing-recaptcha-token"===r.code){const r=await Xi(t,e,n,"getOobCode"===n);return s(t,r)}return Promise.reject(r)})}function to(t,e,n){const s=ji(t);Ur(/^https?:\/\//.test(e),s,"invalid-emulator-scheme");const r=eo(e),{host:i,port:o}=function(t){const e=eo(t),n=/(\/\/)?([^?#/]+)/.exec(t.substr(e.length));if(!n)return{host:"",port:null};const s=n[2].split("@").pop()||"",r=/^(\[[^\]]+\])(:|$)/.exec(s);if(r){const t=r[1];return{host:t,port:no(s.substr(t.length+1))}}{const[t,e]=s.split(":");return{host:t,port:no(e)}}}(e),a=null===o?"":`:${o}`,B={url:`${r}//${i}${a}/`},c=Object.freeze({host:i,port:o,protocol:r.replace(":",""),options:Object.freeze({disableWarnings:!1})});if(!s._canInitEmulator)return Ur(s.config.emulator&&s.emulatorConfig,s,"emulator-config-failed"),void Ur($n(B,s.config.emulator)&&$n(c,s.emulatorConfig),s,"emulator-config-failed");s.config.emulator=B,s.emulatorConfig=c,s.settings.appVerificationDisabledForTesting=!0,Zn(i)?ts(`${r}//${i}${a}`):function(){function t(){const t=document.createElement("p"),e=t.style;t.innerText="Running in emulator mode. Do not use with production credentials.",e.position="fixed",e.width="100%",e.backgroundColor="#ffffff",e.border=".1em solid #000000",e.color="#b50000",e.bottom="0px",e.left="0px",e.margin="0px",e.zIndex="10000",e.textAlign="center",t.classList.add("firebase-emulator-warning"),document.body.appendChild(t)}"undefined"!=typeof console&&console.info;"undefined"!=typeof window&&"undefined"!=typeof document&&("loading"===document.readyState?window.addEventListener("DOMContentLoaded",t):t())}()}function eo(t){const e=t.indexOf(":");return e<0?"":t.substr(0,e+1)}function no(t){if(!t)return null;const e=Number(t);return isNaN(e)?null:e}Yi.scriptInjectionDeferred=null;class so{constructor(t,e){this.providerId=t,this.signInMethod=e}toJSON(){return Vr("not implemented")}_getIdTokenResponse(t){return Vr("not implemented")}_linkToIdToken(t,e){return Vr("not implemented")}_getReauthenticationResolver(t){return Vr("not implemented")}}async function ro(t,e){return ti(t,"POST","/v1/accounts:signUp",e)}async function io(t,e){return ni(t,"POST","/v1/accounts:signInWithPassword",Zr(t,e))}async function oo(t,e){return ti(t,"POST","/v1/accounts:sendOobCode",Zr(t,e))}async function ao(t,e){return oo(t,e)}class Bo extends so{constructor(t,e,n,s=null){super("password",n),this._email=t,this._password=e,this._tenantId=s}static _fromEmailAndPassword(t,e){return new Bo(t,e,"password")}static _fromEmailAndCode(t,e,n=null){return new Bo(t,e,"emailLink",n)}toJSON(){return{email:this._email,password:this._password,signInMethod:this.signInMethod,tenantId:this._tenantId}}static fromJSON(t){const e="string"==typeof t?JSON.parse(t):t;if(e?.email&&e?.password){if("password"===e.signInMethod)return this._fromEmailAndPassword(e.email,e.password);if("emailLink"===e.signInMethod)return this._fromEmailAndCode(e.email,e.password,e.tenantId)}return null}async _getIdTokenResponse(t){switch(this.signInMethod){case"password":return Zi(t,{returnSecureToken:!0,email:this._email,password:this._password,clientType:"CLIENT_TYPE_WEB"},"signInWithPassword",io);case"emailLink":return async function(t,e){return ni(t,"POST","/v1/accounts:signInWithEmailLink",Zr(t,e))}(t,{email:this._email,oobCode:this._password});default:Lr(t,"internal-error")}}async _linkToIdToken(t,e){switch(this.signInMethod){case"password":return Zi(t,{idToken:e,returnSecureToken:!0,email:this._email,password:this._password,clientType:"CLIENT_TYPE_WEB"},"signUpPassword",ro);case"emailLink":return async function(t,e){return ni(t,"POST","/v1/accounts:signInWithEmailLink",Zr(t,e))}(t,{idToken:e,email:this._email,oobCode:this._password});default:Lr(t,"internal-error")}}_getReauthenticationResolver(t){return this._getIdTokenResponse(t)}}async function co(t,e){return ni(t,"POST","/v1/accounts:signInWithIdp",Zr(t,e))}class lo extends so{constructor(){super(...arguments),this.pendingToken=null}static _fromParams(t){const e=new lo(t.providerId,t.signInMethod);return t.idToken||t.accessToken?(t.idToken&&(e.idToken=t.idToken),t.accessToken&&(e.accessToken=t.accessToken),t.nonce&&!t.pendingToken&&(e.nonce=t.nonce),t.pendingToken&&(e.pendingToken=t.pendingToken)):t.oauthToken&&t.oauthTokenSecret?(e.accessToken=t.oauthToken,e.secret=t.oauthTokenSecret):Lr("argument-error"),e}toJSON(){return{idToken:this.idToken,accessToken:this.accessToken,secret:this.secret,nonce:this.nonce,pendingToken:this.pendingToken,providerId:this.providerId,signInMethod:this.signInMethod}}static fromJSON(t){const e="string"==typeof t?JSON.parse(t):t,{providerId:n,signInMethod:s,...r}=e;if(!n||!s)return null;const i=new lo(n,s);return i.idToken=r.idToken||void 0,i.accessToken=r.accessToken||void 0,i.secret=r.secret,i.nonce=r.nonce,i.pendingToken=r.pendingToken||null,i}_getIdTokenResponse(t){return co(t,this.buildRequest())}_linkToIdToken(t,e){const n=this.buildRequest();return n.idToken=e,co(t,n)}_getReauthenticationResolver(t){const e=this.buildRequest();return e.autoCreate=!1,co(t,e)}buildRequest(){const t={requestUri:"http://localhost",returnSecureToken:!0};if(this.pendingToken)t.pendingToken=this.pendingToken;else{const e={};this.idToken&&(e.id_token=this.idToken),this.accessToken&&(e.access_token=this.accessToken),this.secret&&(e.oauth_token_secret=this.secret),e.providerId=this.providerId,this.nonce&&!this.pendingToken&&(e.nonce=this.nonce),t.postBody=qn(e)}return t}}class uo{constructor(t){const e=zn(Kn(t)),n=e.apiKey??null,s=e.oobCode??null,r=function(t){switch(t){case"recoverEmail":return"RECOVER_EMAIL";case"resetPassword":return"PASSWORD_RESET";case"signIn":return"EMAIL_SIGNIN";case"verifyEmail":return"VERIFY_EMAIL";case"verifyAndChangeEmail":return"VERIFY_AND_CHANGE_EMAIL";case"revertSecondFactorAddition":return"REVERT_SECOND_FACTOR_ADDITION";default:return null}}(e.mode??null);Ur(n&&s&&r,"argument-error"),this.apiKey=n,this.operation=r,this.code=s,this.continueUrl=e.continueUrl??null,this.languageCode=e.lang??null,this.tenantId=e.tenantId??null}static parseLink(t){const e=function(t){const e=zn(Kn(t)).link,n=e?zn(Kn(e)).deep_link_id:null,s=zn(Kn(t)).deep_link_id;return(s?zn(Kn(s)).link:null)||s||n||e||t}(t);try{return new uo(e)}catch{return null}}}class ho{constructor(){this.providerId=ho.PROVIDER_ID}static credential(t,e){return Bo._fromEmailAndPassword(t,e)}static credentialWithLink(t,e){const n=uo.parseLink(e);return Ur(n,"argument-error"),Bo._fromEmailAndCode(t,n.code,n.tenantId)}}ho.PROVIDER_ID="password",ho.EMAIL_PASSWORD_SIGN_IN_METHOD="password",ho.EMAIL_LINK_SIGN_IN_METHOD="emailLink";class po{constructor(t){this.providerId=t,this.defaultLanguageCode=null,this.customParameters={}}setDefaultLanguage(t){this.defaultLanguageCode=t}setCustomParameters(t){return this.customParameters=t,this}getCustomParameters(){return this.customParameters}}class fo extends po{constructor(){super(...arguments),this.scopes=[]}addScope(t){return this.scopes.includes(t)||this.scopes.push(t),this}getScopes(){return[...this.scopes]}}class Co extends fo{constructor(){super("facebook.com")}static credential(t){return lo._fromParams({providerId:Co.PROVIDER_ID,signInMethod:Co.FACEBOOK_SIGN_IN_METHOD,accessToken:t})}static credentialFromResult(t){return Co.credentialFromTaggedObject(t)}static credentialFromError(t){return Co.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t||!("oauthAccessToken"in t))return null;if(!t.oauthAccessToken)return null;try{return Co.credential(t.oauthAccessToken)}catch{return null}}}Co.FACEBOOK_SIGN_IN_METHOD="facebook.com",Co.PROVIDER_ID="facebook.com";class go extends fo{constructor(){super("google.com"),this.addScope("profile")}static credential(t,e){return lo._fromParams({providerId:go.PROVIDER_ID,signInMethod:go.GOOGLE_SIGN_IN_METHOD,idToken:t,accessToken:e})}static credentialFromResult(t){return go.credentialFromTaggedObject(t)}static credentialFromError(t){return go.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t)return null;const{oauthIdToken:e,oauthAccessToken:n}=t;if(!e&&!n)return null;try{return go.credential(e,n)}catch{return null}}}go.GOOGLE_SIGN_IN_METHOD="google.com",go.PROVIDER_ID="google.com";class mo extends fo{constructor(){super("github.com")}static credential(t){return lo._fromParams({providerId:mo.PROVIDER_ID,signInMethod:mo.GITHUB_SIGN_IN_METHOD,accessToken:t})}static credentialFromResult(t){return mo.credentialFromTaggedObject(t)}static credentialFromError(t){return mo.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t||!("oauthAccessToken"in t))return null;if(!t.oauthAccessToken)return null;try{return mo.credential(t.oauthAccessToken)}catch{return null}}}mo.GITHUB_SIGN_IN_METHOD="github.com",mo.PROVIDER_ID="github.com";class wo extends fo{constructor(){super("twitter.com")}static credential(t,e){return lo._fromParams({providerId:wo.PROVIDER_ID,signInMethod:wo.TWITTER_SIGN_IN_METHOD,oauthToken:t,oauthTokenSecret:e})}static credentialFromResult(t){return wo.credentialFromTaggedObject(t)}static credentialFromError(t){return wo.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t)return null;const{oauthAccessToken:e,oauthTokenSecret:n}=t;if(!e||!n)return null;try{return wo.credential(e,n)}catch{return null}}}async function yo(t,e){return ni(t,"POST","/v1/accounts:signUp",Zr(t,e))}wo.TWITTER_SIGN_IN_METHOD="twitter.com",wo.PROVIDER_ID="twitter.com";class Eo{constructor(t){this.user=t.user,this.providerId=t.providerId,this._tokenResponse=t._tokenResponse,this.operationType=t.operationType}static async _fromIdTokenResponse(t,e,n,s=!1){const r=await Ei._fromIdTokenResponse(t,n,s),i=_o(n);return new Eo({user:r,providerId:i,_tokenResponse:n,operationType:e})}static async _forOperation(t,e,n){await t._updateTokensIfNecessary(n,!0);const s=_o(n);return new Eo({user:t,providerId:s,_tokenResponse:n,operationType:e})}}function _o(t){return t.providerId?t.providerId:"phoneNumber"in t?"phone":null}class Do extends Vn{constructor(t,e,n,s){super(e.code,e.message),this.operationType=n,this.user=s,Object.setPrototypeOf(this,Do.prototype),this.customData={appName:t.name,tenantId:t.tenantId??void 0,_serverResponse:e.customData._serverResponse,operationType:n}}static _fromErrorAndOperation(t,e,n,s){return new Do(t,e,n,s)}}function bo(t,e,n,s){return("reauthenticate"===e?n._getReauthenticationResolver(t):n._getIdTokenResponse(t)).catch(n=>{if("auth/multi-factor-auth-required"===n.code)throw Do._fromErrorAndOperation(t,n,e,s);throw n})}async function vo(t,e,n=!1){const{auth:s}=t;if(hr(s.app))return Promise.reject(Mr(s));const r="reauthenticate";try{const i=await pi(t,bo(s,r,e,t),n);Ur(i.idToken,s,"internal-error");const o=hi(i.idToken);Ur(o,s,"internal-error");const{sub:a}=o;return Ur(t.uid===a,s,"user-mismatch"),Eo._forOperation(t,r,i)}catch(t){throw"auth/user-not-found"===t?.code&&Lr(s,"user-mismatch"),t}}async function Io(t,e,n=!1){if(hr(t.app))return Promise.reject(Mr(t));const s="signIn",r=await bo(t,s,e),i=await Eo._fromIdTokenResponse(t,s,r);return n||await t._updateCurrentUser(i.user),i}function To(t,e,n){Ur(n.url?.length>0,t,"invalid-continue-uri"),Ur(void 0===n.dynamicLinkDomain||n.dynamicLinkDomain.length>0,t,"invalid-dynamic-link-domain"),Ur(void 0===n.linkDomain||n.linkDomain.length>0,t,"invalid-hosting-link-domain"),e.continueUrl=n.url,e.dynamicLinkDomain=n.dynamicLinkDomain,e.linkDomain=n.linkDomain,e.canHandleCodeInApp=n.handleCodeInApp,n.iOS&&(Ur(n.iOS.bundleId.length>0,t,"missing-ios-bundle-id"),e.iOSBundleId=n.iOS.bundleId),n.android&&(Ur(n.android.packageName.length>0,t,"missing-android-pkg-name"),e.androidInstallApp=n.android.installApp,e.androidMinimumVersionCode=n.android.minimumVersion,e.androidPackageName=n.android.packageName)}async function Oo(t){const e=ji(t);e._getPasswordPolicyInternal()&&await e._updatePasswordPolicy()}async function Ao(t,e,n){const s=ji(t),r={requestType:"PASSWORD_RESET",email:e,clientType:"CLIENT_TYPE_WEB"};await Zi(s,r,"getOobCode",ao)}function So(t,e,n){return hr(t.app)?Promise.reject(Mr(t)):async function(t,e){return Io(ji(t),e)}(Xn(t),ho.credential(e,n)).catch(async e=>{throw"auth/password-does-not-meet-requirements"===e.code&&Oo(t),e})}async function Ro(t,e){const n=Xn(t),s={requestType:"VERIFY_EMAIL",idToken:await t.getIdToken()};e&&To(n.auth,s,e);const{email:r}=await async function(t,e){return oo(t,e)}(n.auth,s);r!==t.email&&await t.reload()}async function No(t,e,n){const s=Xn(t),r={requestType:"VERIFY_AND_CHANGE_EMAIL",idToken:await t.getIdToken(),newEmail:e};n&&To(s.auth,r,n);const{email:i}=await async function(t,e){return oo(t,e)}(s.auth,r);i!==t.email&&await t.reload()}async function xo(t,e){const{displayName:n,photoURL:s}=e;if(void 0===n&&void 0===s)return;const r=Xn(t),i={idToken:await r.getIdToken(),displayName:n,photoUrl:s,returnSecureToken:!0},o=await pi(r,async function(t,e){return ti(t,"POST","/v1/accounts:update",e)}(r.auth,i));r.displayName=o.displayName||null,r.photoURL=o.photoUrl||null;const a=r.providerData.find(({providerId:t})=>"password"===t);a&&(a.displayName=r.displayName,a.photoURL=r.photoURL),await r._updateTokensIfNecessary(o)}function ko(t,e){return async function(t,e,n){const{auth:s}=t,r=await t.getIdToken(),i={idToken:r,returnSecureToken:!0};n&&(i.password=n);const o=await pi(t,async function(t,e){return ti(t,"POST","/v1/accounts:update",e)}(s,i));await t._updateTokensIfNecessary(o,!0)}(Xn(t),0,e)}function Lo(t,e,n,s){return Xn(t).onAuthStateChanged(e,n,s)}const Fo="__sak";class Po{constructor(t,e){this.storageRetriever=t,this.type=e}_isAvailable(){try{return this.storage?(this.storage.setItem(Fo,"1"),this.storage.removeItem(Fo),Promise.resolve(!0)):Promise.resolve(!1)}catch{return Promise.resolve(!1)}}_set(t,e){return this.storage.setItem(t,JSON.stringify(e)),Promise.resolve()}_get(t){const e=this.storage.getItem(t);return Promise.resolve(e?JSON.parse(e):null)}_remove(t){return this.storage.removeItem(t),Promise.resolve()}get storage(){return this.storageRetriever()}}class Mo extends Po{constructor(){super(()=>window.localStorage,"LOCAL"),this.boundEventHandler=(t,e)=>this.onStorageEvent(t,e),this.listeners={},this.localCache={},this.pollTimer=null,this.fallbackToPolling=Mi(),this._shouldAllowMigration=!0}forAllChangedKeys(t){for(const e of Object.keys(this.listeners)){const n=this.storage.getItem(e),s=this.localCache[e];n!==s&&t(e,s,n)}}onStorageEvent(t,e=!1){if(!t.key)return void this.forAllChangedKeys((t,e,n)=>{this.notifyListeners(t,n)});const n=t.key;e?this.detachListener():this.stopPolling();const s=()=>{const t=this.storage.getItem(n);(e||this.localCache[n]!==t)&&this.notifyListeners(n,t)},r=this.storage.getItem(n);Pi()&&r!==t.newValue&&t.newValue!==t.oldValue?setTimeout(s,10):s()}notifyListeners(t,e){this.localCache[t]=e;const n=this.listeners[t];if(n)for(const t of Array.from(n))t(e?JSON.parse(e):e)}startPolling(){this.stopPolling(),this.pollTimer=setInterval(()=>{this.forAllChangedKeys((t,e,n)=>{this.onStorageEvent(new StorageEvent("storage",{key:t,oldValue:e,newValue:n}),!0)})},1e3)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}attachListener(){window.addEventListener("storage",this.boundEventHandler)}detachListener(){window.removeEventListener("storage",this.boundEventHandler)}_addListener(t,e){0===Object.keys(this.listeners).length&&(this.fallbackToPolling?this.startPolling():this.attachListener()),this.listeners[t]||(this.listeners[t]=new Set,this.localCache[t]=this.storage.getItem(t)),this.listeners[t].add(e)}_removeListener(t,e){this.listeners[t]&&(this.listeners[t].delete(e),0===this.listeners[t].size&&delete this.listeners[t]),0===Object.keys(this.listeners).length&&(this.detachListener(),this.stopPolling())}async _set(t,e){await super._set(t,e),this.localCache[t]=JSON.stringify(e)}async _get(t){const e=await super._get(t);return this.localCache[t]=JSON.stringify(e),e}async _remove(t){await super._remove(t),delete this.localCache[t]}}Mo.type="LOCAL";const Go=Mo;class Ho extends Po{constructor(){super(()=>window.sessionStorage,"SESSION")}_addListener(t,e){}_removeListener(t,e){}}Ho.type="SESSION";const Uo=Ho;class Vo{constructor(t){this.eventTarget=t,this.handlersMap={},this.boundEventHandler=this.handleEvent.bind(this)}static _getInstance(t){const e=this.receivers.find(e=>e.isListeningto(t));if(e)return e;const n=new Vo(t);return this.receivers.push(n),n}isListeningto(t){return this.eventTarget===t}async handleEvent(t){const e=t,{eventId:n,eventType:s,data:r}=e.data,i=this.handlersMap[s];if(!i?.size)return;e.ports[0].postMessage({status:"ack",eventId:n,eventType:s});const o=Array.from(i).map(async t=>t(e.origin,r)),a=await function(t){return Promise.all(t.map(async t=>{try{return{fulfilled:!0,value:await t}}catch(t){return{fulfilled:!1,reason:t}}}))}(o);e.ports[0].postMessage({status:"done",eventId:n,eventType:s,response:a})}_subscribe(t,e){0===Object.keys(this.handlersMap).length&&this.eventTarget.addEventListener("message",this.boundEventHandler),this.handlersMap[t]||(this.handlersMap[t]=new Set),this.handlersMap[t].add(e)}_unsubscribe(t,e){this.handlersMap[t]&&e&&this.handlersMap[t].delete(e),e&&0!==this.handlersMap[t].size||delete this.handlersMap[t],0===Object.keys(this.handlersMap).length&&this.eventTarget.removeEventListener("message",this.boundEventHandler)}}function jo(t="",e=10){let n="";for(let t=0;t<e;t++)n+=Math.floor(10*Math.random());return t+n}Vo.receivers=[];class $o{constructor(t){this.target=t,this.handlers=new Set}removeMessageHandler(t){t.messageChannel&&(t.messageChannel.port1.removeEventListener("message",t.onMessage),t.messageChannel.port1.close()),this.handlers.delete(t)}async _send(t,e,n=50){const s="undefined"!=typeof MessageChannel?new MessageChannel:null;if(!s)throw new Error("connection_unavailable");let r,i;return new Promise((o,a)=>{const B=jo("",20);s.port1.start();const c=setTimeout(()=>{a(new Error("unsupported_event"))},n);i={messageChannel:s,onMessage(t){const e=t;if(e.data.eventId===B)switch(e.data.status){case"ack":clearTimeout(c),r=setTimeout(()=>{a(new Error("timeout"))},3e3);break;case"done":clearTimeout(r),o(e.data.response);break;default:clearTimeout(c),clearTimeout(r),a(new Error("invalid_response"))}}},this.handlers.add(i),s.port1.addEventListener("message",i.onMessage),this.target.postMessage({eventType:t,eventId:B,data:e},[s.port2])}).finally(()=>{i&&this.removeMessageHandler(i)})}}function Jo(){return window}function qo(){return void 0!==Jo().WorkerGlobalScope&&"function"==typeof Jo().importScripts}const zo="firebaseLocalStorageDb",Ko="firebaseLocalStorage",Qo="fbase_key";class Wo{constructor(t){this.request=t}toPromise(){return new Promise((t,e)=>{this.request.addEventListener("success",()=>{t(this.request.result)}),this.request.addEventListener("error",()=>{e(this.request.error)})})}}function Yo(t,e){return t.transaction([Ko],e?"readwrite":"readonly").objectStore(Ko)}function Xo(){const t=indexedDB.open(zo,1);return new Promise((e,n)=>{t.addEventListener("error",()=>{n(t.error)}),t.addEventListener("upgradeneeded",()=>{const e=t.result;try{e.createObjectStore(Ko,{keyPath:Qo})}catch(t){n(t)}}),t.addEventListener("success",async()=>{const n=t.result;n.objectStoreNames.contains(Ko)?e(n):(n.close(),await function(){const t=indexedDB.deleteDatabase(zo);return new Wo(t).toPromise()}(),e(await Xo()))})})}async function Zo(t,e,n){const s=Yo(t,!0).put({[Qo]:e,value:n});return new Wo(s).toPromise()}function ta(t,e){const n=Yo(t,!0).delete(e);return new Wo(n).toPromise()}class ea{registerLifecycleListeners(){"undefined"!=typeof window&&"function"==typeof window.addEventListener&&(window.addEventListener("pagehide",this.onPageHide),window.addEventListener("pageshow",this.onPageShow))}unregisterLifecycleListeners(){"undefined"!=typeof window&&"function"==typeof window.removeEventListener&&(window.removeEventListener("pagehide",this.onPageHide),window.removeEventListener("pageshow",this.onPageShow))}constructor(){this.type="LOCAL",this.dbPromise=null,this._shouldAllowMigration=!0,this.listeners={},this.localCache={},this.pollTimer=null,this.isClosing=!1,this.pendingWrites=0,this.receiver=null,this.sender=null,this.serviceWorkerReceiverAvailable=!1,this.activeServiceWorker=null,this.onPageHide=()=>{this.isClosing=!0,this.stopPolling(),this.dbPromise&&(this.dbPromise.then(t=>t.close()).catch(()=>{}),this.dbPromise=null)},this.onPageShow=()=>{this.isClosing&&(this.isClosing=!1,Object.keys(this.listeners).length>0&&this.startPolling())},this._workerInitializationPromise=this.initializeServiceWorkerMessaging().then(()=>{},()=>{})}async _openDb(){return this.dbPromise||(this.dbPromise=Xo(),this.dbPromise.catch(()=>{this.dbPromise=null})),this.dbPromise}async _withRetries(t){let e=0;for(;;)try{const e=await this._openDb();return await t(e)}catch(t){if(e++>3)throw t;if(this.dbPromise){const t=this.dbPromise;this.dbPromise=null;try{(await t).close()}catch{}}}}async initializeServiceWorkerMessaging(){return qo()?this.initializeReceiver():this.initializeSender()}async initializeReceiver(){this.receiver=Vo._getInstance(qo()?self:null),this.receiver._subscribe("keyChanged",async(t,e)=>({keyProcessed:(await this._poll()).includes(e.key)})),this.receiver._subscribe("ping",async(t,e)=>["keyChanged"])}async initializeSender(){if(this.activeServiceWorker=await async function(){if(!navigator?.serviceWorker)return null;try{return(await navigator.serviceWorker.ready).active}catch{return null}}(),!this.activeServiceWorker)return;this.sender=new $o(this.activeServiceWorker);const t=await this.sender._send("ping",{},800);t&&t[0]?.fulfilled&&t[0]?.value.includes("keyChanged")&&(this.serviceWorkerReceiverAvailable=!0)}async notifyServiceWorker(t){if(this.sender&&this.activeServiceWorker&&(navigator?.serviceWorker?.controller||null)===this.activeServiceWorker)try{await this.sender._send("keyChanged",{key:t},this.serviceWorkerReceiverAvailable?800:50)}catch{}}async _isAvailable(){try{return!!indexedDB&&(await this._withRetries(async t=>{await Zo(t,Fo,"1"),await ta(t,Fo)}),!0)}catch{}return!1}async _withPendingWrite(t){this.pendingWrites++;try{await t()}finally{this.pendingWrites--}}async _set(t,e){return this._withPendingWrite(async()=>(await this._withRetries(n=>Zo(n,t,e)),this.localCache[t]=e,this.notifyServiceWorker(t)))}async _get(t){const e=await this._withRetries(e=>async function(t,e){const n=Yo(t,!1).get(e),s=await new Wo(n).toPromise();return void 0===s?null:s.value}(e,t));return this.localCache[t]=e,e}async _remove(t){return this._withPendingWrite(async()=>(await this._withRetries(e=>ta(e,t)),delete this.localCache[t],this.notifyServiceWorker(t)))}async _poll(){if(this.isClosing)return[];try{const t=await this._withRetries(t=>{const e=Yo(t,!1).getAll();return new Wo(e).toPromise()});if(this.isClosing)return[];if(!t)return[];if(0!==this.pendingWrites)return[];const e=[],n=new Set;if(0!==t.length)for(const{fbase_key:s,value:r}of t)n.add(s),JSON.stringify(this.localCache[s])!==JSON.stringify(r)&&(this.notifyListeners(s,r),e.push(s));for(const t of Object.keys(this.localCache))this.localCache[t]&&!n.has(t)&&(this.notifyListeners(t,null),e.push(t));return e}catch(t){return this.isClosing||xr(`Firebase Auth cross-tab polling failed with error: ${t}`),[]}}notifyListeners(t,e){this.localCache[t]=e;const n=this.listeners[t];if(n)for(const t of Array.from(n))t(e)}startPolling(){this.stopPolling(),this.pollTimer=setInterval(async()=>this._poll(),800)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}_addListener(t,e){0===Object.keys(this.listeners).length&&(this.startPolling(),this.registerLifecycleListeners()),this.listeners[t]||(this.listeners[t]=new Set,this._get(t)),this.listeners[t].add(e)}_removeListener(t,e){this.listeners[t]&&(this.listeners[t].delete(e),0===this.listeners[t].size&&delete this.listeners[t]),0===Object.keys(this.listeners).length&&(this.stopPolling(),this.unregisterLifecycleListeners())}}ea.type="LOCAL";const na=ea;function sa(t,e){return e?Di(e):(Ur(t._popupRedirectResolver,t,"argument-error"),t._popupRedirectResolver)}new zr(3e4,6e4);class ra extends so{constructor(t){super("custom","custom"),this.params=t}_getIdTokenResponse(t){return co(t,this._buildIdpRequest())}_linkToIdToken(t,e){return co(t,this._buildIdpRequest(e))}_getReauthenticationResolver(t){return co(t,this._buildIdpRequest())}_buildIdpRequest(t){const e={requestUri:this.params.requestUri,sessionId:this.params.sessionId,postBody:this.params.postBody,tenantId:this.params.tenantId,pendingToken:this.params.pendingToken,returnSecureToken:!0,returnIdpCredential:!0};return t&&(e.idToken=t),e}}function ia(t){return Io(t.auth,new ra(t),t.bypassAuthState)}function oa(t){const{auth:e,user:n}=t;return Ur(n,e,"internal-error"),vo(n,new ra(t),t.bypassAuthState)}async function aa(t){const{auth:e,user:n}=t;return Ur(n,e,"internal-error"),async function(t,e,n=!1){const s=await pi(t,e._linkToIdToken(t.auth,await t.getIdToken()),n);return Eo._forOperation(t,"link",s)}(n,new ra(t),t.bypassAuthState)}class Ba{constructor(t,e,n,s,r=!1){this.auth=t,this.resolver=n,this.user=s,this.bypassAuthState=r,this.pendingPromise=null,this.eventManager=null,this.filter=Array.isArray(e)?e:[e]}execute(){return new Promise(async(t,e)=>{this.pendingPromise={resolve:t,reject:e};try{this.eventManager=await this.resolver._initialize(this.auth),await this.onExecution(),this.eventManager.registerConsumer(this)}catch(t){this.reject(t)}})}async onAuthEvent(t){const{urlResponse:e,sessionId:n,postBody:s,tenantId:r,error:i,type:o}=t;if(i)return void this.reject(i);const a={auth:this.auth,requestUri:e,sessionId:n,tenantId:r||void 0,postBody:s||void 0,user:this.user,bypassAuthState:this.bypassAuthState};try{this.resolve(await this.getIdpTask(o)(a))}catch(t){this.reject(t)}}onError(t){this.reject(t)}getIdpTask(t){switch(t){case"signInViaPopup":case"signInViaRedirect":return ia;case"linkViaPopup":case"linkViaRedirect":return aa;case"reauthViaPopup":case"reauthViaRedirect":return oa;default:Lr(this.auth,"internal-error")}}resolve(t){jr(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.resolve(t),this.unregisterAndCleanUp()}reject(t){jr(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.reject(t),this.unregisterAndCleanUp()}unregisterAndCleanUp(){this.eventManager&&this.eventManager.unregisterConsumer(this),this.pendingPromise=null,this.cleanUp()}}const ca=new zr(2e3,1e4);class la extends Ba{constructor(t,e,n,s,r){super(t,e,s,r),this.provider=n,this.authWindow=null,this.pollId=null,la.currentPopupAction&&la.currentPopupAction.cancel(),la.currentPopupAction=this}async executeNotNull(){const t=await this.execute();return Ur(t,this.auth,"internal-error"),t}async onExecution(){jr(1===this.filter.length,"Popup operations only handle one event");const t=jo();this.authWindow=await this.resolver._openPopup(this.auth,this.provider,this.filter[0],t),this.authWindow.associatedEvent=t,this.resolver._originValidation(this.auth).catch(t=>{this.reject(t)}),this.resolver._isIframeWebStorageSupported(this.auth,t=>{t||this.reject(Fr(this.auth,"web-storage-unsupported"))}),this.pollUserCancellation()}get eventId(){return this.authWindow?.associatedEvent||null}cancel(){this.reject(Fr(this.auth,"cancelled-popup-request"))}cleanUp(){this.authWindow&&this.authWindow.close(),this.pollId&&window.clearTimeout(this.pollId),this.authWindow=null,this.pollId=null,la.currentPopupAction=null}pollUserCancellation(){const t=()=>{this.authWindow?.window?.closed?this.pollId=window.setTimeout(()=>{this.pollId=null,this.reject(Fr(this.auth,"popup-closed-by-user"))},8e3):this.pollId=window.setTimeout(t,ca.get())};t()}}la.currentPopupAction=null;const ua=new Map;class ha extends Ba{constructor(t,e,n=!1){super(t,["signInViaRedirect","linkViaRedirect","reauthViaRedirect","unknown"],e,void 0,n),this.eventId=null}async execute(){let t=ua.get(this.auth._key());if(!t){try{const e=await async function(t,e){const n=fa(e),s=pa(t);if(!await s._isAvailable())return!1;const r="true"===await s._get(n);return await s._remove(n),r}(this.resolver,this.auth),n=e?await super.execute():null;t=()=>Promise.resolve(n)}catch(e){t=()=>Promise.reject(e)}ua.set(this.auth._key(),t)}return this.bypassAuthState||ua.set(this.auth._key(),()=>Promise.resolve(null)),t()}async onAuthEvent(t){if("signInViaRedirect"===t.type)return super.onAuthEvent(t);if("unknown"!==t.type){if(t.eventId){const e=await this.auth._redirectUserForId(t.eventId);if(e)return this.user=e,super.onAuthEvent(t);this.resolve(null)}}else this.resolve(null)}async onExecution(){}cleanUp(){}}function da(t,e){ua.set(t._key(),e)}function pa(t){return Di(t._redirectPersistence)}function fa(t){return Ii("pendingRedirect",t.config.apiKey,t.name)}function Ca(t,e,n){return async function(t,e,n){if(hr(t.app))return Promise.reject(Mr(t));const s=ji(t);Gr(t,e,po),await s._initializationPromise;const r=sa(s,n);return await async function(t,e){return pa(t)._set(fa(e),"true")}(r,s),r._openRedirect(s,e,"signInViaRedirect")}(t,e,n)}async function ga(t,e,n=!1){if(hr(t.app))return Promise.reject(Mr(t));const s=ji(t),r=sa(s,e),i=new ha(s,r,n),o=await i.execute();return o&&!n&&(delete o.user._redirectEventId,await s._persistUserIfCurrent(o.user),await s._setRedirectUser(null,e)),o}class ma{constructor(t){this.auth=t,this.cachedEventUids=new Set,this.consumers=new Set,this.queuedRedirectEvent=null,this.hasHandledPotentialRedirect=!1,this.lastProcessedEventTime=Date.now()}registerConsumer(t){this.consumers.add(t),this.queuedRedirectEvent&&this.isEventForConsumer(this.queuedRedirectEvent,t)&&(this.sendToConsumer(this.queuedRedirectEvent,t),this.saveEventToCache(this.queuedRedirectEvent),this.queuedRedirectEvent=null)}unregisterConsumer(t){this.consumers.delete(t)}onEvent(t){if(this.hasEventBeenHandled(t))return!1;let e=!1;return this.consumers.forEach(n=>{this.isEventForConsumer(t,n)&&(e=!0,this.sendToConsumer(t,n),this.saveEventToCache(t))}),this.hasHandledPotentialRedirect||!function(t){switch(t.type){case"signInViaRedirect":case"linkViaRedirect":case"reauthViaRedirect":return!0;case"unknown":return ya(t);default:return!1}}(t)||(this.hasHandledPotentialRedirect=!0,e||(this.queuedRedirectEvent=t,e=!0)),e}sendToConsumer(t,e){if(t.error&&!ya(t)){const n=t.error.code?.split("auth/")[1]||"internal-error";e.onError(Fr(this.auth,n))}else e.onAuthEvent(t)}isEventForConsumer(t,e){const n=null===e.eventId||!!t.eventId&&t.eventId===e.eventId;return e.filter.includes(t.type)&&n}hasEventBeenHandled(t){return Date.now()-this.lastProcessedEventTime>=6e5&&this.cachedEventUids.clear(),this.cachedEventUids.has(wa(t))}saveEventToCache(t){this.cachedEventUids.add(wa(t)),this.lastProcessedEventTime=Date.now()}}function wa(t){return[t.type,t.eventId,t.sessionId,t.tenantId].filter(t=>t).join("-")}function ya({type:t,error:e}){return"unknown"===t&&"auth/no-auth-event"===e?.code}const Ea=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,_a=/^https?/;async function Da(t){if(t.config.emulator)return;const{authorizedDomains:e}=await async function(t,e={}){return ti(t,"GET","/v1/projects",e)}(t);for(const t of e)try{if(ba(t))return}catch{}Lr(t,"unauthorized-domain")}function ba(t){const e=$r(),{protocol:n,hostname:s}=new URL(e);if(t.startsWith("chrome-extension://")){const r=new URL(t);return""===r.hostname&&""===s?"chrome-extension:"===n&&t.replace("chrome-extension://","")===e.replace("chrome-extension://",""):"chrome-extension:"===n&&r.hostname===s}if(!_a.test(n))return!1;if(Ea.test(t))return s===t;const r=t.replace(/\./g,"\\.");return new RegExp("^(.+\\."+r+"|"+r+")$","i").test(s)}const va=new zr(3e4,6e4);function Ia(){const t=Jo().___jsl;if(t?.H)for(const e of Object.keys(t.H))if(t.H[e].r=t.H[e].r||[],t.H[e].L=t.H[e].L||[],t.H[e].r=[...t.H[e].L],t.CP)for(let e=0;e<t.CP.length;e++)t.CP[e]=null}function Ta(t){return new Promise((e,n)=>{function s(){Ia(),gapi.load("gapi.iframes",{callback:()=>{e(gapi.iframes.getContext())},ontimeout:()=>{Ia(),n(Fr(t,"network-request-failed"))},timeout:va.get()})}if(Jo().gapi?.iframes?.Iframe)e(gapi.iframes.getContext());else{if(!Jo().gapi?.load){const e=`__${"iframefcb"}${Math.floor(1e6*Math.random())}`;return Jo()[e]=()=>{gapi.load?s():n(Fr(t,"network-request-failed"))},qi(`${Ji.gapiScript}?onload=${e}`).catch(t=>n(t))}s()}}).catch(t=>{throw Oa=null,t})}let Oa=null;const Aa=new zr(5e3,15e3),Sa={style:{position:"absolute",top:"-100px",width:"1px",height:"1px"},"aria-hidden":"true",tabindex:"-1"},Ra=new Map([["identitytoolkit.googleapis.com","p"],["staging-identitytoolkit.sandbox.googleapis.com","s"],["test-identitytoolkit.sandbox.googleapis.com","t"]]);function Na(t){const e=t.config;Ur(e.authDomain,t,"auth-domain-config-required");const n=e.emulator?Kr(e,"emulator/auth/iframe"):`https://${t.config.authDomain}/__/auth/iframe`,s={apiKey:e.apiKey,appName:t.name,v:fr},r=Ra.get(t.config.apiHost);r&&(s.eid=r);const i=t._getFrameworks();return i.length&&(s.fw=i.join(",")),`${n}?${qn(s).slice(1)}`}async function xa(t){const e=await function(t){return Oa=Oa||Ta(t),Oa}(t),n=Jo().gapi;return Ur(n,t,"internal-error"),e.open({where:document.body,url:Na(t),messageHandlersFilter:n.iframes.CROSS_ORIGIN_IFRAMES_FILTER,attributes:Sa,dontclear:!0},e=>new Promise(async(n,s)=>{await e.restyle({setHideOnLeave:!1});const r=Fr(t,"network-request-failed"),i=Jo().setTimeout(()=>{s(r)},Aa.get());function o(){Jo().clearTimeout(i),n(e)}e.ping(o).then(o,()=>{s(r)})}))}const ka={location:"yes",resizable:"yes",statusbar:"yes",toolbar:"no"};class La{constructor(t){this.window=t,this.associatedEvent=null}close(){if(this.window)try{this.window.close()}catch(t){}}}function Fa(t,e,n,s=500,r=600){const i=Math.max((window.screen.availHeight-r)/2,0).toString(),o=Math.max((window.screen.availWidth-s)/2,0).toString();let a="";const B={...ka,width:s.toString(),height:r.toString(),top:i,left:o},c=Fn().toLowerCase();n&&(a=Ri(c)?"_blank":n),Ai(c)&&(e=e||"http://localhost",B.scrollbars="yes");const l=Object.entries(B).reduce((t,[e,n])=>`${t}${e}=${n},`,"");if(function(t=Fn()){return Fi(t)&&!!window.navigator?.standalone}(c)&&"_self"!==a)return function(t,e){const n=document.createElement("a");n.href=t,n.target=e;const s=document.createEvent("MouseEvent");s.initMouseEvent("click",!0,!0,window,1,0,0,0,0,!1,!1,!1,!1,1,null),n.dispatchEvent(s)}(e||"",a),new La(null);const u=window.open(e||"",a,l);Ur(u,t,"popup-blocked");try{u.focus()}catch(t){}return new La(u)}const Pa="__/auth/handler",Ma="emulator/auth/handler",Ga=encodeURIComponent("fac");async function Ha(t,e,n,s,r,i){Ur(t.config.authDomain,t,"auth-domain-config-required"),Ur(t.config.apiKey,t,"invalid-api-key");const o={apiKey:t.config.apiKey,appName:t.name,authType:n,redirectUrl:s,v:fr,eventId:r};if(e instanceof po){e.setDefaultLanguage(t.languageCode),o.providerId=e.providerId||"",function(t){for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e))return!1;return!0}(e.getCustomParameters())||(o.customParameters=JSON.stringify(e.getCustomParameters()));for(const[t,e]of Object.entries({}))o[t]=e}if(e instanceof fo){const t=e.getScopes().filter(t=>""!==t);t.length>0&&(o.scopes=t.join(","))}t.tenantId&&(o.tid=t.tenantId);const a=o;for(const t of Object.keys(a))void 0===a[t]&&delete a[t];const B=await t._getAppCheckToken(),c=B?`#${Ga}=${encodeURIComponent(B)}`:"";return`${function({config:t}){if(!t.emulator)return`https://${t.authDomain}/${Pa}`;return Kr(t,Ma)}(t)}?${qn(a).slice(1)}${c}`}const Ua="webStorageSupport";const Va=class{constructor(){this.eventManagers={},this.iframes={},this.originValidationPromises={},this._redirectPersistence=Uo,this._completeRedirectFn=ga,this._overrideRedirectResult=da}async _openPopup(t,e,n,s){jr(this.eventManagers[t._key()]?.manager,"_initialize() not called before _openPopup()");return Fa(t,await Ha(t,e,n,$r(),s),jo())}async _openRedirect(t,e,n,s){await this._originValidation(t);return function(t){Jo().location.href=t}(await Ha(t,e,n,$r(),s)),new Promise(()=>{})}_initialize(t){const e=t._key();if(this.eventManagers[e]){const{manager:t,promise:n}=this.eventManagers[e];return t?Promise.resolve(t):(jr(n,"If manager is not set, promise should be"),n)}const n=this.initAndGetManager(t);return this.eventManagers[e]={promise:n},n.catch(()=>{delete this.eventManagers[e]}),n}async initAndGetManager(t){const e=await xa(t),n=new ma(t);return e.register("authEvent",e=>{Ur(e?.authEvent,t,"invalid-auth-event");return{status:n.onEvent(e.authEvent)?"ACK":"ERROR"}},gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER),this.eventManagers[t._key()]={manager:n},this.iframes[t._key()]=e,n}_isIframeWebStorageSupported(t,e){this.iframes[t._key()].send(Ua,{type:Ua},n=>{const s=n?.[0]?.[Ua];void 0!==s&&e(!!s),Lr(t,"internal-error")},gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER)}_originValidation(t){const e=t._key();return this.originValidationPromises[e]||(this.originValidationPromises[e]=Da(t)),this.originValidationPromises[e]}get _shouldInitProactively(){return Mi()||Si()||Fi()}};var ja="@firebase/auth",$a="1.13.6";class Ja{constructor(t){this.auth=t,this.internalListeners=new Map}getUid(){return this.assertAuthConfigured(),this.auth.currentUser?.uid||null}async getToken(t){if(this.assertAuthConfigured(),await this.auth._initializationPromise,!this.auth.currentUser)return null;return{accessToken:await this.auth.currentUser.getIdToken(t)}}addAuthTokenListener(t){if(this.assertAuthConfigured(),this.internalListeners.has(t))return;const e=this.auth.onIdTokenChanged(e=>{t(e?.stsTokenManager.accessToken||null)});this.internalListeners.set(t,e),this.updateProactiveRefresh()}removeAuthTokenListener(t){this.assertAuthConfigured();const e=this.internalListeners.get(t);e&&(this.internalListeners.delete(t),e(),this.updateProactiveRefresh())}assertAuthConfigured(){Ur(this.auth._initializationPromise,"dependent-sdk-initialized-before-auth")}updateProactiveRefresh(){this.internalListeners.size>0?this.auth._startProactiveRefresh():this.auth._stopProactiveRefresh()}}const qa=xn("authIdTokenMaxAge")||300;let za=null;function Ka(t=gr()){const e=ur(t,"auth");if(e.isInitialized())return e.getImmediate();const n=function(t,e){const n=ur(t,"auth");if(n.isInitialized()){const t=n.getImmediate();if($n(n.getOptions(),e??{}))return t;Lr(t,"already-initialized")}return n.initialize({options:e})}(t,{popupRedirectResolver:Va,persistence:[na,Go,Uo]}),s=xn("authTokenSyncURL");if(s&&"boolean"==typeof isSecureContext&&isSecureContext){const t=new URL(s,location.origin);if(location.origin===t.origin){const e=(r=t.toString(),async t=>{const e=t&&await t.getIdTokenResult(),n=e&&((new Date).getTime()-Date.parse(e.issuedAtTime))/1e3;if(n&&n>qa)return;const s=e?.token;za!==s&&(za=s,await fetch(r,{method:s?"POST":"DELETE",headers:s?{Authorization:`Bearer ${s}`}:{}}))});!function(t,e,n){Xn(t).beforeAuthStateChanged(e,n)}(n,e,()=>e(n.currentUser)),function(t,e,n,s){Xn(t).onIdTokenChanged(e,n,s)}(n,t=>e(t))}}var r;const i=Sn("auth");return i&&to(n,`http://${i}`),n}var Qa;!function(t){Ji=t}({loadJS:t=>new Promise((e,n)=>{const s=document.createElement("script");s.setAttribute("src",t),s.onload=e,s.onerror=t=>{const e=Fr("internal-error");e.customData=t,n(e)},s.type="text/javascript",s.charset="UTF-8",(document.getElementsByTagName("head")?.[0]??document).appendChild(s)}),gapiScript:"https://apis.google.com/js/api.js",recaptchaV2Script:"https://www.google.com/recaptcha/api.js",recaptchaEnterpriseScript:"https://www.google.com/recaptcha/enterprise.js?render="}),Qa="Browser",lr(new es("auth",(t,{options:e})=>{const n=t.getProvider("app").getImmediate(),s=t.getProvider("heartbeat"),r=t.getProvider("app-check-internal"),{apiKey:i,authDomain:o}=n.options;Ur(i&&!i.includes(":"),"invalid-api-key",{appName:n.name});const a={apiKey:i,authDomain:o,clientPlatform:Qa,apiHost:"identitytoolkit.googleapis.com",tokenApiHost:"securetoken.googleapis.com",apiScheme:"https",sdkClientVersion:Gi(Qa)},B=new Vi(n,s,r,a);return function(t,e){const n=e?.persistence||[],s=(Array.isArray(n)?n:[n]).map(Di);e?.errorMap&&t._updateErrorMap(e.errorMap),t._initializeWithPersistence(s,e?.popupRedirectResolver)}(B,e),B},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((t,e,n)=>{t.getProvider("auth-internal").initialize()})),lr(new es("auth-internal",t=>(t=>new Ja(t))(ji(t.getProvider("auth").getImmediate())),"PRIVATE").setInstantiationMode("EXPLICIT")),mr(ja,$a,function(t){switch(t){case"Node":return"node";case"ReactNative":return"rn";case"Worker":return"webworker";case"Cordova":return"cordova";case"WebExtension":return"web-extension";default:return}}(Qa)),mr(ja,$a,"esm2020");mr("firebase","12.19.0","app");var Wa,Ya="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};(function(){var t;function e(){this.blockSize=-1,this.blockSize=64,this.g=Array(4),this.C=Array(this.blockSize),this.o=this.h=0,this.u()}function n(t,e,n){n||(n=0);const s=Array(16);if("string"==typeof e)for(var r=0;r<16;++r)s[r]=e.charCodeAt(n++)|e.charCodeAt(n++)<<8|e.charCodeAt(n++)<<16|e.charCodeAt(n++)<<24;else for(r=0;r<16;++r)s[r]=e[n++]|e[n++]<<8|e[n++]<<16|e[n++]<<24;e=t.g[0],n=t.g[1],r=t.g[2];let i,o=t.g[3];i=e+(o^n&(r^o))+s[0]+3614090360&4294967295,i=o+(r^(e=n+(i<<7&4294967295|i>>>25))&(n^r))+s[1]+3905402710&4294967295,o=e+(i<<12&4294967295|i>>>20),i=r+(n^o&(e^n))+s[2]+606105819&4294967295,i=n+(e^(r=o+(i<<17&4294967295|i>>>15))&(o^e))+s[3]+3250441966&4294967295,i=e+(o^(n=r+(i<<22&4294967295|i>>>10))&(r^o))+s[4]+4118548399&4294967295,i=o+(r^(e=n+(i<<7&4294967295|i>>>25))&(n^r))+s[5]+1200080426&4294967295,o=e+(i<<12&4294967295|i>>>20),i=r+(n^o&(e^n))+s[6]+2821735955&4294967295,i=n+(e^(r=o+(i<<17&4294967295|i>>>15))&(o^e))+s[7]+4249261313&4294967295,i=e+(o^(n=r+(i<<22&4294967295|i>>>10))&(r^o))+s[8]+1770035416&4294967295,i=o+(r^(e=n+(i<<7&4294967295|i>>>25))&(n^r))+s[9]+2336552879&4294967295,o=e+(i<<12&4294967295|i>>>20),i=r+(n^o&(e^n))+s[10]+4294925233&4294967295,i=n+(e^(r=o+(i<<17&4294967295|i>>>15))&(o^e))+s[11]+2304563134&4294967295,i=e+(o^(n=r+(i<<22&4294967295|i>>>10))&(r^o))+s[12]+1804603682&4294967295,i=o+(r^(e=n+(i<<7&4294967295|i>>>25))&(n^r))+s[13]+4254626195&4294967295,o=e+(i<<12&4294967295|i>>>20),i=r+(n^o&(e^n))+s[14]+2792965006&4294967295,i=n+(e^(r=o+(i<<17&4294967295|i>>>15))&(o^e))+s[15]+1236535329&4294967295,i=e+(r^o&((n=r+(i<<22&4294967295|i>>>10))^r))+s[1]+4129170786&4294967295,i=o+(n^r&((e=n+(i<<5&4294967295|i>>>27))^n))+s[6]+3225465664&4294967295,o=e+(i<<9&4294967295|i>>>23),i=r+(e^n&(o^e))+s[11]+643717713&4294967295,i=n+(o^e&((r=o+(i<<14&4294967295|i>>>18))^o))+s[0]+3921069994&4294967295,i=e+(r^o&((n=r+(i<<20&4294967295|i>>>12))^r))+s[5]+3593408605&4294967295,i=o+(n^r&((e=n+(i<<5&4294967295|i>>>27))^n))+s[10]+38016083&4294967295,o=e+(i<<9&4294967295|i>>>23),i=r+(e^n&(o^e))+s[15]+3634488961&4294967295,i=n+(o^e&((r=o+(i<<14&4294967295|i>>>18))^o))+s[4]+3889429448&4294967295,i=e+(r^o&((n=r+(i<<20&4294967295|i>>>12))^r))+s[9]+568446438&4294967295,i=o+(n^r&((e=n+(i<<5&4294967295|i>>>27))^n))+s[14]+3275163606&4294967295,o=e+(i<<9&4294967295|i>>>23),i=r+(e^n&(o^e))+s[3]+4107603335&4294967295,i=n+(o^e&((r=o+(i<<14&4294967295|i>>>18))^o))+s[8]+1163531501&4294967295,i=e+(r^o&((n=r+(i<<20&4294967295|i>>>12))^r))+s[13]+2850285829&4294967295,i=o+(n^r&((e=n+(i<<5&4294967295|i>>>27))^n))+s[2]+4243563512&4294967295,o=e+(i<<9&4294967295|i>>>23),i=r+(e^n&(o^e))+s[7]+1735328473&4294967295,i=n+(o^e&((r=o+(i<<14&4294967295|i>>>18))^o))+s[12]+2368359562&4294967295,i=e+((n=r+(i<<20&4294967295|i>>>12))^r^o)+s[5]+4294588738&4294967295,i=o+((e=n+(i<<4&4294967295|i>>>28))^n^r)+s[8]+2272392833&4294967295,o=e+(i<<11&4294967295|i>>>21),i=r+(o^e^n)+s[11]+1839030562&4294967295,i=n+((r=o+(i<<16&4294967295|i>>>16))^o^e)+s[14]+4259657740&4294967295,i=e+((n=r+(i<<23&4294967295|i>>>9))^r^o)+s[1]+2763975236&4294967295,i=o+((e=n+(i<<4&4294967295|i>>>28))^n^r)+s[4]+1272893353&4294967295,o=e+(i<<11&4294967295|i>>>21),i=r+(o^e^n)+s[7]+4139469664&4294967295,i=n+((r=o+(i<<16&4294967295|i>>>16))^o^e)+s[10]+3200236656&4294967295,i=e+((n=r+(i<<23&4294967295|i>>>9))^r^o)+s[13]+681279174&4294967295,i=o+((e=n+(i<<4&4294967295|i>>>28))^n^r)+s[0]+3936430074&4294967295,o=e+(i<<11&4294967295|i>>>21),i=r+(o^e^n)+s[3]+3572445317&4294967295,i=n+((r=o+(i<<16&4294967295|i>>>16))^o^e)+s[6]+76029189&4294967295,i=e+((n=r+(i<<23&4294967295|i>>>9))^r^o)+s[9]+3654602809&4294967295,i=o+((e=n+(i<<4&4294967295|i>>>28))^n^r)+s[12]+3873151461&4294967295,o=e+(i<<11&4294967295|i>>>21),i=r+(o^e^n)+s[15]+530742520&4294967295,i=n+((r=o+(i<<16&4294967295|i>>>16))^o^e)+s[2]+3299628645&4294967295,i=e+(r^((n=r+(i<<23&4294967295|i>>>9))|~o))+s[0]+4096336452&4294967295,i=o+(n^((e=n+(i<<6&4294967295|i>>>26))|~r))+s[7]+1126891415&4294967295,o=e+(i<<10&4294967295|i>>>22),i=r+(e^(o|~n))+s[14]+2878612391&4294967295,i=n+(o^((r=o+(i<<15&4294967295|i>>>17))|~e))+s[5]+4237533241&4294967295,i=e+(r^((n=r+(i<<21&4294967295|i>>>11))|~o))+s[12]+1700485571&4294967295,i=o+(n^((e=n+(i<<6&4294967295|i>>>26))|~r))+s[3]+2399980690&4294967295,o=e+(i<<10&4294967295|i>>>22),i=r+(e^(o|~n))+s[10]+4293915773&4294967295,i=n+(o^((r=o+(i<<15&4294967295|i>>>17))|~e))+s[1]+2240044497&4294967295,i=e+(r^((n=r+(i<<21&4294967295|i>>>11))|~o))+s[8]+1873313359&4294967295,i=o+(n^((e=n+(i<<6&4294967295|i>>>26))|~r))+s[15]+4264355552&4294967295,o=e+(i<<10&4294967295|i>>>22),i=r+(e^(o|~n))+s[6]+2734768916&4294967295,i=n+(o^((r=o+(i<<15&4294967295|i>>>17))|~e))+s[13]+1309151649&4294967295,i=e+(r^((n=r+(i<<21&4294967295|i>>>11))|~o))+s[4]+4149444226&4294967295,i=o+(n^((e=n+(i<<6&4294967295|i>>>26))|~r))+s[11]+3174756917&4294967295,o=e+(i<<10&4294967295|i>>>22),i=r+(e^(o|~n))+s[2]+718787259&4294967295,i=n+(o^((r=o+(i<<15&4294967295|i>>>17))|~e))+s[9]+3951481745&4294967295,t.g[0]=t.g[0]+e&4294967295,t.g[1]=t.g[1]+(r+(i<<21&4294967295|i>>>11))&4294967295,t.g[2]=t.g[2]+r&4294967295,t.g[3]=t.g[3]+o&4294967295}function s(t,e){this.h=e;const n=[];let s=!0;for(let r=t.length-1;r>=0;r--){const i=0|t[r];s&&i==e||(n[r]=i,s=!1)}this.g=n}!function(t,e){function n(){}n.prototype=e.prototype,t.F=e.prototype,t.prototype=new n,t.prototype.constructor=t,t.D=function(t,n,s){for(var r=Array(arguments.length-2),i=2;i<arguments.length;i++)r[i-2]=arguments[i];return e.prototype[n].apply(t,r)}}(e,function(){this.blockSize=-1}),e.prototype.u=function(){this.g[0]=1732584193,this.g[1]=4023233417,this.g[2]=2562383102,this.g[3]=271733878,this.o=this.h=0},e.prototype.v=function(t,e){void 0===e&&(e=t.length);const s=e-this.blockSize,r=this.C;let i=this.h,o=0;for(;o<e;){if(0==i)for(;o<=s;)n(this,t,o),o+=this.blockSize;if("string"==typeof t){for(;o<e;)if(r[i++]=t.charCodeAt(o++),i==this.blockSize){n(this,r),i=0;break}}else for(;o<e;)if(r[i++]=t[o++],i==this.blockSize){n(this,r),i=0;break}}this.h=i,this.o+=e},e.prototype.A=function(){var t=Array((this.h<56?this.blockSize:2*this.blockSize)-this.h);t[0]=128;for(var e=1;e<t.length-8;++e)t[e]=0;e=8*this.o;for(var n=t.length-8;n<t.length;++n)t[n]=255&e,e/=256;for(this.v(t),t=Array(16),e=0,n=0;n<4;++n)for(let s=0;s<32;s+=8)t[e++]=this.g[n]>>>s&255;return t};var r={};function i(t){return-128<=t&&t<128?function(t,e){var n=r;return Object.prototype.hasOwnProperty.call(n,t)?n[t]:n[t]=e(t)}(t,function(t){return new s([0|t],t<0?-1:0)}):new s([0|t],t<0?-1:0)}function o(t){if(isNaN(t)||!isFinite(t))return a;if(t<0)return h(o(-t));const e=[];let n=1;for(let s=0;t>=n;s++)e[s]=t/n|0,n*=4294967296;return new s(e,0)}var a=i(0),B=i(1),c=i(16777216);function l(t){if(0!=t.h)return!1;for(let e=0;e<t.g.length;e++)if(0!=t.g[e])return!1;return!0}function u(t){return-1==t.h}function h(t){const e=t.g.length,n=[];for(let s=0;s<e;s++)n[s]=~t.g[s];return new s(n,~t.h).add(B)}function d(t,e){return t.add(h(e))}function p(t,e){for(;(65535&t[e])!=t[e];)t[e+1]+=t[e]>>>16,t[e]&=65535,e++}function f(t,e){this.g=t,this.h=e}function C(t,e){if(l(e))throw Error("division by zero");if(l(t))return new f(a,a);if(u(t))return e=C(h(t),e),new f(h(e.g),h(e.h));if(u(e))return e=C(t,h(e)),new f(h(e.g),e.h);if(t.g.length>30){if(u(t)||u(e))throw Error("slowDivide_ only works with positive integers.");for(var n=B,s=e;s.l(t)<=0;)n=g(n),s=g(s);var r=m(n,1),i=m(s,1);for(s=m(s,2),n=m(n,2);!l(s);){var c=i.add(s);c.l(t)<=0&&(r=r.add(n),i=c),s=m(s,1),n=m(n,1)}return e=d(t,r.j(e)),new f(r,e)}for(r=a;t.l(e)>=0;){for(n=Math.max(1,Math.floor(t.m()/e.m())),s=(s=Math.ceil(Math.log(n)/Math.LN2))<=48?1:Math.pow(2,s-48),c=(i=o(n)).j(e);u(c)||c.l(t)>0;)c=(i=o(n-=s)).j(e);l(i)&&(i=B),r=r.add(i),t=d(t,c)}return new f(r,t)}function g(t){const e=t.g.length+1,n=[];for(let s=0;s<e;s++)n[s]=t.i(s)<<1|t.i(s-1)>>>31;return new s(n,t.h)}function m(t,e){const n=e>>5;e%=32;const r=t.g.length-n,i=[];for(let s=0;s<r;s++)i[s]=e>0?t.i(s+n)>>>e|t.i(s+n+1)<<32-e:t.i(s+n);return new s(i,t.h)}(t=s.prototype).m=function(){if(u(this))return-h(this).m();let t=0,e=1;for(let n=0;n<this.g.length;n++){const s=this.i(n);t+=(s>=0?s:4294967296+s)*e,e*=4294967296}return t},t.toString=function(t){if((t=t||10)<2||36<t)throw Error("radix out of range: "+t);if(l(this))return"0";if(u(this))return"-"+h(this).toString(t);const e=o(Math.pow(t,6));var n=this;let s="";for(;;){const r=C(n,e).g;let i=(((n=d(n,r.j(e))).g.length>0?n.g[0]:n.h)>>>0).toString(t);if(l(n=r))return i+s;for(;i.length<6;)i="0"+i;s=i+s}},t.i=function(t){return t<0?0:t<this.g.length?this.g[t]:this.h},t.l=function(t){return u(t=d(this,t))?-1:l(t)?0:1},t.abs=function(){return u(this)?h(this):this},t.add=function(t){const e=Math.max(this.g.length,t.g.length),n=[];let r=0;for(let s=0;s<=e;s++){let e=r+(65535&this.i(s))+(65535&t.i(s)),i=(e>>>16)+(this.i(s)>>>16)+(t.i(s)>>>16);r=i>>>16,e&=65535,i&=65535,n[s]=i<<16|e}return new s(n,-2147483648&n[n.length-1]?-1:0)},t.j=function(t){if(l(this)||l(t))return a;if(u(this))return u(t)?h(this).j(h(t)):h(h(this).j(t));if(u(t))return h(this.j(h(t)));if(this.l(c)<0&&t.l(c)<0)return o(this.m()*t.m());const e=this.g.length+t.g.length,n=[];for(var r=0;r<2*e;r++)n[r]=0;for(r=0;r<this.g.length;r++)for(let e=0;e<t.g.length;e++){const s=this.i(r)>>>16,i=65535&this.i(r),o=t.i(e)>>>16,a=65535&t.i(e);n[2*r+2*e]+=i*a,p(n,2*r+2*e),n[2*r+2*e+1]+=s*a,p(n,2*r+2*e+1),n[2*r+2*e+1]+=i*o,p(n,2*r+2*e+1),n[2*r+2*e+2]+=s*o,p(n,2*r+2*e+2)}for(t=0;t<e;t++)n[t]=n[2*t+1]<<16|n[2*t];for(t=e;t<2*e;t++)n[t]=0;return new s(n,0)},t.B=function(t){return C(this,t).h},t.and=function(t){const e=Math.max(this.g.length,t.g.length),n=[];for(let s=0;s<e;s++)n[s]=this.i(s)&t.i(s);return new s(n,this.h&t.h)},t.or=function(t){const e=Math.max(this.g.length,t.g.length),n=[];for(let s=0;s<e;s++)n[s]=this.i(s)|t.i(s);return new s(n,this.h|t.h)},t.xor=function(t){const e=Math.max(this.g.length,t.g.length),n=[];for(let s=0;s<e;s++)n[s]=this.i(s)^t.i(s);return new s(n,this.h^t.h)},e.prototype.digest=e.prototype.A,e.prototype.reset=e.prototype.u,e.prototype.update=e.prototype.v,s.prototype.add=s.prototype.add,s.prototype.multiply=s.prototype.j,s.prototype.modulo=s.prototype.B,s.prototype.compare=s.prototype.l,s.prototype.toNumber=s.prototype.m,s.prototype.toString=s.prototype.toString,s.prototype.getBits=s.prototype.i,s.fromNumber=o,s.fromString=function t(e,n){if(0==e.length)throw Error("number format error: empty string");if((n=n||10)<2||36<n)throw Error("radix out of range: "+n);if("-"==e.charAt(0))return h(t(e.substring(1),n));if(e.indexOf("-")>=0)throw Error('number format error: interior "-" character');const s=o(Math.pow(n,8));let r=a;for(let t=0;t<e.length;t+=8){var i=Math.min(8,e.length-t);const a=parseInt(e.substring(t,t+i),n);i<8?(i=o(Math.pow(n,i)),r=r.j(i).add(o(a))):(r=r.j(s),r=r.add(o(a)))}return r},Wa=s}).apply(void 0!==Ya?Ya:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{});var Xa,Za,tB,eB,nB,sB,rB,iB,oB="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};(function(){var t,e=Object.defineProperty;var n=function(t){t=["object"==typeof globalThis&&globalThis,t,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof oB&&oB];for(var e=0;e<t.length;++e){var n=t[e];if(n&&n.Math==Math)return n}throw Error("Cannot find global object")}(this);function s(t,s){if(s)t:{var r=n;t=t.split(".");for(var i=0;i<t.length-1;i++){var o=t[i];if(!(o in r))break t;r=r[o]}(s=s(i=r[t=t[t.length-1]]))!=i&&null!=s&&e(r,t,{configurable:!0,writable:!0,value:s})}}s("Symbol.dispose",function(t){return t||Symbol("Symbol.dispose")}),s("Array.prototype.values",function(t){return t||function(){return this[Symbol.iterator]()}}),s("Object.entries",function(t){return t||function(t){var e,n=[];for(e in t)Object.prototype.hasOwnProperty.call(t,e)&&n.push([e,t[e]]);return n}});var r=r||{},i=this||self;function o(t){var e=typeof t;return"object"==e&&null!=t||"function"==e}function a(t,e,n){return t.call.apply(t.bind,arguments)}function B(t,e,n){return(B=a).apply(null,arguments)}function c(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 l(t,e){function n(){}n.prototype=e.prototype,t.Z=e.prototype,t.prototype=new n,t.prototype.constructor=t,t.Ob=function(t,n,s){for(var r=Array(arguments.length-2),i=2;i<arguments.length;i++)r[i-2]=arguments[i];return e.prototype[n].apply(t,r)}}var u="undefined"!=typeof AsyncContext&&"function"==typeof AsyncContext.Snapshot?t=>t&&AsyncContext.Snapshot.wrap(t):t=>t;function h(t){const e=t.length;if(e>0){const n=Array(e);for(let s=0;s<e;s++)n[s]=t[s];return n}return[]}function d(t,e){for(let e=1;e<arguments.length;e++){const s=arguments[e];var n=typeof s;if("array"==(n="object"!=n?n:s?Array.isArray(s)?"array":n:"null")||"object"==n&&"number"==typeof s.length){n=t.length||0;const e=s.length||0;t.length=n+e;for(let r=0;r<e;r++)t[n+r]=s[r]}else t.push(s)}}function p(t){i.setTimeout(()=>{throw t},0)}function f(){var t=y;let e=null;return t.g&&(e=t.g,t.g=t.g.next,t.g||(t.h=null),e.next=null),e}var C=new class{constructor(t,e){this.i=t,this.j=e,this.h=0,this.g=null}get(){let t;return this.h>0?(this.h--,t=this.g,this.g=t.next,t.next=null):t=this.i(),t}}(()=>new g,t=>t.reset());class g{constructor(){this.next=this.g=this.h=null}set(t,e){this.h=t,this.g=e,this.next=null}reset(){this.next=this.g=this.h=null}}let m,w=!1,y=new class{constructor(){this.h=this.g=null}add(t,e){const n=C.get();n.set(t,e),this.h?this.h.next=n:this.g=n,this.h=n}},E=()=>{const t=Promise.resolve(void 0);m=()=>{t.then(_)}};function _(){for(var t;t=f();){try{t.h.call(t.g)}catch(t){p(t)}var e=C;e.j(t),e.h<100&&(e.h++,t.next=e.g,e.g=t)}w=!1}function D(){this.u=this.u,this.C=this.C}function b(t,e){this.type=t,this.g=this.target=e,this.defaultPrevented=!1}D.prototype.u=!1,D.prototype.dispose=function(){this.u||(this.u=!0,this.N())},D.prototype[Symbol.dispose]=function(){this.dispose()},D.prototype.N=function(){if(this.C)for(;this.C.length;)this.C.shift()()},b.prototype.h=function(){this.defaultPrevented=!0};var v=function(){if(!i.addEventListener||!Object.defineProperty)return!1;var t=!1,e=Object.defineProperty({},"passive",{get:function(){t=!0}});try{const t=()=>{};i.addEventListener("test",t,e),i.removeEventListener("test",t,e)}catch(t){}return t}();function I(t){return/^[\s\xa0]*$/.test(t)}function T(t,e){b.call(this,t?t.type:""),this.relatedTarget=this.g=this.target=null,this.button=this.screenY=this.screenX=this.clientY=this.clientX=0,this.key="",this.metaKey=this.shiftKey=this.altKey=this.ctrlKey=!1,this.state=null,this.pointerId=0,this.pointerType="",this.i=null,t&&this.init(t,e)}l(T,b),T.prototype.init=function(t,e){const n=this.type=t.type,s=t.changedTouches&&t.changedTouches.length?t.changedTouches[0]:null;this.target=t.target||t.srcElement,this.g=e,(e=t.relatedTarget)||("mouseover"==n?e=t.fromElement:"mouseout"==n&&(e=t.toElement)),this.relatedTarget=e,s?(this.clientX=void 0!==s.clientX?s.clientX:s.pageX,this.clientY=void 0!==s.clientY?s.clientY:s.pageY,this.screenX=s.screenX||0,this.screenY=s.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=t.pointerType,this.state=t.state,this.i=t,t.defaultPrevented&&T.Z.h.call(this)},T.prototype.h=function(){T.Z.h.call(this);const t=this.i;t.preventDefault?t.preventDefault():t.returnValue=!1};var O="closure_listenable_"+(1e6*Math.random()|0),A=0;function S(t,e,n,s,r){this.listener=t,this.proxy=null,this.src=e,this.type=n,this.capture=!!s,this.ha=r,this.key=++A,this.da=this.fa=!1}function R(t){t.da=!0,t.listener=null,t.proxy=null,t.src=null,t.ha=null}function N(t,e,n){for(const s in t)e.call(n,t[s],s,t)}function x(t){const e={};for(const n in t)e[n]=t[n];return e}const k="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");function L(t,e){let n,s;for(let e=1;e<arguments.length;e++){for(n in s=arguments[e],s)t[n]=s[n];for(let e=0;e<k.length;e++)n=k[e],Object.prototype.hasOwnProperty.call(s,n)&&(t[n]=s[n])}}function F(t){this.src=t,this.g={},this.h=0}function P(t,e){const n=e.type;if(n in t.g){var s,r=t.g[n],i=Array.prototype.indexOf.call(r,e,void 0);(s=i>=0)&&Array.prototype.splice.call(r,i,1),s&&(R(e),0==t.g[n].length&&(delete t.g[n],t.h--))}}function M(t,e,n,s){for(let r=0;r<t.length;++r){const i=t[r];if(!i.da&&i.listener==e&&i.capture==!!n&&i.ha==s)return r}return-1}F.prototype.add=function(t,e,n,s,r){const i=t.toString();(t=this.g[i])||(t=this.g[i]=[],this.h++);const o=M(t,e,s,r);return o>-1?(e=t[o],n||(e.fa=!1)):((e=new S(e,this.src,i,!!s,r)).fa=n,t.push(e)),e};var G="closure_lm_"+(1e6*Math.random()|0),H={};function U(t,e,n,s,r){if(Array.isArray(e)){for(let i=0;i<e.length;i++)U(t,e[i],n,s,r);return null}return n=K(n),t&&t[O]?t.J(e,n,!!o(s)&&!!s.capture,r):function(t,e,n,s,r,i){if(!e)throw Error("Invalid event type");const a=o(r)?!!r.capture:!!r;let B=q(t);if(B||(t[G]=B=new F(t)),n=B.add(e,n,s,a,i),n.proxy)return n;if(s=function(){function t(n){return e.call(t.src,t.listener,n)}const e=J;return t}(),n.proxy=s,s.src=t,s.listener=n,t.addEventListener)v||(r=a),void 0===r&&(r=!1),t.addEventListener(e.toString(),s,r);else if(t.attachEvent)t.attachEvent($(e.toString()),s);else{if(!t.addListener||!t.removeListener)throw Error("addEventListener and attachEvent are unavailable.");t.addListener(s)}return n}(t,e,n,!1,s,r)}function V(t,e,n,s,r){if(Array.isArray(e))for(var i=0;i<e.length;i++)V(t,e[i],n,s,r);else s=o(s)?!!s.capture:!!s,n=K(n),t&&t[O]?(t=t.i,(i=String(e).toString())in t.g&&((n=M(e=t.g[i],n,s,r))>-1&&(R(e[n]),Array.prototype.splice.call(e,n,1),0==e.length&&(delete t.g[i],t.h--)))):t&&(t=q(t))&&(e=t.g[e.toString()],t=-1,e&&(t=M(e,n,s,r)),(n=t>-1?e[t]:null)&&j(n))}function j(t){if("number"!=typeof t&&t&&!t.da){var e=t.src;if(e&&e[O])P(e.i,t);else{var n=t.type,s=t.proxy;e.removeEventListener?e.removeEventListener(n,s,t.capture):e.detachEvent?e.detachEvent($(n),s):e.addListener&&e.removeListener&&e.removeListener(s),(n=q(e))?(P(n,t),0==n.h&&(n.src=null,e[G]=null)):R(t)}}}function $(t){return t in H?H[t]:H[t]="on"+t}function J(t,e){if(t.da)t=!0;else{e=new T(e,this);const n=t.listener,s=t.ha||t.src;t.fa&&j(t),t=n.call(s,e)}return t}function q(t){return(t=t[G])instanceof F?t:null}var z="__closure_events_fn_"+(1e9*Math.random()>>>0);function K(t){return"function"==typeof t?t:(t[z]||(t[z]=function(e){return t.handleEvent(e)}),t[z])}function Q(){D.call(this),this.i=new F(this),this.M=this,this.G=null}function W(t,e){var n,s=t.G;if(s)for(n=[];s;s=s.G)n.push(s);if(t=t.M,s=e.type||e,"string"==typeof e)e=new b(e,t);else if(e instanceof b)e.target=e.target||t;else{var r=e;L(e=new b(s,t),r)}let i,o;if(r=!0,n)for(o=n.length-1;o>=0;o--)i=e.g=n[o],r=Y(i,s,!0,e)&&r;if(i=e.g=t,r=Y(i,s,!0,e)&&r,r=Y(i,s,!1,e)&&r,n)for(o=0;o<n.length;o++)i=e.g=n[o],r=Y(i,s,!1,e)&&r}function Y(t,e,n,s){if(!(e=t.i.g[String(e)]))return!0;e=e.concat();let r=!0;for(let i=0;i<e.length;++i){const o=e[i];if(o&&!o.da&&o.capture==n){const e=o.listener,n=o.ha||o.src;o.fa&&P(t.i,o),r=!1!==e.call(n,s)&&r}}return r&&!s.defaultPrevented}function X(t){t.g=function(t,e){if("function"!=typeof t){if(!t||"function"!=typeof t.handleEvent)throw Error("Invalid listener argument");t=B(t.handleEvent,t)}return Number(e)>2147483647?-1:i.setTimeout(t,e||0)}(()=>{t.g=null,t.i&&(t.i=!1,X(t))},t.l);const e=t.h;t.h=null,t.m.apply(null,e)}l(Q,D),Q.prototype[O]=!0,Q.prototype.removeEventListener=function(t,e,n,s){V(this,t,e,n,s)},Q.prototype.N=function(){if(Q.Z.N.call(this),this.i){var t=this.i;for(const e in t.g){const n=t.g[e];for(let t=0;t<n.length;t++)R(n[t]);delete t.g[e],t.h--}}this.G=null},Q.prototype.J=function(t,e,n,s){return this.i.add(String(t),e,!1,n,s)},Q.prototype.K=function(t,e,n,s){return this.i.add(String(t),e,!0,n,s)};class Z extends D{constructor(t,e){super(),this.m=t,this.l=e,this.h=null,this.i=!1,this.g=null}j(t){this.h=arguments,this.g?this.i=!0:X(this)}N(){super.N(),this.g&&(i.clearTimeout(this.g),this.g=null,this.i=!1,this.h=null)}}function tt(t){D.call(this),this.h=t,this.g={}}l(tt,D);var et=[];function nt(t){N(t.g,function(t,e){this.g.hasOwnProperty(e)&&j(t)},t),t.g={}}tt.prototype.N=function(){tt.Z.N.call(this),nt(this)},tt.prototype.handleEvent=function(){throw Error("EventHandler.handleEvent not implemented")};var st=i.JSON.stringify,rt=i.JSON.parse,it=class{stringify(t){return i.JSON.stringify(t,void 0)}parse(t){return i.JSON.parse(t,void 0)}};function ot(){}function at(){}var Bt={OPEN:"a",hb:"b",ERROR:"c",tb:"d"};function ct(){b.call(this,"d")}function lt(){b.call(this,"c")}l(ct,b),l(lt,b);var ut={},ht=null;function dt(){return ht=ht||new Q}function pt(t){b.call(this,ut.Ia,t)}function ft(t){const e=dt();W(e,new pt(e))}function Ct(t,e){b.call(this,ut.STAT_EVENT,t),this.stat=e}function gt(t){const e=dt();W(e,new Ct(e,t))}function mt(t,e){b.call(this,ut.Ja,t),this.size=e}function wt(t,e){if("function"!=typeof t)throw Error("Fn must not be null and must be a function");return i.setTimeout(function(){t()},e)}function yt(){this.g=!0}function Et(t,e,n,s){t.info(function(){return"XMLHTTP TEXT ("+e+"): "+function(t,e){if(!t.g)return e;if(!e)return null;try{const i=JSON.parse(e);if(i)for(t=0;t<i.length;t++)if(Array.isArray(i[t])){var n=i[t];if(!(n.length<2)){var s=n[1];if(Array.isArray(s)&&!(s.length<1)){var r=s[0];if("noop"!=r&&"stop"!=r&&"close"!=r)for(let t=1;t<s.length;t++)s[t]=""}}}return st(i)}catch(t){return e}}(t,n)+(s?" "+s:"")})}ut.Ia="serverreachability",l(pt,b),ut.STAT_EVENT="statevent",l(Ct,b),ut.Ja="timingevent",l(mt,b),yt.prototype.ua=function(){this.g=!1},yt.prototype.info=function(){};var _t,Dt={NO_ERROR:0,cb:1,qb:2,pb:3,kb:4,ob:5,rb:6,Ga:7,TIMEOUT:8,ub:9},bt={ib:"complete",Fb:"success",ERROR:"error",Ga:"abort",xb:"ready",yb:"readystatechange",TIMEOUT:"timeout",sb:"incrementaldata",wb:"progress",lb:"downloadprogress",Nb:"uploadprogress"};function vt(){}function It(t){return encodeURIComponent(String(t))}function Tt(t){var e=1;t=t.split(":");const n=[];for(;e>0&&t.length;)n.push(t.shift()),e--;return t.length&&n.push(t.join(":")),n}function Ot(t,e,n,s){this.j=t,this.i=e,this.l=n,this.S=s||1,this.V=new tt(this),this.H=45e3,this.J=null,this.o=!1,this.u=this.B=this.A=this.M=this.F=this.T=this.D=null,this.G=[],this.g=null,this.C=0,this.m=this.v=null,this.X=-1,this.K=!1,this.P=0,this.O=null,this.W=this.L=this.U=this.R=!1,this.h=new At}function At(){this.i=null,this.g="",this.h=!1}l(vt,ot),vt.prototype.g=function(){return new XMLHttpRequest},_t=new vt;var St={},Rt={};function Nt(t,e,n){t.M=1,t.A=se(Xt(e)),t.u=n,t.R=!0,xt(t,null)}function xt(t,e){t.F=Date.now(),Ft(t),t.B=Xt(t.A);var n=t.B,s=t.S;Array.isArray(s)||(s=[String(s)]),ge(n.i,"t",s),t.C=0,n=t.j.L,t.h=new At,t.g=sn(t.j,n?e:null,!t.u),t.P>0&&(t.O=new Z(B(t.Y,t,t.g),t.P)),e=t.V,n=t.g,s=t.ba;var r="readystatechange";Array.isArray(r)||(r&&(et[0]=r.toString()),r=et);for(let t=0;t<r.length;t++){const i=U(n,r[t],s||e.handleEvent,!1,e.h||e);if(!i)break;e.g[i.key]=i}e=t.J?x(t.J):{},t.u?(t.v||(t.v="POST"),e["Content-Type"]="application/x-www-form-urlencoded",t.g.ea(t.B,t.v,t.u,e)):(t.v="GET",t.g.ea(t.B,t.v,null,e)),ft(),function(t,e,n,s,r,i){t.info(function(){if(t.g)if(i){var o="",a=i.split("&");for(let t=0;t<a.length;t++){var B=a[t].split("=");if(B.length>1){const t=B[0];B=B[1];const e=t.split("_");o=e.length>=2&&"type"==e[1]?o+(t+"=")+B+"&":o+(t+"=redacted&")}}}else o=null;else o=i;return"XMLHTTP REQ ("+s+") [attempt "+r+"]: "+e+"\n"+n+"\n"+o})}(t.i,t.v,t.B,t.l,t.S,t.u)}function kt(t){return!!t.g&&("GET"==t.v&&2!=t.M&&t.j.Aa)}function Lt(t,e){var n=t.C,s=e.indexOf("\n",n);return-1==s?Rt:(n=Number(e.substring(n,s)),isNaN(n)?St:(s+=1)+n>e.length?Rt:(e=e.slice(s,s+n),t.C=s+n,e))}function Ft(t){t.T=Date.now()+t.H,Pt(t,t.H)}function Pt(t,e){if(null!=t.D)throw Error("WatchDog timer not null");t.D=wt(B(t.aa,t),e)}function Mt(t){t.D&&(i.clearTimeout(t.D),t.D=null)}function Gt(t){0==t.j.I||t.K||Xe(t.j,t)}function Ht(t){Mt(t);var e=t.O;e&&"function"==typeof e.dispose&&e.dispose(),t.O=null,nt(t.V),t.g&&(e=t.g,t.g=null,e.abort(),e.dispose())}function Ut(t,e){try{var n=t.j;if(0!=n.I&&(n.g==t||qt(n.h,t)))if(!t.L&&qt(n.h,t)&&3==n.I){try{var s=n.Ba.g.parse(e)}catch(t){s=null}if(Array.isArray(s)&&3==s.length){var r=s;if(0==r[0]){t:if(!n.v){if(n.g){if(!(n.g.F+3e3<t.F))break t;Ye(n),Ue(n)}Ke(n),gt(18)}}else n.xa=r[1],0<n.xa-n.K&&r[2]<37500&&n.F&&0==n.A&&!n.C&&(n.C=wt(B(n.Va,n),6e3));Jt(n.h)<=1&&n.ta&&(n.ta=void 0)}else tn(n,11)}else if((t.L||n.g==t)&&Ye(n),!I(e))for(r=n.Ba.g.parse(e),e=0;e<r.length;e++){let B=r[e];const l=B[0];if(!(l<=n.K))if(n.K=l,B=B[1],2==n.I)if("c"==B[0]){n.M=B[1],n.ba=B[2];const e=B[3];null!=e&&(n.ka=e,n.j.info("VER="+n.ka));const r=B[4];null!=r&&(n.za=r,n.j.info("SVER="+n.za));const l=B[5];null!=l&&"number"==typeof l&&l>0&&(s=1.5*l,n.O=s,n.j.info("backChannelRequestTimeoutMs_="+s)),s=n;const u=t.g;if(u){const t=u.g?u.g.getResponseHeader("X-Client-Wire-Protocol"):null;if(t){var i=s.h;i.g||-1==t.indexOf("spdy")&&-1==t.indexOf("quic")&&-1==t.indexOf("h2")||(i.j=i.l,i.g=new Set,i.h&&(zt(i,i.h),i.h=null))}if(s.G){const t=u.g?u.g.getResponseHeader("X-HTTP-Session-Id"):null;t&&(s.wa=t,ne(s.J,s.G,t))}}n.I=3,n.l&&n.l.ra(),n.aa&&(n.T=Date.now()-t.F,n.j.info("Handshake RTT: "+n.T+"ms"));var o=t;if((s=n).na=nn(s,s.L?s.ba:null,s.W),o.L){Kt(s.h,o);var a=o,c=s.O;c&&(a.H=c),a.D&&(Mt(a),Ft(a)),s.g=o}else ze(s);n.i.length>0&&je(n)}else"stop"!=B[0]&&"close"!=B[0]||tn(n,7);else 3==n.I&&("stop"==B[0]||"close"==B[0]?"stop"==B[0]?tn(n,7):He(n):"noop"!=B[0]&&n.l&&n.l.qa(B),n.A=0)}ft()}catch(t){}}Ot.prototype.ba=function(t){t=t.target;const e=this.O;e&&3==Fe(t)?e.j():this.Y(t)},Ot.prototype.Y=function(t){try{if(t==this.g)t:{const B=Fe(this.g),c=this.g.ya();this.g.ca();if(!(B<3)&&(3!=B||this.g&&(this.h.h||this.g.la()||Pe(this.g)))){this.K||4!=B||7==c||ft(),Mt(this);var e=this.g.ca();this.X=e;var n=function(t){if(!kt(t))return t.g.la();const e=Pe(t.g);if(""===e)return"";let n="";const s=e.length,r=4==Fe(t.g);if(!t.h.i){if("undefined"==typeof TextDecoder)return Ht(t),Gt(t),"";t.h.i=new i.TextDecoder}for(let i=0;i<s;i++)t.h.h=!0,n+=t.h.i.decode(e[i],{stream:!(r&&i==s-1)});return e.length=0,t.h.g+=n,t.C=0,t.h.g}(this);if(this.o=200==e,function(t,e,n,s,r,i,o){t.info(function(){return"XMLHTTP RESP ("+s+") [ attempt "+r+"]: "+e+"\n"+n+"\n"+i+" "+o})}(this.i,this.v,this.B,this.l,this.S,B,e),this.o){if(this.U&&!this.L){e:{if(this.g){var s,r=this.g;if((s=r.g?r.g.getResponseHeader("X-HTTP-Initial-Response"):null)&&!I(s)){var o=s;break e}}o=null}if(!(t=o)){this.o=!1,this.m=3,gt(12),Ht(this),Gt(this);break t}Et(this.i,this.l,t,"Initial handshake response via X-HTTP-Initial-Response"),this.L=!0,Ut(this,t)}if(this.R){let e;for(t=!0;!this.K&&this.C<n.length;){if(e=Lt(this,n),e==Rt){4==B&&(this.m=4,gt(14),t=!1),Et(this.i,this.l,null,"[Incomplete Response]");break}if(e==St){this.m=4,gt(15),Et(this.i,this.l,n,"[Invalid Chunk]"),t=!1;break}Et(this.i,this.l,e,null),Ut(this,e)}if(kt(this)&&0!=this.C&&(this.h.g=this.h.g.slice(this.C),this.C=0),4!=B||0!=n.length||this.h.h||(this.m=1,gt(16),t=!1),this.o=this.o&&t,t){if(n.length>0&&!this.W){this.W=!0;var a=this.j;a.g==this&&a.aa&&!a.P&&(a.j.info("Great, no buffering proxy detected. Bytes received: "+n.length),Qe(a),a.P=!0,gt(11))}}else Et(this.i,this.l,n,"[Invalid Chunked Response]"),Ht(this),Gt(this)}else Et(this.i,this.l,n,null),Ut(this,n);4==B&&Ht(this),this.o&&!this.K&&(4==B?Xe(this.j,this):(this.o=!1,Ft(this)))}else(function(t){const e={};t=(t.g&&Fe(t)>=2&&t.g.getAllResponseHeaders()||"").split("\r\n");for(let s=0;s<t.length;s++){if(I(t[s]))continue;var n=Tt(t[s]);const r=n[0];if("string"!=typeof(n=n[1]))continue;n=n.trim();const i=e[r]||[];e[r]=i,i.push(n)}!function(t,e){for(const n in t)e.call(void 0,t[n],n,t)}(e,function(t){return t.join(", ")})})(this.g),400==e&&n.indexOf("Unknown SID")>0?(this.m=3,gt(12)):(this.m=0,gt(13)),Ht(this),Gt(this)}}}catch(t){}},Ot.prototype.cancel=function(){this.K=!0,Ht(this)},Ot.prototype.aa=function(){this.D=null;const t=Date.now();t-this.T>=0?(function(t,e){t.info(function(){return"TIMEOUT: "+e})}(this.i,this.B),2!=this.M&&(ft(),gt(17)),Ht(this),this.m=2,Gt(this)):Pt(this,this.T-t)};var Vt=class{constructor(t,e){this.g=t,this.map=e}};function jt(t){this.l=t||10,i.PerformanceNavigationTiming?t=(t=i.performance.getEntriesByType("navigation")).length>0&&("hq"==t[0].nextHopProtocol||"h2"==t[0].nextHopProtocol):t=!!(i.chrome&&i.chrome.loadTimes&&i.chrome.loadTimes()&&i.chrome.loadTimes().wasFetchedViaSpdy),this.j=t?this.l:1,this.g=null,this.j>1&&(this.g=new Set),this.h=null,this.i=[]}function $t(t){return!!t.h||!!t.g&&t.g.size>=t.j}function Jt(t){return t.h?1:t.g?t.g.size:0}function qt(t,e){return t.h?t.h==e:!!t.g&&t.g.has(e)}function zt(t,e){t.g?t.g.add(e):t.h=e}function Kt(t,e){t.h&&t.h==e?t.h=null:t.g&&t.g.has(e)&&t.g.delete(e)}function Qt(t){if(null!=t.h)return t.i.concat(t.h.G);if(null!=t.g&&0!==t.g.size){let e=t.i;for(const n of t.g.values())e=e.concat(n.G);return e}return h(t.i)}jt.prototype.cancel=function(){if(this.i=Qt(this),this.h)this.h.cancel(),this.h=null;else if(this.g&&0!==this.g.size){for(const t of this.g.values())t.cancel();this.g.clear()}};var Wt=RegExp("^(?:([^:/?#.]+):)?(?://(?:([^\\\\/?#]*)@)?([^\\\\/?#]*?)(?::([0-9]+))?(?=[\\\\/?#]|$))?([^?#]+)?(?:\\?([^#]*))?(?:#([\\s\\S]*))?$");function Yt(t){let e;this.g=this.o=this.j="",this.u=null,this.m=this.h="",this.l=!1,t instanceof Yt?(this.l=t.l,Zt(this,t.j),this.o=t.o,this.g=t.g,te(this,t.u),this.h=t.h,ee(this,me(t.i)),this.m=t.m):t&&(e=String(t).match(Wt))?(this.l=!1,Zt(this,e[1]||"",!0),this.o=re(e[2]||""),this.g=re(e[3]||"",!0),te(this,e[4]),this.h=re(e[5]||"",!0),ee(this,e[6]||"",!0),this.m=re(e[7]||"")):(this.l=!1,this.i=new he(null,this.l))}function Xt(t){return new Yt(t)}function Zt(t,e,n){t.j=n?re(e,!0):e,t.j&&(t.j=t.j.replace(/:$/,""))}function te(t,e){if(e){if(e=Number(e),isNaN(e)||e<0)throw Error("Bad port number "+e);t.u=e}else t.u=null}function ee(t,e,n){e instanceof he?(t.i=e,function(t,e){e&&!t.j&&(de(t),t.i=null,t.g.forEach(function(t,e){const n=e.toLowerCase();e!=n&&(pe(this,e),ge(this,n,t))},t)),t.j=e}(t.i,t.l)):(n||(e=ie(e,le)),t.i=new he(e,t.l))}function ne(t,e,n){t.i.set(e,n)}function se(t){return ne(t,"zx",Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^Date.now()).toString(36)),t}function re(t,e){return t?e?decodeURI(t.replace(/%25/g,"%2525")):decodeURIComponent(t):""}function ie(t,e,n){return"string"==typeof t?(t=encodeURI(t).replace(e,oe),n&&(t=t.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),t):null}function oe(t){return"%"+((t=t.charCodeAt(0))>>4&15).toString(16)+(15&t).toString(16)}Yt.prototype.toString=function(){const t=[];var e=this.j;e&&t.push(ie(e,ae,!0),":");var n=this.g;return(n||"file"==e)&&(t.push("//"),(e=this.o)&&t.push(ie(e,ae,!0),"@"),t.push(It(n).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),null!=(n=this.u)&&t.push(":",String(n))),(n=this.h)&&(this.g&&"/"!=n.charAt(0)&&t.push("/"),t.push(ie(n,"/"==n.charAt(0)?ce:Be,!0))),(n=this.i.toString())&&t.push("?",n),(n=this.m)&&t.push("#",ie(n,ue)),t.join("")},Yt.prototype.resolve=function(t){const e=Xt(this);let n=!!t.j;n?Zt(e,t.j):n=!!t.o,n?e.o=t.o:n=!!t.g,n?e.g=t.g:n=null!=t.u;var s=t.h;if(n)te(e,t.u);else if(n=!!t.h){if("/"!=s.charAt(0))if(this.g&&!this.h)s="/"+s;else{var r=e.h.lastIndexOf("/");-1!=r&&(s=e.h.slice(0,r+1)+s)}if(".."==(r=s)||"."==r)s="";else if(-1!=r.indexOf("./")||-1!=r.indexOf("/.")){s=0==r.lastIndexOf("/",0),r=r.split("/");const t=[];for(let e=0;e<r.length;){const n=r[e++];"."==n?s&&e==r.length&&t.push(""):".."==n?((t.length>1||1==t.length&&""!=t[0])&&t.pop(),s&&e==r.length&&t.push("")):(t.push(n),s=!0)}s=t.join("/")}else s=r}return n?e.h=s:n=""!==t.i.toString(),n?ee(e,me(t.i)):n=!!t.m,n&&(e.m=t.m),e};var ae=/[#\/\?@]/g,Be=/[#\?:]/g,ce=/[#\?]/g,le=/[#\?@]/g,ue=/#/g;function he(t,e){this.h=this.g=null,this.i=t||null,this.j=!!e}function de(t){t.g||(t.g=new Map,t.h=0,t.i&&function(t,e){if(t){t=t.split("&");for(let n=0;n<t.length;n++){const s=t[n].indexOf("=");let r,i=null;s>=0?(r=t[n].substring(0,s),i=t[n].substring(s+1)):r=t[n],e(r,i?decodeURIComponent(i.replace(/\+/g," ")):"")}}}(t.i,function(e,n){t.add(decodeURIComponent(e.replace(/\+/g," ")),n)}))}function pe(t,e){de(t),e=we(t,e),t.g.has(e)&&(t.i=null,t.h-=t.g.get(e).length,t.g.delete(e))}function fe(t,e){return de(t),e=we(t,e),t.g.has(e)}function Ce(t,e){de(t);let n=[];if("string"==typeof e)fe(t,e)&&(n=n.concat(t.g.get(we(t,e))));else for(t=Array.from(t.g.values()),e=0;e<t.length;e++)n=n.concat(t[e]);return n}function ge(t,e,n){pe(t,e),n.length>0&&(t.i=null,t.g.set(we(t,e),h(n)),t.h+=n.length)}function me(t){const e=new he;return e.i=t.i,t.g&&(e.g=new Map(t.g),e.h=t.h),e}function we(t,e){return e=String(e),t.j&&(e=e.toLowerCase()),e}function ye(t,e,n,s,r){try{r&&(r.onload=null,r.onerror=null,r.onabort=null,r.ontimeout=null),s(n)}catch(t){}}function Ee(){this.g=new it}function _e(t){this.i=t.Sb||null,this.h=t.ab||!1}function De(t,e){Q.call(this),this.H=t,this.o=e,this.m=void 0,this.status=this.readyState=0,this.responseType=this.responseText=this.response=this.statusText="",this.onreadystatechange=null,this.A=new Headers,this.h=null,this.F="GET",this.D="",this.g=!1,this.B=this.j=this.l=null,this.v=new AbortController}function be(t){t.j.read().then(t.Ma.bind(t)).catch(t.ga.bind(t))}function ve(t){t.readyState=4,t.l=null,t.j=null,t.B=null,Ie(t)}function Ie(t){t.onreadystatechange&&t.onreadystatechange.call(t)}function Te(t){let e="";return N(t,function(t,n){e+=n,e+=":",e+=t,e+="\r\n"}),e}function Oe(t,e,n){t:{for(s in n){var s=!1;break t}s=!0}s||(n=Te(n),"string"==typeof t?null!=n&&It(n):ne(t,e,n))}function Ae(t){Q.call(this),this.headers=new Map,this.L=t||null,this.h=!1,this.g=null,this.D="",this.o=0,this.l="",this.j=this.B=this.v=this.A=!1,this.m=null,this.F="",this.H=!1}(t=he.prototype).add=function(t,e){de(this),this.i=null,t=we(this,t);let n=this.g.get(t);return n||this.g.set(t,n=[]),n.push(e),this.h+=1,this},t.forEach=function(t,e){de(this),this.g.forEach(function(n,s){n.forEach(function(n){t.call(e,n,s,this)},this)},this)},t.set=function(t,e){return de(this),this.i=null,fe(this,t=we(this,t))&&(this.h-=this.g.get(t).length),this.g.set(t,[e]),this.h+=1,this},t.get=function(t,e){return t&&(t=Ce(this,t)).length>0?String(t[0]):e},t.toString=function(){if(this.i)return this.i;if(!this.g)return"";const t=[],e=Array.from(this.g.keys());for(let s=0;s<e.length;s++){var n=e[s];const r=It(n);n=Ce(this,n);for(let e=0;e<n.length;e++){let s=r;""!==n[e]&&(s+="="+It(n[e])),t.push(s)}}return this.i=t.join("&")},l(_e,ot),_e.prototype.g=function(){return new De(this.i,this.h)},l(De,Q),(t=De.prototype).open=function(t,e){if(0!=this.readyState)throw this.abort(),Error("Error reopening a connection");this.F=t,this.D=e,this.readyState=1,Ie(this)},t.send=function(t){if(1!=this.readyState)throw this.abort(),Error("need to call open() first. ");if(this.v.signal.aborted)throw this.abort(),Error("Request was aborted.");this.g=!0;const e={headers:this.A,method:this.F,credentials:this.m,cache:void 0,signal:this.v.signal};t&&(e.body=t),(this.H||i).fetch(new Request(this.D,e)).then(this.Pa.bind(this),this.ga.bind(this))},t.abort=function(){this.response=this.responseText="",this.A=new Headers,this.status=0,this.v.abort(),this.j&&this.j.cancel("Request was aborted.").catch(()=>{}),this.readyState>=1&&this.g&&4!=this.readyState&&(this.g=!1,ve(this)),this.readyState=0},t.Pa=function(t){if(this.g&&(this.l=t,this.h||(this.status=this.l.status,this.statusText=this.l.statusText,this.h=t.headers,this.readyState=2,Ie(this)),this.g&&(this.readyState=3,Ie(this),this.g)))if("arraybuffer"===this.responseType)t.arrayBuffer().then(this.Na.bind(this),this.ga.bind(this));else if(void 0!==i.ReadableStream&&"body"in t){if(this.j=t.body.getReader(),this.o){if(this.responseType)throw Error('responseType must be empty for "streamBinaryChunks" mode responses.');this.response=[]}else this.response=this.responseText="",this.B=new TextDecoder;be(this)}else t.text().then(this.Oa.bind(this),this.ga.bind(this))},t.Ma=function(t){if(this.g){if(this.o&&t.value)this.response.push(t.value);else if(!this.o){var e=t.value?t.value:new Uint8Array(0);(e=this.B.decode(e,{stream:!t.done}))&&(this.response=this.responseText+=e)}t.done?ve(this):Ie(this),3==this.readyState&&be(this)}},t.Oa=function(t){this.g&&(this.response=this.responseText=t,ve(this))},t.Na=function(t){this.g&&(this.response=t,ve(this))},t.ga=function(){this.g&&ve(this)},t.setRequestHeader=function(t,e){this.A.append(t,e)},t.getResponseHeader=function(t){return this.h&&this.h.get(t.toLowerCase())||""},t.getAllResponseHeaders=function(){if(!this.h)return"";const t=[],e=this.h.entries();for(var n=e.next();!n.done;)n=n.value,t.push(n[0]+": "+n[1]),n=e.next();return t.join("\r\n")},Object.defineProperty(De.prototype,"withCredentials",{get:function(){return"include"===this.m},set:function(t){this.m=t?"include":"same-origin"}}),l(Ae,Q);var Se=/^https?$/i,Re=["POST","PUT"];function Ne(t,e){t.h=!1,t.g&&(t.j=!0,t.g.abort(),t.j=!1),t.l=e,t.o=5,xe(t),Le(t)}function xe(t){t.A||(t.A=!0,W(t,"complete"),W(t,"error"))}function ke(t){if(t.h&&void 0!==r)if(t.v&&4==Fe(t))setTimeout(t.Ca.bind(t),0);else if(W(t,"readystatechange"),4==Fe(t)){t.h=!1;try{const r=t.ca();t:switch(r){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var e=!0;break t;default:e=!1}var n;if(!(n=e)){var s;if(s=0===r){let e=String(t.D).match(Wt)[1]||null;!e&&i.self&&i.self.location&&(e=i.self.location.protocol.slice(0,-1)),s=!Se.test(e?e.toLowerCase():"")}n=s}if(n)W(t,"complete"),W(t,"success");else{t.o=6;try{var o=Fe(t)>2?t.g.statusText:""}catch(t){o=""}t.l=o+" ["+t.ca()+"]",xe(t)}}finally{Le(t)}}}function Le(t,e){if(t.g){t.m&&(clearTimeout(t.m),t.m=null);const n=t.g;t.g=null,e||W(t,"ready");try{n.onreadystatechange=null}catch(t){}}}function Fe(t){return t.g?t.g.readyState:0}function Pe(t){try{if(!t.g)return null;if("response"in t.g)return t.g.response;switch(t.F){case"":case"text":return t.g.responseText;case"arraybuffer":if("mozResponseArrayBuffer"in t.g)return t.g.mozResponseArrayBuffer}return null}catch(t){return null}}function Me(t,e,n){return n&&n.internalChannelParams&&n.internalChannelParams[t]||e}function Ge(t){this.za=0,this.i=[],this.j=new yt,this.ba=this.na=this.J=this.W=this.g=this.wa=this.G=this.H=this.u=this.U=this.o=null,this.Ya=this.V=0,this.Sa=Me("failFast",!1,t),this.F=this.C=this.v=this.m=this.l=null,this.X=!0,this.xa=this.K=-1,this.Y=this.A=this.D=0,this.Qa=Me("baseRetryDelayMs",5e3,t),this.Za=Me("retryDelaySeedMs",1e4,t),this.Ta=Me("forwardChannelMaxRetries",2,t),this.va=Me("forwardChannelRequestTimeoutMs",2e4,t),this.ma=t&&t.xmlHttpFactory||void 0,this.Ua=t&&t.Rb||void 0,this.Aa=t&&t.useFetchStreams||!1,this.O=void 0,this.L=t&&t.supportsCrossDomainXhr||!1,this.M="",this.h=new jt(t&&t.concurrentRequestLimit),this.Ba=new Ee,this.S=t&&t.fastHandshake||!1,this.R=t&&t.encodeInitMessageHeaders||!1,this.S&&this.R&&(this.R=!1),this.Ra=t&&t.Pb||!1,t&&t.ua&&this.j.ua(),t&&t.forceLongPolling&&(this.X=!1),this.aa=!this.S&&this.X&&t&&t.detectBufferingProxy||!1,this.ia=void 0,t&&t.longPollingTimeout&&t.longPollingTimeout>0&&(this.ia=t.longPollingTimeout),this.ta=void 0,this.T=0,this.P=!1,this.ja=this.B=null}function He(t){if(Ve(t),3==t.I){var e=t.V++,n=Xt(t.J);if(ne(n,"SID",t.M),ne(n,"RID",e),ne(n,"TYPE","terminate"),Je(t,n),(e=new Ot(t,t.j,e)).M=2,e.A=se(Xt(n)),n=!1,i.navigator&&i.navigator.sendBeacon)try{n=i.navigator.sendBeacon(e.A.toString(),"")}catch(t){}!n&&i.Image&&((new Image).src=e.A,n=!0),n||(e.g=sn(e.j,null),e.g.ea(e.A)),e.F=Date.now(),Ft(e)}en(t)}function Ue(t){t.g&&(Qe(t),t.g.cancel(),t.g=null)}function Ve(t){Ue(t),t.v&&(i.clearTimeout(t.v),t.v=null),Ye(t),t.h.cancel(),t.m&&("number"==typeof t.m&&i.clearTimeout(t.m),t.m=null)}function je(t){if(!$t(t.h)&&!t.m){t.m=!0;var e=t.Ea;m||E(),w||(m(),w=!0),y.add(e,t),t.D=0}}function $e(t,e){var n;n=e?e.l:t.V++;const s=Xt(t.J);ne(s,"SID",t.M),ne(s,"RID",n),ne(s,"AID",t.K),Je(t,s),t.u&&t.o&&Oe(s,t.u,t.o),n=new Ot(t,t.j,n,t.D+1),null===t.u&&(n.J=t.o),e&&(t.i=e.G.concat(t.i)),e=qe(t,n,1e3),n.H=Math.round(.5*t.va)+Math.round(.5*t.va*Math.random()),zt(t.h,n),Nt(n,s,e)}function Je(t,e){t.H&&N(t.H,function(t,n){ne(e,n,t)}),t.l&&N({},function(t,n){ne(e,n,t)})}function qe(t,e,n){n=Math.min(t.i.length,n);const s=t.l?B(t.l.Ka,t.l,t):null;t:{var r=t.i;let e=-1;for(;;){const t=["count="+n];-1==e?n>0?(e=r[0].g,t.push("ofs="+e)):e=0:t.push("ofs="+e);let B=!0;for(let c=0;c<n;c++){var i=r[c].g;const n=r[c].map;if((i-=e)<0)e=Math.max(0,r[c].g-100),B=!1;else try{i="req"+i+"_"||"";try{var a=n instanceof Map?n:Object.entries(n);for(const[e,n]of a){let s=n;o(n)&&(s=st(n)),t.push(i+e+"="+encodeURIComponent(s))}}catch(e){throw t.push(i+"type="+encodeURIComponent("_badmap")),e}}catch(t){s&&s(n)}}if(B){a=t.join("&");break t}}a=void 0}return t=t.i.splice(0,n),e.G=t,a}function ze(t){if(!t.g&&!t.v){t.Y=1;var e=t.Da;m||E(),w||(m(),w=!0),y.add(e,t),t.A=0}}function Ke(t){return!(t.g||t.v||t.A>=3)&&(t.Y++,t.v=wt(B(t.Da,t),Ze(t,t.A)),t.A++,!0)}function Qe(t){null!=t.B&&(i.clearTimeout(t.B),t.B=null)}function We(t){t.g=new Ot(t,t.j,"rpc",t.Y),null===t.u&&(t.g.J=t.o),t.g.P=0;var e=Xt(t.na);ne(e,"RID","rpc"),ne(e,"SID",t.M),ne(e,"AID",t.K),ne(e,"CI",t.F?"0":"1"),!t.F&&t.ia&&ne(e,"TO",t.ia),ne(e,"TYPE","xmlhttp"),Je(t,e),t.u&&t.o&&Oe(e,t.u,t.o),t.O&&(t.g.H=t.O);var n=t.g;t=t.ba,n.M=1,n.A=se(Xt(e)),n.u=null,n.R=!0,xt(n,t)}function Ye(t){null!=t.C&&(i.clearTimeout(t.C),t.C=null)}function Xe(t,e){var n=null;if(t.g==e){Ye(t),Qe(t),t.g=null;var s=2}else{if(!qt(t.h,e))return;n=e.G,Kt(t.h,e),s=1}if(0!=t.I)if(e.o)if(1==s){n=e.u?e.u.length:0,e=Date.now()-e.F;var r=t.D;W(s=dt(),new mt(s,n)),je(t)}else ze(t);else if(3==(r=e.m)||0==r&&e.X>0||!(1==s&&function(t,e){return!(Jt(t.h)>=t.h.j-(t.m?1:0)||(t.m?(t.i=e.G.concat(t.i),0):1==t.I||2==t.I||t.D>=(t.Sa?0:t.Ta)||(t.m=wt(B(t.Ea,t,e),Ze(t,t.D)),t.D++,0)))}(t,e)||2==s&&Ke(t)))switch(n&&n.length>0&&(e=t.h,e.i=e.i.concat(n)),r){case 1:tn(t,5);break;case 4:tn(t,10);break;case 3:tn(t,6);break;default:tn(t,2)}}function Ze(t,e){let n=t.Qa+Math.floor(Math.random()*t.Za);return t.isActive()||(n*=2),n*e}function tn(t,e){if(t.j.info("Error code "+e),2==e){var n=B(t.bb,t),s=t.Ua;const e=!s;s=new Yt(s||"//www.google.com/images/cleardot.gif"),i.location&&"http"==i.location.protocol||Zt(s,"https"),se(s),e?function(t,e){const n=new yt;if(i.Image){const s=new Image;s.onload=c(ye,n,"TestLoadImage: loaded",!0,e,s),s.onerror=c(ye,n,"TestLoadImage: error",!1,e,s),s.onabort=c(ye,n,"TestLoadImage: abort",!1,e,s),s.ontimeout=c(ye,n,"TestLoadImage: timeout",!1,e,s),i.setTimeout(function(){s.ontimeout&&s.ontimeout()},1e4),s.src=t}else e(!1)}(s.toString(),n):function(t,e){new yt;const n=new AbortController,s=setTimeout(()=>{n.abort(),ye(0,0,!1,e)},1e4);fetch(t,{signal:n.signal}).then(t=>{clearTimeout(s),t.ok?ye(0,0,!0,e):ye(0,0,!1,e)}).catch(()=>{clearTimeout(s),ye(0,0,!1,e)})}(s.toString(),n)}else gt(2);t.I=0,t.l&&t.l.pa(e),en(t),Ve(t)}function en(t){if(t.I=0,t.ja=[],t.l){const e=Qt(t.h);0==e.length&&0==t.i.length||(d(t.ja,e),d(t.ja,t.i),t.h.i.length=0,h(t.i),t.i.length=0),t.l.oa()}}function nn(t,e,n){var s=n instanceof Yt?Xt(n):new Yt(n);if(""!=s.g)e&&(s.g=e+"."+s.g),te(s,s.u);else{var r=i.location;s=r.protocol,e=e?e+"."+r.hostname:r.hostname,r=+r.port;const t=new Yt(null);s&&Zt(t,s),e&&(t.g=e),r&&te(t,r),n&&(t.h=n),s=t}return n=t.G,e=t.wa,n&&e&&ne(s,n,e),ne(s,"VER",t.ka),Je(t,s),s}function sn(t,e,n){if(e&&!t.L)throw Error("Can't create secondary domain capable XhrIo object.");return(e=t.Aa&&!t.ma?new Ae(new _e({ab:n})):new Ae(t.ma)).Fa(t.L),e}function rn(){}function on(){}function an(t,e){Q.call(this),this.g=new Ge(e),this.l=t,this.h=e&&e.messageUrlParams||null,t=e&&e.messageHeaders||null,e&&e.clientProtocolHeaderRequired&&(t?t["X-Client-Protocol"]="webchannel":t={"X-Client-Protocol":"webchannel"}),this.g.o=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.sa&&(t?t["X-WebChannel-Client-Profile"]=e.sa:t={"X-WebChannel-Client-Profile":e.sa}),this.g.U=t,(t=e&&e.Qb)&&!I(t)&&(this.g.u=t),this.A=e&&e.supportsCrossDomainXhr||!1,this.v=e&&e.sendRawJson||!1,(e=e&&e.httpSessionIdParam)&&!I(e)&&(this.g.G=e,null!==(t=this.h)&&e in t&&(e in(t=this.h)&&delete t[e])),this.j=new ln(this)}function Bn(t){ct.call(this),t.__headers__&&(this.headers=t.__headers__,this.statusCode=t.__status__,delete t.__headers__,delete t.__status__);var e=t.__sm__;if(e){t:{for(const n in e){t=n;break t}t=void 0}(this.i=t)&&(t=this.i,e=null!==e&&t in e?e[t]:void 0),this.data=e}else this.data=t}function cn(){lt.call(this),this.status=1}function ln(t){this.g=t}(t=Ae.prototype).Fa=function(t){this.H=t},t.ea=function(t,e,n,s){if(this.g)throw Error("[goog.net.XhrIo] Object is active with another request="+this.D+"; newUri="+t);e=e?e.toUpperCase():"GET",this.D=t,this.l="",this.o=0,this.A=!1,this.h=!0,this.g=this.L?this.L.g():_t.g(),this.g.onreadystatechange=u(B(this.Ca,this));try{this.B=!0,this.g.open(e,String(t),!0),this.B=!1}catch(t){return void Ne(this,t)}if(t=n||"",n=new Map(this.headers),s)if(Object.getPrototypeOf(s)===Object.prototype)for(var r in s)n.set(r,s[r]);else{if("function"!=typeof s.keys||"function"!=typeof s.get)throw Error("Unknown input type for opt_headers: "+String(s));for(const t of s.keys())n.set(t,s.get(t))}s=Array.from(n.keys()).find(t=>"content-type"==t.toLowerCase()),r=i.FormData&&t instanceof i.FormData,!(Array.prototype.indexOf.call(Re,e,void 0)>=0)||s||r||n.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8");for(const[t,e]of n)this.g.setRequestHeader(t,e);this.F&&(this.g.responseType=this.F),"withCredentials"in this.g&&this.g.withCredentials!==this.H&&(this.g.withCredentials=this.H);try{this.m&&(clearTimeout(this.m),this.m=null),this.v=!0,this.g.send(t),this.v=!1}catch(t){Ne(this,t)}},t.abort=function(t){this.g&&this.h&&(this.h=!1,this.j=!0,this.g.abort(),this.j=!1,this.o=t||7,W(this,"complete"),W(this,"abort"),Le(this))},t.N=function(){this.g&&(this.h&&(this.h=!1,this.j=!0,this.g.abort(),this.j=!1),Le(this,!0)),Ae.Z.N.call(this)},t.Ca=function(){this.u||(this.B||this.v||this.j?ke(this):this.Xa())},t.Xa=function(){ke(this)},t.isActive=function(){return!!this.g},t.ca=function(){try{return Fe(this)>2?this.g.status:-1}catch(t){return-1}},t.la=function(){try{return this.g?this.g.responseText:""}catch(t){return""}},t.La=function(t){if(this.g){var e=this.g.responseText;return t&&0==e.indexOf(t)&&(e=e.substring(t.length)),rt(e)}},t.ya=function(){return this.o},t.Ha=function(){return"string"==typeof this.l?this.l:String(this.l)},(t=Ge.prototype).ka=8,t.I=1,t.connect=function(t,e,n,s){gt(0),this.W=t,this.H=e||{},n&&void 0!==s&&(this.H.OSID=n,this.H.OAID=s),this.F=this.X,this.J=nn(this,null,this.W),je(this)},t.Ea=function(t){if(this.m)if(this.m=null,1==this.I){if(!t){this.V=Math.floor(1e5*Math.random()),t=this.V++;const r=new Ot(this,this.j,t);let i=this.o;if(this.U&&(i?(i=x(i),L(i,this.U)):i=this.U),null!==this.u||this.R||(r.J=i,i=null),this.S)t:{for(var e=0,n=0;n<this.i.length;n++){var s=this.i[n];if(void 0===(s="__data__"in s.map&&"string"==typeof(s=s.map.__data__)?s.length:void 0))break;if((e+=s)>4096){e=n;break t}if(4096===e||n===this.i.length-1){e=n+1;break t}}e=1e3}else e=1e3;e=qe(this,r,e),ne(n=Xt(this.J),"RID",t),ne(n,"CVER",22),this.G&&ne(n,"X-HTTP-Session-Id",this.G),Je(this,n),i&&(this.R?e="headers="+It(Te(i))+"&"+e:this.u&&Oe(n,this.u,i)),zt(this.h,r),this.Ra&&ne(n,"TYPE","init"),this.S?(ne(n,"$req",e),ne(n,"SID","null"),r.U=!0,Nt(r,n,null)):Nt(r,n,e),this.I=2}}else 3==this.I&&(t?$e(this,t):0==this.i.length||$t(this.h)||$e(this))},t.Da=function(){if(this.v=null,We(this),this.aa&&!(this.P||null==this.g||this.T<=0)){var t=4*this.T;this.j.info("BP detection timer enabled: "+t),this.B=wt(B(this.Wa,this),t)}},t.Wa=function(){this.B&&(this.B=null,this.j.info("BP detection timeout reached."),this.j.info("Buffering proxy detected and switch to long-polling!"),this.F=!1,this.P=!0,gt(10),Ue(this),We(this))},t.Va=function(){null!=this.C&&(this.C=null,Ue(this),Ke(this),gt(19))},t.bb=function(t){t?(this.j.info("Successfully pinged google.com"),gt(2)):(this.j.info("Failed to ping google.com"),gt(1))},t.isActive=function(){return!!this.l&&this.l.isActive(this)},(t=rn.prototype).ra=function(){},t.qa=function(){},t.pa=function(){},t.oa=function(){},t.isActive=function(){return!0},t.Ka=function(){},on.prototype.g=function(t,e){return new an(t,e)},l(an,Q),an.prototype.m=function(){this.g.l=this.j,this.A&&(this.g.L=!0),this.g.connect(this.l,this.h||void 0)},an.prototype.close=function(){He(this.g)},an.prototype.o=function(t){var e=this.g;if("string"==typeof t){var n={};n.__data__=t,t=n}else this.v&&((n={}).__data__=st(t),t=n);e.i.push(new Vt(e.Ya++,t)),3==e.I&&je(e)},an.prototype.N=function(){this.g.l=null,delete this.j,He(this.g),delete this.g,an.Z.N.call(this)},l(Bn,ct),l(cn,lt),l(ln,rn),ln.prototype.ra=function(){W(this.g,"a")},ln.prototype.qa=function(t){W(this.g,new Bn(t))},ln.prototype.pa=function(t){W(this.g,new cn)},ln.prototype.oa=function(){W(this.g,"b")},on.prototype.createWebChannel=on.prototype.g,an.prototype.send=an.prototype.o,an.prototype.open=an.prototype.m,an.prototype.close=an.prototype.close,iB=function(){return new on},rB=function(){return dt()},sB=ut,nB={jb:0,mb:1,nb:2,Hb:3,Mb:4,Jb:5,Kb:6,Ib:7,Gb:8,Lb:9,PROXY:10,NOPROXY:11,Eb:12,Ab:13,Bb:14,zb:15,Cb:16,Db:17,fb:18,eb:19,gb:20},Dt.NO_ERROR=0,Dt.TIMEOUT=8,Dt.HTTP_ERROR=6,eB=Dt,bt.COMPLETE="complete",tB=bt,at.EventType=Bt,Bt.OPEN="a",Bt.CLOSE="b",Bt.ERROR="c",Bt.MESSAGE="d",Q.prototype.listen=Q.prototype.J,Za=at,Ae.prototype.listenOnce=Ae.prototype.K,Ae.prototype.getLastError=Ae.prototype.Ha,Ae.prototype.getLastErrorCode=Ae.prototype.ya,Ae.prototype.getStatus=Ae.prototype.ca,Ae.prototype.getResponseJson=Ae.prototype.La,Ae.prototype.getResponseText=Ae.prototype.la,Ae.prototype.send=Ae.prototype.ea,Ae.prototype.setWithCredentials=Ae.prototype.Fa,Xa=Ae}).apply(void 0!==oB?oB:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{});var aB=class t{static FOLD_CASE=1;static LITERAL=2;static CLASS_NL=4;static DOT_NL=8;static ONE_LINE=16;static NON_GREEDY=32;static PERL_X=64;static UNICODE_GROUPS=128;static WAS_DOLLAR=256;static LOOKBEHIND=512;static MATCH_NL=t.CLASS_NL|t.DOT_NL;static PERL=t.CLASS_NL|t.ONE_LINE|t.PERL_X|t.UNICODE_GROUPS;static POSIX=0;static UNANCHORED=0;static ANCHOR_START=1;static ANCHOR_BOTH=2};const BB=1,cB=2,lB=4,uB=8,hB=16,dB=512,pB=128,fB=new Int32Array(pB),CB=new Int32Array(pB),gB=65535;for(let t=0;t<pB;t++)fB[t]=t>=97&&t<=122?t-32:t,CB[t]=t>=65&&t<=90?t+32:t;var mB=class{static CODES=Object.freeze({"":7,"\b":8,"\t":9,"\n":10,"\v":11,"\f":12,"\r":13," ":32,'"':34,$:36,"&":38,"'":39,"(":40,")":41,"*":42,"+":43,"-":45,".":46,0:48,1:49,2:50,3:51,4:52,5:53,6:54,7:55,8:56,9:57,":":58,"<":60,">":62,"?":63,A:65,B:66,C:67,F:70,P:80,Q:81,U:85,Z:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,a:97,b:98,f:102,i:105,m:109,n:110,r:114,s:115,t:116,v:118,x:120,z:122,"{":123,"|":124,"}":125});static toUpperCase(t){if(t<pB)return fB[t];const e=String.fromCodePoint(t).toUpperCase(),n=e.codePointAt(0)>gB?2:1;if(e.length>n)return t;const s=String.fromCodePoint(e.codePointAt(0)).toLowerCase(),r=s.codePointAt(0)>gB?2:1;return s.length>r||s.codePointAt(0)!==t?t:e.codePointAt(0)}static toLowerCase(t){if(t<pB)return CB[t];const e=String.fromCodePoint(t).toLowerCase(),n=e.codePointAt(0)>gB?2:1;if(e.length>n)return t;const s=String.fromCodePoint(e.codePointAt(0)).toUpperCase(),r=s.codePointAt(0)>gB?2:1;return s.length>r||s.codePointAt(0)!==t?t:e.codePointAt(0)}},wB=class{constructor(t,e=!1){this.data=t,this.isStride1=e,this.SIZE=e?2:3}getLo(t){return this.data[t*this.SIZE]}getHi(t){return this.data[t*this.SIZE+1]}getStride(t){return this.isStride1?1:this.data[t*this.SIZE+2]}get length(){return this.data.length/this.SIZE}};const yB=new Uint8Array(256);for(let t=0;t<64;t++)yB["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-".charCodeAt(t)]=t;const EB=t=>{const e=[];let n=0,s=0;for(let r=0;r<t.length;r++){const i=yB[t.charCodeAt(r)];n|=(31&i)<<s,32&i?s+=5:(e.push(n),n=0,s=0)}return e},_B=(t,e)=>{const n=EB(t),s=e?n.length/2:n.length/3,r=new Uint32Array(3*s);let i=0,o=0;for(let t=0;t<s;t++)i+=n[o++],r[3*t]=i,i+=n[o++],r[3*t+1]=i,r[3*t+2]=e?1:n[o++];return r};var DB=class{constructor(t){this.initializer=t,this.cache=new Map}has(t){return t in this.initializer}get(t){if(this.cache.has(t))return this.cache.get(t);const e=this.initializer[t],n=e?e():null;return this.cache.set(t,n),n}},bB=class{static _CASE_ORBIT=null;static get CASE_ORBIT(){return this._CASE_ORBIT||(this._CASE_ORBIT=(t=>{const e=EB(t),n=new Map;let s=0;for(let t=0;t<e.length;t+=2){s+=e[t];const r=e[t+1],i=r>>>1^-(1&r);n.set(s,s+i)}return n})("rCgCIgCY+rQI4QiCuuBLgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCCgCBgCBgCBgCBgCBgCBgCB+7OB-BB-BB-BB-BB-BBskQB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BC-BB-BB-BB-BB-BB-BB-BByHBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBDCBBBCBBBCBBCCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBCCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBxHBCBBBCBBBCBBB3SBmMBkNBCBBBCBBB8MBCBBB6MB6MBCBBC+EB0MB2MBCBBB6MB+MBiGBmNBiNBCBBBmKBikzCBmNBqNBkIBsNBCBBBCBBBCBBB0NBCBBB0NDCBBB0NBCBBByNByNBCBBBCBBB2NBCBBDCBBCwDFCBCBDBCBCBDBCBCBDBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBB9EBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBCCBCBDBCBBBhGBvDBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBjICCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBH2iVBCBBBlKBwiVB+jVB+jVBCBBBlMBqEBuEBCBBBCBBBCBBBCBBBCBBB+hVB4hVB8hVBjNB7MC5MB5MCzMC1MB+0yCE5MB20yCC9MBu2yCBwyyCBo0yCChNBlNBo0yCBu-UBi0yCDlNC6-UBpNDrNIu+UDzNCm0yCBzNE0yyCBzNBpEBxNBxNBtEG1NLqxyCBkxyCnFoFrBCBBBCBBDCBBEkIBkIBkICoHHsCCqCBqCBqCCgEC+DB+DBmkOBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCC+BBgCBgCBgCBgCBgCBgCBgCBgCBrCBpCBpCBpCBmjOB-BB8BB-BB-BBgEB-BB-BByBBqgOBsDB-BBtwBB-BB-BB-BBsBBgDBCB-BB-BB-BBeB-BB-BB61OB-BB-BB-DB9DB9DBQB7DBmCE9CBrDBPBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBrFB-EBOBnHB3FB-FCCBBBNBCBBCjIBjIBjIBgFBgFBgFBgFBgFBgFBgFBgFBgFBgFBgFBgFBgFBgFBgFBgFBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCB-BB-BB8kMB-BB6kMB-BB-BB-BB-BB-BB-BB-BB-BB-BBokMB-BB-BBkkMBkkMB-BB-BB-BB-BB-BB-BB-BB4jMB-BB-BB-BB-BB-BB-EB-EB-EB-EB-EB-EB-EB-EB-EB-EB-EB-EB-EB-EB-EB-EBCBBBCBoiMBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBJCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBeBCBBBCBBBCBBBCBBBCBBBCBBBCBBBdBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBCgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDL-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-C64CgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOCgmOGgmODg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FDg8FBg8FBg8FhVg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBQBQBQBQBQBQDPBPBPBPBPBPjkC7mMB5mMBnmMBjmMBCBlmMB3lMBpiMBk8kCBCBBG-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FD-7FB-7FB-7F6FoglCEsuHRwjlCyDCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCB0DBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBG1DD97OCCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBQBQBQBQBQBQBQBQBPBPBPBPBPBPBPBPBQBQBQBQBQBQDPBPBPBPBPBPDQBQBQBQBQBQBQBQBPBPBPBPBPBPBPBPBQBQBQBQBQBQBQBQBPBPBPBPBPBPBPBPBQBQBQBQBQBQDPBPBPBPBPBPEQCQCQCQCPCPCPCPBQBQBQBQBQBQBQBQBPBPBPBPBPBPBPBPB0EB0EBsFBsFBsFBsFBoGBoGBgIBgIBgHBgHB8HB8HDQBQBQBQBQBQBQBQBPBPBPBPBPBPBPBPBQBQBQBQBQBQBQBQBPBPBPBPBPBPBPBPBQBQBQBQBQBQBQBQBPBPBPBPBPBPBPBPBQBQCSFPBPBzEBzEBRCxnOFSFrFBrFBrFBrFBREQBQClkOFPBPBnGBnGFQBQCljOCODPBPB-GB-GBNHSF-HB-HB7HB7HBRqJ53OE9tQBrmQH4Bc3BSgBBgBBgBBgBBgBBgBBgBBgBBgBBgBBgBBgBBgBBgBBgBBgBBfBfBfBfBfBfBfBfBfBfBfBfBfBfBfBfECBByZ0BB0BB0BB0BB0BB0BB0BB0BB0BB0BB0BB0BB0BB0BB0BB0BB0BB0BB0BB0BB0BB0BB0BB0BB0BB0BBzBBzBBzBBzBBzBBzBBzBBzBBzBBzBBzBBzBBzBBzBBzBBzBBzBBzBBzBBzBBzBBzBBzBBzBBzBBzB34BgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CBCBBBt-UBruHBt+UB1iVBviVBCBBBCBBBCBBB3hVB5-UB9hVB7hVCCBBCCBBI9jVB9jVBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBICBBBCBBECBBN-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOC-lOG-lOzoeCBBBCBBBCBBBCBBBCBBBCBl8kCBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBTCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBnECBBBCBBBCBBBCBBBCBBBCBBBCBBDCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBKCBBBCBBBnglCBCBBBCBBBCBBBCBBBCBBECBBBvyyCDCBBBCBBBgDCCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBn0yCB90yCB10yCBh0yCBn0yCCjxyCBzyyCBpxyCBg6BBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBB-CBl0yCBvjlCBCBBBCBBBt2yCBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBhkzCZCBB9a-5Bd-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCm6TCBB7gBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCH-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BmlBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvChDwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCFvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvC1DuCBuCBuCBuCBuCBuCBuCBuCBuCBuCBuCCuCBuCBuCBuCBuCBuCBuCBuCBuCBuCBuCBuCBuCBuCBuCCuCBuCBuCBuCBuCBuCBuCCuCBuCCtCBtCBtCBtCBtCBtCBtCBtCBtCBtCBtCCtCBtCBtCBtCBtCBtCBtCBtCBtCBtCBtCBtCBtCBtCBtCCtCBtCBtCBtCBtCBtCBtCCtCBtCk2BgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEO-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-D+CgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCL-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-B74CgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BhrVgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BhB2BB2BB2BB2BB2BB2BB2BB2BB2BB2BB2BB2BB2BB2BB2BB2BB2BB2BB2BB2BB2BB2BB2BB2BB2BD1BB1BB1BB1BB1BB1BB1BB1BB1BB1BB1BB1BB1BB1BB1BB1BB1BB1BB1BB1BB1BB1BB1BB1BB1BtxekCBkCBkCBkCBkCBkCBkCBkCBkCBkCBkCBkCBkCBkCBkCBkCBkCBkCBkCBkCBkCBkCBkCBkCBkCBkCBkCBkCBkCBkCBkCBkCBkCBkCBjCBjCBjCBjCBjCBjCBjCBjCBjCBjCBjCBjCBjCBjCBjCBjCBjCBjCBjCBjCBjCBjCBjCBjCBjCBjCBjCBjCBjCBjCBjCBjCBjCBjC")),this._CASE_ORBIT}static _Print=null;static get Print(){return this._Print||(this._Print=new wB(_B("hB9CBjBLBCpWBDFBFGBCCCBSBCsMBClBBDxBBDCBC2BBJaBFFBSVBC-FBCvBBD6BBDkDBP6BBDwBBDOBCbBDCCBJBGfBIqCBCgFBCHBDBBDVBCGBCEEBCBDIBDBBDDBJFFBCCBDBDYBDCBCFBFBBDVBCGBCBBCBBCBBDCCBDBFBBDCBEIIBCBCIIBPBLCBCIBCCBCVBCGBCBBCEBDJBCCBCCBDQQBCBDLBIGBCCBCHBDBBDVBCGBCBBCEBDIBDBBDCBICBFBBCEBDRBLBBCFBECBCDBEBBCCCBEEBEEBBBELBFEBECBCDBDHHPUBGMBCCBCWBCPBDIBCCBCDBIBBCCBCBBDDBDJBIVBCCBCWBCJBCEBDIBCCBCDBIBBGCBCDBDJBCCBNMBCCBCyBBCCBCFBFPBDZBCCBCRBEXBCIBCDDBFBEFFBEBCCCBGBHJBDCBN5BBFcBmBBBCCCBDBCXBCCCBVBDEBCCCBFBCJBDDBhBnCBCjBBFmBBCjBBCOBCMBmBlGBCGGD4LBCDBDGBCCCBCBDoBBCDBDgBBCDBDGBCCCBCBDOBC4BBCDBDiCBDfBEZBH1CBDFBD-TBCbBE4CBIVBKXBKTBNMBCCBCBBN9CBDJBHJBHNBCKBH4CBIqBBGlCBLeBCLBFLBFEEBoBBDEBMrBBFZBHKBE9BBDgCBCcBDKBHJBHNBDtBBDLBVsCBClFBJ7BBEOBE9BBGqBBDKBJqBBG1QBDFBDlBBDFBDHBCGCBdBD0BBCOBCNBDFBCSBDCBCIBSXBJuBBSBBDaBCMBEhBBPgBBQrEBF5UBXKBWz4BBD9LBGsBBCGGD3BBIBBPXBKGBCGBCGBCGBCGBCGBCGBCGBC9DBjBZBC4CBN1GBbPBC+BBC1CBDmDBGqBBC9CBC1CBKvBBCszcBE2BBK7KBV3FBJ8GBV7BBEJBH3BBJlCBJLBHzDBMdBEtCBCKBFgBBC2BBKNBDJBDmDBZbBLFBDFBDFBKGBCGBC7BBF9DBDJBHj9KBNWBFwBBloItLBDpDBnBGBNEBGZBCEBCCCBCCBCCBoUBhBpBBHyBBCSBCDBFEBCmEBF9FBEFBDFBDFBDCBEGBCGBOBBDLBCZBCSBCBBCOBDNBjB6DBGCBFsBBE3CBCMBEwBwBBsBBjEcBEwBBQbBFjBBKdBGqBBGdBCkBBFNBrB9EBDJBHjBBFjBBFnBBJzBBMLBCOBCGBCBBCKBCOBCGBCBBEzBBN2JBKVBLHBZFBCpBBCIBmCFBDCCBqBBCBBEDDBVBCnCBJIBxBSBCBBGgBBEaBGaBnB3BBFTBDxBBCBBGHBCCBCcBDCBFJBIIBI-BBhBmBBFLBK1BBEcBDaBGZBIDBNGBxCoCB4ByBBOyBBItBBJJBHlBBEcBJBBxGeBCpBBCCBDBBRFBJIBiBtBBJpBBXZBnBbBVWBKtCBFjBBK9BBCEBOYBIJBH0BBCRBJmBBK-CBCTBMRBCuBB-BGBCCCBCBCOBCKBH6BBGJBHDBCHBDBBDVBCGBCBBCEBCJBDBBDCBDHHGGBDGBEEBMJBCDDClBBCJBCDDCDBCJBCBBJBBe7CBCEBfnCBJJBnF1BBDlBBjBkCBMJBHMBU5BBHJBHTBdaBDOBFWB6F7BBlDyCBNHBDDDBGBCBBCdBCBBDLBKJBnCHBDtBBDKBcnCBJyCBOoCBIJB3CHB5ChBBPJBHIBCsBBCNBLcBEfBDVBCNBqCGBCBBCrBBECCBCCBHBJJBHFBCBBCkBBCBBCFBIJBHrBBFJB3HYBIQBCoBBEcB2CQQBwBBO6cBnDuDBCEBMjGBtyCiDBOvhBBRVBL68DBGmSB61G5BBn2B4RBIeBCJBFwCBCJBHdBDFBLlCBLJBCGBCUBGSBxN5BBnG6CBGYBDYBtBqCBF4BBIQBhCEBMGBK1mHBqBfBiDyDB+vIDBCGBCBBCiJBQeeBBBDPPBCBJrMBloCqDBGMBEIBIJBDDBh7D8HBEzNBHWBQQBQtBBDWBKzDB9B1HBLmBBDpCBJvDBWlCB7DTBNTBN2CBKYBoE0CBCmCBCBBDDDBDDBCBCLBCCCBFBCgCBCDBDHBCGBCbBCDBCEBCEEBFBCzKBDjJBD9VBQEBCOBxiBeBHFB2GGBCQBDGBCBBCEBG9BBiBxDxDBrBBENBDJBFBBhKeBS5BBGxOxOBoBB3GqBBFhGhGBdBCVBJBBhHGBCDBCBBCOBCkGBDPBqBrCBFJBFBByYjCBtC8BBjGDBCaBCBBCDDCJBCDBCCCHFFCECBBBCBBCDDCICBCCDDBCGBCDBCDBCCCBIBCQBGCBCEBCQB1BBBvIrBBFjDBNOBDOBCOBCkBBLtFB5BcBOrBBFIBIBBPFB7E4eBEQBEMBE5GBHLBFQQBKBF3BBJJBHnBBJdBDLBFBBPIBoB3KBJNBDMBEKBE4BBCFFBOBDLBFJBIyEBCmDBmgB-2pBBhB9oEBDt0FBDwpHBQtTBjtC9QBjvBq6EBGppIBnkzVvHB",!1))),this._Print}static CATEGORIES=new DB({C:()=>new wB(_B("AfBgDgBBOrWrWBHHBCBICCVuMuMnBBBzBBBE4B4BBGBcDBHQBXhGhGxBBB8BBBmDNB8BBByBBBQddBCCMEBhBGBsCiFiFJBBDBBXIICCBFBBKBBDBBFHBCDBDGGBaaBEEHDBDBBXIIDGDBCCGDBDBBECBCGBFCCBFBSJBEKKEXXIDDGBBLIEBCCBNBFBBNGBIEEJBBDBBXIIDGGBKKBDDBEEBFBEDBDGGBTTBIBDHHBBBEFFBBBDCCDCBDCBECBNDBGCBEFFBCCBEBCNBWEBOEEYRRBKKEFFBFBDEEDBBFBBLGBXEEYLLGBBKEEFGBDEBEFFBLLELBOEE0BEEHDBRBBbEETCBZKKCBBICBCDBHCCJFBLBBELB7BDBekBBDCCGZZCYYBGGCIILBBFfBpClBlBBCBoBlBlBQOOBjBBnGCCBDBCBB6LFFBIICFFBqBqBFBBiBFFBIICFFBQQ6BFFBkCkCBhBhBBBBbFB3CBBHBB+UCB6CGBXIBZIBVLBOEEDLB-CBBLFBLFBPMMBEB6CGBsBEBnCJBgBNNBCBNDBCCBrBBBGKBtBDBbFBMCB-BBBiCeeBMMBEBLFBPBBvBBBNTBuCnFnFBGB9BCBQCB-BEBsBBBMHBsBEB3QBBHBBnBBBHBBJGCgBBB2BQQPBBHUUBEEKMMBDBbEByBPBDBBcOOBBBjBNBiBOBtEDB7UVBMUB14BBB-LEBuBCCBDBCBB5BGBDNBZIBI4BI-DhBBb6C6CBKB3GZBxC3C3CBoDoDBDBsB-C-C3CIBxBuzcuzcBBB4BIB9KTB5FHB+GTB9BCBLFB5BHBnCHBNFB1DKBfCBvCMMBCBiB4B4BBHBPBBLBBoDXBdJBHBBHBBHIBIII9BDB-DBBLFBl9KLBYDByBjoIBvLBBrDlBBILBGEBbGGCGDrUfBrBFB0BUUFDBGoEoEBCB-FCBHBBHBBHBBECBIIIBLBDBBNbbUDDQBBPhBB8DEBEDBuBCB5COOBBBCuBBvBhEBeCByBOBdDBlBIBfEBsBEBfmBmBBCBPpBB-EBBLFBlBDBlBDBpBHB1BKBNQQIDDMQQIDDBBB1BLB4JIBXJBJXBHrBrBKkCBHBBCtBtBDCBCBBYpCpCBGBKvBBUDDBDBiBCBcEBclBB5BDBVBBzBDDBDBJEEeBBEDBLGBKGBhCfBoBDBNIB3BCBeBBcEBbGBFLBIvCBqC2BB0BMB0BGBvBHBLFBnBCBeHBDvGBgBrBrBEBBDPBHHBKgBBvBHBrBVBblBBdTBYIBvCDBlBIB-BGGBLBaGBLFB2BTTBGBoBIBhDVVBJBTwBwBB8BBICCFQQMFB8BEBLFBFJJBDDBXXIDDGLLBDDBEEBCCBEBCEBIBBICBGKBLCCBCCnBLLCBBCFFLDDBGBDcB9CGGBcBpCHBLlFB3BBBnBhBBmCKBLFBOSB7BFBLFBVbBcBBQDBY4FB9BjDB0CLBJBBCBBJDDfDDBNNBHBLlCBJBBvBBBMaBpCHB0CMBqCGBL1CBJ3CBjBNBLFBKuBuBPJBeCBhBBBXPPBnCBIDDtBCBCDDKHBLFBHDDmBDDHGBLFBtBDBL1HBaGBSqBqBBBBe0CBCOBzBMB8clDBwDGGBJBlGryCBkDMBxhBPBXJB88DEBoS41GB7Bl2BB6RGBgBLLBCByCLLBEBfBBHJBnCJBLIIWEBUvNB7BlGB8CEBaBBarBBsCDB6BGBS-BBGKBIIB3mHoBBhBgDB0D8vIBFIIDkJkJBNBCcBEBBCNBFHBtMjoCBsDEBOCBKGBLBBF-6DB+HCB1NFBYOBSOBvBBBYIB1D7BB3HJBoBBBrCHBxDUBnC5DBVLBVLB4CIBamEB2CoCoCDBBCBBDBBFNNCIIiCFFBJJIddFGGCCBI1K1KBlJlJB-V-VBNBGQQBuiBBgBFBH0GBISSBIIDGGBDB-BgBBCvDBuBCBPBBLDBD-JBgBQB7BEBCvOBrB1GBsBDBC-FBgBXXBGBD-GBIFFDQQmGBBRoBBtCDBLDBDwYBlCrCB+BhGBFccDCCBCCLFFCCCBEBCDBCECEDDCBBCICDCCBFFIKFCLLSEBEGGSzBBDtIBtBDBlDLBQBBQQQmBJBvF3BBeMBtBDBKGBDNBH5EB6eCBSCBOCB7GFBNDBCOBNDB5BHBLFBpBHBfBBNDBDNBKmBB5KHBPBBOCBMCB6BCCBCBRBBNDBLGB0EoDoDBjgBBh3pBfB-oEBBv0FBBypHOBvThtCB-QhvBBs6EEBrpIlkzVBxHvw-FB",!1)),Cc:()=>new wB(_B("AfgDgB",!0)),Cf:()=>new wB(_B("tFzqBzqBBEBXhGhGyBhMhMBxCxCs5D9-B9-BBDBbEByBEBCJBw03B6H6HBBBimEQQj7IPBhjiBDBwmFHBn0rYffB+CB",!1)),Cn:()=>new wB(_B("4bBBHDBICCVuMuMnBBBzBBBE4B4BBGBcDBHKBvI9B9BBmDmDBMB8BBByBBBQddBCCMEBjBEBuHJJBDDBXXICCBBBFBBKBBDBBFHBCDBDGGBaaBEEHDBDBBXIIDGDBCCGDBDBBECBCGBFCCBFBSJBEKKEXXIDDGBBLIEBCCBNBFBBNGBIEEJBBDBBXIIDGGBKKBDDBEEBFBEDBDGGBTTBIBDHHBBBEFFBBBDCCDCBDCBECBNDBGCBEFFBCCBEBCNBWEBOEEYRRBKKEFFBFBDEEDBBFBBLGBXEEYLLGBBKEEFGBDEBEFFBLLELBOEE0BEEHDBRBBbEETCBZKKCBBICBCDBHCCJFBLBBELB7BDBekBBDCCGZZCYYBGGCIILBBFfBpClBlBBCBoBlBlBQOOBjBBnGCCBDBCBB6LFFBIICFFBqBqBFBBiBFFBIICFFBQQ6BFFBkCkCBhBhBBBBbFB3CBBHBB+UCB6CGBXIBZIBVLBOEEDLB-CBBLFBLFBbFB6CGBsBEBnCJBgBNNBCBNDBCCBrBBBGKBtBDBbFBMCB-BBBiCeeBMMBEBLFBPBBvBBBNTBuCnFnFBGB9BCBQCB-BEBsBBBMHBsBEB3QBBHBBnBBBHBBJGCgBBB2BQQPBBHUUBEEKmDmDNBBcOOBBBjBNBiBOBtEDB7UVBMUB14BBB-LEBuBCCBDBCBB5BGBDNBZIBI4BI-DhBBb6C6CBKB3GZBxC3C3CBoDoDBDBsB-C-C3CIBxBuzcuzcBBB4BIB9KTB5FHB+GTB9BCBLFB5BHBnCHBNFB1DKBfCBvCMMBCBiB4B4BBHBPBBLBBoDXBdJBHBBHBBHIBIII9BDB-DBBLFBl9KLBYDByBDBvzIBBrDlBBILBGEBbGGCGDrUfBrBFB0BUUFDBGoEoEBCC-FCBHBBHBBHBBECBIIIBIBGBBNbbUDDQBBPhBB8DEBEDBuBCB5COOBBBCuBBvBhEBeCByBOBdDBlBIBfEBsBEBfmBmBBCBPpBB-EBBLFBlBDBlBDBpBHB1BKBNQQIDDMQQIDDBBB1BLB4JIBXJBJXBHrBrBKkCBHBBCtBtBDCBCBBYpCpCBGBKvBBUDDBDBiBCBcEBclBB5BDBVBBzBDDBDBJEEeBBEDBLGBKGBhCfBoBDBNIB3BCBeBBcEBbGBFLBIvCBqC2BB0BMB0BGBvBHBLFBnBCBeHBDvGBgBrBrBEBBDPBHHBKgBBvBHBrBVBblBBdTBYIBvCDBlBIBlCJBCBBaGBLFB2BTTBGBoBIBhDVVBJBTwBwBB8BBICCFQQMFB8BEBLFBFJJBDDBXXIDDGLLBDDBEEBCCBEBCEBIBBICBGKBLCCBCCnBLLCBBCFFLDDBGBDcB9CGGBcBpCHBLlFB3BBBnBhBBmCKBLFBOSB7BFBLFBVbBcBBQDBY4FB9BjDB0CLBJBBCBBJDDfDDBNNBHBLlCBJBBvBBBMaBpCHB0CMBqCGBL1CBJ3CBjBNBLFBKuBuBPJBeCBhBBBXPPBnCBIDDtBCBCDDKHBLFBHDDmBDDHGBLFBtBDBL1HBaGBSqBqBBBBe0CBCOBzBMB8clDBwDGGBJBlGryCBkDMB3iBJB88DEBoS41GB7Bl2BB6RGBgBLLBCByCLLBEBfBBHJBnCJBLIIWEBUvNB7BlGB8CEBaBBarBBsCDB6BGBS-BBGKBIIB3mHoBBhBgDB0D8vIBFIIDkJkJBNBCcBEBBCNBFHBtMjoCBsDEBOCBKGBLBBJ76DB+HCB1NFBYOBSOBvBBBYIB1D7BB3HJBoBBBjGUBnC5DBVLBVLB4CIBamEB2CoCoCDBBCBBDBBFNNCIIiCFFBJJIddFGGCCBI1K1KBlJlJB-V-VBNBGQQBuiBBgBFBH0GBISSBIIDGGBDB-BgBBCvDBuBCBPBBLDBD-JBgBQB7BEBCvOBrB1GBsBDBC-FBgBXXBGBD-GBIFFDQQmGBBRoBBtCDBLDBDwYBlCrCB+BhGBFccDCCBCCLFFCCCBEBCDBCECEDDCBBCICDCCBFFIKFCLLSEBEGGSzBBDtIBtBDBlDLBQBBQQQmBJBvF3BBeMBtBDBKGBDNBH5EB6eCBSCBOCB7GFBNDBCOBNDB5BHBLFBpBHBfBBNDBDNBKmBB5KHBPBBOCBMCB6BCCBCBRBBNDBLGB0EoDoDBjgBBh3pBfB-oEBBv0FBBypHOBvThtCB-QhvBBs6EEBrpIm8yVBCdBhD-DBxHvw-BB---BBB---BBB",!1)),Co:()=>new wB(_B("gg4B-nGh4hc9--BD9--B",!0)),Cs:()=>new wB(_B("gg2B--B",!0)),L:()=>new wB(_B("hCZBHZBwBLLFGGBVBCeBCpOBFLBPEBICCiEEBCBBDDBCHHCCBCCCBSBCyCBCqEBJlFBClBBDHHBnBBoCaBFDBuBqBBkBBBCiDBCQQBIIBLLBBBDRRCdBe4CBMZZBfBKBBFGGBUBFKKEYYBXBIKBGXBCGBRpBB7B1BBETTIJBQPBFHBDBBDVBCGBCEEBCBERROBBCCBPBBLJJBEBFBBDVBCGBCBBCBBCBBgBDBCUUBBBRIBCCBCVBCGBCBBCEBETTQBBYMMBGBDBBDVBCGBCBBCEBEffBCCBBBQSSCFBECBCDBEBBCCCBEEBEEBBBELBX1B1BBGBCCBCWBCPBEbbBBBCBBDBBfFFBGBCCBCWBCJBCEBEffBBBCBBQBBSIBCCBCoBBDRRGCBJCBZFBGRBEXBCIBCDDBFB7BvBBCBBNGB7BBBCCCBDBCXBCCCBIBCBBKDDBDBCWWBCBhBgCgCBGBCjBBcEB0DqBBVRRBEBFDBEEEBIIBBBFMBNSSBkBBCGGDqBBCsKBCDBDGBCCCBCBDoBBCDBDgBBCDBDGBCCCBCBDOBC4BBCDBDiCBmBPBR1CBDFBErTBDQBCZBGqCBHHBIRBOSBPRBPMBCCBQzBBkBFFkC4CBIEBDhBBCGGBkCBLeByBdBDEBMrBBFZB3BWBK0BBzC+C+CBtBBSHB3BdBOBBLrBBbjBBqBCBLjBBDKBGqBBDCBqBDBCFBCBBEGGB+FBhC1IBDFBDlBBDFBDHBCGCBdBD0BBCGBCEEBBBCGBEDBDFBFMBGCBCGB1DOORMBmDFFDJBCEEBDBHGCBCBCKBDDBGEBF1B1BB8zC8zCBjHBHDBEBBNlBBCGGD3BBIRRBVBKGBCGBCGBCGBCGBCGBCGBCGBxC2O2OBrBrBBDBGBBF1CBHCBC5CBCDBGqBBC9CBSfBxBPBhQ-tGBhCs0VBkCtBBDsIBEPBLBBVuBBReBDlCByBIBDmDBDxCBVQBCCBCDBCWBezBBPxBB-BFBECCBMMBaBLWBacBIuBBdRRBDBCJBLEBCoBBYCBCHBVWBEEEBwBBCEEBDDBDBDCCZCBDKBICBNFBDFBDFBKGBCGBCqBBCNBHyDBej9KBNWBFwBBloItLBDpDBnBGBNEBGCCBIBCMBCEBCCCBCCBCCBqDBiBqLBT-BBD1BBpBLB1DEBCmEBlBZBHZBM4CBEFBDFBDFBDCBkBLBCZBCSBCBBCOBDNBjB6DBmMcBEwBBwBfBOTBCHBHlBBLdBDjBBFHBxB9EBTjBBFjBBFnBBJzBBNKBCOBCGBCBBCKBCOBCGBCBBEzBBN2JBKVBLHBZFBCpBBCIBmCFBDCCBqBBCBBEDDBVBLWBKeBiCSBCBBLVBLZBHZBnB3BBHBBhCQQBCBCCBCcBrBcBEcBkBHBCbBc1BBLVBLSBORBvDoCB4ByBBOyBBOjBBnBbBKWB7HpBBHBBRFB5BcBLJJBUBrBRBvBUBcWBN0BB6BBBDOOBrBBhBYBbjBBeDDJiBBENNBuBBPDBWCCkBRBCYBUBBgCGBCCCBCBCOBCJBIuBBnBHBDBBDVBCGBCBBCEBETTNEBfJBCDDClBBCaaCtBtBBzBBTDBVCBfvBBVBBC5F5FBtBBqBDBlBvBBV8B8BBpBBOoCoCBZBmBGB6FrBB1D-BBgBHBDDDBGBCBBCXBQCC-CHBDmBBRCCdLLBmBBIWWMtBBUTTBnCBoGgBBgBIBCkBBSyByBBcBxDGBCBBClBBWaaBEBCBBCfBPYYBqBBlISBQCCBLBChBB9DwCwCB4cBnHjGBtyCgDBQvhBBSFBa68DBGmSB61GdBj3B4RBIeBSuCBSdBTvBBRDBgBUBGSBxNsBB0G-BBhBYBDYBtBqCBGjCjCBLBhCBBCPPBNNB0mHBqBfBiDyDB+vIDBCGBCBBCiJBQeeBBBDPPBCBJrMBloCqDBGMBEIBIJBn7F0CBCmCBCBBDDDBDDBCBCLBCCCBFBCgCBCDBDHBCGBCbBCDBCEBCEEBFBCzKBDYBCYBCeBCYBCeBCYBCeBCYBCeBCYBCHB15BeBHFBmI9BBzEsBBLGBRiKiKBcBTrBBlPbBlHdBDwGwGBdBCCBCBBCGBDEBKBBhHGBCDBCBBCOBCkGB8BjCBI1lB1lBBCBCaBCBBCDDCJBCDBCCCHFFCECBBBCBBCDDCICBCCDDBCGBCDBCDBCCCBIBCQBGCBCEBCQBlqE-2pBBhB9oEBDt0FBDwpHBQtTBjtC9QBjvBq6EBGppIB",!1)),LC:()=>new wB(_B("hCZBHZB7BLLBVBCeBCiGBCDBFvGBDZBhGDBDBBECBCHHCCBCCCBSBCyCBCqEBJlFBClBBKoBB44ClBBCGGDqBBDCBhV1CBDFBjkCKBGqBBDCBhCrBBgCMBChBBmD1IBDFBDlBBDFBDHBCGCBdBD0BBCGBCEEBBBCGBEDBDFBFMBGCBCGBmIFFDJBCEEBDBHGCBCBCFBFDDBCBGEBF1B1BB8zC8zCB6DBDmDBHDBEBBNlBBCGGzoetBBTbBnEtCBCWBEDBCsCBZBBE2Z2ZBpBBGIBIvCBh6TGBNEBqgBZBHZBmlBvCBhDjBBFjBB1DKBCOBCGBCBBCKBCOBCGBCBBk2ByBBOyBB+CVBLVB74C-BBhrV-BBhBYBDYBtpZ0CBCmCBCBBDDDBDDBCBCLBCCCBFBCgCBCDBDHBCGBCbBCDBCEBCEEBFBCzKBDYBCYBCeBCYBCeBCYBCeBCYBCeBCYBCHB15BJBCTBHFB2uCjCB",!1)),Ll:()=>new wB(_B("hDZB7BqBqBBWBCHBC2BCBQCBuBCDECBBBDCCDEEBFFDEEBBBDDDCCCDCCBCCDEECDDBDDBBBHGDCOCBSCBDDCEEC4BCBFBDDDBCCFICBjCBDZBiGCCEEEBBBTccBhBBCBBECBCWCBDBCGDB0B0BBuBBCgBCK0BCDMCBgDCxBoBBo6CqBBDCB5XFBjkCIBC2D2DBqBBgCMBChBBnD0ECBHBCgDCBHBJFBLHBJHBJFBLHBJHBJNBDHBJHBJHBJEBCBBHEEBBBCBBJDBDBBJHBLCBCBBzIEEBEEcKFDBBJDBF2B2Bs1CvBBCEEBGCFCCBCCBEBGiDCBIICFFNlBBCGG0oesBCUaCoEMCBBBC+BCBGBCCCDICFCCDCCBBBCSCGGGCMCFCCDOCbEE2ZqBBGIBIvCBh6TGBNEBqhBZBumBnBBpEjBB8EKBCOBCGBCBBk4ByBB+DVB75CfBhsVfB8BYBnqZZBbGBCRBbZBbDBCCCBFBCKBbZBbZBbZBbZBbZBbZBbZBbZBbbBdYBCFBbYBCFBbYBCFBbYBCFBbYBCFBC15B15BBIBCTBHFB4vChBB",!1)),Lm:()=>new wB(_B("wVRBFLBPEBICCmEGG-OnHnHlFBBuIBBFgBgBKEEhFoFoF1mBgEgE2R72B72BsDkTkTxOFBvF+BBOjBjBBjBByVOORMBg-CBByHgGgG2OsBsBBDBGiDiDB+C+CBBB34bjnBjnBBEBvIzDzDdBB6DIBxCYYpDDBEBB2OXXqEtDtDWBBoDDBKngVngVuBBBh-BFBCpBBCIB0sBhBhB2K04D04DnrTDB9PCBpBBBnRMBhCBBCPPB9-P9-PBCBCGBCBByhM9BBqGGBud0Q0QsSAB",!1)),Lo:()=>new wB(_B("qFQQhIFFBCBxGBB7ZaBFDBuBfBCJBkBBBCiDBCZZBLLBBBDRRCdBe4CBMZZBfBWVBrBYBIKBGXBCGBRoBB8B1BBETTIJBROBFHBDBBDVBCGBCEEBCBERROBBCCBPBBLJJBEBFBBDVBCGBCBBCBBCBBgBDBCUUBBBRIBCCBCVBCGBCBBCEBETTQBBYMMBGBDBBDVBCGBCBBCEBEffBCCBBBQSSCFBECBCDBEBBCCCBEEBEEBBBELBX1B1BBGBCCBCWBCPBEbbBBBCBBDBBfFFBGBCCBCWBCJBCEBEffBBBCBBQBBSIBCCBCoBBDRRGCBJCBZFBGRBEXBCIBCDDBFB7BvBBCBBNFB8BBBCCCBDBCXBCCCBIBCBBKDDBDBYDBhBgCgCBGBCjBBcEB0DqBBVRRBEBFDBEEEBIIBBBFMBNyDyDBnKBCDBDGBCCCBCBDoBBCDBDgBBCDBDGBCCCBCBDOBC4BBCDBDiCBmBPByDrTBDQBCZBGqCBHHBIRBOSBPRBPMBCCBQzBBpBkCkCBhBBC0BBIEBDhBBCGGBkCBLeByBdBDEBMrBBFZB3BWBK0BBxFuBBSHB3BdBOBBLrBBbjBBqBCBLdByDDBCFBCBBE7hB7hBBCB4-C3BBZWBKGBCGBCGBCGBCGBCGBCGBCGBoR2B2BF1CBJCCB4CBFGGBpBBC9CBSfBxBPBhQ-tGBhC0wUBC2jBBkCnBBJrIBFPBLBBjCyByBBkCBqFoDoDEGBCCBCDBCWBezBBPxBB-BFBECCBMMBaBLWBacBIuBBuBEBDIBLEBCoBBYCBCHBVPBCFBEEEBwBBCEEBDDBDBDCCZBBEKBIPPBEBDFBDFBKGBCGByEiBBej9KBNWBFwBBloItLBDpDBkCCCBIBCMBCEBCCCBCCBCCBqDBiBqLBT-BBD1BBpBLB1DEBCmEBqDJBCsBBDeBEFBDFBDFBDCBkBLBCZBCSBCBBCOBDNBjB6DBmMcBEwBBwBfBOTBCHBHlBBLdBDjBBFHBhEtCBjDnBBJzBB9CzBBN2JBKVBLHB5EFBDCCBqBBCBBEDDBVBLWBKeBiCSBCBBLVBLZBHZBnB3BBHBBhCQQBCBCCBCcBrBcBEcBkBHBCbBc1BBLVBLSBORBvDoCB4FjBBnBDBCxJxJBoBBHBBRCBCBB5BcBLJJBUBrBRBvBUBcWBN0BB6BBBDOOBrBBhBYBbjBBeDDJiBBENNBuBBPDBWCCkBRBCYBUBBgCGBCCCBCBCOBCJBIuBBnBHBDBBDVBCGBCBBCEBETTNEBfJBCDDClBBCaaCtBtBBzBBTDBVCBfvBBVBBC5F5FBtBBqBDBlBvBBV8B8BBpBBOoCoCBZBmBGB6FrBB0GHBDDDBGBCBBCXBQCC-CHBDmBBRCCdLLBmBBIWWMtBBUTTBnCBoGgBBgBIBCkBBSyByBBcBxDGBCBBClBBWaaBEBCBBCfBPYYBnBBCBBlISBQCCBLBChBB9DwCwCB4cBnHjGBtyCgDBQvhBBSFBa68DBGmSB61GdBj3B4RBIeBSuCBSdBTvBB0BUBGSB0NnBB2MqCBGwFwFB0mHBqBfBiDyDBuwIiJBQeeBBBDPPBCBJrMBloCqDBGMBEIBIJBxzI2P2PBrBBiBiKiKBcBTrBBlPaBmHdBDwGwGBdBCCBCBBCGBDEBKiHiHBFBCDBCBBCOBCkGB8pBDBCaBCBBCDDCJBCDBCCCHFFCECBBBCBBCDDCICBCCDDBCGBCDBCDBCCCBIBCQBGCBCEBCQBlqE-2pBBhB9oEBDt0FBDwpHBQtTBjtC9QBjvBq6EBGppIB",!1)),Lt:()=>new wB(_B("lOGDnB2sH2sHBGBJHBJHBNQQwBAB",!1)),Lu:()=>new wB(_B("hCZBmDWBCGBiB2BCDOCDuBCBECEBBCCCBCCBBBDDBCBBCCBEBBCBBCECBCCDCCBCCBBBCCCBEEIJDCMCDQCDDDCCBC4BCIBBCBBDCCBCBCGCiJCCEJJHCCBBBCCCBCCBPBCIBkBDDBBBEWCGDDCBBDyBBxBgBCK2BCBMCD+CCDlBBq6ClBBCGGzW1CB0kCHHBpBBDCBhK0ECKgDCKHBJFBLHBJHBJFBMGCJHBpCDBNDBNDBNEBMDBnIFFECBDCBDEEBDBHGCBCBDDBLBBG+B+B9zCvBBxBCCBBBDGCBCBCDDJCBCgDCJCCFuqeuqeCqBCUaCoEMCE8BCLECBICFCCDCCEUCBDBCEBCOCBCBCCCBQCZs5Vs5VBYBmmBnBBpEjBB9EKBCOBCGBCBBr3ByBB+EVB75CfBhsVfBhCYBoqZZBbZBbZBbCCBGDBDDBCBCHBbZBbBBCDBDHBCGBcBBCDBCEBCEEBFBcZBbZBbZBbZBbZBbZBfYBiBYBiBYBiBYBiBYBiB2pE2pEBgBB",!1)),M:()=>new wB(_B("gYvDB0IGBoIsBBCCCBCCBCCpCKBxBUBRmDmDBFBDFBDBBCDBkBffBZB8CKB7BIBKZZBCBCIBCCBCEBsBCB8BIBrBXBCgBB3BCBCRBCGBLBBeCB5BCCBFBDBBDCBKLLBbbDCB5BCCBDBFBBDCBEffBEEMCB5BCCBGBCCBCCBVBBXFBCCB5BCCBFBDBBDCBICBLBBf8B8BBDBECBCDBKpBpBBDB4BCCBFBCCBCDBIBBMBBeCB5BCCBFBCCBCDBIBBMBBQNNBCB4BBBCGBCCBCDBKLLBeeBBBnCFFBEBCCCBGBTBB+BDDBFBNHBjDDDBHBMGBqCBBcECFBByBTBCBBGKBCjBBKlDlDBSBYDBFCBCCBDGBEDBOLBCLLBCBgWCBzdDBdCBeBBfBBhCfBKuBuBBBBC2D2DBjBjB3DLBFLB8GEB6BJBCcBDxBxBBsBBDLBVEBwBQBnBIBNCBfMB5BNBxBTB5ECBCUBFHHDCBnG-BBxWgBB--CCBuEhDhDBeBrRFBqDBB1udDBCJBhBBBxCBBxIEEFYYBDBF0C0CBzBzBBQBbRBOnBnBBGBaMBtBDBwBNBlBkCkCBMBNJJBuBuBBBBzBCCBBBDBBGBBCqBqBBDBGBBtHHBCBBx5TiXiXBOBRPBuejHjH2EEBn0BCBCBBGDBpBCBFmFmFB+R+RBCBiCEB+JBBuCFBnCKByBDB7DCB2BOBqBDDBLLBCBuBKBI+B+BBBBlBNBRBBtBNNBBBxBNBJDBCBB9CLBHDD+ELBWDB4BBBCGBDBBDCBKLLBDDBFBEEBkCIBCDDCDBCEBCPPBzCzCBQBYyCyCBSBsHGBDIBcBBzCQBrDMBmDOBhIOB2HFBCBBDDBCCCBuEuEBFBDGBEddBIBpBGBCDBJKKBJBvBPBnGHBoGHBCHBzCVBCNB7DFBECCBCCBFBCjCjCBDBCBBCEB8KDBKBBCxBxBBFBEEBYmnFmnFHOBpmLRBhuCEB8BGB5gBCCB1BBIDByCMMBslTslTBizEizEBsBBDWB-QEBEFBJHBDGBfDB1ECB89B2BBFxBBJPPXEBCOBxqBGBCQBDGBCBBCEBlDhFhFBFB4L+B+BBCB9PDB-HBB0HDDIBBG7O7OBFBuDGB29lYvHB",!1)),Mc:()=>new wB(_B("joC4B4BDCBJDBCBBzBBB7BCBHBBDBBLsBsB7BCBjC7B7BBBBJCCB2B2BB7B7BCHHBDDBLLnDBBCBBECBCCBLqBqBBBB+BDB+BBB7BCCBDBDBBCBBKBBdPPB7B7BBBBGCBCCBLrBrBBsCsCBBBHHBTBBrKBBgCsFsFBFFHDDBaaBLLBBBDGBWBBDFBDLLBBB5zBffiEIIBGBCBB7KDBDCBFBBCFBhHBB7BCCKCCBJJBEByExBxBGCCBDBCBB+BffFBBD9B9BDCBCEEBxBxBBGBJBBsFWW35EBB0-dBBD5C5CBzBzBBOBvEBBwBxBxBBFFBDDBBBvDBBDBBZuBuBCuDuDDBBGuHuHBCCBCCBCC0gZCCgEuBuBBBBFBB0DZZB8B8BxBCBKBBO+C+CBBBEBBCrFrFBBBgBBB7BBBCDBDBBDCBKLLB1C1CBBBIDDCDBCBBCmDmDBBBJBBErDrDBBBHCCBCBDuHuHBBBHDBDyDyDBBBJBBCuDuDCBBHoDoDCBBFmImIBBBK4H4HBEBCBBFDDCvEvEBBBJDBF1C1CeBB-BqGqGECCoGPPrDIID2G2GBDBFBBC-K-KBNNxBBBJBBCpvQpvQBBBlxD2BBpDBB0rYBBHFB",!1)),Me:()=>new wB(_B("okBBB1xF-wB-wBBCBCCBsshBCB",!1)),Mn:()=>new wB(_B("gYvDB0IEBqIsBBCCCBCCBCCpCKBxBUBRmDmDBFBDFBDBBCDBkBffBZB8CKB7BIBKZZBCBCIBCCBCEBsBCB8BIBrBXBCfB4BCCFHBFEEBFBLBBe7B7BFDBJVVBbbDBB6BFFBFFBDDBBBEffBEEMBB6BFFBDBCBBFVVBXXBEBC7B7BDCCBCBJIIBMMBff+BNNzBEE4BCCBBBGCBCDBIBBMBBe7B7BDHHGBBVBBdBB6BBBFDBJVVBeepCIIBBBC7C7CDGBNHBjDDDBHBMGBqCBBcEC4BNBCEBCBBGKBCjBBKnDnDBCBCFBCBBDBBaBBFCBRDBODDBHHQgWgWBBBzdCBeBBfBBfBBhCBBCGBJDDBJBKuBuBBBBC2D2DBjBjB3DCBFBBKHHBBB8GBBD7B7BCGBCCCDHBHJBDxBxBBMBCeBDLBVDBxBCCBDBCGGpBIBNBBhBDBDBBCCB5BCCBEECCB7BHBDBB5ECBCMBCGBFHHEBBnG-BBxWMBFEEBKB--CCBuEhDhDBeBrRDBsDBB1udFFBIBhBBBxCBBxIEEFaaBGG4EBBbRBOnBnBBGBaKBvBCBxBDDBCBDBBoBkCkCBEBDBBDBBNJJwB0B0BCCBDBBGBBCrBrBBJJvHDDFx5Tx5TiXPBRPBuejHjH2EEBn0BCBCBBGDBpBCBFmFmFB+R+RBCBiCEB+JBBuCFBnCKByBDB8D3B3BBNBqBDDBLLBBByBDBDBBI+B+BBBBlBEBCHB-BNNB1B1BBHBLDBDgDgDBBBDCCBHHD+E+EEHBWBB6BBBEmBmBBFBEEBnCFBOECPBB2CHBDCBCYY1CFBCFFBCCBvHvHBCBHBBCBBcBB2CHBDCCBrDrDCDDBEBCmDmDCDDBCBCEBkIIBCBBhIBBCFFxEDBDBBFhBhBBIBpBFBDDBJKKBEBDCBvBMBCBBnGCCBBBCqGqGBFBCFBCzCzCBUBDGBCBBCBB7DFBECCBCCBFBCpCpCBEEC8K8KBMMB1B1BBDBGCCYmnFmnFHOBpmLLBECBhuCEB8BGB5gBgCgCBCByC5lT5lTBizEizEBsBBDWBhRCBSHBDGBfDB1ECB89B2BBFxBBJPPXEBCOBxqBGBCQBDGBCBBCEBlDhFhFBFB4L+B+BBCB9PDB-HBB0HDDIBBG7O7OBFBuDGB29lYvHB",!1)),N:()=>new wB(_B("wBJB5DBBGDDBBBitBJBnEJBnGJB9MJB3DJBFFBtDJB3DJB3DJBDFBvDMB0DJBJGBoDJBpDGBISBuDJBhDJB3DJBnCTBtIJBnCJBwWTBybCBwHJBHJBXJBtJJBhEKBmFJBHJB3FJB3CJBnEJBHJB3gBEEBEBHJBnGyBBDEB3W7BBvCVB3TdBqrBqYqYaIBPCB4KDBrEJBfHBCOBhBJBoBOBh7cJB9FJBhKFB7EJBnBJBnGJBXJB3CJB3MJB34UJBuPsBBN4BBSBB2KaBlBDBeJJnEEBrGJBvdHBaGBoBIBsCEBXFBhFBBDPBDtBBhCIB1BBBfCBsCEBpDHBZHBqBGBrKFBxBJBHJB3IeB-EJBrBDBxDGBnEdBhEJB9BJBxEJBITB8HJB3KJB3DJB3LJBnDJBHTBtCLBlNSB+CJB3UJB3CcBkHJBnCJB3BJBnLJBnDUBshBuDBimPJBnpCJB3CJBnEJBCGBvQJBnIWB+KCB6nXJBnuBTBNTBtDYB2iBxBBhqCJBnNJB3PJB4HJBtWIBhEJB4Y6BBCCBCDBtCsBBCOBjeMBk3CJB",!1)),Nd:()=>new wB(_B("wBJnxBJnEJnGJ9MJ3DJ3DJ3DJ3DJ3DJ3DJ3DJ3DJ3DJhDJ3DJnCJ3IJnCJn6BJnBJtJJhEJnFJHJ3FJ3CJnEJHJnuiBJnVJnBJnGJXJ3CJ3MJ34UJnsBJnkCJHJ9YJhEJ9BJxEJ3IJ3KJ3DJ3LJnDJHTtCJnNJnDJ3UJ3CJ3HJnCJ3BJnLJ3uQJnpCJ3CJnEJ3QJ37XJ12CxBhqCJnNJ3PJ4HJ2aJ30EJ",!0)),Nl:()=>new wB(_B("u3FCBwzCiBBDDB-zDaaBHBPCBs1dJBxyW0BBtOJJnEEBrhIuDBm8SCB",!1)),No:()=>new wB(_B("yFBBGDDBBB2pCFB5LFB5DCBmEGB6GGBSIByNJB2hBTB0jBJBhP20B20BEFBHJBnGPBqB3W3WB6BBvCVB3TdBqrB1kB1kBBCBrEJBfHBCOBhBJBoBOBxrdFBymWsBBiCDBSBB2KaBlBDB1pBHBaGBoBIBsCEBXFBhFBBDPBDtBBhCIB1BBBfCBsCEBpDHBZHBqBGBrKFBhLeB-EJBrBDBxDGBnETB8LTBmqBBBvNIBobSB0aUBn8SGB-YWBqhZTBNTBtDYBvqFIBid6BBCCBCDBtCsBBCOBjeMB",!1)),P:()=>new wB(_B("hBCBCFBCDBLBBEBBbCBCccCkBkBGEELBBEEE-VJJzOFBqBBB0BCCDDDtBBBVBBCBBOCCBBBrCDBnDsBsBBMBqHCB3BOBgBmImIBLLtE5D5D6DnMnMNwLwL7CLLBpFpFBNBCmBmBBCBoCrCrCBDBFBBwDFBsFlTlTBHB4EuTuTtBBBvCCBoCBB+ECBCCBmBKB6JBB5GBBhEGBCFBhFBBLGBdCB9DDB8BEB-BBBhCHBM9Z9ZBWBJTBCMBCLBfBBPBB6TDBeBB+hBNBwCBBgBJB0MVBgCDBhBBB8XDBCBBxDwEwEBtBBCfBDLBkNCBFJBDLBRNNjD7C7CjgdBBuICBkDLL0DFB9LDB3CBBpBCBCyByBBwBwBiDMBRBB9DDB-DBBRBB6HzqUzqUBxGxGBIBXiBBCNBCFFCBB2ECBCFBCDBLBBEBBbCBCccCCCBFB7MCB9UxBxB-MoXoXoGgBgBxIIBnBxDxDBFBjCGB6CDByO-J-JjBlElEBDBtBDB+FGBuDBBCDB-DDBxBBBwCDBFOOCCB5CFBsDrJrJBCCBzDzDBDBLBBCpDpD7HWBqDCBdMBtCjEjEBBB9HpIpIBBB8E9C9CBGB0CCBCEB+CJB4GgDgDBDBrBBBmUBBrCMBwFxjBxjBBDB97CBB8zOBBmEiCiCBDBJpRpRBBBoJDBoK9lT9lTovHEB07C-a-aBAB",!1)),Pc:()=>new wB(_B("-Cg-Hg-HBUU-u3BBBZCBwHAB",!1)),Pd:()=>new wB(_B("tB9qB9qB0BiyDiyDmgBqgCqgCBEBiwDDDgBBBFdd-NUUwDxszBxszBBmBmBLqFqFhzD-J-J",!1)),Pe:()=>new wB(_B("pB0B0BgB+1D+1DC-6B-6BqtC4B4BQ7T7TCff-hBMCxChBhBCGC1MUChCCCiBmhBmhBCECtBGCtNICEGCDBB-ozB6G6GeOCESSCCCrF0B0BgBGD",!1)),Pf:()=>new wB(_B("7F+6H+6HEddpuDCCFDDQEE",!1)),Pi:()=>new wB(_B("rFt7Ht7HDBBDaapuDCCFDDQEE",!1)),Po:()=>new wB(_B("hBCBCCBDECBLLBEEBcclCGGPBBI-V-VJzOzOBEBqB3B3BDDDtBBBVBBCBBOCCBBBrCDBnDsBsBBMBqHCB3BOBgBmImIBLLtE5D5D6DnMnMNwLwL7CLLBpFpFBNBCxDxDrCEBFBBwDFBsFlTlTBHBmY9D9DBBBoCBB+ECBCCBmBFBCDB6JBB5GBBhEGBCFBhFBBLGBdCB9DDB8BEB-BBBhCHBMjajaBJJBGBJIBDDBDCBEKBCCCBIB7kDDBCBBxDwEwEBFFBBBDDDBHBCBBCDDBLLBDBCJBDDBCCCBLBDCBtNCB6B+F+FjgdBBuICBkDLL0DFB9LDB3CBBpBCBCyByBBwBwBiDMBRBB9DDB-DBBRBB6HlxUlxUBFBDXXVBBDDBECBCDBICBHCCB2E2EBBBCCBDECBLLBEEBcclBDDB7M7MBBB9UxBxB-MoXoXoGgBgBxIIBnBxDxDBFBjCGB6CDB0ZlElEBDBtBDB+FGBuDBBCDB-DDBxBBBwCDBFOOCCB5CFBsDrJrJBCCBzDzDBDBLBBCpDpD7HWBqDCBdMBtCjEjEBBB9HpIpIBBB8E9C9CBGB0CCBCEB+CJB4GgDgDBDBrBBBmUBBrCMBwFxjBxjBBDB97CBB8zOBBmEiCiCBDBJpRpRBBBoJDBoK9lT9lTovHEB07C-a-aBAB",!1)),Ps:()=>new wB(_B("oBzBzBgB-1D-1DC-6B-6B-rCEEnB4B4BQ7T7TCff-hBMCxChBhBCGC1MUChCCCiBmhBmhBCECaTTCECtNICEGCDipzBipzB4GeeCMCESSCCCrFzBzBgBEEDAB",!1)),S:()=>new wB(_B("kBHHRCBgBCCcCCkBEBCBBDCCBCBDEEfgBgBrODBNNBGGBCCCBPB2DPPBxDxDsErIrIBBB3DCBDDDBvGvGLUUB4H4HIBBpEqLqLBHHB2H2H-DjEjEBGBlEwGwGqBmGmGiGCBQCCBBBDFBVECmEHBCFBCBBGDBmGBBxXJB0WuLuLlL+E+EBgBBiLJBKIBhiBCCBBBMCBOCBOCBOBBmCOOoBCBOCBUhBB-BBBCDBCBBLCCBBBGFBCECFMMBFFBDBGDBC7B7BBFFB2LBFcBD+HBXKByCtCBXnTBtBwBBDeBLyMBX+BBFfBD1LBDpEBmHFBmLBBvBZBC4CBN1GBbPBFOOBNNWBBHBB8CBB0HBBFJBhBlBBKRRBdBMdBJQQBeBLmBBQ-JBhuG-BBx0V2BB6RWBKBBoDBB+EDBLDB+RCBiHPPB+9T+9TpEgBBuLPBhCBB3BHBtBDBjDCCBBBD7E7EHRRBBBgBCCcCCiEGBCGBOBB6JIB6BQBDCBCMBEwBwBBrBB7zBBBwSmWmWBiKiKBGBnjC2kC2kCBbBr6SDBG3qU3qUk7DvHBLCBEzNBHWBQQBgDzDB9B1HBLmBBD7BBGCBXBBIdBF8BBWhCBE7F7FB1CBrbaagBaagBaagBaagBaa9B-PB4BDBzBHBCNBCBBp2BwNwNttCEE+DiOiOBvIvIBqBBFjDBNOBDOBCOBCkBBYgFB5BcBOrBBFIBIBBPFB7E4eBEQBEMBE5GBHLBFQQBKBF3BBJJBHnBBJdBDLBFBBPIBoB3KBJNBDMBEKBE4BBCFFBOBDLBFJBIyEBC7CBLAB",!1)),Sc:()=>new wB(_B("kB+D+DBCBqnB8D8DzPBBzPBBI2H2HoImSmS8sClmClmCBgBB37hBkuVkuVtD7E7E8GBBEBB3-HDB-4wBxtCxtC",!1)),Sk:()=>new wB(_B("+CCCoCHHFEEqQDBNNBGGBCCCBPB2DPPBjoBjoB15FCCBBBMCBOCBOCBOBB9kEBBkzdWBKBBoDBBxePPBniUniUBPB8bCCjF4g9B4g9BBDB",!1)),Sm:()=>new wB(_B("rBRRBBB+BCCuBFFmBgBgB-XwQwQBBB8xGOOoBCBOCBsEoBoBBDBHlClCBDBGBBFGDIgBgBBDDCgBgBBqIBhBBB7CffBXBpBFB2OKK3BHBwDxKxKBDBDeBLPBhIiEBX+BBFfBDhIBxBUBDFB9+zB5Z5ZCCBlFRRBBB+BCCkEHHBCBitDBBhrwBx+Bx+BagBgBagBgBagBgBagBgBat5Ft5FB-uC-uCBHB",!1)),So:()=>new wB(_B("mFDDFCCyerIrIBgEgEBvGvGLUUB4H4HkQ2L2LjEFBClElEwGqBqBoMCBQCCBBBDFBVECmEHBCFBCBBGDBmGBBxXJB0WzWzW+EhBBiLJBKIBksBBBCDBCBBLCCBHHBEBCECFMMBPPCBBC7B7BBKKBDBDDBCBBCBBCGBCeBDBBCCCBdBtIHBFTBDGBDwCBCdBanBBHnCBXKByCtCBX2FBCIBC1BBJuDBC3HBtBrBBhC-HBhQvBBWBBHmBBDpEBmHFBmLBBvBZBC4CBN1GBbPBFOOBNNWBBHBBxKBBFJBhBlBBKRRBdBMdBJQQBeBLmBBQ-JBhuG-BBx0V2BBibDBLBBC+R+RBBBqqUPBuLPBhCBB3BHBuBCBlPEEFBBOBB6JIB6BQBDCBCMBEwBwBBrBB7zBBBwSpgBpgBBGBnjC2kC2kCBGBFQBr6SDBG3qU3qUk7DvHBLCBEzNBHWBQPBhDzDB9B1HBLmBBD7BBGCBXBBIdBF8BBWhCBE7F7FB1CBqlB-PB4BDBzBHBCNBCBBp2B96C96CiEyWyWBqBBFjDBNOBDOBCOBCkBBYgFB5BcBOrBBFIBIBBPFB7E6HBG4WBEQBEMBE5GBHLBFQQBKBF3BBJJBHnBBJdBDLBFBB-B3KBJNBDMBEKBE4BBCFFBOBDLBFJBIyEBC7CBLAB",!1)),Z:()=>new wB(_B("gBgEgEgvFgsCgsCBJBeBBGwBwBh9DAB",!1)),Zl:()=>new wB(_B("ohIA",!0)),Zp:()=>new wB(_B("phIA",!0)),Zs:()=>new wB(_B("gBgEgEgvFgsCgsCBJBlBwBwBh9DAB",!1)),ASCII_Hex_Digit:()=>new wB(_B("wBJIFbF",!0)),Alphabetic:()=>new wB(_B("hCZBHZBwBLLFGGBVBCeBCpOBFLBPEBICC3CeeBQBCBBDDBCHHCCBCCCBSBCyCBCqEBJlFBClBBDHHBnBBoBNBCCCBCCBCCJaBFDBeKBG3BBCGBPlDBCHBFHBFCBLCBDRRBuBBOkDBZgBBKBBFGGBWBDSBUYBIKBGXBCGBIJJBoBBLLBEGBHrCBCPBCCBFOBOSBCHBDBBDVBCGBCEEBCBEHBDBBDBBCJJFBBCEBNBBLFFBBBCFBFBBDVBCGBCBBCBBCBBFEBFBBDBBFIIBCBCSSBEBMCBCIBCCBCVBCGBCBBCEBEIBCCBCBBEQQBCBWDBFCBCHBDBBDVBCGBCBBCEBEHBDBBDBBKBBFBBCEBORRBCCBEBECBCDBEBBCCCBEEBEEBBBELBFEBECBCCBEHHpBMBCCBCWBCPBEHBCCBCCBJBBCCBCBBDDBdDBCHBCCBCWBCJBCEBEHBCCBCCBJBBGCBCDBOCBNMBCCBCoBBDHBCCBCCBCGGBCBIEBXFBCCBCRBEXBCIBCDDBFBJFBCCCBGBTBBO5BBGGBH0B0BBECBDBCXBCCCBRBCCBDEBCHHPDBhBgCgCBGBCjBBFSBFPBCjBBkC2BBCDDBDBR-BBLDBDlBBCGGDqBBCsKBCDBDGBCCCBCBDoBBCDBDgBBCDBDGBCCCBCBDOBC4BBCDBDiCBmBPBR1CBDFBErTBDQBCZBGqCBEKBITBMUBNTBNMBCCBCBBNzBBDSBPFFkC4CBIqBBGlCBLeBCLBFIBYdBDEBMrBBFZB3BbBF+BBDTBzBYYBMMBBByBzBBCOBCHB0BpBBDDBLrBBCKBP2BBXCBLjBBDKBGqBBDCBqBDBCFBCBBEGGB+FBUhBBM1IBDFBDlBBDFBDHBCGCBdBD0BBCGBCEEBBBCGBEDBDFBFMBGCBCGB1DOORMBmDFFDJBCEEBDBHGCBCBCKBDDBGEBFSSBnBBuZzBB34BkHBHDBEBBNlBBCGGD3BBIRRBVBKGBCGBCGBCGBCGBCGBCGBCGBCfBwB2O2OBBBaIBIEBDEBF1CBHCBC5CBCDBGqBBC9CBSfBxBPBhQ-tGBhCs0VBkCtBBDsIBEPBLBBVuBBGHBEwDBoBIBDmDBDxCBVUBCgBBZzBBNjCBCtBtBBEBECCBBBLgBBGiBBOcBEyBBCLBQRRBOBLEBC2BBKNBTWBEkCBCCCZCBDPBDDBMFBDFBDFBKGBCGBCqBBCNBH6DBWj9KBNWBFwBBloItLBDpDBnBGBNEBGLBCMBCEBCCCBCCBCCBqDBiBqLBT-BBD1BBpBLB1DEBCmEBlBZBHZBM4CBEFBDFBDFBDCBkBLBCZBCSBCBBCOBDNBjB6DBmC0BBsIcBEwBBwBfBOdBGqBBGdBDjBBFHBCEBrB9EBTjBBFjBBFnBBJzBBNKBCOBCGBCBBCKBCOBCGBCBBEzBBN2JBKVBLHBZFBCpBBCIBmCFBDCCBqBBCBBEDDBVBLWBKeBiCSBCBBLVBLZBHZBnB3BBHBBhCDBCBBGHBCCBCcBrBcBEcBkBHBCbBc1BBLVBLSBORBvDoCB4ByBBOyBBOnBBjBbBEGGBVB7HpBBCBBEBBRFBzBCBEcBLJJBUBrBRBvBUBcWBKlCBsBEBL4BBKOOBXBYyBBSDBJiBBEKKB+BBCDBKBBLCCkBRBChBBDHHBCB-BGBCCCBCBCOBCJBI4BBYDBCHBDBBDVBCGBCBBCEBEHBDBBDBBEHHGGBdJBCDDClBBCJBCDDCDBCBBECCtBhCBCCBCDBVCBfhCBDBBC5F5FB0BBDGBaFBjB+BBCEE8B1BBDoCoCBZBDNBWGB6F4BBoD-BBgBHBDDDBGBCBBCdBCBBDBBDDB+CHBDtBBDFBCCCBccBxBBDJBSnCBGTTBnCBoDHB5CgBBgBIBCsBBCGBCyByBBcBDVBCNBqCGBCBBCrBBECCBCCBBBCDDBZZBEBCBBCkBBCBBCDBCYYBqBBlIWBKQBCoBBECBwDwCwCB4cBnDuDBSjGBtyCgDBQvhBBSFBa68DBGmSB61GuBBy2B4RBIeBSuCBSdBTvBBRDBgBUBGSBxNsBB0G-BBhBYBDYBtBqCBF4BBIQBhCBBCNNBFBK1mHBqBfBiDyDB+vIDBCGBCBBCiJBQeeBBBDPPBCBJrMBloCqDBGMBEIBIJBFi7Fi7FBzCBCmCBCBBDDDBDDBCBCLBCCCBFBCgCBCDBDHBCGBCbBCDBCEBCEEBFBCzKBDYBCYBCeBCYBCeBCYBCeBCYBCeBCYBCHB15BeBHFB2GGBCQBDGBCBBCEBG9BBiBxDxDBrBBLGBRiKiKBcBTrBBlPbBlHdBDwGwGBdBCVBJBBhHGBCDBCBBCOBCkGB8BjCBEEE1lBDBCaBCBBCDDCJBCDBCCCHFFCECBBBCBBCDDCICBCCDDBCGBCDBCDBCCCBIBCQBGCBCEBCQB1TZBHZBHZB3zD-2pBBhB9oEBDt0FBDwpHBQtTBjtC9QBjvBq6EBGppIB",!1)),Dash:()=>new wB(_B("tB9qB9qB0BiyDiyDmgBqgCqgCBEB+BoBoBQnMnMlgDDDgBBBFdd-NUUwDxszBxszBBmBmBLqFqFhzD-J-J",!1)),Emoji:()=>new wB(_B("jBHHGJBwDFFu8HNN5GXX7CFBQBBwLBBNnFnFaKBFCBoGoHoHBLLK7B7BBCBCEBKGDBDDFDDCBBDIEBJJBBBGCCGLBMBBDCCBCCTDDBTTBEBCCCBEEBGGDBBFBBMBBGBBDGGBECBVVBGGBEBCDBDFFDDDBEBCDDCCCHEEHLLBQQDFFCFFBBBCMMBxBxBBBBKeP1LBBwOCBUBB0BFF7mBNN6SCCrrvDrGrGhFBBNBBPDDBIBsCZBCBBYVVDIBWBBvFhBBDvDBDBBCCBDyCBDCBCmIBC+BBMFBCXBIBBDHBNDDBCBDFFBOOBDDJBBKGGBBBNCBJCBDCCFHHEHHB0CBxBlCBGHBDDBEJBECCBEEDJBkHLBF8I8IBtBBCJBC4FBxDMBEKBE4BBCFFBOBDLBFJB",!1)),Emoji_Component:()=>new wB(_B("jBHHGJB0+H2G2Gsp3B3+8B3+8BBYB8PEBxtBDBtzhY-CB",!1)),Emoji_Modifier:()=>new wB(_B("7-8DE",!0)),Emoji_Modifier_Base:()=>new wB(_B("9wJ8G8GRDB4jzD9B9BBBBDDDBBB2DBBDKBWSBEFFBBBCCBICCZqGqGBFFWFFBvFvFBBBEEB0CRRBBBKMMgSDDJHBHKKBIBDCB5B+B+BBCCBCCSCBCMBmHCBrBIB",!1)),Emoji_Presentation:()=>new wB(_B("64IBBuGDBEDDqQBBWBBzBLBsBUUOJJBSSBGGBJJGWWIBBCFFDIIFBBdkBkBCFFBBBC+B+BBBBZPP8aBB0BFFvlxDrGrG-FDDBIBsCZBCZZVDDBDBCCBWBBvFgBBNIBClCBCVBNqBBFEBNQBEEEBlCBCCCB5FBD+BBODBCXBTbbBOO3C0CBxBlCBHEEBBBDDBEDBMBBIIBkHLBF8I8IBtBBCJBC4FBxDMBEKBE4BBCFFBOBDLBFJB",!1)),Extended_Pictographic:()=>new wB(_B("pFFFu8HNN5GXX7CFBQBBwLBBNnFnFaKBFCBoGoHoHBLLK7B7BBCBCEBKGDBDDFDDCBBDIEBJJBBBGCCGLBMBBDCCBCCTDDBTTBEBCCCBEEBGGDBBFBBMBBGBBDGGBECBVVBGGBEBCDBDFFDDDBEBCDDCCCHEEHLLBQQDFFCFFBBBCMMBxBxBBBBKeP1LBBwOCBUBB0BFF7mBNN6SCCrrvDoBoBBCBlDLBQBBQPPBmBmBBIBxDBBNBBPDDBIBU3BBcOBLVVDIBCDBKWBH7FBDvDBDBBCCBDyCBDCBCDBG9HBC+BBMFBCXBIBBDHBNDDBCBDFFBOOBDDJBBKGGBBBNCBJCBDCCFHHEHHB0CBxBlCBGHBDQBECCBEBDMB7GlBBNDB5BHBLFBpBHBfBBNDBDNBKmBBNuBBCJBC4FB5CHBPxEBhI9fB",!1)),Hex_Digit:()=>new wB(_B("wBJIFbFq1-BJIFbF",!0)),Lowercase:()=>new wB(_B("hDZBwBLLFlBlBBWBCHBC2BCBQCBuBCDECBBBDCCDEEBFFDEEBBBDDDCCCDCCBCCDEECDDBDDBBBHGDCOCBSCBDDCEEC4BCBFBDDDBCCFICBjCBDiBBIBBfEBhDsBsBCEEDDBTccBhBBCBBECBCWCBDBCGDB0B0BBuBBCgBCK0BCDMCBgDCxBoBBo6CqBBCDB5XFBjkCIBC2D2DB+FBiC0ECBHBCgDCBHBJFBLHBJHBJFBLHBJHBJNBDHBJHBJHBJEBCBBHEEBBBCBBJDBDBBJHBLCBCBB6DOORMBuDEEBEEcKFDBBJDBFiBiBBOBFsasaBYBn6BvBBCEEBGCFCCBCCBGBEiDCBIICFFNlBBCGG0oesBCUaCBBBmEMCBBBC8BCBIBCCCDICFCCDCCBBBCSCGGGCMCFCCDOCWDBCCCBBB2ZqBBCNBHvCBh6TGBNEBqhBZBumBnBBpEjBB8EKBCOBCGBCBBkODDBBBCpBBCIBmoByBB+DVB75CfBhsVfB8BYBnqZZBbGBCRBbZBbDBCCCBFBCKBbZBbZBbZBbZBbZBbZBbZBbZBbbBdYBCFBbYBCFBbYBCFBbYBCFBbYBCFBC15B15BBIBCTBHFBmI9BB1lChBB",!1)),Math:()=>new wB(_B("rBRRBBBgBeeCuBuBFmBmBgB5W5WBBBDbbBDDBBBwQCBuwGccBBBMEEOPPBCBWEBMEBiCMBFEEBFFBDBTFFDJBCDDBEBHEEBDDBCCBBBCFBENBClClCBWBCFBCBBFBBFfBCHHBPPBqIBJDBVBB7CffBZBCZZMGB+NBBNJBFFBFBBDBBEEBPCCDFBMHBGBB6BCCeDBKCBxK-BBhI-PBxBUBDFB9+zB4Z4ZBEBCjFjFRCBeCCeCCkEHHBCBitDBBhrwBwoBwoBBzCBCmCBCBBDDDBDDBCBCLBCCCBFBCgCBCDBDHBCGBCbBCDBCEBCEEBFBCzKBDjJBDxBBhwFDBCaBCBBCDDCJBCDBCCCHFFCECBBBCBBCDDCICBCCDDBCGBCDBCDBCCCBIBCQBGCBCEBCQB1BBB-uCIB",!1)),Quotation_Mark:()=>new wB(_B("iBFFkEQQ96HHBaBBowDqOqOBCBOCBixzBDB+FFF7CBB",!1)),Terminal_Punctuation:()=>new wB(_B("hBLLCMMBEE-ZJJiQ6B6BpCPPCCB1FsBsBBJBCsHsHB3B3BBEBCHBgBmImIB1nB1nBBtFtFFFB4JBB2YHBmY9D9DBBBoCBB+ECBEoBoBBCBDBB7JBBjLDBjFBBLBBCCBeCB8FEB-BBBldYYBKKBBBwlDCBzJOOFLLCBBEBBtNBB8ndBBuICBkHEB-LBB3CBBgD4E4EBBB0ECBgERRB6H6HnxUDDB6B6BBBBCDBqFLLCMMBEEiCDD7hBxBxBnkBoGoG3JBB5EFBlCFB6CDB5dEBtBDB+FGBxDDBgECBiEBBHRRB5C5CBDBtDrJrJB2D2DBBBNBBnLDBEOBqDBB6HCBmQCC8HBB4CBBFBB-MCBuBmUmUBrCrCBspBspBBDB6vRBBmEiCiCBBBLqRqRBoJoJBnwTnwTovHDB",!1)),Uppercase:()=>new wB(_B("hCZBmDWBCGBiB2BCDOCDuBCBECEBBCCCBCCBBBDDBCBBCCBEBBCBBCECBCCDCCBCCBBBCCCBEEIJDCMCDQCDDDCCBC4BCIBBCBBDCCBCBCGCiJCCEJJHCCBBBCCCBCCBPBCIBkBDDBBBEWCGDDCBBDyBBxBgBCK2BCBMCD+CCDlBBq6ClBBCGGzW1CB0kCHHBpBBDCBhK0ECKgDCKHBJFBLHBJHBJFBMGCJHBpCDBNDBNDBNEBMDBnIFFECBDCBDEEBDBHGCBCBDDBLBBGbbBOBUzZzZBYBx5BvBBxBCCBBBDGCBCBCDDJCBCgDCJCCFuqeuqeCqBCUaCoEMCE8BCLECBICFCCDCCEUCBDBCEBCOCBCBCCCBQCZs5Vs5VBYBmmBnBBpEjBB9EKBCOBCGBCBBr3ByBB+EVB75CfBhsVfBhCYBoqZZBbZBbZBbCCBGDBDDBCBCHBbZBbBBCDBDHBCGBcBBCDBCEBCEEBFBcZBbZBbZBbZBbZBbZBfYBiBYBiBYBiBYBiBYBiB2pE2pEBgBBvgCZBHZBHZB",!1)),White_Space:()=>new wB(_B("JEBTlDlDbgvFgvFgsCKBeBBGwBwBh9DAB",!1))});static SCRIPTS=new DB({Adlam:()=>new wB(_B("go6DrCFJFB",!0)),Ahom:()=>new wB(_B("g4lCaDOFW",!0)),Anatolian_Hieroglyphs:()=>new wB(_B("ggxCmS",!0)),Arabic:()=>new wB(_B("gwBEBCFBCNBCCBCfBCJBMZBCrDBChBBxCvBBxHhBBGqCBCcBxy8BtPBDvEBhBPBxDEBCmEBk7DeBkCFBJIBiBFBh43BDBCaBCBBCDDCJBCDBCCCHFFCECBBBCBBCDDCICBCCDDBCGBCDBCDBCCCBIBCQBGCBCEBCQB1BBB",!1)),Armenian:()=>new wB(_B("xpBlBDxBDCks9BE",!0)),Avestan:()=>new wB(_B("g4iC1BEG",!0)),Balinese:()=>new wB(_B("g4GsCCxB",!0)),Bamum:()=>new wB(_B("g1pB3CpowB4R",!0)),Bassa_Vah:()=>new wB(_B("w26CdDF",!0)),Batak:()=>new wB(_B("g+GzBJD",!0)),Bengali:()=>new wB(_B("gsCDBCHBDBBDVBCGBCEEBCBDIBDBBDDBJFFBCCBDBDYB",!1)),Beria_Erfe:()=>new wB(_B("g17CYDY",!0)),Bhaiksuki:()=>new wB(_B("ggnCICsBCNLc",!0)),Bopomofo:()=>new wB(_B("qXB6wLqBxDf",!0)),Brahmi:()=>new wB(_B("ggkCtCFjBKA",!0)),Braille:()=>new wB(_B("ggK-H",!0)),Buginese:()=>new wB(_B("gwGbDB",!0)),Buhid:()=>new wB(_B("g6FT",!0)),Canadian_Aboriginal:()=>new wB(_B("ggF-TxRlC7tgCP",!0)),Carian:()=>new wB(_B("g1gCwB",!0)),Caucasian_Albanian:()=>new wB(_B("wphCzBMA",!0)),Chakma:()=>new wB(_B("gokC0BCR",!0)),Cham:()=>new wB(_B("gwqB2BKNDJDD",!0)),Cherokee:()=>new wB(_B("g9E1CDFz7lBvC",!0)),Chorasmian:()=>new wB(_B("w9jCb",!0)),Common:()=>new wB(_B("AgCBbFBbuBBCOBCEBYgBgBiOmBBGEBDTB1DKKHCC+THHPEEhB9E9ElQiEiEB6mB6mB2MDBjJwvBwvBBBBoCBBsGBBCumBumBOIIBCBCFBCCBDmYmYBKBD2CBCKBEKBCOBShBB-BlBBCCBDFBCaBCQBqBCBF5UBXKBW-cBhIzTBDpEBhQ9CBzMUBCCCBXBQHBFDB8CBBE7C7CB0E0EBOBhBlBBKxBxBB+BBgBwCBwB5C5CBmFBhuG-BBhoWhBBnDCBmFJB1HhFhFsMPPBzuUzuUBxGxGBIBXiBBCSBCDB0ECCBeBbFBbKBLuBuBBhChCBFBCGBLEBjICBFsBBEIBxCMB0BsBBlHaBltuBDB96D8HBEzNBHWBQQBgDzDB9B1HBLmBBD9BBEQBJBBIdBF8BB2GTBNTBN2CBKYBoE0CBCmCBCBBDDDBDDBCBCLBCCCBFBCgCBCDBDHBCGBCbBCDBCEBCEEBFBCzKBDjJBDxBByjFjCBtC8BBjWrBBFjDBNOBDOBCOBCkBBLtFB5BZBCBBOrBBFIBIBBPFB7E4eBEQBEMBE5GBHLBFQQBKBF3BBJJBHnBBJdBDLBFBBPIBoB3KBJNBDMBEKBE4BBCFFBOBDLBFJBIyEBCmDBnghYffB+CB",!1)),Coptic:()=>new wB(_B("ifNxkKzDGG",!0)),Cuneiform:()=>new wB(_B("ggoC5cnDuDCEMjG",!0)),Cypriot:()=>new wB(_B("ggiCFBDCCBqBBCBBEDD",!1)),Cypro_Minoan:()=>new wB(_B("w8rCiD",!0)),Cyrillic:()=>new wB(_B("ggBkEBDoFBx6FKBhFtCtCojEfBhie-CBv8VBBhw4B9BBiBAB",!1)),Deseret:()=>new wB(_B("gghCvC",!0)),Devanagari:()=>new wB(_B("goCwCFODZh7nBfhwcJ",!0)),Dives_Akuru:()=>new wB(_B("gomCGBDDDBGBCBBCdBCBBDLBKJB",!1)),Dogra:()=>new wB(_B("ggmC7B",!0)),Duployan:()=>new wB(_B("ggvDqDGMEIIJDD",!0)),Egyptian_Hieroglyphs:()=>new wB(_B("ggsC1iBL68D",!0)),Elbasan:()=>new wB(_B("gohCnB",!0)),Elymaic:()=>new wB(_B("g-jCW",!0)),Ethiopic:()=>new wB(_B("gwEoCBCDBDGBCCCBCBDoBBCDBDgBBCDBDGBCCCBCBDOBC4BBCDBDiCBDfBEZBnvGWBKGBCGBCGBCGBCGBCGBCGBCGBjpfFBDFBDFBKGBCGBylvCGBCDBCBBCOB",!1)),Garay:()=>new wB(_B("gqjClBEcJB",!0)),Georgian:()=>new wB(_B("glElBBCGGDqBBCDBx8CqBBDCBhiElBBCGG",!1)),Glagolitic:()=>new wB(_B("ggL-Ch9sDGCQDGCBCE",!0)),Gothic:()=>new wB(_B("w5gCa",!0)),Grantha:()=>new wB(_B("g4kCDBCHBDBBDVBCGBCBBCEBDIBDBBDCBDHHGGBDGBEEB",!1)),Greek:()=>new wB(_B("wbDBCCBDDBCFFCCCBBBCCCBSBC+BBPPBnpGEBzBEBFEB1ChKhKBUBDFBDlBBDFBDHBCGCBdBD0BBCOBCNBDFBCSBDCBCIBoJ-xiB-xiB7uVuCBSgj0Bgj0BBkCB",!1)),Gujarati:()=>new wB(_B("h0CCBCIBCCBCVBCGBCBBCEBDJBCCBCCBDQQBCBDLBIGB",!1)),Gunjala_Gondi:()=>new wB(_B("grnCFCBCkBCBCFIJ",!0)),Gurmukhi:()=>new wB(_B("hwCCBCFBFBBDVBCGBCBBCBBCBBDCCBDBFBBDCBEIIBCBCIIBPB",!1)),Gurung_Khema:()=>new wB(_B("go4C5B",!0)),Han:()=>new wB(_B("g0LZBC4CBN1GBwBCCaIBPDBle-tGBhC-vUBhoWtLBDpDBpodBBNGBqgkB-2pBBhB9oEBDt0FBDwpHBQtTBjtC9QBjvBq6EBGppIB",!1)),Hangul:()=>new wB(_B("goE-HvxHBiI9CyDeiCei3dckUj9KNWFwBl9JeEFDFDFDC",!0)),Hanifi_Rohingya:()=>new wB(_B("gojCnBJJ",!0)),Hanunoo:()=>new wB(_B("g5FU",!0)),Hatran:()=>new wB(_B("gniCSCBGE",!0)),Hebrew:()=>new wB(_B("xsB2BBJaBFFBpp9BZBCEBCCCBCCBCCBIB",!1)),Hiragana:()=>new wB(_B("hiM1CBHCBi7-C+IBTeeBBBulQAB",!1)),Imperial_Aramaic:()=>new wB(_B("giiCVCI",!0)),Inherited:()=>new wB(_B("gYvDB2IBBlOKBbhXhXBCB8qEtBBDLBlPCBCMBCGBFHHEBBnG-BBtQBBjGgBB65DDBsDBBmrzBPBRNBwejHjH7iEl+uBl+uBBsBBDWBhRCBSHBDGBfDBz6rYvHB",!1)),Inscriptional_Pahlavi:()=>new wB(_B("g7iCSGH",!0)),Inscriptional_Parthian:()=>new wB(_B("g6iCVDH",!0)),Javanese:()=>new wB(_B("gsqBtCDJFB",!0)),Kaithi:()=>new wB(_B("gkkCiCLA",!0)),Kannada:()=>new wB(_B("gkDMCCCWCJCEDICCCDIBGCCDDJCC",!0)),Katakana:()=>new wB(_B("hlM5CBDCBxHPBxGuBBC3CBvgzBJBCsBBzisBDBCGBCBBCgJgJBBBzBPPBCB",!1)),Kawi:()=>new wB(_B("g4nCQCoBEc",!0)),Kayah_Li:()=>new wB(_B("goqBtBCA",!0)),Kharoshthi:()=>new wB(_B("gwiCDCBGHCCCcDCFJII",!0)),Khitan_Small_Script:()=>new wB(_B("k-7C84G84GB0OBqBAB",!1)),Khmer:()=>new wB(_B("g8F9CDJHJnPf",!0)),Khojki:()=>new wB(_B("gwkCRCuB",!0)),Khudawadi:()=>new wB(_B("w1kC6BGJ",!0)),Kirat_Rai:()=>new wB(_B("gq7C5B",!0)),Lao:()=>new wB(_B("h0DBBCCCBDBCXBCCCBVBDEBCCCBFBCJBDDB",!1)),Latin:()=>new wB(_B("hCZBHZBwBQQGWBCeBCgOBoBEB8wGlBBHwBBGDBGMBClCBiC-HByLOORMBuEBBHccSoBB42CfBj1elDBExCBVOBxZqBBCIBCDB38TGB7gBZBHZBmhCFBCpBBCIBm61BeBHFB",!1)),Lepcha:()=>new wB(_B("ggH3BEOEC",!0)),Limbu:()=>new wB(_B("goGeBCLBFLBFEEBKB",!1)),Linear_A:()=>new wB(_B("gwhC2JKVLH",!0)),Linear_B:()=>new wB(_B("gggCLCZCSCBCODNjB6D",!0)),Lisu:()=>new wB(_B("wmpBvBx1eA",!0)),Lycian:()=>new wB(_B("g0gCc",!0)),Lydian:()=>new wB(_B("gpiCZGA",!0)),Mahajani:()=>new wB(_B("wqkCmB",!0)),Makasar:()=>new wB(_B("g3nCY",!0)),Malayalam:()=>new wB(_B("goDMCCCyBCCCFFPDZ",!0)),Mandaic:()=>new wB(_B("giCbDA",!0)),Manichaean:()=>new wB(_B("g2iCmBFL",!0)),Marchen:()=>new wB(_B("wjnCfDVCN",!0)),Masaram_Gondi:()=>new wB(_B("gonCGBCBBCrBBECCBCCBHBJJB",!1)),Medefaidrin:()=>new wB(_B("gy7C6C",!0)),Meetei_Mayek:()=>new wB(_B("g3qBWqGtBDJ",!0)),Mende_Kikakui:()=>new wB(_B("gg6DkGDP",!0)),Meroitic_Cursive:()=>new wB(_B("gtiCXFTDtB",!0)),Meroitic_Hieroglyphs:()=>new wB(_B("gsiCf",!0)),Miao:()=>new wB(_B("g47CqCF4BIQ",!0)),Modi:()=>new wB(_B("gwlCkCMJ",!0)),Mongolian:()=>new wB(_B("ggGBBDCCBSBH4CBIqBB2t-BMB",!1)),Mro:()=>new wB(_B("gy6CeCJFB",!0)),Multani:()=>new wB(_B("g0kCGBCCCBCBCOBCKB",!1)),Myanmar:()=>new wB(_B("ggE-EhqmBeiDfxibT",!0)),Nabataean:()=>new wB(_B("gkiCeJI",!0)),Nag_Mundari:()=>new wB(_B("wm5DpB",!0)),Nandinagari:()=>new wB(_B("gtmCHDtBDK",!0)),New_Tai_Lue:()=>new wB(_B("gsGrBFZHKEB",!0)),Newa:()=>new wB(_B("gglC7CCE",!0)),Nko:()=>new wB(_B("g+B6BDC",!0)),Nushu:()=>new wB(_B("h-7CvsQvsQBqMB",!1)),Nyiakeng_Puachue_Hmong:()=>new wB(_B("go4DsBENDJFB",!0)),Ogham:()=>new wB(_B("g0Fc",!0)),Ol_Chiki:()=>new wB(_B("wiHvB",!0)),Ol_Onal:()=>new wB(_B("wu5DqBFA",!0)),Old_Hungarian:()=>new wB(_B("gkjCyBOyBIF",!0)),Old_Italic:()=>new wB(_B("g4gCjBKC",!0)),Old_North_Arabian:()=>new wB(_B("g0iCf",!0)),Old_Permic:()=>new wB(_B("w6gCqB",!0)),Old_Persian:()=>new wB(_B("g9gCjBFN",!0)),Old_Sogdian:()=>new wB(_B("g4jCnB",!0)),Old_South_Arabian:()=>new wB(_B("gziCf",!0)),Old_Turkic:()=>new wB(_B("ggjCoC",!0)),Old_Uyghur:()=>new wB(_B("w7jCZ",!0)),Oriya:()=>new wB(_B("h4CCCHDBDVCGCBCEDIDBDCICFBCEDR",!0)),Osage:()=>new wB(_B("wlhCjBFjB",!0)),Osmanya:()=>new wB(_B("gkhCdDJ",!0)),Pahawh_Hmong:()=>new wB(_B("g46ClCLJCGCUGS",!0)),Palmyrene:()=>new wB(_B("gjiCf",!0)),Pau_Cin_Hau:()=>new wB(_B("g2mC4B",!0)),Phags_Pa:()=>new wB(_B("giqB3B",!0)),Phoenician:()=>new wB(_B("goiCbEA",!0)),Psalter_Pahlavi:()=>new wB(_B("g8iCRIDNG",!0)),Rejang:()=>new wB(_B("wpqBjBMA",!0)),Runic:()=>new wB(_B("g1FqCEK",!0)),Samaritan:()=>new wB(_B("ggCtBDO",!0)),Saurashtra:()=>new wB(_B("gkqBlCJL",!0)),Sharada:()=>new wB(_B("gskC-ChsCH",!0)),Shavian:()=>new wB(_B("wihCvB",!0)),Siddham:()=>new wB(_B("gslC1BDlB",!0)),Sidetic:()=>new wB(_B("gqiCZ",!0)),SignWriting:()=>new wB(_B("gg2DrUQECO",!0)),Sinhala:()=>new wB(_B("hsDCBCRBEXBCIBCDDBFBEFFBEBCCCBGBHJBDCBt-gCTB",!1)),Sogdian:()=>new wB(_B("w5jCpB",!0)),Sora_Sompeng:()=>new wB(_B("wmkCYIJ",!0)),Soyombo:()=>new wB(_B("wymCyC",!0)),Sundanese:()=>new wB(_B("g8G-BhIH",!0)),Sunuwar:()=>new wB(_B("g+mChBPJ",!0)),Syloti_Nagri:()=>new wB(_B("ggqBsB",!0)),Syriac:()=>new wB(_B("g4BNC7BDCxIK",!0)),Tagalog:()=>new wB(_B("g4FVKA",!0)),Tagbanwa:()=>new wB(_B("g7FMCCCB",!0)),Tai_Le:()=>new wB(_B("wqGdDE",!0)),Tai_Tham:()=>new wB(_B("gxG+BCcDKHJHN",!0)),Tai_Viet:()=>new wB(_B("g0qBiCZE",!0)),Tai_Yo:()=>new wB(_B("g25DeCVJB",!0)),Takri:()=>new wB(_B("g0lC5BHJ",!0)),Tamil:()=>new wB(_B("i8CBBCFBECBCDBEBBCCCBEEBEEBBBELBFEBECBCDBDHHPUBm+kCxBBOAB",!1)),Tangsa:()=>new wB(_B("wz6CuCCJ",!0)),Tangut:()=>new wB(_B("g-7CgBgBB+3GBhQeBiDyDB",!1)),Telugu:()=>new wB(_B("ggDMCCCWCPDICCCDIBCCCBDDDJII",!0)),Thaana:()=>new wB(_B("g8BxB",!0)),Thai:()=>new wB(_B("hwD5BGb",!0)),Tibetan:()=>new wB(_B("g4DnCCjBFmBCjBCOCGFB",!0)),Tifinagh:()=>new wB(_B("wpL3BIBPA",!0)),Tirhuta:()=>new wB(_B("gklCnCJJ",!0)),Todhri:()=>new wB(_B("guhCzB",!0)),Tolong_Siki:()=>new wB(_B("wtnCrBFJ",!0)),Toto:()=>new wB(_B("w04De",!0)),Tulu_Tigalari:()=>new wB(_B("g8kCJBCDDClBBCJBCDDCDBCJBCBBJBB",!1)),Ugaritic:()=>new wB(_B("g8gCdCA",!0)),Unknown:()=>new wB(_B("4bBBHDBICCVuMuMnBBBzBBBE4B4BBGBcDBHKBvI9B9BBmDmDBMB8BBByBBBQddBCCMEBjBEBuHJJBDDBXXICCBBBFBBKBBDBBFHBCDBDGGBaaBEEHDBDBBXIIDGDBCCGDBDBBECBCGBFCCBFBSJBEKKEXXIDDGBBLIEBCCBNBFBBNGBIEEJBBDBBXIIDGGBKKBDDBEEBFBEDBDGGBTTBIBDHHBBBEFFBBBDCCDCBDCBECBNDBGCBEFFBCCBEBCNBWEBOEEYRRBKKEFFBFBDEEDBBFBBLGBXEEYLLGBBKEEFGBDEBEFFBLLELBOEE0BEEHDBRBBbEETCBZKKCBBICBCDBHCCJFBLBBELB7BDBekBBDCCGZZCYYBGGCIILBBFfBpClBlBBCBoBlBlBQOOBjBBnGCCBDBCBB6LFFBIICFFBqBqBFBBiBFFBIICFFBQQ6BFFBkCkCBhBhBBBBbFB3CBBHBB+UCB6CGBXIBZIBVLBOEEDLB-CBBLFBLFBbFB6CGBsBEBnCJBgBNNBCBNDBCCBrBBBGKBtBDBbFBMCB-BBBiCeeBMMBEBLFBPBBvBBBNTBuCnFnFBGB9BCBQCB-BEBsBBBMHBsBEB3QBBHBBnBBBHBBJGCgBBB2BQQPBBHUUBEEKmDmDNBBcOOBBBjBNBiBOBtEDB7UVBMUB14BBB-LEBuBCCBDBCBB5BGBDNBZIBI4BI-DhBBb6C6CBKB3GZBxC3C3CBoDoDBDBsB-C-C3CIBxBuzcuzcBBB4BIB9KTB5FHB+GTB9BCBLFB5BHBnCHBNFB1DKBfCBvCMMBCBiB4B4BBHBPBBLBBoDXBdJBHBBHBBHIBIII9BDB-DBBLFBl9KLBYDByBjoIBvLBBrDlBBILBGEBbGGCGDrUfBrBFB0BUUFDBGoEoEBCC-FCBHBBHBBHBBECBIIIBIBGBBNbbUDDQBBPhBB8DEBEDBuBCB5COOBBBCuBBvBhEBeCByBOBdDBlBIBfEBsBEBfmBmBBCBPpBB-EBBLFBlBDBlBDBpBHB1BKBNQQIDDMQQIDDBBB1BLB4JIBXJBJXBHrBrBKkCBHBBCtBtBDCBCBBYpCpCBGBKvBBUDDBDBiBCBcEBclBB5BDBVBBzBDDBDBJEEeBBEDBLGBKGBhCfBoBDBNIB3BCBeBBcEBbGBFLBIvCBqC2BB0BMB0BGBvBHBLFBnBCBeHBDvGBgBrBrBEBBDPBHHBKgBBvBHBrBVBblBBdTBYIBvCDBlBIBlCJBCBBaGBLFB2BTTBGBoBIBhDVVBJBTwBwBB8BBICCFQQMFB8BEBLFBFJJBDDBXXIDDGLLBDDBEEBCCBEBCEBIBBICBGKBLCCBCCnBLLCBBCFFLDDBGBDcB9CGGBcBpCHBLlFB3BBBnBhBBmCKBLFBOSB7BFBLFBVbBcBBQDBY4FB9BjDB0CLBJBBCBBJDDfDDBNNBHBLlCBJBBvBBBMaBpCHB0CMBqCGBL1CBJ3CBjBNBLFBKuBuBPJBeCBhBBBXPPBnCBIDDtBCBCDDKHBLFBHDDmBDDHGBLFBtBDBL1HBaGBSqBqBBBBe0CBCOBzBMB8clDBwDGGBJBlGryCBkDMB3iBJB88DEBoS41GB7Bl2BB6RGBgBLLBCByCLLBEBfBBHJBnCJBLIIWEBUvNB7BlGB8CEBaBBarBBsCDB6BGBS-BBGKBIIB3mHoBBhBgDB0D8vIBFIIDkJkJBNBCcBEBBCNBFHBtMjoCBsDEBOCBKGBLBBJ76DB+HCB1NFBYOBSOBvBBBYIB1D7BB3HJBoBBBjGUBnC5DBVLBVLB4CIBamEB2CoCoCDBBCBBDBBFNNCIIiCFFBJJIddFGGCCBI1K1KBlJlJB-V-VBNBGQQBuiBBgBFBH0GBISSBIIDGGBDB-BgBBCvDBuBCBPBBLDBD-JBgBQB7BEBCvOBrB1GBsBDBC-FBgBXXBGBD-GBIFFDQQmGBBRoBBtCDBLDBDwYBlCrCB+BhGBFccDCCBCCLFFCCCBEBCDBCECEDDCBBCICDCCBFFIKFCLLSEBEGGSzBBDtIBtBDBlDLBQBBQQQmBJBvF3BBeMBtBDBKGBDNBH5EB6eCBSCBOCB7GFBNDBCOBNDB5BHBLFBpBHBfBBNDBDNBKmBB5KHBPBBOCBMCB6BCCBCBRBBNDBLGB0EoDoDBjgBBh3pBfB-oEBBv0FBBypHOBvThtCB-QhvBBs6EEBrpIm8yVBCdBhD-DBxHvw-FB",!1)),Vai:()=>new wB(_B("gopBrJ",!0)),Vithkuqi:()=>new wB(_B("wrhCKCOCGCBCKCOCGCB",!0)),Wancho:()=>new wB(_B("g24D5BGA",!0)),Warang_Citi:()=>new wB(_B("glmCyCNA",!0)),Yezidi:()=>new wB(_B("g0jCpBCCDB",!0)),Yi:()=>new wB(_B("ggoBskBE2B",!0)),Zanabazar_Square:()=>new wB(_B("gwmCnC",!0))});static FOLD_CATEGORIES=new DB({L:()=>new wB(_B("laA",!0)),LC:()=>new wB(_B("laA",!0)),Ll:()=>new wB(_B("hCZBmDWBCGBiBuBCEECDOCDuBCBECEBBCCCBCCBBBDDBCBBCCBEBBCBBCECBCCDCCBCCBBBCCCBEEIBBCBBCBBCOCDQCDBBCCCBBBC4BCIBBCBBDCCBCBCGC3HrBrBCEEJHHCCBCCCBCCBPBCIBkBJJCUCGDDCBBDyBBxBgBCK2BCBMCD+CCDlBBq6ClBBCGGzW1CB0kCHHBpBBDCBhK0ECKgDCKHBJFBLHBJHBJFBMGCJHBZHBJHBJHBJEBMEBMDBNEBMEBqJEEBHHxC9zC9zCBuBBxBCCBBBDGCBCBCDDJCBCgDCJCCFuqeuqeCqBCUaCoEMCE8BCLECBICFCCDCCEUCBDBCEBCOCBCBCCCBQCZs5Vs5VBYBmmBnBBpEjBB9EKBCOBCGBCBBr3ByBB+EVB75CfBhsVfBhCYBoyehBB",!1)),Lt:()=>new wB(_B("kOCCBCCBCClBCCtsHHBJHBJHBMQQwBAB",!1)),Lu:()=>new wB(_B("hDZB7BqBqBBWBCHBCuBCEECDOCDsBCDECBBBDCCDEEGDDECBDDDCCCDFFDEECDDECCGBBCBBCBBCOCBSCDBBCEECkBCEQCJDDBCCFICBEBCBBCCCBEEBCCBCBCEBDCCBDDIDDCBBEFBGLLBnFnFsBCCEEEBBBvBDBCdBCBBECBCWCBDBCGD1BvBBCgBCK0BCDMCBgDCyBlBBq6CqBBDCB5XFBjkCIBCvHvHERRzD0ECGGGC8CCBHBJFBLHBJHBJFBMGCJHBJNBzBBBNSSBPPBEEpL2B2Bs1CvBBCEEBGCHDDLiDCJCCFNNBkBBCGG0oesBCUaCoEMCE8BCLCCDICFFFCBBDSCMOCFCCDOCb9a9advCBi8UZBumBnBBpEjBB8EKBCOBCGBCBBk4ByBB+DVB75CfBhsVfB8BYBvyehBB",!1)),M:()=>new wB(_B("5cgBgBlgHAB",!1)),Mn:()=>new wB(_B("5cgBgBlgHAB",!1)),Emoji:()=>new wB(_B("8mJA",!0)),Extended_Pictographic:()=>new wB(_B("8mJA",!0)),Lowercase:()=>new wB(_B("hCZBmDWBCGBiBuBCEECDOCDuBCBECEBBCCCBCCBBBDDBCBBCCBEBBCBBCECBCCDCCBCCBBBCCCBEEIBBCBBCBBCOCDQCDBBCCCBBBC4BCIBBCBBDCCBCBCGCiJCCEJJHCCBBBCCCBCCBPBCIBkBJJCUCGDDCBBDyBBxBgBCK2BCBMCD+CCDlBBq6ClBBCGGzW1CB0kCHHBpBBDCBhK0ECKgDCKHBJFBLHBJHBJFBMGCJHBZHBJHBJHBJEBMEBMDBNEBMEBqJEEBHHuBPBUzZzZBYBx5BvBBxBCCBBBDGCBCBCDDJCBCgDCJCCFuqeuqeCqBCUaCoEMCE8BCLECBICFCCDCCEUCBDBCEBCOCBCBCCCBQCZs5Vs5VBYBmmBnBBpEjBB9EKBCOBCGBCBBr3ByBB+EVB75CfBhsVfBhCYBoyehBB",!1)),Math:()=>new wB(_B("ycGDCHHFMMDDDCHHFAB",!1)),Uppercase:()=>new wB(_B("hDZB7BqBqBBWBCHBCuBCEECDOCDsBCDECBBBDCCDEEGDDECBDDDCCCDFFDEECDDECCGBBCBBCBBCOCBSCDBBCEECkBCEQCJDDBCCFICBEBCBBCCCBEEBCCBCBCEBDCCBDDIDDCBBEFBGLLBnFnFsBCCEEEBBBvBDBCdBCBBECBCWCBDBCGD1BvBBCgBCK0BCDMCBgDCyBlBBq6CqBBDCB5XFBjkCIBCvHvHERRzD0ECGGGC8CCBHBJFBLHBJHBJFBMGCJHBJNBzBBBNSSBPPBEEpLiBiBBOBFsasaBYBn6BvBBCEEBGCHDDLiDCJCCFNNBkBBCGG0oesBCUaCoEMCE8BCLCCDICFFFCBBDSCMOCFCCDOCb9a9advCBi8UZBumBnBBpEjBB8EKBCOBCGBCBBk4ByBB+DVB75CfBhsVfB8BYBvyehBB",!1))});static FOLD_SCRIPT=new DB({Common:()=>new wB(_B("8cgBgB",!1)),Greek:()=>new wB(_B("1FwUwU",!1)),Inherited:()=>new wB(_B("5cgBgBlgHAB",!1))})},vB=class t{static MAX_RUNE=1114111;static RUNE_ERROR=65533;static isUnsearchable(e){return e===t.RUNE_ERROR||e>=t.MIN_HIGH_SURROGATE&&e<=t.MAX_LOW_SURROGATE}static MAX_ASCII=127;static MAX_LATIN1=255;static MAX_BMP=65535;static MIN_FOLD=65;static MAX_FOLD=125251;static MIN_HIGH_SURROGATE=55296;static MAX_HIGH_SURROGATE=56319;static MIN_LOW_SURROGATE=56320;static MAX_LOW_SURROGATE=57343;static MIN_SUPPLEMENTARY_CODE_POINT=65536;static is32(t,e){let n=0,s=t.length;for(;n<s;){const r=n+Math.floor((s-n)/2),i=t.getLo(r),o=t.getHi(r);if(i<=e&&e<=o){return(e-i)%t.getStride(r)===0}e<i?s=r:n=r+1}return!1}static is(e,n){if(n<=t.MAX_LATIN1){for(let t=0;t<e.length;t++){if(n>e.getHi(t))continue;const s=e.getLo(t);if(n<s)return!1;return(n-s)%e.getStride(t)===0}return!1}return e.length>0&&n>=e.getLo(0)&&t.is32(e,n)}static isPrint(e){return e<=t.MAX_LATIN1?e>=32&&e<t.MAX_ASCII||e>=161&&173!==e:t.is(bB.Print,e)}static simpleFold(e){if(bB.CASE_ORBIT.has(e))return bB.CASE_ORBIT.get(e);if(e<=t.MAX_ASCII){const t=mB.toLowerCase(e);return t!==e?t:mB.toUpperCase(e)}return e}static equalsIgnoreCase(e,n){if(e===n)return!0;if(e<0||n<0)return!1;if(e<=t.MAX_ASCII&&n<=t.MAX_ASCII)return 65<=e&&e<=90&&(e|=32),65<=n&&n<=90&&(n|=32),e===n;for(let s=t.simpleFold(e);s!==e;s=t.simpleFold(s))if(s===n)return!0;return!1}};const IB=new Uint8Array(256);for(let t=0;t<256;t++)IB[t]=97<=t&&t<=122||65<=t&&t<=90||48<=t&&t<=57||95===t?1:0;let TB=null,OB=null;var AB=class t{static METACHARACTERS="\\.+*?()|[]{}^$";static EMPTY_BEGIN_LINE=1;static EMPTY_END_LINE=2;static EMPTY_BEGIN_TEXT=4;static EMPTY_END_TEXT=8;static EMPTY_WORD_BOUNDARY=16;static EMPTY_NO_WORD_BOUNDARY=32;static EMPTY_ALL=-1;static emptyInts(){return[]}static isByteArray(t){return Array.isArray(t)||"[object Uint8Array]"===Object.prototype.toString.call(t)}static isalnum(t){return mB.CODES[0]<=t&&t<=mB.CODES[9]||mB.CODES.a<=t&&t<=mB.CODES.z||mB.CODES.A<=t&&t<=mB.CODES.Z}static unhex(t){return mB.CODES[0]<=t&&t<=mB.CODES[9]?t-mB.CODES[0]:mB.CODES.a<=t&&t<=mB.CODES.f?t-mB.CODES.a+10:mB.CODES.A<=t&&t<=mB.CODES.F?t-mB.CODES.A+10:-1}static escapeRune(e){let n="";if(vB.isPrint(e))t.METACHARACTERS.indexOf(String.fromCodePoint(e))>=0&&(n+="\\"),n+=String.fromCodePoint(e);else switch(e){case mB.CODES['"']:n+='\\"';break;case mB.CODES["\\"]:n+="\\\\";break;case mB.CODES["\t"]:n+="\\t";break;case mB.CODES["\n"]:n+="\\n";break;case mB.CODES["\r"]:n+="\\r";break;case mB.CODES["\b"]:n+="\\b";break;case mB.CODES["\f"]:n+="\\f";break;default:{let t=e.toString(16);e<256?(n+="\\x",1===t.length&&(n+="0"),n+=t):n+=`\\x{${t}}`;break}}return n}static stringToRunes(t){const e=String(t),n=[];let s=0;for(;s<e.length;){const t=e.codePointAt(s);n.push(t),s+=t>vB.MAX_BMP?2:1}return new Int32Array(n)}static runeToString(t){return String.fromCodePoint(t)}static isWordRune(t){return t<256&&1===IB[t]}static emptyOpContext(e,n){let s=0;return e<0&&(s|=t.EMPTY_BEGIN_TEXT|t.EMPTY_BEGIN_LINE),10===e&&(s|=t.EMPTY_BEGIN_LINE),n<0&&(s|=t.EMPTY_END_TEXT|t.EMPTY_END_LINE),10===n&&(s|=t.EMPTY_END_LINE),t.isWordRune(e)!==t.isWordRune(n)?s|=t.EMPTY_WORD_BOUNDARY:s|=t.EMPTY_NO_WORD_BOUNDARY,s}static quoteMeta(e){return e.split("").map(e=>t.METACHARACTERS.indexOf(e)>=0?`\\${e}`:e).join("")}static charCount(t){return t>vB.MAX_BMP?2:1}static toArray(t){const e=t.length,n=new Array(e);for(let s=0;s<e;s++)n[s]=t[s];return n}static stringToUtf8ByteArray(t){if(globalThis.TextEncoder)return TB||(TB=new TextEncoder),TB.encode(t);{let e=[],n=0;for(let s=0;s<t.length;s++){let r=t.charCodeAt(s);r<128?e[n++]=r:r<2048?(e[n++]=r>>6|192,e[n++]=63&r|128):(64512&r)===vB.MIN_HIGH_SURROGATE&&s+1<t.length&&(64512&t.charCodeAt(s+1))===vB.MIN_LOW_SURROGATE?(r=vB.MIN_SUPPLEMENTARY_CODE_POINT+((1023&r)<<10)+(1023&t.charCodeAt(++s)),e[n++]=r>>18|240,e[n++]=r>>12&63|128,e[n++]=r>>6&63|128,e[n++]=63&r|128):(e[n++]=r>>12|224,e[n++]=r>>6&63|128,e[n++]=63&r|128)}return e}}static utf8ByteArrayToString(t){if(globalThis.TextDecoder){OB||(OB=new TextDecoder("utf-8"));const e=t instanceof Uint8Array?t:new Uint8Array(t);return OB.decode(e)}{let e=[],n=0,s=0;for(;n<t.length;){let r=t[n++];if(r<128)e[s++]=String.fromCharCode(r);else if(r>191&&r<224){let i=t[n++];e[s++]=String.fromCharCode((31&r)<<6|63&i)}else if(r>239&&r<365){let i=((7&r)<<18|(63&t[n++])<<12|(63&t[n++])<<6|63&t[n++])-vB.MIN_SUPPLEMENTARY_CODE_POINT;e[s++]=String.fromCharCode(vB.MIN_HIGH_SURROGATE+(i>>10)),e[s++]=String.fromCharCode(vB.MIN_LOW_SURROGATE+(1023&i))}else{let i=t[n++],o=t[n++];e[s++]=String.fromCharCode((15&r)<<12|(63&i)<<6|63&o)}}return e.join("")}}};const SB=(t=[],e=0)=>{const n=Object.create(null);for(let s=0;s<t.length;s++){const r=t[s],i=e+s;n[r]=i,n[i]=r}return Object.freeze(n)};var RB=class t{static Encoding=SB(["UTF_16","UTF_8"]);getEncoding(){throw Error("not implemented")}asCharSequence(){throw Error("not implemented")}asBytes(){throw Error("not implemented")}length(){throw Error("not implemented")}isUTF8Encoding(){return this.getEncoding()===t.Encoding.UTF_8}isUTF16Encoding(){return this.getEncoding()===t.Encoding.UTF_16}},NB=class extends RB{constructor(t=null){super(),this.bytes=t}getEncoding(){return RB.Encoding.UTF_8}asCharSequence(){return AB.utf8ByteArrayToString(this.bytes)}asBytes(){return this.bytes}length(){return this.bytes.length}},xB=class extends RB{constructor(t=null){super(),this.charSequence=t}getEncoding(){return RB.Encoding.UTF_16}asCharSequence(){return this.charSequence}asBytes(){return AB.stringToUtf8ByteArray(this.charSequence.toString())}length(){return this.charSequence.length}},kB=class{static utf16(t){return new xB(t)}static utf8(t){return AB.isByteArray(t)?new NB(t):new NB(AB.stringToUtf8ByteArray(t))}},LB=class{static EOF(){return-8}constructor(){this.start=0,this.end=0}canCheckPrefix(){return!0}endPos(){return this.end-this.start}hasString(){return!1}hasAnyString(){return!1}prefixLength(){return 0}},FB=class t extends LB{static RUNE_ERROR_STEP=vB.RUNE_ERROR<<3|1;constructor(t,e=0,n=t.length){super(),this.bytes=t,this.start=e,this.end=n}hasString(t,e){const n=t.bytes;if(0===n.length)return!0;const s=this.indexOf(this.bytes,n,this.start+e);return-1!==s&&s<=this.end-n.length}hasAnyString(t,e){return t.automaton8().searchUTF8(this.bytes,this.start+e,this.end)}step(e){if((e+=this.start)>=this.end)return LB.EOF();const n=255&this.bytes[e];if(n<128)return n<<3|1;let s,r,i=128,o=191;if(n>=194&&n<=223)s=2,r=31&n;else if(n>=224&&n<=239)s=3,r=15&n,224===n?i=160:237===n&&(o=159);else{if(!(n>=240&&n<=244))return t.RUNE_ERROR_STEP;s=4,r=7&n,240===n?i=144:244===n&&(o=143)}if(e+s>this.end)return t.RUNE_ERROR_STEP;const a=255&this.bytes[e+1];if(a<i||a>o)return t.RUNE_ERROR_STEP;if(r=r<<6|63&a,s>2){const n=255&this.bytes[e+2];if(128!=(192&n))return t.RUNE_ERROR_STEP;if(r=r<<6|63&n,s>3){const n=255&this.bytes[e+3];if(128!=(192&n))return t.RUNE_ERROR_STEP;r=r<<6|63&n}}return r<<3|s}index(t,e){e+=this.start;const n=this.indexOf(this.bytes,t.prefixUTF8,e);return n<0?n:n-e}context(t){let e=-1;if((t+=this.start)>this.start&&t<=this.end){let n=t-1;if(e=this.bytes[n--],e>=128){let s=t-4;for(s<this.start&&(s=this.start);n>=s&&128==(192&this.bytes[n]);)n--;n<this.start&&(n=this.start);const r=this.step(n-this.start);e=n+(7&r)===t?r>>3:vB.RUNE_ERROR}}const n=t<this.end?this.step(t-this.start)>>3:-1;return AB.emptyOpContext(e,n)}indexOf(t,e,n=0){let s=e.length;if(0===s)return n<=this.end?n:-1;const r=e[0];let i=this.end-s;const o="function"==typeof t.indexOf;let a=n;for(;a<=i;){if(o){if(a=t.indexOf(r,a),-1===a||a>i)return-1}else{for(;a<=i&&t[a]!==r;)a++;if(a>i)return-1}let n=!0;for(let r=1;r<s;r++)if(t[a+r]!==e[r]){n=!1;break}if(n)return a;a++}return-1}prefixLength(t){return t.prefixUTF8.length}},PB=class extends LB{constructor(t,e=0,n=t.length){super(),this.charSequence=t,this.start=e,this.end=n}hasString(t,e){const n=this.charSequence.indexOf(t.str,this.start+e);return-1!==n&&n<=this.end-t.str.length}hasAnyString(t,e){return t.automaton16().searchUTF16(this.charSequence,this.start+e,this.end)}step(t){if((t+=this.start)>=this.end)return LB.EOF();const e=this.charSequence.charCodeAt(t);if(e<vB.MIN_HIGH_SURROGATE||e>vB.MAX_HIGH_SURROGATE||t+1>=this.end)return e<<3|1;const n=this.charSequence.charCodeAt(t+1);return n>=vB.MIN_LOW_SURROGATE&&n<=vB.MAX_LOW_SURROGATE?1024*(e-vB.MIN_HIGH_SURROGATE)+(n-vB.MIN_LOW_SURROGATE)+vB.MIN_SUPPLEMENTARY_CODE_POINT<<3|2:e<<3|1}index(t,e){e+=this.start;const n=this.charSequence.indexOf(t.prefix,e);return n<0||n>this.end-t.prefix.length?-1:n-e}context(t){const e=(t+=this.start)>this.start&&t<=this.end?this.charSequence.charCodeAt(t-1):-1,n=t<this.end?this.charSequence.charCodeAt(t):-1;return AB.emptyOpContext(e,n)}prefixLength(t){return t.prefix.length}},MB=class{static fromUTF8(t,e=0,n=t.length){return new FB(t,e,n)}static fromUTF16(t,e=0,n=t.length){return new PB(t,e,n)}},GB=class extends Error{constructor(t){super(t),this.name="RE2JSException"}},HB=class extends GB{constructor(t,e=null){let n=`error parsing regexp: ${t}`;e&&(n+=`: \`${e}\``),super(n),this.name="RE2JSSyntaxException",this.message=n,this.error=t,this.input=e}getDescription(){return this.error}getPattern(){return this.input}},UB=class extends GB{constructor(t){super(t),this.name="RE2JSCompileException"}},VB=class extends GB{constructor(t){super(t),this.name="RE2JSGroupException"}},jB=class extends GB{constructor(t){super(t),this.name="RE2JSFlagsException"}},$B=class extends GB{constructor(t){super(t),this.name="RE2JSInternalException"}},JB=class t{static MAX_REPLACER_ARGS=65535;static quoteReplacement(t,e=!1){return e?t.indexOf("\\")<0&&t.indexOf("$")<0?t:t.split("").map(t=>{const e=t.codePointAt(0);return e===mB.CODES["\\"]||e===mB.CODES.$?`\\${t}`:t}).join(""):t.indexOf("$")<0?t:t.split("").map(t=>t.codePointAt(0)===mB.CODES.$?"$$":t).join("")}constructor(t,e){if(null===t)throw new Error("pattern is null");this.patternInput=t;const n=this.patternInput.re2();this.patternGroupCount=n.numberOfCapturingGroups(),this.groups=[],this.namedGroups=n.namedGroups,this.hasNamedGroups=Object.keys(this.namedGroups).length>0,this.numberOfInstructions=n.numberOfInstructions(),this.lookbehindState=null,e instanceof RB?this.resetMatcherInput(e):AB.isByteArray(e)?this.resetMatcherInput(kB.utf8(e)):this.resetMatcherInput(kB.utf16(e))}pattern(){return this.patternInput}reset(){return this.matcherInputLength=this.matcherInput.length(),this.appendPos=0,this.hasMatch=!1,this.hasGroups=!1,this.anchorFlag=0,this}resetMatcherInput(t){if(null===t)throw new Error("input is null");return t instanceof RB||(t=AB.isByteArray(t)?kB.utf8(t):kB.utf16(t)),this.matcherInput=t,null!==this.lookbehindState?this.lookbehindState.reset():this.lookbehindState=this.patternInput.re2().createLookbehindState(),this.reset(),this}start(t=0){if("string"==typeof t){const e=this.namedGroups[t];if(!Number.isFinite(e))throw new VB(`group '${t}' not found`);t=e}return this.loadGroup(t),this.groups[2*t]}end(t=0){if("string"==typeof t){const e=this.namedGroups[t];if(!Number.isFinite(e))throw new VB(`group '${t}' not found`);t=e}return this.loadGroup(t),this.groups[2*t+1]}programSize(){return this.numberOfInstructions}group(t=0){if("string"==typeof t){const e=this.namedGroups[t];if(!Number.isFinite(e))throw new VB(`group '${t}' not found`);t=e}const e=this.start(t),n=this.end(t);return e<0&&n<0?null:this.substring(e,n)}getNamedGroups(){if(!this.hasMatch)throw new VB("perhaps no match attempted");const t=Object.create(null);for(const e of Object.keys(this.namedGroups))t[e]=this.group(e);return t}groupCount(){return this.patternGroupCount}loadGroup(t){if(!Number.isInteger(t)||t<0||t>this.patternGroupCount)throw new VB(`Group index out of bounds: ${t}`);if(!this.hasMatch)throw new VB("perhaps no match attempted");if(0===t||this.hasGroups)return;const e=this.matcherInputLength,n=this.patternInput.re2().matchMachineInput(this.matcherInput,this.groups[0],e,this.anchorFlag,1+this.patternGroupCount,this.lookbehindState);if(!n[0])throw new VB("inconsistency in matching group data");this.groups=n[1],this.hasGroups=!0}matches(){return this.genMatch(0,aB.ANCHOR_BOTH)}lookingAt(){return this.genMatch(0,aB.ANCHOR_START)}find(t=null){if(null!==t){if(!Number.isInteger(t)||t<0||t>this.matcherInputLength)throw new VB(`start index out of bounds: ${t}`);return this.reset(),this.genMatch(t,0)}if(t=0,this.hasMatch&&(t=this.groups[1],this.groups[0]===this.groups[1])){const e=(this.matcherInput.isUTF16Encoding()?MB.fromUTF16(this.matcherInput.asCharSequence(),0,this.matcherInputLength):MB.fromUTF8(this.matcherInput.asBytes(),0,this.matcherInputLength)).step(t);e<0?t++:t+=7&e}return this.genMatch(t,aB.UNANCHORED)}genMatch(t,e){const n=this.patternInput.re2().matchMachineInput(this.matcherInput,t,this.matcherInputLength,e,1,this.lookbehindState);return n[0]?(this.groups=n[1],this.hasMatch=!0,this.hasGroups=0===this.patternGroupCount,this.anchorFlag=e,!0):(this.hasMatch=!1,!1)}substring(t,e){return this.matcherInput.isUTF8Encoding()?AB.utf8ByteArrayToString(this.matcherInput.asBytes().slice(t,e)):this.matcherInput.asCharSequence().substring(t,e).toString()}inputLength(){return this.matcherInputLength}appendReplacement(t,e=!1){let n="";const s=this.start(),r=this.end();return this.appendPos<s&&(n+=this.substring(this.appendPos,s)),this.appendPos=r,n+=e?this.appendReplacementInternalJava(t):this.appendReplacementInternalJs(t),n}appendReplacementInternalJava(t){let e="",n=0;const s=t.length;let r=0;for(;r<s;){const i=t.codePointAt(r);if(i!==mB.CODES["\\"]){if(i===mB.CODES.$){if(n<r&&(e+=t.substring(n,r)),r+1>=s)throw new VB("Illegal group reference: group index is missing");const i=t.codePointAt(r+1);if(mB.CODES[0]<=i&&i<=mB.CODES[9]){let o=i-mB.CODES[0],a=r+2;for(;a<s;a++){const e=t.codePointAt(a);if(e<mB.CODES[0]||e>mB.CODES[9]||10*o+e-mB.CODES[0]>this.patternGroupCount)break;o=10*o+e-mB.CODES[0]}if(o>this.patternGroupCount)throw new VB(`n > number of groups: ${o}`);const B=this.group(o);null!==B&&(e+=B),r=a,n=r}else{if(i!==mB.CODES["{"])throw new VB("Illegal group reference");{let i=r+2;for(;i<s&&t.codePointAt(i)!==mB.CODES["}"];)i++;if(i>=s)throw new VB("named capture group is missing trailing '}'");const o=t.substring(r+2,i),a=this.group(o);null!==a&&(e+=a),r=i+1,n=r}}continue}r++}else{if(n<r&&(e+=t.substring(n,r)),r++,r>=s)throw new VB("character to be escaped is missing");n=r,r++}}return n<s&&(e+=t.substring(n,s)),e}appendReplacementInternalJs(t){const e=t=>t>=48&&t<=57,n=this.patternGroupCount;let s="",r=0;for(;r<t.length;){const i=t.indexOf("$",r);if(i<0)break;s+=t.substring(r,i),r=i;const o=t.charCodeAt(r+1);if(o===mB.CODES.$)s+="$",r+=2;else if(o===mB.CODES["&"])s+=this.group(0),r+=2;else if(o===mB.CODES["`"])s+=this.substring(0,this.start(0)),r+=2;else if(o===mB.CODES["'"])s+=this.substring(this.end(0),this.matcherInputLength),r+=2;else if(e(o)){let i=1,a=o-48;const B=t.charCodeAt(r+2);if(e(B)&&10*a+B-48<=n&&(i=2,a=10*a+B-48),a>=1&&a<=n){const t=this.group(a);null!==t&&(s+=t)}else s+=t.substring(r,r+1+i);r+=1+i}else if(o===mB.CODES["<"]&&this.hasNamedGroups){const e=t.indexOf(">",r+2);if(e<0)s+="$<",r+=2;else{const n=t.substring(r+2,e);if(Object.prototype.hasOwnProperty.call(this.namedGroups,n)){const t=this.group(n);null!==t&&(s+=t)}r=e+1}}else s+="$",r+=1}return s+t.substring(r)}appendTail(){return this.substring(this.appendPos,this.matcherInputLength)}replaceAll(t,e=!1){return this.replace(t,!0,e)}replaceFirst(t,e=!1){return this.replace(t,!1,e)}replace(e,n=!0,s=!1){let r="";this.reset();const i="function"==typeof e;let o=null;if(i){if(this.groupCount()>=t.MAX_REPLACER_ARGS)throw new VB("Too many capture groups to safely invoke replacer function");o=this.matcherInput.isUTF8Encoding()?this.matcherInput.asBytes():this.matcherInput.asCharSequence()}for(;this.find()&&(r+=i?this.appendReplacementFunc(e,o):this.appendReplacement(e,s),n););return r+=this.appendTail(),r}appendReplacementFunc(t,e){let n="";const s=this.start(),r=this.end();this.appendPos<s&&(n+=this.substring(this.appendPos,s)),this.appendPos=r;const i=this.matchArray();return i.push(s,e),this.hasNamedGroups&&i.push(this.namedGroupsObject()),n+=String(t(...i)),n}matchArray(){const t=[this.group(0)];for(let e=1;e<=this.patternGroupCount;e++){const n=this.group(e);t.push(null===n?void 0:n)}return t}namedGroupsObject(){if(!this.hasNamedGroups)return;const t=this.getNamedGroups();for(const e in t)null===t[e]&&(t[e]=void 0);return t}},qB=class t{static ALT=1;static ALT_MATCH=2;static CAPTURE=3;static EMPTY_WIDTH=4;static FAIL=5;static MATCH=6;static NOP=7;static RUNE=8;static RUNE1=9;static RUNE_ANY=10;static RUNE_ANY_NOT_NL=11;static LB_WRITE=12;static LB_CHECK=13;static isRuneOp(e){return t.RUNE<=e&&e<=t.RUNE_ANY_NOT_NL}static escapeRunes(t){let e='"';for(let n of t)e+=AB.escapeRune(n);return e+='"',e}constructor(t){this.op=t,this.out=0,this.arg=0,this.runes=new Int32Array(0),this.next=null}matchRune(t){if(1===this.runes.length){const e=this.runes[0];return 0!==(this.arg&aB.FOLD_CASE)?vB.equalsIgnoreCase(e,t):t===e}const e=this.runes.length;if(0===e)return!1;if(2===e||4===e||6===e||8===e){for(let n=0;n<e;n+=2){if(t<this.runes[n])return!1;if(t<=this.runes[n+1])return!0}return!1}let n=0,s=e>>1;for(;s>1;){const e=s>>1;n+=this.runes[n+e<<1]<=t?e:0,s-=e}n+=this.runes[n<<1]<=t?1:0;const r=n-1;return r>=0&&t<=this.runes[r<<1|1]}matchRunePos(t){if(1===this.runes.length){const e=this.runes[0];return 0!==(this.arg&aB.FOLD_CASE)?vB.equalsIgnoreCase(e,t)?0:-1:t===e?0:-1}const e=this.runes.length;if(0===e)return-1;if(2===e||4===e||6===e||8===e){for(let n=0;n<e;n+=2){if(t<this.runes[n])return-1;if(t<=this.runes[n+1])return Math.floor(n/2)}return-1}let n=0,s=e>>1;for(;s>1;){const e=s>>1;n+=this.runes[n+e<<1]<=t?e:0,s-=e}n+=this.runes[n<<1]<=t?1:0;const r=n-1;return r>=0&&t<=this.runes[r<<1|1]?r:-1}toString(){switch(this.op){case t.ALT:return`alt -> ${this.out}, ${this.arg}`;case t.ALT_MATCH:return`altmatch -> ${this.out}, ${this.arg}`;case t.CAPTURE:return`cap ${this.arg} -> ${this.out}`;case t.EMPTY_WIDTH:return`empty ${this.arg} -> ${this.out}`;case t.MATCH:return"match"+(0!==this.arg?` ${this.arg}`:"");case t.FAIL:return"fail";case t.NOP:return`nop -> ${this.out}`;case t.LB_WRITE:return`lbwrite ${this.arg} -> ${this.out}`;case t.LB_CHECK:return`lbcheck ${this.arg} -> ${this.out}`;case t.RUNE:return null===this.runes?"rune <null>":["rune ",t.escapeRunes(this.runes),0!==(this.arg&aB.FOLD_CASE)?"/i":""," -> ",this.out].join("");case t.RUNE1:return`rune1 ${t.escapeRunes(this.runes)} -> ${this.out}`;case t.RUNE_ANY:return`any -> ${this.out}`;case t.RUNE_ANY_NOT_NL:return`anynotnl -> ${this.out}`;default:throw new Error("unhandled case in Inst.toString")}}},zB=class t{constructor(t){this.sparse=new Int32Array(t),this.densePcs=new Int32Array(t),this.denseCaps=null,this.size=0,this.ncap=0,this.mainThreads=0}static INITIAL_THREADS=32;init(e){this.ncap=e;const n=Math.min(this.densePcs.length,t.INITIAL_THREADS)*e;(!this.denseCaps||this.denseCaps.length<n)&&(this.denseCaps=new Int32Array(n))}growCaps(t){const e=this.densePcs.length*this.ncap,n=new Int32Array(Math.min(e,Math.max(t,2*this.denseCaps.length)));n.set(this.denseCaps),this.denseCaps=n}contains(t){const e=this.sparse[t];return e<this.size&&this.densePcs[e]===t}isEmpty(){return 0===this.size}add(t){const e=this.size++;return this.sparse[t]=e,this.densePcs[e]=t,e}clear(){this.size=0,this.mainThreads=0}toString(){let t="{";for(let e=0;e<this.size;e++)0!==e&&(t+=", "),t+=this.densePcs[e];return t+="}",t}},KB=class{constructor(t){this.pos=-1,this.pcs=new Int32Array(t.numInst()),this.size=0,this.lbTable=new Int32Array(t.numLb+1)}reset(){this.pos=-1,this.size=0}},QB=class t{static fromRE2(e){const n=new t;return n.prog=e.prog,n.re2=e,n.q0=new zB(n.prog.numInst()),n.q1=new zB(n.prog.numInst()),n.addStack=new Int32Array(2*(n.prog.numInst()+1)),n.matched=!1,n.matchcap=new Int32Array(n.prog.numCap<2?2:n.prog.numCap),n.ncap=0,n}constructor(){this.prog=null,this.re2=null,this.q0=null,this.q1=null,this.addStack=null,this.matched=!1,this.matchcap=null,this.ncap=0,this.lbTable=null}init(t){this.ncap=t,t>this.matchcap.length?this.matchcap=new Int32Array(t).fill(-1):this.matchcap.fill(-1),this.q0.init(t),this.q1.init(t),this.prog.numLb>0&&((!this.lbTable||this.lbTable.length<this.prog.numLb+1)&&(this.lbTable=new Int32Array(this.prog.numLb+1)),this.lbTable.fill(-1))}submatches(){return 0===this.ncap?AB.emptyInts():AB.toArray(this.matchcap.subarray(0,this.ncap))}match(t,e,n,s=null){const r=this.re2.cond;if(r===AB.EMPTY_ALL)return!1;if((n===aB.ANCHOR_START||n===aB.ANCHOR_BOTH)&&0!==e)return!1;this.matched=!1,this.matchcap.fill(-1);const i=this.prog.numLb>0,o=e;let a=e,B=!1;i&&(null!==s&&s.pos>=0&&s.pos<=e?(a=s.pos,B=!0):a=0);let c,l=i&&null!==s,u=this.q0,h=this.q1,d=t.step(a),p=d>>3,f=7&d,C=-1,g=0;for(d!==LB.EOF()&&(d=t.step(a+f),C=d>>3,g=7&d),c=0===a?AB.emptyOpContext(-1,p):t.context(a),i&&(B?this.restoreLookbehinds(s,u,c):this.spawnLookbehinds(u,a,c));;){if(0===u.mainThreads){if(0!==(r&AB.EMPTY_BEGIN_TEXT)&&0!==a)break;if((n===aB.ANCHOR_START||n===aB.ANCHOR_BOTH)&&0!==a)break;if(this.matched)break;if(0===this.prog.numLb&&u.isEmpty()&&0!==this.re2.prefix.length&&C!==this.re2.prefixRune&&t.canCheckPrefix()){const e=t.index(this.re2,a);if(e<0)break;a+=e,d=t.step(a),p=d>>3,f=7&d,d=t.step(a+f),C=d>>3,g=7&d,c=t.context(a)}}a>=o&&(l&&(this.saveLookbehinds(s,u,a),l=!1),this.matched||0!==a&&n!==aB.UNANCHORED||(this.ncap>0&&(this.matchcap[0]=a),this.add(u,this.prog.start,a,this.matchcap,0,c)));const e=a+f;if(c=t.context(e),this.step(u,h,a,e,p,c,n,a===t.endPos()),0===f)break;if(0===this.ncap&&this.matched)break;a+=f,p=C,f=g,-1!==p&&(d=t.step(a+f),C=d>>3,g=7&d);const i=u;u=h,h=i}return u.clear(),h.clear(),this.matched}matchSet(t,e,n){const s=this.re2.cond;if(s===AB.EMPTY_ALL)return[];if((n===aB.ANCHOR_START||n===aB.ANCHOR_BOTH)&&0!==e)return[];let r=this.prog.numLb>0?0:e,i=e,o=this.q0,a=this.q1,B=t.step(r),c=B>>3,l=7&B,u=-1,h=0;B!==LB.EOF()&&(B=t.step(r+l),u=B>>3,h=7&B);let d=0===r?AB.emptyOpContext(-1,c):t.context(r);const p=new Set;for(this.prog.numLb>0&&this.spawnLookbehinds(o,r,d);;){if(0===o.mainThreads){if(0!==(s&AB.EMPTY_BEGIN_TEXT)&&0!==r)break;if((n===aB.ANCHOR_START||n===aB.ANCHOR_BOTH)&&0!==r)break}0!==r&&n!==aB.UNANCHORED||r>=i&&this.add(o,this.prog.start,r,this.matchcap,0,d);const e=r+l;d=t.context(e);for(let s=0;s<o.size;s++){const i=o.densePcs[s],B=this.prog.inst[i],l=s*this.ncap;let u=!1;switch(B.op){case qB.MATCH:if(n===aB.ANCHOR_BOTH&&r!==t.endPos())break;p.add(B.arg);break;case qB.RUNE:u=B.matchRune(c);break;case qB.RUNE1:u=c===B.runes[0];break;case qB.RUNE_ANY:u=!0;break;case qB.RUNE_ANY_NOT_NL:u=10!==c;break;default:continue}u&&this.add(a,B.out,e,o.denseCaps,l,d)}if(o.clear(),0===l)break;r+=l,c=u,l=h,-1!==c&&(B=t.step(r+l),u=B>>3,h=7&B);const f=o;o=a,a=f}return a.clear(),Array.from(p).sort((t,e)=>t-e)}step(t,e,n,s,r,i,o,a){const B=this.re2.longest;for(let c=0;c<t.size;c++){const l=t.densePcs[c],u=c*this.ncap;if(B&&this.matched&&this.ncap>0&&this.matchcap[0]<t.denseCaps[u])continue;const h=this.prog.inst[l];let d=!1;switch(h.op){case qB.MATCH:if(o===aB.ANCHOR_BOTH&&!a)break;if(this.ncap>0&&(!B||!this.matched||this.matchcap[1]<n)){t.denseCaps[u+1]=n;for(let e=0;e<this.ncap;e++)this.matchcap[e]=t.denseCaps[u+e]}B||(t.size=0),this.matched=!0;break;case qB.RUNE:d=h.matchRune(r);break;case qB.RUNE1:d=r===h.runes[0];break;case qB.RUNE_ANY:d=!0;break;case qB.RUNE_ANY_NOT_NL:d=10!==r;break;default:continue}d&&this.add(e,h.out,s,t.denseCaps,u,i)}t.clear()}spawnLookbehinds(t,e,n){for(let s=0;s<this.prog.lbStarts.length;s++)this.add(t,this.prog.lbStarts[s],e,this.matchcap,0,n)}restoreLookbehinds(t,e,n){this.lbTable.set(t.lbTable);for(let s=0;s<t.size;s++)this.add(e,t.pcs[s],t.pos,this.matchcap,0,n)}saveLookbehinds(t,e,n){let s=0;for(let n=0;n<e.size;n++){const r=e.densePcs[n];1===this.prog.lbInst[r]&&qB.isRuneOp(this.prog.inst[r].op)&&(t.pcs[s++]=r)}t.size=s,t.pos=n,t.lbTable.set(this.lbTable)}add(t,e,n,s,r,i){const o=this.addStack;let a=0;for(;;){for(;0!==e&&!t.contains(e);){const B=t.add(e),c=this.prog.inst[e];switch(c.op){case qB.FAIL:e=0;break;case qB.ALT:case qB.ALT_MATCH:o[a++]=c.arg,o[a++]=0,e=c.out;break;case qB.EMPTY_WIDTH:e=0===(c.arg&~i)?c.out:0;break;case qB.NOP:e=c.out;break;case qB.CAPTURE:c.arg<this.ncap&&(o[a++]=-c.arg-1,o[a++]=s[r+c.arg],s[r+c.arg]=n),e=c.out;break;case qB.LB_WRITE:this.lbTable[Math.abs(c.arg)]=n,e=c.out;break;case qB.LB_CHECK:e=c.arg>0?this.lbTable[c.arg]===n?c.out:0:this.lbTable[-c.arg]!==n?c.out:0;break;case qB.MATCH:case qB.RUNE:case qB.RUNE1:case qB.RUNE_ANY:case qB.RUNE_ANY_NOT_NL:if(0===this.prog.lbInst[e]&&t.mainThreads++,this.ncap>0){const e=B*this.ncap;e+this.ncap>t.denseCaps.length&&t.growCaps(e+this.ncap);for(let n=0;n<this.ncap;n++)t.denseCaps[e+n]=s[r+n]}e=0;break;default:throw new $B("unhandled")}}if(0===a)return;a-=2;const B=o[a];B<0?(s[r-B-1]=o[a+1],e=0):e=B}}};const WB=(t,e)=>{if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0},YB=(t,e,n,s)=>t.flag===n&&WB(t.nfaStates,e)&&WB(t.matchIDs,s),XB=[];var ZB=class{constructor(t,e,n){this.nfaStates=t,this.flag=e,this.isMatch=0!==(e&tc.FLAG_MATCH),this.matchIDs=n,this.next=null,this.nextAnchored=null}},tc=class t{static FLAG_EMPTY_MASK=255;static FLAG_MATCH=256;static FLAG_LAST_WORD=512;static FLAG_NEED_SHIFT=16;static STATE_OVERHEAD=150;static ARRAY_OVERHEAD=40;static ELEMENT_SIZE=8;static TABLE_OVERHEAD=48;static PROGRESS_PER_STATE=10;constructor(t,e=8388608){this.prog=t,this.maxMem=e,this.stateCache=new Map,this.stateCount=0,this.startStates=new Map,this.failed=!1;for(let e=0;e<t.numInst();e++){const n=t.getInst(e).op;if(n===qB.LB_WRITE||n===qB.LB_CHECK){this.failed=!0;break}}this.computeRuneClasses(),this.stateBudget=e,this.memBudget=e}computeRuneClasses(){const t=new Set,e=(e,n)=>{t.add(e),t.add(n+1)};for(let t=0;t<this.prog.numInst();t++){const n=this.prog.getInst(t);switch(n.op){case qB.RUNE:case qB.RUNE1:if(1===n.runes.length){if(e(n.runes[0],n.runes[0]),0!==(n.arg&aB.FOLD_CASE))for(let t=vB.simpleFold(n.runes[0]);t!==n.runes[0];t=vB.simpleFold(t))e(t,t)}else for(let t=0;t<n.runes.length;t+=2)e(n.runes[t],n.runes[t+1]);break;case qB.RUNE_ANY_NOT_NL:e(10,10);break;case qB.EMPTY_WIDTH:0!==(n.arg&(AB.EMPTY_BEGIN_LINE|AB.EMPTY_END_LINE))&&e(10,10),0!==(n.arg&(AB.EMPTY_WORD_BOUNDARY|AB.EMPTY_NO_WORD_BOUNDARY))&&(e(48,57),e(65,90),e(95,95),e(97,122))}}t.delete(0),this.classBounds=Int32Array.from(t).sort(),this.numClasses=this.classBounds.length+1;const n=new Int32Array(vB.MAX_LATIN1+1);for(let t=0;t<=vB.MAX_LATIN1;t++)n[t]=this.searchClass(t);this.latin1Class=n}runeClass(t){return t<=vB.MAX_LATIN1?this.latin1Class[t]:this.searchClass(t)}searchClass(t){const e=this.classBounds;let n=0,s=e.length;for(;n<s;){const r=n+s>>1;e[r]<=t?n=r+1:s=r}return n}closure(t,e){const n=new Set,s=Array.from(t);let r=0;for(;s.length>0;){const t=s.pop();if(0===t||n.has(t))continue;n.add(t);const i=this.prog.getInst(t);switch(i.op){case qB.ALT:case qB.ALT_MATCH:s.push(i.out),s.push(i.arg);break;case qB.NOP:case qB.CAPTURE:s.push(i.out);break;case qB.EMPTY_WIDTH:r|=i.arg,0===(i.arg&~e)&&s.push(i.out)}}return{pcs:Array.from(n).sort((t,e)=>t-e),needflags:r}}getState(e,n,s){const r=((t,e,n)=>{let s=-2128831035;for(let e=0;e<t.length;e++)s^=t[e],s=Math.imul(s,16777619);s^=e,s=Math.imul(s,16777619);for(let t=0;t<n.length;t++)s^=n[t],s=Math.imul(s,16777619);return s})(e,n,s),i=this.stateCache.get(r);if(i instanceof ZB){if(YB(i,e,n,s))return i}else if(void 0!==i)for(let t=0;t<i.length;t++)if(YB(i[t],e,n,s))return i[t];const o=t.stateCost(e,s);if(this.memBudget<o)return null;this.memBudget-=o;const a=new ZB(e,n,s);return void 0===i?this.stateCache.set(r,a):i instanceof ZB?this.stateCache.set(r,[i,a]):i.push(a),this.stateCount++,a}static stateCost(e,n){const s=0===n.length?0:t.ARRAY_OVERHEAD+t.ELEMENT_SIZE*n.length;return t.STATE_OVERHEAD+t.ELEMENT_SIZE*e.length+s}*cachedStates(){for(const t of this.stateCache.values())t instanceof ZB?yield t:yield*t}makeState(e,n,s){const r=this.closure(e,n&t.FLAG_EMPTY_MASK);let i=n;return 0===r.needflags&&(i&=t.FLAG_MATCH),i|=r.needflags<<t.FLAG_NEED_SHIFT,this.getState(r.pcs,i,s)}allocTable(e,n){const s=this.numClasses+1,r=t.TABLE_OVERHEAD+t.ELEMENT_SIZE*s;if(this.memBudget<r)return null;this.memBudget-=r;const i=new Array(s).fill(null);return n===aB.UNANCHORED?e.next=i:e.nextAnchored=i,i}clearCache(){this.stateCache.clear(),this.stateCount=0,this.startStates.clear(),this.memBudget=this.stateBudget}resetCache(t){return this.clearCache(),this.getState(t.nfaStates,t.flag,t.matchIDs)}step(e,n,s,r){let i=r===aB.UNANCHORED?e.next:e.nextAnchored;if(null!==i){const t=i[n];if(null!==t)return t}else if(i=this.allocTable(e,r),null===i)return null;const o=e.flag>>>t.FLAG_NEED_SHIFT,a=e.flag&t.FLAG_EMPTY_MASK;let B=a,c=0;10===s&&(B|=AB.EMPTY_END_LINE,c|=AB.EMPTY_BEGIN_LINE),-1===s&&(B|=AB.EMPTY_END_LINE|AB.EMPTY_END_TEXT);const l=0!==(e.flag&t.FLAG_LAST_WORD),u=-1!==s&&AB.isWordRune(s);B|=u===l?AB.EMPTY_NO_WORD_BOUNDARY:AB.EMPTY_WORD_BOUNDARY;let h=e.nfaStates;0!==(B&~a&o)&&(h=this.closure(h,B).pcs);const d=[];let p=!1,f=XB;for(let t=0;t<h.length;t++){const e=this.prog.getInst(h[t]);e.op===qB.MATCH?(p||(p=!0,f=[]),f.push(e.arg)):-1!==s&&qB.isRuneOp(e.op)&&e.matchRune(s)&&d.push(e.out)}f.length>1&&f.sort((t,e)=>t-e),r===aB.UNANCHORED&&-1!==s&&d.push(this.prog.start);let C=c;p&&(C|=t.FLAG_MATCH),u&&(C|=t.FLAG_LAST_WORD);const g=this.makeState(d,C,f);return null===g?null:(i[n]=g,g)}start(e,n){const s=e.context(n);let r;if(0!==(s&AB.EMPTY_BEGIN_TEXT))r=AB.EMPTY_BEGIN_TEXT|AB.EMPTY_BEGIN_LINE;else if(0!==(s&AB.EMPTY_BEGIN_LINE))r=AB.EMPTY_BEGIN_LINE;else{const i=e.step(n),o=i>=0&&AB.isWordRune(i>>3);r=0!==(s&AB.EMPTY_WORD_BOUNDARY)!==o?t.FLAG_LAST_WORD:0}let i=this.startStates.get(r);if(void 0===i){if(i=this.makeState([this.prog.start],r,XB),null===i&&(this.clearCache(),i=this.makeState([this.prog.start],r,XB),null===i))return null;this.startStates.set(r,i)}return i}stepOrReset(e,n,s,r,i,o){let a=this.step(e,n,s,r);if(null!==a)return a;if(o.resetPos>=0&&i-o.resetPos<t.PROGRESS_PER_STATE*this.stateCount)return null;o.resetPos=i;const B=this.resetCache(e);return null===B?null:(a=this.step(B,n,s,r),a)}run(t,e,n,s,r){const i=t.endPos(),o=this.latin1Class,a=n===aB.UNANCHORED,B={resetPos:-1};let c=e;for(;c<i;){const e=t.step(c),i=e>>3,l=7&e;if(0===l)break;const u=i<=vB.MAX_LATIN1?o[i]:this.runeClass(i);let h=a&&null!==s.next?s.next[u]:null;if(null===h&&(h=this.stepOrReset(s,u,i,n,c,B),null===h))return null;if((s=h).isMatch&&r(s,!1))return!0;if(!a&&0===s.nfaStates.length)return!1;c+=l}return null===(s=this.stepOrReset(s,this.numClasses,-1,n,c,B))?null:s.isMatch&&r(s,!0)}match(t,e,n){if(this.failed)return null;if((n===aB.ANCHOR_START||n===aB.ANCHOR_BOTH)&&0!==e)return!1;const s=this.start(t,e);return null===s?null:this.run(t,e,n,s,(t,e)=>n!==aB.ANCHOR_BOTH||e)}matchSet(t,e,n){if(this.failed)return null;if((n===aB.ANCHOR_START||n===aB.ANCHOR_BOTH)&&0!==e)return[];const s=this.start(t,e);if(null===s)return null;const r=new Set;return null===this.run(t,e,n,s,(t,e)=>{if(n!==aB.ANCHOR_BOTH||e)for(let e=0;e<t.matchIDs.length;e++)r.add(t.matchIDs[e]);return!1})?null:Array.from(r).sort((t,e)=>t-e)}};var ec=class{constructor(){this.end=0,this.cap=new Int32Array(0),this.matchcap=new Int32Array(0),this.ncap=0,this.jobPc=new Int32Array(256),this.jobArg=new Uint8Array(256),this.jobPos=new Int32Array(256),this.jobLen=0,this.visited=new Uint32Array(0)}reset(t,e,n){this.end=e,this.jobLen=0,this.ncap=n;const s=t.numInst()*(e+1)+32-1>>>5;this.visited.length<s?this.visited=new Uint32Array(s):this.visited.fill(0,0,s),this.cap.length<n?this.cap=new Int32Array(n).fill(-1):this.cap.fill(-1,0,n),this.matchcap.length<n?this.matchcap=new Int32Array(n).fill(-1):this.matchcap.fill(-1,0,n)}shouldVisit(t,e){const n=t*(this.end+1)+e,s=n>>>5,r=1<<(31&n);return 0===(this.visited[s]&r)&&(this.visited[s]|=r,!0)}push(t,e,n,s){if(t.prog.getInst(e).op!==qB.FAIL&&(s||this.shouldVisit(e,n))){if(this.jobLen>=this.jobPc.length){const t=2*this.jobPc.length,e=new Int32Array(t);e.set(this.jobPc),this.jobPc=e;const n=new Uint8Array(t);n.set(this.jobArg),this.jobArg=n;const s=new Int32Array(t);s.set(this.jobPos),this.jobPos=s}this.jobPc[this.jobLen]=e,this.jobArg[this.jobLen]=s?1:0,this.jobPos[this.jobLen]=n,this.jobLen++}}tryBacktrack(t,e,n,s,r){const i=t.longest;for(this.push(t,n,s,!1);this.jobLen>0;){this.jobLen--;let n=this.jobPc[this.jobLen],s=1===this.jobArg[this.jobLen],o=this.jobPos[this.jobLen],a=!0;for(;a||this.shouldVisit(n,o);){a=!1;const B=t.prog.getInst(n);switch(B.op){case qB.FAIL:break;case qB.ALT:if(s){s=!1,n=B.arg;continue}this.push(t,n,o,!0),n=B.out;continue;case qB.ALT_MATCH:{const e=t.prog.getInst(B.out);if(qB.isRuneOp(e.op)){this.push(t,B.arg,o,!1),n=B.arg,o=this.end;continue}this.push(t,B.out,this.end,!1),n=B.out;continue}case qB.RUNE:{const t=e.step(o);if(t===LB.EOF())break;if(!B.matchRune(t>>3))break;o+=7&t,n=B.out;continue}case qB.RUNE1:{const t=e.step(o);if(t===LB.EOF())break;if(t>>3!==B.runes[0])break;o+=7&t,n=B.out;continue}case qB.RUNE_ANY_NOT_NL:{const t=e.step(o);if(t===LB.EOF())break;if(t>>3==10)break;o+=7&t,n=B.out;continue}case qB.RUNE_ANY:{const t=e.step(o);if(t===LB.EOF())break;o+=7&t,n=B.out;continue}case qB.CAPTURE:if(s){this.cap[B.arg]=o;break}B.arg<this.ncap&&(this.push(t,n,this.cap[B.arg],!0),this.cap[B.arg]=o),n=B.out;continue;case qB.EMPTY_WIDTH:{const t=e.context(o);if(0!==(B.arg&~t))break;n=B.out;continue}case qB.NOP:n=B.out;continue;case qB.MATCH:{if(r===aB.ANCHOR_BOTH&&o!==this.end)break;if(0===this.ncap)return!0;this.ncap>1&&(this.cap[1]=o);const t=this.matchcap[1];if((-1===t||i&&o>0&&o>t)&&this.matchcap.set(this.cap),!i)return!0;if(o===this.end)return!0;break}case qB.LB_WRITE:case qB.LB_CHECK:throw new $B("Backtracker cannot evaluate Lookbehind instructions");default:throw new $B("bad inst")}break}}return i&&this.matchcap.length>1&&this.matchcap[1]>=0}};const nc=[];var sc=class t{static shouldBacktrack(t){return t.numInst()<=500}static maxBitStateLen(e){return t.shouldBacktrack(e)?Math.floor(262144/e.numInst()):0}static execute(t,e,n,s,r){const i=t.cond;if(i===AB.EMPTY_ALL)return null;if((s===aB.ANCHOR_START||s===aB.ANCHOR_BOTH)&&0!==n)return null;if(0!==(i&AB.EMPTY_BEGIN_TEXT)&&0!==n)return null;const o=nc.length>0?nc.pop():new ec,a=e.endPos();o.reset(t.prog,a,r);let B=!1;if(0!==(i&AB.EMPTY_BEGIN_TEXT)||s===aB.ANCHOR_START||s===aB.ANCHOR_BOTH)o.ncap>0&&(o.cap[0]=n),o.tryBacktrack(t,e,t.prog.start,n,s)&&(B=!0);else{let r=-1;for(;n<=a&&0!==r;n+=r){if(t.prefix.length>0){const s=e.index(t,n);if(s<0)break;n+=s}if(o.ncap>0&&(o.cap[0]=n),o.tryBacktrack(t,e,t.prog.start,n,s)){B=!0;break}const i=e.step(n);r=i===LB.EOF()?0:7&i}}if(!B)return nc.push(o),null;const c=0===r?[]:AB.toArray(o.matchcap.subarray(0,r));return nc.push(o),c}},rc=class{constructor(t){this.sparse=new Uint32Array(t),this.dense=new Uint32Array(t),this.size=0,this.nextIndex=0}empty(){return this.nextIndex>=this.size}next(){return this.dense[this.nextIndex++]}clear(){this.size=0,this.nextIndex=0}contains(t){return t<this.sparse.length&&this.sparse[t]<this.size&&this.dense[this.sparse[t]]===t}insert(t){this.contains(t)||this.insertNew(t)}insertNew(t){t>=this.sparse.length||(this.sparse[t]=this.size,this.dense[this.size]=t,this.size++)}};var ic=class{constructor(t){this.start=t.start,this.numCap=t.numCap,this.inst=new Array(t.inst.length);for(let e=0;e<t.inst.length;e++){const n=t.inst[e],s=new qB(n.op);s.out=n.out,s.arg=n.arg,s.runes=n.runes?new Int32Array(n.runes):new Int32Array(0),s.next=null,this.inst[e]=s}}};var oc=class t{static compile(t){if(0===t.start)return null;if(t.numLb>0)return null;const e=t.inst[t.start];if(e.op!==qB.EMPTY_WIDTH||0===(e.arg&AB.EMPTY_BEGIN_TEXT))return null;let n=!1;for(let e=0;e<t.inst.length;e++)if(t.inst[e].op===qB.ALT||t.inst[e].op===qB.ALT_MATCH){n=!0;break}for(let e=0;e<t.inst.length;e++){const s=t.inst[e],r=t.inst[s.out].op;switch(s.op){case qB.ALT:case qB.ALT_MATCH:if(r===qB.MATCH||t.inst[s.arg].op===qB.MATCH)return null;break;case qB.EMPTY_WIDTH:if(r===qB.MATCH){if((s.arg&AB.EMPTY_END_TEXT)===AB.EMPTY_END_TEXT)continue;return null}break;default:if(r===qB.MATCH&&n)return null}}let s=(t=>{const e=new ic(t);for(let t=0;t<e.inst.length;t++){const n=e.inst[t];if(n.op!==qB.ALT&&n.op!==qB.ALT_MATCH)continue;let s="out",r="arg",i=e.inst[n[r]];if(i.op!==qB.ALT&&i.op!==qB.ALT_MATCH&&(s="arg",r="out",i=e.inst[n[r]],i.op!==qB.ALT&&i.op!==qB.ALT_MATCH))continue;const o=e.inst[n[s]];if(o.op===qB.ALT||o.op===qB.ALT_MATCH)continue;let a="out",B="arg",c=!1;i.out===t?c=!0:i.arg===t&&(c=!0,a="arg",B="out"),c&&(i[a]=n[s]),n[s]===i[a]&&(n[r]=i[B])}return e})(t);return s=(t=>{if(t.inst.length>=1e3)return null;const e=new rc(t.inst.length),n=new rc(t.inst.length),s=new Array(t.inst.length),r=new Array(t.inst.length).fill(!1),i=o=>{let a=!0;const B=t.inst[o];if(n.contains(o))return!0;switch(n.insert(o),B.op){case qB.ALT:case qB.ALT_MATCH:{a=i(B.out)&&i(B.arg);let t=r[B.out],e=r[B.arg];if(t&&e)return!1;if(e){const n=B.out;B.out=B.arg,B.arg=n;const s=t;t=e,e=s}t&&(r[o]=!0,B.op=qB.ALT_MATCH);const n=((t,e,n,s)=>{const r=t.length,i=e.length;let o=0,a=0;const B=[],c=[];let l=!0,u=-1;const h=r=>{const i=r?t:e,l=r?o:a,h=r?n:s;return!(u>0&&i[l]<=B[u]||(B.push(i[l],i[l+1]),r?o+=2:a+=2,u+=2,c.push(h),0))};for(;o<r||a<i;)if(l=a>=i?h(!0):o>=r||e[a]<t[o]?h(!1):h(!0),!l)return null;return{merged:B,next:c}})(s[B.out]||[],s[B.arg]||[],B.out,B.arg);if(!n)return!1;s[o]=new Int32Array(n.merged),B.next=new Uint32Array(n.next);break}case qB.CAPTURE:case qB.EMPTY_WIDTH:case qB.NOP:a=i(B.out),r[o]=r[B.out],s[o]=s[B.out]?new Int32Array(s[B.out]):new Int32Array(0),B.next=new Uint32Array(Math.floor(s[o].length/2)+1).fill(B.out);break;case qB.MATCH:case qB.FAIL:r[o]=B.op===qB.MATCH;break;case qB.RUNE:{if(r[o]=!1,B.next&&B.next.length>0)break;if(e.insert(B.out),!B.runes||0===B.runes.length){s[o]=new Int32Array(0),B.next=new Uint32Array([B.out]);break}let t=[];if(1===B.runes.length&&0!==(B.arg&aB.FOLD_CASE)){const e=B.runes[0];t.push(e,e);for(let n=vB.simpleFold(e);n!==e;n=vB.simpleFold(n))t.push(n,n);t.sort((t,e)=>t-e)}else for(let e=0;e<B.runes.length;e++)t.push(B.runes[e]);s[o]=new Int32Array(t),B.next=new Uint32Array(Math.floor(t.length/2)+1).fill(B.out),B.op=qB.RUNE;break}case qB.RUNE1:{if(r[o]=!1,B.next&&B.next.length>0)break;e.insert(B.out);let t=[];if(0!==(B.arg&aB.FOLD_CASE)){const e=B.runes[0];t.push(e,e);for(let n=vB.simpleFold(e);n!==e;n=vB.simpleFold(n))t.push(n,n);t.sort((t,e)=>t-e)}else t.push(B.runes[0],B.runes[0]);s[o]=new Int32Array(t),B.next=new Uint32Array(Math.floor(t.length/2)+1).fill(B.out),B.op=qB.RUNE;break}case qB.RUNE_ANY:if(r[o]=!1,B.next&&B.next.length>0)break;e.insert(B.out),s[o]=new Int32Array([0,vB.MAX_RUNE]),B.next=new Uint32Array([B.out]);break;case qB.RUNE_ANY_NOT_NL:if(r[o]=!1,B.next&&B.next.length>0)break;e.insert(B.out),s[o]=new Int32Array([0,9,11,vB.MAX_RUNE]),B.next=new Uint32Array(Math.floor(s[o].length/2)+1).fill(B.out)}return a};for(e.clear(),e.insert(t.start);!e.empty();)if(n.clear(),!i(e.next()))return null;for(let e=0;e<t.inst.length;e++)s[e]&&(t.inst[e].runes=s[e]);return t})(s),null!==s&&((t,e)=>{for(let n=0;n<e.inst.length;n++){const s=e.inst[n];switch(s.op){case qB.ALT:case qB.ALT_MATCH:case qB.RUNE:break;case qB.CAPTURE:case qB.EMPTY_WIDTH:case qB.NOP:case qB.MATCH:case qB.FAIL:t.inst[n].next=null;break;case qB.RUNE1:case qB.RUNE_ANY:case qB.RUNE_ANY_NOT_NL:t.inst[n].next=null,t.inst[n].op=s.op,t.inst[n].runes=s.runes?new Int32Array(s.runes):new Int32Array(0)}}})(s,t),s}static next(t,e){const n=t.matchRunePos(e);return n>=0?t.next[n]:t.op===qB.ALT_MATCH?t.out:0}static execute(e,n,s,r,i){const o=e.onepass;if(!o)return null;const a=new Int32Array(i).fill(-1);let B=!1,c=n.step(s),l=c>>3,u=7&c,h=LB.EOF(),d=-1,p=0;c!==LB.EOF()&&(h=n.step(s+u),h!==LB.EOF()&&(d=h>>3,p=7&h));let f,C=0===s?AB.emptyOpContext(-1,l):n.context(s),g=o.start;for(;;){switch(f=o.inst[g],g=f.out,f.op){case qB.MATCH:return r===aB.ANCHOR_BOTH&&s!==n.endPos()?null:(B=!0,a.length>0&&(a[0]=0,a[1]=s),0===i?[]:AB.toArray(a));case qB.RUNE:if(!f.matchRune(l))return null;break;case qB.RUNE1:if(l!==f.runes[0])return null;break;case qB.RUNE_ANY:break;case qB.RUNE_ANY_NOT_NL:if(10===l)return null;break;case qB.ALT:case qB.ALT_MATCH:g=t.next(f,l);continue;case qB.FAIL:return null;case qB.NOP:continue;case qB.EMPTY_WIDTH:if(0!==(f.arg&~C))return null;continue;case qB.CAPTURE:f.arg<a.length&&(a[f.arg]=s);continue;default:throw new $B("bad inst")}if(0===u)break;C=AB.emptyOpContext(l,d),s+=u,l=d,u=p,-1!==l&&(h=n.step(s+u),h!==LB.EOF()?(d=h>>3,p=7&h):(d=-1,p=0))}return B?0===i?[]:AB.toArray(a):null}},ac=class t{static Op=SB(["NO_MATCH","EMPTY_MATCH","LITERAL","CHAR_CLASS","ANY_CHAR_NOT_NL","ANY_CHAR","BEGIN_LINE","END_LINE","BEGIN_TEXT","END_TEXT","WORD_BOUNDARY","NO_WORD_BOUNDARY","CAPTURE","STAR","PLUS","QUEST","REPEAT","CONCAT","ALTERNATE","PLB","NLB","LEFT_PAREN","VERTICAL_BAR"]);static isPseudoOp(e){return e>=t.Op.LEFT_PAREN}static emptySubs(){return[]}static quoteIfHyphen(t){return t===mB.CODES["-"]?"\\":""}static fromRegexp(e){const n=new t(e.op);return n.flags=e.flags,n.subs=e.subs,n.runes=e.runes,n.cap=e.cap,n.min=e.min,n.max=e.max,n.name=e.name,n.namedGroups=e.namedGroups,n.lb=e.lb,n}constructor(e){this.op=e,this.flags=0,this.subs=t.emptySubs(),this.runes=new Int32Array(0),this.min=0,this.max=0,this.cap=0,this.name=null,this.namedGroups=Object.create(null),this.lb=0}reinit(){this.flags=0,this.subs=t.emptySubs(),this.runes=new Int32Array(0),this.cap=0,this.min=0,this.max=0,this.name=null,this.namedGroups=Object.create(null),this.lb=0}toString(){return this.appendTo()}appendTo(){let e="";switch(this.op){case t.Op.NO_MATCH:e+="[^\\x00-\\x{10FFFF}]";break;case t.Op.EMPTY_MATCH:e+="(?:)";break;case t.Op.STAR:case t.Op.PLUS:case t.Op.QUEST:case t.Op.REPEAT:{const n=this.subs[0];switch(n.op>t.Op.CAPTURE||n.op===t.Op.LITERAL&&n.runes.length>1?e+=`(?:${n.appendTo()})`:e+=n.appendTo(),this.op){case t.Op.STAR:e+="*";break;case t.Op.PLUS:e+="+";break;case t.Op.QUEST:e+="?";break;case t.Op.REPEAT:e+=`{${this.min}`,this.min!==this.max&&(e+=",",this.max>=0&&(e+=this.max)),e+="}"}0!==(this.flags&aB.NON_GREEDY)&&(e+="?");break}case t.Op.CONCAT:for(let n of this.subs)n.op===t.Op.ALTERNATE?e+=`(?:${n.appendTo()})`:e+=n.appendTo();break;case t.Op.ALTERNATE:{let t="";for(let n of this.subs)e+=t,t="|",e+=n.appendTo();break}case t.Op.LITERAL:0!==(this.flags&aB.FOLD_CASE)&&(e+="(?i:");for(let t of this.runes)e+=AB.escapeRune(t);0!==(this.flags&aB.FOLD_CASE)&&(e+=")");break;case t.Op.ANY_CHAR_NOT_NL:e+="(?-s:.)";break;case t.Op.ANY_CHAR:e+="(?s:.)";break;case t.Op.PLB:e+=`(?<=${this.subs[0].appendTo()})`;break;case t.Op.NLB:e+=`(?<!${this.subs[0].appendTo()})`;break;case t.Op.CAPTURE:null===this.name||0===this.name.length?e+="(":e+=`(?P<${this.name}>`,this.subs[0].op!==t.Op.EMPTY_MATCH&&(e+=this.subs[0].appendTo()),e+=")";break;case t.Op.BEGIN_TEXT:e+="\\A";break;case t.Op.END_TEXT:0!==(this.flags&aB.WAS_DOLLAR)?e+="(?-m:$)":e+="\\z";break;case t.Op.BEGIN_LINE:e+="^";break;case t.Op.END_LINE:e+="$";break;case t.Op.WORD_BOUNDARY:e+="\\b";break;case t.Op.NO_WORD_BOUNDARY:e+="\\B";break;case t.Op.CHAR_CLASS:if(this.runes.length%2!=0){e+="[invalid char class]";break}if(e+="[",0===this.runes.length)e+="^\\x00-\\x{10FFFF}";else if(0===this.runes[0]&&this.runes[this.runes.length-1]===vB.MAX_RUNE){e+="^";for(let n=1;n<this.runes.length-1;n+=2){const s=this.runes[n]+1,r=this.runes[n+1]-1;e+=t.quoteIfHyphen(s),e+=AB.escapeRune(s),s!==r&&(e+="-",e+=t.quoteIfHyphen(r),e+=AB.escapeRune(r))}}else for(let n=0;n<this.runes.length;n+=2){const s=this.runes[n],r=this.runes[n+1];e+=t.quoteIfHyphen(s),e+=AB.escapeRune(s),s!==r&&(e+="-",e+=t.quoteIfHyphen(r),e+=AB.escapeRune(r))}e+="]";break;default:e+=this.op}return e}maxCap(){let e=0;if(this.op===t.Op.CAPTURE&&(e=this.cap),null!==this.subs)for(let t of this.subs){const n=t.maxCap();e<n&&(e=n)}return e}equals(e){if(!(null!==e&&e instanceof t))return!1;if(this.op!==e.op)return!1;switch(this.op){case t.Op.END_TEXT:if((this.flags&aB.WAS_DOLLAR)!==(e.flags&aB.WAS_DOLLAR))return!1;break;case t.Op.LITERAL:case t.Op.CHAR_CLASS:if((this.flags&aB.FOLD_CASE)!==(e.flags&aB.FOLD_CASE))return!1;if(null===this.runes&&null===e.runes)break;if(null===this.runes||null===e.runes)return!1;if(this.runes.length!==e.runes.length)return!1;for(let t=0;t<this.runes.length;t++)if(this.runes[t]!==e.runes[t])return!1;break;case t.Op.ALTERNATE:case t.Op.CONCAT:if(this.subs.length!==e.subs.length)return!1;for(let t=0;t<this.subs.length;++t)if(!this.subs[t].equals(e.subs[t]))return!1;break;case t.Op.STAR:case t.Op.PLUS:case t.Op.QUEST:if((this.flags&aB.NON_GREEDY)!==(e.flags&aB.NON_GREEDY)||!this.subs[0].equals(e.subs[0]))return!1;break;case t.Op.REPEAT:if((this.flags&aB.NON_GREEDY)!==(e.flags&aB.NON_GREEDY)||this.min!==e.min||this.max!==e.max||!this.subs[0].equals(e.subs[0]))return!1;break;case t.Op.CAPTURE:if(this.cap!==e.cap||(null===this.name?null!==e.name:this.name!==e.name)||!this.subs[0].equals(e.subs[0]))return!1;break;case t.Op.PLB:case t.Op.NLB:if(this.lb!==e.lb||!this.subs[0].equals(e.subs[0]))return!1}return!0}},Bc=class{static walk(t,e){const n=[];let s,r=t;for(;;){if(0===r.subs.length)s=e.leaf(r);else{const t=e.enter(r);if(void 0===t.result){n.push({re:r,state:t,i:0}),r=r.subs[0];continue}s=t.result}for(;;){if(0===n.length)return s;const t=n[n.length-1];if(e.child(t.re,t.state,s,t.i),t.i++,void 0===t.state.result&&t.i<t.re.subs.length){r=t.re.subs[t.i];break}n.pop(),s=void 0!==t.state.result?t.state.result:e.leave(t.re,t.state)}}}},cc=class{constructor(t,e){const n=new Map,s=[0],r=[0],i=[0],o=[0];for(const a of t){let t=0;for(let B=0;B<a.length;B++){const c=t*e+a[B];let l=n.get(c);void 0===l&&(l=s.length,n.set(c,l),s.push(t),r.push(a[B]),i.push(i[t]+1),o.push(0)),t=l}o[t]=1}const a=s.length,B=new Int32Array(a-1);for(let t=1;t<a;t++)B[t-1]=t;B.sort((t,e)=>s[t]-s[e]||r[t]-r[e]);const c=new Int32Array(a+1);for(let t=1;t<a;t++)c[s[t]+1]++;for(let t=0;t<a;t++)c[t+1]+=c[t];const l=new Int32Array(a-1);for(let t=0;t<B.length;t++)l[t]=r[B[t]];this.childStart=c,this.childUnit=l,this.childNode=B;const u=new Int32Array(a);for(let t=0;t<a;t++)u[t]=t;u.sort((t,e)=>i[t]-i[e]);const h=new Int32Array(a),d=Uint8Array.from(o);for(let t=1;t<a;t++){const e=u[t],n=s[e];if(0!==n){let t=h[n],s=this.next(t,r[e]);for(;s<0&&0!==t;)t=h[t],s=this.next(t,r[e]);h[e]=s>=0?s:0}d[e]|=d[h[e]]}this.fail=h,this.match=d}next(t,e){let n=this.childStart[t],s=this.childStart[t+1];const r=this.childUnit;for(;n<s;){const t=n+s>>1,i=r[t];if(i===e)return this.childNode[t];i<e?n=t+1:s=t}return-1}advance(t,e){for(;;){const n=this.next(t,e);if(n>=0)return n;if(0===t)return 0;t=this.fail[t]}}searchUTF16(t,e,n){let s=0;for(let r=e;r<n;r++)if(s=this.advance(s,t.charCodeAt(r)),1===this.match[s])return!0;return!1}searchUTF8(t,e,n){let s=0;for(let r=e;r<n;r++)if(s=this.advance(s,t[r]),1===this.match[s])return!0;return!1}},lc=class t{static Type={NONE:0,EXACT:1,AND:2,OR:3};static MAX_SCANS=32;static MAX_AC_UNITS=1<<18;constructor(e){this.type=e,this.subs=[],this.str="",this.bytes=null,this.cost=e===t.Type.EXACT?1:0,this.allExact=!1,this.ac16=null,this.ac8=null}automaton16(){if(null===this.ac16){const t=this.subs.map(t=>{const e=new Array(t.str.length);for(let n=0;n<t.str.length;n++)e[n]=t.str.charCodeAt(n);return e});this.ac16=new cc(t,65536)}return this.ac16}automaton8(){return null===this.ac8&&(this.ac8=new cc(this.subs.map(t=>t.bytes),256)),this.ac8}eval(e,n){switch(this.type){case t.Type.NONE:return!0;case t.Type.EXACT:return e.hasString(this,n);case t.Type.AND:for(let t=0;t<this.subs.length;t++)if(!this.subs[t].eval(e,n))return!1;return!0;case t.Type.OR:if(this.allExact)return e.hasAnyString(this,n);for(let t=0;t<this.subs.length;t++)if(this.subs[t].eval(e,n))return!0;return!1;default:return!0}}},uc=class t{static build(e){return e?Bc.walk(e,t.WALKER):new lc(lc.Type.NONE)}static WALKER={leaf:e=>t.leaf(e),enter:e=>t.enter(e),child:(e,n,s)=>t.child(e,n,s),leave:(e,n)=>t.leave(e,n)};static leaf(t){if(t.op!==ac.Op.LITERAL)return new lc(lc.Type.NONE);if(0===t.runes.length||0!==(t.flags&aB.FOLD_CASE))return new lc(lc.Type.NONE);let e="";for(let n=0;n<t.runes.length;n++){if(vB.isUnsearchable(t.runes[n]))return new lc(lc.Type.NONE);e+=String.fromCodePoint(t.runes[n])}const n=new lc(lc.Type.EXACT);return n.str=e,n.bytes=AB.stringToUtf8ByteArray(n.str),n}static enter(t){switch(t.op){case ac.Op.CAPTURE:case ac.Op.PLUS:return{sub:null};case ac.Op.REPEAT:return t.min>=1?{sub:null}:{result:new lc(lc.Type.NONE)};case ac.Op.CONCAT:return{pf:new lc(lc.Type.AND),subs:[]};case ac.Op.ALTERNATE:return{pf:new lc(lc.Type.OR),subs:[]};default:return{result:new lc(lc.Type.NONE)}}}static child(t,e,n){if(void 0!==e.subs)if(e.pf.type!==lc.Type.AND)if(n.type!==lc.Type.NONE)if(n.type!==lc.Type.OR)e.subs.push(n);else for(let t=0;t<n.subs.length;t++)e.subs.push(n.subs[t]);else e.result=new lc(lc.Type.NONE);else{if(n.type===lc.Type.NONE)return;if(n.type===lc.Type.AND){for(let t=0;t<n.subs.length;t++)e.subs.push(n.subs[t]);return}e.subs.push(n)}else e.sub=n}static leave(t,e){if(void 0===e.subs)return e.sub;const n=e.pf,s=new Set,r=[];for(const t of e.subs){if(t.type===lc.Type.EXACT){if(s.has(t.str))continue;s.add(t.str)}r.push(t)}if(n.type===lc.Type.AND){const t=[];let e=0;for(const n of r)e+n.cost>lc.MAX_SCANS||(t.push(n),e+=n.cost);return 0===t.length?new lc(lc.Type.NONE):1===t.length?t[0]:(n.subs=t,n.cost=e,n)}if(0===r.length)return new lc(lc.Type.NONE);if(1===r.length)return r[0];n.subs=r;let i=!0,o=0,a=0;for(const t of r)t.type!==lc.Type.EXACT?i=!1:a+=t.bytes.length,o+=t.cost;return i?a>lc.MAX_AC_UNITS?new lc(lc.Type.NONE):(n.allExact=!0,n.cost=1,n):o>lc.MAX_SCANS?new lc(lc.Type.NONE):(n.cost=o,n)}},hc=class{constructor(t=0,e=0){this.head=t,this.tail=e}},dc=class{constructor(){this.inst=[],this.start=0,this.numCap=2,this.lbStarts=[],this.numLb=0,this.lbInst=null}getInst(t){return this.inst[t]}numInst(){return this.inst.length}addInst(t){this.inst.push(new qB(t))}markLookbehindInsts(){const t=new Uint8Array(this.inst.length),e=this.lbStarts.slice();for(;e.length>0;){const n=e.pop();if(0===n||1===t[n])continue;t[n]=1;const s=this.inst[n];switch(s.op){case qB.ALT:case qB.ALT_MATCH:e.push(s.out,s.arg);break;case qB.MATCH:case qB.FAIL:break;default:e.push(s.out)}}this.lbInst=t}skipNop(t){let e=this.inst[t];for(;e.op===qB.NOP||e.op===qB.CAPTURE;)e=this.inst[t],t=e.out;return e}prefix(){let t="",e=this.skipNop(this.start);if(!qB.isRuneOp(e.op)||1!==e.runes.length)return[e.op===qB.MATCH,t];for(;qB.isRuneOp(e.op)&&1===e.runes.length&&0===(e.arg&aB.FOLD_CASE)&&!vB.isUnsearchable(e.runes[0]);)t+=String.fromCodePoint(e.runes[0]),e=this.skipNop(e.out);return[e.op===qB.MATCH,t]}startCond(){let t=0,e=this.start;t:for(;;){const n=this.inst[e];switch(n.op){case qB.EMPTY_WIDTH:t|=n.arg;break;case qB.FAIL:return-1;case qB.CAPTURE:case qB.NOP:break;default:break t}e=n.out}return t}patch(t,e){let n=t.head;for(;0!==n;){const t=this.inst[n>>1];1&n?(n=t.arg,t.arg=e):(n=t.out,t.out=e)}}append(t,e){if(0===t.head)return e;if(0===e.head)return t;const n=this.inst[t.tail>>1];return 1&t.tail?n.arg=e.head:n.out=e.head,new hc(t.head,e.tail)}toString(){let t="";for(let e=0;e<this.inst.length;e++){const n=t.length;t+=e,e===this.start&&(t+="*"),t+=" ".substring(t.length-n),t+=this.inst[e],t+="\n"}return t}};const pc=new Int32Array([0,mB.CODES["\n"]-1,mB.CODES["\n"]+1,vB.MAX_RUNE]),fc=new Int32Array([0,vB.MAX_RUNE]);var Cc=class{constructor(t=0,e=new hc,n=!1){this.i=t,this.out=e,this.nullable=n}},gc=class t{static compileRegexp(e){const n=new t,s=n.compile(e);return n.prog.patch(s.out,n.newInst(qB.MATCH).i),n.prog.start=s.i,n.prog.markLookbehindInsts(),n.prog}static compileSet(e){const n=new t;if(0===e.length)return n.prog.start=n.newInst(qB.FAIL).i,n.prog.markLookbehindInsts(),n.prog;let s=[];for(let t=0;t<e.length;t++){n.lbOffset=n.prog.numLb;const r=n.compile(e[t]),i=n.newInst(qB.MATCH);n.prog.getInst(i.i).arg=t,n.prog.patch(r.out,i.i),s.push(r.i)}let r=s[0];for(let t=1;t<s.length;t++){const e=n.newInst(qB.ALT),i=n.prog.getInst(e.i);i.out=r,i.arg=s[t],r=e.i}return n.prog.start=r,n.prog.markLookbehindInsts(),n.prog}constructor(){this.prog=new dc,this.newInst(qB.FAIL),this.lbOffset=0,this.runeCache=new Map,this.walker={leaf:t=>this.leaf(t),enter:t=>this.enter(t),child:(t,e,n)=>this.child(t,e,n),leave:(t,e)=>this.leave(t,e)}}newInst(t){return this.prog.addInst(t),new Cc(this.prog.numInst()-1,new hc,!0)}nop(){const t=this.newInst(qB.NOP);return t.out=new hc(t.i<<1,t.i<<1),t}fail(){return new Cc}cap(t){const e=this.newInst(qB.CAPTURE);return e.out=new hc(e.i<<1,e.i<<1),this.prog.getInst(e.i).arg=t,this.prog.numCap<t+1&&(this.prog.numCap=t+1),e}cat(t,e){return 0===t.i||0===e.i?(this.prog.patch(t.out,0),this.prog.patch(e.out,0),this.fail()):(this.prog.patch(t.out,e.i),new Cc(t.i,e.out,t.nullable&&e.nullable))}alt(t,e){if(0===t.i)return e;if(0===e.i)return t;const n=this.newInst(qB.ALT),s=this.prog.getInst(n.i);return s.out=t.i,s.arg=e.i,n.out=this.prog.append(t.out,e.out),n.nullable=t.nullable||e.nullable,n}loop(t,e){const n=this.newInst(qB.ALT),s=this.prog.getInst(n.i);return e?(s.arg=t.i,n.out=new hc(n.i<<1,n.i<<1)):(s.out=t.i,n.out=new hc(n.i<<1|1,n.i<<1|1)),this.prog.patch(t.out,n.i),n}quest(t,e){if(0===t.i)return this.nop();const n=this.newInst(qB.ALT),s=this.prog.getInst(n.i);return e?(s.arg=t.i,n.out=new hc(n.i<<1,n.i<<1)):(s.out=t.i,n.out=new hc(n.i<<1|1,n.i<<1|1)),n.out=this.prog.append(n.out,t.out),n}star(t,e){return 0===t.i?this.nop():t.nullable?this.quest(this.plus(t,e),e):this.loop(t,e)}plus(t,e){return 0===t.i?this.fail():new Cc(t.i,this.loop(t,e).out,t.nullable)}empty(t){const e=this.newInst(qB.EMPTY_WIDTH);return this.prog.getInst(e.i).arg=t,e.out=new hc(e.i<<1,e.i<<1),e}rune(t,e){const n=this.newInst(qB.RUNE);n.nullable=!1;const s=this.prog.getInst(n.i);return s.runes=t,e&=aB.FOLD_CASE,1===t.length&&vB.simpleFold(t[0])!==t[0]||(e&=-2),s.arg=e,n.out=new hc(n.i<<1,n.i<<1),0===(e&aB.FOLD_CASE)&&1===t.length||2===t.length&&t[0]===t[1]?s.op=qB.RUNE1:2===t.length&&0===t[0]&&t[1]===vB.MAX_RUNE?s.op=qB.RUNE_ANY:4===t.length&&0===t[0]&&t[1]===mB.CODES["\n"]-1&&t[2]===mB.CODES["\n"]+1&&t[3]===vB.MAX_RUNE&&(s.op=qB.RUNE_ANY_NOT_NL),n}lookBehind(t,e){const n=Math.sign(e)*(Math.abs(e)+this.lbOffset),s=this.newInst(qB.LB_WRITE);this.prog.getInst(s.i).arg=n;const r=this.rune(fc,0),i=this.star(r,!0),o=this.cat(i,t);this.prog.patch(o.out,s.i);const a=this.newInst(qB.LB_CHECK);return this.prog.getInst(a.i).arg=n,this.prog.lbStarts.push(o.i),Math.abs(n)>this.prog.numLb&&(this.prog.numLb=Math.abs(n)),a.out=new hc(a.i<<1,a.i<<1),a}compile(t){return Bc.walk(t,this.walker)}leaf(t){switch(t.op){case ac.Op.NO_MATCH:return this.fail();case ac.Op.EMPTY_MATCH:return this.nop();case ac.Op.LITERAL:{if(0===t.runes.length)return this.nop();let e=null;for(let n of t.runes){let s=this.runeCache.get(n);void 0===s&&(s=new Int32Array([n]),this.runeCache.set(n,s));const r=this.rune(s,t.flags);e=null===e?r:this.cat(e,r)}return e}case ac.Op.CHAR_CLASS:return this.rune(t.runes,t.flags);case ac.Op.ANY_CHAR_NOT_NL:return this.rune(pc,0);case ac.Op.ANY_CHAR:return this.rune(fc,0);case ac.Op.BEGIN_LINE:return this.empty(AB.EMPTY_BEGIN_LINE);case ac.Op.END_LINE:return this.empty(AB.EMPTY_END_LINE);case ac.Op.BEGIN_TEXT:return this.empty(AB.EMPTY_BEGIN_TEXT);case ac.Op.END_TEXT:return this.empty(AB.EMPTY_END_TEXT);case ac.Op.WORD_BOUNDARY:return this.empty(AB.EMPTY_WORD_BOUNDARY);case ac.Op.NO_WORD_BOUNDARY:return this.empty(AB.EMPTY_NO_WORD_BOUNDARY);case ac.Op.CONCAT:case ac.Op.ALTERNATE:return this.nop();default:throw new UB("regexp: unhandled case in compile")}}enter(t){switch(t.op){case ac.Op.PLB:case ac.Op.NLB:case ac.Op.STAR:case ac.Op.PLUS:case ac.Op.QUEST:return{sub:null};case ac.Op.CAPTURE:return{bra:this.cap(t.cap<<1),sub:null};case ac.Op.CONCAT:case ac.Op.ALTERNATE:return{f:null};default:throw new UB("regexp: unhandled case in compile")}}child(t,e,n){t.op===ac.Op.CONCAT?e.f=null===e.f?n:this.cat(e.f,n):t.op===ac.Op.ALTERNATE?e.f=null===e.f?n:this.alt(e.f,n):e.sub=n}leave(t,e){switch(t.op){case ac.Op.PLB:case ac.Op.NLB:return this.lookBehind(e.sub,t.lb);case ac.Op.CAPTURE:{const n=this.cap(t.cap<<1|1);return this.cat(this.cat(e.bra,e.sub),n)}case ac.Op.STAR:return this.star(e.sub,0!==(t.flags&aB.NON_GREEDY));case ac.Op.PLUS:return this.plus(e.sub,0!==(t.flags&aB.NON_GREEDY));case ac.Op.QUEST:return this.quest(e.sub,0!==(t.flags&aB.NON_GREEDY));case ac.Op.CONCAT:case ac.Op.ALTERNATE:return e.f;default:throw new UB("regexp: unhandled case in compile")}}},mc=class t{static simplify(e){return null===e?null:Bc.walk(e,t.WALKER)}static WALKER={leaf:e=>t.leaf(e),enter:e=>t.enter(e),child:(e,n,s,r)=>t.child(e,n,s,r),leave:(e,n)=>t.leave(e,n)};static leaf(t){if(t.op===ac.Op.CHAR_CLASS){if(null===t.runes)return t;if(0===t.runes.length)return new ac(ac.Op.NO_MATCH);if(2===t.runes.length&&0===t.runes[0]&&t.runes[1]===vB.MAX_RUNE)return new ac(ac.Op.ANY_CHAR);if(4===t.runes.length&&0===t.runes[0]&&t.runes[1]===mB.CODES["\n"]-1&&t.runes[2]===mB.CODES["\n"]+1&&t.runes[3]===vB.MAX_RUNE)return new ac(ac.Op.ANY_CHAR_NOT_NL)}return t}static enter(t){switch(t.op){case ac.Op.PLB:case ac.Op.NLB:case ac.Op.CAPTURE:case ac.Op.STAR:case ac.Op.PLUS:case ac.Op.QUEST:return{sub:null};case ac.Op.CONCAT:case ac.Op.ALTERNATE:return{subs:[],changed:!1};case ac.Op.REPEAT:return 0===t.min&&0===t.max?{result:new ac(ac.Op.EMPTY_MATCH)}:{sub:null};default:return{result:t}}}static child(t,e,n,s){if(void 0!==e.subs){if(n!==t.subs[s]&&(e.changed=!0),t.op===ac.Op.CONCAT){if(n.op===ac.Op.NO_MATCH)return void(e.result=new ac(ac.Op.NO_MATCH));if(n.op===ac.Op.EMPTY_MATCH)return void(e.changed=!0);if(n.op===ac.Op.CONCAT){e.changed=!0;for(let t=0;t<n.subs.length;t++)e.subs.push(n.subs[t]);return}}else{if(n.op===ac.Op.NO_MATCH)return void(e.changed=!0);if(n.op===ac.Op.ALTERNATE){e.changed=!0;for(let t=0;t<n.subs.length;t++)e.subs.push(n.subs[t]);return}}e.subs.push(n)}else e.sub=n}static leave(e,n){switch(e.op){case ac.Op.PLB:case ac.Op.NLB:case ac.Op.CAPTURE:{const t=n.sub;if(t!==e.subs[0]){const n=ac.fromRegexp(e);return n.runes=new Int32Array(0),n.subs=[t],n}return e}case ac.Op.CONCAT:case ac.Op.ALTERNATE:if(n.changed){const t=n.subs;if(0===t.length)return new ac(e.op===ac.Op.CONCAT?ac.Op.EMPTY_MATCH:ac.Op.NO_MATCH);if(1===t.length)return t[0];const s=ac.fromRegexp(e);return s.runes=new Int32Array(0),s.subs=t,s}return e;case ac.Op.STAR:case ac.Op.PLUS:case ac.Op.QUEST:return t.simplify1(e.op,e.flags,n.sub,e);case ac.Op.REPEAT:return t.simplifyRepeat(e,n.sub);default:return e}}static simplifyRepeat(e,n){if(-1===e.max){if(0===e.min)return t.simplify1(ac.Op.STAR,e.flags,n,null);if(1===e.min)return t.simplify1(ac.Op.PLUS,e.flags,n,null);const s=[];for(let t=0;t<e.min-1;t++)s.push(n);return s.push(t.simplify1(ac.Op.PLUS,e.flags,n,null)),t.concat(s)}if(1===e.min&&1===e.max)return n;let s=null;if(e.min>0){s=[];for(let t=0;t<e.min;t++)s.push(n)}if(e.max>e.min){let r=t.simplify1(ac.Op.QUEST,e.flags,n,null);for(let s=e.min+1;s<e.max;s++)r=t.simplify1(ac.Op.QUEST,e.flags,t.concat([n,r]),null);if(null===s)return r;s.push(r)}return null!==s?t.concat(s):new ac(ac.Op.NO_MATCH)}static concat(t){const e=[];for(let n=0;n<t.length;n++){const s=t[n];if(s.op===ac.Op.NO_MATCH)return new ac(ac.Op.NO_MATCH);if(s.op!==ac.Op.EMPTY_MATCH)if(s.op!==ac.Op.CONCAT)e.push(s);else for(let t=0;t<s.subs.length;t++)e.push(s.subs[t])}if(0===e.length)return new ac(ac.Op.EMPTY_MATCH);if(1===e.length)return e[0];const n=new ac(ac.Op.CONCAT);return n.subs=e,n}static simplify1(t,e,n,s){if(n.op===ac.Op.EMPTY_MATCH)return n;if(n.op===ac.Op.NO_MATCH)return t===ac.Op.PLUS?n:new ac(ac.Op.EMPTY_MATCH);if(t===n.op&&(e&aB.NON_GREEDY)===(n.flags&aB.NON_GREEDY))return n;if(null!==s&&s.op===t&&(s.flags&aB.NON_GREEDY)===(e&aB.NON_GREEDY)&&n===s.subs[0])return s;const r=new ac(t);return r.flags=e,r.subs=[n],r}},wc=class{constructor(t,e){this.sign=t,this.cls=e}};const yc=[48,57],Ec=[9,10,12,13,32,32],_c=[48,57,65,90,95,95,97,122],Dc=new Map([["\\d",new wc(1,yc)],["\\D",new wc(-1,yc)],["\\s",new wc(1,Ec)],["\\S",new wc(-1,Ec)],["\\w",new wc(1,_c)],["\\W",new wc(-1,_c)]]),bc=[48,57,65,90,97,122],vc=[65,90,97,122],Ic=[0,127],Tc=[9,9,32,32],Oc=[0,31,127,127],Ac=[48,57],Sc=[33,126],Rc=[97,122],Nc=[32,126],xc=[33,47,58,64,91,96,123,126],kc=[9,13,32,32],Lc=[65,90],Fc=[48,57,65,90,95,95,97,122],Pc=[48,57,65,70,97,102],Mc=new Map([["[:alnum:]",new wc(1,bc)],["[:^alnum:]",new wc(-1,bc)],["[:alpha:]",new wc(1,vc)],["[:^alpha:]",new wc(-1,vc)],["[:ascii:]",new wc(1,Ic)],["[:^ascii:]",new wc(-1,Ic)],["[:blank:]",new wc(1,Tc)],["[:^blank:]",new wc(-1,Tc)],["[:cntrl:]",new wc(1,Oc)],["[:^cntrl:]",new wc(-1,Oc)],["[:digit:]",new wc(1,Ac)],["[:^digit:]",new wc(-1,Ac)],["[:graph:]",new wc(1,Sc)],["[:^graph:]",new wc(-1,Sc)],["[:lower:]",new wc(1,Rc)],["[:^lower:]",new wc(-1,Rc)],["[:print:]",new wc(1,Nc)],["[:^print:]",new wc(-1,Nc)],["[:punct:]",new wc(1,xc)],["[:^punct:]",new wc(-1,xc)],["[:space:]",new wc(1,kc)],["[:^space:]",new wc(-1,kc)],["[:upper:]",new wc(1,Lc)],["[:^upper:]",new wc(-1,Lc)],["[:word:]",new wc(1,Fc)],["[:^word:]",new wc(-1,Fc)],["[:xdigit:]",new wc(1,Pc)],["[:^xdigit:]",new wc(-1,Pc)]]);var Gc=class t{static charClassToString(t,e){let n="[";for(let s=0;s<e;s+=2){s>0&&(n+=" ");const e=t[s],r=t[s+1];n+=e===r?`0x${e.toString(16)}`:`0x${e.toString(16)}-0x${r.toString(16)}`}return n+="]",n}static sortRanges(t,e){const n=e>>1,s=new Array(n);for(let t=0;t<n;t++)s[t]=t;s.sort((e,n)=>t[2*e]-t[2*n]||t[2*n+1]-t[2*e+1]);const r=t.slice(0,e);for(let e=0;e<n;e++)t[2*e]=r[2*s[e]],t[2*e+1]=r[2*s[e]+1]}constructor(t=AB.emptyInts()){this.r=t,this.len=t.length}toArray(){return this.r instanceof Int32Array?this.len===this.r.length?this.r:this.r.subarray(0,this.len):new Int32Array(this.len===this.r.length?this.r:this.r.slice(0,this.len))}toGrowableArray(){return Array.isArray(this.r)?(this.r.length=this.len,this.r):Array.from(this.r.subarray(0,this.len))}cleanClass(){if(this.len<4)return this;t.sortRanges(this.r,this.len);let e=2;for(let t=2;t<this.len;t+=2){const n=this.r[t],s=this.r[t+1];n<=this.r[e-1]+1?s>this.r[e-1]&&(this.r[e-1]=s):(this.r[e]=n,this.r[e+1]=s,e+=2)}return this.len=e,this}appendLiteral(t,e){return 0!==(e&aB.FOLD_CASE)?this.appendFoldedRange(t,t):this.appendRange(t,t)}appendRange(t,e){if(this.len>0)for(let n=2;n<=4;n+=2)if(this.len>=n){const s=this.r[this.len-n],r=this.r[this.len-n+1];if(t<=r+1&&s<=e+1)return t<s&&(this.r[this.len-n]=t),e>r&&(this.r[this.len-n+1]=e),this}return this.r[this.len++]=t,this.r[this.len++]=e,this}appendFoldedRange(t,e){if(t<=vB.MIN_FOLD&&e>=vB.MAX_FOLD)return this.appendRange(t,e);if(e<vB.MIN_FOLD||t>vB.MAX_FOLD)return this.appendRange(t,e);t<vB.MIN_FOLD&&(this.appendRange(t,vB.MIN_FOLD-1),t=vB.MIN_FOLD),e>vB.MAX_FOLD&&(this.appendRange(vB.MAX_FOLD+1,e),e=vB.MAX_FOLD);for(let n=t;n<=e;n++){this.appendRange(n,n);for(let t=vB.simpleFold(n);t!==n;t=vB.simpleFold(t))this.appendRange(t,t)}return this}appendClass(t){for(let e=0;e<t.length;e+=2)this.appendRange(t[e],t[e+1]);return this}appendFoldedClass(t){for(let e=0;e<t.length;e+=2)this.appendFoldedRange(t[e],t[e+1]);return this}appendNegatedClass(t){let e=0;for(let n=0;n<t.length;n+=2){const s=t[n],r=t[n+1];e<=s-1&&this.appendRange(e,s-1),e=r+1}return e<=vB.MAX_RUNE&&this.appendRange(e,vB.MAX_RUNE),this}appendTable(t){for(let e=0;e<t.length;++e){const n=t.getLo(e),s=t.getHi(e),r=t.getStride(e);if(1!==r)for(let t=n;t<=s;t+=r)this.appendRange(t,t);else this.appendRange(n,s)}return this}appendNegatedTable(t){let e=0;for(let n=0;n<t.length;++n){const s=t.getLo(n),r=t.getHi(n),i=t.getStride(n);if(1!==i)for(let t=s;t<=r;t+=i)e<=t-1&&this.appendRange(e,t-1),e=t+1;else e<=s-1&&this.appendRange(e,s-1),e=r+1}return e<=vB.MAX_RUNE&&this.appendRange(e,vB.MAX_RUNE),this}appendTableWithSign(t,e){return e<0?this.appendNegatedTable(t):this.appendTable(t)}negateClass(){let t=0,e=0;for(let n=0;n<this.len;n+=2){const s=this.r[n],r=this.r[n+1];t<=s-1&&(this.r[e]=t,this.r[e+1]=s-1,e+=2),t=r+1}return this.len=e,t<=vB.MAX_RUNE&&(this.r[this.len++]=t,this.r[this.len++]=vB.MAX_RUNE),this}appendClassWithSign(t,e){return e<0?this.appendNegatedClass(t):this.appendClass(t)}appendGroup(e,n){let s=e.cls;return n&&(s=(new t).appendFoldedClass(s).cleanClass().toArray()),this.appendClassWithSign(s,e.sign)}toString(){return t.charClassToString(this.r,this.len)}},Hc=class{constructor(t){this.str=t,this.position=0}pos(){return this.position}rewindTo(t){this.position=t}more(){return this.position<this.str.length}peek(){return this.str.codePointAt(this.position)}skip(t){this.position+=t}skipString(t){this.position+=t.length}pop(){const t=this.str.codePointAt(this.position);return this.position+=AB.charCount(t),t}lookingAt(t){return this.str.startsWith(t,this.position)}rest(){return this.str.substring(this.position)}from(t){return this.str.substring(t,this.position)}toString(){return this.rest()}},Uc=class t{static ERR_INTERNAL_ERROR="regexp/syntax: internal error";static ERR_INVALID_CHAR_RANGE="invalid character class range";static ERR_INVALID_ESCAPE="invalid escape sequence";static ERR_INVALID_NAMED_CAPTURE="invalid named capture";static ERR_INVALID_PERL_OP="invalid or unsupported Perl syntax";static ERR_INVALID_REPEAT_OP="invalid nested repetition operator";static ERR_INVALID_REPEAT_SIZE="invalid repeat count";static ERR_MISSING_BRACKET="missing closing ]";static ERR_MISSING_PAREN="missing closing )";static ERR_MISSING_REPEAT_ARGUMENT="missing argument to repetition operator";static ERR_TRAILING_BACKSLASH="trailing backslash at end of expression";static ERR_DUPLICATE_NAMED_CAPTURE="duplicate capture group name";static ERR_UNEXPECTED_PAREN="unexpected )";static ERR_NESTING_DEPTH="expression nests too deeply";static ERR_LARGE="expression too large";static ERR_INVALID_CAPTURE_IN_LOOKBEHIND="invalid capture in lookbehind";static MAX_HEIGHT=1e3;static MAX_SIZE=1398101;static MAX_RUNES=33554432;static ANY_TABLE=new wB(new Uint32Array([0,vB.MAX_RUNE,1]));static ASCII_TABLE=new wB(new Uint32Array([0,127,1]));static ASCII_FOLD_TABLE=new wB(new Uint32Array([0,127,1,383,383,1,8490,8490,1]));static unicodeTable(e){return"Any"===e?{tab:t.ANY_TABLE,fold:t.ANY_TABLE,sign:1}:"Ascii"===e?{tab:t.ASCII_TABLE,fold:t.ASCII_FOLD_TABLE,sign:1}:"Assigned"===e?{tab:bB.CATEGORIES.get("Cn"),fold:bB.CATEGORIES.get("Cn"),sign:-1}:"Lc"===e?{tab:bB.CATEGORIES.get("LC"),fold:bB.FOLD_CATEGORIES.get("LC"),sign:1}:bB.CATEGORIES.has(e)?{tab:bB.CATEGORIES.get(e),fold:bB.FOLD_CATEGORIES.get(e),sign:1}:bB.SCRIPTS.has(e)?{tab:bB.SCRIPTS.get(e),fold:bB.FOLD_SCRIPT.get(e),sign:1}:null}static minFoldRune(t){if(t<vB.MIN_FOLD||t>vB.MAX_FOLD)return t;let e=t;const n=t;for(t=vB.simpleFold(t);t!==n;t=vB.simpleFold(t))e>t&&(e=t);return e}static leadingRegexp(t){if(t.op===ac.Op.EMPTY_MATCH)return null;if(t.op===ac.Op.CONCAT&&t.subs.length>0){const e=t.subs[0];return e.op===ac.Op.EMPTY_MATCH?null:e}return t}static literalRegexp(t,e){const n=new ac(ac.Op.LITERAL);return n.flags=e,n.runes=AB.stringToRunes(t),n}static parse(e,n){return new t(e,n).parseInternal()}static parseRepeat(e){const n=e.pos();if(!e.more()||!e.lookingAt("{"))return-1;e.skip(1);const s=t.parseInt(e);if(-1===s)return-1;if(!e.more())return-1;let r;if(e.lookingAt(",")){if(e.skip(1),!e.more())return-1;if(e.lookingAt("}"))r=-1;else if(-1===(r=t.parseInt(e)))return-1}else r=s;if(!e.more()||!e.lookingAt("}"))return-1;if(e.skip(1),s<0||s>1e3||-2===r||r>1e3||r>=0&&s>r)throw new HB(t.ERR_INVALID_REPEAT_SIZE,e.from(n));return s<<16|r&vB.MAX_BMP}static isValidCaptureName(t){if(0===t.length)return!1;for(let e=0;e<t.length;e++){const n=t.codePointAt(e);if(n!==mB.CODES._&&!AB.isalnum(n))return!1}return!0}static parseInt(t){const e=t.pos();for(;t.more()&&t.peek()>=mB.CODES[0]&&t.peek()<=mB.CODES[9];)t.skip(1);const n=t.from(e);return 0===n.length||n.length>1&&n.codePointAt(0)===mB.CODES[0]?-1:n.length>8?-2:parseInt(n,10)}static isCharClass(t){return t.op===ac.Op.LITERAL&&1===t.runes.length||t.op===ac.Op.CHAR_CLASS||t.op===ac.Op.ANY_CHAR_NOT_NL||t.op===ac.Op.ANY_CHAR}static matchRune(t,e){switch(t.op){case ac.Op.LITERAL:return 1===t.runes.length&&t.runes[0]===e;case ac.Op.CHAR_CLASS:for(let n=0;n<t.runes.length;n+=2)if(t.runes[n]<=e&&e<=t.runes[n+1])return!0;return!1;case ac.Op.ANY_CHAR_NOT_NL:return e!==mB.CODES["\n"];case ac.Op.ANY_CHAR:return!0}return!1}static mergeCharClass(e,n){switch(e.op){case ac.Op.ANY_CHAR:break;case ac.Op.ANY_CHAR_NOT_NL:t.matchRune(n,mB.CODES["\n"])&&(e.op=ac.Op.ANY_CHAR);break;case ac.Op.CHAR_CLASS:{const t=new Gc(Array.isArray(e.runes)?e.runes:Array.from(e.runes));n.op===ac.Op.LITERAL?t.appendLiteral(n.runes[0],n.flags):t.appendClass(n.runes),e.runes=t.toGrowableArray();break}case ac.Op.LITERAL:if(n.runes[0]===e.runes[0]&&n.flags===e.flags)break;e.op=ac.Op.CHAR_CLASS,e.runes=(new Gc).appendLiteral(e.runes[0],e.flags).appendLiteral(n.runes[0],n.flags).toGrowableArray()}}static parseEscape(e){const n=e.pos();if(e.skip(1),!e.more())throw new HB(t.ERR_TRAILING_BACKSLASH);let s=e.pop();t:switch(s){case mB.CODES[1]:case mB.CODES[2]:case mB.CODES[3]:case mB.CODES[4]:case mB.CODES[5]:case mB.CODES[6]:case mB.CODES[7]:if(!e.more()||e.peek()<mB.CODES[0]||e.peek()>mB.CODES[7])break;case mB.CODES[0]:{let t=s-mB.CODES[0];for(let n=1;n<3&&!(!e.more()||e.peek()<mB.CODES[0]||e.peek()>mB.CODES[7]);n++)t=8*t+e.peek()-mB.CODES[0],e.skip(1);return t}case mB.CODES.x:{if(!e.more())break;if(s=e.pop(),s===mB.CODES["{"]){let t=0,n=0;for(;;){if(!e.more())break t;if(s=e.pop(),s===mB.CODES["}"])break;const r=AB.unhex(s);if(r<0)break t;if(n=16*n+r,n>vB.MAX_RUNE)break t;t++}if(0===t)break t;return n}const t=AB.unhex(s);if(!e.more())break;s=e.pop();const n=AB.unhex(s);if(t<0||n<0)break;return 16*t+n}case mB.CODES.a:return mB.CODES[""];case mB.CODES.f:return mB.CODES["\f"];case mB.CODES.n:return mB.CODES["\n"];case mB.CODES.r:return mB.CODES["\r"];case mB.CODES.t:return mB.CODES["\t"];case mB.CODES.v:return mB.CODES["\v"];default:if(s<=vB.MAX_ASCII&&!AB.isalnum(s))return s}throw new HB(t.ERR_INVALID_ESCAPE,e.from(n))}static parseClassChar(e,n){if(!e.more())throw new HB(t.ERR_MISSING_BRACKET,e.from(n));return e.lookingAt("\\")?t.parseEscape(e):e.pop()}static hasCapture(e){if(null===e)return!1;if(e.op===ac.Op.CAPTURE)return!0;if(e.subs)for(let n of e.subs)if(t.hasCapture(n))return!0;return!1}constructor(t,e=0){this.wholeRegexp=t,this.flags=e,this.numCap=0,this.namedGroups=Object.create(null),this.stack=[],this.free=null,this.numRegexp=0,this.numRunes=0,this.repeats=0,this.height=null,this.size=null,this.nlb=0}newRegexp(t){let e=this.free;return null!==e&&null!==e.subs&&e.subs.length>0?(this.free=e.subs[0],e.reinit(),e.op=t):(e=new ac(t),this.numRegexp+=1),e}reuse(t){null!==this.height&&this.height.has(t)&&this.height.delete(t),null!==t.subs&&t.subs.length>0&&(t.subs[0]=this.free),this.free=t}checkLimits(e){if(this.numRunes>t.MAX_RUNES)throw new HB(t.ERR_LARGE);this.checkSize(e),this.checkHeight(e)}checkSize(e){if(null===this.size){if(0===this.repeats&&(this.repeats=1),e.op===ac.Op.REPEAT){let n=e.max;-1===n&&(n=e.min),n<=0&&(n=1),n>Math.floor(t.MAX_SIZE/this.repeats)?this.repeats=t.MAX_SIZE:this.repeats*=n}if(this.numRegexp<Math.floor(t.MAX_SIZE/this.repeats))return;this.size=new Map;for(let t of this.stack)this.checkSize(t)}if(this.calcSize(e,!0)>t.MAX_SIZE)throw new HB(t.ERR_LARGE)}calcSize(t,e=!1){if(!e&&null!==this.size&&this.size.has(t))return this.size.get(t);let n=0;switch(t.op){case ac.Op.LITERAL:n=t.runes.length;break;case ac.Op.PLB:case ac.Op.NLB:case ac.Op.CAPTURE:case ac.Op.STAR:n=2+this.calcSize(t.subs[0]);break;case ac.Op.PLUS:case ac.Op.QUEST:n=1+this.calcSize(t.subs[0]);break;case ac.Op.CONCAT:for(let e of t.subs)n+=this.calcSize(e);break;case ac.Op.ALTERNATE:for(let e of t.subs)n+=this.calcSize(e);t.subs.length>1&&(n=n+t.subs.length-1);break;case ac.Op.REPEAT:{let e=this.calcSize(t.subs[0]);if(-1===t.max){n=0===t.min?2+e:1+t.min*e;break}n=t.max*e+(t.max-t.min);break}}return n=Math.max(1,n),null===this.size&&(this.size=new Map),this.size.set(t,n),n}checkHeight(e){if(!(this.numRegexp<t.MAX_HEIGHT)){if(null===this.height){this.height=new Map;for(let t of this.stack)this.checkHeight(t)}if(this.calcHeight(e,!0)>t.MAX_HEIGHT)throw new HB(t.ERR_NESTING_DEPTH)}}calcHeight(t,e=!1){if(!e&&null!==this.height&&this.height.has(t))return this.height.get(t);let n=1;for(let e of t.subs){const t=this.calcHeight(e);n<1+t&&(n=1+t)}return null===this.height&&(this.height=new Map),this.height.set(t,n),n}pop(){return this.stack.pop()}popToPseudo(){const t=this.stack.length;let e=t;for(;e>0&&!ac.isPseudoOp(this.stack[e-1].op);)e--;return this.stack.splice(e,t-e)}push(t){if(this.numRunes+=t.runes.length,t.op===ac.Op.CHAR_CLASS&&2===t.runes.length&&t.runes[0]===t.runes[1]){if(this.maybeConcat(t.runes[0],-2&this.flags))return null;t.op=ac.Op.LITERAL,t.runes=[t.runes[0]],t.flags=-2&this.flags}else if(t.op===ac.Op.CHAR_CLASS&&4===t.runes.length&&t.runes[0]===t.runes[1]&&t.runes[2]===t.runes[3]&&vB.simpleFold(t.runes[0])===t.runes[2]&&vB.simpleFold(t.runes[2])===t.runes[0]||t.op===ac.Op.CHAR_CLASS&&2===t.runes.length&&t.runes[0]+1===t.runes[1]&&vB.simpleFold(t.runes[0])===t.runes[1]&&vB.simpleFold(t.runes[1])===t.runes[0]){if(this.maybeConcat(t.runes[0],this.flags|aB.FOLD_CASE))return null;t.op=ac.Op.LITERAL,t.runes=[t.runes[0]],t.flags=this.flags|aB.FOLD_CASE}else this.maybeConcat(-1,0);return this.stack.push(t),this.checkLimits(t),t}maybeConcat(t,e){const n=this.stack.length;if(n<2)return!1;const s=this.stack[n-1],r=this.stack[n-2];if(s.op!==ac.Op.LITERAL||r.op!==ac.Op.LITERAL||(s.flags&aB.FOLD_CASE)!==(r.flags&aB.FOLD_CASE))return!1;Array.isArray(r.runes)||(r.runes=Array.from(r.runes));for(let t=0;t<s.runes.length;t++)r.runes.push(s.runes[t]);return t>=0?(s.runes=[t],s.flags=e,!0):(this.pop(),this.reuse(s),!1)}newLiteral(e,n){const s=this.newRegexp(ac.Op.LITERAL);return s.flags=n,0!==(n&aB.FOLD_CASE)&&(e=t.minFoldRune(e)),s.runes=[e],s}literal(t){this.push(this.newLiteral(t,this.flags))}op(t){const e=this.newRegexp(t);return e.flags=this.flags,this.push(e)}repeat(e,n,s,r,i,o){let a=this.flags;if(0!==(a&aB.PERL_X)&&(i.more()&&i.lookingAt("?")&&(i.skip(1),a^=aB.NON_GREEDY),-1!==o))throw new HB(t.ERR_INVALID_REPEAT_OP,i.from(o));const B=this.stack.length;if(0===B)throw new HB(t.ERR_MISSING_REPEAT_ARGUMENT,i.from(r));const c=this.stack[B-1];if(ac.isPseudoOp(c.op))throw new HB(t.ERR_MISSING_REPEAT_ARGUMENT,i.from(r));const l=this.newRegexp(e);if(l.min=n,l.max=s,l.flags=a,l.subs=[c],this.stack[B-1]=l,this.checkLimits(l),e===ac.Op.REPEAT&&(n>=2||s>=2)&&!this.repeatIsValid(l,1e3))throw new HB(t.ERR_INVALID_REPEAT_SIZE,i.from(r))}repeatIsValid(t,e){if(t.op===ac.Op.REPEAT){let n=t.max;if(0===n)return!0;if(n<0&&(n=t.min),n>e)return!1;n>0&&(e=Math.trunc(e/n))}for(let n of t.subs)if(!this.repeatIsValid(n,e))return!1;return!0}concat(){this.maybeConcat(-1,0);const t=this.popToPseudo();return 0===t.length?this.push(this.newRegexp(ac.Op.EMPTY_MATCH)):this.push(this.collapse(t,ac.Op.CONCAT))}alternate(){const t=this.popToPseudo();return t.length>0&&this.cleanAlt(t[t.length-1]),0===t.length?this.push(this.newRegexp(ac.Op.NO_MATCH)):this.push(this.collapse(t,ac.Op.ALTERNATE))}cleanAlt(t){t.op===ac.Op.CHAR_CLASS&&(t.runes=new Gc(Array.from(t.runes)).cleanClass().toArray(),2===t.runes.length&&0===t.runes[0]&&t.runes[1]===vB.MAX_RUNE?(t.runes=new Int32Array(0),t.op=ac.Op.ANY_CHAR):4===t.runes.length&&0===t.runes[0]&&t.runes[1]===mB.CODES["\n"]-1&&t.runes[2]===mB.CODES["\n"]+1&&t.runes[3]===vB.MAX_RUNE&&(t.runes=new Int32Array(0),t.op=ac.Op.ANY_CHAR_NOT_NL))}collapse(t,e){if(1===t.length)return t[0];let n=0;for(let s of t)n+=s.op===e?s.subs.length:1;let s=new Array(n).fill(null),r=0;for(let n of t)if(n.op===e){for(let t=0;t<n.subs.length;t++)s[r++]=n.subs[t];this.reuse(n)}else s[r++]=n;let i=this.newRegexp(e);if(i.subs=s,e===ac.Op.ALTERNATE&&(i.subs=this.factor(i.subs),1===i.subs.length)){const t=i;i=i.subs[0],this.reuse(t)}return i}factor(e){if(e.length<2)return e;let n=0,s=e.length,r=0,i=null,o=0,a=0,B=0;for(let t=0;t<=s;t++){let c=null,l=0,u=0;if(t<s){let s=e[n+t];if(s.op===ac.Op.CONCAT&&s.subs.length>0&&(s=s.subs[0]),s.op===ac.Op.LITERAL&&(c=s.runes,l=s.runes.length,u=s.flags&aB.FOLD_CASE),u===a){let t=0;for(;t<o&&t<l&&i[t]===c[t];)t++;if(t>0){o=t;continue}}}if(t===B);else if(t===B+1)e[r++]=e[n+B];else{const s=this.newRegexp(ac.Op.LITERAL);s.flags=a,s.runes=i.slice(0,o);for(let s=B;s<t;s++)e[n+s]=this.removeLeadingString(e[n+s],o),this.checkLimits(e[n+s]);const c=this.collapse(e.slice(n+B,n+t),ac.Op.ALTERNATE),l=this.newRegexp(ac.Op.CONCAT);l.subs=[s,c],e[r++]=l}B=t,i=c,o=l,a=u}s=r,n=0,B=0,r=0;let c=null;for(let i=0;i<=s;i++){let o=null;if(!(i<s&&(o=t.leadingRegexp(e[n+i]),null!==c&&c.equals(o)&&(t.isCharClass(c)||c.op===ac.Op.REPEAT&&c.min===c.max&&t.isCharClass(c.subs[0]))))){if(i===B);else if(i===B+1)e[r++]=e[n+B];else{const t=c;for(let t=B;t<i;t++){const s=t!==B;e[n+t]=this.removeLeadingRegexp(e[n+t],s),this.checkLimits(e[n+t])}const s=this.collapse(e.slice(n+B,n+i),ac.Op.ALTERNATE),o=this.newRegexp(ac.Op.CONCAT);o.subs=[t,s],e[r++]=o}B=i,c=o}}s=r,n=0,B=0,r=0;for(let i=0;i<=s;i++)if(!(i<s&&t.isCharClass(e[n+i]))){if(i===B);else if(i===B+1)e[r++]=e[n+B];else{let s=B;for(let t=B+1;t<i;t++){const r=e[n+s],i=e[n+t];(r.op<i.op||r.op===i.op&&(null!==r.runes?r.runes.length:0)<(null!==i.runes?i.runes.length:0))&&(s=t)}const o=e[n+B];e[n+B]=e[n+s],e[n+s]=o;for(let s=B+1;s<i;s++)t.mergeCharClass(e[n+B],e[n+s]),this.reuse(e[n+s]);this.cleanAlt(e[n+B]),e[r++]=e[n+B]}i<s&&(e[r++]=e[n+i]),B=i+1}s=r,n=0,B=0,r=0;for(let t=0;t<s;++t)t+1<s&&e[n+t].op===ac.Op.EMPTY_MATCH&&e[n+t+1].op===ac.Op.EMPTY_MATCH||(e[r++]=e[n+t]);return s=r,n=0,e.slice(n,s)}removeLeadingString(t,e){if(t.op===ac.Op.CONCAT&&t.subs.length>0){const n=this.removeLeadingString(t.subs[0],e);if(t.subs[0]=n,n.op===ac.Op.EMPTY_MATCH)switch(this.reuse(n),t.subs.length){case 0:case 1:t.op=ac.Op.EMPTY_MATCH,t.subs=ac.emptySubs();break;case 2:{const e=t;t=t.subs[1],this.reuse(e);break}default:t.subs=t.subs.slice(1,t.subs.length)}return t}return t.op===ac.Op.LITERAL&&(t.runes=t.runes.slice(e,t.runes.length),0===t.runes.length&&(t.op=ac.Op.EMPTY_MATCH)),t}removeLeadingRegexp(t,e){if(t.op===ac.Op.CONCAT&&t.subs.length>0){switch(e&&this.reuse(t.subs[0]),t.subs=t.subs.slice(1,t.subs.length),t.subs.length){case 0:t.op=ac.Op.EMPTY_MATCH,t.subs=ac.emptySubs();break;case 1:{const e=t;t=t.subs[0],this.reuse(e);break}}return t}return e&&this.reuse(t),this.newRegexp(ac.Op.EMPTY_MATCH)}parseInternal(){if(0!==(this.flags&aB.LITERAL))return t.literalRegexp(this.wholeRegexp,this.flags);let e=-1,n=-1,s=-1;const r=new Hc(this.wholeRegexp);for(;r.more();){let i=-1;t:switch(r.peek()){case mB.CODES["("]:if(0!==(this.flags&aB.LOOKBEHIND)){if(r.lookingAt("(?<=")){this.parsePosLookBehind(),r.skip(4);break}if(r.lookingAt("(?<!")){this.parseNegLookBehind(),r.skip(4);break}}if(0!==(this.flags&aB.PERL_X)&&r.lookingAt("(?")){this.parsePerlFlags(r);break}this.op(ac.Op.LEFT_PAREN).cap=++this.numCap,r.skip(1);break;case mB.CODES["|"]:this.parseVerticalBar(),r.skip(1);break;case mB.CODES[")"]:this.parseRightParen(),r.skip(1);break;case mB.CODES["^"]:0!==(this.flags&aB.ONE_LINE)?this.op(ac.Op.BEGIN_TEXT):this.op(ac.Op.BEGIN_LINE),r.skip(1);break;case mB.CODES.$:0!==(this.flags&aB.ONE_LINE)?this.op(ac.Op.END_TEXT).flags|=aB.WAS_DOLLAR:this.op(ac.Op.END_LINE),r.skip(1);break;case mB.CODES["."]:0!==(this.flags&aB.DOT_NL)?this.op(ac.Op.ANY_CHAR):this.op(ac.Op.ANY_CHAR_NOT_NL),r.skip(1);break;case mB.CODES["["]:this.parseClass(r);break;case mB.CODES["*"]:case mB.CODES["+"]:case mB.CODES["?"]:{i=r.pos();let t=null;switch(r.pop()){case mB.CODES["*"]:t=ac.Op.STAR;break;case mB.CODES["+"]:t=ac.Op.PLUS;break;case mB.CODES["?"]:t=ac.Op.QUEST}this.repeat(t,n,s,i,r,e);break}case mB.CODES["{"]:{const o=r.pos(),a=t.parseRepeat(r);if(a<0){r.rewindTo(o),this.literal(r.pop());break}i=o,n=a>>16,s=(a&vB.MAX_BMP)<<16>>16,this.repeat(ac.Op.REPEAT,n,s,i,r,e);break}case mB.CODES["\\"]:{const e=r.pos();if(r.skip(1),0!==(this.flags&aB.PERL_X)&&r.more())switch(r.pop()){case mB.CODES.A:this.op(ac.Op.BEGIN_TEXT);break t;case mB.CODES.b:this.op(ac.Op.WORD_BOUNDARY);break t;case mB.CODES.B:this.op(ac.Op.NO_WORD_BOUNDARY);break t;case mB.CODES.C:throw new HB(t.ERR_INVALID_ESCAPE,"\\C");case mB.CODES.Q:{let t=r.rest();const e=t.indexOf("\\E");e>=0?(t=t.substring(0,e),r.skipString(t),r.skipString("\\E")):r.skipString(t);let n=0;for(;n<t.length;){const e=t.codePointAt(n);this.literal(e),n+=AB.charCount(e)}break t}case mB.CODES.z:this.op(ac.Op.END_TEXT);break t;default:r.rewindTo(e)}else r.rewindTo(e);const n=this.newRegexp(ac.Op.CHAR_CLASS);if(n.flags=this.flags,r.lookingAt("\\p")||r.lookingAt("\\P")){const t=new Gc;if(this.parseUnicodeClass(r,t)){n.runes=t.toArray(),this.push(n);break t}}const s=new Gc;if(this.parsePerlClassEscape(r,s)){n.runes=s.toArray(),this.push(n);break t}r.rewindTo(e),this.reuse(n),this.literal(t.parseEscape(r));break}default:this.literal(r.pop())}e=i}if(this.concat(),this.swapVerticalBar()&&this.pop(),this.alternate(),1!==this.stack.length)throw new HB(t.ERR_MISSING_PAREN,this.wholeRegexp);return this.stack[0].namedGroups=this.namedGroups,this.stack[0]}parsePerlFlags(e){const n=e.pos(),s=e.rest();if(s.startsWith("(?P<")||s.startsWith("(?<")){const n="P"===s.charAt(2)?4:3,r=s.indexOf(">");if(r<0)throw new HB(t.ERR_INVALID_NAMED_CAPTURE,s);const i=s.substring(n,r);if(e.skipString(i),e.skip(n+1),!t.isValidCaptureName(i))throw new HB(t.ERR_INVALID_NAMED_CAPTURE,s.substring(0,r+1));const o=this.op(ac.Op.LEFT_PAREN);if(o.cap=++this.numCap,this.namedGroups[i])throw new HB(t.ERR_DUPLICATE_NAMED_CAPTURE,i);return this.namedGroups[i]=this.numCap,void(o.name=i)}e.skip(2);let r=this.flags,i=1,o=!1;t:for(;e.more();){const t=e.pop();switch(t){case mB.CODES.i:r|=aB.FOLD_CASE,o=!0;break;case mB.CODES.m:r&=-17,o=!0;break;case mB.CODES.s:r|=aB.DOT_NL,o=!0;break;case mB.CODES.U:r|=aB.NON_GREEDY,o=!0;break;case mB.CODES["-"]:if(i<0)break t;i=-1,r=~r,o=!1;break;case mB.CODES[":"]:case mB.CODES[")"]:if(i<0){if(!o)break t;r=~r}return t===mB.CODES[":"]&&this.op(ac.Op.LEFT_PAREN),void(this.flags=r);default:break t}}throw new HB(t.ERR_INVALID_PERL_OP,e.from(n))}parsePosLookBehind(){const t=this.newRegexp(ac.Op.LEFT_PAREN);return t.flags=this.flags,t.lb=++this.nlb,this.push(t)}parseNegLookBehind(){const t=this.newRegexp(ac.Op.LEFT_PAREN);return t.flags=this.flags,t.lb=-++this.nlb,this.push(t)}parseVerticalBar(){this.concat(),this.swapVerticalBar()||this.op(ac.Op.VERTICAL_BAR)}swapVerticalBar(){const e=this.stack.length;if(e>=3&&this.stack[e-2].op===ac.Op.VERTICAL_BAR&&t.isCharClass(this.stack[e-1])&&t.isCharClass(this.stack[e-3])){let n=this.stack[e-1],s=this.stack[e-3];if(n.op>s.op){const t=s;s=n,n=t,this.stack[e-3]=s}return t.mergeCharClass(s,n),this.reuse(n),this.pop(),!0}if(e>=2){const t=this.stack[e-1],n=this.stack[e-2];if(n.op===ac.Op.VERTICAL_BAR)return e>=3&&this.cleanAlt(this.stack[e-3]),this.stack[e-2]=t,this.stack[e-1]=n,!0}return!1}parseRightParen(){if(this.concat(),this.swapVerticalBar()&&this.pop(),this.alternate(),this.stack.length<2)throw new HB(t.ERR_UNEXPECTED_PAREN,this.wholeRegexp);const e=this.pop(),n=this.pop();if(n.op!==ac.Op.LEFT_PAREN)throw new HB(t.ERR_UNEXPECTED_PAREN,this.wholeRegexp);if(this.flags=n.flags,0!==n.lb){if(t.hasCapture(e))throw new HB(t.ERR_INVALID_CAPTURE_IN_LOOKBEHIND,this.wholeRegexp);return n.lb>0?n.op=ac.Op.PLB:n.op=ac.Op.NLB,n.subs=[e],void this.push(n)}0===n.cap?this.push(e):(n.op=ac.Op.CAPTURE,n.subs=[e],this.push(n))}parsePerlClassEscape(t,e){const n=t.pos();if(0===(this.flags&aB.PERL_X)||!t.more()||t.pop()!==mB.CODES["\\"]||!t.more())return!1;t.pop();const s=t.from(n),r=Dc.has(s)?Dc.get(s):null;return null!==r&&(e.appendGroup(r,0!==(this.flags&aB.FOLD_CASE)),!0)}parseNamedClass(e,n){const s=e.rest(),r=s.indexOf(":]");if(r<0)return!1;const i=s.substring(0,r+2);e.skipString(i);const o=Mc.has(i)?Mc.get(i):null;if(null===o)throw new HB(t.ERR_INVALID_CHAR_RANGE,i);return n.appendGroup(o,0!==(this.flags&aB.FOLD_CASE)),!0}parseUnicodeClass(e,n){const s=e.pos();if(0===(this.flags&aB.UNICODE_GROUPS)||!e.lookingAt("\\p")&&!e.lookingAt("\\P"))return!1;e.skip(1);let r,i=1,o=e.pop();if(o===mB.CODES.P&&(i=-1),!e.more())throw e.rewindTo(s),new HB(t.ERR_INVALID_CHAR_RANGE,e.rest());if(o=e.pop(),o!==mB.CODES["{"])r=AB.runeToString(o);else{const n=e.rest(),i=n.indexOf("}");if(i<0)throw e.rewindTo(s),new HB(t.ERR_INVALID_CHAR_RANGE,e.rest());r=n.substring(0,i),e.skipString(r),e.skip(1)}0!==r.length&&r.codePointAt(0)===mB.CODES["^"]&&(i=0-i,r=r.substring(1));const a=t.unicodeTable(r);if(null===a)throw new HB(t.ERR_INVALID_CHAR_RANGE,e.from(s));a.sign<0&&(i=0-i);const B=a.tab,c=a.fold;if(0===(this.flags&aB.FOLD_CASE)||null===c)n.appendTableWithSign(B,i);else{const t=(new Gc).appendTable(B).appendTable(c).cleanClass().toArray();n.appendClassWithSign(Array.from(t),i)}return!0}parseClass(e){const n=e.pos();e.skip(1);const s=this.newRegexp(ac.Op.CHAR_CLASS);s.flags=this.flags;const r=new Gc;let i=1;e.more()&&e.lookingAt("^")&&(i=-1,e.skip(1),0===(this.flags&aB.CLASS_NL)&&r.appendRange(mB.CODES["\n"],mB.CODES["\n"]));let o=!0;for(;!e.more()||e.peek()!==mB.CODES["]"]||o;){if(e.more()&&e.lookingAt("-")&&0===(this.flags&aB.PERL_X)&&!o){const s=e.rest();if("-"===s||!s.startsWith("-]"))throw e.rewindTo(n),new HB(t.ERR_INVALID_CHAR_RANGE,e.rest())}o=!1;const s=e.pos();if(e.lookingAt("[:")){if(this.parseNamedClass(e,r))continue;e.rewindTo(s)}if(this.parseUnicodeClass(e,r))continue;if(this.parsePerlClassEscape(e,r))continue;e.rewindTo(s);const i=t.parseClassChar(e,n);let a=i;if(e.more()&&e.lookingAt("-"))if(e.skip(1),e.more()&&e.lookingAt("]"))e.skip(-1);else if(a=t.parseClassChar(e,n),a<i)throw new HB(t.ERR_INVALID_CHAR_RANGE,e.from(s));0===(this.flags&aB.FOLD_CASE)?r.appendRange(i,a):r.appendFoldedRange(i,a)}e.skip(1),r.cleanClass(),i<0&&r.negateClass(),s.runes=r.toArray(),this.push(s)}},Vc=class t{static initTest(e){const n=t.compile(e),s=new t(n.expr,n.prog,n.numSubexp,n.longest);return s.cond=n.cond,s.prefix=n.prefix,s.prefixUTF8=n.prefixUTF8,s.prefixComplete=n.prefixComplete,s.prefixRune=n.prefixRune,s.prefilter=n.prefilter,s.namedGroups=n.namedGroups,s}static compile(e){return t.compileImpl(e,aB.PERL,!1)}static compilePOSIX(e){return t.compileImpl(e,aB.POSIX,!0)}static compileImpl(e,n,s){let r=Uc.parse(e,n);const i=r.maxCap(),o=r.namedGroups;r=mc.simplify(r);const a=uc.build(r),B=gc.compileRegexp(r),c=new t(e,B,i,s);c.prefilter=a.type===lc.Type.NONE?null:a;const[l,u]=B.prefix();return c.prefixComplete=l,c.prefix=u,c.prefixUTF8=AB.stringToUtf8ByteArray(c.prefix),c.prefix.length>0&&(c.prefixRune=c.prefix.codePointAt(0)),c.namedGroups=o,c}static match(e,n){return t.compile(e).match(n)}constructor(t,e,n=0,s=0){this.expr=t,this.prog=e,this.numSubexp=n,this.longest=s,this.cond=e.startCond(),this.prefix=null,this.prefixUTF8=null,this.prefixComplete=!1,this.prefixRune=0,this.namedGroups=Object.create(null),this.machinePool=[],this.lazyDFA=null,this.onepass=oc.compile(this.prog),this.prefilter=null}get dfa(){return null===this.lazyDFA&&(this.lazyDFA=new tc(this.prog)),this.lazyDFA}matchPrefixComplete(t,e,n,s){if((n===aB.ANCHOR_START||n===aB.ANCHOR_BOTH)&&0!==e)return null;let r=-1,i=-1;const o=t.prefixLength(this);if(n===aB.UNANCHORED){const n=t.index(this,e);if(n<0)return null;r=e+n,i=r+o}else if(n===aB.ANCHOR_BOTH){if(t.endPos()!==o)return null;if(0!==t.index(this,0))return null;r=0,i=o}else if(n===aB.ANCHOR_START){if(0!==t.index(this,0))return null;r=0,i=o}if(r<0)return null;if(s>0){const t=new Int32Array(s).fill(-1);return t[0]=r,t[1]=i,Array.from(t)}return[]}createLookbehindState(){return this.prog.numLb>0?new KB(this.prog):null}executeEngine(t,e,n,s,r=null){if(this.prefixComplete&&(0===s||0===this.numSubexp))return this.matchPrefixComplete(t,e,n,s);if(null!==this.prefilter&&n===aB.UNANCHORED&&!this.prefilter.eval(t,e))return null;if(null!==this.onepass)return oc.execute(this,t,e,n,s);if(s>0)return 0===this.prog.numLb&&t.endPos()<=sc.maxBitStateLen(this.prog)?sc.execute(this,t,e,n,s):this.doExecuteNFA(t,e,n,s,r);if(0===this.prog.numLb){const r=this.dfa.match(t,e,n);if(null!==r)return r?[]:null;if(t.endPos()<=sc.maxBitStateLen(this.prog))return sc.execute(this,t,e,n,s)}return this.doExecuteNFA(t,e,n,s,r)}numberOfCapturingGroups(){return this.numSubexp}numberOfInstructions(){return this.prog.numInst()}get(){return this.machinePool.length>0?this.machinePool.pop():null}reset(){this.machinePool.length=0}put(t){this.machinePool.push(t)}toString(){return this.expr}doExecuteNFA(t,e,n,s,r=null){let i=this.get();i||(i=QB.fromRE2(this)),i.init(s);const o=i.match(t,e,n,r)?i.submatches():null;return this.put(i),o}match(t){return null!==this.executeEngine(MB.fromUTF16(t),0,aB.UNANCHORED,0)}matchWithGroup(t,e,n,s,r,i=null){return t instanceof RB||(t=AB.isByteArray(t)?kB.utf8(t):kB.utf16(t)),this.matchMachineInput(t,e,n,s,r,i)}matchMachineInput(t,e,n,s,r,i=null){if(e>n)return[!1,null];const o=t.isUTF16Encoding()?MB.fromUTF16(t.asCharSequence(),0,n):MB.fromUTF8(t.asBytes(),0,n),a=this.executeEngine(o,e,s,2*r,i);return null===a?[!1,null]:[!0,a]}matchUTF8(t){return null!==this.executeEngine(MB.fromUTF8(t),0,aB.UNANCHORED,0)}replaceAll(t,e){return this.replaceAllFunc(t,()=>e,2*t.length+1)}replaceFirst(t,e){return this.replaceAllFunc(t,()=>e,1)}replaceAllFunc(t,e,n){let s=0,r=0,i="";const o=MB.fromUTF16(t),a=this.createLookbehindState();let B=0;for(;r<=t.length;){const c=this.executeEngine(o,r,aB.UNANCHORED,2,a);if(null===c||0===c.length)break;i+=t.substring(s,c[0]),(c[1]>s||0===c[0])&&(i+=e(t.substring(c[0],c[1])),B++),s=c[1];const l=7&o.step(r);if(r+l>c[1]?r+=l:r+1>c[1]?r++:r=c[1],B>=n)break}return i+=t.substring(s),i}pad(t){if(null===t)return null;let e=2*(1+this.numSubexp);if(t.length<e){let n=new Array(e).fill(-1);for(let e=0;e<t.length;e++)n[e]=t[e];t=n}return t}allMatches(t,e,n=t=>t){let s=[];const r=t.endPos();e<0&&(e=r+1);let i=0,o=0,a=-1;const B=this.createLookbehindState();for(;o<e&&i<=r;){const e=this.executeEngine(t,i,aB.UNANCHORED,this.prog.numCap,B);if(null===e||0===e.length)break;let c=!0;if(e[1]===i){e[0]===a&&(c=!1);const n=t.step(i);n<0?i=r+1:i+=7&n}else i=e[1];a=e[1],c&&(s.push(n(this.pad(e))),o++)}return s}findUTF8(t){const e=this.executeEngine(MB.fromUTF8(t),0,aB.UNANCHORED,2);return null===e?null:t.slice(e[0],e[1])}findUTF8Index(t){const e=this.executeEngine(MB.fromUTF8(t),0,aB.UNANCHORED,2);return null===e?null:e.slice(0,2)}find(t){const e=this.executeEngine(MB.fromUTF16(t),0,aB.UNANCHORED,2);return null===e?"":t.substring(e[0],e[1])}findIndex(t){return this.executeEngine(MB.fromUTF16(t),0,aB.UNANCHORED,2)}findUTF8Submatch(t){const e=this.executeEngine(MB.fromUTF8(t),0,aB.UNANCHORED,this.prog.numCap);if(null===e)return null;const n=new Array(1+this.numSubexp).fill(null);for(let s=0;s<n.length;s++)2*s<e.length&&e[2*s]>=0&&(n[s]=t.slice(e[2*s],e[2*s+1]));return n}findUTF8SubmatchIndex(t){return this.pad(this.executeEngine(MB.fromUTF8(t),0,aB.UNANCHORED,this.prog.numCap))}findSubmatch(t){const e=this.executeEngine(MB.fromUTF16(t),0,aB.UNANCHORED,this.prog.numCap);if(null===e)return null;const n=new Array(1+this.numSubexp).fill(null);for(let s=0;s<n.length;s++)2*s<e.length&&e[2*s]>=0&&(n[s]=t.substring(e[2*s],e[2*s+1]));return n}findSubmatchIndex(t){return this.pad(this.executeEngine(MB.fromUTF16(t),0,aB.UNANCHORED,this.prog.numCap))}findAllUTF8(t,e){const n=this.allMatches(MB.fromUTF8(t),e,e=>t.slice(e[0],e[1]));return 0===n.length?null:n}findAllUTF8Index(t,e){const n=this.allMatches(MB.fromUTF8(t),e,t=>t.slice(0,2));return 0===n.length?null:n}findAll(t,e){const n=this.allMatches(MB.fromUTF16(t),e,e=>t.substring(e[0],e[1]));return 0===n.length?null:n}findAllIndex(t,e){const n=this.allMatches(MB.fromUTF16(t),e,t=>t.slice(0,2));return 0===n.length?null:n}findAllUTF8Submatch(t,e){const n=this.allMatches(MB.fromUTF8(t),e,e=>{let n=new Array(e.length/2|0).fill(null);for(let s=0;s<n.length;s++)e[2*s]>=0&&(n[s]=t.slice(e[2*s],e[2*s+1]));return n});return 0===n.length?null:n}findAllUTF8SubmatchIndex(t,e){const n=this.allMatches(MB.fromUTF8(t),e);return 0===n.length?null:n}findAllSubmatch(t,e){const n=this.allMatches(MB.fromUTF16(t),e,e=>{let n=new Array(e.length/2|0).fill(null);for(let s=0;s<n.length;s++)e[2*s]>=0&&(n[s]=t.substring(e[2*s],e[2*s+1]));return n});return 0===n.length?null:n}findAllSubmatchIndex(t,e){const n=this.allMatches(MB.fromUTF16(t),e);return 0===n.length?null:n}},jc=class t{static isHexadecimal(t){return"0"<=t&&t<="9"||"A"<=t&&t<="F"||"a"<=t&&t<="f"}static translate(e){let n="";if(e instanceof RegExp&&(e.ignoreCase&&(n+="i"),e.multiline&&(n+="m"),e.dotAll&&(n+="s"),e=e.source),"string"!=typeof e)return e;let s="",r=!1,i=e.length;0===i&&(s="(?:)",r=!0);let o=!1,a=0;for(;a<i;){let n=e[a];if("\\"===n){if(a+1<i)switch(n=e[a+1],n){case"\\":s+="\\\\",a+=2;continue;case"c":if(a+2<i){let t=e[a+2].charCodeAt(0);if(t>=65&&t<=90||t>=97&&t<=122){let e=t%32;s+="\\x",s+=(e>>4).toString(16).toUpperCase(),s+=(15&e).toString(16).toUpperCase(),a+=3,r=!0;continue}}s+="c",a+=2,r=!0;continue;case"u":if(a+2<i)if("{"===e[a+2]){let n=a+3,o=!1,B=!1;for(;n<i;){const s=e[n];if("}"===s){B=!0;break}if(!t.isHexadecimal(s))break;o=!0,n++}if(B&&o){s+="\\x",a+=2,r=!0;continue}}else if(a+5<i){let n=!0;for(let s=0;s<4;s++)if(!t.isHexadecimal(e[a+2+s])){n=!1;break}if(n){s+="\\x{"+e.substring(a+2,a+6)+"}",a+=6,r=!0;continue}}s+="u",a+=2,r=!0;continue;case"x":{let n=!1;if(a+2<i&&"{"===e[a+2]){let s=a+3,r=!1,o=!1;for(;s<i;){const n=e[s];if("}"===n){o=!0;break}if(!t.isHexadecimal(n))break;r=!0,s++}o&&r&&(n=!0)}else a+3<i&&t.isHexadecimal(e[a+2])&&t.isHexadecimal(e[a+3])&&(n=!0);n?(s+="\\x",a+=2):(s+="x",a+=2,r=!0);continue}case"n":case"r":case"t":case"a":case"f":case"v":case"d":case"D":case"s":case"S":case"w":case"W":case"b":case"B":case"p":case"P":case"A":case"z":case"Q":case"E":case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":s+="\\"+n,a+=2;continue;default:{let t=e.codePointAt(a+1);if(t>=48&&t<=57||t>=65&&t<=90||t>=97&&t<=122){let n=AB.charCount(t);s+=e.substring(a+1,a+1+n),a+=n+1,r=!0}else{s+="\\";let n=AB.charCount(t);s+=e.substring(a+1,a+1+n),a+=n+1}continue}}}else{if("/"===n){s+="\\/",a+=1,r=!0;continue}if("["===n){if(!o&&"]"===e[a+1]){s+="[^\\x00-\\x{10FFFF}]",a+=2,r=!0;continue}if(!o&&"^"===e[a+1]&&"]"===e[a+2]){s+="[\\x00-\\x{10FFFF}]",a+=3,r=!0;continue}o=!0}else if("]"===n)o=!1;else if(!o&&"("===n&&a+2<i&&"?"===e[a+1]&&"<"===e[a+2]&&a+3<i&&!"=!>)".includes(e[a+3])){s+="(?P<",a+=3,r=!0;continue}}let B=e.codePointAt(a),c=AB.charCount(B);s+=e.substring(a,a+c),a+=c}const B=r?s:e;return n.length>0?`(?${n})${B}`:B}};const $c=(t,e)=>{const n=t.matchArray();return n.index=t.start(0),n.input=e,n.groups=t.namedGroupsObject(),n};var Jc=class t{static CASE_INSENSITIVE=BB;static DOTALL=cB;static MULTILINE=lB;static DISABLE_UNICODE_GROUPS=uB;static LONGEST_MATCH=hB;static LOOKBEHINDS=dB;static quote(t){return AB.quoteMeta(t)}static quoteReplacement(t,e=!1){return JB.quoteReplacement(t,e)}static translateRegExp(t){return jc.translate(t)}static compile(e,n=0){let s=e;if(0!==(n&t.CASE_INSENSITIVE)&&(s=`(?i)${s}`),0!==(n&t.DOTALL)&&(s=`(?s)${s}`),0!==(n&t.MULTILINE)&&(s=`(?m)${s}`),-544&n)throw new jB("Flags should only be a combination of MULTILINE, DOTALL, CASE_INSENSITIVE, DISABLE_UNICODE_GROUPS, LONGEST_MATCH, LOOKBEHINDS");let r=aB.PERL;0!==(n&t.DISABLE_UNICODE_GROUPS)&&(r&=-129),0!==(n&t.LOOKBEHINDS)&&(r|=aB.LOOKBEHIND);const i=new t(e,n);return i.re2Input=Vc.compileImpl(s,r,0!==(n&t.LONGEST_MATCH)),i}static matches(e,n){return t.compile(e).testExact(n)}static initTest(e,n,s){if(null==e)throw new Error("pattern is null");if(null==s)throw new Error("re2 is null");const r=new t(e,n);return r.re2Input=s,r}constructor(t,e){this.patternInput=t,this.flagsInput=e,this.re2Input=null}reset(){this.re2Input.reset()}flags(){return this.flagsInput}pattern(){return this.patternInput}re2(){return this.re2Input}matches(t){return this.testExact(t)}matcher(t){return AB.isByteArray(t)&&(t=kB.utf8(t)),new JB(this,t)}test(t){return AB.isByteArray(t)?this.re2Input.matchUTF8(t):this.re2Input.match(t)}testExact(t){const e=AB.isByteArray(t)?MB.fromUTF8(t):MB.fromUTF16(t);return null!==this.re2Input.executeEngine(e,0,aB.ANCHOR_BOTH,0)}exec(t){const e=this.matcher(t);return e.find()?$c(e,t):null}split(t,e=0){const n=this.matcher(t),s=[];let r=0,i=0;for(;n.find();)if(0!==i||0!==n.end()){if(e>0&&s.length===e-1)break;if(i===n.start()){if(0===e){r+=1,i=n.end();continue}}else for(;r>0;)s.push(""),r-=1;s.push(n.substring(i,n.start())),i=n.end()}else i=n.end();if(0===e&&i!==n.inputLength()){for(;r>0;)s.push(""),r-=1;s.push(n.substring(i,n.inputLength()))}return 0===e&&(0!==s.length||i===n.inputLength()&&i>0)||s.push(n.substring(i,n.inputLength())),s}*matchAll(t){const e=this.matcher(t);for(;e.find();)yield $c(e,t)}toString(){return this.patternInput}programSize(){return this.re2Input.numberOfInstructions()}groupCount(){return this.re2Input.numberOfCapturingGroups()}namedGroups(){return this.re2Input.namedGroups}equals(t){return this===t||null!==t&&this.constructor===t.constructor&&(this.flagsInput===t.flagsInput&&this.patternInput===t.patternInput)}};let qc="12.19.0";const zc=new ls("@firebase/firestore");function Kc(){return zc.logLevel}function Qc(t,...e){if(zc.logLevel<=is.DEBUG){const n=e.map(Xc);zc.debug(`Firestore (${qc}): ${t}`,...n)}}function Wc(t,...e){if(zc.logLevel<=is.ERROR){const n=e.map(Xc);zc.error(`Firestore (${qc}): ${t}`,...n)}}function Yc(t,...e){if(zc.logLevel<=is.WARN){const n=e.map(Xc);zc.warn(`Firestore (${qc}): ${t}`,...n)}}function Xc(t){if("string"==typeof t)return t;try{return function(t){return JSON.stringify(t)}(t)}catch(e){return t}}function Zc(t,e,n){let s="Unexpected state";"string"==typeof e?s=e:n=e,tl(t,s,n)}function tl(t,e,n){let s=`FIRESTORE (${qc}) INTERNAL ASSERTION FAILED: ${e} (ID: ${t.toString(16)})`;if(void 0!==n)try{s+=" CONTEXT: "+JSON.stringify(n)}catch(t){s+=" CONTEXT: "+n}throw Wc(s),new Error(s)}function el(t,e,n,s){let r="Unexpected state";"string"==typeof n?r=n:s=n,t||tl(e,r,s)}function nl(t,e){return t}function sl(t){const e="undefined"!=typeof self&&(self.crypto||self.msCrypto),n=new Uint8Array(t);if(e&&"function"==typeof e.getRandomValues)e.getRandomValues(n);else for(let e=0;e<t;e++)n[e]=Math.floor(256*Math.random());return n}class rl{static newId(){const t=62*Math.floor(256/62);let e="";for(;e.length<20;){const n=sl(40);for(let s=0;s<n.length;++s)e.length<20&&n[s]<t&&(e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".charAt(n[s]%62))}return e}}function il(t,e){return t<e?-1:t>e?1:0}function ol(t,e){const n=Math.min(t.length,e.length);for(let s=0;s<n;s++){const n=t.charAt(s),r=e.charAt(s);if(n!==r)return cl(n)===cl(r)?il(n,r):cl(n)?1:-1}return il(t.length,e.length)}const al=55296,Bl=57343;function cl(t){const e=t.charCodeAt(0);return e>=al&&e<=Bl}function ll(t,e,n){return t.length===e.length&&t.every((t,s)=>n(t,e[s]))}class ul{constructor(t,e){this.comparator=t,this.root=e||dl.EMPTY}insert(t,e){return new ul(this.comparator,this.root.insert(t,e,this.comparator).copy(null,null,dl.BLACK,null,null))}remove(t){return new ul(this.comparator,this.root.remove(t,this.comparator).copy(null,null,dl.BLACK,null,null))}get(t){let e=this.root;for(;!e.isEmpty();){const n=this.comparator(t,e.key);if(0===n)return e.value;n<0?e=e.left:n>0&&(e=e.right)}return null}indexOf(t){let e=0,n=this.root;for(;!n.isEmpty();){const s=this.comparator(t,n.key);if(0===s)return e+n.left.size;s<0?n=n.left:(e+=n.left.size+1,n=n.right)}return-1}isEmpty(){return this.root.isEmpty()}get size(){return this.root.size}minKey(){return this.root.minKey()}maxKey(){return this.root.maxKey()}inorderTraversal(t){return this.root.inorderTraversal(t)}forEach(t){this.inorderTraversal((e,n)=>(t(e,n),!1))}toString(){const t=[];return this.inorderTraversal((e,n)=>(t.push(`${e}:${n}`),!1)),`{${t.join(", ")}}`}reverseTraversal(t){return this.root.reverseTraversal(t)}getIterator(){return new hl(this.root,null,this.comparator,!1)}getIteratorFrom(t){return new hl(this.root,t,this.comparator,!1)}getReverseIterator(){return new hl(this.root,null,this.comparator,!0)}getReverseIteratorFrom(t){return new hl(this.root,t,this.comparator,!0)}}class hl{constructor(t,e,n,s){this.isReverse=s,this.nodeStack=[];let r=1;for(;!t.isEmpty();)if(r=e?n(t.key,e):1,e&&s&&(r*=-1),r<0)t=this.isReverse?t.left:t.right;else{if(0===r){this.nodeStack.push(t);break}this.nodeStack.push(t),t=this.isReverse?t.right:t.left}}getNext(){let t=this.nodeStack.pop();const e={key:t.key,value:t.value};if(this.isReverse)for(t=t.left;!t.isEmpty();)this.nodeStack.push(t),t=t.right;else for(t=t.right;!t.isEmpty();)this.nodeStack.push(t),t=t.left;return e}hasNext(){return this.nodeStack.length>0}peek(){if(0===this.nodeStack.length)return null;const t=this.nodeStack[this.nodeStack.length-1];return{key:t.key,value:t.value}}}class dl{constructor(t,e,n,s,r){this.key=t,this.value=e,this.color=null!=n?n:dl.RED,this.left=null!=s?s:dl.EMPTY,this.right=null!=r?r:dl.EMPTY,this.size=this.left.size+1+this.right.size}copy(t,e,n,s,r){return new dl(null!=t?t:this.key,null!=e?e:this.value,null!=n?n:this.color,null!=s?s:this.left,null!=r?r:this.right)}isEmpty(){return!1}inorderTraversal(t){return this.left.inorderTraversal(t)||t(this.key,this.value)||this.right.inorderTraversal(t)}reverseTraversal(t){return this.right.reverseTraversal(t)||t(this.key,this.value)||this.left.reverseTraversal(t)}min(){return this.left.isEmpty()?this:this.left.min()}minKey(){return this.min().key}maxKey(){return this.right.isEmpty()?this.key:this.right.maxKey()}insert(t,e,n){let s=this;const r=n(t,s.key);return s=r<0?s.copy(null,null,null,s.left.insert(t,e,n),null):0===r?s.copy(null,e,null,null,null):s.copy(null,null,null,null,s.right.insert(t,e,n)),s.fixUp()}removeMin(){if(this.left.isEmpty())return dl.EMPTY;let t=this;return t.left.isRed()||t.left.left.isRed()||(t=t.moveRedLeft()),t=t.copy(null,null,null,t.left.removeMin(),null),t.fixUp()}remove(t,e){let n,s=this;if(e(t,s.key)<0)s.left.isEmpty()||s.left.isRed()||s.left.left.isRed()||(s=s.moveRedLeft()),s=s.copy(null,null,null,s.left.remove(t,e),null);else{if(s.left.isRed()&&(s=s.rotateRight()),s.right.isEmpty()||s.right.isRed()||s.right.left.isRed()||(s=s.moveRedRight()),0===e(t,s.key)){if(s.right.isEmpty())return dl.EMPTY;n=s.right.min(),s=s.copy(n.key,n.value,null,null,s.right.removeMin())}s=s.copy(null,null,null,null,s.right.remove(t,e))}return s.fixUp()}isRed(){return this.color}fixUp(){let t=this;return t.right.isRed()&&!t.left.isRed()&&(t=t.rotateLeft()),t.left.isRed()&&t.left.left.isRed()&&(t=t.rotateRight()),t.left.isRed()&&t.right.isRed()&&(t=t.colorFlip()),t}moveRedLeft(){let t=this.colorFlip();return t.right.left.isRed()&&(t=t.copy(null,null,null,null,t.right.rotateRight()),t=t.rotateLeft(),t=t.colorFlip()),t}moveRedRight(){let t=this.colorFlip();return t.left.left.isRed()&&(t=t.rotateRight(),t=t.colorFlip()),t}rotateLeft(){const t=this.copy(null,null,dl.RED,null,this.right.left);return this.right.copy(null,null,this.color,t,null)}rotateRight(){const t=this.copy(null,null,dl.RED,this.left.right,null);return this.left.copy(null,null,this.color,null,t)}colorFlip(){const 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)}checkMaxDepth(){const t=this.check();return Math.pow(2,t)<=this.size+1}check(){if(this.isRed()&&this.left.isRed())throw Zc(43730,{key:this.key,value:this.value});if(this.right.isRed())throw Zc(14113,{key:this.key,value:this.value});const t=this.left.check();if(t!==this.right.check())throw Zc(27949);return t+(this.isRed()?0:1)}}dl.EMPTY=null,dl.RED=!0,dl.BLACK=!1,dl.EMPTY=new class{constructor(){this.size=0}get key(){throw Zc(57766)}get value(){throw Zc(16141)}get color(){throw Zc(16727)}get left(){throw Zc(29726)}get right(){throw Zc(36894)}copy(t,e,n,s,r){return this}insert(t,e,n){return new dl(t,e)}remove(t,e){return this}isEmpty(){return!0}inorderTraversal(t){return!1}reverseTraversal(t){return!1}minKey(){return null}maxKey(){return null}isRed(){return!1}checkMaxDepth(){return!0}check(){return 0}};class pl{constructor(t){this.comparator=t,this.data=new ul(this.comparator)}has(t){return null!==this.data.get(t)}first(){return this.data.minKey()}last(){return this.data.maxKey()}get size(){return this.data.size}indexOf(t){return this.data.indexOf(t)}forEach(t){this.data.inorderTraversal((e,n)=>(t(e),!1))}forEachInRange(t,e){const n=this.data.getIteratorFrom(t[0]);for(;n.hasNext();){const s=n.getNext();if(this.comparator(s.key,t[1])>=0)return;e(s.key)}}forEachWhile(t,e){let n;for(n=void 0!==e?this.data.getIteratorFrom(e):this.data.getIterator();n.hasNext();)if(!t(n.getNext().key))return}firstAfterOrEqual(t){const e=this.data.getIteratorFrom(t);return e.hasNext()?e.getNext().key:null}getIterator(){return new fl(this.data.getIterator())}getIteratorFrom(t){return new fl(this.data.getIteratorFrom(t))}add(t){return this.copy(this.data.remove(t).insert(t,!0))}delete(t){return this.has(t)?this.copy(this.data.remove(t)):this}isEmpty(){return this.data.isEmpty()}unionWith(t){let e=this;return e.size<t.size&&(e=t,t=this),t.forEach(t=>{e=e.add(t)}),e}isEqual(t){if(!(t instanceof pl))return!1;if(this.size!==t.size)return!1;const e=this.data.getIterator(),n=t.data.getIterator();for(;e.hasNext();){const t=e.getNext().key,s=n.getNext().key;if(0!==this.comparator(t,s))return!1}return!0}toArray(){const t=[];return this.forEach(e=>{t.push(e)}),t}toString(){const t=[];return this.forEach(e=>t.push(e)),"SortedSet("+t.toString()+")"}copy(t){const e=new pl(this.comparator);return e.data=t,e}}class fl{constructor(t){this.iter=t}getNext(){return this.iter.getNext().key}hasNext(){return this.iter.hasNext()}}const Cl={OK:"ok",CANCELLED:"cancelled",UNKNOWN:"unknown",INVALID_ARGUMENT:"invalid-argument",DEADLINE_EXCEEDED:"deadline-exceeded",NOT_FOUND:"not-found",ALREADY_EXISTS:"already-exists",PERMISSION_DENIED:"permission-denied",UNAUTHENTICATED:"unauthenticated",RESOURCE_EXHAUSTED:"resource-exhausted",FAILED_PRECONDITION:"failed-precondition",ABORTED:"aborted",OUT_OF_RANGE:"out-of-range",UNIMPLEMENTED:"unimplemented",INTERNAL:"internal",UNAVAILABLE:"unavailable",DATA_LOSS:"data-loss"};class gl extends Vn{constructor(t,e){super(t,e),this.code=t,this.message=e,this.toString=()=>`${this.name}: [code=${this.code}]: ${this.message}`}}const ml="__name__";class wl{constructor(t,e,n){void 0===e?e=0:e>t.length&&Zc(637,{offset:e,range:t.length}),void 0===n?n=t.length-e:n>t.length-e&&Zc(1746,{length:n,range:t.length-e}),this.segments=t,this.offset=e,this.len=n}get length(){return this.len}isEqual(t){return 0===wl.comparator(this,t)}child(t){const e=this.segments.slice(this.offset,this.limit());return t instanceof wl?t.forEach(t=>{e.push(t)}):e.push(t),this.construct(e)}limit(){return this.offset+this.length}popFirst(t){return t=void 0===t?1:t,this.construct(this.segments,this.offset+t,this.length-t)}popLast(){return this.construct(this.segments,this.offset,this.length-1)}firstSegment(){return this.segments[this.offset]}lastSegment(){return this.get(this.length-1)}get(t){return this.segments[this.offset+t]}isEmpty(){return 0===this.length}isPrefixOf(t){if(t.length<this.length)return!1;for(let e=0;e<this.length;e++)if(this.get(e)!==t.get(e))return!1;return!0}isImmediateParentOf(t){if(this.length+1!==t.length)return!1;for(let e=0;e<this.length;e++)if(this.get(e)!==t.get(e))return!1;return!0}forEach(t){for(let e=this.offset,n=this.limit();e<n;e++)t(this.segments[e])}toArray(){return this.segments.slice(this.offset,this.limit())}static comparator(t,e){const n=Math.min(t.length,e.length);for(let s=0;s<n;s++){const n=wl.compareSegments(t.get(s),e.get(s));if(0!==n)return n}return il(t.length,e.length)}static compareSegments(t,e){const n=wl.isNumericId(t),s=wl.isNumericId(e);return n&&!s?-1:!n&&s?1:n&&s?wl.extractNumericId(t).compare(wl.extractNumericId(e)):ol(t,e)}static isNumericId(t){return t.startsWith("__id")&&t.endsWith("__")}static extractNumericId(t){return Wa.fromString(t.substring(4,t.length-2))}}class yl extends wl{construct(t,e,n){return new yl(t,e,n)}canonicalString(){return this.toArray().join("/")}toString(){return this.canonicalString()}toStringWithLeadingSlash(){return`/${this.canonicalString()}`}toUriEncodedString(){return this.toArray().map(encodeURIComponent).join("/")}static fromString(...t){const e=[];for(const n of t){if(n.indexOf("//")>=0)throw new gl(Cl.INVALID_ARGUMENT,`Invalid segment (${n}). Paths must not contain // in them.`);e.push(...n.split("/").filter(t=>t.length>0))}return new yl(e)}static emptyPath(){return new yl([])}}const El=/^[_a-zA-Z][_a-zA-Z0-9]*$/;let _l=class t extends wl{construct(e,n,s){return new t(e,n,s)}static isValidIdentifier(t){return El.test(t)}canonicalString(){return this.toArray().map(e=>(e=e.replace(/\\/g,"\\\\").replace(/`/g,"\\`"),t.isValidIdentifier(e)||(e="`"+e+"`"),e)).join(".")}toString(){return this.canonicalString()}isKeyField(){return 1===this.length&&this.get(0)===ml}static keyField(){return new t([ml])}static fromServerFormat(e){const n=[];let s="",r=0;const i=()=>{if(0===s.length)throw new gl(Cl.INVALID_ARGUMENT,`Invalid field path (${e}). Paths must not be empty, begin with '.', end with '.', or contain '..'`);n.push(s),s=""};let o=!1;for(;r<e.length;){const t=e[r];if("\\"===t){if(r+1===e.length)throw new gl(Cl.INVALID_ARGUMENT,"Path has trailing escape character: "+e);const t=e[r+1];if("\\"!==t&&"."!==t&&"`"!==t)throw new gl(Cl.INVALID_ARGUMENT,"Path has invalid escape sequence: "+e);s+=t,r+=2}else"`"===t?(o=!o,r++):"."!==t||o?(s+=t,r++):(i(),r++)}if(i(),o)throw new gl(Cl.INVALID_ARGUMENT,"Unterminated ` in path: "+e);return new t(n)}static emptyPath(){return new t([])}};class Dl{constructor(t){this.fields=t,t.sort(_l.comparator)}static empty(){return new Dl([])}unionWith(t){let e=new pl(_l.comparator);for(const t of this.fields)e=e.add(t);for(const n of t)e=e.add(n);return new Dl(e.toArray())}covers(t){for(const e of this.fields)if(e.isPrefixOf(t))return!0;return!1}isEqual(t){return ll(this.fields,t.fields,(t,e)=>t.isEqual(e))}}function bl(t){let e=0;for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&e++;return e}function vl(t,e){for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&e(n,t[n])}function Il(t){for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e))return!1;return!0}class Tl{constructor(t){this.path=t}static fromPath(t){return new Tl(yl.fromString(t))}static fromName(t){return new Tl(yl.fromString(t).popFirst(5))}static empty(){return new Tl(yl.emptyPath())}get collectionGroup(){return this.path.popLast().lastSegment()}hasCollectionId(t){return this.path.length>=2&&this.path.get(this.path.length-2)===t}getCollectionGroup(){return this.path.get(this.path.length-2)}getCollectionPath(){return this.path.popLast()}isEqual(t){return null!==t&&0===yl.comparator(this.path,t.path)}toString(){return this.path.toString()}static comparator(t,e){return yl.comparator(t.path,e.path)}static isDocumentKey(t){return t.length%2==0}static fromSegments(t){return new Tl(new yl(t.slice()))}}function Ol(t){if(!Tl.isDocumentKey(t))throw new gl(Cl.INVALID_ARGUMENT,`Invalid document reference. Document references must have an even number of segments, but ${t} has ${t.length}.`)}function Al(t){return"object"==typeof t&&null!==t&&(Object.getPrototypeOf(t)===Object.prototype||null===Object.getPrototypeOf(t))}function Sl(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";{const e=function(t){return t.constructor?t.constructor.name:null}(t);return e?`a custom ${e} object`:"an object"}}return"function"==typeof t?"a function":Zc(12329,{type:typeof t})}function Rl(t,e){if("_delegate"in t&&(t=t._delegate),!(t instanceof e)){if(e.name===t.constructor.name)throw new gl(Cl.INVALID_ARGUMENT,"Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?");{const n=Sl(t);throw new gl(Cl.INVALID_ARGUMENT,`Expected type '${e.name}', but it was: ${n}`)}}return t}function Nl(t,e){const n={typeString:t};return e&&(n.value=e),n}function xl(t,e){if(!Al(t))throw new gl(Cl.INVALID_ARGUMENT,"JSON must be an object");let n;for(const s in e)if(e[s]){const r=e[s].typeString,i="value"in e[s]?{value:e[s].value}:void 0;if(!(s in t)){n=`JSON missing required field: '${s}'`;break}const o=t[s];if(r&&typeof o!==r){n=`JSON field '${s}' must be a ${r}.`;break}if(void 0!==i&&o!==i.value){n=`Expected '${s}' field to equal '${i.value}'`;break}}if(n)throw new gl(Cl.INVALID_ARGUMENT,n);return!0}const kl=-62135596800,Ll=1e6;class Fl{static now(){return Fl.fromMillis(Date.now())}static fromDate(t){return Fl.fromMillis(t.getTime())}static fromMillis(t){const e=Math.floor(t/1e3),n=Math.floor((t-1e3*e)*Ll);return new Fl(e,n)}static fromInstant(t){if(!t||"bigint"!=typeof t.t)throw new gl(Cl.INVALID_ARGUMENT,"Invalid Temporal.Instant object provided.");return Fl._fromEpochNanoseconds(t.t)}static _fromEpochNanoseconds(t){let e,n;if(t>=0n)e=Number(t/1000000000n),n=Number(t%1000000000n);else{const s=t%1000000000n;0n===s?(e=Number(t/1000000000n),n=0):(e=Number(t/1000000000n-1n),n=Number(s+1000000000n))}return new Fl(e,n)}constructor(t,e){if(this.seconds=t,this.nanoseconds=e,e<0)throw new gl(Cl.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+e);if(e>=1e9)throw new gl(Cl.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+e);if(t<kl)throw new gl(Cl.INVALID_ARGUMENT,"Timestamp seconds out of range: "+t);if(t>=253402300800)throw new gl(Cl.INVALID_ARGUMENT,"Timestamp seconds out of range: "+t)}toDate(){return new Date(this.toMillis())}toMillis(){return 1e3*this.seconds+this.nanoseconds/Ll}toInstant(){if("undefined"==typeof Temporal||!Temporal.Instant)throw new gl(Cl.FAILED_PRECONDITION,"The Temporal object is not available in the current environment.");const t=1000000000n*BigInt(this.seconds)+BigInt(this.nanoseconds);return Temporal.Instant.__PRIVATE_fromEpochNanoseconds(t)}_compareTo(t){return this.seconds===t.seconds?il(this.nanoseconds,t.nanoseconds):il(this.seconds,t.seconds)}isEqual(t){return t.seconds===this.seconds&&t.nanoseconds===this.nanoseconds}toString(){return"Timestamp(seconds="+this.seconds+", nanoseconds="+this.nanoseconds+")"}toJSON(){return{type:Fl._jsonSchemaVersion,seconds:this.seconds,nanoseconds:this.nanoseconds}}static fromJSON(t){if(xl(t,Fl._jsonSchema))return new Fl(t.seconds,t.nanoseconds)}valueOf(){const t=this.seconds-kl;return String(t).padStart(12,"0")+"."+String(this.nanoseconds).padStart(9,"0")}}Fl._jsonSchemaVersion="firestore/timestamp/1.0",Fl._jsonSchema={type:Nl("string",Fl._jsonSchemaVersion),seconds:Nl("number"),nanoseconds:Nl("number")};class Pl extends Error{constructor(){super(...arguments),this.name="Base64DecodeError"}}class Ml{constructor(t){this.binaryString=t}static fromBase64String(t){const e=function(t){try{return atob(t)}catch(t){throw"undefined"!=typeof DOMException&&t instanceof DOMException?new Pl("Invalid base64 string: "+t):t}}(t);return new Ml(e)}static fromUint8Array(t){const e=function(t){let e="";for(let n=0;n<t.length;++n)e+=String.fromCharCode(t[n]);return e}(t);return new Ml(e)}[Symbol.iterator](){let t=0;return{next:()=>t<this.binaryString.length?{value:this.binaryString.charCodeAt(t++),done:!1}:{value:void 0,done:!0}}}toBase64(){return function(t){return btoa(t)}(this.binaryString)}toUint8Array(){return function(t){const e=new Uint8Array(t.length);for(let n=0;n<t.length;n++)e[n]=t.charCodeAt(n);return e}(this.binaryString)}approximateByteSize(){return 2*this.binaryString.length}compareTo(t){return il(this.binaryString,t.binaryString)}isEqual(t){return this.binaryString===t.binaryString}}Ml.EMPTY_BYTE_STRING=new Ml("");const Gl=new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);function Hl(t){if(el(!!t,39018),"string"==typeof t){let e=0;const n=Gl.exec(t);if(el(!!n,46558,{timestamp:t}),n[1]){let t=n[1];t=(t+"000000000").substr(0,9),e=Number(t)}const s=new Date(t);return{seconds:Math.floor(s.getTime()/1e3),nanos:e}}return{seconds:Ul(t.seconds),nanos:Ul(t.nanos)}}function Ul(t){return"number"==typeof t?t:"string"==typeof t?Number(t):0}function Vl(t){return"string"==typeof t?Ml.fromBase64String(t):Ml.fromUint8Array(t)}const jl="server_timestamp",$l="__type__",Jl="__previous_value__",ql="__local_write_time__";function zl(t){const e=(t?.mapValue?.fields||{})[$l]?.stringValue;return e===jl}function Kl(t){const e=t.mapValue.fields[Jl];return zl(e)?Kl(e):e}function Ql(t){const e=Hl(t.mapValue.fields[ql].timestampValue);return new Fl(e.seconds,e.nanos)}class Wl{constructor(t,e,n,s,r,i,o,a,B,c,l,u,h){this.databaseId=t,this.appId=e,this.persistenceKey=n,this.host=s,this.ssl=r,this.forceLongPolling=i,this.autoDetectLongPolling=o,this.longPollingOptions=a,this.useFetchStreams=B,this.isUsingEmulator=c,this.apiKey=l,this._customHeaders=u,this.grpcFlowControlWindow=h}}const Yl="(default)";class Xl{constructor(t,e){this.projectId=t,this.database=e||Yl}static empty(){return new Xl("","")}get isDefaultDatabase(){return this.database===Yl}isEqual(t){return t instanceof Xl&&t.projectId===this.projectId&&t.database===this.database}}function Zl(t,e){if(!Object.prototype.hasOwnProperty.apply(t.options,["projectId"]))throw new gl(Cl.INVALID_ARGUMENT,'"projectId" not provided in firebase.initializeApp.');return new Xl(t.options.projectId,e)}function tu(t){return null==t}function eu(t){return 0===t&&1/t==-1/0}const nu="__type__",su="__max__",ru={},iu="__vector__",ou="value",au={nullValue:"NULL_VALUE"},Bu={booleanValue:!0},cu={booleanValue:!1};function lu(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?zl(t)?4:function(t){return(((t.mapValue||{}).fields||{}).__type__||{}).stringValue===su}(t)?9007199254740991:Iu(t)?10:11:Zc(28295,{value:t})}function uu(t,e,n){if(t===e)return!0;const s=lu(t);if(s!==lu(e))return!1;switch(s){case 0:case 9007199254740991:return!0;case 1:return t.booleanValue===e.booleanValue;case 4:return Ql(t).isEqual(Ql(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;const n=Hl(t.timestampValue),s=Hl(e.timestampValue);return n.seconds===s.seconds&&n.nanos===s.nanos}(t,e);case 5:return t.stringValue===e.stringValue;case 6:return function(t,e){return Vl(t.bytesValue).isEqual(Vl(e.bytesValue))}(t,e);case 7:return t.referenceValue===e.referenceValue;case 8:return function(t,e){return Ul(t.geoPointValue.latitude)===Ul(e.geoPointValue.latitude)&&Ul(t.geoPointValue.longitude)===Ul(e.geoPointValue.longitude)}(t,e);case 2:return function(t,e,n){if("integerValue"in t&&"integerValue"in e)return Ul(t.integerValue)===Ul(e.integerValue);let s,r;if("doubleValue"in t&&"doubleValue"in e)s=Ul(t.doubleValue),r=Ul(e.doubleValue);else{if(!n?.i)return!1;s=Ul(t.integerValue??t.doubleValue),r=Ul(e.integerValue??e.doubleValue)}return s===r?!!n?.o||eu(s)===eu(r):!(void 0!==n&&!n.u)&&isNaN(s)&&isNaN(r)}(t,e,n);case 9:return ll(t.arrayValue.values||[],e.arrayValue.values||[],(t,e)=>uu(t,e,n));case 10:case 11:return function(t,e,n){const s=t.mapValue.fields||{},r=e.mapValue.fields||{};if(bl(s)!==bl(r))return!1;for(const t in s)if(s.hasOwnProperty(t)&&(void 0===r[t]||!uu(s[t],r[t],n)))return!1;return!0}(t,e,n);default:return Zc(52216,{left:t})}}function hu(t,e){return void 0!==(t.values||[]).find(t=>uu(t,e))}function du(t,e){if(t===e)return 0;const n=lu(t),s=lu(e);if(n!==s)return il(n,s);switch(n){case 0:case 9007199254740991:return 0;case 1:return il(t.booleanValue,e.booleanValue);case 2:return function(t,e){const n=Ul(t.integerValue||t.doubleValue),s=Ul(e.integerValue||e.doubleValue);return n<s?-1:n>s?1:n===s?0:isNaN(n)?isNaN(s)?0:-1:1}(t,e);case 3:return pu(t.timestampValue,e.timestampValue);case 4:return pu(Ql(t),Ql(e));case 5:return ol(t.stringValue,e.stringValue);case 6:return function(t,e){const n=Vl(t),s=Vl(e);return n.compareTo(s)}(t.bytesValue,e.bytesValue);case 7:return function(t,e){const n=t.split("/"),s=e.split("/");for(let t=0;t<n.length&&t<s.length;t++){const e=il(n[t],s[t]);if(0!==e)return e}return il(n.length,s.length)}(t.referenceValue,e.referenceValue);case 8:return function(t,e){const n=il(Ul(t.latitude),Ul(e.latitude));return 0!==n?n:il(Ul(t.longitude),Ul(e.longitude))}(t.geoPointValue,e.geoPointValue);case 9:return fu(t.arrayValue,e.arrayValue);case 10:return function(t,e){const n=t.fields||{},s=e.fields||{},r=n[ou]?.arrayValue,i=s[ou]?.arrayValue,o=il(r?.values?.length||0,i?.values?.length||0);return 0!==o?o:fu(r,i)}(t.mapValue,e.mapValue);case 11:return function(t,e){if(t===ru&&e===ru)return 0;if(t===ru)return 1;if(e===ru)return-1;const n=t.fields||{},s=Object.keys(n),r=e.fields||{},i=Object.keys(r);s.sort(),i.sort();for(let t=0;t<s.length&&t<i.length;++t){const e=ol(s[t],i[t]);if(0!==e)return e;const o=du(n[s[t]],r[i[t]]);if(0!==o)return o}return il(s.length,i.length)}(t.mapValue,e.mapValue);default:throw Zc(23264,{l:n})}}function pu(t,e){if("string"==typeof t&&"string"==typeof e&&t.length===e.length)return il(t,e);const n=Hl(t),s=Hl(e),r=il(n.seconds,s.seconds);return 0!==r?r:il(n.nanos,s.nanos)}function fu(t,e){const n=t.values||[],s=e.values||[];for(let t=0;t<n.length&&t<s.length;++t){const e=du(n[t],s[t]);if(void 0!==e&&0!==e)return e}return il(n.length,s.length)}function Cu(t){return gu(t)}function gu(t){return"nullValue"in t?"null":"booleanValue"in t?""+t.booleanValue:"integerValue"in t?""+t.integerValue:"doubleValue"in t?""+t.doubleValue:"timestampValue"in t?function(t){const e=Hl(t);return`time(${e.seconds},${e.nanos})`}(t.timestampValue):"stringValue"in t?t.stringValue:"bytesValue"in t?function(t){return Vl(t).toBase64()}(t.bytesValue):"referenceValue"in t?function(t){return Tl.fromName(t).toString()}(t.referenceValue):"geoPointValue"in t?function(t){return`geo(${t.latitude},${t.longitude})`}(t.geoPointValue):"arrayValue"in t?function(t){let e="[",n=!0;for(const s of t.values||[])n?n=!1:e+=",",e+=gu(s);return e+"]"}(t.arrayValue):"mapValue"in t?function(t){const e=Object.keys(t.fields||{}).sort();let n="{",s=!0;for(const r of e)s?s=!1:n+=",",n+=`${r}:${gu(t.fields[r])}`;return n+"}"}(t.mapValue):Zc(61005,{value:t})}function mu(t){switch(lu(t)){case 0:case 1:return 4;case 2:return 8;case 3:case 8:return 16;case 4:const e=Kl(t);return e?16+mu(e):16;case 5:return 2*t.stringValue.length;case 6:return Vl(t.bytesValue).approximateByteSize();case 7:return t.referenceValue.length;case 9:return function(t){return(t.values||[]).reduce((t,e)=>t+mu(e),0)}(t.arrayValue);case 10:case 11:return function(t){let e=0;return vl(t.fields,(t,n)=>{e+=t.length+mu(n)}),e}(t.mapValue);default:throw Zc(13486,{value:t})}}function wu(t){return!!t&&"integerValue"in t}function yu(t){return!!t&&"doubleValue"in t}function Eu(t){return wu(t)||yu(t)}function _u(t){return!!t&&"arrayValue"in t}function Du(t){return!!t&&"nullValue"in t}function bu(t){return!!t&&"doubleValue"in t&&isNaN(Number(t.doubleValue))}function vu(t){return!!t&&"mapValue"in t}function Iu(t){const e=(t?.mapValue?.fields||{})[nu]?.stringValue;return e===iu}function Tu(t){return(t?.mapValue?.fields||{})[ou]?.arrayValue}function Ou(t){if(t.geoPointValue)return{geoPointValue:{...t.geoPointValue}};if(t.timestampValue&&"object"==typeof t.timestampValue)return{timestampValue:{...t.timestampValue}};if(t.mapValue){const e={mapValue:{fields:{}}};return vl(t.mapValue.fields,(t,n)=>e.mapValue.fields[t]=Ou(n)),e}if(t.arrayValue){const e={arrayValue:{values:[]}};for(let n=0;n<(t.arrayValue.values||[]).length;++n)e.arrayValue.values[n]=Ou(t.arrayValue.values[n]);return e}return{...t}}class Au{constructor(t){this.value=t}static empty(){return new Au({mapValue:{}})}field(t){if(t.isEmpty())return this.value;{let e=this.value;for(let n=0;n<t.length-1;++n)if(e=(e.mapValue.fields||{})[t.get(n)],!vu(e))return null;return e=(e.mapValue.fields||{})[t.lastSegment()],e||null}}set(t,e){this.getFieldsMap(t.popLast())[t.lastSegment()]=Ou(e)}setAll(t){let e=_l.emptyPath(),n={},s=[];t.forEach((t,r)=>{if(!e.isImmediateParentOf(r)){const t=this.getFieldsMap(e);this.applyChanges(t,n,s),n={},s=[],e=r.popLast()}t?n[r.lastSegment()]=Ou(t):s.push(r.lastSegment())});const r=this.getFieldsMap(e);this.applyChanges(r,n,s)}delete(t){const e=this.field(t.popLast());vu(e)&&e.mapValue.fields&&delete e.mapValue.fields[t.lastSegment()]}isEqual(t){return uu(this.value,t.value)}getFieldsMap(t){let e=this.value;e.mapValue.fields||(e.mapValue={fields:{}});for(let n=0;n<t.length;++n){let s=e.mapValue.fields[t.get(n)];vu(s)&&s.mapValue.fields||(s={mapValue:{fields:{}}},e.mapValue.fields[t.get(n)]=s),e=s}return e.mapValue.fields}applyChanges(t,e,n){vl(e,(e,n)=>t[e]=n);for(const e of n)delete t[e]}clone(){return new Au(Ou(this.value))}}function Su(t){const e=[];return vl(t.fields,(t,n)=>{const s=new _l([t]);if(vu(n)){const t=Su(n.mapValue).fields;if(0===t.length)e.push(s);else for(const n of t)e.push(s.child(n))}else e.push(s)}),new Dl(e)}function Ru(t,e){if(t.useProto3Json){if(isNaN(e))return{doubleValue:"NaN"};if(e===1/0)return{doubleValue:"Infinity"};if(e===-1/0)return{doubleValue:"-Infinity"}}return{doubleValue:eu(e)?"-0":e}}function Nu(t){return{integerValue:""+t}}function xu(t,e,n){return function(t){return"number"==typeof t&&Number.isInteger(t)&&!eu(t)&&t<=Number.MAX_SAFE_INTEGER&&t>=Number.MIN_SAFE_INTEGER}(e)?Nu(e):Ru(t,e)}class ku{constructor(){this._=void 0}}function Lu(t,e,n){return t instanceof Mu?function(t,e){const n={fields:{[$l]:{stringValue:jl},[ql]:{timestampValue:{seconds:t.seconds,nanos:t.nanoseconds}}}};return e&&zl(e)&&(e=Kl(e)),e&&(n.fields[Jl]=e),{mapValue:n}}(n,e):t instanceof Gu?Hu(t,e):t instanceof Uu?Vu(t,e):t instanceof $u?function(t,e){const n=Pu(t,e),s=Ku(n)+Ku(t.h);return wu(n)&&wu(t.h)?Nu(s):Ru(t.serializer,s)}(t,e):t instanceof Ju?function(t,e){return zu(t,e,Math.min)}(t,e):t instanceof qu?function(t,e){return zu(t,e,Math.max)}(t,e):void 0}function Fu(t,e,n){return t instanceof Gu?Hu(t,e):t instanceof Uu?Vu(t,e):n}function Pu(t,e){return t instanceof $u?Eu(e)?e:{integerValue:0}:null}class Mu extends ku{}class Gu extends ku{constructor(t){super(),this.elements=t}}function Hu(t,e){const n=Qu(e);for(const e of t.elements)n.some(t=>uu(t,e))||n.push(e);return{arrayValue:{values:n}}}class Uu extends ku{constructor(t){super(),this.elements=t}}function Vu(t,e){let n=Qu(e);for(const e of t.elements)n=n.filter(t=>!uu(t,e));return{arrayValue:{values:n}}}class ju extends ku{constructor(t,e){super(),this.serializer=t,this.h=e}}class $u extends ju{}class Ju extends ju{}class qu extends ju{}function zu(t,e,n){if(!Eu(e))return t.h;const s=n(Ku(e),Ku(t.h));return wu(e)&&wu(t.h)?Nu(s):Ru(t.serializer,s)}function Ku(t){return Ul(t.integerValue||t.doubleValue)}function Qu(t){return _u(t)&&t.arrayValue.values?t.arrayValue.values.slice():[]}class Wu{constructor(t,e){this.version=t,this.transformResults=e}}class Yu{constructor(t,e){this.updateTime=t,this.exists=e}static none(){return new Yu}static exists(t){return new Yu(void 0,t)}static updateTime(t){return new Yu(t)}get isNone(){return void 0===this.updateTime&&void 0===this.exists}isEqual(t){return this.exists===t.exists&&(this.updateTime?!!t.updateTime&&this.updateTime.isEqual(t.updateTime):!t.updateTime)}}function Xu(t,e){return void 0!==t.updateTime?e.isFoundDocument()&&e.version.isEqual(t.updateTime):void 0===t.exists||t.exists===e.isFoundDocument()}class Zu{}function th(t,e){if(!t.hasLocalMutations||e&&0===e.fields.length)return null;if(null===e)return t.isNoDocument()?new lh(t.key,Yu.none()):new ih(t.key,t.data,Yu.none());{const n=t.data,s=Au.empty();let r=new pl(_l.comparator);for(let t of e.fields)if(!r.has(t)){let e=n.field(t);null===e&&t.length>1&&(t=t.popLast(),e=n.field(t)),null===e?s.delete(t):s.set(t,e),r=r.add(t)}return new oh(t.key,s,new Dl(r.toArray()),Yu.none())}}function eh(t,e,n){t instanceof ih?function(t,e,n){const s=t.value.clone(),r=Bh(t.fieldTransforms,e,n.transformResults);s.setAll(r),e.convertToFoundDocument(n.version,s).setHasCommittedMutations()}(t,e,n):t instanceof oh?function(t,e,n){if(!Xu(t.precondition,e))return void e.convertToUnknownDocument(n.version);const s=Bh(t.fieldTransforms,e,n.transformResults),r=e.data;r.setAll(ah(t)),r.setAll(s),e.convertToFoundDocument(n.version,r).setHasCommittedMutations()}(t,e,n):function(t,e,n){e.convertToNoDocument(n.version).setHasCommittedMutations()}(0,e,n)}function nh(t,e,n,s){return t instanceof ih?function(t,e,n,s){if(!Xu(t.precondition,e))return n;const r=t.value.clone(),i=ch(t.fieldTransforms,s,e);return r.setAll(i),e.convertToFoundDocument(e.version,r).setHasLocalMutations(),null}(t,e,n,s):t instanceof oh?function(t,e,n,s){if(!Xu(t.precondition,e))return n;const r=ch(t.fieldTransforms,s,e),i=e.data;return i.setAll(ah(t)),i.setAll(r),e.convertToFoundDocument(e.version,i).setHasLocalMutations(),null===n?null:n.unionWith(t.fieldMask.fields).unionWith(t.fieldTransforms.map(t=>t.field))}(t,e,n,s):function(t,e,n){return Xu(t.precondition,e)?(e.convertToNoDocument(e.version).setHasLocalMutations(),null):n}(t,e,n)}function sh(t,e){let n=null;for(const s of t.fieldTransforms){const t=e.data.field(s.field),r=Pu(s.transform,t||null);null!=r&&(null===n&&(n=Au.empty()),n.set(s.field,r))}return n||null}function rh(t,e){return t.type===e.type&&!!t.key.isEqual(e.key)&&!!t.precondition.isEqual(e.precondition)&&!!function(t,e){return void 0===t&&void 0===e||!(!t||!e)&&ll(t,e,(t,e)=>function(t,e){return t.field.isEqual(e.field)&&function(t,e){return t instanceof Gu&&e instanceof Gu||t instanceof Uu&&e instanceof Uu?ll(t.elements,e.elements,uu):t instanceof $u&&e instanceof $u||t instanceof Ju&&e instanceof Ju||t instanceof qu&&e instanceof qu?uu(t.h,e.h):t instanceof Mu&&e instanceof Mu}(t.transform,e.transform)}(t,e))}(t.fieldTransforms,e.fieldTransforms)&&(0===t.type?t.value.isEqual(e.value):1!==t.type||t.data.isEqual(e.data)&&t.fieldMask.isEqual(e.fieldMask))}class ih extends Zu{constructor(t,e,n,s=[]){super(),this.key=t,this.value=e,this.precondition=n,this.fieldTransforms=s,this.type=0}getFieldMask(){return null}}class oh extends Zu{constructor(t,e,n,s,r=[]){super(),this.key=t,this.data=e,this.fieldMask=n,this.precondition=s,this.fieldTransforms=r,this.type=1}getFieldMask(){return this.fieldMask}}function ah(t){const e=new Map;return t.fieldMask.fields.forEach(n=>{if(!n.isEmpty()){const s=t.data.field(n);e.set(n,s)}}),e}function Bh(t,e,n){const s=new Map;el(t.length===n.length,32656,{T:n.length,P:t.length});for(let r=0;r<n.length;r++){const i=t[r],o=i.transform,a=e.data.field(i.field);s.set(i.field,Fu(o,a,n[r]))}return s}function ch(t,e,n){const s=new Map;for(const r of t){const t=r.transform,i=n.data.field(r.field);s.set(r.field,Lu(t,i,e))}return s}class lh extends Zu{constructor(t,e){super(),this.key=t,this.precondition=e,this.type=2,this.fieldTransforms=[]}getFieldMask(){return null}}class uh extends Zu{constructor(t,e){super(),this.key=t,this.precondition=e,this.type=3,this.fieldTransforms=[]}getFieldMask(){return null}}class hh{constructor(t,e){this.position=t,this.inclusive=e}}function dh(t,e,n){let s=0;for(let r=0;r<t.position.length;r++){const i=e[r],o=t.position[r];if(s=i.field.isKeyField()?Tl.comparator(Tl.fromName(o.referenceValue),n.key):du(o,n.data.field(i.field)),"desc"===i.dir&&(s*=-1),0!==s)break}return s}function ph(t,e){if(null===t)return null===e;if(null===e)return!1;if(t.inclusive!==e.inclusive||t.position.length!==e.position.length)return!1;for(let n=0;n<t.position.length;n++)if(!uu(t.position[n],e.position[n]))return!1;return!0}class fh{}class Ch extends fh{constructor(t,e,n){super(),this.field=t,this.op=e,this.value=n}static create(t,e,n){return t.isKeyField()?"in"===e||"not-in"===e?this.createKeyFieldInFilter(t,e,n):new Dh(t,e,n):"array-contains"===e?new Th(t,n):"in"===e?new Oh(t,n):"not-in"===e?new Ah(t,n):"array-contains-any"===e?new Sh(t,n):new Ch(t,e,n)}static createKeyFieldInFilter(t,e,n){return"in"===e?new bh(t,n):new vh(t,n)}matches(t){const e=t.data.field(this.field);return"!="===this.op?null!==e&&void 0===e.nullValue&&this.matchesComparison(du(e,this.value)):null!==e&&lu(this.value)===lu(e)&&this.matchesComparison(du(e,this.value))}matchesComparison(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 Zc(47266,{operator:this.op})}}isInequality(){return["<","<=",">",">=","!=","not-in"].indexOf(this.op)>=0}getFlattenedFilters(){return[this]}getFilters(){return[this]}}class gh extends fh{constructor(t,e){super(),this.filters=t,this.op=e,this.I=null}static create(t,e){return new gh(t,e)}matches(t){return mh(this)?void 0===this.filters.find(e=>!e.matches(t)):void 0!==this.filters.find(e=>e.matches(t))}getFlattenedFilters(){return null!==this.I||(this.I=this.filters.reduce((t,e)=>t.concat(e.getFlattenedFilters()),[])),this.I}getFilters(){return Object.assign([],this.filters)}}function mh(t){return"and"===t.op}function wh(t){return function(t){for(const e of t.filters)if(e instanceof gh)return!1;return!0}(t)&&mh(t)}function yh(t){if(t instanceof Ch)return t.field.canonicalString()+t.op.toString()+Cu(t.value);if(wh(t))return t.filters.map(t=>yh(t)).join(",");{const e=t.filters.map(t=>yh(t)).join(",");return`${t.op}(${e})`}}function Eh(t,e){return t instanceof Ch?function(t,e){return e instanceof Ch&&t.op===e.op&&t.field.isEqual(e.field)&&uu(t.value,e.value)}(t,e):t instanceof gh?function(t,e){return e instanceof gh&&t.op===e.op&&t.filters.length===e.filters.length&&t.filters.reduce((t,n,s)=>t&&Eh(n,e.filters[s]),!0)}(t,e):void Zc(19439)}function _h(t){return t instanceof Ch?function(t){return`${t.field.canonicalString()} ${t.op} ${Cu(t.value)}`}(t):t instanceof gh?function(t){return t.op.toString()+" {"+t.getFilters().map(_h).join(" ,")+"}"}(t):"Filter"}class Dh extends Ch{constructor(t,e,n){super(t,e,n),this.key=Tl.fromName(n.referenceValue)}matches(t){const e=Tl.comparator(t.key,this.key);return this.matchesComparison(e)}}class bh extends Ch{constructor(t,e){super(t,"in",e),this.keys=Ih("in",e)}matches(t){return this.keys.some(e=>e.isEqual(t.key))}}class vh extends Ch{constructor(t,e){super(t,"not-in",e),this.keys=Ih("not-in",e)}matches(t){return!this.keys.some(e=>e.isEqual(t.key))}}function Ih(t,e){return(e.arrayValue?.values||[]).map(t=>Tl.fromName(t.referenceValue))}class Th extends Ch{constructor(t,e){super(t,"array-contains",e)}matches(t){const e=t.data.field(this.field);return _u(e)&&hu(e.arrayValue,this.value)}}class Oh extends Ch{constructor(t,e){super(t,"in",e)}matches(t){const e=t.data.field(this.field);return null!==e&&hu(this.value.arrayValue,e)}}class Ah extends Ch{constructor(t,e){super(t,"not-in",e)}matches(t){if(hu(this.value.arrayValue,{nullValue:"NULL_VALUE"}))return!1;const e=t.data.field(this.field);return null!==e&&void 0===e.nullValue&&!hu(this.value.arrayValue,e)}}class Sh extends Ch{constructor(t,e){super(t,"array-contains-any",e)}matches(t){const e=t.data.field(this.field);return!(!_u(e)||!e.arrayValue.values)&&e.arrayValue.values.some(t=>hu(this.value.arrayValue,t))}}class Rh{constructor(t,e="asc"){this.field=t,this.dir=e}}function Nh(t,e){return t.dir===e.dir&&t.field.isEqual(e.field)}class xh{static fromTimestamp(t){return new xh(t)}static min(){return new xh(new Fl(0,0))}static max(){return new xh(new Fl(253402300799,999999999))}constructor(t){this.timestamp=t}compareTo(t){return this.timestamp._compareTo(t.timestamp)}isEqual(t){return this.timestamp.isEqual(t.timestamp)}toMicroseconds(){return 1e6*this.timestamp.seconds+this.timestamp.nanoseconds/1e3}toString(){return"SnapshotVersion("+this.timestamp.toString()+")"}toTimestamp(){return this.timestamp}}class kh{constructor(t,e,n,s,r,i,o){this.key=t,this.documentType=e,this.version=n,this.readTime=s,this.createTime=r,this.data=i,this.documentState=o}static newInvalidDocument(t){return new kh(t,0,xh.min(),xh.min(),xh.min(),Au.empty(),0)}static newFoundDocument(t,e,n,s){return new kh(t,1,e,xh.min(),n,s,0)}static newNoDocument(t,e){return new kh(t,2,e,xh.min(),xh.min(),Au.empty(),0)}static newUnknownDocument(t,e){return new kh(t,3,e,xh.min(),xh.min(),Au.empty(),2)}convertToFoundDocument(t,e){return!this.createTime.isEqual(xh.min())||2!==this.documentType&&0!==this.documentType||(this.createTime=t),this.version=t,this.documentType=1,this.data=e,this.documentState=0,this}convertToNoDocument(t){return this.version=t,this.documentType=2,this.data=Au.empty(),this.documentState=0,this}convertToUnknownDocument(t){return this.version=t,this.documentType=3,this.data=Au.empty(),this.documentState=2,this}setHasCommittedMutations(){return this.documentState=2,this}setHasLocalMutations(){return this.documentState=1,this.version=xh.min(),this}setReadTime(t){return this.readTime=t,this}get hasLocalMutations(){return 1===this.documentState}get hasCommittedMutations(){return 2===this.documentState}get hasPendingWrites(){return this.hasLocalMutations||this.hasCommittedMutations}isValidDocument(){return 0!==this.documentType}isFoundDocument(){return 1===this.documentType}isNoDocument(){return 2===this.documentType}isUnknownDocument(){return 3===this.documentType}isEqual(t){return t instanceof kh&&this.key.isEqual(t.key)&&this.version.isEqual(t.version)&&this.documentType===t.documentType&&this.documentState===t.documentState&&this.data.isEqual(t.data)}mutableCopy(){return new kh(this.key,this.documentType,this.version,this.readTime,this.createTime,this.data.clone(),this.documentState)}toString(){return`Document(${this.key}, ${this.version}, ${JSON.stringify(this.data.value)}, {createTime: ${this.createTime}}), {documentType: ${this.documentType}}), {documentState: ${this.documentState}})`}}function Lh(t){return new Fh(t.readTime,t.key,-1)}class Fh{constructor(t,e,n){this.readTime=t,this.documentKey=e,this.largestBatchId=n}static min(){return new Fh(xh.min(),Tl.empty(),-1)}static max(){return new Fh(xh.max(),Tl.empty(),-1)}}function Ph(t,e){let n=t.readTime.compareTo(e.readTime);return 0!==n?n:(n=Tl.comparator(t.documentKey,e.documentKey),0!==n?n:il(t.largestBatchId,e.largestBatchId))}class Mh{constructor(t,e=null,n=[],s=[],r=null,i=null,o=null){this.path=t,this.collectionGroup=e,this.orderBy=n,this.filters=s,this.limit=r,this.startAt=i,this.endAt=o,this.R=null}}function Gh(t,e=null,n=[],s=[],r=null,i=null,o=null){return new Mh(t,e,n,s,r,i,o)}function Hh(t){const e=nl(t);if(null===e.R){let t=e.path.canonicalString();null!==e.collectionGroup&&(t+="|cg:"+e.collectionGroup),t+="|f:",t+=e.filters.map(t=>yh(t)).join(","),t+="|ob:",t+=e.orderBy.map(t=>function(t){return t.field.canonicalString()+t.dir}(t)).join(","),tu(e.limit)||(t+="|l:",t+=e.limit),e.startAt&&(t+="|lb:",t+=e.startAt.inclusive?"b:":"a:",t+=e.startAt.position.map(t=>Cu(t)).join(",")),e.endAt&&(t+="|ub:",t+=e.endAt.inclusive?"a:":"b:",t+=e.endAt.position.map(t=>Cu(t)).join(",")),e.R=t}return e.R}function Uh(t,e){if(t.limit!==e.limit)return!1;if(t.orderBy.length!==e.orderBy.length)return!1;for(let n=0;n<t.orderBy.length;n++)if(!Nh(t.orderBy[n],e.orderBy[n]))return!1;if(t.filters.length!==e.filters.length)return!1;for(let n=0;n<t.filters.length;n++)if(!Eh(t.filters[n],e.filters[n]))return!1;return t.collectionGroup===e.collectionGroup&&!!t.path.isEqual(e.path)&&!!ph(t.startAt,e.startAt)&&ph(t.endAt,e.endAt)}class Vh{constructor(t,e=null,n=[],s=[],r=null,i="F",o=null,a=null){this.path=t,this.collectionGroup=e,this.explicitOrderBy=n,this.filters=s,this.limit=r,this.limitType=i,this.startAt=o,this.endAt=a,this.A=null,this.V=null,this.m=null,this.startAt,this.endAt}}function jh(t){return 0===t.filters.length&&null===t.limit&&null==t.startAt&&null==t.endAt&&(0===t.explicitOrderBy.length||1===t.explicitOrderBy.length&&t.explicitOrderBy[0].field.isKeyField())}function $h(t){const e=nl(t);if(null===e.A){e.A=[];const t=new Set;for(const n of e.explicitOrderBy)e.A.push(n),t.add(n.field.canonicalString());const n=e.explicitOrderBy.length>0?e.explicitOrderBy[e.explicitOrderBy.length-1].dir:"asc",s=function(t){let e=new pl(_l.comparator);return t.filters.forEach(t=>{t.getFlattenedFilters().forEach(t=>{t.isInequality()&&(e=e.add(t.field))})}),e}(e);s.forEach(s=>{t.has(s.canonicalString())||s.isKeyField()||e.A.push(new Rh(s,n))}),t.has(_l.keyField().canonicalString())||e.A.push(new Rh(_l.keyField(),n))}return e.A}function Jh(t){const e=nl(t);return e.V||(e.V=function(t,e){if("F"===t.limitType)return Gh(t.path,t.collectionGroup,e,t.filters,t.limit,t.startAt,t.endAt);{e=e.map(t=>{const e="desc"===t.dir?"asc":"desc";return new Rh(t.field,e)});const n=t.endAt?new hh(t.endAt.position,t.endAt.inclusive):null,s=t.startAt?new hh(t.startAt.position,t.startAt.inclusive):null;return Gh(t.path,t.collectionGroup,e,t.filters,t.limit,n,s)}}(e,$h(t))),e.V}function qh(t,e,n){return new Vh(t.path,t.collectionGroup,t.explicitOrderBy.slice(),t.filters.slice(),e,n,t.startAt,t.endAt)}function zh(t){return`Query(target=${function(t){let e=t.path.canonicalString();return null!==t.collectionGroup&&(e+=" collectionGroup="+t.collectionGroup),t.filters.length>0&&(e+=`, filters: [${t.filters.map(t=>_h(t)).join(", ")}]`),tu(t.limit)||(e+=", limit: "+t.limit),t.orderBy.length>0&&(e+=`, orderBy: [${t.orderBy.map(t=>function(t){return`${t.field.canonicalString()} (${t.dir})`}(t)).join(", ")}]`),t.startAt&&(e+=", startAt: ",e+=t.startAt.inclusive?"b:":"a:",e+=t.startAt.position.map(t=>Cu(t)).join(",")),t.endAt&&(e+=", endAt: ",e+=t.endAt.inclusive?"a:":"b:",e+=t.endAt.position.map(t=>Cu(t)).join(",")),`Target(${e})`}(Jh(t))}; limitType=${t.limitType})`}function Kh(t,e){return e.isFoundDocument()&&function(t,e){const n=e.key.path;return null!==t.collectionGroup?e.key.hasCollectionId(t.collectionGroup)&&t.path.isPrefixOf(n):Tl.isDocumentKey(t.path)?t.path.isEqual(n):t.path.isImmediateParentOf(n)}(t,e)&&function(t,e){for(const n of $h(t))if(!n.field.isKeyField()&&null===e.data.field(n.field))return!1;return!0}(t,e)&&function(t,e){for(const n of t.filters)if(!n.matches(e))return!1;return!0}(t,e)&&function(t,e){return!(t.startAt&&!function(t,e,n){const s=dh(t,e,n);return t.inclusive?s<=0:s<0}(t.startAt,$h(t),e))&&!(t.endAt&&!function(t,e,n){const s=dh(t,e,n);return t.inclusive?s>=0:s>0}(t.endAt,$h(t),e))}(t,e)}function Qh(t){return(e,n)=>{let s=!1;for(const r of $h(t)){const t=Wh(r,e,n);if(0!==t)return t;s=s||r.field.isKeyField()}return 0}}function Wh(t,e,n){const s=t.field.isKeyField()?Tl.comparator(e.key,n.key):function(t,e,n){const s=e.data.field(t),r=n.data.field(t);return null!==s&&null!==r?du(s,r):Zc(42886)}(t.field,e,n);switch(t.dir){case"asc":return s;case"desc":return-1*s;default:return Zc(19790,{direction:t.dir})}}var Yh,Xh;function Zh(t){if(void 0===t)return Wc("GRPC error has no .code"),Cl.UNKNOWN;switch(t){case Yh.OK:return Cl.OK;case Yh.CANCELLED:return Cl.CANCELLED;case Yh.UNKNOWN:return Cl.UNKNOWN;case Yh.DEADLINE_EXCEEDED:return Cl.DEADLINE_EXCEEDED;case Yh.RESOURCE_EXHAUSTED:return Cl.RESOURCE_EXHAUSTED;case Yh.INTERNAL:return Cl.INTERNAL;case Yh.UNAVAILABLE:return Cl.UNAVAILABLE;case Yh.UNAUTHENTICATED:return Cl.UNAUTHENTICATED;case Yh.INVALID_ARGUMENT:return Cl.INVALID_ARGUMENT;case Yh.NOT_FOUND:return Cl.NOT_FOUND;case Yh.ALREADY_EXISTS:return Cl.ALREADY_EXISTS;case Yh.PERMISSION_DENIED:return Cl.PERMISSION_DENIED;case Yh.FAILED_PRECONDITION:return Cl.FAILED_PRECONDITION;case Yh.ABORTED:return Cl.ABORTED;case Yh.OUT_OF_RANGE:return Cl.OUT_OF_RANGE;case Yh.UNIMPLEMENTED:return Cl.UNIMPLEMENTED;case Yh.DATA_LOSS:return Cl.DATA_LOSS;default:return Zc(39323,{code:t})}}(Xh=Yh||(Yh={}))[Xh.OK=0]="OK",Xh[Xh.CANCELLED=1]="CANCELLED",Xh[Xh.UNKNOWN=2]="UNKNOWN",Xh[Xh.INVALID_ARGUMENT=3]="INVALID_ARGUMENT",Xh[Xh.DEADLINE_EXCEEDED=4]="DEADLINE_EXCEEDED",Xh[Xh.NOT_FOUND=5]="NOT_FOUND",Xh[Xh.ALREADY_EXISTS=6]="ALREADY_EXISTS",Xh[Xh.PERMISSION_DENIED=7]="PERMISSION_DENIED",Xh[Xh.UNAUTHENTICATED=16]="UNAUTHENTICATED",Xh[Xh.RESOURCE_EXHAUSTED=8]="RESOURCE_EXHAUSTED",Xh[Xh.FAILED_PRECONDITION=9]="FAILED_PRECONDITION",Xh[Xh.ABORTED=10]="ABORTED",Xh[Xh.OUT_OF_RANGE=11]="OUT_OF_RANGE",Xh[Xh.UNIMPLEMENTED=12]="UNIMPLEMENTED",Xh[Xh.INTERNAL=13]="INTERNAL",Xh[Xh.UNAVAILABLE=14]="UNAVAILABLE",Xh[Xh.DATA_LOSS=15]="DATA_LOSS";class td{constructor(t,e){this.mapKeyFn=t,this.equalsFn=e,this.inner={},this.innerSize=0}get(t){const e=this.mapKeyFn(t),n=this.inner[e];if(void 0!==n)for(const[e,s]of n)if(this.equalsFn(e,t))return s}has(t){return void 0!==this.get(t)}set(t,e){const n=this.mapKeyFn(t),s=this.inner[n];if(void 0===s)return this.inner[n]=[[t,e]],void this.innerSize++;for(let n=0;n<s.length;n++)if(this.equalsFn(s[n][0],t))return void(s[n]=[t,e]);s.push([t,e]),this.innerSize++}delete(t){const e=this.mapKeyFn(t),n=this.inner[e];if(void 0===n)return!1;for(let s=0;s<n.length;s++)if(this.equalsFn(n[s][0],t))return 1===n.length?delete this.inner[e]:n.splice(s,1),this.innerSize--,!0;return!1}forEach(t){vl(this.inner,(e,n)=>{for(const[e,s]of n)t(e,s)})}isEmpty(){return Il(this.inner)}size(){return this.innerSize}}const ed=new ul(Tl.comparator);function nd(){return ed}const sd=new ul(Tl.comparator);function rd(...t){let e=sd;for(const n of t)e=e.insert(n.key,n);return e}function id(t){let e=sd;return t.forEach((t,n)=>e=e.insert(t,n.overlayedDocument)),e}function od(){return Bd()}function ad(){return Bd()}function Bd(){return new td(t=>t.toString(),(t,e)=>t.isEqual(e))}const cd=new ul(Tl.comparator),ld=new pl(Tl.comparator);function ud(...t){let e=ld;for(const n of t)e=e.add(n);return e}const hd=new pl(il);new Wa([4294967295,4294967295],0);class dd{constructor(t,e){this.databaseId=t,this.useProto3Json=e}}function pd(t,e){return t.useProto3Json?`${new Date(1e3*e.seconds).toISOString().replace(/\.\d*/,"").replace("Z","")}.${("000000000"+e.nanoseconds).slice(-9)}Z`:{seconds:""+e.seconds,nanos:e.nanoseconds}}function fd(t){const e=Hl(t);return new Fl(e.seconds,e.nanos)}function Cd(t,e){return t.useProto3Json?e.toBase64():e.toUint8Array()}function gd(t,e){return pd(t,e.toTimestamp())}function md(t){return el(!!t,49232),xh.fromTimestamp(fd(t))}function wd(t,e){return yd(t,e).canonicalString()}function yd(t,e){const n=function(t){return new yl(["projects",t.projectId,"databases",t.database])}(t).child("documents");return void 0===e?n:n.child(e)}function Ed(t,e){return wd(t.databaseId,e.path)}function _d(t){const e=function(t){const e=yl.fromString(t);return el(function(t){return t.length>=4&&"projects"===t.get(0)&&"databases"===t.get(2)}(e),10190,{key:e.toString()}),e}(t);return 4===e.length?yl.emptyPath():function(t){return el(t.length>4&&"documents"===t.get(4),29091,{key:t.toString()}),t.popFirst(5)}(e)}function Dd(t,e,n){return{name:Ed(t,e),fields:n.value.mapValue.fields}}function bd(t){let e=_d(t.parent);const n=t.structuredQuery,s=n.from?n.from.length:0;let r=null;if(s>0){el(1===s,65062);const t=n.from[0];t.allDescendants?r=t.collectionId:e=e.child(t.collectionId)}let i=[];n.where&&(i=function(t){const e=vd(t);return e instanceof gh&&wh(e)?e.getFilters():[e]}(n.where));let o=[];n.orderBy&&(o=function(t){return t.map(t=>function(t){return new Rh(Id(t.field),function(t){switch(t){case"ASCENDING":return"asc";case"DESCENDING":return"desc";default:return}}(t.direction))}(t))}(n.orderBy));let a=null;n.limit&&(a=function(t){let e;return e="object"==typeof t?t.value:t,tu(e)?null:e}(n.limit));let B=null;n.startAt&&(B=function(t){const e=!!t.before,n=t.values||[];return new hh(n,e)}(n.startAt));let c=null;return n.endAt&&(c=function(t){const e=!t.before,n=t.values||[];return new hh(n,e)}(n.endAt)),function(t,e,n,s,r,i,o,a){return new Vh(t,e,n,s,r,i,o,a)}(e,r,o,i,a,"F",B,c)}function vd(t){return void 0!==t.unaryFilter?function(t){switch(t.unaryFilter.op){case"IS_NAN":const e=Id(t.unaryFilter.field);return Ch.create(e,"==",{doubleValue:NaN});case"IS_NULL":const n=Id(t.unaryFilter.field);return Ch.create(n,"==",{nullValue:"NULL_VALUE"});case"IS_NOT_NAN":const s=Id(t.unaryFilter.field);return Ch.create(s,"!=",{doubleValue:NaN});case"IS_NOT_NULL":const r=Id(t.unaryFilter.field);return Ch.create(r,"!=",{nullValue:"NULL_VALUE"});case"OPERATOR_UNSPECIFIED":return Zc(61313);default:return Zc(60726)}}(t):void 0!==t.fieldFilter?function(t){return Ch.create(Id(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":return Zc(58110);default:return Zc(50506)}}(t.fieldFilter.op),t.fieldFilter.value)}(t):void 0!==t.compositeFilter?function(t){return gh.create(t.compositeFilter.filters.map(t=>vd(t)),function(t){switch(t){case"AND":return"and";case"OR":return"or";default:return Zc(1026)}}(t.compositeFilter.op))}(t):Zc(30097,{filter:t})}function Id(t){return _l.fromServerFormat(t.fieldPath)}function Td(t){const e=[];return t.fields.forEach(t=>e.push(t.canonicalString())),{fieldPaths:e}}function Od(t){return!!t&&"function"==typeof t._toProto&&"ProtoValue"===t._protoValueType}function Ad(t,e){const n={fields:{}};return e.forEach((e,s)=>{if("string"!=typeof s)throw new Error(`Cannot encode map with non-string key: ${s}`);n.fields[s]=e._toProto(t)}),{mapValue:n}}function Sd(t){return{stringValue:t}}function Rd(t){return new dd(t,!0)}class Nd{constructor(t){this._byteString=t}static fromBase64String(t){try{return new Nd(Ml.fromBase64String(t))}catch(t){throw new gl(Cl.INVALID_ARGUMENT,"Failed to construct data from Base64 string: "+t)}}static fromUint8Array(t){return new Nd(Ml.fromUint8Array(t))}toBase64(){return this._byteString.toBase64()}toUint8Array(){return this._byteString.toUint8Array()}toString(){return"Bytes(base64: "+this.toBase64()+")"}isEqual(t){return this._byteString.isEqual(t._byteString)}toJSON(){return{type:Nd._jsonSchemaVersion,bytes:this.toBase64()}}static fromJSON(t){if(xl(t,Nd._jsonSchema))return Nd.fromBase64String(t.bytes)}}Nd._jsonSchemaVersion="firestore/bytes/1.0",Nd._jsonSchema={type:Nl("string",Nd._jsonSchemaVersion),bytes:Nl("string")};class xd{constructor(...t){for(let e=0;e<t.length;++e)if(0===t[e].length)throw new gl(Cl.INVALID_ARGUMENT,"Invalid field name at argument $(i + 1). Field names must not be empty.");this._internalPath=new _l(t)}isEqual(t){return this._internalPath.isEqual(t._internalPath)}}class kd{constructor(t){this._methodName=t}}class Ld{constructor(t,e){if(!isFinite(t)||t<-90||t>90)throw new gl(Cl.INVALID_ARGUMENT,"Latitude must be a number between -90 and 90, but was: "+t);if(!isFinite(e)||e<-180||e>180)throw new gl(Cl.INVALID_ARGUMENT,"Longitude must be a number between -180 and 180, but was: "+e);this._lat=t,this._long=e}get latitude(){return this._lat}get longitude(){return this._long}isEqual(t){return this._lat===t._lat&&this._long===t._long}_compareTo(t){return il(this._lat,t._lat)||il(this._long,t._long)}toJSON(){return{latitude:this._lat,longitude:this._long,type:Ld._jsonSchemaVersion}}static fromJSON(t){if(xl(t,Ld._jsonSchema))return new Ld(t.latitude,t.longitude)}}Ld._jsonSchemaVersion="firestore/geoPoint/1.0",Ld._jsonSchema={type:Nl("string",Ld._jsonSchemaVersion),latitude:Nl("number"),longitude:Nl("number")};class Fd{constructor(t){this.uid=t}isAuthenticated(){return null!=this.uid}toKey(){return this.isAuthenticated()?"uid:"+this.uid:"anonymous-user"}isEqual(t){return t.uid===this.uid}}Fd.UNAUTHENTICATED=new Fd(null),Fd.GOOGLE_CREDENTIALS=new Fd("google-credentials-uid"),Fd.FIRST_PARTY=new Fd("first-party-uid"),Fd.MOCK_USER=new Fd("mock-user");class Pd{constructor(){this.promise=new Promise((t,e)=>{this.resolve=t,this.reject=e})}}class Md{constructor(t,e){this.user=e,this.type="OAuth",this.headers=new Map,this.headers.set("Authorization",`Bearer ${t}`)}}class Gd{getToken(){return Promise.resolve(null)}invalidateToken(){}start(t,e){t.enqueueRetryable(()=>e(Fd.UNAUTHENTICATED))}shutdown(){}}class Hd{constructor(t){this.token=t,this.changeListener=null}getToken(){return Promise.resolve(this.token)}invalidateToken(){}start(t,e){this.changeListener=e,t.enqueueRetryable(()=>e(this.token.user))}shutdown(){this.changeListener=null}}class Ud{constructor(t){this.De=t,this.currentUser=Fd.UNAUTHENTICATED,this.xe=0,this.forceRefresh=!1,this.auth=null}start(t,e){el(void 0===this.Ce,42304);let n=this.xe;const s=t=>this.xe!==n?(n=this.xe,e(t)):Promise.resolve();let r=new Pd;this.Ce=()=>{this.xe++,this.currentUser=this.Fe(),r.resolve(),r=new Pd,t.enqueueRetryable(()=>s(this.currentUser))};const i=()=>{const e=r;t.enqueueRetryable(async()=>{await e.promise,await s(this.currentUser)})},o=t=>{Qc("FirebaseAuthCredentialsProvider","Auth detected"),this.auth=t,this.Ce&&(this.auth.addAuthTokenListener(this.Ce),i())};this.De.onInit(t=>o(t)),setTimeout(()=>{if(!this.auth){const t=this.De.getImmediate({optional:!0});t?o(t):(Qc("FirebaseAuthCredentialsProvider","Auth not yet detected"),r.resolve(),r=new Pd)}},0),i()}getToken(){const t=this.xe,e=this.forceRefresh;return this.forceRefresh=!1,this.auth?this.auth.getToken(e).then(e=>this.xe!==t?(Qc("FirebaseAuthCredentialsProvider","getToken aborted due to token change."),this.getToken()):e?(el("string"==typeof e.accessToken,31837,{Oe:e}),new Md(e.accessToken,this.currentUser)):null):Promise.resolve(null)}invalidateToken(){this.forceRefresh=!0}shutdown(){this.auth&&this.Ce&&this.auth.removeAuthTokenListener(this.Ce),this.Ce=void 0}Fe(){const t=this.auth&&this.auth.getUid();return el(null===t||"string"==typeof t,2055,{Me:t}),new Fd(t)}}class Vd{constructor(t,e,n){this.Ne=t,this.Le=e,this.Be=n,this.type="FirstParty",this.user=Fd.FIRST_PARTY,this.Ue=new Map}ke(){return this.Be?this.Be():null}get headers(){this.Ue.set("X-Goog-AuthUser",this.Ne);const t=this.ke();return t&&this.Ue.set("Authorization",t),this.Le&&this.Ue.set("X-Goog-Iam-Authorization-Token",this.Le),this.Ue}}class jd{constructor(t,e,n){this.Ne=t,this.Le=e,this.Be=n}getToken(){return Promise.resolve(new Vd(this.Ne,this.Le,this.Be))}start(t,e){t.enqueueRetryable(()=>e(Fd.FIRST_PARTY))}shutdown(){}invalidateToken(){}}class $d{constructor(t){this.value=t,this.type="AppCheck",this.headers=new Map,t&&t.length>0&&this.headers.set("x-firebase-appcheck",this.value)}}class Jd{constructor(t,e){this.qe=e,this.forceRefresh=!1,this.appCheck=null,this.$e=null,this.Ke=null,hr(t)&&t.settings.appCheckToken&&(this.Ke=t.settings.appCheckToken)}start(t,e){el(void 0===this.Ce,3512);const n=t=>{null!=t.error&&Qc("FirebaseAppCheckTokenProvider",`Error getting App Check token; using placeholder token instead. Error: ${t.error.message}`);const n=t.token!==this.$e;return this.$e=t.token,Qc("FirebaseAppCheckTokenProvider",`Received ${n?"new":"existing"} token.`),n?e(t.token):Promise.resolve()};this.Ce=e=>{t.enqueueRetryable(()=>n(e))};const s=t=>{Qc("FirebaseAppCheckTokenProvider","AppCheck detected"),this.appCheck=t,this.Ce&&this.appCheck.addTokenListener(this.Ce)};this.qe.onInit(t=>s(t)),setTimeout(()=>{if(!this.appCheck){const t=this.qe.getImmediate({optional:!0});t?s(t):Qc("FirebaseAppCheckTokenProvider","AppCheck not yet detected")}},0)}getToken(){if(this.Ke)return Promise.resolve(new $d(this.Ke));const t=this.forceRefresh;return this.forceRefresh=!1,this.appCheck?this.appCheck.getToken(t).then(t=>t?(el("string"==typeof t.token,44558,{tokenResult:t}),this.$e=t.token,new $d(t.token)):null):Promise.resolve(null)}invalidateToken(){this.forceRefresh=!0}shutdown(){this.appCheck&&this.Ce&&this.appCheck.removeTokenListener(this.Ce),this.Ce=void 0}}function qd(t){const e={};return void 0!==t.timeoutSeconds&&(e.timeoutSeconds=t.timeoutSeconds),e}class zd{Qe(t){}shutdown(){}}const Kd="ConnectivityMonitor";class Qd{constructor(){this.We=()=>this.Ge(),this.ze=()=>this.je(),this.He=[],this.Je()}Qe(t){this.He.push(t)}shutdown(){window.removeEventListener("online",this.We),window.removeEventListener("offline",this.ze)}Je(){window.addEventListener("online",this.We),window.addEventListener("offline",this.ze)}Ge(){Qc(Kd,"Network connectivity changed: AVAILABLE");for(const t of this.He)t(0)}je(){Qc(Kd,"Network connectivity changed: UNAVAILABLE");for(const t of this.He)t(1)}static Ye(){return"undefined"!=typeof window&&void 0!==window.addEventListener&&void 0!==window.removeEventListener}}let Wd=null;function Yd(){return null===Wd?Wd=268435456+Math.round(2147483648*Math.random()):Wd++,"0x"+Wd.toString(16)}const Xd="RestConnection",Zd={BatchGetDocuments:"batchGet",Commit:"commit",RunQuery:"runQuery",RunAggregationQuery:"runAggregationQuery",ExecutePipeline:"executePipeline"};class tp{get Ze(){return!1}constructor(t){this.databaseInfo=t,this.databaseId=t.databaseId;const e=t.ssl?"https":"http",n=encodeURIComponent(this.databaseId.projectId),s=encodeURIComponent(this.databaseId.database);this.Xe=e+"://"+t.host,this.et=`projects/${n}/databases/${s}`,this.tt=this.databaseId.database===Yl?`project_id=${n}`:`project_id=${n}&database_id=${s}`}nt(t,e,n,s,r){const i=Yd(),o=this.rt(t,e.toUriEncodedString());Qc(Xd,`Sending RPC '${t}' ${i}:`,o,n);const a={"google-cloud-resource-prefix":this.et,"x-goog-request-params":this.tt};this.it(a,s,r);const{host:B}=new URL(o),c=Zn(B);return this.st(t,o,a,n,c).then(e=>(Qc(Xd,`Received RPC '${t}' ${i}: `,e),e),e=>{throw Yc(Xd,`RPC '${t}' ${i} failed with error: `,e,"url: ",o,"request:",n),e})}_t(t,e,n,s,r,i){return this.nt(t,e,n,s,r)}it(t,e,n){if(t["X-Goog-Api-Client"]="gl-js/ fire/"+qc,t["Content-Type"]="text/plain",this.databaseInfo.appId&&(t["X-Firebase-GMPID"]=this.databaseInfo.appId),e&&e.headers.forEach((e,n)=>t[n]=e),n&&n.headers.forEach((e,n)=>t[n]=e),this.databaseInfo._customHeaders)for(const e of Object.keys(this.databaseInfo._customHeaders))t[e]=this.databaseInfo._customHeaders[e]}rt(t,e){const n=Zd[t];let s=`${this.Xe}/v1/${e}:${n}`;return this.databaseInfo.apiKey&&(s=`${s}?key=${encodeURIComponent(this.databaseInfo.apiKey)}`),s}terminate(){}}class ep{constructor(t){this.ot=t.ot,this.ut=t.ut}ct(t){this.lt=t}Et(t){this.ht=t}Tt(t){this.Pt=t}onMessage(t){this.It=t}close(){this.ut()}send(t){this.ot(t)}Rt(){this.lt()}At(){this.ht()}Vt(t){this.Pt(t)}dt(t){this.It(t)}}const np="WebChannelConnection",sp=(t,e,n)=>{t.listen(e,t=>{try{n(t)}catch(t){setTimeout(()=>{throw t},0)}})};class rp extends tp{constructor(t){super(t),this.ft=[],this.forceLongPolling=t.forceLongPolling,this.autoDetectLongPolling=t.autoDetectLongPolling,this.useFetchStreams=t.useFetchStreams,this.longPollingOptions=t.longPollingOptions}static gt(){if(!rp.yt){const t=rB();sp(t,sB.STAT_EVENT,t=>{t.stat===nB.PROXY?Qc(np,"STAT_EVENT: detected buffering proxy"):t.stat===nB.NOPROXY&&Qc(np,"STAT_EVENT: detected no buffering proxy")}),rp.yt=!0}}st(t,e,n,s,r){const i=Yd();return new Promise((r,o)=>{const a=new Xa;a.setWithCredentials(!0),a.listenOnce(tB.COMPLETE,()=>{try{switch(a.getLastErrorCode()){case eB.NO_ERROR:const e=a.getResponseJson();Qc(np,`XHR for RPC '${t}' ${i} received:`,JSON.stringify(e)),r(e);break;case eB.TIMEOUT:Qc(np,`RPC '${t}' ${i} timed out`),o(new gl(Cl.DEADLINE_EXCEEDED,"Request time out"));break;case eB.HTTP_ERROR:const n=a.getStatus();if(Qc(np,`RPC '${t}' ${i} failed with status:`,n,"response text:",a.getResponseText()),n>0){let t=a.getResponseJson();Array.isArray(t)&&(t=t[0]);const e=t?.error;if(e&&e.status&&e.message){const t=function(t){const e=t.toLowerCase().replace(/_/g,"-");return Object.values(Cl).indexOf(e)>=0?e:Cl.UNKNOWN}(e.status);o(new gl(t,e.message))}else o(new gl(Cl.UNKNOWN,"Server responded with status "+a.getStatus()))}else o(new gl(Cl.UNAVAILABLE,"Connection failed."));break;default:Zc(9055,{wt:t,streamId:i,bt:a.getLastErrorCode(),St:a.getLastError()})}}finally{Qc(np,`RPC '${t}' ${i} completed.`)}});const B=JSON.stringify(s);Qc(np,`RPC '${t}' ${i} sending request:`,s),a.send(e,"POST",B,n,15)})}vt(t,e,n){const s=Yd(),r=[this.Xe,"/","google.firestore.v1.Firestore","/",t,"/channel"],i=this.createWebChannelTransport(),o={httpSessionIdParam:"gsessionid",initMessageHeaders:{},messageUrlParams:{database:`projects/${this.databaseId.projectId}/databases/${this.databaseId.database}`},sendRawJson:!0,supportsCrossDomainXhr:!0,internalChannelParams:{forwardChannelRequestTimeoutMs:6e5},forceLongPolling:this.forceLongPolling,detectBufferingProxy:this.autoDetectLongPolling},a=this.longPollingOptions.timeoutSeconds;void 0!==a&&(o.longPollingTimeout=Math.round(1e3*a)),this.useFetchStreams&&(o.useFetchStreams=!0),this.it(o.initMessageHeaders,e,n),o.encodeInitMessageHeaders=!0;const B=r.join("");Qc(np,`Creating RPC '${t}' stream ${s}: ${B}`,o);const c=i.createWebChannel(B,o);this.Dt(c);let l=!1,u=!1;const h=new ep({ot:e=>{u?Qc(np,`Not sending because RPC '${t}' stream ${s} is closed:`,e):(l||(Qc(np,`Opening RPC '${t}' stream ${s} transport.`),c.open(),l=!0),Qc(np,`RPC '${t}' stream ${s} sending:`,e),c.send(e))},ut:()=>c.close()});return sp(c,Za.EventType.OPEN,()=>{u||(Qc(np,`RPC '${t}' stream ${s} transport opened.`),h.Rt())}),sp(c,Za.EventType.CLOSE,()=>{u||(u=!0,Qc(np,`RPC '${t}' stream ${s} transport closed`),h.Vt(),this.xt(c))}),sp(c,Za.EventType.ERROR,e=>{u||(u=!0,Yc(np,`RPC '${t}' stream ${s} transport errored. Name:`,e.name,"Message:",e.message),h.Vt(new gl(Cl.UNAVAILABLE,"The operation could not be completed")))}),sp(c,Za.EventType.MESSAGE,e=>{if(!u){const n=e.data[0];el(!!n,16349);const r=n,i=r?.error||r[0]?.error;if(i){Qc(np,`RPC '${t}' stream ${s} received error:`,i);const e=i.status;let n=function(t){const e=Yh[t];if(void 0!==e)return Zh(e)}(e),r=i.message;"NOT_FOUND"===e&&r.includes("database")&&r.includes("does not exist")&&r.includes(this.databaseId.database)&&Yc(`Database '${this.databaseId.database}' not found. Please check your project configuration.`),void 0===n&&(n=Cl.INTERNAL,r="Unknown error status: "+e+" with message "+i.message),u=!0,h.Vt(new gl(n,r)),c.close()}else Qc(np,`RPC '${t}' stream ${s} received:`,n),h.dt(n)}}),rp.gt(),setTimeout(()=>{h.At()},0),h}terminate(){this.ft.forEach(t=>t.close()),this.ft=[]}Dt(t){this.ft.push(t)}xt(t){this.ft=this.ft.filter(e=>e===t)}it(t,e,n){super.it(t,e,n),this.databaseInfo.apiKey&&(t["x-goog-api-key"]=this.databaseInfo.apiKey)}createWebChannelTransport(){return iB()}}rp.yt=!1;class ip{constructor(t,e,n=1e3,s=1.5,r=6e4){this.Ct=t,this.timerId=e,this.Ft=n,this.Ot=s,this.Mt=r,this.Nt=0,this.Lt=null,this.Bt=Date.now(),this.reset()}reset(){this.Nt=0}Ut(){this.Nt=this.Mt}kt(t){this.cancel();const e=Math.floor(this.Nt+this.qt()),n=Math.max(0,Date.now()-this.Bt),s=Math.max(0,e-n);s>0&&Qc("ExponentialBackoff",`Backing off for ${s} ms (base delay: ${this.Nt} ms, delay with jitter: ${e} ms, last attempt: ${n} ms ago)`),this.Lt=this.Ct.enqueueAfterDelay(this.timerId,s,()=>(this.Bt=Date.now(),t())),this.Nt*=this.Ot,this.Nt<this.Ft&&(this.Nt=this.Ft),this.Nt>this.Mt&&(this.Nt=this.Mt)}$t(){null!==this.Lt&&(this.Lt.skipDelay(),this.Lt=null)}cancel(){null!==this.Lt&&(this.Lt.cancel(),this.Lt=null)}qt(){return(Math.random()-.5)*this.Nt}}const op="PersistentStream";class ap{constructor(t,e,n,s,r,i,o,a){this.Ct=t,this.Kt=n,this.Qt=s,this.connection=r,this.authCredentialsProvider=i,this.appCheckCredentialsProvider=o,this.listener=a,this.state=0,this.Wt=0,this.Gt=null,this.zt=null,this.stream=null,this.jt=0,this.Ht=new ip(t,e)}Jt(){return 1===this.state||5===this.state||this.Yt()}Yt(){return 2===this.state||3===this.state}start(){this.jt=0,4!==this.state?this.auth():this.Zt()}async stop(){this.Jt()&&await this.close(0)}Xt(){this.state=0,this.Ht.reset()}en(){this.Yt()&&null===this.Gt&&(this.Gt=this.Ct.enqueueAfterDelay(this.Kt,6e4,()=>this.tn()))}nn(t){this.rn(),this.stream.send(t)}async tn(){if(this.Yt())return this.close(0)}rn(){this.Gt&&(this.Gt.cancel(),this.Gt=null)}sn(){this.zt&&(this.zt.cancel(),this.zt=null)}async close(t,e){this.rn(),this.sn(),this.Ht.cancel(),this.Wt++,4!==t?this.Ht.reset():e&&e.code===Cl.RESOURCE_EXHAUSTED?(Wc(e.toString()),Wc("Using maximum backoff delay to prevent overloading the backend."),this.Ht.Ut()):e&&e.code===Cl.UNAUTHENTICATED&&3!==this.state&&(this.authCredentialsProvider.invalidateToken(),this.appCheckCredentialsProvider.invalidateToken()),null!==this.stream&&(this._n(),this.stream.close(),this.stream=null),this.state=t,await this.listener.Tt(e)}_n(){}auth(){this.state=1;const t=this.an(this.Wt),e=this.Wt;Promise.all([this.authCredentialsProvider.getToken(),this.appCheckCredentialsProvider.getToken()]).then(([t,n])=>{this.Wt===e&&this.un(t,n)},e=>{t(()=>{const t=new gl(Cl.UNKNOWN,"Fetching auth token failed: "+e.message);return this.cn(t)})})}un(t,e){const n=this.an(this.Wt);this.stream=this.En(t,e),this.stream.ct(()=>{n(()=>this.listener.ct())}),this.stream.Et(()=>{n(()=>(this.state=2,this.zt=this.Ct.enqueueAfterDelay(this.Qt,1e4,()=>(this.Yt()&&(this.state=3),Promise.resolve())),this.listener.Et()))}),this.stream.Tt(t=>{n(()=>this.cn(t))}),this.stream.onMessage(t=>{n(()=>1==++this.jt?this.hn(t):this.onNext(t))})}Zt(){this.state=5,this.Ht.kt(async()=>{this.state=0,this.start()})}cn(t){return Qc(op,`close with error: ${t}`),this.stream=null,this.close(4,t)}an(t){return e=>{this.Ct.enqueueAndForget(()=>this.Wt===t?e():(Qc(op,"stream callback skipped by getCloseGuardedDispatcher."),Promise.resolve()))}}}class Bp extends ap{constructor(t,e,n,s,r,i){super(t,"write_stream_connection_backoff","write_stream_idle","health_check_timeout",e,n,s,i),this.serializer=r}get Rn(){return this.jt>0}start(){this.lastStreamToken=void 0,super.start()}_n(){this.Rn&&this.An([])}En(t,e){return this.connection.vt("Write",t,e)}hn(t){return el(!!t.streamToken,31322),this.lastStreamToken=t.streamToken,el(!t.writeResults||0===t.writeResults.length,55816),this.listener.Vn()}onNext(t){el(!!t.streamToken,12678),this.lastStreamToken=t.streamToken,this.Ht.reset();const e=function(t,e){return t&&t.length>0?(el(void 0!==e,14353),t.map(t=>function(t,e){let n=t.updateTime?md(t.updateTime):md(e);return n.isEqual(xh.min())&&(n=md(e)),new Wu(n,t.transformResults||[])}(t,e))):[]}(t.writeResults,t.commitTime),n=md(t.commitTime);return this.listener.dn(n,e)}fn(){const t={};t.database=function(t){return new yl(["projects",t.databaseId.projectId,"databases",t.databaseId.database]).canonicalString()}(this.serializer),this.nn(t)}An(t){const e={streamToken:this.lastStreamToken,writes:t.map(t=>function(t,e){let n;if(e instanceof ih)n={update:Dd(t,e.key,e.value)};else if(e instanceof lh)n={delete:Ed(t,e.key)};else if(e instanceof oh)n={update:Dd(t,e.key,e.data),updateMask:Td(e.fieldMask)};else{if(!(e instanceof uh))return Zc(16599,{be:e.type});n={verify:Ed(t,e.key)}}return e.fieldTransforms.length>0&&(n.updateTransforms=e.fieldTransforms.map(t=>function(t,e){const n=e.transform;if(n instanceof Mu)return{fieldPath:e.field.canonicalString(),setToServerValue:"REQUEST_TIME"};if(n instanceof Gu)return{fieldPath:e.field.canonicalString(),appendMissingElements:{values:n.elements}};if(n instanceof Uu)return{fieldPath:e.field.canonicalString(),removeAllFromArray:{values:n.elements}};if(n instanceof $u)return{fieldPath:e.field.canonicalString(),increment:n.h};if(n instanceof Ju)return{fieldPath:e.field.canonicalString(),minimum:n.h};if(n instanceof qu)return{fieldPath:e.field.canonicalString(),maximum:n.h};throw Zc(20930,{transform:e.transform})}(0,t))),e.precondition.isNone||(n.currentDocument=function(t,e){return void 0!==e.updateTime?{updateTime:gd(t,e.updateTime)}:void 0!==e.exists?{exists:e.exists}:Zc(27497)}(t,e.precondition)),n}(this.serializer,t))};this.nn(e)}}class cp{}class lp extends cp{constructor(t,e,n,s){super(),this.authCredentials=t,this.appCheckCredentials=e,this.connection=n,this.serializer=s,this.mn=!1}pn(){if(this.mn)throw new gl(Cl.FAILED_PRECONDITION,"The client has already been terminated.")}nt(t,e,n,s){return this.pn(),Promise.all([this.authCredentials.getToken(),this.appCheckCredentials.getToken()]).then(([r,i])=>this.connection.nt(t,yd(e,n),s,r,i)).catch(t=>{throw"FirebaseError"===t.name?(t.code===Cl.UNAUTHENTICATED&&(this.authCredentials.invalidateToken(),this.appCheckCredentials.invalidateToken()),t):new gl(Cl.UNKNOWN,t.toString())})}_t(t,e,n,s,r){return this.pn(),Promise.all([this.authCredentials.getToken(),this.appCheckCredentials.getToken()]).then(([i,o])=>this.connection._t(t,yd(e,n),s,i,o,r)).catch(t=>{throw"FirebaseError"===t.name?(t.code===Cl.UNAUTHENTICATED&&(this.authCredentials.invalidateToken(),this.appCheckCredentials.invalidateToken()),t):new gl(Cl.UNKNOWN,t.toString())})}terminate(){this.mn=!0,this.connection.terminate()}}const up=new Map;const hp={didRun:!1,sequenceNumbersCollected:0,targetsRemoved:0,documentsRemoved:0},dp=41943040;class pp{static withCacheSize(t){return new pp(t,pp.DEFAULT_COLLECTION_PERCENTILE,pp.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT)}constructor(t,e,n){this.cacheSizeCollectionThreshold=t,this.percentileToCollect=e,this.maximumSequenceNumbersToCollect=n}}pp.DEFAULT_COLLECTION_PERCENTILE=10,pp.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT=1e3,pp.DEFAULT=new pp(dp,pp.DEFAULT_COLLECTION_PERCENTILE,pp.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT),pp.DISABLED=new pp(-1,0,0);class fp{constructor(t,e){this.previousValue=t,e&&(e.sequenceNumberHandler=t=>this.gn(t),this.yn=t=>e.writeSequenceNumber(t))}gn(t){return this.previousValue=Math.max(t,this.previousValue),this.previousValue}next(){const t=++this.previousValue;return this.yn&&this.yn(t),t}}fp.wn=-1;class Cp{constructor(){this.onCommittedListeners=[]}addOnCommittedListener(t){this.onCommittedListeners.push(t)}raiseOnCommittedEvent(){this.onCommittedListeners.forEach(t=>t())}}async function gp(t){if(t.code!==Cl.FAILED_PRECONDITION||"The current tab is not in the required state to perform this operation. It might be necessary to refresh the browser tab."!==t.message)throw t;Qc("LocalStore","Unexpectedly lost primary lease")}class mp{constructor(t){this.nextCallback=null,this.catchCallback=null,this.result=void 0,this.error=void 0,this.isDone=!1,this.callbackAttached=!1,t(t=>{this.isDone=!0,this.result=t,this.nextCallback&&this.nextCallback(t)},t=>{this.isDone=!0,this.error=t,this.catchCallback&&this.catchCallback(t)})}catch(t){return this.next(void 0,t)}next(t,e){return this.callbackAttached&&Zc(59440),this.callbackAttached=!0,this.isDone?this.error?this.wrapFailure(e,this.error):this.wrapSuccess(t,this.result):new mp((n,s)=>{this.nextCallback=e=>{this.wrapSuccess(t,e).next(n,s)},this.catchCallback=t=>{this.wrapFailure(e,t).next(n,s)}})}toPromise(){return new Promise((t,e)=>{this.next(t,e)})}wrapUserFunction(t){try{const e=t();return e instanceof mp?e:mp.resolve(e)}catch(t){return mp.reject(t)}}wrapSuccess(t,e){return t?this.wrapUserFunction(()=>t(e)):mp.resolve(e)}wrapFailure(t,e){return t?this.wrapUserFunction(()=>t(e)):mp.reject(e)}static resolve(t){return new mp((e,n)=>{e(t)})}static reject(t){return new mp((e,n)=>{n(t)})}static waitFor(t){return new mp((e,n)=>{let s=0,r=0,i=!1;t.forEach(t=>{++s,t.next(()=>{++r,i&&r===s&&e()},t=>n(t))}),i=!0,r===s&&e()})}static or(t){let e=mp.resolve(!1);for(const n of t)e=e.next(t=>t?mp.resolve(t):n());return e}static forEach(t,e){const n=[];return t.forEach((t,s)=>{n.push(e.call(this,t,s))}),this.waitFor(n)}static mapArray(t,e){return new mp((n,s)=>{const r=t.length,i=new Array(r);let o=0;for(let a=0;a<r;a++){const B=a;e(t[B]).next(t=>{i[B]=t,++o,o===r&&n(i)},t=>s(t))}})}static doWhile(t,e){return new mp((n,s)=>{const r=()=>{!0===t()?e().next(()=>{r()},s):n()};r()})}}function wp(t){return"IndexedDbTransactionError"===t.name}const yp="LruGarbageCollector";function Ep([t,e],[n,s]){const r=il(t,n);return 0===r?il(e,s):r}class _p{constructor(t){this.Yn=t,this.buffer=new pl(Ep),this.Zn=0}Xn(){return++this.Zn}er(t){const e=[t,this.Xn()];if(this.buffer.size<this.Yn)this.buffer=this.buffer.add(e);else{const t=this.buffer.last();Ep(e,t)<0&&(this.buffer=this.buffer.delete(t).add(e))}}get maxValue(){return this.buffer.last()[0]}}class Dp{constructor(t,e,n){this.garbageCollector=t,this.asyncQueue=e,this.localStore=n,this.tr=null}start(){-1!==this.garbageCollector.params.cacheSizeCollectionThreshold&&this.nr(6e4)}stop(){this.tr&&(this.tr.cancel(),this.tr=null)}get started(){return null!==this.tr}nr(t){Qc(yp,`Garbage collection scheduled in ${t}ms`),this.tr=this.asyncQueue.enqueueAfterDelay("lru_garbage_collection",t,async()=>{this.tr=null;try{await this.localStore.collectGarbage(this.garbageCollector)}catch(t){wp(t)?Qc(yp,"Ignoring IndexedDB error during garbage collection: ",t):await gp(t)}await this.nr(3e5)})}}class bp{constructor(t,e){this.rr=t,this.params=e}calculateTargetCount(t,e){return this.rr.ir(t).next(t=>Math.floor(e/100*t))}nthSequenceNumber(t,e){if(0===e)return mp.resolve(fp.wn);const n=new _p(e);return this.rr.forEachTarget(t,t=>n.er(t.sequenceNumber)).next(()=>this.rr.sr(t,t=>n.er(t))).next(()=>n.maxValue)}removeTargets(t,e,n){return this.rr.removeTargets(t,e,n)}removeOrphanedDocuments(t,e){return this.rr.removeOrphanedDocuments(t,e)}collect(t,e){return-1===this.params.cacheSizeCollectionThreshold?(Qc("LruGarbageCollector","Garbage collection skipped; disabled"),mp.resolve(hp)):this.getCacheSize(t).next(n=>n<this.params.cacheSizeCollectionThreshold?(Qc("LruGarbageCollector",`Garbage collection skipped; Cache size ${n} is lower than threshold ${this.params.cacheSizeCollectionThreshold}`),hp):this._r(t,e))}getCacheSize(t){return this.rr.getCacheSize(t)}_r(t,e){let n,s,r,i,o,a,B;const c=Date.now();return this.calculateTargetCount(t,this.params.percentileToCollect).next(e=>(e>this.params.maximumSequenceNumbersToCollect?(Qc("LruGarbageCollector",`Capping sequence numbers to collect down to the maximum of ${this.params.maximumSequenceNumbersToCollect} from ${e}`),s=this.params.maximumSequenceNumbersToCollect):s=e,i=Date.now(),this.nthSequenceNumber(t,s))).next(s=>(n=s,o=Date.now(),this.removeTargets(t,n,e))).next(e=>(r=e,a=Date.now(),this.removeOrphanedDocuments(t,n))).next(t=>(B=Date.now(),Kc()<=is.DEBUG&&Qc("LruGarbageCollector",`LRU Garbage Collection\n\tCounted targets in ${i-c}ms\n\tDetermined least recently used ${s} in `+(o-i)+"ms\n"+`\tRemoved ${r} targets in `+(a-o)+"ms\n"+`\tRemoved ${t} documents in `+(B-a)+"ms\n"+`Total Duration: ${B-c}ms`),mp.resolve({didRun:!0,sequenceNumbersCollected:s,targetsRemoved:r,documentsRemoved:t})))}}const vp="firestore.googleapis.com",Ip=!0;class Tp{constructor(t){if(void 0===t.host){if(void 0!==t.ssl)throw new gl(Cl.INVALID_ARGUMENT,"Can't provide ssl option if host option is not set");this.host=vp,this.ssl=Ip}else this.host=t.host,this.ssl=t.ssl??Ip;if(this.isUsingEmulator=void 0!==t.emulatorOptions,this.credentials=t.credentials,this.ignoreUndefinedProperties=!!t.ignoreUndefinedProperties,this.localCache=t.localCache,t._customHeaders&&(this._customHeaders={...t._customHeaders}),void 0===t.cacheSizeBytes)this.cacheSizeBytes=dp;else{if(-1!==t.cacheSizeBytes&&t.cacheSizeBytes<1048576)throw new gl(Cl.INVALID_ARGUMENT,"cacheSizeBytes must be at least 1048576");this.cacheSizeBytes=t.cacheSizeBytes}if(function(t,e,n,s){if(!0===e&&!0===s)throw new gl(Cl.INVALID_ARGUMENT,`${t} and ${n} cannot be used together.`)}("experimentalForceLongPolling",t.experimentalForceLongPolling,"experimentalAutoDetectLongPolling",t.experimentalAutoDetectLongPolling),this.experimentalForceLongPolling=!!t.experimentalForceLongPolling,this.experimentalForceLongPolling?this.experimentalAutoDetectLongPolling=!1:void 0===t.experimentalAutoDetectLongPolling?this.experimentalAutoDetectLongPolling=!0:this.experimentalAutoDetectLongPolling=!!t.experimentalAutoDetectLongPolling,this.experimentalLongPollingOptions=qd(t.experimentalLongPollingOptions??{}),function(t){if(void 0!==t.timeoutSeconds){if(isNaN(t.timeoutSeconds))throw new gl(Cl.INVALID_ARGUMENT,`invalid long polling timeout: ${t.timeoutSeconds} (must not be NaN)`);if(t.timeoutSeconds<5)throw new gl(Cl.INVALID_ARGUMENT,`invalid long polling timeout: ${t.timeoutSeconds} (minimum allowed value is 5)`);if(t.timeoutSeconds>30)throw new gl(Cl.INVALID_ARGUMENT,`invalid long polling timeout: ${t.timeoutSeconds} (maximum allowed value is 30)`)}}(this.experimentalLongPollingOptions),this.useFetchStreams=!!t.useFetchStreams,void 0!==t.grpcFlowControlWindow){if("number"!=typeof t.grpcFlowControlWindow||t.grpcFlowControlWindow<=0||t.grpcFlowControlWindow>2147483647||!Number.isInteger(t.grpcFlowControlWindow))throw new gl(Cl.INVALID_ARGUMENT,"grpcFlowControlWindow must be a positive integer and cannot exceed 2147483647");this.grpcFlowControlWindow=t.grpcFlowControlWindow}}isEqual(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&&function(t,e){return t.timeoutSeconds===e.timeoutSeconds}(this.experimentalLongPollingOptions,t.experimentalLongPollingOptions)&&this.ignoreUndefinedProperties===t.ignoreUndefinedProperties&&this.useFetchStreams===t.useFetchStreams&&this.grpcFlowControlWindow===t.grpcFlowControlWindow&&function(t,e){if(t===e)return!0;if(!t||!e)return!1;const n=Object.keys(t),s=Object.keys(e);if(n.length!==s.length)return!1;for(const s of n)if(t[s]!==e[s])return!1;return!0}(this._customHeaders,t._customHeaders)}}let Op=class{constructor(t,e,n,s){this._authCredentials=t,this._appCheckCredentials=e,this._databaseId=n,this._app=s,this.type="firestore-lite",this._persistenceKey="(lite)",this._settings=new Tp({}),this._settingsFrozen=!1,this._emulatorOptions={},this._terminateTask="notTerminated"}get app(){if(!this._app)throw new gl(Cl.FAILED_PRECONDITION,"Firestore was not initialized using the Firebase SDK. 'app' is not available");return this._app}get _initialized(){return this._settingsFrozen}get _terminated(){return"notTerminated"!==this._terminateTask}_setSettings(t){if(this._settingsFrozen)throw new gl(Cl.FAILED_PRECONDITION,"Firestore has already been started and its settings can no longer be changed. You can only modify settings before calling any other methods on a Firestore object.");this._settings=new Tp(t),this._emulatorOptions=t.emulatorOptions||{},void 0!==t.credentials&&(this._authCredentials=function(t){if(!t)return new Gd;switch(t.type){case"firstParty":return new jd(t.sessionIndex||"0",t.iamToken||null,t.authTokenFactory||null);case"provider":return t.client;default:throw new gl(Cl.INVALID_ARGUMENT,"makeAuthCredentialsProvider failed due to invalid credential type")}}(t.credentials))}_getSettings(){return this._settings}_getEmulatorOptions(){return this._emulatorOptions}_freezeSettings(){return this._settingsFrozen=!0,this._settings}_delete(){return"notTerminated"===this._terminateTask&&(this._terminateTask=this._terminate()),this._terminateTask}async _restart(){"notTerminated"===this._terminateTask?await this._terminate():this._terminateTask="notTerminated"}toJSON(){return{app:this._app,databaseId:this._databaseId,settings:this._settings}}_terminate(){return function(t){const e=up.get(t);e&&(Qc("ComponentProvider","Removing Datastore"),up.delete(t),e.terminate())}(this),Promise.resolve()}};function Ap(t,e,n,s={}){t=Rl(t,Op);const r=Zn(e),i=t._getSettings(),o={...i,emulatorOptions:t._getEmulatorOptions()},a=`${e}:${n}`;r&&ts(`https://${a}`),i.host!==vp&&i.host!==a&&Yc("Host has been set in both settings() and connectFirestoreEmulator(), emulator host will be used.");const B={...i,host:a,ssl:r,emulatorOptions:s};if(!$n(B,o)&&(t._setSettings(B),s.mockUserToken)){let e,n;if("string"==typeof s.mockUserToken)e=s.mockUserToken,n=Fd.MOCK_USER;else{e=Ln(s.mockUserToken,t._app?.options.projectId);const r=s.mockUserToken.sub||s.mockUserToken.user_id;if(!r)throw new gl(Cl.INVALID_ARGUMENT,"mockUserToken must contain 'sub' or 'user_id' field!");n=new Fd(r)}t._authCredentials=new Hd(new Md(e,n))}}class Sp{constructor(t,e,n){this.converter=e,this._query=n,this.type="query",this.firestore=t}withConverter(t){return new Sp(this.firestore,t,this._query)}}class Rp{constructor(t,e,n){this.converter=e,this._key=n,this.type="document",this.firestore=t}get _path(){return this._key.path}get id(){return this._key.path.lastSegment()}get path(){return this._key.path.canonicalString()}get parent(){return new Np(this.firestore,this.converter,this._key.path.popLast())}withConverter(t){return new Rp(this.firestore,t,this._key)}toJSON(){return{type:Rp._jsonSchemaVersion,referencePath:this._key.toString()}}static fromJSON(t,e,n){if(xl(e,Rp._jsonSchema))return new Rp(t,n||null,new Tl(yl.fromString(e.referencePath)))}}Rp._jsonSchemaVersion="firestore/documentReference/1.0",Rp._jsonSchema={type:Nl("string",Rp._jsonSchemaVersion),referencePath:Nl("string")};class Np extends Sp{constructor(t,e,n){super(t,e,function(t){return new Vh(t)}(n)),this._path=n,this.type="collection"}get id(){return this._query.path.lastSegment()}get path(){return this._query.path.canonicalString()}get parent(){const t=this._path.popLast();return t.isEmpty()?null:new Rp(this.firestore,null,new Tl(t))}withConverter(t){return new Np(this.firestore,t,this._path)}}function xp(t,e,...n){if(t=Xn(t),1===arguments.length&&(e=rl.newId()),function(t,e,n){if(!n)throw new gl(Cl.INVALID_ARGUMENT,`Function ${t}() cannot be called with an empty ${e}.`)}("doc","path",e),t instanceof Op){const s=yl.fromString(e,...n);return Ol(s),new Rp(t,null,new Tl(s))}{if(!(t instanceof Rp||t instanceof Np))throw new gl(Cl.INVALID_ARGUMENT,"Expected first argument to doc() to be a CollectionReference, a DocumentReference or FirebaseFirestore");const s=t._path.child(yl.fromString(e,...n));return Ol(s),new Rp(t.firestore,t instanceof Np?t.converter:null,new Tl(s))}}class kp{constructor(t){this._values=(t||[]).map(t=>t)}toArray(){return this._values.map(t=>t)}isEqual(t){return function(t,e){if(t.length!==e.length)return!1;for(let n=0;n<t.length;++n)if(t[n]!==e[n])return!1;return!0}(this._values,t._values)}toJSON(){return{type:kp._jsonSchemaVersion,vectorValues:this._values}}static fromJSON(t){if(xl(t,kp._jsonSchema)){if(Array.isArray(t.vectorValues)&&t.vectorValues.every(t=>"number"==typeof t))return new kp(t.vectorValues);throw new gl(Cl.INVALID_ARGUMENT,"Expected 'vectorValues' field to be a number array")}}}function Lp(t,e,n){if(Pp(t=Xn(t)))return function(t,e,n){if(!Pp(n)||!Al(n)){const s=Sl(n);throw"an object"===s?e.createError(t+" a custom object"):e.createError(t+" "+s)}}("Unsupported field value:",e,t),function(t,e){const n={};return Il(t)?e.path&&e.path.length>0&&e.fieldMask.push(e.path):vl(t,(t,s)=>{const r=Lp(s,e.childContextForField(t));null!=r&&(n[t]=r)}),{mapValue:{fields:n}}}(t,e);if(t instanceof kd)return function(t,e){if(!function(t){switch(t){case 0:case 2:case 1:return!0;case 3:case 4:return!1;default:throw Zc(40011,{dataSource:t})}}(e.dataSource))throw e.createError(`${t._methodName}() can only be used with update() and set()`);if(!e.path)throw e.createError(`${t._methodName}() is not currently supported inside arrays`);const n=t._toFieldTransform(e);n&&e.fieldTransforms.push(n)}(t,e),null;if(void 0===t&&e.ignoreUndefinedProperties)return null;if(e.path&&e.fieldMask.push(e.path),t instanceof Array){if(e.settings.arrayElement&&4!==e.dataSource)throw e.createError("Nested arrays are not supported");return function(t,e){const n=[];let s=0;for(const r of t){let t=Lp(r,e.childContextForArray(s));null==t&&(t={nullValue:"NULL_VALUE"}),n.push(t),s++}return{arrayValue:{values:n}}}(t,e)}return function(t,e){if(null===(t=Xn(t)))return{nullValue:"NULL_VALUE"};if("number"==typeof t)return xu(e.serializer,t);if("boolean"==typeof t)return{booleanValue:t};if("string"==typeof t)return{stringValue:t};if(t instanceof Date){const n=Fl.fromDate(t);return{timestampValue:pd(e.serializer,n)}}if(t instanceof Fl){const n=new Fl(t.seconds,1e3*Math.floor(t.nanoseconds/1e3));return{timestampValue:pd(e.serializer,n)}}if(Fp(t)){const n=Fl.fromInstant(t),s=new Fl(n.seconds,1e3*Math.floor(n.nanoseconds/1e3));return{timestampValue:pd(e.serializer,s)}}if(t instanceof Ld)return{geoPointValue:{latitude:t.latitude,longitude:t.longitude}};if(t instanceof Nd)return{bytesValue:Cd(e.serializer,t._byteString)};if(t instanceof Rp){const n=e.databaseId,s=t.firestore._databaseId;if(!s.isEqual(n))throw e.createError(`Document reference is for database ${s.projectId}/${s.database} but should be for database ${n.projectId}/${n.database}`);return{referenceValue:wd(t.firestore._databaseId||e.databaseId,t._key.path)}}if(t instanceof kp)return function(t,e){const n=t instanceof kp?t.toArray():t,s={fields:{[nu]:{stringValue:iu},[ou]:{arrayValue:{values:n.map(t=>{if("number"!=typeof t)throw e.createError("VectorValues must only contain numeric values.");return Ru(e.serializer,t)})}}}};return{mapValue:s}}(t,e);if(Od(t))return t._toProto(e.serializer);throw e.createError(`Unsupported field value: ${Sl(t)}`)}(t,e)}function Fp(t){if("object"!=typeof t||null===t)return!1;if("undefined"!=typeof Temporal&&"function"==typeof Temporal.Instant&&t instanceof Temporal.Instant)return!0;const e=t;return"Temporal.Instant"===e[Symbol.toStringTag]&&"bigint"==typeof e.t}function Pp(t){return!("object"!=typeof t||null===t||t instanceof Array||t instanceof Date||t instanceof Fl||t instanceof Ld||t instanceof Nd||t instanceof Rp||t instanceof kd||t instanceof kp||Fp(t)||Od(t))}function Mp(t,e,n){if((e=Xn(e))instanceof xd)return e._internalPath;if("string"==typeof e)return function(t,e){if(e.search(Gp)>=0)throw Hp(`Invalid field path (${e}). Paths must not contain '~', '*', '/', '[', or ']'`,t);try{return new xd(...e.split("."))._internalPath}catch(n){throw Hp(`Invalid field path (${e}). Paths must not be empty, begin with '.', end with '.', or contain '..'`,t)}}(t,e);throw Hp("Field path arguments must be of type string or ",t)}kp._jsonSchemaVersion="firestore/vectorValue/1.0",kp._jsonSchema={type:Nl("string",kp._jsonSchemaVersion),vectorValues:Nl("object")};const Gp=new RegExp("[~\\*/\\[\\]]");function Hp(t,e,n,s,r){let i=`Function ${e}() called with invalid data`;i+=". ";return new gl(Cl.INVALID_ARGUMENT,i+t+"")}class Up{constructor(t){this.optionDefinitions=t}_getKnownOptions(t,e){const n=Au.empty();for(const s in this.optionDefinitions)if(this.optionDefinitions.hasOwnProperty(s)){const r=this.optionDefinitions[s];if(s in t){const i=t[s];let o;r.nestedOptions&&Al(i)?o={mapValue:{fields:new Up(r.nestedOptions).getOptionsProto(e,i)}}:i&&(o=Lp(i,e)??void 0),o&&n.set(_l.fromServerFormat(r.serverName),o)}}return n}getOptionsProto(t,e,n){const s=this._getKnownOptions(e,t);if(n){const e=new Map(function(t,e){const n=[];for(const s in t)Object.prototype.hasOwnProperty.call(t,s)&&n.push(e(t[s],s,t));return n}(n,(e,n)=>[_l.fromServerFormat(n),void 0!==e?Lp(e,t):null]));s.setAll(e)}return s.value.mapValue.fields??{}}}function Vp(t){let e;return t instanceof Jp?t:(e=Al(t)?function(t){const e=[];for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)){const s=t[n];e.push(Xp(n)),e.push(Vp(s))}return new tf("map",e,"map")}(t):t instanceof Array?function(t){return function(t,e){return new tf("array",t.map(t=>Vp(t)),e)}(t,"array")}(t):Zp(t,void 0),e)}function jp(t){if(t instanceof Jp)return t;if(t instanceof kp)return Xp(t);if(Array.isArray(t))return Xp(function(t){return new kp(t)}(t));throw new Error("Unsupported value: "+typeof t)}function $p(t){return function(t){return"string"==typeof t}(t)?function(t){return function(t,e){return new Wp("string"==typeof t?ml===t?new xd(ml)._internalPath:Mp("field",t):t._internalPath,e)}(t,"field")}(t):Vp(t)}class Jp{constructor(){this._protoValueType="ProtoValue"}add(t){return new tf("add",[this,Vp(t)],"add")}asBoolean(){if(this instanceof ef)return this;if(this instanceof Yp)return new sf(this);if(this instanceof Wp)return new rf(this);if(this instanceof tf)return new nf(this);throw new gl("invalid-argument",`Conversion of type ${typeof this} to BooleanExpression not supported.`)}subtract(t){return new tf("subtract",[this,Vp(t)],"subtract")}multiply(t){return new tf("multiply",[this,Vp(t)],"multiply")}divide(t){return new tf("divide",[this,Vp(t)],"divide")}mod(t){return new tf("mod",[this,Vp(t)],"mod")}equal(t){return new tf("equal",[this,Vp(t)],"equal").asBoolean()}notEqual(t){return new tf("not_equal",[this,Vp(t)],"notEqual").asBoolean()}lessThan(t){return new tf("less_than",[this,Vp(t)],"lessThan").asBoolean()}lessThanOrEqual(t){return new tf("less_than_or_equal",[this,Vp(t)],"lessThanOrEqual").asBoolean()}greaterThan(t){return new tf("greater_than",[this,Vp(t)],"greaterThan").asBoolean()}greaterThanOrEqual(t){return new tf("greater_than_or_equal",[this,Vp(t)],"greaterThanOrEqual").asBoolean()}arrayConcat(t,...e){const n=[t,...e].map(t=>Vp(t));return new tf("array_concat",[this,...n],"arrayConcat")}arrayContains(t){return new tf("array_contains",[this,Vp(t)],"arrayContains").asBoolean()}arrayContainsAll(t){const e=Array.isArray(t)?new Qp(t.map(Vp),"arrayContainsAll"):t;return new tf("array_contains_all",[this,e],"arrayContainsAll").asBoolean()}arrayContainsAny(t){const e=Array.isArray(t)?new Qp(t.map(Vp),"arrayContainsAny"):t;return new tf("array_contains_any",[this,e],"arrayContainsAny").asBoolean()}arrayReverse(){return new tf("array_reverse",[this])}arrayLength(){return new tf("array_length",[this],"arrayLength")}equalAny(t){const e=Array.isArray(t)?new Qp(t.map(Vp),"equalAny"):t;return new tf("equal_any",[this,e],"equalAny").asBoolean()}notEqualAny(t){const e=Array.isArray(t)?new Qp(t.map(Vp),"notEqualAny"):t;return new tf("not_equal_any",[this,e],"notEqualAny").asBoolean()}exists(){return new tf("exists",[this],"exists").asBoolean()}charLength(){return new tf("char_length",[this],"charLength")}like(t){return new tf("like",[this,Vp(t)],"like").asBoolean()}regexContains(t){return new tf("regex_contains",[this,Vp(t)],"regexContains").asBoolean()}regexFind(t){return new tf("regex_find",[this,Vp(t)],"regexFind")}regexFindAll(t){return new tf("regex_find_all",[this,Vp(t)],"regexFindAll")}regexMatch(t){return new tf("regex_match",[this,Vp(t)],"regexMatch").asBoolean()}stringContains(t){return new tf("string_contains",[this,Vp(t)],"stringContains").asBoolean()}startsWith(t){return new tf("starts_with",[this,Vp(t)],"startsWith").asBoolean()}endsWith(t){return new tf("ends_with",[this,Vp(t)],"endsWith").asBoolean()}toLower(){return new tf("to_lower",[this],"toLower")}toUpper(){return new tf("to_upper",[this],"toUpper")}trim(t){const e=[this];return t&&e.push(Vp(t)),new tf("trim",e,"trim")}ltrim(t){const e=[this];return t&&e.push(Vp(t)),new tf("ltrim",e,"ltrim")}rtrim(t){const e=[this];return t&&e.push(Vp(t)),new tf("rtrim",e,"rtrim")}type(){return new tf("type",[this])}isType(t){return new tf("is_type",[this,Xp(t)],"isType").asBoolean()}stringConcat(t,...e){const n=[t,...e].map(Vp);return new tf("string_concat",[this,...n],"stringConcat")}stringIndexOf(t){return new tf("string_index_of",[this,Vp(t)],"stringIndexOf")}stringRepeat(t){return new tf("string_repeat",[this,Vp(t)],"stringRepeat")}stringReplaceAll(t,e){return new tf("string_replace_all",[this,Vp(t),Vp(e)],"stringReplaceAll")}stringReplaceOne(t,e){return new tf("string_replace_one",[this,Vp(t),Vp(e)],"stringReplaceOne")}concat(t,...e){const n=[t,...e].map(Vp);return new tf("concat",[this,...n],"concat")}reverse(){return new tf("reverse",[this],"reverse")}arrayFilter(t,e){return new tf("array_filter",[this,Vp(t),e],"arrayFilter")}arrayTransform(t,e){return new tf("array_transform",[this,Vp(t),e],"arrayTransform")}arrayTransformWithIndex(t,e,n){return new tf("array_transform",[this,Vp(t),Vp(e),n],"arrayTransformWithIndex")}arraySlice(t,e){const n=[this,Vp(t)];return void 0!==e&&n.push(Vp(e)),new tf("array_slice",n,"arraySlice")}arrayFirst(){return new tf("array_first",[this],"arrayFirst")}arrayFirstN(t){return new tf("array_first_n",[this,Vp(t)],"arrayFirstN")}arrayLast(){return new tf("array_last",[this],"arrayLast")}arrayLastN(t){return new tf("array_last_n",[this,Vp(t)],"arrayLastN")}arrayMaximum(){return new tf("maximum",[this],"arrayMaximum")}arrayMaximumN(t){return new tf("maximum_n",[this,Vp(t)],"arrayMaximumN")}arrayMinimum(){return new tf("minimum",[this],"arrayMinimum")}arrayMinimumN(t){return new tf("minimum_n",[this,Vp(t)],"arrayMinimumN")}arrayIndexOf(t){return new tf("array_index_of",[this,Vp(t),Vp("first")],"arrayIndexOf")}arrayLastIndexOf(t){return new tf("array_index_of",[this,Vp(t),Vp("last")],"arrayLastIndexOf")}arrayIndexOfAll(t){return new tf("array_index_of_all",[this,Vp(t)],"arrayIndexOfAll")}byteLength(){return new tf("byte_length",[this],"byteLength")}ceil(){return new tf("ceil",[this])}floor(){return new tf("floor",[this])}abs(){return new tf("abs",[this])}exp(){return new tf("exp",[this])}mapGet(t){return new tf("map_get",[this,Xp(t)],"mapGet")}mapSet(t,e,...n){const s=[this,Vp(t),Vp(e),...n.map(Vp)];return new tf("map_set",s,"mapSet")}mapKeys(){return new tf("map_keys",[this],"mapKeys")}mapValues(){return new tf("map_values",[this],"mapValues")}mapEntries(){return new tf("map_entries",[this],"mapEntries")}getField(t){return new tf("get_field",[this,Vp(t)],"get_field")}count(){return qp._create("count",[this],"count")}sum(){return qp._create("sum",[this],"sum")}average(){return qp._create("average",[this],"average")}minimum(){return qp._create("minimum",[this],"minimum")}maximum(){return qp._create("maximum",[this],"maximum")}first(){return qp._create("first",[this],"first")}last(){return qp._create("last",[this],"last")}arrayAgg(){return qp._create("array_agg",[this],"arrayAgg")}arrayAggDistinct(){return qp._create("array_agg_distinct",[this],"arrayAggDistinct")}countDistinct(){return qp._create("count_distinct",[this],"countDistinct")}logicalMaximum(t,...e){const n=[t,...e];return new tf("maximum",[this,...n.map(Vp)],"logicalMaximum")}logicalMinimum(t,...e){const n=[t,...e];return new tf("minimum",[this,...n.map(Vp)],"minimum")}vectorLength(){return new tf("vector_length",[this],"vectorLength")}cosineDistance(t){return new tf("cosine_distance",[this,jp(t)],"cosineDistance")}dotProduct(t){return new tf("dot_product",[this,jp(t)],"dotProduct")}euclideanDistance(t){return new tf("euclidean_distance",[this,jp(t)],"euclideanDistance")}unixMicrosToTimestamp(){return new tf("unix_micros_to_timestamp",[this],"unixMicrosToTimestamp")}timestampToUnixMicros(){return new tf("timestamp_to_unix_micros",[this],"timestampToUnixMicros")}unixMillisToTimestamp(){return new tf("unix_millis_to_timestamp",[this],"unixMillisToTimestamp")}timestampToUnixMillis(){return new tf("timestamp_to_unix_millis",[this],"timestampToUnixMillis")}unixSecondsToTimestamp(){return new tf("unix_seconds_to_timestamp",[this],"unixSecondsToTimestamp")}timestampToUnixSeconds(){return new tf("timestamp_to_unix_seconds",[this],"timestampToUnixSeconds")}timestampAdd(t,e){return new tf("timestamp_add",[this,Vp(t),Vp(e)],"timestampAdd")}timestampSubtract(t,e){return new tf("timestamp_subtract",[this,Vp(t),Vp(e)],"timestampSubtract")}timestampDiff(t,e){return new tf("timestamp_diff",[this,$p(t),Vp(e)],"timestampDiff")}timestampExtract(t,e){const n=[this,Vp(t)];return e&&n.push(Vp(e)),new tf("timestamp_extract",n,"timestampExtract")}documentId(){return new tf("document_id",[this],"documentId")}parent(){return new tf("parent",[this],"parent")}substring(t,e){const n=Vp(t);return new tf("substring",void 0===e?[this,n]:[this,n,Vp(e)],"substring")}arrayGet(t){return new tf("array_get",[this,Vp(t)],"arrayGet")}isError(){return new tf("is_error",[this],"isError").asBoolean()}ifError(t){const e=new tf("if_error",[this,Vp(t)],"ifError");return t instanceof ef?e.asBoolean():e}isAbsent(){return new tf("is_absent",[this],"isAbsent").asBoolean()}mapRemove(t){return new tf("map_remove",[this,Vp(t)],"mapRemove")}mapMerge(t,...e){const n=Vp(t),s=e.map(Vp);return new tf("map_merge",[this,n,...s],"mapMerge")}pow(t){return new tf("pow",[this,Vp(t)])}trunc(t){return void 0===t?new tf("trunc",[this]):new tf("trunc",[this,Vp(t)],"trunc")}round(t){return void 0===t?new tf("round",[this]):new tf("round",[this,Vp(t)],"round")}collectionId(){return new tf("collection_id",[this])}length(){return new tf("length",[this])}ln(){return new tf("ln",[this])}sqrt(){return new tf("sqrt",[this])}stringReverse(){return new tf("string_reverse",[this])}ifAbsent(t){return new tf("if_absent",[this,Vp(t)],"ifAbsent")}ifNull(t){return new tf("if_null",[this,Vp(t)],"ifNull")}coalesce(t,...e){return new tf("coalesce",[this,Vp(t),...e.map(Vp)],"coalesce")}join(t){return new tf("join",[this,Vp(t)],"join")}log10(){return new tf("log10",[this])}arraySum(){return new tf("sum",[this])}split(t){return new tf("split",[this,Vp(t)])}timestampTruncate(t,e){const n=[this,Vp(t)];return e&&n.push(Vp(e)),new tf("timestamp_trunc",n)}ascending(){return function(t){return new of($p(t),"ascending","ascending")}(this)}descending(){return function(t){return new of($p(t),"descending","descending")}(this)}as(t){return new Kp(this,t,"as")}}class qp{constructor(t,e){this.name=t,this.params=e,this.exprType="AggregateFunction",this._protoValueType="ProtoValue"}static _create(t,e,n){const s=new qp(t,e);return s._methodName=n,s}as(t){return new zp(this,t,"as")}_toProto(t){return{functionValue:{name:this.name,args:this.params.map(e=>e._toProto(t))}}}_readUserData(t){t=this._methodName?t.contextWith({methodName:this._methodName}):t,this.params.forEach(e=>e._readUserData(t))}}class zp{constructor(t,e,n){this.aggregate=t,this.alias=e,this._methodName=n}_readUserData(t){this.aggregate._readUserData(t)}}class Kp{constructor(t,e,n){this.expr=t,this.alias=e,this._methodName=n,this.exprType="AliasedExpression",this.selectable=!0}_readUserData(t){this.expr._readUserData(t)}}class Qp extends Jp{constructor(t,e){super(),this.cr=t,this._methodName=e,this.expressionType="ListOfExpressions"}_toProto(t){return{arrayValue:{values:this.cr.map(e=>e._toProto(t))}}}_readUserData(t){this.cr.forEach(e=>e._readUserData(t))}}class Wp extends Jp{constructor(t,e){super(),this.fieldPath=t,this._methodName=e,this.expressionType="Field",this.selectable=!0}get _fieldPath(){return this.fieldPath}get fieldName(){return this.fieldPath.canonicalString()}get alias(){return this.fieldName}get expr(){return this}geoDistance(t){return new tf("geo_distance",[this,Vp(t)],"geoDistance")}_toProto(t){return{fieldReferenceValue:this.fieldPath.canonicalString()}}_readUserData(t){}}class Yp extends Jp{constructor(t,e){super(),this.value=t,this._methodName=e,this.expressionType="Constant"}static _fromProto(t){const e=new Yp(t,void 0);return e._protoValue=t,e}_toProto(t){return el(void 0!==this._protoValue,237),this._protoValue}_getValue(){return this._protoValue}_readUserData(t){t=this._methodName?t.contextWith({methodName:this._methodName}):t,function(t){return"object"==typeof t&&null!==t&&!!("nullValue"in t&&(null===t.nullValue||"NULL_VALUE"===t.nullValue)||"booleanValue"in t&&(null===t.booleanValue||"boolean"==typeof t.booleanValue)||"integerValue"in t&&(null===t.integerValue||"number"==typeof t.integerValue||"string"==typeof t.integerValue)||"doubleValue"in t&&(null===t.doubleValue||"number"==typeof t.doubleValue)||"timestampValue"in t&&(null===t.timestampValue||function(t){return"object"==typeof t&&null!==t&&"seconds"in t&&(null===t.seconds||"number"==typeof t.seconds||"string"==typeof t.seconds)&&"nanos"in t&&(null===t.nanos||"number"==typeof t.nanos)}(t.timestampValue))||"stringValue"in t&&(null===t.stringValue||"string"==typeof t.stringValue)||"bytesValue"in t&&(null===t.bytesValue||t.bytesValue instanceof Uint8Array)||"referenceValue"in t&&(null===t.referenceValue||"string"==typeof t.referenceValue)||"geoPointValue"in t&&(null===t.geoPointValue||function(t){return"object"==typeof t&&null!==t&&"latitude"in t&&(null===t.latitude||"number"==typeof t.latitude)&&"longitude"in t&&(null===t.longitude||"number"==typeof t.longitude)}(t.geoPointValue))||"arrayValue"in t&&(null===t.arrayValue||function(t){return"object"==typeof t&&null!==t&&!(!("values"in t)||null!==t.values&&!Array.isArray(t.values))}(t.arrayValue))||"mapValue"in t&&(null===t.mapValue||function(t){return"object"==typeof t&&null!==t&&!(!("fields"in t)||null!==t.fields&&!Al(t.fields))}(t.mapValue))||"fieldReferenceValue"in t&&(null===t.fieldReferenceValue||"string"==typeof t.fieldReferenceValue)||"functionValue"in t&&(null===t.functionValue||function(t){return"object"==typeof t&&null!==t&&!(!("name"in t)||null!==t.name&&"string"!=typeof t.name||!("args"in t)||null!==t.args&&!Array.isArray(t.args))}(t.functionValue))||"pipelineValue"in t&&(null===t.pipelineValue||function(t){return"object"==typeof t&&null!==t&&!(!("stages"in t)||null!==t.stages&&!Array.isArray(t.stages))}(t.pipelineValue)))}(this._protoValue)||(this._protoValue=Lp(this.value,t))}}function Xp(t,e){return Zp(t,"constant")}function Zp(t,e){const n=new Yp(t,e);return"boolean"==typeof t?new sf(n):n}class tf extends Jp{constructor(t,e,n,s){super(),this.name=t,this.params=e,this.expressionType="Function",this._optionsProto=void 0,void 0!==n&&(this._methodName=n),void 0!==s&&(this._options=s)}get _optionsUtil(){return new Up({})}_toProto(t){const e={functionValue:{name:this.name,args:this.params.map(e=>e._toProto(t))}};return this._optionsProto&&(e.functionValue.options=this._optionsProto),e}_readUserData(t){t=this._methodName?t.contextWith({methodName:this._methodName}):t,this.params.forEach(e=>e._readUserData(t)),this._options&&(this._optionsProto=this._optionsUtil.getOptionsProto(t,this._options))}}class ef extends Jp{get _methodName(){return this._expr._methodName}countIf(){return qp._create("count_if",[this],"countIf")}not(){return new tf("not",[this],"not").asBoolean()}conditional(t,e){return new tf("conditional",[this,t,e],"conditional")}ifError(t){const e=Vp(t),n=new tf("if_error",[this,e],"ifError");return e instanceof ef?n.asBoolean():n}_toProto(t){return this._expr._toProto(t)}_readUserData(t){this._expr._readUserData(t)}}class nf extends ef{constructor(t){super(),this._expr=t,this.expressionType="Function"}}class sf extends ef{constructor(t){super(),this._expr=t,this.expressionType="Constant"}_getValue(){return this._expr._getValue()}}class rf extends ef{constructor(t){super(),this._expr=t,this.expressionType="Field"}}class of{constructor(t,e,n){this.expr=t,this.direction=e,this._methodName=n,this._protoValueType="ProtoValue"}_toProto(t){return{mapValue:{fields:{direction:Sd(this.direction),expression:this.expr._toProto(t)}}}}_readUserData(t){this.expr._readUserData(t)}}class af{constructor(t){this.optionsProto=void 0,({rawOptions:this.rawOptions,...this.knownOptions}=t)}_readUserData(t){this.optionsProto=this._optionsUtil.getOptionsProto(t,this.knownOptions,this.rawOptions)}_toProto(t){return{name:this._name,options:this.optionsProto}}}class Bf extends af{get _name(){return"add_fields"}get _optionsUtil(){return new Up({})}constructor(t,e){super(e),this.fields=t}_toProto(t){return{...super._toProto(t),args:[Ad(t,this.fields)]}}_readUserData(t){super._readUserData(t),Ef(this.fields,t)}}class cf extends af{get _name(){return"aggregate"}get _optionsUtil(){return new Up({})}constructor(t,e,n){super(n),this.groups=t,this.accumulators=e}_toProto(t){return{...super._toProto(t),args:[Ad(t,this.accumulators),Ad(t,this.groups)]}}_readUserData(t){super._readUserData(t),Ef(this.groups,t),Ef(this.accumulators,t)}}class lf extends af{get _name(){return"distinct"}get _optionsUtil(){return new Up({})}constructor(t,e){super(e),this.groups=t}_toProto(t){return{...super._toProto(t),args:[Ad(t,this.groups)]}}_readUserData(t){super._readUserData(t),Ef(this.groups,t)}}class uf extends af{get _name(){return"collection"}get _optionsUtil(){return new Up({forceIndex:{serverName:"force_index"}})}constructor(t,e){super(e),this.hr=t.startsWith("/")?t:"/"+t}_toProto(t){return{...super._toProto(t),args:[{referenceValue:this.hr}]}}_readUserData(t){super._readUserData(t)}}class hf extends af{get _name(){return"collection_group"}get _optionsUtil(){return new Up({forceIndex:{serverName:"force_index"}})}constructor(t,e){super(e),this.collectionId=t}_toProto(t){return{...super._toProto(t),args:[{referenceValue:""},{stringValue:this.collectionId}]}}_readUserData(t){super._readUserData(t)}}class df extends af{get _name(){return"database"}get _optionsUtil(){return new Up({})}_toProto(t){return{...super._toProto(t)}}_readUserData(t){super._readUserData(t)}}class pf extends af{get _name(){return"documents"}get _optionsUtil(){return new Up({})}constructor(t,e){if(super(e),!t||0===t.length)throw new gl(Cl.INVALID_ARGUMENT,"Empty document paths are not allowed in DocumentsSource");const n=t.map(t=>t.startsWith("/")?t:"/"+t),s=new Set(n);if(s.size!==n.length)throw new gl(Cl.INVALID_ARGUMENT,"Duplicate document paths are not allowed in DocumentsSource");this.Tr=n,this.Pr=s}_toProto(t){return{...super._toProto(t),args:this.Tr.map(t=>({referenceValue:t}))}}_readUserData(t){super._readUserData(t)}}class ff extends af{get _name(){return"where"}get _optionsUtil(){return new Up({})}constructor(t,e){super(e),this.condition=t}_toProto(t){return{...super._toProto(t),args:[this.condition._toProto(t)]}}_readUserData(t){super._readUserData(t),Ef(this.condition,t)}}class Cf extends af{get _name(){return"limit"}get _optionsUtil(){return new Up({})}constructor(t,e){el(!isNaN(t)&&t!==1/0&&t!==-1/0,34860),super(e),this.limit=t}_toProto(t){return{...super._toProto(t),args:[xu(t,this.limit)]}}}class gf extends af{get _name(){return"offset"}get _optionsUtil(){return new Up({})}constructor(t,e){super(e),this.offset=t}_toProto(t){return{...super._toProto(t),args:[xu(t,this.offset)]}}}class mf extends af{get _name(){return"select"}get _optionsUtil(){return new Up({})}constructor(t,e){super(e),this.selections=t}_toProto(t){return{...super._toProto(t),args:[Ad(t,this.selections)]}}_readUserData(t){super._readUserData(t),Ef(this.selections,t)}}class wf extends af{get _name(){return"sort"}get _optionsUtil(){return new Up({})}constructor(t,e){super(e),this.orderings=t}_toProto(t){return{...super._toProto(t),args:this.orderings.map(e=>e._toProto(t))}}_readUserData(t){super._readUserData(t),Ef(this.orderings,t)}}class yf extends af{get _name(){return"replace_with"}get _optionsUtil(){return new Up({})}constructor(t,e){super(e),this.map=t}_toProto(t){return{...super._toProto(t),args:[this.map._toProto(t),Sd(yf.Ir)]}}_readUserData(t){super._readUserData(t),Ef(this.map,t)}}function Ef(t,e){return function(t){return"function"==typeof t._readUserData}(t)?t._readUserData(e):Array.isArray(t)||t instanceof Map?t.forEach(t=>t._readUserData(e)):Object.values(t).forEach(t=>t._readUserData(e)),t}yf.Ir="full_replace";class _f{constructor(t,e,n){this.serializer=t,this.stages=e,this.listenOptions=n,this.isCorePipeline=!0}getPipelineCollection(){return bf(this)}getPipelineCollectionGroup(){return vf(this)}getPipelineCollectionId(){return function(t){switch(Df(t)){case"collection":return yl.fromString(bf(t)).lastSegment();case"collection_group":return vf(t);default:return}}(this)}getPipelineDocuments(){return If(this)}getPipelineFlavor(){return function(t){let e="exact";return t.stages.forEach((n,s)=>{n._name!==lf.name&&n._name!==cf.name||(e="keyless"),n._name===mf.name&&"exact"===e&&(e="augmented"),n._name===Bf.name&&s<t.stages.length-1&&"exact"===e&&(e="augmented")}),e}(this)}getPipelineSourceType(){return Df(this)}}function Df(t){const e=t.stages[0];return e instanceof uf||e instanceof hf||e instanceof df||e instanceof pf?e._name:"unknown"}function bf(t){if("collection"===Df(t))return t.stages[0].hr}function vf(t){if("collection_group"===Df(t))return t.stages[0].collectionId}function If(t){if("documents"===Df(t))return t.stages[0].Tr}class Tf{constructor(t,e){this.type=t,this.value=e}static mr(){return new Tf("ERROR",void 0)}static pr(){return new Tf("UNSET",void 0)}static gr(){return new Tf("NULL",au)}static newValue(t){return Du(t)?new Tf("NULL",au):function(t){return!!t&&"booleanValue"in t}(t)?new Tf("BOOLEAN",t):wu(t)?new Tf("INT",t):yu(t)?new Tf("DOUBLE",t):function(t){return!!t&&"timestampValue"in t&&!!t.timestampValue}(t)?new Tf("TIMESTAMP",t):function(t){return!!t&&"stringValue"in t}(t)?new Tf("STRING",t):function(t){return!!t&&"bytesValue"in t}(t)?new Tf("BYTES",t):t.referenceValue?new Tf("REFERENCE",t):t.geoPointValue?new Tf("GEO_POINT",t):_u(t)?new Tf("ARRAY",t):Iu(t)?new Tf("VECTOR",t):vu(t)?new Tf("MAP",t):new Tf("ERROR",void 0)}yr(){return"ERROR"===this.type||"UNSET"===this.type}wr(){return"NULL"===this.type}}function Of(t){if(!t.yr())return t.value}function Af(t){return t instanceof ef?t._expr:t}function Sf(t){if((t=Af(t))instanceof Wp)return new Rf(t);if(t instanceof Yp)return new Nf(t);if(t instanceof Qp)return new xf(t);if(t instanceof tf){if("add"===t.name)return new Hf(t);if("subtract"===t.name)return new Uf(t);if("multiply"===t.name)return new Vf(t);if("divide"===t.name)return new jf(t);if("mod"===t.name)return new $f(t);if("and"===t.name)return new Jf(t);if("equal"===t.name)return new aC(t);if("not_equal"===t.name)return new BC(t);if("less_than"===t.name)return new cC(t);if("less_than_or_equal"===t.name)return new lC(t);if("greater_than"===t.name)return new uC(t);if("greater_than_or_equal"===t.name)return new hC(t);if("array_concat"===t.name)return new dC(t);if("array_reverse"===t.name)return new pC(t);if("array_contains"===t.name)return new fC(t);if("array_contains_all"===t.name)return new CC(t);if("array_contains_any"===t.name)return new gC(t);if("array_length"===t.name)return new mC(t);if("array_element"===t.name)return new wC(t);if("equal_any"===t.name)return new Qf(t);if("not_equal_any"===t.name)return new Wf(t);if("is_nan"===t.name)return new Yf(t);if("is_not_nan"===t.name)return new Xf(t);if("is_null"===t.name)return new Zf(t);if("is_not_null"===t.name)return new tC(t);if("is_error"===t.name)return new eC(t);if("exists"===t.name)return new nC(t);if("not"===t.name)return new qf(t);if("or"===t.name)return new zf(t);if("xor"===t.name)return new Kf(t);if("conditional"===t.name)return new sC(t);if("maximum"===t.name)return new rC(t);if("minimum"===t.name)return new iC(t);if("reverse"===t.name)return new yC(t);if("replace_first"===t.name)return new EC(t);if("replace_all"===t.name)return new _C(t);if("char_length"===t.name)return new DC(t);if("byte_length"===t.name)return new bC(t);if("like"===t.name)return new IC(t);if("regex_contains"===t.name)return new TC(t);if("regex_match"===t.name)return new OC(t);if("string_contains"===t.name)return new AC(t);if("starts_with"===t.name)return new SC(t);if("ends_with"===t.name)return new RC(t);if("to_lower"===t.name)return new NC(t);if("to_upper"===t.name)return new xC(t);if("trim"===t.name)return new kC(t);if("string_concat"===t.name)return new LC(t);if("map_get"===t.name)return new FC(t);if("cosine_distance"===t.name)return new MC(t);if("dot_product"===t.name)return new GC(t);if("euclidean_distance"===t.name)return new HC(t);if("vector_length"===t.name)return new UC(t);if("unix_micros_to_timestamp"===t.name)return new ng(t);if("timestamp_to_unix_micros"===t.name)return new og(t);if("unix_millis_to_timestamp"===t.name)return new sg(t);if("timestamp_to_unix_millis"===t.name)return new ag(t);if("unix_seconds_to_timestamp"===t.name)return new rg(t);if("timestamp_to_unix_seconds"===t.name)return new Bg(t);if("timestamp_add"===t.name)return new lg(t);if("timestamp_subtract"===t.name)return new ug(t)}throw new Error(`Unknown Expr : ${t}`)}class Rf{constructor(t){this.expr=t}evaluate(t,e){if(this.expr.fieldName===ml)return Tf.newValue({referenceValue:Ed(t.serializer,e.key)});if("__update_time__"===this.expr.fieldName)return Tf.newValue({timestampValue:gd(t.serializer,e.version)});if("__create_time__"===this.expr.fieldName)return Tf.newValue({timestampValue:gd(t.serializer,e.createTime)});const n=e.data.field(this.expr._fieldPath);return n?zl(n)?Tf.newValue(function(t,e){if("estimate"===t.serverTimestampBehavior)return{timestampValue:gd(t.serializer,xh.fromTimestamp(Ql(e)))};if("previous"===t.serverTimestampBehavior){const t=Kl(e);if(t)return t}return{nullValue:"NULL_VALUE"}}(t,n)):Tf.newValue(n):Tf.pr()}}class Nf{constructor(t){this.expr=t}evaluate(t,e){return Tf.newValue(this.expr._getValue())}}class xf{constructor(t){this.expr=t}evaluate(t,e){const n=this.expr.cr.map(n=>Sf(n).evaluate(t,e));return n.some(t=>t.yr())?Tf.mr():Tf.newValue({arrayValue:{values:n.map(t=>t.value)}})}}function kf(t){return yu(t)?Number(t.doubleValue):Number(t.integerValue)}function Lf(t){return BigInt(t.integerValue)}const Ff=BigInt("0x7fffffffffffffff"),Pf=-BigInt("0x8000000000000000");class Mf{constructor(t){this.expr=t}evaluate(t,e){el(this.expr.params.length>=2,24778);const n=Sf(this.expr.params[0]).evaluate(t,e),s=Sf(this.expr.params[1]).evaluate(t,e);let r=this.br(n,s);for(const n of this.expr.params.slice(2)){const s=Sf(n).evaluate(t,e);r=this.br(r,s)}return r}br(t,e){if(t.yr()||e.yr())return Tf.mr();if(t.wr()||e.wr())return Tf.gr();const n=t.value,s=e.value;if(!yu(n)&&!wu(n)||!yu(s)&&!wu(s))return Tf.mr();if(yu(n)||yu(s)){const t=this.Sr(n,s);return t?Tf.newValue(t):Tf.mr()}if(wu(n)&&wu(s)){const t=this.vr(n,s);return void 0===t?Tf.mr():"number"==typeof t?Tf.newValue({doubleValue:t}):t<Pf||t>Ff?Tf.mr():Tf.newValue({integerValue:`${t}`})}return Tf.mr()}}function Gf(t,e){return lu(t)!==lu(e)?"TYPE_MISMATCH":bu(t)||bu(e)?"NOT_EQ":Du(t)&&Du(e)?"EQ":Du(t)||Du(e)?"NULL":_u(t)&&_u(e)?function(t,e){if(t.values?.length!==e.values?.length)return"NOT_EQ";let n=!1;for(let s=0;s<(t.values?.length??0);s++){const r=t.values[s],i=e.values[s];switch(Gf(r,i)){case"EQ":break;case"NOT_EQ":case"TYPE_MISMATCH":return"NOT_EQ";case"NULL":n=!0;break;default:Zc(44609,{Dr:r,Cr:i})}}return n?"NULL":"EQ"}(t.arrayValue,e.arrayValue):Iu(t)&&Iu(e)||vu(t)&&vu(e)?function(t,e){const n=t.fields||{},s=e.fields||{};if(bl(n)!==bl(s))return"NOT_EQ";let r=!1;for(const t in n)if(n.hasOwnProperty(t)){if(void 0===s[t])return"NOT_EQ";switch(Gf(n[t],s[t])){case"NOT_EQ":case"TYPE_MISMATCH":return"NOT_EQ";case"NULL":r=!0}}return r?"NULL":"EQ"}(t.mapValue,e.mapValue):function(t,e){return uu(t,e,{u:!1,i:!0,o:!0})}(t,e)?"EQ":"NOT_EQ"}class Hf extends Mf{vr(t,e){return Lf(t)+Lf(e)}Sr(t,e){return{doubleValue:kf(t)+kf(e)}}}class Uf extends Mf{constructor(t){super(t),this.expr=t}vr(t,e){return Lf(t)-Lf(e)}Sr(t,e){return{doubleValue:kf(t)-kf(e)}}}class Vf extends Mf{constructor(t){super(t),this.expr=t}vr(t,e){return Lf(t)*Lf(e)}Sr(t,e){return{doubleValue:kf(t)*kf(e)}}}class jf extends Mf{constructor(t){super(t),this.expr=t}vr(t,e){const n=Lf(e);if(n!==BigInt(0))return Lf(t)/n}Sr(t,e){const n=kf(e);return 0===n?{doubleValue:eu(n)?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY}:{doubleValue:kf(t)/n}}}class $f extends Mf{constructor(t){super(t),this.expr=t}vr(t,e){const n=Lf(e);if(n!==BigInt(0))return Lf(t)%n}Sr(t,e){const n=kf(e);if(0!==n)return{doubleValue:kf(t)%n}}}class Jf{constructor(t){this.expr=t}evaluate(t,e){let n=!1,s=!1;for(const r of this.expr.params){const i=Sf(r).evaluate(t,e);switch(i.type){case"BOOLEAN":if(!i.value?.booleanValue)return Tf.newValue(cu);break;case"NULL":s=!0;break;default:n=!0}}return n?Tf.mr():s?Tf.gr():Tf.newValue(Bu)}}class qf{constructor(t){this.expr=t}evaluate(t,e){el(1===this.expr.params.length,9634);const n=Sf(this.expr.params[0]).evaluate(t,e);switch(n.type){case"BOOLEAN":return Tf.newValue({booleanValue:!n.value?.booleanValue});case"NULL":return Tf.gr();default:return Tf.mr()}}}class zf{constructor(t){this.expr=t}evaluate(t,e){let n=!1,s=!1;for(const r of this.expr.params){const i=Sf(r).evaluate(t,e);switch(i.type){case"BOOLEAN":if(i.value?.booleanValue)return Tf.newValue(Bu);break;case"NULL":s=!0;break;default:n=!0}}return n?Tf.mr():s?Tf.gr():Tf.newValue(cu)}}class Kf{constructor(t){this.expr=t}evaluate(t,e){let n=!1,s=!1;for(const r of this.expr.params){const i=Sf(r).evaluate(t,e);switch(i.type){case"BOOLEAN":n=Kf.xor(n,!!i.value?.booleanValue);break;case"NULL":s=!0;break;default:return Tf.mr()}}return s?Tf.gr():Tf.newValue({booleanValue:n})}static xor(t,e){return(t||e)&&!(t&&e)}}class Qf{constructor(t){this.expr=t}evaluate(t,e){el(2===this.expr.params.length,55094);let n=!1;const s=Sf(this.expr.params[0]).evaluate(t,e);switch(s.type){case"NULL":n=!0;break;case"ERROR":case"UNSET":return Tf.mr()}const r=Sf(this.expr.params[1]).evaluate(t,e);switch(r.type){case"ARRAY":break;case"NULL":n=!0;break;default:return Tf.mr()}if(n)return Tf.gr();for(const t of r.value?.arrayValue?.values??[])switch(Du(s.value)&&Du(t)?"EQ":Gf(s.value,t)){case"EQ":return Tf.newValue(Bu);case"NOT_EQ":case"TYPE_MISMATCH":break;case"NULL":n=!0;break;default:Zc(44608,{value:s.value,candidate:t})}return n?Tf.gr():Tf.newValue(cu)}}class Wf{constructor(t){this.expr=t}evaluate(t,e){return new qf(new tf("not",[new tf("equal_any",this.expr.params)])).evaluate(t,e)}}class Yf{constructor(t){this.expr=t}evaluate(t,e){el(1===this.expr.params.length,23322);const n=Sf(this.expr.params[0]).evaluate(t,e);switch(n.type){case"INT":return Tf.newValue(cu);case"DOUBLE":return Tf.newValue({booleanValue:isNaN(kf(n.value))});case"NULL":return Tf.gr();default:return Tf.mr()}}}class Xf{constructor(t){this.expr=t}evaluate(t,e){return el(1===this.expr.params.length,50406),new qf(new tf("not",[new tf("is_nan",this.expr.params)])).evaluate(t,e)}}class Zf{constructor(t){this.expr=t}evaluate(t,e){switch(el(1===this.expr.params.length,23123),Sf(this.expr.params[0]).evaluate(t,e).type){case"NULL":return Tf.newValue(Bu);case"UNSET":case"ERROR":return Tf.mr();default:return Tf.newValue(cu)}}}class tC{constructor(t){this.expr=t}evaluate(t,e){return el(1===this.expr.params.length,23167),new qf(new tf("not",[new tf("is_null",this.expr.params)])).evaluate(t,e)}}class eC{constructor(t){this.expr=t}evaluate(t,e){return el(1===this.expr.params.length,5228),"ERROR"===Sf(this.expr.params[0]).evaluate(t,e).type?Tf.newValue(Bu):Tf.newValue(cu)}}class nC{constructor(t){this.expr=t}evaluate(t,e){switch(el(1===this.expr.params.length,6877),Sf(this.expr.params[0]).evaluate(t,e).type){case"ERROR":return Tf.mr();case"UNSET":return Tf.newValue(cu);default:return Tf.newValue(Bu)}}}class sC{constructor(t){this.expr=t}evaluate(t,e){el(3===this.expr.params.length,11706);const n=Sf(this.expr.params[0]).evaluate(t,e);switch(n.type){case"BOOLEAN":return n.value?.booleanValue?Sf(this.expr.params[1]).evaluate(t,e):Sf(this.expr.params[2]).evaluate(t,e);case"NULL":return Sf(this.expr.params[2]).evaluate(t,e);default:return Tf.mr()}}}class rC{constructor(t){this.expr=t}evaluate(t,e){const n=this.expr.params.map(n=>Sf(n).evaluate(t,e));let s;for(const t of n)switch(t.type){case"ERROR":case"UNSET":case"NULL":continue;default:s=void 0===s||du(t.value,s.value)>0?t:s}return void 0===s?Tf.gr():s}}class iC{constructor(t){this.expr=t}evaluate(t,e){const n=this.expr.params.map(n=>Sf(n).evaluate(t,e));let s;for(const t of n)switch(t.type){case"ERROR":case"UNSET":case"NULL":continue;default:s=void 0===s||du(t.value,s.value)<0?t:s}return void 0===s?Tf.gr():s}}class oC{constructor(t){this.expr=t}evaluate(t,e){el(2===this.expr.params.length,31033,`${this.expr.name}() function should have exactly 2 params`);const n=Sf(this.expr.params[0]).evaluate(t,e);switch(n.type){case"ERROR":case"UNSET":return Tf.mr()}const s=Sf(this.expr.params[1]).evaluate(t,e);switch(s.type){case"ERROR":case"UNSET":return Tf.mr()}return this.Fr(n,s)}}class aC extends oC{constructor(t){super(t),this.expr=t}Fr(t,e){if(t.wr()&&e.wr())return Tf.newValue(Bu);if(t.wr()||e.wr())return Tf.newValue(cu);if(bu(t.value)||bu(e.value))return Tf.newValue(cu);if(lu(t.value)!==lu(e.value))return Tf.newValue(cu);switch(Gf(t.value,e.value)){case"EQ":return Tf.newValue(Bu);case"NOT_EQ":return Tf.newValue(cu);case"NULL":return Tf.gr();default:Zc(44615,{left:t,right:e})}}}class BC extends oC{constructor(t){super(t),this.expr=t}Fr(t,e){switch(Gf(t.value,e.value)){case"EQ":return Tf.newValue(cu);case"NOT_EQ":case"TYPE_MISMATCH":return Tf.newValue(Bu);case"NULL":return Tf.gr();default:Zc(44614,{left:t,right:e})}}}class cC extends oC{constructor(t){super(t),this.expr=t}Fr(t,e){return lu(t.value)!==lu(e.value)||bu(t.value)||bu(e.value)?Tf.newValue(cu):Tf.newValue({booleanValue:du(t.value,e.value)<0})}}class lC extends oC{constructor(t){super(t),this.expr=t}Fr(t,e){return lu(t.value)!==lu(e.value)||bu(t.value)||bu(e.value)?Tf.newValue(cu):"EQ"===Gf(t.value,e.value)?Tf.newValue(Bu):Tf.newValue({booleanValue:du(t.value,e.value)<0})}}class uC extends oC{constructor(t){super(t),this.expr=t}Fr(t,e){return lu(t.value)!==lu(e.value)||bu(t.value)||bu(e.value)?Tf.newValue(cu):Tf.newValue({booleanValue:du(t.value,e.value)>0})}}class hC extends oC{constructor(t){super(t),this.expr=t}Fr(t,e){return lu(t.value)!==lu(e.value)||bu(t.value)||bu(e.value)?Tf.newValue(cu):"EQ"===Gf(t.value,e.value)?Tf.newValue(Bu):Tf.newValue({booleanValue:du(t.value,e.value)>0})}}class dC{constructor(t){this.expr=t}evaluate(t,e){throw new Error("Unimplemented")}}class pC{constructor(t){this.expr=t}evaluate(t,e){el(1===this.expr.params.length,216);const n=Sf(this.expr.params[0]).evaluate(t,e);switch(n.type){case"NULL":return Tf.gr();case"ARRAY":{const t=n.value.arrayValue?.values??[];return Tf.newValue({arrayValue:{values:[...t].reverse()}})}default:return Tf.mr()}}}class fC{constructor(t){this.expr=t}evaluate(t,e){return el(2===this.expr.params.length,52884),new Qf(new tf("eq_any",[this.expr.params[1],this.expr.params[0]])).evaluate(t,e)}}class CC{constructor(t){this.expr=t}evaluate(t,e){el(2===this.expr.params.length,1392);let n=!1;const s=Sf(this.expr.params[0]).evaluate(t,e);switch(s.type){case"ARRAY":break;case"NULL":n=!0;break;default:return Tf.mr()}const r=Sf(this.expr.params[1]).evaluate(t,e);switch(r.type){case"ARRAY":break;case"NULL":n=!0;break;default:return Tf.mr()}if(n)return Tf.gr();const i=r.value?.arrayValue?.values??[],o=s.value?.arrayValue?.values??[];for(const t of i){let e=!1;n=!1;for(const s of o){switch(Du(t)&&Du(s)?"EQ":Gf(t,s)){case"EQ":e=!0;break;case"NOT_EQ":case"TYPE_MISMATCH":break;case"NULL":n=!0;break;default:Zc(44613,{value:s,search:t})}if(e)break}if(!e)return Tf.newValue(cu)}return Tf.newValue(Bu)}}class gC{constructor(t){this.expr=t}evaluate(t,e){el(2===this.expr.params.length,2680);let n=!1;const s=Sf(this.expr.params[0]).evaluate(t,e);switch(s.type){case"ARRAY":break;case"NULL":n=!0;break;default:return Tf.mr()}const r=Sf(this.expr.params[1]).evaluate(t,e);switch(r.type){case"ARRAY":break;case"NULL":n=!0;break;default:return Tf.mr()}if(n)return Tf.gr();const i=r.value?.arrayValue?.values??[],o=s.value?.arrayValue?.values??[];for(const t of o)for(const e of i)switch(Du(t)&&Du(e)?"EQ":Gf(t,e)){case"EQ":return Tf.newValue(Bu);case"NOT_EQ":case"TYPE_MISMATCH":break;case"NULL":n=!0;break;default:Zc(60403,{value:t,search:e})}return n?Tf.gr():Tf.newValue(cu)}}class mC{constructor(t){this.expr=t}evaluate(t,e){el(1===this.expr.params.length,38605);const n=Sf(this.expr.params[0]).evaluate(t,e);switch(n.type){case"NULL":return Tf.gr();case"ARRAY":return Tf.newValue({integerValue:`${n.value?.arrayValue?.values?.length??0}`});default:return Tf.mr()}}}class wC{constructor(t){this.expr=t}evaluate(t,e){throw new Error("Unimplemented")}}class yC{constructor(t){this.expr=t}evaluate(t,e){el(1===this.expr.params.length,1508);const n=Sf(this.expr.params[0]).evaluate(t,e);switch(n.type){case"NULL":return Tf.gr();case"BYTES":{const t=n.value?.bytesValue;if("string"==typeof t){const e=Ml.fromBase64String(t).toUint8Array();return e.reverse(),Tf.newValue({bytesValue:Ml.fromUint8Array(e).toBase64()})}return Tf.newValue({bytesValue:new Uint8Array(t).reverse()})}case"STRING":{const t=n.value?.stringValue,e=new Intl.__PRIVATE_Segmenter(void 0,{granularity:"grapheme"}).segment(t),s=Array.from(e,t=>t.segment).reverse();return Tf.newValue({stringValue:s.join("")})}default:return Tf.mr()}}}class EC{constructor(t){this.expr=t}evaluate(t,e){throw new Error("Unimplemented")}}class _C{constructor(t){this.expr=t}evaluate(t,e){throw new Error("Unimplemented")}}class DC{constructor(t){this.expr=t}evaluate(t,e){el(1===this.expr.params.length,19400);const n=Sf(this.expr.params[0]).evaluate(t,e);switch(n.type){case"NULL":return Tf.gr();case"STRING":{const t=function(t){let e=0;for(let n=0;n<t.length;n++){const s=t.codePointAt(n);if(void 0===s)return;if(s<=65535)if(s>=55296&&s<=57343)if(s<=56319){const s=t.codePointAt(n+1);void 0!==s&&s>=56320&&s<=57343?(e+=1,n++):e+=1}else e+=1;else e+=1;else{if(!(s<=1114111))return;e+=1,n++}}return e}(n.value.stringValue);return void 0===t?Tf.mr():Tf.newValue({integerValue:t})}default:return Tf.mr()}}}class bC{constructor(t){this.expr=t}evaluate(t,e){el(1===this.expr.params.length,8486);const n=Sf(this.expr.params[0]).evaluate(t,e);switch(n.type){case"BYTES":{const t=n.value?.bytesValue;return"string"==typeof t?Tf.newValue({integerValue:Ml.fromBase64String(t).toUint8Array().length}):Tf.newValue({integerValue:new Uint8Array(t).length})}case"STRING":{const t=function(t){let e=0;for(let n=0;n<t.length;n++){const s=t.codePointAt(n);if(void 0===s)return;if(s>=55296&&s<=57343){if(!(s<=56319))return;{const s=t.codePointAt(n+1);if(void 0===s||!(s>=56320&&s<=57343))return;e+=4,n++}}else if(s<=127)e+=1;else if(s<=2047)e+=2;else if(s<=65535)e+=3;else{if(!(s<=1114111))return;e+=4,n++}}return e}(n.value?.stringValue);return void 0===t?Tf.mr():Tf.newValue({integerValue:t})}case"NULL":return Tf.gr();default:return Tf.mr()}}}class vC{constructor(t){this.expr=t}evaluate(t,e){el(2===this.expr.params.length,39773,`${this.expr.name}() function should have exactly two parameters`);let n=!1;const s=Sf(this.expr.params[0]).evaluate(t,e);switch(s.type){case"STRING":break;case"NULL":n=!0;break;default:return Tf.mr()}const r=Sf(this.expr.params[1]).evaluate(t,e);switch(r.type){case"STRING":break;case"NULL":n=!0;break;default:return Tf.mr()}return n?Tf.gr():this.Or(s.value?.stringValue,r.value?.stringValue)}}class IC extends vC{Or(t,e){try{const n=function(t){let e="";for(let n=0;n<t.length;n++){const s=t.charAt(n);switch(s){case"_":e+=".";break;case"%":e+=".*";break;case"\\":case".":case"*":case"?":case"+":case"^":case"$":case"|":case"(":case")":case"[":case"]":case"{":case"}":e+="\\"+s;break;default:e+=s}}return"^"+e+"$"}(e),s=Jc.compile(n);return Tf.newValue({booleanValue:s.matches(t)})}catch(t){return Yc(`Invalid LIKE pattern converted to regex: ${e}, returning error. Error: ${t}`),Tf.mr()}}}class TC extends vC{Or(t,e){try{const n=Jc.compile(e);return Tf.newValue({booleanValue:n.test(t)})}catch(t){return Yc(`Invalid regex pattern found in regex_contains: ${e}, returning error`),Tf.mr()}}}class OC extends vC{Or(t,e){try{return Tf.newValue({booleanValue:Jc.compile(e).matches(t)})}catch(t){return Yc(`Invalid regex pattern found in regex_match: ${e}, returning error`),Tf.mr()}}}class AC extends vC{Or(t,e){return Tf.newValue({booleanValue:t.includes(e)})}}class SC extends vC{Or(t,e){return Tf.newValue({booleanValue:t.startsWith(e)})}}class RC extends vC{Or(t,e){return Tf.newValue({booleanValue:t.endsWith(e)})}}class NC{constructor(t){this.expr=t}evaluate(t,e){el(1===this.expr.params.length,29079);const n=Sf(this.expr.params[0]).evaluate(t,e);switch(n.type){case"STRING":return Tf.newValue({stringValue:n.value?.stringValue?.toLowerCase()});case"NULL":return Tf.gr();default:return Tf.mr()}}}class xC{constructor(t){this.expr=t}evaluate(t,e){el(1===this.expr.params.length,60487);const n=Sf(this.expr.params[0]).evaluate(t,e);switch(n.type){case"STRING":return Tf.newValue({stringValue:n.value?.stringValue?.toUpperCase()});case"NULL":return Tf.gr();default:return Tf.mr()}}}class kC{constructor(t){this.expr=t}evaluate(t,e){el(1===this.expr.params.length,28544);const n=Sf(this.expr.params[0]).evaluate(t,e);switch(n.type){case"STRING":return Tf.newValue({stringValue:n.value?.stringValue?.trim()});case"NULL":return Tf.gr();default:return Tf.mr()}}}class LC{constructor(t){this.expr=t}evaluate(t,e){const n=this.expr.params.map(n=>Sf(n).evaluate(t,e));let s="",r=!1;for(const t of n)switch(t.type){case"STRING":s+=t.value.stringValue;break;case"NULL":r=!0;break;default:return Tf.mr()}return r?Tf.gr():Tf.newValue({stringValue:s})}}class FC{constructor(t){this.expr=t}evaluate(t,e){el(2===this.expr.params.length,4483);const n=Sf(this.expr.params[0]).evaluate(t,e);switch(n.type){case"UNSET":return Tf.pr();case"MAP":break;default:return Tf.mr()}const s=Sf(this.expr.params[1]).evaluate(t,e);if("STRING"!==s.type)return Tf.mr();const r=n.value?.mapValue?.fields?.[s.value?.stringValue];return void 0===r?Tf.pr():Tf.newValue(r)}}class PC{constructor(t){this.expr=t}evaluate(t,e){el(2===this.expr.params.length,25231,`${this.expr.name}() function should have exactly 2 params`);let n=!1;const s=Sf(this.expr.params[0]).evaluate(t,e);switch(s.type){case"VECTOR":break;case"NULL":n=!0;break;default:return Tf.mr()}const r=Sf(this.expr.params[1]).evaluate(t,e);switch(r.type){case"VECTOR":break;case"NULL":n=!0;break;default:return Tf.mr()}if(n)return Tf.gr();const i=Tu(s.value),o=Tu(r.value);if(void 0===i||void 0===o||i.values?.length!==o.values?.length)return Tf.mr();const a=this.Mr(i,o);return void 0===a||isNaN(a)?Tf.mr():Tf.newValue({doubleValue:a})}}class MC extends PC{Mr(t,e){const n=t?.values??[],s=e?.values??[];if(0===n.length)return;let r=0,i=0,o=0;for(let t=0;t<n.length;t++){if(!Eu(n[t])||!Eu(s[t]))return;const e=kf(n[t]),a=kf(s[t]);r+=e*a,i+=e*e,o+=a*a}const a=Math.sqrt(i)*Math.sqrt(o);return 0!==a?1-Math.max(-1,Math.min(1,r/a)):void 0}}class GC extends PC{Mr(t,e){const n=t?.values??[],s=e?.values??[];if(0===n.length)return 0;let r=0;for(let t=0;t<n.length;t++){if(!Eu(n[t])||!Eu(s[t]))return;r+=kf(n[t])*kf(s[t])}return r}}class HC extends PC{Mr(t,e){const n=t?.values??[],s=e?.values??[];if(0===n.length)return 0;let r=0;for(let t=0;t<n.length;t++){if(!Eu(n[t])||!Eu(s[t]))return;const e=kf(n[t]),i=kf(s[t]);r+=Math.pow(e-i,2)}return Math.sqrt(r)}}class UC{constructor(t){this.expr=t}evaluate(t,e){el(1===this.expr.params.length,39044);const n=Sf(this.expr.params[0]).evaluate(t,e);switch(n.type){case"VECTOR":{const t=Tu(n.value);return Tf.newValue({integerValue:t?.values?.length??0})}case"NULL":return Tf.gr();default:return Tf.mr()}}}const VC=BigInt(-62135596800),jC=BigInt(253402300799),$C=BigInt(1e3),JC=BigInt(1e6),qC=VC*$C,zC=jC*$C+BigInt(999),KC=VC*JC,QC=jC*JC+BigInt(999999);function WC(t){return t>=KC&&t<=QC}function YC(t){return t>=VC&&t<=jC}function XC(t,e){const n=BigInt(t);return!(n<VC||n>jC||e<0||e>=1e9||n===VC&&0!==e||n===jC&&e>999999999)}function ZC(t,e){return e<0?{seconds:t-1,nanos:e+1e9}:{seconds:t,nanos:e}}function tg(t){return BigInt(t.seconds)*JC+BigInt(Math.trunc(t.nanoseconds/1e3))}class eg{constructor(t){this.expr=t}evaluate(t,e){el(1===this.expr.params.length,49262,`${this.expr.name}() function should have exactly one parameter`);const n=Sf(this.expr.params[0]).evaluate(t,e);switch(n.type){case"INT":return this.toTimestamp(BigInt(n.value.integerValue));case"NULL":return Tf.gr();default:return Tf.mr()}}}class ng extends eg{toTimestamp(t){if(!WC(t))return Tf.mr();let e=Number(t/JC),n=Number(t%JC*BigInt(1e3));const s=ZC(e,n);return e=s.seconds,n=s.nanos,XC(e,n)?Tf.newValue({timestampValue:{seconds:e,nanos:n}}):Tf.mr()}}class sg extends eg{toTimestamp(t){if(!function(t){return t>=qC&&t<=zC}(t))return Tf.mr();let e=Number(t/$C),n=Number(t%$C*BigInt(1e6));const s=ZC(e,n);return e=s.seconds,n=s.nanos,XC(e,n)?Tf.newValue({timestampValue:{seconds:e,nanos:n}}):Tf.mr()}}class rg extends eg{toTimestamp(t){if(!YC(t))return Tf.mr();const e=Number(t);return Tf.newValue({timestampValue:{seconds:e,nanos:0}})}}class ig{constructor(t){this.expr=t}evaluate(t,e){el(1===this.expr.params.length,1265,`${this.expr.name}() function should have exactly one parameter`);const n=Sf(this.expr.params[0]).evaluate(t,e);switch(n.type){case"TIMESTAMP":break;case"NULL":return Tf.gr();default:return Tf.mr()}const s=fd(n.value.timestampValue);return XC(s.seconds,s.nanoseconds)?this.Nr(s):Tf.mr()}}class og extends ig{Nr(t){const e=tg(t);return WC(e)?Tf.newValue({integerValue:`${e.toString()}`}):Tf.mr()}}class ag extends ig{Nr(t){const e=tg(t),n=e/BigInt(1e3),s=e%BigInt(1e3);return n>BigInt(0)||s===BigInt(0)?Tf.newValue({integerValue:n.toString()}):Tf.newValue({integerValue:(n-BigInt(1)).toString()})}}class Bg extends ig{Nr(t){const e=BigInt(t.seconds);return YC(e)?Tf.newValue({integerValue:e.toString()}):Tf.mr()}}class cg{constructor(t){this.expr=t}evaluate(t,e){el(3===this.expr.params.length,2775,`${this.expr.name}() function should have exactly 3 parameters`);let n=!1;const s=Sf(this.expr.params[0]).evaluate(t,e);switch(s.type){case"TIMESTAMP":break;case"NULL":n=!0;break;default:return Tf.mr()}const r=Sf(this.expr.params[1]).evaluate(t,e);let i;switch(r.type){case"STRING":if(i=function(t){switch(t){case"microsecond":return"microsecond";case"millisecond":return"millisecond";case"second":return"second";case"minute":return"minute";case"hour":return"hour";case"day":return"day";default:return}}(r.value.stringValue),void 0===i)return Tf.mr();break;case"NULL":n=!0;break;default:return Tf.mr()}const o=Sf(this.expr.params[2]).evaluate(t,e);switch(o.type){case"INT":break;case"NULL":n=!0;break;default:return Tf.mr()}if(n)return Tf.gr();const a=BigInt(o.value.integerValue);let B;try{switch(i){case"microsecond":B=a;break;case"millisecond":B=a*BigInt(1e3);break;case"second":B=a*BigInt(1e6);break;case"minute":B=a*BigInt(6e7);break;case"hour":B=a*BigInt(36e8);break;case"day":B=a*BigInt(864e8);break;default:return Tf.mr()}if("microsecond"!==i&&a!==BigInt(0)&&B/a!==BigInt(this.Lr(i)))return Tf.mr()}catch(t){return Yc(`Error during timestamp arithmetic: ${t}`),Tf.mr()}const c=fd(s.value.timestampValue);if(!XC(c.seconds,c.nanoseconds))return Tf.mr();const l=tg(c),u=this.Br(l,B);if(!WC(u))return Tf.mr();const h=Number(u/JC),d=u%JC,p=Number((d<0?d+JC:d)*BigInt(1e3)),f=d<0?h-1:h;return XC(f,p)?Tf.newValue({timestampValue:{seconds:f,nanos:p}}):Tf.mr()}Lr(t){switch(t){case"millisecond":return 1e3;case"second":return 1e6;case"minute":return 6e7;case"hour":return 36e8;case"day":return 864e8;default:return 1}}}class lg extends cg{Br(t,e){return t+e}}class ug extends cg{Br(t,e){return t-e}}function hg(t){if((t=Af(t))instanceof Wp)return`fld(${t.fieldName})`;if(t instanceof Yp)return`cst(${function(t){return null===t?"null":"number"==typeof t?t.toString():"string"==typeof t?`"${t}"`:t instanceof Rp?`ref(${t.path})`:t instanceof kp?`vec(${JSON.stringify(t)})`:JSON.stringify(t)}(t.value)})`;if(t instanceof tf)return`fn(${t.name},[${t.params.map(hg).join(",")}])`;if("ListOfExpressions"===t.expressionType)return`list([${t.cr.map(hg).join(",")}])`;throw new Error(`Unrecognized expr ${JSON.stringify(t,null,2)}`)}function dg(t){return`${Array.from(t.entries()).sort().map(([t,e])=>`${t}=${hg(e)}`).join(",")}`}function pg(t){return t.stages.map(t=>function(t){if(t instanceof Bf)return`${t._name}(${dg(t.fields)})`;if(t instanceof cf){let e=`${t._name}(${dg(t.accumulators)})`;return t.groups.size>0&&(e+=`grouping(${dg(t.groups)})`),e}if(t instanceof lf)return`${t._name}(${dg(t.groups)})`;if(t instanceof uf)return`${t._name}(${t.hr})`;if(t instanceof hf)return`${t._name}(${t.collectionId})`;if(t instanceof df)return`${t._name}()`;if(t instanceof pf)return`${t._name}(${t.Tr.sort()})`;if(t instanceof ff)return`${t._name}(${hg(t.condition)})`;if(t instanceof Cf)return`${t._name}(${t.limit})`;if(t instanceof wf)return`${t._name}(${function(t){return t.map(t=>`${hg(t.expr)}${t.direction}`).join(",")}(t.orderings)})`;throw new Error(`Unrecognized stage ${t._name}`)}(t)).join("|")}function fg(t,e){return pg(t)===pg(e)}function Cg(t){return t instanceof _f}function gg(t){return Cg(t)?pg(t):zh(t)}function mg(t){return Cg(t)?pg(t):function(t){return`${Hh(Jh(t))}|lt:${t.limitType}`}(t)}function wg(t,e){return t instanceof _f&&e instanceof _f?fg(t,e):!(t instanceof _f&&!(e instanceof _f)||!(t instanceof _f)&&e instanceof _f)&&function(t,e){return Uh(Jh(t),Jh(e))&&t.limitType===e.limitType}(t,e)}function yg(t){return function(t){return!!t.isCorePipeline}(t)?pg(t):Hh(t)}function Eg(t,e){return t instanceof _f&&e instanceof _f?fg(t,e):!(t instanceof _f&&!(e instanceof _f)||!(t instanceof _f)&&e instanceof _f)&&Uh(t,e)}class _g{constructor(t,e,n,s){this.batchId=t,this.localWriteTime=e,this.baseMutations=n,this.mutations=s}applyToRemoteDocument(t,e){const n=e.mutationResults;for(let e=0;e<this.mutations.length;e++){const s=this.mutations[e];s.key.isEqual(t.key)&&eh(s,t,n[e])}}applyToLocalView(t,e){for(const n of this.baseMutations)n.key.isEqual(t.key)&&(e=nh(n,t,e,this.localWriteTime));for(const n of this.mutations)n.key.isEqual(t.key)&&(e=nh(n,t,e,this.localWriteTime));return e}applyToLocalDocumentSet(t,e){const n=ad();return this.mutations.forEach(s=>{const r=t.get(s.key),i=r.overlayedDocument;let o=this.applyToLocalView(i,r.mutatedFields);o=e.has(s.key)?null:o;const a=th(i,o);null!==a&&n.set(s.key,a),i.isValidDocument()||i.convertToNoDocument(xh.min())}),n}keys(){return this.mutations.reduce((t,e)=>t.add(e.key),ud())}isEqual(t){return this.batchId===t.batchId&&ll(this.mutations,t.mutations,(t,e)=>rh(t,e))&&ll(this.baseMutations,t.baseMutations,(t,e)=>rh(t,e))}}class Dg{constructor(t,e,n,s){this.batch=t,this.commitVersion=e,this.mutationResults=n,this.docVersions=s}static from(t,e,n){el(t.mutations.length===n.length,58842,{Ur:t.mutations.length,kr:n.length});let s=cd;const r=t.mutations;for(let t=0;t<r.length;t++)s=s.insert(r[t].key,n[t].version);return new Dg(t,e,n,s)}}function bg(t,e){let n=e;const s=t.length;for(let e=0;e<s;e++){const s=t.charAt(e);switch(s){case"\0":n+="";break;case"":n+="";break;default:n+=s}}return n}function vg(t){return t+""}class Ig{constructor(t,e){this.largestBatchId=t,this.mutation=e}getKey(){return this.mutation.key}isEqual(t){return null!==t&&this.mutation===t.mutation}toString(){return`Overlay{\n largestBatchId: ${this.largestBatchId},\n mutation: ${this.mutation.toString()}\n }`}}class Tg{constructor(t){this.$r=t}}function Og(t){const e=bd({parent:t.parent,structuredQuery:t.structuredQuery});return"LAST"===t.limitType?qh(e,e.limit,"L"):e}class Ag{constructor(){this.Zi=new Sg}addToCollectionParentIndex(t,e){return this.Zi.add(e),mp.resolve()}getCollectionParents(t,e){return mp.resolve(this.Zi.getEntries(e))}addFieldIndex(t,e){return mp.resolve()}deleteFieldIndex(t,e){return mp.resolve()}deleteAllFieldIndexes(t){return mp.resolve()}createTargetIndexes(t,e){return mp.resolve()}getDocumentsMatchingTarget(t,e){return mp.resolve(null)}getIndexType(t,e){return mp.resolve(0)}getFieldIndexes(t,e){return mp.resolve([])}getNextCollectionGroupToUpdate(t){return mp.resolve(null)}getMinOffset(t,e){return mp.resolve(Fh.min())}getMinOffsetFromCollectionGroup(t,e){return mp.resolve(Fh.min())}updateCollectionGroup(t,e,n){return mp.resolve()}updateIndexEntries(t,e){return mp.resolve()}}class Sg{constructor(){this.index={}}add(t){const e=t.lastSegment(),n=t.popLast(),s=this.index[e]||new pl(yl.comparator),r=!s.has(n);return this.index[e]=s.add(n),r}has(t){const e=t.lastSegment(),n=t.popLast(),s=this.index[e];return s&&s.has(n)}getEntries(t){return(this.index[t]||new pl(yl.comparator)).toArray()}}class Rg{constructor(t){this.ys=t}next(){return this.ys+=2,this.ys}static ws(){return new Rg(0)}static bs(){return new Rg(-1)}}function Ng(t,e){return function(t,e){let n=e;for(const e of t.stages)n=xg({serializer:t.serializer,serverTimestampBehavior:t.listenOptions?.serverTimestampBehavior},e,n);return n}(t,[e]).length>0}function xg(t,e,n){if(e instanceof uf)return function(t,e,n){return n.filter(t=>t.isFoundDocument()&&`/${t.key.getCollectionPath().canonicalString()}`===e.hr)}(0,e,n);if(e instanceof ff)return function(t,e,n){return n.filter(n=>{const s=Of(Sf(e.condition).evaluate(t,n));return void 0!==s&&uu(s,Bu)})}(t,e,n);if(e instanceof hf)return function(t,e,n){return n.filter(t=>t.isFoundDocument()&&t.key.getCollectionPath().lastSegment()===e.collectionId)}(0,e,n);if(e instanceof df)return function(t,e,n){return n.filter(t=>t.isFoundDocument())}(0,0,n);if(e instanceof pf)return function(t,e,n){return n.filter(t=>t.isFoundDocument()&&e.Pr.has(t.key.path.toStringWithLeadingSlash()))}(0,e,n);if(e instanceof Cf)return function(t,e,n){return n.slice(0,e.limit)}(0,e,n);if(e instanceof wf)return function(t,e,n){const s=e.orderings.map(t=>({Ms:Sf(t.expr),direction:t.direction}));return[...n].sort((e,n)=>{for(const{Ms:r,direction:i}of s){const s=Of(r.evaluate(t,e)),o=Of(r.evaluate(t,n)),a=du(s??au,o??au);if(0!==a)return"ascending"===i?a:-a}return 0})}(t,e,n);throw new Error(`Unknown stage: ${e._name}`)}class kg{constructor(){this.changes=new td(t=>t.toString(),(t,e)=>t.isEqual(e)),this.changesApplied=!1}addEntry(t){this.assertNotApplied(),this.changes.set(t.key,t)}removeEntry(t,e){this.assertNotApplied(),this.changes.set(t,kh.newInvalidDocument(t).setReadTime(e))}getEntry(t,e){this.assertNotApplied();const n=this.changes.get(e);return void 0!==n?mp.resolve(n):this.getFromCache(t,e)}getEntries(t,e){return this.getAllFromCache(t,e)}apply(t){return this.assertNotApplied(),this.changesApplied=!0,this.applyChanges(t)}assertNotApplied(){}}class Lg{constructor(t,e){this.overlayedDocument=t,this.mutatedFields=e}}class Fg{constructor(t,e,n,s){this.remoteDocumentCache=t,this.mutationQueue=e,this.documentOverlayCache=n,this.indexManager=s}getDocument(t,e){let n=null;return this.documentOverlayCache.getOverlay(t,e).next(s=>(n=s,this.remoteDocumentCache.getEntry(t,e))).next(t=>(null!==n&&nh(n.mutation,t,Dl.empty(),Fl.now()),t))}getDocuments(t,e){return this.remoteDocumentCache.getEntries(t,e).next(e=>this.getLocalViewOfDocuments(t,e,ud()).next(()=>e))}getLocalViewOfDocuments(t,e,n=ud()){const s=od();return this.populateOverlays(t,s,e).next(()=>this.computeViews(t,e,s,n).next(t=>{let e=rd();return t.forEach((t,n)=>{e=e.insert(t,n.overlayedDocument)}),e}))}getOverlayedDocuments(t,e){const n=od();return this.populateOverlays(t,n,e).next(()=>this.computeViews(t,e,n,ud()))}populateOverlays(t,e,n){const s=[];return n.forEach(t=>{e.has(t)||s.push(t)}),this.documentOverlayCache.getOverlays(t,s).next(t=>{t.forEach((t,n)=>{e.set(t,n)})})}computeViews(t,e,n,s){let r=nd();const i=Bd(),o=Bd();return e.forEach((t,e)=>{const o=n.get(e.key);s.has(e.key)&&(void 0===o||o.mutation instanceof oh)?r=r.insert(e.key,e):void 0!==o?(i.set(e.key,o.mutation.getFieldMask()),nh(o.mutation,e,o.mutation.getFieldMask(),Fl.now())):i.set(e.key,Dl.empty())}),this.recalculateAndSaveOverlays(t,r).next(t=>(t.forEach((t,e)=>i.set(t,e)),e.forEach((t,e)=>o.set(t,new Lg(e,i.get(t)??null))),o))}recalculateAndSaveOverlays(t,e){const n=Bd();let s=new ul((t,e)=>t-e),r=ud();return this.mutationQueue.getAllMutationBatchesAffectingDocumentKeys(t,e).next(t=>{for(const r of t)r.keys().forEach(t=>{const i=e.get(t);if(null===i)return;let o=n.get(t)||Dl.empty();o=r.applyToLocalView(i,o),n.set(t,o);const a=(s.get(r.batchId)||ud()).add(t);s=s.insert(r.batchId,a)})}).next(()=>{const i=[],o=s.getReverseIterator();for(;o.hasNext();){const s=o.getNext(),a=s.key,B=s.value,c=ad();B.forEach(t=>{if(!r.has(t)){const s=th(e.get(t),n.get(t));null!==s&&c.set(t,s),r=r.add(t)}}),i.push(this.documentOverlayCache.saveOverlays(t,a,c))}return mp.waitFor(i)}).next(()=>n)}recalculateAndSaveOverlaysForDocumentKeys(t,e){return this.remoteDocumentCache.getEntries(t,e).next(e=>this.recalculateAndSaveOverlays(t,e))}getDocumentsMatchingQuery(t,e,n,s){return Cg(e)?this.getDocumentsMatchingPipeline(t,e,n,s):function(t){return Tl.isDocumentKey(t.path)&&null===t.collectionGroup&&0===t.filters.length}(e)?this.getDocumentsMatchingDocumentQuery(t,e.path):function(t){return null!==t.collectionGroup}(e)?this.getDocumentsMatchingCollectionGroupQuery(t,e,n,s):this.getDocumentsMatchingCollectionQuery(t,e,n,s)}getNextDocuments(t,e,n,s){return this.remoteDocumentCache.getAllFromCollectionGroup(t,e,n,s).next(r=>{const i=s-r.size>0?this.documentOverlayCache.getOverlaysForCollectionGroup(t,e,n.largestBatchId,s-r.size):mp.resolve(od());let o=-1,a=r;return i.next(e=>mp.forEach(e,(e,n)=>(o<n.largestBatchId&&(o=n.largestBatchId),r.get(e)?mp.resolve():this.remoteDocumentCache.getEntry(t,e).next(t=>{a=a.insert(e,t)}))).next(()=>this.populateOverlays(t,e,r)).next(()=>this.computeViews(t,a,e,ud())).next(t=>({batchId:o,changes:id(t)})))})}getDocumentsMatchingDocumentQuery(t,e){return this.getDocument(t,new Tl(e)).next(t=>{let e=rd();return t.isFoundDocument()&&(e=e.insert(t.key,t)),e})}getDocumentsMatchingCollectionGroupQuery(t,e,n,s){const r=e.collectionGroup;let i=rd();return this.indexManager.getCollectionParents(t,r).next(o=>mp.forEach(o,o=>{const a=function(t,e){return new Vh(e,null,t.explicitOrderBy.slice(),t.filters.slice(),t.limit,t.limitType,t.startAt,t.endAt)}(e,o.child(r));return this.getDocumentsMatchingCollectionQuery(t,a,n,s).next(t=>{t.forEach((t,e)=>{i=i.insert(t,e)})})}).next(()=>i))}getDocumentsMatchingCollectionQuery(t,e,n,s){let r;return this.documentOverlayCache.getOverlaysForCollection(t,e.path,n.largestBatchId).next(i=>(r=i,this.remoteDocumentCache.getDocumentsMatchingQuery(t,e,n,r,s))).next(t=>this.retrieveMatchingLocalDocuments(r,t,t=>Kh(e,t)))}getDocumentsMatchingPipeline(t,e,n,s){if("collection_group"===Df(e)){const r=vf(e);let i=rd();return this.indexManager.getCollectionParents(t,r).next(o=>mp.forEach(o,o=>{const a=function(t,e){const n=t.stages.map(t=>t instanceof hf?new uf(e.canonicalString(),{}):t);return new _f(t.serializer,n)}(e,o.child(r));return this.getDocumentsMatchingPipeline(t,a,n,s).next(t=>{t.forEach((t,e)=>{i=i.insert(t,e)})})}).next(()=>i))}{let r;return this.getOverlaysForPipeline(t,e,n.largestBatchId).next(i=>{switch(r=i,Df(e)){case"collection":return this.remoteDocumentCache.getDocumentsMatchingQuery(t,e,n,r,s);case"documents":let i=ud();for(const t of If(e))i=i.add(Tl.fromPath(t));return this.remoteDocumentCache.getEntries(t,i);case"database":return this.remoteDocumentCache.getAllEntries(t);default:throw new gl("invalid-argument",`Invalid pipeline source to execute offline: ${pg(e)}`)}}).next(t=>this.retrieveMatchingLocalDocuments(r,t,t=>Ng(e,t)))}}retrieveMatchingLocalDocuments(t,e,n){t.forEach((t,n)=>{const s=n.getKey();null===e.get(s)&&(e=e.insert(s,kh.newInvalidDocument(s)))});let s=rd();return e.forEach((e,r)=>{const i=t.get(e);void 0!==i&&nh(i.mutation,r,Dl.empty(),Fl.now()),n(r)&&(s=s.insert(e,r))}),s}getOverlaysForPipeline(t,e,n){switch(Df(e)){case"collection":return this.documentOverlayCache.getOverlaysForCollection(t,yl.fromString(bf(e)),n);case"collection_group":throw new gl("invalid-argument",`Unexpected collection group pipeline: ${pg(e)}`);case"documents":return this.documentOverlayCache.getOverlays(t,If(e).map(t=>Tl.fromPath(t)));case"database":return this.documentOverlayCache.getAllOverlays(t,n);default:throw new gl("invalid-argument",`Failed to get overlays for pipeline: ${pg(e)}`)}}}class Pg{constructor(t){this.serializer=t,this.Qs=new Map,this.Ws=new Map}getBundleMetadata(t,e){return mp.resolve(this.Qs.get(e))}saveBundleMetadata(t,e){return this.Qs.set(e.id,function(t){return{id:t.id,version:t.version,createTime:md(t.createTime)}}(e)),mp.resolve()}getNamedQuery(t,e){return mp.resolve(this.Ws.get(e))}saveNamedQuery(t,e){return this.Ws.set(e.name,function(t){return{name:t.name,query:Og(t.bundledQuery),readTime:md(t.readTime)}}(e)),mp.resolve()}}class Mg{constructor(){this.overlays=new ul(Tl.comparator),this.Gs=new Map}getOverlay(t,e){return mp.resolve(this.overlays.get(e))}getOverlays(t,e){const n=od();return mp.forEach(e,e=>this.getOverlay(t,e).next(t=>{null!==t&&n.set(e,t)})).next(()=>n)}getAllOverlays(t,e){const n=od();return this.overlays.forEach((t,s)=>{s.largestBatchId>e&&n.set(t,s)}),mp.resolve(n)}saveOverlays(t,e,n){return n.forEach((n,s)=>{this.Zr(t,e,s)}),mp.resolve()}removeOverlaysForBatchId(t,e,n){const s=this.Gs.get(n);return void 0!==s&&(s.forEach(t=>this.overlays=this.overlays.remove(t)),this.Gs.delete(n)),mp.resolve()}getOverlaysForCollection(t,e,n){const s=od(),r=e.length+1,i=new Tl(e.child("")),o=this.overlays.getIteratorFrom(i);for(;o.hasNext();){const t=o.getNext().value,i=t.getKey();if(!e.isPrefixOf(i.path))break;i.path.length===r&&t.largestBatchId>n&&s.set(t.getKey(),t)}return mp.resolve(s)}getOverlaysForCollectionGroup(t,e,n,s){let r=new ul((t,e)=>t-e);const i=this.overlays.getIterator();for(;i.hasNext();){const t=i.getNext().value;if(t.getKey().getCollectionGroup()===e&&t.largestBatchId>n){let e=r.get(t.largestBatchId);null===e&&(e=od(),r=r.insert(t.largestBatchId,e)),e.set(t.getKey(),t)}}const o=od(),a=r.getIterator();for(;a.hasNext()&&(a.getNext().value.forEach((t,e)=>o.set(t,e)),!(o.size()>=s)););return mp.resolve(o)}Zr(t,e,n){const s=this.overlays.get(n.key);if(null!==s){const t=this.Gs.get(s.largestBatchId).delete(n.key);this.Gs.set(s.largestBatchId,t)}this.overlays=this.overlays.insert(n.key,new Ig(e,n));let r=this.Gs.get(e);void 0===r&&(r=ud(),this.Gs.set(e,r)),this.Gs.set(e,r.add(n.key))}}class Gg{constructor(){this.sessionToken=Ml.EMPTY_BYTE_STRING}getSessionToken(t){return mp.resolve(this.sessionToken)}setSessionToken(t,e){return this.sessionToken=e,mp.resolve()}}class Hg{constructor(){this.zs=new pl(Ug.js),this.Hs=new pl(Ug.Js)}isEmpty(){return this.zs.isEmpty()}addReference(t,e){const n=new Ug(t,e);this.zs=this.zs.add(n),this.Hs=this.Hs.add(n)}Ys(t,e){t.forEach(t=>this.addReference(t,e))}removeReference(t,e){this.Zs(new Ug(t,e))}Xs(t,e){t.forEach(t=>this.removeReference(t,e))}e_(t){const e=new Tl(new yl([])),n=new Ug(e,t),s=new Ug(e,t+1),r=[];return this.Hs.forEachInRange([n,s],t=>{this.Zs(t),r.push(t.key)}),r}t_(){this.zs.forEach(t=>this.Zs(t))}Zs(t){this.zs=this.zs.delete(t),this.Hs=this.Hs.delete(t)}n_(t){const e=new Tl(new yl([])),n=new Ug(e,t),s=new Ug(e,t+1);let r=ud();return this.Hs.forEachInRange([n,s],t=>{r=r.add(t.key)}),r}containsKey(t){const e=new Ug(t,0),n=this.zs.firstAfterOrEqual(e);return null!==n&&t.isEqual(n.key)}}class Ug{constructor(t,e){this.key=t,this.r_=e}static js(t,e){return Tl.comparator(t.key,e.key)||il(t.r_,e.r_)}static Js(t,e){return il(t.r_,e.r_)||Tl.comparator(t.key,e.key)}}class Vg{constructor(t,e){this.indexManager=t,this.referenceDelegate=e,this.mutationQueue=[],this.Gr=1,this.i_=new pl(Ug.js)}checkEmpty(t){return mp.resolve(0===this.mutationQueue.length)}addMutationBatch(t,e,n,s){const r=this.Gr;this.Gr++,this.mutationQueue.length>0&&this.mutationQueue[this.mutationQueue.length-1];const i=new _g(r,e,n,s);this.mutationQueue.push(i);for(const e of s)this.i_=this.i_.add(new Ug(e.key,r)),this.indexManager.addToCollectionParentIndex(t,e.key.path.popLast());return mp.resolve(i)}lookupMutationBatch(t,e){return mp.resolve(this.s_(e))}getNextMutationBatchAfterBatchId(t,e){const n=e+1,s=this.__(n),r=s<0?0:s;return mp.resolve(this.mutationQueue.length>r?this.mutationQueue[r]:null)}getHighestUnacknowledgedBatchId(){return mp.resolve(0===this.mutationQueue.length?-1:this.Gr-1)}getAllMutationBatches(t){return mp.resolve(this.mutationQueue.slice())}getAllMutationBatchesAffectingDocumentKey(t,e){const n=new Ug(e,0),s=new Ug(e,Number.POSITIVE_INFINITY),r=[];return this.i_.forEachInRange([n,s],t=>{const e=this.s_(t.r_);r.push(e)}),mp.resolve(r)}getAllMutationBatchesAffectingDocumentKeys(t,e){let n=new pl(il);return e.forEach(t=>{const e=new Ug(t,0),s=new Ug(t,Number.POSITIVE_INFINITY);this.i_.forEachInRange([e,s],t=>{n=n.add(t.r_)})}),mp.resolve(this.o_(n))}getAllMutationBatchesAffectingQuery(t,e){const n=e.path,s=n.length+1;let r=n;Tl.isDocumentKey(r)||(r=r.child(""));const i=new Ug(new Tl(r),0);let o=new pl(il);return this.i_.forEachWhile(t=>{const e=t.key.path;return!!n.isPrefixOf(e)&&(e.length===s&&(o=o.add(t.r_)),!0)},i),mp.resolve(this.o_(o))}o_(t){const e=[];return t.forEach(t=>{const n=this.s_(t);null!==n&&e.push(n)}),e}removeMutationBatch(t,e){el(0===this.a_(e.batchId,"removed"),55003),this.mutationQueue.shift();let n=this.i_;return mp.forEach(e.mutations,s=>{const r=new Ug(s.key,e.batchId);return n=n.delete(r),this.referenceDelegate.markPotentiallyOrphaned(t,s.key)}).next(()=>{this.i_=n})}Hr(t){}containsKey(t,e){const n=new Ug(e,0),s=this.i_.firstAfterOrEqual(n);return mp.resolve(e.isEqual(s&&s.key))}performConsistencyCheck(t){return this.mutationQueue.length,mp.resolve()}a_(t,e){return this.__(t)}__(t){return 0===this.mutationQueue.length?0:t-this.mutationQueue[0].batchId}s_(t){const e=this.__(t);return e<0||e>=this.mutationQueue.length?null:this.mutationQueue[e]}}class jg{constructor(t){this.u_=t,this.docs=new ul(Tl.comparator),this.size=0}setIndexManager(t){this.indexManager=t}addEntry(t,e){const n=e.key,s=this.docs.get(n),r=s?s.size:0,i=this.u_(e);return this.docs=this.docs.insert(n,{document:e.mutableCopy(),size:i}),this.size+=i-r,this.indexManager.addToCollectionParentIndex(t,n.path.popLast())}removeEntry(t){const e=this.docs.get(t);e&&(this.docs=this.docs.remove(t),this.size-=e.size)}getEntry(t,e){const n=this.docs.get(e);return mp.resolve(n?n.document.mutableCopy():kh.newInvalidDocument(e))}getEntries(t,e){let n=nd();return e.forEach(t=>{const e=this.docs.get(t);n=n.insert(t,e?e.document.mutableCopy():kh.newInvalidDocument(t))}),mp.resolve(n)}getAllEntries(t){let e=nd();return this.docs.forEach((t,n)=>{e=e.insert(t,n.document)}),mp.resolve(e)}getDocumentsMatchingQuery(t,e,n,s){let r,i;Cg(e)?(r=yl.fromString(bf(e)),i=t=>Ng(e,t)):(r=e.path,i=t=>Kh(e,t));let o=nd();const a=new Tl(r.child("__id-9223372036854775808__")),B=this.docs.getIteratorFrom(a);for(;B.hasNext();){const{key:t,value:{document:e}}=B.getNext();if(!r.isPrefixOf(t.path))break;t.path.length>r.length+1||Ph(Lh(e),n)<=0||(s.has(e.key)||i(e))&&(o=o.insert(e.key,e.mutableCopy()))}return mp.resolve(o)}getAllFromCollectionGroup(t,e,n,s){Zc(9500)}c_(t,e){return mp.forEach(this.docs,t=>e(t))}newChangeBuffer(t){return new $g(this)}getSize(t){return mp.resolve(this.size)}}class $g extends kg{constructor(t){super(),this.$s=t}applyChanges(t){const e=[];return this.changes.forEach((n,s)=>{s.isValidDocument()?e.push(this.$s.addEntry(t,s)):this.$s.removeEntry(n)}),mp.waitFor(e)}getFromCache(t,e){return this.$s.getEntry(t,e)}getAllFromCache(t,e){return this.$s.getEntries(t,e)}}class Jg{constructor(t){this.persistence=t,this.l_=new td(t=>yg(t),Eg),this.lastRemoteSnapshotVersion=xh.min(),this.highestTargetId=0,this.E_=0,this.h_=new Hg,this.targetCount=0,this.T_=Rg.ws()}forEachTarget(t,e){return this.l_.forEach((t,n)=>e(n)),mp.resolve()}getLastRemoteSnapshotVersion(t){return mp.resolve(this.lastRemoteSnapshotVersion)}getHighestSequenceNumber(t){return mp.resolve(this.E_)}allocateTargetId(t){return this.highestTargetId=this.T_.next(),mp.resolve(this.highestTargetId)}setTargetsMetadata(t,e,n){return n&&(this.lastRemoteSnapshotVersion=n),e>this.E_&&(this.E_=e),mp.resolve()}Ds(t){this.l_.set(t.target,t);const e=t.targetId;e>this.highestTargetId&&(this.T_=new Rg(e),this.highestTargetId=e),t.sequenceNumber>this.E_&&(this.E_=t.sequenceNumber)}addTargetData(t,e){return this.Ds(e),this.targetCount+=1,mp.resolve()}updateTargetData(t,e){return this.Ds(e),mp.resolve()}removeTargetData(t,e){return this.l_.delete(e.target),this.h_.e_(e.targetId),this.targetCount-=1,mp.resolve()}removeTargets(t,e,n){let s=0;const r=[];return this.l_.forEach((i,o)=>{o.sequenceNumber<=e&&null===n.get(o.targetId)&&(this.l_.delete(i),r.push(this.removeMatchingKeysForTargetId(t,o.targetId)),s++)}),mp.waitFor(r).next(()=>s)}getTargetCount(t){return mp.resolve(this.targetCount)}getTargetData(t,e){const n=this.l_.get(e)||null;return mp.resolve(n)}addMatchingKeys(t,e,n){return this.h_.Ys(e,n),mp.resolve()}removeMatchingKeys(t,e,n){this.h_.Xs(e,n);const s=this.persistence.referenceDelegate,r=[];return s&&e.forEach(e=>{r.push(s.markPotentiallyOrphaned(t,e))}),mp.waitFor(r)}removeMatchingKeysForTargetId(t,e){return this.h_.e_(e),mp.resolve()}getMatchingKeysForTargetId(t,e){const n=this.h_.n_(e);return mp.resolve(n)}containsKey(t,e){return mp.resolve(this.h_.containsKey(e))}}class qg{constructor(t,e){this.P_={},this.overlays={},this.I_=new fp(0),this.R_=!1,this.R_=!0,this.A_=new Gg,this.referenceDelegate=t(this),this.V_=new Jg(this),this.indexManager=new Ag,this.remoteDocumentCache=function(t){return new jg(t)}(t=>this.referenceDelegate.d_(t)),this.serializer=new Tg(e),this.f_=new Pg(this.serializer)}start(){return Promise.resolve()}shutdown(){return this.R_=!1,Promise.resolve()}get started(){return this.R_}setDatabaseDeletedListener(){}setNetworkEnabled(){}getIndexManager(t){return this.indexManager}getDocumentOverlayCache(t){let e=this.overlays[t.toKey()];return e||(e=new Mg,this.overlays[t.toKey()]=e),e}getMutationQueue(t,e){let n=this.P_[t.toKey()];return n||(n=new Vg(e,this.referenceDelegate),this.P_[t.toKey()]=n),n}getGlobalsCache(){return this.A_}getTargetCache(){return this.V_}getRemoteDocumentCache(){return this.remoteDocumentCache}getBundleCache(){return this.f_}runTransaction(t,e,n){Qc("MemoryPersistence","Starting transaction:",t);const s=new zg(this.I_.next());return this.referenceDelegate.m_(),n(s).next(t=>this.referenceDelegate.p_(s).next(()=>t)).toPromise().then(t=>(s.raiseOnCommittedEvent(),t))}g_(t,e){return mp.or(Object.values(this.P_).map(n=>()=>n.containsKey(t,e)))}}class zg extends Cp{constructor(t){super(),this.currentSequenceNumber=t}}class Kg{constructor(t){this.persistence=t,this.y_=new Hg,this.w_=null}static b_(t){return new Kg(t)}get S_(){if(this.w_)return this.w_;throw Zc(60996)}addReference(t,e,n){return this.y_.addReference(n,e),this.S_.delete(n.toString()),mp.resolve()}removeReference(t,e,n){return this.y_.removeReference(n,e),this.S_.add(n.toString()),mp.resolve()}markPotentiallyOrphaned(t,e){return this.S_.add(e.toString()),mp.resolve()}removeTarget(t,e){this.y_.e_(e.targetId).forEach(t=>this.S_.add(t.toString()));const n=this.persistence.getTargetCache();return n.getMatchingKeysForTargetId(t,e.targetId).next(t=>{t.forEach(t=>this.S_.add(t.toString()))}).next(()=>n.removeTargetData(t,e))}m_(){this.w_=new Set}p_(t){const e=this.persistence.getRemoteDocumentCache().newChangeBuffer();return mp.forEach(this.S_,n=>{const s=Tl.fromPath(n);return this.v_(t,s).next(t=>{t||e.removeEntry(s,xh.min())})}).next(()=>(this.w_=null,e.apply(t)))}updateLimboDocument(t,e){return this.v_(t,e).next(t=>{t?this.S_.delete(e.toString()):this.S_.add(e.toString())})}d_(t){return 0}v_(t,e){return mp.or([()=>mp.resolve(this.y_.containsKey(e)),()=>this.persistence.getTargetCache().containsKey(t,e),()=>this.persistence.g_(t,e)])}}class Qg{constructor(t,e){this.persistence=t,this.D_=new td(t=>function(t){let e="";for(let n=0;n<t.length;n++)e.length>0&&(e=vg(e)),e=bg(t.get(n),e);return vg(e)}(t.path),(t,e)=>t.isEqual(e)),this.garbageCollector=function(t,e){return new bp(t,e)}(this,e)}static b_(t,e){return new Qg(t,e)}m_(){}p_(t){return mp.resolve()}forEachTarget(t,e){return this.persistence.getTargetCache().forEachTarget(t,e)}ir(t){const e=this.Cs(t);return this.persistence.getTargetCache().getTargetCount(t).next(t=>e.next(e=>t+e))}Cs(t){let e=0;return this.sr(t,t=>{e++}).next(()=>e)}sr(t,e){return mp.forEach(this.D_,(n,s)=>this.Os(t,n,s).next(t=>t?mp.resolve():e(s)))}removeTargets(t,e,n){return this.persistence.getTargetCache().removeTargets(t,e,n)}removeOrphanedDocuments(t,e){let n=0;const s=this.persistence.getRemoteDocumentCache(),r=s.newChangeBuffer();return s.c_(t,s=>this.Os(t,s,e).next(t=>{t||(n++,r.removeEntry(s,xh.min()))})).next(()=>r.apply(t)).next(()=>n)}markPotentiallyOrphaned(t,e){return this.D_.set(e,t.currentSequenceNumber),mp.resolve()}removeTarget(t,e){const n=e.withSequenceNumber(t.currentSequenceNumber);return this.persistence.getTargetCache().updateTargetData(t,n)}addReference(t,e,n){return this.D_.set(n,t.currentSequenceNumber),mp.resolve()}removeReference(t,e,n){return this.D_.set(n,t.currentSequenceNumber),mp.resolve()}updateLimboDocument(t,e){return this.D_.set(e,t.currentSequenceNumber),mp.resolve()}d_(t){let e=t.key.toString().length;return t.isFoundDocument()&&(e+=mu(t.data.value)),e}Os(t,e,n){return mp.or([()=>this.persistence.g_(t,e),()=>this.persistence.getTargetCache().containsKey(t,e),()=>{const t=this.D_.get(e);return mp.resolve(void 0!==t&&t>n)}])}getCacheSize(t){return this.persistence.getRemoteDocumentCache().getSize(t)}}class Wg{constructor(t,e,n,s){this.targetId=t,this.fromCache=e,this.Vo=n,this.fo=s}static mo(t,e){let n=ud(),s=ud();for(const t of e.docChanges)switch(t.type){case 0:n=n.add(t.doc.key);break;case 1:s=s.add(t.doc.key)}return new Wg(t,e.fromCache,n,s)}}function Yg(t,e){return Tl.comparator(t.key,e.key)}class Xg{constructor(){this._documentReadCount=0}get documentReadCount(){return this._documentReadCount}incrementDocumentReadCount(t){this._documentReadCount+=t}}class Zg{constructor(){this.po=!1,this.yo=!1,this.wo=100,this.bo=Mn()?8:function(t){const e=t.match(/Android ([\d.]+)/i),n=e?e[1].split(".").slice(0,2).join("."):"-1";return Number(n)}(Fn())>0?6:4}initialize(t,e){this.So=t,this.indexManager=e,this.po=!0}getDocumentsMatchingQuery(t,e,n,s){const r={result:null};return this.vo(t,e).next(t=>{r.result=t}).next(()=>{if(!r.result)return this.Do(t,e,s,n).next(t=>{r.result=t})}).next(()=>{if(r.result)return;const n=new Xg;return this.xo(t,e,n).next(s=>{if(r.result=s,this.yo)return this.Co(t,e,n,s.size)})}).next(()=>r.result)}Co(t,e,n,s){return Cg(e)?mp.resolve():n.documentReadCount<this.wo?(Kc()<=is.DEBUG&&Qc("QueryEngine","SDK will not create cache indexes for query:",zh(e),"since it only creates cache indexes for collection contains","more than or equal to",this.wo,"documents"),mp.resolve()):(Kc()<=is.DEBUG&&Qc("QueryEngine","Query:",zh(e),"scans",n.documentReadCount,"local documents and returns",s,"documents as results."),n.documentReadCount>this.bo*s?(Kc()<=is.DEBUG&&Qc("QueryEngine","The SDK decides to create cache indexes for query:",zh(e),"as using cache indexes may help improve performance."),this.indexManager.createTargetIndexes(t,Jh(e))):mp.resolve())}vo(t,e){if(Cg(e))return mp.resolve(null);let n=e;if(jh(n))return mp.resolve(null);let s=Jh(n);return this.indexManager.getIndexType(t,s).next(e=>0===e?null:(null!==n.limit&&1===e&&(n=qh(n,null,"F"),s=Jh(n)),this.indexManager.getDocumentsMatchingTarget(t,s).next(e=>{const r=ud(...e);return this.So.getDocuments(t,r).next(e=>this.indexManager.getMinOffset(t,s).next(s=>{const i=this.Fo(n,e);return this.Oo(n,i,r,s.readTime)?this.vo(t,qh(n,null,"F")):this.Mo(t,i,n,s)}))})))}Do(t,e,n,s){return(Cg(e)?function(t){for(const e of t.stages){if(e instanceof Cf||e instanceof gf)return!1;if(e instanceof ff){if(e.condition instanceof nf&&"exists"===e.condition._expr.name&&e.condition._expr.params[0]instanceof Wp&&e.condition._expr.params[0].fieldName===ml)continue;return!1}}return!0}(e):jh(e))||s.isEqual(xh.min())?mp.resolve(null):this.So.getDocuments(t,n).next(r=>{const i=this.Fo(e,r);return this.Oo(e,i,n,s)?mp.resolve(null):(Kc()<=is.DEBUG&&Qc("QueryEngine","Re-using previous result from %s to execute query: %s",s.toString(),gg(e)),this.Mo(t,i,e,function(t,e){const n=t.toTimestamp().seconds,s=t.toTimestamp().nanoseconds+1,r=xh.fromTimestamp(1e9===s?new Fl(n+1,0):new Fl(n,s));return new Fh(r,Tl.empty(),e)}(s,-1)).next(t=>t))})}Fo(t,e){let n,s;return Cg(t)?(n=new pl(Yg),s=e=>Ng(t,e)):(n=new pl(Qh(t)),s=e=>Kh(t,e)),e.forEach((t,e)=>{s(e)&&(n=n.add(e))}),n}Oo(t,e,n,s){if(Cg(t))return function(t){return t.stages.some(t=>t instanceof Cf||t instanceof gf)}(t);if(null===t.limit)return!1;if(n.size!==e.size)return!0;const r="F"===t.limitType?e.last():e.first();return!!r&&(r.hasPendingWrites||r.version.compareTo(s)>0)}xo(t,e,n){return Kc()<=is.DEBUG&&Qc("QueryEngine","Using full collection scan to execute query:",gg(e)),this.So.getDocumentsMatchingQuery(t,e,Fh.min(),n)}Mo(t,e,n,s){return this.So.getDocumentsMatchingQuery(t,n,s).next(t=>(e.forEach(e=>{t=t.insert(e.key,e)}),t))}}class tm{constructor(t,e,n,s){this.persistence=t,this.No=e,this.serializer=s,this.Lo=new ul(il),this.Bo=new td(t=>yg(t),Eg),this.Uo=new Map,this.ko=t.getRemoteDocumentCache(),this.V_=t.getTargetCache(),this.f_=t.getBundleCache(),this.qo(n)}qo(t){this.documentOverlayCache=this.persistence.getDocumentOverlayCache(t),this.indexManager=this.persistence.getIndexManager(t),this.mutationQueue=this.persistence.getMutationQueue(t,this.indexManager),this.localDocuments=new Fg(this.ko,this.mutationQueue,this.documentOverlayCache,this.indexManager),this.ko.setIndexManager(this.indexManager),this.No.initialize(this.localDocuments,this.indexManager)}collectGarbage(t){return this.persistence.runTransaction("Collect garbage","readwrite-primary",e=>t.collect(e,this.Lo))}}async function em(t,e){const n=nl(t);return await n.persistence.runTransaction("Handle user change","readonly",t=>{let s;return n.mutationQueue.getAllMutationBatches(t).next(r=>(s=r,n.qo(e),n.mutationQueue.getAllMutationBatches(t))).next(e=>{const r=[],i=[];let o=ud();for(const t of s){r.push(t.batchId);for(const e of t.mutations)o=o.add(e.key)}for(const t of e){i.push(t.batchId);for(const e of t.mutations)o=o.add(e.key)}return n.localDocuments.getDocuments(t,o).next(t=>({$o:t,removedBatchIds:r,addedBatchIds:i}))})})}function nm(t,e){const n=nl(t);return n.persistence.runTransaction("Get next mutation batch","readonly",t=>(void 0===e&&(e=-1),n.mutationQueue.getNextMutationBatchAfterBatchId(t,e)))}class sm{constructor(t,e){this.asyncQueue=t,this.onlineStateHandler=e,this.state="Unknown",this.Yo=0,this.Zo=null,this.Xo=!0}ea(){0===this.Yo&&(this.ta("Unknown"),this.Zo=this.asyncQueue.enqueueAfterDelay("online_state_timeout",1e4,()=>(this.Zo=null,this.na("Backend didn't respond within 10 seconds."),this.ta("Offline"),Promise.resolve())))}ra(t){"Online"===this.state?this.ta("Unknown"):(this.Yo++,this.Yo>=1&&(this.ia(),this.na(`Connection failed 1 times. Most recent error: ${t.toString()}`),this.ta("Offline")))}set(t){this.ia(),this.Yo=0,"Online"===t&&(this.Xo=!1),this.ta(t)}ta(t){t!==this.state&&(this.state=t,this.onlineStateHandler(t))}na(t){const 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.Xo?(Wc(e),this.Xo=!1):Qc("OnlineStateTracker",e)}ia(){null!==this.Zo&&(this.Zo.cancel(),this.Zo=null)}}const rm="RemoteStore";class im{constructor(t,e,n,s,r){this.localStore=t,this.datastore=e,this.asyncQueue=n,this.remoteSyncer={},this.sa=[],this._a=new Map,this.oa=new Map,this.aa=new Map,this.ua=new Rg(1e3),this.ca=new Rg(1001),this.la=new Set,this.Ea=[],this.ha=r,this.ha.Qe(t=>{n.enqueueAndForget(async()=>{Bm(this)&&(Qc(rm,"Restarting streams for network reachability change."),await async function(t){const e=nl(t);e.la.add(4),await am(e),e.Ta.set("Unknown"),e.la.delete(4),await om(e)}(this))})}),this.Ta=new sm(n,s)}}async function om(t){if(Bm(t))for(const e of t.Ea)await e(!0)}async function am(t){for(const e of t.Ea)await e(!1)}function Bm(t){return 0===nl(t).la.size}async function cm(t,e,n){if(!wp(e))throw e;t.la.add(1),await am(t),t.Ta.set("Offline"),n||(n=()=>function(t){const e=nl(t);return e.persistence.runTransaction("Get last remote snapshot version","readonly",t=>e.V_.getLastRemoteSnapshotVersion(t))}(t.localStore)),t.asyncQueue.enqueueRetryable(async()=>{Qc(rm,"Retrying IndexedDB access"),await n(),t.la.delete(1),await om(t)})}function lm(t,e){return e().catch(n=>cm(t,n,e))}async function um(t){const e=nl(t),n=Em(e);let s=e.sa.length>0?e.sa[e.sa.length-1].batchId:-1;for(;hm(e);)try{const t=await nm(e.localStore,s);if(null===t){0===e.sa.length&&n.en();break}s=t.batchId,dm(e,t)}catch(t){await cm(e,t)}pm(e)&&fm(e)}function hm(t){return Bm(t)&&t.sa.length<10}function dm(t,e){t.sa.push(e);const n=Em(t);n.Yt()&&n.Rn&&n.An(e.mutations)}function pm(t){return Bm(t)&&!Em(t).Jt()&&t.sa.length>0}function fm(t){Em(t).start()}async function Cm(t){Em(t).fn()}async function gm(t){const e=Em(t);for(const n of t.sa)e.An(n.mutations)}async function mm(t,e,n){const s=t.sa.shift(),r=Dg.from(s,e,n);await lm(t,()=>t.remoteSyncer.applySuccessfulWrite(r)),await um(t)}async function wm(t,e){e&&Em(t).Rn&&await async function(t,e){if(function(t){return function(t){switch(t){case Cl.OK:return Zc(64938);case Cl.CANCELLED:case Cl.UNKNOWN:case Cl.DEADLINE_EXCEEDED:case Cl.RESOURCE_EXHAUSTED:case Cl.INTERNAL:case Cl.UNAVAILABLE:case Cl.UNAUTHENTICATED:return!1;case Cl.INVALID_ARGUMENT:case Cl.NOT_FOUND:case Cl.ALREADY_EXISTS:case Cl.PERMISSION_DENIED:case Cl.FAILED_PRECONDITION:case Cl.ABORTED:case Cl.OUT_OF_RANGE:case Cl.UNIMPLEMENTED:case Cl.DATA_LOSS:return!0;default:return Zc(15467,{code:t})}}(t)&&t!==Cl.ABORTED}(e.code)){const n=t.sa.shift();Em(t).Xt(),await lm(t,()=>t.remoteSyncer.rejectFailedWrite(n.batchId,e)),await um(t)}}(t,e),pm(t)&&fm(t)}async function ym(t,e){const n=nl(t);n.asyncQueue.verifyOperationInProgress(),Qc(rm,"RemoteStore received new credentials");const s=Bm(n);n.la.add(3),await am(n),s&&n.Ta.set("Unknown"),await n.remoteSyncer.handleCredentialChange(e),n.la.delete(3),await om(n)}function Em(t){return t.Ra||(t.Ra=function(t,e,n){const s=nl(t);return s.pn(),new Bp(e,s.connection,s.authCredentials,s.appCheckCredentials,s.serializer,n)}(t.datastore,t.asyncQueue,{ct:()=>Promise.resolve(),Et:Cm.bind(null,t),Tt:wm.bind(null,t),Vn:gm.bind(null,t),dn:mm.bind(null,t)}),t.Ea.push(async e=>{e?(t.Ra.Xt(),await um(t)):(await t.Ra.stop(),t.sa.length>0&&(Qc(rm,`Stopping write stream with ${t.sa.length} pending writes`),t.sa=[]))})),t.Ra}class _m{constructor(t,e,n,s,r){this.asyncQueue=t,this.timerId=e,this.targetTimeMs=n,this.op=s,this.removalCallback=r,this.deferred=new Pd,this.then=this.deferred.promise.then.bind(this.deferred.promise),this.deferred.promise.catch(t=>{})}get promise(){return this.deferred.promise}static createAndSchedule(t,e,n,s,r){const i=Date.now()+n,o=new _m(t,e,i,s,r);return o.start(n),o}start(t){this.timerHandle=setTimeout(()=>this.handleDelayElapsed(),t)}skipDelay(){return this.handleDelayElapsed()}cancel(t){null!==this.timerHandle&&(this.clearTimeout(),this.deferred.reject(new gl(Cl.CANCELLED,"Operation cancelled"+(t?": "+t:""))))}handleDelayElapsed(){this.asyncQueue.enqueueAndForget(()=>null!==this.timerHandle?(this.clearTimeout(),this.op().then(t=>this.deferred.resolve(t))):Promise.resolve())}clearTimeout(){null!==this.timerHandle&&(this.removalCallback(this),clearTimeout(this.timerHandle),this.timerHandle=null)}}function Dm(t,e){if(Wc("AsyncQueue",`${e}: ${t}`),wp(t))return new gl(Cl.UNAVAILABLE,`${e}: ${t}`);throw t}class bm{constructor(){this.activeTargetIds=hd}Ba(t){this.activeTargetIds=this.activeTargetIds.add(t)}Ua(t){this.activeTargetIds=this.activeTargetIds.delete(t)}La(){const t={activeTargetIds:this.activeTargetIds.toArray(),updateTimeMs:Date.now()};return JSON.stringify(t)}}class vm{constructor(){this.fu=new bm,this.mu={},this.onlineStateHandler=null,this.sequenceNumberHandler=null}addPendingMutation(t){}updateMutationState(t,e,n){}addLocalQueryTarget(t,e=!0){return e&&this.fu.Ba(t),this.mu[t]||"not-current"}updateQueryState(t,e,n){this.mu[t]=e}removeLocalQueryTarget(t){this.fu.Ua(t)}isLocalQueryTarget(t){return this.fu.activeTargetIds.has(t)}clearQueryState(t){delete this.mu[t]}getAllActiveQueryTargets(){return this.fu.activeTargetIds}isActiveQueryTarget(t){return this.fu.activeTargetIds.has(t)}start(){return this.fu=new bm,Promise.resolve()}handleUserChange(t,e,n){}setOnlineState(t){}shutdown(){}writeSequenceNumber(t){}notifyBundleLoaded(t){}}function Im(){return"undefined"!=typeof document?document:null}class Tm{constructor(){this.queries=Om(),this.onlineState="Unknown",this.Du=new Set}terminate(){!function(t,e){const n=nl(t),s=n.queries;n.queries=Om(),s.forEach((t,n)=>{for(const t of n.bu)t.onError(e)})}(this,new gl(Cl.ABORTED,"Firestore shutting down"))}}function Om(){return new td(t=>mg(t),wg)}var Am;!function(t){t.Default="default",t.Cache="cache"}(Am||(Am={}));class Sm{constructor(t,e,n,s,r,i){this.localStore=t,this.remoteStore=e,this.eventManager=n,this.sharedClientState=s,this.currentUser=r,this.maxConcurrentLimboResolutions=i,this.hc={},this.Tc=new td(t=>mg(t),wg),this.Pc=new Map,this.Ic=new Set,this.Rc=new ul(Tl.comparator),this.Ac=new Map,this.Vc=new Hg,this.dc={},this.fc=new Map,this.mc=Rg.bs(),this.onlineState="Unknown",this.gc=void 0}get isPrimaryClient(){return!0===this.gc}}async function Rm(t,e,n){const s=function(t){const e=nl(t);return e.remoteStore.remoteSyncer.applySuccessfulWrite=xm.bind(null,e),e.remoteStore.remoteSyncer.rejectFailedWrite=km.bind(null,e),e}(t);try{const t=await function(t,e){const n=nl(t),s=Fl.now(),r=e.reduce((t,e)=>t.add(e.key),ud());let i,o;return n.persistence.runTransaction("Locally write mutations","readwrite",t=>{let a=nd(),B=ud();return n.ko.getEntries(t,r).next(t=>{a=t,a.forEach((t,e)=>{e.isValidDocument()||(B=B.add(t))})}).next(()=>n.localDocuments.getOverlayedDocuments(t,a)).next(r=>{i=r;const o=[];for(const t of e){const e=sh(t,i.get(t.key).overlayedDocument);null!=e&&o.push(new oh(t.key,e,Su(e.value.mapValue),Yu.exists(!0)))}return n.mutationQueue.addMutationBatch(t,s,o,e)}).next(e=>{o=e;const s=e.applyToLocalDocumentSet(i,B);return n.documentOverlayCache.saveOverlays(t,e.batchId,s)})}).then(()=>({batchId:o.batchId,changes:id(i)}))}(s.localStore,e);s.sharedClientState.addPendingMutation(t.batchId),function(t,e,n){let s=t.dc[t.currentUser.toKey()];s||(s=new ul(il)),s=s.insert(e,n),t.dc[t.currentUser.toKey()]=s}(s,t.batchId,n),await Pm(s,t.changes),await um(s.remoteStore)}catch(t){const e=Dm(t,"Failed to persist write");n.reject(e)}}function Nm(t,e,n){const s=nl(t);if(s.isPrimaryClient&&0===n||!s.isPrimaryClient&&1===n){const t=[];s.Tc.forEach((n,s)=>{const r=s.view.xu(e);r.snapshot&&t.push(r.snapshot)}),function(t,e){const n=nl(t);n.onlineState=e;let s=!1;n.queries.forEach((t,n)=>{for(const t of n.bu)t.xu(e)&&(s=!0)}),s&&function(t){t.Du.forEach(t=>{t.next()})}(n)}(s.eventManager,e),t.length&&s.hc.Tn(t),s.onlineState=e,s.isPrimaryClient&&s.sharedClientState.setOnlineState(e)}}async function xm(t,e){const n=nl(t),s=e.batch.batchId;try{const t=await function(t,e){const n=nl(t);return n.persistence.runTransaction("Acknowledge batch","readwrite-primary",t=>{const s=e.batch.keys(),r=n.ko.newChangeBuffer({trackRemovals:!0});return function(t,e,n,s){const r=n.batch,i=r.keys();let o=mp.resolve();return i.forEach(t=>{o=o.next(()=>s.getEntry(e,t)).next(e=>{const i=n.docVersions.get(t);el(null!==i,48541),e.version.compareTo(i)<0&&(r.applyToRemoteDocument(e,n),e.isValidDocument()&&(e.setReadTime(n.commitVersion),s.addEntry(e)))})}),o.next(()=>t.mutationQueue.removeMutationBatch(e,r))}(n,t,e,r).next(()=>r.apply(t)).next(()=>n.mutationQueue.performConsistencyCheck(t)).next(()=>n.documentOverlayCache.removeOverlaysForBatchId(t,s,e.batch.batchId)).next(()=>n.localDocuments.recalculateAndSaveOverlaysForDocumentKeys(t,function(t){let e=ud();for(let n=0;n<t.mutationResults.length;++n)t.mutationResults[n].transformResults.length>0&&(e=e.add(t.batch.mutations[n].key));return e}(e))).next(()=>n.localDocuments.getDocuments(t,s))})}(n.localStore,e);Fm(n,s,null),Lm(n,s),n.sharedClientState.updateMutationState(s,"acknowledged"),await Pm(n,t)}catch(t){await gp(t)}}async function km(t,e,n){const s=nl(t);try{const t=await function(t,e){const n=nl(t);return n.persistence.runTransaction("Reject batch","readwrite-primary",t=>{let s;return n.mutationQueue.lookupMutationBatch(t,e).next(e=>(el(null!==e,37113),s=e.keys(),n.mutationQueue.removeMutationBatch(t,e))).next(()=>n.mutationQueue.performConsistencyCheck(t)).next(()=>n.documentOverlayCache.removeOverlaysForBatchId(t,s,e)).next(()=>n.localDocuments.recalculateAndSaveOverlaysForDocumentKeys(t,s)).next(()=>n.localDocuments.getDocuments(t,s))})}(s.localStore,e);Fm(s,e,n),Lm(s,e),s.sharedClientState.updateMutationState(e,"rejected",n),await Pm(s,t)}catch(n){await gp(n)}}function Lm(t,e){(t.fc.get(e)||[]).forEach(t=>{t.resolve()}),t.fc.delete(e)}function Fm(t,e,n){const s=nl(t);let r=s.dc[s.currentUser.toKey()];if(r){const t=r.get(e);t&&(n?t.reject(n):t.resolve(),r=r.remove(e)),s.dc[s.currentUser.toKey()]=r}}async function Pm(t,e,n){const s=nl(t),r=[],i=[],o=[];s.Tc.isEmpty()||(s.Tc.forEach((t,a)=>{o.push(s.yc(a,e,n).then(t=>{if((t||n)&&s.isPrimaryClient){const e=t?!t.fromCache:n?.targetChanges.get(a.targetId)?.current;s.sharedClientState.updateQueryState(a.targetId,e?"current":"not-current")}if(t){r.push(t);const e=Wg.mo(a.targetId,t);i.push(e)}}))}),await Promise.all(o),s.hc.Tn(r),await async function(t,e){const n=nl(t);try{await n.persistence.runTransaction("notifyLocalViewChanges","readwrite",t=>mp.forEach(e,e=>mp.forEach(e.Vo,s=>n.persistence.referenceDelegate.addReference(t,e.targetId,s)).next(()=>mp.forEach(e.fo,s=>n.persistence.referenceDelegate.removeReference(t,e.targetId,s)))))}catch(t){if(!wp(t))throw t;Qc("LocalStore","Failed to update sequence numbers: "+t)}for(const t of e){const e=t.targetId;if(!t.fromCache){const t=n.Lo.get(e),s=t.snapshotVersion,r=t.withLastLimboFreeSnapshotVersion(s);n.Lo=n.Lo.insert(e,r)}}}(s.localStore,i))}async function Mm(t,e){const n=nl(t);if(!n.currentUser.isEqual(e)){Qc("SyncEngine","User change. New user:",e.toKey());const t=await em(n.localStore,e);n.currentUser=e,function(t,e){t.fc.forEach(t=>{t.forEach(t=>{t.reject(new gl(Cl.CANCELLED,e))})}),t.fc.clear()}(n,"'waitForPendingWrites' promise is rejected due to a user change."),n.sharedClientState.handleUserChange(e,t.removedBatchIds,t.addedBatchIds),await Pm(n,t.$o)}}class Gm{constructor(){this.kind="memory",this.synchronizeTabs=!1}async initialize(t){this.serializer=Rd(t.databaseInfo.databaseId),this.sharedClientState=this.vc(t),this.persistence=this.Dc(t),await this.persistence.start(),this.localStore=this.xc(t),this.gcScheduler=this.Cc(t,this.localStore),this.indexBackfillerScheduler=this.Fc(t,this.localStore)}Cc(t,e){return null}Fc(t,e){return null}xc(t){return function(t,e,n,s){return new tm(t,e,n,s)}(this.persistence,new Zg,t.initialUser,this.serializer)}Dc(t){return new qg(Kg.b_,this.serializer)}vc(t){return new vm}async terminate(){this.gcScheduler?.stop(),this.indexBackfillerScheduler?.stop(),this.sharedClientState.shutdown(),await this.persistence.shutdown()}}Gm.provider={build:()=>new Gm};class Hm extends Gm{constructor(t){super(),this.cacheSizeBytes=t}Cc(t,e){el(this.persistence.referenceDelegate instanceof Qg,46915);const n=this.persistence.referenceDelegate.garbageCollector;return new Dp(n,t.asyncQueue,e)}Dc(t){const e=void 0!==this.cacheSizeBytes?pp.withCacheSize(this.cacheSizeBytes):pp.DEFAULT;return new qg(t=>Qg.b_(t,e),this.serializer)}}class Um{async initialize(t,e){this.localStore||(this.localStore=t.localStore,this.sharedClientState=t.sharedClientState,this.datastore=this.createDatastore(e),this.remoteStore=this.createRemoteStore(e),this.eventManager=this.createEventManager(e),this.syncEngine=this.createSyncEngine(e,!t.synchronizeTabs),this.sharedClientState.onlineStateHandler=t=>Nm(this.syncEngine,t,1),this.remoteStore.remoteSyncer.handleCredentialChange=Mm.bind(null,this.syncEngine),await async function(t,e){const n=nl(t);e?(n.la.delete(2),await om(n)):e||(n.la.add(2),await am(n),n.Ta.set("Unknown"))}(this.remoteStore,this.syncEngine.isPrimaryClient))}createEventManager(t){return new Tm}createDatastore(t){const e=Rd(t.databaseInfo.databaseId),n=function(t){return new rp(t)}(t.databaseInfo);return function(t,e,n,s){return new lp(t,e,n,s)}(t.authCredentials,t.appCheckCredentials,n,e)}createRemoteStore(t){return function(t,e,n,s,r){return new im(t,e,n,s,r)}(this.localStore,this.datastore,t.asyncQueue,t=>Nm(this.syncEngine,t,0),Qd.Ye()?new Qd:new zd)}createSyncEngine(t,e){return function(t,e,n,s,r,i,o){const a=new Sm(t,e,n,s,r,i);return o&&(a.gc=!0),a}(this.localStore,this.remoteStore,this.eventManager,this.sharedClientState,t.initialUser,t.maxConcurrentLimboResolutions,e)}async terminate(){await async function(t){const e=nl(t);Qc(rm,"RemoteStore shutting down."),e.la.add(5),await am(e),e.ha.shutdown(),e.Ta.set("Unknown")}(this.remoteStore),this.datastore?.terminate(),this.eventManager?.terminate()}}Um.provider={build:()=>new Um};const Vm="FirestoreClient";class jm{constructor(t,e,n,s,r){this.authCredentials=t,this.appCheckCredentials=e,this.asyncQueue=n,this._databaseInfo=s,this.user=Fd.UNAUTHENTICATED,this.clientId=rl.newId(),this.authCredentialListener=()=>Promise.resolve(),this.appCheckCredentialListener=()=>Promise.resolve(),this._uninitializedComponentsProvider=r,this.authCredentials.start(n,async t=>{Qc(Vm,"Received user=",t.uid),await this.authCredentialListener(t),this.user=t}),this.appCheckCredentials.start(n,t=>(Qc(Vm,"Received new app check token=",t),this.appCheckCredentialListener(t,this.user)))}get configuration(){return{asyncQueue:this.asyncQueue,databaseInfo:this._databaseInfo,clientId:this.clientId,authCredentials:this.authCredentials,appCheckCredentials:this.appCheckCredentials,initialUser:this.user,maxConcurrentLimboResolutions:100}}setCredentialChangeListener(t){this.authCredentialListener=t}setAppCheckTokenChangeListener(t){this.appCheckCredentialListener=t}terminate(){this.asyncQueue.enterRestrictedMode();const t=new Pd;return this.asyncQueue.enqueueAndForgetEvenWhileRestricted(async()=>{try{this._onlineComponents&&await this._onlineComponents.terminate(),this._offlineComponents&&await this._offlineComponents.terminate(),this.authCredentials.shutdown(),this.appCheckCredentials.shutdown(),t.resolve()}catch(e){const n=Dm(e,"Failed to shutdown persistence");t.reject(n)}}),t.promise}}async function $m(t,e){t.asyncQueue.verifyOperationInProgress(),Qc(Vm,"Initializing OfflineComponentProvider");const n=t.configuration;await e.initialize(n);let s=n.initialUser;t.setCredentialChangeListener(async t=>{s.isEqual(t)||(await em(e.localStore,t),s=t)}),e.persistence.setDatabaseDeletedListener(()=>t.terminate()),t._offlineComponents=e}async function Jm(t,e){t.asyncQueue.verifyOperationInProgress();const n=await async function(t){if(!t._offlineComponents)if(t._uninitializedComponentsProvider){Qc(Vm,"Using user provided OfflineComponentProvider");try{await $m(t,t._uninitializedComponentsProvider._offline)}catch(e){const n=e;if(!function(t){return"FirebaseError"===t.name?t.code===Cl.FAILED_PRECONDITION||t.code===Cl.UNIMPLEMENTED:!("undefined"!=typeof DOMException&&t instanceof DOMException)||22===t.code||20===t.code||11===t.code}(n))throw n;Yc("Error using user provided cache. Falling back to memory cache: "+n),await $m(t,new Gm)}}else Qc(Vm,"Using default OfflineComponentProvider"),await $m(t,new Hm(void 0));return t._offlineComponents}(t);Qc(Vm,"Initializing OnlineComponentProvider"),await e.initialize(n,t.configuration),t.setCredentialChangeListener(t=>ym(e.remoteStore,t)),t.setAppCheckTokenChangeListener((t,n)=>ym(e.remoteStore,n)),t._onlineComponents=e}function qm(t){return async function(t){return t._onlineComponents||(t._uninitializedComponentsProvider?(Qc(Vm,"Using user provided OnlineComponentProvider"),await Jm(t,t._uninitializedComponentsProvider._online)):(Qc(Vm,"Using default OnlineComponentProvider"),await Jm(t,new Um))),t._onlineComponents}(t).then(t=>t.syncEngine)}let zm=class{constructor(t,e,n,s,r){this._firestore=t,this._userDataWriter=e,this._key=n,this._document=s,this._converter=r}get id(){return this._key.path.lastSegment()}get ref(){return new Rp(this._firestore,this._converter,this._key)}exists(){return null!==this._document}data(){if(this._document){if(this._converter){const t=new Km(this._firestore,this._userDataWriter,this._key,this._document,null);return this._converter.fromFirestore(t)}return this._userDataWriter.convertValue(this._document.data.value)}}_fieldsProto(){return this._document?.data.clone().value.mapValue.fields??void 0}get(t){if(this._document){const e=this._document.data.field(Mp("DocumentSnapshot.get",t));if(null!==e)return this._userDataWriter.convertValue(e)}}},Km=class extends zm{data(){return super.data()}};const Qm="AsyncQueue";class Wm{constructor(t=Promise.resolve()){this.$c=[],this.Kc=!1,this.Qc=[],this.Wc=null,this.Gc=!1,this.zc=!1,this.jc=[],this.Ht=new ip(this,"async_queue_retry"),this.Hc=()=>{const t=Im();t&&Qc(Qm,"Visibility state changed to "+t.visibilityState),this.Ht.$t()},this.Jc=t;const e=Im();e&&"function"==typeof e.addEventListener&&e.addEventListener("visibilitychange",this.Hc)}get isShuttingDown(){return this.Kc}enqueueAndForget(t){this.enqueue(t)}enqueueAndForgetEvenWhileRestricted(t){this.Yc(),this.Zc(t)}enterRestrictedMode(t){if(!this.Kc){this.Kc=!0,this.zc=t||!1;const e=Im();e&&"function"==typeof e.removeEventListener&&e.removeEventListener("visibilitychange",this.Hc)}}enqueue(t){if(this.Yc(),this.Kc)return new Promise(()=>{});const e=new Pd;return this.Zc(()=>this.Kc&&this.zc?Promise.resolve():(t().then(e.resolve,e.reject),e.promise)).then(()=>e.promise)}enqueueRetryable(t){this.enqueueAndForget(()=>(this.$c.push(t),this.Xc()))}async Xc(){if(0!==this.$c.length){try{await this.$c[0](),this.$c.shift(),this.Ht.reset()}catch(t){if(!wp(t))throw t;Qc(Qm,"Operation failed with retryable error: "+t)}this.$c.length>0&&this.Ht.kt(()=>this.Xc())}}Zc(t){const e=this.Jc.then(()=>(this.Gc=!0,t().catch(t=>{throw this.Wc=t,this.Gc=!1,Wc("INTERNAL UNHANDLED ERROR: ",Ym(t)),t}).then(t=>(this.Gc=!1,t))));return this.Jc=e,e}enqueueAfterDelay(t,e,n){this.Yc(),this.jc.indexOf(t)>-1&&(e=0);const s=_m.createAndSchedule(this,t,e,n,t=>this.el(t));return this.Qc.push(s),s}Yc(){this.Wc&&Zc(47125,{tl:Ym(this.Wc)})}verifyOperationInProgress(){}async nl(){let t;do{t=this.Jc,await t}while(t!==this.Jc)}rl(t){for(const e of this.Qc)if(e.timerId===t)return!0;return!1}il(t){return this.nl().then(()=>{this.Qc.sort((t,e)=>t.targetTimeMs-e.targetTimeMs);for(const e of this.Qc)if(e.skipDelay(),"all"!==t&&e.timerId===t)break;return this.nl()})}sl(t){this.jc.push(t)}el(t){const e=this.Qc.indexOf(t);this.Qc.splice(e,1)}}function Ym(t){let e=t.message||"";return t.stack&&(e=t.stack.includes(t.message)?t.stack:t.message+"\n"+t.stack),e}class Xm extends Op{constructor(t,e,n,s){super(t,e,n,s),this.type="firestore",this._queue=new Wm,this._persistenceKey=s?.name||"[DEFAULT]"}async _terminate(){if(this._firestoreClient){const t=this._firestoreClient.terminate();this._queue=new Wm(t),this._firestoreClient=void 0,await t}}}function Zm(t){if(t._terminated)throw new gl(Cl.FAILED_PRECONDITION,"The client has already been terminated.");return t._firestoreClient||function(t){const e=t._freezeSettings(),n=function(t,e,n,s,r){return new Wl(t,e,n,r.host,r.ssl,r.experimentalForceLongPolling,r.experimentalAutoDetectLongPolling,qd(r.experimentalLongPollingOptions),r.useFetchStreams,r.isUsingEmulator,s,r._customHeaders,r.grpcFlowControlWindow)}(t._databaseId,t._app?.options.appId||"",t._persistenceKey,t._app?.options.apiKey,e);t._componentsProvider||e.localCache?._offlineComponentProvider&&e.localCache?._onlineComponentProvider&&(t._componentsProvider={_offline:e.localCache._offlineComponentProvider,_online:e.localCache._onlineComponentProvider}),t._firestoreClient=new jm(t._authCredentials,t._appCheckCredentials,t._queue,n,t._componentsProvider&&function(t){const e=t?._online.build();return{_offline:t?._offline.build(e),_online:e}}(t._componentsProvider))}(t),t._firestoreClient}class tw{constructor(t,e){this.hasPendingWrites=t,this.fromCache=e}isEqual(t){return this.hasPendingWrites===t.hasPendingWrites&&this.fromCache===t.fromCache}}class ew extends zm{constructor(t,e,n,s,r,i){super(t,e,n,s,i),this._firestore=t,this._firestoreImpl=t,this.metadata=r}exists(){return super.exists()}data(t={}){if(this._document){if(this._converter){const e=new nw(this._firestore,this._userDataWriter,this._key,this._document,this.metadata,null);return this._converter.fromFirestore(e,t)}return this._userDataWriter.convertValue(this._document.data.value,t.serverTimestamps)}}get(t,e={}){if(this._document){const n=this._document.data.field(Mp("DocumentSnapshot.get",t));if(null!==n)return this._userDataWriter.convertValue(n,e.serverTimestamps)}}toJSON(){if(this.metadata.hasPendingWrites)throw new gl(Cl.FAILED_PRECONDITION,"DocumentSnapshot.toJSON() attempted to serialize a document with pending writes. Await waitForPendingWrites() before invoking toJSON().");const t=this._document,e={};return e.type=ew._jsonSchemaVersion,e.bundle="",e.bundleSource="DocumentSnapshot",e.bundleName=this._key.toString(),t&&t.isValidDocument()&&t.isFoundDocument()?(this._userDataWriter.convertObjectMap(t.data.value.mapValue.fields,"previous"),e.bundle=(this._firestore,this.ref.path,"NOT SUPPORTED"),e):e}}ew._jsonSchemaVersion="firestore/documentSnapshot/1.0",ew._jsonSchema={type:Nl("string",ew._jsonSchemaVersion),bundleSource:Nl("string","DocumentSnapshot"),bundleName:Nl("string"),bundle:Nl("string")};class nw extends ew{data(t={}){return super.data(t)}}class sw{constructor(t,e,n,s){this._firestore=t,this._userDataWriter=e,this._snapshot=s,this.metadata=new tw(s.hasPendingWrites,s.fromCache),this.query=n}get docs(){const t=[];return this.forEach(e=>t.push(e)),t}get size(){return this._snapshot.docs.size}get empty(){return 0===this.size}forEach(t,e){this._snapshot.docs.forEach(n=>{t.call(e,new nw(this._firestore,this._userDataWriter,n.key,n,new tw(this._snapshot.mutatedKeys.has(n.key),this._snapshot.fromCache),this.query.converter))})}docChanges(t={}){const e=!!t.includeMetadataChanges;if(e&&this._snapshot.excludesMetadataChanges)throw new gl(Cl.INVALID_ARGUMENT,"To include metadata changes with your document changes, you must also pass { includeMetadataChanges:true } to onSnapshot().");return this._cachedChanges&&this._cachedChangesIncludeMetadataChanges===e||(this._cachedChanges=function(t,e){if(t._snapshot.oldDocs.isEmpty()){let e=0;return t._snapshot.docChanges.map(n=>{Cg(t._snapshot.query)?function(t){const e=function(t){for(let e=t.stages.length-1;e>=0;e--){const n=t.stages[e];if(n instanceof wf)return n.orderings}throw new Error("Pipeline must contain at least one Sort stage")}(t)}(t._snapshot.query):Qh(t.query._query);const s=new nw(t._firestore,t._userDataWriter,n.doc.key,n.doc,new tw(t._snapshot.mutatedKeys.has(n.doc.key),t._snapshot.fromCache),t.query.converter);return n.doc,{type:"added",doc:s,oldIndex:-1,newIndex:e++}})}{let n=t._snapshot.oldDocs;return t._snapshot.docChanges.filter(t=>e||3!==t.type).map(e=>{const s=new nw(t._firestore,t._userDataWriter,e.doc.key,e.doc,new tw(t._snapshot.mutatedKeys.has(e.doc.key),t._snapshot.fromCache),t.query.converter);let r=-1,i=-1;return 0!==e.type&&(r=n.indexOf(e.doc.key),n=n.delete(e.doc.key)),1!==e.type&&(n=n.add(e.doc),i=n.indexOf(e.doc.key)),{type:rw(e.type),doc:s,oldIndex:r,newIndex:i}})}}(this,e),this._cachedChangesIncludeMetadataChanges=e),this._cachedChanges}toJSON(){if(this.metadata.hasPendingWrites)throw new gl(Cl.FAILED_PRECONDITION,"QuerySnapshot.toJSON() attempted to serialize a document with pending writes. Await waitForPendingWrites() before invoking toJSON().");const t={};t.type=sw._jsonSchemaVersion,t.bundleSource="QuerySnapshot",t.bundleName=rl.newId(),this._firestore._databaseId.database,this._firestore._databaseId.projectId;const e=[],n=[],s=[];return this.docs.forEach(t=>{null!==t._document&&(e.push(t._document),n.push(this._userDataWriter.convertObjectMap(t._document.data.value.mapValue.fields,"previous")),s.push(t.ref.path))}),t.bundle=(this._firestore,this.query._query,t.bundleName,"NOT SUPPORTED"),t}}function rw(t){switch(t){case 0:return"added";case 2:case 3:return"modified";case 1:return"removed";default:return Zc(61501,{type:t})}}function iw(t){return function(t,e){const n=Zm(t);return function(t,e){const n=new Pd;return t.asyncQueue.enqueueAndForget(async()=>Rm(await qm(t),e,n)),n.promise}(n,e)}(Rl(t.firestore,Xm),[new lh(t._key,Yu.none())])}sw._jsonSchemaVersion="firestore/querySnapshot/1.0",sw._jsonSchema={type:Nl("string",sw._jsonSchemaVersion),bundleSource:Nl("string","QuerySnapshot"),bundleName:Nl("string"),bundle:Nl("string")};const ow="@firebase/firestore",aw="4.17.2";!function(t,e=!0){(function(t){qc=t})(fr),lr(new es("firestore",(t,{instanceIdentifier:n,options:s})=>{const r=t.getProvider("app").getImmediate(),i=new Xm(new Ud(t.getProvider("auth-internal")),new Jd(r,t.getProvider("app-check-internal")),Zl(r,n),r);return s={useFetchStreams:e,...s},i._setSettings(s),i},"PUBLIC").setMultipleInstances(!0)),mr(ow,aw,t),mr(ow,aw,"esm2020")}();const Bw="firebasestorage.googleapis.com",cw="storageBucket";class lw extends Vn{constructor(t,e,n=0){super(dw(t),`Firebase Storage: ${e} (${dw(t)})`),this.status_=n,this.customData={serverResponse:null},this._baseMessage=this.message,Object.setPrototypeOf(this,lw.prototype)}get status(){return this.status_}set status(t){this.status_=t}_codeEquals(t){return dw(t)===this.code}get serverResponse(){return this.customData.serverResponse}set serverResponse(t){this.customData.serverResponse=t,this.customData.serverResponse?this.message=`${this._baseMessage}\n${this.customData.serverResponse}`:this.message=this._baseMessage}}var uw,hw;function dw(t){return"storage/"+t}function pw(){return new lw(uw.UNKNOWN,"An unknown error occurred, please check the error payload for server response.")}function fw(){return new lw(uw.RETRY_LIMIT_EXCEEDED,"Max retry time for operation exceeded, please try again.")}function Cw(){return new lw(uw.CANCELED,"User canceled the upload/download.")}function gw(){return new lw(uw.CANNOT_SLICE_BLOB,"Cannot slice blob for upload. Please retry the upload.")}function mw(t){return new lw(uw.INVALID_ARGUMENT,t)}function ww(){return new lw(uw.APP_DELETED,"The Firebase app was deleted.")}function yw(t,e){return new lw(uw.INVALID_FORMAT,"String does not match format '"+t+"': "+e)}function Ew(t){throw new lw(uw.INTERNAL_ERROR,"Internal error: "+t)}!function(t){t.UNKNOWN="unknown",t.OBJECT_NOT_FOUND="object-not-found",t.BUCKET_NOT_FOUND="bucket-not-found",t.PROJECT_NOT_FOUND="project-not-found",t.QUOTA_EXCEEDED="quota-exceeded",t.UNAUTHENTICATED="unauthenticated",t.UNAUTHORIZED="unauthorized",t.UNAUTHORIZED_APP="unauthorized-app",t.RETRY_LIMIT_EXCEEDED="retry-limit-exceeded",t.INVALID_CHECKSUM="invalid-checksum",t.CANCELED="canceled",t.INVALID_EVENT_NAME="invalid-event-name",t.INVALID_URL="invalid-url",t.INVALID_DEFAULT_BUCKET="invalid-default-bucket",t.NO_DEFAULT_BUCKET="no-default-bucket",t.CANNOT_SLICE_BLOB="cannot-slice-blob",t.SERVER_FILE_WRONG_SIZE="server-file-wrong-size",t.NO_DOWNLOAD_URL="no-download-url",t.INVALID_ARGUMENT="invalid-argument",t.INVALID_ARGUMENT_COUNT="invalid-argument-count",t.APP_DELETED="app-deleted",t.INVALID_ROOT_OPERATION="invalid-root-operation",t.INVALID_FORMAT="invalid-format",t.INTERNAL_ERROR="internal-error",t.UNSUPPORTED_ENVIRONMENT="unsupported-environment"}(uw||(uw={}));class _w{constructor(t,e){this.bucket=t,this.path_=e}get path(){return this.path_}get isRoot(){return 0===this.path.length}fullServerUrl(){const t=encodeURIComponent;return"/b/"+t(this.bucket)+"/o/"+t(this.path)}bucketOnlyServerUrl(){return"/b/"+encodeURIComponent(this.bucket)+"/o"}static makeFromBucketSpec(t,e){let n;try{n=_w.makeFromUrl(t,e)}catch(e){return new _w(t,"")}if(""===n.path)return n;throw s=t,new lw(uw.INVALID_DEFAULT_BUCKET,"Invalid default bucket '"+s+"'.");var s}static makeFromUrl(t,e){let n=null;const s="([A-Za-z0-9.\\-_]+)";const r=new RegExp("^gs://"+s+"(/(.*))?$","i");function i(t){t.path_=decodeURIComponent(t.path)}const o=e.replace(/[.]/g,"\\."),a=[{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/${s}/o(/([^?#]*).*)?$`,"i"),indices:{bucket:1,path:3},postModify:i},{regex:new RegExp(`^https?://${e===Bw?"(?:storage.googleapis.com|storage.cloud.google.com)":e}/${s}/([^?#]*)`,"i"),indices:{bucket:1,path:2},postModify:i}];for(let e=0;e<a.length;e++){const s=a[e],r=s.regex.exec(t);if(r){const t=r[s.indices.bucket];let e=r[s.indices.path];e||(e=""),n=new _w(t,e),s.postModify(n);break}}if(null==n)throw function(t){return new lw(uw.INVALID_URL,"Invalid URL '"+t+"'.")}(t);return n}}class Dw{constructor(t){this.promise_=Promise.reject(t)}getPromise(){return this.promise_}cancel(t=!1){}}function bw(t){return"string"==typeof t||t instanceof String}function vw(t){return Iw()&&t instanceof Blob}function Iw(){return"undefined"!=typeof Blob}function Tw(t,e,n,s){if(s<e)throw mw(`Invalid value for '${t}'. Expected ${e} or greater.`);if(s>n)throw mw(`Invalid value for '${t}'. Expected ${n} or less.`)}function Ow(t,e,n){let s=e;return null==n&&(s=`https://${e}`),`${n}://${s}/v0${t}`}function Aw(t){const e=encodeURIComponent;let n="?";for(const s in t)if(t.hasOwnProperty(s)){n=n+(e(s)+"="+e(t[s]))+"&"}return n=n.slice(0,-1),n}function Sw(t,e){const n=t>=500&&t<600,s=-1!==[408,429].indexOf(t),r=-1!==e.indexOf(t);return n||s||r}!function(t){t[t.NO_ERROR=0]="NO_ERROR",t[t.NETWORK_ERROR=1]="NETWORK_ERROR",t[t.ABORT=2]="ABORT"}(hw||(hw={}));class Rw{constructor(t,e,n,s,r,i,o,a,B,c,l,u=!0,h=!1){this.url_=t,this.method_=e,this.headers_=n,this.body_=s,this.successCodes_=r,this.additionalRetryCodes_=i,this.callback_=o,this.errorCallback_=a,this.timeout_=B,this.progressCallback_=c,this.connectionFactory_=l,this.retry=u,this.isUsingEmulator=h,this.pendingConnection_=null,this.backoffId_=null,this.canceled_=!1,this.appDelete_=!1,this.promise_=new Promise((t,e)=>{this.resolve_=t,this.reject_=e,this.start_()})}start_(){const t=(t,e)=>{if(e)return void t(!1,new Nw(!1,null,!0));const n=this.connectionFactory_();this.pendingConnection_=n;const s=t=>{const e=t.loaded,n=t.lengthComputable?t.total:-1;null!==this.progressCallback_&&this.progressCallback_(e,n)};null!==this.progressCallback_&&n.addUploadProgressListener(s),n.send(this.url_,this.method_,this.isUsingEmulator,this.body_,this.headers_).then(()=>{null!==this.progressCallback_&&n.removeUploadProgressListener(s),this.pendingConnection_=null;const e=n.getErrorCode()===hw.NO_ERROR,r=n.getStatus();if(!e||Sw(r,this.additionalRetryCodes_)&&this.retry){const e=n.getErrorCode()===hw.ABORT;return void t(!1,new Nw(!1,null,e))}const i=-1!==this.successCodes_.indexOf(r);t(!0,new Nw(i,n))})},e=(t,e)=>{const n=this.resolve_,s=this.reject_,r=e.connection;if(e.wasSuccessCode)try{const t=this.callback_(r,r.getResponse());!function(t){return void 0!==t}(t)?n():n(t)}catch(t){s(t)}else if(null!==r){const t=pw();t.serverResponse=r.getErrorText(),this.errorCallback_?s(this.errorCallback_(r,t)):s(t)}else if(e.canceled){s(this.appDelete_?ww():Cw())}else{s(fw())}};this.canceled_?e(0,new Nw(!1,null,!0)):this.backoffId_=function(t,e,n){let s=1,r=null,i=null,o=!1,a=0;function B(){return 2===a}let c=!1;function l(...t){c||(c=!0,e.apply(null,t))}function u(e){r=setTimeout(()=>{r=null,t(d,B())},e)}function h(){i&&clearTimeout(i)}function d(t,...e){if(c)return void h();if(t)return h(),void l.call(null,t,...e);if(B()||o)return h(),void l.call(null,t,...e);let n;s<64&&(s*=2),1===a?(a=2,n=0):n=1e3*(s+Math.random()),u(n)}let p=!1;function f(t){p||(p=!0,h(),c||(null!==r?(t||(a=2),clearTimeout(r),u(0)):t||(a=1)))}return u(0),i=setTimeout(()=>{o=!0,f(!0)},n),f}(t,e,this.timeout_)}getPromise(){return this.promise_}cancel(t){this.canceled_=!0,this.appDelete_=t||!1,null!==this.backoffId_&&(0,this.backoffId_)(!1),null!==this.pendingConnection_&&this.pendingConnection_.abort()}}class Nw{constructor(t,e,n){this.wasSuccessCode=t,this.connection=e,this.canceled=!!n}}function xw(){return"undefined"!=typeof BlobBuilder?BlobBuilder:"undefined"!=typeof WebKitBlobBuilder?WebKitBlobBuilder:void 0}function kw(...t){const e=xw();if(void 0!==e){const n=new e;for(let e=0;e<t.length;e++)n.append(t[e]);return n.getBlob()}if(Iw())return new Blob(t);throw new lw(uw.UNSUPPORTED_ENVIRONMENT,"This browser doesn't seem to support creating Blobs")}function Lw(t){if("undefined"==typeof atob)throw e="base-64",new lw(uw.UNSUPPORTED_ENVIRONMENT,`${e} is missing. Make sure to install the required polyfills. See https://firebase.google.com/docs/web/environments-js-sdk#polyfills for more information.`);var e;return atob(t)}const Fw="raw",Pw="base64",Mw="base64url",Gw="data_url";class Hw{constructor(t,e){this.data=t,this.contentType=e||null}}function Uw(t,e){switch(t){case Fw:return new Hw(Vw(e));case Pw:case Mw:return new Hw(jw(t,e));case Gw:return new Hw(function(t){const e=new $w(t);return e.base64?jw(Pw,e.rest):function(t){let e;try{e=decodeURIComponent(t)}catch(t){throw yw(Gw,"Malformed data URL.")}return Vw(e)}(e.rest)}(e),new $w(e).contentType)}throw pw()}function Vw(t){const e=[];for(let n=0;n<t.length;n++){let s=t.charCodeAt(n);if(s<=127)e.push(s);else if(s<=2047)e.push(192|s>>6,128|63&s);else if(55296==(64512&s)){if(n<t.length-1&&56320==(64512&t.charCodeAt(n+1))){s=65536|(1023&s)<<10|1023&t.charCodeAt(++n),e.push(240|s>>18,128|s>>12&63,128|s>>6&63,128|63&s)}else e.push(239,191,189)}else 56320==(64512&s)?e.push(239,191,189):e.push(224|s>>12,128|s>>6&63,128|63&s)}return new Uint8Array(e)}function jw(t,e){switch(t){case Pw:{const n=-1!==e.indexOf("-"),s=-1!==e.indexOf("_");if(n||s){throw yw(t,"Invalid character '"+(n?"-":"_")+"' found: is it base64url encoded?")}break}case Mw:{const n=-1!==e.indexOf("+"),s=-1!==e.indexOf("/");if(n||s){throw yw(t,"Invalid character '"+(n?"+":"/")+"' found: is it base64 encoded?")}e=e.replace(/-/g,"+").replace(/_/g,"/");break}}let n;try{n=Lw(e)}catch(e){if(e.message.includes("polyfill"))throw e;throw yw(t,"Invalid character found")}const s=new Uint8Array(n.length);for(let t=0;t<n.length;t++)s[t]=n.charCodeAt(t);return s}class $w{constructor(t){this.base64=!1,this.contentType=null;const e=t.match(/^data:([^,]+)?,/);if(null===e)throw yw(Gw,"Must be formatted 'data:[<mediatype>][;base64],<data>");const n=e[1]||null;null!=n&&(this.base64=function(t,e){const n=t.length>=e.length;if(!n)return!1;return t.substring(t.length-e.length)===e}(n,";base64"),this.contentType=this.base64?n.substring(0,n.length-7):n),this.rest=t.substring(t.indexOf(",")+1)}}class Jw{constructor(t,e){let n=0,s="";vw(t)?(this.data_=t,n=t.size,s=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_=s}size(){return this.size_}type(){return this.type_}slice(t,e){if(vw(this.data_)){const n=function(t,e,n){return t.webkitSlice?t.webkitSlice(e,n):t.mozSlice?t.mozSlice(e,n):t.slice?t.slice(e,n):null}(this.data_,t,e);return null===n?null:new Jw(n)}{const n=new Uint8Array(this.data_.buffer,t,e-t);return new Jw(n,!0)}}static getBlob(...t){if(Iw()){const e=t.map(t=>t instanceof Jw?t.data_:t);return new Jw(kw.apply(null,e))}{const e=t.map(t=>bw(t)?Uw(Fw,t).data:t.data_);let n=0;e.forEach(t=>{n+=t.byteLength});const s=new Uint8Array(n);let r=0;return e.forEach(t=>{for(let e=0;e<t.length;e++)s[r++]=t[e]}),new Jw(s,!0)}}uploadData(){return this.data_}}function qw(t){let e;try{e=JSON.parse(t)}catch(t){return null}return function(t){return"object"==typeof t&&!Array.isArray(t)}(e)?e:null}function zw(t){const e=t.lastIndexOf("/",t.length-2);return-1===e?t:t.slice(e+1)}function Kw(t,e){return e}class Qw{constructor(t,e,n,s){this.server=t,this.local=e||t,this.writable=!!n,this.xform=s||Kw}}let Ww=null;function Yw(){if(Ww)return Ww;const t=[];t.push(new Qw("bucket")),t.push(new Qw("generation")),t.push(new Qw("metageneration")),t.push(new Qw("name","fullPath",!0));const e=new Qw("name");e.xform=function(t,e){return function(t){return!bw(t)||t.length<2?t:zw(t)}(e)},t.push(e);const n=new Qw("size");return n.xform=function(t,e){return void 0!==e?Number(e):e},t.push(n),t.push(new Qw("timeCreated")),t.push(new Qw("updated")),t.push(new Qw("md5Hash",null,!0)),t.push(new Qw("cacheControl",null,!0)),t.push(new Qw("contentDisposition",null,!0)),t.push(new Qw("contentEncoding",null,!0)),t.push(new Qw("contentLanguage",null,!0)),t.push(new Qw("contentType",null,!0)),t.push(new Qw("metadata","customMetadata",!0)),Ww=t,Ww}function Xw(t,e,n){const s={type:"file"},r=n.length;for(let t=0;t<r;t++){const r=n[t];s[r.local]=r.xform(s,e[r.server])}return function(t,e){Object.defineProperty(t,"ref",{get:function(){const n=t.bucket,s=t.fullPath,r=new _w(n,s);return e._makeStorageReference(r)}})}(s,t),s}function Zw(t,e,n){const s=qw(e);if(null===s)return null;return Xw(t,s,n)}function ty(t,e){const n={},s=e.length;for(let r=0;r<s;r++){const s=e[r];s.writable&&(n[s.server]=t[s.local])}return JSON.stringify(n)}const ey="prefixes",ny="items";function sy(t,e,n){const s=qw(n);if(null===s)return null;return function(t,e,n){const s={prefixes:[],items:[],nextPageToken:n.nextPageToken};if(n[ey])for(const r of n[ey]){const n=r.replace(/\/$/,""),i=t._makeStorageReference(new _w(e,n));s.prefixes.push(i)}if(n[ny])for(const r of n[ny]){const n=t._makeStorageReference(new _w(e,r.name));s.items.push(n)}return s}(t,e,s)}class ry{constructor(t,e,n,s){this.url=t,this.method=e,this.handler=n,this.timeout=s,this.urlParams={},this.headers={},this.body=null,this.errorHandler=null,this.progressCallback=null,this.successCodes=[200],this.additionalRetryCodes=[]}}function iy(t){if(!t)throw pw()}function oy(t,e){return function(n,s){const r=Zw(t,s,e);return iy(null!==r),r}}function ay(t,e){return function(n,s){const r=Zw(t,s,e);return iy(null!==r),function(t,e,n,s){const r=qw(e);if(null===r)return null;if(!bw(r.downloadTokens))return null;const i=r.downloadTokens;if(0===i.length)return null;const o=encodeURIComponent;return i.split(",").map(e=>{const r=t.bucket,i=t.fullPath;return Ow("/b/"+o(r)+"/o/"+o(i),n,s)+Aw({alt:"media",token:e})})[0]}(r,s,t.host,t._protocol)}}function By(t){return function(e,n){let s;var r,i;return 401===e.getStatus()?s=e.getErrorText().includes("Firebase App Check token is invalid")?new lw(uw.UNAUTHORIZED_APP,"This app does not have permission to access Firebase Storage on this project."):new lw(uw.UNAUTHENTICATED,"User is not authenticated, please authenticate using Firebase Authentication and try again."):402===e.getStatus()?(i=t.bucket,s=new lw(uw.QUOTA_EXCEEDED,"Quota for bucket '"+i+"' exceeded, please view quota on https://firebase.google.com/pricing/.")):403===e.getStatus()?(r=t.path,s=new lw(uw.UNAUTHORIZED,"User does not have permission to access '"+r+"'.")):s=n,s.status=e.getStatus(),s.serverResponse=n.serverResponse,s}}function cy(t){const e=By(t);return function(n,s){let r=e(n,s);var i;return 404===n.getStatus()&&(i=t.path,r=new lw(uw.OBJECT_NOT_FOUND,"Object '"+i+"' does not exist.")),r.serverResponse=s.serverResponse,r}}function ly(t,e,n,s,r){const i={};e.isRoot?i.prefix="":i.prefix=e.path+"/",n.length>0&&(i.delimiter=n),s&&(i.pageToken=s),r&&(i.maxResults=r);const o=Ow(e.bucketOnlyServerUrl(),t.host,t._protocol),a=t.maxOperationRetryTime,B=new ry(o,"GET",function(t,e){return function(n,s){const r=sy(t,e,s);return iy(null!==r),r}}(t,e.bucket),a);return B.urlParams=i,B.errorHandler=By(e),B}function uy(t,e,n){const s=Object.assign({},n);return s.fullPath=t.path,s.size=e.size(),s.contentType||(s.contentType=function(t,e){return t&&t.contentType||e&&e.type()||"application/octet-stream"}(null,e)),s}class hy{constructor(t,e,n,s){this.current=t,this.total=e,this.finalized=!!n,this.metadata=s||null}}function dy(t,e){let n=null;try{n=t.getResponseHeader("X-Goog-Upload-Status")}catch(t){iy(!1)}return iy(!!n&&-1!==(e||["active"]).indexOf(n)),n}const py=262144;function fy(t,e,n,s,r,i,o,a){const B=new hy(0,0);if(o?(B.current=o.current,B.total=o.total):(B.current=0,B.total=s.size()),s.size()!==B.total)throw new lw(uw.SERVER_FILE_WRONG_SIZE,"Server recorded incorrect upload file size, please retry the upload.");const c=B.total-B.current;let l=c;r>0&&(l=Math.min(l,r));const u=B.current,h=u+l;let d="";d=0===l?"finalize":c===l?"upload, finalize":"upload";const p={"X-Goog-Upload-Command":d,"X-Goog-Upload-Offset":`${B.current}`},f=s.slice(u,h);if(null===f)throw gw();const C=e.maxUploadRetryTime,g=new ry(n,"POST",function(t,n){const r=dy(t,["active","final"]),o=B.current+l,a=s.size();let c;return c="final"===r?oy(e,i)(t,n):null,new hy(o,a,"final"===r,c)},C);return g.headers=p,g.body=f.uploadData(),g.progressCallback=a||null,g.errorHandler=By(t),g}const Cy="running",gy="paused",my="success",wy="canceled",yy="error";function Ey(t){switch(t){case"running":case"pausing":case"canceling":return Cy;case"paused":return gy;case"success":return my;case"canceled":return wy;default:return yy}}class _y{constructor(t,e,n){const s=function(t){return"function"==typeof t}(t)||null!=e||null!=n;if(s)this.next=t,this.error=e??void 0,this.complete=n??void 0;else{const e=t;this.next=e.next,this.error=e.error,this.complete=e.complete}}}function Dy(t){return(...e)=>{Promise.resolve().then(()=>t(...e))}}class by{constructor(){this.sent_=!1,this.xhr_=new XMLHttpRequest,this.initXhr(),this.errorCode_=hw.NO_ERROR,this.sendPromise_=new Promise(t=>{this.xhr_.addEventListener("abort",()=>{this.errorCode_=hw.ABORT,t()}),this.xhr_.addEventListener("error",()=>{this.errorCode_=hw.NETWORK_ERROR,t()}),this.xhr_.addEventListener("load",()=>{t()})})}send(t,e,n,s,r){if(this.sent_)throw Ew("cannot .send() more than once");if(Zn(t)&&n&&(this.xhr_.withCredentials=!0),this.sent_=!0,this.xhr_.open(e,t,!0),void 0!==r)for(const t in r)r.hasOwnProperty(t)&&this.xhr_.setRequestHeader(t,r[t].toString());return void 0!==s?this.xhr_.send(s):this.xhr_.send(),this.sendPromise_}getErrorCode(){if(!this.sent_)throw Ew("cannot .getErrorCode() before sending");return this.errorCode_}getStatus(){if(!this.sent_)throw Ew("cannot .getStatus() before sending");try{return this.xhr_.status}catch(t){return-1}}getResponse(){if(!this.sent_)throw Ew("cannot .getResponse() before sending");return this.xhr_.response}getErrorText(){if(!this.sent_)throw Ew("cannot .getErrorText() before sending");return this.xhr_.statusText}abort(){this.xhr_.abort()}getResponseHeader(t){return this.xhr_.getResponseHeader(t)}addUploadProgressListener(t){null!=this.xhr_.upload&&this.xhr_.upload.addEventListener("progress",t)}removeUploadProgressListener(t){null!=this.xhr_.upload&&this.xhr_.upload.removeEventListener("progress",t)}}class vy extends by{initXhr(){this.xhr_.responseType="text"}}function Iy(){return new vy}class Ty{isExponentialBackoffExpired(){return this.sleepTime>this.maxSleepTime}constructor(t,e,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=Yw(),this._resumable=this._shouldDoResumable(this._blob),this._state="running",this._errorHandler=t=>{if(this._request=void 0,this._chunkMultiplier=1,t._codeEquals(uw.CANCELED))this._needToFetchStatus=!0,this.completeTransitions_();else{const e=this.isExponentialBackoffExpired();if(Sw(t.status,[])){if(!e)return this.sleepTime=Math.max(2*this.sleepTime,1e3),this._needToFetchStatus=!0,void this.completeTransitions_();t=fw()}this._error=t,this._transition("error")}},this._metadataErrorHandler=t=>{this._request=void 0,t._codeEquals(uw.CANCELED)?this.completeTransitions_():(this._error=t,this._transition("error"))},this.sleepTime=0,this.maxSleepTime=this._ref.storage.maxUploadRetryTime,this._promise=new Promise((t,e)=>{this._resolve=t,this._reject=e,this._start()}),this._promise.then(null,()=>{})}_makeProgressCallback(){const t=this._transferred;return e=>this._updateProgress(t+e)}_shouldDoResumable(t){return t.size()>262144}_start(){"running"===this._state&&void 0===this._request&&(this._resumable?void 0===this._uploadUrl?this._createResumable():this._needToFetchStatus?this._fetchStatus():this._needToFetchMetadata?this._fetchMetadata():this.pendingTimeout=setTimeout(()=>{this.pendingTimeout=void 0,this._continueUpload()},this.sleepTime):this._oneShotUpload())}_resolveToken(t){Promise.all([this._ref.storage._getAuthToken(),this._ref.storage._getAppCheckToken()]).then(([e,n])=>{switch(this._state){case"running":t(e,n);break;case"canceling":this._transition("canceled");break;case"pausing":this._transition("paused")}})}_createResumable(){this._resolveToken((t,e)=>{const n=function(t,e,n,s,r){const i=e.bucketOnlyServerUrl(),o=uy(e,s,r),a={name:o.fullPath},B=Ow(i,t.host,t._protocol),c={"X-Goog-Upload-Protocol":"resumable","X-Goog-Upload-Command":"start","X-Goog-Upload-Header-Content-Length":`${s.size()}`,"X-Goog-Upload-Header-Content-Type":o.contentType,"Content-Type":"application/json; charset=utf-8"},l=ty(o,n),u=t.maxUploadRetryTime,h=new ry(B,"POST",function(t){let e;dy(t);try{e=t.getResponseHeader("X-Goog-Upload-URL")}catch(t){iy(!1)}return iy(bw(e)),e},u);return h.urlParams=a,h.headers=c,h.body=l,h.errorHandler=By(e),h}(this._ref.storage,this._ref._location,this._mappings,this._blob,this._metadata),s=this._ref.storage._makeRequest(n,Iy,t,e);this._request=s,s.getPromise().then(t=>{this._request=void 0,this._uploadUrl=t,this._needToFetchStatus=!1,this.completeTransitions_()},this._errorHandler)})}_fetchStatus(){const t=this._uploadUrl;this._resolveToken((e,n)=>{const s=function(t,e,n,s){const r=t.maxUploadRetryTime,i=new ry(n,"POST",function(t){const e=dy(t,["active","final"]);let n=null;try{n=t.getResponseHeader("X-Goog-Upload-Size-Received")}catch(t){iy(!1)}n||iy(!1);const r=Number(n);return iy(!isNaN(r)),new hy(r,s.size(),"final"===e)},r);return i.headers={"X-Goog-Upload-Command":"query"},i.errorHandler=By(e),i}(this._ref.storage,this._ref._location,t,this._blob),r=this._ref.storage._makeRequest(s,Iy,e,n);this._request=r,r.getPromise().then(t=>{this._request=void 0,this._updateProgress(t.current),this._needToFetchStatus=!1,t.finalized&&(this._needToFetchMetadata=!0),this.completeTransitions_()},this._errorHandler)})}_continueUpload(){const t=py*this._chunkMultiplier,e=new hy(this._transferred,this._blob.size()),n=this._uploadUrl;this._resolveToken((s,r)=>{let i;try{i=fy(this._ref._location,this._ref.storage,n,this._blob,t,this._mappings,e,this._makeProgressCallback())}catch(t){return this._error=t,void this._transition("error")}const o=this._ref.storage._makeRequest(i,Iy,s,r,!1);this._request=o,o.getPromise().then(t=>{this._increaseMultiplier(),this._request=void 0,this._updateProgress(t.current),t.finalized?(this._metadata=t.metadata,this._transition("success")):this.completeTransitions_()},this._errorHandler)})}_increaseMultiplier(){2*(py*this._chunkMultiplier)<33554432&&(this._chunkMultiplier*=2)}_fetchMetadata(){this._resolveToken((t,e)=>{const n=function(t,e,n){const s=Ow(e.fullServerUrl(),t.host,t._protocol),r=t.maxOperationRetryTime,i=new ry(s,"GET",oy(t,n),r);return i.errorHandler=cy(e),i}(this._ref.storage,this._ref._location,this._mappings),s=this._ref.storage._makeRequest(n,Iy,t,e);this._request=s,s.getPromise().then(t=>{this._request=void 0,this._metadata=t,this._transition("success")},this._metadataErrorHandler)})}_oneShotUpload(){this._resolveToken((t,e)=>{const n=function(t,e,n,s,r){const i=e.bucketOnlyServerUrl(),o={"X-Goog-Upload-Protocol":"multipart"},a=function(){let t="";for(let e=0;e<2;e++)t+=Math.random().toString().slice(2);return t}();o["Content-Type"]="multipart/related; boundary="+a;const B=uy(e,s,r),c="--"+a+"\r\nContent-Type: application/json; charset=utf-8\r\n\r\n"+ty(B,n)+"\r\n--"+a+"\r\nContent-Type: "+B.contentType+"\r\n\r\n",l="\r\n--"+a+"--",u=Jw.getBlob(c,s,l);if(null===u)throw gw();const h={name:B.fullPath},d=Ow(i,t.host,t._protocol),p=t.maxUploadRetryTime,f=new ry(d,"POST",oy(t,n),p);return f.urlParams=h,f.headers=o,f.body=u.uploadData(),f.errorHandler=By(e),f}(this._ref.storage,this._ref._location,this._mappings,this._blob,this._metadata),s=this._ref.storage._makeRequest(n,Iy,t,e);this._request=s,s.getPromise().then(t=>{this._request=void 0,this._metadata=t,this._updateProgress(this._blob.size()),this._transition("success")},this._errorHandler)})}_updateProgress(t){const e=this._transferred;this._transferred=t,this._transferred!==e&&this._notifyObservers()}_transition(t){if(this._state!==t)switch(t){case"canceling":case"pausing":this._state=t,void 0!==this._request?this._request.cancel():this.pendingTimeout&&(clearTimeout(this.pendingTimeout),this.pendingTimeout=void 0,this.completeTransitions_());break;case"running":const e="paused"===this._state;this._state=t,e&&(this._notifyObservers(),this._start());break;case"paused":case"error":case"success":this._state=t,this._notifyObservers();break;case"canceled":this._error=Cw(),this._state=t,this._notifyObservers()}}completeTransitions_(){switch(this._state){case"pausing":this._transition("paused");break;case"canceling":this._transition("canceled");break;case"running":this._start()}}get snapshot(){const t=Ey(this._state);return{bytesTransferred:this._transferred,totalBytes:this._blob.size(),state:t,metadata:this._metadata,task:this,ref:this._ref}}on(t,e,n,s){const r=new _y(e||void 0,n||void 0,s||void 0);return this._addObserver(r),()=>{this._removeObserver(r)}}then(t,e){return this._promise.then(t,e)}catch(t){return this.then(null,t)}_addObserver(t){this._observers.push(t),this._notifyObserver(t)}_removeObserver(t){const e=this._observers.indexOf(t);-1!==e&&this._observers.splice(e,1)}_notifyObservers(){this._finishPromise();this._observers.slice().forEach(t=>{this._notifyObserver(t)})}_finishPromise(){if(void 0!==this._resolve){let t=!0;switch(Ey(this._state)){case my:Dy(this._resolve.bind(null,this.snapshot))();break;case wy:case yy:Dy(this._reject.bind(null,this._error))();break;default:t=!1}t&&(this._resolve=void 0,this._reject=void 0)}}_notifyObserver(t){switch(Ey(this._state)){case Cy:case gy:t.next&&Dy(t.next.bind(t,this.snapshot))();break;case my:t.complete&&Dy(t.complete.bind(t))();break;default:t.error&&Dy(t.error.bind(t,this._error))()}}resume(){const t="paused"===this._state||"pausing"===this._state;return t&&this._transition("running"),t}pause(){const t="running"===this._state;return t&&this._transition("pausing"),t}cancel(){const t="running"===this._state||"pausing"===this._state;return t&&this._transition("canceling"),t}}class Oy{constructor(t,e){this._service=t,this._location=e instanceof _w?e:_w.makeFromUrl(e,t.host)}toString(){return"gs://"+this._location.bucket+"/"+this._location.path}_newRef(t,e){return new Oy(t,e)}get root(){const t=new _w(this._location.bucket,"");return this._newRef(this._service,t)}get bucket(){return this._location.bucket}get fullPath(){return this._location.path}get name(){return zw(this._location.path)}get storage(){return this._service}get parent(){const t=function(t){if(0===t.length)return null;const e=t.lastIndexOf("/");return-1===e?"":t.slice(0,e)}(this._location.path);if(null===t)return null;const e=new _w(this._location.bucket,t);return new Oy(this._service,e)}_throwIfRoot(t){if(""===this._location.path)throw function(t){return new lw(uw.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').")}(t)}}function Ay(t){const e={prefixes:[],items:[]};return Sy(t,e).then(()=>e)}async function Sy(t,e,n){const s={pageToken:n},r=await function(t,e){null!=e&&"number"==typeof e.maxResults&&Tw("options.maxResults",1,1e3,e.maxResults);const n=e||{},s=ly(t.storage,t._location,"/",n.pageToken,n.maxResults);return t.storage.makeRequestWithTokens(s,Iy)}(t,s);e.prefixes.push(...r.prefixes),e.items.push(...r.items),null!=r.nextPageToken&&await Sy(t,e,r.nextPageToken)}function Ry(t){t._throwIfRoot("getDownloadURL");const e=function(t,e,n){const s=Ow(e.fullServerUrl(),t.host,t._protocol),r=t.maxOperationRetryTime,i=new ry(s,"GET",ay(t,n),r);return i.errorHandler=cy(e),i}(t.storage,t._location,Yw());return t.storage.makeRequestWithTokens(e,Iy).then(t=>{if(null===t)throw new lw(uw.NO_DOWNLOAD_URL,"The given file does not have any download URLs.");return t})}function Ny(t){t._throwIfRoot("deleteObject");const e=function(t,e){const n=Ow(e.fullServerUrl(),t.host,t._protocol),s=t.maxOperationRetryTime,r=new ry(n,"DELETE",function(t,e){},s);return r.successCodes=[200,204],r.errorHandler=cy(e),r}(t.storage,t._location);return t.storage.makeRequestWithTokens(e,Iy)}function xy(t,e){if(t instanceof Fy){const n=t;if(null==n._bucket)throw new lw(uw.NO_DEFAULT_BUCKET,"No default bucket found. Did you set the '"+cw+"' property when initializing the app?");const s=new Oy(n,n._bucket);return null!=e?xy(s,e):s}return void 0!==e?function(t,e){const n=function(t,e){const n=e.split("/").filter(t=>t.length>0).join("/");return 0===t.length?n:t+"/"+n}(t._location.path,e),s=new _w(t._location.bucket,n);return new Oy(t.storage,s)}(t,e):t}function ky(t,e){if(e&&/^[A-Za-z]+:\/\//.test(e)){if(t instanceof Fy)return new Oy(t,e);throw mw("To use ref(service, url), the first argument must be a Storage instance.")}return xy(t,e)}function Ly(t,e){const n=e?.[cw];return null==n?null:_w.makeFromBucketSpec(n,t)}class Fy{constructor(t,e,n,s,r,i=!1){this.app=t,this._authProvider=e,this._appCheckProvider=n,this._url=s,this._firebaseVersion=r,this._isUsingEmulator=i,this._bucket=null,this._host=Bw,this._protocol="https",this._appId=null,this._deleted=!1,this._maxOperationRetryTime=12e4,this._maxUploadRetryTime=6e5,this._requests=new Set,this._bucket=null!=s?_w.makeFromBucketSpec(s,this._host):Ly(this._host,this.app.options)}get host(){return this._host}set host(t){this._host=t,null!=this._url?this._bucket=_w.makeFromBucketSpec(this._url,t):this._bucket=Ly(t,this.app.options)}get maxUploadRetryTime(){return this._maxUploadRetryTime}set maxUploadRetryTime(t){Tw("time",0,Number.POSITIVE_INFINITY,t),this._maxUploadRetryTime=t}get maxOperationRetryTime(){return this._maxOperationRetryTime}set maxOperationRetryTime(t){Tw("time",0,Number.POSITIVE_INFINITY,t),this._maxOperationRetryTime=t}async _getAuthToken(){if(this._overrideAuthToken)return this._overrideAuthToken;const t=this._authProvider.getImmediate({optional:!0});if(t){const e=await t.getToken();if(null!==e)return e.accessToken}return null}async _getAppCheckToken(){if(hr(this.app)&&this.app.settings.appCheckToken)return this.app.settings.appCheckToken;const t=this._appCheckProvider.getImmediate({optional:!0});if(t){return(await t.getToken()).token}return null}_delete(){return this._deleted||(this._deleted=!0,this._requests.forEach(t=>t.cancel()),this._requests.clear()),Promise.resolve()}_makeStorageReference(t){return new Oy(this,t)}_makeRequest(t,e,n,s,r=!0){if(this._deleted)return new Dw(ww());{const i=function(t,e,n,s,r,i,o=!0,a=!1){const B=Aw(t.urlParams),c=t.url+B,l=Object.assign({},t.headers);return function(t,e){e&&(t["X-Firebase-GMPID"]=e)}(l,e),function(t,e){null!==e&&e.length>0&&(t.Authorization="Firebase "+e)}(l,n),function(t,e){t["X-Firebase-Storage-Version"]="webjs/"+(e??"AppManager")}(l,i),function(t,e){null!==e&&(t["X-Firebase-AppCheck"]=e)}(l,s),new Rw(c,t.method,l,t.body,t.successCodes,t.additionalRetryCodes,t.handler,t.errorHandler,t.timeout,t.progressCallback,r,o,a)}(t,this._appId,n,s,e,this._firebaseVersion,r,this._isUsingEmulator);return this._requests.add(i),i.getPromise().then(()=>this._requests.delete(i),()=>this._requests.delete(i)),i}}async makeRequestWithTokens(t,e){const[n,s]=await Promise.all([this._getAuthToken(),this._getAppCheckToken()]);return this._makeRequest(t,e,n,s).getPromise()}}const Py="@firebase/storage",My="0.14.5",Gy="storage";function Hy(t,e,n){return function(t,e,n){return t._throwIfRoot("uploadBytesResumable"),new Ty(t,new Jw(e),n)}(t=Xn(t),e,n)}function Uy(t){return Ay(t=Xn(t))}function Vy(t){return Ny(t=Xn(t))}function jy(t,e){return ky(t=Xn(t),e)}function $y(t=gr(),e){const n=ur(t=Xn(t),Gy).getImmediate({identifier:e}),s=Rn("storage");return s&&function(t,e,n,s={}){!function(t,e,n,s={}){t.host=`${e}:${n}`;const r=Zn(e);r&&ts(`https://${t.host}/b`),t._isUsingEmulator=!0,t._protocol=r?"https":"http";const{mockUserToken:i}=s;i&&(t._overrideAuthToken="string"==typeof i?i:Ln(i,t.app.options.projectId))}(t,e,n,s)}(n,...s),n}function Jy(t,{instanceIdentifier:e}){const n=t.getProvider("app").getImmediate(),s=t.getProvider("auth-internal"),r=t.getProvider("app-check-internal");return new Fy(n,s,r,e,fr)}lr(new es(Gy,Jy,"PUBLIC").setMultipleInstances(!0)),mr(Py,My,""),mr(Py,My,"esm2020");let qy,zy,Ky,Qy,Wy={},Yy=null,Xy=!1;const Zy=[];let tE;function eE(){return tE}function nE(){return Xy}function sE(t){Xy?t():Zy.push(t)}function rE(){const t="undefined"==typeof process?void 0:process.env,e=t?.FIREBASE_CONFIG;if(!e)return null;const n=JSON.parse(e);return n&&n.apiKey?n:null}function iE(t){if(t&&Object.prototype.hasOwnProperty.call(t,"actionCodeSettings")&&(tE=t.actionCodeSettings),Xy){if(t?.app&&t.app!==qy)throw new Error("pwa-auth: Firebase app is already set");return qy}if(t?.app)qy=t.app,Wy=qy.options;else{const e=t?.config??rE();if(!e)throw new Error("pwa-auth: pass initialize({ config }) or set window.process.env.FIREBASE_CONFIG");Wy=e,qy=Cr(Wy)}return zy=function(t){const e="object"==typeof t?t:gr(),n="string"==typeof t?t:Yl,s=ur(e,"firestore").getImmediate({identifier:n});if(!s._initialized){const t=Rn("firestore");t&&Ap(s,...t)}return s}(qy),Ky=$y(qy),Qy=Ka(qy),Yy=Qy.currentUser,Xy=!0,Zy.splice(0).forEach(t=>t()),qy}const oE=rE();oE&&iE({config:oE});const aE={bubbles:!0,composed:!0};function BE(t){return t?{uid:t.uid,displayName:t.displayName,email:t.email,photoURL:t.photoURL,emailVerified:!0===t.emailVerified}:null}function cE(t,e){window.dispatchEvent(new CustomEvent(t,{...aE,detail:e}))}function lE(t){if("object"==typeof t&&null!==t&&"code"in t){const e=String(t.code);return{code:e,message:t instanceof Error?t.message:e}}return{code:"pwa/unknown",message:t instanceof Error?t.message:"Authentication failed"}}const uE=new Set(["auth/popup-closed-by-user","auth/cancelled-popup-request","auth/user-cancelled"]);let hE=null,dE=!1;function pE(){const t=hE;return hE=null,t}function fE(){return new go}async function CE(t){if(function(t){return/Android|iPhone|iPad|iPod/i.test(t)}("undefined"==typeof navigator?"":navigator.userAgent))return await Ca(Qy,fE()),"redirect";try{return await async function(t,e,n){if(hr(t.app))return Promise.reject(Fr(t,"operation-not-supported-in-this-environment"));const s=ji(t);Gr(t,e,po);const r=sa(s,n);return new la(s,"signInViaPopup",e,r).executeNotNull()}(Qy,fE()),"ok"}catch(t){const e=lE(t).code;if(uE.has(e))return"quiet";if("auth/popup-blocked"===e)return await Ca(Qy,fE()),"redirect";throw t}}function gE(){dE||(dE=!0,sE(()=>{(async function(t,e){return await ji(t)._initializationPromise,ga(t,e,!1)})(Qy).catch(t=>{!function(t){hE=lE(t)}(t)})}))}const mE="pwa-auth-changed",wE="pwa-login",yE="pwa-logout",EE="pwa-signup",_E="pwa-account-deleted",DE="pwa-profile-updated",bE="pwa-email-changed",vE="pwa-password-changed",IE="pwa-reset-sent",TE="pwa-drawer-toggle",OE="pwa-settings",AE="pwa-auth-error",SE="pwa-verification-sent",RE="pwa-email-verified",NE={authChanged:mE,login:wE,logout:yE,signup:EE,accountDeleted:_E,profileUpdated:DE,emailChanged:bE,passwordChanged:vE,resetSent:IE,drawerToggle:TE,settings:OE,authError:AE,verificationSent:SE,emailVerified:RE},xE=128,kE="At least 8 characters. A passphrase works well.",LE="Use at least 8 characters.",FE="Use at most 128 characters.",PE="Passwords don't match.";function ME(t){return t.length<8?{code:"pwa/short-password",message:LE}:t.length>xE?{code:"pwa/long-password",message:FE}:null}const GE={"auth/invalid-email":"Enter a valid email address.","auth/user-not-found":"No account uses that email.","auth/wrong-password":"That password is wrong.","auth/invalid-credential":"That email or password is wrong.","auth/invalid-login-credentials":"That email or password is wrong.","auth/user-token-expired":"This account is no longer available.","auth/invalid-user-token":"This account is no longer available.","auth/user-disabled":"This account is disabled.","auth/email-already-in-use":"An account already uses that email.","auth/account-exists-with-different-credential":"That email already has an account. Sign in with email and password.","auth/weak-password":LE,"auth/too-many-requests":"Too many tries. Wait and try again.","auth/network-request-failed":"Network problem. Try again.","auth/requires-recent-login":"Sign in again, then retry.","pwa/missing-email":"Enter an email address.","pwa/invalid-email":"Enter a valid email address.","pwa/missing-password":"Enter a password.","pwa/short-password":LE,"pwa/long-password":FE,"pwa/current-password":"Enter your current password.","pwa/password-mismatch":PE,"pwa/weak-password":LE,"pwa/signed-out":"Sign in first.","pwa/missing-file":"Choose a photo first.","pwa/not-image":"Choose an image file.","pwa/photo-too-large":"Choose an image under 5 MB.","pwa/photo-unreadable":"That image could not be prepared. Try another.","pwa/not-ready":"Sign-in is not ready yet.","pwa/unknown":"Something went wrong. Try again."};function HE(t){const e=lE(t);return GE[e.code]??"Something went wrong. Try again."}const UE=i`
195
200
 
196
201
  .action-button:focus { outline: 0; }
197
202
 
@@ -520,7 +525,7 @@ const t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow
520
525
  ${QE}
521
526
  Continue with Google
522
527
  </button>
523
- `}let YE="";const XE=new Set;function ZE(t){const e=t.trim();e!==YE&&(YE=e,e&&XE.forEach(t=>t()))}function tD(){return YE}var eD=function(t,e,n,s){var r,i=arguments.length,o=i<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,n):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,s);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(i<3?r(o):i>3?r(e,n,o):r(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},nD=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let sD=class extends it{constructor(){super(),this.source="",this.hideGoogle=!1,this.email="",this.password="",this.status="",this.tone="",this.busy=!1,this.resetBusy=!1,this.showPassword=!1,this.signIn=async(t,e)=>{this.busy=!0,this.tone="",this.status="";try{const n=BE((await So(Qy,t,e)).user);n&&cE(wE,{user:n})}catch(t){this.show(lE(t))}finally{this.busy=!1}},this.forgot=async()=>{if(this.busy||this.resetBusy)return;this.readFields();const t=this.email.trim();if(t.length<4)this.show({code:"pwa/missing-email",message:"Enter an email address."});else if(/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t)){this.resetBusy=!0,this.tone="",this.status="";try{await Ao(Qy,t),this.sent(t)}catch(e){"auth/user-not-found"===lE(e).code?this.sent(t):this.show(lE(e))}finally{this.resetBusy=!1}}else this.show({code:"pwa/invalid-email",message:"Enter a valid email address."})}}connectedCallback(){super.connectedCallback(),this.adoptRedirect()}updated(){this.adoptRedirect()}adoptRedirect(){if(!this.classList.contains("opened"))return;const t=pE();t&&this.show(t)}static get styles(){return[Dn,VE,jE,UE,$E,JE,zE,i`
528
+ `}let YE="";const XE=new Set;function ZE(t){const e=t.trim();e!==YE&&(YE=e,e&&XE.forEach(t=>t()))}function t_(){return YE}var e_=function(t,e,n,s){var r,i=arguments.length,o=i<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,n):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,s);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(i<3?r(o):i>3?r(e,n,o):r(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},n_=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let s_=class extends it{constructor(){super(),this.source="",this.hideGoogle=!1,this.email="",this.password="",this.status="",this.tone="",this.busy=!1,this.resetBusy=!1,this.showPassword=!1,this.signIn=async(t,e)=>{this.busy=!0,this.tone="",this.status="";try{const n=BE((await So(Qy,t,e)).user);n&&cE(wE,{user:n})}catch(t){this.show(lE(t))}finally{this.busy=!1}},this.forgot=async()=>{if(this.busy||this.resetBusy)return;this.readFields();const t=this.email.trim();if(t.length<4)this.show({code:"pwa/missing-email",message:"Enter an email address."});else if(/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t)){this.resetBusy=!0,this.tone="",this.status="";try{await Ao(Qy,t),this.sent(t)}catch(e){"auth/user-not-found"===lE(e).code?this.sent(t):this.show(lE(e))}finally{this.resetBusy=!1}}else this.show({code:"pwa/invalid-email",message:"Enter a valid email address."})}}connectedCallback(){super.connectedCallback(),this.adoptRedirect()}updated(){this.adoptRedirect()}adoptRedirect(){if(!this.classList.contains("opened"))return;const t=pE();t&&this.show(t)}static get styles(){return[_n,VE,jE,UE,$E,JE,zE,i`
524
529
 
525
530
  :host {
526
531
  background-color: var(--pwa_background, var(--section_background_color, #fff));
@@ -621,7 +626,7 @@ const t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow
621
626
 
622
627
  </form>
623
628
 
624
- `}change(){Cn.dispatch(un(this.source))}async google(){if(!this.busy&&!this.resetBusy){this.busy=!0,this.tone="",this.status="";try{await CE()}catch(t){this.show(lE(t))}finally{this.busy=!1}}}show(t,e=!0){this.tone=e?"error":"",this.status=HE(t),e&&cE(AE,t)}handleEmail(t){const e=t.target;this.email=e.value,ZE(this.email)}handlePassword(t){const e=t.target;this.password=e.value}readFields(){const t=this.renderRoot.querySelector('input[type="email"]'),e=this.renderRoot.querySelector('input[name="password"]');this.email=t?.value??"",this.password=e?.value??"",ZE(this.email)}_handleSubmit(t){t.preventDefault(),this.login()}async login(){this.busy||(this.readFields(),this.email.length<4?this.show({code:"pwa/missing-email",message:"Enter an email address."}):this.password?await this.signIn(this.email,this.password):this.show({code:"pwa/missing-password",message:"Enter a password."}))}sent(t){this.tone="",this.status="If an account uses that email, a reset link is on its way.",cE(IE,{email:t})}};eD([lt({type:String}),nD("design:type",Object)],sD.prototype,"source",void 0),eD([lt({type:Boolean,attribute:"hide-google",reflect:!0}),nD("design:type",Object)],sD.prototype,"hideGoogle",void 0),eD([ut(),nD("design:type",Object)],sD.prototype,"email",void 0),eD([ut(),nD("design:type",Object)],sD.prototype,"password",void 0),eD([ut(),nD("design:type",Object)],sD.prototype,"status",void 0),eD([ut(),nD("design:type",Object)],sD.prototype,"tone",void 0),eD([ut(),nD("design:type",Object)],sD.prototype,"busy",void 0),eD([ut(),nD("design:type",Object)],sD.prototype,"resetBusy",void 0),eD([ut(),nD("design:type",Object)],sD.prototype,"showPassword",void 0),sD=eD([at("form-login"),nD("design:paramtypes",[])],sD);const rD="@firebase/installations",iD="0.6.24",oD=1e4,aD=`w:${iD}`,BD="FIS_v2",cD=36e5,lD=new jn("installations","Installations",{"missing-app-config-values":'Missing App configuration value: "{$valueName}"',"not-registered":"Firebase Installation is not registered.","installation-not-found":"Firebase Installation not found.","request-failed":'{$requestName} request failed with error "{$serverCode} {$serverStatus}: {$serverMessage}"',"app-offline":"Could not process request. Application offline.","delete-pending-registration":"Can't delete installation while there is a pending registration request."});function uD(t){return t instanceof Vn&&t.code.includes("request-failed")}function hD({projectId:t}){return`https://firebaseinstallations.googleapis.com/v1/projects/${t}/installations`}function dD(t){return{token:t.token,requestStatus:2,expiresIn:(e=t.expiresIn,Number(e.replace("s","000"))),creationTime:Date.now()};var e}async function pD(t,e){const n=(await e.json()).error;return lD.create("request-failed",{requestName:t,serverCode:n.code,serverMessage:n.message,serverStatus:n.status})}function fD({apiKey:t}){return new Headers({"Content-Type":"application/json",Accept:"application/json","x-goog-api-key":t})}function CD(t,{refreshToken:e}){const n=fD(t);return n.append("Authorization",function(t){return`${BD} ${t}`}(e)),n}async function gD(t){const e=await t();return e.status>=500&&e.status<600?t():e}function mD(t){return new Promise(e=>{setTimeout(e,t)})}const wD=/^[cdef][\w-]{21}$/;function yD(){try{const t=new Uint8Array(17);(self.crypto||self.msCrypto).getRandomValues(t),t[0]=112+t[0]%16;const e=function(t){const e=(n=t,btoa(String.fromCharCode(...n)).replace(/\+/g,"-").replace(/\//g,"_"));var n;return e.substr(0,22)}(t);return wD.test(e)?e:""}catch{return""}}function ED(t){return`${t.appName}!${t.appId}`}const DD=new Map;function _D(t,e){const n=ED(t);bD(n,e),function(t,e){const n=function(){!vD&&"BroadcastChannel"in self&&(vD=new BroadcastChannel("[Firebase] FID Change"),vD.onmessage=t=>{bD(t.data.key,t.data.fid)});return vD}();n&&n.postMessage({key:t,fid:e});0===DD.size&&vD&&(vD.close(),vD=null)}(n,e)}function bD(t,e){const n=DD.get(t);if(n)for(const t of n)t(e)}let vD=null;const ID="firebase-installations-store";let TD=null;function OD(){return TD||(TD=_s("firebase-installations-database",1,{upgrade:(t,e)=>{if(0===e)t.createObjectStore(ID)}})),TD}async function AD(t,e){const n=ED(t),s=(await OD()).transaction(ID,"readwrite"),r=s.objectStore(ID),i=await r.get(n);return await r.put(e,n),await s.done,i&&i.fid===e.fid||_D(t,e.fid),e}async function SD(t){const e=ED(t),n=(await OD()).transaction(ID,"readwrite");await n.objectStore(ID).delete(e),await n.done}async function RD(t,e){const n=ED(t),s=(await OD()).transaction(ID,"readwrite"),r=s.objectStore(ID),i=await r.get(n),o=e(i);return void 0===o?await r.delete(n):await r.put(o,n),await s.done,!o||i&&i.fid===o.fid||_D(t,o.fid),o}async function ND(t){let e;const n=await RD(t.appConfig,n=>{const s=function(t){const e=t||{fid:yD(),registrationStatus:0};return LD(e)}(n),r=function(t,e){if(0===e.registrationStatus){if(!navigator.onLine){return{installationEntry:e,registrationPromise:Promise.reject(lD.create("app-offline"))}}const n={fid:e.fid,registrationStatus:1,registrationTime:Date.now()},s=async function(t,e){try{const n=await async function({appConfig:t,heartbeatServiceProvider:e},{fid:n}){const s=hD(t),r=fD(t),i=e.getImmediate({optional:!0});if(i){const t=await i.getHeartbeatsHeader();t&&r.append("x-firebase-client",t)}const o={fid:n,authVersion:BD,appId:t.appId,sdkVersion:aD},a={method:"POST",headers:r,body:JSON.stringify(o)},B=await gD(()=>fetch(s,a));if(B.ok){const t=await B.json();return{fid:t.fid||n,registrationStatus:2,refreshToken:t.refreshToken,authToken:dD(t.authToken)}}throw await pD("Create Installation",B)}(t,e);return AD(t.appConfig,n)}catch(n){throw uD(n)&&409===n.customData.serverCode?await SD(t.appConfig):await AD(t.appConfig,{fid:e.fid,registrationStatus:0}),n}}(t,n);return{installationEntry:n,registrationPromise:s}}return 1===e.registrationStatus?{installationEntry:e,registrationPromise:xD(t)}:{installationEntry:e}}(t,s);return e=r.registrationPromise,r.installationEntry});return""===n.fid?{installationEntry:await e}:{installationEntry:n,registrationPromise:e}}async function xD(t){let e=await kD(t.appConfig);for(;1===e.registrationStatus;)await mD(100),e=await kD(t.appConfig);if(0===e.registrationStatus){const{installationEntry:e,registrationPromise:n}=await ND(t);return n||e}return e}function kD(t){return RD(t,t=>{if(!t)throw lD.create("installation-not-found");return LD(t)})}function LD(t){return 1===(e=t).registrationStatus&&e.registrationTime+oD<Date.now()?{fid:t.fid,registrationStatus:0}:t;var e}async function FD({appConfig:t,heartbeatServiceProvider:e},n){const s=function(t,{fid:e}){return`${hD(t)}/${e}/authTokens:generate`}(t,n),r=CD(t,n),i=e.getImmediate({optional:!0});if(i){const t=await i.getHeartbeatsHeader();t&&r.append("x-firebase-client",t)}const o={installation:{sdkVersion:aD,appId:t.appId}},a={method:"POST",headers:r,body:JSON.stringify(o)},B=await gD(()=>fetch(s,a));if(B.ok){return dD(await B.json())}throw await pD("Generate Auth Token",B)}async function PD(t,e=!1){let n;const s=await RD(t.appConfig,s=>{if(!GD(s))throw lD.create("not-registered");const r=s.authToken;if(!e&&function(t){return 2===t.requestStatus&&!function(t){const e=Date.now();return e<t.creationTime||t.creationTime+t.expiresIn<e+cD}(t)}(r))return s;if(1===r.requestStatus)return n=async function(t,e){let n=await MD(t.appConfig);for(;1===n.authToken.requestStatus;)await mD(100),n=await MD(t.appConfig);const s=n.authToken;return 0===s.requestStatus?PD(t,e):s}(t,e),s;{if(!navigator.onLine)throw lD.create("app-offline");const e=function(t){const e={requestStatus:1,requestTime:Date.now()};return{...t,authToken:e}}(s);return n=async function(t,e){try{const n=await FD(t,e),s={...e,authToken:n};return await AD(t.appConfig,s),n}catch(n){if(!uD(n)||401!==n.customData.serverCode&&404!==n.customData.serverCode){const n={...e,authToken:{requestStatus:0}};await AD(t.appConfig,n)}else await SD(t.appConfig);throw n}}(t,e),e}});return n?await n:s.authToken}function MD(t){return RD(t,t=>{if(!GD(t))throw lD.create("not-registered");const e=t.authToken;return 1===(n=e).requestStatus&&n.requestTime+oD<Date.now()?{...t,authToken:{requestStatus:0}}:t;var n})}function GD(t){return void 0!==t&&2===t.registrationStatus}async function HD(t,e=!1){const n=t;await async function(t){const{registrationPromise:e}=await ND(t);e&&await e}(n);return(await PD(n,e)).token}function UD(t){return lD.create("missing-app-config-values",{valueName:t})}const VD="installations",jD=t=>{const e=ur(t.getProvider("app").getImmediate(),VD).getImmediate();return{getId:()=>async function(t){const e=t,{installationEntry:n,registrationPromise:s}=await ND(e);return s?s.catch(console.error):PD(e).catch(console.error),n.fid}(e),getToken:t=>HD(e,t)}};lr(new es(VD,t=>{const e=t.getProvider("app").getImmediate(),n=function(t){if(!t||!t.options)throw UD("App Configuration");if(!t.name)throw UD("App Name");const e=["projectId","apiKey","appId"];for(const n of e)if(!t.options[n])throw UD(n);return{appName:t.name,projectId:t.options.projectId,apiKey:t.options.apiKey,appId:t.options.appId}}(e);return{app:e,appConfig:n,heartbeatServiceProvider:ur(e,"heartbeat"),_delete:()=>Promise.resolve()}},"PUBLIC")),lr(new es("installations-internal",jD,"PRIVATE")),mr(rD,iD),mr(rD,iD,"esm2020");const $D="analytics",JD="https://www.googletagmanager.com/gtag/js",qD=new ls("@firebase/analytics"),zD=new jn("analytics","Analytics",{"already-exists":"A Firebase Analytics instance with the appId {$id} already exists. Only one Firebase Analytics instance can be created for each appId.","already-initialized":"initializeAnalytics() cannot be called again with different options than those it was initially called with. It can be called again with the same options to return the existing instance, or getAnalytics() can be used to get a reference to the already-initialized instance.","already-initialized-settings":"Firebase Analytics has already been initialized.settings() must be called before initializing any Analytics instanceor it will have no effect.","interop-component-reg-failed":"Firebase Analytics Interop Component failed to instantiate: {$reason}","invalid-analytics-context":"Firebase Analytics is not supported in this environment. Wrap initialization of analytics in analytics.isSupported() to prevent initialization in unsupported environments. Details: {$errorInfo}","indexeddb-unavailable":"IndexedDB unavailable or restricted in this environment. Wrap initialization of analytics in analytics.isSupported() to prevent initialization in unsupported environments. Details: {$errorInfo}","fetch-throttle":"The config fetch request timed out while in an exponential backoff state. Unix timestamp in milliseconds when fetch request throttling ends: {$throttleEndTimeMillis}.","config-fetch-failed":"Dynamic config fetch failed: [{$httpStatus}] {$responseMessage}","no-api-key":'The "apiKey" field is empty in the local Firebase config. Firebase Analytics requires this field tocontain a valid API key.',"no-app-id":'The "appId" field is empty in the local Firebase config. Firebase Analytics requires this field tocontain a valid app ID.',"no-client-id":'The "client_id" field is empty.',"invalid-gtag-resource":"Trusted Types detected an invalid gtag resource: {$gtagURL}."});function KD(t){if(!t.startsWith(JD)){const e=zD.create("invalid-gtag-resource",{gtagURL:t});return qD.warn(e.message),""}return t}function QD(t){return Promise.all(t.map(t=>t.catch(t=>t)))}function WD(t,e){const n=function(t,e){let n;return window.trustedTypes&&(n=window.trustedTypes.createPolicy(t,e)),n}("firebase-js-sdk-policy",{createScriptURL:KD}),s=document.createElement("script"),r=`${JD}?l=${t}&id=${e}`;s.src=n?n?.createScriptURL(r):r,s.async=!0,document.head.appendChild(s)}function YD(t,e,n,s){return async function(r,...i){try{if("event"===r){const[s,r]=i;await async function(t,e,n,s,r){try{let i=[];if(r&&r.send_to){let t=r.send_to;Array.isArray(t)||(t=[t]);const s=await QD(n);for(const n of t){const t=s.find(t=>t.measurementId===n),r=t&&e[t.appId];if(!r){i=[];break}i.push(r)}}0===i.length&&(i=Object.values(e)),await Promise.all(i),t("event",s,r||{})}catch(t){qD.error(t)}}(t,e,n,s,r)}else if("config"===r){const[r,o]=i;await async function(t,e,n,s,r,i){const o=s[r];try{if(o)await e[o];else{const t=(await QD(n)).find(t=>t.measurementId===r);t&&await e[t.appId]}}catch(t){qD.error(t)}t("config",r,i)}(t,e,n,s,r,o)}else if("consent"===r){const[e,n]=i;t("consent",e,n)}else if("get"===r){const[e,n,s]=i;t("get",e,n,s)}else if("set"===r){const[e]=i;t("set",e)}else t(r,...i)}catch(t){qD.error(t)}}}const XD=new class{constructor(t={},e=1e3){this.throttleMetadata=t,this.intervalMillis=e}getThrottleMetadata(t){return this.throttleMetadata[t]}setThrottleMetadata(t,e){this.throttleMetadata[t]=e}deleteThrottleMetadata(t){delete this.throttleMetadata[t]}};function ZD(t){return new Headers({Accept:"application/json","x-goog-api-key":t})}async function t_(t,e=XD,n){const{appId:s,apiKey:r,measurementId:i}=t.options;if(!s)throw zD.create("no-app-id");if(!r){if(i)return{measurementId:i,appId:s};throw zD.create("no-api-key")}const o=e.getThrottleMetadata(s)||{backoffCount:0,throttleEndTimeMillis:Date.now()},a=new n_;return setTimeout(async()=>{a.abort()},6e4),e_({appId:s,apiKey:r,measurementId:i},o,a,e)}async function e_(t,{throttleEndTimeMillis:e,backoffCount:n},s,r=XD){const{appId:i,measurementId:o}=t;try{await function(t,e){return new Promise((n,s)=>{const r=Math.max(e-Date.now(),0),i=setTimeout(n,r);t.addEventListener(()=>{clearTimeout(i),s(zD.create("fetch-throttle",{throttleEndTimeMillis:e}))})})}(s,e)}catch(t){if(o)return qD.warn(`Timed out fetching this Firebase app's measurement ID from the server. Falling back to the measurement ID ${o} provided in the "measurementId" field in the local Firebase config. [${t?.message}]`),{appId:i,measurementId:o};throw t}try{const e=await async function(t){const{appId:e,apiKey:n}=t,s={method:"GET",headers:ZD(n)},r="https://firebase.googleapis.com/v1alpha/projects/-/apps/{app-id}/webConfig".replace("{app-id}",e),i=await fetch(r,s);if(200!==i.status&&304!==i.status){let t="";try{const e=await i.json();e.error?.message&&(t=e.error.message)}catch(t){}throw zD.create("config-fetch-failed",{httpStatus:i.status,responseMessage:t})}return i.json()}(t);return r.deleteThrottleMetadata(i),e}catch(e){const a=e;if(!function(t){if(!(t instanceof Vn&&t.customData))return!1;const e=Number(t.customData.httpStatus);return 429===e||500===e||503===e||504===e}(a)){if(r.deleteThrottleMetadata(i),o)return qD.warn(`Failed to fetch this Firebase app's measurement ID from the server. Falling back to the measurement ID ${o} provided in the "measurementId" field in the local Firebase config. [${a?.message}]`),{appId:i,measurementId:o};throw e}const B=503===Number(a?.customData?.httpStatus)?Yn(n,r.intervalMillis,30):Yn(n,r.intervalMillis),c={throttleEndTimeMillis:Date.now()+B,backoffCount:n+1};return r.setThrottleMetadata(i,c),qD.debug(`Calling attemptFetch again in ${B} millis`),e_(t,c,s,r)}}class n_{constructor(){this.listeners=[]}addEventListener(t){this.listeners.push(t)}abort(){this.listeners.forEach(t=>t())}}async function s_(t,e,n,s,r,i,o){const a=t_(t);a.then(e=>{n[e.measurementId]=e.appId,t.options.measurementId&&e.measurementId!==t.options.measurementId&&qD.warn(`The measurement ID in the local Firebase config (${t.options.measurementId}) does not match the measurement ID fetched from the server (${e.measurementId}). To ensure analytics events are always sent to the correct Analytics property, update the measurement ID field in the local config or remove it from the local config.`)}).catch(t=>qD.error(t)),e.push(a);const B=async function(){if(!Gn())return qD.warn(zD.create("indexeddb-unavailable",{errorInfo:"IndexedDB is not available in this environment."}).message),!1;try{await Hn()}catch(t){return qD.warn(zD.create("indexeddb-unavailable",{errorInfo:t?.toString()}).message),!1}return!0}().then(t=>t?s.getId():void 0),[c,l]=await Promise.all([a,B]);(function(t){const e=window.document.getElementsByTagName("script");for(const n of Object.values(e))if(n.src&&n.src.includes(JD)&&n.src.includes(t))return n;return null})(i)||WD(i,c.measurementId),r("js",new Date);const u=o?.config??{};return u.origin="firebase",u.update=!0,null!=l&&(u.firebase_id=l),r("config",c.measurementId,u),c.measurementId}class r_{constructor(t){this.app=t}_delete(){return delete i_[this.app.options.appId],Promise.resolve()}}let i_={},o_=[];const a_={};let B_,c_,l_="dataLayer",u_=!1;function h_(t,e,n){!function(){const t=[];if(Pn()&&t.push("This is a browser extension environment."),Un()||t.push("Cookies are not available."),t.length>0){const e=t.map((t,e)=>`(${e+1}) ${t}`).join(" "),n=zD.create("invalid-analytics-context",{errorInfo:e});qD.warn(n.message)}}();const s=t.options.appId;if(!s)throw zD.create("no-app-id");if(!t.options.apiKey){if(!t.options.measurementId)throw zD.create("no-api-key");qD.warn(`The "apiKey" field is empty in the local Firebase config. This is needed to fetch the latest measurement ID for this Firebase app. Falling back to the measurement ID ${t.options.measurementId} provided in the "measurementId" field in the local Firebase config.`)}if(null!=i_[s])throw zD.create("already-exists",{id:s});if(!u_){!function(t){let e=[];Array.isArray(window[t])?e=window[t]:window[t]=e}(l_);const{wrappedGtag:t,gtagCore:e}=function(t,e,n,s,r){let i=function(...t){window[s].push(arguments)};return window[r]&&"function"==typeof window[r]&&(i=window[r]),window[r]=YD(i,t,e,n),{gtagCore:i,wrappedGtag:window[r]}}(i_,o_,a_,l_,"gtag");c_=t,B_=e,u_=!0}i_[s]=s_(t,o_,a_,e,B_,l_,n);return new r_(t)}function d_(t=gr()){const e=ur(t=Xn(t),$D);return e.isInitialized()?e.getImmediate():function(t,e={}){const n=ur(t,$D);if(n.isInitialized()){const t=n.getImmediate();if($n(e,n.getOptions()))return t;throw zD.create("already-initialized")}const s=n.initialize({options:e});return s}(t)}function p_(t,e,n){t=Xn(t),async function(t,e,n,s){if(s&&s.global){const e={};for(const t of Object.keys(n))e[`user_properties.${t}`]=n[t];return t("set",e),Promise.resolve()}t("config",await e,{update:!0,user_properties:n})}(c_,i_[t.app.options.appId],e,n).catch(t=>qD.error(t))}function f_(t,e,n,s){t=Xn(t),async function(t,e,n,s,r){if(r&&r.global)t("event",n,s);else{const r=await e;t("event",n,{...s,send_to:r})}}(c_,i_[t.app.options.appId],e,n,s).catch(t=>qD.error(t))}const C_="@firebase/analytics",g_="0.10.25";lr(new es($D,(t,{options:e})=>h_(t.getProvider("app").getImmediate(),t.getProvider("installations-internal").getImmediate(),e),"PUBLIC")),lr(new es("analytics-internal",function(t){try{const e=t.getProvider($D).getImmediate();return{logEvent:(t,n,s)=>f_(e,t,n,s),setUserProperties:(t,n)=>p_(e,t,n)}}catch(t){throw zD.create("interop-component-reg-failed",{reason:t})}},"PRIVATE")),mr(C_,g_),mr(C_,g_,"esm2020");let m_,w_=null;function y_(){const t=w_;return w_=null,t}function E_(t){w_=t,cE(AE,t)}let D_=Promise.resolve();const __=()=>{Cn.dispatch(ln())};sE(()=>{gE(),Ka(qy).useDeviceLanguage(),D_=(async()=>{await async function(){if(Pn())return!1;if(!Un())return!1;if(!Gn())return!1;try{return await Hn()}catch(t){return!1}}()&&(m_=d_(qy))})(),Lo(Qy,t=>{cE(mE,{user:BE(t)}),t?(Cn.dispatch(an(!0)),Cn.dispatch(ln()),Cn.dispatch(hn(t.displayName??"")),Cn.dispatch(dn(t.email||"")),Cn.dispatch(pn(t.photoURL||"")),Cn.dispatch(fn(!0===t.emailVerified))):(Cn.dispatch(an(!1)),Cn.dispatch(hn("")),Cn.dispatch(dn("")),Cn.dispatch(pn("")),Cn.dispatch(fn(!1)))})});const b_=async t=>{const e=Qy.currentUser;if(!e||!e.email)return E_({code:"pwa/signed-out",message:"Sign in first."}),!1;try{const n=ho.credential(e.email,t);return await async function(t,e){return vo(Xn(t),e)}(e,n),!0}catch(t){return E_(lE(t)),!1}},v_=async()=>{if(!nE()){const t={code:"pwa/not-ready",message:"Sign-in is not ready yet."};throw cE(AE,t),new Error(t.message)}try{await function(t){return Xn(t).signOut()}(Qy),cE(yE,{user:null})}catch(t){throw cE(AE,lE(t)),t}},I_=async()=>{await D_,m_&&f_(m_,"create_account")},T_=async()=>{await D_,m_&&f_(m_,"delete_account")},O_=async(t,e)=>{await iw(xp(zy,t,e))};let A_="",S_=!1,R_=!1;function N_(t){if(!t)return A_="",S_=!1,!1;const e=!0===t.emailVerified;return t.uid!==A_?(A_=t.uid,S_=e,!1):!S_&&e?(S_=!0,!0):(S_=e,!1)}function x_(t){Cn.dispatch(fn(!0));const e=BE({...t,emailVerified:!0});e&&cE(RE,{user:e})}async function k_(t){if(!nE())return!1;const e=Qy.currentUser;if(!e)return N_(null),!1;try{await e.reload()}catch(n){return t&&cE(AE,lE(n)),!0===e.emailVerified}return Cn.dispatch(fn(!0===e.emailVerified)),N_(e)&&x_(e),!0===e.emailVerified}function L_(){k_(!1)}function F_(){"visible"===document.visibilityState&&k_(!1)}function P_(t,e){const n={code:t,message:e};throw cE(AE,n),Object.assign(new Error(e),n)}async function M_(){nE()||P_("pwa/not-ready","Sign-in is not ready yet.");const t=Qy.currentUser;if(t||P_("pwa/signed-out","Sign in first."),t.email||P_("pwa/missing-email","Enter an email address."),t.emailVerified)return!1;const e=eE();try{e?await Ro(t,e):await Ro(t)}catch(t){throw cE(AE,lE(t)),t}return cE(SE,{email:t.email}),!0}async function G_(){return k_(!0)}R_||(R_=!0,sE(()=>{Lo(Qy,t=>{t&&N_(t)&&x_(t),t||N_(null)}),"undefined"!=typeof window&&(window.addEventListener("focus",L_),document.addEventListener("visibilitychange",F_))}));const H_=i`
629
+ `}change(){Cn.dispatch(un(this.source))}async google(){if(!this.busy&&!this.resetBusy){this.busy=!0,this.tone="",this.status="";try{await CE()}catch(t){this.show(lE(t))}finally{this.busy=!1}}}show(t,e=!0){this.tone=e?"error":"",this.status=HE(t),e&&cE(AE,t)}handleEmail(t){const e=t.target;this.email=e.value,ZE(this.email)}handlePassword(t){const e=t.target;this.password=e.value}readFields(){const t=this.renderRoot.querySelector('input[type="email"]'),e=this.renderRoot.querySelector('input[name="password"]');this.email=t?.value??"",this.password=e?.value??"",ZE(this.email)}_handleSubmit(t){t.preventDefault(),this.login()}async login(){this.busy||(this.readFields(),this.email.length<4?this.show({code:"pwa/missing-email",message:"Enter an email address."}):this.password?await this.signIn(this.email,this.password):this.show({code:"pwa/missing-password",message:"Enter a password."}))}sent(t){this.tone="",this.status="If an account uses that email, a reset link is on its way.",cE(IE,{email:t})}};e_([lt({type:String}),n_("design:type",Object)],s_.prototype,"source",void 0),e_([lt({type:Boolean,attribute:"hide-google",reflect:!0}),n_("design:type",Object)],s_.prototype,"hideGoogle",void 0),e_([ut(),n_("design:type",Object)],s_.prototype,"email",void 0),e_([ut(),n_("design:type",Object)],s_.prototype,"password",void 0),e_([ut(),n_("design:type",Object)],s_.prototype,"status",void 0),e_([ut(),n_("design:type",Object)],s_.prototype,"tone",void 0),e_([ut(),n_("design:type",Object)],s_.prototype,"busy",void 0),e_([ut(),n_("design:type",Object)],s_.prototype,"resetBusy",void 0),e_([ut(),n_("design:type",Object)],s_.prototype,"showPassword",void 0),s_=e_([at("form-login"),n_("design:paramtypes",[])],s_);const r_="@firebase/installations",i_="0.6.24",o_=1e4,a_=`w:${i_}`,B_="FIS_v2",c_=36e5,l_=new jn("installations","Installations",{"missing-app-config-values":'Missing App configuration value: "{$valueName}"',"not-registered":"Firebase Installation is not registered.","installation-not-found":"Firebase Installation not found.","request-failed":'{$requestName} request failed with error "{$serverCode} {$serverStatus}: {$serverMessage}"',"app-offline":"Could not process request. Application offline.","delete-pending-registration":"Can't delete installation while there is a pending registration request."});function u_(t){return t instanceof Vn&&t.code.includes("request-failed")}function h_({projectId:t}){return`https://firebaseinstallations.googleapis.com/v1/projects/${t}/installations`}function d_(t){return{token:t.token,requestStatus:2,expiresIn:(e=t.expiresIn,Number(e.replace("s","000"))),creationTime:Date.now()};var e}async function p_(t,e){const n=(await e.json()).error;return l_.create("request-failed",{requestName:t,serverCode:n.code,serverMessage:n.message,serverStatus:n.status})}function f_({apiKey:t}){return new Headers({"Content-Type":"application/json",Accept:"application/json","x-goog-api-key":t})}function C_(t,{refreshToken:e}){const n=f_(t);return n.append("Authorization",function(t){return`${B_} ${t}`}(e)),n}async function g_(t){const e=await t();return e.status>=500&&e.status<600?t():e}function m_(t){return new Promise(e=>{setTimeout(e,t)})}const w_=/^[cdef][\w-]{21}$/;function y_(){try{const t=new Uint8Array(17);(self.crypto||self.msCrypto).getRandomValues(t),t[0]=112+t[0]%16;const e=function(t){const e=(n=t,btoa(String.fromCharCode(...n)).replace(/\+/g,"-").replace(/\//g,"_"));var n;return e.substr(0,22)}(t);return w_.test(e)?e:""}catch{return""}}function E_(t){return`${t.appName}!${t.appId}`}const __=new Map;function D_(t,e){const n=E_(t);b_(n,e),function(t,e){const n=function(){!v_&&"BroadcastChannel"in self&&(v_=new BroadcastChannel("[Firebase] FID Change"),v_.onmessage=t=>{b_(t.data.key,t.data.fid)});return v_}();n&&n.postMessage({key:t,fid:e});0===__.size&&v_&&(v_.close(),v_=null)}(n,e)}function b_(t,e){const n=__.get(t);if(n)for(const t of n)t(e)}let v_=null;const I_="firebase-installations-store";let T_=null;function O_(){return T_||(T_=Ds("firebase-installations-database",1,{upgrade:(t,e)=>{if(0===e)t.createObjectStore(I_)}})),T_}async function A_(t,e){const n=E_(t),s=(await O_()).transaction(I_,"readwrite"),r=s.objectStore(I_),i=await r.get(n);return await r.put(e,n),await s.done,i&&i.fid===e.fid||D_(t,e.fid),e}async function S_(t){const e=E_(t),n=(await O_()).transaction(I_,"readwrite");await n.objectStore(I_).delete(e),await n.done}async function R_(t,e){const n=E_(t),s=(await O_()).transaction(I_,"readwrite"),r=s.objectStore(I_),i=await r.get(n),o=e(i);return void 0===o?await r.delete(n):await r.put(o,n),await s.done,!o||i&&i.fid===o.fid||D_(t,o.fid),o}async function N_(t){let e;const n=await R_(t.appConfig,n=>{const s=function(t){const e=t||{fid:y_(),registrationStatus:0};return L_(e)}(n),r=function(t,e){if(0===e.registrationStatus){if(!navigator.onLine){return{installationEntry:e,registrationPromise:Promise.reject(l_.create("app-offline"))}}const n={fid:e.fid,registrationStatus:1,registrationTime:Date.now()},s=async function(t,e){try{const n=await async function({appConfig:t,heartbeatServiceProvider:e},{fid:n}){const s=h_(t),r=f_(t),i=e.getImmediate({optional:!0});if(i){const t=await i.getHeartbeatsHeader();t&&r.append("x-firebase-client",t)}const o={fid:n,authVersion:B_,appId:t.appId,sdkVersion:a_},a={method:"POST",headers:r,body:JSON.stringify(o)},B=await g_(()=>fetch(s,a));if(B.ok){const t=await B.json();return{fid:t.fid||n,registrationStatus:2,refreshToken:t.refreshToken,authToken:d_(t.authToken)}}throw await p_("Create Installation",B)}(t,e);return A_(t.appConfig,n)}catch(n){throw u_(n)&&409===n.customData.serverCode?await S_(t.appConfig):await A_(t.appConfig,{fid:e.fid,registrationStatus:0}),n}}(t,n);return{installationEntry:n,registrationPromise:s}}return 1===e.registrationStatus?{installationEntry:e,registrationPromise:x_(t)}:{installationEntry:e}}(t,s);return e=r.registrationPromise,r.installationEntry});return""===n.fid?{installationEntry:await e}:{installationEntry:n,registrationPromise:e}}async function x_(t){let e=await k_(t.appConfig);for(;1===e.registrationStatus;)await m_(100),e=await k_(t.appConfig);if(0===e.registrationStatus){const{installationEntry:e,registrationPromise:n}=await N_(t);return n||e}return e}function k_(t){return R_(t,t=>{if(!t)throw l_.create("installation-not-found");return L_(t)})}function L_(t){return 1===(e=t).registrationStatus&&e.registrationTime+o_<Date.now()?{fid:t.fid,registrationStatus:0}:t;var e}async function F_({appConfig:t,heartbeatServiceProvider:e},n){const s=function(t,{fid:e}){return`${h_(t)}/${e}/authTokens:generate`}(t,n),r=C_(t,n),i=e.getImmediate({optional:!0});if(i){const t=await i.getHeartbeatsHeader();t&&r.append("x-firebase-client",t)}const o={installation:{sdkVersion:a_,appId:t.appId}},a={method:"POST",headers:r,body:JSON.stringify(o)},B=await g_(()=>fetch(s,a));if(B.ok){return d_(await B.json())}throw await p_("Generate Auth Token",B)}async function P_(t,e=!1){let n;const s=await R_(t.appConfig,s=>{if(!G_(s))throw l_.create("not-registered");const r=s.authToken;if(!e&&function(t){return 2===t.requestStatus&&!function(t){const e=Date.now();return e<t.creationTime||t.creationTime+t.expiresIn<e+c_}(t)}(r))return s;if(1===r.requestStatus)return n=async function(t,e){let n=await M_(t.appConfig);for(;1===n.authToken.requestStatus;)await m_(100),n=await M_(t.appConfig);const s=n.authToken;return 0===s.requestStatus?P_(t,e):s}(t,e),s;{if(!navigator.onLine)throw l_.create("app-offline");const e=function(t){const e={requestStatus:1,requestTime:Date.now()};return{...t,authToken:e}}(s);return n=async function(t,e){try{const n=await F_(t,e),s={...e,authToken:n};return await A_(t.appConfig,s),n}catch(n){if(!u_(n)||401!==n.customData.serverCode&&404!==n.customData.serverCode){const n={...e,authToken:{requestStatus:0}};await A_(t.appConfig,n)}else await S_(t.appConfig);throw n}}(t,e),e}});return n?await n:s.authToken}function M_(t){return R_(t,t=>{if(!G_(t))throw l_.create("not-registered");const e=t.authToken;return 1===(n=e).requestStatus&&n.requestTime+o_<Date.now()?{...t,authToken:{requestStatus:0}}:t;var n})}function G_(t){return void 0!==t&&2===t.registrationStatus}async function H_(t,e=!1){const n=t;await async function(t){const{registrationPromise:e}=await N_(t);e&&await e}(n);return(await P_(n,e)).token}function U_(t){return l_.create("missing-app-config-values",{valueName:t})}const V_="installations",j_=t=>{const e=ur(t.getProvider("app").getImmediate(),V_).getImmediate();return{getId:()=>async function(t){const e=t,{installationEntry:n,registrationPromise:s}=await N_(e);return s?s.catch(console.error):P_(e).catch(console.error),n.fid}(e),getToken:t=>H_(e,t)}};lr(new es(V_,t=>{const e=t.getProvider("app").getImmediate(),n=function(t){if(!t||!t.options)throw U_("App Configuration");if(!t.name)throw U_("App Name");const e=["projectId","apiKey","appId"];for(const n of e)if(!t.options[n])throw U_(n);return{appName:t.name,projectId:t.options.projectId,apiKey:t.options.apiKey,appId:t.options.appId}}(e);return{app:e,appConfig:n,heartbeatServiceProvider:ur(e,"heartbeat"),_delete:()=>Promise.resolve()}},"PUBLIC")),lr(new es("installations-internal",j_,"PRIVATE")),mr(r_,i_),mr(r_,i_,"esm2020");const $_="analytics",J_="https://www.googletagmanager.com/gtag/js",q_=new ls("@firebase/analytics"),z_=new jn("analytics","Analytics",{"already-exists":"A Firebase Analytics instance with the appId {$id} already exists. Only one Firebase Analytics instance can be created for each appId.","already-initialized":"initializeAnalytics() cannot be called again with different options than those it was initially called with. It can be called again with the same options to return the existing instance, or getAnalytics() can be used to get a reference to the already-initialized instance.","already-initialized-settings":"Firebase Analytics has already been initialized.settings() must be called before initializing any Analytics instanceor it will have no effect.","interop-component-reg-failed":"Firebase Analytics Interop Component failed to instantiate: {$reason}","invalid-analytics-context":"Firebase Analytics is not supported in this environment. Wrap initialization of analytics in analytics.isSupported() to prevent initialization in unsupported environments. Details: {$errorInfo}","indexeddb-unavailable":"IndexedDB unavailable or restricted in this environment. Wrap initialization of analytics in analytics.isSupported() to prevent initialization in unsupported environments. Details: {$errorInfo}","fetch-throttle":"The config fetch request timed out while in an exponential backoff state. Unix timestamp in milliseconds when fetch request throttling ends: {$throttleEndTimeMillis}.","config-fetch-failed":"Dynamic config fetch failed: [{$httpStatus}] {$responseMessage}","no-api-key":'The "apiKey" field is empty in the local Firebase config. Firebase Analytics requires this field tocontain a valid API key.',"no-app-id":'The "appId" field is empty in the local Firebase config. Firebase Analytics requires this field tocontain a valid app ID.',"no-client-id":'The "client_id" field is empty.',"invalid-gtag-resource":"Trusted Types detected an invalid gtag resource: {$gtagURL}."});function K_(t){if(!t.startsWith(J_)){const e=z_.create("invalid-gtag-resource",{gtagURL:t});return q_.warn(e.message),""}return t}function Q_(t){return Promise.all(t.map(t=>t.catch(t=>t)))}function W_(t,e){const n=function(t,e){let n;return window.trustedTypes&&(n=window.trustedTypes.createPolicy(t,e)),n}("firebase-js-sdk-policy",{createScriptURL:K_}),s=document.createElement("script"),r=`${J_}?l=${t}&id=${e}`;s.src=n?n?.createScriptURL(r):r,s.async=!0,document.head.appendChild(s)}function Y_(t,e,n,s){return async function(r,...i){try{if("event"===r){const[s,r]=i;await async function(t,e,n,s,r){try{let i=[];if(r&&r.send_to){let t=r.send_to;Array.isArray(t)||(t=[t]);const s=await Q_(n);for(const n of t){const t=s.find(t=>t.measurementId===n),r=t&&e[t.appId];if(!r){i=[];break}i.push(r)}}0===i.length&&(i=Object.values(e)),await Promise.all(i),t("event",s,r||{})}catch(t){q_.error(t)}}(t,e,n,s,r)}else if("config"===r){const[r,o]=i;await async function(t,e,n,s,r,i){const o=s[r];try{if(o)await e[o];else{const t=(await Q_(n)).find(t=>t.measurementId===r);t&&await e[t.appId]}}catch(t){q_.error(t)}t("config",r,i)}(t,e,n,s,r,o)}else if("consent"===r){const[e,n]=i;t("consent",e,n)}else if("get"===r){const[e,n,s]=i;t("get",e,n,s)}else if("set"===r){const[e]=i;t("set",e)}else t(r,...i)}catch(t){q_.error(t)}}}const X_=new class{constructor(t={},e=1e3){this.throttleMetadata=t,this.intervalMillis=e}getThrottleMetadata(t){return this.throttleMetadata[t]}setThrottleMetadata(t,e){this.throttleMetadata[t]=e}deleteThrottleMetadata(t){delete this.throttleMetadata[t]}};function Z_(t){return new Headers({Accept:"application/json","x-goog-api-key":t})}async function tD(t,e=X_,n){const{appId:s,apiKey:r,measurementId:i}=t.options;if(!s)throw z_.create("no-app-id");if(!r){if(i)return{measurementId:i,appId:s};throw z_.create("no-api-key")}const o=e.getThrottleMetadata(s)||{backoffCount:0,throttleEndTimeMillis:Date.now()},a=new nD;return setTimeout(async()=>{a.abort()},6e4),eD({appId:s,apiKey:r,measurementId:i},o,a,e)}async function eD(t,{throttleEndTimeMillis:e,backoffCount:n},s,r=X_){const{appId:i,measurementId:o}=t;try{await function(t,e){return new Promise((n,s)=>{const r=Math.max(e-Date.now(),0),i=setTimeout(n,r);t.addEventListener(()=>{clearTimeout(i),s(z_.create("fetch-throttle",{throttleEndTimeMillis:e}))})})}(s,e)}catch(t){if(o)return q_.warn(`Timed out fetching this Firebase app's measurement ID from the server. Falling back to the measurement ID ${o} provided in the "measurementId" field in the local Firebase config. [${t?.message}]`),{appId:i,measurementId:o};throw t}try{const e=await async function(t){const{appId:e,apiKey:n}=t,s={method:"GET",headers:Z_(n)},r="https://firebase.googleapis.com/v1alpha/projects/-/apps/{app-id}/webConfig".replace("{app-id}",e),i=await fetch(r,s);if(200!==i.status&&304!==i.status){let t="";try{const e=await i.json();e.error?.message&&(t=e.error.message)}catch(t){}throw z_.create("config-fetch-failed",{httpStatus:i.status,responseMessage:t})}return i.json()}(t);return r.deleteThrottleMetadata(i),e}catch(e){const a=e;if(!function(t){if(!(t instanceof Vn&&t.customData))return!1;const e=Number(t.customData.httpStatus);return 429===e||500===e||503===e||504===e}(a)){if(r.deleteThrottleMetadata(i),o)return q_.warn(`Failed to fetch this Firebase app's measurement ID from the server. Falling back to the measurement ID ${o} provided in the "measurementId" field in the local Firebase config. [${a?.message}]`),{appId:i,measurementId:o};throw e}const B=503===Number(a?.customData?.httpStatus)?Yn(n,r.intervalMillis,30):Yn(n,r.intervalMillis),c={throttleEndTimeMillis:Date.now()+B,backoffCount:n+1};return r.setThrottleMetadata(i,c),q_.debug(`Calling attemptFetch again in ${B} millis`),eD(t,c,s,r)}}class nD{constructor(){this.listeners=[]}addEventListener(t){this.listeners.push(t)}abort(){this.listeners.forEach(t=>t())}}async function sD(t,e,n,s,r,i,o){const a=tD(t);a.then(e=>{n[e.measurementId]=e.appId,t.options.measurementId&&e.measurementId!==t.options.measurementId&&q_.warn(`The measurement ID in the local Firebase config (${t.options.measurementId}) does not match the measurement ID fetched from the server (${e.measurementId}). To ensure analytics events are always sent to the correct Analytics property, update the measurement ID field in the local config or remove it from the local config.`)}).catch(t=>q_.error(t)),e.push(a);const B=async function(){if(!Gn())return q_.warn(z_.create("indexeddb-unavailable",{errorInfo:"IndexedDB is not available in this environment."}).message),!1;try{await Hn()}catch(t){return q_.warn(z_.create("indexeddb-unavailable",{errorInfo:t?.toString()}).message),!1}return!0}().then(t=>t?s.getId():void 0),[c,l]=await Promise.all([a,B]);(function(t){const e=window.document.getElementsByTagName("script");for(const n of Object.values(e))if(n.src&&n.src.includes(J_)&&n.src.includes(t))return n;return null})(i)||W_(i,c.measurementId),r("js",new Date);const u=o?.config??{};return u.origin="firebase",u.update=!0,null!=l&&(u.firebase_id=l),r("config",c.measurementId,u),c.measurementId}class rD{constructor(t){this.app=t}_delete(){return delete iD[this.app.options.appId],Promise.resolve()}}let iD={},oD=[];const aD={};let BD,cD,lD="dataLayer",uD=!1;function hD(t,e,n){!function(){const t=[];if(Pn()&&t.push("This is a browser extension environment."),Un()||t.push("Cookies are not available."),t.length>0){const e=t.map((t,e)=>`(${e+1}) ${t}`).join(" "),n=z_.create("invalid-analytics-context",{errorInfo:e});q_.warn(n.message)}}();const s=t.options.appId;if(!s)throw z_.create("no-app-id");if(!t.options.apiKey){if(!t.options.measurementId)throw z_.create("no-api-key");q_.warn(`The "apiKey" field is empty in the local Firebase config. This is needed to fetch the latest measurement ID for this Firebase app. Falling back to the measurement ID ${t.options.measurementId} provided in the "measurementId" field in the local Firebase config.`)}if(null!=iD[s])throw z_.create("already-exists",{id:s});if(!uD){!function(t){let e=[];Array.isArray(window[t])?e=window[t]:window[t]=e}(lD);const{wrappedGtag:t,gtagCore:e}=function(t,e,n,s,r){let i=function(...t){window[s].push(arguments)};return window[r]&&"function"==typeof window[r]&&(i=window[r]),window[r]=Y_(i,t,e,n),{gtagCore:i,wrappedGtag:window[r]}}(iD,oD,aD,lD,"gtag");cD=t,BD=e,uD=!0}iD[s]=sD(t,oD,aD,e,BD,lD,n);return new rD(t)}function dD(t=gr()){const e=ur(t=Xn(t),$_);return e.isInitialized()?e.getImmediate():function(t,e={}){const n=ur(t,$_);if(n.isInitialized()){const t=n.getImmediate();if($n(e,n.getOptions()))return t;throw z_.create("already-initialized")}const s=n.initialize({options:e});return s}(t)}function pD(t,e,n){t=Xn(t),async function(t,e,n,s){if(s&&s.global){const e={};for(const t of Object.keys(n))e[`user_properties.${t}`]=n[t];return t("set",e),Promise.resolve()}t("config",await e,{update:!0,user_properties:n})}(cD,iD[t.app.options.appId],e,n).catch(t=>q_.error(t))}function fD(t,e,n,s){t=Xn(t),async function(t,e,n,s,r){if(r&&r.global)t("event",n,s);else{const r=await e;t("event",n,{...s,send_to:r})}}(cD,iD[t.app.options.appId],e,n,s).catch(t=>q_.error(t))}const CD="@firebase/analytics",gD="0.10.25";lr(new es($_,(t,{options:e})=>hD(t.getProvider("app").getImmediate(),t.getProvider("installations-internal").getImmediate(),e),"PUBLIC")),lr(new es("analytics-internal",function(t){try{const e=t.getProvider($_).getImmediate();return{logEvent:(t,n,s)=>fD(e,t,n,s),setUserProperties:(t,n)=>pD(e,t,n)}}catch(t){throw z_.create("interop-component-reg-failed",{reason:t})}},"PRIVATE")),mr(CD,gD),mr(CD,gD,"esm2020");let mD,wD=null;function yD(){const t=wD;return wD=null,t}function ED(t){wD=t,cE(AE,t)}let _D=Promise.resolve();const DD=()=>{Cn.dispatch(ln())};sE(()=>{gE(),Ka(qy).useDeviceLanguage(),_D=(async()=>{await async function(){if(Pn())return!1;if(!Un())return!1;if(!Gn())return!1;try{return await Hn()}catch(t){return!1}}()&&(mD=dD(qy))})(),Lo(Qy,t=>{cE(mE,{user:BE(t)}),t?(Cn.dispatch(an(!0)),Cn.dispatch(ln()),Cn.dispatch(hn(t.displayName??"")),Cn.dispatch(dn(t.email||"")),Cn.dispatch(pn(t.photoURL||"")),Cn.dispatch(fn(!0===t.emailVerified))):(Cn.dispatch(an(!1)),Cn.dispatch(hn("")),Cn.dispatch(dn("")),Cn.dispatch(pn("")),Cn.dispatch(fn(!1)))})});const bD=async t=>{const e=Qy.currentUser;if(!e||!e.email)return ED({code:"pwa/signed-out",message:"Sign in first."}),!1;try{const n=ho.credential(e.email,t);return await async function(t,e){return vo(Xn(t),e)}(e,n),!0}catch(t){return ED(lE(t)),!1}},vD=async()=>{if(!nE()){const t={code:"pwa/not-ready",message:"Sign-in is not ready yet."};throw cE(AE,t),new Error(t.message)}try{await function(t){return Xn(t).signOut()}(Qy),cE(yE,{user:null})}catch(t){throw cE(AE,lE(t)),t}},ID=async()=>{await _D,mD&&fD(mD,"create_account")},TD=async()=>{await _D,mD&&fD(mD,"delete_account")},OD=async(t,e)=>{await iw(xp(zy,t,e))};let AD="",SD=!1,RD=!1;function ND(t){if(!t)return AD="",SD=!1,!1;const e=!0===t.emailVerified;return t.uid!==AD?(AD=t.uid,SD=e,!1):!SD&&e?(SD=!0,!0):(SD=e,!1)}function xD(t){Cn.dispatch(fn(!0));const e=BE({...t,emailVerified:!0});e&&cE(RE,{user:e})}async function kD(t){if(!nE())return!1;const e=Qy.currentUser;if(!e)return ND(null),!1;try{await e.reload()}catch(n){return t&&cE(AE,lE(n)),!0===e.emailVerified}return Cn.dispatch(fn(!0===e.emailVerified)),ND(e)&&xD(e),!0===e.emailVerified}function LD(){kD(!1)}function FD(){"visible"===document.visibilityState&&kD(!1)}function PD(t,e){const n={code:t,message:e};throw cE(AE,n),Object.assign(new Error(e),n)}async function MD(){nE()||PD("pwa/not-ready","Sign-in is not ready yet.");const t=Qy.currentUser;if(t||PD("pwa/signed-out","Sign in first."),t.email||PD("pwa/missing-email","Enter an email address."),t.emailVerified)return!1;const e=eE();try{e?await Ro(t,e):await Ro(t)}catch(t){throw cE(AE,lE(t)),t}return cE(SE,{email:t.email}),!0}async function GD(){return kD(!0)}RD||(RD=!0,sE(()=>{Lo(Qy,t=>{t&&ND(t)&&xD(t),t||ND(null)}),"undefined"!=typeof window&&(window.addEventListener("focus",LD),document.addEventListener("visibilitychange",FD))}));const HD=i`
625
630
 
626
631
  .notice {
627
632
  margin: 4px 0 8px;
@@ -638,7 +643,7 @@ const t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow
638
643
  line-height: 1.45;
639
644
  }
640
645
 
641
- `;let U_="";const V_=new Set;function j_(){return U_}function $_(t){return V_.add(t),()=>{V_.delete(t)}}var J_=function(t,e,n,s){var r,i=arguments.length,o=i<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,n):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,s);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(i<3?r(o):i>3?r(e,n,o):r(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},q_=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let z_=class extends it{constructor(){super(),this.source="",this.hideGoogle=!1,this.email="",this.password="",this.status="",this.tone="",this.busy=!1,this.showPassword=!1,this.notice="",this.newAccount=async(t,e)=>{this.busy=!0,this.tone="",this.status="";try{const n=await async function(t,e,n){if(hr(t.app))return Promise.reject(Mr(t));const s=ji(t),r=Zi(s,{returnSecureToken:!0,email:e,password:n,clientType:"CLIENT_TYPE_WEB"},"signUpPassword",yo),i=await r.catch(e=>{throw"auth/password-does-not-meet-requirements"===e.code&&Oo(t),e}),o=await Eo._fromIdTokenResponse(s,"signIn",i);return await s._updateCurrentUser(o.user),o}(Qy,t,e);await I_();const s=BE(n.user);s&&cE(EE,{user:s});try{await M_(),this.notice="Check your inbox for the verification email. You can still sign in.",function(t){U_=t,V_.forEach(t=>t())}(t)}catch(t){this.tone="error",this.status=HE(t)}}catch(t){this.show(lE(t))}finally{this.busy=!1}}}connectedCallback(){super.connectedCallback(),this.adoptRedirect()}updated(){this.adoptRedirect()}adoptRedirect(){if(!this.classList.contains("opened"))return;const t=pE();t&&this.show(t)}static get styles(){return[Dn,VE,jE,UE,$E,JE,H_,zE,i`
646
+ `;let UD="";const VD=new Set;function jD(){return UD}function $D(t){return VD.add(t),()=>{VD.delete(t)}}var JD=function(t,e,n,s){var r,i=arguments.length,o=i<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,n):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,s);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(i<3?r(o):i>3?r(e,n,o):r(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},qD=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let zD=class extends it{constructor(){super(),this.source="",this.hideGoogle=!1,this.email="",this.password="",this.status="",this.tone="",this.busy=!1,this.showPassword=!1,this.notice="",this.newAccount=async(t,e)=>{this.busy=!0,this.tone="",this.status="";try{const n=await async function(t,e,n){if(hr(t.app))return Promise.reject(Mr(t));const s=ji(t),r=Zi(s,{returnSecureToken:!0,email:e,password:n,clientType:"CLIENT_TYPE_WEB"},"signUpPassword",yo),i=await r.catch(e=>{throw"auth/password-does-not-meet-requirements"===e.code&&Oo(t),e}),o=await Eo._fromIdTokenResponse(s,"signIn",i);return await s._updateCurrentUser(o.user),o}(Qy,t,e);await ID();const s=BE(n.user);s&&cE(EE,{user:s});try{await MD(),this.notice="Check your inbox for the verification email. You can still sign in.",function(t){UD=t,VD.forEach(t=>t())}(t)}catch(t){this.tone="error",this.status=HE(t)}}catch(t){this.show(lE(t))}finally{this.busy=!1}}}connectedCallback(){super.connectedCallback(),this.adoptRedirect()}updated(){this.adoptRedirect()}adoptRedirect(){if(!this.classList.contains("opened"))return;const t=pE();t&&this.show(t)}static get styles(){return[_n,VE,jE,UE,$E,JE,HD,zE,i`
642
647
 
643
648
  :host {
644
649
  background-color: var(--pwa_background, var(--section_background_color, #fff));
@@ -740,7 +745,7 @@ const t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow
740
745
 
741
746
  </form>
742
747
 
743
- `}change(){Cn.dispatch(un(this.source))}async google(){if(!this.busy){this.busy=!0,this.tone="",this.status="";try{await CE()}catch(t){this.show(lE(t))}finally{this.busy=!1}}}show(t){this.tone="error",this.status=HE(t),cE(AE,t)}readFields(){const t=this.renderRoot.querySelector('input[type="email"]'),e=this.renderRoot.querySelector('input[name="new-password"]');this.email=t?.value??"",this.password=e?.value??""}_handleSubmit(t){t.preventDefault(),this.signUp()}handleEmail(t){const e=t.target;this.email=e.value}handlePassword(t){const e=t.target;this.password=e.value}async signUp(){if(this.busy)return;if(this.readFields(),this.email.length<4)return void this.show({code:"pwa/missing-email",message:"Enter an email address."});const t=ME(this.password);t?this.show(t):await this.newAccount(this.email,this.password)}};function K_(t){if(nE())return;const e=t.getAttribute("firebase-config");if(e)try{iE({config:JSON.parse(e)})}catch(t){cE(AE,lE(t))}}function Q_(t,e){const n=t.trim();if(n){return n.split(/\s+/).slice(0,2).map(t=>t.charAt(0)).join("").toUpperCase()}const s=e.trim();return s?s.charAt(0).toUpperCase():""}function W_(t,e){const n=t.trim();if(n)return n;const s=e.trim();return s||"Account"}J_([lt({type:String}),q_("design:type",Object)],z_.prototype,"source",void 0),J_([lt({type:Boolean,attribute:"hide-google",reflect:!0}),q_("design:type",Object)],z_.prototype,"hideGoogle",void 0),J_([ut(),q_("design:type",Object)],z_.prototype,"email",void 0),J_([ut(),q_("design:type",Object)],z_.prototype,"password",void 0),J_([ut(),q_("design:type",Object)],z_.prototype,"status",void 0),J_([ut(),q_("design:type",Object)],z_.prototype,"tone",void 0),J_([ut(),q_("design:type",Object)],z_.prototype,"busy",void 0),J_([ut(),q_("design:type",Object)],z_.prototype,"showPassword",void 0),J_([ut(),q_("design:type",Object)],z_.prototype,"notice",void 0),z_=J_([at("form-signup"),q_("design:paramtypes",[])],z_);var Y_=function(t,e,n,s){var r,i=arguments.length,o=i<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,n):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,s);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(i<3?r(o):i>3?r(e,n,o):r(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},X_=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let Z_=class extends(wt(Cn)(it)){constructor(){super(),this.subscribe=!1,this.hideGoogle=!1,this._name="",this._email="",this._verified=!1,this._notice="",this._log=!1,this._sign=!1,this.motion=!1,this.clipHeight="auto",this.sheetShift="none",this.rollMotion=!1,this.booted=!1,this.stopNotice=null,this.heldHeight=null,this.columnWidth=0,this.columnObserver=null,this.onClipEnd=t=>{t instanceof TransitionEvent&&t.target===t.currentTarget&&"max-height"===t.propertyName&&this.rest()}}connectedCallback(){K_(this),this.hasAttribute("role")||this.setAttribute("role","region"),this.hasAttribute("aria-label")||this.setAttribute("aria-label","Account"),super.connectedCallback(),this._notice=j_(),this.stopNotice=$_(()=>{this._notice=j_()})}disconnectedCallback(){this.stopNotice?.(),this.stopNotice=null,this.columnObserver?.disconnect(),this.columnObserver=null,super.disconnectedCallback()}stateChanged(t){this._name=t.session.name,this._email=t.session.email,this._verified=Boolean(t.session.verified),this._log=t.session.login,this._sign=t.session.registerTwo}willUpdate(t){if(!this.booted)return;if(!t.has("_sign")&&!t.has("_log"))return;t.has("_sign")&&(this.motion=!0);const e=this.clip();e&&(this.heldHeight=Math.ceil(e.getBoundingClientRect().height),this.rollMotion=!1,this.clipHeight=`${this.heldHeight}px`,this.sheetShift="translate3d(0, 0, 0)")}updated(t){const e=!this.booted;if(this.booted=!0,e)return this.watchColumn(),void requestAnimationFrame(()=>{this.motion=!0});if(!t.has("_sign")&&!t.has("_log"))return;const n=this.clip(),s=this.sheet();if(!n||!s||null==this.heldHeight)return;const r=this.heldHeight;this.heldHeight=null;const i=Math.ceil(s.getBoundingClientRect().height);Math.abs(i-r)>1?this.rollBetween(n,s,r,i,i):this.rest()}watchColumn(){"undefined"!=typeof ResizeObserver&&(this.columnObserver=new ResizeObserver(()=>{const t=Math.round(this.getBoundingClientRect().width);if(!t||t===this.columnWidth)return;if(this.columnWidth=t,!this.rollMotion)return;const e=this.clip(),n=this.sheet();if(!e||!n)return;const s=Math.ceil(e.getBoundingClientRect().height),r=Math.ceil(n.getBoundingClientRect().height);this.rollBetween(e,n,s,r,r)}),this.columnObserver.observe(this))}clip(){return this.shadowRoot?.querySelector(".login-clip")??null}sheet(){return this.shadowRoot?.querySelector(".service")??null}reduced(){return window.matchMedia("(prefers-reduced-motion: reduce)").matches}rest(){this.rollMotion=!1,this.clipHeight="auto",this.sheetShift="none"}clipStyle(){const t=this.rollMotion&&!this.reduced();return{height:this.clipHeight,maxHeight:"auto"===this.clipHeight?"none":this.clipHeight,transition:t?"height var(--pwa_slide, 2s) ease-in-out, max-height var(--pwa_slide, 2s) ease-in-out":"none"}}sheetStyle(){const t=this.rollMotion&&!this.reduced();return{transform:this.sheetShift,transition:t?"transform var(--pwa_slide, 2s) ease-in-out":"none"}}rollBetween(t,e,n,s,r){const i=n-r,o=s-r,a=t=>`translate3d(0, ${t}px, 0)`;if(this.reduced()||Math.abs(s-n)<=1)return void this.rest();t.style.transition="none",e.style.transition="none",t.style.height=`${Math.max(0,n)}px`,t.style.maxHeight=`${Math.max(0,n)}px`,e.style.transform=a(i),t.offsetHeight,t.style.transition="height var(--pwa_slide, 2s) ease-in-out, max-height var(--pwa_slide, 2s) ease-in-out",e.style.transition="transform var(--pwa_slide, 2s) ease-in-out",t.style.height=`${Math.max(0,s)}px`,t.style.maxHeight=`${Math.max(0,s)}px`,e.style.transform=a(o),this.rollMotion=!0,this.clipHeight=`${Math.max(0,s)}px`,this.sheetShift=a(o)}static get styles(){return[wn,yn,En,Dn,gn,zE,H_,i`
748
+ `}change(){Cn.dispatch(un(this.source))}async google(){if(!this.busy){this.busy=!0,this.tone="",this.status="";try{await CE()}catch(t){this.show(lE(t))}finally{this.busy=!1}}}show(t){this.tone="error",this.status=HE(t),cE(AE,t)}readFields(){const t=this.renderRoot.querySelector('input[type="email"]'),e=this.renderRoot.querySelector('input[name="new-password"]');this.email=t?.value??"",this.password=e?.value??""}_handleSubmit(t){t.preventDefault(),this.signUp()}handleEmail(t){const e=t.target;this.email=e.value}handlePassword(t){const e=t.target;this.password=e.value}async signUp(){if(this.busy)return;if(this.readFields(),this.email.length<4)return void this.show({code:"pwa/missing-email",message:"Enter an email address."});const t=ME(this.password);t?this.show(t):await this.newAccount(this.email,this.password)}};function KD(t){if(nE())return;const e=t.getAttribute("firebase-config");if(e)try{iE({config:JSON.parse(e)})}catch(t){cE(AE,lE(t))}}function QD(t,e){const n=t.trim();if(n){return n.split(/\s+/).slice(0,2).map(t=>t.charAt(0)).join("").toUpperCase()}const s=e.trim();return s?s.charAt(0).toUpperCase():""}function WD(t,e){const n=t.trim();if(n)return n;const s=e.trim();return s||"Account"}JD([lt({type:String}),qD("design:type",Object)],zD.prototype,"source",void 0),JD([lt({type:Boolean,attribute:"hide-google",reflect:!0}),qD("design:type",Object)],zD.prototype,"hideGoogle",void 0),JD([ut(),qD("design:type",Object)],zD.prototype,"email",void 0),JD([ut(),qD("design:type",Object)],zD.prototype,"password",void 0),JD([ut(),qD("design:type",Object)],zD.prototype,"status",void 0),JD([ut(),qD("design:type",Object)],zD.prototype,"tone",void 0),JD([ut(),qD("design:type",Object)],zD.prototype,"busy",void 0),JD([ut(),qD("design:type",Object)],zD.prototype,"showPassword",void 0),JD([ut(),qD("design:type",Object)],zD.prototype,"notice",void 0),zD=JD([at("form-signup"),qD("design:paramtypes",[])],zD);var YD=function(t,e,n,s){var r,i=arguments.length,o=i<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,n):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,s);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(i<3?r(o):i>3?r(e,n,o):r(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},XD=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let ZD=class extends(wt(Cn)(it)){constructor(){super(),this.subscribe=!1,this.hideGoogle=!1,this._name="",this._email="",this._verified=!1,this._notice="",this._log=!1,this._sign=!1,this.motion=!1,this.clipHeight="auto",this.sheetShift="none",this.rollMotion=!1,this.booted=!1,this.stopNotice=null,this.heldHeight=null,this.columnWidth=0,this.columnObserver=null,this.onClipEnd=t=>{t instanceof TransitionEvent&&t.target===t.currentTarget&&"max-height"===t.propertyName&&this.rest()}}connectedCallback(){KD(this),this.hasAttribute("role")||this.setAttribute("role","region"),this.hasAttribute("aria-label")||this.setAttribute("aria-label","Account"),super.connectedCallback(),this._notice=jD(),this.stopNotice=$D(()=>{this._notice=jD()})}disconnectedCallback(){this.stopNotice?.(),this.stopNotice=null,this.columnObserver?.disconnect(),this.columnObserver=null,super.disconnectedCallback()}stateChanged(t){this._name=t.session.name,this._email=t.session.email,this._verified=Boolean(t.session.verified),this._log=t.session.login,this._sign=t.session.registerTwo}willUpdate(t){if(!this.booted)return;if(!t.has("_sign")&&!t.has("_log"))return;t.has("_sign")&&(this.motion=!0);const e=this.clip();e&&(this.heldHeight=Math.ceil(e.getBoundingClientRect().height),this.rollMotion=!1,this.clipHeight=`${this.heldHeight}px`,this.sheetShift="translate3d(0, 0, 0)")}updated(t){const e=!this.booted;if(this.booted=!0,e)return this.watchColumn(),void requestAnimationFrame(()=>{this.motion=!0});if(!t.has("_sign")&&!t.has("_log"))return;const n=this.clip(),s=this.sheet();if(!n||!s||null==this.heldHeight)return;const r=this.heldHeight;this.heldHeight=null;const i=Math.ceil(s.getBoundingClientRect().height);Math.abs(i-r)>1?this.rollBetween(n,s,r,i,i):this.rest()}watchColumn(){"undefined"!=typeof ResizeObserver&&(this.columnObserver=new ResizeObserver(()=>{const t=Math.round(this.getBoundingClientRect().width);if(!t||t===this.columnWidth)return;if(this.columnWidth=t,!this.rollMotion)return;const e=this.clip(),n=this.sheet();if(!e||!n)return;const s=Math.ceil(e.getBoundingClientRect().height),r=Math.ceil(n.getBoundingClientRect().height);this.rollBetween(e,n,s,r,r)}),this.columnObserver.observe(this))}clip(){return this.shadowRoot?.querySelector(".login-clip")??null}sheet(){return this.shadowRoot?.querySelector(".service")??null}reduced(){return window.matchMedia("(prefers-reduced-motion: reduce)").matches}rest(){this.rollMotion=!1,this.clipHeight="auto",this.sheetShift="none"}clipStyle(){const t=this.rollMotion&&!this.reduced();return{height:this.clipHeight,maxHeight:"auto"===this.clipHeight?"none":this.clipHeight,transition:t?"height var(--pwa_slide, 2s) ease-in-out, max-height var(--pwa_slide, 2s) ease-in-out":"none"}}sheetStyle(){const t=this.rollMotion&&!this.reduced();return{transform:this.sheetShift,transition:t?"transform var(--pwa_slide, 2s) ease-in-out":"none"}}rollBetween(t,e,n,s,r){const i=n-r,o=s-r,a=t=>`translate3d(0, ${t}px, 0)`;if(this.reduced()||Math.abs(s-n)<=1)return void this.rest();t.style.transition="none",e.style.transition="none",t.style.height=`${Math.max(0,n)}px`,t.style.maxHeight=`${Math.max(0,n)}px`,e.style.transform=a(i),t.offsetHeight,t.style.transition="height var(--pwa_slide, 2s) ease-in-out, max-height var(--pwa_slide, 2s) ease-in-out",e.style.transition="transform var(--pwa_slide, 2s) ease-in-out",t.style.height=`${Math.max(0,s)}px`,t.style.maxHeight=`${Math.max(0,s)}px`,e.style.transform=a(o),this.rollMotion=!0,this.clipHeight=`${Math.max(0,s)}px`,this.sheetShift=a(o)}static get styles(){return[wn,yn,En,_n,gn,zE,HD,i`
744
749
  /* Required - this card's roll only. Block, so the sheet is not stretched to the clip. */
745
750
  .login-clip {
746
751
  display: block;
@@ -761,7 +766,7 @@ const t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow
761
766
  <section class="service" part="panel" style=${mt(this.sheetStyle())}>
762
767
 
763
768
  <div part="header">
764
- <h2 part="title">${this._log?W_(this._name,this._email):this._sign===this.subscribe?"Login":"Subscribe"}</h2>
769
+ <h2 part="title">${this._log?WD(this._name,this._email):this._sign===this.subscribe?"Login":"Subscribe"}</h2>
765
770
  </div>
766
771
 
767
772
  <!-- Logged-out State -->
@@ -811,7 +816,10 @@ const t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow
811
816
  </section>
812
817
  </div>
813
818
 
814
- `}};Y_([lt({type:Boolean,attribute:!0,reflect:!0}),X_("design:type",Object)],Z_.prototype,"subscribe",void 0),Y_([lt({type:Boolean,attribute:"hide-google",reflect:!0}),X_("design:type",Object)],Z_.prototype,"hideGoogle",void 0),Y_([ut(),X_("design:type",Object)],Z_.prototype,"_name",void 0),Y_([ut(),X_("design:type",Object)],Z_.prototype,"_email",void 0),Y_([ut(),X_("design:type",Object)],Z_.prototype,"_verified",void 0),Y_([ut(),X_("design:type",Object)],Z_.prototype,"_notice",void 0),Y_([ut(),X_("design:type",Object)],Z_.prototype,"_log",void 0),Y_([ut(),X_("design:type",Object)],Z_.prototype,"_sign",void 0),Y_([ut(),X_("design:type",Object)],Z_.prototype,"motion",void 0),Y_([ut(),X_("design:type",Object)],Z_.prototype,"clipHeight",void 0),Y_([ut(),X_("design:type",Object)],Z_.prototype,"sheetShift",void 0),Y_([ut(),X_("design:type",Object)],Z_.prototype,"rollMotion",void 0),Z_=Y_([at("user-login"),X_("design:paramtypes",[])],Z_);const tb=U`<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"></path></svg>`,eb=i`
819
+ `}};YD([lt({type:Boolean,attribute:!0,reflect:!0}),XD("design:type",Object)],ZD.prototype,"subscribe",void 0),YD([lt({type:Boolean,attribute:"hide-google",reflect:!0}),XD("design:type",Object)],ZD.prototype,"hideGoogle",void 0),YD([ut(),XD("design:type",Object)],ZD.prototype,"_name",void 0),YD([ut(),XD("design:type",Object)],ZD.prototype,"_email",void 0),YD([ut(),XD("design:type",Object)],ZD.prototype,"_verified",void 0),YD([ut(),XD("design:type",Object)],ZD.prototype,"_notice",void 0),YD([ut(),XD("design:type",Object)],ZD.prototype,"_log",void 0),YD([ut(),XD("design:type",Object)],ZD.prototype,"_sign",void 0),YD([ut(),XD("design:type",Object)],ZD.prototype,"motion",void 0),YD([ut(),XD("design:type",Object)],ZD.prototype,"clipHeight",void 0),YD([ut(),XD("design:type",Object)],ZD.prototype,"sheetShift",void 0),YD([ut(),XD("design:type",Object)],ZD.prototype,"rollMotion",void 0),ZD=YD([at("user-login"),XD("design:paramtypes",[])],ZD);const tb=U`<svg viewBox="0 0 24 24" aria-hidden="true" fill="none">
820
+ <line x1="7" y1="7" x2="17" y2="17" stroke="currentColor" stroke-width="2" stroke-linecap="round"></line>
821
+ <line x1="17" y1="7" x2="7" y2="17" stroke="currentColor" stroke-width="2" stroke-linecap="round"></line>
822
+ </svg>`,eb=i`
815
823
 
816
824
  .spec[on] { display: grid; }
817
825
  .spec { display: none; }
@@ -871,8 +879,9 @@ const t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow
871
879
 
872
880
  .exit {
873
881
  display: grid;
874
- grid-template-columns: minmax(var(--pwa_tap, 44px), 80px) minmax(0, 1fr) minmax(var(--pwa_tap, 44px), 80px); /* Required - fit 320px */
875
- padding: 12px 8px;
882
+ grid-template-columns: var(--pwa_close_size, 44px) minmax(0, 1fr) var(--pwa_close_size, 44px);
883
+ align-items: center;
884
+ padding: 8px 12px;
876
885
  z-index: 2;
877
886
  background-color: var(--pwa_background, var(--pwa_drawer_background_color, #fff));
878
887
  border-bottom: 1px solid var(--pwa_line_color, #e3daca);
@@ -907,22 +916,39 @@ const t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow
907
916
  }
908
917
  */
909
918
  .close {
910
- min-height: var(--pwa_tap, 44px); /* Required - minimum tap target */
919
+ appearance: none;
920
+ box-sizing: border-box;
921
+ display: grid;
922
+ place-items: center;
923
+ justify-self: end;
924
+ align-self: center;
925
+ width: var(--pwa_close_size, 44px);
926
+ height: var(--pwa_close_size, 44px);
911
927
  min-width: var(--pwa_tap, 44px);
912
- height: auto;
913
- width: auto;
914
- margin: auto;
915
- background-color: transparent;
916
- border: 0px;
917
- fill: var(--pwa_close_color, #9a3b32);
928
+ min-height: var(--pwa_tap, 44px);
929
+ margin: 0;
930
+ padding: 0;
931
+ border-radius: var(--pwa_close_radius, 10px);
932
+ border: var(--pwa_close_border, 1px solid var(--pwa_line_color, #e3daca));
933
+ background: var(--pwa_close_background, #fff);
934
+ color: var(--pwa_close_mark, var(--pwa_drawer_text_color, #1c2430));
935
+ cursor: pointer;
918
936
  }
919
937
 
920
938
  .close svg {
921
- width: 24px;
922
- height: 24px;
939
+ width: 18px;
940
+ height: 18px;
923
941
  display: block;
924
942
  }
925
943
 
944
+ .close:hover {
945
+ background: var(--pwa_close_hover, var(--pwa_nav_on_background, #f2f2f2));
946
+ }
947
+
948
+ .close:active {
949
+ background: var(--pwa_close_active, #e7e2d6);
950
+ }
951
+
926
952
 
927
953
 
928
954
  `,rb=i`
@@ -1019,7 +1045,7 @@ const t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow
1019
1045
  min-width: 0;
1020
1046
  }
1021
1047
 
1022
- `;var lb=function(t,e,n,s){var r,i=arguments.length,o=i<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,n):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,s);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(i<3?r(o):i>3?r(e,n,o):r(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},ub=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};class hb extends(wt(Cn)(it)){constructor(){super(),this.login=!1,this.verified=!1,this.email="",this.status="",this.tone="",this.busy=!1,this.cooldown=0,this.timer=0,this.resend=async t=>{if(t.preventDefault(),!(this.busy||this.cooldown>0||this.verified)){this.busy=!0,this.tone="",this.status="";try{await M_()&&this.showSent()}catch(t){this.showFirebase(t)}finally{this.busy=!1}}}}disconnectedCallback(){this.clearWait(),super.disconnectedCallback()}stateChanged(t){this.login=Boolean(t.session.login),this.verified=Boolean(t.session.verified),this.email=t.session.email??"",this.hidden=!this.login,this.verified&&this.clearWait()}static get styles(){return[UE,zE,cb,i`
1048
+ `;var lb=function(t,e,n,s){var r,i=arguments.length,o=i<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,n):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,s);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(i<3?r(o):i>3?r(e,n,o):r(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},ub=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};class hb extends(wt(Cn)(it)){constructor(){super(),this.login=!1,this.verified=!1,this.email="",this.status="",this.tone="",this.busy=!1,this.cooldown=0,this.timer=0,this.resend=async t=>{if(t.preventDefault(),!(this.busy||this.cooldown>0||this.verified)){this.busy=!0,this.tone="",this.status="";try{await MD()&&this.showSent()}catch(t){this.showFirebase(t)}finally{this.busy=!1}}}}disconnectedCallback(){this.clearWait(),super.disconnectedCallback()}stateChanged(t){this.login=Boolean(t.session.login),this.verified=Boolean(t.session.verified),this.email=t.session.email??"",this.hidden=!this.login,this.verified&&this.clearWait()}static get styles(){return[UE,zE,cb,i`
1023
1049
 
1024
1050
  :host {
1025
1051
  display: block;
@@ -1152,7 +1178,7 @@ const t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow
1152
1178
  </form>
1153
1179
 
1154
1180
  </div>
1155
- `}showSent(){this.tone="",this.status="Check your inbox for the verification email.",this.cooldown=45,this.armCooldown(),this.updateComplete.then(()=>{this.focusStatus()})}showFirebase(t){this.tone="error",this.status=HE(t),this.updateComplete.then(()=>{this.focusStatus()})}focusStatus(){const t=this.renderRoot.querySelector("#pwa-verify-status");t?.focus()}clearWait(){window.clearInterval(this.timer),this.timer=0,this.cooldown=0}armCooldown(){window.clearInterval(this.timer),this.timer=window.setInterval(()=>{if(this.cooldown<=1)return this.cooldown=0,window.clearInterval(this.timer),void(this.timer=0);this.cooldown-=1},1e3)}}lb([ut(),ub("design:type",Object)],hb.prototype,"login",void 0),lb([ut(),ub("design:type",Object)],hb.prototype,"verified",void 0),lb([ut(),ub("design:type",Object)],hb.prototype,"email",void 0),lb([ut(),ub("design:type",Object)],hb.prototype,"status",void 0),lb([ut(),ub("design:type",Object)],hb.prototype,"tone",void 0),lb([ut(),ub("design:type",Object)],hb.prototype,"busy",void 0),lb([ut(),ub("design:type",Object)],hb.prototype,"cooldown",void 0),customElements.define("email-verify",hb);var db=function(t,e,n,s){var r,i=arguments.length,o=i<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,n):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,s);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(i<3?r(o):i>3?r(e,n,o):r(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},pb=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let fb=class extends(wt(Cn)(it)){constructor(){super(),this.url="",this.drawer=!1,this.subscribe=!1,this.hideGoogle=!1,this.name="",this.email="",this.verified=!1,this.notice="",this.user=!1,this.signup=!1,this.sliding=!1,this.motion=!1,this.clipHeight="0px",this.sheetShift="translate3d(0, -100%, 0)",this.rollMotion=!1,this.booted=!1,this.wasOpen=!1,this.sawOpen=!1,this.returnFocus=null,this.stopNotice=null,this.heldHeight=null,this.columnWidth=0,this.columnObserver=null,this.onClipEnd=t=>{if(!(t instanceof TransitionEvent))return;if(t.target!==t.currentTarget)return;if("max-height"!==t.propertyName)return;const e=t.currentTarget;e instanceof HTMLElement&&(this.drawer?this.restOpen():e.getBoundingClientRect().height>1||(this.sliding=!1,this.restShut()))},this.onKey=t=>{if(!this.drawer)return;if("Escape"===t.key)return t.preventDefault(),void Cn.dispatch(ln());if("Tab"!==t.key)return;const e=ob(this);if(!e.length)return;const n=e[0],s=e[e.length-1],r=ab(),i=!!r&&e.includes(r);t.shiftKey?i&&r!==n||(t.preventDefault(),s.focus({preventScroll:!0})):i&&r!==s||(t.preventDefault(),n.focus({preventScroll:!0}))},this.onLightClick=t=>{if(t.defaultPrevented)return;const e=t.target;if(!(e instanceof Element))return;const n=e.closest("a, button");n instanceof HTMLElement&&this.contains(n)&&(this.shadowRoot?.contains(n)||Cn.dispatch(ln()))},this.onSettings=t=>{const e=this.destination();if(!this.dispatchEvent(new CustomEvent(OE,{bubbles:!0,composed:!0,cancelable:!0,detail:{url:e}})))return void t.preventDefault();if(Cn.dispatch(ln()),e)return;t.preventDefault();const n=document.querySelector("user-settings");n instanceof HTMLElement&&n.scrollIntoView({block:"nearest"})}}connectedCallback(){K_(this),this.id||(this.id="pwa-user-drawer"),super.connectedCallback(),this.addEventListener("keydown",this.onKey),this.addEventListener("click",this.onLightClick),this.notice=j_(),this.stopNotice=$_(()=>{this.notice=j_()})}disconnectedCallback(){this.removeEventListener("keydown",this.onKey),this.removeEventListener("click",this.onLightClick),this.stopNotice?.(),this.stopNotice=null,this.columnObserver?.disconnect(),this.columnObserver=null,super.disconnectedCallback()}stateChanged(t){const e=t.session.drawer;this.name=t.session.name,this.email=t.session.email,this.verified=Boolean(t.session.verified),e?this.sliding=!0:this.reduced()&&(this.sliding=!1),this.drawer=e,this.user=t.session.login,this.signup=t.session.registerOne;(this.sawOpen?e!==this.wasOpen:e)&&function(t,e,n){t.dispatchEvent(new CustomEvent(e,{...aE,detail:n}))}(this,TE,{open:e}),this.wasOpen=e,this.sawOpen=!0}willUpdate(t){if(!this.booted)return void(this.drawer&&this.restOpen());if(t.has("signup")&&(this.motion=!0),t.has("drawer")||!t.has("signup")||!this.drawer)return;const e=this.clip();e&&(this.heldHeight=Math.ceil(e.getBoundingClientRect().height),this.rollMotion=!1,this.clipHeight=`${this.heldHeight}px`,this.sheetShift="translate3d(0, 0, 0)")}updated(t){const e=!this.booted;if(this.booted=!0,!e&&t.has("drawer"))this.heldHeight=null,this.drawer?this.unroll():this.rollUp();else if(!e&&null!=this.heldHeight&&this.drawer){const t=this.heldHeight;this.heldHeight=null;const e=this.clip(),n=this.sheet();if(e&&n){const s=Math.ceil(n.getBoundingClientRect().height);Math.abs(s-t)>1?this.rollBetween(e,n,t,s,s):this.restOpen()}}if(e&&requestAnimationFrame(()=>{this.motion=!0}),!t.has("drawer"))return;if(this.drawer){const t=ab();return this.returnFocus=t&&!this.contains(t)?t:this.returnFocus,this.shadowRoot?.querySelector(".close")?.focus({preventScroll:!0}),void k_(!1)}const n=this.returnFocus??this.toggleButton();n?.focus(),this.returnFocus=null}clip(){return this.shadowRoot?.querySelector(".drawer-clip")??null}sheet(){return this.shadowRoot?.querySelector(".userDrawer")??null}toggleButton(){const t=document.querySelector("user-icon"),e=t?.shadowRoot?.querySelector("button");return e instanceof HTMLElement?e:null}reduced(){return window.matchMedia("(prefers-reduced-motion: reduce)").matches}restShut(){this.rollMotion=!1,this.clipHeight="0px",this.sheetShift="translate3d(0, -100%, 0)"}restOpen(){this.rollMotion=!1,this.clipHeight="auto",this.sheetShift="none"}clipStyle(){const t=this.rollMotion&&!this.reduced();return{height:this.clipHeight,maxHeight:"auto"===this.clipHeight?"none":this.clipHeight,transition:t?"height var(--pwa_slide, 2s) ease-in-out, max-height var(--pwa_slide, 2s) ease-in-out":"none"}}sheetStyle(){const t=this.rollMotion&&!this.reduced();return{transform:this.sheetShift,transition:t?"transform var(--pwa_slide, 2s) ease-in-out":"none"}}unroll(){const t=this.clip(),e=this.sheet();if(!t||!e)return;this.scrollTop=0,this.placeAnchor();const n=this.sheetPx(t,e),s=Math.ceil(t.getBoundingClientRect().height);this.rollBetween(t,e,s,n,n)}rollUp(){const t=this.clip(),e=this.sheet();if(!t||!e)return;const n=Math.ceil(e.getBoundingClientRect().height),s=Math.ceil(t.getBoundingClientRect().height);this.rollBetween(t,e,s,0,n),this.reduced()&&(this.sliding=!1)}sheetPx(t,e){const n=t.style.transition,s=t.style.maxHeight,r=t.style.height;t.style.transition="none",t.style.maxHeight="none",t.style.height="auto";const i=Math.ceil(e.getBoundingClientRect().height);return t.style.height=r,t.style.maxHeight=s,t.style.transition=n,i}rollBetween(t,e,n,s,r){const i=n-r,o=s-r,a=t=>`translate3d(0, ${t}px, 0)`;if(this.reduced()||Math.abs(s-n)<=1)return void(0===s?this.restShut():this.restOpen());t.style.transition="none",e.style.transition="none",t.style.height=`${Math.max(0,n)}px`,t.style.maxHeight=`${Math.max(0,n)}px`,e.style.transform=a(i),t.offsetHeight,t.style.transition="height var(--pwa_slide, 2s) ease-in-out, max-height var(--pwa_slide, 2s) ease-in-out",e.style.transition="transform var(--pwa_slide, 2s) ease-in-out",t.style.height=`${Math.max(0,s)}px`,t.style.maxHeight=`${Math.max(0,s)}px`,e.style.transform=a(o),this.rollMotion=!0,this.clipHeight=`${Math.max(0,s)}px`,this.sheetShift=a(o)}firstUpdated(){this.shadowRoot.querySelector(".close").addEventListener("click",()=>{Cn.dispatch(ln())}),this.shadowRoot.querySelector(".leave").addEventListener("click",async()=>{if(this.user)try{await v_()}catch{return}Cn.dispatch(ln())});this.shadowRoot.querySelectorAll("a").forEach(t=>{t.addEventListener("click",()=>{Cn.dispatch(ln())})}),this.watchColumn()}placeAnchor(){const t=getComputedStyle(this).position;if("fixed"===t||"absolute"===t)return void(this.style.top&&(this.style.top=""));const e=this.parentElement;if(!e)return;const n=this.previousElementSibling,s=n?n.getBoundingClientRect().bottom:e.getBoundingClientRect().top+(parseFloat(getComputedStyle(e).paddingTop)||0),r=parseFloat(this.style.top)||0,i=s-(this.getBoundingClientRect().top-r);Math.abs(i-r)<=.5||(this.style.top=Math.abs(i)<=.5?"":`${i}px`)}watchColumn(){if("undefined"==typeof ResizeObserver)return;this.columnObserver=new ResizeObserver(()=>{this.placeAnchor();const t=Math.round(this.getBoundingClientRect().width);t&&t!==this.columnWidth&&(this.columnWidth=t,this.onColumnResize())}),this.columnObserver.observe(this);const t=this.previousElementSibling;t&&this.columnObserver.observe(t),this.placeAnchor()}onColumnResize(){if(!this.rollMotion)return;const t=this.clip(),e=this.sheet();if(!t||!e)return;const n=Math.ceil(t.getBoundingClientRect().height),s=this.sheetPx(t,e);this.rollBetween(t,e,n,this.drawer?s:0,s)}static get styles(){return[eb,gn,mn,nb,sb,rb,ib,Dn,zE,H_,cb,i`
1181
+ `}showSent(){this.tone="",this.status="Check your inbox for the verification email.",this.cooldown=45,this.armCooldown(),this.updateComplete.then(()=>{this.focusStatus()})}showFirebase(t){this.tone="error",this.status=HE(t),this.updateComplete.then(()=>{this.focusStatus()})}focusStatus(){const t=this.renderRoot.querySelector("#pwa-verify-status");t?.focus()}clearWait(){window.clearInterval(this.timer),this.timer=0,this.cooldown=0}armCooldown(){window.clearInterval(this.timer),this.timer=window.setInterval(()=>{if(this.cooldown<=1)return this.cooldown=0,window.clearInterval(this.timer),void(this.timer=0);this.cooldown-=1},1e3)}}lb([ut(),ub("design:type",Object)],hb.prototype,"login",void 0),lb([ut(),ub("design:type",Object)],hb.prototype,"verified",void 0),lb([ut(),ub("design:type",Object)],hb.prototype,"email",void 0),lb([ut(),ub("design:type",Object)],hb.prototype,"status",void 0),lb([ut(),ub("design:type",Object)],hb.prototype,"tone",void 0),lb([ut(),ub("design:type",Object)],hb.prototype,"busy",void 0),lb([ut(),ub("design:type",Object)],hb.prototype,"cooldown",void 0),customElements.define("email-verify",hb);var db=function(t,e,n,s){var r,i=arguments.length,o=i<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,n):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,s);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(i<3?r(o):i>3?r(e,n,o):r(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},pb=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let fb=class extends(wt(Cn)(it)){constructor(){super(),this.url="",this.drawer=!1,this.subscribe=!1,this.hideGoogle=!1,this.name="",this.email="",this.verified=!1,this.notice="",this.user=!1,this.sheetSigned=!1,this.holdSheet=!1,this.openSheetPx=0,this.liveName="",this.liveEmail="",this.liveVerified=!1,this.signup=!1,this.sliding=!1,this.motion=!1,this.clipHeight="0px",this.sheetShift="translate3d(0, -100%, 0)",this.rollMotion=!1,this.booted=!1,this.wasOpen=!1,this.sawOpen=!1,this.returnFocus=null,this.stopNotice=null,this.heldHeight=null,this.columnWidth=0,this.columnObserver=null,this.onClipEnd=t=>{if(!(t instanceof TransitionEvent))return;if(t.target!==t.currentTarget)return;if("max-height"!==t.propertyName)return;const e=t.currentTarget;e instanceof HTMLElement&&(this.drawer?this.restOpen():e.getBoundingClientRect().height>1||(this.sliding=!1,this.restShut(),this.releaseSheet()))},this.onKey=t=>{if(!this.drawer)return;if("Escape"===t.key)return t.preventDefault(),void Cn.dispatch(ln());if("Tab"!==t.key)return;const e=ob(this);if(!e.length)return;const n=e[0],s=e[e.length-1],r=ab(),i=!!r&&e.includes(r);t.shiftKey?i&&r!==n||(t.preventDefault(),s.focus({preventScroll:!0})):i&&r!==s||(t.preventDefault(),n.focus({preventScroll:!0}))},this.onLightClick=t=>{if(t.defaultPrevented)return;const e=t.target;if(!(e instanceof Element))return;const n=e.closest("a, button");n instanceof HTMLElement&&this.contains(n)&&(this.shadowRoot?.contains(n)||Cn.dispatch(ln()))},this.onSettings=t=>{const e=this.destination();if(!this.dispatchEvent(new CustomEvent(OE,{bubbles:!0,composed:!0,cancelable:!0,detail:{url:e}})))return void t.preventDefault();if(Cn.dispatch(ln()),e)return;t.preventDefault();const n=document.querySelector("user-settings");n instanceof HTMLElement&&n.scrollIntoView({block:"nearest"})}}connectedCallback(){KD(this),this.id||(this.id="pwa-user-drawer"),super.connectedCallback(),this.addEventListener("keydown",this.onKey),this.addEventListener("click",this.onLightClick),this.notice=jD(),this.stopNotice=$D(()=>{this.notice=jD()})}disconnectedCallback(){this.removeEventListener("keydown",this.onKey),this.removeEventListener("click",this.onLightClick),this.stopNotice?.(),this.stopNotice=null,this.columnObserver?.disconnect(),this.columnObserver=null,super.disconnectedCallback()}stateChanged(t){const e=t.session.drawer,n=this.drawer,s=!0===this.user;this.liveName=t.session.name,this.liveEmail=t.session.email,this.liveVerified=Boolean(t.session.verified),e?this.sliding=!0:this.reduced()&&(this.sliding=!1),this.drawer=e,this.user=t.session.login,this.signup=t.session.registerOne,this.paintAccount(s,n);(this.sawOpen?e!==this.wasOpen:e)&&function(t,e,n){t.dispatchEvent(new CustomEvent(e,{...aE,detail:n}))}(this,TE,{open:e}),this.wasOpen=e,this.sawOpen=!0}paintAccount(t,e){if(!0===this.user)return this.holdSheet=!1,this.name=this.liveName,this.email=this.liveEmail,this.verified=this.liveVerified,void(this.sheetSigned=!0);if(t&&e){const t=this.sheet(),e=t?Math.ceil(t.getBoundingClientRect().height):0;return e>1&&(this.openSheetPx=e),this.holdSheet=!0,void(this.sheetSigned=!0)}this.holdSheet||(this.name=this.liveName,this.email=this.liveEmail,this.verified=this.liveVerified,this.sheetSigned=!1)}releaseSheet(){this.holdSheet&&(this.holdSheet=!1,this.name=this.liveName,this.email=this.liveEmail,this.verified=this.liveVerified,this.sheetSigned=!0===this.user)}willUpdate(t){if(!this.booted)return void(this.drawer&&this.restOpen());if(t.has("signup")&&(this.motion=!0),t.has("drawer")||!t.has("signup")||!this.drawer)return;const e=this.clip();e&&(this.heldHeight=Math.ceil(e.getBoundingClientRect().height),this.rollMotion=!1,this.clipHeight=`${this.heldHeight}px`,this.sheetShift="translate3d(0, 0, 0)")}updated(t){const e=!this.booted;if(this.booted=!0,!e&&t.has("drawer"))this.heldHeight=null,this.drawer?this.unroll():this.rollUp();else if(!e&&null!=this.heldHeight&&this.drawer){const t=this.heldHeight;this.heldHeight=null;const e=this.clip(),n=this.sheet();if(e&&n){const s=Math.ceil(n.getBoundingClientRect().height);Math.abs(s-t)>1?this.rollBetween(e,n,t,s,s):this.restOpen()}}if(e&&requestAnimationFrame(()=>{this.motion=!0}),!t.has("drawer"))return;if(this.drawer){const t=ab();return this.returnFocus=t&&!this.contains(t)?t:this.returnFocus,this.shadowRoot?.querySelector(".close")?.focus({preventScroll:!0}),void kD(!1)}const n=this.returnFocus??this.toggleButton();n?.focus({preventScroll:!0}),this.returnFocus=null}clip(){return this.shadowRoot?.querySelector(".drawer-clip")??null}sheet(){return this.shadowRoot?.querySelector(".userDrawer")??null}toggleButton(){const t=document.querySelector("user-icon"),e=t?.shadowRoot?.querySelector("button");return e instanceof HTMLElement?e:null}reduced(){return window.matchMedia("(prefers-reduced-motion: reduce)").matches}restShut(){this.rollMotion=!1,this.clipHeight="0px",this.sheetShift="translate3d(0, -100%, 0)";const t=this.sheet();t&&(t.style.minHeight="")}restOpen(){this.rollMotion=!1,this.clipHeight="auto",this.sheetShift="none"}clipStyle(){const t=this.rollMotion&&!this.reduced();return{height:this.clipHeight,maxHeight:"auto"===this.clipHeight?"none":this.clipHeight,transition:t?"height var(--pwa_slide, 2s) ease-in-out, max-height var(--pwa_slide, 2s) ease-in-out":"none"}}sheetStyle(){const t=this.rollMotion&&!this.reduced();return{transform:this.sheetShift,transition:t?"transform var(--pwa_slide, 2s) ease-in-out":"none"}}unroll(){const t=this.clip(),e=this.sheet();if(!t||!e)return;this.scrollTop=0,this.placeAnchor();const n=this.sheetPx(t,e),s=Math.ceil(t.getBoundingClientRect().height);this.rollBetween(t,e,s,n,n)}rollUp(){const t=this.clip(),e=this.sheet();if(!t||!e)return;this.placeAnchor();let n=Math.ceil(e.getBoundingClientRect().height),s=Math.ceil(t.getBoundingClientRect().height);this.holdSheet&&this.openSheetPx>1&&(s=this.openSheetPx,n=this.openSheetPx,e.style.minHeight=`${this.openSheetPx}px`),this.rollBetween(t,e,s,0,n),this.reduced()&&(this.sliding=!1)}sheetPx(t,e){const n=t.style.transition,s=t.style.maxHeight,r=t.style.height;t.style.transition="none",t.style.maxHeight="none",t.style.height="auto";const i=Math.ceil(e.getBoundingClientRect().height);return t.style.height=r,t.style.maxHeight=s,t.style.transition=n,i}rollBetween(t,e,n,s,r){const i=n-r,o=s-r,a=t=>`translate3d(0, ${t}px, 0)`;if(this.reduced()||Math.abs(s-n)<=1)return void(0===s?(this.restShut(),this.releaseSheet()):this.restOpen());t.style.transition="none",e.style.transition="none",t.style.height=`${Math.max(0,n)}px`,t.style.maxHeight=`${Math.max(0,n)}px`,e.style.transform=a(i),t.offsetHeight,t.style.transition="height var(--pwa_slide, 2s) ease-in-out, max-height var(--pwa_slide, 2s) ease-in-out",e.style.transition="transform var(--pwa_slide, 2s) ease-in-out",t.style.height=`${Math.max(0,s)}px`,t.style.maxHeight=`${Math.max(0,s)}px`,e.style.transform=a(o),this.rollMotion=!0,this.clipHeight=`${Math.max(0,s)}px`,this.sheetShift=a(o)}firstUpdated(){this.shadowRoot.querySelector(".close").addEventListener("click",()=>{Cn.dispatch(ln())}),this.shadowRoot.querySelector(".leave").addEventListener("click",async()=>{if(this.user)try{await vD()}catch{return}Cn.dispatch(ln())});this.shadowRoot.querySelectorAll("a").forEach(t=>{t.addEventListener("click",()=>{Cn.dispatch(ln())})}),this.watchColumn()}placeAnchor(){const t=getComputedStyle(this).position;if("fixed"===t||"absolute"===t)return void(this.style.top&&(this.style.top=""));const e=this.parentElement;if(!e)return;const n=this.previousElementSibling,s=n?n.getBoundingClientRect().bottom:e.getBoundingClientRect().top+(parseFloat(getComputedStyle(e).paddingTop)||0),r=parseFloat(this.style.top)||0,i=s-(this.getBoundingClientRect().top-r);Math.abs(i-r)<=.5||(this.style.top=Math.abs(i)<=.5?"":`${i}px`)}watchColumn(){if("undefined"==typeof ResizeObserver)return;this.columnObserver=new ResizeObserver(()=>{this.placeAnchor();const t=Math.round(this.getBoundingClientRect().width);t&&t!==this.columnWidth&&(this.columnWidth=t,this.onColumnResize())}),this.columnObserver.observe(this);const t=this.previousElementSibling;t&&this.columnObserver.observe(t),this.placeAnchor()}onColumnResize(){if(!this.rollMotion)return;const t=this.clip(),e=this.sheet();if(!t||!e)return;const n=Math.ceil(t.getBoundingClientRect().height),s=this.sheetPx(t,e);this.rollBetween(t,e,n,this.drawer?s:0,s)}static get styles(){return[eb,gn,mn,nb,sb,rb,ib,_n,zE,HD,cb,i`
1156
1182
  /* Required - this drawer's roll only. The clip hangs from the tag and grows down. */
1157
1183
  .drawer-clip {
1158
1184
  display: block;
@@ -1248,8 +1274,8 @@ const t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow
1248
1274
  <div class="exit" part="header">
1249
1275
  <div></div>
1250
1276
  <h2 id="pwa-drawer-title" part="title">
1251
- <span class="who">${!1===this.user?this.signup===this.subscribe?"Login":"Subscribe":W_(this.name,this.email)}</span>
1252
- ${this.user?this.verified?Bb:U`<span class="unverified" part="unverified">Not verified</span>`:""}
1277
+ <span class="who">${!1===this.sheetSigned?this.signup===this.subscribe?"Login":"Subscribe":WD(this.name,this.email)}</span>
1278
+ ${this.sheetSigned?this.verified?Bb:U`<span class="unverified" part="unverified">Not verified</span>`:""}
1253
1279
  </h2>
1254
1280
  <button class="close" part="close" type="button" aria-label="Close">${tb}</button>
1255
1281
  </div>
@@ -1257,7 +1283,7 @@ const t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow
1257
1283
  <!-- Logged-out State -->
1258
1284
  <div
1259
1285
  class="spec"
1260
- ?on="${!1===this.user}">
1286
+ ?on="${!1===this.sheetSigned}">
1261
1287
 
1262
1288
  <div class= "wrapper">
1263
1289
  <div class=${ft({inner:!0,motion:this.motion})}>
@@ -1290,7 +1316,7 @@ const t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow
1290
1316
  <!-- Logged-in State -->
1291
1317
  <div
1292
1318
  class="spec setLog"
1293
- ?on="${!0===this.user}">
1319
+ ?on="${!0===this.sheetSigned}">
1294
1320
 
1295
1321
  <!-- Required - Jack's markers. A host link replaces the fallback. -->
1296
1322
  <slot name="before"><a href="/settings">slotted - before</a></slot>
@@ -1299,11 +1325,11 @@ const t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow
1299
1325
 
1300
1326
  <slot><a href="/settings">slotted - default</a></slot>
1301
1327
 
1302
- ${this.user&&this.notice&&!this.verified?U`
1328
+ ${this.sheetSigned&&this.notice&&!this.verified?U`
1303
1329
  <p class="notice" part="notice" role="status" aria-live="polite">Check your inbox for the verification email. You can still sign in.</p>
1304
1330
  `:""}
1305
1331
 
1306
- ${this.user?U`<email-verify exportparts="notice: verify-notice, status: verify-status, submit: verify-submit, verified: email-verified, unverified"></email-verify>`:""}
1332
+ ${this.sheetSigned?U`<email-verify exportparts="notice: verify-notice, status: verify-status, submit: verify-submit, verified: email-verified, unverified"></email-verify>`:""}
1307
1333
 
1308
1334
  <button class="leave" part="logout" type="button" aria-label="Log out">Log out</button>
1309
1335
 
@@ -1312,7 +1338,7 @@ const t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow
1312
1338
  </section>
1313
1339
  </div>
1314
1340
 
1315
- `}destination(){return(this.url||"").trim()}settingsControl(){const t=this.destination();return t?U`<a href="${t}" part="settings" @click="${this.onSettings}">Settings</a>`:U`<button type="button" class="settings" part="settings" @click="${this.onSettings}">Settings</button>`}};db([lt({type:String,reflect:!0}),pb("design:type",Object)],fb.prototype,"url",void 0),db([lt({type:Boolean,attribute:!0,reflect:!0}),pb("design:type",Object)],fb.prototype,"drawer",void 0),db([lt({type:Boolean,attribute:!0,reflect:!0}),pb("design:type",Object)],fb.prototype,"subscribe",void 0),db([lt({type:Boolean,attribute:"hide-google",reflect:!0}),pb("design:type",Object)],fb.prototype,"hideGoogle",void 0),db([ut(),pb("design:type",Object)],fb.prototype,"name",void 0),db([ut(),pb("design:type",Object)],fb.prototype,"email",void 0),db([ut(),pb("design:type",Object)],fb.prototype,"verified",void 0),db([ut(),pb("design:type",Object)],fb.prototype,"notice",void 0),db([ut(),pb("design:type",Object)],fb.prototype,"user",void 0),db([ut(),pb("design:type",Object)],fb.prototype,"signup",void 0),db([lt({type:Boolean,reflect:!0}),pb("design:type",Object)],fb.prototype,"sliding",void 0),db([ut(),pb("design:type",Object)],fb.prototype,"motion",void 0),db([ut(),pb("design:type",Object)],fb.prototype,"clipHeight",void 0),db([ut(),pb("design:type",Object)],fb.prototype,"sheetShift",void 0),db([ut(),pb("design:type",Object)],fb.prototype,"rollMotion",void 0),fb=db([at("user-drawer"),pb("design:paramtypes",[])],fb);const Cb=i`
1341
+ `}destination(){return(this.url||"").trim()}settingsControl(){const t=this.destination();return t?U`<a href="${t}" part="settings" @click="${this.onSettings}">Settings</a>`:U`<button type="button" class="settings" part="settings" @click="${this.onSettings}">Settings</button>`}};db([lt({type:String,reflect:!0}),pb("design:type",Object)],fb.prototype,"url",void 0),db([lt({type:Boolean,attribute:!0,reflect:!0}),pb("design:type",Object)],fb.prototype,"drawer",void 0),db([lt({type:Boolean,attribute:!0,reflect:!0}),pb("design:type",Object)],fb.prototype,"subscribe",void 0),db([lt({type:Boolean,attribute:"hide-google",reflect:!0}),pb("design:type",Object)],fb.prototype,"hideGoogle",void 0),db([ut(),pb("design:type",Object)],fb.prototype,"name",void 0),db([ut(),pb("design:type",Object)],fb.prototype,"email",void 0),db([ut(),pb("design:type",Object)],fb.prototype,"verified",void 0),db([ut(),pb("design:type",Object)],fb.prototype,"notice",void 0),db([ut(),pb("design:type",Object)],fb.prototype,"user",void 0),db([ut(),pb("design:type",Object)],fb.prototype,"sheetSigned",void 0),db([ut(),pb("design:type",Object)],fb.prototype,"signup",void 0),db([lt({type:Boolean,reflect:!0}),pb("design:type",Object)],fb.prototype,"sliding",void 0),db([ut(),pb("design:type",Object)],fb.prototype,"motion",void 0),db([ut(),pb("design:type",Object)],fb.prototype,"clipHeight",void 0),db([ut(),pb("design:type",Object)],fb.prototype,"sheetShift",void 0),db([ut(),pb("design:type",Object)],fb.prototype,"rollMotion",void 0),fb=db([at("user-drawer"),pb("design:paramtypes",[])],fb);const Cb=i`
1316
1342
 
1317
1343
  nav {
1318
1344
  overflow: hidden;
@@ -1397,7 +1423,7 @@ const t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow
1397
1423
  padding: 20px var(--pwa_inset, 0px) 4px;
1398
1424
  }
1399
1425
 
1400
- `;var gb=function(t,e,n,s){var r,i=arguments.length,o=i<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,n):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,s);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(i<3?r(o):i>3?r(e,n,o):r(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},mb=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};function wb(t){return"pwa-auth/"+t+"/photo"}async function yb(t){const e=await async function(t){try{return await createImageBitmap(t,{imageOrientation:"from-image"})}catch{return await createImageBitmap(t)}}(t);try{if(e.width<1||e.height<1)throw new Error("empty image");const t=function(t,e){const n=Math.max(t,e);if(!(n>1024))return{width:Math.max(1,Math.round(t)),height:Math.max(1,Math.round(e))};const s=1024/n;return{width:Math.max(1,Math.round(t*s)),height:Math.max(1,Math.round(e*s))}}(e.width,e.height),n=document.createElement("canvas");n.width=t.width,n.height=t.height;const s=n.getContext("2d");if(!s)throw new Error("no canvas");s.drawImage(e,0,0,t.width,t.height);const r=await new Promise(t=>{n.toBlob(e=>t(e),"image/jpeg",.8)});if(!r)throw new Error("no jpeg");return r}finally{e.close()}}class Eb extends(wt(Cn)(it)){constructor(){super(),this.photo="",this.emptyArtwork="",this.signed=!1,this.person="",this.mail="",this.progress=0,this.error="",this.status="",this.tone="",this.busy=!1,this.stopAuth=null,this.saveImage=async t=>{const e=t.target,n=e?.files?.[0],s=Qy.currentUser;if(this.error="",this.tone="",!s)return this.resetPicker(),void this.fail({code:"pwa/signed-out",message:"Sign in first."});if(!n)return this.resetPicker(),void this.fail({code:"pwa/missing-file",message:"Choose a photo first."});const r=function(t){return t.type.startsWith("image/")?t.size>5242880?{code:"pwa/photo-too-large",message:"Choose an image under 5 MB."}:null:{code:"pwa/not-image",message:"Choose an image file."}}(n);if(r)return this.resetPicker(),void this.fail(r);let i;this.busy=!0,this.progress=0,this.status="Preparing…";try{i=await yb(n)}catch{return this.busy=!1,this.progress=0,this.resetPicker(),void this.fail({code:"pwa/photo-unreadable",message:"That image could not be prepared. Try another."})}const o=Qy.currentUser;if(!o)return this.busy=!1,this.progress=0,this.resetPicker(),void this.fail({code:"pwa/signed-out",message:"Sign in first."});this.status="Uploading…";const a=jy(Ky,wb(o.uid)),B={cacheControl:"public,max-age=300",contentType:i.type||"image/jpeg"},c=Hy(a,i,B);c.on("state_changed",t=>{const e=t.totalBytes>0?t.bytesTransferred/t.totalBytes*100:0;this.progress=isFinite(e)?e:0,this.status=`Uploading… ${Math.round(this.progress)}%`},t=>{this.busy=!1,this.progress=0,this.resetPicker(),this.fail(t)},async()=>{try{const t=await function(t){return Ry(t=Xn(t))}(c.snapshot.ref),e=Qy.currentUser;if(!e)return await Vy(a).catch(()=>{}),void this.fail({code:"pwa/signed-out",message:"Sign in first."});try{await xo(e,{photoURL:t})}catch(t){throw await Vy(a).catch(()=>{}),t}Cn.dispatch(pn(t)),this.photo=t,this.progress=100,this.tone="",this.error="",this.status="Photo saved.",cE(_E,{uid:e.uid,displayName:e.displayName,photoURL:t})}catch(t){this.fail(t)}finally{this.busy=!1,this.resetPicker()}})},this.clearPhoto=async()=>{const t=Qy.currentUser;if(t&&!this.busy){this.busy=!0,this.error="",this.tone="",this.status="";try{await xo(t,{photoURL:null}),Cn.dispatch(pn("")),this.photo="",await Vy(jy(Ky,wb(t.uid))).catch(()=>{}),this.status="Photo removed.",cE(_E,{uid:t.uid,displayName:t.displayName,photoURL:null})}catch(t){this.fail(t)}finally{this.busy=!1,this.resetPicker()}}}}connectedCallback(){super.connectedCallback(),sE(()=>{this.stopAuth?.(),this.stopAuth=Lo(Qy,t=>{if(this.signed=!!t,!t)return this.tone="",this.error="",void(this.status="Sign in to upload a photo.");"Sign in to upload a photo."===this.status&&(this.status="")})})}disconnectedCallback(){this.stopAuth?.(),this.stopAuth=null,super.disconnectedCallback()}stateChanged(t){this.photo=t.session.photoURL,this.person=t.session.name,this.mail=t.session.email}static get styles(){return[VE,JE,i`
1426
+ `;var gb=function(t,e,n,s){var r,i=arguments.length,o=i<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,n):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,s);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(i<3?r(o):i>3?r(e,n,o):r(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},mb=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};function wb(t){return"pwa-auth/"+t+"/photo"}async function yb(t){const e=await async function(t){try{return await createImageBitmap(t,{imageOrientation:"from-image"})}catch{return await createImageBitmap(t)}}(t);try{if(e.width<1||e.height<1)throw new Error("empty image");const t=function(t,e){const n=Math.max(t,e);if(!(n>1024))return{width:Math.max(1,Math.round(t)),height:Math.max(1,Math.round(e))};const s=1024/n;return{width:Math.max(1,Math.round(t*s)),height:Math.max(1,Math.round(e*s))}}(e.width,e.height),n=document.createElement("canvas");n.width=t.width,n.height=t.height;const s=n.getContext("2d");if(!s)throw new Error("no canvas");s.drawImage(e,0,0,t.width,t.height);const r=await new Promise(t=>{n.toBlob(e=>t(e),"image/jpeg",.8)});if(!r)throw new Error("no jpeg");return r}finally{e.close()}}class Eb extends(wt(Cn)(it)){constructor(){super(),this.photo="",this.emptyArtwork="",this.signed=!1,this.person="",this.mail="",this.progress=0,this.error="",this.status="",this.tone="",this.busy=!1,this.stopAuth=null,this.saveImage=async t=>{const e=t.target,n=e?.files?.[0],s=Qy.currentUser;if(this.error="",this.tone="",!s)return this.resetPicker(),void this.fail({code:"pwa/signed-out",message:"Sign in first."});if(!n)return this.resetPicker(),void this.fail({code:"pwa/missing-file",message:"Choose a photo first."});const r=function(t){return t.type.startsWith("image/")?t.size>5242880?{code:"pwa/photo-too-large",message:"Choose an image under 5 MB."}:null:{code:"pwa/not-image",message:"Choose an image file."}}(n);if(r)return this.resetPicker(),void this.fail(r);let i;this.busy=!0,this.progress=0,this.status="Preparing…";try{i=await yb(n)}catch{return this.busy=!1,this.progress=0,this.resetPicker(),void this.fail({code:"pwa/photo-unreadable",message:"That image could not be prepared. Try another."})}const o=Qy.currentUser;if(!o)return this.busy=!1,this.progress=0,this.resetPicker(),void this.fail({code:"pwa/signed-out",message:"Sign in first."});this.status="Uploading…";const a=jy(Ky,wb(o.uid)),B={cacheControl:"public,max-age=300",contentType:i.type||"image/jpeg"},c=Hy(a,i,B);c.on("state_changed",t=>{const e=t.totalBytes>0?t.bytesTransferred/t.totalBytes*100:0;this.progress=isFinite(e)?e:0,this.status=`Uploading… ${Math.round(this.progress)}%`},t=>{this.busy=!1,this.progress=0,this.resetPicker(),this.fail(t)},async()=>{try{const t=await function(t){return Ry(t=Xn(t))}(c.snapshot.ref),e=Qy.currentUser;if(!e)return await Vy(a).catch(()=>{}),void this.fail({code:"pwa/signed-out",message:"Sign in first."});try{await xo(e,{photoURL:t})}catch(t){throw await Vy(a).catch(()=>{}),t}Cn.dispatch(pn(t)),this.photo=t,this.progress=100,this.tone="",this.error="",this.status="Photo saved.",cE(DE,{uid:e.uid,displayName:e.displayName,photoURL:t})}catch(t){this.fail(t)}finally{this.busy=!1,this.resetPicker()}})},this.clearPhoto=async()=>{const t=Qy.currentUser;if(t&&!this.busy){this.busy=!0,this.error="",this.tone="",this.status="";try{await xo(t,{photoURL:null}),Cn.dispatch(pn("")),this.photo="",await Vy(jy(Ky,wb(t.uid))).catch(()=>{}),this.status="Photo removed.",cE(DE,{uid:t.uid,displayName:t.displayName,photoURL:null})}catch(t){this.fail(t)}finally{this.busy=!1,this.resetPicker()}}}}connectedCallback(){super.connectedCallback(),sE(()=>{this.stopAuth?.(),this.stopAuth=Lo(Qy,t=>{if(this.signed=!!t,!t)return this.tone="",this.error="",void(this.status="Sign in to upload a photo.");"Sign in to upload a photo."===this.status&&(this.status="")})})}disconnectedCallback(){this.stopAuth?.(),this.stopAuth=null,super.disconnectedCallback()}stateChanged(t){this.photo=t.session.photoURL,this.person=t.session.name,this.mail=t.session.email}static get styles(){return[VE,JE,i`
1401
1427
 
1402
1428
  :host {
1403
1429
  position: relative;
@@ -1524,7 +1550,7 @@ const t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow
1524
1550
  opacity: 0.72;
1525
1551
  }
1526
1552
 
1527
- `]}letters(){return Q_(this.person,this.mail)}resetPicker(){const t=this.renderRoot.querySelector("input[type=file]");t&&(t.value="")}render(){const t=this.letters(),e="string"==typeof this.photo?this.photo:"",n=!this.signed||this.busy;return U`
1553
+ `]}letters(){return QD(this.person,this.mail)}resetPicker(){const t=this.renderRoot.querySelector("input[type=file]");t&&(t.value="")}render(){const t=this.letters(),e="string"==typeof this.photo?this.photo:"",n=!this.signed||this.busy;return U`
1528
1554
 
1529
1555
  <div class="chooser">
1530
1556
  <input
@@ -1571,7 +1597,7 @@ const t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow
1571
1597
  `:""}
1572
1598
 
1573
1599
  ${qE("pwa-photo-status",this.error||this.status,this.tone)}
1574
- `}fail(t){const e="object"==typeof t&&null!==t&&"code"in t&&"message"in t&&!(t instanceof Error)?t:lE(t);this.tone="error",this.error=HE(e),this.status="",cE(AE,e)}}gb([lt(),mb("design:type",Object)],Eb.prototype,"photo",void 0),gb([lt({type:String,reflect:!0}),mb("design:type",Object)],Eb.prototype,"emptyArtwork",void 0),gb([ut(),mb("design:type",Object)],Eb.prototype,"signed",void 0),gb([ut(),mb("design:type",Object)],Eb.prototype,"person",void 0),gb([ut(),mb("design:type",Object)],Eb.prototype,"mail",void 0),gb([ut(),mb("design:type",Number)],Eb.prototype,"progress",void 0),gb([ut(),mb("design:type",String)],Eb.prototype,"error",void 0),gb([ut(),mb("design:type",String)],Eb.prototype,"status",void 0),gb([ut(),mb("design:type",String)],Eb.prototype,"tone",void 0),gb([ut(),mb("design:type",Object)],Eb.prototype,"busy",void 0),customElements.define("contact-photo",Eb);var Db=function(t,e,n,s){var r,i=arguments.length,o=i<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,n):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,s);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(i<3?r(o):i>3?r(e,n,o):r(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},_b=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};class bb extends(wt(Cn)(it)){constructor(){super(),this.login=!1,this.draft="",this.busy=!1,this.status="",this.tone="",this.dirty=!1,this.default=t=>{t.preventDefault(),this.alertProfile()},this.alertProfile=async()=>{if(this.busy)return;const t=this.renderRoot.querySelector("#pwa-name"),e=(t?.value??this.draft).trim(),n=Qy.currentUser;if(n){this.busy=!0,this.tone="",this.status="";try{await xo(n,{displayName:e}),this.dirty=!1,this.draft=e,Cn.dispatch(hn(e)),this.status="Name saved.",cE(_E,{uid:n.uid,displayName:e,photoURL:n.photoURL})}catch(t){this.show(lE(t))}finally{this.busy=!1}}else this.show({code:"pwa/signed-out",message:"Sign in first."})}}stateChanged(t){const e=Boolean(t.session.login);e!==this.login&&(this.dirty=!1),this.login=e,this.dirty||(this.draft=t.session.name??"")}static get styles(){return[VE,jE,UE,JE,i`
1600
+ `}fail(t){const e="object"==typeof t&&null!==t&&"code"in t&&"message"in t&&!(t instanceof Error)?t:lE(t);this.tone="error",this.error=HE(e),this.status="",cE(AE,e)}}gb([lt(),mb("design:type",Object)],Eb.prototype,"photo",void 0),gb([lt({type:String,reflect:!0}),mb("design:type",Object)],Eb.prototype,"emptyArtwork",void 0),gb([ut(),mb("design:type",Object)],Eb.prototype,"signed",void 0),gb([ut(),mb("design:type",Object)],Eb.prototype,"person",void 0),gb([ut(),mb("design:type",Object)],Eb.prototype,"mail",void 0),gb([ut(),mb("design:type",Number)],Eb.prototype,"progress",void 0),gb([ut(),mb("design:type",String)],Eb.prototype,"error",void 0),gb([ut(),mb("design:type",String)],Eb.prototype,"status",void 0),gb([ut(),mb("design:type",String)],Eb.prototype,"tone",void 0),gb([ut(),mb("design:type",Object)],Eb.prototype,"busy",void 0),customElements.define("contact-photo",Eb);var _b=function(t,e,n,s){var r,i=arguments.length,o=i<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,n):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,s);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(i<3?r(o):i>3?r(e,n,o):r(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},Db=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};class bb extends(wt(Cn)(it)){constructor(){super(),this.login=!1,this.draft="",this.busy=!1,this.status="",this.tone="",this.dirty=!1,this.default=t=>{t.preventDefault(),this.alertProfile()},this.alertProfile=async()=>{if(this.busy)return;const t=this.renderRoot.querySelector("#pwa-name"),e=(t?.value??this.draft).trim(),n=Qy.currentUser;if(n){this.busy=!0,this.tone="",this.status="";try{await xo(n,{displayName:e}),this.dirty=!1,this.draft=e,Cn.dispatch(hn(e)),this.status="Name saved.",cE(DE,{uid:n.uid,displayName:e,photoURL:n.photoURL})}catch(t){this.show(lE(t))}finally{this.busy=!1}}else this.show({code:"pwa/signed-out",message:"Sign in first."})}}stateChanged(t){const e=Boolean(t.session.login);e!==this.login&&(this.dirty=!1),this.login=e,this.dirty||(this.draft=t.session.name??"")}static get styles(){return[VE,jE,UE,JE,i`
1575
1601
 
1576
1602
  :host, form { display: grid; align-content: start; }
1577
1603
 
@@ -1609,7 +1635,7 @@ const t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow
1609
1635
 
1610
1636
  </form>
1611
1637
 
1612
- `}handleInput(t){const e=t.target;this.dirty=!0,this.draft=e.value}show(t){this.tone="error",this.status=HE(t),cE(AE,t)}}Db([ut(),_b("design:type",Object)],bb.prototype,"login",void 0),Db([ut(),_b("design:type",Object)],bb.prototype,"draft",void 0),Db([ut(),_b("design:type",Object)],bb.prototype,"busy",void 0),Db([ut(),_b("design:type",Object)],bb.prototype,"status",void 0),Db([ut(),_b("design:type",Object)],bb.prototype,"tone",void 0),customElements.define("input-name",bb);const vb="userEmailChanged";var Ib=function(t,e,n,s){var r,i=arguments.length,o=i<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,n):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,s);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(i<3?r(o):i>3?r(e,n,o):r(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},Tb=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};class Ob extends(wt(Cn)(it)){constructor(){super(),this.email="",this.login=!1,this.mail="",this.busy=!1,this.status="",this.tone="",this.showPassword=!1,this.saveEmail=async t=>{if(t.preventDefault(),this.busy)return;const e=Qy.currentUser;if(!e)return void this.show({code:"pwa/signed-out",message:"Sign in first."});const n=this.shadowRoot?.querySelector("#pwa-current-email-password")?.value??"",s=this.shadowRoot?.querySelector("#pwa-email");if(!s)return;if(n.length<6)return void this.show({code:"pwa/current-password",message:"Enter your current password."});this.busy=!0,this.tone="",this.status="";if(!await b_(n)){const t=y_();return this.tone="error",this.status=HE(t??{code:"pwa/unknown",message:"Something went wrong. Try again."}),void(this.busy=!1)}try{const t=eE();t?await No(e,s.value,t):await No(e,s.value);const n={email:s.value};if(cE(bE,n),function(t){window.dispatchEvent(new CustomEvent(vb,{detail:t,bubbles:!0,composed:!0}))}(n),this.tone="",this.status="Check your inbox to confirm the new address.",!e.emailVerified)try{await M_()}catch{}}catch(t){const e=lE(t);this.tone="error",this.status=HE(t),cE(AE,e)}finally{this.busy=!1}}}stateChanged(t){this.login=t.session.login,this.mail=t.session.email}handleEmail(t){const e=t.target;this.mail=e.value}static get styles(){return[VE,jE,UE,$E,JE,i`
1638
+ `}handleInput(t){const e=t.target;this.dirty=!0,this.draft=e.value}show(t){this.tone="error",this.status=HE(t),cE(AE,t)}}_b([ut(),Db("design:type",Object)],bb.prototype,"login",void 0),_b([ut(),Db("design:type",Object)],bb.prototype,"draft",void 0),_b([ut(),Db("design:type",Object)],bb.prototype,"busy",void 0),_b([ut(),Db("design:type",Object)],bb.prototype,"status",void 0),_b([ut(),Db("design:type",Object)],bb.prototype,"tone",void 0),customElements.define("input-name",bb);const vb="userEmailChanged";var Ib=function(t,e,n,s){var r,i=arguments.length,o=i<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,n):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,s);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(i<3?r(o):i>3?r(e,n,o):r(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},Tb=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};class Ob extends(wt(Cn)(it)){constructor(){super(),this.email="",this.login=!1,this.mail="",this.busy=!1,this.status="",this.tone="",this.showPassword=!1,this.saveEmail=async t=>{if(t.preventDefault(),this.busy)return;const e=Qy.currentUser;if(!e)return void this.show({code:"pwa/signed-out",message:"Sign in first."});const n=this.shadowRoot?.querySelector("#pwa-current-email-password")?.value??"",s=this.shadowRoot?.querySelector("#pwa-email");if(!s)return;if(n.length<6)return void this.show({code:"pwa/current-password",message:"Enter your current password."});this.busy=!0,this.tone="",this.status="";if(!await bD(n)){const t=yD();return this.tone="error",this.status=HE(t??{code:"pwa/unknown",message:"Something went wrong. Try again."}),void(this.busy=!1)}try{const t=eE();t?await No(e,s.value,t):await No(e,s.value);const n={email:s.value};if(cE(bE,n),function(t){window.dispatchEvent(new CustomEvent(vb,{detail:t,bubbles:!0,composed:!0}))}(n),this.tone="",this.status="Check your inbox to confirm the new address.",!e.emailVerified)try{await MD()}catch{}}catch(t){const e=lE(t);this.tone="error",this.status=HE(t),cE(AE,e)}finally{this.busy=!1}}}stateChanged(t){this.login=t.session.login,this.mail=t.session.email}handleEmail(t){const e=t.target;this.mail=e.value}static get styles(){return[VE,jE,UE,$E,JE,i`
1613
1639
 
1614
1640
  :host, form { display: grid; align-content: start; }
1615
1641
 
@@ -1666,7 +1692,7 @@ const t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow
1666
1692
 
1667
1693
  </form>
1668
1694
 
1669
- `}show(t){this.tone="error",this.status=HE(t),cE(AE,t)}}Ib([lt({type:String,reflect:!0}),Tb("design:type",Object)],Ob.prototype,"email",void 0),Ib([ut(),Tb("design:type",Boolean)],Ob.prototype,"login",void 0),Ib([ut(),Tb("design:type",String)],Ob.prototype,"mail",void 0),Ib([ut(),Tb("design:type",Object)],Ob.prototype,"busy",void 0),Ib([ut(),Tb("design:type",Object)],Ob.prototype,"status",void 0),Ib([ut(),Tb("design:type",Object)],Ob.prototype,"tone",void 0),Ib([ut(),Tb("design:type",Object)],Ob.prototype,"showPassword",void 0),customElements.define("contact-email",Ob);var Ab=function(t,e,n,s){var r,i=arguments.length,o=i<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,n):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,s);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(i<3?r(o):i>3?r(e,n,o):r(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},Sb=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};class Rb extends(wt(Cn)(it)){constructor(){super(),this.message="",this.tone="",this.password="",this.login=!1,this.busy=!1,this.showCurrent=!1,this.showNext=!1,this.showVerify=!1,this.default=t=>{t.preventDefault(),this.alertPassword()},this.updatePass=async(t,e)=>{const n=Qy.currentUser;if(!n)return void this.show({code:"pwa/signed-out",message:"Sign in first."});this.busy=!0,this.tone="",this.message="";if(!await b_(t)){const t=y_();return this.tone="error",this.message=HE(t??{code:"pwa/unknown",message:"Something went wrong. Try again."}),void(this.busy=!1)}try{await ko(n,e),this.tone="",this.message="Password saved.",cE(vE,{uid:n.uid})}catch(t){const e=lE(t);this.tone="error",this.message=HE(t),cE(AE,e)}finally{this.busy=!1}}}stateChanged(t){this.login=t.session.login}handleInputChange(t){const e=t.target;this.password=e.value}static get styles(){return[VE,jE,UE,$E,JE,i`
1695
+ `}show(t){this.tone="error",this.status=HE(t),cE(AE,t)}}Ib([lt({type:String,reflect:!0}),Tb("design:type",Object)],Ob.prototype,"email",void 0),Ib([ut(),Tb("design:type",Boolean)],Ob.prototype,"login",void 0),Ib([ut(),Tb("design:type",String)],Ob.prototype,"mail",void 0),Ib([ut(),Tb("design:type",Object)],Ob.prototype,"busy",void 0),Ib([ut(),Tb("design:type",Object)],Ob.prototype,"status",void 0),Ib([ut(),Tb("design:type",Object)],Ob.prototype,"tone",void 0),Ib([ut(),Tb("design:type",Object)],Ob.prototype,"showPassword",void 0),customElements.define("contact-email",Ob);var Ab=function(t,e,n,s){var r,i=arguments.length,o=i<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,n):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,s);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(i<3?r(o):i>3?r(e,n,o):r(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},Sb=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};class Rb extends(wt(Cn)(it)){constructor(){super(),this.message="",this.tone="",this.password="",this.login=!1,this.busy=!1,this.showCurrent=!1,this.showNext=!1,this.showVerify=!1,this.default=t=>{t.preventDefault(),this.alertPassword()},this.updatePass=async(t,e)=>{const n=Qy.currentUser;if(!n)return void this.show({code:"pwa/signed-out",message:"Sign in first."});this.busy=!0,this.tone="",this.message="";if(!await bD(t)){const t=yD();return this.tone="error",this.message=HE(t??{code:"pwa/unknown",message:"Something went wrong. Try again."}),void(this.busy=!1)}try{await ko(n,e),this.tone="",this.message="Password saved.",cE(vE,{uid:n.uid})}catch(t){const e=lE(t);this.tone="error",this.message=HE(t),cE(AE,e)}finally{this.busy=!1}}}stateChanged(t){this.login=t.session.login}handleInputChange(t){const e=t.target;this.password=e.value}static get styles(){return[VE,jE,UE,$E,JE,i`
1670
1696
 
1671
1697
  :host{
1672
1698
  display: grid;
@@ -1763,7 +1789,7 @@ const t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow
1763
1789
 
1764
1790
  </form>
1765
1791
 
1766
- `}show(t){this.tone="error",this.message=HE(t),cE(AE,t)}async alertPassword(){if(this.busy)return;const t=this.shadowRoot.querySelector("#pwa-current-password").value,e=this.shadowRoot.querySelector("#pwa-new-password").value,n=this.shadowRoot.querySelector("#pwa-verify-password").value;if(this.password=e,t.length<6)return void this.show({code:"pwa/current-password",message:"Enter your current password."});const s=ME(this.password);s?this.show(s):this.password===n?Qy.currentUser?await this.updatePass(t,this.password):this.show({code:"pwa/signed-out",message:"Sign in first."}):this.show({code:"pwa/password-mismatch",message:PE})}}Ab([ut(),Sb("design:type",String)],Rb.prototype,"message",void 0),Ab([ut(),Sb("design:type",String)],Rb.prototype,"tone",void 0),Ab([ut(),Sb("design:type",String)],Rb.prototype,"password",void 0),Ab([ut(),Sb("design:type",Boolean)],Rb.prototype,"login",void 0),Ab([ut(),Sb("design:type",Boolean)],Rb.prototype,"busy",void 0),Ab([ut(),Sb("design:type",Object)],Rb.prototype,"showCurrent",void 0),Ab([ut(),Sb("design:type",Object)],Rb.prototype,"showNext",void 0),Ab([ut(),Sb("design:type",Object)],Rb.prototype,"showVerify",void 0),customElements.define("input-password",Rb);var Nb=function(t,e,n,s){var r,i=arguments.length,o=i<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,n):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,s);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(i<3?r(o):i>3?r(e,n,o):r(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},xb=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};class kb extends(wt(Cn)(it)){constructor(){super(),this.login=!1,this.email="",this.busy=!1,this.status="",this.tone="",this.showPassword=!1,this.alertDelete=()=>{if(this.busy)return;if(!Qy.currentUser)return void this.show({code:"pwa/signed-out",message:"Sign in first."});const t=this.shadowRoot.querySelector("#pwa-delete-password").value;if(t.length<6)return void this.show({code:"pwa/current-password",message:"Enter your current password."});1==confirm("Delete Account?")&&this.officialDelete(t)},this.officialDelete=async t=>{this.busy=!0,this.tone="",this.status="";if(!await b_(t)){const t=y_();return this.tone="error",this.status=HE(t??{code:"pwa/unknown",message:"Something went wrong. Try again."}),void(this.busy=!1)}const e=Qy.currentUser;if(!e)return this.show({code:"pwa/signed-out",message:"Sign in first."}),void(this.busy=!1);try{const t=e.uid;await(async t=>{const e=jy(Ky,"pwa-auth/"+t),n=await Uy(e);await Promise.all(n.items.map(t=>Vy(t)));for(const t of n.prefixes){const e=await Uy(t);await Promise.all(e.items.map(t=>Vy(t)))}})(t),await T_(),await e.delete(),cE(DE,{uid:t})}catch(t){const e=lE(t);this.tone="error",this.status=HE(t),cE(AE,e)}finally{this.busy=!1}}}stateChanged(t){this.login=t.session.login,this.email=t.session.email}static get styles(){return[UE,VE,jE,$E,JE,i`
1792
+ `}show(t){this.tone="error",this.message=HE(t),cE(AE,t)}async alertPassword(){if(this.busy)return;const t=this.shadowRoot.querySelector("#pwa-current-password").value,e=this.shadowRoot.querySelector("#pwa-new-password").value,n=this.shadowRoot.querySelector("#pwa-verify-password").value;if(this.password=e,t.length<6)return void this.show({code:"pwa/current-password",message:"Enter your current password."});const s=ME(this.password);s?this.show(s):this.password===n?Qy.currentUser?await this.updatePass(t,this.password):this.show({code:"pwa/signed-out",message:"Sign in first."}):this.show({code:"pwa/password-mismatch",message:PE})}}Ab([ut(),Sb("design:type",String)],Rb.prototype,"message",void 0),Ab([ut(),Sb("design:type",String)],Rb.prototype,"tone",void 0),Ab([ut(),Sb("design:type",String)],Rb.prototype,"password",void 0),Ab([ut(),Sb("design:type",Boolean)],Rb.prototype,"login",void 0),Ab([ut(),Sb("design:type",Boolean)],Rb.prototype,"busy",void 0),Ab([ut(),Sb("design:type",Object)],Rb.prototype,"showCurrent",void 0),Ab([ut(),Sb("design:type",Object)],Rb.prototype,"showNext",void 0),Ab([ut(),Sb("design:type",Object)],Rb.prototype,"showVerify",void 0),customElements.define("input-password",Rb);var Nb=function(t,e,n,s){var r,i=arguments.length,o=i<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,n):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,s);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(i<3?r(o):i>3?r(e,n,o):r(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},xb=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};class kb extends(wt(Cn)(it)){constructor(){super(),this.login=!1,this.email="",this.busy=!1,this.status="",this.tone="",this.showPassword=!1,this.alertDelete=()=>{if(this.busy)return;if(!Qy.currentUser)return void this.show({code:"pwa/signed-out",message:"Sign in first."});const t=this.shadowRoot.querySelector("#pwa-delete-password").value;if(t.length<6)return void this.show({code:"pwa/current-password",message:"Enter your current password."});1==confirm("Delete Account?")&&this.officialDelete(t)},this.officialDelete=async t=>{this.busy=!0,this.tone="",this.status="";if(!await bD(t)){const t=yD();return this.tone="error",this.status=HE(t??{code:"pwa/unknown",message:"Something went wrong. Try again."}),void(this.busy=!1)}const e=Qy.currentUser;if(!e)return this.show({code:"pwa/signed-out",message:"Sign in first."}),void(this.busy=!1);try{const t=e.uid;await(async t=>{const e=jy(Ky,"pwa-auth/"+t),n=await Uy(e);await Promise.all(n.items.map(t=>Vy(t)));for(const t of n.prefixes){const e=await Uy(t);await Promise.all(e.items.map(t=>Vy(t)))}})(t),await TD(),await e.delete(),cE(_E,{uid:t})}catch(t){const e=lE(t);this.tone="error",this.status=HE(t),cE(AE,e)}finally{this.busy=!1}}}stateChanged(t){this.login=t.session.login,this.email=t.session.email}static get styles(){return[UE,VE,jE,$E,JE,i`
1767
1793
 
1768
1794
  :host {
1769
1795
  display: grid;
@@ -1814,7 +1840,7 @@ const t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow
1814
1840
  ?disabled="${!1===this.login||this.busy}"
1815
1841
  @click="${this.alertDelete}">${this.busy?"Deleting…":"Delete"}</button>
1816
1842
 
1817
- `}show(t){this.tone="error",this.status=HE(t),cE(AE,t)}}Nb([ut(),xb("design:type",Boolean)],kb.prototype,"login",void 0),Nb([ut(),xb("design:type",String)],kb.prototype,"email",void 0),Nb([ut(),xb("design:type",Object)],kb.prototype,"busy",void 0),Nb([ut(),xb("design:type",Object)],kb.prototype,"status",void 0),Nb([ut(),xb("design:type",Object)],kb.prototype,"tone",void 0),Nb([ut(),xb("design:type",Object)],kb.prototype,"showPassword",void 0),customElements.define("delete-user",kb);var Lb=function(t,e,n,s){var r,i=arguments.length,o=i<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,n):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,s);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(i<3?r(o):i>3?r(e,n,o):r(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},Fb=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let Pb=class extends(wt(Cn)(it)){constructor(){super(),this.empty="",this.profileTopic="",this.name="",this.email="",this.login=!1,this.clipHeight="auto",this.sheetShift="none",this.rollMotion=!1,this.leaving="",this.leaveClipHeight="0px",this.leaveSheetShift="translate3d(0, 0, 0)",this.leaveMotion=!1,this.booted=!1,this.heldHeight=null,this.leaveFrom=0,this.columnWidth=0,this.columnObserver=null,this.onSubmit=t=>{t.preventDefault()},this.onFrontEnd=t=>{t instanceof TransitionEvent&&t.target===t.currentTarget&&"max-height"===t.propertyName&&this.rest()},this.onBackEnd=t=>{t instanceof TransitionEvent&&t.target===t.currentTarget&&"max-height"===t.propertyName&&(this.leaving="",this.leaveMotion=!1)}}connectedCallback(){K_(this),this.hasAttribute("role")||this.setAttribute("role","region"),this.hasAttribute("aria-label")||this.setAttribute("aria-label","Account settings"),super.connectedCallback(),this.addEventListener("submit",this.onSubmit)}disconnectedCallback(){this.removeEventListener("submit",this.onSubmit),this.columnObserver?.disconnect(),this.columnObserver=null,super.disconnectedCallback()}onTabKey(t){if("ArrowRight"!==t.key&&"ArrowLeft"!==t.key)return;t.preventDefault();const e=["profile","verification","password","delete"],n=e.indexOf(this.profileTopic),s=e[(n+("ArrowRight"===t.key?1:-1)+e.length)%e.length];Cn.dispatch(on(s)),this.updateComplete.then(()=>{this.shadowRoot?.querySelector(`button[value="${s}"]`)?.focus()})}stateChanged(t){this.profileTopic=t.session.settings,this.login=Boolean(t.session.login),this.name=t.session.name,this.email=t.session.email}static get styles(){return[Cb,Dn,zE,i`
1843
+ `}show(t){this.tone="error",this.status=HE(t),cE(AE,t)}}Nb([ut(),xb("design:type",Boolean)],kb.prototype,"login",void 0),Nb([ut(),xb("design:type",String)],kb.prototype,"email",void 0),Nb([ut(),xb("design:type",Object)],kb.prototype,"busy",void 0),Nb([ut(),xb("design:type",Object)],kb.prototype,"status",void 0),Nb([ut(),xb("design:type",Object)],kb.prototype,"tone",void 0),Nb([ut(),xb("design:type",Object)],kb.prototype,"showPassword",void 0),customElements.define("delete-user",kb);var Lb=function(t,e,n,s){var r,i=arguments.length,o=i<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,n):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,s);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(i<3?r(o):i>3?r(e,n,o):r(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},Fb=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let Pb=class extends(wt(Cn)(it)){constructor(){super(),this.empty="",this.profileTopic="",this.name="",this.email="",this.login=!1,this.clipHeight="auto",this.sheetShift="none",this.rollMotion=!1,this.leaving="",this.leaveClipHeight="0px",this.leaveSheetShift="translate3d(0, 0, 0)",this.leaveMotion=!1,this.booted=!1,this.heldHeight=null,this.leaveFrom=0,this.columnWidth=0,this.columnObserver=null,this.onSubmit=t=>{t.preventDefault()},this.onFrontEnd=t=>{t instanceof TransitionEvent&&t.target===t.currentTarget&&"max-height"===t.propertyName&&this.rest()},this.onBackEnd=t=>{t instanceof TransitionEvent&&t.target===t.currentTarget&&"max-height"===t.propertyName&&(this.leaving="",this.leaveMotion=!1)}}connectedCallback(){KD(this),this.hasAttribute("role")||this.setAttribute("role","region"),this.hasAttribute("aria-label")||this.setAttribute("aria-label","Account settings"),super.connectedCallback(),this.addEventListener("submit",this.onSubmit)}disconnectedCallback(){this.removeEventListener("submit",this.onSubmit),this.columnObserver?.disconnect(),this.columnObserver=null,super.disconnectedCallback()}onTabKey(t){if("ArrowRight"!==t.key&&"ArrowLeft"!==t.key)return;t.preventDefault();const e=["profile","verification","password","delete"],n=e.indexOf(this.profileTopic),s=e[(n+("ArrowRight"===t.key?1:-1)+e.length)%e.length];Cn.dispatch(on(s)),this.updateComplete.then(()=>{this.shadowRoot?.querySelector(`button[value="${s}"]`)?.focus()})}stateChanged(t){this.profileTopic=t.session.settings,this.login=Boolean(t.session.login),this.name=t.session.name,this.email=t.session.email}static get styles(){return[Cb,_n,zE,i`
1818
1844
 
1819
1845
  :host {
1820
1846
  display: block;
@@ -1914,7 +1940,7 @@ const t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow
1914
1940
  </section>
1915
1941
  `}render(){if(!this.login)return U`
1916
1942
  <p class="signed-out" part="signed-out" role="status">Sign in to change the photo, name, email, or password.</p>
1917
- `;const t=W_(this.name,this.email);return U`
1943
+ `;const t=WD(this.name,this.email);return U`
1918
1944
 
1919
1945
  <!-- Page Menu -->
1920
1946
  <nav aria-label="Account" @keydown="${this.onTabKey}">
@@ -2072,7 +2098,7 @@ const t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow
2072
2098
  letter-spacing: 0.04em;
2073
2099
  }
2074
2100
 
2075
- `;var Gb=function(t,e,n,s){var r,i=arguments.length,o=i<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,n):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,s);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(i<3?r(o):i>3?r(e,n,o):r(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},Hb=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let Ub=class extends(wt(Cn)(it)){constructor(){super(),this.subscribe=!1,this.empty="",this._user=!1,this._open=!1,this._photoURL="",this._name="",this._email=""}connectedCallback(){K_(this),super.connectedCallback()}firstUpdated(){this.shadowRoot.querySelector(".toggles").addEventListener("click",()=>{Cn.dispatch(Bn())})}stateChanged(t){this._user=t.session.login,this._open=t.session.drawer,this._photoURL=t.session.photoURL,this._name=t.session.name,this._email=t.session.email}updated(){const t=this.shadowRoot?.querySelector("button"),e=document.querySelector("user-drawer");if(!(t&&e instanceof HTMLElement&&e.id))return;t.setAttribute("aria-controls",e.id);"ariaControlsElements"in t&&(t.ariaControlsElements=[e])}static get styles(){return[Mb,i`:host { border-radius: 10px; }`]}render(){return U`
2101
+ `;var Gb=function(t,e,n,s){var r,i=arguments.length,o=i<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,n):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,s);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(i<3?r(o):i>3?r(e,n,o):r(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},Hb=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let Ub=class extends(wt(Cn)(it)){constructor(){super(),this.subscribe=!1,this.empty="",this._user=!1,this._open=!1,this._photoURL="",this._name="",this._email=""}connectedCallback(){KD(this),super.connectedCallback()}firstUpdated(){this.shadowRoot.querySelector(".toggles").addEventListener("click",()=>{Cn.dispatch(Bn())})}stateChanged(t){this._user=t.session.login,this._open=t.session.drawer,this._photoURL=t.session.photoURL,this._name=t.session.name,this._email=t.session.email}updated(){const t=this.shadowRoot?.querySelector("button"),e=document.querySelector("user-drawer");if(!(t&&e instanceof HTMLElement&&e.id))return;t.setAttribute("aria-controls",e.id);"ariaControlsElements"in t&&(t.ariaControlsElements=[e])}static get styles(){return[Mb,i`:host { border-radius: 10px; }`]}render(){return U`
2076
2102
 
2077
2103
  <!-- two classes: icon / login -->
2078
2104
  <button
@@ -2088,7 +2114,7 @@ const t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow
2088
2114
 
2089
2115
  </button>
2090
2116
 
2091
- `}face(){if(this._photoURL)return U`<img class="userImage" part="photo" alt="" src="${this._photoURL}">`;const t=Q_(this._name,this._email);return t?U`<span class="initials" part="initials" aria-hidden="true">${t}</span>`:this.empty?U`<img class="userImage" part="photo" alt="" src="${this.empty}">`:U`<span class="initials" part="initials" aria-hidden="true">?</span>`}};Gb([lt({type:Boolean,reflect:!0}),Hb("design:type",Object)],Ub.prototype,"subscribe",void 0),Gb([lt({type:String,reflect:!0}),Hb("design:type",Object)],Ub.prototype,"empty",void 0),Gb([ut(),Hb("design:type",Object)],Ub.prototype,"_user",void 0),Gb([ut(),Hb("design:type",Object)],Ub.prototype,"_open",void 0),Gb([ut(),Hb("design:type",Object)],Ub.prototype,"_photoURL",void 0),Gb([ut(),Hb("design:type",Object)],Ub.prototype,"_name",void 0),Gb([ut(),Hb("design:type",Object)],Ub.prototype,"_email",void 0),Ub=Gb([at("user-icon"),Hb("design:paramtypes",[])],Ub);var Vb=function(t,e,n,s){var r,i=arguments.length,o=i<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,n):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,s);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(i<3?r(o):i>3?r(e,n,o):r(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},jb=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};class $b extends it{constructor(){super(),this.active=!1}shouldUpdate(){return this.active}}function Jb(){Cn.dispatch(cn())}function qb(){Cn.dispatch(ln())}function zb(){Cn.dispatch(Bn())}Vb([lt({type:Boolean}),jb("design:type",Boolean)],$b.prototype,"active",void 0);var Kb=function(t,e,n,s){var r,i=arguments.length,o=i<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,n):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,s);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(i<3?r(o):i>3?r(e,n,o):r(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},Qb=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let Wb=class extends $b{constructor(){super(),this.userEmail="",this.status="",this.tone="",this.invalid=!1,this.busy=!1,this.cooldown=0,this.touched=!1,this.timer=0,this.stopDraft=null,this.resetPassword=async t=>{if(t.preventDefault(),this.busy||this.cooldown>0)return;const e=this.renderRoot.querySelector(".email");this.userEmail=(e?e.value:this.userEmail).trim(),e&&e.value!==this.userEmail&&(e.value=this.userEmail);const n=(s=this.userEmail).length<4?{code:"pwa/missing-email",message:"Enter an email address."}:/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(s)?null:{code:"pwa/invalid-email",message:"Enter a valid email address."};var s;if(n)this.showError(n,"email");else{this.busy=!0,this.tone="",this.status="";try{await Ao(Qy,this.userEmail),this.showSent()}catch(t){!function(t){return"auth/user-not-found"===lE(t).code}(t)?this.showFirebase(t):this.showSent()}finally{this.busy=!1}}},this.backToSignIn=()=>{const t=document.querySelector("user-drawer");if(t){const e=t.hasAttribute("subscribe");return Boolean(Cn.getState().session?.registerOne)!==e&&Cn.dispatch(un("drawer")),void Jb()}const e=document.querySelector("user-login");if(!e)return;const n=e.hasAttribute("subscribe");Boolean(Cn.getState().session?.registerTwo)!==n&&Cn.dispatch(un("page")),e.scrollIntoView({block:"nearest"})}}static{this.styles=[VE,jE,UE,$E,i`
2117
+ `}face(){if(this._photoURL)return U`<img class="userImage" part="photo" alt="" src="${this._photoURL}">`;const t=QD(this._name,this._email);return t?U`<span class="initials" part="initials" aria-hidden="true">${t}</span>`:this.empty?U`<img class="userImage" part="photo" alt="" src="${this.empty}">`:U`<span class="initials" part="initials" aria-hidden="true">?</span>`}};Gb([lt({type:Boolean,reflect:!0}),Hb("design:type",Object)],Ub.prototype,"subscribe",void 0),Gb([lt({type:String,reflect:!0}),Hb("design:type",Object)],Ub.prototype,"empty",void 0),Gb([ut(),Hb("design:type",Object)],Ub.prototype,"_user",void 0),Gb([ut(),Hb("design:type",Object)],Ub.prototype,"_open",void 0),Gb([ut(),Hb("design:type",Object)],Ub.prototype,"_photoURL",void 0),Gb([ut(),Hb("design:type",Object)],Ub.prototype,"_name",void 0),Gb([ut(),Hb("design:type",Object)],Ub.prototype,"_email",void 0),Ub=Gb([at("user-icon"),Hb("design:paramtypes",[])],Ub);var Vb=function(t,e,n,s){var r,i=arguments.length,o=i<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,n):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,s);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(i<3?r(o):i>3?r(e,n,o):r(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},jb=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};class $b extends it{constructor(){super(),this.active=!1}shouldUpdate(){return this.active}}function Jb(){Cn.dispatch(cn())}function qb(){Cn.dispatch(ln())}function zb(){Cn.dispatch(Bn())}Vb([lt({type:Boolean}),jb("design:type",Boolean)],$b.prototype,"active",void 0);var Kb=function(t,e,n,s){var r,i=arguments.length,o=i<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,n):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,s);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(i<3?r(o):i>3?r(e,n,o):r(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},Qb=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let Wb=class extends $b{constructor(){super(),this.userEmail="",this.status="",this.tone="",this.invalid=!1,this.busy=!1,this.cooldown=0,this.touched=!1,this.timer=0,this.stopDraft=null,this.resetPassword=async t=>{if(t.preventDefault(),this.busy||this.cooldown>0)return;const e=this.renderRoot.querySelector(".email");this.userEmail=(e?e.value:this.userEmail).trim(),e&&e.value!==this.userEmail&&(e.value=this.userEmail);const n=(s=this.userEmail).length<4?{code:"pwa/missing-email",message:"Enter an email address."}:/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(s)?null:{code:"pwa/invalid-email",message:"Enter a valid email address."};var s;if(n)this.showError(n,"email");else{this.busy=!0,this.tone="",this.status="";try{await Ao(Qy,this.userEmail),this.showSent()}catch(t){!function(t){return"auth/user-not-found"===lE(t).code}(t)?this.showFirebase(t):this.showSent()}finally{this.busy=!1}}},this.backToSignIn=()=>{const t=document.querySelector("user-drawer");if(t){const e=t.hasAttribute("subscribe");return Boolean(Cn.getState().session?.registerOne)!==e&&Cn.dispatch(un("drawer")),void Jb()}const e=document.querySelector("user-login");if(!e)return;const n=e.hasAttribute("subscribe");Boolean(Cn.getState().session?.registerTwo)!==n&&Cn.dispatch(un("page")),e.scrollIntoView({block:"nearest"})}}static{this.styles=[VE,jE,UE,$E,i`
2092
2118
  :host {
2093
2119
  display: block;
2094
2120
  background-color: var(--pwa_background, #fff);
@@ -2131,7 +2157,7 @@ const t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow
2131
2157
  button.new {
2132
2158
  display: block;
2133
2159
  }
2134
- `]}connectedCallback(){var t;this.hasAttribute("role")||this.setAttribute("role","region"),this.hasAttribute("aria-label")||this.setAttribute("aria-label","Reset password"),super.connectedCallback(),this.stopDraft=(t=()=>{this.prefill()},XE.add(t),()=>{XE.delete(t)}),this.prefill()}disconnectedCallback(){window.clearInterval(this.timer),this.timer=0,this.stopDraft?.(),this.stopDraft=null,super.disconnectedCallback()}updated(){this.paintEmail()}prefill(){if(this.touched)return;const t=tD();t&&t!==this.userEmail&&(this.userEmail=t,this.paintEmail())}paintEmail(){if(this.touched)return;const t=this.renderRoot.querySelector(".email");t&&!t.value&&this.userEmail&&(t.value=this.userEmail)}handleEmail(t){const e=t.target;this.touched=!0,this.userEmail=e.value,this.invalid&&(this.invalid=!1)}buttonLabel(){return this.busy?"Sending…":this.cooldown>0?`Send again in ${this.cooldown}s`:"Send reset email"}render(){const t="pwa-reset-status";return U`
2160
+ `]}connectedCallback(){var t;this.hasAttribute("role")||this.setAttribute("role","region"),this.hasAttribute("aria-label")||this.setAttribute("aria-label","Reset password"),super.connectedCallback(),this.stopDraft=(t=()=>{this.prefill()},XE.add(t),()=>{XE.delete(t)}),this.prefill()}disconnectedCallback(){window.clearInterval(this.timer),this.timer=0,this.stopDraft?.(),this.stopDraft=null,super.disconnectedCallback()}updated(){this.paintEmail()}prefill(){if(this.touched)return;const t=t_();t&&t!==this.userEmail&&(this.userEmail=t,this.paintEmail())}paintEmail(){if(this.touched)return;const t=this.renderRoot.querySelector(".email");t&&!t.value&&this.userEmail&&(t.value=this.userEmail)}handleEmail(t){const e=t.target;this.touched=!0,this.userEmail=e.value,this.invalid&&(this.invalid=!1)}buttonLabel(){return this.busy?"Sending…":this.cooldown>0?`Send again in ${this.cooldown}s`:"Send reset email"}render(){const t="pwa-reset-status";return U`
2135
2161
 
2136
2162
  <form
2137
2163
  class="resetPass"
@@ -2181,4 +2207,4 @@ const t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow
2181
2207
 
2182
2208
  </form>
2183
2209
 
2184
- `}showSent(){this.tone="",this.status="If an account uses that email, a reset link is on its way.",this.invalid=!1,this.cooldown=45,this.armCooldown(),cE(IE,{email:this.userEmail}),this.updateComplete.then(()=>{this.focusStatus()})}showError(t,e){this.tone="error",this.status=HE(t),this.invalid="email"===e,cE(AE,t),this.updateComplete.then(()=>{this.focusAfter(e)})}showFirebase(t){const e=lE(t);this.tone="error",this.status=HE(t),this.invalid="auth/invalid-email"===e.code,cE(AE,e),this.updateComplete.then(()=>{this.focusAfter(this.invalid?"email":"status")})}focusAfter(t){"email"===t?this.focusEmail():this.focusStatus()}focusEmail(){const t=this.renderRoot.querySelector(".email");t?.focus()}focusStatus(){const t=this.renderRoot.querySelector("#pwa-reset-status");t?.focus()}armCooldown(){window.clearInterval(this.timer),this.timer=window.setInterval(()=>{if(this.cooldown<=1)return this.cooldown=0,window.clearInterval(this.timer),void(this.timer=0);this.cooldown-=1},1e3)}};function Yb(){return nE()?BE(Qy.currentUser):null}function Xb(t){let e,n=!1;return sE(()=>{n||(e=Lo(Qy,e=>{t(BE(e))}))}),()=>{n=!0,e&&e()}}Kb([ut(),Qb("design:type",String)],Wb.prototype,"userEmail",void 0),Kb([ut(),Qb("design:type",String)],Wb.prototype,"status",void 0),Kb([ut(),Qb("design:type",String)],Wb.prototype,"tone",void 0),Kb([ut(),Qb("design:type",Boolean)],Wb.prototype,"invalid",void 0),Kb([ut(),Qb("design:type",Boolean)],Wb.prototype,"busy",void 0),Kb([ut(),Qb("design:type",Number)],Wb.prototype,"cooldown",void 0),Wb=Kb([at("email-reset"),Qb("design:paramtypes",[])],Wb);export{Wb as EmailReset,fb as UserDrawer,Ub as UserIcon,Z_ as UserLogin,Pb as UserSettings,qy as application,Qy as auth,qb as closeDrawer,zy as db,O_ as deleteDocument,NE as eventName,Wy as firebaseConfig,Yb as getCurrentUser,iE as initialize,G_ as isEmailVerified,I_ as logAccount,T_ as logAccountDelete,v_ as logOut,Xb as onUserChanged,Jb as openDrawer,DE as pwaAccountDeleted,mE as pwaAuthChanged,AE as pwaAuthError,__ as pwaDrawerToggle,TE as pwaDrawerToggleName,bE as pwaEmailChanged,RE as pwaEmailVerified,wE as pwaLogin,yE as pwaLogout,vE as pwaPasswordChanged,_E as pwaProfileUpdated,IE as pwaResetSent,OE as pwaSettings,EE as pwaSignup,SE as pwaVerificationSent,b_ as reauthenticate,M_ as sendVerification,Ky as storage,zb as toggleDrawer,Yy as user,vb as userEmailChanged};
2210
+ `}showSent(){this.tone="",this.status="If an account uses that email, a reset link is on its way.",this.invalid=!1,this.cooldown=45,this.armCooldown(),cE(IE,{email:this.userEmail}),this.updateComplete.then(()=>{this.focusStatus()})}showError(t,e){this.tone="error",this.status=HE(t),this.invalid="email"===e,cE(AE,t),this.updateComplete.then(()=>{this.focusAfter(e)})}showFirebase(t){const e=lE(t);this.tone="error",this.status=HE(t),this.invalid="auth/invalid-email"===e.code,cE(AE,e),this.updateComplete.then(()=>{this.focusAfter(this.invalid?"email":"status")})}focusAfter(t){"email"===t?this.focusEmail():this.focusStatus()}focusEmail(){const t=this.renderRoot.querySelector(".email");t?.focus()}focusStatus(){const t=this.renderRoot.querySelector("#pwa-reset-status");t?.focus()}armCooldown(){window.clearInterval(this.timer),this.timer=window.setInterval(()=>{if(this.cooldown<=1)return this.cooldown=0,window.clearInterval(this.timer),void(this.timer=0);this.cooldown-=1},1e3)}};function Yb(){return nE()?BE(Qy.currentUser):null}function Xb(t){let e,n=!1;return sE(()=>{n||(e=Lo(Qy,e=>{t(BE(e))}))}),()=>{n=!0,e&&e()}}Kb([ut(),Qb("design:type",String)],Wb.prototype,"userEmail",void 0),Kb([ut(),Qb("design:type",String)],Wb.prototype,"status",void 0),Kb([ut(),Qb("design:type",String)],Wb.prototype,"tone",void 0),Kb([ut(),Qb("design:type",Boolean)],Wb.prototype,"invalid",void 0),Kb([ut(),Qb("design:type",Boolean)],Wb.prototype,"busy",void 0),Kb([ut(),Qb("design:type",Number)],Wb.prototype,"cooldown",void 0),Wb=Kb([at("email-reset"),Qb("design:paramtypes",[])],Wb);export{Wb as EmailReset,fb as UserDrawer,Ub as UserIcon,ZD as UserLogin,Pb as UserSettings,qy as application,Qy as auth,qb as closeDrawer,zy as db,OD as deleteDocument,NE as eventName,Wy as firebaseConfig,Yb as getCurrentUser,iE as initialize,GD as isEmailVerified,ID as logAccount,TD as logAccountDelete,vD as logOut,Xb as onUserChanged,Jb as openDrawer,_E as pwaAccountDeleted,mE as pwaAuthChanged,AE as pwaAuthError,DD as pwaDrawerToggle,TE as pwaDrawerToggleName,bE as pwaEmailChanged,RE as pwaEmailVerified,wE as pwaLogin,yE as pwaLogout,vE as pwaPasswordChanged,DE as pwaProfileUpdated,IE as pwaResetSent,OE as pwaSettings,EE as pwaSignup,SE as pwaVerificationSent,bD as reauthenticate,MD as sendVerification,Ky as storage,zb as toggleDrawer,Yy as user,vb as userEmailChanged};