firebase-auth-cordova.js 144 KB

123
  1. import{SDK_VERSION as e,_getProvider as t,_registerComponent as n,registerVersion as r,getApp as i}from"https://www.gstatic.com/firebasejs/9.23.0/firebase-app.js";var o=function(e,t){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},o(e,t)};function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var a=function(){return a=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},a.apply(this,arguments)};function u(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}function c(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((r=r.apply(e,t||[])).next())}))}function d(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}}function l(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}const h={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;t+=3){const i=e[t],o=t+1<e.length,s=o?e[t+1]:0,a=t+2<e.length,u=a?e[t+2]:0,c=i>>2,d=(3&i)<<4|s>>4;let l=(15&s)<<2|u>>6,h=63&u;a||(h=64,o||(l=64)),r.push(n[c],n[d],n[l],n[h])}return r.join("")},encodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?btoa(e):this.encodeByteArray(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}(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 o=e[n++];t[r++]=String.fromCharCode((31&i)<<6|63&o)}else if(i>239&&i<365){const o=((7&i)<<18|(63&e[n++])<<12|(63&e[n++])<<6|63&e[n++])-65536;t[r++]=String.fromCharCode(55296+(o>>10)),t[r++]=String.fromCharCode(56320+(1023&o))}else{const o=e[n++],s=e[n++];t[r++]=String.fromCharCode((15&i)<<12|(63&o)<<6|63&s)}}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++)],o=t<e.length?n[e.charAt(t)]:0;++t;const s=t<e.length?n[e.charAt(t)]:64;++t;const a=t<e.length?n[e.charAt(t)]:64;if(++t,null==i||null==o||null==s||null==a)throw new f;const u=i<<2|o>>4;if(r.push(u),64!==s){const e=o<<4&240|s>>2;if(r.push(e),64!==a){const e=s<<6&192|a;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)}}};class f extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}}function p(){return"undefined"!=typeof navigator&&"string"==typeof navigator.userAgent?navigator.userAgent:""}class v extends Error{constructor(e,t,n){super(t),this.code=e,this.customData=n,this.name="FirebaseError",Object.setPrototypeOf(this,v.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,m.prototype.create)}}class m{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],o=i?function(e,t){return e.replace(g,((e,n)=>{const r=t[n];return null!=r?String(r):`<${n}?>`}))}(i,n):"Error",s=`${this.serviceName}: ${o} (${r}).`;return new v(r,s,n)}}const g=/\{\$([^}]+)}/g;function _(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],o=t[i];if(I(n)&&I(o)){if(!_(n,o))return!1}else if(n!==o)return!1}for(const e of r)if(!n.includes(e))return!1;return!0}function I(e){return null!==e&&"object"==typeof e}function y(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 T(e){const t={};return e.replace(/^\?/,"").split("&").forEach((e=>{if(e){const[n,r]=e.split("=");t[decodeURIComponent(n)]=decodeURIComponent(r)}})),t}function b(e){const t=e.indexOf("?");if(!t)return"";const n=e.indexOf("#",t);return e.substring(t,n>0?n:void 0)}class E{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=A),void 0===r.error&&(r.error=A),void 0===r.complete&&(r.complete=A);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 A(){}function w(e){return e&&e._delegate?e._delegate:e}class k{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}}var R;!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"}(R||(R={}));const N={debug:R.DEBUG,verbose:R.VERBOSE,info:R.INFO,warn:R.WARN,error:R.ERROR,silent:R.SILENT},S=R.INFO,O={[R.DEBUG]:"log",[R.VERBOSE]:"log",[R.INFO]:"info",[R.WARN]:"warn",[R.ERROR]:"error"},C=(e,t,...n)=>{if(t<e.logLevel)return;const r=(new Date).toISOString(),i=O[t];if(!i)throw new Error(`Attempted to log a message with an invalid logType (value: ${t})`);console[i](`[${r}] ${e.name}:`,...n)};function P(e){var t=this;return Promise.all(e.map((function(e){return c(t,void 0,void 0,(function(){return d(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,e];case 1:return[2,{fulfilled:!0,value:t.sent()}];case 2:return[2,{fulfilled:!1,reason:t.sent()}];case 3:return[2]}}))}))})))}var D=function(){function e(e){this.eventTarget=e,this.handlersMap={},this.boundEventHandler=this.handleEvent.bind(this)}return e._getInstance=function(t){var n=this.receivers.find((function(e){return e.isListeningto(t)}));if(n)return n;var r=new e(t);return this.receivers.push(r),r},e.prototype.isListeningto=function(e){return this.eventTarget===e},e.prototype.handleEvent=function(e){return c(this,void 0,void 0,(function(){var t,n,r,i,o,s,a,u=this;return d(this,(function(l){switch(l.label){case 0:return n=(t=e).data,r=n.eventId,i=n.eventType,o=n.data,(null==(s=this.handlersMap[i])?void 0:s.size)?(t.ports[0].postMessage({status:"ack",eventId:r,eventType:i}),[4,P(Array.from(s).map((function(e){return c(u,void 0,void 0,(function(){return d(this,(function(n){return[2,e(t.origin,o)]}))}))})))]):[2];case 1:return a=l.sent(),t.ports[0].postMessage({status:"done",eventId:r,eventType:i,response:a}),[2]}}))}))},e.prototype._subscribe=function(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)},e.prototype._unsubscribe=function(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)},e.receivers=[],e}();function L(e,t){void 0===e&&(e=""),void 0===t&&(t=10);for(var n="",r=0;r<t;r++)n+=Math.floor(10*Math.random());return e+n}var U=function(){function e(e){this.target=e,this.handlers=new Set}return e.prototype.removeMessageHandler=function(e){e.messageChannel&&(e.messageChannel.port1.removeEventListener("message",e.onMessage),e.messageChannel.port1.close()),this.handlers.delete(e)},e.prototype._send=function(e,t,n){return void 0===n&&(n=50),c(this,void 0,void 0,(function(){var r,i,o,s=this;return d(this,(function(a){if(!(r="undefined"!=typeof MessageChannel?new MessageChannel:null))throw new Error("connection_unavailable");return[2,new Promise((function(a,u){var c=L("",20);r.port1.start();var d=setTimeout((function(){u(new Error("unsupported_event"))}),n);o={messageChannel:r,onMessage:function(e){var t=e;if(t.data.eventId===c)switch(t.data.status){case"ack":clearTimeout(d),i=setTimeout((function(){u(new Error("timeout"))}),3e3);break;case"done":clearTimeout(i),a(t.data.response);break;default:clearTimeout(d),clearTimeout(i),u(new Error("invalid_response"))}}},s.handlers.add(o),r.port1.addEventListener("message",o.onMessage),s.target.postMessage({eventType:e,eventId:c,data:t},[r.port2])})).finally((function(){o&&s.removeMessageHandler(o)}))]}))}))},e}();function M(){return window}function V(){return void 0!==M().WorkerGlobalScope&&"function"==typeof M().importScripts}function F(){return c(this,void 0,void 0,(function(){return d(this,(function(e){switch(e.label){case 0:if(!(null===navigator||void 0===navigator?void 0:navigator.serviceWorker))return[2,null];e.label=1;case 1:return e.trys.push([1,3,,4]),[4,navigator.serviceWorker.ready];case 2:return[2,e.sent().active];case 3:return e.sent(),[2,null];case 4:return[2]}}))}))}var H="firebaseLocalStorageDb",x=function(){function e(e){this.request=e}return e.prototype.toPromise=function(){var e=this;return new Promise((function(t,n){e.request.addEventListener("success",(function(){t(e.request.result)})),e.request.addEventListener("error",(function(){n(e.request.error)}))}))},e}();function j(e,t){return e.transaction(["firebaseLocalStorage"],t?"readwrite":"readonly").objectStore("firebaseLocalStorage")}function q(){var e=indexedDB.deleteDatabase(H);return new x(e).toPromise()}function B(){var e=this,t=indexedDB.open(H,1);return new Promise((function(n,r){t.addEventListener("error",(function(){r(t.error)})),t.addEventListener("upgradeneeded",(function(){var e=t.result;try{e.createObjectStore("firebaseLocalStorage",{keyPath:"fbase_key"})}catch(e){r(e)}})),t.addEventListener("success",(function(){return c(e,void 0,void 0,(function(){var e,r;return d(this,(function(i){switch(i.label){case 0:return(e=t.result).objectStoreNames.contains("firebaseLocalStorage")?[3,3]:(e.close(),[4,q()]);case 1:return i.sent(),r=n,[4,B()];case 2:return r.apply(void 0,[i.sent()]),[3,4];case 3:n(e),i.label=4;case 4:return[2]}}))}))}))}))}function W(e,t,n){return c(this,void 0,void 0,(function(){var r,i;return d(this,(function(o){return r=j(e,!0).put(((i={}).fbase_key=t,i.value=n,i)),[2,new x(r).toPromise()]}))}))}function G(e,t){var n=j(e,!0).delete(t);return new x(n).toPromise()}var z=function(){function e(){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((function(){}),(function(){}))}return e.prototype._openDb=function(){return c(this,void 0,void 0,(function(){var e;return d(this,(function(t){switch(t.label){case 0:return this.db?[2,this.db]:(e=this,[4,B()]);case 1:return e.db=t.sent(),[2,this.db]}}))}))},e.prototype._withRetries=function(e){return c(this,void 0,void 0,(function(){var t,n,r;return d(this,(function(i){switch(i.label){case 0:t=0,i.label=1;case 1:i.label=2;case 2:return i.trys.push([2,5,,6]),[4,this._openDb()];case 3:return n=i.sent(),[4,e(n)];case 4:return[2,i.sent()];case 5:if(r=i.sent(),t++>3)throw r;return this.db&&(this.db.close(),this.db=void 0),[3,6];case 6:return[3,1];case 7:return[2]}}))}))},e.prototype.initializeServiceWorkerMessaging=function(){return c(this,void 0,void 0,(function(){return d(this,(function(e){return[2,V()?this.initializeReceiver():this.initializeSender()]}))}))},e.prototype.initializeReceiver=function(){return c(this,void 0,void 0,(function(){var e=this;return d(this,(function(t){return this.receiver=D._getInstance(V()?self:null),this.receiver._subscribe("keyChanged",(function(t,n){return c(e,void 0,void 0,(function(){return d(this,(function(e){switch(e.label){case 0:return[4,this._poll()];case 1:return[2,{keyProcessed:e.sent().includes(n.key)}]}}))}))})),this.receiver._subscribe("ping",(function(t,n){return c(e,void 0,void 0,(function(){return d(this,(function(e){return[2,["keyChanged"]]}))}))})),[2]}))}))},e.prototype.initializeSender=function(){var e,t;return c(this,void 0,void 0,(function(){var n,r;return d(this,(function(i){switch(i.label){case 0:return n=this,[4,F()];case 1:return n.activeServiceWorker=i.sent(),this.activeServiceWorker?(this.sender=new U(this.activeServiceWorker),[4,this.sender._send("ping",{},800)]):[2];case 2:return(r=i.sent())?((null===(e=r[0])||void 0===e?void 0:e.fulfilled)&&(null===(t=r[0])||void 0===t?void 0:t.value.includes("keyChanged"))&&(this.serviceWorkerReceiverAvailable=!0),[2]):[2]}}))}))},e.prototype.notifyServiceWorker=function(e){return c(this,void 0,void 0,(function(){return d(this,(function(t){switch(t.label){case 0:if(!this.sender||!this.activeServiceWorker||function(){var e;return(null===(e=null===navigator||void 0===navigator?void 0:navigator.serviceWorker)||void 0===e?void 0:e.controller)||null}()!==this.activeServiceWorker)return[2];t.label=1;case 1:return t.trys.push([1,3,,4]),[4,this.sender._send("keyChanged",{key:e},this.serviceWorkerReceiverAvailable?800:50)];case 2:case 3:return t.sent(),[3,4];case 4:return[2]}}))}))},e.prototype._isAvailable=function(){return c(this,void 0,void 0,(function(){var e;return d(this,(function(t){switch(t.label){case 0:return t.trys.push([0,4,,5]),indexedDB?[4,B()]:[2,!1];case 1:return[4,W(e=t.sent(),"__sak","1")];case 2:return t.sent(),[4,G(e,"__sak")];case 3:return t.sent(),[2,!0];case 4:return t.sent(),[3,5];case 5:return[2,!1]}}))}))},e.prototype._withPendingWrite=function(e){return c(this,void 0,void 0,(function(){return d(this,(function(t){switch(t.label){case 0:this.pendingWrites++,t.label=1;case 1:return t.trys.push([1,,3,4]),[4,e()];case 2:return t.sent(),[3,4];case 3:return this.pendingWrites--,[7];case 4:return[2]}}))}))},e.prototype._set=function(e,t){return c(this,void 0,void 0,(function(){var n=this;return d(this,(function(r){return[2,this._withPendingWrite((function(){return c(n,void 0,void 0,(function(){return d(this,(function(n){switch(n.label){case 0:return[4,this._withRetries((function(n){return W(n,e,t)}))];case 1:return n.sent(),this.localCache[e]=t,[2,this.notifyServiceWorker(e)]}}))}))}))]}))}))},e.prototype._get=function(e){return c(this,void 0,void 0,(function(){var t;return d(this,(function(n){switch(n.label){case 0:return[4,this._withRetries((function(t){return function(e,t){return c(this,void 0,void 0,(function(){var n,r;return d(this,(function(i){switch(i.label){case 0:return n=j(e,!1).get(t),[4,new x(n).toPromise()];case 1:return[2,void 0===(r=i.sent())?null:r.value]}}))}))}(t,e)}))];case 1:return t=n.sent(),this.localCache[e]=t,[2,t]}}))}))},e.prototype._remove=function(e){return c(this,void 0,void 0,(function(){var t=this;return d(this,(function(n){return[2,this._withPendingWrite((function(){return c(t,void 0,void 0,(function(){return d(this,(function(t){switch(t.label){case 0:return[4,this._withRetries((function(t){return G(t,e)}))];case 1:return t.sent(),delete this.localCache[e],[2,this.notifyServiceWorker(e)]}}))}))}))]}))}))},e.prototype._poll=function(){return c(this,void 0,void 0,(function(){var e,t,n,r,i,o,s,a,u,c,l;return d(this,(function(d){switch(d.label){case 0:return[4,this._withRetries((function(e){var t=j(e,!1).getAll();return new x(t).toPromise()}))];case 1:if(!(e=d.sent()))return[2,[]];if(0!==this.pendingWrites)return[2,[]];for(t=[],n=new Set,r=0,i=e;r<i.length;r++)o=i[r],s=o.fbase_key,a=o.value,n.add(s),JSON.stringify(this.localCache[s])!==JSON.stringify(a)&&(this.notifyListeners(s,a),t.push(s));for(u=0,c=Object.keys(this.localCache);u<c.length;u++)l=c[u],this.localCache[l]&&!n.has(l)&&(this.notifyListeners(l,null),t.push(l));return[2,t]}}))}))},e.prototype.notifyListeners=function(e,t){this.localCache[e]=t;var n=this.listeners[e];if(n)for(var r=0,i=Array.from(n);r<i.length;r++){(0,i[r])(t)}},e.prototype.startPolling=function(){var e=this;this.stopPolling(),this.pollTimer=setInterval((function(){return c(e,void 0,void 0,(function(){return d(this,(function(e){return[2,this._poll()]}))}))}),800)},e.prototype.stopPolling=function(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)},e.prototype._addListener=function(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)},e.prototype._removeListener=function(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()},e.type="LOCAL",e}(),K=z;function J(){var e;return(e={})["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.",e}var Y=function(){var e;return(e={})["admin-restricted-operation"]="This operation is restricted to administrators only.",e["argument-error"]="",e["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.",e["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.",e["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.",e["code-expired"]="The SMS code has expired. Please re-send the verification code to try again.",e["cordova-not-ready"]="Cordova framework is not ready.",e["cors-unsupported"]="This browser is not supported.",e["credential-already-in-use"]="This credential is already associated with a different user account.",e["custom-token-mismatch"]="The custom token corresponds to a different audience.",e["requires-recent-login"]="This operation is sensitive and requires recent authentication. Log in again before retrying this request.",e["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.",e["dynamic-link-not-activated"]="Please activate Dynamic Links in the Firebase Console and agree to the terms and conditions.",e["email-change-needs-verification"]="Multi-factor users must always have a verified email.",e["email-already-in-use"]="The email address is already in use by another account.",e["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.',e["expired-action-code"]="The action code has expired.",e["cancelled-popup-request"]="This operation has been cancelled due to another conflicting popup being opened.",e["internal-error"]="An internal AuthError has occurred.",e["invalid-app-credential"]="The phone verification request contains an invalid application verifier. The reCAPTCHA token response is either invalid or expired.",e["invalid-app-id"]="The mobile app identifier is not registed for the current project.",e["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.",e["invalid-auth-event"]="An internal AuthError has occurred.",e["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.",e["invalid-continue-uri"]="The continue URL provided in the request is invalid.",e["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.",e["invalid-custom-token"]="The custom token format is incorrect. Please check the documentation.",e["invalid-dynamic-link-domain"]="The provided dynamic link domain is not configured or authorized for the current project.",e["invalid-email"]="The email address is badly formatted.",e["invalid-emulator-scheme"]="Emulator URL must start with a valid scheme (http:// or https://).",e["invalid-api-key"]="Your API key is invalid, please check you have copied it correctly.",e["invalid-cert-hash"]="The SHA-1 certificate hash provided is invalid.",e["invalid-credential"]="The supplied auth credential is malformed or has expired.",e["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.",e["invalid-multi-factor-session"]="The request does not contain a valid proof of first factor successful sign-in.",e["invalid-oauth-provider"]="EmailAuthProvider is not supported for this operation. This operation only supports OAuth providers.",e["invalid-oauth-client-id"]="The OAuth client ID provided is either invalid or does not match the specified API key.",e["unauthorized-domain"]="This domain is not authorized for OAuth operations for your Firebase project. Edit the list of authorized domains from the Firebase console.",e["invalid-action-code"]="The action code is invalid. This can happen if the code is malformed, expired, or has already been used.",e["wrong-password"]="The password is invalid or the user does not have a password.",e["invalid-persistence-type"]="The specified persistence type is invalid. It can only be local, session or none.",e["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].",e["invalid-provider-id"]="The specified provider ID is invalid.",e["invalid-recipient-email"]="The email corresponding to this action failed to send as the provided recipient email address is invalid.",e["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.",e["invalid-verification-id"]="The verification ID used to create the phone auth credential is invalid.",e["invalid-tenant-id"]="The Auth instance's tenant ID is invalid.",e["login-blocked"]="Login blocked by user-provided method: {$originalMessage}",e["missing-android-pkg-name"]="An Android Package Name must be provided if the Android App is required to be installed.",e["auth-domain-config-required"]="Be sure to include authDomain when calling firebase.initializeApp(), by following the instructions in the Firebase console.",e["missing-app-credential"]="The phone verification request is missing an application verifier assertion. A reCAPTCHA response token needs to be provided.",e["missing-verification-code"]="The phone auth credential was created with an empty SMS verification code.",e["missing-continue-uri"]="A continue URL must be provided in the request.",e["missing-iframe-start"]="An internal AuthError has occurred.",e["missing-ios-bundle-id"]="An iOS Bundle ID must be provided if an App Store ID is provided.",e["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.",e["missing-password"]="A non-empty password must be provided",e["missing-multi-factor-info"]="No second factor identifier is provided.",e["missing-multi-factor-session"]="The request is missing proof of first factor successful sign-in.",e["missing-phone-number"]="To send verification codes, provide a phone number for the recipient.",e["missing-verification-id"]="The phone auth credential was created with an empty verification ID.",e["app-deleted"]="This instance of FirebaseApp has been deleted.",e["multi-factor-info-not-found"]="The user does not have a second factor matching the identifier provided.",e["multi-factor-auth-required"]="Proof of ownership of a second factor is required to complete sign-in.",e["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.",e["network-request-failed"]="A network AuthError (such as timeout, interrupted connection or unreachable host) has occurred.",e["no-auth-event"]="An internal AuthError has occurred.",e["no-such-provider"]="User was not linked to an account with the given provider.",e["null-user"]="A null user object was provided as the argument for an operation which requires a non-null user object.",e["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.",e["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.',e["popup-blocked"]="Unable to establish a connection with the popup. It may have been blocked by the browser.",e["popup-closed-by-user"]="The popup has been closed by the user before finalizing the operation.",e["provider-already-linked"]="User can only be linked to one identity for the given provider.",e["quota-exceeded"]="The project's quota for this operation has been exceeded.",e["redirect-cancelled-by-user"]="The redirect operation has been cancelled by the user before finalizing.",e["redirect-operation-pending"]="A redirect sign-in operation is already pending.",e["rejected-credential"]="The request contains malformed or mismatching credentials.",e["second-factor-already-in-use"]="The second factor is already enrolled on this account.",e["maximum-second-factor-count-exceeded"]="The maximum allowed number of second factors on a user has been exceeded.",e["tenant-id-mismatch"]="The provided tenant ID does not match the Auth instance's tenant ID",e.timeout="The operation has timed out.",e["user-token-expired"]="The user's credential is no longer valid. The user must sign in again.",e["too-many-requests"]="We have blocked all requests from this device due to unusual activity. Try again later.",e["unauthorized-continue-uri"]="The domain of the continue URL is not whitelisted. Please whitelist the domain in the Firebase console.",e["unsupported-first-factor"]="Enrolling a second factor or signing in with a multi-factor account requires sign-in with a supported first factor.",e["unsupported-persistence-type"]="The current environment does not support the specified persistence type.",e["unsupported-tenant-operation"]="This operation is not supported in a multi-tenant context.",e["unverified-email"]="The operation requires a verified email.",e["user-cancelled"]="The user did not grant your application the permissions it requested.",e["user-not-found"]="There is no user record corresponding to this identifier. The user may have been deleted.",e["user-disabled"]="The user account has been disabled by an administrator.",e["user-mismatch"]="The supplied credentials do not correspond to the previously signed in user.",e["user-signed-out"]="",e["weak-password"]="The password must be 6 characters long or more.",e["web-storage-unsupported"]="This browser is not supported or 3rd party cookies and data may be disabled.",e["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.",e["missing-recaptcha-token"]="The reCAPTCHA token is missing when sending request to the backend.",e["invalid-recaptcha-token"]="The reCAPTCHA token is invalid when sending request to the backend.",e["invalid-recaptcha-action"]="The reCAPTCHA action is invalid when sending request to the backend.",e["recaptcha-not-enabled"]="reCAPTCHA Enterprise integration is not enabled for this project.",e["missing-client-type"]="The reCAPTCHA client type is missing when sending request to the backend.",e["missing-recaptcha-version"]="The reCAPTCHA version is missing when sending request to the backend.",e["invalid-req-type"]="Invalid request parameters.",e["invalid-recaptcha-version"]="The reCAPTCHA version is invalid when sending request to the backend.",e},X=J,Q=new m("auth","Firebase",J()),$={ADMIN_ONLY_OPERATION:"auth/admin-restricted-operation",ARGUMENT_ERROR:"auth/argument-error",APP_NOT_AUTHORIZED:"auth/app-not-authorized",APP_NOT_INSTALLED:"auth/app-not-installed",CAPTCHA_CHECK_FAILED:"auth/captcha-check-failed",CODE_EXPIRED:"auth/code-expired",CORDOVA_NOT_READY:"auth/cordova-not-ready",CORS_UNSUPPORTED:"auth/cors-unsupported",CREDENTIAL_ALREADY_IN_USE:"auth/credential-already-in-use",CREDENTIAL_MISMATCH:"auth/custom-token-mismatch",CREDENTIAL_TOO_OLD_LOGIN_AGAIN:"auth/requires-recent-login",DEPENDENT_SDK_INIT_BEFORE_AUTH:"auth/dependent-sdk-initialized-before-auth",DYNAMIC_LINK_NOT_ACTIVATED:"auth/dynamic-link-not-activated",EMAIL_CHANGE_NEEDS_VERIFICATION:"auth/email-change-needs-verification",EMAIL_EXISTS:"auth/email-already-in-use",EMULATOR_CONFIG_FAILED:"auth/emulator-config-failed",EXPIRED_OOB_CODE:"auth/expired-action-code",EXPIRED_POPUP_REQUEST:"auth/cancelled-popup-request",INTERNAL_ERROR:"auth/internal-error",INVALID_API_KEY:"auth/invalid-api-key",INVALID_APP_CREDENTIAL:"auth/invalid-app-credential",INVALID_APP_ID:"auth/invalid-app-id",INVALID_AUTH:"auth/invalid-user-token",INVALID_AUTH_EVENT:"auth/invalid-auth-event",INVALID_CERT_HASH:"auth/invalid-cert-hash",INVALID_CODE:"auth/invalid-verification-code",INVALID_CONTINUE_URI:"auth/invalid-continue-uri",INVALID_CORDOVA_CONFIGURATION:"auth/invalid-cordova-configuration",INVALID_CUSTOM_TOKEN:"auth/invalid-custom-token",INVALID_DYNAMIC_LINK_DOMAIN:"auth/invalid-dynamic-link-domain",INVALID_EMAIL:"auth/invalid-email",INVALID_EMULATOR_SCHEME:"auth/invalid-emulator-scheme",INVALID_IDP_RESPONSE:"auth/invalid-credential",INVALID_MESSAGE_PAYLOAD:"auth/invalid-message-payload",INVALID_MFA_SESSION:"auth/invalid-multi-factor-session",INVALID_OAUTH_CLIENT_ID:"auth/invalid-oauth-client-id",INVALID_OAUTH_PROVIDER:"auth/invalid-oauth-provider",INVALID_OOB_CODE:"auth/invalid-action-code",INVALID_ORIGIN:"auth/unauthorized-domain",INVALID_PASSWORD:"auth/wrong-password",INVALID_PERSISTENCE:"auth/invalid-persistence-type",INVALID_PHONE_NUMBER:"auth/invalid-phone-number",INVALID_PROVIDER_ID:"auth/invalid-provider-id",INVALID_RECIPIENT_EMAIL:"auth/invalid-recipient-email",INVALID_SENDER:"auth/invalid-sender",INVALID_SESSION_INFO:"auth/invalid-verification-id",INVALID_TENANT_ID:"auth/invalid-tenant-id",MFA_INFO_NOT_FOUND:"auth/multi-factor-info-not-found",MFA_REQUIRED:"auth/multi-factor-auth-required",MISSING_ANDROID_PACKAGE_NAME:"auth/missing-android-pkg-name",MISSING_APP_CREDENTIAL:"auth/missing-app-credential",MISSING_AUTH_DOMAIN:"auth/auth-domain-config-required",MISSING_CODE:"auth/missing-verification-code",MISSING_CONTINUE_URI:"auth/missing-continue-uri",MISSING_IFRAME_START:"auth/missing-iframe-start",MISSING_IOS_BUNDLE_ID:"auth/missing-ios-bundle-id",MISSING_OR_INVALID_NONCE:"auth/missing-or-invalid-nonce",MISSING_MFA_INFO:"auth/missing-multi-factor-info",MISSING_MFA_SESSION:"auth/missing-multi-factor-session",MISSING_PHONE_NUMBER:"auth/missing-phone-number",MISSING_SESSION_INFO:"auth/missing-verification-id",MODULE_DESTROYED:"auth/app-deleted",NEED_CONFIRMATION:"auth/account-exists-with-different-credential",NETWORK_REQUEST_FAILED:"auth/network-request-failed",NULL_USER:"auth/null-user",NO_AUTH_EVENT:"auth/no-auth-event",NO_SUCH_PROVIDER:"auth/no-such-provider",OPERATION_NOT_ALLOWED:"auth/operation-not-allowed",OPERATION_NOT_SUPPORTED:"auth/operation-not-supported-in-this-environment",POPUP_BLOCKED:"auth/popup-blocked",POPUP_CLOSED_BY_USER:"auth/popup-closed-by-user",PROVIDER_ALREADY_LINKED:"auth/provider-already-linked",QUOTA_EXCEEDED:"auth/quota-exceeded",REDIRECT_CANCELLED_BY_USER:"auth/redirect-cancelled-by-user",REDIRECT_OPERATION_PENDING:"auth/redirect-operation-pending",REJECTED_CREDENTIAL:"auth/rejected-credential",SECOND_FACTOR_ALREADY_ENROLLED:"auth/second-factor-already-in-use",SECOND_FACTOR_LIMIT_EXCEEDED:"auth/maximum-second-factor-count-exceeded",TENANT_ID_MISMATCH:"auth/tenant-id-mismatch",TIMEOUT:"auth/timeout",TOKEN_EXPIRED:"auth/user-token-expired",TOO_MANY_ATTEMPTS_TRY_LATER:"auth/too-many-requests",UNAUTHORIZED_DOMAIN:"auth/unauthorized-continue-uri",UNSUPPORTED_FIRST_FACTOR:"auth/unsupported-first-factor",UNSUPPORTED_PERSISTENCE:"auth/unsupported-persistence-type",UNSUPPORTED_TENANT_OPERATION:"auth/unsupported-tenant-operation",UNVERIFIED_EMAIL:"auth/unverified-email",USER_CANCELLED:"auth/user-cancelled",USER_DELETED:"auth/user-not-found",USER_DISABLED:"auth/user-disabled",USER_MISMATCH:"auth/user-mismatch",USER_SIGNED_OUT:"auth/user-signed-out",WEAK_PASSWORD:"auth/weak-password",WEB_STORAGE_UNSUPPORTED:"auth/web-storage-unsupported",ALREADY_INITIALIZED:"auth/already-initialized",RECAPTCHA_NOT_ENABLED:"auth/recaptcha-not-enabled",MISSING_RECAPTCHA_TOKEN:"auth/missing-recaptcha-token",INVALID_RECAPTCHA_TOKEN:"auth/invalid-recaptcha-token",INVALID_RECAPTCHA_ACTION:"auth/invalid-recaptcha-action",MISSING_CLIENT_TYPE:"auth/missing-client-type",MISSING_RECAPTCHA_VERSION:"auth/missing-recaptcha-version",INVALID_RECAPTCHA_VERSION:"auth/invalid-recaptcha-version",INVALID_REQ_TYPE:"auth/invalid-req-type"},Z=new class{constructor(e){this.name=e,this._logLevel=S,this._logHandler=C,this._userLogHandler=null}get logLevel(){return this._logLevel}set logLevel(e){if(!(e in R))throw new TypeError(`Invalid value "${e}" assigned to \`logLevel\``);this._logLevel=e}setLogLevel(e){this._logLevel="string"==typeof e?N[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,R.DEBUG,...e),this._logHandler(this,R.DEBUG,...e)}log(...e){this._userLogHandler&&this._userLogHandler(this,R.VERBOSE,...e),this._logHandler(this,R.VERBOSE,...e)}info(...e){this._userLogHandler&&this._userLogHandler(this,R.INFO,...e),this._logHandler(this,R.INFO,...e)}warn(...e){this._userLogHandler&&this._userLogHandler(this,R.WARN,...e),this._logHandler(this,R.WARN,...e)}error(...e){this._userLogHandler&&this._userLogHandler(this,R.ERROR,...e),this._logHandler(this,R.ERROR,...e)}}("@firebase/auth");function ee(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];Z.logLevel<=R.ERROR&&Z.error.apply(Z,l(["Auth (".concat(e,"): ").concat(t)],n,!1))}function te(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];throw oe.apply(void 0,l([e],t,!1))}function ne(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return oe.apply(void 0,l([e],t,!1))}function re(e,t,n){var r,i=a(a({},X()),((r={})[t]=n,r));return new m("auth","Firebase",i).create(t,{appName:e.name})}function ie(e,t,n){if(!(t instanceof n))throw n.name!==t.constructor.name&&te(e,"argument-error"),re(e,"argument-error","Type of ".concat(t.constructor.name," does not match expected instance.")+"Did you pass a reference from a different Auth SDK?")}function oe(e){for(var t,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];if("string"!=typeof e){var i=n[0],o=l([],n.slice(1),!0);return o[0]&&(o[0].appName=e.name),(t=e._errorFactory).create.apply(t,l([i],o,!1))}return Q.create.apply(Q,l([e],n,!1))}function se(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];if(!e)throw oe.apply(void 0,l([t],n,!1))}function ae(e){var t="INTERNAL ASSERTION FAILED: "+e;throw ee(t),new Error(t)}function ue(e,t){e||ae(t)}function ce(){var e;return"undefined"!=typeof self&&(null===(e=self.location)||void 0===e?void 0:e.href)||""}function de(){return"http:"===le()||"https:"===le()}function le(){var e;return"undefined"!=typeof self&&(null===(e=self.location)||void 0===e?void 0:e.protocol)||null}function he(){return!("undefined"!=typeof navigator&&navigator&&"onLine"in navigator&&"boolean"==typeof navigator.onLine&&(de()||function(){const e="object"==typeof chrome?chrome.runtime:"object"==typeof browser?browser.runtime:void 0;return"object"==typeof e&&void 0!==e.id}()||"connection"in navigator))||navigator.onLine}var fe=function(){function e(e,t){this.shortDelay=e,this.longDelay=t,ue(t>e,"Short delay should be less than long delay!"),this.isMobile="undefined"!=typeof window&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(p())||"object"==typeof navigator&&"ReactNative"===navigator.product}return e.prototype.get=function(){return he()?this.isMobile?this.longDelay:this.shortDelay:Math.min(5e3,this.shortDelay)},e}();function pe(e,t){ue(e.emulator,"Emulator should always be set here");var n=e.emulator.url;return t?"".concat(n).concat(t.startsWith("/")?t.slice(1):t):n}var ve,me=function(){function e(){}return e.initialize=function(e,t,n){this.fetchImpl=e,t&&(this.headersImpl=t),n&&(this.responseImpl=n)},e.fetch=function(){return this.fetchImpl?this.fetchImpl:"undefined"!=typeof self&&"fetch"in self?self.fetch:void ae("Could not find fetch implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")},e.headers=function(){return this.headersImpl?this.headersImpl:"undefined"!=typeof self&&"Headers"in self?self.Headers:void ae("Could not find Headers implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")},e.response=function(){return this.responseImpl?this.responseImpl:"undefined"!=typeof self&&"Response"in self?self.Response:void ae("Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")},e}(),ge=((ve={}).CREDENTIAL_MISMATCH="custom-token-mismatch",ve.MISSING_CUSTOM_TOKEN="internal-error",ve.INVALID_IDENTIFIER="invalid-email",ve.MISSING_CONTINUE_URI="internal-error",ve.INVALID_PASSWORD="wrong-password",ve.MISSING_PASSWORD="missing-password",ve.EMAIL_EXISTS="email-already-in-use",ve.PASSWORD_LOGIN_DISABLED="operation-not-allowed",ve.INVALID_IDP_RESPONSE="invalid-credential",ve.INVALID_PENDING_TOKEN="invalid-credential",ve.FEDERATED_USER_ID_ALREADY_LINKED="credential-already-in-use",ve.MISSING_REQ_TYPE="internal-error",ve.EMAIL_NOT_FOUND="user-not-found",ve.RESET_PASSWORD_EXCEED_LIMIT="too-many-requests",ve.EXPIRED_OOB_CODE="expired-action-code",ve.INVALID_OOB_CODE="invalid-action-code",ve.MISSING_OOB_CODE="internal-error",ve.CREDENTIAL_TOO_OLD_LOGIN_AGAIN="requires-recent-login",ve.INVALID_ID_TOKEN="invalid-user-token",ve.TOKEN_EXPIRED="user-token-expired",ve.USER_NOT_FOUND="user-token-expired",ve.TOO_MANY_ATTEMPTS_TRY_LATER="too-many-requests",ve.INVALID_CODE="invalid-verification-code",ve.INVALID_SESSION_INFO="invalid-verification-id",ve.INVALID_TEMPORARY_PROOF="invalid-credential",ve.MISSING_SESSION_INFO="missing-verification-id",ve.SESSION_EXPIRED="code-expired",ve.MISSING_ANDROID_PACKAGE_NAME="missing-android-pkg-name",ve.UNAUTHORIZED_DOMAIN="unauthorized-continue-uri",ve.INVALID_OAUTH_CLIENT_ID="invalid-oauth-client-id",ve.ADMIN_ONLY_OPERATION="admin-restricted-operation",ve.INVALID_MFA_PENDING_CREDENTIAL="invalid-multi-factor-session",ve.MFA_ENROLLMENT_NOT_FOUND="multi-factor-info-not-found",ve.MISSING_MFA_ENROLLMENT_ID="missing-multi-factor-info",ve.MISSING_MFA_PENDING_CREDENTIAL="missing-multi-factor-session",ve.SECOND_FACTOR_EXISTS="second-factor-already-in-use",ve.SECOND_FACTOR_LIMIT_EXCEEDED="maximum-second-factor-count-exceeded",ve.BLOCKING_FUNCTION_ERROR_RESPONSE="internal-error",ve.RECAPTCHA_NOT_ENABLED="recaptcha-not-enabled",ve.MISSING_RECAPTCHA_TOKEN="missing-recaptcha-token",ve.INVALID_RECAPTCHA_TOKEN="invalid-recaptcha-token",ve.INVALID_RECAPTCHA_ACTION="invalid-recaptcha-action",ve.MISSING_CLIENT_TYPE="missing-client-type",ve.MISSING_RECAPTCHA_VERSION="missing-recaptcha-version",ve.INVALID_RECAPTCHA_VERSION="invalid-recaptcha-version",ve.INVALID_REQ_TYPE="invalid-req-type",ve),_e=new fe(3e4,6e4);function Ie(e,t){return e.tenantId&&!t.tenantId?a(a({},t),{tenantId:e.tenantId}):t}function ye(e,t,n,r,i){return void 0===i&&(i={}),c(this,void 0,void 0,(function(){var o=this;return d(this,(function(s){return[2,Te(e,i,(function(){return c(o,void 0,void 0,(function(){var i,o,s,u;return d(this,(function(c){switch(c.label){case 0:return i={},o={},r&&("GET"===t?o=r:i={body:JSON.stringify(r)}),s=y(a({key:e.config.apiKey},o)).slice(1),[4,e._getAdditionalHeaders()];case 1:return(u=c.sent())["Content-Type"]="application/json",e.languageCode&&(u["X-Firebase-Locale"]=e.languageCode),[2,me.fetch()(Ee(e,e.config.apiHost,n,s),a({method:t,headers:u,referrerPolicy:"no-referrer"},i))]}}))}))}))]}))}))}function Te(e,t,n){return c(this,void 0,void 0,(function(){var r,i,o,s,u,c,l,h,f,p;return d(this,(function(d){switch(d.label){case 0:e._canInitEmulator=!1,r=a(a({},ge),t),d.label=1;case 1:return d.trys.push([1,4,,5]),i=new Ae(e),[4,Promise.race([n(),i.promise])];case 2:return o=d.sent(),i.clearNetworkTimeout(),[4,o.json()];case 3:if("needConfirmation"in(s=d.sent()))throw we(e,"account-exists-with-different-credential",s);if(o.ok&&!("errorMessage"in s))return[2,s];if(u=o.ok?s.errorMessage:s.error.message,c=u.split(" : "),l=c[0],h=c[1],"FEDERATED_USER_ID_ALREADY_LINKED"===l)throw we(e,"credential-already-in-use",s);if("EMAIL_EXISTS"===l)throw we(e,"email-already-in-use",s);if("USER_DISABLED"===l)throw we(e,"user-disabled",s);if(f=r[l]||l.toLowerCase().replace(/[_\s]+/g,"-"),h)throw re(e,f,h);return te(e,f),[3,5];case 4:if((p=d.sent())instanceof v)throw p;return te(e,"network-request-failed",{message:String(p)}),[3,5];case 5:return[2]}}))}))}function be(e,t,n,r,i){return void 0===i&&(i={}),c(this,void 0,void 0,(function(){var o;return d(this,(function(s){switch(s.label){case 0:return[4,ye(e,t,n,r,i)];case 1:return"mfaPendingCredential"in(o=s.sent())&&te(e,"multi-factor-auth-required",{_serverResponse:o}),[2,o]}}))}))}function Ee(e,t,n,r){var i="".concat(t).concat(n,"?").concat(r);return e.config.emulator?pe(e.config,i):"".concat(e.config.apiScheme,"://").concat(i)}var Ae=function(){function e(e){var t=this;this.auth=e,this.timer=null,this.promise=new Promise((function(e,n){t.timer=setTimeout((function(){return n(ne(t.auth,"network-request-failed"))}),_e.get())}))}return e.prototype.clearNetworkTimeout=function(){clearTimeout(this.timer)},e}();function we(e,t,n){var r={appName:e.name};n.email&&(r.email=n.email),n.phoneNumber&&(r.phoneNumber=n.phoneNumber);var i=ne(e,t,r);return i.customData._tokenResponse=n,i}function ke(e,t){return c(this,void 0,void 0,(function(){return d(this,(function(n){return[2,ye(e,"POST","/v1/accounts:delete",t)]}))}))}function Re(e,t){return c(this,void 0,void 0,(function(){return d(this,(function(n){return[2,ye(e,"POST","/v1/accounts:update",t)]}))}))}function Ne(e,t){return c(this,void 0,void 0,(function(){return d(this,(function(n){return[2,ye(e,"POST","/v1/accounts:lookup",t)]}))}))}function Se(e){if(e)try{var t=new Date(Number(e));if(!isNaN(t.getTime()))return t.toUTCString()}catch(e){}}function Oe(e,t){return void 0===t&&(t=!1),w(e).getIdToken(t)}function Ce(e,t){return void 0===t&&(t=!1),c(this,void 0,void 0,(function(){var n,r,i,o,s;return d(this,(function(a){switch(a.label){case 0:return[4,(n=w(e)).getIdToken(t)];case 1:return r=a.sent(),se((i=De(r))&&i.exp&&i.auth_time&&i.iat,n.auth,"internal-error"),o="object"==typeof i.firebase?i.firebase:void 0,s=null==o?void 0:o.sign_in_provider,[2,{claims:i,token:r,authTime:Se(Pe(i.auth_time)),issuedAtTime:Se(Pe(i.iat)),expirationTime:Se(Pe(i.exp)),signInProvider:s||null,signInSecondFactor:(null==o?void 0:o.sign_in_second_factor)||null}]}}))}))}function Pe(e){return 1e3*Number(e)}function De(e){var t=e.split("."),n=t[0],r=t[1],i=t[2];if(void 0===n||void 0===r||void 0===i)return ee("JWT malformed, contained fewer than 3 sections"),null;try{var o=function(e){try{return h.decodeString(e,!0)}catch(e){console.error("base64Decode failed: ",e)}return null}(r);return o?JSON.parse(o):(ee("Failed to decode base64 JWT payload"),null)}catch(e){return ee("Caught error parsing JWT payload as JSON",null==e?void 0:e.toString()),null}}function Le(e,t,n){return void 0===n&&(n=!1),c(this,void 0,void 0,(function(){var r;return d(this,(function(i){switch(i.label){case 0:if(n)return[2,t];i.label=1;case 1:return i.trys.push([1,3,,6]),[4,t];case 2:return[2,i.sent()];case 3:return(r=i.sent())instanceof v&&function(e){var t=e.code;return t==="auth/".concat("user-disabled")||t==="auth/".concat("user-token-expired")}(r)?e.auth.currentUser!==e?[3,5]:[4,e.auth.signOut()]:[3,5];case 4:i.sent(),i.label=5;case 5:throw r;case 6:return[2]}}))}))}var Ue=function(){function e(e){this.user=e,this.isRunning=!1,this.timerId=null,this.errorBackoff=3e4}return e.prototype._start=function(){this.isRunning||(this.isRunning=!0,this.schedule())},e.prototype._stop=function(){this.isRunning&&(this.isRunning=!1,null!==this.timerId&&clearTimeout(this.timerId))},e.prototype.getInterval=function(e){var t;if(e){var n=this.errorBackoff;return this.errorBackoff=Math.min(2*this.errorBackoff,96e4),n}this.errorBackoff=3e4;n=(null!==(t=this.user.stsTokenManager.expirationTime)&&void 0!==t?t:0)-Date.now()-3e5;return Math.max(0,n)},e.prototype.schedule=function(e){var t=this;if(void 0===e&&(e=!1),this.isRunning){var n=this.getInterval(e);this.timerId=setTimeout((function(){return c(t,void 0,void 0,(function(){return d(this,(function(e){switch(e.label){case 0:return[4,this.iteration()];case 1:return e.sent(),[2]}}))}))}),n)}},e.prototype.iteration=function(){return c(this,void 0,void 0,(function(){var e;return d(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,this.user.getIdToken(!0)];case 1:return t.sent(),[3,3];case 2:return(null==(e=t.sent())?void 0:e.code)==="auth/".concat("network-request-failed")&&this.schedule(!0),[2];case 3:return this.schedule(),[2]}}))}))},e}(),Me=function(){function e(e,t){this.createdAt=e,this.lastLoginAt=t,this._initializeTime()}return e.prototype._initializeTime=function(){this.lastSignInTime=Se(this.lastLoginAt),this.creationTime=Se(this.createdAt)},e.prototype._copy=function(e){this.createdAt=e.createdAt,this.lastLoginAt=e.lastLoginAt,this._initializeTime()},e.prototype.toJSON=function(){return{createdAt:this.createdAt,lastLoginAt:this.lastLoginAt}},e}();function Ve(e){var t;return c(this,void 0,void 0,(function(){var n,r,i,o,s,a,c,h,f,p;return d(this,(function(d){switch(d.label){case 0:return n=e.auth,[4,e.getIdToken()];case 1:return r=d.sent(),[4,Le(e,Ne(n,{idToken:r}))];case 2:return se(null==(i=d.sent())?void 0:i.users.length,n,"internal-error"),o=i.users[0],e._notifyReloadListener(o),s=(null===(t=o.providerUserInfo)||void 0===t?void 0:t.length)?o.providerUserInfo.map((function(e){var t=e.providerId,n=u(e,["providerId"]);return{providerId:t,uid:n.rawId||"",displayName:n.displayName||null,email:n.email||null,phoneNumber:n.phoneNumber||null,photoURL:n.photoUrl||null}})):[],v=e.providerData,m=s,a=l(l([],v.filter((function(e){return!m.some((function(t){return t.providerId===e.providerId}))})),!0),m,!0),c=e.isAnonymous,h=!(e.email&&o.passwordHash||(null==a?void 0:a.length)),f=!!c&&h,p={uid:o.localId,displayName:o.displayName||null,photoURL:o.photoUrl||null,email:o.email||null,emailVerified:o.emailVerified||!1,phoneNumber:o.phoneNumber||null,tenantId:o.tenantId||null,providerData:a,metadata:new Me(o.createdAt,o.lastLoginAt),isAnonymous:f},Object.assign(e,p),[2]}var v,m}))}))}function Fe(e){return c(this,void 0,void 0,(function(){var t;return d(this,(function(n){switch(n.label){case 0:return[4,Ve(t=w(e))];case 1:return n.sent(),[4,t.auth._persistUserIfCurrent(t)];case 2:return n.sent(),t.auth._notifyListenersIfCurrent(t),[2]}}))}))}function He(e,t){return c(this,void 0,void 0,(function(){var n,r=this;return d(this,(function(i){switch(i.label){case 0:return[4,Te(e,{},(function(){return c(r,void 0,void 0,(function(){var n,r,i,o,s,a;return d(this,(function(u){switch(u.label){case 0:return n=y({grant_type:"refresh_token",refresh_token:t}).slice(1),r=e.config,i=r.tokenApiHost,o=r.apiKey,s=Ee(e,i,"/v1/token","key=".concat(o)),[4,e._getAdditionalHeaders()];case 1:return(a=u.sent())["Content-Type"]="application/x-www-form-urlencoded",[2,me.fetch()(s,{method:"POST",headers:a,body:n})]}}))}))}))];case 1:return[2,{accessToken:(n=i.sent()).access_token,expiresIn:n.expires_in,refreshToken:n.refresh_token}]}}))}))}var xe=function(){function e(){this.refreshToken=null,this.accessToken=null,this.expirationTime=null}return Object.defineProperty(e.prototype,"isExpired",{get:function(){return!this.expirationTime||Date.now()>this.expirationTime-3e4},enumerable:!1,configurable:!0}),e.prototype.updateFromServerResponse=function(e){se(e.idToken,"internal-error"),se(void 0!==e.idToken,"internal-error"),se(void 0!==e.refreshToken,"internal-error");var t,n,r="expiresIn"in e&&void 0!==e.expiresIn?Number(e.expiresIn):(t=e.idToken,se(n=De(t),"internal-error"),se(void 0!==n.exp,"internal-error"),se(void 0!==n.iat,"internal-error"),Number(n.exp)-Number(n.iat));this.updateTokensAndExpiration(e.idToken,e.refreshToken,r)},e.prototype.getToken=function(e,t){return void 0===t&&(t=!1),c(this,void 0,void 0,(function(){return d(this,(function(n){switch(n.label){case 0:return se(!this.accessToken||this.refreshToken,e,"user-token-expired"),t||!this.accessToken||this.isExpired?this.refreshToken?[4,this.refresh(e,this.refreshToken)]:[3,2]:[2,this.accessToken];case 1:return n.sent(),[2,this.accessToken];case 2:return[2,null]}}))}))},e.prototype.clearRefreshToken=function(){this.refreshToken=null},e.prototype.refresh=function(e,t){return c(this,void 0,void 0,(function(){var n,r,i,o;return d(this,(function(s){switch(s.label){case 0:return[4,He(e,t)];case 1:return n=s.sent(),r=n.accessToken,i=n.refreshToken,o=n.expiresIn,this.updateTokensAndExpiration(r,i,Number(o)),[2]}}))}))},e.prototype.updateTokensAndExpiration=function(e,t,n){this.refreshToken=t||null,this.accessToken=e||null,this.expirationTime=Date.now()+1e3*n},e.fromJSON=function(t,n){var r=n.refreshToken,i=n.accessToken,o=n.expirationTime,s=new e;return r&&(se("string"==typeof r,"internal-error",{appName:t}),s.refreshToken=r),i&&(se("string"==typeof i,"internal-error",{appName:t}),s.accessToken=i),o&&(se("number"==typeof o,"internal-error",{appName:t}),s.expirationTime=o),s},e.prototype.toJSON=function(){return{refreshToken:this.refreshToken,accessToken:this.accessToken,expirationTime:this.expirationTime}},e.prototype._assign=function(e){this.accessToken=e.accessToken,this.refreshToken=e.refreshToken,this.expirationTime=e.expirationTime},e.prototype._clone=function(){return Object.assign(new e,this.toJSON())},e.prototype._performRefresh=function(){return ae("not implemented")},e}();function je(e,t){se("string"==typeof e||void 0===e,"internal-error",{appName:t})}var qe=function(){function e(e){var t=e.uid,n=e.auth,r=e.stsTokenManager,i=u(e,["uid","auth","stsTokenManager"]);this.providerId="firebase",this.proactiveRefresh=new Ue(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?l([],i.providerData,!0):[],this.metadata=new Me(i.createdAt||void 0,i.lastLoginAt||void 0)}return e.prototype.getIdToken=function(e){return c(this,void 0,void 0,(function(){var t;return d(this,(function(n){switch(n.label){case 0:return[4,Le(this,this.stsTokenManager.getToken(this.auth,e))];case 1:return se(t=n.sent(),this.auth,"internal-error"),this.accessToken===t?[3,3]:(this.accessToken=t,[4,this.auth._persistUserIfCurrent(this)]);case 2:n.sent(),this.auth._notifyListenersIfCurrent(this),n.label=3;case 3:return[2,t]}}))}))},e.prototype.getIdTokenResult=function(e){return Ce(this,e)},e.prototype.reload=function(){return Fe(this)},e.prototype._assign=function(e){this!==e&&(se(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((function(e){return a({},e)})),this.metadata._copy(e.metadata),this.stsTokenManager._assign(e.stsTokenManager))},e.prototype._clone=function(t){var n=new e(a(a({},this),{auth:t,stsTokenManager:this.stsTokenManager._clone()}));return n.metadata._copy(this.metadata),n},e.prototype._onReload=function(e){se(!this.reloadListener,this.auth,"internal-error"),this.reloadListener=e,this.reloadUserInfo&&(this._notifyReloadListener(this.reloadUserInfo),this.reloadUserInfo=null)},e.prototype._notifyReloadListener=function(e){this.reloadListener?this.reloadListener(e):this.reloadUserInfo=e},e.prototype._startProactiveRefresh=function(){this.proactiveRefresh._start()},e.prototype._stopProactiveRefresh=function(){this.proactiveRefresh._stop()},e.prototype._updateTokensIfNecessary=function(e,t){return void 0===t&&(t=!1),c(this,void 0,void 0,(function(){var n;return d(this,(function(r){switch(r.label){case 0:return n=!1,e.idToken&&e.idToken!==this.stsTokenManager.accessToken&&(this.stsTokenManager.updateFromServerResponse(e),n=!0),t?[4,Ve(this)]:[3,2];case 1:r.sent(),r.label=2;case 2:return[4,this.auth._persistUserIfCurrent(this)];case 3:return r.sent(),n&&this.auth._notifyListenersIfCurrent(this),[2]}}))}))},e.prototype.delete=function(){return c(this,void 0,void 0,(function(){var e;return d(this,(function(t){switch(t.label){case 0:return[4,this.getIdToken()];case 1:return e=t.sent(),[4,Le(this,ke(this.auth,{idToken:e}))];case 2:return t.sent(),this.stsTokenManager.clearRefreshToken(),[2,this.auth.signOut()]}}))}))},e.prototype.toJSON=function(){return a(a({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((function(e){return a({},e)})),stsTokenManager:this.stsTokenManager.toJSON(),_redirectEventId:this._redirectEventId},this.metadata.toJSON()),{apiKey:this.auth.config.apiKey,appName:this.auth.name})},Object.defineProperty(e.prototype,"refreshToken",{get:function(){return this.stsTokenManager.refreshToken||""},enumerable:!1,configurable:!0}),e._fromJSON=function(t,n){var r,i,o,s,u,c,d,l,h=null!==(r=n.displayName)&&void 0!==r?r:void 0,f=null!==(i=n.email)&&void 0!==i?i:void 0,p=null!==(o=n.phoneNumber)&&void 0!==o?o:void 0,v=null!==(s=n.photoURL)&&void 0!==s?s:void 0,m=null!==(u=n.tenantId)&&void 0!==u?u:void 0,g=null!==(c=n._redirectEventId)&&void 0!==c?c:void 0,_=null!==(d=n.createdAt)&&void 0!==d?d:void 0,I=null!==(l=n.lastLoginAt)&&void 0!==l?l:void 0,y=n.uid,T=n.emailVerified,b=n.isAnonymous,E=n.providerData,A=n.stsTokenManager;se(y&&A,t,"internal-error");var w=xe.fromJSON(this.name,A);se("string"==typeof y,t,"internal-error"),je(h,t.name),je(f,t.name),se("boolean"==typeof T,t,"internal-error"),se("boolean"==typeof b,t,"internal-error"),je(p,t.name),je(v,t.name),je(m,t.name),je(g,t.name),je(_,t.name),je(I,t.name);var k=new e({uid:y,auth:t,email:f,emailVerified:T,displayName:h,isAnonymous:b,photoURL:v,phoneNumber:p,tenantId:m,stsTokenManager:w,createdAt:_,lastLoginAt:I});return E&&Array.isArray(E)&&(k.providerData=E.map((function(e){return a({},e)}))),g&&(k._redirectEventId=g),k},e._fromIdTokenResponse=function(t,n,r){return void 0===r&&(r=!1),c(this,void 0,void 0,(function(){var i,o;return d(this,(function(s){switch(s.label){case 0:return(i=new xe).updateFromServerResponse(n),[4,Ve(o=new e({uid:n.localId,auth:t,stsTokenManager:i,isAnonymous:r}))];case 1:return s.sent(),[2,o]}}))}))},e}(),Be=new Map;function We(e){ue(e instanceof Function,"Expected a class definition");var t=Be.get(e);return t?(ue(t instanceof e,"Instance stored in cache mismatched with class"),t):(t=new e,Be.set(e,t),t)}var Ge=function(){function e(){this.type="NONE",this.storage={}}return e.prototype._isAvailable=function(){return c(this,void 0,void 0,(function(){return d(this,(function(e){return[2,!0]}))}))},e.prototype._set=function(e,t){return c(this,void 0,void 0,(function(){return d(this,(function(n){return this.storage[e]=t,[2]}))}))},e.prototype._get=function(e){return c(this,void 0,void 0,(function(){var t;return d(this,(function(n){return[2,void 0===(t=this.storage[e])?null:t]}))}))},e.prototype._remove=function(e){return c(this,void 0,void 0,(function(){return d(this,(function(t){return delete this.storage[e],[2]}))}))},e.prototype._addListener=function(e,t){},e.prototype._removeListener=function(e,t){},e.type="NONE",e}();function ze(e,t,n){return"".concat("firebase",":").concat(e,":").concat(t,":").concat(n)}var Ke=function(){function e(e,t,n){this.persistence=e,this.auth=t,this.userKey=n;var r=this.auth,i=r.config,o=r.name;this.fullUserKey=ze(this.userKey,i.apiKey,o),this.fullPersistenceKey=ze("persistence",i.apiKey,o),this.boundEventHandler=t._onStorageEvent.bind(t),this.persistence._addListener(this.fullUserKey,this.boundEventHandler)}return e.prototype.setCurrentUser=function(e){return this.persistence._set(this.fullUserKey,e.toJSON())},e.prototype.getCurrentUser=function(){return c(this,void 0,void 0,(function(){var e;return d(this,(function(t){switch(t.label){case 0:return[4,this.persistence._get(this.fullUserKey)];case 1:return[2,(e=t.sent())?qe._fromJSON(this.auth,e):null]}}))}))},e.prototype.removeCurrentUser=function(){return this.persistence._remove(this.fullUserKey)},e.prototype.savePersistenceForRedirect=function(){return this.persistence._set(this.fullPersistenceKey,this.persistence.type)},e.prototype.setPersistence=function(e){return c(this,void 0,void 0,(function(){var t;return d(this,(function(n){switch(n.label){case 0:return this.persistence===e?[2]:[4,this.getCurrentUser()];case 1:return t=n.sent(),[4,this.removeCurrentUser()];case 2:return n.sent(),this.persistence=e,t?[2,this.setCurrentUser(t)]:[2]}}))}))},e.prototype.delete=function(){this.persistence._removeListener(this.fullUserKey,this.boundEventHandler)},e.create=function(t,n,r){return void 0===r&&(r="authUser"),c(this,void 0,void 0,(function(){var i,o,s,a,u,l,h,f,p,v,m=this;return d(this,(function(g){switch(g.label){case 0:return n.length?[4,Promise.all(n.map((function(e){return c(m,void 0,void 0,(function(){return d(this,(function(t){switch(t.label){case 0:return[4,e._isAvailable()];case 1:return t.sent()?[2,e]:[2,void 0]}}))}))})))]:[2,new e(We(Ge),t,r)];case 1:i=g.sent().filter((function(e){return e})),o=i[0]||We(Ge),s=ze(r,t.config.apiKey,t.name),a=null,u=0,l=n,g.label=2;case 2:if(!(u<l.length))return[3,7];h=l[u],g.label=3;case 3:return g.trys.push([3,5,,6]),[4,h._get(s)];case 4:return(f=g.sent())?(p=qe._fromJSON(t,f),h!==o&&(a=p),o=h,[3,7]):[3,6];case 5:return g.sent(),[3,6];case 6:return u++,[3,2];case 7:return v=i.filter((function(e){return e._shouldAllowMigration})),o._shouldAllowMigration&&v.length?(o=v[0],a?[4,o._set(s,a.toJSON())]:[3,9]):[2,new e(o,t,r)];case 8:g.sent(),g.label=9;case 9:return[4,Promise.all(n.map((function(e){return c(m,void 0,void 0,(function(){return d(this,(function(t){switch(t.label){case 0:if(e===o)return[3,4];t.label=1;case 1:return t.trys.push([1,3,,4]),[4,e._remove(s)];case 2:case 3:return t.sent(),[3,4];case 4:return[2]}}))}))})))];case 10:return g.sent(),[2,new e(o,t,r)]}}))}))},e}();function Je(e){var t=e.toLowerCase();if(t.includes("opera/")||t.includes("opr/")||t.includes("opios/"))return"Opera";if(Xe(t))return"IEMobile";if(t.includes("msie")||t.includes("trident/"))return"IE";if(t.includes("edge/"))return"Edge";if(function(e){void 0===e&&(e=p());return/firefox\//i.test(e)}(t))return"Firefox";if(t.includes("silk/"))return"Silk";if($e(t))return"Blackberry";if(Ze(t))return"Webos";if(Ye(t))return"Safari";if((t.includes("chrome/")||function(e){void 0===e&&(e=p());return/crios\//i.test(e)}(t))&&!t.includes("edge/"))return"Chrome";if(Qe(t))return"Android";var n=e.match(/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/);return 2===(null==n?void 0:n.length)?n[1]:"Other"}function Ye(e){void 0===e&&(e=p());var t=e.toLowerCase();return t.includes("safari/")&&!t.includes("chrome/")&&!t.includes("crios/")&&!t.includes("android")}function Xe(e){return void 0===e&&(e=p()),/iemobile/i.test(e)}function Qe(e){return void 0===e&&(e=p()),/android/i.test(e)}function $e(e){return void 0===e&&(e=p()),/blackberry/i.test(e)}function Ze(e){return void 0===e&&(e=p()),/webos/i.test(e)}function et(e){return void 0===e&&(e=p()),/iphone|ipad|ipod/i.test(e)||/macintosh/i.test(e)&&/mobile/i.test(e)}function tt(){return function(){const e=p();return e.indexOf("MSIE ")>=0||e.indexOf("Trident/")>=0}()&&10===document.documentMode}function nt(t,n){var r;switch(void 0===n&&(n=[]),t){case"Browser":r=Je(p());break;case"Worker":r="".concat(Je(p()),"-").concat(t);break;default:r=t}var i=n.length?n.join(","):"FirebaseCore-web";return"".concat(r,"/").concat("JsCore","/").concat(e,"/").concat(i)}function rt(e,t){return c(this,void 0,void 0,(function(){return d(this,(function(n){return[2,ye(e,"GET","/v2/recaptchaConfig",Ie(e,t))]}))}))}function it(e){return void 0!==e&&void 0!==e.enterprise}var ot=function(e){if(this.siteKey="",this.emailPasswordEnabled=!1,void 0===e.recaptchaKey)throw new Error("recaptchaKey undefined");this.siteKey=e.recaptchaKey.split("/")[3],this.emailPasswordEnabled=e.recaptchaEnforcementState.some((function(e){return"EMAIL_PASSWORD_PROVIDER"===e.provider&&"OFF"!==e.enforcementState}))};function st(e){return new Promise((function(t,n){var r=document.createElement("script");r.setAttribute("src",e),r.onload=t,r.onerror=function(e){var t=ne("internal-error");t.customData=e,n(t)},r.type="text/javascript",r.charset="UTF-8",function(){var e,t;return null!==(t=null===(e=document.getElementsByTagName("head"))||void 0===e?void 0:e[0])&&void 0!==t?t:document}().appendChild(r)}))}var at=function(){function e(e){this.type="recaptcha-enterprise",this.auth=lt(e)}return e.prototype.verify=function(e,t){return void 0===e&&(e="verify"),void 0===t&&(t=!1),c(this,void 0,void 0,(function(){function n(t,n,r){var i=window.grecaptcha;it(i)?i.enterprise.ready((function(){i.enterprise.execute(t,{action:e}).then((function(e){n(e)})).catch((function(){n("NO_RECAPTCHA")}))})):r(Error("No reCAPTCHA enterprise script loaded."))}var r=this;return d(this,(function(e){return[2,new Promise((function(e,i){(function(e){return c(this,void 0,void 0,(function(){var n=this;return d(this,(function(r){if(!t){if(null==e.tenantId&&null!=e._agentRecaptchaConfig)return[2,e._agentRecaptchaConfig.siteKey];if(null!=e.tenantId&&void 0!==e._tenantRecaptchaConfigs[e.tenantId])return[2,e._tenantRecaptchaConfigs[e.tenantId].siteKey]}return[2,new Promise((function(t,r){return c(n,void 0,void 0,(function(){return d(this,(function(n){return rt(e,{clientType:"CLIENT_TYPE_WEB",version:"RECAPTCHA_ENTERPRISE"}).then((function(n){if(void 0!==n.recaptchaKey){var i=new ot(n);return null==e.tenantId?e._agentRecaptchaConfig=i:e._tenantRecaptchaConfigs[e.tenantId]=i,t(i.siteKey)}r(new Error("recaptcha Enterprise site key undefined"))})).catch((function(e){r(e)})),[2]}))}))}))]}))}))})(r.auth).then((function(r){if(!t&&it(window.grecaptcha))n(r,e,i);else{if("undefined"==typeof window)return void i(new Error("RecaptchaVerifier is only supported in browser"));st("https://www.google.com/recaptcha/enterprise.js?render="+r).then((function(){n(r,e,i)})).catch((function(e){i(e)}))}})).catch((function(e){i(e)}))}))]}))}))},e}();function ut(e,t,n,r){return void 0===r&&(r=!1),c(this,void 0,void 0,(function(){var i,o,s;return d(this,(function(u){switch(u.label){case 0:i=new at(e),u.label=1;case 1:return u.trys.push([1,3,,5]),[4,i.verify(n)];case 2:return o=u.sent(),[3,5];case 3:return u.sent(),[4,i.verify(n,!0)];case 4:return o=u.sent(),[3,5];case 5:return s=a({},t),r?Object.assign(s,{captchaResp:o}):Object.assign(s,{captchaResponse:o}),Object.assign(s,{clientType:"CLIENT_TYPE_WEB"}),Object.assign(s,{recaptchaVersion:"RECAPTCHA_ENTERPRISE"}),[2,s]}}))}))}var ct=function(){function e(e){this.auth=e,this.queue=[]}return e.prototype.pushCallback=function(e,t){var n=this,r=function(t){return new Promise((function(n,r){try{n(e(t))}catch(e){r(e)}}))};r.onAbort=t,this.queue.push(r);var i=this.queue.length-1;return function(){n.queue[i]=function(){return Promise.resolve()}}},e.prototype.runMiddleware=function(e){return c(this,void 0,void 0,(function(){var t,n,r,i,o,s,a,u;return d(this,(function(c){switch(c.label){case 0:if(this.auth.currentUser===e)return[2];t=[],c.label=1;case 1:c.trys.push([1,6,,7]),n=0,r=this.queue,c.label=2;case 2:return n<r.length?[4,(i=r[n])(e)]:[3,5];case 3:c.sent(),i.onAbort&&t.push(i.onAbort),c.label=4;case 4:return n++,[3,2];case 5:return[3,7];case 6:for(o=c.sent(),t.reverse(),s=0,a=t;s<a.length;s++){u=a[s];try{u()}catch(e){}}throw this.auth._errorFactory.create("login-blocked",{originalMessage:null==o?void 0:o.message});case 7:return[2]}}))}))},e}(),dt=function(){function t(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 ht(this),this.idTokenSubscription=new ht(this),this.beforeStateQueue=new ct(this),this.redirectUser=null,this.isProactiveRefreshEnabled=!1,this._canInitEmulator=!0,this._isInitialized=!1,this._deleted=!1,this._initializationPromise=null,this._popupRedirectResolver=null,this._errorFactory=Q,this._agentRecaptchaConfig=null,this._tenantRecaptchaConfigs={},this.lastNotifiedUid=void 0,this.languageCode=null,this.tenantId=null,this.settings={appVerificationDisabledForTesting:!1},this.frameworks=[],this.name=e.name,this.clientVersion=r.sdkClientVersion}return t.prototype._initializeWithPersistence=function(e,t){var n=this;return t&&(this._popupRedirectResolver=We(t)),this._initializationPromise=this.queue((function(){return c(n,void 0,void 0,(function(){var n,r,i;return d(this,(function(o){switch(o.label){case 0:return this._deleted?[2]:(n=this,[4,Ke.create(this,e)]);case 1:if(n.persistenceManager=o.sent(),this._deleted)return[2];if(!(null===(r=this._popupRedirectResolver)||void 0===r?void 0:r._shouldInitProactively))return[3,5];o.label=2;case 2:return o.trys.push([2,4,,5]),[4,this._popupRedirectResolver._initialize(this)];case 3:case 4:return o.sent(),[3,5];case 5:return[4,this.initializeCurrentUser(t)];case 6:return o.sent(),this.lastNotifiedUid=(null===(i=this.currentUser)||void 0===i?void 0:i.uid)||null,this._deleted?[2]:(this._isInitialized=!0,[2])}}))}))})),this._initializationPromise},t.prototype._onStorageEvent=function(){return c(this,void 0,void 0,(function(){var e;return d(this,(function(t){switch(t.label){case 0:return this._deleted?[2]:[4,this.assertedPersistence.getCurrentUser()];case 1:return e=t.sent(),this.currentUser||e?this.currentUser&&e&&this.currentUser.uid===e.uid?(this._currentUser._assign(e),[4,this.currentUser.getIdToken()]):[3,3]:[2];case 2:case 4:return t.sent(),[2];case 3:return[4,this._updateCurrentUser(e,!0)]}}))}))},t.prototype.initializeCurrentUser=function(e){var t;return c(this,void 0,void 0,(function(){var n,r,i,o,s,a,u;return d(this,(function(c){switch(c.label){case 0:return[4,this.assertedPersistence.getCurrentUser()];case 1:return n=c.sent(),r=n,i=!1,e&&this.config.authDomain?[4,this.getOrInitRedirectPersistenceManager()]:[3,4];case 2:return c.sent(),o=null===(t=this.redirectUser)||void 0===t?void 0:t._redirectEventId,s=null==r?void 0:r._redirectEventId,[4,this.tryRedirectSignIn(e)];case 3:a=c.sent(),o&&o!==s||!(null==a?void 0:a.user)||(r=a.user,i=!0),c.label=4;case 4:if(!r)return[2,this.directlySetCurrentUser(null)];if(r._redirectEventId)return[3,9];if(!i)return[3,8];c.label=5;case 5:return c.trys.push([5,7,,8]),[4,this.beforeStateQueue.runMiddleware(r)];case 6:return c.sent(),[3,8];case 7:return u=c.sent(),r=n,this._popupRedirectResolver._overrideRedirectResult(this,(function(){return Promise.reject(u)})),[3,8];case 8:return r?[2,this.reloadAndSetCurrentUserOrClear(r)]:[2,this.directlySetCurrentUser(null)];case 9:return se(this._popupRedirectResolver,this,"argument-error"),[4,this.getOrInitRedirectPersistenceManager()];case 10:return c.sent(),this.redirectUser&&this.redirectUser._redirectEventId===r._redirectEventId?[2,this.directlySetCurrentUser(r)]:[2,this.reloadAndSetCurrentUserOrClear(r)]}}))}))},t.prototype.tryRedirectSignIn=function(e){return c(this,void 0,void 0,(function(){var t;return d(this,(function(n){switch(n.label){case 0:t=null,n.label=1;case 1:return n.trys.push([1,3,,5]),[4,this._popupRedirectResolver._completeRedirectFn(this,e,!0)];case 2:return t=n.sent(),[3,5];case 3:return n.sent(),[4,this._setRedirectUser(null)];case 4:return n.sent(),[3,5];case 5:return[2,t]}}))}))},t.prototype.reloadAndSetCurrentUserOrClear=function(e){return c(this,void 0,void 0,(function(){var t;return d(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,Ve(e)];case 1:return n.sent(),[3,3];case 2:return(null==(t=n.sent())?void 0:t.code)!=="auth/".concat("network-request-failed")?[2,this.directlySetCurrentUser(null)]:[3,3];case 3:return[2,this.directlySetCurrentUser(e)]}}))}))},t.prototype.useDeviceLanguage=function(){this.languageCode=function(){if("undefined"==typeof navigator)return null;var e=navigator;return e.languages&&e.languages[0]||e.language||null}()},t.prototype._delete=function(){return c(this,void 0,void 0,(function(){return d(this,(function(e){return this._deleted=!0,[2]}))}))},t.prototype.updateCurrentUser=function(e){return c(this,void 0,void 0,(function(){var t;return d(this,(function(n){return(t=e?w(e):null)&&se(t.auth.config.apiKey===this.config.apiKey,this,"invalid-user-token"),[2,this._updateCurrentUser(t&&t._clone(this))]}))}))},t.prototype._updateCurrentUser=function(e,t){return void 0===t&&(t=!1),c(this,void 0,void 0,(function(){var n=this;return d(this,(function(r){switch(r.label){case 0:return this._deleted?[2]:(e&&se(this.tenantId===e.tenantId,this,"tenant-id-mismatch"),t?[3,2]:[4,this.beforeStateQueue.runMiddleware(e)]);case 1:r.sent(),r.label=2;case 2:return[2,this.queue((function(){return c(n,void 0,void 0,(function(){return d(this,(function(t){switch(t.label){case 0:return[4,this.directlySetCurrentUser(e)];case 1:return t.sent(),this.notifyAuthListeners(),[2]}}))}))}))]}}))}))},t.prototype.signOut=function(){return c(this,void 0,void 0,(function(){return d(this,(function(e){switch(e.label){case 0:return[4,this.beforeStateQueue.runMiddleware(null)];case 1:return e.sent(),this.redirectPersistenceManager||this._popupRedirectResolver?[4,this._setRedirectUser(null)]:[3,3];case 2:e.sent(),e.label=3;case 3:return[2,this._updateCurrentUser(null,!0)]}}))}))},t.prototype.setPersistence=function(e){var t=this;return this.queue((function(){return c(t,void 0,void 0,(function(){return d(this,(function(t){switch(t.label){case 0:return[4,this.assertedPersistence.setPersistence(We(e))];case 1:return t.sent(),[2]}}))}))}))},t.prototype.initializeRecaptchaConfig=function(){return c(this,void 0,void 0,(function(){var e,t;return d(this,(function(n){switch(n.label){case 0:return[4,rt(this,{clientType:"CLIENT_TYPE_WEB",version:"RECAPTCHA_ENTERPRISE"})];case 1:return e=n.sent(),t=new ot(e),null==this.tenantId?this._agentRecaptchaConfig=t:this._tenantRecaptchaConfigs[this.tenantId]=t,t.emailPasswordEnabled&&new at(this).verify(),[2]}}))}))},t.prototype._getRecaptchaConfig=function(){return null==this.tenantId?this._agentRecaptchaConfig:this._tenantRecaptchaConfigs[this.tenantId]},t.prototype._getPersistence=function(){return this.assertedPersistence.persistence.type},t.prototype._updateErrorMap=function(e){this._errorFactory=new m("auth","Firebase",e())},t.prototype.onAuthStateChanged=function(e,t,n){return this.registerStateListener(this.authStateSubscription,e,t,n)},t.prototype.beforeAuthStateChanged=function(e,t){return this.beforeStateQueue.pushCallback(e,t)},t.prototype.onIdTokenChanged=function(e,t,n){return this.registerStateListener(this.idTokenSubscription,e,t,n)},t.prototype.toJSON=function(){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()}},t.prototype._setRedirectUser=function(e,t){return c(this,void 0,void 0,(function(){var n;return d(this,(function(r){switch(r.label){case 0:return[4,this.getOrInitRedirectPersistenceManager(t)];case 1:return n=r.sent(),[2,null===e?n.removeCurrentUser():n.setCurrentUser(e)]}}))}))},t.prototype.getOrInitRedirectPersistenceManager=function(e){return c(this,void 0,void 0,(function(){var t,n,r;return d(this,(function(i){switch(i.label){case 0:return this.redirectPersistenceManager?[3,3]:(se(t=e&&We(e)||this._popupRedirectResolver,this,"argument-error"),n=this,[4,Ke.create(this,[We(t._redirectPersistence)],"redirectUser")]);case 1:return n.redirectPersistenceManager=i.sent(),r=this,[4,this.redirectPersistenceManager.getCurrentUser()];case 2:r.redirectUser=i.sent(),i.label=3;case 3:return[2,this.redirectPersistenceManager]}}))}))},t.prototype._redirectUserForId=function(e){var t,n;return c(this,void 0,void 0,(function(){var r=this;return d(this,(function(i){switch(i.label){case 0:return this._isInitialized?[4,this.queue((function(){return c(r,void 0,void 0,(function(){return d(this,(function(e){return[2]}))}))}))]:[3,2];case 1:i.sent(),i.label=2;case 2:return(null===(t=this._currentUser)||void 0===t?void 0:t._redirectEventId)===e?[2,this._currentUser]:(null===(n=this.redirectUser)||void 0===n?void 0:n._redirectEventId)===e?[2,this.redirectUser]:[2,null]}}))}))},t.prototype._persistUserIfCurrent=function(e){return c(this,void 0,void 0,(function(){var t=this;return d(this,(function(n){return e===this.currentUser?[2,this.queue((function(){return c(t,void 0,void 0,(function(){return d(this,(function(t){return[2,this.directlySetCurrentUser(e)]}))}))}))]:[2]}))}))},t.prototype._notifyListenersIfCurrent=function(e){e===this.currentUser&&this.notifyAuthListeners()},t.prototype._key=function(){return"".concat(this.config.authDomain,":").concat(this.config.apiKey,":").concat(this.name)},t.prototype._startProactiveRefresh=function(){this.isProactiveRefreshEnabled=!0,this.currentUser&&this._currentUser._startProactiveRefresh()},t.prototype._stopProactiveRefresh=function(){this.isProactiveRefreshEnabled=!1,this.currentUser&&this._currentUser._stopProactiveRefresh()},Object.defineProperty(t.prototype,"_currentUser",{get:function(){return this.currentUser},enumerable:!1,configurable:!0}),t.prototype.notifyAuthListeners=function(){var e,t;if(this._isInitialized){this.idTokenSubscription.next(this.currentUser);var 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))}},t.prototype.registerStateListener=function(e,t,n,r){var i=this;if(this._deleted)return function(){};var o="function"==typeof t?t:t.next.bind(t),s=this._isInitialized?Promise.resolve():this._initializationPromise;return se(s,this,"internal-error"),s.then((function(){return o(i.currentUser)})),"function"==typeof t?e.addObserver(t,n,r):e.addObserver(t)},t.prototype.directlySetCurrentUser=function(e){return c(this,void 0,void 0,(function(){return d(this,(function(t){switch(t.label){case 0:return this.currentUser&&this.currentUser!==e&&this._currentUser._stopProactiveRefresh(),e&&this.isProactiveRefreshEnabled&&e._startProactiveRefresh(),this.currentUser=e,e?[4,this.assertedPersistence.setCurrentUser(e)]:[3,2];case 1:return t.sent(),[3,4];case 2:return[4,this.assertedPersistence.removeCurrentUser()];case 3:t.sent(),t.label=4;case 4:return[2]}}))}))},t.prototype.queue=function(e){return this.operations=this.operations.then(e,e),this.operations},Object.defineProperty(t.prototype,"assertedPersistence",{get:function(){return se(this.persistenceManager,this,"internal-error"),this.persistenceManager},enumerable:!1,configurable:!0}),t.prototype._logFramework=function(e){e&&!this.frameworks.includes(e)&&(this.frameworks.push(e),this.frameworks.sort(),this.clientVersion=nt(this.config.clientPlatform,this._getFrameworks()))},t.prototype._getFrameworks=function(){return this.frameworks},t.prototype._getAdditionalHeaders=function(){var e;return c(this,void 0,void 0,(function(){var t,n,r,i;return d(this,(function(o){switch(o.label){case 0:return(i={})["X-Client-Version"]=this.clientVersion,t=i,this.app.options.appId&&(t["X-Firebase-gmpid"]=this.app.options.appId),[4,null===(e=this.heartbeatServiceProvider.getImmediate({optional:!0}))||void 0===e?void 0:e.getHeartbeatsHeader()];case 1:return(n=o.sent())&&(t["X-Firebase-Client"]=n),[4,this._getAppCheckToken()];case 2:return(r=o.sent())&&(t["X-Firebase-AppCheck"]=r),[2,t]}}))}))},t.prototype._getAppCheckToken=function(){var t;return c(this,void 0,void 0,(function(){var n;return d(this,(function(r){switch(r.label){case 0:return[4,null===(t=this.appCheckServiceProvider.getImmediate({optional:!0}))||void 0===t?void 0:t.getToken()];case 1:return(null==(n=r.sent())?void 0:n.error)&&function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];Z.logLevel<=R.WARN&&Z.warn.apply(Z,l(["Auth (".concat(e,"): ").concat(t)],n,!1))}("Error while retrieving App Check token: ".concat(n.error)),[2,null==n?void 0:n.token]}}))}))},t}();function lt(e){return w(e)}var ht=function(){function e(e){var t=this;this.auth=e,this.observer=null,this.addObserver=function(e,t){const n=new E(e,t);return n.subscribe.bind(n)}((function(e){return t.observer=e}))}return Object.defineProperty(e.prototype,"next",{get:function(){return se(this.observer,this.auth,"internal-error"),this.observer.next.bind(this.observer)},enumerable:!1,configurable:!0}),e}();function ft(e,n){var r=t(e,"auth");if(r.isInitialized()){var i=r.getImmediate();if(_(r.getOptions(),null!=n?n:{}))return i;te(i,"already-initialized")}return r.initialize({options:n})}function pt(e,t,n){var r=lt(e);se(r._canInitEmulator,r,"emulator-config-failed"),se(/^https?:\/\//.test(t),r,"invalid-emulator-scheme");var i=!!(null==n?void 0:n.disableWarnings),o=vt(t),s=function(e){var t=vt(e),n=/(\/\/)?([^?#/]+)/.exec(e.substr(t.length));if(!n)return{host:"",port:null};var r=n[2].split("@").pop()||"",i=/^(\[[^\]]+\])(:|$)/.exec(r);if(i)return{host:o=i[1],port:mt(r.substr(o.length+1))};var o,s=r.split(":");return{host:o=s[0],port:mt(s[1])}}(t),a=s.host,u=s.port,c=null===u?"":":".concat(u);r.config.emulator={url:"".concat(o,"//").concat(a).concat(c,"/")},r.settings.appVerificationDisabledForTesting=!0,r.emulatorConfig=Object.freeze({host:a,port:u,protocol:o.replace(":",""),options:Object.freeze({disableWarnings:i})}),i||function(){function e(){var 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())}()}function vt(e){var t=e.indexOf(":");return t<0?"":e.substr(0,t+1)}function mt(e){if(!e)return null;var t=Number(e);return isNaN(t)?null:t}var gt=function(){function e(e,t){this.providerId=e,this.signInMethod=t}return e.prototype.toJSON=function(){return ae("not implemented")},e.prototype._getIdTokenResponse=function(e){return ae("not implemented")},e.prototype._linkToIdToken=function(e,t){return ae("not implemented")},e.prototype._getReauthenticationResolver=function(e){return ae("not implemented")},e}();function _t(e,t){return c(this,void 0,void 0,(function(){return d(this,(function(n){return[2,ye(e,"POST","/v1/accounts:resetPassword",Ie(e,t))]}))}))}function It(e,t){return c(this,void 0,void 0,(function(){return d(this,(function(n){return[2,ye(e,"POST","/v1/accounts:update",t)]}))}))}function yt(e,t){return c(this,void 0,void 0,(function(){return d(this,(function(n){return[2,ye(e,"POST","/v1/accounts:update",Ie(e,t))]}))}))}function Tt(e,t){return c(this,void 0,void 0,(function(){return d(this,(function(n){return[2,be(e,"POST","/v1/accounts:signInWithPassword",Ie(e,t))]}))}))}function bt(e,t){return c(this,void 0,void 0,(function(){return d(this,(function(n){return[2,ye(e,"POST","/v1/accounts:sendOobCode",Ie(e,t))]}))}))}function Et(e,t){return c(this,void 0,void 0,(function(){return d(this,(function(n){return[2,bt(e,t)]}))}))}function At(e,t){return c(this,void 0,void 0,(function(){return d(this,(function(n){return[2,bt(e,t)]}))}))}function wt(e,t){return c(this,void 0,void 0,(function(){return d(this,(function(n){return[2,bt(e,t)]}))}))}function kt(e,t){return c(this,void 0,void 0,(function(){return d(this,(function(n){return[2,bt(e,t)]}))}))}function Rt(e,t){return c(this,void 0,void 0,(function(){return d(this,(function(n){return[2,be(e,"POST","/v1/accounts:signInWithEmailLink",Ie(e,t))]}))}))}function Nt(e,t){return c(this,void 0,void 0,(function(){return d(this,(function(n){return[2,be(e,"POST","/v1/accounts:signInWithEmailLink",Ie(e,t))]}))}))}var St=function(e){function t(t,n,r,i){void 0===i&&(i=null);var o=e.call(this,"password",r)||this;return o._email=t,o._password=n,o._tenantId=i,o}return s(t,e),t._fromEmailAndPassword=function(e,n){return new t(e,n,"password")},t._fromEmailAndCode=function(e,n,r){return void 0===r&&(r=null),new t(e,n,"emailLink",r)},t.prototype.toJSON=function(){return{email:this._email,password:this._password,signInMethod:this.signInMethod,tenantId:this._tenantId}},t.fromJSON=function(e){var 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},t.prototype._getIdTokenResponse=function(e){var t;return c(this,void 0,void 0,(function(){var n,r,i=this;return d(this,(function(o){switch(o.label){case 0:switch(this.signInMethod){case"password":return[3,1];case"emailLink":return[3,4]}return[3,5];case 1:return n={returnSecureToken:!0,email:this._email,password:this._password,clientType:"CLIENT_TYPE_WEB"},(null===(t=e._getRecaptchaConfig())||void 0===t?void 0:t.emailPasswordEnabled)?[4,ut(e,n,"signInWithPassword")]:[3,3];case 2:return r=o.sent(),[2,Tt(e,r)];case 3:return[2,Tt(e,n).catch((function(t){return c(i,void 0,void 0,(function(){var r;return d(this,(function(i){switch(i.label){case 0:return t.code!=="auth/".concat("missing-recaptcha-token")?[3,2]:(console.log("Sign-in with email address and password is protected by reCAPTCHA for this project. Automatically triggering the reCAPTCHA flow and restarting the sign-in flow."),[4,ut(e,n,"signInWithPassword")]);case 1:return r=i.sent(),[2,Tt(e,r)];case 2:return[2,Promise.reject(t)]}}))}))}))];case 4:return[2,Rt(e,{email:this._email,oobCode:this._password})];case 5:te(e,"internal-error"),o.label=6;case 6:return[2]}}))}))},t.prototype._linkToIdToken=function(e,t){return c(this,void 0,void 0,(function(){return d(this,(function(n){switch(this.signInMethod){case"password":return[2,It(e,{idToken:t,returnSecureToken:!0,email:this._email,password:this._password})];case"emailLink":return[2,Nt(e,{idToken:t,email:this._email,oobCode:this._password})];default:te(e,"internal-error")}return[2]}))}))},t.prototype._getReauthenticationResolver=function(e){return this._getIdTokenResponse(e)},t}(gt);function Ot(e,t){return c(this,void 0,void 0,(function(){return d(this,(function(n){return[2,be(e,"POST","/v1/accounts:signInWithIdp",Ie(e,t))]}))}))}var Ct,Pt=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.pendingToken=null,t}return s(t,e),t._fromParams=function(e){var n=new t(e.providerId,e.signInMethod);return e.idToken||e.accessToken?(e.idToken&&(n.idToken=e.idToken),e.accessToken&&(n.accessToken=e.accessToken),e.nonce&&!e.pendingToken&&(n.nonce=e.nonce),e.pendingToken&&(n.pendingToken=e.pendingToken)):e.oauthToken&&e.oauthTokenSecret?(n.accessToken=e.oauthToken,n.secret=e.oauthTokenSecret):te("argument-error"),n},t.prototype.toJSON=function(){return{idToken:this.idToken,accessToken:this.accessToken,secret:this.secret,nonce:this.nonce,pendingToken:this.pendingToken,providerId:this.providerId,signInMethod:this.signInMethod}},t.fromJSON=function(e){var n="string"==typeof e?JSON.parse(e):e,r=n.providerId,i=n.signInMethod,o=u(n,["providerId","signInMethod"]);if(!r||!i)return null;var s=new t(r,i);return s.idToken=o.idToken||void 0,s.accessToken=o.accessToken||void 0,s.secret=o.secret,s.nonce=o.nonce,s.pendingToken=o.pendingToken||null,s},t.prototype._getIdTokenResponse=function(e){return Ot(e,this.buildRequest())},t.prototype._linkToIdToken=function(e,t){var n=this.buildRequest();return n.idToken=t,Ot(e,n)},t.prototype._getReauthenticationResolver=function(e){var t=this.buildRequest();return t.autoCreate=!1,Ot(e,t)},t.prototype.buildRequest=function(){var e={requestUri:"http://localhost",returnSecureToken:!0};if(this.pendingToken)e.pendingToken=this.pendingToken;else{var 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=y(t)}return e},t}(gt);var Dt=((Ct={}).USER_NOT_FOUND="user-not-found",Ct);var Lt=function(e){function t(t){var n=e.call(this,"phone","phone")||this;return n.params=t,n}return s(t,e),t._fromVerification=function(e,n){return new t({verificationId:e,verificationCode:n})},t._fromTokenResponse=function(e,n){return new t({phoneNumber:e,temporaryProof:n})},t.prototype._getIdTokenResponse=function(e){return function(e,t){return c(this,void 0,void 0,(function(){return d(this,(function(n){return[2,be(e,"POST","/v1/accounts:signInWithPhoneNumber",Ie(e,t))]}))}))}(e,this._makeVerificationRequest())},t.prototype._linkToIdToken=function(e,t){return function(e,t){return c(this,void 0,void 0,(function(){var n;return d(this,(function(r){switch(r.label){case 0:return[4,be(e,"POST","/v1/accounts:signInWithPhoneNumber",Ie(e,t))];case 1:if((n=r.sent()).temporaryProof)throw we(e,"account-exists-with-different-credential",n);return[2,n]}}))}))}(e,a({idToken:t},this._makeVerificationRequest()))},t.prototype._getReauthenticationResolver=function(e){return function(e,t){return c(this,void 0,void 0,(function(){var n;return d(this,(function(r){return n=a(a({},t),{operation:"REAUTH"}),[2,be(e,"POST","/v1/accounts:signInWithPhoneNumber",Ie(e,n),Dt)]}))}))}(e,this._makeVerificationRequest())},t.prototype._makeVerificationRequest=function(){var e=this.params,t=e.temporaryProof,n=e.phoneNumber,r=e.verificationId,i=e.verificationCode;return t&&n?{temporaryProof:t,phoneNumber:n}:{sessionInfo:r,code:i}},t.prototype.toJSON=function(){var 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},t.fromJSON=function(e){"string"==typeof e&&(e=JSON.parse(e));var n=e,r=n.verificationId,i=n.verificationCode,o=n.phoneNumber,s=n.temporaryProof;return i||r||o||s?new t({verificationId:r,verificationCode:i,phoneNumber:o,temporaryProof:s}):null},t}(gt);var Ut=function(){function e(e){var t,n,r,i,o,s,a=T(b(e)),u=null!==(t=a.apiKey)&&void 0!==t?t:null,c=null!==(n=a.oobCode)&&void 0!==n?n:null,d=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=a.mode)&&void 0!==r?r:null);se(u&&c&&d,"argument-error"),this.apiKey=u,this.operation=d,this.code=c,this.continueUrl=null!==(i=a.continueUrl)&&void 0!==i?i:null,this.languageCode=null!==(o=a.languageCode)&&void 0!==o?o:null,this.tenantId=null!==(s=a.tenantId)&&void 0!==s?s:null}return e.parseLink=function(t){var n=function(e){var t=T(b(e)).link,n=t?T(b(t)).deep_link_id:null,r=T(b(e)).deep_link_id;return(r?T(b(r)).link:null)||r||n||t||e}(t);try{return new e(n)}catch(e){return null}},e}();function Mt(e){return Ut.parseLink(e)}var Vt=function(){function e(){this.providerId=e.PROVIDER_ID}return e.credential=function(e,t){return St._fromEmailAndPassword(e,t)},e.credentialWithLink=function(e,t){var n=Ut.parseLink(t);return se(n,"argument-error"),St._fromEmailAndCode(e,n.code,n.tenantId)},e.PROVIDER_ID="password",e.EMAIL_PASSWORD_SIGN_IN_METHOD="password",e.EMAIL_LINK_SIGN_IN_METHOD="emailLink",e}(),Ft=function(){function e(e){this.providerId=e,this.defaultLanguageCode=null,this.customParameters={}}return e.prototype.setDefaultLanguage=function(e){this.defaultLanguageCode=e},e.prototype.setCustomParameters=function(e){return this.customParameters=e,this},e.prototype.getCustomParameters=function(){return this.customParameters},e}(),Ht=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.scopes=[],t}return s(t,e),t.prototype.addScope=function(e){return this.scopes.includes(e)||this.scopes.push(e),this},t.prototype.getScopes=function(){return l([],this.scopes,!0)},t}(Ft),xt=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return s(t,e),t.credentialFromJSON=function(e){var t="string"==typeof e?JSON.parse(e):e;return se("providerId"in t&&"signInMethod"in t,"argument-error"),Pt._fromParams(t)},t.prototype.credential=function(e){return this._credential(a(a({},e),{nonce:e.rawNonce}))},t.prototype._credential=function(e){return se(e.idToken||e.accessToken,"argument-error"),Pt._fromParams(a(a({},e),{providerId:this.providerId,signInMethod:this.providerId}))},t.credentialFromResult=function(e){return t.oauthCredentialFromTaggedObject(e)},t.credentialFromError=function(e){return t.oauthCredentialFromTaggedObject(e.customData||{})},t.oauthCredentialFromTaggedObject=function(e){var n=e._tokenResponse;if(!n)return null;var r=n,i=r.oauthIdToken,o=r.oauthAccessToken,s=r.oauthTokenSecret,a=r.pendingToken,u=r.nonce,c=r.providerId;if(!(o||s||i||a))return null;if(!c)return null;try{return new t(c)._credential({idToken:i,accessToken:o,nonce:u,pendingToken:a})}catch(e){return null}},t}(Ht),jt=function(e){function t(){return e.call(this,"facebook.com")||this}return s(t,e),t.credential=function(e){return Pt._fromParams({providerId:t.PROVIDER_ID,signInMethod:t.FACEBOOK_SIGN_IN_METHOD,accessToken:e})},t.credentialFromResult=function(e){return t.credentialFromTaggedObject(e)},t.credentialFromError=function(e){return t.credentialFromTaggedObject(e.customData||{})},t.credentialFromTaggedObject=function(e){var n=e._tokenResponse;if(!n||!("oauthAccessToken"in n))return null;if(!n.oauthAccessToken)return null;try{return t.credential(n.oauthAccessToken)}catch(e){return null}},t.FACEBOOK_SIGN_IN_METHOD="facebook.com",t.PROVIDER_ID="facebook.com",t}(Ht),qt=function(e){function t(){var t=e.call(this,"google.com")||this;return t.addScope("profile"),t}return s(t,e),t.credential=function(e,n){return Pt._fromParams({providerId:t.PROVIDER_ID,signInMethod:t.GOOGLE_SIGN_IN_METHOD,idToken:e,accessToken:n})},t.credentialFromResult=function(e){return t.credentialFromTaggedObject(e)},t.credentialFromError=function(e){return t.credentialFromTaggedObject(e.customData||{})},t.credentialFromTaggedObject=function(e){var n=e._tokenResponse;if(!n)return null;var r=n,i=r.oauthIdToken,o=r.oauthAccessToken;if(!i&&!o)return null;try{return t.credential(i,o)}catch(e){return null}},t.GOOGLE_SIGN_IN_METHOD="google.com",t.PROVIDER_ID="google.com",t}(Ht),Bt=function(e){function t(){return e.call(this,"github.com")||this}return s(t,e),t.credential=function(e){return Pt._fromParams({providerId:t.PROVIDER_ID,signInMethod:t.GITHUB_SIGN_IN_METHOD,accessToken:e})},t.credentialFromResult=function(e){return t.credentialFromTaggedObject(e)},t.credentialFromError=function(e){return t.credentialFromTaggedObject(e.customData||{})},t.credentialFromTaggedObject=function(e){var n=e._tokenResponse;if(!n||!("oauthAccessToken"in n))return null;if(!n.oauthAccessToken)return null;try{return t.credential(n.oauthAccessToken)}catch(e){return null}},t.GITHUB_SIGN_IN_METHOD="github.com",t.PROVIDER_ID="github.com",t}(Ht),Wt=function(e){function t(t,n){var r=e.call(this,t,t)||this;return r.pendingToken=n,r}return s(t,e),t.prototype._getIdTokenResponse=function(e){return Ot(e,this.buildRequest())},t.prototype._linkToIdToken=function(e,t){var n=this.buildRequest();return n.idToken=t,Ot(e,n)},t.prototype._getReauthenticationResolver=function(e){var t=this.buildRequest();return t.autoCreate=!1,Ot(e,t)},t.prototype.toJSON=function(){return{signInMethod:this.signInMethod,providerId:this.providerId,pendingToken:this.pendingToken}},t.fromJSON=function(e){var n="string"==typeof e?JSON.parse(e):e,r=n.providerId,i=n.signInMethod,o=n.pendingToken;return r&&i&&o&&r===i?new t(r,o):null},t._create=function(e,n){return new t(e,n)},t.prototype.buildRequest=function(){return{requestUri:"http://localhost",returnSecureToken:!0,pendingToken:this.pendingToken}},t}(gt),Gt=function(e){function t(t){return se(t.startsWith("saml."),"argument-error"),e.call(this,t)||this}return s(t,e),t.credentialFromResult=function(e){return t.samlCredentialFromTaggedObject(e)},t.credentialFromError=function(e){return t.samlCredentialFromTaggedObject(e.customData||{})},t.credentialFromJSON=function(e){var t=Wt.fromJSON(e);return se(t,"argument-error"),t},t.samlCredentialFromTaggedObject=function(e){var t=e._tokenResponse;if(!t)return null;var n=t,r=n.pendingToken,i=n.providerId;if(!r||!i)return null;try{return Wt._create(i,r)}catch(e){return null}},t}(Ft),zt=function(e){function t(){return e.call(this,"twitter.com")||this}return s(t,e),t.credential=function(e,n){return Pt._fromParams({providerId:t.PROVIDER_ID,signInMethod:t.TWITTER_SIGN_IN_METHOD,oauthToken:e,oauthTokenSecret:n})},t.credentialFromResult=function(e){return t.credentialFromTaggedObject(e)},t.credentialFromError=function(e){return t.credentialFromTaggedObject(e.customData||{})},t.credentialFromTaggedObject=function(e){var n=e._tokenResponse;if(!n)return null;var r=n,i=r.oauthAccessToken,o=r.oauthTokenSecret;if(!i||!o)return null;try{return t.credential(i,o)}catch(e){return null}},t.TWITTER_SIGN_IN_METHOD="twitter.com",t.PROVIDER_ID="twitter.com",t}(Ht);function Kt(e,t){return c(this,void 0,void 0,(function(){return d(this,(function(n){return[2,be(e,"POST","/v1/accounts:signUp",Ie(e,t))]}))}))}var Jt=function(){function e(e){this.user=e.user,this.providerId=e.providerId,this._tokenResponse=e._tokenResponse,this.operationType=e.operationType}return e._fromIdTokenResponse=function(t,n,r,i){return void 0===i&&(i=!1),c(this,void 0,void 0,(function(){var o,s;return d(this,(function(a){switch(a.label){case 0:return[4,qe._fromIdTokenResponse(t,r,i)];case 1:return o=a.sent(),s=Yt(r),[2,new e({user:o,providerId:s,_tokenResponse:r,operationType:n})]}}))}))},e._forOperation=function(t,n,r){return c(this,void 0,void 0,(function(){var i;return d(this,(function(o){switch(o.label){case 0:return[4,t._updateTokensIfNecessary(r,!0)];case 1:return o.sent(),i=Yt(r),[2,new e({user:t,providerId:i,_tokenResponse:r,operationType:n})]}}))}))},e}();function Yt(e){return e.providerId?e.providerId:"phoneNumber"in e?"phone":null}function Xt(e){var t;return c(this,void 0,void 0,(function(){var n,r,i;return d(this,(function(o){switch(o.label){case 0:return[4,(n=lt(e))._initializationPromise];case 1:return o.sent(),(null===(t=n.currentUser)||void 0===t?void 0:t.isAnonymous)?[2,new Jt({user:n.currentUser,providerId:null,operationType:"signIn"})]:[4,Kt(n,{returnSecureToken:!0})];case 2:return r=o.sent(),[4,Jt._fromIdTokenResponse(n,"signIn",r,!0)];case 3:return i=o.sent(),[4,n._updateCurrentUser(i.user)];case 4:return o.sent(),[2,i]}}))}))}var Qt=function(e){function t(n,r,i,o){var s,a=this;return(a=e.call(this,r.code,r.message)||this).operationType=i,a.user=o,Object.setPrototypeOf(a,t.prototype),a.customData={appName:n.name,tenantId:null!==(s=n.tenantId)&&void 0!==s?s:void 0,_serverResponse:r.customData._serverResponse,operationType:i},a}return s(t,e),t._fromErrorAndOperation=function(e,n,r,i){return new t(e,n,r,i)},t}(v);function $t(e,t,n,r){return("reauthenticate"===t?n._getReauthenticationResolver(e):n._getIdTokenResponse(e)).catch((function(n){if(n.code==="auth/".concat("multi-factor-auth-required"))throw Qt._fromErrorAndOperation(e,n,t,r);throw n}))}function Zt(e){return new Set(e.map((function(e){return e.providerId})).filter((function(e){return!!e})))}function en(e,t){return c(this,void 0,void 0,(function(){var n,r,i,o,s,a;return d(this,(function(u){switch(u.label){case 0:return[4,nn(!0,n=w(e),t)];case 1:return u.sent(),i=Re,o=[n.auth],a={},[4,n.getIdToken()];case 2:return[4,i.apply(void 0,o.concat([(a.idToken=u.sent(),a.deleteProvider=[t],a)]))];case 3:return r=u.sent().providerUserInfo,s=Zt(r||[]),n.providerData=n.providerData.filter((function(e){return s.has(e.providerId)})),s.has("phone")||(n.phoneNumber=null),[4,n.auth._persistUserIfCurrent(n)];case 4:return u.sent(),[2,n]}}))}))}function tn(e,t,n){return void 0===n&&(n=!1),c(this,void 0,void 0,(function(){var r,i,o,s,a,u;return d(this,(function(c){switch(c.label){case 0:return i=Le,o=[e],a=(s=t)._linkToIdToken,u=[e.auth],[4,e.getIdToken()];case 1:return[4,i.apply(void 0,o.concat([a.apply(s,u.concat([c.sent()])),n]))];case 2:return r=c.sent(),[2,Jt._forOperation(e,"link",r)]}}))}))}function nn(e,t,n){return c(this,void 0,void 0,(function(){var r,i;return d(this,(function(o){switch(o.label){case 0:return[4,Ve(t)];case 1:return o.sent(),r=Zt(t.providerData),i=!1===e?"provider-already-linked":"no-such-provider",se(r.has(n)===e,t.auth,i),[2]}}))}))}function rn(e,t,n){return void 0===n&&(n=!1),c(this,void 0,void 0,(function(){var r,i,o,s,a,u;return d(this,(function(c){switch(c.label){case 0:r=e.auth,i="reauthenticate",c.label=1;case 1:return c.trys.push([1,3,,4]),[4,Le(e,$t(r,i,t,e),n)];case 2:return se((o=c.sent()).idToken,r,"internal-error"),se(s=De(o.idToken),r,"internal-error"),a=s.sub,se(e.uid===a,r,"user-mismatch"),[2,Jt._forOperation(e,i,o)];case 3:throw(null==(u=c.sent())?void 0:u.code)==="auth/".concat("user-not-found")&&te(r,"user-mismatch"),u;case 4:return[2]}}))}))}function on(e,t,n){return void 0===n&&(n=!1),c(this,void 0,void 0,(function(){var r,i,o;return d(this,(function(s){switch(s.label){case 0:return[4,$t(e,r="signIn",t)];case 1:return i=s.sent(),[4,Jt._fromIdTokenResponse(e,r,i)];case 2:return o=s.sent(),n?[3,4]:[4,e._updateCurrentUser(o.user)];case 3:s.sent(),s.label=4;case 4:return[2,o]}}))}))}function sn(e,t){return c(this,void 0,void 0,(function(){return d(this,(function(n){return[2,on(lt(e),t)]}))}))}function an(e,t){return c(this,void 0,void 0,(function(){var n;return d(this,(function(r){switch(r.label){case 0:return[4,nn(!1,n=w(e),t.providerId)];case 1:return r.sent(),[2,tn(n,t)]}}))}))}function un(e,t){return c(this,void 0,void 0,(function(){return d(this,(function(n){return[2,rn(w(e),t)]}))}))}function cn(e,t){return c(this,void 0,void 0,(function(){return d(this,(function(n){return[2,be(e,"POST","/v1/accounts:signInWithCustomToken",Ie(e,t))]}))}))}function dn(e,t){return c(this,void 0,void 0,(function(){var n,r,i;return d(this,(function(o){switch(o.label){case 0:return[4,cn(n=lt(e),{token:t,returnSecureToken:!0})];case 1:return r=o.sent(),[4,Jt._fromIdTokenResponse(n,"signIn",r)];case 2:return i=o.sent(),[4,n._updateCurrentUser(i.user)];case 3:return o.sent(),[2,i]}}))}))}var ln=function(){function e(e,t){this.factorId=e,this.uid=t.mfaEnrollmentId,this.enrollmentTime=new Date(t.enrolledAt).toUTCString(),this.displayName=t.displayName}return e._fromServerResponse=function(e,t){return"phoneInfo"in t?hn._fromServerResponse(e,t):"totpInfo"in t?fn._fromServerResponse(e,t):te(e,"internal-error")},e}(),hn=function(e){function t(t){var n=e.call(this,"phone",t)||this;return n.phoneNumber=t.phoneInfo,n}return s(t,e),t._fromServerResponse=function(e,n){return new t(n)},t}(ln),fn=function(e){function t(t){return e.call(this,"totp",t)||this}return s(t,e),t._fromServerResponse=function(e,n){return new t(n)},t}(ln);function pn(e,t,n){var r;se((null===(r=n.url)||void 0===r?void 0:r.length)>0,e,"invalid-continue-uri"),se(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&&(se(n.iOS.bundleId.length>0,e,"missing-ios-bundle-id"),t.iOSBundleId=n.iOS.bundleId),n.android&&(se(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)}function vn(e,t,n){var r;return c(this,void 0,void 0,(function(){var i,o,s,a=this;return d(this,(function(u){switch(u.label){case 0:return i=lt(e),o={requestType:"PASSWORD_RESET",email:t,clientType:"CLIENT_TYPE_WEB"},(null===(r=i._getRecaptchaConfig())||void 0===r?void 0:r.emailPasswordEnabled)?[4,ut(i,o,"getOobCode",!0)]:[3,3];case 1:return s=u.sent(),n&&pn(i,s,n),[4,At(i,s)];case 2:return u.sent(),[3,5];case 3:return n&&pn(i,o,n),[4,At(i,o).catch((function(e){return c(a,void 0,void 0,(function(){var t;return d(this,(function(r){switch(r.label){case 0:return e.code!=="auth/".concat("missing-recaptcha-token")?[3,3]:(console.log("Password resets are protected by reCAPTCHA for this project. Automatically triggering the reCAPTCHA flow and restarting the password reset flow."),[4,ut(i,o,"getOobCode",!0)]);case 1:return t=r.sent(),n&&pn(i,t,n),[4,At(i,t)];case 2:return r.sent(),[3,4];case 3:return[2,Promise.reject(e)];case 4:return[2]}}))}))}))];case 4:u.sent(),u.label=5;case 5:return[2]}}))}))}function mn(e,t,n){return c(this,void 0,void 0,(function(){return d(this,(function(r){switch(r.label){case 0:return[4,_t(w(e),{oobCode:t,newPassword:n})];case 1:return r.sent(),[2]}}))}))}function gn(e,t){return c(this,void 0,void 0,(function(){return d(this,(function(n){switch(n.label){case 0:return[4,yt(w(e),{oobCode:t})];case 1:return n.sent(),[2]}}))}))}function _n(e,t){return c(this,void 0,void 0,(function(){var n,r,i,o;return d(this,(function(s){switch(s.label){case 0:return[4,_t(n=w(e),{oobCode:t})];case 1:switch(r=s.sent(),se(i=r.requestType,n,"internal-error"),i){case"EMAIL_SIGNIN":break;case"VERIFY_AND_CHANGE_EMAIL":se(r.newEmail,n,"internal-error");break;case"REVERT_SECOND_FACTOR_ADDITION":se(r.mfaInfo,n,"internal-error");default:se(r.email,n,"internal-error")}return o=null,r.mfaInfo&&(o=ln._fromServerResponse(lt(n),r.mfaInfo)),[2,{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:i}]}}))}))}function In(e,t){return c(this,void 0,void 0,(function(){return d(this,(function(n){switch(n.label){case 0:return[4,_n(w(e),t)];case 1:return[2,n.sent().data.email]}}))}))}function yn(e,t,n){var r;return c(this,void 0,void 0,(function(){var i,o,s,a,u,l,h=this;return d(this,(function(f){switch(f.label){case 0:return i=lt(e),o={returnSecureToken:!0,email:t,password:n,clientType:"CLIENT_TYPE_WEB"},(null===(r=i._getRecaptchaConfig())||void 0===r?void 0:r.emailPasswordEnabled)?[4,ut(i,o,"signUpPassword")]:[3,2];case 1:return a=f.sent(),s=Kt(i,a),[3,3];case 2:s=Kt(i,o).catch((function(e){return c(h,void 0,void 0,(function(){var t;return d(this,(function(n){switch(n.label){case 0:return e.code!=="auth/".concat("missing-recaptcha-token")?[3,2]:(console.log("Sign-up is protected by reCAPTCHA for this project. Automatically triggering the reCAPTCHA flow and restarting the sign-up flow."),[4,ut(i,o,"signUpPassword")]);case 1:return t=n.sent(),[2,Kt(i,t)];case 2:return[2,Promise.reject(e)]}}))}))})),f.label=3;case 3:return[4,s.catch((function(e){return Promise.reject(e)}))];case 4:return u=f.sent(),[4,Jt._fromIdTokenResponse(i,"signIn",u)];case 5:return l=f.sent(),[4,i._updateCurrentUser(l.user)];case 6:return f.sent(),[2,l]}}))}))}function Tn(e,t,n){return sn(w(e),Vt.credential(t,n))}function bn(e,t,n){var r;return c(this,void 0,void 0,(function(){function i(e,t){se(t.handleCodeInApp,o,"argument-error"),t&&pn(o,e,t)}var o,s,a,u=this;return d(this,(function(l){switch(l.label){case 0:return o=lt(e),s={requestType:"EMAIL_SIGNIN",email:t,clientType:"CLIENT_TYPE_WEB"},(null===(r=o._getRecaptchaConfig())||void 0===r?void 0:r.emailPasswordEnabled)?[4,ut(o,s,"getOobCode",!0)]:[3,3];case 1:return i(a=l.sent(),n),[4,wt(o,a)];case 2:return l.sent(),[3,5];case 3:return i(s,n),[4,wt(o,s).catch((function(e){return c(u,void 0,void 0,(function(){var t;return d(this,(function(r){switch(r.label){case 0:return e.code!=="auth/".concat("missing-recaptcha-token")?[3,3]:(console.log("Email link sign-in is protected by reCAPTCHA for this project. Automatically triggering the reCAPTCHA flow and restarting the sign-in flow."),[4,ut(o,s,"getOobCode",!0)]);case 1:return i(t=r.sent(),n),[4,wt(o,t)];case 2:return r.sent(),[3,4];case 3:return[2,Promise.reject(e)];case 4:return[2]}}))}))}))];case 4:l.sent(),l.label=5;case 5:return[2]}}))}))}function En(e,t){var n=Ut.parseLink(t);return"EMAIL_SIGNIN"===(null==n?void 0:n.operation)}function An(e,t,n){return c(this,void 0,void 0,(function(){var r,i;return d(this,(function(o){return r=w(e),se((i=Vt.credentialWithLink(t,n||ce()))._tenantId===(r.tenantId||null),r,"tenant-id-mismatch"),[2,sn(r,i)]}))}))}function wn(e,t){return c(this,void 0,void 0,(function(){return d(this,(function(n){return[2,ye(e,"POST","/v1/accounts:createAuthUri",Ie(e,t))]}))}))}function kn(e,t){return c(this,void 0,void 0,(function(){var n,r;return d(this,(function(i){switch(i.label){case 0:return n=de()?ce():"http://localhost",r={identifier:t,continueUri:n},[4,wn(w(e),r)];case 1:return[2,i.sent().signinMethods||[]]}}))}))}function Rn(e,t){return c(this,void 0,void 0,(function(){var n,r,i;return d(this,(function(o){switch(o.label){case 0:return n=w(e),[4,e.getIdToken()];case 1:return r=o.sent(),i={requestType:"VERIFY_EMAIL",idToken:r},t&&pn(n.auth,i,t),[4,Et(n.auth,i)];case 2:return o.sent().email===e.email?[3,4]:[4,e.reload()];case 3:o.sent(),o.label=4;case 4:return[2]}}))}))}function Nn(e,t,n){return c(this,void 0,void 0,(function(){var r,i,o;return d(this,(function(s){switch(s.label){case 0:return r=w(e),[4,e.getIdToken()];case 1:return i=s.sent(),o={requestType:"VERIFY_AND_CHANGE_EMAIL",idToken:i,newEmail:t},n&&pn(r.auth,o,n),[4,kt(r.auth,o)];case 2:return s.sent().email===e.email?[3,4]:[4,e.reload()];case 3:s.sent(),s.label=4;case 4:return[2]}}))}))}function Sn(e,t){return c(this,void 0,void 0,(function(){return d(this,(function(n){return[2,ye(e,"POST","/v1/accounts:update",t)]}))}))}function On(e,t){var n=t.displayName,r=t.photoURL;return c(this,void 0,void 0,(function(){var t,i,o,s,a;return d(this,(function(u){switch(u.label){case 0:return void 0===n&&void 0===r?[2]:[4,(t=w(e)).getIdToken()];case 1:return i=u.sent(),o={idToken:i,displayName:n,photoUrl:r,returnSecureToken:!0},[4,Le(t,Sn(t.auth,o))];case 2:return s=u.sent(),t.displayName=s.displayName||null,t.photoURL=s.photoUrl||null,a=t.providerData.find((function(e){return"password"===e.providerId})),a&&(a.displayName=t.displayName,a.photoURL=t.photoURL),[4,t._updateTokensIfNecessary(s)];case 3:return u.sent(),[2]}}))}))}function Cn(e,t){return Dn(w(e),t,null)}function Pn(e,t){return Dn(w(e),null,t)}function Dn(e,t,n){return c(this,void 0,void 0,(function(){var r,i,o,s;return d(this,(function(a){switch(a.label){case 0:return r=e.auth,[4,e.getIdToken()];case 1:return i=a.sent(),o={idToken:i,returnSecureToken:!0},t&&(o.email=t),n&&(o.password=n),[4,Le(e,It(r,o))];case 2:return s=a.sent(),[4,e._updateTokensIfNecessary(s,!0)];case 3:return a.sent(),[2]}}))}))}var Ln=function(e,t,n){void 0===n&&(n={}),this.isNewUser=e,this.providerId=t,this.profile=n},Un=function(e){function t(t,n,r,i){var o=e.call(this,t,n,r)||this;return o.username=i,o}return s(t,e),t}(Ln),Mn=function(e){function t(t,n){return e.call(this,t,"facebook.com",n)||this}return s(t,e),t}(Ln),Vn=function(e){function t(t,n){return e.call(this,t,"github.com",n,"string"==typeof(null==n?void 0:n.login)?null==n?void 0:n.login:null)||this}return s(t,e),t}(Un),Fn=function(e){function t(t,n){return e.call(this,t,"google.com",n)||this}return s(t,e),t}(Ln),Hn=function(e){function t(t,n,r){return e.call(this,t,"twitter.com",n,r)||this}return s(t,e),t}(Un);function xn(e){var t=e,n=t.user,r=t._tokenResponse;return n.isAnonymous&&!r?{providerId:null,isNewUser:!1,profile:null}:function(e){var t,n;if(!e)return null;var r=e.providerId,i=e.rawUserInfo?JSON.parse(e.rawUserInfo):{},o=e.isNewUser||"identitytoolkit#SignupNewUserResponse"===e.kind;if(!r&&(null==e?void 0:e.idToken)){var s=null===(n=null===(t=De(e.idToken))||void 0===t?void 0:t.firebase)||void 0===n?void 0:n.sign_in_provider;if(s)return new Ln(o,"anonymous"!==s&&"custom"!==s?s:null)}if(!r)return null;switch(r){case"facebook.com":return new Mn(o,i);case"github.com":return new Vn(o,i);case"google.com":return new Fn(o,i);case"twitter.com":return new Hn(o,i,e.screenName||null);case"custom":case"anonymous":return new Ln(o,null);default:return new Ln(o,r,i)}}(r)}function jn(e,t){return w(e).setPersistence(t)}function qn(e){return lt(e).initializeRecaptchaConfig()}function Bn(e,t,n,r){return w(e).onIdTokenChanged(t,n,r)}function Wn(e,t,n){return w(e).beforeAuthStateChanged(t,n)}function Gn(e,t,n,r){return w(e).onAuthStateChanged(t,n,r)}function zn(e){w(e).useDeviceLanguage()}function Kn(e,t){return w(e).updateCurrentUser(t)}function Jn(e){return w(e).signOut()}function Yn(e){return c(this,void 0,void 0,(function(){return d(this,(function(t){return[2,w(e).delete()]}))}))}var Xn=function(){function e(e,t,n){this.type=e,this.credential=t,this.user=n}return e._fromIdtoken=function(t,n){return new e("enroll",t,n)},e._fromMfaPendingCredential=function(t){return new e("signin",t)},e.prototype.toJSON=function(){var e;return{multiFactorSession:(e={},e["enroll"===this.type?"idToken":"pendingCredential"]=this.credential,e)}},e.fromJSON=function(t){var n,r;if(null==t?void 0:t.multiFactorSession){if(null===(n=t.multiFactorSession)||void 0===n?void 0:n.pendingCredential)return e._fromMfaPendingCredential(t.multiFactorSession.pendingCredential);if(null===(r=t.multiFactorSession)||void 0===r?void 0:r.idToken)return e._fromIdtoken(t.multiFactorSession.idToken)}return null},e}(),Qn=function(){function e(e,t,n){this.session=e,this.hints=t,this.signInResolver=n}return e._fromError=function(t,n){var r=this,i=lt(t),o=n.customData._serverResponse,s=(o.mfaInfo||[]).map((function(e){return ln._fromServerResponse(i,e)}));se(o.mfaPendingCredential,i,"internal-error");var u=Xn._fromMfaPendingCredential(o.mfaPendingCredential);return new e(u,s,(function(e){return c(r,void 0,void 0,(function(){var t,r,s;return d(this,(function(c){switch(c.label){case 0:return[4,e._process(i,u)];case 1:switch(t=c.sent(),delete o.mfaInfo,delete o.mfaPendingCredential,r=a(a({},o),{idToken:t.idToken,refreshToken:t.refreshToken}),n.operationType){case"signIn":return[3,2];case"reauthenticate":return[3,5]}return[3,6];case 2:return[4,Jt._fromIdTokenResponse(i,n.operationType,r)];case 3:return s=c.sent(),[4,i._updateCurrentUser(s.user)];case 4:return c.sent(),[2,s];case 5:return se(n.user,i,"internal-error"),[2,Jt._forOperation(n.user,n.operationType,r)];case 6:te(i,"internal-error"),c.label=7;case 7:return[2]}}))}))}))},e.prototype.resolveSignIn=function(e){return c(this,void 0,void 0,(function(){var t;return d(this,(function(n){return t=e,[2,this.signInResolver(t)]}))}))},e}();function $n(e,t){var n,r=w(e),i=t;return se(t.customData.operationType,r,"argument-error"),se(null===(n=i.customData._serverResponse)||void 0===n?void 0:n.mfaPendingCredential,r,"argument-error"),Qn._fromError(r,i)}var Zn=function(){function e(e){var t=this;this.user=e,this.enrolledFactors=[],e._onReload((function(n){n.mfaInfo&&(t.enrolledFactors=n.mfaInfo.map((function(t){return ln._fromServerResponse(e.auth,t)})))}))}return e._fromUser=function(t){return new e(t)},e.prototype.getSession=function(){return c(this,void 0,void 0,(function(){var e,t;return d(this,(function(n){switch(n.label){case 0:return t=(e=Xn)._fromIdtoken,[4,this.user.getIdToken()];case 1:return[2,t.apply(e,[n.sent(),this.user])]}}))}))},e.prototype.enroll=function(e,t){return c(this,void 0,void 0,(function(){var n,r,i;return d(this,(function(o){switch(o.label){case 0:return n=e,[4,this.getSession()];case 1:return r=o.sent(),[4,Le(this.user,n._process(this.user.auth,r,t))];case 2:return i=o.sent(),[4,this.user._updateTokensIfNecessary(i)];case 3:return o.sent(),[2,this.user.reload()]}}))}))},e.prototype.unenroll=function(e){return c(this,void 0,void 0,(function(){var t,n,r;return d(this,(function(i){switch(i.label){case 0:return t="string"==typeof e?e:e.uid,[4,this.user.getIdToken()];case 1:n=i.sent(),i.label=2;case 2:return i.trys.push([2,6,,7]),[4,Le(this.user,(o=this.user.auth,s={idToken:n,mfaEnrollmentId:t},ye(o,"POST","/v2/accounts/mfaEnrollment:withdraw",Ie(o,s))))];case 3:return r=i.sent(),this.enrolledFactors=this.enrolledFactors.filter((function(e){return e.uid!==t})),[4,this.user._updateTokensIfNecessary(r)];case 4:return i.sent(),[4,this.user.reload()];case 5:return i.sent(),[3,7];case 6:throw i.sent();case 7:return[2]}var o,s}))}))},e}(),er=new WeakMap;function tr(e){var t=w(e);return er.has(t)||er.set(t,Zn._fromUser(t)),er.get(t)}var nr="@firebase/auth",rr=function(){function e(e){this.auth=e,this.internalListeners=new Map}return e.prototype.getUid=function(){var e;return this.assertAuthConfigured(),(null===(e=this.auth.currentUser)||void 0===e?void 0:e.uid)||null},e.prototype.getToken=function(e){return c(this,void 0,void 0,(function(){return d(this,(function(t){switch(t.label){case 0:return this.assertAuthConfigured(),[4,this.auth._initializationPromise];case 1:return t.sent(),this.auth.currentUser?[4,this.auth.currentUser.getIdToken(e)]:[2,null];case 2:return[2,{accessToken:t.sent()}]}}))}))},e.prototype.addAuthTokenListener=function(e){if(this.assertAuthConfigured(),!this.internalListeners.has(e)){var t=this.auth.onIdTokenChanged((function(t){e((null==t?void 0:t.stsTokenManager.accessToken)||null)}));this.internalListeners.set(e,t),this.updateProactiveRefresh()}},e.prototype.removeAuthTokenListener=function(e){this.assertAuthConfigured();var t=this.internalListeners.get(e);t&&(this.internalListeners.delete(e),t(),this.updateProactiveRefresh())},e.prototype.assertAuthConfigured=function(){se(this.auth._initializationPromise,"dependent-sdk-initialized-before-auth")},e.prototype.updateProactiveRefresh=function(){this.internalListeners.size>0?this.auth._startProactiveRefresh():this.auth._stopProactiveRefresh()},e}();var ir={PHONE:"phone",TOTP:"totp"},or={FACEBOOK:"facebook.com",GITHUB:"github.com",GOOGLE:"google.com",PASSWORD:"password",PHONE:"phone",TWITTER:"twitter.com"},sr={EMAIL_LINK:"emailLink",EMAIL_PASSWORD:"password",FACEBOOK:"facebook.com",GITHUB:"github.com",GOOGLE:"google.com",PHONE:"phone",TWITTER:"twitter.com"},ar={LINK:"link",REAUTHENTICATE:"reauthenticate",SIGN_IN:"signIn"},ur={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"},cr=function(){function e(e,t){this.storageRetriever=e,this.type=t}return e.prototype._isAvailable=function(){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)}},e.prototype._set=function(e,t){return this.storage.setItem(e,JSON.stringify(t)),Promise.resolve()},e.prototype._get=function(e){var t=this.storage.getItem(e);return Promise.resolve(t?JSON.parse(t):null)},e.prototype._remove=function(e){return this.storage.removeItem(e),Promise.resolve()},Object.defineProperty(e.prototype,"storage",{get:function(){return this.storageRetriever()},enumerable:!1,configurable:!0}),e}();var dr=function(e){function t(){var t,n=e.call(this,(function(){return window.localStorage}),"LOCAL")||this;return n.boundEventHandler=function(e,t){return n.onStorageEvent(e,t)},n.listeners={},n.localCache={},n.pollTimer=null,n.safariLocalStorageNotSynced=(Ye(t=p())||et(t))&&function(){try{return!(!window||window===window.top)}catch(e){return!1}}(),n.fallbackToPolling=function(e){return void 0===e&&(e=p()),et(e)||Qe(e)||Ze(e)||$e(e)||/windows phone/i.test(e)||Xe(e)}(),n._shouldAllowMigration=!0,n}return s(t,e),t.prototype.forAllChangedKeys=function(e){for(var t=0,n=Object.keys(this.listeners);t<n.length;t++){var r=n[t],i=this.storage.getItem(r),o=this.localCache[r];i!==o&&e(r,o,i)}},t.prototype.onStorageEvent=function(e,t){var n=this;if(void 0===t&&(t=!1),e.key){var r=e.key;if(t?this.detachListener():this.stopPolling(),this.safariLocalStorageNotSynced){var i=this.storage.getItem(r);if(e.newValue!==i)null!==e.newValue?this.storage.setItem(r,e.newValue):this.storage.removeItem(r);else if(this.localCache[r]===e.newValue&&!t)return}var o=function(){var e=n.storage.getItem(r);(t||n.localCache[r]!==e)&&n.notifyListeners(r,e)},s=this.storage.getItem(r);tt()&&s!==e.newValue&&e.newValue!==e.oldValue?setTimeout(o,10):o()}else this.forAllChangedKeys((function(e,t,r){n.notifyListeners(e,r)}))},t.prototype.notifyListeners=function(e,t){this.localCache[e]=t;var n=this.listeners[e];if(n)for(var r=0,i=Array.from(n);r<i.length;r++){(0,i[r])(t?JSON.parse(t):t)}},t.prototype.startPolling=function(){var e=this;this.stopPolling(),this.pollTimer=setInterval((function(){e.forAllChangedKeys((function(t,n,r){e.onStorageEvent(new StorageEvent("storage",{key:t,oldValue:n,newValue:r}),!0)}))}),1e3)},t.prototype.stopPolling=function(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)},t.prototype.attachListener=function(){window.addEventListener("storage",this.boundEventHandler)},t.prototype.detachListener=function(){window.removeEventListener("storage",this.boundEventHandler)},t.prototype._addListener=function(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)},t.prototype._removeListener=function(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())},t.prototype._set=function(t,n){return c(this,void 0,void 0,(function(){return d(this,(function(r){switch(r.label){case 0:return[4,e.prototype._set.call(this,t,n)];case 1:return r.sent(),this.localCache[t]=JSON.stringify(n),[2]}}))}))},t.prototype._get=function(t){return c(this,void 0,void 0,(function(){var n;return d(this,(function(r){switch(r.label){case 0:return[4,e.prototype._get.call(this,t)];case 1:return n=r.sent(),this.localCache[t]=JSON.stringify(n),[2,n]}}))}))},t.prototype._remove=function(t){return c(this,void 0,void 0,(function(){return d(this,(function(n){switch(n.label){case 0:return[4,e.prototype._remove.call(this,t)];case 1:return n.sent(),delete this.localCache[t],[2]}}))}))},t.type="LOCAL",t}(cr),lr=dr,hr=function(e){function t(){return e.call(this,(function(){return window.sessionStorage}),"SESSION")||this}return s(t,e),t.prototype._addListener=function(e,t){},t.prototype._removeListener=function(e,t){},t.type="SESSION",t}(cr);function fr(e,t){return t?We(t):(se(e._popupRedirectResolver,e,"argument-error"),e._popupRedirectResolver)}var pr=function(e){function t(t){var n=e.call(this,"custom","custom")||this;return n.params=t,n}return s(t,e),t.prototype._getIdTokenResponse=function(e){return Ot(e,this._buildIdpRequest())},t.prototype._linkToIdToken=function(e,t){return Ot(e,this._buildIdpRequest(t))},t.prototype._getReauthenticationResolver=function(e){return Ot(e,this._buildIdpRequest())},t.prototype._buildIdpRequest=function(e){var 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},t}(gt);function vr(e){return on(e.auth,new pr(e),e.bypassAuthState)}function mr(e){var t=e.auth,n=e.user;return se(n,t,"internal-error"),rn(n,new pr(e),e.bypassAuthState)}function gr(e){return c(this,void 0,void 0,(function(){var t,n;return d(this,(function(r){return t=e.auth,se(n=e.user,t,"internal-error"),[2,tn(n,new pr(e),e.bypassAuthState)]}))}))}var _r=function(){function e(e,t,n,r,i){void 0===i&&(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]}return e.prototype.execute=function(){var e=this;return new Promise((function(t,n){return c(e,void 0,void 0,(function(){var e,r;return d(this,(function(i){switch(i.label){case 0:this.pendingPromise={resolve:t,reject:n},i.label=1;case 1:return i.trys.push([1,4,,5]),e=this,[4,this.resolver._initialize(this.auth)];case 2:return e.eventManager=i.sent(),[4,this.onExecution()];case 3:return i.sent(),this.eventManager.registerConsumer(this),[3,5];case 4:return r=i.sent(),this.reject(r),[3,5];case 5:return[2]}}))}))}))},e.prototype.onAuthEvent=function(e){return c(this,void 0,void 0,(function(){var t,n,r,i,o,s,a,u,c;return d(this,(function(d){switch(d.label){case 0:if(t=e.urlResponse,n=e.sessionId,r=e.postBody,i=e.tenantId,o=e.error,s=e.type,o)return this.reject(o),[2];a={auth:this.auth,requestUri:t,sessionId:n,tenantId:i||void 0,postBody:r||void 0,user:this.user,bypassAuthState:this.bypassAuthState},d.label=1;case 1:return d.trys.push([1,3,,4]),u=this.resolve,[4,this.getIdpTask(s)(a)];case 2:return u.apply(this,[d.sent()]),[3,4];case 3:return c=d.sent(),this.reject(c),[3,4];case 4:return[2]}}))}))},e.prototype.onError=function(e){this.reject(e)},e.prototype.getIdpTask=function(e){switch(e){case"signInViaPopup":case"signInViaRedirect":return vr;case"linkViaPopup":case"linkViaRedirect":return gr;case"reauthViaPopup":case"reauthViaRedirect":return mr;default:te(this.auth,"internal-error")}},e.prototype.resolve=function(e){ue(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.resolve(e),this.unregisterAndCleanUp()},e.prototype.reject=function(e){ue(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.reject(e),this.unregisterAndCleanUp()},e.prototype.unregisterAndCleanUp=function(){this.eventManager&&this.eventManager.unregisterConsumer(this),this.pendingPromise=null,this.cleanUp()},e}(),Ir=new Map,yr=function(e){function t(t,n,r){void 0===r&&(r=!1);var i=e.call(this,t,["signInViaRedirect","linkViaRedirect","reauthViaRedirect","unknown"],n,void 0,r)||this;return i.eventId=null,i}return s(t,e),t.prototype.execute=function(){return c(this,void 0,void 0,(function(){var t,n,r,i;return d(this,(function(o){switch(o.label){case 0:if(t=Ir.get(this.auth._key()))return[3,8];o.label=1;case 1:return o.trys.push([1,6,,7]),[4,Tr(this.resolver,this.auth)];case 2:return o.sent()?[4,e.prototype.execute.call(this)]:[3,4];case 3:return r=o.sent(),[3,5];case 4:r=null,o.label=5;case 5:return n=r,t=function(){return Promise.resolve(n)},[3,7];case 6:return i=o.sent(),t=function(){return Promise.reject(i)},[3,7];case 7:Ir.set(this.auth._key(),t),o.label=8;case 8:return this.bypassAuthState||Ir.set(this.auth._key(),(function(){return Promise.resolve(null)})),[2,t()]}}))}))},t.prototype.onAuthEvent=function(t){return c(this,void 0,void 0,(function(){var n;return d(this,(function(r){switch(r.label){case 0:return"signInViaRedirect"===t.type?[2,e.prototype.onAuthEvent.call(this,t)]:"unknown"===t.type?(this.resolve(null),[2]):t.eventId?[4,this.auth._redirectUserForId(t.eventId)]:[3,2];case 1:if(n=r.sent())return this.user=n,[2,e.prototype.onAuthEvent.call(this,t)];this.resolve(null),r.label=2;case 2:return[2]}}))}))},t.prototype.onExecution=function(){return c(this,void 0,void 0,(function(){return d(this,(function(e){return[2]}))}))},t.prototype.cleanUp=function(){},t}(_r);function Tr(e,t){return c(this,void 0,void 0,(function(){var n,r,i;return d(this,(function(o){switch(o.label){case 0:return n=wr(t),[4,(r=Ar(e))._isAvailable()];case 1:return o.sent()?[4,r._get(n)]:[2,!1];case 2:return i="true"===o.sent(),[4,r._remove(n)];case 3:return o.sent(),[2,i]}}))}))}function br(e,t){return c(this,void 0,void 0,(function(){return d(this,(function(n){return[2,Ar(e)._set(wr(t),"true")]}))}))}function Er(e,t){Ir.set(e._key(),t)}function Ar(e){return We(e._redirectPersistence)}function wr(e){return ze("pendingRedirect",e.config.apiKey,e.name)}function kr(e,t){return c(this,void 0,void 0,(function(){return d(this,(function(n){switch(n.label){case 0:return[4,lt(e)._initializationPromise];case 1:return n.sent(),[2,Rr(e,t,!1)]}}))}))}function Rr(e,t,n){return void 0===n&&(n=!1),c(this,void 0,void 0,(function(){var r,i,o;return d(this,(function(s){switch(s.label){case 0:return r=lt(e),i=fr(r,t),[4,new yr(r,i,n).execute()];case 1:return!(o=s.sent())||n?[3,4]:(delete o.user._redirectEventId,[4,r._persistUserIfCurrent(o.user)]);case 2:return s.sent(),[4,r._setRedirectUser(null,t)];case 3:s.sent(),s.label=4;case 4:return[2,o]}}))}))}function Nr(e){return c(this,void 0,void 0,(function(){var t;return d(this,(function(n){switch(n.label){case 0:return t=L("".concat(e.uid,":::")),e._redirectEventId=t,[4,e.auth._setRedirectUser(e)];case 1:return n.sent(),[4,e.auth._persistUserIfCurrent(e)];case 2:return n.sent(),[2,t]}}))}))}var Sr=encodeURIComponent("fac");function Or(t,n,r,i,o,s){return c(this,void 0,void 0,(function(){var a,u,c,l,h,f,p,v,m,g,_,I;return d(this,(function(d){switch(d.label){case 0:if(se(t.config.authDomain,t,"auth-domain-config-required"),se(t.config.apiKey,t,"invalid-api-key"),a={apiKey:t.config.apiKey,appName:t.name,authType:r,redirectUrl:i,v:e,eventId:o},n instanceof Ft)for(n.setDefaultLanguage(t.languageCode),a.providerId=n.providerId||"",function(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}(n.getCustomParameters())||(a.customParameters=JSON.stringify(n.getCustomParameters())),u=0,c=Object.entries(s||{});u<c.length;u++)l=c[u],g=l[0],h=l[1],a[g]=h;for(n instanceof Ht&&(f=n.getScopes().filter((function(e){return""!==e}))).length>0&&(a.scopes=f.join(",")),t.tenantId&&(a.tid=t.tenantId),p=a,v=0,m=Object.keys(p);v<m.length;v++)g=m[v],void 0===p[g]&&delete p[g];return[4,t._getAppCheckToken()];case 1:return _=d.sent(),I=_?"#".concat(Sr,"=").concat(encodeURIComponent(_)):"",[2,"".concat(Cr(t),"?").concat(y(p).slice(1)).concat(I)]}}))}))}function Cr(e){var t=e.config;return t.emulator?pe(t,"emulator/auth/handler"):"https://".concat(t.authDomain,"/").concat("__/auth/handler")}function Pr(){return window}function Dr(e,t){return void 0===t&&(t={}),c(this,void 0,void 0,(function(){return d(this,(function(n){return[2,ye(e,"GET","/v1/projects",t)]}))}))}function Lr(e,t,n){var r;return c(this,void 0,void 0,(function(){var i,o,s;return d(this,(function(a){switch(a.label){case 0:return i=Pr().BuildInfo,ue(t.sessionId,"AuthEvent did not contain a session ID"),[4,Vr(t.sessionId)];case 1:return o=a.sent(),s={},et()?s.ibi=i.packageName:Qe()?s.apn=i.packageName:te(e,"operation-not-supported-in-this-environment"),i.displayName&&(s.appDisplayName=i.displayName),s.sessionId=o,[2,Or(e,n,t.type,void 0,null!==(r=t.eventId)&&void 0!==r?r:void 0,s)]}}))}))}function Ur(e){var t=Pr().cordova;return new Promise((function(n){t.plugins.browsertab.isAvailable((function(r){var i,o=null;r?t.plugins.browsertab.openUrl(e):o=t.InAppBrowser.open(e,(void 0===i&&(i=p()),/(iPad|iPhone|iPod).*OS 7_\d/i.test(i)||/(iPad|iPhone|iPod).*OS 8_\d/i.test(i)?"_blank":"_system"),"location=yes"),n(o)}))}))}function Mr(e,t,n){return c(this,void 0,void 0,(function(){var r,i;return d(this,(function(o){switch(o.label){case 0:r=Pr().cordova,i=function(){},o.label=1;case 1:return o.trys.push([1,,3,4]),[4,new Promise((function(o,s){var a=null;function u(){var e;o();var t=null===(e=r.plugins.browsertab)||void 0===e?void 0:e.close;"function"==typeof t&&t(),"function"==typeof(null==n?void 0:n.close)&&n.close()}function c(){a||(a=window.setTimeout((function(){s(ne(e,"redirect-cancelled-by-user"))}),2e3))}function d(){"visible"===(null===document||void 0===document?void 0:document.visibilityState)&&c()}t.addPassiveListener(u),document.addEventListener("resume",c,!1),Qe()&&document.addEventListener("visibilitychange",d,!1),i=function(){t.removePassiveListener(u),document.removeEventListener("resume",c,!1),document.removeEventListener("visibilitychange",d,!1),a&&window.clearTimeout(a)}}))];case 2:return o.sent(),[3,4];case 3:return i(),[7];case 4:return[2]}}))}))}function Vr(e){return c(this,void 0,void 0,(function(){var t,n;return d(this,(function(r){switch(r.label){case 0:return t=function(e){if(ue(/[0-9a-zA-Z]+/.test(e),"Can only convert alpha-numeric strings"),"undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var t=new ArrayBuffer(e.length),n=new Uint8Array(t),r=0;r<e.length;r++)n[r]=e.charCodeAt(r);return n}(e),[4,crypto.subtle.digest("SHA-256",t)];case 1:return n=r.sent(),[2,Array.from(new Uint8Array(n)).map((function(e){return e.toString(16).padStart(2,"0")})).join("")]}}))}))}var Fr=function(){function e(e){this.auth=e,this.cachedEventUids=new Set,this.consumers=new Set,this.queuedRedirectEvent=null,this.hasHandledPotentialRedirect=!1,this.lastProcessedEventTime=Date.now()}return e.prototype.registerConsumer=function(e){this.consumers.add(e),this.queuedRedirectEvent&&this.isEventForConsumer(this.queuedRedirectEvent,e)&&(this.sendToConsumer(this.queuedRedirectEvent,e),this.saveEventToCache(this.queuedRedirectEvent),this.queuedRedirectEvent=null)},e.prototype.unregisterConsumer=function(e){this.consumers.delete(e)},e.prototype.onEvent=function(e){var t=this;if(this.hasEventBeenHandled(e))return!1;var n=!1;return this.consumers.forEach((function(r){t.isEventForConsumer(e,r)&&(n=!0,t.sendToConsumer(e,r),t.saveEventToCache(e))})),this.hasHandledPotentialRedirect||!function(e){switch(e.type){case"signInViaRedirect":case"linkViaRedirect":case"reauthViaRedirect":return!0;case"unknown":return xr(e);default:return!1}}(e)||(this.hasHandledPotentialRedirect=!0,n||(this.queuedRedirectEvent=e,n=!0)),n},e.prototype.sendToConsumer=function(e,t){var n;if(e.error&&!xr(e)){var r=(null===(n=e.error.code)||void 0===n?void 0:n.split("auth/")[1])||"internal-error";t.onError(ne(this.auth,r))}else t.onAuthEvent(e)},e.prototype.isEventForConsumer=function(e,t){var n=null===t.eventId||!!e.eventId&&e.eventId===t.eventId;return t.filter.includes(e.type)&&n},e.prototype.hasEventBeenHandled=function(e){return Date.now()-this.lastProcessedEventTime>=6e5&&this.cachedEventUids.clear(),this.cachedEventUids.has(Hr(e))},e.prototype.saveEventToCache=function(e){this.cachedEventUids.add(Hr(e)),this.lastProcessedEventTime=Date.now()},e}();function Hr(e){return[e.type,e.eventId,e.sessionId,e.tenantId].filter((function(e){return e})).join("-")}function xr(e){var t=e.type,n=e.error;return"unknown"===t&&(null==n?void 0:n.code)==="auth/".concat("no-auth-event")}var jr=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.passiveListeners=new Set,t.initPromise=new Promise((function(e){t.resolveInialized=e})),t}return s(t,e),t.prototype.addPassiveListener=function(e){this.passiveListeners.add(e)},t.prototype.removePassiveListener=function(e){this.passiveListeners.delete(e)},t.prototype.resetRedirect=function(){this.queuedRedirectEvent=null,this.hasHandledPotentialRedirect=!1},t.prototype.onEvent=function(t){return this.resolveInialized(),this.passiveListeners.forEach((function(e){return e(t)})),e.prototype.onEvent.call(this,t)},t.prototype.initialized=function(){return c(this,void 0,void 0,(function(){return d(this,(function(e){switch(e.label){case 0:return[4,this.initPromise];case 1:return e.sent(),[2]}}))}))},t}(Fr);function qr(e,t){return zr()._set(Kr(e),t)}function Br(e){return c(this,void 0,void 0,(function(){var t;return d(this,(function(n){switch(n.label){case 0:return[4,zr()._get(Kr(e))];case 1:return(t=n.sent())?[4,zr()._remove(Kr(e))]:[3,3];case 2:n.sent(),n.label=3;case 3:return[2,t]}}))}))}function Wr(e,t){var n,r,i=function(e){var t=Jr(e),n=t.link?decodeURIComponent(t.link):void 0,r=Jr(n).link,i=t.deep_link_id?decodeURIComponent(t.deep_link_id):void 0;return Jr(i).link||i||r||n||e}(t);if(i.includes("/__/auth/callback")){var o=Jr(i),s=o.firebaseError?function(e){try{return JSON.parse(e)}catch(e){return null}}(decodeURIComponent(o.firebaseError)):null,a=null===(r=null===(n=null==s?void 0:s.code)||void 0===n?void 0:n.split("auth/"))||void 0===r?void 0:r[1],u=a?ne(a):null;return u?{type:e.type,eventId:e.eventId,tenantId:e.tenantId,error:u,urlResponse:null,sessionId:null,postBody:null}:{type:e.type,eventId:e.eventId,tenantId:e.tenantId,sessionId:e.sessionId,urlResponse:i,postBody:null}}return null}function Gr(){for(var e=[],t="1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",n=0;n<20;n++){var r=Math.floor(Math.random()*t.length);e.push(t.charAt(r))}return e.join("")}function zr(){return We(lr)}function Kr(e){return ze("authEvent",e.config.apiKey,e.name)}function Jr(e){if(!(null==e?void 0:e.includes("?")))return{};var t=e.split("?");return t[0],T(t.slice(1).join("?"))}var Yr,Xr=function(){function e(){this._redirectPersistence=hr,this._shouldInitProactively=!0,this.eventManagers=new Map,this.originValidationPromises={},this._completeRedirectFn=Rr,this._overrideRedirectResult=Er}return e.prototype._initialize=function(e){return c(this,void 0,void 0,(function(){var t,n;return d(this,(function(r){return t=e._key(),(n=this.eventManagers.get(t))||(n=new jr(e),this.eventManagers.set(t,n),this.attachCallbackListeners(e,n)),[2,n]}))}))},e.prototype._openPopup=function(e){te(e,"operation-not-supported-in-this-environment")},e.prototype._openRedirect=function(e,t,n,r){return c(this,void 0,void 0,(function(){var i,o,s;return d(this,(function(a){switch(a.label){case 0:return function(e){var t,n,r,i,o,s,a,u,c,d,l=Pr();se("function"==typeof(null===(t=null==l?void 0:l.universalLinks)||void 0===t?void 0:t.subscribe),e,"invalid-cordova-configuration",{missingPlugin:"cordova-universal-links-plugin-fix"}),se(void 0!==(null===(n=null==l?void 0:l.BuildInfo)||void 0===n?void 0:n.packageName),e,"invalid-cordova-configuration",{missingPlugin:"cordova-plugin-buildInfo"}),se("function"==typeof(null===(o=null===(i=null===(r=null==l?void 0:l.cordova)||void 0===r?void 0:r.plugins)||void 0===i?void 0:i.browsertab)||void 0===o?void 0:o.openUrl),e,"invalid-cordova-configuration",{missingPlugin:"cordova-plugin-browsertab"}),se("function"==typeof(null===(u=null===(a=null===(s=null==l?void 0:l.cordova)||void 0===s?void 0:s.plugins)||void 0===a?void 0:a.browsertab)||void 0===u?void 0:u.isAvailable),e,"invalid-cordova-configuration",{missingPlugin:"cordova-plugin-browsertab"}),se("function"==typeof(null===(d=null===(c=null==l?void 0:l.cordova)||void 0===c?void 0:c.InAppBrowser)||void 0===d?void 0:d.open),e,"invalid-cordova-configuration",{missingPlugin:"cordova-plugin-inappbrowser"})}(e),[4,this._initialize(e)];case 1:return[4,(i=a.sent()).initialized()];case 2:return a.sent(),i.resetRedirect(),Ir.clear(),[4,this._originValidation(e)];case 3:return a.sent(),o=function(e,t,n){return void 0===n&&(n=null),{type:t,eventId:n,urlResponse:null,sessionId:Gr(),postBody:null,tenantId:e.tenantId,error:ne(e,"no-auth-event")}}(e,n,r),[4,qr(e,o)];case 4:return a.sent(),[4,Lr(e,o,t)];case 5:return[4,Ur(a.sent())];case 6:return s=a.sent(),[2,Mr(e,i,s)]}}))}))},e.prototype._isIframeWebStorageSupported=function(e,t){throw new Error("Method not implemented.")},e.prototype._originValidation=function(e){var t=e._key();return this.originValidationPromises[t]||(this.originValidationPromises[t]=function(e){return c(this,void 0,void 0,(function(){var t,n;return d(this,(function(r){switch(r.label){case 0:return t=Pr().BuildInfo,n={},et()?n.iosBundleId=t.packageName:Qe()?n.androidPackageName=t.packageName:te(e,"operation-not-supported-in-this-environment"),[4,Dr(e,n)];case 1:return r.sent(),[2]}}))}))}(e)),this.originValidationPromises[t]},e.prototype.attachCallbackListeners=function(e,t){var n=this,r=Pr(),i=r.universalLinks,o=r.handleOpenURL,s=r.BuildInfo,a=setTimeout((function(){return c(n,void 0,void 0,(function(){return d(this,(function(n){switch(n.label){case 0:return[4,Br(e)];case 1:return n.sent(),t.onEvent($r()),[2]}}))}))}),500),u=function(r){return c(n,void 0,void 0,(function(){var n,i;return d(this,(function(o){switch(o.label){case 0:return clearTimeout(a),[4,Br(e)];case 1:return n=o.sent(),i=null,n&&(null==r?void 0:r.url)&&(i=Wr(n,r.url)),t.onEvent(i||$r()),[2]}}))}))};void 0!==i&&"function"==typeof i.subscribe&&i.subscribe(null,u);var l=o,h="".concat(s.packageName.toLowerCase(),"://");Pr().handleOpenURL=function(e){return c(n,void 0,void 0,(function(){return d(this,(function(t){if(e.toLowerCase().startsWith(h)&&u({url:e}),"function"==typeof l)try{l(e)}catch(e){console.error(e)}return[2]}))}))}},e}(),Qr=Xr;function $r(){return{type:"unknown",eventId:null,sessionId:null,urlResponse:null,postBody:null,tenantId:null,error:ne("no-auth-event")}}function Zr(e,t,n){return function(e,t,n){return c(this,void 0,void 0,(function(){var r,i;return d(this,(function(o){switch(o.label){case 0:return r=lt(e),ie(e,t,Ft),[4,r._initializationPromise];case 1:return o.sent(),[4,br(i=fr(r,n),r)];case 2:return o.sent(),[2,i._openRedirect(r,t,"signInViaRedirect")]}}))}))}(e,t,n)}function ei(e,t,n){return function(e,t,n){return c(this,void 0,void 0,(function(){var r,i,o;return d(this,(function(s){switch(s.label){case 0:return ie((r=w(e)).auth,t,Ft),[4,r.auth._initializationPromise];case 1:return s.sent(),[4,br(i=fr(r.auth,n),r.auth)];case 2:return s.sent(),[4,Nr(r)];case 3:return o=s.sent(),[2,i._openRedirect(r.auth,t,"reauthViaRedirect",o)]}}))}))}(e,t,n)}function ti(e,t,n){return function(e,t,n){return c(this,void 0,void 0,(function(){var r,i,o;return d(this,(function(s){switch(s.label){case 0:return ie((r=w(e)).auth,t,Ft),[4,r.auth._initializationPromise];case 1:return s.sent(),i=fr(r.auth,n),[4,nn(!1,r,t.providerId)];case 2:return s.sent(),[4,br(i,r.auth)];case 3:return s.sent(),[4,Nr(r)];case 4:return o=s.sent(),[2,i._openRedirect(r.auth,t,"linkViaRedirect",o)]}}))}))}(e,t,n)}function ni(e){void 0===e&&(e=i());var n=t(e,"auth");return n.isInitialized()?n.getImmediate():ft(e,{persistence:K,popupRedirectResolver:Qr})}Yr="Cordova",n(new k("auth",(function(e,t){var n=t.options,r=e.getProvider("app").getImmediate(),i=e.getProvider("heartbeat"),o=e.getProvider("app-check-internal"),s=r.options,a=s.apiKey,u=s.authDomain;se(a&&!a.includes(":"),"invalid-api-key",{appName:r.name});var c={apiKey:a,authDomain:u,clientPlatform:Yr,apiHost:"identitytoolkit.googleapis.com",tokenApiHost:"securetoken.googleapis.com",apiScheme:"https",sdkClientVersion:nt(Yr)},d=new dt(r,i,o,c);return function(e,t){var n=(null==t?void 0:t.persistence)||[],r=(Array.isArray(n)?n:[n]).map(We);(null==t?void 0:t.errorMap)&&e._updateErrorMap(t.errorMap),e._initializeWithPersistence(r,null==t?void 0:t.popupRedirectResolver)}(d,n),d}),"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((function(e,t,n){e.getProvider("auth-internal").initialize()}))),n(new k("auth-internal",(function(e){return function(e){return new rr(e)}(lt(e.getProvider("auth").getImmediate()))}),"PRIVATE").setInstantiationMode("EXPLICIT")),r(nr,"0.23.2",function(e){switch(e){case"Node":return"node";case"ReactNative":return"rn";case"Worker":return"webworker";case"Cordova":return"cordova";default:return}}(Yr)),r(nr,"0.23.2","esm5");export{ur as ActionCodeOperation,Ut as ActionCodeURL,gt as AuthCredential,$ as AuthErrorCodes,St as EmailAuthCredential,Vt as EmailAuthProvider,jt as FacebookAuthProvider,ir as FactorId,Bt as GithubAuthProvider,qt as GoogleAuthProvider,Pt as OAuthCredential,xt as OAuthProvider,ar as OperationType,Lt as PhoneAuthCredential,or as ProviderId,Gt as SAMLAuthProvider,sr as SignInMethod,zt as TwitterAuthProvider,gn as applyActionCode,Wn as beforeAuthStateChanged,lr as browserLocalPersistence,hr as browserSessionPersistence,_n as checkActionCode,mn as confirmPasswordReset,pt as connectAuthEmulator,Qr as cordovaPopupRedirectResolver,yn as createUserWithEmailAndPassword,Y as debugErrorMap,Yn as deleteUser,kn as fetchSignInMethodsForEmail,xn as getAdditionalUserInfo,ni as getAuth,Oe as getIdToken,Ce as getIdTokenResult,$n as getMultiFactorResolver,kr as getRedirectResult,Ge as inMemoryPersistence,K as indexedDBLocalPersistence,ft as initializeAuth,qn as initializeRecaptchaConfig,En as isSignInWithEmailLink,an as linkWithCredential,ti as linkWithRedirect,tr as multiFactor,Gn as onAuthStateChanged,Bn as onIdTokenChanged,Mt as parseActionCodeURL,X as prodErrorMap,un as reauthenticateWithCredential,ei as reauthenticateWithRedirect,Fe as reload,Rn as sendEmailVerification,vn as sendPasswordResetEmail,bn as sendSignInLinkToEmail,jn as setPersistence,Xt as signInAnonymously,sn as signInWithCredential,dn as signInWithCustomToken,Tn as signInWithEmailAndPassword,An as signInWithEmailLink,Zr as signInWithRedirect,Jn as signOut,en as unlink,Kn as updateCurrentUser,Cn as updateEmail,Pn as updatePassword,On as updateProfile,zn as useDeviceLanguage,Nn as verifyBeforeUpdateEmail,In as verifyPasswordResetCode};
  2. //# sourceMappingURL=firebase-auth-cordova.js.map