mobileapplicationPassvault/node_modules/firebase/firebase-performance-compat.js

3 lines
30 KiB
JavaScript
Raw Normal View History

2024-04-12 05:23:32 +00:00
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(require("@firebase/app-compat"),require("@firebase/app")):"function"==typeof define&&define.amd?define(["@firebase/app-compat","@firebase/app"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).firebase,e.firebase.INTERNAL.modularAPIs)}(this,function(yt,Et){"use strict";try{!(function(){function e(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var t,r,n=e(yt);class o extends Error{constructor(e,t,n){super(t),this.code=e,this.customData=n,this.name="FirebaseError",Object.setPrototypeOf(this,o.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,a.prototype.create)}}class a{constructor(e,t,n){this.service=e,this.serviceName=t,this.errors=n}create(e,...t){var r,n=t[0]||{},a=`${this.service}/${e}`,i=this.errors[e],i=i?(r=n,i.replace(s,(e,t)=>{var n=r[t];return null!=n?String(n):`<${t}?>`})):"Error",i=`${this.serviceName}: ${i} (${a}).`;return new o(a,i,n)}}const s=/\{\$([^}]+)}/g;class i{constructor(e,t,n){this.name=e,this.instanceFactory=t,this.type=n,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}}(Te=t=t||{})[Te.DEBUG=0]="DEBUG",Te[Te.VERBOSE=1]="VERBOSE",Te[Te.INFO=2]="INFO",Te[Te.WARN=3]="WARN",Te[Te.ERROR=4]="ERROR",Te[Te.SILENT=5]="SILENT";const c={debug:t.DEBUG,verbose:t.VERBOSE,info:t.INFO,warn:t.WARN,error:t.ERROR,silent:t.SILENT},l=t.INFO,u={[t.DEBUG]:"log",[t.VERBOSE]:"log",[t.INFO]:"info",[t.WARN]:"warn",[t.ERROR]:"error"},d=(e,t,...n)=>{if(!(t<e.logLevel)){var r=(new Date).toISOString(),a=u[t];if(!a)throw new Error(`Attempted to log a message with an invalid logType (value: ${t})`);console[a](`[${r}] ${e.name}:`,...n)}};const p=(t,e)=>e.some(e=>t instanceof e);let f,g;const h=new WeakMap,m=new WeakMap,v=new WeakMap,b=new WeakMap,w=new WeakMap;let _={get(e,t,n){if(e instanceof IDBTransaction){if("done"===t)return m.get(e);if("objectStoreNames"===t)return e.objectStoreNames||v.get(e);if("store"===t)return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return I(e[t])},set(e,t,n){return e[t]=n,!0},has(e,t){return e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e}};function y(r){return r!==IDBDatabase.prototype.transaction||"objectStoreNames"in IDBTransaction.prototype?(g=g||[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey]).includes(r)?function(...e){return r.apply(T(this),e),I(h.get(this))}:function(...e){return I(r.apply(T(this),e))}:function(e,...t){var n=r.call(T(this),e,...t);return v.set(n,e.sort?e.sort():[e]),I(n)}}function E(e){return"function"==typeof e?y(e):(e instanceof IDBTransaction&&(i=e,m.has(i)||(t=new Promise((e,t)=>{const n=()=>{i.removeEventListener("complete",r),i.removeEventListener("error",a),i.removeEventListener("abort",a)},r=()=>{e(),n()},a=()=>{t(i.error||new DOMException("AbortError","AbortError")),n()};i.addEventListener("complete",r),i.addEventListener("error",a),i.addEventListener("abort",a)}),m.set(i,t))),p(e,f=f||[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])?new Proxy(e,_):e);var i,t}function I(e){if(e instanceof IDBRequest)return function(i){const e=new Promise((e,t)=>{const n=()=>{i.removeEventListener("success",r),i.removeEventListener("error",a)},r=()=>{e(I(i.result)),n()},a=()=>{t(i.error),n()};i.addEventListener("success",r),i.addEventListener("error",a)});return e.then(e=>{e instanceof IDBCursor&&h.set(e,i)}).catch(()=>{}),w.set(e,i),e}(e);if(b.has(e))return b.get(e);var t=E(e);return t!==e&&(b.set(e,t),w.set(t,e)),t}const T=e=>w.get(e);const S=["get","getKey","getAll","getAllKeys","count"],k=["put","add","delete","clear"],N=new Map;function C(e,t){if(e instanceof IDBDatabase&&!(t in e)&&"string"==typeof t){if(N.get(t))return N.get(t);const a=t.replace(/FromIndex$/,""),i=t!==a,o=k.in
//# sourceMappingURL=firebase-performance-compat.js.map