PageSourceSearch

https://cangrande-hotel.web.app/chunk-AEEO376M.js

js cangrande-hotel.web.app collected 2026-10-03 12:19:41 UTC 46,658 bytes, 1 lines download raw bytes

vendor: 4,567 bytes, line 1
1import{a as z,b as Pe,c as xe,d as Be}from"./chunk-MOHNRJGN.js";import{a as m,b as L,g as c}from"./chunk-RA2WU32H.js";var Le=()=>{};var Ue=function(t){let e=[],n=0;for(let r=0;r<t.length;r++){let i=t.charCodeAt(r);i<128?e[n++]=i:i<2048?(e[n++]=i>>6|192,e[n++]=i&63|128):(i&64512)===55296&&r+1<t.length&&(t.charCodeAt(r+1)&64512)===56320?(i=65536+((i&1023)<<10)+(t.charCodeAt(++r)&1023),e[n++]=i>>18|240,e[n++]=i>>12&63|128,e[n++]=i>>6&63|128,e[n++]=i&63|128):(e[n++]=i>>12|224,e[n++]=i>>6&63|128,e[n++]=i&63|128)}return e},Gt=function(t){let e=[],n=0,r=0;for(;n<t.length;){let i=t[n++];if(i<128)e[r++]=String.fromCharCode(i);else if(i>191&&i<224){let s=t[n++];e[r++]=String.fromCharCode((i&31)<<6|s&63)}else if(i>239&&i<365){let s=t[n++],a=t[n++],o=t[n++],d=((i&7)<<18|(s&63)<<12|(a&63)<<6|o&63)-65536;e[r++]=String.fromCharCode(55296+(d>>10)),e[r++]=String.fromCharCode(56320+(d&1023))}else{let s=t[n++],a=t[n++];e[r++]=String.fromCharCode((i&15)<<12|(s&63)<<6|a&63)}}return e.join("")},$e={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:typeof atob=="function",encodeByteArray(t,e){if(!Array.isArray(t))throw Error("encodeByteArray takes an array as a parameter");this.init_();let n=e?this.byteToCharMapWebSafe_:this.byteToCharMap_,r=[];for(let i=0;i<t.length;i+=3){let s=t[i],a=i+1<t.length,o=a?t[i+1]:0,d=i+2<t.length,g=d?t[i+2]:0,_=s>>2,u=(s&3)<<4|o>>4,y=(o&15)<<2|g>>6,C=g&63;d||(C=64,a||(y=64)),r.push(n[_],n[u],n[y],n[C])}return r.join("")},encodeString(t,e){return this.HAS_NATIVE_SUPPORT&&!e?btoa(t):this.encodeByteArray(Ue(t),e)},decodeString(t,e){return this.HAS_NATIVE_SUPPORT&&!e?atob(t):Gt(this.decodeStringToByteArray(t,e))},decodeStringToByteArray(t,e){this.init_();let n=e?this.charToByteMapWebSafe_:this.charToByteMap_,r=[];for(let i=0;i<t.length;){let s=n[t.charAt(i++)],o=i<t.length?n[t.charAt(i)]:0;++i;let g=i<t.length?n[t.charAt(i)]:64;++i;let u=i<t.length?n[t.charAt(i)]:64;if(++i,s==null||o==null||g==null||u==null)throw new te;let y=s<<2|o>>4;if(r.push(y),g!==64){let C=o<<4&240|g>>2;if(r.push(C),u!==64){let qt=g<<6&192|u;r.push(qt)}}}return r},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let t=0;t<this.ENCODED_VALS.length;t++)this.byteToCharMap_[t]=this.ENCODED_VALS.charAt(t),this.charToByteMap_[this.byteToCharMap_[t]]=t,this.byteToCharMapWebSafe_[t]=this.ENCODED_VALS_WEBSAFE.charAt(t),this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[t]]=t,t>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(t)]=t,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(t)]=t)}}},te=class extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}},Kt=function(t){let e=Ue(t);return $e.encodeByteArray(e,!0)},ne=function(t){return Kt(t).replace(/\./g,"")},ze=function(t){try{return $e.decodeString(t,!0)}catch(e){console.error("base64Decode failed: ",e)}return null};function Jt(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("Unable to locate global object.")}var Xt=()=>Jt().__FIREBASE_DEFAULTS__,Yt=()=>{if(typeof process>"u"||typeof process.env>"u")return;let t=process.env.__FIREBASE_DEFAULTS__;if(t)return JSON.parse(t)},Zt=()=>{if(typeof document>"u")return;let t;try{t=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch{return}let e=t&&ze(t[1]);return e&&JSON.parse(e)},Qt=()=>{try{return Le()||Xt()||Yt()||Zt()}catch(t){console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${t}`);return}};var re=()=>Qt()?.config;var H=class{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise((e,n)=>{this.resolve=e,this.reject=n})}wrapCallback(e){return(n,r)=>{n?this.reject(n):this.resolve(r),typeof e=="function"&&(this.promise.catch(()=>{}),e.length===1?e(n):e(n,r))}}};function V(){try{return typeof indexedDB=="object"}catch{return!1}}function j(){return new Promise((t,e)=>{try{let n=!0,r="validate-browser-context-for-indexeddb-analytics-module",i=self.indexedDB.open(r);i.onsuccess=()=>{i.result.close(),n||self.indexedDB.deleteDatabase(r),t(!0)},i.onupgradeneeded=()=>{n=!1},i.onerror=()=>{e(i.error?.message||"")}}catch(n){e(n)}})}function He(){return!(typeof navigator>"u"||!navigator.cookieEnabled)}
vendor: 7,357 bytes, line 1
1var en="FirebaseError",T=class t extends Error{constructor(e,n,r){super(n),this.code=e,this.customData=r,this.name=en,Object.setPrototypeOf(this,t.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,A.prototype.create)}},A=class{constructor(e,n,r){this.service=e,this.serviceName=n,this.errors=r}create(e,...n){let r=n[0]||{},i=`${this.service}/${e}`,s=this.errors[e],a=s?tn(s,r):"Error",o=`${this.serviceName}: ${a} (${i}).`;return new T(i,o,r)}};function tn(t,e){return t.replace(nn,(n,r)=>{let i=e[r];return i!=null?String(i):`<${r}?>`})}var nn=/\{\$([^}]+)}/g;function P(t,e){if(t===e)return!0;let n=Object.keys(t),r=Object.keys(e);for(let i of n){if(!r.includes(i))return!1;let s=t[i],a=e[i];if(Fe(s)&&Fe(a)){if(!P(s,a))return!1}else if(s!==a)return!1}for(let i of r)if(!n.includes(i))return!1;return!0}function Fe(t){return t!==null&&typeof t=="object"}var $i=14400*1e3;function W(t){return t&&t._delegate?t._delegate:t}var rn=[],l=(function(t){return t[t.DEBUG=0]="DEBUG",t[t.VERBOSE=1]="VERBOSE",t[t.INFO=2]="INFO",t[t.WARN=3]="WARN",t[t.ERROR=4]="ERROR",t[t.SILENT=5]="SILENT",t})(l||{}),sn={debug:l.DEBUG,verbose:l.VERBOSE,info:l.INFO,warn:l.WARN,error:l.ERROR,silent:l.SILENT},on=l.INFO,an={[l.DEBUG]:"log",[l.VERBOSE]:"log",[l.INFO]:"info",[l.WARN]:"warn",[l.ERROR]:"error"},cn=(t,e,...n)=>{if(e<t.logLevel)return;let r=new Date().toISOString(),i=an[e];if(i)console[i](`[${r}]  ${t.name}:`,...n);else throw new Error(`Attempted to log a message with an invalid logType (value: ${e})`)},x=class{constructor(e){this.name=e,this._logLevel=on,this._logHandler=cn,this._userLogHandler=null,rn.push(this)}get logLevel(){return this._logLevel}set logLevel(e){if(!(e in l))throw new TypeError(`Invalid value "${e}" assigned to \`logLevel\``);this._logLevel=e}setLogLevel(e){this._logLevel=typeof e=="string"?sn[e]:e}get logHandler(){return this._logHandler}set logHandler(e){if(typeof e!="function")throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=e}get userLogHandler(){return this._userLogHandler}set userLogHandler(e){this._userLogHandler=e}debug(...e){this._userLogHandler&&this._userLogHandler(this,l.DEBUG,...e),this._logHandler(this,l.DEBUG,...e)}log(...e){this._userLogHandler&&this._userLogHandler(this,l.VERBOSE,...e),this._logHandler(this,l.VERBOSE,...e)}info(...e){this._userLogHandler&&this._userLogHandler(this,l.INFO,...e),this._logHandler(this,l.INFO,...e)}warn(...e){this._userLogHandler&&this._userLogHandler(this,l.WARN,...e),this._logHandler(this,l.WARN,...e)}error(...e){this._userLogHandler&&this._userLogHandler(this,l.ERROR,...e),this._logHandler(this,l.ERROR,...e)}};var E=class{constructor(e,n,r){this.name=e,this.instanceFactory=n,this.type=r,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}setInstantiationMode(e){return this.instantiationMode=e,this}setMultipleInstances(e){return this.multipleInstances=e,this}setServiceProps(e){return this.serviceProps=e,this}setInstanceCreatedCallback(e){return this.onInstanceCreated=e,this}};var R="[DEFAULT]";var ie=class{constructor(e,n){this.name=e,this.container=n,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}get(e){let n=this.normalizeInstanceIdentifier(e);if(!this.instancesDeferred.has(n)){let r=new H;if(this.instancesDeferred.set(n,r),this.isInitialized(n)||this.shouldAutoInitialize())try{let i=this.getOrInitializeService({instanceIdentifier:n});i&&r.resolve(i)}catch{}}return this.instancesDeferred.get(n).promise}getImmediate(e){let n=this.normalizeInstanceIdentifier(e?.identifier),r=e?.optional??!1;if(this.isInitialized(n)||this.shouldAutoInitialize())try{return this.getOrInitializeService({instanceIdentifier:n})}catch(i){if(r)return null;throw i}else{if(r)return null;throw Error(`Service ${this.name} is not available`)}}getComponent(){return this.component}setComponent(e){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(un(e))try{this.getOrInitializeService({instanceIdentifier:R})}catch{}for(let[n,r]of this.instancesDeferred.entries()){let i=this.normalizeInstanceIdentifier(n);try{let s=this.getOrInitializeService({instanceIdentifier:i});r.resolve(s)}catch{}}}}clearInstance(e=R){this.instancesDeferred.delete(e),this.instancesOptions.delete(e),this.instances.delete(e)}delete(){return c(this,null,function*(){let e=Array.from(this.instances.values());yield Promise.all([...e.filter(n=>"INTERNAL"in n).map(n=>n.INTERNAL.delete()),...e.filter(n=>"_delete"in n).map(n=>n._delete())])})}isComponentSet(){return this.component!=null}isInitialized(e=R){return this.instances.has(e)}getOptions(e=R){return this.instancesOptions.get(e)||{}}initialize(e={}){let{options:n={}}=e,r=this.normalizeInstanceIdentifier(e.instanceIdentifier);if(this.isInitialized(r))throw Error(`${this.name}(${r}) has already been initialized`);if(!this.isComponentSet())throw Error(`Component ${this.name} has not been registered yet`);let i=this.getOrInitializeService({instanceIdentifier:r,options:n});for(let[s,a]of this.instancesDeferred.entries()){let o=this.normalizeInstanceIdentifier(s);r===o&&a.resolve(i)}return i}onInit(e,n){let r=this.normalizeInstanceIdentifier(n),i=this.onInitCallbacks.get(r)??new Set;i.add(e),this.onInitCallbacks.set(r,i);let s=this.instances.get(r);return s&&e(s,r),()=>{i.delete(e)}}invokeOnInitCallbacks(e,n){let r=this.onInitCallbacks.get(n);if(r)for(let i of r)try{i(e,n)}catch{}}getOrInitializeService({instanceIdentifier:e,options:n={}}){let r=this.instances.get(e);if(!r&&this.component&&(r=this.component.instanceFactory(this.container,{instanceIdentifier:ln(e),options:n}),this.instances.set(e,r),this.instancesOptions.set(e,n),this.invokeOnInitCallbacks(r,e),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,e,r)}catch{}return r||null}normalizeInstanceIdentifier(e=R){return this.component?this.component.multipleInstances?e:R:e}shouldAutoInitialize(){return!!this.component&&this.component.instantiationMode!=="EXPLICIT"}};function ln(t){return t===R?void 0:t}function un(t){return t.instantiationMode==="EAGER"}var q=class{constructor(e){this.name=e,this.providers=new Map}addComponent(e){let n=this.getProvider(e.name);if(n.isComponentSet())throw new Error(`Component ${e.name} has already been registered with ${this.name}`);n.setComponent(e)}addOrOverwriteComponent(e){this.getProvider(e.name).isComponentSet()&&this.providers.delete(e.name),this.addComponent(e)}getProvider(e){if(this.providers.has(e))return this.providers.get(e);let n=new ie(e,this);return this.providers.set(e,n),n}getProviders(){return Array.from(this.providers.values())}};var oe=class{constructor(e){this.container=e}getPlatformInfoString(){return this.container.getProviders().map(n=>{if(fn(n)){let r=n.getImmediate();return`${r.library}/${r.version}`}else return null}).filter(n=>n).join(" ")}};function fn(t){return t.getComponent()?.type==="VERSION"}var ae="@firebase/app",Ve="0.14.5";var v=new x("@firebase/app"),dn="@firebase/app-compat",hn="@firebase/analytics-compat",pn="@firebase/analytics",gn="@firebase/app-check-compat",mn="@f
1irebase/app-check",bn="@firebase/auth",_n="@firebase/auth-compat",En="@firebase/database",In="@firebase/data-connect",yn="@firebase/database-compat",Tn="@firebase/functions",An="@firebase/functions-compat",Sn="@firebase/installations",vn="@firebase/installations-compat",wn="@firebase/messaging",Cn="@firebase/messaging-compat",Nn="@firebase/performance",On="@firebase/performance-compat",Rn="@firebase/remote-config",Dn="@firebase/remote-config-compat",Mn="@firebase/storage",kn="@firebase/storage-compat",Pn="@firebase/firestore",xn="@firebase/ai",Bn="@firebase/firestore-compat",Ln="firebase";var ce="[DEFAULT]",Fn={[ae]:"fire-core",[dn]:"fire-core-compat",[pn]:"fire-analytics",[hn]:"fire-analytics-compat",[mn]:"fire-app-check",[gn]:"fire-app-check-compat",[bn]:"fire-auth",[_n]:"fire-auth-compat",[En]:"fire-rtdb",[In]:"fire-data-connect",[yn]:"fire-rtdb-compat",[Tn]:"fire-fn",[An]:"fire-fn-compat",[Sn]:"fire-iid",[vn]:"fire-iid-compat",[wn]:"fire-fcm",[Cn]:"fire-fcm-compat",[Nn]:"fire-perf",[On]:"fire-perf-compat",[Rn]:"fire-rc",[Dn]:"fire-rc-compat",[Mn]:"fire-gcs",[kn]:"fire-gcs-compat",[Pn]:"fire-fst",[Bn]:"fire-fst-compat",[xn]:"fire-vertex","fire-js":"fire-js",[Ln]:"fire-js-all"};var G=new Map,Un=new Map,le=new Map;function je(t,e){try{t.container.addComponent(e)}catch(n){v.debug(`Component ${e.name} failed to register with FirebaseApp ${t.name}`,n)}}function O(t){let e=t.name;if(le.has(e))return v.debug(`There were multiple attempts to register component ${e}.`),!1;le.set(e,t);for(let n of G.values())je(n,t);for(let n of Un.values())je(n,t);return!0}function B(t,e){let n=t.container.getProvider("heartbeat").getImmediate({optional:!0});return n&&n.triggerHeartbeat(),t.container.getProvider(e)}var $n={"no-app":"No Firebase App '{$appName}' has been created - call initializeApp() first","bad-app-name":"Illegal App name: '{$appName}'","duplicate-app":"Firebase App named '{$appName}' already exists with different options or config","app-deleted":"Firebase App named '{$appName}' already deleted","server-app-deleted":"Firebase Server App has been deleted","no-options":"Need to provide options, when not being deployed to hosting via source.","invalid-app-argument":"firebase.{$appName}() takes either no argument or a Firebase App instance.","invali
1d-log-argument":"First argument to `onLog` must be null or a function.","idb-open":"Error thrown when opening IndexedDB. Original error: {$originalErrorMessage}.","idb-get":"Error thrown when reading from IndexedDB. Original error: {$originalErrorMessage}.","idb-set":"Error thrown when writing to IndexedDB. Original error: {$originalErrorMessage}.","idb-delete":"Error thrown when deleting from IndexedDB. Original error: {$originalErrorMessage}.","finalization-registry-not-supported":"FirebaseServerApp deleteOnDeref field defined but the JS runtime does not support FinalizationRegistry.","invalid-server-app-environment":"FirebaseServerApp is not for use in browser environments."},N=new A("app","Firebase",$n);var ue=class{constructor(e,n,r){this._isDeleted=!1,this._options=m({},e),this._config=m({},n),this._name=n.name,this._automaticDataCollectionEnabled=n.automaticDataCollectionEnabled,this._container=r,this.container.addComponent(new E("app",()=>this,"PUBLIC"))}get automaticDataCollectionEnabled(){return this.checkDestroyed(),this._automaticDataCollectionEnabled}set automaticDataCollectionEnabled(e){this.checkDestroyed(),this._automaticDataCollectionEnabled=e}get name(){return this.checkDestroyed(),this._name}get options(){return this.checkDestroyed(),this._options}get config(){return this.checkDestroyed(),this._config}get container(){return this._container}get isDeleted(){return this._isDeleted}set isDeleted(e){this._isDeleted=e}checkDestroyed(){if(this.isDeleted)throw N.create("app-deleted",{appName:this._name})}};function zn(t,e={}){let n=t;typeof e!="object"&&(e={name:e});let r=m({name:ce,automaticDataCollectionEnabled:!0},e),i=r.name;if(typeof i!="string"||!i)throw N.create("bad-app-name",{appName:String(i)});if(n||(n=re()),!n)throw N.create("no-options");let s=G.get(i);if(s){if(P(n,s.options)&&P(r,s.config))return s;throw N.create("duplicate-app",{appName:i})}let a=new q(i);for(let d of le.values())a.addComponent(d);let o=new ue(n,r,a);return G.set(i,o),o}function he(t=ce){let e=G.get(t);if(!e&&t===ce&&re())return zn();if(!e)throw N.create("no-app",{appName:t});return e}function S(t,e,n){let r=Fn[t]??t;n&&(r+=`-${n}`);let i=r.match(/\s|\//),s=e.match(/\s|\//);if(i||s){let a=[`Unable to register library "${r}" with version "${e}":`];i&&a.push(`library name "${r}" contains illegal characters (whitespace or "/")`),i&&s&&a.push("and"),s&&a.push(`version name "${e}" contains illegal characters (whitespace or "/")`),v.warn(a.join(" "));return}O(new E(`${r}-version`,()=>({library:r,version:e}),"VERSION"))}var Hn="firebase-heartbeat-database",Vn=1,F="firebase-heartbeat-store",se=null;function Ke(){return se||(se=z(Hn,Vn,{upgrade:(t,e)=>{switch(e){case 0:try{t.createObjectStore(F)}catch(n){console.warn(n)}}}}).catch(t=>{throw N.create("idb-open",{originalErrorMessage:t.message})})),se}function jn(t){return c(this,null,function*(){try{let n=(yield Ke()).transaction(F),r=yield n.objectStore(F).get(Je(t));return yield n.done,r}catch(e){if(e instanceof T)v.warn(e.message);else{let n=N.create("idb-get",{originalErrorMessage:e?.message});v.warn(n.message)}}})}function We(t,e){return c(this,null,function*(){try{let r=(yield Ke()).transaction(F,"readwrite");yield r.objectStore(F).put(e,Je(t)),yield r.done}catch(n){if(n instanceof T)v.warn(n.message);else{let r=N.create("idb-set",{originalErrorMessage:n?.message});v.warn(r.message)}}})}function Je(t){return`${t.name}!${t.options.appId}`}var Wn=1024,qn=30,fe=class{constructor(e){this.container=e,this._heartbeatsCache=null;let n=this.container.getProvider("app").getImmediate();this._storage=new de(n),this._heartbeatsCachePromise=this._storage.read().then(r=>(this._heartbeatsCache=r,r))}triggerHeartbeat(){return c(this,null,function*(){try{let n=this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(),r=qe();if(this._heartbeatsCache?.heartbeats==null&&(this._heartbeatsCache=yield this._heartbeatsCachePromise,this._heartbeatsCache?.heartbeats==null)||this._heartbeatsCache.lastSentHeartbeatDate===r||this._heartbeatsCache.heartbeats.some(i=>i.date===r))return;if(this._heartbeatsCache.heartbeats.push({date:r,agent:n}),this._heartbeatsCache.heartbeats.length>qn){let i=Kn(this._heartbeatsCache.heartbeats);this._heartbeatsCache.heartbeats.splice(i,1)}return this._storage.overwrite(this._heartbeatsCache)}catch(e){v.warn(e)}})}getHeartbeatsHeader(){return c(this,null,function*(){try{if(this._heartbeatsCache===null&&(yield this._heartbeatsCachePromise),this._heartbeatsCache?.heartbeats==null||this._heartbeatsCache.heartbeats.length===0)return"";let e=qe(),{heartbeatsToSend:n,unsentEntries:r}=Gn(this._heartbeatsCache.heartbeats),i=ne(JSON.stringify({version:2,heartbeats:n}));return this._heartbeatsCache.lastSentHeartbeatDate=e,r.length>0?(this._heartbeatsCache.heartbeats=r,yield this._storage.overwrite(this._heartbeatsCache)):(this._heartbeatsCache.heartbeats=[],this._storage.overwrite(this._heartbeatsCache)),i}catch(e){return v.warn(e),""}})}};function qe(){return new Date().toISOString().substring(0,10)}function Gn(t,e=Wn){let n=[],r=t.slice();for(let i of t){let s=n.find(a=>a.agent===i.agent);if(s){if(s.dates.push(i.date),Ge(n)>e){s.dates.pop();break}}else if(n.push({agent:i.agent,dates:[i.date]}),Ge(n)>e){n.pop();break}r=r.slice(1)}return{heartbeatsToSend:n,unsentEntries:r}}var de=class{constructor(e){this.app=e,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}runIndexedDBEnvironmentCheck(){return c(this,null,function*(){return V()?j().then(()=>!0).catch(()=>!1):!1})}read(){return c(this,null,function*(){if(yield this._canUseIndexedDBPromise){let n=yield jn(this.app);return n?.heartbeats?n:{heartbeats:[]}}else return{heartbeats:[]}})}overwrite(e){return c(this,null,function*(){if(yield this._canUseIndexedDBPromise){let r=yield this.read();return We(this.app,{lastSentHeartbeatDate:e.lastSentHeartbeatDate??r.lastSentHeartbeatDate,heartbeats:e.heartbeats})}else return})}add(e){return c(this,null,function*(){if(yield this._canUseIndexedDBPromise){let r=yield this.read();return We(this.app,{lastSentHeartbeatDate:e.lastSentHeartbeatDate??r.lastSentHeartbeatDate,heartbeats:[...r.heartbeats,...e.heartbeats]})}else return})}};function Ge(t){return ne(JSON.stringify({version:2,heartbeats:t})).length}function Kn(t){if(t.length===0)return-1;let e=0,n=t[0].date;for(let r=1;r<t.length;r++)t[r].date<n&&(n=t[r].date,e=r);return e}function Jn(t){O(new E("platform-logger",e=>new oe(e),"PRIVATE")),O(new E("heartbeat",e=>new fe(e),"PRIVATE")),S(ae,Ve,t),S(ae,Ve,"esm2020"),S("fire-js","")}Jn("");var Ze="@firebase/installations",be="0.6.19";var Qe=1e4,et=`w:${be}`,tt="FIS_v2",Xn="https://firebaseinstallations.googleapis.com/v1",Yn=3600*1e3,Zn="installations",Qn="Installations";var er={"missing-app-config-values":'Missing App configuration value: "{$valueName}"',"not-registered":"Firebase Installation is not registered.","installation-not-found":"Firebase Installation not found.","request-failed":'{$requestName} request failed with error "{$serverCode} {$serverStatus}: {$serverMessage}"',"app-offline":"Could not process request. Application offline.","delete-pending-registration":"Can't delete installation while there is a pending registration request."},M=new A(Zn,Qn,er);function nt(t){return t instanceof T&&t.code.includes("request-failed")}function rt({projectId:t}){return`${Xn}/projects/${t}/installations`}
1function it(t){return{token:t.token,requestStatus:2,expiresIn:nr(t.expiresIn),creationTime:Date.now()}}function st(t,e){return c(this,null,function*(){let r=(yield e.json()).error;return M.create("request-failed",{requestName:t,serverCode:r.code,serverMessage:r.message,serverStatus:r.status})})}function ot({apiKey:t}){return new Headers({"Content-Type":"application/json",Accept:"application/json","x-goog-api-key":t})}function tr(t,{refreshToken:e}){let n=ot(t);return n.append("Authorization",rr(e)),n}function at(t){return c(this,null,function*(){let e=yield t();return e.status>=500&&e.status<600?t():e})}function nr(t){return Number(t.replace("s","000"))}function rr(t){return`${tt} ${t}`}function ir(r,i){return c(this,arguments,function*({appConfig:t,heartbeatServiceProvider:e},{fid:n}){let s=rt(t),a=ot(t),o=e.getImmediate({optional:!0});if(o){let u=yield o.getHeartbeatsHeader();u&&a.append("x-firebase-client",u)}let d={fid:n,authVersion:tt,appId:t.appId,sdkVersion:et},g={method:"POST",headers:a,body:JSON.stringify(d)},_=yield at(()=>fetch(s,g));if(_.ok){let u=yield _.json();return{fid:u.fid||n,registrationStatus:2,refreshToken:u.refreshToken,authToken:it(u.authToken)}}else throw yield st("Create Installation",_)})}function ct(t){return new Promise(e=>{setTimeout(e,t)})}function sr(t){return btoa(String.fromCharCode(...t)).replace(/\+/g,"-").replace(/\//g,"_")}var or=/^[cdef][\w-]{21}$/,me="";function ar(){try{let t=new Uint8Array(17);(self.crypto||self.msCrypto).getRandomValues(t),t[0]=112+t[0]%16;let n=cr(t);return or.test(n)?n:me}catch{return me}}function cr(t){return sr(t).substr(0,22)}function J(t){return`${t.appName}!${t.appId}`}var lt=new Map;function ut(t,e){let n=J(t);ft(n,e),lr(n,e)}function ft(t,e){let n=lt.get(t);if(n)for(let r of n)r(e)}function lr(t,e){let n=ur();n&&n.postMessage({key:t,fid:e}),fr()}var D=null;function ur(){return!D&&"BroadcastChannel"in self&&(D=new BroadcastChannel("[Firebase] FID Change"),D.onmessage=t=>{ft(t.data.key,t.data.fid)}),D}function fr(){lt.size===0&&D&&(D.close(),D=null)}var dr="firebase-installations-database",hr=1,k="firebase-installations-store",pe=null;function _e(){return pe||(pe=z(dr,hr,{upgrade:(t,e)=>{switch(e){case 0:t.createObjectStore(k)}}})),pe}function K(t,e){return c(this,null,function*(){let n=J(t),i=(yield _e()).transaction(k,"readwrite"),s=i.objectStore(k),a=yield s.get(n);return yield s.put(e,n),yield i.done,(!a||a.fid!==e.fid)&&ut(t,e.fid),e})}function dt(t){return c(this,null,function*(){let e=J(t),r=(yield _e()).transaction(k,"readwrite");yield r.objectStore(k).delete(e),yield r.done})}function X(t,e){return c(this,null,function*(){let n=J(t),i=(yield _e()).transaction(k,"readwrite"),s=i.objectStore(k),a=yield s.get(n),o=e(a);return o===void 0?yield s.delete(n):yield s.put(o,n),yield i.done,o&&(!a||a.fid!==o.fid)&&ut(t,o.fid),o})}function Ee(t){return c(this,null,function*(){let e,n=yield X(t.appConfig,r=>{let i=pr(r),s=gr(t,i);return e=s.registrationPromise,s.installationEntry});return n.fid===me?{installationEntry:yield e}:{installationEntry:n,registrationPromise:e}})}function pr(t){let e=t||{fid:ar(),registrationStatus:0};return ht(e)}function gr(t,e){if(e.registrationStatus===0){if(!navigator.onLine){let i=Promise.reject(M.create("app-offline"));return{installationEntry:e,registrationPromise:i}}let n={fid:e.fid,registrationStatus:1,registrationTime:Date.now()},r=mr(t,n);return{installationEntry:n,registrationPromise:r}}else return e.registrationStatus===1?{installationEntry:e,registrationPromise:br(t)}:{installationEntry:e}}function mr(t,e){return c(this,null,function*(){try{let n=yield ir(t,e);return K(t.appConfig,n)}catch(n){throw nt(n)&&n.customData.serverCode===409?yield dt(t.appConfig):yield K(t.appConfig,{fid:e.fid,registrationStatus:0}),n}})}function br(t){return c(this,null,function*(){let e=yield Xe(t.appConfig);for(;e.registrationStatus===1;)yield ct(100),e=yield Xe(t.appConfig);if(e.registrationStatus===0){let{installationEntry:n,registrationPromise:r}=yield Ee(t);return r||n}return e})}function Xe(t){return X(t,e=>{if(!e)throw M.create("installation-not-found");return ht(e)})}function ht(t){return _r(t)?{fid:t.fid,registrationStatus:0}:t}function _r(t){return t.registrationStatus===1&&t.registrationTime+Qe<Date.now()}function Er(r,i){return c(this,arguments,function*({appConfig:t,heartbeatServiceProvider:e},n){let s=Ir(t,n),a=tr(t,n),o=e.getImmediate({optional:!0});if(o){let u=yield o.getHeartbeatsHeader();u&&a.append("x-firebase-client",u)}let d={installation:{sdkVersion:et,appId:t.appId}},g={method:"POST",headers:a,body:JSON.stringify(d)},_=yield at(()=>fetch(s,g));if(_.ok){let u=yield _.json();return it(u)}else throw yield st("Generate Auth Token",_)})}function Ir(t,{fid:e}){return`${rt(t)}/${e}/authTokens:generate`}function Ie(t,e=!1){return c(this,null,function*(){let n,r=yield X(t.a
1ppConfig,s=>{if(!pt(s))throw M.create("not-registered");let a=s.authToken;if(!e&&Ar(a))return s;if(a.requestStatus===1)return n=yr(t,e),s;{if(!navigator.onLine)throw M.create("app-offline");let o=vr(s);return n=Tr(t,o),o}});return n?yield n:r.authToken})}function yr(t,e){return c(this,null,function*(){let n=yield Ye(t.appConfig);for(;n.authToken.requestStatus===1;)yield ct(100),n=yield Ye(t.appConfig);let r=n.authToken;return r.requestStatus===0?Ie(t,e):r})}function Ye(t){return X(t,e=>{if(!pt(e))throw M.create("not-registered");let n=e.authToken;return wr(n)?L(m({},e),{authToken:{requestStatus:0}}):e})}function Tr(t,e){return c(this,null,function*(){try{let n=yield Er(t,e),r=L(m({},e),{authToken:n});return yield K(t.appConfig,r),n}catch(n){if(nt(n)&&(n.customData.serverCode===401||n.customData.serverCode===404))yield dt(t.appConfig);else{let r=L(m({},e),{authToken:{requestStatus:0}});yield K(t.appConfig,r)}throw n}})}function pt(t){return t!==void 0&&t.registrationStatus===2}function Ar(t){return t.requestStatus===2&&!Sr(t)}function Sr(t){let e=Date.now();return e<t.creationTime||t.creationTime+t.expiresIn<e+Yn}function vr(t){let e={requestStatus:1,requestTime:Date.now()};return L(m({},t),{authToken:e})}function wr(t){return t.requestStatus===1&&t.requestTime+Qe<Date.now()}function Cr(t){return c(this,null,function*(){let e=t,{installationEntry:n,registrationPromise:r}=yield Ee(e);return r?r.catch(console.error):Ie(e).catch(console.error),n.fid})}function Nr(t,e=!1){return c(this,null,function*(){let n=t;return yield Or(n),(yield Ie(n,e)).token})}function Or(t){return c(this,null,function*(){let{registrationPromise:e}=yield Ee(t);e&&(yield e)})}function Rr(t){if(!t||!t.options)throw ge("App Configuration");if(!t.name)throw ge("App Name");let e=["projectId","apiKey","appId"];for(let n of e)if(!t.options[n])throw ge(n);return{appName:t.name,projectId:t.options.projectId,apiKey:t.options.apiKey,appId:t.options.appId}}function ge(t){return M.create("missing-app-config-values",{valueName:t})}var gt="installations",Dr="installations-internal",Mr=t=>{let e=t.getProvider("app").getImmediate(),n=Rr(e),r=B(e,"heartbeat");return{app:e,appConfig:n,heartbeatServiceProvider:r,_delete:()=>Promise.resolve()}},kr=t=>{let e=t.getProvider("app").getImmediate(),n=B(e,gt).getImmediate();return{getId:()=>Cr(n),getToken:i=>Nr(n,i)}};function Pr(){O(new E(gt,Mr,"PUBLIC")),O(new E(Dr,kr,"PRIVATE"))}Pr();S(Ze,be);S(Ze,be,"esm2020");var mt="@firebase/performance",we="0.7.9";var wt=we,xr="FB-PERF-TRACE-START",Br="FB-PERF-TRACE-STOP",Ce="FB-PERF-TRACE-MEASURE",Ct="_wt_",Nt="_fp",Ot="_fcp",Rt="_fid",Dt="_lcp",Lr="lcp_element",Mt="_inp",Fr="inp_interactionTarget",kt="_cls",Ur="cls_largestShiftTarget",Pt="@firebase/performance/config",xt="@firebase/performance/configexpire",$r="performance",Bt="Performance";var zr={"trace started":"Trace {$traceName} was started before.","trace stopped":"Trace {$traceName} is not running.","nonpositive trace startTime":"Trace {$traceName} startTime should be positive.","nonpositive trace duration":"Trace {$traceName} duration should be positive.","no window":"Window is not available.","no app id":"App id is not available.","no project id":"Project id is not available.","no api key":"Api key is not available.","invalid cc log":"Attempted to queue invalid cc event","FB not default":"Performance can only start when Firebase app instance is the default one.","RC response not ok":"RC response is not ok","invalid attribute name":"Attribute name {$attributeName} is invalid.","invalid attribute value":"Attribute value {$attributeValue} is invalid.","invalid custom metric name":"Custom metric name {$customMetricName} is invalid","invalid String merger input":"Input for String merger is invalid, contact support team to resolve.","already initialized":"initializePerformance() has already been called with different options. To avoid this error, call initializePerformance() with the same options as when it was originally called, or call getPerformance() to return the already initialized instance."},h=new A($r,Bt,zr);var w=new x(Bt);w.logLevel=l.INFO;var ye,Lt,f=class t{constructor(e){if(this.window=e,!e)throw h.create("no window");this.performance=e.performance,this.PerformanceObserver=e.PerformanceObserver,this.windowLocation=e.location,this.navigator=e.n
1avigator,this.document=e.document,this.navigator&&this.navigator.cookieEnabled&&(this.localStorage=e.localStorage),e.perfMetrics&&e.perfMetrics.onFirstInputDelay&&(this.onFirstInputDelay=e.perfMetrics.onFirstInputDelay),this.onLCP=Be,this.onINP=xe,this.onCLS=Pe}getUrl(){return this.windowLocation.href.split("?")[0]}mark(e){!this.performance||!this.performance.mark||this.performance.mark(e)}measure(e,n,r){!this.performance||!this.performance.measure||this.performance.measure(e,n,r)}getEntriesByType(e){return!this.performance||!this.performance.getEntriesByType?[]:this.performance.getEntriesByType(e)}getEntriesByName(e){return!this.performance||!this.performance.getEntriesByName?[]:this.performance.getEntriesByName(e)}getTimeOrigin(){return this.performance&&(this.performance.timeOrigin||this.performance.timing.navigationStart)}requiredApisAvailable(){return!fetch||!Promise||!He()?(w.info("Firebase Performance cannot start if browser does not support fetch and Promise or cookie is disabled."),!1):V()?!0:(w.info("IndexedDB is not supported by current browser"),!1)}setupObserver(e,n){if(!this.PerformanceObserver)return;new this.PerformanceObserver(i=>{for(let s of i.getEntries())n(s)}).observe({entryTypes:[e]})}static getInstance(){return ye===void 0&&(ye=new t(Lt)),ye}};function Hr(t){Lt=t}var Ft;function Vr(t){let e=t.getId();return e.then(n=>{Ft=n}),e}function De(){return Ft}function jr(t){let e=t.getToken();return e.then(n=>{}),e}function bt(t,e){let n=t.length-e.length;if(n<0||n>1)throw h.create("invalid String merger input");let r=[];for(let i=0;i<t.length;i++)r.push(t.charAt(i)),e.length>i&&r.push(e.charAt(i));return r.join("")}var Te,p=class t{constructor(){this.instrumentationEnabled=!0,this.dataCollectionEnabled=!0,this.loggingEnabled=!1,this.tracesSamplingRate=1,this.networkRequestsSamplingRate=1,this.logEndPointUrl="https://firebaselogging.googleapis.com/v0cc/log?format=json_proto",this.flTransportEndpointUrl=bt("hts/frbslgigp.ogepscmv/ieo/eaylg","tp:/ieaeogn-agolai.o/1frlglgc/o"),this.transportKey=bt("AzSC8r6ReiGqFMyfvgow","Iayx0u-XT3vksVM-pIV"),this.logSource=462,this.logTraceAfterSampling=!1,this.logNetworkAfterSampling=!1,this.configTimeToLive=12,this.logMaxFlushSize=40}getFlTransportFullUrl(){return this.flTransportEndpointUrl.concat("?key=",this.transportKey)}static getInstance(){return Te===void 0&&(Te=new t),Te}};var Z=(function(t){return t[t.UNKNOWN=0]="UNKNOWN",t[t.VISIBLE=1]="VISIBLE",t[t.HIDDEN=2]="HIDDEN",t})(Z||{}),Wr=["firebase_","google_","ga_"],qr=new RegExp("^[a-zA-Z]\\w*$"),Gr=40,Ne=100;function Kr(){let t=f.getInstance().navigator;return t?.serviceWorker?t.serviceWorker.controller?2:3:1}function Jr(){switch(f.getInstance().document.visibilityState){case"visible":return Z.VISIBLE;case"hidden":return Z.HIDDEN;default:return Z.UNKNOWN}}function Xr(){let e=f.getInstance().navigator.connection;switch(e&&e.effectiveType){case"slow-2g":return 1;case"2g":return 2;case"3g":return 3;case"4g":return 4;default:return 0}}function Yr(t){return t.length===0||t.length>Gr?!1:!Wr.some(n=>t.startsWith(n))&&!!t.match(qr)}function Zr(t){return t.length!==0&&t.length<=Ne}function Ut(t){let e=t.options?.appId;if(!e)throw h.create("no app id");return e}function Qr(t){let e=t.options?.projectId;if(!e)throw h.create("no project id");return e}function ei(t){let e=t.options?.apiKey;if(!e)throw h.create("no api key");return e}var ti="0.0.1",b={loggingEnabled:!0},ni="FIREBASE_INSTALLATIONS_AUTH";function ri(t,e){let n=ii();return n?(_t(n),Promise.resolve()):ai(t,e).then(_t).then(r=>si(r),()=>{})}function ii(){let t=f.getInstance().localStorage;if(!t)return;let e=t.getItem(xt);if(!e||!ci(e))return;let n=t.getItem(Pt);if(n)try{return JSON.parse(n)}catch{return}}function si(t){let e=f.getInstance().localStorage;!t||!e||(e.setItem(Pt,JSON.stringify(t)),e.setItem(xt,String(Date.now()+p.getInstance().configTimeToLive*60*60*1e3)))}var oi="Could not fetch config, will use default configs";function ai(t,e){return jr(t.installations).then(n=>{let r=Qr(t.app),i=ei(t.app),s=`https://firebaseremoteconfig.googleapis.com/v1/projects/${r}
1/namespaces/fireperf:fetch?key=${i}`,a=new Request(s,{method:"POST",headers:{Authorization:`${ni} ${n}`},body:JSON.stringify({app_instance_id:e,app_instance_id_token:n,app_id:Ut(t.app),app_version:wt,sdk_version:ti})});return fetch(a).then(o=>{if(o.ok)return o.json();throw h.create("RC response not ok")})}).catch(()=>{w.info(oi)})}function _t(t){if(!t)return t;let e=p.getInstance(),n=t.entries||{};return n.fpr_enabled!==void 0?e.loggingEnabled=String(n.fpr_enabled)==="true":e.loggingEnabled=b.loggingEnabled,n.fpr_log_source?e.logSource=Number(n.fpr_log_source):b.logSource&&(e.logSource=b.logSource),n.fpr_log_endpoint_url?e.logEndPointUrl=n.fpr_log_endpoint_url:b.logEndPointUrl&&(e.logEndPointUrl=b.logEndPointUrl),n.fpr_log_transport_key?e.transportKey=n.fpr_log_transport_key:b.transportKey&&(e.transportKey=b.transportKey),n.fpr_vc_network_request_sampling_rate!==void 0?e.networkRequestsSamplingRate=Number(n.fpr_vc_network_request_sampling_rate):b.networkRequestsSamplingRate!==void 0&&(e.networkRequestsSamplingRate=b.networkRequestsSamplingRate),n.fpr_vc_trace_sampling_rate!==void 0?e.tracesSamplingRate=Number(n.fpr_vc_trace_sampling_rate):b.tracesSamplingRate!==void 0&&(e.tracesSamplingRate=b.tracesSamplingRate),n.fpr_log_max_flush_size?e.logMaxFlushSize=Number(n.fpr_log_max_flush_size):b.logMaxFlushSize&&(e.logMaxFlushSize=b.logMaxFlushSize),e.logTraceAfterSampling=Et(e.tracesSamplingRate),e.logNetworkAfterSampling=Et(e.networkRequestsSamplingRate),t}function ci(t){return Number(t)>Date.now()}function Et(t){return Math.random()<=t}var Me=1,Ae;function $t(t){return Me=2,Ae=Ae||ui(t),Ae}function li(){return Me===3}function ui(t){return fi().then(()=>Vr(t.installations)).then(e=>ri(t,e)).then(()=>It(),()=>It())}function fi(){let t=f.getInstance().document;return new Promise(e=>{if(t&&t.readyState!=="complete"){let n=()=>{t.readyState==="complete"&&(t.removeEventListener("readystatechange",n),e())};t.addEventListener("readystatechange",n)}else e()})}function It(){Me=3}var zt=10*1e3,di=5.5*1e3,hi=1e3,Ht=3,pi=65536,gi=new TextEncoder,Q=Ht,I=[],yt=!1;function mi(){yt||(ke(di),yt=!0)}function ke(t){setTimeout(()=>{Q<=0||(I.length>0&&bi(),ke(zt))},t)}function bi(){let t=I.splice(0,hi),e=Oe(t);_i(e).then(()=>{Q=Ht}).catch(()=>{I=[...t,...I],Q--,w.info(`Tries left: ${Q}.`),ke(zt)})}function Oe(t){let e=t.map(r=>({source_extension_json_proto3:r.message,event_time_ms:String(r.eventTime)})),n={request_time_ms:String(Date.now()),client_info:{client_type:1,js_client_info:{}},log_source:p.getInstance().logSource,log_event:e};return JSON.stringify(n)}function _i(t){let e=p.getInstance().getFlTransportFullUrl();return gi.encode(t).length<=pi&&navigator.sendBeacon&&navigator.sendBeacon(e,t)?Promise.resolve():fetch(e,{method:"POST",body:t})}function Ei(t){if(!t.eventTime||!t.message)throw h.create("invalid cc log");I=[...I,t]}function Ii(t){return(...e)=>{let n=t(...e);Ei({message:n,eventTime:Date.now()})}}function yi(){let t=p.getInstance().getFlTransportFullUrl();for(;I.length>0;){let e=I.splice(-p.getInstance().logMaxFlushSize),n=Oe(e);if(!(navigator.sendBeacon&&navigator.sendBeacon(t,n))){I=[...I,...e];break}}if(I.length>0){let e=Oe(I);fetch(t,{method:"POST",body:e}).catch(()=>{w.info("Failed flushing queued events.")})}}var U;function Vt(t,e){U||(U={send:Ii(Si),flush:yi}),U.send(t,e)}function Y(t){let e=p.getInstance();!e.instrumentationEnabled&&t.isAuto||!e.dataCollectionEnabled&&!t.isAuto||f.getInstance().requiredApisAvailable()&&(li()?Se(t):$t(t.performanceController).then(()=>Se(t),()=>Se(t)))}function Ti(){U&&U.flush()}function Se(t){if(!De())return;let e=p.getInstance();!e.loggingEnabled||!e.logTraceAfterSampling||Vt(t,1)}function Ai(t){let e=p.getInstance();if(!e.instrumentationEnabled)return;let n=t.url,r=e.logEndPointUrl.split("?")[0],i=e.flTransportEndpointUrl.split("?")[0];n===r||n===i||!e.loggingEnabled||!e.logNetworkAfterSampling||Vt(t,0)}function Si(t,e){return e===0?vi(t):wi(t)}function vi(t){let e={url:t.url,http_method:t.httpMethod||0,http_response_code:200,response_payload_bytes:t.responsePayloadBytes,client_start_time_us:t.startTimeUs,time_to_response_initiated_us:t.timeToResponseInitiatedUs,time_to_response_completed_us:t.timeToResponseCompletedUs},n={application_info:jt(t.performanceController.app),network_request_metric:e};return JSON.stringify(n)}function wi(t){let e={name:t.name,is_auto:t.isAuto,client_start_time_us:t.startTimeUs,duration_us:t.durationUs};Object.keys(t.counters).length!==0&&(e.counters=t.counters);let n=t.getAttributes();Object.keys(n).length!==0&&(e.custom_attributes=n);let r={application_info:jt(t.performanceController.app),trace_metric:e};return JSON.stringify(r)}function jt(t){return{google_app_id:Ut(t),app_instance_id:De(),web_app_info:{sdk_version:wt,page_url:f.getInstance().getUrl(),service_worker_status:Kr(),visibility_state:Jr(),effective_connection_type:Xr()},application_process_state:0}}function Tt(t,e){let n=e;if(!n||n.responseStart===void 0)return;let r=f.getInstance().getTimeOrigin(),i=Math.floor((n.startTime+r)*1e3),s=n.responseStart?Math.floor((n.responseStart-n.startTime)*1e3):void 0,a=Math.floor((n.responseEnd-n.startTime)*1e3),o=n.name&&n.name.split("?")[0],d={performanceController:t,url:o,responsePayloadBytes:n.transferSize,startTimeUs:i,timeToResponseInitiatedUs:s,timeToResponseCompletedUs:a};Ai(d)}var Ci=100,Ni="_",Oi=[Nt,Ot,Rt,Dt,kt,Mt];function Ri(t,e){return t.length===0||t.length>Ci?!1:e&&e.startsWith(Ct)&&Oi.indexOf(t)>-1||!t.startsWith(Ni)}function Di(t){let e=Math.floor(t);return e<t&&w.info(`Metric value should be an Integer, setting the value as : ${e}.`),e}var $=class t{constructor(e,n,r=!1,i){this.performanceController=e,this.name=n,this.isAuto=r,this.state=1,this.customAttributes={},this.counters={},this.api=f.getInstance(),this.randomId=Math.floor(Math.random()*1e6),this.isAuto||(this.traceStartMark=`${xr}-${this.randomId}-${this.name}`,this.traceStopMark=`${Br}-${this.randomId}-${this.name}`,this.traceMeasure=i||`${Ce}-${this.randomId}-${this.name}`,i&&this.calculateTraceMetrics())}
1start(){if(this.state!==1)throw h.create("trace started",{traceName:this.name});this.api.mark(this.traceStartMark),this.state=2}stop(){if(this.state!==2)throw h.create("trace stopped",{traceName:this.name});this.state=3,this.api.mark(this.traceStopMark),this.api.measure(this.traceMeasure,this.traceStartMark,this.traceStopMark),this.calculateTraceMetrics(),Y(this)}record(e,n,r){if(e<=0)throw h.create("nonpositive trace startTime",{traceName:this.name});if(n<=0)throw h.create("nonpositive trace duration",{traceName:this.name});if(this.durationUs=Math.floor(n*1e3),this.startTimeUs=Math.floor(e*1e3),r&&r.attributes&&(this.customAttributes=m({},r.attributes)),r&&r.metrics)for(let i of Object.keys(r.metrics))isNaN(Number(r.metrics[i]))||(this.counters[i]=Math.floor(Number(r.metrics[i])));Y(this)}incrementMetric(e,n=1){this.counters[e]===void 0?this.putMetric(e,n):this.putMetric(e,this.counters[e]+n)}putMetric(e,n){if(Ri(e,this.name))this.counters[e]=Di(n??0);else throw h.create("invalid custom metric name",{customMetricName:e})}getMetric(e){return this.counters[e]||0}putAttribute(e,n){let r=Yr(e),i=Zr(n);if(r&&i){this.customAttributes[e]=n;return}if(!r)throw h.create("invalid attribute name",{attributeName:e});if(!i)throw h.create("invalid attribute value",{attributeValue:n})}getAttribute(e){return this.customAttributes[e]}removeAttribute(e){this.customAttributes[e]!==void 0&&delete this.customAttributes[e]}getAttributes(){return m({},this.customAttributes)}setStartTime(e){this.startTimeUs=e}setDuration(e){this.durationUs=e}calculateTraceMetrics(){let e=this.api.getEntriesByName(this.traceMeasure),n=e&&e[0];n&&(this.durationUs=Math.floor(n.duration*1e3),this.startTimeUs=Math.floor((n.startTime+this.api.getTimeOrigin())*1e3))}static createOobTrace(e,n,r,i,s){let a=f.getInstance().getUrl();if(!a)return;let o=new t(e,Ct+a,!0),d=Math.floor(f.getInstance().getTimeOrigin()*1e3);o.setStartTime(d),n&&n[0]&&(o.setDuration(Math.floor(n[0].duration*1e3)),o.putMetric("domInteractive",Math.floor(n[0].domInteractive*1e3)),o.putMetric("domContentLoadedEventEnd",Math.floor(n[0].domContentLoadedEventEnd*1e3)),o.putMetric("loadEventEnd",Math.floor(n[0].loadEventEnd*1e3)));let g="first-paint",_="first-contentful-paint";if(r){let u=r.find(C=>C.name===g);u&&u.startTime&&o.putMetric(Nt,Math.floor(u.startTime*1e3));let y=r.find(C=>C.name===_);y&&y.startTime&&o.putMetric(Ot,Math.floor(y.startTime*1e3)),s&&o.putMetric(Rt,Math.floor(s*1e3))}this.addWebVitalMetric(o,Dt,Lr,i.lcp),this.addWebVitalMetric(o,kt,Ur,i.cls),this.addWebVitalMetric(o,Mt,Fr,i.inp),Y(o),Ti()}static addWebVitalMetric(e,n,r,i){i&&(e.putMetric(n,Math.floor(i.value*1e3)),i.elementAttribution&&(i.elementAttribution.length>Ne?e.putAttribute(r,i.elementAttribution.substring(0,Ne)):e.putAttribute(r,i.elementAttribution)))}static createUserTimingTrace(e,n){let r=new t(e,n,!1,n);Y(r)}};var ee={},At=!1,Wt;function St(t){De()&&(setTimeout(()=>ki(t),0),setTimeout(()=>Mi(t),0),setTimeout(()=>Pi(t),0))}function Mi(t){let e=f.getInstance(),n=e.getEntriesByType("resource");for(let r of n)Tt(t,r);e.setupObserver("resource",r=>Tt(t,r))}function ki(t){let e=f.getInstance();"onpagehide"in window?e.document.addEventListener("pagehide",()=>ve(t)):e.document.addEventListener("unload",()=>ve(t)),e.document.addEventListener("visibilitychange",()=>{e.document.visibilityState==="hidden"&&ve(t)}),e.onFirstInputDelay&&e.onFirstInputDelay(n=>{Wt=n}),e.onLCP(n=>{ee.lcp={value:n.value,elementAttribution:n.attribution?.element}}),e.onCLS(n=>{ee.cls={value:n.value,elementAttribution:n.attribution?.largestShiftTarget}}),e.onINP(n=>{ee.inp={value:n.value,elementAttribution:n.attribution?.interactionTarget}})}function Pi(t){let e=f.getInstance(),n=e.getEntriesByType("measure");for(let r of n)vt(t,r);e.setupObserver("measure",r=>vt(t,r))}function vt(t,e){let n=e.name;n.substring(0,Ce.length)!==Ce&&$.createUserTimingTrace(t,n)}function ve(t){if(!At){At=!0;let e=f.getInstance(),n=e.getEntriesByType("navigation"),r=e.getEntriesByType("paint");setTimeout(()=>{$.createOobTrace(t,n,r,ee,Wt)},0)}}var Re=class{constructor(e,n){this.app=e,this.installations=n,this.initialized=!1}_init(e){this.initialized||(e?.dataCollectionEnabled!==void 0&&(this.dataCollectionEnabled=e.dataCollectionEnabled),e?.instrumentationEnabled!==void 0&&(this.instrumentationEnabled=e.instrumentationEnabled),f.getInstance().requiredApisAvailable()?j().then(n=>
1{n&&(mi(),$t(this).then(()=>St(this),()=>St(this)),this.initialized=!0)}).catch(n=>{w.info(`Environment doesn't support IndexedDB: ${n}`)}):w.info('Firebase Performance cannot start if the browser does not support "Fetch" and "Promise", or cookies are disabled.'))}set instrumentationEnabled(e){p.getInstance().instrumentationEnabled=e}get instrumentationEnabled(){return p.getInstance().instrumentationEnabled}set dataCollectionEnabled(e){p.getInstance().dataCollectionEnabled=e}get dataCollectionEnabled(){return p.getInstance().dataCollectionEnabled}},xi="[DEFAULT]";function ms(t=he()){return t=W(t),B(t,"performance").getImmediate()}function bs(t,e){t=W(t);let n=B(t,"performance");if(n.isInitialized()){let i=n.getImmediate(),s=n.getOptions();if(P(s,e??{}))return i;throw h.create("already initialized")}return n.initialize({options:e})}function _s(t,e){return t=W(t),new $(t,e)}var Bi=(t,{options:e})=>{let n=t.getProvider("app").getImmediate(),r=t.getProvider("installations-internal").getImmediate();if(n.name!==xi)throw h.create("FB not default");if(typeof window>"u")throw h.create("no window");Hr(window);let i=new Re(n,r);return i._init(e),i};function Li(){O(new E("performance",Bi,"PUBLIC")),S(mt,we),S(mt,we,"esm2020")}Li();export{ms as getPerformance,bs as initializePerformance,_s as trace};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.