@amplitude/analytics-browser 1.5.8 → 1.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -32,7 +32,7 @@ Alternatively, the package is also distributed through a CDN. Copy and paste the
32
32
  <!-- README_SNIPPET_BLOCK -->
33
33
  ```html
34
34
  <script type="text/javascript">
35
- !function(){"use strict";!function(e,t){var n=e.amplitude||{_q:[],_iq:[]};if(n.invoked)e.console&&console.error&&console.error("Amplitude snippet has been loaded.");else{n.invoked=!0;var r=t.createElement("script");r.type="text/javascript",r.integrity="sha384-RlEul9diq4FLF1oXbgB4FqMOPnKhXHR65WOT/1gV2+Z38fSsnyNEQn2dT/eW6Fhu",r.crossOrigin="anonymous",r.async=!0,r.src="https://cdn.amplitude.com/libs/analytics-browser-1.5.8-min.js.gz",r.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(r,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]);n.Identify=o;for(var u=function(){return this._q=[],this},c=["getEventProperties","setProductId","setQuantity","setPrice","setRevenue","setRevenueType","setEventProperties"],l=0;l<c.length;l++)v(u,c[l]);n.Revenue=u;var p=["getDeviceId","setDeviceId","getSessionId","setSessionId","getUserId","setUserId","setOptOut","setTransport","reset"],d=["init","add","remove","track","logEvent","identify","groupIdentify","setGroup","revenue","flush"];function f(e){function t(t,n){e[t]=function(){var r={promise:new Promise((n=>{e._q.push({name:t,args:Array.prototype.slice.call(arguments,0),resolve:n})}))};if(n)return r}}for(var n=0;n<p.length;n++)t(p[n],!1);for(var r=0;r<d.length;r++)t(d[r],!0)}f(n),n.createInstance=function(){var e=n._iq.push({_q:[]})-1;return f(n._iq[e]),n._iq[e]},e.amplitude=n}}(window,document)}();
35
+ !function(){"use strict";!function(e,t){var r=e.amplitude||{_q:[],_iq:[]};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-21/avgAWaXA1nUNd3f0ZOYfiIQFQVwEuIeN1FqN6xL7sk+vj57uUp85vq0fDXOPY",n.crossOrigin="anonymous",n.async=!0,n.src="https://cdn.amplitude.com/libs/analytics-browser-1.6.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 d=["getDeviceId","setDeviceId","getSessionId","setSessionId","getUserId","setUserId","setOptOut","setTransport","reset"],l=["init","add","remove","track","logEvent","identify","groupIdentify","setGroup","revenue","flush"];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<d.length;r++)t(d[r],!1);for(var n=0;n<l.length;n++)t(l[n],!0)}f(r),r.createInstance=function(){var e=r._iq.push({_q:[]})-1;return f(r._iq[e]),r._iq[e]},e.amplitude=r}}(window,document)}();
36
36
 
37
37
  amplitude.init("YOUR_API_KEY_HERE");
38
38
  </script>
@@ -1 +1 @@
1
- {"version":3,"file":"browser-client.d.ts","sourceRoot":"","sources":["../../src/browser-client.ts"],"names":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,EACb,cAAc,EAEd,YAAY,EACZ,QAAQ,IAAI,SAAS,EACrB,MAAM,EACN,OAAO,IAAI,QAAQ,EACnB,aAAa,EACd,MAAM,4BAA4B,CAAC;AAMpC,qBAAa,gBAAiB,SAAQ,aAAa,CAAC,aAAa,CAAC;IAC1D,IAAI,CAAC,MAAM,SAAK,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc;IA6D3D,sBAAsB,CAAC,iBAAiB,CAAC,EAAE,kBAAkB,EAAE,YAAY,UAAQ;IAezF,SAAS;IAIT,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS;IAQpC,WAAW;IAIX,WAAW,CAAC,QAAQ,EAAE,MAAM;IAQ5B,KAAK;IAKL,YAAY;IAIZ,YAAY,CAAC,SAAS,EAAE,MAAM;IAS9B,YAAY,CAAC,SAAS,EAAE,aAAa;IAQrC,QAAQ,CAAC,QAAQ,EAAE,SAAS,EAAE,YAAY,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,MAAM,CAAC;IAe3E,aAAa,CACX,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,GAAG,MAAM,EAAE,EAC5B,QAAQ,EAAE,SAAS,EACnB,YAAY,CAAC,EAAE,YAAY,GAC1B,OAAO,CAAC,MAAM,CAAC;IASlB,OAAO,CAAC,OAAO,EAAE,QAAQ,EAAE,YAAY,CAAC,EAAE,YAAY;CAQvD;AAED,eAAO,MAAM,cAAc,QAAO,aAsHjC,CAAC;;AAEF,wBAAgC"}
@@ -183,25 +183,25 @@ exports.AmplitudeBrowser = AmplitudeBrowser;
183
183
  var createInstance = function () {
184
184
  var client = new AmplitudeBrowser();
185
185
  return {
186
- init: (0, analytics_core_1.returnWrapper)(client.init.bind(client)),
187
- add: (0, analytics_core_1.returnWrapper)(client.add.bind(client)),
188
- remove: (0, analytics_core_1.returnWrapper)(client.remove.bind(client)),
189
- track: (0, analytics_core_1.returnWrapper)(client.track.bind(client)),
190
- logEvent: (0, analytics_core_1.returnWrapper)(client.logEvent.bind(client)),
191
- identify: (0, analytics_core_1.returnWrapper)(client.identify.bind(client)),
192
- groupIdentify: (0, analytics_core_1.returnWrapper)(client.groupIdentify.bind(client)),
193
- setGroup: (0, analytics_core_1.returnWrapper)(client.setGroup.bind(client)),
194
- revenue: (0, analytics_core_1.returnWrapper)(client.revenue.bind(client)),
195
- flush: (0, analytics_core_1.returnWrapper)(client.flush.bind(client)),
196
- getUserId: client.getUserId.bind(client),
197
- setUserId: client.setUserId.bind(client),
198
- getDeviceId: client.getDeviceId.bind(client),
199
- setDeviceId: client.setDeviceId.bind(client),
200
- reset: client.reset.bind(client),
201
- getSessionId: client.getSessionId.bind(client),
202
- setSessionId: client.setSessionId.bind(client),
203
- setOptOut: client.setOptOut.bind(client),
204
- setTransport: client.setTransport.bind(client),
186
+ init: (0, analytics_core_1.debugWrapper)((0, analytics_core_1.returnWrapper)(client.init.bind(client)), 'init', (0, analytics_core_1.getClientLogConfig)(client), (0, analytics_core_1.getClientStates)(client, ['config'])),
187
+ add: (0, analytics_core_1.debugWrapper)((0, analytics_core_1.returnWrapper)(client.add.bind(client)), 'add', (0, analytics_core_1.getClientLogConfig)(client), (0, analytics_core_1.getClientStates)(client, ['config.apiKey', 'timeline.plugins'])),
188
+ remove: (0, analytics_core_1.debugWrapper)((0, analytics_core_1.returnWrapper)(client.remove.bind(client)), 'remove', (0, analytics_core_1.getClientLogConfig)(client), (0, analytics_core_1.getClientStates)(client, ['config.apiKey', 'timeline.plugins'])),
189
+ track: (0, analytics_core_1.debugWrapper)((0, analytics_core_1.returnWrapper)(client.track.bind(client)), 'track', (0, analytics_core_1.getClientLogConfig)(client), (0, analytics_core_1.getClientStates)(client, ['config.apiKey', 'timeline.queue.length'])),
190
+ logEvent: (0, analytics_core_1.debugWrapper)((0, analytics_core_1.returnWrapper)(client.logEvent.bind(client)), 'logEvent', (0, analytics_core_1.getClientLogConfig)(client), (0, analytics_core_1.getClientStates)(client, ['config.apiKey', 'timeline.queue.length'])),
191
+ identify: (0, analytics_core_1.debugWrapper)((0, analytics_core_1.returnWrapper)(client.identify.bind(client)), 'identify', (0, analytics_core_1.getClientLogConfig)(client), (0, analytics_core_1.getClientStates)(client, ['config.apiKey', 'timeline.queue.length'])),
192
+ groupIdentify: (0, analytics_core_1.debugWrapper)((0, analytics_core_1.returnWrapper)(client.groupIdentify.bind(client)), 'groupIdentify', (0, analytics_core_1.getClientLogConfig)(client), (0, analytics_core_1.getClientStates)(client, ['config.apiKey', 'timeline.queue.length'])),
193
+ setGroup: (0, analytics_core_1.debugWrapper)((0, analytics_core_1.returnWrapper)(client.setGroup.bind(client)), 'setGroup', (0, analytics_core_1.getClientLogConfig)(client), (0, analytics_core_1.getClientStates)(client, ['config.apiKey', 'timeline.queue.length'])),
194
+ revenue: (0, analytics_core_1.debugWrapper)((0, analytics_core_1.returnWrapper)(client.revenue.bind(client)), 'revenue', (0, analytics_core_1.getClientLogConfig)(client), (0, analytics_core_1.getClientStates)(client, ['config.apiKey', 'timeline.queue.length'])),
195
+ flush: (0, analytics_core_1.debugWrapper)((0, analytics_core_1.returnWrapper)(client.flush.bind(client)), 'flush', (0, analytics_core_1.getClientLogConfig)(client), (0, analytics_core_1.getClientStates)(client, ['config.apiKey', 'timeline.queue.length'])),
196
+ getUserId: (0, analytics_core_1.debugWrapper)(client.getUserId.bind(client), 'getUserId', (0, analytics_core_1.getClientLogConfig)(client), (0, analytics_core_1.getClientStates)(client, ['config', 'config.userId'])),
197
+ setUserId: (0, analytics_core_1.debugWrapper)(client.setUserId.bind(client), 'setUserId', (0, analytics_core_1.getClientLogConfig)(client), (0, analytics_core_1.getClientStates)(client, ['config', 'config.userId'])),
198
+ getDeviceId: (0, analytics_core_1.debugWrapper)(client.getDeviceId.bind(client), 'getDeviceId', (0, analytics_core_1.getClientLogConfig)(client), (0, analytics_core_1.getClientStates)(client, ['config', 'config.deviceId'])),
199
+ setDeviceId: (0, analytics_core_1.debugWrapper)(client.setDeviceId.bind(client), 'setDeviceId', (0, analytics_core_1.getClientLogConfig)(client), (0, analytics_core_1.getClientStates)(client, ['config', 'config.deviceId'])),
200
+ reset: (0, analytics_core_1.debugWrapper)(client.reset.bind(client), 'reset', (0, analytics_core_1.getClientLogConfig)(client), (0, analytics_core_1.getClientStates)(client, ['config', 'config.userId', 'config.deviceId'])),
201
+ getSessionId: (0, analytics_core_1.debugWrapper)(client.getSessionId.bind(client), 'getSessionId', (0, analytics_core_1.getClientLogConfig)(client), (0, analytics_core_1.getClientStates)(client, ['config'])),
202
+ setSessionId: (0, analytics_core_1.debugWrapper)(client.setSessionId.bind(client), 'setSessionId', (0, analytics_core_1.getClientLogConfig)(client), (0, analytics_core_1.getClientStates)(client, ['config'])),
203
+ setOptOut: (0, analytics_core_1.debugWrapper)(client.setOptOut.bind(client), 'setOptOut', (0, analytics_core_1.getClientLogConfig)(client), (0, analytics_core_1.getClientStates)(client, ['config'])),
204
+ setTransport: (0, analytics_core_1.debugWrapper)(client.setTransport.bind(client), 'setTransport', (0, analytics_core_1.getClientLogConfig)(client), (0, analytics_core_1.getClientStates)(client, ['config'])),
205
205
  };
206
206
  };
207
207
  exports.createInstance = createInstance;
@@ -1 +1 @@
1
- {"version":3,"file":"browser-client.js","sourceRoot":"","sources":["../../src/browser-client.ts"],"names":[],"mappings":";;;AAAA,4DAA+G;AAC/G,8EAAiH;AAajH,yDAAyF;AACzF,6CAA4C;AAC5C,mCAAoF;AACpF,uDAAqD;AAErD;IAAsC,iDAA4B;IAAlE;;IAoKA,CAAC;IAnKO,+BAAI,GAAV,UAAW,MAAW,EAAE,MAAe,EAAE,OAAwB;;QAAtD,uBAAA,EAAA,WAAW;;;;;;;wBACpB,0CAA0C;wBAC1C,IAAI,IAAI,CAAC,YAAY,EAAE;4BACrB,sBAAO;yBACR;wBACD,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;wBAGN,qBAAM,IAAA,kCAAe,EAAC,MAAM,EAAE,OAAO,CAAC,EAAA;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per } from '@amplitude/analytics-core';\nimport { CampaignTracker, getAnalyticsConnector, IdentityEventSender } from '@amplitude/analytics-client-common';\nimport {\n AttributionOptions,\n BrowserClient,\n BrowserConfig,\n BrowserOptions,\n Campaign,\n EventOptions,\n Identify as IIdentify,\n Result,\n Revenue as IRevenue,\n TransportType,\n} from '@amplitude/analytics-types';\nimport { convertProxyObjectToRealObject, isInstanceProxy } from './utils/snippet-helper';\nimport { Context } from './plugins/context';\nimport { useBrowserConfig, createTransport, createFlexibleStorage } from './config';\nimport { parseOldCookies } from './cookie-migration';\n\nexport class AmplitudeBrowser extends AmplitudeCore<BrowserConfig> {\n async init(apiKey = '', userId?: string, options?: BrowserOptions) {\n // Step 0: Block concurrent initialization\n if (this.initializing) {\n return;\n }\n this.initializing = true;\n\n // Step 1: Read cookies stored by old SDK\n const oldCookies = await parseOldCookies(apiKey, options);\n\n // Step 2: Create browser config\n const browserOptions = await useBrowserConfig(apiKey, userId || oldCookies.userId, {\n ...options,\n deviceId: oldCookies.deviceId ?? options?.deviceId,\n sessionId: oldCookies.sessionId ?? options?.sessionId,\n optOut: options?.optOut ?? oldCookies.optOut,\n lastEventTime: oldCookies.lastEventTime,\n });\n\n await super._init(browserOptions);\n\n // Step 3: Manage session\n let isNewSession = !this.config.lastEventTime;\n if (\n !this.config.sessionId ||\n (this.config.lastEventTime && Date.now() - this.config.lastEventTime > this.config.sessionTimeout)\n ) {\n // Either\n // 1) No previous session; or\n // 2) Previous session expired\n this.setSessionId(Date.now());\n isNewSession = true;\n }\n\n // Set up the analytics connector to integrate with the experiment SDK.\n // Send events from the experiment SDK and forward identifies to the\n // identity store.\n const connector = getAnalyticsConnector();\n connector.eventBridge.setEventReceiver((event) => {\n void this.track(event.eventType, event.eventProperties);\n });\n connector.identityStore.setIdentity({\n userId: this.config.userId,\n deviceId: this.config.deviceId,\n });\n\n // Step 4: Install plugins\n // Do not track any events before this\n await this.add(new Context());\n await this.add(new IdentityEventSender());\n await this.add(new Destination());\n\n this.initializing = false;\n\n // Step 5: Track attributions\n await this.runAttributionStrategy(browserOptions.attribution, isNewSession);\n\n // Step 6: Run queued dispatch functions\n await this.runQueuedFunctions('dispatchQ');\n }\n\n async runAttributionStrategy(attributionConfig?: AttributionOptions, isNewSession = false) {\n const track = this.track.bind(this);\n const onNewCampaign = this.setSessionId.bind(this, Date.now());\n\n const storage = await createFlexibleStorage<Campaign>(this.config);\n const campaignTracker = new CampaignTracker(this.config.apiKey, {\n ...attributionConfig,\n storage,\n track,\n onNewCampaign,\n });\n\n await campaignTracker.send(isNewSession);\n }\n\n getUserId() {\n return this.config?.userId;\n }\n\n setUserId(userId: string | undefined) {\n if (!this.config) {\n this.q.push(this.setUserId.bind(this, userId));\n return;\n }\n this.config.userId = userId;\n }\n\n getDeviceId() {\n return this.config?.deviceId;\n }\n\n setDeviceId(deviceId: string) {\n if (!this.config) {\n this.q.push(this.setDeviceId.bind(this, deviceId));\n return;\n }\n this.config.deviceId = deviceId;\n }\n\n reset() {\n this.setUserId(undefined);\n this.setDeviceId(UUID());\n }\n\n getSessionId() {\n return this.config?.sessionId;\n }\n\n setSessionId(sessionId: number) {\n if (!this.config) {\n this.q.push(this.setSessionId.bind(this, sessionId));\n return;\n }\n this.config.sessionId = sessionId;\n this.config.lastEventTime = undefined;\n }\n\n setTransport(transport: TransportType) {\n if (!this.config) {\n this.q.push(this.setTransport.bind(this, transport));\n return;\n }\n this.config.transportProvider = createTransport(transport);\n }\n\n identify(identify: IIdentify, eventOptions?: EventOptions): Promise<Result> {\n if (isInstanceProxy(identify)) {\n const queue = identify._q;\n identify._q = [];\n identify = convertProxyObjectToRealObject(new Identify(), queue);\n }\n if (eventOptions?.user_id) {\n this.setUserId(eventOptions.user_id);\n }\n if (eventOptions?.device_id) {\n this.setDeviceId(eventOptions.device_id);\n }\n return super.identify(identify, eventOptions);\n }\n\n groupIdentify(\n groupType: string,\n groupName: string | string[],\n identify: IIdentify,\n eventOptions?: EventOptions,\n ): Promise<Result> {\n if (isInstanceProxy(identify)) {\n const queue = identify._q;\n identify._q = [];\n identify = convertProxyObjectToRealObject(new Identify(), queue);\n }\n return super.groupIdentify(groupType, groupName, identify, eventOptions);\n }\n\n revenue(revenue: IRevenue, eventOptions?: EventOptions) {\n if (isInstanceProxy(revenue)) {\n const queue = revenue._q;\n revenue._q = [];\n revenue = convertProxyObjectToRealObject(new Revenue(), queue);\n }\n return super.revenue(revenue, eventOptions);\n }\n}\n\nexport const createInstance = (): BrowserClient => {\n const client = new AmplitudeBrowser();\n return {\n init: returnWrapper(client.init.bind(client)),\n add: returnWrapper(client.add.bind(client)),\n remove: returnWrapper(client.remove.bind(client)),\n track: returnWrapper(client.track.bind(client)),\n logEvent: returnWrapper(client.logEvent.bind(client)),\n identify: returnWrapper(client.identify.bind(client)),\n groupIdentify: returnWrapper(client.groupIdentify.bind(client)),\n setGroup: returnWrapper(client.setGroup.bind(client)),\n revenue: returnWrapper(client.revenue.bind(client)),\n flush: returnWrapper(client.flush.bind(client)),\n getUserId: client.getUserId.bind(client),\n setUserId: client.setUserId.bind(client),\n getDeviceId: client.getDeviceId.bind(client),\n setDeviceId: client.setDeviceId.bind(client),\n reset: client.reset.bind(client),\n getSessionId: client.getSessionId.bind(client),\n setSessionId: client.setSessionId.bind(client),\n setOptOut: client.setOptOut.bind(client),\n setTransport: client.setTransport.bind(client),\n };\n};\n\nexport default createInstance();\n"]}
1
+ {"version":3,"file":"browser-client.js","sourceRoot":"","sources":["../../src/browser-client.ts"],"names":[],"mappings":";;;AAAA,4DAUmC;AACnC,8EAAiH;AAajH,yDAAyF;AACzF,6CAA4C;AAC5C,mCAAoF;AACpF,uDAAqD;AAErD;IAAsC,iDAA4B;IAAlE;;IAoKA,CAAC;IAnKO,+BAAI,GAAV,UAAW,MAAW,EAAE,MAAe,EAAE,OAAwB;;QAAtD,uBAAA,EAAA,WAAW;;;;;;;wBACpB,0CAA0C;wBAC1C,IAAI,IAAI,CAAC,YAAY,EAAE;4BACrB,sBAAO;yBACR;w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,mCAAkB,EAAC,MAAM,CAAC,EAC1B,IAAA,gCAAe,EAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,CAAC,CACpC;QACD,YAAY,EAAE,IAAA,6BAAY,EACxB,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,EAChC,cAAc,EACd,IAAA,mCAAkB,EAAC,MAAM,CAAC,EAC1B,IAAA,gCAAe,EAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,CAAC,CACpC;KACF,CAAC;AACJ,CAAC,CAAC;AAtHW,QAAA,cAAc,kBAsHzB;AAEF,kBAAe,IAAA,sBAAc,GAAE,CAAC","sourcesContent":["import {\n AmplitudeCore,\n Destination,\n Identify,\n Revenue,\n UUID,\n returnWrapper,\n debugWrapper,\n getClientLogConfig,\n getClientStates,\n} from '@amplitude/analytics-core';\nimport { CampaignTracker, getAnalyticsConnector, IdentityEventSender } from '@amplitude/analytics-client-common';\nimport {\n AttributionOptions,\n BrowserClient,\n BrowserConfig,\n BrowserOptions,\n Campaign,\n EventOptions,\n Identify as IIdentify,\n Result,\n Revenue as IRevenue,\n TransportType,\n} from '@amplitude/analytics-types';\nimport { convertProxyObjectToRealObject, isInstanceProxy } from './utils/snippet-helper';\nimport { Context } from './plugins/context';\nimport { useBrowserConfig, createTransport, createFlexibleStorage } from './config';\nimport { parseOldCookies } from './cookie-migration';\n\nexport class AmplitudeBrowser extends AmplitudeCore<BrowserConfig> {\n async init(apiKey = '', userId?: string, options?: BrowserOptions) {\n // Step 0: Block concurrent initialization\n if (this.initializing) {\n return;\n }\n this.initializing = true;\n\n // Step 1: Read cookies stored by old SDK\n const oldCookies = await parseOldCookies(apiKey, options);\n\n // Step 2: Create browser config\n const browserOptions = await useBrowserConfig(apiKey, userId || oldCookies.userId, {\n ...options,\n deviceId: oldCookies.deviceId ?? options?.deviceId,\n sessionId: oldCookies.sessionId ?? options?.sessionId,\n optOut: options?.optOut ?? oldCookies.optOut,\n lastEventTime: oldCookies.lastEventTime,\n });\n\n await super._init(browserOptions);\n\n // Step 3: Manage session\n let isNewSession = !this.config.lastEventTime;\n if (\n !this.config.sessionId ||\n (this.config.lastEventTime && Date.now() - this.config.lastEventTime > this.config.sessionTimeout)\n ) {\n // Either\n // 1) No previous session; or\n // 2) Previous session expired\n this.setSessionId(Date.now());\n isNewSession = true;\n }\n\n // Set up the analytics connector to integrate with the experiment SDK.\n // Send events from the experiment SDK and forward identifies to the\n // identity store.\n const connector = getAnalyticsConnector();\n connector.eventBridge.setEventReceiver((event) => {\n void this.track(event.eventType, event.eventProperties);\n });\n connector.identityStore.setIdentity({\n userId: this.config.userId,\n deviceId: this.config.deviceId,\n });\n\n // Step 4: Install plugins\n // Do not track any events before this\n await this.add(new Context());\n await this.add(new IdentityEventSender());\n await this.add(new Destination());\n\n this.initializing = false;\n\n // Step 5: Track attributions\n await this.runAttributionStrategy(browserOptions.attribution, isNewSession);\n\n // Step 6: Run queued dispatch functions\n await this.runQueuedFunctions('dispatchQ');\n }\n\n async runAttributionStrategy(attributionConfig?: AttributionOptions, isNewSession = false) {\n const track = this.track.bind(this);\n const onNewCampaign = this.setSessionId.bind(this, Date.now());\n\n const storage = await createFlexibleStorage<Campaign>(this.config);\n const campaignTracker = new CampaignTracker(this.config.apiKey, {\n ...attributionConfig,\n storage,\n track,\n onNewCampaign,\n });\n\n await campaignTracker.send(isNewSession);\n }\n\n getUserId() {\n return this.config?.userId;\n }\n\n setUserId(userId: string | undefined) {\n if (!this.config) {\n this.q.push(this.setUserId.bind(this, userId));\n return;\n }\n this.config.userId = userId;\n }\n\n getDeviceId() {\n return this.config?.deviceId;\n }\n\n setDeviceId(deviceId: string) {\n if (!this.config) {\n this.q.push(this.setDeviceId.bind(this, deviceId));\n return;\n }\n this.config.deviceId = deviceId;\n }\n\n reset() {\n this.setUserId(undefined);\n this.setDeviceId(UUID());\n }\n\n getSessionId() {\n return this.config?.sessionId;\n }\n\n setSessionId(sessionId: number) {\n if (!this.config) {\n this.q.push(this.setSessionId.bind(this, sessionId));\n return;\n }\n this.config.sessionId = sessionId;\n this.config.lastEventTime = undefined;\n }\n\n setTransport(transport: TransportType) {\n if (!this.config) {\n this.q.push(this.setTransport.bind(this, transport));\n return;\n }\n this.config.transportProvider = createTransport(transport);\n }\n\n identify(identify: IIdentify, eventOptions?: EventOptions): Promise<Result> {\n if (isInstanceProxy(identify)) {\n const queue = identify._q;\n identify._q = [];\n identify = convertProxyObjectToRealObject(new Identify(), queue);\n }\n if (eventOptions?.user_id) {\n this.setUserId(eventOptions.user_id);\n }\n if (eventOptions?.device_id) {\n this.setDeviceId(eventOptions.device_id);\n }\n return super.identify(identify, eventOptions);\n }\n\n groupIdentify(\n groupType: string,\n groupName: string | string[],\n identify: IIdentify,\n eventOptions?: EventOptions,\n ): Promise<Result> {\n if (isInstanceProxy(identify)) {\n const queue = identify._q;\n identify._q = [];\n identify = convertProxyObjectToRealObject(new Identify(), queue);\n }\n return super.groupIdentify(groupType, groupName, identify, eventOptions);\n }\n\n revenue(revenue: IRevenue, eventOptions?: EventOptions) {\n if (isInstanceProxy(revenue)) {\n const queue = revenue._q;\n revenue._q = [];\n revenue = convertProxyObjectToRealObject(new Revenue(), queue);\n }\n return super.revenue(revenue, eventOptions);\n }\n}\n\nexport const createInstance = (): BrowserClient => {\n const client = new AmplitudeBrowser();\n return {\n init: debugWrapper(\n returnWrapper(client.init.bind(client)),\n 'init',\n getClientLogConfig(client),\n getClientStates(client, ['config']),\n ),\n add: debugWrapper(\n returnWrapper(client.add.bind(client)),\n 'add',\n getClientLogConfig(client),\n getClientStates(client, ['config.apiKey', 'timeline.plugins']),\n ),\n remove: debugWrapper(\n returnWrapper(client.remove.bind(client)),\n 'remove',\n getClientLogConfig(client),\n getClientStates(client, ['config.apiKey', 'timeline.plugins']),\n ),\n track: debugWrapper(\n returnWrapper(client.track.bind(client)),\n 'track',\n getClientLogConfig(client),\n getClientStates(client, ['config.apiKey', 'timeline.queue.length']),\n ),\n logEvent: debugWrapper(\n returnWrapper(client.logEvent.bind(client)),\n 'logEvent',\n getClientLogConfig(client),\n getClientStates(client, ['config.apiKey', 'timeline.queue.length']),\n ),\n identify: debugWrapper(\n returnWrapper(client.identify.bind(client)),\n 'identify',\n getClientLogConfig(client),\n getClientStates(client, ['config.apiKey', 'timeline.queue.length']),\n ),\n groupIdentify: debugWrapper(\n returnWrapper(client.groupIdentify.bind(client)),\n 'groupIdentify',\n getClientLogConfig(client),\n getClientStates(client, ['config.apiKey', 'timeline.queue.length']),\n ),\n setGroup: debugWrapper(\n returnWrapper(client.setGroup.bind(client)),\n 'setGroup',\n getClientLogConfig(client),\n getClientStates(client, ['config.apiKey', 'timeline.queue.length']),\n ),\n revenue: debugWrapper(\n returnWrapper(client.revenue.bind(client)),\n 'revenue',\n getClientLogConfig(client),\n getClientStates(client, ['config.apiKey', 'timeline.queue.length']),\n ),\n flush: debugWrapper(\n returnWrapper(client.flush.bind(client)),\n 'flush',\n getClientLogConfig(client),\n getClientStates(client, ['config.apiKey', 'timeline.queue.length']),\n ),\n getUserId: debugWrapper(\n client.getUserId.bind(client),\n 'getUserId',\n getClientLogConfig(client),\n getClientStates(client, ['config', 'config.userId']),\n ),\n setUserId: debugWrapper(\n client.setUserId.bind(client),\n 'setUserId',\n getClientLogConfig(client),\n getClientStates(client, ['config', 'config.userId']),\n ),\n getDeviceId: debugWrapper(\n client.getDeviceId.bind(client),\n 'getDeviceId',\n getClientLogConfig(client),\n getClientStates(client, ['config', 'config.deviceId']),\n ),\n setDeviceId: debugWrapper(\n client.setDeviceId.bind(client),\n 'setDeviceId',\n getClientLogConfig(client),\n getClientStates(client, ['config', 'config.deviceId']),\n ),\n reset: debugWrapper(\n client.reset.bind(client),\n 'reset',\n getClientLogConfig(client),\n getClientStates(client, ['config', 'config.userId', 'config.deviceId']),\n ),\n getSessionId: debugWrapper(\n client.getSessionId.bind(client),\n 'getSessionId',\n getClientLogConfig(client),\n getClientStates(client, ['config']),\n ),\n setSessionId: debugWrapper(\n client.setSessionId.bind(client),\n 'setSessionId',\n getClientLogConfig(client),\n getClientStates(client, ['config']),\n ),\n setOptOut: debugWrapper(\n client.setOptOut.bind(client),\n 'setOptOut',\n getClientLogConfig(client),\n getClientStates(client, ['config']),\n ),\n setTransport: debugWrapper(\n client.setTransport.bind(client),\n 'setTransport',\n getClientLogConfig(client),\n getClientStates(client, ['config']),\n ),\n };\n};\n\nexport default createInstance();\n"]}
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "1.5.8";
1
+ export declare const VERSION = "1.6.1";
2
2
  //# sourceMappingURL=version.d.ts.map
@@ -1,4 +1,4 @@
1
1
  Object.defineProperty(exports, "__esModule", { value: true });
2
2
  exports.VERSION = void 0;
3
- exports.VERSION = '1.5.8';
3
+ exports.VERSION = '1.6.1';
4
4
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":";;AAAa,QAAA,OAAO,GAAG,OAAO,CAAC","sourcesContent":["export const VERSION = '1.5.8';\n"]}
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":";;AAAa,QAAA,OAAO,GAAG,OAAO,CAAC","sourcesContent":["export const VERSION = '1.6.1';\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"browser-client.d.ts","sourceRoot":"","sources":["../../src/browser-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAuD,MAAM,2BAA2B,CAAC;AAE/G,OAAO,EACL,kBAAkB,EAClB,aAAa,EACb,aAAa,EACb,cAAc,EAEd,YAAY,EACZ,QAAQ,IAAI,SAAS,EACrB,MAAM,EACN,OAAO,IAAI,QAAQ,EACnB,aAAa,EACd,MAAM,4BAA4B,CAAC;AAMpC,qBAAa,gBAAiB,SAAQ,aAAa,CAAC,aAAa,CAAC;IAC1D,IAAI,CAAC,MAAM,SAAK,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,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AM,EAAE,MAAM,GAAG,SAAS;IAQpC,WAAW;IAIX,WAAW,CAAC,QAAQ,EAAE,MAAM;IAQ5B,KAAK;IAKL,YAAY;IAIZ,YAAY,CAAC,SAAS,EAAE,MAAM;IAS9B,YAAY,CAAC,SAAS,EAAE,aAAa;IAQrC,QAAQ,CAAC,QAAQ,EAAE,SAAS,EAAE,YAAY,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,MAAM,CAAC;IAe3E,aAAa,CACX,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,GAAG,MAAM,EAAE,EAC5B,QAAQ,EAAE,SAAS,EACnB,YAAY,CAAC,EAAE,YAAY,GAC1B,OAAO,CAAC,MAAM,CAAC;IASlB,OAAO,CAAC,OAAO,EAAE,QAAQ,EAAE,YAAY,CAAC,EAAE,YAAY;CAQvD;AAED,eAAO,MAAM,cAAc,QAAO,aAsHjC,CAAC;;AAEF,wBAAgC"}
@@ -1,5 +1,5 @@
1
1
  import { __assign, __awaiter, __extends, __generator } from "tslib";
2
- import { AmplitudeCore, Destination, Identify, Revenue, UUID, returnWrapper } from '@amplitude/analytics-core';
2
+ import { AmplitudeCore, Destination, Identify, Revenue, UUID, returnWrapper, debugWrapper, getClientLogConfig, getClientStates, } from '@amplitude/analytics-core';
3
3
  import { CampaignTracker, getAnalyticsConnector, IdentityEventSender } from '@amplitude/analytics-client-common';
4
4
  import { convertProxyObjectToRealObject, isInstanceProxy } from './utils/snippet-helper';
5
5
  import { Context } from './plugins/context';
@@ -181,25 +181,25 @@ export { AmplitudeBrowser };
181
181
  export var createInstance = function () {
182
182
  var client = new AmplitudeBrowser();
183
183
  return {
184
- init: returnWrapper(client.init.bind(client)),
185
- add: returnWrapper(client.add.bind(client)),
186
- remove: returnWrapper(client.remove.bind(client)),
187
- track: returnWrapper(client.track.bind(client)),
188
- logEvent: returnWrapper(client.logEvent.bind(client)),
189
- identify: returnWrapper(client.identify.bind(client)),
190
- groupIdentify: returnWrapper(client.groupIdentify.bind(client)),
191
- setGroup: returnWrapper(client.setGroup.bind(client)),
192
- revenue: returnWrapper(client.revenue.bind(client)),
193
- flush: returnWrapper(client.flush.bind(client)),
194
- getUserId: client.getUserId.bind(client),
195
- setUserId: client.setUserId.bind(client),
196
- getDeviceId: client.getDeviceId.bind(client),
197
- setDeviceId: client.setDeviceId.bind(client),
198
- reset: client.reset.bind(client),
199
- getSessionId: client.getSessionId.bind(client),
200
- setSessionId: client.setSessionId.bind(client),
201
- setOptOut: client.setOptOut.bind(client),
202
- setTransport: client.setTransport.bind(client),
184
+ init: debugWrapper(returnWrapper(client.init.bind(client)), 'init', getClientLogConfig(client), getClientStates(client, ['config'])),
185
+ add: debugWrapper(returnWrapper(client.add.bind(client)), 'add', getClientLogConfig(client), getClientStates(client, ['config.apiKey', 'timeline.plugins'])),
186
+ remove: debugWrapper(returnWrapper(client.remove.bind(client)), 'remove', getClientLogConfig(client), getClientStates(client, ['config.apiKey', 'timeline.plugins'])),
187
+ track: debugWrapper(returnWrapper(client.track.bind(client)), 'track', getClientLogConfig(client), getClientStates(client, ['config.apiKey', 'timeline.queue.length'])),
188
+ logEvent: debugWrapper(returnWrapper(client.logEvent.bind(client)), 'logEvent', getClientLogConfig(client), getClientStates(client, ['config.apiKey', 'timeline.queue.length'])),
189
+ identify: debugWrapper(returnWrapper(client.identify.bind(client)), 'identify', getClientLogConfig(client), getClientStates(client, ['config.apiKey', 'timeline.queue.length'])),
190
+ groupIdentify: debugWrapper(returnWrapper(client.groupIdentify.bind(client)), 'groupIdentify', getClientLogConfig(client), getClientStates(client, ['config.apiKey', 'timeline.queue.length'])),
191
+ setGroup: debugWrapper(returnWrapper(client.setGroup.bind(client)), 'setGroup', getClientLogConfig(client), getClientStates(client, ['config.apiKey', 'timeline.queue.length'])),
192
+ revenue: debugWrapper(returnWrapper(client.revenue.bind(client)), 'revenue', getClientLogConfig(client), getClientStates(client, ['config.apiKey', 'timeline.queue.length'])),
193
+ flush: debugWrapper(returnWrapper(client.flush.bind(client)), 'flush', getClientLogConfig(client), getClientStates(client, ['config.apiKey', 'timeline.queue.length'])),
194
+ getUserId: debugWrapper(client.getUserId.bind(client), 'getUserId', getClientLogConfig(client), getClientStates(client, ['config', 'config.userId'])),
195
+ setUserId: debugWrapper(client.setUserId.bind(client), 'setUserId', getClientLogConfig(client), getClientStates(client, ['config', 'config.userId'])),
196
+ getDeviceId: debugWrapper(client.getDeviceId.bind(client), 'getDeviceId', getClientLogConfig(client), getClientStates(client, ['config', 'config.deviceId'])),
197
+ setDeviceId: debugWrapper(client.setDeviceId.bind(client), 'setDeviceId', getClientLogConfig(client), getClientStates(client, ['config', 'config.deviceId'])),
198
+ reset: debugWrapper(client.reset.bind(client), 'reset', getClientLogConfig(client), getClientStates(client, ['config', 'config.userId', 'config.deviceId'])),
199
+ getSessionId: debugWrapper(client.getSessionId.bind(client), 'getSessionId', getClientLogConfig(client), getClientStates(client, ['config'])),
200
+ setSessionId: debugWrapper(client.setSessionId.bind(client), 'setSessionId', getClientLogConfig(client), getClientStates(client, ['config'])),
201
+ setOptOut: debugWrapper(client.setOptOut.bind(client), 'setOptOut', getClientLogConfig(client), getClientStates(client, ['config'])),
202
+ setTransport: debugWrapper(client.setTransport.bind(client), 'setTransport', getClientLogConfig(client), getClientStates(client, ['config'])),
203
203
  };
204
204
  };
205
205
  export default createInstance();
@@ -1 +1 @@
1
- {"version":3,"file":"browser-client.js","sourceRoot":"","sources":["../../src/browser-client.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC/G,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAajH,OAAO,EAAE,8BAA8B,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzF,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,O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AS,EAAE,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC;QACxC,YAAY,EAAE,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC;KAC/C,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,cAAc,EAAE,CAAC","sourcesContent":["import { AmplitudeCore, Destination, Identify, Revenue, UUID, returnWrapper } from '@amplitude/analytics-core';\nimport { CampaignTracker, getAnalyticsConnector, IdentityEventSender } from '@amplitude/analytics-client-common';\nimport {\n AttributionOptions,\n BrowserClient,\n BrowserConfig,\n BrowserOptions,\n Campaign,\n EventOptions,\n Identify as IIdentify,\n Result,\n Revenue as IRevenue,\n TransportType,\n} from '@amplitude/analytics-types';\nimport { convertProxyObjectToRealObject, isInstanceProxy } from './utils/snippet-helper';\nimport { Context } from './plugins/context';\nimport { useBrowserConfig, createTransport, createFlexibleStorage } from './config';\nimport { parseOldCookies } from './cookie-migration';\n\nexport class AmplitudeBrowser extends AmplitudeCore<BrowserConfig> {\n async init(apiKey = '', userId?: string, options?: BrowserOptions) {\n // Step 0: Block concurrent initialization\n if (this.initializing) {\n return;\n }\n this.initializing = true;\n\n // Step 1: Read cookies stored by old SDK\n const oldCookies = await parseOldCookies(apiKey, options);\n\n // Step 2: Create browser config\n const browserOptions = await useBrowserConfig(apiKey, userId || oldCookies.userId, {\n ...options,\n deviceId: oldCookies.deviceId ?? options?.deviceId,\n sessionId: oldCookies.sessionId ?? options?.sessionId,\n optOut: options?.optOut ?? oldCookies.optOut,\n lastEventTime: oldCookies.lastEventTime,\n });\n\n await super._init(browserOptions);\n\n // Step 3: Manage session\n let isNewSession = !this.config.lastEventTime;\n if (\n !this.config.sessionId ||\n (this.config.lastEventTime && Date.now() - this.config.lastEventTime > this.config.sessionTimeout)\n ) {\n // Either\n // 1) No previous session; or\n // 2) Previous session expired\n this.setSessionId(Date.now());\n isNewSession = true;\n }\n\n // Set up the analytics connector to integrate with the experiment SDK.\n // Send events from the experiment SDK and forward identifies to the\n // identity store.\n const connector = getAnalyticsConnector();\n connector.eventBridge.setEventReceiver((event) => {\n void this.track(event.eventType, event.eventProperties);\n });\n connector.identityStore.setIdentity({\n userId: this.config.userId,\n deviceId: this.config.deviceId,\n });\n\n // Step 4: Install plugins\n // Do not track any events before this\n await this.add(new Context());\n await this.add(new IdentityEventSender());\n await this.add(new Destination());\n\n this.initializing = false;\n\n // Step 5: Track attributions\n await this.runAttributionStrategy(browserOptions.attribution, isNewSession);\n\n // Step 6: Run queued dispatch functions\n await this.runQueuedFunctions('dispatchQ');\n }\n\n async runAttributionStrategy(attributionConfig?: AttributionOptions, isNewSession = false) {\n const track = this.track.bind(this);\n const onNewCampaign = this.setSessionId.bind(this, Date.now());\n\n const storage = await createFlexibleStorage<Campaign>(this.config);\n const campaignTracker = new CampaignTracker(this.config.apiKey, {\n ...attributionConfig,\n storage,\n track,\n onNewCampaign,\n });\n\n await campaignTracker.send(isNewSession);\n }\n\n getUserId() {\n return this.config?.userId;\n }\n\n setUserId(userId: string | undefined) {\n if (!this.config) {\n this.q.push(this.setUserId.bind(this, userId));\n return;\n }\n this.config.userId = userId;\n }\n\n getDeviceId() {\n return this.config?.deviceId;\n }\n\n setDeviceId(deviceId: string) {\n if (!this.config) {\n this.q.push(this.setDeviceId.bind(this, deviceId));\n return;\n }\n this.config.deviceId = deviceId;\n }\n\n reset() {\n this.setUserId(undefined);\n this.setDeviceId(UUID());\n }\n\n getSessionId() {\n return this.config?.sessionId;\n }\n\n setSessionId(sessionId: number) {\n if (!this.config) {\n this.q.push(this.setSessionId.bind(this, sessionId));\n return;\n }\n this.config.sessionId = sessionId;\n this.config.lastEventTime = undefined;\n }\n\n setTransport(transport: TransportType) {\n if (!this.config) {\n this.q.push(this.setTransport.bind(this, transport));\n return;\n }\n this.config.transportProvider = createTransport(transport);\n }\n\n identify(identify: IIdentify, eventOptions?: EventOptions): Promise<Result> {\n if (isInstanceProxy(identify)) {\n const queue = identify._q;\n identify._q = [];\n identify = convertProxyObjectToRealObject(new Identify(), queue);\n }\n if (eventOptions?.user_id) {\n this.setUserId(eventOptions.user_id);\n }\n if (eventOptions?.device_id) {\n this.setDeviceId(eventOptions.device_id);\n }\n return super.identify(identify, eventOptions);\n }\n\n groupIdentify(\n groupType: string,\n groupName: string | string[],\n identify: IIdentify,\n eventOptions?: EventOptions,\n ): Promise<Result> {\n if (isInstanceProxy(identify)) {\n const queue = identify._q;\n identify._q = [];\n identify = convertProxyObjectToRealObject(new Identify(), queue);\n }\n return super.groupIdentify(groupType, groupName, identify, eventOptions);\n }\n\n revenue(revenue: IRevenue, eventOptions?: EventOptions) {\n if (isInstanceProxy(revenue)) {\n const queue = revenue._q;\n revenue._q = [];\n revenue = convertProxyObjectToRealObject(new Revenue(), queue);\n }\n return super.revenue(revenue, eventOptions);\n }\n}\n\nexport const createInstance = (): BrowserClient => {\n const client = new AmplitudeBrowser();\n return {\n init: returnWrapper(client.init.bind(client)),\n add: returnWrapper(client.add.bind(client)),\n remove: returnWrapper(client.remove.bind(client)),\n track: returnWrapper(client.track.bind(client)),\n logEvent: returnWrapper(client.logEvent.bind(client)),\n identify: returnWrapper(client.identify.bind(client)),\n groupIdentify: returnWrapper(client.groupIdentify.bind(client)),\n setGroup: returnWrapper(client.setGroup.bind(client)),\n revenue: returnWrapper(client.revenue.bind(client)),\n flush: returnWrapper(client.flush.bind(client)),\n getUserId: client.getUserId.bind(client),\n setUserId: client.setUserId.bind(client),\n getDeviceId: client.getDeviceId.bind(client),\n setDeviceId: client.setDeviceId.bind(client),\n reset: client.reset.bind(client),\n getSessionId: client.getSessionId.bind(client),\n setSessionId: client.setSessionId.bind(client),\n setOptOut: client.setOptOut.bind(client),\n setTransport: client.setTransport.bind(client),\n };\n};\n\nexport default createInstance();\n"]}
1
+ {"version":3,"file":"browser-client.js","sourceRoot":"","sources":["../../src/browser-client.ts"],"names":[],"mappings":";AAAA,OAAO,EACL,aAAa,EACb,WAAW,EACX,QAAQ,EACR,OAAO,EACP,IAAI,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S,EAAE,YAAY,CACrB,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,EAC7B,WAAW,EACX,kBAAkB,CAAC,MAAM,CAAC,EAC1B,eAAe,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,CAAC,CACpC;QACD,YAAY,EAAE,YAAY,CACxB,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,EAChC,cAAc,EACd,kBAAkB,CAAC,MAAM,CAAC,EAC1B,eAAe,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,CAAC,CACpC;KACF,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,cAAc,EAAE,CAAC","sourcesContent":["import {\n AmplitudeCore,\n Destination,\n Identify,\n Revenue,\n UUID,\n returnWrapper,\n debugWrapper,\n getClientLogConfig,\n getClientStates,\n} from '@amplitude/analytics-core';\nimport { CampaignTracker, getAnalyticsConnector, IdentityEventSender } from '@amplitude/analytics-client-common';\nimport {\n AttributionOptions,\n BrowserClient,\n BrowserConfig,\n BrowserOptions,\n Campaign,\n EventOptions,\n Identify as IIdentify,\n Result,\n Revenue as IRevenue,\n TransportType,\n} from '@amplitude/analytics-types';\nimport { convertProxyObjectToRealObject, isInstanceProxy } from './utils/snippet-helper';\nimport { Context } from './plugins/context';\nimport { useBrowserConfig, createTransport, createFlexibleStorage } from './config';\nimport { parseOldCookies } from './cookie-migration';\n\nexport class AmplitudeBrowser extends AmplitudeCore<BrowserConfig> {\n async init(apiKey = '', userId?: string, options?: BrowserOptions) {\n // Step 0: Block concurrent initialization\n if (this.initializing) {\n return;\n }\n this.initializing = true;\n\n // Step 1: Read cookies stored by old SDK\n const oldCookies = await parseOldCookies(apiKey, options);\n\n // Step 2: Create browser config\n const browserOptions = await useBrowserConfig(apiKey, userId || oldCookies.userId, {\n ...options,\n deviceId: oldCookies.deviceId ?? options?.deviceId,\n sessionId: oldCookies.sessionId ?? options?.sessionId,\n optOut: options?.optOut ?? oldCookies.optOut,\n lastEventTime: oldCookies.lastEventTime,\n });\n\n await super._init(browserOptions);\n\n // Step 3: Manage session\n let isNewSession = !this.config.lastEventTime;\n if (\n !this.config.sessionId ||\n (this.config.lastEventTime && Date.now() - this.config.lastEventTime > this.config.sessionTimeout)\n ) {\n // Either\n // 1) No previous session; or\n // 2) Previous session expired\n this.setSessionId(Date.now());\n isNewSession = true;\n }\n\n // Set up the analytics connector to integrate with the experiment SDK.\n // Send events from the experiment SDK and forward identifies to the\n // identity store.\n const connector = getAnalyticsConnector();\n connector.eventBridge.setEventReceiver((event) => {\n void this.track(event.eventType, event.eventProperties);\n });\n connector.identityStore.setIdentity({\n userId: this.config.userId,\n deviceId: this.config.deviceId,\n });\n\n // Step 4: Install plugins\n // Do not track any events before this\n await this.add(new Context());\n await this.add(new IdentityEventSender());\n await this.add(new Destination());\n\n this.initializing = false;\n\n // Step 5: Track attributions\n await this.runAttributionStrategy(browserOptions.attribution, isNewSession);\n\n // Step 6: Run queued dispatch functions\n await this.runQueuedFunctions('dispatchQ');\n }\n\n async runAttributionStrategy(attributionConfig?: AttributionOptions, isNewSession = false) {\n const track = this.track.bind(this);\n const onNewCampaign = this.setSessionId.bind(this, Date.now());\n\n const storage = await createFlexibleStorage<Campaign>(this.config);\n const campaignTracker = new CampaignTracker(this.config.apiKey, {\n ...attributionConfig,\n storage,\n track,\n onNewCampaign,\n });\n\n await campaignTracker.send(isNewSession);\n }\n\n getUserId() {\n return this.config?.userId;\n }\n\n setUserId(userId: string | undefined) {\n if (!this.config) {\n this.q.push(this.setUserId.bind(this, userId));\n return;\n }\n this.config.userId = userId;\n }\n\n getDeviceId() {\n return this.config?.deviceId;\n }\n\n setDeviceId(deviceId: string) {\n if (!this.config) {\n this.q.push(this.setDeviceId.bind(this, deviceId));\n return;\n }\n this.config.deviceId = deviceId;\n }\n\n reset() {\n this.setUserId(undefined);\n this.setDeviceId(UUID());\n }\n\n getSessionId() {\n return this.config?.sessionId;\n }\n\n setSessionId(sessionId: number) {\n if (!this.config) {\n this.q.push(this.setSessionId.bind(this, sessionId));\n return;\n }\n this.config.sessionId = sessionId;\n this.config.lastEventTime = undefined;\n }\n\n setTransport(transport: TransportType) {\n if (!this.config) {\n this.q.push(this.setTransport.bind(this, transport));\n return;\n }\n this.config.transportProvider = createTransport(transport);\n }\n\n identify(identify: IIdentify, eventOptions?: EventOptions): Promise<Result> {\n if (isInstanceProxy(identify)) {\n const queue = identify._q;\n identify._q = [];\n identify = convertProxyObjectToRealObject(new Identify(), queue);\n }\n if (eventOptions?.user_id) {\n this.setUserId(eventOptions.user_id);\n }\n if (eventOptions?.device_id) {\n this.setDeviceId(eventOptions.device_id);\n }\n return super.identify(identify, eventOptions);\n }\n\n groupIdentify(\n groupType: string,\n groupName: string | string[],\n identify: IIdentify,\n eventOptions?: EventOptions,\n ): Promise<Result> {\n if (isInstanceProxy(identify)) {\n const queue = identify._q;\n identify._q = [];\n identify = convertProxyObjectToRealObject(new Identify(), queue);\n }\n return super.groupIdentify(groupType, groupName, identify, eventOptions);\n }\n\n revenue(revenue: IRevenue, eventOptions?: EventOptions) {\n if (isInstanceProxy(revenue)) {\n const queue = revenue._q;\n revenue._q = [];\n revenue = convertProxyObjectToRealObject(new Revenue(), queue);\n }\n return super.revenue(revenue, eventOptions);\n }\n}\n\nexport const createInstance = (): BrowserClient => {\n const client = new AmplitudeBrowser();\n return {\n init: debugWrapper(\n returnWrapper(client.init.bind(client)),\n 'init',\n getClientLogConfig(client),\n getClientStates(client, ['config']),\n ),\n add: debugWrapper(\n returnWrapper(client.add.bind(client)),\n 'add',\n getClientLogConfig(client),\n getClientStates(client, ['config.apiKey', 'timeline.plugins']),\n ),\n remove: debugWrapper(\n returnWrapper(client.remove.bind(client)),\n 'remove',\n getClientLogConfig(client),\n getClientStates(client, ['config.apiKey', 'timeline.plugins']),\n ),\n track: debugWrapper(\n returnWrapper(client.track.bind(client)),\n 'track',\n getClientLogConfig(client),\n getClientStates(client, ['config.apiKey', 'timeline.queue.length']),\n ),\n logEvent: debugWrapper(\n returnWrapper(client.logEvent.bind(client)),\n 'logEvent',\n getClientLogConfig(client),\n getClientStates(client, ['config.apiKey', 'timeline.queue.length']),\n ),\n identify: debugWrapper(\n returnWrapper(client.identify.bind(client)),\n 'identify',\n getClientLogConfig(client),\n getClientStates(client, ['config.apiKey', 'timeline.queue.length']),\n ),\n groupIdentify: debugWrapper(\n returnWrapper(client.groupIdentify.bind(client)),\n 'groupIdentify',\n getClientLogConfig(client),\n getClientStates(client, ['config.apiKey', 'timeline.queue.length']),\n ),\n setGroup: debugWrapper(\n returnWrapper(client.setGroup.bind(client)),\n 'setGroup',\n getClientLogConfig(client),\n getClientStates(client, ['config.apiKey', 'timeline.queue.length']),\n ),\n revenue: debugWrapper(\n returnWrapper(client.revenue.bind(client)),\n 'revenue',\n getClientLogConfig(client),\n getClientStates(client, ['config.apiKey', 'timeline.queue.length']),\n ),\n flush: debugWrapper(\n returnWrapper(client.flush.bind(client)),\n 'flush',\n getClientLogConfig(client),\n getClientStates(client, ['config.apiKey', 'timeline.queue.length']),\n ),\n getUserId: debugWrapper(\n client.getUserId.bind(client),\n 'getUserId',\n getClientLogConfig(client),\n getClientStates(client, ['config', 'config.userId']),\n ),\n setUserId: debugWrapper(\n client.setUserId.bind(client),\n 'setUserId',\n getClientLogConfig(client),\n getClientStates(client, ['config', 'config.userId']),\n ),\n getDeviceId: debugWrapper(\n client.getDeviceId.bind(client),\n 'getDeviceId',\n getClientLogConfig(client),\n getClientStates(client, ['config', 'config.deviceId']),\n ),\n setDeviceId: debugWrapper(\n client.setDeviceId.bind(client),\n 'setDeviceId',\n getClientLogConfig(client),\n getClientStates(client, ['config', 'config.deviceId']),\n ),\n reset: debugWrapper(\n client.reset.bind(client),\n 'reset',\n getClientLogConfig(client),\n getClientStates(client, ['config', 'config.userId', 'config.deviceId']),\n ),\n getSessionId: debugWrapper(\n client.getSessionId.bind(client),\n 'getSessionId',\n getClientLogConfig(client),\n getClientStates(client, ['config']),\n ),\n setSessionId: debugWrapper(\n client.setSessionId.bind(client),\n 'setSessionId',\n getClientLogConfig(client),\n getClientStates(client, ['config']),\n ),\n setOptOut: debugWrapper(\n client.setOptOut.bind(client),\n 'setOptOut',\n getClientLogConfig(client),\n getClientStates(client, ['config']),\n ),\n setTransport: debugWrapper(\n client.setTransport.bind(client),\n 'setTransport',\n getClientLogConfig(client),\n getClientStates(client, ['config']),\n ),\n };\n};\n\nexport default createInstance();\n"]}
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "1.5.8";
1
+ export declare const VERSION = "1.6.1";
2
2
  //# sourceMappingURL=version.d.ts.map
@@ -1,2 +1,2 @@
1
- export var VERSION = '1.5.8';
1
+ export var VERSION = '1.6.1';
2
2
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,IAAM,OAAO,GAAG,OAAO,CAAC","sourcesContent":["export const VERSION = '1.5.8';\n"]}
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,IAAM,OAAO,GAAG,OAAO,CAAC","sourcesContent":["export const VERSION = '1.6.1';\n"]}
@@ -12,4 +12,4 @@
12
12
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13
13
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14
14
  PERFORMANCE OF THIS SOFTWARE.
15
- ***************************************************************************** */var e=function(t,i){return e=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])},e(t,i)};function t(t,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=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}var i=function(){return i=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},i.apply(this,arguments)};function n(e,t){var i={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(i[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(e);r<n.length;r++)t.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(e,n[r])&&(i[n[r]]=e[n[r]])}return i}function r(e,t,i,n){return new(i||(i=Promise))((function(r,o){function s(e){try{a(n.next(e))}catch(e){o(e)}}function u(e){try{a(n.throw(e))}catch(e){o(e)}}function a(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(s,u)}a((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:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(o){return function(u){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,u])}}}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 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 a(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 c,l,d,p,h,f,v,g,b=function(){return"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof self?self:"undefined"!=typeof global?global:void 0},y=function(){var e,t=b();return(null===(e=null==t?void 0:t.location)||void 0===e?void 0:e.search)?t.location.search.substring(1).split("&").filter(Boolean).reduce((function(e,t){var i=t.split("=",2),n=m(i[0]),r=m(i[1]);return r?(e[n]=r,e):e}),{}):{}},m=function(e){void 0===e&&(e="");try{return decodeURIComponent(e)}catch(e){return""}},w={utm_source:void 0,utm_medium:void 0,utm_campaign:void 0,utm_term:void 0,utm_content:void 0,referrer:void 0,referring_domain:void 0,dclid:void 0,gbraid:void 0,gclid:void 0,fbclid:void 0,ko_click_id:void 0,msclkid:void 0,ttclid:void 0,twclid:void 0,wbraid:void 0},_=function(){function e(){}return e.prototype.parse=function(){return r(this,void 0,void 0,(function(){return o(this,(function(e){return[2,i(i(i(i({},w),this.getUtmParam()),this.getReferrer()),this.getClickIds())]}))}))},e.prototype.getUtmParam=function(){var e=y();return{utm_source:e.utm_source,utm_medium:e.utm_medium,utm_campaign:e.utm_campaign,utm_term:e.utm_term,utm_content:e.utm_content}},e.prototype.getReferrer=function(){var e,t,i={referrer:void 0,referring_domain:void 0};try{i.referrer=document.referrer||void 0,i.referring_domain=null!==(t=null===(e=i.referrer)||void 0===e?void 0:e.split("/")[2])&&void 0!==t?t:void 0}catch(e){}return i},e.prototype.getClickIds=function(){var e,t=y();return(e={}).dclid=t.dclid,e.fbclid=t.fbclid,e.gbraid=t.gbraid,e.gclid=t.gclid,e.ko_click_id=t.ko_click_id,e.msclkid=t.msclkid,e.ttclid=t.ttclid,e.twclid=t.twclid,e.wbraid=t.wbraid,e},e}();!function(e){e.US="US",e.EU="EU"}(c||(c={})),function(e){e.SET="$set",e.SET_ONCE="$setOnce",e.ADD="$add",e.APPEND="$append",e.PREPEND="$prepend",e.REMOVE="$remove",e.PREINSERT="$preInsert",e.POSTINSERT="$postInsert",e.UNSET="$unset",e.CLEAR_ALL="$clearAll"}(l||(l={})),function(e){e.REVENUE_PRODUCT_ID="$productId",e.REVENUE_QUANTITY="$quantity",e.REVENUE_PRICE="$price",e.REVENUE_TYPE="$revenueType",e.REVENUE="$revenue"}(d||(d={})),function(e){e.IDENTIFY="$identify",e.GROUP_IDENTIFY="$groupidentify",e.REVENUE="revenue_amount"}(p||(p={})),function(e){e[e.None=0]="None",e[e.Error=1]="Error",e[e.Warn=2]="Warn",e[e.Verbose=3]="Verbose"}(h||(h={})),function(e){e.BEFORE="before",e.ENRICHMENT="enrichment",e.DESTINATION="destination"}(f||(f={})),function(e){e.Unknown="unknown",e.Skipped="skipped",e.Success="success",e.RateLimit="rate_limit",e.PayloadTooLarge="payload_too_large",e.Invalid="invalid",e.Failed="failed",e.Timeout="Timeout",e.SystemError="SystemError"}(v||(v={})),function(e){e.XHR="xhr",e.SendBeacon="beacon",e.Fetch="fetch"}(g||(g={}));var I,S,E=Object.freeze({__proto__:null,get ServerZone(){return c},get SpecialEventType(){return p},get IdentifyOperation(){return l},get RevenueProperty(){return d},get LogLevel(){return h},get PluginType(){return f},get Status(){return v},get TransportType(){return g}}),k="AMP",O="".concat(k,"_unsent"),T="https://api2.amplitude.com/2/httpapi",x=function(e){if(Object.keys(e).length>1e3)return!1;for(var t in e){var i=e[t];if(!P(t,i))return!1}return!0},P=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),u=o.next();!u.done;u=o.next()){var a=u.value;if(Array.isArray(a))return!1;if("object"==typeof a)r=r&&x(a);else if(!["number","string"].includes(typeof a))return!1;if(!r)return!1}}catch(e){i={error:e}}finally{try{u&&!u.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}}else{if(null==t)return!1;if("object"==typeof t)return x(t);if(!["number","string","boolean"].includes(typeof t))return!1}return!0},R=function(){function e(){this._propertySet=new Set,this._properties={}}return e.prototype.getUserProperties=function(){return i({},this._properties)},e.prototype.set=function(e,t){return this._safeSet(l.SET,e,t),this},e.prototype.setOnce=function(e,t){return this._safeSet(l.SET_ONCE,e,t),this},e.prototype.append=function(e,t){return this._safeSet(l.APPEND,e,t),this},e.prototype.prepend=function(e,t){return this._safeSet(l.PREPEND,e,t),this},e.prototype.postInsert=function(e,t){return this._safeSet(l.POSTINSERT,e,t),this},e.prototype.preInsert=function(e,t){return this._safeSet(l.PREINSERT,e,t),this},e.prototype.remove=function(e,t){return this._safeSet(l.REMOVE,e,t),this},e.prototype.add=function(e,t){return this._safeSet(l.ADD,e,t),this},e.prototype.unset=function(e){return this._safeSet(l.UNSET,e,"-"),this},e.prototype.clearAll=function(){return this._properties={},this._properties[l.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[l.CLEAR_ALL]&&(!this._propertySet.has(t)&&(e===l.ADD?"number"==typeof i:e===l.UNSET||e===l.REMOVE||P(t,i)))},e}(),N=function(e,t){return i(i({},t),{event_type:p.IDENTIFY,user_properties:e.getUserProperties()})},U=function(e,t,i){return void 0===t&&(t=0),void 0===i&&(i=v.Unknown),{event:e,code:t,message:i}},C=function(){function e(){this.queue=[],this.applying=!1,this.plugins=[]}return e.prototype.register=function(e,t){return r(this,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(),this.plugins.push(e),[2]}}))}))},e.prototype.deregister=function(e){return this.plugins.splice(this.plugins.findIndex((function(t){return t.name===e})),1),Promise.resolve()},e.prototype.reset=function(){this.applying=!1,this.plugins=[]},e.prototype.push=function(e){var t=this;return new Promise((function(i){t.queue.push([e,i]),t.scheduleApply(0)}))},e.prototype.scheduleApply=function(e){var t=this;this.applying||(this.applying=!0,setTimeout((function(){t.apply(t.queue.shift()).then((function(){t.applying=!1,t.queue.length>0&&t.scheduleApply(0)}))}),e))},e.prototype.apply=function(e){return r(this,void 0,void 0,(function(){var t,n,r,a,c,l,d,p,h,v,g,b,y,m,w,_,I,S;return o(this,(function(o){switch(o.label){case 0:if(!e)return[2];t=u(e,1),n=t[0],r=u(e,2),a=r[1],c=this.plugins.filter((function(e){return e.type===f.BEFORE})),o.label=1;case 1:o.trys.push([1,6,7,8]),l=s(c),d=l.next(),o.label=2;case 2:return d.done?[3,5]:[4,d.value.execute(i({},n))];case 3:n=o.sent(),o.label=4;case 4:return d=l.next(),[3,2];case 5:return[3,8];case 6:return p=o.sent(),w={error:p},[3,8];case 7:try{d&&!d.done&&(_=l.return)&&_.call(l)}finally{if(w)throw w.error}return[7];case 8:h=this.plugins.filter((function(e){return e.type===f.ENRICHMENT})),o.label=9;case 9:o.trys.push([9,14,15,16]),v=s(h),g=v.next(),o.label=10;case 10:return g.done?[3,13]:[4,g.value.execute(i({},n))];case 11:n=o.sent(),o.label=12;case 12:return g=v.next(),[3,10];case 13:return[3,16];case 14:return b=o.sent(),I={error:b},[3,16];case 15:try{g&&!g.done&&(S=v.return)&&S.call(v)}finally{if(I)throw I.error}return[7];case 16:return y=this.plugins.filter((function(e){return e.type===f.DESTINATION})),m=y.map((function(e){var t=i({},n);return e.execute(t).catch((function(e){return U(t,0,String(e))}))})),Promise.all(m).then((function(e){var t=u(e,1)[0];a(t)})),[2]}}))}))},e.prototype.flush=function(){return r(this,void 0,void 0,(function(){var e,t,i,n=this;return o(this,(function(r){switch(r.label){case 0:return e=this.queue,this.queue=[],[4,Promise.all(e.map((function(e){return n.apply(e)})))];case 1:return r.sent(),t=this.plugins.filter((function(e){return e.type===f.DESTINATION})),i=t.map((function(e){return e.flush&&e.flush()})),[4,Promise.all(i)];case 2:return r.sent(),[2]}}))}))},e}(),q="Event rejected due to exceeded retry count",D=function(){function e(e){void 0===e&&(e="$default"),this.initializing=!1,this.q=[],this.dispatchQ=[],this.logEvent=this.track.bind(this),this.timeline=new C,this.name=e}return e.prototype._init=function(e){return r(this,void 0,void 0,(function(){return o(this,(function(t){switch(t.label){case 0:return this.config=e,this.timeline.reset(),[4,this.runQueuedFunctions("q")];case 1:return t.sent(),[2]}}))}))},e.prototype.runQueuedFunctions=function(e){return r(this,void 0,void 0,(function(){var t,i,n,r,u,a;return o(this,(function(o){switch(o.label){case 0:t=this[e],this[e]=[],o.label=1;case 1:o.trys.push([1,6,7,8]),i=s(t),n=i.next(),o.label=2;case 2:return n.done?[3,5]:[4,(0,n.value)()];case 3:o.sent(),o.label=4;case 4:return n=i.next(),[3,2];case 5:return[3,8];case 6:return r=o.sent(),u={error:r},[3,8];case 7:try{n&&!n.done&&(a=i.return)&&a.call(i)}finally{if(u)throw u.error}return[7];case 8:return[2]}}))}))},e.prototype.track=function(e,t,n){var r=function(e,t,n){return i(i(i({},"string"==typeof e?{event_type:e}:e),n),t&&{event_properties:t})}(e,t,n);return this.dispatch(r)},e.prototype.identify=function(e,t){var i=N(e,t);return this.dispatch(i)},e.prototype.groupIdentify=function(e,t,n,r){var o=function(e,t,n,r){var o;return i(i({},r),{event_type:p.GROUP_IDENTIFY,group_properties:n.getUserProperties(),groups:(o={},o[e]=t,o)})}(e,t,n,r);return this.dispatch(o)},e.prototype.setGroup=function(e,t,n){var r=function(e,t,n){var r,o=new R;return o.set(e,t),i(i({},n),{event_type:p.IDENTIFY,user_properties:o.getUserProperties(),groups:(r={},r[e]=t,r)})}(e,t,n);return this.dispatch(r)},e.prototype.revenue=function(e,t){var n=function(e,t){return i(i({},t),{event_type:p.REVENUE,event_properties:e.getEventProperties()})}(e,t);return this.dispatch(n)},e.prototype.add=function(e){return r(this,void 0,void 0,(function(){return o(this,(function(t){return this.config?[2,this.timeline.register(e,this.config)]:(this.q.push(this.add.bind(this,e)),[2])}))}))},e.prototype.remove=function(e){return r(this,void 0,void 0,(function(){return o(this,(function(t){return this.config?[2,this.timeline.deregister(e)]:(this.q.push(this.remove.bind(this,e)),[2])}))}))},e.prototype.dispatchWithCallback=function(e,t){if(!this.config)return t(U(e,0,"Client not initialized"));this.process(e).then(t)},e.prototype.dispatch=function(e){return r(this,void 0,void 0,(function(){var t=this;return o(this,(function(i){return this.config?[2,this.process(e)]:[2,new Promise((function(i){t.dispatchQ.push(t.dispatchWithCallback.bind(t,e,i))}))]}))}))},e.prototype.process=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]),this.config.optOut?[2,U(e,0,"Event skipped due to optOut config")]:[4,this.timeline.push(e)];case 1:return 200===(n=r.sent()).code?this.config.loggerProvider.log(n.message):this.config.loggerProvider.error(n.message),[2,n];case 2:return t=r.sent(),i=String(t),this.config.loggerProvider.error(i),[2,n=U(e,0,i)];case 3:return[2]}}))}))},e.prototype.setOptOut=function(e){this.config?this.config.optOut=Boolean(e):this.q.push(this.setOptOut.bind(this,Boolean(e)))},e.prototype.flush=function(){return this.timeline.flush()},e}(),A=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 x(e)&&(this.properties=e),this},e.prototype.getEventProperties=function(){var e=this.properties?i({},this.properties):{};return e[d.REVENUE_PRODUCT_ID]=this.productId,e[d.REVENUE_QUANTITY]=this.quantity,e[d.REVENUE_PRICE]=this.price,e[d.REVENUE_TYPE]=this.revenueType,e[d.REVENUE]=this.revenue,e},e}(),j="Amplitude Logger ",M=function(){function e(){this.logLevel=h.None}return e.prototype.disable=function(){this.logLevel=h.None},e.prototype.enable=function(e){void 0===e&&(e=h.Warn),this.logLevel=e},e.prototype.log=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<h.Verbose||console.log("".concat(j,"[Log]: ").concat(e.join(" ")))},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<h.Warn||console.warn("".concat(j,"[Warn]: ").concat(e.join(" ")))},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<h.Error||console.error("".concat(j,"[Error]: ").concat(e.join(" ")))},e}(),L=function(){return{flushMaxRetries:12,flushQueueSize:200,flushIntervalMillis:1e4,logLevel:h.Warn,loggerProvider:new M,optOut:!1,serverUrl:T,serverZone:c.US,useBatch:!1}},V=function(){function e(e){var t,i,n;this._optOut=!1;var r=L();this.apiKey=e.apiKey,this.flushIntervalMillis=e.flushIntervalMillis||r.flushIntervalMillis,this.flushMaxRetries=e.flushMaxRetries||r.flushMaxRetries,this.flushQueueSize=e.flushQueueSize||r.flushQueueSize,this.loggerProvider=e.loggerProvider||r.loggerProvider,this.logLevel=null!==(t=e.logLevel)&&void 0!==t?t:r.logLevel,this.minIdLength=e.minIdLength,this.plan=e.plan,this.ingestionMetadata=e.ingestionMetadata,this.optOut=null!==(i=e.optOut)&&void 0!==i?i:r.optOut,this.serverUrl=e.serverUrl,this.serverZone=e.serverZone||r.serverZone,this.storageProvider=e.storageProvider,this.transportProvider=e.transportProvider,this.useBatch=null!==(n=e.useBatch)&&void 0!==n?n:r.useBatch,this.loggerProvider.enable(this.logLevel);var o=z(e.serverUrl,e.serverZone,e.useBatch);this.serverZone=o.serverZone,this.serverUrl=o.serverUrl}return Object.defineProperty(e.prototype,"optOut",{get:function(){return this._optOut},set:function(e){this._optOut=e},enumerable:!1,configurable:!0}),e}(),B=function(e,t){return e===c.EU?t?"https://api.eu.amplitude.com/batch":"https://api.eu.amplitude.com/2/httpapi":t?"https://api2.amplitude.com/batch":T},z=function(e,t,i){if(void 0===e&&(e=""),void 0===t&&(t=L().serverZone),void 0===i&&(i=L().useBatch),e)return{serverUrl:e,serverZone:void 0};var n=[c.US,c.EU].includes(t)?t:L().serverZone;return{serverZone:n,serverUrl:B(n,i)}},F=function(){function e(){this.name="amplitude",this.type=f.DESTINATION,this.retryTimeout=1e3,this.throttleTimeout=3e4,this.storageKey="",this.scheduled=!1,this.queue=[]}return e.prototype.setup=function(e){var t;return r(this,void 0,void 0,(function(){var i,n=this;return o(this,(function(r){switch(r.label){case 0:return this.config=e,this.storageKey="".concat(O,"_").concat(this.config.apiKey.substring(0,10)),[4,null===(t=this.config.storageProvider)||void 0===t?void 0:t.get(this.storageKey)];case 1:return i=r.sent(),this.saveEvents(),i&&i.length>0&&Promise.all(i.map((function(e){return n.execute(e)}))).catch(),[2,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)},timeout: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?(t.attempts+=1,!0):(e.fulfillRequest([t],500,q),!1)}));n.forEach((function(t){e.queue=e.queue.concat(t),0!==t.timeout?setTimeout((function(){t.timeout=0,e.schedule(0)}),t.timeout):e.schedule(e.config.flushIntervalMillis)})),this.saveEvents()},e.prototype.schedule=function(e){var t=this;this.scheduled||(this.scheduled=!0,setTimeout((function(){t.flush(!0).then((function(){t.scheduled=!1,t.queue.length>0&&t.schedule(e)}))}),e))},e.prototype.flush=function(e){return void 0===e&&(e=!1),r(this,void 0,void 0,(function(){var t,i,n,r=this;return o(this,(function(o){switch(o.label){case 0:return t=[],i=[],this.queue.forEach((function(e){return 0===e.timeout?t.push(e):i.push(e)})),this.queue=i,s=t,u=this.config.flushQueueSize,a=Math.max(u,1),n=s.reduce((function(e,t,i){var n=Math.floor(i/a);return e[n]||(e[n]=[]),e[n].push(t),e}),[]),[4,Promise.all(n.map((function(t){return r.send(t,e)})))];case 1:return o.sent(),[2]}var s,u,a}))}))},e.prototype.send=function(e,t){return void 0===t&&(t=!0),r(this,void 0,void 0,(function(){var i,r,s,u;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")];i={api_key:this.config.apiKey,events:e.map((function(e){var t=e.event;return t.extra,n(t,["extra"])})),options:{min_id_length:this.config.minIdLength}},o.label=1;case 1:return o.trys.push([1,3,,4]),r=z(this.config.serverUrl,this.config.serverZone,this.config.useBatch).serverUrl,[4,this.config.transportProvider.send(r,i)];case 2:return null===(s=o.sent())?(this.fulfillRequest(e,0,"Unexpected error occurred"),[2]):t?(this.handleReponse(s,e),[3,4]):(this.fulfillRequest(e,s.statusCode,s.status),[2]);case 3:return u=o.sent(),this.fulfillRequest(e,0,String(u)),[3,4];case 4:return[2]}}))}))},e.prototype.handleReponse=function(e,t){switch(e.status){case v.Success:this.handleSuccessResponse(e,t);break;case v.Invalid:this.handleInvalidResponse(e,t);break;case v.PayloadTooLarge:this.handlePayloadTooLargeResponse(e,t);break;case v.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||e.body.error.startsWith("Invalid API key"))this.fulfillRequest(t,e.statusCode,e.body.error);else{var n=a(a(a(a([],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,a([],u(o),!1))}},e.prototype.handlePayloadTooLargeResponse=function(e,t){1!==t.length?(this.config.flushQueueSize/=2,this.addToQueue.apply(this,a([],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),c=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&&c.has(t.event.device_id)))return l.has(n)&&(t.timeout=i.throttleTimeout),!0;i.fulfillRequest([t],e.statusCode,e.body.error)}));this.addToQueue.apply(this,a([],u(d),!1))},e.prototype.handleOtherReponse=function(e){var t=this;this.addToQueue.apply(this,a([],u(e.map((function(e){return e.timeout=e.attempts*t.retryTimeout,e}))),!1))},e.prototype.fulfillRequest=function(e,t,i){this.saveEvents(),e.forEach((function(e){return e.callback(U(e.event,t,i))}))},e.prototype.saveEvents=function(){if(this.config.storageProvider){var e=Array.from(this.queue.map((function(e){return e.event})));this.config.storageProvider.set(this.storageKey,e)}},e}(),Q=function(e){return function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];return{promise:e.apply(void 0,a([],u(t),!1))}}},$=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,$)},W=function(){function e(){this.memoryStorage=new Map}return e.prototype.isEnabled=function(){return r(this,void 0,void 0,(function(){return o(this,(function(e){return[2,!0]}))}))},e.prototype.get=function(e){return r(this,void 0,void 0,(function(){return o(this,(function(t){return[2,this.memoryStorage.get(e)]}))}))},e.prototype.getRaw=function(e){return r(this,void 0,void 0,(function(){var t;return o(this,(function(i){switch(i.label){case 0:return[4,this.get(e)];case 1:return[2,(t=i.sent())?JSON.stringify(t):void 0]}}))}))},e.prototype.set=function(e,t){return r(this,void 0,void 0,(function(){return o(this,(function(i){return this.memoryStorage.set(e,t),[2]}))}))},e.prototype.remove=function(e){return r(this,void 0,void 0,(function(){return o(this,(function(t){return this.memoryStorage.delete(e),[2]}))}))},e.prototype.reset=function(){return r(this,void 0,void 0,(function(){return o(this,(function(e){return this.memoryStorage.clear(),[2]}))}))},e}(),K=function(){function e(){}return e.prototype.send=function(e,t){return Promise.resolve(null)},e.prototype.buildResponse=function(e){var t,i,n,r,o,s,u,a,c,l,d,p,h,f,g,b,y,m,w,_,I,S;if("object"!=typeof e)return null;var E=e.code||0,k=this.buildStatus(E);switch(k){case v.Success:return{status:k,statusCode:E,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 v.Invalid:return{status:k,statusCode:E,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!==(u=e.events_with_missing_fields)&&void 0!==u?u:{},eventsWithInvalidIdLengths:null!==(a=e.events_with_invalid_id_lengths)&&void 0!==a?a:{},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!==(p=e.silenced_events)&&void 0!==p?p:[],throttledDevices:null!==(h=e.throttled_devices)&&void 0!==h?h:{},throttledEvents:null!==(f=e.throttled_events)&&void 0!==f?f:[]}};case v.PayloadTooLarge:return{status:k,statusCode:E,body:{error:null!==(g=e.error)&&void 0!==g?g:""}};case v.RateLimit:return{status:k,statusCode:E,body:{error:null!==(b=e.error)&&void 0!==b?b:"",epsThreshold:null!==(y=e.eps_threshold)&&void 0!==y?y:0,throttledDevices:null!==(m=e.throttled_devices)&&void 0!==m?m:{},throttledUsers:null!==(w=e.throttled_users)&&void 0!==w?w:{},exceededDailyQuotaDevices:null!==(_=e.exceeded_daily_quota_devices)&&void 0!==_?_:{},exceededDailyQuotaUsers:null!==(I=e.exceeded_daily_quota_users)&&void 0!==I?I:{},throttledEvents:null!==(S=e.throttled_events)&&void 0!==S?S:[]}};case v.Timeout:default:return{status:k,statusCode:E}}},e.prototype.buildStatus=function(e){return e>=200&&e<300?v.Success:429===e?v.RateLimit:413===e?v.PayloadTooLarge:408===e?v.Timeout:e>=400&&e<500?v.Invalid:e>=500?v.Failed:v.Unknown},e}(),Z=function(e,t,i){return void 0===t&&(t=""),void 0===i&&(i=10),[k,t,e.substring(0,i)].filter(Boolean).join("_")},G=function(){function e(e,t){var i,n;this.storage=t.storage,this.storageKey=Z(e,"MKTG"),this.parser=new _,this.track=t.track,this.onNewCampaign=t.onNewCampaign,this.disabled=Boolean(t.disabled),this.trackNewCampaigns=Boolean(t.trackNewCampaigns),this.trackPageViews=Boolean(t.trackPageViews),this.excludeReferrers=null!==(i=t.excludeReferrers)&&void 0!==i?i:[],"undefined"!=typeof location&&this.excludeReferrers.unshift(location.hostname),this.initialEmptyValue=null!==(n=t.initialEmptyValue)&&void 0!==n?n:"EMPTY"}return e.prototype.isNewCampaign=function(e,t){e.referrer;var i=n(e,["referrer"]),r=t||{};r.referrer;var o=n(r,["referrer"]),s=Boolean(i.referring_domain&&this.excludeReferrers.includes(i.referring_domain)),u=JSON.stringify(i)!==JSON.stringify(o);return!s&&(!t||u)},e.prototype.saveCampaignToStorage=function(e){return r(this,void 0,void 0,(function(){return o(this,(function(t){switch(t.label){case 0:return[4,this.storage.set(this.storageKey,e)];case 1:return t.sent(),[2]}}))}))},e.prototype.getCampaignFromStorage=function(){return r(this,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return[4,this.storage.get(this.storageKey)];case 1:return[2,e.sent()]}}))}))},e.prototype.createCampaignEvent=function(e){var t=this,n=i(i({},w),e),r=Object.entries(n).reduce((function(e,i){var n=u(i,2),r=n[0],o=n[1];return e.setOnce("initial_".concat(r),o||t.initialEmptyValue),o?e.set(r,o):e.unset(r)}),new R),o={event_type:"Page View",event_properties:{page_title:"undefined"!=typeof document&&document.title||"",page_location:"undefined"!=typeof location&&location.href||"",page_path:"undefined"!=typeof location&&location.pathname||""}};return i(i({},N(r)),this.trackPageViews&&o)},e.prototype.send=function(e){return r(this,void 0,void 0,(function(){var t,i;return o(this,(function(n){switch(n.label){case 0:return this.disabled?[2]:[4,this.parser.parse()];case 1:return t=n.sent(),[4,this.getCampaignFromStorage()];case 2:if(i=n.sent(),!e){if(!this.trackNewCampaigns||!this.isNewCampaign(t,i))return[2];this.onNewCampaign(t)}return[4,this.track(this.createCampaignEvent(t))];case 3:return n.sent(),[4,this.saveCampaignToStorage(t)];case 4:return n.sent(),[2]}}))}))},e}(),H=function(){function e(e){this.options=i({},e)}return e.prototype.isEnabled=function(){return r(this,void 0,void 0,(function(){var t,i,n;return o(this,(function(r){switch(r.label){case 0:if(!b())return[2,!1];t=String(Date.now()),i=new e(this.options),n="AMP_TEST",r.label=1;case 1:return r.trys.push([1,4,5,7]),[4,i.set(n,t)];case 2:return r.sent(),[4,i.get(n)];case 3:return[2,r.sent()===t];case 4:return r.sent(),[2,!1];case 5:return[4,i.remove(n)];case 6:return r.sent(),[7];case 7:return[2]}}))}))},e.prototype.get=function(e){return r(this,void 0,void 0,(function(){var t;return o(this,(function(i){switch(i.label){case 0:return[4,this.getRaw(e)];case 1:if(!(t=i.sent()))return[2,void 0];try{try{t=decodeURIComponent(atob(t))}catch(e){}return[2,JSON.parse(t)]}catch(e){return[2,void 0]}return[2]}}))}))},e.prototype.getRaw=function(e){var t;return r(this,void 0,void 0,(function(){var i,n,r;return o(this,(function(o){return i=b(),n=null!==(t=null==i?void 0:i.document.cookie.split("; "))&&void 0!==t?t:[],(r=n.find((function(t){return 0===t.indexOf(e+"=")})))?[2,r.substring(e.length+1)]:[2,void 0]}))}))},e.prototype.set=function(e,t){var i;return r(this,void 0,void 0,(function(){var n,r,s,u,a,c;return o(this,(function(o){try{n=null!==(i=this.options.expirationDays)&&void 0!==i?i:0,s=void 0,(r=null!==t?n:-1)&&((u=new Date).setTime(u.getTime()+24*r*60*60*1e3),s=u),a="".concat(e,"=").concat(btoa(encodeURIComponent(JSON.stringify(t)))),s&&(a+="; expires=".concat(s.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)),(c=b())&&(c.document.cookie=a)}catch(e){}return[2]}))}))},e.prototype.remove=function(e){return r(this,void 0,void 0,(function(){return o(this,(function(t){switch(t.label){case 0:return[4,this.set(e,null)];case 1:return t.sent(),[2]}}))}))},e.prototype.reset=function(){return r(this,void 0,void 0,(function(){return o(this,(function(e){return[2]}))}))},e}(),J=function(){function e(e,t){this.storage=e,this.isSessionCacheValid=!0,this.storageKey=Z(t),this.cache={optOut:!1}}return e.prototype.load=function(){var e;return r(this,void 0,void 0,(function(){var t;return o(this,(function(i){switch(i.label){case 0:return t=this,[4,this.storage.get(this.storageKey)];case 1:return t.cache=null!==(e=i.sent())&&void 0!==e?e:{optOut:!1},[2,this]}}))}))},e.prototype.setSession=function(e){this.cache=i(i({},this.cache),e),this.storage.set(this.storageKey,this.cache)},e.prototype.getSessionId=function(){var e=this;return this.isSessionCacheValid=!0,this.storage.get(this.storageKey).then((function(t){e.isSessionCacheValid&&(e.cache.sessionId=null==t?void 0:t.sessionId)})),this.cache.sessionId},e.prototype.setSessionId=function(e){this.isSessionCacheValid=!1,this.setSession({sessionId:e})},e.prototype.getDeviceId=function(){return this.cache.deviceId},e.prototype.setDeviceId=function(e){this.setSession({deviceId:e})},e.prototype.getUserId=function(){return this.cache.userId},e.prototype.setUserId=function(e){this.setSession({userId:e})},e.prototype.getLastEventTime=function(){return this.cache.lastEventTime},e.prototype.setLastEventTime=function(e){this.setSession({lastEventTime:e})},e.prototype.getOptOut=function(){return this.cache.optOut},e.prototype.setOptOut=function(e){this.setSession({optOut:e})},e}(),Y=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return t(i,e),i.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,this.buildResponse(n)]}}))}))},i}(K),X="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},ee={exports:{}};I=ee,S=ee.exports,function(e,t){var i="function",n="undefined",r="object",o="string",s="model",u="name",a="type",c="vendor",l="version",d="architecture",p="console",h="mobile",f="tablet",v="smarttv",g="wearable",b="embedded",y="Amazon",m="Apple",w="ASUS",_="BlackBerry",E="Firefox",k="Google",O="Huawei",T="LG",x="Microsoft",P="Motorola",R="Opera",N="Samsung",U="Sony",C="Xiaomi",q="Zebra",D="Facebook",A=function(e){for(var t={},i=0;i<e.length;i++)t[e[i].toUpperCase()]=e[i];return t},j=function(e,t){return typeof e===o&&-1!==M(t).indexOf(M(e))},M=function(e){return e.toLowerCase()},L=function(e,t){if(typeof e===o)return e=e.replace(/^\s\s*/,"").replace(/\s\s*$/,""),typeof t===n?e:e.substring(0,275)},V=function(e,n){for(var o,s,u,a,c,l,d=0;d<n.length&&!c;){var p=n[d],h=n[d+1];for(o=s=0;o<p.length&&!c;)if(c=p[o++].exec(e))for(u=0;u<h.length;u++)l=c[++s],typeof(a=h[u])===r&&a.length>0?2===a.length?typeof a[1]==i?this[a[0]]=a[1].call(this,l):this[a[0]]=a[1]:3===a.length?typeof a[1]!==i||a[1].exec&&a[1].test?this[a[0]]=l?l.replace(a[1],a[2]):t:this[a[0]]=l?a[1].call(this,l,a[2]):t:4===a.length&&(this[a[0]]=l?a[3].call(this,l.replace(a[1],a[2])):t):this[a]=l||t;d+=2}},B=function(e,i){for(var n in i)if(typeof i[n]===r&&i[n].length>0){for(var o=0;o<i[n].length;o++)if(j(i[n][o],e))return"?"===n?t:n}else if(j(i[n],e))return"?"===n?t:n;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],[l,[u,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[l,[u,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[u,l],[/opios[\/ ]+([\w\.]+)/i],[l,[u,"Opera Mini"]],[/\bopr\/([\w\.]+)/i],[l,[u,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],[u,l],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[l,[u,"UCBrowser"]],[/\bqbcore\/([\w\.]+)/i],[l,[u,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[l,[u,"WeChat"]],[/konqueror\/([\w\.]+)/i],[l,[u,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[l,[u,"IE"]],[/yabrowser\/([\w\.]+)/i],[l,[u,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[u,/(.+)/,"$1 Secure Browser"],l],[/\bfocus\/([\w\.]+)/i],[l,[u,"Firefox Focus"]],[/\bopt\/([\w\.]+)/i],[l,[u,"Opera Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[l,[u,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[l,[u,"Dolphin"]],[/coast\/([\w\.]+)/i],[l,[u,"Opera Coast"]],[/miuibrowser\/([\w\.]+)/i],[l,[u,"MIUI Browser"]],[/fxios\/([-\w\.]+)/i],[l,[u,E]],[/\bqihu|(qi?ho?o?|360)browser/i],[[u,"360 Browser"]],[/(oculus|samsung|sailfish)browser\/([\w\.]+)/i],[[u,/(.+)/,"$1 Browser"],l],[/(comodo_dragon)\/([\w\.]+)/i],[[u,/_/g," "],l],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[u,l],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i],[u],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[u,D],l],[/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/ ]([-\w\.]+)/i],[u,l],[/\bgsa\/([\w\.]+) .*safari\//i],[l,[u,"GSA"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[l,[u,"Chrome Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[u,"Chrome WebView"],l],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[l,[u,"Android Browser"]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[u,l],[/version\/([\w\.]+) .*mobile\/\w+ (safari)/i],[l,[u,"Mobile Safari"]],[/version\/([\w\.]+) .*(mobile ?safari|safari)/i],[l,u],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[u,[l,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],[u,l],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[u,"Netscape"],l],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[l,[u,"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],[u,l]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[d,"amd64"]],[/(ia32(?=;))/i],[[d,M]],[/((?:i[346]|x)86)[;\)]/i],[[d,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[d,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[d,"armhf"]],[/windows (ce|mobile); ppc;/i],[[d,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[d,/ower/,"",M]],[/(sun4\w)[;\)]/i],[[d,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[d,M]]],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],[s,[c,N],[a,f]],[/\b((?:s[cgp]h|gt|sm)-\w+|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[s,[c,N],[a,h]],[/((ipod|iphone)\d+,\d+)/i],[s,[c,m],[a,h]],[/(ipad\d+,\d+)/i],[s,[c,m],[a,f]],[/\((ip(?:hone|od)[\w ]*);/i],[s,[c,m],[a,h]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[s,[c,m],[a,f]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[s,[c,O],[a,f]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[s,[c,O],[a,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|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[s,/_/g," "],[c,C],[a,h]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[s,/_/g," "],[c,C],[a,f]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[s,[c,"OPPO"],[a,h]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[s,[c,"Vivo"],[a,h]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[s,[c,"Realme"],[a,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],[s,[c,P],[a,h]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[s,[c,P],[a,f]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[s,[c,T],[a,f]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[s,[c,T],[a,h]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[s,[c,"Lenovo"],[a,f]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[s,/_/g," "],[c,"Nokia"],[a,h]],[/(pixel c)\b/i],[s,[c,k],[a,f]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[s,[c,k],[a,h]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[s,[c,U],[a,h]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[s,"Xperia Tablet"],[c,U],[a,f]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[s,[c,"OnePlus"],[a,h]],[/(alexa)webm/i,/(kf[a-z]{2}wi)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[s,[c,y],[a,f]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[s,/(.+)/g,"Fire Phone $1"],[c,y],[a,h]],[/(playbook);[-\w\),; ]+(rim)/i],[s,c,[a,f]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[s,[c,_],[a,h]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[s,[c,w],[a,f]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[s,[c,w],[a,h]],[/(nexus 9)/i],[s,[c,"HTC"],[a,f]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic|sony(?!-bra))[-_ ]?([-\w]*)/i],[c,[s,/_/g," "],[a,h]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[s,[c,"Acer"],[a,f]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[s,[c,"Meizu"],[a,h]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[s,[c,"Sharp"],[a,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],[c,s,[a,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],[c,s,[a,f]],[/(surface duo)/i],[s,[c,x],[a,f]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[s,[c,"Fairphone"],[a,h]],[/(u304aa)/i],[s,[c,"AT&T"],[a,h]],[/\bsie-(\w*)/i],[s,[c,"Siemens"],[a,h]],[/\b(rct\w+) b/i],[s,[c,"RCA"],[a,f]],[/\b(venue[\d ]{2,7}) b/i],[s,[c,"Dell"],[a,f]],[/\b(q(?:mv|ta)\w+) b/i],[s,[c,"Verizon"],[a,f]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[s,[c,"Barnes & Noble"],[a,f]],[/\b(tm\d{3}\w+) b/i],[s,[c,"NuVision"],[a,f]],[/\b(k88) b/i],[s,[c,"ZTE"],[a,f]],[/\b(nx\d{3}j) b/i],[s,[c,"ZTE"],[a,h]],[/\b(gen\d{3}) b.+49h/i],[s,[c,"Swiss"],[a,h]],[/\b(zur\d{3}) b/i],[s,[c,"Swiss"],[a,f]],[/\b((zeki)?tb.*\b) b/i],[s,[c,"Zeki"],[a,f]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[c,"Dragon Touch"],s,[a,f]],[/\b(ns-?\w{0,9}) b/i],[s,[c,"Insignia"],[a,f]],[/\b((nxa|next)-?\w{0,9}) b/i],[s,[c,"NextBook"],[a,f]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[c,"Voice"],s,[a,h]],[/\b(lvtel\-)?(v1[12]) b/i],[[c,"LvTel"],s,[a,h]],[/\b(ph-1) /i],[s,[c,"Essential"],[a,h]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[s,[c,"Envizen"],[a,f]],[/\b(trio[-\w\. ]+) b/i],[s,[c,"MachSpeed"],[a,f]],[/\btu_(1491) b/i],[s,[c,"Rotor"],[a,f]],[/(shield[\w ]+) b/i],[s,[c,"Nvidia"],[a,f]],[/(sprint) (\w+)/i],[c,s,[a,h]],[/(kin\.[onetw]{3})/i],[[s,/\./g," "],[c,x],[a,h]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[s,[c,q],[a,f]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[s,[c,q],[a,h]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[c,s,[a,p]],[/droid.+; (shield) bui/i],[s,[c,"Nvidia"],[a,p]],[/(playstation [345portablevi]+)/i],[s,[c,U],[a,p]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[s,[c,x],[a,p]],[/smart-tv.+(samsung)/i],[c,[a,v]],[/hbbtv.+maple;(\d+)/i],[[s,/^/,"SmartTV"],[c,N],[a,v]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[c,T],[a,v]],[/(apple) ?tv/i],[c,[s,"Apple TV"],[a,v]],[/crkey/i],[[s,"Chromecast"],[c,k],[a,v]],[/droid.+aft(\w)( bui|\))/i],[s,[c,y],[a,v]],[/\(dtv[\);].+(aquos)/i],[s,[c,"Sharp"],[a,v]],[/(bravia[\w- ]+) bui/i],[s,[c,U],[a,v]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w ]*; *(\w[^;]*);([^;]*)/i],[[c,L],[s,L],[a,v]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[a,v]],[/((pebble))app/i],[c,s,[a,g]],[/droid.+; (glass) \d/i],[s,[c,k],[a,g]],[/droid.+; (wt63?0{2,3})\)/i],[s,[c,q],[a,g]],[/(quest( 2)?)/i],[s,[c,D],[a,g]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[c,[a,b]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[s,[a,h]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[s,[a,f]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[a,f]],[/(phone|mobile(?:[;\/]| safari)|pda(?=.+windows ce))/i],[[a,h]],[/(android[-\w\. ]{0,9});.+buil/i],[s,[c,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[l,[u,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[l,[u,"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],[u,l],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[l,u]],os:[[/microsoft (windows) (vista|xp)/i],[u,l],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[u,[l,B,z]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[u,"Windows"],[l,B,z]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/cfnetwork\/.+darwin/i],[[l,/_/g,"."],[u,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[u,"Mac OS"],[l,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86)/i],[l,u],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[u,l],[/\(bb(10);/i],[l,[u,_]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[l,[u,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[l,[u,"Firefox OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[l,[u,"webOS"]],[/crkey\/([\d\.]+)/i],[l,[u,"Chromecast"]],[/(cros) [\w]+ ([\w\.]+\w)/i],[[u,"Chromium OS"],l],[/(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],[u,l],[/(sunos) ?([\w\.\d]*)/i],[[u,"Solaris"],l],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux)/i,/(unix) ?([\w\.]*)/i],[u,l]]},Q=function(i,s){if(typeof i===r&&(s=i,i=t),!(this instanceof Q))return new Q(i,s).getResult();var u=i||(typeof e!==n&&e.navigator&&e.navigator.userAgent?e.navigator.userAgent:""),a=s?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,s):F;return this.getBrowser=function(){var e,i={};return i.name=t,i.version=t,V.call(i,u,a.browser),i.major=typeof(e=i.version)===o?e.replace(/[^\d\.]/g,"").split(".")[0]:t,i},this.getCPU=function(){var e={};return e.architecture=t,V.call(e,u,a.cpu),e},this.getDevice=function(){var e={};return e.vendor=t,e.model=t,e.type=t,V.call(e,u,a.device),e},this.getEngine=function(){var e={};return e.name=t,e.version=t,V.call(e,u,a.engine),e},this.getOS=function(){var e={};return e.name=t,e.version=t,V.call(e,u,a.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 u},this.setUA=function(e){return u=typeof e===o&&e.length>275?L(e,275):e,this},this.setUA(u),this};Q.VERSION="0.7.31",Q.BROWSER=A([u,l,"major"]),Q.CPU=A([d]),Q.DEVICE=A([s,c,a,p,h,v,f,g,b]),Q.ENGINE=Q.OS=A([u,l]),I.exports&&(S=I.exports=Q),S.UAParser=Q;var $=typeof e!==n&&(e.jQuery||e.Zepto);if($&&!$.ua){var W=new Q;$.ua=W.getResult(),$.ua.get=function(){return W.getUA()},$.ua.set=function(e){W.setUA(e);var t=W.getResult();for(var i in t)$.ua[i]=t[i]}}}("object"==typeof window?window:X);var te=ee.exports,ie=function(){function e(){this.ua=new ee.exports.UAParser("undefined"!=typeof navigator?navigator.userAgent:null).getResult()}return e.prototype.getApplicationContext=function(){return{versionName:this.versionName,language:oe(),platform:"Web",os:ne(this.ua),deviceModel:re(this.ua)}},e}(),ne=function(e){var t,i;return[null===(t=e.browser)||void 0===t?void 0:t.name,null===(i=e.browser)||void 0===i?void 0:i.major].filter((function(e){return null!=e})).join(" ")},re=function(e){var t;return null===(t=e.os)||void 0===t?void 0:t.name},oe=function(){return"undefined"!=typeof navigator&&(navigator.languages&&navigator.languages[0]||navigator.language)||""},se=function(){function e(){this.queue=[]}return e.prototype.logEvent=function(e){this.receiver?this.receiver(e):this.queue.length<512&&this.queue.push(e)},e.prototype.setEventReceiver=function(e){this.receiver=e,this.queue.length>0&&(this.queue.forEach((function(t){e(t)})),this.queue=[])},e}(),ue=function(){return ue=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},ue.apply(this,arguments)};Object.entries||(Object.entries=function(e){for(var t=Object.keys(e),i=t.length,n=new Array(i);i--;)n[i]=[t[i],e[t[i]]];return n});var ae=function(){function e(){this.identity={userProperties:{}},this.listeners=new Set}return e.prototype.editIdentity=function(){var e=this,t=ue({},this.identity.userProperties),i=ue(ue({},this.identity),{userProperties:t});return{setUserId:function(e){return i.userId=e,this},setDeviceId:function(e){return i.deviceId=e,this},setUserProperties:function(e){return i.userProperties=e,this},updateUserProperties:function(e){for(var t=i.userProperties||{},n=0,r=Object.entries(e);n<r.length;n++){var o=r[n],s=o[0],u=o[1];switch(s){case"$set":for(var a=0,c=Object.entries(u);a<c.length;a++){var l=c[a],d=l[0],p=l[1];t[d]=p}break;case"$unset":for(var h=0,f=Object.keys(u);h<f.length;h++){delete t[d=f[h]]}break;case"$clearAll":t={}}}return i.userProperties=t,this},commit:function(){return e.setIdentity(i),this}}},e.prototype.getIdentity=function(){return ue({},this.identity)},e.prototype.setIdentity=function(e){var t=ue({},this.identity);this.identity=ue({},e),ce(t,this.identity)||this.listeners.forEach((function(t){t(e)}))},e.prototype.addIdentityListener=function(e){this.listeners.add(e)},e.prototype.removeIdentityListener=function(e){this.listeners.delete(e)},e}(),ce=function(e,t){var i=typeof e;if(i!==typeof t)return!1;for(var n=0,r=["string","number","boolean","undefined"];n<r.length;n++){if(r[n]===i)return e===t}if(e.length!==t.length)return!1;var o=Array.isArray(e),s=Array.isArray(t);if(o!==s)return!1;if(!o||!s){var u=Object.keys(e).sort(),a=Object.keys(t).sort();if(!ce(u,a))return!1;var c=!0;return Object.keys(e).forEach((function(i){ce(e[i],t[i])||(c=!1)})),c}for(var l=0;l<e.length;l++)if(!ce(e[l],t[l]))return!1;return!0},le="undefined"!=typeof globalThis?globalThis:global||self,de=function(){function e(){this.identityStore=new ae,this.eventBridge=new se,this.applicationContextProvider=new ie}return e.getInstance=function(t){return le.analyticsConnectorInstances||(le.analyticsConnectorInstances={}),le.analyticsConnectorInstances[t]||(le.analyticsConnectorInstances[t]=new e),le.analyticsConnectorInstances[t]},e}(),pe=function(){return de.getInstance("$default_instance")},he=function(){function e(){this.name="identity",this.type=f.BEFORE,this.identityStore=pe().identityStore}return e.prototype.execute=function(e){return r(this,void 0,void 0,(function(){var t;return o(this,(function(i){return(t=e.user_properties)&&this.identityStore.editIdentity().updateUserProperties(t).commit(),[2,e]}))}))},e.prototype.setup=function(e){return Promise.resolve(void 0)},e}(),fe=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:""},ve=function(e,t){ge(e,t)},ge=function(e,t){for(var i=0;i<t.length;i++){var n=t[i],r=n.name,o=n.args,s=n.resolve,u=e&&e[r];if("function"==typeof u){var a=u.apply(e,o);"function"==typeof s&&s(null==a?void 0:a.promise)}}return e},be=function(e){return e&&void 0!==e._q},ye=function(){function e(){var e;this.name="context",this.type=f.BEFORE,this.eventId=0,this.library="amplitude-ts/".concat("1.5.8"),"undefined"!=typeof navigator&&(e=navigator.userAgent),this.uaResult=new te(e).getResult()}return e.prototype.setup=function(e){return this.config=e,Promise.resolve(void 0)},e.prototype.execute=function(e){return r(this,void 0,void 0,(function(){var t,n,r,s,u;return o(this,(function(o){return this.isSessionValid()||(this.config.sessionId=Date.now()),this.config.lastEventTime=Date.now(),t=(new Date).getTime(),n=this.uaResult.browser.name,r=this.uaResult.browser.version,s=this.uaResult.device.model||this.uaResult.os.name,u=this.uaResult.device.vendor,[2,i(i(i(i(i(i(i(i(i(i(i(i({user_id:this.config.userId,device_id:this.config.deviceId,session_id:this.config.sessionId,time:t},this.config.appVersion&&{app_version:this.config.appVersion}),this.config.trackingOptions.platform&&{platform:"Web"}),this.config.trackingOptions.osName&&{os_name:n}),this.config.trackingOptions.osVersion&&{os_version:r}),this.config.trackingOptions.deviceManufacturer&&{device_manufacturer:u}),this.config.trackingOptions.deviceModel&&{device_model:s}),this.config.trackingOptions.language&&{language:fe()}),this.config.trackingOptions.ipAddress&&{ip:"$remote"}),{insert_id:$(),partner_id:this.config.partnerId,plan:this.config.plan}),this.config.ingestionMetadata&&{ingestion_metadata:{source_name:this.config.ingestionMetadata.sourceName,source_version:this.config.ingestionMetadata.sourceVersion}}),e),{event_id:this.eventId++,library:this.library})]}))}))},e.prototype.isSessionValid=function(){var e=this.config.lastEventTime||Date.now();return Date.now()-e<this.config.sessionTimeout},e}(),me=function(){function e(){}return e.prototype.isEnabled=function(){return r(this,void 0,void 0,(function(){var t,i,n;return o(this,(function(r){switch(r.label){case 0:if(!b())return[2,!1];t=String(Date.now()),i=new e,n="AMP_TEST",r.label=1;case 1:return r.trys.push([1,4,5,7]),[4,i.set(n,t)];case 2:return r.sent(),[4,i.get(n)];case 3:return[2,r.sent()===t];case 4:return r.sent(),[2,!1];case 5:return[4,i.remove(n)];case 6:return r.sent(),[7];case 7:return[2]}}))}))},e.prototype.get=function(e){return r(this,void 0,void 0,(function(){var t;return o(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,this.getRaw(e)];case 1:return(t=i.sent())?[2,JSON.parse(t)]:[2,void 0];case 2:return i.sent(),[2,void 0];case 3:return[2]}}))}))},e.prototype.getRaw=function(e){var t;return r(this,void 0,void 0,(function(){return o(this,(function(i){return[2,(null===(t=b())||void 0===t?void 0:t.localStorage.getItem(e))||void 0]}))}))},e.prototype.set=function(e,t){var i;return r(this,void 0,void 0,(function(){return o(this,(function(n){try{null===(i=b())||void 0===i||i.localStorage.setItem(e,JSON.stringify(t))}catch(e){}return[2]}))}))},e.prototype.remove=function(e){var t;return r(this,void 0,void 0,(function(){return o(this,(function(i){try{null===(t=b())||void 0===t||t.localStorage.removeItem(e)}catch(e){}return[2]}))}))},e.prototype.reset=function(){var e;return r(this,void 0,void 0,(function(){return o(this,(function(t){try{null===(e=b())||void 0===e||e.localStorage.clear()}catch(e){}return[2]}))}))},e}(),we=function(e){function i(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={done:4},t}return t(i,e),i.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=i.buildResponse(t);n(s)}catch(e){r(e)}},o.setRequestHeader("Content-Type","application/json"),o.setRequestHeader("Accept","*/*"),o.send(JSON.stringify(t))}))]}))}))},i}(K),_e=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return t(i,e),i.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){var o=b();if(!(null==o?void 0:o.navigator.sendBeacon))throw new Error("SendBeaconTransport is not supported");try{var s=JSON.stringify(t);return n(o.navigator.sendBeacon(e,JSON.stringify(t))?i.buildResponse({code:200,events_ingested:t.events.length,payload_size_bytes:s.length,server_upload_time:Date.now()}):i.buildResponse({code:500}))}catch(e){r(e)}}))]}))}))},i}(K),Ie=function(){var e=new W;return{cookieExpiration:365,cookieSameSite:"Lax",cookieSecure:!1,cookieStorage:e,disableCookies:!1,domain:"",sessionManager:new J(e,""),sessionTimeout:18e5,storageProvider:new W,trackingOptions:{deviceManufacturer:!0,deviceModel:!0,ipAddress:!0,language:!0,osName:!0,osVersion:!0,platform:!0},transportProvider:new Y}},Se=function(e){function n(t,n,r){var o,s,u,a,c,l,d,p,h,f,v,g,b=this,y=Ie();return(b=e.call(this,i(i({flushIntervalMillis:1e3,flushMaxRetries:5,flushQueueSize:30},r),{apiKey:t,storageProvider:null!==(o=null==r?void 0:r.storageProvider)&&void 0!==o?o:y.storageProvider,transportProvider:null!==(s=null==r?void 0:r.transportProvider)&&void 0!==s?s:y.transportProvider}))||this).cookieStorage=null!==(u=null==r?void 0:r.cookieStorage)&&void 0!==u?u:y.cookieStorage,b.sessionManager=null!==(a=null==r?void 0:r.sessionManager)&&void 0!==a?a:y.sessionManager,b.sessionTimeout=null!==(c=null==r?void 0:r.sessionTimeout)&&void 0!==c?c:y.sessionTimeout,b.appVersion=null==r?void 0:r.appVersion,b.attribution=null==r?void 0:r.attribution,b.cookieExpiration=null!==(l=null==r?void 0:r.cookieExpiration)&&void 0!==l?l:y.cookieExpiration,b.cookieSameSite=null!==(d=null==r?void 0:r.cookieSameSite)&&void 0!==d?d:y.cookieSameSite,b.cookieSecure=null!==(p=null==r?void 0:r.cookieSecure)&&void 0!==p?p:y.cookieSecure,b.deviceId=null==r?void 0:r.deviceId,b.disableCookies=null!==(h=null==r?void 0:r.disableCookies)&&void 0!==h?h:y.disableCookies,b.domain=null!==(f=null==r?void 0:r.domain)&&void 0!==f?f:y.domain,b.lastEventTime=null!==(v=b.lastEventTime)&&void 0!==v?v:null==r?void 0:r.lastEventTime,b.optOut=Boolean(null==r?void 0:r.optOut),b.partnerId=null==r?void 0:r.partnerId,b.sessionId=null==r?void 0:r.sessionId,b.trackingOptions=null!==(g=null==r?void 0:r.trackingOptions)&&void 0!==g?g:y.trackingOptions,b.userId=n,b}return t(n,e),Object.defineProperty(n.prototype,"deviceId",{get:function(){return this.sessionManager.getDeviceId()},set:function(e){this.sessionManager.setDeviceId(e)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"userId",{get:function(){return this.sessionManager.getUserId()},set:function(e){this.sessionManager.setUserId(e)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"sessionId",{get:function(){return this.sessionManager.getSessionId()},set:function(e){this.sessionManager.setSessionId(e)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"optOut",{get:function(){return this.sessionManager.getOptOut()},set:function(e){var t;null===(t=this.sessionManager)||void 0===t||t.setOptOut(Boolean(e))},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"lastEventTime",{get:function(){return this.sessionManager.getLastEventTime()},set:function(e){this.sessionManager.setLastEventTime(e)},enumerable:!1,configurable:!0}),n}(V),Ee=function(e,t,n){return r(void 0,void 0,void 0,(function(){var r,s,u,a,c,l,d,p,h,f,v,g,b,m,w,_,I;return o(this,(function(o){switch(o.label){case 0:return r=Ie(),null===(b=null==n?void 0:n.domain)||void 0===b?[3,1]:(u=b,[3,3]);case 1:return[4,Re()];case 2:u=o.sent(),o.label=3;case 3:return s=u,[4,ke(i(i({},n),{domain:s}))];case 4:return a=o.sent(),c=Z(e),[4,a.get(c)];case 5:return l=o.sent(),d=y(),[4,new J(a,e).load()];case 6:return p=o.sent(),h=Se.bind,f=[void 0,e,null!=t?t:null==l?void 0:l.userId],v=[i({},n)],g={cookieStorage:a,sessionManager:p,deviceId:xe(null==l?void 0:l.deviceId,null==n?void 0:n.deviceId,d.deviceId),domain:s,optOut:null!==(m=null==n?void 0:n.optOut)&&void 0!==m?m:Boolean(null==l?void 0:l.optOut)},[4,a.get(c)];case 7:return g.sessionId=null!==(_=null===(w=o.sent())||void 0===w?void 0:w.sessionId)&&void 0!==_?_:null==n?void 0:n.sessionId,[4,Te(n)];case 8:return[2,new(h.apply(Se,f.concat([i.apply(void 0,v.concat([(g.storageProvider=o.sent(),g.trackingOptions=i(i({},r.trackingOptions),null==n?void 0:n.trackingOptions),g.transportProvider=null!==(I=null==n?void 0:n.transportProvider)&&void 0!==I?I:Pe(null==n?void 0:n.transport),g)]))])))]}}))}))},ke=function(e,t){return void 0===t&&(t=Ie()),r(void 0,void 0,void 0,(function(){var n,r,s;return o(this,(function(o){switch(o.label){case 0:return n=i(i({},t),e),r=null==e?void 0:e.cookieStorage,(s=!r)?[3,2]:[4,r.isEnabled()];case 1:s=!o.sent(),o.label=2;case 2:return s?[2,Oe(n)]:[2,r]}}))}))},Oe=function(e){return r(void 0,void 0,void 0,(function(){var t,i;return o(this,(function(n){switch(n.label){case 0:return t=new H({domain:e.domain,expirationDays:e.cookieExpiration,sameSite:e.cookieSameSite,secure:e.cookieSecure}),(i=e.disableCookies)?[3,2]:[4,t.isEnabled()];case 1:i=!n.sent(),n.label=2;case 2:return i?[4,(t=new me).isEnabled()]:[3,4];case 3:n.sent()||(t=new W),n.label=4;case 4:return[2,t]}}))}))},Te=function(e){return r(void 0,void 0,void 0,(function(){var t,i,n,r,u,a,c;return o(this,(function(o){switch(o.label){case 0:if(e&&Object.prototype.hasOwnProperty.call(e,"storageProvider")&&!e.storageProvider)return[3,9];o.label=1;case 1:o.trys.push([1,7,8,9]),t=s([null==e?void 0:e.storageProvider,new me]),i=t.next(),o.label=2;case 2:return i.done?[3,6]:(n=i.value,(r=n)?[4,n.isEnabled()]:[3,4]);case 3:r=o.sent(),o.label=4;case 4:if(r)return[2,n];o.label=5;case 5:return i=t.next(),[3,2];case 6:return[3,9];case 7:return u=o.sent(),a={error:u},[3,9];case 8:try{i&&!i.done&&(c=t.return)&&c.call(t)}finally{if(a)throw a.error}return[7];case 9:return[2,void 0]}}))}))},xe=function(e,t,i){return t||i||e||$()},Pe=function(e){return e===g.XHR?new we:e===g.SendBeacon?new _e:Ie().transportProvider},Re=function(e){return r(void 0,void 0,void 0,(function(){var t,i,n,r,s,u,a;return o(this,(function(o){switch(o.label){case 0:return[4,(new H).isEnabled()];case 1:if(!o.sent()||!e&&"undefined"==typeof location)return[2,""];for(t=null!=e?e:location.hostname,i=t.split("."),n=[],r="AMP_TLDTEST",s=i.length-2;s>=0;--s)n.push(i.slice(s).join("."));s=0,o.label=2;case 2:return s<n.length?(u=n[s],[4,(a=new H({domain:"."+u})).set(r,1)]):[3,7];case 3:return o.sent(),[4,a.get(r)];case 4:return o.sent()?[4,a.remove(r)]:[3,6];case 5:return o.sent(),[2,"."+u];case 6:return s++,[3,2];case 7:return[2,""]}}))}))},Ne=function(e,t){return r(void 0,void 0,void 0,(function(){var i,n,r,s,a,c,l,d,p;return o(this,(function(o){switch(o.label){case 0:return[4,(i=new H).isEnabled()];case 1:return o.sent()&&!(null==t?void 0:t.disableCookies)||(i=new me),[4,i.isEnabled()];case 2:return o.sent()?(n=function(e){return"".concat(k.toLowerCase(),"_").concat(e.substring(0,6))}(e),[4,i.getRaw(n)]):[2,{optOut:!1}];case 3:return(r=o.sent())?[4,i.remove(n)]:[2,{optOut:!1}];case 4:return o.sent(),s=u(r.split("."),5),a=s[0],c=s[1],l=s[2],d=s[3],p=s[4],[2,{deviceId:a,userId:Ce(c),sessionId:Ue(d),lastEventTime:Ue(p),optOut:Boolean(l)}]}}))}))},Ue=function(e){var t=parseInt(e,32);if(!isNaN(t))return t},Ce=function(e){if(atob&&escape&&e)try{return decodeURIComponent(escape(atob(e)))}catch(e){return}},qe=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return t(n,e),n.prototype.init=function(t,n,s){var u,a,c;return void 0===t&&(t=""),r(this,void 0,void 0,(function(){var r,l,d,p,h=this;return o(this,(function(o){switch(o.label){case 0:return this.initializing?[2]:(this.initializing=!0,[4,Ne(t,s)]);case 1:return r=o.sent(),[4,Ee(t,n||r.userId,i(i({},s),{deviceId:null!==(u=r.deviceId)&&void 0!==u?u:null==s?void 0:s.deviceId,sessionId:null!==(a=r.sessionId)&&void 0!==a?a:null==s?void 0:s.sessionId,optOut:null!==(c=null==s?void 0:s.optOut)&&void 0!==c?c:r.optOut,lastEventTime:r.lastEventTime}))];case 2:return l=o.sent(),[4,e.prototype._init.call(this,l)];case 3:return o.sent(),d=!this.config.lastEventTime,(!this.config.sessionId||this.config.lastEventTime&&Date.now()-this.config.lastEventTime>this.config.sessionTimeout)&&(this.setSessionId(Date.now()),d=!0),(p=pe()).eventBridge.setEventReceiver((function(e){h.track(e.eventType,e.eventProperties)})),p.identityStore.setIdentity({userId:this.config.userId,deviceId:this.config.deviceId}),[4,this.add(new ye)];case 4:return o.sent(),[4,this.add(new he)];case 5:return o.sent(),[4,this.add(new F)];case 6:return o.sent(),this.initializing=!1,[4,this.runAttributionStrategy(l.attribution,d)];case 7:return o.sent(),[4,this.runQueuedFunctions("dispatchQ")];case 8:return o.sent(),[2]}}))}))},n.prototype.runAttributionStrategy=function(e,t){return void 0===t&&(t=!1),r(this,void 0,void 0,(function(){var n,r,s;return o(this,(function(o){switch(o.label){case 0:return n=this.track.bind(this),r=this.setSessionId.bind(this,Date.now()),[4,Oe(this.config)];case 1:return s=o.sent(),[4,new G(this.config.apiKey,i(i({},e),{storage:s,track:n,onNewCampaign:r})).send(t)];case 2:return o.sent(),[2]}}))}))},n.prototype.getUserId=function(){var e;return null===(e=this.config)||void 0===e?void 0:e.userId},n.prototype.setUserId=function(e){this.config?this.config.userId=e:this.q.push(this.setUserId.bind(this,e))},n.prototype.getDeviceId=function(){var e;return null===(e=this.config)||void 0===e?void 0:e.deviceId},n.prototype.setDeviceId=function(e){this.config?this.config.deviceId=e:this.q.push(this.setDeviceId.bind(this,e))},n.prototype.reset=function(){this.setUserId(void 0),this.setDeviceId($())},n.prototype.getSessionId=function(){var e;return null===(e=this.config)||void 0===e?void 0:e.sessionId},n.prototype.setSessionId=function(e){this.config?(this.config.sessionId=e,this.config.lastEventTime=void 0):this.q.push(this.setSessionId.bind(this,e))},n.prototype.setTransport=function(e){this.config?this.config.transportProvider=Pe(e):this.q.push(this.setTransport.bind(this,e))},n.prototype.identify=function(t,i){if(be(t)){var n=t._q;t._q=[],t=ge(new R,n)}return(null==i?void 0:i.user_id)&&this.setUserId(i.user_id),(null==i?void 0:i.device_id)&&this.setDeviceId(i.device_id),e.prototype.identify.call(this,t,i)},n.prototype.groupIdentify=function(t,i,n,r){if(be(n)){var o=n._q;n._q=[],n=ge(new R,o)}return e.prototype.groupIdentify.call(this,t,i,n,r)},n.prototype.revenue=function(t,i){if(be(t)){var n=t._q;t._q=[],t=ge(new A,n)}return e.prototype.revenue.call(this,t,i)},n}(D),De=function(){var e=new qe;return{init:Q(e.init.bind(e)),add:Q(e.add.bind(e)),remove:Q(e.remove.bind(e)),track:Q(e.track.bind(e)),logEvent:Q(e.logEvent.bind(e)),identify:Q(e.identify.bind(e)),groupIdentify:Q(e.groupIdentify.bind(e)),setGroup:Q(e.setGroup.bind(e)),revenue:Q(e.revenue.bind(e)),flush:Q(e.flush.bind(e)),getUserId:e.getUserId.bind(e),setUserId:e.setUserId.bind(e),getDeviceId:e.getDeviceId.bind(e),setDeviceId:e.setDeviceId.bind(e),reset:e.reset.bind(e),getSessionId:e.getSessionId.bind(e),setSessionId:e.setSessionId.bind(e),setOptOut:e.setOptOut.bind(e),setTransport:e.setTransport.bind(e)}},Ae=De(),je=Ae.add,Me=Ae.flush,Le=Ae.getDeviceId,Ve=Ae.getSessionId,Be=Ae.getUserId,ze=Ae.groupIdentify,Fe=Ae.identify,Qe=Ae.init,$e=Ae.logEvent,We=Ae.remove,Ke=Ae.reset,Ze=Ae.revenue,Ge=Ae.setDeviceId,He=Ae.setGroup,Je=Ae.setOptOut,Ye=Ae.setSessionId,Xe=Ae.setTransport,et=Ae.setUserId,tt=Ae.track,it=Object.freeze({__proto__:null,add:je,flush:Me,getDeviceId:Le,getSessionId:Ve,getUserId:Be,groupIdentify:ze,identify:Fe,init:Qe,logEvent:$e,remove:We,reset:Ke,revenue:Ze,setDeviceId:Ge,setGroup:He,setOptOut:Je,setSessionId:Ye,setTransport:Xe,setUserId:et,track:tt,Types:E,createInstance:De,runQueuedFunctions:ve,Revenue:A,Identify:R});!function(){var e=b();if(e){if(e.amplitude=Object.assign(e.amplitude||{},it),e.amplitude.invoked){var t=e.amplitude._q;e.amplitude._q=[],ve(it,t);for(var i=0;i<e.amplitude._iq.length;i++){var n=Object.assign(e.amplitude._iq[i],De()),r=n._q;n._q=[],ve(n,r)}}}else console.error("[Amplitude] Error: GlobalScope is not defined")}()}();
15
+ ***************************************************************************** */var e=function(t,i){return e=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])},e(t,i)};function t(t,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=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}var i=function(){return i=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},i.apply(this,arguments)};function n(e,t){var i={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(i[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(e);r<n.length;r++)t.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(e,n[r])&&(i[n[r]]=e[n[r]])}return i}function r(e,t,i,n){return new(i||(i=Promise))((function(r,o){function s(e){try{a(n.next(e))}catch(e){o(e)}}function u(e){try{a(n.throw(e))}catch(e){o(e)}}function a(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(s,u)}a((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:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(o){return function(u){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,u])}}}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 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 a(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 c,l,d,p,f,h,v,g,b=function(){return"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof self?self:"undefined"!=typeof global?global:void 0},y=function(){var e,t=b();return(null===(e=null==t?void 0:t.location)||void 0===e?void 0:e.search)?t.location.search.substring(1).split("&").filter(Boolean).reduce((function(e,t){var i=t.split("=",2),n=m(i[0]),r=m(i[1]);return r?(e[n]=r,e):e}),{}):{}},m=function(e){void 0===e&&(e="");try{return decodeURIComponent(e)}catch(e){return""}},w={utm_source:void 0,utm_medium:void 0,utm_campaign:void 0,utm_term:void 0,utm_content:void 0,referrer:void 0,referring_domain:void 0,dclid:void 0,gbraid:void 0,gclid:void 0,fbclid:void 0,ko_click_id:void 0,msclkid:void 0,ttclid:void 0,twclid:void 0,wbraid:void 0},I=function(){function e(){}return e.prototype.parse=function(){return r(this,void 0,void 0,(function(){return o(this,(function(e){return[2,i(i(i(i({},w),this.getUtmParam()),this.getReferrer()),this.getClickIds())]}))}))},e.prototype.getUtmParam=function(){var e=y();return{utm_source:e.utm_source,utm_medium:e.utm_medium,utm_campaign:e.utm_campaign,utm_term:e.utm_term,utm_content:e.utm_content}},e.prototype.getReferrer=function(){var e,t,i={referrer:void 0,referring_domain:void 0};try{i.referrer=document.referrer||void 0,i.referring_domain=null!==(t=null===(e=i.referrer)||void 0===e?void 0:e.split("/")[2])&&void 0!==t?t:void 0}catch(e){}return i},e.prototype.getClickIds=function(){var e,t=y();return(e={}).dclid=t.dclid,e.fbclid=t.fbclid,e.gbraid=t.gbraid,e.gclid=t.gclid,e.ko_click_id=t.ko_click_id,e.msclkid=t.msclkid,e.ttclid=t.ttclid,e.twclid=t.twclid,e.wbraid=t.wbraid,e},e}();!function(e){e.US="US",e.EU="EU"}(c||(c={})),function(e){e.SET="$set",e.SET_ONCE="$setOnce",e.ADD="$add",e.APPEND="$append",e.PREPEND="$prepend",e.REMOVE="$remove",e.PREINSERT="$preInsert",e.POSTINSERT="$postInsert",e.UNSET="$unset",e.CLEAR_ALL="$clearAll"}(l||(l={})),function(e){e.REVENUE_PRODUCT_ID="$productId",e.REVENUE_QUANTITY="$quantity",e.REVENUE_PRICE="$price",e.REVENUE_TYPE="$revenueType",e.REVENUE="$revenue"}(d||(d={})),function(e){e.IDENTIFY="$identify",e.GROUP_IDENTIFY="$groupidentify",e.REVENUE="revenue_amount"}(p||(p={})),function(e){e[e.None=0]="None",e[e.Error=1]="Error",e[e.Warn=2]="Warn",e[e.Verbose=3]="Verbose",e[e.Debug=4]="Debug"}(f||(f={})),function(e){e.BEFORE="before",e.ENRICHMENT="enrichment",e.DESTINATION="destination"}(h||(h={})),function(e){e.Unknown="unknown",e.Skipped="skipped",e.Success="success",e.RateLimit="rate_limit",e.PayloadTooLarge="payload_too_large",e.Invalid="invalid",e.Failed="failed",e.Timeout="Timeout",e.SystemError="SystemError"}(v||(v={})),function(e){e.XHR="xhr",e.SendBeacon="beacon",e.Fetch="fetch"}(g||(g={}));var _,S,E=Object.freeze({__proto__:null,get ServerZone(){return c},get SpecialEventType(){return p},get IdentifyOperation(){return l},get RevenueProperty(){return d},get LogLevel(){return f},get PluginType(){return h},get Status(){return v},get TransportType(){return g}}),k="AMP",O="".concat(k,"_unsent"),T="https://api2.amplitude.com/2/httpapi",x=function(e){if(Object.keys(e).length>1e3)return!1;for(var t in e){var i=e[t];if(!P(t,i))return!1}return!0},P=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),u=o.next();!u.done;u=o.next()){var a=u.value;if(Array.isArray(a))return!1;if("object"==typeof a)r=r&&x(a);else if(!["number","string"].includes(typeof a))return!1;if(!r)return!1}}catch(e){i={error:e}}finally{try{u&&!u.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}}else{if(null==t)return!1;if("object"==typeof t)return x(t);if(!["number","string","boolean"].includes(typeof t))return!1}return!0},R=function(){function e(){this._propertySet=new Set,this._properties={}}return e.prototype.getUserProperties=function(){return i({},this._properties)},e.prototype.set=function(e,t){return this._safeSet(l.SET,e,t),this},e.prototype.setOnce=function(e,t){return this._safeSet(l.SET_ONCE,e,t),this},e.prototype.append=function(e,t){return this._safeSet(l.APPEND,e,t),this},e.prototype.prepend=function(e,t){return this._safeSet(l.PREPEND,e,t),this},e.prototype.postInsert=function(e,t){return this._safeSet(l.POSTINSERT,e,t),this},e.prototype.preInsert=function(e,t){return this._safeSet(l.PREINSERT,e,t),this},e.prototype.remove=function(e,t){return this._safeSet(l.REMOVE,e,t),this},e.prototype.add=function(e,t){return this._safeSet(l.ADD,e,t),this},e.prototype.unset=function(e){return this._safeSet(l.UNSET,e,"-"),this},e.prototype.clearAll=function(){return this._properties={},this._properties[l.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[l.CLEAR_ALL]&&(!this._propertySet.has(t)&&(e===l.ADD?"number"==typeof i:e===l.UNSET||e===l.REMOVE||P(t,i)))},e}(),N=function(e,t){return i(i({},t),{event_type:p.IDENTIFY,user_properties:e.getUserProperties()})},U=function(e,t,i){return void 0===t&&(t=0),void 0===i&&(i=v.Unknown),{event:e,code:t,message:i}},q=function(){function e(){this.queue=[],this.applying=!1,this.plugins=[]}return e.prototype.register=function(e,t){return r(this,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(),this.plugins.push(e),[2]}}))}))},e.prototype.deregister=function(e){return this.plugins.splice(this.plugins.findIndex((function(t){return t.name===e})),1),Promise.resolve()},e.prototype.reset=function(){this.applying=!1,this.plugins=[]},e.prototype.push=function(e){var t=this;return new Promise((function(i){t.queue.push([e,i]),t.scheduleApply(0)}))},e.prototype.scheduleApply=function(e){var t=this;this.applying||(this.applying=!0,setTimeout((function(){t.apply(t.queue.shift()).then((function(){t.applying=!1,t.queue.length>0&&t.scheduleApply(0)}))}),e))},e.prototype.apply=function(e){return r(this,void 0,void 0,(function(){var t,n,r,a,c,l,d,p,f,v,g,b,y,m,w,I,_,S;return o(this,(function(o){switch(o.label){case 0:if(!e)return[2];t=u(e,1),n=t[0],r=u(e,2),a=r[1],c=this.plugins.filter((function(e){return e.type===h.BEFORE})),o.label=1;case 1:o.trys.push([1,6,7,8]),l=s(c),d=l.next(),o.label=2;case 2:return d.done?[3,5]:[4,d.value.execute(i({},n))];case 3:n=o.sent(),o.label=4;case 4:return d=l.next(),[3,2];case 5:return[3,8];case 6:return p=o.sent(),w={error:p},[3,8];case 7:try{d&&!d.done&&(I=l.return)&&I.call(l)}finally{if(w)throw w.error}return[7];case 8:f=this.plugins.filter((function(e){return e.type===h.ENRICHMENT})),o.label=9;case 9:o.trys.push([9,14,15,16]),v=s(f),g=v.next(),o.label=10;case 10:return g.done?[3,13]:[4,g.value.execute(i({},n))];case 11:n=o.sent(),o.label=12;case 12:return g=v.next(),[3,10];case 13:return[3,16];case 14:return b=o.sent(),_={error:b},[3,16];case 15:try{g&&!g.done&&(S=v.return)&&S.call(v)}finally{if(_)throw _.error}return[7];case 16:return y=this.plugins.filter((function(e){return e.type===h.DESTINATION})),m=y.map((function(e){var t=i({},n);return e.execute(t).catch((function(e){return U(t,0,String(e))}))})),Promise.all(m).then((function(e){var t=u(e,1)[0];a(t)})),[2]}}))}))},e.prototype.flush=function(){return r(this,void 0,void 0,(function(){var e,t,i,n=this;return o(this,(function(r){switch(r.label){case 0:return e=this.queue,this.queue=[],[4,Promise.all(e.map((function(e){return n.apply(e)})))];case 1:return r.sent(),t=this.plugins.filter((function(e){return e.type===h.DESTINATION})),i=t.map((function(e){return e.flush&&e.flush()})),[4,Promise.all(i)];case 2:return r.sent(),[2]}}))}))},e}(),C="Event rejected due to exceeded retry count",D=function(){function e(e){void 0===e&&(e="$default"),this.initializing=!1,this.q=[],this.dispatchQ=[],this.logEvent=this.track.bind(this),this.timeline=new q,this.name=e}return e.prototype._init=function(e){return r(this,void 0,void 0,(function(){return o(this,(function(t){switch(t.label){case 0:return this.config=e,this.timeline.reset(),[4,this.runQueuedFunctions("q")];case 1:return t.sent(),[2]}}))}))},e.prototype.runQueuedFunctions=function(e){return r(this,void 0,void 0,(function(){var t,i,n,r,u,a;return o(this,(function(o){switch(o.label){case 0:t=this[e],this[e]=[],o.label=1;case 1:o.trys.push([1,6,7,8]),i=s(t),n=i.next(),o.label=2;case 2:return n.done?[3,5]:[4,(0,n.value)()];case 3:o.sent(),o.label=4;case 4:return n=i.next(),[3,2];case 5:return[3,8];case 6:return r=o.sent(),u={error:r},[3,8];case 7:try{n&&!n.done&&(a=i.return)&&a.call(i)}finally{if(u)throw u.error}return[7];case 8:return[2]}}))}))},e.prototype.track=function(e,t,n){var r=function(e,t,n){return i(i(i({},"string"==typeof e?{event_type:e}:e),n),t&&{event_properties:t})}(e,t,n);return this.dispatch(r)},e.prototype.identify=function(e,t){var i=N(e,t);return this.dispatch(i)},e.prototype.groupIdentify=function(e,t,n,r){var o=function(e,t,n,r){var o;return i(i({},r),{event_type:p.GROUP_IDENTIFY,group_properties:n.getUserProperties(),groups:(o={},o[e]=t,o)})}(e,t,n,r);return this.dispatch(o)},e.prototype.setGroup=function(e,t,n){var r=function(e,t,n){var r,o=new R;return o.set(e,t),i(i({},n),{event_type:p.IDENTIFY,user_properties:o.getUserProperties(),groups:(r={},r[e]=t,r)})}(e,t,n);return this.dispatch(r)},e.prototype.revenue=function(e,t){var n=function(e,t){return i(i({},t),{event_type:p.REVENUE,event_properties:e.getEventProperties()})}(e,t);return this.dispatch(n)},e.prototype.add=function(e){return r(this,void 0,void 0,(function(){return o(this,(function(t){return this.config?[2,this.timeline.register(e,this.config)]:(this.q.push(this.add.bind(this,e)),[2])}))}))},e.prototype.remove=function(e){return r(this,void 0,void 0,(function(){return o(this,(function(t){return this.config?[2,this.timeline.deregister(e)]:(this.q.push(this.remove.bind(this,e)),[2])}))}))},e.prototype.dispatchWithCallback=function(e,t){if(!this.config)return t(U(e,0,"Client not initialized"));this.process(e).then(t)},e.prototype.dispatch=function(e){return r(this,void 0,void 0,(function(){var t=this;return o(this,(function(i){return this.config?[2,this.process(e)]:[2,new Promise((function(i){t.dispatchQ.push(t.dispatchWithCallback.bind(t,e,i))}))]}))}))},e.prototype.process=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]),this.config.optOut?[2,U(e,0,"Event skipped due to optOut config")]:[4,this.timeline.push(e)];case 1:return 200===(n=r.sent()).code?this.config.loggerProvider.log(n.message):this.config.loggerProvider.error(n.message),[2,n];case 2:return t=r.sent(),i=String(t),this.config.loggerProvider.error(i),[2,n=U(e,0,i)];case 3:return[2]}}))}))},e.prototype.setOptOut=function(e){this.config?this.config.optOut=Boolean(e):this.q.push(this.setOptOut.bind(this,Boolean(e)))},e.prototype.flush=function(){return this.timeline.flush()},e}(),A=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 x(e)&&(this.properties=e),this},e.prototype.getEventProperties=function(){var e=this.properties?i({},this.properties):{};return e[d.REVENUE_PRODUCT_ID]=this.productId,e[d.REVENUE_QUANTITY]=this.quantity,e[d.REVENUE_PRICE]=this.price,e[d.REVENUE_TYPE]=this.revenueType,e[d.REVENUE]=this.revenue,e},e}(),j="Amplitude Logger ",M=function(){function e(){this.logLevel=f.None}return e.prototype.disable=function(){this.logLevel=f.None},e.prototype.enable=function(e){void 0===e&&(e=f.Warn),this.logLevel=e},e.prototype.log=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<f.Verbose||console.log("".concat(j,"[Log]: ").concat(e.join(" ")))},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<f.Warn||console.warn("".concat(j,"[Warn]: ").concat(e.join(" ")))},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<f.Error||console.error("".concat(j,"[Error]: ").concat(e.join(" ")))},e.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<f.Debug||console.log("".concat(j,"[Debug]: ").concat(e.join(" ")))},e}(),L=function(){return{flushMaxRetries:12,flushQueueSize:200,flushIntervalMillis:1e4,logLevel:f.Warn,loggerProvider:new M,optOut:!1,serverUrl:T,serverZone:c.US,useBatch:!1}},V=function(){function e(e){var t,i,n;this._optOut=!1;var r=L();this.apiKey=e.apiKey,this.flushIntervalMillis=e.flushIntervalMillis||r.flushIntervalMillis,this.flushMaxRetries=e.flushMaxRetries||r.flushMaxRetries,this.flushQueueSize=e.flushQueueSize||r.flushQueueSize,this.loggerProvider=e.loggerProvider||r.loggerProvider,this.logLevel=null!==(t=e.logLevel)&&void 0!==t?t:r.logLevel,this.minIdLength=e.minIdLength,this.plan=e.plan,this.ingestionMetadata=e.ingestionMetadata,this.optOut=null!==(i=e.optOut)&&void 0!==i?i:r.optOut,this.serverUrl=e.serverUrl,this.serverZone=e.serverZone||r.serverZone,this.storageProvider=e.storageProvider,this.transportProvider=e.transportProvider,this.useBatch=null!==(n=e.useBatch)&&void 0!==n?n:r.useBatch,this.loggerProvider.enable(this.logLevel);var o=z(e.serverUrl,e.serverZone,e.useBatch);this.serverZone=o.serverZone,this.serverUrl=o.serverUrl}return Object.defineProperty(e.prototype,"optOut",{get:function(){return this._optOut},set:function(e){this._optOut=e},enumerable:!1,configurable:!0}),e}(),B=function(e,t){return e===c.EU?t?"https://api.eu.amplitude.com/batch":"https://api.eu.amplitude.com/2/httpapi":t?"https://api2.amplitude.com/batch":T},z=function(e,t,i){if(void 0===e&&(e=""),void 0===t&&(t=L().serverZone),void 0===i&&(i=L().useBatch),e)return{serverUrl:e,serverZone:void 0};var n=[c.US,c.EU].includes(t)?t:L().serverZone;return{serverZone:n,serverUrl:B(n,i)}},F=function(){function e(){this.name="amplitude",this.type=h.DESTINATION,this.retryTimeout=1e3,this.throttleTimeout=3e4,this.storageKey="",this.scheduled=!1,this.queue=[]}return e.prototype.setup=function(e){var t;return r(this,void 0,void 0,(function(){var i,n=this;return o(this,(function(r){switch(r.label){case 0:return this.config=e,this.storageKey="".concat(O,"_").concat(this.config.apiKey.substring(0,10)),[4,null===(t=this.config.storageProvider)||void 0===t?void 0:t.get(this.storageKey)];case 1:return i=r.sent(),this.saveEvents(),i&&i.length>0&&Promise.all(i.map((function(e){return n.execute(e)}))).catch(),[2,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)},timeout: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?(t.attempts+=1,!0):(e.fulfillRequest([t],500,C),!1)}));n.forEach((function(t){e.queue=e.queue.concat(t),0!==t.timeout?setTimeout((function(){t.timeout=0,e.schedule(0)}),t.timeout):e.schedule(e.config.flushIntervalMillis)})),this.saveEvents()},e.prototype.schedule=function(e){var t=this;this.scheduled||(this.scheduled=!0,setTimeout((function(){t.flush(!0).then((function(){t.scheduled=!1,t.queue.length>0&&t.schedule(e)}))}),e))},e.prototype.flush=function(e){return void 0===e&&(e=!1),r(this,void 0,void 0,(function(){var t,i,n,r=this;return o(this,(function(o){switch(o.label){case 0:return t=[],i=[],this.queue.forEach((function(e){return 0===e.timeout?t.push(e):i.push(e)})),this.queue=i,s=t,u=this.config.flushQueueSize,a=Math.max(u,1),n=s.reduce((function(e,t,i){var n=Math.floor(i/a);return e[n]||(e[n]=[]),e[n].push(t),e}),[]),[4,Promise.all(n.map((function(t){return r.send(t,e)})))];case 1:return o.sent(),[2]}var s,u,a}))}))},e.prototype.send=function(e,t){return void 0===t&&(t=!0),r(this,void 0,void 0,(function(){var i,r,s,u;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")];i={api_key:this.config.apiKey,events:e.map((function(e){var t=e.event;return t.extra,n(t,["extra"])})),options:{min_id_length:this.config.minIdLength}},o.label=1;case 1:return o.trys.push([1,3,,4]),r=z(this.config.serverUrl,this.config.serverZone,this.config.useBatch).serverUrl,[4,this.config.transportProvider.send(r,i)];case 2:return null===(s=o.sent())?(this.fulfillRequest(e,0,"Unexpected error occurred"),[2]):t?(this.handleReponse(s,e),[3,4]):(this.fulfillRequest(e,s.statusCode,s.status),[2]);case 3:return u=o.sent(),this.fulfillRequest(e,0,String(u)),[3,4];case 4:return[2]}}))}))},e.prototype.handleReponse=function(e,t){switch(e.status){case v.Success:this.handleSuccessResponse(e,t);break;case v.Invalid:this.handleInvalidResponse(e,t);break;case v.PayloadTooLarge:this.handlePayloadTooLargeResponse(e,t);break;case v.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||e.body.error.startsWith("Invalid API key"))this.fulfillRequest(t,e.statusCode,e.body.error);else{var n=a(a(a(a([],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,a([],u(o),!1))}},e.prototype.handlePayloadTooLargeResponse=function(e,t){1!==t.length?(this.config.flushQueueSize/=2,this.addToQueue.apply(this,a([],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),c=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&&c.has(t.event.device_id)))return l.has(n)&&(t.timeout=i.throttleTimeout),!0;i.fulfillRequest([t],e.statusCode,e.body.error)}));this.addToQueue.apply(this,a([],u(d),!1))},e.prototype.handleOtherReponse=function(e){var t=this;this.addToQueue.apply(this,a([],u(e.map((function(e){return e.timeout=e.attempts*t.retryTimeout,e}))),!1))},e.prototype.fulfillRequest=function(e,t,i){this.saveEvents(),e.forEach((function(e){return e.callback(U(e.event,t,i))}))},e.prototype.saveEvents=function(){if(this.config.storageProvider){var e=Array.from(this.queue.map((function(e){return e.event})));this.config.storageProvider.set(this.storageKey,e)}},e}(),K=function(e){return function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];return{promise:e.apply(void 0,a([],u(t),!1))}}},Q=function(e){return void 0===e&&(e=0),((new Error).stack||"").split("\n").slice(2+e).map((function(e){return e.trim()}))},$=function(e){return function(){var t=i({},e.config);return{logger:t.loggerProvider,logLevel:t.logLevel}}},W=function(e,t){var i,n;t=(t=t.replace(/\[(\w+)\]/g,".$1")).replace(/^\./,"");try{for(var r=s(t.split(".")),o=r.next();!o.done;o=r.next()){var u=o.value;if(!(u in e))return;e=e[u]}}catch(e){i={error:e}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return e},Z=function(e,t){return function(){var i,n,r={};try{for(var o=s(t),u=o.next();!u.done;u=o.next()){var a=u.value;r[a]=W(e,a)}}catch(e){i={error:e}}finally{try{u&&!u.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return r}},G=function(e,t,i,n,r){return void 0===r&&(r=null),function(){for(var o=[],s=0;s<arguments.length;s++)o[s]=arguments[s];var u=i(),a=u.logger,c=u.logLevel;if(c&&c<f.Debug||!c||!a)return e.apply(r,o);var l={type:"invoke public method",name:t,args:o,stacktrace:Q(1),time:{start:(new Date).toISOString()},states:{}};n&&l.states&&(l.states.before=n());var d=e.apply(r,o);return d&&d.promise?d.promise.then((function(){n&&l.states&&(l.states.after=n()),l.time&&(l.time.end=(new Date).toISOString()),a.debug(JSON.stringify(l,null,2))})):(n&&l.states&&(l.states.after=n()),l.time&&(l.time.end=(new Date).toISOString()),a.debug(JSON.stringify(l,null,2))),d}},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)},H=function(){function e(){this.memoryStorage=new Map}return e.prototype.isEnabled=function(){return r(this,void 0,void 0,(function(){return o(this,(function(e){return[2,!0]}))}))},e.prototype.get=function(e){return r(this,void 0,void 0,(function(){return o(this,(function(t){return[2,this.memoryStorage.get(e)]}))}))},e.prototype.getRaw=function(e){return r(this,void 0,void 0,(function(){var t;return o(this,(function(i){switch(i.label){case 0:return[4,this.get(e)];case 1:return[2,(t=i.sent())?JSON.stringify(t):void 0]}}))}))},e.prototype.set=function(e,t){return r(this,void 0,void 0,(function(){return o(this,(function(i){return this.memoryStorage.set(e,t),[2]}))}))},e.prototype.remove=function(e){return r(this,void 0,void 0,(function(){return o(this,(function(t){return this.memoryStorage.delete(e),[2]}))}))},e.prototype.reset=function(){return r(this,void 0,void 0,(function(){return o(this,(function(e){return this.memoryStorage.clear(),[2]}))}))},e}(),Y=function(){function e(){}return e.prototype.send=function(e,t){return Promise.resolve(null)},e.prototype.buildResponse=function(e){var t,i,n,r,o,s,u,a,c,l,d,p,f,h,g,b,y,m,w,I,_,S;if("object"!=typeof e)return null;var E=e.code||0,k=this.buildStatus(E);switch(k){case v.Success:return{status:k,statusCode:E,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 v.Invalid:return{status:k,statusCode:E,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!==(u=e.events_with_missing_fields)&&void 0!==u?u:{},eventsWithInvalidIdLengths:null!==(a=e.events_with_invalid_id_lengths)&&void 0!==a?a:{},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!==(p=e.silenced_events)&&void 0!==p?p:[],throttledDevices:null!==(f=e.throttled_devices)&&void 0!==f?f:{},throttledEvents:null!==(h=e.throttled_events)&&void 0!==h?h:[]}};case v.PayloadTooLarge:return{status:k,statusCode:E,body:{error:null!==(g=e.error)&&void 0!==g?g:""}};case v.RateLimit:return{status:k,statusCode:E,body:{error:null!==(b=e.error)&&void 0!==b?b:"",epsThreshold:null!==(y=e.eps_threshold)&&void 0!==y?y:0,throttledDevices:null!==(m=e.throttled_devices)&&void 0!==m?m:{},throttledUsers:null!==(w=e.throttled_users)&&void 0!==w?w:{},exceededDailyQuotaDevices:null!==(I=e.exceeded_daily_quota_devices)&&void 0!==I?I:{},exceededDailyQuotaUsers:null!==(_=e.exceeded_daily_quota_users)&&void 0!==_?_:{},throttledEvents:null!==(S=e.throttled_events)&&void 0!==S?S:[]}};case v.Timeout:default:return{status:k,statusCode:E}}},e.prototype.buildStatus=function(e){return e>=200&&e<300?v.Success:429===e?v.RateLimit:413===e?v.PayloadTooLarge:408===e?v.Timeout:e>=400&&e<500?v.Invalid:e>=500?v.Failed:v.Unknown},e}(),X=function(e,t,i){return void 0===t&&(t=""),void 0===i&&(i=10),[k,t,e.substring(0,i)].filter(Boolean).join("_")},ee=function(){function e(e,t){var i,n;this.storage=t.storage,this.storageKey=X(e,"MKTG"),this.parser=new I,this.track=t.track,this.onNewCampaign=t.onNewCampaign,this.disabled=Boolean(t.disabled),this.trackNewCampaigns=Boolean(t.trackNewCampaigns),this.trackPageViews=Boolean(t.trackPageViews),this.excludeReferrers=null!==(i=t.excludeReferrers)&&void 0!==i?i:[],"undefined"!=typeof location&&this.excludeReferrers.unshift(location.hostname),this.initialEmptyValue=null!==(n=t.initialEmptyValue)&&void 0!==n?n:"EMPTY"}return e.prototype.isNewCampaign=function(e,t,i){void 0===i&&(i=!1),e.referrer;var r=e.referring_domain,o=n(e,["referrer","referring_domain"]),s=t||{};s.referrer;var u=s.referring_domain,a=n(s,["referrer","referring_domain"]);if(e.referring_domain&&this.excludeReferrers.includes(e.referring_domain))return!1;var c=JSON.stringify(o)!==JSON.stringify(a),l=i?te(r||"")!==te(u||""):r!==u;return!t||c||l},e.prototype.saveCampaignToStorage=function(e){return r(this,void 0,void 0,(function(){return o(this,(function(t){switch(t.label){case 0:return[4,this.storage.set(this.storageKey,e)];case 1:return t.sent(),[2]}}))}))},e.prototype.getCampaignFromStorage=function(){return r(this,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return[4,this.storage.get(this.storageKey)];case 1:return[2,e.sent()]}}))}))},e.prototype.createCampaignEvent=function(e){var t=this,n=i(i({},w),e),r=Object.entries(n).reduce((function(e,i){var n=u(i,2),r=n[0],o=n[1];return e.setOnce("initial_".concat(r),o||t.initialEmptyValue),o?e.set(r,o):e.unset(r)}),new R),o={event_type:"Page View",event_properties:{page_title:"undefined"!=typeof document&&document.title||"",page_location:"undefined"!=typeof location&&location.href||"",page_path:"undefined"!=typeof location&&location.pathname||""}};return i(i({},N(r)),this.trackPageViews&&o)},e.prototype.send=function(e){return r(this,void 0,void 0,(function(){var t,i;return o(this,(function(n){switch(n.label){case 0:return this.disabled?[2]:[4,this.parser.parse()];case 1:return t=n.sent(),[4,this.getCampaignFromStorage()];case 2:if(i=n.sent(),!e){if(!this.trackNewCampaigns||!this.isNewCampaign(t,i))return[2];this.onNewCampaign(t)}return[4,this.track(this.createCampaignEvent(t))];case 3:return n.sent(),[4,this.saveCampaignToStorage(t)];case 4:return n.sent(),[2]}}))}))},e}(),te=function(e){var t=e.split(".");return t.length<=2?e:t.slice(t.length-2,t.length).join(".")},ie=function(){function e(e){this.options=i({},e)}return e.prototype.isEnabled=function(){return r(this,void 0,void 0,(function(){var t,i,n;return o(this,(function(r){switch(r.label){case 0:if(!b())return[2,!1];t=String(Date.now()),i=new e(this.options),n="AMP_TEST",r.label=1;case 1:return r.trys.push([1,4,5,7]),[4,i.set(n,t)];case 2:return r.sent(),[4,i.get(n)];case 3:return[2,r.sent()===t];case 4:return r.sent(),[2,!1];case 5:return[4,i.remove(n)];case 6:return r.sent(),[7];case 7:return[2]}}))}))},e.prototype.get=function(e){return r(this,void 0,void 0,(function(){var t;return o(this,(function(i){switch(i.label){case 0:return[4,this.getRaw(e)];case 1:if(!(t=i.sent()))return[2,void 0];try{try{t=decodeURIComponent(atob(t))}catch(e){}return[2,JSON.parse(t)]}catch(e){return[2,void 0]}return[2]}}))}))},e.prototype.getRaw=function(e){var t;return r(this,void 0,void 0,(function(){var i,n,r;return o(this,(function(o){return i=b(),n=null!==(t=null==i?void 0:i.document.cookie.split("; "))&&void 0!==t?t:[],(r=n.find((function(t){return 0===t.indexOf(e+"=")})))?[2,r.substring(e.length+1)]:[2,void 0]}))}))},e.prototype.set=function(e,t){var i;return r(this,void 0,void 0,(function(){var n,r,s,u,a,c;return o(this,(function(o){try{n=null!==(i=this.options.expirationDays)&&void 0!==i?i:0,s=void 0,(r=null!==t?n:-1)&&((u=new Date).setTime(u.getTime()+24*r*60*60*1e3),s=u),a="".concat(e,"=").concat(btoa(encodeURIComponent(JSON.stringify(t)))),s&&(a+="; expires=".concat(s.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)),(c=b())&&(c.document.cookie=a)}catch(e){}return[2]}))}))},e.prototype.remove=function(e){return r(this,void 0,void 0,(function(){return o(this,(function(t){switch(t.label){case 0:return[4,this.set(e,null)];case 1:return t.sent(),[2]}}))}))},e.prototype.reset=function(){return r(this,void 0,void 0,(function(){return o(this,(function(e){return[2]}))}))},e}(),ne=function(){function e(e,t){this.storage=e,this.isSessionCacheValid=!0,this.storageKey=X(t),this.cache={optOut:!1}}return e.prototype.load=function(){var e;return r(this,void 0,void 0,(function(){var t;return o(this,(function(i){switch(i.label){case 0:return t=this,[4,this.storage.get(this.storageKey)];case 1:return t.cache=null!==(e=i.sent())&&void 0!==e?e:{optOut:!1},[2,this]}}))}))},e.prototype.setSession=function(e){this.cache=i(i({},this.cache),e),this.storage.set(this.storageKey,this.cache)},e.prototype.getSessionId=function(){var e=this;return this.isSessionCacheValid=!0,this.storage.get(this.storageKey).then((function(t){e.isSessionCacheValid&&(e.cache.sessionId=null==t?void 0:t.sessionId)})),this.cache.sessionId},e.prototype.setSessionId=function(e){this.isSessionCacheValid=!1,this.setSession({sessionId:e})},e.prototype.getDeviceId=function(){return this.cache.deviceId},e.prototype.setDeviceId=function(e){this.setSession({deviceId:e})},e.prototype.getUserId=function(){return this.cache.userId},e.prototype.setUserId=function(e){this.setSession({userId:e})},e.prototype.getLastEventTime=function(){return this.cache.lastEventTime},e.prototype.setLastEventTime=function(e){this.setSession({lastEventTime:e})},e.prototype.getOptOut=function(){return this.cache.optOut},e.prototype.setOptOut=function(e){this.setSession({optOut:e})},e}(),re=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return t(i,e),i.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,this.buildResponse(n)]}}))}))},i}(Y),oe="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},se={exports:{}};_=se,S=se.exports,function(e,t){var i="function",n="undefined",r="object",o="string",s="model",u="name",a="type",c="vendor",l="version",d="architecture",p="console",f="mobile",h="tablet",v="smarttv",g="wearable",b="embedded",y="Amazon",m="Apple",w="ASUS",I="BlackBerry",E="Firefox",k="Google",O="Huawei",T="LG",x="Microsoft",P="Motorola",R="Opera",N="Samsung",U="Sony",q="Xiaomi",C="Zebra",D="Facebook",A=function(e){for(var t={},i=0;i<e.length;i++)t[e[i].toUpperCase()]=e[i];return t},j=function(e,t){return typeof e===o&&-1!==M(t).indexOf(M(e))},M=function(e){return e.toLowerCase()},L=function(e,t){if(typeof e===o)return e=e.replace(/^\s\s*/,"").replace(/\s\s*$/,""),typeof t===n?e:e.substring(0,275)},V=function(e,n){for(var o,s,u,a,c,l,d=0;d<n.length&&!c;){var p=n[d],f=n[d+1];for(o=s=0;o<p.length&&!c;)if(c=p[o++].exec(e))for(u=0;u<f.length;u++)l=c[++s],typeof(a=f[u])===r&&a.length>0?2===a.length?typeof a[1]==i?this[a[0]]=a[1].call(this,l):this[a[0]]=a[1]:3===a.length?typeof a[1]!==i||a[1].exec&&a[1].test?this[a[0]]=l?l.replace(a[1],a[2]):t:this[a[0]]=l?a[1].call(this,l,a[2]):t:4===a.length&&(this[a[0]]=l?a[3].call(this,l.replace(a[1],a[2])):t):this[a]=l||t;d+=2}},B=function(e,i){for(var n in i)if(typeof i[n]===r&&i[n].length>0){for(var o=0;o<i[n].length;o++)if(j(i[n][o],e))return"?"===n?t:n}else if(j(i[n],e))return"?"===n?t:n;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],[l,[u,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[l,[u,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[u,l],[/opios[\/ ]+([\w\.]+)/i],[l,[u,"Opera Mini"]],[/\bopr\/([\w\.]+)/i],[l,[u,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],[u,l],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[l,[u,"UCBrowser"]],[/\bqbcore\/([\w\.]+)/i],[l,[u,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[l,[u,"WeChat"]],[/konqueror\/([\w\.]+)/i],[l,[u,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[l,[u,"IE"]],[/yabrowser\/([\w\.]+)/i],[l,[u,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[u,/(.+)/,"$1 Secure Browser"],l],[/\bfocus\/([\w\.]+)/i],[l,[u,"Firefox Focus"]],[/\bopt\/([\w\.]+)/i],[l,[u,"Opera Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[l,[u,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[l,[u,"Dolphin"]],[/coast\/([\w\.]+)/i],[l,[u,"Opera Coast"]],[/miuibrowser\/([\w\.]+)/i],[l,[u,"MIUI Browser"]],[/fxios\/([-\w\.]+)/i],[l,[u,E]],[/\bqihu|(qi?ho?o?|360)browser/i],[[u,"360 Browser"]],[/(oculus|samsung|sailfish)browser\/([\w\.]+)/i],[[u,/(.+)/,"$1 Browser"],l],[/(comodo_dragon)\/([\w\.]+)/i],[[u,/_/g," "],l],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[u,l],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i],[u],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[u,D],l],[/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/ ]([-\w\.]+)/i],[u,l],[/\bgsa\/([\w\.]+) .*safari\//i],[l,[u,"GSA"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[l,[u,"Chrome Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[u,"Chrome WebView"],l],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[l,[u,"Android Browser"]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[u,l],[/version\/([\w\.]+) .*mobile\/\w+ (safari)/i],[l,[u,"Mobile Safari"]],[/version\/([\w\.]+) .*(mobile ?safari|safari)/i],[l,u],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[u,[l,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],[u,l],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[u,"Netscape"],l],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[l,[u,"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],[u,l]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[d,"amd64"]],[/(ia32(?=;))/i],[[d,M]],[/((?:i[346]|x)86)[;\)]/i],[[d,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[d,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[d,"armhf"]],[/windows (ce|mobile); ppc;/i],[[d,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[d,/ower/,"",M]],[/(sun4\w)[;\)]/i],[[d,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[d,M]]],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],[s,[c,N],[a,h]],[/\b((?:s[cgp]h|gt|sm)-\w+|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[s,[c,N],[a,f]],[/((ipod|iphone)\d+,\d+)/i],[s,[c,m],[a,f]],[/(ipad\d+,\d+)/i],[s,[c,m],[a,h]],[/\((ip(?:hone|od)[\w ]*);/i],[s,[c,m],[a,f]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[s,[c,m],[a,h]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[s,[c,O],[a,h]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[s,[c,O],[a,f]],[/\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|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[s,/_/g," "],[c,q],[a,f]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[s,/_/g," "],[c,q],[a,h]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[s,[c,"OPPO"],[a,f]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[s,[c,"Vivo"],[a,f]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[s,[c,"Realme"],[a,f]],[/\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],[s,[c,P],[a,f]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[s,[c,P],[a,h]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[s,[c,T],[a,h]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[s,[c,T],[a,f]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[s,[c,"Lenovo"],[a,h]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[s,/_/g," "],[c,"Nokia"],[a,f]],[/(pixel c)\b/i],[s,[c,k],[a,h]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[s,[c,k],[a,f]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[s,[c,U],[a,f]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[s,"Xperia Tablet"],[c,U],[a,h]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[s,[c,"OnePlus"],[a,f]],[/(alexa)webm/i,/(kf[a-z]{2}wi)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[s,[c,y],[a,h]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[s,/(.+)/g,"Fire Phone $1"],[c,y],[a,f]],[/(playbook);[-\w\),; ]+(rim)/i],[s,c,[a,h]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[s,[c,I],[a,f]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[s,[c,w],[a,h]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[s,[c,w],[a,f]],[/(nexus 9)/i],[s,[c,"HTC"],[a,h]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic|sony(?!-bra))[-_ ]?([-\w]*)/i],[c,[s,/_/g," "],[a,f]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[s,[c,"Acer"],[a,h]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[s,[c,"Meizu"],[a,f]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[s,[c,"Sharp"],[a,f]],[/(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],[c,s,[a,f]],[/(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],[c,s,[a,h]],[/(surface duo)/i],[s,[c,x],[a,h]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[s,[c,"Fairphone"],[a,f]],[/(u304aa)/i],[s,[c,"AT&T"],[a,f]],[/\bsie-(\w*)/i],[s,[c,"Siemens"],[a,f]],[/\b(rct\w+) b/i],[s,[c,"RCA"],[a,h]],[/\b(venue[\d ]{2,7}) b/i],[s,[c,"Dell"],[a,h]],[/\b(q(?:mv|ta)\w+) b/i],[s,[c,"Verizon"],[a,h]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[s,[c,"Barnes & Noble"],[a,h]],[/\b(tm\d{3}\w+) b/i],[s,[c,"NuVision"],[a,h]],[/\b(k88) b/i],[s,[c,"ZTE"],[a,h]],[/\b(nx\d{3}j) b/i],[s,[c,"ZTE"],[a,f]],[/\b(gen\d{3}) b.+49h/i],[s,[c,"Swiss"],[a,f]],[/\b(zur\d{3}) b/i],[s,[c,"Swiss"],[a,h]],[/\b((zeki)?tb.*\b) b/i],[s,[c,"Zeki"],[a,h]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[c,"Dragon Touch"],s,[a,h]],[/\b(ns-?\w{0,9}) b/i],[s,[c,"Insignia"],[a,h]],[/\b((nxa|next)-?\w{0,9}) b/i],[s,[c,"NextBook"],[a,h]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[c,"Voice"],s,[a,f]],[/\b(lvtel\-)?(v1[12]) b/i],[[c,"LvTel"],s,[a,f]],[/\b(ph-1) /i],[s,[c,"Essential"],[a,f]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[s,[c,"Envizen"],[a,h]],[/\b(trio[-\w\. ]+) b/i],[s,[c,"MachSpeed"],[a,h]],[/\btu_(1491) b/i],[s,[c,"Rotor"],[a,h]],[/(shield[\w ]+) b/i],[s,[c,"Nvidia"],[a,h]],[/(sprint) (\w+)/i],[c,s,[a,f]],[/(kin\.[onetw]{3})/i],[[s,/\./g," "],[c,x],[a,f]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[s,[c,C],[a,h]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[s,[c,C],[a,f]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[c,s,[a,p]],[/droid.+; (shield) bui/i],[s,[c,"Nvidia"],[a,p]],[/(playstation [345portablevi]+)/i],[s,[c,U],[a,p]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[s,[c,x],[a,p]],[/smart-tv.+(samsung)/i],[c,[a,v]],[/hbbtv.+maple;(\d+)/i],[[s,/^/,"SmartTV"],[c,N],[a,v]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[c,T],[a,v]],[/(apple) ?tv/i],[c,[s,"Apple TV"],[a,v]],[/crkey/i],[[s,"Chromecast"],[c,k],[a,v]],[/droid.+aft(\w)( bui|\))/i],[s,[c,y],[a,v]],[/\(dtv[\);].+(aquos)/i],[s,[c,"Sharp"],[a,v]],[/(bravia[\w- ]+) bui/i],[s,[c,U],[a,v]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w ]*; *(\w[^;]*);([^;]*)/i],[[c,L],[s,L],[a,v]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[a,v]],[/((pebble))app/i],[c,s,[a,g]],[/droid.+; (glass) \d/i],[s,[c,k],[a,g]],[/droid.+; (wt63?0{2,3})\)/i],[s,[c,C],[a,g]],[/(quest( 2)?)/i],[s,[c,D],[a,g]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[c,[a,b]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[s,[a,f]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[s,[a,h]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[a,h]],[/(phone|mobile(?:[;\/]| safari)|pda(?=.+windows ce))/i],[[a,f]],[/(android[-\w\. ]{0,9});.+buil/i],[s,[c,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[l,[u,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[l,[u,"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],[u,l],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[l,u]],os:[[/microsoft (windows) (vista|xp)/i],[u,l],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[u,[l,B,z]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[u,"Windows"],[l,B,z]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/cfnetwork\/.+darwin/i],[[l,/_/g,"."],[u,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[u,"Mac OS"],[l,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86)/i],[l,u],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[u,l],[/\(bb(10);/i],[l,[u,I]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[l,[u,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[l,[u,"Firefox OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[l,[u,"webOS"]],[/crkey\/([\d\.]+)/i],[l,[u,"Chromecast"]],[/(cros) [\w]+ ([\w\.]+\w)/i],[[u,"Chromium OS"],l],[/(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],[u,l],[/(sunos) ?([\w\.\d]*)/i],[[u,"Solaris"],l],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux)/i,/(unix) ?([\w\.]*)/i],[u,l]]},K=function(i,s){if(typeof i===r&&(s=i,i=t),!(this instanceof K))return new K(i,s).getResult();var u=i||(typeof e!==n&&e.navigator&&e.navigator.userAgent?e.navigator.userAgent:""),a=s?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,s):F;return this.getBrowser=function(){var e,i={};return i.name=t,i.version=t,V.call(i,u,a.browser),i.major=typeof(e=i.version)===o?e.replace(/[^\d\.]/g,"").split(".")[0]:t,i},this.getCPU=function(){var e={};return e.architecture=t,V.call(e,u,a.cpu),e},this.getDevice=function(){var e={};return e.vendor=t,e.model=t,e.type=t,V.call(e,u,a.device),e},this.getEngine=function(){var e={};return e.name=t,e.version=t,V.call(e,u,a.engine),e},this.getOS=function(){var e={};return e.name=t,e.version=t,V.call(e,u,a.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 u},this.setUA=function(e){return u=typeof e===o&&e.length>275?L(e,275):e,this},this.setUA(u),this};K.VERSION="0.7.31",K.BROWSER=A([u,l,"major"]),K.CPU=A([d]),K.DEVICE=A([s,c,a,p,f,v,h,g,b]),K.ENGINE=K.OS=A([u,l]),_.exports&&(S=_.exports=K),S.UAParser=K;var Q=typeof e!==n&&(e.jQuery||e.Zepto);if(Q&&!Q.ua){var $=new K;Q.ua=$.getResult(),Q.ua.get=function(){return $.getUA()},Q.ua.set=function(e){$.setUA(e);var t=$.getResult();for(var i in t)Q.ua[i]=t[i]}}}("object"==typeof window?window:oe);var ue=se.exports,ae=function(){function e(){this.ua=new se.exports.UAParser("undefined"!=typeof navigator?navigator.userAgent:null).getResult()}return e.prototype.getApplicationContext=function(){return{versionName:this.versionName,language:de(),platform:"Web",os:ce(this.ua),deviceModel:le(this.ua)}},e}(),ce=function(e){var t,i;return[null===(t=e.browser)||void 0===t?void 0:t.name,null===(i=e.browser)||void 0===i?void 0:i.major].filter((function(e){return null!=e})).join(" ")},le=function(e){var t;return null===(t=e.os)||void 0===t?void 0:t.name},de=function(){return"undefined"!=typeof navigator&&(navigator.languages&&navigator.languages[0]||navigator.language)||""},pe=function(){function e(){this.queue=[]}return e.prototype.logEvent=function(e){this.receiver?this.receiver(e):this.queue.length<512&&this.queue.push(e)},e.prototype.setEventReceiver=function(e){this.receiver=e,this.queue.length>0&&(this.queue.forEach((function(t){e(t)})),this.queue=[])},e}(),fe=function(){return fe=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},fe.apply(this,arguments)};Object.entries||(Object.entries=function(e){for(var t=Object.keys(e),i=t.length,n=new Array(i);i--;)n[i]=[t[i],e[t[i]]];return n});var he=function(){function e(){this.identity={userProperties:{}},this.listeners=new Set}return e.prototype.editIdentity=function(){var e=this,t=fe({},this.identity.userProperties),i=fe(fe({},this.identity),{userProperties:t});return{setUserId:function(e){return i.userId=e,this},setDeviceId:function(e){return i.deviceId=e,this},setUserProperties:function(e){return i.userProperties=e,this},updateUserProperties:function(e){for(var t=i.userProperties||{},n=0,r=Object.entries(e);n<r.length;n++){var o=r[n],s=o[0],u=o[1];switch(s){case"$set":for(var a=0,c=Object.entries(u);a<c.length;a++){var l=c[a],d=l[0],p=l[1];t[d]=p}break;case"$unset":for(var f=0,h=Object.keys(u);f<h.length;f++){delete t[d=h[f]]}break;case"$clearAll":t={}}}return i.userProperties=t,this},commit:function(){return e.setIdentity(i),this}}},e.prototype.getIdentity=function(){return fe({},this.identity)},e.prototype.setIdentity=function(e){var t=fe({},this.identity);this.identity=fe({},e),ve(t,this.identity)||this.listeners.forEach((function(t){t(e)}))},e.prototype.addIdentityListener=function(e){this.listeners.add(e)},e.prototype.removeIdentityListener=function(e){this.listeners.delete(e)},e}(),ve=function(e,t){var i=typeof e;if(i!==typeof t)return!1;for(var n=0,r=["string","number","boolean","undefined"];n<r.length;n++){if(r[n]===i)return e===t}if(e.length!==t.length)return!1;var o=Array.isArray(e),s=Array.isArray(t);if(o!==s)return!1;if(!o||!s){var u=Object.keys(e).sort(),a=Object.keys(t).sort();if(!ve(u,a))return!1;var c=!0;return Object.keys(e).forEach((function(i){ve(e[i],t[i])||(c=!1)})),c}for(var l=0;l<e.length;l++)if(!ve(e[l],t[l]))return!1;return!0},ge="undefined"!=typeof globalThis?globalThis:global||self,be=function(){function e(){this.identityStore=new he,this.eventBridge=new pe,this.applicationContextProvider=new ae}return e.getInstance=function(t){return ge.analyticsConnectorInstances||(ge.analyticsConnectorInstances={}),ge.analyticsConnectorInstances[t]||(ge.analyticsConnectorInstances[t]=new e),ge.analyticsConnectorInstances[t]},e}(),ye=function(){return be.getInstance("$default_instance")},me=function(){function e(){this.name="identity",this.type=h.BEFORE,this.identityStore=ye().identityStore}return e.prototype.execute=function(e){return r(this,void 0,void 0,(function(){var t;return o(this,(function(i){return(t=e.user_properties)&&this.identityStore.editIdentity().updateUserProperties(t).commit(),[2,e]}))}))},e.prototype.setup=function(e){return Promise.resolve(void 0)},e}(),we=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:""},Ie=function(e,t){_e(e,t)},_e=function(e,t){for(var i=0;i<t.length;i++){var n=t[i],r=n.name,o=n.args,s=n.resolve,u=e&&e[r];if("function"==typeof u){var a=u.apply(e,o);"function"==typeof s&&s(null==a?void 0:a.promise)}}return e},Se=function(e){return e&&void 0!==e._q},Ee=function(){function e(){var e;this.name="context",this.type=h.BEFORE,this.eventId=0,this.library="amplitude-ts/".concat("1.6.1"),"undefined"!=typeof navigator&&(e=navigator.userAgent),this.uaResult=new ue(e).getResult()}return e.prototype.setup=function(e){return this.config=e,Promise.resolve(void 0)},e.prototype.execute=function(e){return r(this,void 0,void 0,(function(){var t,n,r,s,u;return o(this,(function(o){return this.isSessionValid()||(this.config.sessionId=Date.now()),this.config.lastEventTime=Date.now(),t=(new Date).getTime(),n=this.uaResult.browser.name,r=this.uaResult.browser.version,s=this.uaResult.device.model||this.uaResult.os.name,u=this.uaResult.device.vendor,[2,i(i(i(i(i(i(i(i(i(i(i(i({user_id:this.config.userId,device_id:this.config.deviceId,session_id:this.config.sessionId,time:t},this.config.appVersion&&{app_version:this.config.appVersion}),this.config.trackingOptions.platform&&{platform:"Web"}),this.config.trackingOptions.osName&&{os_name:n}),this.config.trackingOptions.osVersion&&{os_version:r}),this.config.trackingOptions.deviceManufacturer&&{device_manufacturer:u}),this.config.trackingOptions.deviceModel&&{device_model:s}),this.config.trackingOptions.language&&{language:we()}),this.config.trackingOptions.ipAddress&&{ip:"$remote"}),{insert_id:J(),partner_id:this.config.partnerId,plan:this.config.plan}),this.config.ingestionMetadata&&{ingestion_metadata:{source_name:this.config.ingestionMetadata.sourceName,source_version:this.config.ingestionMetadata.sourceVersion}}),e),{event_id:this.eventId++,library:this.library})]}))}))},e.prototype.isSessionValid=function(){var e=this.config.lastEventTime||Date.now();return Date.now()-e<this.config.sessionTimeout},e}(),ke=function(){function e(){}return e.prototype.isEnabled=function(){return r(this,void 0,void 0,(function(){var t,i,n;return o(this,(function(r){switch(r.label){case 0:if(!b())return[2,!1];t=String(Date.now()),i=new e,n="AMP_TEST",r.label=1;case 1:return r.trys.push([1,4,5,7]),[4,i.set(n,t)];case 2:return r.sent(),[4,i.get(n)];case 3:return[2,r.sent()===t];case 4:return r.sent(),[2,!1];case 5:return[4,i.remove(n)];case 6:return r.sent(),[7];case 7:return[2]}}))}))},e.prototype.get=function(e){return r(this,void 0,void 0,(function(){var t;return o(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,this.getRaw(e)];case 1:return(t=i.sent())?[2,JSON.parse(t)]:[2,void 0];case 2:return i.sent(),[2,void 0];case 3:return[2]}}))}))},e.prototype.getRaw=function(e){var t;return r(this,void 0,void 0,(function(){return o(this,(function(i){return[2,(null===(t=b())||void 0===t?void 0:t.localStorage.getItem(e))||void 0]}))}))},e.prototype.set=function(e,t){var i;return r(this,void 0,void 0,(function(){return o(this,(function(n){try{null===(i=b())||void 0===i||i.localStorage.setItem(e,JSON.stringify(t))}catch(e){}return[2]}))}))},e.prototype.remove=function(e){var t;return r(this,void 0,void 0,(function(){return o(this,(function(i){try{null===(t=b())||void 0===t||t.localStorage.removeItem(e)}catch(e){}return[2]}))}))},e.prototype.reset=function(){var e;return r(this,void 0,void 0,(function(){return o(this,(function(t){try{null===(e=b())||void 0===e||e.localStorage.clear()}catch(e){}return[2]}))}))},e}(),Oe=function(e){function i(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={done:4},t}return t(i,e),i.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=i.buildResponse(t);n(s)}catch(e){r(e)}},o.setRequestHeader("Content-Type","application/json"),o.setRequestHeader("Accept","*/*"),o.send(JSON.stringify(t))}))]}))}))},i}(Y),Te=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return t(i,e),i.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){var o=b();if(!(null==o?void 0:o.navigator.sendBeacon))throw new Error("SendBeaconTransport is not supported");try{var s=JSON.stringify(t);return n(o.navigator.sendBeacon(e,JSON.stringify(t))?i.buildResponse({code:200,events_ingested:t.events.length,payload_size_bytes:s.length,server_upload_time:Date.now()}):i.buildResponse({code:500}))}catch(e){r(e)}}))]}))}))},i}(Y),xe=function(){var e=new H;return{cookieExpiration:365,cookieSameSite:"Lax",cookieSecure:!1,cookieStorage:e,disableCookies:!1,domain:"",sessionManager:new ne(e,""),sessionTimeout:18e5,storageProvider:new H,trackingOptions:{deviceManufacturer:!0,deviceModel:!0,ipAddress:!0,language:!0,osName:!0,osVersion:!0,platform:!0},transportProvider:new re}},Pe=function(e){function n(t,n,r){var o,s,u,a,c,l,d,p,f,h,v,g,b=this,y=xe();return(b=e.call(this,i(i({flushIntervalMillis:1e3,flushMaxRetries:5,flushQueueSize:30},r),{apiKey:t,storageProvider:null!==(o=null==r?void 0:r.storageProvider)&&void 0!==o?o:y.storageProvider,transportProvider:null!==(s=null==r?void 0:r.transportProvider)&&void 0!==s?s:y.transportProvider}))||this).cookieStorage=null!==(u=null==r?void 0:r.cookieStorage)&&void 0!==u?u:y.cookieStorage,b.sessionManager=null!==(a=null==r?void 0:r.sessionManager)&&void 0!==a?a:y.sessionManager,b.sessionTimeout=null!==(c=null==r?void 0:r.sessionTimeout)&&void 0!==c?c:y.sessionTimeout,b.appVersion=null==r?void 0:r.appVersion,b.attribution=null==r?void 0:r.attribution,b.cookieExpiration=null!==(l=null==r?void 0:r.cookieExpiration)&&void 0!==l?l:y.cookieExpiration,b.cookieSameSite=null!==(d=null==r?void 0:r.cookieSameSite)&&void 0!==d?d:y.cookieSameSite,b.cookieSecure=null!==(p=null==r?void 0:r.cookieSecure)&&void 0!==p?p:y.cookieSecure,b.deviceId=null==r?void 0:r.deviceId,b.disableCookies=null!==(f=null==r?void 0:r.disableCookies)&&void 0!==f?f:y.disableCookies,b.domain=null!==(h=null==r?void 0:r.domain)&&void 0!==h?h:y.domain,b.lastEventTime=null!==(v=b.lastEventTime)&&void 0!==v?v:null==r?void 0:r.lastEventTime,b.optOut=Boolean(null==r?void 0:r.optOut),b.partnerId=null==r?void 0:r.partnerId,b.sessionId=null==r?void 0:r.sessionId,b.trackingOptions=null!==(g=null==r?void 0:r.trackingOptions)&&void 0!==g?g:y.trackingOptions,b.userId=n,b}return t(n,e),Object.defineProperty(n.prototype,"deviceId",{get:function(){return this.sessionManager.getDeviceId()},set:function(e){this.sessionManager.setDeviceId(e)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"userId",{get:function(){return this.sessionManager.getUserId()},set:function(e){this.sessionManager.setUserId(e)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"sessionId",{get:function(){return this.sessionManager.getSessionId()},set:function(e){this.sessionManager.setSessionId(e)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"optOut",{get:function(){return this.sessionManager.getOptOut()},set:function(e){var t;null===(t=this.sessionManager)||void 0===t||t.setOptOut(Boolean(e))},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"lastEventTime",{get:function(){return this.sessionManager.getLastEventTime()},set:function(e){this.sessionManager.setLastEventTime(e)},enumerable:!1,configurable:!0}),n}(V),Re=function(e,t,n){return r(void 0,void 0,void 0,(function(){var r,s,u,a,c,l,d,p,f,h,v,g,b,m,w,I,_;return o(this,(function(o){switch(o.label){case 0:return r=xe(),null===(b=null==n?void 0:n.domain)||void 0===b?[3,1]:(u=b,[3,3]);case 1:return[4,Ae()];case 2:u=o.sent(),o.label=3;case 3:return s=u,[4,Ne(i(i({},n),{domain:s}))];case 4:return a=o.sent(),c=X(e),[4,a.get(c)];case 5:return l=o.sent(),d=y(),[4,new ne(a,e).load()];case 6:return p=o.sent(),f=Pe.bind,h=[void 0,e,null!=t?t:null==l?void 0:l.userId],v=[i({},n)],g={cookieStorage:a,sessionManager:p,deviceId:Ce(null==l?void 0:l.deviceId,null==n?void 0:n.deviceId,d.deviceId),domain:s,optOut:null!==(m=null==n?void 0:n.optOut)&&void 0!==m?m:Boolean(null==l?void 0:l.optOut)},[4,a.get(c)];case 7:return g.sessionId=null!==(I=null===(w=o.sent())||void 0===w?void 0:w.sessionId)&&void 0!==I?I:null==n?void 0:n.sessionId,[4,qe(n)];case 8:return[2,new(f.apply(Pe,h.concat([i.apply(void 0,v.concat([(g.storageProvider=o.sent(),g.trackingOptions=i(i({},r.trackingOptions),null==n?void 0:n.trackingOptions),g.transportProvider=null!==(_=null==n?void 0:n.transportProvider)&&void 0!==_?_:De(null==n?void 0:n.transport),g)]))])))]}}))}))},Ne=function(e,t){return void 0===t&&(t=xe()),r(void 0,void 0,void 0,(function(){var n,r,s;return o(this,(function(o){switch(o.label){case 0:return n=i(i({},t),e),r=null==e?void 0:e.cookieStorage,(s=!r)?[3,2]:[4,r.isEnabled()];case 1:s=!o.sent(),o.label=2;case 2:return s?[2,Ue(n)]:[2,r]}}))}))},Ue=function(e){return r(void 0,void 0,void 0,(function(){var t,i;return o(this,(function(n){switch(n.label){case 0:return t=new ie({domain:e.domain,expirationDays:e.cookieExpiration,sameSite:e.cookieSameSite,secure:e.cookieSecure}),(i=e.disableCookies)?[3,2]:[4,t.isEnabled()];case 1:i=!n.sent(),n.label=2;case 2:return i?[4,(t=new ke).isEnabled()]:[3,4];case 3:n.sent()||(t=new H),n.label=4;case 4:return[2,t]}}))}))},qe=function(e){return r(void 0,void 0,void 0,(function(){var t,i,n,r,u,a,c;return o(this,(function(o){switch(o.label){case 0:if(e&&Object.prototype.hasOwnProperty.call(e,"storageProvider")&&!e.storageProvider)return[3,9];o.label=1;case 1:o.trys.push([1,7,8,9]),t=s([null==e?void 0:e.storageProvider,new ke]),i=t.next(),o.label=2;case 2:return i.done?[3,6]:(n=i.value,(r=n)?[4,n.isEnabled()]:[3,4]);case 3:r=o.sent(),o.label=4;case 4:if(r)return[2,n];o.label=5;case 5:return i=t.next(),[3,2];case 6:return[3,9];case 7:return u=o.sent(),a={error:u},[3,9];case 8:try{i&&!i.done&&(c=t.return)&&c.call(t)}finally{if(a)throw a.error}return[7];case 9:return[2,void 0]}}))}))},Ce=function(e,t,i){return t||i||e||J()},De=function(e){return e===g.XHR?new Oe:e===g.SendBeacon?new Te:xe().transportProvider},Ae=function(e){return r(void 0,void 0,void 0,(function(){var t,i,n,r,s,u,a;return o(this,(function(o){switch(o.label){case 0:return[4,(new ie).isEnabled()];case 1:if(!o.sent()||!e&&"undefined"==typeof location)return[2,""];for(t=null!=e?e:location.hostname,i=t.split("."),n=[],r="AMP_TLDTEST",s=i.length-2;s>=0;--s)n.push(i.slice(s).join("."));s=0,o.label=2;case 2:return s<n.length?(u=n[s],[4,(a=new ie({domain:"."+u})).set(r,1)]):[3,7];case 3:return o.sent(),[4,a.get(r)];case 4:return o.sent()?[4,a.remove(r)]:[3,6];case 5:return o.sent(),[2,"."+u];case 6:return s++,[3,2];case 7:return[2,""]}}))}))},je=function(e,t){return r(void 0,void 0,void 0,(function(){var i,n,r,s,a,c,l,d,p;return o(this,(function(o){switch(o.label){case 0:return[4,(i=new ie).isEnabled()];case 1:return o.sent()&&!(null==t?void 0:t.disableCookies)||(i=new ke),[4,i.isEnabled()];case 2:return o.sent()?(n=function(e){return"".concat(k.toLowerCase(),"_").concat(e.substring(0,6))}(e),[4,i.getRaw(n)]):[2,{optOut:!1}];case 3:return(r=o.sent())?[4,i.remove(n)]:[2,{optOut:!1}];case 4:return o.sent(),s=u(r.split("."),5),a=s[0],c=s[1],l=s[2],d=s[3],p=s[4],[2,{deviceId:a,userId:Le(c),sessionId:Me(d),lastEventTime:Me(p),optOut:Boolean(l)}]}}))}))},Me=function(e){var t=parseInt(e,32);if(!isNaN(t))return t},Le=function(e){if(atob&&escape&&e)try{return decodeURIComponent(escape(atob(e)))}catch(e){return}},Ve=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return t(n,e),n.prototype.init=function(t,n,s){var u,a,c;return void 0===t&&(t=""),r(this,void 0,void 0,(function(){var r,l,d,p,f=this;return o(this,(function(o){switch(o.label){case 0:return this.initializing?[2]:(this.initializing=!0,[4,je(t,s)]);case 1:return r=o.sent(),[4,Re(t,n||r.userId,i(i({},s),{deviceId:null!==(u=r.deviceId)&&void 0!==u?u:null==s?void 0:s.deviceId,sessionId:null!==(a=r.sessionId)&&void 0!==a?a:null==s?void 0:s.sessionId,optOut:null!==(c=null==s?void 0:s.optOut)&&void 0!==c?c:r.optOut,lastEventTime:r.lastEventTime}))];case 2:return l=o.sent(),[4,e.prototype._init.call(this,l)];case 3:return o.sent(),d=!this.config.lastEventTime,(!this.config.sessionId||this.config.lastEventTime&&Date.now()-this.config.lastEventTime>this.config.sessionTimeout)&&(this.setSessionId(Date.now()),d=!0),(p=ye()).eventBridge.setEventReceiver((function(e){f.track(e.eventType,e.eventProperties)})),p.identityStore.setIdentity({userId:this.config.userId,deviceId:this.config.deviceId}),[4,this.add(new Ee)];case 4:return o.sent(),[4,this.add(new me)];case 5:return o.sent(),[4,this.add(new F)];case 6:return o.sent(),this.initializing=!1,[4,this.runAttributionStrategy(l.attribution,d)];case 7:return o.sent(),[4,this.runQueuedFunctions("dispatchQ")];case 8:return o.sent(),[2]}}))}))},n.prototype.runAttributionStrategy=function(e,t){return void 0===t&&(t=!1),r(this,void 0,void 0,(function(){var n,r,s;return o(this,(function(o){switch(o.label){case 0:return n=this.track.bind(this),r=this.setSessionId.bind(this,Date.now()),[4,Ue(this.config)];case 1:return s=o.sent(),[4,new ee(this.config.apiKey,i(i({},e),{storage:s,track:n,onNewCampaign:r})).send(t)];case 2:return o.sent(),[2]}}))}))},n.prototype.getUserId=function(){var e;return null===(e=this.config)||void 0===e?void 0:e.userId},n.prototype.setUserId=function(e){this.config?this.config.userId=e:this.q.push(this.setUserId.bind(this,e))},n.prototype.getDeviceId=function(){var e;return null===(e=this.config)||void 0===e?void 0:e.deviceId},n.prototype.setDeviceId=function(e){this.config?this.config.deviceId=e:this.q.push(this.setDeviceId.bind(this,e))},n.prototype.reset=function(){this.setUserId(void 0),this.setDeviceId(J())},n.prototype.getSessionId=function(){var e;return null===(e=this.config)||void 0===e?void 0:e.sessionId},n.prototype.setSessionId=function(e){this.config?(this.config.sessionId=e,this.config.lastEventTime=void 0):this.q.push(this.setSessionId.bind(this,e))},n.prototype.setTransport=function(e){this.config?this.config.transportProvider=De(e):this.q.push(this.setTransport.bind(this,e))},n.prototype.identify=function(t,i){if(Se(t)){var n=t._q;t._q=[],t=_e(new R,n)}return(null==i?void 0:i.user_id)&&this.setUserId(i.user_id),(null==i?void 0:i.device_id)&&this.setDeviceId(i.device_id),e.prototype.identify.call(this,t,i)},n.prototype.groupIdentify=function(t,i,n,r){if(Se(n)){var o=n._q;n._q=[],n=_e(new R,o)}return e.prototype.groupIdentify.call(this,t,i,n,r)},n.prototype.revenue=function(t,i){if(Se(t)){var n=t._q;t._q=[],t=_e(new A,n)}return e.prototype.revenue.call(this,t,i)},n}(D),Be=function(){var e=new Ve;return{init:G(K(e.init.bind(e)),"init",$(e),Z(e,["config"])),add:G(K(e.add.bind(e)),"add",$(e),Z(e,["config.apiKey","timeline.plugins"])),remove:G(K(e.remove.bind(e)),"remove",$(e),Z(e,["config.apiKey","timeline.plugins"])),track:G(K(e.track.bind(e)),"track",$(e),Z(e,["config.apiKey","timeline.queue.length"])),logEvent:G(K(e.logEvent.bind(e)),"logEvent",$(e),Z(e,["config.apiKey","timeline.queue.length"])),identify:G(K(e.identify.bind(e)),"identify",$(e),Z(e,["config.apiKey","timeline.queue.length"])),groupIdentify:G(K(e.groupIdentify.bind(e)),"groupIdentify",$(e),Z(e,["config.apiKey","timeline.queue.length"])),setGroup:G(K(e.setGroup.bind(e)),"setGroup",$(e),Z(e,["config.apiKey","timeline.queue.length"])),revenue:G(K(e.revenue.bind(e)),"revenue",$(e),Z(e,["config.apiKey","timeline.queue.length"])),flush:G(K(e.flush.bind(e)),"flush",$(e),Z(e,["config.apiKey","timeline.queue.length"])),getUserId:G(e.getUserId.bind(e),"getUserId",$(e),Z(e,["config","config.userId"])),setUserId:G(e.setUserId.bind(e),"setUserId",$(e),Z(e,["config","config.userId"])),getDeviceId:G(e.getDeviceId.bind(e),"getDeviceId",$(e),Z(e,["config","config.deviceId"])),setDeviceId:G(e.setDeviceId.bind(e),"setDeviceId",$(e),Z(e,["config","config.deviceId"])),reset:G(e.reset.bind(e),"reset",$(e),Z(e,["config","config.userId","config.deviceId"])),getSessionId:G(e.getSessionId.bind(e),"getSessionId",$(e),Z(e,["config"])),setSessionId:G(e.setSessionId.bind(e),"setSessionId",$(e),Z(e,["config"])),setOptOut:G(e.setOptOut.bind(e),"setOptOut",$(e),Z(e,["config"])),setTransport:G(e.setTransport.bind(e),"setTransport",$(e),Z(e,["config"]))}},ze=Be(),Fe=ze.add,Ke=ze.flush,Qe=ze.getDeviceId,$e=ze.getSessionId,We=ze.getUserId,Ze=ze.groupIdentify,Ge=ze.identify,Je=ze.init,He=ze.logEvent,Ye=ze.remove,Xe=ze.reset,et=ze.revenue,tt=ze.setDeviceId,it=ze.setGroup,nt=ze.setOptOut,rt=ze.setSessionId,ot=ze.setTransport,st=ze.setUserId,ut=ze.track,at=Object.freeze({__proto__:null,add:Fe,flush:Ke,getDeviceId:Qe,getSessionId:$e,getUserId:We,groupIdentify:Ze,identify:Ge,init:Je,logEvent:He,remove:Ye,reset:Xe,revenue:et,setDeviceId:tt,setGroup:it,setOptOut:nt,setSessionId:rt,setTransport:ot,setUserId:st,track:ut,Types:E,createInstance:Be,runQueuedFunctions:Ie,Revenue:A,Identify:R});!function(){var e=b();if(e){if(e.amplitude=Object.assign(e.amplitude||{},at),e.amplitude.invoked){var t=e.amplitude._q;e.amplitude._q=[],Ie(at,t);for(var i=0;i<e.amplitude._iq.length;i++){var n=Object.assign(e.amplitude._iq[i],Be()),r=n._q;n._q=[],Ie(n,r)}}}else console.error("[Amplitude] Error: GlobalScope is not defined")}()}();
Binary file
@@ -12,4 +12,4 @@
12
12
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13
13
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14
14
  PERFORMANCE OF THIS SOFTWARE.
15
- ***************************************************************************** */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,r,o,s,u,a,c,l,d=function(){return d=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},d.apply(this,arguments)};function p(e,t){var i={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(i[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(e);r<n.length;r++)t.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(e,n[r])&&(i[n[r]]=e[n[r]])}return i}function f(e,t,i,n){return new(i||(i=Promise))((function(r,o){function s(e){try{a(n.next(e))}catch(e){o(e)}}function u(e){try{a(n.throw(e))}catch(e){o(e)}}function a(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(s,u)}a((n=n.apply(e,t||[])).next())}))}function h(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:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(o){return function(u){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,u])}}}function v(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 g(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 b(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))}!function(e){e.US="US",e.EU="EU"}(n||(n={})),function(e){e.SET="$set",e.SET_ONCE="$setOnce",e.ADD="$add",e.APPEND="$append",e.PREPEND="$prepend",e.REMOVE="$remove",e.PREINSERT="$preInsert",e.POSTINSERT="$postInsert",e.UNSET="$unset",e.CLEAR_ALL="$clearAll"}(r||(r={})),function(e){e.REVENUE_PRODUCT_ID="$productId",e.REVENUE_QUANTITY="$quantity",e.REVENUE_PRICE="$price",e.REVENUE_TYPE="$revenueType",e.REVENUE="$revenue"}(o||(o={})),function(e){e.IDENTIFY="$identify",e.GROUP_IDENTIFY="$groupidentify",e.REVENUE="revenue_amount"}(s||(s={})),function(e){e[e.None=0]="None",e[e.Error=1]="Error",e[e.Warn=2]="Warn",e[e.Verbose=3]="Verbose"}(u||(u={})),function(e){e.BEFORE="before",e.ENRICHMENT="enrichment",e.DESTINATION="destination"}(a||(a={})),function(e){e.Unknown="unknown",e.Skipped="skipped",e.Success="success",e.RateLimit="rate_limit",e.PayloadTooLarge="payload_too_large",e.Invalid="invalid",e.Failed="failed",e.Timeout="Timeout",e.SystemError="SystemError"}(c||(c={})),function(e){e.XHR="xhr",e.SendBeacon="beacon",e.Fetch="fetch"}(l||(l={}));var y=Object.freeze({__proto__:null,get ServerZone(){return n},get SpecialEventType(){return s},get IdentifyOperation(){return r},get RevenueProperty(){return o},get LogLevel(){return u},get PluginType(){return a},get Status(){return c},get TransportType(){return l}}),m="AMP",w="".concat(m,"_unsent"),I="https://api2.amplitude.com/2/httpapi",_=function(e){if(Object.keys(e).length>1e3)return!1;for(var t in e){var i=e[t];if(!S(t,i))return!1}return!0},S=function(e,t){var i,n;if("string"!=typeof e)return!1;if(Array.isArray(t)){var r=!0;try{for(var o=v(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&&_(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(null==t)return!1;if("object"==typeof t)return _(t);if(!["number","string","boolean"].includes(typeof t))return!1}return!0},E=function(){function e(){this._propertySet=new Set,this._properties={}}return e.prototype.getUserProperties=function(){return d({},this._properties)},e.prototype.set=function(e,t){return this._safeSet(r.SET,e,t),this},e.prototype.setOnce=function(e,t){return this._safeSet(r.SET_ONCE,e,t),this},e.prototype.append=function(e,t){return this._safeSet(r.APPEND,e,t),this},e.prototype.prepend=function(e,t){return this._safeSet(r.PREPEND,e,t),this},e.prototype.postInsert=function(e,t){return this._safeSet(r.POSTINSERT,e,t),this},e.prototype.preInsert=function(e,t){return this._safeSet(r.PREINSERT,e,t),this},e.prototype.remove=function(e,t){return this._safeSet(r.REMOVE,e,t),this},e.prototype.add=function(e,t){return this._safeSet(r.ADD,e,t),this},e.prototype.unset=function(e){return this._safeSet(r.UNSET,e,"-"),this},e.prototype.clearAll=function(){return this._properties={},this._properties[r.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[r.CLEAR_ALL]&&(!this._propertySet.has(t)&&(e===r.ADD?"number"==typeof i:e===r.UNSET||e===r.REMOVE||S(t,i)))},e}(),k=function(e,t){return d(d({},t),{event_type:s.IDENTIFY,user_properties:e.getUserProperties()})},O=function(e,t,i){return void 0===t&&(t=0),void 0===i&&(i=c.Unknown),{event:e,code:t,message:i}},T=function(){function e(){this.queue=[],this.applying=!1,this.plugins=[]}return e.prototype.register=function(e,t){return f(this,void 0,void 0,(function(){return h(this,(function(i){switch(i.label){case 0:return[4,e.setup(t)];case 1:return i.sent(),this.plugins.push(e),[2]}}))}))},e.prototype.deregister=function(e){return this.plugins.splice(this.plugins.findIndex((function(t){return t.name===e})),1),Promise.resolve()},e.prototype.reset=function(){this.applying=!1,this.plugins=[]},e.prototype.push=function(e){var t=this;return new Promise((function(i){t.queue.push([e,i]),t.scheduleApply(0)}))},e.prototype.scheduleApply=function(e){var t=this;this.applying||(this.applying=!0,setTimeout((function(){t.apply(t.queue.shift()).then((function(){t.applying=!1,t.queue.length>0&&t.scheduleApply(0)}))}),e))},e.prototype.apply=function(e){return f(this,void 0,void 0,(function(){var t,i,n,r,o,s,u,c,l,p,f,b,y,m,w,I,_,S;return h(this,(function(h){switch(h.label){case 0:if(!e)return[2];t=g(e,1),i=t[0],n=g(e,2),r=n[1],o=this.plugins.filter((function(e){return e.type===a.BEFORE})),h.label=1;case 1:h.trys.push([1,6,7,8]),s=v(o),u=s.next(),h.label=2;case 2:return u.done?[3,5]:[4,u.value.execute(d({},i))];case 3:i=h.sent(),h.label=4;case 4:return u=s.next(),[3,2];case 5:return[3,8];case 6:return c=h.sent(),w={error:c},[3,8];case 7:try{u&&!u.done&&(I=s.return)&&I.call(s)}finally{if(w)throw w.error}return[7];case 8:l=this.plugins.filter((function(e){return e.type===a.ENRICHMENT})),h.label=9;case 9:h.trys.push([9,14,15,16]),p=v(l),f=p.next(),h.label=10;case 10:return f.done?[3,13]:[4,f.value.execute(d({},i))];case 11:i=h.sent(),h.label=12;case 12:return f=p.next(),[3,10];case 13:return[3,16];case 14:return b=h.sent(),_={error:b},[3,16];case 15:try{f&&!f.done&&(S=p.return)&&S.call(p)}finally{if(_)throw _.error}return[7];case 16:return y=this.plugins.filter((function(e){return e.type===a.DESTINATION})),m=y.map((function(e){var t=d({},i);return e.execute(t).catch((function(e){return O(t,0,String(e))}))})),Promise.all(m).then((function(e){var t=g(e,1)[0];r(t)})),[2]}}))}))},e.prototype.flush=function(){return f(this,void 0,void 0,(function(){var e,t,i,n=this;return h(this,(function(r){switch(r.label){case 0:return e=this.queue,this.queue=[],[4,Promise.all(e.map((function(e){return n.apply(e)})))];case 1:return r.sent(),t=this.plugins.filter((function(e){return e.type===a.DESTINATION})),i=t.map((function(e){return e.flush&&e.flush()})),[4,Promise.all(i)];case 2:return r.sent(),[2]}}))}))},e}(),x="Event rejected due to exceeded retry count",P=function(){function e(e){void 0===e&&(e="$default"),this.initializing=!1,this.q=[],this.dispatchQ=[],this.logEvent=this.track.bind(this),this.timeline=new T,this.name=e}return e.prototype._init=function(e){return f(this,void 0,void 0,(function(){return h(this,(function(t){switch(t.label){case 0:return this.config=e,this.timeline.reset(),[4,this.runQueuedFunctions("q")];case 1:return t.sent(),[2]}}))}))},e.prototype.runQueuedFunctions=function(e){return f(this,void 0,void 0,(function(){var t,i,n,r,o,s;return h(this,(function(u){switch(u.label){case 0:t=this[e],this[e]=[],u.label=1;case 1:u.trys.push([1,6,7,8]),i=v(t),n=i.next(),u.label=2;case 2:return n.done?[3,5]:[4,(0,n.value)()];case 3:u.sent(),u.label=4;case 4:return n=i.next(),[3,2];case 5:return[3,8];case 6:return r=u.sent(),o={error:r},[3,8];case 7:try{n&&!n.done&&(s=i.return)&&s.call(i)}finally{if(o)throw o.error}return[7];case 8:return[2]}}))}))},e.prototype.track=function(e,t,i){var n=function(e,t,i){return d(d(d({},"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){var i=k(e,t);return this.dispatch(i)},e.prototype.groupIdentify=function(e,t,i,n){var r=function(e,t,i,n){var r;return d(d({},n),{event_type:s.GROUP_IDENTIFY,group_properties:i.getUserProperties(),groups:(r={},r[e]=t,r)})}(e,t,i,n);return this.dispatch(r)},e.prototype.setGroup=function(e,t,i){var n=function(e,t,i){var n,r=new E;return r.set(e,t),d(d({},i),{event_type:s.IDENTIFY,user_properties:r.getUserProperties(),groups:(n={},n[e]=t,n)})}(e,t,i);return this.dispatch(n)},e.prototype.revenue=function(e,t){var i=function(e,t){return d(d({},t),{event_type:s.REVENUE,event_properties:e.getEventProperties()})}(e,t);return this.dispatch(i)},e.prototype.add=function(e){return f(this,void 0,void 0,(function(){return h(this,(function(t){return this.config?[2,this.timeline.register(e,this.config)]:(this.q.push(this.add.bind(this,e)),[2])}))}))},e.prototype.remove=function(e){return f(this,void 0,void 0,(function(){return h(this,(function(t){return this.config?[2,this.timeline.deregister(e)]:(this.q.push(this.remove.bind(this,e)),[2])}))}))},e.prototype.dispatchWithCallback=function(e,t){if(!this.config)return t(O(e,0,"Client not initialized"));this.process(e).then(t)},e.prototype.dispatch=function(e){return f(this,void 0,void 0,(function(){var t=this;return h(this,(function(i){return this.config?[2,this.process(e)]:[2,new Promise((function(i){t.dispatchQ.push(t.dispatchWithCallback.bind(t,e,i))}))]}))}))},e.prototype.process=function(e){return f(this,void 0,void 0,(function(){var t,i,n;return h(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),this.config.optOut?[2,O(e,0,"Event skipped due to optOut config")]:[4,this.timeline.push(e)];case 1:return 200===(n=r.sent()).code?this.config.loggerProvider.log(n.message):this.config.loggerProvider.error(n.message),[2,n];case 2:return t=r.sent(),i=String(t),this.config.loggerProvider.error(i),[2,n=O(e,0,i)];case 3:return[2]}}))}))},e.prototype.setOptOut=function(e){this.config?this.config.optOut=Boolean(e):this.q.push(this.setOptOut.bind(this,Boolean(e)))},e.prototype.flush=function(){return this.timeline.flush()},e}(),R=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)&&(this.properties=e),this},e.prototype.getEventProperties=function(){var e=this.properties?d({},this.properties):{};return e[o.REVENUE_PRODUCT_ID]=this.productId,e[o.REVENUE_QUANTITY]=this.quantity,e[o.REVENUE_PRICE]=this.price,e[o.REVENUE_TYPE]=this.revenueType,e[o.REVENUE]=this.revenue,e},e}(),N="Amplitude Logger ",U=function(){function e(){this.logLevel=u.None}return e.prototype.disable=function(){this.logLevel=u.None},e.prototype.enable=function(e){void 0===e&&(e=u.Warn),this.logLevel=e},e.prototype.log=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<u.Verbose||console.log("".concat(N,"[Log]: ").concat(e.join(" ")))},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<u.Warn||console.warn("".concat(N,"[Warn]: ").concat(e.join(" ")))},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<u.Error||console.error("".concat(N,"[Error]: ").concat(e.join(" ")))},e}(),C=function(){return{flushMaxRetries:12,flushQueueSize:200,flushIntervalMillis:1e4,logLevel:u.Warn,loggerProvider:new U,optOut:!1,serverUrl:I,serverZone:n.US,useBatch:!1}},q=function(){function e(e){var t,i,n;this._optOut=!1;var r=C();this.apiKey=e.apiKey,this.flushIntervalMillis=e.flushIntervalMillis||r.flushIntervalMillis,this.flushMaxRetries=e.flushMaxRetries||r.flushMaxRetries,this.flushQueueSize=e.flushQueueSize||r.flushQueueSize,this.loggerProvider=e.loggerProvider||r.loggerProvider,this.logLevel=null!==(t=e.logLevel)&&void 0!==t?t:r.logLevel,this.minIdLength=e.minIdLength,this.plan=e.plan,this.ingestionMetadata=e.ingestionMetadata,this.optOut=null!==(i=e.optOut)&&void 0!==i?i:r.optOut,this.serverUrl=e.serverUrl,this.serverZone=e.serverZone||r.serverZone,this.storageProvider=e.storageProvider,this.transportProvider=e.transportProvider,this.useBatch=null!==(n=e.useBatch)&&void 0!==n?n:r.useBatch,this.loggerProvider.enable(this.logLevel);var o=A(e.serverUrl,e.serverZone,e.useBatch);this.serverZone=o.serverZone,this.serverUrl=o.serverUrl}return Object.defineProperty(e.prototype,"optOut",{get:function(){return this._optOut},set:function(e){this._optOut=e},enumerable:!1,configurable:!0}),e}(),D=function(e,t){return e===n.EU?t?"https://api.eu.amplitude.com/batch":"https://api.eu.amplitude.com/2/httpapi":t?"https://api2.amplitude.com/batch":I},A=function(e,t,i){if(void 0===e&&(e=""),void 0===t&&(t=C().serverZone),void 0===i&&(i=C().useBatch),e)return{serverUrl:e,serverZone:void 0};var r=[n.US,n.EU].includes(t)?t:C().serverZone;return{serverZone:r,serverUrl:D(r,i)}},M=function(){function e(){this.name="amplitude",this.type=a.DESTINATION,this.retryTimeout=1e3,this.throttleTimeout=3e4,this.storageKey="",this.scheduled=!1,this.queue=[]}return e.prototype.setup=function(e){var t;return f(this,void 0,void 0,(function(){var i,n=this;return h(this,(function(r){switch(r.label){case 0:return this.config=e,this.storageKey="".concat(w,"_").concat(this.config.apiKey.substring(0,10)),[4,null===(t=this.config.storageProvider)||void 0===t?void 0:t.get(this.storageKey)];case 1:return i=r.sent(),this.saveEvents(),i&&i.length>0&&Promise.all(i.map((function(e){return n.execute(e)}))).catch(),[2,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)},timeout: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?(t.attempts+=1,!0):(e.fulfillRequest([t],500,x),!1)}));n.forEach((function(t){e.queue=e.queue.concat(t),0!==t.timeout?setTimeout((function(){t.timeout=0,e.schedule(0)}),t.timeout):e.schedule(e.config.flushIntervalMillis)})),this.saveEvents()},e.prototype.schedule=function(e){var t=this;this.scheduled||(this.scheduled=!0,setTimeout((function(){t.flush(!0).then((function(){t.scheduled=!1,t.queue.length>0&&t.schedule(e)}))}),e))},e.prototype.flush=function(e){return void 0===e&&(e=!1),f(this,void 0,void 0,(function(){var t,i,n,r=this;return h(this,(function(o){switch(o.label){case 0:return t=[],i=[],this.queue.forEach((function(e){return 0===e.timeout?t.push(e):i.push(e)})),this.queue=i,s=t,u=this.config.flushQueueSize,a=Math.max(u,1),n=s.reduce((function(e,t,i){var n=Math.floor(i/a);return e[n]||(e[n]=[]),e[n].push(t),e}),[]),[4,Promise.all(n.map((function(t){return r.send(t,e)})))];case 1:return o.sent(),[2]}var s,u,a}))}))},e.prototype.send=function(e,t){return void 0===t&&(t=!0),f(this,void 0,void 0,(function(){var i,n,r,o;return h(this,(function(s){switch(s.label){case 0:if(!this.config.apiKey)return[2,this.fulfillRequest(e,400,"Event rejected due to missing API key")];i={api_key:this.config.apiKey,events:e.map((function(e){var t=e.event;return t.extra,p(t,["extra"])})),options:{min_id_length:this.config.minIdLength}},s.label=1;case 1:return s.trys.push([1,3,,4]),n=A(this.config.serverUrl,this.config.serverZone,this.config.useBatch).serverUrl,[4,this.config.transportProvider.send(n,i)];case 2:return null===(r=s.sent())?(this.fulfillRequest(e,0,"Unexpected error occurred"),[2]):t?(this.handleReponse(r,e),[3,4]):(this.fulfillRequest(e,r.statusCode,r.status),[2]);case 3:return o=s.sent(),this.fulfillRequest(e,0,String(o)),[3,4];case 4:return[2]}}))}))},e.prototype.handleReponse=function(e,t){switch(e.status){case c.Success:this.handleSuccessResponse(e,t);break;case c.Invalid:this.handleInvalidResponse(e,t);break;case c.PayloadTooLarge:this.handlePayloadTooLargeResponse(e,t);break;case c.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||e.body.error.startsWith("Invalid API key"))this.fulfillRequest(t,e.statusCode,e.body.error);else{var n=b(b(b(b([],g(Object.values(e.body.eventsWithInvalidFields)),!1),g(Object.values(e.body.eventsWithMissingFields)),!1),g(Object.values(e.body.eventsWithInvalidIdLengths)),!1),g(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,b([],g(o),!1))}},e.prototype.handlePayloadTooLargeResponse=function(e,t){1!==t.length?(this.config.flushQueueSize/=2,this.addToQueue.apply(this,b([],g(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),u=new Set(r),a=new Set(o),c=t.filter((function(t,n){if(!(t.event.user_id&&s.has(t.event.user_id)||t.event.device_id&&u.has(t.event.device_id)))return a.has(n)&&(t.timeout=i.throttleTimeout),!0;i.fulfillRequest([t],e.statusCode,e.body.error)}));this.addToQueue.apply(this,b([],g(c),!1))},e.prototype.handleOtherReponse=function(e){var t=this;this.addToQueue.apply(this,b([],g(e.map((function(e){return e.timeout=e.attempts*t.retryTimeout,e}))),!1))},e.prototype.fulfillRequest=function(e,t,i){this.saveEvents(),e.forEach((function(e){return e.callback(O(e.event,t,i))}))},e.prototype.saveEvents=function(){if(this.config.storageProvider){var e=Array.from(this.queue.map((function(e){return e.event})));this.config.storageProvider.set(this.storageKey,e)}},e}(),j=function(e){return function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];return{promise:e.apply(void 0,b([],g(t),!1))}}},L=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,L)},V=function(){function e(){this.memoryStorage=new Map}return e.prototype.isEnabled=function(){return f(this,void 0,void 0,(function(){return h(this,(function(e){return[2,!0]}))}))},e.prototype.get=function(e){return f(this,void 0,void 0,(function(){return h(this,(function(t){return[2,this.memoryStorage.get(e)]}))}))},e.prototype.getRaw=function(e){return f(this,void 0,void 0,(function(){var t;return h(this,(function(i){switch(i.label){case 0:return[4,this.get(e)];case 1:return[2,(t=i.sent())?JSON.stringify(t):void 0]}}))}))},e.prototype.set=function(e,t){return f(this,void 0,void 0,(function(){return h(this,(function(i){return this.memoryStorage.set(e,t),[2]}))}))},e.prototype.remove=function(e){return f(this,void 0,void 0,(function(){return h(this,(function(t){return this.memoryStorage.delete(e),[2]}))}))},e.prototype.reset=function(){return f(this,void 0,void 0,(function(){return h(this,(function(e){return this.memoryStorage.clear(),[2]}))}))},e}(),B=function(){function e(){}return e.prototype.send=function(e,t){return Promise.resolve(null)},e.prototype.buildResponse=function(e){var t,i,n,r,o,s,u,a,l,d,p,f,h,v,g,b,y,m,w,I,_,S;if("object"!=typeof e)return null;var E=e.code||0,k=this.buildStatus(E);switch(k){case c.Success:return{status:k,statusCode:E,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 c.Invalid:return{status:k,statusCode:E,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!==(u=e.events_with_missing_fields)&&void 0!==u?u:{},eventsWithInvalidIdLengths:null!==(a=e.events_with_invalid_id_lengths)&&void 0!==a?a:{},epsThreshold:null!==(l=e.eps_threshold)&&void 0!==l?l:0,exceededDailyQuotaDevices:null!==(d=e.exceeded_daily_quota_devices)&&void 0!==d?d:{},silencedDevices:null!==(p=e.silenced_devices)&&void 0!==p?p:[],silencedEvents:null!==(f=e.silenced_events)&&void 0!==f?f:[],throttledDevices:null!==(h=e.throttled_devices)&&void 0!==h?h:{},throttledEvents:null!==(v=e.throttled_events)&&void 0!==v?v:[]}};case c.PayloadTooLarge:return{status:k,statusCode:E,body:{error:null!==(g=e.error)&&void 0!==g?g:""}};case c.RateLimit:return{status:k,statusCode:E,body:{error:null!==(b=e.error)&&void 0!==b?b:"",epsThreshold:null!==(y=e.eps_threshold)&&void 0!==y?y:0,throttledDevices:null!==(m=e.throttled_devices)&&void 0!==m?m:{},throttledUsers:null!==(w=e.throttled_users)&&void 0!==w?w:{},exceededDailyQuotaDevices:null!==(I=e.exceeded_daily_quota_devices)&&void 0!==I?I:{},exceededDailyQuotaUsers:null!==(_=e.exceeded_daily_quota_users)&&void 0!==_?_:{},throttledEvents:null!==(S=e.throttled_events)&&void 0!==S?S:[]}};case c.Timeout:default:return{status:k,statusCode:E}}},e.prototype.buildStatus=function(e){return e>=200&&e<300?c.Success:429===e?c.RateLimit:413===e?c.PayloadTooLarge:408===e?c.Timeout:e>=400&&e<500?c.Invalid:e>=500?c.Failed:c.Unknown},e}(),z=function(){return"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof self?self:"undefined"!=typeof global?global:void 0},F=function(){var e,t=z();return(null===(e=null==t?void 0:t.location)||void 0===e?void 0:e.search)?t.location.search.substring(1).split("&").filter(Boolean).reduce((function(e,t){var i=t.split("=",2),n=Q(i[0]),r=Q(i[1]);return r?(e[n]=r,e):e}),{}):{}},Q=function(e){void 0===e&&(e="");try{return decodeURIComponent(e)}catch(e){return""}},$={utm_source:void 0,utm_medium:void 0,utm_campaign:void 0,utm_term:void 0,utm_content:void 0,referrer:void 0,referring_domain:void 0,dclid:void 0,gbraid:void 0,gclid:void 0,fbclid:void 0,ko_click_id:void 0,msclkid:void 0,ttclid:void 0,twclid:void 0,wbraid:void 0},W=function(){function e(){}return e.prototype.parse=function(){return f(this,void 0,void 0,(function(){return h(this,(function(e){return[2,d(d(d(d({},$),this.getUtmParam()),this.getReferrer()),this.getClickIds())]}))}))},e.prototype.getUtmParam=function(){var e=F();return{utm_source:e.utm_source,utm_medium:e.utm_medium,utm_campaign:e.utm_campaign,utm_term:e.utm_term,utm_content:e.utm_content}},e.prototype.getReferrer=function(){var e,t,i={referrer:void 0,referring_domain:void 0};try{i.referrer=document.referrer||void 0,i.referring_domain=null!==(t=null===(e=i.referrer)||void 0===e?void 0:e.split("/")[2])&&void 0!==t?t:void 0}catch(e){}return i},e.prototype.getClickIds=function(){var e,t=F();return(e={}).dclid=t.dclid,e.fbclid=t.fbclid,e.gbraid=t.gbraid,e.gclid=t.gclid,e.ko_click_id=t.ko_click_id,e.msclkid=t.msclkid,e.ttclid=t.ttclid,e.twclid=t.twclid,e.wbraid=t.wbraid,e},e}(),K=function(e,t,i){return void 0===t&&(t=""),void 0===i&&(i=10),[m,t,e.substring(0,i)].filter(Boolean).join("_")},Z=function(){function e(e,t){var i,n;this.storage=t.storage,this.storageKey=K(e,"MKTG"),this.parser=new W,this.track=t.track,this.onNewCampaign=t.onNewCampaign,this.disabled=Boolean(t.disabled),this.trackNewCampaigns=Boolean(t.trackNewCampaigns),this.trackPageViews=Boolean(t.trackPageViews),this.excludeReferrers=null!==(i=t.excludeReferrers)&&void 0!==i?i:[],"undefined"!=typeof location&&this.excludeReferrers.unshift(location.hostname),this.initialEmptyValue=null!==(n=t.initialEmptyValue)&&void 0!==n?n:"EMPTY"}return e.prototype.isNewCampaign=function(e,t){e.referrer;var i=p(e,["referrer"]),n=t||{};n.referrer;var r=p(n,["referrer"]),o=Boolean(i.referring_domain&&this.excludeReferrers.includes(i.referring_domain)),s=JSON.stringify(i)!==JSON.stringify(r);return!o&&(!t||s)},e.prototype.saveCampaignToStorage=function(e){return f(this,void 0,void 0,(function(){return h(this,(function(t){switch(t.label){case 0:return[4,this.storage.set(this.storageKey,e)];case 1:return t.sent(),[2]}}))}))},e.prototype.getCampaignFromStorage=function(){return f(this,void 0,void 0,(function(){return h(this,(function(e){switch(e.label){case 0:return[4,this.storage.get(this.storageKey)];case 1:return[2,e.sent()]}}))}))},e.prototype.createCampaignEvent=function(e){var t=this,i=d(d({},$),e),n=Object.entries(i).reduce((function(e,i){var n=g(i,2),r=n[0],o=n[1];return e.setOnce("initial_".concat(r),o||t.initialEmptyValue),o?e.set(r,o):e.unset(r)}),new E),r={event_type:"Page View",event_properties:{page_title:"undefined"!=typeof document&&document.title||"",page_location:"undefined"!=typeof location&&location.href||"",page_path:"undefined"!=typeof location&&location.pathname||""}};return d(d({},k(n)),this.trackPageViews&&r)},e.prototype.send=function(e){return f(this,void 0,void 0,(function(){var t,i;return h(this,(function(n){switch(n.label){case 0:return this.disabled?[2]:[4,this.parser.parse()];case 1:return t=n.sent(),[4,this.getCampaignFromStorage()];case 2:if(i=n.sent(),!e){if(!this.trackNewCampaigns||!this.isNewCampaign(t,i))return[2];this.onNewCampaign(t)}return[4,this.track(this.createCampaignEvent(t))];case 3:return n.sent(),[4,this.saveCampaignToStorage(t)];case 4:return n.sent(),[2]}}))}))},e}(),G=function(){function e(e){this.options=d({},e)}return e.prototype.isEnabled=function(){return f(this,void 0,void 0,(function(){var t,i,n;return h(this,(function(r){switch(r.label){case 0:if(!z())return[2,!1];t=String(Date.now()),i=new e(this.options),n="AMP_TEST",r.label=1;case 1:return r.trys.push([1,4,5,7]),[4,i.set(n,t)];case 2:return r.sent(),[4,i.get(n)];case 3:return[2,r.sent()===t];case 4:return r.sent(),[2,!1];case 5:return[4,i.remove(n)];case 6:return r.sent(),[7];case 7:return[2]}}))}))},e.prototype.get=function(e){return f(this,void 0,void 0,(function(){var t;return h(this,(function(i){switch(i.label){case 0:return[4,this.getRaw(e)];case 1:if(!(t=i.sent()))return[2,void 0];try{try{t=decodeURIComponent(atob(t))}catch(e){}return[2,JSON.parse(t)]}catch(e){return[2,void 0]}return[2]}}))}))},e.prototype.getRaw=function(e){var t;return f(this,void 0,void 0,(function(){var i,n,r;return h(this,(function(o){return i=z(),n=null!==(t=null==i?void 0:i.document.cookie.split("; "))&&void 0!==t?t:[],(r=n.find((function(t){return 0===t.indexOf(e+"=")})))?[2,r.substring(e.length+1)]:[2,void 0]}))}))},e.prototype.set=function(e,t){var i;return f(this,void 0,void 0,(function(){var n,r,o,s,u,a;return h(this,(function(c){try{n=null!==(i=this.options.expirationDays)&&void 0!==i?i:0,o=void 0,(r=null!==t?n:-1)&&((s=new Date).setTime(s.getTime()+24*r*60*60*1e3),o=s),u="".concat(e,"=").concat(btoa(encodeURIComponent(JSON.stringify(t)))),o&&(u+="; expires=".concat(o.toUTCString())),u+="; path=/",this.options.domain&&(u+="; domain=".concat(this.options.domain)),this.options.secure&&(u+="; Secure"),this.options.sameSite&&(u+="; SameSite=".concat(this.options.sameSite)),(a=z())&&(a.document.cookie=u)}catch(e){}return[2]}))}))},e.prototype.remove=function(e){return f(this,void 0,void 0,(function(){return h(this,(function(t){switch(t.label){case 0:return[4,this.set(e,null)];case 1:return t.sent(),[2]}}))}))},e.prototype.reset=function(){return f(this,void 0,void 0,(function(){return h(this,(function(e){return[2]}))}))},e}(),H=function(){function e(e,t){this.storage=e,this.isSessionCacheValid=!0,this.storageKey=K(t),this.cache={optOut:!1}}return e.prototype.load=function(){var e;return f(this,void 0,void 0,(function(){var t;return h(this,(function(i){switch(i.label){case 0:return t=this,[4,this.storage.get(this.storageKey)];case 1:return t.cache=null!==(e=i.sent())&&void 0!==e?e:{optOut:!1},[2,this]}}))}))},e.prototype.setSession=function(e){this.cache=d(d({},this.cache),e),this.storage.set(this.storageKey,this.cache)},e.prototype.getSessionId=function(){var e=this;return this.isSessionCacheValid=!0,this.storage.get(this.storageKey).then((function(t){e.isSessionCacheValid&&(e.cache.sessionId=null==t?void 0:t.sessionId)})),this.cache.sessionId},e.prototype.setSessionId=function(e){this.isSessionCacheValid=!1,this.setSession({sessionId:e})},e.prototype.getDeviceId=function(){return this.cache.deviceId},e.prototype.setDeviceId=function(e){this.setSession({deviceId:e})},e.prototype.getUserId=function(){return this.cache.userId},e.prototype.setUserId=function(e){this.setSession({userId:e})},e.prototype.getLastEventTime=function(){return this.cache.lastEventTime},e.prototype.setLastEventTime=function(e){this.setSession({lastEventTime:e})},e.prototype.getOptOut=function(){return this.cache.optOut},e.prototype.setOptOut=function(e){this.setSession({optOut:e})},e}(),J=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.send=function(e,t){return f(this,void 0,void 0,(function(){var i,n;return h(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,this.buildResponse(n)]}}))}))},t}(B),Y="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},X={exports:{}};!function(e,t){!function(i,n){var r="function",o="undefined",s="object",u="string",a="model",c="name",l="type",d="vendor",p="version",f="architecture",h="console",v="mobile",g="tablet",b="smarttv",y="wearable",m="embedded",w="Amazon",I="Apple",_="ASUS",S="BlackBerry",E="Firefox",k="Google",O="Huawei",T="LG",x="Microsoft",P="Motorola",R="Opera",N="Samsung",U="Sony",C="Xiaomi",q="Zebra",D="Facebook",A=function(e){for(var t={},i=0;i<e.length;i++)t[e[i].toUpperCase()]=e[i];return t},M=function(e,t){return typeof e===u&&-1!==j(t).indexOf(j(e))},j=function(e){return e.toLowerCase()},L=function(e,t){if(typeof e===u)return e=e.replace(/^\s\s*/,"").replace(/\s\s*$/,""),typeof t===o?e:e.substring(0,275)},V=function(e,t){for(var i,o,u,a,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(u=0;u<f.length;u++)l=c[++o],typeof(a=f[u])===s&&a.length>0?2===a.length?typeof a[1]==r?this[a[0]]=a[1].call(this,l):this[a[0]]=a[1]:3===a.length?typeof a[1]!==r||a[1].exec&&a[1].test?this[a[0]]=l?l.replace(a[1],a[2]):n:this[a[0]]=l?a[1].call(this,l,a[2]):n:4===a.length&&(this[a[0]]=l?a[3].call(this,l.replace(a[1],a[2])):n):this[a]=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(M(t[i][r],e))return"?"===i?n:i}else if(M(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,E]],[/\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,D],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,j]],[/((?: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/,"",j]],[/(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,j]]],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],[a,[d,N],[l,g]],[/\b((?:s[cgp]h|gt|sm)-\w+|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[a,[d,N],[l,v]],[/((ipod|iphone)\d+,\d+)/i],[a,[d,I],[l,v]],[/(ipad\d+,\d+)/i],[a,[d,I],[l,g]],[/\((ip(?:hone|od)[\w ]*);/i],[a,[d,I],[l,v]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[a,[d,I],[l,g]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[a,[d,O],[l,g]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[a,[d,O],[l,v]],[/\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|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[a,/_/g," "],[d,C],[l,v]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[a,/_/g," "],[d,C],[l,g]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[a,[d,"OPPO"],[l,v]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[a,[d,"Vivo"],[l,v]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[a,[d,"Realme"],[l,v]],[/\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],[a,[d,P],[l,v]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[a,[d,P],[l,g]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[a,[d,T],[l,g]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[a,[d,T],[l,v]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[a,[d,"Lenovo"],[l,g]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[a,/_/g," "],[d,"Nokia"],[l,v]],[/(pixel c)\b/i],[a,[d,k],[l,g]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[a,[d,k],[l,v]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[a,[d,U],[l,v]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[a,"Xperia Tablet"],[d,U],[l,g]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[a,[d,"OnePlus"],[l,v]],[/(alexa)webm/i,/(kf[a-z]{2}wi)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[a,[d,w],[l,g]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[a,/(.+)/g,"Fire Phone $1"],[d,w],[l,v]],[/(playbook);[-\w\),; ]+(rim)/i],[a,d,[l,g]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[a,[d,S],[l,v]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[a,[d,_],[l,g]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[a,[d,_],[l,v]],[/(nexus 9)/i],[a,[d,"HTC"],[l,g]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic|sony(?!-bra))[-_ ]?([-\w]*)/i],[d,[a,/_/g," "],[l,v]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[a,[d,"Acer"],[l,g]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[a,[d,"Meizu"],[l,v]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[a,[d,"Sharp"],[l,v]],[/(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,a,[l,v]],[/(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,a,[l,g]],[/(surface duo)/i],[a,[d,x],[l,g]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[a,[d,"Fairphone"],[l,v]],[/(u304aa)/i],[a,[d,"AT&T"],[l,v]],[/\bsie-(\w*)/i],[a,[d,"Siemens"],[l,v]],[/\b(rct\w+) b/i],[a,[d,"RCA"],[l,g]],[/\b(venue[\d ]{2,7}) b/i],[a,[d,"Dell"],[l,g]],[/\b(q(?:mv|ta)\w+) b/i],[a,[d,"Verizon"],[l,g]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[a,[d,"Barnes & Noble"],[l,g]],[/\b(tm\d{3}\w+) b/i],[a,[d,"NuVision"],[l,g]],[/\b(k88) b/i],[a,[d,"ZTE"],[l,g]],[/\b(nx\d{3}j) b/i],[a,[d,"ZTE"],[l,v]],[/\b(gen\d{3}) b.+49h/i],[a,[d,"Swiss"],[l,v]],[/\b(zur\d{3}) b/i],[a,[d,"Swiss"],[l,g]],[/\b((zeki)?tb.*\b) b/i],[a,[d,"Zeki"],[l,g]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[d,"Dragon Touch"],a,[l,g]],[/\b(ns-?\w{0,9}) b/i],[a,[d,"Insignia"],[l,g]],[/\b((nxa|next)-?\w{0,9}) b/i],[a,[d,"NextBook"],[l,g]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[d,"Voice"],a,[l,v]],[/\b(lvtel\-)?(v1[12]) b/i],[[d,"LvTel"],a,[l,v]],[/\b(ph-1) /i],[a,[d,"Essential"],[l,v]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[a,[d,"Envizen"],[l,g]],[/\b(trio[-\w\. ]+) b/i],[a,[d,"MachSpeed"],[l,g]],[/\btu_(1491) b/i],[a,[d,"Rotor"],[l,g]],[/(shield[\w ]+) b/i],[a,[d,"Nvidia"],[l,g]],[/(sprint) (\w+)/i],[d,a,[l,v]],[/(kin\.[onetw]{3})/i],[[a,/\./g," "],[d,x],[l,v]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[a,[d,q],[l,g]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[a,[d,q],[l,v]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[d,a,[l,h]],[/droid.+; (shield) bui/i],[a,[d,"Nvidia"],[l,h]],[/(playstation [345portablevi]+)/i],[a,[d,U],[l,h]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[a,[d,x],[l,h]],[/smart-tv.+(samsung)/i],[d,[l,b]],[/hbbtv.+maple;(\d+)/i],[[a,/^/,"SmartTV"],[d,N],[l,b]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[d,T],[l,b]],[/(apple) ?tv/i],[d,[a,"Apple TV"],[l,b]],[/crkey/i],[[a,"Chromecast"],[d,k],[l,b]],[/droid.+aft(\w)( bui|\))/i],[a,[d,w],[l,b]],[/\(dtv[\);].+(aquos)/i],[a,[d,"Sharp"],[l,b]],[/(bravia[\w- ]+) bui/i],[a,[d,U],[l,b]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w ]*; *(\w[^;]*);([^;]*)/i],[[d,L],[a,L],[l,b]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[l,b]],[/((pebble))app/i],[d,a,[l,y]],[/droid.+; (glass) \d/i],[a,[d,k],[l,y]],[/droid.+; (wt63?0{2,3})\)/i],[a,[d,q],[l,y]],[/(quest( 2)?)/i],[a,[d,D],[l,y]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[d,[l,m]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[a,[l,v]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[a,[l,g]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[l,g]],[/(phone|mobile(?:[;\/]| safari)|pda(?=.+windows ce))/i],[[l,v]],[/(android[-\w\. ]{0,9});.+buil/i],[a,[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,S]],[/(?: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]]},Q=function(e,t){if(typeof e===s&&(t=e,e=n),!(this instanceof Q))return new Q(e,t).getResult();var r=e||(typeof i!==o&&i.navigator&&i.navigator.userAgent?i.navigator.userAgent:""),a=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,V.call(t,r,a.browser),t.major=typeof(e=t.version)===u?e.replace(/[^\d\.]/g,"").split(".")[0]:n,t},this.getCPU=function(){var e={};return e.architecture=n,V.call(e,r,a.cpu),e},this.getDevice=function(){var e={};return e.vendor=n,e.model=n,e.type=n,V.call(e,r,a.device),e},this.getEngine=function(){var e={};return e.name=n,e.version=n,V.call(e,r,a.engine),e},this.getOS=function(){var e={};return e.name=n,e.version=n,V.call(e,r,a.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===u&&e.length>275?L(e,275):e,this},this.setUA(r),this};Q.VERSION="0.7.31",Q.BROWSER=A([c,p,"major"]),Q.CPU=A([f]),Q.DEVICE=A([a,d,l,h,v,b,g,y,m]),Q.ENGINE=Q.OS=A([c,p]),e.exports&&(t=e.exports=Q),t.UAParser=Q;var $=typeof i!==o&&(i.jQuery||i.Zepto);if($&&!$.ua){var W=new Q;$.ua=W.getResult(),$.ua.get=function(){return W.getUA()},$.ua.set=function(e){W.setUA(e);var t=W.getResult();for(var i in t)$.ua[i]=t[i]}}}("object"==typeof window?window:Y)}(X,X.exports);var ee=X.exports,te=function(){function e(){this.ua=new X.exports.UAParser("undefined"!=typeof navigator?navigator.userAgent:null).getResult()}return e.prototype.getApplicationContext=function(){return{versionName:this.versionName,language:re(),platform:"Web",os:ie(this.ua),deviceModel:ne(this.ua)}},e}(),ie=function(e){var t,i;return[null===(t=e.browser)||void 0===t?void 0:t.name,null===(i=e.browser)||void 0===i?void 0:i.major].filter((function(e){return null!=e})).join(" ")},ne=function(e){var t;return null===(t=e.os)||void 0===t?void 0:t.name},re=function(){return"undefined"!=typeof navigator&&(navigator.languages&&navigator.languages[0]||navigator.language)||""},oe=function(){function e(){this.queue=[]}return e.prototype.logEvent=function(e){this.receiver?this.receiver(e):this.queue.length<512&&this.queue.push(e)},e.prototype.setEventReceiver=function(e){this.receiver=e,this.queue.length>0&&(this.queue.forEach((function(t){e(t)})),this.queue=[])},e}(),se=function(){return se=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},se.apply(this,arguments)};Object.entries||(Object.entries=function(e){for(var t=Object.keys(e),i=t.length,n=new Array(i);i--;)n[i]=[t[i],e[t[i]]];return n});var ue=function(){function e(){this.identity={userProperties:{}},this.listeners=new Set}return e.prototype.editIdentity=function(){var e=this,t=se({},this.identity.userProperties),i=se(se({},this.identity),{userProperties:t});return{setUserId:function(e){return i.userId=e,this},setDeviceId:function(e){return i.deviceId=e,this},setUserProperties:function(e){return i.userProperties=e,this},updateUserProperties:function(e){for(var t=i.userProperties||{},n=0,r=Object.entries(e);n<r.length;n++){var o=r[n],s=o[0],u=o[1];switch(s){case"$set":for(var a=0,c=Object.entries(u);a<c.length;a++){var l=c[a],d=l[0],p=l[1];t[d]=p}break;case"$unset":for(var f=0,h=Object.keys(u);f<h.length;f++){delete t[d=h[f]]}break;case"$clearAll":t={}}}return i.userProperties=t,this},commit:function(){return e.setIdentity(i),this}}},e.prototype.getIdentity=function(){return se({},this.identity)},e.prototype.setIdentity=function(e){var t=se({},this.identity);this.identity=se({},e),ae(t,this.identity)||this.listeners.forEach((function(t){t(e)}))},e.prototype.addIdentityListener=function(e){this.listeners.add(e)},e.prototype.removeIdentityListener=function(e){this.listeners.delete(e)},e}(),ae=function(e,t){var i=typeof e;if(i!==typeof t)return!1;for(var n=0,r=["string","number","boolean","undefined"];n<r.length;n++){if(r[n]===i)return e===t}if(e.length!==t.length)return!1;var o=Array.isArray(e),s=Array.isArray(t);if(o!==s)return!1;if(!o||!s){var u=Object.keys(e).sort(),a=Object.keys(t).sort();if(!ae(u,a))return!1;var c=!0;return Object.keys(e).forEach((function(i){ae(e[i],t[i])||(c=!1)})),c}for(var l=0;l<e.length;l++)if(!ae(e[l],t[l]))return!1;return!0},ce="undefined"!=typeof globalThis?globalThis:global||self,le=function(){function e(){this.identityStore=new ue,this.eventBridge=new oe,this.applicationContextProvider=new te}return e.getInstance=function(t){return ce.analyticsConnectorInstances||(ce.analyticsConnectorInstances={}),ce.analyticsConnectorInstances[t]||(ce.analyticsConnectorInstances[t]=new e),ce.analyticsConnectorInstances[t]},e}(),de=function(){return le.getInstance("$default_instance")},pe=function(){function e(){this.name="identity",this.type=a.BEFORE,this.identityStore=de().identityStore}return e.prototype.execute=function(e){return f(this,void 0,void 0,(function(){var t;return h(this,(function(i){return(t=e.user_properties)&&this.identityStore.editIdentity().updateUserProperties(t).commit(),[2,e]}))}))},e.prototype.setup=function(e){return Promise.resolve(void 0)},e}(),fe=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:""},he=function(e,t){for(var i=0;i<t.length;i++){var n=t[i],r=n.name,o=n.args,s=n.resolve,u=e&&e[r];if("function"==typeof u){var a=u.apply(e,o);"function"==typeof s&&s(null==a?void 0:a.promise)}}return e},ve=function(e){return e&&void 0!==e._q},ge=function(){function e(){var e;this.name="context",this.type=a.BEFORE,this.eventId=0,this.library="amplitude-ts/".concat("1.5.8"),"undefined"!=typeof navigator&&(e=navigator.userAgent),this.uaResult=new ee(e).getResult()}return e.prototype.setup=function(e){return this.config=e,Promise.resolve(void 0)},e.prototype.execute=function(e){return f(this,void 0,void 0,(function(){var t,i,n,r,o;return h(this,(function(s){return this.isSessionValid()||(this.config.sessionId=Date.now()),this.config.lastEventTime=Date.now(),t=(new Date).getTime(),i=this.uaResult.browser.name,n=this.uaResult.browser.version,r=this.uaResult.device.model||this.uaResult.os.name,o=this.uaResult.device.vendor,[2,d(d(d(d(d(d(d(d(d(d(d(d({user_id:this.config.userId,device_id:this.config.deviceId,session_id:this.config.sessionId,time:t},this.config.appVersion&&{app_version:this.config.appVersion}),this.config.trackingOptions.platform&&{platform:"Web"}),this.config.trackingOptions.osName&&{os_name:i}),this.config.trackingOptions.osVersion&&{os_version:n}),this.config.trackingOptions.deviceManufacturer&&{device_manufacturer:o}),this.config.trackingOptions.deviceModel&&{device_model:r}),this.config.trackingOptions.language&&{language:fe()}),this.config.trackingOptions.ipAddress&&{ip:"$remote"}),{insert_id:L(),partner_id:this.config.partnerId,plan:this.config.plan}),this.config.ingestionMetadata&&{ingestion_metadata:{source_name:this.config.ingestionMetadata.sourceName,source_version:this.config.ingestionMetadata.sourceVersion}}),e),{event_id:this.eventId++,library:this.library})]}))}))},e.prototype.isSessionValid=function(){var e=this.config.lastEventTime||Date.now();return Date.now()-e<this.config.sessionTimeout},e}(),be=function(){function e(){}return e.prototype.isEnabled=function(){return f(this,void 0,void 0,(function(){var t,i,n;return h(this,(function(r){switch(r.label){case 0:if(!z())return[2,!1];t=String(Date.now()),i=new e,n="AMP_TEST",r.label=1;case 1:return r.trys.push([1,4,5,7]),[4,i.set(n,t)];case 2:return r.sent(),[4,i.get(n)];case 3:return[2,r.sent()===t];case 4:return r.sent(),[2,!1];case 5:return[4,i.remove(n)];case 6:return r.sent(),[7];case 7:return[2]}}))}))},e.prototype.get=function(e){return f(this,void 0,void 0,(function(){var t;return h(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,this.getRaw(e)];case 1:return(t=i.sent())?[2,JSON.parse(t)]:[2,void 0];case 2:return i.sent(),[2,void 0];case 3:return[2]}}))}))},e.prototype.getRaw=function(e){var t;return f(this,void 0,void 0,(function(){return h(this,(function(i){return[2,(null===(t=z())||void 0===t?void 0:t.localStorage.getItem(e))||void 0]}))}))},e.prototype.set=function(e,t){var i;return f(this,void 0,void 0,(function(){return h(this,(function(n){try{null===(i=z())||void 0===i||i.localStorage.setItem(e,JSON.stringify(t))}catch(e){}return[2]}))}))},e.prototype.remove=function(e){var t;return f(this,void 0,void 0,(function(){return h(this,(function(i){try{null===(t=z())||void 0===t||t.localStorage.removeItem(e)}catch(e){}return[2]}))}))},e.prototype.reset=function(){var e;return f(this,void 0,void 0,(function(){return h(this,(function(t){try{null===(e=z())||void 0===e||e.localStorage.clear()}catch(e){}return[2]}))}))},e}(),ye=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={done:4},t}return i(t,e),t.prototype.send=function(e,t){return f(this,void 0,void 0,(function(){var i=this;return h(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=i.buildResponse(t);n(s)}catch(e){r(e)}},o.setRequestHeader("Content-Type","application/json"),o.setRequestHeader("Accept","*/*"),o.send(JSON.stringify(t))}))]}))}))},t}(B),me=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.send=function(e,t){return f(this,void 0,void 0,(function(){var i=this;return h(this,(function(n){return[2,new Promise((function(n,r){var o=z();if(!(null==o?void 0:o.navigator.sendBeacon))throw new Error("SendBeaconTransport is not supported");try{var s=JSON.stringify(t);return n(o.navigator.sendBeacon(e,JSON.stringify(t))?i.buildResponse({code:200,events_ingested:t.events.length,payload_size_bytes:s.length,server_upload_time:Date.now()}):i.buildResponse({code:500}))}catch(e){r(e)}}))]}))}))},t}(B),we=function(){var e=new V;return{cookieExpiration:365,cookieSameSite:"Lax",cookieSecure:!1,cookieStorage:e,disableCookies:!1,domain:"",sessionManager:new H(e,""),sessionTimeout:18e5,storageProvider:new V,trackingOptions:{deviceManufacturer:!0,deviceModel:!0,ipAddress:!0,language:!0,osName:!0,osVersion:!0,platform:!0},transportProvider:new J}},Ie=function(e){function t(t,i,n){var r,o,s,u,a,c,l,p,f,h,v,g,b=this,y=we();return(b=e.call(this,d(d({flushIntervalMillis:1e3,flushMaxRetries:5,flushQueueSize:30},n),{apiKey:t,storageProvider:null!==(r=null==n?void 0:n.storageProvider)&&void 0!==r?r:y.storageProvider,transportProvider:null!==(o=null==n?void 0:n.transportProvider)&&void 0!==o?o:y.transportProvider}))||this).cookieStorage=null!==(s=null==n?void 0:n.cookieStorage)&&void 0!==s?s:y.cookieStorage,b.sessionManager=null!==(u=null==n?void 0:n.sessionManager)&&void 0!==u?u:y.sessionManager,b.sessionTimeout=null!==(a=null==n?void 0:n.sessionTimeout)&&void 0!==a?a:y.sessionTimeout,b.appVersion=null==n?void 0:n.appVersion,b.attribution=null==n?void 0:n.attribution,b.cookieExpiration=null!==(c=null==n?void 0:n.cookieExpiration)&&void 0!==c?c:y.cookieExpiration,b.cookieSameSite=null!==(l=null==n?void 0:n.cookieSameSite)&&void 0!==l?l:y.cookieSameSite,b.cookieSecure=null!==(p=null==n?void 0:n.cookieSecure)&&void 0!==p?p:y.cookieSecure,b.deviceId=null==n?void 0:n.deviceId,b.disableCookies=null!==(f=null==n?void 0:n.disableCookies)&&void 0!==f?f:y.disableCookies,b.domain=null!==(h=null==n?void 0:n.domain)&&void 0!==h?h:y.domain,b.lastEventTime=null!==(v=b.lastEventTime)&&void 0!==v?v:null==n?void 0:n.lastEventTime,b.optOut=Boolean(null==n?void 0:n.optOut),b.partnerId=null==n?void 0:n.partnerId,b.sessionId=null==n?void 0:n.sessionId,b.trackingOptions=null!==(g=null==n?void 0:n.trackingOptions)&&void 0!==g?g:y.trackingOptions,b.userId=i,b}return i(t,e),Object.defineProperty(t.prototype,"deviceId",{get:function(){return this.sessionManager.getDeviceId()},set:function(e){this.sessionManager.setDeviceId(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"userId",{get:function(){return this.sessionManager.getUserId()},set:function(e){this.sessionManager.setUserId(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sessionId",{get:function(){return this.sessionManager.getSessionId()},set:function(e){this.sessionManager.setSessionId(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"optOut",{get:function(){return this.sessionManager.getOptOut()},set:function(e){var t;null===(t=this.sessionManager)||void 0===t||t.setOptOut(Boolean(e))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lastEventTime",{get:function(){return this.sessionManager.getLastEventTime()},set:function(e){this.sessionManager.setLastEventTime(e)},enumerable:!1,configurable:!0}),t}(q),_e=function(e,t,i){return f(void 0,void 0,void 0,(function(){var n,r,o,s,u,a,c,l,p,f,v,g,b,y,m,w,I;return h(this,(function(h){switch(h.label){case 0:return n=we(),null===(b=null==i?void 0:i.domain)||void 0===b?[3,1]:(o=b,[3,3]);case 1:return[4,xe()];case 2:o=h.sent(),h.label=3;case 3:return r=o,[4,Se(d(d({},i),{domain:r}))];case 4:return s=h.sent(),u=K(e),[4,s.get(u)];case 5:return a=h.sent(),c=F(),[4,new H(s,e).load()];case 6:return l=h.sent(),p=Ie.bind,f=[void 0,e,null!=t?t:null==a?void 0:a.userId],v=[d({},i)],g={cookieStorage:s,sessionManager:l,deviceId:Oe(null==a?void 0:a.deviceId,null==i?void 0:i.deviceId,c.deviceId),domain:r,optOut:null!==(y=null==i?void 0:i.optOut)&&void 0!==y?y:Boolean(null==a?void 0:a.optOut)},[4,s.get(u)];case 7:return g.sessionId=null!==(w=null===(m=h.sent())||void 0===m?void 0:m.sessionId)&&void 0!==w?w:null==i?void 0:i.sessionId,[4,ke(i)];case 8:return[2,new(p.apply(Ie,f.concat([d.apply(void 0,v.concat([(g.storageProvider=h.sent(),g.trackingOptions=d(d({},n.trackingOptions),null==i?void 0:i.trackingOptions),g.transportProvider=null!==(I=null==i?void 0:i.transportProvider)&&void 0!==I?I:Te(null==i?void 0:i.transport),g)]))])))]}}))}))},Se=function(e,t){return void 0===t&&(t=we()),f(void 0,void 0,void 0,(function(){var i,n,r;return h(this,(function(o){switch(o.label){case 0:return i=d(d({},t),e),n=null==e?void 0:e.cookieStorage,(r=!n)?[3,2]:[4,n.isEnabled()];case 1:r=!o.sent(),o.label=2;case 2:return r?[2,Ee(i)]:[2,n]}}))}))},Ee=function(e){return f(void 0,void 0,void 0,(function(){var t,i;return h(this,(function(n){switch(n.label){case 0:return t=new G({domain:e.domain,expirationDays:e.cookieExpiration,sameSite:e.cookieSameSite,secure:e.cookieSecure}),(i=e.disableCookies)?[3,2]:[4,t.isEnabled()];case 1:i=!n.sent(),n.label=2;case 2:return i?[4,(t=new be).isEnabled()]:[3,4];case 3:n.sent()||(t=new V),n.label=4;case 4:return[2,t]}}))}))},ke=function(e){return f(void 0,void 0,void 0,(function(){var t,i,n,r,o,s,u;return h(this,(function(a){switch(a.label){case 0:if(e&&Object.prototype.hasOwnProperty.call(e,"storageProvider")&&!e.storageProvider)return[3,9];a.label=1;case 1:a.trys.push([1,7,8,9]),t=v([null==e?void 0:e.storageProvider,new be]),i=t.next(),a.label=2;case 2:return i.done?[3,6]:(n=i.value,(r=n)?[4,n.isEnabled()]:[3,4]);case 3:r=a.sent(),a.label=4;case 4:if(r)return[2,n];a.label=5;case 5:return i=t.next(),[3,2];case 6:return[3,9];case 7:return o=a.sent(),s={error:o},[3,9];case 8:try{i&&!i.done&&(u=t.return)&&u.call(t)}finally{if(s)throw s.error}return[7];case 9:return[2,void 0]}}))}))},Oe=function(e,t,i){return t||i||e||L()},Te=function(e){return e===l.XHR?new ye:e===l.SendBeacon?new me:we().transportProvider},xe=function(e){return f(void 0,void 0,void 0,(function(){var t,i,n,r,o,s,u;return h(this,(function(a){switch(a.label){case 0:return[4,(new G).isEnabled()];case 1:if(!a.sent()||!e&&"undefined"==typeof location)return[2,""];for(t=null!=e?e:location.hostname,i=t.split("."),n=[],r="AMP_TLDTEST",o=i.length-2;o>=0;--o)n.push(i.slice(o).join("."));o=0,a.label=2;case 2:return o<n.length?(s=n[o],[4,(u=new G({domain:"."+s})).set(r,1)]):[3,7];case 3:return a.sent(),[4,u.get(r)];case 4:return a.sent()?[4,u.remove(r)]:[3,6];case 5:return a.sent(),[2,"."+s];case 6:return o++,[3,2];case 7:return[2,""]}}))}))},Pe=function(e,t){return f(void 0,void 0,void 0,(function(){var i,n,r,o,s,u,a,c,l;return h(this,(function(d){switch(d.label){case 0:return[4,(i=new G).isEnabled()];case 1:return d.sent()&&!(null==t?void 0:t.disableCookies)||(i=new be),[4,i.isEnabled()];case 2:return d.sent()?(n=function(e){return"".concat(m.toLowerCase(),"_").concat(e.substring(0,6))}(e),[4,i.getRaw(n)]):[2,{optOut:!1}];case 3:return(r=d.sent())?[4,i.remove(n)]:[2,{optOut:!1}];case 4:return d.sent(),o=g(r.split("."),5),s=o[0],u=o[1],a=o[2],c=o[3],l=o[4],[2,{deviceId:s,userId:Ne(u),sessionId:Re(c),lastEventTime:Re(l),optOut:Boolean(a)}]}}))}))},Re=function(e){var t=parseInt(e,32);if(!isNaN(t))return t},Ne=function(e){if(atob&&escape&&e)try{return decodeURIComponent(escape(atob(e)))}catch(e){return}},Ue=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.init=function(t,i,n){var r,o,s;return void 0===t&&(t=""),f(this,void 0,void 0,(function(){var u,a,c,l,p=this;return h(this,(function(f){switch(f.label){case 0:return this.initializing?[2]:(this.initializing=!0,[4,Pe(t,n)]);case 1:return u=f.sent(),[4,_e(t,i||u.userId,d(d({},n),{deviceId:null!==(r=u.deviceId)&&void 0!==r?r:null==n?void 0:n.deviceId,sessionId:null!==(o=u.sessionId)&&void 0!==o?o:null==n?void 0:n.sessionId,optOut:null!==(s=null==n?void 0:n.optOut)&&void 0!==s?s:u.optOut,lastEventTime:u.lastEventTime}))];case 2:return a=f.sent(),[4,e.prototype._init.call(this,a)];case 3:return f.sent(),c=!this.config.lastEventTime,(!this.config.sessionId||this.config.lastEventTime&&Date.now()-this.config.lastEventTime>this.config.sessionTimeout)&&(this.setSessionId(Date.now()),c=!0),(l=de()).eventBridge.setEventReceiver((function(e){p.track(e.eventType,e.eventProperties)})),l.identityStore.setIdentity({userId:this.config.userId,deviceId:this.config.deviceId}),[4,this.add(new ge)];case 4:return f.sent(),[4,this.add(new pe)];case 5:return f.sent(),[4,this.add(new M)];case 6:return f.sent(),this.initializing=!1,[4,this.runAttributionStrategy(a.attribution,c)];case 7:return f.sent(),[4,this.runQueuedFunctions("dispatchQ")];case 8:return f.sent(),[2]}}))}))},t.prototype.runAttributionStrategy=function(e,t){return void 0===t&&(t=!1),f(this,void 0,void 0,(function(){var i,n,r;return h(this,(function(o){switch(o.label){case 0:return i=this.track.bind(this),n=this.setSessionId.bind(this,Date.now()),[4,Ee(this.config)];case 1:return r=o.sent(),[4,new Z(this.config.apiKey,d(d({},e),{storage:r,track:i,onNewCampaign:n})).send(t)];case 2:return o.sent(),[2]}}))}))},t.prototype.getUserId=function(){var e;return null===(e=this.config)||void 0===e?void 0:e.userId},t.prototype.setUserId=function(e){this.config?this.config.userId=e:this.q.push(this.setUserId.bind(this,e))},t.prototype.getDeviceId=function(){var e;return null===(e=this.config)||void 0===e?void 0:e.deviceId},t.prototype.setDeviceId=function(e){this.config?this.config.deviceId=e:this.q.push(this.setDeviceId.bind(this,e))},t.prototype.reset=function(){this.setUserId(void 0),this.setDeviceId(L())},t.prototype.getSessionId=function(){var e;return null===(e=this.config)||void 0===e?void 0:e.sessionId},t.prototype.setSessionId=function(e){this.config?(this.config.sessionId=e,this.config.lastEventTime=void 0):this.q.push(this.setSessionId.bind(this,e))},t.prototype.setTransport=function(e){this.config?this.config.transportProvider=Te(e):this.q.push(this.setTransport.bind(this,e))},t.prototype.identify=function(t,i){if(ve(t)){var n=t._q;t._q=[],t=he(new E,n)}return(null==i?void 0:i.user_id)&&this.setUserId(i.user_id),(null==i?void 0:i.device_id)&&this.setDeviceId(i.device_id),e.prototype.identify.call(this,t,i)},t.prototype.groupIdentify=function(t,i,n,r){if(ve(n)){var o=n._q;n._q=[],n=he(new E,o)}return e.prototype.groupIdentify.call(this,t,i,n,r)},t.prototype.revenue=function(t,i){if(ve(t)){var n=t._q;t._q=[],t=he(new R,n)}return e.prototype.revenue.call(this,t,i)},t}(P),Ce=function(){var e=new Ue;return{init:j(e.init.bind(e)),add:j(e.add.bind(e)),remove:j(e.remove.bind(e)),track:j(e.track.bind(e)),logEvent:j(e.logEvent.bind(e)),identify:j(e.identify.bind(e)),groupIdentify:j(e.groupIdentify.bind(e)),setGroup:j(e.setGroup.bind(e)),revenue:j(e.revenue.bind(e)),flush:j(e.flush.bind(e)),getUserId:e.getUserId.bind(e),setUserId:e.setUserId.bind(e),getDeviceId:e.getDeviceId.bind(e),setDeviceId:e.setDeviceId.bind(e),reset:e.reset.bind(e),getSessionId:e.getSessionId.bind(e),setSessionId:e.setSessionId.bind(e),setOptOut:e.setOptOut.bind(e),setTransport:e.setTransport.bind(e)}},qe=Ce(),De=qe.add,Ae=qe.flush,Me=qe.getDeviceId,je=qe.getSessionId,Le=qe.getUserId,Ve=qe.groupIdentify,Be=qe.identify,ze=qe.init,Fe=qe.logEvent,Qe=qe.remove,$e=qe.reset,We=qe.revenue,Ke=qe.setDeviceId,Ze=qe.setGroup,Ge=qe.setOptOut,He=qe.setSessionId,Je=qe.setTransport,Ye=qe.setUserId,Xe=qe.track;e.Identify=E,e.Revenue=R,e.Types=y,e.add=De,e.createInstance=Ce,e.flush=Ae,e.getDeviceId=Me,e.getSessionId=je,e.getUserId=Le,e.groupIdentify=Ve,e.identify=Be,e.init=ze,e.logEvent=Fe,e.remove=Qe,e.reset=$e,e.revenue=We,e.runQueuedFunctions=function(e,t){he(e,t)},e.setDeviceId=Ke,e.setGroup=Ze,e.setOptOut=Ge,e.setSessionId=He,e.setTransport=Je,e.setUserId=Ye,e.track=Xe,Object.defineProperty(e,"__esModule",{value:!0})}));
15
+ ***************************************************************************** */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,r,o,s,u,a,c,l,d=function(){return d=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},d.apply(this,arguments)};function p(e,t){var i={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(i[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(e);r<n.length;r++)t.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(e,n[r])&&(i[n[r]]=e[n[r]])}return i}function f(e,t,i,n){return new(i||(i=Promise))((function(r,o){function s(e){try{a(n.next(e))}catch(e){o(e)}}function u(e){try{a(n.throw(e))}catch(e){o(e)}}function a(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(s,u)}a((n=n.apply(e,t||[])).next())}))}function h(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:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(o){return function(u){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,u])}}}function v(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 g(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 b(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))}!function(e){e.US="US",e.EU="EU"}(n||(n={})),function(e){e.SET="$set",e.SET_ONCE="$setOnce",e.ADD="$add",e.APPEND="$append",e.PREPEND="$prepend",e.REMOVE="$remove",e.PREINSERT="$preInsert",e.POSTINSERT="$postInsert",e.UNSET="$unset",e.CLEAR_ALL="$clearAll"}(r||(r={})),function(e){e.REVENUE_PRODUCT_ID="$productId",e.REVENUE_QUANTITY="$quantity",e.REVENUE_PRICE="$price",e.REVENUE_TYPE="$revenueType",e.REVENUE="$revenue"}(o||(o={})),function(e){e.IDENTIFY="$identify",e.GROUP_IDENTIFY="$groupidentify",e.REVENUE="revenue_amount"}(s||(s={})),function(e){e[e.None=0]="None",e[e.Error=1]="Error",e[e.Warn=2]="Warn",e[e.Verbose=3]="Verbose",e[e.Debug=4]="Debug"}(u||(u={})),function(e){e.BEFORE="before",e.ENRICHMENT="enrichment",e.DESTINATION="destination"}(a||(a={})),function(e){e.Unknown="unknown",e.Skipped="skipped",e.Success="success",e.RateLimit="rate_limit",e.PayloadTooLarge="payload_too_large",e.Invalid="invalid",e.Failed="failed",e.Timeout="Timeout",e.SystemError="SystemError"}(c||(c={})),function(e){e.XHR="xhr",e.SendBeacon="beacon",e.Fetch="fetch"}(l||(l={}));var y=Object.freeze({__proto__:null,get ServerZone(){return n},get SpecialEventType(){return s},get IdentifyOperation(){return r},get RevenueProperty(){return o},get LogLevel(){return u},get PluginType(){return a},get Status(){return c},get TransportType(){return l}}),m="AMP",w="".concat(m,"_unsent"),I="https://api2.amplitude.com/2/httpapi",_=function(e){if(Object.keys(e).length>1e3)return!1;for(var t in e){var i=e[t];if(!S(t,i))return!1}return!0},S=function(e,t){var i,n;if("string"!=typeof e)return!1;if(Array.isArray(t)){var r=!0;try{for(var o=v(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&&_(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(null==t)return!1;if("object"==typeof t)return _(t);if(!["number","string","boolean"].includes(typeof t))return!1}return!0},E=function(){function e(){this._propertySet=new Set,this._properties={}}return e.prototype.getUserProperties=function(){return d({},this._properties)},e.prototype.set=function(e,t){return this._safeSet(r.SET,e,t),this},e.prototype.setOnce=function(e,t){return this._safeSet(r.SET_ONCE,e,t),this},e.prototype.append=function(e,t){return this._safeSet(r.APPEND,e,t),this},e.prototype.prepend=function(e,t){return this._safeSet(r.PREPEND,e,t),this},e.prototype.postInsert=function(e,t){return this._safeSet(r.POSTINSERT,e,t),this},e.prototype.preInsert=function(e,t){return this._safeSet(r.PREINSERT,e,t),this},e.prototype.remove=function(e,t){return this._safeSet(r.REMOVE,e,t),this},e.prototype.add=function(e,t){return this._safeSet(r.ADD,e,t),this},e.prototype.unset=function(e){return this._safeSet(r.UNSET,e,"-"),this},e.prototype.clearAll=function(){return this._properties={},this._properties[r.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[r.CLEAR_ALL]&&(!this._propertySet.has(t)&&(e===r.ADD?"number"==typeof i:e===r.UNSET||e===r.REMOVE||S(t,i)))},e}(),k=function(e,t){return d(d({},t),{event_type:s.IDENTIFY,user_properties:e.getUserProperties()})},O=function(e,t,i){return void 0===t&&(t=0),void 0===i&&(i=c.Unknown),{event:e,code:t,message:i}},T=function(){function e(){this.queue=[],this.applying=!1,this.plugins=[]}return e.prototype.register=function(e,t){return f(this,void 0,void 0,(function(){return h(this,(function(i){switch(i.label){case 0:return[4,e.setup(t)];case 1:return i.sent(),this.plugins.push(e),[2]}}))}))},e.prototype.deregister=function(e){return this.plugins.splice(this.plugins.findIndex((function(t){return t.name===e})),1),Promise.resolve()},e.prototype.reset=function(){this.applying=!1,this.plugins=[]},e.prototype.push=function(e){var t=this;return new Promise((function(i){t.queue.push([e,i]),t.scheduleApply(0)}))},e.prototype.scheduleApply=function(e){var t=this;this.applying||(this.applying=!0,setTimeout((function(){t.apply(t.queue.shift()).then((function(){t.applying=!1,t.queue.length>0&&t.scheduleApply(0)}))}),e))},e.prototype.apply=function(e){return f(this,void 0,void 0,(function(){var t,i,n,r,o,s,u,c,l,p,f,b,y,m,w,I,_,S;return h(this,(function(h){switch(h.label){case 0:if(!e)return[2];t=g(e,1),i=t[0],n=g(e,2),r=n[1],o=this.plugins.filter((function(e){return e.type===a.BEFORE})),h.label=1;case 1:h.trys.push([1,6,7,8]),s=v(o),u=s.next(),h.label=2;case 2:return u.done?[3,5]:[4,u.value.execute(d({},i))];case 3:i=h.sent(),h.label=4;case 4:return u=s.next(),[3,2];case 5:return[3,8];case 6:return c=h.sent(),w={error:c},[3,8];case 7:try{u&&!u.done&&(I=s.return)&&I.call(s)}finally{if(w)throw w.error}return[7];case 8:l=this.plugins.filter((function(e){return e.type===a.ENRICHMENT})),h.label=9;case 9:h.trys.push([9,14,15,16]),p=v(l),f=p.next(),h.label=10;case 10:return f.done?[3,13]:[4,f.value.execute(d({},i))];case 11:i=h.sent(),h.label=12;case 12:return f=p.next(),[3,10];case 13:return[3,16];case 14:return b=h.sent(),_={error:b},[3,16];case 15:try{f&&!f.done&&(S=p.return)&&S.call(p)}finally{if(_)throw _.error}return[7];case 16:return y=this.plugins.filter((function(e){return e.type===a.DESTINATION})),m=y.map((function(e){var t=d({},i);return e.execute(t).catch((function(e){return O(t,0,String(e))}))})),Promise.all(m).then((function(e){var t=g(e,1)[0];r(t)})),[2]}}))}))},e.prototype.flush=function(){return f(this,void 0,void 0,(function(){var e,t,i,n=this;return h(this,(function(r){switch(r.label){case 0:return e=this.queue,this.queue=[],[4,Promise.all(e.map((function(e){return n.apply(e)})))];case 1:return r.sent(),t=this.plugins.filter((function(e){return e.type===a.DESTINATION})),i=t.map((function(e){return e.flush&&e.flush()})),[4,Promise.all(i)];case 2:return r.sent(),[2]}}))}))},e}(),x="Event rejected due to exceeded retry count",P=function(){function e(e){void 0===e&&(e="$default"),this.initializing=!1,this.q=[],this.dispatchQ=[],this.logEvent=this.track.bind(this),this.timeline=new T,this.name=e}return e.prototype._init=function(e){return f(this,void 0,void 0,(function(){return h(this,(function(t){switch(t.label){case 0:return this.config=e,this.timeline.reset(),[4,this.runQueuedFunctions("q")];case 1:return t.sent(),[2]}}))}))},e.prototype.runQueuedFunctions=function(e){return f(this,void 0,void 0,(function(){var t,i,n,r,o,s;return h(this,(function(u){switch(u.label){case 0:t=this[e],this[e]=[],u.label=1;case 1:u.trys.push([1,6,7,8]),i=v(t),n=i.next(),u.label=2;case 2:return n.done?[3,5]:[4,(0,n.value)()];case 3:u.sent(),u.label=4;case 4:return n=i.next(),[3,2];case 5:return[3,8];case 6:return r=u.sent(),o={error:r},[3,8];case 7:try{n&&!n.done&&(s=i.return)&&s.call(i)}finally{if(o)throw o.error}return[7];case 8:return[2]}}))}))},e.prototype.track=function(e,t,i){var n=function(e,t,i){return d(d(d({},"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){var i=k(e,t);return this.dispatch(i)},e.prototype.groupIdentify=function(e,t,i,n){var r=function(e,t,i,n){var r;return d(d({},n),{event_type:s.GROUP_IDENTIFY,group_properties:i.getUserProperties(),groups:(r={},r[e]=t,r)})}(e,t,i,n);return this.dispatch(r)},e.prototype.setGroup=function(e,t,i){var n=function(e,t,i){var n,r=new E;return r.set(e,t),d(d({},i),{event_type:s.IDENTIFY,user_properties:r.getUserProperties(),groups:(n={},n[e]=t,n)})}(e,t,i);return this.dispatch(n)},e.prototype.revenue=function(e,t){var i=function(e,t){return d(d({},t),{event_type:s.REVENUE,event_properties:e.getEventProperties()})}(e,t);return this.dispatch(i)},e.prototype.add=function(e){return f(this,void 0,void 0,(function(){return h(this,(function(t){return this.config?[2,this.timeline.register(e,this.config)]:(this.q.push(this.add.bind(this,e)),[2])}))}))},e.prototype.remove=function(e){return f(this,void 0,void 0,(function(){return h(this,(function(t){return this.config?[2,this.timeline.deregister(e)]:(this.q.push(this.remove.bind(this,e)),[2])}))}))},e.prototype.dispatchWithCallback=function(e,t){if(!this.config)return t(O(e,0,"Client not initialized"));this.process(e).then(t)},e.prototype.dispatch=function(e){return f(this,void 0,void 0,(function(){var t=this;return h(this,(function(i){return this.config?[2,this.process(e)]:[2,new Promise((function(i){t.dispatchQ.push(t.dispatchWithCallback.bind(t,e,i))}))]}))}))},e.prototype.process=function(e){return f(this,void 0,void 0,(function(){var t,i,n;return h(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),this.config.optOut?[2,O(e,0,"Event skipped due to optOut config")]:[4,this.timeline.push(e)];case 1:return 200===(n=r.sent()).code?this.config.loggerProvider.log(n.message):this.config.loggerProvider.error(n.message),[2,n];case 2:return t=r.sent(),i=String(t),this.config.loggerProvider.error(i),[2,n=O(e,0,i)];case 3:return[2]}}))}))},e.prototype.setOptOut=function(e){this.config?this.config.optOut=Boolean(e):this.q.push(this.setOptOut.bind(this,Boolean(e)))},e.prototype.flush=function(){return this.timeline.flush()},e}(),R=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)&&(this.properties=e),this},e.prototype.getEventProperties=function(){var e=this.properties?d({},this.properties):{};return e[o.REVENUE_PRODUCT_ID]=this.productId,e[o.REVENUE_QUANTITY]=this.quantity,e[o.REVENUE_PRICE]=this.price,e[o.REVENUE_TYPE]=this.revenueType,e[o.REVENUE]=this.revenue,e},e}(),N="Amplitude Logger ",U=function(){function e(){this.logLevel=u.None}return e.prototype.disable=function(){this.logLevel=u.None},e.prototype.enable=function(e){void 0===e&&(e=u.Warn),this.logLevel=e},e.prototype.log=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<u.Verbose||console.log("".concat(N,"[Log]: ").concat(e.join(" ")))},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<u.Warn||console.warn("".concat(N,"[Warn]: ").concat(e.join(" ")))},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<u.Error||console.error("".concat(N,"[Error]: ").concat(e.join(" ")))},e.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<u.Debug||console.log("".concat(N,"[Debug]: ").concat(e.join(" ")))},e}(),C=function(){return{flushMaxRetries:12,flushQueueSize:200,flushIntervalMillis:1e4,logLevel:u.Warn,loggerProvider:new U,optOut:!1,serverUrl:I,serverZone:n.US,useBatch:!1}},q=function(){function e(e){var t,i,n;this._optOut=!1;var r=C();this.apiKey=e.apiKey,this.flushIntervalMillis=e.flushIntervalMillis||r.flushIntervalMillis,this.flushMaxRetries=e.flushMaxRetries||r.flushMaxRetries,this.flushQueueSize=e.flushQueueSize||r.flushQueueSize,this.loggerProvider=e.loggerProvider||r.loggerProvider,this.logLevel=null!==(t=e.logLevel)&&void 0!==t?t:r.logLevel,this.minIdLength=e.minIdLength,this.plan=e.plan,this.ingestionMetadata=e.ingestionMetadata,this.optOut=null!==(i=e.optOut)&&void 0!==i?i:r.optOut,this.serverUrl=e.serverUrl,this.serverZone=e.serverZone||r.serverZone,this.storageProvider=e.storageProvider,this.transportProvider=e.transportProvider,this.useBatch=null!==(n=e.useBatch)&&void 0!==n?n:r.useBatch,this.loggerProvider.enable(this.logLevel);var o=A(e.serverUrl,e.serverZone,e.useBatch);this.serverZone=o.serverZone,this.serverUrl=o.serverUrl}return Object.defineProperty(e.prototype,"optOut",{get:function(){return this._optOut},set:function(e){this._optOut=e},enumerable:!1,configurable:!0}),e}(),D=function(e,t){return e===n.EU?t?"https://api.eu.amplitude.com/batch":"https://api.eu.amplitude.com/2/httpapi":t?"https://api2.amplitude.com/batch":I},A=function(e,t,i){if(void 0===e&&(e=""),void 0===t&&(t=C().serverZone),void 0===i&&(i=C().useBatch),e)return{serverUrl:e,serverZone:void 0};var r=[n.US,n.EU].includes(t)?t:C().serverZone;return{serverZone:r,serverUrl:D(r,i)}},j=function(){function e(){this.name="amplitude",this.type=a.DESTINATION,this.retryTimeout=1e3,this.throttleTimeout=3e4,this.storageKey="",this.scheduled=!1,this.queue=[]}return e.prototype.setup=function(e){var t;return f(this,void 0,void 0,(function(){var i,n=this;return h(this,(function(r){switch(r.label){case 0:return this.config=e,this.storageKey="".concat(w,"_").concat(this.config.apiKey.substring(0,10)),[4,null===(t=this.config.storageProvider)||void 0===t?void 0:t.get(this.storageKey)];case 1:return i=r.sent(),this.saveEvents(),i&&i.length>0&&Promise.all(i.map((function(e){return n.execute(e)}))).catch(),[2,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)},timeout: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?(t.attempts+=1,!0):(e.fulfillRequest([t],500,x),!1)}));n.forEach((function(t){e.queue=e.queue.concat(t),0!==t.timeout?setTimeout((function(){t.timeout=0,e.schedule(0)}),t.timeout):e.schedule(e.config.flushIntervalMillis)})),this.saveEvents()},e.prototype.schedule=function(e){var t=this;this.scheduled||(this.scheduled=!0,setTimeout((function(){t.flush(!0).then((function(){t.scheduled=!1,t.queue.length>0&&t.schedule(e)}))}),e))},e.prototype.flush=function(e){return void 0===e&&(e=!1),f(this,void 0,void 0,(function(){var t,i,n,r=this;return h(this,(function(o){switch(o.label){case 0:return t=[],i=[],this.queue.forEach((function(e){return 0===e.timeout?t.push(e):i.push(e)})),this.queue=i,s=t,u=this.config.flushQueueSize,a=Math.max(u,1),n=s.reduce((function(e,t,i){var n=Math.floor(i/a);return e[n]||(e[n]=[]),e[n].push(t),e}),[]),[4,Promise.all(n.map((function(t){return r.send(t,e)})))];case 1:return o.sent(),[2]}var s,u,a}))}))},e.prototype.send=function(e,t){return void 0===t&&(t=!0),f(this,void 0,void 0,(function(){var i,n,r,o;return h(this,(function(s){switch(s.label){case 0:if(!this.config.apiKey)return[2,this.fulfillRequest(e,400,"Event rejected due to missing API key")];i={api_key:this.config.apiKey,events:e.map((function(e){var t=e.event;return t.extra,p(t,["extra"])})),options:{min_id_length:this.config.minIdLength}},s.label=1;case 1:return s.trys.push([1,3,,4]),n=A(this.config.serverUrl,this.config.serverZone,this.config.useBatch).serverUrl,[4,this.config.transportProvider.send(n,i)];case 2:return null===(r=s.sent())?(this.fulfillRequest(e,0,"Unexpected error occurred"),[2]):t?(this.handleReponse(r,e),[3,4]):(this.fulfillRequest(e,r.statusCode,r.status),[2]);case 3:return o=s.sent(),this.fulfillRequest(e,0,String(o)),[3,4];case 4:return[2]}}))}))},e.prototype.handleReponse=function(e,t){switch(e.status){case c.Success:this.handleSuccessResponse(e,t);break;case c.Invalid:this.handleInvalidResponse(e,t);break;case c.PayloadTooLarge:this.handlePayloadTooLargeResponse(e,t);break;case c.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||e.body.error.startsWith("Invalid API key"))this.fulfillRequest(t,e.statusCode,e.body.error);else{var n=b(b(b(b([],g(Object.values(e.body.eventsWithInvalidFields)),!1),g(Object.values(e.body.eventsWithMissingFields)),!1),g(Object.values(e.body.eventsWithInvalidIdLengths)),!1),g(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,b([],g(o),!1))}},e.prototype.handlePayloadTooLargeResponse=function(e,t){1!==t.length?(this.config.flushQueueSize/=2,this.addToQueue.apply(this,b([],g(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),u=new Set(r),a=new Set(o),c=t.filter((function(t,n){if(!(t.event.user_id&&s.has(t.event.user_id)||t.event.device_id&&u.has(t.event.device_id)))return a.has(n)&&(t.timeout=i.throttleTimeout),!0;i.fulfillRequest([t],e.statusCode,e.body.error)}));this.addToQueue.apply(this,b([],g(c),!1))},e.prototype.handleOtherReponse=function(e){var t=this;this.addToQueue.apply(this,b([],g(e.map((function(e){return e.timeout=e.attempts*t.retryTimeout,e}))),!1))},e.prototype.fulfillRequest=function(e,t,i){this.saveEvents(),e.forEach((function(e){return e.callback(O(e.event,t,i))}))},e.prototype.saveEvents=function(){if(this.config.storageProvider){var e=Array.from(this.queue.map((function(e){return e.event})));this.config.storageProvider.set(this.storageKey,e)}},e}(),M=function(e){return function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];return{promise:e.apply(void 0,b([],g(t),!1))}}},L=function(e){return void 0===e&&(e=0),((new Error).stack||"").split("\n").slice(2+e).map((function(e){return e.trim()}))},V=function(e){return function(){var t=d({},e.config);return{logger:t.loggerProvider,logLevel:t.logLevel}}},B=function(e,t){var i,n;t=(t=t.replace(/\[(\w+)\]/g,".$1")).replace(/^\./,"");try{for(var r=v(t.split(".")),o=r.next();!o.done;o=r.next()){var s=o.value;if(!(s in e))return;e=e[s]}}catch(e){i={error:e}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return e},z=function(e,t){return function(){var i,n,r={};try{for(var o=v(t),s=o.next();!s.done;s=o.next()){var u=s.value;r[u]=B(e,u)}}catch(e){i={error:e}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return r}},F=function(e,t,i,n,r){return void 0===r&&(r=null),function(){for(var o=[],s=0;s<arguments.length;s++)o[s]=arguments[s];var a=i(),c=a.logger,l=a.logLevel;if(l&&l<u.Debug||!l||!c)return e.apply(r,o);var d={type:"invoke public method",name:t,args:o,stacktrace:L(1),time:{start:(new Date).toISOString()},states:{}};n&&d.states&&(d.states.before=n());var p=e.apply(r,o);return p&&p.promise?p.promise.then((function(){n&&d.states&&(d.states.after=n()),d.time&&(d.time.end=(new Date).toISOString()),c.debug(JSON.stringify(d,null,2))})):(n&&d.states&&(d.states.after=n()),d.time&&(d.time.end=(new Date).toISOString()),c.debug(JSON.stringify(d,null,2))),p}},K=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,K)},Q=function(){function e(){this.memoryStorage=new Map}return e.prototype.isEnabled=function(){return f(this,void 0,void 0,(function(){return h(this,(function(e){return[2,!0]}))}))},e.prototype.get=function(e){return f(this,void 0,void 0,(function(){return h(this,(function(t){return[2,this.memoryStorage.get(e)]}))}))},e.prototype.getRaw=function(e){return f(this,void 0,void 0,(function(){var t;return h(this,(function(i){switch(i.label){case 0:return[4,this.get(e)];case 1:return[2,(t=i.sent())?JSON.stringify(t):void 0]}}))}))},e.prototype.set=function(e,t){return f(this,void 0,void 0,(function(){return h(this,(function(i){return this.memoryStorage.set(e,t),[2]}))}))},e.prototype.remove=function(e){return f(this,void 0,void 0,(function(){return h(this,(function(t){return this.memoryStorage.delete(e),[2]}))}))},e.prototype.reset=function(){return f(this,void 0,void 0,(function(){return h(this,(function(e){return this.memoryStorage.clear(),[2]}))}))},e}(),$=function(){function e(){}return e.prototype.send=function(e,t){return Promise.resolve(null)},e.prototype.buildResponse=function(e){var t,i,n,r,o,s,u,a,l,d,p,f,h,v,g,b,y,m,w,I,_,S;if("object"!=typeof e)return null;var E=e.code||0,k=this.buildStatus(E);switch(k){case c.Success:return{status:k,statusCode:E,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 c.Invalid:return{status:k,statusCode:E,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!==(u=e.events_with_missing_fields)&&void 0!==u?u:{},eventsWithInvalidIdLengths:null!==(a=e.events_with_invalid_id_lengths)&&void 0!==a?a:{},epsThreshold:null!==(l=e.eps_threshold)&&void 0!==l?l:0,exceededDailyQuotaDevices:null!==(d=e.exceeded_daily_quota_devices)&&void 0!==d?d:{},silencedDevices:null!==(p=e.silenced_devices)&&void 0!==p?p:[],silencedEvents:null!==(f=e.silenced_events)&&void 0!==f?f:[],throttledDevices:null!==(h=e.throttled_devices)&&void 0!==h?h:{},throttledEvents:null!==(v=e.throttled_events)&&void 0!==v?v:[]}};case c.PayloadTooLarge:return{status:k,statusCode:E,body:{error:null!==(g=e.error)&&void 0!==g?g:""}};case c.RateLimit:return{status:k,statusCode:E,body:{error:null!==(b=e.error)&&void 0!==b?b:"",epsThreshold:null!==(y=e.eps_threshold)&&void 0!==y?y:0,throttledDevices:null!==(m=e.throttled_devices)&&void 0!==m?m:{},throttledUsers:null!==(w=e.throttled_users)&&void 0!==w?w:{},exceededDailyQuotaDevices:null!==(I=e.exceeded_daily_quota_devices)&&void 0!==I?I:{},exceededDailyQuotaUsers:null!==(_=e.exceeded_daily_quota_users)&&void 0!==_?_:{},throttledEvents:null!==(S=e.throttled_events)&&void 0!==S?S:[]}};case c.Timeout:default:return{status:k,statusCode:E}}},e.prototype.buildStatus=function(e){return e>=200&&e<300?c.Success:429===e?c.RateLimit:413===e?c.PayloadTooLarge:408===e?c.Timeout:e>=400&&e<500?c.Invalid:e>=500?c.Failed:c.Unknown},e}(),W=function(){return"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof self?self:"undefined"!=typeof global?global:void 0},Z=function(){var e,t=W();return(null===(e=null==t?void 0:t.location)||void 0===e?void 0:e.search)?t.location.search.substring(1).split("&").filter(Boolean).reduce((function(e,t){var i=t.split("=",2),n=G(i[0]),r=G(i[1]);return r?(e[n]=r,e):e}),{}):{}},G=function(e){void 0===e&&(e="");try{return decodeURIComponent(e)}catch(e){return""}},J={utm_source:void 0,utm_medium:void 0,utm_campaign:void 0,utm_term:void 0,utm_content:void 0,referrer:void 0,referring_domain:void 0,dclid:void 0,gbraid:void 0,gclid:void 0,fbclid:void 0,ko_click_id:void 0,msclkid:void 0,ttclid:void 0,twclid:void 0,wbraid:void 0},H=function(){function e(){}return e.prototype.parse=function(){return f(this,void 0,void 0,(function(){return h(this,(function(e){return[2,d(d(d(d({},J),this.getUtmParam()),this.getReferrer()),this.getClickIds())]}))}))},e.prototype.getUtmParam=function(){var e=Z();return{utm_source:e.utm_source,utm_medium:e.utm_medium,utm_campaign:e.utm_campaign,utm_term:e.utm_term,utm_content:e.utm_content}},e.prototype.getReferrer=function(){var e,t,i={referrer:void 0,referring_domain:void 0};try{i.referrer=document.referrer||void 0,i.referring_domain=null!==(t=null===(e=i.referrer)||void 0===e?void 0:e.split("/")[2])&&void 0!==t?t:void 0}catch(e){}return i},e.prototype.getClickIds=function(){var e,t=Z();return(e={}).dclid=t.dclid,e.fbclid=t.fbclid,e.gbraid=t.gbraid,e.gclid=t.gclid,e.ko_click_id=t.ko_click_id,e.msclkid=t.msclkid,e.ttclid=t.ttclid,e.twclid=t.twclid,e.wbraid=t.wbraid,e},e}(),Y=function(e,t,i){return void 0===t&&(t=""),void 0===i&&(i=10),[m,t,e.substring(0,i)].filter(Boolean).join("_")},X=function(){function e(e,t){var i,n;this.storage=t.storage,this.storageKey=Y(e,"MKTG"),this.parser=new H,this.track=t.track,this.onNewCampaign=t.onNewCampaign,this.disabled=Boolean(t.disabled),this.trackNewCampaigns=Boolean(t.trackNewCampaigns),this.trackPageViews=Boolean(t.trackPageViews),this.excludeReferrers=null!==(i=t.excludeReferrers)&&void 0!==i?i:[],"undefined"!=typeof location&&this.excludeReferrers.unshift(location.hostname),this.initialEmptyValue=null!==(n=t.initialEmptyValue)&&void 0!==n?n:"EMPTY"}return e.prototype.isNewCampaign=function(e,t,i){void 0===i&&(i=!1),e.referrer;var n=e.referring_domain,r=p(e,["referrer","referring_domain"]),o=t||{};o.referrer;var s=o.referring_domain,u=p(o,["referrer","referring_domain"]);if(e.referring_domain&&this.excludeReferrers.includes(e.referring_domain))return!1;var a=JSON.stringify(r)!==JSON.stringify(u),c=i?ee(n||"")!==ee(s||""):n!==s;return!t||a||c},e.prototype.saveCampaignToStorage=function(e){return f(this,void 0,void 0,(function(){return h(this,(function(t){switch(t.label){case 0:return[4,this.storage.set(this.storageKey,e)];case 1:return t.sent(),[2]}}))}))},e.prototype.getCampaignFromStorage=function(){return f(this,void 0,void 0,(function(){return h(this,(function(e){switch(e.label){case 0:return[4,this.storage.get(this.storageKey)];case 1:return[2,e.sent()]}}))}))},e.prototype.createCampaignEvent=function(e){var t=this,i=d(d({},J),e),n=Object.entries(i).reduce((function(e,i){var n=g(i,2),r=n[0],o=n[1];return e.setOnce("initial_".concat(r),o||t.initialEmptyValue),o?e.set(r,o):e.unset(r)}),new E),r={event_type:"Page View",event_properties:{page_title:"undefined"!=typeof document&&document.title||"",page_location:"undefined"!=typeof location&&location.href||"",page_path:"undefined"!=typeof location&&location.pathname||""}};return d(d({},k(n)),this.trackPageViews&&r)},e.prototype.send=function(e){return f(this,void 0,void 0,(function(){var t,i;return h(this,(function(n){switch(n.label){case 0:return this.disabled?[2]:[4,this.parser.parse()];case 1:return t=n.sent(),[4,this.getCampaignFromStorage()];case 2:if(i=n.sent(),!e){if(!this.trackNewCampaigns||!this.isNewCampaign(t,i))return[2];this.onNewCampaign(t)}return[4,this.track(this.createCampaignEvent(t))];case 3:return n.sent(),[4,this.saveCampaignToStorage(t)];case 4:return n.sent(),[2]}}))}))},e}(),ee=function(e){var t=e.split(".");return t.length<=2?e:t.slice(t.length-2,t.length).join(".")},te=function(){function e(e){this.options=d({},e)}return e.prototype.isEnabled=function(){return f(this,void 0,void 0,(function(){var t,i,n;return h(this,(function(r){switch(r.label){case 0:if(!W())return[2,!1];t=String(Date.now()),i=new e(this.options),n="AMP_TEST",r.label=1;case 1:return r.trys.push([1,4,5,7]),[4,i.set(n,t)];case 2:return r.sent(),[4,i.get(n)];case 3:return[2,r.sent()===t];case 4:return r.sent(),[2,!1];case 5:return[4,i.remove(n)];case 6:return r.sent(),[7];case 7:return[2]}}))}))},e.prototype.get=function(e){return f(this,void 0,void 0,(function(){var t;return h(this,(function(i){switch(i.label){case 0:return[4,this.getRaw(e)];case 1:if(!(t=i.sent()))return[2,void 0];try{try{t=decodeURIComponent(atob(t))}catch(e){}return[2,JSON.parse(t)]}catch(e){return[2,void 0]}return[2]}}))}))},e.prototype.getRaw=function(e){var t;return f(this,void 0,void 0,(function(){var i,n,r;return h(this,(function(o){return i=W(),n=null!==(t=null==i?void 0:i.document.cookie.split("; "))&&void 0!==t?t:[],(r=n.find((function(t){return 0===t.indexOf(e+"=")})))?[2,r.substring(e.length+1)]:[2,void 0]}))}))},e.prototype.set=function(e,t){var i;return f(this,void 0,void 0,(function(){var n,r,o,s,u,a;return h(this,(function(c){try{n=null!==(i=this.options.expirationDays)&&void 0!==i?i:0,o=void 0,(r=null!==t?n:-1)&&((s=new Date).setTime(s.getTime()+24*r*60*60*1e3),o=s),u="".concat(e,"=").concat(btoa(encodeURIComponent(JSON.stringify(t)))),o&&(u+="; expires=".concat(o.toUTCString())),u+="; path=/",this.options.domain&&(u+="; domain=".concat(this.options.domain)),this.options.secure&&(u+="; Secure"),this.options.sameSite&&(u+="; SameSite=".concat(this.options.sameSite)),(a=W())&&(a.document.cookie=u)}catch(e){}return[2]}))}))},e.prototype.remove=function(e){return f(this,void 0,void 0,(function(){return h(this,(function(t){switch(t.label){case 0:return[4,this.set(e,null)];case 1:return t.sent(),[2]}}))}))},e.prototype.reset=function(){return f(this,void 0,void 0,(function(){return h(this,(function(e){return[2]}))}))},e}(),ie=function(){function e(e,t){this.storage=e,this.isSessionCacheValid=!0,this.storageKey=Y(t),this.cache={optOut:!1}}return e.prototype.load=function(){var e;return f(this,void 0,void 0,(function(){var t;return h(this,(function(i){switch(i.label){case 0:return t=this,[4,this.storage.get(this.storageKey)];case 1:return t.cache=null!==(e=i.sent())&&void 0!==e?e:{optOut:!1},[2,this]}}))}))},e.prototype.setSession=function(e){this.cache=d(d({},this.cache),e),this.storage.set(this.storageKey,this.cache)},e.prototype.getSessionId=function(){var e=this;return this.isSessionCacheValid=!0,this.storage.get(this.storageKey).then((function(t){e.isSessionCacheValid&&(e.cache.sessionId=null==t?void 0:t.sessionId)})),this.cache.sessionId},e.prototype.setSessionId=function(e){this.isSessionCacheValid=!1,this.setSession({sessionId:e})},e.prototype.getDeviceId=function(){return this.cache.deviceId},e.prototype.setDeviceId=function(e){this.setSession({deviceId:e})},e.prototype.getUserId=function(){return this.cache.userId},e.prototype.setUserId=function(e){this.setSession({userId:e})},e.prototype.getLastEventTime=function(){return this.cache.lastEventTime},e.prototype.setLastEventTime=function(e){this.setSession({lastEventTime:e})},e.prototype.getOptOut=function(){return this.cache.optOut},e.prototype.setOptOut=function(e){this.setSession({optOut:e})},e}(),ne=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.send=function(e,t){return f(this,void 0,void 0,(function(){var i,n;return h(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,this.buildResponse(n)]}}))}))},t}($),re="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},oe={exports:{}};!function(e,t){!function(i,n){var r="function",o="undefined",s="object",u="string",a="model",c="name",l="type",d="vendor",p="version",f="architecture",h="console",v="mobile",g="tablet",b="smarttv",y="wearable",m="embedded",w="Amazon",I="Apple",_="ASUS",S="BlackBerry",E="Firefox",k="Google",O="Huawei",T="LG",x="Microsoft",P="Motorola",R="Opera",N="Samsung",U="Sony",C="Xiaomi",q="Zebra",D="Facebook",A=function(e){for(var t={},i=0;i<e.length;i++)t[e[i].toUpperCase()]=e[i];return t},j=function(e,t){return typeof e===u&&-1!==M(t).indexOf(M(e))},M=function(e){return e.toLowerCase()},L=function(e,t){if(typeof e===u)return e=e.replace(/^\s\s*/,"").replace(/\s\s*$/,""),typeof t===o?e:e.substring(0,275)},V=function(e,t){for(var i,o,u,a,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(u=0;u<f.length;u++)l=c[++o],typeof(a=f[u])===s&&a.length>0?2===a.length?typeof a[1]==r?this[a[0]]=a[1].call(this,l):this[a[0]]=a[1]:3===a.length?typeof a[1]!==r||a[1].exec&&a[1].test?this[a[0]]=l?l.replace(a[1],a[2]):n:this[a[0]]=l?a[1].call(this,l,a[2]):n:4===a.length&&(this[a[0]]=l?a[3].call(this,l.replace(a[1],a[2])):n):this[a]=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(j(t[i][r],e))return"?"===i?n:i}else if(j(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,E]],[/\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,D],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,M]],[/((?: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/,"",M]],[/(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,M]]],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],[a,[d,N],[l,g]],[/\b((?:s[cgp]h|gt|sm)-\w+|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[a,[d,N],[l,v]],[/((ipod|iphone)\d+,\d+)/i],[a,[d,I],[l,v]],[/(ipad\d+,\d+)/i],[a,[d,I],[l,g]],[/\((ip(?:hone|od)[\w ]*);/i],[a,[d,I],[l,v]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[a,[d,I],[l,g]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[a,[d,O],[l,g]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[a,[d,O],[l,v]],[/\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|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[a,/_/g," "],[d,C],[l,v]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[a,/_/g," "],[d,C],[l,g]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[a,[d,"OPPO"],[l,v]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[a,[d,"Vivo"],[l,v]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[a,[d,"Realme"],[l,v]],[/\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],[a,[d,P],[l,v]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[a,[d,P],[l,g]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[a,[d,T],[l,g]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[a,[d,T],[l,v]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[a,[d,"Lenovo"],[l,g]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[a,/_/g," "],[d,"Nokia"],[l,v]],[/(pixel c)\b/i],[a,[d,k],[l,g]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[a,[d,k],[l,v]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[a,[d,U],[l,v]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[a,"Xperia Tablet"],[d,U],[l,g]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[a,[d,"OnePlus"],[l,v]],[/(alexa)webm/i,/(kf[a-z]{2}wi)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[a,[d,w],[l,g]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[a,/(.+)/g,"Fire Phone $1"],[d,w],[l,v]],[/(playbook);[-\w\),; ]+(rim)/i],[a,d,[l,g]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[a,[d,S],[l,v]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[a,[d,_],[l,g]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[a,[d,_],[l,v]],[/(nexus 9)/i],[a,[d,"HTC"],[l,g]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic|sony(?!-bra))[-_ ]?([-\w]*)/i],[d,[a,/_/g," "],[l,v]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[a,[d,"Acer"],[l,g]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[a,[d,"Meizu"],[l,v]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[a,[d,"Sharp"],[l,v]],[/(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,a,[l,v]],[/(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,a,[l,g]],[/(surface duo)/i],[a,[d,x],[l,g]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[a,[d,"Fairphone"],[l,v]],[/(u304aa)/i],[a,[d,"AT&T"],[l,v]],[/\bsie-(\w*)/i],[a,[d,"Siemens"],[l,v]],[/\b(rct\w+) b/i],[a,[d,"RCA"],[l,g]],[/\b(venue[\d ]{2,7}) b/i],[a,[d,"Dell"],[l,g]],[/\b(q(?:mv|ta)\w+) b/i],[a,[d,"Verizon"],[l,g]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[a,[d,"Barnes & Noble"],[l,g]],[/\b(tm\d{3}\w+) b/i],[a,[d,"NuVision"],[l,g]],[/\b(k88) b/i],[a,[d,"ZTE"],[l,g]],[/\b(nx\d{3}j) b/i],[a,[d,"ZTE"],[l,v]],[/\b(gen\d{3}) b.+49h/i],[a,[d,"Swiss"],[l,v]],[/\b(zur\d{3}) b/i],[a,[d,"Swiss"],[l,g]],[/\b((zeki)?tb.*\b) b/i],[a,[d,"Zeki"],[l,g]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[d,"Dragon Touch"],a,[l,g]],[/\b(ns-?\w{0,9}) b/i],[a,[d,"Insignia"],[l,g]],[/\b((nxa|next)-?\w{0,9}) b/i],[a,[d,"NextBook"],[l,g]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[d,"Voice"],a,[l,v]],[/\b(lvtel\-)?(v1[12]) b/i],[[d,"LvTel"],a,[l,v]],[/\b(ph-1) /i],[a,[d,"Essential"],[l,v]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[a,[d,"Envizen"],[l,g]],[/\b(trio[-\w\. ]+) b/i],[a,[d,"MachSpeed"],[l,g]],[/\btu_(1491) b/i],[a,[d,"Rotor"],[l,g]],[/(shield[\w ]+) b/i],[a,[d,"Nvidia"],[l,g]],[/(sprint) (\w+)/i],[d,a,[l,v]],[/(kin\.[onetw]{3})/i],[[a,/\./g," "],[d,x],[l,v]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[a,[d,q],[l,g]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[a,[d,q],[l,v]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[d,a,[l,h]],[/droid.+; (shield) bui/i],[a,[d,"Nvidia"],[l,h]],[/(playstation [345portablevi]+)/i],[a,[d,U],[l,h]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[a,[d,x],[l,h]],[/smart-tv.+(samsung)/i],[d,[l,b]],[/hbbtv.+maple;(\d+)/i],[[a,/^/,"SmartTV"],[d,N],[l,b]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[d,T],[l,b]],[/(apple) ?tv/i],[d,[a,"Apple TV"],[l,b]],[/crkey/i],[[a,"Chromecast"],[d,k],[l,b]],[/droid.+aft(\w)( bui|\))/i],[a,[d,w],[l,b]],[/\(dtv[\);].+(aquos)/i],[a,[d,"Sharp"],[l,b]],[/(bravia[\w- ]+) bui/i],[a,[d,U],[l,b]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w ]*; *(\w[^;]*);([^;]*)/i],[[d,L],[a,L],[l,b]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[l,b]],[/((pebble))app/i],[d,a,[l,y]],[/droid.+; (glass) \d/i],[a,[d,k],[l,y]],[/droid.+; (wt63?0{2,3})\)/i],[a,[d,q],[l,y]],[/(quest( 2)?)/i],[a,[d,D],[l,y]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[d,[l,m]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[a,[l,v]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[a,[l,g]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[l,g]],[/(phone|mobile(?:[;\/]| safari)|pda(?=.+windows ce))/i],[[l,v]],[/(android[-\w\. ]{0,9});.+buil/i],[a,[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,S]],[/(?: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]]},K=function(e,t){if(typeof e===s&&(t=e,e=n),!(this instanceof K))return new K(e,t).getResult();var r=e||(typeof i!==o&&i.navigator&&i.navigator.userAgent?i.navigator.userAgent:""),a=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,V.call(t,r,a.browser),t.major=typeof(e=t.version)===u?e.replace(/[^\d\.]/g,"").split(".")[0]:n,t},this.getCPU=function(){var e={};return e.architecture=n,V.call(e,r,a.cpu),e},this.getDevice=function(){var e={};return e.vendor=n,e.model=n,e.type=n,V.call(e,r,a.device),e},this.getEngine=function(){var e={};return e.name=n,e.version=n,V.call(e,r,a.engine),e},this.getOS=function(){var e={};return e.name=n,e.version=n,V.call(e,r,a.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===u&&e.length>275?L(e,275):e,this},this.setUA(r),this};K.VERSION="0.7.31",K.BROWSER=A([c,p,"major"]),K.CPU=A([f]),K.DEVICE=A([a,d,l,h,v,b,g,y,m]),K.ENGINE=K.OS=A([c,p]),e.exports&&(t=e.exports=K),t.UAParser=K;var Q=typeof i!==o&&(i.jQuery||i.Zepto);if(Q&&!Q.ua){var $=new K;Q.ua=$.getResult(),Q.ua.get=function(){return $.getUA()},Q.ua.set=function(e){$.setUA(e);var t=$.getResult();for(var i in t)Q.ua[i]=t[i]}}}("object"==typeof window?window:re)}(oe,oe.exports);var se=oe.exports,ue=function(){function e(){this.ua=new oe.exports.UAParser("undefined"!=typeof navigator?navigator.userAgent:null).getResult()}return e.prototype.getApplicationContext=function(){return{versionName:this.versionName,language:le(),platform:"Web",os:ae(this.ua),deviceModel:ce(this.ua)}},e}(),ae=function(e){var t,i;return[null===(t=e.browser)||void 0===t?void 0:t.name,null===(i=e.browser)||void 0===i?void 0:i.major].filter((function(e){return null!=e})).join(" ")},ce=function(e){var t;return null===(t=e.os)||void 0===t?void 0:t.name},le=function(){return"undefined"!=typeof navigator&&(navigator.languages&&navigator.languages[0]||navigator.language)||""},de=function(){function e(){this.queue=[]}return e.prototype.logEvent=function(e){this.receiver?this.receiver(e):this.queue.length<512&&this.queue.push(e)},e.prototype.setEventReceiver=function(e){this.receiver=e,this.queue.length>0&&(this.queue.forEach((function(t){e(t)})),this.queue=[])},e}(),pe=function(){return pe=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},pe.apply(this,arguments)};Object.entries||(Object.entries=function(e){for(var t=Object.keys(e),i=t.length,n=new Array(i);i--;)n[i]=[t[i],e[t[i]]];return n});var fe=function(){function e(){this.identity={userProperties:{}},this.listeners=new Set}return e.prototype.editIdentity=function(){var e=this,t=pe({},this.identity.userProperties),i=pe(pe({},this.identity),{userProperties:t});return{setUserId:function(e){return i.userId=e,this},setDeviceId:function(e){return i.deviceId=e,this},setUserProperties:function(e){return i.userProperties=e,this},updateUserProperties:function(e){for(var t=i.userProperties||{},n=0,r=Object.entries(e);n<r.length;n++){var o=r[n],s=o[0],u=o[1];switch(s){case"$set":for(var a=0,c=Object.entries(u);a<c.length;a++){var l=c[a],d=l[0],p=l[1];t[d]=p}break;case"$unset":for(var f=0,h=Object.keys(u);f<h.length;f++){delete t[d=h[f]]}break;case"$clearAll":t={}}}return i.userProperties=t,this},commit:function(){return e.setIdentity(i),this}}},e.prototype.getIdentity=function(){return pe({},this.identity)},e.prototype.setIdentity=function(e){var t=pe({},this.identity);this.identity=pe({},e),he(t,this.identity)||this.listeners.forEach((function(t){t(e)}))},e.prototype.addIdentityListener=function(e){this.listeners.add(e)},e.prototype.removeIdentityListener=function(e){this.listeners.delete(e)},e}(),he=function(e,t){var i=typeof e;if(i!==typeof t)return!1;for(var n=0,r=["string","number","boolean","undefined"];n<r.length;n++){if(r[n]===i)return e===t}if(e.length!==t.length)return!1;var o=Array.isArray(e),s=Array.isArray(t);if(o!==s)return!1;if(!o||!s){var u=Object.keys(e).sort(),a=Object.keys(t).sort();if(!he(u,a))return!1;var c=!0;return Object.keys(e).forEach((function(i){he(e[i],t[i])||(c=!1)})),c}for(var l=0;l<e.length;l++)if(!he(e[l],t[l]))return!1;return!0},ve="undefined"!=typeof globalThis?globalThis:global||self,ge=function(){function e(){this.identityStore=new fe,this.eventBridge=new de,this.applicationContextProvider=new ue}return e.getInstance=function(t){return ve.analyticsConnectorInstances||(ve.analyticsConnectorInstances={}),ve.analyticsConnectorInstances[t]||(ve.analyticsConnectorInstances[t]=new e),ve.analyticsConnectorInstances[t]},e}(),be=function(){return ge.getInstance("$default_instance")},ye=function(){function e(){this.name="identity",this.type=a.BEFORE,this.identityStore=be().identityStore}return e.prototype.execute=function(e){return f(this,void 0,void 0,(function(){var t;return h(this,(function(i){return(t=e.user_properties)&&this.identityStore.editIdentity().updateUserProperties(t).commit(),[2,e]}))}))},e.prototype.setup=function(e){return Promise.resolve(void 0)},e}(),me=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:""},we=function(e,t){for(var i=0;i<t.length;i++){var n=t[i],r=n.name,o=n.args,s=n.resolve,u=e&&e[r];if("function"==typeof u){var a=u.apply(e,o);"function"==typeof s&&s(null==a?void 0:a.promise)}}return e},Ie=function(e){return e&&void 0!==e._q},_e=function(){function e(){var e;this.name="context",this.type=a.BEFORE,this.eventId=0,this.library="amplitude-ts/".concat("1.6.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){return f(this,void 0,void 0,(function(){var t,i,n,r,o;return h(this,(function(s){return this.isSessionValid()||(this.config.sessionId=Date.now()),this.config.lastEventTime=Date.now(),t=(new Date).getTime(),i=this.uaResult.browser.name,n=this.uaResult.browser.version,r=this.uaResult.device.model||this.uaResult.os.name,o=this.uaResult.device.vendor,[2,d(d(d(d(d(d(d(d(d(d(d(d({user_id:this.config.userId,device_id:this.config.deviceId,session_id:this.config.sessionId,time:t},this.config.appVersion&&{app_version:this.config.appVersion}),this.config.trackingOptions.platform&&{platform:"Web"}),this.config.trackingOptions.osName&&{os_name:i}),this.config.trackingOptions.osVersion&&{os_version:n}),this.config.trackingOptions.deviceManufacturer&&{device_manufacturer:o}),this.config.trackingOptions.deviceModel&&{device_model:r}),this.config.trackingOptions.language&&{language:me()}),this.config.trackingOptions.ipAddress&&{ip:"$remote"}),{insert_id:K(),partner_id:this.config.partnerId,plan:this.config.plan}),this.config.ingestionMetadata&&{ingestion_metadata:{source_name:this.config.ingestionMetadata.sourceName,source_version:this.config.ingestionMetadata.sourceVersion}}),e),{event_id:this.eventId++,library:this.library})]}))}))},e.prototype.isSessionValid=function(){var e=this.config.lastEventTime||Date.now();return Date.now()-e<this.config.sessionTimeout},e}(),Se=function(){function e(){}return e.prototype.isEnabled=function(){return f(this,void 0,void 0,(function(){var t,i,n;return h(this,(function(r){switch(r.label){case 0:if(!W())return[2,!1];t=String(Date.now()),i=new e,n="AMP_TEST",r.label=1;case 1:return r.trys.push([1,4,5,7]),[4,i.set(n,t)];case 2:return r.sent(),[4,i.get(n)];case 3:return[2,r.sent()===t];case 4:return r.sent(),[2,!1];case 5:return[4,i.remove(n)];case 6:return r.sent(),[7];case 7:return[2]}}))}))},e.prototype.get=function(e){return f(this,void 0,void 0,(function(){var t;return h(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,this.getRaw(e)];case 1:return(t=i.sent())?[2,JSON.parse(t)]:[2,void 0];case 2:return i.sent(),[2,void 0];case 3:return[2]}}))}))},e.prototype.getRaw=function(e){var t;return f(this,void 0,void 0,(function(){return h(this,(function(i){return[2,(null===(t=W())||void 0===t?void 0:t.localStorage.getItem(e))||void 0]}))}))},e.prototype.set=function(e,t){var i;return f(this,void 0,void 0,(function(){return h(this,(function(n){try{null===(i=W())||void 0===i||i.localStorage.setItem(e,JSON.stringify(t))}catch(e){}return[2]}))}))},e.prototype.remove=function(e){var t;return f(this,void 0,void 0,(function(){return h(this,(function(i){try{null===(t=W())||void 0===t||t.localStorage.removeItem(e)}catch(e){}return[2]}))}))},e.prototype.reset=function(){var e;return f(this,void 0,void 0,(function(){return h(this,(function(t){try{null===(e=W())||void 0===e||e.localStorage.clear()}catch(e){}return[2]}))}))},e}(),Ee=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={done:4},t}return i(t,e),t.prototype.send=function(e,t){return f(this,void 0,void 0,(function(){var i=this;return h(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=i.buildResponse(t);n(s)}catch(e){r(e)}},o.setRequestHeader("Content-Type","application/json"),o.setRequestHeader("Accept","*/*"),o.send(JSON.stringify(t))}))]}))}))},t}($),ke=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.send=function(e,t){return f(this,void 0,void 0,(function(){var i=this;return h(this,(function(n){return[2,new Promise((function(n,r){var o=W();if(!(null==o?void 0:o.navigator.sendBeacon))throw new Error("SendBeaconTransport is not supported");try{var s=JSON.stringify(t);return n(o.navigator.sendBeacon(e,JSON.stringify(t))?i.buildResponse({code:200,events_ingested:t.events.length,payload_size_bytes:s.length,server_upload_time:Date.now()}):i.buildResponse({code:500}))}catch(e){r(e)}}))]}))}))},t}($),Oe=function(){var e=new Q;return{cookieExpiration:365,cookieSameSite:"Lax",cookieSecure:!1,cookieStorage:e,disableCookies:!1,domain:"",sessionManager:new ie(e,""),sessionTimeout:18e5,storageProvider:new Q,trackingOptions:{deviceManufacturer:!0,deviceModel:!0,ipAddress:!0,language:!0,osName:!0,osVersion:!0,platform:!0},transportProvider:new ne}},Te=function(e){function t(t,i,n){var r,o,s,u,a,c,l,p,f,h,v,g,b=this,y=Oe();return(b=e.call(this,d(d({flushIntervalMillis:1e3,flushMaxRetries:5,flushQueueSize:30},n),{apiKey:t,storageProvider:null!==(r=null==n?void 0:n.storageProvider)&&void 0!==r?r:y.storageProvider,transportProvider:null!==(o=null==n?void 0:n.transportProvider)&&void 0!==o?o:y.transportProvider}))||this).cookieStorage=null!==(s=null==n?void 0:n.cookieStorage)&&void 0!==s?s:y.cookieStorage,b.sessionManager=null!==(u=null==n?void 0:n.sessionManager)&&void 0!==u?u:y.sessionManager,b.sessionTimeout=null!==(a=null==n?void 0:n.sessionTimeout)&&void 0!==a?a:y.sessionTimeout,b.appVersion=null==n?void 0:n.appVersion,b.attribution=null==n?void 0:n.attribution,b.cookieExpiration=null!==(c=null==n?void 0:n.cookieExpiration)&&void 0!==c?c:y.cookieExpiration,b.cookieSameSite=null!==(l=null==n?void 0:n.cookieSameSite)&&void 0!==l?l:y.cookieSameSite,b.cookieSecure=null!==(p=null==n?void 0:n.cookieSecure)&&void 0!==p?p:y.cookieSecure,b.deviceId=null==n?void 0:n.deviceId,b.disableCookies=null!==(f=null==n?void 0:n.disableCookies)&&void 0!==f?f:y.disableCookies,b.domain=null!==(h=null==n?void 0:n.domain)&&void 0!==h?h:y.domain,b.lastEventTime=null!==(v=b.lastEventTime)&&void 0!==v?v:null==n?void 0:n.lastEventTime,b.optOut=Boolean(null==n?void 0:n.optOut),b.partnerId=null==n?void 0:n.partnerId,b.sessionId=null==n?void 0:n.sessionId,b.trackingOptions=null!==(g=null==n?void 0:n.trackingOptions)&&void 0!==g?g:y.trackingOptions,b.userId=i,b}return i(t,e),Object.defineProperty(t.prototype,"deviceId",{get:function(){return this.sessionManager.getDeviceId()},set:function(e){this.sessionManager.setDeviceId(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"userId",{get:function(){return this.sessionManager.getUserId()},set:function(e){this.sessionManager.setUserId(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sessionId",{get:function(){return this.sessionManager.getSessionId()},set:function(e){this.sessionManager.setSessionId(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"optOut",{get:function(){return this.sessionManager.getOptOut()},set:function(e){var t;null===(t=this.sessionManager)||void 0===t||t.setOptOut(Boolean(e))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lastEventTime",{get:function(){return this.sessionManager.getLastEventTime()},set:function(e){this.sessionManager.setLastEventTime(e)},enumerable:!1,configurable:!0}),t}(q),xe=function(e,t,i){return f(void 0,void 0,void 0,(function(){var n,r,o,s,u,a,c,l,p,f,v,g,b,y,m,w,I;return h(this,(function(h){switch(h.label){case 0:return n=Oe(),null===(b=null==i?void 0:i.domain)||void 0===b?[3,1]:(o=b,[3,3]);case 1:return[4,qe()];case 2:o=h.sent(),h.label=3;case 3:return r=o,[4,Pe(d(d({},i),{domain:r}))];case 4:return s=h.sent(),u=Y(e),[4,s.get(u)];case 5:return a=h.sent(),c=Z(),[4,new ie(s,e).load()];case 6:return l=h.sent(),p=Te.bind,f=[void 0,e,null!=t?t:null==a?void 0:a.userId],v=[d({},i)],g={cookieStorage:s,sessionManager:l,deviceId:Ue(null==a?void 0:a.deviceId,null==i?void 0:i.deviceId,c.deviceId),domain:r,optOut:null!==(y=null==i?void 0:i.optOut)&&void 0!==y?y:Boolean(null==a?void 0:a.optOut)},[4,s.get(u)];case 7:return g.sessionId=null!==(w=null===(m=h.sent())||void 0===m?void 0:m.sessionId)&&void 0!==w?w:null==i?void 0:i.sessionId,[4,Ne(i)];case 8:return[2,new(p.apply(Te,f.concat([d.apply(void 0,v.concat([(g.storageProvider=h.sent(),g.trackingOptions=d(d({},n.trackingOptions),null==i?void 0:i.trackingOptions),g.transportProvider=null!==(I=null==i?void 0:i.transportProvider)&&void 0!==I?I:Ce(null==i?void 0:i.transport),g)]))])))]}}))}))},Pe=function(e,t){return void 0===t&&(t=Oe()),f(void 0,void 0,void 0,(function(){var i,n,r;return h(this,(function(o){switch(o.label){case 0:return i=d(d({},t),e),n=null==e?void 0:e.cookieStorage,(r=!n)?[3,2]:[4,n.isEnabled()];case 1:r=!o.sent(),o.label=2;case 2:return r?[2,Re(i)]:[2,n]}}))}))},Re=function(e){return f(void 0,void 0,void 0,(function(){var t,i;return h(this,(function(n){switch(n.label){case 0:return t=new te({domain:e.domain,expirationDays:e.cookieExpiration,sameSite:e.cookieSameSite,secure:e.cookieSecure}),(i=e.disableCookies)?[3,2]:[4,t.isEnabled()];case 1:i=!n.sent(),n.label=2;case 2:return i?[4,(t=new Se).isEnabled()]:[3,4];case 3:n.sent()||(t=new Q),n.label=4;case 4:return[2,t]}}))}))},Ne=function(e){return f(void 0,void 0,void 0,(function(){var t,i,n,r,o,s,u;return h(this,(function(a){switch(a.label){case 0:if(e&&Object.prototype.hasOwnProperty.call(e,"storageProvider")&&!e.storageProvider)return[3,9];a.label=1;case 1:a.trys.push([1,7,8,9]),t=v([null==e?void 0:e.storageProvider,new Se]),i=t.next(),a.label=2;case 2:return i.done?[3,6]:(n=i.value,(r=n)?[4,n.isEnabled()]:[3,4]);case 3:r=a.sent(),a.label=4;case 4:if(r)return[2,n];a.label=5;case 5:return i=t.next(),[3,2];case 6:return[3,9];case 7:return o=a.sent(),s={error:o},[3,9];case 8:try{i&&!i.done&&(u=t.return)&&u.call(t)}finally{if(s)throw s.error}return[7];case 9:return[2,void 0]}}))}))},Ue=function(e,t,i){return t||i||e||K()},Ce=function(e){return e===l.XHR?new Ee:e===l.SendBeacon?new ke:Oe().transportProvider},qe=function(e){return f(void 0,void 0,void 0,(function(){var t,i,n,r,o,s,u;return h(this,(function(a){switch(a.label){case 0:return[4,(new te).isEnabled()];case 1:if(!a.sent()||!e&&"undefined"==typeof location)return[2,""];for(t=null!=e?e:location.hostname,i=t.split("."),n=[],r="AMP_TLDTEST",o=i.length-2;o>=0;--o)n.push(i.slice(o).join("."));o=0,a.label=2;case 2:return o<n.length?(s=n[o],[4,(u=new te({domain:"."+s})).set(r,1)]):[3,7];case 3:return a.sent(),[4,u.get(r)];case 4:return a.sent()?[4,u.remove(r)]:[3,6];case 5:return a.sent(),[2,"."+s];case 6:return o++,[3,2];case 7:return[2,""]}}))}))},De=function(e,t){return f(void 0,void 0,void 0,(function(){var i,n,r,o,s,u,a,c,l;return h(this,(function(d){switch(d.label){case 0:return[4,(i=new te).isEnabled()];case 1:return d.sent()&&!(null==t?void 0:t.disableCookies)||(i=new Se),[4,i.isEnabled()];case 2:return d.sent()?(n=function(e){return"".concat(m.toLowerCase(),"_").concat(e.substring(0,6))}(e),[4,i.getRaw(n)]):[2,{optOut:!1}];case 3:return(r=d.sent())?[4,i.remove(n)]:[2,{optOut:!1}];case 4:return d.sent(),o=g(r.split("."),5),s=o[0],u=o[1],a=o[2],c=o[3],l=o[4],[2,{deviceId:s,userId:je(u),sessionId:Ae(c),lastEventTime:Ae(l),optOut:Boolean(a)}]}}))}))},Ae=function(e){var t=parseInt(e,32);if(!isNaN(t))return t},je=function(e){if(atob&&escape&&e)try{return decodeURIComponent(escape(atob(e)))}catch(e){return}},Me=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.init=function(t,i,n){var r,o,s;return void 0===t&&(t=""),f(this,void 0,void 0,(function(){var u,a,c,l,p=this;return h(this,(function(f){switch(f.label){case 0:return this.initializing?[2]:(this.initializing=!0,[4,De(t,n)]);case 1:return u=f.sent(),[4,xe(t,i||u.userId,d(d({},n),{deviceId:null!==(r=u.deviceId)&&void 0!==r?r:null==n?void 0:n.deviceId,sessionId:null!==(o=u.sessionId)&&void 0!==o?o:null==n?void 0:n.sessionId,optOut:null!==(s=null==n?void 0:n.optOut)&&void 0!==s?s:u.optOut,lastEventTime:u.lastEventTime}))];case 2:return a=f.sent(),[4,e.prototype._init.call(this,a)];case 3:return f.sent(),c=!this.config.lastEventTime,(!this.config.sessionId||this.config.lastEventTime&&Date.now()-this.config.lastEventTime>this.config.sessionTimeout)&&(this.setSessionId(Date.now()),c=!0),(l=be()).eventBridge.setEventReceiver((function(e){p.track(e.eventType,e.eventProperties)})),l.identityStore.setIdentity({userId:this.config.userId,deviceId:this.config.deviceId}),[4,this.add(new _e)];case 4:return f.sent(),[4,this.add(new ye)];case 5:return f.sent(),[4,this.add(new j)];case 6:return f.sent(),this.initializing=!1,[4,this.runAttributionStrategy(a.attribution,c)];case 7:return f.sent(),[4,this.runQueuedFunctions("dispatchQ")];case 8:return f.sent(),[2]}}))}))},t.prototype.runAttributionStrategy=function(e,t){return void 0===t&&(t=!1),f(this,void 0,void 0,(function(){var i,n,r;return h(this,(function(o){switch(o.label){case 0:return i=this.track.bind(this),n=this.setSessionId.bind(this,Date.now()),[4,Re(this.config)];case 1:return r=o.sent(),[4,new X(this.config.apiKey,d(d({},e),{storage:r,track:i,onNewCampaign:n})).send(t)];case 2:return o.sent(),[2]}}))}))},t.prototype.getUserId=function(){var e;return null===(e=this.config)||void 0===e?void 0:e.userId},t.prototype.setUserId=function(e){this.config?this.config.userId=e:this.q.push(this.setUserId.bind(this,e))},t.prototype.getDeviceId=function(){var e;return null===(e=this.config)||void 0===e?void 0:e.deviceId},t.prototype.setDeviceId=function(e){this.config?this.config.deviceId=e:this.q.push(this.setDeviceId.bind(this,e))},t.prototype.reset=function(){this.setUserId(void 0),this.setDeviceId(K())},t.prototype.getSessionId=function(){var e;return null===(e=this.config)||void 0===e?void 0:e.sessionId},t.prototype.setSessionId=function(e){this.config?(this.config.sessionId=e,this.config.lastEventTime=void 0):this.q.push(this.setSessionId.bind(this,e))},t.prototype.setTransport=function(e){this.config?this.config.transportProvider=Ce(e):this.q.push(this.setTransport.bind(this,e))},t.prototype.identify=function(t,i){if(Ie(t)){var n=t._q;t._q=[],t=we(new E,n)}return(null==i?void 0:i.user_id)&&this.setUserId(i.user_id),(null==i?void 0:i.device_id)&&this.setDeviceId(i.device_id),e.prototype.identify.call(this,t,i)},t.prototype.groupIdentify=function(t,i,n,r){if(Ie(n)){var o=n._q;n._q=[],n=we(new E,o)}return e.prototype.groupIdentify.call(this,t,i,n,r)},t.prototype.revenue=function(t,i){if(Ie(t)){var n=t._q;t._q=[],t=we(new R,n)}return e.prototype.revenue.call(this,t,i)},t}(P),Le=function(){var e=new Me;return{init:F(M(e.init.bind(e)),"init",V(e),z(e,["config"])),add:F(M(e.add.bind(e)),"add",V(e),z(e,["config.apiKey","timeline.plugins"])),remove:F(M(e.remove.bind(e)),"remove",V(e),z(e,["config.apiKey","timeline.plugins"])),track:F(M(e.track.bind(e)),"track",V(e),z(e,["config.apiKey","timeline.queue.length"])),logEvent:F(M(e.logEvent.bind(e)),"logEvent",V(e),z(e,["config.apiKey","timeline.queue.length"])),identify:F(M(e.identify.bind(e)),"identify",V(e),z(e,["config.apiKey","timeline.queue.length"])),groupIdentify:F(M(e.groupIdentify.bind(e)),"groupIdentify",V(e),z(e,["config.apiKey","timeline.queue.length"])),setGroup:F(M(e.setGroup.bind(e)),"setGroup",V(e),z(e,["config.apiKey","timeline.queue.length"])),revenue:F(M(e.revenue.bind(e)),"revenue",V(e),z(e,["config.apiKey","timeline.queue.length"])),flush:F(M(e.flush.bind(e)),"flush",V(e),z(e,["config.apiKey","timeline.queue.length"])),getUserId:F(e.getUserId.bind(e),"getUserId",V(e),z(e,["config","config.userId"])),setUserId:F(e.setUserId.bind(e),"setUserId",V(e),z(e,["config","config.userId"])),getDeviceId:F(e.getDeviceId.bind(e),"getDeviceId",V(e),z(e,["config","config.deviceId"])),setDeviceId:F(e.setDeviceId.bind(e),"setDeviceId",V(e),z(e,["config","config.deviceId"])),reset:F(e.reset.bind(e),"reset",V(e),z(e,["config","config.userId","config.deviceId"])),getSessionId:F(e.getSessionId.bind(e),"getSessionId",V(e),z(e,["config"])),setSessionId:F(e.setSessionId.bind(e),"setSessionId",V(e),z(e,["config"])),setOptOut:F(e.setOptOut.bind(e),"setOptOut",V(e),z(e,["config"])),setTransport:F(e.setTransport.bind(e),"setTransport",V(e),z(e,["config"]))}},Ve=Le(),Be=Ve.add,ze=Ve.flush,Fe=Ve.getDeviceId,Ke=Ve.getSessionId,Qe=Ve.getUserId,$e=Ve.groupIdentify,We=Ve.identify,Ze=Ve.init,Ge=Ve.logEvent,Je=Ve.remove,He=Ve.reset,Ye=Ve.revenue,Xe=Ve.setDeviceId,et=Ve.setGroup,tt=Ve.setOptOut,it=Ve.setSessionId,nt=Ve.setTransport,rt=Ve.setUserId,ot=Ve.track;e.Identify=E,e.Revenue=R,e.Types=y,e.add=Be,e.createInstance=Le,e.flush=ze,e.getDeviceId=Fe,e.getSessionId=Ke,e.getUserId=Qe,e.groupIdentify=$e,e.identify=We,e.init=Ze,e.logEvent=Ge,e.remove=Je,e.reset=He,e.revenue=Ye,e.runQueuedFunctions=function(e,t){we(e,t)},e.setDeviceId=Xe,e.setGroup=et,e.setOptOut=tt,e.setSessionId=it,e.setTransport=nt,e.setUserId=rt,e.track=ot,Object.defineProperty(e,"__esModule",{value:!0})}));
Binary file
@@ -1,5 +1,5 @@
1
1
  <script type="text/javascript">
2
- !function(){"use strict";!function(e,t){var n=e.amplitude||{_q:[],_iq:[]};if(n.invoked)e.console&&console.error&&console.error("Amplitude snippet has been loaded.");else{n.invoked=!0;var r=t.createElement("script");r.type="text/javascript",r.integrity="sha384-RlEul9diq4FLF1oXbgB4FqMOPnKhXHR65WOT/1gV2+Z38fSsnyNEQn2dT/eW6Fhu",r.crossOrigin="anonymous",r.async=!0,r.src="https://cdn.amplitude.com/libs/analytics-browser-1.5.8-min.js.gz",r.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(r,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]);n.Identify=o;for(var u=function(){return this._q=[],this},c=["getEventProperties","setProductId","setQuantity","setPrice","setRevenue","setRevenueType","setEventProperties"],l=0;l<c.length;l++)v(u,c[l]);n.Revenue=u;var p=["getDeviceId","setDeviceId","getSessionId","setSessionId","getUserId","setUserId","setOptOut","setTransport","reset"],d=["init","add","remove","track","logEvent","identify","groupIdentify","setGroup","revenue","flush"];function f(e){function t(t,n){e[t]=function(){var r={promise:new Promise((n=>{e._q.push({name:t,args:Array.prototype.slice.call(arguments,0),resolve:n})}))};if(n)return r}}for(var n=0;n<p.length;n++)t(p[n],!1);for(var r=0;r<d.length;r++)t(d[r],!0)}f(n),n.createInstance=function(){var e=n._iq.push({_q:[]})-1;return f(n._iq[e]),n._iq[e]},e.amplitude=n}}(window,document)}();
2
+ !function(){"use strict";!function(e,t){var r=e.amplitude||{_q:[],_iq:[]};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-21/avgAWaXA1nUNd3f0ZOYfiIQFQVwEuIeN1FqN6xL7sk+vj57uUp85vq0fDXOPY",n.crossOrigin="anonymous",n.async=!0,n.src="https://cdn.amplitude.com/libs/analytics-browser-1.6.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 d=["getDeviceId","setDeviceId","getSessionId","setSessionId","getUserId","setUserId","setOptOut","setTransport","reset"],l=["init","add","remove","track","logEvent","identify","groupIdentify","setGroup","revenue","flush"];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<d.length;r++)t(d[r],!1);for(var n=0;n<l.length;n++)t(l[n],!0)}f(r),r.createInstance=function(){var e=r._iq.push({_q:[]})-1;return f(r._iq[e]),r._iq[e]},e.amplitude=r}}(window,document)}();
3
3
 
4
4
  amplitude.init("YOUR_API_KEY_HERE");
5
5
  </script>
@@ -1 +1 @@
1
- !function(){"use strict";!function(e,t){var n=e.amplitude||{_q:[],_iq:[]};if(n.invoked)e.console&&console.error&&console.error("Amplitude snippet has been loaded.");else{n.invoked=!0;var r=t.createElement("script");r.type="text/javascript",r.integrity="sha384-RlEul9diq4FLF1oXbgB4FqMOPnKhXHR65WOT/1gV2+Z38fSsnyNEQn2dT/eW6Fhu",r.crossOrigin="anonymous",r.async=!0,r.src="https://cdn.amplitude.com/libs/analytics-browser-1.5.8-min.js.gz",r.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(r,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]);n.Identify=o;for(var u=function(){return this._q=[],this},c=["getEventProperties","setProductId","setQuantity","setPrice","setRevenue","setRevenueType","setEventProperties"],l=0;l<c.length;l++)v(u,c[l]);n.Revenue=u;var p=["getDeviceId","setDeviceId","getSessionId","setSessionId","getUserId","setUserId","setOptOut","setTransport","reset"],d=["init","add","remove","track","logEvent","identify","groupIdentify","setGroup","revenue","flush"];function f(e){function t(t,n){e[t]=function(){var r={promise:new Promise((n=>{e._q.push({name:t,args:Array.prototype.slice.call(arguments,0),resolve:n})}))};if(n)return r}}for(var n=0;n<p.length;n++)t(p[n],!1);for(var r=0;r<d.length;r++)t(d[r],!0)}f(n),n.createInstance=function(){var e=n._iq.push({_q:[]})-1;return f(n._iq[e]),n._iq[e]},e.amplitude=n}}(window,document)}();
1
+ !function(){"use strict";!function(e,t){var r=e.amplitude||{_q:[],_iq:[]};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-21/avgAWaXA1nUNd3f0ZOYfiIQFQVwEuIeN1FqN6xL7sk+vj57uUp85vq0fDXOPY",n.crossOrigin="anonymous",n.async=!0,n.src="https://cdn.amplitude.com/libs/analytics-browser-1.6.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 d=["getDeviceId","setDeviceId","getSessionId","setSessionId","getUserId","setUserId","setOptOut","setTransport","reset"],l=["init","add","remove","track","logEvent","identify","groupIdentify","setGroup","revenue","flush"];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<d.length;r++)t(d[r],!1);for(var n=0;n<l.length;n++)t(l[n],!0)}f(r),r.createInstance=function(){var e=r._iq.push({_q:[]})-1;return f(r._iq[e]),r._iq[e]},e.amplitude=r}}(window,document)}();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@amplitude/analytics-browser",
3
- "version": "1.5.8",
3
+ "version": "1.6.1",
4
4
  "description": "Official Amplitude SDK for Web",
5
5
  "keywords": [
6
6
  "analytics",
@@ -43,9 +43,9 @@
43
43
  "url": "https://github.com/amplitude/Amplitude-TypeScript/issues"
44
44
  },
45
45
  "dependencies": {
46
- "@amplitude/analytics-client-common": "^0.3.4",
47
- "@amplitude/analytics-core": "^0.9.7",
48
- "@amplitude/analytics-types": "^0.11.0",
46
+ "@amplitude/analytics-client-common": "^0.4.0",
47
+ "@amplitude/analytics-core": "^0.10.0",
48
+ "@amplitude/analytics-types": "^0.12.0",
49
49
  "@amplitude/ua-parser-js": "^0.7.31",
50
50
  "tslib": "^2.3.1"
51
51
  },
@@ -65,5 +65,5 @@
65
65
  "files": [
66
66
  "lib"
67
67
  ],
68
- "gitHead": "30837ddfa774ffc2ed4b43859838ef6e03bd7d3b"
68
+ "gitHead": "c3ea56594ea49edd5d63f67bdc4223e6ae5be9b2"
69
69
  }