@amplitude/analytics-browser
Advanced tools
Comparing version 0.3.1 to 0.4.0
import { BrowserConfig, UTMData } from '@amplitude/analytics-types'; | ||
export declare const trackAttributions: (config: BrowserConfig) => void; | ||
export declare const getAttributions: (config: BrowserConfig) => Record<string, string>; | ||
export declare const getUtmParam: () => UTMData; | ||
@@ -4,0 +4,0 @@ export declare const getReferrer: () => Record<string, string | undefined>; |
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getFbclid = exports.getGclid = exports.getReferrer = exports.getUtmParam = exports.trackAttributions = void 0; | ||
exports.getFbclid = exports.getGclid = exports.getReferrer = exports.getUtmParam = exports.getAttributions = void 0; | ||
var tslib_1 = require("tslib"); | ||
var analytics_core_1 = require("@amplitude/analytics-core"); | ||
var constants_1 = require("./constants"); | ||
var utm_cookie_1 = require("./storage/utm-cookie"); | ||
var query_params_1 = require("./utils/query-params"); | ||
var trackAttributions = function (config) { | ||
var attribution = (0, tslib_1.__assign)((0, tslib_1.__assign)((0, tslib_1.__assign)((0, tslib_1.__assign)({}, (config.includeUtm && (0, exports.getUtmParam)())), (config.includeReferrer && (0, exports.getReferrer)())), (config.includeGclid && (0, exports.getGclid)())), (config.includeFbclid && (0, exports.getFbclid)())); | ||
if (Object.keys(attribution).length === 0) { | ||
return; | ||
} | ||
var id = new analytics_core_1.Identify(); | ||
Object.entries(attribution).forEach(function (_a) { | ||
var _b = (0, tslib_1.__read)(_a, 2), key = _b[0], value = _b[1]; | ||
if (value) { | ||
id.setOnce("initial_".concat(key), value); | ||
id.set(key, value); | ||
} | ||
}); | ||
void (0, analytics_core_1.identify)(undefined, undefined, id); | ||
var getAttributions = function (config) { | ||
var attributions = (0, tslib_1.__assign)((0, tslib_1.__assign)((0, tslib_1.__assign)((0, tslib_1.__assign)({}, (config.includeUtm && (0, exports.getUtmParam)())), (config.includeReferrer && (0, exports.getReferrer)())), (config.includeGclid && (0, exports.getGclid)())), (config.includeFbclid && (0, exports.getFbclid)())); | ||
return attributions; | ||
}; | ||
exports.trackAttributions = trackAttributions; | ||
exports.getAttributions = getAttributions; | ||
var getUtmParam = function () { | ||
@@ -25,0 +13,0 @@ var params = (0, query_params_1.getQueryParams)(); |
@@ -1,3 +0,18 @@ | ||
import { Identify, Revenue } from '@amplitude/analytics-core'; | ||
import { AmplitudeReturn, BrowserOptions, EventOptions, Plugin, Result, TransportType } from '@amplitude/analytics-types'; | ||
import { AmplitudeCore } from '@amplitude/analytics-core'; | ||
import { BrowserConfig, BrowserOptions, EventOptions, Identify as IIdentify, Result, Revenue as IRevenue, TransportType } from '@amplitude/analytics-types'; | ||
export declare class AmplitudeBrowser extends AmplitudeCore<BrowserConfig> { | ||
init(apiKey: string, userId?: string, options?: BrowserOptions): Promise<void>; | ||
getUserId(): string | undefined; | ||
setUserId(userId: string): void; | ||
getDeviceId(): string | undefined; | ||
setDeviceId(deviceId: string): void; | ||
getSessionId(): number | undefined; | ||
setSessionId(sessionId: number): void; | ||
setOptOut(optOut: boolean): void; | ||
setTransport(transport: TransportType): void; | ||
identify(identify: IIdentify, eventOptions?: EventOptions): Promise<Result>; | ||
groupIdentify(groupType: string, groupName: string | string[], identify: IIdentify, eventOptions?: EventOptions): Promise<Result>; | ||
revenue(revenue: IRevenue, eventOptions?: EventOptions): Promise<Result>; | ||
trackAttributions(): Promise<Result> | undefined; | ||
} | ||
/** | ||
@@ -11,3 +26,3 @@ * Initializes the Amplitude SDK with your apiKey, userId and optional configurations. | ||
*/ | ||
export declare const init: (apiKey: string, userId?: string | undefined, options?: BrowserOptions | undefined) => AmplitudeReturn<void>; | ||
export declare const init: (apiKey: string, userId?: string | undefined, options?: BrowserOptions | undefined) => import("@amplitude/analytics-types").AmplitudeReturn<void>; | ||
/** | ||
@@ -21,3 +36,3 @@ * Adds a new plugin. | ||
*/ | ||
export declare const add: (plugin: Plugin) => AmplitudeReturn<void>; | ||
export declare const add: (plugin: import("@amplitude/analytics-types").Plugin) => import("@amplitude/analytics-types").AmplitudeReturn<void>; | ||
/** | ||
@@ -30,4 +45,80 @@ * Removes a plugin. | ||
*/ | ||
export declare const remove: (pluginName: string) => AmplitudeReturn<void>; | ||
export declare const remove: (pluginName: string) => import("@amplitude/analytics-types").AmplitudeReturn<void>; | ||
/** | ||
* Tracks user-defined event, with specified type, optional event properties and optional overwrites. | ||
* | ||
* ```typescript | ||
* // event tracking with event type only | ||
* track('Page Load'); | ||
* | ||
* // event tracking with event type and additional event properties | ||
* track('Page Load', { loadTime: 1000 }); | ||
* | ||
* // event tracking with event type, additional event properties, and overwritten event options | ||
* track('Page Load', { loadTime: 1000 }, { sessionId: -1 }); | ||
* | ||
* // alternatively, this tracking method is awaitable | ||
* const result = await track('Page Load').promise; | ||
* console.log(result.event); // {...} | ||
* console.log(result.code); // 200 | ||
* console.log(result.message); // "Event tracked successfully" | ||
* ``` | ||
*/ | ||
export declare const track: (eventInput: string | import("@amplitude/analytics-types").BaseEvent, eventProperties?: Record<string, any> | undefined, eventOptions?: EventOptions | undefined) => import("@amplitude/analytics-types").AmplitudeReturn<Result>; | ||
/** | ||
* Alias for track() | ||
*/ | ||
export declare const logEvent: (eventInput: string | import("@amplitude/analytics-types").BaseEvent, eventProperties?: Record<string, any> | undefined, eventOptions?: EventOptions | undefined) => import("@amplitude/analytics-types").AmplitudeReturn<Result>; | ||
/** | ||
* Sends an identify event containing user property operations | ||
* | ||
* ```typescript | ||
* const id = new Identify(); | ||
* id.set('colors', ['rose', 'gold']); | ||
* identify(id); | ||
* | ||
* // alternatively, this tracking method is awaitable | ||
* const result = await identify(id).promise; | ||
* console.log(result.event); // {...} | ||
* console.log(result.code); // 200 | ||
* console.log(result.message); // "Event tracked successfully" | ||
* ``` | ||
*/ | ||
export declare const identify: (identify: IIdentify, eventOptions?: EventOptions | undefined) => import("@amplitude/analytics-types").AmplitudeReturn<Result>; | ||
/** | ||
* Sends a group identify event containing group property operations. | ||
* | ||
* ```typescript | ||
* const id = new Identify(); | ||
* id.set('skills', ['js', 'ts']); | ||
* const groupType = 'org'; | ||
* const groupName = 'engineering'; | ||
* groupIdentify(groupType, groupName, id); | ||
* | ||
* // alternatively, this tracking method is awaitable | ||
* const result = await groupIdentify(groupType, groupName, id).promise; | ||
* console.log(result.event); // {...} | ||
* console.log(result.code); // 200 | ||
* console.log(result.message); // "Event tracked successfully" | ||
* ``` | ||
*/ | ||
export declare const groupIdentify: (groupType: string, groupName: string | string[], identify: IIdentify, eventOptions?: EventOptions | undefined) => import("@amplitude/analytics-types").AmplitudeReturn<Result>; | ||
export declare const setGroup: (groupType: string, groupName: string | string[]) => import("@amplitude/analytics-types").AmplitudeReturn<Result>; | ||
/** | ||
* Sends a revenue event containing revenue property operations. | ||
* | ||
* ```typescript | ||
* const rev = new Revenue(); | ||
* rev.setRevenue(100); | ||
* revenue(rev); | ||
* | ||
* // alternatively, this tracking method is awaitable | ||
* const result = await revenue(rev).promise; | ||
* console.log(result.event); // {...} | ||
* console.log(result.code); // 200 | ||
* console.log(result.message); // "Event tracked successfully" | ||
* ``` | ||
*/ | ||
export declare const revenue: (revenue: IRevenue, eventOptions?: EventOptions | undefined) => import("@amplitude/analytics-types").AmplitudeReturn<Result>; | ||
/** | ||
* Returns current user ID. | ||
@@ -110,78 +201,2 @@ * | ||
export declare const setTransport: (transport: TransportType) => void; | ||
/** | ||
* Tracks user-defined event, with specified type, optional event properties and optional overwrites. | ||
* | ||
* ```typescript | ||
* // event tracking with event type only | ||
* track('Page Load'); | ||
* | ||
* // event tracking with event type and additional event properties | ||
* track('Page Load', { loadTime: 1000 }); | ||
* | ||
* // event tracking with event type, additional event properties, and overwritten event options | ||
* track('Page Load', { loadTime: 1000 }, { sessionId: -1 }); | ||
* | ||
* // alternatively, this tracking method is awaitable | ||
* const result = await track('Page Load').promise; | ||
* console.log(result.event); // {...} | ||
* console.log(result.code); // 200 | ||
* console.log(result.message); // "Event tracked successfully" | ||
* ``` | ||
*/ | ||
export declare const track: (eventType: string, eventProperties?: Record<string, any> | undefined, eventOptions?: EventOptions | undefined) => AmplitudeReturn<Result>; | ||
/** | ||
* Alis for track() | ||
*/ | ||
export declare const logEvent: (eventType: string, eventProperties?: Record<string, any> | undefined, eventOptions?: EventOptions | undefined) => AmplitudeReturn<Result>; | ||
/** | ||
* Sends an identify event containing user property operations | ||
* | ||
* ```typescript | ||
* const id = new Identify(); | ||
* id.set('colors', ['rose', 'gold']); | ||
* identify(id); | ||
* | ||
* // alternatively, this tracking method is awaitable | ||
* const result = await identify(id).promise; | ||
* console.log(result.event); // {...} | ||
* console.log(result.code); // 200 | ||
* console.log(result.message); // "Event tracked successfully" | ||
* ``` | ||
*/ | ||
export declare const identify: (identify: Identify, eventOptions?: EventOptions | undefined) => AmplitudeReturn<Result>; | ||
/** | ||
* Sends a group identify event containing group property operations. | ||
* | ||
* ```typescript | ||
* const id = new Identify(); | ||
* id.set('skills', ['js', 'ts']); | ||
* const groupType = 'org'; | ||
* const groupName = 'engineering'; | ||
* groupIdentify(groupType, groupName, id); | ||
* | ||
* // alternatively, this tracking method is awaitable | ||
* const result = await groupIdentify(groupType, groupName, id).promise; | ||
* console.log(result.event); // {...} | ||
* console.log(result.code); // 200 | ||
* console.log(result.message); // "Event tracked successfully" | ||
* ``` | ||
*/ | ||
export declare const groupIdentify: (groupType: string, groupName: string | string[], identify: Identify, eventOptions?: EventOptions | undefined) => AmplitudeReturn<Result>; | ||
export declare const setGroup: (groupType: string, groupName: string | string[]) => AmplitudeReturn<Result>; | ||
/** | ||
* Sends a revenue event containing revenue property operations. | ||
* | ||
* ```typescript | ||
* const rev = new Revenue(); | ||
* rev.setRevenue(100); | ||
* revenue(rev); | ||
* | ||
* // alternatively, this tracking method is awaitable | ||
* const result = await revenue(rev).promise; | ||
* console.log(result.event); // {...} | ||
* console.log(result.code); // 200 | ||
* console.log(result.message); // "Event tracked successfully" | ||
* ``` | ||
*/ | ||
export declare const revenue: (revenue: Revenue, eventOptions?: EventOptions | undefined) => AmplitudeReturn<Result>; | ||
//# sourceMappingURL=browser-client.d.ts.map |
@@ -1,4 +0,3 @@ | ||
var _this = this; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.revenue = exports.setGroup = exports.groupIdentify = exports.identify = exports.logEvent = exports.track = exports.setTransport = exports.setOptOut = exports.setSessionId = exports.getSessionId = exports.setDeviceId = exports.getDeviceId = exports.setUserId = exports.getUserId = exports.remove = exports.add = exports.init = void 0; | ||
exports.setTransport = exports.setOptOut = exports.setSessionId = exports.getSessionId = exports.setDeviceId = exports.getDeviceId = exports.setUserId = exports.getUserId = exports.revenue = exports.setGroup = exports.groupIdentify = exports.identify = exports.logEvent = exports.track = exports.remove = exports.add = exports.init = exports.AmplitudeBrowser = void 0; | ||
var tslib_1 = require("tslib"); | ||
@@ -11,2 +10,108 @@ var analytics_core_1 = require("@amplitude/analytics-core"); | ||
var session_manager_1 = require("./session-manager"); | ||
var cookie_migration_1 = require("./cookie-migration"); | ||
var AmplitudeBrowser = /** @class */ (function (_super) { | ||
(0, tslib_1.__extends)(AmplitudeBrowser, _super); | ||
function AmplitudeBrowser() { | ||
return _super !== null && _super.apply(this, arguments) || this; | ||
} | ||
AmplitudeBrowser.prototype.init = function (apiKey, userId, options) { | ||
var _a, _b, _c; | ||
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () { | ||
var oldCookies, browserOptions; | ||
return (0, tslib_1.__generator)(this, function (_d) { | ||
switch (_d.label) { | ||
case 0: | ||
oldCookies = (0, cookie_migration_1.parseOldCookies)(apiKey, options); | ||
browserOptions = (0, config_1.useBrowserConfig)(apiKey, userId || oldCookies.userId, (0, tslib_1.__assign)((0, tslib_1.__assign)({}, options), { deviceId: (_a = oldCookies.deviceId) !== null && _a !== void 0 ? _a : options === null || options === void 0 ? void 0 : options.deviceId, sessionId: (_b = oldCookies.sessionId) !== null && _b !== void 0 ? _b : options === null || options === void 0 ? void 0 : options.sessionId, optOut: (_c = options === null || options === void 0 ? void 0 : options.optOut) !== null && _c !== void 0 ? _c : oldCookies.optOut })); | ||
return [4 /*yield*/, _super.prototype.init.call(this, undefined, undefined, browserOptions)]; | ||
case 1: | ||
_d.sent(); | ||
// Step 3: Store user session in cookie storage | ||
(0, session_manager_1.updateCookies)(this.config, oldCookies.lastEventTime); | ||
// Step 4: Install plugins | ||
return [4 /*yield*/, this.add(new context_1.Context())]; | ||
case 2: | ||
// Step 4: Install plugins | ||
_d.sent(); | ||
return [4 /*yield*/, this.add(new analytics_core_1.Destination())]; | ||
case 3: | ||
_d.sent(); | ||
// Step 4: Track attributions | ||
void this.trackAttributions(); | ||
return [2 /*return*/]; | ||
} | ||
}); | ||
}); | ||
}; | ||
AmplitudeBrowser.prototype.getUserId = function () { | ||
return this.config.userId; | ||
}; | ||
AmplitudeBrowser.prototype.setUserId = function (userId) { | ||
this.config.userId = userId; | ||
(0, session_manager_1.updateCookies)(this.config); | ||
}; | ||
AmplitudeBrowser.prototype.getDeviceId = function () { | ||
return this.config.deviceId; | ||
}; | ||
AmplitudeBrowser.prototype.setDeviceId = function (deviceId) { | ||
this.config.deviceId = deviceId; | ||
(0, session_manager_1.updateCookies)(this.config); | ||
}; | ||
AmplitudeBrowser.prototype.getSessionId = function () { | ||
return this.config.sessionId; | ||
}; | ||
AmplitudeBrowser.prototype.setSessionId = function (sessionId) { | ||
this.config.sessionId = sessionId; | ||
(0, session_manager_1.updateCookies)(this.config); | ||
}; | ||
AmplitudeBrowser.prototype.setOptOut = function (optOut) { | ||
_super.prototype.setOptOut.call(this, optOut); | ||
(0, session_manager_1.updateCookies)(this.config); | ||
}; | ||
AmplitudeBrowser.prototype.setTransport = function (transport) { | ||
this.config.transportProvider = (0, config_1.createTransport)(transport); | ||
}; | ||
AmplitudeBrowser.prototype.identify = function (identify, eventOptions) { | ||
if ((0, snippet_helper_1.isInstanceProxy)(identify)) { | ||
var queue = identify._q; | ||
identify._q = []; | ||
identify = (0, snippet_helper_1.convertProxyObjectToRealObject)(new analytics_core_1.Identify(), queue); | ||
} | ||
return _super.prototype.identify.call(this, identify, eventOptions); | ||
}; | ||
AmplitudeBrowser.prototype.groupIdentify = function (groupType, groupName, identify, eventOptions) { | ||
if ((0, snippet_helper_1.isInstanceProxy)(identify)) { | ||
var queue = identify._q; | ||
identify._q = []; | ||
identify = (0, snippet_helper_1.convertProxyObjectToRealObject)(new analytics_core_1.Identify(), queue); | ||
} | ||
return _super.prototype.groupIdentify.call(this, groupType, groupName, identify, eventOptions); | ||
}; | ||
AmplitudeBrowser.prototype.revenue = function (revenue, eventOptions) { | ||
if ((0, snippet_helper_1.isInstanceProxy)(revenue)) { | ||
var queue = revenue._q; | ||
revenue._q = []; | ||
revenue = (0, snippet_helper_1.convertProxyObjectToRealObject)(new analytics_core_1.Revenue(), queue); | ||
} | ||
return _super.prototype.revenue.call(this, revenue, eventOptions); | ||
}; | ||
AmplitudeBrowser.prototype.trackAttributions = function () { | ||
var attributions = (0, attribution_1.getAttributions)(this.config); | ||
if (Object.keys(attributions).length === 0) { | ||
return; | ||
} | ||
var id = new analytics_core_1.Identify(); | ||
Object.entries(attributions).forEach(function (_a) { | ||
var _b = (0, tslib_1.__read)(_a, 2), key = _b[0], value = _b[1]; | ||
if (value) { | ||
id.setOnce("initial_".concat(key), value); | ||
id.set(key, value); | ||
} | ||
}); | ||
return this.identify(id); | ||
}; | ||
return AmplitudeBrowser; | ||
}(analytics_core_1.AmplitudeCore)); | ||
exports.AmplitudeBrowser = AmplitudeBrowser; | ||
var client = new AmplitudeBrowser(); | ||
/** | ||
@@ -20,26 +125,3 @@ * Initializes the Amplitude SDK with your apiKey, userId and optional configurations. | ||
*/ | ||
var init = function (apiKey, userId, options) { | ||
return { | ||
promise: (function () { return (0, tslib_1.__awaiter)(_this, void 0, void 0, function () { | ||
var browserOptions, config; | ||
return (0, tslib_1.__generator)(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: | ||
browserOptions = (0, config_1.createConfig)(apiKey, userId, options); | ||
config = (0, analytics_core_1.init)(browserOptions); | ||
(0, session_manager_1.updateCookies)(config); | ||
return [4 /*yield*/, (0, analytics_core_1.add)(new context_1.Context())]; | ||
case 1: | ||
_a.sent(); | ||
return [4 /*yield*/, (0, analytics_core_1.add)(new analytics_core_1.Destination())]; | ||
case 2: | ||
_a.sent(); | ||
(0, attribution_1.trackAttributions)(config); | ||
return [2 /*return*/]; | ||
} | ||
}); | ||
}); })(), | ||
}; | ||
}; | ||
exports.init = init; | ||
exports.init = (0, analytics_core_1.returnWrapper)(client.init.bind(client)); | ||
/** | ||
@@ -53,8 +135,3 @@ * Adds a new plugin. | ||
*/ | ||
var add = function (plugin) { | ||
return { | ||
promise: (0, analytics_core_1.add)(plugin), | ||
}; | ||
}; | ||
exports.add = add; | ||
exports.add = (0, analytics_core_1.returnWrapper)(client.add.bind(client)); | ||
/** | ||
@@ -67,9 +144,80 @@ * Removes a plugin. | ||
*/ | ||
var remove = function (pluginName) { | ||
return { | ||
promise: (0, analytics_core_1.remove)(pluginName), | ||
}; | ||
}; | ||
exports.remove = remove; | ||
exports.remove = (0, analytics_core_1.returnWrapper)(client.remove.bind(client)); | ||
/** | ||
* Tracks user-defined event, with specified type, optional event properties and optional overwrites. | ||
* | ||
* ```typescript | ||
* // event tracking with event type only | ||
* track('Page Load'); | ||
* | ||
* // event tracking with event type and additional event properties | ||
* track('Page Load', { loadTime: 1000 }); | ||
* | ||
* // event tracking with event type, additional event properties, and overwritten event options | ||
* track('Page Load', { loadTime: 1000 }, { sessionId: -1 }); | ||
* | ||
* // alternatively, this tracking method is awaitable | ||
* const result = await track('Page Load').promise; | ||
* console.log(result.event); // {...} | ||
* console.log(result.code); // 200 | ||
* console.log(result.message); // "Event tracked successfully" | ||
* ``` | ||
*/ | ||
exports.track = (0, analytics_core_1.returnWrapper)(client.track.bind(client)); | ||
/** | ||
* Alias for track() | ||
*/ | ||
exports.logEvent = (0, analytics_core_1.returnWrapper)(client.logEvent.bind(client)); | ||
/** | ||
* Sends an identify event containing user property operations | ||
* | ||
* ```typescript | ||
* const id = new Identify(); | ||
* id.set('colors', ['rose', 'gold']); | ||
* identify(id); | ||
* | ||
* // alternatively, this tracking method is awaitable | ||
* const result = await identify(id).promise; | ||
* console.log(result.event); // {...} | ||
* console.log(result.code); // 200 | ||
* console.log(result.message); // "Event tracked successfully" | ||
* ``` | ||
*/ | ||
exports.identify = (0, analytics_core_1.returnWrapper)(client.identify.bind(client)); | ||
/** | ||
* Sends a group identify event containing group property operations. | ||
* | ||
* ```typescript | ||
* const id = new Identify(); | ||
* id.set('skills', ['js', 'ts']); | ||
* const groupType = 'org'; | ||
* const groupName = 'engineering'; | ||
* groupIdentify(groupType, groupName, id); | ||
* | ||
* // alternatively, this tracking method is awaitable | ||
* const result = await groupIdentify(groupType, groupName, id).promise; | ||
* console.log(result.event); // {...} | ||
* console.log(result.code); // 200 | ||
* console.log(result.message); // "Event tracked successfully" | ||
* ``` | ||
*/ | ||
exports.groupIdentify = (0, analytics_core_1.returnWrapper)(client.groupIdentify.bind(client)); | ||
exports.setGroup = (0, analytics_core_1.returnWrapper)(client.setGroup.bind(client)); | ||
/** | ||
* Sends a revenue event containing revenue property operations. | ||
* | ||
* ```typescript | ||
* const rev = new Revenue(); | ||
* rev.setRevenue(100); | ||
* revenue(rev); | ||
* | ||
* // alternatively, this tracking method is awaitable | ||
* const result = await revenue(rev).promise; | ||
* console.log(result.event); // {...} | ||
* console.log(result.code); // 200 | ||
* console.log(result.message); // "Event tracked successfully" | ||
* ``` | ||
*/ | ||
exports.revenue = (0, analytics_core_1.returnWrapper)(client.revenue.bind(client)); | ||
/** | ||
* Returns current user ID. | ||
@@ -81,6 +229,3 @@ * | ||
*/ | ||
var getUserId = function () { | ||
return (0, config_1.getConfig)().userId; | ||
}; | ||
exports.getUserId = getUserId; | ||
exports.getUserId = client.getUserId.bind(client); | ||
/** | ||
@@ -93,8 +238,3 @@ * Sets a new user ID. | ||
*/ | ||
var setUserId = function (userId) { | ||
var config = (0, config_1.getConfig)(); | ||
config.userId = userId; | ||
(0, session_manager_1.updateCookies)(config); | ||
}; | ||
exports.setUserId = setUserId; | ||
exports.setUserId = client.setUserId.bind(client); | ||
/** | ||
@@ -107,6 +247,3 @@ * Returns current device ID. | ||
*/ | ||
var getDeviceId = function () { | ||
return (0, config_1.getConfig)().deviceId; | ||
}; | ||
exports.getDeviceId = getDeviceId; | ||
exports.getDeviceId = client.getDeviceId.bind(client); | ||
/** | ||
@@ -121,8 +258,3 @@ * Sets a new device ID. | ||
*/ | ||
var setDeviceId = function (deviceId) { | ||
var config = (0, config_1.getConfig)(); | ||
config.deviceId = deviceId; | ||
(0, session_manager_1.updateCookies)(config); | ||
}; | ||
exports.setDeviceId = setDeviceId; | ||
exports.setDeviceId = client.setDeviceId.bind(client); | ||
/** | ||
@@ -135,6 +267,3 @@ * Returns current session ID. | ||
*/ | ||
var getSessionId = function () { | ||
return (0, config_1.getConfig)().sessionId; | ||
}; | ||
exports.getSessionId = getSessionId; | ||
exports.getSessionId = client.getSessionId.bind(client); | ||
/** | ||
@@ -148,8 +277,3 @@ * Sets a new session ID. | ||
*/ | ||
var setSessionId = function (sessionId) { | ||
var config = (0, config_1.getConfig)(); | ||
config.sessionId = sessionId; | ||
(0, session_manager_1.updateCookies)(config); | ||
}; | ||
exports.setSessionId = setSessionId; | ||
exports.setSessionId = client.setSessionId.bind(client); | ||
/** | ||
@@ -166,8 +290,3 @@ * Sets a new optOut config value. This toggles event tracking on/off. | ||
*/ | ||
var setOptOut = function (optOut) { | ||
(0, analytics_core_1.setOptOut)(optOut); | ||
var config = (0, config_1.getConfig)(); | ||
(0, session_manager_1.updateCookies)(config); | ||
}; | ||
exports.setOptOut = setOptOut; | ||
exports.setOptOut = client.setOptOut.bind(client); | ||
/** | ||
@@ -187,124 +306,3 @@ * Sets the network transport type for events. | ||
*/ | ||
var setTransport = function (transport) { | ||
var config = (0, config_1.getConfig)(); | ||
var transportProvider = (0, config_1.createTransport)(transport); | ||
config.transportProvider = transportProvider; | ||
}; | ||
exports.setTransport = setTransport; | ||
/** | ||
* Tracks user-defined event, with specified type, optional event properties and optional overwrites. | ||
* | ||
* ```typescript | ||
* // event tracking with event type only | ||
* track('Page Load'); | ||
* | ||
* // event tracking with event type and additional event properties | ||
* track('Page Load', { loadTime: 1000 }); | ||
* | ||
* // event tracking with event type, additional event properties, and overwritten event options | ||
* track('Page Load', { loadTime: 1000 }, { sessionId: -1 }); | ||
* | ||
* // alternatively, this tracking method is awaitable | ||
* const result = await track('Page Load').promise; | ||
* console.log(result.event); // {...} | ||
* console.log(result.code); // 200 | ||
* console.log(result.message); // "Event tracked successfully" | ||
* ``` | ||
*/ | ||
var track = function (eventType, eventProperties, eventOptions) { | ||
return { | ||
promise: (0, analytics_core_1.track)(eventType, eventProperties, eventOptions), | ||
}; | ||
}; | ||
exports.track = track; | ||
/** | ||
* Alis for track() | ||
*/ | ||
exports.logEvent = exports.track; | ||
/** | ||
* Sends an identify event containing user property operations | ||
* | ||
* ```typescript | ||
* const id = new Identify(); | ||
* id.set('colors', ['rose', 'gold']); | ||
* identify(id); | ||
* | ||
* // alternatively, this tracking method is awaitable | ||
* const result = await identify(id).promise; | ||
* console.log(result.event); // {...} | ||
* console.log(result.code); // 200 | ||
* console.log(result.message); // "Event tracked successfully" | ||
* ``` | ||
*/ | ||
var identify = function (identify, eventOptions) { | ||
if ((0, snippet_helper_1.isInstanceProxy)(identify)) { | ||
var queue = identify._q; | ||
identify._q = []; | ||
identify = (0, snippet_helper_1.convertProxyObjectToRealObject)(new analytics_core_1.Identify(), queue); | ||
} | ||
return { | ||
promise: (0, analytics_core_1.identify)(undefined, undefined, identify, eventOptions), | ||
}; | ||
}; | ||
exports.identify = identify; | ||
/** | ||
* Sends a group identify event containing group property operations. | ||
* | ||
* ```typescript | ||
* const id = new Identify(); | ||
* id.set('skills', ['js', 'ts']); | ||
* const groupType = 'org'; | ||
* const groupName = 'engineering'; | ||
* groupIdentify(groupType, groupName, id); | ||
* | ||
* // alternatively, this tracking method is awaitable | ||
* const result = await groupIdentify(groupType, groupName, id).promise; | ||
* console.log(result.event); // {...} | ||
* console.log(result.code); // 200 | ||
* console.log(result.message); // "Event tracked successfully" | ||
* ``` | ||
*/ | ||
var groupIdentify = function (groupType, groupName, identify, eventOptions) { | ||
if ((0, snippet_helper_1.isInstanceProxy)(identify)) { | ||
var queue = identify._q; | ||
identify._q = []; | ||
identify = (0, snippet_helper_1.convertProxyObjectToRealObject)(new analytics_core_1.Identify(), queue); | ||
} | ||
return { | ||
promise: (0, analytics_core_1.groupIdentify)(undefined, undefined, groupType, groupName, identify, eventOptions), | ||
}; | ||
}; | ||
exports.groupIdentify = groupIdentify; | ||
var setGroup = function (groupType, groupName) { | ||
return { | ||
promise: (0, analytics_core_1.setGroup)(groupType, groupName), | ||
}; | ||
}; | ||
exports.setGroup = setGroup; | ||
/** | ||
* Sends a revenue event containing revenue property operations. | ||
* | ||
* ```typescript | ||
* const rev = new Revenue(); | ||
* rev.setRevenue(100); | ||
* revenue(rev); | ||
* | ||
* // alternatively, this tracking method is awaitable | ||
* const result = await revenue(rev).promise; | ||
* console.log(result.event); // {...} | ||
* console.log(result.code); // 200 | ||
* console.log(result.message); // "Event tracked successfully" | ||
* ``` | ||
*/ | ||
var revenue = function (revenue, eventOptions) { | ||
if ((0, snippet_helper_1.isInstanceProxy)(revenue)) { | ||
var queue = revenue._q; | ||
revenue._q = []; | ||
revenue = (0, snippet_helper_1.convertProxyObjectToRealObject)(new analytics_core_1.Revenue(), queue); | ||
} | ||
return { | ||
promise: (0, analytics_core_1.revenue)(revenue, eventOptions), | ||
}; | ||
}; | ||
exports.revenue = revenue; | ||
exports.setTransport = client.setTransport.bind(client); | ||
//# sourceMappingURL=browser-client.js.map |
@@ -1,10 +0,12 @@ | ||
import { BrowserOptions, BrowserConfig as IBrowserConfig, Storage, TrackingOptions, TransportType, UserSession } from '@amplitude/analytics-types'; | ||
import { Event, BrowserOptions, BrowserConfig as IBrowserConfig, Storage, TrackingOptions, TransportType, UserSession } from '@amplitude/analytics-types'; | ||
import { Config } from '@amplitude/analytics-core'; | ||
import { FetchTransport } from './transports/fetch'; | ||
import { MemoryStorage } from './storage/memory'; | ||
import { XHRTransport } from './transports/xhr'; | ||
import { SendBeaconTransport } from './transports/send-beacon'; | ||
export declare const defaultConfig: { | ||
export declare const getDefaultConfig: () => { | ||
cookieExpiration: number; | ||
cookieSameSite: string; | ||
cookieSecure: boolean; | ||
cookieStorage: MemoryStorage<UserSession>; | ||
disableCookies: boolean; | ||
@@ -17,2 +19,3 @@ domain: string; | ||
sessionTimeout: number; | ||
storageProvider: MemoryStorage<Event[]>; | ||
trackingOptions: { | ||
@@ -42,6 +45,6 @@ city: boolean; | ||
domain: string; | ||
includeUtm: boolean; | ||
includeReferrer: boolean; | ||
includeGclid: boolean; | ||
includeFbclid: boolean; | ||
includeReferrer: boolean; | ||
includeUtm: boolean; | ||
sessionTimeout: number; | ||
@@ -51,3 +54,3 @@ trackingOptions: TrackingOptions; | ||
} | ||
export declare const createConfig: (apiKey: string, userId?: string | undefined, overrides?: BrowserOptions | undefined) => IBrowserConfig; | ||
export declare const useBrowserConfig: (apiKey: string, userId?: string | undefined, options?: BrowserOptions | undefined) => IBrowserConfig; | ||
export declare const createCookieStorage: (overrides?: BrowserOptions | undefined, baseConfig?: { | ||
@@ -57,2 +60,3 @@ cookieExpiration: number; | ||
cookieSecure: boolean; | ||
cookieStorage: MemoryStorage<UserSession>; | ||
disableCookies: boolean; | ||
@@ -65,2 +69,3 @@ domain: string; | ||
sessionTimeout: number; | ||
storageProvider: MemoryStorage<Event[]>; | ||
trackingOptions: { | ||
@@ -83,7 +88,6 @@ city: boolean; | ||
}) => Storage<UserSession>; | ||
export declare const createEventsStorage: (overrides?: BrowserOptions | undefined) => Storage<import("@amplitude/analytics-types").Event[]>; | ||
export declare const createEventsStorage: (overrides?: BrowserOptions | undefined) => Storage<Event[]>; | ||
export declare const createDeviceId: (idFromCookies?: string | undefined, idFromOptions?: string | undefined, idFromQueryParams?: string | undefined) => string; | ||
export declare const createSessionId: (idFromCookies: number | undefined, idFromOptions: number | undefined, lastEventTime: number | undefined, sessionTimeout: number) => number; | ||
export declare const createTransport: (transport?: TransportType | undefined) => FetchTransport | XHRTransport | SendBeaconTransport; | ||
export declare const getConfig: () => BrowserConfig; | ||
//# sourceMappingURL=config.d.ts.map |
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getConfig = exports.createTransport = exports.createSessionId = exports.createDeviceId = exports.createEventsStorage = exports.createCookieStorage = exports.createConfig = exports.BrowserConfig = exports.defaultConfig = void 0; | ||
exports.createTransport = exports.createSessionId = exports.createDeviceId = exports.createEventsStorage = exports.createCookieStorage = exports.useBrowserConfig = exports.BrowserConfig = exports.getDefaultConfig = void 0; | ||
var tslib_1 = require("tslib"); | ||
@@ -15,6 +15,7 @@ var analytics_types_1 = require("@amplitude/analytics-types"); | ||
var send_beacon_1 = require("./transports/send-beacon"); | ||
exports.defaultConfig = { | ||
var getDefaultConfig = function () { return ({ | ||
cookieExpiration: 365, | ||
cookieSameSite: 'Lax', | ||
cookieSecure: false, | ||
cookieStorage: new memory_1.MemoryStorage(), | ||
disableCookies: false, | ||
@@ -27,2 +28,3 @@ domain: '', | ||
sessionTimeout: 30 * 60 * 1000, | ||
storageProvider: new memory_1.MemoryStorage(), | ||
trackingOptions: { | ||
@@ -44,29 +46,23 @@ city: true, | ||
transportProvider: new fetch_1.FetchTransport(), | ||
}; | ||
}); }; | ||
exports.getDefaultConfig = getDefaultConfig; | ||
var BrowserConfig = /** @class */ (function (_super) { | ||
(0, tslib_1.__extends)(BrowserConfig, _super); | ||
function BrowserConfig(apiKey, userId, options) { | ||
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l; | ||
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p; | ||
var _this = this; | ||
var cookieStorage = (0, exports.createCookieStorage)(options); | ||
var storageProvider = (0, exports.createEventsStorage)(options); | ||
var transportProvider = (_a = options === null || options === void 0 ? void 0 : options.transportProvider) !== null && _a !== void 0 ? _a : (0, exports.createTransport)(options === null || options === void 0 ? void 0 : options.transport); | ||
var sessionTimeout = (_b = options === null || options === void 0 ? void 0 : options.sessionTimeout) !== null && _b !== void 0 ? _b : exports.defaultConfig.sessionTimeout; | ||
var trackingOptions = (0, tslib_1.__assign)((0, tslib_1.__assign)({}, exports.defaultConfig.trackingOptions), options === null || options === void 0 ? void 0 : options.trackingOptions); | ||
var cookieName = (0, session_manager_1.getCookieName)(apiKey); | ||
var cookies = cookieStorage.get(cookieName); | ||
var queryParams = (0, query_params_1.getQueryParams)(); | ||
_this = _super.call(this, (0, tslib_1.__assign)((0, tslib_1.__assign)({}, options), { apiKey: apiKey, storageProvider: storageProvider, transportProvider: transportProvider, userId: userId !== null && userId !== void 0 ? userId : cookies === null || cookies === void 0 ? void 0 : cookies.userId, deviceId: (0, exports.createDeviceId)(cookies === null || cookies === void 0 ? void 0 : cookies.deviceId, options === null || options === void 0 ? void 0 : options.deviceId, queryParams.deviceId), sessionId: (0, exports.createSessionId)(cookies === null || cookies === void 0 ? void 0 : cookies.sessionId, options === null || options === void 0 ? void 0 : options.sessionId, cookies === null || cookies === void 0 ? void 0 : cookies.lastEventTime, sessionTimeout), optOut: Boolean(cookies === null || cookies === void 0 ? void 0 : cookies.optOut) })) || this; | ||
_this.cookieExpiration = (_c = options === null || options === void 0 ? void 0 : options.cookieExpiration) !== null && _c !== void 0 ? _c : exports.defaultConfig.cookieExpiration; | ||
_this.cookieSameSite = (_d = options === null || options === void 0 ? void 0 : options.cookieSameSite) !== null && _d !== void 0 ? _d : exports.defaultConfig.cookieSameSite; | ||
_this.cookieSecure = (_e = options === null || options === void 0 ? void 0 : options.cookieSecure) !== null && _e !== void 0 ? _e : exports.defaultConfig.cookieSecure; | ||
_this.cookieStorage = cookieStorage; | ||
_this.disableCookies = (_f = options === null || options === void 0 ? void 0 : options.disableCookies) !== null && _f !== void 0 ? _f : exports.defaultConfig.disableCookies; | ||
_this.domain = (_g = options === null || options === void 0 ? void 0 : options.domain) !== null && _g !== void 0 ? _g : exports.defaultConfig.domain; | ||
_this.includeGclid = (_h = options === null || options === void 0 ? void 0 : options.includeGclid) !== null && _h !== void 0 ? _h : exports.defaultConfig.includeGclid; | ||
_this.includeFbclid = (_j = options === null || options === void 0 ? void 0 : options.includeFbclid) !== null && _j !== void 0 ? _j : exports.defaultConfig.includeFbclid; | ||
_this.includeReferrer = (_k = options === null || options === void 0 ? void 0 : options.includeReferrer) !== null && _k !== void 0 ? _k : exports.defaultConfig.includeReferrer; | ||
_this.includeUtm = (_l = options === null || options === void 0 ? void 0 : options.includeUtm) !== null && _l !== void 0 ? _l : exports.defaultConfig.includeUtm; | ||
_this.sessionTimeout = sessionTimeout; | ||
_this.trackingOptions = trackingOptions; | ||
var defaultConfig = (0, exports.getDefaultConfig)(); | ||
_this = _super.call(this, (0, tslib_1.__assign)((0, tslib_1.__assign)({}, options), { apiKey: apiKey, userId: userId, optOut: Boolean(options === null || options === void 0 ? void 0 : options.optOut), storageProvider: (_a = options === null || options === void 0 ? void 0 : options.storageProvider) !== null && _a !== void 0 ? _a : defaultConfig.storageProvider, transportProvider: (_b = options === null || options === void 0 ? void 0 : options.transportProvider) !== null && _b !== void 0 ? _b : defaultConfig.transportProvider })) || this; | ||
_this.cookieExpiration = (_c = options === null || options === void 0 ? void 0 : options.cookieExpiration) !== null && _c !== void 0 ? _c : defaultConfig.cookieExpiration; | ||
_this.cookieSameSite = (_d = options === null || options === void 0 ? void 0 : options.cookieSameSite) !== null && _d !== void 0 ? _d : defaultConfig.cookieSameSite; | ||
_this.cookieSecure = (_e = options === null || options === void 0 ? void 0 : options.cookieSecure) !== null && _e !== void 0 ? _e : defaultConfig.cookieSecure; | ||
_this.cookieStorage = (_f = options === null || options === void 0 ? void 0 : options.cookieStorage) !== null && _f !== void 0 ? _f : defaultConfig.cookieStorage; | ||
_this.disableCookies = (_g = options === null || options === void 0 ? void 0 : options.disableCookies) !== null && _g !== void 0 ? _g : defaultConfig.disableCookies; | ||
_this.domain = (_h = options === null || options === void 0 ? void 0 : options.domain) !== null && _h !== void 0 ? _h : defaultConfig.domain; | ||
_this.includeGclid = (_j = options === null || options === void 0 ? void 0 : options.includeGclid) !== null && _j !== void 0 ? _j : defaultConfig.includeGclid; | ||
_this.includeFbclid = (_k = options === null || options === void 0 ? void 0 : options.includeFbclid) !== null && _k !== void 0 ? _k : defaultConfig.includeFbclid; | ||
_this.includeReferrer = (_l = options === null || options === void 0 ? void 0 : options.includeReferrer) !== null && _l !== void 0 ? _l : defaultConfig.includeReferrer; | ||
_this.includeUtm = (_m = options === null || options === void 0 ? void 0 : options.includeUtm) !== null && _m !== void 0 ? _m : defaultConfig.includeUtm; | ||
_this.sessionTimeout = (_o = options === null || options === void 0 ? void 0 : options.sessionTimeout) !== null && _o !== void 0 ? _o : defaultConfig.sessionTimeout; | ||
_this.trackingOptions = (_p = options === null || options === void 0 ? void 0 : options.trackingOptions) !== null && _p !== void 0 ? _p : defaultConfig.trackingOptions; | ||
return _this; | ||
@@ -77,8 +73,15 @@ } | ||
exports.BrowserConfig = BrowserConfig; | ||
var createConfig = function (apiKey, userId, overrides) { | ||
return new BrowserConfig(apiKey, userId, overrides); | ||
var useBrowserConfig = function (apiKey, userId, options) { | ||
var _a, _b, _c; | ||
var defaultConfig = (0, exports.getDefaultConfig)(); | ||
var cookieStorage = (0, exports.createCookieStorage)(options); | ||
var cookieName = (0, session_manager_1.getCookieName)(apiKey); | ||
var cookies = cookieStorage.get(cookieName); | ||
var queryParams = (0, query_params_1.getQueryParams)(); | ||
var sessionTimeout = (_a = options === null || options === void 0 ? void 0 : options.sessionTimeout) !== null && _a !== void 0 ? _a : defaultConfig.sessionTimeout; | ||
return new BrowserConfig(apiKey, userId !== null && userId !== void 0 ? userId : cookies === null || cookies === void 0 ? void 0 : cookies.userId, (0, tslib_1.__assign)((0, tslib_1.__assign)({}, options), { cookieStorage: cookieStorage, sessionTimeout: sessionTimeout, deviceId: (0, exports.createDeviceId)(cookies === null || cookies === void 0 ? void 0 : cookies.deviceId, options === null || options === void 0 ? void 0 : options.deviceId, queryParams.deviceId), optOut: (_b = options === null || options === void 0 ? void 0 : options.optOut) !== null && _b !== void 0 ? _b : Boolean(cookies === null || cookies === void 0 ? void 0 : cookies.optOut), sessionId: (0, exports.createSessionId)(cookies === null || cookies === void 0 ? void 0 : cookies.sessionId, options === null || options === void 0 ? void 0 : options.sessionId, cookies === null || cookies === void 0 ? void 0 : cookies.lastEventTime, sessionTimeout), storageProvider: (0, exports.createEventsStorage)(options), trackingOptions: (0, tslib_1.__assign)((0, tslib_1.__assign)({}, defaultConfig.trackingOptions), options === null || options === void 0 ? void 0 : options.trackingOptions), transportProvider: (_c = options === null || options === void 0 ? void 0 : options.transportProvider) !== null && _c !== void 0 ? _c : (0, exports.createTransport)(options === null || options === void 0 ? void 0 : options.transport) })); | ||
}; | ||
exports.createConfig = createConfig; | ||
exports.useBrowserConfig = useBrowserConfig; | ||
var createCookieStorage = function (overrides, baseConfig) { | ||
if (baseConfig === void 0) { baseConfig = exports.defaultConfig; } | ||
if (baseConfig === void 0) { baseConfig = (0, exports.getDefaultConfig)(); } | ||
var options = (0, tslib_1.__assign)((0, tslib_1.__assign)({}, baseConfig), overrides); | ||
@@ -135,9 +138,5 @@ var cookieStorage = overrides === null || overrides === void 0 ? void 0 : overrides.cookieStorage; | ||
} | ||
return exports.defaultConfig.transportProvider; | ||
return (0, exports.getDefaultConfig)().transportProvider; | ||
}; | ||
exports.createTransport = createTransport; | ||
var getConfig = function () { | ||
return (0, analytics_core_1.getConfig)(); | ||
}; | ||
exports.getConfig = getConfig; | ||
//# sourceMappingURL=config.js.map |
@@ -38,3 +38,3 @@ Object.defineProperty(exports, "__esModule", { value: true }); | ||
(0, session_manager_1.checkSessionExpiry)(_this.config); | ||
(0, session_manager_1.updateLastEventTime)(_this.config, time); | ||
(0, session_manager_1.updateCookies)(_this.config, time); | ||
var contextEvent = (0, tslib_1.__assign)((0, tslib_1.__assign)((0, tslib_1.__assign)((0, tslib_1.__assign)((0, tslib_1.__assign)((0, tslib_1.__assign)((0, tslib_1.__assign)((0, tslib_1.__assign)((0, tslib_1.__assign)((0, tslib_1.__assign)((0, tslib_1.__assign)({ user_id: _this.config.userId, device_id: _this.config.deviceId, session_id: _this.config.sessionId, time: time }, (_this.config.appVersion && { app_version: _this.config.appVersion })), (_this.config.trackingOptions.platform && { platform: BROWSER_PLATFORM })), (_this.config.trackingOptions.osName && { os_name: osName })), (_this.config.trackingOptions.osVersion && { os_version: osVersion })), (_this.config.trackingOptions.deviceManufacturer && { device_manufacturer: deviceVendor })), (_this.config.trackingOptions.deviceModel && { device_model: deviceModel })), (_this.config.trackingOptions.language && { language: (0, language_1.getLanguage)() })), (_this.config.trackingOptions.ipAddress && { ip: IP_ADDRESS })), { insert_id: (0, uuid_1.UUID)(), partner_id: _this.config.partnerId }), context), { event_id: _this.eventId++, library: _this.library }); | ||
@@ -41,0 +41,0 @@ return resolve(contextEvent); |
import { BrowserConfig } from '@amplitude/analytics-types'; | ||
export declare const updateCookies: (config: BrowserConfig) => void; | ||
export declare const updateLastEventTime: (config: BrowserConfig, lastEventTime: number) => void; | ||
export declare const updateCookies: (config: BrowserConfig, lastEventTime?: number | undefined) => void; | ||
export declare const checkSessionExpiry: (config: BrowserConfig) => void; | ||
export declare const getCookieName: (apiKey: string) => string; | ||
export declare const getCookieName: (apiKey: string, limit?: number) => string; | ||
export declare const getOldCookieName: (apiKey: string) => string; | ||
//# sourceMappingURL=session-manager.d.ts.map |
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getCookieName = exports.checkSessionExpiry = exports.updateLastEventTime = exports.updateCookies = void 0; | ||
exports.getOldCookieName = exports.getCookieName = exports.checkSessionExpiry = exports.updateCookies = void 0; | ||
var analytics_core_1 = require("@amplitude/analytics-core"); | ||
var updateCookies = function (config) { | ||
var updateCookies = function (config, lastEventTime) { | ||
var _a; | ||
@@ -11,3 +11,3 @@ var cookieName = (0, exports.getCookieName)(config.apiKey); | ||
sessionId: config.sessionId, | ||
lastEventTime: (_a = config.cookieStorage.get(cookieName)) === null || _a === void 0 ? void 0 : _a.lastEventTime, | ||
lastEventTime: lastEventTime !== null && lastEventTime !== void 0 ? lastEventTime : (_a = config.cookieStorage.get(cookieName)) === null || _a === void 0 ? void 0 : _a.lastEventTime, | ||
optOut: Boolean(config.optOut), | ||
@@ -17,13 +17,2 @@ }); | ||
exports.updateCookies = updateCookies; | ||
var updateLastEventTime = function (config, lastEventTime) { | ||
var cookieName = (0, exports.getCookieName)(config.apiKey); | ||
config.cookieStorage.set(cookieName, { | ||
userId: config.userId, | ||
deviceId: config.deviceId, | ||
sessionId: config.sessionId, | ||
lastEventTime: lastEventTime, | ||
optOut: Boolean(config.optOut), | ||
}); | ||
}; | ||
exports.updateLastEventTime = updateLastEventTime; | ||
var checkSessionExpiry = function (config) { | ||
@@ -40,6 +29,11 @@ var _a; | ||
exports.checkSessionExpiry = checkSessionExpiry; | ||
var getCookieName = function (apiKey) { | ||
return "".concat(analytics_core_1.AMPLITUDE_PREFIX, "_").concat(apiKey.substring(0, 10)); | ||
var getCookieName = function (apiKey, limit) { | ||
if (limit === void 0) { limit = 10; } | ||
return "".concat(analytics_core_1.AMPLITUDE_PREFIX, "_").concat(apiKey.substring(0, limit)); | ||
}; | ||
exports.getCookieName = getCookieName; | ||
var getOldCookieName = function (apiKey) { | ||
return "".concat(analytics_core_1.AMPLITUDE_PREFIX.toLowerCase(), "_").concat(apiKey.substring(0, 6)); | ||
}; | ||
exports.getOldCookieName = getOldCookieName; | ||
//# sourceMappingURL=session-manager.js.map |
@@ -7,4 +7,4 @@ import { Storage, CookieStorageOptions } from '@amplitude/analytics-types'; | ||
get(key: string): T | undefined; | ||
findByKey(key: string): string | undefined; | ||
set(key: string, value: T | null, options?: CookieStorageOptions): void; | ||
getRaw(key: string): string | undefined; | ||
set(key: string, value: T | null): void; | ||
remove(key: string): void; | ||
@@ -11,0 +11,0 @@ reset(): void; |
@@ -30,6 +30,9 @@ Object.defineProperty(exports, "__esModule", { value: true }); | ||
CookieStorage.prototype.get = function (key) { | ||
var value = this.getRaw(key); | ||
if (!value) { | ||
return undefined; | ||
} | ||
try { | ||
var value = this.findByKey(key); | ||
// eslint-disable-next-line @typescript-eslint/no-unsafe-return | ||
return value ? JSON.parse(value) : undefined; | ||
return JSON.parse(value); | ||
} | ||
@@ -41,3 +44,3 @@ catch (_a) { | ||
}; | ||
CookieStorage.prototype.findByKey = function (key) { | ||
CookieStorage.prototype.getRaw = function (key) { | ||
var cookie = window.document.cookie.split('; '); | ||
@@ -50,5 +53,7 @@ var match = cookie.find(function (c) { return c.indexOf(key + '=') === 0; }); | ||
}; | ||
CookieStorage.prototype.set = function (key, value, options) { | ||
CookieStorage.prototype.set = function (key, value) { | ||
var _a; | ||
try { | ||
var expires = value !== null ? options === null || options === void 0 ? void 0 : options.expirationDays : -1; | ||
var expirationDays = (_a = this.options.expirationDays) !== null && _a !== void 0 ? _a : 0; | ||
var expires = value !== null ? expirationDays : -1; | ||
var expireDate = undefined; | ||
@@ -65,14 +70,14 @@ if (expires) { | ||
str += '; path=/'; | ||
if (options === null || options === void 0 ? void 0 : options.domain) { | ||
str += "; domain=".concat(options.domain); | ||
if (this.options.domain) { | ||
str += "; domain=".concat(this.options.domain); | ||
} | ||
if (options === null || options === void 0 ? void 0 : options.secure) { | ||
if (this.options.secure) { | ||
str += '; Secure'; | ||
} | ||
if (options === null || options === void 0 ? void 0 : options.sameSite) { | ||
str += "; SameSite=".concat(options.sameSite); | ||
if (this.options.sameSite) { | ||
str += "; SameSite=".concat(this.options.sameSite); | ||
} | ||
window.document.cookie = str; | ||
} | ||
catch (_a) { | ||
catch (_b) { | ||
// | ||
@@ -79,0 +84,0 @@ } |
@@ -5,2 +5,3 @@ import { Storage } from '@amplitude/analytics-types'; | ||
get(key: string): T | undefined; | ||
getRaw(key: string): string | undefined; | ||
set(key: string, value: T): void; | ||
@@ -7,0 +8,0 @@ remove(key: string): void; |
@@ -29,3 +29,3 @@ Object.defineProperty(exports, "__esModule", { value: true }); | ||
try { | ||
var value = window.localStorage.getItem(key); | ||
var value = this.getRaw(key); | ||
if (!value) { | ||
@@ -42,2 +42,5 @@ return undefined; | ||
}; | ||
LocalStorage.prototype.getRaw = function (key) { | ||
return window.localStorage.getItem(key) || undefined; | ||
}; | ||
LocalStorage.prototype.set = function (key, value) { | ||
@@ -44,0 +47,0 @@ try { |
@@ -6,2 +6,3 @@ import { Storage } from '@amplitude/analytics-types'; | ||
get(key: string): T | undefined; | ||
getRaw(key: string): string | undefined; | ||
set(key: string, value: T): void; | ||
@@ -8,0 +9,0 @@ remove(key: string): void; |
@@ -13,2 +13,6 @@ Object.defineProperty(exports, "__esModule", { value: true }); | ||
}; | ||
MemoryStorage.prototype.getRaw = function (key) { | ||
var value = this.get(key); | ||
return value ? JSON.stringify(value) : undefined; | ||
}; | ||
MemoryStorage.prototype.set = function (key, value) { | ||
@@ -15,0 +19,0 @@ this.memoryStorage.set(key, value); |
@@ -12,3 +12,3 @@ Object.defineProperty(exports, "__esModule", { value: true }); | ||
try { | ||
var value = this.findByKey(key); | ||
var value = this.getRaw(key); | ||
if (!value) { | ||
@@ -15,0 +15,0 @@ return undefined; |
import { InstanceProxy, QueueProxy } from '@amplitude/analytics-types'; | ||
/** | ||
* Applies the proxied functions on the proxied amplitude snippet to an instance of the real object. | ||
* @ignore | ||
*/ | ||
@@ -5,0 +6,0 @@ export declare const runQueuedFunctions: (instance: object, queue: QueueProxy) => void; |
@@ -5,2 +5,3 @@ Object.defineProperty(exports, "__esModule", { value: true }); | ||
* Applies the proxied functions on the proxied amplitude snippet to an instance of the real object. | ||
* @ignore | ||
*/ | ||
@@ -7,0 +8,0 @@ var runQueuedFunctions = function (instance, queue) { |
@@ -1,2 +0,2 @@ | ||
export declare const VERSION = "0.3.1"; | ||
export declare const VERSION = "0.4.0"; | ||
//# sourceMappingURL=version.d.ts.map |
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.VERSION = void 0; | ||
exports.VERSION = '0.3.1'; | ||
exports.VERSION = '0.4.0'; | ||
//# sourceMappingURL=version.js.map |
import { BrowserConfig, UTMData } from '@amplitude/analytics-types'; | ||
export declare const trackAttributions: (config: BrowserConfig) => void; | ||
export declare const getAttributions: (config: BrowserConfig) => Record<string, string>; | ||
export declare const getUtmParam: () => UTMData; | ||
@@ -4,0 +4,0 @@ export declare const getReferrer: () => Record<string, string | undefined>; |
@@ -1,20 +0,8 @@ | ||
import { __assign, __read } from "tslib"; | ||
import { Identify, identify } from '@amplitude/analytics-core'; | ||
import { __assign } from "tslib"; | ||
import { UTM_CAMPAIGN, UTM_CONTENT, UTM_MEDIUM, UTM_SOURCE, UTM_TERM, UTMZ_SOURCE, UTMZ_MEDIUM, UTMZ_CAMPAIGN, UTMZ_TERM, UTMZ_CONTENT, GCLID, FBCLID, } from './constants'; | ||
import { UTMCookie } from './storage/utm-cookie'; | ||
import { getQueryParams } from './utils/query-params'; | ||
export var trackAttributions = function (config) { | ||
var attribution = __assign(__assign(__assign(__assign({}, (config.includeUtm && getUtmParam())), (config.includeReferrer && getReferrer())), (config.includeGclid && getGclid())), (config.includeFbclid && getFbclid())); | ||
if (Object.keys(attribution).length === 0) { | ||
return; | ||
} | ||
var id = new Identify(); | ||
Object.entries(attribution).forEach(function (_a) { | ||
var _b = __read(_a, 2), key = _b[0], value = _b[1]; | ||
if (value) { | ||
id.setOnce("initial_".concat(key), value); | ||
id.set(key, value); | ||
} | ||
}); | ||
void identify(undefined, undefined, id); | ||
export var getAttributions = function (config) { | ||
var attributions = __assign(__assign(__assign(__assign({}, (config.includeUtm && getUtmParam())), (config.includeReferrer && getReferrer())), (config.includeGclid && getGclid())), (config.includeFbclid && getFbclid())); | ||
return attributions; | ||
}; | ||
@@ -21,0 +9,0 @@ export var getUtmParam = function () { |
@@ -1,3 +0,18 @@ | ||
import { Identify, Revenue } from '@amplitude/analytics-core'; | ||
import { AmplitudeReturn, BrowserOptions, EventOptions, Plugin, Result, TransportType } from '@amplitude/analytics-types'; | ||
import { AmplitudeCore } from '@amplitude/analytics-core'; | ||
import { BrowserConfig, BrowserOptions, EventOptions, Identify as IIdentify, Result, Revenue as IRevenue, TransportType } from '@amplitude/analytics-types'; | ||
export declare class AmplitudeBrowser extends AmplitudeCore<BrowserConfig> { | ||
init(apiKey: string, userId?: string, options?: BrowserOptions): Promise<void>; | ||
getUserId(): string | undefined; | ||
setUserId(userId: string): void; | ||
getDeviceId(): string | undefined; | ||
setDeviceId(deviceId: string): void; | ||
getSessionId(): number | undefined; | ||
setSessionId(sessionId: number): void; | ||
setOptOut(optOut: boolean): void; | ||
setTransport(transport: TransportType): void; | ||
identify(identify: IIdentify, eventOptions?: EventOptions): Promise<Result>; | ||
groupIdentify(groupType: string, groupName: string | string[], identify: IIdentify, eventOptions?: EventOptions): Promise<Result>; | ||
revenue(revenue: IRevenue, eventOptions?: EventOptions): Promise<Result>; | ||
trackAttributions(): Promise<Result> | undefined; | ||
} | ||
/** | ||
@@ -11,3 +26,3 @@ * Initializes the Amplitude SDK with your apiKey, userId and optional configurations. | ||
*/ | ||
export declare const init: (apiKey: string, userId?: string | undefined, options?: BrowserOptions | undefined) => AmplitudeReturn<void>; | ||
export declare const init: (apiKey: string, userId?: string | undefined, options?: BrowserOptions | undefined) => import("@amplitude/analytics-types").AmplitudeReturn<void>; | ||
/** | ||
@@ -21,3 +36,3 @@ * Adds a new plugin. | ||
*/ | ||
export declare const add: (plugin: Plugin) => AmplitudeReturn<void>; | ||
export declare const add: (plugin: import("@amplitude/analytics-types").Plugin) => import("@amplitude/analytics-types").AmplitudeReturn<void>; | ||
/** | ||
@@ -30,4 +45,80 @@ * Removes a plugin. | ||
*/ | ||
export declare const remove: (pluginName: string) => AmplitudeReturn<void>; | ||
export declare const remove: (pluginName: string) => import("@amplitude/analytics-types").AmplitudeReturn<void>; | ||
/** | ||
* Tracks user-defined event, with specified type, optional event properties and optional overwrites. | ||
* | ||
* ```typescript | ||
* // event tracking with event type only | ||
* track('Page Load'); | ||
* | ||
* // event tracking with event type and additional event properties | ||
* track('Page Load', { loadTime: 1000 }); | ||
* | ||
* // event tracking with event type, additional event properties, and overwritten event options | ||
* track('Page Load', { loadTime: 1000 }, { sessionId: -1 }); | ||
* | ||
* // alternatively, this tracking method is awaitable | ||
* const result = await track('Page Load').promise; | ||
* console.log(result.event); // {...} | ||
* console.log(result.code); // 200 | ||
* console.log(result.message); // "Event tracked successfully" | ||
* ``` | ||
*/ | ||
export declare const track: (eventInput: string | import("@amplitude/analytics-types").BaseEvent, eventProperties?: Record<string, any> | undefined, eventOptions?: EventOptions | undefined) => import("@amplitude/analytics-types").AmplitudeReturn<Result>; | ||
/** | ||
* Alias for track() | ||
*/ | ||
export declare const logEvent: (eventInput: string | import("@amplitude/analytics-types").BaseEvent, eventProperties?: Record<string, any> | undefined, eventOptions?: EventOptions | undefined) => import("@amplitude/analytics-types").AmplitudeReturn<Result>; | ||
/** | ||
* Sends an identify event containing user property operations | ||
* | ||
* ```typescript | ||
* const id = new Identify(); | ||
* id.set('colors', ['rose', 'gold']); | ||
* identify(id); | ||
* | ||
* // alternatively, this tracking method is awaitable | ||
* const result = await identify(id).promise; | ||
* console.log(result.event); // {...} | ||
* console.log(result.code); // 200 | ||
* console.log(result.message); // "Event tracked successfully" | ||
* ``` | ||
*/ | ||
export declare const identify: (identify: IIdentify, eventOptions?: EventOptions | undefined) => import("@amplitude/analytics-types").AmplitudeReturn<Result>; | ||
/** | ||
* Sends a group identify event containing group property operations. | ||
* | ||
* ```typescript | ||
* const id = new Identify(); | ||
* id.set('skills', ['js', 'ts']); | ||
* const groupType = 'org'; | ||
* const groupName = 'engineering'; | ||
* groupIdentify(groupType, groupName, id); | ||
* | ||
* // alternatively, this tracking method is awaitable | ||
* const result = await groupIdentify(groupType, groupName, id).promise; | ||
* console.log(result.event); // {...} | ||
* console.log(result.code); // 200 | ||
* console.log(result.message); // "Event tracked successfully" | ||
* ``` | ||
*/ | ||
export declare const groupIdentify: (groupType: string, groupName: string | string[], identify: IIdentify, eventOptions?: EventOptions | undefined) => import("@amplitude/analytics-types").AmplitudeReturn<Result>; | ||
export declare const setGroup: (groupType: string, groupName: string | string[]) => import("@amplitude/analytics-types").AmplitudeReturn<Result>; | ||
/** | ||
* Sends a revenue event containing revenue property operations. | ||
* | ||
* ```typescript | ||
* const rev = new Revenue(); | ||
* rev.setRevenue(100); | ||
* revenue(rev); | ||
* | ||
* // alternatively, this tracking method is awaitable | ||
* const result = await revenue(rev).promise; | ||
* console.log(result.event); // {...} | ||
* console.log(result.code); // 200 | ||
* console.log(result.message); // "Event tracked successfully" | ||
* ``` | ||
*/ | ||
export declare const revenue: (revenue: IRevenue, eventOptions?: EventOptions | undefined) => import("@amplitude/analytics-types").AmplitudeReturn<Result>; | ||
/** | ||
* Returns current user ID. | ||
@@ -110,78 +201,2 @@ * | ||
export declare const setTransport: (transport: TransportType) => void; | ||
/** | ||
* Tracks user-defined event, with specified type, optional event properties and optional overwrites. | ||
* | ||
* ```typescript | ||
* // event tracking with event type only | ||
* track('Page Load'); | ||
* | ||
* // event tracking with event type and additional event properties | ||
* track('Page Load', { loadTime: 1000 }); | ||
* | ||
* // event tracking with event type, additional event properties, and overwritten event options | ||
* track('Page Load', { loadTime: 1000 }, { sessionId: -1 }); | ||
* | ||
* // alternatively, this tracking method is awaitable | ||
* const result = await track('Page Load').promise; | ||
* console.log(result.event); // {...} | ||
* console.log(result.code); // 200 | ||
* console.log(result.message); // "Event tracked successfully" | ||
* ``` | ||
*/ | ||
export declare const track: (eventType: string, eventProperties?: Record<string, any> | undefined, eventOptions?: EventOptions | undefined) => AmplitudeReturn<Result>; | ||
/** | ||
* Alis for track() | ||
*/ | ||
export declare const logEvent: (eventType: string, eventProperties?: Record<string, any> | undefined, eventOptions?: EventOptions | undefined) => AmplitudeReturn<Result>; | ||
/** | ||
* Sends an identify event containing user property operations | ||
* | ||
* ```typescript | ||
* const id = new Identify(); | ||
* id.set('colors', ['rose', 'gold']); | ||
* identify(id); | ||
* | ||
* // alternatively, this tracking method is awaitable | ||
* const result = await identify(id).promise; | ||
* console.log(result.event); // {...} | ||
* console.log(result.code); // 200 | ||
* console.log(result.message); // "Event tracked successfully" | ||
* ``` | ||
*/ | ||
export declare const identify: (identify: Identify, eventOptions?: EventOptions | undefined) => AmplitudeReturn<Result>; | ||
/** | ||
* Sends a group identify event containing group property operations. | ||
* | ||
* ```typescript | ||
* const id = new Identify(); | ||
* id.set('skills', ['js', 'ts']); | ||
* const groupType = 'org'; | ||
* const groupName = 'engineering'; | ||
* groupIdentify(groupType, groupName, id); | ||
* | ||
* // alternatively, this tracking method is awaitable | ||
* const result = await groupIdentify(groupType, groupName, id).promise; | ||
* console.log(result.event); // {...} | ||
* console.log(result.code); // 200 | ||
* console.log(result.message); // "Event tracked successfully" | ||
* ``` | ||
*/ | ||
export declare const groupIdentify: (groupType: string, groupName: string | string[], identify: Identify, eventOptions?: EventOptions | undefined) => AmplitudeReturn<Result>; | ||
export declare const setGroup: (groupType: string, groupName: string | string[]) => AmplitudeReturn<Result>; | ||
/** | ||
* Sends a revenue event containing revenue property operations. | ||
* | ||
* ```typescript | ||
* const rev = new Revenue(); | ||
* rev.setRevenue(100); | ||
* revenue(rev); | ||
* | ||
* // alternatively, this tracking method is awaitable | ||
* const result = await revenue(rev).promise; | ||
* console.log(result.event); // {...} | ||
* console.log(result.code); // 200 | ||
* console.log(result.message); // "Event tracked successfully" | ||
* ``` | ||
*/ | ||
export declare const revenue: (revenue: Revenue, eventOptions?: EventOptions | undefined) => AmplitudeReturn<Result>; | ||
//# sourceMappingURL=browser-client.d.ts.map |
@@ -1,8 +0,114 @@ | ||
import { __awaiter, __generator } from "tslib"; | ||
import { add as _add, groupIdentify as _groupIdentify, Destination, identify as _identify, revenue as _revenue, init as _init, setOptOut as _setOptOut, Identify, Revenue, track as _track, setGroup as _setGroup, remove as _remove, } from '@amplitude/analytics-core'; | ||
import { __assign, __awaiter, __extends, __generator, __read } from "tslib"; | ||
import { AmplitudeCore, Destination, Identify, Revenue, returnWrapper } from '@amplitude/analytics-core'; | ||
import { convertProxyObjectToRealObject, isInstanceProxy } from './utils/snippet-helper'; | ||
import { Context } from './plugins/context'; | ||
import { createConfig, createTransport, getConfig } from './config'; | ||
import { trackAttributions } from './attribution'; | ||
import { useBrowserConfig, createTransport } from './config'; | ||
import { getAttributions } from './attribution'; | ||
import { updateCookies } from './session-manager'; | ||
import { parseOldCookies } from './cookie-migration'; | ||
var AmplitudeBrowser = /** @class */ (function (_super) { | ||
__extends(AmplitudeBrowser, _super); | ||
function AmplitudeBrowser() { | ||
return _super !== null && _super.apply(this, arguments) || this; | ||
} | ||
AmplitudeBrowser.prototype.init = function (apiKey, userId, options) { | ||
var _a, _b, _c; | ||
return __awaiter(this, void 0, void 0, function () { | ||
var oldCookies, browserOptions; | ||
return __generator(this, function (_d) { | ||
switch (_d.label) { | ||
case 0: | ||
oldCookies = parseOldCookies(apiKey, options); | ||
browserOptions = useBrowserConfig(apiKey, userId || oldCookies.userId, __assign(__assign({}, options), { deviceId: (_a = oldCookies.deviceId) !== null && _a !== void 0 ? _a : options === null || options === void 0 ? void 0 : options.deviceId, sessionId: (_b = oldCookies.sessionId) !== null && _b !== void 0 ? _b : options === null || options === void 0 ? void 0 : options.sessionId, optOut: (_c = options === null || options === void 0 ? void 0 : options.optOut) !== null && _c !== void 0 ? _c : oldCookies.optOut })); | ||
return [4 /*yield*/, _super.prototype.init.call(this, undefined, undefined, browserOptions)]; | ||
case 1: | ||
_d.sent(); | ||
// Step 3: Store user session in cookie storage | ||
updateCookies(this.config, oldCookies.lastEventTime); | ||
// Step 4: Install plugins | ||
return [4 /*yield*/, this.add(new Context())]; | ||
case 2: | ||
// Step 4: Install plugins | ||
_d.sent(); | ||
return [4 /*yield*/, this.add(new Destination())]; | ||
case 3: | ||
_d.sent(); | ||
// Step 4: Track attributions | ||
void this.trackAttributions(); | ||
return [2 /*return*/]; | ||
} | ||
}); | ||
}); | ||
}; | ||
AmplitudeBrowser.prototype.getUserId = function () { | ||
return this.config.userId; | ||
}; | ||
AmplitudeBrowser.prototype.setUserId = function (userId) { | ||
this.config.userId = userId; | ||
updateCookies(this.config); | ||
}; | ||
AmplitudeBrowser.prototype.getDeviceId = function () { | ||
return this.config.deviceId; | ||
}; | ||
AmplitudeBrowser.prototype.setDeviceId = function (deviceId) { | ||
this.config.deviceId = deviceId; | ||
updateCookies(this.config); | ||
}; | ||
AmplitudeBrowser.prototype.getSessionId = function () { | ||
return this.config.sessionId; | ||
}; | ||
AmplitudeBrowser.prototype.setSessionId = function (sessionId) { | ||
this.config.sessionId = sessionId; | ||
updateCookies(this.config); | ||
}; | ||
AmplitudeBrowser.prototype.setOptOut = function (optOut) { | ||
_super.prototype.setOptOut.call(this, optOut); | ||
updateCookies(this.config); | ||
}; | ||
AmplitudeBrowser.prototype.setTransport = function (transport) { | ||
this.config.transportProvider = createTransport(transport); | ||
}; | ||
AmplitudeBrowser.prototype.identify = function (identify, eventOptions) { | ||
if (isInstanceProxy(identify)) { | ||
var queue = identify._q; | ||
identify._q = []; | ||
identify = convertProxyObjectToRealObject(new Identify(), queue); | ||
} | ||
return _super.prototype.identify.call(this, identify, eventOptions); | ||
}; | ||
AmplitudeBrowser.prototype.groupIdentify = function (groupType, groupName, identify, eventOptions) { | ||
if (isInstanceProxy(identify)) { | ||
var queue = identify._q; | ||
identify._q = []; | ||
identify = convertProxyObjectToRealObject(new Identify(), queue); | ||
} | ||
return _super.prototype.groupIdentify.call(this, groupType, groupName, identify, eventOptions); | ||
}; | ||
AmplitudeBrowser.prototype.revenue = function (revenue, eventOptions) { | ||
if (isInstanceProxy(revenue)) { | ||
var queue = revenue._q; | ||
revenue._q = []; | ||
revenue = convertProxyObjectToRealObject(new Revenue(), queue); | ||
} | ||
return _super.prototype.revenue.call(this, revenue, eventOptions); | ||
}; | ||
AmplitudeBrowser.prototype.trackAttributions = function () { | ||
var attributions = getAttributions(this.config); | ||
if (Object.keys(attributions).length === 0) { | ||
return; | ||
} | ||
var id = new Identify(); | ||
Object.entries(attributions).forEach(function (_a) { | ||
var _b = __read(_a, 2), key = _b[0], value = _b[1]; | ||
if (value) { | ||
id.setOnce("initial_".concat(key), value); | ||
id.set(key, value); | ||
} | ||
}); | ||
return this.identify(id); | ||
}; | ||
return AmplitudeBrowser; | ||
}(AmplitudeCore)); | ||
export { AmplitudeBrowser }; | ||
var client = new AmplitudeBrowser(); | ||
/** | ||
@@ -16,25 +122,3 @@ * Initializes the Amplitude SDK with your apiKey, userId and optional configurations. | ||
*/ | ||
export var init = function (apiKey, userId, options) { | ||
return { | ||
promise: (function () { return __awaiter(void 0, void 0, void 0, function () { | ||
var browserOptions, config; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: | ||
browserOptions = createConfig(apiKey, userId, options); | ||
config = _init(browserOptions); | ||
updateCookies(config); | ||
return [4 /*yield*/, _add(new Context())]; | ||
case 1: | ||
_a.sent(); | ||
return [4 /*yield*/, _add(new Destination())]; | ||
case 2: | ||
_a.sent(); | ||
trackAttributions(config); | ||
return [2 /*return*/]; | ||
} | ||
}); | ||
}); })(), | ||
}; | ||
}; | ||
export var init = returnWrapper(client.init.bind(client)); | ||
/** | ||
@@ -48,7 +132,3 @@ * Adds a new plugin. | ||
*/ | ||
export var add = function (plugin) { | ||
return { | ||
promise: _add(plugin), | ||
}; | ||
}; | ||
export var add = returnWrapper(client.add.bind(client)); | ||
/** | ||
@@ -61,8 +141,80 @@ * Removes a plugin. | ||
*/ | ||
export var remove = function (pluginName) { | ||
return { | ||
promise: _remove(pluginName), | ||
}; | ||
}; | ||
export var remove = returnWrapper(client.remove.bind(client)); | ||
/** | ||
* Tracks user-defined event, with specified type, optional event properties and optional overwrites. | ||
* | ||
* ```typescript | ||
* // event tracking with event type only | ||
* track('Page Load'); | ||
* | ||
* // event tracking with event type and additional event properties | ||
* track('Page Load', { loadTime: 1000 }); | ||
* | ||
* // event tracking with event type, additional event properties, and overwritten event options | ||
* track('Page Load', { loadTime: 1000 }, { sessionId: -1 }); | ||
* | ||
* // alternatively, this tracking method is awaitable | ||
* const result = await track('Page Load').promise; | ||
* console.log(result.event); // {...} | ||
* console.log(result.code); // 200 | ||
* console.log(result.message); // "Event tracked successfully" | ||
* ``` | ||
*/ | ||
export var track = returnWrapper(client.track.bind(client)); | ||
/** | ||
* Alias for track() | ||
*/ | ||
export var logEvent = returnWrapper(client.logEvent.bind(client)); | ||
/** | ||
* Sends an identify event containing user property operations | ||
* | ||
* ```typescript | ||
* const id = new Identify(); | ||
* id.set('colors', ['rose', 'gold']); | ||
* identify(id); | ||
* | ||
* // alternatively, this tracking method is awaitable | ||
* const result = await identify(id).promise; | ||
* console.log(result.event); // {...} | ||
* console.log(result.code); // 200 | ||
* console.log(result.message); // "Event tracked successfully" | ||
* ``` | ||
*/ | ||
export var identify = returnWrapper(client.identify.bind(client)); | ||
/** | ||
* Sends a group identify event containing group property operations. | ||
* | ||
* ```typescript | ||
* const id = new Identify(); | ||
* id.set('skills', ['js', 'ts']); | ||
* const groupType = 'org'; | ||
* const groupName = 'engineering'; | ||
* groupIdentify(groupType, groupName, id); | ||
* | ||
* // alternatively, this tracking method is awaitable | ||
* const result = await groupIdentify(groupType, groupName, id).promise; | ||
* console.log(result.event); // {...} | ||
* console.log(result.code); // 200 | ||
* console.log(result.message); // "Event tracked successfully" | ||
* ``` | ||
*/ | ||
export var groupIdentify = returnWrapper(client.groupIdentify.bind(client)); | ||
export var setGroup = returnWrapper(client.setGroup.bind(client)); | ||
/** | ||
* Sends a revenue event containing revenue property operations. | ||
* | ||
* ```typescript | ||
* const rev = new Revenue(); | ||
* rev.setRevenue(100); | ||
* revenue(rev); | ||
* | ||
* // alternatively, this tracking method is awaitable | ||
* const result = await revenue(rev).promise; | ||
* console.log(result.event); // {...} | ||
* console.log(result.code); // 200 | ||
* console.log(result.message); // "Event tracked successfully" | ||
* ``` | ||
*/ | ||
export var revenue = returnWrapper(client.revenue.bind(client)); | ||
/** | ||
* Returns current user ID. | ||
@@ -74,5 +226,3 @@ * | ||
*/ | ||
export var getUserId = function () { | ||
return getConfig().userId; | ||
}; | ||
export var getUserId = client.getUserId.bind(client); | ||
/** | ||
@@ -85,7 +235,3 @@ * Sets a new user ID. | ||
*/ | ||
export var setUserId = function (userId) { | ||
var config = getConfig(); | ||
config.userId = userId; | ||
updateCookies(config); | ||
}; | ||
export var setUserId = client.setUserId.bind(client); | ||
/** | ||
@@ -98,5 +244,3 @@ * Returns current device ID. | ||
*/ | ||
export var getDeviceId = function () { | ||
return getConfig().deviceId; | ||
}; | ||
export var getDeviceId = client.getDeviceId.bind(client); | ||
/** | ||
@@ -111,7 +255,3 @@ * Sets a new device ID. | ||
*/ | ||
export var setDeviceId = function (deviceId) { | ||
var config = getConfig(); | ||
config.deviceId = deviceId; | ||
updateCookies(config); | ||
}; | ||
export var setDeviceId = client.setDeviceId.bind(client); | ||
/** | ||
@@ -124,5 +264,3 @@ * Returns current session ID. | ||
*/ | ||
export var getSessionId = function () { | ||
return getConfig().sessionId; | ||
}; | ||
export var getSessionId = client.getSessionId.bind(client); | ||
/** | ||
@@ -136,7 +274,3 @@ * Sets a new session ID. | ||
*/ | ||
export var setSessionId = function (sessionId) { | ||
var config = getConfig(); | ||
config.sessionId = sessionId; | ||
updateCookies(config); | ||
}; | ||
export var setSessionId = client.setSessionId.bind(client); | ||
/** | ||
@@ -153,7 +287,3 @@ * Sets a new optOut config value. This toggles event tracking on/off. | ||
*/ | ||
export var setOptOut = function (optOut) { | ||
_setOptOut(optOut); | ||
var config = getConfig(); | ||
updateCookies(config); | ||
}; | ||
export var setOptOut = client.setOptOut.bind(client); | ||
/** | ||
@@ -173,118 +303,3 @@ * Sets the network transport type for events. | ||
*/ | ||
export var setTransport = function (transport) { | ||
var config = getConfig(); | ||
var transportProvider = createTransport(transport); | ||
config.transportProvider = transportProvider; | ||
}; | ||
/** | ||
* Tracks user-defined event, with specified type, optional event properties and optional overwrites. | ||
* | ||
* ```typescript | ||
* // event tracking with event type only | ||
* track('Page Load'); | ||
* | ||
* // event tracking with event type and additional event properties | ||
* track('Page Load', { loadTime: 1000 }); | ||
* | ||
* // event tracking with event type, additional event properties, and overwritten event options | ||
* track('Page Load', { loadTime: 1000 }, { sessionId: -1 }); | ||
* | ||
* // alternatively, this tracking method is awaitable | ||
* const result = await track('Page Load').promise; | ||
* console.log(result.event); // {...} | ||
* console.log(result.code); // 200 | ||
* console.log(result.message); // "Event tracked successfully" | ||
* ``` | ||
*/ | ||
export var track = function (eventType, eventProperties, eventOptions) { | ||
return { | ||
promise: _track(eventType, eventProperties, eventOptions), | ||
}; | ||
}; | ||
/** | ||
* Alis for track() | ||
*/ | ||
export var logEvent = track; | ||
/** | ||
* Sends an identify event containing user property operations | ||
* | ||
* ```typescript | ||
* const id = new Identify(); | ||
* id.set('colors', ['rose', 'gold']); | ||
* identify(id); | ||
* | ||
* // alternatively, this tracking method is awaitable | ||
* const result = await identify(id).promise; | ||
* console.log(result.event); // {...} | ||
* console.log(result.code); // 200 | ||
* console.log(result.message); // "Event tracked successfully" | ||
* ``` | ||
*/ | ||
export var identify = function (identify, eventOptions) { | ||
if (isInstanceProxy(identify)) { | ||
var queue = identify._q; | ||
identify._q = []; | ||
identify = convertProxyObjectToRealObject(new Identify(), queue); | ||
} | ||
return { | ||
promise: _identify(undefined, undefined, identify, eventOptions), | ||
}; | ||
}; | ||
/** | ||
* Sends a group identify event containing group property operations. | ||
* | ||
* ```typescript | ||
* const id = new Identify(); | ||
* id.set('skills', ['js', 'ts']); | ||
* const groupType = 'org'; | ||
* const groupName = 'engineering'; | ||
* groupIdentify(groupType, groupName, id); | ||
* | ||
* // alternatively, this tracking method is awaitable | ||
* const result = await groupIdentify(groupType, groupName, id).promise; | ||
* console.log(result.event); // {...} | ||
* console.log(result.code); // 200 | ||
* console.log(result.message); // "Event tracked successfully" | ||
* ``` | ||
*/ | ||
export var groupIdentify = function (groupType, groupName, identify, eventOptions) { | ||
if (isInstanceProxy(identify)) { | ||
var queue = identify._q; | ||
identify._q = []; | ||
identify = convertProxyObjectToRealObject(new Identify(), queue); | ||
} | ||
return { | ||
promise: _groupIdentify(undefined, undefined, groupType, groupName, identify, eventOptions), | ||
}; | ||
}; | ||
export var setGroup = function (groupType, groupName) { | ||
return { | ||
promise: _setGroup(groupType, groupName), | ||
}; | ||
}; | ||
/** | ||
* Sends a revenue event containing revenue property operations. | ||
* | ||
* ```typescript | ||
* const rev = new Revenue(); | ||
* rev.setRevenue(100); | ||
* revenue(rev); | ||
* | ||
* // alternatively, this tracking method is awaitable | ||
* const result = await revenue(rev).promise; | ||
* console.log(result.event); // {...} | ||
* console.log(result.code); // 200 | ||
* console.log(result.message); // "Event tracked successfully" | ||
* ``` | ||
*/ | ||
export var revenue = function (revenue, eventOptions) { | ||
if (isInstanceProxy(revenue)) { | ||
var queue = revenue._q; | ||
revenue._q = []; | ||
revenue = convertProxyObjectToRealObject(new Revenue(), queue); | ||
} | ||
return { | ||
promise: _revenue(revenue, eventOptions), | ||
}; | ||
}; | ||
export var setTransport = client.setTransport.bind(client); | ||
//# sourceMappingURL=browser-client.js.map |
@@ -1,10 +0,12 @@ | ||
import { BrowserOptions, BrowserConfig as IBrowserConfig, Storage, TrackingOptions, TransportType, UserSession } from '@amplitude/analytics-types'; | ||
import { Event, BrowserOptions, BrowserConfig as IBrowserConfig, Storage, TrackingOptions, TransportType, UserSession } from '@amplitude/analytics-types'; | ||
import { Config } from '@amplitude/analytics-core'; | ||
import { FetchTransport } from './transports/fetch'; | ||
import { MemoryStorage } from './storage/memory'; | ||
import { XHRTransport } from './transports/xhr'; | ||
import { SendBeaconTransport } from './transports/send-beacon'; | ||
export declare const defaultConfig: { | ||
export declare const getDefaultConfig: () => { | ||
cookieExpiration: number; | ||
cookieSameSite: string; | ||
cookieSecure: boolean; | ||
cookieStorage: MemoryStorage<UserSession>; | ||
disableCookies: boolean; | ||
@@ -17,2 +19,3 @@ domain: string; | ||
sessionTimeout: number; | ||
storageProvider: MemoryStorage<Event[]>; | ||
trackingOptions: { | ||
@@ -42,6 +45,6 @@ city: boolean; | ||
domain: string; | ||
includeUtm: boolean; | ||
includeReferrer: boolean; | ||
includeGclid: boolean; | ||
includeFbclid: boolean; | ||
includeReferrer: boolean; | ||
includeUtm: boolean; | ||
sessionTimeout: number; | ||
@@ -51,3 +54,3 @@ trackingOptions: TrackingOptions; | ||
} | ||
export declare const createConfig: (apiKey: string, userId?: string | undefined, overrides?: BrowserOptions | undefined) => IBrowserConfig; | ||
export declare const useBrowserConfig: (apiKey: string, userId?: string | undefined, options?: BrowserOptions | undefined) => IBrowserConfig; | ||
export declare const createCookieStorage: (overrides?: BrowserOptions | undefined, baseConfig?: { | ||
@@ -57,2 +60,3 @@ cookieExpiration: number; | ||
cookieSecure: boolean; | ||
cookieStorage: MemoryStorage<UserSession>; | ||
disableCookies: boolean; | ||
@@ -65,2 +69,3 @@ domain: string; | ||
sessionTimeout: number; | ||
storageProvider: MemoryStorage<Event[]>; | ||
trackingOptions: { | ||
@@ -83,7 +88,6 @@ city: boolean; | ||
}) => Storage<UserSession>; | ||
export declare const createEventsStorage: (overrides?: BrowserOptions | undefined) => Storage<import("@amplitude/analytics-types").Event[]>; | ||
export declare const createEventsStorage: (overrides?: BrowserOptions | undefined) => Storage<Event[]>; | ||
export declare const createDeviceId: (idFromCookies?: string | undefined, idFromOptions?: string | undefined, idFromQueryParams?: string | undefined) => string; | ||
export declare const createSessionId: (idFromCookies: number | undefined, idFromOptions: number | undefined, lastEventTime: number | undefined, sessionTimeout: number) => number; | ||
export declare const createTransport: (transport?: TransportType | undefined) => FetchTransport | XHRTransport | SendBeaconTransport; | ||
export declare const getConfig: () => BrowserConfig; | ||
//# sourceMappingURL=config.d.ts.map |
import { __assign, __extends } from "tslib"; | ||
import { TransportType, } from '@amplitude/analytics-types'; | ||
import { Config, getConfig as _getConfig } from '@amplitude/analytics-core'; | ||
import { Config } from '@amplitude/analytics-core'; | ||
import { CookieStorage } from './storage/cookie'; | ||
@@ -13,6 +13,7 @@ import { FetchTransport } from './transports/fetch'; | ||
import { SendBeaconTransport } from './transports/send-beacon'; | ||
export var defaultConfig = { | ||
export var getDefaultConfig = function () { return ({ | ||
cookieExpiration: 365, | ||
cookieSameSite: 'Lax', | ||
cookieSecure: false, | ||
cookieStorage: new MemoryStorage(), | ||
disableCookies: false, | ||
@@ -25,2 +26,3 @@ domain: '', | ||
sessionTimeout: 30 * 60 * 1000, | ||
storageProvider: new MemoryStorage(), | ||
trackingOptions: { | ||
@@ -42,29 +44,22 @@ city: true, | ||
transportProvider: new FetchTransport(), | ||
}; | ||
}); }; | ||
var BrowserConfig = /** @class */ (function (_super) { | ||
__extends(BrowserConfig, _super); | ||
function BrowserConfig(apiKey, userId, options) { | ||
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l; | ||
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p; | ||
var _this = this; | ||
var cookieStorage = createCookieStorage(options); | ||
var storageProvider = createEventsStorage(options); | ||
var transportProvider = (_a = options === null || options === void 0 ? void 0 : options.transportProvider) !== null && _a !== void 0 ? _a : createTransport(options === null || options === void 0 ? void 0 : options.transport); | ||
var sessionTimeout = (_b = options === null || options === void 0 ? void 0 : options.sessionTimeout) !== null && _b !== void 0 ? _b : defaultConfig.sessionTimeout; | ||
var trackingOptions = __assign(__assign({}, defaultConfig.trackingOptions), options === null || options === void 0 ? void 0 : options.trackingOptions); | ||
var cookieName = getCookieName(apiKey); | ||
var cookies = cookieStorage.get(cookieName); | ||
var queryParams = getQueryParams(); | ||
_this = _super.call(this, __assign(__assign({}, options), { apiKey: apiKey, storageProvider: storageProvider, transportProvider: transportProvider, userId: userId !== null && userId !== void 0 ? userId : cookies === null || cookies === void 0 ? void 0 : cookies.userId, deviceId: createDeviceId(cookies === null || cookies === void 0 ? void 0 : cookies.deviceId, options === null || options === void 0 ? void 0 : options.deviceId, queryParams.deviceId), sessionId: createSessionId(cookies === null || cookies === void 0 ? void 0 : cookies.sessionId, options === null || options === void 0 ? void 0 : options.sessionId, cookies === null || cookies === void 0 ? void 0 : cookies.lastEventTime, sessionTimeout), optOut: Boolean(cookies === null || cookies === void 0 ? void 0 : cookies.optOut) })) || this; | ||
var defaultConfig = getDefaultConfig(); | ||
_this = _super.call(this, __assign(__assign({}, options), { apiKey: apiKey, userId: userId, optOut: Boolean(options === null || options === void 0 ? void 0 : options.optOut), storageProvider: (_a = options === null || options === void 0 ? void 0 : options.storageProvider) !== null && _a !== void 0 ? _a : defaultConfig.storageProvider, transportProvider: (_b = options === null || options === void 0 ? void 0 : options.transportProvider) !== null && _b !== void 0 ? _b : defaultConfig.transportProvider })) || this; | ||
_this.cookieExpiration = (_c = options === null || options === void 0 ? void 0 : options.cookieExpiration) !== null && _c !== void 0 ? _c : defaultConfig.cookieExpiration; | ||
_this.cookieSameSite = (_d = options === null || options === void 0 ? void 0 : options.cookieSameSite) !== null && _d !== void 0 ? _d : defaultConfig.cookieSameSite; | ||
_this.cookieSecure = (_e = options === null || options === void 0 ? void 0 : options.cookieSecure) !== null && _e !== void 0 ? _e : defaultConfig.cookieSecure; | ||
_this.cookieStorage = cookieStorage; | ||
_this.disableCookies = (_f = options === null || options === void 0 ? void 0 : options.disableCookies) !== null && _f !== void 0 ? _f : defaultConfig.disableCookies; | ||
_this.domain = (_g = options === null || options === void 0 ? void 0 : options.domain) !== null && _g !== void 0 ? _g : defaultConfig.domain; | ||
_this.includeGclid = (_h = options === null || options === void 0 ? void 0 : options.includeGclid) !== null && _h !== void 0 ? _h : defaultConfig.includeGclid; | ||
_this.includeFbclid = (_j = options === null || options === void 0 ? void 0 : options.includeFbclid) !== null && _j !== void 0 ? _j : defaultConfig.includeFbclid; | ||
_this.includeReferrer = (_k = options === null || options === void 0 ? void 0 : options.includeReferrer) !== null && _k !== void 0 ? _k : defaultConfig.includeReferrer; | ||
_this.includeUtm = (_l = options === null || options === void 0 ? void 0 : options.includeUtm) !== null && _l !== void 0 ? _l : defaultConfig.includeUtm; | ||
_this.sessionTimeout = sessionTimeout; | ||
_this.trackingOptions = trackingOptions; | ||
_this.cookieStorage = (_f = options === null || options === void 0 ? void 0 : options.cookieStorage) !== null && _f !== void 0 ? _f : defaultConfig.cookieStorage; | ||
_this.disableCookies = (_g = options === null || options === void 0 ? void 0 : options.disableCookies) !== null && _g !== void 0 ? _g : defaultConfig.disableCookies; | ||
_this.domain = (_h = options === null || options === void 0 ? void 0 : options.domain) !== null && _h !== void 0 ? _h : defaultConfig.domain; | ||
_this.includeGclid = (_j = options === null || options === void 0 ? void 0 : options.includeGclid) !== null && _j !== void 0 ? _j : defaultConfig.includeGclid; | ||
_this.includeFbclid = (_k = options === null || options === void 0 ? void 0 : options.includeFbclid) !== null && _k !== void 0 ? _k : defaultConfig.includeFbclid; | ||
_this.includeReferrer = (_l = options === null || options === void 0 ? void 0 : options.includeReferrer) !== null && _l !== void 0 ? _l : defaultConfig.includeReferrer; | ||
_this.includeUtm = (_m = options === null || options === void 0 ? void 0 : options.includeUtm) !== null && _m !== void 0 ? _m : defaultConfig.includeUtm; | ||
_this.sessionTimeout = (_o = options === null || options === void 0 ? void 0 : options.sessionTimeout) !== null && _o !== void 0 ? _o : defaultConfig.sessionTimeout; | ||
_this.trackingOptions = (_p = options === null || options === void 0 ? void 0 : options.trackingOptions) !== null && _p !== void 0 ? _p : defaultConfig.trackingOptions; | ||
return _this; | ||
@@ -75,7 +70,14 @@ } | ||
export { BrowserConfig }; | ||
export var createConfig = function (apiKey, userId, overrides) { | ||
return new BrowserConfig(apiKey, userId, overrides); | ||
export var useBrowserConfig = function (apiKey, userId, options) { | ||
var _a, _b, _c; | ||
var defaultConfig = getDefaultConfig(); | ||
var cookieStorage = createCookieStorage(options); | ||
var cookieName = getCookieName(apiKey); | ||
var cookies = cookieStorage.get(cookieName); | ||
var queryParams = getQueryParams(); | ||
var sessionTimeout = (_a = options === null || options === void 0 ? void 0 : options.sessionTimeout) !== null && _a !== void 0 ? _a : defaultConfig.sessionTimeout; | ||
return new BrowserConfig(apiKey, userId !== null && userId !== void 0 ? userId : cookies === null || cookies === void 0 ? void 0 : cookies.userId, __assign(__assign({}, options), { cookieStorage: cookieStorage, sessionTimeout: sessionTimeout, deviceId: createDeviceId(cookies === null || cookies === void 0 ? void 0 : cookies.deviceId, options === null || options === void 0 ? void 0 : options.deviceId, queryParams.deviceId), optOut: (_b = options === null || options === void 0 ? void 0 : options.optOut) !== null && _b !== void 0 ? _b : Boolean(cookies === null || cookies === void 0 ? void 0 : cookies.optOut), sessionId: createSessionId(cookies === null || cookies === void 0 ? void 0 : cookies.sessionId, options === null || options === void 0 ? void 0 : options.sessionId, cookies === null || cookies === void 0 ? void 0 : cookies.lastEventTime, sessionTimeout), storageProvider: createEventsStorage(options), trackingOptions: __assign(__assign({}, defaultConfig.trackingOptions), options === null || options === void 0 ? void 0 : options.trackingOptions), transportProvider: (_c = options === null || options === void 0 ? void 0 : options.transportProvider) !== null && _c !== void 0 ? _c : createTransport(options === null || options === void 0 ? void 0 : options.transport) })); | ||
}; | ||
export var createCookieStorage = function (overrides, baseConfig) { | ||
if (baseConfig === void 0) { baseConfig = defaultConfig; } | ||
if (baseConfig === void 0) { baseConfig = getDefaultConfig(); } | ||
var options = __assign(__assign({}, baseConfig), overrides); | ||
@@ -128,7 +130,4 @@ var cookieStorage = overrides === null || overrides === void 0 ? void 0 : overrides.cookieStorage; | ||
} | ||
return defaultConfig.transportProvider; | ||
return getDefaultConfig().transportProvider; | ||
}; | ||
export var getConfig = function () { | ||
return _getConfig(); | ||
}; | ||
//# sourceMappingURL=config.js.map |
@@ -7,3 +7,3 @@ import { __assign } from "tslib"; | ||
import { VERSION } from '../version'; | ||
import { checkSessionExpiry, updateLastEventTime } from '../session-manager'; | ||
import { checkSessionExpiry, updateCookies } from '../session-manager'; | ||
var BROWSER_PLATFORM = 'Web'; | ||
@@ -37,3 +37,3 @@ var IP_ADDRESS = '$remote'; | ||
checkSessionExpiry(_this.config); | ||
updateLastEventTime(_this.config, time); | ||
updateCookies(_this.config, time); | ||
var contextEvent = __assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({ user_id: _this.config.userId, device_id: _this.config.deviceId, session_id: _this.config.sessionId, time: time }, (_this.config.appVersion && { app_version: _this.config.appVersion })), (_this.config.trackingOptions.platform && { platform: BROWSER_PLATFORM })), (_this.config.trackingOptions.osName && { os_name: osName })), (_this.config.trackingOptions.osVersion && { os_version: osVersion })), (_this.config.trackingOptions.deviceManufacturer && { device_manufacturer: deviceVendor })), (_this.config.trackingOptions.deviceModel && { device_model: deviceModel })), (_this.config.trackingOptions.language && { language: getLanguage() })), (_this.config.trackingOptions.ipAddress && { ip: IP_ADDRESS })), { insert_id: UUID(), partner_id: _this.config.partnerId }), context), { event_id: _this.eventId++, library: _this.library }); | ||
@@ -40,0 +40,0 @@ return resolve(contextEvent); |
import { BrowserConfig } from '@amplitude/analytics-types'; | ||
export declare const updateCookies: (config: BrowserConfig) => void; | ||
export declare const updateLastEventTime: (config: BrowserConfig, lastEventTime: number) => void; | ||
export declare const updateCookies: (config: BrowserConfig, lastEventTime?: number | undefined) => void; | ||
export declare const checkSessionExpiry: (config: BrowserConfig) => void; | ||
export declare const getCookieName: (apiKey: string) => string; | ||
export declare const getCookieName: (apiKey: string, limit?: number) => string; | ||
export declare const getOldCookieName: (apiKey: string) => string; | ||
//# sourceMappingURL=session-manager.d.ts.map |
import { AMPLITUDE_PREFIX } from '@amplitude/analytics-core'; | ||
export var updateCookies = function (config) { | ||
export var updateCookies = function (config, lastEventTime) { | ||
var _a; | ||
@@ -9,16 +9,6 @@ var cookieName = getCookieName(config.apiKey); | ||
sessionId: config.sessionId, | ||
lastEventTime: (_a = config.cookieStorage.get(cookieName)) === null || _a === void 0 ? void 0 : _a.lastEventTime, | ||
lastEventTime: lastEventTime !== null && lastEventTime !== void 0 ? lastEventTime : (_a = config.cookieStorage.get(cookieName)) === null || _a === void 0 ? void 0 : _a.lastEventTime, | ||
optOut: Boolean(config.optOut), | ||
}); | ||
}; | ||
export var updateLastEventTime = function (config, lastEventTime) { | ||
var cookieName = getCookieName(config.apiKey); | ||
config.cookieStorage.set(cookieName, { | ||
userId: config.userId, | ||
deviceId: config.deviceId, | ||
sessionId: config.sessionId, | ||
lastEventTime: lastEventTime, | ||
optOut: Boolean(config.optOut), | ||
}); | ||
}; | ||
export var checkSessionExpiry = function (config) { | ||
@@ -34,5 +24,9 @@ var _a; | ||
}; | ||
export var getCookieName = function (apiKey) { | ||
return "".concat(AMPLITUDE_PREFIX, "_").concat(apiKey.substring(0, 10)); | ||
export var getCookieName = function (apiKey, limit) { | ||
if (limit === void 0) { limit = 10; } | ||
return "".concat(AMPLITUDE_PREFIX, "_").concat(apiKey.substring(0, limit)); | ||
}; | ||
export var getOldCookieName = function (apiKey) { | ||
return "".concat(AMPLITUDE_PREFIX.toLowerCase(), "_").concat(apiKey.substring(0, 6)); | ||
}; | ||
//# sourceMappingURL=session-manager.js.map |
@@ -7,4 +7,4 @@ import { Storage, CookieStorageOptions } from '@amplitude/analytics-types'; | ||
get(key: string): T | undefined; | ||
findByKey(key: string): string | undefined; | ||
set(key: string, value: T | null, options?: CookieStorageOptions): void; | ||
getRaw(key: string): string | undefined; | ||
set(key: string, value: T | null): void; | ||
remove(key: string): void; | ||
@@ -11,0 +11,0 @@ reset(): void; |
@@ -28,6 +28,9 @@ import { __assign } from "tslib"; | ||
CookieStorage.prototype.get = function (key) { | ||
var value = this.getRaw(key); | ||
if (!value) { | ||
return undefined; | ||
} | ||
try { | ||
var value = this.findByKey(key); | ||
// eslint-disable-next-line @typescript-eslint/no-unsafe-return | ||
return value ? JSON.parse(value) : undefined; | ||
return JSON.parse(value); | ||
} | ||
@@ -39,3 +42,3 @@ catch (_a) { | ||
}; | ||
CookieStorage.prototype.findByKey = function (key) { | ||
CookieStorage.prototype.getRaw = function (key) { | ||
var cookie = window.document.cookie.split('; '); | ||
@@ -48,5 +51,7 @@ var match = cookie.find(function (c) { return c.indexOf(key + '=') === 0; }); | ||
}; | ||
CookieStorage.prototype.set = function (key, value, options) { | ||
CookieStorage.prototype.set = function (key, value) { | ||
var _a; | ||
try { | ||
var expires = value !== null ? options === null || options === void 0 ? void 0 : options.expirationDays : -1; | ||
var expirationDays = (_a = this.options.expirationDays) !== null && _a !== void 0 ? _a : 0; | ||
var expires = value !== null ? expirationDays : -1; | ||
var expireDate = undefined; | ||
@@ -63,14 +68,14 @@ if (expires) { | ||
str += '; path=/'; | ||
if (options === null || options === void 0 ? void 0 : options.domain) { | ||
str += "; domain=".concat(options.domain); | ||
if (this.options.domain) { | ||
str += "; domain=".concat(this.options.domain); | ||
} | ||
if (options === null || options === void 0 ? void 0 : options.secure) { | ||
if (this.options.secure) { | ||
str += '; Secure'; | ||
} | ||
if (options === null || options === void 0 ? void 0 : options.sameSite) { | ||
str += "; SameSite=".concat(options.sameSite); | ||
if (this.options.sameSite) { | ||
str += "; SameSite=".concat(this.options.sameSite); | ||
} | ||
window.document.cookie = str; | ||
} | ||
catch (_a) { | ||
catch (_b) { | ||
// | ||
@@ -77,0 +82,0 @@ } |
@@ -5,2 +5,3 @@ import { Storage } from '@amplitude/analytics-types'; | ||
get(key: string): T | undefined; | ||
getRaw(key: string): string | undefined; | ||
set(key: string, value: T): void; | ||
@@ -7,0 +8,0 @@ remove(key: string): void; |
@@ -27,3 +27,3 @@ var LocalStorage = /** @class */ (function () { | ||
try { | ||
var value = window.localStorage.getItem(key); | ||
var value = this.getRaw(key); | ||
if (!value) { | ||
@@ -40,2 +40,5 @@ return undefined; | ||
}; | ||
LocalStorage.prototype.getRaw = function (key) { | ||
return window.localStorage.getItem(key) || undefined; | ||
}; | ||
LocalStorage.prototype.set = function (key, value) { | ||
@@ -42,0 +45,0 @@ try { |
@@ -6,2 +6,3 @@ import { Storage } from '@amplitude/analytics-types'; | ||
get(key: string): T | undefined; | ||
getRaw(key: string): string | undefined; | ||
set(key: string, value: T): void; | ||
@@ -8,0 +9,0 @@ remove(key: string): void; |
@@ -11,2 +11,6 @@ var MemoryStorage = /** @class */ (function () { | ||
}; | ||
MemoryStorage.prototype.getRaw = function (key) { | ||
var value = this.get(key); | ||
return value ? JSON.stringify(value) : undefined; | ||
}; | ||
MemoryStorage.prototype.set = function (key, value) { | ||
@@ -13,0 +17,0 @@ this.memoryStorage.set(key, value); |
@@ -10,3 +10,3 @@ import { __extends, __read } from "tslib"; | ||
try { | ||
var value = this.findByKey(key); | ||
var value = this.getRaw(key); | ||
if (!value) { | ||
@@ -13,0 +13,0 @@ return undefined; |
import { InstanceProxy, QueueProxy } from '@amplitude/analytics-types'; | ||
/** | ||
* Applies the proxied functions on the proxied amplitude snippet to an instance of the real object. | ||
* @ignore | ||
*/ | ||
@@ -5,0 +6,0 @@ export declare const runQueuedFunctions: (instance: object, queue: QueueProxy) => void; |
/** | ||
* Applies the proxied functions on the proxied amplitude snippet to an instance of the real object. | ||
* @ignore | ||
*/ | ||
@@ -4,0 +5,0 @@ export var runQueuedFunctions = function (instance, queue) { |
@@ -1,2 +0,2 @@ | ||
export declare const VERSION = "0.3.1"; | ||
export declare const VERSION = "0.4.0"; | ||
//# sourceMappingURL=version.d.ts.map |
@@ -1,2 +0,2 @@ | ||
export var VERSION = '0.3.1'; | ||
export var VERSION = '0.4.0'; | ||
//# sourceMappingURL=version.js.map |
@@ -15,2 +15,2 @@ !function(){"use strict";function e(e,t){return t.forEach((function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach((function(i){if("default"!==i&&!(i in e)){var n=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(e,i,n.get?n:{enumerable:!0,get:function(){return t[i]}})}}))})),Object.freeze(e)} | ||
PERFORMANCE OF THIS SOFTWARE. | ||
***************************************************************************** */var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},t(e,i)};function i(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}var n=function(){return n=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},n.apply(this,arguments)};function r(e,t,i,n){return new(i||(i=Promise))((function(r,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))}function o(e,t){var i,n,r,o,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(i)throw new TypeError("Generator is already executing.");for(;s;)try{if(i=1,n&&(r=2&o[0]?n.return:o[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,o[1])).done)return r;switch(n=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(r=s.trys,(r=r.length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){s.label=o[1];break}if(6===o[0]&&s.label<r[1]){s.label=r[1],r=o;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(o);break}r[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],n=0}finally{i=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}}function s(e){var t="function"==typeof Symbol&&Symbol.iterator,i=t&&e[t],n=0;if(i)return i.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function a(e,t){var i="function"==typeof Symbol&&e[Symbol.iterator];if(!i)return e;var n,r,o=i.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){r={error:e}}finally{try{n&&!n.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}return s}function u(e,t,i){if(i||2===arguments.length)for(var n,r=0,o=t.length;r<o;r++)!n&&r in t||(n||(n=Array.prototype.slice.call(t,0,r)),n[r]=t[r]);return e.concat(n||Array.prototype.slice.call(t))}var l="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function c(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var d,p,f={},v={};d=v,Object.defineProperty(d,"__esModule",{value:!0}),d.ServerZone=void 0,(p=d.ServerZone||(d.ServerZone={})).US="US",p.EU="EU";var h={};!function(e){var t,i,n;Object.defineProperty(e,"__esModule",{value:!0}),e.SpecialEventType=e.RevenueProperty=e.IdentifyOperation=void 0,(t=e.IdentifyOperation||(e.IdentifyOperation={})).SET="$set",t.SET_ONCE="$setOnce",t.ADD="$add",t.APPEND="$append",t.PREPEND="$prepend",t.REMOVE="$remove",t.PREINSERT="$preInsert",t.POSTINSERT="$postInsert",t.UNSET="$unset",t.CLEAR_ALL="$clearAll",(i=e.RevenueProperty||(e.RevenueProperty={})).REVENUE_PRODUCT_ID="$productId",i.REVENUE_QUANTITY="$quantity",i.REVENUE_PRICE="$price",i.REVENUE_TYPE="$revenueType",i.REVENUE="$revenue",(n=e.SpecialEventType||(e.SpecialEventType={})).IDENTIFY="$identify",n.GROUP_IDENTIFY="$groupidentify",n.REVENUE="revenue_amount"}(h);var b={};!function(e){var t;Object.defineProperty(e,"__esModule",{value:!0}),e.LogLevel=void 0,(t=e.LogLevel||(e.LogLevel={}))[t.None=0]="None",t[t.Error=1]="Error",t[t.Warn=2]="Warn",t[t.Verbose=3]="Verbose"}(b);var y={};!function(e){var t;Object.defineProperty(e,"__esModule",{value:!0}),e.PluginType=void 0,(t=e.PluginType||(e.PluginType={})).BEFORE="before",t.ENRICHMENT="enrichment",t.DESTINATION="destination"}(y);var g={};!function(e){var t;Object.defineProperty(e,"__esModule",{value:!0}),e.Status=void 0,(t=e.Status||(e.Status={})).Unknown="unknown",t.Skipped="skipped",t.Success="success",t.RateLimit="rate_limit",t.PayloadTooLarge="payload_too_large",t.Invalid="invalid",t.Failed="failed",t.Timeout="Timeout",t.SystemError="SystemError"}(g);var w={};!function(e){var t;Object.defineProperty(e,"__esModule",{value:!0}),e.TransportType=void 0,(t=e.TransportType||(e.TransportType={})).XHR="xhr",t.SendBeacon="beacon",t.Fetch="fetch"}(w),function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.TransportType=e.Status=e.PluginType=e.LogLevel=e.RevenueProperty=e.IdentifyOperation=e.SpecialEventType=e.ServerZone=void 0;var t=v;Object.defineProperty(e,"ServerZone",{enumerable:!0,get:function(){return t.ServerZone}});var i=h;Object.defineProperty(e,"SpecialEventType",{enumerable:!0,get:function(){return i.SpecialEventType}}),Object.defineProperty(e,"IdentifyOperation",{enumerable:!0,get:function(){return i.IdentifyOperation}}),Object.defineProperty(e,"RevenueProperty",{enumerable:!0,get:function(){return i.RevenueProperty}});var n=b;Object.defineProperty(e,"LogLevel",{enumerable:!0,get:function(){return n.LogLevel}});var r=y;Object.defineProperty(e,"PluginType",{enumerable:!0,get:function(){return r.PluginType}});var o=g;Object.defineProperty(e,"Status",{enumerable:!0,get:function(){return o.Status}});var s=w;Object.defineProperty(e,"TransportType",{enumerable:!0,get:function(){return s.TransportType}})}(f);var m,S=e({__proto__:null,default:c(f)},[f]),_="".concat("AMP","_unsent"),E="https://api2.amplitude.com/2/httpapi",T="Amplitude Logger ",k=function(){function e(){this.logLevel=f.LogLevel.None}return e.prototype.disable=function(){this.logLevel=f.LogLevel.None},e.prototype.enable=function(e){void 0===e&&(e=f.LogLevel.Warn),this.logLevel=e},e.prototype.log=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<f.LogLevel.Verbose||console.log("".concat(T,"[Log]: ").concat(e.join(" ")))},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<f.LogLevel.Warn||console.warn("".concat(T,"[Warn]: ").concat(e.join(" ")))},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<f.LogLevel.Error||console.error("".concat(T,"[Error]: ").concat(e.join(" ")))},e}(),O={},I=((m={})[f.ServerZone.US]=function(e){return e?"https://api2.amplitude.com/batch":E},m[f.ServerZone.EU]=function(e){return e?"https://api.eu.amplitude.com/batch":"https://api.eu.amplitude.com/2/httpapi"},m),x={flushMaxRetries:5,flushQueueSize:10,flushIntervalMillis:1e3,logLevel:f.LogLevel.Warn,loggerProvider:new k,saveEvents:!0,optOut:!1,serverUrl:E,serverZone:f.ServerZone.US,useBatch:!1},P=function(e){var t,i,n,r;this.apiKey=e.apiKey,this.userId=e.userId,this.deviceId=e.deviceId,this.sessionId=e.sessionId,this.flushIntervalMillis=e.flushIntervalMillis||x.flushIntervalMillis,this.flushMaxRetries=e.flushMaxRetries||x.flushMaxRetries,this.flushQueueSize=e.flushQueueSize||x.flushQueueSize,this.loggerProvider=e.loggerProvider||x.loggerProvider,this.logLevel=null!==(t=e.logLevel)&&void 0!==t?t:x.logLevel,this.partnerId=e.partnerId,this.plugins=[],this.optOut=null!==(i=e.optOut)&&void 0!==i?i:x.optOut,this.saveEvents=null!==(n=e.saveEvents)&&void 0!==n?n:x.saveEvents,this.serverUrl=e.serverUrl,this.serverZone=e.serverZone||x.serverZone,this.storageProvider=e.storageProvider,this.transportProvider=e.transportProvider,this.useBatch=null!==(r=e.useBatch)&&void 0!==r?r:x.useBatch,this.loggerProvider.enable(this.logLevel),U(this)},R=function(){return O.default},N=function(e){return U(e)},U=function(e){return e.serverUrl||([f.ServerZone.US,f.ServerZone.EU].includes(e.serverZone)||(e.loggerProvider.warn('Unknown server zone "'.concat(e.serverZone,'". Replaced with US server zone')),e.serverZone=f.ServerZone.US),e.serverUrl=I[e.serverZone](e.useBatch)),e.serverUrl},L=function(e){if(Object.keys(e).length>1e3)return!1;for(var t in e){var i=e[t];if(!q(t,i))return!1}return!0},q=function(e,t){var i,n;if("string"!=typeof e)return!1;if(Array.isArray(t))try{for(var r=s(t),o=r.next();!o.done;o=r.next()){var a=o.value;if(Array.isArray(a))return!1;if("object"==typeof a)return L(t);if(!["number","string"].includes(typeof a))return!1}}catch(e){i={error:e}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}else{if("object"==typeof t)return L(t);if(!["number","string","boolean"].includes(typeof t))return!1}return!0},j=function(){function e(){this._propertySet=new Set,this._properties={}}return e.prototype.getUserProperties=function(){return n({},this._properties)},e.prototype.set=function(e,t){return this._safeSet(f.IdentifyOperation.SET,e,t),this},e.prototype.setOnce=function(e,t){return this._safeSet(f.IdentifyOperation.SET_ONCE,e,t),this},e.prototype.append=function(e,t){return this._safeSet(f.IdentifyOperation.APPEND,e,t),this},e.prototype.prepend=function(e,t){return this._safeSet(f.IdentifyOperation.PREPEND,e,t),this},e.prototype.postInsert=function(e,t){return this._safeSet(f.IdentifyOperation.POSTINSERT,e,t),this},e.prototype.preInsert=function(e,t){return this._safeSet(f.IdentifyOperation.PREINSERT,e,t),this},e.prototype.remove=function(e,t){return this._safeSet(f.IdentifyOperation.REMOVE,e,t),this},e.prototype.add=function(e,t){return this._safeSet(f.IdentifyOperation.ADD,e,t),this},e.prototype.unset=function(e){return this._safeSet(f.IdentifyOperation.UNSET,e,"-"),this},e.prototype.clearAll=function(){return this._properties={},this._properties[f.IdentifyOperation.CLEAR_ALL]="-",this},e.prototype._safeSet=function(e,t,i){if(this._validate(e,t,i)){var n=this._properties[e];return void 0===n&&(n={},this._properties[e]=n),n[t]=i,this._propertySet.add(t),!0}return!1},e.prototype._validate=function(e,t,i){return void 0===this._properties[f.IdentifyOperation.CLEAR_ALL]&&(!this._propertySet.has(t)&&(e===f.IdentifyOperation.ADD?"number"==typeof i:e===f.IdentifyOperation.UNSET||e===f.IdentifyOperation.REMOVE||q(t,i)))},e}(),A=function(e,t,i){return void 0===t&&(t=0),void 0===i&&(i=f.Status.Unknown),{event:e,code:t,message:i}},C=[],D=!1,M=function(e,t){return r(void 0,void 0,void 0,(function(){return o(this,(function(i){switch(i.label){case 0:return[4,e.setup(t)];case 1:return i.sent(),t.plugins.push(e),[2]}}))}))},B=function(e,t){return t.plugins.splice(t.plugins.findIndex((function(t){return t.name===e})),1),Promise.resolve()},z=function(e,t){return new Promise((function(i){t.optOut?i(A(e,0,"Event skipped due to optOut config")):(C.push([e,i,t.plugins]),F(0))}))},F=function(e){D||(D=!0,setTimeout((function(){V().then((function(){D=!1,C.length>0&&F(0)}))}),e))},V=function(){return r(void 0,void 0,void 0,(function(){var e,t,i,r,u,l,c,d,p,v,h,b,y,g,w,m,S,_,E,T;return o(this,(function(o){switch(o.label){case 0:if(!(e=C.shift()))return[2];t=a(e,1),i=t[0],r=a(e,3),u=r[1],l=r[2],c=l.filter((function(e){return e.type===f.PluginType.BEFORE})),o.label=1;case 1:o.trys.push([1,6,7,8]),d=s(c),p=d.next(),o.label=2;case 2:return p.done?[3,5]:[4,p.value.execute(n({},i))];case 3:i=o.sent(),o.label=4;case 4:return p=d.next(),[3,2];case 5:return[3,8];case 6:return v=o.sent(),S={error:v},[3,8];case 7:try{p&&!p.done&&(_=d.return)&&_.call(d)}finally{if(S)throw S.error}return[7];case 8:h=l.filter((function(e){return e.type===f.PluginType.ENRICHMENT})),o.label=9;case 9:o.trys.push([9,14,15,16]),b=s(h),y=b.next(),o.label=10;case 10:return y.done?[3,13]:[4,y.value.execute(n({},i))];case 11:i=o.sent(),o.label=12;case 12:return y=b.next(),[3,10];case 13:return[3,16];case 14:return g=o.sent(),E={error:g},[3,16];case 15:try{y&&!y.done&&(T=b.return)&&T.call(b)}finally{if(E)throw E.error}return[7];case 16:return w=l.filter((function(e){return e.type===f.PluginType.DESTINATION})),m=w.map((function(e){var t=n({},i);return e.execute(t).catch((function(e){return A(t,0,String(e))}))})),Promise.all(m).then((function(e){var t=a(e,1)[0];u(t)})),[2]}}))}))},Z=function(e){return function(e){return O.default=O.default?Object.assign(O.default,e):e,O.default}(e)},$=function(e,t,i){var r=R(),o=function(e,t,i){return n(n(n({},i),{event_type:e}),t&&{event_properties:t})}(e,t,i);return J(o,r)},Q=function(e,t,i,r){var o=R(),s=function(e,t,i,r){var o=n(n({},r),{event_type:f.SpecialEventType.IDENTIFY,user_properties:i.getUserProperties(),user_id:e});return void 0!==t&&t.length>0&&(o.device_id=t),o}(e,t,i,r);return J(s,o)},K=function(e,t,i,r,o,s){var a=R(),u=function(e,t,i,r,o,s){var a,u=n(n({},s),{event_type:f.SpecialEventType.GROUP_IDENTIFY,group_properties:o.getUserProperties(),groups:(a={},a[i]=r,a),user_id:e});return void 0!==t&&t.length>0&&(u.device_id=t),u}(e,t,i,r,o,s);return J(u,a)},W=function(e,t){var i=R(),n=function(e,t){var i,n=new j;return n.set(e,t),{event_type:f.SpecialEventType.IDENTIFY,user_properties:n.getUserProperties(),groups:(i={},i[e]=t,i)}}(e,t);return J(n,i)},G=function(e,t){var i=R(),r=function(e,t){return n(n({},t),{event_type:f.SpecialEventType.REVENUE,event_properties:e.getEventProperties()})}(e,t);return J(r,i)},H=function(e){return r(void 0,void 0,void 0,(function(){var t;return o(this,(function(i){return t=R(),[2,M(e,t)]}))}))},Y=function(e){return r(void 0,void 0,void 0,(function(){var t;return o(this,(function(i){return t=R(),[2,B(e,t)]}))}))},J=function(e,t){return r(void 0,void 0,void 0,(function(){var i,n,r;return o(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,z(e,t)];case 1:return 200===(i=o.sent()).code?t.loggerProvider.log(i.message):t.loggerProvider.error(i.message),[2,i];case 2:return n=o.sent(),r=String(n),t.loggerProvider.error(r),[2,A(e,0,r)];case 3:return[2]}}))}))};var X=function(e){var t,i,n,r,o,s,a,u,l,c,d,p,v,h,b,y,g,w,m,S,_;if("object"!=typeof e)return null;var E,T=e.code||0,k=(E=T)>=200&&E<300?f.Status.Success:429===E?f.Status.RateLimit:413===E?f.Status.PayloadTooLarge:408===E?f.Status.Timeout:E>=400&&E<500?f.Status.Invalid:E>=500?f.Status.Failed:f.Status.Unknown;switch(k){case f.Status.Success:return{status:k,statusCode:T,body:{eventsIngested:null!==(t=e.events_ingested)&&void 0!==t?t:0,payloadSizeBytes:null!==(i=e.payload_size_bytes)&&void 0!==i?i:0,serverUploadTime:null!==(n=e.server_upload_time)&&void 0!==n?n:0}};case f.Status.Invalid:return{status:k,statusCode:T,body:{error:null!==(r=e.error)&&void 0!==r?r:"",missingField:null!==(o=e.missing_field)&&void 0!==o?o:"",eventsWithInvalidFields:null!==(s=e.events_with_invalid_fields)&&void 0!==s?s:{},eventsWithMissingFields:null!==(a=e.events_with_missing_fields)&&void 0!==a?a:{},epsThreshold:null!==(u=e.eps_threshold)&&void 0!==u?u:0,exceededDailyQuotaDevices:null!==(l=e.exceeded_daily_quota_devices)&&void 0!==l?l:{},silencedDevices:null!==(c=e.silenced_devices)&&void 0!==c?c:[],silencedEvents:null!==(d=e.silenced_events)&&void 0!==d?d:[],throttledDevices:null!==(p=e.throttled_devices)&&void 0!==p?p:{},throttledEvents:null!==(v=e.throttled_events)&&void 0!==v?v:[]}};case f.Status.PayloadTooLarge:return{status:k,statusCode:T,body:{error:null!==(h=e.error)&&void 0!==h?h:""}};case f.Status.RateLimit:return{status:k,statusCode:T,body:{error:null!==(b=e.error)&&void 0!==b?b:"",epsThreshold:null!==(y=e.eps_threshold)&&void 0!==y?y:0,throttledDevices:null!==(g=e.throttled_devices)&&void 0!==g?g:{},throttledUsers:null!==(w=e.throttled_users)&&void 0!==w?w:{},exceededDailyQuotaDevices:null!==(m=e.exceeded_daily_quota_devices)&&void 0!==m?m:{},exceededDailyQuotaUsers:null!==(S=e.exceeded_daily_quota_users)&&void 0!==S?S:{},throttledEvents:null!==(_=e.throttled_events)&&void 0!==_?_:[]}};case f.Status.Timeout:default:return{status:k,statusCode:T}}},ee=function(){function e(){this.productId="",this.quantity=1,this.price=0}return e.prototype.setProductId=function(e){return this.productId=e,this},e.prototype.setQuantity=function(e){return e>0&&(this.quantity=e),this},e.prototype.setPrice=function(e){return this.price=e,this},e.prototype.setRevenueType=function(e){return this.revenueType=e,this},e.prototype.setRevenue=function(e){return this.revenue=e,this},e.prototype.setEventProperties=function(e){return L(e)&&(this.properties=e),this},e.prototype.getEventProperties=function(){var e=this.properties?n({},this.properties):{};return e[f.RevenueProperty.REVENUE_PRODUCT_ID]=this.productId,e[f.RevenueProperty.REVENUE_QUANTITY]=this.quantity,e[f.RevenueProperty.REVENUE_PRICE]=this.price,e[f.RevenueProperty.REVENUE_TYPE]=this.revenueType,e[f.RevenueProperty.REVENUE]=this.revenue,e},e}(),te=function(){function e(){this.name="amplitude",this.type=f.PluginType.DESTINATION,this.backoff=1e3,this.throttle=3e4,this.storageKey="",this.backup=new Set,this.scheduled=!1,this.queue=[]}return e.prototype.setup=function(e){var t=this;this.config=e,this.storageKey="".concat(_,"_").concat(this.config.apiKey.substring(0,10));var i=this.config.storageProvider.get(this.storageKey);return this.snapshot(),i&&i.length>0&&Promise.all(i.map((function(e){return t.execute(e)}))).catch(),Promise.resolve(void 0)},e.prototype.execute=function(e){var t=this;return new Promise((function(i){var n={event:e,attempts:0,callback:function(e){return i(e)},delay:0};t.addToQueue(n)}))},e.prototype.addToQueue=function(){for(var e=this,t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];var n=t.filter((function(t){return t.attempts<e.config.flushMaxRetries||(e.fulfillRequest([t],500,f.Status.Unknown),!1)}));this.addToBackup.apply(this,u([],a(n.map((function(e){return e.event}))),!1)),n.forEach((function(t){t.attempts+=1;var i=t.delay;if(t.delay=0,1===t.attempts&&!t.delay)return e.queue=e.queue.concat(t),void e.schedule(e.config.flushIntervalMillis);setTimeout((function(){e.queue=e.queue.concat(t),e.schedule(e.config.flushIntervalMillis)}),i||t.attempts*e.backoff)}))},e.prototype.schedule=function(e){var t=this;this.scheduled||(this.scheduled=!0,setTimeout((function(){t.flush().then((function(){t.scheduled=!1,t.queue.length>0&&t.schedule(e)}))}),e))},e.prototype.flush=function(){return r(this,void 0,void 0,(function(){var e,t,i=this;return o(this,(function(n){switch(n.label){case 0:return e=this.queue,this.queue=[],r=e,o=this.config.flushQueueSize,s=Math.max(o,1),t=r.reduce((function(e,t,i){var n=Math.floor(i/s);return e[n]||(e[n]=[]),e[n].push(t),e}),[]),[4,Promise.all(t.map((function(e){return i.send(e)})))];case 1:return n.sent(),[2]}var r,o,s}))}))},e.prototype.send=function(e){return r(this,void 0,void 0,(function(){var t,i,n;return o(this,(function(r){switch(r.label){case 0:if(!this.config.apiKey)return[2,this.fulfillRequest(e,400,"Event skipped due to optOut config")];t={api_key:this.config.apiKey,events:e.map((function(e){return e.event}))},r.label=1;case 1:return r.trys.push([1,3,,4]),[4,this.config.transportProvider.send(N(this.config),t)];case 2:return null===(i=r.sent())?(this.fulfillRequest(e,0,"Unexpected error occurred"),[2]):(this.handleReponse(i,e),[3,4]);case 3:return n=r.sent(),this.fulfillRequest(e,0,String(n)),[3,4];case 4:return[2]}}))}))},e.prototype.handleReponse=function(e,t){switch(e.status){case f.Status.Success:this.handleSuccessResponse(e,t);break;case f.Status.Invalid:this.handleInvalidResponse(e,t);break;case f.Status.PayloadTooLarge:this.handlePayloadTooLargeResponse(e,t);break;case f.Status.RateLimit:this.handleRateLimitResponse(e,t);break;default:this.handleOtherReponse(t)}},e.prototype.handleSuccessResponse=function(e,t){this.fulfillRequest(t,e.statusCode,"Event tracked successfully")},e.prototype.handleInvalidResponse=function(e,t){var i=this;if(e.body.missingField)this.fulfillRequest(t,e.statusCode,e.body.error);else{var n=u(u(u([],a(Object.values(e.body.eventsWithInvalidFields)),!1),a(Object.values(e.body.eventsWithMissingFields)),!1),a(e.body.silencedEvents),!1).flat(),r=new Set(n),o=t.filter((function(t,n){if(!r.has(n))return!0;i.fulfillRequest([t],e.statusCode,e.body.error)}));this.addToQueue.apply(this,u([],a(o),!1))}},e.prototype.handlePayloadTooLargeResponse=function(e,t){1!==t.length?(this.config.flushQueueSize/=2,this.addToQueue.apply(this,u([],a(t),!1))):this.fulfillRequest(t,e.statusCode,e.body.error)},e.prototype.handleRateLimitResponse=function(e,t){var i=this,n=Object.keys(e.body.exceededDailyQuotaUsers),r=Object.keys(e.body.exceededDailyQuotaDevices),o=e.body.throttledEvents,s=new Set(n),l=new Set(r),c=new Set(o),d=t.filter((function(t,n){if(!(t.event.user_id&&s.has(t.event.user_id)||t.event.device_id&&l.has(t.event.device_id)))return c.has(n)&&(t.delay=i.throttle),!0;i.fulfillRequest([t],e.statusCode,e.body.error)}));this.addToQueue.apply(this,u([],a(d),!1))},e.prototype.handleOtherReponse=function(e){this.addToQueue.apply(this,u([],a(e),!1))},e.prototype.fulfillRequest=function(e,t,i){this.removeFromBackup.apply(this,u([],a(e.map((function(e){return e.event}))),!1)),e.forEach((function(e){return e.callback(A(e.event,t,i))}))},e.prototype.addToBackup=function(){for(var e=this,t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];this.config.saveEvents&&(t.forEach((function(t){return e.backup.add(t)})),this.snapshot())},e.prototype.removeFromBackup=function(){for(var e=this,t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];this.config.saveEvents&&(t.forEach((function(t){return e.backup.delete(t)})),this.snapshot())},e.prototype.snapshot=function(){if(this.config.saveEvents){var e=Array.from(this.backup);this.config.storageProvider.set(this.storageKey,e)}},e}(),ie=function(e,t){ne(e,t)},ne=function(e,t){for(var i=0;i<t.length;i++){var n=t[i],r=n.name,o=n.args,s=n.resolve,a=e&&e[r];if("function"==typeof a){var u=a.apply(e,o);"function"==typeof s&&s(null==u?void 0:u.promise)}}return e},re=function(e){return e&&void 0!==e._q},oe={exports:{}};!function(e,t){!function(i,n){var r="function",o="undefined",s="object",a="string",u="model",l="name",c="type",d="vendor",p="version",f="architecture",v="console",h="mobile",b="tablet",y="smarttv",g="wearable",w="embedded",m="Amazon",S="Apple",_="ASUS",E="BlackBerry",T="Firefox",k="Google",O="Huawei",I="LG",x="Microsoft",P="Motorola",R="Opera",N="Samsung",U="Sony",L="Xiaomi",q="Zebra",j=function(e){for(var t={},i=0;i<e.length;i++)t[e[i].toUpperCase()]=e[i];return t},A=function(e,t){return typeof e===a&&-1!==C(t).indexOf(C(e))},C=function(e){return e.toLowerCase()},D=function(e,t){if(typeof e===a)return e=e.replace(/^\s+|\s+$/g,""),typeof t===o?e:e.substring(0,255)},M=function(e,t){for(var i,o,a,u,l,c,d=0;d<t.length&&!l;){var p=t[d],f=t[d+1];for(i=o=0;i<p.length&&!l;)if(l=p[i++].exec(e))for(a=0;a<f.length;a++)c=l[++o],typeof(u=f[a])===s&&u.length>0?2==u.length?typeof u[1]==r?this[u[0]]=u[1].call(this,c):this[u[0]]=u[1]:3==u.length?typeof u[1]!==r||u[1].exec&&u[1].test?this[u[0]]=c?c.replace(u[1],u[2]):n:this[u[0]]=c?u[1].call(this,c,u[2]):n:4==u.length&&(this[u[0]]=c?u[3].call(this,c.replace(u[1],u[2])):n):this[u]=c||n;d+=2}},B=function(e,t){for(var i in t)if(typeof t[i]===s&&t[i].length>0){for(var r=0;r<t[i].length;r++)if(A(t[i][r],e))return"?"===i?n:i}else if(A(t[i],e))return"?"===i?n:i;return e},z={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},F={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[p,[l,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[p,[l,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[l,p],[/opios[\/ ]+([\w\.]+)/i],[p,[l,"Opera Mini"]],[/\bopr\/([\w\.]+)/i],[p,[l,R]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i,/(ba?idubrowser)[\/ ]?([\w\.]+)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale|qqbrowserlite|qq)\/([-\w\.]+)/i,/(weibo)__([\d\.]+)/i],[l,p],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[p,[l,"UCBrowser"]],[/\bqbcore\/([\w\.]+)/i],[p,[l,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[p,[l,"WeChat"]],[/konqueror\/([\w\.]+)/i],[p,[l,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[p,[l,"IE"]],[/yabrowser\/([\w\.]+)/i],[p,[l,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[l,/(.+)/,"$1 Secure Browser"],p],[/\bfocus\/([\w\.]+)/i],[p,[l,"Firefox Focus"]],[/\bopt\/([\w\.]+)/i],[p,[l,"Opera Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[p,[l,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[p,[l,"Dolphin"]],[/coast\/([\w\.]+)/i],[p,[l,"Opera Coast"]],[/miuibrowser\/([\w\.]+)/i],[p,[l,"MIUI Browser"]],[/fxios\/([-\w\.]+)/i],[p,[l,T]],[/\bqihu|(qi?ho?o?|360)browser/i],[[l,"360 Browser"]],[/(oculus|samsung|sailfish)browser\/([\w\.]+)/i],[[l,/(.+)/,"$1 Browser"],p],[/(comodo_dragon)\/([\w\.]+)/i],[[l,/_/g," "],p],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[l,p],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i],[l],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[l,"Facebook"],p],[/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/ ]([-\w\.]+)/i],[l,p],[/\bgsa\/([\w\.]+) .*safari\//i],[p,[l,"GSA"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[p,[l,"Chrome Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[l,"Chrome WebView"],p],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[p,[l,"Android Browser"]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[l,p],[/version\/([\w\.]+) .*mobile\/\w+ (safari)/i],[p,[l,"Mobile Safari"]],[/version\/([\w\.]+) .*(mobile ?safari|safari)/i],[p,l],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[l,[p,B,{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}]],[/(webkit|khtml)\/([\w\.]+)/i],[l,p],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[l,"Netscape"],p],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[p,[l,"Firefox Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i],[l,p]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[f,"amd64"]],[/(ia32(?=;))/i],[[f,C]],[/((?:i[346]|x)86)[;\)]/i],[[f,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[f,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[f,"armhf"]],[/windows (ce|mobile); ppc;/i],[[f,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[f,/ower/,"",C]],[/(sun4\w)[;\)]/i],[[f,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[f,C]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[pt]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[u,[d,N],[c,b]],[/\b((?:s[cgp]h|gt|sm)-\w+|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[u,[d,N],[c,h]],[/((ipod|iphone)\d+,\d+)/i],[u,[d,S],[c,h]],[/(ipad\d+,\d+)/i],[u,[d,S],[c,b]],[/\((ip(?:hone|od)[\w ]*);/i],[u,[d,S],[c,h]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[u,[d,S],[c,b]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[u,[d,O],[c,b]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}-[atu]?[ln][01259x][012359][an]?)\b(?!.+d\/s)/i],[u,[d,O],[c,h]],[/\b(poco[\w ]+)(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[u,/_/g," "],[d,L],[c,h]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[u,/_/g," "],[d,L],[c,b]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007)\b/i],[u,[d,"OPPO"],[c,h]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[u,[d,"Vivo"],[c,h]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[u,[d,"Realme"],[c,h]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[u,[d,P],[c,h]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[u,[d,P],[c,b]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[u,[d,I],[c,b]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[u,[d,I],[c,h]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[u,[d,"Lenovo"],[c,b]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[u,/_/g," "],[d,"Nokia"],[c,h]],[/(pixel c)\b/i],[u,[d,k],[c,b]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[u,[d,k],[c,h]],[/droid.+ ([c-g]\d{4}|so[-l]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[u,[d,U],[c,h]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[u,"Xperia Tablet"],[d,U],[c,b]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[u,[d,"OnePlus"],[c,h]],[/(alexa)webm/i,/(kf[a-z]{2}wi)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[u,[d,m],[c,b]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[u,/(.+)/g,"Fire Phone $1"],[d,m],[c,h]],[/(playbook);[-\w\),; ]+(rim)/i],[u,d,[c,b]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[u,[d,E],[c,h]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[u,[d,_],[c,b]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[u,[d,_],[c,h]],[/(nexus 9)/i],[u,[d,"HTC"],[c,b]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic|sony)[-_ ]?([-\w]*)/i],[d,[u,/_/g," "],[c,h]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[u,[d,"Acer"],[c,b]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[u,[d,"Meizu"],[c,h]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[u,[d,"Sharp"],[c,h]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[d,u,[c,h]],[/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[d,u,[c,b]],[/(surface duo)/i],[u,[d,x],[c,b]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[u,[d,"Fairphone"],[c,h]],[/(u304aa)/i],[u,[d,"AT&T"],[c,h]],[/\bsie-(\w*)/i],[u,[d,"Siemens"],[c,h]],[/\b(rct\w+) b/i],[u,[d,"RCA"],[c,b]],[/\b(venue[\d ]{2,7}) b/i],[u,[d,"Dell"],[c,b]],[/\b(q(?:mv|ta)\w+) b/i],[u,[d,"Verizon"],[c,b]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[u,[d,"Barnes & Noble"],[c,b]],[/\b(tm\d{3}\w+) b/i],[u,[d,"NuVision"],[c,b]],[/\b(k88) b/i],[u,[d,"ZTE"],[c,b]],[/\b(nx\d{3}j) b/i],[u,[d,"ZTE"],[c,h]],[/\b(gen\d{3}) b.+49h/i],[u,[d,"Swiss"],[c,h]],[/\b(zur\d{3}) b/i],[u,[d,"Swiss"],[c,b]],[/\b((zeki)?tb.*\b) b/i],[u,[d,"Zeki"],[c,b]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[d,"Dragon Touch"],u,[c,b]],[/\b(ns-?\w{0,9}) b/i],[u,[d,"Insignia"],[c,b]],[/\b((nxa|next)-?\w{0,9}) b/i],[u,[d,"NextBook"],[c,b]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[d,"Voice"],u,[c,h]],[/\b(lvtel\-)?(v1[12]) b/i],[[d,"LvTel"],u,[c,h]],[/\b(ph-1) /i],[u,[d,"Essential"],[c,h]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[u,[d,"Envizen"],[c,b]],[/\b(trio[-\w\. ]+) b/i],[u,[d,"MachSpeed"],[c,b]],[/\btu_(1491) b/i],[u,[d,"Rotor"],[c,b]],[/(shield[\w ]+) b/i],[u,[d,"Nvidia"],[c,b]],[/(sprint) (\w+)/i],[d,u,[c,h]],[/(kin\.[onetw]{3})/i],[[u,/\./g," "],[d,x],[c,h]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[u,[d,q],[c,b]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[u,[d,q],[c,h]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[d,u,[c,v]],[/droid.+; (shield) bui/i],[u,[d,"Nvidia"],[c,v]],[/(playstation [345portablevi]+)/i],[u,[d,U],[c,v]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[u,[d,x],[c,v]],[/smart-tv.+(samsung)/i],[d,[c,y]],[/hbbtv.+maple;(\d+)/i],[[u,/^/,"SmartTV"],[d,N],[c,y]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[d,I],[c,y]],[/(apple) ?tv/i],[d,[u,"Apple TV"],[c,y]],[/crkey/i],[[u,"Chromecast"],[d,k],[c,y]],[/droid.+aft(\w)( bui|\))/i],[u,[d,m],[c,y]],[/\(dtv[\);].+(aquos)/i],[u,[d,"Sharp"],[c,y]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w ]*; *(\w[^;]*);([^;]*)/i],[[d,D],[u,D],[c,y]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[c,y]],[/((pebble))app/i],[d,u,[c,g]],[/droid.+; (glass) \d/i],[u,[d,k],[c,g]],[/droid.+; (wt63?0{2,3})\)/i],[u,[d,q],[c,g]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[d,[c,w]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[u,[c,h]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[u,[c,b]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[c,b]],[/(phone|mobile(?:[;\/]| safari)|pda(?=.+windows ce))/i],[[c,h]],[/(android[-\w\. ]{0,9});.+buil/i],[u,[d,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[p,[l,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[p,[l,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i],[l,p],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[p,l]],os:[[/microsoft (windows) (vista|xp)/i],[l,p],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[l,[p,B,z]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[l,"Windows"],[p,B,z]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/cfnetwork\/.+darwin/i],[[p,/_/g,"."],[l,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[l,"Mac OS"],[p,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86)/i],[p,l],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[l,p],[/\(bb(10);/i],[p,[l,E]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[p,[l,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[p,[l,"Firefox OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[p,[l,"webOS"]],[/crkey\/([\d\.]+)/i],[p,[l,"Chromecast"]],[/(cros) [\w]+ ([\w\.]+\w)/i],[[l,"Chromium OS"],p],[/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[l,p],[/(sunos) ?([\w\.\d]*)/i],[[l,"Solaris"],p],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux)/i,/(unix) ?([\w\.]*)/i],[l,p]]},V=function(e,t){if(typeof e===s&&(t=e,e=n),!(this instanceof V))return new V(e,t).getResult();var r=e||(typeof i!==o&&i.navigator&&i.navigator.userAgent?i.navigator.userAgent:""),u=t?function(e,t){var i={};for(var n in e)t[n]&&t[n].length%2==0?i[n]=t[n].concat(e[n]):i[n]=e[n];return i}(F,t):F;return this.getBrowser=function(){var e,t={};return t.name=n,t.version=n,M.call(t,r,u.browser),t.major=typeof(e=t.version)===a?e.replace(/[^\d\.]/g,"").split(".")[0]:n,t},this.getCPU=function(){var e={};return e.architecture=n,M.call(e,r,u.cpu),e},this.getDevice=function(){var e={};return e.vendor=n,e.model=n,e.type=n,M.call(e,r,u.device),e},this.getEngine=function(){var e={};return e.name=n,e.version=n,M.call(e,r,u.engine),e},this.getOS=function(){var e={};return e.name=n,e.version=n,M.call(e,r,u.os),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return r},this.setUA=function(e){return r=typeof e===a&&e.length>255?D(e,255):e,this},this.setUA(r),this};V.VERSION="0.7.28",V.BROWSER=j([l,p,"major"]),V.CPU=j([f]),V.DEVICE=j([u,d,c,v,h,y,b,g,w]),V.ENGINE=V.OS=j([l,p]),e.exports&&(t=e.exports=V),t.UAParser=V;var Z=typeof i!==o&&(i.jQuery||i.Zepto);if(Z&&!Z.ua){var $=new V;Z.ua=$.getResult(),Z.ua.get=function(){return $.getUA()},Z.ua.set=function(e){$.setUA(e);var t=$.getResult();for(var i in t)Z.ua[i]=t[i]}}}("object"==typeof window?window:l)}(oe,oe.exports);var se=oe.exports,ae=function(e){return e?(e^16*Math.random()>>e/4).toString(16):(String(1e7)+String(-1e3)+String(-4e3)+String(-8e3)+String(-1e11)).replace(/[018]/g,ae)},ue=function(){var e,t,i,n;if("undefined"==typeof navigator)return"";var r=navigator.userLanguage;return null!==(n=null!==(i=null!==(t=null===(e=navigator.languages)||void 0===e?void 0:e[0])&&void 0!==t?t:navigator.language)&&void 0!==i?i:r)&&void 0!==n?n:""},le=function(e){var t,i=ce(e.apiKey);e.cookieStorage.set(i,{userId:e.userId,deviceId:e.deviceId,sessionId:e.sessionId,lastEventTime:null===(t=e.cookieStorage.get(i))||void 0===t?void 0:t.lastEventTime,optOut:Boolean(e.optOut)})},ce=function(e){return"".concat("AMP","_").concat(e.substring(0,10))},de=function(){function e(){var e;this.name="context",this.type=f.PluginType.BEFORE,this.eventId=0,this.library="amplitude-ts/".concat("0.3.1"),"undefined"!=typeof navigator&&(e=navigator.userAgent),this.uaResult=new se(e).getResult()}return e.prototype.setup=function(e){return this.config=e,Promise.resolve(void 0)},e.prototype.execute=function(e){var t=this;return new Promise((function(i){var r=(new Date).getTime(),o=t.uaResult.browser.name,s=t.uaResult.browser.version,a=t.uaResult.device.model||t.uaResult.os.name,u=t.uaResult.device.vendor;return function(e){var t,i=ce(e.apiKey),n=null===(t=e.cookieStorage.get(i))||void 0===t?void 0:t.lastEventTime,r=Date.now();n&&r-n>=e.sessionTimeout&&(e.sessionId=r,le(e))}(t.config),function(e,t){var i=ce(e.apiKey);e.cookieStorage.set(i,{userId:e.userId,deviceId:e.deviceId,sessionId:e.sessionId,lastEventTime:t,optOut:Boolean(e.optOut)})}(t.config,r),i(n(n(n(n(n(n(n(n(n(n(n({user_id:t.config.userId,device_id:t.config.deviceId,session_id:t.config.sessionId,time:r},t.config.appVersion&&{app_version:t.config.appVersion}),t.config.trackingOptions.platform&&{platform:"Web"}),t.config.trackingOptions.osName&&{os_name:o}),t.config.trackingOptions.osVersion&&{os_version:s}),t.config.trackingOptions.deviceManufacturer&&{device_manufacturer:u}),t.config.trackingOptions.deviceModel&&{device_model:a}),t.config.trackingOptions.language&&{language:ue()}),t.config.trackingOptions.ipAddress&&{ip:"$remote"}),{insert_id:ae(),partner_id:t.config.partnerId}),e),{event_id:t.eventId++,library:t.library}))}))},e}(),pe=function(){function e(e){this.options=n({},e)}return e.prototype.isEnabled=function(){if("undefined"==typeof window)return!1;var t=String(Date.now()),i=new e,n="AMP_TEST";try{return i.set(n,t),i.get(n)===t}catch(e){return!1}finally{i.remove(n)}},e.prototype.get=function(e){try{var t=this.findByKey(e);return t?JSON.parse(t):void 0}catch(e){return}},e.prototype.findByKey=function(e){var t=window.document.cookie.split("; ").find((function(t){return 0===t.indexOf(e+"=")}));if(t)return t.substring(e.length+1)},e.prototype.set=function(e,t,i){try{var n=null!==t?null==i?void 0:i.expirationDays:-1,r=void 0;if(n){var o=new Date;o.setTime(o.getTime()+24*n*60*60*1e3),r=o}var s="".concat(e,"=").concat(JSON.stringify(t));r&&(s+="; expires=".concat(r.toUTCString())),s+="; path=/",(null==i?void 0:i.domain)&&(s+="; domain=".concat(i.domain)),(null==i?void 0:i.secure)&&(s+="; Secure"),(null==i?void 0:i.sameSite)&&(s+="; SameSite=".concat(i.sameSite)),window.document.cookie=s}catch(e){}},e.prototype.remove=function(e){this.set(e,null)},e.prototype.reset=function(){},e}(),fe=function(){function e(){}return e.prototype.send=function(e,t){return r(this,void 0,void 0,(function(){var i,n;return o(this,(function(r){switch(r.label){case 0:if("undefined"==typeof fetch)throw new Error("FetchTransport is not supported");return i={headers:{"Content-Type":"application/json",Accept:"*/*"},body:JSON.stringify(t),method:"POST"},[4,fetch(e,i)];case 1:return[4,r.sent().json()];case 2:return n=r.sent(),[2,X(n)]}}))}))},e}(),ve=function(){function e(){}return e.prototype.isEnabled=function(){if("undefined"==typeof window)return!1;var t=String(Date.now()),i=new e,n="AMP_TEST";try{return i.set(n,t),i.get(n)===t}catch(e){return!1}finally{i.remove(n)}},e.prototype.get=function(e){try{var t=window.localStorage.getItem(e);if(!t)return;return JSON.parse(t)}catch(e){return}},e.prototype.set=function(e,t){try{window.localStorage.setItem(e,JSON.stringify(t))}catch(e){}},e.prototype.remove=function(e){try{window.localStorage.removeItem(e)}catch(e){}},e.prototype.reset=function(){try{window.localStorage.clear()}catch(e){}},e}(),he=function(){function e(){this.memoryStorage=new Map}return e.prototype.isEnabled=function(){return!0},e.prototype.get=function(e){return this.memoryStorage.get(e)},e.prototype.set=function(e,t){this.memoryStorage.set(e,t)},e.prototype.remove=function(e){this.memoryStorage.delete(e)},e.prototype.reset=function(){this.memoryStorage.clear()},e}(),be=function(){if("undefined"==typeof window)return{};var e=window.location.search.substring(1).split("&").filter(Boolean).reduce((function(e,t){var i=a(t.split("=",2),2),n=i[0],r=i[1],o=void 0===r?"":r;return o?(e[decodeURIComponent(n)]=decodeURIComponent(o),e):e}),{});return e},ye=function(){function e(){this.state={done:4}}return e.prototype.send=function(e,t){return r(this,void 0,void 0,(function(){var i=this;return o(this,(function(n){return[2,new Promise((function(n,r){"undefined"==typeof XMLHttpRequest&&r(new Error("XHRTransport is not supported."));var o=new XMLHttpRequest;o.open("POST",e,!0),o.onreadystatechange=function(){if(o.readyState===i.state.done)try{var e=o.responseText,t=JSON.parse(e),s=X(t);n(s)}catch(e){r(e)}},o.setRequestHeader("Content-Type","application/json"),o.setRequestHeader("Accept","*/*"),o.send(JSON.stringify(t))}))]}))}))},e}(),ge=function(){function e(){}return e.prototype.send=function(e,t){return r(this,void 0,void 0,(function(){return o(this,(function(i){return[2,new Promise((function(i,n){if("undefined"==typeof window||void 0===window.navigator||void 0===window.navigator.sendBeacon)throw new Error("SendBeaconTransport is not supported");try{var r=JSON.stringify(t);return i(window.navigator.sendBeacon(e,JSON.stringify(t))?X({code:200,events_ingested:t.events.length,payload_size_bytes:r.length,server_upload_time:Date.now()}):X({code:500}))}catch(e){n(e)}}))]}))}))},e}(),we={cookieExpiration:365,cookieSameSite:"Lax",cookieSecure:!1,disableCookies:!1,domain:"",includeGclid:!0,includeFbclid:!0,includeReferrer:!0,includeUtm:!0,sessionTimeout:18e5,trackingOptions:{city:!0,country:!0,carrier:!0,deviceManufacturer:!0,deviceModel:!0,dma:!0,ipAddress:!0,language:!0,osName:!0,osVersion:!0,platform:!0,region:!0,versionName:!0},transportProvider:new fe},me=function(e){function t(t,i,r){var o,s,a,u,l,c,d,p,f,v,h,b=this,y=Se(r),g=_e(r),w=null!==(o=null==r?void 0:r.transportProvider)&&void 0!==o?o:ke(null==r?void 0:r.transport),m=null!==(s=null==r?void 0:r.sessionTimeout)&&void 0!==s?s:we.sessionTimeout,S=n(n({},we.trackingOptions),null==r?void 0:r.trackingOptions),_=ce(t),E=y.get(_),T=be();return(b=e.call(this,n(n({},r),{apiKey:t,storageProvider:g,transportProvider:w,userId:null!=i?i:null==E?void 0:E.userId,deviceId:Ee(null==E?void 0:E.deviceId,null==r?void 0:r.deviceId,T.deviceId),sessionId:Te(null==E?void 0:E.sessionId,null==r?void 0:r.sessionId,null==E?void 0:E.lastEventTime,m),optOut:Boolean(null==E?void 0:E.optOut)}))||this).cookieExpiration=null!==(a=null==r?void 0:r.cookieExpiration)&&void 0!==a?a:we.cookieExpiration,b.cookieSameSite=null!==(u=null==r?void 0:r.cookieSameSite)&&void 0!==u?u:we.cookieSameSite,b.cookieSecure=null!==(l=null==r?void 0:r.cookieSecure)&&void 0!==l?l:we.cookieSecure,b.cookieStorage=y,b.disableCookies=null!==(c=null==r?void 0:r.disableCookies)&&void 0!==c?c:we.disableCookies,b.domain=null!==(d=null==r?void 0:r.domain)&&void 0!==d?d:we.domain,b.includeGclid=null!==(p=null==r?void 0:r.includeGclid)&&void 0!==p?p:we.includeGclid,b.includeFbclid=null!==(f=null==r?void 0:r.includeFbclid)&&void 0!==f?f:we.includeFbclid,b.includeReferrer=null!==(v=null==r?void 0:r.includeReferrer)&&void 0!==v?v:we.includeReferrer,b.includeUtm=null!==(h=null==r?void 0:r.includeUtm)&&void 0!==h?h:we.includeUtm,b.sessionTimeout=m,b.trackingOptions=S,b}return i(t,e),t}(P),Se=function(e,t){void 0===t&&(t=we);var i=n(n({},t),e),r=null==e?void 0:e.cookieStorage;return r&&r.isEnabled()||(r=new pe({domain:i.domain,expirationDays:i.cookieExpiration,sameSite:i.cookieSameSite,secure:i.cookieSecure}),!i.disableCookies&&r.isEnabled()||(r=new ve).isEnabled()||(r=new he)),r},_e=function(e){var t=null==e?void 0:e.storageProvider;return t&&t.isEnabled()||(t=new ve).isEnabled()||(t=new he),t},Ee=function(e,t,i){return t||i||e||ae()},Te=function(e,t,i,n){return void 0===e&&(e=0),void 0===t&&(t=0),void 0===i&&(i=0),e&&Date.now()-i<n?e:t||Date.now()},ke=function(e){return e===f.TransportType.XHR?new ye:e===f.TransportType.SendBeacon?new ge:we.transportProvider},Oe=function(){return R()},Ie=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.get=function(e){try{var t=this.findByKey(e);if(!t)return;return t.split(".").splice(-1)[0].split("|").reduce((function(e,t){var i=a(t.split("=",2),2),n=i[0],r=i[1],o=void 0===r?"":r;return o?(e[n]=decodeURIComponent(o),e):e}),{})}catch(e){return}},t.prototype.set=function(){},t}(pe),xe=function(){var e=be(),t=new Ie,i=t.isEnabled()&&t.get("__utmz")||{},n=e.utm_source||i.utmcsr,r=e.utm_medium||i.utmcmd,o=e.utm_campaign||i.utmccn,s=e.utm_term||i.utmctr,a=e.utm_content||i.utmcct,u={};return n&&(u.utm_source=n),r&&(u.utm_medium=r),o&&(u.utm_campaign=o),s&&(u.utm_term=s),a&&(u.utm_content=a),u},Pe=function(){var e,t={};try{var i=document.referrer||void 0,n=null!==(e=null==i?void 0:i.split("/")[2])&&void 0!==e?e:void 0;void 0!==i&&(t.referrer=i),void 0!==n&&(t.referring_domain=n)}catch(e){}return t},Re=function(){var e,t=be();return n({},t.gclid&&((e={}).gclid=t.gclid,e))},Ne=function(){var e,t=be();return n({},t.fbclid&&((e={}).fbclid=t.fbclid,e))},Ue=function(e,t,i){return{promise:$(e,t,i)}},Le=Ue,qe=Object.freeze({__proto__:null,Types:S,add:function(e){return{promise:H(e)}},getDeviceId:function(){return Oe().deviceId},getSessionId:function(){return Oe().sessionId},getUserId:function(){return Oe().userId},groupIdentify:function(e,t,i,n){if(re(i)){var r=i._q;i._q=[],i=ne(new j,r)}return{promise:K(void 0,void 0,e,t,i,n)}},identify:function(e,t){if(re(e)){var i=e._q;e._q=[],e=ne(new j,i)}return{promise:Q(void 0,void 0,e,t)}},init:function(e,t,i){return{promise:r(void 0,void 0,void 0,(function(){var r,s;return o(this,(function(o){switch(o.label){case 0:return r=function(e,t,i){return new me(e,t,i)}(e,t,i),s=Z(r),le(s),[4,H(new de)];case 1:return o.sent(),[4,H(new te)];case 2:return o.sent(),function(e){var t=n(n(n(n({},e.includeUtm&&xe()),e.includeReferrer&&Pe()),e.includeGclid&&Re()),e.includeFbclid&&Ne());if(0!==Object.keys(t).length){var i=new j;Object.entries(t).forEach((function(e){var t=a(e,2),n=t[0],r=t[1];r&&(i.setOnce("initial_".concat(n),r),i.set(n,r))})),Q(void 0,void 0,i)}}(s),[2]}}))}))}},logEvent:Le,remove:function(e){return{promise:Y(e)}},revenue:function(e,t){if(re(e)){var i=e._q;e._q=[],e=ne(new ee,i)}return{promise:G(e,t)}},setDeviceId:function(e){var t=Oe();t.deviceId=e,le(t)},setGroup:function(e,t){return{promise:W(e,t)}},setOptOut:function(e){!function(e){R().optOut=Boolean(e)}(e);var t=Oe();le(t)},setSessionId:function(e){var t=Oe();t.sessionId=e,le(t)},setTransport:function(e){var t=Oe(),i=ke(e);t.transportProvider=i},setUserId:function(e){var t=Oe();t.userId=e,le(t)},track:Ue,runQueuedFunctions:ie,Revenue:ee,Identify:j});if(globalThis.amplitude=Object.assign(globalThis.amplitude||{},qe),globalThis.amplitude.invoked){var je=globalThis.amplitude._q;globalThis.amplitude._q=[],ie(qe,je)}}(); | ||
***************************************************************************** */var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},t(e,i)};function i(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}var n=function(){return n=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},n.apply(this,arguments)};function r(e,t,i,n){return new(i||(i=Promise))((function(r,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))}function o(e,t){var i,n,r,o,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(i)throw new TypeError("Generator is already executing.");for(;s;)try{if(i=1,n&&(r=2&o[0]?n.return:o[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,o[1])).done)return r;switch(n=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(r=s.trys,(r=r.length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){s.label=o[1];break}if(6===o[0]&&s.label<r[1]){s.label=r[1],r=o;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(o);break}r[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],n=0}finally{i=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}}function s(e){var t="function"==typeof Symbol&&Symbol.iterator,i=t&&e[t],n=0;if(i)return i.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function a(e,t){var i="function"==typeof Symbol&&e[Symbol.iterator];if(!i)return e;var n,r,o=i.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){r={error:e}}finally{try{n&&!n.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}return s}function u(e,t,i){if(i||2===arguments.length)for(var n,r=0,o=t.length;r<o;r++)!n&&r in t||(n||(n=Array.prototype.slice.call(t,0,r)),n[r]=t[r]);return e.concat(n||Array.prototype.slice.call(t))}var l="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function c(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var d,p,f={},v={};d=v,Object.defineProperty(d,"__esModule",{value:!0}),d.ServerZone=void 0,(p=d.ServerZone||(d.ServerZone={})).US="US",p.EU="EU";var h={};!function(e){var t,i,n;Object.defineProperty(e,"__esModule",{value:!0}),e.SpecialEventType=e.RevenueProperty=e.IdentifyOperation=void 0,(t=e.IdentifyOperation||(e.IdentifyOperation={})).SET="$set",t.SET_ONCE="$setOnce",t.ADD="$add",t.APPEND="$append",t.PREPEND="$prepend",t.REMOVE="$remove",t.PREINSERT="$preInsert",t.POSTINSERT="$postInsert",t.UNSET="$unset",t.CLEAR_ALL="$clearAll",(i=e.RevenueProperty||(e.RevenueProperty={})).REVENUE_PRODUCT_ID="$productId",i.REVENUE_QUANTITY="$quantity",i.REVENUE_PRICE="$price",i.REVENUE_TYPE="$revenueType",i.REVENUE="$revenue",(n=e.SpecialEventType||(e.SpecialEventType={})).IDENTIFY="$identify",n.GROUP_IDENTIFY="$groupidentify",n.REVENUE="revenue_amount"}(h);var b={};!function(e){var t;Object.defineProperty(e,"__esModule",{value:!0}),e.LogLevel=void 0,(t=e.LogLevel||(e.LogLevel={}))[t.None=0]="None",t[t.Error=1]="Error",t[t.Warn=2]="Warn",t[t.Verbose=3]="Verbose"}(b);var g={};!function(e){var t;Object.defineProperty(e,"__esModule",{value:!0}),e.PluginType=void 0,(t=e.PluginType||(e.PluginType={})).BEFORE="before",t.ENRICHMENT="enrichment",t.DESTINATION="destination"}(g);var y={};!function(e){var t;Object.defineProperty(e,"__esModule",{value:!0}),e.Status=void 0,(t=e.Status||(e.Status={})).Unknown="unknown",t.Skipped="skipped",t.Success="success",t.RateLimit="rate_limit",t.PayloadTooLarge="payload_too_large",t.Invalid="invalid",t.Failed="failed",t.Timeout="Timeout",t.SystemError="SystemError"}(y);var w={};!function(e){var t;Object.defineProperty(e,"__esModule",{value:!0}),e.TransportType=void 0,(t=e.TransportType||(e.TransportType={})).XHR="xhr",t.SendBeacon="beacon",t.Fetch="fetch"}(w),function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.TransportType=e.Status=e.PluginType=e.LogLevel=e.RevenueProperty=e.IdentifyOperation=e.SpecialEventType=e.ServerZone=void 0;var t=v;Object.defineProperty(e,"ServerZone",{enumerable:!0,get:function(){return t.ServerZone}});var i=h;Object.defineProperty(e,"SpecialEventType",{enumerable:!0,get:function(){return i.SpecialEventType}}),Object.defineProperty(e,"IdentifyOperation",{enumerable:!0,get:function(){return i.IdentifyOperation}}),Object.defineProperty(e,"RevenueProperty",{enumerable:!0,get:function(){return i.RevenueProperty}});var n=b;Object.defineProperty(e,"LogLevel",{enumerable:!0,get:function(){return n.LogLevel}});var r=g;Object.defineProperty(e,"PluginType",{enumerable:!0,get:function(){return r.PluginType}});var o=y;Object.defineProperty(e,"Status",{enumerable:!0,get:function(){return o.Status}});var s=w;Object.defineProperty(e,"TransportType",{enumerable:!0,get:function(){return s.TransportType}})}(f);var m=e({__proto__:null,default:c(f)},[f]),S="AMP",_="".concat(S,"_unsent"),E="https://api2.amplitude.com/2/httpapi",T=function(e){if(Object.keys(e).length>1e3)return!1;for(var t in e){var i=e[t];if(!k(t,i))return!1}return!0},k=function(e,t){var i,n;if("string"!=typeof e)return!1;if(Array.isArray(t)){var r=!0;try{for(var o=s(t),a=o.next();!a.done;a=o.next()){var u=a.value;if(Array.isArray(u))return!1;if("object"==typeof u)r=r&&T(u);else if(!["number","string"].includes(typeof u))return!1;if(!r)return!1}}catch(e){i={error:e}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}}else{if("object"==typeof t)return T(t);if(!["number","string","boolean"].includes(typeof t))return!1}return!0},I=function(){function e(){this._propertySet=new Set,this._properties={}}return e.prototype.getUserProperties=function(){return n({},this._properties)},e.prototype.set=function(e,t){return this._safeSet(f.IdentifyOperation.SET,e,t),this},e.prototype.setOnce=function(e,t){return this._safeSet(f.IdentifyOperation.SET_ONCE,e,t),this},e.prototype.append=function(e,t){return this._safeSet(f.IdentifyOperation.APPEND,e,t),this},e.prototype.prepend=function(e,t){return this._safeSet(f.IdentifyOperation.PREPEND,e,t),this},e.prototype.postInsert=function(e,t){return this._safeSet(f.IdentifyOperation.POSTINSERT,e,t),this},e.prototype.preInsert=function(e,t){return this._safeSet(f.IdentifyOperation.PREINSERT,e,t),this},e.prototype.remove=function(e,t){return this._safeSet(f.IdentifyOperation.REMOVE,e,t),this},e.prototype.add=function(e,t){return this._safeSet(f.IdentifyOperation.ADD,e,t),this},e.prototype.unset=function(e){return this._safeSet(f.IdentifyOperation.UNSET,e,"-"),this},e.prototype.clearAll=function(){return this._properties={},this._properties[f.IdentifyOperation.CLEAR_ALL]="-",this},e.prototype._safeSet=function(e,t,i){if(this._validate(e,t,i)){var n=this._properties[e];return void 0===n&&(n={},this._properties[e]=n),n[t]=i,this._propertySet.add(t),!0}return!1},e.prototype._validate=function(e,t,i){return void 0===this._properties[f.IdentifyOperation.CLEAR_ALL]&&(!this._propertySet.has(t)&&(e===f.IdentifyOperation.ADD?"number"==typeof i:e===f.IdentifyOperation.UNSET||e===f.IdentifyOperation.REMOVE||k(t,i)))},e}(),O=function(e,t,i){return void 0===t&&(t=0),void 0===i&&(i=f.Status.Unknown),{event:e,code:t,message:i}},x=[],P=!1,R=function(e,t){return r(void 0,void 0,void 0,(function(){return o(this,(function(i){switch(i.label){case 0:return[4,e.setup(t)];case 1:return i.sent(),t.plugins.push(e),[2]}}))}))},N=function(e,t){return t.plugins.splice(t.plugins.findIndex((function(t){return t.name===e})),1),Promise.resolve()},U=function(e,t){return new Promise((function(i){t.optOut?i(O(e,0,"Event skipped due to optOut config")):(x.push([e,i,t.plugins]),L(0))}))},L=function(e){P||(P=!0,setTimeout((function(){j().then((function(){P=!1,x.length>0&&L(0)}))}),e))},j=function(){return r(void 0,void 0,void 0,(function(){var e,t,i,r,u,l,c,d,p,v,h,b,g,y,w,m,S,_,E,T;return o(this,(function(o){switch(o.label){case 0:if(!(e=x.shift()))return[2];t=a(e,1),i=t[0],r=a(e,3),u=r[1],l=r[2],c=l.filter((function(e){return e.type===f.PluginType.BEFORE})),o.label=1;case 1:o.trys.push([1,6,7,8]),d=s(c),p=d.next(),o.label=2;case 2:return p.done?[3,5]:[4,p.value.execute(n({},i))];case 3:i=o.sent(),o.label=4;case 4:return p=d.next(),[3,2];case 5:return[3,8];case 6:return v=o.sent(),S={error:v},[3,8];case 7:try{p&&!p.done&&(_=d.return)&&_.call(d)}finally{if(S)throw S.error}return[7];case 8:h=l.filter((function(e){return e.type===f.PluginType.ENRICHMENT})),o.label=9;case 9:o.trys.push([9,14,15,16]),b=s(h),g=b.next(),o.label=10;case 10:return g.done?[3,13]:[4,g.value.execute(n({},i))];case 11:i=o.sent(),o.label=12;case 12:return g=b.next(),[3,10];case 13:return[3,16];case 14:return y=o.sent(),E={error:y},[3,16];case 15:try{g&&!g.done&&(T=b.return)&&T.call(b)}finally{if(E)throw E.error}return[7];case 16:return w=l.filter((function(e){return e.type===f.PluginType.DESTINATION})),m=w.map((function(e){var t=n({},i);return e.execute(t).catch((function(e){return O(t,0,String(e))}))})),Promise.all(m).then((function(e){var t=a(e,1)[0];u(t)})),[2]}}))}))},q=function(){function e(e){void 0===e&&(e="$default"),this.logEvent=this.track.bind(this),this.name=e}return e.prototype.init=function(e,t,i){return this.config=i,Promise.resolve()},e.prototype.track=function(e,t,i){var r=function(e,t,i){return n(n(n({},"string"==typeof e?{event_type:e}:e),i),t&&{event_properties:t})}(e,t,i);return this.dispatch(r)},e.prototype.identify=function(e,t,i,r){var o=function(e,t,i,r){var o=n(n({},r),{event_type:f.SpecialEventType.IDENTIFY,user_properties:i.getUserProperties(),user_id:e});return void 0!==t&&t.length>0&&(o.device_id=t),o}(i,r,e,t);return this.dispatch(o)},e.prototype.groupIdentify=function(e,t,i,r,o,s){var a=function(e,t,i,r,o,s){var a,u=n(n({},s),{event_type:f.SpecialEventType.GROUP_IDENTIFY,group_properties:o.getUserProperties(),groups:(a={},a[i]=r,a),user_id:e});return void 0!==t&&t.length>0&&(u.device_id=t),u}(o,s,e,t,i,r);return this.dispatch(a)},e.prototype.setGroup=function(e,t){var i=function(e,t){var i,n=new I;return n.set(e,t),{event_type:f.SpecialEventType.IDENTIFY,user_properties:n.getUserProperties(),groups:(i={},i[e]=t,i)}}(e,t);return this.dispatch(i)},e.prototype.revenue=function(e,t){var i=function(e,t){return n(n({},t),{event_type:f.SpecialEventType.REVENUE,event_properties:e.getEventProperties()})}(e,t);return this.dispatch(i)},e.prototype.add=function(e){return r(this,void 0,void 0,(function(){var t;return o(this,(function(i){return t=this.config,[2,R(e,t)]}))}))},e.prototype.remove=function(e){return r(this,void 0,void 0,(function(){var t;return o(this,(function(i){return t=this.config,[2,N(e,t)]}))}))},e.prototype.dispatch=function(e){return r(this,void 0,void 0,(function(){var t,i,n;return o(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,U(e,this.config)];case 1:return 200===(t=r.sent()).code?this.config.loggerProvider.log(t.message):this.config.loggerProvider.error(t.message),[2,t];case 2:return i=r.sent(),n=String(i),this.config.loggerProvider.error(n),[2,O(e,0,n)];case 3:return[2]}}))}))},e.prototype.setOptOut=function(e){this.config.optOut=Boolean(e)},e}();var A=function(e){var t,i,n,r,o,s,a,u,l,c,d,p,v,h,b,g,y,w,m,S,_,E;if("object"!=typeof e)return null;var T,k=e.code||0,I=(T=k)>=200&&T<300?f.Status.Success:429===T?f.Status.RateLimit:413===T?f.Status.PayloadTooLarge:408===T?f.Status.Timeout:T>=400&&T<500?f.Status.Invalid:T>=500?f.Status.Failed:f.Status.Unknown;switch(I){case f.Status.Success:return{status:I,statusCode:k,body:{eventsIngested:null!==(t=e.events_ingested)&&void 0!==t?t:0,payloadSizeBytes:null!==(i=e.payload_size_bytes)&&void 0!==i?i:0,serverUploadTime:null!==(n=e.server_upload_time)&&void 0!==n?n:0}};case f.Status.Invalid:return{status:I,statusCode:k,body:{error:null!==(r=e.error)&&void 0!==r?r:"",missingField:null!==(o=e.missing_field)&&void 0!==o?o:"",eventsWithInvalidFields:null!==(s=e.events_with_invalid_fields)&&void 0!==s?s:{},eventsWithMissingFields:null!==(a=e.events_with_missing_fields)&&void 0!==a?a:{},eventsWithInvalidIdLengths:null!==(u=e.events_with_invalid_id_lengths)&&void 0!==u?u:{},epsThreshold:null!==(l=e.eps_threshold)&&void 0!==l?l:0,exceededDailyQuotaDevices:null!==(c=e.exceeded_daily_quota_devices)&&void 0!==c?c:{},silencedDevices:null!==(d=e.silenced_devices)&&void 0!==d?d:[],silencedEvents:null!==(p=e.silenced_events)&&void 0!==p?p:[],throttledDevices:null!==(v=e.throttled_devices)&&void 0!==v?v:{},throttledEvents:null!==(h=e.throttled_events)&&void 0!==h?h:[]}};case f.Status.PayloadTooLarge:return{status:I,statusCode:k,body:{error:null!==(b=e.error)&&void 0!==b?b:""}};case f.Status.RateLimit:return{status:I,statusCode:k,body:{error:null!==(g=e.error)&&void 0!==g?g:"",epsThreshold:null!==(y=e.eps_threshold)&&void 0!==y?y:0,throttledDevices:null!==(w=e.throttled_devices)&&void 0!==w?w:{},throttledUsers:null!==(m=e.throttled_users)&&void 0!==m?m:{},exceededDailyQuotaDevices:null!==(S=e.exceeded_daily_quota_devices)&&void 0!==S?S:{},exceededDailyQuotaUsers:null!==(_=e.exceeded_daily_quota_users)&&void 0!==_?_:{},throttledEvents:null!==(E=e.throttled_events)&&void 0!==E?E:[]}};case f.Status.Timeout:default:return{status:I,statusCode:k}}},D=function(){function e(){this.productId="",this.quantity=1,this.price=0}return e.prototype.setProductId=function(e){return this.productId=e,this},e.prototype.setQuantity=function(e){return e>0&&(this.quantity=e),this},e.prototype.setPrice=function(e){return this.price=e,this},e.prototype.setRevenueType=function(e){return this.revenueType=e,this},e.prototype.setRevenue=function(e){return this.revenue=e,this},e.prototype.setEventProperties=function(e){return T(e)&&(this.properties=e),this},e.prototype.getEventProperties=function(){var e=this.properties?n({},this.properties):{};return e[f.RevenueProperty.REVENUE_PRODUCT_ID]=this.productId,e[f.RevenueProperty.REVENUE_QUANTITY]=this.quantity,e[f.RevenueProperty.REVENUE_PRICE]=this.price,e[f.RevenueProperty.REVENUE_TYPE]=this.revenueType,e[f.RevenueProperty.REVENUE]=this.revenue,e},e}(),C="Amplitude Logger ",M=function(){function e(){this.logLevel=f.LogLevel.None}return e.prototype.disable=function(){this.logLevel=f.LogLevel.None},e.prototype.enable=function(e){void 0===e&&(e=f.LogLevel.Warn),this.logLevel=e},e.prototype.log=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<f.LogLevel.Verbose||console.log("".concat(C,"[Log]: ").concat(e.join(" ")))},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<f.LogLevel.Warn||console.warn("".concat(C,"[Warn]: ").concat(e.join(" ")))},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<f.LogLevel.Error||console.error("".concat(C,"[Error]: ").concat(e.join(" ")))},e}(),B=function(){return{flushMaxRetries:5,flushQueueSize:10,flushIntervalMillis:1e3,logLevel:f.LogLevel.Warn,loggerProvider:new M,saveEvents:!0,optOut:!1,plugins:[],serverUrl:E,serverZone:f.ServerZone.US,useBatch:!1}},z=function(e){var t,i,n,r,o=B();this.apiKey=e.apiKey,this.appVersion=e.appVersion,this.userId=e.userId,this.deviceId=e.deviceId,this.sessionId=e.sessionId,this.flushIntervalMillis=e.flushIntervalMillis||o.flushIntervalMillis,this.flushMaxRetries=e.flushMaxRetries||o.flushMaxRetries,this.flushQueueSize=e.flushQueueSize||o.flushQueueSize,this.loggerProvider=e.loggerProvider||o.loggerProvider,this.logLevel=null!==(t=e.logLevel)&&void 0!==t?t:o.logLevel,this.partnerId=e.partnerId,this.plugins=o.plugins,this.optOut=null!==(i=e.optOut)&&void 0!==i?i:o.optOut,this.saveEvents=null!==(n=e.saveEvents)&&void 0!==n?n:o.saveEvents,this.serverUrl=e.serverUrl,this.serverZone=e.serverZone||o.serverZone,this.storageProvider=e.storageProvider,this.transportProvider=e.transportProvider,this.useBatch=null!==(r=e.useBatch)&&void 0!==r?r:o.useBatch,this.loggerProvider.enable(this.logLevel);var s=V(e.serverZone,e.useBatch);this.serverZone=s.serverZone,this.serverUrl=s.serverUrl},F=function(e,t){return e===f.ServerZone.EU?t?"https://api.eu.amplitude.com/batch":"https://api.eu.amplitude.com/2/httpapi":t?"https://api2.amplitude.com/batch":E},V=function(e,t){void 0===e&&(e=B().serverZone),void 0===t&&(t=B().useBatch);var i=[f.ServerZone.US,f.ServerZone.EU].includes(e)?e:B().serverZone;return{serverZone:i,serverUrl:F(i,t)}},Z=function(){function e(){this.name="amplitude",this.type=f.PluginType.DESTINATION,this.backoff=1e3,this.throttle=3e4,this.storageKey="",this.backup=new Set,this.scheduled=!1,this.queue=[]}return e.prototype.setup=function(e){var t=this;this.config=e,this.storageKey="".concat(_,"_").concat(this.config.apiKey.substring(0,10));var i=this.config.storageProvider.get(this.storageKey);return this.snapshot(),i&&i.length>0&&Promise.all(i.map((function(e){return t.execute(e)}))).catch(),Promise.resolve(void 0)},e.prototype.execute=function(e){var t=this;return new Promise((function(i){var n={event:e,attempts:0,callback:function(e){return i(e)},delay:0};t.addToQueue(n)}))},e.prototype.addToQueue=function(){for(var e=this,t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];var n=t.filter((function(t){return t.attempts<e.config.flushMaxRetries||(e.fulfillRequest([t],500,f.Status.Unknown),!1)}));this.addToBackup.apply(this,u([],a(n.map((function(e){return e.event}))),!1)),n.forEach((function(t){t.attempts+=1;var i=t.delay;if(t.delay=0,1===t.attempts&&!t.delay)return e.queue=e.queue.concat(t),void e.schedule(e.config.flushIntervalMillis);setTimeout((function(){e.queue=e.queue.concat(t),e.schedule(e.config.flushIntervalMillis)}),i||t.attempts*e.backoff)}))},e.prototype.schedule=function(e){var t=this;this.scheduled||(this.scheduled=!0,setTimeout((function(){t.flush().then((function(){t.scheduled=!1,t.queue.length>0&&t.schedule(e)}))}),e))},e.prototype.flush=function(){return r(this,void 0,void 0,(function(){var e,t,i=this;return o(this,(function(n){switch(n.label){case 0:return e=this.queue,this.queue=[],r=e,o=this.config.flushQueueSize,s=Math.max(o,1),t=r.reduce((function(e,t,i){var n=Math.floor(i/s);return e[n]||(e[n]=[]),e[n].push(t),e}),[]),[4,Promise.all(t.map((function(e){return i.send(e)})))];case 1:return n.sent(),[2]}var r,o,s}))}))},e.prototype.send=function(e){return r(this,void 0,void 0,(function(){var t,i,n,r;return o(this,(function(o){switch(o.label){case 0:if(!this.config.apiKey)return[2,this.fulfillRequest(e,400,"Event rejected due to missing API key")];t={api_key:this.config.apiKey,events:e.map((function(e){return e.event}))},o.label=1;case 1:return o.trys.push([1,3,,4]),i=V(this.config.serverZone,this.config.useBatch).serverUrl,[4,this.config.transportProvider.send(i,t)];case 2:return null===(n=o.sent())?(this.fulfillRequest(e,0,"Unexpected error occurred"),[2]):(this.handleReponse(n,e),[3,4]);case 3:return r=o.sent(),this.fulfillRequest(e,0,String(r)),[3,4];case 4:return[2]}}))}))},e.prototype.handleReponse=function(e,t){switch(e.status){case f.Status.Success:this.handleSuccessResponse(e,t);break;case f.Status.Invalid:this.handleInvalidResponse(e,t);break;case f.Status.PayloadTooLarge:this.handlePayloadTooLargeResponse(e,t);break;case f.Status.RateLimit:this.handleRateLimitResponse(e,t);break;default:this.handleOtherReponse(t)}},e.prototype.handleSuccessResponse=function(e,t){this.fulfillRequest(t,e.statusCode,"Event tracked successfully")},e.prototype.handleInvalidResponse=function(e,t){var i=this;if(e.body.missingField)this.fulfillRequest(t,e.statusCode,e.body.error);else{var n=u(u(u(u([],a(Object.values(e.body.eventsWithInvalidFields)),!1),a(Object.values(e.body.eventsWithMissingFields)),!1),a(Object.values(e.body.eventsWithInvalidIdLengths)),!1),a(e.body.silencedEvents),!1).flat(),r=new Set(n),o=t.filter((function(t,n){if(!r.has(n))return!0;i.fulfillRequest([t],e.statusCode,e.body.error)}));this.addToQueue.apply(this,u([],a(o),!1))}},e.prototype.handlePayloadTooLargeResponse=function(e,t){1!==t.length?(this.config.flushQueueSize/=2,this.addToQueue.apply(this,u([],a(t),!1))):this.fulfillRequest(t,e.statusCode,e.body.error)},e.prototype.handleRateLimitResponse=function(e,t){var i=this,n=Object.keys(e.body.exceededDailyQuotaUsers),r=Object.keys(e.body.exceededDailyQuotaDevices),o=e.body.throttledEvents,s=new Set(n),l=new Set(r),c=new Set(o),d=t.filter((function(t,n){if(!(t.event.user_id&&s.has(t.event.user_id)||t.event.device_id&&l.has(t.event.device_id)))return c.has(n)&&(t.delay=i.throttle),!0;i.fulfillRequest([t],e.statusCode,e.body.error)}));this.addToQueue.apply(this,u([],a(d),!1))},e.prototype.handleOtherReponse=function(e){this.addToQueue.apply(this,u([],a(e),!1))},e.prototype.fulfillRequest=function(e,t,i){this.removeFromBackup.apply(this,u([],a(e.map((function(e){return e.event}))),!1)),e.forEach((function(e){return e.callback(O(e.event,t,i))}))},e.prototype.addToBackup=function(){for(var e=this,t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];this.config.saveEvents&&(t.forEach((function(t){return e.backup.add(t)})),this.snapshot())},e.prototype.removeFromBackup=function(){for(var e=this,t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];this.config.saveEvents&&(t.forEach((function(t){return e.backup.delete(t)})),this.snapshot())},e.prototype.snapshot=function(){if(this.config.saveEvents){var e=Array.from(this.backup);this.config.storageProvider.set(this.storageKey,e)}},e}(),$=function(e){return function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];return{promise:e.apply(void 0,u([],a(t),!1))}}},Q=function(e,t){W(e,t)},W=function(e,t){for(var i=0;i<t.length;i++){var n=t[i],r=n.name,o=n.args,s=n.resolve,a=e&&e[r];if("function"==typeof a){var u=a.apply(e,o);"function"==typeof s&&s(null==u?void 0:u.promise)}}return e},G=function(e){return e&&void 0!==e._q},H={exports:{}};!function(e,t){!function(i,n){var r="function",o="undefined",s="object",a="string",u="model",l="name",c="type",d="vendor",p="version",f="architecture",v="console",h="mobile",b="tablet",g="smarttv",y="wearable",w="embedded",m="Amazon",S="Apple",_="ASUS",E="BlackBerry",T="Firefox",k="Google",I="Huawei",O="LG",x="Microsoft",P="Motorola",R="Opera",N="Samsung",U="Sony",L="Xiaomi",j="Zebra",q=function(e){for(var t={},i=0;i<e.length;i++)t[e[i].toUpperCase()]=e[i];return t},A=function(e,t){return typeof e===a&&-1!==D(t).indexOf(D(e))},D=function(e){return e.toLowerCase()},C=function(e,t){if(typeof e===a)return e=e.replace(/^\s+|\s+$/g,""),typeof t===o?e:e.substring(0,255)},M=function(e,t){for(var i,o,a,u,l,c,d=0;d<t.length&&!l;){var p=t[d],f=t[d+1];for(i=o=0;i<p.length&&!l;)if(l=p[i++].exec(e))for(a=0;a<f.length;a++)c=l[++o],typeof(u=f[a])===s&&u.length>0?2==u.length?typeof u[1]==r?this[u[0]]=u[1].call(this,c):this[u[0]]=u[1]:3==u.length?typeof u[1]!==r||u[1].exec&&u[1].test?this[u[0]]=c?c.replace(u[1],u[2]):n:this[u[0]]=c?u[1].call(this,c,u[2]):n:4==u.length&&(this[u[0]]=c?u[3].call(this,c.replace(u[1],u[2])):n):this[u]=c||n;d+=2}},B=function(e,t){for(var i in t)if(typeof t[i]===s&&t[i].length>0){for(var r=0;r<t[i].length;r++)if(A(t[i][r],e))return"?"===i?n:i}else if(A(t[i],e))return"?"===i?n:i;return e},z={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},F={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[p,[l,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[p,[l,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[l,p],[/opios[\/ ]+([\w\.]+)/i],[p,[l,"Opera Mini"]],[/\bopr\/([\w\.]+)/i],[p,[l,R]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i,/(ba?idubrowser)[\/ ]?([\w\.]+)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale|qqbrowserlite|qq)\/([-\w\.]+)/i,/(weibo)__([\d\.]+)/i],[l,p],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[p,[l,"UCBrowser"]],[/\bqbcore\/([\w\.]+)/i],[p,[l,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[p,[l,"WeChat"]],[/konqueror\/([\w\.]+)/i],[p,[l,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[p,[l,"IE"]],[/yabrowser\/([\w\.]+)/i],[p,[l,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[l,/(.+)/,"$1 Secure Browser"],p],[/\bfocus\/([\w\.]+)/i],[p,[l,"Firefox Focus"]],[/\bopt\/([\w\.]+)/i],[p,[l,"Opera Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[p,[l,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[p,[l,"Dolphin"]],[/coast\/([\w\.]+)/i],[p,[l,"Opera Coast"]],[/miuibrowser\/([\w\.]+)/i],[p,[l,"MIUI Browser"]],[/fxios\/([-\w\.]+)/i],[p,[l,T]],[/\bqihu|(qi?ho?o?|360)browser/i],[[l,"360 Browser"]],[/(oculus|samsung|sailfish)browser\/([\w\.]+)/i],[[l,/(.+)/,"$1 Browser"],p],[/(comodo_dragon)\/([\w\.]+)/i],[[l,/_/g," "],p],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[l,p],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i],[l],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[l,"Facebook"],p],[/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/ ]([-\w\.]+)/i],[l,p],[/\bgsa\/([\w\.]+) .*safari\//i],[p,[l,"GSA"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[p,[l,"Chrome Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[l,"Chrome WebView"],p],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[p,[l,"Android Browser"]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[l,p],[/version\/([\w\.]+) .*mobile\/\w+ (safari)/i],[p,[l,"Mobile Safari"]],[/version\/([\w\.]+) .*(mobile ?safari|safari)/i],[p,l],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[l,[p,B,{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}]],[/(webkit|khtml)\/([\w\.]+)/i],[l,p],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[l,"Netscape"],p],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[p,[l,"Firefox Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i],[l,p]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[f,"amd64"]],[/(ia32(?=;))/i],[[f,D]],[/((?:i[346]|x)86)[;\)]/i],[[f,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[f,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[f,"armhf"]],[/windows (ce|mobile); ppc;/i],[[f,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[f,/ower/,"",D]],[/(sun4\w)[;\)]/i],[[f,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[f,D]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[pt]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[u,[d,N],[c,b]],[/\b((?:s[cgp]h|gt|sm)-\w+|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[u,[d,N],[c,h]],[/((ipod|iphone)\d+,\d+)/i],[u,[d,S],[c,h]],[/(ipad\d+,\d+)/i],[u,[d,S],[c,b]],[/\((ip(?:hone|od)[\w ]*);/i],[u,[d,S],[c,h]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[u,[d,S],[c,b]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[u,[d,I],[c,b]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}-[atu]?[ln][01259x][012359][an]?)\b(?!.+d\/s)/i],[u,[d,I],[c,h]],[/\b(poco[\w ]+)(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[u,/_/g," "],[d,L],[c,h]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[u,/_/g," "],[d,L],[c,b]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007)\b/i],[u,[d,"OPPO"],[c,h]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[u,[d,"Vivo"],[c,h]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[u,[d,"Realme"],[c,h]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[u,[d,P],[c,h]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[u,[d,P],[c,b]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[u,[d,O],[c,b]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[u,[d,O],[c,h]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[u,[d,"Lenovo"],[c,b]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[u,/_/g," "],[d,"Nokia"],[c,h]],[/(pixel c)\b/i],[u,[d,k],[c,b]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[u,[d,k],[c,h]],[/droid.+ ([c-g]\d{4}|so[-l]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[u,[d,U],[c,h]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[u,"Xperia Tablet"],[d,U],[c,b]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[u,[d,"OnePlus"],[c,h]],[/(alexa)webm/i,/(kf[a-z]{2}wi)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[u,[d,m],[c,b]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[u,/(.+)/g,"Fire Phone $1"],[d,m],[c,h]],[/(playbook);[-\w\),; ]+(rim)/i],[u,d,[c,b]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[u,[d,E],[c,h]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[u,[d,_],[c,b]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[u,[d,_],[c,h]],[/(nexus 9)/i],[u,[d,"HTC"],[c,b]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic|sony)[-_ ]?([-\w]*)/i],[d,[u,/_/g," "],[c,h]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[u,[d,"Acer"],[c,b]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[u,[d,"Meizu"],[c,h]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[u,[d,"Sharp"],[c,h]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[d,u,[c,h]],[/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[d,u,[c,b]],[/(surface duo)/i],[u,[d,x],[c,b]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[u,[d,"Fairphone"],[c,h]],[/(u304aa)/i],[u,[d,"AT&T"],[c,h]],[/\bsie-(\w*)/i],[u,[d,"Siemens"],[c,h]],[/\b(rct\w+) b/i],[u,[d,"RCA"],[c,b]],[/\b(venue[\d ]{2,7}) b/i],[u,[d,"Dell"],[c,b]],[/\b(q(?:mv|ta)\w+) b/i],[u,[d,"Verizon"],[c,b]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[u,[d,"Barnes & Noble"],[c,b]],[/\b(tm\d{3}\w+) b/i],[u,[d,"NuVision"],[c,b]],[/\b(k88) b/i],[u,[d,"ZTE"],[c,b]],[/\b(nx\d{3}j) b/i],[u,[d,"ZTE"],[c,h]],[/\b(gen\d{3}) b.+49h/i],[u,[d,"Swiss"],[c,h]],[/\b(zur\d{3}) b/i],[u,[d,"Swiss"],[c,b]],[/\b((zeki)?tb.*\b) b/i],[u,[d,"Zeki"],[c,b]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[d,"Dragon Touch"],u,[c,b]],[/\b(ns-?\w{0,9}) b/i],[u,[d,"Insignia"],[c,b]],[/\b((nxa|next)-?\w{0,9}) b/i],[u,[d,"NextBook"],[c,b]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[d,"Voice"],u,[c,h]],[/\b(lvtel\-)?(v1[12]) b/i],[[d,"LvTel"],u,[c,h]],[/\b(ph-1) /i],[u,[d,"Essential"],[c,h]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[u,[d,"Envizen"],[c,b]],[/\b(trio[-\w\. ]+) b/i],[u,[d,"MachSpeed"],[c,b]],[/\btu_(1491) b/i],[u,[d,"Rotor"],[c,b]],[/(shield[\w ]+) b/i],[u,[d,"Nvidia"],[c,b]],[/(sprint) (\w+)/i],[d,u,[c,h]],[/(kin\.[onetw]{3})/i],[[u,/\./g," "],[d,x],[c,h]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[u,[d,j],[c,b]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[u,[d,j],[c,h]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[d,u,[c,v]],[/droid.+; (shield) bui/i],[u,[d,"Nvidia"],[c,v]],[/(playstation [345portablevi]+)/i],[u,[d,U],[c,v]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[u,[d,x],[c,v]],[/smart-tv.+(samsung)/i],[d,[c,g]],[/hbbtv.+maple;(\d+)/i],[[u,/^/,"SmartTV"],[d,N],[c,g]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[d,O],[c,g]],[/(apple) ?tv/i],[d,[u,"Apple TV"],[c,g]],[/crkey/i],[[u,"Chromecast"],[d,k],[c,g]],[/droid.+aft(\w)( bui|\))/i],[u,[d,m],[c,g]],[/\(dtv[\);].+(aquos)/i],[u,[d,"Sharp"],[c,g]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w ]*; *(\w[^;]*);([^;]*)/i],[[d,C],[u,C],[c,g]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[c,g]],[/((pebble))app/i],[d,u,[c,y]],[/droid.+; (glass) \d/i],[u,[d,k],[c,y]],[/droid.+; (wt63?0{2,3})\)/i],[u,[d,j],[c,y]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[d,[c,w]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[u,[c,h]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[u,[c,b]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[c,b]],[/(phone|mobile(?:[;\/]| safari)|pda(?=.+windows ce))/i],[[c,h]],[/(android[-\w\. ]{0,9});.+buil/i],[u,[d,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[p,[l,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[p,[l,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i],[l,p],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[p,l]],os:[[/microsoft (windows) (vista|xp)/i],[l,p],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[l,[p,B,z]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[l,"Windows"],[p,B,z]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/cfnetwork\/.+darwin/i],[[p,/_/g,"."],[l,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[l,"Mac OS"],[p,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86)/i],[p,l],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[l,p],[/\(bb(10);/i],[p,[l,E]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[p,[l,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[p,[l,"Firefox OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[p,[l,"webOS"]],[/crkey\/([\d\.]+)/i],[p,[l,"Chromecast"]],[/(cros) [\w]+ ([\w\.]+\w)/i],[[l,"Chromium OS"],p],[/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[l,p],[/(sunos) ?([\w\.\d]*)/i],[[l,"Solaris"],p],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux)/i,/(unix) ?([\w\.]*)/i],[l,p]]},V=function(e,t){if(typeof e===s&&(t=e,e=n),!(this instanceof V))return new V(e,t).getResult();var r=e||(typeof i!==o&&i.navigator&&i.navigator.userAgent?i.navigator.userAgent:""),u=t?function(e,t){var i={};for(var n in e)t[n]&&t[n].length%2==0?i[n]=t[n].concat(e[n]):i[n]=e[n];return i}(F,t):F;return this.getBrowser=function(){var e,t={};return t.name=n,t.version=n,M.call(t,r,u.browser),t.major=typeof(e=t.version)===a?e.replace(/[^\d\.]/g,"").split(".")[0]:n,t},this.getCPU=function(){var e={};return e.architecture=n,M.call(e,r,u.cpu),e},this.getDevice=function(){var e={};return e.vendor=n,e.model=n,e.type=n,M.call(e,r,u.device),e},this.getEngine=function(){var e={};return e.name=n,e.version=n,M.call(e,r,u.engine),e},this.getOS=function(){var e={};return e.name=n,e.version=n,M.call(e,r,u.os),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return r},this.setUA=function(e){return r=typeof e===a&&e.length>255?C(e,255):e,this},this.setUA(r),this};V.VERSION="0.7.28",V.BROWSER=q([l,p,"major"]),V.CPU=q([f]),V.DEVICE=q([u,d,c,v,h,g,b,y,w]),V.ENGINE=V.OS=q([l,p]),e.exports&&(t=e.exports=V),t.UAParser=V;var Z=typeof i!==o&&(i.jQuery||i.Zepto);if(Z&&!Z.ua){var $=new V;Z.ua=$.getResult(),Z.ua.get=function(){return $.getUA()},Z.ua.set=function(e){$.setUA(e);var t=$.getResult();for(var i in t)Z.ua[i]=t[i]}}}("object"==typeof window?window:l)}(H,H.exports);var K=H.exports,J=function(e){return e?(e^16*Math.random()>>e/4).toString(16):(String(1e7)+String(-1e3)+String(-4e3)+String(-8e3)+String(-1e11)).replace(/[018]/g,J)},Y=function(){var e,t,i,n;if("undefined"==typeof navigator)return"";var r=navigator.userLanguage;return null!==(n=null!==(i=null!==(t=null===(e=navigator.languages)||void 0===e?void 0:e[0])&&void 0!==t?t:navigator.language)&&void 0!==i?i:r)&&void 0!==n?n:""},X=function(e,t){var i,n=ee(e.apiKey);e.cookieStorage.set(n,{userId:e.userId,deviceId:e.deviceId,sessionId:e.sessionId,lastEventTime:null!=t?t:null===(i=e.cookieStorage.get(n))||void 0===i?void 0:i.lastEventTime,optOut:Boolean(e.optOut)})},ee=function(e,t){return void 0===t&&(t=10),"".concat(S,"_").concat(e.substring(0,t))},te=function(){function e(){var e;this.name="context",this.type=f.PluginType.BEFORE,this.eventId=0,this.library="amplitude-ts/".concat("0.4.0"),"undefined"!=typeof navigator&&(e=navigator.userAgent),this.uaResult=new K(e).getResult()}return e.prototype.setup=function(e){return this.config=e,Promise.resolve(void 0)},e.prototype.execute=function(e){var t=this;return new Promise((function(i){var r=(new Date).getTime(),o=t.uaResult.browser.name,s=t.uaResult.browser.version,a=t.uaResult.device.model||t.uaResult.os.name,u=t.uaResult.device.vendor;return function(e){var t,i=ee(e.apiKey),n=null===(t=e.cookieStorage.get(i))||void 0===t?void 0:t.lastEventTime,r=Date.now();n&&r-n>=e.sessionTimeout&&(e.sessionId=r,X(e))}(t.config),X(t.config,r),i(n(n(n(n(n(n(n(n(n(n(n({user_id:t.config.userId,device_id:t.config.deviceId,session_id:t.config.sessionId,time:r},t.config.appVersion&&{app_version:t.config.appVersion}),t.config.trackingOptions.platform&&{platform:"Web"}),t.config.trackingOptions.osName&&{os_name:o}),t.config.trackingOptions.osVersion&&{os_version:s}),t.config.trackingOptions.deviceManufacturer&&{device_manufacturer:u}),t.config.trackingOptions.deviceModel&&{device_model:a}),t.config.trackingOptions.language&&{language:Y()}),t.config.trackingOptions.ipAddress&&{ip:"$remote"}),{insert_id:J(),partner_id:t.config.partnerId}),e),{event_id:t.eventId++,library:t.library}))}))},e}(),ie=function(){function e(e){this.options=n({},e)}return e.prototype.isEnabled=function(){if("undefined"==typeof window)return!1;var t=String(Date.now()),i=new e,n="AMP_TEST";try{return i.set(n,t),i.get(n)===t}catch(e){return!1}finally{i.remove(n)}},e.prototype.get=function(e){var t=this.getRaw(e);if(t)try{return JSON.parse(t)}catch(e){return}},e.prototype.getRaw=function(e){var t=window.document.cookie.split("; ").find((function(t){return 0===t.indexOf(e+"=")}));if(t)return t.substring(e.length+1)},e.prototype.set=function(e,t){var i;try{var n=null!==(i=this.options.expirationDays)&&void 0!==i?i:0,r=null!==t?n:-1,o=void 0;if(r){var s=new Date;s.setTime(s.getTime()+24*r*60*60*1e3),o=s}var a="".concat(e,"=").concat(JSON.stringify(t));o&&(a+="; expires=".concat(o.toUTCString())),a+="; path=/",this.options.domain&&(a+="; domain=".concat(this.options.domain)),this.options.secure&&(a+="; Secure"),this.options.sameSite&&(a+="; SameSite=".concat(this.options.sameSite)),window.document.cookie=a}catch(e){}},e.prototype.remove=function(e){this.set(e,null)},e.prototype.reset=function(){},e}(),ne=function(){function e(){}return e.prototype.send=function(e,t){return r(this,void 0,void 0,(function(){var i,n;return o(this,(function(r){switch(r.label){case 0:if("undefined"==typeof fetch)throw new Error("FetchTransport is not supported");return i={headers:{"Content-Type":"application/json",Accept:"*/*"},body:JSON.stringify(t),method:"POST"},[4,fetch(e,i)];case 1:return[4,r.sent().json()];case 2:return n=r.sent(),[2,A(n)]}}))}))},e}(),re=function(){function e(){}return e.prototype.isEnabled=function(){if("undefined"==typeof window)return!1;var t=String(Date.now()),i=new e,n="AMP_TEST";try{return i.set(n,t),i.get(n)===t}catch(e){return!1}finally{i.remove(n)}},e.prototype.get=function(e){try{var t=this.getRaw(e);if(!t)return;return JSON.parse(t)}catch(e){return}},e.prototype.getRaw=function(e){return window.localStorage.getItem(e)||void 0},e.prototype.set=function(e,t){try{window.localStorage.setItem(e,JSON.stringify(t))}catch(e){}},e.prototype.remove=function(e){try{window.localStorage.removeItem(e)}catch(e){}},e.prototype.reset=function(){try{window.localStorage.clear()}catch(e){}},e}(),oe=function(){function e(){this.memoryStorage=new Map}return e.prototype.isEnabled=function(){return!0},e.prototype.get=function(e){return this.memoryStorage.get(e)},e.prototype.getRaw=function(e){var t=this.get(e);return t?JSON.stringify(t):void 0},e.prototype.set=function(e,t){this.memoryStorage.set(e,t)},e.prototype.remove=function(e){this.memoryStorage.delete(e)},e.prototype.reset=function(){this.memoryStorage.clear()},e}(),se=function(){return"undefined"==typeof window?{}:window.location.search.substring(1).split("&").filter(Boolean).reduce((function(e,t){var i=a(t.split("=",2),2),n=i[0],r=i[1],o=void 0===r?"":r;return o?(e[decodeURIComponent(n)]=decodeURIComponent(o),e):e}),{})},ae=function(){function e(){this.state={done:4}}return e.prototype.send=function(e,t){return r(this,void 0,void 0,(function(){var i=this;return o(this,(function(n){return[2,new Promise((function(n,r){"undefined"==typeof XMLHttpRequest&&r(new Error("XHRTransport is not supported."));var o=new XMLHttpRequest;o.open("POST",e,!0),o.onreadystatechange=function(){if(o.readyState===i.state.done)try{var e=o.responseText,t=JSON.parse(e),s=A(t);n(s)}catch(e){r(e)}},o.setRequestHeader("Content-Type","application/json"),o.setRequestHeader("Accept","*/*"),o.send(JSON.stringify(t))}))]}))}))},e}(),ue=function(){function e(){}return e.prototype.send=function(e,t){return r(this,void 0,void 0,(function(){return o(this,(function(i){return[2,new Promise((function(i,n){if("undefined"==typeof window||void 0===window.navigator||void 0===window.navigator.sendBeacon)throw new Error("SendBeaconTransport is not supported");try{var r=JSON.stringify(t);return i(window.navigator.sendBeacon(e,JSON.stringify(t))?A({code:200,events_ingested:t.events.length,payload_size_bytes:r.length,server_upload_time:Date.now()}):A({code:500}))}catch(e){n(e)}}))]}))}))},e}(),le=function(){return{cookieExpiration:365,cookieSameSite:"Lax",cookieSecure:!1,cookieStorage:new oe,disableCookies:!1,domain:"",includeGclid:!0,includeFbclid:!0,includeReferrer:!0,includeUtm:!0,sessionTimeout:18e5,storageProvider:new oe,trackingOptions:{city:!0,country:!0,carrier:!0,deviceManufacturer:!0,deviceModel:!0,dma:!0,ipAddress:!0,language:!0,osName:!0,osVersion:!0,platform:!0,region:!0,versionName:!0},transportProvider:new ne}},ce=function(e){function t(t,i,r){var o,s,a,u,l,c,d,p,f,v,h,b,g,y,w=this,m=le();return(w=e.call(this,n(n({},r),{apiKey:t,userId:i,optOut:Boolean(null==r?void 0:r.optOut),storageProvider:null!==(o=null==r?void 0:r.storageProvider)&&void 0!==o?o:m.storageProvider,transportProvider:null!==(s=null==r?void 0:r.transportProvider)&&void 0!==s?s:m.transportProvider}))||this).cookieExpiration=null!==(a=null==r?void 0:r.cookieExpiration)&&void 0!==a?a:m.cookieExpiration,w.cookieSameSite=null!==(u=null==r?void 0:r.cookieSameSite)&&void 0!==u?u:m.cookieSameSite,w.cookieSecure=null!==(l=null==r?void 0:r.cookieSecure)&&void 0!==l?l:m.cookieSecure,w.cookieStorage=null!==(c=null==r?void 0:r.cookieStorage)&&void 0!==c?c:m.cookieStorage,w.disableCookies=null!==(d=null==r?void 0:r.disableCookies)&&void 0!==d?d:m.disableCookies,w.domain=null!==(p=null==r?void 0:r.domain)&&void 0!==p?p:m.domain,w.includeGclid=null!==(f=null==r?void 0:r.includeGclid)&&void 0!==f?f:m.includeGclid,w.includeFbclid=null!==(v=null==r?void 0:r.includeFbclid)&&void 0!==v?v:m.includeFbclid,w.includeReferrer=null!==(h=null==r?void 0:r.includeReferrer)&&void 0!==h?h:m.includeReferrer,w.includeUtm=null!==(b=null==r?void 0:r.includeUtm)&&void 0!==b?b:m.includeUtm,w.sessionTimeout=null!==(g=null==r?void 0:r.sessionTimeout)&&void 0!==g?g:m.sessionTimeout,w.trackingOptions=null!==(y=null==r?void 0:r.trackingOptions)&&void 0!==y?y:m.trackingOptions,w}return i(t,e),t}(z),de=function(e,t){void 0===t&&(t=le());var i=n(n({},t),e),r=null==e?void 0:e.cookieStorage;return r&&r.isEnabled()||(r=new ie({domain:i.domain,expirationDays:i.cookieExpiration,sameSite:i.cookieSameSite,secure:i.cookieSecure}),!i.disableCookies&&r.isEnabled()||(r=new re).isEnabled()||(r=new oe)),r},pe=function(e){var t=null==e?void 0:e.storageProvider;return t&&t.isEnabled()||(t=new re).isEnabled()||(t=new oe),t},fe=function(e,t,i){return t||i||e||J()},ve=function(e,t,i,n){return void 0===e&&(e=0),void 0===t&&(t=0),void 0===i&&(i=0),e&&Date.now()-i<n?e:t||Date.now()},he=function(e){return e===f.TransportType.XHR?new ae:e===f.TransportType.SendBeacon?new ue:le().transportProvider},be=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.get=function(e){try{var t=this.getRaw(e);if(!t)return;return t.split(".").splice(-1)[0].split("|").reduce((function(e,t){var i=a(t.split("=",2),2),n=i[0],r=i[1],o=void 0===r?"":r;return o?(e[n]=decodeURIComponent(o),e):e}),{})}catch(e){return}},t.prototype.set=function(){},t}(ie),ge=function(){var e=se(),t=new be,i=t.isEnabled()&&t.get("__utmz")||{},n=e.utm_source||i.utmcsr,r=e.utm_medium||i.utmcmd,o=e.utm_campaign||i.utmccn,s=e.utm_term||i.utmctr,a=e.utm_content||i.utmcct,u={};return n&&(u.utm_source=n),r&&(u.utm_medium=r),o&&(u.utm_campaign=o),s&&(u.utm_term=s),a&&(u.utm_content=a),u},ye=function(){var e,t={};try{var i=document.referrer||void 0,n=null!==(e=null==i?void 0:i.split("/")[2])&&void 0!==e?e:void 0;void 0!==i&&(t.referrer=i),void 0!==n&&(t.referring_domain=n)}catch(e){}return t},we=function(){var e,t=se();return n({},t.gclid&&((e={}).gclid=t.gclid,e))},me=function(){var e,t=se();return n({},t.fbclid&&((e={}).fbclid=t.fbclid,e))},Se=function(e,t){var i=new ie;if(i.isEnabled()&&!(null==t?void 0:t.disableCookies)||(i=new re),!i.isEnabled())return{optOut:!1};var n=function(e){return"".concat(S.toLowerCase(),"_").concat(e.substring(0,6))}(e),r=i.getRaw(n);if(!r)return{optOut:!1};i.remove(n);var o=a(r.split("."),5),s=o[0],u=o[1],l=o[2],c=o[3],d=o[4];return{deviceId:s,userId:Ee(u),sessionId:_e(c),lastEventTime:_e(d),optOut:Boolean(l)}},_e=function(e){var t=parseInt(e,32);if(!isNaN(t))return t},Ee=function(e){if(atob&&escape&&e)try{return decodeURIComponent(escape(atob(e)))}catch(e){return}},Te=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.init=function(t,i,s){var a,u,l;return r(this,void 0,void 0,(function(){var r,c;return o(this,(function(o){switch(o.label){case 0:return r=Se(t,s),c=function(e,t,i){var r,o,s,a=le(),u=de(i),l=ee(e),c=u.get(l),d=se(),p=null!==(r=null==i?void 0:i.sessionTimeout)&&void 0!==r?r:a.sessionTimeout;return new ce(e,null!=t?t:null==c?void 0:c.userId,n(n({},i),{cookieStorage:u,sessionTimeout:p,deviceId:fe(null==c?void 0:c.deviceId,null==i?void 0:i.deviceId,d.deviceId),optOut:null!==(o=null==i?void 0:i.optOut)&&void 0!==o?o:Boolean(null==c?void 0:c.optOut),sessionId:ve(null==c?void 0:c.sessionId,null==i?void 0:i.sessionId,null==c?void 0:c.lastEventTime,p),storageProvider:pe(i),trackingOptions:n(n({},a.trackingOptions),null==i?void 0:i.trackingOptions),transportProvider:null!==(s=null==i?void 0:i.transportProvider)&&void 0!==s?s:he(null==i?void 0:i.transport)}))}(t,i||r.userId,n(n({},s),{deviceId:null!==(a=r.deviceId)&&void 0!==a?a:null==s?void 0:s.deviceId,sessionId:null!==(u=r.sessionId)&&void 0!==u?u:null==s?void 0:s.sessionId,optOut:null!==(l=null==s?void 0:s.optOut)&&void 0!==l?l:r.optOut})),[4,e.prototype.init.call(this,void 0,void 0,c)];case 1:return o.sent(),X(this.config,r.lastEventTime),[4,this.add(new te)];case 2:return o.sent(),[4,this.add(new Z)];case 3:return o.sent(),this.trackAttributions(),[2]}}))}))},t.prototype.getUserId=function(){return this.config.userId},t.prototype.setUserId=function(e){this.config.userId=e,X(this.config)},t.prototype.getDeviceId=function(){return this.config.deviceId},t.prototype.setDeviceId=function(e){this.config.deviceId=e,X(this.config)},t.prototype.getSessionId=function(){return this.config.sessionId},t.prototype.setSessionId=function(e){this.config.sessionId=e,X(this.config)},t.prototype.setOptOut=function(t){e.prototype.setOptOut.call(this,t),X(this.config)},t.prototype.setTransport=function(e){this.config.transportProvider=he(e)},t.prototype.identify=function(t,i){if(G(t)){var n=t._q;t._q=[],t=W(new I,n)}return e.prototype.identify.call(this,t,i)},t.prototype.groupIdentify=function(t,i,n,r){if(G(n)){var o=n._q;n._q=[],n=W(new I,o)}return e.prototype.groupIdentify.call(this,t,i,n,r)},t.prototype.revenue=function(t,i){if(G(t)){var n=t._q;t._q=[],t=W(new D,n)}return e.prototype.revenue.call(this,t,i)},t.prototype.trackAttributions=function(){var e=function(e){return n(n(n(n({},e.includeUtm&&ge()),e.includeReferrer&&ye()),e.includeGclid&&we()),e.includeFbclid&&me())}(this.config);if(0!==Object.keys(e).length){var t=new I;return Object.entries(e).forEach((function(e){var i=a(e,2),n=i[0],r=i[1];r&&(t.setOnce("initial_".concat(n),r),t.set(n,r))})),this.identify(t)}},t}(q),ke=new Te,Ie=$(ke.init.bind(ke)),Oe=$(ke.add.bind(ke)),xe=$(ke.remove.bind(ke)),Pe=$(ke.track.bind(ke)),Re=$(ke.logEvent.bind(ke)),Ne=$(ke.identify.bind(ke)),Ue=$(ke.groupIdentify.bind(ke)),Le=$(ke.setGroup.bind(ke)),je=$(ke.revenue.bind(ke)),qe=ke.getUserId.bind(ke),Ae=ke.setUserId.bind(ke),De=ke.getDeviceId.bind(ke),Ce=ke.setDeviceId.bind(ke),Me=ke.getSessionId.bind(ke),Be=ke.setSessionId.bind(ke),ze=ke.setOptOut.bind(ke),Fe=ke.setTransport.bind(ke),Ve=Object.freeze({__proto__:null,Types:m,add:Oe,getDeviceId:De,getSessionId:Me,getUserId:qe,groupIdentify:Ue,identify:Ne,init:Ie,logEvent:Re,remove:xe,revenue:je,setDeviceId:Ce,setGroup:Le,setOptOut:ze,setSessionId:Be,setTransport:Fe,setUserId:Ae,track:Pe,runQueuedFunctions:Q,Revenue:D,Identify:I});if(globalThis.amplitude=Object.assign(globalThis.amplitude||{},Ve),globalThis.amplitude.invoked){var Ze=globalThis.amplitude._q;globalThis.amplitude._q=[],Q(Ve,Ze)}}(); |
@@ -15,2 +15,2 @@ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).amplitude={})}(this,(function(e){"use strict";function t(e,t){return t.forEach((function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach((function(i){if("default"!==i&&!(i in e)){var n=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(e,i,n.get?n:{enumerable:!0,get:function(){return t[i]}})}}))})),Object.freeze(e)} | ||
PERFORMANCE OF THIS SOFTWARE. | ||
***************************************************************************** */var i=function(e,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},i(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}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var r=function(){return r=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},r.apply(this,arguments)};function o(e,t,i,n){return new(i||(i=Promise))((function(r,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))}function s(e,t){var i,n,r,o,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(i)throw new TypeError("Generator is already executing.");for(;s;)try{if(i=1,n&&(r=2&o[0]?n.return:o[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,o[1])).done)return r;switch(n=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(r=s.trys,(r=r.length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){s.label=o[1];break}if(6===o[0]&&s.label<r[1]){s.label=r[1],r=o;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(o);break}r[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],n=0}finally{i=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}}function a(e){var t="function"==typeof Symbol&&Symbol.iterator,i=t&&e[t],n=0;if(i)return i.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function u(e,t){var i="function"==typeof Symbol&&e[Symbol.iterator];if(!i)return e;var n,r,o=i.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){r={error:e}}finally{try{n&&!n.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}return s}function c(e,t,i){if(i||2===arguments.length)for(var n,r=0,o=t.length;r<o;r++)!n&&r in t||(n||(n=Array.prototype.slice.call(t,0,r)),n[r]=t[r]);return e.concat(n||Array.prototype.slice.call(t))}var l="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function d(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var p={},f={};!function(e){var t;Object.defineProperty(e,"__esModule",{value:!0}),e.ServerZone=void 0,(t=e.ServerZone||(e.ServerZone={})).US="US",t.EU="EU"}(f);var v={};!function(e){var t,i,n;Object.defineProperty(e,"__esModule",{value:!0}),e.SpecialEventType=e.RevenueProperty=e.IdentifyOperation=void 0,(t=e.IdentifyOperation||(e.IdentifyOperation={})).SET="$set",t.SET_ONCE="$setOnce",t.ADD="$add",t.APPEND="$append",t.PREPEND="$prepend",t.REMOVE="$remove",t.PREINSERT="$preInsert",t.POSTINSERT="$postInsert",t.UNSET="$unset",t.CLEAR_ALL="$clearAll",(i=e.RevenueProperty||(e.RevenueProperty={})).REVENUE_PRODUCT_ID="$productId",i.REVENUE_QUANTITY="$quantity",i.REVENUE_PRICE="$price",i.REVENUE_TYPE="$revenueType",i.REVENUE="$revenue",(n=e.SpecialEventType||(e.SpecialEventType={})).IDENTIFY="$identify",n.GROUP_IDENTIFY="$groupidentify",n.REVENUE="revenue_amount"}(v);var h={};!function(e){var t;Object.defineProperty(e,"__esModule",{value:!0}),e.LogLevel=void 0,(t=e.LogLevel||(e.LogLevel={}))[t.None=0]="None",t[t.Error=1]="Error",t[t.Warn=2]="Warn",t[t.Verbose=3]="Verbose"}(h);var b={};!function(e){var t;Object.defineProperty(e,"__esModule",{value:!0}),e.PluginType=void 0,(t=e.PluginType||(e.PluginType={})).BEFORE="before",t.ENRICHMENT="enrichment",t.DESTINATION="destination"}(b);var y={};!function(e){var t;Object.defineProperty(e,"__esModule",{value:!0}),e.Status=void 0,(t=e.Status||(e.Status={})).Unknown="unknown",t.Skipped="skipped",t.Success="success",t.RateLimit="rate_limit",t.PayloadTooLarge="payload_too_large",t.Invalid="invalid",t.Failed="failed",t.Timeout="Timeout",t.SystemError="SystemError"}(y);var g={};!function(e){var t;Object.defineProperty(e,"__esModule",{value:!0}),e.TransportType=void 0,(t=e.TransportType||(e.TransportType={})).XHR="xhr",t.SendBeacon="beacon",t.Fetch="fetch"}(g),function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.TransportType=e.Status=e.PluginType=e.LogLevel=e.RevenueProperty=e.IdentifyOperation=e.SpecialEventType=e.ServerZone=void 0;var t=f;Object.defineProperty(e,"ServerZone",{enumerable:!0,get:function(){return t.ServerZone}});var i=v;Object.defineProperty(e,"SpecialEventType",{enumerable:!0,get:function(){return i.SpecialEventType}}),Object.defineProperty(e,"IdentifyOperation",{enumerable:!0,get:function(){return i.IdentifyOperation}}),Object.defineProperty(e,"RevenueProperty",{enumerable:!0,get:function(){return i.RevenueProperty}});var n=h;Object.defineProperty(e,"LogLevel",{enumerable:!0,get:function(){return n.LogLevel}});var r=b;Object.defineProperty(e,"PluginType",{enumerable:!0,get:function(){return r.PluginType}});var o=y;Object.defineProperty(e,"Status",{enumerable:!0,get:function(){return o.Status}});var s=g;Object.defineProperty(e,"TransportType",{enumerable:!0,get:function(){return s.TransportType}})}(p);var w,m=t({__proto__:null,default:d(p)},[p]),S="".concat("AMP","_unsent"),_="https://api2.amplitude.com/2/httpapi",E="Amplitude Logger ",T=function(){function e(){this.logLevel=p.LogLevel.None}return e.prototype.disable=function(){this.logLevel=p.LogLevel.None},e.prototype.enable=function(e){void 0===e&&(e=p.LogLevel.Warn),this.logLevel=e},e.prototype.log=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<p.LogLevel.Verbose||console.log("".concat(E,"[Log]: ").concat(e.join(" ")))},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<p.LogLevel.Warn||console.warn("".concat(E,"[Warn]: ").concat(e.join(" ")))},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<p.LogLevel.Error||console.error("".concat(E,"[Error]: ").concat(e.join(" ")))},e}(),k={},O=((w={})[p.ServerZone.US]=function(e){return e?"https://api2.amplitude.com/batch":_},w[p.ServerZone.EU]=function(e){return e?"https://api.eu.amplitude.com/batch":"https://api.eu.amplitude.com/2/httpapi"},w),x={flushMaxRetries:5,flushQueueSize:10,flushIntervalMillis:1e3,logLevel:p.LogLevel.Warn,loggerProvider:new T,saveEvents:!0,optOut:!1,serverUrl:_,serverZone:p.ServerZone.US,useBatch:!1},I=function(e){var t,i,n,r;this.apiKey=e.apiKey,this.userId=e.userId,this.deviceId=e.deviceId,this.sessionId=e.sessionId,this.flushIntervalMillis=e.flushIntervalMillis||x.flushIntervalMillis,this.flushMaxRetries=e.flushMaxRetries||x.flushMaxRetries,this.flushQueueSize=e.flushQueueSize||x.flushQueueSize,this.loggerProvider=e.loggerProvider||x.loggerProvider,this.logLevel=null!==(t=e.logLevel)&&void 0!==t?t:x.logLevel,this.partnerId=e.partnerId,this.plugins=[],this.optOut=null!==(i=e.optOut)&&void 0!==i?i:x.optOut,this.saveEvents=null!==(n=e.saveEvents)&&void 0!==n?n:x.saveEvents,this.serverUrl=e.serverUrl,this.serverZone=e.serverZone||x.serverZone,this.storageProvider=e.storageProvider,this.transportProvider=e.transportProvider,this.useBatch=null!==(r=e.useBatch)&&void 0!==r?r:x.useBatch,this.loggerProvider.enable(this.logLevel),N(this)},P=function(){return k.default},R=function(e){return N(e)},N=function(e){return e.serverUrl||([p.ServerZone.US,p.ServerZone.EU].includes(e.serverZone)||(e.loggerProvider.warn('Unknown server zone "'.concat(e.serverZone,'". Replaced with US server zone')),e.serverZone=p.ServerZone.US),e.serverUrl=O[e.serverZone](e.useBatch)),e.serverUrl},U=function(e){if(Object.keys(e).length>1e3)return!1;for(var t in e){var i=e[t];if(!L(t,i))return!1}return!0},L=function(e,t){var i,n;if("string"!=typeof e)return!1;if(Array.isArray(t))try{for(var r=a(t),o=r.next();!o.done;o=r.next()){var s=o.value;if(Array.isArray(s))return!1;if("object"==typeof s)return U(t);if(!["number","string"].includes(typeof s))return!1}}catch(e){i={error:e}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}else{if("object"==typeof t)return U(t);if(!["number","string","boolean"].includes(typeof t))return!1}return!0},j=function(){function e(){this._propertySet=new Set,this._properties={}}return e.prototype.getUserProperties=function(){return r({},this._properties)},e.prototype.set=function(e,t){return this._safeSet(p.IdentifyOperation.SET,e,t),this},e.prototype.setOnce=function(e,t){return this._safeSet(p.IdentifyOperation.SET_ONCE,e,t),this},e.prototype.append=function(e,t){return this._safeSet(p.IdentifyOperation.APPEND,e,t),this},e.prototype.prepend=function(e,t){return this._safeSet(p.IdentifyOperation.PREPEND,e,t),this},e.prototype.postInsert=function(e,t){return this._safeSet(p.IdentifyOperation.POSTINSERT,e,t),this},e.prototype.preInsert=function(e,t){return this._safeSet(p.IdentifyOperation.PREINSERT,e,t),this},e.prototype.remove=function(e,t){return this._safeSet(p.IdentifyOperation.REMOVE,e,t),this},e.prototype.add=function(e,t){return this._safeSet(p.IdentifyOperation.ADD,e,t),this},e.prototype.unset=function(e){return this._safeSet(p.IdentifyOperation.UNSET,e,"-"),this},e.prototype.clearAll=function(){return this._properties={},this._properties[p.IdentifyOperation.CLEAR_ALL]="-",this},e.prototype._safeSet=function(e,t,i){if(this._validate(e,t,i)){var n=this._properties[e];return void 0===n&&(n={},this._properties[e]=n),n[t]=i,this._propertySet.add(t),!0}return!1},e.prototype._validate=function(e,t,i){return void 0===this._properties[p.IdentifyOperation.CLEAR_ALL]&&(!this._propertySet.has(t)&&(e===p.IdentifyOperation.ADD?"number"==typeof i:e===p.IdentifyOperation.UNSET||e===p.IdentifyOperation.REMOVE||L(t,i)))},e}(),q=function(e,t,i){return void 0===t&&(t=0),void 0===i&&(i=p.Status.Unknown),{event:e,code:t,message:i}},A=[],C=!1,D=function(e,t){return o(void 0,void 0,void 0,(function(){return s(this,(function(i){switch(i.label){case 0:return[4,e.setup(t)];case 1:return i.sent(),t.plugins.push(e),[2]}}))}))},M=function(e,t){return t.plugins.splice(t.plugins.findIndex((function(t){return t.name===e})),1),Promise.resolve()},B=function(e,t){return new Promise((function(i){t.optOut?i(q(e,0,"Event skipped due to optOut config")):(A.push([e,i,t.plugins]),z(0))}))},z=function(e){C||(C=!0,setTimeout((function(){F().then((function(){C=!1,A.length>0&&z(0)}))}),e))},F=function(){return o(void 0,void 0,void 0,(function(){var e,t,i,n,o,c,l,d,f,v,h,b,y,g,w,m,S,_,E,T;return s(this,(function(s){switch(s.label){case 0:if(!(e=A.shift()))return[2];t=u(e,1),i=t[0],n=u(e,3),o=n[1],c=n[2],l=c.filter((function(e){return e.type===p.PluginType.BEFORE})),s.label=1;case 1:s.trys.push([1,6,7,8]),d=a(l),f=d.next(),s.label=2;case 2:return f.done?[3,5]:[4,f.value.execute(r({},i))];case 3:i=s.sent(),s.label=4;case 4:return f=d.next(),[3,2];case 5:return[3,8];case 6:return v=s.sent(),S={error:v},[3,8];case 7:try{f&&!f.done&&(_=d.return)&&_.call(d)}finally{if(S)throw S.error}return[7];case 8:h=c.filter((function(e){return e.type===p.PluginType.ENRICHMENT})),s.label=9;case 9:s.trys.push([9,14,15,16]),b=a(h),y=b.next(),s.label=10;case 10:return y.done?[3,13]:[4,y.value.execute(r({},i))];case 11:i=s.sent(),s.label=12;case 12:return y=b.next(),[3,10];case 13:return[3,16];case 14:return g=s.sent(),E={error:g},[3,16];case 15:try{y&&!y.done&&(T=b.return)&&T.call(b)}finally{if(E)throw E.error}return[7];case 16:return w=c.filter((function(e){return e.type===p.PluginType.DESTINATION})),m=w.map((function(e){var t=r({},i);return e.execute(t).catch((function(e){return q(t,0,String(e))}))})),Promise.all(m).then((function(e){var t=u(e,1)[0];o(t)})),[2]}}))}))},V=function(e){return function(e){return k.default=k.default?Object.assign(k.default,e):e,k.default}(e)},Z=function(e,t,i){var n=P(),o=function(e,t,i){return r(r(r({},i),{event_type:e}),t&&{event_properties:t})}(e,t,i);return Y(o,n)},$=function(e,t,i,n){var o=P(),s=function(e,t,i,n){var o=r(r({},n),{event_type:p.SpecialEventType.IDENTIFY,user_properties:i.getUserProperties(),user_id:e});return void 0!==t&&t.length>0&&(o.device_id=t),o}(e,t,i,n);return Y(s,o)},Q=function(e,t,i,n,o,s){var a=P(),u=function(e,t,i,n,o,s){var a,u=r(r({},s),{event_type:p.SpecialEventType.GROUP_IDENTIFY,group_properties:o.getUserProperties(),groups:(a={},a[i]=n,a),user_id:e});return void 0!==t&&t.length>0&&(u.device_id=t),u}(e,t,i,n,o,s);return Y(u,a)},K=function(e,t){var i=P(),n=function(e,t){var i,n=new j;return n.set(e,t),{event_type:p.SpecialEventType.IDENTIFY,user_properties:n.getUserProperties(),groups:(i={},i[e]=t,i)}}(e,t);return Y(n,i)},W=function(e,t){var i=P(),n=function(e,t){return r(r({},t),{event_type:p.SpecialEventType.REVENUE,event_properties:e.getEventProperties()})}(e,t);return Y(n,i)},G=function(e){return o(void 0,void 0,void 0,(function(){var t;return s(this,(function(i){return t=P(),[2,D(e,t)]}))}))},H=function(e){return o(void 0,void 0,void 0,(function(){var t;return s(this,(function(i){return t=P(),[2,M(e,t)]}))}))},Y=function(e,t){return o(void 0,void 0,void 0,(function(){var i,n,r;return s(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,B(e,t)];case 1:return 200===(i=o.sent()).code?t.loggerProvider.log(i.message):t.loggerProvider.error(i.message),[2,i];case 2:return n=o.sent(),r=String(n),t.loggerProvider.error(r),[2,q(e,0,r)];case 3:return[2]}}))}))};var J=function(e){var t,i,n,r,o,s,a,u,c,l,d,f,v,h,b,y,g,w,m,S,_;if("object"!=typeof e)return null;var E,T=e.code||0,k=(E=T)>=200&&E<300?p.Status.Success:429===E?p.Status.RateLimit:413===E?p.Status.PayloadTooLarge:408===E?p.Status.Timeout:E>=400&&E<500?p.Status.Invalid:E>=500?p.Status.Failed:p.Status.Unknown;switch(k){case p.Status.Success:return{status:k,statusCode:T,body:{eventsIngested:null!==(t=e.events_ingested)&&void 0!==t?t:0,payloadSizeBytes:null!==(i=e.payload_size_bytes)&&void 0!==i?i:0,serverUploadTime:null!==(n=e.server_upload_time)&&void 0!==n?n:0}};case p.Status.Invalid:return{status:k,statusCode:T,body:{error:null!==(r=e.error)&&void 0!==r?r:"",missingField:null!==(o=e.missing_field)&&void 0!==o?o:"",eventsWithInvalidFields:null!==(s=e.events_with_invalid_fields)&&void 0!==s?s:{},eventsWithMissingFields:null!==(a=e.events_with_missing_fields)&&void 0!==a?a:{},epsThreshold:null!==(u=e.eps_threshold)&&void 0!==u?u:0,exceededDailyQuotaDevices:null!==(c=e.exceeded_daily_quota_devices)&&void 0!==c?c:{},silencedDevices:null!==(l=e.silenced_devices)&&void 0!==l?l:[],silencedEvents:null!==(d=e.silenced_events)&&void 0!==d?d:[],throttledDevices:null!==(f=e.throttled_devices)&&void 0!==f?f:{},throttledEvents:null!==(v=e.throttled_events)&&void 0!==v?v:[]}};case p.Status.PayloadTooLarge:return{status:k,statusCode:T,body:{error:null!==(h=e.error)&&void 0!==h?h:""}};case p.Status.RateLimit:return{status:k,statusCode:T,body:{error:null!==(b=e.error)&&void 0!==b?b:"",epsThreshold:null!==(y=e.eps_threshold)&&void 0!==y?y:0,throttledDevices:null!==(g=e.throttled_devices)&&void 0!==g?g:{},throttledUsers:null!==(w=e.throttled_users)&&void 0!==w?w:{},exceededDailyQuotaDevices:null!==(m=e.exceeded_daily_quota_devices)&&void 0!==m?m:{},exceededDailyQuotaUsers:null!==(S=e.exceeded_daily_quota_users)&&void 0!==S?S:{},throttledEvents:null!==(_=e.throttled_events)&&void 0!==_?_:[]}};case p.Status.Timeout:default:return{status:k,statusCode:T}}},X=function(){function e(){this.productId="",this.quantity=1,this.price=0}return e.prototype.setProductId=function(e){return this.productId=e,this},e.prototype.setQuantity=function(e){return e>0&&(this.quantity=e),this},e.prototype.setPrice=function(e){return this.price=e,this},e.prototype.setRevenueType=function(e){return this.revenueType=e,this},e.prototype.setRevenue=function(e){return this.revenue=e,this},e.prototype.setEventProperties=function(e){return U(e)&&(this.properties=e),this},e.prototype.getEventProperties=function(){var e=this.properties?r({},this.properties):{};return e[p.RevenueProperty.REVENUE_PRODUCT_ID]=this.productId,e[p.RevenueProperty.REVENUE_QUANTITY]=this.quantity,e[p.RevenueProperty.REVENUE_PRICE]=this.price,e[p.RevenueProperty.REVENUE_TYPE]=this.revenueType,e[p.RevenueProperty.REVENUE]=this.revenue,e},e}(),ee=function(){function e(){this.name="amplitude",this.type=p.PluginType.DESTINATION,this.backoff=1e3,this.throttle=3e4,this.storageKey="",this.backup=new Set,this.scheduled=!1,this.queue=[]}return e.prototype.setup=function(e){var t=this;this.config=e,this.storageKey="".concat(S,"_").concat(this.config.apiKey.substring(0,10));var i=this.config.storageProvider.get(this.storageKey);return this.snapshot(),i&&i.length>0&&Promise.all(i.map((function(e){return t.execute(e)}))).catch(),Promise.resolve(void 0)},e.prototype.execute=function(e){var t=this;return new Promise((function(i){var n={event:e,attempts:0,callback:function(e){return i(e)},delay:0};t.addToQueue(n)}))},e.prototype.addToQueue=function(){for(var e=this,t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];var n=t.filter((function(t){return t.attempts<e.config.flushMaxRetries||(e.fulfillRequest([t],500,p.Status.Unknown),!1)}));this.addToBackup.apply(this,c([],u(n.map((function(e){return e.event}))),!1)),n.forEach((function(t){t.attempts+=1;var i=t.delay;if(t.delay=0,1===t.attempts&&!t.delay)return e.queue=e.queue.concat(t),void e.schedule(e.config.flushIntervalMillis);setTimeout((function(){e.queue=e.queue.concat(t),e.schedule(e.config.flushIntervalMillis)}),i||t.attempts*e.backoff)}))},e.prototype.schedule=function(e){var t=this;this.scheduled||(this.scheduled=!0,setTimeout((function(){t.flush().then((function(){t.scheduled=!1,t.queue.length>0&&t.schedule(e)}))}),e))},e.prototype.flush=function(){return o(this,void 0,void 0,(function(){var e,t,i=this;return s(this,(function(n){switch(n.label){case 0:return e=this.queue,this.queue=[],r=e,o=this.config.flushQueueSize,s=Math.max(o,1),t=r.reduce((function(e,t,i){var n=Math.floor(i/s);return e[n]||(e[n]=[]),e[n].push(t),e}),[]),[4,Promise.all(t.map((function(e){return i.send(e)})))];case 1:return n.sent(),[2]}var r,o,s}))}))},e.prototype.send=function(e){return o(this,void 0,void 0,(function(){var t,i,n;return s(this,(function(r){switch(r.label){case 0:if(!this.config.apiKey)return[2,this.fulfillRequest(e,400,"Event skipped due to optOut config")];t={api_key:this.config.apiKey,events:e.map((function(e){return e.event}))},r.label=1;case 1:return r.trys.push([1,3,,4]),[4,this.config.transportProvider.send(R(this.config),t)];case 2:return null===(i=r.sent())?(this.fulfillRequest(e,0,"Unexpected error occurred"),[2]):(this.handleReponse(i,e),[3,4]);case 3:return n=r.sent(),this.fulfillRequest(e,0,String(n)),[3,4];case 4:return[2]}}))}))},e.prototype.handleReponse=function(e,t){switch(e.status){case p.Status.Success:this.handleSuccessResponse(e,t);break;case p.Status.Invalid:this.handleInvalidResponse(e,t);break;case p.Status.PayloadTooLarge:this.handlePayloadTooLargeResponse(e,t);break;case p.Status.RateLimit:this.handleRateLimitResponse(e,t);break;default:this.handleOtherReponse(t)}},e.prototype.handleSuccessResponse=function(e,t){this.fulfillRequest(t,e.statusCode,"Event tracked successfully")},e.prototype.handleInvalidResponse=function(e,t){var i=this;if(e.body.missingField)this.fulfillRequest(t,e.statusCode,e.body.error);else{var n=c(c(c([],u(Object.values(e.body.eventsWithInvalidFields)),!1),u(Object.values(e.body.eventsWithMissingFields)),!1),u(e.body.silencedEvents),!1).flat(),r=new Set(n),o=t.filter((function(t,n){if(!r.has(n))return!0;i.fulfillRequest([t],e.statusCode,e.body.error)}));this.addToQueue.apply(this,c([],u(o),!1))}},e.prototype.handlePayloadTooLargeResponse=function(e,t){1!==t.length?(this.config.flushQueueSize/=2,this.addToQueue.apply(this,c([],u(t),!1))):this.fulfillRequest(t,e.statusCode,e.body.error)},e.prototype.handleRateLimitResponse=function(e,t){var i=this,n=Object.keys(e.body.exceededDailyQuotaUsers),r=Object.keys(e.body.exceededDailyQuotaDevices),o=e.body.throttledEvents,s=new Set(n),a=new Set(r),l=new Set(o),d=t.filter((function(t,n){if(!(t.event.user_id&&s.has(t.event.user_id)||t.event.device_id&&a.has(t.event.device_id)))return l.has(n)&&(t.delay=i.throttle),!0;i.fulfillRequest([t],e.statusCode,e.body.error)}));this.addToQueue.apply(this,c([],u(d),!1))},e.prototype.handleOtherReponse=function(e){this.addToQueue.apply(this,c([],u(e),!1))},e.prototype.fulfillRequest=function(e,t,i){this.removeFromBackup.apply(this,c([],u(e.map((function(e){return e.event}))),!1)),e.forEach((function(e){return e.callback(q(e.event,t,i))}))},e.prototype.addToBackup=function(){for(var e=this,t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];this.config.saveEvents&&(t.forEach((function(t){return e.backup.add(t)})),this.snapshot())},e.prototype.removeFromBackup=function(){for(var e=this,t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];this.config.saveEvents&&(t.forEach((function(t){return e.backup.delete(t)})),this.snapshot())},e.prototype.snapshot=function(){if(this.config.saveEvents){var e=Array.from(this.backup);this.config.storageProvider.set(this.storageKey,e)}},e}(),te=function(e,t){for(var i=0;i<t.length;i++){var n=t[i],r=n.name,o=n.args,s=n.resolve,a=e&&e[r];if("function"==typeof a){var u=a.apply(e,o);"function"==typeof s&&s(null==u?void 0:u.promise)}}return e},ie=function(e){return e&&void 0!==e._q},ne={exports:{}};!function(e,t){!function(i,n){var r="function",o="undefined",s="object",a="string",u="model",c="name",l="type",d="vendor",p="version",f="architecture",v="console",h="mobile",b="tablet",y="smarttv",g="wearable",w="embedded",m="Amazon",S="Apple",_="ASUS",E="BlackBerry",T="Firefox",k="Google",O="Huawei",x="LG",I="Microsoft",P="Motorola",R="Opera",N="Samsung",U="Sony",L="Xiaomi",j="Zebra",q=function(e){for(var t={},i=0;i<e.length;i++)t[e[i].toUpperCase()]=e[i];return t},A=function(e,t){return typeof e===a&&-1!==C(t).indexOf(C(e))},C=function(e){return e.toLowerCase()},D=function(e,t){if(typeof e===a)return e=e.replace(/^\s+|\s+$/g,""),typeof t===o?e:e.substring(0,255)},M=function(e,t){for(var i,o,a,u,c,l,d=0;d<t.length&&!c;){var p=t[d],f=t[d+1];for(i=o=0;i<p.length&&!c;)if(c=p[i++].exec(e))for(a=0;a<f.length;a++)l=c[++o],typeof(u=f[a])===s&&u.length>0?2==u.length?typeof u[1]==r?this[u[0]]=u[1].call(this,l):this[u[0]]=u[1]:3==u.length?typeof u[1]!==r||u[1].exec&&u[1].test?this[u[0]]=l?l.replace(u[1],u[2]):n:this[u[0]]=l?u[1].call(this,l,u[2]):n:4==u.length&&(this[u[0]]=l?u[3].call(this,l.replace(u[1],u[2])):n):this[u]=l||n;d+=2}},B=function(e,t){for(var i in t)if(typeof t[i]===s&&t[i].length>0){for(var r=0;r<t[i].length;r++)if(A(t[i][r],e))return"?"===i?n:i}else if(A(t[i],e))return"?"===i?n:i;return e},z={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},F={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[p,[c,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[p,[c,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[c,p],[/opios[\/ ]+([\w\.]+)/i],[p,[c,"Opera Mini"]],[/\bopr\/([\w\.]+)/i],[p,[c,R]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i,/(ba?idubrowser)[\/ ]?([\w\.]+)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale|qqbrowserlite|qq)\/([-\w\.]+)/i,/(weibo)__([\d\.]+)/i],[c,p],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[p,[c,"UCBrowser"]],[/\bqbcore\/([\w\.]+)/i],[p,[c,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[p,[c,"WeChat"]],[/konqueror\/([\w\.]+)/i],[p,[c,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[p,[c,"IE"]],[/yabrowser\/([\w\.]+)/i],[p,[c,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[c,/(.+)/,"$1 Secure Browser"],p],[/\bfocus\/([\w\.]+)/i],[p,[c,"Firefox Focus"]],[/\bopt\/([\w\.]+)/i],[p,[c,"Opera Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[p,[c,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[p,[c,"Dolphin"]],[/coast\/([\w\.]+)/i],[p,[c,"Opera Coast"]],[/miuibrowser\/([\w\.]+)/i],[p,[c,"MIUI Browser"]],[/fxios\/([-\w\.]+)/i],[p,[c,T]],[/\bqihu|(qi?ho?o?|360)browser/i],[[c,"360 Browser"]],[/(oculus|samsung|sailfish)browser\/([\w\.]+)/i],[[c,/(.+)/,"$1 Browser"],p],[/(comodo_dragon)\/([\w\.]+)/i],[[c,/_/g," "],p],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[c,p],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i],[c],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[c,"Facebook"],p],[/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/ ]([-\w\.]+)/i],[c,p],[/\bgsa\/([\w\.]+) .*safari\//i],[p,[c,"GSA"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[p,[c,"Chrome Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[c,"Chrome WebView"],p],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[p,[c,"Android Browser"]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[c,p],[/version\/([\w\.]+) .*mobile\/\w+ (safari)/i],[p,[c,"Mobile Safari"]],[/version\/([\w\.]+) .*(mobile ?safari|safari)/i],[p,c],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[c,[p,B,{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}]],[/(webkit|khtml)\/([\w\.]+)/i],[c,p],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[c,"Netscape"],p],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[p,[c,"Firefox Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i],[c,p]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[f,"amd64"]],[/(ia32(?=;))/i],[[f,C]],[/((?:i[346]|x)86)[;\)]/i],[[f,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[f,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[f,"armhf"]],[/windows (ce|mobile); ppc;/i],[[f,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[f,/ower/,"",C]],[/(sun4\w)[;\)]/i],[[f,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[f,C]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[pt]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[u,[d,N],[l,b]],[/\b((?:s[cgp]h|gt|sm)-\w+|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[u,[d,N],[l,h]],[/((ipod|iphone)\d+,\d+)/i],[u,[d,S],[l,h]],[/(ipad\d+,\d+)/i],[u,[d,S],[l,b]],[/\((ip(?:hone|od)[\w ]*);/i],[u,[d,S],[l,h]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[u,[d,S],[l,b]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[u,[d,O],[l,b]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}-[atu]?[ln][01259x][012359][an]?)\b(?!.+d\/s)/i],[u,[d,O],[l,h]],[/\b(poco[\w ]+)(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[u,/_/g," "],[d,L],[l,h]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[u,/_/g," "],[d,L],[l,b]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007)\b/i],[u,[d,"OPPO"],[l,h]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[u,[d,"Vivo"],[l,h]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[u,[d,"Realme"],[l,h]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[u,[d,P],[l,h]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[u,[d,P],[l,b]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[u,[d,x],[l,b]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[u,[d,x],[l,h]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[u,[d,"Lenovo"],[l,b]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[u,/_/g," "],[d,"Nokia"],[l,h]],[/(pixel c)\b/i],[u,[d,k],[l,b]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[u,[d,k],[l,h]],[/droid.+ ([c-g]\d{4}|so[-l]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[u,[d,U],[l,h]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[u,"Xperia Tablet"],[d,U],[l,b]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[u,[d,"OnePlus"],[l,h]],[/(alexa)webm/i,/(kf[a-z]{2}wi)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[u,[d,m],[l,b]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[u,/(.+)/g,"Fire Phone $1"],[d,m],[l,h]],[/(playbook);[-\w\),; ]+(rim)/i],[u,d,[l,b]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[u,[d,E],[l,h]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[u,[d,_],[l,b]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[u,[d,_],[l,h]],[/(nexus 9)/i],[u,[d,"HTC"],[l,b]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic|sony)[-_ ]?([-\w]*)/i],[d,[u,/_/g," "],[l,h]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[u,[d,"Acer"],[l,b]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[u,[d,"Meizu"],[l,h]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[u,[d,"Sharp"],[l,h]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[d,u,[l,h]],[/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[d,u,[l,b]],[/(surface duo)/i],[u,[d,I],[l,b]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[u,[d,"Fairphone"],[l,h]],[/(u304aa)/i],[u,[d,"AT&T"],[l,h]],[/\bsie-(\w*)/i],[u,[d,"Siemens"],[l,h]],[/\b(rct\w+) b/i],[u,[d,"RCA"],[l,b]],[/\b(venue[\d ]{2,7}) b/i],[u,[d,"Dell"],[l,b]],[/\b(q(?:mv|ta)\w+) b/i],[u,[d,"Verizon"],[l,b]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[u,[d,"Barnes & Noble"],[l,b]],[/\b(tm\d{3}\w+) b/i],[u,[d,"NuVision"],[l,b]],[/\b(k88) b/i],[u,[d,"ZTE"],[l,b]],[/\b(nx\d{3}j) b/i],[u,[d,"ZTE"],[l,h]],[/\b(gen\d{3}) b.+49h/i],[u,[d,"Swiss"],[l,h]],[/\b(zur\d{3}) b/i],[u,[d,"Swiss"],[l,b]],[/\b((zeki)?tb.*\b) b/i],[u,[d,"Zeki"],[l,b]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[d,"Dragon Touch"],u,[l,b]],[/\b(ns-?\w{0,9}) b/i],[u,[d,"Insignia"],[l,b]],[/\b((nxa|next)-?\w{0,9}) b/i],[u,[d,"NextBook"],[l,b]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[d,"Voice"],u,[l,h]],[/\b(lvtel\-)?(v1[12]) b/i],[[d,"LvTel"],u,[l,h]],[/\b(ph-1) /i],[u,[d,"Essential"],[l,h]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[u,[d,"Envizen"],[l,b]],[/\b(trio[-\w\. ]+) b/i],[u,[d,"MachSpeed"],[l,b]],[/\btu_(1491) b/i],[u,[d,"Rotor"],[l,b]],[/(shield[\w ]+) b/i],[u,[d,"Nvidia"],[l,b]],[/(sprint) (\w+)/i],[d,u,[l,h]],[/(kin\.[onetw]{3})/i],[[u,/\./g," "],[d,I],[l,h]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[u,[d,j],[l,b]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[u,[d,j],[l,h]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[d,u,[l,v]],[/droid.+; (shield) bui/i],[u,[d,"Nvidia"],[l,v]],[/(playstation [345portablevi]+)/i],[u,[d,U],[l,v]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[u,[d,I],[l,v]],[/smart-tv.+(samsung)/i],[d,[l,y]],[/hbbtv.+maple;(\d+)/i],[[u,/^/,"SmartTV"],[d,N],[l,y]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[d,x],[l,y]],[/(apple) ?tv/i],[d,[u,"Apple TV"],[l,y]],[/crkey/i],[[u,"Chromecast"],[d,k],[l,y]],[/droid.+aft(\w)( bui|\))/i],[u,[d,m],[l,y]],[/\(dtv[\);].+(aquos)/i],[u,[d,"Sharp"],[l,y]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w ]*; *(\w[^;]*);([^;]*)/i],[[d,D],[u,D],[l,y]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[l,y]],[/((pebble))app/i],[d,u,[l,g]],[/droid.+; (glass) \d/i],[u,[d,k],[l,g]],[/droid.+; (wt63?0{2,3})\)/i],[u,[d,j],[l,g]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[d,[l,w]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[u,[l,h]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[u,[l,b]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[l,b]],[/(phone|mobile(?:[;\/]| safari)|pda(?=.+windows ce))/i],[[l,h]],[/(android[-\w\. ]{0,9});.+buil/i],[u,[d,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[p,[c,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[p,[c,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i],[c,p],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[p,c]],os:[[/microsoft (windows) (vista|xp)/i],[c,p],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[c,[p,B,z]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[c,"Windows"],[p,B,z]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/cfnetwork\/.+darwin/i],[[p,/_/g,"."],[c,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[c,"Mac OS"],[p,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86)/i],[p,c],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[c,p],[/\(bb(10);/i],[p,[c,E]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[p,[c,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[p,[c,"Firefox OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[p,[c,"webOS"]],[/crkey\/([\d\.]+)/i],[p,[c,"Chromecast"]],[/(cros) [\w]+ ([\w\.]+\w)/i],[[c,"Chromium OS"],p],[/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[c,p],[/(sunos) ?([\w\.\d]*)/i],[[c,"Solaris"],p],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux)/i,/(unix) ?([\w\.]*)/i],[c,p]]},V=function(e,t){if(typeof e===s&&(t=e,e=n),!(this instanceof V))return new V(e,t).getResult();var r=e||(typeof i!==o&&i.navigator&&i.navigator.userAgent?i.navigator.userAgent:""),u=t?function(e,t){var i={};for(var n in e)t[n]&&t[n].length%2==0?i[n]=t[n].concat(e[n]):i[n]=e[n];return i}(F,t):F;return this.getBrowser=function(){var e,t={};return t.name=n,t.version=n,M.call(t,r,u.browser),t.major=typeof(e=t.version)===a?e.replace(/[^\d\.]/g,"").split(".")[0]:n,t},this.getCPU=function(){var e={};return e.architecture=n,M.call(e,r,u.cpu),e},this.getDevice=function(){var e={};return e.vendor=n,e.model=n,e.type=n,M.call(e,r,u.device),e},this.getEngine=function(){var e={};return e.name=n,e.version=n,M.call(e,r,u.engine),e},this.getOS=function(){var e={};return e.name=n,e.version=n,M.call(e,r,u.os),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return r},this.setUA=function(e){return r=typeof e===a&&e.length>255?D(e,255):e,this},this.setUA(r),this};V.VERSION="0.7.28",V.BROWSER=q([c,p,"major"]),V.CPU=q([f]),V.DEVICE=q([u,d,l,v,h,y,b,g,w]),V.ENGINE=V.OS=q([c,p]),e.exports&&(t=e.exports=V),t.UAParser=V;var Z=typeof i!==o&&(i.jQuery||i.Zepto);if(Z&&!Z.ua){var $=new V;Z.ua=$.getResult(),Z.ua.get=function(){return $.getUA()},Z.ua.set=function(e){$.setUA(e);var t=$.getResult();for(var i in t)Z.ua[i]=t[i]}}}("object"==typeof window?window:l)}(ne,ne.exports);var re=ne.exports,oe=function(e){return e?(e^16*Math.random()>>e/4).toString(16):(String(1e7)+String(-1e3)+String(-4e3)+String(-8e3)+String(-1e11)).replace(/[018]/g,oe)},se=function(){var e,t,i,n;if("undefined"==typeof navigator)return"";var r=navigator.userLanguage;return null!==(n=null!==(i=null!==(t=null===(e=navigator.languages)||void 0===e?void 0:e[0])&&void 0!==t?t:navigator.language)&&void 0!==i?i:r)&&void 0!==n?n:""},ae=function(e){var t,i=ue(e.apiKey);e.cookieStorage.set(i,{userId:e.userId,deviceId:e.deviceId,sessionId:e.sessionId,lastEventTime:null===(t=e.cookieStorage.get(i))||void 0===t?void 0:t.lastEventTime,optOut:Boolean(e.optOut)})},ue=function(e){return"".concat("AMP","_").concat(e.substring(0,10))},ce=function(){function e(){var e;this.name="context",this.type=p.PluginType.BEFORE,this.eventId=0,this.library="amplitude-ts/".concat("0.3.1"),"undefined"!=typeof navigator&&(e=navigator.userAgent),this.uaResult=new re(e).getResult()}return e.prototype.setup=function(e){return this.config=e,Promise.resolve(void 0)},e.prototype.execute=function(e){var t=this;return new Promise((function(i){var n=(new Date).getTime(),o=t.uaResult.browser.name,s=t.uaResult.browser.version,a=t.uaResult.device.model||t.uaResult.os.name,u=t.uaResult.device.vendor;return function(e){var t,i=ue(e.apiKey),n=null===(t=e.cookieStorage.get(i))||void 0===t?void 0:t.lastEventTime,r=Date.now();n&&r-n>=e.sessionTimeout&&(e.sessionId=r,ae(e))}(t.config),function(e,t){var i=ue(e.apiKey);e.cookieStorage.set(i,{userId:e.userId,deviceId:e.deviceId,sessionId:e.sessionId,lastEventTime:t,optOut:Boolean(e.optOut)})}(t.config,n),i(r(r(r(r(r(r(r(r(r(r(r({user_id:t.config.userId,device_id:t.config.deviceId,session_id:t.config.sessionId,time:n},t.config.appVersion&&{app_version:t.config.appVersion}),t.config.trackingOptions.platform&&{platform:"Web"}),t.config.trackingOptions.osName&&{os_name:o}),t.config.trackingOptions.osVersion&&{os_version:s}),t.config.trackingOptions.deviceManufacturer&&{device_manufacturer:u}),t.config.trackingOptions.deviceModel&&{device_model:a}),t.config.trackingOptions.language&&{language:se()}),t.config.trackingOptions.ipAddress&&{ip:"$remote"}),{insert_id:oe(),partner_id:t.config.partnerId}),e),{event_id:t.eventId++,library:t.library}))}))},e}(),le=function(){function e(e){this.options=r({},e)}return e.prototype.isEnabled=function(){if("undefined"==typeof window)return!1;var t=String(Date.now()),i=new e,n="AMP_TEST";try{return i.set(n,t),i.get(n)===t}catch(e){return!1}finally{i.remove(n)}},e.prototype.get=function(e){try{var t=this.findByKey(e);return t?JSON.parse(t):void 0}catch(e){return}},e.prototype.findByKey=function(e){var t=window.document.cookie.split("; ").find((function(t){return 0===t.indexOf(e+"=")}));if(t)return t.substring(e.length+1)},e.prototype.set=function(e,t,i){try{var n=null!==t?null==i?void 0:i.expirationDays:-1,r=void 0;if(n){var o=new Date;o.setTime(o.getTime()+24*n*60*60*1e3),r=o}var s="".concat(e,"=").concat(JSON.stringify(t));r&&(s+="; expires=".concat(r.toUTCString())),s+="; path=/",(null==i?void 0:i.domain)&&(s+="; domain=".concat(i.domain)),(null==i?void 0:i.secure)&&(s+="; Secure"),(null==i?void 0:i.sameSite)&&(s+="; SameSite=".concat(i.sameSite)),window.document.cookie=s}catch(e){}},e.prototype.remove=function(e){this.set(e,null)},e.prototype.reset=function(){},e}(),de=function(){function e(){}return e.prototype.send=function(e,t){return o(this,void 0,void 0,(function(){var i,n;return s(this,(function(r){switch(r.label){case 0:if("undefined"==typeof fetch)throw new Error("FetchTransport is not supported");return i={headers:{"Content-Type":"application/json",Accept:"*/*"},body:JSON.stringify(t),method:"POST"},[4,fetch(e,i)];case 1:return[4,r.sent().json()];case 2:return n=r.sent(),[2,J(n)]}}))}))},e}(),pe=function(){function e(){}return e.prototype.isEnabled=function(){if("undefined"==typeof window)return!1;var t=String(Date.now()),i=new e,n="AMP_TEST";try{return i.set(n,t),i.get(n)===t}catch(e){return!1}finally{i.remove(n)}},e.prototype.get=function(e){try{var t=window.localStorage.getItem(e);if(!t)return;return JSON.parse(t)}catch(e){return}},e.prototype.set=function(e,t){try{window.localStorage.setItem(e,JSON.stringify(t))}catch(e){}},e.prototype.remove=function(e){try{window.localStorage.removeItem(e)}catch(e){}},e.prototype.reset=function(){try{window.localStorage.clear()}catch(e){}},e}(),fe=function(){function e(){this.memoryStorage=new Map}return e.prototype.isEnabled=function(){return!0},e.prototype.get=function(e){return this.memoryStorage.get(e)},e.prototype.set=function(e,t){this.memoryStorage.set(e,t)},e.prototype.remove=function(e){this.memoryStorage.delete(e)},e.prototype.reset=function(){this.memoryStorage.clear()},e}(),ve=function(){if("undefined"==typeof window)return{};var e=window.location.search.substring(1).split("&").filter(Boolean).reduce((function(e,t){var i=u(t.split("=",2),2),n=i[0],r=i[1],o=void 0===r?"":r;return o?(e[decodeURIComponent(n)]=decodeURIComponent(o),e):e}),{});return e},he=function(){function e(){this.state={done:4}}return e.prototype.send=function(e,t){return o(this,void 0,void 0,(function(){var i=this;return s(this,(function(n){return[2,new Promise((function(n,r){"undefined"==typeof XMLHttpRequest&&r(new Error("XHRTransport is not supported."));var o=new XMLHttpRequest;o.open("POST",e,!0),o.onreadystatechange=function(){if(o.readyState===i.state.done)try{var e=o.responseText,t=JSON.parse(e),s=J(t);n(s)}catch(e){r(e)}},o.setRequestHeader("Content-Type","application/json"),o.setRequestHeader("Accept","*/*"),o.send(JSON.stringify(t))}))]}))}))},e}(),be=function(){function e(){}return e.prototype.send=function(e,t){return o(this,void 0,void 0,(function(){return s(this,(function(i){return[2,new Promise((function(i,n){if("undefined"==typeof window||void 0===window.navigator||void 0===window.navigator.sendBeacon)throw new Error("SendBeaconTransport is not supported");try{var r=JSON.stringify(t);return i(window.navigator.sendBeacon(e,JSON.stringify(t))?J({code:200,events_ingested:t.events.length,payload_size_bytes:r.length,server_upload_time:Date.now()}):J({code:500}))}catch(e){n(e)}}))]}))}))},e}(),ye={cookieExpiration:365,cookieSameSite:"Lax",cookieSecure:!1,disableCookies:!1,domain:"",includeGclid:!0,includeFbclid:!0,includeReferrer:!0,includeUtm:!0,sessionTimeout:18e5,trackingOptions:{city:!0,country:!0,carrier:!0,deviceManufacturer:!0,deviceModel:!0,dma:!0,ipAddress:!0,language:!0,osName:!0,osVersion:!0,platform:!0,region:!0,versionName:!0},transportProvider:new de},ge=function(e){function t(t,i,n){var o,s,a,u,c,l,d,p,f,v,h,b=this,y=we(n),g=me(n),w=null!==(o=null==n?void 0:n.transportProvider)&&void 0!==o?o:Ee(null==n?void 0:n.transport),m=null!==(s=null==n?void 0:n.sessionTimeout)&&void 0!==s?s:ye.sessionTimeout,S=r(r({},ye.trackingOptions),null==n?void 0:n.trackingOptions),_=ue(t),E=y.get(_),T=ve();return(b=e.call(this,r(r({},n),{apiKey:t,storageProvider:g,transportProvider:w,userId:null!=i?i:null==E?void 0:E.userId,deviceId:Se(null==E?void 0:E.deviceId,null==n?void 0:n.deviceId,T.deviceId),sessionId:_e(null==E?void 0:E.sessionId,null==n?void 0:n.sessionId,null==E?void 0:E.lastEventTime,m),optOut:Boolean(null==E?void 0:E.optOut)}))||this).cookieExpiration=null!==(a=null==n?void 0:n.cookieExpiration)&&void 0!==a?a:ye.cookieExpiration,b.cookieSameSite=null!==(u=null==n?void 0:n.cookieSameSite)&&void 0!==u?u:ye.cookieSameSite,b.cookieSecure=null!==(c=null==n?void 0:n.cookieSecure)&&void 0!==c?c:ye.cookieSecure,b.cookieStorage=y,b.disableCookies=null!==(l=null==n?void 0:n.disableCookies)&&void 0!==l?l:ye.disableCookies,b.domain=null!==(d=null==n?void 0:n.domain)&&void 0!==d?d:ye.domain,b.includeGclid=null!==(p=null==n?void 0:n.includeGclid)&&void 0!==p?p:ye.includeGclid,b.includeFbclid=null!==(f=null==n?void 0:n.includeFbclid)&&void 0!==f?f:ye.includeFbclid,b.includeReferrer=null!==(v=null==n?void 0:n.includeReferrer)&&void 0!==v?v:ye.includeReferrer,b.includeUtm=null!==(h=null==n?void 0:n.includeUtm)&&void 0!==h?h:ye.includeUtm,b.sessionTimeout=m,b.trackingOptions=S,b}return n(t,e),t}(I),we=function(e,t){void 0===t&&(t=ye);var i=r(r({},t),e),n=null==e?void 0:e.cookieStorage;return n&&n.isEnabled()||(n=new le({domain:i.domain,expirationDays:i.cookieExpiration,sameSite:i.cookieSameSite,secure:i.cookieSecure}),!i.disableCookies&&n.isEnabled()||(n=new pe).isEnabled()||(n=new fe)),n},me=function(e){var t=null==e?void 0:e.storageProvider;return t&&t.isEnabled()||(t=new pe).isEnabled()||(t=new fe),t},Se=function(e,t,i){return t||i||e||oe()},_e=function(e,t,i,n){return void 0===e&&(e=0),void 0===t&&(t=0),void 0===i&&(i=0),e&&Date.now()-i<n?e:t||Date.now()},Ee=function(e){return e===p.TransportType.XHR?new he:e===p.TransportType.SendBeacon?new be:ye.transportProvider},Te=function(){return P()},ke=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t.prototype.get=function(e){try{var t=this.findByKey(e);if(!t)return;return t.split(".").splice(-1)[0].split("|").reduce((function(e,t){var i=u(t.split("=",2),2),n=i[0],r=i[1],o=void 0===r?"":r;return o?(e[n]=decodeURIComponent(o),e):e}),{})}catch(e){return}},t.prototype.set=function(){},t}(le),Oe=function(){var e=ve(),t=new ke,i=t.isEnabled()&&t.get("__utmz")||{},n=e.utm_source||i.utmcsr,r=e.utm_medium||i.utmcmd,o=e.utm_campaign||i.utmccn,s=e.utm_term||i.utmctr,a=e.utm_content||i.utmcct,u={};return n&&(u.utm_source=n),r&&(u.utm_medium=r),o&&(u.utm_campaign=o),s&&(u.utm_term=s),a&&(u.utm_content=a),u},xe=function(){var e,t={};try{var i=document.referrer||void 0,n=null!==(e=null==i?void 0:i.split("/")[2])&&void 0!==e?e:void 0;void 0!==i&&(t.referrer=i),void 0!==n&&(t.referring_domain=n)}catch(e){}return t},Ie=function(){var e,t=ve();return r({},t.gclid&&((e={}).gclid=t.gclid,e))},Pe=function(){var e,t=ve();return r({},t.fbclid&&((e={}).fbclid=t.fbclid,e))},Re=function(e,t,i){return{promise:Z(e,t,i)}},Ne=Re;e.Identify=j,e.Revenue=X,e.Types=m,e.add=function(e){return{promise:G(e)}},e.getDeviceId=function(){return Te().deviceId},e.getSessionId=function(){return Te().sessionId},e.getUserId=function(){return Te().userId},e.groupIdentify=function(e,t,i,n){if(ie(i)){var r=i._q;i._q=[],i=te(new j,r)}return{promise:Q(void 0,void 0,e,t,i,n)}},e.identify=function(e,t){if(ie(e)){var i=e._q;e._q=[],e=te(new j,i)}return{promise:$(void 0,void 0,e,t)}},e.init=function(e,t,i){return{promise:o(void 0,void 0,void 0,(function(){var n,o;return s(this,(function(s){switch(s.label){case 0:return n=function(e,t,i){return new ge(e,t,i)}(e,t,i),o=V(n),ae(o),[4,G(new ce)];case 1:return s.sent(),[4,G(new ee)];case 2:return s.sent(),function(e){var t=r(r(r(r({},e.includeUtm&&Oe()),e.includeReferrer&&xe()),e.includeGclid&&Ie()),e.includeFbclid&&Pe());if(0!==Object.keys(t).length){var i=new j;Object.entries(t).forEach((function(e){var t=u(e,2),n=t[0],r=t[1];r&&(i.setOnce("initial_".concat(n),r),i.set(n,r))})),$(void 0,void 0,i)}}(o),[2]}}))}))}},e.logEvent=Ne,e.remove=function(e){return{promise:H(e)}},e.revenue=function(e,t){if(ie(e)){var i=e._q;e._q=[],e=te(new X,i)}return{promise:W(e,t)}},e.runQueuedFunctions=function(e,t){te(e,t)},e.setDeviceId=function(e){var t=Te();t.deviceId=e,ae(t)},e.setGroup=function(e,t){return{promise:K(e,t)}},e.setOptOut=function(e){!function(e){P().optOut=Boolean(e)}(e);var t=Te();ae(t)},e.setSessionId=function(e){var t=Te();t.sessionId=e,ae(t)},e.setTransport=function(e){var t=Te(),i=Ee(e);t.transportProvider=i},e.setUserId=function(e){var t=Te();t.userId=e,ae(t)},e.track=Re,Object.defineProperty(e,"__esModule",{value:!0})})); | ||
***************************************************************************** */var i=function(e,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},i(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}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var r=function(){return r=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},r.apply(this,arguments)};function o(e,t,i,n){return new(i||(i=Promise))((function(r,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))}function s(e,t){var i,n,r,o,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(i)throw new TypeError("Generator is already executing.");for(;s;)try{if(i=1,n&&(r=2&o[0]?n.return:o[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,o[1])).done)return r;switch(n=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(r=s.trys,(r=r.length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){s.label=o[1];break}if(6===o[0]&&s.label<r[1]){s.label=r[1],r=o;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(o);break}r[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],n=0}finally{i=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}}function a(e){var t="function"==typeof Symbol&&Symbol.iterator,i=t&&e[t],n=0;if(i)return i.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function u(e,t){var i="function"==typeof Symbol&&e[Symbol.iterator];if(!i)return e;var n,r,o=i.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){r={error:e}}finally{try{n&&!n.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}return s}function c(e,t,i){if(i||2===arguments.length)for(var n,r=0,o=t.length;r<o;r++)!n&&r in t||(n||(n=Array.prototype.slice.call(t,0,r)),n[r]=t[r]);return e.concat(n||Array.prototype.slice.call(t))}var l="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function d(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var p={},f={};!function(e){var t;Object.defineProperty(e,"__esModule",{value:!0}),e.ServerZone=void 0,(t=e.ServerZone||(e.ServerZone={})).US="US",t.EU="EU"}(f);var v={};!function(e){var t,i,n;Object.defineProperty(e,"__esModule",{value:!0}),e.SpecialEventType=e.RevenueProperty=e.IdentifyOperation=void 0,(t=e.IdentifyOperation||(e.IdentifyOperation={})).SET="$set",t.SET_ONCE="$setOnce",t.ADD="$add",t.APPEND="$append",t.PREPEND="$prepend",t.REMOVE="$remove",t.PREINSERT="$preInsert",t.POSTINSERT="$postInsert",t.UNSET="$unset",t.CLEAR_ALL="$clearAll",(i=e.RevenueProperty||(e.RevenueProperty={})).REVENUE_PRODUCT_ID="$productId",i.REVENUE_QUANTITY="$quantity",i.REVENUE_PRICE="$price",i.REVENUE_TYPE="$revenueType",i.REVENUE="$revenue",(n=e.SpecialEventType||(e.SpecialEventType={})).IDENTIFY="$identify",n.GROUP_IDENTIFY="$groupidentify",n.REVENUE="revenue_amount"}(v);var h={};!function(e){var t;Object.defineProperty(e,"__esModule",{value:!0}),e.LogLevel=void 0,(t=e.LogLevel||(e.LogLevel={}))[t.None=0]="None",t[t.Error=1]="Error",t[t.Warn=2]="Warn",t[t.Verbose=3]="Verbose"}(h);var b={};!function(e){var t;Object.defineProperty(e,"__esModule",{value:!0}),e.PluginType=void 0,(t=e.PluginType||(e.PluginType={})).BEFORE="before",t.ENRICHMENT="enrichment",t.DESTINATION="destination"}(b);var y={};!function(e){var t;Object.defineProperty(e,"__esModule",{value:!0}),e.Status=void 0,(t=e.Status||(e.Status={})).Unknown="unknown",t.Skipped="skipped",t.Success="success",t.RateLimit="rate_limit",t.PayloadTooLarge="payload_too_large",t.Invalid="invalid",t.Failed="failed",t.Timeout="Timeout",t.SystemError="SystemError"}(y);var g={};!function(e){var t;Object.defineProperty(e,"__esModule",{value:!0}),e.TransportType=void 0,(t=e.TransportType||(e.TransportType={})).XHR="xhr",t.SendBeacon="beacon",t.Fetch="fetch"}(g),function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.TransportType=e.Status=e.PluginType=e.LogLevel=e.RevenueProperty=e.IdentifyOperation=e.SpecialEventType=e.ServerZone=void 0;var t=f;Object.defineProperty(e,"ServerZone",{enumerable:!0,get:function(){return t.ServerZone}});var i=v;Object.defineProperty(e,"SpecialEventType",{enumerable:!0,get:function(){return i.SpecialEventType}}),Object.defineProperty(e,"IdentifyOperation",{enumerable:!0,get:function(){return i.IdentifyOperation}}),Object.defineProperty(e,"RevenueProperty",{enumerable:!0,get:function(){return i.RevenueProperty}});var n=h;Object.defineProperty(e,"LogLevel",{enumerable:!0,get:function(){return n.LogLevel}});var r=b;Object.defineProperty(e,"PluginType",{enumerable:!0,get:function(){return r.PluginType}});var o=y;Object.defineProperty(e,"Status",{enumerable:!0,get:function(){return o.Status}});var s=g;Object.defineProperty(e,"TransportType",{enumerable:!0,get:function(){return s.TransportType}})}(p);var w=t({__proto__:null,default:d(p)},[p]),m="AMP",S="".concat(m,"_unsent"),_="https://api2.amplitude.com/2/httpapi",E=function(e){if(Object.keys(e).length>1e3)return!1;for(var t in e){var i=e[t];if(!T(t,i))return!1}return!0},T=function(e,t){var i,n;if("string"!=typeof e)return!1;if(Array.isArray(t)){var r=!0;try{for(var o=a(t),s=o.next();!s.done;s=o.next()){var u=s.value;if(Array.isArray(u))return!1;if("object"==typeof u)r=r&&E(u);else if(!["number","string"].includes(typeof u))return!1;if(!r)return!1}}catch(e){i={error:e}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}}else{if("object"==typeof t)return E(t);if(!["number","string","boolean"].includes(typeof t))return!1}return!0},k=function(){function e(){this._propertySet=new Set,this._properties={}}return e.prototype.getUserProperties=function(){return r({},this._properties)},e.prototype.set=function(e,t){return this._safeSet(p.IdentifyOperation.SET,e,t),this},e.prototype.setOnce=function(e,t){return this._safeSet(p.IdentifyOperation.SET_ONCE,e,t),this},e.prototype.append=function(e,t){return this._safeSet(p.IdentifyOperation.APPEND,e,t),this},e.prototype.prepend=function(e,t){return this._safeSet(p.IdentifyOperation.PREPEND,e,t),this},e.prototype.postInsert=function(e,t){return this._safeSet(p.IdentifyOperation.POSTINSERT,e,t),this},e.prototype.preInsert=function(e,t){return this._safeSet(p.IdentifyOperation.PREINSERT,e,t),this},e.prototype.remove=function(e,t){return this._safeSet(p.IdentifyOperation.REMOVE,e,t),this},e.prototype.add=function(e,t){return this._safeSet(p.IdentifyOperation.ADD,e,t),this},e.prototype.unset=function(e){return this._safeSet(p.IdentifyOperation.UNSET,e,"-"),this},e.prototype.clearAll=function(){return this._properties={},this._properties[p.IdentifyOperation.CLEAR_ALL]="-",this},e.prototype._safeSet=function(e,t,i){if(this._validate(e,t,i)){var n=this._properties[e];return void 0===n&&(n={},this._properties[e]=n),n[t]=i,this._propertySet.add(t),!0}return!1},e.prototype._validate=function(e,t,i){return void 0===this._properties[p.IdentifyOperation.CLEAR_ALL]&&(!this._propertySet.has(t)&&(e===p.IdentifyOperation.ADD?"number"==typeof i:e===p.IdentifyOperation.UNSET||e===p.IdentifyOperation.REMOVE||T(t,i)))},e}(),I=function(e,t,i){return void 0===t&&(t=0),void 0===i&&(i=p.Status.Unknown),{event:e,code:t,message:i}},O=[],x=!1,P=function(e,t){return o(void 0,void 0,void 0,(function(){return s(this,(function(i){switch(i.label){case 0:return[4,e.setup(t)];case 1:return i.sent(),t.plugins.push(e),[2]}}))}))},R=function(e,t){return t.plugins.splice(t.plugins.findIndex((function(t){return t.name===e})),1),Promise.resolve()},N=function(e,t){return new Promise((function(i){t.optOut?i(I(e,0,"Event skipped due to optOut config")):(O.push([e,i,t.plugins]),U(0))}))},U=function(e){x||(x=!0,setTimeout((function(){L().then((function(){x=!1,O.length>0&&U(0)}))}),e))},L=function(){return o(void 0,void 0,void 0,(function(){var e,t,i,n,o,c,l,d,f,v,h,b,y,g,w,m,S,_,E,T;return s(this,(function(s){switch(s.label){case 0:if(!(e=O.shift()))return[2];t=u(e,1),i=t[0],n=u(e,3),o=n[1],c=n[2],l=c.filter((function(e){return e.type===p.PluginType.BEFORE})),s.label=1;case 1:s.trys.push([1,6,7,8]),d=a(l),f=d.next(),s.label=2;case 2:return f.done?[3,5]:[4,f.value.execute(r({},i))];case 3:i=s.sent(),s.label=4;case 4:return f=d.next(),[3,2];case 5:return[3,8];case 6:return v=s.sent(),S={error:v},[3,8];case 7:try{f&&!f.done&&(_=d.return)&&_.call(d)}finally{if(S)throw S.error}return[7];case 8:h=c.filter((function(e){return e.type===p.PluginType.ENRICHMENT})),s.label=9;case 9:s.trys.push([9,14,15,16]),b=a(h),y=b.next(),s.label=10;case 10:return y.done?[3,13]:[4,y.value.execute(r({},i))];case 11:i=s.sent(),s.label=12;case 12:return y=b.next(),[3,10];case 13:return[3,16];case 14:return g=s.sent(),E={error:g},[3,16];case 15:try{y&&!y.done&&(T=b.return)&&T.call(b)}finally{if(E)throw E.error}return[7];case 16:return w=c.filter((function(e){return e.type===p.PluginType.DESTINATION})),m=w.map((function(e){var t=r({},i);return e.execute(t).catch((function(e){return I(t,0,String(e))}))})),Promise.all(m).then((function(e){var t=u(e,1)[0];o(t)})),[2]}}))}))},j=function(){function e(e){void 0===e&&(e="$default"),this.logEvent=this.track.bind(this),this.name=e}return e.prototype.init=function(e,t,i){return this.config=i,Promise.resolve()},e.prototype.track=function(e,t,i){var n=function(e,t,i){return r(r(r({},"string"==typeof e?{event_type:e}:e),i),t&&{event_properties:t})}(e,t,i);return this.dispatch(n)},e.prototype.identify=function(e,t,i,n){var o=function(e,t,i,n){var o=r(r({},n),{event_type:p.SpecialEventType.IDENTIFY,user_properties:i.getUserProperties(),user_id:e});return void 0!==t&&t.length>0&&(o.device_id=t),o}(i,n,e,t);return this.dispatch(o)},e.prototype.groupIdentify=function(e,t,i,n,o,s){var a=function(e,t,i,n,o,s){var a,u=r(r({},s),{event_type:p.SpecialEventType.GROUP_IDENTIFY,group_properties:o.getUserProperties(),groups:(a={},a[i]=n,a),user_id:e});return void 0!==t&&t.length>0&&(u.device_id=t),u}(o,s,e,t,i,n);return this.dispatch(a)},e.prototype.setGroup=function(e,t){var i=function(e,t){var i,n=new k;return n.set(e,t),{event_type:p.SpecialEventType.IDENTIFY,user_properties:n.getUserProperties(),groups:(i={},i[e]=t,i)}}(e,t);return this.dispatch(i)},e.prototype.revenue=function(e,t){var i=function(e,t){return r(r({},t),{event_type:p.SpecialEventType.REVENUE,event_properties:e.getEventProperties()})}(e,t);return this.dispatch(i)},e.prototype.add=function(e){return o(this,void 0,void 0,(function(){var t;return s(this,(function(i){return t=this.config,[2,P(e,t)]}))}))},e.prototype.remove=function(e){return o(this,void 0,void 0,(function(){var t;return s(this,(function(i){return t=this.config,[2,R(e,t)]}))}))},e.prototype.dispatch=function(e){return o(this,void 0,void 0,(function(){var t,i,n;return s(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,N(e,this.config)];case 1:return 200===(t=r.sent()).code?this.config.loggerProvider.log(t.message):this.config.loggerProvider.error(t.message),[2,t];case 2:return i=r.sent(),n=String(i),this.config.loggerProvider.error(n),[2,I(e,0,n)];case 3:return[2]}}))}))},e.prototype.setOptOut=function(e){this.config.optOut=Boolean(e)},e}();var A=function(e){var t,i,n,r,o,s,a,u,c,l,d,f,v,h,b,y,g,w,m,S,_,E;if("object"!=typeof e)return null;var T,k=e.code||0,I=(T=k)>=200&&T<300?p.Status.Success:429===T?p.Status.RateLimit:413===T?p.Status.PayloadTooLarge:408===T?p.Status.Timeout:T>=400&&T<500?p.Status.Invalid:T>=500?p.Status.Failed:p.Status.Unknown;switch(I){case p.Status.Success:return{status:I,statusCode:k,body:{eventsIngested:null!==(t=e.events_ingested)&&void 0!==t?t:0,payloadSizeBytes:null!==(i=e.payload_size_bytes)&&void 0!==i?i:0,serverUploadTime:null!==(n=e.server_upload_time)&&void 0!==n?n:0}};case p.Status.Invalid:return{status:I,statusCode:k,body:{error:null!==(r=e.error)&&void 0!==r?r:"",missingField:null!==(o=e.missing_field)&&void 0!==o?o:"",eventsWithInvalidFields:null!==(s=e.events_with_invalid_fields)&&void 0!==s?s:{},eventsWithMissingFields:null!==(a=e.events_with_missing_fields)&&void 0!==a?a:{},eventsWithInvalidIdLengths:null!==(u=e.events_with_invalid_id_lengths)&&void 0!==u?u:{},epsThreshold:null!==(c=e.eps_threshold)&&void 0!==c?c:0,exceededDailyQuotaDevices:null!==(l=e.exceeded_daily_quota_devices)&&void 0!==l?l:{},silencedDevices:null!==(d=e.silenced_devices)&&void 0!==d?d:[],silencedEvents:null!==(f=e.silenced_events)&&void 0!==f?f:[],throttledDevices:null!==(v=e.throttled_devices)&&void 0!==v?v:{},throttledEvents:null!==(h=e.throttled_events)&&void 0!==h?h:[]}};case p.Status.PayloadTooLarge:return{status:I,statusCode:k,body:{error:null!==(b=e.error)&&void 0!==b?b:""}};case p.Status.RateLimit:return{status:I,statusCode:k,body:{error:null!==(y=e.error)&&void 0!==y?y:"",epsThreshold:null!==(g=e.eps_threshold)&&void 0!==g?g:0,throttledDevices:null!==(w=e.throttled_devices)&&void 0!==w?w:{},throttledUsers:null!==(m=e.throttled_users)&&void 0!==m?m:{},exceededDailyQuotaDevices:null!==(S=e.exceeded_daily_quota_devices)&&void 0!==S?S:{},exceededDailyQuotaUsers:null!==(_=e.exceeded_daily_quota_users)&&void 0!==_?_:{},throttledEvents:null!==(E=e.throttled_events)&&void 0!==E?E:[]}};case p.Status.Timeout:default:return{status:I,statusCode:k}}},q=function(){function e(){this.productId="",this.quantity=1,this.price=0}return e.prototype.setProductId=function(e){return this.productId=e,this},e.prototype.setQuantity=function(e){return e>0&&(this.quantity=e),this},e.prototype.setPrice=function(e){return this.price=e,this},e.prototype.setRevenueType=function(e){return this.revenueType=e,this},e.prototype.setRevenue=function(e){return this.revenue=e,this},e.prototype.setEventProperties=function(e){return E(e)&&(this.properties=e),this},e.prototype.getEventProperties=function(){var e=this.properties?r({},this.properties):{};return e[p.RevenueProperty.REVENUE_PRODUCT_ID]=this.productId,e[p.RevenueProperty.REVENUE_QUANTITY]=this.quantity,e[p.RevenueProperty.REVENUE_PRICE]=this.price,e[p.RevenueProperty.REVENUE_TYPE]=this.revenueType,e[p.RevenueProperty.REVENUE]=this.revenue,e},e}(),D="Amplitude Logger ",C=function(){function e(){this.logLevel=p.LogLevel.None}return e.prototype.disable=function(){this.logLevel=p.LogLevel.None},e.prototype.enable=function(e){void 0===e&&(e=p.LogLevel.Warn),this.logLevel=e},e.prototype.log=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<p.LogLevel.Verbose||console.log("".concat(D,"[Log]: ").concat(e.join(" ")))},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<p.LogLevel.Warn||console.warn("".concat(D,"[Warn]: ").concat(e.join(" ")))},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<p.LogLevel.Error||console.error("".concat(D,"[Error]: ").concat(e.join(" ")))},e}(),M=function(){return{flushMaxRetries:5,flushQueueSize:10,flushIntervalMillis:1e3,logLevel:p.LogLevel.Warn,loggerProvider:new C,saveEvents:!0,optOut:!1,plugins:[],serverUrl:_,serverZone:p.ServerZone.US,useBatch:!1}},B=function(e){var t,i,n,r,o=M();this.apiKey=e.apiKey,this.appVersion=e.appVersion,this.userId=e.userId,this.deviceId=e.deviceId,this.sessionId=e.sessionId,this.flushIntervalMillis=e.flushIntervalMillis||o.flushIntervalMillis,this.flushMaxRetries=e.flushMaxRetries||o.flushMaxRetries,this.flushQueueSize=e.flushQueueSize||o.flushQueueSize,this.loggerProvider=e.loggerProvider||o.loggerProvider,this.logLevel=null!==(t=e.logLevel)&&void 0!==t?t:o.logLevel,this.partnerId=e.partnerId,this.plugins=o.plugins,this.optOut=null!==(i=e.optOut)&&void 0!==i?i:o.optOut,this.saveEvents=null!==(n=e.saveEvents)&&void 0!==n?n:o.saveEvents,this.serverUrl=e.serverUrl,this.serverZone=e.serverZone||o.serverZone,this.storageProvider=e.storageProvider,this.transportProvider=e.transportProvider,this.useBatch=null!==(r=e.useBatch)&&void 0!==r?r:o.useBatch,this.loggerProvider.enable(this.logLevel);var s=F(e.serverZone,e.useBatch);this.serverZone=s.serverZone,this.serverUrl=s.serverUrl},z=function(e,t){return e===p.ServerZone.EU?t?"https://api.eu.amplitude.com/batch":"https://api.eu.amplitude.com/2/httpapi":t?"https://api2.amplitude.com/batch":_},F=function(e,t){void 0===e&&(e=M().serverZone),void 0===t&&(t=M().useBatch);var i=[p.ServerZone.US,p.ServerZone.EU].includes(e)?e:M().serverZone;return{serverZone:i,serverUrl:z(i,t)}},V=function(){function e(){this.name="amplitude",this.type=p.PluginType.DESTINATION,this.backoff=1e3,this.throttle=3e4,this.storageKey="",this.backup=new Set,this.scheduled=!1,this.queue=[]}return e.prototype.setup=function(e){var t=this;this.config=e,this.storageKey="".concat(S,"_").concat(this.config.apiKey.substring(0,10));var i=this.config.storageProvider.get(this.storageKey);return this.snapshot(),i&&i.length>0&&Promise.all(i.map((function(e){return t.execute(e)}))).catch(),Promise.resolve(void 0)},e.prototype.execute=function(e){var t=this;return new Promise((function(i){var n={event:e,attempts:0,callback:function(e){return i(e)},delay:0};t.addToQueue(n)}))},e.prototype.addToQueue=function(){for(var e=this,t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];var n=t.filter((function(t){return t.attempts<e.config.flushMaxRetries||(e.fulfillRequest([t],500,p.Status.Unknown),!1)}));this.addToBackup.apply(this,c([],u(n.map((function(e){return e.event}))),!1)),n.forEach((function(t){t.attempts+=1;var i=t.delay;if(t.delay=0,1===t.attempts&&!t.delay)return e.queue=e.queue.concat(t),void e.schedule(e.config.flushIntervalMillis);setTimeout((function(){e.queue=e.queue.concat(t),e.schedule(e.config.flushIntervalMillis)}),i||t.attempts*e.backoff)}))},e.prototype.schedule=function(e){var t=this;this.scheduled||(this.scheduled=!0,setTimeout((function(){t.flush().then((function(){t.scheduled=!1,t.queue.length>0&&t.schedule(e)}))}),e))},e.prototype.flush=function(){return o(this,void 0,void 0,(function(){var e,t,i=this;return s(this,(function(n){switch(n.label){case 0:return e=this.queue,this.queue=[],r=e,o=this.config.flushQueueSize,s=Math.max(o,1),t=r.reduce((function(e,t,i){var n=Math.floor(i/s);return e[n]||(e[n]=[]),e[n].push(t),e}),[]),[4,Promise.all(t.map((function(e){return i.send(e)})))];case 1:return n.sent(),[2]}var r,o,s}))}))},e.prototype.send=function(e){return o(this,void 0,void 0,(function(){var t,i,n,r;return s(this,(function(o){switch(o.label){case 0:if(!this.config.apiKey)return[2,this.fulfillRequest(e,400,"Event rejected due to missing API key")];t={api_key:this.config.apiKey,events:e.map((function(e){return e.event}))},o.label=1;case 1:return o.trys.push([1,3,,4]),i=F(this.config.serverZone,this.config.useBatch).serverUrl,[4,this.config.transportProvider.send(i,t)];case 2:return null===(n=o.sent())?(this.fulfillRequest(e,0,"Unexpected error occurred"),[2]):(this.handleReponse(n,e),[3,4]);case 3:return r=o.sent(),this.fulfillRequest(e,0,String(r)),[3,4];case 4:return[2]}}))}))},e.prototype.handleReponse=function(e,t){switch(e.status){case p.Status.Success:this.handleSuccessResponse(e,t);break;case p.Status.Invalid:this.handleInvalidResponse(e,t);break;case p.Status.PayloadTooLarge:this.handlePayloadTooLargeResponse(e,t);break;case p.Status.RateLimit:this.handleRateLimitResponse(e,t);break;default:this.handleOtherReponse(t)}},e.prototype.handleSuccessResponse=function(e,t){this.fulfillRequest(t,e.statusCode,"Event tracked successfully")},e.prototype.handleInvalidResponse=function(e,t){var i=this;if(e.body.missingField)this.fulfillRequest(t,e.statusCode,e.body.error);else{var n=c(c(c(c([],u(Object.values(e.body.eventsWithInvalidFields)),!1),u(Object.values(e.body.eventsWithMissingFields)),!1),u(Object.values(e.body.eventsWithInvalidIdLengths)),!1),u(e.body.silencedEvents),!1).flat(),r=new Set(n),o=t.filter((function(t,n){if(!r.has(n))return!0;i.fulfillRequest([t],e.statusCode,e.body.error)}));this.addToQueue.apply(this,c([],u(o),!1))}},e.prototype.handlePayloadTooLargeResponse=function(e,t){1!==t.length?(this.config.flushQueueSize/=2,this.addToQueue.apply(this,c([],u(t),!1))):this.fulfillRequest(t,e.statusCode,e.body.error)},e.prototype.handleRateLimitResponse=function(e,t){var i=this,n=Object.keys(e.body.exceededDailyQuotaUsers),r=Object.keys(e.body.exceededDailyQuotaDevices),o=e.body.throttledEvents,s=new Set(n),a=new Set(r),l=new Set(o),d=t.filter((function(t,n){if(!(t.event.user_id&&s.has(t.event.user_id)||t.event.device_id&&a.has(t.event.device_id)))return l.has(n)&&(t.delay=i.throttle),!0;i.fulfillRequest([t],e.statusCode,e.body.error)}));this.addToQueue.apply(this,c([],u(d),!1))},e.prototype.handleOtherReponse=function(e){this.addToQueue.apply(this,c([],u(e),!1))},e.prototype.fulfillRequest=function(e,t,i){this.removeFromBackup.apply(this,c([],u(e.map((function(e){return e.event}))),!1)),e.forEach((function(e){return e.callback(I(e.event,t,i))}))},e.prototype.addToBackup=function(){for(var e=this,t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];this.config.saveEvents&&(t.forEach((function(t){return e.backup.add(t)})),this.snapshot())},e.prototype.removeFromBackup=function(){for(var e=this,t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];this.config.saveEvents&&(t.forEach((function(t){return e.backup.delete(t)})),this.snapshot())},e.prototype.snapshot=function(){if(this.config.saveEvents){var e=Array.from(this.backup);this.config.storageProvider.set(this.storageKey,e)}},e}(),Z=function(e){return function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];return{promise:e.apply(void 0,c([],u(t),!1))}}},$=function(e,t){for(var i=0;i<t.length;i++){var n=t[i],r=n.name,o=n.args,s=n.resolve,a=e&&e[r];if("function"==typeof a){var u=a.apply(e,o);"function"==typeof s&&s(null==u?void 0:u.promise)}}return e},Q=function(e){return e&&void 0!==e._q},W={exports:{}};!function(e,t){!function(i,n){var r="function",o="undefined",s="object",a="string",u="model",c="name",l="type",d="vendor",p="version",f="architecture",v="console",h="mobile",b="tablet",y="smarttv",g="wearable",w="embedded",m="Amazon",S="Apple",_="ASUS",E="BlackBerry",T="Firefox",k="Google",I="Huawei",O="LG",x="Microsoft",P="Motorola",R="Opera",N="Samsung",U="Sony",L="Xiaomi",j="Zebra",A=function(e){for(var t={},i=0;i<e.length;i++)t[e[i].toUpperCase()]=e[i];return t},q=function(e,t){return typeof e===a&&-1!==D(t).indexOf(D(e))},D=function(e){return e.toLowerCase()},C=function(e,t){if(typeof e===a)return e=e.replace(/^\s+|\s+$/g,""),typeof t===o?e:e.substring(0,255)},M=function(e,t){for(var i,o,a,u,c,l,d=0;d<t.length&&!c;){var p=t[d],f=t[d+1];for(i=o=0;i<p.length&&!c;)if(c=p[i++].exec(e))for(a=0;a<f.length;a++)l=c[++o],typeof(u=f[a])===s&&u.length>0?2==u.length?typeof u[1]==r?this[u[0]]=u[1].call(this,l):this[u[0]]=u[1]:3==u.length?typeof u[1]!==r||u[1].exec&&u[1].test?this[u[0]]=l?l.replace(u[1],u[2]):n:this[u[0]]=l?u[1].call(this,l,u[2]):n:4==u.length&&(this[u[0]]=l?u[3].call(this,l.replace(u[1],u[2])):n):this[u]=l||n;d+=2}},B=function(e,t){for(var i in t)if(typeof t[i]===s&&t[i].length>0){for(var r=0;r<t[i].length;r++)if(q(t[i][r],e))return"?"===i?n:i}else if(q(t[i],e))return"?"===i?n:i;return e},z={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},F={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[p,[c,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[p,[c,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[c,p],[/opios[\/ ]+([\w\.]+)/i],[p,[c,"Opera Mini"]],[/\bopr\/([\w\.]+)/i],[p,[c,R]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i,/(ba?idubrowser)[\/ ]?([\w\.]+)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale|qqbrowserlite|qq)\/([-\w\.]+)/i,/(weibo)__([\d\.]+)/i],[c,p],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[p,[c,"UCBrowser"]],[/\bqbcore\/([\w\.]+)/i],[p,[c,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[p,[c,"WeChat"]],[/konqueror\/([\w\.]+)/i],[p,[c,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[p,[c,"IE"]],[/yabrowser\/([\w\.]+)/i],[p,[c,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[c,/(.+)/,"$1 Secure Browser"],p],[/\bfocus\/([\w\.]+)/i],[p,[c,"Firefox Focus"]],[/\bopt\/([\w\.]+)/i],[p,[c,"Opera Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[p,[c,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[p,[c,"Dolphin"]],[/coast\/([\w\.]+)/i],[p,[c,"Opera Coast"]],[/miuibrowser\/([\w\.]+)/i],[p,[c,"MIUI Browser"]],[/fxios\/([-\w\.]+)/i],[p,[c,T]],[/\bqihu|(qi?ho?o?|360)browser/i],[[c,"360 Browser"]],[/(oculus|samsung|sailfish)browser\/([\w\.]+)/i],[[c,/(.+)/,"$1 Browser"],p],[/(comodo_dragon)\/([\w\.]+)/i],[[c,/_/g," "],p],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[c,p],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i],[c],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[c,"Facebook"],p],[/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/ ]([-\w\.]+)/i],[c,p],[/\bgsa\/([\w\.]+) .*safari\//i],[p,[c,"GSA"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[p,[c,"Chrome Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[c,"Chrome WebView"],p],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[p,[c,"Android Browser"]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[c,p],[/version\/([\w\.]+) .*mobile\/\w+ (safari)/i],[p,[c,"Mobile Safari"]],[/version\/([\w\.]+) .*(mobile ?safari|safari)/i],[p,c],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[c,[p,B,{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}]],[/(webkit|khtml)\/([\w\.]+)/i],[c,p],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[c,"Netscape"],p],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[p,[c,"Firefox Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i],[c,p]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[f,"amd64"]],[/(ia32(?=;))/i],[[f,D]],[/((?:i[346]|x)86)[;\)]/i],[[f,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[f,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[f,"armhf"]],[/windows (ce|mobile); ppc;/i],[[f,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[f,/ower/,"",D]],[/(sun4\w)[;\)]/i],[[f,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[f,D]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[pt]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[u,[d,N],[l,b]],[/\b((?:s[cgp]h|gt|sm)-\w+|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[u,[d,N],[l,h]],[/((ipod|iphone)\d+,\d+)/i],[u,[d,S],[l,h]],[/(ipad\d+,\d+)/i],[u,[d,S],[l,b]],[/\((ip(?:hone|od)[\w ]*);/i],[u,[d,S],[l,h]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[u,[d,S],[l,b]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[u,[d,I],[l,b]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}-[atu]?[ln][01259x][012359][an]?)\b(?!.+d\/s)/i],[u,[d,I],[l,h]],[/\b(poco[\w ]+)(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[u,/_/g," "],[d,L],[l,h]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[u,/_/g," "],[d,L],[l,b]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007)\b/i],[u,[d,"OPPO"],[l,h]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[u,[d,"Vivo"],[l,h]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[u,[d,"Realme"],[l,h]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[u,[d,P],[l,h]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[u,[d,P],[l,b]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[u,[d,O],[l,b]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[u,[d,O],[l,h]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[u,[d,"Lenovo"],[l,b]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[u,/_/g," "],[d,"Nokia"],[l,h]],[/(pixel c)\b/i],[u,[d,k],[l,b]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[u,[d,k],[l,h]],[/droid.+ ([c-g]\d{4}|so[-l]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[u,[d,U],[l,h]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[u,"Xperia Tablet"],[d,U],[l,b]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[u,[d,"OnePlus"],[l,h]],[/(alexa)webm/i,/(kf[a-z]{2}wi)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[u,[d,m],[l,b]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[u,/(.+)/g,"Fire Phone $1"],[d,m],[l,h]],[/(playbook);[-\w\),; ]+(rim)/i],[u,d,[l,b]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[u,[d,E],[l,h]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[u,[d,_],[l,b]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[u,[d,_],[l,h]],[/(nexus 9)/i],[u,[d,"HTC"],[l,b]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic|sony)[-_ ]?([-\w]*)/i],[d,[u,/_/g," "],[l,h]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[u,[d,"Acer"],[l,b]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[u,[d,"Meizu"],[l,h]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[u,[d,"Sharp"],[l,h]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[d,u,[l,h]],[/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[d,u,[l,b]],[/(surface duo)/i],[u,[d,x],[l,b]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[u,[d,"Fairphone"],[l,h]],[/(u304aa)/i],[u,[d,"AT&T"],[l,h]],[/\bsie-(\w*)/i],[u,[d,"Siemens"],[l,h]],[/\b(rct\w+) b/i],[u,[d,"RCA"],[l,b]],[/\b(venue[\d ]{2,7}) b/i],[u,[d,"Dell"],[l,b]],[/\b(q(?:mv|ta)\w+) b/i],[u,[d,"Verizon"],[l,b]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[u,[d,"Barnes & Noble"],[l,b]],[/\b(tm\d{3}\w+) b/i],[u,[d,"NuVision"],[l,b]],[/\b(k88) b/i],[u,[d,"ZTE"],[l,b]],[/\b(nx\d{3}j) b/i],[u,[d,"ZTE"],[l,h]],[/\b(gen\d{3}) b.+49h/i],[u,[d,"Swiss"],[l,h]],[/\b(zur\d{3}) b/i],[u,[d,"Swiss"],[l,b]],[/\b((zeki)?tb.*\b) b/i],[u,[d,"Zeki"],[l,b]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[d,"Dragon Touch"],u,[l,b]],[/\b(ns-?\w{0,9}) b/i],[u,[d,"Insignia"],[l,b]],[/\b((nxa|next)-?\w{0,9}) b/i],[u,[d,"NextBook"],[l,b]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[d,"Voice"],u,[l,h]],[/\b(lvtel\-)?(v1[12]) b/i],[[d,"LvTel"],u,[l,h]],[/\b(ph-1) /i],[u,[d,"Essential"],[l,h]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[u,[d,"Envizen"],[l,b]],[/\b(trio[-\w\. ]+) b/i],[u,[d,"MachSpeed"],[l,b]],[/\btu_(1491) b/i],[u,[d,"Rotor"],[l,b]],[/(shield[\w ]+) b/i],[u,[d,"Nvidia"],[l,b]],[/(sprint) (\w+)/i],[d,u,[l,h]],[/(kin\.[onetw]{3})/i],[[u,/\./g," "],[d,x],[l,h]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[u,[d,j],[l,b]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[u,[d,j],[l,h]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[d,u,[l,v]],[/droid.+; (shield) bui/i],[u,[d,"Nvidia"],[l,v]],[/(playstation [345portablevi]+)/i],[u,[d,U],[l,v]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[u,[d,x],[l,v]],[/smart-tv.+(samsung)/i],[d,[l,y]],[/hbbtv.+maple;(\d+)/i],[[u,/^/,"SmartTV"],[d,N],[l,y]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[d,O],[l,y]],[/(apple) ?tv/i],[d,[u,"Apple TV"],[l,y]],[/crkey/i],[[u,"Chromecast"],[d,k],[l,y]],[/droid.+aft(\w)( bui|\))/i],[u,[d,m],[l,y]],[/\(dtv[\);].+(aquos)/i],[u,[d,"Sharp"],[l,y]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w ]*; *(\w[^;]*);([^;]*)/i],[[d,C],[u,C],[l,y]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[l,y]],[/((pebble))app/i],[d,u,[l,g]],[/droid.+; (glass) \d/i],[u,[d,k],[l,g]],[/droid.+; (wt63?0{2,3})\)/i],[u,[d,j],[l,g]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[d,[l,w]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[u,[l,h]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[u,[l,b]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[l,b]],[/(phone|mobile(?:[;\/]| safari)|pda(?=.+windows ce))/i],[[l,h]],[/(android[-\w\. ]{0,9});.+buil/i],[u,[d,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[p,[c,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[p,[c,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i],[c,p],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[p,c]],os:[[/microsoft (windows) (vista|xp)/i],[c,p],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[c,[p,B,z]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[c,"Windows"],[p,B,z]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/cfnetwork\/.+darwin/i],[[p,/_/g,"."],[c,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[c,"Mac OS"],[p,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86)/i],[p,c],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[c,p],[/\(bb(10);/i],[p,[c,E]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[p,[c,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[p,[c,"Firefox OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[p,[c,"webOS"]],[/crkey\/([\d\.]+)/i],[p,[c,"Chromecast"]],[/(cros) [\w]+ ([\w\.]+\w)/i],[[c,"Chromium OS"],p],[/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[c,p],[/(sunos) ?([\w\.\d]*)/i],[[c,"Solaris"],p],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux)/i,/(unix) ?([\w\.]*)/i],[c,p]]},V=function(e,t){if(typeof e===s&&(t=e,e=n),!(this instanceof V))return new V(e,t).getResult();var r=e||(typeof i!==o&&i.navigator&&i.navigator.userAgent?i.navigator.userAgent:""),u=t?function(e,t){var i={};for(var n in e)t[n]&&t[n].length%2==0?i[n]=t[n].concat(e[n]):i[n]=e[n];return i}(F,t):F;return this.getBrowser=function(){var e,t={};return t.name=n,t.version=n,M.call(t,r,u.browser),t.major=typeof(e=t.version)===a?e.replace(/[^\d\.]/g,"").split(".")[0]:n,t},this.getCPU=function(){var e={};return e.architecture=n,M.call(e,r,u.cpu),e},this.getDevice=function(){var e={};return e.vendor=n,e.model=n,e.type=n,M.call(e,r,u.device),e},this.getEngine=function(){var e={};return e.name=n,e.version=n,M.call(e,r,u.engine),e},this.getOS=function(){var e={};return e.name=n,e.version=n,M.call(e,r,u.os),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return r},this.setUA=function(e){return r=typeof e===a&&e.length>255?C(e,255):e,this},this.setUA(r),this};V.VERSION="0.7.28",V.BROWSER=A([c,p,"major"]),V.CPU=A([f]),V.DEVICE=A([u,d,l,v,h,y,b,g,w]),V.ENGINE=V.OS=A([c,p]),e.exports&&(t=e.exports=V),t.UAParser=V;var Z=typeof i!==o&&(i.jQuery||i.Zepto);if(Z&&!Z.ua){var $=new V;Z.ua=$.getResult(),Z.ua.get=function(){return $.getUA()},Z.ua.set=function(e){$.setUA(e);var t=$.getResult();for(var i in t)Z.ua[i]=t[i]}}}("object"==typeof window?window:l)}(W,W.exports);var G=W.exports,H=function(e){return e?(e^16*Math.random()>>e/4).toString(16):(String(1e7)+String(-1e3)+String(-4e3)+String(-8e3)+String(-1e11)).replace(/[018]/g,H)},K=function(){var e,t,i,n;if("undefined"==typeof navigator)return"";var r=navigator.userLanguage;return null!==(n=null!==(i=null!==(t=null===(e=navigator.languages)||void 0===e?void 0:e[0])&&void 0!==t?t:navigator.language)&&void 0!==i?i:r)&&void 0!==n?n:""},J=function(e,t){var i,n=Y(e.apiKey);e.cookieStorage.set(n,{userId:e.userId,deviceId:e.deviceId,sessionId:e.sessionId,lastEventTime:null!=t?t:null===(i=e.cookieStorage.get(n))||void 0===i?void 0:i.lastEventTime,optOut:Boolean(e.optOut)})},Y=function(e,t){return void 0===t&&(t=10),"".concat(m,"_").concat(e.substring(0,t))},X=function(){function e(){var e;this.name="context",this.type=p.PluginType.BEFORE,this.eventId=0,this.library="amplitude-ts/".concat("0.4.0"),"undefined"!=typeof navigator&&(e=navigator.userAgent),this.uaResult=new G(e).getResult()}return e.prototype.setup=function(e){return this.config=e,Promise.resolve(void 0)},e.prototype.execute=function(e){var t=this;return new Promise((function(i){var n=(new Date).getTime(),o=t.uaResult.browser.name,s=t.uaResult.browser.version,a=t.uaResult.device.model||t.uaResult.os.name,u=t.uaResult.device.vendor;return function(e){var t,i=Y(e.apiKey),n=null===(t=e.cookieStorage.get(i))||void 0===t?void 0:t.lastEventTime,r=Date.now();n&&r-n>=e.sessionTimeout&&(e.sessionId=r,J(e))}(t.config),J(t.config,n),i(r(r(r(r(r(r(r(r(r(r(r({user_id:t.config.userId,device_id:t.config.deviceId,session_id:t.config.sessionId,time:n},t.config.appVersion&&{app_version:t.config.appVersion}),t.config.trackingOptions.platform&&{platform:"Web"}),t.config.trackingOptions.osName&&{os_name:o}),t.config.trackingOptions.osVersion&&{os_version:s}),t.config.trackingOptions.deviceManufacturer&&{device_manufacturer:u}),t.config.trackingOptions.deviceModel&&{device_model:a}),t.config.trackingOptions.language&&{language:K()}),t.config.trackingOptions.ipAddress&&{ip:"$remote"}),{insert_id:H(),partner_id:t.config.partnerId}),e),{event_id:t.eventId++,library:t.library}))}))},e}(),ee=function(){function e(e){this.options=r({},e)}return e.prototype.isEnabled=function(){if("undefined"==typeof window)return!1;var t=String(Date.now()),i=new e,n="AMP_TEST";try{return i.set(n,t),i.get(n)===t}catch(e){return!1}finally{i.remove(n)}},e.prototype.get=function(e){var t=this.getRaw(e);if(t)try{return JSON.parse(t)}catch(e){return}},e.prototype.getRaw=function(e){var t=window.document.cookie.split("; ").find((function(t){return 0===t.indexOf(e+"=")}));if(t)return t.substring(e.length+1)},e.prototype.set=function(e,t){var i;try{var n=null!==(i=this.options.expirationDays)&&void 0!==i?i:0,r=null!==t?n:-1,o=void 0;if(r){var s=new Date;s.setTime(s.getTime()+24*r*60*60*1e3),o=s}var a="".concat(e,"=").concat(JSON.stringify(t));o&&(a+="; expires=".concat(o.toUTCString())),a+="; path=/",this.options.domain&&(a+="; domain=".concat(this.options.domain)),this.options.secure&&(a+="; Secure"),this.options.sameSite&&(a+="; SameSite=".concat(this.options.sameSite)),window.document.cookie=a}catch(e){}},e.prototype.remove=function(e){this.set(e,null)},e.prototype.reset=function(){},e}(),te=function(){function e(){}return e.prototype.send=function(e,t){return o(this,void 0,void 0,(function(){var i,n;return s(this,(function(r){switch(r.label){case 0:if("undefined"==typeof fetch)throw new Error("FetchTransport is not supported");return i={headers:{"Content-Type":"application/json",Accept:"*/*"},body:JSON.stringify(t),method:"POST"},[4,fetch(e,i)];case 1:return[4,r.sent().json()];case 2:return n=r.sent(),[2,A(n)]}}))}))},e}(),ie=function(){function e(){}return e.prototype.isEnabled=function(){if("undefined"==typeof window)return!1;var t=String(Date.now()),i=new e,n="AMP_TEST";try{return i.set(n,t),i.get(n)===t}catch(e){return!1}finally{i.remove(n)}},e.prototype.get=function(e){try{var t=this.getRaw(e);if(!t)return;return JSON.parse(t)}catch(e){return}},e.prototype.getRaw=function(e){return window.localStorage.getItem(e)||void 0},e.prototype.set=function(e,t){try{window.localStorage.setItem(e,JSON.stringify(t))}catch(e){}},e.prototype.remove=function(e){try{window.localStorage.removeItem(e)}catch(e){}},e.prototype.reset=function(){try{window.localStorage.clear()}catch(e){}},e}(),ne=function(){function e(){this.memoryStorage=new Map}return e.prototype.isEnabled=function(){return!0},e.prototype.get=function(e){return this.memoryStorage.get(e)},e.prototype.getRaw=function(e){var t=this.get(e);return t?JSON.stringify(t):void 0},e.prototype.set=function(e,t){this.memoryStorage.set(e,t)},e.prototype.remove=function(e){this.memoryStorage.delete(e)},e.prototype.reset=function(){this.memoryStorage.clear()},e}(),re=function(){return"undefined"==typeof window?{}:window.location.search.substring(1).split("&").filter(Boolean).reduce((function(e,t){var i=u(t.split("=",2),2),n=i[0],r=i[1],o=void 0===r?"":r;return o?(e[decodeURIComponent(n)]=decodeURIComponent(o),e):e}),{})},oe=function(){function e(){this.state={done:4}}return e.prototype.send=function(e,t){return o(this,void 0,void 0,(function(){var i=this;return s(this,(function(n){return[2,new Promise((function(n,r){"undefined"==typeof XMLHttpRequest&&r(new Error("XHRTransport is not supported."));var o=new XMLHttpRequest;o.open("POST",e,!0),o.onreadystatechange=function(){if(o.readyState===i.state.done)try{var e=o.responseText,t=JSON.parse(e),s=A(t);n(s)}catch(e){r(e)}},o.setRequestHeader("Content-Type","application/json"),o.setRequestHeader("Accept","*/*"),o.send(JSON.stringify(t))}))]}))}))},e}(),se=function(){function e(){}return e.prototype.send=function(e,t){return o(this,void 0,void 0,(function(){return s(this,(function(i){return[2,new Promise((function(i,n){if("undefined"==typeof window||void 0===window.navigator||void 0===window.navigator.sendBeacon)throw new Error("SendBeaconTransport is not supported");try{var r=JSON.stringify(t);return i(window.navigator.sendBeacon(e,JSON.stringify(t))?A({code:200,events_ingested:t.events.length,payload_size_bytes:r.length,server_upload_time:Date.now()}):A({code:500}))}catch(e){n(e)}}))]}))}))},e}(),ae=function(){return{cookieExpiration:365,cookieSameSite:"Lax",cookieSecure:!1,cookieStorage:new ne,disableCookies:!1,domain:"",includeGclid:!0,includeFbclid:!0,includeReferrer:!0,includeUtm:!0,sessionTimeout:18e5,storageProvider:new ne,trackingOptions:{city:!0,country:!0,carrier:!0,deviceManufacturer:!0,deviceModel:!0,dma:!0,ipAddress:!0,language:!0,osName:!0,osVersion:!0,platform:!0,region:!0,versionName:!0},transportProvider:new te}},ue=function(e){function t(t,i,n){var o,s,a,u,c,l,d,p,f,v,h,b,y,g,w=this,m=ae();return(w=e.call(this,r(r({},n),{apiKey:t,userId:i,optOut:Boolean(null==n?void 0:n.optOut),storageProvider:null!==(o=null==n?void 0:n.storageProvider)&&void 0!==o?o:m.storageProvider,transportProvider:null!==(s=null==n?void 0:n.transportProvider)&&void 0!==s?s:m.transportProvider}))||this).cookieExpiration=null!==(a=null==n?void 0:n.cookieExpiration)&&void 0!==a?a:m.cookieExpiration,w.cookieSameSite=null!==(u=null==n?void 0:n.cookieSameSite)&&void 0!==u?u:m.cookieSameSite,w.cookieSecure=null!==(c=null==n?void 0:n.cookieSecure)&&void 0!==c?c:m.cookieSecure,w.cookieStorage=null!==(l=null==n?void 0:n.cookieStorage)&&void 0!==l?l:m.cookieStorage,w.disableCookies=null!==(d=null==n?void 0:n.disableCookies)&&void 0!==d?d:m.disableCookies,w.domain=null!==(p=null==n?void 0:n.domain)&&void 0!==p?p:m.domain,w.includeGclid=null!==(f=null==n?void 0:n.includeGclid)&&void 0!==f?f:m.includeGclid,w.includeFbclid=null!==(v=null==n?void 0:n.includeFbclid)&&void 0!==v?v:m.includeFbclid,w.includeReferrer=null!==(h=null==n?void 0:n.includeReferrer)&&void 0!==h?h:m.includeReferrer,w.includeUtm=null!==(b=null==n?void 0:n.includeUtm)&&void 0!==b?b:m.includeUtm,w.sessionTimeout=null!==(y=null==n?void 0:n.sessionTimeout)&&void 0!==y?y:m.sessionTimeout,w.trackingOptions=null!==(g=null==n?void 0:n.trackingOptions)&&void 0!==g?g:m.trackingOptions,w}return n(t,e),t}(B),ce=function(e,t){void 0===t&&(t=ae());var i=r(r({},t),e),n=null==e?void 0:e.cookieStorage;return n&&n.isEnabled()||(n=new ee({domain:i.domain,expirationDays:i.cookieExpiration,sameSite:i.cookieSameSite,secure:i.cookieSecure}),!i.disableCookies&&n.isEnabled()||(n=new ie).isEnabled()||(n=new ne)),n},le=function(e){var t=null==e?void 0:e.storageProvider;return t&&t.isEnabled()||(t=new ie).isEnabled()||(t=new ne),t},de=function(e,t,i){return t||i||e||H()},pe=function(e,t,i,n){return void 0===e&&(e=0),void 0===t&&(t=0),void 0===i&&(i=0),e&&Date.now()-i<n?e:t||Date.now()},fe=function(e){return e===p.TransportType.XHR?new oe:e===p.TransportType.SendBeacon?new se:ae().transportProvider},ve=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t.prototype.get=function(e){try{var t=this.getRaw(e);if(!t)return;return t.split(".").splice(-1)[0].split("|").reduce((function(e,t){var i=u(t.split("=",2),2),n=i[0],r=i[1],o=void 0===r?"":r;return o?(e[n]=decodeURIComponent(o),e):e}),{})}catch(e){return}},t.prototype.set=function(){},t}(ee),he=function(){var e=re(),t=new ve,i=t.isEnabled()&&t.get("__utmz")||{},n=e.utm_source||i.utmcsr,r=e.utm_medium||i.utmcmd,o=e.utm_campaign||i.utmccn,s=e.utm_term||i.utmctr,a=e.utm_content||i.utmcct,u={};return n&&(u.utm_source=n),r&&(u.utm_medium=r),o&&(u.utm_campaign=o),s&&(u.utm_term=s),a&&(u.utm_content=a),u},be=function(){var e,t={};try{var i=document.referrer||void 0,n=null!==(e=null==i?void 0:i.split("/")[2])&&void 0!==e?e:void 0;void 0!==i&&(t.referrer=i),void 0!==n&&(t.referring_domain=n)}catch(e){}return t},ye=function(){var e,t=re();return r({},t.gclid&&((e={}).gclid=t.gclid,e))},ge=function(){var e,t=re();return r({},t.fbclid&&((e={}).fbclid=t.fbclid,e))},we=function(e,t){var i=new ee;if(i.isEnabled()&&!(null==t?void 0:t.disableCookies)||(i=new ie),!i.isEnabled())return{optOut:!1};var n=function(e){return"".concat(m.toLowerCase(),"_").concat(e.substring(0,6))}(e),r=i.getRaw(n);if(!r)return{optOut:!1};i.remove(n);var o=u(r.split("."),5),s=o[0],a=o[1],c=o[2],l=o[3],d=o[4];return{deviceId:s,userId:Se(a),sessionId:me(l),lastEventTime:me(d),optOut:Boolean(c)}},me=function(e){var t=parseInt(e,32);if(!isNaN(t))return t},Se=function(e){if(atob&&escape&&e)try{return decodeURIComponent(escape(atob(e)))}catch(e){return}},_e=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t.prototype.init=function(t,i,n){var a,u,c;return o(this,void 0,void 0,(function(){var o,l;return s(this,(function(s){switch(s.label){case 0:return o=we(t,n),l=function(e,t,i){var n,o,s,a=ae(),u=ce(i),c=Y(e),l=u.get(c),d=re(),p=null!==(n=null==i?void 0:i.sessionTimeout)&&void 0!==n?n:a.sessionTimeout;return new ue(e,null!=t?t:null==l?void 0:l.userId,r(r({},i),{cookieStorage:u,sessionTimeout:p,deviceId:de(null==l?void 0:l.deviceId,null==i?void 0:i.deviceId,d.deviceId),optOut:null!==(o=null==i?void 0:i.optOut)&&void 0!==o?o:Boolean(null==l?void 0:l.optOut),sessionId:pe(null==l?void 0:l.sessionId,null==i?void 0:i.sessionId,null==l?void 0:l.lastEventTime,p),storageProvider:le(i),trackingOptions:r(r({},a.trackingOptions),null==i?void 0:i.trackingOptions),transportProvider:null!==(s=null==i?void 0:i.transportProvider)&&void 0!==s?s:fe(null==i?void 0:i.transport)}))}(t,i||o.userId,r(r({},n),{deviceId:null!==(a=o.deviceId)&&void 0!==a?a:null==n?void 0:n.deviceId,sessionId:null!==(u=o.sessionId)&&void 0!==u?u:null==n?void 0:n.sessionId,optOut:null!==(c=null==n?void 0:n.optOut)&&void 0!==c?c:o.optOut})),[4,e.prototype.init.call(this,void 0,void 0,l)];case 1:return s.sent(),J(this.config,o.lastEventTime),[4,this.add(new X)];case 2:return s.sent(),[4,this.add(new V)];case 3:return s.sent(),this.trackAttributions(),[2]}}))}))},t.prototype.getUserId=function(){return this.config.userId},t.prototype.setUserId=function(e){this.config.userId=e,J(this.config)},t.prototype.getDeviceId=function(){return this.config.deviceId},t.prototype.setDeviceId=function(e){this.config.deviceId=e,J(this.config)},t.prototype.getSessionId=function(){return this.config.sessionId},t.prototype.setSessionId=function(e){this.config.sessionId=e,J(this.config)},t.prototype.setOptOut=function(t){e.prototype.setOptOut.call(this,t),J(this.config)},t.prototype.setTransport=function(e){this.config.transportProvider=fe(e)},t.prototype.identify=function(t,i){if(Q(t)){var n=t._q;t._q=[],t=$(new k,n)}return e.prototype.identify.call(this,t,i)},t.prototype.groupIdentify=function(t,i,n,r){if(Q(n)){var o=n._q;n._q=[],n=$(new k,o)}return e.prototype.groupIdentify.call(this,t,i,n,r)},t.prototype.revenue=function(t,i){if(Q(t)){var n=t._q;t._q=[],t=$(new q,n)}return e.prototype.revenue.call(this,t,i)},t.prototype.trackAttributions=function(){var e=function(e){return r(r(r(r({},e.includeUtm&&he()),e.includeReferrer&&be()),e.includeGclid&&ye()),e.includeFbclid&&ge())}(this.config);if(0!==Object.keys(e).length){var t=new k;return Object.entries(e).forEach((function(e){var i=u(e,2),n=i[0],r=i[1];r&&(t.setOnce("initial_".concat(n),r),t.set(n,r))})),this.identify(t)}},t}(j),Ee=new _e,Te=Z(Ee.init.bind(Ee)),ke=Z(Ee.add.bind(Ee)),Ie=Z(Ee.remove.bind(Ee)),Oe=Z(Ee.track.bind(Ee)),xe=Z(Ee.logEvent.bind(Ee)),Pe=Z(Ee.identify.bind(Ee)),Re=Z(Ee.groupIdentify.bind(Ee)),Ne=Z(Ee.setGroup.bind(Ee)),Ue=Z(Ee.revenue.bind(Ee)),Le=Ee.getUserId.bind(Ee),je=Ee.setUserId.bind(Ee),Ae=Ee.getDeviceId.bind(Ee),qe=Ee.setDeviceId.bind(Ee),De=Ee.getSessionId.bind(Ee),Ce=Ee.setSessionId.bind(Ee),Me=Ee.setOptOut.bind(Ee),Be=Ee.setTransport.bind(Ee);e.Identify=k,e.Revenue=q,e.Types=w,e.add=ke,e.getDeviceId=Ae,e.getSessionId=De,e.getUserId=Le,e.groupIdentify=Re,e.identify=Pe,e.init=Te,e.logEvent=xe,e.remove=Ie,e.revenue=Ue,e.runQueuedFunctions=function(e,t){$(e,t)},e.setDeviceId=qe,e.setGroup=Ne,e.setOptOut=Me,e.setSessionId=Ce,e.setTransport=Be,e.setUserId=je,e.track=Oe,Object.defineProperty(e,"__esModule",{value:!0})})); |
@@ -1,1 +0,1 @@ | ||
!function(){"use strict";!function(e,t){var r=e.amplitude||{_q:[]};if(r.invoked)e.console&&console.error&&console.error("Amplitude snippet has been loaded.");else{r.invoked=!0;var n=t.createElement("script");n.type="text/javascript",n.integrity="sha384-TeoEVjqxsQrwhskzwWGK6epJC7EkYjvl7k4gmwunKlRBkUK9nT01H4FL9z4VPMSm",n.crossOrigin="anonymous",n.async=!0,n.src="https://cdn.amplitude.com/libs/analytics-browser-0.3.1-min.js.gz",n.onload=function(){e.amplitude.runQueuedFunctions||console.log("[Amplitude] Error: could not load SDK")};var s=t.getElementsByTagName("script")[0];function v(e,t){e.prototype[t]=function(){return this._q.push({name:t,args:Array.prototype.slice.call(arguments,0)}),this}}s.parentNode.insertBefore(n,s);for(var o=function(){return this._q=[],this},i=["add","append","clearAll","prepend","set","setOnce","unset","preInsert","postInsert","remove","getUserProperties"],a=0;a<i.length;a++)v(o,i[a]);r.Identify=o;for(var u=function(){return this._q=[],this},c=["getEventProperties","setProductId","setQuantity","setPrice","setRevenue","setRevenueType","setEventProperties"],p=0;p<c.length;p++)v(u,c[p]);r.Revenue=u;var l=["getDeviceId","setDeviceId","getSessionId","setSessionId","getUserId","setUserId","setOptOut","setTransport"],d=["init","add","remove","track","logEvent","identify","groupIdentify","setGroup","revenue"];function m(e){function t(t,r){e[t]=function(){var n={promise:new Promise((r=>{e._q.push({name:t,args:Array.prototype.slice.call(arguments,0),resolve:r})}))};if(r)return n}}for(var r=0;r<l.length;r++)t(l[r],!1);for(var n=0;n<d.length;n++)t(d[n],!0)}m(r),e.amplitude=r}}(window,document)}(); | ||
!function(){"use strict";!function(e,t){var r=e.amplitude||{_q:[]};if(r.invoked)e.console&&console.error&&console.error("Amplitude snippet has been loaded.");else{r.invoked=!0;var n=t.createElement("script");n.type="text/javascript",n.integrity="sha384-cTyMPwluBEHeat1GN+1GyBa6Iy+7pBUktRKWt7PHWlXs/7XucraxWtXA4s/tysw3",n.crossOrigin="anonymous",n.async=!0,n.src="https://cdn.amplitude.com/libs/analytics-browser-0.4.0-min.js.gz",n.onload=function(){e.amplitude.runQueuedFunctions||console.log("[Amplitude] Error: could not load SDK")};var s=t.getElementsByTagName("script")[0];function v(e,t){e.prototype[t]=function(){return this._q.push({name:t,args:Array.prototype.slice.call(arguments,0)}),this}}s.parentNode.insertBefore(n,s);for(var o=function(){return this._q=[],this},i=["add","append","clearAll","prepend","set","setOnce","unset","preInsert","postInsert","remove","getUserProperties"],a=0;a<i.length;a++)v(o,i[a]);r.Identify=o;for(var u=function(){return this._q=[],this},c=["getEventProperties","setProductId","setQuantity","setPrice","setRevenue","setRevenueType","setEventProperties"],p=0;p<c.length;p++)v(u,c[p]);r.Revenue=u;var l=["getDeviceId","setDeviceId","getSessionId","setSessionId","getUserId","setUserId","setOptOut","setTransport"],d=["init","add","remove","track","logEvent","identify","groupIdentify","setGroup","revenue"];function f(e){function t(t,r){e[t]=function(){var n={promise:new Promise((r=>{e._q.push({name:t,args:Array.prototype.slice.call(arguments,0),resolve:r})}))};if(r)return n}}for(var r=0;r<l.length;r++)t(l[r],!1);for(var n=0;n<d.length;n++)t(d[n],!0)}f(r),e.amplitude=r}}(window,document)}(); |
{ | ||
"name": "@amplitude/analytics-browser", | ||
"version": "0.3.1", | ||
"description": "", | ||
"version": "0.4.0", | ||
"description": "Official Amplitude SDK for Web", | ||
"keywords": [ | ||
"analytics", | ||
"amplitude" | ||
], | ||
"author": "Amplitude Inc", | ||
@@ -32,3 +36,3 @@ "homepage": "https://github.com/amplitude/Amplitude-TypeScript", | ||
"typecheck": "tsc -p ./tsconfig.json", | ||
"version": "yarn build", | ||
"version": "GENERATE_SNIPPET=true yarn build", | ||
"vesion-file": "node -p \"'export const VERSION = \\'' + require('./package.json').version + '\\';'\" > src/version.ts" | ||
@@ -40,4 +44,4 @@ }, | ||
"dependencies": { | ||
"@amplitude/analytics-core": "^0.2.4", | ||
"@amplitude/analytics-types": "^0.1.3", | ||
"@amplitude/analytics-core": "^0.3.0", | ||
"@amplitude/analytics-types": "^0.2.0", | ||
"@amplitude/ua-parser-js": "^0.7.26", | ||
@@ -61,3 +65,3 @@ "tslib": "^2.3.1" | ||
], | ||
"gitHead": "58392895e0f09cd602676f7f25504d54b80a44d0" | ||
"gitHead": "3899a210e9848fcf66a4cd2b353ea2c0c6dd45dc" | ||
} |
@@ -35,3 +35,3 @@ <p align="center"> | ||
<script type="text/javascript"> | ||
!function(){"use strict";!function(e,t){var r=e.amplitude||{_q:[]};if(r.invoked)e.console&&console.error&&console.error("Amplitude snippet has been loaded.");else{r.invoked=!0;var n=t.createElement("script");n.type="text/javascript",n.integrity="sha384-TeoEVjqxsQrwhskzwWGK6epJC7EkYjvl7k4gmwunKlRBkUK9nT01H4FL9z4VPMSm",n.crossOrigin="anonymous",n.async=!0,n.src="https://cdn.amplitude.com/libs/analytics-browser-0.3.1-min.js.gz",n.onload=function(){e.amplitude.runQueuedFunctions||console.log("[Amplitude] Error: could not load SDK")};var s=t.getElementsByTagName("script")[0];function v(e,t){e.prototype[t]=function(){return this._q.push({name:t,args:Array.prototype.slice.call(arguments,0)}),this}}s.parentNode.insertBefore(n,s);for(var o=function(){return this._q=[],this},i=["add","append","clearAll","prepend","set","setOnce","unset","preInsert","postInsert","remove","getUserProperties"],a=0;a<i.length;a++)v(o,i[a]);r.Identify=o;for(var u=function(){return this._q=[],this},c=["getEventProperties","setProductId","setQuantity","setPrice","setRevenue","setRevenueType","setEventProperties"],p=0;p<c.length;p++)v(u,c[p]);r.Revenue=u;var l=["getDeviceId","setDeviceId","getSessionId","setSessionId","getUserId","setUserId","setOptOut","setTransport"],d=["init","add","remove","track","logEvent","identify","groupIdentify","setGroup","revenue"];function m(e){function t(t,r){e[t]=function(){var n={promise:new Promise((r=>{e._q.push({name:t,args:Array.prototype.slice.call(arguments,0),resolve:r})}))};if(r)return n}}for(var r=0;r<l.length;r++)t(l[r],!1);for(var n=0;n<d.length;n++)t(d[n],!0)}m(r),e.amplitude=r}}(window,document)}(); | ||
!function(){"use strict";!function(e,t){var r=e.amplitude||{_q:[]};if(r.invoked)e.console&&console.error&&console.error("Amplitude snippet has been loaded.");else{r.invoked=!0;var n=t.createElement("script");n.type="text/javascript",n.integrity="sha384-cTyMPwluBEHeat1GN+1GyBa6Iy+7pBUktRKWt7PHWlXs/7XucraxWtXA4s/tysw3",n.crossOrigin="anonymous",n.async=!0,n.src="https://cdn.amplitude.com/libs/analytics-browser-0.4.0-min.js.gz",n.onload=function(){e.amplitude.runQueuedFunctions||console.log("[Amplitude] Error: could not load SDK")};var s=t.getElementsByTagName("script")[0];function v(e,t){e.prototype[t]=function(){return this._q.push({name:t,args:Array.prototype.slice.call(arguments,0)}),this}}s.parentNode.insertBefore(n,s);for(var o=function(){return this._q=[],this},i=["add","append","clearAll","prepend","set","setOnce","unset","preInsert","postInsert","remove","getUserProperties"],a=0;a<i.length;a++)v(o,i[a]);r.Identify=o;for(var u=function(){return this._q=[],this},c=["getEventProperties","setProductId","setQuantity","setPrice","setRevenue","setRevenueType","setEventProperties"],p=0;p<c.length;p++)v(u,c[p]);r.Revenue=u;var l=["getDeviceId","setDeviceId","getSessionId","setSessionId","getUserId","setUserId","setOptOut","setTransport"],d=["init","add","remove","track","logEvent","identify","groupIdentify","setGroup","revenue"];function f(e){function t(t,r){e[t]=function(){var n={promise:new Promise((r=>{e._q.push({name:t,args:Array.prototype.slice.call(arguments,0),resolve:r})}))};if(r)return n}}for(var r=0;r<l.length;r++)t(l[r],!1);for(var n=0;n<d.length;n++)t(d[n],!0)}f(r),e.amplitude=r}}(window,document)}(); | ||
@@ -38,0 +38,0 @@ amplitude.init("YOUR_API_KEY_HERE"); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
437567
177
3434
+ Added@amplitude/analytics-core@0.3.1(transitive)
+ Added@amplitude/analytics-types@0.2.1(transitive)
- Removed@amplitude/analytics-core@0.2.4(transitive)
- Removed@amplitude/analytics-types@0.1.3(transitive)