@rudderstack/analytics-js 3.34.2 → 3.34.3
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 +13 -0
- package/dist/npm/index.d.cts +6 -0
- package/dist/npm/index.d.mts +6 -0
- package/dist/npm/legacy/bundled/cjs/index.cjs +95 -43
- package/dist/npm/legacy/bundled/esm/index.mjs +95 -43
- package/dist/npm/legacy/bundled/umd/index.js +95 -43
- package/dist/npm/legacy/cjs/index.cjs +95 -43
- package/dist/npm/legacy/content-script/cjs/index.cjs +95 -43
- package/dist/npm/legacy/content-script/esm/index.mjs +95 -43
- package/dist/npm/legacy/content-script/umd/index.js +95 -43
- package/dist/npm/legacy/esm/index.mjs +95 -43
- package/dist/npm/legacy/lite/cjs/index.cjs +94 -42
- package/dist/npm/legacy/lite/esm/index.mjs +94 -42
- package/dist/npm/legacy/lite/umd/index.js +94 -42
- package/dist/npm/legacy/umd/index.js +95 -43
- package/dist/npm/modern/bundled/cjs/index.cjs +94 -42
- package/dist/npm/modern/bundled/esm/index.mjs +94 -42
- package/dist/npm/modern/bundled/umd/index.js +94 -42
- package/dist/npm/modern/cjs/index.cjs +95 -43
- package/dist/npm/modern/content-script/cjs/index.cjs +94 -42
- package/dist/npm/modern/content-script/esm/index.mjs +94 -42
- package/dist/npm/modern/content-script/umd/index.js +94 -42
- package/dist/npm/modern/esm/index.mjs +95 -43
- package/dist/npm/modern/lite/cjs/index.cjs +94 -42
- package/dist/npm/modern/lite/esm/index.mjs +94 -42
- package/dist/npm/modern/lite/umd/index.js +94 -42
- package/dist/npm/modern/umd/index.js +95 -43
- package/package.json +1 -1
|
@@ -913,7 +913,7 @@ Object.getOwnPropertyNames(err).forEach(function(key){if(key!=='message'&&key!==
|
|
|
913
913
|
}}});return newError;}catch(_unused2){return new Error("".concat(issue,": ").concat(stringifyWithoutCircular(err)));}};var dispatchErrorEvent=function dispatchErrorEvent(error){if(isTypeOfError(error)){var errStack=getStacktrace(error);if(errStack){// eslint-disable-next-line no-param-reassign
|
|
914
914
|
error.stack="".concat(errStack,"\n").concat(MANUAL_ERROR_IDENTIFIER);}}globalThis.dispatchEvent(new ErrorEvent('error',{error:error,bubbles:true,cancelable:true,composed:true}));};
|
|
915
915
|
|
|
916
|
-
var APP_NAME='RudderLabs JavaScript SDK';var APP_VERSION='3.34.
|
|
916
|
+
var APP_NAME='RudderLabs JavaScript SDK';var APP_VERSION='3.34.3';var APP_NAMESPACE='com.rudderlabs.javascript';var MODULE_TYPE='npm';var BUILD_VARIANT='legacy-content-script';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';
|
|
917
917
|
|
|
918
918
|
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';
|
|
919
919
|
|
|
@@ -1033,7 +1033,7 @@ var SUPPORTED_STORAGE_TYPES=['localStorage','memoryStorage','cookieStorage','ses
|
|
|
1033
1033
|
|
|
1034
1034
|
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 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 SOURCE_CONFIG_OPTION_ERROR=function SOURCE_CONFIG_OPTION_ERROR(context){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"The \"getSourceConfig\" load API option must be a function that returns valid source configuration data.");};var COMPONENT_BASE_URL_ERROR=function COMPONENT_BASE_URL_ERROR(context,component,url){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"The base URL \"").concat(url,"\" for ").concat(component," is not valid.");};// ERROR
|
|
1035
1035
|
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 NON_ERROR_WARNING=function NON_ERROR_WARNING(context,errStr){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"Ignoring a non-error: ").concat(errStr,".");};var BREADCRUMB_ERROR="Failed to log breadcrumb";var HANDLE_ERROR_FAILURE=function HANDLE_ERROR_FAILURE(context){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"Failed to handle 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 SOURCE_CONFIG_FETCH_ERROR='Failed to fetch the source config';var WRITE_KEY_VALIDATION_ERROR=function WRITE_KEY_VALIDATION_ERROR(context,writeKey){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"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(context,dataPlaneUrl){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"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 INVALID_CALLBACK_FN_ERROR=function INVALID_CALLBACK_FN_ERROR(context){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"The provided callback parameter is not a function.");};var XHR_DELIVERY_ERROR=function XHR_DELIVERY_ERROR(prefix,status,statusText,url,response){return "".concat(prefix," with status ").concat(status," (").concat(statusText,") for URL: ").concat(url,". Response: ").concat(response.trim());};var XHR_REQUEST_ERROR=function XHR_REQUEST_ERROR(prefix,e,url){return "".concat(prefix," due to timeout or no connection (").concat(e?e.type:'',") at the client side 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_URL_INVALID_ERROR=function DATA_SERVER_URL_INVALID_ERROR(context,url){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"The server side cookies functionality is disabled as the provided data server URL, \"").concat(url,"\" is invalid.");};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.";var COLLAPSED_COOKIE_BATCH_ERROR=function COLLAPSED_COOKIE_BATCH_ERROR(missingCookies,batchSize){return "The server did not set ".concat(missingCookies.length," of the ").concat(batchSize," cookies sent in one request: ").concat(missingCookies.join(', '),". A fallback to set them client side was attempted. Check that the data service and any proxy preserve every \"Set-Cookie\" header, and that the cookie domain and SameSite/Secure attributes are valid.");};// WARNING
|
|
1036
|
-
var STORAGE_TYPE_VALIDATION_WARNING=function STORAGE_TYPE_VALIDATION_WARNING(context,storageType){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 storage type will be used instead.");};var UNSUPPORTED_STORAGE_ENTRY_TYPE_WARNING=function UNSUPPORTED_STORAGE_ENTRY_TYPE_WARNING(context,entry,storageType){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"The storage type \"").concat(storageType,"\" configured for the entry \"").concat(entry,"\" is not supported. Please choose one of the following supported types: \"").concat(SUPPORTED_STORAGE_TYPES,"\". The default storage type 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_ERROR=function SERVER_SIDE_COOKIE_FEATURE_OVERRIDE_ERROR(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 SERVER_SIDE_COOKIE_DATA_SERVICE_HOST_ERROR=function SERVER_SIDE_COOKIE_DATA_SERVICE_HOST_ERROR(context,dataServiceHost,webpageHost){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"The data service host (").concat(dataServiceHost,") cannot set cookies for the current webpage (").concat(webpageHost,"). Hence, the cookies will be set client-side instead of server-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 RESERVED_CUSTOM_CONTEXT_KEY_WARNING=function RESERVED_CUSTOM_CONTEXT_KEY_WARNING(logContext,property){return "".concat(logContext).concat(LOG_CONTEXT_SEPARATOR,"The top-level custom context property \"").concat(property,"\" is reserved and was ignored.");};var INVALID_CONTEXT_OBJECT_WARNING=function INVALID_CONTEXT_OBJECT_WARNING(logContext){return "".concat(logContext).concat(LOG_CONTEXT_SEPARATOR,"Please make sure that the \"context\" property in the event API's \"options\" argument is a valid object literal with key-value pairs.");};var INVALID_CUSTOM_CONTEXT_WARNING=function INVALID_CUSTOM_CONTEXT_WARNING(logContext){return "".concat(logContext).concat(LOG_CONTEXT_SEPARATOR,"Invalid custom context. Use a plain object without prototype pollution keys.");};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 CUT_OFF_DURATION_NOT_NUMBER_WARNING=function CUT_OFF_DURATION_NOT_NUMBER_WARNING(context,cutOffDuration,defaultValue){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"The session cut off duration value \"").concat(cutOffDuration,"\" is not a number. The default cut off duration of ").concat(defaultValue," ms will be used instead.");};var CUT_OFF_DURATION_LESS_THAN_TIMEOUT_WARNING=function CUT_OFF_DURATION_LESS_THAN_TIMEOUT_WARNING(context,cutOffDuration,timeout){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"The session cut off duration value \"").concat(cutOffDuration,"\" ms is less than the session timeout value \"").concat(timeout,"\" ms. The cut off functionality will be disabled.");};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 CALLBACK_INVOKE_ERROR=function CALLBACK_INVOKE_ERROR(context){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"The callback threw an exception");};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 DEPRECATED_PRE_CONSENT_STORAGE_STRATEGY=function DEPRECATED_PRE_CONSENT_STORAGE_STRATEGY(context){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"The pre-consent storage strategy option is deprecated. Please enable \"storage\" in the pre-consent options and use the \"storage\" load API option 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 DEPRECATED_PLUGIN_WARNING=function DEPRECATED_PLUGIN_WARNING(context,pluginName){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR).concat(pluginName," plugin is deprecated. Please exclude it from the load API options.");};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 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.");};var UNKNOWN_PLUGINS_WARNING=function UNKNOWN_PLUGINS_WARNING(context,unknownPlugins){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"Ignoring unknown plugins: ").concat(unknownPlugins.join(', '),".");};var UNAVAILABLE_PLUGINS_ERROR=function UNAVAILABLE_PLUGINS_ERROR(context,unavailablePlugins){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"Failed to load the following unavailable local plugins: ").concat(unavailablePlugins.join(', '),". Some features of the SDK may not work as expected. Make sure you are using the correct SDK bundle variant.");};var CUSTOM_INTEGRATION_CANNOT_BE_ADDED_ERROR=function CUSTOM_INTEGRATION_CANNOT_BE_ADDED_ERROR(context,destinationId){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"Cannot add custom integration for destination ID \"").concat(destinationId,"\" after the SDK is loaded.");};
|
|
1036
|
+
var STORAGE_TYPE_VALIDATION_WARNING=function STORAGE_TYPE_VALIDATION_WARNING(context,storageType){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 storage type will be used instead.");};var UNSUPPORTED_STORAGE_ENTRY_TYPE_WARNING=function UNSUPPORTED_STORAGE_ENTRY_TYPE_WARNING(context,entry,storageType){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"The storage type \"").concat(storageType,"\" configured for the entry \"").concat(entry,"\" is not supported. Please choose one of the following supported types: \"").concat(SUPPORTED_STORAGE_TYPES,"\". The default storage type 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_ERROR=function SERVER_SIDE_COOKIE_FEATURE_OVERRIDE_ERROR(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 SERVER_SIDE_COOKIE_DATA_SERVICE_HOST_ERROR=function SERVER_SIDE_COOKIE_DATA_SERVICE_HOST_ERROR(context,dataServiceHost,webpageHost){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"The data service host (").concat(dataServiceHost,") cannot set cookies for the current webpage (").concat(webpageHost,"). Hence, the cookies will be set client-side instead of server-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 RESERVED_CUSTOM_CONTEXT_KEY_WARNING=function RESERVED_CUSTOM_CONTEXT_KEY_WARNING(logContext,property){return "".concat(logContext).concat(LOG_CONTEXT_SEPARATOR,"The top-level custom context property \"").concat(property,"\" is reserved and was ignored.");};var INVALID_CONTEXT_OBJECT_WARNING=function INVALID_CONTEXT_OBJECT_WARNING(logContext){return "".concat(logContext).concat(LOG_CONTEXT_SEPARATOR,"Please make sure that the \"context\" property in the event API's \"options\" argument is a valid object literal with key-value pairs.");};var INVALID_CUSTOM_CONTEXT_WARNING=function INVALID_CUSTOM_CONTEXT_WARNING(logContext){return "".concat(logContext).concat(LOG_CONTEXT_SEPARATOR,"Invalid custom context. Use a plain object without prototype pollution keys.");};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 CUT_OFF_DURATION_NOT_NUMBER_WARNING=function CUT_OFF_DURATION_NOT_NUMBER_WARNING(context,cutOffDuration,defaultValue){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"The session cut off duration value \"").concat(cutOffDuration,"\" is not a number. The default cut off duration of ").concat(defaultValue," ms will be used instead.");};var CUT_OFF_DURATION_LESS_THAN_TIMEOUT_WARNING=function CUT_OFF_DURATION_LESS_THAN_TIMEOUT_WARNING(context,cutOffDuration,timeout){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"The session cut off duration value \"").concat(cutOffDuration,"\" ms is less than the session timeout value \"").concat(timeout,"\" ms. The cut off functionality will be disabled.");};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 CALLBACK_INVOKE_ERROR=function CALLBACK_INVOKE_ERROR(context){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"The callback threw an exception");};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 DEPRECATED_PRE_CONSENT_STORAGE_STRATEGY=function DEPRECATED_PRE_CONSENT_STORAGE_STRATEGY(context){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"The pre-consent storage strategy option is deprecated. Please enable \"storage\" in the pre-consent options and use the \"storage\" load API option 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 DEPRECATED_PLUGIN_WARNING=function DEPRECATED_PLUGIN_WARNING(context,pluginName){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR).concat(pluginName," plugin is deprecated. Please exclude it from the load API options.");};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 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.");};var UNKNOWN_PLUGINS_WARNING=function UNKNOWN_PLUGINS_WARNING(context,unknownPlugins){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"Ignoring unknown plugins: ").concat(unknownPlugins.join(', '),".");};var REMOTE_PLUGIN_LOAD_ERROR=function REMOTE_PLUGIN_LOAD_ERROR(context,pluginName,reason){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"Failed to load plugin \"").concat(pluginName,"\" - ").concat(reason);};var UNAVAILABLE_PLUGINS_ERROR=function UNAVAILABLE_PLUGINS_ERROR(context,unavailablePlugins){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"Failed to load the following unavailable local plugins: ").concat(unavailablePlugins.join(', '),". Some features of the SDK may not work as expected. Make sure you are using the correct SDK bundle variant.");};var CUSTOM_INTEGRATION_CANNOT_BE_ADDED_ERROR=function CUSTOM_INTEGRATION_CANNOT_BE_ADDED_ERROR(context,destinationId){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"Cannot add custom integration for destination ID \"").concat(destinationId,"\" after the SDK is loaded.");};
|
|
1037
1037
|
|
|
1038
1038
|
var DEFAULT_INTEGRATIONS_CONFIG={All:true};
|
|
1039
1039
|
|
|
@@ -1059,7 +1059,7 @@ anonymousId:false,initialReferrer:false,initialReferringDomain:false}});var SERV
|
|
|
1059
1059
|
|
|
1060
1060
|
var sessionState={userId:y(DEFAULT_USER_SESSION_VALUES.userId),userTraits:y(DEFAULT_USER_SESSION_VALUES.userTraits),anonymousId:y(DEFAULT_USER_SESSION_VALUES.anonymousId),groupId:y(DEFAULT_USER_SESSION_VALUES.groupId),groupTraits:y(DEFAULT_USER_SESSION_VALUES.groupTraits),initialReferrer:y(DEFAULT_USER_SESSION_VALUES.initialReferrer),initialReferringDomain:y(DEFAULT_USER_SESSION_VALUES.initialReferringDomain),sessionInfo:y(DEFAULT_USER_SESSION_VALUES.sessionInfo),authToken:y(DEFAULT_USER_SESSION_VALUES.authToken)};
|
|
1061
1061
|
|
|
1062
|
-
var capabilitiesState={isOnline:y(true),storage:{isLocalStorageAvailable:y(false),isCookieStorageAvailable:y(false),isSessionStorageAvailable:y(false)},isBeaconAvailable:y(false),isLegacyDOM:y(false),isUaCHAvailable:y(false),isCryptoAvailable:y(false),isAdBlockerDetectionInProgress:y(false),isAdBlocked:y(undefined),
|
|
1062
|
+
var capabilitiesState={isOnline:y(true),storage:{isLocalStorageAvailable:y(false),isCookieStorageAvailable:y(false),isSessionStorageAvailable:y(false)},isBeaconAvailable:y(false),isLegacyDOM:y(false),isUaCHAvailable:y(false),isCryptoAvailable:y(false),isAdBlockerDetectionInProgress:y(false),isAdBlocked:y(undefined),cspViolations:y([]),sdkCdnProbe:y({})};
|
|
1063
1063
|
|
|
1064
1064
|
var reportingState={isErrorReportingEnabled:y(false),isMetricsReportingEnabled:y(false),breadcrumbs:y([])};
|
|
1065
1065
|
|
|
@@ -1109,7 +1109,9 @@ try{if(JSON.stringify(f)==='{}')return accum;return accum.concat(f);}catch(_unus
|
|
|
1109
1109
|
* Utility to parse XHR JSON response
|
|
1110
1110
|
*/var responseTextToJson=function responseTextToJson(responseText,onError){try{return JSON.parse(responseText||'');}catch(err){var error=getMutatedError(err,'Failed to parse response data');onError(error);}return undefined;};
|
|
1111
1111
|
|
|
1112
|
-
var FAILED_REQUEST_ERR_MSG_PREFIX='The request failed';var PLUGINS_LOAD_FAILURE_MESSAGES=[
|
|
1112
|
+
var FAILED_REQUEST_ERR_MSG_PREFIX='The request failed';var PLUGINS_LOAD_FAILURE_MESSAGES=[// Chromium
|
|
1113
|
+
/Failed to fetch dynamically imported module: .*/,// Firefox
|
|
1114
|
+
/error loading dynamically imported module: .*/];var INTEGRATIONS_LOAD_FAILURE_MESSAGES=[/Unable to load \(.*\) the script with the id .*/,/A timeout of \d+ ms occurred while trying to load the script with id .*/];var ERROR_MESSAGES_TO_BE_FILTERED=[new RegExp("".concat(FAILED_REQUEST_ERR_MSG_PREFIX,".*")),/A script with the id .* is already loaded\./];var SCRIPT_LOAD_FAILURE_MESSAGES=[].concat(PLUGINS_LOAD_FAILURE_MESSAGES,INTEGRATIONS_LOAD_FAILURE_MESSAGES);var INTEGRATIONS_ERROR_CATEGORY='integrations';var SDK_ERROR_CATEGORY='sdk';var DEFAULT_ERROR_CATEGORY=SDK_ERROR_CATEGORY;
|
|
1113
1115
|
|
|
1114
1116
|
var DEFAULT_XHR_REQUEST_OPTIONS={headers:{Accept:'application/json','Content-Type':'application/json;charset=UTF-8'},method:'GET'};/**
|
|
1115
1117
|
* Utility to create request configuration based on default options
|
|
@@ -1127,14 +1129,14 @@ xhr.timeout=timeout;Object.keys(options.headers).forEach(function(headerName){if
|
|
|
1127
1129
|
* Service to handle data communication with APIs
|
|
1128
1130
|
*/var HttpClient=/*#__PURE__*/function(){function HttpClient(logger){_classCallCheck(this,HttpClient);this.logger=logger;this.onError=this.onError.bind(this);}return _createClass(HttpClient,[{key:"init",value:function init(errorHandler){this.errorHandler=errorHandler;}/**
|
|
1129
1131
|
* Implement requests in a blocking way
|
|
1130
|
-
*/},{key:"getData",value:(function(){var _getData=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(config){var url,options,timeout,isRawResponse,data,_t;return _regenerator().w(function(_context){while(1)switch(_context.p=_context.n){case 0:url=config.url,options=config.options,timeout=config.timeout,isRawResponse=config.isRawResponse;_context.p=1;_context.n=2;return xhrRequest(createXhrRequestOptions(url,options,this.
|
|
1132
|
+
*/},{key:"getData",value:(function(){var _getData=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(config){var url,options,timeout,isRawResponse,skipAuthHeader,data,_t;return _regenerator().w(function(_context){while(1)switch(_context.p=_context.n){case 0:url=config.url,options=config.options,timeout=config.timeout,isRawResponse=config.isRawResponse,skipAuthHeader=config.skipAuthHeader;_context.p=1;_context.n=2;return xhrRequest(createXhrRequestOptions(url,options,this.getAuthHeader(skipAuthHeader)),timeout,this.logger);case 2:data=_context.v;return _context.a(2,{data:isRawResponse?data.response:responseTextToJson(data.response,this.onError),details:data});case 3:_context.p=3;_t=_context.v;return _context.a(2,{data:undefined,details:_t});}},_callee,this,[[1,3]]);}));function getData(_x){return _getData.apply(this,arguments);}return getData;}()/**
|
|
1131
1133
|
* Implement requests in a non-blocking way
|
|
1132
|
-
*/)},{key:"getAsyncData",value:function getAsyncData(config){var _this=this;var callback=config.callback,url=config.url,options=config.options,timeout=config.timeout,isRawResponse=config.isRawResponse;var isFireAndForget=!isFunction(callback);xhrRequest(createXhrRequestOptions(url,options,this.
|
|
1134
|
+
*/)},{key:"getAsyncData",value:function getAsyncData(config){var _this=this;var callback=config.callback,url=config.url,options=config.options,timeout=config.timeout,isRawResponse=config.isRawResponse,skipAuthHeader=config.skipAuthHeader;var isFireAndForget=!isFunction(callback);xhrRequest(createXhrRequestOptions(url,options,this.getAuthHeader(skipAuthHeader)),timeout,this.logger).then(function(data){if(!isFireAndForget){callback(isRawResponse?data.response:responseTextToJson(data.response,_this.onError),data);}},function(data){if(!isFireAndForget){callback(undefined,data);}})// Exceptions thrown by the callback must never re-enter it
|
|
1133
1135
|
.catch(this.onError);}/**
|
|
1134
1136
|
* Handle errors
|
|
1135
1137
|
*/},{key:"onError",value:function onError(error,groupingHash){var _this$errorHandler;(_this$errorHandler=this.errorHandler)===null||_this$errorHandler===void 0||_this$errorHandler.onError({error:error,context:HTTP_CLIENT,groupingHash:groupingHash});}/**
|
|
1136
1138
|
* Set basic authentication header (eg writekey)
|
|
1137
|
-
*/},{key:"setAuthHeader",value:function setAuthHeader(value){var noBtoa=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;var authVal=noBtoa?value:toBase64("".concat(value,":"));this.basicAuthHeader="Basic ".concat(authVal);}/**
|
|
1139
|
+
*/},{key:"getAuthHeader",value:function getAuthHeader(skipAuthHeader){return skipAuthHeader===true?undefined:this.basicAuthHeader;}},{key:"setAuthHeader",value:function setAuthHeader(value){var noBtoa=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;var authVal=noBtoa?value:toBase64("".concat(value,":"));this.basicAuthHeader="Basic ".concat(authVal);}/**
|
|
1138
1140
|
* Clear basic authentication header
|
|
1139
1141
|
*/},{key:"resetAuthHeader",value:function resetAuthHeader(){this.basicAuthHeader=undefined;}}]);}();var defaultHttpClient=new HttpClient(defaultLogger);
|
|
1140
1142
|
|
|
@@ -1149,46 +1151,67 @@ var APP_STATE_EXCLUDE_KEYS=['userId','userTraits','groupId','groupTraits','anony
|
|
|
1149
1151
|
'customContext',// customer-provided event context
|
|
1150
1152
|
'traits','authToken'];var NOTIFIER_NAME='RudderStack JavaScript SDK';var SDK_GITHUB_URL='git+https://github.com/rudderlabs/rudder-sdk-js.git';var SOURCE_NAME='js';
|
|
1151
1153
|
|
|
1152
|
-
var detectAdBlockers=function detectAdBlockers(httpClient){state.capabilities.isAdBlockerDetectionInProgress.value=true;try{// Apparently, '?view=ad' is a query param that is blocked by majority of adblockers
|
|
1153
|
-
// Use source config URL here as it is very unlikely to be blocked by adblockers
|
|
1154
|
-
// Only the extra query param should make it vulnerable to adblockers
|
|
1155
|
-
// This will work even if the users proxies it.
|
|
1156
|
-
// The edge case where this doesn't work is when HEAD method is not allowed by the server (user's)
|
|
1157
|
-
var baseUrl=new URL(state.lifecycle.sourceConfigUrl.value);var url="".concat(baseUrl.origin).concat(baseUrl.pathname,"?view=ad");httpClient.getAsyncData({url:url,options:{// We actually don't need the response from the request, so we are using HEAD
|
|
1158
|
-
method:'HEAD',headers:{'Content-Type':undefined}},isRawResponse:true,callback:function callback(result,details){var _details$xhr;state.capabilities.isAdBlockerDetectionInProgress.value=false;// not ad blocked if the request is successful or it is not internally redirected on the client side
|
|
1159
|
-
// Often adblockers instead of blocking the request, they redirect it to an internal URL
|
|
1160
|
-
state.capabilities.isAdBlocked.value=(details===null||details===void 0?void 0:details.error)!==undefined||(details===null||details===void 0||(_details$xhr=details.xhr)===null||_details$xhr===void 0?void 0:_details$xhr.responseURL)!==url;}});}catch(err){// Reset the flag to prevent blocking future detection attempts
|
|
1161
|
-
state.capabilities.isAdBlockerDetectionInProgress.value=false;// Re-throw the error to be handled by the caller
|
|
1162
|
-
throw err;}};
|
|
1163
|
-
|
|
1164
1154
|
var getErrInstance=function getErrInstance(err,errorType){switch(errorType){case ErrorType.UNHANDLEDEXCEPTION:{var _ref=err,error=_ref.error;return error||err;}case ErrorType.UNHANDLEDREJECTION:{return err.reason;}case ErrorType.HANDLEDEXCEPTION:default:return err;}};var createNewBreadcrumb=function createNewBreadcrumb(message){return {type:'manual',name:message,timestamp:new Date(),metaData:{}};};/**
|
|
1165
1155
|
* A function to get the Bugsnag release stage for the current environment
|
|
1166
1156
|
* @param getHostName Optional function to get the hostname (primarily for testing)
|
|
1167
1157
|
* @returns 'development' if the host is empty (for file:// protocol etc.) or a dev host (localhost, 127.0.0.1, etc.), otherwise ''production'' (it'll be replaced with the actual release stage during the build)
|
|
1168
|
-
*/var getReleaseStage=function getReleaseStage(){var getHostName=arguments.length>0&&arguments[0]!==undefined?arguments[0]:function(){return window.location.hostname;};var host=getHostName();return !host||host&&DEV_HOSTS.includes(host)?'development':'production';};var getAppStateForMetadata=function getAppStateForMetadata(state){var stateStr=stringifyWithoutCircular(state,false,APP_STATE_EXCLUDE_KEYS);return stateStr!==null?JSON.parse(stateStr):{};};var getURLWithoutQueryString=function getURLWithoutQueryString(){var url=globalThis.location.href.split('?');return url[0];};var getUserDetails=function getUserDetails(source,session,lifecycle,autoTrack){var _source$value$id,_source$value,_session$sessionInfo$,_autoTrack$pageLifecy,_source$value$name,_source$value2;return {id:"".concat((_source$value$id=(_source$value=source.value)===null||_source$value===void 0?void 0:_source$value.id)!==null&&_source$value$id!==void 0?_source$value$id:lifecycle.writeKey.value,"..").concat((_session$sessionInfo$=session.sessionInfo.value.id)!==null&&_session$sessionInfo$!==void 0?_session$sessionInfo$:'NA',"..").concat((_autoTrack$pageLifecy=autoTrack.pageLifecycle.pageViewId.value)!==null&&_autoTrack$pageLifecy!==void 0?_autoTrack$pageLifecy:'NA'),name:(_source$value$name=(_source$value2=source.value)===null||_source$value2===void 0?void 0:_source$value2.name)!==null&&_source$value$name!==void 0?_source$value$name:'NA'};};var getDeviceDetails=function getDeviceDetails(locale,userAgent){var _locale$value,_userAgent$value;return {locale:(_locale$value=locale.value)!==null&&_locale$value!==void 0?_locale$value:'NA',userAgent:(_userAgent$value=userAgent.value)!==null&&_userAgent$value!==void 0?_userAgent$value:'NA',time:new Date()};};var getBugsnagErrorEvent=function getBugsnagErrorEvent(exception,errorState,state,groupingHash){var context=state.context,lifecycle=state.lifecycle,session=state.session,source=state.source,reporting=state.reporting,autoTrack=state.autoTrack;var app=context.app,locale=context.locale,userAgent=context.userAgent,timezone=context.timezone,screen=context.screen,library=context.library;return {payloadVersion:'5',notifier:{name:NOTIFIER_NAME,version:app.value.version,url:SDK_GITHUB_URL},events:[{exceptions:[clone(exception)],severity:errorState.severity,unhandled:errorState.unhandled,severityReason:errorState.severityReason,app:{version:app.value.version,releaseStage:getReleaseStage(),type:app.value.installType},device:getDeviceDetails(locale,userAgent),request:{url:getURLWithoutQueryString(),clientIp:'[NOT COLLECTED]'},breadcrumbs:clone(reporting.breadcrumbs.value),context:exception.message,groupingHash:groupingHash,metaData:_objectSpread2({app:{snippetVersion:library.value.snippetVersion},device:_objectSpread2(_objectSpread2({},screen.value),{},{timezone:timezone.value})},getAppStateForMetadata(state)),user:getUserDetails(source,session,lifecycle,autoTrack)}]};}
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
*
|
|
1172
|
-
*
|
|
1173
|
-
*
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1158
|
+
*/var getReleaseStage=function getReleaseStage(){var getHostName=arguments.length>0&&arguments[0]!==undefined?arguments[0]:function(){return window.location.hostname;};var host=getHostName();return !host||host&&DEV_HOSTS.includes(host)?'development':'production';};var getAppStateForMetadata=function getAppStateForMetadata(state){var stateStr=stringifyWithoutCircular(state,false,APP_STATE_EXCLUDE_KEYS);return stateStr!==null?JSON.parse(stateStr):{};};var getURLWithoutQueryString=function getURLWithoutQueryString(){var url=globalThis.location.href.split('?');return url[0];};var getUserDetails=function getUserDetails(source,session,lifecycle,autoTrack){var _source$value$id,_source$value,_session$sessionInfo$,_autoTrack$pageLifecy,_source$value$name,_source$value2;return {id:"".concat((_source$value$id=(_source$value=source.value)===null||_source$value===void 0?void 0:_source$value.id)!==null&&_source$value$id!==void 0?_source$value$id:lifecycle.writeKey.value,"..").concat((_session$sessionInfo$=session.sessionInfo.value.id)!==null&&_session$sessionInfo$!==void 0?_session$sessionInfo$:'NA',"..").concat((_autoTrack$pageLifecy=autoTrack.pageLifecycle.pageViewId.value)!==null&&_autoTrack$pageLifecy!==void 0?_autoTrack$pageLifecy:'NA'),name:(_source$value$name=(_source$value2=source.value)===null||_source$value2===void 0?void 0:_source$value2.name)!==null&&_source$value$name!==void 0?_source$value$name:'NA'};};var getDeviceDetails=function getDeviceDetails(locale,userAgent){var _locale$value,_userAgent$value;return {locale:(_locale$value=locale.value)!==null&&_locale$value!==void 0?_locale$value:'NA',userAgent:(_userAgent$value=userAgent.value)!==null&&_userAgent$value!==void 0?_userAgent$value:'NA',time:new Date()};};var getBugsnagErrorEvent=function getBugsnagErrorEvent(exception,errorState,state,groupingHash){var context=state.context,lifecycle=state.lifecycle,session=state.session,source=state.source,reporting=state.reporting,autoTrack=state.autoTrack;var app=context.app,locale=context.locale,userAgent=context.userAgent,timezone=context.timezone,screen=context.screen,library=context.library;return {payloadVersion:'5',notifier:{name:NOTIFIER_NAME,version:app.value.version,url:SDK_GITHUB_URL},events:[{exceptions:[clone(exception)],severity:errorState.severity,unhandled:errorState.unhandled,severityReason:errorState.severityReason,app:{version:app.value.version,releaseStage:getReleaseStage(),type:app.value.installType},device:getDeviceDetails(locale,userAgent),request:{url:getURLWithoutQueryString(),clientIp:'[NOT COLLECTED]'},breadcrumbs:clone(reporting.breadcrumbs.value),context:exception.message,groupingHash:groupingHash,metaData:_objectSpread2({app:{snippetVersion:library.value.snippetVersion},device:_objectSpread2(_objectSpread2({},screen.value),{},{timezone:timezone.value})},getAppStateForMetadata(state)),user:getUserDetails(source,session,lifecycle,autoTrack)}]};};// A violation only speaks for the kind of load the directive governs. default-src
|
|
1159
|
+
// is the fallback for both, so it counts for either.
|
|
1160
|
+
var SCRIPT_CSP_DIRECTIVES=['script-src-elem','script-src','default-src'];var CONNECT_CSP_DIRECTIVES=['connect-src','default-src'];var hasCspViolation=function hasCspViolation(state,url,directives){return state.capabilities.cspViolations.value.some(function(violation){return directives.includes(violation.directive)&&isSameOrUnder(url,violation.blockedURL);});};/**
|
|
1161
|
+
* Whether a URL is the blocked one or sits beneath it.
|
|
1162
|
+
*
|
|
1163
|
+
* Browsers strip a cross-origin blockedURI down to its origin, so a stored entry
|
|
1164
|
+
* is often a prefix of the failing URL rather than equal to it. Matching on a
|
|
1165
|
+
* bare string prefix is too loose: an origin entry would swallow a look-alike
|
|
1166
|
+
* host, and a script entry would swallow its own source map. The prefix only
|
|
1167
|
+
* counts when the next character starts a new path, query or fragment.
|
|
1168
|
+
*/var isSameOrUnder=function isSameOrUnder(url,blockedURL){if(url===blockedURL){return true;}if(!url.startsWith(blockedURL)){return false;}var boundary=url.charAt(blockedURL.length);return boundary==='/'||boundary==='?'||boundary==='#';};// Probes already in flight, keyed by URL. Concurrent failures share one request
|
|
1169
|
+
// rather than each firing its own HEAD and possibly reaching different verdicts
|
|
1170
|
+
// about the same URL.
|
|
1171
|
+
var inFlightProbes=new Map();/**
|
|
1172
|
+
* Probes the URL that failed to load and records what came back, so the report
|
|
1173
|
+
* can tell a request that never left the client from one the CDN answered with
|
|
1174
|
+
* an error. The failed URL is probed rather than a fixed path: plugins and
|
|
1175
|
+
* integrations sit under different prefixes and can be blocked independently.
|
|
1176
|
+
*/var probeSdkCdn=function probeSdkCdn(state,httpClient,url,done){if(isDefined(state.capabilities.sdkCdnProbe.value[url])){done();return;}var waiting=inFlightProbes.get(url);if(waiting){waiting.push(done);return;}inFlightProbes.set(url,[done]);httpClient.getAsyncData({url:url,// The CDN refuses preflight, so this has to stay a simple request: a HEAD
|
|
1177
|
+
// carrying none of the headers the client would otherwise add.
|
|
1178
|
+
skipAuthHeader:true,options:{method:'HEAD',headers:{'Content-Type':undefined,Accept:undefined}},isRawResponse:true,callback:function callback(_result,details){var _details$xhr$status,_details$xhr,_details$xhr2,_inFlightProbes$get;// A request that never reached the CDN reports status 0. A blocker that
|
|
1179
|
+
// answers instead of dropping it lands on a URL outside the CDN. An
|
|
1180
|
+
// ordinary redirect that stays under the CDN -- canonicalisation, a signed
|
|
1181
|
+
// URL -- is the CDN answering and must not be mistaken for one.
|
|
1182
|
+
var status=(_details$xhr$status=details===null||details===void 0||(_details$xhr=details.xhr)===null||_details$xhr===void 0?void 0:_details$xhr.status)!==null&&_details$xhr$status!==void 0?_details$xhr$status:0;var responseURL=details===null||details===void 0||(_details$xhr2=details.xhr)===null||_details$xhr2===void 0?void 0:_details$xhr2.responseURL;state.capabilities.sdkCdnProbe.value=_objectSpread2(_objectSpread2({},state.capabilities.sdkCdnProbe.value),{},_defineProperty({},url,{status:status,timedOut:(details===null||details===void 0?void 0:details.timedOut)===true,redirectedOffCdn:status!==0&&isString(responseURL)&&responseURL!==url&&!isSameOrUnder(responseURL,SDK_CDN_BASE_URL)}));var waiters=(_inFlightProbes$get=inFlightProbes.get(url))!==null&&_inFlightProbes$get!==void 0?_inFlightProbes$get:[];inFlightProbes.delete(url);waiters.forEach(function(waiter){return waiter();});}});};/**
|
|
1180
1183
|
* A function to determine whether the error should be promoted to notify or not.
|
|
1181
|
-
*
|
|
1182
|
-
*
|
|
1183
|
-
*
|
|
1184
|
+
* Script load failures from a host other than the RS CDN are not promoted.
|
|
1185
|
+
* For those from the RS CDN, a probe of the failed URL is awaited so its result
|
|
1186
|
+
* is carried in the report, and the error is suppressed in exactly two cases: a
|
|
1187
|
+
* CSP violation covering that URL, or a probe whose shape nothing server side
|
|
1188
|
+
* produces -- a request that never reached the CDN, or one answered by
|
|
1189
|
+
* something else. Any status the CDN itself returned is promoted.
|
|
1190
|
+
* The generic ad blocker signal is deliberately not consulted: it probes the
|
|
1191
|
+
* source config host, and a client that cannot reach the CDN cannot be told
|
|
1192
|
+
* apart from a CDN outage.
|
|
1193
|
+
* Errors from other causes are promoted unless explicitly denylisted.
|
|
1184
1194
|
* @param {Error} exception The error object
|
|
1185
1195
|
* @param {ApplicationState} state The application state
|
|
1186
1196
|
* @param {IHttpClient} httpClient The HTTP client instance
|
|
1187
1197
|
* @returns A promise that resolves to a boolean indicating whether the error should be promoted to notify or not
|
|
1188
1198
|
*/var checkIfAllowedToBeNotified=function checkIfAllowedToBeNotified(exception,state,httpClient){var errMsg=exception.message;return new Promise(function(resolve){// Filter out script load failures that are not from the RS CDN.
|
|
1189
|
-
if(SCRIPT_LOAD_FAILURE_MESSAGES.some(function(regex){return regex.test(errMsg);})){var _exec;var extractedURL=(_exec=/https?:\/\/[^\s"'(),;<>[\]{}]+/.exec(errMsg))===null||_exec===void 0?void 0:_exec[0];if(isString(extractedURL)){if(extractedURL
|
|
1190
|
-
|
|
1191
|
-
|
|
1199
|
+
if(SCRIPT_LOAD_FAILURE_MESSAGES.some(function(regex){return regex.test(errMsg);})){var _exec;var extractedURL=(_exec=/https?:\/\/[^\s"'(),;<>[\]{}]+/.exec(errMsg))===null||_exec===void 0?void 0:_exec[0];if(isString(extractedURL)){if(isSameOrUnder(extractedURL,SDK_CDN_BASE_URL)){// Wait for the CDN reachability probe so its result is carried in the
|
|
1200
|
+
// report. The generic ad blocker signal is deliberately not consulted:
|
|
1201
|
+
// it probes the source config host rather than the CDN, and a client
|
|
1202
|
+
// that cannot reach the CDN is indistinguishable from a CDN outage, so
|
|
1203
|
+
// it must not suppress the error.
|
|
1204
|
+
probeSdkCdn(state,httpClient,extractedURL,function(){// Only a script directive can explain a failed script load.
|
|
1205
|
+
var isCspBlocked=hasCspViolation(state,extractedURL,SCRIPT_CSP_DIRECTIVES);// A probe that never reached the CDN, or that was answered by
|
|
1206
|
+
// something else, is a client-side failure: nothing server side
|
|
1207
|
+
// produces either shape. A timeout is not attributable, and any
|
|
1208
|
+
// status the CDN itself returned is worth reporting.
|
|
1209
|
+
var probe=state.capabilities.sdkCdnProbe.value[extractedURL];// Unless CSP stopped the probe itself. connect-src governs the probe
|
|
1210
|
+
// while script-src governs the import, and a page can allow the
|
|
1211
|
+
// import and deny the probe -- then status 0 says nothing about the
|
|
1212
|
+
// load that actually failed, so the probe is inconclusive and the
|
|
1213
|
+
// error stands on its own.
|
|
1214
|
+
var isProbeCspBlocked=hasCspViolation(state,extractedURL,CONNECT_CSP_DIRECTIVES);var isClientSideFailure=probe!==undefined&&!probe.timedOut&&!isProbeCspBlocked&&(probe.status===0||probe.redirectedOffCdn);resolve(!isCspBlocked&&!isClientSideFailure);});}else {// Filter out errors that are not from the RS CDN.
|
|
1192
1215
|
resolve(false);}}else {// Allow the error to be notified if no URL could be extracted from the error message
|
|
1193
1216
|
resolve(true);}}else {resolve(!ERROR_MESSAGES_TO_BE_FILTERED.some(function(e){return e.test(errMsg);}));}});};/**
|
|
1194
1217
|
* A function to get the directory name from a file path.
|
|
@@ -1221,9 +1244,11 @@ function ErrorHandler(httpClient,logger){_classCallCheck(this,ErrorHandler);_def
|
|
|
1221
1244
|
* This method should be called once after construction.
|
|
1222
1245
|
*/return _createClass(ErrorHandler,[{key:"init",value:function init(){if(this.initialized){return;}this.attachErrorListeners();this.initialized=true;}/**
|
|
1223
1246
|
* Attach error listeners to the global window object
|
|
1224
|
-
*/},{key:"attachErrorListeners",value:function attachErrorListeners(){var _this=this;globalThis.addEventListener('error',function(event){_this.onError({error:event,context:ERROR_HANDLER,errorType:ErrorType.UNHANDLEDEXCEPTION});});globalThis.addEventListener('unhandledrejection',function(event){_this.onError({error:event,context:ERROR_HANDLER,errorType:ErrorType.UNHANDLEDREJECTION});});// Listen to CSP violations
|
|
1225
|
-
//
|
|
1226
|
-
|
|
1247
|
+
*/},{key:"attachErrorListeners",value:function attachErrorListeners(){var _this=this;globalThis.addEventListener('error',function(event){_this.onError({error:event,context:ERROR_HANDLER,errorType:ErrorType.UNHANDLEDEXCEPTION});});globalThis.addEventListener('unhandledrejection',function(event){_this.onError({error:event,context:ERROR_HANDLER,errorType:ErrorType.UNHANDLEDREJECTION});});// Listen to CSP violations for RS CDN URLs, recording the directive that
|
|
1248
|
+
// rejected each one. script-src governs a plugin import and connect-src the
|
|
1249
|
+
// reachability probe, so without the directive a probe-only violation looks
|
|
1250
|
+
// identical to one that stopped the script.
|
|
1251
|
+
document.addEventListener('securitypolicyviolation',function(event){var blockedURL=isString(event.blockedURI)?event.blockedURI:'';var directive=isString(event.effectiveDirective)?event.effectiveDirective:'';if(event.disposition!=='enforce'||!isSameOrUnder(blockedURL,SDK_CDN_BASE_URL)){return;}var isAlreadyRecorded=state.capabilities.cspViolations.value.some(function(violation){return violation.blockedURL===blockedURL&&violation.directive===directive;});if(!isAlreadyRecorded){state.capabilities.cspViolations.value=[].concat(_toConsumableArray(state.capabilities.cspViolations.value),[{blockedURL:blockedURL,directive:directive}]);}});}/**
|
|
1227
1252
|
* Handle errors
|
|
1228
1253
|
* @param errorInfo - The error information
|
|
1229
1254
|
* @param errorInfo.error - The error to handle
|
|
@@ -1580,7 +1605,7 @@ var DIR_NAME$1a='Keen';_defineProperty(_defineProperty(_defineProperty(_definePr
|
|
|
1580
1605
|
|
|
1581
1606
|
var DIR_NAME$19='Kissmetrics';_defineProperty(_defineProperty(_defineProperty({},KISSMETRICS_NAME,KISSMETRICS_NAME),"Kissmetrics",KISSMETRICS_NAME),"kissmetrics",KISSMETRICS_NAME);
|
|
1582
1607
|
|
|
1583
|
-
var DIR_NAME$18='CustomerIO';_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},CUSTOMERIO_NAME,CUSTOMERIO_NAME),"Customerio",CUSTOMERIO_NAME),'Customer.io',CUSTOMERIO_NAME),'CUSTOMER.IO',CUSTOMERIO_NAME),'customer.io',CUSTOMERIO_NAME)
|
|
1608
|
+
var DIR_NAME$18='CustomerIO';_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},CUSTOMERIO_NAME,CUSTOMERIO_NAME),"Customerio",CUSTOMERIO_NAME),'Customer.io',CUSTOMERIO_NAME),'CUSTOMER.IO',CUSTOMERIO_NAME),'customer.io',CUSTOMERIO_NAME);// Destination config key selecting the Customer.io client to load (top-level string, 'v1' or 'v2',
|
|
1584
1609
|
|
|
1585
1610
|
var DIR_NAME$17='Chartbeat';_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},CHARTBEAT_NAME,CHARTBEAT_NAME),"Chartbeat",CHARTBEAT_NAME),"chartbeat",CHARTBEAT_NAME),'Chart Beat',CHARTBEAT_NAME),'chart beat',CHARTBEAT_NAME);
|
|
1586
1611
|
|
|
@@ -3204,8 +3229,23 @@ var availablePlugins=[].concat(_toConsumableArray(Object.keys(pluginsInventory))
|
|
|
3204
3229
|
* Register plugins that are direct imports to PluginEngine
|
|
3205
3230
|
*/},{key:"registerLocalPlugins",value:function registerLocalPlugins(){var _this2=this;var unavailablePlugins=[];Object.entries(pluginsInventory).forEach(function(_ref){var _ref2=_slicedToArray(_ref,2),pluginName=_ref2[0],localPlugin=_ref2[1];if(state.plugins.activePlugins.value.includes(pluginName)){if(isFunction(localPlugin)){_this2.register([localPlugin()]);}else {unavailablePlugins.push(pluginName);}}});if(unavailablePlugins.length>0){state.plugins.failedPlugins.value=[].concat(_toConsumableArray(state.plugins.failedPlugins.value),unavailablePlugins);this.logger.error(UNAVAILABLE_PLUGINS_ERROR(PLUGINS_MANAGER,unavailablePlugins));}}/**
|
|
3206
3231
|
* Register plugins that are dynamic imports to PluginEngine
|
|
3207
|
-
*/},{key:"registerRemotePlugins",value:function registerRemotePlugins(){var _this3=this;var remotePluginsList=remotePluginsInventory(state.plugins.activePlugins.value);
|
|
3208
|
-
|
|
3232
|
+
*/},{key:"registerRemotePlugins",value:function registerRemotePlugins(){var _this3=this;var remotePluginsList=remotePluginsInventory(state.plugins.activePlugins.value);var loadFailures=[];// Kept separate from state.plugins.failedPlugins, which also collects
|
|
3233
|
+
// unknown plugins from setActivePlugins, unavailable local plugins from
|
|
3234
|
+
// registerLocalPlugins and registration failures from register(). Reporting
|
|
3235
|
+
// the global list would attribute those to this remote load incident.
|
|
3236
|
+
var failedRemotePlugins=[];return Promise.all(Object.keys(remotePluginsList).map(/*#__PURE__*/function(){var _ref3=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(remotePluginKey){return _regenerator().w(function(_context){while(1)switch(_context.n){case 0:_context.n=1;return remotePluginsList[remotePluginKey]().then(function(remotePluginModule){return _this3.register([remotePluginModule.default()]);}).catch(function(err){var _message;// TODO: add retry here if dynamic import fails
|
|
3237
|
+
failedRemotePlugins.push(remotePluginKey);state.plugins.failedPlugins.value=[].concat(_toConsumableArray(state.plugins.failedPlugins.value),[remotePluginKey]);_this3.logger.error(REMOTE_PLUGIN_LOAD_ERROR(PLUGINS_MANAGER,remotePluginKey,// A rejection is not guaranteed to be an Error; the assertion
|
|
3238
|
+
// only silences the compiler, so the reason still needs a
|
|
3239
|
+
// fallback or the log reads "- undefined".
|
|
3240
|
+
(_message=err===null||err===void 0?void 0:err.message)!==null&&_message!==void 0?_message:String(err)));loadFailures.push(err);});case 1:return _context.a(2);}},_callee);}));return function(_x){return _ref3.apply(this,arguments);};}())).then(function(){// A failed remote entry rejects every plugin import at once, so the
|
|
3241
|
+
// fan-out is one incident and gets one report, raised only after every
|
|
3242
|
+
// import has settled so it names all of them.
|
|
3243
|
+
//
|
|
3244
|
+
// An import that never settles therefore means no report. That is
|
|
3245
|
+
// deliberate: a dynamic import has no timeout of its own, and holding a
|
|
3246
|
+
// timer open to salvage a partial report would spend page resources on
|
|
3247
|
+
// error reporting, which is the lowest priority thing the SDK does.
|
|
3248
|
+
if(failedRemotePlugins.length===0){return;}var firstFailure=loadFailures[0];_this3.onError(firstFailure,"Failed to load plugins: ".concat(failedRemotePlugins.join(', ')),firstFailure);}).catch(function(err){_this3.onError(err);});}/**
|
|
3209
3249
|
* Extension point invoke that allows multiple plugins to be registered to it with error handling
|
|
3210
3250
|
*/},{key:"invokeMultiple",value:function invokeMultiple(extPoint){try{var _this$engine;for(var _len=arguments.length,args=new Array(_len>1?_len-1:0),_key=1;_key<_len;_key++){args[_key-1]=arguments[_key];}return (_this$engine=this.engine).invokeMultiple.apply(_this$engine,[extPoint].concat(args));}catch(e){this.onError(e,extPoint);return [];}}/**
|
|
3211
3251
|
* Extension point invoke that allows a single plugin to be registered to it with error handling
|
|
@@ -3616,6 +3656,18 @@ ArrayBuffer:function ArrayBuffer(){return !isFunction(globalThis.Uint8Array);},S
|
|
|
3616
3656
|
var POLYFILL_URL='';var POLYFILL_LOAD_TIMEOUT=10*1000;// 10 seconds
|
|
3617
3657
|
var POLYFILL_SCRIPT_ID='rudderstackPolyfill';
|
|
3618
3658
|
|
|
3659
|
+
var detectAdBlockers=function detectAdBlockers(httpClient){state.capabilities.isAdBlockerDetectionInProgress.value=true;try{// Apparently, '?view=ad' is a query param that is blocked by majority of adblockers
|
|
3660
|
+
// Use source config URL here as it is very unlikely to be blocked by adblockers
|
|
3661
|
+
// Only the extra query param should make it vulnerable to adblockers
|
|
3662
|
+
// This will work even if the users proxies it.
|
|
3663
|
+
// The edge case where this doesn't work is when HEAD method is not allowed by the server (user's)
|
|
3664
|
+
var baseUrl=new URL(state.lifecycle.sourceConfigUrl.value);var url="".concat(baseUrl.origin).concat(baseUrl.pathname,"?view=ad");httpClient.getAsyncData({url:url,options:{// We actually don't need the response from the request, so we are using HEAD
|
|
3665
|
+
method:'HEAD',headers:{'Content-Type':undefined}},isRawResponse:true,callback:function callback(result,details){var _details$xhr;state.capabilities.isAdBlockerDetectionInProgress.value=false;// not ad blocked if the request is successful or it is not internally redirected on the client side
|
|
3666
|
+
// Often adblockers instead of blocking the request, they redirect it to an internal URL
|
|
3667
|
+
state.capabilities.isAdBlocked.value=(details===null||details===void 0?void 0:details.error)!==undefined||(details===null||details===void 0||(_details$xhr=details.xhr)===null||_details$xhr===void 0?void 0:_details$xhr.responseURL)!==url;}});}catch(err){// Reset the flag to prevent blocking future detection attempts
|
|
3668
|
+
state.capabilities.isAdBlockerDetectionInProgress.value=false;// Re-throw the error to be handled by the caller
|
|
3669
|
+
throw err;}};
|
|
3670
|
+
|
|
3619
3671
|
var hasCrypto=function hasCrypto(){return !isNullOrUndefined(globalThis.crypto)&&isFunction(globalThis.crypto.getRandomValues);};// eslint-disable-next-line compat/compat -- We are checking for the existence of navigator.userAgentData
|
|
3620
3672
|
var hasUAClientHints=function hasUAClientHints(){return !isNullOrUndefined(globalThis.navigator.userAgentData);};var hasBeacon=function hasBeacon(){return !isNullOrUndefined(globalThis.navigator.sendBeacon)&&isFunction(globalThis.navigator.sendBeacon);};
|
|
3621
3673
|
|