HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux ip-172-31-4-197 6.8.0-1036-aws #38~22.04.1-Ubuntu SMP Fri Aug 22 15:44:33 UTC 2025 x86_64
User: ubuntu (1000)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/web.enelar.com.co/node_modules/firebase/firebase-app-check-compat.js
!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(Be,He){"use strict";try{!(function(){function e(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var t,r,n=e(Be);const o={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:"function"==typeof atob,encodeByteArray(r,e){if(!Array.isArray(r))throw Error("encodeByteArray takes an array as a parameter");this.init_();var n=e?this.byteToCharMapWebSafe_:this.byteToCharMap_;const o=[];for(let h=0;h<r.length;h+=3){var a=r[h],i=h+1<r.length,s=i?r[h+1]:0,c=h+2<r.length,l=c?r[h+2]:0;let e=(15&s)<<2|l>>6,t=63&l;c||(t=64,i||(e=64)),o.push(n[a>>2],n[(3&a)<<4|s>>4],n[e],n[t])}return o.join("")},encodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?btoa(e):this.encodeByteArray(function(t){const r=[];let n=0;for(let o=0;o<t.length;o++){let e=t.charCodeAt(o);e<128?r[n++]=e:(e<2048?r[n++]=e>>6|192:(55296==(64512&e)&&o+1<t.length&&56320==(64512&t.charCodeAt(o+1))?(e=65536+((1023&e)<<10)+(1023&t.charCodeAt(++o)),r[n++]=e>>18|240,r[n++]=e>>12&63|128):r[n++]=e>>12|224,r[n++]=e>>6&63|128),r[n++]=63&e|128)}return r}(e),t)},decodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?atob(e):function(e){const t=[];let r=0,n=0;for(;r<e.length;){var o,a,i=e[r++];i<128?t[n++]=String.fromCharCode(i):191<i&&i<224?(o=e[r++],t[n++]=String.fromCharCode((31&i)<<6|63&o)):239<i&&i<365?(a=((7&i)<<18|(63&e[r++])<<12|(63&e[r++])<<6|63&e[r++])-65536,t[n++]=String.fromCharCode(55296+(a>>10)),t[n++]=String.fromCharCode(56320+(1023&a))):(o=e[r++],a=e[r++],t[n++]=String.fromCharCode((15&i)<<12|(63&o)<<6|63&a))}return t.join("")}(this.decodeStringToByteArray(e,t))},decodeStringToByteArray(e,t){this.init_();var r=t?this.charToByteMapWebSafe_:this.charToByteMap_;const n=[];for(let c=0;c<e.length;){var o=r[e.charAt(c++)],a=c<e.length?r[e.charAt(c)]:0;++c;var i=c<e.length?r[e.charAt(c)]:64;++c;var s=c<e.length?r[e.charAt(c)]:64;if(++c,null==o||null==a||null==i||null==s)throw new l;n.push(o<<2|a>>4),64!==i&&(n.push(a<<4&240|i>>2),64!==s&&n.push(i<<6&192|s))}return n},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let e=0;e<this.ENCODED_VALS.length;e++)this.byteToCharMap_[e]=this.ENCODED_VALS.charAt(e),this.charToByteMap_[this.byteToCharMap_[e]]=e,this.byteToCharMapWebSafe_[e]=this.ENCODED_VALS_WEBSAFE.charAt(e),this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[e]]=e,e>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(e)]=e,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(e)]=e)}}};class l extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}}const i=function(e){try{return o.decodeString(e,!0)}catch(e){console.error("base64Decode failed: ",e)}return null};class s{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}wrapCallback(r){return(e,t)=>{e?this.reject(e):this.resolve(t),"function"==typeof r&&(this.promise.catch(()=>{}),1===r.length?r(e):r(e,t))}}}function a(){try{return"object"==typeof indexedDB}catch(e){return}}class c extends Error{constructor(e,t,r){super(t),this.code=e,this.customData=r,this.name="FirebaseError",Object.setPrototypeOf(this,c.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,h.prototype.create)}}class h{constructor(e,t,r){this.service=e,this.serviceName=t,this.errors=r}create(e,...t){var n,r=t[0]||{},o=`${this.service}/${e}`,a=this.errors[e],a=a?(n=r,a.replace(u,(e,t)=>{var r=n[t];return null!=r?String(r):`<${t}?>`})):"Error",a=`${this.serviceName}: ${a} (${o}).`;return new c(o,a,r)}}const u=/\{\$([^}]+)}/g;function p(e){return JSON.parse(e)}function d(e){const t=function(e){let t={},r={},n={},o="";try{var a=e.split(".");t=p(i(a[0])||""),r=p(i(a[1])||""),o=a[2],n=r.d||{},delete r.d}catch(e){}return{header:t,claims:r,data:n,signature:o}}(e).claims;return"object"==typeof t&&t.hasOwnProperty("iat")?t.iat:null}function f(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=16*Math.random()|0,r="x"===e?t:3&t|8;return r.toString(16)})}const g=144e5,v=.5;class w{constructor(e,t,r){this.name=e,this.instanceFactory=t,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}}(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";const E={debug:t.DEBUG,verbose:t.VERBOSE,info:t.INFO,warn:t.WARN,error:t.ERROR,silent:t.SILENT},m=t.INFO,b={[t.DEBUG]:"log",[t.VERBOSE]:"log",[t.INFO]:"info",[t.WARN]:"warn",[t.ERROR]:"error"},_=(e,t,...r)=>{if(!(t<e.logLevel)){var n=(new Date).toISOString(),o=b[t];if(!o)throw new Error(`Attempted to log a message with an invalid logType (value: ${t})`);console[o](`[${n}]  ${e.name}:`,...r)}};const k={};function y(e,t){if(r=e,!Array.isArray(r)||!Array.isArray(r.raw)||(r.length!==r.raw.length||!S&&r===r.raw||!(S&&!C||A(r)))||t+1!==e.length)throw new TypeError(`
    ############################## ERROR ##############################

    It looks like you are trying to call a template tag function (fn\`...\`)
    using the normal function syntax (fn(...)), which is not supported.

    The functions in the safevalues library are not designed to be called
    like normal functions, and doing so invalidates the security guarantees
    that safevalues provides.

    If you are stuck and not sure how to proceed, please reach out to us
    instead through:
     - https://github.com/google/safevalues/issues

    ############################## ERROR ##############################`);var r}function A(e){return Object.isFrozen(e)&&Object.isFrozen(e.raw)}function T(e){return-1===e.toString().indexOf("`")}const S=T(e=>e``)||T(e=>e`\0`)||T(e=>e`\n`)||T(e=>e`\u0000`),C=A``&&A`\0`&&A`\n`&&A`\u0000`;function R(){var e;return null!==(e=function(){if("undefined"!=typeof window)return window.trustedTypes}())&&void 0!==e?e:null}let P;class O{constructor(e,t){!function(e){if("production"!==process.env.NODE_ENV&&e!==k)throw new Error("Bad secret")}(t),this.privateDoNotAccessOrElseWrappedResourceUrl=e}toString(){return this.privateDoNotAccessOrElseWrappedResourceUrl.toString()}}function D(e){var t=e,r=null===(r=function(){var e,t;if(void 0===P)try{P=null!==(t=null===(e=R())||void 0===e?void 0:e.createPolicy("google#safe",{createHTML:e=>e,createScript:e=>e,createScriptURL:e=>e}))&&void 0!==t?t:null}catch(e){P=null}return P}())||void 0===r?void 0:r.createScriptURL(t);return null!=r?r:new O(t,k)}function N(e,...t){if("production"!==process.env.NODE_ENV&&y(e,t.length),0===t.length)return D(e[0]);var r,n=e[0].toLowerCase();if("production"!==process.env.NODE_ENV){if(/^data:/.test(n))throw new Error("Data URLs cannot have expressions in the template literal input.");if(!(function(e){if(/^https:\/\//.test(e)||/^\/\//.test(e)){var t=e.indexOf("//")+2,r=e.indexOf("/",t);if(r<=t)throw new Error("Can't interpolate data in a url's origin, Please make sure to fully specify the origin, terminated with '/'.");r=e.substring(t,r);if(!/^[0-9a-z.:-]+$/i.test(r))throw new Error("The origin contains unsupported characters.");if(!/^[^:]*(:[0-9]+)?$/i.test(r))throw new Error("Invalid port number.");if(!/(^|\.)[a-z][^.]*$/i.test(r))throw new Error("The top-level domain must start with a letter.");return 1}}(n)||function(e){if(/^\//.test(e)){if("/"===e||1<e.length&&"/"!==e[1]&&"\\"!==e[1])return 1;throw new Error("The path start in the url is invalid.")}}(n)||(r=n,new RegExp("^[^:\\s\\\\/]+/").test(r))||function(e){if(/^about:blank/.test(e)){if("about:blank"!==e&&!/^about:blank#/.test(e))throw new Error("The about url is invalid.");return 1}}(n)))throw new Error("Trying to interpolate expressions in an unsupported url format.")}let o=e[0];for(let a=0;a<t.length;a++)o+=encodeURIComponent(t[a])+e[a+1];return D(o)}function I(e){return function(e,t){var r;const n=t.document,o=null===(r=n.querySelector)||void 0===r?void 0:r.call(n,`${e}[nonce]`);if(o)return o.nonce||o.getAttribute("nonce")||"";return""}("script",e)}function x(e,t,r){var n;e.src=function(e){var t;if(null!==(t=R())&&void 0!==t&&t.isScriptURL(e))return e;if(e instanceof O)return e.privateDoNotAccessOrElseWrappedResourceUrl;{let e="";throw"production"!==process.env.NODE_ENV&&(e="Unexpected type when unwrapping TrustedResourceUrl"),new Error(e)}}(t),null!=r&&r.omitNonce||(n=I((e=e).ownerDocument&&e.ownerDocument.defaultView||window))&&e.setAttribute("nonce",n)}const L=new Map,M={activated:!1,tokenObservers:[]},B={initialized:!1,enabled:!1};function H(e){return L.get(e)||Object.assign({},M)}const $="https://content-firebaseappcheck.googleapis.com/v1",W="exchangeDebugToken",j={OFFSET_DURATION:3e5,RETRIAL_MIN_WAIT:3e4,RETRIAL_MAX_WAIT:96e4};class F{constructor(e,t,r,n,o){if(this.operation=e,this.retryPolicy=t,this.getWaitDuration=r,this.lowerBound=n,this.upperBound=o,this.pending=null,o<(this.nextErrorWaitInterval=n))throw new Error("Proactive refresh lower bound greater than upper bound!")}start(){this.nextErrorWaitInterval=this.lowerBound,this.process(!0).catch(()=>{})}stop(){this.pending&&(this.pending.reject("cancelled"),this.pending=null)}isRunning(){return!!this.pending}async process(e){this.stop();try{this.pending=new s,this.pending.promise.catch(e=>{}),t=this.getNextRun(e),await new Promise(e=>{setTimeout(e,t)}),this.pending.resolve(),await this.pending.promise,this.pending=new s,this.pending.promise.catch(e=>{}),await this.operation(),this.pending.resolve(),await this.pending.promise,this.process(!0).catch(()=>{})}catch(e){this.retryPolicy(e)?this.process(!1).catch(()=>{}):this.stop()}var t}getNextRun(e){if(e)return this.nextErrorWaitInterval=this.lowerBound,this.getWaitDuration();var t=this.nextErrorWaitInterval;return this.nextErrorWaitInterval*=2,this.nextErrorWaitInterval>this.upperBound&&(this.nextErrorWaitInterval=this.upperBound),t}}const V=new h("appCheck","AppCheck",{"already-initialized":"You have already called initializeAppCheck() for FirebaseApp {$appName} with different options. To avoid this error, call initializeAppCheck() with the same options as when it was originally called. This will return the already initialized instance.","use-before-activation":"App Check is being used before initializeAppCheck() is called for FirebaseApp {$appName}. Call initializeAppCheck() before instantiating other Firebase services.","fetch-network-error":"Fetch failed to connect to a network. Check Internet connection. Original error: {$originalErrorMessage}.","fetch-parse-error":"Fetch client could not parse response. Original error: {$originalErrorMessage}.","fetch-status-error":"Fetch server returned an HTTP error status. HTTP status: {$httpStatus}.","storage-open":"Error thrown when opening storage. Original error: {$originalErrorMessage}.","storage-get":"Error thrown when reading from storage. Original error: {$originalErrorMessage}.","storage-set":"Error thrown when writing to storage. Original error: {$originalErrorMessage}.","recaptcha-error":"ReCAPTCHA error.",throttled:"Requests throttled due to {$httpStatus} error. Attempts allowed again after {$time}"});function U(e=!1){var t;return e?null===(t=self.grecaptcha)||void 0===t?void 0:t.enterprise:self.grecaptcha}function z(e){if(!H(e).activated)throw V.create("use-before-activation",{appName:e.name})}function K(e){var t=Math.round(e/1e3),r=Math.floor(t/86400),n=Math.floor((t-3600*r*24)/3600),o=Math.floor((t-3600*r*24-3600*n)/60),t=t-3600*r*24-3600*n-60*o;let a="";return r&&(a+=q(r)+"d:"),n&&(a+=q(n)+"h:"),a+=q(o)+"m:"+q(t)+"s",a}function q(e){return 0===e?"00":10<=e?e.toString():"0"+e}async function G({url:e,body:t},r){const n={"Content-Type":"application/json"},o=r.getImmediate({optional:!0});!o||(c=await o.getHeartbeatsHeader())&&(n["X-Firebase-Client"]=c);var a={method:"POST",body:JSON.stringify(t),headers:n};let i;try{i=await fetch(e,a)}catch(e){throw V.create("fetch-network-error",{originalErrorMessage:null==e?void 0:e.message})}if(200!==i.status)throw V.create("fetch-status-error",{httpStatus:i.status});let s;try{s=await i.json()}catch(e){throw V.create("fetch-parse-error",{originalErrorMessage:null==e?void 0:e.message})}var c=s.ttl.match(/^([\d.]+)(s)$/);if(!c||!c[2]||isNaN(Number(c[1])))throw V.create("fetch-parse-error",{originalErrorMessage:"ttl field (timeToLive) is not in standard Protobuf Duration "+`format: ${s.ttl}`});a=1e3*Number(c[1]),c=Date.now();return{token:s.token,expireTimeMillis:c+a,issuedAtTimeMillis:c}}function X(e,t){var{projectId:r,appId:n,apiKey:o}=e.options;return{url:`${$}/projects/${r}/apps/${n}:${W}?key=${o}`,body:{debug_token:t}}}const J="firebase-app-check-database",Y=1,Z="firebase-app-check-store",Q="debug-token";let ee=null;function te(){return ee||(ee=new Promise((t,r)=>{try{const e=indexedDB.open(J,Y);e.onsuccess=e=>{t(e.target.result)},e.onerror=e=>{var t;r(V.create("storage-open",{originalErrorMessage:null===(t=e.target.error)||void 0===t?void 0:t.message}))},e.onupgradeneeded=e=>{const t=e.target.result;0===e.oldVersion&&t.createObjectStore(Z,{keyPath:"compositeKey"})}}catch(e){r(V.create("storage-open",{originalErrorMessage:null==e?void 0:e.message}))}}),ee)}async function re(e,t){const r=await te(),n=r.transaction(Z,"readwrite"),o=n.objectStore(Z),a=o.put({compositeKey:e,value:t});return new Promise((t,r)=>{a.onsuccess=e=>{t()},n.onerror=e=>{var t;r(V.create("storage-set",{originalErrorMessage:null===(t=e.target.error)||void 0===t?void 0:t.message}))}})}async function ne(e){const t=await te(),o=t.transaction(Z,"readonly"),r=o.objectStore(Z),a=r.get(e);return new Promise((r,n)=>{a.onsuccess=e=>{var t=e.target.result;r(t?t.value:void 0)},o.onerror=e=>{var t;n(V.create("storage-get",{originalErrorMessage:null===(t=e.target.error)||void 0===t?void 0:t.message}))}})}function oe(e){return`${e.options.appId}-${e.name}`}const ae=new class{constructor(e){this.name=e,this._logLevel=m,this._logHandler=_,this._userLogHandler=null}get logLevel(){return this._logLevel}set logLevel(e){if(!(e in t))throw new TypeError(`Invalid value "${e}" assigned to \`logLevel\``);this._logLevel=e}setLogLevel(e){this._logLevel="string"==typeof e?E[e]:e}get logHandler(){return this._logHandler}set logHandler(e){if("function"!=typeof e)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,t.DEBUG,...e),this._logHandler(this,t.DEBUG,...e)}log(...e){this._userLogHandler&&this._userLogHandler(this,t.VERBOSE,...e),this._logHandler(this,t.VERBOSE,...e)}info(...e){this._userLogHandler&&this._userLogHandler(this,t.INFO,...e),this._logHandler(this,t.INFO,...e)}warn(...e){this._userLogHandler&&this._userLogHandler(this,t.WARN,...e),this._logHandler(this,t.WARN,...e)}error(...e){this._userLogHandler&&this._userLogHandler(this,t.ERROR,...e),this._logHandler(this,t.ERROR,...e)}}("@firebase/app-check");async function ie(t){if(a()){let e=void 0;try{e=await ne(oe(t))}catch(e){ae.warn(`Failed to read token from IndexedDB. Error: ${e}`)}return e}}function se(e,t){return a()?re(oe(e),t).catch(e=>{ae.warn(`Failed to write token to IndexedDB. Error: ${e}`)}):Promise.resolve()}async function ce(){let e=void 0;try{e=await ne(Q)}catch(e){}if(e)return e;var t,r=f();return t=r,re(Q,t).catch(e=>ae.warn(`Failed to persist debug token to IndexedDB. Error: ${e}`)),r}function le(){return B.enabled}async function he(){var e=B;if(e.enabled&&e.token)return e.token.promise;throw Error(`
            Can't get debug token in production mode.
        `)}function ue(){var e=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if("undefined"!=typeof global)return global;throw new Error("Unable to locate global object.")}();const t=B;if(t.initialized=!0,"string"==typeof e.FIREBASE_APPCHECK_DEBUG_TOKEN||!0===e.FIREBASE_APPCHECK_DEBUG_TOKEN){t.enabled=!0;const r=new s;t.token=r,"string"==typeof e.FIREBASE_APPCHECK_DEBUG_TOKEN?r.resolve(e.FIREBASE_APPCHECK_DEBUG_TOKEN):r.resolve(ce())}}const pe={error:"UNKNOWN_ERROR"};async function de(e,t=!1){var r=e.app;z(r);const n=H(r);let o=n.token,a=void 0;if(o&&!Ee(o)&&(n.token=void 0,o=void 0),o||(s=await n.cachedTokenPromise)&&(Ee(s)?o=s:await se(r,void 0)),!t&&o&&Ee(o))return{token:o.token};let i=!1;if(le()){n.exchangeTokenPromise||(n.exchangeTokenPromise=G(X(r,await he()),e.heartbeatServiceProvider).finally(()=>{n.exchangeTokenPromise=void 0}),i=!0);var s=await n.exchangeTokenPromise;return await se(r,s),{token:(n.token=s).token}}try{n.exchangeTokenPromise||(n.exchangeTokenPromise=n.provider.getToken().finally(()=>{n.exchangeTokenPromise=void 0}),i=!0),o=await H(r).exchangeTokenPromise}catch(e){"appCheck/throttled"===e.code?ae.warn(e.message):ae.error(e),a=e}let c;return o?a?c=Ee(o)?{token:o.token,internalError:a}:me(a):(c={token:o.token},n.token=o,await se(r,o)):c=me(a),i&&we(r,c),c}function fe(e,t,r,n){var o=e["app"];const a=H(o);o={next:r,error:n,type:t};if(a.tokenObservers=[...a.tokenObservers,o],a.token&&Ee(a.token)){const i=a.token;Promise.resolve().then(()=>{r({token:i.token}),ve(e)}).catch(()=>{})}a.cachedTokenPromise.then(()=>ve(e))}function ge(e,t){const r=H(e);var n=r.tokenObservers.filter(e=>e.next!==t);0===n.length&&r.tokenRefresher&&r.tokenRefresher.isRunning()&&r.tokenRefresher.stop(),r.tokenObservers=n}function ve(e){var t=e["app"];const r=H(t);let n=r.tokenRefresher;n||(n=function(r){const n=r["app"];return new F(async()=>{var e=H(n);let t;if(t=e.token?await de(r,!0):await de(r),t.error)throw t.error;if(t.internalError)throw t.internalError},()=>!0,()=>{var e=H(n);if(e.token){var t=e.token.issuedAtTimeMillis+.5*(e.token.expireTimeMillis-e.token.issuedAtTimeMillis)+3e5,e=e.token.expireTimeMillis-3e5,t=Math.min(t,e);return Math.max(0,t-Date.now())}return 0},j.RETRIAL_MIN_WAIT,j.RETRIAL_MAX_WAIT)}(e),r.tokenRefresher=n),!n.isRunning()&&r.isTokenAutoRefreshEnabled&&n.start()}function we(e,t){for(const r of H(e).tokenObservers)try{"EXTERNAL"===r.type&&null!=t.error?r.error(t.error):r.next(t)}catch(e){}}function Ee(e){return 0<e.expireTimeMillis-Date.now()}function me(e){return{token:(t=pe,o.encodeString(JSON.stringify(t),!1)),error:e};var t}class be{constructor(e,t){this.app=e,this.heartbeatServiceProvider=t}_delete(){var e=H(this.app)["tokenObservers"];for(const t of e)ge(this.app,t.next);return Promise.resolve()}}function _e(t){return{getToken:e=>de(t,e),getLimitedUseToken:()=>async function(e){var t=e.app;z(t);const r=H(t)["provider"];if(le()){var n=(await G(X(t,await he()),e.heartbeatServiceProvider))["token"];return{token:n}}return{token:n=(await r.getToken())["token"]}}(t),addTokenListener:e=>fe(t,"INTERNAL",e),removeTokenListener:e=>ge(t.app,e)}}function ke(t,r){const n=new s,e=H(t);e.reCAPTCHAState={initialized:n};const o=Te(t);var a=U(!1);return a?Ae(t,r,a,o,n):function(e){const t=document.createElement("script");x(t,N`https://www.google.com/recaptcha/api.js`),t.onload=e,document.head.appendChild(t)}(()=>{var e=U(!1);if(!e)throw new Error("no recaptcha");Ae(t,r,e,o,n)}),n.promise}function ye(t,r){const n=new s,e=H(t);e.reCAPTCHAState={initialized:n};const o=Te(t);var a=U(!0);return a?Ae(t,r,a,o,n):function(e){const t=document.createElement("script");x(t,N`https://www.google.com/recaptcha/enterprise.js`),t.onload=e,document.head.appendChild(t)}(()=>{var e=U(!0);if(!e)throw new Error("no recaptcha");Ae(t,r,e,o,n)}),n.promise}function Ae(e,t,r,n,o){r.ready(()=>{!function(e,t,r,n){const o=r.render(n,{sitekey:t,size:"invisible",callback:()=>{H(e).reCAPTCHAState.succeeded=!0},"error-callback":()=>{H(e).reCAPTCHAState.succeeded=!1}}),a=H(e);a.reCAPTCHAState=Object.assign(Object.assign({},a.reCAPTCHAState),{widgetId:o})}(e,t,r,n),o.resolve(r)})}function Te(e){var t=`fire_app_check_${e.name}`;const r=document.createElement("div");return r.id=t,r.style.display="none",document.body.appendChild(r),t}async function Se(n){z(n);const o=await H(n).reCAPTCHAState.initialized.promise;return new Promise((e,t)=>{const r=H(n).reCAPTCHAState;o.ready(()=>{e(o.execute(r.widgetId,{action:"fire_app_check"}))})})}class Ce{constructor(e){this._siteKey=e,this._throttleData=null}async getToken(){var e;De(this._throttleData);var t=await Se(this._app).catch(e=>{throw V.create("recaptcha-error")});if(null===(e=H(this._app).reCAPTCHAState)||void 0===e||!e.succeeded)throw V.create("recaptcha-error");let r;try{r=await G(function(e,t){var{projectId:r,appId:n,apiKey:o}=e.options;return{url:`${$}/projects/${r}/apps/${n}:exchangeRecaptchaV3Token?key=${o}`,body:{recaptcha_v3_token:t}}}(this._app,t),this._heartbeatServiceProvider)}catch(e){throw null!==(t=e.code)&&void 0!==t&&t.includes("fetch-status-error")?(this._throttleData=Oe(Number(null===(t=e.customData)||void 0===t?void 0:t.httpStatus),this._throttleData),V.create("throttled",{time:K(this._throttleData.allowRequestsAfter-Date.now()),httpStatus:this._throttleData.httpStatus})):e}return this._throttleData=null,r}initialize(e){this._app=e,this._heartbeatServiceProvider=He._getProvider(e,"heartbeat"),ke(e,this._siteKey).catch(()=>{})}isEqual(e){return e instanceof Ce&&this._siteKey===e._siteKey}}class Re{constructor(e){this._siteKey=e,this._throttleData=null}async getToken(){var e;De(this._throttleData);var t=await Se(this._app).catch(e=>{throw V.create("recaptcha-error")});if(null===(e=H(this._app).reCAPTCHAState)||void 0===e||!e.succeeded)throw V.create("recaptcha-error");let r;try{r=await G(function(e,t){var{projectId:r,appId:n,apiKey:o}=e.options;return{url:`${$}/projects/${r}/apps/${n}:exchangeRecaptchaEnterpriseToken?key=${o}`,body:{recaptcha_enterprise_token:t}}}(this._app,t),this._heartbeatServiceProvider)}catch(e){throw null!==(t=e.code)&&void 0!==t&&t.includes("fetch-status-error")?(this._throttleData=Oe(Number(null===(t=e.customData)||void 0===t?void 0:t.httpStatus),this._throttleData),V.create("throttled",{time:K(this._throttleData.allowRequestsAfter-Date.now()),httpStatus:this._throttleData.httpStatus})):e}return this._throttleData=null,r}initialize(e){this._app=e,this._heartbeatServiceProvider=He._getProvider(e,"heartbeat"),ye(e,this._siteKey).catch(()=>{})}isEqual(e){return e instanceof Re&&this._siteKey===e._siteKey}}class Pe{constructor(e){this._customProviderOptions=e}async getToken(){var e=await this._customProviderOptions.getToken(),t=d(e.token),t=null!==t&&t<Date.now()&&0<t?1e3*t:Date.now();return Object.assign(Object.assign({},e),{issuedAtTimeMillis:t})}initialize(e){this._app=e}isEqual(e){return e instanceof Pe&&this._customProviderOptions.getToken.toString()===e._customProviderOptions.getToken.toString()}}function Oe(e,t){if(404===e||403===e)return{backoffCount:1,allowRequestsAfter:Date.now()+864e5,httpStatus:e};var r,n,o=t?t.backoffCount:0,n=(t=2,r=1e3*Math.pow(t,o),n=Math.round(v*r*(Math.random()-.5)*2),Math.min(g,r+n));return{backoffCount:o+1,allowRequestsAfter:Date.now()+n,httpStatus:e}}function De(e){if(e&&Date.now()-e.allowRequestsAfter<=0)throw V.create("throttled",{time:K(e.allowRequestsAfter-Date.now()),httpStatus:e.httpStatus})}function Ne(e=He.getApp(),t){var r;e=(r=e)&&r._delegate?r._delegate:r;const n=He._getProvider(e,"app-check");if(B.initialized||ue(),le()&&he().then(e=>console.log(`App Check debug token: ${e}. You will need to add it to your app's App Check settings in the Firebase console for it to work.`)),n.isInitialized()){var o=n.getImmediate();const a=n.getOptions();if(a.isTokenAutoRefreshEnabled===t.isTokenAutoRefreshEnabled&&a.provider.isEqual(t.provider))return o;throw V.create("already-initialized",{appName:e.name})}o=n.initialize({options:t});return function(t,e,r){const n=function(e,t){return L.set(e,t),L.get(e)}(t,Object.assign({},M));n.activated=!0,n.provider=e,n.cachedTokenPromise=ie(t).then(e=>(e&&Ee(e)&&(n.token=e,we(t,{token:e.token})),e)),n.isTokenAutoRefreshEnabled=void 0===r?t.automaticDataCollectionEnabled:r,n.provider.initialize(t)}(e,t.provider,t.isTokenAutoRefreshEnabled),H(e).isTokenAutoRefreshEnabled&&fe(o,"INTERNAL",()=>{}),o}const Ie="app-check-internal";He._registerComponent(new w("app-check",e=>{var t,r=e.getProvider("app").getImmediate(),n=e.getProvider("heartbeat");return t=r,e=n,new be(t,e)},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((e,t,r)=>{e.getProvider(Ie).initialize()})),He._registerComponent(new w(Ie,e=>{return _e(e.getProvider("app-check").getImmediate())},"PUBLIC").setInstantiationMode("EXPLICIT")),He.registerVersion("@firebase/app-check","0.8.6");const xe=new h("appCheck","AppCheck",{"use-before-activation":"App Check is being used before activate() is called for FirebaseApp {$appName}. Call activate() before instantiating other Firebase services."});class Le{constructor(e){this.app=e}activate(e,t){let r;r="string"==typeof e?new Ce(e):e instanceof Re||e instanceof Ce||e instanceof Pe?e:new Pe({getToken:e.getToken}),this._delegate=Ne(this.app,{provider:r,isTokenAutoRefreshEnabled:t})}setTokenAutoRefreshEnabled(e){if(!this._delegate)throw xe.create("use-before-activation",{appName:this.app.name});!function(e,t){const r=H(e.app);r.tokenRefresher&&(!0===t?r.tokenRefresher.start():r.tokenRefresher.stop()),r.isTokenAutoRefreshEnabled=t}(this._delegate,e)}getToken(e){if(!this._delegate)throw xe.create("use-before-activation",{appName:this.app.name});return async function(e,t){var r=await de(e,t);if(r.error)throw r.error;return{token:r.token}}(this._delegate,e)}onTokenChanged(e,t,r){if(!this._delegate)throw xe.create("use-before-activation",{appName:this.app.name});return function(e,t,r){let n=()=>{},o=()=>{};return n=null!=t.next?t.next.bind(t):t,null!=t.error?o=t.error.bind(t):r&&(o=r),fe(e,"EXTERNAL",n,o),()=>ge(e.app,n)}(this._delegate,e,t)}}const Me=e=>{var t=e.getProvider("app-compat").getImmediate();return new Le(t)};n.default.INTERNAL.registerComponent(new w("appCheck-compat",Me,"PUBLIC").setServiceProps({ReCaptchaEnterpriseProvider:Re,ReCaptchaV3Provider:Ce,CustomProvider:Pe})),n.default.registerVersion("@firebase/app-check-compat","0.3.13")}).apply(this,arguments)}catch(e){throw console.error(e),new Error("Cannot instantiate firebase-app-check-compat.js - be sure to load firebase-app.js first.")}});
//# sourceMappingURL=firebase-app-check-compat.js.map