@rudderstack/analytics-js 3.7.18 → 3.8.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.
@@ -376,7 +376,7 @@
376
376
 
377
377
  const CAPABILITIES_MANAGER='CapabilitiesManager';const CONFIG_MANAGER='ConfigManager';const EVENT_MANAGER='EventManager';const PLUGINS_MANAGER='PluginsManager';const USER_SESSION_MANAGER='UserSessionManager';const ERROR_HANDLER='ErrorHandler';const PLUGIN_ENGINE='PluginEngine';const STORE_MANAGER='StoreManager';const READY_API='readyApi';const EVENT_REPOSITORY='EventRepository';const EXTERNAL_SRC_LOADER='ExternalSrcLoader';const HTTP_CLIENT='HttpClient';const RS_APP='RudderStackApplication';const ANALYTICS_CORE='AnalyticsCore';
378
378
 
379
- const APP_NAME='RudderLabs JavaScript SDK';const APP_VERSION='3.7.18';const APP_NAMESPACE='com.rudderlabs.javascript';const MODULE_TYPE='npm';const ADBLOCK_PAGE_CATEGORY='RudderJS-Initiated';const ADBLOCK_PAGE_NAME='ad-block page request';const ADBLOCK_PAGE_PATH='/ad-blocked';const GLOBAL_PRELOAD_BUFFER='preloadedEventsBuffer';const CONSENT_TRACK_EVENT_NAME='Consent Management Interaction';
379
+ const APP_NAME='RudderLabs JavaScript SDK';const APP_VERSION='3.8.0';const APP_NAMESPACE='com.rudderlabs.javascript';const MODULE_TYPE='npm';const ADBLOCK_PAGE_CATEGORY='RudderJS-Initiated';const ADBLOCK_PAGE_NAME='ad-block page request';const ADBLOCK_PAGE_PATH='/ad-blocked';const GLOBAL_PRELOAD_BUFFER='preloadedEventsBuffer';const CONSENT_TRACK_EVENT_NAME='Consent Management Interaction';
380
380
 
381
381
  const QUERY_PARAM_TRAIT_PREFIX='ajs_trait_';const QUERY_PARAM_PROPERTY_PREFIX='ajs_prop_';const QUERY_PARAM_ANONYMOUS_ID_KEY='ajs_aid';const QUERY_PARAM_USER_ID_KEY='ajs_uid';const QUERY_PARAM_TRACK_EVENT_NAME_KEY='ajs_event';
382
382
 
@@ -536,9 +536,9 @@
536
536
 
537
537
  const BUILD_TYPE='modern';const SDK_CDN_BASE_URL='https://cdn.rudderlabs.com';const CDN_ARCH_VERSION_DIR='v3';const DEST_SDK_BASE_URL=`${SDK_CDN_BASE_URL}/${CDN_ARCH_VERSION_DIR}/${BUILD_TYPE}/${CDN_INT_DIR}`;const PLUGINS_BASE_URL=`${SDK_CDN_BASE_URL}/${CDN_ARCH_VERSION_DIR}/${BUILD_TYPE}/${CDN_PLUGINS_DIR}`;const DEFAULT_CONFIG_BE_URL='https://api.rudderstack.com';
538
538
 
539
- const DEFAULT_STORAGE_ENCRYPTION_VERSION='v3';const DEFAULT_DATA_PLANE_EVENTS_TRANSPORT='xhr';const ConsentManagersToPluginNameMap={oneTrust:'OneTrustConsentManager',ketch:'KetchConsentManager',custom:'CustomConsentManager'};const StorageEncryptionVersionsToPluginNameMap={[DEFAULT_STORAGE_ENCRYPTION_VERSION]:'StorageEncryption',legacy:'StorageEncryptionLegacy'};const DataPlaneEventsTransportToPluginNameMap={[DEFAULT_DATA_PLANE_EVENTS_TRANSPORT]:'XhrQueue',beacon:'BeaconQueue'};const DEFAULT_DATA_SERVICE_ENDPOINT='rsaRequest';const METRICS_SERVICE_ENDPOINT='rsaMetrics';
539
+ const DEFAULT_STORAGE_ENCRYPTION_VERSION='v3';const DEFAULT_DATA_PLANE_EVENTS_TRANSPORT='xhr';const ConsentManagersToPluginNameMap={iubenda:'IubendaConsentManager',oneTrust:'OneTrustConsentManager',ketch:'KetchConsentManager',custom:'CustomConsentManager'};const StorageEncryptionVersionsToPluginNameMap={[DEFAULT_STORAGE_ENCRYPTION_VERSION]:'StorageEncryption',legacy:'StorageEncryptionLegacy'};const DataPlaneEventsTransportToPluginNameMap={[DEFAULT_DATA_PLANE_EVENTS_TRANSPORT]:'XhrQueue',beacon:'BeaconQueue'};const DEFAULT_DATA_SERVICE_ENDPOINT='rsaRequest';const METRICS_SERVICE_ENDPOINT='rsaMetrics';
540
540
 
541
- const 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};const loadOptionsState=d$1(clone(defaultLoadOptions));
541
+ const 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};const loadOptionsState=d$1(clone(defaultLoadOptions));
542
542
 
543
543
  const DEFAULT_USER_SESSION_VALUES={userId:'',userTraits:{},anonymousId:'',groupId:'',groupTraits:{},initialReferrer:'',initialReferringDomain:'',sessionInfo:{},authToken:null};const SERVER_SIDE_COOKIES_DEBOUNCE_TIME=10;// milliseconds
544
544
 
@@ -632,7 +632,7 @@
632
632
  /**
633
633
  * List of plugin names that are loaded as dynamic imports in modern builds
634
634
  */const pluginNamesList=['BeaconQueue','Bugsnag',// deprecated
635
- 'CustomConsentManager','DeviceModeDestinations','DeviceModeTransformation','ErrorReporting','ExternalAnonymousId','GoogleLinker','KetchConsentManager','NativeDestinationQueue','OneTrustConsentManager','StorageEncryption','StorageEncryptionLegacy','StorageMigrator','XhrQueue'];
635
+ 'CustomConsentManager','DeviceModeDestinations','DeviceModeTransformation','ErrorReporting','ExternalAnonymousId','GoogleLinker','IubendaConsentManager','KetchConsentManager','NativeDestinationQueue','OneTrustConsentManager','StorageEncryption','StorageEncryptionLegacy','StorageMigrator','XhrQueue'];
636
636
 
637
637
  /**
638
638
  * To get the current timestamp in ISO string format
@@ -829,7 +829,7 @@
829
829
  // Hence, we need this backward compatibility check
830
830
  if(isFunction(storageEngine.keys)){storageKeys=storageEngine.keys();}else {for(let i=0;i<storageEngine.length;i++){const key=storageEngine.key(i);if(key){storageKeys.push(key);}}}storageKeys.forEach(k=>{const keyParts=k?k.split('.'):[];if(keyParts.length>=3&&keyParts[0]===name&&keyParts[1]!==this.id&&keyParts[2]===QueueStatuses.ACK){res.push(this.storeManager.setStore({id:keyParts[1],name,validKeys:QueueStatuses,type:LOCAL_STORAGE}));}});return res;};findOtherQueues(this.name).forEach(store=>{if(this.schedule.now()-store.get(QueueStatuses.ACK)<this.timeouts.reclaimTimeout){return;}tryReclaim(store);});this.schedule.run(this.checkReclaim,this.timeouts.reclaimTimer,ScheduleModes.RESCHEDULE);}clear(){this.schedule.cancelAll();this.setDefaultQueueEntries();}}
831
831
 
832
- const pluginName$e='BeaconQueue';const BeaconQueue=()=>({name:pluginName$e,deps:[],initialize:state=>{state.plugins.loadedPlugins.value=[...state.plugins.loadedPlugins.value,pluginName$e];},dataplaneEventsQueue:{/**
832
+ const pluginName$f='BeaconQueue';const BeaconQueue=()=>({name:pluginName$f,deps:[],initialize:state=>{state.plugins.loadedPlugins.value=[...state.plugins.loadedPlugins.value,pluginName$f];},dataplaneEventsQueue:{/**
833
833
  * Initialize the queue for delivery
834
834
  * @param state Application state
835
835
  * @param httpClient http client instance
@@ -859,7 +859,7 @@
859
859
 
860
860
  const isApiKeyValid=apiKey=>{const isAPIKeyValid=!(apiKey.startsWith('{{')||apiKey.endsWith('}}')||apiKey.length===0);return isAPIKeyValid;};
861
861
 
862
- const pluginName$d='Bugsnag';const Bugsnag=()=>({name:pluginName$d,deps:[],initialize:state=>{state.plugins.loadedPlugins.value=[...state.plugins.loadedPlugins.value,pluginName$d];},errorReportingProvider:{init:(state,externalSrcLoader,logger)=>new Promise((resolve,reject)=>{// If API key token is not parsed or invalid, don't proceed to initialize the client
862
+ const pluginName$e='Bugsnag';const Bugsnag=()=>({name:pluginName$e,deps:[],initialize:state=>{state.plugins.loadedPlugins.value=[...state.plugins.loadedPlugins.value,pluginName$e];},errorReportingProvider:{init:(state,externalSrcLoader,logger)=>new Promise((resolve,reject)=>{// If API key token is not parsed or invalid, don't proceed to initialize the client
863
863
  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
864
864
  // eslint-disable-next-line no-constant-condition
865
865
  // @ts-expect-error we're dynamically filling this value during build
@@ -868,177 +868,179 @@
868
868
 
869
869
  const CUSTOM_CONSENT_MANAGER_PLUGIN='CustomConsentManagerPlugin';
870
870
 
871
- const DESTINATION_CONSENT_STATUS_ERROR$2=`Failed to determine the consent status for the destination. Please check the destination configuration and try again.`;
871
+ const DESTINATION_CONSENT_STATUS_ERROR$3=`Failed to determine the consent status for the destination. Please check the destination configuration and try again.`;
872
872
 
873
- const pluginName$c='CustomConsentManager';const CustomConsentManager=()=>({name:pluginName$c,deps:[],initialize:state=>{state.plugins.loadedPlugins.value=[...state.plugins.loadedPlugins.value,pluginName$c];},consentManager:{init(state,logger){// Nothing to initialize
873
+ const pluginName$d='CustomConsentManager';const CustomConsentManager=()=>({name:pluginName$d,deps:[],initialize:state=>{state.plugins.loadedPlugins.value=[...state.plugins.loadedPlugins.value,pluginName$d];},consentManager:{init(state,logger){// Nothing to initialize
874
874
  },updateConsentsInfo(state,storeManager,logger){// Nothing to update. Already provided by the user
875
875
  },isDestinationConsented(state,destConfig,errorHandler,logger){if(!state.consents.initialized.value){return true;}const allowedConsentIds=state.consents.data.value.allowedConsentIds;try{const{consentManagement}=destConfig;// If the destination does not have consent management config, events should be sent.
876
876
  if(!consentManagement){return true;}// Get the corresponding consents for the destination
877
877
  const cmpConfig=consentManagement.find(c=>c.provider===state.consents.provider.value);// If there are no consents configured for the destination for the current provider, events should be sent.
878
878
  if(!cmpConfig?.consents){return true;}const configuredConsents=cmpConfig.consents.map(c=>c.consent.trim()).filter(n=>n);const resolutionStrategy=cmpConfig.resolutionStrategy??state.consents.resolutionStrategy.value;// match the configured consents with user provided consents as per
879
879
  // the configured resolution strategy
880
- const matchPredicate=consent=>allowedConsentIds.includes(consent);switch(resolutionStrategy){case'or':return configuredConsents.some(matchPredicate)||configuredConsents.length===0;case'and':default:return configuredConsents.every(matchPredicate);}}catch(err){errorHandler?.onError(err,CUSTOM_CONSENT_MANAGER_PLUGIN,DESTINATION_CONSENT_STATUS_ERROR$2);return true;}}}});
880
+ const matchPredicate=consent=>allowedConsentIds.includes(consent);switch(resolutionStrategy){case'or':return configuredConsents.some(matchPredicate)||configuredConsents.length===0;case'and':default:return configuredConsents.every(matchPredicate);}}catch(err){errorHandler?.onError(err,CUSTOM_CONSENT_MANAGER_PLUGIN,DESTINATION_CONSENT_STATUS_ERROR$3);return true;}}}});
881
881
 
882
- const DIR_NAME$1e='AdobeAnalytics';const DISPLAY_NAME$1e='Adobe Analytics';
882
+ const DIR_NAME$1f='AdobeAnalytics';const DISPLAY_NAME$1f='Adobe Analytics';
883
883
 
884
- const DIR_NAME$1d='Amplitude';const DISPLAY_NAME$1d='Amplitude';
884
+ const DIR_NAME$1e='Amplitude';const DISPLAY_NAME$1e='Amplitude';
885
885
 
886
- const DIR_NAME$1c='Appcues';const DISPLAY_NAME$1c='Appcues';
886
+ const DIR_NAME$1d='Appcues';const DISPLAY_NAME$1d='Appcues';
887
887
 
888
- const DIR_NAME$1b='BingAds';const DISPLAY_NAME$1b='Bing Ads';
888
+ const DIR_NAME$1c='BingAds';const DISPLAY_NAME$1c='Bing Ads';
889
889
 
890
- const DIR_NAME$1a='Braze';const DISPLAY_NAME$1a='Braze';
890
+ const DIR_NAME$1b='Braze';const DISPLAY_NAME$1b='Braze';
891
891
 
892
- const DIR_NAME$19='Bugsnag';const DISPLAY_NAME$19='Bugsnag';
892
+ const DIR_NAME$1a='Bugsnag';const DISPLAY_NAME$1a='Bugsnag';
893
893
 
894
- const DIR_NAME$18='Chartbeat';const DISPLAY_NAME$18='Chartbeat';
894
+ const DIR_NAME$19='Chartbeat';const DISPLAY_NAME$19='Chartbeat';
895
895
 
896
- const DIR_NAME$17='Clevertap';const DISPLAY_NAME$17='CleverTap';
896
+ const DIR_NAME$18='Clevertap';const DISPLAY_NAME$18='CleverTap';
897
897
 
898
- const DIR_NAME$16='Comscore';const DISPLAY_NAME$16='Comscore';
898
+ const DIR_NAME$17='Comscore';const DISPLAY_NAME$17='Comscore';
899
899
 
900
- const DIR_NAME$15='Criteo';const DISPLAY_NAME$15='Criteo';
900
+ const DIR_NAME$16='Criteo';const DISPLAY_NAME$16='Criteo';
901
901
 
902
- const DIR_NAME$14='CustomerIO';const DISPLAY_NAME$14='Customer IO';
902
+ const DIR_NAME$15='CustomerIO';const DISPLAY_NAME$15='Customer IO';
903
903
 
904
- const DIR_NAME$13='Drip';const DISPLAY_NAME$13='Drip';
904
+ const DIR_NAME$14='Drip';const DISPLAY_NAME$14='Drip';
905
905
 
906
- const DIR_NAME$12='FacebookPixel';const DISPLAY_NAME$12='Facebook Pixel';
906
+ const DIR_NAME$13='FacebookPixel';const DISPLAY_NAME$13='Facebook Pixel';
907
907
 
908
- const DIR_NAME$11='Fullstory';const DISPLAY_NAME$11='Fullstory';
908
+ const DIR_NAME$12='Fullstory';const DISPLAY_NAME$12='Fullstory';
909
909
 
910
- const DIR_NAME$10='GA';const DISPLAY_NAME$10='Google Analytics';
910
+ const DIR_NAME$11='GA';const DISPLAY_NAME$11='Google Analytics';
911
911
 
912
- const DIR_NAME$$='GA4';const DISPLAY_NAME$$='Google Analytics 4 (GA4)';
912
+ const DIR_NAME$10='GA4';const DISPLAY_NAME$10='Google Analytics 4 (GA4)';
913
913
 
914
- const DIR_NAME$_='GA4_V2';const DISPLAY_NAME$_='Google Analytics 4 (GA4) V2';
914
+ const DIR_NAME$$='GA4_V2';const DISPLAY_NAME$$='Google Analytics 4 (GA4) V2';
915
915
 
916
- const DIR_NAME$Z='GoogleAds';const DISPLAY_NAME$Z='Google Ads';
916
+ const DIR_NAME$_='GoogleAds';const DISPLAY_NAME$_='Google Ads';
917
917
 
918
- const DIR_NAME$Y='GoogleOptimize';const DISPLAY_NAME$Y='Google Optimize';
918
+ const DIR_NAME$Z='GoogleOptimize';const DISPLAY_NAME$Z='Google Optimize';
919
919
 
920
- const DIR_NAME$X='GoogleTagManager';const DISPLAY_NAME$X='Google Tag Manager';
920
+ const DIR_NAME$Y='GoogleTagManager';const DISPLAY_NAME$Y='Google Tag Manager';
921
921
 
922
- const DIR_NAME$W='Heap';const DISPLAY_NAME$W='Heap.io';
922
+ const DIR_NAME$X='Heap';const DISPLAY_NAME$X='Heap.io';
923
923
 
924
- const DIR_NAME$V='Hotjar';const DISPLAY_NAME$V='Hotjar';
924
+ const DIR_NAME$W='Hotjar';const DISPLAY_NAME$W='Hotjar';
925
925
 
926
- const DIR_NAME$U='HubSpot';const DISPLAY_NAME$U='HubSpot';
926
+ const DIR_NAME$V='HubSpot';const DISPLAY_NAME$V='HubSpot';
927
927
 
928
- const DIR_NAME$T='INTERCOM';const DISPLAY_NAME$T='Intercom';
928
+ const DIR_NAME$U='INTERCOM';const DISPLAY_NAME$U='Intercom';
929
929
 
930
- const DIR_NAME$S='Keen';const DISPLAY_NAME$S='Keen';
930
+ const DIR_NAME$T='Keen';const DISPLAY_NAME$T='Keen';
931
931
 
932
- const DIR_NAME$R='Kissmetrics';const DISPLAY_NAME$R='Kiss Metrics';
932
+ const DIR_NAME$S='Kissmetrics';const DISPLAY_NAME$S='Kiss Metrics';
933
933
 
934
- const DIR_NAME$Q='Klaviyo';const DISPLAY_NAME$Q='Klaviyo';
934
+ const DIR_NAME$R='Klaviyo';const DISPLAY_NAME$R='Klaviyo';
935
935
 
936
- const DIR_NAME$P='LaunchDarkly';const DISPLAY_NAME$P='LaunchDarkly';
936
+ const DIR_NAME$Q='LaunchDarkly';const DISPLAY_NAME$Q='LaunchDarkly';
937
937
 
938
- const DIR_NAME$O='LinkedInInsightTag';const DISPLAY_NAME$O='Linkedin Insight Tag';
938
+ const DIR_NAME$P='LinkedInInsightTag';const DISPLAY_NAME$P='Linkedin Insight Tag';
939
939
 
940
- const DIR_NAME$N='Lotame';const DISPLAY_NAME$N='Lotame';
940
+ const DIR_NAME$O='Lotame';const DISPLAY_NAME$O='Lotame';
941
941
 
942
- const DIR_NAME$M='Lytics';const DISPLAY_NAME$M='Lytics';
942
+ const DIR_NAME$N='Lytics';const DISPLAY_NAME$N='Lytics';
943
943
 
944
- const DIR_NAME$L='Mixpanel';const DISPLAY_NAME$L='Mixpanel';
944
+ const DIR_NAME$M='Mixpanel';const DISPLAY_NAME$M='Mixpanel';
945
945
 
946
- const DIR_NAME$K='MoEngage';const DISPLAY_NAME$K='MoEngage';
946
+ const DIR_NAME$L='MoEngage';const DISPLAY_NAME$L='MoEngage';
947
947
 
948
- const DIR_NAME$J='Optimizely';const DISPLAY_NAME$J='Optimizely Web';
948
+ const DIR_NAME$K='Optimizely';const DISPLAY_NAME$K='Optimizely Web';
949
949
 
950
- const DIR_NAME$I='Pendo';const DISPLAY_NAME$I='Pendo';
950
+ const DIR_NAME$J='Pendo';const DISPLAY_NAME$J='Pendo';
951
951
 
952
- const DIR_NAME$H='PinterestTag';const DISPLAY_NAME$H='Pinterest Tag';
952
+ const DIR_NAME$I='PinterestTag';const DISPLAY_NAME$I='Pinterest Tag';
953
953
 
954
- const DIR_NAME$G='PostAffiliatePro';const DISPLAY_NAME$G='Post Affiliate Pro';
954
+ const DIR_NAME$H='PostAffiliatePro';const DISPLAY_NAME$H='Post Affiliate Pro';
955
955
 
956
- const DIR_NAME$F='Posthog';const DISPLAY_NAME$F='PostHog';
956
+ const DIR_NAME$G='Posthog';const DISPLAY_NAME$G='PostHog';
957
957
 
958
- const DIR_NAME$E='ProfitWell';const DISPLAY_NAME$E='ProfitWell';
958
+ const DIR_NAME$F='ProfitWell';const DISPLAY_NAME$F='ProfitWell';
959
959
 
960
- const DIR_NAME$D='Qualtrics';const DISPLAY_NAME$D='Qualtrics';
960
+ const DIR_NAME$E='Qualtrics';const DISPLAY_NAME$E='Qualtrics';
961
961
 
962
- const DIR_NAME$C='QuantumMetric';const DISPLAY_NAME$C='Quantum Metric';
962
+ const DIR_NAME$D='QuantumMetric';const DISPLAY_NAME$D='Quantum Metric';
963
963
 
964
- const DIR_NAME$B='RedditPixel';const DISPLAY_NAME$B='Reddit Pixel';
964
+ const DIR_NAME$C='RedditPixel';const DISPLAY_NAME$C='Reddit Pixel';
965
965
 
966
- const DIR_NAME$A='Sentry';const DISPLAY_NAME$A='Sentry';
966
+ const DIR_NAME$B='Sentry';const DISPLAY_NAME$B='Sentry';
967
967
 
968
- const DIR_NAME$z='SnapPixel';const DISPLAY_NAME$z='Snap Pixel';
968
+ const DIR_NAME$A='SnapPixel';const DISPLAY_NAME$A='Snap Pixel';
969
969
 
970
- const DIR_NAME$y='TVSquared';const DISPLAY_NAME$y='TVSquared';
970
+ const DIR_NAME$z='TVSquared';const DISPLAY_NAME$z='TVSquared';
971
971
 
972
- const DIR_NAME$x='VWO';const DISPLAY_NAME$x='VWO';
972
+ const DIR_NAME$y='VWO';const DISPLAY_NAME$y='VWO';
973
973
 
974
- const DIR_NAME$w='GA360';const DISPLAY_NAME$w='Google Analytics 360';
974
+ const DIR_NAME$x='GA360';const DISPLAY_NAME$x='Google Analytics 360';
975
975
 
976
- const DIR_NAME$v='Adroll';const DISPLAY_NAME$v='Adroll';
976
+ const DIR_NAME$w='Adroll';const DISPLAY_NAME$w='Adroll';
977
977
 
978
- const DIR_NAME$u='DCMFloodlight';const DISPLAY_NAME$u='DCM Floodlight';
978
+ const DIR_NAME$v='DCMFloodlight';const DISPLAY_NAME$v='DCM Floodlight';
979
979
 
980
- const DIR_NAME$t='Matomo';const DISPLAY_NAME$t='Matomo';
980
+ const DIR_NAME$u='Matomo';const DISPLAY_NAME$u='Matomo';
981
981
 
982
- const DIR_NAME$s='Vero';const DISPLAY_NAME$s='Vero';
982
+ const DIR_NAME$t='Vero';const DISPLAY_NAME$t='Vero';
983
983
 
984
- const DIR_NAME$r='Mouseflow';const DISPLAY_NAME$r='Mouseflow';
984
+ const DIR_NAME$s='Mouseflow';const DISPLAY_NAME$s='Mouseflow';
985
985
 
986
- const DIR_NAME$q='Rockerbox';const DISPLAY_NAME$q='Rockerbox';
986
+ const DIR_NAME$r='Rockerbox';const DISPLAY_NAME$r='Rockerbox';
987
987
 
988
- const DIR_NAME$p='ConvertFlow';const DISPLAY_NAME$p='ConvertFlow';
988
+ const DIR_NAME$q='ConvertFlow';const DISPLAY_NAME$q='ConvertFlow';
989
989
 
990
- const DIR_NAME$o='SnapEngage';const DISPLAY_NAME$o='SnapEngage';
990
+ const DIR_NAME$p='SnapEngage';const DISPLAY_NAME$p='SnapEngage';
991
991
 
992
- const DIR_NAME$n='LiveChat';const DISPLAY_NAME$n='LiveChat';
992
+ const DIR_NAME$o='LiveChat';const DISPLAY_NAME$o='LiveChat';
993
993
 
994
- const DIR_NAME$m='Shynet';const DISPLAY_NAME$m='Shynet';
994
+ const DIR_NAME$n='Shynet';const DISPLAY_NAME$n='Shynet';
995
995
 
996
- const DIR_NAME$l='Woopra';const DISPLAY_NAME$l='Woopra';
996
+ const DIR_NAME$m='Woopra';const DISPLAY_NAME$m='Woopra';
997
997
 
998
- const DIR_NAME$k='RollBar';const DISPLAY_NAME$k='RollBar';
998
+ const DIR_NAME$l='RollBar';const DISPLAY_NAME$l='RollBar';
999
999
 
1000
- const DIR_NAME$j='QuoraPixel';const DISPLAY_NAME$j='Quora Pixel';
1000
+ const DIR_NAME$k='QuoraPixel';const DISPLAY_NAME$k='Quora Pixel';
1001
1001
 
1002
- const DIR_NAME$i='June';const DISPLAY_NAME$i='JUNE';
1002
+ const DIR_NAME$j='June';const DISPLAY_NAME$j='JUNE';
1003
1003
 
1004
- const DIR_NAME$h='Engage';const DISPLAY_NAME$h='Engage';
1004
+ const DIR_NAME$i='Engage';const DISPLAY_NAME$i='Engage';
1005
1005
 
1006
- const DIR_NAME$g='Iterable';const DISPLAY_NAME$g='Iterable';
1006
+ const DIR_NAME$h='Iterable';const DISPLAY_NAME$h='Iterable';
1007
1007
 
1008
- const DIR_NAME$f='YandexMetrica';const DISPLAY_NAME$f='Yandex.Metrica';
1008
+ const DIR_NAME$g='YandexMetrica';const DISPLAY_NAME$g='Yandex.Metrica';
1009
1009
 
1010
- const DIR_NAME$e='Refiner';const DISPLAY_NAME$e='Refiner';
1010
+ const DIR_NAME$f='Refiner';const DISPLAY_NAME$f='Refiner';
1011
1011
 
1012
- const DIR_NAME$d='Qualaroo';const DISPLAY_NAME$d='Qualaroo';
1012
+ const DIR_NAME$e='Qualaroo';const DISPLAY_NAME$e='Qualaroo';
1013
1013
 
1014
- const DIR_NAME$c='Podsights';const DISPLAY_NAME$c='Podsights';
1014
+ const DIR_NAME$d='Podsights';const DISPLAY_NAME$d='Podsights';
1015
1015
 
1016
- const DIR_NAME$b='Axeptio';const DISPLAY_NAME$b='Axeptio';
1016
+ const DIR_NAME$c='Axeptio';const DISPLAY_NAME$c='Axeptio';
1017
1017
 
1018
- const DIR_NAME$a='Satismeter';const DISPLAY_NAME$a='Satismeter';
1018
+ const DIR_NAME$b='Satismeter';const DISPLAY_NAME$b='Satismeter';
1019
1019
 
1020
- const DIR_NAME$9='MicrosoftClarity';const DISPLAY_NAME$9='Microsoft Clarity';
1020
+ const DIR_NAME$a='MicrosoftClarity';const DISPLAY_NAME$a='Microsoft Clarity';
1021
1021
 
1022
- const DIR_NAME$8='Sendinblue';const DISPLAY_NAME$8='Sendinblue';
1022
+ const DIR_NAME$9='Sendinblue';const DISPLAY_NAME$9='Sendinblue';
1023
1023
 
1024
- const DIR_NAME$7='Olark';const DISPLAY_NAME$7='Olark';
1024
+ const DIR_NAME$8='Olark';const DISPLAY_NAME$8='Olark';
1025
1025
 
1026
- const DIR_NAME$6='Lemnisk';const DISPLAY_NAME$6='Lemnisk';
1026
+ const DIR_NAME$7='Lemnisk';const DISPLAY_NAME$7='Lemnisk';
1027
1027
 
1028
- const DIR_NAME$5='TiktokAds';const DISPLAY_NAME$5='TikTok Ads';
1028
+ const DIR_NAME$6='TiktokAds';const DISPLAY_NAME$6='TikTok Ads';
1029
1029
 
1030
- const DIR_NAME$4='ActiveCampaign';const DISPLAY_NAME$4='Active Campaign';
1030
+ const DIR_NAME$5='ActiveCampaign';const DISPLAY_NAME$5='Active Campaign';
1031
1031
 
1032
- const DIR_NAME$3='Sprig';const DISPLAY_NAME$3='Sprig';
1032
+ const DIR_NAME$4='Sprig';const DISPLAY_NAME$4='Sprig';
1033
1033
 
1034
- const DIR_NAME$2='SpotifyPixel';const DISPLAY_NAME$2='Spotify Pixel';
1034
+ const DIR_NAME$3='SpotifyPixel';const DISPLAY_NAME$3='Spotify Pixel';
1035
1035
 
1036
- const DIR_NAME$1='CommandBar';const DISPLAY_NAME$1='CommandBar';
1036
+ const DIR_NAME$2='CommandBar';const DISPLAY_NAME$2='CommandBar';
1037
1037
 
1038
- const DIR_NAME='Ninetailed';const DISPLAY_NAME='Ninetailed';
1038
+ const DIR_NAME$1='Ninetailed';const DISPLAY_NAME$1='Ninetailed';
1039
+
1040
+ const DIR_NAME='XPixel';const DISPLAY_NAME='XPixel';
1039
1041
 
1040
1042
  // map of the destination display names to the destination directory names
1041
- const destDisplayNamesToFileNamesMap={[DISPLAY_NAME$U]:DIR_NAME$U,[DISPLAY_NAME$10]:DIR_NAME$10,[DISPLAY_NAME$V]:DIR_NAME$V,[DISPLAY_NAME$Z]:DIR_NAME$Z,[DISPLAY_NAME$x]:DIR_NAME$x,[DISPLAY_NAME$X]:DIR_NAME$X,[DISPLAY_NAME$1a]:DIR_NAME$1a,[DISPLAY_NAME$T]:DIR_NAME$T,[DISPLAY_NAME$S]:DIR_NAME$S,[DISPLAY_NAME$R]:DIR_NAME$R,[DISPLAY_NAME$14]:DIR_NAME$14,[DISPLAY_NAME$18]:DIR_NAME$18,[DISPLAY_NAME$16]:DIR_NAME$16,[DISPLAY_NAME$12]:DIR_NAME$12,[DISPLAY_NAME$N]:DIR_NAME$N,[DISPLAY_NAME$J]:DIR_NAME$J,[DISPLAY_NAME$19]:DIR_NAME$19,[DISPLAY_NAME$11]:DIR_NAME$11,[DISPLAY_NAME$y]:DIR_NAME$y,[DISPLAY_NAME$$]:DIR_NAME$$,[DISPLAY_NAME$_]:DIR_NAME$_,[DISPLAY_NAME$K]:DIR_NAME$K,[DISPLAY_NAME$1d]:DIR_NAME$1d,[DISPLAY_NAME$I]:DIR_NAME$I,[DISPLAY_NAME$M]:DIR_NAME$M,[DISPLAY_NAME$1c]:DIR_NAME$1c,[DISPLAY_NAME$F]:DIR_NAME$F,[DISPLAY_NAME$Q]:DIR_NAME$Q,[DISPLAY_NAME$17]:DIR_NAME$17,[DISPLAY_NAME$1b]:DIR_NAME$1b,[DISPLAY_NAME$H]:DIR_NAME$H,[DISPLAY_NAME$1e]:DIR_NAME$1e,[DISPLAY_NAME$O]:DIR_NAME$O,[DISPLAY_NAME$B]:DIR_NAME$B,[DISPLAY_NAME$13]:DIR_NAME$13,[DISPLAY_NAME$W]:DIR_NAME$W,[DISPLAY_NAME$15]:DIR_NAME$15,[DISPLAY_NAME$L]:DIR_NAME$L,[DISPLAY_NAME$D]:DIR_NAME$D,[DISPLAY_NAME$E]:DIR_NAME$E,[DISPLAY_NAME$A]:DIR_NAME$A,[DISPLAY_NAME$C]:DIR_NAME$C,[DISPLAY_NAME$z]:DIR_NAME$z,[DISPLAY_NAME$G]:DIR_NAME$G,[DISPLAY_NAME$Y]:DIR_NAME$Y,[DISPLAY_NAME$P]:DIR_NAME$P,[DISPLAY_NAME$w]:DIR_NAME$w,[DISPLAY_NAME$v]:DIR_NAME$v,[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,[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,[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,[DISPLAY_NAME]:DIR_NAME};
1043
+ const destDisplayNamesToFileNamesMap={[DISPLAY_NAME$V]:DIR_NAME$V,[DISPLAY_NAME$11]:DIR_NAME$11,[DISPLAY_NAME$W]:DIR_NAME$W,[DISPLAY_NAME$_]:DIR_NAME$_,[DISPLAY_NAME$y]:DIR_NAME$y,[DISPLAY_NAME$Y]:DIR_NAME$Y,[DISPLAY_NAME$1b]:DIR_NAME$1b,[DISPLAY_NAME$U]:DIR_NAME$U,[DISPLAY_NAME$T]:DIR_NAME$T,[DISPLAY_NAME$S]:DIR_NAME$S,[DISPLAY_NAME$15]:DIR_NAME$15,[DISPLAY_NAME$19]:DIR_NAME$19,[DISPLAY_NAME$17]:DIR_NAME$17,[DISPLAY_NAME$13]:DIR_NAME$13,[DISPLAY_NAME$O]:DIR_NAME$O,[DISPLAY_NAME$K]:DIR_NAME$K,[DISPLAY_NAME$1a]:DIR_NAME$1a,[DISPLAY_NAME$12]:DIR_NAME$12,[DISPLAY_NAME$z]:DIR_NAME$z,[DISPLAY_NAME$10]:DIR_NAME$10,[DISPLAY_NAME$$]:DIR_NAME$$,[DISPLAY_NAME$L]:DIR_NAME$L,[DISPLAY_NAME$1e]:DIR_NAME$1e,[DISPLAY_NAME$J]:DIR_NAME$J,[DISPLAY_NAME$N]:DIR_NAME$N,[DISPLAY_NAME$1d]:DIR_NAME$1d,[DISPLAY_NAME$G]:DIR_NAME$G,[DISPLAY_NAME$R]:DIR_NAME$R,[DISPLAY_NAME$18]:DIR_NAME$18,[DISPLAY_NAME$1c]:DIR_NAME$1c,[DISPLAY_NAME$I]:DIR_NAME$I,[DISPLAY_NAME$1f]:DIR_NAME$1f,[DISPLAY_NAME$P]:DIR_NAME$P,[DISPLAY_NAME$C]:DIR_NAME$C,[DISPLAY_NAME$14]:DIR_NAME$14,[DISPLAY_NAME$X]:DIR_NAME$X,[DISPLAY_NAME$16]:DIR_NAME$16,[DISPLAY_NAME$M]:DIR_NAME$M,[DISPLAY_NAME$E]:DIR_NAME$E,[DISPLAY_NAME$F]:DIR_NAME$F,[DISPLAY_NAME$B]:DIR_NAME$B,[DISPLAY_NAME$D]:DIR_NAME$D,[DISPLAY_NAME$A]:DIR_NAME$A,[DISPLAY_NAME$H]:DIR_NAME$H,[DISPLAY_NAME$Z]:DIR_NAME$Z,[DISPLAY_NAME$Q]:DIR_NAME$Q,[DISPLAY_NAME$x]:DIR_NAME$x,[DISPLAY_NAME$w]:DIR_NAME$w,[DISPLAY_NAME$v]:DIR_NAME$v,[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,[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,[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,[DISPLAY_NAME]:DIR_NAME};
1042
1044
 
1043
1045
  const isDestIntgConfigTruthy=destIntgConfig=>!isUndefined(destIntgConfig)&&Boolean(destIntgConfig)===true;const isDestIntgConfigFalsy=destIntgConfig=>!isUndefined(destIntgConfig)&&Boolean(destIntgConfig)===false;/**
1044
1046
  * Filters the destinations that should not be loaded or forwarded events to based on the integration options (load or events API)
@@ -1071,7 +1073,7 @@
1071
1073
  if(isHybridModeDestination(initializedDestination)){state.nativeDestinations.integrationsConfig.value=getCumulativeIntegrationsConfig(initializedDestination,state.nativeDestinations.integrationsConfig.value,errorHandler);}state.nativeDestinations.initializedDestinations.value=[...state.nativeDestinations.initializedDestinations.value,initializedDestination];}).catch(err=>{state.nativeDestinations.failedDestinations.value=[...state.nativeDestinations.failedDestinations.value,dest];// The error message is already formatted in the isDestinationReady function
1072
1074
  logger?.error(err);});}catch(err){state.nativeDestinations.failedDestinations.value=[...state.nativeDestinations.failedDestinations.value,dest];errorHandler?.onError(err,DEVICE_MODE_DESTINATIONS_PLUGIN,DESTINATION_INIT_ERROR(dest.userFriendlyId));}};
1073
1075
 
1074
- const pluginName$b='DeviceModeDestinations';const DeviceModeDestinations=()=>({name:pluginName$b,initialize:state=>{state.plugins.loadedPlugins.value=[...state.plugins.loadedPlugins.value,pluginName$b];},nativeDestinations:{setActiveDestinations(state,pluginsManager,errorHandler,logger){state.nativeDestinations.loadIntegration.value=state.loadOptions.value.loadIntegration;// Filter destination that doesn't have mapping config-->Integration names
1076
+ const pluginName$c='DeviceModeDestinations';const DeviceModeDestinations=()=>({name:pluginName$c,initialize:state=>{state.plugins.loadedPlugins.value=[...state.plugins.loadedPlugins.value,pluginName$c];},nativeDestinations:{setActiveDestinations(state,pluginsManager,errorHandler,logger){state.nativeDestinations.loadIntegration.value=state.loadOptions.value.loadIntegration;// Filter destination that doesn't have mapping config-->Integration names
1075
1077
  const configSupportedDestinations=state.nativeDestinations.configuredDestinations.value.filter(configDest=>{if(destDisplayNamesToFileNamesMap[configDest.displayName]){return true;}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
1076
1078
  const destinationsToLoad=filterDestinations(state.consents.postConsent.value?.integrations??state.nativeDestinations.loadOnlyIntegrations.value,configSupportedDestinations);const consentedDestinations=destinationsToLoad.filter(dest=>// if consent manager is not configured, then default to load the destination
1077
1079
  pluginsManager.invokeSingle(`consentManager.isDestinationConsented`,state,dest.config,errorHandler,logger)??true);state.nativeDestinations.activeDestinations.value=consentedDestinations;},load(state,externalSrcLoader,errorHandler,logger,externalScriptOnLoad){const integrationsCDNPath=state.lifecycle.integrationsCDNPath.value;const activeDestinations=state.nativeDestinations.activeDestinations.value;activeDestinations.forEach(dest=>{const sdkName=destDisplayNamesToFileNamesMap[dest.displayName];const destSDKIdentifier=`${sdkName}_RS`;// this is the name of the object loaded on the window
@@ -1089,7 +1091,7 @@
1089
1091
  */const createPayload=(event,destinationIds,token)=>{const orderNo=Date.now();const payload={metadata:{'Custom-Authorization':token},batch:[{orderNo,destinationIds,event}]};return payload;};const sendTransformedEventToDestinations=(state,pluginsManager,destinationIds,result,status,event,errorHandler,logger)=>{const NATIVE_DEST_EXT_POINT='destinationsEventsQueue.enqueueEventToDestination';const ACTION_TO_SEND_UNTRANSFORMED_EVENT='Sending untransformed event';const ACTION_TO_DROP_EVENT='Dropping the event';const destinations=state.nativeDestinations.initializedDestinations.value.filter(d=>d&&destinationIds.includes(d.id));destinations.forEach(dest=>{try{const eventsToSend=[];switch(status){case 200:{const response=JSON.parse(result);const destTransformedResult=response.transformedBatch.find(e=>e.id===dest.id);destTransformedResult?.payload.forEach(tEvent=>{if(tEvent.status==='200'){eventsToSend.push(tEvent.event);}else {let reason='Unknown';if(tEvent.status==='410'){reason='Transformation is not available';}let action=ACTION_TO_DROP_EVENT;if(dest.propagateEventsUntransformedOnError===true){action=ACTION_TO_SEND_UNTRANSFORMED_EVENT;eventsToSend.push(event);logger?.warn(DMT_TRANSFORMATION_UNSUCCESSFUL_ERROR(DMT_PLUGIN,dest.displayName,reason,action));}else {logger?.error(DMT_TRANSFORMATION_UNSUCCESSFUL_ERROR(DMT_PLUGIN,dest.displayName,reason,action));}}});break;}// Transformation server access denied
1090
1092
  case 404:{logger?.warn(DMT_SERVER_ACCESS_DENIED_WARNING(DMT_PLUGIN));eventsToSend.push(event);break;}default:{if(dest.propagateEventsUntransformedOnError===true){logger?.warn(DMT_REQUEST_FAILED_ERROR(DMT_PLUGIN,dest.displayName,status,ACTION_TO_SEND_UNTRANSFORMED_EVENT));eventsToSend.push(event);}else {logger?.error(DMT_REQUEST_FAILED_ERROR(DMT_PLUGIN,dest.displayName,status,ACTION_TO_DROP_EVENT));}break;}}eventsToSend?.forEach(tEvent=>{if(isNonEmptyObject(tEvent)){pluginsManager.invokeSingle(NATIVE_DEST_EXT_POINT,state,tEvent,dest,errorHandler,logger);}});}catch(e){errorHandler?.onError(e,DMT_PLUGIN,DMT_EXCEPTION(dest.displayName));}});};
1091
1093
 
1092
- const pluginName$a='DeviceModeTransformation';const DeviceModeTransformation=()=>({name:pluginName$a,deps:[],initialize:state=>{state.plugins.loadedPlugins.value=[...state.plugins.loadedPlugins.value,pluginName$a];},transformEvent:{init(state,pluginsManager,httpClient,storeManager,errorHandler,logger){const writeKey=state.lifecycle.writeKey.value;httpClient.setAuthHeader(writeKey);const eventsQueue=new RetryQueue(// adding write key to the queue name to avoid conflicts
1094
+ const pluginName$b='DeviceModeTransformation';const DeviceModeTransformation=()=>({name:pluginName$b,deps:[],initialize:state=>{state.plugins.loadedPlugins.value=[...state.plugins.loadedPlugins.value,pluginName$b];},transformEvent:{init(state,pluginsManager,httpClient,storeManager,errorHandler,logger){const writeKey=state.lifecycle.writeKey.value;httpClient.setAuthHeader(writeKey);const eventsQueue=new RetryQueue(// adding write key to the queue name to avoid conflicts
1093
1095
  `${QUEUE_NAME$2}_${writeKey}` ,DEFAULT_TRANSFORMATION_QUEUE_OPTIONS,(item,done,attemptNumber,maxRetryAttempts)=>{const payload=createPayload(item.event,item.destinationIds,item.token);httpClient.getAsyncData({url:`${state.lifecycle.activeDataplaneUrl.value}/transform`,options:{method:'POST',data:getDMTDeliveryPayload(payload),sendRawData:true},isRawResponse:true,timeout:REQUEST_TIMEOUT_MS$2,callback:(result,details)=>{// null means item will not be requeued
1094
1096
  const queueErrResp=isErrRetryable(details)?details:null;if(!queueErrResp||attemptNumber===maxRetryAttempts){sendTransformedEventToDestinations(state,pluginsManager,item.destinationIds,result,details?.xhr?.status,item.event,errorHandler,logger);}done(queueErrResp,result);}});},storeManager,MEMORY_STORAGE);return eventsQueue;},enqueue(state,eventsQueue,event,destinations){const destinationIds=destinations.map(d=>d.id);eventsQueue.addItem({event,destinationIds,token:state.session.authToken.value});}}});
1095
1097
 
@@ -1165,7 +1167,7 @@
1165
1167
 
1166
1168
  const INVALID_SOURCE_CONFIG_ERROR=`Invalid source configuration or source id.`;
1167
1169
 
1168
- const pluginName$9='ErrorReporting';const ErrorReporting=()=>({name:pluginName$9,deps:[],initialize:state=>{state.plugins.loadedPlugins.value=[...state.plugins.loadedPlugins.value,pluginName$9];state.reporting.isErrorReportingPluginLoaded.value=true;if(state.reporting.breadcrumbs?.value){state.reporting.breadcrumbs.value=[createNewBreadcrumb('Error Reporting Plugin Loaded')];}},errorReporting:{// This extension point is deprecated
1170
+ const pluginName$a='ErrorReporting';const ErrorReporting=()=>({name:pluginName$a,deps:[],initialize:state=>{state.plugins.loadedPlugins.value=[...state.plugins.loadedPlugins.value,pluginName$a];state.reporting.isErrorReportingPluginLoaded.value=true;if(state.reporting.breadcrumbs?.value){state.reporting.breadcrumbs.value=[createNewBreadcrumb('Error Reporting Plugin Loaded')];}},errorReporting:{// This extension point is deprecated
1169
1171
  // TODO: Remove this in the next major release
1170
1172
  init:(state,pluginEngine,externalSrcLoader,logger,isInvokedFromLatestCore)=>{if(isInvokedFromLatestCore){return undefined;}if(!state.source.value?.config||!state.source.value?.id){return Promise.reject(new Error(INVALID_SOURCE_CONFIG_ERROR));}return pluginEngine.invokeSingle('errorReportingProvider.init',state,externalSrcLoader,logger);},notify:(pluginEngine,client,error,state,logger,httpClient,errorState)=>{if(httpClient){const{component,normalizedError}=getConfigForPayloadCreation(error,errorState?.severityReason.type);// Generate the error payload
1171
1173
  const errorPayload=ErrorFormat.create(normalizedError,component,logger);if(!errorPayload||!isAllowedToBeNotified(errorPayload.errors[0])){return;}// filter errors
@@ -1182,7 +1184,7 @@
1182
1184
  */const lsEngine=getStorageEngine(LOCAL_STORAGE);if(lsEngine?.isEnabled){anonymousId=lsEngine.getItem(externallyLoadedSessionStorageKeys.segment);}// If anonymousId is not present in local storage and find it in cookies
1183
1185
  const csEngine=getStorageEngine(COOKIE_STORAGE);if(!anonymousId&&csEngine?.isEnabled){anonymousId=csEngine.getItem(externallyLoadedSessionStorageKeys.segment);}return anonymousId;};
1184
1186
 
1185
- const pluginName$8='ExternalAnonymousId';const ExternalAnonymousId=()=>({name:pluginName$8,initialize:state=>{state.plugins.loadedPlugins.value=[...state.plugins.loadedPlugins.value,pluginName$8];},storage:{getAnonymousId(getStorageEngine,options){let anonymousId;if(options?.autoCapture?.enabled&&options.autoCapture.source){const source=options.autoCapture.source.toLowerCase();if(!Object.keys(externallyLoadedSessionStorageKeys).includes(source)){return anonymousId;}// eslint-disable-next-line sonarjs/no-small-switch
1187
+ const pluginName$9='ExternalAnonymousId';const ExternalAnonymousId=()=>({name:pluginName$9,initialize:state=>{state.plugins.loadedPlugins.value=[...state.plugins.loadedPlugins.value,pluginName$9];},storage:{getAnonymousId(getStorageEngine,options){let anonymousId;if(options?.autoCapture?.enabled&&options.autoCapture.source){const source=options.autoCapture.source.toLowerCase();if(!Object.keys(externallyLoadedSessionStorageKeys).includes(source)){return anonymousId;}// eslint-disable-next-line sonarjs/no-small-switch
1186
1188
  switch(source){case'segment':anonymousId=getSegmentAnonymousId(getStorageEngine);break;}}return anonymousId;}}});
1187
1189
 
1188
1190
  const AMP_LINKER_ANONYMOUS_ID_KEY='rs_amp_id';
@@ -1273,7 +1275,42 @@
1273
1275
  * @return {?Object<string, string>}
1274
1276
  */const parseLinker=value=>{const linkerObj=parseLinkerParamValue(value);if(!linkerObj){return null;}const{checksum,serializedIds}=linkerObj;if(!serializedIds||!checksum||!isCheckSumValid(serializedIds,checksum)){return null;}return deserialize(serializedIds);};
1275
1277
 
1276
- const pluginName$7='GoogleLinker';const GoogleLinker=()=>({name:pluginName$7,initialize:state=>{state.plugins.loadedPlugins.value=[...state.plugins.loadedPlugins.value,pluginName$7];},userSession:{anonymousIdGoogleLinker(rudderAmpLinkerParam){if(!rudderAmpLinkerParam){return null;}const parsedAnonymousIdObj=rudderAmpLinkerParam?parseLinker(rudderAmpLinkerParam):null;return parsedAnonymousIdObj?parsedAnonymousIdObj[AMP_LINKER_ANONYMOUS_ID_KEY]:null;}}});
1278
+ const pluginName$8='GoogleLinker';const GoogleLinker=()=>({name:pluginName$8,initialize:state=>{state.plugins.loadedPlugins.value=[...state.plugins.loadedPlugins.value,pluginName$8];},userSession:{anonymousIdGoogleLinker(rudderAmpLinkerParam){if(!rudderAmpLinkerParam){return null;}const parsedAnonymousIdObj=rudderAmpLinkerParam?parseLinker(rudderAmpLinkerParam):null;return parsedAnonymousIdObj?parsedAnonymousIdObj[AMP_LINKER_ANONYMOUS_ID_KEY]:null;}}});
1279
+
1280
+ const IUBENDA_CONSENT_COOKIE_READ_ERROR=context=>`${context}${LOG_CONTEXT_SEPARATOR}Failed to read the consent cookie.`;const IUBENDA_CONSENT_COOKIE_PARSE_ERROR=context=>`${context}${LOG_CONTEXT_SEPARATOR}Failed to parse the consent cookie.`;const DESTINATION_CONSENT_STATUS_ERROR$2=`Failed to determine the consent status for the destination. Please check the destination configuration and try again.`;
1281
+
1282
+ const IUBENDA_CONSENT_MANAGER_PLUGIN='IubendaConsentManagerPlugin';const IUBENDA_CONSENT_COOKIE_NAME_PATTERN=/^_iub_cs-\d+$/;
1283
+
1284
+ const getIubendaCookieName=logger=>{try{// Retrieve cookies as a string and split them into an array
1285
+ const cookies=document.cookie.split('; ');// Find the cookie that matches the iubenda cookie pattern
1286
+ const matchedCookie=cookies.find(cookie=>{const[name]=cookie.split('=');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
1287
+ const[name]=matchedCookie.split('=');return name||'';}catch(err){logger?.error(IUBENDA_CONSENT_COOKIE_READ_ERROR(IUBENDA_CONSENT_MANAGER_PLUGIN),err);return '';}};/**
1288
+ * Gets the consent data from the Iubenda's consent cookie
1289
+ * @param storeManager Store manager instance
1290
+ * @param logger Logger instance
1291
+ * @returns Consent data from the consent cookie
1292
+ */const getIubendaConsentData=(storeManager,logger)=>{let rawConsentCookieData=null;try{const dataStore=storeManager?.setStore({id:IUBENDA_CONSENT_MANAGER_PLUGIN,name:IUBENDA_CONSENT_MANAGER_PLUGIN,type:COOKIE_STORAGE});rawConsentCookieData=dataStore?.engine.getItem(getIubendaCookieName(logger));}catch(err){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
1293
+ let consentCookieData;try{consentCookieData=JSON.parse(decodeURIComponent(rawConsentCookieData));}catch(err){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
1294
+ const consentPurposes=consentCookieData.purposes;return consentPurposes;};/**
1295
+ * Gets the consent data in the format expected by the application state
1296
+ * @param iubendaConsentData Consent data derived from the consent cookie
1297
+ * @returns Consent data
1298
+ */const getConsentData$1=iubendaConsentData=>{const allowedConsentIds=[];const deniedConsentIds=[];if(iubendaConsentData){Object.entries(iubendaConsentData).forEach(e=>{const purposeId=e[0];const isConsented=e[1];if(isConsented){allowedConsentIds.push(purposeId);}else {deniedConsentIds.push(purposeId);}});}return {allowedConsentIds,deniedConsentIds};};const updateConsentStateFromData$1=(state,iubendaConsentData)=>{const consentData=getConsentData$1(iubendaConsentData);state.consents.initialized.value=isDefined(iubendaConsentData);state.consents.data.value=consentData;};
1299
+
1300
+ const pluginName$7='IubendaConsentManager';const IubendaConsentManager=()=>({name:pluginName$7,deps:[],initialize:state=>{state.plugins.loadedPlugins.value=[...state.plugins.loadedPlugins.value,pluginName$7];},consentManager:{init(state,logger){// getIubendaUserConsentedPurposes returns current iubenda opted-in purposes
1301
+ // This will be helpful for debugging
1302
+ globalThis.getIubendaUserConsentedPurposes=()=>state.consents.data.value.allowedConsentIds?.slice();// getIubendaUserDeniedPurposes returns current Iubenda opted-out purposes
1303
+ // This will be helpful for debugging
1304
+ globalThis.getIubendaUserDeniedPurposes=()=>state.consents.data.value.deniedConsentIds?.slice();// updateIubendaConsent callback function to update current consent purpose state
1305
+ globalThis.updateIubendaConsent=iubendaConsentData=>{updateConsentStateFromData$1(state,iubendaConsentData);};},updateConsentsInfo(state,storeManager,logger){// retrieve consent data and update the state
1306
+ let iubendaConsentData;// From window
1307
+ if(!isUndefined(globalThis._iub.cs.consent.purposes)){iubendaConsentData=globalThis._iub.cs.consent.purposes;// From cookie
1308
+ }else {iubendaConsentData=getIubendaConsentData(storeManager,logger);}updateConsentStateFromData$1(state,iubendaConsentData);},isDestinationConsented(state,destConfig,errorHandler,logger){if(!state.consents.initialized.value){return true;}const allowedConsentIds=state.consents.data.value.allowedConsentIds;const matchPredicate=consent=>allowedConsentIds.includes(consent);try{const{consentManagement}=destConfig;// If the destination does not have consent management config, events should be sent.
1309
+ if(consentManagement){// Get the corresponding consents for the destination
1310
+ const cmpConfig=consentManagement.find(c=>c.provider===state.consents.provider.value);// If there are no consents configured for the destination for the current provider, events should be sent.
1311
+ if(!cmpConfig?.consents){return true;}const configuredConsents=cmpConfig.consents.map(c=>c.consent.trim()).filter(n=>n);const resolutionStrategy=cmpConfig.resolutionStrategy??state.consents.resolutionStrategy.value;// match the configured consents with user provided consents as per
1312
+ // the configured resolution strategy
1313
+ switch(resolutionStrategy){case'or':return configuredConsents.some(matchPredicate)||configuredConsents.length===0;case'and':default:return configuredConsents.every(matchPredicate);}}return true;}catch(err){errorHandler?.onError(err,IUBENDA_CONSENT_MANAGER_PLUGIN,DESTINATION_CONSENT_STATUS_ERROR$2);return true;}}}});
1277
1314
 
1278
1315
  const KETCH_CONSENT_COOKIE_READ_ERROR=context=>`${context}${LOG_CONTEXT_SEPARATOR}Failed to read the consent cookie.`;const KETCH_CONSENT_COOKIE_PARSE_ERROR=context=>`${context}${LOG_CONTEXT_SEPARATOR}Failed to parse the consent cookie.`;const DESTINATION_CONSENT_STATUS_ERROR$1=`Failed to determine the consent status for the destination. Please check the destination configuration and try again.`;
1279
1316
 
@@ -2398,7 +2435,7 @@
2398
2435
 
2399
2436
  /**
2400
2437
  * Map plugin names to direct code imports from plugins package
2401
- */const getBundledBuildPluginImports=()=>({BeaconQueue,Bugsnag,CustomConsentManager,DeviceModeDestinations,DeviceModeTransformation,ErrorReporting,ExternalAnonymousId,GoogleLinker,KetchConsentManager,NativeDestinationQueue,OneTrustConsentManager,StorageEncryption,StorageEncryptionLegacy,StorageMigrator,XhrQueue});
2438
+ */const getBundledBuildPluginImports=()=>({BeaconQueue,Bugsnag,CustomConsentManager,DeviceModeDestinations,DeviceModeTransformation,ErrorReporting,ExternalAnonymousId,GoogleLinker,IubendaConsentManager,KetchConsentManager,NativeDestinationQueue,OneTrustConsentManager,StorageEncryption,StorageEncryptionLegacy,StorageMigrator,XhrQueue});
2402
2439
 
2403
2440
  /**
2404
2441
  * Map of mandatory plugin names and direct imports
@@ -2734,22 +2771,22 @@
2734
2771
  * Updates the reporting state variables from the source config data
2735
2772
  * @param res Source config
2736
2773
  * @param logger Logger instance
2737
- */const updateReportingState=res=>{state.reporting.isErrorReportingEnabled.value=isErrorReportingEnabled(res.source.config)&&!isSDKRunningInChromeExtension();state.reporting.isMetricsReportingEnabled.value=isMetricsReportingEnabled(res.source.config);};const updateStorageStateFromLoadOptions=logger=>{const{useServerSideCookies,dataServiceEndpoint,storage:storageOptsFromLoad,setCookieDomain,sameDomainCookiesOnly}=state.loadOptions.value;let storageType=storageOptsFromLoad?.type;if(isDefined(storageType)&&!isValidStorageType(storageType)){logger?.warn(STORAGE_TYPE_VALIDATION_WARNING(CONFIG_MANAGER,storageType,DEFAULT_STORAGE_TYPE));storageType=DEFAULT_STORAGE_TYPE;}let storageEncryptionVersion=storageOptsFromLoad?.encryption?.version;const encryptionPluginName=storageEncryptionVersion&&StorageEncryptionVersionsToPluginNameMap[storageEncryptionVersion];if(!isUndefined(storageEncryptionVersion)&&isUndefined(encryptionPluginName)){// set the default encryption plugin
2738
- 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
2739
- const configuredMigrationValue=storageOptsFromLoad?.migrate;const finalMigrationVal=configuredMigrationValue&&storageEncryptionVersion===DEFAULT_STORAGE_ENCRYPTION_VERSION;if(configuredMigrationValue===true&&finalMigrationVal!==configuredMigrationValue){logger?.warn(STORAGE_DATA_MIGRATION_OVERRIDE_WARNING(CONFIG_MANAGER,storageEncryptionVersion,DEFAULT_STORAGE_ENCRYPTION_VERSION));}r(()=>{state.storage.type.value=storageType;let cookieOptions=storageOptsFromLoad?.cookie??{};if(useServerSideCookies){state.serverCookies.isEnabledServerSideCookies.value=useServerSideCookies;const providedCookieDomain=cookieOptions.domain??setCookieDomain;/**
2740
- * Based on the following conditions, we decide whether to use the exact domain or not to determine the data service URL:
2741
- * 1. If the cookie domain is provided and it is not a top-level domain, then use the exact domain
2742
- * 2. If the sameDomainCookiesOnly flag is set to true, then use the exact domain
2743
- */const useExactDomain=isDefined(providedCookieDomain)&&!isWebpageTopLevelDomain(removeLeadingPeriod(providedCookieDomain))||sameDomainCookiesOnly;const dataServiceUrl=getDataServiceUrl(dataServiceEndpoint??DEFAULT_DATA_SERVICE_ENDPOINT,useExactDomain??false);if(isValidURL(dataServiceUrl)){state.serverCookies.dataServiceUrl.value=removeTrailingSlashes(dataServiceUrl);const curHost=getDomain(window.location.href);const dataServiceHost=getDomain(dataServiceUrl);// If the current host is different from the data service host, then it is a cross-site request
2774
+ */const updateReportingState=res=>{state.reporting.isErrorReportingEnabled.value=isErrorReportingEnabled(res.source.config)&&!isSDKRunningInChromeExtension();state.reporting.isMetricsReportingEnabled.value=isMetricsReportingEnabled(res.source.config);};const getServerSideCookiesStateData=logger=>{const{useServerSideCookies,dataServiceEndpoint,storage:storageOptsFromLoad,setCookieDomain,sameDomainCookiesOnly}=state.loadOptions.value;let cookieOptions=storageOptsFromLoad?.cookie;let sscEnabled=false;let finalDataServiceUrl;if(useServerSideCookies){sscEnabled=useServerSideCookies;const providedCookieDomain=cookieOptions.domain??setCookieDomain;/**
2775
+ * Based on the following conditions, we decide whether to use the exact domain or not to determine the data service URL:
2776
+ * 1. If the cookie domain is provided and it is not a top-level domain, then use the exact domain
2777
+ * 2. If the sameDomainCookiesOnly flag is set to true, then use the exact domain
2778
+ */const useExactDomain=isDefined(providedCookieDomain)&&!isWebpageTopLevelDomain(removeLeadingPeriod(providedCookieDomain))||sameDomainCookiesOnly;const dataServiceUrl=getDataServiceUrl(dataServiceEndpoint??DEFAULT_DATA_SERVICE_ENDPOINT,useExactDomain);if(isValidURL(dataServiceUrl)){finalDataServiceUrl=removeTrailingSlashes(dataServiceUrl);const curHost=getDomain(window.location.href);const dataServiceHost=getDomain(dataServiceUrl);// If the current host is different from the data service host, then it is a cross-site request
2744
2779
  // For server-side cookies to work, we need to set the SameSite=None and Secure attributes
2745
2780
  // One round of cookie options manipulation is taking place here
2746
2781
  // Based on these(setCookieDomain/storage.cookie or sameDomainCookiesOnly) two load-options, final cookie options are set in the storage module
2747
2782
  // TODO: Refactor the cookie options manipulation logic in one place
2748
2783
  if(curHost!==dataServiceHost){cookieOptions={...cookieOptions,samesite:'None',secure:true};}/**
2749
- * If the sameDomainCookiesOnly flag is not set and the cookie domain is provided(not top level domain),
2750
- * and the data service host is different from the provided cookie domain, then we disable server-side cookies
2751
- * ex: provided cookie domain: 'random.com', data service host: 'sub.example.com'
2752
- */if(!sameDomainCookiesOnly&&useExactDomain&&dataServiceHost!==removeLeadingPeriod(providedCookieDomain)){state.serverCookies.isEnabledServerSideCookies.value=false;logger?.warn(SERVER_SIDE_COOKIE_FEATURE_OVERRIDE_WARNING(CONFIG_MANAGER,providedCookieDomain,dataServiceHost));}}else {state.serverCookies.isEnabledServerSideCookies.value=false;}}state.storage.cookie.value=cookieOptions;state.storage.encryptionPluginName.value=StorageEncryptionVersionsToPluginNameMap[storageEncryptionVersion];state.storage.migrate.value=finalMigrationVal;});};const updateConsentsStateFromLoadOptions=logger=>{const{provider,consentManagerPluginName,initialized,enabled,consentsData}=getConsentManagementData(state.loadOptions.value.consentManagement,logger);// Pre-consent
2784
+ * If the sameDomainCookiesOnly flag is not set and the cookie domain is provided(not top level domain),
2785
+ * and the data service host is different from the provided cookie domain, then we disable server-side cookies
2786
+ * ex: provided cookie domain: 'random.com', data service host: 'sub.example.com'
2787
+ */if(!sameDomainCookiesOnly&&useExactDomain&&dataServiceHost!==removeLeadingPeriod(providedCookieDomain)){sscEnabled=false;logger?.warn(SERVER_SIDE_COOKIE_FEATURE_OVERRIDE_WARNING(CONFIG_MANAGER,providedCookieDomain,dataServiceHost));}}else {sscEnabled=false;}}return {sscEnabled,cookieOptions,finalDataServiceUrl};};const updateStorageStateFromLoadOptions=logger=>{const{storage:storageOptsFromLoad}=state.loadOptions.value;let storageType=storageOptsFromLoad?.type;if(isDefined(storageType)&&!isValidStorageType(storageType)){logger?.warn(STORAGE_TYPE_VALIDATION_WARNING(CONFIG_MANAGER,storageType,DEFAULT_STORAGE_TYPE));storageType=DEFAULT_STORAGE_TYPE;}let storageEncryptionVersion=storageOptsFromLoad?.encryption?.version;const encryptionPluginName=storageEncryptionVersion&&StorageEncryptionVersionsToPluginNameMap[storageEncryptionVersion];if(!isUndefined(storageEncryptionVersion)&&isUndefined(encryptionPluginName)){// set the default encryption plugin
2788
+ 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
2789
+ const configuredMigrationValue=storageOptsFromLoad?.migrate;const finalMigrationVal=configuredMigrationValue&&storageEncryptionVersion===DEFAULT_STORAGE_ENCRYPTION_VERSION;if(configuredMigrationValue===true&&finalMigrationVal!==configuredMigrationValue){logger?.warn(STORAGE_DATA_MIGRATION_OVERRIDE_WARNING(CONFIG_MANAGER,storageEncryptionVersion,DEFAULT_STORAGE_ENCRYPTION_VERSION));}const{sscEnabled,finalDataServiceUrl,cookieOptions}=getServerSideCookiesStateData(logger);r(()=>{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;});};const updateConsentsStateFromLoadOptions=logger=>{const{provider,consentManagerPluginName,initialized,enabled,consentsData}=getConsentManagementData(state.loadOptions.value.consentManagement,logger);// Pre-consent
2753
2790
  const preConsentOpts=state.loadOptions.value.preConsent;let storageStrategy=preConsentOpts?.storage?.strategy??DEFAULT_PRE_CONSENT_STORAGE_STRATEGY;const StorageStrategies=['none','session','anonymousId'];if(isDefined(storageStrategy)&&!StorageStrategies.includes(storageStrategy)){storageStrategy=DEFAULT_PRE_CONSENT_STORAGE_STRATEGY;logger?.warn(UNSUPPORTED_PRE_CONSENT_STORAGE_STRATEGY(CONFIG_MANAGER,preConsentOpts?.storage?.strategy,DEFAULT_PRE_CONSENT_STORAGE_STRATEGY));}let eventsDeliveryType=preConsentOpts?.events?.delivery??DEFAULT_PRE_CONSENT_EVENTS_DELIVERY_TYPE;const deliveryTypes=['immediate','buffer'];if(isDefined(eventsDeliveryType)&&!deliveryTypes.includes(eventsDeliveryType)){eventsDeliveryType=DEFAULT_PRE_CONSENT_EVENTS_DELIVERY_TYPE;logger?.warn(UNSUPPORTED_PRE_CONSENT_EVENTS_DELIVERY_TYPE(CONFIG_MANAGER,preConsentOpts?.events?.delivery,DEFAULT_PRE_CONSENT_EVENTS_DELIVERY_TYPE));}r(()=>{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
2754
2791
  // if it is not already initialized and
2755
2792
  // if consent management is enabled
@@ -3147,10 +3184,10 @@
3147
3184
 
3148
3185
  /**
3149
3186
  * Plugins to be loaded in the plugins loadOption is not defined
3150
- */const defaultOptionalPluginsList=['BeaconQueue','Bugsnag','CustomConsentManager','DeviceModeDestinations','DeviceModeTransformation','ErrorReporting','ExternalAnonymousId','GoogleLinker','KetchConsentManager','NativeDestinationQueue','OneTrustConsentManager','StorageEncryption','StorageEncryptionLegacy','StorageMigrator','XhrQueue'];
3187
+ */const defaultOptionalPluginsList=['BeaconQueue','Bugsnag','CustomConsentManager','DeviceModeDestinations','DeviceModeTransformation','ErrorReporting','ExternalAnonymousId','GoogleLinker','IubendaConsentManager','KetchConsentManager','NativeDestinationQueue','OneTrustConsentManager','StorageEncryption','StorageEncryptionLegacy','StorageMigrator','XhrQueue'];
3151
3188
 
3152
3189
  const normalizeLoadOptions=(loadOptionsFromState,loadOptions)=>{// TODO: Maybe add warnings for invalid values
3153
- const normalizedLoadOpts=clone(loadOptions);if(!isString(normalizedLoadOpts.setCookieDomain)){delete normalizedLoadOpts.setCookieDomain;}const cookieSameSiteValues=['Strict','Lax','None'];if(!cookieSameSiteValues.includes(normalizedLoadOpts.sameSiteCookie)){delete normalizedLoadOpts.sameSiteCookie;}normalizedLoadOpts.secureCookie=normalizedLoadOpts.secureCookie===true;const uaChTrackLevels=['none','default','full'];if(!uaChTrackLevels.includes(normalizedLoadOpts.uaChTrackLevel)){delete normalizedLoadOpts.uaChTrackLevel;}if(!isNonEmptyObject(normalizedLoadOpts.integrations)){delete normalizedLoadOpts.integrations;}normalizedLoadOpts.plugins=normalizedLoadOpts.plugins??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 {normalizedLoadOpts.storage=removeUndefinedAndNullValues(normalizedLoadOpts.storage);normalizedLoadOpts.storage.migrate=normalizedLoadOpts.storage?.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.storage?.cookie)){delete normalizedLoadOpts.storage?.cookie;}else {normalizedLoadOpts.storage.cookie=removeUndefinedAndNullValues(normalizedLoadOpts.storage?.cookie);}if(!isObjectLiteralAndNotNull(normalizedLoadOpts.preConsent)){delete normalizedLoadOpts.preConsent;}else {normalizedLoadOpts.preConsent=removeUndefinedAndNullValues(normalizedLoadOpts.preConsent);}const mergedLoadOptions=mergeDeepRight(loadOptionsFromState,normalizedLoadOpts);return mergedLoadOptions;};
3190
+ const normalizedLoadOpts=clone(loadOptions);if(!isString(normalizedLoadOpts.setCookieDomain)){delete normalizedLoadOpts.setCookieDomain;}const cookieSameSiteValues=['Strict','Lax','None'];if(!cookieSameSiteValues.includes(normalizedLoadOpts.sameSiteCookie)){delete normalizedLoadOpts.sameSiteCookie;}normalizedLoadOpts.secureCookie=normalizedLoadOpts.secureCookie===true;normalizedLoadOpts.sameDomainCookiesOnly=normalizedLoadOpts.sameDomainCookiesOnly===true;const uaChTrackLevels=['none','default','full'];if(!uaChTrackLevels.includes(normalizedLoadOpts.uaChTrackLevel)){delete normalizedLoadOpts.uaChTrackLevel;}if(!isNonEmptyObject(normalizedLoadOpts.integrations)){delete normalizedLoadOpts.integrations;}normalizedLoadOpts.plugins=normalizedLoadOpts.plugins??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 {normalizedLoadOpts.storage=removeUndefinedAndNullValues(normalizedLoadOpts.storage);normalizedLoadOpts.storage.migrate=normalizedLoadOpts.storage?.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.storage?.cookie)){delete normalizedLoadOpts.storage?.cookie;}else {normalizedLoadOpts.storage.cookie=removeUndefinedAndNullValues(normalizedLoadOpts.storage?.cookie);}if(!isObjectLiteralAndNotNull(normalizedLoadOpts.preConsent)){delete normalizedLoadOpts.preConsent;}else {normalizedLoadOpts.preConsent=removeUndefinedAndNullValues(normalizedLoadOpts.preConsent);}const mergedLoadOptions=mergeDeepRight(loadOptionsFromState,normalizedLoadOpts);return mergedLoadOptions;};
3154
3191
 
3155
3192
  const DATA_PLANE_QUEUE_EXT_POINT_PREFIX='dataplaneEventsQueue';const DESTINATIONS_QUEUE_EXT_POINT_PREFIX='destinationsEventsQueue';const DMT_EXT_POINT_PREFIX='transformEvent';
3156
3193