1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,51836,25027,49537,29361,76180,66953,19256,11433,40502,99416,30181,75704,56866,90428,18451,87285,28425,58610,94792,27517,87049,79946,66516,16731,63515,55582,51828,18913,5575,93592,38666,29899,34348,76656,90204,12068,47545,58176,19390,22557,t=>{"use strict";function e(t){let e,i=null==t?void 0:t.Rt(Q.Tt.SS);return i&&(e={label:i.l,name:i.a}),e}t.s(["OPTIONS",()=>eS,"default",()=>ey],51836),t.s(["STORAGE_KEYS",()=>Q,"default",()=>tt],18451),t.s(["BRAZE_ACTION_URI_REGEX",()=>D,"isValidBrazeActionJson",()=>q,"isValidBrazeActionType",()=>G,"isValidEmail",()=>j,"validateCustomAttributeArrayType",()=>F,"validateCustomAttributeKey",()=>U,"validateCustomProperties",()=>z,"validateCustomString",()=>P,"validatePropertyType",()=>M,"validateStandardString",()=>$],99416),t.s(["BRAZE_ACTIONS",()=>E,"INELIGIBLE_BRAZE_ACTION_URL_ERROR_TYPES",()=>C,"containsPushPrimerBrazeAction",()=>k,"containsUnknownBrazeAction",()=>O,"getDecodedBrazeAction",()=>_,"ineligibleBrazeActionURLErrorMessage",()=>I],11433),t.s(["default",()=>tc],94792),t.s(["default",()=>tg],27517),t.s(["TriggersProviderFactory",()=>ea],47545),t.s(["default",()=>er],12068),t.s(["default",()=>tV],93592),t.s(["default",()=>tJ],5575),t.s(["default",()=>tY],29899),t.s(["default",()=>tX],34348),t.s(["default",()=>tQ],76656);let i={init:function(t){void 0===t&&void 0!==i.zg||(i.zg=!!t),i.i||(i.i=!0)},destroy:function(){i.i=!1,i.zg=void 0,i.vd=void 0},setLogger:function(t){"function"==typeof t?(i.init(),i.vd=t):i.info("Ignoring setLogger call since logger is not a function")},toggleLogging:function(){i.init(),i.zg?(console.log("Disabling Braze logging"),i.zg=!1):(console.log("Enabled Braze logging"),i.zg=!0)},info:function(t){if(i.zg){let e="Braze: "+t;null!=i.vd?i.vd(e):console.log(e)}},warn:function(t){if(i.zg){let e="Braze SDK Warning: "+t+" (v6.7.1)";null!=i.vd?i.vd(e):console.warn(e)}},error:function(t){if(i.zg){let e="Braze SDK Error: "+t+" (v6.7.1)";null!=i.vd?i.vd(e):console.error(e)}}};function s(t){let e=[];for(let i in t)Object.prototype.hasOwnProperty.call(t,i)&&void 0!==t[i]&&e.push(t[i]);return e}function n(t,e,n,r){let o=s(t);return -1!==o.indexOf(e)||(i.error(`${n} Valid values from ${r} are "${o.join('"/"')}".`),!1)}function r(t){return Array.isArray?Array.isArray(t):"[object Array]"===Object.prototype.toString.call(t)}function o(t){return"[object Date]"===Object.prototype.toString.call(t)}function l(t){return"[object Object]"===Object.prototype.toString.call(t)}function a(t){let e=[];for(let i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.push(i);return e}function u(t,e){if(t===e)return 0!==t||1/t==1/e;if(null==t||null==e)return t===e;let i=t.toString();if(i!==e.toString())return!1;switch(i){case"[object RegExp]":case"[object String]":return""+t==""+e;case"[object Number]":return+t!=+t?+e!=+e:0==+t?1/t==1/e:+t==+e;case"[object Date]":case"[object Boolean]":return+t==+e}let s="[object Array]"===i;if(!s){if("object"!=typeof t||"object"!=typeof e)return!1;let i=t.constructor,s=e.constructor;if(i!==s&&!("function"==typeof i&&i instanceof i&&"function"==typeof s&&s instanceof s)&&"constructor"in t&&"constructor"in e)return!1}let n=[],r=[],o=n.length;for(;o--;)if(n[o]===t)return r[o]===e;if(n.push(t),r.push(e),s){if((o=t.length)!==e.length)return!1;for(;o--;)if(!u(t[o],e[o]))return!1}else{let i,s=a(t);if(o=s.length,a(e).length!==o)return!1;for(;o--;)if(i=s[o],!Object.prototype.hasOwnProperty.call(e,i)||!u(t[i],e[i]))return!1}return n.pop(),r.pop(),!0}function h(t,e=!1){let i=t/1e3;return e&&(i=Math.floor(i)),i}function c(t){if(null==t)return null;let e=parseInt(t.toString());return isNaN(e)?null:new Date(1e3*e)}function d(t){return null!=t&&o(t)?t.toISOString().replace(/\.[0-9]{3}Z$/,""):t}function g(t){return null==t||""===t?null:new Date(t)}function f(t){return(new Date().valueOf()-t.valueOf())/1e3}function p(t){return(t.valueOf()-new Date().valueOf())/1e3}t.s(["logger",0,i],25027),t.s(["isArray",0,r,"isDate",0,o,"isEqual",0,u,"isObject",0,l,"keys",0,a,"validateValueIsFromEnum",0,n,"values",0,s],49537);class m{constructor(t,e,i,s,n){this.userId=t,this.type=e,this.time=i,this.sessionId=s,this.data=n,this.userId=t,this.type=e,this.time=function(t){return null==t||""===t?new Date().valueOf():t}(i),this.sessionId=s,this.data=n}ta(){var t;
1let i={name:this.type,time:h(this.time),data:this.data||{},session_id:this.sessionId};null!=this.userId&&(i.user_id=this.userId);let s=(null==(t=ey.Br())?void 0:t.Fh())||!1;if(!i.user_id&&!s){let t=e(ey.p());t&&(i.alias=t)}return i}qt(){return{u:this.userId,t:this.type,ts:this.time,s:this.sessionId,d:this.data}}static fromJson(t){return new m(t.user_id,t.name,t.time,t.session_id,t.data)}static hS(t){return null!=t&&l(t)&&null!=t.t&&""!==t.t}static _u(t){return new m(t.u,t.t,t.ts,t.s,t.d)}}let b={de:function(){if("u">typeof window&&window.crypto){if("function"==typeof window.crypto.randomUUID)return window.crypto.randomUUID();if("function"==typeof window.crypto.getRandomValues)try{let t=new Uint8Array(16);window.crypto.getRandomValues(t),t[6]=15&t[6]|64,t[8]=63&t[8]|128;let e=Array.from(t,t=>("0"+t.toString(16)).slice(-2));return[e.slice(0,4).join(""),e.slice(4,6).join(""),e.slice(6,8).join(""),e.slice(8,10).join(""),e.slice(10,16).join("")].join("-")}catch(t){}}let t=(t=!1)=>{let e=(Math.random().toString(16)+"000000000").substr(2,8);return t?"-"+e.substr(0,4)+"-"+e.substr(4,4):e};return t()+t(!0)+t(!0)+t()}};t.s(["Guid",0,b],29361);let v=t=>t instanceof Error?t.message:String(t);t.s(["getErrorMessage",0,v],76180);class S{constructor(t,e,i){this.Tu=t,null==t&&(t=b.de()),!i||isNaN(i)?this.lm=new Date().valueOf():this.lm=i,this.Tu=t,this.pm=new Date().valueOf(),this.fm=e}qt(){return`g:${encodeURIComponent(this.Tu)}|e:${this.fm}|c:${this.lm}|l:${this.pm}`}static cS(t){let e;if("string"!=typeof t)return null;let i=t.lastIndexOf("|e:"),s=t.substring(0,i),n=s.split("g:")[1];return e=/[|:]/.test(n)?encodeURIComponent(n):n,t=t.replace(s,`g:${e}`)}static _u(t){let e;if("string"==typeof t)try{let i=t.split("|");if(!r(i)||4!==i.length)return null;let s=t=>t.split(":")[1],n=t=>{let e=parseInt(s(t));if(!isNaN(e))return e};(e=new S(decodeURIComponent(s(i[0])),n(i[1]),n(i[2]))).pm=n(i[3])}catch(e){i.info(`Unable to parse cookie string ${t}, failed with error: ${v(e)}`)}else{if(null==t||null==t.g)return null;(e=new S(t.g,t.e,t.c)).pm=t.l}return e}}let y={CustomEvent:"ce",Pr:"p",Uc:"pc",ev:"ca",gl:"i",Ya:"ie",ds:"cci",js:"ccic",os:"ccc",cs:"ccd",wm:"ss",hm:"se",Fn:"si",On:"sc",Xn:"sbc",tv:"sfe",om:"iec",Oc:"lr",Nc:"uae",Kc:"lcaa",Jc:"lcar",Zu:"inc",Qu:"add",Xu:"rem",Yu:"set",Vu:"ncam",Wc:"sgu",xo:"ffi",ro:"bi",Dt:"bc",Ft:"bd"};function T(t){let e=t.length;for(let i=t.length-1;i>=0;i--){let s=t.charCodeAt(i);s>127&&s<=2047?e++:s>2047&&s<=65535&&(e+=2),s>=56320&&s<=57343&&i--}return e}function w(t){try{t=t.replace(/-/g,"+").replace(/_/g,"/");let e=window.atob(t),i=new Uint8Array(e.length);for(let t=0;t<e.length;t++)i[t]=e.charCodeAt(t);let s=new Uint16Array(i.buffer);return String.fromCharCode(...s)}catch(t){return i.error("Unable to decode Base64: "+t),null}}t.s(["EventTypes",0,y],66953),t.s(["decodeBrazeActions",0,w,"getByteLength",0,T],19256);let E={types:{io:"container",logCustomEvent:"logCustomEvent",setEmailNotificationSubscriptionType:"setEmailNotificationSubscriptionType",setPushNotificationSubscriptionType:"setPushNotificationSubscriptionType",setCustomUserAttribute:"setCustomUserAttribute",requestPushPermission:"requestPushPermission",addToSubscriptionGroup:"addToSubscriptionGroup",removeFromSubscriptionGroup:"removeFromSubscriptionGroup",addToCustomAttributeArray:"addToCustomAttributeArray",removeFromCustomAttributeArray:"removeFromCustomAttributeArray",mo:"openLink",uo:"openLinkInWebView"},properties:{type:"type",eo:"steps",so:"args"}},C={Un:"unknownBrazeAction",Zc:"noPushPrompt"},I=(t,e)=>t===C.Un?`${e} contains an unknown braze action type and will not be displayed.`:"";function _(t){try{let e=t.match(D),s=e?e[0].length:null,n=s?t.substring(s):null;if(null==s||s>t.length-1||!n)return void i.error(`Did not find base64 encoded brazeAction in url to process : ${t}`);let r=w(n);return r?JSON.parse(r):void i.error(`Failed to decode base64 encoded brazeAction: ${n}`)}catch(e){return void i.error(`Failed to process brazeAction URL ${t} : ${v(e)}`)}}function A(t,e){let i=!1;if(e){for(let s of e)if(i=i||t(s))return!0}return!1}function O(t){let e=E.properties.type,i=E.properties.eo;try{if(null==t)return!0;let s=t[e];return s===E.types.io?A(O,t[i]):!G(s)}catch(t){return!0}}function k(t){if(!t||!q(t))return!1;let e=E.properties.type,i=E.properties.eo,s=t[e];return s===E.types.io?A(k,t[i]):s===E.types.requestPushPermission}let R={ee:"Braze must be initialized before calling methods.",je:"logCustomEvent",Ku:"setCustomUserAttribute"};t.s(["CoreStrings",0,R,"DISMISSALS_CACHE_SIZE_DEFAULT",0,200,"GLOBAL_RATE_LIMIT_CAPACITY_DEFAULT",0,30,"GLOBAL_RATE_LIMIT_REFILL_RATE_DEFAULT",0,30,"LA
1ST_REQUEST_TO_ENDPOINT_MS_AGO_DEFAULT",0,72e5,"MAX_PURCHASE_QUANTITY",0,100,"MAX_RETRY_COUNT_PER_REQUEST",0,15,"REQUEST_ATTEMPT_DEFAULT",0,1,"REQUEST_BACKOFF_MAX_SLEEP_MS_DEFAULT",0,3e5,"REQUEST_BACKOFF_MIN_SLEEP_MS_DEFAULT",0,1e4,"REQUEST_BACKOFF_SCALE_FACTOR_DEFAULT",0,3],40502);let N=/^[^\x00-\x1F\x22]+$/,x=/[$.]/,B=["$add","$update","$remove","$identifier_key","$identifier_value","$new_object","$time","$google_ad_personalization","$google_ad_user_data"],L=/^[^@\s]+@[^@\s]+\.[^@\s]+$/,D=/^brazeActions:\/\/v\d+\//;function P(t,e,s){let n=null!=t&&"string"==typeof t&&(""===t||null!=t.match(N));return n||i.error(`Cannot ${e} because ${s} "${t}" is invalid.`),n}function U(t){return null!=t&&t.match(x)&&-1===B.indexOf(t)&&i.warn("Custom attribute keys cannot contain '$' or '.'"),P(t,"set custom user attribute","the given key")}function M(t){let e=typeof t;return null==t||"number"===e||"boolean"===e||o(t)||"string"===e}function $(t,e,s,n=!1){let r="string"==typeof t||null===t&&n;return r||i.error(`Cannot ${e} because ${s} "${t}" is invalid.`),r}function z(t,e,s,n,u){let h,c,g;if(null==t&&(t={}),"object"!=typeof t||r(t))return i.error(`${e} requires that ${s} be an object. Ignoring ${u}.`),[!1,null];e===R.Ku?(h=76800,c="75KB"):(h=51200,c="50KB");let f=JSON.stringify(t);if(T(f)>h)return i.error(`Could not ${n} because ${s} was greater than the max size of ${c}.`),[!1,null];try{g=JSON.parse(f)}catch(t){return i.error(`Could not ${n} because ${s} did not contain valid JSON.`),[!1,null]}for(let s in t){if(e===R.Ku&&!U(s)||!P(s,n,`the ${u} property name`))return[!1,null];let h=t[s];if(e!==R.Ku&&null==h){delete t[s],delete g[s];continue}if(o(h)&&(g[s]=d(h)),!function(t,e,s,n,u){let h;return(h=l(t)||r(t)?function t(e,s,n){let u=-1!==n;if(u&&n>50)return i.error("Nested attributes cannot be more than 50 levels deep."),!1;let h=u?n+1:-1;if(r(e)&&r(s)){for(let i=0;i<e.length&&i<s.length;i++)if(o(e[i])&&(s[i]=d(e[i])),!t(e[i],s[i],h))return!1}else{if(!l(e))return M(e);for(let i of a(e)){let n=e[i];if(u&&!U(i)||(o(n)&&(s[i]=d(n)),!t(n,s[i],h)))return!1}}return!0}(t,e,u?1:-1):M(t))||i.error(`Cannot ${s} because ${n} "${t}" is invalid.`),h}(h,g[s],n,`the ${u} property "${s}"`,e===R.Ku))return[!1,null]}return[!0,g]}function F(t,e){let s=!1,n=!1,r=()=>{i.error("Custom attribute arrays must be either string arrays or object arrays.")};for(let i of e)if("string"==typeof i){if(n)return r(),[!1,!1];if(!P(i,`set custom user attribute "${t}"`,"the element in the given array"))return[!1,!1];s=!0}else{if(!l(i)||s)return r(),[!1,!1];if(!z(i,R.Ku,"attribute value",`set custom user attribute "${t}"`,"custom user attribute"))return[!1,!1];n=!0}return[s,n]}function j(t){if("string"!=typeof t)return!1;let e=t.length;return!(0===e||e>256)&&L.test(t.toLowerCase())}function q(t){if(!(E.properties.type in t))return!1;switch(t[E.properties.type]){case E.types.io:if(E.properties.eo in t)return!0;break;case E.types.logCustomEvent:case E.types.setEmailNotificationSubscriptionType:case E.types.setPushNotificationSubscriptionType:case E.types.setCustomUserAttribute:case E.types.addToSubscriptionGroup:case E.types.removeFromSubscriptionGroup:case E.types.addToCustomAttributeArray:case E.types.removeFromCustomAttributeArray:case E.types.mo:case E.types.uo:if(E.properties.so in t)return!0;break;case E.types.requestPushPermission:return!0}return!1}function G(t){let e=!1;return Object.keys(E.types).forEach(i=>{E.types[i]!==t.toString()||(e=!0)}),e}class W{constructor(t,e){this.Ss=t,this.Ru=e,this.Ss=t,this.Ru=e}getUserId(t){let e=this.Ss.getUserId();if("function"!=typeof t)return e;i.warn("The callback for getUserId is deprecated. You can access its return value directly instead (e.g. `const id = braze.getUser().getUserId()`)"),t(e)}addAlias(t,e){return!$(t,"add alias","the alias",!1)||t.length<=0?(i.error("addAlias requires a non-empty alias"),!1):!$(e,"add alias","the label",!1)||e.length<=0?(i.error("addAlias requires a non-empty label"),!1):this.Ru.Gu(t,e).lt}setFirstName(t){return!!$(t,"set first name","the firstName",!0)&&this.Ss.zu("first_name",t)}setLastName(t){return!!$(t,"set last name","the lastName",!0)&&this.Ss.zu("last_name",t)}setEmail(t){return null===t||j(t)?this.Ss.zu("email",t):(i.error(`Cannot set email address - "${t}
1" did not pass RFC-5322 validation.`),!1)}setGender(t){return"string"==typeof t&&(t=t.toLowerCase()),!(null!==t&&!n(W.Genders,t,`Gender "${t}" is not a valid gender.`,"User.Genders"))&&this.Ss.zu("gender",t)}setDateOfBirth(t,e,s){return null===t&&null===e&&null===s?this.Ss.zu("dob",null):(t=null!=t?parseInt(t.toString()):null,e=null!=e?parseInt(e.toString()):null,s=null!=s?parseInt(s.toString()):null,null==t||null==e||null==s||isNaN(t)||isNaN(e)||isNaN(s)||e>12||e<1||s>31||s<1?(i.error("Cannot set date of birth - parameters should comprise a valid date e.g. setDateOfBirth(1776, 7, 4);"),!1):this.Ss.zu("dob",`${t}-${e}-${s}`))}setCountry(t){return!!$(t,"set country","the country",!0)&&this.Ss.zu("country",t)}setHomeCity(t){return!!$(t,"set home city","the homeCity",!0)&&this.Ss.zu("home_city",t)}setLanguage(t){return!!$(t,"set language","the language",!0)&&this.Ss.zu("language",t)}setEmailNotificationSubscriptionType(t){return!!n(W.NotificationSubscriptionTypes,t,`Email notification setting "${t}" is not a valid subscription type.`,"User.NotificationSubscriptionTypes")&&this.Ss.zu("email_subscribe",t)}setPushNotificationSubscriptionType(t){return!!n(W.NotificationSubscriptionTypes,t,`Push notification setting "${t}" is not a valid subscription type.`,"User.NotificationSubscriptionTypes")&&this.Ss.zu("push_subscribe",t)}setPhoneNumber(t){return!!$(t,"set phone number","the phoneNumber",!0)&&(null===t||t.match(W.Hu)?this.Ss.zu("phone",t):(i.error(`Cannot set phone number - "${t}" did not pass validation.`),!1))}setLastKnownLocation(t,e,s,n,r){return null==t||null==e?(i.error("Cannot set last-known location - latitude and longitude are required."),!1):(t=parseFloat(t.toString()),e=parseFloat(e.toString()),null!=s&&(s=parseFloat(s.toString())),null!=n&&(n=parseFloat(n.toString())),null!=r&&(r=parseFloat(r.toString())),isNaN(t)||isNaN(e)||null!=s&&isNaN(s)||null!=n&&isNaN(n)||null!=r&&isNaN(r)?(i.error("Cannot set last-known location - all supplied parameters must be numeric."),!1):t>90||t<-90||e>180||e<-180?(i.error("Cannot set last-known location - latitude and longitude are bounded by ±90 and ±180 respectively."),!1):null!=s&&s<0||null!=r&&r<0?(i.error("Cannot set last-known location - accuracy and altitudeAccuracy may not be negative."),!1):this.Ru.setLastKnownLocation(this.Ss.getUserId(),t,e,n,s,r).lt)}setCustomUserAttribute(t,e,i){if(!U(t))return!1;let s=e=>{let[i]=z(e,R.Ku,"attribute value",`set custom user attribute "${t}"`,"custom user attribute");return i};if(r(e)){let[i,n]=F(t,e);if(!i&&!n&&0!==e.length)return!1;if(i||0===e.length)return this.Ru.Mu(y.Yu,t,e).lt;for(let t of e)if(!s(t))return!1}else if(l(e)){if(!s(e))return!1;if(i)return this.Ru.Mu(y.Vu,t,e).lt}else if(!(void 0!==e&&M(e))||(o(e)&&(e=d(e)),"string"==typeof e&&!P(e,`set custom user attribute "${t}"`,"the element in the given array")))return!1;return this.Ss.setCustomUserAttribute(t,e)}addToCustomAttributeArray(t,e){return!!P(t,"add to custom user attribute array","the given key")&&!(null!=e&&!P(e,"add to custom user attribute array","the given value"))&&this.Ru.Mu(y.Qu,t,e).lt}removeFromCustomAttributeArray(t,e){return!!P(t,"remove from custom user attribute array","the given key")&&!(null!=e&&!P(e,"remove from custom user attribute array","the given value"))&&this.Ru.Mu(y.Xu,t,e).lt}incrementCustomUserAttribute(t,e){if(!P(t,"increment custom user attribute","the given key"))return!1;null==e&&(e=1);let s=parseInt(e.toString());return isNaN(s)||s!==parseFloat(e.toString())?(i.error(`Cannot increment custom user attribute because the given incrementValue "${e}" is not an integer.`),!1):this.Ru.Mu(y.Zu,t,s).lt}setCustomLocationAttribute(t,e,s){return!!P(t,"set custom location attribute","the given key")&&((null!==e||null!==s)&&(e=null!=e?parseFloat(e.toString()):null,s=null!=s?parseFloat(s.toString()):null,null==e&&null!=s||null!=e&&null==s||null!=e&&(isNaN(e)||e>90||e<-90)||null!=s&&(isNaN(s)||s>180||s<-180))?(i.error("Received invalid values for latitude and/or longitude. Latitude and longitude are bounded by ±90 and ±180 respectively, or must both be null for removal."),!1):this.Ru.Na(t,e,s).lt)}
1addToSubscriptionGroup(t){return!$(t,"add user to subscription group","subscription group ID",!1)||t.length<=0?(i.error("addToSubscriptionGroup requires a non-empty subscription group ID"),!1):this.Ru.va(t,W.Ia.SUBSCRIBED).lt}removeFromSubscriptionGroup(t){return!$(t,"remove user from subscription group","subscription group ID",!1)||t.length<=0?(i.error("removeFromSubscriptionGroup requires a non-empty subscription group ID"),!1):this.Ru.va(t,W.Ia.UNSUBSCRIBED).lt}setLineId(t){return $(t,"set LINE user ID","the ID",!0)&&0!==(null==t?void 0:t.length)?t&&t.length>W.Ca?(i.error(`Rejected LINE user ID ${t} because it is longer than ${W.Ca} characters.`),!1):this.Ss.zu("native_line_id",t):(i.error("setLineId requires a non-empty ID"),!1)}gu(t,e,i,s,n){this.Ss.gu(t,e,i,s,n),this.Ru.Ea()}wu(t){this.Ss.wu(t)}}W.Genders={MALE:"m",FEMALE:"f",OTHER:"o",UNKNOWN:"u",NOT_APPLICABLE:"n",PREFER_NOT_TO_SAY:"p"},W.NotificationSubscriptionTypes={OPTED_IN:"opted_in",SUBSCRIBED:"subscribed",UNSUBSCRIBED:"unsubscribed"},W.Hu=/^[0-9 .\\(\\)\\+\\-]+$/,W.Ia={SUBSCRIBED:"subscribed",UNSUBSCRIBED:"unsubscribed"},W.Sa="user_id",W.Bu="custom",W.br=997,W.Ca=33,t.s(["default",0,W],30181),t.s(["User",0,W],75704);class K{ef(){}ff(){}Fa(t){}static nf(t,e){if(t&&e){if(t=t.toLowerCase(),r(e.cf)){for(let i=0;i<e.cf.length;i++)if(-1!==t.indexOf(e.cf[i].toLowerCase()))return e.identity}else if(-1!==t.indexOf(e.cf.toLowerCase()))return e.identity}}}let H={rO:"Chrome",eO:"Edge",oO:"Opera",Bg:"Safari",OO:"Firefox",Sg:"ChatGPTBrowser"},J={Dg:"Android",co:"iOS",Pg:"Mac",kg:"Windows"};t.s(["Browsers",0,H,"OperatingSystems",0,J],56866);class V extends K{constructor(){if(super(),this.userAgentData=navigator.userAgentData,this.browser=null,this.version=null,this.userAgentData){const t=this.hf();this.browser=t.browser||"Unknown Browser",this.version=t.version||"Unknown Version"}this.OS=null}ef(){return this.browser}ff(){return this.version}Fa(t){if(this.OS)return Promise.resolve(this.OS);let e=e=>{for(let i=0;i<t.length;i++){let s=V.nf(e,t[i]);if(s)return this.OS=s,this.OS}return e};return this.userAgentData.platform?Promise.resolve(e(this.userAgentData.platform)):this.getHighEntropyValues().then(t=>t.platform?e(t.platform):navigator.platform).catch(()=>navigator.platform)}hf(){let t={},e=this.userAgentData.brands;if(e&&e.length)for(let i of e){let e=this.uf(H),s=i.brand.match(e);if(s&&s.length>0){t.browser=s[0],t.version=i.version;break}}return t}uf(t){let e=[];for(let i in t)e.push(t[i]);return RegExp("("+e.join("|")+")","i")}getHighEntropyValues(){return this.userAgentData.getHighEntropyValues?this.userAgentData.getHighEntropyValues(["platform"]):Promise.reject()}}class Z extends K{constructor(){super(),this.Sd=Z.hf(navigator.userAgent||"")}ef(){return this.Sd[0]||"Unknown Browser"}ff(){return this.Sd[1]||"Unknown Version"}Fa(t){for(let e=0;e<t.length;
1e++){let i=t[e].string,s=Z.nf(i,t[e]);if(s)return s===J.Pg&&navigator.maxTouchPoints>1&&(s=J.co),Promise.resolve(s)}return Promise.resolve(navigator.platform)}static hf(t){let e,i=t.match(/(samsungbrowser|tizen|roku|konqueror|icab|crios|opera|ucbrowser|chatgptbrowser|chrome|safari|firefox|camino|msie|trident(?=\/))\/?\s*(\.?\d+(\.\d+)*)/i)||[];if(-1!==t.indexOf("(Web0S; Linux/SmartTV)"))return["LG Smart TV",null];if(-1!==t.indexOf("CrKey"))return["Chromecast",null];if(-1!==t.indexOf("BRAVIA")||-1!==t.indexOf("SonyCEBrowser")||-1!==t.indexOf("SonyDTV"))return["Sony Smart TV",null];if(-1!==t.indexOf("PhilipsTV"))return["Philips Smart TV",null];if(t.match(/\b(Roku)\b/))return["Roku",null];if(t.match(/\bAFTM\b/))return["Amazon Fire Stick",null];if(i[1]===H.rO){if(t.includes(H.Sg))return[H.Sg,i[2]];if(null!=(e=t.match(/\b(OPR|Edge|EdgA|Edg|UCBrowser)\/(\.?\d+(\.\d+)*)/)))return(e=e.slice(1))[0]=e[0].replace("OPR",H.oO),e[0]=e[0].replace("EdgA",H.eO),"Edg"===e[0]&&(e[0]=H.eO),[e[0],e[1]]}if(i[1]===H.Bg&&null!=(e=t.match(/\b(EdgiOS)\/(\.?\d+(\.\d+)*)/)))return(e=e.slice(1))[0]=e[0].replace("EdgiOS",H.eO),[e[0],e[1]];if((i=i[2]?[i[1],i[2]]:[null,null])[0]===H.Bg&&null!=(e=t.match(/version\/(\.?\d+(\.\d+)*)/i))&&i.splice(1,1,e[1]),null!=(e=t.match(/\b(UCBrowser)\/(\.?\d+(\.\d+)*)/))&&i.splice(1,1,e[2]),i[0]===H.oO&&null!=(e=t.match(/mini\/(\.?\d+(\.\d+)*)/i)))return["Opera Mini",e[1]||""];if(i[0]){let t=i[0].toLowerCase();"crios"===t&&(i[0]=H.rO),"tizen"===t&&(i[0]="Samsung Smart TV",i[1]=null),"samsungbrowser"===t&&(i[0]="Samsung Browser")}return i}}class Y{constructor(){let t;t=navigator.userAgent.toLowerCase().includes(H.Sg.toLowerCase())||!navigator.userAgentData?Z:V,this.vg=new t,this.userAgent=navigator.userAgent,this.browser=this.vg.ef(),this.version=this.vg.ff(),this.OS=null,this.Fa().then(t=>this.OS=t);const e=navigator;this.language=(e.userLanguage||e.language||e.browserLanguage||e.systemLanguage||"").toLowerCase(),this.il=Y.xg(this.userAgent)}IS(){return this.browser===H.Bg}Aa(){return this.OS||null}Fa(){return this.OS?Promise.resolve(this.OS):this.vg.Fa(Y.Og).then(t=>(this.OS=t,t))}static xg(t){t=t.toLowerCase();let e=["bot","slurp","baiduspider","yandex","facebookexternalhit","sogou","ia_archiver","https://github.com/prerender/prerender","aolbuild","bingpreview","mediapartners-google","teoma","taiko","facebookexternalhit","facebookcatalog","meta-webindexer","meta-externalads","meta-externalagent","meta-externalfetcher"];for(let i=0;i<e.length;i++)if(-1!==t.indexOf(e[i]))return!0;return!1}}Y.Og=[{string:navigator.platform,cf:"Win",identity:J.kg},{string:navigator.platform,cf:"Mac",identity:J.Pg},{string:navigator.platform,cf:"BlackBerry",identity:"BlackBerry"},{string:navigator.platform,cf:"FreeBSD",identity:"FreeBSD"},{string:navigator.platform,cf:"OpenBSD",identity:"OpenBSD"},{string:navigator.platform,cf:"Nintendo",identity:"Nintendo"},{string:navigator.platform,cf:"SunOS",identity:"SunOS"},{string:navigator.platform,cf:"PlayStation",identity:"PlayStation"},{string:navigator.platform,cf:"X11",identity:"X11"},{string:navigator.userAgent,cf:["iPhone","iPad","iPod"],identity:J.co},{string:navigator.platform,cf:"Pike v",identity:J.co},{string:navigator.userAgent,cf:["Web0S"],identity:"WebOS"},{string:navigator.userAgent,cf:"Tizen",identity:"Tizen"},{string:navigator.userAgent,cf:"Coolita",identity:"Other Smart TV"},{string:navigator.userAgent,cf:"WhaleTV",identity:"Other Smart TV"},{string:navigator.platform,cf:["Linux armv7l","Android"],identity:J.Dg},{string:navigator.userAgent,cf:["Android"],identity:J.Dg},{string:navigator.platform,cf:"Linux",identity:"Linux"}];let X=new Y;t.s(["default",0,X],90428);let Q={Ou:{Cu:"ab.storage.userId",Wh:"ab.storage.deviceId",um:"ab.storage.sessionId"},Tt:{_c:"ab.test",QE:"ab.storage.events",ZE:"ab.storage.attributes",$E:"ab.storage.attributes.anonymous_user",Ba:"ab.storage.device",Ka:"ab.storage.sdk_metadata",Pa:"ab.storage.session_id_for_cached_metadata",Uu:"ab.storage.pushToken",tS:"ab.storage.cardImpressions",tc:"ab.storage.serverConfig",eS:"ab.storage.triggers",sS:"ab.storage.triggers.ts",dm:"ab.storage.messagingSessionStart",Ci:"ab.storage.cc",gi:"ab.storage.ccLastFullSync",ji:"ab.storage.ccLastCardUpdated",Ml:"ab.storage.globalRateLimitCurrentTokenCount",Ll:"ab.storage.dynamicRateLimitCurrentTokenCount",ns:"ab.storage.ccClicks",hs:"ab.storage.ccImpressions",us:"ab.storage.ccDismissals",rS:"ab.storage.lastDisplayedTriggerTimesById",oS:"ab.storage.lastDisplayedTriggerTime",nS:"ab.storage.triggerFireInstancesById",fh:"ab.storage.signature",aS:"ab.storage.brazeSyncRetryCount",ki:"ab.storage.sdkVersion",Fo:"ab.storage.ff",jo:"ab.storage.ffImpressions",qo:"ab.storage.ff
1LastRefreshAt",Do:"ab.storage.ff.sessionId",iS:"ab.storage.lastReqToEndpoint",ES:"ab.storage.requestAttempts",pa:"ab.storage.deferredIam",Cl:"ab.storage.lastSdkReq",SS:"ab.storage.alias",St:"ab.storage.banners",Wt:"ab.storage.banners.impressions",Mt:"ab.storage.banners.dismissals",_t:"ab.storage.banners.sessionId",Gt:"ab.storage.banners.lastRequestedTime",Ke:"ab.storage.dust.mite",Qe:"ab.storage.dust.host",Ve:"ab.storage.dust.auth",Xe:"ab.storage.dust.expiration"},ce:"ab.optOut"};class tt{constructor(t,e){this.lS=t,this._S=e,this.lS=t,this._S=e}hl(t){let e=a(Q.Ou),i=new tt.le(t);for(let t of e)i.remove(Q.Ou[t])}Iu(t,e){let i=null;null!=e&&e instanceof S&&(i=e.qt()),this.lS.store(t,i)}uS(t){let e=this.$u(t);null!=e&&(e.pm=new Date().valueOf(),this.Iu(t,e))}$u(t){let e,i=this.lS.wr(t),s=(t=>{let e;try{e=JSON.parse(t)}catch(t){e=null}return e})(i);if(s)(e=S._u(s)||null)&&this.Iu(t,e);else{let s=S.cS(i);e=S._u(s)||null,s!==i&&e&&this.Iu(t,e)}return e}jm(t){this.lS.remove(t)}ll(){let t;for(let e of a(Q.Ou))null!=(t=this.$u(Q.Ou[e]))&&this.Iu(Q.Ou[e],t)}ol(t){let e;if(null==t||0===t.length)return!1;e=r(t)?t:[t];let i=this._S.wr(Q.Tt.QE);null!=i&&r(i)||(i=[]);for(let t=0;t<e.length;t++)i.push(e[t].qt());return this._S.store(Q.Tt.QE,i)}gm(t){return null!=t&&this.ol([t])}TS(){let t=this._S.wr(Q.Tt.QE);this._S.remove(Q.Tt.QE),null==t&&(t=[]);let e=[],i=!1,s=null;if(r(t))for(let i=0;i<t.length;i++)m.hS(t[i])?e.push(m._u(t[i])):s=i;else i=!0;if(i||null!=s){let n="Stored events could not be deserialized as Events";i&&(n+=", was "+Object.prototype.toString.call(t)+" not an array"),null!=s&&(n+=", value at index "+s+" does not look like an event"),n+=", serialized values were of type "+typeof t+": "+JSON.stringify(t),e.push(new m(null,y.Ya,new Date().valueOf(),null,{e:n}))}return e}It(t,e){return!!n(Q.Tt,t,"StorageManager cannot store object.","STORAGE_KEYS.OBJECTS")&&this._S.store(t,e)}Rt(t){return!!n(Q.Tt,t,"StorageManager cannot retrieve object.","STORAGE_KEYS.OBJECTS")&&this._S.wr(t)}Qt(t){return!!n(Q.Tt,t,"StorageManager cannot remove object.","STORAGE_KEYS.OBJECTS")&&(this._S.remove(t),!0)}clearData(){let t=a(Q.Ou),e=a(Q.Tt);for(let e=0;e<t.length;e++){let i=t[e];this.lS.remove(Q.Ou[i])}for(let t=0;t<e.length;t++){let i=e[t];this._S.remove(Q.Tt[i])}}AS(t){return t||Q.Tt.$E}vl(t){let e=this._S.wr(Q.Tt.ZE);null==e&&(e={});let i=this.AS(t[W.Sa]),s=e[i];for(let n in t)n!==W.Sa&&(null==e[i]||s&&null==s[n])&&this.Eu(t[W.Sa],n,t[n])}Eu(t,e,i){let s=this._S.wr(Q.Tt.ZE);null==s&&(s={});let n=this.AS(t),r=s[n];if(null==r&&(r={},null!=t&&(r[W.Sa]=t)),e===W.Bu)for(let t in null==r[e]&&(r[e]={}),i)r[e][t]=i[t];else r[e]=i;return s[n]=r,this._S.store(Q.Tt.ZE,s)}gS(){let t=this._S.wr(Q.Tt.ZE);this._S.remove(Q.Tt.ZE);let e=[];for(let i in t)null!=t[i]&&e.push(t[i]);return e}Lu(t){let e=this._S.wr(Q.Tt.ZE);if(null!=e){let i=this.AS(null),s=e[i];null!=s&&(e[i]=void 0,this._S.store(Q.Tt.ZE,e),s[W.Sa]=t,this.vl(s))}let i=this.$u(Q.Ou.um),s=null;null!=i&&(s=i.Tu);let n=this.TS();if(null!=n)for(let e=0;e<n.length;e++){let i=n[e];null==i.userId&&i.sessionId==s&&(i.userId=t),this.gm(i)}}RS(){return this._S.dS}}tt.wc=class{constructor(t){this.tu=t,this.tu=t,this.dS=X.IS()?3:10}bS(t){return t+"."+this.tu}store(t,e){try{return localStorage.setItem(this.bS(t),JSON.stringify({v:e})),!0}catch(t){return i.info("Storage failure: "+v(t)),!1}}wr(t){try{let e=null,i=localStorage.getItem(this.bS(t));return null!=i&&(e=JSON.parse(i)),null==e?null:e.v}catch(t){return i.info("Storage retrieval failure: "+v(t)),null}}remove(t){try{localStorage.removeItem(this.bS(t))}catch(t){return i.info("Storage removal failure: "+v(t)),!1}}},tt.Rc=class{constructor(){this.fS={},this.mS=5242880,this.dS=3}store(t,e){let s=this.KS(e);return s>this.mS?(i.info("Storage failure: object is â"+s+" bytes which is greater than the max of "+this.mS),!1):(this.fS[t]={value:e},!0)}KS(t){let e=[],i=[t],s=0;for(;i.length;){let t=i.pop();if("boolean"==typeof t)s+=4;else if("string"==typeof t)s+=2*t.length;else if("number"==typeof t)s+=8;else if("object"==typeof t&&-1===e.indexOf(t))for(let s in e.push(t),t)i.push(t[s])}return s}wr(t){let e=this.fS[t];return null==e?null:e.value}remove(t){this.fS[t]=null}},tt.le=class{constructor(t,e,i){this.tu=t,this.YS=e,this.tu=t,this.NS=this.DS(),this.GS=24*("number"==typeof i&&i>0?i:400)*60,this.CS={},this.YS=!!e}bS(t){return null!=this.tu?t+"."+this.tu:t}DS(){let t=0,e=document.location.hostname,i=e.split("."),s="ab._gd";
1for(;t<i.length-1&&-1===document.cookie.indexOf(s+"="+s);)t++,e="."+i.slice(-1-t).join("."),document.cookie=s+"="+s+";domain="+e+";";return document.cookie=s+"=;expires="+new Date(0).toUTCString()+";domain="+e+";",e}me(){let t=new Date;return t.setTime(t.getTime()+60*this.GS*1e3),t.getFullYear()}MS(){let t=s(Q.Ou),e=document.cookie.split(";");for(let i=0;i<e.length;i++){let s=e[i];for(;" "===s.charAt(0);)s=s.substring(1);let n=!1;for(let e=0;e<t.length;e++)if(0===s.indexOf(t[e])){n=!0;break}if(n){let t=s.split("=")[0];-1===t.indexOf("."+this.tu)&&this.pS(t)}}}store(t,e){let s;this.MS();let n=this.bS(t),r=new Date;r.setTime(r.getTime()+60*this.GS*1e3);let o="expires="+r.toUTCString(),l="domain="+this.NS,a=n+"="+(s=this.YS?e:encodeURIComponent(e))+";"+o+";"+l+";path=/";if(a.length>=4093)return i.info("Storage failure: string is "+a.length+" chars which is too large to store as a cookie."),this.CS[n]=!0,this.pS(n),!1;try{document.cookie=a}catch(t){return i.info("Storage failure: "+v(t)),this.CS[n]=!0,!1}let u=this.YS?String(s):decodeURIComponent(s);return this.vS(n)!==u?(i.info(`Storage failure: unable to verify cookie write for "${n}". Falling back to other storage.`),this.CS[n]=!0,this.pS(n),!1):(delete this.CS[n],!0)}wr(t){let e=this.bS(t);return this.CS[e]?null:this.vS(e)}vS(t){let e=[],s=t+"=",n=document.cookie.split(";");for(let r=0;r<n.length;r++){let o=n[r];for(;" "===o.charAt(0);)o=o.substring(1);if(0===o.indexOf(s))try{let t;t=this.YS?o.substring(s.length,o.length):decodeURIComponent(o.substring(s.length,o.length)),e.push(t)}catch(e){return i.info("Storage retrieval failure: "+v(e)),this.pS(t),null}}return e.length>0?e[e.length-1]:null}remove(t){this.pS(this.bS(t))}pS(t){let e=t+"=;expires="+new Date(0).toUTCString();document.cookie=e,document.cookie=e+";path=/";let i=e+";domain="+this.NS;document.cookie=i,document.cookie=i+";path=/"}},tt.Ec=class{constructor(t,e,i,s){this.tu=t,this.US=[],e&&this.US.push(new tt.le(t,void 0,s)),i&&this.US.push(new tt.wc(t)),this.US.push(new tt.Rc)}store(t,e){let i=!0;for(let s=0;s<this.US.length;s++)i=this.US[s].store(t,e)&&i;return i}wr(t){for(let e=0;e<this.US.length;e++){let i=this.US[e].wr(t);if(null!=i)return i}return null}remove(t){new tt.le(this.tu).remove(t);for(let e=0;e<this.US.length;e++)this.US[e].remove(t)}};class te{constructor(){this.In={}}Kt(t){if("function"!=typeof t)return null;let e=b.de();return this.In[e]=t,e}removeSubscription(t){delete this.In[t]}removeAllSubscriptions(){this.In={}}Le(){return Object.keys(this.In).length}A(t){let e=[];for(let i in this.In){let s=this.In[i];e.push(s(t))}return e}}t.s(["default",0,te],87285);class ti{constructor(t,e){this.database=t,this.vd=e,this.parent="u"<typeof window?self:window,this.database=t,this.vd=e}Dd(){if("indexedDB"in this.parent)return this.parent.indexedDB}isSupported(){var t;try{if(null==this.Dd())return!1;{let e=null==(t=this.Dd())?void 0:t.open("Braze IndexedDB Support Test");if(e&&(e.onupgradeneeded=()=>e.result.close(),e.onsuccess=()=>e.result.close()),"u">typeof window){let t=window,e=t.chrome||t.browser||t.Bd;if(e&&e.runtime&&e.runtime.id)return this.vd.info("Not using IndexedDB for storage because we are running inside an extension"),!1}return!0}}catch(t){return this.vd.info("Not using IndexedDB for storage due to following error: "+t),!1}}Cd(t,e){var i;let s=null==(i=this.Dd())?void 0:i.open(this.database.xd,this.database.VERSION);if(null==s)return"function"==typeof e&&e(),!1;let n=this;return s.onupgradeneeded=t=>{var e;n.vd.info("Upgrading indexedDB "+n.database.xd+" to v"+n.database.VERSION+"...");let i=null==(e=t.target)?void 0:e.result;for(let t in n.database.Os)n.database.Os.hasOwnProperty(t)&&!i.objectStoreNames.contains(n.database.Os[t])&&i.createObjectStore(n.database.Os[t])},s.onsuccess=i=>{var s;let r=null==(s=i.target)?void 0:s.result;r.onversionchange=()=>{r.close(),"function"==typeof e&&e(),n.vd.error("Needed to close the database unexpectedly because of an upgrade in another tab")},t(r)},s.onerror=t=>{var i;return n.vd.info("Could not open indexedDB "+n.database.xd+" v"+n.database.VERSION+": "+(null==(i=t.target)?void 0:i.errorCode)),"function"==typeof e&&e(),!0},!0}setItem(t,e,i,s,n){if(!this.isSupported())return"function"==typeof n&&n(),!1;let r=this;return this.Cd(o=>{if(!o.objectStoreNames.contains(t))return r.vd.error("Could not store object "+e+" in "+t+" on indexedDB "+r.database.xd+" - "+t+" is not a valid objectStore"),"function"==typeof n&&n(),void o.close();let l=o.transaction([t],"readwrite");l.oncomplete=()=>o.close();let a=l.objectStore(t).put(i,e);a.onerror=()=>{r.vd.error("Could not store object "+e+" in "+t+" on indexedDB "+r.database.xd),"function"==typeof n&&n()},a.onsuccess=()=>{"function"==typeof s&&s()}},n)}getItem(t,e,i){if(!this.isSupported())return!1;let s=this;return this.Cd(n=>{if(!n.objectStoreNames.contains(t))return s.vd.error("Could not retrieve object "+e+" in "+t+" on indexedDB "+s.database.xd+" - "+t+" is not a valid objectStore"),void n.close();let r=n.transaction([t],"readonly");r.oncomplete=()=>n.close();let o=r.objectStore(t).get(e);o.onerror=()=>{s.vd.error("Could not retrieve object "+e+" in "+t+" on indexedDB "+s.database.xd)},o.onsuccess=t=>{var e;let s=null==(e=t.target)?void 0:e.result;null!=s&&i(s)}})}kr(t,e,i){if(!this.isSupported())return"function"==typeof i&&i(),!1;let s=this;return this.Cd(n=>{if(!n.objectStoreNames.contains(t))return s.vd.error("Could not retrieve last record from "+t+" on indexedDB "+s.database.xd+" - "+t+" is not a valid objectStore"),"function"==typeof i&&i(),void n.close();let r=n.transaction([t],"readonly");r.oncomplete=()=>n.close();let o=r.objectStore(t).openCursor(null,"prev");o.onerror=()=>{s.vd.error("Could not open cursor for "+t+" on indexedDB "+s.database.xd),"function"==typeof i&&i()},o.onsuccess=t=>{var s;let n=null==(s=t.target)?void 0:s.result;null!=n&&null!=n.value&&null!=n.key?e(n.key,n.value):"function"==typeof i&&i()}},i)}ge(t,e){if(!this.isSupported())return!1;let i=this;return this.Cd(s=>{if(!s.objectStoreNames.contains(t))return i.vd.error("Could not delete record "+e+" from "+t+" on indexedDB "+i.database.xd+" - "+t+" is not a valid objectStore"),void s.close();let n=s.transaction([t],"readwrite");n.oncomplete=()=>s.close(),n.objectStore(t).delete(e).onerror=()=>{i.vd.error("Could not delete record "+e+" from "+t+" on indexedDB "+i.database.xd)}})}Xs(t,e){if(!this.isSupported())return!1;let i=this;return this.Cd(s=>{if(!s.objectStoreNames.contains(t))return i.vd.error("Could not retrieve objects from "+t+" on indexedDB "+i.database.xd+" - "+t+" is not a valid objectStore"),void s.close();let n=s.transaction([t],"readwrite");n.oncomplete=()=>s.close();let r=n.objectStore(t),o=r.openCursor(),l=[];o.onerror=()=>{l.length>0?(i.vd.info("Cursor closed midway through for "+t+" on indexedDB "+i.database.xd),e(l)):i.vd.error("Could not open cursor for "+t+" on indexedDB "+i.database.xd)},o.onsuccess=t=>{var i;let s=null==(i=t.target)?void 0:i.result;null!=s?(null!=s.value&&null!=s.key&&(r.delete(s.key).onsuccess=()=>{l.push(s.value)}),"function"==typeof s.continue&&s.continue()):l.length>0&&e(l)}})}clearData(){if(!this.isSupported())return!1;let t=[];for(let e in this.database.Os)this.database.Os.hasOwnProperty(e)&&this.database.Os[e]!==this.database.Os.pe&&t.push(this.database.Os[e]);let e=this;return this.Cd(function(i){let s=i.transaction(t,"readwrite");s.oncomplete=()=>i.close();for(let i=0;i<t.length;i++){let n=t[i];s.objectStore(n).clear().onerror=function(){e.vd.error("Could not clear "+this.source.name+" on indexedDB "+e.database.xd)}}s.onerror=function(){e.vd.error("Could not clear object stores on indexedDB "+e.database.xd)}})}}ti.Ps={$s:{xd:"AppboyServiceWorkerAsyncStorage",VERSION:6,Os:{pn:"data",$r:"pushClicks",Fu:"pushSubscribed",yd:"fallbackDevice",_s:"cardUpdates",pe:"optOut",qr
1:"pendingData",wh:"sdkAuthenticationSignature"},be:1}},t.s(["IndexedDBAdapter",0,ti],28425);class ts{constructor(t,e,i){this.C=t,this.gh=e,this.bh=i,this.C=t,this.gh=e||!1,this.bh=i,this.Sh=new te,this.Ah=0,this.ph=1}Fh(){return this.gh}kh(){return this.C.Rt(Q.Tt.fh)}setSdkAuthenticationSignature(t){let e=this.kh();this.C.It(Q.Tt.fh,t);let s=ti.Ps.$s;new ti(s,i).setItem(s.Os.wh,this.ph,t),e!==t&&this.ct()}jh(){this.C.Qt(Q.Tt.fh);let t=ti.Ps.$s;new ti(t,i).ge(t.Os.wh,this.ph)}subscribeToSdkAuthenticationFailures(t){return this.bh.Kt(t)}Ch(t){this.bh.A(t)}xh(){this.Sh.removeAllSubscriptions()}Eh(){this.Ah+=1}Ih(){return this.Ah}ct(){this.Ah=0}}class tn{I(t){}changeUser(t=!1){}clearData(t=!1){}}t.s(["default",0,tn],58610);class tr{constructor(t){this.id=t,this.id=t}ta(){let t={};return null!=this.browser&&(t.browser=this.browser),null!=this.Oa&&(t.browser_version=this.Oa),null!=this.os&&(t.os_version=this.os),null!=this.resolution&&(t.resolution=this.resolution),null!=this.language&&(t.locale=this.language),null!=this.timeZone&&(t.time_zone=this.timeZone),null!=this.userAgent&&(t.user_agent=this.userAgent),t}}let to={BROWSER:"browser",BROWSER_VERSION:"browserVersion",OS:"os",RESOLUTION:"resolution",LANGUAGE:"language",TIME_ZONE:"timeZone",USER_AGENT:"userAgent"};class tl{constructor(t,e){this.C=t,this.Da=e,this.C=t,null==e&&(e=s(to)),this.Da=e}ve(t=!0){let e=this.C.$u(Q.Ou.Wh);null==e&&(e=new S(b.de()),t&&this.C.Iu(Q.Ou.Wh,e));let i=new tr(e.Tu);for(let t=0;t<this.Da.length;t++)switch(this.Da[t]){case to.BROWSER:i.browser=X.browser;break;case to.BROWSER_VERSION:i.Oa=X.version;break;case to.OS:i.os=this.Fa();break;case to.RESOLUTION:i.Ga=screen.width+"x"+screen.height;break;case to.LANGUAGE:i.language=X.language;break;case to.TIME_ZONE:i.timeZone=this.Ja(new Date);break;case to.USER_AGENT:i.userAgent=X.userAgent}return i}Fa(){if(X.Aa())return X.Aa();let t=this.C.Rt(Q.Tt.Ba);return t&&t.os_version?t.os_version:X.Fa()}Ja(t){let e=!1;if("u">typeof Intl&&"function"==typeof Intl.DateTimeFormat)try{if("function"==typeof Intl.DateTimeFormat().resolvedOptions){let t=Intl.DateTimeFormat().resolvedOptions().timeZone;if(null!=t&&""!==t)return t}}catch(t){i.info("Intl.DateTimeFormat threw an error, cannot detect user's time zone:"+v(t)),e=!0}if(e)return"";let s=t.getTimezoneOffset();return this.Ha(s)}Ha(t){let e=Math.trunc(t/60),i=Math.trunc(t%60),s="GMT";return 0!==t&&(s+=(t<0?"+":"-")+(("00"+Math.abs(e)).slice(-2)+":")+("00"+Math.abs(i)).slice(-2)),s}}let ta="invalid_json_response",tu="empty_response";class th{constructor(t=!1,e=[]){this.lt=t,this.Ce=e,this.lt=t,this.Ce=e}ps(t){this.lt=this.lt&&t.lt,this.Ce.push(...t.Ce)}}let tc={wt:(t,e,s)=>{var n,r;let o=new th,l=ey.u();if(!l)return i.info(`Not logging event with type "${t}" because the current session ID could not be found.`),o;let a=l.el();return o.Ce.push(new m(s||(null==(n=ey.ir())?void 0:n.getUserId()),t,new Date().valueOf(),a,e)),o.lt=(null==(r=ey.p())?void 0:r.ol(o.Ce))||!1,o}},td={it:{pn:"data",Ji:"content_cards/sync",Co:"feature_flags/sync",Yo:"template",st:"banners/sync"},Pl:t=>null==t?void 0:t.Rt(Q.Tt.iS),Am:t=>null==t?void 0:t.Rt(Q.Tt.ES),Rm:(t,e)=>{null==t||t.It(Q.Tt.iS,e)},qm:(t,e)=>{null==t||t.It(Q.Tt.ES,e)},ql:(t,e)=>{if(!t||!e)return -1;let i=td.Pl(t);if(null==i)return -1;let s=i[e];return null==s||isNaN(s)?-1:s},Al:(t,e)=>{let i=1;if(!t||!e)return i;let s=td.Am(t);return null==s?i:null==(i=s[e])||isNaN(i)?1:i},nt:(t,e,i)=>{if(!t||!e)return;let s=td.Pl(t);null==s&&(s={}),s[e]=i,td.Rm(t,s)},Dl:(t,e,i)=>{if(!t||!e)return;let s=td.Am(t);null==s&&(s={}),s[e]=i,td.qm(t,s)},Li:(t,e)=>{t&&e&&td.Dl(t,e,1)},zl:(t,e)=>{if(!t||!e)return;let i=td.Al(t,e);td.Dl(t,e,i+1)}},tg=td,tf=t=>{let e,i,s={},n=t.toString().split("\r\n");if(!n)return s;for(let t of n)t&&(e=t.slice(0,t.indexOf(":")).toLowerCase().trim(),i=t.slice(t.indexOf(":")+1).trim(),s[e]=i);return s},tp={ot:t=>{let e,s;try{let n=!1;if(window.XMLHttpRequest&&(n=!0),!n)return void i.error("This browser does not have any supported ajax options!");e=new XMLHttpRequest;let r=i=>{"function"==typeof t.error&&t.error(e.status),"function"==typeof t.ft&&t.ft(!1,i)};for(let i of(e.onload=()=>{let i=!1;if(4!==e.readyState)return;i=e.status>=200&&e.status<300||304===e.status;let s=e.getAllResponseHeaders();if(i){if("function"==typeof t.lt){let i;try{i=JSON.parse(e.responseText)}catch(n){let i={error:""===e.responseText?tu:ta,response:e.responseText};(0,t.lt)(i,s)}i&&t.lt(i,s)}"function"==typeof t.ft&&t.ft(!0,s)}else r(s)},e.onerror=()=>{r(e.getAllResponseHeaders())},e.ontimeout=()=>{r()},s=JSON.stringify(t.data),e.open("POST",t.url,!0),e.setRequestHeader("Content-type","application/json"),e.setRequestHeader("X-Requested-With","XMLHttpRequest"),t.headers||[]))e.setRequestHeader(i[0],i[1]);e.send(s)}catch(t){i.error(`Network request error: ${v(t)}`)}}};t.s(["default",0,tp,"readResponseHeaders",0,tf],87049);class tm{constructor(t,e,i,s,n,r,o,l,a,u,h,c){this.eu=t,this.C=e,this.Gh=i,this.Ss=s,this.j=n,this.h=r,this.tu=o,this.Yh=l,this.Vh=a,this.Kh=u,this.appVersion=h,this.Ra=c,this.$a=t=>null==t?"":`${t} `,this.eu=t,this.C=e,this.Gh=i,this.Ss=s,this.j=n,this.h=r,this.tu=o,this.Yh=l,this.Vh=a,this.Kh=u,this.appVersion=h,this.Ra=c,this.Xa=["npm"],this.La={}}Z(t,i=!1,s=!1){let n=this.eu.ve(!s),r=n.ta();u(this.C.Rt(Q.Tt.Ba),r)||(t.device=r),t.api_key=this.tu,t.time=h(new Date().valueOf(),!0);let o=this.C.Rt(Q.Tt.Ka)||[],l=this.C.Rt(Q.Tt.Pa)||"";this.Xa.length>0&&(!u(o,this.Xa)||l!==this.j.kt())&&(t.sdk_metadata=this.Xa),t.sdk_version=this.Vh,this.Kh&&(t.sdk_flavor=this.Kh),t.app_version=this.appVersion,t.app_version_code=this.Ra,t.device_id=n.id;let a=this.Ss.getUserId();if(i&&null!==a&&(t.user_id=a),!a&&!this.Gh.Fh()){let i=e(this.C);i&&(t.alias=i)}return t}ut(t,e,s){let n=e.auth_error,o=e.error;if(!n&&!o)return!0;
1if(n){let e;this.Gh.Eh();let o={errorCode:n.error_code};for(let t of s)r(t)&&"X-Braze-Auth-Signature"===t[0]&&(o.signature=t[1]);t.respond_with&&t.respond_with.user_id?o.userId=t.respond_with.user_id:t.user_id&&(o.userId=t.user_id);let l=n.reason;return l?(o.reason=l,e=`due to ${l}`):e=`with error code ${n.error_code}.`,this.Gh.Fh()||(e+=' Please use the "enableSdkAuthentication" initialization option to enable authentication.'),i.error(`SDK Authentication failed ${e}`),this.Ua(t.events||[],t.attributes||[]),this.Gh.Ch(o),!1}if(o){let s,n=o;switch(n){case tu:return s="Received successful response with empty body.",tc.wt(y.Ya,{e:s}),i.info(s),!1;case ta:return s="Received successful response with invalid JSON",tc.wt(y.Ya,{e:s+": "+e.response}),i.info(s),!1;case"invalid_api_key":n=`The API key "${t.api_key}" is invalid for the baseUrl ${this.Yh}`;break;case"blacklisted":n="Sorry, we are not currently accepting your requests. If you think this is in error, please contact us.";break;case"no_device_identifier":n="No device identifier. Please contact [email protected]"}i.error("Backend error: "+n)}return!1}fl(t,e,i){return!!(t&&0!==t.length||e&&0!==e.length||i)}ml(t,e,i,s=!1){let n=[],r=t=>t||"",o=r(this.Ss.getUserId()),l=this.Zo(t),a=[],u=[],h,c=null;if(e.length>0){let t=[];for(let i of e){if(h=i.ta(),this.Gh.Fh()){if(o&&!h.user_id){c||(c={}),c.events||(c.events=[]),c.events.push(h);continue}if(r(h.user_id)!==o){u.push(h);continue}}t.push(h)}t.length>0&&(l.events=t)}if(i.length>0){let t=[];for(let e of i)e&&(this.Gh.Fh()&&r(e.user_id)!==o?a.push(e):t.push(e));t.length>0&&(l.attributes=t)}if(this.Ua(u,a),l=this.Z(l,!1,s),c){let t={requestData:c=this.Z(c,!1,s),headers:this.tt(c,tg.it.pn)};n.push(t)}if(l&&!this.fl(l.events,l.attributes,t))return c?n:null;let d={requestData:l,headers:this.tt(l,tg.it.pn)};return n.push(d),n}Ua(t,e){if(t){let e=[];for(let i of t){let t=m.fromJson(i);t.time=1e3*t.time,e.push(t)}this.C.ol(e)}if(e)for(let t of e)this.C.vl(t)}dt(t,e){let s="HTTP error ";null!=t&&(s+=t+" "),s+=e,i.error(s)}Rl(t){return tc.wt(y.gl,{n:t})}Zo(t,i){let s={};t&&(s.triggers=!0);let n=null!=i?i:this.Ss.getUserId();if(n&&(s.user_id=n),!s.user_id&&!this.Gh.Fh()){let t=e(this.C);t&&(s.alias=t)}return s.config={config_time:this.h.Ot()},{respond_with:s}}bl(t){let e=new Date().valueOf(),i="7200000",s=tg.ql(this.C,t);return -1!==s&&(i=(e-s).toString()),i}tt(t,e,i=!1){let s=[["X-Braze-Api-Key",this.tu]],n=this.bl(e);s.push(["X-Braze-Last-Req-Ms-Ago",n]);let r=tg.Al(this.C,e).toString();s.push(["X-Braze-Req-Attempt",r]);let o=!1;if(null!=t.respond_with&&t.respond_with.triggers&&(s.push(["X-Braze-TriggersRequest","true"]),o=!0),e===tg.it.Ji){s.push(["X-Braze-ContentCardsRequest","true"]);let t=tg.Al(this.C,tg.it.Ji);t&&!i||(t=1,tg.Dl(this.C,tg.it.Ji,t));let e=Math.max(0,t-1);s.push(["BRAZE-SYNC-RETRY-COUNT",e.toString()]),o=!0}if(e===tg.it.Co&&(s.push(["X-Braze-FeatureFlagsRequest","true"]),o=!0),o&&s.push(["X-Braze-DataRequest","true"]),this.Gh.Fh()){let t=this.Gh.kh();null!=t&&s.push(["X-Braze-Auth-Signature",t])}return s}Tl(t,e,s,n){if(this.La[n])return;let r=window.setTimeout(()=>{i.info(`Retrying rate limited ${this.$a(n)}SDK request.`),this.et(e,s,n)},t);this.La[n]=r}fo(){for(let t in this.La){let e=this.La[t];window.clearTimeout(e)}this.La={}}et(t,e,s,n){if(!this.kl(s))return i.info(`${this.$a(s)}SDK request being rate limited.`),void("function"==typeof n&&n());let r=this.yl();if(!r.wl)return this.Tl(r.Nl,t,e,s),void i.info(`${this.$a(s)}SDK request being rate limited. Request will be retried in ${Math.trunc(r.Nl/1e3)} seconds.`);this.C.It(Q.Tt.Cl,new Date().valueOf());let o=t.device;o&&o.os_version instanceof Promise?o.os_version.then(i=>{t.device.os_version=i,e(r.Sl)}):e(r.Sl)}Bl(t){let e=t?tf(t):null;if(!e||!e["retry-after"])return null;let i=e["retry-after"];return isNaN(i)&&!isNaN(Date.parse(i))?{type:"date",value:Date.parse(i)}:isNaN(parseFloat(i.toString()))?(tc.wt(y.Ya,{e:"Received unexpected value for retry-after header in /sync response: "+i}),null):{type:"timestamp",value:1e3*parseFloat(i.toString())}}yt(t,e,i,s,n,r){let o;if(tg.Al(this.C,i)>=15)return;r=r||0;let l=this.Bl(t);n();let a=t=>{s(window.setTimeout(()=>{e()},t)),tg.zl(this.C,i)};if(l&&!isNaN(l.value)){switch(l.type){case"date":(o=l.value-new Date().getTime()+r)<0&&e();break;case"timestamp":o=l.value+r}a(o)}else r?a(r):tg.Li(this.C,i)}jl(t){var e;null==(e=this.C)||e.It(Q.Tt.Ml,t)}$l(t,e){let i=this.Xl();null==i&&(i={}),i[t]=e,this.C.It(Q.Tt.Ll,i)}El(){var t;return null==(t=this.C)?void 0:t.Rt(Q.Tt.Ml)}Xl(){var t;return null==(t=this.C)?void 0:t.Rt(Q.Tt.Ll)}Fl(t,e,i,s,n=""){let r;if(n){let t=this.Xl();r=null==t||isNaN(t[n])?e:t[n]}else(null==(r=this.El())||isNaN(r))&&(r=e);return Math.min(r+(t-s)/1e3/i,e)}Kl(t,e){return Math.max(0,(1-t)*e*1e3)}Il(t,e=""){var i,s,n,r,o;let l={wl:!0,Sl:-1,Nl:0};if(null==t&&(t=!0),!t&&!e)return l;let a,u,h=null;if(t)h=null==(i=this.C)?void 0:i.Rt(Q.Tt.Cl);else{let t=tg.Pl(this.C);if(null==t||null==t[e])return l;h=t[e]}
1if(null==h||isNaN(h)||(t?(a=(null==(s=this.h)?void 0:s.Ul())||-1,u=(null==(n=this.h)?void 0:n.xl())||-1):(a=(null==(r=this.h)?void 0:r.Hl(e))||-1,u=(null==(o=this.h)?void 0:o.Ol(e))||-1),-1===a||-1===u))return l;let c=new Date().valueOf(),d=this.Fl(c,a,u,h,e);return d<1?(l.wl=!1,l.Nl=this.Kl(d,u)):(l.Sl=d=Math.trunc(d)-1,t?this.jl(d):this.$l(e,d)),l}yl(){return this.Il(!0)}kl(t){let e=this.Il(!1,t);return!(e&&!e.wl)}ct(){this.Gh.ct()}ht(){return this.Yh}addSdkMetadata(t){for(let e of t)-1===this.Xa.indexOf(e)&&this.Xa.push(e)}}let tb={EE:"inAppMessage must be an InAppMessage object",TE:"ab-pause-scrolling"},tv={IE:0xff333333,AE:0xffffffff,_E:0xff0073d5,OE:0xffefefef,LE:0xff555555,SE:0xc0333333,NE:0xff9b9b9b},tS={RE:"hd",tE:"ias",ME:"of",eE:"do",oE:"umt",CE:"tf",DE:"te"},ty={TOP:"TOP",BOTTOM:"BOTTOM"},tT={URI:"URI",NONE:"NONE"},tw={AUTO_DISMISS:"AUTO_DISMISS",MANUAL:"SWIPE"},tE={NONE:"NONE",BLANK:"BLANK"},tC={TOP:"TOP",GRAPHIC:"GRAPHIC"},tI={PORTRAIT:"PORTRAIT",LANDSCAPE:"LANDSCAPE"},t_={START:"START",CENTER:"CENTER",END:"END"},tA={CENTER_CROP:"CENTER_CROP",FIT_CENTER:"FIT_CENTER"},tO={sE:"SLIDEUP",aE:"MODAL",UE:"MODAL_STYLED",cE:"FULL",iE:"WEB_HTML",PE:"HTML",nE:"HTML_FULL"},tk={gr:500,pE:200},tR="ab-show",tN="ab-hide",tx={rE:"m",mE:"ma",GE:"sf",Fs:"e",FE:"ti",HE:"ca",URI:"u",xE:"oa",BE:"dt",lE:"d",bE:"i",ys:"iu",gE:"is",YE:"ic",KE:"ibc",XE:"bc",dE:"tc",hE:"cbc",yE:"ai",uE:"ao",WE:"h",fE:"ha",jE:"htc",kE:"fc",vE:"b",wE:"ct",zE:"o",VE:"hi",CSS:"css",xs:"type",qE:"messageFields",JE:"me",LANGUAGE:"l",Ks:"ia"};t.s(["IAM_HIDE_CLASS",0,tN,"IAM_SHOW_CLASS",0,tR,"IamClickAction",0,tT,"IamColors",0,tv,"IamCropType",0,tA,"IamDismissType",0,tw,"IamDisplayFailures",0,tS,"IamImageStyle",0,tC,"IamOpenTarget",0,tE,"IamOrientation",0,tI,"IamSerializationKeys",0,tx,"IamServerTypes",0,tO,"IamSlideFrom",0,ty,"IamStrings",0,tb,"IamTextAlignment",0,t_,"IamTiming",0,tk],79946);let tB={cu:()=>"serviceWorker"in navigator&&"u">typeof ServiceWorkerRegistration&&"showNotification"in ServiceWorkerRegistration.prototype&&"PushManager"in window,lu:()=>"safari"in window&&"pushNotification"in window.safari&&"function"==typeof window.safari.pushNotification.permission&&"function"==typeof window.safari.pushNotification.requestPermission,isPushSupported:()=>tB.cu()||tB.lu(),isPushBlocked:()=>{let t=tB.isPushSupported()&&"Notification"in window&&null!=window.Notification&&null!=window.Notification.permission&&"denied"===window.Notification.permission,e=tB.isPushSupported()&&(!("Notification"in window)||null==window.Notification);return t||e},isPushPermissionGranted:()=>tB.isPushSupported()&&"Notification"in window&&null!=window.Notification&&null!=window.Notification.permission&&"granted"===window.Notification.permission,Vn:()=>tB.isPushBlocked()?{Wn:!1,reason:"blocked"}:tB.isPushSupported()?tB.isPushPermissionGranted()?{Wn:!1,reason:"permissionGranted"}:{Wn:!0}:{Wn:!1,reason:"unsupported"},Yn:(t,e)=>"blocked"===t?`${e} containing a push prompt is not being shown because the user has already declined push permission prompt.`:"unsupported"===t?`${e} containing a push prompt is not being shown because the browser doesn't support push notifications.`:`${e} containing a push prompt is not being shown because the user has already accepted the permission prompt.`};t.s(["default",0,tB],66516);let tL=(t,e)=>(t=Math.ceil(t),Math.floor(Math.random()*((e=Math.floor(e))-t+1))+t);t.s(["randomInclusive",0,tL],16731);class tD{constructor(t,e,i,s,n,r,o,l,a,u){this.tu=t,this.baseUrl=e,this.j=i,this.eu=s,this.Ss=n,this.h=r,this.C=o,this.bc=l,this.Gh=a,this.B=u,this.tu=t,this.baseUrl=e,this.kc=0,this.dS=o.RS()||0,this.yc=null,this.j=i,this.eu=s,this.Ss=n,this.h=r,this.C=o,this.Gh=a,this.B=u,this.bc=l,this.jc=new te,this.Ac=null,this.Dc=50,this.$c=!1,this.qc=!1}Cc(t,e){return!t&&!e&&this.Gh.Ih()>=this.Dc}Mc(t){let e=this.j.am();if(t.length>0){let i=this.Ss.getUserId();for(let s of t){let t=!s.userId&&!i||s.userId===i;s.type===y.wm&&t&&(e=!0)}}return e}Tc(t=!1,e=!0,s,n,r,o=!1,l=!1){e&&this.Lc();let a=this.C.TS(),u=this.C.gS(),h=!1,c=(t,i,o=-1)=>{let l=new Date().valueOf();tg.nt(this.C,tg.it.pn,l),-1!==o&&i.push(["X-Braze-Req-Tokens-Remaining",o.toString()]);let a=!1;tp.ot({url:this.baseUrl+"/data/",data:t,headers:i,lt:e=>{null!=t.respond_with&&t.respond_with.triggers&&(this.kc=Math.max(this.kc-1,0)),this.B.ut(t,e,i)?(this.Gh.ct(),this.h.sc(e),null!=t.respond_with&&t.respond_with.user_id!=this.Ss.getUserId()||(null!=t.device&&this.C.It(Q.Tt.Ba,t.device),null!=t.sdk_metadata&&(this.C.It(Q.Tt.Ka,t.sdk_metadata),this.C.It(Q.Tt.Pa,this.j.kt())),this.bc(e),tg.Dl(this.C,tg.it.pn,1),"function"==typeof s&&s())):e.auth_error&&(a=!0)},error:()=>{a=!0,null!=t.respond_with&&t.respond_with.triggers&&(this.kc=Math.max(this.kc-1,0)),this.B.Ua(t.events,t.attributes),"function"==typeof n&&n()},ft:(t,i)=>{"function"==typeof r&&r(!a);let s=this.B.Bl(i),n=0;if(s)switch(s.type){case"date":n=Math.max(s.value-new Date().valueOf(),0);break;case"timestamp":n=s.value}
1if(e&&!h){if(a){tg.zl(this.C,tg.it.pn);let t=this.h.vt(),e=this.h.gt(),i=this.h.bt(),s=this.yc;(null==s||s<t)&&(s=t);let r=Math.min(i,tL(t,s*e))+n;this.Fc(r)}else this.Fc(Math.max(1e3*this.dS,n));h=!0}}})},d=this.Mc(a),g=t||d;if(this.Cc(o,d))return void i.info("Declining to flush data due to 50 consecutive authentication failures");if(e&&!this.B.fl(a,u,g))return this.Fc(),void("function"==typeof r&&r(!0));let f=this.B.ml(g,a,u,l);g&&this.kc++;let p=!1;if(f)for(let t of f)this.B.et(t.requestData,e=>c(t.requestData,t.headers,e),tg.it.pn,n),p=!0;this.Gh.Fh()&&e&&!p?this.Fc():d&&(i.info("Invoking new session subscriptions"),this.jc.A(),this.qc=!0)}Ic(){return this.kc>0}Fc(t=1e3*this.dS){this.$c||(this.Lc(),this.Ac=window.setTimeout(()=>{if(document.hidden){let t="visibilitychange",e=()=>{document.hidden||(document.removeEventListener(t,e,!1),this.Tc())};document.addEventListener(t,e,!1)}else this.Tc()},t),this.yc=t)}Lc(){null!=this.Ac&&(clearTimeout(this.Ac),this.Ac=null)}initialize(){this.$c=!1,this.Fc()}destroy(){this.jc.removeAllSubscriptions(),this.Gh.xh(),this.Lc(),this.$c=!0,this.Tc(void 0,!1,void 0,void 0,void 0,void 0,!0),this.Ac=null,this.qc=!1}rn(t){return this.qc?(t(),null):this.jc.Kt(t)}openSession(){let e=this.j.kt()!==this.j.el();e&&(this.C.uS(Q.Ou.Wh),this.C.uS(Q.Ou.Cu)),this.Tc(!1,void 0,()=>{e&&(this.C.Qt(Q.Tt.jo),this.C.Qt(Q.Tt.Wt))}),this.Ea(),e&&t.A(71230).then(t=>{if(this.$c)return;let e=t.default.ra();if(null!=e&&(tB.isPushPermissionGranted()||tB.isPushBlocked())){let t=()=>{e.du()?i.info("Push token maintenance is disabled, not refreshing token for backend."):e.subscribe()},s=()=>{let e=this.C.Rt(Q.Tt.Uu);(null==e||e)&&t()},n=ti.Ps.$s;new ti(n,i).kr(n.Os.Fu,(e,i)=>{i&&t()},s)}})}Pc(){this.C.Qt(Q.Tt.Fo),this.C.Qt(Q.Tt.Ci),this.C.Qt(Q.Tt.pa)}xc(){this.C.Qt(Q.Tt.Cl),this.C.Qt(Q.Tt.iS),this.C.Qt(Q.Tt.Ml),this.C.Qt(Q.Tt.Ll)}changeUser(t,e,s){let n=this.Ss.getUserId();if(n!==t){this.j.Sm(),this.Pc(),function(){let t=document.querySelectorAll(".ab-iam-root");for(let e=0;e<t.length;e++){let i=t[e];if(i.id){let t=i.id+"-css",e=document.getElementById(t);e&&e.parentNode&&e.parentNode.removeChild(e)}i.parentNode&&i.parentNode.removeChild(i)}let e=document.getElementsByClassName(tb.TE);for(let t=0;t<e.length;t++){let i=e[t].classList;i.contains(tb.TE)&&i.remove(tb.TE)}}(),null!=n&&this.Tc(void 0,!1,void 0,void 0,void 0),this.Ss.Ju(t),s?this.Gh.setSdkAuthenticationSignature(s):this.Gh.jh();for(let t=0;t<e.length;t++)e[t].changeUser(null==n);this.B.fo(),null!=n&&this.C.Qt(Q.Tt.tS),this.C.Qt(Q.Tt.Ba),this.C.Qt(Q.Tt.SS),this.xc(),this.openSession(),i.info('Changed user to "'+t+'".')}else{let e="Doing nothing.";s&&this.Gh.kh()!==s&&(this.Gh.setSdkAuthenticationSignature(s),e="Updated SDK authentication signature"),i.info(`Current user is already ${t}. ${e}`)}}requestImmediateDataFlush(t){this.Lc(),this.j.el(),this.Tc(void 0,void 0,void 0,()=>{i.error("Failed to flush data, request will be retried automatically.")},t,!0)}Sr(t,e){this.j.el(),i.info("Requesting explicit trigger refresh."),this.Tc(!0,void 0,t,e)}Gu(t,e){let s=y.Nc,n={a:t,l:e},r=tc.wt(s,n);return r&&(i.info(`Logged alias ${t} with label ${e}`),this.C.It(Q.Tt.SS,n)),r}Mu(t,e,s){if(this.h.qu(e))return i.info(`Custom Attribute "${e}" is blocklisted, ignoring.`),new th;let n=tc.wt(t,{key:e,value:s});if(n){let t="object"==typeof s?JSON.stringify(s,null,2):s;i.info(`Logged custom attribute: ${e} with value: ${t}`)}return n}setLastKnownLocation(t,e,s,n,r,o){let l={latitude:e,longitude:s};null!=n&&(l.altitude=n),null!=r&&(l.ll_accuracy=r),null!=o&&(l.alt_accuracy=o);let a=tc.wt(y.Oc,l,t||void 0);return a&&i.info(`Set user last known location as ${JSON.stringify(l,null,2)}`),a}yr(t,e){let i=this.j.el();return new m(this.Ss.getUserId(),y.Uc,t,i,{cid:e})}Bc(t,e){return new ti(t,e)}Ea(){let t=ti.Ps.$s;this.Bc(t,i).setItem(t.Os.pn,1,{baseUrl:this.baseUrl,data:{api_key:this.tu,device_id:this.eu.ve().id},userId:this.Ss.getUserId(),sdkAuthEnabled:this.Gh.Fh()})}Ar(t){for(let e of t)if(e.api_key===this.tu)this.B.Ua(e.events,e.attributes);else{let t=ti.Ps.$s;new ti(t,i).setItem(t.Os.qr,b.de(),e)}}Na(t,e,s){let n,r;return this.h.qu(t)?(i.info(`Custom Attribute "${t}" is blocklisted, ignoring.`),new th):(null===e&&null===s?(n=y.Jc,r={key:t}):(n=y.Kc,r={key:t,latitude:e,longitude:s}),tc.wt(n,r))}va(t,e){return tc.wt(y.Wc,{group_id:t,status:e})}}class tP{constructor(t=0,e=[],i=[],s=[],n=null,r=null,o={enabled:!1},l={enabled:!1,refresh_rate_limit:void 0},a={enabled:!0,capacity:30,refill_rate:30,endpoint_overrides:{}},u=null,h=null,c=null,d=null){this.ec=t,this.uc=e,this.oc=i,this.ac=s,this.cc=n,this.rc=r,this.lc=o,this.Xr=l,this.nc=a,this.banners=u,this.dust=h,this.vc=c,this.fc=d}qt(){return{s:"6.7.1",l:this.ec,e:this.uc,a:this.oc,p:this.ac,m:this.cc,v:this.rc,c:this.lc,f:this.Xr,grl:this.nc,b:this.banners,d:this.dust,rb:this.vc,mst:this.fc}}static _u(t){let e=t.l;return"6.7.1"!==t.s&&(e=0),new tP(e,t.e,t.a,t.p,t.m,t.v,t.c,t.f,t.grl,t.b,t.d,t.rb,t.mst)}}class tU{constructor(t){this.C=t,this.C=t,this.Gl=new te,this._l=new te,this.Vl=new te,this.Jl=new te,this.Ql=new te,this.Wl=null,this.Yl=null}Zl(){if(null==this.Yl){let t=this.C.Rt(Q.Tt.tc);this.Yl=null!=t?tP._u(t):new tP}return this.Yl}Ot(){return this.Zl().ec}sc(t){var e,i,s,n;if(null!=t&&null!=t.config){let r=t.config;if(r.time>this.Zl().ec){let t=t=>null==t?this.Zl().nc:t,o=new tP(r.time,r.events_blacklist,r.attributes_blacklist,r.purchases_blacklist,r.messaging_session_timeout,r.vapid_public_key,r.content_cards,r.feature_flags,t(r.global_request_rate_limit),r.banners,r.dust,r.request_backoff,r.minimum_session_timeout),l=!1;null!=o.rc&&this.ju()!==o.rc&&(l=!0);let a=!1;null!=o.lc.enabled&&this.Bi()!==o.lc.enabled&&(a=!0);let u=!1;null!=o.Xr.enabled&&this.lo()!==o.Xr.enabled&&(u=!0);let h=!1;null!=(null==(e=o.banners)?void 0:e.enabled)&&this.Jt()!==(null==(i=o.banners)?void 0:i.enabled)&&(h=!0);let c=!1;null!=(null==(s=o.dust)?void 0:s.enabled)&&this.fn()!==(null==(n=o.dust)?void 0:n.enabled)&&(c=!0),this.Yl=o,this.C.It(Q.Tt.tc,o.qt()),l&&this.Gl.A(),a&&this._l.A(),u&&this.Vl.A(),h&&this.Jl.A(),c&&this.Ql.A()}}}xu(t){let e=this.Gl.Kt(t);return this.Wl&&this.Gl.removeSubscription(this.Wl),this.Wl=e,e}Mi(t){return this._l.Kt(t)}bo(t){return this.Vl.Kt(t)}V(t){return this.Jl.Kt(t)}Tr(t){return this.Ql.Kt(t)}$e(t){return -1!==this.Zl().uc.indexOf(t)}qu(t){return -1!==this.Zl().oc.indexOf(t)}Dr(t){return -1!==this.Zl().ac.indexOf(t)}hc(){return this.Zl().cc}ju(){return this.Zl().rc}Bi(){return this.Zl().lc.enabled||!1}dc(){let t=this.Zl().nc;return!(!t||null==t.enabled)&&t.enabled}Ul(){if(!this.dc())return -1;let t=this.Zl().nc;return null==t.capacity||t.capacity<10?-1:t.capacity}xl(){if(!this.dc())return -1;let t=this.Zl().nc;return null==t.refill_rate||t.refill_rate<=0?-1:t.refill_rate}mc(t){let e=this.Zl().nc.endpoint_overrides;return null==e?null:e[t]}Hl(t){let e=this.mc(t);return null==e||isNaN(e.capacity)||e.capacity<=0?-1:e.capacity}Ol(t){let e=this.mc(t);return null==e||isNaN(e.refill_rate)||e.refill_rate<=0?-1:e.refill_rate}lo(){return this.Zl().Xr.enabled&&null==this.Ro()?(tc.wt(y.Ya,{e:"Missing feature flag refresh_rate_limit."}),!1):this.Zl().Xr.enabled||!1}Ro(){return this.Zl().Xr.refresh_rate_limit}Jt(){var t;return(null==(t=this.Zl().banners)?void 0:t.enabled)||null}re(){var t;return(null==(t=this.Zl().banners)?void 0:t.max_placements)||0}Xt(){var t;let e=null==(t=this.Zl().banners)?void 0:t.dismissals_cache_size;return null!=e&&"number"==typeof e&&e>0?e:200}fn(){var t;return(null==(t=this.Zl().dust)?void 0:t.enabled)||!1}vt(){var t;let e=null==(t=this.Zl().vc)?void 0:t.min_sleep_duration_ms;return null!=e?e:1e4}gt(){var t;let e=null==(t=this.Zl().vc)?void 0:t.scale_factor;return null!=e?e:3}bt(){var t;let e=null==(t=this.Zl().vc)?void 0:t.max_sleep_duration_ms;return null!=e?e:3e5}gc(){return this.Zl().fc}}class tM{constructor(t,e,s,n){this.C=t,this.Ss=e,this.h=s,this.tm=n,this.C=t,this.Ss=e,this.h=s;const r=this.h.gc();this.im=r?1e3*r:1e4,(null==n||isNaN(n))&&(n=1800),n<this.im/1e3&&i.info("Specified session timeout of "+n+"s is too small, using the minimum session timeout of "+this.im/1e3+"s instead."),this.tm=Math.max(n,this.im/1e3)}nm(t,e){return new m(this.Ss.getUserId(),y.hm,t,e.Tu,{d:h(t-e.lm)})}al(){return this.C.$u(Q.Ou.um)}kt(){let t=this.C.$u(Q.Ou.um);return null==t?null:t.Tu}am(){let t=new Date().valueOf(),e=this.h.hc();if(null==e)return!1;let i=this.C.Rt(Q.Tt.dm),s=null==i||t-i>1e3*e;return s&&this.C.It(Q.Tt.dm,t),s}ul(t,e){return null==e||null==e.fm||!(t-e.lm<this.im)&&e.fm<t}el(){let t=new Date().valueOf(),e=t+1e3*this.tm,s=this.C.$u(Q.Ou.um);if(this.ul(t,s)){let n="Generating session start event with time "+t;if(null!=s){let t=s.pm;t-s.lm<this.im&&(t=s.lm+this.im),this.C.gm(this.nm(t,s)),n+=" (old session ended "+t+")"}n+=". Will expire "+e.valueOf(),i.info(n);let r=new S(b.de(),e);return this.C.gm(new m(this.Ss.getUserId(),y.wm,t,r.Tu)),this.C.Iu(Q.Ou.um,r),null==this.C.Rt(Q.Tt.dm)&&this.C.It(Q.Tt.dm,t),r.Tu}if(null!=s)return s.pm=t,s.fm=e,this.C.Iu(Q.Ou.um,s),s.Tu}Sm(){let t=this.C.$u(Q.Ou.um);null!=t&&(this.C.jm(Q.Ou.um),this.C.gm(this.nm(new Date().valueOf(),t)))}}
1let t$={rl:function(t,e=!1,i){let s,n=t$.Sc(),r=t$.sl(),o=new tt.Ec(t,n&&!e,r,i);return s=r?new tt.wc(t):new tt.Rc,new tt(o,s)},Sc:function(){return navigator.cookieEnabled||"cookie"in document&&(document.cookie.length>0||(document.cookie="test").indexOf.call(document.cookie,"test")>-1)},sl:function(){let t=!1;try{if(localStorage&&localStorage.getItem)try{localStorage.setItem(Q.Tt._c,"true"),localStorage.getItem(Q.Tt._c)?(localStorage.removeItem(Q.Tt._c),t=!0):t=!1}catch(e){if(!(e instanceof Error&&("QuotaExceededError"===e.name||"NS_ERROR_DOM_QUOTA_REACHED"===e.name)&&localStorage.length>0))throw e;t=!0}}catch(t){i.info("Local Storage not supported!")}return t}};class tz{constructor(t,e){this.triggerId=t,this.messageExtras=e,this.triggerId=t,this.messageExtras=e,this.extras={},this.isControl=!0,this.Zt=!1}static fromJson(t){return new tz(t.trigger_id,t.message_extras)}gs(){return!this.Zt&&(this.Zt=!0,!0)}sm(){return this.Zt}}t.s(["default",0,tz],63515);let tF={lp:null,td:function(t,e=!1,i=!1,s=!1){if(null==t)return!1;e=e||!1,i=i||!1;let n=t.getBoundingClientRect();return null!=n&&(n.top>=0&&n.top<=(window.innerHeight||document.documentElement.clientHeight)||!e)&&(n.left>=0||!s)&&(n.bottom>=0&&n.bottom<=(window.innerHeight||document.documentElement.clientHeight)||!i)&&(n.right<=(window.innerWidth||document.documentElement.clientWidth)||!s)}},tj={Uo:"up",Vo:"down",ie:"left",ne:"right"};function tq(){if(null==tF.lp){tF.lp=!1;try{let t=Object.defineProperty({},"passive",{get:()=>{tF.lp=!0}});window.addEventListener("testPassive",()=>{},t),window.removeEventListener("testPassive",()=>{},t)}catch(t){i.error(v(t))}}return tF.lp}function tG(t,e,i=()=>{}){t.addEventListener(e,i,!!tq()&&{passive:!0})}function tW(t){if(t.onclick){let e=document.createEvent("MouseEvents");e.initEvent("click",!0,!0),t.onclick.apply(t,[e])}}t.s(["DIRECTIONS",0,tj,"DOMUtils",0,tF,"addPassiveEventListener",0,tG,"buildSvg",0,function(t,e,i){let s="http://www.w3.org/2000/svg",n=document.createElementNS(s,"svg");n.setAttribute("viewBox",t),n.setAttribute("xmlns",s);let r=document.createElementNS(s,"path");return r.setAttribute("d",e),null!=i&&r.setAttribute("fill",i),n.appendChild(r),n},"clickElement",0,tW,"detectSwipe",0,function(t,e,i){let s=null,n=null;tG(t,"touchstart",t=>{s=t.touches[0].clientX,n=t.touches[0].clientY}),tG(t,"touchmove",r=>{if(null==s||null==n)return;let o=s-r.touches[0].clientX,l=n-r.touches[0].clientY;Math.abs(o)>Math.abs(l)&&Math.abs(o)>=25?((o>0&&e===tj.ie||o<0&&e===tj.ne)&&i(r),s=null,n=null):Math.abs(l)>=25&&((l>0&&e===tj.Uo&&t.scrollTop===t.scrollHeight-t.offsetHeight||l<0&&e===tj.Vo&&0===t.scrollTop)&&i(r),s=null,n=null)})},"supportsPassive",0,tq],55582);let tK={Ao:32,Wo:9,Lo:13,rh:27};t.s(["KeyCodes",0,tK],51828);let tH=t=>null!==t&&"IFRAME"===t.tagName;t.s(["isIFrame",0,tH],18913);class tJ{constructor(t,e,i,s,n,r,o,l,a,u,h,c,d,g,f,p,m,b,v,S,y,T,w,E,C,I,_,A,O,k,R,N){this.message=t,this.messageAlignment=e,this.slideFrom=i,this.extras=s,this.triggerId=n,this.clickAction=r,this.uri=o,this.openTarget=l,this.dismissType=a,this.duration=u,this.icon=h,this.imageUrl=c,this.imageStyle=d,this.iconColor=g,this.iconBackgroundColor=f,this.backgroundColor=p,this.textColor=m,this.closeButtonColor=b,this.animateIn=v,this.animateOut=S,this.header=y,this.headerAlignment=T,this.headerTextColor=w,this.frameColor=E,this.buttons=C,this.cropType=I,this.orientation=_,this.htmlId=A,this.css=O,this.messageExtras=k,this.language=R,this.altImageText=N,this.message=t,this.messageAlignment=e||t_.CENTER,this.duration=u||5e3,this.slideFrom=i||ty.BOTTOM,this.extras=s||{},this.triggerId=n,this.clickAction=r||tT.NONE,this.uri=o,this.openTarget=l||tE.NONE,this.dismissType=a||tw.AUTO_DISMISS,this.icon=h,this.imageUrl=c,this.imageStyle=d||tC.TOP,this.iconColor=g||tv.AE,this.iconBackgroundColor=f||tv._E,this.backgroundColor=p||tv.AE,this.textColor=m||tv.IE,this.closeButtonColor=b||tv.NE,this.animateIn=v,null==this.animateIn&&(this.animateIn=!0),this.animateOut=S,null==this.animateOut&&(this.animateOut=!0),this.header=y,this.headerAlignment=T||t_.CENTER,this.headerTextColor=w||tv.IE,this.frameColor=E||tv.SE,this.buttons=C||[],this.cropType=I||tA.FIT_CENTER,this.orientation=_,this.htmlId=A,this.css=O,this.isControl
1=!1,this.messageExtras=k,this.language=R,this.altImageText=N,this.th=!1,this.Zt=!1,this.rd=!1,this.sh=!1,this.Eo=null,this.$o=null,this.ti=new te,this.ih=new te,this.Go=t_.CENTER}subscribeToClickedEvent(t){return this.ti.Kt(t)}subscribeToDismissedEvent(t){return this.ih.Kt(t)}removeSubscription(t){this.ti.removeSubscription(t),this.ih.removeSubscription(t)}removeAllSubscriptions(){this.ti.removeAllSubscriptions(),this.ih.removeAllSubscriptions()}closeMessage(){this.tl(this.Eo)}zo(){return!0}od(){return this.zo()}Bo(){return null!=this.htmlId&&this.htmlId.length>4}Mo(){return this.Bo()&&null!=this.css&&this.css.length>0}Oo(){if(this.Bo()&&this.Mo())return this.htmlId+"-css"}gs(){return!this.Zt&&(this.Zt=!0,!0)}sm(){return this.Zt}ss(t){return!this.rd&&(this.rd=!0,this.ti.A(),!0)}ls(){return!this.sh&&(this.sh=!0,this.ih.A(),!0)}hide(t){if(t&&t.parentNode){let e=t.closest(".ab-iam-root");if(null==e&&(e=t),this.zo()&&null!=e.parentNode){let t=e.parentNode.classList;t&&t.contains(tb.TE)&&t.remove(tb.TE),document.body.removeEventListener("touchmove",tJ.hh)}e.className=e.className.replace(tR,tN)}return this.animateOut||!1}tl(t,e){let i,s;if(null==t)return;this.Eo=null;let n=!1;(i=-1===t.className.indexOf("ab-in-app-message")?t.getElementsByClassName("ab-in-app-message")[0]:t)&&(n=this.hide(i));let r=document.body;null!=r&&(s=r.scrollTop);let o=()=>{if(t&&t.parentNode){let e=t.closest(".ab-iam-root");null==e&&(e=t),e.parentNode&&e.parentNode.removeChild(e)}let i=this.Oo();if(null!=i){let t=document.getElementById(i);t&&t.parentNode&&t.parentNode.removeChild(t)}null!=r&&"Safari"===X.browser&&(r.scrollTop=s),e?e():this.ls()};n?setTimeout(o,tk.gr):o(),this.$o&&this.$o.focus()}Ko(){return document.createTextNode(this.message||"")}Ho(t){t.setAttribute("alt",this.altImageText||"")}static hh(t){if(t.targetTouches&&t.targetTouches.length>1)return;let e=t.target;e&&e.classList&&e.classList.contains("ab-message-text")&&e.scrollHeight>e.clientHeight||document.querySelector(`.${tb.TE}`)&&t.cancelable&&t.preventDefault()}eh(t){let e=t.parentNode;this.zo()&&null!=e&&this.orientation!==tI.LANDSCAPE&&(null!=e.classList&&e.classList.add(tb.TE),document.body.addEventListener("touchmove",tJ.hh,!!tq()&&{passive:!1})),t.className+=" "+tR}static nh(t){if(t.keyCode===tK.rh&&!ey.er(eS.oh)&&document.querySelectorAll(".ab-modal-interactions").length>0){let t=document.getElementsByClassName("ab-html-message"),e=!1;for(let i of t){let t=null;tH(i)&&i.contentWindow&&(t=i.contentWindow.document.getElementsByClassName("ab-programmatic-close-button")[0]),null!=t&&(tW(t),e=!0)}if(!e){let t=document.querySelectorAll(".ab-modal-interactions > .ab-close-button")[0];null!=t&&tW(t)}}}lh(){this.th||ey.er(eS.oh)||(document.addEventListener("keydown",tJ.nh,!1),ey.uh(()=>{document.removeEventListener("keydown",tJ.nh)}),this.th=!0)}qt(t){let e={};return t&&(e[tx.rE]=this.message,e[tx.mE]=this.messageAlignment,e[tx.GE]=this.slideFrom,e[tx.Fs]=this.extras,e[tx.FE]=this.triggerId,e[tx.HE]=this.clickAction,e[tx.URI]=this.uri,e[tx.xE]=this.openTarget,e[tx.BE]=this.dismissType,e[tx.lE]=this.duration,e[tx.bE]=this.icon,e[tx.ys]=this.imageUrl,e[tx.gE]=this.imageStyle,e[tx.YE]=this.iconColor,e[tx.KE]=this.iconBackgroundColor,e[tx.XE]=this.backgroundColor,e[tx.dE]=this.textColor,e[tx.hE]=this.closeButtonColor,e[tx.yE]=this.animateIn,e[tx.uE]=this.animateOut,e[tx.WE]=this.header,e[tx.fE]=this.headerAlignment,e[tx.jE]=this.headerTextColor,e[tx.kE]=this.frameColor,e[tx.vE]=this.buttons,e[tx.wE]=this.cropType,e[tx.zE]=this.orientation,e[tx.VE]=this.htmlId,e[tx.CSS]=this.css,e[tx.xs]=t,e[tx.JE]=this.messageExtras,e[tx.LANGUAGE]=this.language,e[tx.Ks]=this.altImageText),e}}tJ.ah=tv,tJ.mh=tS,tJ.SlideFrom=ty,tJ.ClickAction=tT,tJ.DismissType=tw,tJ.OpenTarget=tE,tJ.ImageStyle=tC,tJ.Orientation=tI,tJ.TextAlignment=t_,tJ.CropType=tA,tJ.dh=tO,tJ.gr=tk.gr,tJ.pE=tk.pE,tJ.bs=tx;class tV extends tJ{constructor(t,e,i,s,n,r,o,l,a,u,h,c){super(t,void 0,void 0,e,i,void 0,void 0,void 0,s=s||tw.MANUAL,n,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,r,o,void 0,void 0,void 0,l,void 0,void 0,void 0,a,u,c,void 0,void 0),this.messageFields=h,this.messageFields=h}od(){return!1}ss(t){if(this.ko===tO.iE){if(this.rd)return!1;this.rd=!0}return this.ti.A(t),!0}qt(){let t=super.qt(tO.iE);return t[tx.qE]=this.messageFields,t}static ha(t){return new tV(t[tx.rE],t[tx.Fs],t[tx.FE],t[tx.BE],t[tx.lE],t[tx.yE],t[tx.uE],t[tx.kE],t[tx.VE],t[tx.CSS],t[tx.qE],t[tx.JE])}}class tZ{constructor(t,e,i,s,n,r,o){this.text=t,this.backgroundColor=e,this.textColor=i,this.borderColor=s,this.clickAction=n,this.uri=r,this.id=o,this.text=t||"",this.backgroundColor=e||tv._E,this.textColor=i||tv.AE,this.borderColor=s||this.backgroundColor,this.clickAction=n||tT.NONE,this.uri=r,null==o&&(o=tZ.Kn),this.id=o,this.rd=!1,this.ti=new te}subscribeToClickedEvent(t){return this.ti.Kt(t)}removeSubscription(t){this.ti.removeSubscription(t)}removeAllSubscriptions(){this.ti.removeAllSubscriptions()}ss(){return!this.rd&&(this.rd=!0,this.ti.A(),!0)}static fromJson(t){return new tZ(t.text,t.bg_color,t.text_color,t.border_color,t.click_action,t.uri,t.id)}}tZ.Kn=-1,t.s(["default",0,tZ],38666);class tY extends tJ{constructor(t,e,i,s,n,r,o,l,a,u,h,c,d,g,f,p,m,b,v,S,y,T,w,E,C,I,_,A,O,k,R){l=l||tw.MANUAL,I=I||tI.PORTRAIT,super(t,e,void 0,i,s,n,r,o,l,a,u,h,c,d,g,f,p,m,b,v,S,y,T,w,E,C=C||tA.CENTER_CROP,I,_,A,O,k,R),this.Go=t_.CENTER}qt(){return super.qt(tO.cE)}static ha(t){return new tY(t[tx.rE],t[tx.mE],t[tx.Fs],t[tx.FE],t[tx.HE],t[tx.URI],t[tx.xE],t[tx.BE],t[tx.lE],t[tx.bE],t[tx.ys],t[tx.gE],t[tx.YE],t[tx.KE],t[tx.XE],t[tx.dE],t[tx.hE],t[tx.yE],t[tx.uE],t[tx.WE],t[tx.fE],t[tx.jE],t[tx.kE],t1(t[tx.vE]),t[tx.wE],t[tx.zE],t[tx.VE],t[tx.CSS],t[tx.JE],t[tx.LANGUAGE],t[tx.Ks])}}class tX extends tJ{constructor(t,e,i,s,n,r,o,l,a,u,h,c,d,g,f,p,m,b,v,S,y,T,w,E,C,I,_,A,O,k){super(t,e,void 0,i,s,n,r,o,l=l||tw.MANUAL,a,u,h,c,d,g,f,p,m,b,v,S,y,T,w,E,C=C||tA.FIT_CENTER,void 0,I,_,A,O,k),this.Go=t_.CENTER}qt(){return super.qt(tO.aE)}static ha(t){return new tX(t[tx.rE],t[tx.mE],t[tx.Fs],t[tx.FE],t[tx.HE],t[tx.URI],t[tx.xE],t[tx.BE],t[tx.lE],t[tx.bE],t[tx.ys],t[tx.gE],t[tx.YE],t[tx.KE],t[tx.XE],t[tx.dE],t[tx.hE],t[tx.yE],t[tx.uE],t[tx.WE],t[tx.fE],t[tx.jE],t[tx.kE],t1(t[tx.vE]),t[tx.wE],t[tx.VE],t[tx.CSS],t[tx.JE],t[tx.LANGUAGE],t[tx.Ks])}}class tQ extends tJ{constructor(t,e,i,s,n,r,o,l,a,u,h,c,d,g,f,p,m,b,v,S,y,T,w,E){p=p||tv.LE,f=f||tv.OE,super(t,e=e||t_.START,i,s,n,r,o,l,a,u,h,c,void 0,d,g,f,p,m,b,v,void 0,void 0,void 0,void 0,void 0,void 0,void 0,S,y,T,w,E),this.Go=t_.START}zo(){return!1}Ko(){let t=document.createElement("span");return t.appendChild(document.createTextNode(this.message||"")),t}eh(t){let e=t.getElementsByClassName("ab-in-app-message")[0];tF.td(e,!0,!0)||(this.slideFrom===ty.TOP?e.style.top="0px":e.style.bottom="0px"),super.eh(t)}qt(){return super.qt(tO.sE)}static ha(t){return new tQ(t[tx.rE],t[tx.mE],t[tx.GE],t[tx.Fs],t[tx.FE],t[tx.HE],t[tx.URI],t[tx.xE],t[tx.BE],t[tx.lE],t[tx.bE],t[tx.ys],t[tx.YE],t[tx.KE],t[tx.XE],t[tx.dE],t[tx.hE],t[tx.yE],t[tx.uE],t[tx.VE],t[tx.CSS],t[tx.JE],t[tx.LANGUAGE],t[tx.Ks])}}function t0(t){let e;if(!t)return null;if(t.is_control)return tz.fromJson(t);let s=t.type;null!=s&&(s=s.toUpperCase());let n=t.message,r=t.text_align_message,o=t.slide_from,l=t.extras,a=t.trigger_id,u=t.click_action,h=t.uri,c=t.open_target,d=t.message_close,g=t.duration,f=t.icon,p=t.image_url,m=t.image_style,b=t.icon_color,v=t.icon_bg_color,S=t.bg_color,y=t.text_color,T=t.close_btn_color,w=t.header,E=t.text_align_header,C=t.header_text_color,I=t.frame_color,_=[],A=t.btns;null==A&&(A=[]);for(let t=0;t<A.length;t++)_.push(tZ.fromJson(A[t]));let O=t.crop_type,k=t.orientation,R=t.animate_in,N=t.animate_out,x=t.html_id,B=t.css;null!=x&&""!==x&&null!=B&&""!==B||(x=void 0,B=void 0);let L=t.message_extras,D=t.language,P=t.image_alt;if(s===tO.aE||s===tO.UE)e=new tX(n,r,l,a,u,h,c,d,g,f,p,m,b,v,S,y,T,R,N,w,E,C,I,_,O,x,B,L,D,P);else if(s===tO.cE)e=new tY(n,r,l,a,u,h,c,d,g,f,p,m,b,v,S,y,T,R,N,w,E,C,I,_,O,k,x,B,L,D,P);else if(s===tO.sE)e=new tQ(n,r,o,l,a,u,h,c,d,g,f,p,b,v,S,y,T,R,N,x,B,L,D,P);else{if(s!==tO.iE&&s!==tO.PE&&s!==tO.nE)return void i.error("Ignoring message with unknown type "+s);(e=new tV(n,l,a,d,g,R,N,I,x,B,t.message_fields,L)).trusted=t.trusted||!1}return e.ko=s,e}function t1(t){let e=[];for(let i of t)e.push(new tZ(i.text,i.backgroundColor,i.textColor,i.borderColor,i.clickAction,i.uri,i.id));return e}class t3{constructor(t){this.Gc=t,this.Gc=t}Hc(t){return null==this.Gc||this.Gc===t[0]}static fromJson(t){return new t3(t?t.event_name:null)}qt(){return this.Gc}}class t5{constructor(t,e,i,s){this.tT=t,this.sT=e,this.comparator=i,this.eT=s,this.tT=t,this.sT=e,this.comparator=i,this.eT=s,this.sT===t5.lT.iT&&this.comparator!==t5.hT.rT&&this.comparator!==t5.hT.nT&&this.comparator!==t5.hT.uT&&this.comparator!==t5.hT.oT&&(this.eT=c(this.eT))}Hc(t){let e=null;switch(null!=t&&(e=t[this.tT]),this.comparator){case t5.hT.ET:return null!=e&&e.valueOf()===this.eT.valueOf();case t5.hT.aT:return null==e||e.valueOf()!==this.eT.valueOf();case t5.hT.TT:return null!=e&&typeof e==typeof this.eT&&e>this.eT;case t5.hT.rT:return this.sT===t5.lT.iT?null!=e&&o(e)&&f(e)<=this.eT.valueOf():null!=e&&typeof e==typeof this.eT&&e>=this.eT;case t5.hT.cT:return null!=e&&typeof e==typeof this.eT&&e<this.eT;case t5.hT.nT:return this.sT===t5.lT.iT?null!=e&&o(e)&&f(e)>=this.eT.valueOf():null!=e&&typeof e==typeof this.eT&&e<=this.eT;case t5.hT.AT:return null!=e&&"string"==typeof e&&typeof e==typeof this.eT&&null!=e.match(this.eT);case t5.hT._T:return null!=e;case t5.hT.fT:return null==e;case t5.hT.uT:return null!=e&&o(e)&&p(e)<this.eT;case t5.hT.oT:return null!=e&&o(e)&&p(e)>this.eT;case t5.hT.pT:return null==e||typeof e!=typeof this.eT||"string"!=typeof e||null==e.match(this.eT)}return!1}static fromJson(t){return new t5(t.property_key,t.property_type,t.comparator,t.property_value)}qt(){let t=this.eT;return o(this.eT)&&(t=h(t.valueOf())),{k:this.tT,t:this.sT,c:this.comparator,v:t}}static _u(t){return new t5(t.k,t.t,t.c,t.v)}}t5.lT={yT:"boolean",ST:"number",NT:"string",iT:"date"},t5.hT={ET:1,aT:2,TT:3,rT:4,cT:5,nT:6,AT:10,_T:11,fT:12,uT:15,oT:16,pT:17};class t6{constructor(t){this.filters=t,this.filters=t}Hc(t){let e=!0;for(let i=0;i<this.filters.length;i++){let s=this.filters[i],n=!1;for(let e=0;e<s.length;e++)if(s[e].Hc(t)){n=!0;break}if(!n){e=!1;break}}return e}static fromJson(t){if(null==t||!r(t))return null;let e=[];for(let i=0;i<t.length;i++){let s=[],n=t[i];for(let t=0;t<n.length;t++)s.push(t5.fromJson(n[t]));e.push(s)}return new t6(e)}qt(){let t=[];for(let e=0;e<this.filters.length;e++){let i=this.filters[e],s=[];for(let t=0;t<i.length;t++)s.push(i[t].qt());t.push(s)}return t}static _u(t){let e=[];for(let i=0;i<t.length;i++){let s=[],n=t[i];for(let t=0;t<n.length;t++)s.push(t5._u(n[t]));e.push(s)}return new t6(e)}}class t2{constructor(t,e){this.Gc=t,this.tf=e,this.Gc=t,this.tf=e}Hc(t){if(null==this.Gc||null==this.tf)return!1;let e=t[0],i=t[1];return e===this.Gc&&this.tf.Hc(i)}static fromJson(t){return new t2(t?t.event_name:null,t?t6.fromJson(t.property_filters):null)}qt(){return{e:this.Gc,pf:this.tf?this.tf.qt():null}}}class t4{constructor(t,e){this.if=t,this.rf=e,this.if=t,this.rf=e}Hc(t){if(null==this.if)return!1;let e=ee.sf(t[0],this.if);if(!e)return!1;let i=null==this.rf||0===this.rf.length;if(null!=this.rf){for(let e=0;e<this.rf.length;e++)if(this.rf[e]===t[1]){i=!0;break}}return e&&i}static fromJson(t){return new t4(t?t.id:null,t?t.buttons:null)}qt(){return this.if}}class t9{constructor(t){this.productId=t,this.productId=t}Hc(t){return null==this.productId||t[0]===this.productId}static fromJson(t){return new t9(t?t.product_id:null)}qt(){return this.productId}}class t8{constructor(t,e){this.productId=t,this.tf=e,this.productId=t,this.tf=e}Hc(t){if(null==this.productId||null==this.tf)return!1;let e=t[0],i=t[1];return e===this.productId&&this.tf.Hc(i)}static fromJson(t){return new t8(t?t.product_id:null,t?t6.fromJson(t.property_filters):null)}qt(){return{id:this.productId,pf:this.tf?this.tf.qt():null}}}class t7{constructor(t){this.if=t,this.if=t}
1Hc(t){return null==this.if||ee.sf(t[0],this.if)}static fromJson(t){return new t7(t?t.campaign_id:null)}qt(){return this.if}}let et={OPEN:"open",Rr:"purchase",Fr:"push_click",he:"custom_event",rm:"iam_click",Ls:"test"};t.s(["default",0,et],90204);class ee{constructor(t,e){this.type=t,this.data=e,this.type=t,this.data=e}Vc(t,e){return ee.Yc[this.type]===t&&(null==this.data||this.data.Hc(e))}static sf(t,e){let s=null;try{s=window.atob(t)}catch(e){return i.info("Failed to unencode analytics id "+t+": "+v(e)),!1}return e===s.split("_")[0]}static fromJson(t){let e=t.type,i=null;switch(e){case ee.la.OPEN:case ee.la.Ls:break;case ee.la.Rr:i=t9.fromJson(t.data);break;case ee.la.Qc:i=t8.fromJson(t.data);break;case ee.la.Fr:i=t7.fromJson(t.data);break;case ee.la.he:i=t3.fromJson(t.data);break;case ee.la.Xc:i=t2.fromJson(t.data);break;case ee.la.rm:i=t4.fromJson(t.data)}return new ee(e,i)}qt(){return{t:this.type,d:this.data?this.data.qt():null}}static _u(t){let e,i=null;switch(t.t){case ee.la.OPEN:case ee.la.Ls:break;case ee.la.Rr:i=new t9(t.d);break;case ee.la.Qc:i=new t8((e=t.d||{}).id,t6._u(e.pf||[]));break;case ee.la.Fr:i=new t7(t.d);break;case ee.la.he:i=new t3(t.d);break;case ee.la.Xc:i=new t2((e=t.d||{}).e,t6._u(e.pf||[]));break;case ee.la.rm:i=new t4(t.d)}return new ee(t.t,i)}}ee.la={OPEN:"open",Rr:"purchase",Qc:"purchase_property",Fr:"push_click",he:"custom_event",Xc:"custom_event_property",rm:"iam_click",Ls:"test"},ee.Yc={},ee.Yc[ee.la.OPEN]=et.OPEN,ee.Yc[ee.la.Rr]=et.Rr,ee.Yc[ee.la.Qc]=et.Rr,ee.Yc[ee.la.Fr]=et.Fr,ee.Yc[ee.la.he]=et.he,ee.Yc[ee.la.Xc]=et.he,ee.Yc[ee.la.rm]=et.rm,ee.Yc[ee.la.Ls]=et.Ls;class ei{constructor(t,e=[],i,s,n=0,r,o,l=0,a=ei.sd,u,h,c){this.id=t,this.ed=e,this.startTime=i,this.endTime=s,this.priority=n,this.type=r,this.data=o,this.hd=l,this.nd=a,this.ca=u,this.ad=h,this.ud=c,this.id=t,this.ed=e||[],void 0===i&&(i=null),this.startTime=i,void 0===s&&(s=null),this.endTime=s,this.priority=n||0,this.type=r,this.hd=l||0,null==u&&(u=1e3*(this.hd+30)),this.ca=u,this.data=o,null!=a&&(this.nd=a),this.ad=h,this.ud=c||null}dd(t){return null==this.ud||this.nd!==ei.sd&&t-this.ud>=1e3*this.nd}md(t){this.ud=t}gd(t){return Math.max(t+1e3*this.hd-new Date().valueOf(),0)}fd(t){let e=new Date().valueOf()-t,s=null==t||isNaN(e)||null==this.ca||e<this.ca;return s||i.info(`Trigger action ${this.type} is no longer eligible for display - fired ${e}ms ago and has a timeout of ${this.ca}ms.`),!s}static fromJson(t){let e=t.id,i=[];for(let e=0;e<t.trigger_condition.length;e++)i.push(ee.fromJson(t.trigger_condition[e]));let s=c(t.start_time),r=c(t.end_time),o=t.priority,l=t.type,a=t.delay,u=t.re_eligibility,h=t.timeout,d=t.data,g=t.min_seconds_since_last_trigger;return n(ei.la,l,"Could not construct Trigger from server data","Trigger.Types")?new ei(e,i,s,r,o,l,d,a,u,h,g):null}qt(){let t=[];for(let e=0;e<this.ed.length;e++)t.push(this.ed[e].qt());return{i:this.id,c:t,s:this.startTime,e:this.endTime,p:this.priority,t:this.type,da:this.data,d:this.hd,r:this.nd,tm:this.ca,ss:this.ad,ld:this.ud}}static _u(t){let e=[],i=t.c||[];for(let t=0;t<i.length;t++)e.push(ee._u(i[t]));return new ei(t.i,e,g(t.s),g(t.e),t.p,t.t,t.da,t.d,t.r,t.tm,t.ss,t.ld)}}ei.la={oa:"inapp",pd:"templated_iam"},ei.sd=-1;class es{constructor(t,e,i,s){this.B=t,this.j=e,this.C=i,this.Ss=s,this.B=t,this.j=e,this.C=i,this.Ss=s,this.In=new te,ey.S(this.In),this.An=1e3,this.Dn=6e4,this.Bn=null,this._n=null,this.qn=null}Pn(){return this.In}En(t){return this.In.Kt(t)}Gn(){return this.Bn}Nn(t){this.Bn=t}wt(t,e,s,n){let r,o=new th;if(e===y.Fn||t instanceof tz){if(!t.gs())return i.info("This in-app message has already received an impression. Ignoring analytics event."),o}else if((e===y.On||t instanceof tV&&e===y.Xn)&&!t.ss(n))return i.info("This in-app message has already received a click. Ignoring analytics event."),o;return null==(r=t instanceof tz?{trigger_ids:[t.triggerId]}:this.Hn(t))?o:(t.messageExtras&&(r.message_extras=t.messageExtras),null!=s&&(r.bid=s),tc.wt(e,r))}Jn(t,e){let s=new th;if(!t.ss())return i.info("This in-app message button has already received a click. Ignoring analytics event."),s;let n=this.Hn(e);
1return null==n?s:t.id===tZ.Kn?(i.info("This in-app message button does not have a tracking id. Not logging event to Braze servers."),s):(null!=t.id&&(n.bid=t.id),tc.wt(y.Xn,n))}Ln(t){let e=t.messageFields;return null!=e&&e.is_push_primer||!1}Qn(t){let e;if(!(t instanceof tJ))return;let i=t=>{if(!t)return;let e=_(t);if(O(e))return I(C.Un,"In-App Message");if(k(e)){let t=tB.Vn();if(!t.Wn)return tB.Yn(t.reason,"In-App Message")}};if(this.Ln(t)){let t=tB.Vn();if(!t.Wn)return tB.Yn(t.reason,"In-App Message")}for(let s of t.buttons||[])if(s.clickAction===tT.URI&&s.uri&&D.test(s.uri)&&(e=i(s.uri)))return e;return t.clickAction===tT.URI&&t.uri&&D.test(t.uri)?i(t.uri):void 0}Zn(t,e){e!==this.qn&&this._o(),this._n=t,this.qn=e}_o(){null!=this._n&&(clearTimeout(this._n),this._n=null,this.qn=null)}Xo(t,e,s,n){let r=this.B;if(!r)return;this.qn&&t.triggerId!==this.qn&&(this._o(),tg.Li(this.C,tg.it.Yo));let o=r.Zo(!1),l=r.Z(o);l.template={trigger_id:t.triggerId,trigger_event_type:e},null!=s&&(l.template.data=s.ta());let a=r.tt(l,tg.it.Yo);r.et(l,(r=-1)=>{let o=this.B;if(!o)return;let u=new Date().valueOf();tg.nt(this.C,tg.it.Yo,u),-1!==r&&a.push(["X-Braze-Req-Tokens-Remaining",r.toString()]);let h,c,d=!1;tp.ot({url:`${o.ht()}/template/`,data:l,headers:a,lt:e=>{if(!o.ut(l,e,a))return void("function"==typeof t.ia&&t.ia());if(o.ct(),null==e||null==e.templated_message)return;let s=e.templated_message;if(s.type!==ei.la.oa)return;let n=t0(s.data);if(null==n)return;let r=this.Qn(n);r?(i.error(r),"function"==typeof t.ia&&t.ia()):"function"==typeof t.ua&&t.ua(n)},error:e=>{d=!0,h=e,c=`getting user personalization for message ${t.triggerId}.`},ft:(i,r)=>{if(new Date().valueOf()-t.ma<t.ca){let i=0;if(d){let e=Math.min(t.ca,this.Dn),s=this.An;null==n&&(n=s),i=Math.min(e,tL(s,3*n))}o.yt(r,()=>{this.Xo(t,e,s,i)},tg.it.Yo,e=>this.Zn(e,t.triggerId),()=>this._o(),i)}d&&o.dt(h,c)}})},tg.it.Yo)}Hn(t){if(null==t.triggerId)return i.info("The in-app message has no analytics id. Not logging event to Braze servers."),null;let e={};return null!=t.triggerId&&(e.trigger_ids=[t.triggerId]),e}jn(t){return!!this.C&&!(!(t&&t instanceof tJ&&t.constructor!==tJ)||t instanceof tz)&&this.C.It(Q.Tt.pa,t.qt())}sa(){let t;if(!this.C)return null;let e=this.C.Rt(Q.Tt.pa);if(!e)return null;switch(e.type){case tO.cE:t=tY.ha(e);break;case tO.iE:case tO.PE:case tO.nE:t=tV.ha(e);break;case tO.aE:case tO.UE:t=tX.ha(e);break;case tO.sE:t=tQ.ha(e)}return t&&this.fa(),t}fa(){this.C&&this.C.Qt(Q.Tt.pa)}}let en={na:null,i:!1,ra:()=>(en.t(),en.na||(en.na=new es(ey.m(),ey.u(),ey.p(),ey.ir())),en.na),t:()=>{en.i||(ey.g(en),en.i=!0)},destroy:()=>{en.na=null,en.i=!1}},er=en;class eo{constructor(t,e,i,s,n){this.triggerId=t,this.ua=e,this.ia=i,this.ma=s,this.ca=n,this.triggerId=t,this.ua=e,this.ia=i,this.ma=s,this.ca=n}static fromJson(t,e,i,s,n){return null==t||null==t.trigger_id?null:new eo(t.trigger_id,e,i,s,n)}}class el extends tn{constructor(t,e,i,s,n){super(),this.tg=t,this.Rs=e,this.C=i,this.Ru=s,this.ig=n,this.tg=t,this.Rs=e,this.C=i,this.Ru=s,this.ig=n,this.sg=[],this.eg=[],this.hg=null,this.ng={},this.og={},this.triggers=[],this.lg=0,this.ag(),this.gg()}fg(){if(this.C){this.hg=this.C.Rt(Q.Tt.oS)||this.hg,this.ng=this.C.Rt(Q.Tt.nS)||this.ng,this.og=this.C.Rt(Q.Tt.rS)||this.og;for(let t=0;t<this.triggers.length;t++){let e=this.triggers[t];e.id&&null!=this.og[e.id]&&e.md(this.og[e.id])}}}ag(){if(!this.C)return;this.lg=this.C.Rt(Q.Tt.sS)||0;let t=this.C.Rt(Q.Tt.eS)||[],e=[];for(let i=0;i<t.length;i++)e.push(ei._u(t[i]));this.triggers=e,this.fg()}gg(){let t=this,e=function(e,i,s,n,r){return function(){t.cg(e,i,s,n,r)}},i={};for(let t of this.triggers)t.id&&(i[t.id]=t);let s=!1;for(let t=0;t<this.triggers.length;t++){let n=this.triggers[t];if(n.id&&null!=this.ng[n.id]){let t=this.ng[n.id],o=[];for(let s=0;s<t.length;s++){let l=t[s],a=n.gd(l.ma||0);if(a>0){let t,s;o.push(l),null!=l.ug&&(t=l.ug),null!=l.dg&&m.hS(l.dg)&&(s=m._u(l.dg));let u=[];if(l.pg&&r(l.pg))for(let t=0;t<l.pg.length;t++){let e=i[l.pg[t]];null!=e&&u.push(e)}this.eg.push(window.setTimeout(e(n,l.ma||0,t,s,u),a))}}this.ng[n.id].length>o.length&&(this.ng[n.id]=o,s=!0,0===this.ng[n.id].length&&delete this.ng[n.id])}}s&&this.C&&this.C.It(Q.Tt.nS,this.ng)}mg(){if(!this.C)return;let t=[];for(let e=0;e<this.triggers.length;e++)t.push(this.triggers[e].qt());this.lg=new Date().valueOf(),this.C.It(Q.Tt.eS,t),this.C.It(Q.Tt.sS,this.lg)}bg(){this.C&&((this.C.Rt(Q.Tt.sS)||0)>this.lg?this.ag():this.fg())}I(t){let e=!1;if(null!=t&&t.triggers){let s;this.ig.fa(),this.fg();let n={},r={};this.triggers=[];for(let i=0;i<t.triggers.length;i++){let s=ei.fromJson(t.triggers[i]);if(s){s.id&&null!=this.og[s.id]&&(s.md(this.og[s.id]),n[s.id]=this.og[s.id]),s.id&&null!=this.ng[s.id]&&(r[s.id]=this.ng[s.id]);for(let t=0;t<s.ed.length;t++)if(s.ed[t].Vc(et.Ls,null)){e=!0;break}this.triggers.push(s)}}u(this.og,n)||(this.og=n,this.C&&this.C.It(Q.Tt.rS,this.og)),u(this.ng,r)||(this.ng=r,this.C&&this.C.It(Q.Tt.nS,this.ng)),this.mg(),e&&(i.info("Trigger with test c
1ondition found, firing test."),this.Ee(et.Ls)),this.Ee(et.OPEN);let o=this.sg;this.sg=[];for(let t=0;t<o.length;t++)s=Array.prototype.slice.call(o[t]),this.Ee(...s)}}cg(t,e,s,n,r){let o,l,a,u=n=>{this.fg();let r=new Date().valueOf();t.fd(e)||(!1===navigator.onLine&&t.type===ei.la.oa&&n.imageUrl?i.info(`Not showing ${t.type} trigger action ${t.id} due to offline state.`):t.dd(r)&&this.wg(t,r,s)?0===this.Rs.Le()?i.info(`Not displaying trigger ${t.id} because neither automaticallyShowInAppMessages() nor subscribeToInAppMessage() were called.`):(this.Rs.A([n]),this.yg(t,r)):i.info(`Not displaying trigger ${t.id} because display time fell outside of the acceptable time window.`))},h=()=>{this.fg();let o=r.pop();if(null!=o)if(this.Tg(o,e,s,n,r),o.fd(e)){let t=`Server aborted in-app message display, but the timeout on fallback trigger ${o.id} has already elapsed.`;r.length>0&&(t+=" Continuing to fall back."),i.info(t),h()}else{i.info(`Server aborted in-app message display. Falling back to lower priority ${o.type} trigger action ${t.id}.`);let l=1e3*o.hd-(new Date().valueOf()-e);l>0?this.eg.push(window.setTimeout(()=>{this.cg(o,e,s,n,r)},l)):this.cg(o,e,s,n,r)}};switch(t.type){case ei.la.oa:if(null==(o=t0(t.data))){i.error(`Could not parse trigger data for trigger ${t.id}, ignoring.`);break}if(l=this.ig.Qn(o)){i.error(l),h();break}u(o);break;case ei.la.pd:if(null==(a=eo.fromJson(t.data,u,h,e,t.ca||0))){i.error(`Could not parse trigger data for trigger ${t.id}, ignoring.`);break}this.ig.Xo(a,s,n);break;default:i.error(`Trigger ${t.id} was of unexpected type ${t.type}, ignoring.`)}}Ee(t,e=null,s){if(!n(et,t,"Cannot fire trigger action.","TriggerEvents"))return;if(this.Ru&&this.Ru.Ic())return i.info("Trigger sync is currently in progress, awaiting sync completion before firing trigger event."),void this.sg.push(arguments);this.bg();let r=new Date().valueOf(),o=r-(this.hg||0),l=!0,a=!0,u=[];for(let i=0;i<this.triggers.length;i++){let s=this.triggers[i],n=r+1e3*s.hd;if(s.dd(n)&&(null==s.startTime||s.startTime.valueOf()<=r)&&(null==s.endTime||s.endTime.valueOf()>=r)){let i=!1;for(let n=0;n<s.ed.length;n++)if(s.ed[n].Vc(t,e)){i=!0;break}i&&(l=!1,this.wg(s,n,t)&&(a=!1,u.push(s)))}}if(l)return void i.info(`Trigger event ${t} did not match any trigger conditions.`);if(a)return void i.info(`Ignoring ${t} trigger event because a trigger was displayed ${o/1e3}s ago.`);u.sort((t,e)=>t.priority-e.priority);let h=u.pop();null!=h&&(i.info(`Firing ${h.type} trigger action ${h.id} from trigger event ${t}.`),this.Tg(h,r,t,s,u),0===h.hd?this.cg(h,r,t,s,u):this.eg.push(window.setTimeout(()=>{this.cg(h,r,t,s,u)},1e3*h.hd)))}changeUser(t=!1){if(this.triggers=[],this.C&&this.C.Qt(Q.Tt.eS),!t){this.sg=[],this.hg=null,this.og={},this.ng={};for(let t=0;t<this.eg.length;t++)clearTimeout(this.eg[t]);this.eg=[],this.C&&(this.C.Qt(Q.Tt.oS),this.C.Qt(Q.Tt.rS),this.C.Qt(Q.Tt.nS))}}clearData(){this.triggers=[],this.hg=null,this.og={},this.ng={};for(let t=0;t<this.eg.length;t++)clearTimeout(this.eg[t]);this.eg=[]}wg(t,e,s){if(null==this.hg)return!0;if(s===et.Ls)return i.info("Ignoring minimum interval between trigger because it is a test type."),!0;let n=t.ad;return null==n&&(n=this.tg),e-this.hg>=1e3*n}Tg(t,e,i,s,n){let r;this.fg(),t.id&&(this.ng[t.id]=this.ng[t.id]||[]);let o={};o.ma=e,o.ug=i,null!=s&&(r=s.qt()),o.dg=r;let l=[];for(let t of n)t.id&&l.push(t.id);o.pg=l,t.id&&this.ng[t.id].push(o),this.C&&this.C.It(Q.Tt.nS,this.ng)}yg(t,e){this.fg(),t.md(e),this.hg=e,t.id&&(this.og[t.id]=e),this.C&&(this.C.It(Q.Tt.oS,e),this.C.It(Q.Tt.rS,this.og))}}let ea={i:!1,provider:null,o:()=>(ea.t(),ea.provider||ea.rg(),ea.provider),rg:()=>{if(!ea.provider){let t=ey.er(eS.Dh);ea.provider=new el(null!=t?t:30,er.ra().Pn(),ey.p(),ey.nn(),er.ra()),ey.v(ea.provider)}},t:()=>{ea.i||(ea.rg(),ey.g(ea),ea.i=!0)},destroy:()=>{ea.provider=null,ea.i=!1}};function eu(){return"u">typeof SharedWorker}class eh{constructor(t){this.Wr=null,this.Lr=null,this.isConnected=!1,this.Ir=null,this.Mr=null,this.Be=t.Be,this.Pe=t.Pe,this.He=t.He,this.Je=t.Je}initialize(){if(!eu())return i.info("SharedWorker not supported, will use direct connection"),!1;try{let t=new Blob(['\n"use strict";\nconst workerSelf = self;\nlet eventSource = null;\nlet currentConfig = null;\nlet retryCount = 0;\nlet retryTimeoutId = null;\nlet connectionInProgress = false;\nconst maxRetries = 5;\nconst connectedPorts = new Map();\nlet lastSleepMs = null;\nlet currentRcs = null;\nlet ttlTimeoutId = null;\nlet leaderPortId = null;\nlet ddrTimeoutId = null;\nconst fn = {\n startConnection: null,\n handleMessage: null,\n};
1\nfunction broadcast(message) {\n connectedPorts.forEach((portInfo, portId) => {\n try {\n portInfo.port.postMessage(message);\n }\n catch (_a) {\n connectedPorts.delete(portId);\n }\n });\n}\nfunction randomInclusive(min, max) {\n return Math.floor(Math.random() * (max - min + 1)) + min;\n}\nfunction electLeader() {\n if (leaderPortId && connectedPorts.has(leaderPortId)) {\n return;\n }\n const firstPortId = connectedPorts.keys().next().value;\n leaderPortId = firstPortId || null;\n if (leaderPortId) {\n console.log("[Braze Real-Time] Elected leader port:", leaderPortId);\n }\n}\nfunction promoteToLeader(portId) {\n if (connectedPorts.has(portId) && leaderPortId !== portId) {\n leaderPortId = portId;\n console.log("[Braze Real-Time] Promoted to leader (tab became active):", portId);\n }\n}\nfunction sendToLeader(message) {\n electLeader();\n if (!leaderPortId) {\n console.warn("[Braze Real-Time] No leader to send message to");\n return;\n }\n const leader = connectedPorts.get(leaderPortId);\n if (leader) {\n try {\n leader.port.postMessage(message);\n }\n catch (_a) {\n connectedPorts.delete(leaderPortId);\n leaderPortId = null;\n sendToLeader(message);\n }\n }\n}\nfunction closeConnection() {\n connectionInProgress = false;\n if (retryTimeoutId !== null) {\n clearTimeout(retryTimeoutId);\n retryTimeoutId = null;\n }\n if (ttlTimeoutId !== null) {\n clearTimeout(ttlTimeoutId);\n ttlTimeoutId = null;\n }\n if (ddrTimeoutId !== null) {\n clearTimeout(ddrTimeoutId);\n ddrTimeoutId = null;\n }\n if (eventSource) {\n eventSource.close();\n eventSource = null;\n broadcast({ type: "disconnected" });\n }\n}\nfunction retryWithBackoff() {\n if (!currentConfig) {\n return;\n }\n retryCount++;\n const { minSleepMs, maxSleepMs, scaleFactor } = currentConfig.backoff;\n let previousSleepMs = lastSleepMs;\n if (previousSleepMs == null || previousSleepMs < minSleepMs) {\n previousSleepMs = minSleepMs;\n }\n const backoffMs = Math.min(maxSleepMs, randomInclusive(minSleepMs, previousSleepMs * scaleFactor));\n lastSleepMs = backoffMs;\n console.log("[Braze Real-Time] Retrying in " + backoffMs + "ms (attempt " + retryCount + "/" + maxRetries + ")");\n retryTimeoutId = setTimeout(function () {\n retryTimeoutId = null;\n fn.startConnection();\n }, backoffMs);\n}\nfunction startConnection(oldEventSourceToClose) {\n if (!currentConfig) {\n return;\n }\n if (eventSource && !oldEventSourceToClose) {\n console.warn("[Braze Real-Time] Connection already exists");\n return;\n }\n if (connectionInProgress && !oldEventSourceToClose) {\n console.warn("[Braze Real-Time] Connection attempt already in progress");\n return;\n }\n connectionInProgress = true;\n const { dustHost, mite, auth } = currentConfig;\n const dustHostWithScheme = /^https?:\\/\\//i.test(dustHost) ? dustHost : "https://" + dustHost;\n let queryString = "mite=" + encodeURIComponent(mite) + "&attempts=" + retryCount;\n if (auth) {\n queryString += "&auth=" + encodeURIComponent(auth);\n }\n if (currentRcs) {\n queryString += "&rcs=" + encodeURIComponent(currentRcs);\n }\n const subscribeUrl = dustHostWithScheme + "/sse?" + queryString;\n try {\n const newEventSource = new EventSource(subscribeUrl);\n newEventSource.onopen = function () {\n if (oldEventSourceToClose) {\n console.log("[Braze Real-Time] Gapless reconnection: new connection established, closing old connection");\n oldEventSourceToClose.close();\n }\n else {\n console.log("[Braze Real-Time] Connection established");\n }\n eventSource = newEventSource;\n connectionInProgress = false;\n retryCount = 0;\n lastSleepMs = null;\n broadcast({ type: "connected" });\n };\n newEventSource.addEventListener("msg", function (event) {\n fn.handleMessage(event.data);\n });\n newEventSource.onerror = function () {\n const readyState = newEventSource ? newEventSource.readyState : -1;\n if (readyState === 0) {\n console.log("[Braze Real-Time] Failed to connect");\n }\n else {\n console.log("[Braze Real-Time] Connection lost");\n }\n if (oldEventSourceToClose && eventSource !== newEventSource) {\n console.log("[Braze Real-Time] Gapless reconnection failed, keeping old connection");\n newEventSource.close();\n connectionInProgress = false;\n if (retryCount < maxRetries) {\n retryWithBackoff();\n }\n return;\n }\n closeConnection();\n if (retryCount < maxRetries) {\n retryWithBackoff();\n }\n else {\n console.error("[Braze Real-Time] Max retries reached");\n broadcast({ type: "error", error: "Max retry attempts reached" });\n }\n };\n }\n catch (error) {\n connectionInProgress = false;\n console.error("[Braze Real-Time] Failed to create EventSource:", error);\n broadcast({ type: "error", error: String(error) });\n }\n}\nfunction handleTtlMessage(tMs, rcs) {\n if (typeof tMs !== "number") {\n return;\n }\n if (typeof rcs === "string") {\n currentRcs = rcs;\n }\n console.log("[Braze Real-Time] TTL set to " + tMs + "ms, will perform gapless reconnection when expired");\n if (ttlTimeoutId !== null) {\n clearTimeout(ttlTimeoutId);\n }\n ttlTimeoutId = setTimeout(function () {\n ttlTimeoutId = null;\n console.log("[Braze Real-Time] TTL expired, performing gapless reconnection");\n startConnection(eventSource || undefined);\n }, tMs);\n}\nfunction handleDdrMessage(rMs, reason) {\n if (typeof rMs !== "number") {\n return;\n }\n const jitter = Math.random() * rMs * 0.3;\n const waitMs = Math.round(rMs + jitter);\n const reasonStr = reason ? " (" + reason + ")" : "";\n console.log("[Braze Real-Time] Admin requested disconnect" + reasonStr + ", reconnecting in " + waitMs + "ms");\n if (ddrTimeoutId !== null) {\n clearTimeout(ddrTimeoutId);\n }\n closeConnection();\n ddrTimeoutId = setTimeout(function () {\n ddrTimeoutId = null;\n fn.startConnection();\n }, waitMs);\n}
1\nfunction handleMessage(data) {\n try {\n const message = JSON.parse(data);\n if (!message.type) {\n console.warn("[Braze Real-Time] Message without type:", message);\n return;\n }\n if (message.type === "ttl" && message.body) {\n handleTtlMessage(message.body.t_ms, message.body.rcs);\n return;\n }\n if (message.type === "ddr" && message.body) {\n handleDdrMessage(message.body.r_ms, message.body.e);\n return;\n }\n console.log("[Braze Real-Time] Routing \'" + message.type + "\' message to leader");\n sendToLeader({ type: "message", data: message });\n }\n catch (error) {\n console.warn("[Braze Real-Time] Failed to parse message:", error);\n }\n}\nfn.startConnection = startConnection;\nfn.handleMessage = handleMessage;\nfunction handlePortMessage(port, portId, message) {\n switch (message.type) {\n case "connect":\n if (currentConfig &&\n (currentConfig.mite !== message.config.mite || currentConfig.dustHost !== message.config.dustHost)) {\n console.log("[Braze Real-Time] Config changed, reconnecting");\n closeConnection();\n retryCount = 0;\n lastSleepMs = null;\n currentRcs = null;\n }\n currentConfig = message.config;\n electLeader();\n if (!eventSource && !connectionInProgress) {\n startConnection();\n }\n else if (eventSource) {\n port.postMessage({ type: "connected" });\n }\n break;\n case "disconnect":\n connectedPorts.delete(portId);\n if (portId === leaderPortId) {\n leaderPortId = null;\n electLeader();\n }\n if (connectedPorts.size === 0) {\n console.log("[Braze Real-Time] No more ports, closing connection");\n closeConnection();\n currentConfig = null;\n currentRcs = null;\n leaderPortId = null;\n }\n break;\n case "tab_active":\n promoteToLeader(portId);\n break;\n case "ping":\n port.postMessage({ type: "pong" });\n break;\n default:\n console.warn("[Braze Real-Time] Unknown message type:", message.type);\n }\n}\nworkerSelf.onconnect = function (event) {\n const port = event.ports[0];\n const portId = "port-" + Date.now() + "-" + Math.random().toString(36).substr(2, 9);\n connectedPorts.set(portId, { port: port });\n port.onmessage = function (messageEvent) {\n try {\n handlePortMessage(port, portId, messageEvent.data);\n }\n catch (error) {\n console.error("[Braze Real-Time] Error handling message:", error);\n }\n };\n port.onmessageerror = function () {\n console.warn("[Braze Real-Time] Message error from port:", portId);\n connectedPorts.delete(portId);\n };\n port.start();\n};\n'],{type:"application/javascript"});return this.Lr=URL.createObjectURL(t),this.Wr=new SharedWorker(this.Lr,{name:"braze-dust-worker"}),this.Wr.port.onmessage=t=>{this.Ur(t.data)},this.Wr.port.onmessageerror=()=>{i.warn("Message error from real-time messaging worker")},this.Wr.onerror=t=>{var e;i.error(`Real-time messaging worker error: ${t.message||"unknown error"}`),null==(e=this.Je)||e.call(this,"SharedWorker error")},this.Wr.port.start(),this.Vr(),this.Er(),i.info("Real-time messaging worker initialized"),!0}catch(t){return i.error(`Failed to create real-time messaging worker: ${t instanceof Error?t.message:String(t)}`),this._r(),!1}}Ur(t){var e,s,n;switch(t.type){case"connected":i.info("Real-time messaging connection established via SharedWorker"),this.isConnected=!0,null==(e=this.Pe)||e.call(this);break;case"disconnected":i.info("Real-time messaging connection closed via SharedWorker"),this.isConnected=!1,null==(s=this.He)||s.call(this);break;case"message":this.Be(t.data);break;case"error":i.error(`Real-time messaging error: ${t.error}`),null==(n=this.Je)||n.call(this,t.error)}}Vr(){this.Ir=window.setInterval(()=>{this.Wr&&this.Gr({type:"ping"})},3e4)}Jr(){null!==this.Ir&&(window.clearInterval(this.Ir),this.Ir=null)}Er(){this.Mr=()=>{"visible"===document.visibilityState&&this.Wr&&this.Gr({type:"tab_active"})},document.addEventListener("visibilitychange",this.Mr)}Kr(){this.Mr&&(document.removeEventListener("visibilitychange",this.Mr),this.Mr=null)}Gr(t){this.Wr&&this.Wr.port.postMessage(t)}connect(t){this.Wr?(this.Gr({type:"connect",zn:t}),i.info("Connecting to real-time messaging")):i.error("Cannot connect: real-time messaging worker not initialized")}disconnect(){this.Wr&&(this.Gr({type:"disconnect"}),this.isConnected=!1,i.info("Disconnecting from real-time messaging"))}cn(){return this.isConnected}isInitialized(){return null!==this.Wr}_r(){this.Jr(),this.Kr(),this.Wr&&(this.Wr.port.close(),this.Wr=null),this.Lr&&(URL.revokeObjectURL(this.Lr),this.Lr=null),this.isConnected=!1}destroy(){this.disconnect(),this._r(),i.info("Real-time messaging worker destroyed")}}class ec extends tn{constructor(t,e,i,s,n=!0){super(),this.B=t,this.C=e,this.h=i,this.B=t,this.C=e,this.h=i,this.mite=null,this.Wi=null,this.Gi=null,this.Hi=null,this.Oi=s||null,this.Ki=null,this.Qi=null,this.T=null,this.Vi=0,this.Xi=5,this.Yi=null,this.Zi=null,this._i=!0,this.we=null,this.Se=null,this.ke=null,this.ye=null,this.Re=!1,this.Me=new Map,this.xe=null,this.De=null,this.We=null,this.Fe=this.Ue(n),this.Ne=!1,this.Te=0,this.ze()}Ue(t){return t?eu()?"sharedworker":(i.info("SharedWorker not supported, using direct EventSource (multi-tab will gracefully degrade)"),"direct"):(i.info("Shared connection disabled, using direct EventSource"),"direct")}Ae(){this.We=new eh({Be:t=>{this.Ge(t)},Pe:()=>{this.qe()},He:()=>{},Je:t=>{i.error(`Real-time messaging SharedWorker error: ${t}`)}}),this.We.initialize()||(i.info("SharedWorker initialization failed, falling back to direct EventSource"),this.Fe="direct",this.We=null)}qe(){this.Vi=0,this.we=null,this._i=!0,this.Ne=!1,this.Te=0}Ge(t){if(!t.type)return void i.warn(`Received real-time message without type: ${JSON.stringify(t)}`);let e="sharedworker"===this.Fe?"SharedWorker":"Direct";i.info(`Received real-time message of type '${t.type}' via ${e}`);let s=this.Me.get(t.type);if(s&&s.Le()>0)try{s.A(t)}catch(e){i.error(`Error invoking subscription for message type '${t.type}': ${e}`)}else i.info(`No subscribers for real-time message type '${t.type}'`)}Oe(){return"sharedworker"===this.Fe}Ie(){return this.Fe}ze(){if(this.C){let t=this.C.Rt(Q.Tt.Ke),e=this.C.Rt(Q.Tt.Qe),s=this.C.Rt(Q.Tt.Ve),n=this.C.Rt(Q.Tt.Xe);t&&e?(this.mite=t,this.Wi=e,this.Gi=s,this.Hi=n,i.info("Restored real-time messaging configuration from storage")):(t||e)&&(i.warn("Incomplete real-time messaging configuration in storage, clearing"),this.Ye())}}Hr(){this.xe||this.De||(this.xe=this.Ze("ddr",t=>{if(!t.body||"number"!=typeof t.body._e)return;let e=Math.random()*t.body._e*.3,s=Math.round(t.body._e+e),n=t.body.e?` (${t.body.e})`:"";i.info(`Admin requested disconnect${n}, reconnecting in ${s}ms`),this.sn(),setTimeout(()=>this.en(),s)}),this.De=this.Ze("ttl",t=>{if(!t.body||"number"!=typeof t.body.on)return;let e=t.body.on;i.info(`Time to live set to ${e}ms, will reconnect when expired`),"sharedworker"!==this.Fe&&("string"==typeof t.body.hn&&(this.Ki=t.body.hn),null!==this.Zi&&window.clearTimeout(this.Zi),this.Zi=window.setTimeout(()=>{this.Zi=null,i.info("Time to live expired, performing gapless reconnection"),this.an()},e))}))}ln(){this.Se||this.ke||(this.ye=()=>{this.Re=!0,this._i=!1},window.addEventListener("beforeunload",this.ye),this.Se=()=>{var t;this.Re=!0,(this.Qi||(null==(t=this.We)?void 0:t.cn()))&&(i.info("Page unloading, closing real-time connection gracefully"),this._i=!1,this.sn())},window.addEventListener("pagehide",this.Se),this.ke=t=>{var e;let s=this.Qi||(null==(e=this.We)?void 0:e.cn());t.persisted&&this.un()&&!s&&(i.info("Page restored from bfcache, reconnecting"),this.Re=!1,this.qe(),this.en())},window.addEventListener("pageshow",this.ke))}Lt(){return this.T}$t(t){this.T=t}Ze(t,e){if("function"!=typeof e)return null;let i=this.Me.get(t);
1return i||(i=new te,this.Me.set(t,i),ey.S(i)),i.Kt(e)}dn(t,e){let i=this.Me.get(t);i&&i.removeSubscription(e)}un(){return!!(this.mite&&this.Wi)}gn(){return!!this.Hi&&Math.floor(new Date().valueOf()/1e3)>=this.Hi}Ye(){this.mite=null,this.Wi=null,this.Gi=null,this.Hi=null,this.Ki=null,this.C&&(this.C.Qt(Q.Tt.Ke),this.C.Qt(Q.Tt.Qe),this.C.Qt(Q.Tt.Ve),this.C.Qt(Q.Tt.Xe))}mn(t,e){let s=()=>{"function"==typeof e&&e()},n=this.B,r=this.C;if(!n||!r)return i.error("NetworkManager or StorageManager not available"),void s();if(!this.h||!this.h.fn())return i.info("Real-time messaging is not enabled, skipping refresh"),void s();this.un()?i.info("Refreshing real-time messaging configuration"):i.info("Fetching initial real-time messaging configuration");let o=n.Z({},!0),l=n.tt(o,tg.it.pn,!1),a=new Date().valueOf();tg.nt(r,tg.it.pn,a),tp.ot({url:`${n.ht()}/dust/config`,headers:l,data:o,lt:e=>{n.ut(o,e,l)?(n.ct(),e.mite&&e.host?(this.mite=e.mite,this.Wi=e.host,this.Gi=e.auth||null,this.Hi=e.expiration||null,i.info("Received real-time messaging configuration from server"),r.It(Q.Tt.Ke,e.mite),r.It(Q.Tt.Qe,e.host),e.auth?r.It(Q.Tt.Ve,e.auth):r.Qt(Q.Tt.Ve),e.expiration?r.It(Q.Tt.Xe,e.expiration):r.Qt(Q.Tt.Xe),this.en(),"function"==typeof t&&t()):(i.info("Real-time messaging configuration not available - this SDK version may not be supported"),this.Ye(),s())):(i.error("Failed to validate server response for real-time messaging configuration"),s())},error:t=>{n.dt(t,"retrieving DUST config"),s()}})}en(){if(!this.h||!this.h.fn())return;if(!this.un())return void i.error("Cannot start real-time subscription without configuration");if(this.gn())return i.info("Real-time messaging auth token has expired, refreshing configuration"),void this.mn(()=>{this.en()},()=>{i.error("Failed to refresh expired real-time messaging configuration")});let t=this.mite,e=this.Oi||this.Wi;if(t&&e)switch(this.Fe){case"sharedworker":this.vn(t,e);break;case"direct":this.Qi&&(i.info("Real-time connection already exists, closing before starting new subscription"),this.sn()),this.wn()}}bn(){var t,e,i;let s,n,r=this.mite,o=this.Oi||this.Wi;return r&&o?(t=this.Vi,e=this.Gi||void 0,i=this.Ki||void 0,s=/^https?:\/\//i.test(o)?o:`https://${o}`,n=`mite=${encodeURIComponent(r)}&attempts=${t}`,e&&(n+=`&auth=${encodeURIComponent(e)}`),i&&(n+=`&rcs=${encodeURIComponent(i)}`),`${s}/sse?${n}`):null}vn(t,e){var s,n,r;if(this.We||this.Ae(),!this.We)return i.info("SharedWorker initialization failed, falling back to direct EventSource"),this.Fe="direct",void this.Sn();this.Oi&&i.info(`Using custom real-time messaging host: ${this.Oi}`),i.info("Starting real-time subscription via SharedWorker");let o=(null==(s=this.h)?void 0:s.vt())||1e4,l=(null==(n=this.h)?void 0:n.bt())||3e5,a=(null==(r=this.h)?void 0:r.gt())||3;this.We.connect({mite:t,Wi:e,auth:this.Gi||void 0,kn:{yn:o,$n:l,Rn:a}})}Sn(){this.Qi&&(i.info("Real-time connection already exists, closing before starting new subscription"),this.Cn()),this.wn()}wn(t){let e=this.bn();if(e){this.Oi&&i.info(`Using custom real-time messaging host: ${this.Oi}`);try{let s=new EventSource(e);s.onopen=()=>{t?(i.info("Gapless reconnection: new connection established, closing old connection"),t.close()):i.info("Real-time messaging connection established"),this.Qi=s,this.Vi=0,this.we=null,this._i=!0,this.Ne=!0},s.addEventListener("msg",t=>{this.Mn(t.data)}),s.onerror=()=>{let e=s.readyState;return this.Re||(0===e?i.info("Real-time messaging failed to connect"):i.info("Real-time messaging connection lost")),t&&this.Qi!==s?(i.info("Gapless reconnection failed, keeping old connection"),s.close(),void(this._i&&this.Vi<this.Xi&&this.xn())):(this.Cn(),this.Ne&&(this.Te++,this.Te>1)?(i.info("Real-time messaging connection lost twice after successful connect (likely multi-tab conflict), yielding to other tab"),void(this._i=!1)):void(this._i&&this.Vi<this.Xi?this.xn():(this.Vi>=this.Xi&&i.error(`Max retry attempts (${this.Xi}) reached for real-time messaging, giving up for current session`),this._i=!1)))}}catch(t){i.error(`Failed to create real-time messaging connection: ${t instanceof Error?t.message:String(t)}`)}}}xn(){var t,e,s;this.Vi++;let n=(null==(t=this.h)?void 0:t.vt())||1e4,r=(null==(e=this.h)?void 0:e.gt())||3,o=(null==(s=this.h)?void 0:s.bt())||3e5,l=this.we;(null==l||l<n)&&(l=n);let a=Math.min(o,tL(n,l*r));this.we=a,i.info(`Retrying real-time messaging connection in ${a}ms (attempt ${this.Vi}/${this.Xi})`),this.Yi=window.setTimeout(()=>{this.Yi=null,this.en()},a)}an(){if(this.un()){if(this.gn())return i.info("Auth token expired during gapless reconnection, falling back to regular reconnection"),this.sn(),void this.en();null!==this.Zi&&(window.clearTimeout(this.Zi),this.Zi=null),this.wn(this.Qi||void 0)}else i.error("Cannot perform gapless reconnection without configuration")}sn(){var t;switch(this.Fe){case"sharedworker":null==(t=this.We)||t.disconnect();break;case"direct":this.Cn()}}Cn(){null!==this.Yi&&(window.clearTimeout(this.Yi),this.Yi=null),null!==this.Zi&&(window.clearTimeout(this.Zi),this.Zi=null),this.Qi&&(this.Qi.close(),this.Qi=null,i.info("Real-time messaging connection closed"))}Mn(t){try{let e=JSON.parse(t);this.Ge(e)}catch(t){i.warn(`Failed to parse real-time message: ${t instanceof Error?t.message:String(t)}`)}}changeUser(t=!1){this.sn(),t||(this.un()&&i.info("Clearing cached real-time messaging configuration for user change"),this.Ye()),this.qe()}clearData(t=!1){this._i=!1,this.sn(),t&&(this.un()&&i.info("Clearing cached real-time messaging configuration (wipeData)"),this.Ye()),this.qe()}destroy(){this._i=!1,this.sn(),this.Ye(),this.We&&(this.We.destroy(),this.We=null),this.xe&&(this.dn("ddr",this.xe),this.xe=null),this.De&&(this.dn("ttl",this.De),this.De=null),this.ye&&(window.removeEventListener("beforeunload",this.ye),this.ye=null),this.Se&&(window.removeEventListener("pagehide",this.Se),this.Se=null),this.ke&&(window.removeEventListener("pageshow",this.ke),this.ke=null),this.T&&(ey.removeSubscription(this.T),this.T=null)}}let ed={i:!1,provider:null,o:()=>
1{if(ed.t(),!ed.provider){let t=ey.er("dustHost");ed.provider=new ec(ey.m(),ey.p(),ey.l(),t),ey.v(ed.provider),ed.provider.Hr()}return ed.provider},t:()=>{ed.i||(ey.g(ed),ed.i=!0)},destroy:()=>{ed.provider&&ed.provider.destroy(),ed.provider=null,ed.i=!1}};class eg{constructor(t,e,i,s,n){this.endpoint=t,this.Wu=e,this.publicKey=i,this.zc=s,this.rc=n,this.endpoint=t||null,this.Wu=e||null,this.publicKey=i||null,this.zc=s||null,this.rc=n||null}qt(){return{e:this.endpoint,c:this.Wu,p:this.publicKey,u:this.zc,v:this.rc}}static _u(t){return new eg(t.e,g(t.c),t.p,t.u,t.v)}}t.s(["default",0,eg],58176);class ef{constructor(t,e){this.h=t,this.C=e,this.h=t,this.C=e}getUserId(){let t=this.C.$u(Q.Ou.Cu);if(null==t)return null;let e=t.Tu,i=T(e);if(i>W.br){for(;i>W.br;)i=T(e=e.slice(0,e.length-1));t.Tu=e,this.C.Iu(Q.Ou.Cu,t)}return e}Ju(t){let e=null==this.getUserId();this.C.Iu(Q.Ou.Cu,new S(t)),e&&this.C.Lu(t)}setCustomUserAttribute(t,e){if(this.h.qu(t))return i.info('Custom Attribute "'+t+'" is blocklisted, ignoring.'),!1;let s={};return s[t]=e,this.zu(W.Bu,s,!0)}zu(t,e,s=!1,n=!1){let r=this.C.Eu(this.getUserId(),t,e),o="",l=t,a=e;return s&&(o=" custom","object"==typeof e&&(l=Object.keys(e)[0],"object"==typeof(a=e[l])&&(a=JSON.stringify(a,null,2)))),!n&&r&&i.info(`Logged${o} attribute ${l} with value ${a}`),r}gu(t,e,s,n,r){this.zu("push_token",t,!1,!0),this.zu("custom_push_public_key",s,!1,!0),this.zu("custom_push_user_auth",n,!1,!0),this.zu("custom_push_vapid_public_key",r,!1,!0);let o=ti.Ps.$s,l=new ti(o,i),a=new eg(t,e,s,n,r);this.C.It(Q.Tt.Uu,a.qt()),l.setItem(o.Os.Fu,o.be,!0)}wu(t){if(this.zu("push_token",null,!1,!0),this.zu("custom_push_public_key",null,!1,!0),this.zu("custom_push_user_auth",null,!1,!0),this.zu("custom_push_vapid_public_key",null,!1,!0),t){let t=ti.Ps.$s,e=new ti(t,i);this.C.It(Q.Tt.Uu,!1),e.setItem(t.Os.Fu,t.be,!1)}}}function ep(t){null==t&&(t="");let e=t.split("?").slice(1).join("?"),i={};if(null!=e){let t=e.split("&");for(let e=0;e<t.length;e++){let s=t[e].split("=");""!==s[0]&&(i[s[0]]=s[1])}}return i}t.s(["isURIJavascriptOrData",0,function(t){return!(!t||0!==(t=t.toString().toLowerCase()).lastIndexOf("javascript:",0)&&0!==t.lastIndexOf("data:",0))},"parseQueryStringKeyValues",0,ep],19390);let em={PORTRAIT:0,LANDSCAPE:1},eb={openUri:function(t,e,i){t&&(e||null!=i&&i.metaKey?window.open(t):window.location=t)},da:function(){return screen.width<=600},ga:function(){if("orientation"in window)return 90===Math.abs(window.orientation)||270===window.orientation?em.LANDSCAPE:em.PORTRAIT;let t=window;if("screen"in t){let e=t.screen.orientation||screen.mozOrientation||screen.msOrientation;return null!=e&&"object"==typeof e&&(e=e.type),"landscape-primary"===e||"landscape-secondary"===e?em.LANDSCAPE:em.PORTRAIT}return em.PORTRAIT},Qh:function(){return window.location.href}};t.s(["ORIENTATION",0,em,"WindowUtils",0,eb],22557);let ev={_h:"allowCrawlerActivity",Nh:"baseUrl",se:"cookieExpiryInDays",Oh:"noCookies",Th:"devicePropertyAllowlist",ka:"disablePushTokenMaintenance",Rh:"enableLogging",Ph:"enableSdkAuthentication",_a:"manageServiceWorkerExternally",Dh:"minimumIntervalBetweenTriggerActionsInSeconds",Lh:"sessionTimeoutInSeconds",yh:"appVersion",Mh:"appVersionNumber",xa:"serviceWorkerLocation",Ma:"safariWebsitePushId",qa:"localization",sr:"contentSecurityNonce",nr:"allowUserSuppliedJavascript",ja:"inAppMessageZIndex",ba:"openInAppMessagesInNewTab",oh:"requireExplicitInAppMessageDismissal",Uh:"doNotLoadFontAwesome",Wh:"deviceId",ya:"serviceWorkerScope",Qe:"dustHost",Bh:"sdkFlavor",tn:"openCardsInNewTab"},eS={_h:"allowCrawlerActivity",Nh:"baseUrl",se:"cookieExpiryInDays",Oh:"noCookies",Th:"devicePropertyAllowlist",ka:"disablePushTokenMaintenance",Rh:"enableLogging",Ph:"enableSdkAuthentication",_a:"manageServiceWorkerExternally",Dh:"minimumIntervalBetweenTriggerActionsInSeconds",Lh:"sessionTimeoutInSeconds",yh:"appVersion",Mh:"appVersionNumber",xa:"serviceWorkerLocation",Ma:"safariWebsitePushId",qa:"localization",sr:"contentSecurityNonce",nr:"allowUserSuppliedJavascript",ja:"inAppMessageZIndex",ba:"openInAppMessagesInNewTab",tn:"openCardsInNewTab",oh:"requireExplicitInAppMessageDismissal",Uh:"doNotLoadFontAwesome",Wh:"deviceId",ya:"serviceWorker
1Scope",Qe:"dustHost",Bh:"sdkFlavor"},ey=new class{constructor(){this.tu="",this.Vh="",this.Kh=void 0,this.Gh=null,this.eu=null,this.B=null,this.Ru=null,this.h=null,this.j=null,this.C=null,this.Ss=null,this.Yh="",this.isInitialized=!1,this.$h=!1,this.qh=new te,this.Hh=new te,this.options={},this.Jh=[],this.Xh=[],this.In=[],this.Vh="6.7.1"}Zh(t){this.qh.Kt(t)}uh(t){this.Hh.Kt(t)}initialize(e,o){var l,u,h;if(this.ao())return i.info("Braze has already been initialized with an API key."),!0;this.options=o||{};let c=this.er(eS.Rh),d=ep(eb.Qh());if(d&&"true"===d.brazeLogging&&(c=!0),i.init(c),i.info(`Initialization Options: ${JSON.stringify(this.options,null,2)}`),null==e||""===e||"string"!=typeof e)return i.error("Braze requires a valid API key to be initialized."),!1;this.tu=e;let g=this.er(eS.Nh);if(null==g||""===g||"string"!=typeof g)return i.error("Braze requires a valid baseUrl to be initialized."),!1;!1===/^https?:/.test(g)&&(g=`https://${g}`);let f=g;if((g=document.createElement("a")).href=f,"/"===g.pathname&&(g=`${g}api/v3`),this.Yh=g.toString(),X.il&&!this.er(eS._h))return i.info("Ignoring activity from crawler bot "+navigator.userAgent),this.$h=!0,!1;let p=this.er(eS.Oh)||!1,m=this.er(eS.se),b=t$.sl();if(this.C=t$.rl(e,p,m),p&&this.C.hl(e),new tt.le(null,!0).wr(Q.ce))return i.info("Ignoring all activity due to previous opt out"),this.$h=!0,!1;for(let t of a(this.options))-1===s(ev).indexOf(t)&&i.warn(`Ignoring unknown initialization option '${t}'.`);if(null!=this.er(eS.Bh)){let t=this.er(eS.Bh);-1!==["mparticle","wordpress","tealium"].indexOf(t)?this.Kh=t:i.error("Invalid sdk flavor passed: "+t)}let v=this.er(ev.Th);if(null!=v)if(r(v)){let t=[];for(let e=0;e<v.length;e++)n(to,v[e],"devicePropertyAllowlist contained an invalid value.","DeviceProperties")&&t.push(v[e]);v=t}else i.error("devicePropertyAllowlist must be an array. Defaulting to all properties."),v=null;let y=this.er(eS.Wh);if(y){let t=new S(y);this.C.Iu(Q.Ou.Wh,t)}this.eu=new tl(this.C,v),this.h=new tU(this.C),this.Ss=new ef(this.h,this.C),this.j=new tM(this.C,this.Ss,this.h,this.er(eS.Lh));let T=new te;this.Gh=new ts(this.C,this.er(eS.Ph),T),this.S(T),this.B=new tm(this.eu,this.C,this.Gh,this.Ss,this.j,this.h,this.tu,this.Yh,this.Vh,this.Kh||"",this.er(eS.yh),this.er(eS.Mh)),this.Ru=new tD(this.tu,this.Yh,this.j,this.eu,this.Ss,this.h,this.C,t=>{if(this.ao())for(let e of this.vr())e.I(t)},this.Gh,this.B),this.Ru.initialize(),p||this.C.ll(),i.info(`Initialized for the Braze backend at "${this.er(eS.Nh)}" with API key "${this.tu}".`),ea.t(),function(){let t=ey.l(),e=ey.nn();if(!t||!e)return;let i=ed.o(),s=()=>
1{if(!i.Lt()){i.ln();let s=e.rn(()=>{t.fn()&&i.mn()});return s&&i.$t(s),i.un()&&i.en(),s}return i.Lt()};t.Tr(()=>{ey.ao()&&(t.fn()?(i.mn(),s()):(i.sn(),i.un()&&i.Ye()))}),t.fn()&&s()}(),this.h.bo(()=>{var e;this.isInitialized&&(null==(e=this.h)?void 0:e.lo())&&t.A(41090).then(t=>{this.isInitialized&&(0,t.default)()})}),this.Ru.rn(()=>{var e;this.isInitialized&&(null==(e=this.h)?void 0:e.lo())&&t.A(41090).then(t=>{this.isInitialized&&(0,t.default)(void 0,void 0,!0)})}),this.qh.A(this.options),this.isInitialized=!0,window.dispatchEvent(new CustomEvent("braze.initialized"));let w=null==(l=this.j)?void 0:l.al();return b||null==w||(null==(u=this.j)?void 0:u.ul(new Date().valueOf(),w))||null==(h=this.Ru)||h.Sr(),!0}destroy(t){if(i.destroy(),this.ao()){for(let t of(this.Hh.A(),this.Hh.removeAllSubscriptions(),this.Jh))t.destroy();for(let t of(this.Jh=[],this.Xh))t.clearData(!1);this.B&&this.B.fo(),this.Xh=[],this.removeAllSubscriptions(),this.In=[],null!=this.Ru&&this.Ru.destroy(),this.Ru=null,this.Gh=null,this.eu=null,this.B=null,this.h=null,this.j=null,this.Ss=null,this.options={},this.Kh=void 0,this.isInitialized=!1,this.$h=!1,t&&(this.C=null)}}rr(){return!this.cl()&&(!!this.ao()||(console.warn(R.ee),!1))}za(){return this.tu}Br(){return this.Gh}ht(){return this.Yh}ue(){return this.eu}m(){return this.B}er(t){return this.options[t]}vr(){return this.Xh}nn(){return this.Ru}l(){return this.h}u(){return this.j}p(){return this.C}zr(){if(this.Ss&&this.Ru)return new W(this.Ss,this.Ru)}ir(){return this.Ss}ar(){return!0===this.er(eS.nr)}g(t){let e=!1;for(let i of this.Jh)i===t&&(e=!0);e||this.Jh.push(t)}v(t){let e=!1;for(let i of this.Xh)i.constructor===t.constructor&&(e=!0);t instanceof tn&&!e&&this.Xh.push(t)}S(t){t instanceof te&&this.In.push(t)}removeAllSubscriptions(){if(this.rr())for(let t of this.In)t.removeAllSubscriptions()}removeSubscription(t){if(this.rr())for(let e of this.In)e.removeSubscription(t)}fe(t){this.$h=t}ao(){return this.isInitialized}cl(){return this.$h}dr(t,e){return this.rr()?ed.o().Ze(t,e):null}zi(){return this.Vh}}}]);
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.