diff --git a/dist/dil.js b/dist/dil.js index 66ce048..1857fc3 100644 --- a/dist/dil.js +++ b/dist/dil.js @@ -1 +1 @@ -!function(){"use strict";function e(e,t,s){var n="",i=t||"Error caught in DIL module/submodule: ";return e===Object(e)?n=i+(e.message||"err has no message"):(n=i+"err is not a valid object",e={}),e.message=n,s instanceof DIL&&(e.partner=s.api.getPartner()),DIL.errorModule.handleError(e),this.errorMessage=n}var r,a,o,t={submitUniversalAnalytics:function(e,t,s){try{var n,i,r,a,o=e.getAll()[0],d=o[s||"b"].data.keys,u={};for(n=0,i=d.length;nthis.LIMIT));n++);this.errorMessage=1'}");if((s=e.getInstance(t,{idSyncContainerID:r}))!==Object(s)||"function"!=typeof s.isAllowed||"function"!=typeof s.getMarketingCloudVisitorID||"function"!=typeof s.getCustomerIDs||"function"!=typeof s.isOptedOut||"function"!=typeof s.publishDestinations)throw this.releaseType="invalid instance",n="Invalid Visitor instance.",s===Object(s)&&"function"!=typeof s.publishDestinations&&(n+=" In particular, visitorInstance.publishDestinations is not a function. This is needed to fire URL destinations in DIL v8.0+ and should be present in Visitor v3.3.0+ ."),new Error(n);if(this.VisitorAPI=e,!s.isAllowed())return this.releaseType="VisitorAPI is not allowed to write cookies",void this.releaseRequests();this.instance=s,this.waitForMidToReleaseRequests()}catch(e){if(!D)throw new Error("Error in processing Visitor API, which is a hard dependency for DIL v8.0+: "+e.message);this.releaseRequests()}},waitForMidToReleaseRequests:function(){var t=this;this.instance&&(this.instance.getMarketingCloudVisitorID(function(e){t.mid=e,t.releaseType="VisitorAPI",t.releaseRequests()},!0),(!N.exists||!N.isIabContext&&N.isApproved()||N.isIabContext&&G.hasGoSignal())&&setTimeout(function(){"VisitorAPI"!==t.releaseType&&(t.releaseType="timeout",t.releaseRequests())},this.getLoadTimeout()))},releaseRequests:function(){this.calledBack=!0,R.registerRequest()},getMarketingCloudVisitorID:function(){return this.instance?this.instance.getMarketingCloudVisitorID():null},getMIDQueryString:function(){var e=V.isPopulatedString,t=this.getMarketingCloudVisitorID();return e(this.mid)&&this.mid===t||(this.mid=t),e(this.mid)?"d_mid="+this.mid+"&":""},getCustomerIDs:function(){return this.instance?this.instance.getCustomerIDs():null},getCustomerIDsQueryString:function(e){if(e!==Object(e))return"";var t,s,n,i,r="",a=[],o=[];for(t in e)e.hasOwnProperty(t)&&(s=e[o[0]=t])===Object(s)&&(o[1]=s.id||"",o[2]=s.authState||0,a.push(o),o=[]);if(i=a.length)for(n=0;n 1"):void 0},getPublishDestinationsVersion:function(){if(null!==this.publishDestinationsVersion)return this.publishDestinationsVersion;var e=R.adms.instance,s=-1;return e.publishDestinations(null,null,function(e){if(e===Object(e)){var t=e.error;"subdomain is not a populated string."===t?s=1:"Invalid parameters passed."===t&&(s=2)}}),this.publishDestinationsVersion=s}},q={traits:function(e){return V.isValidPdata(e)&&(T.sids instanceof Array||(T.sids=[]),x.extendArray(T.sids,e)),this},pixels:function(e){return V.isValidPdata(e)&&(T.pdata instanceof Array||(T.pdata=[]),x.extendArray(T.pdata,e)),this},logs:function(e){return V.isValidLogdata(e)&&(T.logdata!==Object(T.logdata)&&(T.logdata={}),x.extendObject(T.logdata,e)),this},customQueryParams:function(e){return V.isEmptyObject(e)||x.extendObject(T,e,R.reservedKeys),this},signals:function(e,t){var s,n=e;if(!V.isEmptyObject(n)){if(t&&"string"==typeof t)for(s in n={},e)e.hasOwnProperty(s)&&(n[t+s]=e[s]);x.extendObject(T,n,R.reservedKeys)}return this},declaredId:function(e){return R.declaredId.setDeclaredId(e,"request"),this},result:function(e){return"function"==typeof e&&(T.callback=e),this},afterResult:function(e){return"function"==typeof e&&(T.postCallbackFn=e),this},useImageRequest:function(){return T.useImageRequest=!0,this},clearData:function(){return T={},this},submit:function(e){return T.isDefaultRequest=!!e,M.submitRequest(T),T={},this},getPartner:function(){return I},getContainerNSID:function(){return r},getEventLog:function(){return S},getState:function(){var e={},t={};return x.extendObject(e,R,{registerRequest:!0}),x.extendObject(t,k,{requestToProcess:!0,process:!0,sendMessages:!0}),{initConfig:s,pendingRequest:T,otherRequestInfo:e,destinationPublishingInfo:t,log:S}},idSync:function(){throw new Error("Please use the `idSyncByURL` method of the Experience Cloud ID Service (Visitor) instance")},aamIdSync:function(){throw new Error("Please use the `idSyncByDataSource` method of the Experience Cloud ID Service (Visitor) instance")},passData:function(e){return V.isEmptyObject(e)?"Error: json is empty or not an object":(M.defaultCallback(e),e)},getPlatformParams:function(){return R.platformParams},getEventCallConfigParams:function(){var e,t=R,s=t.modStatsParams,n=t.platformParams;if(!s){for(e in s={},n)n.hasOwnProperty(e)&&!t.nonModStatsParams[e]&&(s[e.replace(/^d_/,"")]=n[e]);!0===d?s.coop_safe=1:!1===d&&(s.coop_unsafe=1),t.modStatsParams=s}return s},setAsCoopSafe:function(){return d=!0,this},setAsCoopUnsafe:function(){return d=!1,this},getEventCallIabSignals:function(e){var t;return e!==Object(e)?"Error: config is not an object":"function"!=typeof e.callback?"Error: config.callback is not a function":(t=parseInt(e.timeout,10),isNaN(t)&&(t=null),void G.getQueryStringObject(e.callback,t))}},M={corsMetadata:(E="none","undefined"!=typeof XMLHttpRequest&&XMLHttpRequest===Object(XMLHttpRequest)&&"withCredentials"in new XMLHttpRequest&&(E="XMLHttpRequest"),{corsType:E}),getCORSInstance:function(){return"none"===this.corsMetadata.corsType?null:new window[this.corsMetadata.corsType]},submitRequest:function(e){return R.registerRequest(M.createQueuedRequest(e)),!0},createQueuedRequest:function(e){var t,s,n,i,r,a=e.callback,o="img",d=e.isDefaultRequest;if(delete e.isDefaultRequest,!V.isEmptyObject(u))for(n in u)if(u.hasOwnProperty(n)){if(null==(i=u[n])||""===i)continue;if(n in e&&!(i in e)&&!(i in R.reservedKeys)){if(null==(r=e[n])||""===r)continue;e[i]=r}}return V.isValidPdata(e.sids)||(e.sids=[]),V.isValidPdata(e.pdata)||(e.pdata=[]),V.isValidLogdata(e.logdata)||(e.logdata={}),e.logdataArray=x.convertObjectToKeyValuePairs(e.logdata,"=",!0),e.logdataArray.push("_ts="+(new Date).getTime()),"function"!=typeof a&&(a=this.defaultCallback),t=this.makeRequestSrcData(e),(s=this.getCORSInstance())&&!0!==e.useImageRequest&&(o="cors"),{tag:o,src:t.src,corsSrc:t.corsSrc,callbackFn:a,postCallbackFn:e.postCallbackFn,useImageRequest:!!e.useImageRequest,requestData:e,corsInstance:s,corsPostData:t.corsPostData,isDefaultRequest:d}},defaultCallback:function(e,t){var s,n,i,r,a,o,d,u,c;if(g&&(s=e.stuff)&&s instanceof Array&&(n=s.length))for(i=0;ithis.LIMIT));n++);this.errorMessage=1'}");if((s=e.getInstance(t,{idSyncContainerID:r}))!==Object(s)||"function"!=typeof s.isAllowed||"function"!=typeof s.getMarketingCloudVisitorID||"function"!=typeof s.getCustomerIDs||"function"!=typeof s.isOptedOut||"function"!=typeof s.publishDestinations)throw this.releaseType="invalid instance",n="Invalid Visitor instance.",s===Object(s)&&"function"!=typeof s.publishDestinations&&(n+=" In particular, visitorInstance.publishDestinations is not a function. This is needed to fire URL destinations in DIL v8.0+ and should be present in Visitor v3.3.0+ ."),new Error(n);if(this.VisitorAPI=e,!s.isAllowed())return this.releaseType="VisitorAPI is not allowed to write cookies",void this.releaseRequests();this.instance=s,this.waitForMidToReleaseRequests()}catch(e){if(!D)throw new Error("Error in processing Visitor API, which is a hard dependency for DIL v8.0+: "+e.message);this.releaseRequests()}},waitForMidToReleaseRequests:function(){var t=this;this.instance&&(this.instance.getMarketingCloudVisitorID(function(e){t.mid=e,t.releaseType="VisitorAPI",t.releaseRequests()},!0),(!N.exists||!N.isIabContext&&N.isApproved()||N.isIabContext&&G.hasGoSignal())&&setTimeout(function(){"VisitorAPI"!==t.releaseType&&(t.releaseType="timeout",t.releaseRequests())},this.getLoadTimeout()))},releaseRequests:function(){this.calledBack=!0,R.registerRequest()},getMarketingCloudVisitorID:function(){return this.instance?this.instance.getMarketingCloudVisitorID():null},getMIDQueryString:function(){var e=V.isPopulatedString,t=this.getMarketingCloudVisitorID();return e(this.mid)&&this.mid===t||(this.mid=t),e(this.mid)?"d_mid="+this.mid+"&":""},getCustomerIDs:function(){return this.instance?this.instance.getCustomerIDs():null},getCustomerIDsQueryString:function(e){if(e!==Object(e))return"";var t,s,n,i,r="",a=[],o=[];for(t in e)e.hasOwnProperty(t)&&(s=e[o[0]=t])===Object(s)&&(o[1]=s.id||"",o[2]=s.authState||0,a.push(o),o=[]);if(i=a.length)for(n=0;n 1"):void 0},getPublishDestinationsVersion:function(){if(null!==this.publishDestinationsVersion)return this.publishDestinationsVersion;var e=R.adms.instance,s=-1;return e.publishDestinations(null,null,function(e){if(e===Object(e)){var t=e.error;"subdomain is not a populated string."===t?s=1:"Invalid parameters passed."===t&&(s=2)}}),this.publishDestinationsVersion=s}},q={traits:function(e){return V.isValidPdata(e)&&(T.sids instanceof Array||(T.sids=[]),x.extendArray(T.sids,e)),this},pixels:function(e){return V.isValidPdata(e)&&(T.pdata instanceof Array||(T.pdata=[]),x.extendArray(T.pdata,e)),this},logs:function(e){return V.isValidLogdata(e)&&(T.logdata!==Object(T.logdata)&&(T.logdata={}),x.extendObject(T.logdata,e)),this},customQueryParams:function(e){return V.isEmptyObject(e)||x.extendObject(T,e,R.reservedKeys),this},signals:function(e,t){var s,n=e;if(!V.isEmptyObject(n)){if(t&&"string"==typeof t)for(s in n={},e)e.hasOwnProperty(s)&&(n[t+s]=e[s]);x.extendObject(T,n,R.reservedKeys)}return this},declaredId:function(e){return R.declaredId.setDeclaredId(e,"request"),this},result:function(e){return"function"==typeof e&&(T.callback=e),this},afterResult:function(e){return"function"==typeof e&&(T.postCallbackFn=e),this},useImageRequest:function(){return T.useImageRequest=!0,this},clearData:function(){return T={},this},submit:function(e){return T.isDefaultRequest=!!e,M.submitRequest(T),T={},this},getPartner:function(){return I},getContainerNSID:function(){return r},getEventLog:function(){return S},getState:function(){var e={},t={};return x.extendObject(e,R,{registerRequest:!0}),x.extendObject(t,k,{requestToProcess:!0,process:!0,sendMessages:!0}),{initConfig:s,pendingRequest:T,otherRequestInfo:e,destinationPublishingInfo:t,log:S}},idSync:function(){throw new Error("Please use the `idSyncByURL` method of the Experience Cloud ID Service (Visitor) instance")},aamIdSync:function(){throw new Error("Please use the `idSyncByDataSource` method of the Experience Cloud ID Service (Visitor) instance")},passData:function(e){return V.isEmptyObject(e)?"Error: json is empty or not an object":(M.defaultCallback(e),e)},getPlatformParams:function(){return R.platformParams},getEventCallConfigParams:function(){var e,t=R,s=t.modStatsParams,n=t.platformParams;if(!s){for(e in s={},n)n.hasOwnProperty(e)&&!t.nonModStatsParams[e]&&(s[e.replace(/^d_/,"")]=n[e]);!0===d?s.coop_safe=1:!1===d&&(s.coop_unsafe=1),t.modStatsParams=s}return s},setAsCoopSafe:function(){return d=!0,this},setAsCoopUnsafe:function(){return d=!1,this},getEventCallIabSignals:function(e){var t;return e!==Object(e)?"Error: config is not an object":"function"!=typeof e.callback?"Error: config.callback is not a function":(t=parseInt(e.timeout,10),isNaN(t)&&(t=null),void G.getQueryStringObject(e.callback,t))}},M={corsMetadata:(E="none","undefined"!=typeof XMLHttpRequest&&XMLHttpRequest===Object(XMLHttpRequest)&&"withCredentials"in new XMLHttpRequest&&(E="XMLHttpRequest"),{corsType:E}),getCORSInstance:function(){return"none"===this.corsMetadata.corsType?null:new window[this.corsMetadata.corsType]},submitRequest:function(e){return R.registerRequest(M.createQueuedRequest(e)),!0},createQueuedRequest:function(e){var t,s,n,i,r,a=e.callback,o="img",d=e.isDefaultRequest;if(delete e.isDefaultRequest,!V.isEmptyObject(u))for(n in u)if(u.hasOwnProperty(n)){if(null==(i=u[n])||""===i)continue;if(n in e&&!(i in e)&&!(i in R.reservedKeys)){if(null==(r=e[n])||""===r)continue;e[i]=r}}return V.isValidPdata(e.sids)||(e.sids=[]),V.isValidPdata(e.pdata)||(e.pdata=[]),V.isValidLogdata(e.logdata)||(e.logdata={}),e.logdataArray=x.convertObjectToKeyValuePairs(e.logdata,"=",!0),e.logdataArray.push("_ts="+(new Date).getTime()),"function"!=typeof a&&(a=this.defaultCallback),t=this.makeRequestSrcData(e),(s=this.getCORSInstance())&&!0!==e.useImageRequest&&(o="cors"),{tag:o,src:t.src,corsSrc:t.corsSrc,callbackFn:a,postCallbackFn:e.postCallbackFn,useImageRequest:!!e.useImageRequest,requestData:e,corsInstance:s,corsPostData:t.corsPostData,isDefaultRequest:d}},defaultCallback:function(e,t){var s,n,i,r,a,o,d,u,c;if(g&&(s=e.stuff)&&s instanceof Array&&(n=s.length))for(i=0;i