PageSourceSearch

https://www.justwatch.com/appassets/js/1790192282886_npm.firebase.05d26338.js

js justwatch.com collected 2026-09-24 07:58:52 UTC 267,025 bytes, 2,531 lines download raw bytes

1(window.webpackJsonp=window.webpackJsonp||[]).push([["npm.firebase"],{"1f5a":function(e,t,n){"use strict";n.d(t,"x",(function(){return g})),n.d(t,"F",(function(){return f}));var r=n("cb5f");n.d(t,"a",(function(){return r.b})),n.d(t,"b",(function(){return r.g})),n.d(t,"c",(function(){return r.l})),n.d(t,"d",(function(){return r.m})),n.d(t,"e",(function(){return r.o})),n.d(t,"f",(function(){return r.n})),n.d(t,"g",(function(){return r.h})),n.d(t,"h",(function(){return r.p})),n.d(t,"i",(function(){return r.i})),n.d(t,"j",(function(){return r.ub})),n.d(t,"k",(function(){return r.wb})),n.d(t,"l",(function(){return r.j})),n.d(t,"m",(function(){return r.N})),n.d(t,"n",(function(){return r.q})),n.d(t,"o",(function(){return r.a})),n.d(t,"p",(function(){return r.E})),n.d(t,"q",(function(){return r.L})),n.d(t,"r",(function(){return r.gb})),n.d(t,"s",(function(){return r.M})),n.d(t,"t",(function(){return r.G})),n.d(t,"u",(function(){return r.I})),n.d(t,"v",(function(){return r.J})),n.d(t,"w",(function(){return r.H})),n.d(t,"y",(function(){return r.z})),n.d(t,"z",(function(){return r.jb})),n.d(t,"A",(function(){return r.sb})),n.d(t,"B",(function(){return r.r})),n.d(t,"C",(function(){return r.A})),n.d(t,"D",(function(){return r.y})),n.d(t,"E",(function(){return r.f})),n.d(t,"G",(function(){return r.O})),n.d(t,"H",(function(){return r.e})),n.d(t,"I",(function(){return r.T})),n.d(t,"J",(function(){return r.ab})),n.d(t,"K",(function(){return r.bb})),n.d(t,"L",(function(){return r.rb})),n.d(t,"M",(function(){return r.k})),n.d(t,"N",(function(){return r.qb})),n.d(t,"O",(function(){return r.R})),n.d(t,"P",(function(){return r.u})),n.d(t,"Q",(function(){return r.tb})),n.d(t,"R",(function(){return r.lb})),n.d(t,"S",(function(){return r.ob})),n.d(t,"T",(function(){return r.cb})),n.d(t,"U",(function(){return r.v})),n.d(t,"V",(function(){return r.xb})),n.d(t,"W",(function(){return r.mb})),n.d(t,"X",(function(){return r.pb})),n.d(t,"Y",(function(){return r.U})),n.d(t,"Z",(function(){return r.x})),n.d(t,"ab",(function(){return r.Q})),n.d(t,"bb",(function(){return r.s})),n.d(t,"cb",(function(){return r.t})),n.d(t,"db",(function(){return r.w})),n.d(t,"eb",(function(){return r.P})),n.d(t,"fb",(function(){return r.S})),n.d(t,"gb",(function(){return r.yb})),n.d(t,"hb",(function(){return r.kb})),n.d(t,"ib",(function(){return r.nb})),n.d(t,"jb",(function(){return r.Z})),n.d(t,"kb",(function(){return r.X})),n.d(t,"lb",(function(){return r.Y})),n.d(t,"mb",(function(){return r.zb})),n.d(t,"nb",(function(){return r.W})),n.d(t,"ob",(function(){return r.V})),n.d(t,"pb",(function(){return r.B}));var i=n("1fd5");n("589b"),n("e691"),n("22e5");
2/**
3 * @license
4 * Copyright 2021 Google LLC
5 *
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
9 *
10 *   http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 */
18function s(){return window}
19/**
20 * @license
21 * Copyright 2020 Google LLC
22 *
23 * Licensed under the Apache License, Version 2.0 (the "License");
24 * you may not use this file except in compliance with the License.
25 * You may obtain a copy of the License at
26 *
27 *   http://www.apache.org/licenses/LICENSE-2.0
28 *
29 * Unless required by applicable law or agreed to in writing, software
30 * distributed under the License is distributed on an "AS IS" BASIS,
31 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
32 * See the License for the specific language governing permissions and
33 * limitations under the License.
34 */async function o(e,t,n){var i;const{BuildInfo:o}=s();Object(r.db)(t.sessionId,"AuthEvent did not contain a session ID");const a=await async function(e){const t=function(e){if(Object(r.db)(/[0-9a-zA-Z]+/.test(e),"Can only convert alpha-numeric strings"),"undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);const t=new ArrayBuffer(e.length),n=new Uint8Array(t);for(let t=0;t<e.length;t++)n[t]=e.charCodeAt(t);return n}
35/**
36 * @license
37 * Copyright 2020 Google LLC
38 *
39 * Licensed under the Apache License, Version 2.0 (the "License");
40 * you may not use this file except in compliance with the License.
41 * You may obtain a copy of the License at
42 *
43 *   http://www.apache.org/licenses/LICENSE-2.0
44 *
45 * Unless required by applicable law or agreed to in writing, software
46 * distributed under the License is distributed on an "AS IS" BASIS,
47 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
48 * See the License for the specific language governing permissions and
49 * limitations under the License.
50 */(e),n=await crypto.subtle.digest("SHA-256",t);return Array.from(new Uint8Array(n)).map(e=>e.toString(16).padStart(2,"0")).join("")}(t.sessionId),c={};return Object(r.eb)()?c.ibi=o.packageName:Object(r.fb)()?c.apn=o.packageName:Object(r.gb)(e,"operation-not-supported-in-this-environment"),o.displayName&&(c.appDisplayName=o.displayName),c.sessionId=a,Object(r.hb)(e,n,t.type,void 0,null!==(i=t.eventId)&&void 0!==i?i:void 0,c)}class a extends r.F{constructor(){super(...arguments),this.passiveListeners=new Set,this.initPromise=new Promise(e=>{this.resolveInitialized=e})}addPassiveListener(e){this.passiveListeners.add(e)}removePassiveListener(e){this.passiveListeners.delete(e)}resetRedirect(){this.queuedRedirectEvent=null,this.hasHandledPotentialRedirect=!1}onEvent(e){return this.resolveInitialized(),this.passiveListeners.forEach(t=>t(e)),super.onEvent(e)}async initialized(){await this.initPromise}}async function c(e){const t=await l()._get(h(e));return t&&await l()._remove(h(e)),t}function u(e,t){var n,i;const s=function(e){const t=p(e),n=t.link?decodeURIComponent(t.link):void 0,r=p(n).link,i=t.deep_link_id?decodeURIComponent(t.deep_link_id):void 0;return p(i).link||i||r||n||e}(t);if(s.includes("/__/auth/callback")){const t=p(s),o=t.firebaseError?function(e){try{return JSON.parse(e)}catch(e){return null}}(decodeURIComponent(t.firebaseError)):null,a=null===(i=null===(n=null==o?void 0:o.code)||void 0===n?void 0:n.split("auth/"))||void 0===i?void 0:i[1],c=a?Object(r.D)(a):null;return c?{type:e.type,eventId:e.eventId,tenantId:e.tenantId,error:c,urlResponse:null,sessionId:null,postBody:null}:{type:e.type,eventId:e.eventId,tenantId:e.tenantId,sessionId:e.sessionId,urlResponse:s,postBody:null}}return null}function d(){const e=[],t="1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";for(let n=0;n<20;n++){const n=Math.floor(Math.random()*t.length);e.push(t.charAt(n))}return e.join("")}function l(){return Object(r.G)(r.jb)}function h(e){return Object(r.H)("authEvent",e.config.apiKey,e.name)}function p(e){if(!(null==e?void 0:e.includes("?")))return{};const[t,...n]=e.split("?");return Object(i.B)(n.join("?"))}
51/**
52 * @license
53 * Copyright 2021 Google LLC
54 *
55 * Licensed under the Apache License, Version 2.0 (the "License");
56 * you may not use this file except in compliance with the License.
57 * You may obtain a copy of the License at
58 *
59 *   http://www.apache.org/licenses/LICENSE-2.0
60 *
61 * Unless required by applicable law or agreed to in writing, software
62 * distributed under the License is distributed on an "AS IS" BASIS,
63 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
64 * See the License for the specific language governing permissions and
65 * limitations under the License.
66 */const f=class{constructor(){this._redirectPersistence=r.r,this._shouldInitProactively=!0,this.eventManagers=new Map,this.originValidationPromises={},this._completeRedirectFn=r.I,this._overrideRedirectResult=r.J}async _initialize(e){const t=e._key();let n=this.eventManagers.get(t);return n||(n=new a(e),this.eventManagers.set(t,n),this.attachCallbackListeners(e,n)),n}_openPopup(e){Object(r.gb)(e,"operation-not-supported-in-this-environment")}async _openRedirect(e,t,n,i){!function(e){var t,n,i,o,a,c,u,d,l,h;const p=s();Object(r.E)("function"==typeof(null===(t=null==p?void 0:p.universalLinks)||void 0===t?void 0:t.subscribe),e,"invalid-cordova-configuration",{missingPlugin:"cordova-universal-links-plugin-fix"}),Object(r.E)(void 0!==(null===(n=null==p?void 0:p.BuildInfo)||void 0===n?void 0:n.packageName),e,"invalid-cordova-configuration",{missingPlugin:"cordova-plugin-buildInfo"}),Object(r.E)("function"==typeof(null===(a=null===(o=null===(i=null==p?void 0:p.cordova)||void 0===i?void 0:i.plugins)||void 0===o?void 0:o.browsertab)||void 0===a?void 0:a.openUrl),e,"invali
66d-cordova-configuration",{missingPlugin:"cordova-plugin-browsertab"}),Object(r.E)("function"==typeof(null===(d=null===(u=null===(c=null==p?void 0:p.cordova)||void 0===c?void 0:c.plugins)||void 0===u?void 0:u.browsertab)||void 0===d?void 0:d.isAvailable),e,"invalid-cordova-configuration",{missingPlugin:"cordova-plugin-browsertab"}),Object(r.E)("function"==typeof(null===(h=null===(l=null==p?void 0:p.cordova)||void 0===l?void 0:l.InAppBrowser)||void 0===h?void 0:h.open),e,"invalid-cordova-configuration",{missingPlugin:"cordova-plugin-inappbrowser"})}(e);const a=await this._initialize(e);await a.initialized(),a.resetRedirect(),Object(r.K)(),await this._originValidation(e);const c=function(e,t,n=null){return{type:t,eventId:n,urlResponse:null,sessionId:d(),postBody:null,tenantId:e.tenantId,error:Object(r.D)(e,"no-auth-event")}}(e,n,i);await function(e,t){return l()._set(h(e),t)}(e,c);const u=await o(e,c,t);return async function(e,t,n){const{cordova:i}=s();let o=()=>{};try{await new Promise((s,a)=>{let c=null;function u(){var e;s();const t=null===(e=i.plugins.browsertab)||void 0===e?void 0:e.close;"function"==typeof t&&t(),"function"==typeof(null==n?void 0:n.close)&&n.close()}function d(){c||(c=window.setTimeout(()=>{a(Object(r.D)(e,"redirect-cancelled-by-user"))},2e3))}function l(){"visible"===(null===document||void 0===document?void 0:document.visibilityState)&&d()}t.addPassiveListener(u),document.addEventListener("resume",d,!1),Object(r.fb)()&&document.addEventListener("visibilitychange",l,!1),o=()=>{t.removePassiveListener(u),document.removeEventListener("resume",d,!1),document.removeEventListener("visibilitychange",l,!1),c&&window.clearTimeout(c)}})}finally{o()}}(e,a,await function(e){const{cordova:t}=s();return new Promise(n=>{t.plugins.browsertab.isAvailable(i=>{let s=null;i?t.plugins.browsertab.openUrl(e):s=t.InAppBrowser.open(e,Object(r.C)()?"_blank":"_system","location=yes"),n(s)})})}(u))}_isIframeWebStorageSupported(e,t){throw new Error("Method not implemented.")}_originValidation(e){const t=e._key();return this.originValidationPromises[t]||(this.originValidationPromises[t]=async function(e){const{BuildInfo:t}=s(),n={};Object(r.eb)()?n.iosBundleId=t.packageName:Object(r.fb)()?n.androidPackageName=t.packageName:Object(r.gb)(e,"operation-not-supported-in-this-environment"),await Object(r.ib)(e,n)}(e)),this.originValidationPromises[t]}attachCallbackListeners(e,t){const{universalLinks:n,handleOpenURL:r,BuildInfo:i}=s(),o=setTimeout(async()=>{await c(e),t.onEvent(m())},500),a=async n=>{clearTimeout(o);const r=await c(e);let i=null;r&&(null==n?void 0:n.url)&&(i=u(r,n.url)),t.onEvent(i||m())};void 0!==n&&"function"==typeof n.subscribe&&n.subscribe(null,a);const d=r,l=i.packageName.toLowerCase()+"://";s().handleOpenURL=async e=>{if(e.toLowerCase().startsWith(l)&&a({url:e}),"function"==typeof d)try{d(e)}catch(e){console.error(e)}}}};function m(){return{type:"unknown",eventId:null,sessionId:null,urlResponse:null,postBody:null,tenantId:null,error:Object(r.D)("no-auth-event")}}
67/**
68 * @license
69 * Copyright 2017 Google LLC
70 *
71 * Licensed under the Apache License, Version 2.0 (the "License");
72 * you may not use this file except in compliance with the License.
73 * You may obtain a copy of the License at
74 *
75 *   http://www.apache.org/licenses/LICENSE-2.0
76 *
77 * Unless required by applicable law or agreed to in writing, software
78 * distributed under the License is distributed on an "AS IS" BASIS,
79 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
80 * See the License for the specific language governing permissions and
81 * limitations under the License.
82 */function g(e,t){Object(r.L)(e)._logFramework(t)}},"1fd5":function(e,t,n){"use strict";(function(e,r){n.d(t,"a",(function(){return m})),n.d(t,"b",(function(){return A})),n.d(t,"c",(function(){return S})),n.d(t,"d",(function(){return c})),n.d(t,"e",(function(){return a})),n.d(t,"f",(function(){return R})),n.d(t,"g",(function(){return M})),n.d(t,"h",(function(){return N})),n.d(t,"i",(function(){return u})),n.d(t,"j",(function(){return U})),n.d(t,"k",(function(){return p})),n.d(t,"l",(function(){return h})),n.d(t,"m",(function(){return f})),n.d(t,"n",(function(){return d})),n.d(t,"o",(function(){return V})),n.d(t,"p",(function(){return g})),n.d(t,"q",(function(){return _})),n.d(t,"r",(function(){return I})),n.d(t,"s",(function(){return w})),n.d(t,"t",(function(){return P})),n.d(t,"u",(function(){return E})),n.d(t,"v",(function(){return O})),n.d(t,"w",(function(){return v})),n.d(t,"x",(function(){return b})),n.d(t,"y",(function(){return T})),n.d(t,"z",(function(){return y}
vendor: 1,651 bytes, lines 82-99
82)),n.d(t,"A",(function(){return L})),n.d(t,"B",(function(){return j})),n.d(t,"C",(function(){return k}));
83/**
84 * @license
85 * Copyright 2017 Google LLC
86 *
87 * Licensed under the Apache License, Version 2.0 (the "License");
88 * you may not use this file except in compliance with the License.
89 * You may obtain a copy of the License at
90 *
91 *   http://www.apache.org/licenses/LICENSE-2.0
92 *
93 * Unless required by applicable law or agreed to in writing, software
94 * distributed under the License is distributed on an "AS IS" BASIS,
95 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
96 * See the License for the specific language governing permissions and
97 * limitations under the License.
98 */
99const i=function(e){const t=[];let n=0;for(let r=0;r<e.length;r++){let i=e.charCodeAt(r);i<128?t[n++]=i:i<2048?(t[n++]=i>>6|192,t[n++]=63&i|128):55296==(64512&i)&&r+1<e.length&&56320==(64512&e.charCodeAt(r+1))?(i=65536+((1023&i)<<10)+(1023&e.charCodeAt(++r)),t[n++]=i>>18|240,t[n++]=i>>12&63|128,t[n++]=i>>6&63|128,t[n++]=63&i|128):(t[n++]=i>>12|224,t[n++]=i>>6&63|128,t[n++]=63&i|128)}return t},s={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(e,t){if(!Array.isArray(e))throw Error("encodeByteArray takes an array as a parameter");this.init_();const n=t?this.byteToCharMapWebSafe_:this.byteToCharMap_,r=[];for(let t=0;t<e.length;
vendor: 4,159 bytes, lines 99-143
99t+=3){const i=e[t],s=t+1<e.length,o=s?e[t+1]:0,a=t+2<e.length,c=a?e[t+2]:0,u=i>>2,d=(3&i)<<4|o>>4;let l=(15&o)<<2|c>>6,h=63&c;a||(h=64,s||(l=64)),r.push(n[u],n[d],n[l],n[h])}return r.join("")},encodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?btoa(e):this.encodeByteArray(i(e),t)},decodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?atob(e):function(e){const t=[];let n=0,r=0;for(;n<e.length;){const i=e[n++];if(i<128)t[r++]=String.fromCharCode(i);else if(i>191&&i<224){const s=e[n++];t[r++]=String.fromCharCode((31&i)<<6|63&s)}else if(i>239&&i<365){const s=((7&i)<<18|(63&e[n++])<<12|(63&e[n++])<<6|63&e[n++])-65536;t[r++]=String.fromCharCode(55296+(s>>10)),t[r++]=String.fromCharCode(56320+(1023&s))}else{const s=e[n++],o=e[n++];t[r++]=String.fromCharCode((15&i)<<12|(63&s)<<6|63&o)}}return t.join("")}(this.decodeStringToByteArray(e,t))},decodeStringToByteArray(e,t){this.init_();const n=t?this.charToByteMapWebSafe_:this.charToByteMap_,r=[];for(let t=0;t<e.length;){const i=n[e.charAt(t++)],s=t<e.length?n[e.charAt(t)]:0;++t;const a=t<e.length?n[e.charAt(t)]:64;++t;const c=t<e.length?n[e.charAt(t)]:64;if(++t,null==i||null==s||null==a||null==c)throw new o;const u=i<<2|s>>4;if(r.push(u),64!==a){const e=s<<4&240|a>>2;if(r.push(e),64!==c){const e=a<<6&192|c;r.push(e)}}}return r},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let e=0;e<this.ENCODED_VALS.length;e++)this.byteToCharMap_[e]=this.ENCODED_VALS.charAt(e),this.charToByteMap_[this.byteToCharMap_[e]]=e,this.byteToCharMapWebSafe_[e]=this.ENCODED_VALS_WEBSAFE.charAt(e),this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[e]]=e,e>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(e)]=e,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(e)]=e)}}};
100/**
101 * @license
102 * Copyright 2017 Google LLC
103 *
104 * Licensed under the Apache License, Version 2.0 (the "License");
105 * you may not use this file except in compliance with the License.
106 * You may obtain a copy of the License at
107 *
108 *   http://www.apache.org/licenses/LICENSE-2.0
109 *
110 * Unless required by applicable law or agreed to in writing, software
111 * distributed under the License is distributed on an "AS IS" BASIS,
112 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
113 * See the License for the specific language governing permissions and
114 * limitations under the License.
115 */class o extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}}const a=function(e){return function(e){const t=i(e);return s.encodeByteArray(t,!0)}(e).replace(/\./g,"")},c=function(e){try{return s.decodeString(e,!0)}catch(e){console.error("base64Decode failed: ",e)}return null};function u(e,t){if(!(t instanceof Object))return t;switch(t.constructor){case Date:return new Date(t.getTime());case Object:void 0===e&&(e={});break;case Array:e=[];break;default:return t}for(const n in t)t.hasOwnProperty(n)&&"__proto__"!==n&&(e[n]=u(e[n],t[n]));return e}
116/**
117 * @license
118 * Copyright 2022 Google LLC
119 *
120 * Licensed under the Apache License, Version 2.0 (the "License");
121 * you may not use this file except in compliance with the License.
122 * You may obtain a copy of the License at
123 *
124 *   http://www.apache.org/licenses/LICENSE-2.0
125 *
126 * Unless required by applicable law or agreed to in writing, software
127 * distributed under the License is distributed on an "AS IS" BASIS,
128 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
129 * See the License for the specific language governing permissions and
130 * limitations under the License.
131 */
132function d(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==e)return e;throw new Error("Unable to locate global object.")}
133/**
134 * @license
135 * Copyright 2022 Google LLC
136 *
137 * Licensed under the Apache License, Version 2.0 (the "License");
138 * you may not use this file except in compliance with the License.
139 * You may obtain a copy of the License at
140 *
141 *   http://www.apache.org/licenses/LICENSE-2.0
142 *
143 * Unless required by applicable law or agreed to in writing, softw
143are
144 * distributed under the License is distributed on an "AS IS" BASIS,
145 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
146 * See the License for the specific language governing permissions and
147 * limitations under the License.
148 */const l=()=>{try{return d().__FIREBASE_DEFAULTS__||(()=>{if(void 0===r)return;const e=Object({NODE_ENV:"production",BASE_URL:"/"}).__FIREBASE_DEFAULTS__;return e?JSON.parse(e):void 0})()||(()=>{if("undefined"==typeof document)return;let e;try{e=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch(e){return}const t=e&&c(e[1]);return t&&JSON.parse(t)})()}catch(e){return void console.info("Unable to get __FIREBASE_DEFAULTS__ due to: "+e)}},h=e=>{var t,n;return null===(n=null===(t=l())||void 0===t?void 0:t.emulatorHosts)||void 0===n?void 0:n[e]},p=()=>{var e;return null===(e=l())||void 0===e?void 0:e.config},f=e=>{var t;return null===(t=l())||void 0===t?void 0:t["_"+e]};
149/**
150 * @license
151 * Copyright 2017 Google LLC
152 *
153 * Licensed under the Apache License, Version 2.0 (the "License");
154 * you may not use this file except in compliance with the License.
155 * You may obtain a copy of the License at
156 *
157 *   http://www.apache.org/licenses/LICENSE-2.0
158 *
159 * Unless required by applicable law or agreed to in writing, software
160 * distributed under the License is distributed on an "AS IS" BASIS,
161 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
162 * See the License for the specific language governing permissions and
163 * limitations under the License.
164 */
165class m{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}wrapCallback(e){return(t,n)=>{t?this.reject(t):this.resolve(n),"function"==typeof e&&(this.promise.catch(()=>{}),1===e.length?e(t):e(t,n))}}}
166/**
167 * @license
168 * Copyright 2021 Google LLC
169 *
170 * Licensed under the Apache License, Version 2.0 (the "License");
171 * you may not use this file except in compliance with the License.
172 * You may obtain a copy of the License at
173 *
174 *   http://www.apache.org/licenses/LICENSE-2.0
175 *
176 * Unless required by applicable law or agreed to in writing, software
177 * distributed under the License is distributed on an "AS IS" BASIS,
178 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
179 * See the License for the specific language governing permissions and
180 * limitations under the License.
181 */
182/**
183 * @license
184 * Copyright 2017 Google LLC
185 *
186 * Licensed under the Apache License, Version 2.0 (the "License");
187 * you may not use this file except in compliance with the License.
188 * You may obtain a copy of the License at
189 *
190 *   http://www.apache.org/licenses/LICENSE-2.0
191 *
192 * Unless required by applicable law or agreed to in writing, software
193 * distributed under the License is distributed on an "AS IS" BASIS,
194 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
195 * See the License for the specific language governing permissions and
196 * limitations under the License.
197 */
198function g(){return"undefined"!=typeof navigator&&"string"==typeof navigator.userAgent?navigator.userAgent:""}function v(){return"undefined"!=typeof window&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(g())}function b(){var t;const n=null===(t=l())||void 0===t?void 0:t.forceEnvironment;if("node"===n)return!0;if("browser"===n)return!1;try{return"[object process]"===Object.prototype.toString.call(e.process)}catch(e){return!1}}function _(){return"undefined"!=typeof window||y()}function y(){return"undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof self&&self instanceof WorkerGlobalScope}function w(){return"undefined"!=typeof navigator&&"Cloudflare-Workers"===navigator.userAgent}function I(){const e="object"==typeof chrome?chrome.runtime:"object"==typeof browser?browser.runtime:void 0;return"object"==typeof e&&void 0!==e.id}function T(){return"object"==typeof navigator&&"ReactNative"===navigator.product}function E(){const e=g();return e.indexOf("MSIE ")>=0||e.indexOf("Trident/")>=0}function O(){try{return"object"==typeof indexedDB}catch(e){return!1}}function k(){return new Promise((e,t)=>
198{try{let n=!0;const r="validate-browser-context-for-indexeddb-analytics-module",i=self.indexedDB.open(r);i.onsuccess=()=>{i.result.close(),n||self.indexedDB.deleteDatabase(r),e(!0)},i.onupgradeneeded=()=>{n=!1},i.onerror=()=>{var e;t((null===(e=i.error)||void 0===e?void 0:e.message)||"")}}catch(e){t(e)}})}class S extends Error{constructor(e,t,n){super(t),this.code=e,this.customData=n,this.name="FirebaseError",Object.setPrototypeOf(this,S.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,A.prototype.create)}}class A{constructor(e,t,n){this.service=e,this.serviceName=t,this.errors=n}create(e,...t){const n=t[0]||{},r=`${this.service}/${e}`,i=this.errors[e],s=i?function(e,t){return e.replace(C,(e,n)=>{const r=t[n];return null!=r?String(r):`<${n}?>`})}(i,n):"Error",o=`${this.serviceName}: ${s} (${r}).`;return new S(r,o,n)}}const C=/\{\$([^}]+)}/g;
199/**
200 * @license
201 * Copyright 2017 Google LLC
202 *
203 * Licensed under the Apache License, Version 2.0 (the "License");
204 * you may not use this file except in compliance with the License.
205 * You may obtain a copy of the License at
206 *
207 *   http://www.apache.org/licenses/LICENSE-2.0
208 *
209 * Unless required by applicable law or agreed to in writing, software
210 * distributed under the License is distributed on an "AS IS" BASIS,
211 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
212 * See the License for the specific language governing permissions and
213 * limitations under the License.
214 */
215/**
216 * @license
217 * Copyright 2017 Google LLC
218 *
219 * Licensed under the Apache License, Version 2.0 (the "License");
220 * you may not use this file except in compliance with the License.
221 * You may obtain a copy of the License at
222 *
223 *   http://www.apache.org/licenses/LICENSE-2.0
224 *
225 * Unless required by applicable law or agreed to in writing, software
226 * distributed under the License is distributed on an "AS IS" BASIS,
227 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
228 * See the License for the specific language governing permissions and
229 * limitations under the License.
230 */
231function R(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function P(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}function N(e,t){if(e===t)return!0;const n=Object.keys(e),r=Object.keys(t);for(const i of n){if(!r.includes(i))return!1;const n=e[i],s=t[i];if(D(n)&&D(s)){if(!N(n,s))return!1}else if(n!==s)return!1}for(const e of r)if(!n.includes(e))return!1;return!0}function D(e){return null!==e&&"object"==typeof e}
232/**
233 * @license
234 * Copyright 2022 Google LLC
235 *
236 * Licensed under the Apache License, Version 2.0 (the "License");
237 * you may not use this file except in compliance with the License.
238 * You may obtain a copy of the License at
239 *
240 *   http://www.apache.org/licenses/LICENSE-2.0
241 *
242 * Unless required by applicable law or agreed to in writing, software
243 * distributed under the License is distributed on an "AS IS" BASIS,
244 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
245 * See the License for the specific language governing permissions and
246 * limitations under the License.
247 */
248/**
249 * @license
250 * Copyright 2017 Google LLC
251 *
252 * Licensed under the Apache License, Version 2.0 (the "License");
253 * you may not use this file except in compliance with the License.
254 * You may obtain a copy of the License at
255 *
256 *   http://www.apache.org/licenses/LICENSE-2.0
257 *
258 * Unless required by applicable law or agreed to in writing, software
259 * distributed under the License is distributed on an "AS IS" BASIS,
260 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
261 * See the License for the specific language governing permissions and
262 * limitations under the License.
263 */
264function L(e){const t=[];for(const[n,r]of Object.entries(e))Array.isArray(r)?r.forEach(e=>{t.push(encodeURIComponent(n)+"="+encodeURIComponent(e))}):t.push(encodeURIComponent(n)+"="+encodeURIComponent(r));return t.length?"&"+t.join("&"):""}function j(e){const t={};return e.replace(/^\?/,"").split("&").forEach(e=>{if(e){const[n,r]=e.split("=");
264t[decodeURIComponent(n)]=decodeURIComponent(r)}}),t}function U(e){const t=e.indexOf("?");if(!t)return"";const n=e.indexOf("#",t);return e.substring(t,n>0?n:void 0)}
265/**
266 * @license
267 * Copyright 2017 Google LLC
268 *
269 * Licensed under the Apache License, Version 2.0 (the "License");
270 * you may not use this file except in compliance with the License.
271 * You may obtain a copy of the License at
272 *
273 *   http://www.apache.org/licenses/LICENSE-2.0
274 *
275 * Unless required by applicable law or agreed to in writing, software
276 * distributed under the License is distributed on an "AS IS" BASIS,
277 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
278 * See the License for the specific language governing permissions and
279 * limitations under the License.
280 */function M(e,t){const n=new F(e,t);return n.subscribe.bind(n)}class F{constructor(e,t){this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=t,this.task.then(()=>{e(this)}).catch(e=>{this.error(e)})}next(e){this.forEachObserver(t=>{t.next(e)})}error(e){this.forEachObserver(t=>{t.error(e)}),this.close(e)}complete(){this.forEachObserver(e=>{e.complete()}),this.close()}subscribe(e,t,n){let r;if(void 0===e&&void 0===t&&void 0===n)throw new Error("Missing Observer.");r=function(e,t){if("object"!=typeof e||null===e)return!1;for(const n of t)if(n in e&&"function"==typeof e[n])return!0;return!1}(e,["next","error","complete"])?e:{next:e,error:t,complete:n},void 0===r.next&&(r.next=x),void 0===r.error&&(r.error=x),void 0===r.complete&&(r.complete=x);const i=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then(()=>{try{this.finalError?r.error(this.finalError):r.complete()}catch(e){}}),this.observers.push(r),i}unsubscribeOne(e){void 0!==this.observers&&void 0!==this.observers[e]&&(delete this.observers[e],this.observerCount-=1,0===this.observerCount&&void 0!==this.onNoObservers&&this.onNoObservers(this))}forEachObserver(e){if(!this.finalized)for(let t=0;t<this.observers.length;t++)this.sendOne(t,e)}sendOne(e,t){this.task.then(()=>{if(void 0!==this.observers&&void 0!==this.observers[e])try{t(this.observers[e])}catch(e){"undefined"!=typeof console&&console.error&&console.error(e)}})}close(e){this.finalized||(this.finalized=!0,void 0!==e&&(this.finalError=e),this.task.then(()=>{this.observers=void 0,this.onNoObservers=void 0}))}}function x(){}
281/**
282 * @license
283 * Copyright 2017 Google LLC
284 *
285 * Licensed under the Apache License, Version 2.0 (the "License");
286 * you may not use this file except in compliance with the License.
287 * You may obtain a copy of the License at
288 *
289 *   http://www.apache.org/licenses/LICENSE-2.0
290 *
291 * Unless required by applicable law or agreed to in writing, software
292 * distributed under the License is distributed on an "AS IS" BASIS,
293 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
294 * See the License for the specific language governing permissions and
295 * limitations under the License.
296 */
297/**
298 * @license
299 * Copyright 2021 Google LLC
300 *
301 * Licensed under the Apache License, Version 2.0 (the "License");
302 * you may not use this file except in compliance with the License.
303 * You may obtain a copy of the License at
304 *
305 *   http://www.apache.org/licenses/LICENSE-2.0
306 *
307 * Unless required by applicable law or agreed to in writing, software
308 * distributed under the License is distributed on an "AS IS" BASIS,
309 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
310 * See the License for the specific language governing permissions and
311 * limitations under the License.
312 */
313function V(e){return e&&e._delegate?e._delegate:e}}).call(this,n("c8ba"),n("4362"))},"22e5":function(e,t,n){"use strict";n.d(t,"a",(function(){return i})),n.d(t,"b",(function(){return o}));var r=n("1fd5");class i{constructor(e,t,n){this.name=e,this.instanceFactory=t,this.type=n,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}setInstantiationMode(e){return this.instantiationMode=e,this}setMultipleInstances(e){return this.multipleInstances=e,this}setServiceProps(e){return this.serviceProps=e,this}setInstanceCreatedCallback(e){return this.onInstanceCreated=e,this}}
314/**
315 * @license
316 * Copyright 2019 Google LLC
317 *
318 * Licensed under the Apache License, Version 2.0 (the "License");
319 * you may not use this file except in compliance with the License.
320 * You may obtain a copy of the License at
321 *
322 *   http://www.apache.org/licenses/LICENSE-2.0
323 *
324 * Unless required by applicable law or agreed to in writing, software
325 * distributed under the License is distributed on an "AS IS" BASIS,
326 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
327 * See the License for the specific language governing permissions and
328 * limitations under the License.
329 */
330/**
331 * @license
332 * Copyright 2019 Google LLC
333 *
334 * Licensed under the Apache License, Version 2.0 (the "License");
335 * you may not use this file except in compliance with the License.
336 * You may obtain a copy of the License at
337 *
338 *   http://www.apache.org/licenses/LICENSE-2.0
339 *
340 * Unless required by applicable law or agreed to in writing, software
341 * distributed under the License is distributed on an "AS IS" BASIS,
342 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
343 * See the License for the specific language governing permissions and
344 * limitations under the License.
345 */
346class s{constructor(e,t){this.name=e,this.container=t,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}get(e){const t=this.normalizeInstanceIdentifier(e);if(!this.instancesDeferred.has(t)){const e=new r.a;if(this.instancesDeferred.set(t,e),this.isInitialized(t)||this.shouldAutoInitialize())try{const n=this.getOrInitializeService({instanceIdentifier:t});n&&e.resolve(n)}catch(e){}}return this.instancesDeferred.get(t).promise}getImmediate(e){var t;const n=this.normalizeInstanceIdentifier(null==e?void 0:e.identifier),r=null!==(t=null==e?void 0:e.optional)&&void 0!==t&&t;if(!this.isInitialized(n)&&!this.shouldAutoInitialize()){if(r)return null;throw Error(`Service ${this.name} is not available`)}try{return this.getOrInitializeService({instanceIdentifier:n})}catch(e){if(r)return null;throw e}}getComponent(){return this.component}setComponent(e){if(e.name!==this.name)throw Error(`Mismatching Component ${e.name} for Provider ${this.name}.`);if(this.component)throw Error(`Component for ${this.name} has already been provided`);if(this.component=e,this.shouldAutoInitialize()){if(function(e){return"EAGER"===e.instantiationMode}
347/**
348 * @license
349 * Copyright 2019 Google LLC
350 *
351 * Licensed under the Apache License, Version 2.0 (the "License");
352 * you may not use this file except in compliance with the License.
353 * You may obtain a copy of the License at
354 *
355 *   http://www.apache.org/licenses/LICENSE-2.0
356 *
357 * Unless required by applicable law or agreed to in writing, software
358 * distributed under the License is distributed on an "AS IS" BASIS,
359 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
360 * See the License for the specific language governing permissions and
361 * limitations under the License.
362 */(e))try{this.getOrInitializeService({instanceIdentifier:"[DEFAULT]"})}catch(e){}for(const[e,t]of this.instancesDeferred.entries()){const n=this.normalizeInstanceIdentifier(e);try{const e=this.getOrInitializeService({instanceIdentifier:n});t.resolve(e)}catch(e){}}}}clearInstance(e="[DEFAULT]"){this.instancesDeferred.delete(e),this.instancesOptions.delete(e),this.instances.delete(e)}async delete(){const e=Array.from(this.instances.values());await Promise.all([...e.filter(e=>"INTERNAL"in e).map(e=>e.INTERNAL.delete()),...e.filter(e=>"_delete"in e).map(e=>e._delete())])}isComponentSet(){return null!=this.component}isInitialized(e="[DEFAULT]"){return this.instances.has(e)}getOptions(e="[DEFAULT]"){return this.instancesOptions.get(e)||{}}initialize(e={}){const{options:t={}}=e,n=this.normalizeInstanceIdentifier(e.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 r=this.getOrInitializeService({instanceIdentifier:n,options:t});for(const[e,t]of this.instancesDeferred.entries()){n===this.normalizeInstanceIdentifier(e)&&t.resolve(r)}return r}onInit(e,t){var n;const r=this.normalizeInstanceIdentifier(t),i=null!==(n=this.onInitCallbacks.get(r))&&void 0!==n?n:new Set;i.add(e),this.onInitCallbacks.set(r,i);const s=this.instances.get(r);return s&&e(s,r),()=>{i.delete(e)}}invokeOnInitCallbacks(e,t){const n=this.onInitCallbacks.get(t);if(n)for(const r of n)try{r(e,t)}catch(e){}}getOrInitializeService({instanceIdentifier:e,options:t={}}){let n=this.instances.get(e);if(!n&&this.component&&(n=this.component.instanceFactory(this.container,{instanceIdentifier:(r=e,"[DEFAULT]"===r?void 0:r),options:t}),this.instances.set(e,n),this.instancesOptions.set(e,t),this.invokeOnInitCallbacks(n,e),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,e,n)}catch(e){}var r;return n||null}normalizeInstanceIdentifier(e="[DEFAULT]"){return this.component?this.component.multipleInstances?e:"[DEFAULT]":e}shouldAutoInitialize(){return!!this.component&&"EXPLICIT"!==this.component.instantiationMode}}class o{constructor(e){this.name=e,this.providers=new Map}addComponent(e){const t=this.getProvider(e.name);if(t.isComponentSet())throw new Error(`Component ${e.name} has already been registered with ${this.name}`);t.setComponent(e)}addOrOverwriteComponent(e){this.getProvider(e.name).isComponentSet()&&this.providers.delete(e.name),this.addComponent(e)}getProvider(e){if(this.providers.has(e))return this.providers.get(e);const t=new s(e,this);return this.providers.set(e,t),t}getProviders(){return Array.from(this.providers.values())}}},"589b":function(e,t,n){"use strict";n.r(t),n.d(t,"SDK_VERSION",(function(){return S})),n.d(t,"_DEFAULT_ENTRY_NAME",(function(){return d})),n.d(t,"_addComponent",(function(){return m})),n.d(t,"_addOrOverwriteComponent",(function(){return g})),n.d(t,"_apps",(function(){return h})),n.d(t,"_clearComponents",(function(){return I})),n.d(t,"_components",(function(){return f})),n.d(t,"_getProvider",(function(){return b})),n.d(t,"_isFirebaseApp",(function(){return y}
362)),n.d(t,"_isFirebaseServerApp",(function(){return w})),n.d(t,"_registerComponent",(function(){return v})),n.d(t,"_removeServiceInstance",(function(){return _})),n.d(t,"_serverApps",(function(){return p})),n.d(t,"deleteApp",(function(){return N})),n.d(t,"getApp",(function(){return R})),n.d(t,"getApps",(function(){return P})),n.d(t,"initializeApp",(function(){return A})),n.d(t,"initializeServerApp",(function(){return C})),n.d(t,"onLog",(function(){return L})),n.d(t,"registerVersion",(function(){return D})),n.d(t,"setLogLevel",(function(){return j}));var r=n("22e5"),i=n("e691"),s=n("1fd5");n.d(t,"FirebaseError",(function(){return s.c}));var o=n("1d252");
363/**
364 * @license
365 * Copyright 2019 Google LLC
366 *
367 * Licensed under the Apache License, Version 2.0 (the "License");
368 * you may not use this file except in compliance with the License.
369 * You may obtain a copy of the License at
370 *
371 *   http://www.apache.org/licenses/LICENSE-2.0
372 *
373 * Unless required by applicable law or agreed to in writing, software
374 * distributed under the License is distributed on an "AS IS" BASIS,
375 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
376 * See the License for the specific language governing permissions and
377 * limitations under the License.
378 */class a{constructor(e){this.container=e}getPlatformInfoString(){return this.container.getProviders().map(e=>{if(function(e){const t=e.getComponent();return"VERSION"===(null==t?void 0:t.type)}(e)){const t=e.getImmediate();return`${t.library}/${t.version}`}return null}).filter(e=>e).join(" ")}}const c="@firebase/app",u=new i.b("@firebase/app"),d="[DEFAULT]",l={[c]:"fire-core","@firebase/app-compat":"fire-core-compat","@firebase/analytics":"fire-analytics","@firebase/analytics-compat":"fire-analytics-compat","@firebase/app-check":"fire-app-check","@firebase/app-check-compat":"fire-app-check-compat","@firebase/auth":"fire-auth","@firebase/auth-compat":"fire-auth-compat","@firebase/database":"fire-rtdb","@firebase/data-connect":"fire-data-connect","@firebase/database-compat":"fire-rtdb-compat","@firebase/functions":"fire-fn","@firebase/functions-compat":"fire-fn-compat","@firebase/installations":"fire-iid","@firebase/installations-compat":"fire-iid-compat","@firebase/messaging":"fire-fcm","@firebase/messaging-compat":"fire-fcm-compat","@firebase/performance":"fire-perf","@firebase/performance-compat":"fire-perf-compat","@firebase/remote-config":"fire-rc","@firebase/remote-config-compat":"fire-rc-compat","@firebase/storage":"fire-gcs","@firebase/storage-compat":"fire-gcs-compat","@firebase/firestore":"fire-fst","@firebase/firestore-compat":"fire-fst-compat","@firebase/vertexai-preview":"fire-vertex","fire-js":"fire-js",firebase:"fire-js-all"},h=new Map,p=new Map,f=new Map;function m(e,t){try{e.container.addComponent(t)}catch(n){u.debug(`Component ${t.name} failed to register with FirebaseApp ${e.name}`,n)}}function g(e,t){e.container.addOrOverwriteComponent(t)}function v(e){const t=e.name;if(f.has(t))return u.debug(`There were multiple attempts to register component ${t}.`),!1;f.set(t,e);for(const t of h.values())m(t,e);for(const t of p.values())m(t,e);return!0}function b(e,t){const n=e.container.getProvider("heartbeat").getImmediate({optional:!0});return n&&n.triggerHeartbeat(),e.container.getProvider(t)}function _(e,t,n=d){b(e,t).clearInstance(n)}function y(e){return void 0!==e.options}function w(e){return void 0!==e.settings}function I(){f.clear()}
379/**
380 * @license
381 * Copyright 2019 Google LLC
382 *
383 * Licensed under the Apache License, Version 2.0 (the "License");
384 * you may not use this file except in compliance with the License.
385 * You may obtain a copy of the License at
386 *
387 *   http://www.apache.org/licenses/LICENSE-2.0
388 *
389 * Unless required by applicable law or agreed to in writing, software
390 * distributed under the License is distributed on an "AS IS" BASIS,
391 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
392 * See the License for the specific language governing permissions and
393 * limitations under the License.
394 */const T={"no-app":"No Firebase App '{$appName}' has been created - call initializeApp() first","bad-app-name":"Illegal App name: '{$appName}'","duplicate-app":"Firebase App named '{$appName}' already exists with different options or config","app-deleted":"Firebase App named '{$appName}' already deleted","server-app-deleted":"Firebase Server App has been deleted","no-options":"Need to provide options, when not being deployed to hosting via source.","invali
394d-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."},E=new s.b("app","Firebase",T);
395/**
396 * @license
397 * Copyright 2019 Google LLC
398 *
399 * Licensed under the Apache License, Version 2.0 (the "License");
400 * you may not use this file except in compliance with the License.
401 * You may obtain a copy of the License at
402 *
403 *   http://www.apache.org/licenses/LICENSE-2.0
404 *
405 * Unless required by applicable law or agreed to in writing, software
406 * distributed under the License is distributed on an "AS IS" BASIS,
407 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
408 * See the License for the specific language governing permissions and
409 * limitations under the License.
410 */
411class O{constructor(e,t,n){this._isDeleted=!1,this._options=Object.assign({},e),this._config=Object.assign({},t),this._name=t.name,this._automaticDataCollectionEnabled=t.automaticDataCollectionEnabled,this._container=n,this.container.addComponent(new r.a("app",()=>this,"PUBLIC"))}get automaticDataCollectionEnabled(){return this.checkDestroyed(),this._automaticDataCollectionEnabled}set automaticDataCollectionEnabled(e){this.checkDestroyed(),this._automaticDataCollectionEnabled=e}get name(){return this.checkDestroyed(),this._name}get options(){return this.checkDestroyed(),this._options}get config(){return this.checkDestroyed(),this._config}get container(){return this._container}get isDeleted(){return this._isDeleted}set isDeleted(e){this._isDeleted=e}checkDestroyed(){if(this.isDeleted)throw E.create("app-deleted",{appName:this._name})}}
412/**
413 * @license
414 * Copyright 2023 Google LLC
415 *
416 * Licensed under the Apache License, Version 2.0 (the "License");
417 * you may not use this file except in compliance with the License.
418 * You may obtain a copy of the License at
419 *
420 *   http://www.apache.org/licenses/LICENSE-2.0
421 *
422 * Unless required by applicable law or agreed to in writing, software
423 * distributed under the License is distributed on an "AS IS" BASIS,
424 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
425 * See the License for the specific language governing permissions and
426 * limitations under the License.
427 */class k extends O{constructor(e,t,n,r){const i=void 0!==t.automaticDataCollectionEnabled&&t.automaticDataCollectionEnabled,s={name:n,automaticDataCollectionEnabled:i};if(void 0!==e.apiKey)super(e,s,r);else{super(e.options,s,r)}this._serverConfig=Object.assign({automaticDataCollectionEnabled:i},t),this._finalizationRegistry=null,"undefined"!=typeof FinalizationRegistry&&(this._finalizationRegistry=new FinalizationRegistry(()=>{this.automaticCleanup()})),this._refCount=0,this.incRefCount(this._serverConfig.releaseOnDeref),this._serverConfig.releaseOnDeref=void 0,t.releaseOnDeref=void 0,D(c,"0.10.13","serverapp")}toJSON(){}get refCount(){return this._refCount}incRefCount(e){this.isDeleted||(this._refCount++,void 0!==e&&null!==this._finalizationRegistry&&this._finalizationRegistry.register(e,this))}decRefCount(){return this.isDeleted?0:--this._refCount}automaticCleanup(){N(this)}get settings(){return this.checkDestroyed(),this._serverConfig}checkDestroyed(){if(this.isDeleted)throw E.create("server-app-deleted")}}
428/**
429 * @license
430 * Copyright 2019 Google LLC
431 *
432 * Licensed under the Apache License, Version 2.0 (the "License");
433 * you may not use this file except in compliance with the License.
434 * You may obtain a copy of the License at
435 *
436 *   http://www.apache.org/licenses/LICENSE-2.0
437 *
438 * Unless required by applicable law or agreed to in writing, softw
438are
439 * distributed under the License is distributed on an "AS IS" BASIS,
440 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
441 * See the License for the specific language governing permissions and
442 * limitations under the License.
443 */const S="10.14.1";function A(e,t={}){let n=e;if("object"!=typeof t){t={name:t}}const i=Object.assign({name:d,automaticDataCollectionEnabled:!1},t),o=i.name;if("string"!=typeof o||!o)throw E.create("bad-app-name",{appName:String(o)});if(n||(n=Object(s.k)()),!n)throw E.create("no-options");const a=h.get(o);if(a){if(Object(s.h)(n,a.options)&&Object(s.h)(i,a.config))return a;throw E.create("duplicate-app",{appName:o})}const c=new r.b(o);for(const e of f.values())c.addComponent(e);const u=new O(n,i,c);return h.set(o,u),u}function C(e,t){if(Object(s.q)()&&!Object(s.z)())throw E.create("invalid-server-app-environment");let n;void 0===t.automaticDataCollectionEnabled&&(t.automaticDataCollectionEnabled=!1),n=y(e)?e.options:e;const i=Object.assign(Object.assign({},t),n);void 0!==i.releaseOnDeref&&delete i.releaseOnDeref;if(void 0!==t.releaseOnDeref&&"undefined"==typeof FinalizationRegistry)throw E.create("finalization-registry-not-supported",{});const o=""+(a=JSON.stringify(i),[...a].reduce((e,t)=>Math.imul(31,e)+t.charCodeAt(0)|0,0));var a;const c=p.get(o);if(c)return c.incRefCount(t.releaseOnDeref),c;const u=new r.b(o);for(const e of f.values())u.addComponent(e);const d=new k(n,t,o,u);return p.set(o,d),d}function R(e=d){const t=h.get(e);if(!t&&e===d&&Object(s.k)())return A();if(!t)throw E.create("no-app",{appName:e});return t}function P(){return Array.from(h.values())}async function N(e){let t=!1;const n=e.name;if(h.has(n))t=!0,h.delete(n);else if(p.has(n)){e.decRefCount()<=0&&(p.delete(n),t=!0)}t&&(await Promise.all(e.container.getProviders().map(e=>e.delete())),e.isDeleted=!0)}function D(e,t,n){var i;let s=null!==(i=l[e])&&void 0!==i?i:e;n&&(s+="-"+n);const o=s.match(/\s|\//),a=t.match(/\s|\//);if(o||a){const e=[`Unable to register library "${s}" with version "${t}":`];return o&&e.push(`library name "${s}" contains illegal characters (whitespace or "/")`),o&&a&&e.push("and"),a&&e.push(`version name "${t}" contains illegal characters (whitespace or "/")`),void u.warn(e.join(" "))}v(new r.a(s+"-version",()=>({library:s,version:t}),"VERSION"))}function L(e,t){if(null!==e&&"function"!=typeof e)throw E.create("invalid-log-argument");Object(i.d)(e,t)}function j(e){Object(i.c)(e)}
444/**
445 * @license
446 * Copyright 2021 Google LLC
447 *
448 * Licensed under the Apache License, Version 2.0 (the "License");
449 * you may not use this file except in compliance with the License.
450 * You may obtain a copy of the License at
451 *
452 *   http://www.apache.org/licenses/LICENSE-2.0
453 *
454 * Unless required by applicable law or agreed to in writing, software
455 * distributed under the License is distributed on an "AS IS" BASIS,
456 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
457 * See the License for the specific language governing permissions and
458 * limitations under the License.
459 */const U="firebase-heartbeat-store";let M=null;function F(){return M||(M=Object(o.a)("firebase-heartbeat-database",1,{upgrade:(e,t)=>{switch(t){case 0:try{e.createObjectStore(U)}catch(e){console.warn(e)}}}}).catch(e=>{throw E.create("idb-open",{originalErrorMessage:e.message})})),M}async function x(e,t){try{const n=(await F()).transaction(U,"readwrite"),r=n.objectStore(U);await r.put(t,V(e)),await n.done}catch(e){if(e instanceof s.c)u.warn(e.message);else{const t=E.create("idb-set",{originalErrorMessage:null==e?void 0:e.message});u.warn(t.message)}}}function V(e){return`${e.name}!${e.options.appId}`}
460/**
461 * @license
462 * Copyright 2021 Google LLC
463 *
464 * Licensed under the Apache License, Version 2.0 (the "License");
465 * you may not use this file except in compliance with the License.
466 * You may obtain a copy of the License at
467 *
468 *   http://www.apache.org/licenses/LICENSE-2.0
469 *
470 * Unless required by applicable law or agreed to in writing, software
471 * distributed under the License is distributed on an "AS IS" BASIS,
472 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
473 * See the License for the specific language governing permissions and
474 * limitations under the License.
475 */class z{constructor(e){this.container=e,this._heartbeatsCache=null;const t=this.container.getProvider("app").getImmediate();this._storage=new W(t),this._heartbeatsCachePromise=this._storage.read().then(e=>(this._heartbeatsCache=e,e))}async triggerHeartbeat(){var e,t;try{const n=this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(),r=H();if(null==(null===(e=this._heartbeatsCache)||void 0===e?void 0:e.heartbeats)&&(this._heartbeatsCache=await this._heartbeatsCachePromise,null==(null===(t=this._heartbeatsCache)||void 0===t?void 0:t.heartbeats)))return;if(this._heartbeatsCache.lastSentHeartbeatDate===r||this._heartbeatsCache.heartbeats.some(e=>e.date===r))return;return this._heartbeatsCache.heartbeats.push({date:r,agent:n}),this._heartbeatsCache.heartbeats=this._heartbeatsCache.heartbeats.filter(e=>{const t=new Date(e.date).valueOf();return Date.now()-t<=2592e6}),this._storage.overwrite(this._heartbeatsCache)}catch(e){u.warn(e)}}async getHeartbeatsHeader(){var e;try{if(null===this._heartbeatsCache&&await this._heartbeatsCachePromise,null==(null===(e=this._heartbeatsCache)||void 0===e?void 0:e.heartbeats)||0===this._heartbeatsCache.heartbeats.length)return"";const t=H(),{heartbeatsToSend:n,unsentEntries:r}=function(e,t=1024){const n=[];let r=e.slice();for(const i of e){const e=n.find(e=>e.agent===i.agent);if(e){if(e.dates.push(i.date),B(n)>t){e.dates.pop();break}}else if(n.push({agent:i.agent,dates:[i.date]}),B(n)>t){n.pop();break}r=r.slice(1)}return{heartbeatsToSend:n,unsentEntries:r}}(this._heartbeatsCache.heartbeats),i=Object(s.e)(JSON.stringify({version:2,heartbeats:n}));return this._heartbeatsCache.lastSentHeartbeatDate=t,r.length>0?(this._heartbeatsCache.heartbeats=r,await this._storage.overwrite(this._heartbeatsCache)):(this._heartbeatsCache.heartbeats=[],this._storage.overwrite(this._heartbeatsCache)),i}catch(e){return u.warn(e),""}}}function H(){return(new Date).toISOString().substring(0,10)}class W{constructor(e){this.app=e,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}async runIndexedDBEnvironmentCheck(){return!!Object(s.v)()&&Object(s.C)().then(()=>!0).catch(()=>!1)}async read(){if(await this._canUseIndexedDBPromise){const e=await async function(e){try{const t=(await F()).transaction(U),n=await t.objectStore(U).get(V(e));return await t.done,n}catch(e){if(e instanceof s.c)u.warn(e.message);else{const t=E.create("idb-get",{originalErrorMessage:null==e?void 0:e.message});u.warn(t.message)}}}(this.app);return(null==e?void 0:e.heartbeats)?e:{heartbeats:[]}}return{heartbeats:[]}}async overwrite(e){var t;if(await this._canUseIndexedDBPromise){const n=await this.read();return x(this.app,{lastSentHeartbeatDate:null!==(t=e.lastSentHeartbeatDate)&&void 0!==t?t:n.lastSentHeartbeatDate,heartbeats:e.heartbeats})}}async add(e){var t;if(await this._canUseIndexedDBPromise){const n=await this.read();return x(this.app,{lastSentHeartbeatDate:null!==(t=e.lastSentHeartbeatDate)&&void 0!==t?t:n.lastSentHeartbeatDate,heartbeats:[...n.heartbeats,...e.heartbeats]})}}}function B(e){return Object(s.e)(JSON.stringify({version:2,heartbeats:e})).length}
476/**
477 * @license
478 * Copyright 2019 Google LLC
479 *
480 * Licensed under the Apache License, Version 2.0 (the "License");
481 * you may not use this file except in compliance with the License.
482 * You may obtain a copy of the License at
483 *
484 *   http://www.apache.org/licenses/LICENSE-2.0
485 *
486 * Unless required by applicable law or agreed to in writing, software
487 * distributed under the License is distributed on an "AS IS" BASIS,
488 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
489 * See the License for the specific language governing permissions and
490 * limitations under the License.
491 */var q;q="",v(new r.a("platform-logger",e=>new a(e),"PRIVATE")),v(new r.a("heartbeat",e=>new z(e),"PRIVATE")),D(c,"0.10.13",q),D(c,"0.10.13","esm2017"),D("fire-js","")},5994:function(e,t,n){"use strict";(function(e){var t=n("7ded"),r=n("1f5a"),i=n("22e5"),s=n("1fd5");function o(){var e;return(null===(e=null===self||void 0===self?void 0:self.location)||void 0===e?void 0:e.protocol)||null}function a(e=Object(s.p)()){return!("file:"!==o()&&"ionic:"!==o()&&"capacitor:"!==o()||!e.toLowerCase().match(/iphone|ipad|ipod|android/))}function c(e=Object(s.p)()){return Object(s.u)()&&11===(null===document||void 0===document?void 0:document.documentMode)||function(e=Object(s.p)()){return/Edge\/\d+/.test(e)}(e)}function u(){try{const e=self.localStorage,t=r.s();if(e)return e.setItem(t,"1"),e.removeItem(t),!c()||Object(s.v)()}catch(e){return d()&&Object(s.v)()}return!1}function d(){return void 0!==e&&"WorkerGlobalScope"in e&&"importScripts"in e}function l(){return("http:"===o()||"https:"===o()||Object(s.r)()||a())&&!(Object(s.y)()||Object(s.x)())&&u()&&!d()}function h(){return a()&&"undefined"!=typeof document}
492/**
493 * @license
494 * Copyright 2020 Google LLC
495 *
496 * Licensed under the Apache License, Version 2.0 (the "License");
497 * you may not use this file except in compliance with the License.
498 * You may obtain a copy of the License at
499 *
500 *   http://www.apache.org/licenses/LICENSE-2.0
501 *
502 * Unless required by applicable law or agreed to in writing, software
503 * distributed under the License is distributed on an "AS IS" BASIS,
504 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
505 * See the License for the specific language governing permissions and
506 * limitations under the License.
507 */
508const p={LOCAL:"local",NONE:"none",SESSION:"session"},f=r.p;async function m(e){await e._initializationPromise;const t=g(),n=r.w("persistence",e.config.apiKey,e.name);t&&t.setItem(n,e._getPersistence())}function g(){var e;try{return(null===(e="undefined"!=typeof window?window:null)||void 0===e?void 0:e.sessionStorage)||null}catch(e){return null}}
509/**
510 * @license
511 * Copyright 2020 Google LLC
512 *
513 * Licensed under the Apache License, Version 2.0 (the "License");
514 * you may not use this file except in compliance with the License.
515 * You may obtain a copy of the License at
516 *
517 *   http://www.apache.org/licenses/LICENSE-2.0
518 *
519 * Unless required by applicable law or agreed to in writing, software
520 * distributed under the License is distributed on an "AS IS" BASIS,
521 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
522 * See the License for the specific language governing permissions and
523 * limitations under the License.
524 */const v=r.p;class b{constructor(){this.browserResolver=r.t(r.A),this.cordovaResolver=r.t(r.F),this.underlyingResolver=null,this._redirectPersistence=r.B,this._completeRedirectFn=r.u,this._overrideRedirectResult=r.v}async _initialize(e){return await this.selectUnderlyingResolver(),this.assertedUnderlyingResolver._initialize(e)}async _openPopup(e,t,n,r){return await this.selectUnderlyingResolver(),this.assertedUnderlyingResolver._openPopup(e,t,n,r)}async _openRedirect(e,t,n,r){return await this.selectUnderlyingResolver(),this.assertedUnderlyingResolver._openRedirect(e,t,n,r)}_isIframeWebStorageSupported(e,t){this.assertedUnderlyingResolver._isIframeWebStorageSupported(e,t)}_originValidation(e){return this.assertedUnderlyingResolver._originValidation(e)}get _shouldInitProactively(){return h()||this.browserResolver._shouldInitProactively}get assertedUnderlyingResolver(){return v(this.underlyingResolver,"internal-error"),this.underlyingResolver}async selectUnderlyingResolver(){if(this.underlyingResolver)return;const e=await async function(){return!!h()&&new Promise(e=>{const t=setTimeout(()=>{e(!1)},1e3);document.addEventListener("deviceready",()=>{clearTimeout(t),e(!0)})})}();this.underlyingResolver=e?this.cordovaResolver:this.browserResolver}}
525/**
526 * @license
527 * Copyright 2020 Google LLC
528 *
529 * Licensed under the Apache License, Version 2.0 (the "License");
530 * you may not use this file except in compliance with the License.
531 * You may obtain a copy of the License at
532 *
533 *   http://www.apache.org/licenses/LICENSE-2.0
534 *
535 * Unless required by applicable law or agreed to in writing, software
536 * distributed under the License is distributed on an "AS IS" BASIS,
537 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
538 * See the License for the specific language governing permissions and
539 * limitations under the License.
540 */function _(e){return e.unwrap()}function y(e){const{_tokenResponse:t}=e instanceof s.c?e.customData:e;if(!t)return null;if(!(e instanceof s.c)&&"temporaryProof"in t&&"phoneNumber"in t)return r.i.credentialFromResult(e);const n=t.providerId;if(!n||n===r.k.PASSWORD)return null;let i;switch(n){case r.k.GOOGLE:i=r.f;break;case r.k.FACEBOOK:i=r.d;break;case r.k.GITHUB:i=r.e;break;case r.k.TWITTER:i=r.o;break;default:const{oauthIdToken:e,oauthAccessToken:s,oauthTokenSecret:o,pendingToken:a,nonce:c}=t;return s||o||e||a?a?n.startsWith("saml.")?r.m._create(n,a):r.g._fromParams({providerId:n,signInMethod:n,pendingToken:a,idToken:e,accessToken:s}):new r.h(n).credential({idToken:e,accessToken:s,rawNonce:c}):null}return e instanceof s.c?i.credentialFromError(e):i.credentialFromResult(e)}function w(e,t){return t.catch(t=>{throw t instanceof s.c&&function(e,t){var n;const i=null===(n=t.customData)||void 0===n?void 0:n._tokenResponse;if("auth/multi-factor-auth-required"===(null==t?void 0:t.code)){t.resolver=new T(e,r.K(e,t))}else if(i){const e=y(t),n=t;e&&(n.credential=e,n.tenantId=i.tenantId||void 0,n.email=i.email||void 0,n.phoneNumber=i.phoneNumber||void 0)}}(e,t),t}).then(e=>{const t=e.operationType,n=e.user;return{operationType:t,credential:(i=e,y(i)),additionalUserInfo:r.J(e),user:E.getOrCreate(n)};
541/**
542 * @license
543 * Copyright 2020 Google LLC
544 *
545 * Licensed under the Apache License, Version 2.0 (the "License");
546 * you may not use this file except in compliance with the License.
547 * You may obtain a copy of the License at
548 *
549 *   http://www.apache.org/licenses/LICENSE-2.0
550 *
551 * Unless required by applicable law or agreed to in writing, software
552 * distributed under the License is distributed on an "AS IS" BASIS,
553 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
554 * See the License for the specific language governing permissions and
555 * limitations under the License.
556 */
557var i})}async function I(e,t){const n=await t;return{verificationId:n.verificationId,confirm:t=>w(e,n.confirm(t))}}class T{constructor(e,t){this.resolver=t,this.auth=e.wrapped()}get session(){return this.resolver.session}get hints(){return this.resolver.hints}resolveSignIn(e){return w(_(this.auth),this.resolver.resolveSignIn(e))}}
558/**
559 * @license
560 * Copyright 2020 Google LLC
561 *
562 * Licensed under the Apache License, Version 2.0 (the "License");
563 * you may not use this file except in compliance with the License.
564 * You may obtain a copy of the License at
565 *
566 *   http://www.apache.org/licenses/LICENSE-2.0
567 *
568 * Unless required by applicable law or agreed to in writing, software
569 * distributed under the License is distributed on an "AS IS" BASIS,
570 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
571 * See the License for the specific language governing permissions and
572 * limitations under the License.
573 */class E{constructor(e){this._delegate=e,this.multiFactor=r.T(e)}static getOrCreate(e){return E.USER_MAP.has(e)||E.USER_MAP.set(e,new E(e)),E.USER_MAP.get(e)}delete(){return this._delegate.delete()}reload(){return this._delegate.reload()}toJSON(){return this._delegate.toJSON()}getIdTokenResult(e){return this._delegate.getIdTokenResult(e)}getIdToken(e){return this._delegate.getIdToken(e)}linkAndRetrieveDataWithCredential(e){return this.linkWithCredential(e)}async linkWithCredential(e){return w(this.auth,r.P(this._delegate,e))}async linkWithPhoneNumber(e,t){return I(this.auth,r.Q(this._delegate,e,t))}async linkWithPopup(e){return w(this.auth,r.R(this._delegate,e,b))}async linkWithRedirect(e){return await m(r.q(this.auth)),r.S(this._delegate,e,b)}reauthenticateAndRetrieveDataWithCredential(e){return this.reauthenticateWithCredential(e)}async reauthenticateWithCredential(e){return w(this.auth,r.U(this._delegate,e))}reauthenticateWithPhoneNumber(e,t){return I(this.auth,r.V(this._delegate,e,t))}reauthenticateWithPopup(e){return w(this.auth,r.W(this._delegate,e,b))}async reauthenticateWithRedirect(e){return await m(r.q(this.auth)),r.X(this._delegate,e,b)}sendEmailVerification(e){return r.Y(this._delegate,e)}async unlink(e){return await r.jb(this._delegate,e),this}updateEmail(e){return r.kb(this._delegate,e)}updatePassword(e){return r.lb(this._delegate,e)}updatePhoneNumber(e){return r.mb(this._delegate,e)}updateProfile(e){return r.nb(this._delegate,e)}verifyBeforeUpdateEmail(e,t){return r.ob(this._delegate,e,t)}get emailVerified(){return this._delegate.emailVerified}get isAnonymous(){return this._delegate.isAnonymous}get metadata(){return this._delegate.metadata}get phoneNumber(){return this._delegate.phoneNumber}get providerData(){return this._delegate.providerData}get refreshToken(){return this._delegate.refreshToken}get tenantId(){return this._delegate.tenantId}get displayName(){return this._delegate.displayName}get email(){return this._delegate.email}get photoURL(){return this._delegate.photoURL}get providerId(){return this._delegate.providerId}get uid(){return this._delegate.uid}get auth(){return this._delegate.auth}}E.USER_MAP=new WeakMap;
574/**
575 * @license
576 * Copyright 2020 Google LLC
577 *
578 * Licensed under the Apache License, Version 2.0 (the "License");
579 * you may not use this file except in compliance with the License.
580 * You may obtain a copy of the License at
581 *
582 *   http://www.apache.org/licenses/LICENSE-2.0
583 *
584 * Unless required by applicable law or agreed to in writing, software
585 * distributed under the License is distributed on an "AS IS" BASIS,
586 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
587 * See the License for the specific language governing permissions and
588 * limitations under the License.
589 */
590const O=r.p;class k{constructor(e,t){if(this.app=e,t.isInitialized())return this._delegate=t.getImmediate(),void this.linkUnderlyingAuth();const{apiKey:n}=e.options;O(n,"invalid-api-key",{appName:e.name}),O(n,"invalid-api-key",{appName:e.name});const i="undefined"!=typeof window?b:void 0;this._delegate=t.initialize({options:{persistence:A(n,e.name),popupRedirectResolver:i}}),this._delegate._updateErrorMap(r.H),this.linkUnderlyingAuth()}get emulatorConfig(){return this._delegate.emulatorConfig}get currentUser(){return this._delegate.currentUser?E.getOrCreate(this._delegate.currentUser):null}get languageCode(){return this._delegate.languageCode}set languageCode(e){this._delegate.languageCode=e}get settings(){return this._delegate.settings}get tenantId(){return this._delegate.tenantId}set tenantId(e){this._delegate.tenantId=e}useDeviceLanguage(){this._delegate.useDeviceLanguage()}signOut(){return this._delegate.signOut()}useEmulator(e,t){r.E(this._delegate,e,t)}applyActionCode(e){return r.y(this._delegate,e)}checkActionCode(e){return r.C(this._delegate,e)}confirmPasswordReset(e,t){return r.D(this._delegate,e,t)}async createUserWithEmailAndPassword(e,t){return w(this._delegate,r.G(this._delegate,e,t))}fetchProvidersForEmail(e){return this.fetchSignInMethodsForEmail(e)}fetchSignInMethodsForEmail(e){return r.I(this._delegate,e)}isSignInWithEmailLink(e){return r.O(this._delegate,e)}async getRedirectResult(){O(l(),this._delegate,"operation-not-supported-in-this-environment");const e=await r.L(this._delegate,b);return e?w(this._delegate,Promise.resolve(e)):{credential:null,user:null}}addFrameworkForLogging(e){r.x(this._delegate,e)}onAuthStateChanged(e,t,n){const{next:r,error:i,complete:s}=S(e,t,n);return this._delegate.onAuthStateChanged(r,i,s)}onIdTokenChanged(e,t,n){const{next:r,error:i,complete:s}=S(e,t,n);return this._delegate.onIdTokenChanged(r,i,s)}sendSignInLinkToEmail(e,t){return r.ab(this._delegate,e,t)}sendPasswordResetEmail(e,t){return r.Z(this._delegate,e,t||void 0)}async setPersistence(e){let t;switch(function(e,t){f(Object.values(p).includes(t),e,"invalid-persistence-type"),Object(s.y)()?f(t!==p.SESSION,e,"unsupported-persistence-type"):Object(s.x)()?f(t===p.NONE,e,"unsupported-persistence-type"):d()?f(t===p.NONE||t===p.LOCAL&&Object(s.v)(),e,"unsupported-persistence-type"):f(t===p.NONE||u(),e,"unsupported-persistence-type")}(this._delegate,e),e){case p.SESSION:t=r.B;break;case p.LOCAL:t=await r.t(r.N)._isAvailable()?r.N:r.z;break;case p.NONE:t=r.M;break;default:return r.r("argument-error",{appName:this._delegate.name})}return this._delegate.setPersistence(t)}signInAndRetrieveDataWithCredential(e){return this.signInWithCredential(e)}signInAnonymously(){return w(this._delegate,r.bb(this._delegate))}signInWithCredential(e){return w(this._delegate,r.cb(this._delegate,e))}signInWithCustomToken(e){return w(this._delegate,r.db(this._delegate,e))}signInWithEmailAndPassword(e,t){return w(this._delegate,r.eb(this._delegate,e,t))}signInWithEmailLink(e,t){return w(this._delegate,r.fb(this._delegate,e,t))}signInWithPhoneNumber(e,t){return I(this._delegate,r.gb(this._delegate,e,t))}async signInWithPopup(e){return O(l(),this._delegate,"operation-not-supported-in-this-environment"),w(this._delegate,r.hb(this._delegate,e,b))}async signInWithRedirect(e){return O(l(),this._delegate,"operation-not-supported-in-this-environment"),await m(this._delegate),r.ib(this._delegate,e,b)}updateCurrentUser(e){return this._delegate.updateCurrentUser(e)}verifyPasswordResetCode(e){return r.pb(this._delegate,e)}unwrap(){return this._delegate}_delete(){return this._delegate._delete()}linkUnderlyingAuth(){this._delegate.wrapped=()=>this}}function S(e,t,n){let r=e;"function"!=typeof e&&({next:r,error:t,complete:n}=e);const i=r;return{next:e=>i(e&&E.getOrCreate(e)),error:t,complete:n}}
590function A(e,t){const n=function(e,t){const n=g();if(!n)return[];const i=r.w("persistence",e,t);switch(n.getItem(i)){case p.NONE:return[r.M];case p.LOCAL:return[r.N,r.B];case p.SESSION:return[r.B];default:return[]}}(e,t);if("undefined"==typeof self||n.includes(r.N)||n.push(r.N),"undefined"!=typeof window)for(const e of[r.z,r.B])n.includes(e)||n.push(e);return n.includes(r.M)||n.push(r.M),n}
591/**
592 * @license
593 * Copyright 2020 Google LLC
594 *
595 * Licensed under the Apache License, Version 2.0 (the "License");
596 * you may not use this file except in compliance with the License.
597 * You may obtain a copy of the License at
598 *
599 *   http://www.apache.org/licenses/LICENSE-2.0
600 *
601 * Unless required by applicable law or agreed to in writing, software
602 * distributed under the License is distributed on an "AS IS" BASIS,
603 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
604 * See the License for the specific language governing permissions and
605 * limitations under the License.
606 */k.Persistence=p;class C{constructor(){this.providerId="phone",this._delegate=new r.i(_(t.a.auth()))}static credential(e,t){return r.i.credential(e,t)}verifyPhoneNumber(e,t){return this._delegate.verifyPhoneNumber(e,t)}unwrap(){return this._delegate}}C.PHONE_SIGN_IN_METHOD=r.i.PHONE_SIGN_IN_METHOD,C.PROVIDER_ID=r.i.PROVIDER_ID;
607/**
608 * @license
609 * Copyright 2020 Google LLC
610 *
611 * Licensed under the Apache License, Version 2.0 (the "License");
612 * you may not use this file except in compliance with the License.
613 * You may obtain a copy of the License at
614 *
615 *   http://www.apache.org/licenses/LICENSE-2.0
616 *
617 * Unless required by applicable law or agreed to in writing, software
618 * distributed under the License is distributed on an "AS IS" BASIS,
619 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
620 * See the License for the specific language governing permissions and
621 * limitations under the License.
622 */
623const R=r.p;class P{constructor(e,n,i=t.a.app()){var s;R(null===(s=i.options)||void 0===s?void 0:s.apiKey,"invalid-api-key",{appName:i.name}),this._delegate=new r.l(i.auth(),e,n),this.type=this._delegate.type}clear(){this._delegate.clear()}render(){return this._delegate.render()}verify(){return this._delegate.verify()}}
624/**
625 * @license
626 * Copyright 2020 Google LLC
627 *
628 * Licensed under the Apache License, Version 2.0 (the "License");
629 * you may not use this file except in compliance with the License.
630 * You may obtain a copy of the License at
631 *
632 *   http://www.apache.org/licenses/LICENSE-2.0
633 *
634 * Unless required by applicable law or agreed to in writing, software
635 * distributed under the License is distributed on an "AS IS" BASIS,
636 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
637 * See the License for the specific language governing permissions and
638 * limitations under the License.
639 */var N;(N=t.a).INTERNAL.registerComponent(new i.a("auth-compat",e=>{const t=e.getProvider("app-compat").getImmediate(),n=e.getProvider("auth");return new k(t,n)},"PUBLIC").setServiceProps({ActionCodeInfo:{Operation:{EMAIL_SIGNIN:r.a.EMAIL_SIGNIN,PASSWORD_RESET:r.a.PASSWORD_RESET,RECOVER_EMAIL:r.a.RECOVER_EMAIL,REVERT_SECOND_FACTOR_ADDITION:r.a.REVERT_SECOND_FACTOR_ADDITION,VERIFY_AND_CHANGE_EMAIL:r.a.VERIFY_AND_CHANGE_EMAIL,VERIFY_EMAIL:r.a.VERIFY_EMAIL}},EmailAuthProvider:r.c,FacebookAuthProvider:r.d,GithubAuthProvider:r.e,GoogleAuthProvider:r.f,OAuthProvider:r.h,SAMLAuthProvider:r.n,PhoneAuthProvider:C,PhoneMultiFactorGenerator:r.j,RecaptchaVerifier:P,TwitterAuthProvider:r.o,Auth:k,AuthCredential:r.b,Error:s.c}).setInstantiationMode("LAZY").setMultipleInstances(!1)),N.registerVersion("@firebase/auth-compat","0.5.14")}).call(this,n("c8ba"))},"7ded":function(e,t,n){"use strict";n.d(t,"a",(function(){return h}));var r=n("1fd5"),i=n("22e5"),s=n("589b"),o=n("e691");
640/**
641 * @license
642 * Copyright 2020 Google LLC
643 *
644 * Licensed under the Apache License, Version 2.0 (the "License");
645 * you may not use this file except in compliance with the License.
646 * You may obtain a copy of the License at
647 *
648 *   http://www.apache.org/licenses/LICENSE-2.0
649 *
650 * Unless required by applicable law or agreed to in writing, softw
650are
651 * distributed under the License is distributed on an "AS IS" BASIS,
652 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
653 * See the License for the specific language governing permissions and
654 * limitations under the License.
655 */
656class a{constructor(e,t){this._delegate=e,this.firebase=t,Object(s._addComponent)(e,new i.a("app-compat",()=>this,"PUBLIC")),this.container=e.container}get automaticDataCollectionEnabled(){return this._delegate.automaticDataCollectionEnabled}set automaticDataCollectionEnabled(e){this._delegate.automaticDataCollectionEnabled=e}get name(){return this._delegate.name}get options(){return this._delegate.options}delete(){return new Promise(e=>{this._delegate.checkDestroyed(),e()}).then(()=>(this.firebase.INTERNAL.removeApp(this.name),Object(s.deleteApp)(this._delegate)))}_getService(e,t=s._DEFAULT_ENTRY_NAME){var n;this._delegate.checkDestroyed();const r=this._delegate.container.getProvider(e);return r.isInitialized()||"EXPLICIT"!==(null===(n=r.getComponent())||void 0===n?void 0:n.instantiationMode)||r.initialize(),r.getImmediate({identifier:t})}_removeServiceInstance(e,t=s._DEFAULT_ENTRY_NAME){this._delegate.container.getProvider(e).clearInstance(t)}_addComponent(e){Object(s._addComponent)(this._delegate,e)}_addOrOverwriteComponent(e){Object(s._addOrOverwriteComponent)(this._delegate,e)}toJSON(){return{name:this.name,automaticDataCollectionEnabled:this.automaticDataCollectionEnabled,options:this.options}}}
657/**
658 * @license
659 * Copyright 2019 Google LLC
660 *
661 * Licensed under the Apache License, Version 2.0 (the "License");
662 * you may not use this file except in compliance with the License.
663 * You may obtain a copy of the License at
664 *
665 *   http://www.apache.org/licenses/LICENSE-2.0
666 *
667 * Unless required by applicable law or agreed to in writing, software
668 * distributed under the License is distributed on an "AS IS" BASIS,
669 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
670 * See the License for the specific language governing permissions and
671 * limitations under the License.
672 */const c={"no-app":"No Firebase App '{$appName}' has been created - call Firebase App.initializeApp()","invalid-app-argument":"firebase.{$appName}() takes either no argument or a Firebase App instance."},u=new r.b("app-compat","Firebase",c);const d=
673/**
674 * @license
675 * Copyright 2019 Google LLC
676 *
677 * Licensed under the Apache License, Version 2.0 (the "License");
678 * you may not use this file except in compliance with the License.
679 * You may obtain a copy of the License at
680 *
681 *   http://www.apache.org/licenses/LICENSE-2.0
682 *
683 * Unless required by applicable law or agreed to in writing, software
684 * distributed under the License is distributed on an "AS IS" BASIS,
685 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
686 * See the License for the specific language governing permissions and
687 * limitations under the License.
688 */
689function e(){const t=
690/**
691 * @license
692 * Copyright 2019 Google LLC
693 *
694 * Licensed under the Apache License, Version 2.0 (the "License");
695 * you may not use this file except in compliance with the License.
696 * You may obtain a copy of the License at
697 *
698 *   http://www.apache.org/licenses/LICENSE-2.0
699 *
700 * Unless required by applicable law or agreed to in writing, software
701 * distributed under the License is distributed on an "AS IS" BASIS,
702 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
703 * See the License for the specific language governing permissions and
704 * limitations under the License.
705 */
706function(e){const t={},n={__esModule:!0,initializeApp:function(i,o={}){const a=s.initializeApp(i,o);if(Object(r.f)(t,a.name))return t[a.name];const c=new e(a,n);return t[a.name]=c,c},app:i,registerVersion:s.registerVersion,setLogLevel:s.setLogLevel,onLog:s.onLog,apps:null,SDK_VERSION:s.SDK_VERSION,INTERNAL:{registerComponent:function(t){const o=t.name,a=o.replace("-compat","");if(s._registerComponent(t)&&"PUBLIC"===t.type){const s=(e=i())=>{if("function"!=typeof e[a])throw u.create("invalid-app-argument",{appName:o});return e[a]()};void 0!==t.serviceProps&&Object(r.i)(s,t.serviceProps),n[a]=s,e.prototype[a]=function(...e){return this._getService.bind(this,o).apply(this,t.multipleInstances?e:[])}}return"PUBLIC"===t.type?n[a]:null},removeApp:function(e){delete t[e]},useAsService:function(e,t){if("serverAuth"===t)return null;return t},modularAPIs:s}};function i(e){if(e=e||s._DEFAULT_ENTRY_NAME,!Object(r.f)(t,e))throw u.create("no-app",{appName:e});return t[e]}return n.default=n,Object.defineProperty(n,"apps",{get:function(){return Object.keys(t).map(e=>t[e])}}),i.App=e,n}(a);return t.INTERNAL=Object.assign(Object.assign({},t.INTERNAL),{createFirebaseNamespace:e,extendNamespace:function(e){Object(r.i)(t,e)},createSubscribe:r.g,ErrorFactory:r.b,deepExtend:r.i}),t}(),l=new o.b("@firebase/app-compat");
707/**
708 * @license
709 * Copyright 2019 Google LLC
710 *
711 * Licensed under the Apache License, Version 2.0 (the "License");
712 * you may not use this file except in compliance with the License.
713 * You may obtain a copy of the License at
714 *
715 *   http://www.apache.org/licenses/LICENSE-2.0
716 *
717 * Unless required by applicable law or agreed to in writing, software
718 * distributed under the License is distributed on an "AS IS" BASIS,
719 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
720 * See the License for the specific language governing permissions and
721 * limitations under the License.
722 */
723/**
724 * @license
725 * Copyright 2020 Google LLC
726 *
727 * Licensed under the Apache License, Version 2.0 (the "License");
728 * you may not use this file except in compliance with the License.
729 * You may obtain a copy of the License at
730 *
731 *   http://www.apache.org/licenses/LICENSE-2.0
732 *
733 * Unless required by applicable law or agreed to in writing, software
734 * distributed under the License is distributed on an "AS IS" BASIS,
735 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
736 * See the License for the specific language governing permissions and
737 * limitations under the License.
738 */
739try{const e=Object(r.n)();if(void 0!==e.firebase){l.warn("\n      Warning: Firebase is already defined in the global scope. Please make sure\n      Firebase library is only loaded once.\n    ");const t=e.firebase.SDK_VERSION;t&&t.indexOf("LITE")>=0&&l.warn("\n        Warning: You are trying to load Firebase while using Firebase Performance standalone script.\n        You should load Firebase Performance with this instance of Firebase to avoid loading duplicate code.\n        ")}}catch(e){}const h=d;
740/**
741 * @license
742 * Copyright 2019 Google LLC
743 *
744 * Licensed under the Apache License, Version 2.0 (the "License");
745 * you may not use this file except in compliance with the License.
746 * You may obtain a copy of the License at
747 *
748 *   http://www.apache.org/licenses/LICENSE-2.0
749 *
750 * Unless required by applicable law or agreed to in writing, software
751 * distributed under the License is distributed on an "AS IS" BASIS,
752 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
753 * See the License for the specific language governing permissions and
754 * limitations under the License.
755 */
756var p;Object(s.registerVersion)("@firebase/app-compat","0.2.43",p)},aedf:function(e,t,n){"use strict";var r=n("7ded");n.d(t,"a",(function(){return r.a}));
757/**
758 * @license
759 * Copyright 2020 Google LLC
760 *
761 * Licensed under the Apache License, Version 2.0 (the "License");
762 * you may not use this file except in compliance with the License.
763 * You may obtain a copy of the License at
764 *
765 *   http://www.apache.org/licenses/LICENSE-2.0
766 *
767 * Unless required by applicable law or agreed to in writing, software
768 * distributed under the License is distributed on an "AS IS" BASIS,
769 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
770 * See the License for the specific language governing permissions and
771 * limitations under the License.
772 */
773r.a.registerVersion("firebase","10.14.1","app-compat")},bc7b:function(e,t,n){"use strict";var r=n("589b");n.d(t,"a",(function(){return r.initializeApp}));
774/**
775 * @license
776 * Copyright 2020 Google LLC
777 *
778 * Licensed under the Apache License, Version 2.0 (the "License");
779 * you may not use this file except in compliance with the License.
780 * You may obtain a copy of the License at
781 *
782 *   http://www.apache.org/licenses/LICENSE-2.0
783 *
784 * Unless required by applicable law or agreed to in writing, software
785 * distributed under the License is distributed on an "AS IS" BASIS,
786 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
787 * See the License for the specific language governing permissions and
788 * limitations under the License.
789 */
790Object(r.registerVersion)("firebase","10.14.1","app")},be8c:function(e,t,n){"use strict";n.d(t,"a",(function(){return r.l})),n.d(t,"b",(function(){return r.m})),n.d(t,"c",(function(){return r.n})),n.d(t,"d",(function(){return r.p})),n.d(t,"e",(function(){return r.d})),n.d(t,"f",(function(){return r.vb})),n.d(t,"g",(function(){return r.u})),n.d(t,"h",(function(){return r.lb})),n.d(t,"i",(function(){return r.v})),n.d(t,"j",(function(){return r.mb})),n.d(t,"k",(function(){return r.U})),n.d(t,"l",(function(){return r.x})),n.d(t,"m",(function(){return r.w})),n.d(t,"n",(function(){return r.c})),n.d(t,"o",(function(){return r.Z})),n.d(t,"p",(function(){return r.X})),n.d(t,"q",(function(){return r.Y}));var r=n("cb5f");n("589b"),n("1fd5"),n("e691"),n("22e5")},cb5f:function(e,t,n){"use strict";n.d(t,"a",(function(){return it})),n.d(t,"b",(function(){return u})),n.d(t,"c",(function(){return Yt})),n.d(t,"d",(function(){return Xt})),n.d(t,"e",(function(){return l})),n.d(t,"f",(function(){return De})),n.d(t,"g",(function(){return Ue})),n.d(t,"h",(function(){return qe})),n.d(t,"i",(function(){return Mn})),n.d(t,"j",(function(){return Rn})),n.d(t,"k",(function(){return ae})),n.d(t,"l",(function(){return Je})),n.d(t,"m",(function(){return Qe})),n.d(t,"n",(function(){return et})),n.d(t,"o",(function(){return tt})),n.d(t,"p",(function(){return Ze})),n.d(t,"q",(function(){return rt})),n.d(t,"r",(function(){return un})),n.d(t,"s",(function(){return ct})),n.d(t,"t",(function(){return vt})),n.d(t,"u",(function(){return bt})),n.d(t,"v",(function(){return _t})),n.d(t,"w",(function(){return yt})),n.d(t,"x",(function(){return kt})),n.d(t,"y",(function(){return St})),n.d(t,"z",(function(){return At})),n.d(t,"A",(function(){return Ct})),n.d(t,"B",(function(){return Rt})),n.d(t,"C",(function(){return _e})),n.d(t,"D",(function(){return v})),n.d(t,"E",(function(){return I})),n.d(t,"F",(function(){return cr})),n.d(t,"G",(function(){return se})),n.d(t,"H",(function(){return ce})),n.d(t,"I",(function(){return or})),n.d(t,"J",(function(){return Qn})),n.d(t,"K",(function(){return Zn})),n.d(t,"L",(function(){return Oe})),n.d(t,"M",(function(){return ln})),n.d(t,"N",(function(){return nt})),n.d(t,"O",(function(){return Pt})),n.d(t,"P",(function(){return Nt})),n.d(t,"Q",(function(){return Dt})),n.d(t,"R",(function(){return Lt})),n.d(t,"S",(function(){return jt})),n.d(t,"T",(function(){return Ut})),n.d(t,"U",(function(){return Mt})),n.d(t,"V",(function(){return Ft})),n.d(t,"W",(function(){return xt})),n.d(t,"X",(function(){return Vt})),n.d(t,"Y",(function(){return zt})),n.d(t,"Z",(function(){return ht})),n.d(t,"ab",(function(){return Jt})),n.d(t,"bb",(function(){return en})),n.d(t,"cb",(function(){return rn})),n.d(t,"db",(function(){return E})),n.d(t,"eb",(function(){return be})),n.d(t,"fb",(function(){return me})),n.d(t,"gb",(function(){return g})),n.d(t,"hb",(function(){return Ar})),n.d(t,"ib",(function(){return lr})),n.d(t,"jb",(function(){return an})),n.d(t,"kb",(function(){return qn})),n.d(t,"lb",(function(){return $n})),n.d(t,"mb",(function(){return Gn})),n.d(t,"nb",(function(){return nr})),n.d(t,"ob",(function(){return ir})),n.d(t,"pb",(function(){return rr})),n.d(t,"qb",(function(){return In})),n.d(t,"rb",(function(){return sr})),n.d(t,"sb",(function(){return Cr})),n.d(t,"tb",(function(){return Dn})),n.d(t,"ub",(function(){return Nr})),n.d(t,"vb",(function(){return Mr})),n.d(t,"wb",(function(){return c})),n.d(t,"xb",(function(){return Ln})),n.d(t,"yb",(function(){return Nn})),n.d(t,"zb",(function(){return Un}));var r=n("589b"),i=n("1fd5"),s=n("e691"),o=n("9ab4"),a=n("22e5");
791/**
792 * @license
793 * Copyright 2021 Google LLC
794 *
795 * Licensed under the Apache License, Version 2.0 (the "License");
796 * you may not use this file except in compliance with the License.
797 * You may obtain a copy of the License at
798 *
799 *   http://www.apache.org/licenses/LICENSE-2.0
800 *
801 * Unless required by applicable law or agreed to in writing, software
802 * distributed under the License is distributed on an "AS IS" BASIS,
803 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
804 * See the License for the specific language governing permissions and
805 * limitations under the License.
806 */
807const c={FACEBOOK:"facebook.com",GITHUB:"github.com",GOOGLE:"google.com",PASSWORD:"password",PHONE:"phone",TWITTER:"twitter.com"},u={EMAIL_SIGNIN:"EMAIL_SIGNIN",PASSWORD_RESET:"PASSWORD_RESET",RECOVER_EMAIL:"RECOVER_EMAIL",REVERT_SECOND_FACTOR_ADDITION:"REVERT_SECOND_FACTOR_ADDITION",VERIFY_AND_CHANGE_EMAIL:"VERIFY_AND_CHANGE_EMAIL",VERIFY_EMAIL:"VERIFY_EMAIL"};function d(){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."}}const l=
808/**
809 * @license
810 * Copyright 2020 Google LLC
811 *
812 * Licensed under the Apache License, Version 2.0 (the "License");
813 * you may not use this file except in compliance with the License.
814 * You may obtain a copy of the License at
815 *
816 *   http://www.apache.org/licenses/LICENSE-2.0
817 *
818 * Unless required by applicable law or agreed to in writing, software
819 * distributed under the License is distributed on an "AS IS" BASIS,
820 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
821 * See the License for the specific language governing permissions and
822 * limitations under the License.
823 */
824function
vendor: 11,842 bytes, line 824
824(){return{"admin-restricted-operation":"This operation is restricted to administrators only.","argument-error":"","app-not-authorized":"This app, identified by the domain where it's hosted, is not authorized to use Firebase Authentication with the provided API key. Review your key configuration in the Google API console.","app-not-installed":"The requested mobile application corresponding to the identifier (Android package name or iOS bundle ID) provided is not installed on this device.","captcha-check-failed":"The reCAPTCHA response token provided is either invalid, expired, already used or the domain associated with it does not match the list of whitelisted domains.","code-expired":"The SMS code has expired. Please re-send the verification code to try again.","cordova-not-ready":"Cordova framework is not ready.","cors-unsupported":"This browser is not supported.","credential-already-in-use":"This credential is already associated with a different user account.","custom-token-mismatch":"The custom token corresponds to a different audience.","requires-recent-login":"This operation is sensitive and requires recent authentication. Log in again before retrying this request.","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.","dynamic-link-not-activated":"Please activate Dynamic Links in the Firebase Console and agree to the terms and conditions.","email-change-needs-verification":"Multi-factor users must always have a verified email.","email-already-in-use":"The email address is already in use by another account.","emulator-config-failed":'Auth instance has already been used to make a network call. Auth can no longer be configured to use the emulator. Try calling "connectAuthEmulator()" sooner.',"expired-action-code":"The action code has expired.","cancelled-popup-request":"This operation has been cancelled due to another conflicting popup being opened.","internal-error":"An internal AuthError has occurred.","invalid-app-credential":"The phone verification request contains an invalid application verifier. The reCAPTCHA token response is either invalid or expired.","invalid-app-id":"The mobile app identifier is not registered for the current project.","invalid-user-token":"This user's credential isn't valid for this project. This can happen if the user's token has been tampered with, or if the user isn't for the project associated with this API key.","invalid-auth-event":"An internal AuthError has occurred.","invalid-verification-code":"The SMS verification code used to create the phone auth credential is invalid. Please resend the verification code sms and be sure to use the verification code provided by the user.","invalid-continue-uri":"The continue URL provided in the request is invalid.","invalid-cordova-configuration":"The following Cordova plugins must be installed to enable OAuth sign-in: cordova-plugin-buildinfo, cordova-universal-links-plugin, cordova-plugin-browsertab, cordova-plugin-inappbrowser and cordova-plugin-customurlscheme.","invalid-custom-token":"The custom token format is incorrect. Please check the documentation.","invalid-dynamic-link-domain":"The provided dynamic link domain is not configured or authorized for the current project.","invalid-email":"The email address is badly formatted.","invalid-emulator-scheme":"Emulator URL must start with a valid scheme (http:// or https://).","invalid-api-key":"Your API key is invalid, please check you have copied it correctly.","invalid-cert-hash":"The SHA-1 certificate hash provided is invalid.","invalid-credential":"The supplied auth credential is incorrect, malformed or has expired.","invalid-message-payload":"The email template corresponding to this action contains invalid characters in its message. Please fix by going to the Auth email templates section in the Firebase Console.","invalid-multi-factor-session":"The request does not contain a valid proof of first factor successful sign-in.","invalid-oauth-provider":"EmailAuthProvider is not supported for this operation. This operation only supports OAuth providers.","invalid-oauth-client-id":"The OAuth client ID provided is either invalid or does not match the specified API key.","unauthorized-domain":"This domain is not authorized for OAuth operations for your Firebase project. Edit the list of authorized domains from the Firebase console.","invalid-action-code":"The action code is invalid. This can happen if the code is malformed, expired, or has already been used.","wrong-password":"The password is invalid or the user does not have a password.","invalid-persistence-type":"The specified persistence type is invalid. It can only be local, session or none.","invalid-phone-number":"The format of the phone number provided is incorrect. Please enter the phone number in a format that can be parsed into E.164 format. E.164 phone numbers are written in the format [+][country code][subscriber number including area code].","invalid-provider-id":"The specified provider ID is invalid.","invalid-recipient-email":"The email corresponding to this action failed to send as the provided recipient email address is invalid.","invalid-sender":"The email template corresponding to this action contains an invalid sender email or name. Please fix by going to the Auth email templates section in the Firebase Console.","invalid-verification-id":"The verification ID used to create the phone auth credential is invalid.","invalid-tenant-id":"The Auth instance's tenant ID is invalid.","login-blocked":"Login blocked by user-provided method: {$originalMessage}","missing-android-pkg-name":"An Android Package Name must be provided if the Android App is required to be installed.","auth-domain-config-required":"Be sure to include authDomain when calling firebase.initializeApp(), by following the instructions in the Firebase console.","missing-app-credential":"The phone verification request is missing an application verifier assertion. A reCAPTCHA response token needs to be provided.","missing-verification-code":"The phone auth credential was created with an empty SMS verification code.","missing-continue-uri":"A continue URL must be provided in the request.","missing-iframe-start":"An internal AuthError has occurred.","missing-ios-bundle-id":"An iOS Bundle ID must be provided if an App Store ID is provided.","missing-or-invalid-nonce":"The request does not contain a valid nonce. This can occur if the SHA-256 hash of the provided raw nonce does not match the hashed nonce in the ID token payload.","missing-password":"A non-empty password must be provided","missing-multi-factor-info":"No second factor identifier is provided.","missing-multi-factor-session":"The request is missing proof of first factor successful sign-in.","missing-phone-number":"To send verification codes, provide a phone number for the recipient.","missing-verification-id":"The phone auth credential was created with an empty verification ID.","app-deleted":"This instance of FirebaseApp has been deleted.","multi-factor-info-not-found":"The user does not have a second factor matching the identifier provided.","multi-factor-auth-required":"Proof of ownership of a second factor is required to complete sign-in.","account-exists-with-different-credential":"An account already exists with the same email address but different sign-in credentials. Sign in using a provider associated with this email address.","network-request-failed":"A network AuthError (such as timeout, interrupted connection or unreachable host) has occurred.","no-auth-event":"An internal AuthError has occurred.","no-such-provider":"User was not linked to an account with the given provider.","null-user":"A null user object was provided as the argument for an operation which requires a non-null user object.","operation-not-allowed":"The given sign-in provider is disabled for this Firebase project. Enable it in the Firebase console, under the sign-in method tab of the Auth section.","operation-not-supported-in-this-environment":'This operation is not supported in the environment this application is running on. "location.protocol" must be http, https or chrome-extension and web storage must be enabled.',"popup-blocked":"Unable to establish a connection with the popup. It may have been blocked by the browser.","popup-closed-by-user":"The popup has been closed by the user before finalizing the operation.","provider-already-linked":"User can only be linked to one identity for the given provider.","quota-exceeded":"The project's quota for this operation has been exceeded.","redirect-cancelled-by-user":"The redirect operation has been cancelled by the user before finalizing.","redirect-operation-pending":"A redirect sign-in operation is already pending.","rejected-credential":"The request contains malformed or mismatching credentials.","second-factor-already-in-use":"The second factor is already enrolled on this account.","maximum-second-factor-count-exceeded":"The maximum allowed number of second factors on a user has been exceeded.","tenant-id-mismatch":"The provided tenant ID does not match the Auth instance's tenant ID",timeout:"The operation has timed out.","user-token-expired":"The user's credential is no longer valid. The user must sign in again.","too-many-requests":"We have blocked all requests from this device due to unusual activity. Try again later.","unauthorized-continue-uri":"The domain of the continue URL is not whitelisted.  Please whitelist the domain in the Firebase console.","unsupported-first-factor":"Enrolling a second factor or signing in with a multi-factor account requires sign-in with a supported first factor.","unsupported-persistence-type":"The current environment does not support the specified persistence type.","unsupported-tenant-operation":"This operation is not supported in a multi-tenant context.","unverified-email":"The operation requires a verified email.","user-cancelled":"The user did not grant your application the permissions it requested.","user-not-found":"There is no user record corresponding to this identifier. The user may have been deleted.","user-disabled":"The user account has been disabled by an administrator.","user-mismatch":"The supplied credentials do not correspond to the previously signed in user.","user-signed-out":"","weak-password":"The password must be 6 characters long or more.","web-storage-unsupported":"This browser is not supported or 3rd party cookies and data may be disabled.","already-initialized":"initializeAuth() has already been called with different options. To avoid this error, call initializeAuth() with the same options as when it was originally called, or call getAuth() to return the already initialized instance.","missing-recaptcha-token":"The reCAPTCHA token is missing when sending request to the backend.","invalid-recaptcha-token":"The reCAPTCHA token is invalid when sending request to the backend.","invalid-recaptcha-action":"The reCAPTCHA action is invalid when sending request to the backend.","recaptcha-not-enabled":"reCAPTCHA Enterprise integration is not enabled for this project.","missing-client-type":"The reCAPTCHA client type is missing when sending request to the backend.","missing-recaptcha-version":"The reCAPTCHA version is missing when sending request to the backend.","invalid-req-type":"Invalid request parameters.","invalid-recaptcha-version":"The reCAPTCHA version is invalid when sending request to the backend.","unsupported-password-policy-schema-version":"The password policy received from the backend uses a schema version that is not supported by this version of the Firebase SDK.","password-does-not-meet-requirements":"The password does not meet the requirements."
824}},h=d,p=new i.b("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."}),f=new s.b("@firebase/auth");function m(e,...t){f.logLevel<=s.a.ERROR&&f.error(`Auth (${r.SDK_VERSION}): ${e}`,...t)}
825/**
826 * @license
827 * Copyright 2020 Google LLC
828 *
829 * Licensed under the Apache License, Version 2.0 (the "License");
830 * you may not use this file except in compliance with the License.
831 * You may obtain a copy of the License at
832 *
833 *   http://www.apache.org/licenses/LICENSE-2.0
834 *
835 * Unless required by applicable law or agreed to in writing, software
836 * distributed under the License is distributed on an "AS IS" BASIS,
837 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
838 * See the License for the specific language governing permissions and
839 * limitations under the License.
840 */function g(e,...t){throw w(e,...t)}function v(e,...t){return w(e,...t)}function b(e,t,n){const r=Object.assign(Object.assign({},h()),{[t]:n});return new i.b("auth","Firebase",r).create(t,{appName:e.name})}function _(e){return b(e,"operation-not-supported-in-this-environment","Operations that alter the current user are not supported in conjunction with FirebaseServerApp")}function y(e,t,n){if(!(t instanceof n))throw n.name!==t.constructor.name&&g(e,"argument-error"),b(e,"argument-error",`Type of ${t.constructor.name} does not match expected instance.Did you pass a reference from a different Auth SDK?`)}function w(e,...t){if("string"!=typeof e){const n=t[0],r=[...t.slice(1)];return r[0]&&(r[0].appName=e.name),e._errorFactory.create(n,...r)}return p.create(e,...t)}function I(e,t,...n){if(!e)throw w(t,...n)}function T(e){const t="INTERNAL ASSERTION FAILED: "+e;throw m(t),new Error(t)}function E(e,t){e||T(t)}
841/**
842 * @license
843 * Copyright 2020 Google LLC
844 *
845 * Licensed under the Apache License, Version 2.0 (the "License");
846 * you may not use this file except in compliance with the License.
847 * You may obtain a copy of the License at
848 *
849 *   http://www.apache.org/licenses/LICENSE-2.0
850 *
851 * Unless required by applicable law or agreed to in writing, software
852 * distributed under the License is distributed on an "AS IS" BASIS,
853 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
854 * See the License for the specific language governing permissions and
855 * limitations under the License.
856 */function O(){var e;return"undefined"!=typeof self&&(null===(e=self.location)||void 0===e?void 0:e.href)||""}function k(){return"http:"===S()||"https:"===S()}function S(){var e;return"undefined"!=typeof self&&(null===(e=self.location)||void 0===e?void 0:e.protocol)||null}
857/**
858 * @license
859 * Copyright 2020 Google LLC
860 *
861 * Licensed under the Apache License, Version 2.0 (the "License");
862 * you may not use this file except in compliance with the License.
863 * You may obtain a copy of the License at
864 *
865 *   http://www.apache.org/licenses/LICENSE-2.0
866 *
867 * Unless required by applicable law or agreed to in writing, softw
867are
868 * distributed under the License is distributed on an "AS IS" BASIS,
869 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
870 * See the License for the specific language governing permissions and
871 * limitations under the License.
872 */
873/**
874 * @license
875 * Copyright 2020 Google LLC
876 *
877 * Licensed under the Apache License, Version 2.0 (the "License");
878 * you may not use this file except in compliance with the License.
879 * You may obtain a copy of the License at
880 *
881 *   http://www.apache.org/licenses/LICENSE-2.0
882 *
883 * Unless required by applicable law or agreed to in writing, software
884 * distributed under the License is distributed on an "AS IS" BASIS,
885 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
886 * See the License for the specific language governing permissions and
887 * limitations under the License.
888 */
889class A{constructor(e,t){this.shortDelay=e,this.longDelay=t,E(t>e,"Short delay should be less than long delay!"),this.isMobile=Object(i.w)()||Object(i.y)()}get(){return"undefined"!=typeof navigator&&navigator&&"onLine"in navigator&&"boolean"==typeof navigator.onLine&&(k()||Object(i.r)()||"connection"in navigator)&&!navigator.onLine?Math.min(5e3,this.shortDelay):this.isMobile?this.longDelay:this.shortDelay}}
890/**
891 * @license
892 * Copyright 2020 Google LLC
893 *
894 * Licensed under the Apache License, Version 2.0 (the "License");
895 * you may not use this file except in compliance with the License.
896 * You may obtain a copy of the License at
897 *
898 *   http://www.apache.org/licenses/LICENSE-2.0
899 *
900 * Unless required by applicable law or agreed to in writing, software
901 * distributed under the License is distributed on an "AS IS" BASIS,
902 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
903 * See the License for the specific language governing permissions and
904 * limitations under the License.
905 */function C(e,t){E(e.emulator,"Emulator should always be set here");const{url:n}=e.emulator;return t?`${n}${t.startsWith("/")?t.slice(1):t}`:n}
906/**
907 * @license
908 * Copyright 2020 Google LLC
909 *
910 * Licensed under the Apache License, Version 2.0 (the "License");
911 * you may not use this file except in compliance with the License.
912 * You may obtain a copy of the License at
913 *
914 *   http://www.apache.org/licenses/LICENSE-2.0
915 *
916 * Unless required by applicable law or agreed to in writing, software
917 * distributed under the License is distributed on an "AS IS" BASIS,
918 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
919 * See the License for the specific language governing permissions and
920 * limitations under the License.
921 */class R{static initialize(e,t,n){this.fetchImpl=e,t&&(this.headersImpl=t),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 T("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 T("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 T("Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}}
922/**
923 * @license
924 * Copyright 2020 Google LLC
925 *
926 * Licensed under the Apache License, Version 2.0 (the "License");
927 * you may not use this file except in compliance with the License.
928 * You may obtain a copy of the License at
929 *
930 *   http://www.apache.org/licenses/LICENSE-2.0
931 *
932 * Unless required by applicable law or agreed to in writing, software
933 * distributed under the License is distributed on an "AS IS" BASIS,
934 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
935 * See the License for the specific language governing permissions and
936 * limitations under the License.
937 */const P={CREDENTIAL_MISMATCH:"custom-token-mismatch",MISSING_CUSTOM_TOKEN:"internal-error",INVA
937LID_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"},N=new A(3e4,6e4);
938/**
939 * @license
940 * Copyright 2020 Google LLC
941 *
942 * Licensed under the Apache License, Version 2.0 (the "License");
943 * you may not use this file except in compliance with the License.
944 * You may obtain a copy of the License at
945 *
946 *   http://www.apache.org/licenses/LICENSE-2.0
947 *
948 * Unless required by applicable law or agreed to in writing, software
949 * distributed under the License is distributed on an "AS IS" BASIS,
950 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
951 * See the License for the specific language governing permissions and
952 * limitations under the License.
953 */function D(e,t){return e.tenantId&&!t.tenantId?Object.assign(Object.assign({},t),{tenantId:e.tenantId}):t}async function L(e,t,n,r,s={}){return j(e,s,async()=>{let s={},o={};r&&("GET"===t?o=r:s={body:JSON.stringify(r)});const a=Object(i.A)(Object.assign({key:e.config.apiKey},o)).slice(1),c=await e._getAdditionalHeaders();c["Content-Type"]="application/json",e.languageCode&&(c["X-Firebase-Locale"]=e.languageCode);const u=Object.assign({method:t,headers:c},s);return Object(i.s)()||(u.referrerPolicy="no-referrer"),R.fetch()(M(e,e.config.apiHost,n,a),u)})}async function j(e,t,n){e._canInitEmulator=!1;const r=Object.assign(Object.assign({},P),t);try{const t=new x(e),i=await Promise.race([n(),t.promise]);t.clearNetworkTimeout();const s=await i.json();if("needConfirmation"in s)throw V(e,"account-exists-with-different-credential",s);if(i.ok&&!("errorMessage"in s))return s;{const t=i.ok?s.errorMessage:s.error.message,[n,o]=t.split(" : ");if("FEDERATED_USER_ID_ALREADY_LINKED"===n)throw V(e,"credential-already-in-use",s);if("EMAIL_EXISTS"===n)throw V(e,"email-already-in-use",s);if("USER_DISABLED"===n)throw V(e,"user-disabled",s);const a=r[n]||n.toLowerCase().replace(/[_\s]+/g,"-");if(o)throw b(e,a,o);g(e,a)}}catch(t){if(t instanceof i.c)throw t;g(e,"network-request-failed",{message:String(t)})}}async function U(e,t,n,r,i={}){const s=await L(e,t,n,r,i);return"mfaPendingCredential"in s&&g(e,"multi-factor-auth-required",{_serverResponse:s}),s}function M(e,t,n,r){const i=`${t}${n}?${r}`;return e.config.emulator?C(e.config,i):`${e.config.apiScheme}://${i}`}function F(e){switch(e){case"ENFORCE":return"ENFORCE";case"AUDIT":return"AUDIT";case"OFF":return"OFF";default:return"ENFORCEMENT_STATE_UNSPECIFIED"}}class x{constructor(e){this.auth=e,this.timer=null,this.promise=new Promise((e,t)=>
953{this.timer=setTimeout(()=>t(v(this.auth,"network-request-failed")),N.get())})}clearNetworkTimeout(){clearTimeout(this.timer)}}function V(e,t,n){const r={appName:e.name};n.email&&(r.email=n.email),n.phoneNumber&&(r.phoneNumber=n.phoneNumber);const i=v(e,t,r);return i.customData._tokenResponse=n,i}
954/**
955 * @license
956 * Copyright 2020 Google LLC
957 *
958 * Licensed under the Apache License, Version 2.0 (the "License");
959 * you may not use this file except in compliance with the License.
960 * You may obtain a copy of the License at
961 *
962 *   http://www.apache.org/licenses/LICENSE-2.0
963 *
964 * Unless required by applicable law or agreed to in writing, software
965 * distributed under the License is distributed on an "AS IS" BASIS,
966 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
967 * See the License for the specific language governing permissions and
968 * limitations under the License.
969 */function z(e){return void 0!==e&&void 0!==e.getResponse}function H(e){return void 0!==e&&void 0!==e.enterprise}class W{constructor(e){if(this.siteKey="",this.recaptchaEnforcementState=[],void 0===e.recaptchaKey)throw new Error("recaptchaKey undefined");this.siteKey=e.recaptchaKey.split("/")[3],this.recaptchaEnforcementState=e.recaptchaEnforcementState}getProviderEnforcementState(e){if(!this.recaptchaEnforcementState||0===this.recaptchaEnforcementState.length)return null;for(const t of this.recaptchaEnforcementState)if(t.provider&&t.provider===e)return F(t.enforcementState);return null}isProviderEnabled(e){return"ENFORCE"===this.getProviderEnforcementState(e)||"AUDIT"===this.getProviderEnforcementState(e)}}
970/**
971 * @license
972 * Copyright 2020 Google LLC
973 *
974 * Licensed under the Apache License, Version 2.0 (the "License");
975 * you may not use this file except in compliance with the License.
976 * You may obtain a copy of the License at
977 *
978 *   http://www.apache.org/licenses/LICENSE-2.0
979 *
980 * Unless required by applicable law or agreed to in writing, software
981 * distributed under the License is distributed on an "AS IS" BASIS,
982 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
983 * See the License for the specific language governing permissions and
984 * limitations under the License.
985 */async function B(e,t){return L(e,"GET","/v2/recaptchaConfig",D(e,t))}
986/**
987 * @license
988 * Copyright 2020 Google LLC
989 *
990 * Licensed under the Apache License, Version 2.0 (the "License");
991 * you may not use this file except in compliance with the License.
992 * You may obtain a copy of the License at
993 *
994 *   http://www.apache.org/licenses/LICENSE-2.0
995 *
996 * Unless required by applicable law or agreed to in writing, software
997 * distributed under the License is distributed on an "AS IS" BASIS,
998 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
999 * See the License for the specific language governing permissions and
1000 * limitations under the License.
1001 */async function q(e,t){return L(e,"POST","/v1/accounts:lookup",t)}
1002/**
1003 * @license
1004 * Copyright 2020 Google LLC
1005 *
1006 * Licensed under the Apache License, Version 2.0 (the "License");
1007 * you may not use this file except in compliance with the License.
1008 * You may obtain a copy of the License at
1009 *
1010 *   http://www.apache.org/licenses/LICENSE-2.0
1011 *
1012 * Unless required by applicable law or agreed to in writing, software
1013 * distributed under the License is distributed on an "AS IS" BASIS,
1014 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1015 * See the License for the specific language governing permissions and
1016 * limitations under the License.
1017 */function G(e){if(e)try{const t=new Date(Number(e));if(!isNaN(t.getTime()))return t.toUTCString()}catch(e){}}
1018/**
1019 * @license
1020 * Copyright 2020 Google LLC
1021 *
1022 * Licensed under the Apache License, Version 2.0 (the "License");
1023 * you may not use this file except in compliance with the License.
1024 * You may obtain a copy of the License at
1025 *
1026 *   http://www.apache.org/licenses/LICENSE-2.0
1027 *
1028 * Unless required by applicable law or agreed to in writing, software
1029 * distributed under the License is distributed on an "AS IS" BASIS,
1030 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1031 * See the License for the specific language governing permissions and
1032 * limitations under the License.
1033 */function $(e){return 1e3*Number(e)}function K(e){const[t,n,r]=e.split(".");if(void 0===t||void 0===n||void 0===r)return m("JWT malformed, contained fewer than 3 sections"),null;try{const e=Object(i.d)(n);return e?JSON.parse(e):(m("Failed to decode base64 JWT payload"),null)}catch(e){return m("Caught error parsing JWT payload as JSON",null==e?void 0:e.toString()),null}}function J(e){const t=K(e);return I(t,"internal-error"),I(void 0!==t.exp,"internal-error"),I(void 0!==t.iat,"internal-error"),Number(t.exp)-Number(t.iat)}
1034/**
1035 * @license
1036 * Copyright 2020 Google LLC
1037 *
1038 * Licensed under the Apache License, Version 2.0 (the "License");
1039 * you may not use this file except in compliance with the License.
1040 * You may obtain a copy of the License at
1041 *
1042 *   http://www.apache.org/licenses/LICENSE-2.0
1043 *
1044 * Unless required by applicable law or agreed to in writing, software
1045 * distributed under the License is distributed on an "AS IS" BASIS,
1046 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1047 * See the License for the specific language governing permissions and
1048 * limitations under the License.
1049 */async function Y(e,t,n=!1){if(n)return t;try{return await t}catch(t){throw t instanceof i.c&&function({code:e}){return"auth/user-disabled"===e||"auth/user-token-expired"===e}
1050/**
1051 * @license
1052 * Copyright 2020 Google LLC
1053 *
1054 * Licensed under the Apache License, Version 2.0 (the "License");
1055 * you may not use this file except in compliance with the License.
1056 * You may obtain a copy of the License at
1057 *
1058 *   http://www.apache.org/licenses/LICENSE-2.0
1059 *
1060 * Unless required by applicable law or agreed to in writing, software
1061 * distributed under the License is distributed on an "AS IS" BASIS,
1062 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1063 * See the License for the specific language governing permissions and
1064 * limitations under the License.
1065 */(t)&&e.auth.currentUser===e&&await e.auth.signOut(),t}}class X{constructor(e){this.user=e,this.isRunning=!1,this.timerId=null,this.errorBackoff=3e4}_start(){this.isRunning||(this.isRunning=!0,this.schedule())}_stop(){this.isRunning&&(this.isRunning=!1,null!==this.timerId&&clearTimeout(this.timerId))}getInterval(e){var t;if(e){const e=this.errorBackoff;return this.errorBackoff=Math.min(2*this.errorBackoff,96e4),e}{this.errorBackoff=3e4;const e=(null!==(t=this.user.stsTokenManager.expirationTime)&&void 0!==t?t:0)-Date.now()-3e5;return Math.max(0,e)}}schedule(e=!1){if(!this.isRunning)return;const t=this.getInterval(e);this.timerId=setTimeout(async()=>{await this.iteration()},t)}async iteration(){try{await this.user.getIdToken(!0)}catch(e){return void("auth/network-request-failed"===(null==e?void 0:e.code)&&this.schedule(!0))}this.schedule()}}
1066/**
1067 * @license
1068 * Copyright 2020 Google LLC
1069 *
1070 * Licensed under the Apache License, Version 2.0 (the "License");
1071 * you may not use this file except in compliance with the License.
1072 * You may obtain a copy of the License at
1073 *
1074 *   http://www.apache.org/licenses/LICENSE-2.0
1075 *
1076 * Unless required by applicable law or agreed to in writing, software
1077 * distributed under the License is distributed on an "AS IS" BASIS,
1078 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1079 * See the License for the specific language governing permissions and
1080 * limitations under the License.
1081 */class Z{constructor(e,t){this.createdAt=e,this.lastLoginAt=t,this._initializeTime()}_initializeTime(){this.lastSignInTime=G(this.lastLoginAt),this.creationTime=G(this.createdAt)}_copy(e){this.createdAt=e.createdAt,this.lastLoginAt=e.lastLoginAt,this._initializeTime()}toJSON(){return{createdAt:this.createdAt,lastLoginAt:this.lastLoginAt}}}
1082/**
1083 * @license
1084 * Copyright 2019 Google LLC
1085 *
1086 * Licensed under the Apache License, Version 2.0 (the "License");
1087 * you may not use this file except in compliance with the License.
1088 * You may obtain a copy of the License at
1089 *
1090 *   http://www.apache.org/licenses/LICENSE-2.0
1091 *
1092 * Unless required by applicable law or agreed to in writing, software
1093 * distributed under the License is distributed on an "AS IS" BASIS,
1094 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1095 * See the License for the specific language governing permissions and
1096 * limitations under the License.
1097 */async function Q(e){var t;const n=e.auth,r=await e.getIdToken(),i=await Y(e,q(n,{idToken:r}));I(null==i?void 0:i.users.length,n,"internal-error");const s=i.users[0];e._notifyReloadListener(s);const o=(null===(t=s.providerUserInfo)||void 0===t?void 0:t.length)?ee(s.providerUserInfo):[],a=(c=e.providerData,u=o,[...c.filter(e=>!u.some(t=>t.providerId===e.providerId)),...u]);var c,u;const d=e.isAnonymous,l=!(e.email&&s.passwordHash||(null==a?void 0:a.length)),h=!!d&&l,p={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:a,metadata:new Z(s.createdAt,s.lastLoginAt),isAnonymous:h};Object.assign(e,p)}function ee(e){return e.map(e=>{var{providerId:t}=e,n=Object(o.b)(e,["providerId"]);
vendor: 10,008 bytes, lines 1097-1157
1097return{providerId:t,uid:n.rawId||"",displayName:n.displayName||null,email:n.email||null,phoneNumber:n.phoneNumber||null,photoURL:n.photoUrl||null}})}
1098/**
1099 * @license
1100 * Copyright 2020 Google LLC
1101 *
1102 * Licensed under the Apache License, Version 2.0 (the "License");
1103 * you may not use this file except in compliance with the License.
1104 * You may obtain a copy of the License at
1105 *
1106 *   http://www.apache.org/licenses/LICENSE-2.0
1107 *
1108 * Unless required by applicable law or agreed to in writing, software
1109 * distributed under the License is distributed on an "AS IS" BASIS,
1110 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1111 * See the License for the specific language governing permissions and
1112 * limitations under the License.
1113 */
1114/**
1115 * @license
1116 * Copyright 2020 Google LLC
1117 *
1118 * Licensed under the Apache License, Version 2.0 (the "License");
1119 * you may not use this file except in compliance with the License.
1120 * You may obtain a copy of the License at
1121 *
1122 *   http://www.apache.org/licenses/LICENSE-2.0
1123 *
1124 * Unless required by applicable law or agreed to in writing, software
1125 * distributed under the License is distributed on an "AS IS" BASIS,
1126 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1127 * See the License for the specific language governing permissions and
1128 * limitations under the License.
1129 */
1130class te{constructor(){this.refreshToken=null,this.accessToken=null,this.expirationTime=null}get isExpired(){return!this.expirationTime||Date.now()>this.expirationTime-3e4}updateFromServerResponse(e){I(e.idToken,"internal-error"),I(void 0!==e.idToken,"internal-error"),I(void 0!==e.refreshToken,"internal-error");const t="expiresIn"in e&&void 0!==e.expiresIn?Number(e.expiresIn):J(e.idToken);this.updateTokensAndExpiration(e.idToken,e.refreshToken,t)}updateFromIdToken(e){I(0!==e.length,"internal-error");const t=J(e);this.updateTokensAndExpiration(e,null,t)}async getToken(e,t=!1){return t||!this.accessToken||this.isExpired?(I(this.refreshToken,e,"user-token-expired"),this.refreshToken?(await this.refresh(e,this.refreshToken),this.accessToken):null):this.accessToken}clearRefreshToken(){this.refreshToken=null}async refresh(e,t){const{accessToken:n,refreshToken:r,expiresIn:s}=await async function(e,t){const n=await j(e,{},async()=>{const n=Object(i.A)({grant_type:"refresh_token",refresh_token:t}).slice(1),{tokenApiHost:r,apiKey:s}=e.config,o=M(e,r,"/v1/token","key="+s),a=await e._getAdditionalHeaders();return a["Content-Type"]="application/x-www-form-urlencoded",R.fetch()(o,{method:"POST",headers:a,body:n})});return{accessToken:n.access_token,expiresIn:n.expires_in,refreshToken:n.refresh_token}}(e,t);this.updateTokensAndExpiration(n,r,Number(s))}updateTokensAndExpiration(e,t,n){this.refreshToken=t||null,this.accessToken=e||null,this.expirationTime=Date.now()+1e3*n}static fromJSON(e,t){const{refreshToken:n,accessToken:r,expirationTime:i}=t,s=new te;return n&&(I("string"==typeof n,"internal-error",{appName:e}),s.refreshToken=n),r&&(I("string"==typeof r,"internal-error",{appName:e}),s.accessToken=r),i&&(I("number"==typeof i,"internal-error",{appName:e}),s.expirationTime=i),s}toJSON(){return{refreshToken:this.refreshToken,accessToken:this.accessToken,expirationTime:this.expirationTime}}_assign(e){this.accessToken=e.accessToken,this.refreshToken=e.refreshToken,this.expirationTime=e.expirationTime}_clone(){return Object.assign(new te,this.toJSON())}_performRefresh(){return T("not implemented")}}
1131/**
1132 * @license
1133 * Copyright 2020 Google LLC
1134 *
1135 * Licensed under the Apache License, Version 2.0 (the "License");
1136 * you may not use this file except in compliance with the License.
1137 * You may obtain a copy of the License at
1138 *
1139 *   http://www.apache.org/licenses/LICENSE-2.0
1140 *
1141 * Unless required by applicable law or agreed to in writing, software
1142 * distributed under the License is distributed on an "AS IS" BASIS,
1143 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1144 * See the License for the specific language governing permissions and
1145 * limitations under the License.
1146 */function ne(e,t){I("string"==typeof e||void 0===e,"internal-error",{appName:t})}class re{constructor(e){var{uid:t,auth:n,stsTokenManager:r}=e,i=Object(o.b)(e,["uid","auth","stsTokenManager"]);this.providerId="firebase",this.proactiveRefresh=new X(this),this.reloadUserInfo=null,this.reloadListener=null,this.uid=t,this.auth=n,this.stsTokenManager=r,this.accessToken=r.accessToken,this.displayName=i.displayName||null,this.email=i.email||null,this.emailVerified=i.emailVerified||!1,this.phoneNumber=i.phoneNumber||null,this.photoURL=i.photoURL||null,this.isAnonymous=i.isAnonymous||!1,this.tenantId=i.tenantId||null,this.providerData=i.providerData?[...i.providerData]:[],this.metadata=new Z(i.createdAt||void 0,i.lastLoginAt||void 0)}async getIdToken(e){const t=await Y(this,this.stsTokenManager.getToken(this.auth,e));return I(t,this.auth,"internal-error"),this.accessToken!==t&&(this.accessToken=t,await this.auth._persistUserIfCurrent(this),this.auth._notifyListenersIfCurrent(this)),t}getIdTokenResult(e){return async function(e,t=!1){const n=Object(i.o)(e),r=await n.getIdToken(t),s=K(r);I(s&&s.exp&&s.auth_time&&s.iat,n.auth,"internal-error");const o="object"==typeof s.firebase?s.firebase:void 0,a=null==o?void 0:o.sign_in_provider;return{claims:s,token:r,authTime:G($(s.auth_time)),issuedAtTime:G($(s.iat)),expirationTime:G($(s.exp)),signInProvider:a||null,signInSecondFactor:(null==o?void 0:o.sign_in_second_factor)||null}}(this,e)}reload(){return async function(e){const t=Object(i.o)(e);await Q(t),await t.auth._persistUserIfCurrent(t),t.auth._notifyListenersIfCurrent(t)}(this)}_assign(e){this!==e&&(I(this.uid===e.uid,this.auth,"internal-error"),this.displayName=e.displayName,this.photoURL=e.photoURL,this.email=e.email,this.emailVerified=e.emailVerified,this.phoneNumber=e.phoneNumber,this.isAnonymous=e.isAnonymous,this.tenantId=e.tenantId,this.providerData=e.providerData.map(e=>Object.assign({},e)),this.metadata._copy(e.metadata),this.stsTokenManager._assign(e.stsTokenManager))}_clone(e){const t=new re(Object.assign(Object.assign({},this),{auth:e,stsTokenManager:this.stsTokenManager._clone()}));return t.metadata._copy(this.metadata),t}_onReload(e){I(!this.reloadListener,this.auth,"internal-error"),this.reloadListener=e,this.reloadUserInfo&&(this._notifyReloadListener(this.reloadUserInfo),this.reloadUserInfo=null)}_notifyReloadListener(e){this.reloadListener?this.reloadListener(e):this.reloadUserInfo=e}_startProactiveRefresh(){this.proactiveRefresh._start()}_stopProactiveRefresh(){this.proactiveRefresh._stop()}async _updateTokensIfNecessary(e,t=!1){let n=!1;e.idToken&&e.idToken!==this.stsTokenManager.accessToken&&(this.stsTokenManager.updateFromServerResponse(e),n=!0),t&&await Q(this),await this.auth._persistUserIfCurrent(this),n&&this.auth._notifyListenersIfCurrent(this)}async delete(){if(Object(r._isFirebaseServerApp)(this.auth.app))return Promise.reject(_(this.auth));const e=await this.getIdToken();return await Y(this,async function(e,t){return L(e,"POST","/v1/accounts:delete",t)}(this.auth,{idToken:e})),this.stsTokenManager.clearRefreshToken(),this.auth.signOut()}toJSON(){return Object.assign(Object.assign({uid:this.uid,email:this.email||void 0,emailVerified:this.emailVerified,displayName:this.displayName||void 0,isAnonymous:this.isAnonymous,photoURL:this.photoURL||void 0,phoneNumber:this.phoneNumber||void 0,tenantId:this.tenantId||void 0,providerData:this.providerData.map(e=>Object.assign({},e)),stsTokenManager:this.stsTokenManager.toJSON(),_redirectEventId:this._redirectEventId},this.metadata.toJSON()),{apiKey:this.auth.config.apiKey,appName:this.auth.name})}get refreshToken(){return this.stsTokenManager.refreshToken||""}static _fromJSON(e,t){var n,r,i,s,o,a,c,u;const d=null!==(n=t.displayName)&&void 0!==n?n:void 0,l=null!==(r=t.email)&&void 0!==r?r:void 0,h=null!==(i=t.phoneNumber)&&void 0!==i?i:void 0,p=null!==(s=t.photoURL)&&void 0!==s?s:void 0,f=null!==(o=t.tenantId)&&void 0!==o?o:void 0,m=null!==(a=t._redirectEventId)&&void 0!==a?a:void 0,g=null!==(c=t.createdAt)&&void 0!==c?c:void 0,v=null!==(u=t.lastLoginAt)&&void 0!==u?u:void 0,{uid:b,emailVerified:_,isAnonymous:y,providerData:w,stsTokenManager:T}=t;I(b&&T,e,"internal-error");const E=te.fromJSON(this.name,T);I("string"==typeof b,e,"internal-error"),ne(d,e.name),ne(l,e.name),I("boolean"==typeof _,e,"internal-error"),I("boolean"==typeof y,e,"internal-error"),ne(h,e.name),ne(p,e.name),ne(f,e.name),ne(m,e.name),ne(g,e.name),ne(v,e.name);const O=new re({uid:b,auth:e,email:l,emailVerified:_,displayName:d,isAnonymous:y,photoURL:p,phoneNumber:h,tenantId:f,stsTokenManager:E,createdAt:g,lastLoginAt:v});return w&&Array.isArray(w)&&(O.providerData=w.map(e=>Object.assign({},e))),m&&(O._redirectEventId=m),O}static async _fromIdTokenResponse(e,t,n=!1){const r=new te;r.updateFromServerResponse(t);const i=new re({uid:t.localId,auth:e,stsTokenManager:r,isAnonymous:n});return await Q(i),i}static async _fromGetAccountInfoResponse(e,t,n){const r=t.users[0];I(void 0!==r.localId,"internal-error");const i=void 0!==r.providerUserInfo?ee(r.providerUserInfo):[],s=!(r.email&&r.passwordHash||(null==i?void 0:i.length)),o=new te;o.updateFromIdToken(n);const a=new re({uid:r.localId,auth:e,stsTokenManager:o,isAnonymous:s}),c={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:i,metadata:new Z(r.createdAt,r.lastLoginAt),isAnonymous:!(r.email&&r.passwordHash||(null==i?void 0:i.length))};return Object.assign(a,c),a}}
1147/**
1148 * @license
1149 * Copyright 2020 Google LLC
1150 *
1151 * Licensed under the Apache License, Version 2.0 (the "License");
1152 * you may not use this file except in compliance with the License.
1153 * You may obtain a copy of the License at
1154 *
1155 *   http://www.apache.org/licenses/LICENSE-2.0
1156 *
1157 * Unless required by applicable law or agreed to in writing, softw
1157are
1158 * distributed under the License is distributed on an "AS IS" BASIS,
1159 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1160 * See the License for the specific language governing permissions and
1161 * limitations under the License.
1162 */const ie=new Map;function se(e){E(e instanceof Function,"Expected a class definition");let t=ie.get(e);return t?(E(t instanceof e,"Instance stored in cache mismatched with class"),t):(t=new e,ie.set(e,t),t)}
1163/**
1164 * @license
1165 * Copyright 2019 Google LLC
1166 *
1167 * Licensed under the Apache License, Version 2.0 (the "License");
1168 * you may not use this file except in compliance with the License.
1169 * You may obtain a copy of the License at
1170 *
1171 *   http://www.apache.org/licenses/LICENSE-2.0
1172 *
1173 * Unless required by applicable law or agreed to in writing, software
1174 * distributed under the License is distributed on an "AS IS" BASIS,
1175 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1176 * See the License for the specific language governing permissions and
1177 * limitations under the License.
1178 */class oe{constructor(){this.type="NONE",this.storage={}}async _isAvailable(){return!0}async _set(e,t){this.storage[e]=t}async _get(e){const t=this.storage[e];return void 0===t?null:t}async _remove(e){delete this.storage[e]}_addListener(e,t){}_removeListener(e,t){}}oe.type="NONE";const ae=oe;
1179/**
1180 * @license
1181 * Copyright 2019 Google LLC
1182 *
1183 * Licensed under the Apache License, Version 2.0 (the "License");
1184 * you may not use this file except in compliance with the License.
1185 * You may obtain a copy of the License at
1186 *
1187 *   http://www.apache.org/licenses/LICENSE-2.0
1188 *
1189 * Unless required by applicable law or agreed to in writing, software
1190 * distributed under the License is distributed on an "AS IS" BASIS,
1191 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1192 * See the License for the specific language governing permissions and
1193 * limitations under the License.
1194 */function ce(e,t,n){return`firebase:${e}:${t}:${n}`}class ue{constructor(e,t,n){this.persistence=e,this.auth=t,this.userKey=n;const{config:r,name:i}=this.auth;this.fullUserKey=ce(this.userKey,r.apiKey,i),this.fullPersistenceKey=ce("persistence",r.apiKey,i),this.boundEventHandler=t._onStorageEvent.bind(t),this.persistence._addListener(this.fullUserKey,this.boundEventHandler)}setCurrentUser(e){return this.persistence._set(this.fullUserKey,e.toJSON())}async getCurrentUser(){const e=await this.persistence._get(this.fullUserKey);return e?re._fromJSON(this.auth,e):null}removeCurrentUser(){return this.persistence._remove(this.fullUserKey)}savePersistenceForRedirect(){return this.persistence._set(this.fullPersistenceKey,this.persistence.type)}async setPersistence(e){if(this.persistence===e)return;const t=await this.getCurrentUser();return await this.removeCurrentUser(),this.persistence=e,t?this.setCurrentUser(t):void 0}delete(){this.persistence._removeListener(this.fullUserKey,this.boundEventHandler)}static async create(e,t,n="authUser"){if(!t.length)return new ue(se(ae),e,n);const r=(await Promise.all(t.map(async e=>{if(await e._isAvailable())return e}))).filter(e=>e);let i=r[0]||se(ae);const s=ce(n,e.config.apiKey,e.name);let o=null;for(const n of t)try{const t=await n._get(s);if(t){const r=re._fromJSON(e,t);n!==i&&(o=r),i=n;break}}catch(e){}const a=r.filter(e=>e._shouldAllowMigration);return i._shouldAllowMigration&&a.length?(i=a[0],o&&await i._set(s,o.toJSON()),await Promise.all(t.map(async e=>{if(e!==i)try{await e._remove(s)}catch(e){}})),new ue(i,e,n)):new ue(i,e,n)}}
1195/**
1196 * @license
1197 * Copyright 2020 Google LLC
1198 *
1199 * Licensed under the Apache License, Version 2.0 (the "License");
1200 * you may not use this file except in compliance with the License.
1201 * You may obtain a copy of the License at
1202 *
1203 *   http://www.apache.org/licenses/LICENSE-2.0
1204 *
1205 * Unless required by applicable law or agreed to in writing, software
1206 * distributed under the License is distributed on an "AS IS" BASIS,
1207 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1208 * See the License for the specific language governing permissions and
1209 * limitations under the License.
1210 */function de(e){const t=e.toLowerCase();if(t.includes("opera/")||t.includes("opr/")||t.includes("opios/"))return"Opera";if(fe(t))return"IEMobile";if(t.includes("msie")||t.includes("trident/"))return"IE";if(t.includes("edge/"))return"Edge";if(le(t))return"Firefox";if(t.includes("silk/"))return"Silk";if(ge(t))return"Blackberry";if(ve(t))return"Webos";if(he(t))return"Safari";if((t.includes("chrome/")||pe(t))&&!t.includes("edge/"))return"Chrome";if(me(t))return"Android";{const t=/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/,n=e.match(t);if(2===(null==n?void 0:n.length))return n[1]}return"Other"}function le(e=Object(i.p)()){return/firefox\//i.test(e)}function he(e=Object(i.p)()){const t=e.toLowerCase();return t.includes("safari/")&&!t.includes("chrome/")&&!t.includes("crios/")&&!t.includes("android")}function pe(e=Object(i.p)()){return/crios\//i.test(e)}function fe(e=Object(i.p)()){return/iemobile/i.test(e)}function me(e=Object(i.p)()){return/android/i.test(e)}function ge(e=Object(i.p)()){return/blackberry/i.test(e)}function ve(e=Object(i.p)()){return/webos/i.test(e)}function be(e=Object(i.p)()){return/iphone|ipad|ipod/i.test(e)||/macintosh/i.test(e)&&/mobile/i.test(e)}function _e(e=Object(i.p)()){return/(iPad|iPhone|iPod).*OS 7_\d/i.test(e)||/(iPad|iPhone|iPod).*OS 8_\d/i.test(e)}function ye(e=Object(i.p)()){return be(e)||me(e)||ve(e)||ge(e)||/windows phone/i.test(e)||fe(e)}
1211/**
1212 * @license
1213 * Copyright 2020 Google LLC
1214 *
1215 * Licensed under the Apache License, Version 2.0 (the "License");
1216 * you may not use this file except in compliance with the License.
1217 * You may obtain a copy of the License at
1218 *
1219 *   http://www.apache.org/licenses/LICENSE-2.0
1220 *
1221 * Unless required by applicable law or agreed to in writing, software
1222 * distributed under the License is distributed on an "AS IS" BASIS,
1223 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1224 * See the License for the specific language governing permissions and
1225 * limitations under the License.
1226 */function we(e,t=[]){let n;switch(e){case"Browser":n=de(Object(i.p)());break;case"Worker":n=`${de(Object(i.p)())}-${e}`;break;default:n=e}const s=t.length?t.join(","):"FirebaseCore-web";return`${n}/JsCore/${r.SDK_VERSION}/${s}`}
1227/**
1228 * @license
1229 * Copyright 2022 Google LLC
1230 *
1231 * Licensed under the Apache License, Version 2.0 (the "License");
1232 * you may not use this file except in compliance with the License.
1233 * You may obtain a copy of the License at
1234 *
1235 *   http://www.apache.org/licenses/LICENSE-2.0
1236 *
1237 * Unless required by applicable law or agreed to in writing, software
1238 * distributed under the License is distributed on an "AS IS" BASIS,
1239 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1240 * See the License for the specific language governing permissions and
1241 * limitations under the License.
1242 */class Ie{constructor(e){this.auth=e,this.queue=[]}pushCallback(e,t){const n=t=>new Promise((n,r)=>{try{n(e(t))}catch(e){r(e)}});n.onAbort=t,this.queue.push(n);const r=this.queue.length-1;return()=>{this.queue[r]=()=>Promise.resolve()}}async runMiddleware(e){if(this.auth.currentUser===e)return;const t=[];try{for(const n of this.queue)await n(e),n.onAbort&&t.push(n.onAbort)}catch(e){t.reverse();for(const e of t)try{e()}catch(e){}throw this.auth._errorFactory.create("login-blocked",{originalMessage:null==e?void 0:e.message})}}}
1243/**
1244 * @license
1245 * Copyright 2023 Google LLC
1246 *
1247 * Licensed under the Apache License, Version 2.0 (the "License");
1248 * you may not use this file except in compliance with the License.
1249 * You may obtain a copy of the License at
1250 *
1251 *   http://www.apache.org/licenses/LICENSE-2.0
1252 *
1253 * Unless required by applicable law or agreed to in writing, software
1254 * distributed under the License is distributed on an "AS IS" BASIS,
1255 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1256 * See the License for the specific language governing permissions and
1257 * limitations under the License.
1258 */class Te{constructor(e){var t,n,r,i;const s=e.customStrengthOptions;this.customStrengthOptions={},this.customStrengthOptions.minPasswordLength=null!==(t=s.minPasswordLength)&&void 0!==t?t:6,s.maxPasswordLength&&(this.customStrengthOptions.maxPasswordLength=s.maxPasswordLength),void 0!==s.containsLowercaseCharacter&&(this.customStrengthOptions.containsLowercaseLetter=s.containsLowercaseCharacter),void 0!==s.containsUppercaseCharacter&&(this.customStrengthOptions.containsUppercaseLetter=s.containsUppercaseCharacter),void 0!==s.containsNumericCharacter&&(this.customStrengthOptions.containsNumericCharacter=s.containsNumericCharacter),void 0!==s.containsNonAlphanumericCharacter&&(this.customStrengthOptions.containsNonAlphanumericCharacter=s.containsNonAlphanumericCharacter),this.enforcementState=e.enforcementState,"ENFORCEMENT_STATE_UNSPECIFIED"===this.enforcementState&&(this.enforcementState="OFF"),this.allowedNonAlphanumericCharacters=null!==(r=null===(n=e.allowedNonAlphanumericCharacters)||void 0===n?void 0:n.join(""))&&void 0!==r?r:"",this.forceUpgradeOnSignin=null!==(i=e.forceUpgradeOnSignin)&&void 0!==i&&i,this.schemaVersion=e.schemaVersion}validatePassword(e){var t,n,r,i,s,o;const a={isValid:!0,passwordPolicy:this};return this.validatePasswordLengthOptions(e,a),this.validatePasswordCharacterOptions(e,a),a.isValid&&(a.isValid=null===(t=a.meetsMinPasswordLength)||void 0===t||t),a.isValid&&(a.isValid=null===(n=a.meetsMaxPasswordLength)||void 0===n||n),a.isValid&&(a.isValid=null===(r=a.containsLowercaseLetter)||void 0===r||r),a.isValid&&(a.isValid=null===(i=a.containsUppercaseLetter)||void 0===i||i),a.isValid&&(a.isValid=null===(s=a.containsNumericCharacter)||void 0===s||s),a.isValid&&
vendor: 4,407 bytes, lines 1258-1274
1258(a.isValid=null===(o=a.containsNonAlphanumericCharacter)||void 0===o||o),a}validatePasswordLengthOptions(e,t){const n=this.customStrengthOptions.minPasswordLength,r=this.customStrengthOptions.maxPasswordLength;n&&(t.meetsMinPasswordLength=e.length>=n),r&&(t.meetsMaxPasswordLength=e.length<=r)}validatePasswordCharacterOptions(e,t){let n;this.updatePasswordCharacterOptionsStatuses(t,!1,!1,!1,!1);for(let r=0;r<e.length;r++)n=e.charAt(r),this.updatePasswordCharacterOptionsStatuses(t,n>="a"&&n<="z",n>="A"&&n<="Z",n>="0"&&n<="9",this.allowedNonAlphanumericCharacters.includes(n))}updatePasswordCharacterOptionsStatuses(e,t,n,r,i){this.customStrengthOptions.containsLowercaseLetter&&(e.containsLowercaseLetter||(e.containsLowercaseLetter=t)),this.customStrengthOptions.containsUppercaseLetter&&(e.containsUppercaseLetter||(e.containsUppercaseLetter=n)),this.customStrengthOptions.containsNumericCharacter&&(e.containsNumericCharacter||(e.containsNumericCharacter=r)),this.customStrengthOptions.containsNonAlphanumericCharacter&&(e.containsNonAlphanumericCharacter||(e.containsNonAlphanumericCharacter=i))}}
1259/**
1260 * @license
1261 * Copyright 2020 Google LLC
1262 *
1263 * Licensed under the Apache License, Version 2.0 (the "License");
1264 * you may not use this file except in compliance with the License.
1265 * You may obtain a copy of the License at
1266 *
1267 *   http://www.apache.org/licenses/LICENSE-2.0
1268 *
1269 * Unless required by applicable law or agreed to in writing, software
1270 * distributed under the License is distributed on an "AS IS" BASIS,
1271 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1272 * See the License for the specific language governing permissions and
1273 * limitations under the License.
1274 */class Ee{constructor(e,t,n,r){this.app=e,this.heartbeatServiceProvider=t,this.appCheckServiceProvider=n,this.config=r,this.currentUser=null,this.emulatorConfig=null,this.operations=Promise.resolve(),this.authStateSubscription=new ke(this),this.idTokenSubscription=new ke(this),this.beforeStateQueue=new Ie(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=p,this._agentRecaptchaConfig=null,this._tenantRecaptchaConfigs={},this._projectPasswordPolicy=null,this._tenantPasswordPolicies={},this.lastNotifiedUid=void 0,this.languageCode=null,this.tenantId=null,this.settings={appVerificationDisabledForTesting:!1},this.frameworks=[],this.name=e.name,this.clientVersion=r.sdkClientVersion}_initializeWithPersistence(e,t){return t&&(this._popupRedirectResolver=se(t)),this._initializationPromise=this.queue(async()=>{var n,r;if(!this._deleted&&(this.persistenceManager=await ue.create(this,e),!this._deleted)){if(null===(n=this._popupRedirectResolver)||void 0===n?void 0:n._shouldInitProactively)try{await this._popupRedirectResolver._initialize(this)}catch(e){}await this.initializeCurrentUser(t),this.lastNotifiedUid=(null===(r=this.currentUser)||void 0===r?void 0:r.uid)||null,this._deleted||(this._isInitialized=!0)}}),this._initializationPromise}async _onStorageEvent(){if(this._deleted)return;const e=await this.assertedPersistence.getCurrentUser();return this.currentUser||e?this.currentUser&&e&&this.currentUser.uid===e.uid?(this._currentUser._assign(e),void await this.currentUser.getIdToken()):void await this._updateCurrentUser(e,!0):void 0}async initializeCurrentUserFromIdToken(e){try{const t=await q(this,{idToken:e}),n=await re._fromGetAccountInfoResponse(this,t,e);await this.directlySetCurrentUser(n)}catch(e){console.warn("FirebaseServerApp could not login user with provided authIdToken: ",e),await this.directlySetCurrentUser(null)}}async initializeCurrentUser(e){var t;if(Object(r._isFirebaseServerApp)(this.app)){const e=this.app.settings.authIdToken;return e?new Promise(t=>{setTimeout(()=>this.initializeCurrentUserFromIdToken(e).then(t,t))}):this.directlySetCurrentUser(null)}const n=await this.assertedPersistence.getCurrentUser();let i=n,s=!1;if(e&&this.config.authDomain){await this.getOrInitRedirectPersistenceManager();const n=null===(t=this.redirectUser)||void 0===t?void 0:t._redirectEventId,r=null==i?void 0:i._redirectEventId,o=await this.tryRedirectSignIn(e);n&&n!==r||!(null==o?void 0:o.user)||(i=o.user,s=!0)}if(!i)return this.directlySetCurrentUser(null);
1274if(!i._redirectEventId){if(s)try{await this.beforeStateQueue.runMiddleware(i)}catch(e){i=n,this._popupRedirectResolver._overrideRedirectResult(this,()=>Promise.reject(e))}return i?this.reloadAndSetCurrentUserOrClear(i):this.directlySetCurrentUser(null)}return I(this._popupRedirectResolver,this,"argument-error"),await this.getOrInitRedirectPersistenceManager(),this.redirectUser&&this.redirectUser._redirectEventId===i._redirectEventId?this.directlySetCurrentUser(i):this.reloadAndSetCurrentUserOrClear(i)}async tryRedirectSignIn(e){let t=null;try{t=await this._popupRedirectResolver._completeRedirectFn(this,e,!0)}catch(e){await this._setRedirectUser(null)}return t}async reloadAndSetCurrentUserOrClear(e){try{await Q(e)}catch(e){if("auth/network-request-failed"!==(null==e?void 0:e.code))return this.directlySetCurrentUser(null)}return this.directlySetCurrentUser(e)}useDeviceLanguage(){this.languageCode=function(){if("undefined"==typeof navigator)return null;const e=navigator;return e.languages&&e.languages[0]||e.language||null}()}async _delete(){this._deleted=!0}async updateCurrentUser(e){if(Object(r._isFirebaseServerApp)(this.app))return Promise.reject(_(this));const t=e?Object(i.o)(e):null;return t&&I(t.auth.config.apiKey===this.config.apiKey,this,"invalid-user-token"),this._updateCurrentUser(t&&t._clone(this))}async _updateCurrentUser(e,t=!1){if(!this._deleted)return e&&I(this.tenantId===e.tenantId,this,"tenant-id-mismatch"),t||await this.beforeStateQueue.runMiddleware(e),this.queue(async()=>{await this.directlySetCurrentUser(e),this.notifyAuthListeners()})}async signOut(){return Object(r._isFirebaseServerApp)(this.app)?Promise.reject(_(this)):(await this.beforeStateQueue.runMiddleware(null),(this.redirectPersistenceManager||this._popupRedirectResolver)&&await this._setRedirectUser(null),this._updateCurrentUser(null,!0))}setPersistence(e){return Object(r._isFirebaseServerApp)(this.app)?Promise.reject(_(this)):this.queue(async()=>{await this.assertedPersistence.setPersistence(se(e))})}_getRecaptchaConfig(){return null==this.tenantId?this._agentRecaptchaConfig:this._tenantRecaptchaConfigs[this.tenantId]}async validatePassword(e){this._getPasswordPolicyInternal()||await this._updatePasswordPolicy();const t=this._getPasswordPolicyInternal();return t.schemaVersion!==this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION?Promise.reject(this._errorFactory.create("unsupported-password-policy-schema-version",{})):t.validatePassword(e)}_getPasswordPolicyInternal(){return null===this.tenantId?this._projectPasswordPolicy:this._tenantPasswordPolicies[this.tenantId]}async _updatePasswordPolicy(){const e=await async function(e,t={}){return L(e,"GET","/v2/passwordPolicy",D(e,t))}
1275/**
1276 * @license
1277 * Copyright 2023 Google LLC
1278 *
1279 * Licensed under the Apache License, Version 2.0 (the "License");
1280 * you may not use this file except in compliance with the License.
1281 * You may obtain a copy of the License at
1282 *
1283 *   http://www.apache.org/licenses/LICENSE-2.0
1284 *
1285 * Unless required by applicable law or agreed to in writing, software
1286 * distributed under the License is distributed on an "AS IS" BASIS,
1287 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1288 * See the License for the specific language governing permissions and
1289 * limitations under the License.
1290 */(this),t=new Te(e);null===this.tenantId?this._projectPasswordPolicy=t:this._tenantPasswordPolicies[this.tenantId]=t}_getPersistence(){return this.assertedPersistence.persistence.type}_updateErrorMap(e){this._errorFactory=new i.b("auth","Firebase",e())}onAuthStateChanged(e,t,n){return this.registerStateListener(this.authStateSubscription,e,t,n)}beforeAuthStateChanged(e,t){return this.beforeStateQueue.pushCallback(e,t)}onIdTokenChanged(e,t,n){return this.registerStateListener(this.idTokenSubscription,e,t,n)}authStateReady(){return new Promise((e,t)=>{if(this.currentUser)e();else{const n=this.onAuthStateChanged(()=>{n(),e()},t)}})}async revokeAccessToken(e){if(this.currentUser){const t={providerId:"apple.com",tokenType:"ACCESS_TOKEN",token:e,idToken:await this.currentUser.getIdToken()};null!=this.tenantId&&(t.tenantId=this.tenantId),await async function(e,t){return L(e,"POST","/v2/accounts:revokeToken",D(e,t))}(this,t)}}toJSON(){var e;return{apiKey:this.config.apiKey,authDomain:this.config.authDomain,appName:this.name,currentUser:null===(e=this._currentUser)||void 0===e?void 0:e.toJSON()}}async _setRedirectUser(e,t){const n=await this.getOrInitRedirectPersistenceManager(t);return null===e?n.removeCurrentUser():n.setCurrentUser(e)}async getOrInitRedirectPersistenceManager(e){if(!this.redirectPersistenceManager){const t=e&&se(e)||this._popupRedirectResolver;I(t,this,"argument-error"),this.redirectPersistenceManager=await ue.create(this,[se(t._redirectPersistence)],"redirectUser"),this.redirectUser=await this.redirectPersistenceManager.getCurrentUser()}return this.redirectPersistenceManager}async _redirectUserForId(e){var t,n;return this._isInitialized&&await this.queue(async()=>{}),(null===(t=this._currentUser)||void 0===t?void 0:t._redirectEventId)===e?this._currentUser:(null===(n=this.redirectUser)||void 0===n?void 0:n._redirectEventId)===e?this.redirectUser:null}async _persistUserIfCurrent(e){if(e===this.currentUser)return this.queue(async()=>this.directlySetCurrentUser(e))}_notifyListenersIfCurrent(e){e===this.currentUser&&this.notifyAuthListeners()}_key(){return`${this.config.authDomain}:${this.config.apiKey}:${this.name}`}_startProactiveRefresh(){this.isProactiveRefreshEnabled=!0,this.currentUser&&this._currentUser._startProactiveRefresh()}_stopProactiveRefresh(){this.isProactiveRefreshEnabled=!1,this.currentUser&&this._currentUser._stopProactiveRefresh()}get _currentUser(){return this.currentUser}notifyAuthListeners(){var e,t;if(!this._isInitialized)return;this.idTokenSubscription.next(this.currentUser);const n=null!==(t=null===(e=this.currentUser)||void 0===e?void 0:e.uid)&&void 0!==t?t:null;this.lastNotifiedUid!==n&&(this.lastNotifiedUid=n,this.authStateSubscription.next(this.currentUser))}registerStateListener(e,t,n,r){if(this._deleted)return()=>{};const i="function"==typeof t?t:t.next.bind(t);let s=!1;const o=this._isInitialized?Promise.resolve():this._initializationPromise;if(I(o,this,"internal-error"),o.then(()=>{s||i(this.currentUser)}),"function"==typeof t){const i=e.addObserver(t,n,r);return()=>{s=!0,i()}}{const n=e.addObserver(t);return()=>{s=!0,n()}}}async directlySetCurrentUser(e){this.currentUser&&this.currentUser!==e&&this._currentUser._stopProactiveRefresh(),e&&this.isProactiveRefreshEnabled&&e._startProactiveRefresh(),this.currentUser=e,e?await this.assertedPersistence.setCurrentUser(e):await this.assertedPersistence.removeCurrentUser()}queue(e){return this.operations=this.operations.then(e,e),this.operations}get assertedPersistence(){return I(this.persistenceManager,this,"internal-error"),this.persistenceManager}_logFramework(e){e&&!this.frameworks.includes(e)&&(this.frameworks.push(e),this.frameworks.sort(),this.clientVersion=we(this.config.clientPlatform,this._getFrameworks()))}_getFrameworks(){return this.frameworks}async _getAdditionalHeaders(){var e;const t={"X-Client-Version":this.clientVersion};this.app.options.appId&&(t["X-Firebase-gmpid"]=this.app.options.appId);const n=await(null===(e=this.heartbeatServiceProvider.getImmediate({optional:!0}))||void 0===e?void 0:e.getHeartbeatsHeader());n&&(t["X-Firebase-Client"]=n);const r=await this._getAppCheckToken();return r&&(t["X-Firebase-AppCheck"]=r),t}async _getAppCheckToken(){var e;const t=await(null===(e=this.appCheckServiceProvider.getImmediate({optional:!0}))||void 0===e?void 0:e.getToken());return(null==t?void 0:t.error)&&function(e,...t){f.logLevel<=s.a.WARN&&f.warn(`Auth (${r.SDK_VERSION}): ${e}`,...t)}("Error while retrieving App Check token: "+t.error),null==t?void 0:t.token}}function Oe(e){return Object(i.o)(e)}class ke{constructor(e){this.auth=e,this.observer=null,this.addObserver=Object(i.g)(e=>this.observer=e)}get next(){return I(this.observer,this.auth,"internal-error"),this.observer.next.bind(this.observer)}}
1291/**
1292 * @license
1293 * Copyright 2020 Google LLC
1294 *
1295 * Licensed under the Apache License, Version 2.0 (the "License");
1296 * you may not use this file except in compliance with the License.
1297 * You may obtain a copy of the License at
1298 *
1299 *   http://www.apache.org/licenses/LICENSE-2.0
1300 *
1301 * Unless required by applicable law or agreed to in writing, software
1302 * distributed under the License is distributed on an "AS IS" BASIS,
1303 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1304 * See the License for the specific language governing permissions and
1305 * limitations under the License.
1306 */let Se={async loadJS(){throw new Error("Unable to load external scripts")},recaptchaV2Script:"",recaptchaEnterpriseScript:"",gapiScript:""};function Ae(e){return Se.loadJS(e)}function Ce(e){return`__${e}${Math.floor(1e6*Math.random())}`}class Re{constructor(e){this.type="recaptcha-enterprise",this.auth=Oe(e)}async verify(e="verify",t=!1){function n(t,n,r){const i=window.grecaptcha;H(i)?i.enterprise.ready(()=>{i.enterprise.execute(t,{action:e}).then(e=>{n(e)}).catch(()=>{n("NO_RECAPTCHA")})}):r(Error("No reCAPTCHA enterprise script loaded."))}return new Promise((e,r)=>{(async function(e){if(!t){if(null==e.tenantId&&null!=e._agentRecaptchaConfig)return e._agentRecaptchaConfig.siteKey;if(null!=e.tenantId&&void 0!==e._tenantRecaptchaConfigs[e.tenantId])return e._tenantRecaptchaConfigs[e.tenantId].siteKey}return new Promise(async(t,n)=>{B(e,{clientType:"CLIENT_TYPE_WEB",version:"RECAPTCHA_ENTERPRISE"}).then(r=>{if(void 0!==r.recaptchaKey){const n=new W(r);return null==e.tenantId?e._agentRecaptchaConfig=n:e._tenantRecaptchaConfigs[e.tenantId]=n,t(n.siteKey)}n(new Error("recaptcha Enterprise site key undefined"))}).catch(e=>{n(e)})})})(this.auth).then(i=>{if(!t&&H(window.grecaptcha))n(i,e,r);else{if("undefined"==typeof window)return void r(new Error("RecaptchaVerifier is only supported in browser"));let t=Se.recaptchaEnterpriseScript;0!==t.length&&(t+=i),Ae(t).then(()=>{n(i,e,r)}).catch(e=>{r(e)})}}).catch(e=>{r(e)})})}}async function Pe(e,t,n,r=!1){const i=new Re(e);let s;try{s=await i.verify(n)}catch(e){s=await i.verify(n,!0)}const o=Object.assign({},t);return r?Object.assign(o,{captchaResp:s}):Object.assign(o,{captchaResponse:s}),Object.assign(o,{clientType:"CLIENT_TYPE_WEB"}),Object.assign(o,{recaptchaVersion:"RECAPTCHA_ENTERPRISE"}),o}async function Ne(e,t,n,r){var i;if(null===(i=e._getRecaptchaConfig())||void 0===i?void 0:i.isProviderEnabled("EMAIL_PASSWORD_PROVIDER")){const i=await Pe(e,t,n,"getOobCode"===n);return r(e,i)}return r(e,t).catch(async i=>{if("auth/missing-recaptcha-token"===i.code){console.log(n+" is protected by reCAPTCHA Enterprise for this project. Automatically triggering the reCAPTCHA flow and restarting the flow.");const i=await Pe(e,t,n,"getOobCode"===n);return r(e,i)}return Promise.reject(i)})}function De(e,t,n){const r=Oe(e);I(r._canInitEmulator,r,"emulator-config-failed"),I(/^https?:\/\//.test(t),r,"invalid-emulator-scheme");const i=!!(null==n?void 0:n.disableWarnings),s=Le(t),{host:o,port:a}=function(e){const t=Le(e),n=/(\/\/)?([^?#/]+)/.exec(e.substr(t.length));if(!n)return{host:"",port:null};const r=n[2].split("@").pop()||"",i=/^(\[[^\]]+\])(:|$)/.exec(r);if(i){const e=i[1];return{host:e,port:je(r.substr(e.length+1))}}{const[e,t]=r.split(":");return{host:e,port:je(t)}}}(t),c=null===a?"":":"+a;r.config.emulator={url:`${s}//${o}${c}/`},r.settings.appVerificationDisabledForTesting=!0,r.emulatorConfig=Object.freeze({host:o,port:a,protocol:s.replace(":",""),options:Object.freeze({disableWarnings:i})}),i||function(){function e(){const e=document.createElement("p"),t=e.style;e.innerText="Running in emulator mode. Do not use with production credentials.",t.position="fixed",t.width="100%",t.backgroundColor="#ffffff",t.border=".1em solid #000000",t.color="#b50000",t.bottom="0px",t.left="0px",t.margin="0px",t.zIndex="10000",t.textAlign="center",e.classList.add("firebase-emulator-warning"),document.body.appendChild(e)}"undefined"!=typeof console&&"function"==typeof console.info&&console.info("WARNING: You are using the Auth Emulator, which is intended for local testing only.  Do not use with production credentials.");"undefined"!=typeof window&&"undefined"!=typeof document&&("loading"===document.readyState?window.addEventListener("DOMContentLoaded",e):e())}
1307/**
1308 * @license
1309 * Copyright 2020 Google LLC
1310 *
1311 * Licensed under the Apache License, Version 2.0 (the "License");
1312 * you may not use this file except in compliance with the License.
1313 * You may obtain a copy of the License at
1314 *
1315 *   http://www.apache.org/licenses/LICENSE-2.0
1316 *
1317 * Unless required by applicable law or agreed to in writing, software
1318 * distributed under the License is distributed on an "AS IS" BASIS,
1319 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1320 * See the License for the specific language governing permissions and
1321 * limitations under the License.
1322 */()}function Le(e){const t=e.indexOf(":");return t<0?"":e.substr(0,t+1)}function je(e){if(!e)return null;const t=Number(e);return isNaN(t)?null:t}class Ue{constructor(e,t){this.providerId=e,this.signInMethod=t}toJSON(){return T("not implemented")}_getIdTokenResponse(e){return T("not implemented")}_linkToIdToken(e,t){return T("not implemented")}_getReauthenticationResolver(e){return T("not implemented")}}
1323/**
1324 * @license
1325 * Copyright 2020 Google LLC
1326 *
1327 * Licensed under the Apache License, Version 2.0 (the "License");
1328 * you may not use this file except in compliance with the License.
1329 * You may obtain a copy of the License at
1330 *
1331 *   http://www.apache.org/licenses/LICENSE-2.0
1332 *
1333 * Unless required by applicable law or agreed to in writing, software
1334 * distributed under the License is distributed on an "AS IS" BASIS,
1335 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1336 * See the License for the specific language governing permissions and
1337 * limitations under the License.
1338 */async function Me(e,t){return L(e,"POST","/v1/accounts:resetPassword",D(e,t))}async function Fe(e,t){return L(e,"POST","/v1/accounts:signUp",t)}
1339/**
1340 * @license
1341 * Copyright 2020 Google LLC
1342 *
1343 * Licensed under the Apache License, Version 2.0 (the "License");
1344 * you may not use this file except in compliance with the License.
1345 * You may obtain a copy of the License at
1346 *
1347 *   http://www.apache.org/licenses/LICENSE-2.0
1348 *
1349 * Unless required by applicable law or agreed to in writing, software
1350 * distributed under the License is distributed on an "AS IS" BASIS,
1351 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1352 * See the License for the specific language governing permissions and
1353 * limitations under the License.
1354 */
1355async function xe(e,t){return U(e,"POST","/v1/accounts:signInWithPassword",D(e,t))}async function Ve(e,t){return L(e,"POST","/v1/accounts:sendOobCode",D(e,t))}async function ze(e,t){return Ve(e,t)}async function He(e,t){return Ve(e,t)}
1356/**
1357 * @license
1358 * Copyright 2020 Google LLC
1359 *
1360 * Licensed under the Apache License, Version 2.0 (the "License");
1361 * you may not use this file except in compliance with the License.
1362 * You may obtain a copy of the License at
1363 *
1364 *   http://www.apache.org/licenses/LICENSE-2.0
1365 *
1366 * Unless required by applicable law or agreed to in writing, software
1367 * distributed under the License is distributed on an "AS IS" BASIS,
1368 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1369 * See the License for the specific language governing permissions and
1370 * limitations under the License.
1371 */
1372class We extends Ue{constructor(e,t,n,r=null){super("password",n),this._email=e,this._password=t,this._tenantId=r}static _fromEmailAndPassword(e,t){return new We(e,t,"password")}static _fromEmailAndCode(e,t,n=null){return new We(e,t,"emailLink",n)}toJSON(){return{email:this._email,password:this._password,signInMethod:this.signInMethod,tenantId:this._tenantId}}static fromJSON(e){const t="string"==typeof e?JSON.parse(e):e;if((null==t?void 0:t.email)&&(null==t?void 0:t.password)){if("password"===t.signInMethod)return this._fromEmailAndPassword(t.email,t.password);if("emailLink"===t.signInMethod)return this._fromEmailAndCode(t.email,t.password,t.tenantId)}return null}async _getIdTokenResponse(e){switch(this.signInMethod){case"password":return Ne(e,{returnSecureToken:!0,email:this._email,password:this._password,clientType:"CLIENT_TYPE_WEB"},"signInWithPassword",xe);case"emailLink":
1373/**
1374 * @license
1375 * Copyright 2020 Google LLC
1376 *
1377 * Licensed under the Apache License, Version 2.0 (the "License");
1378 * you may not use this file except in compliance with the License.
1379 * You may obtain a copy of the License at
1380 *
1381 *   http://www.apache.org/licenses/LICENSE-2.0
1382 *
1383 * Unless required by applicable law or agreed to in writing, software
1384 * distributed under the License is distributed on an "AS IS" BASIS,
1385 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1386 * See the License for the specific language governing permissions and
1387 * limitations under the License.
1388 */
1389return async function(e,t){return U(e,"POST","/v1/accounts:signInWithEmailLink",D(e,t))}(e,{email:this._email,oobCode:this._password});default:g(e,"internal-error")}}async _linkToIdToken(e,t){switch(this.signInMethod){case"password":return Ne(e,{idToken:t,returnSecureToken:!0,email:this._email,password:this._password,clientType:"CLIENT_TYPE_WEB"},"signUpPassword",Fe);case"emailLink":return async function(e,t){return U(e,"POST","/v1/accounts:signInWithEmailLink",D(e,t))}(e,{idToken:t,email:this._email,oobCode:this._password});default:g(e,"internal-error")}}_getReauthenticationResolver(e){return this._getIdTokenResponse(e)}}
1390/**
1391 * @license
1392 * Copyright 2020 Google LLC
1393 *
1394 * Licensed under the Apache License, Version 2.0 (the "License");
1395 * you may not use this file except in compliance with the License.
1396 * You may obtain a copy of the License at
1397 *
1398 *   http://www.apache.org/licenses/LICENSE-2.0
1399 *
1400 * Unless required by applicable law or agreed to in writing, software
1401 * distributed under the License is distributed on an "AS IS" BASIS,
1402 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1403 * See the License for the specific language governing permissions and
1404 * limitations under the License.
1405 */async function Be(e,t){return U(e,"POST","/v1/accounts:signInWithIdp",D(e,t))}
1406/**
1407 * @license
1408 * Copyright 2020 Google LLC
1409 *
1410 * Licensed under the Apache License, Version 2.0 (the "License");
1411 * you may not use this file except in compliance with the License.
1412 * You may obtain a copy of the License at
1413 *
1414 *   http://www.apache.org/licenses/LICENSE-2.0
1415 *
1416 * Unless required by applicable law or agreed to in writing, software
1417 * distributed under the License is distributed on an "AS IS" BASIS,
1418 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1419 * See the License for the specific language governing permissions and
1420 * limitations under the License.
1421 */class qe extends Ue{constructor(){super(...arguments),this.pendingToken=null}static _fromParams(e){const t=new qe(e.providerId,e.signInMethod);return e.idToken||e.accessToken?(e.idToken&&(t.idToken=e.idToken),e.accessToken&&(t.accessToken=e.accessToken),e.nonce&&!e.pendingToken&&(t.nonce=e.nonce),e.pendingToken&&(t.pendingToken=e.pendingToken)):e.oauthToken&&e.oauthTokenSecret?(t.accessToken=e.oauthToken,t.secret=e.oauthTokenSecret):g("argument-error"),t}toJSON(){return{idToken:this.idToken,accessToken:this.accessToken,secret:this.secret,n
1421once:this.nonce,pendingToken:this.pendingToken,providerId:this.providerId,signInMethod:this.signInMethod}}static fromJSON(e){const t="string"==typeof e?JSON.parse(e):e,{providerId:n,signInMethod:r}=t,i=Object(o.b)(t,["providerId","signInMethod"]);if(!n||!r)return null;const s=new qe(n,r);return s.idToken=i.idToken||void 0,s.accessToken=i.accessToken||void 0,s.secret=i.secret,s.nonce=i.nonce,s.pendingToken=i.pendingToken||null,s}_getIdTokenResponse(e){return Be(e,this.buildRequest())}_linkToIdToken(e,t){const n=this.buildRequest();return n.idToken=t,Be(e,n)}_getReauthenticationResolver(e){const t=this.buildRequest();return t.autoCreate=!1,Be(e,t)}buildRequest(){const e={requestUri:"http://localhost",returnSecureToken:!0};if(this.pendingToken)e.pendingToken=this.pendingToken;else{const t={};this.idToken&&(t.id_token=this.idToken),this.accessToken&&(t.access_token=this.accessToken),this.secret&&(t.oauth_token_secret=this.secret),t.providerId=this.providerId,this.nonce&&!this.pendingToken&&(t.nonce=this.nonce),e.postBody=Object(i.A)(t)}return e}}
1422/**
1423 * @license
1424 * Copyright 2020 Google LLC
1425 *
1426 * Licensed under the Apache License, Version 2.0 (the "License");
1427 * you may not use this file except in compliance with the License.
1428 * You may obtain a copy of the License at
1429 *
1430 *   http://www.apache.org/licenses/LICENSE-2.0
1431 *
1432 * Unless required by applicable law or agreed to in writing, software
1433 * distributed under the License is distributed on an "AS IS" BASIS,
1434 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1435 * See the License for the specific language governing permissions and
1436 * limitations under the License.
1437 */const Ge={USER_NOT_FOUND:"user-not-found"};
1438/**
1439 * @license
1440 * Copyright 2020 Google LLC
1441 *
1442 * Licensed under the Apache License, Version 2.0 (the "License");
1443 * you may not use this file except in compliance with the License.
1444 * You may obtain a copy of the License at
1445 *
1446 *   http://www.apache.org/licenses/LICENSE-2.0
1447 *
1448 * Unless required by applicable law or agreed to in writing, software
1449 * distributed under the License is distributed on an "AS IS" BASIS,
1450 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1451 * See the License for the specific language governing permissions and
1452 * limitations under the License.
1453 */
1454class $e extends Ue{constructor(e){super("phone","phone"),this.params=e}static _fromVerification(e,t){return new $e({verificationId:e,verificationCode:t})}static _fromTokenResponse(e,t){return new $e({phoneNumber:e,temporaryProof:t})}_getIdTokenResponse(e){return async function(e,t){return U(e,"POST","/v1/accounts:signInWithPhoneNumber",D(e,t))}(e,this._makeVerificationRequest())}_linkToIdToken(e,t){return async function(e,t){const n=await U(e,"POST","/v1/accounts:signInWithPhoneNumber",D(e,t));if(n.temporaryProof)throw V(e,"account-exists-with-different-credential",n);return n}(e,Object.assign({idToken:t},this._makeVerificationRequest()))}_getReauthenticationResolver(e){return async function(e,t){return U(e,"POST","/v1/accounts:signInWithPhoneNumber",D(e,Object.assign(Object.assign({},t),{operation:"REAUTH"})),Ge)}(e,this._makeVerificationRequest())}_makeVerificationRequest(){const{temporaryProof:e,phoneNumber:t,verificationId:n,verificationCode:r}=this.params;return e&&t?{temporaryProof:e,phoneNumber:t}:{sessionInfo:n,code:r}}toJSON(){const e={providerId:this.providerId};return this.params.phoneNumber&&(e.phoneNumber=this.params.phoneNumber),this.params.temporaryProof&&(e.temporaryProof=this.params.temporaryProof),this.params.verificationCode&&(e.verificationCode=this.params.verificationCode),this.params.verificationId&&(e.verificationId=this.params.verificationId),e}static fromJSON(e){"string"==typeof e&&(e=JSON.parse(e));const{verificationId:t,verificationCode:n,phoneNumber:r,temporaryProof:i}=e;return n||t||r||i?new $e({verificationId:t,verificationCode:n,phoneNumber:r,temporaryProof:i}):null}}
1455/**
1456 * @license
1457 * Copyright 2020 Google LLC
1458 *
1459 * Licensed under the Apache License, Version 2.0 (the "License");
1460 * you may not use this file except in compliance with the License.
1461 * You may obtain a copy of the License at
1462 *
1463 *   http://www.apache.org/licenses/LICENSE-2.0
1464 *
1465 * Unless required by applicable law or agreed to in writing, softw
1465are
1466 * distributed under the License is distributed on an "AS IS" BASIS,
1467 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1468 * See the License for the specific language governing permissions and
1469 * limitations under the License.
1470 */class Ke{constructor(e){var t,n,r,s,o,a;const c=Object(i.B)(Object(i.j)(e)),u=null!==(t=c.apiKey)&&void 0!==t?t:null,d=null!==(n=c.oobCode)&&void 0!==n?n:null,l=function(e){switch(e){case"recoverEmail":return"RECOVER_EMAIL";case"resetPassword":return"PASSWORD_RESET";case"signIn":return"EMAIL_SIGNIN";case"verifyEmail":return"VERIFY_EMAIL";case"verifyAndChangeEmail":return"VERIFY_AND_CHANGE_EMAIL";case"revertSecondFactorAddition":return"REVERT_SECOND_FACTOR_ADDITION";default:return null}}(null!==(r=c.mode)&&void 0!==r?r:null);I(u&&d&&l,"argument-error"),this.apiKey=u,this.operation=l,this.code=d,this.continueUrl=null!==(s=c.continueUrl)&&void 0!==s?s:null,this.languageCode=null!==(o=c.languageCode)&&void 0!==o?o:null,this.tenantId=null!==(a=c.tenantId)&&void 0!==a?a:null}static parseLink(e){const t=function(e){const t=Object(i.B)(Object(i.j)(e)).link,n=t?Object(i.B)(Object(i.j)(t)).deep_link_id:null,r=Object(i.B)(Object(i.j)(e)).deep_link_id;return(r?Object(i.B)(Object(i.j)(r)).link:null)||r||n||t||e}(e);try{return new Ke(t)}catch(e){return null}}}
1471/**
1472 * @license
1473 * Copyright 2020 Google LLC
1474 *
1475 * Licensed under the Apache License, Version 2.0 (the "License");
1476 * you may not use this file except in compliance with the License.
1477 * You may obtain a copy of the License at
1478 *
1479 *   http://www.apache.org/licenses/LICENSE-2.0
1480 *
1481 * Unless required by applicable law or agreed to in writing, software
1482 * distributed under the License is distributed on an "AS IS" BASIS,
1483 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1484 * See the License for the specific language governing permissions and
1485 * limitations under the License.
1486 */
1487class Je{constructor(){this.providerId=Je.PROVIDER_ID}static credential(e,t){return We._fromEmailAndPassword(e,t)}static credentialWithLink(e,t){const n=Ke.parseLink(t);return I(n,"argument-error"),We._fromEmailAndCode(e,n.code,n.tenantId)}}Je.PROVIDER_ID="password",Je.EMAIL_PASSWORD_SIGN_IN_METHOD="password",Je.EMAIL_LINK_SIGN_IN_METHOD="emailLink";
1488/**
1489 * @license
1490 * Copyright 2020 Google LLC
1491 *
1492 * Licensed under the Apache License, Version 2.0 (the "License");
1493 * you may not use this file except in compliance with the License.
1494 * You may obtain a copy of the License at
1495 *
1496 *   http://www.apache.org/licenses/LICENSE-2.0
1497 *
1498 * Unless required by applicable law or agreed to in writing, software
1499 * distributed under the License is distributed on an "AS IS" BASIS,
1500 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1501 * See the License for the specific language governing permissions and
1502 * limitations under the License.
1503 */
1504class Ye{constructor(e){this.providerId=e,this.defaultLanguageCode=null,this.customParameters={}}setDefaultLanguage(e){this.defaultLanguageCode=e}setCustomParameters(e){return this.customParameters=e,this}getCustomParameters(){return this.customParameters}}
1505/**
1506 * @license
1507 * Copyright 2019 Google LLC
1508 *
1509 * Licensed under the Apache License, Version 2.0 (the "License");
1510 * you may not use this file except in compliance with the License.
1511 * You may obtain a copy of the License at
1512 *
1513 *   http://www.apache.org/licenses/LICENSE-2.0
1514 *
1515 * Unless required by applicable law or agreed to in writing, software
1516 * distributed under the License is distributed on an "AS IS" BASIS,
1517 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1518 * See the License for the specific language governing permissions and
1519 * limitations under the License.
1520 */class Xe extends Ye{constructor(){super(...arguments),this.scopes=[]}addScope(e){return this.scopes.includes(e)||this.scopes.push(e),this}getScopes(){return[...this.scopes]}}class Ze extends Xe{static credentialFromJSON(e){const t="string"==typeof e?JSON.parse(e):e;return I("providerId"in t&&"signInMethod"in t,"argument-error"),qe._fromParams(t)}credential(e){return this._credential(Object.assign(Object.assign({},e),{nonce:e.rawNonce}))}_credential(e){return I(e.idToken||e.accessToken,"argument-error"),qe._fromParams(Object.assign(Object.assign({}
vendor: 5,021 bytes, lines 1520-1575
1520,e),{providerId:this.providerId,signInMethod:this.providerId}))}static credentialFromResult(e){return Ze.oauthCredentialFromTaggedObject(e)}static credentialFromError(e){return Ze.oauthCredentialFromTaggedObject(e.customData||{})}static oauthCredentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{oauthIdToken:t,oauthAccessToken:n,oauthTokenSecret:r,pendingToken:i,nonce:s,providerId:o}=e;if(!(n||r||t||i))return null;if(!o)return null;try{return new Ze(o)._credential({idToken:t,accessToken:n,nonce:s,pendingToken:i})}catch(e){return null}}}
1521/**
1522 * @license
1523 * Copyright 2020 Google LLC
1524 *
1525 * Licensed under the Apache License, Version 2.0 (the "License");
1526 * you may not use this file except in compliance with the License.
1527 * You may obtain a copy of the License at
1528 *
1529 *   http://www.apache.org/licenses/LICENSE-2.0
1530 *
1531 * Unless required by applicable law or agreed to in writing, software
1532 * distributed under the License is distributed on an "AS IS" BASIS,
1533 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1534 * See the License for the specific language governing permissions and
1535 * limitations under the License.
1536 */class Qe extends Xe{constructor(){super("facebook.com")}static credential(e){return qe._fromParams({providerId:Qe.PROVIDER_ID,signInMethod:Qe.FACEBOOK_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return Qe.credentialFromTaggedObject(e)}static credentialFromError(e){return Qe.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!("oauthAccessToken"in e))return null;if(!e.oauthAccessToken)return null;try{return Qe.credential(e.oauthAccessToken)}catch(e){return null}}}Qe.FACEBOOK_SIGN_IN_METHOD="facebook.com",Qe.PROVIDER_ID="facebook.com";
1537/**
1538 * @license
1539 * Copyright 2020 Google LLC
1540 *
1541 * Licensed under the Apache License, Version 2.0 (the "License");
1542 * you may not use this file except in compliance with the License.
1543 * You may obtain a copy of the License at
1544 *
1545 *   http://www.apache.org/licenses/LICENSE-2.0
1546 *
1547 * Unless required by applicable law or agreed to in writing, software
1548 * distributed under the License is distributed on an "AS IS" BASIS,
1549 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1550 * See the License for the specific language governing permissions and
1551 * limitations under the License.
1552 */
1553class et extends Xe{constructor(){super("google.com"),this.addScope("profile")}static credential(e,t){return qe._fromParams({providerId:et.PROVIDER_ID,signInMethod:et.GOOGLE_SIGN_IN_METHOD,idToken:e,accessToken:t})}static credentialFromResult(e){return et.credentialFromTaggedObject(e)}static credentialFromError(e){return et.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{oauthIdToken:t,oauthAccessToken:n}=e;if(!t&&!n)return null;try{return et.credential(t,n)}catch(e){return null}}}et.GOOGLE_SIGN_IN_METHOD="google.com",et.PROVIDER_ID="google.com";
1554/**
1555 * @license
1556 * Copyright 2020 Google LLC
1557 *
1558 * Licensed under the Apache License, Version 2.0 (the "License");
1559 * you may not use this file except in compliance with the License.
1560 * You may obtain a copy of the License at
1561 *
1562 *   http://www.apache.org/licenses/LICENSE-2.0
1563 *
1564 * Unless required by applicable law or agreed to in writing, software
1565 * distributed under the License is distributed on an "AS IS" BASIS,
1566 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1567 * See the License for the specific language governing permissions and
1568 * limitations under the License.
1569 */
1570class tt extends Xe{constructor(){super("github.com")}static credential(e){return qe._fromParams({providerId:tt.PROVIDER_ID,signInMethod:tt.GITHUB_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return tt.credentialFromTaggedObject(e)}static credentialFromError(e){return tt.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!("oauthAccessToken"in e))return null;if(!e.oauthAccessToken)return null;try{return tt.credential(e.oauthAccessToken)}catch(e){return null}}}tt.GITHUB_SIGN_IN_METHOD="github.com",tt.PROVIDER_ID="github.com";class nt extends Ue{constructor(e,t){super(e,e),this.pendingToken=t}_getIdTokenResponse(e){return Be(e,this.buildRequest())}_linkToIdToken(e,t){const n=this.buildRequest();return n.idToken=t,Be(e,n)}_getReauthenticationResolver(e){const t=this.buildRequest();return t.autoCreate=!1,Be(e,t)}toJSON(){return{signInMethod:this.signInMethod,providerId:this.providerId,pendingToken:this.pendingToken}}static fromJSON(e){const t="string"==typeof e?JSON.parse(e):e,{providerId:n,signInMethod:r,pendingToken:i}=t;return n&&r&&i&&n===r?new nt(n,i):null}static _create(e,t){return new nt(e,t)}buildRequest(){return{requestUri:"http://localhost",returnSecureToken:!0,pendingToken:this.pendingToken}}}
1571/**
1572 * @license
1573 * Copyright 2020 Google LLC
1574 *
1575 * Licensed under the Apache License, Version 2.0 (the "License");
1576 * you may not use this file except in compliance with the License.
1577 * You may obtain a copy of the License at
1578 *
1579 *   http://www.apache.org/licenses/LICENSE-2.0
1580 *
1581 * Unless required by applicable law or agreed to in writing, software
1582 * distributed under the License is distributed on an "AS IS" BASIS,
1583 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1584 * See the License for the specific language governing permissions and
1585 * limitations under the License.
1586 */class rt extends Ye{constructor(e){I(e.startsWith("saml."),"argument-error"),super(e)}static credentialFromResult(e){return rt.samlCredentialFromTaggedObject(e)}static credentialFromError(e){return rt.samlCredentialFromTaggedObject(e.customData||{})}static credentialFromJSON(e){const t=nt.fromJSON(e);return I(t,"argument-error"),t}static samlCredentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{pendingToken:t,providerId:n}=e;if(!t||!n)return null;try{return nt._create(n,t)}catch(e){return null}}}
1587/**
1588 * @license
1589 * Copyright 2020 Google LLC
1590 *
1591 * Licensed under the Apache License, Version 2.0 (the "License");
1592 * you may not use this file except in compliance with the License.
1593 * You may obtain a copy of the License at
1594 *
1595 *   http://www.apache.org/licenses/LICENSE-2.0
1596 *
1597 * Unless required by applicable law or agreed to in writing, software
1598 * distributed under the License is distributed on an "AS IS" BASIS,
1599 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1600 * See the License for the specific language governing permissions and
1601 * limitations under the License.
1602 */class it extends Xe{constructor(){super("twitter.com")}static credential(e,t){return qe._fromParams({providerId:it.PROVIDER_ID,signInMethod:it.TWITTER_SIGN_IN_METHOD,oauthToken:e,oauthTokenSecret:t})}static credentialFromResult(e){return it.credentialFromTaggedObject(e)}static credentialFromError(e){return it.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{oauthAccessToken:t,oauthTokenSecret:n}=e;if(!t||!n)return null;try{return it.credential(t,n)}catch(e){return null}}}
1603/**
1604 * @license
1605 * Copyright 2020 Google LLC
1606 *
1607 * Licensed under the Apache License, Version 2.0 (the "License");
1608 * you may not use this file except in compliance with the License.
1609 * You may obtain a copy of the License at
1610 *
1611 *   http://www.apache.org/licenses/LICENSE-2.0
1612 *
1613 * Unless required by applicable law or agreed to in writing, software
1614 * distributed under the License is distributed on an "AS IS" BASIS,
1615 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1616 * See the License for the specific language governing permissions and
1617 * limitations under the License.
1618 */
1619async function st(e,t){return U(e,"POST","/v1/accounts:signUp",D(e,t))}
1620/**
1621 * @license
1622 * Copyright 2020 Google LLC
1623 *
1624 * Licensed under the Apache License, Version 2.0 (the "License");
1625 * you may not use this file except in compliance with the License.
1626 * You may obtain a copy of the License at
1627 *
1628 *   http://www.apache.org/licenses/LICENSE-2.0
1629 *
1630 * Unless required by applicable law or agreed to in writing, software
1631 * distributed under the License is distributed on an "AS IS" BASIS,
1632 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1633 * See the License for the specific language governing permissions and
1634 * limitations under the License.
1635 */it.TWITTER_SIGN_IN_METHOD="twitter.com",it.PROVIDER_ID="twitter.com";class ot{constructor(e){this.user=e.user,this.providerId=e.providerId,this._tokenResponse=e._tokenResponse,this.operationType=e.operationType}static async _fromIdTokenResponse(e,t,n,r=!1){const i=await re._fromIdTokenResponse(e,n,r),s=at(n);return new ot({user:i,providerId:s,_tokenResponse:n,operationType:t})}static async _forOperation(e,t,n){await e._updateTokensIfNecessary(n,!0);const r=at(n);return new ot({user:e,providerId:r,_tokenResponse:n,operationType:t})}}function at(e){return e.providerId?e.providerId:"phoneNumber"in e?"phone":null}
1636/**
1637 * @license
1638 * Copyright 2020 Google LLC
1639 *
1640 * Licensed under the Apache License, Version 2.0 (the "License");
1641 * you may not use this file except in compliance with the License.
1642 * You may obtain a copy of the License at
1643 *
1644 *   http://www.apache.org/licenses/LICENSE-2.0
1645 *
1646 * Unless required by applicable law or agreed to in writing, software
1647 * distributed under the License is distributed on an "AS IS" BASIS,
1648 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1649 * See the License for the specific language governing permissions and
1650 * limitations under the License.
1651 */async function ct(e){var t;if(Object(r._isFirebaseServerApp)(e.app))return Promise.reject(_(e));const n=Oe(e);if(await n._initializationPromise,null===(t=n.currentUser)||void 0===t?void 0:t.isAnonymous)return new ot({user:n.currentUser,providerId:null,operationType:"signIn"});const i=await st(n,{returnSecureToken:!0}),s=await ot._fromIdTokenResponse(n,"signIn",i,!0);return await n._updateCurrentUser(s.user),s}
1652/**
1653 * @license
1654 * Copyright 2020 Google LLC
1655 *
1656 * Licensed under the Apache License, Version 2.0 (the "License");
1657 * you may not use this file except in compliance with the License.
1658 * You may obtain a copy of the License at
1659 *
1660 *   http://www.apache.org/licenses/LICENSE-2.0
1661 *
1662 * Unless required by applicable law or agreed to in writing, software
1663 * distributed under the License is distributed on an "AS IS" BASIS,
1664 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1665 * See the License for the specific language governing permissions and
1666 * limitations under the License.
1667 */class ut extends i.c{constructor(e,t,n,r){var i;super(t.code,t.message),this.operationType=n,this.user=r,Object.setPrototypeOf(this,ut.prototype),this.customData={appName:e.name,tenantId:null!==(i=e.tenantId)&&void 0!==i?i:void 0,_serverResponse:t.customData._serverResponse,operationType:n}}static _fromErrorAndOperation(e,t,n,r){return new ut(e,t,n,r)}}function dt(e,t,n,r){return("reauthenticate"===t?n._getReauthenticationResolver(e):n._getIdTokenResponse(e)).catch(n=>{if("auth/multi-factor-auth-required"===n.code)throw ut._fromErrorAndOperation(e,n,t,r);throw n})}
1668/**
1669 * @license
1670 * Copyright 2020 Google LLC
1671 *
1672 * Licensed under the Apache License, Version 2.0 (the "License");
1673 * you may not use this file except in compliance with the License.
1674 * You may obtain a copy of the License at
1675 *
1676 *   http://www.apache.org/licenses/LICENSE-2.0
1677 *
1678 * Unless required by applicable law or agreed to in writing, software
1679 * distributed under the License is distributed on an "AS IS" BASIS,
1680 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1681 * See the License for the specific language governing permissions and
1682 * limitations under the License.
1683 */function lt(e){return new Set(e.map(({providerId:e})=>e).filter(e=>!!e))}
1684/**
1685 * @license
1686 * Copyright 2019 Google LLC
1687 *
1688 * Licensed under the Apache License, Version 2.0 (the "License");
1689 * you may not use this file except in compliance with the License.
1690 * You may obtain a copy of the License at
1691 *
1692 *   http://www.apache.org/licenses/LICENSE-2.0
1693 *
1694 * Unless required by applicable law or agreed to in writing, software
1695 * distributed under the License is distributed on an "AS IS" BASIS,
1696 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1697 * See the License for the specific language governing permissions and
1698 * limitations under the License.
1699 */async function ht(e,t){const n=Object(i.o)(e);await ft(!0,n,t);const{providerUserInfo:r}=await async function(e,t){return L(e,"POST","/v1/accounts:update",t)}(n.auth,{idToken:await n.getIdToken(),deleteProvider:[t]}),s=lt(r||[]);return n.providerData=n.providerData.filter(e=>s.has(e.providerId)),s.has("phone")||(n.phoneNumber=null),await n.auth._persistUserIfCurrent(n),n}async function pt(e,t,n=!1){const r=await Y(e,t._linkToIdToken(e.auth,await e.getIdToken()),n);return ot._forOperation(e,"link",r)}async function ft(e,t,n){await Q(t);const r=!1===e?"provider-already-linked":"no-such-provider";I(lt(t.providerData).has(n)===e,t.auth,r)}
1700/**
1701 * @license
1702 * Copyright 2019 Google LLC
1703 *
1704 * Licensed under the Apache License, Version 2.0 (the "License");
1705 * you may not use this file except in compliance with the License.
1706 * You may obtain a copy of the License at
1707 *
1708 *   http://www.apache.org/licenses/LICENSE-2.0
1709 *
1710 * Unless required by applicable law or agreed to in writing, software
1711 * distributed under the License is distributed on an "AS IS" BASIS,
1712 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1713 * See the License for the specific language governing permissions and
1714 * limitations under the License.
1715 */async function mt(e,t,n=!1){const{auth:i}=e;if(Object(r._isFirebaseServerApp)(i.app))return Promise.reject(_(i));try{const r=await Y(e,dt(i,"reauthenticate",t,e),n);I(r.idToken,i,"internal-error");const s=K(r.idToken);I(s,i,"internal-error");const{sub:o}=s;return I(e.uid===o,i,"user-mismatch"),ot._forOperation(e,"reauthenticate",r)}catch(e){throw"auth/user-not-found"===(null==e?void 0:e.code)&&g(i,"user-mismatch"),e}}
1716/**
1717 * @license
1718 * Copyright 2020 Google LLC
1719 *
1720 * Licensed under the Apache License, Version 2.0 (the "License");
1721 * you may not use this file except in compliance with the License.
1722 * You may obtain a copy of the License at
1723 *
1724 *   http://www.apache.org/licenses/LICENSE-2.0
1725 *
1726 * Unless required by applicable law or agreed to in writing, software
1727 * distributed under the License is distributed on an "AS IS" BASIS,
1728 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1729 * See the License for the specific language governing permissions and
1730 * limitations under the License.
1731 */async function gt(e,t,n=!1){if(Object(r._isFirebaseServerApp)(e.app))return Promise.reject(_(e));const i=await dt(e,"signIn",t),s=await ot._fromIdTokenResponse(e,"signIn",i);return n||await e._updateCurrentUser(s.user),s}async function vt(e,t){return gt(Oe(e),t)}async function bt(e,t){const n=Object(i.o)(e);return await ft(!1,n,t.providerId),pt(n,t)}async function _t(e,t){return mt(Object(i.o)(e),t)}
1732/**
1733 * @license
1734 * Copyright 2020 Google LLC
1735 *
1736 * Licensed under the Apache License, Version 2.0 (the "License");
1737 * you may not use this file except in compliance with the License.
1738 * You may obtain a copy of the License at
1739 *
1740 *   http://www.apache.org/licenses/LICENSE-2.0
1741 *
1742 * Unless required by applicable law or agreed to in writing, software
1743 * distributed under the License is distributed on an "AS IS" BASIS,
1744 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1745 * See the License for the specific language governing permissions and
1746 * limitations under the License.
1747 */
1748/**
1749 * @license
1750 * Copyright 2020 Google LLC
1751 *
1752 * Licensed under the Apache License, Version 2.0 (the "License");
1753 * you may not use this file except in compliance with the License.
1754 * You may obtain a copy of the License at
1755 *
1756 *   http://www.apache.org/licenses/LICENSE-2.0
1757 *
1758 * Unless required by applicable law or agreed to in writing, software
1759 * distributed under the License is distributed on an "AS IS" BASIS,
1760 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1761 * See the License for the specific language governing permissions and
1762 * limitations under the License.
1763 */
1764async function yt(e,t){if(Object(r._isFirebaseServerApp)(e.app))return Promise.reject(_(e));const n=Oe(e),i=await async function(e,t){return U(e,"POST","/v1/accounts:signInWithCustomToken",D(e,t))}(n,{token:t,returnSecureToken:!0}),s=await ot._fromIdTokenResponse(n,"signIn",i);return await n._updateCurrentUser(s.user),s}
1765/**
1766 * @license
1767 * Copyright 2020 Google LLC
1768 *
1769 * Licensed under the Apache License, Version 2.0 (the "License");
1770 * you may not use this file except in compliance with the License.
1771 * You may obtain a copy of the License at
1772 *
1773 *   http://www.apache.org/licenses/LICENSE-2.0
1774 *
1775 * Unless required by applicable law or agreed to in writing, software
1776 * distributed under the License is distributed on an "AS IS" BASIS,
1777 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1778 * See the License for the specific language governing permissions and
1779 * limitations under the License.
1780 */class wt{constructor(e,t){this.factorId=e,this.uid=t.mfaEnrollmentId,this.enrollmentTime=new Date(t.enrolledAt).toUTCString(),this.displayName=t.displayName}static _fromServerResponse(e,t){return"phoneInfo"in t?It._fromServerResponse(e,t):"totpInfo"in t?Tt._fromServerResponse(e,t):g(e,"internal-error")}}class It extends wt{constructor(e){super("phone",e),this.phoneNumber=e.phoneInfo}static _fromServerResponse(e,t){return new It(t)}}class Tt extends wt{constructor(e){super("totp",e)}static _fromServerResponse(e,t){return new Tt(t)}}
1781/**
1782 * @license
1783 * Copyright 2020 Google LLC
1784 *
1785 * Licensed under the Apache License, Version 2.0 (the "License");
1786 * you may not use this file except in compliance with the License.
1787 * You may obtain a copy of the License at
1788 *
1789 *   http://www.apache.org/licenses/LICENSE-2.0
1790 *
1791 * Unless required by applicable law or agreed to in writing, software
1792 * distributed under the License is distributed on an "AS IS" BASIS,
1793 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1794 * See the License for the specific language governing permissions and
1795 * limitations under the License.
1796 */function Et(e,t,n){var r;I((null===(r=n.url)||void 0===r?void 0:r.length)>0,e,"invalid-continue-uri"),I(void 0===n.dynamicLinkDomain||n.dynamicLinkDomain.length>0,e,"invalid-dynamic-link-domain"),t.continueUrl=n.url,t.dynamicLinkDomain=n.dynamicLinkDomain,t.canHandleCodeInApp=n.handleCodeInApp,n.iOS&&(I(n.iOS.bundleId.length>0,e,"missing-ios-bundle-id"),t.iOSBundleId=n.iOS.bundleId),n.android&&(I(n.android.packageName.length>0,e,"missing-android-pkg-name"),t.androidInstallApp=n.android.installApp,t.androidMinimumVersionCode=n.android.minimumVersion,t.androidPackageName=n.android.packageName)}
1797/**
1798 * @license
1799 * Copyright 2020 Google LLC
1800 *
1801 * Licensed under the Apache License, Version 2.0 (the "License");
1802 * you may not use this file except in compliance with the License.
1803 * You may obtain a copy of the License at
1804 *
1805 *   http://www.apache.org/licenses/LICENSE-2.0
1806 *
1807 * Unless required by applicable law or agreed to in writing, software
1808 * distributed under the License is distributed on an "AS IS" BASIS,
1809 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1810 * See the License for the specific language governing permissions and
1811 * limitations under the License.
1812 */async function Ot(e){const t=Oe(e);t._getPasswordPolicyInternal()&&await t._updatePasswordPolicy()}async function kt(e,t,n){const r=Oe(e),i={requestType:"PASSWORD_RESET",email:t,clientType:"CLIENT_TYPE_WEB"};n&&Et(r,i,n),await Ne(r,i,"getOobCode",ze)}async function St(e,t,n){await Me(Object(i.o)(e),{oobCode:t,newPassword:n}).catch(async t=>{throw"auth/password-does-not-meet-requirements"===t.code&&Ot(e),t})}async function At(e,t){await async function(e,t){return L(e,"POST","/v1/accounts:update",D(e,t))}(Object(i.o)(e),{oobCode:t})}async function Ct(e,t){const n=Object(i.o)(e),r=await Me(n,{oobCode:t}),s=r.requestType;switch(I(s,n,"internal-error"),s){case"EMAIL_SIGNIN":break;case"VERIFY_AND_CHANGE_EMAIL":I(r.newEmail,n,"internal-error");break;case"REVERT_SECOND_FACTOR_ADDITION":I(r.mfaInfo,n,"internal-error");default:I(r.email,n,"internal-error")}let o=null;return r.mfaInfo&&(o=wt._fromServerResponse(Oe(n),r.mfaInfo)),{data:{email:("VERIFY_AND_CHANGE_EMAIL"===r.requestType?r.newEmail:r.email)||null,previousEmail:("VERIFY_AND_CHANGE_EMAIL"===r.requestType?r.email:r.newEmail)||null,multiFactorInfo:o},operation:s}}async function Rt(e,t){const{data:n}=await Ct(Object(i.o)(e),t);return n.email}async function Pt(e,t,n){if(Object(r._isFirebaseServerApp)(e.app))return Promise.reject(_(e));const i=Oe(e),s=Ne(i,{returnSecureToken:!0,email:t,password:n,clientType:"CLIENT_TYPE_WEB"},"signUpPassword",st),o=await s.catch(t=>{throw"auth/password-does-not-meet-requirements"===t.code&&Ot(e),t}),a=await ot._fromIdTokenResponse(i,"signIn",o);return await i._updateCurrentUser(a.user),a}function Nt(e,t,n){return Object(r._isFirebaseServerApp)(e.app)?Promise.reject(_(e)):vt(Object(i.o)(e),Je.credential(t,n)).catch(async t=>{throw"auth/password-does-not-meet-requirements"===t.code&&Ot(e),t})}
1813/**
1814 * @license
1815 * Copyright 2020 Google LLC
1816 *
1817 * Licensed under the Apache License, Version 2.0 (the "License");
1818 * you may not use this file except in compliance with the License.
1819 * You may obtain a copy of the License at
1820 *
1821 *   http://www.apache.org/licenses/LICENSE-2.0
1822 *
1823 * Unless required by applicable law or agreed to in writing, software
1824 * distributed under the License is distributed on an "AS IS" BASIS,
1825 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1826 * See the License for the specific language governing permissions and
1827 * limitations under the License.
1828 */async function Dt(e,t,n){const r=Oe(e),i={requestType:"EMAIL_SIGNIN",email:t,clientType:"CLIENT_TYPE_WEB"};!function(e,t){I(t.handleCodeInApp,r,"argument-error"),t&&Et(r,e,t)}(i,n),await Ne(r,i,"getOobCode",He)}function Lt(e,t){const n=Ke.parseLink(t);return"EMAIL_SIGNIN"===(null==n?void 0:n.operation)}async function jt(e,t,n){if(Object(r._isFirebaseServerApp)(e.app))return Promise.reject(_(e));const s=Object(i.o)(e),o=Je.credentialWithLink(t,n||O());return I(o._tenantId===(s.tenantId||null),s,"tenant-id-mismatch"),vt(s,o)}
1829/**
1830 * @license
1831 * Copyright 2020 Google LLC
1832 *
1833 * Licensed under the Apache License, Version 2.0 (the "License");
1834 * you may not use this file except in compliance with the License.
1835 * You may obtain a copy of the License at
1836 *
1837 *   http://www.apache.org/licenses/LICENSE-2.0
1838 *
1839 * Unless required by applicable law or agreed to in writing, software
1840 * distributed under the License is distributed on an "AS IS" BASIS,
1841 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1842 * See the License for the specific language governing permissions and
1843 * limitations under the License.
1844 */
1845/**
1846 * @license
1847 * Copyright 2020 Google LLC
1848 *
1849 * Licensed under the Apache License, Version 2.0 (the "License");
1850 * you may not use this file except in compliance with the License.
1851 * You may obtain a copy of the License at
1852 *
1853 *   http://www.apache.org/licenses/LICENSE-2.0
1854 *
1855 * Unless required by applicable law or agreed to in writing, software
1856 * distributed under the License is distributed on an "AS IS" BASIS,
1857 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1858 * See the License for the specific language governing permissions and
1859 * limitations under the License.
1860 */
1861async function Ut(e,t){const n={identifier:t,continueUri:k()?O():"http://localhost"},{signinMethods:r}=await async function(e,t){return L(e,"POST","/v1/accounts:createAuthUri",D(e,t))}(Object(i.o)(e),n);return r||[]}async function Mt(e,t){const n=Object(i.o)(e),r={requestType:"VERIFY_EMAIL",idToken:await e.getIdToken()};t&&Et(n.auth,r,t);const{email:s}=await async function(e,t){return Ve(e,t)}(n.auth,r);s!==e.email&&await e.reload()}async function Ft(e,t,n){const r=Object(i.o)(e),s={requestType:"VERIFY_AND_CHANGE_EMAIL",idToken:await e.getIdToken(),newEmail:t};n&&Et(r.auth,s,n);const{email:o}=await async function(e,t){return Ve(e,t)}(r.auth,s);o!==e.email&&await e.reload()}
1862/**
1863 * @license
1864 * Copyright 2020 Google LLC
1865 *
1866 * Licensed under the Apache License, Version 2.0 (the "License");
1867 * you may not use this file except in compliance with the License.
1868 * You may obtain a copy of the License at
1869 *
1870 *   http://www.apache.org/licenses/LICENSE-2.0
1871 *
1872 * Unless required by applicable law or agreed to in writing, software
1873 * distributed under the License is distributed on an "AS IS" BASIS,
1874 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1875 * See the License for the specific language governing permissions and
1876 * limitations under the License.
1877 */
1878/**
1879 * @license
1880 * Copyright 2020 Google LLC
1881 *
1882 * Licensed under the Apache License, Version 2.0 (the "License");
1883 * you may not use this file except in compliance with the License.
1884 * You may obtain a copy of the License at
1885 *
1886 *   http://www.apache.org/licenses/LICENSE-2.0
1887 *
1888 * Unless required by applicable law or agreed to in writing, software
1889 * distributed under the License is distributed on an "AS IS" BASIS,
1890 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1891 * See the License for the specific language governing permissions and
1892 * limitations under the License.
1893 */
1894async function xt(e,{displayName:t,photoURL:n}){if(void 0===t&&void 0===n)return;const r=Object(i.o)(e),s={idToken:await r.getIdToken(),displayName:t,photoUrl:n,returnSecureToken:!0},o=await Y(r,async function(e,t){return L(e,"POST","/v1/accounts:update",t)}(r.auth,s));r.displayName=o.displayName||null,r.photoURL=o.photoUrl||null;const a=r.providerData.find(({providerId:e})=>"password"===e);a&&(a.displayName=r.displayName,a.photoURL=r.photoURL),await r._updateTokensIfNecessary(o)}function Vt(e,t){const n=Object(i.o)(e);return Object(r._isFirebaseServerApp)(n.auth.app)?Promise.reject(_(n.auth)):Ht(n,t,null)}function zt(e,t){return Ht(Object(i.o)(e),null,t)}async function Ht(e,t,n){const{auth:r}=e,i={idToken:await e.getIdToken(),returnSecureToken:!0};t&&(i.email=t),n&&(i.password=n);const s=await Y(e,async function(e,t){return L(e,"POST","/v1/accounts:update",t)}(r,i));await e._updateTokensIfNecessary(s,!0)}
1895/**
1896 * @license
1897 * Copyright 2019 Google LLC
1898 *
1899 * Licensed under the Apache License, Version 2.0 (the "License");
1900 * you may not use this file except in compliance with the License.
1901 * You may obtain a copy of the License at
1902 *
1903 *   http://www.apache.org/licenses/LICENSE-2.0
1904 *
1905 * Unless required by applicable law or agreed to in writing, softw
1905are
1906 * distributed under the License is distributed on an "AS IS" BASIS,
1907 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1908 * See the License for the specific language governing permissions and
1909 * limitations under the License.
1910 */class Wt{constructor(e,t,n={}){this.isNewUser=e,this.providerId=t,this.profile=n}}class Bt extends Wt{constructor(e,t,n,r){super(e,t,n),this.username=r}}class qt extends Wt{constructor(e,t){super(e,"facebook.com",t)}}class Gt extends Bt{constructor(e,t){super(e,"github.com",t,"string"==typeof(null==t?void 0:t.login)?null==t?void 0:t.login:null)}}class $t extends Wt{constructor(e,t){super(e,"google.com",t)}}class Kt extends Bt{constructor(e,t,n){super(e,"twitter.com",t,n)}}function Jt(e){const{user:t,_tokenResponse:n}=e;return t.isAnonymous&&!n?{providerId:null,isNewUser:!1,profile:null}:function(e){var t,n;if(!e)return null;const{providerId:r}=e,i=e.rawUserInfo?JSON.parse(e.rawUserInfo):{},s=e.isNewUser||"identitytoolkit#SignupNewUserResponse"===e.kind;if(!r&&(null==e?void 0:e.idToken)){const r=null===(n=null===(t=K(e.idToken))||void 0===t?void 0:t.firebase)||void 0===n?void 0:n.sign_in_provider;if(r){return new Wt(s,"anonymous"!==r&&"custom"!==r?r:null)}}if(!r)return null;switch(r){case"facebook.com":return new qt(s,i);case"github.com":return new Gt(s,i);case"google.com":return new $t(s,i);case"twitter.com":return new Kt(s,i,e.screenName||null);case"custom":case"anonymous":return new Wt(s,null);default:return new Wt(s,r,i)}}(n)}
1911/**
1912 * @license
1913 * Copyright 2020 Google LLC
1914 *
1915 * Licensed under the Apache License, Version 2.0 (the "License");
1916 * you may not use this file except in compliance with the License.
1917 * You may obtain a copy of the License at
1918 *
1919 *   http://www.apache.org/licenses/LICENSE-2.0
1920 *
1921 * Unless required by applicable law or agreed to in writing, software
1922 * distributed under the License is distributed on an "AS IS" BASIS,
1923 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1924 * See the License for the specific language governing permissions and
1925 * limitations under the License.
1926 */function Yt(e){return Object(i.o)(e).signOut()}async function Xt(e){return Object(i.o)(e).delete()}
1927/**
1928 * @license
1929 * Copyright 2020 Google LLC
1930 *
1931 * Licensed under the Apache License, Version 2.0 (the "License");
1932 * you may not use this file except in compliance with the License.
1933 * You may obtain a copy of the License at
1934 *
1935 *   http://www.apache.org/licenses/LICENSE-2.0
1936 *
1937 * Unless required by applicable law or agreed to in writing, software
1938 * distributed under the License is distributed on an "AS IS" BASIS,
1939 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1940 * See the License for the specific language governing permissions and
1941 * limitations under the License.
1942 */class Zt{constructor(e,t,n){this.type=e,this.credential=t,this.user=n}static _fromIdtoken(e,t){return new Zt("enroll",e,t)}static _fromMfaPendingCredential(e){return new Zt("signin",e)}toJSON(){return{multiFactorSession:{["enroll"===this.type?"idToken":"pendingCredential"]:this.credential}}}static fromJSON(e){var t,n;if(null==e?void 0:e.multiFactorSession){if(null===(t=e.multiFactorSession)||void 0===t?void 0:t.pendingCredential)return Zt._fromMfaPendingCredential(e.multiFactorSession.pendingCredential);if(null===(n=e.multiFactorSession)||void 0===n?void 0:n.idToken)return Zt._fromIdtoken(e.multiFactorSession.idToken)}return null}}
1943/**
1944 * @license
1945 * Copyright 2020 Google LLC
1946 *
1947 * Licensed under the Apache License, Version 2.0 (the "License");
1948 * you may not use this file except in compliance with the License.
1949 * You may obtain a copy of the License at
1950 *
1951 *   http://www.apache.org/licenses/LICENSE-2.0
1952 *
1953 * Unless required by applicable law or agreed to in writing, software
1954 * distributed under the License is distributed on an "AS IS" BASIS,
1955 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1956 * See the License for the specific language governing permissions and
1957 * limitations under the License.
1958 */class Qt{constructor(e,t,n){this.session=e,this.hints=t,this.signInResolver=n}static _fromError(e,t){const n=Oe(e),r=t.customData._serverResponse,i=(r.mfaInfo||[]).map(e=>wt._fromServerResponse(n,e));I(r.mfaPendingCredential,n,"internal-error");const s=Zt._fromMfaPendingCredential(r.mfaPendingCredential);return new Qt(s,i,async e=>{const i=await e._process(n,s);delete r.mfaInfo,delete r.mfaPendingCredential;const o=Object.assign(Object.assign({},r),{idToken:i.idToken,refreshToken:i.refreshToken});switch(t.operationType){case"signIn":const e=await ot._fromIdTokenResponse(n,t.operationType,o);return await n._updateCurrentUser(e.user),e;case"reauthenticate":return I(t.user,n,"internal-error"),ot._forOperation(t.user,t.operationType,o);default:g(n,"internal-error")}})}async resolveSignIn(e){const t=e;return this.signInResolver(t)}}function en(e,t){var n;const r=Object(i.o)(e),s=t;return I(t.customData.operationType,r,"argument-error"),I(null===(n=s.customData._serverResponse)||void 0===n?void 0:n.mfaPendingCredential,r,"argument-error"),Qt._fromError(r,s)}
1959/**
1960 * @license
1961 * Copyright 2020 Google LLC
1962 *
1963 * Licensed under the Apache License, Version 2.0 (the "License");
1964 * you may not use this file except in compliance with the License.
1965 * You may obtain a copy of the License at
1966 *
1967 *   http://www.apache.org/licenses/LICENSE-2.0
1968 *
1969 * Unless required by applicable law or agreed to in writing, software
1970 * distributed under the License is distributed on an "AS IS" BASIS,
1971 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1972 * See the License for the specific language governing permissions and
1973 * limitations under the License.
1974 */class tn{constructor(e){this.user=e,this.enrolledFactors=[],e._onReload(t=>{t.mfaInfo&&(this.enrolledFactors=t.mfaInfo.map(t=>wt._fromServerResponse(e.auth,t)))})}static _fromUser(e){return new tn(e)}async getSession(){return Zt._fromIdtoken(await this.user.getIdToken(),this.user)}async enroll(e,t){const n=e,r=await this.getSession(),i=await Y(this.user,n._process(this.user.auth,r,t));return await this.user._updateTokensIfNecessary(i),this.user.reload()}async unenroll(e){const t="string"==typeof e?e:e.uid,n=await this.user.getIdToken();try{const e=await Y(this.user,(r=this.user.auth,i={idToken:n,mfaEnrollmentId:t},L(r,"POST","/v2/accounts/mfaEnrollment:withdraw",D(r,i))));this.enrolledFactors=this.enrolledFactors.filter(({uid:e})=>e!==t),await this.user._updateTokensIfNecessary(e),await this.user.reload()}catch(e){throw e}var r,i}}const nn=new WeakMap;function rn(e){const t=Object(i.o)(e);return nn.has(t)||nn.set(t,tn._fromUser(t)),nn.get(t)}
1975/**
1976 * @license
1977 * Copyright 2019 Google LLC
1978 *
1979 * Licensed under the Apache License, Version 2.0 (the "License");
1980 * you may not use this file except in compliance with the License.
1981 * You may obtain a copy of the License at
1982 *
1983 *   http://www.apache.org/licenses/LICENSE-2.0
1984 *
1985 * Unless required by applicable law or agreed to in writing, software
1986 * distributed under the License is distributed on an "AS IS" BASIS,
1987 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1988 * See the License for the specific language governing permissions and
1989 * limitations under the License.
1990 */
1991class sn{constructor(e,t){this.storageRetriever=e,this.type=t}_isAvailable(){try{return this.storage?(this.storage.setItem("__sak","1"),this.storage.removeItem("__sak"),Promise.resolve(!0)):Promise.resolve(!1)}catch(e){return Promise.resolve(!1)}}_set(e,t){return this.storage.setItem(e,JSON.stringify(t)),Promise.resolve()}_get(e){const t=this.storage.getItem(e);return Promise.resolve(t?JSON.parse(t):null)}_remove(e){return this.storage.removeItem(e),Promise.resolve()}get storage(){return this.storageRetriever()}}
1992/**
1993 * @license
1994 * Copyright 2020 Google LLC
1995 *
1996 * Licensed under the Apache License, Version 2.0 (the "License");
1997 * you may not use this file except in compliance with the License.
1998 * You may obtain a copy of the License at
1999 *
2000 *   http://www.apache.org/licenses/LICENSE-2.0
2001 *
2002 * Unless required by applicable law or agreed to in writing, software
2003 * distributed under the License is distributed on an "AS IS" BASIS,
2004 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2005 * See the License for the specific language governing permissions and
2006 * limitations under the License.
2007 */class on extends sn{constructor(){super(()=>window.localStorage,"LOCAL"),this.boundEventHandler=(e,t)=>this.onStorageEvent(e,t),this.listeners={},this.localCache={},this.pollTimer=null,this.fallbackToPolling=ye(),this._shouldAllowMigration=!0}forAllChangedKeys(e){for(const t of Object.keys(this.listeners)){const n=this.storage.getItem(t),r=this.localCache[t];n!==r&&e(t,r,n)}}onStorageEvent(e,t=!1){if(!e.key)return void this.forAllChangedKeys((e,t,n)=>{this.notifyListeners(e,n)});const n=e.key;t?this.detachListener():this.stopPolling();const r=()=>{const e=this.storage.getItem(n);(t||this.localCache[n]!==e)&&this.notifyListeners(n,e)},s=this.storage.getItem(n);Object(i.u)()&&10===document.documentMode&&s!==e.newValue&&e.newValue!==e.oldValue?setTimeout(r,10):r()}notifyListeners(e,t){this.localCache[e]=t;const n=this.listeners[e];if(n)for(const e of Array.from(n))e(t?JSON.parse(t):t)}startPolling(){this.stopPolling(),this.pollTimer=setInterval(()=>{this.forAllChangedKeys((e,t,n)=>{this.onStorageEvent(new StorageEvent("storage",{key:e,oldValue:t,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(e,t){0===Object.keys(this.listeners).length&&(this.fallbackToPolling?this.startPolling():this.attachListener()),this.listeners[e]||(this.listeners[e]=new Set,this.localCache[e]=this.storage.getItem(e)),this.listeners[e].add(t)}_removeListener(e,t){this.listeners[e]&&(this.listeners[e].delete(t),0===this.listeners[e].size&&delete this.listeners[e]),0===Object.keys(this.listeners).length&&(this.detachListener(),this.stopPolling())}async _set(e,t){await super._set(e,t),this.localCache[e]=JSON.stringify(t)}async _get(e){const t=await super._get(e);return this.localCache[e]=JSON.stringify(t),t}async _remove(e){await super._remove(e),delete this.localCache[e]}}on.type="LOCAL";const an=on;
2008/**
2009 * @license
2010 * Copyright 2020 Google LLC
2011 *
2012 * Licensed under the Apache License, Version 2.0 (the "License");
2013 * you may not use this file except in compliance with the License.
2014 * You may obtain a copy of the License at
2015 *
2016 *   http://www.apache.org/licenses/LICENSE-2.0
2017 *
2018 * Unless required by applicable law or agreed to in writing, software
2019 * distributed under the License is distributed on an "AS IS" BASIS,
2020 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2021 * See the License for the specific language governing permissions and
2022 * limitations under the License.
2023 */class cn extends sn{constructor(){super(()=>window.sessionStorage,"SESSION")}_addListener(e,t){}_removeListener(e,t){}}cn.type="SESSION";const un=cn;
2024/**
2025 * @license
2026 * Copyright 2019 Google LLC
2027 *
2028 * Licensed under the Apache License, Version 2.0 (the "License");
2029 * you may not use this file except in compliance with the License.
2030 * You may obtain a copy of the License at
2031 *
2032 *   http://www.apache.org/licenses/LICENSE-2.0
2033 *
2034 * Unless required by applicable law or agreed to in writing, software
2035 * distributed under the License is distributed on an "AS IS" BASIS,
2036 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2037 * See the License for the specific language governing permissions and
2038 * limitations under the License.
2039 */
2040/**
2041 * @license
2042 * Copyright 2019 Google LLC
2043 *
2044 * Licensed under the Apache License, Version 2.0 (the "License");
2045 * you may not use this file except in compliance with the License.
2046 * You may obtain a copy of the License at
2047 *
2048 *   http://www.apache.org/licenses/LICENSE-2.0
2049 *
2050 * Unless required by applicable law or agreed to in writing, software
2051 * distributed under the License is distributed on an "AS IS" BASIS,
2052 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2053 * See the License for the specific language governing permissions and
2054 * limitations under the License.
2055 */
2056class dn{constructor(e){this.eventTarget=e,this.handlersMap={},this.boundEventHandler=this.handleEvent.bind(this)}static _getInstance(e){const t=this.receivers.find(t=>t.isListeningto(e));if(t)return t;const n=new dn(e);return this.receivers.push(n),n}isListeningto(e){return this.eventTarget===e}async handleEvent(e){const t=e,{eventId:n,eventType:r,data:i}=t.data,s=this.handlersMap[r];if(!(null==s?void 0:s.size))return;t.ports[0].postMessage({status:"ack",eventId:n,eventType:r});const o=Array.from(s).map(async e=>e(t.origin,i)),a=await function(e){return Promise.all(e.map(async e=>{try{return{fulfilled:!0,value:await e}}catch(e){return{fulfilled:!1,reason:e}}}))}(o);t.ports[0].postMessage({status:"done",eventId:n,eventType:r,response:a})}_subscribe(e,t){0===Object.keys(this.handlersMap).length&&this.eventTarget.addEventListener("message",this.boundEventHandler),this.handlersMap[e]||(this.handlersMap[e]=new Set),this.handlersMap[e].add(t)}_unsubscribe(e,t){this.handlersMap[e]&&t&&this.handlersMap[e].delete(t),t&&0!==this.handlersMap[e].size||delete this.handlersMap[e],0===Object.keys(this.handlersMap).length&&this.eventTarget.removeEventListener("message",this.boundEventHandler)}}
2057/**
2058 * @license
2059 * Copyright 2020 Google LLC
2060 *
2061 * Licensed under the Apache License, Version 2.0 (the "License");
2062 * you may not use this file except in compliance with the License.
2063 * You may obtain a copy of the License at
2064 *
2065 *   http://www.apache.org/licenses/LICENSE-2.0
2066 *
2067 * Unless required by applicable law or agreed to in writing, software
2068 * distributed under the License is distributed on an "AS IS" BASIS,
2069 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2070 * See the License for the specific language governing permissions and
2071 * limitations under the License.
2072 */
2073function ln(e="",t=10){let n="";for(let e=0;e<t;e++)n+=Math.floor(10*Math.random());return e+n}
2074/**
2075 * @license
2076 * Copyright 2019 Google LLC
2077 *
2078 * Licensed under the Apache License, Version 2.0 (the "License");
2079 * you may not use this file except in compliance with the License.
2080 * You may obtain a copy of the License at
2081 *
2082 *   http://www.apache.org/licenses/LICENSE-2.0
2083 *
2084 * Unless required by applicable law or agreed to in writing, softw
2084are
2085 * distributed under the License is distributed on an "AS IS" BASIS,
2086 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2087 * See the License for the specific language governing permissions and
2088 * limitations under the License.
2089 */dn.receivers=[];class hn{constructor(e){this.target=e,this.handlers=new Set}removeMessageHandler(e){e.messageChannel&&(e.messageChannel.port1.removeEventListener("message",e.onMessage),e.messageChannel.port1.close()),this.handlers.delete(e)}async _send(e,t,n=50){const r="undefined"!=typeof MessageChannel?new MessageChannel:null;if(!r)throw new Error("connection_unavailable");let i,s;return new Promise((o,a)=>{const c=ln("",20);r.port1.start();const u=setTimeout(()=>{a(new Error("unsupported_event"))},n);s={messageChannel:r,onMessage(e){const t=e;if(t.data.eventId===c)switch(t.data.status){case"ack":clearTimeout(u),i=setTimeout(()=>{a(new Error("timeout"))},3e3);break;case"done":clearTimeout(i),o(t.data.response);break;default:clearTimeout(u),clearTimeout(i),a(new Error("invalid_response"))}}},this.handlers.add(s),r.port1.addEventListener("message",s.onMessage),this.target.postMessage({eventType:e,eventId:c,data:t},[r.port2])}).finally(()=>{s&&this.removeMessageHandler(s)})}}
2090/**
2091 * @license
2092 * Copyright 2020 Google LLC
2093 *
2094 * Licensed under the Apache License, Version 2.0 (the "License");
2095 * you may not use this file except in compliance with the License.
2096 * You may obtain a copy of the License at
2097 *
2098 *   http://www.apache.org/licenses/LICENSE-2.0
2099 *
2100 * Unless required by applicable law or agreed to in writing, software
2101 * distributed under the License is distributed on an "AS IS" BASIS,
2102 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2103 * See the License for the specific language governing permissions and
2104 * limitations under the License.
2105 */function pn(){return window}
2106/**
2107 * @license
2108 * Copyright 2020 Google LLC.
2109 *
2110 * Licensed under the Apache License, Version 2.0 (the "License");
2111 * you may not use this file except in compliance with the License.
2112 * You may obtain a copy of the License at
2113 *
2114 *   http://www.apache.org/licenses/LICENSE-2.0
2115 *
2116 * Unless required by applicable law or agreed to in writing, software
2117 * distributed under the License is distributed on an "AS IS" BASIS,
2118 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2119 * See the License for the specific language governing permissions and
2120 * limitations under the License.
2121 */
2122function fn(){return void 0!==pn().WorkerGlobalScope&&"function"==typeof pn().importScripts}
2123/**
2124 * @license
2125 * Copyright 2019 Google LLC
2126 *
2127 * Licensed under the Apache License, Version 2.0 (the "License");
2128 * you may not use this file except in compliance with the License.
2129 * You may obtain a copy of the License at
2130 *
2131 *   http://www.apache.org/licenses/LICENSE-2.0
2132 *
2133 * Unless required by applicable law or agreed to in writing, software
2134 * distributed under the License is distributed on an "AS IS" BASIS,
2135 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2136 * See the License for the specific language governing permissions and
2137 * limitations under the License.
2138 */
2139const mn="firebaseLocalStorageDb";class gn{constructor(e){this.request=e}toPromise(){return new Promise((e,t)=>{this.request.addEventListener("success",()=>{e(this.request.result)}),this.request.addEventListener("error",()=>{t(this.request.error)})})}}function vn(e,t){return e.transaction(["firebaseLocalStorage"],t?"readwrite":"readonly").objectStore("firebaseLocalStorage")}function bn(){const e=indexedDB.open(mn,1);return new Promise((t,n)=>{e.addEventListener("error",()=>{n(e.error)}),e.addEventListener("upgradeneeded",()=>{const t=e.result;try{t.createObjectStore("firebaseLocalStorage",{keyPath:"fbase_key"})}catch(e){n(e)}}),e.addEventListener("success",async()=>{const n=e.result;n.objectStoreNames.contains("firebaseLocalStorage")?t(n):(n.close(),await function(){const e=indexedDB.deleteDatabase(mn);
2139return new gn(e).toPromise()}(),t(await bn()))})})}async function _n(e,t,n){const r=vn(e,!0).put({fbase_key:t,value:n});return new gn(r).toPromise()}function yn(e,t){const n=vn(e,!0).delete(t);return new gn(n).toPromise()}class wn{constructor(){this.type="LOCAL",this._shouldAllowMigration=!0,this.listeners={},this.localCache={},this.pollTimer=null,this.pendingWrites=0,this.receiver=null,this.sender=null,this.serviceWorkerReceiverAvailable=!1,this.activeServiceWorker=null,this._workerInitializationPromise=this.initializeServiceWorkerMessaging().then(()=>{},()=>{})}async _openDb(){return this.db||(this.db=await bn()),this.db}async _withRetries(e){let t=0;for(;;)try{const t=await this._openDb();return await e(t)}catch(e){if(t++>3)throw e;this.db&&(this.db.close(),this.db=void 0)}}async initializeServiceWorkerMessaging(){return fn()?this.initializeReceiver():this.initializeSender()}async initializeReceiver(){this.receiver=dn._getInstance(fn()?self:null),this.receiver._subscribe("keyChanged",async(e,t)=>({keyProcessed:(await this._poll()).includes(t.key)})),this.receiver._subscribe("ping",async(e,t)=>["keyChanged"])}async initializeSender(){var e,t;if(this.activeServiceWorker=await async function(){if(!(null===navigator||void 0===navigator?void 0:navigator.serviceWorker))return null;try{return(await navigator.serviceWorker.ready).active}catch(e){return null}}(),!this.activeServiceWorker)return;this.sender=new hn(this.activeServiceWorker);const n=await this.sender._send("ping",{},800);n&&(null===(e=n[0])||void 0===e?void 0:e.fulfilled)&&(null===(t=n[0])||void 0===t?void 0:t.value.includes("keyChanged"))&&(this.serviceWorkerReceiverAvailable=!0)}async notifyServiceWorker(e){var t;if(this.sender&&this.activeServiceWorker&&((null===(t=null===navigator||void 0===navigator?void 0:navigator.serviceWorker)||void 0===t?void 0:t.controller)||null)===this.activeServiceWorker)try{await this.sender._send("keyChanged",{key:e},this.serviceWorkerReceiverAvailable?800:50)}catch(t){}}async _isAvailable(){try{if(!indexedDB)return!1;const e=await bn();return await _n(e,"__sak","1"),await yn(e,"__sak"),!0}catch(e){}return!1}async _withPendingWrite(e){this.pendingWrites++;try{await e()}finally{this.pendingWrites--}}async _set(e,t){return this._withPendingWrite(async()=>(await this._withRetries(n=>_n(n,e,t)),this.localCache[e]=t,this.notifyServiceWorker(e)))}async _get(e){const t=await this._withRetries(t=>async function(e,t){const n=vn(e,!1).get(t),r=await new gn(n).toPromise();return void 0===r?null:r.value}(t,e));return this.localCache[e]=t,t}async _remove(e){return this._withPendingWrite(async()=>(await this._withRetries(t=>yn(t,e)),delete this.localCache[e],this.notifyServiceWorker(e)))}async _poll(){const e=await this._withRetries(e=>{const t=vn(e,!1).getAll();return new gn(t).toPromise()});if(!e)return[];if(0!==this.pendingWrites)return[];const t=[],n=new Set;if(0!==e.length)for(const{fbase_key:r,value:i}of e)n.add(r),JSON.stringify(this.localCache[r])!==JSON.stringify(i)&&(this.notifyListeners(r,i),t.push(r));for(const e of Object.keys(this.localCache))this.localCache[e]&&!n.has(e)&&(this.notifyListeners(e,null),t.push(e));return t}notifyListeners(e,t){this.localCache[e]=t;const n=this.listeners[e];if(n)for(const e of Array.from(n))e(t)}startPolling(){this.stopPolling(),this.pollTimer=setInterval(async()=>this._poll(),800)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}_addListener(e,t){0===Object.keys(this.listeners).length&&this.startPolling(),this.listeners[e]||(this.listeners[e]=new Set,this._get(e)),this.listeners[e].add(t)}_removeListener(e,t){this.listeners[e]&&(this.listeners[e].delete(t),0===this.listeners[e].size&&delete this.listeners[e]),0===Object.keys(this.listeners).length&&this.stopPolling()}}wn.type="LOCAL";const In=wn;
2140/**
2141 * @license
2142 * Copyright 2020 Google LLC
2143 *
2144 * Licensed under the Apache License, Version 2.0 (the "License");
2145 * you may not use this file except in compliance with the License.
2146 * You may obtain a copy of the License at
2147 *
2148 *   http://www.apache.org/licenses/LICENSE-2.0
2149 *
2150 * Unless required by applicable law or agreed to in writing, softw
2150are
2151 * distributed under the License is distributed on an "AS IS" BASIS,
2152 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2153 * See the License for the specific language governing permissions and
2154 * limitations under the License.
2155 */class Tn{constructor(e){this.auth=e,this.counter=1e12,this._widgets=new Map}render(e,t){const n=this.counter;return this._widgets.set(n,new En(e,this.auth.name,t||{})),this.counter++,n}reset(e){var t;const n=e||1e12;null===(t=this._widgets.get(n))||void 0===t||t.delete(),this._widgets.delete(n)}getResponse(e){var t;const n=e||1e12;return(null===(t=this._widgets.get(n))||void 0===t?void 0:t.getResponse())||""}async execute(e){var t;const n=e||1e12;return null===(t=this._widgets.get(n))||void 0===t||t.execute(),""}}class En{constructor(e,t,n){this.params=n,this.timerId=null,this.deleted=!1,this.responseToken=null,this.clickHandler=()=>{this.execute()};const r="string"==typeof e?document.getElementById(e):e;I(r,"argument-error",{appName:t}),this.container=r,this.isVisible="invisible"!==this.params.size,this.isVisible?this.execute():this.container.addEventListener("click",this.clickHandler)}getResponse(){return this.checkIfDeleted(),this.responseToken}delete(){this.checkIfDeleted(),this.deleted=!0,this.timerId&&(clearTimeout(this.timerId),this.timerId=null),this.container.removeEventListener("click",this.clickHandler)}execute(){this.checkIfDeleted(),this.timerId||(this.timerId=window.setTimeout(()=>{this.responseToken=function(e){const t=[],n="1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";for(let r=0;r<e;r++)t.push(n.charAt(Math.floor(Math.random()*n.length)));return t.join("")}
2156/**
2157 * @license
2158 * Copyright 2020 Google LLC
2159 *
2160 * Licensed under the Apache License, Version 2.0 (the "License");
2161 * you may not use this file except in compliance with the License.
2162 * You may obtain a copy of the License at
2163 *
2164 *   http://www.apache.org/licenses/LICENSE-2.0
2165 *
2166 * Unless required by applicable law or agreed to in writing, software
2167 * distributed under the License is distributed on an "AS IS" BASIS,
2168 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2169 * See the License for the specific language governing permissions and
2170 * limitations under the License.
2171 */(50);const{callback:e,"expired-callback":t}=this.params;if(e)try{e(this.responseToken)}catch(e){}this.timerId=window.setTimeout(()=>{if(this.timerId=null,this.responseToken=null,t)try{t()}catch(e){}this.isVisible&&this.execute()},6e4)},500))}checkIfDeleted(){if(this.deleted)throw new Error("reCAPTCHA mock was already deleted!")}}const On=Ce("rcb"),kn=new A(3e4,6e4);class Sn{constructor(){var e;this.hostLanguage="",this.counter=0,this.librarySeparatelyLoaded=!!(null===(e=pn().grecaptcha)||void 0===e?void 0:e.render)}load(e,t=""){return I(function(e){return e.length<=6&&/^\s*[a-zA-Z0-9\-]*\s*$/.test(e)}(t),e,"argument-error"),this.shouldResolveImmediately(t)&&z(pn().grecaptcha)?Promise.resolve(pn().grecaptcha):new Promise((n,r)=>{const s=pn().setTimeout(()=>{r(v(e,"network-request-failed"))},kn.get());pn()[On]=()=>{pn().clearTimeout(s),delete pn()[On];const i=pn().grecaptcha;if(!i||!z(i))return void r(v(e,"internal-error"));const o=i.render;i.render=(e,t)=>{const n=o(e,t);return this.counter++,n},this.hostLanguage=t,n(i)};Ae(`${Se.recaptchaV2Script}?${Object(i.A)({onload:On,render:"explicit",hl:t})}`).catch(()=>{clearTimeout(s),r(v(e,"internal-error"))})})}clearedOneInstance(){this.counter--}shouldResolveImmediately(e){var t;return!!(null===(t=pn().grecaptcha)||void 0===t?void 0:t.render)&&(e===this.hostLanguage||this.counter>0||this.librarySeparatelyLoaded)}}class An{async load(e){return new Tn(e)}clearedOneInstance(){}}
2172/**
2173 * @license
2174 * Copyright 2020 Google LLC
2175 *
2176 * Licensed under the Apache License, Version 2.0 (the "License");
2177 * you may not use this file except in compliance with the License.
2178 * You may obtain a copy of the License at
2179 *
2180 *   http://www.apache.org/licenses/LICENSE-2.0
2181 *
2182 * Unless required by applicable law or agreed to in writing, software
2183 * distributed under the License is distributed on an "AS IS" BASIS,
2184 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2185 * See the License for the specific language governing permissions and
2186 * limitations under the License.
2187 */const Cn={theme:"light",type:"image"};class Rn{constructor(e,t,n=Object.assign({},Cn)){this.parameters=n,this.type="recaptcha",this.destroyed=!1,this.widgetId=null,this.tokenChangeListeners=new Set,this.renderPromise=null,this.recaptcha=null,this.auth=Oe(e),this.isInvisible="invisible"===this.parameters.size,I("undefined"!=typeof document,this.auth,"operation-not-supported-in-this-environment");const r="string"==typeof t?document.getElementById(t):t;I(r,this.auth,"argument-error"),this.container=r,this.parameters.callback=this.makeTokenCallback(this.parameters.callback),this._recaptchaLoader=this.auth.settings.appVerificationDisabledForTesting?new An:new Sn,this.validateStartingState()}async verify(){this.assertNotDestroyed();const e=await this.render(),t=this.getAssertedRecaptcha(),n=t.getResponse(e);return n||new Promise(n=>{const r=e=>{e&&(this.tokenChangeListeners.delete(r),n(e))};this.tokenChangeListeners.add(r),this.isInvisible&&t.execute(e)})}render(){try{this.assertNotDestroyed()}catch(e){return Promise.reject(e)}return this.renderPromise||(this.renderPromise=this.makeRenderPromise().catch(e=>{throw this.renderPromise=null,e})),this.renderPromise}_reset(){this.assertNotDestroyed(),null!==this.widgetId&&this.getAssertedRecaptcha().reset(this.widgetId)}clear(){this.assertNotDestroyed(),this.destroyed=!0,this._recaptchaLoader.clearedOneInstance(),this.isInvisible||this.container.childNodes.forEac
2187h(e=>{this.container.removeChild(e)})}validateStartingState(){I(!this.parameters.sitekey,this.auth,"argument-error"),I(this.isInvisible||!this.container.hasChildNodes(),this.auth,"argument-error"),I("undefined"!=typeof document,this.auth,"operation-not-supported-in-this-environment")}makeTokenCallback(e){return t=>{if(this.tokenChangeListeners.forEach(e=>e(t)),"function"==typeof e)e(t);else if("string"==typeof e){const n=pn()[e];"function"==typeof n&&n(t)}}}assertNotDestroyed(){I(!this.destroyed,this.auth,"internal-error")}async makeRenderPromise(){if(await this.init(),!this.widgetId){let e=this.container;if(!this.isInvisible){const t=document.createElement("div");e.appendChild(t),e=t}this.widgetId=this.getAssertedRecaptcha().render(e,this.parameters)}return this.widgetId}async init(){I(k()&&!fn(),this.auth,"internal-error"),await function(){let e=null;return new Promise(t=>{"complete"!==document.readyState?(e=()=>t(),window.addEventListener("load",e)):t()}).catch(t=>{throw e&&window.removeEventListener("load",e),t})}
2188/**
2189 * @license
2190 * Copyright 2020 Google LLC
2191 *
2192 * Licensed under the Apache License, Version 2.0 (the "License");
2193 * you may not use this file except in compliance with the License.
2194 * You may obtain a copy of the License at
2195 *
2196 *   http://www.apache.org/licenses/LICENSE-2.0
2197 *
2198 * Unless required by applicable law or agreed to in writing, software
2199 * distributed under the License is distributed on an "AS IS" BASIS,
2200 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2201 * See the License for the specific language governing permissions and
2202 * limitations under the License.
2203 */(),this.recaptcha=await this._recaptchaLoader.load(this.auth,this.auth.languageCode||void 0);const e=await async function(e){return(await L(e,"GET","/v1/recaptchaParams")).recaptchaSiteKey||""}(this.auth);I(e,this.auth,"internal-error"),this.parameters.sitekey=e}getAssertedRecaptcha(){return I(this.recaptcha,this.auth,"internal-error"),this.recaptcha}}class Pn{constructor(e,t){this.verificationId=e,this.onConfirmation=t}confirm(e){const t=$e._fromVerification(this.verificationId,e);return this.onConfirmation(t)}}async function Nn(e,t,n){if(Object(r._isFirebaseServerApp)(e.app))return Promise.reject(_(e));const s=Oe(e),o=await jn(s,t,Object(i.o)(n));return new Pn(o,e=>vt(s,e))}async function Dn(e,t,n){const r=Object(i.o)(e);await ft(!1,r,"phone");const s=await jn(r.auth,t,Object(i.o)(n));return new Pn(s,e=>bt(r,e))}async function Ln(e,t,n){const s=Object(i.o)(e);if(Object(r._isFirebaseServerApp)(s.auth.app))return Promise.reject(_(s.auth));const o=await jn(s.auth,t,Object(i.o)(n));return new Pn(o,e=>_t(s,e))}async function jn(e,t,n){var r;const i=await n.verify();try{let s;
2203if(I("string"==typeof i,e,"argument-error"),I("recaptcha"===n.type,e,"argument-error"),s="string"==typeof t?{phoneNumber:t}:t,"session"in s){const t=s.session;if("phoneNumber"in s){I("enroll"===t.type,e,"internal-error");return(await function(e,t){return L(e,"POST","/v2/accounts/mfaEnrollment:start",D(e,t))}(e,{idToken:t.credential,phoneEnrollmentInfo:{phoneNumber:s.phoneNumber,recaptchaToken:i}})).phoneSessionInfo.sessionInfo}{I("signin"===t.type,e,"internal-error");const n=(null===(r=s.multiFactorHint)||void 0===r?void 0:r.uid)||s.multiFactorUid;I(n,e,"missing-multi-factor-info");return(await function(e,t){return L(e,"POST","/v2/accounts/mfaSignIn:start",D(e,t))}(e,{mfaPendingCredential:t.credential,mfaEnrollmentId:n,phoneSignInInfo:{recaptchaToken:i}})).phoneResponseInfo.sessionInfo}}{const{sessionInfo:t}=await async function(e,t){return L(e,"POST","/v1/accounts:sendVerificationCode",D(e,t))}(e,{phoneNumber:s.phoneNumber,recaptchaToken:i});return t}}finally{n._reset()}}async function Un(e,t){const n=Object(i.o)(e);if(Object(r._isFirebaseServerApp)(n.auth.app))return Promise.reject(_(n.auth));await pt(n,t)}
2204/**
2205 * @license
2206 * Copyright 2020 Google LLC
2207 *
2208 * Licensed under the Apache License, Version 2.0 (the "License");
2209 * you may not use this file except in compliance with the License.
2210 * You may obtain a copy of the License at
2211 *
2212 *   http://www.apache.org/licenses/LICENSE-2.0
2213 *
2214 * Unless required by applicable law or agreed to in writing, software
2215 * distributed under the License is distributed on an "AS IS" BASIS,
2216 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2217 * See the License for the specific language governing permissions and
2218 * limitations under the License.
2219 */class Mn{constructor(e){this.providerId=Mn.PROVIDER_ID,this.auth=Oe(e)}verifyPhoneNumber(e,t){return jn(this.auth,e,Object(i.o)(t))}static credential(e,t){return $e._fromVerification(e,t)}static credentialFromResult(e){const t=e;return Mn.credentialFromTaggedObject(t)}static credentialFromError(e){return Mn.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{phoneNumber:t,temporaryProof:n}=e;return t&&n?$e._fromTokenResponse(t,n):null}}
2220/**
2221 * @license
2222 * Copyright 2021 Google LLC
2223 *
2224 * Licensed under the Apache License, Version 2.0 (the "License");
2225 * you may not use this file except in compliance with the License.
2226 * You may obtain a copy of the License at
2227 *
2228 *   http://www.apache.org/licenses/LICENSE-2.0
2229 *
2230 * Unless required by applicable law or agreed to in writing, software
2231 * distributed under the License is distributed on an "AS IS" BASIS,
2232 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2233 * See the License for the specific language governing permissions and
2234 * limitations under the License.
2235 */
2236function Fn(e,t){return t?se(t):(I(e._popupRedirectResolver,e,"argument-error"),e._popupRedirectResolver)}
2237/**
2238 * @license
2239 * Copyright 2019 Google LLC
2240 *
2241 * Licensed under the Apache License, Version 2.0 (the "License");
2242 * you may not use this file except in compliance with the License.
2243 * You may obtain a copy of the License at
2244 *
2245 *   http://www.apache.org/licenses/LICENSE-2.0
2246 *
2247 * Unless required by applicable law or agreed to in writing, software
2248 * distributed under the License is distributed on an "AS IS" BASIS,
2249 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2250 * See the License for the specific language governing permissions and
2251 * limitations under the License.
2252 */Mn.PROVIDER_ID="phone",Mn.PHONE_SIGN_IN_METHOD="phone";class xn extends Ue{constructor(e){super("custom","custom"),this.params=e}_getIdTokenResponse(e){return Be(e,this._buildIdpRequest())}_linkToIdToken(e,t){return Be(e,this._buildIdpRequest(t))}_getReauthenticationResolver(e){return Be(e,this._buildIdpRequest())}_buildIdpRequest(e){const t={requestUri:this.params.requestUri,sessionId:this.params.sessionId,postBody:this.params.postBody,tenantId:this.params.tenantId,pendingToken:this.params.pendingToken,returnSecureToken:!0,returnIdpCredential:!0};return e&&(t.idToken=e),t}}function Vn(e){return gt(e.auth,new xn(e),e.bypassAuthState)}function zn(e){const{auth:t,user:n}=e;return I(n,t,"internal-error"),mt(n,new xn(e),e.bypassAuthState)}async function Hn(e){const{auth:t,user:n}=e;return I(n,t,"internal-error"),pt(n,new xn(e),e.bypassAuthState)}
2253/**
2254 * @license
2255 * Copyright 2020 Google LLC
2256 *
2257 * Licensed under the Apache License, Version 2.0 (the "License");
2258 * you may not use this file except in compliance with the License.
2259 * You may obtain a copy of the License at
2260 *
2261 *   http://www.apache.org/licenses/LICENSE-2.0
2262 *
2263 * Unless required by applicable law or agreed to in writing, software
2264 * distributed under the License is distributed on an "AS IS" BASIS,
2265 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2266 * See the License for the specific language governing permissions and
2267 * limitations under the License.
2268 */class Wn{constructor(e,t,n,r,i=!1){this.auth=e,this.resolver=n,this.user=r,this.bypassAuthState=i,this.pendingPromise=null,this.eventManager=null,this.filter=Array.isArray(t)?t:[t]}execute(){return new Promise(async(e,t)=>{this.pendingPromise={resolve:e,reject:t};try{this.eventManager=await this.resolver._initialize(this.auth),await this.onExecution(),this.eventManager.registerConsumer(this)}catch(e){this.reject(e)}})}async onAuthEvent(e){const{urlResponse:t,sessionId:n,postBody:r,tenantId:i,error:s,type:o}=e;if(s)return void this.reject(s);const a={auth:this.auth,requestUri:t,sessionId:n,tenantId:i||void 0,postBody:r||void 0,user:this.user,bypassAuthState:this.bypassAuthState};try{this.resolve(await this.getIdpTask(o)(a))}catch(e){this.reject(e)}}onError(e){this.reject(e)}getIdpTask(e){switch(e){case"signInViaPopup":case"signInViaRedirect":return Vn;case"linkViaPopup":case"linkViaRedirect":return Hn;case"reauthViaPopup":case"reauthViaRedirect":return zn;default:g(this.auth,"internal-error")}}resolve(e){E(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.resolve(e),this.unregisterAndCleanUp()}reject(e){E(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.reject(e),this.unregisterAndCleanUp()}unregisterAndCleanUp(){this.eventManager&&this.eventManager.unregisterConsumer(this),this.pendingPromise=null,this.cleanUp()}}
2269/**
2270 * @license
2271 * Copyright 2020 Google LLC
2272 *
2273 * Licensed under the Apache License, Version 2.0 (the "License");
2274 * you may not use this file except in compliance with the License.
2275 * You may obtain a copy of the License at
2276 *
2277 *   http://www.apache.org/licenses/LICENSE-2.0
2278 *
2279 * Unless required by applicable law or agreed to in writing, software
2280 * distributed under the License is distributed on an "AS IS" BASIS,
2281 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2282 * See the License for the specific language governing permissions and
2283 * limitations under the License.
2284 */const Bn=new A(2e3,1e4);async function qn(e,t,n){if(Object(r._isFirebaseServerApp)(e.app))return Promise.reject(v(e,"operation-not-supported-in-this-environment"));const i=Oe(e);y(e,t,Ye);const s=Fn(i,n);return new Kn(i,"signInViaPopup",t,s).executeNotNull()}async function Gn(e,t,n){const s=Object(i.o)(e);if(Object(r._isFirebaseServerApp)(s.auth.app))return Promise.reject(v(s.auth,"operation-not-supported-in-this-environment"));y(s.auth,t,Ye);const o=Fn(s.auth,n);return new Kn(s.auth,"reauthViaPopup",t,o,s).executeNotNull()}async function $n(e,t,n){const r=Object(i.o)(e);y(r.auth,t,Ye);const s=Fn(r.auth,n);return new Kn(r.auth,"linkViaPopup",t,s,r).executeNotNull()}class Kn extends Wn{constructor(e,t,n,r,i){super(e,t,r,i),this.provider=n,this.authWindow=null,this.pollId=null,Kn.currentPopupAction&&Kn.currentPopupAction.cancel(),Kn.currentPopupAction=this}async executeNotNull(){const e=await this.execute();return I(e,this.auth,"internal-error"),e}async onExecution(){E(1===this.filter.length,"Popup operations only handle one event");const e=ln();this.authWindow=await this.resolver._openPopup(this.auth,this.provider,this.filter[0],e),this.authWindow.associatedEvent=e,this.resolver._originValidation(this.auth).catch(e=>{this.reject(e)}),this.resolver._isIframeWebStorageSupported(this.auth,e=>{e||this.reject(v(this.auth,"web-storage-unsupported"))}),this.pollUserCancellation()}get eventId(){var e;return(null===(e=this.authWindow)||void 0===e?void 0:e.associatedEvent)||null}cancel(){this.reject(v(this.auth,"cancelled-popup-request"))}cleanUp(){this.authWindow&&this.authWindow.close(),this.pollId&&window.clearTimeout(this.pollId),this.authWindow=null,this.pollId=null,Kn.currentPopupAction=null}pollUserCancellation(){const e=()=>{var t,n;(null===(n=null===(t=this.authWindow)||void 0===t?void 0:t.window)||void 0===n?void 0:n.closed)?this.pollId=window.setTimeout(()=>{this.pollId=null,this.reject(v(this.auth,"popup-closed-by-user"))},8e3):this.pollId=window.setTimeout(e,Bn.get())};e()}}Kn.currentPopupAction=null;
2285/**
2286 * @license
2287 * Copyright 2020 Google LLC
2288 *
2289 * Licensed under the Apache License, Version 2.0 (the "License");
2290 * you may not use this file except in compliance with the License.
2291 * You may obtain a copy of the License at
2292 *
2293 *   http://www.apache.org/licenses/LICENSE-2.0
2294 *
2295 * Unless required by applicable law or agreed to in writing, software
2296 * distributed under the License is distributed on an "AS IS" BASIS,
2297 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2298 * See the License for the specific language governing permissions and
2299 * limitations under the License.
2300 */
2301const Jn=new Map;class Yn extends Wn{constructor(e,t,n=!1){super(e,["signInViaRedirect","linkViaRedirect","reauthViaRedirect","unknown"],t,void 0,n),this.eventId=null}async execute(){let e=Jn.get(this.auth._key());if(!e){try{const t=await async function(e,t){const n=tr(t),r=er(e);if(!await r._isAvailable())return!1;const i="true"===await r._get(n);return await r._remove(n),i}(this.resolver,this.auth)?await super.execute():null;e=()=>Promise.resolve(t)}catch(t){e=()=>Promise.reject(t)}Jn.set(this.auth._key(),e)}return this.bypassAuthState||Jn.set(this.auth._key(),()=>Promise.resolve(null)),e()}async onAuthEvent(e){if("signInViaRedirect"===e.type)return super.onAuthEvent(e);if("unknown"!==e.type){if(e.eventId){const t=await this.auth._redirectUserForId(e.eventId);if(t)return this.user=t,super.onAuthEvent(e);this.resolve(null)}}else this.resolve(null)}async onExecution(){}cleanUp(){}}async function Xn(e,t){return er(e)._set(tr(t),"true")}function Zn(){Jn.clear()}function Qn(e,t){Jn.set(e._key(),t)}function er(e){return se(e._redirectPersistence)}function tr(e){return ce("pendingRedirect",e.config.apiKey,e.name)}
2302/**
2303 * @license
2304 * Copyright 2020 Google LLC
2305 *
2306 * Licensed under the Apache License, Version 2.0 (the "License");
2307 * you may not use this file except in compliance with the License.
2308 * You may obtain a copy of the License at
2309 *
2310 *   http://www.apache.org/licenses/LICENSE-2.0
2311 *
2312 * Unless required by applicable law or agreed to in writing, software
2313 * distributed under the License is distributed on an "AS IS" BASIS,
2314 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2315 * See the License for the specific language governing permissions and
2316 * limitations under the License.
2317 */function nr(e,t,n){return async function(e,t,n){if(Object(r._isFirebaseServerApp)(e.app))return Promise.reject(_(e));const i=Oe(e);y(e,t,Ye),await i._initializationPromise;const s=Fn(i,n);return await Xn(s,i),s._openRedirect(i,t,"signInViaRedirect")}(e,t,n)}function rr(e,t,n){return async function(e,t,n){const s=Object(i.o)(e);if(y(s.auth,t,Ye),Object(r._isFirebaseServerApp)(s.auth.app))return Promise.reject(_(s.auth));await s.auth._initializationPromise;const o=Fn(s.auth,n);await Xn(o,s.auth);const a=await ar(s);return o._openRedirect(s.auth,t,"reauthViaRedirect",a)}(e,t,n)}function ir(e,t,n){return async function(e,t,n){const r=Object(i.o)(e);y(r.auth,t,Ye),await r.auth._initializationPromise;const s=Fn(r.auth,n);await ft(!1,r,t.providerId),await Xn(s,r.auth);const o=await ar(r);return s._openRedirect(r.auth,t,"linkViaRedirect",o)}(e,t,n)}async function sr(e,t){return await Oe(e)._initializationPromise,or(e,t,!1)}async function or(e,t,n=!1){if(Object(r._isFirebaseServerApp)(e.app))return Promise.reject(_(e));const i=Oe(e),s=Fn(i,t),o=new Yn(i,s,n),a=await o.execute();return a&&!n&&(delete a.user._redirectEventId,await i._persistUserIfCurrent(a.user),await i._setRedirectUser(null,t)),a}async function ar(e){const t=ln(e.uid+":::");return e._redirectEventId=t,await e.auth._setRedirectUser(e),await e.auth._persistUserIfCurrent(e),t}
2318/**
2319 * @license
2320 * Copyright 2020 Google LLC
2321 *
2322 * Licensed under the Apache License, Version 2.0 (the "License");
2323 * you may not use this file except in compliance with the License.
2324 * You may obtain a copy of the License at
2325 *
2326 *   http://www.apache.org/licenses/LICENSE-2.0
2327 *
2328 * Unless required by applicable law or agreed to in writing, software
2329 * distributed under the License is distributed on an "AS IS" BASIS,
2330 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2331 * See the License for the specific language governing permissions and
2332 * limitations under the License.
2333 */class cr{constructor(e){this.auth=e,this.cachedEventUids=new Set,this.consumers=new Set,this.queuedRedirectEvent=null,this.hasHandledPotentialRedirect=!1,this.lastProcessedEventTime=
2333Date.now()}registerConsumer(e){this.consumers.add(e),this.queuedRedirectEvent&&this.isEventForConsumer(this.queuedRedirectEvent,e)&&(this.sendToConsumer(this.queuedRedirectEvent,e),this.saveEventToCache(this.queuedRedirectEvent),this.queuedRedirectEvent=null)}unregisterConsumer(e){this.consumers.delete(e)}onEvent(e){if(this.hasEventBeenHandled(e))return!1;let t=!1;return this.consumers.forEach(n=>{this.isEventForConsumer(e,n)&&(t=!0,this.sendToConsumer(e,n),this.saveEventToCache(e))}),this.hasHandledPotentialRedirect||!function(e){switch(e.type){case"signInViaRedirect":case"linkViaRedirect":case"reauthViaRedirect":return!0;case"unknown":return dr(e);default:return!1}}
2334/**
2335 * @license
2336 * Copyright 2020 Google LLC
2337 *
2338 * Licensed under the Apache License, Version 2.0 (the "License");
2339 * you may not use this file except in compliance with the License.
2340 * You may obtain a copy of the License at
2341 *
2342 *   http://www.apache.org/licenses/LICENSE-2.0
2343 *
2344 * Unless required by applicable law or agreed to in writing, software
2345 * distributed under the License is distributed on an "AS IS" BASIS,
2346 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2347 * See the License for the specific language governing permissions and
2348 * limitations under the License.
2349 */(e)||(this.hasHandledPotentialRedirect=!0,t||(this.queuedRedirectEvent=e,t=!0)),t}sendToConsumer(e,t){var n;if(e.error&&!dr(e)){const r=(null===(n=e.error.code)||void 0===n?void 0:n.split("auth/")[1])||"internal-error";t.onError(v(this.auth,r))}else t.onAuthEvent(e)}isEventForConsumer(e,t){const n=null===t.eventId||!!e.eventId&&e.eventId===t.eventId;return t.filter.includes(e.type)&&n}hasEventBeenHandled(e){return Date.now()-this.lastProcessedEventTime>=6e5&&this.cachedEventUids.clear(),this.cachedEventUids.has(ur(e))}saveEventToCache(e){this.cachedEventUids.add(ur(e)),this.lastProcessedEventTime=Date.now()}}function ur(e){return[e.type,e.eventId,e.sessionId,e.tenantId].filter(e=>e).join("-")}function dr({type:e,error:t}){return"unknown"===e&&"auth/no-auth-event"===(null==t?void 0:t.code)}async function lr(e,t={}){return L(e,"GET","/v1/projects",t)}
2350/**
2351 * @license
2352 * Copyright 2020 Google LLC
2353 *
2354 * Licensed under the Apache License, Version 2.0 (the "License");
2355 * you may not use this file except in compliance with the License.
2356 * You may obtain a copy of the License at
2357 *
2358 *   http://www.apache.org/licenses/LICENSE-2.0
2359 *
2360 * Unless required by applicable law or agreed to in writing, software
2361 * distributed under the License is distributed on an "AS IS" BASIS,
2362 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2363 * See the License for the specific language governing permissions and
2364 * limitations under the License.
2365 */const hr=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,pr=/^https?/;function fr(e){const t=O(),{protocol:n,hostname:r}=new URL(t);if(e.startsWith("chrome-extension://")){const i=new URL(e);return""===i.hostname&&""===r?"chrome-extension:"===n&&e.replace("chrome-extension://","")===t.replace("chrome-extension://",""):"chrome-extension:"===n&&i.hostname===r}if(!pr.test(n))return!1;if(hr.test(e))return r===e;const i=e.replace(/\./g,"\\.");return new RegExp("^(.+\\."+i+"|"+i+")$","i").test(r)}
2366/**
2367 * @license
2368 * Copyright 2020 Google LLC.
2369 *
2370 * Licensed under the Apache License, Version 2.0 (the "License");
2371 * you may not use this file except in compliance with the License.
2372 * You may obtain a copy of the License at
2373 *
2374 *   http://www.apache.org/licenses/LICENSE-2.0
2375 *
2376 * Unless required by applicable law or agreed to in writing, software
2377 * distributed under the License is distributed on an "AS IS" BASIS,
2378 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2379 * See the License for the specific language governing permissions and
2380 * limitations under the License.
2381 */const mr=new A(3e4,6e4);function gr(){const e=pn().___jsl;if(null==e?void 0:e.H)for(const t of Object.keys(e.H))if(e.H[t].r=e.H[t].r||[],e.H[t].L=e.H[t].L||[],e.H[t].r=[...e.H[t].L],e.CP)for(let t=0;t<e.CP.length;t++)e.CP[t]=null}function vr(e){return new Promise((t,n)=>{var r,i,s;function o(){gr(),gapi.load("gapi.iframes",{callback:()=>{t(gapi.iframes.getContext())},ontimeout:()=>{gr(),n(v(e,"network-request-failed"))},timeout:mr.get()})}if(null===(i=null===(r=pn().gapi)||void 0===r?void 0:r.iframes)||void 0===i?void 0:i.Iframe)t(gapi.iframes.getContext());else{if(!(null===(s=pn().gapi)||void 0===s?void 0:s.load)){const t=Ce("iframefcb");return pn()[t]=()=>{gapi.load?o():n(v(e,"network-request-failed"))},Ae(`${Se.gapiScript}?onload=${t}`).catch(e=>n(e))}o()}}).catch(e=>{throw br=null,e})}let br=null;
2382/**
2383 * @license
2384 * Copyright 2020 Google LLC.
2385 *
2386 * Licensed under the Apache License, Version 2.0 (the "License");
2387 * you may not use this file except in compliance with the License.
2388 * You may obtain a copy of the License at
2389 *
2390 *   http://www.apache.org/licenses/LICENSE-2.0
2391 *
2392 * Unless required by applicable law or agreed to in writing, software
2393 * distributed under the License is distributed on an "AS IS" BASIS,
2394 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2395 * See the License for the specific language governing permissions and
2396 * limitations under the License.
2397 */
2398const _r=new A(5e3,15e3),yr={style:{position:"absolute",top:"-100px",width:"1px",height:"1px"},"aria-hidden":"true",tabindex:"-1"},wr=new Map([["identitytoolkit.googleapis.com","p"],["staging-identitytoolkit.sandbox.googleapis.com","s"],["test-identitytoolkit.sandbox.googleapis.com","t"]]);function Ir(e){const t=e.config;I(t.authDomain,e,"auth-domain-config-required");const n=t.emulator?C(t,"emulator/auth/iframe"):`https://${e.config.authDomain}/__/auth/iframe`,s={apiKey:t.apiKey,appName:e.name,v:r.SDK_VERSION},o=wr.get(e.config.apiHost);o&&(s.eid=o);const a=e._getFrameworks();return a.length&&(s.fw=a.join(",")),`${n}?${Object(i.A)(s).slice(1)}`}async function Tr(e){const t=await function(e){return br=br||vr(e),br}(e),n=pn().gapi;return I(n,e,"internal-error"),t.open({where:document.body,url:Ir(e),messageHandlersFilter:n.iframes.CROSS_ORIGIN_IFRAMES_FILTER,attributes:yr,dontclear:!0},t=>new Promise(async(n,r)=>{await t.restyle({setHideOnLeave:!1});const i=v(e,"network-request-failed"),s=pn().setTimeout(()=>{r(i)},_r.get());function o(){pn().clearTimeout(s),n(t)}t.ping(o).then(o,()=>{r(i)})}))}
2399/**
2400 * @license
2401 * Copyright 2020 Google LLC.
2402 *
2403 * Licensed under the Apache License, Version 2.0 (the "License");
2404 * you may not use this file except in compliance with the License.
2405 * You may obtain a copy of the License at
2406 *
2407 *   http://www.apache.org/licenses/LICENSE-2.0
2408 *
2409 * Unless required by applicable law or agreed to in writing, software
2410 * distributed under the License is distributed on an "AS IS" BASIS,
2411 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2412 * See the License for the specific language governing permissions and
2413 * limitations under the License.
2414 */const Er={location:"yes",resizable:"yes",statusbar:"yes",toolbar:"no"};class Or{constructor(e){this.window=e,this.associatedEvent=null}close(){if(this.window)try{this.window.close()}catch(e){}}}function kr(e,t,n,r=500,s=600){const o=Math.max((window.screen.availHeight-s)/2,0).toString(),a=Math.max((window.screen.availWidth-r)/2,0).toString();let c="";const u=Object.assign(Object.assign({},Er),{width:r.toString(),height:s.toString(),top:o,left:a}),d=Object(i.p)().toLowerCase();n&&(c=pe(d)?"_blank":n),le(d)&&(t=t||"http://localhost",u.scrollbars="yes");const l=Object.entries(u).reduce((e,[t,n])=>`${e}${t}=${n},`,"");if(function(e=Object(i.p)()){var t;return be(e)&&!!(null===(t=window.navigator)||void 0===t?void 0:t.standalone)}(d)&&"_self"!==c)return function(e,t){const n=document.createElement("a");n.href=e,n.target=t;const r=document.createEvent("MouseEvent");r.initMouseEvent("click",!0,!0,window,1,0,0,0,0,!1,!1,!1,!1,1,null),n.dispatchEvent(r)}
2415/**
2416 * @license
2417 * Copyright 2021 Google LLC
2418 *
2419 * Licensed under the Apache License, Version 2.0 (the "License");
2420 * you may not use this file except in compliance with the License.
2421 * You may obtain a copy of the License at
2422 *
2423 *   http://www.apache.org/licenses/LICENSE-2.0
2424 *
2425 * Unless required by applicable law or agreed to in writing, software
2426 * distributed under the License is distributed on an "AS IS" BASIS,
2427 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2428 * See the License for the specific language governing permissions and
2429 * limitations under the License.
2430 */(t||"",c),new Or(null);const h=window.open(t||"",c,l);I(h,e,"popup-blocked");try{h.focus()}catch(e){}return new Or(h)}const Sr=encodeURIComponent("fac");async function Ar(e,t,n,s,o,a){I(e.config.authDomain,e,"auth-domain-config-required"),I(e.config.apiKey,e,"invalid-api-key");const c={apiKey:e.config.apiKey,appName:e.name,authType:n,redirectUrl:s,v:r.SDK_VERSION,eventId:o};if(t instanceof Ye){t.setDefaultLanguage(e.languageCode),c.providerId=t.providerId||"",Object(i.t)(t.getCustomParameters())||(c.customParameters=JSON.stringify(t.getCustomParameters()));for(const[e,t]of Object.entries(a||{}))c[e]=t}if(t instanceof Xe){const e=t.getScopes().filter(e=>""!==e);e.length>0&&(c.scopes=e.join(","))}e.tenantId&&(c.tid=e.tenantId);const u=c;for(const e of Object.keys(u))void 0===u[e]&&delete u[e];const d=await e._getAppCheckToken(),l=d?`#${Sr}=${encodeURIComponent(d)}`:"";return`${function({config:e}){if(!e.emulator)return`https://${e.authDomain}/__/auth/handler`;return C(e,"emulator/auth/handler")}
2431/**
2432 * @license
2433 * Copyright 2020 Google LLC
2434 *
2435 * Licensed under the Apache License, Version 2.0 (the "License");
2436 * you may not use this file except in compliance with the License.
2437 * You may obtain a copy of the License at
2438 *
2439 *   http://www.apache.org/licenses/LICENSE-2.0
2440 *
2441 * Unless required by applicable law or agreed to in writing, software
2442 * distributed under the License is distributed on an "AS IS" BASIS,
2443 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2444 * See the License for the specific language governing permissions and
2445 * limitations under the License.
2446 */(e)}?${Object(i.A)(u).slice(1)}${l}`}const Cr=class{constructor(){this.eventManagers={},this.iframes={},this.originValidationPromises={},this._redirectPersistence=un,this._completeRedirectFn=or,this._overrideRedirectResult=Qn}async _openPopup(e,t,n,r){var i;E(null===(i=this.eventManagers[e._key()])||void 0===i?void 0:i.manager,"_initialize() not called before _openPopup()");return kr(e,await Ar(e,t,n,O(),r),ln())}async _openRedirect(e,t,n,r){await this._originValidation(e);return function(e){pn().location.href=e}(await Ar(e,t,n,O(),r)),new Promise(()=>{})}_initialize(e){const t=e._key();if(this.eventManagers[t]){const{manager:e,promise:n}=this.eventManagers[t];return e?Promise.resolve(e):(E(n,"If manager is not set, promise should be"),n)}const n=this.initAndGetManager(e);return this.eventManagers[t]={promise:n},n.catch(()=>{delete this.eventManagers[t]}),n}async initAndGetManager(e){const t=await Tr(e),n=new cr(e);return t.register("authEvent",t=>{I(null==t?void 0:t.authEvent,e,"invalid-auth-event");return{status:n.onEvent(t.authEvent)?"ACK":"ERROR"}},gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER),this.eventManagers[e._key()]={manager:n},this.iframes[e._key()]=t,n}_isIframeWebStorageSupported(e,t){this.iframes[e._key()].send("webStorageSupport",{type:"webStorageSupport"},n=>{var r;const i=null===(r=null==n?void 0:n[0])||void 0===r?void 0:r.webStorageSupport;void 0!==i&&t(!!i),g(e,"internal-error")},gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER)}_originValidation(e){const t=e._key();return this.originValidationPromises[t]||(this.originValidationPromises[t]=async function(e){if(e.config.emulator)return;const{authorizedDomains:t}=await lr(e);for(const e of t)try{if(fr(e))return}catch(e){}g(e,"unauthorized-domain")}(e)),this.originValidationPromises[t]}get _shouldInitProactively(){return ye()||he()||be()}};class Rr{constructor(e){this.factorId=e}_process(e,t,n){switch(t.type){case"enroll":return this._finalizeEnroll(e,t.credential,n);case"signin":return this._finalizeSignIn(e,t.credential);default:return T("unexpected MultiFactorSessionType")}}}class Pr extends Rr{constructor(e){super("phone"),this.credential=e}static _fromCredential(e){return new Pr(e)}_finalizeEnroll(e,t,n){return function(e,t){return L(e,"POST","/v2/accounts/mfaEnrollment:finalize",D(e,t))}(e,{idToken:t,displayName:n,phoneVerificationInfo:this.credential._makeVerificationRequest()})}_finalizeSignIn(e,t){return function(e,t){return L(e,"POST","/v2/accounts/mfaSignIn:finalize",D(e,t))}(e,{mfaPendingCredential:t,phoneVerificationInfo:this.credential._makeVerificationRequest()})}}class Nr{constructor(){}static assertion(e){return Pr._fromCredential(e)}}Nr.FACTOR_ID="phone";var Dr="@firebase/auth";
2447/**
2448 * @license
2449 * Copyright 2020 Google LLC
2450 *
2451 * Licensed under the Apache License, Version 2.0 (the "License");
2452 * you may not use this file except in compliance with the License.
2453 * You may obtain a copy of the License at
2454 *
2455 *   http://www.apache.org/licenses/LICENSE-2.0
2456 *
2457 * Unless required by applicable law or agreed to in writing, software
2458 * distributed under the License is distributed on an "AS IS" BASIS,
2459 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2460 * See the License for the specific language governing permissions and
2461 * limitations under the License.
2462 */
2463class Lr{constructor(e){this.auth=e,this.internalListeners=new Map}getUid(){var e;return this.assertAuthConfigured(),(null===(e=this.auth.currentUser)||void 0===e?void 0:e.uid)||null}async getToken(e){if(this.assertAuthConfigured(),await this.auth._initializationPromise,!this.auth.currentUser)return null;return{accessToken:await this.auth.currentUser.getIdToken(e)}}addAuthTokenListener(e){if(this.assertAuthConfigured(),this.internalListeners.has(e))return;const t=this.auth.onIdTokenChanged(t=>{e((null==t?void 0:t.stsTokenManager.accessToken)||null)});this.internalListeners.set(e,t),this.updateProactiveRefresh()}removeAuthTokenListener(e){this.assertAuthConfigured();const t=this.internalListeners.get(e);t&&(this.internalListeners.delete(e),t(),this.updateProactiveRefresh())}assertAuthConfigured(){I(this.auth._initializationPromise,"dependent-sdk-initialized-before-auth")}updateProactiveRefresh(){this.internalListeners.size>0?this.auth._startProactiveRefresh():this.auth._stopProactiveRefresh()}}
2464/**
2465 * @license
2466 * Copyright 2020 Google LLC
2467 *
2468 * Licensed under the Apache License, Version 2.0 (the "License");
2469 * you may not use this file except in compliance with the License.
2470 * You may obtain a copy of the License at
2471 *
2472 *   http://www.apache.org/licenses/LICENSE-2.0
2473 *
2474 * Unless required by applicable law or agreed to in writing, software
2475 * distributed under the License is distributed on an "AS IS" BASIS,
2476 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2477 * See the License for the specific language governing permissions and
2478 * limitations under the License.
2479 */
2480/**
2481 * @license
2482 * Copyright 2021 Google LLC
2483 *
2484 * Licensed under the Apache License, Version 2.0 (the "License");
2485 * you may not use this file except in compliance with the License.
2486 * You may obtain a copy of the License at
2487 *
2488 *   http://www.apache.org/licenses/LICENSE-2.0
2489 *
2490 * Unless required by applicable law or agreed to in writing, software
2491 * distributed under the License is distributed on an "AS IS" BASIS,
2492 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2493 * See the License for the specific language governing permissions and
2494 * limitations under the License.
2495 */
2496const jr=Object(i.m)("authIdTokenMaxAge")||300;let Ur=null;function Mr(e=Object(r.getApp)()){const t=Object(r._getProvider)(e,"auth");if(t.isInitialized())return t.getImmediate();const n=
2497/**
2498 * @license
2499 * Copyright 2020 Google LLC
2500 *
2501 * Licensed under the Apache License, Version 2.0 (the "License");
2502 * you may not use this file except in compliance with the License.
2503 * You may obtain a copy of the License at
2504 *
2505 *   http://www.apache.org/licenses/LICENSE-2.0
2506 *
2507 * Unless required by applicable law or agreed to in writing, software
2508 * distributed under the License is distributed on an "AS IS" BASIS,
2509 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2510 * See the License for the specific language governing permissions and
2511 * limitations under the License.
2512 */
2513function(e,t){const n=Object(r._getProvider)(e,"auth");if(n.isInitialized()){const e=n.getImmediate(),r=n.getOptions();if(Object(i.h)(r,null!=t?t:{}))return e;g(e,"already-initialized")}return n.initialize({options:t})}(e,{popupRedirectResolver:Cr,persistence:[In,an,un]}),s=Object(i.m)("authTokenSyncURL");if(s&&"boolean"==typeof isSecureContext&&isSecureContext){const e=new URL(s,location.origin);if(location.origin===e.origin){const t=(o=e.toString(),async e=>{const t=e&&await e.getIdTokenResult(),n=t&&((new Date).getTime()-Date.parse(t.issuedAtTime))/1e3;if(n&&n>jr)return;const r=null==t?void 0:t.token;Ur!==r&&(Ur=r,await fetch(o,{method:r?"POST":"DELETE",headers:r?{Authorization:"Bearer "+r}:{}}))});!function(e,t,n){Object(i.o)(e).beforeAuthStateChanged(t,n)}(n,t,()=>t(n.currentUser)),function(e,t,n,r){Object(i.o)(e).onIdTokenChanged(t,n,r)}(n,e=>t(e))}}var o;const a=Object(i.l)("auth");return a&&De(n,"http://"+a),n}var Fr;Se={loadJS:e=>new Promise((t,n)=>{const r=document.createElement("script");var i,s;r.setAttribute("src",e),r.onload=t,r.onerror=e=>{const t=v("internal-error");t.customData=e,n(t)},r.type="text/javascript",r.charset="UTF-8",(null!==(s=null===(i=document.getElementsByTagName("head"))||void 0===i?void 0:i[0])&&void 0!==s?s:document).appendChild(r)}),gapiScript:"https://apis.google.com/js/api.js",recaptchaV2Script:"https://www.google.com/recaptcha/api.js",recaptchaEnterpriseScript:"https://www.google.com/recaptcha/enterprise.js?render="},Fr="Browser",Object(r._registerComponent)(new a.a("auth",(e,{options:t})=>{const n=e.getProvider("app").getImmediate(),r=e.getProvider("heartbeat"),i=e.getProvider("app-check-internal"),{apiKey:s,authDomain:o}=n.options;I(s&&!s.includes(":"),"invalid-api-key",{appName:n.name});const a={apiKey:s,authDomain:o,clientPlatform:Fr,apiHost:"identitytoolkit.googleapis.com",tokenApiHost:"securetoken.googleapis.com",apiScheme:"https",sdkClientVersion:we(Fr)},c=new Ee(n,r,i,a);return function(e,t){const n=(null==t?void 0:t.persistence)||[],r=(Array.isArray(n)?n:[n]).map(se);(null==t?void 0:t.errorMap)&&e._updateErrorMap(t.errorMap),e._initializeWithPersistence(r,null==t?void 0:t.popupRedirectResolver)}(c,t),c},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((e,t,n)=>{e.getProvider("auth-internal").initialize()})),Object(r._registerComponent)(new a.a("auth-internal",e=>(e=>new Lr(e))(Oe(e.getProvider("auth").getImmediate())),"PRIVATE").setInstantiationMode("EXPLICIT")),Ob
2513ject(r.registerVersion)(Dr,"1.7.9",function(e){switch(e){case"Node":return"node";case"ReactNative":return"rn";case"Worker":return"webworker";case"Cordova":return"cordova";case"WebExtension":return"web-extension";default:return}}(Fr)),Object(r.registerVersion)(Dr,"1.7.9","esm2017")},e691:function(e,t,n){"use strict";n.d(t,"a",(function(){return i})),n.d(t,"b",(function(){return u})),n.d(t,"c",(function(){return d})),n.d(t,"d",(function(){return l}));
2514/**
2515 * @license
2516 * Copyright 2017 Google LLC
2517 *
2518 * Licensed under the Apache License, Version 2.0 (the "License");
2519 * you may not use this file except in compliance with the License.
2520 * You may obtain a copy of the License at
2521 *
2522 *   http://www.apache.org/licenses/LICENSE-2.0
2523 *
2524 * Unless required by applicable law or agreed to in writing, software
2525 * distributed under the License is distributed on an "AS IS" BASIS,
2526 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2527 * See the License for the specific language governing permissions and
2528 * limitations under the License.
2529 */
2530const r=[];var i;!function(e){e[e.DEBUG=0]="DEBUG",e[e.VERBOSE=1]="VERBOSE",e[e.INFO=2]="INFO",e[e.WARN=3]="WARN",e[e.ERROR=4]="ERROR",e[e.SILENT=5]="SILENT"}(i||(i={}));const s={debug:i.DEBUG,verbose:i.VERBOSE,info:i.INFO,warn:i.WARN,error:i.ERROR,silent:i.SILENT},o=i.INFO,a={[i.DEBUG]:"log",[i.VERBOSE]:"log",[i.INFO]:"info",[i.WARN]:"warn",[i.ERROR]:"error"},c=(e,t,...n)=>{if(t<e.logLevel)return;const r=(new Date).toISOString(),i=a[t];if(!i)throw new Error(`Attempted to log a message with an invalid logType (value: ${t})`);console[i](`[${r}]  ${e.name}:`,...n)};class u{constructor(e){this.name=e,this._logLevel=o,this._logHandler=c,this._userLogHandler=null,r.push(this)}get logLevel(){return this._logLevel}set logLevel(e){if(!(e in i))throw new TypeError(`Invalid value "${e}" assigned to \`logLevel\``);this._logLevel=e}setLogLevel(e){this._logLevel="string"==typeof e?s[e]:e}get logHandler(){return this._logHandler}set logHandler(e){if("function"!=typeof e)throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=e}get userLogHandler(){return this._userLogHandler}set userLogHandler(e){this._userLogHandler=e}debug(...e){this._userLogHandler&&this._userLogHandler(this,i.DEBUG,...e),this._logHandler(this,i.DEBUG,...e)}log(...e){this._userLogHandler&&this._userLogHandler(this,i.VERBOSE,...e),this._logHandler(this,i.VERBOSE,...e)}info(...e){this._userLogHandler&&this._userLogHandler(this,i.INFO,...e),this._logHandler(this,i.INFO,...e)}warn(...e){this._userLogHandler&&this._userLogHandler(this,i.WARN,...e),this._logHandler(this,i.WARN,...e)}error(...e){this._userLogHandler&&this._userLogHandler(this,i.ERROR,...e),this._logHandler(this,i.ERROR,...e)}}function d(e){r.forEach(t=>{t.setLogLevel(e)})}function l(e,t){for(const n of r){let r=null;t&&t.level&&(r=s[t.level]),n.userLogHandler=null===e?null:(t,n,...s)=>{const o=s.map(e=>{if(null==e)return null;if("string"==typeof e)return e;if("number"==typeof e||"boolean"==typeof e)return e.toString();if(e instanceof Error)return e.message;try{return JSON.stringify(e)}catch(e){return null}}).filter(e=>e).join(" ");n>=(null!=r?r:t.logLevel)&&e({level:i[n].toLowerCase(),message:o,args:s,type:t.name})}}}},e9f8:function(e,t,n){"use strict";n("5994")}}]);
2531//# sourceMappingURL=1790192282886_npm.firebase.05d26338.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.