@rudderstack/analytics-js 3.7.19 → 3.9.0
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/CHANGELOG.md +25 -0
- package/dist/npm/index.d.cts +48 -7
- package/dist/npm/index.d.mts +48 -7
- package/dist/npm/legacy/bundled/cjs/index.cjs +256 -144
- package/dist/npm/legacy/bundled/esm/index.mjs +256 -144
- package/dist/npm/legacy/bundled/umd/index.js +256 -144
- package/dist/npm/legacy/cjs/index.cjs +256 -144
- package/dist/npm/legacy/content-script/cjs/index.cjs +256 -144
- package/dist/npm/legacy/content-script/esm/index.mjs +256 -144
- package/dist/npm/legacy/content-script/umd/index.js +256 -144
- package/dist/npm/legacy/esm/index.mjs +256 -144
- package/dist/npm/legacy/umd/index.js +256 -144
- package/dist/npm/modern/bundled/cjs/index.cjs +223 -143
- package/dist/npm/modern/bundled/esm/index.mjs +223 -143
- package/dist/npm/modern/bundled/umd/index.js +223 -143
- package/dist/npm/modern/cjs/index.cjs +98 -44
- package/dist/npm/modern/content-script/cjs/index.cjs +223 -143
- package/dist/npm/modern/content-script/esm/index.mjs +223 -143
- package/dist/npm/modern/content-script/umd/index.js +223 -143
- package/dist/npm/modern/esm/index.mjs +98 -44
- package/dist/npm/modern/umd/index.js +98 -44
- package/package.json +1 -1
@@ -9,6 +9,9 @@
|
|
9
9
|
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
10
10
|
return n;
|
11
11
|
}
|
12
|
+
function _arrayWithHoles(r) {
|
13
|
+
if (Array.isArray(r)) return r;
|
14
|
+
}
|
12
15
|
function _arrayWithoutHoles(r) {
|
13
16
|
if (Array.isArray(r)) return _arrayLikeToArray(r);
|
14
17
|
}
|
@@ -158,6 +161,33 @@
|
|
158
161
|
function _iterableToArray(r) {
|
159
162
|
if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
|
160
163
|
}
|
164
|
+
function _iterableToArrayLimit(r, l) {
|
165
|
+
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
166
|
+
if (null != t) {
|
167
|
+
var e,
|
168
|
+
n,
|
169
|
+
i,
|
170
|
+
u,
|
171
|
+
a = [],
|
172
|
+
f = !0,
|
173
|
+
o = !1;
|
174
|
+
try {
|
175
|
+
if (i = (t = t.call(r)).next, 0 === l) ; else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
|
176
|
+
} catch (r) {
|
177
|
+
o = !0, n = r;
|
178
|
+
} finally {
|
179
|
+
try {
|
180
|
+
if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
|
181
|
+
} finally {
|
182
|
+
if (o) throw n;
|
183
|
+
}
|
184
|
+
}
|
185
|
+
return a;
|
186
|
+
}
|
187
|
+
}
|
188
|
+
function _nonIterableRest() {
|
189
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
190
|
+
}
|
161
191
|
function _nonIterableSpread() {
|
162
192
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
163
193
|
}
|
@@ -493,6 +523,9 @@
|
|
493
523
|
return t.__proto__ = e, t;
|
494
524
|
}, _setPrototypeOf(t, e);
|
495
525
|
}
|
526
|
+
function _slicedToArray(r, e) {
|
527
|
+
return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
|
528
|
+
}
|
496
529
|
function _superPropBase(t, o) {
|
497
530
|
for (; !{}.hasOwnProperty.call(t, o) && null !== (t = _getPrototypeOf(t)););
|
498
531
|
return t;
|
@@ -907,9 +940,50 @@
|
|
907
940
|
// Also, to clone the incoming object type arguments
|
908
941
|
payload.groupId=tryStringify(payload.groupId);if(isObjectLiteralAndNotNull(payload.traits)){payload.traits=clone(payload.traits);}else {payload.traits=undefined;}if(isDefined(payload.options)){payload.options=clone(payload.options);}else {payload.options=undefined;}return payload;};
|
909
942
|
|
943
|
+
/**
|
944
|
+
* Represents the options parameter for anonymousId
|
945
|
+
*//**
|
946
|
+
* Represents the beacon queue options parameter in loadOptions type
|
947
|
+
*//**
|
948
|
+
* Represents the queue options parameter in loadOptions type
|
949
|
+
*//**
|
950
|
+
* Represents the destinations queue options parameter in loadOptions type
|
951
|
+
*/var PageLifecycleEvents=/*#__PURE__*/function(PageLifecycleEvents){PageLifecycleEvents["LOADED"]="Page Loaded";PageLifecycleEvents["UNLOADED"]="Page Unloaded";return PageLifecycleEvents;}({});/**
|
952
|
+
* Represents the options parameter in the load API
|
953
|
+
*/
|
954
|
+
|
910
955
|
var CAPABILITIES_MANAGER='CapabilitiesManager';var CONFIG_MANAGER='ConfigManager';var EVENT_MANAGER='EventManager';var PLUGINS_MANAGER='PluginsManager';var USER_SESSION_MANAGER='UserSessionManager';var ERROR_HANDLER='ErrorHandler';var PLUGIN_ENGINE='PluginEngine';var STORE_MANAGER='StoreManager';var READY_API='readyApi';var EVENT_REPOSITORY='EventRepository';var EXTERNAL_SRC_LOADER='ExternalSrcLoader';var HTTP_CLIENT='HttpClient';var RS_APP='RudderStackApplication';var ANALYTICS_CORE='AnalyticsCore';
|
911
956
|
|
912
|
-
|
957
|
+
function random(len){return crypto.getRandomValues(new Uint8Array(len));}
|
958
|
+
|
959
|
+
var SIZE=4096,HEX$1=[],IDX$1=0,BUFFER$1;for(;IDX$1<256;IDX$1++){HEX$1[IDX$1]=(IDX$1+256).toString(16).substring(1);}function v4$1(){if(!BUFFER$1||IDX$1+16>SIZE){BUFFER$1=random(SIZE);IDX$1=0;}var i=0,tmp,out='';for(;i<16;i++){tmp=BUFFER$1[IDX$1+i];if(i==6)out+=HEX$1[tmp&15|64];else if(i==8)out+=HEX$1[tmp&63|128];else out+=HEX$1[tmp];if(i&1&&i>1&&i<11)out+='-';}IDX$1+=16;return out;}
|
960
|
+
|
961
|
+
var IDX=256,HEX=[],BUFFER;while(IDX--)HEX[IDX]=(IDX+256).toString(16).substring(1);function v4(){var i=0,num,out='';if(!BUFFER||IDX+16>256){BUFFER=Array(i=256);while(i--)BUFFER[i]=256*Math.random()|0;i=IDX=0;}for(;i<16;i++){num=BUFFER[IDX+i];if(i==6)out+=HEX[num&15|64];else if(i==8)out+=HEX[num&63|128];else out+=HEX[num];if(i&1&&i>1&&i<11)out+='-';}IDX++;return out;}
|
962
|
+
|
963
|
+
var hasCrypto$1=function hasCrypto(){return !isNullOrUndefined(globalThis.crypto)&&isFunction(globalThis.crypto.getRandomValues);};
|
964
|
+
|
965
|
+
var generateUUID=function generateUUID(){if(hasCrypto$1()){return v4$1();}return v4();};
|
966
|
+
|
967
|
+
var onPageLeave=function onPageLeave(callback){// To ensure the callback is only called once even if more than one events
|
968
|
+
// are fired at once.
|
969
|
+
var pageLeft=false;var isAccessible=false;function handleOnLeave(){if(pageLeft){return;}pageLeft=true;callback(isAccessible);// Reset pageLeft on the next tick
|
970
|
+
// to ensure callback executes for other listeners
|
971
|
+
// when closing an inactive browser tab.
|
972
|
+
setTimeout(function(){pageLeft=false;},0);}// Catches the unloading of the page (e.g., closing the tab or navigating away).
|
973
|
+
// Includes user actions like clicking a link, entering a new URL,
|
974
|
+
// refreshing the page, or closing the browser tab
|
975
|
+
// Note that 'pagehide' is not supported in IE.
|
976
|
+
// So, this is a fallback.
|
977
|
+
globalThis.addEventListener('beforeunload',function(){isAccessible=false;handleOnLeave();});globalThis.addEventListener('blur',function(){isAccessible=true;handleOnLeave();});globalThis.addEventListener('focus',function(){pageLeft=false;});// Catches the page being hidden, including scenarios like closing the tab.
|
978
|
+
document.addEventListener('pagehide',function(){isAccessible=document.visibilityState==='hidden';handleOnLeave();});// Catches visibility changes, such as switching tabs or minimizing the browser.
|
979
|
+
document.addEventListener('visibilitychange',function(){isAccessible=true;if(document.visibilityState==='hidden'){handleOnLeave();}else {pageLeft=false;}});};
|
980
|
+
|
981
|
+
var getFormattedTimestamp=function getFormattedTimestamp(date){return date.toISOString();};/**
|
982
|
+
* To get the current timestamp in ISO string format
|
983
|
+
* @returns ISO formatted timestamp string
|
984
|
+
*/var getCurrentTimeFormatted=function getCurrentTimeFormatted(){return getFormattedTimestamp(new Date());};
|
985
|
+
|
986
|
+
var APP_NAME='RudderLabs JavaScript SDK';var APP_VERSION='3.9.0';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';
|
913
987
|
|
914
988
|
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';
|
915
989
|
|
@@ -1029,7 +1103,7 @@
|
|
1029
1103
|
* A buffer queue to serve as a store for any type of data
|
1030
1104
|
*/var BufferQueue=/*#__PURE__*/function(){function BufferQueue(){_classCallCheck(this,BufferQueue);this.items=[];}return _createClass(BufferQueue,[{key:"enqueue",value:function enqueue(item){this.items.push(item);}},{key:"dequeue",value:function dequeue(){if(this.items.length===0){return null;}return this.items.shift();}},{key:"isEmpty",value:function isEmpty(){return this.items.length===0;}},{key:"size",value:function size(){return this.items.length;}},{key:"clear",value:function clear(){this.items=[];}}]);}();
|
1031
1105
|
|
1032
|
-
var LOG_LEVEL_MAP={LOG:0,INFO:1,DEBUG:2,WARN:3,ERROR:4,NONE:5};var DEFAULT_LOG_LEVEL='ERROR';var LOG_MSG_PREFIX='RS SDK';var LOG_MSG_PREFIX_STYLE='font-weight: bold; background: black; color: white;';var LOG_MSG_STYLE='font-weight: normal;';/**
|
1106
|
+
var LOG_LEVEL_MAP={LOG:0,INFO:1,DEBUG:2,WARN:3,ERROR:4,NONE:5};var DEFAULT_LOG_LEVEL='LOG';var POST_LOAD_LOG_LEVEL='ERROR';var LOG_MSG_PREFIX='RS SDK';var LOG_MSG_PREFIX_STYLE='font-weight: bold; background: black; color: white;';var LOG_MSG_STYLE='font-weight: normal;';/**
|
1033
1107
|
* Service to log messages/data to output provider, default is console
|
1034
1108
|
*/var Logger=/*#__PURE__*/function(){function Logger(){var minLogLevel=arguments.length>0&&arguments[0]!==undefined?arguments[0]:DEFAULT_LOG_LEVEL;var scope=arguments.length>1&&arguments[1]!==undefined?arguments[1]:'';var logProvider=arguments.length>2&&arguments[2]!==undefined?arguments[2]:console;_classCallCheck(this,Logger);this.minLogLevel=LOG_LEVEL_MAP[minLogLevel];this.scope=scope;this.logProvider=logProvider;}return _createClass(Logger,[{key:"log",value:function log(){for(var _len=arguments.length,data=new Array(_len),_key=0;_key<_len;_key++){data[_key]=arguments[_key];}this.outputLog('LOG',data);}},{key:"info",value:function info(){for(var _len2=arguments.length,data=new Array(_len2),_key2=0;_key2<_len2;_key2++){data[_key2]=arguments[_key2];}this.outputLog('INFO',data);}},{key:"debug",value:function debug(){for(var _len3=arguments.length,data=new Array(_len3),_key3=0;_key3<_len3;_key3++){data[_key3]=arguments[_key3];}this.outputLog('DEBUG',data);}},{key:"warn",value:function warn(){for(var _len4=arguments.length,data=new Array(_len4),_key4=0;_key4<_len4;_key4++){data[_key4]=arguments[_key4];}this.outputLog('WARN',data);}},{key:"error",value:function error(){for(var _len5=arguments.length,data=new Array(_len5),_key5=0;_key5<_len5;_key5++){data[_key5]=arguments[_key5];}this.outputLog('ERROR',data);}},{key:"outputLog",value:function outputLog(logMethod,data){if(this.minLogLevel<=LOG_LEVEL_MAP[logMethod]){var _this$logProvider,_this$logProvider2;(_this$logProvider=(_this$logProvider2=this.logProvider)[logMethod.toLowerCase()])===null||_this$logProvider===void 0||_this$logProvider.call.apply(_this$logProvider,[_this$logProvider2].concat(_toConsumableArray(this.formatLogData(data))));}}},{key:"setScope",value:function setScope(scopeVal){this.scope=scopeVal||this.scope;}// TODO: should we allow to change the level via global variable on run time
|
1035
1109
|
// to assist on the fly debugging?
|
@@ -1052,7 +1126,7 @@
|
|
1052
1126
|
|
1053
1127
|
var SOURCE_CONFIG_OPTION_ERROR="\"getSourceConfig\" must be a function. Please make sure that it is defined and returns a valid source configuration object.";var SOURCE_CONFIG_RESOLUTION_ERROR="Unable to process/parse source configuration response.";var SOURCE_DISABLED_ERROR="The source is disabled. Please enable the source in the dashboard to send events.";var XHR_PAYLOAD_PREP_ERROR="Failed to prepare data for the request.";var EVENT_OBJECT_GENERATION_ERROR="Failed to generate the event object.";var PLUGIN_EXT_POINT_MISSING_ERROR="Failed to invoke plugin because the extension point name is missing.";var PLUGIN_EXT_POINT_INVALID_ERROR="Failed to invoke plugin because the extension point name is invalid.";var COMPONENT_BASE_URL_ERROR=function COMPONENT_BASE_URL_ERROR(component){return "Failed to load the SDK as the base URL for ".concat(component," is not valid.");};// ERROR
|
1054
1128
|
var UNSUPPORTED_CONSENT_MANAGER_ERROR=function UNSUPPORTED_CONSENT_MANAGER_ERROR(context,selectedConsentManager,consentManagersToPluginNameMap){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"The consent manager \"").concat(selectedConsentManager,"\" is not supported. Please choose one of the following supported consent managers: \"").concat(Object.keys(consentManagersToPluginNameMap),"\".");};var REPORTING_PLUGIN_INIT_FAILURE_ERROR=function REPORTING_PLUGIN_INIT_FAILURE_ERROR(context){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"Failed to initialize the error reporting plugin.");};var NOTIFY_FAILURE_ERROR=function NOTIFY_FAILURE_ERROR(context){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"Failed to notify the error.");};var PLUGIN_NAME_MISSING_ERROR=function PLUGIN_NAME_MISSING_ERROR(context){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"Plugin name is missing.");};var PLUGIN_ALREADY_EXISTS_ERROR=function PLUGIN_ALREADY_EXISTS_ERROR(context,pluginName){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"Plugin \"").concat(pluginName,"\" already exists.");};var PLUGIN_NOT_FOUND_ERROR=function PLUGIN_NOT_FOUND_ERROR(context,pluginName){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"Plugin \"").concat(pluginName,"\" not found.");};var PLUGIN_ENGINE_BUG_ERROR=function PLUGIN_ENGINE_BUG_ERROR(context,pluginName){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"Plugin \"").concat(pluginName,"\" not found in plugins but found in byName. This indicates a bug in the plugin engine. Please report this issue to the development team.");};var PLUGIN_DEPS_ERROR=function PLUGIN_DEPS_ERROR(context,pluginName,notExistDeps){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"Plugin \"").concat(pluginName,"\" could not be loaded because some of its dependencies \"").concat(notExistDeps,"\" do not exist.");};var PLUGIN_INVOCATION_ERROR=function PLUGIN_INVOCATION_ERROR(context,extPoint,pluginName){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"Failed to invoke the \"").concat(extPoint,"\" extension point of plugin \"").concat(pluginName,"\".");};var STORAGE_UNAVAILABILITY_ERROR_PREFIX=function STORAGE_UNAVAILABILITY_ERROR_PREFIX(context,storageType){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"The \"").concat(storageType,"\" storage type is ");};var SOURCE_CONFIG_FETCH_ERROR=function SOURCE_CONFIG_FETCH_ERROR(reason){return "Failed to fetch the source config. Reason: ".concat(reason);};var WRITE_KEY_VALIDATION_ERROR=function WRITE_KEY_VALIDATION_ERROR(writeKey){return "The write key \"".concat(writeKey,"\" is invalid. It must be a non-empty string. Please check that the write key is correct and try again.");};var DATA_PLANE_URL_VALIDATION_ERROR=function DATA_PLANE_URL_VALIDATION_ERROR(dataPlaneUrl){return "The data plane URL \"".concat(dataPlaneUrl,"\" is invalid. It must be a valid URL string. Please check that the data plane URL is correct and try again.");};var READY_API_CALLBACK_ERROR=function READY_API_CALLBACK_ERROR(context){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"The callback is not a function.");};var XHR_DELIVERY_ERROR=function XHR_DELIVERY_ERROR(prefix,status,statusText,url){return "".concat(prefix," with status: ").concat(status,", ").concat(statusText," for URL: ").concat(url,".");};var XHR_REQUEST_ERROR=function XHR_REQUEST_ERROR(prefix,e,url){return "".concat(prefix," due to timeout or no connection (").concat(e?e.type:'',") for URL: ").concat(url,".");};var XHR_SEND_ERROR=function XHR_SEND_ERROR(prefix,url){return "".concat(prefix," for URL: ").concat(url);};var STORE_DATA_SAVE_ERROR=function STORE_DATA_SAVE_ERROR(key){return "Failed to save the value for \"".concat(key,"\" to storage");};var STORE_DATA_FETCH_ERROR=function STORE_DATA_FETCH_ERROR(key){return "Failed to retrieve or parse data for \"".concat(key,"\" from storage");};var DATA_SERVER_REQUEST_FAIL_ERROR=function DATA_SERVER_REQUEST_FAIL_ERROR(status){return "The server responded with status ".concat(status," while setting the cookies. As a fallback, the cookies will be set client side.");};var FAILED_SETTING_COOKIE_FROM_SERVER_ERROR=function FAILED_SETTING_COOKIE_FROM_SERVER_ERROR(key){return "The server failed to set the ".concat(key," cookie. As a fallback, the cookies will be set client side.");};var FAILED_SETTING_COOKIE_FROM_SERVER_GLOBAL_ERROR="Failed to set/remove cookies via server. As a fallback, the cookies will be managed client side.";// WARNING
|
1055
|
-
var STORAGE_TYPE_VALIDATION_WARNING=function STORAGE_TYPE_VALIDATION_WARNING(context,storageType,defaultStorageType){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"The storage type \"").concat(storageType,"\" is not supported. Please choose one of the following supported types: \"").concat(SUPPORTED_STORAGE_TYPES,"\". The default type \"").concat(defaultStorageType,"\" will be used instead.");};var UNSUPPORTED_STORAGE_ENCRYPTION_VERSION_WARNING=function UNSUPPORTED_STORAGE_ENCRYPTION_VERSION_WARNING(context,selectedStorageEncryptionVersion,storageEncryptionVersionsToPluginNameMap,defaultVersion){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"The storage encryption version \"").concat(selectedStorageEncryptionVersion,"\" is not supported. Please choose one of the following supported versions: \"").concat(Object.keys(storageEncryptionVersionsToPluginNameMap),"\". The default version \"").concat(defaultVersion,"\" will be used instead.");};var STORAGE_DATA_MIGRATION_OVERRIDE_WARNING=function STORAGE_DATA_MIGRATION_OVERRIDE_WARNING(context,storageEncryptionVersion,defaultVersion){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"The storage data migration has been disabled because the configured storage encryption version (").concat(storageEncryptionVersion,") is not the latest (").concat(defaultVersion,"). To enable storage data migration, please update the storage encryption version to the latest version.");};var SERVER_SIDE_COOKIE_FEATURE_OVERRIDE_WARNING=function SERVER_SIDE_COOKIE_FEATURE_OVERRIDE_WARNING(context,providedCookieDomain,currentCookieDomain){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"The provided cookie domain (").concat(providedCookieDomain,") does not match the current webpage's domain (").concat(currentCookieDomain,"). Hence, the cookies will be set client-side.");};var RESERVED_KEYWORD_WARNING=function RESERVED_KEYWORD_WARNING(context,property,parentKeyPath,reservedElements){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"The \"").concat(property,"\" property defined under \"").concat(parentKeyPath,"\" is a reserved keyword. Please choose a different property name to avoid conflicts with reserved keywords (").concat(reservedElements,").");};var UNSUPPORTED_BEACON_API_WARNING=function UNSUPPORTED_BEACON_API_WARNING(context){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"The Beacon API is not supported by your browser. The events will be sent using XHR instead.");};var TIMEOUT_NOT_NUMBER_WARNING=function TIMEOUT_NOT_NUMBER_WARNING(context,timeout,defaultValue){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"The session timeout value \"").concat(timeout,"\" is not a number. The default timeout of ").concat(defaultValue," ms will be used instead.");};var TIMEOUT_ZERO_WARNING=function TIMEOUT_ZERO_WARNING(context){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"The session timeout value is 0, which disables the automatic session tracking feature. If you want to enable session tracking, please provide a positive integer value for the timeout.");};var TIMEOUT_NOT_RECOMMENDED_WARNING=function TIMEOUT_NOT_RECOMMENDED_WARNING(context,timeout,minTimeout){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"The session timeout value ").concat(timeout," ms is less than the recommended minimum of ").concat(minTimeout," ms. Please consider increasing the timeout value to ensure optimal performance and reliability.");};var INVALID_SESSION_ID_WARNING=function INVALID_SESSION_ID_WARNING(context,sessionId,minSessionIdLength){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"The provided session ID (").concat(sessionId,") is either invalid, not a positive integer, or not at least \"").concat(minSessionIdLength,"\" digits long. A new session ID will be auto-generated instead.");};var STORAGE_QUOTA_EXCEEDED_WARNING=function STORAGE_QUOTA_EXCEEDED_WARNING(context){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"The storage is either full or unavailable, so the data will not be persisted. Switching to in-memory storage.");};var STORAGE_UNAVAILABLE_WARNING=function STORAGE_UNAVAILABLE_WARNING(context,entry,selectedStorageType,finalStorageType){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"The storage type \"").concat(selectedStorageType,"\" is not available for entry \"").concat(entry,"\". The SDK will initialize the entry with \"").concat(finalStorageType,"\" storage type instead.");};var WRITE_KEY_NOT_A_STRING_ERROR=function WRITE_KEY_NOT_A_STRING_ERROR(context,writeKey){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"The write key \"").concat(writeKey,"\" is not a string. Please check that the write key is correct and try again.");};var EMPTY_GROUP_CALL_ERROR=function EMPTY_GROUP_CALL_ERROR(context){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"The group() method must be called with at least one argument.");};var READY_CALLBACK_INVOKE_ERROR="Failed to invoke the ready callback";var API_CALLBACK_INVOKE_ERROR="API Callback Invocation Failed";var NATIVE_DEST_PLUGIN_INITIALIZE_ERROR="NativeDestinationQueuePlugin initialization failed";var DATAPLANE_PLUGIN_INITIALIZE_ERROR="XhrQueuePlugin initialization failed";var DMT_PLUGIN_INITIALIZE_ERROR="DeviceModeTransformationPlugin initialization failed";var NATIVE_DEST_PLUGIN_ENQUEUE_ERROR="NativeDestinationQueuePlugin event enqueue failed";var DATAPLANE_PLUGIN_ENQUEUE_ERROR="XhrQueuePlugin event enqueue failed";var INVALID_CONFIG_URL_WARNING=function INVALID_CONFIG_URL_WARNING(context,configUrl){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"The provided source config URL \"").concat(configUrl,"\" is invalid. Using the default source config URL instead.");};var POLYFILL_SCRIPT_LOAD_ERROR=function POLYFILL_SCRIPT_LOAD_ERROR(scriptId,url){return "Failed to load the polyfill script with ID \"".concat(scriptId,"\" from URL ").concat(url,".");};var UNSUPPORTED_PRE_CONSENT_STORAGE_STRATEGY=function UNSUPPORTED_PRE_CONSENT_STORAGE_STRATEGY(context,selectedStrategy,defaultStrategy){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"The pre-consent storage strategy \"").concat(selectedStrategy,"\" is not supported. Please choose one of the following supported strategies: \"none, session, anonymousId\". The default strategy \"").concat(defaultStrategy,"\" will be used instead.");};var UNSUPPORTED_PRE_CONSENT_EVENTS_DELIVERY_TYPE=function UNSUPPORTED_PRE_CONSENT_EVENTS_DELIVERY_TYPE(context,selectedDeliveryType,defaultDeliveryType){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"The pre-consent events delivery type \"").concat(selectedDeliveryType,"\" is not supported. Please choose one of the following supported types: \"immediate, buffer\". The default type \"").concat(defaultDeliveryType,"\" will be used instead.");};var generateMisconfiguredPluginsWarning=function generateMisconfiguredPluginsWarning(context,configurationStatus,missingPlugins,shouldAddMissingPlugins){var isSinglePlugin=missingPlugins.length===1;var pluginsString=isSinglePlugin?" '".concat(missingPlugins[0],"' plugin was"):" ['".concat(missingPlugins.join("', '"),"'] plugins were");var baseWarning="".concat(context).concat(LOG_CONTEXT_SEPARATOR).concat(configurationStatus,", but").concat(pluginsString," not configured to load.");if(shouldAddMissingPlugins){return "".concat(baseWarning," So, ").concat(isSinglePlugin?'the plugin':'those plugins'," will be loaded automatically.");}return "".concat(baseWarning," Ignore if this was intentional. Otherwise, consider adding ").concat(isSinglePlugin?'it':'them'," to the 'plugins' load API option.");};var INVALID_POLYFILL_URL_WARNING=function INVALID_POLYFILL_URL_WARNING(context,customPolyfillUrl){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"The provided polyfill URL \"").concat(customPolyfillUrl,"\" is invalid. The default polyfill URL will be used instead.");};var BAD_COOKIES_WARNING=function BAD_COOKIES_WARNING(key){return "The cookie data for ".concat(key," seems to be encrypted using SDK versions < v3. The data is dropped. This can potentially stem from using SDK versions < v3 on other sites or web pages that can share cookies with this webpage. We recommend using the same SDK (v3) version everywhere or avoid disabling the storage data migration.");};
|
1129
|
+
var STORAGE_TYPE_VALIDATION_WARNING=function STORAGE_TYPE_VALIDATION_WARNING(context,storageType,defaultStorageType){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"The storage type \"").concat(storageType,"\" is not supported. Please choose one of the following supported types: \"").concat(SUPPORTED_STORAGE_TYPES,"\". The default type \"").concat(defaultStorageType,"\" will be used instead.");};var UNSUPPORTED_STORAGE_ENCRYPTION_VERSION_WARNING=function UNSUPPORTED_STORAGE_ENCRYPTION_VERSION_WARNING(context,selectedStorageEncryptionVersion,storageEncryptionVersionsToPluginNameMap,defaultVersion){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"The storage encryption version \"").concat(selectedStorageEncryptionVersion,"\" is not supported. Please choose one of the following supported versions: \"").concat(Object.keys(storageEncryptionVersionsToPluginNameMap),"\". The default version \"").concat(defaultVersion,"\" will be used instead.");};var STORAGE_DATA_MIGRATION_OVERRIDE_WARNING=function STORAGE_DATA_MIGRATION_OVERRIDE_WARNING(context,storageEncryptionVersion,defaultVersion){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"The storage data migration has been disabled because the configured storage encryption version (").concat(storageEncryptionVersion,") is not the latest (").concat(defaultVersion,"). To enable storage data migration, please update the storage encryption version to the latest version.");};var SERVER_SIDE_COOKIE_FEATURE_OVERRIDE_WARNING=function SERVER_SIDE_COOKIE_FEATURE_OVERRIDE_WARNING(context,providedCookieDomain,currentCookieDomain){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"The provided cookie domain (").concat(providedCookieDomain,") does not match the current webpage's domain (").concat(currentCookieDomain,"). Hence, the cookies will be set client-side.");};var RESERVED_KEYWORD_WARNING=function RESERVED_KEYWORD_WARNING(context,property,parentKeyPath,reservedElements){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"The \"").concat(property,"\" property defined under \"").concat(parentKeyPath,"\" is a reserved keyword. Please choose a different property name to avoid conflicts with reserved keywords (").concat(reservedElements,").");};var UNSUPPORTED_BEACON_API_WARNING=function UNSUPPORTED_BEACON_API_WARNING(context){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"The Beacon API is not supported by your browser. The events will be sent using XHR instead.");};var TIMEOUT_NOT_NUMBER_WARNING=function TIMEOUT_NOT_NUMBER_WARNING(context,timeout,defaultValue){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"The session timeout value \"").concat(timeout,"\" is not a number. The default timeout of ").concat(defaultValue," ms will be used instead.");};var TIMEOUT_ZERO_WARNING=function TIMEOUT_ZERO_WARNING(context){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"The session timeout value is 0, which disables the automatic session tracking feature. If you want to enable session tracking, please provide a positive integer value for the timeout.");};var TIMEOUT_NOT_RECOMMENDED_WARNING=function TIMEOUT_NOT_RECOMMENDED_WARNING(context,timeout,minTimeout){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"The session timeout value ").concat(timeout," ms is less than the recommended minimum of ").concat(minTimeout," ms. Please consider increasing the timeout value to ensure optimal performance and reliability.");};var INVALID_SESSION_ID_WARNING=function INVALID_SESSION_ID_WARNING(context,sessionId,minSessionIdLength){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"The provided session ID (").concat(sessionId,") is either invalid, not a positive integer, or not at least \"").concat(minSessionIdLength,"\" digits long. A new session ID will be auto-generated instead.");};var STORAGE_QUOTA_EXCEEDED_WARNING=function STORAGE_QUOTA_EXCEEDED_WARNING(context){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"The storage is either full or unavailable, so the data will not be persisted. Switching to in-memory storage.");};var STORAGE_UNAVAILABLE_WARNING=function STORAGE_UNAVAILABLE_WARNING(context,entry,selectedStorageType,finalStorageType){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"The storage type \"").concat(selectedStorageType,"\" is not available for entry \"").concat(entry,"\". The SDK will initialize the entry with \"").concat(finalStorageType,"\" storage type instead.");};var WRITE_KEY_NOT_A_STRING_ERROR=function WRITE_KEY_NOT_A_STRING_ERROR(context,writeKey){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"The write key \"").concat(writeKey,"\" is not a string. Please check that the write key is correct and try again.");};var EMPTY_GROUP_CALL_ERROR=function EMPTY_GROUP_CALL_ERROR(context){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"The group() method must be called with at least one argument.");};var READY_CALLBACK_INVOKE_ERROR="Failed to invoke the ready callback";var API_CALLBACK_INVOKE_ERROR="API Callback Invocation Failed";var NATIVE_DEST_PLUGIN_INITIALIZE_ERROR="NativeDestinationQueuePlugin initialization failed";var DATAPLANE_PLUGIN_INITIALIZE_ERROR="XhrQueuePlugin initialization failed";var DMT_PLUGIN_INITIALIZE_ERROR="DeviceModeTransformationPlugin initialization failed";var NATIVE_DEST_PLUGIN_ENQUEUE_ERROR="NativeDestinationQueuePlugin event enqueue failed";var DATAPLANE_PLUGIN_ENQUEUE_ERROR="XhrQueuePlugin event enqueue failed";var INVALID_CONFIG_URL_WARNING=function INVALID_CONFIG_URL_WARNING(context,configUrl){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"The provided source config URL \"").concat(configUrl,"\" is invalid. Using the default source config URL instead.");};var POLYFILL_SCRIPT_LOAD_ERROR=function POLYFILL_SCRIPT_LOAD_ERROR(scriptId,url){return "Failed to load the polyfill script with ID \"".concat(scriptId,"\" from URL ").concat(url,".");};var UNSUPPORTED_PRE_CONSENT_STORAGE_STRATEGY=function UNSUPPORTED_PRE_CONSENT_STORAGE_STRATEGY(context,selectedStrategy,defaultStrategy){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"The pre-consent storage strategy \"").concat(selectedStrategy,"\" is not supported. Please choose one of the following supported strategies: \"none, session, anonymousId\". The default strategy \"").concat(defaultStrategy,"\" will be used instead.");};var UNSUPPORTED_PRE_CONSENT_EVENTS_DELIVERY_TYPE=function UNSUPPORTED_PRE_CONSENT_EVENTS_DELIVERY_TYPE(context,selectedDeliveryType,defaultDeliveryType){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"The pre-consent events delivery type \"").concat(selectedDeliveryType,"\" is not supported. Please choose one of the following supported types: \"immediate, buffer\". The default type \"").concat(defaultDeliveryType,"\" will be used instead.");};var generateMisconfiguredPluginsWarning=function generateMisconfiguredPluginsWarning(context,configurationStatus,missingPlugins,shouldAddMissingPlugins){var isSinglePlugin=missingPlugins.length===1;var pluginsString=isSinglePlugin?" '".concat(missingPlugins[0],"' plugin was"):" ['".concat(missingPlugins.join("', '"),"'] plugins were");var baseWarning="".concat(context).concat(LOG_CONTEXT_SEPARATOR).concat(configurationStatus,", but").concat(pluginsString," not configured to load.");if(shouldAddMissingPlugins){return "".concat(baseWarning," So, ").concat(isSinglePlugin?'the plugin':'those plugins'," will be loaded automatically.");}return "".concat(baseWarning," Ignore if this was intentional. Otherwise, consider adding ").concat(isSinglePlugin?'it':'them'," to the 'plugins' load API option.");};var INVALID_POLYFILL_URL_WARNING=function INVALID_POLYFILL_URL_WARNING(context,customPolyfillUrl){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"The provided polyfill URL \"").concat(customPolyfillUrl,"\" is invalid. The default polyfill URL will be used instead.");};var BAD_COOKIES_WARNING=function BAD_COOKIES_WARNING(key){return "The cookie data for ".concat(key," seems to be encrypted using SDK versions < v3. The data is dropped. This can potentially stem from using SDK versions < v3 on other sites or web pages that can share cookies with this webpage. We recommend using the same SDK (v3) version everywhere or avoid disabling the storage data migration.");};var PAGE_UNLOAD_ON_BEACON_DISABLED_WARNING=function PAGE_UNLOAD_ON_BEACON_DISABLED_WARNING(context){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"Page Unloaded event can only be tracked when the Beacon transport is active. Please enable \"useBeacon\" load API option.");};
|
1056
1130
|
|
1057
1131
|
var DEFAULT_INTEGRATIONS_CONFIG={All:true};
|
1058
1132
|
|
@@ -1069,9 +1143,9 @@
|
|
1069
1143
|
|
1070
1144
|
var BUILD_TYPE='legacy';var SDK_CDN_BASE_URL='https://cdn.rudderlabs.com';var CDN_ARCH_VERSION_DIR='v3';var DEST_SDK_BASE_URL="".concat(SDK_CDN_BASE_URL,"/").concat(CDN_ARCH_VERSION_DIR,"/").concat(BUILD_TYPE,"/").concat(CDN_INT_DIR);var PLUGINS_BASE_URL="".concat(SDK_CDN_BASE_URL,"/").concat(CDN_ARCH_VERSION_DIR,"/").concat(BUILD_TYPE,"/").concat(CDN_PLUGINS_DIR);var DEFAULT_CONFIG_BE_URL='https://api.rudderstack.com';
|
1071
1145
|
|
1072
|
-
var DEFAULT_STORAGE_ENCRYPTION_VERSION='v3';var DEFAULT_DATA_PLANE_EVENTS_TRANSPORT='xhr';var ConsentManagersToPluginNameMap={oneTrust:'OneTrustConsentManager',ketch:'KetchConsentManager',custom:'CustomConsentManager'};var StorageEncryptionVersionsToPluginNameMap=_defineProperty(_defineProperty({},DEFAULT_STORAGE_ENCRYPTION_VERSION,'StorageEncryption'),"legacy",'StorageEncryptionLegacy');var DataPlaneEventsTransportToPluginNameMap=_defineProperty(_defineProperty({},DEFAULT_DATA_PLANE_EVENTS_TRANSPORT,'XhrQueue'),"beacon",'BeaconQueue');var DEFAULT_DATA_SERVICE_ENDPOINT='rsaRequest';var METRICS_SERVICE_ENDPOINT='rsaMetrics';
|
1146
|
+
var DEFAULT_STORAGE_ENCRYPTION_VERSION='v3';var DEFAULT_DATA_PLANE_EVENTS_TRANSPORT='xhr';var ConsentManagersToPluginNameMap={iubenda:'IubendaConsentManager',oneTrust:'OneTrustConsentManager',ketch:'KetchConsentManager',custom:'CustomConsentManager'};var StorageEncryptionVersionsToPluginNameMap=_defineProperty(_defineProperty({},DEFAULT_STORAGE_ENCRYPTION_VERSION,'StorageEncryption'),"legacy",'StorageEncryptionLegacy');var DataPlaneEventsTransportToPluginNameMap=_defineProperty(_defineProperty({},DEFAULT_DATA_PLANE_EVENTS_TRANSPORT,'XhrQueue'),"beacon",'BeaconQueue');var DEFAULT_DATA_SERVICE_ENDPOINT='rsaRequest';var METRICS_SERVICE_ENDPOINT='rsaMetrics';
|
1073
1147
|
|
1074
|
-
var defaultLoadOptions={logLevel:'ERROR',configUrl:DEFAULT_CONFIG_BE_URL,loadIntegration:true,sessions:{autoTrack:true,timeout:DEFAULT_SESSION_TIMEOUT_MS},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},sendAdblockPageOptions:{},useServerSideCookies:false};var loadOptionsState=d$1(clone(defaultLoadOptions));
|
1148
|
+
var defaultLoadOptions={logLevel:'ERROR',configUrl:DEFAULT_CONFIG_BE_URL,loadIntegration:true,sessions:{autoTrack:true,timeout:DEFAULT_SESSION_TIMEOUT_MS},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:{}},sendAdblockPageOptions:{},useServerSideCookies:false};var loadOptionsState=d$1(clone(defaultLoadOptions));
|
1075
1149
|
|
1076
1150
|
var DEFAULT_USER_SESSION_VALUES={userId:'',userTraits:{},anonymousId:'',groupId:'',groupTraits:{},initialReferrer:'',initialReferringDomain:'',sessionInfo:{},authToken:null};var SERVER_SIDE_COOKIES_DEBOUNCE_TIME=10;// milliseconds
|
1077
1151
|
|
@@ -1104,7 +1178,9 @@
|
|
1104
1178
|
var dataPlaneEventsState={eventsQueuePluginName:d$1(undefined),deliveryEnabled:d$1(true)// Delivery should always happen
|
1105
1179
|
};
|
1106
1180
|
|
1107
|
-
var
|
1181
|
+
var autoTrackState={enabled:d$1(false),pageLifecycle:{enabled:d$1(false),visitId:d$1(undefined),pageLoadedTimestamp:d$1(undefined)}};
|
1182
|
+
|
1183
|
+
var defaultStateValues={capabilities:capabilitiesState,consents:consentsState,context:contextState,eventBuffer:eventBufferState,lifecycle:lifecycleState,loadOptions:loadOptionsState,metrics:metricsState,nativeDestinations:nativeDestinationsState,plugins:pluginsState,reporting:reportingState,session:sessionState,source:sourceConfigState,storage:storageState,serverCookies:serverSideCookiesState,dataPlaneEvents:dataPlaneEventsState,autoTrack:autoTrackState};var state=_objectSpread2({},clone(defaultStateValues));
|
1108
1184
|
|
1109
1185
|
// to next or return the value if it is the last one instead of an array per
|
1110
1186
|
// plugin that is the normal invoke
|
@@ -1165,12 +1241,7 @@
|
|
1165
1241
|
/**
|
1166
1242
|
* List of plugin names that are loaded as dynamic imports in modern builds
|
1167
1243
|
*/var pluginNamesList=['BeaconQueue','Bugsnag',// deprecated
|
1168
|
-
'CustomConsentManager','DeviceModeDestinations','DeviceModeTransformation','ErrorReporting','ExternalAnonymousId','GoogleLinker','KetchConsentManager','NativeDestinationQueue','OneTrustConsentManager','StorageEncryption','StorageEncryptionLegacy','StorageMigrator','XhrQueue'];
|
1169
|
-
|
1170
|
-
/**
|
1171
|
-
* To get the current timestamp in ISO string format
|
1172
|
-
* @returns ISO formatted timestamp string
|
1173
|
-
*/var getCurrentTimeFormatted=function getCurrentTimeFormatted(){var curDateTime=new Date().toISOString();return curDateTime;};
|
1244
|
+
'CustomConsentManager','DeviceModeDestinations','DeviceModeTransformation','ErrorReporting','ExternalAnonymousId','GoogleLinker','IubendaConsentManager','KetchConsentManager','NativeDestinationQueue','OneTrustConsentManager','StorageEncryption','StorageEncryptionLegacy','StorageMigrator','XhrQueue'];
|
1174
1245
|
|
1175
1246
|
var COOKIE_STORAGE='cookieStorage';var LOCAL_STORAGE='localStorage';var SESSION_STORAGE='sessionStorage';var MEMORY_STORAGE='memoryStorage';var NO_STORAGE='none';
|
1176
1247
|
|
@@ -1183,16 +1254,6 @@
|
|
1183
1254
|
if(isFunction(globalThis.URL)){// eslint-disable-next-line no-new
|
1184
1255
|
new URL(url);}return URL_PATTERN.test(url);}catch(e){return false;}};
|
1185
1256
|
|
1186
|
-
function random(len){return crypto.getRandomValues(new Uint8Array(len));}
|
1187
|
-
|
1188
|
-
var SIZE=4096,HEX$1=[],IDX$1=0,BUFFER$1;for(;IDX$1<256;IDX$1++){HEX$1[IDX$1]=(IDX$1+256).toString(16).substring(1);}function v4$1(){if(!BUFFER$1||IDX$1+16>SIZE){BUFFER$1=random(SIZE);IDX$1=0;}var i=0,tmp,out='';for(;i<16;i++){tmp=BUFFER$1[IDX$1+i];if(i==6)out+=HEX$1[tmp&15|64];else if(i==8)out+=HEX$1[tmp&63|128];else out+=HEX$1[tmp];if(i&1&&i>1&&i<11)out+='-';}IDX$1+=16;return out;}
|
1189
|
-
|
1190
|
-
var IDX=256,HEX=[],BUFFER;while(IDX--)HEX[IDX]=(IDX+256).toString(16).substring(1);function v4(){var i=0,num,out='';if(!BUFFER||IDX+16>256){BUFFER=Array(i=256);while(i--)BUFFER[i]=256*Math.random()|0;i=IDX=0;}for(;i<16;i++){num=BUFFER[IDX+i];if(i==6)out+=HEX[num&15|64];else if(i==8)out+=HEX[num&63|128];else out+=HEX[num];if(i&1&&i>1&&i<11)out+='-';}IDX++;return out;}
|
1191
|
-
|
1192
|
-
var hasCrypto$1=function hasCrypto(){return !isNullOrUndefined(globalThis.crypto)&&isFunction(globalThis.crypto.getRandomValues);};
|
1193
|
-
|
1194
|
-
var generateUUID=function generateUUID(){if(hasCrypto$1()){return v4$1();}return v4();};
|
1195
|
-
|
1196
1257
|
var isErrRetryable=function isErrRetryable(details){var isRetryableNWFailure=false;if(details!==null&&details!==void 0&&details.error&&details!==null&&details!==void 0&&details.xhr){var xhrStatus=details.xhr.status;// same as in v1.1
|
1197
1258
|
isRetryableNWFailure=xhrStatus===429||xhrStatus>=500&&xhrStatus<600;}return isRetryableNWFailure;};
|
1198
1259
|
|
@@ -1256,17 +1317,6 @@
|
|
1256
1317
|
|
1257
1318
|
var QueueStatuses={IN_PROGRESS:'inProgress',QUEUE:'queue',RECLAIM_START:'reclaimStart',RECLAIM_END:'reclaimEnd',ACK:'ack',BATCH_QUEUE:'batchQueue'};
|
1258
1319
|
|
1259
|
-
var onPageLeave=function onPageLeave(callback){// To ensure the callback is only called once even if more than one events
|
1260
|
-
// are fired at once.
|
1261
|
-
var pageLeft=false;var isAccessible=false;function handleOnLeave(){if(pageLeft){return;}pageLeft=true;callback(isAccessible);}// Catches the unloading of the page (e.g., closing the tab or navigating away).
|
1262
|
-
// Includes user actions like clicking a link, entering a new URL,
|
1263
|
-
// refreshing the page, or closing the browser tab
|
1264
|
-
// Note that 'pagehide' is not supported in IE.
|
1265
|
-
// So, this is a fallback.
|
1266
|
-
globalThis.addEventListener('beforeunload',function(){isAccessible=false;handleOnLeave();});globalThis.addEventListener('blur',function(){isAccessible=true;handleOnLeave();});globalThis.addEventListener('focus',function(){pageLeft=false;});// Catches the page being hidden, including scenarios like closing the tab.
|
1267
|
-
document.addEventListener('pagehide',function(){isAccessible=document.visibilityState==='hidden';handleOnLeave();});// Catches visibility changes, such as switching tabs or minimizing the browser.
|
1268
|
-
document.addEventListener('visibilitychange',function(){isAccessible=true;if(document.visibilityState==='hidden'){handleOnLeave();}else {pageLeft=false;}});};
|
1269
|
-
|
1270
1320
|
var ScheduleModes=/*#__PURE__*/function(ScheduleModes){ScheduleModes[ScheduleModes["ASAP"]=1]="ASAP";ScheduleModes[ScheduleModes["RESCHEDULE"]=2]="RESCHEDULE";ScheduleModes[ScheduleModes["ABANDON"]=3]="ABANDON";return ScheduleModes;}({});var DEFAULT_CLOCK_LATE_FACTOR=2;var DEFAULT_CLOCK={setTimeout:function setTimeout(fn,ms){return globalThis.setTimeout(fn,ms);},clearTimeout:function clearTimeout(id){return globalThis.clearTimeout(id);},Date:globalThis.Date,clockLateFactor:DEFAULT_CLOCK_LATE_FACTOR};var Schedule=/*#__PURE__*/function(){function Schedule(){_classCallCheck(this,Schedule);this.tasks={};this.nextId=1;this.clock=DEFAULT_CLOCK;}return _createClass(Schedule,[{key:"now",value:function now(){return +new this.clock.Date();}},{key:"run",value:function run(task,timeout,mode){var id=(this.nextId+1).toString();this.tasks[id]=this.clock.setTimeout(this.handle(id,task,timeout,mode||ScheduleModes.ASAP),timeout);return id;}},{key:"handle",value:function handle(id,callback,timeout,mode){var _this=this;var start=this.now();return function(){delete _this.tasks[id];var elapsedTimeoutTime=start+timeout*(_this.clock.clockLateFactor||DEFAULT_CLOCK_LATE_FACTOR);var currentTime=_this.now();var notCompletedOrTimedOut=mode>=ScheduleModes.RESCHEDULE&&elapsedTimeoutTime<currentTime;if(notCompletedOrTimedOut){if(mode===ScheduleModes.RESCHEDULE){_this.run(callback,timeout,mode);}return undefined;}return callback();};}},{key:"cancel",value:function cancel(id){if(this.tasks[id]){this.clock.clearTimeout(this.tasks[id]);delete this.tasks[id];}}},{key:"cancelAll",value:function cancelAll(){Object.values(this.tasks).forEach(this.clock.clearTimeout);this.tasks={};}}]);}();
|
1271
1321
|
|
1272
1322
|
var RETRY_QUEUE_PROCESS_ERROR=function RETRY_QUEUE_PROCESS_ERROR(context){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"Process function threw an error.");};var RETRY_QUEUE_ENTRY_REMOVE_ERROR=function RETRY_QUEUE_ENTRY_REMOVE_ERROR(context,entry,attempt){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"Failed to remove local storage entry \"").concat(entry,"\" (attempt: ").concat(attempt,".");};
|
@@ -1362,7 +1412,7 @@
|
|
1362
1412
|
// Hence, we need this backward compatibility check
|
1363
1413
|
if(isFunction(storageEngine.keys)){storageKeys=storageEngine.keys();}else {for(var i=0;i<storageEngine.length;i++){var key=storageEngine.key(i);if(key){storageKeys.push(key);}}}storageKeys.forEach(function(k){var keyParts=k?k.split('.'):[];if(keyParts.length>=3&&keyParts[0]===name&&keyParts[1]!==_this4.id&&keyParts[2]===QueueStatuses.ACK){res.push(_this4.storeManager.setStore({id:keyParts[1],name:name,validKeys:QueueStatuses,type:LOCAL_STORAGE}));}});return res;};findOtherQueues(this.name).forEach(function(store){if(_this4.schedule.now()-store.get(QueueStatuses.ACK)<_this4.timeouts.reclaimTimeout){return;}tryReclaim(store);});this.schedule.run(this.checkReclaim,this.timeouts.reclaimTimer,ScheduleModes.RESCHEDULE);}},{key:"clear",value:function clear(){this.schedule.cancelAll();this.setDefaultQueueEntries();}}]);}();
|
1364
1414
|
|
1365
|
-
var pluginName$
|
1415
|
+
var pluginName$f='BeaconQueue';var BeaconQueue=function BeaconQueue(){return {name:pluginName$f,deps:[],initialize:function initialize(state){state.plugins.loadedPlugins.value=[].concat(_toConsumableArray(state.plugins.loadedPlugins.value),[pluginName$f]);},dataplaneEventsQueue:{/**
|
1366
1416
|
* Initialize the queue for delivery
|
1367
1417
|
* @param state Application state
|
1368
1418
|
* @param httpClient http client instance
|
@@ -1419,185 +1469,187 @@
|
|
1419
1469
|
maxEvents:100,maxBreadcrumbs:40,releaseStage:getReleaseStage$1(),user:{id:((_state$source$value=state.source.value)===null||_state$source$value===void 0?void 0:_state$source$value.id)||state.lifecycle.writeKey.value},logger:logger,networkBreadcrumbsEnabled:false};var client=globalBugsnagLibInstance(clientConfig);return client;};var isApiKeyValid=function isApiKeyValid(apiKey){var isAPIKeyValid=!(apiKey.startsWith('{{')||apiKey.endsWith('}}')||apiKey.length===0);return isAPIKeyValid;};var loadBugsnagSDK=function loadBugsnagSDK(externalSrcLoader,logger){var isNotLoaded=GLOBAL_LIBRARY_OBJECT_NAMES.every(function(globalKeyName){return !globalThis[globalKeyName];});if(!isNotLoaded){return;}externalSrcLoader.loadJSFile({url:BUGSNAG_CDN_URL,id:ERROR_REPORT_PROVIDER_NAME_BUGSNAG,callback:function callback(id){if(!id){logger===null||logger===void 0||logger.error(BUGSNAG_SDK_LOAD_ERROR(BUGSNAG_PLUGIN));}}});};var _initBugsnagClient=function initBugsnagClient(state,promiseResolve,promiseReject,logger){var time=arguments.length>4&&arguments[4]!==undefined?arguments[4]:0;var globalBugsnagLibInstance=getGlobalBugsnagLibInstance();if(typeof globalBugsnagLibInstance==='function'){if(isValidVersion(globalBugsnagLibInstance)){var client=getNewClient(state,logger);promiseResolve(client);}}else if(time>=MAX_WAIT_FOR_SDK_LOAD_MS){promiseReject(new Error(BUGSNAG_SDK_LOAD_TIMEOUT_ERROR(MAX_WAIT_FOR_SDK_LOAD_MS)));}else {// Try to initialize the client after a delay
|
1420
1470
|
globalThis.setTimeout(_initBugsnagClient,SDK_LOAD_POLL_INTERVAL_MS,state,promiseResolve,promiseReject,logger,time+SDK_LOAD_POLL_INTERVAL_MS);}};
|
1421
1471
|
|
1422
|
-
var pluginName$
|
1472
|
+
var pluginName$e='Bugsnag';var Bugsnag=function Bugsnag(){return {name:pluginName$e,deps:[],initialize:function initialize(state){state.plugins.loadedPlugins.value=[].concat(_toConsumableArray(state.plugins.loadedPlugins.value),[pluginName$e]);},errorReportingProvider:{init:function init(state,externalSrcLoader,logger){return new Promise(function(resolve,reject){// If API key token is not parsed or invalid, don't proceed to initialize the client
|
1423
1473
|
if(!isApiKeyValid(API_KEY)){reject(new Error(BUGSNAG_API_KEY_VALIDATION_ERROR(API_KEY)));return;}// If SDK URL is empty, don't proceed to initialize the client
|
1424
1474
|
loadBugsnagSDK(externalSrcLoader,logger);_initBugsnagClient(state,resolve,reject,logger);});},notify:function notify(client,error,state,logger){client.notify(error);},breadcrumb:function breadcrumb(client,message,logger){client===null||client===void 0||client.leaveBreadcrumb(message);}}};};
|
1425
1475
|
|
1426
1476
|
var CUSTOM_CONSENT_MANAGER_PLUGIN='CustomConsentManagerPlugin';
|
1427
1477
|
|
1428
|
-
var DESTINATION_CONSENT_STATUS_ERROR$
|
1478
|
+
var DESTINATION_CONSENT_STATUS_ERROR$3="Failed to determine the consent status for the destination. Please check the destination configuration and try again.";
|
1429
1479
|
|
1430
|
-
var pluginName$
|
1480
|
+
var pluginName$d='CustomConsentManager';var CustomConsentManager=function CustomConsentManager(){return {name:pluginName$d,deps:[],initialize:function initialize(state){state.plugins.loadedPlugins.value=[].concat(_toConsumableArray(state.plugins.loadedPlugins.value),[pluginName$d]);},consentManager:{init:function init(state,logger){// Nothing to initialize
|
1431
1481
|
},updateConsentsInfo:function updateConsentsInfo(state,storeManager,logger){// Nothing to update. Already provided by the user
|
1432
1482
|
},isDestinationConsented:function isDestinationConsented(state,destConfig,errorHandler,logger){if(!state.consents.initialized.value){return true;}var allowedConsentIds=state.consents.data.value.allowedConsentIds;try{var _cmpConfig$resolution;var consentManagement=destConfig.consentManagement;// If the destination does not have consent management config, events should be sent.
|
1433
1483
|
if(!consentManagement){return true;}// Get the corresponding consents for the destination
|
1434
1484
|
var cmpConfig=consentManagement.find(function(c){return c.provider===state.consents.provider.value;});// If there are no consents configured for the destination for the current provider, events should be sent.
|
1435
1485
|
if(!(cmpConfig!==null&&cmpConfig!==void 0&&cmpConfig.consents)){return true;}var configuredConsents=cmpConfig.consents.map(function(c){return c.consent.trim();}).filter(function(n){return n;});var resolutionStrategy=(_cmpConfig$resolution=cmpConfig.resolutionStrategy)!==null&&_cmpConfig$resolution!==void 0?_cmpConfig$resolution:state.consents.resolutionStrategy.value;// match the configured consents with user provided consents as per
|
1436
1486
|
// the configured resolution strategy
|
1437
|
-
var matchPredicate=function matchPredicate(consent){return allowedConsentIds.includes(consent);};switch(resolutionStrategy){case'or':return configuredConsents.some(matchPredicate)||configuredConsents.length===0;case'and':default:return configuredConsents.every(matchPredicate);}}catch(err){errorHandler===null||errorHandler===void 0||errorHandler.onError(err,CUSTOM_CONSENT_MANAGER_PLUGIN,DESTINATION_CONSENT_STATUS_ERROR$
|
1487
|
+
var matchPredicate=function matchPredicate(consent){return allowedConsentIds.includes(consent);};switch(resolutionStrategy){case'or':return configuredConsents.some(matchPredicate)||configuredConsents.length===0;case'and':default:return configuredConsents.every(matchPredicate);}}catch(err){errorHandler===null||errorHandler===void 0||errorHandler.onError(err,CUSTOM_CONSENT_MANAGER_PLUGIN,DESTINATION_CONSENT_STATUS_ERROR$3);return true;}}}};};
|
1438
1488
|
|
1439
|
-
var DIR_NAME$
|
1489
|
+
var DIR_NAME$1g='AdobeAnalytics';var NAME$1g='ADOBE_ANALYTICS';var DISPLAY_NAME$1g='Adobe Analytics';_defineProperty({},DISPLAY_NAME$1g,DIR_NAME$1g);_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({'Adobe Analytics':NAME$1g,ADOBEANALYTICS:NAME$1g,'ADOBE ANALYTICS':NAME$1g},NAME$1g,NAME$1g),"AdobeAnalytics",NAME$1g),"adobeanalytics",NAME$1g),'adobe analytics',NAME$1g),'Adobe analytics',NAME$1g),'adobe Analytics',NAME$1g);
|
1440
1490
|
|
1441
|
-
var DIR_NAME$
|
1491
|
+
var DIR_NAME$1f='Amplitude';var NAME$1f='AM';var DISPLAY_NAME$1f='Amplitude';_defineProperty({},DISPLAY_NAME$1f,DIR_NAME$1f);_defineProperty(_defineProperty(_defineProperty(_defineProperty({},NAME$1f,NAME$1f),"AMPLITUDE",NAME$1f),"Amplitude",NAME$1f),"am",NAME$1f);
|
1442
1492
|
|
1443
|
-
var DIR_NAME$
|
1493
|
+
var DIR_NAME$1e='Appcues';var NAME$1e='APPCUES';var DISPLAY_NAME$1e='Appcues';_defineProperty({},DISPLAY_NAME$1e,DIR_NAME$1e);_defineProperty(_defineProperty(_defineProperty(_defineProperty({},NAME$1e,NAME$1e),"Appcues",NAME$1e),'App Cues',NAME$1e),"appcues",NAME$1e);
|
1444
1494
|
|
1445
|
-
var DIR_NAME$
|
1495
|
+
var DIR_NAME$1d='BingAds';var NAME$1d='BINGADS';var DISPLAY_NAME$1d='Bing Ads';_defineProperty({},DISPLAY_NAME$1d,DIR_NAME$1d);_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},NAME$1d,NAME$1d),"BingAds",NAME$1d),"bingads",NAME$1d),'Bing Ads',NAME$1d),'Bing ads',NAME$1d),'bing Ads',NAME$1d),'bing ads',NAME$1d);
|
1446
1496
|
|
1447
|
-
var DIR_NAME$
|
1497
|
+
var DIR_NAME$1c='Braze';var NAME$1c='BRAZE';var DISPLAY_NAME$1c='Braze';_defineProperty({},DISPLAY_NAME$1c,DIR_NAME$1c);_defineProperty(_defineProperty(_defineProperty({},NAME$1c,NAME$1c),"Braze",NAME$1c),"braze",NAME$1c);
|
1448
1498
|
|
1449
|
-
var DIR_NAME$
|
1499
|
+
var DIR_NAME$1b='Bugsnag';var NAME$1b='BUGSNAG';var DISPLAY_NAME$1b='Bugsnag';_defineProperty({},DISPLAY_NAME$1b,DIR_NAME$1b);_defineProperty(_defineProperty(_defineProperty({},NAME$1b,NAME$1b),"bugsnag",NAME$1b),"Bugsnag",NAME$1b);
|
1450
1500
|
|
1451
|
-
var DIR_NAME$
|
1501
|
+
var DIR_NAME$1a='Chartbeat';var NAME$1a='CHARTBEAT';var DISPLAY_NAME$1a='Chartbeat';_defineProperty({},DISPLAY_NAME$1a,DIR_NAME$1a);_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},NAME$1a,NAME$1a),"Chartbeat",NAME$1a),"chartbeat",NAME$1a),'Chart Beat',NAME$1a),'chart beat',NAME$1a);
|
1452
1502
|
|
1453
|
-
var DIR_NAME$
|
1503
|
+
var DIR_NAME$19='Clevertap';var NAME$19='CLEVERTAP';var DISPLAY_NAME$19='CleverTap';_defineProperty({},DISPLAY_NAME$19,DIR_NAME$19);_defineProperty(_defineProperty(_defineProperty({},NAME$19,NAME$19),"Clevertap",NAME$19),"clevertap",NAME$19);
|
1454
1504
|
|
1455
|
-
var DIR_NAME$
|
1505
|
+
var DIR_NAME$18='Comscore';var NAME$18='COMSCORE';var DISPLAY_NAME$18='Comscore';_defineProperty({},DISPLAY_NAME$18,DIR_NAME$18);_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},NAME$18,NAME$18),"Comscore",NAME$18),'Com Score',NAME$18),'com Score',NAME$18),'com score',NAME$18),'Com score',NAME$18);
|
1456
1506
|
|
1457
|
-
var DIR_NAME$
|
1507
|
+
var DIR_NAME$17='Criteo';var NAME$17='CRITEO';var DISPLAY_NAME$17='Criteo';_defineProperty({},DISPLAY_NAME$17,DIR_NAME$17);_defineProperty(_defineProperty(_defineProperty({},NAME$17,NAME$17),"Criteo",NAME$17),"criteo",NAME$17);
|
1458
1508
|
|
1459
|
-
var DIR_NAME$
|
1509
|
+
var DIR_NAME$16='CustomerIO';var NAME$16='CUSTOMERIO';var DISPLAY_NAME$16='Customer IO';_defineProperty({},DISPLAY_NAME$16,DIR_NAME$16);_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},NAME$16,NAME$16),"Customerio",NAME$16),'Customer.io',NAME$16),'CUSTOMER.IO',NAME$16),'customer.io',NAME$16);
|
1460
1510
|
|
1461
|
-
var DIR_NAME$
|
1511
|
+
var DIR_NAME$15='Drip';var NAME$15='DRIP';var DISPLAY_NAME$15='Drip';_defineProperty({},DISPLAY_NAME$15,DIR_NAME$15);_defineProperty(_defineProperty(_defineProperty({},NAME$15,NAME$15),"Drip",NAME$15),"drip",NAME$15);
|
1462
1512
|
|
1463
|
-
var DIR_NAME$
|
1513
|
+
var DIR_NAME$14='FacebookPixel';var NAME$14='FACEBOOK_PIXEL';var DISPLAY_NAME$14='Facebook Pixel';_defineProperty({},DISPLAY_NAME$14,DIR_NAME$14);_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},NAME$14,NAME$14),'FB Pixel',NAME$14),'Facebook Pixel',NAME$14),'facebook pixel',NAME$14),"fbpixel",NAME$14),"FBPIXEL",NAME$14),"FB_PIXEL",NAME$14);
|
1464
1514
|
|
1465
|
-
var DIR_NAME$
|
1515
|
+
var DIR_NAME$13='Fullstory';var NAME$13='FULLSTORY';var DISPLAY_NAME$13='Fullstory';_defineProperty({},DISPLAY_NAME$13,DIR_NAME$13);_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},NAME$13,NAME$13),"Fullstory",NAME$13),"FullStory",NAME$13),'full Story',NAME$13),'Full Story',NAME$13),'Full story',NAME$13),'full story',NAME$13),"fullstory",NAME$13);
|
1466
1516
|
|
1467
|
-
var DIR_NAME$
|
1517
|
+
var DIR_NAME$12='GA';var NAME$12='GA';var DISPLAY_NAME$12='Google Analytics';_defineProperty({},DISPLAY_NAME$12,DIR_NAME$12);_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},NAME$12,NAME$12),'Google Analytics',NAME$12),"GoogleAnalytics",NAME$12),'GOOGLE ANALYTICS',NAME$12),'google analytics',NAME$12);
|
1468
1518
|
|
1469
|
-
var DIR_NAME$
|
1519
|
+
var DIR_NAME$11='GA4';var NAME$11='GA4';var DISPLAY_NAME$11='Google Analytics 4 (GA4)';_defineProperty({},DISPLAY_NAME$11,DIR_NAME$11);_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},NAME$11,NAME$11),'Google Analytics 4',NAME$11),'Google analytics 4',NAME$11),'google analytics 4',NAME$11),'Google Analytics4',NAME$11),'Google analytics4',NAME$11),'google analytics4',NAME$11),'Google Analytics 4 (GA4)',NAME$11),'google analytics 4 (ga4)',NAME$11),"GoogleAnalytics4",NAME$11);
|
1470
1520
|
|
1471
|
-
var DIR_NAME
|
1521
|
+
var DIR_NAME$10='GA4_V2';var NAME$10='GA4_V2';var DISPLAY_NAME$10='Google Analytics 4 (GA4) V2';_defineProperty({},DISPLAY_NAME$10,DIR_NAME$10);_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},NAME$10,NAME$10),'Google Analytics 4 V2',NAME$10),'Google analytics 4 V2',NAME$10),'google analytics 4 V2',NAME$10),'Google Analytics4 V2',NAME$10),'Google analytics4 V2',NAME$10),'google analytics4 V2',NAME$10),'Google Analytics 4 (GA4) V2',NAME$10),'google analytics 4 (ga4) V2',NAME$10),"GoogleAnalytics4V2",NAME$10);
|
1472
1522
|
|
1473
|
-
var DIR_NAME
|
1523
|
+
var DIR_NAME$$='GoogleAds';var NAME$$='GOOGLEADS';var DISPLAY_NAME$$='Google Ads';_defineProperty({},DISPLAY_NAME$$,DIR_NAME$$);_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},NAME$$,NAME$$),'Google Ads',NAME$$),"GoogleAds",NAME$$),'GOOGLE ADS',NAME$$),'google ads',NAME$$),"googleads",NAME$$);
|
1474
1524
|
|
1475
|
-
var DIR_NAME$
|
1525
|
+
var DIR_NAME$_='GoogleOptimize';var NAME$_='GOOGLE_OPTIMIZE';var DISPLAY_NAME$_='Google Optimize';_defineProperty({},DISPLAY_NAME$_,DIR_NAME$_);_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},NAME$_,NAME$_),'Google Optimize',NAME$_),"GoogleOptimize",NAME$_),"Googleoptimize",NAME$_),"GOOGLEOPTIMIZE",NAME$_),'google optimize',NAME$_),'Google optimize',NAME$_),'GOOGLE OPTIMIZE',NAME$_);
|
1476
1526
|
|
1477
|
-
var DIR_NAME$
|
1527
|
+
var DIR_NAME$Z='GoogleTagManager';var NAME$Z='GTM';var DISPLAY_NAME$Z='Google Tag Manager';_defineProperty({},DISPLAY_NAME$Z,DIR_NAME$Z);_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},NAME$Z,NAME$Z),'Google Tag Manager',NAME$Z),'google tag manager',NAME$Z),'googletag manager',NAME$Z),"googletagmanager",NAME$Z);
|
1478
1528
|
|
1479
|
-
var DIR_NAME$
|
1529
|
+
var DIR_NAME$Y='Heap';var NAME$Y='HEAP';var DISPLAY_NAME$Y='Heap.io';_defineProperty({},DISPLAY_NAME$Y,DIR_NAME$Y);_defineProperty(_defineProperty(_defineProperty(_defineProperty({},NAME$Y,NAME$Y),"Heap",NAME$Y),"heap",NAME$Y),'Heap.io',NAME$Y);
|
1480
1530
|
|
1481
|
-
var DIR_NAME$
|
1531
|
+
var DIR_NAME$X='Hotjar';var NAME$X='HOTJAR';var DISPLAY_NAME$X='Hotjar';_defineProperty({},DISPLAY_NAME$X,DIR_NAME$X);_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},NAME$X,NAME$X),"Hotjar",NAME$X),"hotjar",NAME$X),'Hot Jar',NAME$X),'hot jar',NAME$X);
|
1482
1532
|
|
1483
|
-
var DIR_NAME$
|
1533
|
+
var DIR_NAME$W='HubSpot';var NAME$W='HS';var DISPLAY_NAME$W='HubSpot';_defineProperty({},DISPLAY_NAME$W,DIR_NAME$W);_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},NAME$W,NAME$W),"Hubspot",NAME$W),"HUBSPOT",NAME$W),'hub spot',NAME$W),'Hub Spot',NAME$W),'Hub spot',NAME$W);
|
1484
1534
|
|
1485
|
-
var DIR_NAME$
|
1535
|
+
var DIR_NAME$V='INTERCOM';var NAME$V='INTERCOM';var DISPLAY_NAME$V='Intercom';_defineProperty({},DISPLAY_NAME$V,DIR_NAME$V);_defineProperty(_defineProperty(_defineProperty({},NAME$V,NAME$V),"Intercom",NAME$V),"intercom",NAME$V);
|
1486
1536
|
|
1487
|
-
var DIR_NAME$
|
1537
|
+
var DIR_NAME$U='Keen';var NAME$U='KEEN';var DISPLAY_NAME$U='Keen';_defineProperty({},DISPLAY_NAME$U,DIR_NAME$U);_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},NAME$U,NAME$U),"Keen",NAME$U),'Keen.io',NAME$U),"keen",NAME$U),'keen.io',NAME$U);
|
1488
1538
|
|
1489
|
-
var DIR_NAME$
|
1539
|
+
var DIR_NAME$T='Kissmetrics';var NAME$T='KISSMETRICS';var DISPLAY_NAME$T='Kiss Metrics';_defineProperty({},DISPLAY_NAME$T,DIR_NAME$T);_defineProperty(_defineProperty(_defineProperty({},NAME$T,NAME$T),"Kissmetrics",NAME$T),"kissmetrics",NAME$T);
|
1490
1540
|
|
1491
|
-
var DIR_NAME$
|
1541
|
+
var DIR_NAME$S='Klaviyo';var NAME$S='KLAVIYO';var DISPLAY_NAME$S='Klaviyo';_defineProperty({},DISPLAY_NAME$S,DIR_NAME$S);_defineProperty(_defineProperty(_defineProperty({},NAME$S,NAME$S),"Klaviyo",NAME$S),"klaviyo",NAME$S);
|
1492
1542
|
|
1493
|
-
var DIR_NAME$
|
1543
|
+
var DIR_NAME$R='LaunchDarkly';var NAME$R='LAUNCHDARKLY';var DISPLAY_NAME$R='LaunchDarkly';_defineProperty({},DISPLAY_NAME$R,DIR_NAME$R);_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},NAME$R,NAME$R),"LaunchDarkly",NAME$R),"Launch_Darkly",NAME$R),'Launch Darkly',NAME$R),"launchDarkly",NAME$R),'launch darkly',NAME$R);
|
1494
1544
|
|
1495
|
-
var _CNameMapping$1;var DIR_NAME$
|
1545
|
+
var _CNameMapping$1;var DIR_NAME$Q='LinkedInInsightTag';var NAME$Q='LINKEDIN_INSIGHT_TAG';var DISPLAY_NAME$Q='Linkedin Insight Tag';_defineProperty({},DISPLAY_NAME$Q,DIR_NAME$Q);(_CNameMapping$1={},_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_CNameMapping$1,NAME$Q,NAME$Q),'LinkedIn Insight Tag',NAME$Q),'LinkedIn insight tag',NAME$Q),'linkedIn insight tag',NAME$Q),"Linkedin_insight_tag",NAME$Q),"LinkedinInsighttag",NAME$Q),"LinkedinInsightTag",NAME$Q),"LinkedInInsightTag",NAME$Q),"Linkedininsighttag",NAME$Q),"LINKEDININSIGHTTAG",NAME$Q),_defineProperty(_CNameMapping$1,"linkedininsighttag",NAME$Q));
|
1496
1546
|
|
1497
|
-
var DIR_NAME$
|
1547
|
+
var DIR_NAME$P='Lotame';var NAME$P='LOTAME';var DISPLAY_NAME$P='Lotame';_defineProperty({},DISPLAY_NAME$P,DIR_NAME$P);_defineProperty(_defineProperty(_defineProperty({},NAME$P,NAME$P),"Lotame",NAME$P),"lotame",NAME$P);
|
1498
1548
|
|
1499
|
-
var DIR_NAME$
|
1549
|
+
var DIR_NAME$O='Lytics';var NAME$O='LYTICS';var DISPLAY_NAME$O='Lytics';_defineProperty({},DISPLAY_NAME$O,DIR_NAME$O);_defineProperty(_defineProperty(_defineProperty({},NAME$O,NAME$O),"Lytics",NAME$O),"lytics",NAME$O);
|
1500
1550
|
|
1501
|
-
var DIR_NAME$
|
1551
|
+
var DIR_NAME$N='Mixpanel';var NAME$N='MP';var DISPLAY_NAME$N='Mixpanel';_defineProperty({},DISPLAY_NAME$N,DIR_NAME$N);_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},NAME$N,NAME$N),"MIXPANEL",NAME$N),"Mixpanel",NAME$N),'MIX PANEL',NAME$N),'Mix panel',NAME$N),'Mix Panel',NAME$N);
|
1502
1552
|
|
1503
|
-
var DIR_NAME$
|
1553
|
+
var DIR_NAME$M='MoEngage';var NAME$M='MOENGAGE';var DISPLAY_NAME$M='MoEngage';_defineProperty({},DISPLAY_NAME$M,DIR_NAME$M);_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},NAME$M,NAME$M),"MoEngage",NAME$M),"moengage",NAME$M),"Moengage",NAME$M),'Mo Engage',NAME$M),'mo engage',NAME$M),'Mo engage',NAME$M);
|
1504
1554
|
|
1505
|
-
var DIR_NAME$
|
1555
|
+
var DIR_NAME$L='Optimizely';var NAME$L='OPTIMIZELY';var DISPLAY_NAME$L='Optimizely Web';_defineProperty({},DISPLAY_NAME$L,DIR_NAME$L);_defineProperty(_defineProperty(_defineProperty({},NAME$L,NAME$L),"Optimizely",NAME$L),"optimizely",NAME$L);
|
1506
1556
|
|
1507
|
-
var DIR_NAME$
|
1557
|
+
var DIR_NAME$K='Pendo';var NAME$K='PENDO';var DISPLAY_NAME$K='Pendo';_defineProperty({},DISPLAY_NAME$K,DIR_NAME$K);_defineProperty(_defineProperty(_defineProperty({},NAME$K,NAME$K),"Pendo",NAME$K),"pendo",NAME$K);
|
1508
1558
|
|
1509
|
-
var _CNameMapping;var DIR_NAME$
|
1559
|
+
var _CNameMapping;var DIR_NAME$J='PinterestTag';var NAME$J='PINTEREST_TAG';var DISPLAY_NAME$J='Pinterest Tag';_defineProperty({},DISPLAY_NAME$J,DIR_NAME$J);(_CNameMapping={},_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_CNameMapping,NAME$J,NAME$J),"PinterestTag",NAME$J),"Pinterest_Tag",NAME$J),"PINTERESTTAG",NAME$J),"pinterest",NAME$J),"PinterestAds",NAME$J),"Pinterest_Ads",NAME$J),"Pinterest",NAME$J),'Pinterest Tag',NAME$J),'Pinterest tag',NAME$J),_defineProperty(_defineProperty(_defineProperty(_defineProperty(_CNameMapping,'PINTEREST TAG',NAME$J),'pinterest tag',NAME$J),'Pinterest Ads',NAME$J),'Pinterest ads',NAME$J));
|
1510
1560
|
|
1511
|
-
var DIR_NAME$
|
1561
|
+
var DIR_NAME$I='PostAffiliatePro';var NAME$I='POST_AFFILIATE_PRO';var DISPLAY_NAME$I='Post Affiliate Pro';_defineProperty({},DISPLAY_NAME$I,DIR_NAME$I);_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},NAME$I,NAME$I),"PostAffiliatePro",NAME$I),"Post_affiliate_pro",NAME$I),'Post Affiliate Pro',NAME$I),'Post affiliate pro',NAME$I),'post affiliate pro',NAME$I),"postaffiliatepro",NAME$I),"POSTAFFILIATEPRO",NAME$I);
|
1512
1562
|
|
1513
|
-
var DIR_NAME$
|
1563
|
+
var DIR_NAME$H='Posthog';var NAME$H='POSTHOG';var DISPLAY_NAME$H='PostHog';_defineProperty({},DISPLAY_NAME$H,DIR_NAME$H);_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},NAME$H,NAME$H),"PostHog",NAME$H),"Posthog",NAME$H),"posthog",NAME$H),'Post Hog',NAME$H),'Post hog',NAME$H),'post hog',NAME$H);
|
1514
1564
|
|
1515
|
-
var DIR_NAME$
|
1565
|
+
var DIR_NAME$G='ProfitWell';var NAME$G='PROFITWELL';var DISPLAY_NAME$G='ProfitWell';_defineProperty({},DISPLAY_NAME$G,DIR_NAME$G);_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},NAME$G,NAME$G),"ProfitWell",NAME$G),"profitwell",NAME$G),"Profitwell",NAME$G),'Profit Well',NAME$G),'profit well',NAME$G),'Profit well',NAME$G);
|
1516
1566
|
|
1517
|
-
var DIR_NAME$
|
1567
|
+
var DIR_NAME$F='Qualtrics';var NAME$F='QUALTRICS';var DISPLAY_NAME$F='Qualtrics';_defineProperty({},DISPLAY_NAME$F,DIR_NAME$F);_defineProperty(_defineProperty(_defineProperty({},NAME$F,NAME$F),"Qualtrics",NAME$F),"qualtrics",NAME$F);
|
1518
1568
|
|
1519
|
-
var DIR_NAME$
|
1569
|
+
var DIR_NAME$E='QuantumMetric';var NAME$E='QUANTUMMETRIC';var DISPLAY_NAME$E='Quantum Metric';_defineProperty({},DISPLAY_NAME$E,DIR_NAME$E);_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},NAME$E,NAME$E),'Quantum Metric',NAME$E),'quantum Metric',NAME$E),'quantum metric',NAME$E),"QuantumMetric",NAME$E),"quantumMetric",NAME$E),"quantummetric",NAME$E),"Quantum_Metric",NAME$E);
|
1520
1570
|
|
1521
|
-
var DIR_NAME$
|
1571
|
+
var DIR_NAME$D='RedditPixel';var NAME$D='REDDIT_PIXEL';var DISPLAY_NAME$D='Reddit Pixel';_defineProperty({},DISPLAY_NAME$D,DIR_NAME$D);_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},NAME$D,NAME$D),"Reddit_Pixel",NAME$D),"RedditPixel",NAME$D),"REDDITPIXEL",NAME$D),"redditpixel",NAME$D),'Reddit Pixel',NAME$D),'REDDIT PIXEL',NAME$D),'reddit pixel',NAME$D);
|
1522
1572
|
|
1523
|
-
var DIR_NAME$
|
1573
|
+
var DIR_NAME$C='Sentry';var NAME$C='SENTRY';var DISPLAY_NAME$C='Sentry';_defineProperty({},DISPLAY_NAME$C,DIR_NAME$C);_defineProperty(_defineProperty(_defineProperty({},NAME$C,NAME$C),"sentry",NAME$C),"Sentry",NAME$C);
|
1524
1574
|
|
1525
|
-
var DIR_NAME$
|
1575
|
+
var DIR_NAME$B='SnapPixel';var NAME$B='SNAP_PIXEL';var DISPLAY_NAME$B='Snap Pixel';_defineProperty({},DISPLAY_NAME$B,DIR_NAME$B);_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},NAME$B,NAME$B),"Snap_Pixel",NAME$B),"SnapPixel",NAME$B),"SNAPPIXEL",NAME$B),"snappixel",NAME$B),'Snap Pixel',NAME$B),'SNAP PIXEL',NAME$B),'snap pixel',NAME$B);
|
1526
1576
|
|
1527
|
-
var DIR_NAME$
|
1577
|
+
var DIR_NAME$A='TVSquared';var NAME$A='TVSQUARED';var DISPLAY_NAME$A='TVSquared';_defineProperty({},DISPLAY_NAME$A,DIR_NAME$A);_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},NAME$A,NAME$A),"TVSquared",NAME$A),"tvsquared",NAME$A),"tvSquared",NAME$A),"TvSquared",NAME$A),"Tvsquared",NAME$A),'TV Squared',NAME$A),'tv squared',NAME$A),'tv Squared',NAME$A);
|
1528
1578
|
|
1529
|
-
var DIR_NAME$
|
1579
|
+
var DIR_NAME$z='VWO';var NAME$z='VWO';var DISPLAY_NAME$z='VWO';_defineProperty({},DISPLAY_NAME$z,DIR_NAME$z);_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},NAME$z,NAME$z),"VisualWebsiteOptimizer",NAME$z),"Visualwebsiteoptimizer",NAME$z),"visualwebsiteoptimizer",NAME$z),"vwo",NAME$z),'Visual Website Optimizer',NAME$z),'Visual website optimizer',NAME$z),'visual website optimizer',NAME$z);
|
1530
1580
|
|
1531
|
-
var DIR_NAME$
|
1581
|
+
var DIR_NAME$y='GA360';var NAME$y='GA360';var DISPLAY_NAME$y='Google Analytics 360';_defineProperty({},DISPLAY_NAME$y,DIR_NAME$y);_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},NAME$y,NAME$y),'Google Analytics 360',NAME$y),'Google analytics 360',NAME$y),'google analytics 360',NAME$y),'Google Analytics360',NAME$y),'Google analytics360',NAME$y),'google analytics360',NAME$y),"GoogleAnalytics360",NAME$y),'GA 360',NAME$y);
|
1532
1582
|
|
1533
|
-
var DIR_NAME$
|
1583
|
+
var DIR_NAME$x='Adroll';var NAME$x='ADROLL';var DISPLAY_NAME$x='Adroll';_defineProperty({},DISPLAY_NAME$x,DIR_NAME$x);_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},NAME$x,NAME$x),"Adroll",NAME$x),'Ad roll',NAME$x),'ad roll',NAME$x),"adroll",NAME$x);
|
1534
1584
|
|
1535
|
-
var DIR_NAME$
|
1585
|
+
var DIR_NAME$w='DCMFloodlight';var NAME$w='DCM_FLOODLIGHT';var DISPLAY_NAME$w='DCM Floodlight';_defineProperty({},DISPLAY_NAME$w,DIR_NAME$w);_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},NAME$w,NAME$w),'DCM Floodlight',NAME$w),'dcm floodlight',NAME$w),'Dcm Floodlight',NAME$w),"DCMFloodlight",NAME$w),"dcmfloodlight",NAME$w),"DcmFloodlight",NAME$w),"dcm_floodlight",NAME$w),"DCM_Floodlight",NAME$w);
|
1536
1586
|
|
1537
|
-
var DIR_NAME$
|
1587
|
+
var DIR_NAME$v='Matomo';var NAME$v='MATOMO';var DISPLAY_NAME$v='Matomo';_defineProperty({},DISPLAY_NAME$v,DIR_NAME$v);_defineProperty(_defineProperty(_defineProperty({},NAME$v,NAME$v),"Matomo",NAME$v),"matomo",NAME$v);
|
1538
1588
|
|
1539
|
-
var DIR_NAME$
|
1589
|
+
var DIR_NAME$u='Vero';var NAME$u='VERO';var DISPLAY_NAME$u='Vero';_defineProperty({},DISPLAY_NAME$u,DIR_NAME$u);_defineProperty(_defineProperty(_defineProperty({},NAME$u,NAME$u),"Vero",NAME$u),"vero",NAME$u);
|
1540
1590
|
|
1541
|
-
var DIR_NAME$
|
1591
|
+
var DIR_NAME$t='Mouseflow';var NAME$t='MOUSEFLOW';var DISPLAY_NAME$t='Mouseflow';_defineProperty({},DISPLAY_NAME$t,DIR_NAME$t);_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},NAME$t,NAME$t),"Mouseflow",NAME$t),"mouseflow",NAME$t),"mouseFlow",NAME$t),"MouseFlow",NAME$t),'Mouse flow',NAME$t),'mouse flow',NAME$t),'mouse Flow',NAME$t),'Mouse Flow',NAME$t);
|
1542
1592
|
|
1543
|
-
var DIR_NAME$
|
1593
|
+
var DIR_NAME$s='Rockerbox';var NAME$s='ROCKERBOX';var DISPLAY_NAME$s='Rockerbox';_defineProperty({},DISPLAY_NAME$s,DIR_NAME$s);_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},NAME$s,NAME$s),"Rockerbox",NAME$s),"rockerbox",NAME$s),"RockerBox",NAME$s),'Rocker box',NAME$s),'rocker box',NAME$s),'Rocker Box',NAME$s);
|
1544
1594
|
|
1545
|
-
var DIR_NAME$
|
1595
|
+
var DIR_NAME$r='ConvertFlow';var NAME$r='CONVERTFLOW';var DISPLAY_NAME$r='ConvertFlow';_defineProperty({},DISPLAY_NAME$r,DIR_NAME$r);_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},NAME$r,NAME$r),"Convertflow",NAME$r),"convertflow",NAME$r),"convertFlow",NAME$r),"ConvertFlow",NAME$r),'Convert flow',NAME$r),'convert flow',NAME$r),'convert Flow',NAME$r),'Convert Flow',NAME$r),'CONVERT FLOW',NAME$r);
|
1546
1596
|
|
1547
|
-
var DIR_NAME$
|
1597
|
+
var DIR_NAME$q='SnapEngage';var NAME$q='SNAPENGAGE';var DISPLAY_NAME$q='SnapEngage';_defineProperty({},DISPLAY_NAME$q,DIR_NAME$q);_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},NAME$q,NAME$q),"SnapEngage",NAME$q),"Snap_Engage",NAME$q),"snapengage",NAME$q),'SNAP ENGAGE',NAME$q),'Snap Engage',NAME$q),'snap engage',NAME$q);
|
1548
1598
|
|
1549
|
-
var DIR_NAME$
|
1599
|
+
var DIR_NAME$p='LiveChat';var NAME$p='LIVECHAT';var DISPLAY_NAME$p='LiveChat';_defineProperty({},DISPLAY_NAME$p,DIR_NAME$p);_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},NAME$p,NAME$p),"LiveChat",NAME$p),"Live_Chat",NAME$p),"livechat",NAME$p),'LIVE CHAT',NAME$p),'Live Chat',NAME$p),'live chat',NAME$p);
|
1550
1600
|
|
1551
|
-
var DIR_NAME$
|
1601
|
+
var DIR_NAME$o='Shynet';var NAME$o='SHYNET';var DISPLAY_NAME$o='Shynet';_defineProperty({},DISPLAY_NAME$o,DIR_NAME$o);_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},NAME$o,NAME$o),"shynet",NAME$o),"ShyNet",NAME$o),"shyNet",NAME$o),"Shynet",NAME$o),'shy net',NAME$o),'Shy Net',NAME$o),'shy Net',NAME$o),'Shy net',NAME$o);
|
1552
1602
|
|
1553
|
-
var DIR_NAME$
|
1603
|
+
var DIR_NAME$n='Woopra';var NAME$n='WOOPRA';var DISPLAY_NAME$n='Woopra';_defineProperty({},DISPLAY_NAME$n,DIR_NAME$n);_defineProperty(_defineProperty(_defineProperty({},NAME$n,NAME$n),"Woopra",NAME$n),"woopra",NAME$n);
|
1554
1604
|
|
1555
|
-
var DIR_NAME$
|
1605
|
+
var DIR_NAME$m='RollBar';var NAME$m='ROLLBAR';var DISPLAY_NAME$m='RollBar';_defineProperty({},DISPLAY_NAME$m,DIR_NAME$m);_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},NAME$m,NAME$m),"RollBar",NAME$m),"Roll_Bar",NAME$m),"rollbar",NAME$m),"Rollbar",NAME$m),'ROLL BAR',NAME$m),'Roll Bar',NAME$m),'roll bar',NAME$m);
|
1556
1606
|
|
1557
|
-
var DIR_NAME$
|
1607
|
+
var DIR_NAME$l='QuoraPixel';var NAME$l='QUORA_PIXEL';var DISPLAY_NAME$l='Quora Pixel';_defineProperty({},DISPLAY_NAME$l,DIR_NAME$l);_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},NAME$l,NAME$l),'Quora Pixel',NAME$l),'Quora pixel',NAME$l),'QUORA PIXEL',NAME$l),"QuoraPixel",NAME$l),"Quorapixel",NAME$l),"QUORAPIXEL",NAME$l),"Quora_Pixel",NAME$l),"quora_pixel",NAME$l),"Quora",NAME$l);
|
1558
1608
|
|
1559
|
-
var DIR_NAME$
|
1609
|
+
var DIR_NAME$k='June';var NAME$k='JUNE';var DISPLAY_NAME$k='JUNE';_defineProperty({},DISPLAY_NAME$k,DIR_NAME$k);_defineProperty(_defineProperty(_defineProperty({},NAME$k,NAME$k),"June",NAME$k),"june",NAME$k);
|
1560
1610
|
|
1561
|
-
var DIR_NAME$
|
1611
|
+
var DIR_NAME$j='Engage';var NAME$j='ENGAGE';var DISPLAY_NAME$j='Engage';_defineProperty({},DISPLAY_NAME$j,DIR_NAME$j);_defineProperty(_defineProperty(_defineProperty({},NAME$j,NAME$j),"Engage",NAME$j),"engage",NAME$j);
|
1562
1612
|
|
1563
|
-
var DIR_NAME$
|
1613
|
+
var DIR_NAME$i='Iterable';var NAME$i='ITERABLE';var DISPLAY_NAME$i='Iterable';_defineProperty({},DISPLAY_NAME$i,DIR_NAME$i);_defineProperty(_defineProperty(_defineProperty({},NAME$i,NAME$i),"Iterable",NAME$i),"iterable",NAME$i);
|
1564
1614
|
|
1565
|
-
var DIR_NAME$
|
1615
|
+
var DIR_NAME$h='YandexMetrica';var NAME$h='YANDEX_METRICA';var DISPLAY_NAME$h='Yandex.Metrica';_defineProperty({},DISPLAY_NAME$h,DIR_NAME$h);_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},NAME$h,NAME$h),"Yandexmetrica",NAME$h),"yandexmetrica",NAME$h),"yandexMetrica",NAME$h),"YandexMetrica",NAME$h);
|
1566
1616
|
|
1567
|
-
var DIR_NAME$
|
1617
|
+
var DIR_NAME$g='Refiner';var NAME$g='REFINER';var DISPLAY_NAME$g='Refiner';_defineProperty({},DISPLAY_NAME$g,DIR_NAME$g);_defineProperty(_defineProperty(_defineProperty({},NAME$g,NAME$g),"Refiner",NAME$g),"refiner",NAME$g);
|
1568
1618
|
|
1569
|
-
var DIR_NAME$
|
1619
|
+
var DIR_NAME$f='Qualaroo';var NAME$f='QUALAROO';var DISPLAY_NAME$f='Qualaroo';_defineProperty({},DISPLAY_NAME$f,DIR_NAME$f);_defineProperty(_defineProperty(_defineProperty({},NAME$f,NAME$f),"Qualaroo",NAME$f),"qualaroo",NAME$f);
|
1570
1620
|
|
1571
|
-
var DIR_NAME$
|
1621
|
+
var DIR_NAME$e='Podsights';var NAME$e='PODSIGHTS';var DISPLAY_NAME$e='Podsights';_defineProperty({},DISPLAY_NAME$e,DIR_NAME$e);_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},NAME$e,NAME$e),"Podsights",NAME$e),"PodSights",NAME$e),'pod Sights',NAME$e),'Pod Sights',NAME$e),'pod sights',NAME$e),'POD SIGHTS',NAME$e),'Pod sights',NAME$e);
|
1572
1622
|
|
1573
|
-
var DIR_NAME$
|
1623
|
+
var DIR_NAME$d='Axeptio';var NAME$d='AXEPTIO';var DISPLAY_NAME$d='Axeptio';_defineProperty({},DISPLAY_NAME$d,DIR_NAME$d);_defineProperty(_defineProperty(_defineProperty({},NAME$d,NAME$d),"Axeptio",NAME$d),"axeptio",NAME$d);
|
1574
1624
|
|
1575
|
-
var DIR_NAME$
|
1625
|
+
var DIR_NAME$c='Satismeter';var NAME$c='SATISMETER';var DISPLAY_NAME$c='Satismeter';_defineProperty({},DISPLAY_NAME$c,DIR_NAME$c);_defineProperty(_defineProperty(_defineProperty({},NAME$c,NAME$c),"Satismeter",NAME$c),"SatisMeter",NAME$c);
|
1576
1626
|
|
1577
|
-
var DIR_NAME$
|
1627
|
+
var DIR_NAME$b='MicrosoftClarity';var NAME$b='MICROSOFT_CLARITY';var DISPLAY_NAME$b='Microsoft Clarity';_defineProperty({},DISPLAY_NAME$b,DIR_NAME$b);_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},NAME$b,NAME$b),'Microsoft Clarity',NAME$b),'Microsoft clarity',NAME$b),'microsoft clarity',NAME$b),"Microsoft_clarity",NAME$b),"MicrosoftClarity",NAME$b),"MICROSOFTCLARITY",NAME$b),"microsoftclarity",NAME$b),"microsoftClarity",NAME$b);
|
1578
1628
|
|
1579
|
-
var DIR_NAME$
|
1629
|
+
var DIR_NAME$a='Sendinblue';var NAME$a='SENDINBLUE';var DISPLAY_NAME$a='Sendinblue';_defineProperty({},DISPLAY_NAME$a,DIR_NAME$a);_defineProperty(_defineProperty(_defineProperty(_defineProperty({},NAME$a,NAME$a),"Sendinblue",NAME$a),"sendinblue",NAME$a),"SendinBlue",NAME$a);
|
1580
1630
|
|
1581
|
-
var DIR_NAME$
|
1631
|
+
var DIR_NAME$9='Olark';var NAME$9='OLARK';var DISPLAY_NAME$9='Olark';_defineProperty({},DISPLAY_NAME$9,DIR_NAME$9);_defineProperty(_defineProperty(_defineProperty({},NAME$9,NAME$9),"Olark",NAME$9),"olark",NAME$9);
|
1582
1632
|
|
1583
|
-
var DIR_NAME$
|
1633
|
+
var DIR_NAME$8='Lemnisk';var NAME$8='LEMNISK';var DISPLAY_NAME$8='Lemnisk';_defineProperty({},DISPLAY_NAME$8,DIR_NAME$8);_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},NAME$8,NAME$8),"LEMNISK_MARKETING_AUTOMATION",NAME$8),'Lemnisk Marketing Automation',NAME$8),"LemniskMarketingAutomation",NAME$8),"lemniskmarketingautomation",NAME$8),"lemniskMarketingAutomation",NAME$8),"lemnisk",NAME$8),"Lemnisk",NAME$8);
|
1584
1634
|
|
1585
|
-
var DIR_NAME$
|
1635
|
+
var DIR_NAME$7='TiktokAds';var NAME$7='TIKTOK_ADS';var DISPLAY_NAME$7='TikTok Ads';_defineProperty({},DISPLAY_NAME$7,DIR_NAME$7);_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},NAME$7,NAME$7),"TiktokAds",NAME$7),'Tiktok ads',NAME$7),'Tiktok Ads',NAME$7),'Tik Tok Ads',NAME$7),'tik tok ads',NAME$7),"tiktokads",NAME$7);
|
1586
1636
|
|
1587
|
-
var DIR_NAME$
|
1637
|
+
var DIR_NAME$6='ActiveCampaign';var NAME$6='ACTIVE_CAMPAIGN';var DISPLAY_NAME$6='Active Campaign';_defineProperty({},DISPLAY_NAME$6,DIR_NAME$6);_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({ActiveCampaign:NAME$6,'Active Campaign':NAME$6,'ACTIVE CAMPAIGN':NAME$6},NAME$6,NAME$6),"activecampaign",NAME$6),'active campaign',NAME$6),'Active campaign',NAME$6),'active Campaign',NAME$6),"active_campaign",NAME$6);
|
1588
1638
|
|
1589
|
-
var DIR_NAME$
|
1639
|
+
var DIR_NAME$5='Sprig';var NAME$5='SPRIG';var DISPLAY_NAME$5='Sprig';_defineProperty({},DISPLAY_NAME$5,DIR_NAME$5);_defineProperty(_defineProperty(_defineProperty({},NAME$5,NAME$5),"Sprig",NAME$5),"sprig",NAME$5);
|
1590
1640
|
|
1591
|
-
var DIR_NAME$
|
1641
|
+
var DIR_NAME$4='SpotifyPixel';var NAME$4='SPOTIFYPIXEL';var DISPLAY_NAME$4='Spotify Pixel';_defineProperty({},DISPLAY_NAME$4,DIR_NAME$4);_defineProperty(_defineProperty(_defineProperty(_defineProperty({},NAME$4,NAME$4),'Spotify Pixel',NAME$4),'spotify pixel',NAME$4),"SPOTIFY_PIXEL",NAME$4);
|
1592
1642
|
|
1593
|
-
var DIR_NAME$
|
1643
|
+
var DIR_NAME$3='CommandBar';var NAME$3='COMMANDBAR';var DISPLAY_NAME$3='CommandBar';_defineProperty({},DISPLAY_NAME$3,DIR_NAME$3);_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},NAME$3,NAME$3),'Command Bar',NAME$3),'Commandbar',NAME$3),"COMMAND_BAR",NAME$3),"commandbar",NAME$3);
|
1594
1644
|
|
1595
|
-
var DIR_NAME$
|
1645
|
+
var DIR_NAME$2='Ninetailed';var NAME$2='NINETAILED';var DISPLAY_NAME$2='Ninetailed';_defineProperty({},DISPLAY_NAME$2,DIR_NAME$2);_defineProperty(_defineProperty(_defineProperty(_defineProperty({},NAME$2,NAME$2),"Ninetailed",NAME$2),"ninetailed",NAME$2),"NineTailed",NAME$2);
|
1646
|
+
|
1647
|
+
var DIR_NAME$1='Gainsight_PX';var NAME$1='GAINSIGHT_PX';var DISPLAY_NAME$1='Gainsight PX';_defineProperty({},DISPLAY_NAME$1,DIR_NAME$1);_defineProperty(_defineProperty({},NAME$1,NAME$1),"Gainsight_PX",NAME$1);
|
1596
1648
|
|
1597
1649
|
var DIR_NAME='XPixel';var NAME='XPIXEL';var DISPLAY_NAME='XPixel';_defineProperty({},DISPLAY_NAME,DIR_NAME);_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},NAME,NAME),"XPIXEL",NAME),"XPixel",NAME),"Xpixel",NAME),"xpixel",NAME),"xPixel",NAME);
|
1598
1650
|
|
1599
1651
|
var _destDisplayNamesToFi;// map of the destination display names to the destination directory names
|
1600
|
-
var destDisplayNamesToFileNamesMap=(_destDisplayNamesToFi={},_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_destDisplayNamesToFi,DISPLAY_NAME$
|
1652
|
+
var destDisplayNamesToFileNamesMap=(_destDisplayNamesToFi={},_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_destDisplayNamesToFi,DISPLAY_NAME$W,DIR_NAME$W),DISPLAY_NAME$12,DIR_NAME$12),DISPLAY_NAME$X,DIR_NAME$X),DISPLAY_NAME$$,DIR_NAME$$),DISPLAY_NAME$z,DIR_NAME$z),DISPLAY_NAME$Z,DIR_NAME$Z),DISPLAY_NAME$1c,DIR_NAME$1c),DISPLAY_NAME$V,DIR_NAME$V),DISPLAY_NAME$U,DIR_NAME$U),DISPLAY_NAME$T,DIR_NAME$T),_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_destDisplayNamesToFi,DISPLAY_NAME$16,DIR_NAME$16),DISPLAY_NAME$1a,DIR_NAME$1a),DISPLAY_NAME$18,DIR_NAME$18),DISPLAY_NAME$14,DIR_NAME$14),DISPLAY_NAME$P,DIR_NAME$P),DISPLAY_NAME$L,DIR_NAME$L),DISPLAY_NAME$1b,DIR_NAME$1b),DISPLAY_NAME$13,DIR_NAME$13),DISPLAY_NAME$A,DIR_NAME$A),DISPLAY_NAME$11,DIR_NAME$11),_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_destDisplayNamesToFi,DISPLAY_NAME$10,DIR_NAME$10),DISPLAY_NAME$M,DIR_NAME$M),DISPLAY_NAME$1f,DIR_NAME$1f),DISPLAY_NAME$K,DIR_NAME$K),DISPLAY_NAME$O,DIR_NAME$O),DISPLAY_NAME$1e,DIR_NAME$1e),DISPLAY_NAME$H,DIR_NAME$H),DISPLAY_NAME$S,DIR_NAME$S),DISPLAY_NAME$19,DIR_NAME$19),DISPLAY_NAME$1d,DIR_NAME$1d),_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_destDisplayNamesToFi,DISPLAY_NAME$J,DIR_NAME$J),DISPLAY_NAME$1g,DIR_NAME$1g),DISPLAY_NAME$Q,DIR_NAME$Q),DISPLAY_NAME$D,DIR_NAME$D),DISPLAY_NAME$15,DIR_NAME$15),DISPLAY_NAME$Y,DIR_NAME$Y),DISPLAY_NAME$17,DIR_NAME$17),DISPLAY_NAME$N,DIR_NAME$N),DISPLAY_NAME$F,DIR_NAME$F),DISPLAY_NAME$G,DIR_NAME$G),_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_destDisplayNamesToFi,DISPLAY_NAME$C,DIR_NAME$C),DISPLAY_NAME$E,DIR_NAME$E),DISPLAY_NAME$B,DIR_NAME$B),DISPLAY_NAME$I,DIR_NAME$I),DISPLAY_NAME$_,DIR_NAME$_),DISPLAY_NAME$R,DIR_NAME$R),DISPLAY_NAME$y,DIR_NAME$y),DISPLAY_NAME$x,DIR_NAME$x),DISPLAY_NAME$w,DIR_NAME$w),DISPLAY_NAME$v,DIR_NAME$v),_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_destDisplayNamesToFi,DISPLAY_NAME$u,DIR_NAME$u),DISPLAY_NAME$t,DIR_NAME$t),DISPLAY_NAME$s,DIR_NAME$s),DISPLAY_NAME$r,DIR_NAME$r),DISPLAY_NAME$q,DIR_NAME$q),DISPLAY_NAME$p,DIR_NAME$p),DISPLAY_NAME$o,DIR_NAME$o),DISPLAY_NAME$n,DIR_NAME$n),DISPLAY_NAME$m,DIR_NAME$m),DISPLAY_NAME$l,DIR_NAME$l),_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_destDisplayNamesToFi,DISPLAY_NAME$k,DIR_NAME$k),DISPLAY_NAME$j,DIR_NAME$j),DISPLAY_NAME$i,DIR_NAME$i),DISPLAY_NAME$h,DIR_NAME$h),DISPLAY_NAME$g,DIR_NAME$g),DISPLAY_NAME$f,DIR_NAME$f),DISPLAY_NAME$e,DIR_NAME$e),DISPLAY_NAME$d,DIR_NAME$d),DISPLAY_NAME$c,DIR_NAME$c),DISPLAY_NAME$b,DIR_NAME$b),_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_destDisplayNamesToFi,DISPLAY_NAME$a,DIR_NAME$a),DISPLAY_NAME$9,DIR_NAME$9),DISPLAY_NAME$8,DIR_NAME$8),DISPLAY_NAME$7,DIR_NAME$7),DISPLAY_NAME$6,DIR_NAME$6),DISPLAY_NAME$5,DIR_NAME$5),DISPLAY_NAME$4,DIR_NAME$4),DISPLAY_NAME$3,DIR_NAME$3),DISPLAY_NAME$2,DIR_NAME$2),DISPLAY_NAME$1,DIR_NAME$1),_defineProperty(_destDisplayNamesToFi,DISPLAY_NAME,DIR_NAME));
|
1601
1653
|
|
1602
1654
|
var isDestIntgConfigTruthy=function isDestIntgConfigTruthy(destIntgConfig){return !isUndefined(destIntgConfig)&&Boolean(destIntgConfig)===true;};var isDestIntgConfigFalsy=function isDestIntgConfigFalsy(destIntgConfig){return !isUndefined(destIntgConfig)&&Boolean(destIntgConfig)===false;};/**
|
1603
1655
|
* Filters the destinations that should not be loaded or forwarded events to based on the integration options (load or events API)
|
@@ -1630,7 +1682,7 @@
|
|
1630
1682
|
if(isHybridModeDestination(initializedDestination)){state.nativeDestinations.integrationsConfig.value=getCumulativeIntegrationsConfig(initializedDestination,state.nativeDestinations.integrationsConfig.value,errorHandler);}state.nativeDestinations.initializedDestinations.value=[].concat(_toConsumableArray(state.nativeDestinations.initializedDestinations.value),[initializedDestination]);}).catch(function(err){state.nativeDestinations.failedDestinations.value=[].concat(_toConsumableArray(state.nativeDestinations.failedDestinations.value),[dest]);// The error message is already formatted in the isDestinationReady function
|
1631
1683
|
logger===null||logger===void 0||logger.error(err);});}catch(err){state.nativeDestinations.failedDestinations.value=[].concat(_toConsumableArray(state.nativeDestinations.failedDestinations.value),[dest]);errorHandler===null||errorHandler===void 0||errorHandler.onError(err,DEVICE_MODE_DESTINATIONS_PLUGIN,DESTINATION_INIT_ERROR(dest.userFriendlyId));}};
|
1632
1684
|
|
1633
|
-
var pluginName$
|
1685
|
+
var pluginName$c='DeviceModeDestinations';var DeviceModeDestinations=function DeviceModeDestinations(){return {name:pluginName$c,initialize:function initialize(state){state.plugins.loadedPlugins.value=[].concat(_toConsumableArray(state.plugins.loadedPlugins.value),[pluginName$c]);},nativeDestinations:{setActiveDestinations:function setActiveDestinations(state,pluginsManager,errorHandler,logger){var _state$consents$postC,_state$consents$postC2;state.nativeDestinations.loadIntegration.value=state.loadOptions.value.loadIntegration;// Filter destination that doesn't have mapping config-->Integration names
|
1634
1686
|
var configSupportedDestinations=state.nativeDestinations.configuredDestinations.value.filter(function(configDest){if(destDisplayNamesToFileNamesMap[configDest.displayName]){return true;}errorHandler===null||errorHandler===void 0||errorHandler.onError(new Error(DESTINATION_NOT_SUPPORTED_ERROR(configDest.userFriendlyId)),DEVICE_MODE_DESTINATIONS_PLUGIN);return false;});// Filter destinations that are disabled through load or consent API options
|
1635
1687
|
var destinationsToLoad=filterDestinations((_state$consents$postC=(_state$consents$postC2=state.consents.postConsent.value)===null||_state$consents$postC2===void 0?void 0:_state$consents$postC2.integrations)!==null&&_state$consents$postC!==void 0?_state$consents$postC:state.nativeDestinations.loadOnlyIntegrations.value,configSupportedDestinations);var consentedDestinations=destinationsToLoad.filter(function(dest){var _pluginsManager$invok;return(// if consent manager is not configured, then default to load the destination
|
1636
1688
|
(_pluginsManager$invok=pluginsManager.invokeSingle("consentManager.isDestinationConsented",state,dest.config,errorHandler,logger))!==null&&_pluginsManager$invok!==void 0?_pluginsManager$invok:true);});state.nativeDestinations.activeDestinations.value=consentedDestinations;},load:function load(state,externalSrcLoader,errorHandler,logger,externalScriptOnLoad){var integrationsCDNPath=state.lifecycle.integrationsCDNPath.value;var activeDestinations=state.nativeDestinations.activeDestinations.value;activeDestinations.forEach(function(dest){var sdkName=destDisplayNamesToFileNamesMap[dest.displayName];var destSDKIdentifier="".concat(sdkName,"_RS");// this is the name of the object loaded on the window
|
@@ -1648,7 +1700,7 @@
|
|
1648
1700
|
*/var createPayload=function createPayload(event,destinationIds,token){var orderNo=Date.now();var payload={metadata:{'Custom-Authorization':token},batch:[{orderNo:orderNo,destinationIds:destinationIds,event:event}]};return payload;};var sendTransformedEventToDestinations=function sendTransformedEventToDestinations(state,pluginsManager,destinationIds,result,status,event,errorHandler,logger){var NATIVE_DEST_EXT_POINT='destinationsEventsQueue.enqueueEventToDestination';var ACTION_TO_SEND_UNTRANSFORMED_EVENT='Sending untransformed event';var ACTION_TO_DROP_EVENT='Dropping the event';var destinations=state.nativeDestinations.initializedDestinations.value.filter(function(d){return d&&destinationIds.includes(d.id);});destinations.forEach(function(dest){try{var eventsToSend=[];switch(status){case 200:{var response=JSON.parse(result);var destTransformedResult=response.transformedBatch.find(function(e){return e.id===dest.id;});destTransformedResult===null||destTransformedResult===void 0||destTransformedResult.payload.forEach(function(tEvent){if(tEvent.status==='200'){eventsToSend.push(tEvent.event);}else {var reason='Unknown';if(tEvent.status==='410'){reason='Transformation is not available';}var action=ACTION_TO_DROP_EVENT;if(dest.propagateEventsUntransformedOnError===true){action=ACTION_TO_SEND_UNTRANSFORMED_EVENT;eventsToSend.push(event);logger===null||logger===void 0||logger.warn(DMT_TRANSFORMATION_UNSUCCESSFUL_ERROR(DMT_PLUGIN,dest.displayName,reason,action));}else {logger===null||logger===void 0||logger.error(DMT_TRANSFORMATION_UNSUCCESSFUL_ERROR(DMT_PLUGIN,dest.displayName,reason,action));}}});break;}// Transformation server access denied
|
1649
1701
|
case 404:{logger===null||logger===void 0||logger.warn(DMT_SERVER_ACCESS_DENIED_WARNING(DMT_PLUGIN));eventsToSend.push(event);break;}default:{if(dest.propagateEventsUntransformedOnError===true){logger===null||logger===void 0||logger.warn(DMT_REQUEST_FAILED_ERROR(DMT_PLUGIN,dest.displayName,status,ACTION_TO_SEND_UNTRANSFORMED_EVENT));eventsToSend.push(event);}else {logger===null||logger===void 0||logger.error(DMT_REQUEST_FAILED_ERROR(DMT_PLUGIN,dest.displayName,status,ACTION_TO_DROP_EVENT));}break;}}eventsToSend===null||eventsToSend===void 0||eventsToSend.forEach(function(tEvent){if(isNonEmptyObject(tEvent)){pluginsManager.invokeSingle(NATIVE_DEST_EXT_POINT,state,tEvent,dest,errorHandler,logger);}});}catch(e){errorHandler===null||errorHandler===void 0||errorHandler.onError(e,DMT_PLUGIN,DMT_EXCEPTION(dest.displayName));}});};
|
1650
1702
|
|
1651
|
-
var pluginName$
|
1703
|
+
var pluginName$b='DeviceModeTransformation';var DeviceModeTransformation=function DeviceModeTransformation(){return {name:pluginName$b,deps:[],initialize:function initialize(state){state.plugins.loadedPlugins.value=[].concat(_toConsumableArray(state.plugins.loadedPlugins.value),[pluginName$b]);},transformEvent:{init:function init(state,pluginsManager,httpClient,storeManager,errorHandler,logger){var writeKey=state.lifecycle.writeKey.value;httpClient.setAuthHeader(writeKey);var eventsQueue=new RetryQueue(// adding write key to the queue name to avoid conflicts
|
1652
1704
|
"".concat(QUEUE_NAME$2,"_").concat(writeKey),DEFAULT_TRANSFORMATION_QUEUE_OPTIONS,function(item,done,attemptNumber,maxRetryAttempts){var payload=createPayload(item.event,item.destinationIds,item.token);httpClient.getAsyncData({url:"".concat(state.lifecycle.activeDataplaneUrl.value,"/transform"),options:{method:'POST',data:getDMTDeliveryPayload(payload),sendRawData:true},isRawResponse:true,timeout:REQUEST_TIMEOUT_MS$2,callback:function callback(result,details){// null means item will not be requeued
|
1653
1705
|
var queueErrResp=isErrRetryable(details)?details:null;if(!queueErrResp||attemptNumber===maxRetryAttempts){var _details$xhr;sendTransformedEventToDestinations(state,pluginsManager,item.destinationIds,result,details===null||details===void 0||(_details$xhr=details.xhr)===null||_details$xhr===void 0?void 0:_details$xhr.status,item.event,errorHandler,logger);}done(queueErrResp,result);}});},storeManager,MEMORY_STORAGE);return eventsQueue;},enqueue:function enqueue(state,eventsQueue,event,destinations){var destinationIds=destinations.map(function(d){return d.id;});eventsQueue.addItem({event:event,destinationIds:destinationIds,token:state.session.authToken.value});}}};};
|
1654
1706
|
|
@@ -1724,7 +1776,7 @@
|
|
1724
1776
|
|
1725
1777
|
var INVALID_SOURCE_CONFIG_ERROR="Invalid source configuration or source id.";
|
1726
1778
|
|
1727
|
-
var pluginName$
|
1779
|
+
var pluginName$a='ErrorReporting';var ErrorReporting=function ErrorReporting(){return {name:pluginName$a,deps:[],initialize:function initialize(state){var _state$reporting$brea;state.plugins.loadedPlugins.value=[].concat(_toConsumableArray(state.plugins.loadedPlugins.value),[pluginName$a]);state.reporting.isErrorReportingPluginLoaded.value=true;if((_state$reporting$brea=state.reporting.breadcrumbs)!==null&&_state$reporting$brea!==void 0&&_state$reporting$brea.value){state.reporting.breadcrumbs.value=[createNewBreadcrumb('Error Reporting Plugin Loaded')];}},errorReporting:{// This extension point is deprecated
|
1728
1780
|
// TODO: Remove this in the next major release
|
1729
1781
|
init:function init(state,pluginEngine,externalSrcLoader,logger,isInvokedFromLatestCore){var _state$source$value,_state$source$value2;if(isInvokedFromLatestCore){return undefined;}if(!((_state$source$value=state.source.value)!==null&&_state$source$value!==void 0&&_state$source$value.config)||!((_state$source$value2=state.source.value)!==null&&_state$source$value2!==void 0&&_state$source$value2.id)){return Promise.reject(new Error(INVALID_SOURCE_CONFIG_ERROR));}return pluginEngine.invokeSingle('errorReportingProvider.init',state,externalSrcLoader,logger);},notify:function notify(pluginEngine,client,error,state,logger,httpClient,errorState){if(httpClient){var _getConfigForPayloadC=getConfigForPayloadCreation(error,errorState===null||errorState===void 0?void 0:errorState.severityReason.type),component=_getConfigForPayloadC.component,normalizedError=_getConfigForPayloadC.normalizedError;// Generate the error payload
|
1730
1782
|
var errorPayload=ErrorFormat.create(normalizedError,component,logger);if(!errorPayload||!isAllowedToBeNotified(errorPayload.errors[0])){return;}// filter errors
|
@@ -1741,7 +1793,7 @@
|
|
1741
1793
|
*/var lsEngine=getStorageEngine(LOCAL_STORAGE);if(lsEngine!==null&&lsEngine!==void 0&&lsEngine.isEnabled){anonymousId=lsEngine.getItem(externallyLoadedSessionStorageKeys.segment);}// If anonymousId is not present in local storage and find it in cookies
|
1742
1794
|
var csEngine=getStorageEngine(COOKIE_STORAGE);if(!anonymousId&&csEngine!==null&&csEngine!==void 0&&csEngine.isEnabled){anonymousId=csEngine.getItem(externallyLoadedSessionStorageKeys.segment);}return anonymousId;};
|
1743
1795
|
|
1744
|
-
var pluginName$
|
1796
|
+
var pluginName$9='ExternalAnonymousId';var ExternalAnonymousId=function ExternalAnonymousId(){return {name:pluginName$9,initialize:function initialize(state){state.plugins.loadedPlugins.value=[].concat(_toConsumableArray(state.plugins.loadedPlugins.value),[pluginName$9]);},storage:{getAnonymousId:function getAnonymousId(getStorageEngine,options){var _options$autoCapture;var anonymousId;if(options!==null&&options!==void 0&&(_options$autoCapture=options.autoCapture)!==null&&_options$autoCapture!==void 0&&_options$autoCapture.enabled&&options.autoCapture.source){var source=options.autoCapture.source.toLowerCase();if(!Object.keys(externallyLoadedSessionStorageKeys).includes(source)){return anonymousId;}// eslint-disable-next-line sonarjs/no-small-switch
|
1745
1797
|
switch(source){case'segment':anonymousId=getSegmentAnonymousId(getStorageEngine);break;}}return anonymousId;}}};};
|
1746
1798
|
|
1747
1799
|
var AMP_LINKER_ANONYMOUS_ID_KEY='rs_amp_id';
|
@@ -1832,7 +1884,42 @@
|
|
1832
1884
|
* @return {?Object<string, string>}
|
1833
1885
|
*/var parseLinker=function parseLinker(value){var linkerObj=parseLinkerParamValue(value);if(!linkerObj){return null;}var checksum=linkerObj.checksum,serializedIds=linkerObj.serializedIds;if(!serializedIds||!checksum||!isCheckSumValid(serializedIds,checksum)){return null;}return deserialize(serializedIds);};
|
1834
1886
|
|
1835
|
-
var pluginName$
|
1887
|
+
var pluginName$8='GoogleLinker';var GoogleLinker=function GoogleLinker(){return {name:pluginName$8,initialize:function initialize(state){state.plugins.loadedPlugins.value=[].concat(_toConsumableArray(state.plugins.loadedPlugins.value),[pluginName$8]);},userSession:{anonymousIdGoogleLinker:function anonymousIdGoogleLinker(rudderAmpLinkerParam){if(!rudderAmpLinkerParam){return null;}var parsedAnonymousIdObj=rudderAmpLinkerParam?parseLinker(rudderAmpLinkerParam):null;return parsedAnonymousIdObj?parsedAnonymousIdObj[AMP_LINKER_ANONYMOUS_ID_KEY]:null;}}};};
|
1888
|
+
|
1889
|
+
var IUBENDA_CONSENT_COOKIE_READ_ERROR=function IUBENDA_CONSENT_COOKIE_READ_ERROR(context){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"Failed to read the consent cookie.");};var IUBENDA_CONSENT_COOKIE_PARSE_ERROR=function IUBENDA_CONSENT_COOKIE_PARSE_ERROR(context){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"Failed to parse the consent cookie.");};var DESTINATION_CONSENT_STATUS_ERROR$2="Failed to determine the consent status for the destination. Please check the destination configuration and try again.";
|
1890
|
+
|
1891
|
+
var IUBENDA_CONSENT_MANAGER_PLUGIN='IubendaConsentManagerPlugin';var IUBENDA_CONSENT_COOKIE_NAME_PATTERN=/^_iub_cs-\d+$/;
|
1892
|
+
|
1893
|
+
var getIubendaCookieName=function getIubendaCookieName(logger){try{// Retrieve cookies as a string and split them into an array
|
1894
|
+
var cookies=document.cookie.split('; ');// Find the cookie that matches the iubenda cookie pattern
|
1895
|
+
var matchedCookie=cookies.find(function(cookie){var _cookie$split=cookie.split('='),_cookie$split2=_slicedToArray(_cookie$split,1),name=_cookie$split2[0];return IUBENDA_CONSENT_COOKIE_NAME_PATTERN.test((name||'').trim());});if(!matchedCookie){throw new Error('Iubenda Cookie not found with the specified pattern.');}// Extract and return the cookie name
|
1896
|
+
var _matchedCookie$split=matchedCookie.split('='),_matchedCookie$split2=_slicedToArray(_matchedCookie$split,1),name=_matchedCookie$split2[0];return name||'';}catch(err){logger===null||logger===void 0||logger.error(IUBENDA_CONSENT_COOKIE_READ_ERROR(IUBENDA_CONSENT_MANAGER_PLUGIN),err);return '';}};/**
|
1897
|
+
* Gets the consent data from the Iubenda's consent cookie
|
1898
|
+
* @param storeManager Store manager instance
|
1899
|
+
* @param logger Logger instance
|
1900
|
+
* @returns Consent data from the consent cookie
|
1901
|
+
*/var getIubendaConsentData=function getIubendaConsentData(storeManager,logger){var rawConsentCookieData=null;try{var dataStore=storeManager===null||storeManager===void 0?void 0:storeManager.setStore({id:IUBENDA_CONSENT_MANAGER_PLUGIN,name:IUBENDA_CONSENT_MANAGER_PLUGIN,type:COOKIE_STORAGE});rawConsentCookieData=dataStore===null||dataStore===void 0?void 0:dataStore.engine.getItem(getIubendaCookieName(logger));}catch(err){logger===null||logger===void 0||logger.error(IUBENDA_CONSENT_COOKIE_READ_ERROR(IUBENDA_CONSENT_MANAGER_PLUGIN),err);return undefined;}if(isNullOrUndefined(rawConsentCookieData)){return undefined;}// Decode and parse the cookie data to JSON
|
1902
|
+
var consentCookieData;try{consentCookieData=JSON.parse(decodeURIComponent(rawConsentCookieData));}catch(err){logger===null||logger===void 0||logger.error(IUBENDA_CONSENT_COOKIE_PARSE_ERROR(IUBENDA_CONSENT_MANAGER_PLUGIN),err);return undefined;}if(!consentCookieData){return undefined;}// Convert the cookie data to consent data
|
1903
|
+
var consentPurposes=consentCookieData.purposes;return consentPurposes;};/**
|
1904
|
+
* Gets the consent data in the format expected by the application state
|
1905
|
+
* @param iubendaConsentData Consent data derived from the consent cookie
|
1906
|
+
* @returns Consent data
|
1907
|
+
*/var getConsentData$1=function getConsentData(iubendaConsentData){var allowedConsentIds=[];var deniedConsentIds=[];if(iubendaConsentData){Object.entries(iubendaConsentData).forEach(function(e){var purposeId=e[0];var isConsented=e[1];if(isConsented){allowedConsentIds.push(purposeId);}else {deniedConsentIds.push(purposeId);}});}return {allowedConsentIds:allowedConsentIds,deniedConsentIds:deniedConsentIds};};var updateConsentStateFromData$1=function updateConsentStateFromData(state,iubendaConsentData){var consentData=getConsentData$1(iubendaConsentData);state.consents.initialized.value=isDefined(iubendaConsentData);state.consents.data.value=consentData;};
|
1908
|
+
|
1909
|
+
var pluginName$7='IubendaConsentManager';var IubendaConsentManager=function IubendaConsentManager(){return {name:pluginName$7,deps:[],initialize:function initialize(state){state.plugins.loadedPlugins.value=[].concat(_toConsumableArray(state.plugins.loadedPlugins.value),[pluginName$7]);},consentManager:{init:function init(state,logger){// getIubendaUserConsentedPurposes returns current iubenda opted-in purposes
|
1910
|
+
// This will be helpful for debugging
|
1911
|
+
globalThis.getIubendaUserConsentedPurposes=function(){var _state$consents$data$;return (_state$consents$data$=state.consents.data.value.allowedConsentIds)===null||_state$consents$data$===void 0?void 0:_state$consents$data$.slice();};// getIubendaUserDeniedPurposes returns current Iubenda opted-out purposes
|
1912
|
+
// This will be helpful for debugging
|
1913
|
+
globalThis.getIubendaUserDeniedPurposes=function(){var _state$consents$data$2;return (_state$consents$data$2=state.consents.data.value.deniedConsentIds)===null||_state$consents$data$2===void 0?void 0:_state$consents$data$2.slice();};// updateIubendaConsent callback function to update current consent purpose state
|
1914
|
+
globalThis.updateIubendaConsent=function(iubendaConsentData){updateConsentStateFromData$1(state,iubendaConsentData);};},updateConsentsInfo:function updateConsentsInfo(state,storeManager,logger){// retrieve consent data and update the state
|
1915
|
+
var iubendaConsentData;// From window
|
1916
|
+
if(!isUndefined(globalThis._iub.cs.consent.purposes)){iubendaConsentData=globalThis._iub.cs.consent.purposes;// From cookie
|
1917
|
+
}else {iubendaConsentData=getIubendaConsentData(storeManager,logger);}updateConsentStateFromData$1(state,iubendaConsentData);},isDestinationConsented:function isDestinationConsented(state,destConfig,errorHandler,logger){if(!state.consents.initialized.value){return true;}var allowedConsentIds=state.consents.data.value.allowedConsentIds;var matchPredicate=function matchPredicate(consent){return allowedConsentIds.includes(consent);};try{var consentManagement=destConfig.consentManagement;// If the destination does not have consent management config, events should be sent.
|
1918
|
+
if(consentManagement){var _cmpConfig$resolution;// Get the corresponding consents for the destination
|
1919
|
+
var cmpConfig=consentManagement.find(function(c){return c.provider===state.consents.provider.value;});// If there are no consents configured for the destination for the current provider, events should be sent.
|
1920
|
+
if(!(cmpConfig!==null&&cmpConfig!==void 0&&cmpConfig.consents)){return true;}var configuredConsents=cmpConfig.consents.map(function(c){return c.consent.trim();}).filter(function(n){return n;});var resolutionStrategy=(_cmpConfig$resolution=cmpConfig.resolutionStrategy)!==null&&_cmpConfig$resolution!==void 0?_cmpConfig$resolution:state.consents.resolutionStrategy.value;// match the configured consents with user provided consents as per
|
1921
|
+
// the configured resolution strategy
|
1922
|
+
switch(resolutionStrategy){case'or':return configuredConsents.some(matchPredicate)||configuredConsents.length===0;case'and':default:return configuredConsents.every(matchPredicate);}}return true;}catch(err){errorHandler===null||errorHandler===void 0||errorHandler.onError(err,IUBENDA_CONSENT_MANAGER_PLUGIN,DESTINATION_CONSENT_STATUS_ERROR$2);return true;}}}};};
|
1836
1923
|
|
1837
1924
|
var KETCH_CONSENT_COOKIE_READ_ERROR=function KETCH_CONSENT_COOKIE_READ_ERROR(context){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"Failed to read the consent cookie.");};var KETCH_CONSENT_COOKIE_PARSE_ERROR=function KETCH_CONSENT_COOKIE_PARSE_ERROR(context){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"Failed to parse the consent cookie.");};var DESTINATION_CONSENT_STATUS_ERROR$1="Failed to determine the consent status for the destination. Please check the destination configuration and try again.";
|
1838
1925
|
|
@@ -2983,7 +3070,7 @@
|
|
2983
3070
|
|
2984
3071
|
/**
|
2985
3072
|
* Map plugin names to direct code imports from plugins package
|
2986
|
-
*/var getBundledBuildPluginImports=function getBundledBuildPluginImports(){return {BeaconQueue:BeaconQueue,Bugsnag:Bugsnag,CustomConsentManager:CustomConsentManager,DeviceModeDestinations:DeviceModeDestinations,DeviceModeTransformation:DeviceModeTransformation,ErrorReporting:ErrorReporting,ExternalAnonymousId:ExternalAnonymousId,GoogleLinker:GoogleLinker,KetchConsentManager:KetchConsentManager,NativeDestinationQueue:NativeDestinationQueue,OneTrustConsentManager:OneTrustConsentManager,StorageEncryption:StorageEncryption,StorageEncryptionLegacy:StorageEncryptionLegacy,StorageMigrator:StorageMigrator,XhrQueue:XhrQueue};};
|
3073
|
+
*/var getBundledBuildPluginImports=function getBundledBuildPluginImports(){return {BeaconQueue:BeaconQueue,Bugsnag:Bugsnag,CustomConsentManager:CustomConsentManager,DeviceModeDestinations:DeviceModeDestinations,DeviceModeTransformation:DeviceModeTransformation,ErrorReporting:ErrorReporting,ExternalAnonymousId:ExternalAnonymousId,GoogleLinker:GoogleLinker,IubendaConsentManager:IubendaConsentManager,KetchConsentManager:KetchConsentManager,NativeDestinationQueue:NativeDestinationQueue,OneTrustConsentManager:OneTrustConsentManager,StorageEncryption:StorageEncryption,StorageEncryptionLegacy:StorageEncryptionLegacy,StorageMigrator:StorageMigrator,XhrQueue:XhrQueue};};
|
2987
3074
|
|
2988
3075
|
/**
|
2989
3076
|
* Map of mandatory plugin names and direct imports
|
@@ -3319,22 +3406,22 @@
|
|
3319
3406
|
* Updates the reporting state variables from the source config data
|
3320
3407
|
* @param res Source config
|
3321
3408
|
* @param logger Logger instance
|
3322
|
-
*/var updateReportingState=function updateReportingState(res){state.reporting.isErrorReportingEnabled.value=isErrorReportingEnabled(res.source.config)&&!isSDKRunningInChromeExtension();state.reporting.isMetricsReportingEnabled.value=isMetricsReportingEnabled(res.source.config);};var
|
3323
|
-
|
3324
|
-
|
3325
|
-
|
3326
|
-
|
3327
|
-
* 2. If the sameDomainCookiesOnly flag is set to true, then use the exact domain
|
3328
|
-
*/var useExactDomain=isDefined(providedCookieDomain)&&!isWebpageTopLevelDomain(removeLeadingPeriod(providedCookieDomain))||sameDomainCookiesOnly;var dataServiceUrl=getDataServiceUrl(dataServiceEndpoint!==null&&dataServiceEndpoint!==void 0?dataServiceEndpoint:DEFAULT_DATA_SERVICE_ENDPOINT,useExactDomain!==null&&useExactDomain!==void 0?useExactDomain:false);if(isValidURL(dataServiceUrl)){state.serverCookies.dataServiceUrl.value=_removeTrailingSlashes(dataServiceUrl);var curHost=getDomain(window.location.href);var dataServiceHost=getDomain(dataServiceUrl);// If the current host is different from the data service host, then it is a cross-site request
|
3409
|
+
*/var updateReportingState=function updateReportingState(res){state.reporting.isErrorReportingEnabled.value=isErrorReportingEnabled(res.source.config)&&!isSDKRunningInChromeExtension();state.reporting.isMetricsReportingEnabled.value=isMetricsReportingEnabled(res.source.config);};var getServerSideCookiesStateData=function getServerSideCookiesStateData(logger){var _state$loadOptions$va=state.loadOptions.value,useServerSideCookies=_state$loadOptions$va.useServerSideCookies,dataServiceEndpoint=_state$loadOptions$va.dataServiceEndpoint,storageOptsFromLoad=_state$loadOptions$va.storage,setCookieDomain=_state$loadOptions$va.setCookieDomain,sameDomainCookiesOnly=_state$loadOptions$va.sameDomainCookiesOnly;var cookieOptions=storageOptsFromLoad===null||storageOptsFromLoad===void 0?void 0:storageOptsFromLoad.cookie;var sscEnabled=false;var finalDataServiceUrl;if(useServerSideCookies){var _cookieOptions$domain;sscEnabled=useServerSideCookies;var providedCookieDomain=(_cookieOptions$domain=cookieOptions.domain)!==null&&_cookieOptions$domain!==void 0?_cookieOptions$domain:setCookieDomain;/**
|
3410
|
+
* Based on the following conditions, we decide whether to use the exact domain or not to determine the data service URL:
|
3411
|
+
* 1. If the cookie domain is provided and it is not a top-level domain, then use the exact domain
|
3412
|
+
* 2. If the sameDomainCookiesOnly flag is set to true, then use the exact domain
|
3413
|
+
*/var useExactDomain=isDefined(providedCookieDomain)&&!isWebpageTopLevelDomain(removeLeadingPeriod(providedCookieDomain))||sameDomainCookiesOnly;var dataServiceUrl=getDataServiceUrl(dataServiceEndpoint!==null&&dataServiceEndpoint!==void 0?dataServiceEndpoint:DEFAULT_DATA_SERVICE_ENDPOINT,useExactDomain);if(isValidURL(dataServiceUrl)){finalDataServiceUrl=_removeTrailingSlashes(dataServiceUrl);var curHost=getDomain(window.location.href);var dataServiceHost=getDomain(dataServiceUrl);// If the current host is different from the data service host, then it is a cross-site request
|
3329
3414
|
// For server-side cookies to work, we need to set the SameSite=None and Secure attributes
|
3330
3415
|
// One round of cookie options manipulation is taking place here
|
3331
3416
|
// Based on these(setCookieDomain/storage.cookie or sameDomainCookiesOnly) two load-options, final cookie options are set in the storage module
|
3332
3417
|
// TODO: Refactor the cookie options manipulation logic in one place
|
3333
3418
|
if(curHost!==dataServiceHost){cookieOptions=_objectSpread2(_objectSpread2({},cookieOptions),{},{samesite:'None',secure:true});}/**
|
3334
|
-
|
3335
|
-
|
3336
|
-
|
3337
|
-
|
3419
|
+
* If the sameDomainCookiesOnly flag is not set and the cookie domain is provided(not top level domain),
|
3420
|
+
* and the data service host is different from the provided cookie domain, then we disable server-side cookies
|
3421
|
+
* ex: provided cookie domain: 'random.com', data service host: 'sub.example.com'
|
3422
|
+
*/if(!sameDomainCookiesOnly&&useExactDomain&&dataServiceHost!==removeLeadingPeriod(providedCookieDomain)){sscEnabled=false;logger===null||logger===void 0||logger.warn(SERVER_SIDE_COOKIE_FEATURE_OVERRIDE_WARNING(CONFIG_MANAGER,providedCookieDomain,dataServiceHost));}}else {sscEnabled=false;}}return {sscEnabled:sscEnabled,cookieOptions:cookieOptions,finalDataServiceUrl:finalDataServiceUrl};};var updateStorageStateFromLoadOptions=function updateStorageStateFromLoadOptions(logger){var _storageOptsFromLoad$;var storageOptsFromLoad=state.loadOptions.value.storage;var storageType=storageOptsFromLoad===null||storageOptsFromLoad===void 0?void 0:storageOptsFromLoad.type;if(isDefined(storageType)&&!isValidStorageType(storageType)){logger===null||logger===void 0||logger.warn(STORAGE_TYPE_VALIDATION_WARNING(CONFIG_MANAGER,storageType,DEFAULT_STORAGE_TYPE));storageType=DEFAULT_STORAGE_TYPE;}var storageEncryptionVersion=storageOptsFromLoad===null||storageOptsFromLoad===void 0||(_storageOptsFromLoad$=storageOptsFromLoad.encryption)===null||_storageOptsFromLoad$===void 0?void 0:_storageOptsFromLoad$.version;var encryptionPluginName=storageEncryptionVersion&&StorageEncryptionVersionsToPluginNameMap[storageEncryptionVersion];if(!isUndefined(storageEncryptionVersion)&&isUndefined(encryptionPluginName)){// set the default encryption plugin
|
3423
|
+
logger===null||logger===void 0||logger.warn(UNSUPPORTED_STORAGE_ENCRYPTION_VERSION_WARNING(CONFIG_MANAGER,storageEncryptionVersion,StorageEncryptionVersionsToPluginNameMap,DEFAULT_STORAGE_ENCRYPTION_VERSION));storageEncryptionVersion=DEFAULT_STORAGE_ENCRYPTION_VERSION;}else if(isUndefined(storageEncryptionVersion)){storageEncryptionVersion=DEFAULT_STORAGE_ENCRYPTION_VERSION;}// Allow migration only if the configured encryption version is the default encryption version
|
3424
|
+
var configuredMigrationValue=storageOptsFromLoad===null||storageOptsFromLoad===void 0?void 0:storageOptsFromLoad.migrate;var finalMigrationVal=configuredMigrationValue&&storageEncryptionVersion===DEFAULT_STORAGE_ENCRYPTION_VERSION;if(configuredMigrationValue===true&&finalMigrationVal!==configuredMigrationValue){logger===null||logger===void 0||logger.warn(STORAGE_DATA_MIGRATION_OVERRIDE_WARNING(CONFIG_MANAGER,storageEncryptionVersion,DEFAULT_STORAGE_ENCRYPTION_VERSION));}var _getServerSideCookies=getServerSideCookiesStateData(logger),sscEnabled=_getServerSideCookies.sscEnabled,finalDataServiceUrl=_getServerSideCookies.finalDataServiceUrl,cookieOptions=_getServerSideCookies.cookieOptions;r(function(){state.storage.type.value=storageType;state.storage.cookie.value=cookieOptions;state.serverCookies.isEnabledServerSideCookies.value=sscEnabled;state.serverCookies.dataServiceUrl.value=finalDataServiceUrl;state.storage.encryptionPluginName.value=StorageEncryptionVersionsToPluginNameMap[storageEncryptionVersion];state.storage.migrate.value=finalMigrationVal;});};var updateConsentsStateFromLoadOptions=function updateConsentsStateFromLoadOptions(logger){var _preConsentOpts$stora,_preConsentOpts$stora2,_preConsentOpts$event,_preConsentOpts$event2;var _getConsentManagement=getConsentManagementData(state.loadOptions.value.consentManagement,logger),provider=_getConsentManagement.provider,consentManagerPluginName=_getConsentManagement.consentManagerPluginName,initialized=_getConsentManagement.initialized,enabled=_getConsentManagement.enabled,consentsData=_getConsentManagement.consentsData;// Pre-consent
|
3338
3425
|
var preConsentOpts=state.loadOptions.value.preConsent;var storageStrategy=(_preConsentOpts$stora=preConsentOpts===null||preConsentOpts===void 0||(_preConsentOpts$stora2=preConsentOpts.storage)===null||_preConsentOpts$stora2===void 0?void 0:_preConsentOpts$stora2.strategy)!==null&&_preConsentOpts$stora!==void 0?_preConsentOpts$stora:DEFAULT_PRE_CONSENT_STORAGE_STRATEGY;var StorageStrategies=['none','session','anonymousId'];if(isDefined(storageStrategy)&&!StorageStrategies.includes(storageStrategy)){var _preConsentOpts$stora3;storageStrategy=DEFAULT_PRE_CONSENT_STORAGE_STRATEGY;logger===null||logger===void 0||logger.warn(UNSUPPORTED_PRE_CONSENT_STORAGE_STRATEGY(CONFIG_MANAGER,preConsentOpts===null||preConsentOpts===void 0||(_preConsentOpts$stora3=preConsentOpts.storage)===null||_preConsentOpts$stora3===void 0?void 0:_preConsentOpts$stora3.strategy,DEFAULT_PRE_CONSENT_STORAGE_STRATEGY));}var eventsDeliveryType=(_preConsentOpts$event=preConsentOpts===null||preConsentOpts===void 0||(_preConsentOpts$event2=preConsentOpts.events)===null||_preConsentOpts$event2===void 0?void 0:_preConsentOpts$event2.delivery)!==null&&_preConsentOpts$event!==void 0?_preConsentOpts$event:DEFAULT_PRE_CONSENT_EVENTS_DELIVERY_TYPE;var deliveryTypes=['immediate','buffer'];if(isDefined(eventsDeliveryType)&&!deliveryTypes.includes(eventsDeliveryType)){var _preConsentOpts$event3;eventsDeliveryType=DEFAULT_PRE_CONSENT_EVENTS_DELIVERY_TYPE;logger===null||logger===void 0||logger.warn(UNSUPPORTED_PRE_CONSENT_EVENTS_DELIVERY_TYPE(CONFIG_MANAGER,preConsentOpts===null||preConsentOpts===void 0||(_preConsentOpts$event3=preConsentOpts.events)===null||_preConsentOpts$event3===void 0?void 0:_preConsentOpts$event3.delivery,DEFAULT_PRE_CONSENT_EVENTS_DELIVERY_TYPE));}r(function(){var _state$loadOptions$va2;state.consents.activeConsentManagerPluginName.value=consentManagerPluginName;state.consents.initialized.value=initialized;state.consents.enabled.value=enabled;state.consents.data.value=consentsData;state.consents.provider.value=provider;state.consents.preConsent.value={// Only enable pre-consent if it is explicitly enabled and
|
3339
3426
|
// if it is not already initialized and
|
3340
3427
|
// if consent management is enabled
|
@@ -3537,7 +3624,7 @@
|
|
3537
3624
|
* @param pageProps Page properties
|
3538
3625
|
* @param logger logger
|
3539
3626
|
* @returns Enriched RudderEvent object
|
3540
|
-
*/var getEnrichedEvent=function getEnrichedEvent(rudderEvent,options,pageProps,logger){var _state$storage$entrie;var commonEventData={channel:CHANNEL,context:_objectSpread2(_objectSpread2({traits:clone(state.session.userTraits.value),sessionId:state.session.sessionInfo.value.id||undefined,sessionStart:state.session.sessionInfo.value.sessionStart||undefined},state.consents.enabled.value&&{consentManagement:{deniedConsentIds:clone(state.consents.data.value.deniedConsentIds),allowedConsentIds:clone(state.consents.data.value.allowedConsentIds),provider:state.consents.provider.value,resolutionStrategy:state.consents.resolutionStrategy.value}}),{},{'ua-ch':state.context['ua-ch'].value,app:state.context.app.value,library:state.context.library.value,userAgent:state.context.userAgent.value,os:state.context.os.value,locale:state.context.locale.value,screen:state.context.screen.value,campaign:extractUTMParameters(globalThis.location.href),page:getContextPageProperties(pageProps),timezone:state.context.timezone.value}),originalTimestamp:getCurrentTimeFormatted(),messageId:generateUUID(),userId:rudderEvent.userId||state.session.userId.value};if(!isStorageTypeValidForStoringData((_state$storage$entrie=state.storage.entries.value.anonymousId)===null||_state$storage$entrie===void 0?void 0:_state$storage$entrie.type)){// Generate new anonymous id for each request
|
3627
|
+
*/var getEnrichedEvent=function getEnrichedEvent(rudderEvent,options,pageProps,logger){var _state$storage$entrie;var commonEventData={channel:CHANNEL,context:_objectSpread2(_objectSpread2({traits:clone(state.session.userTraits.value),sessionId:state.session.sessionInfo.value.id||undefined,sessionStart:state.session.sessionInfo.value.sessionStart||undefined},state.consents.enabled.value&&{consentManagement:{deniedConsentIds:clone(state.consents.data.value.deniedConsentIds),allowedConsentIds:clone(state.consents.data.value.allowedConsentIds),provider:state.consents.provider.value,resolutionStrategy:state.consents.resolutionStrategy.value}}),{},{'ua-ch':state.context['ua-ch'].value,app:state.context.app.value,library:state.context.library.value,userAgent:state.context.userAgent.value,os:state.context.os.value,locale:state.context.locale.value,screen:state.context.screen.value,campaign:extractUTMParameters(globalThis.location.href),page:getContextPageProperties(pageProps),timezone:state.context.timezone.value},state.autoTrack.enabled.value&&{autoTrack:_objectSpread2({},state.autoTrack.pageLifecycle.enabled.value&&{page:{visitId:state.autoTrack.pageLifecycle.visitId.value}})}),originalTimestamp:getCurrentTimeFormatted(),messageId:generateUUID(),userId:rudderEvent.userId||state.session.userId.value};if(!isStorageTypeValidForStoringData((_state$storage$entrie=state.storage.entries.value.anonymousId)===null||_state$storage$entrie===void 0?void 0:_state$storage$entrie.type)){// Generate new anonymous id for each request
|
3541
3628
|
commonEventData.anonymousId=generateAnonymousId();}else {// Type casting to string as the user session manager will take care of initializing the value
|
3542
3629
|
commonEventData.anonymousId=state.session.anonymousId.value;}// set truly anonymous tracking flag
|
3543
3630
|
if(state.storage.trulyAnonymousTracking.value){commonEventData.context.trulyAnonymousTracking=true;}if(rudderEvent.type==='identify'){var _state$storage$entrie2;commonEventData.context.traits=((_state$storage$entrie2=state.storage.entries.value.userTraits)===null||_state$storage$entrie2===void 0?void 0:_state$storage$entrie2.type)!==NO_STORAGE?clone(state.session.userTraits.value):rudderEvent.context.traits;}if(rudderEvent.type==='group'){if(rudderEvent.groupId||state.session.groupId.value){commonEventData.groupId=rudderEvent.groupId||state.session.groupId.value;}if(rudderEvent.traits||state.session.groupTraits.value){var _state$storage$entrie3;commonEventData.traits=((_state$storage$entrie3=state.storage.entries.value.groupTraits)===null||_state$storage$entrie3===void 0?void 0:_state$storage$entrie3.type)!==NO_STORAGE?clone(state.session.groupTraits.value):rudderEvent.traits;}}var processedEvent=mergeDeepRight(rudderEvent,commonEventData);// Set the default values for the event properties
|
@@ -3731,10 +3818,10 @@
|
|
3731
3818
|
|
3732
3819
|
/**
|
3733
3820
|
* Plugins to be loaded in the plugins loadOption is not defined
|
3734
|
-
*/var defaultOptionalPluginsList=['BeaconQueue','Bugsnag','CustomConsentManager','DeviceModeDestinations','DeviceModeTransformation','ErrorReporting','ExternalAnonymousId','GoogleLinker','KetchConsentManager','NativeDestinationQueue','OneTrustConsentManager','StorageEncryption','StorageEncryptionLegacy','StorageMigrator','XhrQueue'];
|
3821
|
+
*/var defaultOptionalPluginsList=['BeaconQueue','Bugsnag','CustomConsentManager','DeviceModeDestinations','DeviceModeTransformation','ErrorReporting','ExternalAnonymousId','GoogleLinker','IubendaConsentManager','KetchConsentManager','NativeDestinationQueue','OneTrustConsentManager','StorageEncryption','StorageEncryptionLegacy','StorageMigrator','XhrQueue'];
|
3735
3822
|
|
3736
3823
|
var normalizeLoadOptions=function normalizeLoadOptions(loadOptionsFromState,loadOptions){var _normalizedLoadOpts$p,_normalizedLoadOpts$s2;// TODO: Maybe add warnings for invalid values
|
3737
|
-
var normalizedLoadOpts=clone(loadOptions);if(!isString(normalizedLoadOpts.setCookieDomain)){delete normalizedLoadOpts.setCookieDomain;}var cookieSameSiteValues=['Strict','Lax','None'];if(!cookieSameSiteValues.includes(normalizedLoadOpts.sameSiteCookie)){delete normalizedLoadOpts.sameSiteCookie;}normalizedLoadOpts.secureCookie=normalizedLoadOpts.secureCookie===true;var uaChTrackLevels=['none','default','full'];if(!uaChTrackLevels.includes(normalizedLoadOpts.uaChTrackLevel)){delete normalizedLoadOpts.uaChTrackLevel;}if(!isNonEmptyObject(normalizedLoadOpts.integrations)){delete normalizedLoadOpts.integrations;}normalizedLoadOpts.plugins=(_normalizedLoadOpts$p=normalizedLoadOpts.plugins)!==null&&_normalizedLoadOpts$p!==void 0?_normalizedLoadOpts$p:defaultOptionalPluginsList;normalizedLoadOpts.useGlobalIntegrationsConfigInEvents=normalizedLoadOpts.useGlobalIntegrationsConfigInEvents===true;normalizedLoadOpts.bufferDataPlaneEventsUntilReady=normalizedLoadOpts.bufferDataPlaneEventsUntilReady===true;normalizedLoadOpts.sendAdblockPage=normalizedLoadOpts.sendAdblockPage===true;normalizedLoadOpts.useServerSideCookies=normalizedLoadOpts.useServerSideCookies===true;if(normalizedLoadOpts.dataServiceEndpoint&&typeof normalizedLoadOpts.dataServiceEndpoint!=='string'){delete normalizedLoadOpts.dataServiceEndpoint;}if(!isObjectLiteralAndNotNull(normalizedLoadOpts.sendAdblockPageOptions)){delete normalizedLoadOpts.sendAdblockPageOptions;}if(!isDefined(normalizedLoadOpts.loadIntegration)){delete normalizedLoadOpts.loadIntegration;}else {normalizedLoadOpts.loadIntegration=normalizedLoadOpts.loadIntegration===true;}if(!isObjectLiteralAndNotNull(normalizedLoadOpts.storage)){delete normalizedLoadOpts.storage;}else {var _normalizedLoadOpts$s;normalizedLoadOpts.storage=_removeUndefinedAndNullValues(normalizedLoadOpts.storage);normalizedLoadOpts.storage.migrate=((_normalizedLoadOpts$s=normalizedLoadOpts.storage)===null||_normalizedLoadOpts$s===void 0?void 0:_normalizedLoadOpts$s.migrate)===true;}if(!isObjectLiteralAndNotNull(normalizedLoadOpts.beaconQueueOptions)){delete normalizedLoadOpts.beaconQueueOptions;}else {normalizedLoadOpts.beaconQueueOptions=_removeUndefinedAndNullValues(normalizedLoadOpts.beaconQueueOptions);}if(!isObjectLiteralAndNotNull(normalizedLoadOpts.destinationsQueueOptions)){delete normalizedLoadOpts.destinationsQueueOptions;}else {normalizedLoadOpts.destinationsQueueOptions=_removeUndefinedAndNullValues(normalizedLoadOpts.destinationsQueueOptions);}if(!isObjectLiteralAndNotNull(normalizedLoadOpts.queueOptions)){delete normalizedLoadOpts.queueOptions;}else {normalizedLoadOpts.queueOptions=_removeUndefinedAndNullValues(normalizedLoadOpts.queueOptions);}normalizedLoadOpts.lockIntegrationsVersion=normalizedLoadOpts.lockIntegrationsVersion===true;normalizedLoadOpts.lockPluginsVersion=normalizedLoadOpts.lockPluginsVersion===true;if(!isNumber(normalizedLoadOpts.dataPlaneEventsBufferTimeout)){delete normalizedLoadOpts.dataPlaneEventsBufferTimeout;}if(!isObjectLiteralAndNotNull((_normalizedLoadOpts$s2=normalizedLoadOpts.storage)===null||_normalizedLoadOpts$s2===void 0?void 0:_normalizedLoadOpts$s2.cookie)){var _normalizedLoadOpts$s3;(_normalizedLoadOpts$s3=normalizedLoadOpts.storage)===null||_normalizedLoadOpts$s3===void 0||delete _normalizedLoadOpts$s3.cookie;}else {var _normalizedLoadOpts$s4;normalizedLoadOpts.storage.cookie=_removeUndefinedAndNullValues((_normalizedLoadOpts$s4=normalizedLoadOpts.storage)===null||_normalizedLoadOpts$s4===void 0?void 0:_normalizedLoadOpts$s4.cookie);}if(!isObjectLiteralAndNotNull(normalizedLoadOpts.preConsent)){delete normalizedLoadOpts.preConsent;}else {normalizedLoadOpts.preConsent=_removeUndefinedAndNullValues(normalizedLoadOpts.preConsent);}var mergedLoadOptions=mergeDeepRight(loadOptionsFromState,normalizedLoadOpts);return mergedLoadOptions;};
|
3824
|
+
var normalizedLoadOpts=clone(loadOptions);if(!isString(normalizedLoadOpts.setCookieDomain)){delete normalizedLoadOpts.setCookieDomain;}var cookieSameSiteValues=['Strict','Lax','None'];if(!cookieSameSiteValues.includes(normalizedLoadOpts.sameSiteCookie)){delete normalizedLoadOpts.sameSiteCookie;}normalizedLoadOpts.secureCookie=normalizedLoadOpts.secureCookie===true;normalizedLoadOpts.sameDomainCookiesOnly=normalizedLoadOpts.sameDomainCookiesOnly===true;var uaChTrackLevels=['none','default','full'];if(!uaChTrackLevels.includes(normalizedLoadOpts.uaChTrackLevel)){delete normalizedLoadOpts.uaChTrackLevel;}if(!isNonEmptyObject(normalizedLoadOpts.integrations)){delete normalizedLoadOpts.integrations;}normalizedLoadOpts.plugins=(_normalizedLoadOpts$p=normalizedLoadOpts.plugins)!==null&&_normalizedLoadOpts$p!==void 0?_normalizedLoadOpts$p:defaultOptionalPluginsList;normalizedLoadOpts.useGlobalIntegrationsConfigInEvents=normalizedLoadOpts.useGlobalIntegrationsConfigInEvents===true;normalizedLoadOpts.bufferDataPlaneEventsUntilReady=normalizedLoadOpts.bufferDataPlaneEventsUntilReady===true;normalizedLoadOpts.sendAdblockPage=normalizedLoadOpts.sendAdblockPage===true;normalizedLoadOpts.useServerSideCookies=normalizedLoadOpts.useServerSideCookies===true;if(normalizedLoadOpts.dataServiceEndpoint&&typeof normalizedLoadOpts.dataServiceEndpoint!=='string'){delete normalizedLoadOpts.dataServiceEndpoint;}if(!isObjectLiteralAndNotNull(normalizedLoadOpts.sendAdblockPageOptions)){delete normalizedLoadOpts.sendAdblockPageOptions;}if(!isDefined(normalizedLoadOpts.loadIntegration)){delete normalizedLoadOpts.loadIntegration;}else {normalizedLoadOpts.loadIntegration=normalizedLoadOpts.loadIntegration===true;}if(!isObjectLiteralAndNotNull(normalizedLoadOpts.storage)){delete normalizedLoadOpts.storage;}else {var _normalizedLoadOpts$s;normalizedLoadOpts.storage=_removeUndefinedAndNullValues(normalizedLoadOpts.storage);normalizedLoadOpts.storage.migrate=((_normalizedLoadOpts$s=normalizedLoadOpts.storage)===null||_normalizedLoadOpts$s===void 0?void 0:_normalizedLoadOpts$s.migrate)===true;}if(!isObjectLiteralAndNotNull(normalizedLoadOpts.beaconQueueOptions)){delete normalizedLoadOpts.beaconQueueOptions;}else {normalizedLoadOpts.beaconQueueOptions=_removeUndefinedAndNullValues(normalizedLoadOpts.beaconQueueOptions);}if(!isObjectLiteralAndNotNull(normalizedLoadOpts.destinationsQueueOptions)){delete normalizedLoadOpts.destinationsQueueOptions;}else {normalizedLoadOpts.destinationsQueueOptions=_removeUndefinedAndNullValues(normalizedLoadOpts.destinationsQueueOptions);}if(!isObjectLiteralAndNotNull(normalizedLoadOpts.queueOptions)){delete normalizedLoadOpts.queueOptions;}else {normalizedLoadOpts.queueOptions=_removeUndefinedAndNullValues(normalizedLoadOpts.queueOptions);}normalizedLoadOpts.lockIntegrationsVersion=normalizedLoadOpts.lockIntegrationsVersion===true;normalizedLoadOpts.lockPluginsVersion=normalizedLoadOpts.lockPluginsVersion===true;if(!isNumber(normalizedLoadOpts.dataPlaneEventsBufferTimeout)){delete normalizedLoadOpts.dataPlaneEventsBufferTimeout;}if(!isObjectLiteralAndNotNull((_normalizedLoadOpts$s2=normalizedLoadOpts.storage)===null||_normalizedLoadOpts$s2===void 0?void 0:_normalizedLoadOpts$s2.cookie)){var _normalizedLoadOpts$s3;(_normalizedLoadOpts$s3=normalizedLoadOpts.storage)===null||_normalizedLoadOpts$s3===void 0||delete _normalizedLoadOpts$s3.cookie;}else {var _normalizedLoadOpts$s4;normalizedLoadOpts.storage.cookie=_removeUndefinedAndNullValues((_normalizedLoadOpts$s4=normalizedLoadOpts.storage)===null||_normalizedLoadOpts$s4===void 0?void 0:_normalizedLoadOpts$s4.cookie);}if(!isObjectLiteralAndNotNull(normalizedLoadOpts.preConsent)){delete normalizedLoadOpts.preConsent;}else {normalizedLoadOpts.preConsent=_removeUndefinedAndNullValues(normalizedLoadOpts.preConsent);}var mergedLoadOptions=mergeDeepRight(loadOptionsFromState,normalizedLoadOpts);return mergedLoadOptions;};
|
3738
3825
|
|
3739
3826
|
var DATA_PLANE_QUEUE_EXT_POINT_PREFIX='dataplaneEventsQueue';var DESTINATIONS_QUEUE_EXT_POINT_PREFIX='destinationsEventsQueue';var DMT_EXT_POINT_PREFIX='transformEvent';
|
3740
3827
|
|
@@ -3790,10 +3877,10 @@
|
|
3790
3877
|
* Initialize services and components or use default ones if singletons
|
3791
3878
|
*/function Analytics(){_classCallCheck(this,Analytics);this.preloadBuffer=new BufferQueue();this.initialized=false;this.errorHandler=defaultErrorHandler;this.logger=defaultLogger;this.externalSrcLoader=new ExternalSrcLoader(this.errorHandler,this.logger);this.capabilitiesManager=new CapabilitiesManager(this.errorHandler,this.logger);this.httpClient=defaultHttpClient;}/**
|
3792
3879
|
* Start application lifecycle if not already started
|
3793
|
-
*/return _createClass(Analytics,[{key:"load",value:function load(writeKey,dataPlaneUrl){var loadOptions=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};if(state.lifecycle.status.value){return;}var clonedDataPlaneUrl=clone(dataPlaneUrl);var clonedLoadOptions=clone(loadOptions);// dataPlaneUrl is not provided
|
3880
|
+
*/return _createClass(Analytics,[{key:"load",value:function load(writeKey,dataPlaneUrl){var _this$logger,_state$loadOptions$va;var loadOptions=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};if(state.lifecycle.status.value){return;}var clonedDataPlaneUrl=clone(dataPlaneUrl);var clonedLoadOptions=clone(loadOptions);// dataPlaneUrl is not provided
|
3794
3881
|
if(isObjectAndNotNull(dataPlaneUrl)){clonedLoadOptions=dataPlaneUrl;clonedDataPlaneUrl=undefined;}// Set initial state values
|
3795
3882
|
r(function(){state.lifecycle.writeKey.value=writeKey;state.lifecycle.dataPlaneUrl.value=clonedDataPlaneUrl;state.loadOptions.value=normalizeLoadOptions(state.loadOptions.value,clonedLoadOptions);state.lifecycle.status.value='mounted';});// set log level as early as possible
|
3796
|
-
|
3883
|
+
(_this$logger=this.logger)===null||_this$logger===void 0||_this$logger.setMinLogLevel((_state$loadOptions$va=state.loadOptions.value.logLevel)!==null&&_state$loadOptions$va!==void 0?_state$loadOptions$va:POST_LOAD_LOG_LEVEL);// Expose state to global objects
|
3797
3884
|
setExposedGlobal('state',state,writeKey);// Configure initial config of any services or components here
|
3798
3885
|
// State application lifecycle
|
3799
3886
|
this.startLifecycle();}// Start lifecycle methods
|
@@ -3884,7 +3971,7 @@
|
|
3884
3971
|
function RudderAnalytics(){_classCallCheck(this,RudderAnalytics);_defineProperty(this,"analyticsInstances",{});_defineProperty(this,"defaultAnalyticsKey",'');_defineProperty(this,"logger",defaultLogger);if(RudderAnalytics.globalSingleton){// START-NO-SONAR-SCAN
|
3885
3972
|
// eslint-disable-next-line no-constructor-return
|
3886
3973
|
return RudderAnalytics.globalSingleton;// END-NO-SONAR-SCAN
|
3887
|
-
}defaultErrorHandler.attachErrorListeners();this.setDefaultInstanceKey=this.setDefaultInstanceKey.bind(this);this.getAnalyticsInstance=this.getAnalyticsInstance.bind(this);this.load=this.load.bind(this);this.ready=this.ready.bind(this);this.triggerBufferedLoadEvent=this.triggerBufferedLoadEvent.bind(this);this.page=this.page.bind(this);this.track=this.track.bind(this);this.identify=this.identify.bind(this);this.alias=this.alias.bind(this);this.group=this.group.bind(this);this.reset=this.reset.bind(this);this.getAnonymousId=this.getAnonymousId.bind(this);this.setAnonymousId=this.setAnonymousId.bind(this);this.getUserId=this.getUserId.bind(this);this.getUserTraits=this.getUserTraits.bind(this);this.getGroupId=this.getGroupId.bind(this);this.getGroupTraits=this.getGroupTraits.bind(this);this.startSession=this.startSession.bind(this);this.endSession=this.endSession.bind(this);this.getSessionId=this.getSessionId.bind(this);this.setAuthToken=this.setAuthToken.bind(this);this.consent=this.consent.bind(this);RudderAnalytics.globalSingleton=this;// start loading if a load event was buffered or wait for explicit load call
|
3974
|
+
}defaultErrorHandler.attachErrorListeners();this.setDefaultInstanceKey=this.setDefaultInstanceKey.bind(this);this.getAnalyticsInstance=this.getAnalyticsInstance.bind(this);this.load=this.load.bind(this);this.ready=this.ready.bind(this);this.triggerBufferedLoadEvent=this.triggerBufferedLoadEvent.bind(this);this.page=this.page.bind(this);this.track=this.track.bind(this);this.identify=this.identify.bind(this);this.alias=this.alias.bind(this);this.group=this.group.bind(this);this.reset=this.reset.bind(this);this.getAnonymousId=this.getAnonymousId.bind(this);this.setAnonymousId=this.setAnonymousId.bind(this);this.getUserId=this.getUserId.bind(this);this.getUserTraits=this.getUserTraits.bind(this);this.getGroupId=this.getGroupId.bind(this);this.getGroupTraits=this.getGroupTraits.bind(this);this.startSession=this.startSession.bind(this);this.endSession=this.endSession.bind(this);this.getSessionId=this.getSessionId.bind(this);this.setAuthToken=this.setAuthToken.bind(this);this.consent=this.consent.bind(this);RudderAnalytics.globalSingleton=this;state.autoTrack.pageLifecycle.visitId.value=generateUUID();state.autoTrack.pageLifecycle.pageLoadedTimestamp.value=Date.now();// start loading if a load event was buffered or wait for explicit load call
|
3888
3975
|
this.triggerBufferedLoadEvent();// Assign to global "rudderanalytics" object after processing the preload buffer (if any exists)
|
3889
3976
|
// for CDN bundling IIFE exports covers this but for npm ESM and CJS bundling has to be done explicitly
|
3890
3977
|
globalThis.rudderanalytics=this;}/**
|
@@ -3895,11 +3982,36 @@
|
|
3895
3982
|
* Retrieve an existing analytics instance
|
3896
3983
|
*/},{key:"getAnalyticsInstance",value:function getAnalyticsInstance(writeKey){var instanceId=writeKey!==null&&writeKey!==void 0?writeKey:this.defaultAnalyticsKey;var analyticsInstanceExists=Boolean(this.analyticsInstances[instanceId]);if(!analyticsInstanceExists){this.analyticsInstances[instanceId]=new Analytics();}return this.analyticsInstances[instanceId];}/**
|
3897
3984
|
* Create new analytics instance and trigger application lifecycle start
|
3898
|
-
*/},{key:"load",value:function load(writeKey,dataPlaneUrl,loadOptions){if(!isString(writeKey)){this.logger.error(WRITE_KEY_NOT_A_STRING_ERROR(RS_APP,writeKey));return;}if(this.analyticsInstances[writeKey]){return;}this.setDefaultInstanceKey(writeKey);
|
3985
|
+
*/},{key:"load",value:function load(writeKey,dataPlaneUrl,loadOptions){if(!isString(writeKey)){this.logger.error(WRITE_KEY_NOT_A_STRING_ERROR(RS_APP,writeKey));return;}if(this.analyticsInstances[writeKey]){return;}this.setDefaultInstanceKey(writeKey);var preloadedEventsArray=this.getPreloadedEvents();// Track page loaded lifecycle event if enabled
|
3986
|
+
this.trackPageLifecycleEvents(preloadedEventsArray,loadOptions);// The array will be mutated in the below method
|
3987
|
+
promotePreloadedConsentEventsToTop(preloadedEventsArray);setExposedGlobal(GLOBAL_PRELOAD_BUFFER,clone(preloadedEventsArray));this.analyticsInstances[writeKey]=new Analytics();this.getAnalyticsInstance(writeKey).load(writeKey,dataPlaneUrl,loadOptions);}/**
|
3988
|
+
* A function to get preloaded events array from global object
|
3989
|
+
* @returns preloaded events array
|
3990
|
+
*/// eslint-disable-next-line class-methods-use-this
|
3991
|
+
},{key:"getPreloadedEvents",value:function getPreloadedEvents(){return Array.isArray(globalThis.rudderanalytics)?globalThis.rudderanalytics:[];}/**
|
3992
|
+
* A function to track page lifecycle events like page loaded and page unloaded
|
3993
|
+
* @param preloadedEventsArray
|
3994
|
+
* @param loadOptions
|
3995
|
+
* @returns
|
3996
|
+
*/},{key:"trackPageLifecycleEvents",value:function trackPageLifecycleEvents(preloadedEventsArray,loadOptions){var _ref=loadOptions!==null&&loadOptions!==void 0?loadOptions:{},autoTrack=_ref.autoTrack,useBeacon=_ref.useBeacon;var _ref2=autoTrack!==null&&autoTrack!==void 0?autoTrack:{},_ref2$enabled=_ref2.enabled,autoTrackEnabled=_ref2$enabled===void 0?false:_ref2$enabled,_ref2$options=_ref2.options,autoTrackOptions=_ref2$options===void 0?{}:_ref2$options,pageLifecycle=_ref2.pageLifecycle;var _ref3=pageLifecycle!==null&&pageLifecycle!==void 0?pageLifecycle:{},_ref3$events=_ref3.events,events=_ref3$events===void 0?[PageLifecycleEvents.LOADED,PageLifecycleEvents.UNLOADED]:_ref3$events,_ref3$enabled=_ref3.enabled,pageLifecycleEnabled=_ref3$enabled===void 0?autoTrackEnabled:_ref3$enabled,_ref3$options=_ref3.options,options=_ref3$options===void 0?autoTrackOptions:_ref3$options;state.autoTrack.pageLifecycle.enabled.value=pageLifecycleEnabled;// Set the autoTrack enabled state
|
3997
|
+
// if at least one of the autoTrack options is enabled
|
3998
|
+
// IMPORTANT: make sure this is done at the end as it depends on the above states
|
3999
|
+
state.autoTrack.enabled.value=autoTrackEnabled||pageLifecycleEnabled;if(!pageLifecycleEnabled){return;}this.trackPageLoadedEvent(events,options,preloadedEventsArray);this.setupPageUnloadTracking(events,useBeacon,options);}/**
|
4000
|
+
* Buffer the page loaded event in the preloaded events array
|
4001
|
+
* @param events
|
4002
|
+
* @param options
|
4003
|
+
* @param preloadedEventsArray
|
4004
|
+
*/// eslint-disable-next-line class-methods-use-this
|
4005
|
+
},{key:"trackPageLoadedEvent",value:function trackPageLoadedEvent(events,options,preloadedEventsArray){if(events.length===0||events.includes(PageLifecycleEvents.LOADED)){preloadedEventsArray.unshift(['track',PageLifecycleEvents.LOADED,{},_objectSpread2(_objectSpread2({},options),{},{originalTimestamp:getFormattedTimestamp(new Date(state.autoTrack.pageLifecycle.pageLoadedTimestamp.value))})]);}}/**
|
4006
|
+
* Setup page unload tracking if enabled
|
4007
|
+
* @param events
|
4008
|
+
* @param useBeacon
|
4009
|
+
* @param options
|
4010
|
+
*/},{key:"setupPageUnloadTracking",value:function setupPageUnloadTracking(events,useBeacon,options){var _this=this;if(events.length===0||events.includes(PageLifecycleEvents.UNLOADED)){if(useBeacon===true){onPageLeave(function(isAccessible){if(isAccessible===false&&state.lifecycle.loaded.value){var pageUnloadedTimestamp=Date.now();var visitDuration=pageUnloadedTimestamp-state.autoTrack.pageLifecycle.pageLoadedTimestamp.value;_this.track(PageLifecycleEvents.UNLOADED,{visitDuration:visitDuration},_objectSpread2(_objectSpread2({},options),{},{originalTimestamp:getFormattedTimestamp(new Date(pageUnloadedTimestamp))}));}});}else {// throw warning if beacon is disabled
|
4011
|
+
this.logger.warn(PAGE_UNLOAD_ON_BEACON_DISABLED_WARNING(RS_APP));}}}/**
|
3899
4012
|
* Trigger load event in buffer queue if exists and stores the
|
3900
4013
|
* remaining preloaded events array in global object
|
3901
|
-
*/},{key:"triggerBufferedLoadEvent",value:function triggerBufferedLoadEvent(){var preloadedEventsArray=
|
3902
|
-
promotePreloadedConsentEventsToTop(preloadedEventsArray);// Get any load method call that is buffered if any
|
4014
|
+
*/},{key:"triggerBufferedLoadEvent",value:function triggerBufferedLoadEvent(){var preloadedEventsArray=this.getPreloadedEvents();// Get any load method call that is buffered if any
|
3903
4015
|
// BTW, load method is also removed from the array
|
3904
4016
|
// So, the Analytics object can directly consume the remaining events
|
3905
4017
|
var loadEvent=getPreloadedLoadEvent(preloadedEventsArray);// Set the final preloaded events array in global object
|