/*! For license information please see 2.597d7ff1.chunk.js.LICENSE.txt */ (this.webpackJsonpfrontend=this.webpackJsonpfrontend||[]).push([[2],[function(e,t,n){e.exports=n(46)},function(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";function r(e,t,n,r,a,i,o){try{var u=e[i](o),s=u.value}catch(c){return void n(c)}u.done?t(s):Promise.resolve(s).then(r,a)}function a(e){return function(){var t=this,n=arguments;return new Promise((function(a,i){var o=e.apply(t,n);function u(e){r(o,a,i,u,s,"next",e)}function s(e){r(o,a,i,u,s,"throw",e)}u(void 0)}))}}n.d(t,"a",(function(){return a}))},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return h})),n.d(t,"b",(function(){return w})),n.d(t,"c",(function(){return k})),n.d(t,"d",(function(){return p})),n.d(t,"e",(function(){return C})),n.d(t,"f",(function(){return x})),n.d(t,"g",(function(){return T})),n.d(t,"h",(function(){return N})),n.d(t,"i",(function(){return v})),n.d(t,"j",(function(){return y})),n.d(t,"k",(function(){return E})),n.d(t,"l",(function(){return g})),n.d(t,"m",(function(){return m})),n.d(t,"n",(function(){return b})),n.d(t,"o",(function(){return j})),n.d(t,"p",(function(){return I}));var r=n(18),a=n(20),i=n(21),o=n(7),u=n(8),s=n(39),c=n(4),l=n(5),f=function(e){for(var t=[],n=0,r=0;r>6|192,t[n++]=63&a|128):55296===(64512&a)&&r+1>18|240,t[n++]=a>>12&63|128,t[n++]=a>>6&63|128,t[n++]=63&a|128):(t[n++]=a>>12|224,t[n++]=a>>6&63|128,t[n++]=63&a|128)}return t},d={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:"function"===typeof atob,encodeByteArray:function(e,t){if(!Array.isArray(e))throw Error("encodeByteArray takes an array as a parameter");this.init_();for(var n=t?this.byteToCharMapWebSafe_:this.byteToCharMap_,r=[],a=0;a>2,f=(3&i)<<4|u>>4,d=(15&u)<<2|c>>6,p=63&c;s||(p=64,o||(d=64)),r.push(n[l],n[f],n[d],n[p])}return r.join("")},encodeString:function(e,t){return this.HAS_NATIVE_SUPPORT&&!t?btoa(e):this.encodeByteArray(f(e),t)},decodeString:function(e,t){return this.HAS_NATIVE_SUPPORT&&!t?atob(e):function(e){for(var t=[],n=0,r=0;n191&&a<224){var i=e[n++];t[r++]=String.fromCharCode((31&a)<<6|63&i)}else if(a>239&&a<365){var o=((7&a)<<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{var u=e[n++],s=e[n++];t[r++]=String.fromCharCode((15&a)<<12|(63&u)<<6|63&s)}}return t.join("")}(this.decodeStringToByteArray(e,t))},decodeStringToByteArray:function(e,t){this.init_();for(var n=t?this.charToByteMapWebSafe_:this.charToByteMap_,r=[],a=0;a>4;if(r.push(c),64!==u){var l=o<<4&240|u>>2;if(r.push(l),64!==s){var f=u<<6&192|s;r.push(f)}}}return r},init_:function(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(var e=0;e=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(e)]=e,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(e)]=e)}}},p=function(e){try{return d.decodeString(e,!0)}catch(t){console.error("base64Decode failed: ",t)}return null};var h=function(){function e(){var t=this;Object(c.a)(this,e),this.reject=function(){},this.resolve=function(){},this.promise=new Promise((function(e,n){t.resolve=e,t.reject=n}))}return Object(l.a)(e,[{key:"wrapCallback",value:function(e){var t=this;return function(n,r){n?t.reject(n):t.resolve(r),"function"===typeof e&&(t.promise.catch((function(){})),1===e.length?e(n):e(n,r))}}}]),e}();function v(){return"undefined"!==typeof navigator&&"string"===typeof navigator.userAgent?navigator.userAgent:""}function m(){return"undefined"!==typeof window&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(v())}function y(){var e="object"===typeof chrome?chrome.runtime:"object"===typeof browser?browser.runtime:void 0;return"object"===typeof e&&void 0!==e.id}function b(){return"object"===typeof navigator&&"ReactNative"===navigator.product}function g(){var e=v();return e.indexOf("MSIE ")>=0||e.indexOf("Trident/")>=0}var k=function(e){Object(o.a)(n,e);var t=Object(u.a)(n);function n(e,r,a){var o;return Object(c.a)(this,n),(o=t.call(this,r)).code=e,o.customData=a,o.name="FirebaseError",Object.setPrototypeOf(Object(i.a)(o),n.prototype),Error.captureStackTrace&&Error.captureStackTrace(Object(i.a)(o),w.prototype.create),o}return n}(Object(s.a)(Error)),w=function(){function e(t,n,r){Object(c.a)(this,e),this.service=t,this.serviceName=n,this.errors=r}return Object(l.a)(e,[{key:"create",value:function(e){var t=(arguments.length<=1?void 0:arguments[1])||{},n="".concat(this.service,"/").concat(e),r=this.errors[e],a=r?O(r,t):"Error",i="".concat(this.serviceName,": ").concat(a," (").concat(n,")."),o=new k(n,i,t);return o}}]),e}();function O(e,t){return e.replace(_,(function(e,n){var r=t[n];return null!=r?String(r):"<".concat(n,"?>")}))}var _=/\{\$([^}]+)}/g;function E(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}function x(e,t){if(e===t)return!0;for(var n=Object.keys(e),r=Object.keys(t),a=0,i=n;a0?n:void 0)}function C(e,t){var n=new P(e,t);return n.subscribe.bind(n)}var P=function(){function e(t,n){var r=this;Object(c.a)(this,e),this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=n,this.task.then((function(){t(r)})).catch((function(e){r.error(e)}))}return Object(l.a)(e,[{key:"next",value:function(e){this.forEachObserver((function(t){t.next(e)}))}},{key:"error",value:function(e){this.forEachObserver((function(t){t.error(e)})),this.close(e)}},{key:"complete",value:function(){this.forEachObserver((function(e){e.complete()})),this.close()}},{key:"subscribe",value:function(e,t,n){var a,i=this;if(void 0===e&&void 0===t&&void 0===n)throw new Error("Missing Observer.");void 0===(a=function(e,t){if("object"!==typeof e||null===e)return!1;var n,a=Object(r.a)(t);try{for(a.s();!(n=a.n()).done;){var i=n.value;if(i in e&&"function"===typeof e[i])return!0}}catch(o){a.e(o)}finally{a.f()}return!1}(e,["next","error","complete"])?e:{next:e,error:t,complete:n}).next&&(a.next=R),void 0===a.error&&(a.error=R),void 0===a.complete&&(a.complete=R);var o=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then((function(){try{i.finalError?a.error(i.finalError):a.complete()}catch(e){}})),this.observers.push(a),o}},{key:"unsubscribeOne",value:function(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))}},{key:"forEachObserver",value:function(e){if(!this.finalized)for(var t=0;t0&&a[a.length-1])&&(6===i[0]||2===i[0])){o=0;continue}if(3===i[0]&&(!a||i[1]>a[0]&&i[1]=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function u(e,t){var n="function"===typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,a,i=n.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)o.push(r.value)}catch(u){a={error:u}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(a)throw a.error}}return o}function s(e,t,n){if(n||2===arguments.length)for(var r,a=0,i=t.length;a1&&void 0!==arguments[1]?arguments[1]:{};if("object"!==typeof t){var n=t;t={name:n}}var r=Object.assign({name:m,automaticDataCollectionEnabled:!1},t),a=r.name;if("string"!==typeof a||!a)throw x.create("bad-app-name",{appName:String(a)});var o=b.get(a);if(o){if(Object(f.f)(e,o.options)&&Object(f.f)(r,o.config))return o;throw x.create("duplicate-app",{appName:a})}var u,s=new c.b(a),l=Object(i.a)(g.values());try{for(l.s();!(u=l.n()).done;){var d=u.value;s.addComponent(d)}}catch(h){l.e(h)}finally{l.f()}var p=new S(e,r,s);return b.set(a,p),p}function T(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:m,t=b.get(e);if(!t)throw x.create("no-app",{appName:e});return t}function C(e,t,n){var r,a=null!==(r=y[e])&&void 0!==r?r:e;n&&(a+="-".concat(n));var i=a.match(/\s|\//),o=t.match(/\s|\//);if(i||o){var u=['Unable to register library "'.concat(a,'" with version "').concat(t,'":')];return i&&u.push('library name "'.concat(a,'" contains illegal characters (whitespace or "/")')),i&&o&&u.push("and"),o&&u.push('version name "'.concat(t,'" contains illegal characters (whitespace or "/")')),void v.warn(u.join(" "))}w(new c.a("".concat(a,"-version"),(function(){return{library:a,version:t}}),"VERSION"))}_="",w(new c.a("platform-logger",(function(e){return new d(e)}),"PRIVATE")),C(p,h,_),C(p,h,"esm2017"),C("fire-js","")},function(e,t,n){"use strict";function r(e){return r=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},r(e)}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return _})),n.d(t,"b",(function(){return T})),n.d(t,"d",(function(){return P})),n.d(t,"c",(function(){return v})),n.d(t,"f",(function(){return m})),n.d(t,"e",(function(){return h}));var r=n(11);function a(e){return"/"===e.charAt(0)}function i(e,t){for(var n=t,r=n+1,a=e.length;r=0;d--){var p=o[d];"."===p?i(o,d):".."===p?(i(o,d),f++):f&&(i(o,d),f--)}if(!c)for(;f--;f)o.unshift("..");!c||""===o[0]||o[0]&&a(o[0])||o.unshift("");var h=o.join("/");return n&&"/"!==h.substr(-1)&&(h+="/"),h};function u(e){return e.valueOf?e.valueOf():Object.prototype.valueOf.call(e)}var s=function e(t,n){if(t===n)return!0;if(null==t||null==n)return!1;if(Array.isArray(t))return Array.isArray(n)&&t.length===n.length&&t.every((function(t,r){return e(t,n[r])}));if("object"===typeof t||"object"===typeof n){var r=u(t),a=u(n);return r!==t||a!==n?e(r,a):Object.keys(Object.assign({},t,n)).every((function(r){return e(t[r],n[r])}))}return!1},c=n(16);function l(e){return"/"===e.charAt(0)?e:"/"+e}function f(e){return"/"===e.charAt(0)?e.substr(1):e}function d(e,t){return function(e,t){return 0===e.toLowerCase().indexOf(t.toLowerCase())&&-1!=="/?#".indexOf(e.charAt(t.length))}(e,t)?e.substr(t.length):e}function p(e){return"/"===e.charAt(e.length-1)?e.slice(0,-1):e}function h(e){var t=e.pathname,n=e.search,r=e.hash,a=t||"/";return n&&"?"!==n&&(a+="?"===n.charAt(0)?n:"?"+n),r&&"#"!==r&&(a+="#"===r.charAt(0)?r:"#"+r),a}function v(e,t,n,a){var i;"string"===typeof e?(i=function(e){var t=e||"/",n="",r="",a=t.indexOf("#");-1!==a&&(r=t.substr(a),t=t.substr(0,a));var i=t.indexOf("?");return-1!==i&&(n=t.substr(i),t=t.substr(0,i)),{pathname:t,search:"?"===n?"":n,hash:"#"===r?"":r}}(e),i.state=t):(void 0===(i=Object(r.a)({},e)).pathname&&(i.pathname=""),i.search?"?"!==i.search.charAt(0)&&(i.search="?"+i.search):i.search="",i.hash?"#"!==i.hash.charAt(0)&&(i.hash="#"+i.hash):i.hash="",void 0!==t&&void 0===i.state&&(i.state=t));try{i.pathname=decodeURI(i.pathname)}catch(u){throw u instanceof URIError?new URIError('Pathname "'+i.pathname+'" could not be decoded. This is likely caused by an invalid percent-encoding.'):u}return n&&(i.key=n),a?i.pathname?"/"!==i.pathname.charAt(0)&&(i.pathname=o(i.pathname,a.pathname)):i.pathname=a.pathname:i.pathname||(i.pathname="/"),i}function m(e,t){return e.pathname===t.pathname&&e.search===t.search&&e.hash===t.hash&&e.key===t.key&&s(e.state,t.state)}function y(){var e=null;var t=[];return{setPrompt:function(t){return e=t,function(){e===t&&(e=null)}},confirmTransitionTo:function(t,n,r,a){if(null!=e){var i="function"===typeof e?e(t,n):e;"string"===typeof i?"function"===typeof r?r(i,a):a(!0):a(!1!==i)}else a(!0)},appendListener:function(e){var n=!0;function r(){n&&e.apply(void 0,arguments)}return t.push(r),function(){n=!1,t=t.filter((function(e){return e!==r}))}},notifyListeners:function(){for(var e=arguments.length,n=new Array(e),r=0;rt?n.splice(t,n.length-t,a):n.push(a),f({action:r,location:a,index:t,entries:n})}}))},replace:function(e,t){var r="REPLACE",a=v(e,t,d(),k.location);l.confirmTransitionTo(a,r,n,(function(e){e&&(k.entries[k.index]=a,f({action:r,location:a}))}))},go:g,goBack:function(){g(-1)},goForward:function(){g(1)},canGo:function(e){var t=k.index+e;return t>=0&&t=e.length?{done:!0}:{done:!1,value:e[a++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,u=!0,s=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return u=e.done,e},e:function(e){s=!0,o=e},f:function(){try{u||null==n.return||n.return()}finally{if(s)throw o}}}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i})),n.d(t,"b",(function(){return s}));var r=n(12),a=n(3),i=function(){function e(e,t,n){this.name=e,this.instanceFactory=t,this.type=n,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}return e.prototype.setInstantiationMode=function(e){return this.instantiationMode=e,this},e.prototype.setMultipleInstances=function(e){return this.multipleInstances=e,this},e.prototype.setServiceProps=function(e){return this.serviceProps=e,this},e.prototype.setInstanceCreatedCallback=function(e){return this.onInstanceCreated=e,this},e}(),o="[DEFAULT]",u=function(){function e(e,t){this.name=e,this.container=t,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}return e.prototype.get=function(e){var t=this.normalizeInstanceIdentifier(e);if(!this.instancesDeferred.has(t)){var n=new a.a;if(this.instancesDeferred.set(t,n),this.isInitialized(t)||this.shouldAutoInitialize())try{var r=this.getOrInitializeService({instanceIdentifier:t});r&&n.resolve(r)}catch(i){}}return this.instancesDeferred.get(t).promise},e.prototype.getImmediate=function(e){var t,n=this.normalizeInstanceIdentifier(null===e||void 0===e?void 0:e.identifier),r=null!==(t=null===e||void 0===e?void 0:e.optional)&&void 0!==t&&t;if(!this.isInitialized(n)&&!this.shouldAutoInitialize()){if(r)return null;throw Error("Service "+this.name+" is not available")}try{return this.getOrInitializeService({instanceIdentifier:n})}catch(a){if(r)return null;throw a}},e.prototype.getComponent=function(){return this.component},e.prototype.setComponent=function(e){var t,n;if(e.name!==this.name)throw Error("Mismatching Component "+e.name+" for Provider "+this.name+".");if(this.component)throw Error("Component for "+this.name+" has already been provided");if(this.component=e,this.shouldAutoInitialize()){if(function(e){return"EAGER"===e.instantiationMode}(e))try{this.getOrInitializeService({instanceIdentifier:o})}catch(d){}try{for(var a=Object(r.f)(this.instancesDeferred.entries()),i=a.next();!i.done;i=a.next()){var u=Object(r.c)(i.value,2),s=u[0],c=u[1],l=this.normalizeInstanceIdentifier(s);try{var f=this.getOrInitializeService({instanceIdentifier:l});c.resolve(f)}catch(d){}}}catch(p){t={error:p}}finally{try{i&&!i.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}}},e.prototype.clearInstance=function(e){void 0===e&&(e=o),this.instancesDeferred.delete(e),this.instancesOptions.delete(e),this.instances.delete(e)},e.prototype.delete=function(){return Object(r.a)(this,void 0,void 0,(function(){var e;return Object(r.b)(this,(function(t){switch(t.label){case 0:return e=Array.from(this.instances.values()),[4,Promise.all(Object(r.e)(Object(r.e)([],Object(r.c)(e.filter((function(e){return"INTERNAL"in e})).map((function(e){return e.INTERNAL.delete()})))),Object(r.c)(e.filter((function(e){return"_delete"in e})).map((function(e){return e._delete()})))))];case 1:return t.sent(),[2]}}))}))},e.prototype.isComponentSet=function(){return null!=this.component},e.prototype.isInitialized=function(e){return void 0===e&&(e=o),this.instances.has(e)},e.prototype.getOptions=function(e){return void 0===e&&(e=o),this.instancesOptions.get(e)||{}},e.prototype.initialize=function(e){var t,n;void 0===e&&(e={});var a=e.options,i=void 0===a?{}:a,o=this.normalizeInstanceIdentifier(e.instanceIdentifier);if(this.isInitialized(o))throw Error(this.name+"("+o+") has already been initialized");if(!this.isComponentSet())throw Error("Component "+this.name+" has not been registered yet");var u=this.getOrInitializeService({instanceIdentifier:o,options:i});try{for(var s=Object(r.f)(this.instancesDeferred.entries()),c=s.next();!c.done;c=s.next()){var l=Object(r.c)(c.value,2),f=l[0],d=l[1];o===this.normalizeInstanceIdentifier(f)&&d.resolve(u)}}catch(p){t={error:p}}finally{try{c&&!c.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}return u},e.prototype.onInit=function(e,t){var n,r=this.normalizeInstanceIdentifier(t),a=null!==(n=this.onInitCallbacks.get(r))&&void 0!==n?n:new Set;a.add(e),this.onInitCallbacks.set(r,a);var i=this.instances.get(r);return i&&e(i,r),function(){a.delete(e)}},e.prototype.invokeOnInitCallbacks=function(e,t){var n,a,i=this.onInitCallbacks.get(t);if(i)try{for(var o=Object(r.f)(i),u=o.next();!u.done;u=o.next()){var s=u.value;try{s(e,t)}catch(c){}}}catch(l){n={error:l}}finally{try{u&&!u.done&&(a=o.return)&&a.call(o)}finally{if(n)throw n.error}}},e.prototype.getOrInitializeService=function(e){var t,n=e.instanceIdentifier,r=e.options,a=void 0===r?{}:r,i=this.instances.get(n);if(!i&&this.component&&(i=this.component.instanceFactory(this.container,{instanceIdentifier:(t=n,t===o?void 0:t),options:a}),this.instances.set(n,i),this.instancesOptions.set(n,a),this.invokeOnInitCallbacks(i,n),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,n,i)}catch(u){}return i||null},e.prototype.normalizeInstanceIdentifier=function(e){return void 0===e&&(e=o),this.component?this.component.multipleInstances?e:o:e},e.prototype.shouldAutoInitialize=function(){return!!this.component&&"EXPLICIT"!==this.component.instantiationMode},e}();var s=function(){function e(e){this.name=e,this.providers=new Map}return e.prototype.addComponent=function(e){var t=this.getProvider(e.name);if(t.isComponentSet())throw new Error("Component "+e.name+" has already been registered with "+this.name);t.setComponent(e)},e.prototype.addOrOverwriteComponent=function(e){this.getProvider(e.name).isComponentSet()&&this.providers.delete(e.name),this.addComponent(e)},e.prototype.getProvider=function(e){if(this.providers.has(e))return this.providers.get(e);var t=new u(e,this);return this.providers.set(e,t),t},e.prototype.getProviders=function(){return Array.from(this.providers.values())},e}()},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(26);function a(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(e)){var n=[],r=!0,a=!1,i=void 0;try{for(var o,u=e[Symbol.iterator]();!(r=(o=u.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(s){a=!0,i=s}finally{try{r||null==u.return||u.return()}finally{if(a)throw i}}return n}}(e,t)||Object(r.a)(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},function(e,t,n){"use strict";function r(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return a})),n.d(t,"b",(function(){return h})),n.d(t,"c",(function(){return v})),n.d(t,"d",(function(){return m}));var r,a,i=n(18),o=n(4),u=n(5),s=n(1),c=[];!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"}(a||(a={}));var l={debug:a.DEBUG,verbose:a.VERBOSE,info:a.INFO,warn:a.WARN,error:a.ERROR,silent:a.SILENT},f=a.INFO,d=(r={},Object(s.a)(r,a.DEBUG,"log"),Object(s.a)(r,a.VERBOSE,"log"),Object(s.a)(r,a.INFO,"info"),Object(s.a)(r,a.WARN,"warn"),Object(s.a)(r,a.ERROR,"error"),r),p=function(e,t){if(!(t2?i-2:0),u=2;u2?r-2:0),u=2;u=(null!==i&&void 0!==i?i:t.logLevel)&&e({level:a[n].toLowerCase(),message:s,args:o,type:t.name})}};for(r.s();!(n=r.n()).done;)o()}catch(u){r.e(u)}finally{r.f()}}},function(e,t,n){"use strict";function r(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r=0||(a[n]=e[n]);return a}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return bt})),n.d(t,"b",(function(){return gr})),n.d(t,"c",(function(){return Nt})),n.d(t,"d",(function(){return Sn}));var r=n(14);function a(e,t,n){return a="undefined"!==typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var a=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Object(r.a)(e)););return e}(e,t);if(a){var i=Object.getOwnPropertyDescriptor(a,t);return i.get?i.get.call(n):i.value}},a(e,t,n||e)}var i=n(21),o=n(7),u=n(8),s=n(18),c=n(0),l=n.n(c),f=n(20),d=n(2),p=n(4),h=n(5),v=n(28);var m=n(26);function y(e){return function(e){if(Array.isArray(e))return Object(v.a)(e)}(e)||function(e){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||Object(m.a)(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var b,g=n(1),k=n(3),w=n(13),O=n(12),_=n(22),E=n(19);function x(){return Object(g.a)({},"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.")}var S=x,j=new k.b("auth","Firebase",x()),I=new _.b("@firebase/auth");function T(e){if(I.logLevel<=_.a.ERROR){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r1?t-1:0),r=1;r1?t-1:0),r=1;r1?t-1:0),r=1;r2?n-2:0),a=2;at,"Short delay should be less than long delay!"),this.isMobile=Object(k.m)()||Object(k.n)()}return Object(h.a)(e,[{key:"get",value:function(){return"undefined"!==typeof navigator&&navigator&&"onLine"in navigator&&"boolean"===typeof navigator.onLine&&(W()||Object(k.j)()||"connection"in navigator)&&!navigator.onLine?Math.min(5e3,this.shortDelay):this.isMobile?this.longDelay:this.shortDelay}}]),e}();function $(e,t){D(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 q=function(){function e(){Object(p.a)(this,e)}return Object(h.a)(e,null,[{key:"initialize",value:function(e,t,n){this.fetchImpl=e,t&&(this.headersImpl=t),n&&(this.responseImpl=n)}},{key:"fetch",value:function(){return this.fetchImpl?this.fetchImpl:"undefined"!==typeof self&&"fetch"in self?self.fetch:void M("Could not find fetch implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}},{key:"headers",value:function(){return this.headersImpl?this.headersImpl:"undefined"!==typeof self&&"Headers"in self?self.Headers:void M("Could not find Headers implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}},{key:"response",value:function(){return this.responseImpl?this.responseImpl:"undefined"!==typeof self&&"Response"in self?self.Response:void M("Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}}]),e}(),K=(b={},Object(g.a)(b,"CREDENTIAL_MISMATCH","custom-token-mismatch"),Object(g.a)(b,"MISSING_CUSTOM_TOKEN","internal-error"),Object(g.a)(b,"INVALID_IDENTIFIER","invalid-email"),Object(g.a)(b,"MISSING_CONTINUE_URI","internal-error"),Object(g.a)(b,"INVALID_PASSWORD","wrong-password"),Object(g.a)(b,"MISSING_PASSWORD","internal-error"),Object(g.a)(b,"EMAIL_EXISTS","email-already-in-use"),Object(g.a)(b,"PASSWORD_LOGIN_DISABLED","operation-not-allowed"),Object(g.a)(b,"INVALID_IDP_RESPONSE","invalid-credential"),Object(g.a)(b,"INVALID_PENDING_TOKEN","invalid-credential"),Object(g.a)(b,"FEDERATED_USER_ID_ALREADY_LINKED","credential-already-in-use"),Object(g.a)(b,"MISSING_REQ_TYPE","internal-error"),Object(g.a)(b,"EMAIL_NOT_FOUND","user-not-found"),Object(g.a)(b,"RESET_PASSWORD_EXCEED_LIMIT","too-many-requests"),Object(g.a)(b,"EXPIRED_OOB_CODE","expired-action-code"),Object(g.a)(b,"INVALID_OOB_CODE","invalid-action-code"),Object(g.a)(b,"MISSING_OOB_CODE","internal-error"),Object(g.a)(b,"CREDENTIAL_TOO_OLD_LOGIN_AGAIN","requires-recent-login"),Object(g.a)(b,"INVALID_ID_TOKEN","invalid-user-token"),Object(g.a)(b,"TOKEN_EXPIRED","user-token-expired"),Object(g.a)(b,"USER_NOT_FOUND","user-token-expired"),Object(g.a)(b,"TOO_MANY_ATTEMPTS_TRY_LATER","too-many-requests"),Object(g.a)(b,"INVALID_CODE","invalid-verification-code"),Object(g.a)(b,"INVALID_SESSION_INFO","invalid-verification-id"),Object(g.a)(b,"INVALID_TEMPORARY_PROOF","invalid-credential"),Object(g.a)(b,"MISSING_SESSION_INFO","missing-verification-id"),Object(g.a)(b,"SESSION_EXPIRED","code-expired"),Object(g.a)(b,"MISSING_ANDROID_PACKAGE_NAME","missing-android-pkg-name"),Object(g.a)(b,"UNAUTHORIZED_DOMAIN","unauthorized-continue-uri"),Object(g.a)(b,"INVALID_OAUTH_CLIENT_ID","invalid-oauth-client-id"),Object(g.a)(b,"ADMIN_ONLY_OPERATION","admin-restricted-operation"),Object(g.a)(b,"INVALID_MFA_PENDING_CREDENTIAL","invalid-multi-factor-session"),Object(g.a)(b,"MFA_ENROLLMENT_NOT_FOUND","multi-factor-info-not-found"),Object(g.a)(b,"MISSING_MFA_ENROLLMENT_ID","missing-multi-factor-info"),Object(g.a)(b,"MISSING_MFA_PENDING_CREDENTIAL","missing-multi-factor-session"),Object(g.a)(b,"SECOND_FACTOR_EXISTS","second-factor-already-in-use"),Object(g.a)(b,"SECOND_FACTOR_LIMIT_EXCEEDED","maximum-second-factor-count-exceeded"),Object(g.a)(b,"BLOCKING_FUNCTION_ERROR_RESPONSE","internal-error"),b),G=new B(3e4,6e4);function Q(e,t){return e.tenantId&&!t.tenantId?Object.assign(Object.assign({},t),{tenantId:e.tenantId}):t}function J(e,t,n,r){return Y.apply(this,arguments)}function Y(){return Y=Object(d.a)(l.a.mark((function e(t,n,r,a){var i,o=arguments;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=o.length>4&&void 0!==o[4]?o[4]:{},e.abrupt("return",X(t,i,(function(){var e={},i={};a&&("GET"===n?i=a:e={body:JSON.stringify(a)});var o=Object(k.o)(Object.assign({key:t.config.apiKey},i)).slice(1),u=new(q.headers());return u.set("Content-Type","application/json"),u.set("X-Client-Version",t._getSdkClientVersion()),t.languageCode&&u.set("X-Firebase-Locale",t.languageCode),q.fetch()(ne(t,t.config.apiHost,r,o),Object.assign({method:n,headers:u,referrerPolicy:"no-referrer"},e))})));case 2:case"end":return e.stop()}}),e)}))),Y.apply(this,arguments)}function X(e,t,n){return Z.apply(this,arguments)}function Z(){return(Z=Object(d.a)(l.a.mark((function e(t,n,r){var a,i,o,u,s,c,d,p,h,v;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t._canInitEmulator=!1,a=Object.assign(Object.assign({},K),n),e.prev=2,i=new re(t),e.next=6,Promise.race([r(),i.promise]);case 6:return o=e.sent,i.clearNetworkTimeout(),e.next=10,o.json();case 10:if(!("needConfirmation"in(u=e.sent))){e.next=13;break}throw ae(t,"account-exists-with-different-credential",u);case 13:if(!o.ok||"errorMessage"in u){e.next=17;break}return e.abrupt("return",u);case 17:if(s=o.ok?u.errorMessage:u.error.message,c=s.split(" : "),d=Object(f.a)(c,2),p=d[0],h=d[1],"FEDERATED_USER_ID_ALREADY_LINKED"!==p){e.next=23;break}throw ae(t,"credential-already-in-use",u);case 23:if("EMAIL_EXISTS"!==p){e.next=25;break}throw ae(t,"email-already-in-use",u);case 25:if(v=a[p]||p.toLowerCase().replace(/[_\s]+/g,"-"),!h){e.next=30;break}throw R(t,v,h);case 30:C(t,v);case 31:e.next=38;break;case 33:if(e.prev=33,e.t0=e.catch(2),!(e.t0 instanceof k.c)){e.next=37;break}throw e.t0;case 37:C(t,"network-request-failed");case 38:case"end":return e.stop()}}),e,null,[[2,33]])})))).apply(this,arguments)}function ee(e,t,n,r){return te.apply(this,arguments)}function te(){return te=Object(d.a)(l.a.mark((function e(t,n,r,a){var i,o,u=arguments;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=u.length>4&&void 0!==u[4]?u[4]:{},e.next=3,J(t,n,r,a,i);case 3:return"mfaPendingCredential"in(o=e.sent)&&C(t,"multi-factor-auth-required",{_serverResponse:o}),e.abrupt("return",o);case 6:case"end":return e.stop()}}),e)}))),te.apply(this,arguments)}function ne(e,t,n,r){var a="".concat(t).concat(n,"?").concat(r);return e.config.emulator?$(e.config,a):"".concat(e.config.apiScheme,"://").concat(a)}var re=function(){function e(t){var n=this;Object(p.a)(this,e),this.auth=t,this.timer=null,this.promise=new Promise((function(e,t){n.timer=setTimeout((function(){return t(P(n.auth,"timeout"))}),G.get())}))}return Object(h.a)(e,[{key:"clearNetworkTimeout",value:function(){clearTimeout(this.timer)}}]),e}();function ae(e,t,n){var r={appName:e.name};n.email&&(r.email=n.email),n.phoneNumber&&(r.phoneNumber=n.phoneNumber);var a=P(e,t,r);return a.customData._tokenResponse=n,a}function ie(e,t){return oe.apply(this,arguments)}function oe(){return(oe=Object(d.a)(l.a.mark((function e(t,n){return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",J(t,"POST","/v1/accounts:delete",n));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ue(e,t){return se.apply(this,arguments)}function se(){return(se=Object(d.a)(l.a.mark((function e(t,n){return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",J(t,"POST","/v1/accounts:lookup",n));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ce(e){if(e)try{var t=new Date(Number(e));if(!isNaN(t.getTime()))return t.toUTCString()}catch(n){}}function le(){return le=Object(d.a)(l.a.mark((function e(t){var n,r,a,i,o,u,s=arguments;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=s.length>1&&void 0!==s[1]&&s[1],r=Object(k.h)(t),e.next=4,r.getIdToken(n);case 4:return a=e.sent,A((i=de(a))&&i.exp&&i.auth_time&&i.iat,r.auth,"internal-error"),o="object"===typeof i.firebase?i.firebase:void 0,u=null===o||void 0===o?void 0:o.sign_in_provider,e.abrupt("return",{claims:i,token:a,authTime:ce(fe(i.auth_time)),issuedAtTime:ce(fe(i.iat)),expirationTime:ce(fe(i.exp)),signInProvider:u||null,signInSecondFactor:(null===o||void 0===o?void 0:o.sign_in_second_factor)||null});case 10:case"end":return e.stop()}}),e)}))),le.apply(this,arguments)}function fe(e){return 1e3*Number(e)}function de(e){var t=e.split("."),n=Object(f.a)(t,3),r=n[0],a=n[1],i=n[2];if(void 0===r||void 0===a||void 0===i)return T("JWT malformed, contained fewer than 3 sections"),null;try{var o=Object(k.d)(a);return o?JSON.parse(o):(T("Failed to decode base64 JWT payload"),null)}catch(u){return T("Caught error parsing JWT payload as JSON",u),null}}function pe(e,t){return he.apply(this,arguments)}function he(){return he=Object(d.a)(l.a.mark((function e(t,n){var r=arguments;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(r.length>2&&void 0!==r[2]&&r[2])){e.next=3;break}return e.abrupt("return",n);case 3:return e.prev=3,e.next=6,n;case 6:return e.abrupt("return",e.sent);case 9:if(e.prev=9,e.t0=e.catch(3),!(e.t0 instanceof k.c&&ve(e.t0))){e.next=15;break}if(t.auth.currentUser!==t){e.next=15;break}return e.next=15,t.auth.signOut();case 15:throw e.t0;case 16:case"end":return e.stop()}}),e,null,[[3,9]])}))),he.apply(this,arguments)}function ve(e){var t=e.code;return t==="auth/".concat("user-disabled")||t==="auth/".concat("user-token-expired")}var me=function(){function e(t){Object(p.a)(this,e),this.user=t,this.isRunning=!1,this.timerId=null,this.errorBackoff=3e4}return Object(h.a)(e,[{key:"_start",value:function(){this.isRunning||(this.isRunning=!0,this.schedule())}},{key:"_stop",value:function(){this.isRunning&&(this.isRunning=!1,null!==this.timerId&&clearTimeout(this.timerId))}},{key:"getInterval",value:function(e){var t;if(e){var n=this.errorBackoff;return this.errorBackoff=Math.min(2*this.errorBackoff,96e4),n}this.errorBackoff=3e4;var r=(null!==(t=this.user.stsTokenManager.expirationTime)&&void 0!==t?t:0)-Date.now()-3e5;return Math.max(0,r)}},{key:"schedule",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.isRunning){var n=this.getInterval(t);this.timerId=setTimeout(Object(d.a)(l.a.mark((function t(){return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.iteration();case 2:case"end":return t.stop()}}),t)}))),n)}}},{key:"iteration",value:function(){var e=Object(d.a)(l.a.mark((function e(){return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.user.getIdToken(!0);case 3:e.next=9;break;case 5:return e.prev=5,e.t0=e.catch(0),e.t0.code==="auth/".concat("network-request-failed")&&this.schedule(!0),e.abrupt("return");case 9:this.schedule();case 10:case"end":return e.stop()}}),e,this,[[0,5]])})));return function(){return e.apply(this,arguments)}}()}]),e}(),ye=function(){function e(t,n){Object(p.a)(this,e),this.createdAt=t,this.lastLoginAt=n,this._initializeTime()}return Object(h.a)(e,[{key:"_initializeTime",value:function(){this.lastSignInTime=ce(this.lastLoginAt),this.creationTime=ce(this.createdAt)}},{key:"_copy",value:function(e){this.createdAt=e.createdAt,this.lastLoginAt=e.lastLoginAt,this._initializeTime()}},{key:"toJSON",value:function(){return{createdAt:this.createdAt,lastLoginAt:this.lastLoginAt}}}]),e}();function be(e){return ge.apply(this,arguments)}function ge(){return(ge=Object(d.a)(l.a.mark((function e(t){var n,r,a,i,o,u,s,c,f,d,p;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.auth,e.next=3,t.getIdToken();case 3:return a=e.sent,e.next=6,pe(t,ue(r,{idToken:a}));case 6:A(null===(i=e.sent)||void 0===i?void 0:i.users.length,r,"internal-error"),o=i.users[0],t._notifyReloadListener(o),u=(null===(n=o.providerUserInfo)||void 0===n?void 0:n.length)?Oe(o.providerUserInfo):[],s=we(t.providerData,u),c=t.isAnonymous,f=!(t.email&&o.passwordHash)&&!(null===s||void 0===s?void 0:s.length),d=!!c&&f,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:s,metadata:new ye(o.createdAt,o.lastLoginAt),isAnonymous:d},Object.assign(t,p);case 17:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ke(){return(ke=Object(d.a)(l.a.mark((function e(t){var n;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=Object(k.h)(t),e.next=3,be(n);case 3:return e.next=5,n.auth._persistUserIfCurrent(n);case 5:n.auth._notifyListenersIfCurrent(n);case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function we(e,t){var n=e.filter((function(e){return!t.some((function(t){return t.providerId===e.providerId}))}));return[].concat(y(n),y(t))}function Oe(e){return e.map((function(e){var t=e.providerId,n=Object(O.d)(e,["providerId"]);return{providerId:t,uid:n.rawId||"",displayName:n.displayName||null,email:n.email||null,phoneNumber:n.phoneNumber||null,photoURL:n.photoUrl||null}}))}function _e(e,t){return Ee.apply(this,arguments)}function Ee(){return(Ee=Object(d.a)(l.a.mark((function e(t,n){var r;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,X(t,{},(function(){var e=Object(k.o)({grant_type:"refresh_token",refresh_token:n}).slice(1),r=t.config,a=r.tokenApiHost,i=r.apiKey,o=ne(t,a,"/v1/token","key=".concat(i));return q.fetch()(o,{method:"POST",headers:{"X-Client-Version":t._getSdkClientVersion(),"Content-Type":"application/x-www-form-urlencoded"},body:e})}));case 2:return r=e.sent,e.abrupt("return",{accessToken:r.access_token,expiresIn:r.expires_in,refreshToken:r.refresh_token});case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var xe=function(){function e(){Object(p.a)(this,e),this.refreshToken=null,this.accessToken=null,this.expirationTime=null}return Object(h.a)(e,[{key:"isExpired",get:function(){return!this.expirationTime||Date.now()>this.expirationTime-3e4}},{key:"updateFromServerResponse",value:function(e){A(e.idToken,"internal-error"),A("undefined"!==typeof e.idToken,"internal-error"),A("undefined"!==typeof e.refreshToken,"internal-error");var t="expiresIn"in e&&"undefined"!==typeof e.expiresIn?Number(e.expiresIn):function(e){var t=de(e);return A(t,"internal-error"),A("undefined"!==typeof t.exp,"internal-error"),A("undefined"!==typeof t.iat,"internal-error"),Number(t.exp)-Number(t.iat)}(e.idToken);this.updateTokensAndExpiration(e.idToken,e.refreshToken,t)}},{key:"getToken",value:function(){var e=Object(d.a)(l.a.mark((function e(t){var n,r=arguments;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=r.length>1&&void 0!==r[1]&&r[1],A(!this.accessToken||this.refreshToken,t,"user-token-expired"),n||!this.accessToken||this.isExpired){e.next=4;break}return e.abrupt("return",this.accessToken);case 4:if(!this.refreshToken){e.next=8;break}return e.next=7,this.refresh(t,this.refreshToken);case 7:return e.abrupt("return",this.accessToken);case 8:return e.abrupt("return",null);case 9:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"clearRefreshToken",value:function(){this.refreshToken=null}},{key:"refresh",value:function(){var e=Object(d.a)(l.a.mark((function e(t,n){var r,a,i,o;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,_e(t,n);case 2:r=e.sent,a=r.accessToken,i=r.refreshToken,o=r.expiresIn,this.updateTokensAndExpiration(a,i,Number(o));case 7:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"updateTokensAndExpiration",value:function(e,t,n){this.refreshToken=t||null,this.accessToken=e||null,this.expirationTime=Date.now()+1e3*n}},{key:"toJSON",value:function(){return{refreshToken:this.refreshToken,accessToken:this.accessToken,expirationTime:this.expirationTime}}},{key:"_assign",value:function(e){this.accessToken=e.accessToken,this.refreshToken=e.refreshToken,this.expirationTime=e.expirationTime}},{key:"_clone",value:function(){return Object.assign(new e,this.toJSON())}},{key:"_performRefresh",value:function(){return M("not implemented")}}],[{key:"fromJSON",value:function(t,n){var r=n.refreshToken,a=n.accessToken,i=n.expirationTime,o=new e;return r&&(A("string"===typeof r,"internal-error",{appName:t}),o.refreshToken=r),a&&(A("string"===typeof a,"internal-error",{appName:t}),o.accessToken=a),i&&(A("number"===typeof i,"internal-error",{appName:t}),o.expirationTime=i),o}}]),e}();function Se(e,t){A("string"===typeof e||"undefined"===typeof e,"internal-error",{appName:t})}var je=function(){function e(t){Object(p.a)(this,e);var n=t.uid,r=t.auth,a=t.stsTokenManager,i=Object(O.d)(t,["uid","auth","stsTokenManager"]);this.providerId="firebase",this.emailVerified=!1,this.isAnonymous=!1,this.tenantId=null,this.providerData=[],this.proactiveRefresh=new me(this),this.reloadUserInfo=null,this.reloadListener=null,this.uid=n,this.auth=r,this.stsTokenManager=a,this.accessToken=a.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.metadata=new ye(i.createdAt||void 0,i.lastLoginAt||void 0)}return Object(h.a)(e,[{key:"getIdToken",value:function(){var e=Object(d.a)(l.a.mark((function e(t){var n;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,pe(this,this.stsTokenManager.getToken(this.auth,t));case 2:if(A(n=e.sent,this.auth,"internal-error"),this.accessToken===n){e.next=9;break}return this.accessToken=n,e.next=8,this.auth._persistUserIfCurrent(this);case 8:this.auth._notifyListenersIfCurrent(this);case 9:return e.abrupt("return",n);case 10:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"getIdTokenResult",value:function(e){return function(e){return le.apply(this,arguments)}(this,e)}},{key:"reload",value:function(){return function(e){return ke.apply(this,arguments)}(this)}},{key:"_assign",value:function(e){this!==e&&(A(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 Object.assign({},e)})),this.metadata._copy(e.metadata),this.stsTokenManager._assign(e.stsTokenManager))}},{key:"_clone",value:function(t){return new e(Object.assign(Object.assign({},this),{auth:t,stsTokenManager:this.stsTokenManager._clone()}))}},{key:"_onReload",value:function(e){A(!this.reloadListener,this.auth,"internal-error"),this.reloadListener=e,this.reloadUserInfo&&(this._notifyReloadListener(this.reloadUserInfo),this.reloadUserInfo=null)}},{key:"_notifyReloadListener",value:function(e){this.reloadListener?this.reloadListener(e):this.reloadUserInfo=e}},{key:"_startProactiveRefresh",value:function(){this.proactiveRefresh._start()}},{key:"_stopProactiveRefresh",value:function(){this.proactiveRefresh._stop()}},{key:"_updateTokensIfNecessary",value:function(){var e=Object(d.a)(l.a.mark((function e(t){var n,r,a=arguments;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=a.length>1&&void 0!==a[1]&&a[1],r=!1,t.idToken&&t.idToken!==this.stsTokenManager.accessToken&&(this.stsTokenManager.updateFromServerResponse(t),r=!0),!n){e.next=6;break}return e.next=6,be(this);case 6:return e.next=8,this.auth._persistUserIfCurrent(this);case 8:r&&this.auth._notifyListenersIfCurrent(this);case 9:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"delete",value:function(){var e=Object(d.a)(l.a.mark((function e(){var t;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getIdToken();case 2:return t=e.sent,e.next=5,pe(this,ie(this.auth,{idToken:t}));case 5:return this.stsTokenManager.clearRefreshToken(),e.abrupt("return",this.auth.signOut());case 7:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"toJSON",value:function(){return Object.assign(Object.assign({uid:this.uid,email:this.email||void 0,emailVerified:this.emailVerified,displayName:this.displayName||void 0,isAnonymous:this.isAnonymous,photoURL:this.photoURL||void 0,phoneNumber:this.phoneNumber||void 0,tenantId:this.tenantId||void 0,providerData:this.providerData.map((function(e){return Object.assign({},e)})),stsTokenManager:this.stsTokenManager.toJSON(),_redirectEventId:this._redirectEventId},this.metadata.toJSON()),{apiKey:this.auth.config.apiKey,appName:this.auth.name})}},{key:"refreshToken",get:function(){return this.stsTokenManager.refreshToken||""}}],[{key:"_fromJSON",value:function(t,n){var r,a,i,o,u,s,c,l,f=null!==(r=n.displayName)&&void 0!==r?r:void 0,d=null!==(a=n.email)&&void 0!==a?a:void 0,p=null!==(i=n.phoneNumber)&&void 0!==i?i:void 0,h=null!==(o=n.photoURL)&&void 0!==o?o:void 0,v=null!==(u=n.tenantId)&&void 0!==u?u:void 0,m=null!==(s=n._redirectEventId)&&void 0!==s?s:void 0,y=null!==(c=n.createdAt)&&void 0!==c?c:void 0,b=null!==(l=n.lastLoginAt)&&void 0!==l?l:void 0,g=n.uid,k=n.emailVerified,w=n.isAnonymous,O=n.providerData,_=n.stsTokenManager;A(g&&_,t,"internal-error");var E=xe.fromJSON(this.name,_);A("string"===typeof g,t,"internal-error"),Se(f,t.name),Se(d,t.name),A("boolean"===typeof k,t,"internal-error"),A("boolean"===typeof w,t,"internal-error"),Se(p,t.name),Se(h,t.name),Se(v,t.name),Se(m,t.name),Se(y,t.name),Se(b,t.name);var x=new e({uid:g,auth:t,email:d,emailVerified:k,displayName:f,isAnonymous:w,photoURL:h,phoneNumber:p,tenantId:v,stsTokenManager:E,createdAt:y,lastLoginAt:b});return O&&Array.isArray(O)&&(x.providerData=O.map((function(e){return Object.assign({},e)}))),m&&(x._redirectEventId=m),x}},{key:"_fromIdTokenResponse",value:function(){var t=Object(d.a)(l.a.mark((function t(n,r){var a,i,o,u=arguments;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a=u.length>2&&void 0!==u[2]&&u[2],(i=new xe).updateFromServerResponse(r),o=new e({uid:r.localId,auth:n,stsTokenManager:i,isAnonymous:a}),t.next=6,be(o);case 6:return t.abrupt("return",o);case 7:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}()}]),e}(),Ie=function(){function e(){Object(p.a)(this,e),this.type="NONE",this.storage={}}return Object(h.a)(e,[{key:"_isAvailable",value:function(){var e=Object(d.a)(l.a.mark((function e(){return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",!0);case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()},{key:"_set",value:function(){var e=Object(d.a)(l.a.mark((function e(t,n){return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.storage[t]=n;case 1:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"_get",value:function(){var e=Object(d.a)(l.a.mark((function e(t){var n;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=this.storage[t],e.abrupt("return",void 0===n?null:n);case 2:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"_remove",value:function(){var e=Object(d.a)(l.a.mark((function e(t){return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:delete this.storage[t];case 1:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"_addListener",value:function(e,t){}},{key:"_removeListener",value:function(e,t){}}]),e}();Ie.type="NONE";var Te=Ie;function Ce(e,t,n){return"firebase".concat(":",e,":").concat(t,":").concat(n)}var Pe=function(){function e(t,n,r){Object(p.a)(this,e),this.persistence=t,this.auth=n,this.userKey=r;var a=this.auth,i=a.config,o=a.name;this.fullUserKey=Ce(this.userKey,i.apiKey,o),this.fullPersistenceKey=Ce("persistence",i.apiKey,o),this.boundEventHandler=n._onStorageEvent.bind(n),this.persistence._addListener(this.fullUserKey,this.boundEventHandler)}return Object(h.a)(e,[{key:"setCurrentUser",value:function(e){return this.persistence._set(this.fullUserKey,e.toJSON())}},{key:"getCurrentUser",value:function(){var e=Object(d.a)(l.a.mark((function e(){var t;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.persistence._get(this.fullUserKey);case 2:return t=e.sent,e.abrupt("return",t?je._fromJSON(this.auth,t):null);case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"removeCurrentUser",value:function(){return this.persistence._remove(this.fullUserKey)}},{key:"savePersistenceForRedirect",value:function(){return this.persistence._set(this.fullPersistenceKey,this.persistence.type)}},{key:"setPersistence",value:function(){var e=Object(d.a)(l.a.mark((function e(t){var n;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.persistence!==t){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,this.getCurrentUser();case 4:return n=e.sent,e.next=7,this.removeCurrentUser();case 7:if(this.persistence=t,!n){e.next=10;break}return e.abrupt("return",this.setCurrentUser(n));case 10:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"delete",value:function(){this.persistence._removeListener(this.fullUserKey,this.boundEventHandler)}}],[{key:"create",value:function(){var t=Object(d.a)(l.a.mark((function t(n,r){var a,i,o,u,c,f,p,h,v,m,y,b=arguments;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(a=b.length>2&&void 0!==b[2]?b[2]:"authUser",r.length){t.next=3;break}return t.abrupt("return",new e(z(Te),n,a));case 3:return t.next=5,Promise.all(r.map(function(){var e=Object(d.a)(l.a.mark((function e(t){return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t._isAvailable();case 2:if(!e.sent){e.next=4;break}return e.abrupt("return",t);case 4:return e.abrupt("return",void 0);case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 5:i=t.sent.filter((function(e){return e})),o=i[0]||z(Te),u=Ce(a,n.config.apiKey,n.name),c=null,f=Object(s.a)(r),t.prev=10,f.s();case 12:if((p=f.n()).done){t.next=29;break}return h=p.value,t.prev=14,t.next=17,h._get(u);case 17:if(!(v=t.sent)){t.next=23;break}return m=je._fromJSON(n,v),h!==o&&(c=m),o=h,t.abrupt("break",29);case 23:t.next=27;break;case 25:t.prev=25,t.t0=t.catch(14);case 27:t.next=12;break;case 29:t.next=34;break;case 31:t.prev=31,t.t1=t.catch(10),f.e(t.t1);case 34:return t.prev=34,f.f(),t.finish(34);case 37:if(y=i.filter((function(e){return e._shouldAllowMigration})),o._shouldAllowMigration&&y.length){t.next=40;break}return t.abrupt("return",new e(o,n,a));case 40:if(o=y[0],!c){t.next=44;break}return t.next=44,o._set(u,c.toJSON());case 44:return t.next=46,Promise.all(r.map(function(){var e=Object(d.a)(l.a.mark((function e(t){return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t===o){e.next=8;break}return e.prev=1,e.next=4,t._remove(u);case 4:e.next=8;break;case 6:e.prev=6,e.t0=e.catch(1);case 8:case"end":return e.stop()}}),e,null,[[1,6]])})));return function(t){return e.apply(this,arguments)}}()));case 46:return t.abrupt("return",new e(o,n,a));case 47:case"end":return t.stop()}}),t,null,[[10,31,34,37],[14,25]])})));return function(e,n){return t.apply(this,arguments)}}()}]),e}();function Re(e){var t=e.toLowerCase();if(t.includes("opera/")||t.includes("opr/")||t.includes("opios/"))return"Opera";if(Me(t))return"IEMobile";if(t.includes("msie")||t.includes("trident/"))return"IE";if(t.includes("edge/"))return"Edge";if(Ne(t))return"Firefox";if(t.includes("silk/"))return"Silk";if(Ue(t))return"Blackberry";if(ze(t))return"Webos";if(Le(t))return"Safari";if((t.includes("chrome/")||Ae(t))&&!t.includes("edge/"))return"Chrome";if(De(t))return"Android";var n=e.match(/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/);return 2===(null===n||void 0===n?void 0:n.length)?n[1]:"Other"}function Ne(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Object(k.i)();return/firefox\//i.test(e)}function Le(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Object(k.i)(),t=e.toLowerCase();return t.includes("safari/")&&!t.includes("chrome/")&&!t.includes("crios/")&&!t.includes("android")}function Ae(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Object(k.i)();return/crios\//i.test(e)}function Me(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Object(k.i)();return/iemobile/i.test(e)}function De(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Object(k.i)();return/android/i.test(e)}function Ue(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Object(k.i)();return/blackberry/i.test(e)}function ze(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Object(k.i)();return/webos/i.test(e)}function Fe(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Object(k.i)();return/iphone|ipad|ipod/i.test(e)}function Ve(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Object(k.i)();return Fe(t)&&!!(null===(e=window.navigator)||void 0===e?void 0:e.standalone)}function We(){return Object(k.l)()&&10===document.documentMode}function He(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Object(k.i)();return Fe(e)||De(e)||ze(e)||Ue(e)||/windows phone/i.test(e)||Me(e)}function Be(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];switch(e){case"Browser":t=Re(Object(k.i)());break;case"Worker":t="".concat(Re(Object(k.i)()),"-").concat(e);break;default:t=e}var r=n.length?n.join(","):"FirebaseCore-web";return"".concat(t,"/","JsCore","/").concat(w.a,"/").concat(r)}var $e=function(){function e(t,n){Object(p.a)(this,e),this.app=t,this.config=n,this.currentUser=null,this.emulatorConfig=null,this.operations=Promise.resolve(),this.authStateSubscription=new Ke(this),this.idTokenSubscription=new Ke(this),this.redirectUser=null,this.isProactiveRefreshEnabled=!1,this._canInitEmulator=!0,this._isInitialized=!1,this._deleted=!1,this._initializationPromise=null,this._popupRedirectResolver=null,this._errorFactory=j,this.lastNotifiedUid=void 0,this.languageCode=null,this.tenantId=null,this.settings={appVerificationDisabledForTesting:!1},this.frameworks=[],this.name=t.name,this.clientVersion=n.sdkClientVersion}return Object(h.a)(e,[{key:"_initializeWithPersistence",value:function(e,t){var n=this;return t&&(this._popupRedirectResolver=z(t)),this._initializationPromise=this.queue(Object(d.a)(l.a.mark((function r(){var a;return l.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(!n._deleted){r.next=2;break}return r.abrupt("return");case 2:return r.next=4,Pe.create(n,e);case 4:if(n.persistenceManager=r.sent,!n._deleted){r.next=7;break}return r.abrupt("return");case 7:if(!(null===(a=n._popupRedirectResolver)||void 0===a?void 0:a._shouldInitProactively)){r.next=10;break}return r.next=10,n._popupRedirectResolver._initialize(n);case 10:return r.next=12,n.initializeCurrentUser(t);case 12:if(!n._deleted){r.next=14;break}return r.abrupt("return");case 14:n._isInitialized=!0;case 15:case"end":return r.stop()}}),r)})))),this._initializationPromise}},{key:"_onStorageEvent",value:function(){var e=Object(d.a)(l.a.mark((function e(){var t;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._deleted){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,this.assertedPersistence.getCurrentUser();case 4:if(t=e.sent,this.currentUser||t){e.next=7;break}return e.abrupt("return");case 7:if(!this.currentUser||!t||this.currentUser.uid!==t.uid){e.next=12;break}return this._currentUser._assign(t),e.next=11,this.currentUser.getIdToken();case 11:return e.abrupt("return");case 12:return e.next=14,this._updateCurrentUser(t);case 14:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"initializeCurrentUser",value:function(){var e=Object(d.a)(l.a.mark((function e(t){var n,r,a,i,o;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.assertedPersistence.getCurrentUser();case 2:if(r=e.sent,!t||!this.config.authDomain){e.next=12;break}return e.next=6,this.getOrInitRedirectPersistenceManager();case 6:return a=null===(n=this.redirectUser)||void 0===n?void 0:n._redirectEventId,i=null===r||void 0===r?void 0:r._redirectEventId,e.next=10,this.tryRedirectSignIn(t);case 10:o=e.sent,a&&a!==i||!(null===o||void 0===o?void 0:o.user)||(r=o.user);case 12:if(r){e.next=14;break}return e.abrupt("return",this.directlySetCurrentUser(null));case 14:if(r._redirectEventId){e.next=16;break}return e.abrupt("return",this.reloadAndSetCurrentUserOrClear(r));case 16:return A(this._popupRedirectResolver,this,"argument-error"),e.next=19,this.getOrInitRedirectPersistenceManager();case 19:if(!this.redirectUser||this.redirectUser._redirectEventId!==r._redirectEventId){e.next=21;break}return e.abrupt("return",this.directlySetCurrentUser(r));case 21:return e.abrupt("return",this.reloadAndSetCurrentUserOrClear(r));case 22:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"tryRedirectSignIn",value:function(){var e=Object(d.a)(l.a.mark((function e(t){var n;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=null,e.prev=1,e.next=4,this._popupRedirectResolver._completeRedirectFn(this,t,!0);case 4:n=e.sent,e.next=11;break;case 7:return e.prev=7,e.t0=e.catch(1),e.next=11,this._setRedirectUser(null);case 11:return e.abrupt("return",n);case 12:case"end":return e.stop()}}),e,this,[[1,7]])})));return function(t){return e.apply(this,arguments)}}()},{key:"reloadAndSetCurrentUserOrClear",value:function(){var e=Object(d.a)(l.a.mark((function e(t){return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,be(t);case 3:e.next=9;break;case 5:if(e.prev=5,e.t0=e.catch(0),e.t0.code==="auth/".concat("network-request-failed")){e.next=9;break}return e.abrupt("return",this.directlySetCurrentUser(null));case 9:return e.abrupt("return",this.directlySetCurrentUser(t));case 10:case"end":return e.stop()}}),e,this,[[0,5]])})));return function(t){return e.apply(this,arguments)}}()},{key:"useDeviceLanguage",value:function(){this.languageCode=function(){if("undefined"===typeof navigator)return null;var e=navigator;return e.languages&&e.languages[0]||e.language||null}()}},{key:"_delete",value:function(){var e=Object(d.a)(l.a.mark((function e(){return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this._deleted=!0;case 1:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"updateCurrentUser",value:function(){var e=Object(d.a)(l.a.mark((function e(t){var n;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(n=t?Object(k.h)(t):null)&&A(n.auth.config.apiKey===this.config.apiKey,this,"invalid-user-token"),e.abrupt("return",this._updateCurrentUser(n&&n._clone(this)));case 3:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"_updateCurrentUser",value:function(){var e=Object(d.a)(l.a.mark((function e(t){var n=this;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._deleted){e.next=2;break}return e.abrupt("return");case 2:return t&&A(this.tenantId===t.tenantId,this,"tenant-id-mismatch"),e.abrupt("return",this.queue(Object(d.a)(l.a.mark((function e(){return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n.directlySetCurrentUser(t);case 2:n.notifyAuthListeners();case 3:case"end":return e.stop()}}),e)})))));case 4:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"signOut",value:function(){var e=Object(d.a)(l.a.mark((function e(){return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.redirectPersistenceManager&&!this._popupRedirectResolver){e.next=3;break}return e.next=3,this._setRedirectUser(null);case 3:return e.abrupt("return",this._updateCurrentUser(null));case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"setPersistence",value:function(e){var t=this;return this.queue(Object(d.a)(l.a.mark((function n(){return l.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,t.assertedPersistence.setPersistence(z(e));case 2:case"end":return n.stop()}}),n)}))))}},{key:"_getPersistence",value:function(){return this.assertedPersistence.persistence.type}},{key:"_updateErrorMap",value:function(e){this._errorFactory=new k.b("auth","Firebase",e())}},{key:"onAuthStateChanged",value:function(e,t,n){return this.registerStateListener(this.authStateSubscription,e,t,n)}},{key:"onIdTokenChanged",value:function(e,t,n){return this.registerStateListener(this.idTokenSubscription,e,t,n)}},{key:"toJSON",value: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()}}},{key:"_setRedirectUser",value:function(){var e=Object(d.a)(l.a.mark((function e(t,n){var r;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getOrInitRedirectPersistenceManager(n);case 2:return r=e.sent,e.abrupt("return",null===t?r.removeCurrentUser():r.setCurrentUser(t));case 4:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"getOrInitRedirectPersistenceManager",value:function(){var e=Object(d.a)(l.a.mark((function e(t){var n;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.redirectPersistenceManager){e.next=9;break}return A(n=t&&z(t)||this._popupRedirectResolver,this,"argument-error"),e.next=5,Pe.create(this,[z(n._redirectPersistence)],"redirectUser");case 5:return this.redirectPersistenceManager=e.sent,e.next=8,this.redirectPersistenceManager.getCurrentUser();case 8:this.redirectUser=e.sent;case 9:return e.abrupt("return",this.redirectPersistenceManager);case 10:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"_redirectUserForId",value:function(){var e=Object(d.a)(l.a.mark((function e(t){var n,r;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._isInitialized){e.next=3;break}return e.next=3,this.queue(Object(d.a)(l.a.mark((function e(){return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)}))));case 3:if((null===(n=this._currentUser)||void 0===n?void 0:n._redirectEventId)!==t){e.next=5;break}return e.abrupt("return",this._currentUser);case 5:if((null===(r=this.redirectUser)||void 0===r?void 0:r._redirectEventId)!==t){e.next=7;break}return e.abrupt("return",this.redirectUser);case 7:return e.abrupt("return",null);case 8:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"_persistUserIfCurrent",value:function(){var e=Object(d.a)(l.a.mark((function e(t){var n=this;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t!==this.currentUser){e.next=2;break}return e.abrupt("return",this.queue(Object(d.a)(l.a.mark((function e(){return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",n.directlySetCurrentUser(t));case 1:case"end":return e.stop()}}),e)})))));case 2:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"_notifyListenersIfCurrent",value:function(e){e===this.currentUser&&this.notifyAuthListeners()}},{key:"_key",value:function(){return"".concat(this.config.authDomain,":").concat(this.config.apiKey,":").concat(this.name)}},{key:"_startProactiveRefresh",value:function(){this.isProactiveRefreshEnabled=!0,this.currentUser&&this._currentUser._startProactiveRefresh()}},{key:"_stopProactiveRefresh",value:function(){this.isProactiveRefreshEnabled=!1,this.currentUser&&this._currentUser._stopProactiveRefresh()}},{key:"_currentUser",get:function(){return this.currentUser}},{key:"notifyAuthListeners",value: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))}}},{key:"registerStateListener",value:function(e,t,n,r){var a=this;if(this._deleted)return function(){};var i="function"===typeof t?t:t.next.bind(t),o=this._isInitialized?Promise.resolve():this._initializationPromise;return A(o,this,"internal-error"),o.then((function(){return i(a.currentUser)})),"function"===typeof t?e.addObserver(t,n,r):e.addObserver(t)}},{key:"directlySetCurrentUser",value:function(){var e=Object(d.a)(l.a.mark((function e(t){return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.currentUser&&this.currentUser!==t&&(this._currentUser._stopProactiveRefresh(),t&&this.isProactiveRefreshEnabled&&t._startProactiveRefresh()),this.currentUser=t,!t){e.next=7;break}return e.next=5,this.assertedPersistence.setCurrentUser(t);case 5:e.next=9;break;case 7:return e.next=9,this.assertedPersistence.removeCurrentUser();case 9:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"queue",value:function(e){return this.operations=this.operations.then(e,e),this.operations}},{key:"assertedPersistence",get:function(){return A(this.persistenceManager,this,"internal-error"),this.persistenceManager}},{key:"_logFramework",value:function(e){e&&!this.frameworks.includes(e)&&(this.frameworks.push(e),this.frameworks.sort(),this.clientVersion=Be(this.config.clientPlatform,this._getFrameworks()))}},{key:"_getFrameworks",value:function(){return this.frameworks}},{key:"_getSdkClientVersion",value:function(){return this.clientVersion}}]),e}();function qe(e){return Object(k.h)(e)}var Ke=function(){function e(t){var n=this;Object(p.a)(this,e),this.auth=t,this.observer=null,this.addObserver=Object(k.e)((function(e){return n.observer=e}))}return Object(h.a)(e,[{key:"next",get:function(){return A(this.observer,this.auth,"internal-error"),this.observer.next.bind(this.observer)}}]),e}();var Ge=function(){function e(t,n){Object(p.a)(this,e),this.providerId=t,this.signInMethod=n}return Object(h.a)(e,[{key:"toJSON",value:function(){return M("not implemented")}},{key:"_getIdTokenResponse",value:function(e){return M("not implemented")}},{key:"_linkToIdToken",value:function(e,t){return M("not implemented")}},{key:"_getReauthenticationResolver",value:function(e){return M("not implemented")}}]),e}();function Qe(e,t){return Je.apply(this,arguments)}function Je(){return(Je=Object(d.a)(l.a.mark((function e(t,n){return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",J(t,"POST","/v1/accounts:update",n));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ye(e,t){return Xe.apply(this,arguments)}function Xe(){return(Xe=Object(d.a)(l.a.mark((function e(t,n){return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",ee(t,"POST","/v1/accounts:signInWithPassword",Q(t,n)));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ze(e,t){return et.apply(this,arguments)}function et(){return(et=Object(d.a)(l.a.mark((function e(t,n){return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",ee(t,"POST","/v1/accounts:signInWithEmailLink",Q(t,n)));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function tt(e,t){return nt.apply(this,arguments)}function nt(){return(nt=Object(d.a)(l.a.mark((function e(t,n){return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",ee(t,"POST","/v1/accounts:signInWithEmailLink",Q(t,n)));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var rt=function(e){Object(o.a)(n,e);var t=Object(u.a)(n);function n(e,r,a){var i,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;return Object(p.a)(this,n),(i=t.call(this,"password",a))._email=e,i._password=r,i._tenantId=o,i}return Object(h.a)(n,[{key:"toJSON",value:function(){return{email:this._email,password:this._password,signInMethod:this.signInMethod,tenantId:this._tenantId}}},{key:"_getIdTokenResponse",value:function(){var e=Object(d.a)(l.a.mark((function e(t){return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.t0=this.signInMethod,e.next="password"===e.t0?3:"emailLink"===e.t0?4:5;break;case 3:return e.abrupt("return",Ye(t,{returnSecureToken:!0,email:this._email,password:this._password}));case 4:return e.abrupt("return",Ze(t,{email:this._email,oobCode:this._password}));case 5:C(t,"internal-error");case 6:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"_linkToIdToken",value:function(){var e=Object(d.a)(l.a.mark((function e(t,n){return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.t0=this.signInMethod,e.next="password"===e.t0?3:"emailLink"===e.t0?4:5;break;case 3:return e.abrupt("return",Qe(t,{idToken:n,returnSecureToken:!0,email:this._email,password:this._password}));case 4:return e.abrupt("return",tt(t,{idToken:n,email:this._email,oobCode:this._password}));case 5:C(t,"internal-error");case 6:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"_getReauthenticationResolver",value:function(e){return this._getIdTokenResponse(e)}}],[{key:"_fromEmailAndPassword",value:function(e,t){return new n(e,t,"password")}},{key:"_fromEmailAndCode",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return new n(e,t,"emailLink",r)}},{key:"fromJSON",value:function(e){var t="string"===typeof e?JSON.parse(e):e;if((null===t||void 0===t?void 0:t.email)&&(null===t||void 0===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}}]),n}(Ge);function at(e,t){return it.apply(this,arguments)}function it(){return(it=Object(d.a)(l.a.mark((function e(t,n){return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",ee(t,"POST","/v1/accounts:signInWithIdp",Q(t,n)));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var ot=function(e){Object(o.a)(n,e);var t=Object(u.a)(n);function n(){var e;return Object(p.a)(this,n),(e=t.apply(this,arguments)).pendingToken=null,e}return Object(h.a)(n,[{key:"toJSON",value:function(){return{idToken:this.idToken,accessToken:this.accessToken,secret:this.secret,nonce:this.nonce,pendingToken:this.pendingToken,providerId:this.providerId,signInMethod:this.signInMethod}}},{key:"_getIdTokenResponse",value:function(e){return at(e,this.buildRequest())}},{key:"_linkToIdToken",value:function(e,t){var n=this.buildRequest();return n.idToken=t,at(e,n)}},{key:"_getReauthenticationResolver",value:function(e){var t=this.buildRequest();return t.autoCreate=!1,at(e,t)}},{key:"buildRequest",value: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=Object(k.o)(t)}return e}}],[{key:"_fromParams",value:function(e){var t=new n(e.providerId,e.signInMethod);return e.idToken||e.accessToken?(e.idToken&&(t.idToken=e.idToken),e.accessToken&&(t.accessToken=e.accessToken),e.nonce&&!e.pendingToken&&(t.nonce=e.nonce),e.pendingToken&&(t.pendingToken=e.pendingToken)):e.oauthToken&&e.oauthTokenSecret?(t.accessToken=e.oauthToken,t.secret=e.oauthTokenSecret):C("argument-error"),t}},{key:"fromJSON",value:function(e){var t="string"===typeof e?JSON.parse(e):e,r=t.providerId,a=t.signInMethod,i=Object(O.d)(t,["providerId","signInMethod"]);if(!r||!a)return null;var o=new n(r,a);return o.idToken=i.idToken||void 0,o.accessToken=i.accessToken||void 0,o.secret=i.secret,o.nonce=i.nonce,o.pendingToken=i.pendingToken||null,o}}]),n}(Ge);function ut(e,t){return st.apply(this,arguments)}function st(){return(st=Object(d.a)(l.a.mark((function e(t,n){return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",J(t,"POST","/v1/accounts:sendVerificationCode",Q(t,n)));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ct(){return(ct=Object(d.a)(l.a.mark((function e(t,n){return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",ee(t,"POST","/v1/accounts:signInWithPhoneNumber",Q(t,n)));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function lt(){return(lt=Object(d.a)(l.a.mark((function e(t,n){var r;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,ee(t,"POST","/v1/accounts:signInWithPhoneNumber",Q(t,n));case 2:if(!(r=e.sent).temporaryProof){e.next=5;break}throw ae(t,"account-exists-with-different-credential",r);case 5:return e.abrupt("return",r);case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var ft=Object(g.a)({},"USER_NOT_FOUND","user-not-found");function dt(){return(dt=Object(d.a)(l.a.mark((function e(t,n){var r;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=Object.assign(Object.assign({},n),{operation:"REAUTH"}),e.abrupt("return",ee(t,"POST","/v1/accounts:signInWithPhoneNumber",Q(t,r),ft));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var pt=function(e){Object(o.a)(n,e);var t=Object(u.a)(n);function n(e){var r;return Object(p.a)(this,n),(r=t.call(this,"phone","phone")).params=e,r}return Object(h.a)(n,[{key:"_getIdTokenResponse",value:function(e){return function(e,t){return ct.apply(this,arguments)}(e,this._makeVerificationRequest())}},{key:"_linkToIdToken",value:function(e,t){return function(e,t){return lt.apply(this,arguments)}(e,Object.assign({idToken:t},this._makeVerificationRequest()))}},{key:"_getReauthenticationResolver",value:function(e){return function(e,t){return dt.apply(this,arguments)}(e,this._makeVerificationRequest())}},{key:"_makeVerificationRequest",value:function(){var e=this.params,t=e.temporaryProof,n=e.phoneNumber,r=e.verificationId,a=e.verificationCode;return t&&n?{temporaryProof:t,phoneNumber:n}:{sessionInfo:r,code:a}}},{key:"toJSON",value: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}}],[{key:"_fromVerification",value:function(e,t){return new n({verificationId:e,verificationCode:t})}},{key:"_fromTokenResponse",value:function(e,t){return new n({phoneNumber:e,temporaryProof:t})}},{key:"fromJSON",value:function(e){"string"===typeof e&&(e=JSON.parse(e));var t=e,r=t.verificationId,a=t.verificationCode,i=t.phoneNumber,o=t.temporaryProof;return a||r||i||o?new n({verificationId:r,verificationCode:a,phoneNumber:i,temporaryProof:o}):null}}]),n}(Ge);var ht=function(){function e(t){var n,r,a,i,o,u;Object(p.a)(this,e);var s=Object(k.p)(Object(k.g)(t)),c=null!==(n=s.apiKey)&&void 0!==n?n:null,l=null!==(r=s.oobCode)&&void 0!==r?r:null,f=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!==(a=s.mode)&&void 0!==a?a:null);A(c&&l&&f,"argument-error"),this.apiKey=c,this.operation=f,this.code=l,this.continueUrl=null!==(i=s.continueUrl)&&void 0!==i?i:null,this.languageCode=null!==(o=s.languageCode)&&void 0!==o?o:null,this.tenantId=null!==(u=s.tenantId)&&void 0!==u?u:null}return Object(h.a)(e,null,[{key:"parseLink",value:function(t){var n=function(e){var t=Object(k.p)(Object(k.g)(e)).link,n=t?Object(k.p)(Object(k.g)(t)).deep_link_id:null,r=Object(k.p)(Object(k.g)(e)).deep_link_id;return(r?Object(k.p)(Object(k.g)(r)).link:null)||r||n||t||e}(t);try{return new e(n)}catch(r){return null}}}]),e}();var vt=function(){function e(){Object(p.a)(this,e),this.providerId=e.PROVIDER_ID}return Object(h.a)(e,null,[{key:"credential",value:function(e,t){return rt._fromEmailAndPassword(e,t)}},{key:"credentialWithLink",value:function(e,t){var n=ht.parseLink(t);return A(n,"argument-error"),rt._fromEmailAndCode(e,n.code,n.tenantId)}}]),e}();vt.PROVIDER_ID="password",vt.EMAIL_PASSWORD_SIGN_IN_METHOD="password",vt.EMAIL_LINK_SIGN_IN_METHOD="emailLink";var mt=function(){function e(t){Object(p.a)(this,e),this.providerId=t,this.defaultLanguageCode=null,this.customParameters={}}return Object(h.a)(e,[{key:"setDefaultLanguage",value:function(e){this.defaultLanguageCode=e}},{key:"setCustomParameters",value:function(e){return this.customParameters=e,this}},{key:"getCustomParameters",value:function(){return this.customParameters}}]),e}(),yt=function(e){Object(o.a)(n,e);var t=Object(u.a)(n);function n(){var e;return Object(p.a)(this,n),(e=t.apply(this,arguments)).scopes=[],e}return Object(h.a)(n,[{key:"addScope",value:function(e){return this.scopes.includes(e)||this.scopes.push(e),this}},{key:"getScopes",value:function(){return y(this.scopes)}}]),n}(mt),bt=function(e){Object(o.a)(n,e);var t=Object(u.a)(n);function n(){return Object(p.a)(this,n),t.apply(this,arguments)}return Object(h.a)(n,[{key:"credential",value:function(e){return this._credential(Object.assign(Object.assign({},e),{nonce:e.rawNonce}))}},{key:"_credential",value:function(e){return A(e.idToken||e.accessToken,"argument-error"),ot._fromParams(Object.assign(Object.assign({},e),{providerId:this.providerId,signInMethod:this.providerId}))}}],[{key:"credentialFromJSON",value:function(e){var t="string"===typeof e?JSON.parse(e):e;return A("providerId"in t&&"signInMethod"in t,"argument-error"),ot._fromParams(t)}},{key:"credentialFromResult",value:function(e){return n.oauthCredentialFromTaggedObject(e)}},{key:"credentialFromError",value:function(e){return n.oauthCredentialFromTaggedObject(e.customData||{})}},{key:"oauthCredentialFromTaggedObject",value:function(e){var t=e._tokenResponse;if(!t)return null;var r=t.oauthIdToken,a=t.oauthAccessToken,i=t.oauthTokenSecret,o=t.pendingToken,u=t.nonce,s=t.providerId;if(!a&&!i&&!r&&!o)return null;if(!s)return null;try{return new n(s)._credential({idToken:r,accessToken:a,nonce:u,pendingToken:o})}catch(c){return null}}}]),n}(yt),gt=function(e){Object(o.a)(n,e);var t=Object(u.a)(n);function n(){return Object(p.a)(this,n),t.call(this,"facebook.com")}return Object(h.a)(n,null,[{key:"credential",value:function(e){return ot._fromParams({providerId:n.PROVIDER_ID,signInMethod:n.FACEBOOK_SIGN_IN_METHOD,accessToken:e})}},{key:"credentialFromResult",value:function(e){return n.credentialFromTaggedObject(e)}},{key:"credentialFromError",value:function(e){return n.credentialFromTaggedObject(e.customData||{})}},{key:"credentialFromTaggedObject",value:function(e){var t=e._tokenResponse;if(!t||!("oauthAccessToken"in t))return null;if(!t.oauthAccessToken)return null;try{return n.credential(t.oauthAccessToken)}catch(r){return null}}}]),n}(yt);gt.FACEBOOK_SIGN_IN_METHOD="facebook.com",gt.PROVIDER_ID="facebook.com";var kt=function(e){Object(o.a)(n,e);var t=Object(u.a)(n);function n(){var e;return Object(p.a)(this,n),(e=t.call(this,"google.com")).addScope("profile"),e}return Object(h.a)(n,null,[{key:"credential",value:function(e,t){return ot._fromParams({providerId:n.PROVIDER_ID,signInMethod:n.GOOGLE_SIGN_IN_METHOD,idToken:e,accessToken:t})}},{key:"credentialFromResult",value:function(e){return n.credentialFromTaggedObject(e)}},{key:"credentialFromError",value:function(e){return n.credentialFromTaggedObject(e.customData||{})}},{key:"credentialFromTaggedObject",value:function(e){var t=e._tokenResponse;if(!t)return null;var r=t.oauthIdToken,a=t.oauthAccessToken;if(!r&&!a)return null;try{return n.credential(r,a)}catch(i){return null}}}]),n}(yt);kt.GOOGLE_SIGN_IN_METHOD="google.com",kt.PROVIDER_ID="google.com";var wt=function(e){Object(o.a)(n,e);var t=Object(u.a)(n);function n(){return Object(p.a)(this,n),t.call(this,"github.com")}return Object(h.a)(n,null,[{key:"credential",value:function(e){return ot._fromParams({providerId:n.PROVIDER_ID,signInMethod:n.GITHUB_SIGN_IN_METHOD,accessToken:e})}},{key:"credentialFromResult",value:function(e){return n.credentialFromTaggedObject(e)}},{key:"credentialFromError",value:function(e){return n.credentialFromTaggedObject(e.customData||{})}},{key:"credentialFromTaggedObject",value:function(e){var t=e._tokenResponse;if(!t||!("oauthAccessToken"in t))return null;if(!t.oauthAccessToken)return null;try{return n.credential(t.oauthAccessToken)}catch(r){return null}}}]),n}(yt);wt.GITHUB_SIGN_IN_METHOD="github.com",wt.PROVIDER_ID="github.com";var Ot=function(e){Object(o.a)(n,e);var t=Object(u.a)(n);function n(){return Object(p.a)(this,n),t.call(this,"twitter.com")}return Object(h.a)(n,null,[{key:"credential",value:function(e,t){return ot._fromParams({providerId:n.PROVIDER_ID,signInMethod:n.TWITTER_SIGN_IN_METHOD,oauthToken:e,oauthTokenSecret:t})}},{key:"credentialFromResult",value:function(e){return n.credentialFromTaggedObject(e)}},{key:"credentialFromError",value:function(e){return n.credentialFromTaggedObject(e.customData||{})}},{key:"credentialFromTaggedObject",value:function(e){var t=e._tokenResponse;if(!t)return null;var r=t.oauthAccessToken,a=t.oauthTokenSecret;if(!r||!a)return null;try{return n.credential(r,a)}catch(i){return null}}}]),n}(yt);Ot.TWITTER_SIGN_IN_METHOD="twitter.com",Ot.PROVIDER_ID="twitter.com";var _t=function(){function e(t){Object(p.a)(this,e),this.user=t.user,this.providerId=t.providerId,this._tokenResponse=t._tokenResponse,this.operationType=t.operationType}return Object(h.a)(e,null,[{key:"_fromIdTokenResponse",value:function(){var t=Object(d.a)(l.a.mark((function t(n,r,a){var i,o,u,s,c=arguments;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=c.length>3&&void 0!==c[3]&&c[3],t.next=3,je._fromIdTokenResponse(n,a,i);case 3:return o=t.sent,u=Et(a),s=new e({user:o,providerId:u,_tokenResponse:a,operationType:r}),t.abrupt("return",s);case 7:case"end":return t.stop()}}),t)})));return function(e,n,r){return t.apply(this,arguments)}}()},{key:"_forOperation",value:function(){var t=Object(d.a)(l.a.mark((function t(n,r,a){var i;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n._updateTokensIfNecessary(a,!0);case 2:return i=Et(a),t.abrupt("return",new e({user:n,providerId:i,_tokenResponse:a,operationType:r}));case 4:case"end":return t.stop()}}),t)})));return function(e,n,r){return t.apply(this,arguments)}}()}]),e}();function Et(e){return e.providerId?e.providerId:"phoneNumber"in e?"phone":null}var xt=function(e){Object(o.a)(n,e);var t=Object(u.a)(n);function n(e,r,a,o){var u,s;return Object(p.a)(this,n),(u=t.call(this,r.code,r.message)).operationType=a,u.user=o,Object.setPrototypeOf(Object(i.a)(u),n.prototype),u.customData={appName:e.name,tenantId:null!==(s=e.tenantId)&&void 0!==s?s:void 0,_serverResponse:r.customData._serverResponse,operationType:a},u}return Object(h.a)(n,null,[{key:"_fromErrorAndOperation",value:function(e,t,r,a){return new n(e,t,r,a)}}]),n}(k.c);function St(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 xt._fromErrorAndOperation(e,n,t,r);throw n}))}function jt(e,t){return It.apply(this,arguments)}function It(){return It=Object(d.a)(l.a.mark((function e(t,n){var r,a,i=arguments;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=i.length>2&&void 0!==i[2]&&i[2],e.t0=pe,e.t1=t,e.t2=n,e.t3=t.auth,e.next=7,t.getIdToken();case 7:return e.t4=e.sent,e.t5=e.t2._linkToIdToken.call(e.t2,e.t3,e.t4),e.t6=r,e.next=12,(0,e.t0)(e.t1,e.t5,e.t6);case 12:return a=e.sent,e.abrupt("return",_t._forOperation(t,"link",a));case 14:case"end":return e.stop()}}),e)}))),It.apply(this,arguments)}function Tt(e,t){return Ct.apply(this,arguments)}function Ct(){return Ct=Object(d.a)(l.a.mark((function e(t,n){var r,a,i,o,u,s,c=arguments;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=c.length>2&&void 0!==c[2]&&c[2],a=t.auth,i="reauthenticate",e.prev=3,e.next=6,pe(t,St(a,i,n,t),r);case 6:return A((o=e.sent).idToken,a,"internal-error"),A(u=de(o.idToken),a,"internal-error"),s=u.sub,A(t.uid===s,a,"user-mismatch"),e.abrupt("return",_t._forOperation(t,i,o));case 15:throw e.prev=15,e.t0=e.catch(3),(null===e.t0||void 0===e.t0?void 0:e.t0.code)==="auth/".concat("user-not-found")&&C(a,"user-mismatch"),e.t0;case 19:case"end":return e.stop()}}),e,null,[[3,15]])}))),Ct.apply(this,arguments)}function Pt(e,t){return Rt.apply(this,arguments)}function Rt(){return Rt=Object(d.a)(l.a.mark((function e(t,n){var r,a,i,o,u=arguments;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=u.length>2&&void 0!==u[2]&&u[2],a="signIn",e.next=4,St(t,a,n);case 4:return i=e.sent,e.next=7,_t._fromIdTokenResponse(t,a,i);case 7:if(o=e.sent,r){e.next=11;break}return e.next=11,t._updateCurrentUser(o.user);case 11:return e.abrupt("return",o);case 12:case"end":return e.stop()}}),e)}))),Rt.apply(this,arguments)}function Nt(e,t,n,r){return Object(k.h)(e).onAuthStateChanged(t,n,r)}function Lt(e,t){return J(e,"POST","/v2/accounts/mfaEnrollment:start",Q(e,t))}new WeakMap;var At="__sak",Mt=function(){function e(t,n){Object(p.a)(this,e),this.storageRetriever=t,this.type=n}return Object(h.a)(e,[{key:"_isAvailable",value:function(){try{return this.storage?(this.storage.setItem(At,"1"),this.storage.removeItem(At),Promise.resolve(!0)):Promise.resolve(!1)}catch(e){return Promise.resolve(!1)}}},{key:"_set",value:function(e,t){return this.storage.setItem(e,JSON.stringify(t)),Promise.resolve()}},{key:"_get",value:function(e){var t=this.storage.getItem(e);return Promise.resolve(t?JSON.parse(t):null)}},{key:"_remove",value:function(e){return this.storage.removeItem(e),Promise.resolve()}},{key:"storage",get:function(){return this.storageRetriever()}}]),e}();var Dt=function(e){Object(o.a)(n,e);var t=Object(u.a)(n);function n(){var e;return Object(p.a)(this,n),(e=t.call(this,(function(){return window.localStorage}),"LOCAL")).boundEventHandler=function(t,n){return e.onStorageEvent(t,n)},e.listeners={},e.localCache={},e.pollTimer=null,e.safariLocalStorageNotSynced=function(){var e=Object(k.i)();return Le(e)||Fe(e)}()&&function(){try{return!(!window||window===window.top)}catch(e){return!1}}(),e.fallbackToPolling=He(),e._shouldAllowMigration=!0,e}return Object(h.a)(n,[{key:"forAllChangedKeys",value:function(e){for(var t=0,n=Object.keys(this.listeners);t1&&void 0!==arguments[1]&&arguments[1];if(e.key){var r=e.key;if(n?this.detachListener():this.stopPolling(),this.safariLocalStorageNotSynced){var a=this.storage.getItem(r);if(e.newValue!==a)null!==e.newValue?this.storage.setItem(r,e.newValue):this.storage.removeItem(r);else if(this.localCache[r]===e.newValue&&!n)return}var i=function(){var e=t.storage.getItem(r);(n||t.localCache[r]!==e)&&t.notifyListeners(r,e)},o=this.storage.getItem(r);We()&&o!==e.newValue&&e.newValue!==e.oldValue?setTimeout(i,10):i()}else this.forAllChangedKeys((function(e,n,r){t.notifyListeners(e,r)}))}},{key:"notifyListeners",value:function(e,t){this.localCache[e]=t;var n=this.listeners[e];if(n)for(var r=0,a=Array.from(n);r0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,n="",r=0;r2&&void 0!==s[2]?s[2]:50,a="undefined"!==typeof MessageChannel?new MessageChannel:null){e.next=4;break}throw new Error("connection_unavailable");case 4:return e.abrupt("return",new Promise((function(e,s){var c=Ht("",20);a.port1.start();var l=setTimeout((function(){s(new Error("unsupported_event"))}),r);o={messageChannel:a,onMessage:function(t){var n=t;if(n.data.eventId===c)switch(n.data.status){case"ack":clearTimeout(l),i=setTimeout((function(){s(new Error("timeout"))}),3e3);break;case"done":clearTimeout(i),e(n.data.response);break;default:clearTimeout(l),clearTimeout(i),s(new Error("invalid_response"))}}},u.handlers.add(o),a.port1.addEventListener("message",o.onMessage),u.target.postMessage({eventType:t,eventId:c,data:n},[a.port2])})).finally((function(){o&&u.removeMessageHandler(o)})));case 5:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()}]),e}();function $t(){return window}function qt(){return"undefined"!==typeof $t().WorkerGlobalScope&&"function"===typeof $t().importScripts}function Kt(){return Gt.apply(this,arguments)}function Gt(){return(Gt=Object(d.a)(l.a.mark((function e(){var t;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null===navigator||void 0===navigator?void 0:navigator.serviceWorker){e.next=2;break}return e.abrupt("return",null);case 2:return e.prev=2,e.next=5,navigator.serviceWorker.ready;case 5:return t=e.sent,e.abrupt("return",t.active);case 9:return e.prev=9,e.t0=e.catch(2),e.abrupt("return",null);case 12:case"end":return e.stop()}}),e,null,[[2,9]])})))).apply(this,arguments)}function Qt(){var e;return(null===(e=null===navigator||void 0===navigator?void 0:navigator.serviceWorker)||void 0===e?void 0:e.controller)||null}var Jt="firebaseLocalStorageDb",Yt="firebaseLocalStorage",Xt="fbase_key",Zt=function(){function e(t){Object(p.a)(this,e),this.request=t}return Object(h.a)(e,[{key:"toPromise",value: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 en(e,t){return e.transaction([Yt],t?"readwrite":"readonly").objectStore(Yt)}function tn(){var e=indexedDB.deleteDatabase(Jt);return new Zt(e).toPromise()}function nn(){var e=indexedDB.open(Jt,1);return new Promise((function(t,n){e.addEventListener("error",(function(){n(e.error)})),e.addEventListener("upgradeneeded",(function(){var t=e.result;try{t.createObjectStore(Yt,{keyPath:Xt})}catch(r){n(r)}})),e.addEventListener("success",Object(d.a)(l.a.mark((function n(){var r;return l.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if((r=e.result).objectStoreNames.contains(Yt)){n.next=12;break}return r.close(),n.next=5,tn();case 5:return n.t0=t,n.next=8,nn();case 8:n.t1=n.sent,(0,n.t0)(n.t1),n.next=13;break;case 12:t(r);case 13:case"end":return n.stop()}}),n)}))))}))}function rn(e,t,n){return an.apply(this,arguments)}function an(){return(an=Object(d.a)(l.a.mark((function e(t,n,r){var a,i;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=en(t,!0).put((a={},Object(g.a)(a,Xt,n),Object(g.a)(a,"value",r),a)),e.abrupt("return",new Zt(i).toPromise());case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function on(e,t){return un.apply(this,arguments)}function un(){return(un=Object(d.a)(l.a.mark((function e(t,n){var r,a;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=en(t,!1).get(n),e.next=3,new Zt(r).toPromise();case 3:return a=e.sent,e.abrupt("return",void 0===a?null:a.value);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function sn(e,t){var n=en(e,!0).delete(t);return new Zt(n).toPromise()}var cn=function(){function e(){Object(p.a)(this,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 Object(h.a)(e,[{key:"_openDb",value:function(){var e=Object(d.a)(l.a.mark((function e(){return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.db){e.next=2;break}return e.abrupt("return",this.db);case 2:return e.next=4,nn();case 4:return this.db=e.sent,e.abrupt("return",this.db);case 6:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"_withRetries",value:function(){var e=Object(d.a)(l.a.mark((function e(t){var n,r;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=0;case 1:return e.prev=2,e.next=5,this._openDb();case 5:return r=e.sent,e.next=8,t(r);case 8:return e.abrupt("return",e.sent);case 11:if(e.prev=11,e.t0=e.catch(2),!(n++>3)){e.next=15;break}throw e.t0;case 15:this.db&&(this.db.close(),this.db=void 0);case 16:e.next=1;break;case 18:case"end":return e.stop()}}),e,this,[[2,11]])})));return function(t){return e.apply(this,arguments)}}()},{key:"initializeServiceWorkerMessaging",value:function(){var e=Object(d.a)(l.a.mark((function e(){return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",qt()?this.initializeReceiver():this.initializeSender());case 1:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"initializeReceiver",value:function(){var e=Object(d.a)(l.a.mark((function e(){var t=this;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.receiver=Wt._getInstance(qt()?self:null),this.receiver._subscribe("keyChanged",function(){var e=Object(d.a)(l.a.mark((function e(n,r){var a;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t._poll();case 2:return a=e.sent,e.abrupt("return",{keyProcessed:a.includes(r.key)});case 4:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()),this.receiver._subscribe("ping",function(){var e=Object(d.a)(l.a.mark((function e(t,n){return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",["keyChanged"]);case 1:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}());case 3:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"initializeSender",value:function(){var e=Object(d.a)(l.a.mark((function e(){var t,n,r;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Kt();case 2:if(this.activeServiceWorker=e.sent,this.activeServiceWorker){e.next=5;break}return e.abrupt("return");case 5:return this.sender=new Bt(this.activeServiceWorker),e.next=8,this.sender._send("ping",{},800);case 8:if(r=e.sent){e.next=11;break}return e.abrupt("return");case 11:(null===(t=r[0])||void 0===t?void 0:t.fulfilled)&&(null===(n=r[0])||void 0===n?void 0:n.value.includes("keyChanged"))&&(this.serviceWorkerReceiverAvailable=!0);case 12:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"notifyServiceWorker",value:function(){var e=Object(d.a)(l.a.mark((function e(t){return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.sender&&this.activeServiceWorker&&Qt()===this.activeServiceWorker){e.next=2;break}return e.abrupt("return");case 2:return e.prev=2,e.next=5,this.sender._send("keyChanged",{key:t},this.serviceWorkerReceiverAvailable?800:50);case 5:e.next=9;break;case 7:e.prev=7,e.t0=e.catch(2);case 9:case"end":return e.stop()}}),e,this,[[2,7]])})));return function(t){return e.apply(this,arguments)}}()},{key:"_isAvailable",value:function(){var e=Object(d.a)(l.a.mark((function e(){var t;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,indexedDB){e.next=3;break}return e.abrupt("return",!1);case 3:return e.next=5,nn();case 5:return t=e.sent,e.next=8,rn(t,At,"1");case 8:return e.next=10,sn(t,At);case 10:return e.abrupt("return",!0);case 13:e.prev=13,e.t0=e.catch(0);case 15:return e.abrupt("return",!1);case 16:case"end":return e.stop()}}),e,null,[[0,13]])})));return function(){return e.apply(this,arguments)}}()},{key:"_withPendingWrite",value:function(){var e=Object(d.a)(l.a.mark((function e(t){return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.pendingWrites++,e.prev=1,e.next=4,t();case 4:return e.prev=4,this.pendingWrites--,e.finish(4);case 7:case"end":return e.stop()}}),e,this,[[1,,4,7]])})));return function(t){return e.apply(this,arguments)}}()},{key:"_set",value:function(){var e=Object(d.a)(l.a.mark((function e(t,n){var r=this;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this._withPendingWrite(Object(d.a)(l.a.mark((function e(){return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r._withRetries((function(e){return rn(e,t,n)}));case 2:return r.localCache[t]=n,e.abrupt("return",r.notifyServiceWorker(t));case 4:case"end":return e.stop()}}),e)})))));case 1:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"_get",value:function(){var e=Object(d.a)(l.a.mark((function e(t){var n;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._withRetries((function(e){return on(e,t)}));case 2:return n=e.sent,this.localCache[t]=n,e.abrupt("return",n);case 5:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"_remove",value:function(){var e=Object(d.a)(l.a.mark((function e(t){var n=this;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this._withPendingWrite(Object(d.a)(l.a.mark((function e(){return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n._withRetries((function(e){return sn(e,t)}));case 2:return delete n.localCache[t],e.abrupt("return",n.notifyServiceWorker(t));case 4:case"end":return e.stop()}}),e)})))));case 1:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"_poll",value:function(){var e=Object(d.a)(l.a.mark((function e(){var t,n,r,a,i,o,u,c,f,d,p;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._withRetries((function(e){var t=en(e,!1).getAll();return new Zt(t).toPromise()}));case 2:if(t=e.sent){e.next=5;break}return e.abrupt("return",[]);case 5:if(0===this.pendingWrites){e.next=7;break}return e.abrupt("return",[]);case 7:n=[],r=new Set,a=Object(s.a)(t);try{for(a.s();!(i=a.n()).done;)o=i.value,u=o.fbase_key,c=o.value,r.add(u),JSON.stringify(this.localCache[u])!==JSON.stringify(c)&&(this.notifyListeners(u,c),n.push(u))}catch(l){a.e(l)}finally{a.f()}for(f=0,d=Object.keys(this.localCache);f4&&void 0!==arguments[4]&&arguments[4];Object(p.a)(this,e),this.auth=t,this.resolver=r,this.user=a,this.bypassAuthState=i,this.pendingPromise=null,this.eventManager=null,this.filter=Array.isArray(n)?n:[n]}return Object(h.a)(e,[{key:"execute",value:function(){var e=this;return new Promise(function(){var t=Object(d.a)(l.a.mark((function t(n,r){return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e.pendingPromise={resolve:n,reject:r},t.prev=1,t.next=4,e.resolver._initialize(e.auth);case 4:return e.eventManager=t.sent,t.next=7,e.onExecution();case 7:e.eventManager.registerConsumer(e),t.next=13;break;case 10:t.prev=10,t.t0=t.catch(1),e.reject(t.t0);case 13:case"end":return t.stop()}}),t,null,[[1,10]])})));return function(e,n){return t.apply(this,arguments)}}())}},{key:"onAuthEvent",value:function(){var e=Object(d.a)(l.a.mark((function e(t){var n,r,a,i,o,u,s;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.urlResponse,r=t.sessionId,a=t.postBody,i=t.tenantId,o=t.error,u=t.type,!o){e.next=4;break}return this.reject(o),e.abrupt("return");case 4:return s={auth:this.auth,requestUri:n,sessionId:r,tenantId:i||void 0,postBody:a||void 0,user:this.user,bypassAuthState:this.bypassAuthState},e.prev=5,e.t0=this,e.next=9,this.getIdpTask(u)(s);case 9:e.t1=e.sent,e.t0.resolve.call(e.t0,e.t1),e.next=16;break;case 13:e.prev=13,e.t2=e.catch(5),this.reject(e.t2);case 16:case"end":return e.stop()}}),e,this,[[5,13]])})));return function(t){return e.apply(this,arguments)}}()},{key:"onError",value:function(e){this.reject(e)}},{key:"getIdpTask",value:function(e){switch(e){case"signInViaPopup":case"signInViaRedirect":return kn;case"linkViaPopup":case"linkViaRedirect":return On;case"reauthViaPopup":case"reauthViaRedirect":return wn;default:C(this.auth,"internal-error")}}},{key:"resolve",value:function(e){D(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.resolve(e),this.unregisterAndCleanUp()}},{key:"reject",value:function(e){D(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.reject(e),this.unregisterAndCleanUp()}},{key:"unregisterAndCleanUp",value:function(){this.eventManager&&this.eventManager.unregisterConsumer(this),this.pendingPromise=null,this.cleanUp()}}]),e}(),xn=new B(2e3,1e4);function Sn(e,t,n){return jn.apply(this,arguments)}function jn(){return(jn=Object(d.a)(l.a.mark((function e(t,n,r){var a,i,o;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=qe(t),N(t,n,mt),i=bn(a,r),o=new In(a,"signInViaPopup",n,i),e.abrupt("return",o.executeNotNull());case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var In=function(e){Object(o.a)(n,e);var t=Object(u.a)(n);function n(e,r,a,o,u){var s;return Object(p.a)(this,n),(s=t.call(this,e,r,o,u)).provider=a,s.authWindow=null,s.pollId=null,n.currentPopupAction&&n.currentPopupAction.cancel(),n.currentPopupAction=Object(i.a)(s),s}return Object(h.a)(n,[{key:"executeNotNull",value:function(){var e=Object(d.a)(l.a.mark((function e(){var t;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.execute();case 2:return A(t=e.sent,this.auth,"internal-error"),e.abrupt("return",t);case 5:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"onExecution",value:function(){var e=Object(d.a)(l.a.mark((function e(){var t,n=this;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return D(1===this.filter.length,"Popup operations only handle one event"),t=Ht(),e.next=4,this.resolver._openPopup(this.auth,this.provider,this.filter[0],t);case 4:this.authWindow=e.sent,this.authWindow.associatedEvent=t,this.resolver._originValidation(this.auth).catch((function(e){n.reject(e)})),this.resolver._isIframeWebStorageSupported(this.auth,(function(e){e||n.reject(P(n.auth,"web-storage-unsupported"))})),this.pollUserCancellation();case 9:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"eventId",get:function(){var e;return(null===(e=this.authWindow)||void 0===e?void 0:e.associatedEvent)||null}},{key:"cancel",value:function(){this.reject(P(this.auth,"cancelled-popup-request"))}},{key:"cleanUp",value:function(){this.authWindow&&this.authWindow.close(),this.pollId&&window.clearTimeout(this.pollId),this.authWindow=null,this.pollId=null,n.currentPopupAction=null}},{key:"pollUserCancellation",value:function(){var e=this;!function t(){var n,r;(null===(r=null===(n=e.authWindow)||void 0===n?void 0:n.window)||void 0===r?void 0:r.closed)?e.pollId=window.setTimeout((function(){e.pollId=null,e.reject(P(e.auth,"popup-closed-by-user"))}),2e3):e.pollId=window.setTimeout(t,xn.get())}()}}]),n}(En);In.currentPopupAction=null;var Tn=new Map,Cn=function(e){Object(o.a)(n,e);var t=Object(u.a)(n);function n(e,r){var a,i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return Object(p.a)(this,n),(a=t.call(this,e,["signInViaRedirect","linkViaRedirect","reauthViaRedirect","unknown"],r,void 0,i)).eventId=null,a}return Object(h.a)(n,[{key:"execute",value:function(){var e=Object(d.a)(l.a.mark((function e(){var t,i;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=Tn.get(this.auth._key())){e.next=21;break}return e.prev=2,e.next=5,Pn(this.resolver,this.auth);case 5:if(!e.sent){e.next=12;break}return e.next=9,a(Object(r.a)(n.prototype),"execute",this).call(this);case 9:e.t0=e.sent,e.next=13;break;case 12:e.t0=null;case 13:i=e.t0,t=function(){return Promise.resolve(i)},e.next=20;break;case 17:e.prev=17,e.t1=e.catch(2),t=function(){return Promise.reject(e.t1)};case 20:Tn.set(this.auth._key(),t);case 21:return this.bypassAuthState||Tn.set(this.auth._key(),(function(){return Promise.resolve(null)})),e.abrupt("return",t());case 23:case"end":return e.stop()}}),e,this,[[2,17]])})));return function(){return e.apply(this,arguments)}}()},{key:"onAuthEvent",value:function(){var e=Object(d.a)(l.a.mark((function e(t){var i;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("signInViaRedirect"!==t.type){e.next=4;break}return e.abrupt("return",a(Object(r.a)(n.prototype),"onAuthEvent",this).call(this,t));case 4:if("unknown"!==t.type){e.next=7;break}return this.resolve(null),e.abrupt("return");case 7:if(!t.eventId){e.next=17;break}return e.next=10,this.auth._redirectUserForId(t.eventId);case 10:if(!(i=e.sent)){e.next=16;break}return this.user=i,e.abrupt("return",a(Object(r.a)(n.prototype),"onAuthEvent",this).call(this,t));case 16:this.resolve(null);case 17:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"onExecution",value:function(){var e=Object(d.a)(l.a.mark((function e(){return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()},{key:"cleanUp",value:function(){}}]),n}(En);function Pn(e,t){return Rn.apply(this,arguments)}function Rn(){return(Rn=Object(d.a)(l.a.mark((function e(t,n){var r,a,i;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=Ln(n),a=Nn(t),e.next=4,a._isAvailable();case 4:if(e.sent){e.next=6;break}return e.abrupt("return",!1);case 6:return e.next=8,a._get(r);case 8:return e.t0=e.sent,i="true"===e.t0,e.next=12,a._remove(r);case 12:return e.abrupt("return",i);case 13:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Nn(e){return z(e._redirectPersistence)}function Ln(e){return Ce("pendingRedirect",e.config.apiKey,e.name)}function An(e,t){return Mn.apply(this,arguments)}function Mn(){return Mn=Object(d.a)(l.a.mark((function e(t,n){var r,a,i,o,u,s=arguments;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=s.length>2&&void 0!==s[2]&&s[2],a=qe(t),i=bn(a,n),o=new Cn(a,i,r),e.next=6,o.execute();case 6:if(!(u=e.sent)||r){e.next=13;break}return delete u.user._redirectEventId,e.next=11,a._persistUserIfCurrent(u.user);case 11:return e.next=13,a._setRedirectUser(null,n);case 13:return e.abrupt("return",u);case 14:case"end":return e.stop()}}),e)}))),Mn.apply(this,arguments)}var Dn=function(){function e(t){Object(p.a)(this,e),this.auth=t,this.cachedEventUids=new Set,this.consumers=new Set,this.queuedRedirectEvent=null,this.hasHandledPotentialRedirect=!1,this.lastProcessedEventTime=Date.now()}return Object(h.a)(e,[{key:"registerConsumer",value: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)}},{key:"unregisterConsumer",value:function(e){this.consumers.delete(e)}},{key:"onEvent",value: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 zn(e);default:return!1}}(e)||(this.hasHandledPotentialRedirect=!0,n||(this.queuedRedirectEvent=e,n=!0)),n}},{key:"sendToConsumer",value:function(e,t){var n;if(e.error&&!zn(e)){var r=(null===(n=e.error.code)||void 0===n?void 0:n.split("auth/")[1])||"internal-error";t.onError(P(this.auth,r))}else t.onAuthEvent(e)}},{key:"isEventForConsumer",value:function(e,t){var n=null===t.eventId||!!e.eventId&&e.eventId===t.eventId;return t.filter.includes(e.type)&&n}},{key:"hasEventBeenHandled",value:function(e){return Date.now()-this.lastProcessedEventTime>=6e5&&this.cachedEventUids.clear(),this.cachedEventUids.has(Un(e))}},{key:"saveEventToCache",value:function(e){this.cachedEventUids.add(Un(e)),this.lastProcessedEventTime=Date.now()}}]),e}();function Un(e){return[e.type,e.eventId,e.sessionId,e.tenantId].filter((function(e){return e})).join("-")}function zn(e){var t=e.type,n=e.error;return"unknown"===t&&(null===n||void 0===n?void 0:n.code)==="auth/".concat("no-auth-event")}function Fn(e){return Vn.apply(this,arguments)}function Vn(){return Vn=Object(d.a)(l.a.mark((function e(t){var n,r=arguments;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=r.length>1&&void 0!==r[1]?r[1]:{},e.abrupt("return",J(t,"GET","/v1/projects",n));case 2:case"end":return e.stop()}}),e)}))),Vn.apply(this,arguments)}var Wn=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,Hn=/^https?/;function Bn(){return(Bn=Object(d.a)(l.a.mark((function e(t){var n,r,a,i,o;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t.config.emulator){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,Fn(t);case 4:n=e.sent,r=n.authorizedDomains,a=Object(s.a)(r),e.prev=7,a.s();case 9:if((i=a.n()).done){e.next=20;break}if(o=i.value,e.prev=11,!$n(o)){e.next=14;break}return e.abrupt("return");case 14:e.next=18;break;case 16:e.prev=16,e.t0=e.catch(11);case 18:e.next=9;break;case 20:e.next=25;break;case 22:e.prev=22,e.t1=e.catch(7),a.e(e.t1);case 25:return e.prev=25,a.f(),e.finish(25);case 28:C(t,"unauthorized-domain");case 29:case"end":return e.stop()}}),e,null,[[7,22,25,28],[11,16]])})))).apply(this,arguments)}function $n(e){var t=V(),n=new URL(t),r=n.protocol,a=n.hostname;if(e.startsWith("chrome-extension://")){var i=new URL(e);return""===i.hostname&&""===a?"chrome-extension:"===r&&e.replace("chrome-extension://","")===t.replace("chrome-extension://",""):"chrome-extension:"===r&&i.hostname===a}if(!Hn.test(r))return!1;if(Wn.test(e))return a===e;var o=e.replace(/\./g,"\\.");return new RegExp("^(.+\\."+o+"|"+o+")$","i").test(a)}var qn=new B(3e4,6e4);function Kn(){var e=$t().___jsl;if(null===e||void 0===e?void 0:e.H)for(var t=0,n=Object.keys(e.H);t3&&void 0!==arguments[3]?arguments[3]:500,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:600,i=Math.max((window.screen.availHeight-a)/2,0).toString(),o=Math.max((window.screen.availWidth-r)/2,0).toString(),u="",s=Object.assign(Object.assign({},nr),{width:r.toString(),height:a.toString(),top:i,left:o}),c=Object(k.i)().toLowerCase();n&&(u=Ae(c)?rr:n),Ne(c)&&(t=t||ar,s.scrollbars="yes");var l=Object.entries(s).reduce((function(e,t){var n=Object(f.a)(t,2),r=n[0],a=n[1];return"".concat(e).concat(r,"=").concat(a,",")}),"");if(Ve(c)&&"_self"!==u)return ur(t||"",u),new ir(null);var d=window.open(t||"",u,l);A(d,e,"popup-blocked");try{d.focus()}catch(p){}return new ir(d)}function ur(e,t){var n=document.createElement("a");n.href=e,n.target=t;var r=document.createEvent("MouseEvent");r.initMouseEvent("click",!0,!0,window,1,0,0,0,0,!1,!1,!1,!1,1,null),n.dispatchEvent(r)}var sr="__/auth/handler",cr="emulator/auth/handler";function lr(e,t,n,r,a,i){A(e.config.authDomain,e,"auth-domain-config-required"),A(e.config.apiKey,e,"invalid-api-key");var o={apiKey:e.config.apiKey,appName:e.name,authType:n,redirectUrl:r,v:w.a,eventId:a};if(t instanceof mt){t.setDefaultLanguage(e.languageCode),o.providerId=t.providerId||"",Object(k.k)(t.getCustomParameters())||(o.customParameters=JSON.stringify(t.getCustomParameters()));for(var u=0,s=Object.entries(i||{});u0&&(o.scopes=p.join(","))}e.tenantId&&(o.tid=e.tenantId);for(var h=o,v=0,m=Object.keys(h);v0?this.auth._startProactiveRefresh():this.auth._stopProactiveRefresh()}}]),e}();function gr(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Object(w.d)(),t=Object(w.b)(e,"auth");return t.isInitialized()?t.getImmediate():F(e,{popupRedirectResolver:pr,persistence:[ln,Ut,Ft]})}vr="Browser",Object(w.c)(new E.a("auth",(function(e,t){var n=t.options,r=e.getProvider("app").getImmediate(),a=r.options,i=a.apiKey,o=a.authDomain;return function(e){A(i&&!i.includes(":"),"invalid-api-key",{appName:e.name}),A(!(null===o||void 0===o?void 0:o.includes(":")),"argument-error",{appName:e.name});var t={apiKey:i,authDomain:o,clientPlatform:vr,apiHost:"identitytoolkit.googleapis.com",tokenApiHost:"securetoken.googleapis.com",apiScheme:"https",sdkClientVersion:Be(vr)},r=new $e(e,t);return function(e,t){var n=(null===t||void 0===t?void 0:t.persistence)||[],r=(Array.isArray(n)?n:[n]).map(z);(null===t||void 0===t?void 0:t.errorMap)&&e._updateErrorMap(t.errorMap),e._initializeWithPersistence(r,null===t||void 0===t?void 0:t.popupRedirectResolver)}(r,n),r}(r)}),"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((function(e,t,n){e.getProvider("auth-internal").initialize()}))),Object(w.c)(new E.a("auth-internal",(function(e){return function(e){return new br(e)}(qe(e.getProvider("auth").getImmediate()))}),"PRIVATE").setInstantiationMode("EXPLICIT")),Object(w.f)(mr,yr,function(e){switch(e){case"Node":return"node";case"ReactNative":return"rn";case"Worker":return"webworker";case"Cordova":return"cordova";default:return}}(vr)),Object(w.f)(mr,yr,"esm2017")},function(e,t,n){"use strict";function r(e,t){return r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},r(e,t)}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(28);function a(e,t){if(e){if("string"===typeof e)return Object(r.a)(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Object(r.a)(e,t):void 0}}},function(e,t,n){e.exports=n(48)()},function(e,t,n){"use strict";function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n