((e,t)=>{"object"==typeof exports&&"undefined"!=typeof module?t(require("@firebase/app")):"function"==typeof define&&define.amd?define(["@firebase/app"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).firebase)})(this,function(mt){try{!function(){function R(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var F=R(mt),M=function(e,t){return(M=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])}))(e,t)},c=function(){return(c=Object.assign||function(e){for(var t,n=1,r=arguments.length;ns[0]&&t[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 H(){for(var e=[],t=0;t{var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||0"})):"Error",e=this.serviceName+": "+e+" ("+o+").";return new a(o,e,i)};var z=J;function J(e,t,n){this.service=e,this.serviceName=t,this.errors=n}var Y=/\{\$([^}]+)}/g,X=1e3,Z=2,Q=144e5,ee=.5;function te(e,t,n){void 0===t&&(t=X),void 0===n&&(n=Z);n=t*Math.pow(n,e),e=Math.round(ee*n*(Math.random()-.5)*2);return Math.min(Q,n+e)}n.prototype.setInstantiationMode=function(e){return this.instantiationMode=e,this},n.prototype.setMultipleInstances=function(e){return this.multipleInstances=e,this},n.prototype.setServiceProps=function(e){return this.serviceProps=e,this};var t=n;function n(e,t,n){this.name=e,this.instanceFactory=t,this.type=n,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY"}function ne(n){return new Promise(function(e,t){n.onsuccess=function(){e(n.result)},n.onerror=function(){t(n.error)}})}function re(n,r,i){var o,e=new Promise(function(e,t){ne(o=n[r].apply(n,i)).then(e,t)});return e.request=o,e}function i(e,n,t){t.forEach(function(t){Object.defineProperty(e.prototype,t,{get:function(){return this[n][t]},set:function(e){this[n][t]=e}})})}function ie(t,n,r,e){e.forEach(function(e){e in r.prototype&&(t.prototype[e]=function(){return re(this[n],e,arguments)})})}function o(t,n,r,e){e.forEach(function(e){e in r.prototype&&(t.prototype[e]=function(){return this[n][e].apply(this[n],arguments)})})}function oe(e,r,t,n){n.forEach(function(n){n in t.prototype&&(e.prototype[n]=function(){return e=this[r],(t=re(e,n,arguments)).then(function(e){if(e)return new u(e,t.request)});var e,t})})}function s(e){this._index=e}function u(e,t){this._cursor=e,this._request=t}function l(e){this._store=e}function f(n){this._tx=n,this.complete=new Promise(function(e,t){n.oncomplete=function(){e()},n.onerror=function(){t(n.error)},n.onabort=function(){t(n.error)}})}function d(e,t,n){this._db=e,this.oldVersion=t,this.transaction=new f(n)}function p(e){this._db=e}i(s,"_index",["name","keyPath","multiEntry","unique"]),ie(s,"_index",IDBIndex,["get","getKey","getAll","getAllKeys","count"]),oe(s,"_index",IDBIndex,["openCursor","openKeyCursor"]),i(u,"_cursor",["direction","key","primaryKey","value"]),ie(u,"_cursor",IDBCursor,["update","delete"]),["advance","continue","continuePrimaryKey"].forEach(function(n){n in IDBCursor.prototype&&(u.prototype[n]=function(){var t=this,e=arguments;return Promise.resolve().then(function(){return t._cursor[n].apply(t._cursor,e),ne(t._request).then(function(e){if(e)return new u(e,t._request)})})})}),l.prototype.createIndex=function(){return new s(this._store.createIndex.apply(this._store,arguments))},l.prototype.index=function(){return new s(this._store.index.apply(this._store,arguments))},i(l,"_store",["name","keyPath","indexNames","autoIncrement"]),ie(l,"_store",IDBObjectStore,["put","add","delete","clear","get","getAll","getKey","getAllKeys","count"]),oe(l,"_store",IDBObjectStore,["openCursor","openKeyCursor"]),o(l,"_store",IDBObjectStore,["deleteIndex"]),f.prototype.objectStore=function(){return new l(this._tx.objectStore.apply(this._tx,arguments))},i(f,"_tx",["objectStoreNames","mode"]),o(f,"_tx",IDBTransaction,["abort"]),d.prototype.createObjectStore=function(){return new l(this._db.createObjectStore.apply(this._db,arguments))},i(d,"_db",["name","version","objectStoreNames"]),o(d,"_db",IDBDatabase,["deleteObjectStore","close"]),p.prototype.transaction=function(){return new f(this._db.transaction.apply(this._db,arguments))},i(p,"_db",["name","version","objectStoreNames"]),o(p,"_db",IDBDatabase,["close"]),["openCursor","openKeyCursor"].forEach(function(i){[l,s].forEach(function(e){i in e.prototype&&(e.prototype[i.replace("open","iterate")]=function(){n=arguments;var e=Array.prototype.slice.call(n),t=e[e.length-1],n=this._store||this._index,r=n[i].apply(n,e.slice(0,-1));r.onsuccess=function(){t(r.result)}})})}),[s,l].forEach(function(e){e.prototype.getAll||(e.prototype.getAll=function(e,n){var r=this,i=[];return new Promise(function(t){r.iterateCursor(e,function(e){e&&(i.push(e.value),void 0===n||i.length!=n)?e.continue():t(i)})})})});var ae="0.4.19",se=1e4,ue="w:"+ae,ce="FIS_v2",le="https://firebaseinstallations.googleapis.com/v1",fe=36e5,g=((C={})["missing-app-config-values"]='Missing App configuration value: "{$valueName}"',C["not-registered"]="Firebase Installation is not registered.",C["installation-not-found"]="Firebase Installation not found.",C["request-failed"]='{$requestName} request failed with error "{$serverCode} {$serverStatus}: {$serverMessage}"',C["app-offline"]="Could not process request. Application offline.",C["delete-pending-registration"]="Can't delete installation while there is a pending registration request.",C),m=new z("installations","Installations",g);function de(e){return e instanceof a&&e.code.includes("request-failed")}function pe(e){e=e.projectId;return le+"/projects/"+e+"/installations"}function he(e){return{token:e.token,requestStatus:2,expiresIn:(e=e.expiresIn,Number(e.replace("s","000"))),creationTime:Date.now()}}function ve(n,r){return h(this,void 0,void 0,function(){var t;return v(this,function(e){switch(e.label){case 0:return[4,r.json()];case 1:return t=e.sent(),t=t.error,[2,m.create("request-failed",{requestName:n,serverCode:t.code,serverMessage:t.message,serverStatus:t.status})]}})})}function ge(e){e=e.apiKey;return new Headers({"Content-Type":"application/json",Accept:"application/json","x-goog-api-key":e})}function me(e,t){t=t.refreshToken,e=ge(e);return e.append("Authorization",ce+" "+t),e}function ye(n){return h(this,void 0,void 0,function(){var t;return v(this,function(e){switch(e.label){case 0:return[4,n()];case 1:return 500<=(t=e.sent()).status&&t.status<600?[2,n()]:[2,t]}})})}function be(t){return new Promise(function(e){setTimeout(e,t)})}var we=/^[cdef][\w-]{21}$/,Ie="";function _e(){try{var e=new Uint8Array(17);(self.crypto||self.msCrypto).getRandomValues(e),e[0]=112+e[0]%16;e=(t=e,btoa(String.fromCharCode.apply(String,H(t))).replace(/\+/g,"-").replace(/\//g,"_")).substr(0,22);return we.test(e)?e:Ie}catch(e){return Ie}var t}function y(e){return e.appName+"!"+e.appId}var b=new Map;function Ee(e,t){e=y(e);Te(e,t);var n=Se();n&&n.postMessage({key:e,fid:t});Ce()}function Te(e,t){var n,r,i=b.get(e);if(i)try{for(var o=B(i),a=o.next();!a.done;a=o.next())(0,a.value)(t)}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}}var w=null;function Se(){return!w&&"BroadcastChannel"in self&&((w=new BroadcastChannel("[Firebase] FID Change")).onmessage=function(e){Te(e.data.key,e.data.fid)}),w}function Ce(){0===b.size&&w&&(w.close(),w=null)}var I,Oe="firebase-installations-database",Ne=1,_="firebase-installations-store",De=null;function Pe(){var e,t,n;return De||(e=Ne,t=function(e){0===e.oldVersion&&e.createObjectStore(_)},(n=(e=re(indexedDB,"open",[Oe,e])).request)&&(n.onupgradeneeded=function(e){t&&t(new d(n.result,e.oldVersion,n.transaction))}),De=e.then(function(e){return new p(e)})),De}function E(o,a){return h(this,void 0,void 0,function(){var t,n,r,i;return v(this,function(e){switch(e.label){case 0:return t=y(o),[4,Pe()];case 1:return r=e.sent(),n=r.transaction(_,"readwrite"),[4,(r=n.objectStore(_)).get(t)];case 2:return i=e.sent(),[4,r.put(a,t)];case 3:return e.sent(),[4,n.complete];case 4:return e.sent(),i&&i.fid===a.fid||Ee(o,a.fid),[2,a]}})})}function Ae(r){return h(this,void 0,void 0,function(){var t,n;return v(this,function(e){switch(e.label){case 0:return t=y(r),[4,Pe()];case 1:return n=e.sent(),[4,(n=n.transaction(_,"readwrite")).objectStore(_).delete(t)];case 2:return e.sent(),[4,n.complete];case 3:return e.sent(),[2]}})})}function T(a,s){return h(this,void 0,void 0,function(){var t,n,r,i,o;return v(this,function(e){switch(e.label){case 0:return t=y(a),[4,Pe()];case 1:return r=e.sent(),n=r.transaction(_,"readwrite"),[4,(r=n.objectStore(_)).get(t)];case 2:return i=e.sent(),void 0!==(o=s(i))?[3,4]:[4,r.delete(t)];case 3:return e.sent(),[3,6];case 4:return[4,r.put(o,t)];case 5:e.sent(),e.label=6;case 6:return[4,n.complete];case 7:return e.sent(),!o||i&&i.fid===o.fid||Ee(a,o.fid),[2,o]}})})}function xe(i){return h(this,void 0,void 0,function(){var t,n,r;return v(this,function(e){switch(e.label){case 0:return[4,T(i,function(e){e=je(e||{fid:_e(),registrationStatus:0}),e=((e,t)=>{if(0!==t.registrationStatus)return 1===t.registrationStatus?{installationEntry:t,registrationPromise:function(i){return h(this,void 0,void 0,function(){var t,n,r;return v(this,function(e){switch(e.label){case 0:return[4,ke(i)];case 1:t=e.sent(),e.label=2;case 2:return 1!==t.registrationStatus?[3,5]:[4,be(100)];case 3:return e.sent(),[4,ke(i)];case 4:return t=e.sent(),[3,2];case 5:return 0!==t.registrationStatus?[3,7]:[4,xe(i)];case 6:return r=e.sent(),n=r.installationEntry,(r=r.registrationPromise)?[2,r]:[2,n];case 7:return[2,t]}})})}(e)}:{installationEntry:t};var n;if(!navigator.onLine)return n=Promise.reject(m.create("app-offline")),{installationEntry:t,registrationPromise:n};t={fid:t.fid,registrationStatus:1,registrationTime:Date.now()},e=function(r,i){return h(this,void 0,void 0,function(){var t,n;return v(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,7]),[4,function(a,e){var s=e.fid;return h(this,void 0,void 0,function(){var t,n,r,i,o;return v(this,function(e){switch(e.label){case 0:return t=pe(a),n=ge(a),o={fid:s,authVersion:ce,appId:a.appId,sdkVersion:ue},r={method:"POST",headers:n,body:JSON.stringify(o)},[4,ye(function(){return fetch(t,r)})];case 1:return(i=e.sent()).ok?[4,i.json()]:[3,3];case 2:return o=e.sent(),[2,{fid:o.fid||s,registrationStatus:2,refreshToken:o.refreshToken,authToken:he(o.authToken)}];case 3:return[4,ve("Create Installation",i)];case 4:throw e.sent()}})})}(r,i)];case 1:return t=e.sent(),[2,E(r,t)];case 2:return de(n=e.sent())&&409===n.customData.serverCode?[4,Ae(r)]:[3,4];case 3:return e.sent(),[3,6];case 4:return[4,E(r,{fid:i.fid,registrationStatus:0})];case 5:e.sent(),e.label=6;case 6:throw n;case 7:return[2]}})})}(e,t);return{installationEntry:t,registrationPromise:e}})(i,e);return t=e.registrationPromise,e.installationEntry})];case 1:return(n=e.sent()).fid!==Ie?[3,3]:(r={},[4,t]);case 2:return[2,(r.installationEntry=e.sent(),r)];case 3:return[2,{installationEntry:n,registrationPromise:t}]}})})}function ke(e){return T(e,function(e){if(e)return je(e);throw m.create("installation-not-found")})}function je(e){return 1===(t=e).registrationStatus&&t.registrationTime+se{t=t.fid;return pe(e)+"/"+t+"/authTokens:generate"})(s,a),n=me(s,a),(o=u.getImmediate({optional:!0}))&&n.append("x-firebase-client",o.getPlatformInfoString()),o={installation:{sdkVersion:ue}},r={method:"POST",headers:n,body:JSON.stringify(o)},[4,ye(function(){return fetch(t,r)})];case 1:return(i=e.sent()).ok?[4,i.json()]:[3,3];case 2:return o=e.sent(),[2,he(o)];case 3:return[4,ve("Generate Auth Token",i)];case 4:throw e.sent()}})})}function Re(a,s){return void 0===s&&(s=!1),h(this,void 0,void 0,function(){var o,t,n;return v(this,function(e){switch(e.label){case 0:return[4,T(a.appConfig,function(e){if(!Me(e))throw m.create("not-registered");var t,n,r,i=e.authToken;if(s||2!==(t=i).requestStatus||(n=t,r=Date.now(),r{t=t.fid;return pe(e)+"/"+t})(i,o),r=me(i,o),n={method:"DELETE",headers:r},[4,ye(function(){return fetch(t,n)})];case 1:return(r=e.sent()).ok?[3,3]:[4,ve("Delete Installation",r)];case 2:throw e.sent();case 3:return[2]}})})}function qe(e,r){var t,n,i=e.appConfig;return e=i,t=r,n=(Se(),y(e)),(e=b.get(n))||(e=new Set,b.set(n,e)),e.add(t),function(){var e,t=r,n=y(e=i);(e=b.get(n))&&(e.delete(t),0===e.size&&b.delete(n),Ce())}}function Ve(e){return m.create("missing-app-config-values",{valueName:e})}function S(){for(var e=0,t=0,n=arguments.length;t{var t,n;if(!e||!e.options)throw Ve("App Configuration");if(!e.name)throw Ve("App Name");try{for(var r=B(["projectId","apiKey","appId"]),i=r.next();!i.done;i=r.next()){var o=i.value;if(!e.options[o])throw Ve(o)}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}return{appName:e.name,projectId:e.options.projectId,apiKey:e.options.apiKey,appId:e.options.appId}})(t),platformLoggerProvider:e.getProvider("platform-logger")};return{app:t,getId:function(){return function(r){return h(this,void 0,void 0,function(){var t,n;return v(this,function(e){switch(e.label){case 0:return[4,xe(r.appConfig)];case 1:return t=e.sent(),n=t.installationEntry,(t.registrationPromise||Re(r)).catch(console.error),[2,n.fid]}})})}(n)},getToken:function(e){return Be(n,e)},delete:function(){return function(r){return h(this,void 0,void 0,function(){var t,n;return v(this,function(e){switch(e.label){case 0:return[4,T(t=r.appConfig,function(e){if(!e||0!==e.registrationStatus)return e})];case 1:if(!(n=e.sent()))return[3,6];if(1!==n.registrationStatus)return[3,2];throw m.create("delete-pending-registration");case 2:if(2!==n.registrationStatus)return[3,6];if(navigator.onLine)return[3,3];throw m.create("app-offline");case 3:return[4,He(t,n)];case 4:return e.sent(),[4,Ae(t)];case 5:e.sent(),e.label=6;case 6:return[2]}})})}(n)},onIdChange:function(e){return qe(n,e)}}},"PUBLIC")),L.registerVersion("@firebase/installations",ae),(C=I=I||{})[C.DEBUG=0]="DEBUG",C[C.VERBOSE=1]="VERBOSE",C[C.INFO=2]="INFO",C[C.WARN=3]="WARN",C[C.ERROR=4]="ERROR",C[C.SILENT=5]="SILENT";function Ge(e,t){for(var n=[],r=2;r{for(var e=window.document.getElementsByTagName("script"),t=0,n=Object.values(e);t