!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).firebase=t()}(this,function(){"use strict";var r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)};var o=function(){return(o=Object.assign||function(e){for(var t,r=1,n=arguments.length;ra[0]&&t[1]=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function u(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),a=[];try{for(;(void 0===t||0"})):"Error",e=this.serviceName+": "+e+" ("+o+").";return new p(o,e,i)},y);function y(e,t,r){this.service=e,this.serviceName=t,this.errors=r}var g=/\{\$([^}]+)}/g;function b(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function w(e,t){t=new E(e,t);return t.subscribe.bind(t)}var E=(O.prototype.next=function(t){this.forEachObserver(function(e){e.next(t)})},O.prototype.error=function(t){this.forEachObserver(function(e){e.error(t)}),this.close(t)},O.prototype.complete=function(){this.forEachObserver(function(e){e.complete()}),this.close()},O.prototype.subscribe=function(e,t,r){var n,i=this;if(void 0===e&&void 0===t&&void 0===r)throw new Error("Missing Observer.");void 0===(n=function(e,t){if("object"!=typeof e||null===e)return!1;for(var r=0,n=t;r=(null!=o?o:e.logLevel)&&a({level:j[t].toLowerCase(),message:i,args:r,type:e.name})}}(r[e])}}(e,t)},apps:null,SDK_VERSION:J,INTERNAL:{registerComponent:o,removeApp:function(e){delete c[e]},components:u,useAsService:function(e,t){if("serverAuth"===t)return null;return t}}};function f(e){if(!b(c,e=e||W))throw U.create("no-app",{appName:e});return c[e]}function o(r){var t,e,n,i=r.name;if(u.has(i))return $.debug("There were multiple attempts to register component "+i+"."),"PUBLIC"===r.type?p[i]:null;u.set(i,r),"PUBLIC"===r.type&&(n=function(e){if(void 0===e&&(e=f()),"function"!=typeof e[i])throw U.create("invalid-app-argument",{appName:i});return e[i]()},void 0!==r.serviceProps&&d(n,r.serviceProps),p[i]=n,l.prototype[i]=function(){for(var e=[],t=0;t