1!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(j,R){"use strict";try{!(function(){function e(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var t,n=e(j);class s extends Error{constructor(e,t,n){super(t),this.code=e,this.customData=n,this.name="FirebaseError",Object.setPrototypeOf(this,s.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,r.prototype.create)}}class r{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(o,(e,t)=>{var n=r[t];return null!=n?String(n):`<${t}?>`})):"Error",i=`${this.serviceName}: ${i} (${a}).`;return new s(a,i,n)}}const o=/\{\$([^}]+)}/g;function c(e){return e&&e._delegate?e._delegate:e}class a{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}}const i="type.googleapis.com/google.protobuf.Int64Value",u="type.googleapis.com/google.protobuf.UInt64Value";function l(e,t){const n={};for(const r in e)e.hasOwnProperty(r)&&(n[r]=t(e[r]));return n}function p(e){if(null==e)return null;if("number"==typeof(e=e instanceof Number?e.valueOf():e)&&isFinite(e))return e;if(!0===e||!1===e)return e;if("[object String]"===Object.prototype.toString.call(e))return e;if(e instanceof Date)return e.toISOString();if(Array.isArray(e))return e.map(e=>p(e));if("function"==typeof e||"object"==typeof e)return l(e,e=>p(e));throw new Error("Data cannot be encoded in JSON: "+e)}function m(e){if(null==e)return e;if(e["@type"])switch(e["@type"]){case i:case u:var t=Number(e.value);if(isNaN(t))throw new Error("Data cannot be decoded from JSON: "+e);return t;default:throw new Error("Data cannot be decoded from JSON: "+e)}return Array.isArray(e)?e.map(e=>m(e)):"function"==typeof e||"object"==typeof e?l(e,e=>m(e)):e}const d="functions",h={OK:"ok",CANCELLED:"cancelled",UNKNOWN:"unknown",INVALID_ARGUMENT:"invalid-argument",DEADLINE_EXCEEDED:"deadline-exceeded",NOT_FOUND:"not-found",ALREADY_EXISTS:"already-exists",PERMISSION_DENIED:"permission-denied",UNAUTHENTICATED:"unauthenticated",RESOURCE_EXHAUSTED:"resource-exhausted",FAILED_PRECONDITION:"failed-precondition",ABORTED:"aborted",OUT_OF_RANGE:"out-of-range",UNIMPLEMENTED:"unimplemented",INTERNAL:"internal",UNAVAILABLE:"unavailable",DATA_LOSS:"data-loss"};class g extends s{constructor(e,t,n){super(`${d}/${e}`,t||""),this.details=n,Object.setPrototypeOf(this,g.prototype)}}function v(e,t){let n=function(e){if(200<=e&&e<300)return"ok";switch(e){case 0:return"internal";case 400:return"invalid-argument";case 401:return"unauthenticated";case 403:return"permission-denied";case 404:return"not-found";case 409:return"aborted";case 429:return"resource-exhausted";case 499:return"cancelled";case 500:return"internal";case 501:return"unimplemented";case 503:return"unavailable";case 504:return"deadline-exceeded"}return"unknown"}(e),r=n,a=void 0;try{var i=t&&t.error;if(i){const e=i.status;if("string"==typeof e){if(!h[e])return new g("internal","internal");n=h[e],r=e}var s=i.message;"string"==typeof s&&(r=s),a=i.details,void 0!==a&&(a=m(a))}}catch(e){}return"ok"===n?null:new g(n,r,a)}class f{constructor(e,t,n){this.auth=null,this.messaging=null,this.appCheck=null,this.auth=e.getImmediate({optional:!0}),this.messaging=t.getImmediate({optional:!0}),this.auth||e.get().then(e=>this.auth=e,()=>{}),this.messaging||t.get().then(e=>this.messaging=e,()=>{}),this.appCheck||n.get().then(e=>this.appCheck=e,()=>{})}async getAuthToken(){if(this.auth)try{var e=await this.auth.getToken();return null==e?void 0:e.accessToken}catch(e){return}}
1async getMessagingToken(){if(this.messaging&&"Notification"in self&&"granted"===Notification.permission)try{return this.messaging.getToken()}catch(e){return}}async getAppCheckToken(e){if(this.appCheck){var t=e?await this.appCheck.getLimitedUseToken():await this.appCheck.getToken();return t.error?null:t.token}return null}async getContext(e){return{authToken:await this.getAuthToken(),messagingToken:await this.getMessagingToken(),appCheckToken:await this.getAppCheckToken(e)}}}const w="us-central1",y=/^data: (.*?)(?:\n|$)/;class b{constructor(e,t,n,r,a=w,i=(...e)=>fetch(...e)){this.app=e,this.fetchImpl=i,this.emulatorOrigin=null,this.contextProvider=new f(t,n,r),this.cancelAllRequests=new Promise(e=>{this.deleteService=()=>Promise.resolve(e())});try{var s=new URL(a);this.customDomain=s.origin+("/"===s.pathname?"":s.pathname),this.region=w}catch(e){this.customDomain=null,this.region=a}}_delete(){return this.deleteService()}_url(e){var t=this.app.options.projectId;return null===this.emulatorOrigin?null!==this.customDomain?`${this.customDomain}/${e}`:`https://${this.region}-${t}.cloudfunctions.net/${e}`:`${this.emulatorOrigin}/${t}/${this.region}/${e}`}}function T(a,i,s){var e=e=>{return t=e,n=s||{},r=(e=a)._url(i),I(e,r,t,n);var t,n,r};return e.stream=(e,t)=>{return n=e,e=t,r=(t=a)._url(i),k(t,r,n,e||{});var n,r},e}async function E(e,t){const n={};var r=await e.contextProvider.getContext(t.limitedUseAppCheckTokens);return r.authToken&&(n.Authorization="Bearer "+r.authToken),r.messagingToken&&(n["Firebase-Instance-ID-Token"]=r.messagingToken),null!==r.appCheckToken&&(n["X-Firebase-AppCheck"]=r.appCheckToken),n}async function I(e,t,n,r){var a={data:n=p(n)},i=await E(e,r);const s=function(n){let r=null;return{promise:new Promise((e,t)=>{r=setTimeout(()=>{t(new g("deadline-exceeded","deadline-exceeded"))},n)}),cancel:()=>{r&&clearTimeout(r)}}}(r.timeout||7e4);a=await Promise.race([async function(e,t,n,r){n["Content-Type"]="application/json";let a;try{a=await r(e,{method:"POST",body:JSON.stringify(t),headers:n})}catch(e){return{status:0,json:null}}let i=null;try{i=await a.json()}catch(e){}return{status:a.status,json:i}}(t,a,i,e.fetchImpl),s.promise,e.cancelAllRequests]);if(s.cancel(),!a)throw new g("cancelled","Firebase Functions instance was deleted.");i=v(a.status,a.json);if(i)throw i;if(!a.json)throw new g("internal","Response is not valid JSON object.");let o=a.json.data;if(void 0===o&&(o=a.json.result),void 0===o)throw new g("internal","Response is missing data field.");return{data:m(o)}}async function k(e,t,n,r){var a={data:n=p(n)};const i=await E(e,r);i["Content-Type"]="application/json",i.Accept="text/event-stream";let s;try{s=await e.fetchImpl(t,{method:"POST",body:JSON.stringify(a),headers:i,signal:null==r?void 0:r.signal})}catch(e){if(e instanceof Error&&"AbortError"===e.name){const h=new g("cancelled","Request was cancelled.");return{data:Promise.reject(h),stream:{[Symbol.asyncIterator](){return{next(){return Promise.reject(h)}}}}}}const d=v(0,null);return{data:Promise.reject(d),stream:{[Symbol.asyncIterator](){return{next(){return Promise.reject(d)}}}}}}let o,c;var u=new Promise((e,t)=>{o=e,c=t});null!==(a=null==r?void 0:r.signal)&&void 0!==a&&a.addEventListener("abort",()=>{var e=new g("cancelled","Request was cancelled.");c(e)});const l=function(l,i,d,h){const p=(e,t)=>{var n=e.match(y);if(n){n=n[1];try{var r=JSON.parse(n);if("result"in r)return void i(m(r.result));if("message"in r)return void t.enqueue(m(r.message));if("error"in r){var a=v(0,r);return t.error(a),void d(a)}}catch(e){if(e instanceof g)return t.error(e),void d(e)}}},f=new TextDecoder;return new ReadableStream({start(c){let u="";return async function e(){if(null!=h&&h.aborted){const t=new g("cancelled","Request was cancelled");return c.error(t),d(t),Promise.resolve()}try{const{value:n,done:r}=await l.read();if(r)return u.trim()&&p(u.trim(),c),void c.close();if(null!=h&&h.aborted){const i=new g("cancelled","Request was cancelled");return c.error(i),d(i),void await l.cancel()}u+=f.decode(n,{stream:!0});const a=u.split("\n");u=a.pop()||"";for(const s of a)s.trim()&&p(s.trim(),c);return e()}catch(e){const o=e instanceof g?e:v(0,null);c.error(o),d(o)}}()},cancel(){return l.cancel()}})}(s.body.getReader(),o,c,null==r?void 0:r.signal);
1return{stream:{[Symbol.asyncIterator](){const n=l.getReader();return{async next(){var{value:e,done:t}=await n.read();return{value:e,done:t}},async return(){return await n.cancel(),{done:!0,value:void 0}}}}},data:u}}const N="@firebase/functions",A="0.12.0";function C(e,t,n){c(e).emulatorOrigin=`http://${t}:${n}`}function P(e,t,n){return r=c(e),a=t,i=n,(s=e=>I(r,a,e,i||{})).stream=(e,t)=>k(r,a,e,t||{}),s;var r,a,i,s}R._registerComponent(new a(d,(e,{instanceIdentifier:t})=>{var n=e.getProvider("app").getImmediate(),r=e.getProvider("auth-internal"),a=e.getProvider("messaging-internal"),i=e.getProvider("app-check-internal");return new b(n,r,a,i,t)},"PUBLIC").setMultipleInstances(!0)),R.registerVersion(N,A,t),R.registerVersion(N,A,"esm2017");var O;class S{constructor(e,t){this.app=e,this._delegate=t,this._region=this._delegate.region,this._customDomain=this._delegate.customDomain}httpsCallable(e,t){return T(c(this._delegate),e,t)}httpsCallableFromURL(e,t){return P(this._delegate,e,t)}useFunctionsEmulator(e){var t=e.match("[a-zA-Z]+://([a-zA-Z0-9.-]+)(?::([0-9]+))?");if(null==t)throw new s("functions","No origin provided to useFunctionsEmulator()");if(null==t[2])throw new s("functions","Port missing in origin provided to useFunctionsEmulator()");return C(this._delegate,t[1],Number(t[2]))}useEmulator(e,t){return C(this._delegate,e,t)}}const D="us-central1",_=(e,{instanceIdentifier:t})=>{var n=e.getProvider("app-compat").getImmediate(),r=e.getProvider("functions").getImmediate({identifier:null!=t?t:D});return new S(n,r)};O={Functions:S},n.default.INTERNAL.registerComponent(new a("functions-compat",_,"PUBLIC").setServiceProps(O).setMultipleInstances(!0)),n.default.registerVersion("@firebase/functions-compat","0.3.17")}).apply(this,arguments)}catch(e){throw console.error(e),new Error("Cannot instantiate firebase-functions-compat.js - be sure to load firebase-app.js first.")}}); 2//# sourceMappingURL=firebase-functions-compat.js.map
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.