1(window.webpackJsonp=window.webpackJsonp||[]).push([[47],{1467:function(e,t,r){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}r.r(t),r.d(t,"default",(function(){return $r})),"undefined"!=typeof globalThis&&(globalThis.regeneratorRuntime=void 0);var i={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode:function(e){try{if(window.btoa&&window.atob)return window.btoa(unescape(encodeURIComponent(e)))}catch(e){console.error("Error encoding cookie values into Base64:"+e)}return this._encode(e)},_encode:function(e){var t,r,n,s,a,u,c,d="",l=0;for(e=o.encode(e);l<e.length;)s=(t=e.charCodeAt(l++))>>2,a=(3&t)<<4|(r=e.charCodeAt(l++))>>4,u=(15&r)<<2|(n=e.charCodeAt(l++))>>6,c=63&n,isNaN(r)?u=c=64:isNaN(n)&&(c=64),d=d+i._keyStr.charAt(s)+i._keyStr.charAt(a)+i._keyStr.charAt(u)+i._keyStr.charAt(c);return d},decode:function(e){try{if(window.btoa&&window.atob)return decodeURIComponent(escape(window.atob(e)))}catch(e){}return i._decode(e)},_decode:function(e){var t,r,n,s,a,u,c="",d=0;for(e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");d<e.length;)t=i._keyStr.indexOf(e.charAt(d++))<<2|(s=i._keyStr.indexOf(e.charAt(d++)))>>4,r=(15&s)<<4|(a=i._keyStr.indexOf(e.charAt(d++)))>>2,n=(3&a)<<6|(u=i._keyStr.indexOf(e.charAt(d++))),c+=String.fromCharCode(t),64!==a&&(c+=String.fromCharCode(r)),64!==u&&(c+=String.fromCharCode(n));return c=o.decode(c)}},o={encode:function(e){for(var t,r="",n=0;n<e.length;n++)128>(t=e.charCodeAt(n))?r+=String.fromCharCode(t):127<t&&2048>t?(r+=String.fromCharCode(192|t>>6),r+=String.fromCharCode(128|63&t)):(r+=String.fromCharCode(224|t>>12),r+=String.fromCharCode(128|63&t>>6),r+=String.fromCharCode(128|63&t));return r},decode:function(e){for(var t="",r=0,n=0,i=0,o=0;r<e.length;)128>(n=e.charCodeAt(r))?(t+=String.fromCharCode(n),r++):191<n&&224>n?(i=e.charCodeAt(r+1),t+=String.fromCharCode((31&n)<<6|63&i),r+=2):(i=e.charCodeAt(r+1),o=e.charCodeAt(r+2),t+=String.fromCharCode((15&n)<<12|(63&i)<<6|63&o),r+=3);return t}},s={forEach:function(e,t){var r,n;if(null==this)throw new TypeError(" this is null or not defined");var i=Object(this),o=i.length>>>0;if("function"!=typeof e)throw new TypeError(e+" is not a function");for(1<arguments.length&&(r=t),n=0;n<o;){var s;n in i&&(s=i[n],e.call(r,s,n,i)),n++}},map:function(e,t){var r,n,i;if(null===this)throw new TypeError(" this is null or not defined");var o=Object(this),s=o.length>>>0;if("function"!=typeof e)throw new TypeError(e+" is not a function");for(1<arguments.length&&(r=t),n=Array(s),i=0;i<s;){var a,u;i in o&&(a=o[i],u=e.call(r,a,i,o),n[i]=u),i++}return n},filter:function(e){if(null==this)throw new TypeError;var t=Object(this),r=t.length>>>0;if("function"!=typeof e)throw new TypeError;for(var n=[],i=2<=arguments.length?arguments[1]:void 0,o=0;o<r;o++)if(o in t){var s=t[o];e.call(i,s,o,t)&&n.push(s)}return n},isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},Base64:i},a={sdkVersion:"2.43.1",sdkVendor:"mparticle",platform:"web",Messages:{DeprecationMessages:{MethodIsDeprecatedPostfix:"is a deprecated method and will be removed in future releases",AlternativeMethodPrefix:"Please use the alternate method:"},ErrorMessages:{NoToken:"A token must be specified.",EventNameInvalidType:"Event name must be a valid string value.",EventDataInvalidType:"Event data must be a valid object hash.",LoggingDisabled:"Event logging is currently disabled.",CookieParseError:"Could not parse cookie",EventEmpty:"Event object is null or undefined, cancelling send",APIRequestEmpty:"APIRequest is null or undefined, cancelling send",NoEventType:"Event type must be specified.",TransactionIdRequired:"Transaction ID is required",TransactionRequired:"A transaction attributes object is required",PromotionIdRequired:"Promotion ID is required",BadAttribute:"Attribute value cannot be object or array",BadKey:"Key value cannot be object or array",BadLogPurchase:"Transaction attributes and a product are both required to log a purchase, https://docs.mparticle.com/?javascript#measuring-transactions",AudienceAPINotEnabled:"Your workspace is not enabled to retrieve user audiences."},InformationMessages:{CookieSearch:"Searching for cookie",CookieFound:"Cookie found, parsing values",CookieNotFound:"Cookies not found",CookieSet:"Setting cookie",CookieSync:"Performing cookie sync",SendBegin:"Starting to send event",SendIdentityBegin:"Starting to send event to identity server",SendWindowsPhone:"Sending event to Windows Phone container",SendIOS:"Calling iOS path: ",SendAndroid:"Calling Android JS interface method: ",SendHttp:"Sending event to mParticle HTTP service",SendAliasHttp:"Sending alias request to mParticle HTTP service",SendIdentityHttp:"Sending event to mParticle HTTP service",StartingNewSession:"Starting new Session",StartingLogEvent:"Starting to log event",StartingLogOptOut:"Starting to log user opt in/out",StartingEndSession:"Starting to end session",StartingInitialization:"Starting to initialize",StartingLogCommerceEvent:"Starting to log commerce event",StartingAliasRequest:"Starting to Alias MPIDs",LoadingConfig:"Loading configuration options",AbandonLogEvent:"Cannot log event, logging disabled or developer token not set",AbandonAliasUsers:"Cannot Alias Users, logging disabled or developer token not set",AbandonStartSession:"Cannot start session, logging disabled or developer token not set",AbandonEndSession:"Cannot end session, logging disabled or developer token not set",NoSessionToEnd:"Cannot end session, no active session found"}
1,ValidationMessages:{ModifyIdentityRequestUserIdentitiesPresent:"identityRequests to modify require userIdentities to be present. Request not sent to server. Please fix and try again",IdentityRequesetInvalidKey:"There is an invalid key on your identityRequest object. It can only contain a `userIdentities` object and a `onUserAlias` function. Request not sent to server. Please fix and try again.",OnUserAliasType:"The onUserAlias value must be a function.",UserIdentities:"The userIdentities key must be an object with keys of identityTypes and values of strings. Request not sent to server. Please fix and try again.",UserIdentitiesInvalidKey:"There is an invalid identity key on your `userIdentities` object within the identityRequest. Request not sent to server. Please fix and try again.",UserIdentitiesInvalidValues:"All user identity values must be strings or null. Request not sent to server. Please fix and try again.",AliasMissingMpid:"Alias Request must contain both a destinationMpid and a sourceMpid",AliasNonUniqueMpid:"Alias Request's destinationMpid and sourceMpid must be unique",AliasMissingTime:"Alias Request must have both a startTime and an endTime",AliasStartBeforeEndTime:"Alias Request's endTime must be later than its startTime"}},NativeSdkPaths:{LogEvent:"logEvent",SetUserTag:"setUserTag",RemoveUserTag:"removeUserTag",SetUserAttribute:"setUserAttribute",RemoveUserAttribute:"removeUserAttribute",SetSessionAttribute:"setSessionAttribute",AddToCart:"addToCart",RemoveFromCart:"removeFromCart",ClearCart:"clearCart",LogOut:"logOut",SetUserAttributeList:"setUserAttributeList",RemoveAllUserAttributes:"removeAllUserAttributes",GetUserAttributesLists:"getUserAttributesLists",GetAllUserAttributes:"getAllUserAttributes",Identify:"identify",Logout:"logout",Login:"login",Modify:"modify",Alias:"aliasUsers",Upload:"upload"},StorageNames:{localStorageName:"mprtcl-api",localStorageNameV3:"mprtcl-v3",cookieName:"mprtcl-api",cookieNameV2:"mprtcl-v2",cookieNameV3:"mprtcl-v3",localStorageNameV4:"mprtcl-v4",localStorageProductsV4:"mprtcl-prodv4",cookieNameV4:"mprtcl-v4",currentStorageName:"mprtcl-v4",currentStorageProductsName:"mprtcl-prodv4"},DefaultConfig:{cookieDomain:null,cookieExpiration:365,logLevel:null,timeout:300,sessionTimeout:30,maxProducts:20,forwarderStatsTimeout:5e3,integrationDelayTimeout:5e3,maxCookieSize:3e3,aliasMaxWindow:90,uploadInterval:0},DefaultBaseUrls:{v1SecureServiceUrl:"jssdks.mparticle.com/v1/JS/",v2SecureServiceUrl:"jssdks.mparticle.com/v2/JS/",v3SecureServiceUrl:"jssdks.mparticle.com/v3/JS/",configUrl:"jssdkcdns.mparticle.com/JS/v2/",identityUrl:"identity.mparticle.com/v1/",aliasUrl:"jssdks.mparticle.com/v1/identity/",userAudienceUrl:"nativesdks.mparticle.com/v1/"},CNAMEUrlPaths:{v1SecureServiceUrl:"/webevents/v1/JS/",v2SecureServiceUrl:"/webevents/v2/JS/",v3SecureServiceUrl:"/webevents/v3/JS/",configUrl:"/tags/JS/v2/",identityUrl:"/identity/v1/",aliasUrl:"/webevents/v1/identity/"},Base64CookieKeys:{csm:1,sa:1,ss:1,ua:1,ui:1,csd:1,ia:1,con:1},SDKv2NonMPIDCookieKeys:{gs:1,cu:1,l:1,globalSettings:1,currentUserMPID:1},HTTPCodes:{noHttpCoverage:-1,activeIdentityRequest:-2,activeSession:-3,validationIssue:-4,nativeIdentityRequest:-5,loggingDisabledOrMissingAPIKey:-6,tooManyRequests:429},FeatureFlags:{ReportBatching:"reportBatching",EventBatchingIntervalMillis:"eventBatchingIntervalMillis",OfflineStorage:"offlineStorage",DirectUrlRouting:"directURLRouting",CacheIdentity:"cacheIdentity",AudienceAPI:"audienceAPI",CaptureIntegrationSpecificIds:"captureIntegrationSpecificIds",AstBackgroundEvents:"astBackgroun
1dEvents"},DefaultInstance:"default_instance",CCPAPurpose:"data_sale_opt_out",IdentityMethods:{Modify:"modify",Logout:"logout",Login:"login",Identify:"identify"},Environment:{Development:"development",Production:"production"}},u=200,c=202,d=400,l=function(e,t){return l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},l(e,t)};function g(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}l(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var p=function(){return p=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},p.apply(this,arguments)};function v(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(t){o(t)}}function a(e){try{u(n.throw(e))}catch(t){o(t)}}function u(e){e.done?i(e.value):function(e){return e instanceof r?e:new r((function(t){t(e)}))}(e.value).then(s,a)}u((n=n.apply(e,t||[])).next())}))}function f(e,t){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(u){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(r=1,n&&(i=2&a[0]?n.return:a[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,a[1])).done)return i;switch(n=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,n=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){s.label=a[1];break}if(6===a[0]&&s.label<i[1]){s.label=i[1],i=a;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(a);break}i[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(u){a=[6,u],n=0}finally{r=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}}function m(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var h=a.Messages,y=function(e){return D(L(e))},S=function(e){return U(O(e))},b=function(e,t){if(!e)return!1;var r=0;if(Array.prototype.indexOf)return 0<=e.indexOf(t,0);for(var n=e.length;r<n;r++)if(r in e&&e[r]===t)return!0;return!1},I=function(e,t){if(t&&e)for(var r in e)if(e.hasOwnProperty(r)&&r.toLowerCase()===t.toLowerCase())return r;return null},_=function(e,t){var r=[e,h.DeprecationMessages.MethodIsDeprecatedPostfix];return t&&(r.push(t),r.push(h.DeprecationMessages.MethodIsDeprecatedPostfix)),r.join(" ")};function P(e){var t=0;if(null==e)return 0;if(e=e.toString().toLowerCase(),Array.prototype.reduce)return e.split("").reduce((function(e,t){return(e=(e<<5)-e+t.charCodeAt(0))&e}),0);if(0===e.length)return t;for(var r=0;r<e.length;r++)t=(t<<5)-t+e.charCodeAt(r),t&=t;return t}var C,w,A=function e(t){return void 0===t&&(t=""),t?function(){var e,t;return window.crypto&&window.crypto.getRandomValues&&(e=window.crypto.getRandomValues(new Uint8Array(1))),e?(t^e[0]%16>>NaN).toString(16):(t^16*Math.random()>>NaN).toString(16)}():"".concat(1e7,"-").concat(1e3,"-").concat(4e3,"-").concat(8e3,"-").concat(1e11).replace(/[018]/g,e)},T=function(e){var t=Object.prototype.toString.call(e);return"[object Object]"===t||"[object Error]"===t},E=function(e){if(isNaN(e)||!isFinite(e))return 0;var t=parseFloat(e);return isNaN(t)?0:t},k=function(e){return W(e)?e:null},D=function(e){return e.replace(/,/g,"|")},U=function(e){return e.replace(/\|/g,",")},O=function(e){return e.replace(/\'/g,'"')},L=function(e){return e.replace(/\"/g,"'")},M=function(e,t){return e.replace("%%mpid%%",t)},F=function(e){return e.replace(/&/g,"&")},N=function(e,t,r){var n=F(t),i=r?F(r):null,o=M(n,e),s=i?M(i,e):"";return o+encodeURIComponent(s)},R=function(e){return"false"!==e&&"0"!==e&&!!e},x=function(e){return decodeURIComponent(e.replace(/\+/g," "))},V=function(e){return 0===e.indexOf('"')&&(e=e.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\")),e},H=function(e){return"string"==typeof e},K=function(e){return"number"==typeof e},j=function(e){return"function"==typeof e},q=function(e){return K(e)||H(e)||function(e){return"boolean"==typeof e}(e)},B=function(e){return e===function(e){return W(e)?e.toString().toLowerCase().replace(/[^0-9a-zA-Z]+/g,"_"):""}(e)},W=function(e){return H(e)||K(e)},J=function(e){return null==e||!(Object.keys(e)||e).length},z=function(e,t){return e.slice(0,t).concat(e.slice(t+1),e[t])},Q=function(e){var t={};return(e.split("?")[1]||"").split("&").forEach((function(e){var r=e.split("="),n=r[0],i=r.slice(1).join("=");if(n&&void 0!==i)try{t[n]=decodeURIComponent(i||"")}catch(e){console.error("Failed to decode value for key ".concat(n,": ").concat(e))}})),{get:function(e){return t[e]}
1,forEach:function(e){for(var r in t)t.hasOwnProperty(r)&&e(t[r],r)}}},G=function(){return"undefined"!=typeof window&&window.location?window.location.href:""},Y=function(e,t,r){var n={};if(!J(e))for(var i in e)if(e.hasOwnProperty(i)){var o=r(i);b(t,o)||(n[i]=e[i])}return n},X=function(e,t,r){var n;return(null===(n=e.kitConfigs)||void 0===n?void 0:n.find((function(e){return e.name===t&&e.moduleId===r})))||null},$={SessionStart:1,SessionEnd:2,PageView:3,PageEvent:4,CrashReport:5,OptOut:6,AppStateTransition:10,Profile:14,Commerce:16,Media:20,UserAttributeChange:17,UserIdentityChange:18},Z={Unknown:0,Navigation:1,Location:2,Search:3,Transaction:4,UserContent:5,UserPreference:6,Social:7,Other:8,Media:9,getName:function(e){return e===Z.Unknown?"Unknown":e===Z.Navigation?"Navigation":e===Z.Location?"Location":e===Z.Search?"Search":e===Z.Transaction?"Transaction":e===Z.UserContent?"User Content":e===Z.UserPreference?"User Preference":e===Z.Social?"Social":e===ee.ProductAddToCart?"Product Added to Cart":e===ee.ProductAddToWishlist?"Product Added to Wishlist":e===ee.ProductCheckout?"Product Checkout":e===ee.ProductCheckoutOption?"Product Checkout Options":e===ee.ProductClick?"Product Click":e===ee.ProductImpression?"Product Impression":e===ee.ProductPurchase?"Product Purchased":e===ee.ProductRefund?"Product Refunded":e===ee.ProductRemoveFromCart?"Product Removed From Cart":e===ee.ProductRemoveFromWishlist?"Product Removed from Wishlist":e===ee.ProductViewDetail?"Product View Details":e===ee.PromotionClick?"Promotion Click":e===ee.PromotionView?"Promotion View":"Other"}},ee={ProductAddToCart:10,ProductRemoveFromCart:11,ProductCheckout:12,ProductCheckoutOption:13,ProductClick:14,ProductViewDetail:15,ProductPurchase:16,ProductRefund:17,PromotionView:18,PromotionClick:19,ProductAddToWishlist:20,ProductRemoveFromWishlist:21,ProductImpression:22},te={Other:0,CustomerId:1,Facebook:2,Twitter:3,Google:4,Microsoft:5,Yahoo:6,Email:7,FacebookCustomAudienceId:9,Other2:10,Other3:11,Other4:12,Other5:13,Other6:14,Other7:15,Other8:16,Other9:17,Other10:18,MobileNumber:19,PhoneNumber2:20,PhoneNumber3:21,isValid:function(e){if("number"==typeof e)for(var t in te)if(te.hasOwnProperty(t)&&te[t]===e)return!0;return!1},getName:function(e){return e===window.mParticle.IdentityType.CustomerId?"Customer ID":e===window.mParticle.IdentityType.Facebook?"Facebook ID":e===window.mParticle.IdentityType.Twitter?"Twitter ID":e===window.mParticle.IdentityType.Google?"Google ID":e===window.mParticle.IdentityType.Microsoft?"Microsoft ID":e===window.mParticle.IdentityType.Yahoo?"Yahoo ID":e===window.mParticle.IdentityType.Email?"Email":e===window.mParticle.IdentityType.FacebookCustomAudienceId?"Facebook App User ID":"Other ID"},getIdentityType:function(e){return"other"===e?te.Other:"customerid"===e?te.CustomerId:"facebook"===e?te.Facebook:"twitter"===e?te.Twitter:"google"===e?te.Google:"microsoft"===e?te.Microsoft:"yahoo"===e?te.Yahoo:"email"===e?te.Email:"facebookcustomaudienceid"===e?te.FacebookCustomAudienceId:"other2"===e?te.Other2:"other3"===e?te.Other3:"other4"===e?te.Other4:"other5"===e?te.Other5:"other6"===e?te.Other6:"other7"===e?te.Other7:"other8"===e?te.Other8:"other9"===e?te.Other9:"other10"===e?te.Other10:"mobile_number"===e?te.MobileNumber:"phone_number_2"===e?te.PhoneNumber2:!("phone_number_3"!=e)&&te.PhoneNumber3},getIdentityName:function(e){return e===te.Other?"other":e===te.CustomerId?"customerid":e===te.Facebook?"facebook":e===te.Twitter?"twitter":e===te.Google?"google":e===te.Microsoft?"microsoft":e===te.Yahoo?"yahoo":e===te.Email?"email":e===te.FacebookCustomAudienceId?"facebookcustomaudienceid":e===te.Other2?"other2":e===te.Other3?"other3":e===te.Other4?"other4":e===te.Other5?"other5":e===te.Other6?"other6":e===te.Other7?"other7":e===te.Other8?"other8":e===te.Other9?"other9":e===te.Other10?"other10":e===te.MobileNumber?"mobile_number":e===te.PhoneNumber2?"phone_number_2":e===te.PhoneNumber3?"phone_number_3":null},getValuesAsStrings:function(){return Object.values(te).map((function(e){return K(e)?e.toString():void 0})).filter((function(e){return void 0!==e}))},getNewIdentitiesByName:function(e){var t={},r=te.getValuesAsStrings();for(var n in e){if(r.includes(n))t[te.getIdentityName(E(n))]=e[n]}return t}},re={Unknown:0,AddToCart:1,RemoveFromCart:2,Checkout:3,CheckoutOption:4,Click:5,ViewDetail:6,Purchase:7,Refund:8,AddToWishlist:9,RemoveFromWishlist:10,getName:function(e){return e===re.AddToCart?"Add to Cart":e===re.RemoveFromCart?"Remove from Cart":e===re.Checkout?"Checkout":e===re.CheckoutOption?"Checkout Option":e===re.Click?"Click":e===re.ViewDetail?"View Detail":e===re.Purchase?"Purchase":e===re.Refund?"Refund":e===re.AddToWishlist?"Add to Wishlist":e===re.RemoveFromWishlist?"Remove from Wishlist":"Unknown"},getExpansionName:function(e){return e===re.AddToCart?"add_to_cart":e===re.RemoveFromCart?"remove_from_cart":e===re.Checkout?"checkout":e===re.CheckoutOption?"checkout_option":e===re.Click?"click":e===re.ViewDetail?"view_detail":e===re.Purchase?"purchase":e===re.Refund?"refund":e===re.AddToWishlist?"add_to_wishlist":e===re.RemoveFromWishlist?"remove_from_wishlist":"unknown"}},ne={Unknown:0,PromotionView:1,PromotionClick:2,getName:function(e){return e===ne.PromotionView?"view":e===ne.PromotionClick?"click":"unknown"},getExpansionName:function(e){return e===ne.PromotionView?"view":e===ne.PromotionClick?"click":"unknown"}},ie={MessageType:$,EventType:Z,CommerceEventType:ee,IdentityType:te,ProfileMessageType:{Logout:3},ApplicationTransitionType:{AppInit:1},ProductActionType:re,PromotionActionType:ne,Environment:a.Environment};function oe(e){return oe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},oe(e)}
1function se(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}(w=C||(C={}))[w.Unknown=0]="Unknown",w[w.AddToCart=1]="AddToCart",w[w.RemoveFromCart=2]="RemoveFromCart",w[w.Checkout=3]="Checkout",w[w.CheckoutOption=4]="CheckoutOption",w[w.Click=5]="Click",w[w.ViewDetail=6]="ViewDetail",w[w.Purchase=7]="Purchase",w[w.Refund=8]="Refund",w[w.AddToWishlist=9]="AddToWishlist",w[w.RemoveFromWishlist=10]="RemoveFromWishlist";var ae,ue,ce,de,le,ge,pe,ve,fe,me,he,ye,Se,be,Ie,_e,Pe,Ce,we,Ae={};ae=Ae,Object.defineProperty(ae,"__esModule",{value:!0}),(ue=ae.ApplicationInformationOsEnum||(ae.ApplicationInformationOsEnum={})).unknown="Unknown",ue.iOS="IOS",ue.android="Android",ue.windowsPhone="WindowsPhone",ue.mobileWeb="MobileWeb",ue.unityIOS="UnityIOS",ue.unityAndroid="UnityAndroid",ue.desktop="Desktop",ue.tvOS="TVOS",ue.roku="Roku",ue.outOfBand="OutOfBand",ue.alexa="Alexa",ue.smartTV="SmartTV",ue.fireTV="FireTV",ue.xbox="Xbox",(ae.ApplicationStateTransitionEventEventTypeEnum||(ae.ApplicationStateTransitionEventEventTypeEnum={})).applicationStateTransition="application_state_transition",(ce=ae.ApplicationStateTransitionEventDataApplicationTransitionTypeEnum||(ae.ApplicationStateTransitionEventDataApplicationTransitionTypeEnum={})).applicationInitialized="application_initialized",ce.applicationExit="application_exit",ce.applicationBackground="application_background",ce.applicationForeground="application_foreground",(de=ae.BatchEnvironmentEnum||(ae.BatchEnvironmentEnum={})).unknown="unknown",de.development="development",de.production="production",(ae.BreadcrumbEventEventTypeEnum||(ae.BreadcrumbEventEventTypeEnum={})).breadcrumb="breadcrumb",(ae.CommerceEventEventTypeEnum||(ae.CommerceEventEventTypeEnum={})).commerceEvent="commerce_event",(le=ae.CommerceEventDataCustomEventTypeEnum||(ae.CommerceEventDataCustomEventTypeEnum={})).addToCart="add_to_cart",le.removeFromCart="remove_from_cart",le.checkout="checkout",le.checkoutOption="checkout_option",le.click="click",le.viewDetail="view_detail",le.purchase="purchase",le.refund="refund",le.promotionView="promotion_view",le.promotionClick="promotion_click",le.addToWishlist="add_to_wishlist",le.removeFromWishlist="remove_from_wishlist",le.impression="impression",(ae.CrashReportEventEventTypeEnum||(ae.CrashReportEventEventTypeEnum={})).crashReport="crash_report",(ae.CustomEventEventTypeEnum||(ae.CustomEventEventTypeEnum={})).customEvent="custom_event",(ge=ae.CustomEventDataCustomEventTypeEnum||(ae.CustomEventDataCustomEventTypeEnum={})).navigation="navigation",ge.location="location",ge.search="search",ge.transaction="transaction",ge.userContent="user_content",ge.userPreference="user_preference",ge.social="social",ge.media="media",ge.other="other",ge.unknown="unknown",(pe=ae.DeviceCurrentStateDeviceOrientationEnum||(ae.DeviceCurrentStateDeviceOrientationEnum={})).portrait="portrait",pe.portraitUpsideDown="portrait_upside_down",pe.landscape="landscape",pe.landscapeLeft="LandscapeLeft",pe.landscapeRight="LandscapeRight",pe.faceUp="FaceUp",pe.faceDown="FaceDown",pe.square="Square",(ve=ae.DeviceCurrentStateStatusBarOrientationEnum||(ae.DeviceCurrentStateStatusBarOrientationEnum={})).portrait="portrait",ve.portraitUpsideDown="portrait_upside_down",ve.landscape="landscape",ve.landscapeLeft="LandscapeLeft",ve.landscapeRight="LandscapeRight",ve.faceUp="FaceUp",ve.faceDown="FaceDown",ve.square="Square",(fe=ae.DeviceInformationPlatformEnum||(ae.DeviceInformationPlatformEnum={})).iOS="iOS",fe.android="Android",fe.web="web",fe.desktop="desktop",fe.tvOS="tvOS",fe.roku="roku",fe.outOfBand="out_of_band",fe.smartTV="smart_tv",fe.xbox="xbox",(me=ae.EventTypeEnum||(ae.EventTypeEnum={})).unknown="unknown",me.sessionStart="session_start",me.sessionEnd="session_end",me.screenView="screen_view",me.customEvent="custom_event",me.crashReport="crash_report",me.optOut="opt_out",me.firstRun="first_run",me.preAttribution="pre_attribution",me.pushRegistration="push_registration",me.applicationStateTransition="application_state_transition",me.pushMessage="push_message",me.networkPerformance="network_performance",me.breadcrumb="breadcrumb",me.profile="profile",me.pushReaction="push_reaction",me.commerceEvent="commerce_event",me.userAttributeChange="user_attribute_change",me.userIdentityChange="user_identity_change",me.uninstall="uninstall",me.validationResult="validation_result",(he=ae.IdentityTypeEnum||(ae.IdentityTypeEnum={})).other="other",he.customerId="customer_id",he.facebook="facebook",he.twitter="twitter",he.google="google",he.microsoft="microsoft",he.yahoo="yahoo",he.email="email",he.alias="al
1ias",he.facebookCustomAudienceId="facebook_custom_audience_id",he.otherId2="other_id_2",he.otherId3="other_id_3",he.otherId4="other_id_4",he.otherId5="other_id_5",he.otherId6="other_id_6",he.otherId7="other_id_7",he.otherId8="other_id_8",he.otherId9="other_id_9",he.otherId10="other_id_10",he.mobileNumber="mobile_number",he.phoneNumber2="phone_number_2",he.phoneNumber3="phone_number_3",(ae.NetworkPerformanceEventEventTypeEnum||(ae.NetworkPerformanceEventEventTypeEnum={})).networkPerformance="network_performance",(ae.OptOutEventEnum||(ae.OptOutEventEnum={})).optOut="opt_out",(ye=ae.ProductActionActionEnum||(ae.ProductActionActionEnum={})).unknown="unknown",ye.addToCart="add_to_cart",ye.removeFromCart="remove_from_cart",ye.checkout="checkout",ye.checkoutOption="checkout_option",ye.click="click",ye.viewDetail="view_detail",ye.purchase="purchase",ye.refund="refund",ye.addToWishlist="add_to_wishlist",ye.removeFromWishlist="remove_from_wish_list",(ae.ProfileEventEventTypeEnum||(ae.ProfileEventEventTypeEnum={})).profile="profile",(Se=ae.ProfileEventDataProfileEventTypeEnum||(ae.ProfileEventDataProfileEventTypeEnum={})).signup="signup",Se.login="login",Se.logout="logout",Se.update="update",Se.delete="delete",(be=ae.PromotionActionActionEnum||(ae.PromotionActionActionEnum={})).view="view",be.click="click",(ae.PushMessageEventEventTypeEnum||(ae.PushMessageEventEventTypeEnum={})).pushMessage="push_message",(Ie=ae.PushMessageEventDataPushMessageTypeEnum||(ae.PushMessageEventDataPushMessageTypeEnum={})).sent="sent",Ie.received="received",Ie.action="action",(_e=ae.PushMessageEventDataApplicationStateEnum||(ae.PushMessageEventDataApplicationStateEnum={})).notRunning="not_running",_e.background="background",_e.foreground="foreground",(Pe=ae.PushMessageEventDataPushMessageBehaviorEnum||(ae.PushMessageEventDataPushMessageBehaviorEnum={})).received="Received",Pe.directOpen="DirectOpen",Pe.read="Read",Pe.influencedOpen="InfluencedOpen",Pe.displayed="Displayed",(ae.PushRegistrationEventEventTypeEnum||(ae.PushRegistrationEventEventTypeEnum={})).pushRegistration="push_registration",(ae.SessionEndEventEventTypeEnum||(ae.SessionEndEventEventTypeEnum={})).sessionEnd="session_end",(ae.SessionStartEventEventTypeEnum||(ae.SessionStartEventEventTypeEnum={})).sessionStart="session_start",(Ce=ae.SourceInformationChannelEnum||(ae.SourceInformationChannelEnum={})).native="native",Ce.javascript="javascript",Ce.pixel="pixel",Ce.desktop="desktop",Ce.partner="partner",Ce.serverToServer="server_to_server",(ae.UserAttributeChangeEventEventTypeEnum||(ae.UserAttributeChangeEventEventTypeEnum={})).userAttributeChange="user_attribute_change",(ae.UserIdentityChangeEventEventTypeEnum||(ae.UserIdentityChangeEventEventTypeEnum={})).userIdentityChange="user_identity_change",function(e){e.other="other",e.customerId="customerid",e.facebook="facebook",e.twitter="twitter",e.google="google",e.microsoft="microsoft",e.yahoo="yahoo",e.email="email",e.alias="alias",e.facebookCustomAudienceId="facebookcustomaudienceid",e.otherId2="other2",e.otherId3="other3",e.otherId4="other4",e.otherId5="other5",e.otherId6="other6",e.otherId7="other7",e.otherId8="other8",e.otherId9="other9",e.otherId10="other10",e.mobileNumber="mobile_number",e.phoneNumber2="phone_number_2",e.phoneNumber3="phone_number_3"}(we||(we={}));var Te=a.FeatureFlags.CaptureIntegrationSpecificIds;function Ee(e,t,r){if(!e)return null;if(!t||1>t.length)return null;for(var n,i=r._IntegrationCapture,o=r._Helpers.getFeatureFlag,s=r.Identity.getCurrentUser(),a=[],u=null,c=0,d=t;c<d.length;c++)if(n=d[c]){u=n;var l=Le(n);l&&a.push(l)}if(!u)return null;var g=null;J(u.ConsentState)?!J(s)&&(g=s.getConsentState()):g=u.ConsentState;var p={source_request_id:r._Helpers.generateUniqueId(),mpid:e,timestamp_unixtime_ms:(new Date).getTime(),environment:u.Debug?Ae.BatchEnvironmentEnum.development:Ae.BatchEnvironmentEnum.production,events:a,mp_deviceid:u.DeviceId,sdk_version:u.SDKVersion,application_info:{application_version:u.AppVersion,application_name:u.AppName,package:u.Package,sideloaded_kits_count:r._Store.sideloadedKitsCount},device_info:{platform:Ae.DeviceInformationPlatformEnum.web,screen_width:"undefined"!=typeof window&&void 0!==window.screen?window.screen.width:0,screen_height:"undefined"!=typeof window&&void 0!==window.screen?window.screen.height:0},user_attributes:u.UserAttributes,user_identities:Oe(u.UserIdentities),consent_state:ke(g),integration_attributes:u.IntegrationAttributes};if(u.DataPlan&&u.DataPlan.PlanId&&(p.context={data_plan:{plan_id:u.DataPlan.PlanId,plan_version:u.DataPlan.PlanVersion||void 0}}),o&&!!o(Te)){var v=null==i?void 0:i.getClickIdsAsPartnerIdentities();J(v)||(p.partner_identities=v)}return p}
1function ke(e){return J(e)?null:{gdpr:De(e.getGDPRConsentState()),ccpa:Ue(e.getCCPAConsentState())}}function De(e){if(!e)return null;var t={};for(var r in e)e.hasOwnProperty(r)&&(t[r]={consented:e[r].Consented,hardware_id:e[r].HardwareId,document:e[r].ConsentDocument,timestamp_unixtime_ms:e[r].Timestamp,location:e[r].Location});return t}function Ue(e){return e?{data_sale_opt_out:{consented:e.Consented,hardware_id:e.HardwareId,document:e.ConsentDocument,timestamp_unixtime_ms:e.Timestamp,location:e.Location}}:null}function Oe(e){if(!e||!e.length)return null;for(var t,r={},n=0,i=e;n<i.length;n++)switch((t=i[n]).Type){case ie.IdentityType.CustomerId:r.customer_id=t.Identity;break;case ie.IdentityType.Email:r.email=t.Identity;break;case ie.IdentityType.Facebook:r.facebook=t.Identity;break;case ie.IdentityType.FacebookCustomAudienceId:r.facebook_custom_audience_id=t.Identity;break;case ie.IdentityType.Google:r.google=t.Identity;break;case ie.IdentityType.Microsoft:r.microsoft=t.Identity;break;case ie.IdentityType.Other:r.other=t.Identity;break;case ie.IdentityType.Other2:r.other_id_2=t.Identity;break;case ie.IdentityType.Other3:r.other_id_3=t.Identity;break;case ie.IdentityType.Other4:r.other_id_4=t.Identity;break;case ie.IdentityType.Other5:r.other_id_5=t.Identity;break;case ie.IdentityType.Other6:r.other_id_6=t.Identity;break;case ie.IdentityType.Other7:r.other_id_7=t.Identity;break;case ie.IdentityType.Other8:r.other_id_8=t.Identity;break;case ie.IdentityType.Other9:r.other_id_9=t.Identity;break;case ie.IdentityType.Other10:r.other_id_10=t.Identity;break;case ie.IdentityType.MobileNumber:r.mobile_number=t.Identity;break;case ie.IdentityType.PhoneNumber2:r.phone_number_2=t.Identity;break;case ie.IdentityType.PhoneNumber3:r.phone_number_3=t.Identity}return r}function Le(e){if(!e)return null;switch(e.EventDataType){case ie.MessageType.AppStateTransition:return function(e){var t=je(e),r=Ae.ApplicationStateTransitionEventDataApplicationTransitionTypeEnum,n=r.applicationBackground,i=r.applicationInitialized,o=e.IsBackgroundAST?n:i,s={application_transition_type:o,is_first_run:e.IsFirstRun,is_upgrade:!1,launch_referral:e.LaunchReferral};return s=Object.assign(s,t),{event_type:Ae.EventTypeEnum.applicationStateTransition,data:s}}(e);case ie.MessageType.Commerce:return function(e){var t=je(e),r={custom_flags:e.CustomFlags,product_action:Fe(e),promotion_action:Re(e),product_impressions:Ve(e),shopping_cart:He(e),currency_code:e.CurrencyCode};return r=Object.assign(r,t),{event_type:Ae.EventTypeEnum.commerceEvent,data:r}}(e);case ie.MessageType.CrashReport:return function(e){var t=je(e),r={message:e.EventName};return r=Object.assign(r,t),{event_type:Ae.EventTypeEnum.crashReport,data:r}}(e);case ie.MessageType.OptOut:return function(e){var t=je(e),r={is_opted_out:e.OptOut};return r=Object.assign(r,t),{event_type:Ae.EventTypeEnum.optOut,data:r}}(e);case ie.MessageType.PageEvent:return function(e){var t=je(e),r={custom_event_type:Ke(e.EventCategory),custom_flags:e.CustomFlags,event_name:e.EventName};return r=Object.assign(r,t),{event_type:Ae.EventTypeEnum.customEvent,data:r}}(e);case ie.MessageType.PageView:return function(e){var t=je(e),r={custom_flags:e.CustomFlags,screen_name:e.EventName};return r=Object.assign(r,t),{event_type:Ae.EventTypeEnum.screenView,data:r}}(e);case ie.MessageType.Profile:return null;case ie.MessageType.SessionEnd:return function(e){var t=je(e),r={session_duration_ms:e.SessionLength};return r=Object.assign(r,t),{event_type:Ae.EventTypeEnum.sessionEnd,data:r}}(e);case ie.MessageType.SessionStart:return function(e){var t=je(e),r={};return r=Object.assign(r,t),{event_type:Ae.EventTypeEnum.sessionStart,data:r}}(e);case ie.MessageType.UserAttributeChange:return function(e){var t=je(e),r={user_attribute_name:e.UserAttributeChanges.UserAttributeName,new:e.UserAttributeChanges.New,old:e.UserAttributeChanges.Old,deleted:e.UserAttributeChanges.Deleted,is_new_attribute:e.UserAttributeChanges.IsNewAttribute};return r=p(p({},r),t),{event_type:Ae.EventTypeEnum.userAttributeChange,data:r}}(e);case ie.MessageType.UserIdentityChange:return function(e){var t=je(e),r={new:{identity_type:Be(e.UserIdentityChanges.New.IdentityType),identity:e.UserIdentityChanges.New.Identity||null,timestamp_unixtime_ms:e.Timestamp,created_this_batch:e.UserIdentityChanges.New.CreatedThisBatch},old:{identity_type:Be(e.UserIdentityChanges.Old.IdentityType),identity:e.UserIdentityChanges.Old.Identity||null,timestamp_unixtime_ms:e.Timestamp,created_this_batch:e.UserIdentityChanges.Old.CreatedThisBatch}};return r=Object.assign(r,t),{event_type:Ae.EventTypeEnum.userIdentityChange,data:r}}(e)}return null}function Me(e){return e?e===C.AddToCart?Ae.ProductActionActionEnum.addToCart:e===C.AddToWishlist?Ae.ProductActionActionEnum.addToWishlist:e===C.Checkout?Ae.ProductActionActionEnum.checkout:e===C.CheckoutOption?Ae.ProductActionActionEnum.checkoutOption:e===C.Click?Ae.ProductActionActionEnum.click:e===C.Purchase?Ae.ProductActionActionEnum.purchase:e===C.Refund?Ae.ProductActionActionEnum.refund:e===C.RemoveFromCart?Ae.ProductActionActionEnum.removeFromCart:e===C.RemoveFromWishlist?Ae.ProductActionActionEnum.removeFromWishlist:e===C.ViewDetail?Ae.ProductActionActionEnum.viewDetail:Ae.ProductActionActionEnum.unknown:Ae.ProductActionActionEnum.unknown}function Fe(e){return e.ProductAction?{action:Me(e.ProductAction.ProductActionType),checkout_step:e.ProductAction.CheckoutStep,checkout_options:e.ProductAction.CheckoutOptions,transaction_id:e.ProductAction.TransactionId,affiliation:e.ProductAction.Affiliation,total_amount:e.ProductAction.TotalAmount,tax_amount:e.ProductAction.TaxAmount,shipping_amount:e.ProductAction.ShippingAmount,coupon_code:e.ProductAction.CouponCode,products:Ne(e.ProductAction.ProductList)}:null}function Ne(e){if(!e||!e.length)return null;for(var t=[],r=0,n=e;r<n.length;r++){var i=n[r],o={id:i.Sku,name:i.Name,brand:i.Brand,category:i.Category,variant:i.Variant,total_product_amount:i.TotalAmount,position:i.Position,price:i.Price,quantity:i.Quantity,coupon_code:i.CouponCode,custom_attributes:i.Attributes};t.push(o)}return t}function Re(e){return e.PromotionAction?{action:e.PromotionAction.PromotionActionType,promotions:xe(e.PromotionAction.PromotionList)}:null}function xe(e){if(!e||!e.length)return null;for(var t=[],r=0,n=e;r<n.length;r++){var i=n[r],o={id:i.Id,name:i.Name,creative:i.Creative,position:i.Position};t.push(o)}return t}function Ve(e){if(!e.ProductImpressions)return null;for(var t=[],r=0,n=e.ProductImpressions;r<n.length;r++){var i=n[r],o={product_impression_list:i.ProductImpressionList,products:Ne(i.ProductList)};t.push(o)}return t}function He(e){return e.ShoppingCart&&e.ShoppingCart.ProductList&&e.ShoppingCart.ProductList.length?{products:Ne(e.ShoppingCart.ProductList)}:null}function Ke(e){return e===ie.EventType.Other?Ae.CustomEventDataCustomEventTypeEnum.other:e===ie.EventType.Location?Ae.CustomEventDataCustomEventTypeEnum.location:e===ie.EventType.Navigation?Ae.CustomEventDataCustomEventTypeEnum.navigation:e===ie.EventType.Search?Ae.CustomEventDataCustomEventTypeEnum.search:e===ie.EventType.Social?Ae.CustomEventDataCustomEventTypeEnum.social:e===ie.EventType.Transaction?Ae.CustomEventDataCustomEventTypeEnum.transaction:e===ie.EventType.UserContent?Ae.CustomEventDataCustomEventTypeEnum.userContent:e===ie.EventType.UserPreference?Ae.CustomEventDataCustomEventTypeEnum.userPreference:e===ie.EventType.Media?Ae.CustomEventDataCustomEventTypeEnum.media:e===ie.CommerceEventType.ProductAddToCart?Ae.CommerceEventDataCustomEventTypeEnum.addToCart:e===ie.CommerceEventType.ProductAddToWishlist?Ae.CommerceEventDataCustomEventTypeEnum.addToWishlist:e===ie.CommerceEventType.ProductCheckout?Ae.CommerceEventDataCustomEventTypeEnum.checkout:e===ie.CommerceEventType.ProductCheckoutOption?Ae.CommerceEventDataCustomEventTypeEnum.checkoutOption:e===ie.CommerceEventType.ProductClick?Ae.CommerceEventDataCustomEventTypeEnum.click:e===ie.CommerceEventType.ProductImpression?Ae.CommerceEventDataCustomEventTypeEnum.impression:e===ie.CommerceEventType.ProductPurchase?Ae.CommerceEventDataCustomEventTypeEnum.purchase:e===ie.CommerceEventType.ProductRefund?Ae.CommerceEventDataCustomEventTypeEnum.refund:e===ie.CommerceEventType.ProductRemoveFromCart?Ae.CommerceEventDataCustomEventTypeEnum.removeFromCart:e===ie.CommerceEventType.ProductRemoveFromWishlist?Ae.CommerceEventDataCustomEventTypeEnum.removeFromWishlist:e===ie.CommerceEventType.ProductViewDetail?Ae.CommerceEventDataCustomEventTypeEnum.viewDetail:e===ie.CommerceEventType.PromotionClick?Ae.CommerceEventDataCustomEventTypeEnum.promotionClick:e===ie.CommerceEventType.PromotionView?Ae.CommerceEventDataCustomEventTypeEnum.promotionView:Ae.CustomEventDataCustomEventTypeEnum.unknown}function je(e){return{timestamp_unixtime_ms:e.Timestamp,session_uuid:e.SessionId,session_start_unixtime_ms:e.SessionStartDate,custom_attributes:e.EventAttributes,location:qe(e.Location),source_message_id:e.SourceMessageId,active_time_on_site_ms:e.ActiveTimeOnSite}}function qe(e){return e&&Object.keys(e).length?{latitude:e.lat,longitude:e.lng}:null}function Be(e){return e===we.other?Ae.IdentityTypeEnum.other:e===we.customerId?Ae.IdentityTypeEnum.customerId:e===we.facebook?Ae.IdentityTypeEnum.facebook:e===we.twitter?Ae.IdentityTypeEnum.twitter:e===we.google?Ae.IdentityTypeEnum.google:e===we.microsoft?Ae.IdentityTypeEnum.microsoft:e===we.yahoo?Ae.IdentityTypeEnum.yahoo:e===we.email?Ae.IdentityTypeEnum.email:e===we.alias?Ae.IdentityTypeEnum.alias:e===we.facebookCustomAudienceId?Ae.IdentityTypeEnum.facebookCustomAudienceId:e===we.otherId2?Ae.IdentityTypeEnum.otherId2:e===we.otherId3?Ae.IdentityTypeEnum.otherId3:e===we.otherId4?Ae.IdentityTypeEnum.otherId4:e===we.otherId5?Ae.IdentityTypeEnum.otherId5:e===we.otherId6?Ae.IdentityTypeEnum.otherId6:e===we.otherId7?Ae.IdentityTypeEnum.otherId7:e===we.otherId8?Ae.IdentityTypeEnum.otherId8:e===we.otherId9?Ae.IdentityTypeEnum.otherId9
1:e===we.otherId10?Ae.IdentityTypeEnum.otherId10:e===we.mobileNumber?Ae.IdentityTypeEnum.mobileNumber:e===we.phoneNumber2?Ae.IdentityTypeEnum.phoneNumber2:e===we.phoneNumber3?Ae.IdentityTypeEnum.phoneNumber3:void 0}var We=function(){function e(e,t,r){this._storageKey=e,this.storageObject=t,this.logger=(null==r?void 0:r.logger)||{verbose:function(){},warning:function(){},error:function(){}},this.contents=this.retrieve()}return e.prototype.store=function(e){var t;this.contents=e,t=K(e)||!J(e)?JSON.stringify(e):"";try{this.storageObject.setItem(this._storageKey,t),this.logger.verbose("Saving item to Storage: ".concat(t))}catch(e){this.logger.error("Cannot Save items to Storage: ".concat(t)),this.logger.error(e)}},e.prototype.retrieve=function(){var e=this.storageObject.getItem(this._storageKey);return this.contents=e?JSON.parse(e):null,this.logger.verbose("Retrieving item from Storage: ".concat(e)),this.contents},e.prototype.purge=function(){this.logger.verbose("Purging Storage"),this.contents=null,this.storageObject.removeItem(this._storageKey)},e}(),Je=function(e){function t(t,r){return e.call(this,t,window.localStorage,r)||this}return g(t,e),t}(We),ze=function(e){function t(t,r){return e.call(this,t,window.sessionStorage,r)||this}return g(t,e),t}(We),Qe=function(e){this.url=e},Ge=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return g(t,e),t.prototype.upload=function(e,t){return v(this,void 0,void 0,(function(){var r;return f(this,(function(n){switch(n.label){case 0:return r=t||this.url,[4,fetch(r,e)];case 1:return[2,n.sent()]}}))}))},t}(Qe),Ye=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return g(t,e),t.prototype.upload=function(e){return v(this,void 0,void 0,(function(){return f(this,(function(t){switch(t.label){case 0:return[4,this.makeRequest(this.url,e.body,e.method,e.headers)];case 1:return[2,t.sent()]}}))}))},t.prototype.makeRequest=function(e,t,r,n){return void 0===r&&(r="post"),void 0===n&&(n={}),v(this,void 0,void 0,(function(){var i;return f(this,(function(){return i=new XMLHttpRequest,[2,new Promise((function(o,s){for(var a in i.onreadystatechange=function(){4!==i.readyState||o(i)},i.onerror=function(){s(i)},i.open(r,e),n)n.hasOwnProperty(a)&&i.setRequestHeader(a,n[a]);i.send(t)}))]}))}))},t}(Qe);function Xe(e,t){if(t){if(!e)return t.MPID=null,t.ConsentState=null,t.UserAttributes=null,void(t.UserIdentities=null);if(!t.MPID||t.MPID!==e.getMPID()){t.MPID=e.getMPID(),t.ConsentState=e.getConsentState(),t.UserAttributes=e.getAllUserAttributes();var r=e.getUserIdentities().userIdentities,n={};for(var i in r){var o=ie.IdentityType.getIdentityType(i);!1!==o&&(n[o]=r[i])}var s=[];if(T(n)&&Object.keys(n).length)for(var a in n){var u={};u.Identity=n[a],u.Type=E(a),s.push(u)}t.UserIdentities=s}}}var $e=function(){function e(t,r){var n;this.offlineStorageEnabled=!1,this.lastASTEventTime=0,this.AST_DEBOUNCE_MS=1e3,this.mpInstance=t,this.uploadIntervalMillis=r,this.batchingEnabled=r>=e.MINIMUM_INTERVAL_MILLIS,this.uploadIntervalMillis<e.MINIMUM_INTERVAL_MILLIS&&(this.uploadIntervalMillis=e.MINIMUM_INTERVAL_MILLIS),this.eventsQueuedForProcessing=[],this.batchesQueuedForProcessing=[],this.offlineStorageEnabled=this.isOfflineStorageAvailable(),this.offlineStorageEnabled&&(this.eventVault=new ze("".concat(t._Store.storageName,"-events"),{logger:t.Logger}),this.batchVault=new Je("".concat(t._Store.storageName,"-batches"),{logger:t.Logger}),(n=this.eventsQueuedForProcessing).push.apply(n,this.eventVault.retrieve()));var i=this.mpInstance._Store,o=i.SDKConfig,s=i.devToken,a=this.mpInstance._Helpers.createServiceUrl(o.v3SecureServiceUrl,s);this.uploadUrl="".concat(a,"/events"),this.uploader=window.fetch?new Ge(this.uploadUrl):new Ye(this.uploadUrl),this.triggerUploadInterval(!0,!1),this.addEventListeners()}return e.prototype.isOfflineStorageAvailable=function(){var e=this.mpInstance,t=e._Helpers.getFeatureFlag,r=e._Store.deviceId,n=t(a.FeatureFlags.OfflineStorage),i=parseInt(n,10),o=function(e){if(!e)return 100;var t=P(e);return Math.abs(t%100)+1}(r);return i>=o},e.prototype.shouldDebounceAndUpdateLastASTTime=function(){var e=Date.now();return!!(e-this.lastASTEventTime<this.AST_DEBOUNCE_MS)||(this.lastASTEventTime=e,!1)}
1,e.prototype.createBackgroundASTEvent=function(){var e=Date.now(),t=this.mpInstance,r=t._Store,n=t.Identity,i=t._timeOnSiteTimer,o=t._Helpers,s=r.sessionId,u=r.deviceId,c=r.sessionStartDate,d=r.SDKConfig,l=o.generateUniqueId,g=n.getCurrentUser,p={AppName:d.appName,AppVersion:d.appVersion,Package:d.package,EventDataType:$.AppStateTransition,Timestamp:e,SessionId:s,DeviceId:u,IsFirstRun:!1,SourceMessageId:l(),SDKVersion:a.sdkVersion,CustomFlags:{},EventAttributes:{},SessionStartDate:(null==c?void 0:c.getTime())||e,Debug:d.isDevelopmentMode,ActiveTimeOnSite:(null==i?void 0:i.getTimeInForeground())||0,IsBackgroundAST:!0};return Xe(g(),p),p},e.prototype.addEventListeners=function(){var e=this,t=this,r=function(){var r=e.mpInstance._Helpers.getFeatureFlag;if(r(a.FeatureFlags.AstBackgroundEvents)){if(t.shouldDebounceAndUpdateLastASTTime())return;var n=t.createBackgroundASTEvent();t.queueEvent(n)}t.prepareAndUpload(!1,t.isBeaconAvailable())};document.addEventListener("visibilitychange",(function(){"hidden"===document.visibilityState&&r()})),window.addEventListener("beforeunload",r),window.addEventListener("pagehide",r)},e.prototype.isBeaconAvailable=function(){return!!navigator.sendBeacon},e.prototype.triggerUploadInterval=function(e,t){var r=this;void 0===e&&(e=!1),void 0===t&&(t=!1),setTimeout((function(){r.prepareAndUpload(e,t)}),this.uploadIntervalMillis)},e.prototype.queueEvent=function(e){if(!J(e)){var t=this.mpInstance.Logger.verbose;this.eventsQueuedForProcessing.push(e),this.offlineStorageEnabled&&this.eventVault&&this.eventVault.store(this.eventsQueuedForProcessing),t("Queuing event: ".concat(JSON.stringify(e))),t("Queued event count: ".concat(this.eventsQueuedForProcessing.length)),this.shouldTriggerImmediateUpload(e.EventDataType)&&this.prepareAndUpload(!1,!1)}},e.prototype.shouldTriggerImmediateUpload=function(e){var t=[$.Commerce,$.UserIdentityChange];return!this.batchingEnabled||t.includes(e)},e.createNewBatches=function(e,t,r){if(!t||!e||!e.length)return null;for(var n=[],i=new Map,o=0,s=e;o<s.length;o++){if(!(m=s[o]).MPID){var a=t.getMPID();m.MPID=a}(f=i.get(m.MPID))||(f=[]),f.push(m),i.set(m.MPID,f)}for(var u=0,c=Array.from(i.entries());u<c.length;u++){for(var d=c[u],l=(a=d[0],d[1]),g=new Map,p=0,v=l;p<v.length;p++){var f,m=v[p];(f=g.get(m.SessionId))||(f=[]),f.push(m),g.set(m.SessionId,f)}for(var h=0,y=Array.from(g.entries());h<y.length;h++){var S=Ee(a,y[h][1],r),b=r._Store.SDKConfig.onCreateBatch;b&&((S=b(S))?S.modified=!0:r.Logger.warning("Skiping batch upload because no batch was returned from onCreateBatch callback")),S&&n.push(S)}}return n},e.prototype.prepareAndUpload=function(t,r){return void 0===t&&(t=!1),void 0===r&&(r=!1),v(this,void 0,void 0,(function(){var n,i,o,s,a,u,c,d;return f(this,(function(l){switch(l.label){case 0:return n=this.mpInstance.Identity.getCurrentUser(),i=this.eventsQueuedForProcessing,this.eventsQueuedForProcessing=[],this.offlineStorageEnabled&&this.eventVault&&this.eventVault.store([]),o=[],J(i)||(o=e.createNewBatches(i,n,this.mpInstance)),this.offlineStorageEnabled&&this.batchVault&&((u=this.batchesQueuedForProcessing).unshift.apply(u,this.batchVault.retrieve()),this.batchVault.purge()),J(o)||(c=this.batchesQueuedForProcessing).push.apply(c,o),s=this.batchesQueuedForProcessing,this.batchesQueuedForProcessing=[],[4,this.uploadBatches(this.mpInstance.Logger,s,r)];case 1:return a=l.sent(),J(a)||(d=this.batchesQueuedForProcessing).unshift.apply(d,a),!r&&this.offlineStorageEnabled&&this.batchVault&&(this.batchVault.store(this.batchesQueuedForProcessing),this.batchesQueuedForProcessing=[]),t&&this.triggerUploadInterval(t,!1),[2]}}))}))},e.prototype.uploadBatches=function(t,r,n){return v(this,void 0,void 0,(function(){var i,o,s,a,u,c;return f(this,(function(d){switch(d.label){case 0:if(i=r.filter((function(e){return!J(e.events)})),J(i))return[2,null];t.verbose("Uploading batches: ".concat(JSON.stringify(i))),t.verbose("Batch count: ".concat(i.length)),o=0,d.label=1;case 1:return o<i.length?(s={method:"POST",headers:{Accept:e.CONTENT_TYPE,"Content-Type":"text/plain;charset=UTF-8"},body:JSON.stringify(i[o])},n&&this.isBeaconAvailable()?(a=new Blob([s.body],{type:"text/plain;charset=UTF-8"}),navigator.sendBeacon(this.uploadUrl,a),[3,5]):[3,2]):[3,6];case 2:return d.trys.push([2,4,,5]),[4,this.uploader.upload(s)];case 3:if(!(200<=(u=d.sent()).status&&300>u.status)){if(500<=u.status||429===u.status)return t.error("HTTP error status ".concat(u.status," received")),[2,i.slice(o,i.length)];if(401<=u.status)return t.error("HTTP error status ".concat(u.status," while uploading - please verify your API key.")),[2,null];throw console.error("HTTP error status ".concat(u.status," while uploading events."),u),new Error("Uncaught HTTP Error ".concat(u.status,". Batch upload will be re-attempted."))}return t.verbose("Upload success for request ID: ".concat(i[o].source_request_id)),[3,5];case 4:return c=d.sent(),t.error("Error sending event to mParticle servers. ".concat(c)),[2,i.slice(o,i.length)];case 5:return o++,[3,1];case 6:return[2,null]}}))}))},e.CONTENT_TYPE="text/plain;charset=UTF-8",e.MINIMUM_INTERVAL_MILLIS=500,e}();function Ze(e,t){this.uploader=null;var r=this;this.queueEventForBatchUpload=function(t){if(!this.uploader){var r=E(e._Helpers.getFeatureFlag(a.FeatureFlags.EventBatchingIntervalMillis));this.uploader=new $e(e,r)}
1this.uploader.queueEvent(t),e._Persistence.update()},this.processQueuedEvents=function(){var t,n=e.Identity.getCurrentUser();if(n&&(t=n.getMPID()),e._Store.eventQueue.length&&t){var i=e._Store.eventQueue;e._Store.eventQueue=[],this.appendUserInfoToEvents(n,i),i.forEach((function(e){r.sendEventToServer(e)}))}},this.appendUserInfoToEvents=function(e,t){t.forEach((function(t){t.MPID||Xe(e,t)}))},this.sendEventToServer=function(r,n){var i=e._Helpers.extend({shouldUploadEvent:!0},n);if(!e._Store.webviewBridgeEnabled){var o,s=e.Identity.getCurrentUser();return s&&(o=s.getMPID()),e._Store.requireDelay=e._Helpers.isDelayedByIntegration(e._preInit.integrationDelays,e._Store.integrationDelayTimeoutStart,Date.now()),o&&!e._Store.requireDelay&&e._Store.configurationLoaded?(this.processQueuedEvents(),void(J(r)||(i.shouldUploadEvent&&this.queueEventForBatchUpload(r),r.EventName!==ie.MessageType.AppStateTransition&&(t&&t.kitBlockingEnabled&&(r=t.createBlockedEvent(r)),r&&e._Forwarders.sendEventToForwarders(r))))):(e.Logger.verbose("Event was added to eventQueue. eventQueue will be processed once a valid MPID is returned or there is no more integration imposed delay."),void e._Store.eventQueue.push(r))}e._NativeSdkHelpers.sendToNative(a.NativeSdkPaths.LogEvent,JSON.stringify(r))},this.sendBatchForwardingStatsToServer=function(t,r){var n,i;try{n=e._Helpers.createServiceUrl(e._Store.SDKConfig.v2SecureServiceUrl,e._Store.devToken),i={uuid:e._Helpers.generateUniqueId(),data:t},r&&(r.open("post",n+"/Forwarding"),r.send(JSON.stringify(i)))}catch(t){e.Logger.error("Error sending forwarding stats to mParticle servers.")}},this.initializeForwarderStatsUploader=function(){var t=e._Store.SDKConfig.v1SecureServiceUrl,r=e._Store.devToken,n="https://".concat(t).concat(r,"/Forwarding");return window.fetch?new Ge(n):new Ye(n)},this.prepareForwardingStats=function(t,r){var n,i=e._Forwarders.getForwarderStatsQueue();if(t&&t.isVisible){n={mid:t.id,esid:t.eventSubscriptionId,n:r.EventName,attrs:r.EventAttributes,sdk:r.SDKVersion,dt:r.EventDataType,et:r.EventCategory,dbg:r.Debug,ct:r.Timestamp,eec:r.ExpandedEventCount,dp:r.DataPlan};var o=e._Forwarders,s=o.sendSingleForwardingStatsToServer,u=o.setForwarderStatsQueue;e._Helpers.getFeatureFlag(a.FeatureFlags.ReportBatching)?(i.push(n),u(i)):s(n)}}}var et=a.IdentityMethods.Modify,tt={isNumber:K,isFunction:j,isStringOrNumber:W,isValidAttributeValue:function(e){return void 0!==e&&!T(e)&&!Array.isArray(e)},isValidKeyValue:function(e){return!(!e||T(e)||Array.isArray(e)||this.isFunction(e))},removeFalsyIdentityValues:function(e,t){if(!e||!e.userIdentities)return e;var r={},n=p({},e.userIdentities);for(var i in e.userIdentities)if(e.userIdentities.hasOwnProperty(i)){var o=e.userIdentities[i];null===o||o||(t.warning("Identity value for '".concat(i,"' is falsy (").concat(o,"). This value will be removed from the request.")),delete n[i])}return r.userIdentities=n,r},validateIdentities:function(e,t){var r={userIdentities:1,onUserAlias:1,copyUserAttributes:1};if(e){if(t===et&&(T(e.userIdentities)&&!Object.keys(e.userIdentities).length||!T(e.userIdentities)))return{valid:!1,error:a.Messages.ValidationMessages.ModifyIdentityRequestUserIdentitiesPresent};for(var n in e)if(e.hasOwnProperty(n)){if(!r[n])return{valid:!1,error:a.Messages.ValidationMessages.IdentityRequesetInvalidKey};if("onUserAlias"===n&&!tt.isFunction(e[n]))return{valid:!1,error:a.Messages.ValidationMessages.OnUserAliasType}}if(0===Object.keys(e).length)return{valid:!0};if(void 0===e.userIdentities)return{valid:!1,error:a.Messages.ValidationMessages.UserIdentities};if(null!==e.userIdentities&&!T(e.userIdentities))return{valid:!1,error:a.Messages.ValidationMessages.UserIdentities};if(T(e.userIdentities)&&Object.keys(e.userIdentities).length)for(var i in e.userIdentities)if(e.userIdentities.hasOwnProperty(i)){if(!1===ie.IdentityType.getIdentityType(i))return{valid:!1,error:a.Messages.ValidationMessages.UserIdentitiesInvalidKey};if("string"!=typeof e.userIdentities[i]&&null!==e.userIdentities[i])return{valid:!1,error:a.Messages.ValidationMessages.UserIdentitiesInvalidValues}}}return{valid:!0}}},rt=function(){function e(){}var t;return e.hashEventType=function(e){return P(e)},e.hashEventName=function(e,t){return P(t+e)},e.hashEventAttributeKey=function(e,t,r){return P(e+t+r)},e.hashUserAttribute=function(e){return P(e)},e.hashUserIdentity=function(e){return e},e.hashConsentPurpose=function(e,t){return P(e+t)},e.hashAttributeConditionalForwarding=function(e){return P(e).toString()},e.hashConsentPurposeConditionalForwarding=function(e,t){return this.hashConsentPurpose(e,t).toString()},t=e,e.filterUserAttributes=function(e,r){return Y(e,r,(function(e){return t.hashUserAttribute(e)}))},e.filterUserIdentities=function(e,r){return Y(e,r,(function(e){return t.hashUserIdentity(te.getIdentityType(e))}))},e.isFilteredUserAttribute=function(e,r){var n=t.hashUserAttribute(e);return r&&b(r,n)},e}(),nt=a.StorageNames;function it(e){var t=this;this.canLog=function(){return!(!e._Store.isEnabled||!e._Store.devToken&&!e._Store.webviewBridgeEnabled)},this.getFeatureFlag=function(t){return e._Store.SDKConfig.flags.hasOwnProperty(t)?e._Store.SDKConfig.flags[t]:null}
1,this.invokeCallback=function(r,n,i,o,s){r||e.Logger.warning("There is no callback provided");try{t.Validators.isFunction(r)&&r({httpCode:n,body:i,getUser:function(){return o||e.Identity.getCurrentUser()},getPreviousUser:function(){if(!s){var t=e.Identity.getUsers(),r=t.shift(),n=o||e.Identity.getCurrentUser();return r&&n&&r.getMPID()===n.getMPID()&&(r=t.shift()),r||null}return e.Identity.getUser(s)}})}catch(t){e.Logger.error("There was an error with your callback: "+t)}},this.invokeAliasCallback=function(r,n,i){r||e.Logger.warning("There is no callback provided");try{if(t.Validators.isFunction(r)){var o={httpCode:n};i&&(o.message=i),r(o)}}catch(t){e.Logger.error("There was an error with your callback: "+t)}},this.extend=function(){var e,r,n,i,o,s,a=arguments[0]||{},u=1,c=arguments.length,d=!1,l={hasOwn:Object.prototype.hasOwnProperty,class2type:{},type:function(e){return null==e?e+"":l.class2type[Object.prototype.toString.call(e)]||"object"},isPlainObject:function(e){if(!e||"object"!==l.type(e)||e.nodeType||l.isWindow(e))return!1;try{if(e.constructor&&!l.hasOwn.call(e,"constructor")&&!l.hasOwn.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(e){return!1}for(var t in e);return void 0===t||l.hasOwn.call(e,t)},isArray:Array.isArray||function(e){return"array"===l.type(e)},isFunction:function(e){return"function"===l.type(e)},isWindow:function(e){return null!=e&&e==e.window}};for("boolean"==typeof a&&(d=a,a=arguments[1]||{}
1,u=2),"object"===oe(a)||l.isFunction(a)||(a={}),c===u&&(a=this,--u);u<c;u++)if(null!=(e=arguments[u]))for(r in e)n=a[r],a!==(i=e[r])&&(d&&i&&(l.isPlainObject(i)||(o=l.isArray(i)))?(o?(o=!1,s=n&&l.isArray(n)?n:[]):s=n&&l.isPlainObject(n)?n:{},a[r]=t.extend(d,s,i)):void 0!==i&&(a[r]=i));return a},this.createServiceUrl=function(t,r){var n,i=window.mParticle&&e._Store.SDKConfig.forceHttps?"https://":window.location.protocol+"//";return n=e._Store.SDKConfig.forceHttps?"https://"+t:i+t,r&&(n+=r),n},this.createXHR=function(t){var r;try{r=new window.XMLHttpRequest}catch(t){e.Logger.error("Error creating XMLHttpRequest object.")}if(r&&t&&"withCredentials"in r)r.onreadystatechange=t;else if(void 0!==window.XDomainRequest){e.Logger.verbose("Creating XDomainRequest object");try{(r=new window.XDomainRequest).onload=t}catch(t){e.Logger.error("Error creating XDomainRequest object")}}return r},this.filterUserIdentities=function(e,r){var n=[];if(e&&Object.keys(e).length)for(var i in e)if(e.hasOwnProperty(i)){var o=ie.IdentityType.getIdentityType(i);if(!t.inArray(r,o)){var s={Type:o,Identity:e[i]};o===ie.IdentityType.CustomerId?n.unshift(s):n.push(s)}}return n},this.filterUserIdentitiesForForwarders=rt.filterUserIdentities,this.filterUserAttributes=rt.filterUserAttributes,this.isEventType=function(e){for(var t in ie.EventType)if(ie.EventType.hasOwnProperty(t)&&ie.EventType[t]===e)return!0;return!1},this.sanitizeAttributes=function(r,n){if(!r||!t.isObject(r))return null;var i={};for(var o in r)r.hasOwnProperty(o)&&t.Validators.isValidAttributeValue(r[o])?i[o]=r[o]:e.Logger.warning("For '"+n+"', the corresponding attribute value of '"+o+"' must be a string, number, boolean, or null.");return i},this.isDelayedByIntegration=function(t,r,n){if(n-r>e._Store.SDKConfig.integrationDelayTimeout)return!1;for(var i in t)if(!0===t[i])return!0;return!1},this.createMainStorageName=function(e){return e?nt.currentStorageName+"_"+e:nt.currentStorageName},this.createProductStorageName=function(e){return e?nt.currentStorageProductsName+"_"+e:nt.currentStorageProductsName},this.converted=V,this.findKeyInObject=I,this.parseNumber=E,this.inArray=b,this.isObject=T,this.decoded=x,this.parseStringOrNumber=k,this.generateHash=P,this.generateUniqueId=A,this.Validators=tt}var ot=a.Messages,st="mParticleAndroid",at="mParticle";function ut(e){var t=this;this.initializeSessionAttributes=function(e){var r=a.NativeSdkPaths.SetSessionAttribute,n=JSON.stringify({key:"$src_env",value:"webview"}),i=JSON.stringify({key:"$src_key",value:e});t.sendToNative(r,n),e&&t.sendToNative(r,i)},this.isBridgeV2Available=function(e){if(!e)return!1;var t=at+"_"+e+"_v2";return!!(window.webkit&&window.webkit.messageHandlers&&window.webkit.messageHandlers.hasOwnProperty(t))||!(!window.mParticle||!window.mParticle.uiwebviewBridgeName||window.mParticle.uiwebviewBridgeName!==t)||!!window.hasOwnProperty(st+"_"+e+"_v2")},this.isWebviewEnabled=function(r,n){return e._Store.bridgeV2Available=t.isBridgeV2Available(r),e._Store.bridgeV1Available=t.isBridgeV1Available(),2===n?e._Store.bridgeV2Available:!(window.mParticle&&window.mParticle.uiwebviewBridgeName&&window.mParticle.uiwebviewBridgeName!==at+"_"+r+"_v2")&&!!(2>n)&&(e._Store.bridgeV2Available||e._Store.bridgeV1Available)},this.isBridgeV1Available=function(){return!!(e._Store.SDKConfig.useNativeSdk||window.mParticleAndroid||e._Store.SDKConfig.isIOS)},this.sendToNative=function(r,n){return e._Store.bridgeV2Available&&2===e._Store.SDKConfig.minWebviewBridgeVersion||e._Store.bridgeV2Available&&2>e._Store.SDKConfig.minWebviewBridgeVersion?void t.sendViaBridgeV2(r,n,e._Store.SDKConfig.requiredWebviewBridgeName):e._Store.bridgeV1Available&&2>e._Store.SDKConfig.minWebviewBridgeVersion?void t.sendViaBridgeV1(r,n):void 0},this.sendViaBridgeV1=function(r,n){window.mParticleAndroid&&window.mParticleAndroid.hasOwnProperty(r)?(e.Logger.verbose(ot.InformationMessages.SendAndroid+r),window.mParticleAndroid[r](n)):e._Store.SDKConfig.isIOS&&(e.Logger.verbose(ot.InformationMessages.SendIOS+r),t.sendViaIframeToIOS(r,n))},this.sendViaIframeToIOS=function(e,t){var r=document.createElement("IF
1RAME");r.setAttribute("src","mp-sdk://"+e+"/"+encodeURIComponent(t)),document.documentElement.appendChild(r),r.parentNode.removeChild(r)},this.sendViaBridgeV2=function(r,n,i){if(i){var o,s,a=window[st+"_"+i+"_v2"],u=at+"_"+i+"_v2";return window.webkit&&window.webkit.messageHandlers&&window.webkit.messageHandlers[u]&&(o=window.webkit.messageHandlers[u]),e.uiwebviewBridgeName===u&&(s=e[u]),a&&a.hasOwnProperty(r)?(e.Logger.verbose(ot.InformationMessages.SendAndroid+r),void a[r](n)):void(o?(e.Logger.verbose(ot.InformationMessages.SendIOS+r),o.postMessage(JSON.stringify({path:r,value:n?JSON.parse(n):null}))):s&&(e.Logger.verbose(ot.InformationMessages.SendIOS+r),t.sendViaIframeToIOS(r,n)))}}}var ct=a.Messages.InformationMessages;function dt(e){var t=this;this.attemptCookieSync=function(r,n){var i=e._Store,o=i.pixelConfigurations,s=i.webviewBridgeEnabled;if(r&&!s){var a=e._Persistence.getPersistence();J(a)||o.forEach((function(i){var o,s,u=!1,c=i.filteringConsentRuleValues,d=i.pixelUrl,l=i.redirectUrl,g=i.moduleId,p=i.frequencyCap,v=(c||{}).values;if(!J(d)&&(J(v)||(u=!0),!u||!n)&&(0,e._Consent.isEnabledForUserConsent)(c,e.Identity.getCurrentUser())){var f=null!==(s=null===(o=a[r])||void 0===o?void 0:o.csd)&&void 0!==s?s:{},m=f[g]||null;if(lt(p,m)){var h=N(r,d,l);t.performCookieSync(h,g.toString(),r,f)}}}))}},this.performCookieSync=function(t,r,n,i){var o=document.createElement("img");e.Logger.verbose(ct.CookieSync),o.onload=function(){i[r]=(new Date).getTime(),e._Persistence.saveUserCookieSyncDatesToPersistence(n,i)},o.src=t}}var lt=function(e,t){return!t||(new Date).getTime()>new Date(t).getTime()+864e5*e},gt=a.IdentityMethods,pt=gt.Identify,vt=gt.Modify,ft=gt.Login,mt=gt.Logout,ht="x-mp-max-age",yt=function(e,t,r,n,i){if(!i){var o=Ct(null==n?void 0:n.cacheMaxAge);e===ft||e===pt?St(e,t,o,r,n):(e===vt||e===mt)&&r.purge()}},St=function(e,t,r,n,i){var o=i.responseText,s=i.status,a=n.retrieve()||{},u=P(bt(e,t)),c=o.mpid,d=o.is_logged_in;a[u]={responseText:JSON.stringify({mpid:c,is_logged_in:d}),status:s,expireTimestamp:r},n.store(a)},bt=function(e,t){var r="".concat(e,":").concat("device_application_stamp","=").concat(t.device_application_stamp,";"),n="";if(Object.keys(t).length){var i=[];for(var o in t)"device_application_stamp"!==o&&(i[ie.IdentityType.getIdentityType(o)]=t[o]);n=i.reduce((function(e,t,r){var n=ie.IdentityType.getIdentityName(r);return"".concat(e).concat(n,"=").concat(t,";")}),r)}return n},It=function(e,t){var r={};if(T(null==e?void 0:e.userIdentities))for(var n in e.userIdentities)r[n]=e.userIdentities[n];return r.device_application_stamp=t,r},_t=function(e){var t=e.retrieve()||{},r=(new Date).getTime();for(var n in t)t[n].expireTimestamp<r&&delete t[n];e.store(t)},Pt=function(e,t,r,n,i,o,s){var a=function(e,t,r){var n=null==r?void 0:r.retrieve();if(!n)return!1;var i=P(bt(e,t));return!(!n.hasOwnProperty(i)||n[i].expireTimestamp<(new Date).getTime())}(s,e,t);if(a){var u=function(e,t,r){var n=P(bt(e,t)),i=r.retrieve(),o=i?i[n]:null;return{responseText:wt(o.responseText),expireTimestamp:o.expireTimestamp,status:o.status}}(s,e,t);return r(u,n,i,o,s,e,!0),!0}return!1},Ct=function(e){return void 0===e&&(e=86400),(new Date).getTime()+1e3*e},wt=function(e){return e?JSON.parse(e):{}},At=function(e,t){if(!e||null==t||!t.userIdentities)return!1;var r=e.getUserIdentities().userIdentities,n=t.userIdentities;return JSON.stringify(r)!==JSON.stringify(n)},Tt=a.Messages;function Et(e){var t=this;this.initialize=function(){if(e._Store.sessionId){var r=6e4*e._Store.SDKConfig.sessionTimeout;if(new Date>new Date(e._Store.dateLastEventSent.getTime()+r))t.endSession(),t.startNewSession();else{var n=e.Identity.getCurrentUser(),i=e._Store.SDKConfig.identifyRequest;At(n,i)&&(e.Identity.identify(e._Store.SDKConfig.identifyRequest,e._Store.SDKConfig.identityCallback),e._Store.identifyCalled=!0,e._Store.SDKConfig.identityCallback=null)}}else t.startNewSession()}
1,this.getSession=function(){return e.Logger.warning(_("SessionManager.getSession()","SessionManager.getSessionId()")),this.getSessionId()},this.getSessionId=function(){return e._Store.sessionId},this.startNewSession=function(){if(e.Logger.verbose(Tt.InformationMessages.StartingNewSession),e._Helpers.canLog()){e._Store.sessionId=e._Helpers.generateUniqueId().toUpperCase();var r=e.Identity.getCurrentUser(),n=r?r.getMPID():null;if(n&&(e._Store.currentSessionMPIDs=[n]),!e._Store.sessionStartDate){var i=new Date;e._Store.sessionStartDate=i,e._Store.dateLastEventSent=i}t.setSessionTimer(),e._Store.identifyCalled||(e.Identity.identify(e._Store.SDKConfig.identifyRequest,e._Store.SDKConfig.identityCallback),e._Store.identifyCalled=!0,e._Store.SDKConfig.identityCallback=null),e._Events.logEvent({messageType:ie.MessageType.SessionStart})}else e.Logger.verbose(Tt.InformationMessages.AbandonStartSession)},this.endSession=function(r){var n,i,o,s,a;if(e.Logger.verbose(Tt.InformationMessages.StartingEndSession),r)return e._Events.logEvent({messageType:ie.MessageType.SessionEnd}),e._Store.nullifySession(),void(null===(n=e._timeOnSiteTimer)||void 0===n||n.resetTimer());if(!e._Helpers.canLog())return e.Logger.verbose(Tt.InformationMessages.AbandonEndSession),void(null===(i=e._timeOnSiteTimer)||void 0===i||i.resetTimer());var u,c=e._Persistence.getPersistence();if(!c||c.gs&&!c.gs.sid)return e.Logger.verbose(Tt.InformationMessages.NoSessionToEnd),void(null===(o=e._timeOnSiteTimer)||void 0===o||o.resetTimer());(c.gs.sid&&e._Store.sessionId!==c.gs.sid&&(e._Store.sessionId=c.gs.sid),null===(s=null==c?void 0:c.gs)||void 0===s?void 0:s.les)&&(u=6e4*e._Store.SDKConfig.sessionTimeout,(new Date).getTime()-c.gs.les<u?t.setSessionTimer():(e._Events.logEvent({messageType:ie.MessageType.SessionEnd}),e._Store.sessionStartDate=null,e._Store.nullifySession()));null===(a=e._timeOnSiteTimer)||void 0===a||a.resetTimer()},this.setSessionTimer=function(){var r=6e4*e._Store.SDKConfig.sessionTimeout;e._Store.globalTimer=window.setTimeout((function(){t.endSession()}),r)},this.resetSessionTimer=function(){e._Store.webviewBridgeEnabled||(!e._Store.sessionId&&t.startNewSession(),t.clearSessionTimeout(),t.setSessionTimer()),t.startNewSessionIfNeeded()},this.clearSessionTimeout=function(){clearTimeout(e._Store.globalTimer)},this.startNewSessionIfNeeded=function(){if(!e._Store.webviewBridgeEnabled){var r=e._Persistence.getPersistence();!e._Store.sessionId&&r&&(r.sid?e._Store.sessionId=r.sid:t.startNewSession())}}}var kt=a.Messages;function Dt(e){var t=this;this.convertTransactionAttributesToProductAction=function(e,t){e.hasOwnProperty("Id")&&(t.TransactionId=e.Id),e.hasOwnProperty("Affiliation")&&(t.Affiliation=e.Affiliation),e.hasOwnProperty("CouponCode")&&(t.CouponCode=e.CouponCode),e.hasOwnProperty("Revenue")&&(t.TotalAmount=this.sanitizeAmount(e.Revenue,"Revenue")),e.hasOwnProperty("Shipping")&&(t.ShippingAmount=this.sanitizeAmount(e.Shipping,"Shipping")),e.hasOwnProperty("Tax")&&(t.TaxAmount=this.sanitizeAmount(e.Tax,"Tax")),e.hasOwnProperty("Step")&&(t.CheckoutStep=e.Step),e.hasOwnProperty("Option")&&(t.CheckoutOptions=e.Option)},this.getProductActionEventName=function(e){switch(e){case ie.ProductActionType.AddToCart:return"AddToCart";case ie.ProductActionType.AddToWishlist:return"AddToWishlist";case ie.ProductActionType.Checkout:return"Checkout";case ie.ProductActionType.CheckoutOption:return"CheckoutOption";case ie.ProductActionType.Click:return"Click";case ie.ProductActionType.Purchase:return"Purchase";case ie.ProductActionType.Refund:return"Refund";case ie.ProductActionType.RemoveFromCart:return"RemoveFromCart";case ie.ProductActionType.RemoveFromWishlist:return"RemoveFromWishlist";case ie.ProductActionType.ViewDetail:return"ViewDetail";case ie.ProductActionType.Unknown:default:return"Unknown"}},this.getPromotionActionEventName=function(e){return e===ie.PromotionActionType.PromotionClick?"PromotionClick":e===ie.PromotionActionType.PromotionView?"PromotionView":"Unknown"},this.convertProductActionToEventType=function(t){return t===ie.ProductActionType.AddToCart?ie.CommerceEventType.ProductAddToCart:t===ie.ProductActionType.AddToWishlist?ie.CommerceEventType.ProductAddToWishlist:t===ie.ProductActionType.Checkout?ie.CommerceEventType.ProductCheckout:t===ie.ProductActionType.CheckoutOption?ie.CommerceEventType.ProductCheckoutOption:t===ie.ProductActionType.Click?ie.CommerceEventType.ProductClick:t===ie.ProductActionType.Purchase?ie.CommerceEventType.ProductPurchase:t===ie.ProductActionType.Refund?ie.CommerceEventType.ProductRefund:t===ie.ProductActionType.RemoveFromCart?ie.CommerceEventType.ProductRemoveFromCart:t===ie.ProductActionType.RemoveFromWishlist?ie.CommerceEventType.ProductRemoveFromWishlist:t===ie.ProductActionType.Unknown?ie.EventType.Unknown:t===ie.ProductActionType.ViewDetail?ie.CommerceEventType.ProductViewDetail:(e.Logger.error("Could not convert product action type "+t+" to event type"),null)},this.convertPromotionActionToEventType=function(t){return t===ie.PromotionActionType.PromotionClick?ie.CommerceEventType.PromotionClick:t===ie.PromotionActionType.PromotionView?ie.CommerceEventType.PromotionView:(e.Logger.error("Could not convert promotion action type "+t+" to event type"),null)},this.generateExpandedEcommerceName=function(e,t){return"eCommerce - "+e+" - "+(t?"Total":"Item")},this.extractProductAttributes=function(e,t){t.CouponCode&&(e["Coupon Code"]=t.CouponCode),t.Brand&&(e.Brand=t.Brand),t.Category&&(e.Category=t.Category),t.Name&&(e.Name=t.Name),t.Sku&&(e.Id=t.Sku),t.Price&&(e["Item Price"]=t.Price),t.Quantity&&(e.Quantity=t.Quantity),t.Position&&(e.Position=t.Position),t.Variant&&(e.Variant=t.Variant),e["Total Product Amount"]=t.TotalAmount||0},this.extractTransactionId=function(e,t){t.TransactionId&&(e["Transaction Id"]=t.TransactionId)},this.extractActionAttributes=function(e,r){t.extractTransactionId(e,r),r.Affiliation&&(e.Affiliation=r.Affiliation),r.CouponCode&&(e["Coupon Code"]=r.CouponCode),r.TotalAmount&&(e["Total Amount"]=r.TotalAmount),r.ShippingAmount&&(e["Shipping Amou
1nt"]=r.ShippingAmount),r.TaxAmount&&(e["Tax Amount"]=r.TaxAmount),r.CheckoutOptions&&(e["Checkout Options"]=r.CheckoutOptions),r.CheckoutStep&&(e["Checkout Step"]=r.CheckoutStep)},this.extractPromotionAttributes=function(e,t){t.Id&&(e.Id=t.Id),t.Creative&&(e.Creative=t.Creative),t.Name&&(e.Name=t.Name),t.Position&&(e.Position=t.Position)},this.buildProductList=function(e,t){return t?Array.isArray(t)?t:[t]:e.ShoppingCart.ProductList},this.createProduct=function(t,r,n,i,o,s,a,u,c,d){return d=e._Helpers.sanitizeAttributes(d,t),"string"!=typeof t?(e.Logger.error("Name is required when creating a product"),null):e._Helpers.Validators.isStringOrNumber(r)?e._Helpers.Validators.isStringOrNumber(n)?(n=e._Helpers.parseNumber(n),u&&!e._Helpers.Validators.isNumber(u)&&(e.Logger.error("Position must be a number, it will be set to null."),u=null),{Name:t,Sku:r,Price:n,Quantity:i=e._Helpers.Validators.isStringOrNumber(i)?e._Helpers.parseNumber(i):1,Brand:a,Variant:o,Category:s,Position:u,CouponCode:c,TotalAmount:i*n,Attributes:d}):(e.Logger.error("Price is required when creating a product, and must be a string or a number"),null):(e.Logger.error("SKU is required when creating a product, and must be a string or a number"),null)},this.createPromotion=function(t,r,n,i){return e._Helpers.Validators.isStringOrNumber(t)?{Id:t,Creative:r,Name:n,Position:i}:(e.Logger.error(kt.ErrorMessages.PromotionIdRequired),null)},this.createImpression=function(t,r){return"string"==typeof t?r?{Name:t,Product:r}:(e.Logger.error("Product is required when creating an impression."),null):(e.Logger.error("Name is required when creating an impression."),null)},this.createTransactionAttributes=function(t,r,n,i,o,s){return e._Helpers.Validators.isStringOrNumber(t)?{Id:t,Affiliation:r,CouponCode:n,Revenue:i,Shipping:o,Tax:s}:(e.Logger.error(kt.ErrorMessages.TransactionIdRequired),null)},this.expandProductImpression=function(r){var n=[];return r.ProductImpressions?(r.ProductImpressions.forEach((function(i){i.ProductList&&i.ProductList.forEach((function(o){var s=e._Helpers.extend(!1,{},r.EventAttributes);if(o.Attributes)for(var a in o.Attributes)s[a]=o.Attributes[a];t.extractProductAttributes(s,o),i.ProductImpressionList&&(s["Product Impression List"]=i.ProductImpressionList);var u=e._ServerModel.createEventObject({messageType:ie.MessageType.PageEvent,name:t.generateExpandedEcommerceName("Impression"),data:s,eventType:ie.EventType.Transaction});n.push(u)}))})),n):n},this.expandCommerceEvent=function(e){return e?t.expandProductAction(e).concat(t.expandPromotionAction(e)).concat(t.expandProductImpression(e)):null},this.expandPromotionAction=function(r){var n=[];return r.PromotionAction?(r.PromotionAction.PromotionList.forEach((function(i){var o=e._Helpers.extend(!1,{},r.EventAttributes);t.extractPromotionAttributes(o,i);var s=e._ServerModel.createEventObject({messageType:ie.MessageType.PageEvent,name:t.generateExpandedEcommerceName(ie.PromotionActionType.getExpansionName(r.PromotionAction.PromotionActionType)),data:o,eventType:ie.EventType.Transaction});n.push(s)})),n):n},this.expandProductAction=function(r){var n=[];if(!r.ProductAction)return n;var i=!1;if(r.ProductAction.ProductActionType===ie.ProductActionType.Purchase||r.ProductAction.ProductActionType===ie.ProductActionType.Refund){var o=e._Helpers.extend(!1,{},r.EventAttributes);o["Product Count"]=r.ProductAction.ProductList?r.ProductAction.ProductList.length:0,t.extractActionAttributes(o,r.ProductAction),r.CurrencyCode&&(o["Currency Code"]=r.CurrencyCode);var s=e._ServerModel.createEventObject({messageType:ie.MessageType.PageEvent,name:t.generateExpandedEcommerceName(ie.ProductActionType.getExpansionName(r.ProductAction.ProductActionType),!0),data:o,eventType:ie.EventType.Transaction});n.push(s)}else i=!0;var a=r.ProductAction.ProductList;return a?(a.forEach((function(o){var s=e._Helpers.extend(!1,r.EventAttributes,o.Attributes);i?t.extractActionAttributes(s,r.ProductAction):t.extractTransactionId(s,r.ProductAction),t.extractProductAttributes(s,o);var a=e._ServerModel.createEventObject({messageType:ie.MessageType.PageEvent,name:t.generateExpandedEcommerceName(ie.ProductActionType.getExpansionName(r.ProductAction.ProductActionType)),data:s,eventType:ie.EventType.Transaction});n.push(a)})),n):n},this.createCommerceEventObject=function(t,r){var n,i=e._Helpers.extend;return e.Logger.verbose(kt.InformationMessages.StartingLogCommerceEvent),e._Helpers.canLog()?((n=e._ServerModel.createEventObject({messageType:ie.MessageType.Commerce,sourceMessageId:null==r?void 0:r.sourceMessageId})).EventName="eCommerce - ",n.CurrencyCode=e._Store.currencyCode,n.ShoppingCart=[],n.CustomFlags=i(n.CustomFlags,t),n):(e.Logger.verbose(kt.InformationMessages.AbandonLogEvent),null)},this.sanitizeAmount=function(t,r){if(!e._Helpers.Validators.isStringOrNumber(t)){var n=[r,"must be of type number. A",oe(t),"was passed. Converting to 0"].join(" ");
1return e.Logger.warning(n),0}return e._Helpers.parseNumber(t)}}var Ut=function(){function e(e){this.isTrackerActive=!1,this.localStorageName="",this.startTime=0,this.totalTime=0,this.localStorageName="mprtcl-tos-".concat(e),this.timerVault=new Je(this.localStorageName),this.loadTimeFromStorage(),this.addHandlers(),!1===document.hidden&&this.startTracking()}return e.prototype.addHandlers=function(){var e=this;document.addEventListener("visibilitychange",(function(){return e.handleVisibilityChange()})),window.addEventListener("blur",(function(){return e.handleWindowBlur()})),window.addEventListener("focus",(function(){return e.handleWindowFocus()})),window.addEventListener("storage",(function(t){return e.syncAcrossTabs(t)})),window.addEventListener("beforeunload",(function(){return e.updateTimeInPersistence()}))},e.prototype.handleVisibilityChange=function(){document.hidden?this.stopTracking():this.startTracking()},e.prototype.handleWindowBlur=function(){this.isTrackerActive&&this.stopTracking()},e.prototype.handleWindowFocus=function(){this.isTrackerActive||this.startTracking()},e.prototype.syncAcrossTabs=function(e){if(e.key===this.localStorageName&&null!==e.newValue){var t=parseFloat(e.newValue)||0;this.totalTime=t}},e.prototype.updateTimeInPersistence=function(){this.isTrackerActive&&this.timerVault.store(Math.round(this.totalTime))},e.prototype.loadTimeFromStorage=function(){var e=this.timerVault.retrieve();K(e)&&null!==e&&(this.totalTime=e)},e.prototype.startTracking=function(){document.hidden||(this.startTime=Math.floor(performance.now()),this.isTrackerActive=!0)},e.prototype.stopTracking=function(){this.isTrackerActive&&(this.setTotalTime(),this.updateTimeInPersistence(),this.isTrackerActive=!1)},e.prototype.setTotalTime=function(){if(this.isTrackerActive){var e=Math.floor(performance.now());this.totalTime+=e-this.startTime,this.startTime=e}},e.prototype.getTimeInForeground=function(){return this.setTotalTime(),this.updateTimeInPersistence(),this.totalTime},e.prototype.resetTimer=function(){this.totalTime=0,this.updateTimeInPersistence()},e}();function Ot(e,t,r){var n=this,i=t._Helpers,o=i.createMainStorageName,s=i.createProductStorageName,u=t._NativeSdkHelpers.isWebviewEnabled,c={isEnabled:!0,sessionAttributes:{},currentSessionMPIDs:[],consentState:null,sessionId:null,isFirstRun:null,clientId:null,deviceId:null,devToken:null,serverSettings:{},dateLastEventSent:null,sessionStartDate:null,currentPosition:null,isTracking:!1,watchPositionId:null,cartProducts:[],eventQueue:[],currencyCode:null,globalTimer:null,context:null,configurationLoaded:!1,identityCallInFlight:!1,SDKConfig:{},nonCurrentUserMPIDs:{},identifyCalled:!1,isLoggedIn:!1,cookieSyncDates:{},integrationAttributes:{},requireDelay:!0,isLocalStorageAvailable:null,storageName:null,prodStorageName:null,activeForwarders:[],kits:{},sideloadedKits:[],configuredForwarders:[],pixelConfigurations:[],wrapperSDKInfo:{name:"none",version:null,isInfoSet:!1},persistenceData:{gs:{}}};for(var d in c)this[d]=c[d];if(this.devToken=r||null,this.integrationDelayTimeoutStart=Date.now(),this.SDKConfig=function(e){var t={};for(var r in a.DefaultConfig)a.DefaultConfig.hasOwnProperty(r)&&(t[r]=a.DefaultConfig[r]);if(e)for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);for(var r in a.DefaultBaseUrls)t[r]=a.DefaultBaseUrls[r];return t}(e),e){e.hasOwnProperty("flags")||(this.SDKConfig.flags={}),this.SDKConfig.flags=Lt(e),e.deviceId&&(this.deviceId=e.deviceId),this.SDKConfig.isDevelopmentMode=!!e.hasOwnProperty("isDevelopmentMode")&&R(e.isDevelopmentMode);var l=Mt(e,this.SDKConfig.flags,r);for(var g in l)this.SDKConfig[g]=l[g];if(e.hasOwnProperty("logLevel")&&(this.SDKConfig.logLevel=e.logLevel),this.SDKConfig.useNativeSdk=!!e.useNativeSdk,this.SDKConfig.kits=e.kits||{},this.SDKConfig.sideloadedKits=e.sideloadedKits||[],this.SDKConfig.isIOS=e.hasOwnProperty("isIOS")?e.isIOS:!(!window.mParticle||!window.mParticle.isIOS)&&window.mParticle.isIOS,this.SDKConfig.useCookieStorage=!!e.hasOwnProperty("useCookieStorage")&&e.useCookieStorage,this.SDKConfig.maxProducts=e.hasOwnProperty("maxProducts")?e.maxProducts:a.DefaultConfig.maxProducts,this.SDKConfig.maxCookieSize=e.hasOwnProperty("maxCookieSize")?e.maxCookieSize:a.DefaultConfig.maxCookieSize,e.hasOwnProperty("appName")&&(this.SDKConfig.appName=e.appName),e.hasOwnProperty("package")&&(this.SDKConfig.package=e.package),this.SDKConfig.integrationDelayTimeout=e.hasOwnProperty("integrationDelayTimeout")?e.integrationDelayTimeout:a.DefaultConfig.integrationDelayTimeout,e.hasOwnProperty("identifyRequest")&&(this.SDKConfig.identifyRequest=e.identifyRequest),e.hasOwnProperty("identityCallback")){var p=e.identityCallback;t._Helpers.Validators.isFunction(p)?this.SDKConfig.identityCallback=e.identityCallback:t.Logger.w
1arning("The optional callback must be a function. You tried entering a(n) "+oe(p)+" . Callback not set. Please set your callback again.")}if(e.hasOwnProperty("appVersion")&&(this.SDKConfig.appVersion=e.appVersion),e.hasOwnProperty("appName")&&(this.SDKConfig.appName=e.appName),e.hasOwnProperty("sessionTimeout")&&(this.SDKConfig.sessionTimeout=e.sessionTimeout),e.hasOwnProperty("dataPlan")){this.SDKConfig.dataPlan={PlanVersion:null,PlanId:null};var v=e.dataPlan;v.planId&&(B(v.planId)?this.SDKConfig.dataPlan.PlanId=v.planId:t.Logger.error("Your data plan id must be a string and match the data plan slug format (i.e. under_case_slug)")),v.planVersion&&(K(v.planVersion)?this.SDKConfig.dataPlan.PlanVersion=v.planVersion:t.Logger.error("Your data plan version must be a number"))}else this.SDKConfig.dataPlan={};if(this.SDKConfig.forceHttps=!e.hasOwnProperty("forceHttps")||e.forceHttps,this.SDKConfig.customFlags=e.customFlags||{},this.SDKConfig.minWebviewBridgeVersion=e.hasOwnProperty("minWebviewBridgeVersion")?e.minWebviewBridgeVersion:1,this.SDKConfig.aliasMaxWindow=e.hasOwnProperty("aliasMaxWindow")?e.aliasMaxWindow:a.DefaultConfig.aliasMaxWindow,e.hasOwnProperty("dataPlanOptions")){var f=e.dataPlanOptions;f.hasOwnProperty("dataPlanVersion")&&f.hasOwnProperty("blockUserAttributes")&&f.hasOwnProperty("blockEventAttributes")&&f.hasOwnProperty("blockEvents")&&f.hasOwnProperty("blockUserIdentities")||t.Logger.error('Ensure your config.dataPlanOptions object has the following keys: a "dataPlanVersion" object, and "blockUserAttributes", "blockEventAttributes", "blockEvents", "blockUserIdentities" booleans')}e.hasOwnProperty("onCreateBatch")&&("function"==typeof e.onCreateBatch?this.SDKConfig.onCreateBatch=e.onCreateBatch:(t.Logger.error("config.onCreateBatch must be a function"),this.SDKConfig.onCreateBatch=void 0))}this._getFromPersistence=function(e,t){return e?(n.syncPersistenceData(),n.persistenceData&&n.persistenceData[e]&&n.persistenceData[e][t]?n.persistenceData[e][t]:null):null},this._setPersistence=function(e,r,i){var o;e&&(n.syncPersistenceData(),n.persistenceData&&(n.persistenceData[e]?n.persistenceData[e][r]=i:n.persistenceData[e]=((o={})[r]=i,o),T(n.persistenceData[e][r])&&J(n.persistenceData[e][r])&&delete n.persistenceData[e][r],t._Persistence.savePersistence(n.persistenceData)))},this.hasInvalidIdentifyRequest=function(){var e=n.SDKConfig.identifyRequest;return T(e)&&T(e.userIdentities)&&J(e.userIdentities)||!e},this.getConsentState=function(e){var r=t._Consent.ConsentSerialization.fromMinifiedJsonObject,i=n._getFromPersistence(e,"con");return J(i)?null:r(i)},this.setConsentState=function(e,r){var i=t._Consent.ConsentSerialization.toMinifiedJsonObject;(r||null===r)&&n._setPersistence(e,"con",i(r))},this.getDeviceId=function(){return n.deviceId},this.setDeviceId=function(e){n.deviceId=e,n.persistenceData.gs.das=e,t._Persistence.update()},this.getFirstSeenTime=function(e){return n._getFromPersistence(e,"fst")},this.setFirstSeenTime=function(e,t){if(e){var r=t||(new Date).getTime();n._setPersistence(e,"fst",r)}},this.getLastSeenTime=function(e){if(!e)return null;var r=t.Identity.getCurrentUser();return e===(null==r?void 0:r.getMPID())?(new Date).getTime():n._getFromPersistence(e,"lst")},this.setLastSeenTime=function(e,t){if(e){var r=t||(new Date).getTime();n._setPersistence(e,"lst",r)}},this.syncPersistenceData=function(){var e=t._Persistence.getPersistence();n.persistenceData=t._Helpers.extend({},n.persistenceData,e)},this.getUserAttributes=function(e){return n._getFromPersistence(e,"ua")||{}},this.setUserAttributes=function(e,t){return n._setPersistence(e,"ua",t)},this.getUserIdentities=function(e){return n._getFromPersistence(e,"ui")||{}},this.setUserIdentities=function(e,t){n._setPersistence(e,"ui",t)},this.addMpidToSessionHistory=function(e,t){var r=n.currentSessionMPIDs.indexOf(e);return e&&t!==e&&0>r?void n.currentSessionMPIDs.push(e):void(0<=r&&(n.currentSessionMPIDs=z(n.currentSessionMPIDs,r)))},this.nullifySession=function(){n.sessionId=null,n.dateLastEventSent=null,n.sessionAttributes={}
1,t._Persistence.update()},this.processConfig=function(e){var i=e.workspaceToken,a=e.requiredWebviewBridgeName;n.SDKConfig.flags=Lt(e);var c=Mt(e,n.SDKConfig.flags,r);for(var d in c)n.SDKConfig[d]=c[d];i?(n.SDKConfig.workspaceToken=i,t._timeOnSiteTimer=new Ut(i)):t.Logger.warning("You should have a workspaceToken on your config object for security purposes."),n.storageName=o(i),n.prodStorageName=s(i),n.SDKConfig.requiredWebviewBridgeName=a||i,n.webviewBridgeEnabled=u(n.SDKConfig.requiredWebviewBridgeName,n.SDKConfig.minWebviewBridgeVersion),n.configurationLoaded=!0}}function Lt(e){var t={},r=a.FeatureFlags,n=r.ReportBatching,i=r.EventBatchingIntervalMillis,o=r.OfflineStorage,s=r.DirectUrlRouting,u=r.CacheIdentity,c=r.AudienceAPI,d=r.CaptureIntegrationSpecificIds,l=r.AstBackgroundEvents;return e.flags?(t[n]=e.flags[n]||!1,t[i]=E(e.flags[i])||a.DefaultConfig.uploadInterval,t[o]=e.flags[o]||"0",t[s]="True"===e.flags[s],t[u]="True"===e.flags[u],t[c]="True"===e.flags[c],t[d]="True"===e.flags[d],t[l]="True"===e.flags[l],t):{}}function Mt(e,t,r){return r?t.directURLRouting?function(e,t){var r=a.DefaultBaseUrls,n={},i=t.split("-"),o=1>=i.length?"us1":i[0];for(var s in r)if("configUrl"!=s)if(e.hasOwnProperty(s))n[s]=e[s];else{var u=r[s].split(".");n[s]=m([u[0],o],u.slice(1),!0).join(".")}else n[s]=e[s]||r[s];return n}(e,r):function(e){var t=a.DefaultBaseUrls,r=a.CNAMEUrlPaths,n={};if(!J(e.domain)){for(var i in r)n[i]="".concat(e.domain).concat(r[i]);return n}for(var o in t)n[o]=e[o]||t[o];return n}(e):{}}function Ft(e){var t=this,r=e.logLevel||"warning";this.logger=e.hasOwnProperty("logger")?e.logger:new Nt,this.verbose=function(e){"none"!==r&&t.logger.verbose&&"verbose"===r&&t.logger.verbose(e)},this.warning=function(e){"none"!==r&&t.logger.warning&&("verbose"===r||"warning"===r)&&t.logger.warning(e)},this.error=function(e){"none"!==r&&t.logger.error&&t.logger.error(e)},this.setLogLevel=function(e){r=e}}function Nt(){this.verbose=function(e){console&&console.info&&console.info(e)},this.error=function(e){console&&console.error&&console.error(e)},this.warning=function(e){console&&console.warn&&console.warn(e)}}var Rt=s.Base64,xt=a.Messages,Vt=a.Base64CookieKeys,Ht=a.SDKv2NonMPIDCookieKeys,Kt=a.StorageNames;function jt(e){function t(t){var r=e._Store;return t.gs.sid=r.sessionId,t.gs.ie=r.isEnabled,t.gs.sa=r.sessionAttributes,t.gs.ss=r.serverSettings,t.gs.dt=r.devToken,t.gs.les=r.dateLastEventSent?r.dateLastEventSent.getTime():null,t.gs.av=r.SDKConfig.appVersion,t.gs.cgid=r.clientId,t.gs.das=r.deviceId,t.gs.c=r.context,t.gs.ssd=r.sessionStartDate?r.sessionStartDate.getTime():0,t.gs.ia=r.integrationAttributes,t}function r(e){localStorage.removeItem(e)}function n(e,t,r){return i.encodePersistence(JSON.stringify(e))+";expires="+t+";path=/"+r}var i=this;this.useLocalStorage=function(){return!e._Store.SDKConfig.useCookieStorage&&e._Store.isLocalStorageAvailable},this.initializeStorage=function(){try{var t,r,n=i.getLocalStorage(),o=i.getCookie();n||o?e._Store.isFirstRun=!1:(e._Store.isFirstRun=!0,e._Store.mpid=0),e._Store.isLocalStorageAvailable||(e._Store.SDKConfig.useCookieStorage=!0),e._Store.isLocalStorageAvailable?(t=window.localStorage,e._Store.SDKConfig.useCookieStorage?(n?(r=o?e._Helpers.extend(!1,n,o):n,t.removeItem(e._Store.storageName)):o&&(r=o),i.storeDataInMemory(r)):o?(r=n?e._Helpers.extend(!1,n,o):o,i.storeDataInMemory(r),i.expireCookies(e._Store.storageName)):i.storeDataInMemory(n)):i.storeDataInMemory(o);try{if(e._Store.isLocalStorageAvailable){var s=localStorage.getItem(e._Store.prodStorageName);if(s)var a=JSON.parse(Rt.decode(s));e._Store.mpid&&i.storeProductsInMemory(a,e._Store.mpid)}}catch(t){e._Store.isLocalStorageAvailable&&localStorage.removeItem(e._Store.prodStorageName),e._Store.cartProducts=[],e.Logger.error("Error loading products in initialization: "+t)}for(var u in r)r.hasOwnProperty(u)&&(Ht[u]||(e._Store.nonCurrentUserMPIDs[u]=r[u]));i.update()}catch(t){i.useLocalStorage()&&e._Store.isLocalStorageAvailable?localStorage.removeItem(e._Store.storageName):i.expireCookies(e._Store.storageName),e.Logger.error("Error initializing storage: "+t)}},this.update=function(){e._Store.webviewBridgeEnabled||(e._Store.SDKConfig.useCookieStorage&&i.setCookie(),i.setLocalStorage())},this.storeProductsInMemory=function(t,r){if(t)try{e._Store.cartProducts=t[r]&&t[r].cp?t[r].cp:[]}catch(t){e.Logger.error(xt.ErrorMessages.CookieParseError)}},this.storeDataInMemory=function(t,r){try{t?(e._Store.mpid=r||(t.cu||0),t.gs=t.gs||{},e._Store.sessionId=t.gs.sid||e._Store.sessionId,e._Store.isEnabled=void 0===t.gs.ie?e._Store.isEnabled:t.gs.ie,e._Store.sessionAttributes=t.gs.sa||e._Store.sessionAttributes,e._Store.serverSettings=t.gs.ss||e._Store.serverSettings,e._Store.devToken=e._Store.devToken||t.gs.dt,e._Store.SDKConfig.appVersion=e._Store.SDKConfig.appVersion||t.gs.av,e._Store.clientId=t.gs.cgid||e._Store.clientId||e._Helpers.generateUniqueId(),e._Store.deviceId=e._Store.deviceId||t.gs.das||e._Helpers.generateUniqueId(),e._Store.integrationAttributes=t.gs.ia||{},e._Store.context=t.gs.c||e._Store.context,e._Store.currentSessionMPIDs=t.gs.csm||e._Store.currentSessionMPIDs,e._Store.isLoggedIn=!0===t.l,t.gs.les&&(e._Store.dateLastEventSent=new Date(t.gs.les)),e._Store.sessionStartDate=t.gs.ssd?new Date(t.gs.ssd):new Date,t=r?t[r]:t[t.cu]):(e.Logger.verbose(xt.InformationMessages.CookieNotFound),e._Store.clientId=e._Store.clientId||e._Helpers.generateUniqueId(),e._Store.deviceId=e._Store.deviceId||e._Helpers.generateUniqueId())}catch(t){e.Logger.error(xt.ErrorMessages.CookieParseError)}},this.determineLocalStorageAvailability=function(e){var t;
1window.mParticle&&window.mParticle._forceNoLocalStorage&&(e=void 0);try{return e.setItem("mparticle","test"),t="test"===e.getItem("mparticle"),e.removeItem("mparticle"),t&&e}catch(e){return!1}},this.getUserProductsFromLS=function(t){if(!e._Store.isLocalStorageAvailable)return[];var r,n,i=localStorage.getItem(e._Store.prodStorageName);if(i&&(r=Rt.decode(i)),!t)return[];try{return r&&(n=JSON.parse(r)),r&&n[t]&&n[t].cp&&Array.isArray(n[t].cp)?n[t].cp:[]}catch(e){return[]}},this.getAllUserProductsFromLS=function(){var t,r,n=localStorage.getItem(e._Store.prodStorageName);n&&(t=Rt.decode(n));try{r=JSON.parse(t)}catch(e){r={}}return r},this.setLocalStorage=function(){if(e._Store.isLocalStorageAvailable){var r=e._Store.storageName,n=i.getAllUserProductsFromLS(),o=i.getLocalStorage()||{},s=e.Identity.getCurrentUser(),a=s?s.getMPID():null,u={cp:n[a]?n[a].cp:[]};if(a){(n=n||{})[a]=u;try{window.localStorage.setItem(encodeURIComponent(e._Store.prodStorageName),Rt.encode(JSON.stringify(n)))}catch(t){e.Logger.error("Error with setting products on localStorage.")}}if(!e._Store.SDKConfig.useCookieStorage){o.gs=o.gs||{},o.l=e._Store.isLoggedIn?1:0,e._Store.sessionId&&(o.gs.csm=e._Store.currentSessionMPIDs),o.gs.ie=e._Store.isEnabled,a&&(o.cu=a),Object.keys(e._Store.nonCurrentUserMPIDs).length&&(o=e._Helpers.extend({},o,e._Store.nonCurrentUserMPIDs),e._Store.nonCurrentUserMPIDs={}),o=t(o);try{window.localStorage.setItem(encodeURIComponent(r),i.encodePersistence(JSON.stringify(o)))}catch(t){e.Logger.error("Error with setting localStorage item.")}}}},this.getLocalStorage=function(){if(!e._Store.isLocalStorageAvailable)return null;var t,r=e._Store.storageName,n=i.decodePersistence(window.localStorage.getItem(r)),o={};if(n)for(t in n=JSON.parse(n))n.hasOwnProperty(t)&&(o[t]=n[t]);return Object.keys(o).length?o:null},this.expireCookies=function(e){var t,r,n,o=new Date;r=""===(n=i.getCookieDomain())?"":";domain="+n,o.setTime(o.getTime()-864e5),t="; expires="+o.toUTCString(),document.cookie=e+"="+t+"; path=/"+r},this.getCookie=function(){var t,r,n,o,s,a,u=e._Store.storageName,c=u?void 0:{};e.Logger.verbose(xt.InformationMessages.CookieSearch);try{t=window.document.cookie.split("; ")}catch(t){return e.Logger.verbose("Unable to parse undefined cookie"),null}for(r=0,n=t.length;r<n;r++){try{s=(o=t[r].split("=")).shift(),a=o.join("=")}catch(t){e.Logger.verbose("Unable to parse cookie: "+s+". Skipping.")}if(u&&u===s){c=e._Helpers.converted(a);break}u||(c[s]=e._Helpers.converted(a))}return c?(e.Logger.verbose(xt.InformationMessages.CookieFound),JSON.parse(i.decodePersistence(c))):null},this.setCookie=function(){var r,n=e.Identity.getCurrentUser();n&&(r=n.getMPID());var o,s,a,u=new Date,c=e._Store.storageName,d=i.getCookie()||{},l=new Date(u.getTime()+24*e._Store.SDKConfig.cookieExpiration*60*60*1e3).toGMTString();s=""===(o=i.getCookieDomain())?"":";domain="+o,d.gs=d.gs||{},e._Store.sessionId&&(d.gs.csm=e._Store.currentSessionMPIDs),r&&(d.cu=r),d.l=e._Store.isLoggedIn?1:0,d=t(d),Object.keys(e._Store.nonCurrentUserMPIDs).length&&(d=e._Helpers.extend({},d,e._Store.nonCurrentUserMPIDs),e._Store.nonCurrentUserMPIDs={}),a=i.reduceAndEncodePersistence(d,l,s,e._Store.SDKConfig.maxCookieSize),e.Logger.verbose(xt.InformationMessages.CookieSet),window.document.cookie=encodeURIComponent(c)+"="+a},this.reduceAndEncodePersistence=function(t,r,i,o){var s,a=t.gs.csm?t.gs.csm:[];if(a.length){var u={};for(var c in t)t.hasOwnProperty(c)&&(Ht[c]||c===t.cu||(u[c]=1));if(Object.keys(u).length)for(var d in u)(s=n(t,r,i)).length>o&&u.hasOwnProperty(d)&&-1===a.indexOf(d)&&delete t[d];for(var l,g=0;g<a.length&&(s=n(t,r,i)).length>o;g++)t[l=a[g]]?(e.Logger.verbose("Size of new encoded cookie is larger than maxCookieSize setting of "+o+". Removing from cookie the earliest logged in MPID containing: "+JSON.stringify(t[l],0,2)),delete t[l]):e.Logger.error("Unable to save MPID data to cookies because the resulting encoded cookie is larger than the maxCookieSize setting of "+o+". We recommend using a maxCookieSize of 1500.")}else for(var p in t)t.hasOwnProperty(p)&&((s=n(t,r,i)).length>o&&!Ht[p]&&p!==t.cu&&delete t[p]);return s}
1,this.findPrevCookiesBasedOnUI=function(t){var r,n=e._Persistence.getPersistence();if(t)for(var o in t.userIdentities)if(n&&Object.keys(n).length)for(var s in n)if(n[s].mpid){var a=n[s].ui;for(var u in a)if(o===u&&t.userIdentities[o]===a[u]){r=s;break}}r&&i.storeDataInMemory(n,r)},this.encodePersistence=function(t){for(var r in(t=JSON.parse(t)).gs)t.gs.hasOwnProperty(r)&&(Vt[r]?t.gs[r]&&(Array.isArray(t.gs[r])&&t.gs[r].length||e._Helpers.isObject(t.gs[r])&&Object.keys(t.gs[r]).length)?t.gs[r]=Rt.encode(JSON.stringify(t.gs[r])):delete t.gs[r]:"ie"===r?t.gs[r]=t.gs[r]?1:0:!t.gs[r]&&delete t.gs[r]);for(var n in t)if(t.hasOwnProperty(n)&&!Ht[n])for(r in t[n])t[n].hasOwnProperty(r)&&Vt[r]&&(e._Helpers.isObject(t[n][r])&&Object.keys(t[n][r]).length?t[n][r]=Rt.encode(JSON.stringify(t[n][r])):delete t[n][r]);return y(JSON.stringify(t))},this.decodePersistence=function(t){try{if(t){if(t=JSON.parse(S(t)),e._Helpers.isObject(t)&&Object.keys(t).length){for(var r in t.gs)t.gs.hasOwnProperty(r)&&(Vt[r]?t.gs[r]=JSON.parse(Rt.decode(t.gs[r])):"ie"===r&&(t.gs[r]=!!t.gs[r]));for(var n in t)if(t.hasOwnProperty(n))if(Ht[n])"l"===n&&(t[n]=!!t[n]);else for(r in t[n])t[n].hasOwnProperty(r)&&Vt[r]&&t[n][r].length&&(t[n][r]=JSON.parse(Rt.decode(t[n][r])))}return JSON.stringify(t)}}catch(t){e.Logger.error("Problem with decoding cookie",t)}},this.getCookieDomain=function(){if(e._Store.SDKConfig.cookieDomain)return e._Store.SDKConfig.cookieDomain;var t=i.getDomain(document,location.hostname);return""===t?"":"."+t},this.getDomain=function(e,t){var r,n,i=t.split(".");for(r=i.length-1;0<=r;r--)if(n=i.slice(r).join("."),e.cookie="mptest=cookie;domain=."+n+";",-1<e.cookie.indexOf("mptest=cookie"))return e.cookie="mptest=;domain=."+n+";expires=Thu, 01 Jan 1970 00:00:01 GMT;",n;return""},this.getCartProducts=function(t){var r,n=localStorage.getItem(e._Store.prodStorageName);return n&&((r=JSON.parse(Rt.decode(n)))&&r[t]&&r[t].cp)?r[t].cp:[]},this.setCartProducts=function(t){if(e._Store.isLocalStorageAvailable)try{window.localStorage.setItem(encodeURIComponent(e._Store.prodStorageName),Rt.encode(JSON.stringify(t)))}catch(t){e.Logger.error("Error with setting products on localStorage.")}},this.saveUserCookieSyncDatesToPersistence=function(e,t){if(t){var r=i.getPersistence();r&&(r[e]?r[e].csd=t:r[e]={csd:t}),i.savePersistence(r)}},this.swapCurrentUser=function(e,t,r){if(e&&t&&e!==t){var n=i.getPersistence();n&&(n.cu=t,n.gs.csm=r,i.savePersistence(n))}},this.savePersistence=function(t){var r,n=i.encodePersistence(JSON.stringify(t)),o=new Date,s=e._Store.storageName,a=new Date(o.getTime()+24*e._Store.SDKConfig.cookieExpiration*60*60*1e3).toGMTString(),u=i.getCookieDomain();if(r=""===u?"":";domain="+u,e._Store.SDKConfig.useCookieStorage){var c=i.reduceAndEncodePersistence(t,a,r,e._Store.SDKConfig.maxCookieSize);window.document.cookie=encodeURIComponent(s)+"="+c}else e._Store.isLocalStorageAvailable&&localStorage.setItem(e._Store.storageName,n)},this.getPersistence=function(){return this.useLocalStorage()?this.getLocalStorage():this.getCookie()},this.getFirstSeenTime=function(e){if(!e)return null;var t=i.getPersistence();return t&&t[e]&&t[e].fst?t[e].fst:null},this.setFirstSeenTime=function(e,t){if(e){t||(t=(new Date).getTime());var r=i.getPersistence();r&&(!r[e]&&(r[e]={}),!r[e].fst&&(r[e].fst=t,i.savePersistence(r)))}},this.getLastSeenTime=function(t){if(!t)return null;if(t===e.Identity.getCurrentUser().getMPID())return(new Date).getTime();var r=i.getPersistence();return r&&r[t]&&r[t].lst?r[t].lst:null},this.setLastSeenTime=function(e,t){if(e){t||(t=(new Date).getTime());var r=i.getPersistence();r&&r[e]&&(r[e].lst=t,i.savePersistence(r))}},this.getDeviceId=function(){return e._Store.deviceId},this.setDeviceId=function(t){e._Store.deviceId=t,i.update()},this.resetPersistence=function(){r(Kt.localStorageName),r(Kt.localStorageNameV3),r(Kt.localStorageNameV4),r(e._Store.prodStorageName),r(e._Store.storageName),r(Kt.localStorageProductsV4),i.expireCookies(Kt.cookieName),i.expireCookies(Kt.cookieNameV2),i.expireCookies(Kt.cookieNameV3),i.expireCookies(Kt.cookieNameV4),i.expireCookies(e._Store.prodStorageName),i.expireCookies(e._Store.storageName),mParticle._isTestEnv&&(r(e._Helpers.createMainStorageName("abcdef")),i.expireCookies(e._Helpers.createMainStorageName("abcdef")),r(e._Helpers.createProductStorageName("abcdef")))},this.forwardingStatsBatches={uploadsTable:{},forwardingStatsEventQueue:[]}}var qt=a.Messages;function Bt(e){var t=this;this.logEvent=function(t,r){if(e.Logger.verbose(qt.InformationMessages.StartingLogEvent+": "+t.name),e._Helpers.canLog()){var n=e._ServerModel.createEventObject(t);e._APIClient.sendEventToServer(n,r)}else e.Logger.verbose(qt.InformationMessages.AbandonLogEvent)},this.startTracking=function(t){function r(t,r){if(t)try{r?t(r):t()}catch(t){e.Logger.error("Error invoking the callback passed to startTrackingLocation."),e.Logger.error(t)}}
1if(e._Store.isTracking){var n={coords:{latitude:e._Store.currentPosition.lat,longitude:e._Store.currentPosition.lng}};r(t,n)}else"geolocation"in navigator&&(e._Store.watchPositionId=navigator.geolocation.watchPosition((function(n){e._Store.currentPosition={lat:n.coords.latitude,lng:n.coords.longitude},r(t,n),t=null,e._Store.isTracking=!0}),(function(){r(t),t=null,e._Store.isTracking=!1})))},this.stopTracking=function(){e._Store.isTracking&&(navigator.geolocation.clearWatch(e._Store.watchPositionId),e._Store.currentPosition=null,e._Store.isTracking=!1)},this.logOptOut=function(){e.Logger.verbose(qt.InformationMessages.StartingLogOptOut);var t=e._ServerModel.createEventObject({messageType:ie.MessageType.OptOut,eventType:ie.EventType.Other});e._APIClient.sendEventToServer(t)},this.logAST=function(){t.logEvent({messageType:ie.MessageType.AppStateTransition})},this.logCheckoutEvent=function(r,n,i,o){var s=e._Ecommerce.createCommerceEventObject(o);s&&(s.EventName+=e._Ecommerce.getProductActionEventName(ie.ProductActionType.Checkout),s.EventCategory=ie.CommerceEventType.ProductCheckout,s.ProductAction={ProductActionType:ie.ProductActionType.Checkout,CheckoutStep:r,CheckoutOptions:n,ProductList:[]},t.logCommerceEvent(s,i))},this.logProductActionEvent=function(r,n,i,o,s,a){var u=e._Ecommerce.createCommerceEventObject(o,a),c=Array.isArray(n)?n:[n];c.forEach((function(t){t.TotalAmount&&(t.TotalAmount=e._Ecommerce.sanitizeAmount(t.TotalAmount,"TotalAmount")),t.Position&&(t.Position=e._Ecommerce.sanitizeAmount(t.Position,"Position")),t.Price&&(t.Price=e._Ecommerce.sanitizeAmount(t.Price,"Price")),t.Quantity&&(t.Quantity=e._Ecommerce.sanitizeAmount(t.Quantity,"Quantity"))})),u&&(u.EventCategory=e._Ecommerce.convertProductActionToEventType(r),u.EventName+=e._Ecommerce.getProductActionEventName(r),u.ProductAction={ProductActionType:r,ProductList:c},e._Helpers.isObject(s)&&e._Ecommerce.convertTransactionAttributesToProductAction(s,u.ProductAction),t.logCommerceEvent(u,i,a))},this.logPurchaseEvent=function(r,n,i,o){var s=e._Ecommerce.createCommerceEventObject(o);s&&(s.EventName+=e._Ecommerce.getProductActionEventName(ie.ProductActionType.Purchase),s.EventCategory=ie.CommerceEventType.ProductPurchase,s.ProductAction={ProductActionType:ie.ProductActionType.Purchase},s.ProductAction.ProductList=e._Ecommerce.buildProductList(s,n),e._Ecommerce.convertTransactionAttributesToProductAction(r,s.ProductAction),t.logCommerceEvent(s,i))},this.logRefundEvent=function(r,n,i,o){if(r){var s=e._Ecommerce.createCommerceEventObject(o);s&&(s.EventName+=e._Ecommerce.getProductActionEventName(ie.ProductActionType.Refund),s.EventCategory=ie.CommerceEventType.ProductRefund,s.ProductAction={ProductActionType:ie.ProductActionType.Refund},s.ProductAction.ProductList=e._Ecommerce.buildProductList(s,n),e._Ecommerce.convertTransactionAttributesToProductAction(r,s.ProductAction),t.logCommerceEvent(s,i))}else e.Logger.error(qt.ErrorMessages.TransactionRequired)},this.logPromotionEvent=function(r,n,i,o,s){var a=e._Ecommerce.createCommerceEventObject(o);a&&(a.EventName+=e._Ecommerce.getPromotionActionEventName(r),a.EventCategory=e._Ecommerce.convertPromotionActionToEventType(r),a.PromotionAction={PromotionActionType:r,PromotionList:Array.isArray(n)?n:[n]},t.logCommerceEvent(a,i,s))},this.logImpressionEvent=function(r,n,i,o){var s=e._Ecommerce.createCommerceEventObject(i);s&&(s.EventName+="Impression",s.EventCategory=ie.CommerceEventType.ProductImpression,!Array.isArray(r)&&(r=[r]),s.ProductImpressions=[],r.forEach((function(e){s.ProductImpressions.push({ProductImpressionList:e.Name,ProductList:Array.isArray(e.Product)?e.Product:[e.Product]})})),t.logCommerceEvent(s,n,o))},this.logCommerceEvent=function(t,r,n){return e.Logger.verbose(qt.InformationMessages.StartingLogCommerceEvent),t.ProductAction&&null===t.EventCategory?void e.Logger.error("Commerce event not sent. The mParticle.ProductActionType you passed was invalid. Re-check your code."):(r=e._Helpers.sanitizeAttributes(r,t.EventName),void(e._Helpers.canLog()?(e._Store.webviewBridgeEnabled&&(t.ShoppingCart={}),r&&(t.EventAttributes=r),e._APIClient.sendEventToServer(t,n),e._Persistence.update(
1)):e.Logger.verbose(qt.InformationMessages.AbandonLogEvent)))},this.addEventHandler=function(r,n,i,o,s){var a,u,c=[],d=function(r){e.Logger.verbose("DOM event triggered, handling event"),t.logEvent({messageType:ie.MessageType.PageEvent,name:"function"==typeof i?i(a):i,data:"function"==typeof o?o(a):o,eventType:s||ie.EventType.Other}),(a.href&&"_blank"!==a.target||a.submit)&&(r.preventDefault?r.preventDefault():r.returnValue=!1,setTimeout((function(){a.href?window.location.href=a.href:a.submit&&a.submit()}),e._Store.SDKConfig.timeout))};if(n)if("string"==typeof n?c=document.querySelectorAll(n):n.nodeType&&(c=[n]),c.length)for(e.Logger.verbose("Found "+c.length+" element"+(1<c.length?"s":"")+", attaching event handlers"),u=0;u<c.length;u++)(a=c[u]).addEventListener?a.addEventListener(r,d,!1):a.attachEvent?a.attachEvent("on"+r,d):a["on"+r]=d;else e.Logger.verbose("No elements found");else e.Logger.error("Can't bind event, selector is required")}}function Wt(e,t,r,n,i,o,s){try{var a=e[o](s),u=a.value}catch(c){return void r(c)}a.done?t(u):Promise.resolve(u).then(n,i)}var Jt={exports:{}},zt={exports:{}};!function(e){function t(r){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}(zt);var Qt=zt.exports;!function(e){var t=Qt.default;function r(){e.exports=r=function(){return i},e.exports.__esModule=!0,e.exports.default=e.exports;var n,i={},o=Object.prototype,s=o.hasOwnProperty,a=Object.defineProperty||function(e,t,r){e[t]=r.value},u="function"==typeof Symbol?Symbol:{},c=u.iterator||"@@iterator",d=u.asyncIterator||"@@asyncIterator",l=u.toStringTag||"@@toStringTag";function g(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{g({},"")}catch(n){g=function(e,t,r){return e[t]=r}}function p(e,t,r,n){var i=t&&t.prototype instanceof b?t:b,o=Object.create(i.prototype),s=new L(n||[]);return a(o,"_invoke",{value:k(e,r,s)}),o}function v(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}i.wrap=p;var f="suspendedStart",m="suspendedYield",h="executing",y="completed",S={};function b(){}function I(){}function _(){}var P={};g(P,c,(function(){return this}));var C=Object.getPrototypeOf,w=C&&C(C(M([])));w&&w!==o&&s.call(w,c)&&(P=w);var A=_.prototype=b.prototype=Object.create(P);function T(e){["next","throw","return"].forEach((function(t){g(e,t,(function(e){return this._invoke(t,e)}))}))}function E(e,r){function n(i,o,a,u){var c=v(e[i],e,o);if("throw"!==c.type){var d=c.arg,l=d.value;return l&&"object"==t(l)&&s.call(l,"__await")?r.resolve(l.__await).then((function(e){n("next",e,a,u)}),(function(e){n("throw",e,a,u)})):r.resolve(l).then((function(e){d.value=e,a(d)}),(function(e){return n("throw",e,a,u)}))}u(c.arg)}var i;a(this,"_invoke",{value:function(e,t){function o(){return new r((function(r,i){n(e,t,r,i)}))}return i=i?i.then(o,o):o()}})}function k(e,t,r){var i=f;return function(o,s){if(i===h)throw new Error("Generator is already running");if(i===y){if("throw"===o)throw s;return{value:n,done:!0}}for(r.method=o,r.arg=s;;){var a=r.delegate;if(a){var u=D(a,r);if(u){if(u===S)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(i===f)throw i=y,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i=h;var c=v(e,t,r);if("normal"===c.type){if(i=r.done?y:m,c.arg===S)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(i=y,r.method="throw",r.arg=c.arg)}}}function D(e,t){var r=t.method,i=e.iterator[r];if(i===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=n,D(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),S;var o=v(i,e.iterator,t.arg);if("throw"===o.type)return t.method="throw",t.arg=o.arg,t.delegate=null,S;var s=o.arg;return s?s.done?(t[e.resultName]=s.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=n),t.delegate=null,S):s:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,S)}function U(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function L(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(U,this),this.reset(!0)}function M(e){if(e||""===e){var r=e[c];if(r)return r.call(e);
vendor: 1,738 bytes, line 1
1if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function t(){for(;++i<e.length;)if(s.call(e,i))return t.value=e[i],t.done=!1,t;return t.value=n,t.done=!0,t};return o.next=o}}throw new TypeError(t(e)+" is not iterable")}return I.prototype=_,a(A,"constructor",{value:_,configurable:!0}),a(_,"constructor",{value:I,configurable:!0}),I.displayName=g(_,l,"GeneratorFunction"),i.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===I||"GeneratorFunction"===(t.displayName||t.name))},i.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,_):(e.__proto__=_,g(e,l,"GeneratorFunction")),e.prototype=Object.create(A),e},i.awrap=function(e){return{__await:e}},T(E.prototype),g(E.prototype,d,(function(){return this})),i.AsyncIterator=E,i.async=function(e,t,r,n,o){void 0===o&&(o=Promise);var s=new E(p(e,t,r,n),o);return i.isGeneratorFunction(t)?s:s.next().then((function(e){return e.done?e.value:s.next()}))},T(A),g(A,l,"Generator"),g(A,c,(function(){return this})),g(A,"toString",(function(){return"[object Generator]"})),i.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},i.values=M,L.prototype={constructor:L,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=n,this.done=!1,this.delegate=null,this.method="next",this.arg=n,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&s.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=n)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;
1function r(r,i){return a.type="throw",a.arg=e,t.next=r,i&&(t.method="next",t.arg=n),!!i}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var u=s.call(o,"catchLoc"),c=s.call(o,"finallyLoc");if(u&&c){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(u){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&s.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var i=n;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var o=i?i.completion:{};return o.type=e,o.arg=t,i?(this.method="next",this.next=i.finallyLoc,S):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),S},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),S}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;O(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:M(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=n),S}},i}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports}(Jt);var Gt=(0,Jt.exports)(),Yt=Gt;try{regeneratorRuntime=Gt}catch(Zr){"object"===("undefined"==typeof globalThis?"undefined":n(globalThis))?globalThis.regeneratorRuntime=Gt:Function("r","regeneratorRuntime = r")(Gt)}var Xt=se(Yt);function $t(e,t,r,n){var i=this;return{getUserIdentities:function(){var i={},o=r._Store.getUserIdentities(e);for(var s in o)if(o.hasOwnProperty(s)){var a=ie.IdentityType.getIdentityName(r._Helpers.parseNumber(s));n&&(!n||n.isIdentityBlocked(a))||(i[a]=o[s])}return{userIdentities:i=r._Helpers.filterUserIdentitiesForForwarders(i,t.userIdentityFilters)}},getMPID:function(){return e},getUserAttributesLists:function(e){var t,o={};for(var s in t=i.getAllUserAttributes())t.hasOwnProperty(s)&&Array.isArray(t[s])&&(n&&(!n||n.isAttributeKeyBlocked(s))||(o[s]=t[s].slice()));return o=r._Helpers.filterUserAttributes(o,e.userAttributeFilters)},getAllUserAttributes:function(){var i={},o=r._Store.getUserAttributes(e);if(o)for(var s in o)o.hasOwnProperty(s)&&(n&&(!n||n.isAttributeKeyBlocked(s))||(Array.isArray(o[s])?i[s]=o[s].slice():i[s]=o[s]));return i=r._Helpers.filterUserAttributes(i,t.userAttributeFilters)}}}var Zt=a.IdentityMethods,er=Zt.Modify,tr=Zt.Identify,rr=Zt.Login,nr=Zt.Logout;function ir(e,t){var r=this,n=this;this.forwarderStatsUploader=new Ze(e,t).initializeForwarderStatsUploader();var i="setUserAttribute",o="removeUserAttribute";this.initForwarders=function(t,r){var i=e.Identity.getCurrentUser();!e._Store.webviewBridgeEnabled&&e._Store.configuredForwarders&&(e._Store.configuredForwarders.sort((function(e,t){return e.settings.PriorityValue=e.settings.PriorityValue||0,t.settings.PriorityValue=t.settings.PriorityValue||0,-1*(e.settings.PriorityValue-t.settings.PriorityValue)})),e._Store.activeForwarders=e._Store.configuredForwarders.filter((function(o){if(!e._Consent.isEnabledForUserConsent(o.filteringConsentRuleValues,i))return!1;if(!n.isEnabledForUserAttributes(o.filteringUserAttributeValue,i))return!1;if(!n.isEnabledForUnknownUser(o.excludeAnonymousUser,i))return!1;var s=e._Helpers.filterUserIdentities(t,o.userIdentityFilters),a=e._Helpers.filterUserAttributes(i?i.getAllUserAttributes():{},o.userAttributeFilters);return o.initialized||(o.logger=e.Logger,o.init(o.settings,r,!1,null,a,s,e._Store.SDKConfig.appVersion,e._Store.SDKConfig.appName,e._Store.SDKConfig.customFlags,e._Store.clientId),o.initialized=!0),!0})))},this.isEnabledForUserAttributes=function(t,r){if(!t||!e._Helpers.isObject(t)||!Object.keys(t).length)return!0;var n,i,o;if(!r)return!1;o=r.getAllUserAttributes();var s=!1;try{if(o&&e._Helpers.isObject(o)&&Object.keys(o).length)for(var a in o)if(o.hasOwnProperty(a)&&(n=rt.hashAttributeConditionalForwarding(a),i=rt.hashAttributeConditionalForwarding(
1o[a]),n===t.userAttributeName&&i===t.userAttributeValue)){s=!0;break}return!t||t.includeOnMatch===s}catch(e){return!0}},this.isEnabledForUnknownUser=function(e,t){return!!(t&&t.isLoggedIn()||!e)},this.applyToForwarders=function(t,r){e._Store.activeForwarders.length&&e._Store.activeForwarders.forEach((function(n){if(n[t])try{var i=n[t](r);i&&e.Logger.verbose(i)}catch(t){e.Logger.verbose(t)}}))},this.sendEventToForwarders=function(t){var r,n,i,o=function(t,r){t.UserIdentities&&t.UserIdentities.length&&t.UserIdentities.forEach((function(n,i){e._Helpers.inArray(r,rt.hashUserIdentity(n.Type))&&(t.UserIdentities.splice(i,1),0<i&&i--)}))},s=function(t,r){var n;if(r)for(var i in t.EventAttributes)t.EventAttributes.hasOwnProperty(i)&&(n=rt.hashEventAttributeKey(t.EventCategory,t.EventName,i),e._Helpers.inArray(r,n)&&delete t.EventAttributes[i])},a=function(t,r){return!!(t&&t.length&&e._Helpers.inArray(t,r))},u=[ie.MessageType.PageEvent,ie.MessageType.PageView,ie.MessageType.Commerce];if(!e._Store.webviewBridgeEnabled&&e._Store.activeForwarders){n=rt.hashEventName(t.EventName,t.EventCategory),i=rt.hashEventType(t.EventCategory);for(var c=0;c<e._Store.activeForwarders.length;c++){if(-1<u.indexOf(t.EventDataType)&&e._Store.activeForwarders[c].filteringEventAttributeValue&&e._Store.activeForwarders[c].filteringEventAttributeValue.eventAttributeName&&e._Store.activeForwarders[c].filteringEventAttributeValue.eventAttributeValue){var d=null;if(t.EventAttributes)for(var l in t.EventAttributes){var g;if((g=rt.hashAttributeConditionalForwarding(l))===e._Store.activeForwarders[c].filteringEventAttributeValue.eventAttributeName&&(d={name:g,value:rt.hashAttributeConditionalForwarding(t.EventAttributes[l])}),d)break}var p=null!==d&&d.value===e._Store.activeForwarders[c].filteringEventAttributeValue.eventAttributeValue;if(!(!0===e._Store.activeForwarders[c].filteringEventAttributeValue.includeOnMatch?p:!p))continue}if((r={},r=e._Helpers.extend(!0,r,t),t.EventDataType!==ie.MessageType.PageEvent||!a(e._Store.activeForwarders[c].eventNameFilters,n)&&!a(e._Store.activeForwarders[c].eventTypeFilters,i))&&((t.EventDataType!==ie.MessageType.Commerce||!a(e._Store.activeForwarders[c].eventTypeFilters,i))&&(t.EventDataType!==ie.MessageType.PageView||!a(e._Store.activeForwarders[c].screenNameFilters,n))&&(r.EventAttributes&&(t.EventDataType===ie.MessageType.PageEvent?s(r,e._Store.activeForwarders[c].attributeFilters):t.EventDataType===ie.MessageType.PageView&&s(r,e._Store.activeForwarders[c].screenAttributeFilters)),o(r,e._Store.activeForwarders[c].userIdentityFilters),r.UserAttributes=e._Helpers.filterUserAttributes(r.UserAttributes,e._Store.activeForwarders[c].userAttributeFilters),e._Store.activeForwarders[c].process))){e.Logger.verbose("Sending message to forwarder: "+e._Store.activeForwarders[c].name);var v=e._Store.activeForwarders[c].process(r);v&&e.Logger.verbose(v)}}}},this.handleForwarderUserAttributes=function(r,n,s){t&&t.isAttributeKeyBlocked(n)||!e._Store.activeForwarders.length||e._Store.activeForwarders.forEach((function(t){if(t[r]&&!rt.isFilteredUserAttribute(n,t.userAttributeFilters))try{var a;r===i?a=t.setUserAttribute(n,s):r===o&&(a=t.removeUserAttribute(n)),a&&e.Logger.verbose(a)}catch(t){e.Logger.error(t)}}))},this.setForwarderUserIdentities=function(t){e._Store.activeForwarders.forEach((function(r){var n=e._Helpers.filterUserIdentities(t,r.userIdentityFilters);r.setUserIdentity&&n.forEach((function(t){var n=r.setUserIdentity(t.Identity,t.Type);n&&e.Logger.verbose(n)}))}))},this.setForwarderOnUserIdentified=function(r){e._Store.activeForwarders.forEach((function(n){var i=$t(r.getMPID(),n,e,t);if(n.onUserIdentified){var o=n.onUserIdentified(i);o&&e.Logger.verbose(o)}}))},this.setForwarderOnIdentityComplete=function(r,n){var i;e._Store.activeForwarders.forEach((function(o){var s=$t(r.getMPID(),o,e,t),a=s.getUserIdentities();n===tr?o.onIdentifyComplete&&((i=o.onIdentifyComplete(s,a))&&e.Logger.verbose(i)):n===rr?o.onLoginComplete&&((i=o.onLoginComplete(s,a))&&e.Logger.verbose(i)):n===nr?o.onLogoutComplete&&((i=o.onLogoutComplete(s,a))&&e.Logger.verbose(i)):n===er&&o.onModifyComplete&&((i=o.onModifyComplete(s,a))&&e.Logger.verbose(i))}))},this.getForwarderStatsQueue=function(){return e._Persistence.forwardingStatsBatches.forwardingStatsEventQueue},this.setForwarderStatsQueue=function(t){e._Persistence.forwardingStatsBatches.forwardingStatsEventQueue=t},this.processForwarders=function(t,r){t?(this.processUIEnabledKits(t),this.processSideloadedKits(t),n.initForwarders(e._Store.SDKConfig.identifyRequest.userIdentities,r)):e.Logger.w
1arning("No config was passed. Cannot process forwarders")},this.processUIEnabledKits=function(t){var r=this.returnKitConstructors();try{Array.isArray(t.kitConfigs)&&t.kitConfigs.length&&t.kitConfigs.forEach((function(e){n.configureUIEnabledKit(e,r)}))}catch(t){e.Logger.error("MP Kits not configured propertly. Kits may not be initialized. "+t)}},this.returnKitConstructors=function(){var t={};return J(e._Store.SDKConfig.kits)?!J(e._preInit.forwarderConstructors)&&e._preInit.forwarderConstructors.forEach((function(e){if(e.suffix){var r="".concat(e.name,"-").concat(e.suffix);t[r]=e}else t[e.name]=e})):t=e._Store.SDKConfig.kits,t},this.configureUIEnabledKit=function(t,r){var n=null,i=t;for(var o in r){var s=void 0;if(i.suffix&&(s="".concat(i.name,"-").concat(i.suffix)),!(o!==s&&o!==i.name||i.isDebug!==e._Store.SDKConfig.isDevelopmentMode&&i.isSandbox!==e._Store.SDKConfig.isDevelopmentMode)){n=this.returnConfiguredKit(r[o],i),e._Store.configuredForwarders.push(n);break}}},this.processSideloadedKits=function(t){try{if(Array.isArray(t.sideloadedKits)){var r={kits:{}},i=t.sideloadedKits;for(var o in i.forEach((function(e){try{e.kitInstance.register(r);var t=e.kitInstance.name;r.kits[t].filters=e.filterDictionary}catch(t){console.error("Error registering sideloaded kit "+e.kitInstance.name)}})),r.kits){var s=r.kits[o];n.configureSideloadedKit(s)}if(!J(r.kits)){var a=Object.keys(r.kits);e._Store.sideloadedKitsCount=a.length}}}catch(t){e.Logger.error("Sideloaded Kits not configured propertly. Kits may not be initialized. "+t)}},this.configureSideloadedKit=function(t){e._Store.configuredForwarders.push(this.returnConfiguredKit(t,t.filters))},this.returnConfiguredKit=function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},r=new e.constructor;return r.id=t.moduleId,r.isSandbox=t.isDebug||t.isSandbox,r.hasSandbox="true"===t.hasDebugString,r.isVisible=t.isVisible||!0,r.settings=t.settings||{},r.eventNameFilters=t.eventNameFilters||[],r.eventTypeFilters=t.eventTypeFilters||[],r.attributeFilters=t.attributeFilters||[],r.screenNameFilters=t.screenNameFilters||[],r.screenAttributeFilters=t.screenAttributeFilters||[],r.userIdentityFilters=t.userIdentityFilters||[],r.userAttributeFilters=t.userAttributeFilters||[],r.filteringEventAttributeValue=t.filteringEventAttributeValue||{},r.filteringUserAttributeValue=t.filteringUserAttributeValue||{},r.eventSubscriptionId=t.eventSubscriptionId||null,r.filteringConsentRuleValues=t.filteringConsentRuleValues||{},r.excludeAnonymousUser=t.excludeAnonymousUser||!1,r},this.configurePixel=function(t){(t.isDebug===e._Store.SDKConfig.isDevelopmentMode||t.isProduction!==e._Store.SDKConfig.isDevelopmentMode)&&e._Store.pixelConfigurations.push(t)},this.processPixelConfigs=function(t){try{J(t.pixelConfigs)||t.pixelConfigs.forEach((function(e){n.configurePixel(e)}))}catch(t){e.Logger.error("Cookie Sync configs not configured propertly. Cookie Sync may not be initialized. "+t)}},this.sendSingleForwardingStatsToServer=function(){var t,n=(t=Xt.mark((function t(n){var i,o,s,a;return Xt.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o={method:"post",body:JSON.stringify(n),headers:{Accept:"text/plain;charset=UTF-8","Content-Type":"text/plain;charset=UTF-8"}},t.next=3,r.forwarderStatsUploader.upload(o);case 3:s=t.sent,a=202===s.status?"Successfully sent forwarding stats to mParticle Servers":"Issue with forwarding stats to mParticle Servers, received HTTP Code of "+s.statusText,null==e||null===(i=e.Logger)||void 0===i||i.verbose(a);case 6:case"end":return t.stop()}}),t)})),function(){var e=this,r=arguments;return new Promise((function(n,i){var o=t.apply(e,r);function s(e){Wt(o,n,i,s,a,"next",e)}function a(e){Wt(o,n,i,s,a,"throw",e)}s(void 0)}))});return function(){return n.apply(this,arguments)}}()}var or=ie.MessageType,sr=ie.ApplicationTransitionType;function ar(e){return e?e.map((function(e){return function(e){return{id:k(e.Sku),nm:k(e.Name),pr:E(e.Price),qt:E(e.Quantity),br:k(e.Brand),va:k(e.Variant),ca:k(e.Category),ps:E(e.Position),cc:k(e.CouponCode),tpa:E(e.TotalAmount),attrs:e.Attributes}}(e)})):[]}function ur(e){var t=this;this.convertToConsentStateV2DTO=function(e){if(!e)return null;var t={},r=e.getGDPRConsentState();if(r){var n={};for(var i in t.gdpr=n,r)if(r.hasOwnProperty(i)){var o=r[i];t.gdpr[i]={},"boolean"==typeof o.Consented&&(n[i].c=o.Consented),"number"==typeof o.Timestamp&&(n[i].ts=o.Timestamp),"string"==typeof o.ConsentDocument&&(n[i].d=o.ConsentDocument),"string"==typeof o.Location&&(n[i].l=o.Location),"string"==typeof o.HardwareId&&(n[i].h=o.HardwareId)}}
1var s=e.getCCPAConsentState();return s&&(t.ccpa={data_sale_opt_out:{c:s.Consented,ts:s.Timestamp,d:s.ConsentDocument,l:s.Location,h:s.HardwareId}}),t},this.createEventObject=function(t,r){var n,i={},o={},s=t.messageType===ie.MessageType.OptOut?!e._Store.isEnabled:null;if(e._Store.sessionId||t.messageType===ie.MessageType.OptOut||e._Store.webviewBridgeEnabled){var u=p({},t.customFlags),c=e._Store.integrationAttributes;if(e._Helpers.getFeatureFlag&&e._Helpers.getFeatureFlag(a.FeatureFlags.CaptureIntegrationSpecificIds)){e._IntegrationCapture.capture();var d=e._IntegrationCapture.getClickIdsAsCustomFlags();u=p(p({},d),u);var l=e._IntegrationCapture.getClickIdsAsIntegrationAttributes();c=p(p({},l),c)}return o=t.hasOwnProperty("toEventAPIObject")?t.toEventAPIObject():{EventName:t.name||t.messageType,EventCategory:t.eventType,EventAttributes:e._Helpers.sanitizeAttributes(t.data,t.name),ActiveTimeOnSite:null===(n=e._timeOnSiteTimer)||void 0===n?void 0:n.getTimeInForeground(),SourceMessageId:t.sourceMessageId||e._Helpers.generateUniqueId(),EventDataType:t.messageType,CustomFlags:u,UserAttributeChanges:t.userAttributeChanges,UserIdentityChanges:t.userIdentityChanges},t.messageType!==ie.MessageType.SessionEnd&&(e._Store.dateLastEventSent=new Date),i={Store:e._Store.serverSettings,SDKVersion:a.sdkVersion,SessionId:e._Store.sessionId,SessionStartDate:e._Store.sessionStartDate?e._Store.sessionStartDate.getTime():0,Debug:e._Store.SDKConfig.isDevelopmentMode,Location:e._Store.currentPosition,OptOut:s,ExpandedEventCount:0,AppVersion:e.getAppVersion(),AppName:e.getAppName(),Package:e._Store.SDKConfig.package,ClientGeneratedId:e._Store.clientId,DeviceId:e._Store.deviceId,IntegrationAttributes:c,CurrencyCode:e._Store.currencyCode,DataPlan:e._Store.SDKConfig.dataPlan?e._Store.SDKConfig.dataPlan:{}},o.EventDataType===or.AppStateTransition&&(o.IsFirstRun=e._Store.isFirstRun,o.LaunchReferral=window.location.href||null),o.CurrencyCode=e._Store.currencyCode,Xe(r||e.Identity.getCurrentUser(),o),t.messageType===ie.MessageType.SessionEnd&&(o.SessionLength=e._Store.dateLastEventSent.getTime()-e._Store.sessionStartDate.getTime(),o.currentSessionMPIDs=e._Store.currentSessionMPIDs,o.EventAttributes=e._Store.sessionAttributes,e._Store.currentSessionMPIDs=[],e._Store.sessionStartDate=null),i.Timestamp=e._Store.dateLastEventSent.getTime(),e._Helpers.extend({},o,i)}return null},this.convertEventToV2DTO=function(r){var n={n:r.EventName,et:r.EventCategory,ua:r.UserAttributes,ui:r.UserIdentities,ia:r.IntegrationAttributes,str:r.Store,attrs:r.EventAttributes,sdk:r.SDKVersion,sid:r.SessionId,sl:r.SessionLength,ssd:r.SessionStartDate,dt:r.EventDataType,dbg:r.Debug,ct:r.Timestamp,lc:r.Location,o:r.OptOut,eec:r.ExpandedEventCount,av:r.AppVersion,cgid:r.ClientGeneratedId,das:r.DeviceId,mpid:r.MPID,smpids:r.currentSessionMPIDs};r.DataPlan&&r.DataPlan.PlanId&&(n.dp_id=r.DataPlan.PlanId,r.DataPlan.PlanVersion&&(n.dp_v=r.DataPlan.PlanVersion));var i=t.convertToConsentStateV2DTO(r.ConsentState);return i&&(n.con=i),r.EventDataType===or.AppStateTransition&&(n.fr=r.IsFirstRun,n.iu=!1,n.at=sr.AppInit,n.lr=r.LaunchReferral,n.attrs=null),r.CustomFlags&&function(e,t){var r=[];for(var n in t.flags={},e.CustomFlags)r=[],e.CustomFlags.hasOwnProperty(n)&&(Array.isArray(e.CustomFlags[n])?e.CustomFlags[n].forEac
1h((function(e){q(e)&&r.push(e.toString())})):q(e.CustomFlags[n])&&r.push(e.CustomFlags[n].toString()),r.length&&(t.flags[n]=r))}(r,n),r.EventDataType===or.Commerce?(n.cu=r.CurrencyCode,r.ShoppingCart&&(n.sc={pl:ar(r.ShoppingCart.ProductList)}),r.ProductAction?n.pd={an:r.ProductAction.ProductActionType,cs:e._Helpers.parseNumber(r.ProductAction.CheckoutStep),co:r.ProductAction.CheckoutOptions,pl:ar(r.ProductAction.ProductList),ti:r.ProductAction.TransactionId,ta:r.ProductAction.Affiliation,tcc:r.ProductAction.CouponCode,tr:e._Helpers.parseNumber(r.ProductAction.TotalAmount),ts:e._Helpers.parseNumber(r.ProductAction.ShippingAmount),tt:e._Helpers.parseNumber(r.ProductAction.TaxAmount)}:r.PromotionAction?n.pm={an:r.PromotionAction.PromotionActionType,pl:r.PromotionAction.PromotionList.map((function(e){return{id:e.Id,nm:e.Name,cr:e.Creative,ps:e.Position?e.Position:0}}))}:r.ProductImpressions&&(n.pi=r.ProductImpressions.map((function(e){return{pil:e.ProductImpressionList,pl:ar(e.ProductList)}})))):r.EventDataType===or.Profile&&(n.pet=r.ProfileMessageType),n}}function cr(e){this.startForwardingStatsTimer=function(){mParticle._forwardingStatsTimer=setInterval((function(){!function(){var t=e._Forwarders.getForwarderStatsQueue(),r=e._Persistence.forwardingStatsBatches.uploadsTable,n=Date.now();for(var i in t.length&&(r[n]={uploading:!1,data:t},e._Forwarders.setForwarderStatsQueue([])),r)!function(t){if(r.hasOwnProperty(t)&&!1===r[t].uploading){var n=e._Helpers.createXHR((function(){4===n.readyState&&(200===n.status||202===n.status?(e.Logger.verbose("Successfully sent "+n.statusText+" from server"),delete r[t]):"4"===n.status.toString()[0]?429!==n.status&&delete r[t]:r[t].uploading=!1)})),i=r[t].data;r[t].uploading=!0,e._APIClient.sendBatchForwardingStatsToServer(i,n)}}(i)}()}),e._Store.SDKConfig.forwarderStatsTimeout)}}var dr=function(){function e(e,t,r){this.url="",this.logger=r,this.url="https://".concat(e).concat(t,"/audience"),this.userAudienceAPI=window.fetch?new Ge(this.url):new Ye(this.url)}return e.prototype.sendGetUserAudienceRequest=function(e,t){return v(this,void 0,void 0,(function(){var r,n,i,o,s,a;return f(this,(function(u){switch(u.label){case 0:this.logger.verbose("Fetching user audiences from server"),r={method:"GET",headers:{Accept:"*/*"}},n="".concat(this.url,"?mpid=").concat(e),u.label=1;case 1:return u.trys.push([1,6,,7]),[4,this.userAudienceAPI.upload(r,n)];case 2:return 200<=(i=u.sent()).status&&300>i.status?(this.logger.verbose("User Audiences successfully received"),[4,i.json()]):[3,4];case 3:o=u.sent(),s={currentAudienceMemberships:null==o?void 0:o.audience_memberships};try{t(s)}catch(e){throw new Error("Error invoking callback on user audience response.")}return[3,5];case 4:throw 401===i.status?new Error("`HTTP error status ${userAudiencePromise.status} while retrieving User Audiences - please verify your API key.`"):403===i.status?new Error("`HTTP error status ${userAudiencePromise.status} while retrieving User Audiences - please verify your workspace is enabled for audiences.`"):new Error("Uncaught HTTP Error ".concat(i.status,"."));case 5:return[3,7];case 6:return a=u.sent(),this.logger.error("Error retrieving audiences. ".concat(a)),[3,7];case 7:return[2]}}
1))}))},e}(),lr=function(e){return J(e)||e.forEach((function(e){j(e)?e():Array.isArray(e)&&gr(e)})),[]},gr=function(e){var t=e,r=t.splice(0,1)[0];if("undefined"!=typeof window&&window.mParticle&&window.mParticle[t[0]])window.mParticle[r].apply(window.mParticle,t);else{var n=r.split(".");try{for(var i,o=window.mParticle,s=window.mParticle,a=0,u=n;a<u.length;a++)i=u[a],s=o,o=o[i];o.apply(s,t)}catch(e){throw new Error("Unable to compute proper mParticle function "+e)}}},pr=a.Messages,vr=a.HTTPCodes,fr=a.FeatureFlags,mr=a.IdentityMethods,hr=pr.ErrorMessages,yr=fr.CacheIdentity,Sr=mr.Identify,br=mr.Modify,Ir=mr.Login,_r=mr.Logout;function Pr(e){var t=e._Helpers,r=t.getFeatureFlag,n=t.extend,i=this;this.idCache=null,this.audienceManager=null,this.IdentityRequest={preProcessIdentityRequest:function(t,r,n){e.Logger.verbose(pr.InformationMessages.StartingLogEvent+": "+n);var i=e._Helpers.Validators.removeFalsyIdentityValues(t,e.Logger),o=e._Helpers.Validators.validateIdentities(i,n);if(!o.valid)return e.Logger.error("ERROR: "+o.error),{valid:!1,error:o.error};if(r&&!e._Helpers.Validators.isFunction(r)){var s="The optional callback must be a function. You tried entering a(n) "+oe(r);return e.Logger.error(s),{valid:!1,error:s}}return{valid:!0,cleanedIdentities:i}},createIdentityRequest:function(t,r,n,i,o,s,a){return{client_sdk:{platform:r,sdk_vendor:n,sdk_version:i},context:s,environment:e._Store.SDKConfig.isDevelopmentMode?"development":"production",request_id:e._Helpers.generateUniqueId(),request_timestamp_ms:(new Date).getTime(),previous_mpid:a||null,known_identities:It(t,o)}},createModifyIdentityRequest:function(t,r,n,i,o,s){return{client_sdk:{platform:n,sdk_vendor:i,sdk_version:o},context:s,environment:e._Store.SDKConfig.isDevelopmentMode?"development":"production",request_id:e._Helpers.generateUniqueId(),request_timestamp_ms:(new Date).getTime(),identity_changes:this.createIdentityChanges(t,r)}},createIdentityChanges:function(e,t){var r,n=[];if(t&&T(t)&&e&&T(e))for(r in t)n.push({old_value:e[r]||null,new_value:t[r],identity_type:r});return n},combineUserIdentities:function(e,t){var r={},i=n({},e,t);for(var o in i){var s=ie.IdentityType.getIdentityType(o);!1!==s&&0<=s&&(r[ie.IdentityType.getIdentityType(o)]=i[o])}return r},createAliasNetworkRequest:function(t){return{request_id:e._Helpers.generateUniqueId(),request_type:"alias",environment:e._Store.SDKConfig.isDevelopmentMode?"development":"production",api_key:e._Store.devToken,data:{destination_mpid:t.destinationMpid,source_mpid:t.sourceMpid,start_unixtime_ms:t.startTime,end_unixtime_ms:t.endTime,scope:t.scope,device_application_stamp:e._Store.deviceId}}},convertAliasToNative:function(e){return{DestinationMpid:e.destinationMpid,SourceMpid:e.sourceMpid,StartUnixtimeMs:e.startTime,EndUnixtimeMs:e.endTime}},convertToNative:function(e){var t=[];if(e&&e.userIdentities){for(var r in e.userIdentities)e.userIdentities.hasOwnProperty(r)&&t.push({Type:ie.IdentityType.getIdentityType(r),Identity:e.userIdentities[r]});return{UserIdentities:t}}}},this.IdentityAPI={HTTPCodes:vr,identify:function(t,r){var n,o=e.Identity.getCurrentUser(),s=e._Identity.IdentityRequest.preProcessIdentityRequest(t,r,Sr);if(o&&(n=o.getMPID()),s.valid){var u=e._Identity.IdentityRequest.createIdentityRequest(s.cleanedIdentities,a.platform,a.sdkVendor,a.sdkVersion,e._Store.deviceId,e._Store.context,n);if(e._Helpers.getFeatureFlag(a.FeatureFlags.CacheIdentity))if(Pt(u.known_identities,i.idCache,i.parseIdentityResponse,n,r,t,Sr))return;e._Helpers.canLog()?e._Store.webviewBridgeEnabled?(e._NativeSdkHelpers.sendToNative(a.NativeSdkPaths.Identify,JSON.stringify(e._Identity.IdentityRequest.convertToNative(t))),e._Helpers.invokeCallback(r,vr.nativeIdentityRequest,"Identify request sent to native sdk")):e._IdentityAPIClient.sendIdentityRequest(u,Sr,r,t,i.parseIdentityResponse,n,u.known_identities):(e._Helpers.invokeCallback(r,vr.loggingDisabledOrMissingAPIKey,pr.InformationMessages.AbandonLogEvent),e.Logger.verbose(pr.InformationMessages.AbandonLogEvent))}else e._Helpers.invokeCallback(r,vr.validationIssue,s.error),e.Logger.verbose(s)},logout:function(t,r){var n,o=e.Identity.getCurrentUser(),s=e._Identity.IdentityRequest.preProcessIdentityRequest(t,r,_r);
1if(o&&(n=o.getMPID()),s.valid){var u,c=e._Identity.IdentityRequest.createIdentityRequest(s.cleanedIdentities,a.platform,a.sdkVendor,a.sdkVersion,e._Store.deviceId,e._Store.context,n);e._Helpers.canLog()?e._Store.webviewBridgeEnabled?(e._NativeSdkHelpers.sendToNative(a.NativeSdkPaths.Logout,JSON.stringify(e._Identity.IdentityRequest.convertToNative(t))),e._Helpers.invokeCallback(r,vr.nativeIdentityRequest,"Logout request sent to native sdk")):(e._IdentityAPIClient.sendIdentityRequest(c,_r,r,t,i.parseIdentityResponse,n),(u=e._ServerModel.createEventObject({messageType:ie.MessageType.Profile})).ProfileMessageType=ie.ProfileMessageType.Logout,e._Store.activeForwarders.length&&e._Store.activeForwarders.forEach((function(e){e.logOut&&e.logOut(u)}))):(e._Helpers.invokeCallback(r,vr.loggingDisabledOrMissingAPIKey,pr.InformationMessages.AbandonLogEvent),e.Logger.verbose(pr.InformationMessages.AbandonLogEvent))}else e._Helpers.invokeCallback(r,vr.validationIssue,s.error),e.Logger.verbose(s)},login:function(t,r){var n,o=e.Identity.getCurrentUser(),s=e._Identity.IdentityRequest.preProcessIdentityRequest(t,r,Ir);if(o&&(n=o.getMPID()),s.valid){var u=e._Identity.IdentityRequest.createIdentityRequest(s.cleanedIdentities,a.platform,a.sdkVendor,a.sdkVersion,e._Store.deviceId,e._Store.context,n);if(e._Helpers.getFeatureFlag(a.FeatureFlags.CacheIdentity))if(Pt(u.known_identities,i.idCache,i.parseIdentityResponse,n,r,t,Ir))return;e._Helpers.canLog()?e._Store.webviewBridgeEnabled?(e._NativeSdkHelpers.sendToNative(a.NativeSdkPaths.Login,JSON.stringify(e._Identity.IdentityRequest.convertToNative(t))),e._Helpers.invokeCallback(r,vr.nativeIdentityRequest,"Login request sent to native sdk")):e._IdentityAPIClient.sendIdentityRequest(u,Ir,r,t,i.parseIdentityResponse,n,u.known_identities):(e._Helpers.invokeCallback(r,vr.loggingDisabledOrMissingAPIKey,pr.InformationMessages.AbandonLogEvent),e.Logger.verbose(pr.InformationMessages.AbandonLogEvent))}else e._Helpers.invokeCallback(r,vr.validationIssue,s.error),e.Logger.verbose(s)},modify:function(t,r){var n,o=e.Identity.getCurrentUser(),s=e._Identity.IdentityRequest.preProcessIdentityRequest(t,r,br);if(o&&(n=o.getMPID()),s.valid){var u=t&&t.userIdentities?s.cleanedIdentities.userIdentities:{},c=e._Identity.IdentityRequest.createModifyIdentityRequest(o?o.getUserIdentities().userIdentities:{},u,a.platform,a.sdkVendor,a.sdkVersion,e._Store.context);e._Helpers.canLog()?e._Store.webviewBridgeEnabled?(e._NativeSdkHelpers.sendToNative(a.NativeSdkPaths.Modify,JSON.stringify(e._Identity.IdentityRequest.convertToNative(t))),e._Helpers.invokeCallback(r,vr.nativeIdentityRequest,"Modify request sent to native sdk")):e._IdentityAPIClient.sendIdentityRequest(c,br,r,t,i.parseIdentityResponse,n,c.known_identities):(e._Helpers.invokeCallback(r,vr.loggingDisabledOrMissingAPIKey,pr.InformationMessages.AbandonLogEvent),e.Logger.verbose(pr.InformationMessages.AbandonLogEvent))}else e._Helpers.invokeCallback(r,vr.validationIssue,s.error),e.Logger.verbose(s)},getCurrentUser:function(){var t;return e._Store?(t=e._Store.mpid)?(t=e._Store.mpid.slice(),i.mParticleUser(t,e._Store.isLoggedIn)):e._Store.webviewBridgeEnabled?i.mParticleUser():null:null},getUser:function(t){var r=e._Persistence.getPersistence();return r&&r[t]&&!a.SDKv2NonMPIDCookieKeys.hasOwnProperty(t)?i.mParticleUser(t):null},getUsers:function(){var t=e._Persistence.getPersistence(),r=[];if(t)for(var n in t)a.SDKv2NonMPIDCookieKeys.hasOwnProperty(n)||r.push(i.mParticleUser(n));return r.sort((function(e,t){return(e.getLastSeenTime()||0)>(t.getLastSeenTime()||0)?-1:1})),r},aliasUsers:function(t,r){var n;if(t.destinationMpid&&t.sourceMpid||(n=pr.ValidationMessages.AliasMissingMpid),t.destinationMpid===t.sourceMpid&&(n=pr.ValidationMessages.AliasNonUniqueMpid),t.startTime&&t.endTime||(n=pr.ValidationMessages.AliasMissingTime),t.startTime>t.endTime&&(n=pr.ValidationMessages.AliasStartBeforeEndTime),n)return e.Logger.warning(n),void e._Helpers.invokeAliasCallback(r,vr.validationIssue,n);if(e._Helpers.canLog())if(e._Store.webviewBridgeEnabled)e._NativeSdkHelpers.sendToNative(a.NativeSdkPaths.Alias,JSON.stringify(e._Identity.IdentityRequest.convertAliasToNative(t))),e._Helpers.invokeAliasCallback(r,vr.nativeIdentityRequest,"Alias request sent to native sdk");else{e.Logger.verbose(pr.InformationMessages.StartingAliasRequest+": "+t.sourceMpid+" -> "+t.destinationMpid);
1var i=e._Identity.IdentityRequest.createAliasNetworkRequest(t);e._IdentityAPIClient.sendAliasRequest(i,r)}else e._Helpers.invokeAliasCallback(r,vr.loggingDisabledOrMissingAPIKey,pr.InformationMessages.AbandonAliasUsers),e.Logger.verbose(pr.InformationMessages.AbandonAliasUsers)},createAliasRequest:function(t,r){try{if(!r||!t)return e.Logger.error("'destinationUser' and 'sourceUser' must both be present"),null;var n=t.getFirstSeenTime();n||e.Identity.getUsers().forEach((function(e){e.getFirstSeenTime()&&(!n||e.getFirstSeenTime()<n)&&(n=e.getFirstSeenTime())}));var i=(new Date).getTime()-24*e._Store.SDKConfig.aliasMaxWindow*60*60*1e3,o=t.getLastSeenTime()||(new Date).getTime();return n<i&&(o<(n=i)&&e.Logger.warning("Source User has not been seen in the last "+e._Store.SDKConfig.maxAliasWindow+" days, Alias Request will likely fail")),{destinationMpid:r.getMPID(),sourceMpid:t.getMPID(),startTime:n,endTime:o}}catch(r){return e.Logger.error("There was a problem with creating an alias request: "+r),null}}},this.mParticleUser=function(t,r){var n=this;return{getUserIdentities:function(){var r={},n=e._Store.getUserIdentities(t);for(var i in n)n.hasOwnProperty(i)&&(r[ie.IdentityType.getIdentityName(e._Helpers.parseNumber(i))]=n[i]);return{userIdentities:r}},getMPID:function(){return t},setUserTag:function(t){return e._Helpers.Validators.isValidKeyValue(t)?void this.setUserAttribute(t,null):void e.Logger.error(pr.ErrorMessages.BadKey)},removeUserTag:function(t){return e._Helpers.Validators.isValidKeyValue(t)?void this.removeUserAttribute(t):void e.Logger.error(pr.ErrorMessages.BadKey)},setUserAttribute:function(r,i){if(e._SessionManager.resetSessionTimer(),e._Helpers.canLog()){if(!e._Helpers.Validators.isValidAttributeValue(i))return void e.Logger.error(pr.ErrorMessages.BadAttribute);if(!e._Helpers.Validators.isValidKeyValue(r))return void e.Logger.error(pr.ErrorMessages.BadKey);if(e._Store.webviewBridgeEnabled)e._NativeSdkHelpers.sendToNative(a.NativeSdkPaths.SetUserAttribute,JSON.stringify({key:r,value:i}));else{var o,s,u=this.getAllUserAttributes(),c=e._Helpers.findKeyInObject(u,r);c?(s=!1,o=u[c],delete u[c]):s=!0,u[r]=i,e._Store.setUserAttributes(t,u),n.sendUserAttributeChangeEvent(r,i,o,s,!1,this),e._Forwarders.initForwarders(n.IdentityAPI.getCurrentUser().getUserIdentities(),e._APIClient.prepareForwardingStats),e._Forwarders.handleForwarderUserAttributes("setUserAttribute",r,i)}}},setUserAttributes:function(t){if(e._SessionManager.resetSessionTimer(),T(t)){if(e._Helpers.canLog())for(var r in t)t.hasOwnProperty(r)&&this.setUserAttribute(r,t[r])}else e.Logger.error("Must pass an object into setUserAttributes. You passed a "+oe(t))},removeUserAttribute:function(r){var i,o;if(e._SessionManager.resetSessionTimer(),e._Helpers.Validators.isValidKeyValue(r))if(e._Store.webviewBridgeEnabled)e._NativeSdkHelpers.sendToNative(a.NativeSdkPaths.RemoveUserAttribute,JSON.stringify({key:r,value:null}));else{i=e._Persistence.getPersistence(),o=this.getAllUserAttributes();var s=e._Helpers.findKeyInObject(o,r);s&&(r=s);var u=o[r]?o[r].toString():null;delete o[r],i&&i[t]&&(i[t].ua=o,e._Persistence.savePersistence(i,t)),n.sendUserAttributeChangeEvent(r,null,u,!1,!0,this),e._Forwarders.initForwarders(n.IdentityAPI.getCurrentUser().getUserIdentities(),e._APIClient.prepareForwardingStats),e._Forwarders.handleForwarderUserAttributes("removeUserAttribute",r,null)}else e.Logger.error(pr.ErrorMessages.BadKey)},setUserAttributeList:function(r,i){if(e._SessionManager.resetSessionTimer(),e._Helpers.Validators.isValidKeyValue(r))if(Array.isArray(i)){var o=i.slice();if(e._Store.webviewBridgeEnabled)e._NativeSdkHelpers.sendToNative(a.NativeSdkPaths.SetUserAttributeList,JSON.stringify({key:r,value:o}));else{var s,u,c,d=this.getAllUserAttributes(),l=e._Helpers.findKeyInObject(d,r);if(l?(u=!1,s=d[l],delete d[l]):u=!0,d[r]=o,e._Store.setUserAttributes(t,d),s&&Array.isArray(s)){if(i.length!==s.length)c=!0;else for(var g=0;g<i.length;g++)if(s[g]!==i[g]){c=!0;break}}else c=!0;c&&n.sendUserAttributeChangeEvent(r,i,s,u,!1,this),e._Forwarders.initForwarders(n.IdentityAPI.getCurrentUser().getUserIdentities(),e._APIClient.prepareForwardingStats),e._Forwarders.handleForwarder
1UserAttributes("setUserAttribute",r,o)}}else e.Logger.error("The value you passed in to setUserAttributeList must be an array. You passed in a "+("undefined"==typeof value?"undefined":oe(value)));else e.Logger.error(pr.ErrorMessages.BadKey)},removeAllUserAttributes:function(){var t;if(e._SessionManager.resetSessionTimer(),e._Store.webviewBridgeEnabled)e._NativeSdkHelpers.sendToNative(a.NativeSdkPaths.RemoveAllUserAttributes);else if(t=this.getAllUserAttributes(),e._Forwarders.initForwarders(n.IdentityAPI.getCurrentUser().getUserIdentities(),e._APIClient.prepareForwardingStats),t)for(var r in t)t.hasOwnProperty(r)&&e._Forwarders.handleForwarderUserAttributes("removeUserAttribute",r,null),this.removeUserAttribute(r)},getUserAttributesLists:function(){var e,t={};for(var r in e=this.getAllUserAttributes())e.hasOwnProperty(r)&&Array.isArray(e[r])&&(t[r]=e[r].slice());return t},getAllUserAttributes:function(){var r={},n=(0,e._Store.getUserAttributes)(t);if(n)for(var i in n)n.hasOwnProperty(i)&&(r[i]=Array.isArray(n[i])?n[i].slice():n[i]);return r},getCart:function(){return e.Logger.warning("Deprecated function Identity.getCurrentUser().getCart() will be removed in future releases"),n.mParticleUserCart(t)},getConsentState:function(){return e._Store.getConsentState(t)},setConsentState:function(r){e._Store.setConsentState(t,r),e._Forwarders.initForwarders(this.getUserIdentities().userIdentities,e._APIClient.prepareForwardingStats),e._CookieSyncManager.attemptCookieSync(this.getMPID())},isLoggedIn:function(){return r},getLastSeenTime:function(){return e._Persistence.getLastSeenTime(t)},getFirstSeenTime:function(){return e._Persistence.getFirstSeenTime(t)},getUserAudiences:function(r){return e._Helpers.getFeatureFlag(fr.AudienceAPI)?(null===n.audienceManager&&(n.audienceManager=new dr(e._Store.SDKConfig.userAudienceUrl,e._Store.devToken,e.Logger,t)),void n.audienceManager.sendGetUserAudienceRequest(t,r)):void e.Logger.error(hr.AudienceAPINotEnabled)}}},this.mParticleUserCart=function(t){return{add:function(r,n){var i,o,s;e.Logger.warning("Deprecated function Identity.getCurrentUser().getCart().add() will be removed in future releases"),(s=Array.isArray(r)?r.slice():[r]).forEach((function(t){t.Attributes=e._Helpers.sanitizeAttributes(t.Attributes)})),e._Store.webviewBridgeEnabled?e._NativeSdkHelpers.sendToNative(a.NativeSdkPaths.AddToCart,JSON.stringify(s)):(e._SessionManager.resetSessionTimer(),o=(o=e._Persistence.getUserProductsFromLS(t)).concat(s),!0===n&&e._Events.logProductActionEvent(ie.ProductActionType.AddToCart,s),o.length>e._Store.SDKConfig.maxProducts&&(e.Logger.verbose("The cart contains "+o.length+" items. Only "+e._Store.SDKConfig.maxProducts+" can currently be saved in cookies."),o=o.slice(-e._Store.SDKConfig.maxProducts)),(i=e._Persistence.getAllUserProductsFromLS())[t].cp=o,e._Persistence.setCartProducts(i))},remove:function(r,n){e.Logger.warning("Deprecated function Identity.getCurrentUser().getCart().remove() will be removed in future releases");var i,o,s=-1,u=null;e._Store.webviewBridgeEnabled?e._NativeSdkHelpers.sendToNative(a.NativeSdkPaths.RemoveFromCart,JSON.stringify(r)):(e._SessionManager.resetSessionTimer(),(o=e._Persistence.getUserProductsFromLS(t))&&(o.forEach((function(e,t){e.Sku===r.Sku&&(s=t,u=e)})),-1<s&&(o.splice(s,1),!0===n&&e._Events.logProductActionEvent(ie.ProductActionType.RemoveFromCart,u))),(i=e._Persistence.getAllUserProductsFromLS())[t].cp=o,e._Persistence.setCartProducts(i))},clear:function(){var r;
1e.Logger.warning("Deprecated function Identity.getCurrentUser().getCart().clear() will be removed in future releases"),e._Store.webviewBridgeEnabled?e._NativeSdkHelpers.sendToNative(a.NativeSdkPaths.ClearCart):(e._SessionManager.resetSessionTimer(),(r=e._Persistence.getAllUserProductsFromLS())&&r[t]&&r[t].cp&&(r[t].cp=[],r[t].cp=[],e._Persistence.setCartProducts(r)))},getCartProducts:function(){return e.Logger.warning("Deprecated function Identity.getCurrentUser().getCart().getCartProducts() will be removed in future releases"),e._Persistence.getCartProducts(t)}}},this.parseIdentityResponse=function(t,n,o,s,a,c,d){var l,g,p,v=e.Identity.getUser(n),f=v?v.getMPID():null,m=v?v.getUserIdentities().userIdentities:{},h={};e._Store.identityCallInFlight=!1;try{var y,S,b;if(e.Logger.verbose('Parsing "'+a+'" identity response from server'),g=null!==(y=t.responseText)&&void 0!==y?y:null,e._Store.isLoggedIn=(null===(S=g)||void 0===S?void 0:S.is_logged_in)||!1,function(e,t){return!e||e.getMPID()&&t.mpid&&t.mpid!==e.getMPID()}(v,g)&&(e._Store.mpid=g.mpid,v&&e._Persistence.setLastSeenTime(n),l=!e._Persistence.getFirstSeenTime(g.mpid),e._Persistence.setFirstSeenTime(g.mpid)),t.status===u){r(yr)&&yt(a,c,i.idCache,t,d);var I=i.IdentityAPI.getUser(g.mpid),P=I?I.getUserIdentities().userIdentities:{};a===br?(h=e._Identity.IdentityRequest.combineUserIdentities(m,s.userIdentities),e._Store.setUserIdentities(n,h)):(a===Sr&&v&&g.mpid===f&&e._Persistence.setFirstSeenTime(g.mpid),e._Store.addMpidToSessionHistory(g.mpid,n),e._CookieSyncManager.attemptCookieSync(g.mpid,l),e._Persistence.swapCurrentUser(n,g.mpid,e._Store.currentSessionMPIDs),s&&!J(s.userIdentities)&&(h=i.IdentityRequest.combineUserIdentities(P,s.userIdentities)),e._Store.setUserIdentities(g.mpid,h),e._Persistence.update(),e._Store.syncPersistenceData(),e._Persistence.findPrevCookiesB
1asedOnUI(s),e._Store.context=g.context||e._Store.context),function(e,t,r,n){if(r&&r.onUserAlias&&j(r.onUserAlias))try{n.warning(_("onUserAlias")),r.onUserAlias(e,t)}catch(t){n.error("There was an error with your onUserAlias function - "+t)}}(v,p=e.Identity.getCurrentUser(),s,e.Logger);var C=e._Persistence.getPersistence();p&&(e._Persistence.storeDataInMemory(C,p.getMPID()),i.reinitForwardersOnUserChange(v,p),i.setForwarderCallbacks(p,a));var w=te.getNewIdentitiesByName(h),A=a===br?m:P;i.sendUserIdentityChangeEvent(w,a,g.mpid,A)}if(o){var T=0===t.status?vr.noHttpCoverage:t.status;e._Helpers.invokeCallback(o,T,g||null,p)}else g&&!J(g.errors)&&e.Logger.error("Received HTTP response code of "+t.status+" - "+g.errors[0].message);e.Logger.verbose("Successfully parsed Identity Response"),null===(b=e._APIClient)||void 0===b||b.processQueuedEvents()}catch(r){o&&e._Helpers.invokeCallback(o,t.status,g||null),e.Logger.error("Error parsing JSON response from Identity server: "+r)}e._Store.isInitialized=!0,e._RoktManager.isReady()&&(e._RoktManager.currentUser=e.Identity.getCurrentUser()),e._preInit.readyQueue=lr(e._preInit.readyQueue)},this.sendUserIdentityChangeEvent=function(t,r,n,o){if(n||r===br){var s=this.IdentityAPI.getUser(n);for(var a in t)if(o[a]!==t[a]){var u,c=!o[a],d=i.createUserIdentityChange(a,t[a],o[a],c,s);null===(u=e._APIClient)||void 0===u||u.sendEventToServer(d)}}},this.createUserIdentityChange=function(t,r,n,i,o){return e._ServerModel.createEventObject({messageType:ie.MessageType.UserIdentityChange,userIdentityChanges:{New:{IdentityType:t,Identity:r,CreatedThisBatch:i},Old:{IdentityType:t,Identity:n,CreatedThisBatch:!1}},userInMemory:o})},this.sendUserAttributeChangeEvent=function(t,r,n,o,s,a){var u,c=i.createUserAttributeChange(t,r,n,o,s,a);c&&(null===(u=e._APIClient)||void 0===u||u.sendEventToServer(c))},this.createUserAttributeChange=function(t,r,n,i,o,s){var a;return void 0===n&&(n=null),r!==n&&(a=e._ServerModel.createEventObject({messageType:ie.MessageType.UserAttributeChange,userAttributeChanges:{UserAttributeName:t,New:r,Old:n,Deleted:o,IsNewAttribute:i}},s)),a},this.reinitForwardersOnUserChange=function(t,r){var n;(function(e,t){return!e||t.getMPID()!==e.getMPID()||e.isLoggedIn()!==t.isLoggedIn()})(t,r)&&(null===(n=e._Forwarders)||void 0===n||n.initForwarders(r.getUserIdentities().userIdentities,e._APIClient.prepareForwardingStats))},this.setForwarderCallbacks=function(t,r){var n,i,o;null===(n=e._Forwarders)||void 0===n||n.setForwarderUserIdentities(t.getUserIdentities().userIdentities),null===(i=e._Forwarders)||void 0===i||i.setForwarderOnIdentityComplete(t,r),null===(o=e._Forwarders)||void 0===o||o.setForwarderOnUserIdentified(t)}}var Cr=a.CCPAPurpose;function wr(e){var t=this;this.isEnabledForUserConsent=function(e,t){if(!e||!e.values||!e.values.length)return!0;if(!t)return!1;var r,n={},i=t.getConsentState();if(i){var o=i.getGDPRConsentState();if(o)for(var s in o)o.hasOwnProperty(s)&&(r=rt.hashConsentPurposeConditionalForwarding("1",s),n[r]=o[s].Consented);var a=i.getCCPAConsentState();a&&(r=rt.hashConsentPurposeConditionalForwarding("2",Cr),n[r]=a.Consented)}var u=e.values.some((function(e){var t=e.consentPurpose,r=e.hasConsented;return!!n.hasOwnProperty(t)&&n[t]===r}));return e.includeOnMatch===u},this.createPrivacyConsent=function(t,r,n,i,o){return"boolean"==typeof t?r&&isNaN(r)?(e.Logger.error("Timestamp must be a valid number when constructing a Consent object."),null):n&&"string"!=typeof n?(e.Logger.error("Document must be a valid string when constructing a Consent object."),null):i&&"string"!=typeof i?(e.Logger.error("Location must be a valid string when constructing a Consent object."),null):o&&"string"!=typeof o?(e.Logger.error("Hardware ID must be a valid string when constructing a Consent object."),null):{Consented:t,Timestamp:r||Date.now(),ConsentDocument:n,Location:i,HardwareId:o}:(e.Logger.error("Consented boolean is required when constructing a Consent object."),null)},this.ConsentSerialization={toMinifiedJsonObject:function(e){var t,r={};if(e){var n=e.getGDPRConsentState();if(n)for(var i in r.gdpr={},n)if(n.hasOwnProperty(i)){var o=n[i];r.gdpr[i]={},"boolean"==typeof o.Consented&&(r.gdpr[i].c=o.Consented),"number"==typeof o.Timestamp&&(r.gdpr[i].ts=o.Timestamp),"string"==typeof o.ConsentDocument&&(r.gdpr[i].d=o.ConsentDocument),"string"==typeof o.Location&&(r.gdpr[i].l=o.Location),"string"==typeof o.HardwareId&&(r.gdpr[i].h=o.HardwareId)}
1var s=e.getCCPAConsentState();s&&(r.ccpa=((t={})[Cr]={},t),"boolean"==typeof s.Consented&&(r.ccpa[Cr].c=s.Consented),"number"==typeof s.Timestamp&&(r.ccpa[Cr].ts=s.Timestamp),"string"==typeof s.ConsentDocument&&(r.ccpa[Cr].d=s.ConsentDocument),"string"==typeof s.Location&&(r.ccpa[Cr].l=s.Location),"string"==typeof s.HardwareId&&(r.ccpa[Cr].h=s.HardwareId))}return r},fromMinifiedJsonObject:function(e){var r=t.createConsentState();if(e.gdpr)for(var n in e.gdpr)if(e.gdpr.hasOwnProperty(n)){var i=t.createPrivacyConsent(e.gdpr[n].c,e.gdpr[n].ts,e.gdpr[n].d,e.gdpr[n].l,e.gdpr[n].h);r.addGDPRConsentState(n,i)}if(e.ccpa&&e.ccpa.hasOwnProperty(Cr)){var o=t.createPrivacyConsent(e.ccpa[Cr].c,e.ccpa[Cr].ts,e.ccpa[Cr].d,e.ccpa[Cr].l,e.ccpa[Cr].h);r.setCCPAConsentState(o)}return r}},this.createConsentState=function(r){function n(e){if("string"!=typeof e)return null;var t=e.trim();return t.length?t.toLowerCase():null}function i(){return delete s[Cr],this}var o={},s={};if(r){var a=t.createConsentState();return a.setGDPRConsentState(r.getGDPRConsentState()),a.setCCPAConsentState(r.getCCPAConsentState()),a}return{setGDPRConsentState:function(e){if(e){if(T(e))for(var t in o={},e)e.hasOwnProperty(t)&&this.addGDPRConsentState(t,e[t])}else o={};return this},addGDPRConsentState:function(r,i){var s=n(r);if(!s)return e.Logger.error("Purpose must be a string."),this;if(!T(i))return e.Logger.error("Invoked with a bad or empty consent object."),this;var a=t.createPrivacyConsent(i.Consented,i.Timestamp,i.ConsentDocument,i.Location,i.HardwareId);return a&&(o[s]=a),this},setCCPAConsentState:function(r){if(!T(r))return e.Logger.error("Invoked with a bad or empty CCPA consent object."),this;var n=t.createPrivacyConsent(r.Consented,r.Timestamp,r.ConsentDocument,r.Location,r.HardwareId);return n&&(s[Cr]=n),this},getCCPAConsentState:function(){return s[Cr]},getGDPRConsentState:function(){return Object.assign({},o)},removeGDPRConsentState:function(e){var t=n(e);return t?(delete o[t],this):this},removeCCPAState:function(){return e.Logger.warning("removeCCPAState is deprecated and will be removed in a future release; use removeCCPAConsentState instead"),i()},removeCCPAConsentState:i}}}var Ar={ScreenView:"screen_view",CustomEvent:"custom_event",Commerce:"commerce",UserAttributes:"user_attributes",UserIdentities:"user_identities",ProductAction:"product_action",PromotionAction:"promotion_action",ProductImpression:"product_impression"},Tr=function(){function e(e,t){var r,n,i,o,s,a,u,c,d,l,g,p,v,f,m,h=this;if(this.dataPlanMatchLookups={},this.blockEvents=!1,this.blockEventAttributes=!1,this.blockUserAttributes=!1,this.blockUserIdentities=!1,this.kitBlockingEnabled=!1,!e||e.document){this.kitBlockingEnabled=!0,this.mpInstance=t,this.blockEvents=null===(i=null===(n=null===(r=null==e?void 0:e.document)||void 0===r?void 0:r.dtpn)||void 0===n?void 0:n.blok)||void 0===i?void 0:i.ev,this.blockEventAttributes=null===(a=null===(s=null===(o=null==e?void 0:e.document)||void 0===o?void 0:o.dtpn)||void 0===s?void 0:s.blok)||void 0===a?void 0:a.ea,this.blockUserAttributes=null===(d=null===(c=null===(u=null==e?void 0:e.document)||void 0===u?void 0:u.dtpn)||void 0===c?void 0:c.blok)||void 0===d?void 0:d.ua,this.blockUserIdentities=null===(p=null===(g=null===(l=null==e?void 0:e.document)||void 0===l?void 0:l.dtpn)||void 0===g?void 0:g.blok)||void 0===p?void 0:p.id;var y=null===(m=null===(f=null===(v=null==e?void 0:e.document)||void 0===v?void 0:v.dtpn)||void 0===f?void 0:f.vers)||void 0===m?void 0:m.version_document,S=null==y?void 0:y.data_points;if(y)try{0<(null==S?void 0:S.length)&&S.forEach((function(e){return h.addToMatchLookups(e)}))}catch(e){this.mpInstance.Logger.error("There was an issue with the data plan: "+e)}}else this.kitBlockingEnabled=!1}return e.prototype.addToMatchLookups=function(e){var t,r,n;if(e.match&&e.validator){var i=this.generateMatchKey(e.match),o=this.getPlannedProperties(e.match.type,e.validator);this.dataPlanMatchLookups[i]=o,((null===(t=null==e?void 0:e.match)||void 0===t?void 0:t.type)===Ar.ProductImpression||(null===(r=null==e?void 0:e.match)||void 0===r?void 0:r.type)===Ar.ProductAction||(null===(n=null==e?void 0:e.match)||void 0===n?void 0:n.type)===Ar.PromotionAction)&&(i=this.generateProductAttributeMatchKey(e.match),o=this.getProductProperties(e.match.type,e.validator),this.dataPlanMatchLookups[i]=o)}
1else this.mpInstance.Logger.warning("Data Plan Point is not valid' + ".concat(e))},e.prototype.generateMatchKey=function(e){var t=e.criteria||"";switch(e.type){case Ar.CustomEvent:var r=t;return[Ar.CustomEvent,r.custom_event_type,r.event_name].join(":");case Ar.ScreenView:return[Ar.ScreenView,"",t.screen_name].join(":");case Ar.ProductAction:case Ar.PromotionAction:case Ar.ProductImpression:return[e.type,t.action].join(":");case Ar.UserIdentities:case Ar.UserAttributes:return[e.type].join(":");default:return null}},e.prototype.generateProductAttributeMatchKey=function(e){var t=e.criteria||"";switch(e.type){case Ar.ProductAction:case Ar.PromotionAction:return[e.type,t.action,"ProductAttributes"].join(":");case Ar.ProductImpression:return[e.type,"ProductAttributes"].join(":");default:return null}},e.prototype.getPlannedProperties=function(e,t){var r,n,i,o,s,a,u,c,d,l;switch(e){case Ar.CustomEvent:case Ar.ScreenView:case Ar.ProductAction:case Ar.PromotionAction:case Ar.ProductImpression:if(d=null===(o=null===(i=null===(n=null===(r=null==t?void 0:t.definition)||void 0===r?void 0:r.properties)||void 0===n?void 0:n.data)||void 0===i?void 0:i.properties)||void 0===o?void 0:o.custom_attributes){if(!0===d.additionalProperties||void 0===d.additionalProperties)return!0;for(var g={},p=0,v=Object.keys(d.properties);p<v.length;p++)g[v[p]]=!0;return g}return!1!==(null===(u=null===(a=null===(s=null==t?void 0:t.definition)||void 0===s?void 0:s.properties)||void 0===a?void 0:a.data)||void 0===u?void 0:u.additionalProperties)||{};case Ar.UserAttributes:case Ar.UserIdentities:if(!0===(l=null===(c=null==t?void 0:t.definition)||void 0===c?void 0:c.additionalProperties)||void 0===l)return!0;g={};for(var f=t.definition.properties,m=0,h=Object.keys(f);m<h.length;m++)g[h[m]]=!0;return g;default:return null}},e.prototype.getProductProperties=function(e,t){var r,n,i,o,s,a,u,c,d,l,g,p,v,f,m,h,y,S,b,I;switch(e){case Ar.ProductImpression:if(!1===(null==(I=null===(l=null===(d=null===(c=null===(u=null===(a=null===(s=null===(o=null===(i=null===(n=null===(r=null==t?void 0:t.definition)||void 0===r?void 0:r.properties)||void 0===n?void 0:n.data)||void 0===i?void 0:i.properties)||void 0===o?void 0:o.product_impressions)||void 0===s?void 0:s.items)||void 0===a?void 0:a.properties)||void 0===u?void 0:u.products)||void 0===c?void 0:c.items)||void 0===d?void 0:d.properties)||void 0===l?void 0:l.custom_attributes)?void 0:I.additionalProperties)){for(var _={},P=0,C=Object.keys(null==I?void 0:I.properties);P<C.length;P++)_[C[P]]=!0;return _}return!0;case Ar.ProductAction:case Ar.PromotionAction:if((I=null===(b=null===(S=null===(y=null===(h=null===(m=null===(f=null===(v=null===(p=null===(g=null==t?void 0:t.definition)||void 0===g?void 0:g.properties)||void 0===p?void 0:p.data)||void 0===v?void 0:v.properties)||void 0===f?void 0:f.product_action)||void 0===m?void 0:m.properties)||void 0===h?void 0:h.products)||void 0===y?void 0:y.items)||void 0===S?void 0:S.properties)||void 0===b?void 0:b.custom_attributes)&&!1===I.additionalProperties){_={};for(var w=0,A=Object.keys(null==I?void 0:I.properties);w<A.length;w++)_[A[w]]=!0;return _}return!0;default:return null}},e.prototype.getMatchKey=function(e){switch(e.event_type){case Ae.EventTypeEnum.screenView:var t=e;return t.data?["screen_view","",t.data.screen_name].join(":"):null;case Ae.EventTypeEnum.commerceEvent:var r=e,n=[];if(r&&r.data){var i=r.data,o=i.product_action,s=i.product_impressions,a=i.promotion_action;o?(n.push(Ar.ProductAction),n.push(o.action)):a?(n.push(Ar.PromotionAction),n.push(a.action)):s&&n.push(Ar.ProductImpression)}return n.join(":");case Ae.EventTypeEnum.customEvent:var u=e;return u.data?["custom_event",u.data.custom_event_type,u.data.event_name].join(":"):null;default:return null}},e.prototype.getProductAttributeMatchKey=function(e){if(e.event_type===Ae.EventTypeEnum.commerceEvent){var t=[],r=e.data,n=r.product_action,i=r.product_impressions,o=r.promotion_action;return n?(t.push(Ar.ProductAction),t.push(n.action),t.push("ProductAttributes")):o?(t.push(Ar.PromotionAction),t.push(o.action),t.push("ProductAttributes")):i&&(t.push(Ar.ProductImpression),t.push("ProductAttributes")),t.join(":")}return null},e.prototype.createBlockedEvent=function(e){try{return e&&(e=this.transformEventAndEventAttributes(e)),e&&e.EventDataType===ie.MessageType.Commerce&&(e=this.transformProductAttributes(e)),e&&(e=this.transformUserAttributes(e),e=this.transformUserIdentities(e)),e}catch(t){return e}},e.prototype.transformEventAndEventAttributes=function(e){var t=p({},e),r=Le(t),n=this.getMatchKey(r),i=this.dataPlanMatchLookups[n];if(this.blockEvents&&!i)return null;
1if(this.blockEventAttributes){if(!0===i)return t;if(i){for(var o,s=0,a=Object.keys(t.EventAttributes);s<a.length;s++)i[o=a[s]]||delete t.EventAttributes[o];return t}return t}return t},e.prototype.transformProductAttributes=function(e){function t(e,t){t.forEach((function(t){for(var r,n=0,i=Object.keys(t.Attributes);n<i.length;n++)r=i[n],e[r]||delete t.Attributes[r]}))}var r,n=p({},e),i=Le(n),o=this.getProductAttributeMatchKey(i),s=this.dataPlanMatchLookups[o];if(this.blockEvents&&!s)return null;if(this.blockEventAttributes){if(!0===s)return n;if(s){switch(e.EventCategory){case ie.CommerceEventType.ProductImpression:n.ProductImpressions.forEach((function(e){t(s,null==e?void 0:e.ProductList)}));break;case ie.CommerceEventType.ProductPurchase:t(s,null===(r=n.ProductAction)||void 0===r?void 0:r.ProductList);break;default:this.mpInstance.Logger.warning("Product Not Supported ")}return n}return n}return n},e.prototype.transformUserAttributes=function(e){var t=p({},e);if(this.blockUserAttributes){var r=this.dataPlanMatchLookups.user_attributes;if(this.mpInstance._Helpers.isObject(r))for(var n,i=0,o=Object.keys(t.UserAttributes);i<o.length;i++)r[n=o[i]]||delete t.UserAttributes[n]}return t},e.prototype.isAttributeKeyBlocked=function(e){if(!this.blockUserAttributes)return!1;var t=this.dataPlanMatchLookups.user_attributes;return!("boolean"==typeof t&&t)&&"object"===oe(t)&&!0!==t[e]},e.prototype.isIdentityBlocked=function(e){if(!this.blockUserIdentities)return!1;if(!this.blockUserIdentities)return!1;var t=this.dataPlanMatchLookups.user_identities;return!0!==t&&!t[e]},e.prototype.transformUserIdentities=function(e){var t,r=this,n=p({},e);if(this.blockUserIdentities){var i=this.dataPlanMatchLookups.user_identities;this.mpInstance._Helpers.isObject(i)&&(null===(t=null==n?void 0:n.UserIdentities)||void 0===t?void 0:t.length)&&n.UserIdentities.forEach((function(e,t){var o=ie.IdentityType.getIdentityName(r.mpInstance._Helpers.parseNumber(e.Type));i[o]||n.UserIdentities.splice(t,1)}))}return n},e}(),Er=function(e,t,r,n){var i=["env=".concat(n?"1":"0")],o=r||{},s=o.planId,a=o.planVersion;return s&&i.push("plan_id=".concat(s)),a&&i.push("plan_version=".concat(a)),"".concat(e+t+"/config","?").concat(i.join("&"))};function kr(e,t,r){var n=this,i="https://"+r._Store.SDKConfig.configUrl,o=t.isDevelopmentMode,s=t.dataPlan,a=Er(i,e,s,o),u=window.fetch?new Ge(a):new Ye(a);this.getSDKConfiguration=function(){return v(n,void 0,void 0,(function(){var e,n,i,o,s,a;return f(this,(function(c){switch(c.label){case 0:e={method:"get",headers:{Accept:"text/plain;charset=UTF-8","Content-Type":"text/plain;charset=UTF-8"},body:null},c.label=1;case 1:return c.trys.push([1,6,,7]),[4,u.upload(e)];case 2:return 200!==(n=c.sent()).status?[3,5]:(null===(o=null==r?void 0:r.Logger)||void 0===o||o.verbose("Successfully received configuration from server"),n.json?[4,n.json()]:[3,4]);case 3:return[2,c.sent()];case 4:return i=n,[2,JSON.parse(i.responseText)];case 5:return null===(s=null==r?void 0:r.Logger)||void 0===s||s.verbose("Issue with receiving configuration from server, received HTTP Code of "+n.statusText),[3,7];case 6:return c.sent(),null===(a=null==r?void 0:r.Logger)||void 0===a||a.error("Error getting forwarder configuration from mParticle servers."),[3,7];case 7:return[2,t]}}))}))}}var Dr=a.HTTPCodes,Ur=a.Messages,Or=a.IdentityMethods.Modify;function Lr(e){this.sendAliasRequest=function(t,r){return v(this,void 0,void 0,(function(){var n,i,o,s,a,l,g,p,v,m,h,y,S,b,I,_,P;return f(this,(function(f){switch(f.label){case 0:n=e.Logger,i=n.verbose,o=n.error,s=e._Helpers.invokeAliasCallback,a=e._Store.SDKConfig.aliasUrl,l=e._Store.devToken,i(Ur.InformationMessages.SendAliasHttp),g="https://".concat(a).concat(l,"/Alias"),p=window.fetch?new Ge(g):new Ye(g),v={method:"post",headers:{Accept:"text/plain;charset=UTF-8","Content-Type":"application/json"},body:JSON.stringify(t)},f.label=1;case 1:return f.trys.push([1,13,,14]),[4,p.upload(v)];case 2:return m=f.sent(),h=void 0,y=void 0,P=void 0,(S=m.status)===c||S===u?[3,3]:S===d?[3,4]:[3,11];case 3:return y="Received Alias Response from server: "+JSON.stringify(m.status),[3,12];case 4:if(!m.json)return[3,9];f.label=5;case 5:return f.trys.push([5,7,,8]),[4,m.json()];case 6:return h=f.sent(),[3,8];case 7:return f.sent(),i("The request has no response body"),[3,8];case 8:return[3,10];case 9:h=(b=m).responseText?JSON.parse(b.responseText):"",f.label=10;case 10:return(null==(I=h)?void 0:I.message)&&(P=I.message),y="Issue with sending Alias Request to mParticle Servers, received HTTP Code of "+m.status,(null==I?void 0:I.code)&&(y+=" - "+I.code),[3,12];case 11:throw new Error("Received HTTP Code of "+m.status);case 12:return i(y),s(r,m.status,P),[3,14];case 13:return _=f.sent(),P=_.message||_.toString(),o("Error sending alias request to mParticle servers. "+P),s(r,Dr.noHttpCoverage,P),[3,14];case 14:return[2]}}
1))}))},this.sendIdentityRequest=function(t,r,n,i,o,s,a){return v(this,void 0,void 0,(function(){var l,g,p,v,m,h,y,S,b,I,_,P,C,w,A,T;return f(this,(function(f){switch(f.label){case 0:if(l=e.Logger,g=l.verbose,p=l.error,v=e._Helpers.invokeCallback,g(Ur.InformationMessages.SendIdentityBegin),!t)return p(Ur.ErrorMessages.APIRequestEmpty),[2];if(g(Ur.InformationMessages.SendIdentityHttp),e._Store.identityCallInFlight)return v(n,Dr.activeIdentityRequest,"There is currently an Identity request processing. Please wait for this to return before requesting again"),[2];m=s||null,h=this.getUploadUrl(r,s),y=window.fetch?new Ge(h):new Ye(h),S={method:"post",headers:{Accept:"text/plain;charset=UTF-8","Content-Type":"application/json","x-mp-key":e._Store.devToken},body:JSON.stringify(t)},e._Store.identityCallInFlight=!0,f.label=1;case 1:return f.trys.push([1,9,,10]),[4,y.upload(S)];case 2:return b=f.sent(),I=void 0,_=void 0,(P=b.status)===c||P===u||P===d?[3,3]:[3,7];case 3:return b.json?[4,b.json()]:[3,5];case 4:return C=f.sent(),I=this.getIdentityResponseFromFetch(b,C),[3,6];case 5:I=this.getIdentityResponseFromXHR(b),f.label=6;case 6:return I.status===d?(w=I.responseText,_="Issue with sending Identity Request to mParticle Servers, received HTTP Code of "+I.status,(null==w?void 0:w.Errors)&&(T=w.Errors.map((function(e){return e.message})).join(", "),_+=" - "+T)):(_="Received Identity Response from server: ",_+=JSON.stringify(I.responseText)),[3,8];case 7:throw new Error("Received HTTP Code of "+b.status);case 8:return e._Store.identityCallInFlight=!1,g(_),o(I,m,n,i,r,a,!1),[3,10];case 9:return A=f.sent(),e._Store.identityCallInFlight=!1,T=A.message||A.toString(),p("Error sending identity request to servers - "+T),v(n,Dr.noHttpCoverage,T),[3,10];case 10:return[2]}}
1))}))},this.getUploadUrl=function(t,r){var n=e._Helpers.createServiceUrl(e._Store.SDKConfig.identityUrl);return t===Or?n+r+"/"+t:n+t},this.getIdentityResponseFromFetch=function(e,t){return{status:e.status,responseText:t,cacheMaxAge:parseInt(e.headers.get(ht))||0,expireTimestamp:0}},this.getIdentityResponseFromXHR=function(e){return{status:e.status,responseText:e.responseText?JSON.parse(e.responseText):{},cacheMaxAge:E(e.getResponseHeader(ht)||""),expireTimestamp:0}}}var Mr="custom_flags",Fr="partner_identities",Nr="integration_attributes",Rr={fbclid:{mappedKey:"Facebook.ClickId",processor:function(e,t,r){if(!e||!t)return"";var n=null==t?void 0:t.split("//");if(!n)return"";var i=1;3<=n[1].split("/")[0].split(".").length&&(i=2);var o=r||Date.now();return"fb.".concat(i,".").concat(o,".").concat(e)},output:Mr},_fbp:{mappedKey:"Facebook.BrowserId",output:Mr},_fbc:{mappedKey:"Facebook.ClickId",output:Mr},gclid:{mappedKey:"GoogleEnhancedConversions.Gclid",output:Mr},gbraid:{mappedKey:"GoogleEnhancedConversions.Gbraid",output:Mr},wbraid:{mappedKey:"GoogleEnhancedConversions.Wbraid",output:Mr},rtid:{mappedKey:"passbackconversiontrackingid",output:Nr,moduleId:1277},rclid:{mappedKey:"passbackconversiontrackingid",output:Nr,moduleId:1277},RoktTransactionId:{mappedKey:"passbackconversiontrackingid",output:Nr,moduleId:1277},ttclid:{mappedKey:"TikTok.Callback",output:Mr},_ttp:{mappedKey:"tiktok_cookie_id",output:Fr},ScCid:{mappedKey:"SnapchatConversions.ClickId",output:Mr}},xr=function(){function e(){this.initialTimestamp=Date.now(),this.filteredPartnerIdentityMappings=this.filterMappings(Fr),this.filteredCustomFlagMappings=this.filterMappings(Mr),this.filteredIntegrationAttributeMappings=this.filterMappings(Nr)}return e.prototype.capture=function(){var e=this.captureQueryParams()||{},t=this.captureCookies()||{},r=this.captureLocalStorage()||{};e.fbclid&&t._fbc&&delete t._fbc;var n=e.rtid||e.rclid,i=r.RoktTransactionId,o=t.RoktTransactionId;n?(i&&delete r.RoktTransactionId,o&&delete t.RoktTransactionId):i&&o&&delete t.RoktTransactionId,this.clickIds=p(p(p(p({},this.clickIds),e),r),t)},e.prototype.captureCookies=function(){var e=function(e){var t=function(){try{return"undefined"==typeof window?[]:window.document.cookie.split(";").map((function(e){return e.trim()}))}catch(e){return console.error("Unable to parse cookies",e),[]}}();return function(e,t){for(var r={},n=0,i=e;n<i.length;n++){var o=i[n].split("="),s=o[0],a=o[1];(!t||t.includes(s))&&(r[s]=a)}return r}(t,e)}(Object.keys(Rr));return this.applyProcessors(e,G(),this.initialTimestamp)},e.prototype.captureQueryParams=function(){var e=this.getQueryParams();return this.applyProcessors(e,G(),this.initialTimestamp)},e.prototype.captureLocalStorage=function(){var e={};for(var t in Rr){var r=localStorage.getItem(t);r&&(e[t]=r)}return this.applyProcessors(e,G(),this.initialTimestamp)},e.prototype.getQueryParams=function(){return function(e,t){void 0===t&&(t=[]);var r,n={},i={};if(!e)return n;if("undefined"!=typeof URL&&"undefined"!=typeof URLSearchParams){var o=new URL(e);r=new URLSearchParams(o.search)}else r=Q(e);return r.forEach((function(e,t){i[t.toLowerCase()]=e})),J(t)?i:(t.forEach((function(e){var t=i[e.toLowerCase()];t&&(n[e]=t)})),n)}(G(),Object.keys(Rr))},e.prototype.getClickIdsAsCustomFlags=function(){return this.getClickIds(this.clickIds,this.filteredCustomFlagMappings)},e.prototype.getClickIdsAsPartnerIdentities=function(){return this.getClickIds(this.clickIds,this.filteredPartnerIdentityMappings)},e.prototype.getClickIdsAsIntegrationAttributes=function(){var e,t,r,n={};for(var i in this.clickIds)if(this.clickIds.hasOwnProperty(i)){var o=this.clickIds[i],s=null===(t=this.filteredIntegrationAttributeMappings[i])||void 0===t?void 0:t.mappedKey;if(!J(s)){var a=null===(r=this.filteredIntegrationAttributeMappings[i])||void 0===r?void 0:r.moduleId;a&&!n[a]&&(n[a]=((e={})[s]=o,e))}}return n},e.prototype.getClickIds=function(e,t){var r,n={};if(!e)return n;for(var i in e)if(e.hasOwnProperty(i)){var o=e[i],s=null===(r=t[i])||void 0===r?void 0:r.mappedKey;J(s)||(n[s]=o)}return n},e.prototype.applyProcessors=function(e,t,r){var n,i={};for(var o in e)if(e.hasOwnProperty(o)){var s=e[o],a=null===(n=Rr[o
1])||void 0===n?void 0:n.processor;i[o]=a?a(s,t,r):s}return i},e.prototype.filterMappings=function(e){var t={};for(var r in Rr)Rr[r].output===e&&(t[r]=Rr[r]);return t},e}(),Vr=function(){function e(){this.kit=null,this.filters={},this.currentUser=null,this.messageQueue=[],this.sandbox=null,this.placementAttributesMapping=[]}return e.prototype.init=function(e,t,r,n,i){var o=e||{},s=o.userAttributeFilters,a=(o.settings||{}).placementAttributesMapping;try{this.placementAttributesMapping=function(e){try{return e?JSON.parse(e.replace(/"/g,'"')):[]}catch(e){throw new Error("Settings string contains invalid JSON")}}(a)}catch(e){console.error("Error parsing placement attributes mapping from config",e)}this.identityService=r,this.logger=n,this.filters={userAttributeFilters:s,filterUserAttributes:rt.filterUserAttributes,filteredUser:t};var u=(null==i?void 0:i.sandbox)||!1;this.launcherOptions=p({sandbox:u},null==i?void 0:i.launcherOptions),(null==i?void 0:i.domain)&&(this.domain=i.domain)},e.prototype.attachKit=function(e){this.kit=e,this.processMessageQueue()},e.prototype.selectPlacements=function(e){var t,r;return v(this,void 0,void 0,(function(){var n,i,o,s,a,u,c,d,l,g,v=this;return f(this,(function(f){switch(f.label){case 0:if(!this.isReady())return this.queueMessage({methodName:"selectPlacements",payload:e}),[2,Promise.resolve({})];f.label=1;case 1:if(f.trys.push([1,6,,7]),n=e.attributes,i=(null==n?void 0:n.sandbox)||null,o=this.mapPlacementAttributes(n,this.placementAttributesMapping),this.currentUser=this.identityService.getCurrentUser(),s=(null===(r=null===(t=this.currentUser)||void 0===t?void 0:t.getUserIdentities())||void 0===r?void 0:r.userIdentities)||{},a=s.email,!(u=o.email)||a&&a===u)return[3,5];a&&a!==u&&this.logger.warning("Email mismatch detected. Current email, ".concat(a," differs from email passed to selectPlacements call, ").concat(u,". Proceeding to call identify with ").concat(u,". Please verify your implementation.")),f.label=2;case 2:return f.trys.push([2,4,,5]),[4,new Promise((function(e){v.identityService.identify({userIdentities:p(p({},s),{email:u})},(function(){e()}))}))];case 3:return f.sent(),[3,5];case 4:return c=f.sent(),this.logger.error("Failed to identify user with new email: "+JSON.stringify(c)),[3,5];case 5:return this.setUserAttributes(o),d=p(p({},o),null===i?{}:{sandbox:i}),l=p(p({},e),{attributes:d}),[2,this.kit.selectPlacements(l)];case 6:return g=f.sent(),[2,Promise.reject(g instanceof Error?g:new Error("Unknown error occurred"))];case 7:return[2]}}
1))}))},e.prototype.hashAttributes=function(e){if(!this.isReady())return this.queueMessage({methodName:"hashAttributes",payload:e}),Promise.resolve({});try{return this.kit.hashAttributes(e)}catch(e){return Promise.reject(e instanceof Error?e:new Error("Unknown error occurred"))}},e.prototype.setExtensionData=function(e){if(this.isReady())try{this.kit.setExtensionData(e)}catch(e){var t=e instanceof Error?e.message:e+"";throw new Error("Error setting extension data: "+t)}else this.queueMessage({methodName:"setExtensionData",payload:e})},e.prototype.isReady=function(){return!(!this.kit||!this.kit.launcher)},e.prototype.setUserAttributes=function(e){var t=["sandbox"],r={};for(var n in e)e.hasOwnProperty(n)&&-1===t.indexOf(n)&&(r[n]=e[n]);try{this.currentUser.setUserAttributes(r)}catch(e){console.error("Error setting user attributes",e)}},e.prototype.mapPlacementAttributes=function(e,t){for(var r,n={},i=0,o=t;i<o.length;i++)n[(r=o[i]).map]=r.value;var s={};for(var a in e){if(e.hasOwnProperty(a))s[n[a]||a]=e[a]}return s},e.prototype.processMessageQueue=function(){var e=this;0<this.messageQueue.length&&this.isReady()&&(this.messageQueue.forEach((function(t){return v(e,void 0,void 0,(function(){return f(this,(function(e){switch(e.label){case 0:return this.kit&&t.methodName in this.kit?[4,this.kit[t.methodName](t.payload)]:[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}}
1))}))})),this.messageQueue=[])},e.prototype.queueMessage=function(e){this.messageQueue.push(e)},e}(),Hr=a.Messages,Kr=a.HTTPCodes,jr=a.FeatureFlags,qr=jr.ReportBatching,Br=jr.CaptureIntegrationSpecificIds,Wr=Hr.InformationMessages.StartingInitialization;function Jr(e){var t=this;this._instanceName=e,this._NativeSdkHelpers=new ut(this),this._SessionManager=new Et(this),this._Persistence=new jt(this),this._Helpers=new it(this),this._Events=new Bt(this),this._CookieSyncManager=new dt(this),this._ServerModel=new ur(this),this._Ecommerce=new Dt(this),this._ForwardingStatsUploader=new cr(this),this._Consent=new wr(this),this._IdentityAPIClient=new Lr(this),this._preInit={readyQueue:[],integrationDelays:{},forwarderConstructors:[]},this._IntegrationCapture=new xr,this._RoktManager=new Vr,this.IdentityType=te,this.EventType=Z,this.CommerceEventType=ee,this.PromotionType=ne,this.ProductActionType=re,this._Identity=new Pr(this),this.Identity=this._Identity.IdentityAPI,this.generateHash=this._Helpers.generateHash,this.getDeviceId=this._Persistence.getDeviceId,"undefined"!=typeof window&&window.mParticle&&window.mParticle.config&&window.mParticle.config.hasOwnProperty("rq")&&(this._preInit.readyQueue=window.mParticle.config.rq),this.init=function(e,t){var r=this;(t||console.warn("You did not pass a config object to init(). mParticle will not initialize properly"),function(e,t,r){e.Logger=new Ft(r),e._Store=new Ot(r,e,t),window.mParticle.Store=e._Store,e.Logger.verbose(Wr);try{e._Store.isLocalStorageAvailable=e._Persistence.determineLocalStorageAvailability(window.localStorage)}catch(t){e.Logger.warning("localStorage is not available, using cookies if available"),e._Store.isLocalStorageAvailable=!1}}(this,e,t),t)?!t.hasOwnProperty("requestConfig")||t.requestConfig?new kr(e,t,this).getSDKConfiguration().then((function(n){var i=r._Helpers.extend({},t,n);zr(e,i,r)})):zr(e,t,this):console.error("No config available on the window, please pass a config object to mParticle.init()")},this.setLogLevel=function(e){t.Logger.setLogLevel(e)},this.reset=function(e){try{e._Persistence.resetPersistence(),e._Store&&delete e._Store}catch(e){console.error("Cannot reset mParticle",e)}},this._resetForTests=function(e,t,r){r._Store&&delete r._Store,r._Store=new Ot(e,r),r._Store.isLocalStorageAvailable=r._Persistence.determineLocalStorageAvailability(window.localStorage),r._Events.stopTracking(),t||r._Persistence.resetPersistence(),r._Persistence.forwardingStatsBatches.uploadsTable={},r._Persistence.forwardingStatsBatches.forwardingStatsEventQueue=[],r._preInit={readyQueue:[],pixelConfigurations:[],integrationDelays:{},forwarderConstructors:[],isDevelopmentMode:!1}},this.ready=function(e){t.isInitialized()&&"function"==typeof e?e():t._preInit.readyQueue.push(e)},this.getEnvironment=function(){return t._Store.SDKConfig.isDevelopmentMode?a.Environment.Development:a.Environment.Production},this.getVersion=function(){return a.sdkVersion},this.setAppVersion=function(e){Qr((function(){t.setAppVersion(e)}),t)||(t._Store.SDKConfig.appVersion=e,t._Persistence.update())},this.setDeviceId=function(e){Qr((function(){t.setDeviceId(e)}),t)||this._Store.setDeviceId(e)},this.isInitialized=function(){return!!t._Store&&t._Store.isInitialized},this.getAppName=function(){return t._Store.SDKConfig.appName},this.setAppName=function(e){Qr((function(){t.setAppName(e)}),t)||(t._Store.SDKConfig.appName=e)},this.getAppVersion=function(){return t._Store.SDKConfig.appVersion},this.stopTrackingLocation=function(){t._SessionManager.resetSessionTimer(),t._Events.stopTracking()},this.startTrackingLocation=function(e){j(e)||t.Logger.warning("Warning: Location tracking is triggered, but not including a callback into the `startTrackingLocation` may result in events logged too quickly and not being associated with a location."),t._SessionManager.resetSessionTimer(),t._Events.startTracking(e)},this.setPosition=function(e,r){Qr((function(){t.setPosition(e,r)}),t)||(t._SessionManager.resetSessionTimer(),"number"==typeof e&&"number"==typeof r?t._Store.currentPosition={lat:e,lng:r}:t.Logger.error("Position latitude and/or longitude must both be of type number"))},this.startNewSession=function(){t._SessionManager.startNewSession()},this.endSession=function(){t._SessionManager.endSession(!0)},this.logBaseEvent=function(e,r){if(!Qr((function(){t.logBaseEvent(e,r)}),t))return t._SessionManager.resetSessionTimer(),"string"!=typeof e.name?void t.Logger.error(Hr.ErrorMessages.EventNameInvalidType):(e.eventType||(e.eventType=Z.Unknown),t._Helpers.canLog()?void t._Events.logEvent(e,r):void t.L
1ogger.error(Hr.ErrorMessages.LoggingDisabled))},this.logEvent=function(e,r,n,i,o){if(!Qr((function(){t.logEvent(e,r,n,i,o)}),t))return t._SessionManager.resetSessionTimer(),"string"!=typeof e?void t.Logger.error(Hr.ErrorMessages.EventNameInvalidType):(r||(r=Z.Unknown),t._Helpers.isEventType(r)?t._Helpers.canLog()?void t._Events.logEvent({messageType:$.PageEvent,name:e,data:n,eventType:r,customFlags:i},o):void t.Logger.error(Hr.ErrorMessages.LoggingDisabled):void t.Logger.error("Invalid event type: "+r+", must be one of: \n"+JSON.stringify(Z)))},this.logError=function(e,r){if(!Qr((function(){t.logError(e,r)}),t)&&(t._SessionManager.resetSessionTimer(),e)){"string"==typeof e&&(e={message:e});var n={m:e.message?e.message:e,s:"Error",t:e.stack||null};if(r){var i=t._Helpers.sanitizeAttributes(r,n.m);for(var o in i)n[o]=i[o]}t._Events.logEvent({messageType:$.CrashReport,name:e.name?e.name:"Error",eventType:Z.Other,data:n})}},this.logLink=function(e,r,n,i){t._Events.addEventHandler("click",e,r,i,n)},this.logForm=function(e,r,n,i){t._Events.addEventHandler("submit",e,r,i,n)},this.logPageView=function(e,r,n,i){if(!Qr((function(){t.logPageView(e,r,n,i)}),t)){if(t._SessionManager.resetSessionTimer(),t._Helpers.canLog()){if(t._Helpers.Validators.isStringOrNumber(e)||(e="PageView"),r){if(!t._Helpers.isObject(r))return void t.Logger.error("The attributes argument must be an object. A "+oe(r)+" was entered. Please correct and retry.")}else r={hostname:window.location.hostname,title:window.document.title};if(n&&!t._Helpers.isObject(n))return void t.Logger.error("The customFlags argument must be an object. A "+oe(n)+" was entered. Please correct and retry.")}t._Events.logEvent({messageType:$.PageView,name:e,data:r,eventType:Z.Unknown,customFlags:n},i)}},this.upload=function(){var e,r;t._Helpers.canLog()&&(t._Store.webviewBridgeEnabled?t._NativeSdkHelpers.sendToNative(a.NativeSdkPaths.Upload):null===(r=null===(e=t._APIClient)||void 0===e?void 0:e.uploader)||void 0===r||r.prepareAndUpload(!1,!1))},this.Consent={createCCPAConsent:t._Consent.createPrivacyConsent,createGDPRConsent:t._Consent.createPrivacyConsent,createConsentState:t._Consent.createConsentState},this.eCommerce={Cart:{add:function(e,r){t.Logger.warning("Deprecated function eCommerce.Cart.add() will be removed in future releases");var n,i=t.Identity.getCurrentUser();i&&(n=i.getMPID()),t._Identity.mParticleUserCart(n).add(e,r)},remove:function(e,r){t.Logger.warning("Deprecated function eCommerce.Cart.remove() will be removed in future releases");var n,i=t.Identity.getCurrentUser();i&&(n=i.getMPID()),t._Identity.mParticleUserCart(n).remove(e,r)},clear:function(){t.Logger.warning("Deprecated function eCommerce.Cart.clear() will be removed in future releases");var e,r=t.Identity.getCurrentUser();r&&(e=r.getMPID()),t._Identity.mParticleUserCart(e).clear()}},setCurrencyCode:function(e){return Qr((function(){t.eCommerce.setCurrencyCode(e)}),t)?void 0:"string"==typeof e?(t._SessionManager.resetSessionTimer(),void(t._Store.currencyCode=e)):void t.Logger.error("Code must be a string")},createProduct:function(e,r,n,i,o,s,a,u,c,d){return t._Ecommerce.createProduct(e,r,n,i,o,s,a,u,c,d)},createPromotion:function(e,r,n,i){return t._Ecommerce.createPromotion(e,r,n,i)},createImpression:function(e,r){return t._Ecommerce.createImpression(e,r)},createTransactionAttributes:function(e,r,n,i,o,s){return t._Ecommerce.createTransactionAttributes(e,r,n,i,o,s)},logCheckout:function(e,r,n,i){return t.Logger.warning("mParticle.logCheckout is deprecated, please use mParticle.logProductAction instead"),t._Store.isInitialized?(t._SessionManager.resetSessionTimer(),void t._Events.logCheckoutEvent(e,r,n,i)):void t.ready((function(){t.eCommerce.logCheckout(e,r,n,i)}))},logProductAction:function(e,r,n,i,o,s){Qr((function(){t.eCommerce.logProductAction(e,r,n,i,o,s)}),t)||(t._SessionManager.resetSessionTimer(),t._Events.logProductActionEvent(e,r,n,i,o,s))},logPurchase:function(e,r,n,i,o){return t.Logger.warning("mParticle.logPurchase is deprecated, please use mParticle.logProductAction instead"),t._Store.isInitialized?e&&r?(t._SessionManager.resetSessionTimer(),void t._Events.logPurchaseEvent(e,r,i,o)):void t.L
1ogger.error(Hr.ErrorMessages.BadLogPurchase):void t.ready((function(){t.eCommerce.logPurchase(e,r,n,i,o)}))},logPromotion:function(e,r,n,i,o){Qr((function(){t.eCommerce.logPromotion(e,r,n,i,o)}),t)||(t._SessionManager.resetSessionTimer(),t._Events.logPromotionEvent(e,r,n,i,o))},logImpression:function(e,r,n,i){Qr((function(){t.eCommerce.logImpression(e,r,n,i)}),t)||(t._SessionManager.resetSessionTimer(),t._Events.logImpressionEvent(e,r,n,i))},logRefund:function(e,r,n,i,o){return t.Logger.warning("mParticle.logRefund is deprecated, please use mParticle.logProductAction instead"),t._Store.isInitialized?(t._SessionManager.resetSessionTimer(),void t._Events.logRefundEvent(e,r,i,o)):void t.ready((function(){t.eCommerce.logRefund(e,r,n,i,o)}))},expandCommerceEvent:function(e){return t._Ecommerce.expandCommerceEvent(e)}},this.setSessionAttribute=function(e,r){if(!Qr((function(){t.setSessionAttribute(e,r)}),t)&&t._Helpers.canLog()){if(!t._Helpers.Validators.isValidAttributeValue(r))return void t.Logger.error(Hr.ErrorMessages.BadAttribute);if(!t._Helpers.Validators.isValidKeyValue(e))return void t.Logger.error(Hr.ErrorMessages.BadKey);if(t._Store.webviewBridgeEnabled)t._NativeSdkHelpers.sendToNative(a.NativeSdkPaths.SetSessionAttribute,JSON.stringify({key:e,value:r}));else{var n=t._Helpers.findKeyInObject(t._Store.sessionAttributes,e);n&&(e=n),t._Store.sessionAttributes[e]=r,t._Persistence.update(),t._Forwarders.applyToForwarders("setSessionAttribute",[e,r])}}},this.setOptOut=function(e){Qr((function(){t.setOptOut(e)}),t)||(t._SessionManager.resetSessionTimer(),t._Store.isEnabled=!e,t._Events.logOptOut(),t._Persistence.update(),t._Store.activeForwarders.length&&t._Store.activeForwarders.forEach((function(r){if(r.setOptOut){var n=r.setOptOut(e);n&&t.Logger.verbose(n)}})))},this.setIntegrationAttribute=function(e,r){if(!Qr((function(){t.setIntegrationAttribute(e,r)}),t)){if("number"!=typeof e)return void t.Logger.error("integrationId must be a number");if(null===r)t._Store.integrationAttributes[e]={};else{if(!t._Helpers.isObject(r))return void t.Logger.error("Attrs must be an object with keys and values. You entered a "+oe(r));if(0===Object.keys(r).length)t._Store.integrationAttributes[e]={};else for(var n in r)"string"==typeof n?"string"==typeof r[n]?(t._Helpers.isObject(t._Store.integrationAttributes[e])||(t._Store.integrationAttributes[e]={}),t._Store.integrationAttributes[e][n]=r[n]):t.Logger.error("Values for integration attributes must be strings. You entered a "+oe(r[n])):t.Logger.error("Keys must be strings, you entered a "+oe(n))}t._Persistence.update()}},this.getIntegrationAttributes=function(e){return t._Store.integrationAttributes[e]?t._Store.integrationAttributes[e]:{}},this.addForwarder=function(e){t._preInit.forwarderConstructors.push(e)},this.configurePixel=function(e){t._Forwarders.configurePixel(e)},this._getActiveForwarders=function(){return t._Store.activeForwarders},this._getIntegrationDelays=function(){return t._preInit.integrationDelays},this._setIntegrationDelay=function(e,r){if(t._preInit.integrationDelays[e]=r,!0!==r){var n=Object.keys(t._preInit.integrationDelays);if(0!==n.length){var i=n.some((function(e){return!0===t._preInit.integrationDelays[e]}));i||t._APIClient.processQueuedEvents()}}},this._setWrapperSDKInfo=function(e,r){Qr((function(){t._setWrapperSDKInfo(e,r)}),t)||(void 0===t._Store.wrapperSDKInfo||!t._Store.wrapperSDKInfo.isInfoSet)&&(t._Store.wrapperSDKInfo={name:e,version:r,isInfoSet:!0})}}function zr(e,t,r){var n=function(e,t){var r,n,i,o;return e.dataPlanOptions&&(t.Logger.verbose("Customer provided data plan found"),o=e.dataPlanOptions,n={document:{dtpn:{vers:o.dataPlanVersion,blok:{ev:o.blockEvents,ea:o.blockEventAttributes,ua:o.blockUserAttributes,id:o.blockUserIdentities}}}}),n||(e.dataPlan&&e.dataPlan.document?e.dataPlan.document.error_message?i=e.dataPlan.document.error_message:(t.Logger.verbose("Data plan found from mParticle.js"),n=e.dataPlan):e.dataPlanResult&&(e.dataPlanResult.error_message?i=e.dataPlanResult.error_message:(t.Logger.verbose("Data plan found from /config"),n={document:e.dataPlanResult}))),i&&t.Logger.error(i),n&&(r=new Tr(n,t)),r}(t,r);if(r._APIClient=new Ze(r,n),r._Forwarders=new ir(r,n),r._Store.processConfig(t),r._Identity.idCache=function(e){return new Je("".concat(e._Store.storageName,"-id-cache"),{logger:e.Logger})}(r),_t(r._Identity.idCache),r._Store.webviewBridgeEnabled)r._NativeSdkHelpers.initializeSessionAttributes(e);else{r._Persistence.initializeStorage(),r._Store.syncPersistenceData();var i=r.Identity.getCurrentUser(),o=i?i.getMPID():null,s=i?i.getUserIdentities().userIdentities:{};r._Store.SDKConfig.identifyRequest=r._Store.hasInvalidIdentifyRequest()?{userIdentities:s}:r._Store.SDKConfig.identifyRequest,r._Helpers.getFeatureFlag(qr)&&r._ForwardingStatsUploader.startForwardingStatsTimer(),r._Helpers.getFeatureFlag(Br)&&r._IntegrationCapture.capture();var a=X(t,"Rokt",181);if(a){var u=$t(o,{userAttributeFilters:a.userAttributeFilters},r),c={sandbox:null==t?void 0:t.isDevelopmentMode,launcherOptions:null==t?void 0:t.launcherOptions,domain:null==t?void 0:t.domain};r._RoktManager.init(a,u,r.Identity,r.Logger,c)}r._Forwarders.processForwarders(t,r._APIClient.prepareForwardingStats),r._Forwarders.processPixelConfigs(t),r._SessionManager.initialize(),r._Events.logAST(),function(e,t,r,n){!e._Store.identifyCalled&&e._Store.SDKConfig.identityCallback&&t&&r&&e._Store.SDKConfig.identityCallback({httpCode:Kr.activeSession,getUser:function(){return e._Identity.mParticleUser(r)},getPreviousUser:function(){var t=e.Identity.getUsers(),n=t.shift(),i=n.getMPID();return n&&i===r&&(n=t.shift()),n||null},body:{mpid:r,is_logged_in:e._Store.isLoggedIn,matched_identities:n,context:null,is_ephemeral:!1}})}(r,i,o,s)}(r._Store.mpid&&!r._Store.identifyCalled||r._Store.webviewBridgeEnabled)&&(r._Store.isInitialized=!0,r._preInit.ready
1Queue=lr(r._preInit.readyQueue)),r._Store.isFirstRun&&(r._Store.isFirstRun=!1)}function Qr(e,t){return!t.isInitialized()&&(t.ready((function(){e()})),!0)}var Gr=function(){return null},Yr=function(){function e(){}return e.prototype.getMPInstance=function(){return{_Helpers:{sanitizeAttributes:window.mParticle.getInstance()._Helpers.sanitizeAttributes,generateHash:function(){return"mockHash"},generateUniqueId:function(){return"mockId"},extend:window.mParticle.getInstance()._Helpers.extend,createServiceUrl:Gr,parseNumber:Gr,isObject:Gr,Validators:null},_resetForTests:Gr,_APIClient:null,_timeOnSiteTimer:{getTimeInForeground:Gr},MPSideloadedKit:null,_Consent:null,_Events:null,_Forwarders:null,_NativeSdkHelpers:null,_Persistence:null,_preInit:null,Consent:null,_ServerModel:null,_SessionManager:null,_Store:{sessionId:"mockSessionId",sideloadedKits:[],devToken:"test_dev_token",isFirstRun:!0,isEnabled:!0,sessionAttributes:{},currentSessionMPIDs:[],consentState:null,clientId:null,deviceId:null,serverSettings:{},dateLastEventSent:null,sessionStartDate:null,currentPosition:null,isTracking:!1,watchPositionId:null,cartProducts:[],eventQueue:[],currencyCode:null,globalTimer:null,context:null,configurationLoaded:!1,identityCallInFlight:!1,nonCurrentUserMPIDs:{},identifyCalled:!1,isLoggedIn:!1,cookieSyncDates:{},integrationAttributes:{},requireDelay:!0,isLocalStorageAvailable:null,integrationDelayTimeoutStart:null,storageName:null,prodStorageName:null,activeForwarders:[],kits:{},configuredForwarders:[],pixelConfigurations:[],wrapperSDKInfo:{name:"none",version:null,isInfoSet:!1},SDKConfig:{isDevelopmentMode:!1,onCreateBatch:Gr}},config:null,eCommerce:null,Identity:{getCurrentUser:Gr,IdentityAPI:{},identify:Gr,login:Gr,logout:Gr,modify:Gr},Logger:{verbose:Gr,error:Gr,warning:Gr},ProductActionType:null,ServerModel:null,addForwarder:Gr,generateHash:Gr,getAppVersion:Gr,getAppName:Gr,getInstance:Gr,getDeviceId:Gr,init:Gr,logBaseEvent:Gr,logEvent:Gr,logLevel:"none",setPosition:Gr,upload:Gr}},e.prototype.createSDKEventFunction=function(e){return new ur(this.getMPInstance()).createEventObject(e)},e.prototype.returnBatch=function(e){var t=this,r=this.getMPInstance();return Ee("0",Array.isArray(e)?e.map((function(e){return t.createSDKEventFunction(e)})):[this.createSDKEventFunction(e)],r)},e}(),Xr=function(){function e(e){this.filterDictionary={eventTypeFilters:[],eventNameFilters:[],screenNameFilters:[],screenAttributeFilters:[],userIdentityFilters:[],userAttributeFilters:[],attributeFilters:[],consentRegulationFilters:[],consentRegulationPurposeFilters:[],messageTypeFilters:[],messageTypeStateFilters:[],filteringEventAttributeValue:{},filteringUserAttributeValue:{},filteringConsentRuleValues:{}},this.kitInstance=e}return e.prototype.addEventTypeFilter=function(e){var t=rt.hashEventType(e);this.filterDictionary.eventTypeFilters.push(t)},e.prototype.addEventNameFilter=function(e,t){var r=rt.hashEventName(t,e);this.filterDictionary.eventNameFilters.push(r)},e.prototype.addEventAttributeFilter=function(e,t,r){var n=rt.hashEventAttributeKey(e,t,r);this.filterDictionary.attributeFilters.push(n)},e.prototype.addScreenNameFilter=function(e){var t=rt.hashEventName(e,Z.Unknown);this.filterDictionary.screenNameFilters.push(t)},e.prototype.addScreenAttributeFilter=function(e,t){var r=rt.hashEventAttributeKey(Z.Unknown,e,t);this.filterDictionary.screenAttributeFilters.push(r)},e.prototype.addUserIdentityFilter=function(e){var t=rt.hashUserIdentity(e);this.filterDictionary.userIdentityFilters.push(t)},e.prototype.addUserAttributeFilter=function(e){var t=rt.hashUserAttribute(e);this.filterDictionary.userAttributeFilters.push(t)},e}();Array.prototype.forEach||(Array.prototype.forEach=s.forEach),Array.prototype.map||(Array.prototype.map=s.map),Array.prototype.filter||(Array.prototype.filter=s.filter),Array.isArray||(Array.prototype.isArray=s.isArray);var $r=new function(){var e=this;this.Store={},this._instances={},this.IdentityType=te,this.EventType=Z,this.CommerceEventType=ee,this.PromotionType=ne,this.ProductActionType=re,this.MPSideloadedKit=Xr,"undefined"!=typeof window&&(this.isIOS=!(!window.mParticle||!window.mParticle.isIOS)&&window.mParticle.isIOS,this.config=window.mParticle&&window.mParticle.config?window.mParticle.config:{}),this.init=function(t,r,n){!r&&window.mParticle&&window.mParticle.config&&(console.warn("You did not pass a config object to mParticle.init(). Attempting to use the window.mParticle.config if it exists. Please note that in a future release, this may not work and mParticle will not initialize properly"),r=window.mParticle?window.mParticle.config:{}),n=(n&&0!==n.length?n:a.DefaultInstance).toLowerCase();var i=e._instances[n];void 0===i&&(i=new Jr(n),e._instances[n]=i),i.init(t,r,n)},this.getInstance=function(t){var r;return t?(r=e._instances[t.toLowerCase()])||(console.log("You tried to initialize an instance named "+t+". This instance does not exist. Check your instance name or initialize a new instance with this name before calling it."),null):(t=a.DefaultInstance,(r=e._instances[t])||(r=new Jr(t),e._instances[a.DefaultInstance]=r),r)},this.Rokt=e.getInstance()._RoktManager,this.getDeviceId=function(){return e.getInstance().getDeviceId()},this.setDeviceId=function(t){return e.getInstance().setDeviceId(t)},this.isInitialized=function(){return e.getInstance().isInitialized()},this.startNewSession=function(){e.getInstance().startNewSession()},this.endSession=function(){e.getInstance().endSession()},this.setLogLevel=function(t){e.getInstance().setLogLevel(t)}
1,this.ready=function(t){e.getInstance().ready(t)},this.setAppVersion=function(t){e.getInstance().setAppVersion(t)},this.getAppName=function(){return e.getInstance().getAppName()},this.setAppName=function(t){e.getInstance().setAppName(t)},this.getAppVersion=function(){return e.getInstance().getAppVersion()},this.getEnvironment=function(){return e.getInstance().getEnvironment()},this.stopTrackingLocation=function(){e.getInstance().stopTrackingLocation()},this.startTrackingLocation=function(t){e.getInstance().startTrackingLocation(t)},this.setPosition=function(t,r){e.getInstance().setPosition(t,r)},this.startNewSession=function(){e.getInstance().startNewSession()},this.endSession=function(){e.getInstance().endSession()},this.logBaseEvent=function(t,r){e.getInstance().logBaseEvent(t,r)},this.logEvent=function(t,r,n,i,o){e.getInstance().logEvent(t,r,n,i,o)},this.logError=function(t,r){e.getInstance().logError(t,r)},this.logLink=function(t,r,n,i){e.getInstance().logLink(t,r,n,i)},this.logForm=function(t,r,n,i){e.getInstance().logForm(t,r,n,i)},this.logPageView=function(t,r,n,i){e.getInstance().logPageView(t,r,n,i)},this.upload=function(){e.getInstance().upload()},this.eCommerce={Cart:{add:function(t,r){e.getInstance().eCommerce.Cart.add(t,r)},remove:function(t,r){e.getInstance().eCommerce.Cart.remove(t,r)},clear:function(){e.getInstance().eCommerce.Cart.clear()}},setCurrencyCode:function(t){e.getInstance().eCommerce.setCurrencyCode(t)},createProduct:function(t,r,n,i,o,s,a,u,c,d){return e.getInstance().eCommerce.createProduct(t,r,n,i,o,s,a,u,c,d)},createPromotion:function(t,r,n,i){return e.getInstance().eCommerce.createPromotion(t,r,n,i)},createImpression:function(t,r){return e.getInstance().eCommerce.createImpression(t,r)},createTransactionAttributes:function(t,r,n,i,o,s){return e.getInstance().eCommerce.createTransactionAttributes(t,r,n,i,o,s)},logCheckout:function(t,r,n,i){e.getInstance().eCommerce.logCheckout(t,r,n,i)},logProductAction:function(t,r,n,i,o,s){e.getInstance().eCommerce.logProductAction(t,r,n,i,o,s)},logPurchase:function(t,r,n,i,o){e.getInstance().eCommerce.logPurchase(t,r,n,i,o)},logPromotion:function(t,r,n,i,o){e.getInstance().eCommerce.logPromotion(t,r,n,i,o)},logImpression:function(t,r,n,i){e.getInstance().eCommerce.logImpression(t,r,n,i)},logRefund:function(t,r,n,i,o){e.getInstance().eCommerce.logRefund(t,r,n,i,o)},expandCommerceEvent:function(t){return e.getInstance().eCommerce.expandCommerceEvent(t)}},this.setSessionAttribute=function(t,r){e.getInstance().setSessionAttribute(t,r)},this.setOptOut=function(t){e.getInstance().setOptOut(t)},this.setIntegrationAttribute=function(t,r){e.getInstance().setIntegrationAttribute(t,r)},this.getIntegrationAttributes=function(t){return e.getInstance().getIntegrationAttributes(t)},this.Identity={HTTPCodes:a.HTTPCodes,aliasUsers:function(t,r){e.getInstance().Identity.aliasUsers(t,r)},createAliasRequest:function(t,r){return e.getInstance().Identity.createAliasRequest(t,r)},getCurrentUser:function(){return e.getInstance().Identity.getCurrentUser()},getUser:function(t){return e.getInstance().Identity.getUser(t)},getUsers:function(){return e.getInstance().Identity.getUsers()},identify:function(t,r){e.getInstance().Identity.identify(t,r)},login:function(t,r){e.getInstance().Identity.login(t,r)},logout:function(t,r){e.getInstance().Identity.logout(t,r)},modify:function(t,r){e.getInstance().Identity.modify(t,r)}},this.sessionManager={getSession:function(){return e.getInstance()._SessionManager.getSession()}},this.Consent={createConsentState:function(){return e.getInstance().Consent.createConsentState()},createGDPRConsent:function(t,r,n,i,o){return e.getInstance().Consent.createGDPRConsent(t,r,n,i,o)},createCCPAConsent:function(t,r,n,i,o){return e.getInstance().Consent.createGDPRConsent(t,r,n,i,o)}},this.reset=function(){e.getInstance().reset(e.getInstance())},this._resetForTests=function(t,r){"boolean"==typeof r?e.getInstance()._resetForTests(t,r,e.getInstance()):e.getInstance()._resetForTests(t,!1,e.getInstance())},this.configurePixel=function(t){e.getInstance().configurePixel(t)},this._setIntegrationDelay=function(t,r){e.getInstance()._setIntegrationDelay(t,r)},this._getIntegrationDelays=function(){return e.getInstance()._getIntegrationDelays()},this.getVersion=function(){return e.getInstance().getVersion()},this.generateHash=function(t){return e.getInstance().generateHash(t)},this.addForwarder=function(t){e.getInstance().addForwarder(t)},this._getActiveForwarders=function(){return e.getInstance()._getActiveForwarders()},this._setWrapperSDKInfo=function(t,r){e.getInstance()._setWrapperSDKInfo(t,r)}};"undefined"!=typeof window&&(window.mParticle=$r,window.mParticle._BatchValidator=new Yr)}}]); 2//# sourceMappingURL=vendors~mparticle_web-sdk-f670f4.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.