var config,notifyMesage;!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(n="undefined"!=typeof globalThis?globalThis:n||self).firebase=t()}(this,function(){"use strict";function et(n,t,i,r){return new(i=i||Promise)(function(u,f){function o(n){try{e(r.next(n))}catch(n){f(n)}}function s(n){try{e(r.throw(n))}catch(n){f(n)}}function e(n){var t;n.done?u(n.value):((t=n.value)instanceof i?t:new i(function(n){n(t)})).then(o,s)}e((r=r.apply(n,t||[])).next())})}function bt(n,t){function e(e){return function(o){return function(e){if(f)throw new TypeError("Generator is already executing.");for(;r;)try{if(f=1,u&&(i=2&e[0]?u.return:e[0]?u.throw||((i=u.return)&&i.call(u),0):u.next)&&!(i=i.call(u,e[1])).done)return i;switch(u=0,(e=i?[2&e[0],i.value]:e)[0]){case 0:case 1:i=e;break;case 4:return r.label++,{value:e[1],done:!1};case 5:r.label++;u=e[1];e=[0];continue;case 7:e=r.ops.pop();r.trys.pop();continue;default:if(!(i=0<(i=r.trys).length&&i[i.length-1])&&(6===e[0]||2===e[0])){r=0;continue}if(3===e[0]&&(!i||e[1]>i[0]&&e[1]<i[3])){r.label=e[1];break}if(6===e[0]&&r.label<i[1]){r.label=i[1];i=e;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(e);break}i[2]&&r.ops.pop();r.trys.pop();continue}e=t.call(n,r)}catch(o){e=[6,o];u=0}finally{f=i=0}if(5&e[0])throw e[1];return{value:e[0]?e[1]:void 0,done:!0}}([e,o])}}var f,u,i,r={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},o={next:e(0),"throw":e(1),"return":e(2)};return"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o}function d(n){var t="function"==typeof Symbol&&Symbol.iterator,i=t&&n[t],r=0;if(i)return i.call(n);if(n&&"number"==typeof n.length)return{next:function(){return{value:(n=n&&r>=n.length?void 0:n)&&n[r++],done:!n}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.");}function p(n,t){var i="function"==typeof Symbol&&n[Symbol.iterator],r,f,u,e;if(!i)return n;u=i.call(n);e=[];try{for(;(void 0===t||0<t--)&&!(r=u.next()).done;)e.push(r.value)}catch(n){f={error:n}}finally{try{r&&!r.done&&(i=u.return)&&i.call(u)}finally{if(f)throw f.error;}}return e}function u(n,t){for(var i=0,u=t.length,r=n.length;i<u;i++,r++)n[r]=t[i];return n}function l(n,t){if(!(t instanceof Object))return t;switch(t.constructor){case Date:return new Date(t.getTime());case Object:void 0===n&&(n={});break;case Array:n=[];break;default:return t}for(var i in t)t.hasOwnProperty(i)&&"__proto__"!==i&&(n[i]=l(n[i],t[i]));return n}function ot(){var n=this;this.reject=function(){};this.resolve=function(){};this.promise=new Promise(function(t,i){n.resolve=t;n.reject=i})}function g(n,t,i){return t=st.call(this,t)||this,t.code=n,t.customData=i,t.name=dt,Object.setPrototypeOf(t,g.prototype),Error.captureStackTrace&&Error.captureStackTrace(t,nt.prototype.create),t}function ht(n,t,i){this.service=n;this.serviceName=t;this.errors=i}function ct(n,t){return Object.prototype.hasOwnProperty.call(n,t)}function ti(n,t){return t=new ii(n,t),t.subscribe.bind(t)}function o(n,t){var i=this;this.observers=[];this.unsubscribes=[];this.observerCount=0;this.task=Promise.resolve();this.finalized=!1;this.onNoObservers=t;this.task.then(function(){n(i)}).catch(function(n){i.error(n)})}function tt(){}function a(n,t,i){this.name=n;this.instanceFactory=t;this.type=i;this.multipleInstances=!1;this.serviceProps={};this.instantiationMode="LAZY";this.onInstanceCreated=null}function i(n,t){this.name=n;this.container=t;this.component=null;this.instances=new Map;this.instancesDeferred=new Map;this.onInitCallbacks=new Set}function v(n){this.name=n;this.providers=new Map}function fi(n,t){for(var e,f,r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];if(!(t<n.logLevel)){if(e=(new Date).toISOString(),f=oi[t],!f)throw new Error("Attempted to log a message with an invalid logType (value: "+t+")");console[f].apply(console,u(["["+e+"]  "+n.name+":"],r))}}function e(n){this.name=n;this._logLevel=ei;this._logHandler=fi;this._userLogHandler=null;rt.push(this)}function si(n){rt.forEach(function(t){t.setLogLevel(n)})}function hi(n,i){for(var r=0,u=rt;r<u.length;r++)!function(r){var u=null;i&&i.level&&(u=lt[i.level]);r.userLogHandler=null===n?null:function(i,r){for(var o,e=[],f=2;f<arguments.length;f++)e[f-2]=arguments[f];o=e.map(function(n){if(null==n)return null;if("string"==typeof n)return n;if("number"==typeof n||"boolean"==typeof n)return n.toString();if(n instanceof Error)return n.message;try{return JSON.stringify(n)}catch(n){return null}}).filter(function(n){return n}).join(" ");r>=(null!=u?u:i.logLevel)&&n({level:t[r].toLowerCase(),message:o,args:e,type:i.name})}}(u[r])}function f(n,t,i){var r=this;this.firebase_=i;this.isDeleted_=!1;this.name_=t.name;this.automaticDataCollectionEnabled_=t.automaticDataCollectionEnabled||!1;this.options_=l(void 0,n);this.container=new ui(t.name);this._addComponent(new it("app",function(){return r},"PUBLIC"));this.firebase_.INTERNAL.components.forEach(function(n){return r._addComponent(n)})}function li(n){function u(n){if(!ct(t,n=n||w))throw h.create("no-app",{appName:n});return t[n]}function f(f){var s,e=f.name,o,a,v;if(r.has(e))return c.debug("There were multiple attempts to register component "+e+"."),"PUBLIC"===f.type?i[e]:null;for(r.set(e,f),"PUBLIC"===f.type&&(s=function(n){if("function"!=typeof(n=void 0===n?u():n)[e])throw h.create("invalid-app-argument",{appName:e});return n[e]()},void 0!==f.serviceProps&&l(s,f.serviceProps),i[e]=s,n.prototype[e]=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return this._getService.bind(this,e).apply(this,f.multipleInstances?t:[])}),o=0,a=Object.keys(t);o<a.length;o++)v=a[o],t[v]._addComponent(f);return"PUBLIC"===f.type?i[e]:null}var t={},r=new Map,i={__esModule:!0,initializeApp:function(r,u){void 0===u&&(u={});"object"==typeof u&&null!==u||(u={name:u});var f=u;if(void 0===f.name&&(f.name=w),u=f.name,"string"!=typeof u||!u)throw h.create("bad-app-name",{appName:String(u)});if(ct(t,u))throw h.create("duplicate-app",{appName:u});return f=new n(r,f,i),t[u]=f},app:u,registerVersion:function(n,t,i){var u=null!==(r=ci[n])&&void 0!==r?r:n,r,n;if(i&&(u+="-"+i),r=u.match(/\s|\//),n=t.match(/\s|\//),r||n)return i=['Unable to register library "'+u+'" with version "'+t+'":'],r&&i.push('library name "'+u+'" contains illegal characters (whitespace or "/")'),r&&n&&i.push("and"),n&&i.push('version name "'+t+'" contains illegal characters (whitespace or "/")'),void c.warn(i.join(" "));f(new it(u+"-version",function(){return{library:u,version:t}},"VERSION"))},setLogLevel:si,onLog:function(n,t){if(null!==n&&"function"!=typeof n)throw h.create("invalid-log-argument");hi(n,t)},apps:null,SDK_VERSION:vt,INTERNAL:{registerComponent:f,removeApp:function(n){delete t[n]},components:r,useAsService:function(n,t){return"serverAuth"===t?null:t}}};return i.default=i,Object.defineProperty(i,"apps",{get:function(){return Object.keys(t).map(function(n){return t[n]})}}),u.App=n,i}function pt(n){this.container=n}var ft=function(n,t){return(ft=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])})(n,t)},y=function(){return(y=Object.assign||function(n){for(var r,i,t=1,u=arguments.length;t<u;t++)for(i in r=arguments[t])Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i]);return n}).apply(this,arguments)},kt=(ot.prototype.wrapCallback=function(n){var t=this;return function(i,r){i?t.reject(i):t.resolve(r);"function"==typeof n&&(t.promise.catch(function(){}),1===n.length?n(i):n(i,r))}},ot),st,dt="FirebaseError",gt=(function(n,t){function i(){this.constructor=n}if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");ft(n,t);n.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(g,st=Error),g),nt=(ht.prototype.create=function(n){for(var i=[],t=1;t<arguments.length;t++)i[t-1]=arguments[t];var r,u=i[0]||{},f=this.service+"/"+n,n=this.errors[n],n=n?(r=u,n.replace(ni,function(n,t){var i=r[t];return null!=i?String(i):"<"+t+"?>"})):"Error",n=this.serviceName+": "+n+" ("+f+").";return new gt(f,n,u)},ht),ni=/\{\$([^}]+)}/g,ii=(o.prototype.next=function(n){this.forEachObserver(function(t){t.next(n)})},o.prototype.error=function(n){this.forEachObserver(function(t){t.error(n)});this.close(n)},o.prototype.complete=function(){this.forEachObserver(function(n){n.complete()});this.close()},o.prototype.subscribe=function(n,t,i){var r,u=this;if(void 0===n&&void 0===t&&void 0===i)throw new Error("Missing Observer.");return void 0===(r=function(n,t){var i,r,u;if("object"!=typeof n||null===n)return!1;for(i=0,r=t;i<r.length;i++)if(u=r[i],u in n&&"function"==typeof n[u])return!0;return!1}(n,["next","error","complete"])?n:{next:n,error:t,complete:i}).next&&(r.next=tt),void 0===r.error&&(r.error=tt),void 0===r.complete&&(r.complete=tt),i=this.unsubscribeOne.bind(this,this.observers.length),this.finalized&&this.task.then(function(){try{u.finalError?r.error(u.finalError):r.complete()}catch(n){}}),this.observers.push(r),i},o.prototype.unsubscribeOne=function(n){void 0!==this.observers&&void 0!==this.observers[n]&&(delete this.observers[n],--this.observerCount,0===this.observerCount&&void 0!==this.onNoObservers&&this.onNoObservers(this))},o.prototype.forEachObserver=function(n){if(!this.finalized)for(var t=0;t<this.observers.length;t++)this.sendOne(t,n)},o.prototype.sendOne=function(n,t){var i=this;this.task.then(function(){if(void 0!==i.observers&&void 0!==i.observers[n])try{t(i.observers[n])}catch(n){"undefined"!=typeof console&&console.error&&console.error(n)}})},o.prototype.close=function(n){var t=this;this.finalized||(this.finalized=!0,void 0!==n&&(this.finalError=n),this.task.then(function(){t.observers=void 0;t.onNoObservers=void 0}))},o),it=(a.prototype.setInstantiationMode=function(n){return this.instantiationMode=n,this},a.prototype.setMultipleInstances=function(n){return this.multipleInstances=n,this},a.prototype.setServiceProps=function(n){return this.serviceProps=n,this},a.prototype.setInstanceCreatedCallback=function(n){return this.onInstanceCreated=n,this},a),s="[DEFAULT]",ri=(i.prototype.get=function(n){var t,i,r;if(void 0===n&&(n=s),t=this.normalizeInstanceIdentifier(n),!this.instancesDeferred.has(t)&&(i=new kt,this.instancesDeferred.set(t,i),this.isInitialized(t)||this.shouldAutoInitialize()))try{r=this.getOrInitializeService({instanceIdentifier:t});r&&i.resolve(r)}catch(n){}return this.instancesDeferred.get(t).promise},i.prototype.getImmediate=function(n){var t=y({identifier:s,optional:!1},n),n=t.identifier,t=t.optional,i=this.normalizeInstanceIdentifier(n);if(!this.isInitialized(i)&&!this.shouldAutoInitialize()){if(t)return null;throw Error("Service "+this.name+" is not available");}try{return this.getOrInitializeService({instanceIdentifier:i})}catch(n){if(t)return null;throw n;}},i.prototype.getComponent=function(){return this.component},i.prototype.setComponent=function(n){var r,u,i,t,e;if(n.name!==this.name)throw Error("Mismatching Component "+n.name+" for Provider "+this.name+".");if(this.component)throw Error("Component for "+this.name+" has already been provided");if(this.component=n,this.shouldAutoInitialize()){if("EAGER"===n.instantiationMode)try{this.getOrInitializeService({instanceIdentifier:s})}catch(n){}try{for(i=d(this.instancesDeferred.entries()),t=i.next();!t.done;t=i.next()){var f=p(t.value,2),o=f[0],h=f[1],c=this.normalizeInstanceIdentifier(o);try{e=this.getOrInitializeService({instanceIdentifier:c});h.resolve(e)}catch(n){}}}catch(n){r={error:n}}finally{try{t&&!t.done&&(u=i.return)&&u.call(i)}finally{if(r)throw r.error;}}}},i.prototype.clearInstance=function(n){void 0===n&&(n=s);this.instancesDeferred.delete(n);this.instances.delete(n)},i.prototype.delete=function(){return et(this,void 0,void 0,function(){var n;return bt(this,function(t){switch(t.label){case 0:return n=Array.from(this.instances.values()),[4,Promise.all(u(u([],p(n.filter(function(n){return"INTERNAL"in n}).map(function(n){return n.INTERNAL.delete()}))),p(n.filter(function(n){return"_delete"in n}).map(function(n){return n._delete()}))))];case 1:return t.sent(),[2]}})})},i.prototype.isComponentSet=function(){return null!=this.component},i.prototype.isInitialized=function(n){return void 0===n&&(n=s),this.instances.has(n)},i.prototype.initialize=function(n){var f,h,e=(n=void 0===n?{}:n).instanceIdentifier,e=void 0===e?s:e,n=n.options,n=void 0===n?{}:n,i=this.normalizeInstanceIdentifier(e),u,r,t;if(this.isInitialized(i))throw Error(this.name+"("+i+") has already been initialized");if(!this.isComponentSet())throw Error("Component "+this.name+" has not been registered yet");u=this.getOrInitializeService({instanceIdentifier:i,options:n});try{for(r=d(this.instancesDeferred.entries()),t=r.next();!t.done;t=r.next()){var o=p(t.value,2),c=o[0],o=o[1];i===this.normalizeInstanceIdentifier(c)&&o.resolve(u)}}catch(n){f={error:n}}finally{try{t&&!t.done&&(h=r.return)&&h.call(r)}finally{if(f)throw f.error;}}return this.invokeOnInitCallbacks(u,i),u},i.prototype.onInit=function(n){var t=this;return this.onInitCallbacks.add(n),function(){t.onInitCallbacks.delete(n)}},i.prototype.invokeOnInitCallbacks=function(n,t){var u,f,r,i,e;try{for(r=d(this.onInitCallbacks),i=r.next();!i.done;i=r.next()){e=i.value;try{e(n,t)}catch(n){}}}catch(n){u={error:n}}finally{try{i&&!i.done&&(f=r.return)&&f.call(r)}finally{if(u)throw u.error;}}},i.prototype.getOrInitializeService=function(n){var i=n.instanceIdentifier,r=n.options,n=void 0===r?{}:r,t=this.instances.get(i);if(!t&&this.component&&(t=this.component.instanceFactory(this.container,{instanceIdentifier:(r=i)===s?void 0:r,options:n}),this.instances.set(i,t),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,i,t)}catch(n){}return t||null},i.prototype.normalizeInstanceIdentifier=function(n){return!this.component||this.component.multipleInstances?n:s},i.prototype.shouldAutoInitialize=function(){return!!this.component&&"EXPLICIT"!==this.component.instantiationMode},i),ui=(v.prototype.addComponent=function(n){var t=this.getProvider(n.name);if(t.isComponentSet())throw new Error("Component "+n.name+" has already been registered with "+this.name);t.setComponent(n)},v.prototype.addOrOverwriteComponent=function(n){this.getProvider(n.name).isComponentSet()&&this.providers.delete(n.name);this.addComponent(n)},v.prototype.getProvider=function(n){if(this.providers.has(n))return this.providers.get(n);var t=new ri(n,this);return this.providers.set(n,t),t},v.prototype.getProviders=function(){return Array.from(this.providers.values())},v),t,rt=[],vt,n,yt,wt,ut,ai,k;(r=t=t||{})[r.DEBUG=0]="DEBUG";r[r.VERBOSE=1]="VERBOSE";r[r.INFO=2]="INFO";r[r.WARN=3]="WARN";r[r.ERROR=4]="ERROR";r[r.SILENT=5]="SILENT";var lt={debug:t.DEBUG,verbose:t.VERBOSE,info:t.INFO,warn:t.WARN,error:t.ERROR,silent:t.SILENT},ei=t.INFO,oi=((n={})[t.DEBUG]="log",n[t.VERBOSE]="log",n[t.INFO]="info",n[t.WARN]="warn",n[t.ERROR]="error",n),r=(Object.defineProperty(e.prototype,"logLevel",{get:function(){return this._logLevel},set:function(n){if(!(n in t))throw new TypeError('Invalid value "'+n+'" assigned to `logLevel`');this._logLevel=n},enumerable:!1,configurable:!0}),e.prototype.setLogLevel=function(n){this._logLevel="string"==typeof n?lt[n]:n},Object.defineProperty(e.prototype,"logHandler",{get:function(){return this._logHandler},set:function(n){if("function"!=typeof n)throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=n},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"userLogHandler",{get:function(){return this._userLogHandler},set:function(n){this._userLogHandler=n},enumerable:!1,configurable:!0}),e.prototype.debug=function(){for(var i=[],n=0;n<arguments.length;n++)i[n]=arguments[n];this._userLogHandler&&this._userLogHandler.apply(this,u([this,t.DEBUG],i));this._logHandler.apply(this,u([this,t.DEBUG],i))},e.prototype.log=function(){for(var i=[],n=0;n<arguments.length;n++)i[n]=arguments[n];this._userLogHandler&&this._userLogHandler.apply(this,u([this,t.VERBOSE],i));this._logHandler.apply(this,u([this,t.VERBOSE],i))},e.prototype.info=function(){for(var i=[],n=0;n<arguments.length;n++)i[n]=arguments[n];this._userLogHandler&&this._userLogHandler.apply(this,u([this,t.INFO],i));this._logHandler.apply(this,u([this,t.INFO],i))},e.prototype.warn=function(){for(var i=[],n=0;n<arguments.length;n++)i[n]=arguments[n];this._userLogHandler&&this._userLogHandler.apply(this,u([this,t.WARN],i));this._logHandler.apply(this,u([this,t.WARN],i))},e.prototype.error=function(){for(var i=[],n=0;n<arguments.length;n++)i[n]=arguments[n];this._userLogHandler&&this._userLogHandler.apply(this,u([this,t.ERROR],i));this._logHandler.apply(this,u([this,t.ERROR],i))},e);var n=((n={})["no-app"]="No Firebase App '{$appName}' has been created - call Firebase App.initializeApp()",n["bad-app-name"]="Illegal App name: '{$appName}",n["duplicate-app"]="Firebase App named '{$appName}' already exists",n["app-deleted"]="Firebase App named '{$appName}' already deleted",n["invalid-app-argument"]="firebase.{$appName}() takes either no argument or a Firebase App instance.",n["invalid-log-argument"]="First argument to `onLog` must be null or a function.",n),h=new nt("app","Firebase",n),at="@firebase/app",w="[DEFAULT]",ci=((n={})[at]="fire-core",n["@firebase/analytics"]="fire-analytics",n["@firebase/app-check"]="fire-app-check",n["@firebase/auth"]="fire-auth",n["@firebase/database"]="fire-rtdb",n["@firebase/functions"]="fire-fn",n["@firebase/installations"]="fire-iid",n["@firebase/messaging"]="fire-fcm",n["@firebase/performance"]="fire-perf",n["@firebase/remote-config"]="fire-rc",n["@firebase/storage"]="fire-gcs",n["@firebase/firestore"]="fire-fst",n["fire-js"]="fire-js",n["firebase-wrapper"]="fire-js-all",n),c=new r("@firebase/app"),b=(Object.defineProperty(f.prototype,"automaticDataCollectionEnabled",{get:function(){return this.checkDestroyed_(),this.automaticDataCollectionEnabled_},set:function(n){this.checkDestroyed_();this.automaticDataCollectionEnabled_=n},enumerable:!1,configurable:!0}),Object.defineProperty(f.prototype,"name",{get:function(){return this.checkDestroyed_(),this.name_},enumerable:!1,configurable:!0}),Object.defineProperty(f.prototype,"options",{get:function(){return this.checkDestroyed_(),this.options_},enumerable:!1,configurable:!0}),f.prototype.delete=function(){var n=this;return new Promise(function(t){n.checkDestroyed_();t()}).then(function(){return n.firebase_.INTERNAL.removeApp(n.name_),Promise.all(n.container.getProviders().map(function(n){return n.delete()}))}).then(function(){n.isDeleted_=!0})},f.prototype._getService=function(n,t){return void 0===t&&(t=w),this.checkDestroyed_(),this.container.getProvider(n).getImmediate({identifier:t})},f.prototype._removeServiceInstance=function(n,t){void 0===t&&(t=w);this.container.getProvider(n).clearInstance(t)},f.prototype._addComponent=function(n){try{this.container.addComponent(n)}catch(t){c.debug("Component "+n.name+" failed to register with FirebaseApp "+this.name,t)}},f.prototype._addOrOverwriteComponent=function(n){this.container.addOrOverwriteComponent(n)},f.prototype.toJSON=function(){return{name:this.name,automaticDataCollectionEnabled:this.automaticDataCollectionEnabled,options:this.options}},f.prototype.checkDestroyed_=function(){if(this.isDeleted_)throw h.create("app-deleted",{appName:this.name_});},f);return b.prototype.name&&b.prototype.options||b.prototype.delete||console.log("dc"),vt="8.5.0",n=function et(){var n=li(b);return n.INTERNAL=y(y({},n.INTERNAL),{createFirebaseNamespace:et,extendNamespace:function(t){l(n,t)},createSubscribe:ti,ErrorFactory:nt,deepExtend:l}),n}(),yt=(pt.prototype.getPlatformInfoString=function(){return this.container.getProviders().map(function(n){return function(n){return n=n.getComponent(),"VERSION"===(null==n?void 0:n.type)}(n)?(n=n.getImmediate(),n.library+"/"+n.version):null}).filter(function(n){return n}).join(" ")},pt),"object"==typeof self&&self.self===self&&void 0!==self.firebase&&(c.warn("\n    Warning: Firebase is already defined in the global scope. Please make sure\n    Firebase library is only loaded once.\n  "),(r=self.firebase.SDK_VERSION)&&0<=r.indexOf("LITE")&&c.warn("\n    Warning: You are trying to load Firebase while using Firebase Performance standalone script.\n    You should load Firebase Performance with this instance of Firebase to avoid loading duplicate code.\n    ")),wt=n.initializeApp,n.initializeApp=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return function(){try{return"[object process]"===Object.prototype.toString.call(global.process)}catch(n){return}}()&&c.warn('\n      Warning: This is a browser-targeted Firebase bundle but it appears it is being\n      run in a Node environment.  If running in a Node environment, make sure you\n      are using the bundle specified by the "main" field in package.json.\n      \n      If you are using Webpack, you can specify "main" as the first item in\n      "resolve.mainFields":\n      https://webpack.js.org/configuration/resolve/#resolvemainfields\n      \n      If using Rollup, use the @rollup/plugin-node-resolve plugin and specify "main"\n      as the first item in "mainFields", e.g. [\'main\', \'module\'].\n      https://github.com/rollup/@rollup/plugin-node-resolve\n      '),wt.apply(void 0,t)},k=n,(ut=k).INTERNAL.registerComponent(new it("platform-logger",function(n){return new yt(n)},"PRIVATE")),ut.registerVersion(at,"0.6.21",ai),ut.registerVersion("fire-js",""),k.registerVersion("firebase","8.5.0","app"),k});!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?t(require("@firebase/app")):"function"==typeof define&&define.amd?define(["@firebase/app"],t):t((n="undefined"!=typeof globalThis?globalThis:n||self).firebase)}(this,function(n){"use strict";try{!function(){function vu(n){return n&&"object"==typeof n&&"default"in n?n:{"default":n}}function t(n,t,i,r){return new(i=i||Promise)(function(u,f){function o(n){try{e(r.next(n))}catch(n){f(n)}}function s(n){try{e(r.throw(n))}catch(n){f(n)}}function e(n){var t;n.done?u(n.value):((t=n.value)instanceof i?t:new i(function(n){n(t)})).then(o,s)}e((r=r.apply(n,t||[])).next())})}function i(n,t){function e(e){return function(o){return function(e){if(f)throw new TypeError("Generator is already executing.");for(;r;)try{if(f=1,u&&(i=2&e[0]?u.return:e[0]?u.throw||((i=u.return)&&i.call(u),0):u.next)&&!(i=i.call(u,e[1])).done)return i;switch(u=0,(e=i?[2&e[0],i.value]:e)[0]){case 0:case 1:i=e;break;case 4:return r.label++,{value:e[1],done:!1};case 5:r.label++;u=e[1];e=[0];continue;case 7:e=r.ops.pop();r.trys.pop();continue;default:if(!(i=0<(i=r.trys).length&&i[i.length-1])&&(6===e[0]||2===e[0])){r=0;continue}if(3===e[0]&&(!i||e[1]>i[0]&&e[1]<i[3])){r.label=e[1];break}if(6===e[0]&&r.label<i[1]){r.label=i[1];i=e;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(e);break}i[2]&&r.ops.pop();r.trys.pop();continue}e=t.call(n,r)}catch(o){e=[6,o];u=0}finally{f=i=0}if(5&e[0])throw e[1];return{value:e[0]?e[1]:void 0,done:!0}}([e,o])}}var f,u,i,r={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},o={next:e(0),"throw":e(1),"return":e(2)};return"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o}function d(n){var t="function"==typeof Symbol&&Symbol.iterator,i=t&&n[t],r=0;if(i)return i.call(n);if(n&&"number"==typeof n.length)return{next:function(){return{value:(n=n&&r>=n.length?void 0:n)&&n[r++],done:!n}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.");}function yi(n,t){var i="function"==typeof Symbol&&n[Symbol.iterator],r,f,u,e;if(!i)return n;u=i.call(n);e=[];try{for(;(void 0===t||0<t--)&&!(r=u.next()).done;)e.push(r.value)}catch(n){f={error:n}}finally{try{r&&!r.done&&(i=u.return)&&i.call(u)}finally{if(f)throw f.error;}}return e}function pi(n,t){for(var i=0,u=t.length,r=n.length;i<u;i++,r++)n[r]=t[i];return n}function at(n,t,i){return t=wi.call(this,t)||this,t.code=n,t.customData=i,t.name=yu,Object.setPrototypeOf(t,at.prototype),Error.captureStackTrace&&Error.captureStackTrace(t,vt.prototype.create),t}function ki(n,t,i){this.service=n;this.serviceName=t;this.errors=i}function g(n,t,i){this.name=n;this.instanceFactory=t;this.type=i;this.multipleInstances=!1;this.serviceProps={};this.instantiationMode="LAZY";this.onInstanceCreated=null}function gi(n){return new Promise(function(t,i){n.onsuccess=function(){t(n.result)};n.onerror=function(){i(n.error)}})}function ut(n,t,i){var r,u=new Promise(function(u,f){gi(r=n[t].apply(n,i)).then(u,f)});return u.request=r,u}function w(n,t,i){i.forEach(function(i){Object.defineProperty(n.prototype,i,{get:function(){return this[t][i]},set:function(n){this[t][i]=n}})})}function yt(n,t,i,r){r.forEach(function(r){r in i.prototype&&(n.prototype[r]=function(){return ut(this[t],r,arguments)})})}function ft(n,t,i,r){r.forEach(function(r){r in i.prototype&&(n.prototype[r]=function(){return this[t][r].apply(this[t],arguments)})})}function nr(n,t,i,r){r.forEach(function(r){r in i.prototype&&(n.prototype[r]=function(){return n=this[t],(i=ut(n,r,arguments)).then(function(n){if(n)return new nt(n,i.request)});var n,i})})}function c(n){this._index=n}function nt(n,t){this._cursor=n;this._request=t}function s(n){this._store=n}function tt(n){this._tx=n;this.complete=new Promise(function(t,i){n.oncomplete=function(){t()};n.onerror=function(){i(n.error)};n.onabort=function(){i(n.error)}})}function et(n,t,i){this._db=n;this.oldVersion=t;this.transaction=new tt(i)}function ot(n){this._db=n}function pt(n,t,i){var t=ut(indexedDB,"open",[n,t]),r=t.request;return r&&(r.onupgradeneeded=function(n){i&&i(new et(r.result,n.oldVersion,r.transaction))}),t.then(function(n){return new ot(n)})}function wt(n){return ut(indexedDB,"deleteDatabase",[n])}function fr(n){return n instanceof bi&&n.code.includes("request-failed")}function bt(n){return n=n.projectId,wu+"/projects/"+n+"/installations"}function er(n){return{token:n.token,requestStatus:2,expiresIn:(n=n.expiresIn,Number(n.replace("s","000"))),creationTime:Date.now()}}function kt(n,r){return t(this,void 0,void 0,function(){var t;return i(this,function(i){switch(i.label){case 0:return[4,r.json()];case 1:return t=i.sent(),t=t.error,[2,h.create("request-failed",{requestName:n,serverCode:t.code,serverMessage:t.message,serverStatus:t.status})]}})})}function or(n){return n=n.apiKey,new Headers({"Content-Type":"application/json",Accept:"application/json","x-goog-api-key":n})}function sr(n,t){return t=t.refreshToken,n=or(n),n.append("Authorization",ur+" "+t),n}function dt(n){return t(this,void 0,void 0,function(){var t;return i(this,function(i){switch(i.label){case 0:return[4,n()];case 1:return 500<=(t=i.sent()).status&&t.status<600?[2,n()]:[2,t]}})})}function hr(n){return new Promise(function(t){setTimeout(t,n)})}function ku(){try{var n=new Uint8Array(17);return(self.crypto||self.msCrypto).getRandomValues(n),n[0]=112+n[0]%16,n=function(n){return btoa(String.fromCharCode.apply(String,pi([],yi(n)))).replace(/\+/g,"-").replace(/\//g,"_")}(n).substr(0,22),cr.test(n)?n:st}catch(n){return st}}function b(n){return n.appName+"!"+n.appId}function lr(n,t){n=b(n);ar(n,t),function(n,t){var i=vr();i&&i.postMessage({key:n,fid:t});yr()}(n,t)}function ar(n,t){var u,f,e=l.get(n),r,i;if(e)try{for(r=d(e),i=r.next();!i.done;i=r.next())i.value(t)}catch(n){u={error:n}}finally{try{i&&!i.done&&(f=r.return)&&f.call(r)}finally{if(u)throw u.error;}}}function vr(){return!a&&"BroadcastChannel"in self&&((a=new BroadcastChannel("[Firebase] FID Change")).onmessage=function(n){ar(n.data.key,n.data.fid)}),a}function yr(){0===l.size&&a&&(a.close(),a=null)}function gt(){return wr=wr||pt(du,gu,function(n){0===n.oldVersion&&n.createObjectStore(v)})}function ht(n,r){return t(this,void 0,void 0,function(){var u,f,t,e;return i(this,function(i){switch(i.label){case 0:return u=b(n),[4,gt()];case 1:return t=i.sent(),f=t.transaction(v,"readwrite"),[4,(t=f.objectStore(v)).get(u)];case 2:return e=i.sent(),[4,t.put(r,u)];case 3:return i.sent(),[4,f.complete];case 4:return i.sent(),e&&e.fid===r.fid||lr(n,r.fid),[2,r]}})})}function ni(n){return t(this,void 0,void 0,function(){var r,t;return i(this,function(i){switch(i.label){case 0:return r=b(n),[4,gt()];case 1:return t=i.sent(),[4,(t=t.transaction(v,"readwrite")).objectStore(v).delete(r)];case 2:return i.sent(),[4,t.complete];case 3:return i.sent(),[2]}})})}function it(n,r){return t(this,void 0,void 0,function(){var f,o,u,e,t;return i(this,function(i){switch(i.label){case 0:return f=b(n),[4,gt()];case 1:return u=i.sent(),o=u.transaction(v,"readwrite"),[4,(u=o.objectStore(v)).get(f)];case 2:return e=i.sent(),void 0!==(t=r(e))?[3,4]:[4,u.delete(f)];case 3:return i.sent(),[3,6];case 4:return[4,u.put(t,f)];case 5:i.sent();i.label=6;case 6:return[4,o.complete];case 7:return i.sent(),!t||e&&e.fid===t.fid||lr(n,t.fid),[2,t]}})})}function ti(n){return t(this,void 0,void 0,function(){var r,f,u;return i(this,function(e){switch(e.label){case 0:return[4,it(n,function(u){return u=kr(u||{fid:ku(),registrationStatus:0}),u=function(n,r){if(0!==r.registrationStatus)return 1===r.registrationStatus?{installationEntry:r,registrationPromise:function(n){return t(this,void 0,void 0,function(){var t,u,r;return i(this,function(i){switch(i.label){case 0:return[4,br(n)];case 1:t=i.sent();i.label=2;case 2:return 1!==t.registrationStatus?[3,5]:[4,hr(100)];case 3:return i.sent(),[4,br(n)];case 4:return t=i.sent(),[3,2];case 5:return 0!==t.registrationStatus?[3,7]:[4,ti(n)];case 6:return r=i.sent(),u=r.installationEntry,(r=r.registrationPromise)?[2,r]:[2,u];case 7:return[2,t]}})})}(n)}:{installationEntry:r};if(!navigator.onLine){var u=Promise.reject(h.create("app-offline"));return{installationEntry:r,registrationPromise:u}}return r={fid:r.fid,registrationStatus:1,registrationTime:Date.now()},n=function(n,r){return t(this,void 0,void 0,function(){var f,u;return i(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,7]),[4,function(n,r){var u=r.fid;return t(this,void 0,void 0,function(){var f,e,o,r,t;return i(this,function(i){switch(i.label){case 0:return f=bt(n),e=or(n),t={fid:u,authVersion:ur,appId:n.appId,sdkVersion:rr},o={method:"POST",headers:e,body:JSON.stringify(t)},[4,dt(function(){return fetch(f,o)})];case 1:return(r=i.sent()).ok?[4,r.json()]:[3,3];case 2:return t=i.sent(),[2,{fid:t.fid||u,registrationStatus:2,refreshToken:t.refreshToken,authToken:er(t.authToken)}];case 3:return[4,kt("Create Installation",r)];case 4:throw i.sent();}})})}(n,r)];case 1:return f=e.sent(),[2,ht(n,f)];case 2:return fr(u=e.sent())&&409===u.customData.serverCode?[4,ni(n)]:[3,4];case 3:return e.sent(),[3,6];case 4:return[4,ht(n,{fid:r.fid,registrationStatus:0})];case 5:e.sent();e.label=6;case 6:throw u;case 7:return[2]}})})}(n,r),{installationEntry:r,registrationPromise:n}}(n,u),r=u.registrationPromise,u.installationEntry})];case 1:return(f=e.sent()).fid!==st?[3,3]:(u={},[4,r]);case 2:return[2,(u.installationEntry=e.sent(),u)];case 3:return[2,{installationEntry:f,registrationPromise:r}]}})})}function br(n){return it(n,function(n){if(!n)throw h.create("installation-not-found");return kr(n)})}function kr(n){return 1===(t=n).registrationStatus&&t.registrationTime+ir<Date.now()?{fid:n.fid,registrationStatus:0}:n;var t}function nf(n,r){var u=n.appConfig,f=n.platformLoggerProvider;return t(this,void 0,void 0,function(){var o,t,s,e,n;return i(this,function(i){switch(i.label){case 0:return o=function(n,t){return t=t.fid,bt(n)+"/"+t+"/authTokens:generate"}(u,r),t=sr(u,r),(n=f.getImmediate({optional:!0}))&&t.append("x-firebase-client",n.getPlatformInfoString()),n={installation:{sdkVersion:rr}},s={method:"POST",headers:t,body:JSON.stringify(n)},[4,dt(function(){return fetch(o,s)})];case 1:return(e=i.sent()).ok?[4,e.json()]:[3,3];case 2:return n=i.sent(),[2,er(n)];case 3:return[4,kt("Generate Auth Token",e)];case 4:throw i.sent();}})})}function ii(n,r){return void 0===r&&(r=!1),t(this,void 0,void 0,function(){var u,e,f;return i(this,function(s){switch(s.label){case 0:return[4,it(n.appConfig,function(f){if(!gr(f))throw h.create("not-registered");var s,e=f.authToken;if(r||2!==(s=e).requestStatus||function(n){var t=Date.now();return t<n.creationTime||n.creationTime+n.expiresIn<t+bu}(s)){if(1===e.requestStatus)return u=function(n,r){return t(this,void 0,void 0,function(){var t;return i(this,function(i){switch(i.label){case 0:return[4,dr(n.appConfig)];case 1:t=i.sent();i.label=2;case 2:return 1!==t.authToken.requestStatus?[3,5]:[4,hr(100)];case 3:return i.sent(),[4,dr(n.appConfig)];case 4:return t=i.sent(),[3,2];case 5:return 0===(t=t.authToken).requestStatus?[2,ii(n,r)]:[2,t]}})})}(n,r),f;if(!navigator.onLine)throw h.create("app-offline");return e=(s=f,e={requestStatus:1,requestTime:Date.now()},o(o({},s),{authToken:e})),u=function(n,r){return t(this,void 0,void 0,function(){var f,t,u;return i(this,function(i){switch(i.label){case 0:return i.trys.push([0,3,,8]),[4,nf(n,r)];case 1:return f=i.sent(),u=o(o({},r),{authToken:f}),[4,ht(n.appConfig,u)];case 2:return i.sent(),[2,f];case 3:return!fr(t=i.sent())||401!==t.customData.serverCode&&404!==t.customData.serverCode?[3,5]:[4,ni(n.appConfig)];case 4:return i.sent(),[3,7];case 5:return u=o(o({},r),{authToken:{requestStatus:0}}),[4,ht(n.appConfig,u)];case 6:i.sent();i.label=7;case 7:throw t;case 8:return[2]}})})}(n,e),e}return f})];case 1:return e=s.sent(),u?[4,u]:[3,3];case 2:return f=s.sent(),[3,4];case 3:f=e.authToken;s.label=4;case 4:return[2,f]}})})}function dr(n){return it(n,function(n){if(!gr(n))throw h.create("not-registered");var t=n.authToken;return 1===(t=t).requestStatus&&t.requestTime+ir<Date.now()?o(o({},n),{authToken:{requestStatus:0}}):n})}function gr(n){return void 0!==n&&2===n.registrationStatus}function tf(n,r){return void 0===r&&(r=!1),t(this,void 0,void 0,function(){return i(this,function(u){switch(u.label){case 0:return[4,function(n){return t(this,void 0,void 0,function(){var t;return i(this,function(i){switch(i.label){case 0:return[4,ti(n)];case 1:return(t=i.sent().registrationPromise)?[4,t]:[3,3];case 2:i.sent();i.label=3;case 3:return[2]}})})}(n.appConfig)];case 1:return u.sent(),[4,ii(n,r)];case 2:return[2,u.sent().token]}})})}function rf(n,r){return t(this,void 0,void 0,function(){var u,f,t;return i(this,function(i){switch(i.label){case 0:return u=function(n,t){return t=t.fid,bt(n)+"/"+t}(n,r),t=sr(n,r),f={method:"DELETE",headers:t},[4,dt(function(){return fetch(u,f)})];case 1:return(t=i.sent()).ok?[3,3]:[4,kt("Delete Installation",t)];case 2:throw i.sent();case 3:return[2]}})})}function uf(n,t){var i=n.appConfig;return function(n,t){vr();var i=b(n);(n=l.get(i))||(n=new Set,l.set(i,n));n.add(t)}(i,t),function(){var n,u,r;u=t;r=b(n=i);(n=l.get(r))&&(n.delete(u),0===n.size&&l.delete(r),yr())}}function ri(n){return h.create("missing-app-config-values",{valueName:n})}function k(n){return n=new Uint8Array(n),btoa(String.fromCharCode.apply(String,pi([],yi(n)))).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function sf(n){return t(this,void 0,void 0,function(){var u,r,f=this;return i(this,function(e){switch(e.label){case 0:return"databases"in indexedDB?[4,indexedDB.databases()]:[3,2];case 1:if(u=e.sent(),!u.map(function(n){return n.name}).includes(ui))return[2,null];e.label=2;case 2:return r=null,[4,pt(ui,ef,function(u){return t(f,void 0,void 0,function(){var e,t,f;return i(this,function(i){switch(i.label){case 0:return u.oldVersion<2?[2]:u.objectStoreNames.contains(iu)?[4,(f=u.transaction.objectStore(iu)).index("fcmSenderId").get(n)]:[2];case 1:return e=i.sent(),[4,f.clear()];case 2:if(i.sent(),!e)return[2];if(2===u.oldVersion){if(!(t=e).auth||!t.p256dh||!t.endpoint)return[2];r={token:t.fcmToken,createTime:null!==(f=t.createTime)&&void 0!==f?f:Date.now(),subscriptionOptions:{auth:t.auth,p256dh:t.p256dh,endpoint:t.endpoint,swScope:t.swScope,vapidKey:"string"==typeof t.vapidKey?t.vapidKey:k(t.vapidKey)}}}else(3===u.oldVersion||4===u.oldVersion)&&(r={token:(t=e).fcmToken,createTime:t.createTime,subscriptionOptions:{auth:k(t.auth),p256dh:k(t.p256dh),endpoint:t.endpoint,swScope:t.swScope,vapidKey:k(t.vapidKey)}});return[2]}})})})];case 3:return e.sent().close(),[4,wt(ui)];case 4:return e.sent(),[4,wt("fcm_vapid_details_db")];case 5:return e.sent(),[4,wt("undefined")];case 6:return e.sent(),[2,function(n){if(!n||!n.subscriptionOptions)return!1;var t=n.subscriptionOptions;return"number"==typeof n.createTime&&0<n.createTime&&"string"==typeof n.token&&0<n.token.length&&"string"==typeof t.auth&&0<t.auth.length&&"string"==typeof t.p256dh&&0<t.p256dh.length&&"string"==typeof t.endpoint&&0<t.endpoint.length&&"string"==typeof t.swScope&&0<t.swScope.length&&"string"==typeof t.vapidKey&&0<t.vapidKey.length}(r)?r:null]}})})}function fi(){return ru=ru||pt(hf,cf,function(n){0===n.oldVersion&&n.createObjectStore(p)})}function lt(n){return t(this,void 0,void 0,function(){var t,r;return i(this,function(i){switch(i.label){case 0:return t=oi(n),[4,fi()];case 1:return[4,i.sent().transaction(p).objectStore(p).get(t)];case 2:return(t=i.sent())?[2,t]:[3,3];case 3:return[4,sf(n.appConfig.senderId)];case 4:return(r=i.sent())?[4,ei(n,r)]:[3,6];case 5:return i.sent(),[2,r];case 6:return[2]}})})}function ei(n,r){return t(this,void 0,void 0,function(){var u,t;return i(this,function(i){switch(i.label){case 0:return u=oi(n),[4,fi()];case 1:return t=i.sent(),[4,(t=t.transaction(p,"readwrite")).objectStore(p).put(r,u)];case 2:return i.sent(),[4,t.complete];case 3:return i.sent(),[2,r]}})})}function oi(n){return n.appConfig.appId}function uu(n,r){return t(this,void 0,void 0,function(){var t,f;return i(this,function(i){switch(i.label){case 0:return[4,hi(n)];case 1:t=i.sent();t={method:"DELETE",headers:t};i.label=2;case 2:return i.trys.push([2,5,,6]),[4,fetch(si(n.appConfig)+"/"+r,t)];case 3:return[4,i.sent().json()];case 4:if((t=i.sent()).error)throw f=t.error.message,u.create("token-unsubscribe-failed",{errorInfo:f});return[3,6];case 5:throw f=i.sent(),u.create("token-unsubscribe-failed",{errorInfo:f});case 6:return[2]}})})}function si(n){return n=n.projectId,ff+"/projects/"+n+"/registrations"}function hi(n){var r=n.appConfig,u=n.installations;return t(this,void 0,void 0,function(){var n;return i(this,function(t){switch(t.label){case 0:return[4,u.getToken()];case 1:return n=t.sent(),[2,new Headers({"Content-Type":"application/json",Accept:"application/json","x-goog-api-key":r.apiKey,"x-goog-firebase-installations-auth":"FIS "+n})]}})})}function fu(n){var t=n.p256dh,i=n.auth,r=n.endpoint,n=n.vapidKey,t={web:{endpoint:r,auth:i,p256dh:t}};return n!==ct&&(t.web.applicationPubKey=n),t}function ci(n,r,f){return t(this,void 0,void 0,function(){var e,h,s;return i(this,function(c){switch(c.label){case 0:if("granted"!==Notification.permission)throw u.create("permission-blocked");return[4,function(n,r){return t(this,void 0,void 0,function(){var t;return i(this,function(i){switch(i.label){case 0:return[4,n.pushManager.getSubscription()];case 1:return(t=i.sent())?[2,t]:[2,n.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:function(n){for(var n=(n+"=".repeat((4-n.length%4)%4)).replace(/\-/g,"+").replace(/_/g,"/"),i=atob(n),r=new Uint8Array(i.length),t=0;t<i.length;++t)r[t]=i.charCodeAt(t);return r}(r)})]}})})}(r,f)];case 1:return s=c.sent(),[4,lt(n)];case 2:return e=c.sent(),h={vapidKey:f,swScope:r.scope,endpoint:s.endpoint,auth:k(s.getKey("auth")),p256dh:k(s.getKey("p256dh"))},e?[3,3]:[2,eu(n,h)];case 3:if(l=e.subscriptionOptions,v=(a=h).vapidKey===l.vapidKey,y=a.endpoint===l.endpoint,p=a.auth===l.auth,l=a.p256dh===l.p256dh,v&&y&&p&&l)return[3,8];c.label=4;case 4:return c.trys.push([4,6,,7]),[4,uu(n,e.token)];case 5:return c.sent(),[3,7];case 6:return s=c.sent(),console.warn(s),[3,7];case 7:return[2,eu(n,h)];case 8:return Date.now()>=e.createTime+6048e5?[2,function(n,r,f){return t(this,void 0,void 0,function(){var e,s,h;return i(this,function(c){switch(c.label){case 0:return c.trys.push([0,3,,5]),[4,function(n,r){return t(this,void 0,void 0,function(){var o,f,t,e;return i(this,function(i){switch(i.label){case 0:return[4,hi(n)];case 1:o=i.sent();f=fu(r.subscriptionOptions);f={method:"PATCH",headers:o,body:JSON.stringify(f)};i.label=2;case 2:return i.trys.push([2,5,,6]),[4,fetch(si(n.appConfig)+"/"+r.token,f)];case 3:return[4,i.sent().json()];case 4:return t=i.sent(),[3,6];case 5:throw e=i.sent(),u.create("token-update-failed",{errorInfo:e});case 6:if(t.error)throw e=t.error.message,u.create("token-update-failed",{errorInfo:e});if(!t.token)throw u.create("token-update-no-token");return[2,t.token]}})})}(r,n)];case 1:return e=c.sent(),s=o(o({},n),{token:e,createTime:Date.now()}),[4,ei(r,s)];case 2:return c.sent(),[2,e];case 3:return h=c.sent(),[4,rt(r,f)];case 4:throw c.sent(),h;case 5:return[2]}})})}({token:e.token,createTime:Date.now(),subscriptionOptions:h},n,r)]:[2,e.token];case 9:return[2]}var l,a,v,y,p})})}function rt(n,r){return t(this,void 0,void 0,function(){var u;return i(this,function(f){switch(f.label){case 0:return[4,lt(n)];case 1:return(u=f.sent())?[4,uu(n,u.token)]:[3,4];case 2:return f.sent(),[4,function(n){return t(this,void 0,void 0,function(){var r,t;return i(this,function(i){switch(i.label){case 0:return r=oi(n),[4,fi()];case 1:return t=i.sent(),[4,(t=t.transaction(p,"readwrite")).objectStore(p).delete(r)];case 2:return i.sent(),[4,t.complete];case 3:return i.sent(),[2]}})})}(n)];case 3:f.sent();f.label=4;case 4:return[4,r.pushManager.getSubscription()];case 5:return(u=f.sent())?[2,u.unsubscribe()]:[2,!0]}})})}function eu(n,r){return t(this,void 0,void 0,function(){var f;return i(this,function(e){switch(e.label){case 0:return[4,function(n,r){return t(this,void 0,void 0,function(){var o,f,t,e;return i(this,function(i){switch(i.label){case 0:return[4,hi(n)];case 1:o=i.sent();f=fu(r);f={method:"POST",headers:o,body:JSON.stringify(f)};i.label=2;case 2:return i.trys.push([2,5,,6]),[4,fetch(si(n.appConfig),f)];case 3:return[4,i.sent().json()];case 4:return t=i.sent(),[3,6];case 5:throw e=i.sent(),u.create("token-subscribe-failed",{errorInfo:e});case 6:if(t.error)throw e=t.error.message,u.create("token-subscribe-failed",{errorInfo:e});if(!t.token)throw u.create("token-subscribe-no-token");return[2,t.token]}})})}(n,r)];case 1:return f=e.sent(),f={token:f,createTime:Date.now(),subscriptionOptions:r},[4,ei(n,f)];case 2:return e.sent(),[2,f.token]}})})}function lf(n){var t={from:n.from,collapseKey:n.collapse_key};return function(n,t){if(t.notification){n.notification={};var i=t.notification.title;i&&(n.notification.title=i);i=t.notification.body;i&&(n.notification.body=i);t=t.notification.image;t&&(n.notification.image=t)}}(t,n),function(n,t){t.data&&(n.data=t.data)}(t,n),function(n,t){if(t.fcmOptions){n.fcmOptions={};var i=t.fcmOptions.link;i&&(n.fcmOptions.link=i);t=t.fcmOptions.analytics_label;t&&(n.fcmOptions.analyticsLabel=t)}}(t,n),t}function ou(n){return"object"==typeof n&&n&&tu in n}function su(n){return new Promise(function(t){setTimeout(t,n)})}function e(n){var t=this;this.firebaseDependencies=n;this.isOnBackgroundMessageUsed=null;this.vapidKey=null;this.bgMessageHandler=null;self.addEventListener("push",function(n){n.waitUntil(t.onPush(n))});self.addEventListener("pushsubscriptionchange",function(n){n.waitUntil(t.onSubChange(n))});self.addEventListener("notificationclick",function(n){n.waitUntil(t.onNotificationClick(n))})}function cu(){return self.clients.matchAll({type:"window",includeUncontrolled:!0})}function f(n){var t=this;this.firebaseDependencies=n;this.vapidKey=null;this.onMessageCallback=null;navigator.serviceWorker.addEventListener("message",function(n){return t.messageEventListener(n)})}function li(n){return u.create("missing-app-config-values",{valueName:n})}function au(){return self&&"ServiceWorkerGlobalScope"in self?"indexedDB"in self&&null!==indexedDB&&"PushManager"in self&&"Notification"in self&&ServiceWorkerRegistration.prototype.hasOwnProperty("showNotification")&&PushSubscription.prototype.hasOwnProperty("getKey"):"indexedDB"in window&&null!==indexedDB&&navigator.cookieEnabled&&"serviceWorker"in navigator&&"PushManager"in window&&"Notification"in window&&"fetch"in window&&ServiceWorkerRegistration.prototype.hasOwnProperty("showNotification")&&PushSubscription.prototype.hasOwnProperty("getKey")}var ai=vu(n),vi=function(n,t){return(vi=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])})(n,t)},o=function(){return(o=Object.assign||function(n){for(var r,i,t=1,u=arguments.length;t<u;t++)for(i in r=arguments[t])Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i]);return n}).apply(this,arguments)},wi,yu="FirebaseError",bi=(function(n,t){function i(){this.constructor=n}if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");vi(n,t);n.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(at,wi=Error),at),vt=(ki.prototype.create=function(n){for(var i=[],t=1;t<arguments.length;t++)i[t-1]=arguments[t];var r,u=i[0]||{},f=this.service+"/"+n,n=this.errors[n],n=n?(r=u,n.replace(pu,function(n,t){var i=r[t];return null!=i?String(i):"<"+t+"?>"})):"Error",n=this.serviceName+": "+n+" ("+f+").";return new bi(f,n,u)},ki),pu=/\{\$([^}]+)}/g,di=(g.prototype.setInstantiationMode=function(n){return this.instantiationMode=n,this},g.prototype.setMultipleInstances=function(n){return this.multipleInstances=n,this},g.prototype.setServiceProps=function(n){return this.serviceProps=n,this},g.prototype.setInstanceCreatedCallback=function(n){return this.onInstanceCreated=n,this},g),cr,st,l,a,hu,lu;w(c,"_index",["name","keyPath","multiEntry","unique"]);yt(c,"_index",IDBIndex,["get","getKey","getAll","getAllKeys","count"]);nr(c,"_index",IDBIndex,["openCursor","openKeyCursor"]);w(nt,"_cursor",["direction","key","primaryKey","value"]);yt(nt,"_cursor",IDBCursor,["update","delete"]);["advance","continue","continuePrimaryKey"].forEach(function(n){n in IDBCursor.prototype&&(nt.prototype[n]=function(){var t=this,i=arguments;return Promise.resolve().then(function(){return t._cursor[n].apply(t._cursor,i),gi(t._request).then(function(n){if(n)return new nt(n,t._request)})})})});s.prototype.createIndex=function(){return new c(this._store.createIndex.apply(this._store,arguments))};s.prototype.index=function(){return new c(this._store.index.apply(this._store,arguments))};w(s,"_store",["name","keyPath","indexNames","autoIncrement"]);yt(s,"_store",IDBObjectStore,["put","add","delete","clear","get","getAll","getKey","getAllKeys","count"]);nr(s,"_store",IDBObjectStore,["openCursor","openKeyCursor"]);ft(s,"_store",IDBObjectStore,["deleteIndex"]);tt.prototype.objectStore=function(){return new s(this._tx.objectStore.apply(this._tx,arguments))};w(tt,"_tx",["objectStoreNames","mode"]);ft(tt,"_tx",IDBTransaction,["abort"]);et.prototype.createObjectStore=function(){return new s(this._db.createObjectStore.apply(this._db,arguments))};w(et,"_db",["name","version","objectStoreNames"]);ft(et,"_db",IDBDatabase,["deleteObjectStore","close"]);ot.prototype.transaction=function(){return new tt(this._db.transaction.apply(this._db,arguments))};w(ot,"_db",["name","version","objectStoreNames"]);ft(ot,"_db",IDBDatabase,["close"]);["openCursor","openKeyCursor"].forEach(function(n){[s,c].forEach(function(t){n in t.prototype&&(t.prototype[n.replace("open","iterate")]=function(){var i=(t=arguments,Array.prototype.slice.call(t)),u=i[i.length-1],t=this._store||this._index,r=t[n].apply(t,i.slice(0,-1));r.onsuccess=function(){u(r.result)}})})});[c,s].forEach(function(n){n.prototype.getAll||(n.prototype.getAll=function(n,t){var r=this,i=[];return new Promise(function(u){r.iterateCursor(n,function(n){n?(i.push(n.value),void 0===t||i.length!=t?n.continue():u(i)):u(i)})})})});var tr="0.4.26",ir=1e4,rr="w:"+tr,ur="FIS_v2",wu="https://firebaseinstallations.googleapis.com/v1",bu=36e5,r=((r={})["missing-app-config-values"]='Missing App configuration value: "{$valueName}"',r["not-registered"]="Firebase Installation is not registered.",r["installation-not-found"]="Firebase Installation not found.",r["request-failed"]='{$requestName} request failed with error "{$serverCode} {$serverStatus}: {$serverMessage}"',r["app-offline"]="Could not process request. Application offline.",r["delete-pending-registration"]="Can't delete installation while there is a pending registration request.",r),h=new vt("installations","Installations",r);cr=/^[cdef][\w-]{21}$/;st="";l=new Map;a=null;var pr,du="firebase-installations-database",gu=1,v="firebase-installations-store",wr=null;(pr=ai.default).INTERNAL.registerComponent(new di("installations",function(n){var u=n.getProvider("app").getImmediate(),r={appConfig:function(n){var r,f,i,t,u;if(!n||!n.options)throw ri("App Configuration");if(!n.name)throw ri("App Name");try{for(i=d(["projectId","apiKey","appId"]),t=i.next();!t.done;t=i.next())if(u=t.value,!n.options[u])throw ri(u);}catch(n){r={error:n}}finally{try{t&&!t.done&&(f=i.return)&&f.call(i)}finally{if(r)throw r.error;}}return{appName:n.name,projectId:n.options.projectId,apiKey:n.options.apiKey,appId:n.options.appId}}(u),platformLoggerProvider:n.getProvider("platform-logger")};return{app:u,getId:function(){return function(n){return t(this,void 0,void 0,function(){var t,r;return i(this,function(i){switch(i.label){case 0:return[4,ti(n.appConfig)];case 1:return t=i.sent(),r=t.installationEntry,(t.registrationPromise||ii(n)).catch(console.error),[2,r.fid]}})})}(r)},getToken:function(n){return tf(r,n)},"delete":function(){return function(n){return t(this,void 0,void 0,function(){var r,t;return i(this,function(i){switch(i.label){case 0:return[4,it(r=n.appConfig,function(n){if(!n||0!==n.registrationStatus)return n})];case 1:if(!(t=i.sent()))return[3,6];if(1!==t.registrationStatus)return[3,2];throw h.create("delete-pending-registration");case 2:if(2!==t.registrationStatus)return[3,6];if(navigator.onLine)return[3,3];throw h.create("app-offline");case 3:return[4,rf(r,t)];case 4:return i.sent(),[4,ni(r)];case 5:i.sent();i.label=6;case 6:return[2]}})})}(r)},onIdChange:function(n){return uf(r,n)}}},"PUBLIC"));pr.registerVersion("@firebase/installations",tr);var y,r=((r={})["missing-app-config-values"]='Missing App configuration value: "{$valueName}"',r["only-available-in-window"]="This method is available in a Window context.",r["only-available-in-sw"]="This method is available in a service worker context.",r["permission-default"]="The notification permission was not granted and dismissed instead.",r["permission-blocked"]="The notification permission was not granted and blocked instead.",r["unsupported-browser"]="This browser doesn't support the API's required to use the firebase SDK.",r["failed-service-worker-registration"]="We are unable to register the default service worker. {$browserErrorMessage}",r["token-subscribe-failed"]="A problem occurred while subscribing the user to FCM: {$errorInfo}",r["token-subscribe-no-token"]="FCM returned no token when subscribing the user to push.",r["token-unsubscribe-failed"]="A problem occurred while unsubscribing the user from FCM: {$errorInfo}",r["token-update-failed"]="A problem occurred while updating the user from FCM: {$errorInfo}",r["token-update-no-token"]="FCM returned no token when updating the user to push.",r["use-sw-after-get-token"]="The useServiceWorker() method may only be called once and must be called before calling getToken() to ensure your service worker is used.",r["invalid-sw-registration"]="The input to useServiceWorker() must be a ServiceWorkerRegistration.",r["invalid-bg-handler"]="The input to setBackgroundMessageHandler() must be a function.",r["invalid-vapid-key"]="The public VAPID key must be a string.",r["use-vapid-key-after-get-token"]="The usePublicVapidKey() method may only be called once and must be called before calling getToken() to ensure your VAPID key is used.",r),u=new vt("messaging","Messaging",r),ct="BDOU99-h67HcA6JeFXHbSNMu7e2yNNu3RzoMj8TM4W88jITfq7ZmPvIM1Iv-4_l2LxQcYwhqby2xGpWwzjfAnG4",ff="https://fcmregistrations.googleapis.com/v1",nu="FCM_MSG",tu="google.c.a.c_id";(r=y=y||{}).PUSH_RECEIVED="push-received";r.NOTIFICATION_CLICKED="notification-clicked";var ui="fcm_token_details_db",ef=5,iu="fcm_token_object_Store";var hf="firebase-messaging-database",cf=1,p="firebase-messaging-store",ru=null;hu=(Object.defineProperty(e.prototype,"app",{get:function(){return this.firebaseDependencies.app},enumerable:!1,configurable:!0}),e.prototype.setBackgroundMessageHandler=function(n){if(this.isOnBackgroundMessageUsed=!1,!n||"function"!=typeof n)throw u.create("invalid-bg-handler");this.bgMessageHandler=n},e.prototype.onBackgroundMessage=function(n){var t=this;return this.isOnBackgroundMessageUsed=!0,this.bgMessageHandler=n,function(){t.bgMessageHandler=null}},e.prototype.getToken=function(){var n;return t(this,void 0,void 0,function(){var t;return i(this,function(i){switch(i.label){case 0:return this.vapidKey?[3,2]:[4,lt(this.firebaseDependencies)];case 1:t=i.sent();this.vapidKey=null!==(n=null===(n=null==t?void 0:t.subscriptionOptions)||void 0===n?void 0:n.vapidKey)&&void 0!==n?n:ct;i.label=2;case 2:return[2,ci(this.firebaseDependencies,self.registration,this.vapidKey)]}})})},e.prototype.deleteToken=function(){return rt(this.firebaseDependencies,self.registration)},e.prototype.requestPermission=function(){throw u.create("only-available-in-window");},e.prototype.usePublicVapidKey=function(n){if(null!==this.vapidKey)throw u.create("use-vapid-key-after-get-token");if("string"!=typeof n||0===n.length)throw u.create("invalid-vapid-key");this.vapidKey=n},e.prototype.useServiceWorker=function(){throw u.create("only-available-in-window");},e.prototype.onMessage=function(){throw u.create("only-available-in-window");},e.prototype.onTokenRefresh=function(){throw u.create("only-available-in-window");},e.prototype.onPush=function(n){return t(this,void 0,void 0,function(){var r,u,t;return i(this,function(i){switch(i.label){case 0:return(t=function(n){var t=n.data;if(!t)return null;try{return t.json()}catch(n){return null}}(n))?[4,cu()]:(console.debug("FirebaseMessaging: failed to get parsed MessagePayload from the PushEvent. Skip handling the push."),[2]);case 1:return(r=i.sent(),r.some(function(n){return"visible"===n.visibilityState&&!n.url.startsWith("chrome-extension://")}))?[2,function(n,t){var u,f,r,i;t.isFirebaseMessaging=!0;t.messageType=y.PUSH_RECEIVED;try{for(r=d(n),i=r.next();!i.done;i=r.next())i.value.postMessage(t)}catch(n){u={error:n}}finally{try{i&&!i.done&&(f=r.return)&&f.call(r)}finally{if(u)throw u.error;}}}(r,t)]:(u=!1,t.notification?[4,function(n){var i=n.actions,t=Notification.maxActions;return i&&t&&i.length>t&&console.warn("This browser only supports "+t+" actions. The remaining actions will not be displayed."),self.registration.showNotification(null!==(t=n.title)&&void 0!==t?t:"",n)}(((s=o({},(f=t).notification)).data=((e={})[nu]=f,e),s))]:[3,3]);case 2:i.sent();u=!0;i.label=3;case 3:return!0===u&&!1===this.isOnBackgroundMessageUsed?[2]:(this.bgMessageHandler&&(t=lf(t),"function"==typeof this.bgMessageHandler?this.bgMessageHandler(t):this.bgMessageHandler.next(t)),[4,su(1e3)]);case 4:return i.sent(),[2]}var f,e,s})})},e.prototype.onSubChange=function(n){var r;return t(this,void 0,void 0,function(){var t;return i(this,function(i){switch(i.label){case 0:return n.newSubscription?[3,2]:[4,rt(this.firebaseDependencies,self.registration)];case 1:return i.sent(),[2];case 2:return[4,lt(this.firebaseDependencies)];case 3:return t=i.sent(),[4,rt(this.firebaseDependencies,self.registration)];case 4:return i.sent(),[4,ci(this.firebaseDependencies,self.registration,null!==(r=null===(r=null==t?void 0:t.subscriptionOptions)||void 0===r?void 0:r.vapidKey)&&void 0!==r?r:ct)];case 5:return i.sent(),[2]}})})},e.prototype.onNotificationClick=function(n){var r;return t(this,void 0,void 0,function(){var f,e,o,s,u;return i(this,function(h){switch(h.label){case 0:return(f=null===(r=null===(r=n.notification)||void 0===r?void 0:r.data)||void 0===r?void 0:r[nu])?n.action?[2]:(n.stopImmediatePropagation(),n.notification.close(),(e=function(n){var t,i=null!==(t=null===(t=n.fcmOptions)||void 0===t?void 0:t.link)&&void 0!==t?t:null===(i=n.notification)||void 0===i?void 0:i.click_action;return i?i:ou(n.data)?self.location.origin:null}(f))?(o=new URL(e,self.location.href),s=new URL(self.location.origin),o.host!==s.host?[2]:[4,function(n){return t(this,void 0,void 0,function(){var e,r,t,u,o,f,s;return i(this,function(i){switch(i.label){case 0:return[4,cu()];case 1:e=i.sent();try{for(r=d(e),t=r.next();!t.done;t=r.next())if(u=t.value,o=new URL(u.url,self.location.href),n.host===o.host)return[2,u]}catch(i){f={error:i}}finally{try{t&&!t.done&&(s=r.return)&&s.call(r)}finally{if(f)throw f.error;}}return[2,null]}})})}(o)]):[2]):[2];case 1:return(u=h.sent())?[3,4]:[4,self.clients.openWindow(e)];case 2:return u=h.sent(),[4,su(3e3)];case 3:return h.sent(),[3,6];case 4:return[4,u.focus()];case 5:u=h.sent();h.label=6;case 6:return u?(f.messageType=y.NOTIFICATION_CLICKED,f.isFirebaseMessaging=!0,[2,u.postMessage(f)]):[2]}})})},e);lu=(Object.defineProperty(f.prototype,"app",{get:function(){return this.firebaseDependencies.app},enumerable:!1,configurable:!0}),f.prototype.messageEventListener=function(n){return t(this,void 0,void 0,function(){var t,r;return i(this,function(i){switch(i.label){case 0:return(t=n.data).isFirebaseMessaging?(this.onMessageCallback&&t.messageType===y.PUSH_RECEIVED&&("function"==typeof this.onMessageCallback?this.onMessageCallback((delete(u=Object.assign({},t)).messageType,delete u.isFirebaseMessaging,u)):this.onMessageCallback.next(Object.assign({},t))),ou(r=t.data)&&"1"===r["google.c.a.e"]?[4,this.logEvent(t.messageType,r)]:[3,2]):[2];case 1:i.sent();i.label=2;case 2:return[2]}var u})})},f.prototype.getVapidKey=function(){return this.vapidKey},f.prototype.getSwReg=function(){return this.swRegistration},f.prototype.getToken=function(n){return t(this,void 0,void 0,function(){return i(this,function(t){switch(t.label){case 0:return"default"!==Notification.permission?[3,2]:[4,Notification.requestPermission()];case 1:t.sent();t.label=2;case 2:if("granted"!==Notification.permission)throw u.create("permission-blocked");return[4,this.updateVapidKey(null==n?void 0:n.vapidKey)];case 3:return t.sent(),[4,this.updateSwReg(null==n?void 0:n.serviceWorkerRegistration)];case 4:return t.sent(),[2,ci(this.firebaseDependencies,this.swRegistration,this.vapidKey)]}})})},f.prototype.updateVapidKey=function(n){return t(this,void 0,void 0,function(){return i(this,function(){return n?this.vapidKey=n:this.vapidKey||(this.vapidKey=ct),[2]})})},f.prototype.updateSwReg=function(n){return t(this,void 0,void 0,function(){return i(this,function(t){switch(t.label){case 0:return n||this.swRegistration?[3,2]:[4,this.registerDefaultSw()];case 1:t.sent();t.label=2;case 2:if(!n&&this.swRegistration)return[2];if(!(n instanceof ServiceWorkerRegistration))throw u.create("invalid-sw-registration");return this.swRegistration=n,[2]}})})},f.prototype.registerDefaultSw=function(){return t(this,void 0,void 0,function(){var n;return i(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),n=this,[4,navigator.serviceWorker.register("/firebase-messaging-sw.js",{scope:"/firebase-cloud-messaging-push-scope"})];case 1:return n.swRegistration=t.sent(),this.swRegistration.update().catch(function(){}),[3,3];case 2:throw n=t.sent(),u.create("failed-service-worker-registration",{browserErrorMessage:n.message});case 3:return[2]}})})},f.prototype.deleteToken=function(){return t(this,void 0,void 0,function(){return i(this,function(n){switch(n.label){case 0:return this.swRegistration?[3,2]:[4,this.registerDefaultSw()];case 1:n.sent();n.label=2;case 2:return[2,rt(this.firebaseDependencies,this.swRegistration)]}})})},f.prototype.requestPermission=function(){return t(this,void 0,void 0,function(){var n;return i(this,function(t){switch(t.label){case 0:return"granted"===Notification.permission?[2]:[4,Notification.requestPermission()];case 1:if("granted"===(n=t.sent()))return[2];throw"denied"===n?u.create("permission-blocked"):u.create("permission-default");}})})},f.prototype.usePublicVapidKey=function(n){if(null!==this.vapidKey)throw u.create("use-vapid-key-after-get-token");if("string"!=typeof n||0===n.length)throw u.create("invalid-vapid-key");this.vapidKey=n},f.prototype.useServiceWorker=function(n){if(!(n instanceof ServiceWorkerRegistration))throw u.create("invalid-sw-registration");if(this.swRegistration)throw u.create("use-sw-after-get-token");this.swRegistration=n},f.prototype.onMessage=function(n){var t=this;return this.onMessageCallback=n,function(){t.onMessageCallback=null}},f.prototype.setBackgroundMessageHandler=function(){throw u.create("only-available-in-sw");},f.prototype.onBackgroundMessage=function(){throw u.create("only-available-in-sw");},f.prototype.onTokenRefresh=function(){return function(){}},f.prototype.logEvent=function(n,r){return t(this,void 0,void 0,function(){var t;return i(this,function(i){switch(i.label){case 0:return t=function(n){switch(n){case y.NOTIFICATION_CLICKED:return"notification_open";case y.PUSH_RECEIVED:return"notification_foreground";default:throw new Error;}}(n),[4,this.firebaseDependencies.analyticsProvider.get()];case 1:return i.sent().logEvent(t,{message_id:r[tu],message_name:r["google.c.a.c_l"],message_time:r["google.c.a.ts"],message_device_time:Math.floor(Date.now()/1e3)}),[2]}})})},f);r={isSupported:au};ai.default.INTERNAL.registerComponent(new di("messaging",function(n){var t=n.getProvider("app").getImmediate(),n={app:t,appConfig:function(n){var u,e,t,r,i,f;if(!n||!n.options)throw li("App Configuration Object");if(!n.name)throw li("App Name");t=n.options;try{for(r=d(["projectId","apiKey","appId","messagingSenderId"]),i=r.next();!i.done;i=r.next())if(f=i.value,!t[f])throw li(f);}catch(n){u={error:n}}finally{try{i&&!i.done&&(e=r.return)&&e.call(r)}finally{if(u)throw u.error;}}return{appName:n.name,projectId:t.projectId,apiKey:t.apiKey,appId:t.appId,senderId:t.messagingSenderId}}(t),installations:n.getProvider("installations").getImmediate(),analyticsProvider:n.getProvider("analytics-internal")};if(!au())throw u.create("unsupported-browser");return new(self&&"ServiceWorkerGlobalScope"in self?hu:lu)(n)},"PUBLIC").setServiceProps(r))}.apply(this,arguments)}catch(t){throw console.error(t),new Error("Cannot instantiate firebase-messaging.js - be sure to load firebase-app.js first.");}});config={apiKey:"AIzaSyDoBuYQE8ZWETS4pC3bfs_A-km0VPe60LU",authDomain:"chobrod-notify.firebaseapp.com",databaseURL:"https://chobrod-notify.firebaseio.com",projectId:"chobrod-notify",storageBucket:"chobrod-notify.appspot.com",messagingSenderId:"274237931818",appId:"1:274237931818:web:f6b88a824bd59e87501e53",measurementId:"G-2ETGE83E3P"};firebase.initializeApp(config);const messaging=firebase.messaging();messaging.usePublicVapidKey("BLDtqz_12ltGHiw9rVCHJDZHRS9akLMsVIb2u9QHLnOgZQsbWTmoVNXBrEudUbXSqXbi4O-JdTaS89jGhA1Pk1k");notifyMesage={MessageData:{},ClearPopupNotify:"",Init:function(){notifyMesage.RequestPermission();notifyMesage.BackgroundServicePushMesage()},InitFirebase:function(){messaging.getToken().then(n=>{if(n)if(Commons.CheckCookie("firebaseToken")){var t=Commons.GetCookie("firebaseToken");t===n&&Commons.CheckCookie("addFirebaseToken")||notifyMesage.AddFirebaseToken(n)}else notifyMesage.AddFirebaseToken(n);else notifyMesage.RequestPermission()}).catch(n=>{console.log("An error occurred while retrieving token. ",n)});messaging.onMessage(function(n){typeof ChatClient!="undefined"&&(notifyMesage.MessageData=n.data,ChatClient.ChatCountNotRead(notifyMesage.PopupNotify))})},AddFirebaseToken:function(n){Commons.SetCookie("addFirebaseToken",n,-1);var t=$("#cUserId").val();t!=null&&t!=undefined&&t!=""&&t!="0"&&$.ajax({type:"POST",cache:!1,url:"/commons/addtokenfirebase/",data:{firebaseToken:n}})},RequestPermission:function(){if(Notification.permission==="granted")notifyMesage.InitFirebase();else if(typeof localStorage!="undefined"){var n=0;localStorage.getItem("RequestPermission")?(n=parseInt(localStorage.getItem("RequestPermission")),n%5==0&&notifyMesage.PopupRequestPermission()):notifyMesage.PopupRequestPermission();n=n+1;n>100&&(n=1);localStorage.setItem("RequestPermission",n++)}},BackgroundServicePushMesage:function(){if(Notification.permission==="granted"){var n=new BroadcastChannel("pushnotify");n.onmessage=function(n){typeof ChatClient!="undefined"&&(notifyMesage.MessageData=n.data.data,ChatClient.ChatCountNotRead(notifyMesage.PopupNotify))}}},PopupRequestPermission:function(){return!0},CancelPermission:function(){$("#popup").empty();$("body").removeClass("no-scroll");typeof localStorage!="undefined"&&localStorage.setItem("EnableRequestPermission",!0)},EnablePermission:function(){$("#popup").empty();$("body").removeClass("no-scroll");Notification.requestPermission().then(function(n){n==="granted"&&(typeof localStorage!="undefined"&&localStorage.setItem("EnableRequestPermission",!0),notifyMesage.InitFirebase(),notifyMesage.BackgroundServicePushMesage())})},PopupNotify:function(n){var i=$("#cUserId").val(),r,t;i!=null&&i!=undefined&&i!=""&&i!="0"&&(r="1",n>0&&(r=n>10?"10+":""+n),t="",t+='<div class="pu-notify-chat">',t+='    <div class="notify-chat-content">',t+='       <a href="'+decodeURIComponent(notifyMesage.MessageData.url)+'">',t+='           <h3 class="author-name">'+decodeURIComponent(notifyMesage.MessageData.user_from_name)+"<\/h3>",t+='           <div class="desc">'+decodeURIComponent(notifyMesage.MessageData.content)+"<\/div>",t+="       <\/a>",t+='       <span class="popup_close" onclick="notifyMesage.ClosePopupNotify();"><i class="icon-cancel"><\/i><\/span>',t+="    <\/div>",t+='    <div class="btn-chat">',t+='       <a href="'+decodeURIComponent(notifyMesage.MessageData.url)+'">',t+='           <i class="cicon-chat"><\/i>',t+='           <span class="lbl-notify">'+r+"<\/span>",t+="       <\/a>",t+="    <\/div>",t+=" <\/div>",$("#popup").empty().html(t).show(),clearTimeout(notifyMesage.ClearPopupNotify),notifyMesage.ClearPopupNotify=setTimeout(function(){$("#popup").fadeOut(500)},5e3));notifyMesage.MessageData={}},ClosePopupNotify:function(){$("#popup").empty()}};$(document).ready(function(){notifyMesage.Init()});