UNPKG

21.5 kBJavaScriptView Raw
1!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(require("@firebase/app")):"function"==typeof define&&define.amd?define(["@firebase/app"],t):t((e=e||self).firebase)}(this,function(Pe){"use strict";try{(function(){Pe=Pe&&Pe.hasOwnProperty("default")?Pe.default:Pe;var n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};var s=function(){return(s=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function c(o,a,s,u){return new(s=s||Promise)(function(e,t){function n(e){try{i(u.next(e))}catch(e){t(e)}}function r(e){try{i(u.throw(e))}catch(e){t(e)}}function i(t){t.done?e(t.value):new s(function(e){e(t.value)}).then(n,r)}i((u=u.apply(o,a||[])).next())})}function f(n,r){var i,o,a,e,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return e={next:t(0),throw:t(1),return:t(2)},"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(;s;)try{if(i=1,o&&(a=2&t[0]?o.return:t[0]?o.throw||((a=o.return)&&a.call(o),0):o.next)&&!(a=a.call(o,t[1])).done)return a;switch(o=0,a&&(t=[2&t[0],a.value]),t[0]){case 0:case 1:a=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,o=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(a=0<(a=s.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3])){s.label=t[1];break}if(6===t[0]&&s.label<a[1]){s.label=a[1],a=t;break}if(a&&s.label<a[2]){s.label=a[2],s.ops.push(t);break}a[2]&&s.ops.pop(),s.trys.pop();continue}t=r.call(n,s)}catch(e){t=[6,e],o=0}finally{i=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}([t,e])}}}function r(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||0<t--)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}var e,t,i,p=(i=Error,n(e=a,t=i),void(e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)),a);function o(){this.constructor=e}function a(e,t){var n=i.call(this,t)||this;return n.code=e,n.name="FirebaseError",Object.setPrototypeOf(n,a.prototype),Error.captureStackTrace&&Error.captureStackTrace(n,u.prototype.create),n}var u=(l.prototype.create=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];for(var r=t[0]||{},i=this.service+"/"+e,o=this.errors[e],a=o?function(e,r){return e.replace(d,function(e,t){var n=r[t];return null!=n?n.toString():"<"+t+"?>"})}(o,r):"Error",s=this.serviceName+": "+a+" ("+i+").",u=new p(i,s),c=0,f=Object.keys(r);c<f.length;c++){var l=f[c];"_"!==l.slice(-1)&&(l in u&&console.warn('Overwriting FirebaseError base field "'+l+'" can cause unexpected behavior.'),u[l]=r[l])}return u},l);function l(e,t,n){this.service=e,this.serviceName=t,this.errors=n}var d=/\{\$([^}]+)}/g;function h(n){return new Promise(function(e,t){n.onsuccess=function(){e(n.result)},n.onerror=function(){t(n.error)}})}function v(n,r,i){var o,e=new Promise(function(e,t){h(o=n[r].apply(n,i)).then(e,t)});return e.request=o,e}function y(e,n,t){t.forEach(function(t){Object.defineProperty(e.prototype,t,{get:function(){return this[n][t]},set:function(e){this[n][t]=e}})})}function g(t,n,r,e){e.forEach(function(e){e in r.prototype&&(t.prototype[e]=function(){return v(this[n],e,arguments)})})}function w(t,n,r,e){e.forEach(function(e){e in r.prototype&&(t.prototype[e]=function(){return this[n][e].apply(this[n],arguments)})})}function b(t,n,r,e){e.forEach(function(e){e in r.prototype&&(t.prototype[e]=function(){return function(e,t,n){var r=v(e,t,n);return r.then(function(e){if(e)return new m(e,r.request)})}(this[n],e,arguments)})})}function _(e){this._index=e}function m(e,t){this._cursor=e,this._request=t}function E(e){this._store=e}function S(n){this._tx=n,this.complete=new Promise(function(e,t){n.oncomplete=function(){e()},n.onerror=function(){t(n.error)},n.onabort=function(){t(n.error)}})}function I(e,t,n){this._db=e,this.oldVersion=t,this.transaction=new S(n)}function T(e){this._db=e}y(_,"_index",["name","keyPath","multiEntry","unique"]),g(_,"_index",IDBIndex,["get","getKey","getAll","getAllKeys","count"]),b(_,"_index",IDBIndex,["openCursor","openKeyCursor"]),y(m,"_cursor",["direction","key","primaryKey","value"]),g(m,"_cursor",IDBCursor,["update","delete"]),["advance","continue","continuePrimaryKey"].forEach(function(n){n in IDBCursor.prototype&&(m.prototype[n]=function(){var t=this,e=arguments;return Promise.resolve().then(function(){return t._cursor[n].apply(t._cursor,e),h(t._request).then(function(e){if(e)return new m(e,t._request)})})})}),E.prototype.createIndex=function(){return new _(this._store.createIndex.apply(this._store,arguments))},E.prototype.index=function(){return new _(this._store.index.apply(this._store,arguments))},y(E,"_store",["name","keyPath","indexNames","autoIncrement"]),g(E,"_store",IDBObjectStore,["put","add","delete","clear","get","getAll","getKey","getAllKeys","count"]),b(E,"_store",IDBObjectStore,["openCursor","openKeyCursor"]),w(E,"_store",IDBObjectStore,["deleteIndex"]),S.prototype.objectStore=function(){return new E(this._tx.objectStore.apply(this._tx,arguments))},y(S,"_tx",["objectStoreNames","mode"]),w(S,"_tx",IDBTransaction,["abort"]),I.prototype.createObjectStore=function(){return new E(this._db.createObjectStore.apply(this._db,arguments))},y(I,"_db",["name","version","objectStoreNames"]),w(I,"_db",IDBDatabase,["deleteObjectStore","close"]),T.prototype.transaction=function(){return new S(this._db.transaction.apply(this._db,arguments))},y(T,"_db",["name","version","objectStoreNames"]),w(T,"_db",IDBDatabase,["close"]),["openCursor","openKeyCursor"].forEach(function(i){[E,_].forEach(function(e){i in e.prototype&&(e.prototype[i.replace("open","iterate")]=function(){var e=function(e){return Array.prototype.slice.call(e)}(arguments),t=e[e.length-1],n=this._store||this._index,r=n[i].apply(n,e.slice(0,-1));r.onsuccess=function(){t(r.result)}})})}),[_,E].forEach(function(e){e.prototype.getAll||(e.prototype.getAll=function(e,n){var r=this,i=[];return new Promise(function(t){r.iterateCursor(e,function(e){e?(i.push(e.value),void 0===n||i.length!=n?e.continue():t(i)):t(i)})})})});var N,O=1e4,C="w:0.3.3",A="FIS_v2",k="https://firebaseinstallations.googleapis.com/v1",j=36e5,P=((N={})["missing-app-config-values"]='Missing App configuration value: "{$valueName}"',N["not-registered"]="Firebase Installation is not registered.",N["installation-not-found"]="Firebase Installation not found.",N["request-failed"]='{$requestName} request failed with error "{$serverCode} {$serverStatus}: {$serverMessage}"',N["app-offline"]="Could not process request. Application offline.",N["delete-pending-registration"]="Can't delete installation while there is a pending registration request.",N),x=new u("installations","Installations",P);function D(e){return e instanceof p&&e.code.includes("request-failed")}function q(e){var t,n;if(!e||!e.options)throw F("App Configuration");if(!e.name)throw F("App Name");try{for(var r=function(e){var t="function"==typeof Symbol&&e[Symbol.iterator],n=0;return t?t.call(e):{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}(["projectId","apiKey","appId"]),i=r.next();!i.done;i=r.next()){var o=i.value;if(!e.options[o])throw F(o)}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}return{appName:e.name,projectId:e.options.projectId,apiKey:e.options.apiKey,appId:e.options.appId}}function F(e){return x.create("missing-app-config-values",{valueName:e})}function R(e){var t=e.projectId;return k+"/projects/"+t+"/installations"}function G(e){return{token:e.token,requestStatus:2,expiresIn:function(e){return Number(e.replace("s","000"))}(e.expiresIn),creationTime:Date.now()}}function V(r,i){return c(this,void 0,void 0,function(){var t,n;return f(this,function(e){switch(e.label){case 0:return[4,i.json()];case 1:return t=e.sent(),n=t.error,[2,x.create("request-failed",{requestName:r,serverCode:n.code,serverMessage:n.message,serverStatus:n.status})]}})})}function L(e){var t=e.apiKey;return new Headers({"Content-Type":"application/json",Accept:"application/json","x-goog-api-key":t})}function K(e,t){var n=t.refreshToken,r=L(e);return r.append("Authorization",function(e){return A+" "+e}(n)),r}function B(n){return c(this,void 0,void 0,function(){var t;return f(this,function(e){switch(e.label){case 0:return[4,n()];case 1:return 500<=(t=e.sent()).status&&t.status<600?[2,n()]:[2,t]}})})}function M(t){return new Promise(function(e){setTimeout(e,t)})}function U(e){return btoa(String.fromCharCode.apply(String,function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(r(arguments[t]));return e}(e))).replace(/\+/g,"-").replace(/\//g,"_")}var H=/^[cdef][\w-]{21}$/,$="";function W(){try{var e=new Uint8Array(17);(self.crypto||self.msCrypto).getRandomValues(e),e[0]=112+e[0]%16;var t=function(e){return U(e).substr(0,22)}(e);return H.test(t)?t:$}catch(e){return $}}var z="firebase-installations-database",J=1,X="firebase-installations-store",Y=null;function Q(){return Y=Y||function(e,t,n){var r=v(indexedDB,"open",[e,t]),i=r.request;return i&&(i.onupgradeneeded=function(e){n&&n(new I(i.result,e.oldVersion,i.transaction))}),r.then(function(e){return new T(e)})}(z,J,function(e){switch(e.oldVersion){case 0:e.createObjectStore(X)}})}function Z(i,o){return c(this,void 0,void 0,function(){var t,n,r;return f(this,function(e){switch(e.label){case 0:return t=ne(i),[4,Q()];case 1:return n=e.sent(),[4,(r=n.transaction(X,"readwrite")).objectStore(X).put(o,t)];case 2:return e.sent(),[4,r.complete];case 3:return e.sent(),[2,o]}})})}function ee(i){return c(this,void 0,void 0,function(){var t,n,r;return f(this,function(e){switch(e.label){case 0:return t=ne(i),[4,Q()];case 1:return n=e.sent(),[4,(r=n.transaction(X,"readwrite")).objectStore(X).delete(t)];case 2:return e.sent(),[4,r.complete];case 3:return e.sent(),[2]}})})}function te(s,u){return c(this,void 0,void 0,function(){var t,n,r,i,o,a;return f(this,function(e){switch(e.label){case 0:return t=ne(s),[4,Q()];case 1:return n=e.sent(),r=n.transaction(X,"readwrite"),[4,(i=r.objectStore(X)).get(t)];case 2:return o=e.sent(),void 0!==(a=u(o))?[3,4]:[4,i.delete(t)];case 3:return e.sent(),[3,6];case 4:return[4,i.put(a,t)];case 5:e.sent(),e.label=6;case 6:return[4,r.complete];case 7:return e.sent(),[2,a]}})})}function ne(e){return e.appName+"!"+e.appId}function re(i){return c(this,void 0,void 0,function(){var r,t,n;return f(this,function(e){switch(e.label){case 0:return[4,te(i,function(e){var t=function(e){return oe(e||{fid:W(),registrationStatus:0})}(e),n=function(e,t){{if(0!==t.registrationStatus)return 1===t.registrationStatus?{installationEntry:t,registrationPromise:function(o){return c(this,void 0,void 0,function(){var t,n,r,i;return f(this,function(e){switch(e.label){case 0:return[4,ie(o)];case 1:t=e.sent(),e.label=2;case 2:return 1!==t.registrationStatus?[3,5]:[4,M(100)];case 3:return e.sent(),[4,ie(o)];case 4:return t=e.sent(),[3,2];case 5:return 0!==t.registrationStatus?[3,7]:[4,re(o)];case 6:return n=e.sent(),r=n.installationEntry,(i=n.registrationPromise)?[2,i]:[2,r];case 7:return[2,t]}})})}(e)}:{installationEntry:t};if(!navigator.onLine){var n=Promise.reject(x.create("app-offline"));return{installationEntry:t,registrationPromise:n}}var r={fid:t.fid,registrationStatus:1,registrationTime:Date.now()},i=function(r,i){return c(this,void 0,void 0,function(){var t,n;return f(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,7]),[4,function(s,e){var u=e.fid;return c(this,void 0,void 0,function(){var t,n,r,i,o,a;return f(this,function(e){switch(e.label){case 0:return t=R(s),n=L(s),r={fid:u,authVersion:A,appId:s.appId,sdkVersion:C},i={method:"POST",headers:n,body:JSON.stringify(r)},[4,B(function(){return fetch(t,i)})];case 1:return(o=e.sent()).ok?[4,o.json()]:[3,3];case 2:return a=e.sent(),[2,{fid:a.fid||u,registrationStatus:2,refreshToken:a.refreshToken,authToken:G(a.authToken)}];case 3:return[4,V("Create Installation",o)];case 4:throw e.sent()}})})}(r,i)];case 1:return t=e.sent(),[2,Z(r,t)];case 2:return D(n=e.sent())&&409===n.serverCode?[4,ee(r)]:[3,4];case 3:return e.sent(),[3,6];case 4:return[4,Z(r,{fid:i.fid,registrationStatus:0})];case 5:e.sent(),e.label=6;case 6:throw n;case 7:return[2]}})})}(e,r);return{installationEntry:r,registrationPromise:i}}}(i,t);return r=n.registrationPromise,n.installationEntry})];case 1:return(t=e.sent()).fid!==$?[3,3]:(n={},[4,r]);case 2:return[2,(n.installationEntry=e.sent(),n)];case 3:return[2,{installationEntry:t,registrationPromise:r}]}})})}function ie(e){return te(e,function(e){if(!e)throw x.create("installation-not-found");return oe(e)})}function oe(e){return function(e){return 1===e.registrationStatus&&e.registrationTime+O<Date.now()}(e)?{fid:e.fid,registrationStatus:0}:e}function ae(s,u){return c(this,void 0,void 0,function(){var t,n,r,i,o,a;return f(this,function(e){switch(e.label){case 0:return t=function(e,t){var n=t.fid;return R(e)+"/"+n+"/authTokens:generate"}(s,u),n=K(s,u),r={installation:{sdkVersion:C}},i={method:"POST",headers:n,body:JSON.stringify(r)},[4,B(function(){return fetch(t,i)})];case 1:return(o=e.sent()).ok?[4,o.json()]:[3,3];case 2:return a=e.sent(),[2,G(a)];case 3:return[4,V("Generate Auth Token",o)];case 4:throw e.sent()}})})}function se(i,o){return void 0===o&&(o=!1),c(this,void 0,void 0,function(){var r,t,n;return f(this,function(e){switch(e.label){case 0:return[4,te(i,function(e){if(!ce(e))throw x.create("not-registered");var t=e.authToken;if(!o&&function(e){return 2===e.requestStatus&&!function(e){var t=Date.now();return t<e.creationTime||e.creationTime+e.expiresIn<t+j}(e)}(t))return e;if(1===t.requestStatus)return r=function(r,i){return c(this,void 0,void 0,function(){var t,n;return f(this,function(e){switch(e.label){case 0:return[4,ue(r)];case 1:t=e.sent(),e.label=2;case 2:return 1!==t.authToken.requestStatus?[3,5]:[4,M(100)];case 3:return e.sent(),[4,ue(r)];case 4:return t=e.sent(),[3,2];case 5:return 0===(n=t.authToken).requestStatus?[2,se(r,i)]:[2,n]}})})}(i,o),e;if(!navigator.onLine)throw x.create("app-offline");var n=function(e){var t={requestStatus:1,requestTime:Date.now()};return s(s({},e),{authToken:t})}(e);return r=function(i,o){return c(this,void 0,void 0,function(){var t,n,r;return f(this,function(e){switch(e.label){case 0:return e.trys.push([0,3,,8]),[4,ae(i,o)];case 1:return t=e.sent(),r=s(s({},o),{authToken:t}),[4,Z(i,r)];case 2:return e.sent(),[2,t];case 3:return!D(n=e.sent())||401!==n.serverCode&&404!==n.serverCode?[3,5]:[4,ee(i)];case 4:return e.sent(),[3,7];case 5:return r=s(s({},o),{authToken:{requestStatus:0}}),[4,Z(i,r)];case 6:e.sent(),e.label=7;case 7:throw n;case 8:return[2]}})})}(i,n),n})];case 1:return t=e.sent(),r?[4,r]:[3,3];case 2:return n=e.sent(),[3,4];case 3:n=t.authToken,e.label=4;case 4:return[2,n]}})})}function ue(e){return te(e,function(e){if(!ce(e))throw x.create("not-registered");return function(e){return 1===e.requestStatus&&e.requestTime+O<Date.now()}(e.authToken)?s(s({},e),{authToken:{requestStatus:0}}):e})}function ce(e){return void 0!==e&&2===e.registrationStatus}function fe(n,r){return void 0===r&&(r=!1),c(this,void 0,void 0,function(){var t;return f(this,function(e){switch(e.label){case 0:return[4,function(n){return c(this,void 0,void 0,function(){var t;return f(this,function(e){switch(e.label){case 0:return[4,re(n)];case 1:return(t=e.sent().registrationPromise)?[4,t]:[3,3];case 2:e.sent(),e.label=3;case 3:return[2]}})})}(t=q(n))];case 1:return e.sent(),[4,se(t,r)];case 2:return[2,e.sent().token]}})})}function le(o,a){return c(this,void 0,void 0,function(){var t,n,r,i;return f(this,function(e){switch(e.label){case 0:return t=function(e,t){var n=t.fid;return R(e)+"/"+n}(o,a),n=K(o,a),r={method:"DELETE",headers:n},[4,B(function(){return fetch(t,r)})];case 1:return(i=e.sent()).ok?[3,3]:[4,V("Delete Installation",i)];case 2:throw e.sent();case 3:return[2]}})})}Pe.INTERNAL.registerService("installations",function(t){return q(t),{app:t,getId:function(){return function(o){return c(this,void 0,void 0,function(){var t,n,r,i;return f(this,function(e){switch(e.label){case 0:return[4,re(t=q(o))];case 1:return n=e.sent(),r=n.installationEntry,(i=n.registrationPromise)?i.catch(console.error):se(t).catch(console.error),[2,r.fid]}})})}(t)},getToken:function(e){return fe(t,e)},delete:function(){return function(r){return c(this,void 0,void 0,function(){var t,n;return f(this,function(e){switch(e.label){case 0:return[4,te(t=q(r),function(e){if(!e||0!==e.registrationStatus)return e})];case 1:if(!(n=e.sent()))return[3,6];if(1!==n.registrationStatus)return[3,2];throw x.create("delete-pending-registration");case 2:if(2!==n.registrationStatus)return[3,6];if(navigator.onLine)return[3,3];throw x.create("app-offline");case 3:return[4,le(t,n)];case 4:return e.sent(),[4,ee(t)];case 5:e.sent(),e.label=6;case 6:return[2]}})})}(t)}}});var pe,de,he,ve,ye,ge="measurementId",we="firebase_id",be="origin";function _e(e){return Array.isArray(window[e])}function me(e,n,t){var r=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];window[n].push(arguments)};return window[t]&&"function"==typeof window[t]&&(r=window[t]),window[t]=function(p,d){return function(e,t,n){if(e===pe.EVENT){var r=[];if(n&&n.send_to){var i=n.send_to;Array.isArray(i)||(i=[i]);for(var o=0,a=i;o<a.length;o++){var s=a[o],u=d[s];if(!u){r=[];break}r.push(u)}}if(0===r.length)for(var c=0,f=Object.values(d);c<f.length;c++){var l=f[c];r.push(l)}Promise.all(r).then(function(){return p(pe.EVENT,t,n||{})}).catch(function(e){return console.error(e)})}else if(e===pe.CONFIG){(d[t]||Promise.resolve()).then(function(){p(pe.CONFIG,t,n)}).catch(function(e){return console.error(e)})}else p(pe.SET,t)}}(r,e),{gtagCore:r,wrappedGtag:window[t]}}(de=pe=pe||{}).EVENT="event",de.SET="set",de.CONFIG="config",(ve=he=he||{}).ADD_PAYMENT_INFO="add_payment_info",ve.ADD_TO_CART="add_to_cart",ve.ADD_TO_WISHLIST="add_to_wishlist",ve.BEGIN_CHECKOUT="begin_checkout",ve.CHECKOUT_PROGRESS="checkout_progress",ve.EXCEPTION="exception",ve.GENERATE_LEAD="generate_lead",ve.LOGIN="login",ve.PAGE_VIEW="page_view",ve.PURCHASE="purchase",ve.REFUND="refund",ve.REMOVE_FROM_CART="remove_from_cart",ve.SCREEN_VIEW="screen_view",ve.SEARCH="search",ve.SELECT_CONTENT="select_content",ve.SET_CHECKOUT_OPTION="set_checkout_option",ve.SHARE="share",ve.SIGN_UP="sign_up",ve.TIMING_COMPLETE="timing_complete",ve.VIEW_ITEM="view_item",ve.VIEW_ITEM_LIST="view_item_list",ve.VIEW_PROMOTION="view_promotion",ve.VIEW_SEARCH_RESULTS="view_search_results";var Ee,Se,Ie=((ye={})["no-ga-id"]='"'+ge+'" field is empty in Firebase config. Firebase Analytics requires this field to contain a valid measurement ID.',ye["already-exists"]="A Firebase Analytics instance with the measurement ID ${id} already exists. Only one Firebase Analytics instance can be created for each measurement ID.",ye["already-initialized"]="Firebase Analytics has already been initialized.settings() must be called before initializing any Analytics instanceor it will have no effect.",ye),Te=new u("analytics","Analytics",Ie),Ne={},Oe="dataLayer",Ce="gtag",Ae=!1;function ke(e){if(Ae)throw Te.create("already-initialized");e.dataLayerName&&(Oe=e.dataLayerName),e.gtagName&&(Ce=e.gtagName)}function je(e,t){var r=e.options[ge];if(!r)throw Te.create("no-ga-id");if(null!=Ne[r])throw Te.create("already-exists",{id:r});if(!Ae){_e(Oe)||function(e){var t=document.createElement("script");t.src="https://www.googletagmanager.com/gtag/js?l="+e,t.async=!0,document.head.appendChild(t)}(Oe),function(e){_e(e)?window[e]:window[e]=[]}(Oe);var n=me(Ne,Oe,Ce),i=n.wrappedGtag,o=n.gtagCore;Se=i,Ee=o,Ae=!0}Ne[r]=function(r,i){return c(this,void 0,void 0,function(){var t,n;return f(this,function(e){switch(e.label){case 0:return[4,r.installations().getId()];case 1:return t=e.sent(),i("js",new Date),i(pe.CONFIG,r.options[ge],((n={})[we]=t,n[be]="firebase",n.update=!0,n)),[2]}})})}(e,Ee);var a={app:e,logEvent:function(e,t,n){return function(e,t,n,r,i){var o=r||{};i&&i.global||(o=s(s({},r),{send_to:t})),e(pe.EVENT,n,o||{})}(Se,r,e,t,n)},setCurrentScreen:function(e,t){return function(e,t,n,r){r&&r.global?e(pe.SET,{screen_name:n}):e(pe.CONFIG,t,{update:!0,screen_name:n})}(Se,r,e,t)},setUserId:function(e,t){return function(e,t,n,r){r&&r.global?e(pe.SET,{user_id:n}):e(pe.CONFIG,t,{update:!0,user_id:n})}(Se,r,e,t)},setUserProperties:function(e,t){return function(e,t,n,r){if(r&&r.global){for(var i={},o=0,a=Object.keys(n);o<a.length;o++){var s=a[o];i["user_properties."+s]=n[s]}e(pe.SET,i)}else e(pe.CONFIG,t,{update:!0,user_properties:n})}(Se,r,e,t)},setAnalyticsCollectionEnabled:function(e){return function(e,t){window["ga-disable-"+e]=!t}(r,e)}};return t({INTERNAL:{analytics:{logEvent:a.logEvent}}}),a}Pe.INTERNAL.registerService("analytics",je,{settings:ke,EventName:he},void 0,!1)}).apply(this,arguments)}catch(e){throw console.error(e),new Error("Cannot instantiate firebase-analytics - be sure to load firebase-app.js first.")}});
2//# sourceMappingURL=firebase-analytics.js.map