@rudderstack/analytics-js 3.23.2-beta.pr.2445.550d671 → 3.23.2-beta.pr.2458.49076a2
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/dist/npm/index.d.cts +8 -48
- package/dist/npm/index.d.mts +8 -48
- package/dist/npm/legacy/bundled/cjs/index.cjs +24 -63
- package/dist/npm/legacy/bundled/esm/index.mjs +24 -63
- package/dist/npm/legacy/bundled/umd/index.js +24 -63
- package/dist/npm/legacy/cjs/index.cjs +24 -63
- package/dist/npm/legacy/content-script/cjs/index.cjs +24 -63
- package/dist/npm/legacy/content-script/esm/index.mjs +24 -63
- package/dist/npm/legacy/content-script/umd/index.js +24 -63
- package/dist/npm/legacy/esm/index.mjs +24 -63
- package/dist/npm/legacy/umd/index.js +24 -63
- package/dist/npm/modern/bundled/cjs/index.cjs +23 -47
- package/dist/npm/modern/bundled/esm/index.mjs +23 -47
- package/dist/npm/modern/bundled/umd/index.js +23 -47
- package/dist/npm/modern/cjs/index.cjs +24 -52
- package/dist/npm/modern/content-script/cjs/index.cjs +23 -47
- package/dist/npm/modern/content-script/esm/index.mjs +23 -47
- package/dist/npm/modern/content-script/umd/index.js +23 -47
- package/dist/npm/modern/esm/index.mjs +24 -52
- package/dist/npm/modern/umd/index.js +24 -52
- package/package.json +1 -1
package/dist/npm/index.d.cts
CHANGED
@@ -61,8 +61,6 @@ type IntegrationOpts = {
|
|
61
61
|
[index: string]: DestinationIntgConfig;
|
62
62
|
};
|
63
63
|
|
64
|
-
type UserSessionKey = 'userId' | 'userTraits' | 'anonymousId' | 'groupId' | 'groupTraits' | 'initialReferrer' | 'initialReferringDomain' | 'sessionInfo' | 'authToken';
|
65
|
-
|
66
64
|
type Traits = Nullable<ApiObject>;
|
67
65
|
type ApiCallback = (data?: any) => void;
|
68
66
|
/**
|
@@ -88,11 +86,6 @@ type APIEvent = {
|
|
88
86
|
groupId?: Nullable<string>;
|
89
87
|
};
|
90
88
|
type RudderEventType = 'page' | 'track' | 'identify' | 'alias' | 'group';
|
91
|
-
type ResetOptions = {
|
92
|
-
entries: {
|
93
|
-
[key in UserSessionKey]?: boolean;
|
94
|
-
};
|
95
|
-
};
|
96
89
|
|
97
90
|
interface ExtensionPoint {
|
98
91
|
[lifeCycleName: string]: (...args: any[]) => unknown;
|
@@ -136,6 +129,8 @@ interface IPluginsManager {
|
|
136
129
|
}
|
137
130
|
type PluginName = 'BeaconQueue' | 'CustomConsentManager' | 'DeviceModeDestinations' | 'DeviceModeTransformation' | 'ExternalAnonymousId' | 'GoogleLinker' | 'IubendaConsentManager' | 'KetchConsentManager' | 'NativeDestinationQueue' | 'OneTrustConsentManager' | 'StorageEncryption' | 'StorageEncryptionLegacy' | 'StorageMigrator' | 'XhrQueue';
|
138
131
|
|
132
|
+
type UserSessionKey = 'userId' | 'userTraits' | 'anonymousId' | 'groupId' | 'groupTraits' | 'initialReferrer' | 'initialReferringDomain' | 'sessionInfo' | 'authToken';
|
133
|
+
|
139
134
|
type StorageEncryptionVersion = 'legacy' | 'v3';
|
140
135
|
type StorageType = 'cookieStorage' | 'localStorage' | 'memoryStorage' | 'sessionStorage' | 'none';
|
141
136
|
type StorageEncryption = {
|
@@ -598,10 +593,6 @@ type AnalyticsAliasMethod = {
|
|
598
593
|
(to: string, options?: Nullable<ApiOptions>, callback?: ApiCallback): void;
|
599
594
|
(to: string, callback?: ApiCallback): void;
|
600
595
|
};
|
601
|
-
type AnalyticsResetMethod = {
|
602
|
-
(options?: ResetOptions): void;
|
603
|
-
(resetAnonymousId?: boolean): void;
|
604
|
-
};
|
605
596
|
interface IRudderAnalytics<T = any> {
|
606
597
|
analyticsInstances: Record<string, T>;
|
607
598
|
defaultAnalyticsKey: string;
|
@@ -647,11 +638,11 @@ interface IRudderAnalytics<T = any> {
|
|
647
638
|
*/
|
648
639
|
group: AnalyticsGroupMethod;
|
649
640
|
/**
|
650
|
-
* Clear user
|
641
|
+
* Clear user information
|
651
642
|
*
|
652
|
-
* @param
|
643
|
+
* @param resetAnonymousId optionally clears anonymousId as well
|
653
644
|
*/
|
654
|
-
reset:
|
645
|
+
reset(resetAnonymousId?: boolean): void;
|
655
646
|
/**
|
656
647
|
* To get anonymousId set in the SDK
|
657
648
|
*
|
@@ -1040,7 +1031,7 @@ interface IUserSessionManager {
|
|
1040
1031
|
getGroupTraits(): Nullable<ApiObject>;
|
1041
1032
|
setGroupId(groupId?: Nullable<string>): void;
|
1042
1033
|
setGroupTraits(traits?: Nullable<ApiObject>): void;
|
1043
|
-
reset(
|
1034
|
+
reset(resetAnonymousId?: boolean, noNewSessionStart?: boolean): void;
|
1044
1035
|
start(sessionId?: number): void;
|
1045
1036
|
end(): void;
|
1046
1037
|
syncStorageDataToState(): void;
|
@@ -1259,10 +1250,9 @@ interface IAnalytics {
|
|
1259
1250
|
*/
|
1260
1251
|
setAnonymousId(anonymousId?: string, rudderAmpLinkerParam?: string, isBufferedInvocation?: boolean): void;
|
1261
1252
|
/**
|
1262
|
-
* Clear user information
|
1263
|
-
* @param options options for reset
|
1253
|
+
* Clear user information, optionally anonymousId as well
|
1264
1254
|
*/
|
1265
|
-
reset(
|
1255
|
+
reset(resetAnonymousId?: boolean, isBufferedInvocation?: boolean): void;
|
1266
1256
|
/**
|
1267
1257
|
* To get userId set in the SDK
|
1268
1258
|
*/
|
@@ -1403,36 +1393,6 @@ declare class RudderAnalytics implements IRudderAnalytics<IAnalytics> {
|
|
1403
1393
|
group(groupId: string, callback?: ApiCallback): void;
|
1404
1394
|
group(traits: Nullable<IdentifyTraits>, options?: Nullable<ApiOptions>, callback?: ApiCallback): void;
|
1405
1395
|
group(traits: Nullable<IdentifyTraits>, callback?: ApiCallback): void;
|
1406
|
-
/**
|
1407
|
-
* Reset the analytics instance
|
1408
|
-
* @param options Reset options. Except for anonymousId, initialReferrer, and initialReferringDomain
|
1409
|
-
* all other values will be reset by default.
|
1410
|
-
* @example
|
1411
|
-
* ```ts
|
1412
|
-
* reset({
|
1413
|
-
* entries: {
|
1414
|
-
* anonymousId: true,
|
1415
|
-
* }
|
1416
|
-
* });
|
1417
|
-
* ```
|
1418
|
-
* @example
|
1419
|
-
* ```ts
|
1420
|
-
* reset({
|
1421
|
-
* entries: {
|
1422
|
-
* userId: false,
|
1423
|
-
* sessionInfo: false,
|
1424
|
-
* }
|
1425
|
-
* });
|
1426
|
-
* ```
|
1427
|
-
* @returns none
|
1428
|
-
*/
|
1429
|
-
reset(options?: ResetOptions): void;
|
1430
|
-
/**
|
1431
|
-
* Reset the analytics instance
|
1432
|
-
* @param resetAnonymousId Reset anonymous ID
|
1433
|
-
* @returns none
|
1434
|
-
* @deprecated Use reset(options) instead
|
1435
|
-
*/
|
1436
1396
|
reset(resetAnonymousId?: boolean): void;
|
1437
1397
|
getAnonymousId(options?: AnonymousIdOptions): string | undefined;
|
1438
1398
|
setAnonymousId(anonymousId?: string, rudderAmpLinkerParam?: string): void;
|
package/dist/npm/index.d.mts
CHANGED
@@ -61,8 +61,6 @@ type IntegrationOpts = {
|
|
61
61
|
[index: string]: DestinationIntgConfig;
|
62
62
|
};
|
63
63
|
|
64
|
-
type UserSessionKey = 'userId' | 'userTraits' | 'anonymousId' | 'groupId' | 'groupTraits' | 'initialReferrer' | 'initialReferringDomain' | 'sessionInfo' | 'authToken';
|
65
|
-
|
66
64
|
type Traits = Nullable<ApiObject>;
|
67
65
|
type ApiCallback = (data?: any) => void;
|
68
66
|
/**
|
@@ -88,11 +86,6 @@ type APIEvent = {
|
|
88
86
|
groupId?: Nullable<string>;
|
89
87
|
};
|
90
88
|
type RudderEventType = 'page' | 'track' | 'identify' | 'alias' | 'group';
|
91
|
-
type ResetOptions = {
|
92
|
-
entries: {
|
93
|
-
[key in UserSessionKey]?: boolean;
|
94
|
-
};
|
95
|
-
};
|
96
89
|
|
97
90
|
interface ExtensionPoint {
|
98
91
|
[lifeCycleName: string]: (...args: any[]) => unknown;
|
@@ -136,6 +129,8 @@ interface IPluginsManager {
|
|
136
129
|
}
|
137
130
|
type PluginName = 'BeaconQueue' | 'CustomConsentManager' | 'DeviceModeDestinations' | 'DeviceModeTransformation' | 'ExternalAnonymousId' | 'GoogleLinker' | 'IubendaConsentManager' | 'KetchConsentManager' | 'NativeDestinationQueue' | 'OneTrustConsentManager' | 'StorageEncryption' | 'StorageEncryptionLegacy' | 'StorageMigrator' | 'XhrQueue';
|
138
131
|
|
132
|
+
type UserSessionKey = 'userId' | 'userTraits' | 'anonymousId' | 'groupId' | 'groupTraits' | 'initialReferrer' | 'initialReferringDomain' | 'sessionInfo' | 'authToken';
|
133
|
+
|
139
134
|
type StorageEncryptionVersion = 'legacy' | 'v3';
|
140
135
|
type StorageType = 'cookieStorage' | 'localStorage' | 'memoryStorage' | 'sessionStorage' | 'none';
|
141
136
|
type StorageEncryption = {
|
@@ -598,10 +593,6 @@ type AnalyticsAliasMethod = {
|
|
598
593
|
(to: string, options?: Nullable<ApiOptions>, callback?: ApiCallback): void;
|
599
594
|
(to: string, callback?: ApiCallback): void;
|
600
595
|
};
|
601
|
-
type AnalyticsResetMethod = {
|
602
|
-
(options?: ResetOptions): void;
|
603
|
-
(resetAnonymousId?: boolean): void;
|
604
|
-
};
|
605
596
|
interface IRudderAnalytics<T = any> {
|
606
597
|
analyticsInstances: Record<string, T>;
|
607
598
|
defaultAnalyticsKey: string;
|
@@ -647,11 +638,11 @@ interface IRudderAnalytics<T = any> {
|
|
647
638
|
*/
|
648
639
|
group: AnalyticsGroupMethod;
|
649
640
|
/**
|
650
|
-
* Clear user
|
641
|
+
* Clear user information
|
651
642
|
*
|
652
|
-
* @param
|
643
|
+
* @param resetAnonymousId optionally clears anonymousId as well
|
653
644
|
*/
|
654
|
-
reset:
|
645
|
+
reset(resetAnonymousId?: boolean): void;
|
655
646
|
/**
|
656
647
|
* To get anonymousId set in the SDK
|
657
648
|
*
|
@@ -1040,7 +1031,7 @@ interface IUserSessionManager {
|
|
1040
1031
|
getGroupTraits(): Nullable<ApiObject>;
|
1041
1032
|
setGroupId(groupId?: Nullable<string>): void;
|
1042
1033
|
setGroupTraits(traits?: Nullable<ApiObject>): void;
|
1043
|
-
reset(
|
1034
|
+
reset(resetAnonymousId?: boolean, noNewSessionStart?: boolean): void;
|
1044
1035
|
start(sessionId?: number): void;
|
1045
1036
|
end(): void;
|
1046
1037
|
syncStorageDataToState(): void;
|
@@ -1259,10 +1250,9 @@ interface IAnalytics {
|
|
1259
1250
|
*/
|
1260
1251
|
setAnonymousId(anonymousId?: string, rudderAmpLinkerParam?: string, isBufferedInvocation?: boolean): void;
|
1261
1252
|
/**
|
1262
|
-
* Clear user information
|
1263
|
-
* @param options options for reset
|
1253
|
+
* Clear user information, optionally anonymousId as well
|
1264
1254
|
*/
|
1265
|
-
reset(
|
1255
|
+
reset(resetAnonymousId?: boolean, isBufferedInvocation?: boolean): void;
|
1266
1256
|
/**
|
1267
1257
|
* To get userId set in the SDK
|
1268
1258
|
*/
|
@@ -1403,36 +1393,6 @@ declare class RudderAnalytics implements IRudderAnalytics<IAnalytics> {
|
|
1403
1393
|
group(groupId: string, callback?: ApiCallback): void;
|
1404
1394
|
group(traits: Nullable<IdentifyTraits>, options?: Nullable<ApiOptions>, callback?: ApiCallback): void;
|
1405
1395
|
group(traits: Nullable<IdentifyTraits>, callback?: ApiCallback): void;
|
1406
|
-
/**
|
1407
|
-
* Reset the analytics instance
|
1408
|
-
* @param options Reset options. Except for anonymousId, initialReferrer, and initialReferringDomain
|
1409
|
-
* all other values will be reset by default.
|
1410
|
-
* @example
|
1411
|
-
* ```ts
|
1412
|
-
* reset({
|
1413
|
-
* entries: {
|
1414
|
-
* anonymousId: true,
|
1415
|
-
* }
|
1416
|
-
* });
|
1417
|
-
* ```
|
1418
|
-
* @example
|
1419
|
-
* ```ts
|
1420
|
-
* reset({
|
1421
|
-
* entries: {
|
1422
|
-
* userId: false,
|
1423
|
-
* sessionInfo: false,
|
1424
|
-
* }
|
1425
|
-
* });
|
1426
|
-
* ```
|
1427
|
-
* @returns none
|
1428
|
-
*/
|
1429
|
-
reset(options?: ResetOptions): void;
|
1430
|
-
/**
|
1431
|
-
* Reset the analytics instance
|
1432
|
-
* @param resetAnonymousId Reset anonymous ID
|
1433
|
-
* @returns none
|
1434
|
-
* @deprecated Use reset(options) instead
|
1435
|
-
*/
|
1436
1396
|
reset(resetAnonymousId?: boolean): void;
|
1437
1397
|
getAnonymousId(options?: AnonymousIdOptions): string | undefined;
|
1438
1398
|
setAnonymousId(anonymousId?: string, rudderAmpLinkerParam?: string): void;
|
@@ -208,26 +208,6 @@ function _objectSpread2(e) {
|
|
208
208
|
}
|
209
209
|
return e;
|
210
210
|
}
|
211
|
-
function _objectWithoutProperties(e, t) {
|
212
|
-
if (null == e) return {};
|
213
|
-
var o,
|
214
|
-
r,
|
215
|
-
i = _objectWithoutPropertiesLoose(e, t);
|
216
|
-
if (Object.getOwnPropertySymbols) {
|
217
|
-
var n = Object.getOwnPropertySymbols(e);
|
218
|
-
for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
|
219
|
-
}
|
220
|
-
return i;
|
221
|
-
}
|
222
|
-
function _objectWithoutPropertiesLoose(r, e) {
|
223
|
-
if (null == r) return {};
|
224
|
-
var t = {};
|
225
|
-
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
226
|
-
if (-1 !== e.indexOf(n)) continue;
|
227
|
-
t[n] = r[n];
|
228
|
-
}
|
229
|
-
return t;
|
230
|
-
}
|
231
211
|
function _possibleConstructorReturn(t, e) {
|
232
212
|
if (e && ("object" == typeof e || "function" == typeof e)) return e;
|
233
213
|
if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined");
|
@@ -739,7 +719,7 @@ mergeDeepRight(mergedArray[index],value):value;});return mergedArray;};/**
|
|
739
719
|
* @returns Returns the input value if it is a boolean, otherwise returns the default value
|
740
720
|
* @example
|
741
721
|
* getNormalizedBooleanValue(true, false) // returns true
|
742
|
-
*/var getNormalizedBooleanValue=function getNormalizedBooleanValue(val,defVal){return typeof val==='boolean'?val:defVal;};
|
722
|
+
*/var getNormalizedBooleanValue=function getNormalizedBooleanValue(val,defVal){return typeof val==='boolean'?val:defVal;};
|
743
723
|
|
744
724
|
var trim=function trim(value){return value.replace(/^\s+|\s+$/gm,'');};var removeLeadingPeriod=function removeLeadingPeriod(value){return value.replace(/^\.+/,'');};/**
|
745
725
|
* A function to convert values to string
|
@@ -826,6 +806,11 @@ var hasCrypto$1=function hasCrypto(){return !isNullOrUndefined(globalThis.crypto
|
|
826
806
|
|
827
807
|
var generateUUID=function generateUUID(){if(hasCrypto$1()){return v4$1();}return v4();};
|
828
808
|
|
809
|
+
/**
|
810
|
+
* Determines if the SDK is running inside a chrome extension
|
811
|
+
* @returns boolean
|
812
|
+
*/var isSDKRunningInChromeExtension=function isSDKRunningInChromeExtension(){var _chrome;return !!((_chrome=window.chrome)!==null&&_chrome!==void 0&&(_chrome=_chrome.runtime)!==null&&_chrome!==void 0&&_chrome.id);};var isIE11=function isIE11(){return isString(globalThis.navigator.userAgent)&&/Trident.*rv:11\./.test(globalThis.navigator.userAgent);};
|
813
|
+
|
829
814
|
var onPageLeave=function onPageLeave(callback){// To ensure the callback is only called once even if more than one events
|
830
815
|
// are fired at once.
|
831
816
|
var pageLeft=false;var isAccessible=false;function handleOnLeave(){if(pageLeft){return;}pageLeft=true;callback(isAccessible);// Reset pageLeft on the next tick
|
@@ -835,8 +820,12 @@ setTimeout(function(){pageLeft=false;},0);}// Catches the unloading of the page
|
|
835
820
|
// Includes user actions like clicking a link, entering a new URL,
|
836
821
|
// refreshing the page, or closing the browser tab
|
837
822
|
// Note that 'pagehide' is not supported in IE.
|
838
|
-
//
|
839
|
-
|
823
|
+
// Registering this event conditionally for IE11 also because
|
824
|
+
// it affects bfcache optimization on modern browsers otherwise.
|
825
|
+
if(isIE11()){globalThis.addEventListener('beforeunload',function(){isAccessible=false;handleOnLeave();});}// This is important for iOS Safari browser as it does not
|
826
|
+
// fire the regular pagehide and visibilitychange events
|
827
|
+
// when user goes to tablist view and closes the tab.
|
828
|
+
globalThis.addEventListener('blur',function(){isAccessible=true;handleOnLeave();});globalThis.addEventListener('focus',function(){pageLeft=false;});// Catches the page being hidden, including scenarios like closing the tab.
|
840
829
|
document.addEventListener('pagehide',function(){isAccessible=document.visibilityState==='hidden';handleOnLeave();});// Catches visibility changes, such as switching tabs or minimizing the browser.
|
841
830
|
document.addEventListener('visibilitychange',function(){isAccessible=true;if(document.visibilityState==='hidden'){handleOnLeave();}else {pageLeft=false;}});};
|
842
831
|
|
@@ -896,7 +885,7 @@ error.stack="".concat(stack,"\n").concat(MANUAL_ERROR_IDENTIFIER);break;case sta
|
|
896
885
|
error.stacktrace="".concat(stacktrace,"\n").concat(MANUAL_ERROR_IDENTIFIER);break;case operaSourceloc:default:// eslint-disable-next-line no-param-reassign
|
897
886
|
error['opera#sourceloc']="".concat(operaSourceloc,"\n").concat(MANUAL_ERROR_IDENTIFIER);break;}}}globalThis.dispatchEvent(new ErrorEvent('error',{error:error,bubbles:true,cancelable:true,composed:true}));};
|
898
887
|
|
899
|
-
var APP_NAME='RudderLabs JavaScript SDK';var APP_VERSION='3.23.2-beta.pr.
|
888
|
+
var APP_NAME='RudderLabs JavaScript SDK';var APP_VERSION='3.23.2-beta.pr.2458.49076a2';var APP_NAMESPACE='com.rudderlabs.javascript';var MODULE_TYPE='npm';var ADBLOCK_PAGE_CATEGORY='RudderJS-Initiated';var ADBLOCK_PAGE_NAME='ad-block page request';var ADBLOCK_PAGE_PATH='/ad-blocked';var GLOBAL_PRELOAD_BUFFER='preloadedEventsBuffer';var CONSENT_TRACK_EVENT_NAME='Consent Management Interaction';
|
900
889
|
|
901
890
|
var QUERY_PARAM_TRAIT_PREFIX='ajs_trait_';var QUERY_PARAM_PROPERTY_PREFIX='ajs_prop_';var QUERY_PARAM_ANONYMOUS_ID_KEY='ajs_aid';var QUERY_PARAM_USER_ID_KEY='ajs_uid';var QUERY_PARAM_TRACK_EVENT_NAME_KEY='ajs_event';
|
902
891
|
|
@@ -1036,8 +1025,7 @@ var DEFAULT_STORAGE_ENCRYPTION_VERSION='v3';var DEFAULT_DATA_PLANE_EVENTS_TRANSP
|
|
1036
1025
|
|
1037
1026
|
var defaultLoadOptions={configUrl:DEFAULT_CONFIG_BE_URL,loadIntegration:true,sessions:{autoTrack:true,timeout:DEFAULT_SESSION_TIMEOUT_MS,cutOff:{enabled:false}},sameSiteCookie:'Lax',polyfillIfRequired:true,integrations:DEFAULT_INTEGRATIONS_CONFIG,useBeacon:false,beaconQueueOptions:{},destinationsQueueOptions:{},queueOptions:{},lockIntegrationsVersion:false,lockPluginsVersion:false,uaChTrackLevel:'none',plugins:[],useGlobalIntegrationsConfigInEvents:false,bufferDataPlaneEventsUntilReady:false,dataPlaneEventsBufferTimeout:DEFAULT_DATA_PLANE_EVENTS_BUFFER_TIMEOUT_MS,storage:{encryption:{version:DEFAULT_STORAGE_ENCRYPTION_VERSION},migrate:true,cookie:{}},sendAdblockPage:false,sameDomainCookiesOnly:false,secureCookie:false,sendAdblockPageOptions:{},useServerSideCookies:false};var loadOptionsState=d$1(clone(defaultLoadOptions));
|
1038
1027
|
|
1039
|
-
var DEFAULT_USER_SESSION_VALUES=
|
1040
|
-
anonymousId:false,initialReferrer:false,initialReferringDomain:false}});var SERVER_SIDE_COOKIES_DEBOUNCE_TIME=10;// milliseconds
|
1028
|
+
var DEFAULT_USER_SESSION_VALUES={userId:'',userTraits:{},anonymousId:'',groupId:'',groupTraits:{},initialReferrer:'',initialReferringDomain:'',sessionInfo:{},authToken:null};var SERVER_SIDE_COOKIES_DEBOUNCE_TIME=10;// milliseconds
|
1041
1029
|
|
1042
1030
|
var sessionState={userId:d$1(DEFAULT_USER_SESSION_VALUES.userId),userTraits:d$1(DEFAULT_USER_SESSION_VALUES.userTraits),anonymousId:d$1(DEFAULT_USER_SESSION_VALUES.anonymousId),groupId:d$1(DEFAULT_USER_SESSION_VALUES.groupId),groupTraits:d$1(DEFAULT_USER_SESSION_VALUES.groupTraits),initialReferrer:d$1(DEFAULT_USER_SESSION_VALUES.initialReferrer),initialReferringDomain:d$1(DEFAULT_USER_SESSION_VALUES.initialReferringDomain),sessionInfo:d$1(DEFAULT_USER_SESSION_VALUES.sessionInfo),authToken:d$1(DEFAULT_USER_SESSION_VALUES.authToken)};
|
1043
1031
|
|
@@ -3208,7 +3196,7 @@ var storeExports = requireStore();
|
|
3208
3196
|
var store = /*@__PURE__*/getDefaultExportFromCjs(storeExports);
|
3209
3197
|
|
3210
3198
|
var hasCrypto=function hasCrypto(){return !isNullOrUndefined(globalThis.crypto)&&isFunction(globalThis.crypto.getRandomValues);};// eslint-disable-next-line compat/compat -- We are checking for the existence of navigator.userAgentData
|
3211
|
-
var hasUAClientHints=function hasUAClientHints(){return !isNullOrUndefined(globalThis.navigator.userAgentData);};var hasBeacon=function hasBeacon(){return !isNullOrUndefined(globalThis.navigator.sendBeacon)&&isFunction(globalThis.navigator.sendBeacon);};
|
3199
|
+
var hasUAClientHints=function hasUAClientHints(){return !isNullOrUndefined(globalThis.navigator.userAgentData);};var hasBeacon=function hasBeacon(){return !isNullOrUndefined(globalThis.navigator.sendBeacon)&&isFunction(globalThis.navigator.sendBeacon);};
|
3212
3200
|
|
3213
3201
|
var getUserAgentClientHint=function getUserAgentClientHint(callback){var level=arguments.length>1&&arguments[1]!==undefined?arguments[1]:'none';if(level==='none'){callback(undefined);}if(level==='default'){callback(navigator.userAgentData);}if(level==='full'){var _navigator$userAgentD;(_navigator$userAgentD=navigator.userAgentData)===null||_navigator$userAgentD===void 0||_navigator$userAgentD.getHighEntropyValues(['architecture','bitness','brands','mobile','model','platform','platformVersion','uaFullVersion','fullVersionList','wow64']).then(function(ua){callback(ua);}).catch(function(){callback();});}};
|
3214
3202
|
|
@@ -3352,11 +3340,6 @@ if(utmParam==='campaign'){utmParam='name';}result[utmParam]=value;}});}catch(err
|
|
3352
3340
|
*/var getUrlWithoutHash=function getUrlWithoutHash(url){var urlWithoutHash=url;try{var urlObj=new URL(url);urlWithoutHash=urlObj.origin+urlObj.pathname+urlObj.search;}catch(error){// Do nothing
|
3353
3341
|
}return urlWithoutHash;};
|
3354
3342
|
|
3355
|
-
/**
|
3356
|
-
* Determines if the SDK is running inside a chrome extension
|
3357
|
-
* @returns boolean
|
3358
|
-
*/var isSDKRunningInChromeExtension=function isSDKRunningInChromeExtension(){var _chrome;return !!((_chrome=window.chrome)!==null&&_chrome!==void 0&&(_chrome=_chrome.runtime)!==null&&_chrome!==void 0&&_chrome.id);};
|
3359
|
-
|
3360
3343
|
var DEFAULT_PRE_CONSENT_STORAGE_STRATEGY='none';var DEFAULT_PRE_CONSENT_EVENTS_DELIVERY_TYPE='immediate';
|
3361
3344
|
|
3362
3345
|
var isErrorReportingEnabled=function isErrorReportingEnabled(sourceConfig){var _sourceConfig$statsCo;return (sourceConfig===null||sourceConfig===void 0||(_sourceConfig$statsCo=sourceConfig.statsCollection)===null||_sourceConfig$statsCo===void 0||(_sourceConfig$statsCo=_sourceConfig$statsCo.errors)===null||_sourceConfig$statsCo===void 0?void 0:_sourceConfig$statsCo.enabled)===true;};var isMetricsReportingEnabled=function isMetricsReportingEnabled(sourceConfig){var _sourceConfig$statsCo2;return (sourceConfig===null||sourceConfig===void 0||(_sourceConfig$statsCo2=sourceConfig.statsCollection)===null||_sourceConfig$statsCo2===void 0||(_sourceConfig$statsCo2=_sourceConfig$statsCo2.metrics)===null||_sourceConfig$statsCo2===void 0?void 0:_sourceConfig$statsCo2.enabled)===true;};
|
@@ -3553,7 +3536,7 @@ var RESERVED_ELEMENTS=['id','anonymous_id','user_id','sent_at','timestamp','rece
|
|
3553
3536
|
* @returns boolean
|
3554
3537
|
*/var isPositiveInteger=function isPositiveInteger(num){return isNumber(num)&&num>=0&&Number.isInteger(num);};
|
3555
3538
|
|
3556
|
-
var
|
3539
|
+
var MIN_SESSION_ID_LENGTH=10;var isCutOffTimeExceeded=function isCutOffTimeExceeded(sessionInfo){var cutOff=sessionInfo.cutOff;var timestamp=Date.now();return Boolean((cutOff===null||cutOff===void 0?void 0:cutOff.enabled)&&cutOff.expiresAt&×tamp>cutOff.expiresAt);};/**
|
3557
3540
|
* A function to validate whether the current auto tracking session has expired or not.
|
3558
3541
|
* It checks for the current session expiry and the cut off time expiry.
|
3559
3542
|
* @param sessionInfo session info
|
@@ -3580,9 +3563,7 @@ timeout:timeout,autoTrack:true},cutOff&&{cutOff:cutOff});};/**
|
|
3580
3563
|
*/var generateManualTrackingSession=function generateManualTrackingSession(id,logger){var sessionId=isManualSessionIdValid(id,logger)?id:generateSessionId();return {id:sessionId,sessionStart:undefined,manualTrack:true};};var isStorageTypeValidForStoringData=function isStorageTypeValidForStoringData(storageType){return Boolean(storageType===COOKIE_STORAGE||storageType===LOCAL_STORAGE||storageType===SESSION_STORAGE||storageType===MEMORY_STORAGE);};/**
|
3581
3564
|
* Generate a new anonymousId
|
3582
3565
|
* @returns string anonymousID
|
3583
|
-
*/var generateAnonymousId=function generateAnonymousId(){return generateUUID();};
|
3584
|
-
if(isBoolean(options)){var entries=DEFAULT_RESET_OPTIONS.entries,rest=_objectWithoutProperties(DEFAULT_RESET_OPTIONS,_excluded);return _objectSpread2(_objectSpread2({},rest),{},{entries:_objectSpread2(_objectSpread2({},entries),{},{anonymousId:options})});}// Override any defaults with the user provided options
|
3585
|
-
if(isObjectLiteralAndNotNull(options)&&isObjectLiteralAndNotNull(options.entries)){return mergeDeepRight(DEFAULT_RESET_OPTIONS,options);}return _objectSpread2({},DEFAULT_RESET_OPTIONS);};
|
3566
|
+
*/var generateAnonymousId=function generateAnonymousId(){return generateUUID();};
|
3586
3567
|
|
3587
3568
|
/**
|
3588
3569
|
* To get the page properties for context object
|
@@ -3789,11 +3770,13 @@ this.migrateStorageIfNeeded([store],[sessionKey]);var storageKey=(_entries$sessi
|
|
3789
3770
|
if(sessionInfo.sessionStart===undefined){sessionInfo=_objectSpread2(_objectSpread2({},sessionInfo),{},{sessionStart:true});}else if(sessionInfo.sessionStart){sessionInfo=_objectSpread2(_objectSpread2({},sessionInfo),{},{sessionStart:false});}}// Always write to state (in-turn to storage) to keep the session info up to date.
|
3790
3771
|
state.session.sessionInfo.value=sessionInfo;if(state.lifecycle.status.value!=='readyExecuted'){// Force update the storage as the 'effect' blocks are not getting triggered
|
3791
3772
|
// when processing preload buffered requests
|
3792
|
-
this.syncValueToStorage('sessionInfo',sessionInfo);}}
|
3773
|
+
this.syncValueToStorage('sessionInfo',sessionInfo);}}/**
|
3793
3774
|
* Reset state values
|
3794
|
-
* @param
|
3775
|
+
* @param resetAnonymousId
|
3776
|
+
* @param noNewSessionStart
|
3795
3777
|
* @returns
|
3796
|
-
*/},{key:"reset",value:function reset(
|
3778
|
+
*/},{key:"reset",value:function reset(resetAnonymousId,noNewSessionStart){var _this7=this;var session=state.session;var _session$sessionInfo$=session.sessionInfo.value,manualTrack=_session$sessionInfo$.manualTrack,autoTrack=_session$sessionInfo$.autoTrack,timeout=_session$sessionInfo$.timeout,cutOff=_session$sessionInfo$.cutOff;r(function(){session.userId.value=DEFAULT_USER_SESSION_VALUES.userId;session.userTraits.value=DEFAULT_USER_SESSION_VALUES.userTraits;session.groupId.value=DEFAULT_USER_SESSION_VALUES.groupId;session.groupTraits.value=DEFAULT_USER_SESSION_VALUES.groupTraits;session.authToken.value=DEFAULT_USER_SESSION_VALUES.authToken;if(resetAnonymousId===true){// This will generate a new anonymous ID
|
3779
|
+
_this7.setAnonymousId();}if(noNewSessionStart){return;}if(autoTrack){var sessionInfo=_objectSpread2(_objectSpread2({},DEFAULT_USER_SESSION_VALUES.sessionInfo),{},{timeout:timeout});if(cutOff){sessionInfo.cutOff={enabled:cutOff.enabled,duration:cutOff.duration};}session.sessionInfo.value=sessionInfo;_this7.startOrRenewAutoTracking(session.sessionInfo.value);}else if(manualTrack){_this7.startManualTrackingInternal();}});}/**
|
3797
3780
|
* Set user Id
|
3798
3781
|
* @param userId
|
3799
3782
|
*/},{key:"setUserId",value:function setUserId(userId){state.session.userId.value=this.isPersistenceEnabledForStorageEntry('userId')&&userId?userId:DEFAULT_USER_SESSION_VALUES.userId;}/**
|
@@ -3956,7 +3939,7 @@ if(state.capabilities.isAdBlocked.value===true&&payload.category!==ADBLOCK_PAGE_
|
|
3956
3939
|
// in v3 implementation
|
3957
3940
|
path:ADBLOCK_PAGE_PATH},state.loadOptions.value.sendAdblockPageOptions));}}},{key:"track",value:function track(payload){var _this$eventManager3;var type='track';if(!state.lifecycle.loaded.value){state.eventBuffer.toBeProcessedArray.value=[].concat(_toConsumableArray(state.eventBuffer.toBeProcessedArray.value),[[type,payload]]);return;}this.errorHandler.leaveBreadcrumb("New ".concat(type," event - ").concat(payload.name));state.metrics.triggered.value+=1;(_this$eventManager3=this.eventManager)===null||_this$eventManager3===void 0||_this$eventManager3.addEvent({type:type,name:payload.name||undefined,properties:payload.properties,options:payload.options,callback:payload.callback});}},{key:"identify",value:function identify(payload){var _this$userSessionMana3,_this$eventManager4;var type='identify';if(!state.lifecycle.loaded.value){state.eventBuffer.toBeProcessedArray.value=[].concat(_toConsumableArray(state.eventBuffer.toBeProcessedArray.value),[[type,payload]]);return;}this.errorHandler.leaveBreadcrumb("New ".concat(type," event"));state.metrics.triggered.value+=1;var shouldResetSession=Boolean(payload.userId&&state.session.userId.value&&payload.userId!==state.session.userId.value);if(shouldResetSession){this.reset();}// `null` value indicates that previous user ID needs to be retained
|
3958
3941
|
if(!isNull(payload.userId)){var _this$userSessionMana2;(_this$userSessionMana2=this.userSessionManager)===null||_this$userSessionMana2===void 0||_this$userSessionMana2.setUserId(payload.userId);}(_this$userSessionMana3=this.userSessionManager)===null||_this$userSessionMana3===void 0||_this$userSessionMana3.setUserTraits(payload.traits);(_this$eventManager4=this.eventManager)===null||_this$eventManager4===void 0||_this$eventManager4.addEvent({type:type,userId:payload.userId,traits:payload.traits,options:payload.options,callback:payload.callback});}},{key:"alias",value:function alias(payload){var _payload$from,_this$userSessionMana4,_this$eventManager5;var type='alias';if(!state.lifecycle.loaded.value){state.eventBuffer.toBeProcessedArray.value=[].concat(_toConsumableArray(state.eventBuffer.toBeProcessedArray.value),[[type,payload]]);return;}this.errorHandler.leaveBreadcrumb("New ".concat(type," event"));state.metrics.triggered.value+=1;var previousId=(_payload$from=payload.from)!==null&&_payload$from!==void 0?_payload$from:this.getUserId()||((_this$userSessionMana4=this.userSessionManager)===null||_this$userSessionMana4===void 0?void 0:_this$userSessionMana4.getAnonymousId());(_this$eventManager5=this.eventManager)===null||_this$eventManager5===void 0||_this$eventManager5.addEvent({type:type,to:payload.to,from:previousId,options:payload.options,callback:payload.callback});}},{key:"group",value:function group(payload){var _this$userSessionMana6,_this$eventManager6;var type='group';if(!state.lifecycle.loaded.value){state.eventBuffer.toBeProcessedArray.value=[].concat(_toConsumableArray(state.eventBuffer.toBeProcessedArray.value),[[type,payload]]);return;}this.errorHandler.leaveBreadcrumb("New ".concat(type," event"));state.metrics.triggered.value+=1;// `null` value indicates that previous group ID needs to be retained
|
3959
|
-
if(!isNull(payload.groupId)){var _this$userSessionMana5;(_this$userSessionMana5=this.userSessionManager)===null||_this$userSessionMana5===void 0||_this$userSessionMana5.setGroupId(payload.groupId);}(_this$userSessionMana6=this.userSessionManager)===null||_this$userSessionMana6===void 0||_this$userSessionMana6.setGroupTraits(payload.traits);(_this$eventManager6=this.eventManager)===null||_this$eventManager6===void 0||_this$eventManager6.addEvent({type:type,groupId:payload.groupId,traits:payload.traits,options:payload.options,callback:payload.callback});}},{key:"reset",value:function reset(
|
3942
|
+
if(!isNull(payload.groupId)){var _this$userSessionMana5;(_this$userSessionMana5=this.userSessionManager)===null||_this$userSessionMana5===void 0||_this$userSessionMana5.setGroupId(payload.groupId);}(_this$userSessionMana6=this.userSessionManager)===null||_this$userSessionMana6===void 0||_this$userSessionMana6.setGroupTraits(payload.traits);(_this$eventManager6=this.eventManager)===null||_this$eventManager6===void 0||_this$eventManager6.addEvent({type:type,groupId:payload.groupId,traits:payload.traits,options:payload.options,callback:payload.callback});}},{key:"reset",value:function reset(resetAnonymousId){var _this$userSessionMana7;var type='reset';if(!state.lifecycle.loaded.value){state.eventBuffer.toBeProcessedArray.value=[].concat(_toConsumableArray(state.eventBuffer.toBeProcessedArray.value),[[type,resetAnonymousId]]);return;}this.errorHandler.leaveBreadcrumb("New ".concat(type," invocation, resetAnonymousId: ").concat(resetAnonymousId));(_this$userSessionMana7=this.userSessionManager)===null||_this$userSessionMana7===void 0||_this$userSessionMana7.reset(resetAnonymousId);}},{key:"getAnonymousId",value:function getAnonymousId(options){var _this$userSessionMana8;return (_this$userSessionMana8=this.userSessionManager)===null||_this$userSessionMana8===void 0?void 0:_this$userSessionMana8.getAnonymousId(options);}},{key:"setAnonymousId",value:function setAnonymousId(anonymousId,rudderAmpLinkerParam){var _this$userSessionMana9;var type='setAnonymousId';// Buffering is needed as setting the anonymous ID may require invoking the GoogleLinker plugin
|
3960
3943
|
if(!state.lifecycle.loaded.value){state.eventBuffer.toBeProcessedArray.value=[].concat(_toConsumableArray(state.eventBuffer.toBeProcessedArray.value),[[type,anonymousId,rudderAmpLinkerParam]]);return;}this.errorHandler.leaveBreadcrumb("New ".concat(type," invocation"));(_this$userSessionMana9=this.userSessionManager)===null||_this$userSessionMana9===void 0||_this$userSessionMana9.setAnonymousId(anonymousId,rudderAmpLinkerParam);}// eslint-disable-next-line class-methods-use-this
|
3961
3944
|
},{key:"getUserId",value:function getUserId(){return state.session.userId.value;}// eslint-disable-next-line class-methods-use-this
|
3962
3945
|
},{key:"getUserTraits",value:function getUserTraits(){return state.session.userTraits.value;}// eslint-disable-next-line class-methods-use-this
|
@@ -4054,29 +4037,7 @@ this.load.apply(null,loadEvent);}}/**
|
|
4054
4037
|
},{key:"alias",value:function alias(to,from,options,callback){try{var _this$getAnalyticsIns6;(_this$getAnalyticsIns6=this.getAnalyticsInstance())===null||_this$getAnalyticsIns6===void 0||_this$getAnalyticsIns6.alias(aliasArgumentsToCallOptions(getSanitizedValue(to),getSanitizedValue(from),getSanitizedValue(options),getSanitizedValue(callback)));}catch(error){dispatchErrorEvent(error);}}/**
|
4055
4038
|
* Process group arguments and forward to page call
|
4056
4039
|
*/// These overloads should be same as AnalyticsGroupMethod in @rudderstack/analytics-js-common/types/IRudderAnalytics
|
4057
|
-
},{key:"group",value:function group(groupId,traits,options,callback){try{var _this$getAnalyticsIns7;(_this$getAnalyticsIns7=this.getAnalyticsInstance())===null||_this$getAnalyticsIns7===void 0||_this$getAnalyticsIns7.group(groupArgumentsToCallOptions(getSanitizedValue(groupId),getSanitizedValue(traits),getSanitizedValue(options),getSanitizedValue(callback)));}catch(error){dispatchErrorEvent(error);}}
|
4058
|
-
* Reset the analytics instance
|
4059
|
-
* @param options Reset options. Except for anonymousId, initialReferrer, and initialReferringDomain
|
4060
|
-
* all other values will be reset by default.
|
4061
|
-
* @example
|
4062
|
-
* ```ts
|
4063
|
-
* reset({
|
4064
|
-
* entries: {
|
4065
|
-
* anonymousId: true,
|
4066
|
-
* }
|
4067
|
-
* });
|
4068
|
-
* ```
|
4069
|
-
* @example
|
4070
|
-
* ```ts
|
4071
|
-
* reset({
|
4072
|
-
* entries: {
|
4073
|
-
* userId: false,
|
4074
|
-
* sessionInfo: false,
|
4075
|
-
* }
|
4076
|
-
* });
|
4077
|
-
* ```
|
4078
|
-
* @returns none
|
4079
|
-
*/},{key:"reset",value:function reset(options){try{var _this$getAnalyticsIns8;(_this$getAnalyticsIns8=this.getAnalyticsInstance())===null||_this$getAnalyticsIns8===void 0||_this$getAnalyticsIns8.reset(getSanitizedValue(options));}catch(error){dispatchErrorEvent(error);}}},{key:"getAnonymousId",value:function getAnonymousId(options){try{var _this$getAnalyticsIns9;return (_this$getAnalyticsIns9=this.getAnalyticsInstance())===null||_this$getAnalyticsIns9===void 0?void 0:_this$getAnalyticsIns9.getAnonymousId(getSanitizedValue(options));}catch(error){dispatchErrorEvent(error);return undefined;}}},{key:"setAnonymousId",value:function setAnonymousId(anonymousId,rudderAmpLinkerParam){try{var _this$getAnalyticsIns0;(_this$getAnalyticsIns0=this.getAnalyticsInstance())===null||_this$getAnalyticsIns0===void 0||_this$getAnalyticsIns0.setAnonymousId(getSanitizedValue(anonymousId),getSanitizedValue(rudderAmpLinkerParam));}catch(error){dispatchErrorEvent(error);}}},{key:"getUserId",value:function getUserId(){try{var _this$getAnalyticsIns1;return (_this$getAnalyticsIns1=this.getAnalyticsInstance())===null||_this$getAnalyticsIns1===void 0?void 0:_this$getAnalyticsIns1.getUserId();}catch(error){dispatchErrorEvent(error);return undefined;}}},{key:"getUserTraits",value:function getUserTraits(){try{var _this$getAnalyticsIns10;return (_this$getAnalyticsIns10=this.getAnalyticsInstance())===null||_this$getAnalyticsIns10===void 0?void 0:_this$getAnalyticsIns10.getUserTraits();}catch(error){dispatchErrorEvent(error);return undefined;}}},{key:"getGroupId",value:function getGroupId(){try{var _this$getAnalyticsIns11;return (_this$getAnalyticsIns11=this.getAnalyticsInstance())===null||_this$getAnalyticsIns11===void 0?void 0:_this$getAnalyticsIns11.getGroupId();}catch(error){dispatchErrorEvent(error);return undefined;}}},{key:"getGroupTraits",value:function getGroupTraits(){try{var _this$getAnalyticsIns12;return (_this$getAnalyticsIns12=this.getAnalyticsInstance())===null||_this$getAnalyticsIns12===void 0?void 0:_this$getAnalyticsIns12.getGroupTraits();}catch(error){dispatchErrorEvent(error);return undefined;}}},{key:"startSession",value:function startSession(sessionId){try{var _this$getAnalyticsIns13;(_this$getAnalyticsIns13=this.getAnalyticsInstance())===null||_this$getAnalyticsIns13===void 0||_this$getAnalyticsIns13.startSession(getSanitizedValue(sessionId));}catch(error){dispatchErrorEvent(error);}}},{key:"endSession",value:function endSession(){try{var _this$getAnalyticsIns14;(_this$getAnalyticsIns14=this.getAnalyticsInstance())===null||_this$getAnalyticsIns14===void 0||_this$getAnalyticsIns14.endSession();}catch(error){dispatchErrorEvent(error);}}},{key:"getSessionId",value:function getSessionId(){try{var _this$getAnalyticsIns15;return (_this$getAnalyticsIns15=this.getAnalyticsInstance())===null||_this$getAnalyticsIns15===void 0?void 0:_this$getAnalyticsIns15.getSessionId();}catch(error){dispatchErrorEvent(error);return undefined;}}},{key:"setAuthToken",value:function setAuthToken(token){try{var _this$getAnalyticsIns16;(_this$getAnalyticsIns16=this.getAnalyticsInstance())===null||_this$getAnalyticsIns16===void 0||_this$getAnalyticsIns16.setAuthToken(getSanitizedValue(token));}catch(error){dispatchErrorEvent(error);}}},{key:"consent",value:function consent(options){try{var _this$getAnalyticsIns17;(_this$getAnalyticsIns17=this.getAnalyticsInstance())===null||_this$getAnalyticsIns17===void 0||_this$getAnalyticsIns17.consent(getSanitizedValue(options));}catch(error){dispatchErrorEvent(error);}}},{key:"addCustomIntegration",value:function addCustomIntegration(destinationId,integration){try{var _this$getAnalyticsIns18;(_this$getAnalyticsIns18=this.getAnalyticsInstance())===null||_this$getAnalyticsIns18===void 0||_this$getAnalyticsIns18.addCustomIntegration(getSanitizedValue(destinationId),getSanitizedValue(integration));}catch(error){dispatchErrorEvent(error);}}}],[{key:"initializeGlobalResources",value:function initializeGlobalResources(){// We need to initialize the error handler first to catch any unhandled errors occurring in this module as well
|
4040
|
+
},{key:"group",value:function group(groupId,traits,options,callback){try{var _this$getAnalyticsIns7;(_this$getAnalyticsIns7=this.getAnalyticsInstance())===null||_this$getAnalyticsIns7===void 0||_this$getAnalyticsIns7.group(groupArgumentsToCallOptions(getSanitizedValue(groupId),getSanitizedValue(traits),getSanitizedValue(options),getSanitizedValue(callback)));}catch(error){dispatchErrorEvent(error);}}},{key:"reset",value:function reset(resetAnonymousId){try{var _this$getAnalyticsIns8;(_this$getAnalyticsIns8=this.getAnalyticsInstance())===null||_this$getAnalyticsIns8===void 0||_this$getAnalyticsIns8.reset(getSanitizedValue(resetAnonymousId));}catch(error){dispatchErrorEvent(error);}}},{key:"getAnonymousId",value:function getAnonymousId(options){try{var _this$getAnalyticsIns9;return (_this$getAnalyticsIns9=this.getAnalyticsInstance())===null||_this$getAnalyticsIns9===void 0?void 0:_this$getAnalyticsIns9.getAnonymousId(getSanitizedValue(options));}catch(error){dispatchErrorEvent(error);return undefined;}}},{key:"setAnonymousId",value:function setAnonymousId(anonymousId,rudderAmpLinkerParam){try{var _this$getAnalyticsIns0;(_this$getAnalyticsIns0=this.getAnalyticsInstance())===null||_this$getAnalyticsIns0===void 0||_this$getAnalyticsIns0.setAnonymousId(getSanitizedValue(anonymousId),getSanitizedValue(rudderAmpLinkerParam));}catch(error){dispatchErrorEvent(error);}}},{key:"getUserId",value:function getUserId(){try{var _this$getAnalyticsIns1;return (_this$getAnalyticsIns1=this.getAnalyticsInstance())===null||_this$getAnalyticsIns1===void 0?void 0:_this$getAnalyticsIns1.getUserId();}catch(error){dispatchErrorEvent(error);return undefined;}}},{key:"getUserTraits",value:function getUserTraits(){try{var _this$getAnalyticsIns10;return (_this$getAnalyticsIns10=this.getAnalyticsInstance())===null||_this$getAnalyticsIns10===void 0?void 0:_this$getAnalyticsIns10.getUserTraits();}catch(error){dispatchErrorEvent(error);return undefined;}}},{key:"getGroupId",value:function getGroupId(){try{var _this$getAnalyticsIns11;return (_this$getAnalyticsIns11=this.getAnalyticsInstance())===null||_this$getAnalyticsIns11===void 0?void 0:_this$getAnalyticsIns11.getGroupId();}catch(error){dispatchErrorEvent(error);return undefined;}}},{key:"getGroupTraits",value:function getGroupTraits(){try{var _this$getAnalyticsIns12;return (_this$getAnalyticsIns12=this.getAnalyticsInstance())===null||_this$getAnalyticsIns12===void 0?void 0:_this$getAnalyticsIns12.getGroupTraits();}catch(error){dispatchErrorEvent(error);return undefined;}}},{key:"startSession",value:function startSession(sessionId){try{var _this$getAnalyticsIns13;(_this$getAnalyticsIns13=this.getAnalyticsInstance())===null||_this$getAnalyticsIns13===void 0||_this$getAnalyticsIns13.startSession(getSanitizedValue(sessionId));}catch(error){dispatchErrorEvent(error);}}},{key:"endSession",value:function endSession(){try{var _this$getAnalyticsIns14;(_this$getAnalyticsIns14=this.getAnalyticsInstance())===null||_this$getAnalyticsIns14===void 0||_this$getAnalyticsIns14.endSession();}catch(error){dispatchErrorEvent(error);}}},{key:"getSessionId",value:function getSessionId(){try{var _this$getAnalyticsIns15;return (_this$getAnalyticsIns15=this.getAnalyticsInstance())===null||_this$getAnalyticsIns15===void 0?void 0:_this$getAnalyticsIns15.getSessionId();}catch(error){dispatchErrorEvent(error);return undefined;}}},{key:"setAuthToken",value:function setAuthToken(token){try{var _this$getAnalyticsIns16;(_this$getAnalyticsIns16=this.getAnalyticsInstance())===null||_this$getAnalyticsIns16===void 0||_this$getAnalyticsIns16.setAuthToken(getSanitizedValue(token));}catch(error){dispatchErrorEvent(error);}}},{key:"consent",value:function consent(options){try{var _this$getAnalyticsIns17;(_this$getAnalyticsIns17=this.getAnalyticsInstance())===null||_this$getAnalyticsIns17===void 0||_this$getAnalyticsIns17.consent(getSanitizedValue(options));}catch(error){dispatchErrorEvent(error);}}},{key:"addCustomIntegration",value:function addCustomIntegration(destinationId,integration){try{var _this$getAnalyticsIns18;(_this$getAnalyticsIns18=this.getAnalyticsInstance())===null||_this$getAnalyticsIns18===void 0||_this$getAnalyticsIns18.addCustomIntegration(getSanitizedValue(destinationId),getSanitizedValue(integration));}catch(error){dispatchErrorEvent(error);}}}],[{key:"initializeGlobalResources",value:function initializeGlobalResources(){// We need to initialize the error handler first to catch any unhandled errors occurring in this module as well
|
4080
4041
|
defaultErrorHandler.init();// Initialize the storage engines with default options
|
4081
4042
|
defaultCookieStorage.configure();defaultLocalStorage.configure();defaultSessionStorage.configure();defaultInMemoryStorage.configure();}}]);}();// START-NO-SONAR-SCAN
|
4082
4043
|
// eslint-disable-next-line sonarjs/public-static-readonly
|