mirror of
https://github.com/Heretek-AI/GDevelop.git
synced 2026-08-27 11:11:26 -04:00
36721c63e0
* Update Firebase SDK to v8.10.0 * Fix small firebase usability issues * Fix tracer stopping * Fix a crash when using tracers * Add password reset action to authentication
3 lines
11 KiB
JavaScript
3 lines
11 KiB
JavaScript
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(require("@firebase/app")):"function"==typeof define&&define.amd?define(["@firebase/app"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).firebase)}(this,function(j){"use strict";try{!function(){function e(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var t=e(j),r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function n(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function a(e,s,a,u){return new(a=a||Promise)(function(n,t){function r(e){try{o(u.next(e))}catch(e){t(e)}}function i(e){try{o(u.throw(e))}catch(e){t(e)}}function o(e){var t;e.done?n(e.value):((t=e.value)instanceof a?t:new a(function(e){e(t)})).then(r,i)}o((u=u.apply(e,s||[])).next())})}function p(n,r){var i,o,s,a={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(t){return function(e){return function(t){if(i)throw new TypeError("Generator is already executing.");for(;a;)try{if(i=1,o&&(s=2&t[0]?o.return:t[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,t[1])).done)return s;switch(o=0,(t=s?[2&t[0],s.value]:t)[0]){case 0:case 1:s=t;break;case 4:return a.label++,{value:t[1],done:!1};case 5:a.label++,o=t[1],t=[0];continue;case 7:t=a.ops.pop(),a.trys.pop();continue;default:if(!(s=0<(s=a.trys).length&&s[s.length-1])&&(6===t[0]||2===t[0])){a=0;continue}if(3===t[0]&&(!s||t[1]>s[0]&&t[1]<s[3])){a.label=t[1];break}if(6===t[0]&&a.label<s[1]){a.label=s[1],s=t;break}if(s&&a.label<s[2]){a.label=s[2],a.ops.push(t);break}s[2]&&a.ops.pop(),a.trys.pop();continue}t=r.call(n,a)}catch(e){t=[6,e],o=0}finally{i=s=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}([t,e])}}}var i,o="FirebaseError",s=(n(u,i=Error),u);function u(e,t,n){t=i.call(this,t)||this;return t.code=e,t.customData=n,t.name=o,Object.setPrototypeOf(t,u.prototype),Error.captureStackTrace&&Error.captureStackTrace(t,c.prototype.create),t}var c=(l.prototype.create=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r,i=t[0]||{},o=this.service+"/"+e,e=this.errors[e],e=e?(r=i,e.replace(f,function(e,t){var n=r[t];return null!=n?String(n):"<"+t+"?>"})):"Error",e=this.serviceName+": "+e+" ("+o+").";return new s(o,e,i)},l);function l(e,t,n){this.service=e,this.serviceName=t,this.errors=n}var f=/\{\$([^}]+)}/g,h=(d.prototype.setInstantiationMode=function(e){return this.instantiationMode=e,this},d.prototype.setMultipleInstances=function(e){return this.multipleInstances=e,this},d.prototype.setServiceProps=function(e){return this.serviceProps=e,this},d.prototype.setInstanceCreatedCallback=function(e){return this.onInstanceCreated=e,this},d);function d(e,t,n){this.name=e,this.instanceFactory=t,this.type=n,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}var v,y={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"},g=(n(m,v=Error),m);function m(e,t,n){t=v.call(this,t)||this;return Object.setPrototypeOf(t,m.prototype),t.code=e,t.details=n,t}function b(e,t,n){var r=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),i=r,e=void 0;try{var o=t&&t.error;if(o){var s=o.status;if("string"==typeof s){if(!y[s])return new g("internal","internal");r=y[s],i=s}var a=o.message;"string"==typeof a&&(i=a),void 0!==(e=o.details)&&(e=n.decode(e))}}catch(e){}return"ok"===r?null:new g(r,i,e)}var w=(E.prototype.getAuthToken=function(){return a(this,void 0,void 0,function(){var t;return p(this,function(e){switch(e.label){case 0:if(!this.auth)return[2,void 0];e.label=1;case 1:return e.trys.push([1,3,,4]),[4,this.auth.getToken()];case 2:return(t=e.sent())?[2,t.accessToken]:[2,void 0];case 3:return e.sent(),[2,void 0];case 4:return[2]}})})},E.prototype.getInstanceIdToken=function(){return a(this,void 0,void 0,function(){return p(this,function(e){switch(e.label){case 0:if(!(this.messaging&&"Notification"in self&&"granted"===Notification.permission))return[2,void 0];e.label=1;case 1:return e.trys.push([1,3,,4]),[4,this.messaging.getToken()];case 2:return[2,e.sent()];case 3:return e.sent(),[2,void 0];case 4:return[2]}})})},E.prototype.getContext=function(){return a(this,void 0,void 0,function(){var t,n;return p(this,function(e){switch(e.label){case 0:return[4,this.getAuthToken()];case 1:return t=e.sent(),[4,this.getInstanceIdToken()];case 2:return n=e.sent(),[2,{authToken:t,instanceIdToken:n}]}})})},E);function E(e,t){var n=this;this.auth=null,this.messaging=null,this.auth=e.getImmediate({optional:!0}),this.messaging=t.getImmediate({optional:!0}),this.auth||e.get().then(function(e){return n.auth=e},function(){}),this.messaging||t.get().then(function(e){return n.messaging=e},function(){})}function I(e,t){var n,r={};for(n in e)e.hasOwnProperty(n)&&(r[n]=t(e[n]));return r}var T=(N.prototype.encode=function(e){var t=this;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(function(e){return t.encode(e)});if("function"==typeof e||"object"==typeof e)return I(e,function(e){return t.encode(e)});throw new Error("Data cannot be encoded in JSON: "+e)},N.prototype.decode=function(e){var t=this;if(null==e)return e;if(e["@type"])switch(e["@type"]){case"type.googleapis.com/google.protobuf.Int64Value":case"type.googleapis.com/google.protobuf.UInt64Value":var n=Number(e.value);if(isNaN(n))throw new Error("Data cannot be decoded from JSON: "+e);return n;default:throw new Error("Data cannot be decoded from JSON: "+e)}return Array.isArray(e)?e.map(function(e){return t.decode(e)}):"function"==typeof e||"object"==typeof e?I(e,function(e){return t.decode(e)}):e},N);function N(){}var O=(Object.defineProperty(k.prototype,"app",{get:function(){return this.app_},enumerable:!1,configurable:!0}),k.prototype._url=function(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},k.prototype.useEmulator=function(e,t){this.emulatorOrigin="http://"+e+":"+t},k.prototype.useFunctionsEmulator=function(e){this.emulatorOrigin=e},k.prototype.httpsCallable=function(t,n){var r=this;return function(e){return r.call(t,e,n||{})}},k.prototype.postJSON=function(i,o,s){return a(this,void 0,void 0,function(){var t,n,r;return p(this,function(e){switch(e.label){case 0:return s["Content-Type"]="application/json",[4,this.getAppCheckToken()];case 1:null!==(t=e.sent())&&(s["X-Firebase-AppCheck"]=t),e.label=2;case 2:return e.trys.push([2,4,,5]),[4,this.fetchImpl(i,{method:"POST",body:JSON.stringify(o),headers:s})];case 3:return n=e.sent(),[3,5];case 4:return e.sent(),[2,{status:0,json:null}];case 5:r=null,e.label=6;case 6:return e.trys.push([6,8,,9]),[4,n.json()];case 7:return r=e.sent(),[3,9];case 8:return e.sent(),[3,9];case 9:return[2,{status:n.status,json:r}]}})})},k.prototype.getAppCheckToken=function(){return a(this,void 0,void 0,function(){var t;return p(this,function(e){switch(e.label){case 0:return(t=this.appCheckProvider.getImmediate({optional:!0}))?[4,t.getToken()]:[3,2];case 1:return[2,e.sent().token];case 2:return[2,null]}})})},k.prototype.call=function(c,l,f){return a(this,void 0,void 0,function(){var i,o,s,a,u;return p(this,function(e){switch(e.label){case 0:return i=this._url(c),l=this.serializer.encode(l),o={data:l},s={},[4,this.contextProvider.getContext()];case 1:return(a=e.sent()).authToken&&(s.Authorization="Bearer "+a.authToken),a.instanceIdToken&&(s["Firebase-Instance-ID-Token"]=a.instanceIdToken),u=f.timeout||7e4,n=u,t=new Promise(function(e,t){r=setTimeout(function(){t(new g("deadline-exceeded","deadline-exceeded"))},n)}),u=(a={timer:r,promise:t}).timer,a=a.promise,[4,Promise.race([A(u,this.postJSON(i,o,s)),a,A(u,this.cancelAllRequests)])];case 2:if(!(a=e.sent()))throw new g("cancelled","Firebase Functions instance was deleted.");if(u=b(a.status,a.json,this.serializer))throw u;if(!a.json)throw new g("internal","Response is not valid JSON object.");if(void 0===(u=void 0===(u=a.json.data)?a.json.result:u))throw new g("internal","Response is missing data field.");return[2,{data:this.serializer.decode(u)}]}var n,r,t})})},k);function k(e,t,n,r,i,o){var s=this;void 0===i&&(i="us-central1"),this.app_=e,this.appCheckProvider=r,this.fetchImpl=o,this.serializer=new T,this.emulatorOrigin=null,this.INTERNAL={delete:function(){return Promise.resolve(s.deleteService())}},this.contextProvider=new w(t,n),this.cancelAllRequests=new Promise(function(e){s.deleteService=function(){return e()}});try{var a=new URL(i);this.customDomain=a.origin,this.region="us-central1"}catch(e){this.customDomain=null,this.region=i}}function A(n,r){return a(this,void 0,void 0,function(){var t;return p(this,function(e){switch(e.label){case 0:return[4,r];case 1:return t=e.sent(),clearTimeout(n),[2,t]}})})}var S,P,D;S=t.default,P=fetch.bind(self),D={Functions:O},S.INTERNAL.registerComponent(new h("functions",function(e,t){var n=t.instanceIdentifier,r=e.getProvider("app").getImmediate(),i=e.getProvider("auth-internal"),t=e.getProvider("app-check-internal"),e=e.getProvider("messaging");return new O(r,i,e,t,n,P)},"PUBLIC").setServiceProps(D).setMultipleInstances(!0)),t.default.registerVersion("@firebase/functions","0.6.15")}.apply(this,arguments)}catch(e){throw console.error(e),new Error("Cannot instantiate firebase-functions.js - be sure to load firebase-app.js first.")}});
|
|
//# sourceMappingURL=B_firebase-functions.js.map
|