1(function(){try{var e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{};e.SENTRY_RELEASE={id:`cbc5ad3ab83f05f6c43712364d1fa42567e54452`};var t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]=`7411cd6b-3633-470d-87b3-a040b5c94433`,e._sentryDebugIdIdentifier=`sentry-dbid-7411cd6b-3633-470d-87b3-a040b5c94433`)}catch{}})();import{r as e}from"./@amplitude/plugin-session-replay-browser-D88gPvAm.js";var t={init:function(e){e===void 0&&t.zg!==void 0||(t.zg=!!e),t.i||=!0},destroy:function(){t.i=!1,t.zg=void 0,t.vd=void 0},setLogger:function(e){typeof e==`function`?(t.init(),t.vd=e):t.info(`Ignoring setLogger call since logger is not a function`)},toggleLogging:function(){t.init(),t.zg?(console.log(`Disabling Braze logging`),t.zg=!1):(console.log(`Enabled Braze logging`),t.zg=!0)},info:function(e){if(t.zg){let n=`Braze: `+e;t.vd==null?console.log(n):t.vd(n)}},warn:function(e){if(t.zg){let n=`Braze SDK Warning: `+e+` (v6.4.0)`;t.vd==null?console.warn(n):t.vd(n)}},error:function(e){if(t.zg){let n=`Braze SDK Error: `+e+` (v6.4.0)`;t.vd==null?console.error(n):t.vd(n)}}},n={CustomEvent:`ce`,Pr:`p`,Ic:`pc`,Jc:`ca`,Hu:`i`,ju:`ie`,Ut:`cci`,Wt:`ccic`,Ht:`ccc`,Mt:`ccd`,sm:`ss`,Jl:`se`,Jr:`si`,Kr:`sc`,Lr:`sbc`,Kc:`sfe`,Mo:`iec`,Fc:`lr`,Rc:`uae`,Nc:`lcaa`,xc:`lcar`,vu:`inc`,Nu:`add`,yu:`rem`,fu:`set`,gu:`ncam`,Oc:`sgu`,Ir:`ffi`,ro:`bi`,ot:`bc`},r={oe:function(){if(typeof window<`u`&&window.crypto){if(typeof window.crypto.randomUUID==`function`)return window.crypto.randomUUID();if(typeof window.crypto.getRandomValues==`function`)try{let e=new Uint8Array(16);window.crypto.getRandomValues(e),e[6]=15&e[6]|64,e[8]=63&e[8]|128;let t=Array.from(e,e=>(`0`+e.toString(16)).slice(-2));return[t.slice(0,4).join(``),t.slice(4,6).join(``),t.slice(6,8).join(``),t.slice(8,10).join(``),t.slice(10,16).join(``)].join(`-`)}catch{}}let e=(e=!1)=>{let t=(Math.random().toString(16)+`000000000`).substr(2,8);return e?`-`+t.substr(0,4)+`-`+t.substr(4,4):t};return e()+e(!0)+e(!0)+e()}},i=class{constructor(e,t){this.database=e,this.vd=t,this.parent=typeof window>`u`?self:window,this.database=e,this.vd=t}Dd(){if(`indexedDB`in this.parent)return this.parent.indexedDB}isSupported(){try{if(this.Dd()==null)return!1;{let e=this.Dd()?.open(`Braze IndexedDB Support Test`);if(e&&(e.onupgradeneeded=()=>e.result.close(),e.onsuccess=()=>e.result.close()),typeof window<`u`){let e=window,t=e.chrome||e.browser||e.pd;if(t&&t.runtime&&t.runtime.id)return this.vd.info(`Not using IndexedDB for storage because we are running inside an extension`),!1}return!0}}catch(e){return this.vd.info(`Not using IndexedDB for storage due to following error: `+e),!1}}Bd(e,t){let n=this.Dd()?.open(this.database.Sd,this.database.VERSION);if(n==null)return typeof t==`function`&&t(),!1;let r=this;return n.onupgradeneeded=e=>{r.vd.info(`Upgrading indexedDB `+r.database.Sd+` to v`+r.database.VERSION+`...`);let t=e.target?.result;for(let e in r.database.Fs){let n=e;r.database.Fs.hasOwnProperty(e)&&!t.objectStoreNames.contains(r.database.Fs[n])&&t.createObjectStore(r.database.Fs[n])}},n.onsuccess=n=>{let i=n.target?.result;i.onversionchange=()=>{i.close(),typeof t==`function`&&t(),r.vd.error(`Needed to close the database unexpectedly because of an upgrade in another tab`)},e(i)},n.onerror=e=>{let n=e;return r.vd.info(`Could not open indexedDB `+r.database.Sd+` v`+r.database.VERSION+`: `+n.target?.errorCode),typeof t==`function`&&t(),!0},!0}setItem(e,t,n,r,i){if(!this.isSupported())return typeof i==`function`&&i(),!1;let a=this;return this.Bd(o=>{if(!o.objectStoreNames.contains(e))return a.vd.error(`Could not store object `+t+` in `+e+` on indexedDB `+a.database.Sd+` - `+e+` is not a valid objectStore`),typeof i==`function`&&i(),void o.close();let s=o.transaction([e],`readwrite`);s.oncomplete=()=>o.close();let c=s.objectStore(e).put(n,t);c.onerror=()=>{a.vd.error(`Could not store object `+t+` in `+e+` on indexedDB `+a.database.Sd),typeof i==`function`&&i()},c.onsuccess=()=>{typeof r==`function`&&r()}},i)}getItem(e,t,n){if(!this.isSupported())return!1;let r=this;return this.Bd(i=>{if(!i.objectStoreNames.contains(e))return r.vd.error(`Could not retrieve object `+t+` in `+e+` on indexedDB `+r.database.Sd+` - `+e+` is not a valid objectStore`),void i.close();let a=i.transaction([e],`readonly`);a.oncomplete=()=>i.close();let o=a.objectStore(e).get(t);o.onerror=()=>{r.vd.error(`Could not retrieve object `+t+` in `+e+` on indexedDB `+r.database.Sd)},o.onsuccess=e=>{let t=e.target?.result;t!=null&&n(t)}})}kr(e,t,n){if(!this.isSupported())return typeof n==`function`&&n(),!1;let r=this;return this.Bd(i=>{if(!i.objectStoreNames.contains(e))return r.vd.error(`Could not retrieve last record from `+e+` on indexedDB `+r.database.Sd+` - `+e+` is not a valid objectStore`),typeof n==`function`&&n(),void i.close();let a=i.transaction([e],`readonly`);a.oncomplete=()=>i.close();let o=a.objectStore(e).openCursor(null,`prev`);o.onerror=()=>{r.vd.error(`Could not open cursor for `+e+` on indexedDB `+r.database.Sd),typeof n==`function`&&n()},o.onsuccess=e=>{let r=e.target?.result;r!=null&&r.value!=null&&r.key!=null?t(r.key,r.value):typeof n==`function`&&n()}},n)}be(e,t){if(!this.isSupported())return!1;let n=this;return this.Bd(r=>{if(!r.objectStoreNames.contains(e))return n.vd.error(`Could not delete record `+t+` from `+e+` on indexedDB `+n.database.Sd+` - `+e+` is not a valid objectStore`),void r.close();let i=r.transaction([e],`readwrite`);i.oncomplete=()=>r.close(),i.objectStore(e).delete(t).onerror=()=>{n.vd.error(`Could not delete record `+t+` from `+e+` on indexedDB `+n.database.Sd)}})}Ds(e,t){if(!this.isSupported())return!1;let n=this;return this.Bd(r=>{if(!r.objectStoreNames.contains(e))return n.vd.error(`Could not retrieve objects from `+e+` on indexedDB `+n.database.Sd+` - `+e+` is not a valid objectStore`),void r.close();let i=r.transaction([e],`readwrite`);i.oncomplete=()=>r.close();let a=i.objectStore(e),o=a.openCursor(),s=[];o.onerror=()=>{s.length>0?(n.vd.info(`Cursor closed midway through for `+e+` on indexedDB `+n.database.Sd),t(s)):n.vd.error(`Could not open cursor for `+e+` on indexedDB `+n.database.Sd)},o.onsuccess=e=>{let n=e.target?.result;n==null?s.length>0&&t(s):(n.value!=null&&n.key!=null&&(a.delete(n.key).onsuccess=()=>{s.push(n.value)}),typeof n.continue==`function`&&n.continue())}})}clearData(){if(!this.isSupported())return!1;let e=[];for(let t in this.database.Fs){let n=t;this.database.Fs.hasOwnProperty(t)&&this.database.Fs[n]!==this.database.Fs.le&&e.push(this.database.Fs[n])}let t=this;return this.Bd(function(n){let r=n.transaction(e,`readwrite`);r.oncomplete=()=>n.close();for(let n=0;n<e.length;n++){let i=e[n];r.objectStore(i).clear().onerror=function(){t.vd.error(`Could not clear `+this.source.name+` on indexedDB `+t.database.Sd)}}r.onerror=function(){t.vd.error(`Could not clear object stores on indexedDB `+t.database.Sd)}})}};i.Us={Rs:{Sd:`AppboyServiceWorkerAsyncStorage`,VERSION:6,Fs:{Yi:`data`,vr:`pushClicks`,cu:`pushSubscribed`,Cd:`fallbackDevice`,As:`cardUpdates`,le:`optOut`,zr:`pendingData`,qh:`sdkAuthenticationSignature`},me:1}};var a={Ph:`allowCrawlerActivity`,Wh:`baseUrl`,Vh:`noCookies`,Kh:`devicePropertyAllowlist`,Da:`disablePushTokenMaintenance`,$h:`enableLogging`,Yh:`enableSdkAuthentication`,Ca:`manageServiceWorkerExternally`,Xh:`minimumIntervalBetweenTriggerActionsInSeconds`,Zh:`sessionTimeoutInSeconds`,Qh:`appVersion`,Ia:`appVersionNumber`,_a:`serviceWorkerLocation`,Ba:`safariWebsitePushId`,Ea:`localization`,er:`contentSecurityNonce`,re:`allowUserSuppliedJavascript`,Jo:`inAppMessageZIndex`,To:`openInAppMessagesInNewTab`,Oh:`requireExplicitInAppMessageDismissal`,Na:`doNotLoadFontAwesome`,Oa:`deviceId`,Aa:`serviceWorker
1Scope`,zi:`dustHost`,Ta:`sdkFlavor`,tn:`openCardsInNewTab`};function o(e){let t=[],n;for(let r in e)n=r,Object.prototype.hasOwnProperty.call(e,n)&&e[n]!==void 0&&t.push(e[n]);return t}function s(e,n,r,i){let a=o(e);return a.indexOf(n)!==-1||(t.error(`${r} Valid values from ${i} are "${a.join(`"/"`)}".`),!1)}function c(e){return Array.isArray?Array.isArray(e):Object.prototype.toString.call(e)===`[object Array]`}function l(e){return Object.prototype.toString.call(e)===`[object Date]`}function u(e){return Object.prototype.toString.call(e)===`[object Object]`}function d(e){let t=[];for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t}function f(e,t){if(e===t)return e!==0||1/e==1/t;if(e==null||t==null)return e===t;let n=e.toString();if(n!==t.toString())return!1;switch(n){case`[object RegExp]`:case`[object String]`:return``+e==``+t;case`[object Number]`:return+e==+e?+e==0?1/e==1/t:+e==+t:+t!=+t;case`[object Date]`:case`[object Boolean]`:return+e==+t}let r=n===`[object Array]`;if(!r){if(typeof e!=`object`||typeof t!=`object`)return!1;let n=e.constructor,r=t.constructor;if(n!==r&&!(typeof n==`function`&&n instanceof n&&typeof r==`function`&&r instanceof r)&&`constructor`in e&&`constructor`in t)return!1}let i=[],a=[],o=i.length;for(;o--;)if(i[o]===e)return a[o]===t;if(i.push(e),a.push(t),r){if(o=e.length,o!==t.length)return!1;for(;o--;)if(!f(e[o],t[o]))return!1}else{let n=d(e),r;if(o=n.length,d(t).length!==o)return!1;for(;o--;)if(r=n[o],!Object.prototype.hasOwnProperty.call(t,r)||!f(e[r],t[r]))return!1}return i.pop(),a.pop(),!0}function p(e,t=!1){let n=e/1e3;return t&&(n=Math.floor(n)),n}function m(e){return 1e3*e}function h(e){if(e==null)return null;let t=parseInt(e.toString());return isNaN(t)?null:new Date(1e3*t)}function g(e){return e!=null&&l(e)?e.toISOString().replace(/\.[0-9]{3}Z$/,``):e}function _(e){return e==null||e===``?null:new Date(e)}function v(e){return e==null||e===``?new Date().valueOf():e}function y(e){return(new Date().valueOf()-e.valueOf())/1e3}function b(e){return(e.valueOf()-new Date().valueOf())/1e3}var x=`inAppMessage must be an InAppMessage object`,S=`logCustomEvent`,C=`setCustomUserAttribute`,w=`Braze must be initialized before calling methods.`,T=72e5,E=`ab-pause-scrolling`,D=class{constructor(){this.Mr={}}wt(e){if(typeof e!=`function`)return null;let t=r.oe();return this.Mr[t]=e,t}removeSubscription(e){delete this.Mr[e]}removeAllSubscriptions(){this.Mr={}}he(){return Object.keys(this.Mr).length}L(e){let t=[];for(let n in this.Mr){let r=this.Mr[n];t.push(r(e))}return t}};function ee(e){let t=e?.lt(z.ct.uE),n;return t&&(n={label:t.l,name:t.a}),n}var O=class e{constructor(e,t,n,r,i){this.userId=e,this.type=t,this.time=n,this.sessionId=r,this.data=i,this.userId=e,this.type=t,this.time=v(n),this.sessionId=r,this.data=i}pn(){let e={name:this.type,time:p(this.time),data:this.data||{},session_id:this.sessionId};this.userId!=null&&(e.user_id=this.userId);let t=Q.Sr()?.wh()||!1;if(!e.user_id&&!t){let t=ee(Q.p());t&&(e.alias=t)}return e}dt(){return{u:this.userId,t:this.type,ts:this.time,s:this.sessionId,d:this.data}}static fromJson(t){return new e(t.user_id,t.name,t.time,t.session_id,t.data)}static gE(e){return e!=null&&u(e)&&e.t!=null&&e.t!==``}static Vo(t){return new e(t.u,t.t,t.ts,t.s,t.d)}},k=e=>e instanceof Error?e.message:String(e),A=class e{constructor(e,t,n){this.eu=e,e??=r.oe(),!n||isNaN(n)?this.Ol=new Date().valueOf():this.Ol=n,this.eu=e,this.Zl=new Date().valueOf(),this.Yl=t}dt(){return`g:${encodeURIComponent(this.eu)}|e:${this.Yl}|c:${this.Ol}|l:${this.Zl}`}static AE(e){if(typeof e!=`string`)return null;let t=e.lastIndexOf(`|e:`),n=e.substring(0,t),r=n.split(`g:`)[1],i;return i=/[|:]/.test(r)?encodeURIComponent(r):r,e=e.replace(n,`g:${i}`)}static Vo(n){let r;if(typeof n==`string`)try{let t=n.split(`|`);if(!c(t)||t.length!==4)return null;let i=e=>e.split(`:`)[1],a=e=>{let t=parseInt(i(e));if(!isNaN(t))return t};r=new e(decodeURIComponent(i(t[0])),a(t[1]),a(t[2])),r.Zl=a(t[3])}catch(e){t.info(`Unable to parse cookie string ${n}, failed with error: ${k(e)}`)}else{if(n==null||n.g==null)return null;r=new e(n.g,n.e,n.c),r.Zl=n.l}return r}};function j(e){let t=e.length;for(let n=e.length-1;n>=0;n--){let r=e.charCodeAt(n);r>127&&r<=2047?t++:r>2047&&r<=65535&&(t+=2),r>=56320&&r<=57343&&n--}return t}function te(e){try{e=e.replace(/-/g,`+`).replace(/_/g,`/`);let t=window.atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);let r=new Uint16Array(n.buffer);return String.fromCharCode(...r)}catch(e){return t.error(`Unable to decode Base64: `+e),null}}var M={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`}},ne={Zr:`unknownBrazeAction`,Zc:`noPushPrompt`},re=(e,t)=>
1e===ne.Zr?`${t} contains an unknown braze action type and will not be displayed.`:``;function ie(e){try{let n=e.match(fe),r=n?n[0].length:null,i=r?e.substring(r):null;if(r==null||r>e.length-1||!i)return void t.error(`Did not find base64 encoded brazeAction in url to process : ${e}`);let a=te(i);return a?JSON.parse(a):void t.error(`Failed to decode base64 encoded brazeAction: ${i}`)}catch(n){t.error(`Failed to process brazeAction URL ${e} : ${k(n)}`);return}}function ae(e,t){let n=!1;if(t){for(let r of t)if(n||=e(r),n)return!0}return!1}function oe(e){let t=M.properties.type,n=M.properties.eo;try{if(e==null)return!0;let r=e[t];return r===M.types.io?ae(oe,e[n]):!xe(r)}catch{return!0}}function se(e){if(!e||!be(e))return!1;let t=M.properties.type,n=M.properties.eo,r=e[t];return r===M.types.io?ae(se,e[n]):r===M.types.requestPushPermission}var ce=/^[^\x00-\x1F\x22]+$/,le=/[$.]/,ue=[`$add`,`$update`,`$remove`,`$identifier_key`,`$identifier_value`,`$new_object`,`$time`,`$google_ad_personalization`,`$google_ad_user_data`],de=/^[^@\s]+@[^@\s]+\.[^@\s]+$/,fe=/^brazeActions:\/\/v\d+\//;function N(e,n,r){let i=e!=null&&typeof e==`string`&&(e===``||e.match(ce)!=null);return i||t.error(`Cannot ${n} because ${r} "${e}" is invalid.`),i}function pe(e){return e!=null&&e.match(le)&&ue.indexOf(e)===-1&&t.warn(`Custom attribute keys cannot contain '$' or '.'`),N(e,`set custom user attribute`,`the given key`)}function me(e){let t=typeof e;return e==null||t===`number`||t===`boolean`||l(e)||t===`string`}function he(e,n,r){let i=r!==-1;if(i&&r>50)return t.error(`Nested attributes cannot be more than 50 levels deep.`),!1;let a=i?r+1:-1;if(c(e)&&c(n)){for(let t=0;t<e.length&&t<n.length;t++)if(l(e[t])&&(n[t]=g(e[t])),!he(e[t],n[t],a))return!1}else{if(!u(e))return me(e);for(let t of d(e)){let r=e[t];if(i&&!pe(t)||(l(r)&&(n[t]=g(r)),!he(r,n[t],a)))return!1}}return!0}function ge(e,n,r,i,a){let o;return o=u(e)||c(e)?he(e,n,a?1:-1):me(e),o||t.error(`Cannot ${r} because ${i} "${e}" is invalid.`),o}function P(e,n,r,i=!1){let a=typeof e==`string`||e===null&&i;return a||t.error(`Cannot ${n} because ${r} "${e}" is invalid.`),a}function _e(e,n,r,i,a){if(e??={},typeof e!=`object`||c(e))return t.error(`${n} requires that ${r} be an object. Ignoring ${a}.`),[!1,null];let o,s;n===`setCustomUserAttribute`?(o=76800,s=`75KB`):(o=51200,s=`50KB`);let u=JSON.stringify(e);if(j(u)>o)return t.error(`Could not ${i} because ${r} was greater than the max size of ${s}.`),[!1,null];let d;try{d=JSON.parse(u)}catch{return t.error(`Could not ${i} because ${r} did not contain valid JSON.`),[!1,null]}for(let t in e){if(n===`setCustomUserAttribute`&&!pe(t)||!N(t,i,`the ${a} property name`))return[!1,null];let r=e[t];if(n!==`setCustomUserAttribute`&&r==null){delete e[t],delete d[t];continue}if(l(r)&&(d[t]=g(r)),!ge(r,d[t],i,`the ${a} property "${t}"`,n===`setCustomUserAttribute`))return[!1,null]}return[!0,d]}function ve(e,n){let r=!1,i=!1,a=()=>{t.error(`Custom attribute arrays must be either string arrays or object arrays.`)};for(let t of n)if(typeof t==`string`){if(i)return a(),[!1,!1];if(!N(t,`set custom user attribute "${e}"`,`the element in the given array`))return[!1,!1];r=!0}else{if(!u(t)||r)return a(),[!1,!1];if(!_e(t,`setCustomUserAttribute`,`attribute value`,`set custom user attribute "${e}"`,`custom user attribute`))return[!1,!1];i=!0}return[r,i]}function ye(e){if(typeof e!=`string`)return!1;let t=e.length;return!(t===0||t>256)&&de.test(e.toLowerCase())}function be(e){if(!(M.properties.type in e))return!1;switch(e[M.properties.type]){case M.types.io:if(M.properties.eo in e)return!0;break;case M.types.logCustomEvent:case M.types.setEmailNotificationSubscriptionType:case M.types.setPushNotificationSubscriptionType:case M.types.setCustomUserAttribute:case M.types.addToSubscriptionGroup:case M.types.removeFromSubscriptionGroup:case M.types.addToCustomAttributeArray:case M.types.removeFromCustomAttributeArray:case M.types.mo:case M.types.uo:if(M.properties.so in e)return!0;break;case M.types.requestPushPermission:return!0;default:return!1}return!1}function xe(e){let t=!1;
1return Object.keys(M.types).forEach(n=>{M.types[n]!==e.toString()||(t=!0)}),t}var F=class e{constructor(e,t){this.Cs=e,this.au=t,this.Cs=e,this.au=t}getUserId(e){let n=this.Cs.getUserId();if(typeof e!=`function`)return n;t.warn("The callback for getUserId is deprecated. You can access its return value directly instead (e.g. `const id = braze.getUser().getUserId()`)"),e(n)}addAlias(e,n){return!P(e,`add alias`,`the alias`,!1)||e.length<=0?(t.error(`addAlias requires a non-empty alias`),!1):!P(n,`add alias`,`the label`,!1)||n.length<=0?(t.error(`addAlias requires a non-empty label`),!1):this.au.du(e,n).W}setFirstName(e){return!!P(e,`set first name`,`the firstName`,!0)&&this.Cs.nu(`first_name`,e)}setLastName(e){return!!P(e,`set last name`,`the lastName`,!0)&&this.Cs.nu(`last_name`,e)}setEmail(e){return e===null||ye(e)?this.Cs.nu(`email`,e):(t.error(`Cannot set email address - "${e}" did not pass RFC-5322 validation.`),!1)}setGender(t){return typeof t==`string`&&(t=t.toLowerCase()),!(t!==null&&!s(e.Genders,t,`Gender "${t}" is not a valid gender.`,`User.Genders`))&&this.Cs.nu(`gender`,t)}setDateOfBirth(e,n,r){return e===null&&n===null&&r===null?this.Cs.nu(`dob`,null):(e=e==null?null:parseInt(e.toString()),n=n==null?null:parseInt(n.toString()),r=r==null?null:parseInt(r.toString()),e==null||n==null||r==null||isNaN(e)||isNaN(n)||isNaN(r)||n>12||n<1||r>31||r<1?(t.error(`Cannot set date of birth - parameters should comprise a valid date e.g. setDateOfBirth(1776, 7, 4);`),!1):this.Cs.nu(`dob`,`${e}-${n}-${r}`))}setCountry(e){return!!P(e,`set country`,`the country`,!0)&&this.Cs.nu(`country`,e)}setHomeCity(e){return!!P(e,`set home city`,`the homeCity`,!0)&&this.Cs.nu(`home_city`,e)}setLanguage(e){return!!P(e,`set language`,`the language`,!0)&&this.Cs.nu(`language`,e)}setEmailNotificationSubscriptionType(t){return!!s(e.NotificationSubscriptionTypes,t,`Email notification setting "${t}" is not a valid subscription type.`,`User.NotificationSubscriptionTypes`)&&this.Cs.nu(`email_subscribe`,t)}setPushNotificationSubscriptionType(t){return!!s(e.NotificationSubscriptionTypes,t,`Push notification setting "${t}" is not a valid subscription type.`,`User.NotificationSubscriptionTypes`)&&this.Cs.nu(`push_subscribe`,t)}setPhoneNumber(n){return!!P(n,`set phone number`,`the phoneNumber`,!0)&&(n===null||n.match(e.pu)?this.Cs.nu(`phone`,n):(t.error(`Cannot set phone number - "${n}" did not pass validation.`),!1))}setLastKnownLocation(e,n,r,i,a){return e==null||n==null?(t.error(`Cannot set last-known location - latitude and longitude are required.`),!1):(e=parseFloat(e.toString()),n=parseFloat(n.toString()),r!=null&&(r=parseFloat(r.toString())),i!=null&&(i=parseFloat(i.toString())),a!=null&&(a=parseFloat(a.toString())),isNaN(e)||isNaN(n)||r!=null&&isNaN(r)||i!=null&&isNaN(i)||a!=null&&isNaN(a)?(t.error(`Cannot set last-known location - all supplied parameters must be numeric.`),!1):e>90||e<-90||n>180||n<-180?(t.error(`Cannot set last-known location - latitude and longitude are bounded by ±90 and ±180 respectively.`),!1):r!=null&&r<0||a!=null&&a<0?(t.error(`Cannot set last-known location - accuracy and altitudeAccuracy may not be negative.`),!1):this.au.setLastKnownLocation(this.Cs.getUserId(),e,n,i,r,a).W)}setCustomUserAttribute(e,t,r){if(!pe(e))return!1;let i=t=>{let[n]=_e(t,C,`attribute value`,`set custom user attribute "${e}"`,`custom user attribute`);return n};if(c(t)){let[r,a]=ve(e,t);if(!r&&!a&&t.length!==0)return!1;if(r||t.length===0)return this.au.bu(n.fu,e,t).W;for(let e of t)if(!i(e))return!1}else if(u(t)){if(!i(t))return!1;if(r)return this.au.bu(n.gu,e,t).W}else if(!(t!==void 0&&me(t))||(l(t)&&(t=g(t)),typeof t==`string`&&!N(t,`set custom user attribute "${e}"`,`the element in the given array`)))return!1;return this.Cs.setCustomUserAttribute(e,t)}addToCustomAttributeArray(e,t){return!!N(e,`add to custom user attribute array`,`the given key`)&&!(t!=null&&!N(t,`add to custom user attribute array`,`the given value`))&&this.au.bu(n.Nu,e,t).W}removeFromCustomAttributeArray(e,t){return!!N(e,`remove from custom user attribute array`,`the given key`)&&!(t!=null&&!N(t,`remove from custom user attribute array`,`the given value`))&&this.au.bu(n.yu,e,t).W}incrementCustomUserAttribute(e,r){if(!N(e,`increment custom user attribute`,`the given key`))return!1;r??=1;let i=parseInt(r.toString());return isNaN(i)||i!==parseFloat(r.toString())?(t.error(`Cannot increment custom user attribute because the given incrementValue "${r}" is not an integer.`),!1):this.au.bu(n.vu,e,i).W}setCustomLocationAttribute(e,n,r){return!!N(e,`set custom location attribute`,`the given key`)&&((n!==null||r!==null)&&(n=n==null?null:parseFloat(n.toString()),r=r==null?null:parseFloat(r.toString()),n==null&&r!=null||n!=null&&r==null||n!=null&&(isNaN(n)||n>90||n<-90)||r!=null&&(isNaN(r)||r>
1180||r<-180))?(t.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.au.Iu(e,n,r).W)}addToSubscriptionGroup(n){return!P(n,`add user to subscription group`,`subscription group ID`,!1)||n.length<=0?(t.error(`addToSubscriptionGroup requires a non-empty subscription group ID`),!1):this.au.Cu(n,e.Eu.SUBSCRIBED).W}removeFromSubscriptionGroup(n){return!P(n,`remove user from subscription group`,`subscription group ID`,!1)||n.length<=0?(t.error(`removeFromSubscriptionGroup requires a non-empty subscription group ID`),!1):this.au.Cu(n,e.Eu.UNSUBSCRIBED).W}setLineId(n){return P(n,`set LINE user ID`,`the ID`,!0)&&n?.length!==0?n&&n.length>e.Su?(t.error(`Rejected LINE user ID ${n} because it is longer than ${e.Su} characters.`),!1):this.Cs.nu(`native_line_id`,n):(t.error(`setLineId requires a non-empty ID`),!1)}Yn(e,t,n,r,i){this.Cs.Yn(e,t,n,r,i),this.au.Au()}Hn(e){this.Cs.Hn(e)}};F.Genders={MALE:`m`,FEMALE:`f`,OTHER:`o`,UNKNOWN:`u`,NOT_APPLICABLE:`n`,PREFER_NOT_TO_SAY:`p`},F.NotificationSubscriptionTypes={OPTED_IN:`opted_in`,SUBSCRIBED:`subscribed`,UNSUBSCRIBED:`unsubscribed`},F.pu=/^[0-9 .\\(\\)\\+\\-]+$/,F.Eu={SUBSCRIBED:`subscribed`,UNSUBSCRIBED:`unsubscribed`},F.Uu=`user_id`,F.lu=`custom`,F.mr=997,F.Su=33;var Se=class{constructor(){}ef(){}ff(){}rc(e){}static nf(e,t){if(e&&t){if(e=e.toLowerCase(),c(t.cf)){for(let n=0;n<t.cf.length;n++)if(e.indexOf(t.cf[n].toLowerCase())!==-1)return t.identity}else if(e.indexOf(t.cf.toLowerCase())!==-1)return t.identity}}},I={rO:`Chrome`,eO:`Edge`,oO:`Opera`,Bg:`Safari`,OO:`Firefox`,Sg:`ChatGPTBrowser`},L={Dg:`Android`,co:`iOS`,Pg:`Mac`,kg:`Windows`},Ce=class e extends Se{constructor(){if(super(),this.userAgentData=navigator.userAgentData,this.browser=null,this.version=null,this.userAgentData){let e=this.Vc();this.browser=e.browser||`Unknown Browser`,this.version=e.version||`Unknown Version`}this.OS=null}ef(){return this.browser}ff(){return this.version}rc(t){if(this.OS)return Promise.resolve(this.OS);let n=n=>{for(let r=0;r<t.length;r++){let i=e.nf(n,t[r]);if(i)return this.OS=i,this.OS}return n};return this.userAgentData.platform?Promise.resolve(n(this.userAgentData.platform)):this.getHighEntropyValues().then(e=>e.platform?n(e.platform):navigator.platform).catch(()=>navigator.platform)}Vc(){let e={},t=this.userAgentData.brands;if(t&&t.length)for(let n of t){let t=this.Gc(I),r=n.brand.match(t);if(r&&r.length>0){e.browser=r[0],e.version=n.version;break}}return e}Gc(e){let t=[];for(let n in e){let r=n;t.push(e[r])}return RegExp(`(`+t.join(`|`)+`)`,`i`)}getHighEntropyValues(){return this.userAgentData.getHighEntropyValues?this.userAgentData.getHighEntropyValues([`platform`]):Promise.reject()}},we=class e extends Se{constructor(){super(),this.fd=e.Vc(navigator.userAgent||``)}ef(){return this.fd[0]||`Unknown Browser`}ff(){return this.fd[1]||`Unknown Version`}rc(t){for(let n=0;n<t.length;n++){let r=t[n].string,i=e.nf(r,t[n]);if(i)return i===L.Pg&&navigator.maxTouchPoints>1&&(i=L.co),Promise.resolve(i)}return Promise.resolve(navigator.platform)}static Vc(e){let t,n=e.match(/(samsungbrowser|tizen|roku|konqueror|icab|crios|opera|ucbrowser|chatgptbrowser|chrome|safari|firefox|camino|msie|trident(?=\/))\/?\s*(\.?\d+(\.\d+)*)/i)||[];if(e.indexOf(`(Web0S; Linux/SmartTV)`)!==-1)return[`LG Smart TV`,null];if(e.indexOf(`CrKey`)!==-1)return[`Chromecast`,null];if(e.indexOf(`BRAVIA`)!==-1||e.indexOf(`SonyCEBrowser`)!==-1||e.indexOf(`SonyDTV`)!==-1)return[`Sony Smart TV`,null];if(e.indexOf(`PhilipsTV`)!==-1)return[`Philips Smart TV`,null];if(e.match(/\b(Roku)\b/))return[`Roku`,null];if(e.match(/\bAFTM\b/))return[`Amazon Fire Stick`,null];if(n[1]===I.rO){if(e.includes(I.Sg))return[I.Sg,n[2]];if(t=e.match(/\b(OPR|Edge|EdgA|Edg|UCBrowser)\/(\.?\d+(\.\d+)*)/),t!=null)return t=t.slice(1),t[0]=t[0].replace(`OPR`,I.oO),t[0]=t[0].replace(`EdgA`,I.eO),t[0]===`Edg`&&(t[0]=I.eO),[t[0],t[1]]}if(n[1]===I.Bg&&(t=e.match(/\b(EdgiOS)\/(\.?\d+(\.\d+)*)/),t!=null))return t=t.slice(1),t[0]=t[0].replace(`EdgiOS`,I.eO),[t[0],t[1]];if(n=n[2]?[n[1],n[2]]:[null,null],n[0]===I.Bg&&(t=e.match(/version\/(\.?\d+(\.\d+)*)/i))!=null&&n.splice(1,1,t[1]),(t=e.match(/\b(UCBrowser)\/(\.?\d+(\.\d+)*)/))!=null&&n.splice(1,1,t[2]),n[0]===I.oO&&(t=e.match(/mini\/(\.?\d+(\.\d+)*)/i))!=null)return[`Opera Mini`,t[1]||``];if(n[0]){let e=n[0].toLowerCase();e===`crios`&&(n[0]=I.rO),e===`tizen`&&(n[0]=`Samsung Smart TV`,n[1]=null),e===`samsungbrowser`&&(n[0]=`Samsung Browser`)}return n}},Te=class e{constructor(){let t;t=navigator.userAgent.toLowerCase().includes(I.Sg.toLowerCase())||!navigator.userAgentData?we:Ce,this.vg=new t,this.userAgent=navigator.userAgent,this.browser=this.vg.ef(),this.version=this.vg.ff(),this.OS=null,this.rc().then(e=>this.OS=e);let n=navigator;this.language=(n.userLanguage||n.language||n.browserLanguage||n.systemLanguage||``).toLowerCase(),this.Ja=e.xg(this.userAgent)}fE(){return this.browser===I.Bg}nc(){return this.OS||null}rc(){return this.OS?Promise.resolve(this.OS):this.vg.rc(e.Og).then(e=>(this.OS=e,e))}static xg(e){e=e.toLowerCase();let t=[`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 n=0;n<t.length;n++)if(e.indexOf(t[n])!==-1)return!0;return!1}};Te.Og=[{string:navigator.platform,cf:`Win`,identity:L.kg},{string:navigator.platform,cf:`Mac`,identity:L.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:L.co},{string:navigator.platform,cf:`Pike v`,identity:L.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:L.Dg},{string:navigator.userAgent,cf:[`Android`],identity:L.Dg},{string:navigator.platform,cf:`Linux`,identity:`Linux`}];var R=new Te,z={iu:{su:`ab.storage.userId`,Oa:`ab.storage.deviceId`,Ql:`ab.storage.sessionId`},ct:{lc:`ab.test`,tE:`ab.storage.events`,eE:`ab.storage.attributes`,sE:`ab.storage.attributes.anonymous_user`,ac:`ab.storage.device`,ku:`ab.storage.sdk_metadata`,wu:`ab.storage.session_id_for_cached_metadata`,Wo:`ab.storage.pushToken`,rE:`ab.storage.cardImpressions`,jl:`ab.storage.serverConfig`,oE:`ab.storage.triggers`,nE:`ab.storage.triggers.ts`,Vl:`ab.storage.messagingSessionStart`,Ps:`ab.storage.cc`,Gs:`ab.storage.ccLastFullSync`,Hs:`ab.storage.ccLastCardUpdated`,ol:`ab.storage.globalRateLimitCurrentTokenCount`,ul:`ab.storage.dynamicRateLimitCurrentTokenCount`,Et:`ab.storage.ccClicks`,Pt:`ab.storage.ccImpressions`,Lt:`ab.storage.ccDismissals`,aE:`ab.storage.lastDisplayedTriggerTimesById`,iE:`ab.storage.lastDisplayedTriggerTime`,EE:`ab.storage.triggerFireInstancesById`,xh:`ab.storage.signature`,lE:`ab.storage.brazeSyncRetryCount`,Qs:`ab.storage.sdkVersion`,Se:`ab.storage.ff`,Ne:`ab.storage.ffImpressions`,Ee:`ab.storage.ff
1LastRefreshAt`,Xe:`ab.storage.ff.sessionId`,SE:`ab.storage.lastReqToEndpoint`,_E:`ab.storage.requestAttempts`,yn:`ab.storage.deferredIam`,tl:`ab.storage.lastSdkReq`,uE:`ab.storage.alias`,ut:`ab.storage.banners`,It:`ab.storage.banners.impressions`,gt:`ab.storage.banners.sessionId`,qi:`ab.storage.dust.mite`,zi:`ab.storage.dust.host`},ie:`ab.optOut`},B=class e{constructor(e,t){this.cE=e,this.TE=t,this.cE=e,this.TE=t}Xa(t){let n=d(z.iu),r=new e.ne(t);for(let e of n)r.remove(z.iu[e])}uu(e,t){let n=null;t!=null&&t instanceof A&&(n=t.dt()),this.cE.store(e,n)}hE(e){let t=this.tu(e);t!=null&&(t.Zl=new Date().valueOf(),this.uu(e,t))}tu(e){let t=this.cE.jr(e),n=(e=>{let t;try{t=JSON.parse(e)}catch{t=null}return t})(t),r;if(n)r=A.Vo(n)||null,r&&this.uu(e,r);else{let n=A.AE(t);r=A.Vo(n)||null,n!==t&&r&&this.uu(e,r)}return r}im(e){this.cE.remove(e)}Za(){let e=d(z.iu),t;for(let n of e)t=this.tu(z.iu[n]),t!=null&&this.uu(z.iu[n],t)}Go(e){let t;if(e==null||e.length===0)return!1;t=c(e)?e:[e];let n=this.TE.jr(z.ct.tE);n!=null&&c(n)||(n=[]);for(let e=0;e<t.length;e++)n.push(t[e].dt());return this.TE.store(z.ct.tE,n)}$l(e){return e!=null&&this.Go([e])}RE(){let e=this.TE.jr(z.ct.tE);this.TE.remove(z.ct.tE),e??=[];let t=[],r=!1,i=null;if(c(e))for(let n=0;n<e.length;n++)O.gE(e[n])?t.push(O.Vo(e[n])):i=n;else r=!0;if(r||i!=null){let a=`Stored events could not be deserialized as Events`;r&&(a+=`, was `+Object.prototype.toString.call(e)+` not an array`),i!=null&&(a+=`, value at index `+i+` does not look like an event`),a+=`, serialized values were of type `+typeof e+`: `+JSON.stringify(e),t.push(new O(null,n.ju,new Date().valueOf(),null,{e:a}))}return t}ft(e,t){return!!s(z.ct,e,`StorageManager cannot store object.`,`STORAGE_KEYS.OBJECTS`)&&this.TE.store(e,t)}lt(e){return!!s(z.ct,e,`StorageManager cannot retrieve object.`,`STORAGE_KEYS.OBJECTS`)&&this.TE.jr(e)}Nt(e){return!!s(z.ct,e,`StorageManager cannot remove object.`,`STORAGE_KEYS.OBJECTS`)&&(this.TE.remove(e),!0)}clearData(){let e=d(z.iu),t=d(z.ct);for(let t=0;t<e.length;t++){let n=e[t];this.cE.remove(z.iu[n])}for(let e=0;e<t.length;e++){let n=t[e];this.TE.remove(z.ct[n])}}OE(e){return e||z.ct.sE}Pu(e){let t=this.TE.jr(z.ct.eE);t??={};let n=this.OE(e[F.Uu]),r=t[n];for(let i in e)i!==F.Uu&&(t[n]==null||r&&r[i]==null)&&this.mu(e[F.Uu],i,e[i])}mu(e,t,n){let r=this.TE.jr(z.ct.eE);r??={};let i=this.OE(e),a=r[i];if(a??(a={},e!=null&&(a[F.Uu]=e)),t===F.lu){a[t]??(a[t]={});for(let e in n)a[t][e]=n[e]}else a[t]=n;return r[i]=a,this.TE.store(z.ct.eE,r)}IE(){let e=this.TE.jr(z.ct.eE);this.TE.remove(z.ct.eE);let t=[];for(let n in e)e[n]!=null&&t.push(e[n]);return t}ru(e){let t=this.TE.jr(z.ct.eE);if(t!=null){let n=this.OE(null),r=t[n];r!=null&&(t[n]=void 0,this.TE.store(z.ct.eE,t),r[F.Uu]=e,this.Pu(r))}let n=this.tu(z.iu.Ql),r=null;n!=null&&(r=n.eu);let i=this.RE();if(i!=null)for(let t=0;t<i.length;t++){let n=i[t];n.userId==null&&n.sessionId==r&&(n.userId=e),this.$l(n)}}dE(){return this.TE.bE}};B.dc=class{constructor(e){this.Pn=e,this.Pn=e,this.bE=R.fE()?3:10}mE(e){return e+`.`+this.Pn}store(e,n){let r={v:n};try{return localStorage.setItem(this.mE(e),JSON.stringify(r)),!0}catch(e){return t.info(`Storage failure: `+k(e)),!1}}jr(e){try{let t=null,n=localStorage.getItem(this.mE(e));return n!=null&&(t=JSON.parse(n)),t==null?null:t.v}catch(e){return t.info(`Storage retrieval failure: `+k(e)),null}}remove(e){try{localStorage.removeItem(this.mE(e))}catch(e){return t.info(`Storage removal failure: `+k(e)),!1}}},B.mc=class{constructor(){this.KE={},this.YE=5242880,this.bE=3}store(e,n){let r={value:n},i=this.NE(n);return i>this.YE?(t.info(`Storage failure: object is â`+i+` bytes which is greater than the max of `+this.YE),!1):(this.KE[e]=r,!0)}NE(e){let t=[],n=[e],r=0;for(;n.length;){let e=n.pop();if(typeof e==`boolean`)r+=4;else if(typeof e==`string`)r+=2*e.length;else if(typeof e==`number`)r+=8;else if(typeof e==`object`&&t.indexOf(e)===-1){let r,i;t.push(e);for(let t in e)i=e,r=t,n.push(i[r])}}return r}jr(e){let t=this.KE[e];return t==null?null:t.value}remove(e){this.KE[e]=null}},B.ne=class{constructor(e,t){this.Pn=e,this.GE=t,this.Pn=e,this.DE=this.CE(),this.ME=576e3,this.GE=!!t}mE(e){return this.Pn==null?e:e+`.`+this.Pn}CE(){let e=0,t=document.location.hostname,n=t.split(`.`),r=`ab._gd`;for(;e<n.length-1&&document.cookie.indexOf(r+`=ab._gd`)===-1;)e++,t=`.`+n.slice(-1-e).join(`.`),document.cookie=r+`=ab._gd;domain=`+t+`;`;return document.cookie=r+`=;expires=`+new Date(0).toUTCString()+`;domain=`+t+`;`,t}se(){let e=new Date;return e.setTime(e.getTime()+60*this.ME*1e3),e.getFullYear()}pE(){let e=o(z.iu),t=document.cookie.split(`;`);for(let n=0;n<t.length;n++){let r=t[n];for(;r.charAt(0)===` `;)r=r.substring(1);let i=!1;for(let t=0;t<e.length;t++)if(r.indexOf(e[t])===0){i=!0;break}if(i){let e=r.split(`=`)[0];e.indexOf(`.`+this.Pn)===-1&&this.vE(e)}}}store(e,n){this.pE();let r=new Date;r.setTime(r.getTime()+60*this.ME*1e3);let i=`expires=`+r.toUTCString(),a=`domain=`+this.DE,o;o=this.GE?n:encodeURIComponent(n);let s=this.mE(e)+`=`+o+`;`+i+`;`+a+`;path=/`;return s.length>=4093?(t.info(`Storage failure: string is `+s.length+` chars which is too large to store as a cookie.`),!1):(document.cookie=s,!0)}jr(e){let n=[],r=this.mE(e)+`=`,i=document.cookie.split(`;`);for(let a=0;a<i.length;a++){let o=i[a];for(;o.charAt(0)===` `;)o=o.substring(1);if(o.indexOf(r)===0)try{let e;e=this.GE?o.substring(r.length,o.length):decodeURIComponent(o.substring(r.length,o.length)),n.push(e)}catch(n){return t.info(`Storage retrieval failure: `+k(n)),this.remove(e),null}}return n.length>0?n[n.length-1]:null}remove(e){this.vE(this.mE(e))}vE(e){let t=e+`=;expires=`+new Date(0).toUTCString();document.cookie=t,document.cookie=t+`;path=/`;let n=t+`;domain=`+this.DE;document.cookie=n,document.cookie=n+`;path=/`}},B.uc=class{constructor(e,t,n){this.Pn=e,this.UE=[],t&&this.UE.push(new B.ne(e)),n&&this.UE.push(new B.dc(e)),this.UE.push(new B.mc)}store(e,t){let n=!0;for(let r=0;r<this.UE.length;r++)n=this.UE[r].store(e,t)&&n;return n}jr(e){for(let t=0;t<this.UE.length;t++){let n=this.UE[t].jr(e);if(n!=null)return n}return null}remove(e){new B.ne(this.Pn).remove(e);for(let t=0;t<this.UE.length;t++)this.UE[t].remove(e)}};var Ee=class{constructor(e,t,n){this.j=e,this.gh=t,this.ph=n,this.j=e,this.gh=t||!1,this.ph=n,this.Fh=new D,this.kh=0,this.fh=1}wh(){return this.gh}jh(){return this.j.lt(z.ct.xh)}setSdkAuthenticationSignature(e){let n=this.jh();this.j.ft(z.ct.xh,e);let r=i.Us.Rs;new i(r,t).setItem(r.Fs.qh,this.fh,e),n!==e&&this.Z()}yh(){this.j.Nt(z.ct.xh);let e=i.Us.Rs;new i(e,t).be(e.Fs.qh,this.fh)}subscribeToSdkAuthenticationFailures(e){return this.ph.wt(e)}Bh(e){this.ph.L(e)}Gh(){this.Fh.removeAllSubscriptions()}Hh(){this.kh+=1}Jh(){return this.kh}Z(){this.kh=0}},De=class{constructor(){}N(e){}changeUser(e=!1){}clearData(e=!1){}},Oe=class{constructor(e){this.id=e,this.id=e}pn(){let e={};return this.browser!=null&&(e.browser=this.browser),this.ec!=null&&(e.browser_version=this.ec),this.os!=null&&(e.os_version=this.os),this.resolution!=null&&(e.resolution=this.resolution),this.language!=null&&(e.locale=this.language),this.timeZone!=null&&(e.time_zone=this.timeZone),this.userAgent!=null&&(e.user_agent=this.userAgent),e}},V={BROWSER:`browser`,BROWSER_VERSION:`browserVersion`,OS:`os`,RESOLUTION:`resolution`,LANGUAGE:`language`,TIME_ZONE:`timeZone`,USER_AGENT:`userAgent`},ke=class{constructor(e,t){this.j=e,this.tc=t,this.j=e,t??=o(V),this.tc=t}fe(e=!0){let t=this.j.tu(z.iu.Oa);t??(t=new A(r.oe()),e&&this.j.uu(z.iu.Oa,t));let n=new Oe(t.eu);for(let e=0;e<this.tc.length;e++)switch(this.tc[e]){case V.BROWSER:n.browser=R.browser;break;case V.BROWSER_VERSION:n.ec=R.version;break;case V.OS:n.os=this.rc();break;case V.RESOLUTION:n.sc=screen.width+`x`+screen.height;break;case V.LANGUAGE:n.language=R.language;break;case V.TIME_ZONE:n.timeZone=this.oc(new Date);break;case V.USER_AGENT:n.userAgent=R.userAgent}return n}rc(){if(R.nc())return R.nc();let e=this.j.lt(z.ct.ac);return e&&e.os_version?e.os_version:R.rc()}oc(e){let n=!1;if(typeof Intl<`u`&&typeof Intl.DateTimeFormat==`function`)try{if(typeof Intl.DateTimeFormat().resolvedOptions==`function`){let e=Intl.DateTimeFormat().resolvedOptions().timeZone;if(e!=null&&e!==``)return e}}catch(e){t.info(`Intl.DateTimeFormat threw an error, cannot detect user's time zone:`+k(e)),n=!0}if(n)return``;let r=e.getTimezoneOffset();return this.cc(r)}cc(e){let t=Math.trunc(e/60),n=Math.trunc(e%60),r=`GMT`;return e!==0&&(r+=e<0?`+`:`-`,r+=(`00`+Math.abs(t)).slice(-2)+`:`+(`00`+Math.abs(n)).slice(-2)),r}},Ae={$u:`invalid_api_key`,Xu:`blacklisted`,Lu:`no_device_identifier`,Mu:`invalid_json_response`,zu:`empty_response`,__:`sdk_auth_error`},H={H:{Yi:`data`,Ci:`content_cards/sync`,ke:`feature_flags/sync`,mn:`template`,G:`banners/sync`},vl:e=>e?.lt(z.ct.SE),nm:e=>e?.lt(z.ct._E),rm:(e,t)=>
1{e?.ft(z.ct.SE,t)},um:(e,t)=>{e?.ft(z.ct._E,t)},Gu:(e,t)=>{if(!e||!t)return-1;let n=H.vl(e);if(n==null)return-1;let r=n[t];return r==null||isNaN(r)?-1:r},_u:(e,t)=>{let n=1;if(!e||!t)return n;let r=H.nm(e);return r==null?n:(n=r[t],n==null||isNaN(n)?1:n)},K:(e,t,n)=>{if(!e||!t)return;let r=H.vl(e);r??={},r[t]=n,H.rm(e,r)},Wu:(e,t,n)=>{if(!e||!t)return;let r=H.nm(e);r??={},r[t]=n,H.um(e,r)},fi:(e,t)=>{e&&t&&H.Wu(e,t,1)},sl:(e,t)=>{if(!e||!t)return;let n=H._u(e,t);H.Wu(e,t,n+1)}},je={O:e=>{let n,r;try{let i=()=>{t.error(`This browser does not have any supported ajax options!`)},a=!1;if(window.XMLHttpRequest&&(a=!0),!a)return void i();n=new XMLHttpRequest;let o=t=>{typeof e.error==`function`&&e.error(n.status),typeof e.tt==`function`&&e.tt(!1,t)};n.onload=()=>{let t=!1;if(n.readyState!==4)return;t=n.status>=200&&n.status<300||n.status===304;let r=n.getAllResponseHeaders();if(t){if(typeof e.W==`function`){let t;try{t=JSON.parse(n.responseText)}catch{let t={error:n.responseText===``?Ae.zu:Ae.Mu,response:n.responseText};(0,e.W)(t,r)}t&&e.W(t,r)}typeof e.tt==`function`&&e.tt(!0,r)}else o(r)},n.onerror=()=>{o(n.getAllResponseHeaders())},n.ontimeout=()=>{o()},r=JSON.stringify(e.data),n.open(`POST`,e.url,!0),n.setRequestHeader(`Content-type`,`application/json`),n.setRequestHeader(`X-Requested-With`,`XMLHttpRequest`);let s=e.headers||[];for(let e of s)n.setRequestHeader(e[0],e[1]);n.send(r)}catch(e){t.error(`Network request error: ${k(e)}`)}}},Me=e=>{let t={},n=e.toString().split(`\r 2`);if(!n)return t;let r,i;for(let e of n)e&&(r=e.slice(0,e.indexOf(`:`)).toLowerCase().trim(),i=e.slice(e.indexOf(`:`)+1).trim(),t[r]=i);return t},Ne=class{constructor(e,t,n,r,i,a,o,s,c,l,u,d){this.Dn=e,this.j=t,this.La=n,this.Cs=r,this.C=i,this.h=a,this.Pn=o,this.Ua=s,this.Ra=c,this.Pa=l,this.appVersion=u,this.Ru=d,this.qu=e=>e==null?``:`${e} `,this.Dn=e,this.j=t,this.La=n,this.Cs=r,this.C=i,this.h=a,this.Pn=o,this.Ua=s,this.Ra=c,this.Pa=l,this.appVersion=u,this.Ru=d,this.Du=[`npm`],this.Tu={}}$(e,t=!1,n=!1){let r=this.Dn.fe(!n),i=r.pn();f(this.j.lt(z.ct.ac),i)||(e.device=i),e.api_key=this.Pn,e.time=p(new Date().valueOf(),!0);let a=this.j.lt(z.ct.ku)||[],o=this.j.lt(z.ct.wu)||``;this.Du.length>0&&(!f(a,this.Du)||o!==this.C.bt())&&(e.sdk_metadata=this.Du),e.sdk_version=this.Ra,this.Pa&&(e.sdk_flavor=this.Pa),e.app_version=this.appVersion,e.app_version_code=this.Ru,e.device_id=r.id;let s=this.Cs.getUserId();if(t&&s!==null&&(e.user_id=s),!s&&!this.La.wh()){let t=ee(this.j);t&&(e.alias=t)}return e}Y(e,r,i){let a=r.auth_error,o=r.error;if(!a&&!o)return!0;if(a){let n;this.La.Hh();let r={errorCode:a.error_code};for(let e of i)c(e)&&e[0]===`X-Braze-Auth-Signature`&&(r.signature=e[1]);e.respond_with&&e.respond_with.user_id?r.userId=e.respond_with.user_id:e.user_id&&(r.userId=e.user_id);let o=a.reason;return o?(r.reason=o,n=`due to ${o}`):n=`with error code ${a.error_code}.`,this.La.wh()||(n+=` Please use the "enableSdkAuthentication" initialization option to enable authentication.`),t.error(`SDK Authentication failed ${n}`),this.Bu(e.events||[],e.attributes||[]),this.La.Bh(r),!1}if(o){let i,a=o;switch(a){case Ae.zu:return i=`Received successful response with empty body.`,$.rt(n.ju,{e:i}),t.info(i),!1;case Ae.Mu:return i=`Received successful response with invalid JSON`,$.rt(n.ju,{e:i+`: `+r.response}),t.info(i),!1;case Ae.$u:a=`The API key "${e.api_key}" is invalid for the baseUrl ${this.Ua}`;break;case Ae.Xu:a=`Sorry, we are not currently accepting your requests. If you think this is in error, please contact us.`;break;case Ae.Lu:a=`No device identifier. Please contact [email protected]`}t.error(`Backend error: `+a)}return!1}Fu(e,t,n){return!!(e&&e.length!==0||t&&t.length!==0||n)}Ku(e,t,n,r=!1){let i=[],a=e=>e||``,o=a(this.Cs.getUserId()),s=this.cn(e),c=[],l=[],u,d=null;if(t.length>0){let e=[];for(let n of t){if(u=n.pn(),this.La.wh()){if(o&&!u.user_id){d||={},d.events||=[],d.events.push(u);continue}if(a(u.user_id)!==o){l.push(u);continue}}e.push(u)}e.length>0&&(s.events=e)}if(n.length>0){let e=[];for(let t of n)t&&(this.La.wh()&&a(t.user_id)!==o?c.push(t):e.push(t));e.length>0&&(s.attributes=e)}if(this.Bu(l,c),s=this.$(s,!1,r),d){d=this.$(d,!1,r);let e={requestData:d,headers:this.A(d,H.H.Yi)};i.push(e)}if(s&&!this.Fu(s.events,s.attributes,e))return d?i:null;let f={requestData:s,headers:this.A(s,H.H.Yi)};return i.push(f),i}Bu(e,t){if(e){let t=[];for(let n of e){let e=O.fromJson(n);e.time=m(e.time),t.push(e)}this.j.Go(t)}if(t)for(let e of t)this.j.Pu(e)}_(e,n){let r=`HTTP error `;e!=null&&(r+=e+` `),r+=n,t.error(r)}xu(e){return $.rt(n.Hu,{n:e})}cn(e,t){let n={};e&&(n.triggers=!0);let r=t??this.Cs.getUserId();if(r&&(n.user_id=r),!n.user_id&&!this.La.wh()){let e=ee(this.j);e&&(n.alias=e)}return n.config={config_time:this.h.Ft()},{respond_with:n}}Ou(e){let t=new Date().valueOf(),n=T.toString(),r=H.Gu(this.j,e);return r!==-1&&(n=(t-r).toString()),n}A(e,t,n=!1){let r=[[`X-Braze-Api-Key`,this.Pn]],i=this.Ou(t);r.push([`X-Braze-Last-Req-Ms-Ago`,i]);let a=H._u(this.j,t).toString();r.push([`X-Braze-Req-Attempt`,a]);let o=!1;if(e.respond_with!=null&&e.respond_with.triggers&&(r.push([`X-Braze-TriggersRequest`,`true`]),o=!0),t===H.H.Ci){r.push([`X-Braze-ContentCardsRequest`,`true`]);let e=H._u(this.j,H.H.Ci);e&&!n||(e=1,H.Wu(this.j,H.H.Ci,e));let t=Math.max(0,e-1);r.push([`BRAZE-SYNC-RETRY-COUNT`,t.toString()]),o=!0}if(t===H.H.ke&&(r.push([`X-Braze-FeatureFlagsRequest`,`true`]),o=!0),o&&r.push([`X-Braze-DataRequest`,`true`]),this.La.wh()){let e=this.La.jh();e!=null&&r.push([`X-Braze-Auth-Signature`,e])}return r}Yu(e,n,r,i){if(this.Tu[i])return;let a=window.setTimeout(()=>{t.info(`Retrying rate limited ${this.qu(i)}SDK request.`),this.J(n,r,i)},e);this.Tu[i]=a}fo(){for(let e in this.Tu){let t=this.Tu[e];window.clearTimeout(t)}this.Tu={}}J(e,n,r,i){if(!this.Ju(r))return t.info(`${this.qu(r)}SDK request being rate limited.`),void(typeof i==`function`&&i());let a=this.Qu();if(!a.Vu)return this.Yu(a.Zu,e,n,r),void t.info(`${this.qu(r)}SDK request being rate limited. Request will be retried in ${Math.trunc(a.Zu/1e3)} seconds.`);this.j.ft(z.ct.tl,new Date().valueOf());let o=e.device;o&&o.os_version instanceof Promise?o.os_version.then(t=>
2{e.device.os_version=t,n(a.el)}):n(a.el)}il(e){let t=e?Me(e):null;if(!t||!t[`retry-after`])return null;let r=t[`retry-after`];return isNaN(r)&&!isNaN(Date.parse(r))?{type:`date`,value:Date.parse(r)}:isNaN(parseFloat(r.toString()))?($.rt(n.ju,{e:`Received unexpected value for retry-after header in /sync response: `+r}),null):{type:`timestamp`,value:1e3*parseFloat(r.toString())}}st(e,t,n,r,i,a){if(H._u(this.j,n)>=15)return;let o;a||=0;let s=this.il(e);i();let c=e=>{r(window.setTimeout(()=>{t()},e)),H.sl(this.j,n)};if(s&&!isNaN(s.value)){switch(s.type){case`date`:o=s.value-new Date().getTime()+a,o<0&&t();break;case`timestamp`:o=s.value+a}c(o)}else a?c(a):H.fi(this.j,n)}rl(e){var t;(t=this.j)==null||t.ft(z.ct.ol,e)}al(e,t){let n=this.hl();n??={},n[e]=t,this.j.ft(z.ct.ul,n)}cl(){return this.j?.lt(z.ct.ol)}hl(){return this.j?.lt(z.ct.ul)}dl(e,t,n,r,i=``){let a;if(i){let e=this.hl();a=e==null||isNaN(e[i])?t:e[i]}else a=this.cl(),(a==null||isNaN(a))&&(a=t);let o=(e-r)/1e3;return a=Math.min(a+o/n,t),a}fl(e,t){return Math.max(0,(1-e)*t*1e3)}ml(e,t=``){let n={Vu:!0,el:-1,Zu:0};if(e??=!0,!e&&!t)return n;let r,i,a=null;if(e)a=this.j?.lt(z.ct.tl);else{let e=H.vl(this.j);if(e==null||e[t]==null)return n;a=e[t]}if(a==null||isNaN(a)||(e?(r=this.h?.Rl()||-1,i=this.h?.gl()||-1):(r=this.h?.bl(t)||-1,i=this.h?.ql(t)||-1),r===-1||i===-1))return n;let o=new Date().valueOf(),s=this.dl(o,r,i,a,t);return s<1?(n.Vu=!1,n.Zu=this.fl(s,i),n):(s=Math.trunc(s)-1,n.el=s,e?this.rl(s):this.al(t,s),n)}Qu(){return this.ml(!0)}Ju(e){let t=this.ml(!1,e);return!(t&&!t.Vu)}Z(){this.La.Z()}V(){return this.Ua}addSdkMetadata(e){for(let t of e)this.Du.indexOf(t)===-1&&this.Du.push(t)}},Pe=(e,t)=>(e=Math.ceil(e),t=Math.floor(t),Math.floor(Math.random()*(t-e+1))+e),Fe=class{constructor(e=!1,t=[]){this.W=e,this.ue=t,this.W=e,this.ue=t}Vt(e){this.W=this.W&&e.W,this.ue.push(...e.ue)}},U={qn:()=>`serviceWorker`in navigator&&typeof ServiceWorkerRegistration<`u`&&`showNotification`in ServiceWorkerRegistration.prototype&&`PushManager`in window,En:()=>`safari`in window&&`pushNotification`in window.safari&&typeof window.safari.pushNotification.permission==`function`&&typeof window.safari.pushNotification.requestPermission==`function`,isPushSupported:()=>U.qn()||U.En(),isPushBlocked:()=>{let e=U.isPushSupported()&&`Notification`in window&&window.Notification!=null&&window.Notification.permission!=null&&window.Notification.permission===`denied`,t=U.isPushSupported()&&(!(`Notification`in window)||window.Notification==null);return e||t},isPushPermissionGranted:()=>U.isPushSupported()&&`Notification`in window&&window.Notification!=null&&window.Notification.permission!=null&&window.Notification.permission===`granted`,en:()=>U.isPushBlocked()?{sn:!1,reason:`blocked`}:U.isPushSupported()?U.isPushPermissionGranted()?{sn:!1,reason:`permissionGranted`}:{sn:!0}:{sn:!1,reason:`unsupported`},on:(e,t)=>e===`blocked`?`${t} containing a push prompt is not being shown because the user has already declined push permission prompt.`:e===`unsupported`?`${t} containing a push prompt is not being shown because the browser doesn't support push notifications.`:`${t} containing a push prompt is not being shown because the user has already accepted the permission prompt.`};function Ie(){let e=document.querySelectorAll(`.ab-iam-root`);for(let t=0;t<e.length;t++){let n=e[t];if(n.id){let e=n.id+`-css`,t=document.getElementById(e);t&&t.parentNode&&t.parentNode.removeChild(t)}n.parentNode&&n.parentNode.removeChild(n)}let t=document.getElementsByClassName(E);for(let e=0;e<t.length;e++){let n=t[e].classList;n.contains(`ab-pause-scrolling`)&&n.remove(`ab-pause-scrolling`)}}var Le=class{constructor(e,t,n,r,i,a,o,s,c,l){this.Pn=e,this.baseUrl=t,this.C=n,this.Dn=r,this.Cs=i,this.h=a,this.j=o,this.fc=s,this.La=c,this.B=l,this.Pn=e,this.baseUrl=t,this.vc=0,this.bE=o.dE()||0,this.bc=null,this.C=n,this.Dn=r,this.Cs=i,this.h=a,this.j=o,this.La=c,this.B=l,this.fc=s,this.wc=new D,this.kc=null,this.yc=50,this.jc=!1,this.Sc=!1}Ac(e,t){return!e&&!t&&this.La.Jh()>=this.yc}Dc(e){let t=this.C.Ul();if(e.length>0){let r=this.Cs.getUserId();for(let i of e){let e=!i.userId&&!r||i.userId===r;i.type===n.sm&&e&&(t=!0)}}return t}$c(e=!1,n=!0,r,i,a,o=!1,s=!1){n&&this.qc();let c=this.j.RE(),l=this.j.IE(),u=!1,d=(e,t,o=-1)=>{let s=new Date().valueOf();H.K(this.j,H.H.Yi,s),o!==-1&&t.push([`X-Braze-Req-Tokens-Remaining`,o.toString()]);let c=!1;je.O({url:this.baseUrl+`/data/`,data:e,headers:t,W:n=>{e.respond_with!=null&&e.respond_with.triggers&&(this.vc=Math.max(this.vc-1,0)),this.B.Y(e,n,t)?(this.La.Z(),this.h.Nl(n),e.respond_with!=null&&e.respond_with.user_id!=this.Cs.getUserId()||(e.device!=null&&this.j.ft(z.ct.ac,e.device),e.sdk_metadata!=null&&(this.j.ft(z.ct.ku,e.sdk_metadata),this.j.ft(z.ct.wu,this.C.bt())),this.fc(n),H.Wu(this.j,H.H.Yi,1),typeof r==`function`&&r())):n.auth_error&&(c=!0)},error:()=>{c=!0,e.respond_with!=null&&e.respond_with.triggers&&(this.vc=Math.max(this.vc-1,0)),this.B.Bu(e.events,e.attributes),typeof i==`function`&&i()},tt:(e,t)=>{typeof a==`function`&&a(!c);let r=this.B.il(t),i=0;if(r)switch(r.type){case`date`:i=Math.max(r.value-new Date().valueOf(),0);break;case`timestamp`:i=r.value}if(n&&!u){if(c){H.sl(this.j,H.H.Yi);let e=this.bc;(e==null||e<1e3*this.bE)&&(e=1e3*this.bE);let t=Math.min(3e5,Pe(1e3*this.bE,3*e))+i;this.Cc(t)}
2else this.Cc(Math.max(1e3*this.bE,i));u=!0}}})},f=this.Dc(c),p=e||f;if(this.Ac(o,f))return void t.info(`Declining to flush data due to 50 consecutive authentication failures`);if(n&&!this.B.Fu(c,l,p))return this.Cc(),void(typeof a==`function`&&a(!0));let m=this.B.Ku(p,c,l,s);p&&this.vc++;let h=!1;if(m)for(let e of m)this.B.J(e.requestData,t=>d(e.requestData,e.headers,t),H.H.Yi,i),h=!0;this.La.wh()&&n&&!h?this.Cc():f&&(t.info(`Invoking new session subscriptions`),this.wc.L(),this.Sc=!0)}Mc(){return this.vc>0}Cc(e=1e3*this.bE){this.jc||(this.qc(),this.kc=window.setTimeout(()=>{if(document.hidden){let e=`visibilitychange`,t=()=>{document.hidden||(document.removeEventListener(e,t,!1),this.$c())};document.addEventListener(e,t,!1)}else this.$c()},e),this.bc=e)}qc(){this.kc!=null&&(clearTimeout(this.kc),this.kc=null)}initialize(){this.jc=!1,this.Cc()}destroy(){this.wc.removeAllSubscriptions(),this.La.Gh(),this.qc(),this.jc=!0,this.$c(void 0,!1,void 0,void 0,void 0,void 0,!0),this.kc=null,this.Sc=!1}rn(e){return this.Sc?(e(),null):this.wc.wt(e)}openSession(){let n=this.C.bt()!==this.C.Fo();n&&(this.j.hE(z.iu.Oa),this.j.hE(z.iu.su)),this.$c(!1,void 0,()=>{n&&(this.j.Nt(z.ct.Ne),this.j.Nt(z.ct.It))}),this.Au(),n&&e(()=>import(`./push-manager-factory-CjodTP6Q.js`).then(e=>{if(this.jc)return;let n=e.default.ea();if(n!=null&&(U.isPushPermissionGranted()||U.isPushBlocked())){let e=()=>{n.Rn()?t.info(`Push token maintenance is disabled, not refreshing token for backend.`):n.subscribe()},r=(t,n)=>{n&&e()},a=()=>{let t=this.j.lt(z.ct.Wo);(t==null||t)&&e()},o=i.Us.Rs;new i(o,t).kr(o.Fs.cu,r,a)}}),[])}Tc(){this.j.Nt(z.ct.Se),this.j.Nt(z.ct.Ps),this.j.Nt(z.ct.yn)}Lc(){this.j.Nt(z.ct.tl),this.j.Nt(z.ct.SE);let e=H.H;for(let t in e){let n=e[t];this.B.al(n,this.h?.bl(n))}this.B.rl(this.h?.Rl())}changeUser(e,n,r){let i=this.Cs.getUserId();if(i!==e){this.C.tm(),this.Tc(),Ie(),i!=null&&this.$c(void 0,!1,void 0,void 0,void 0),this.Cs.ou(e),r?this.La.setSdkAuthenticationSignature(r):this.La.yh();for(let e=0;e<n.length;e++)n[e].changeUser(i==null);this.B.fo(),i!=null&&this.j.Nt(z.ct.rE),this.j.Nt(z.ct.ac),this.j.Nt(z.ct.uE),this.Lc(),this.openSession(),t.info(`Changed user to "`+e+`".`)}else{let n=`Doing nothing.`;r&&this.La.jh()!==r&&(this.La.setSdkAuthenticationSignature(r),n=`Updated SDK authentication signature`),t.info(`Current user is already ${e}. ${n}`)}}requestImmediateDataFlush(e){this.qc(),this.C.Fo(),this.$c(void 0,void 0,void 0,()=>{t.error(`Failed to flush data, request will be retried automatically.`)},e,!0)}yr(e,n){this.C.Fo(),t.info(`Requesting explicit trigger refresh.`),this.$c(!0,void 0,e,n)}du(e,r){let i=n.Rc,a={a:e,l:r},o=$.rt(i,a);return o&&(t.info(`Logged alias ${e} with label ${r}`),this.j.ft(z.ct.uE,a)),o}bu(e,n,r){if(this.h.hu(n))return t.info(`Custom Attribute "${n}" is blocklisted, ignoring.`),new Fe;let i={key:n,value:r},a=$.rt(e,i);if(a){let e=typeof r==`object`?JSON.stringify(r,null,2):r;t.info(`Logged custom attribute: ${n} with value: ${e}`)}return a}setLastKnownLocation(e,r,i,a,o,s){let c={latitude:r,longitude:i};a!=null&&(c.altitude=a),o!=null&&(c.ll_accuracy=o),s!=null&&(c.alt_accuracy=s);let l=$.rt(n.Fc,c,e||void 0);return l&&t.info(`Set user last known location as ${JSON.stringify(c,null,2)}`),l}$r(e,t){let r=this.C.Fo();return new O(this.Cs.getUserId(),n.Ic,e,r,{cid:t})}Pc(e,t){return new i(e,t)}Au(){let e=i.Us.Rs;this.Pc(e,t).setItem(e.Fs.Yi,1,{baseUrl:this.baseUrl,data:{api_key:this.Pn,device_id:this.Dn.fe().id},userId:this.Cs.getUserId(),sdkAuthEnabled:this.La.wh()})}Fr(e){for(let n of e)if(n.api_key===this.Pn)this.B.Bu(n.events,n.attributes);else{let e=i.Us.Rs;new i(e,t).setItem(e.Fs.zr,r.oe(),n)}}Iu(e,r,i){if(this.h.hu(e))return t.info(`Custom Attribute "${e}" is blocklisted, ignoring.`),new Fe;let a,o;return r===null&&i===null?(a=n.xc,o={key:e}):(a=n.Nc,o={key:e,latitude:r,longitude:i}),$.rt(a,o)}Cu(e,t){let r={group_id:e,status:t};return $.rt(n.Oc,r)}},Re=class e{constructor(e=0,t=[],n=[],r=[],i=null,a=null,o={enabled:!1},s={enabled:!1,refresh_rate_limit:void 0},c={enabled:!0,capacity:30,refill_rate:30,endpoint_overrides:{}},l=null,u=null){this.Dl=e,this.Il=t,this.Ml=n,this.Sl=r,this.Pl=i,this.xl=a,this.Gl=o,this.je=s,this.kl=c,this.banners=l,this.dust=u,this.Dl=e,this.Il=t,this.Ml=n,this.Sl=r,this.Pl=i,this.xl=a,this.Gl=o,this.je=s,this.kl=c,this.banners=l,this.dust=u}dt(){return{s:`6.4.0`,l:this.Dl,e:this.Il,a:this.Ml,p:this.Sl,m:this.Pl,v:this.xl,c:this.Gl,f:this.je,grl:this.kl,b:this.banners,d:this.dust}}static Vo(t){let n=t.l;return t.s!==`6.4.0`&&(n=0),new e(n,t.e,t.a,t.p,t.m,t.v,t.c,t.f,t.grl,t.b,t.d)}},ze=class{constructor(e){this.j=e,this.j=e,this.El=new D,this.wl=new D,this.Cl=new D,this.yl=new D,this.Ll=new D,this.Tl=null,this.Bl=null}
2Fl(){if(this.Bl==null){let e=this.j.lt(z.ct.jl);this.Bl=e==null?new Re:Re.Vo(e)}return this.Bl}Ft(){return this.Fl().Dl}Nl(e){if(e!=null&&e.config!=null){let t=e.config;if(t.time>this.Fl().Dl){let e=new Re(t.time,t.events_blacklist,t.attributes_blacklist,t.purchases_blacklist,t.messaging_session_timeout,t.vapid_public_key,t.content_cards,t.feature_flags,(e=>e??this.Fl().kl)(t.global_request_rate_limit),t.banners,t.dust),n=!1;e.xl!=null&&this.Zn()!==e.xl&&(n=!0);let r=!1;e.Gl.enabled!=null&&this.wi()!==e.Gl.enabled&&(r=!0);let i=!1;e.je.enabled!=null&&this.Te()!==e.je.enabled&&(i=!0);let a=!1;e.banners?.enabled!=null&&this.Dt()!==e.banners?.enabled&&(a=!0);let o=!1;e.dust?.enabled!=null&&this.Xi()!==e.dust?.enabled&&(o=!0),this.Bl=e,this.j.ft(z.ct.jl,e.dt()),n&&this.El.L(),r&&this.wl.L(),i&&this.Cl.L(),a&&this.yl.L(),o&&this.Ll.L()}}}$n(e){let t=this.El.wt(e);return this.Tl&&this.El.removeSubscription(this.Tl),this.Tl=t,t}bi(e){return this.wl.wt(e)}$e(e){return this.Cl.wt(e)}P(e){return this.yl.wt(e)}Tr(e){return this.Ll.wt(e)}ge(e){return this.Fl().Il.indexOf(e)!==-1}hu(e){return this.Fl().Ml.indexOf(e)!==-1}Dr(e){return this.Fl().Sl.indexOf(e)!==-1}Kl(){return this.Fl().Pl}Zn(){return this.Fl().xl}wi(){return this.Fl().Gl.enabled||!1}_l(){let e=this.Fl().kl;return!(!e||e.enabled==null)&&e.enabled}Rl(){if(!this._l())return-1;let e=this.Fl().kl;return e.capacity==null||e.capacity<10?-1:e.capacity}gl(){if(!this._l())return-1;let e=this.Fl().kl;return e.refill_rate==null||e.refill_rate<=0?-1:e.refill_rate}Al(e){let t=this.Fl().kl.endpoint_overrides;return t==null?null:t[e]}bl(e){let t=this.Al(e);return t==null||isNaN(t.capacity)||t.capacity<=0?-1:t.capacity}ql(e){let t=this.Al(e);return t==null||isNaN(t.refill_rate)||t.refill_rate<=0?-1:t.refill_rate}Te(){return this.Fl().je.enabled&&this.Be()==null?($.rt(n.ju,{e:`Missing feature flag refresh_rate_limit.`}),!1):this.Fl().je.enabled||!1}Be(){return this.Fl().je.refresh_rate_limit}Dt(){return this.Fl().banners?.enabled||null}te(){return this.Fl().banners?.max_placements||0}Xi(){return this.Fl().dust?.enabled||!1}},Be=class{constructor(e,n,r,i){this.j=e,this.Cs=n,this.h=r,this.zl=i,this.j=e,this.Cs=n,this.h=r,this.Hl=1e3,(i==null||isNaN(i))&&(i=1800),i<this.Hl/1e3&&(t.info(`Specified session timeout of `+i+`s is too small, using the minimum session timeout of `+this.Hl/1e3+`s instead.`),i=this.Hl/1e3),this.zl=i}Wl(e,t){return new O(this.Cs.getUserId(),n.Jl,e,t.eu,{d:p(e-t.Ol)})}bt(){let e=this.j.tu(z.iu.Ql);return e==null?null:e.eu}Ul(){let e=new Date().valueOf(),t=this.h.Kl();if(t==null)return!1;let n=this.j.lt(z.ct.Vl),r=n==null||e-n>1e3*t;return r&&this.j.ft(z.ct.Vl,e),r}Xl(e,t){return t==null||t.Yl==null||!(e-t.Ol<this.Hl)&&t.Yl<e}Fo(){let e=new Date().valueOf(),i=e+1e3*this.zl,a=this.j.tu(z.iu.Ql);if(this.Xl(e,a)){let o=`Generating session start event with time `+e;if(a!=null){let e=a.Zl;e-a.Ol<this.Hl&&(e=a.Ol+this.Hl),this.j.$l(this.Wl(e,a)),o+=` (old session ended `+e+`)`}o+=`. Will expire `+i.valueOf(),t.info(o);let s=new A(r.oe(),i);return this.j.$l(new O(this.Cs.getUserId(),n.sm,e,s.eu)),this.j.uu(z.iu.Ql,s),this.j.lt(z.ct.Vl)??this.j.ft(z.ct.Vl,e),s.eu}if(a!=null)return a.Zl=e,a.Yl=i,this.j.uu(z.iu.Ql,a),a.eu}tm(){let e=this.j.tu(z.iu.Ql);e!=null&&(this.j.im(z.iu.Ql),this.j.$l(this.Wl(new Date().valueOf(),e)))}},Ve={Ya:function(e,n=!1){let r=!1;try{if(localStorage&&localStorage.getItem)try{localStorage.setItem(z.ct.lc,`true`),localStorage.getItem(z.ct.lc)&&(localStorage.removeItem(z.ct.lc),r=!0)}catch(e){if(!(e instanceof Error&&(e.name===`QuotaExceededError`||e.name===`NS_ERROR_DOM_QUOTA_REACHED`)&&localStorage.length>0))throw e;r=!0}}catch{t.info(`Local Storage not supported!`)}let i=Ve.gc(),a=new B.uc(e,i&&!n,r),o;return o=r?new B.dc(e):new B.mc,new B(a,o)},gc:function(){return navigator.cookieEnabled||`cookie`in document&&(document.cookie.length>0||(document.cookie=`test`).indexOf.call(document.cookie,`test`)>-1)}},He=class e{constructor(e,t){this.triggerId=e,this.messageExtras=t,this.triggerId=e,this.messageExtras=t,this.extras={},this.isControl=!0,this.kt=!1}static fromJson(t){return new e(t.trigger_id,t.message_extras)}Qt(){return!this.kt&&(this.kt=!0,!0)}zo(){return this.kt}};function Ue(e,t=!1,n=!1,r=!1){if(e==null)return!1;t||=!1,n||=!1;let i=e.getBoundingClientRect();return i!=null&&(i.top>=0&&i.top<=(window.innerHeight||document.documentElement.clientHeight)||!t)&&(i.left>=0||!r)&&(i.bottom>=0&&i.bottom<=(window.innerHeight||document.documentElement.clientHeight)||!n)&&(i.right<=(window.innerWidth||document.documentElement.clientWidth)||
2!r)}var We={Wc:null,Do:Ue},Ge={xo:`up`,Co:`down`,Zt:`left`,ae:`right`};function Ke(){if(We.Wc==null){We.Wc=!1;try{let e=Object.defineProperty({},`passive`,{get:()=>{We.Wc=!0}});window.addEventListener(`testPassive`,()=>{},e),window.removeEventListener(`testPassive`,()=>{},e)}catch(e){t.error(k(e))}}return We.Wc}function qe(e,t,n=()=>{}){e.addEventListener(t,n,!!Ke()&&{passive:!0})}function Je(e){if(e.onclick){let t=document.createEvent(`MouseEvents`);t.initEvent(`click`,!0,!0),e.onclick.apply(e,[t])}}function Ye(e,t,n){let r=null,i=null;qe(e,`touchstart`,e=>{r=e.touches[0].clientX,i=e.touches[0].clientY}),qe(e,`touchmove`,a=>{if(r==null||i==null)return;let o=r-a.touches[0].clientX,s=i-a.touches[0].clientY;Math.abs(o)>Math.abs(s)&&Math.abs(o)>=25?((o>0&&t===Ge.Zt||o<0&&t===Ge.ae)&&n(a),r=null,i=null):Math.abs(s)>=25&&((s>0&&t===Ge.xo&&e.scrollTop===e.scrollHeight-e.offsetHeight||s<0&&t===Ge.Co&&e.scrollTop===0)&&n(a),r=null,i=null)})}function Xe(e,t,n){let r=`http://www.w3.org/2000/svg`,i=document.createElementNS(r,`svg`);i.setAttribute(`viewBox`,e),i.setAttribute(`xmlns`,r);let a=document.createElementNS(r,`path`);return a.setAttribute(`d`,t),n!=null&&a.setAttribute(`fill`,n),i.appendChild(a),i}var Ze={do:32,yo:9,lo:13,Ih:27},Qe=e=>e!==null&&e.tagName===`IFRAME`,W=class e{constructor(t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,ee,O,k,A,j,te){this.message=t,this.messageAlignment=n,this.slideFrom=r,this.extras=i,this.triggerId=a,this.clickAction=o,this.uri=s,this.openTarget=c,this.dismissType=l,this.duration=u,this.icon=d,this.imageUrl=f,this.imageStyle=p,this.iconColor=m,this.iconBackgroundColor=h,this.backgroundColor=g,this.textColor=_,this.closeButtonColor=v,this.animateIn=y,this.animateOut=b,this.header=x,this.headerAlignment=S,this.headerTextColor=C,this.frameColor=w,this.buttons=T,this.cropType=E,this.orientation=ee,this.htmlId=O,this.css=k,this.messageExtras=A,this.language=j,this.altImageText=te,this.message=t,this.messageAlignment=n||e.TextAlignment.CENTER,this.duration=u||5e3,this.slideFrom=r||e.SlideFrom.BOTTOM,this.extras=i||{},this.triggerId=a,this.clickAction=o||e.ClickAction.NONE,this.uri=s,this.openTarget=c||e.OpenTarget.NONE,this.dismissType=l||e.DismissType.AUTO_DISMISS,this.icon=d,this.imageUrl=f,this.imageStyle=p||e.ImageStyle.TOP,this.iconColor=m||e.th.ih,this.iconBackgroundColor=h||e.th.sh,this.backgroundColor=g||e.th.ih,this.textColor=_||e.th.hh,this.closeButtonColor=v||e.th.eh,this.animateIn=y,this.animateIn??=!0,this.animateOut=b,this.animateOut??=!0,this.header=x,this.headerAlignment=S||e.TextAlignment.CENTER,this.headerTextColor=C||e.th.hh,this.frameColor=w||e.th.Eh,this.buttons=T||[],this.cropType=E||e.CropType.FIT_CENTER,this.orientation=ee,this.htmlId=O,this.css=k,this.isControl=!1,this.messageExtras=A,this.language=j,this.altImageText=te,this.nh=!1,this.kt=!1,this.So=!1,this.Th=!1,this.Qe=null,this.Ve=null,this.ti=new D,this.oh=new D,this.bo=e.TextAlignment.CENTER}subscribeToClickedEvent(e){return this.ti.wt(e)}subscribeToDismissedEvent(e){return this.oh.wt(e)}removeSubscription(e){this.ti.removeSubscription(e),this.oh.removeSubscription(e)}removeAllSubscriptions(){this.ti.removeAllSubscriptions(),this.oh.removeAllSubscriptions()}closeMessage(){this.ll(this.Qe)}We(){return!0}Po(){return this.We()}Pe(){return this.htmlId!=null&&this.htmlId.length>4}Oe(){return this.Pe()&&this.css!=null&&this.css.length>0}He(){if(this.Pe()&&this.Oe())return this.htmlId+`-css`}Qt(){return!this.kt&&(this.kt=!0,!0)}zo(){return this.kt}$t(e){return!this.So&&(this.So=!0,this.ti.L(),!0)}Kt(){return!this.Th&&(this.Th=!0,this.oh.L(),!0)}hide(t){if(t&&t.parentNode){let n=t.closest(`.ab-iam-root`);if(n??=t,this.We()&&n.parentNode!=null){let t=n.parentNode.classList;t&&t.contains(`ab-pause-scrolling`)&&t.remove(`ab-pause-scrolling`),document.body.removeEventListener(`touchmove`,e.rh)}n.className=n.className.replace(e.lh,e.uh)}return this.animateOut||!1}ll(t,n){if(t==null)return;let r;this.Qe=null,r=t.className.indexOf(`ab-in-app-message`)===-1?t.getElementsByClassName(`ab-in-app-message`)[0]:t;let i=!1;r&&(i=this.hide(r));let a=document.body,o;a!=null&&(o=a.scrollTop);let s=()=>
2{if(t&&t.parentNode){let e=t.closest(`.ab-iam-root`);e??=t,e.parentNode&&e.parentNode.removeChild(e)}let e=this.He();if(e!=null){let t=document.getElementById(e);t&&t.parentNode&&t.parentNode.removeChild(t)}a!=null&&R.browser===`Safari`&&(a.scrollTop=o),n?n():this.Kt()};i?setTimeout(s,e.hr):s(),this.Ve&&this.Ve.focus()}jo(){return document.createTextNode(this.message||``)}po(e){e.setAttribute(`alt`,this.altImageText||``)}static rh(e){if(e.targetTouches&&e.targetTouches.length>1)return;let t=e.target;t&&t.classList&&t.classList.contains(`ab-message-text`)&&t.scrollHeight>t.clientHeight||document.querySelector(`.ab-pause-scrolling`)&&e.cancelable&&e.preventDefault()}ah(t){let n=t.parentNode;this.We()&&n!=null&&this.orientation!==e.Orientation.LANDSCAPE&&(n.classList!=null&&n.classList.add(`ab-pause-scrolling`),document.body.addEventListener(`touchmove`,e.rh,!!Ke()&&{passive:!1})),t.className+=` `+e.lh}static Ah(e){if(e.keyCode===Ze.Ih&&!Q.ee(Z.Oh)&&document.querySelectorAll(`.ab-modal-interactions`).length>0){let e=document.getElementsByClassName(`ab-html-message`),t=!1;for(let n of e){let e=null;Qe(n)&&n.contentWindow&&(e=n.contentWindow.document.getElementsByClassName(`ab-programmatic-close-button`)[0]),e!=null&&(Je(e),t=!0)}if(!t){let e=document.querySelectorAll(`.ab-modal-interactions > .ab-close-button`)[0];e!=null&&Je(e)}}}mh(){this.nh||Q.ee(Z.Oh)||(document.addEventListener(`keydown`,e.Ah,!1),Q.Lh(()=>{document.removeEventListener(`keydown`,e.Ah)}),this.nh=!0)}dt(t){let n={};return t?(n[e.ss.ra]=this.message,n[e.ss.sa]=this.messageAlignment,n[e.ss._h]=this.slideFrom,n[e.ss.xs]=this.extras,n[e.ss.ta]=this.triggerId,n[e.ss.ia]=this.clickAction,n[e.ss.URI]=this.uri,n[e.ss.oa]=this.openTarget,n[e.ss.pa]=this.dismissType,n[e.ss.ma]=this.duration,n[e.ss.na]=this.icon,n[e.ss.ns]=this.imageUrl,n[e.ss.ua]=this.imageStyle,n[e.ss.ca]=this.iconColor,n[e.ss.fa]=this.iconBackgroundColor,n[e.ss.da]=this.backgroundColor,n[e.ss.la]=this.textColor,n[e.ss.ga]=this.closeButtonColor,n[e.ss.ja]=this.animateIn,n[e.ss.xa]=this.animateOut,n[e.ss.za]=this.header,n[e.ss.ha]=this.headerAlignment,n[e.ss.va]=this.headerTextColor,n[e.ss.wa]=this.frameColor,n[e.ss.ya]=this.buttons,n[e.ss.Sa]=this.cropType,n[e.ss.ba]=this.orientation,n[e.ss.ka]=this.htmlId,n[e.ss.CSS]=this.css,n[e.ss.ts]=t,n[e.ss.qa]=this.messageExtras,n[e.ss.LANGUAGE]=this.language,n[e.ss.ks]=this.altImageText,n):n}};W.th={hh:4281545523,ih:4294967295,sh:4278219733,Nh:4293914607,Rh:4283782485,Eh:3224580915,eh:4288387995},W.Ze={Sh:`hd`,Ye:`ias`,Mh:`of`,Dh:`do`,Ch:`umt`,dh:`tf`,Uh:`te`},W.SlideFrom={TOP:`TOP`,BOTTOM:`BOTTOM`},W.ClickAction={URI:`URI`,NONE:`NONE`},W.DismissType={AUTO_DISMISS:`AUTO_DISMISS`,MANUAL:`SWIPE`},W.OpenTarget={NONE:`NONE`,BLANK:`BLANK`},W.ImageStyle={TOP:`TOP`,GRAPHIC:`GRAPHIC`},W.Orientation={PORTRAIT:`PORTRAIT`,LANDSCAPE:`LANDSCAPE`},W.TextAlignment={START:`START`,CENTER:`CENTER`,END:`END`},W.CropType={CENTER_CROP:`CENTER_CROP`,FIT_CENTER:`FIT_CENTER`},W.Le={Tn:`SLIDEUP`,An:`MODAL`,Io:`MODAL_STYLED`,bn:`FULL`,Mn:`WEB_HTML`,Ke:`HTML`,Ao:`HTML_FULL`},W.hr=500,W.bh=200,W.lh=`ab-show`,W.uh=`ab-hide`,W.ss={ra:`m`,sa:`ma`,_h:`sf`,xs:`e`,ta:`ti`,ia:`ca`,URI:`u`,oa:`oa`,pa:`dt`,ma:`d`,na:`i`,ns:`iu`,ua:`is`,ca:`ic`,fa:`ibc`,da:`bc`,la:`tc`,ga:`cbc`,ja:`ai`,xa:`ao`,za:`h`,ha:`ha`,va:`htc`,wa:`fc`,ya:`b`,Sa:`ct`,ba:`o`,ka:`hi`,CSS:`css`,ts:`type`,qo:`messageFields`,qa:`me`,LANGUAGE:`l`,ks:`ia`};var $e=class e extends W{constructor(e,t,n,r,i,a,o,s,c,l,u,d){super(e,void 0,void 0,t,n,void 0,void 0,void 0,r||=W.DismissType.MANUAL,i,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,a,o,void 0,void 0,void 0,s,void 0,void 0,void 0,c,l,d,void 0,void 0),this.messageFields=u,this.messageFields=u}Po(){return!1}$t(e){if(this.Je===W.Le.Mn){if(this.So)return!1;this.So=!0}return this.ti.L(e),!0}dt(){let t=super.dt(e.es);return t[W.ss.qo]=this.messageFields,t}static In(t){return new e(t[W.ss.ra],t[W.ss.xs],t[W.ss.ta],t[W.ss.pa],t[W.ss.ma],t[W.ss.ja],t[W.ss.xa],t[W.ss.wa],t[W.ss.ka],t[W.ss.CSS],t[W.ss.qo],t[W.ss.qa])}};$e.es=W.Le.Mn;var et=class e{constructor(t,n,r,i,a,o,s){this.text=t,this.backgroundColor=n,this.textColor=r,this.borderColor=i,this.clickAction=a,this.uri=o,this.id=s,this.text=t||``,this.backgroundColor=n||W.th.sh,this.textColor=r||W.th.ih,this.borderColor=i||this.backgroundColor,this.clickAction=a||W.ClickAction.NONE,this.uri=o,s??=e.Vr,this.id=s,this.So=!1,this.ti=new D}subscribeToClickedEvent(e){return this.ti.wt(e)}removeSubscription(e){this.ti.removeSubscription(e)}removeAllSubscriptions(){this.ti.removeAllSubscriptions()}$t(){return!this.So&&(this.So=!0,this.ti.L(),!0)}static fromJson(t){return new e(t.text,t.bg_color,t.text_color,t.border_color,t.click_action,t.uri,t.id)}};et.Vr=-1;var tt=class e extends W{constructor(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D,ee,O,k){s||=W.DismissType.MANUAL,T||=W.Orientation.PORTRAIT,super(e,t,void 0,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w||=W.CropType.CENTER_CROP,T,E,D,ee,O,k),this.bo=W.TextAlignment.CENTER}dt(){return super.dt(e.es)}static In(t){return new e(t[W.ss.ra],t[W.ss.sa],t[W.ss.xs],t[W.ss.ta],t[W.ss.ia],t[W.ss.URI],t[W.ss.oa],t[W.ss.pa],t[W.ss.ma],t[W.ss.na],t[W.ss.ns],t[W.ss.ua],t[W.ss.ca],t[W.ss.fa],t[W.ss.da],t[W.ss.la],t[W.ss.ga],t[W.ss.ja],t[W.ss.xa],t[W.ss.za],t[W.ss.ha],t[W.ss.va],t[W.ss.wa],at(t[W.ss.ya]),t[W.ss.Sa],t[W.ss.ba],t[W.ss.ka],t[W.ss.CSS],t[W.ss.qa],t[W.ss.LANGUAGE],t[W.ss.ks])}};tt.es=W.Le.bn;var nt=class e extends W{constructor(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D,ee,O){super(e,t,void 0,n,r,i,a,o,s||=W.DismissType.MANUAL,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w||=W.CropType.FIT_CENTER,void 0,T,E,D,ee,O),this.bo=W.TextAlignment.CENTER}dt(){return super.dt(e.es)}static In(t){return new e(t[W.ss.ra],t[W.ss.sa],t[W.ss.xs],t[W.ss.ta],t[W.ss.ia],t[W.ss.URI],t[W.ss.oa],t[W.ss.pa],t[W.ss.ma],t[W.ss.na],t[W.ss.ns],t[W.ss.ua],t[W.ss.ca],t[W.ss.fa],t[W.ss.da],t[W.ss.la],t[W.ss.ga],t[W.ss.ja],t[W.ss.xa],t[W.ss.za],t[W.ss.ha],t[W.ss.va],t[W.ss.wa],at(t[W.ss.ya]),t[W.ss.Sa],t[W.ss.ka],t[W.ss.CSS],t[W.ss.qa],t[W.ss.LANGUAGE],t[W.ss.ks])}};nt.es=W.Le.An;var rt=class e extends W{constructor(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C){h||=W.th.Rh,m||=W.th.Nh,super(e,t||=W.TextAlignment.START,n,r,i,a,o,s,c,l,u,d,void 0,f,p,m,h,g,_,v,void 0,void 0,void 0,void 0,void 0,void 0,void 0,y,b,x,S,C),this.bo=W.TextAlignment.START}We(){return!1}jo(){let e=document.createElement(`span`);return e.appendChild(document.createTextNode(this.message||``)),e}ah(e){let t=e.getElementsByClassName(`ab-in-app-message`)[0];We.Do(t,!0,!0)||(this.slideFrom===W.SlideFrom.TOP?t.style.top=`0px`:t.style.bottom=`0px`),super.ah(e)}dt(){return super.dt(e.es)}static In(t){return new e(t[W.ss.ra],t[W.ss.sa],t[W.ss._h],t[W.ss.xs],t[W.ss.ta],t[W.ss.ia],t[W.ss.URI],t[W.ss.oa],t[W.ss.pa],t[W.ss.ma],t[W.ss.na],t[W.ss.ns],t[W.ss.ca],t[W.ss.fa],t[W.ss.da],t[W.ss.la],t[W.ss.ga],t[W.ss.ja],t[W.ss.xa],t[W.ss.ka],t[W.ss.CSS],t[W.ss.qa],t[W.ss.LANGUAGE],t[W.ss.ks])}};rt.es=W.Le.Tn;function it(e){if(!e)return null;if(e.is_control)return He.fromJson(e);let n=e.type;n!=null&&(n=n.toUpperCase());let r=e.message,i=e.text_align_message,a=e.slide_from,o=e.extras,s=e.trigger_id,c=e.click_action,l=e.uri,u=e.open_target,d=e.message_close,f=e.duration,p=e.icon,m=e.image_url,h=e.image_style,g=e.icon_color,_=e.icon_bg_color,v=e.bg_color,y=e.text_color,b=e.close_btn_color,x=e.header,S=e.text_align_header,C=e.header_text_color,w=e.frame_color,T=[],E=e.btns;E??=[];for(let e=0;e<E.length;e++)T.push(et.fromJson(E[e]));let D=e.crop_type,ee=e.orientation,O=e.animate_in,k=e.animate_out,A=e.html_id,j=e.css;A!=null&&A!==``&&j!=null&&j!==``||(A=void 0,j=void 0);let te=e.message_extras,M=e.language,ne=e.image_alt,re;if(n===nt.es||n===W.Le.Io)re=new nt(r,i,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,O,k,x,S,C,w,T,D,A,j,te,M,ne);else if(n===tt.es)re=new tt(r,i,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,O,k,x,S,C,w,T,D,ee,A,j,te,M,ne);else if(n===rt.es)re=new rt(r,i,a,o,s,c,l,u,d,f,p,m,g,_,v,y,b,O,k,A,j,te,M,ne);else{if(n!==$e.es&&n!==W.Le.Ke&&n!==W.Le.Ao)return void t.error(`Ignoring message with unknown type `+n);{let t=e.message_fields;re=new $e(r,o,s,d,f,O,k,w,A,j,t,te),re.trusted=e.trusted||!1}}return re.Je=n,re}function at(e){let t=[];for(let n of e)t.push(new et(n.text,n.backgroundColor,n.textColor,n.borderColor,n.clickAction,n.uri,n.id));return t}var ot=class e{constructor(e){this.zc=e,this.zc=e}Bc(e){return this.zc==null||this.zc===e[0]}static fromJson(t){return new e(t?t.event_name:null)}dt(){return this.zc}},st=class e{constructor(t,n,r,i){this.yE=t,this.HE=n,this.comparator=r,this.LE=i,this.yE=t,this.HE=n,this.comparator=r,this.LE=i,this.HE===e.XE.QE&&this.comparator!==e.BE.wE&&this.comparator!==e.BE.jE&&this.comparator!==e.BE.zE&&this.comparator!==e.BE.FE&&(this.LE=h(this.LE))}Bc(t){let n=null;switch(t!=null&&(n=t[this.yE]),this.comparator){case e.BE.kE:return n!=null&&n.valueOf()===this.LE.valueOf();case e.BE.xE:return n==null||n.valueOf()!==this.LE.valueOf();case e.BE.JE:return n!=null&&typeof n==typeof this.LE&&n>this.LE;case e.BE.wE:return this.HE===e.XE.QE?n!=null&&l(n)&&y(n)<=this.LE.valueOf():n!=null&&typeof n==typeof this.LE&&n>=this.LE;case e.BE.VE:return n!=null&&typeof n==typeof this.LE&&n<this.LE;case e.BE.jE:return this.HE===e.XE.QE?n!=null&&l(n)&&y(n)>=this.LE.valueOf():n!=null&&typeof n==typeof this.LE&&n<=this.LE;case e.BE.qE:return n!=null&&typeof n==`string`&&typeof n==typeof this.LE&&n.match(this.LE)!=null;case e.BE.PE:return n!=null;case e.BE.WE:return n==null;case e.BE.zE:return n!=null&&l(n)&&b(n)<this.LE;case e.BE.FE:return n!=null&&l(n)&&b(n)>this.LE;case e.BE.ZE:return n==null||typeof n!=typeof this.LE||typeof n!=`string`||n.match(this.LE)==null}return!1}static fromJson(t){return new e(t.property_key,t.property_type,t.comparator,t.property_value)}dt(){let e=this.LE;return l(this.LE)&&(e=p(e.valueOf())),{k:this.yE,t:this.HE,c:this.comparator,v:e}}static Vo(t){return new e(t.k,t.t,t.c,t.v)}};st.XE={$E:`boolean`,tT:`number`,sT:`string`,QE:`date`},st.BE={kE:1,xE:2,JE:3,wE:4,VE:5,jE:6,qE:10,PE:11,WE:12,zE:15,FE:16,ZE:17};var ct=class e{constructor(e){this.filters=e,this.filters=e}Bc(e){let t=!0;for(let n=0;n<this.filters.length;n++){let r=this.filters[n],i=!1;for(let t=0;t<r.length;t++)if(r[t].Bc(e)){i=!0;break}if(!i){t=!1;break}}return t}static fromJson(t){if(t==null||!c(t))return null;let n=[];for(let e=0;e<t.length;e++){let r=[],i=t[e];for(let e=0;e<i.length;e++)r.push(st.fromJson(i[e]));n.push(r)}return new e(n)}dt(){let e=[];for(let t=0;t<this.filters.length;t++){let n=this.filters[t],r=[];for(let e=0;e<n.length;e++)r.push(n[e].dt());e.push(r)}return e}static Vo(t){let n=[];for(let e=0;e<t.length;e++){let r=[],i=t[e];for(let e=0;e<i.length;e++)r.push(st.Vo(i[e]));n.push(r)}return new e(n)}},lt=class e{constructor(e,t){this.zc=e,this.tf=t,this.zc=e,this.tf=t}Bc(e){if(this.zc==null||this.tf==null)return!1;let t=e[0],n=e[1];return t===this.zc&&this.tf.Bc(n)}static fromJson(t){return new e(t?t.event_name:null,t?ct.fromJson(t.property_filters):null)}dt(){return{e:this.zc,pf:this.tf?this.tf.dt():null}}},ut=class e{constructor(e,t){this.if=e,this.rf=t,this.if=e,this.rf=t}Bc(e){if(this.if==null)return!1;let t=K.sf(e[0],this.if);if(!t)return!1;let n=this.rf==null||this.rf.length===0;if(this.rf!=null){for(let t=0;t<this.rf.length;t++)if(this.rf[t]===e[1]){n=!0;break}}return t&&n}static fromJson(t){return new e(t?t.id:null,t?t.buttons:null)}dt(){return this.if}},dt=class e{constructor(e){this.productId=e,this.productId=e}Bc(e){return this.productId==null||e[0]===this.productId}static fromJson(t){return new e(t?t.product_id:null)}dt(){return this.productId}},ft=class e{constructor(e,t){this.productId=e,this.tf=t,this.productId=e,this.tf=t}Bc(e){if(this.productId==null||this.tf==null)return!1;let t=e[0],n=e[1];return t===this.productId&&this.tf.Bc(n)}static fromJson(t){return new e(t?t.product_id:null,t?ct.fromJson(t.property_filters):null)}dt(){return{id:this.productId,pf:this.tf?this.tf.dt():null}}},pt=class e{constructor(e){this.if=e,this.if=e}Bc(e){return this.if==null||K.sf(e[0],this.if)}static fromJson(t){return new e(t?t.campaign_id:null)}dt(){return this.if}},G={OPEN:`open`,Rr:`purchase`,wr:`push_click`,pe:`custom_event`,Bo:`iam_click`,qs:`test`},K=class e{constructor(e,t){this.type=e,this.data=t,this.type=e,this.data=t}_c(t,n){return e.Ec[this.type]===t&&(this.data==null||this.data.Bc(n))}static sf(e,n){let r=null;try{r=window.atob(e)}catch(n){return t.info(`Failed to unencode analytics id `+e+`: `+k(n)),!1}return n===r.split(`_`)[0]}static fromJson(t){let n=t.type,r=null;switch(n){case e.gn.OPEN:case e.gn.qs:break;case e.gn.Rr:r=dt.fromJson(t.data);break;case e.gn.Uc:r=ft.fromJson(t.data);break;case e.gn.wr:r=pt.fromJson(t.data);break;case e.gn.pe:r=ot.fromJson(t.data);break;case e.gn.Hc:r=lt.fromJson(t.data);break;case e.gn.Bo:r=ut.fromJson(t.data)}return new e(n,r)}
2dt(){return{t:this.type,d:this.data?this.data.dt():null}}static Vo(t){let n,r=null;switch(t.t){case e.gn.OPEN:case e.gn.qs:break;case e.gn.Rr:r=new dt(t.d);break;case e.gn.Uc:n=t.d||{},r=new ft(n.id,ct.Vo(n.pf||[]));break;case e.gn.wr:r=new pt(t.d);break;case e.gn.pe:r=new ot(t.d);break;case e.gn.Hc:n=t.d||{},r=new lt(n.e,ct.Vo(n.pf||[]));break;case e.gn.Bo:r=new ut(t.d)}return new e(t.t,r)}};K.gn={OPEN:`open`,Rr:`purchase`,Uc:`purchase_property`,wr:`push_click`,pe:`custom_event`,Hc:`custom_event_property`,Bo:`iam_click`,qs:`test`},K.Ec={},K.Ec[K.gn.OPEN]=G.OPEN,K.Ec[K.gn.Rr]=G.Rr,K.Ec[K.gn.Uc]=G.Rr,K.Ec[K.gn.wr]=G.wr,K.Ec[K.gn.pe]=G.pe,K.Ec[K.gn.Hc]=G.pe,K.Ec[K.gn.Bo]=G.Bo,K.Ec[K.gn.qs]=G.qs;var q=class e{constructor(t,n=[],r,i,a=0,o,s,c=0,l=e.td,u,d,f){this.id=t,this.sd=n,this.startTime=r,this.endTime=i,this.priority=a,this.type=o,this.data=s,this.ed=c,this.rd=l,this.vn=u,this.hd=d,this.od=f,this.id=t,this.sd=n||[],r===void 0&&(r=null),this.startTime=r,i===void 0&&(i=null),this.endTime=i,this.priority=a||0,this.type=o,this.ed=c||0,u??=1e3*(this.ed+30),this.vn=u,this.data=s,l!=null&&(this.rd=l),this.hd=d,this.od=f||null}nd(t){return this.od==null||this.rd!==e.td&&t-this.od>=1e3*this.rd}ad(e){this.od=e}ud(e){let t=e+1e3*this.ed;return Math.max(t-new Date().valueOf(),0)}dd(e){let n=new Date().valueOf()-e,r=e==null||isNaN(n)||this.vn==null||n<this.vn;return r||t.info(`Trigger action ${this.type} is no longer eligible for display - fired ${n}ms ago and has a timeout of ${this.vn}ms.`),!r}static fromJson(t){let n=t.id,r=[];for(let e=0;e<t.trigger_condition.length;e++)r.push(K.fromJson(t.trigger_condition[e]));let i=h(t.start_time),a=h(t.end_time),o=t.priority,c=t.type,l=t.delay,u=t.re_eligibility,d=t.timeout,f=t.data,p=t.min_seconds_since_last_trigger;return s(e.gn,c,`Could not construct Trigger from server data`,`Trigger.Types`)?new e(n,r,i,a,o,c,f,l,u,d,p):null}dt(){let e=[];for(let t=0;t<this.sd.length;t++)e.push(this.sd[t].dt());return{i:this.id,c:e,s:this.startTime,e:this.endTime,p:this.priority,t:this.type,da:this.data,d:this.ed,r:this.rd,tm:this.vn,ss:this.hd,ld:this.od}}static Vo(t){let n=[],r=t.c||[];for(let e=0;e<r.length;e++)n.push(K.Vo(r[e]));return new e(t.i,n,_(t.s),_(t.e),t.p,t.t,t.da,t.d,t.r,t.tm,t.ss,t.ld)}};q.gn={fn:`inapp`,md:`templated_iam`},q.td=-1;var mt={PORTRAIT:0,LANDSCAPE:1};function ht(){return screen.width<=600}function gt(){if(`orientation`in window)return Math.abs(window.orientation)===90||window.orientation===270?mt.LANDSCAPE:mt.PORTRAIT;let e=window;if(`screen`in e){let t=e.screen.orientation||screen.mozOrientation||screen.msOrientation;return typeof t==`object`&&t&&(t=t.type),t===`landscape-primary`||t===`landscape-secondary`?mt.LANDSCAPE:mt.PORTRAIT}return mt.PORTRAIT}function _t(e,t,n){e&&(t||n!=null&&n.metaKey?window.open(e):window.location=e)}function vt(){return window.location.href}var yt={openUri:_t,Uo:ht,$o:gt,Ha:vt};function bt(e){e??=``;let t=e.split(`?`).slice(1).join(`?`),n={};if(t!=null){let e=t.split(`&`);for(let t=0;t<e.length;t++){let r=e[t].split(`=`);r[0]!==``&&(n[r[0]]=r[1])}}return n}function xt(e){return!(!e||(e=e.toString().toLowerCase()).lastIndexOf(`javascript:`,0)!==0&&e.lastIndexOf(`data:`,0)!==0)}var St=class{constructor(e,t,n,r){this.B=e,this.C=t,this.j=n,this.Cs=r,this.B=e,this.C=t,this.j=n,this.Cs=r,this.Mr=new D,Q.q(this.Mr),this.Br=1e3,this._r=6e4,this.qr=null,this.Er=null,this.Gr=null}Nr(){return this.Mr}Or(e){return this.Mr.wt(e)}Xr(){return this.qr}Hr(e){this.qr=e}rt(e,r,i,a){let o=new Fe,s;if(r===n.Jr||e instanceof He){if(!e.Qt())return t.info(`This in-app message has already received an impression. Ignoring analytics event.`),o}else if((r===n.Kr||e instanceof $e&&r===n.Lr)&&!e.$t(a))return t.info(`This in-app message has already received a click. Ignoring analytics event.`),o;return s=e instanceof He?{trigger_ids:[e.triggerId]}:this.Qr(e),s==null?o:(e.messageExtras&&(s.message_extras=e.messageExtras),i!=null&&(s.bid=i),$.rt(r,s))}Ur(e,r){let i=new Fe;if(!e.$t())return t.info(`This in-app message button has already received a click. Ignoring analytics event.`),i;let a=this.Qr(r);return a==null?i:e.id===et.Vr?(t.info(`This in-app message button does not have a tracking id. Not logging event to Braze servers.`),i):(e.id!=null&&(a.bid=e.id),$.rt(n.Lr,a))}Wr(e){let t=e.messageFields;return t!=null&&t.is_push_primer||!1}Yr(e){if(!(e instanceof W))return;let t=e=>{if(!e)return;let t=ie(e);if(oe(t))return re(ne.Zr,`In-App Message`);if(se(t)){let e=U.en();if(!e.sn)return U.on(e.reason,`In-App Message`)}};if(this.Wr(e)){let e=U.en();if(!e.sn)return U.on(e.reason,`In-App Message`)}let n=e.buttons||[],r;for(let e of n)if(e.clickAction===W.ClickAction.URI&&e.uri&&fe.test(e.uri)&&
2(r=t(e.uri),r))return r;return e.clickAction===W.ClickAction.URI&&e.uri&&fe.test(e.uri)?t(e.uri):void 0}an(e,t){t!==this.Gr&&this.ln(),this.Er=e,this.Gr=t}ln(){this.Er!=null&&(clearTimeout(this.Er),this.Er=null,this.Gr=null)}un(e,n,r,i){let a=this.B;if(!a)return;this.Gr&&e.triggerId!==this.Gr&&(this.ln(),H.fi(this.j,H.H.mn));let o=a.cn(!1),s=a.$(o);s.template={trigger_id:e.triggerId,trigger_event_type:n},r!=null&&(s.template.data=r.pn());let c=a.A(s,H.H.mn);a.J(s,(a=-1)=>{let o=this.B;if(!o)return;let l=new Date().valueOf();H.K(this.j,H.H.mn,l),a!==-1&&c.push([`X-Braze-Req-Tokens-Remaining`,a.toString()]);let u,d,f=!1;je.O({url:`${o.V()}/template/`,data:s,headers:c,W:n=>{if(!o.Y(s,n,c))return void(typeof e.hn==`function`&&e.hn());if(o.Z(),n==null||n.templated_message==null)return;let r=n.templated_message;if(r.type!==q.gn.fn)return;let i=it(r.data);if(i==null)return;let a=this.Yr(i);if(a)return t.error(a),void(typeof e.hn==`function`&&e.hn());typeof e.dn==`function`&&e.dn(i)},error:t=>{f=!0,u=t,d=`getting user personalization for message ${e.triggerId}.`},tt:(t,a)=>{if(new Date().valueOf()-e.jn<e.vn){let t=0;if(f){let n=Math.min(e.vn,this._r),r=this.Br;i??=r,t=Math.min(n,Pe(r,3*i))}o.st(a,()=>{this.un(e,n,r,t)},H.H.mn,t=>this.an(t,e.triggerId),()=>this.ln(),t)}f&&o._(u,d)}})},H.H.mn)}Qr(e){if(e.triggerId==null)return t.info(`The in-app message has no analytics id. Not logging event to Braze servers.`),null;let n={};return e.triggerId!=null&&(n.trigger_ids=[e.triggerId]),n}Ge(e){return!!this.j&&!(!(e&&e instanceof W&&e.constructor!==W)||e instanceof He)&&this.j.ft(z.ct.yn,e.dt())}Ar(){if(!this.j)return null;let e=this.j.lt(z.ct.yn);if(!e)return null;let t;switch(e.type){case W.Le.bn:t=tt.In(e);break;case W.Le.Mn:case W.Le.Ke:case W.Le.Ao:t=$e.In(e);break;case W.Le.An:case W.Le.Io:t=nt.In(e);break;case W.Le.Tn:t=rt.In(e)}return t&&this.kn(),t}kn(){this.j&&this.j.Nt(z.ct.yn)}},J={aa:null,i:!1,ea:()=>(J.t(),J.aa||=new St(Q.m(),Q.u(),Q.p(),Q.ir()),J.aa),t:()=>{J.i||=(Q.g(J),!0)},destroy:()=>{J.aa=null,J.i=!1}},Ct=class e{constructor(e,t,n,r,i){this.triggerId=e,this.dn=t,this.hn=n,this.jn=r,this.vn=i,this.triggerId=e,this.dn=t,this.hn=n,this.jn=r,this.vn=i}static fromJson(t,n,r,i,a){return t==null||t.trigger_id==null?null:new e(t.trigger_id,n,r,i,a)}},wt=class extends De{constructor(e,t,n,r,i){super(),this.tg=e,this.ws=t,this.j=n,this.au=r,this.ig=i,this.tg=e,this.ws=t,this.j=n,this.au=r,this.ig=i,this.sg=[],this.eg=[],this.hg=null,this.ng={},this.og={},this.triggers=[],this.lg=0,this.ag(),this.gg()}fg(){if(this.j){this.hg=this.j.lt(z.ct.iE)||this.hg,this.ng=this.j.lt(z.ct.EE)||this.ng,this.og=this.j.lt(z.ct.aE)||this.og;for(let e=0;e<this.triggers.length;e++){let t=this.triggers[e];t.id&&this.og[t.id]!=null&&t.ad(this.og[t.id])}}}ag(){if(!this.j)return;this.lg=this.j.lt(z.ct.nE)||0;let e=this.j.lt(z.ct.oE)||[],t=[];for(let n=0;n<e.length;n++)t.push(q.Vo(e[n]));this.triggers=t,this.fg()}gg(){let e=this,t=function(t,n,r,i,a){return function(){e.cg(t,n,r,i,a)}},n={};for(let e of this.triggers)e.id&&(n[e.id]=e);let r=!1;for(let e=0;e<this.triggers.length;e++){let i=this.triggers[e];if(i.id&&this.ng[i.id]!=null){let e=this.ng[i.id],a=[];for(let r=0;r<e.length;r++){let o=e[r],s=i.ud(o.jn||0);if(s>0){let e,r;a.push(o),o.ug!=null&&(e=o.ug),o.dg!=null&&O.gE(o.dg)&&(r=O.Vo(o.dg));let l=[];if(o.pg&&c(o.pg))for(let e=0;e<o.pg.length;e++){let t=n[o.pg[e]];t!=null&&l.push(t)}this.eg.push(window.setTimeout(t(i,o.jn||0,e,r,l),s))}}this.ng[i.id].length>a.length&&(this.ng[i.id]=a,r=!0,this.ng[i.id].length===0&&delete this.ng[i.id])}}r&&this.j&&this.j.ft(z.ct.EE,this.ng)}mg(){if(!this.j)return;let e=[];for(let t=0;t<this.triggers.length;t++)e.push(this.triggers[t].dt());this.lg=new Date().valueOf(),this.j.ft(z.ct.oE,e),this.j.ft(z.ct.nE,this.lg)}bg(){this.j&&((this.j.lt(z.ct.nE)||0)>this.lg?this.ag():this.fg())}N(e){let n=!1;if(e!=null&&e.triggers){this.ig.kn(),this.fg();let r={},i={};this.triggers=[];for(let t=0;t<e.triggers.length;t++){let a=q.fromJson(e.triggers[t]);if(a){a.id&&this.og[a.id]!=null&&(a.ad(this.og[a.id]),r[a.id]=this.og[a.id]),a.id&&this.ng[a.id]!=null&&(i[a.id]=this.ng[a.id]);for(let e=0;e<a.sd.length;e++)if(a.sd[e]._c(G.qs,null)){n=!0;break}this.triggers.push(a)}}f(this.og,r)||(this.og=r,this.j&&this.j.ft(z.ct.aE,this.og)),f(this.ng,i)||(this.ng=i,this.j&&this.j.ft(z.ct.EE,this.ng)),this.mg(),n&&(t.info(`Trigger with test c
2ondition found, firing test.`),this.ve(G.qs)),this.ve(G.OPEN);let a=this.sg,o;this.sg=[];for(let e=0;e<a.length;e++)o=Array.prototype.slice.call(a[e]),this.ve(...o)}}cg(e,n,r,i,a){let o=i=>{this.fg();let a=new Date().valueOf();e.dd(n)||(!1===navigator.onLine&&e.type===q.gn.fn&&i.imageUrl?t.info(`Not showing ${e.type} trigger action ${e.id} due to offline state.`):e.nd(a)&&this.wg(e,a,r)?this.ws.he()===0?t.info(`Not displaying trigger ${e.id} because neither automaticallyShowInAppMessages() nor subscribeToInAppMessage() were called.`):(this.ws.L([i]),this.yg(e,a)):t.info(`Not displaying trigger ${e.id} because display time fell outside of the acceptable time window.`))},s=()=>{this.fg();let o=a.pop();if(o!=null)if(this.Tg(o,n,r,i,a),o.dd(n)){let e=`Server aborted in-app message display, but the timeout on fallback trigger ${o.id} has already elapsed.`;a.length>0&&(e+=` Continuing to fall back.`),t.info(e),s()}else{t.info(`Server aborted in-app message display. Falling back to lower priority ${o.type} trigger action ${e.id}.`);let s=1e3*o.ed-(new Date().valueOf()-n);s>0?this.eg.push(window.setTimeout(()=>{this.cg(o,n,r,i,a)},s)):this.cg(o,n,r,i,a)}},c,l,u;switch(e.type){case q.gn.fn:if(c=it(e.data),c==null){t.error(`Could not parse trigger data for trigger ${e.id}, ignoring.`);break}if(l=this.ig.Yr(c),l){t.error(l),s();break}o(c);break;case q.gn.md:if(u=Ct.fromJson(e.data,o,s,n,e.vn||0),u==null){t.error(`Could not parse trigger data for trigger ${e.id}, ignoring.`);break}this.ig.un(u,r,i);break;default:t.error(`Trigger ${e.id} was of unexpected type ${e.type}, ignoring.`)}}ve(e,n=null,r){if(!s(G,e,`Cannot fire trigger action.`,`TriggerEvents`))return;if(this.au&&this.au.Mc())return t.info(`Trigger sync is currently in progress, awaiting sync completion before firing trigger event.`),void this.sg.push(arguments);this.bg();let i=new Date().valueOf(),a=i-(this.hg||0),o=!0,c=!0,l=[];for(let t=0;t<this.triggers.length;t++){let r=this.triggers[t],a=i+1e3*r.ed;if(r.nd(a)&&(r.startTime==null||r.startTime.valueOf()<=i)&&(r.endTime==null||r.endTime.valueOf()>=i)){let t=!1;for(let i=0;i<r.sd.length;i++)if(r.sd[i]._c(e,n)){t=!0;break}t&&(o=!1,this.wg(r,a,e)&&(c=!1,l.push(r)))}}if(o)return void t.info(`Trigger event ${e} did not match any trigger conditions.`);if(c)return void t.info(`Ignoring ${e} trigger event because a trigger was displayed ${a/1e3}s ago.`);l.sort((e,t)=>e.priority-t.priority);let u=l.pop();u!=null&&(t.info(`Firing ${u.type} trigger action ${u.id} from trigger event ${e}.`),this.Tg(u,i,e,r,l),u.ed===0?this.cg(u,i,e,r,l):this.eg.push(window.setTimeout(()=>{this.cg(u,i,e,r,l)},1e3*u.ed)))}changeUser(e=!1){if(this.triggers=[],this.j&&this.j.Nt(z.ct.oE),!e){this.sg=[],this.hg=null,this.og={},this.ng={};for(let e=0;e<this.eg.length;e++)clearTimeout(this.eg[e]);this.eg=[],this.j&&(this.j.Nt(z.ct.iE),this.j.Nt(z.ct.aE),this.j.Nt(z.ct.EE))}}clearData(){this.triggers=[],this.hg=null,this.og={},this.ng={};for(let e=0;e<this.eg.length;e++)clearTimeout(this.eg[e]);this.eg=[]}wg(e,n,r){if(this.hg==null)return!0;if(r===G.qs)return t.info(`Ignoring minimum interval between trigger because it is a test type.`),!0;let i=e.hd;return i??=this.tg,n-this.hg>=1e3*i}Tg(e,t,n,r,i){this.fg(),e.id&&(this.ng[e.id]=this.ng[e.id]||[]);let a={},o;a.jn=t,a.ug=n,r!=null&&(o=r.dt()),a.dg=o;let s=[];for(let e of i)e.id&&s.push(e.id);a.pg=s,e.id&&this.ng[e.id].push(a),this.j&&this.j.ft(z.ct.EE,this.ng)}yg(e,t){this.fg(),e.ad(t),this.hg=t,e.id&&(this.og[e.id]=t),this.j&&(this.j.ft(z.ct.iE,t),this.j.ft(z.ct.aE,this.og))}},Y={i:!1,provider:null,o:()=>(Y.t(),Y.provider||Y.rg(),Y.provider),rg:()=>{Y.provider||(Y.provider=new wt(Q.ee(Z.Xh)??30,J.ea().Nr(),Q.p(),Q.nn(),J.ea()),Q.v(Y.provider))},t:()=>{Y.i||=(Y.rg(),Q.g(Y),!0)},destroy:()=>{Y.provider=null,Y.i=!1}},Tt=class extends De{constructor(e,t,n){super(),this.B=e,this.j=t,this.B=e,this.j=t,this.mite=null,this.yi=null,this.$i=n||null,this.Ri=null,this.D=null,this.Mi=0,this.ji=5,this.Fi=null,this.Ui=!0,this.xi=null,this.Pi=null,this.ki=null,this.Bi=!1,this.Ji=new Map,this.Oi()}Oi(){if(this.j){let e=this.j.lt(z.ct.qi),n=this.j.lt(z.ct.zi);e&&n?(this.mite=e,this.yi=n,t.info(`Restored DUST configuration from storage`)):(e||n)&&(t.warn(`Incomplete DUST configuration in storage, clearing`),this.j.Nt(z.ct.qi),this.j.Nt(z.ct.zi))}}Hi(){this.xi||this.Pi||(this.ki=()=>{this.Bi=!0,this.Ui=!1},window.addEventListener(`beforeunload`,this.ki),this.xi=()=>{this.Bi=!0,this.Ri&&(t.info(`Page unloading, closing real-time connection gracefully`),this.Ui=!1,this.Li())},window.addEventListener(`pagehide`,this.xi),this.Pi=e=>{e.persisted&&this.Wi()&&!this.Ri&&(t.info(`Page restored from bfcache, reconnecting`),this.Bi=!1,this.Ui=!0,this.Mi=0,this.Gi())},window.addEventListener(`pageshow`,this.Pi))}jt(){return this.D}yt(e){this.D=e}Ki(e,t){if(typeof t!=`function`)return null;let n=this.Ji.get(e);return n||(n=new D,this.Ji.set(e,n),Q.q(n)),n.wt(t)}Qi(e,t){let n=this.Ji.get(e);n&&n.removeSubscription(t)}Wi(){return!!(this.mite&&this.yi)}Vi(e,n){let r=()=>{typeof n==`function`&&n()},i=this.B,a=this.j;if(!i||!a)return t.error(`NetworkManager or StorageManager not available`),void r();let o=Q.l();if(o&&!o.Xi())return t.info(`Real-time messaging is not enabled, skipping refresh`),void r();this.Wi()?t.info(`Refreshing real-time messaging configuration`):t.info(`Fetching initial real-time messaging configuration`);let s=i.$({},!0),c=i.A(s,H.H.Yi,!1),l=new Date().valueOf();H.K(a,H.H.Yi,l),je.O({url:`${i.V()}/dust/config`,headers:c,data:s,W:n=>{if(!i.Y(s,n,c))return t.error(`Failed to validate server response for real-time messaging configuration`),void r();i.Z(),n.mite&&n.host?(this.mite=n.mite,this.yi=n.host,t.info(`Received real-time messaging configuration from server`),a.ft(z.ct.qi,n.mite),a.ft(z.ct.zi,n.host),this.Gi(),typeof e==`function`&&e()):(n.mite||t.error(`Missing messaging identifier in server response`),n.host||t.error(`Missing messaging host in server response`),r())},error:e=>{i._(e,`retrieving DUST config`),r()}})}Gi(){let e=Q.l();if(e&&!e.Xi())return void t.info(`Real-time messaging is not enabled, skipping connection`);if(!this.Wi())return void t.error(`Cannot start real-time subscription without configuration`);this.Ri&&(t.info(`Real-time connection already exists, closing before starting new subscription`),this.Li());let n=this.mite,r=this.$i||this.yi;if(!n||!r)return;let i=`${/^https?:\/\//i.test(r)?r:`https://${r}`}/sse?mite=${encodeURIComponent(n)}&attempts=${this.Mi}`;this.$i&&t.info(`Using custom real-time messaging host: ${this.$i}`);try{this.Ri=new EventSource(i),this.Ri.onopen=()=>{t.info(`Real-time messaging connection established`),this.Mi=0,this.Ui=!0},this.Ri.addEventListener(`msg`,e=>{this.Zi(e.data)}),this.Ri.onerror=e=>{let n=this.Ri?.readyState;this.Bi||t.error(`Real-time messaging connection error (readyState: ${n}, eventPhase: ${e?.eventPhase})`),this.Li(),this.Ui&&this.Mi<this.ji?this._i():(this.Mi>=this.ji&&t.error(`Max retry attempts (${this.ji}) reached for real-time messaging, giving up for current session`),this.Ui=!1)}}catch(e){t.error(`Failed to create real-time messaging connection: ${e instanceof Error?e.message:String(e)}`)}}_i(){this.Mi++;let e=Math.min(1e3*2**this.Mi,6e4);t.info(`Retrying real-time messaging connection in ${e}ms (attempt ${this.Mi}/${this.ji})`),this.Fi=window.setTimeout(()=>{this.Fi=null,this.Gi()},e)}Li(){this.Fi!==null&&(window.clearTimeout(this.Fi),this.Fi=null),this.Ri&&(this.Ri.close(),this.Ri=null,t.info(`Real-time messaging connection closed`))}Zi(e){try{let n=JSON.parse(e);
2if(!n.type)return void t.error(`Received real-time message without type: ${JSON.stringify(n)}`);t.info(`Received real-time message of type '${n.type}'`);let r=this.Ji.get(n.type);r&&r.he()>0?r.L(n):t.info(`No subscribers for real-time message type '${n.type}'`)}catch(e){t.error(`Failed to parse real-time message: ${e instanceof Error?e.message:String(e)}`)}}changeUser(e=!1){this.Li(),!e&&this.j?(this.Wi()&&t.info(`Clearing cached real-time messaging configuration for user change`),this.j.Nt(z.ct.qi),this.j.Nt(z.ct.zi),this.mite=null,this.yi=null):e&&this.Wi()&&t.info(`Preserving cached real-time messaging configuration for anonymous->identified user transition`),this.Mi=0,this.Ui=!0}clearData(e=!1){this.Ui=!1,this.Li(),e&&this.j&&(this.Wi()&&t.info(`Clearing cached real-time messaging configuration (wipeData)`),this.j.Nt(z.ct.qi),this.j.Nt(z.ct.zi),this.mite=null,this.yi=null),this.Mi=0}destroy(){this.Ui=!1,this.Li(),this.mite=null,this.Mi=0,this.ki&&=(window.removeEventListener(`beforeunload`,this.ki),null),this.xi&&=(window.removeEventListener(`pagehide`,this.xi),null),this.Pi&&=(window.removeEventListener(`pageshow`,this.Pi),null),this.D&&=(Q.removeSubscription(this.D),null)}},X={i:!1,provider:null,o:()=>{if(X.t(),!X.provider){let e=Q.ee(`dustHost`);X.provider=new Tt(Q.m(),Q.p(),e),Q.v(X.provider)}return X.provider},t:()=>{X.i||=(Q.g(X),!0)},destroy:()=>{X.provider&&X.provider.destroy(),X.provider=null,X.i=!1}};function Et(){let e=Q.l(),t=Q.nn();if(!e||!t)return null;let n=X.o(),r=()=>{if(!n.jt()){n.Hi();let r=t.rn(()=>{e.Xi()&&n.Vi()});return r&&n.yt(r),n.Wi()&&n.Gi(),r}return n.jt()};return e.Xi()?r():(e.Tr(()=>{Q.ao()&&e.Xi()&&(n.Vi(),r())}),null)}var Dt=class e{constructor(e,t,n,r,i){this.endpoint=e,this._o=t,this.publicKey=n,this.hc=r,this.xl=i,this.endpoint=e||null,this._o=t||null,this.publicKey=n||null,this.hc=r||null,this.xl=i||null}dt(){return{e:this.endpoint,c:this._o,p:this.publicKey,u:this.hc,v:this.xl}}static Vo(t){return new e(t.e,_(t.c),t.p,t.u,t.v)}},Ot=class{constructor(e,t){this.h=e,this.j=t,this.h=e,this.j=t}getUserId(){let e=this.j.tu(z.iu.su);if(e==null)return null;let t=e.eu,n=j(t);if(n>F.mr){for(;n>F.mr;)t=t.slice(0,t.length-1),n=j(t);e.eu=t,this.j.uu(z.iu.su,e)}return t}ou(e){let t=this.getUserId()==null;this.j.uu(z.iu.su,new A(e)),t&&this.j.ru(e)}setCustomUserAttribute(e,n){if(this.h.hu(e))return t.info(`Custom Attribute "`+e+`" is blocklisted, ignoring.`),!1;let r={};return r[e]=n,this.nu(F.lu,r,!0)}nu(e,n,r=!1,i=!1){let a=this.j.mu(this.getUserId(),e,n),o=``,s=e,c=n;return r&&(o=` custom`,typeof n==`object`&&(s=Object.keys(n)[0],c=n[s],typeof c==`object`&&(c=JSON.stringify(c,null,2)))),!i&&a&&t.info(`Logged${o} attribute ${s} with value ${c}`),a}Yn(e,n,r,a,o){this.nu(`push_token`,e,!1,!0),this.nu(`custom_push_public_key`,r,!1,!0),this.nu(`custom_push_user_auth`,a,!1,!0),this.nu(`custom_push_vapid_public_key`,o,!1,!0);let s=i.Us.Rs,c=new i(s,t),l=new Dt(e,n,r,a,o);this.j.ft(z.ct.Wo,l.dt()),c.setItem(s.Fs.cu,s.me,!0)}Hn(e){if(this.nu(`push_token`,null,!1,!0),this.nu(`custom_push_public_key`,null,!1,!0),this.nu(`custom_push_user_auth`,null,!1,!0),this.nu(`custom_push_vapid_public_key`,null,!1,!0),e){let e=i.Us.Rs,n=new i(e,t);this.j.ft(z.ct.Wo,!1),n.setItem(e.Fs.cu,e.me,!1)}}},Z={Ph:`allowCrawlerActivity`,Wh:`baseUrl`,Vh:`noCookies`,Kh:`devicePropertyAllowlist`,Da:`disablePushTokenMaintenance`,$h:`enableLogging`,Yh:`enableSdkAuthentication`,Ca:`manageServiceWorkerExternally`,Xh:`minimumIntervalBetweenTriggerActionsInSeconds`,Zh:`sessionTimeoutInSeconds`,Qh:`appVersion`,Ia:`appVersionNumber`,_a:`serviceWorkerLocation`,Ba:`safariWebsitePushId`,Ea:`localization`,er:`contentSecurityNonce`,re:`allowUserSuppliedJavascript`,Jo:`inAppMessageZIndex`,To:`openInAppMessagesInNewTab`,tn:`openCardsInNewTab`,Oh:`requireExplicitInAppMessageDismissal`,Na:`doNotLoadFontAwesome`,Oa:`deviceId`,Aa:`serviceWorkerScope`,zi:`dustHost`,Ta:`sdkFlavor`},Q=new class{constructor(){this.Pn=``,this.Ra=``,this.Pa=void 0,this.La=null,this.Dn=null,this.B=null,this.au=null,this.h=null,this.C=null,this.j=null,this.Cs=null,this.Ua=``,this.isInitialized=!1,this.Wa=!1,this.Va=new D,this.Fa=new D,this.options={},this.Ka=[],this.Ga=[],this.Mr=[],this.Ra=`6.4.0`}$a(e){this.Va.wt(e)}Lh(e){this.Fa.wt(e)}initialize(n,r){if(this.ao())return t.info(`Braze has already been initialized with an API key.`),!0;this.options=r||{};let i=this.ee(Z.$h),l=bt(yt.Ha());if(l&&l.brazeLogging===`true`&&(i=!0),t.init(i),t.info(`Initialization Options: ${JSON.stringify(this.options,null,2)}`),n==null||n===``||typeof n!=`string`)return t.error(`Braze requires a valid API key to be initialized.`),!1;this.Pn=n;let u=this.ee(Z.Wh);if(u==null||u===``||typeof u!=`string`)return t.error(`Braze requires a valid baseUrl to be initialized.`),!1;!1===/^https?:/.test(u)&&(u=`https://${u}`);let f=u;if(u=document.createElement(`a`),u.href=f,u.pathname===`/`&&(u=`${u}api/v3`),this.Ua=u.toString(),R.Ja&&!this.ee(Z.Ph))return t.info(`Ignoring activity from crawler bot `+navigator.userAgent),this.Wa=!0,!1;let p=this.ee(Z.Vh)||!1;if(this.j=Ve.Ya(n,p),p&&this.j.Xa(n),new B.ne(null,!0).jr(z.ie))return t.info(`Ignoring all activity due to previous opt out`),this.Wa=!0,!1;for(let e of d(this.options))o(a).indexOf(e)===-1&&t.warn(`Ignoring unknown initialization option '${e}'.`);let m=[`mparticle`,`wordpress`,`tealium`];if(this.ee(Z.Ta)!=null){let e=this.ee(Z.Ta);m.indexOf(e)===-1?t.error(`Invalid sdk flavor passed: `+e):this.Pa=e}let h=this.ee(a.Kh);if(h!=null)if(c(h)){let e=[];for(let t=0;t<h.length;
2t++)s(V,h[t],`devicePropertyAllowlist contained an invalid value.`,`DeviceProperties`)&&e.push(h[t]);h=e}else t.error(`devicePropertyAllowlist must be an array. Defaulting to all properties.`),h=null;let g=this.ee(Z.Oa);if(g){let e=new A(g);this.j.uu(z.iu.Oa,e)}this.Dn=new ke(this.j,h),this.h=new ze(this.j),this.Cs=new Ot(this.h,this.j),this.C=new Be(this.j,this.Cs,this.h,this.ee(Z.Zh));let _=new D;return this.La=new Ee(this.j,this.ee(Z.Yh),_),this.q(_),this.B=new Ne(this.Dn,this.j,this.La,this.Cs,this.C,this.h,this.Pn,this.Ua,this.Ra,this.Pa||``,this.ee(Z.Qh),this.ee(Z.Ia)),this.au=new Le(this.Pn,this.Ua,this.C,this.Dn,this.Cs,this.h,this.j,e=>{if(this.ao())for(let t of this.gr())t.N(e)},this.La,this.B),this.au.initialize(),p||this.j.Za(),t.info(`Initialized for the Braze backend at "${this.ee(Z.Wh)}" with API key "${this.Pn}".`),Y.t(),Et(),this.h.$e(()=>{var t;this.isInitialized&&(t=this.h)!=null&&t.Te()&&e(()=>import(`./refresh-feature-flags-BxEuUClQ.js`).then(e=>{this.isInitialized&&(0,e.default)()}),[])}),this.au.rn(()=>{var t;this.isInitialized&&(t=this.h)!=null&&t.Te()&&e(()=>import(`./refresh-feature-flags-BxEuUClQ.js`).then(e=>{this.isInitialized&&(0,e.default)(void 0,void 0,!0)}),[])}),this.Va.L(this.options),this.isInitialized=!0,window.dispatchEvent(new CustomEvent(`braze.initialized`)),!0}destroy(e){if(t.destroy(),this.ao()){this.Fa.L(),this.Fa.removeAllSubscriptions();for(let e of this.Ka)e.destroy();this.Ka=[];for(let e of this.Ga)e.clearData(!1);this.B&&this.B.fo(),this.Ga=[],this.removeAllSubscriptions(),this.Mr=[],this.au!=null&&this.au.destroy(),this.au=null,this.La=null,this.Dn=null,this.B=null,this.h=null,this.C=null,this.Cs=null,this.options={},this.Pa=void 0,this.isInitialized=!1,this.Wa=!1,e&&(this.j=null)}}rr(){return!this.Qa()&&(!!this.ao()||(console.warn(`Braze must be initialized before calling methods.`),!1))}Ma(){return this.Pn}Sr(){return this.La}V(){return this.Ua}de(){return this.Dn}m(){return this.B}ee(e){return this.options[e]}gr(){return this.Ga}nn(){return this.au}l(){return this.h}u(){return this.C}p(){return this.j}br(){if(this.Cs&&this.au)return new F(this.Cs,this.au)}ir(){return this.Cs}nr(){return!0===this.ee(Z.re)}g(e){let t=!1;for(let n of this.Ka)n===e&&(t=!0);t||this.Ka.push(e)}v(e){let t=!1;for(let n of this.Ga)n.constructor===e.constructor&&(t=!0);e instanceof De&&!t&&this.Ga.push(e)}q(e){e instanceof D&&this.Mr.push(e)}removeAllSubscriptions(){if(this.rr())for(let e of this.Mr)e.removeAllSubscriptions()}removeSubscription(e){if(this.rr())for(let t of this.Mr)t.removeSubscription(e)}ce(e){this.Wa=e}ao(){return this.isInitialized}Qa(){return this.Wa}tr(e,t){return this.rr()?X.o().Ki(e,t):null}Vs(){return this.Ra}},$={rt:(e,n,r)=>{let i=new Fe,a=Q.u();if(!a)return t.info(`Not logging event with type "${e}" because the current session ID could not be found.`),i;let o=a.Fo();return i.ue.push(new O(r||Q.ir()?.getUserId(),e,new Date().valueOf(),o,n)),i.W=Q.p()?.Go(i.ue)||!1,i}};export{t as $,z as A,ie as B,Ye as C,je as D,Pe as E,be as F,S as G,k as H,_e as I,f as J,x as K,N as L,L as M,F as N,H as O,fe as P,n as Q,P as R,Xe as S,U as T,D as U,j as V,w as W,i as X,d as Y,r as Z,W as _,Y as a,Ge as b,bt as c,G as d,rt as f,$e as g,et as h,Dt as i,R as j,De as k,mt as l,tt as m,Z as n,J as o,nt as p,c as q,Q as r,xt as s,$ as t,yt as u,Qe as v,He as w,qe as x,Ze as y,M as z}; 3//# sourceMappingURL=event-logger-Bevdge5G.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.