1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["dashboard-static/push-manager-factory-CkKg32XS.js","dashboard-static/rolldown-runtime-DLzXii5c.js","dashboard-static/refresh-feature-flags-BmV-CkXS.js"])))=>i.map(i=>d[i]); 2(function(){try{var e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{};e.SENTRY_RELEASE={id:`29ae0319a6961340fd1207c714d43b4796313dfd`};var t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]=`e98c6da5-f7dd-40a7-9360-c949f80a7876`,e._sentryDebugIdIdentifier=`sentry-dbid-e98c6da5-f7dd-40a7-9360-c949f80a7876`)}catch{}})();import{t as e}from"./preload-helper-C1QaZmeS.js";var t={init:function(e){e===void 0&&t.zg!==void 0||(t.zg=!!e),t.l||=!0},destroy:function(){t.l=!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+` (v5.9.1)`;t.vd==null?console.warn(n):t.vd(n)}},error:function(e){if(t.zg){let n=`Braze SDK Error: `+e+` (v5.9.1)`;t.vd==null?console.error(n):t.vd(n)}}},n={CustomEvent:`ce`,Pr:`p`,wc:`pc`,Ac:`ca`,Su:`i`,qu:`ie`,ts:`cci`,rs:`ccic`,Mt:`ccc`,Wt:`ccd`,Fl:`ss`,Dl:`se`,Ki:`si`,Li:`sc`,Qi:`sbc`,Mc:`sfe`,Do:`iec`,bc:`lr`,vc:`uae`,ss:`ci`,Ot:`cc`,Sc:`lcaa`,yc:`lcar`,Hn:`inc`,On:`add`,Gn:`rem`,$n:`set`,Bn:`ncam`,jc:`sgu`,yr:`ffi`,ro:`bi`,ct:`bc`},r={Fr:`feed_displayed`,Dc:`content_cards_displayed`},i={ce:function(){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()}},a=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.Ms){let n=e;r.database.Ms.hasOwnProperty(e)&&!t.objectStoreNames.contains(r.database.Ms[n])&&t.createObjectStore(r.database.Ms[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)}})}cr(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)}ge(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)}})}Ns(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.Ms){let n=t;this.database.Ms.hasOwnProperty(t)&&this.database.Ms[n]!==this.database.Ms.pe&&e.push(this.database.Ms[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)}})}};a.Ls={Fs:{Sd:`AppboyServiceWorkerAsyncStorage`,VERSION:6,Ms:{Nu:`data`,jr:`pushClicks`,cu:`pushSubscribed`,Cd:`fallbackDevice`,Js:`cardUpdates`,pe:`optOut`,kr:`pendingData`,yh:`sdkAuthenticationSignature`},be:1}};var o={Yo:`allowCrawlerActivity`,Zo:`baseUrl`,Wh:`noCookies`,Vh:`devicePropertyAllowlist`,Da:`disablePushTokenMaintenance`,$h:`enableLogging`,Yh:`enableSdkAuthentication`,Ca:`manageServiceWorkerExternally`,Xh:`minimumIntervalBetweenTriggerActionsInSeconds`,Zh:`sessionTimeoutInSeconds`,Qh:`appVersion`,Ea:`appVersionNumber`,_a:`serviceWorkerLocation`,Ba:`safariWebsitePushId`,Zn:`localization`,er:`contentSecurityNonce`,re:`allowUserSuppliedJavascript`,Go:`inAppMessageZIndex`,Ko:`openInAppMessagesInNewTab`,en:`openNewsFeedCardsInNewTab`,mh:`requireExplicitInAppMessageDismissal`,Ia:`doNotLoadFontAwesome`,Na:`deviceId`,Aa:`serviceWorker
2Scope`,Oa:`sdkFlavor`,tn:`openCardsInNewTab`};function s(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 c(e,n,r,i){let a=s(e);return a.indexOf(n)!==-1||(t.error(`${r} Valid values from ${i} are "${a.join(`"/"`)}".`),!1)}function l(e){return Array.isArray?Array.isArray(e):Object.prototype.toString.call(e)===`[object Array]`}function u(e){return Object.prototype.toString.call(e)===`[object Date]`}function d(e){return Object.prototype.toString.call(e)===`[object Object]`}function f(e,...t){e??=[];let n=[],r=arguments.length;for(let t=0,i=e.length;t<i;t++){let i=e[t];if(n.indexOf(i)!==-1)continue;let a=1;for(a=1;a<r&&arguments[a].indexOf(i)!==-1;a++);a===r&&n.push(i)}return n}function p(e){let t=[];for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t}function m(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(!m(e[o],t[o]))return!1}else{let n=p(e),r;if(o=n.length,p(t).length!==o)return!1;for(;o--;)if(r=n[o],!Object.prototype.hasOwnProperty.call(t,r)||!m(e[r],t[r]))return!1}return i.pop(),a.pop(),!0}function h(e,t=!1){let n=e/1e3;return t&&(n=Math.floor(n)),n}function g(e){return 1e3*e}function _(e){if(e==null)return null;let t=parseInt(e.toString());return isNaN(t)?null:new Date(1e3*t)}function v(e){return e!=null&&u(e)?e.toISOString().replace(/\.[0-9]{3}Z$/,``):e}function y(e){return e==null||e===``?null:new Date(e)}function b(e){return e==null||e===``?new Date().valueOf():e}function x(e){return(new Date().valueOf()-e.valueOf())/1e3}function S(e){return(e.valueOf()-new Date().valueOf())/1e3}var ee=`inAppMessage must be an InAppMessage object`,C=`must be a Card object`,w=`logCustomEvent`,T=`setCustomUserAttribute`,te=`Braze must be initialized before calling methods.`,ne=72e5,E=`data-update-subscription-id`,D=`Banners are disabled. Make sure you have at least one campaign and relaunch the app.`,O=class{constructor(){this.Mi={}}Dt(e){if(typeof e!=`function`)return null;let t=i.ce();return this.Mi[t]=e,t}removeSubscription(e){delete this.Mi[e]}removeAllSubscriptions(){this.Mi={}}hc(){return Object.keys(this.Mi).length}X(e){let t=[];for(let n in this.Mi){let r=this.Mi[n];t.push(r(e))}return t}};function k(e){let t=e?.ft(B.gt._E),n;return t&&(n={label:t.l,name:t.a}),n}var A=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=b(n),this.sessionId=r,this.data=i}Nr(){let e={name:this.type,time:h(this.time),data:this.data||{},session_id:this.sessionId};this.userId!=null&&(e.user_id=this.userId);let t=Q.Sr()?.jh()||!1;if(!e.user_id&&!t){let t=k(Q.j());t&&(e.alias=t)}return e}bt(){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 RE(e){return e!=null&&d(e)&&e.t!=null&&e.t!==``}static Rn(t){return new e(t.u,t.t,t.ts,t.s,t.d)}},j=e=>e instanceof Error?e.message:String(e),M=class e{constructor(e,t,n){this.eu=e,e??=i.ce(),!n||isNaN(n)?this.Gl=new Date().valueOf():this.Gl=n,this.eu=e,this.ql=new Date().valueOf(),this.kl=t}bt(){return`g:${encodeURIComponent(this.eu)}|e:${this.kl}|c:${this.Gl}|l:${this.ql}`}static hE(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 Rn(n){let r;if(typeof n==`string`)try{let t=n.split(`|`);if(!l(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.ql=a(t[3])}catch(e){t.info(`Unable to parse cookie string ${n}, failed with error: ${j(e)}`)}else{if(n==null||n.g==null)return null;r=new e(n.g,n.e,n.c),r.ql=n.l}return r}};function re(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 ie(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 N={types:{io:`container`,logCustomEvent:`logCustomEvent`,setEmailNotificationSubscriptionType:`setEmailNotificationSubscriptionType`,setPushNotificationSubscriptionType:`setPushNotificationSubscriptionType`,setCustomUserAttribute:`setCustomUserAttribute`,requestPushPermission:`requestPushPermission`,addToSubscriptionGroup:`addToSubscriptionGroup`,removeFromSubscriptionGroup:`removeFromSubscriptionGroup`,addToCustomAttributeArray:`addToCustomAttributeArray`,removeFromCustomAttributeArray:`removeFromCustomAttributeArray`,co:`openLink`,mo:`openLinkInWebView`},properties:{type:`type`,eo:`steps`,so:`args`}},ae={Mr:`unknownBrazeAction`,wr:`noPushPrompt`},oe=(e,t)=>{switch(e){case ae.Mr:return`${t} contains an unknown braze action type and will not be displayed.`;case ae.wr:return`${t} contains a push prompt braze action, but is not eligible for a push prompt. Ignoring.`;default:return``}};function se(e){try{let n=e.match(he),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=ie(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} : ${j(n)}`);return}}function ce(e,t){let n=!1;if(t){for(let r of t)if(n||=e(r),n)return!0}return!1}function le(e){let t=N.properties.type,n=N.properties.eo;try{if(e==null)return!0;let r=e[t];return r===N.types.io?ce(le,e[n]):!Te(r)}catch{return!0}}function ue(e){if(!e||!we(e))return!1;let t=N.properties.type,n=N.properties.eo,r=e[t];return r===N.types.io?ce(ue,e[n]):r===N.types.requestPushPermission}var de=/^[^\x00-\x1F\x22]+$/,fe=/[$.]/,pe=[`$add`,`$update`,`$remove`,`$identifier_key`,`$identifier_value`,`$new_object`,`$time`,`$google_ad_personalization`,`$google_ad_user_data`],me=new RegExp(/^.+@.+\..+$/),he=/^brazeActions:\/\/v\d+\//,ge=/^[^\s]+$/;function P(e,n,r){let i=e!=null&&typeof e==`string`&&(e===``||e.match(de)!=null);return i||t.error(`Cannot ${n} because ${r} "${e}
2" is invalid.`),i}function _e(e){return e!=null&&e.match(fe)&&pe.indexOf(e)===-1&&t.warn(`Custom attribute keys cannot contain '$' or '.'`),P(e,`set custom user attribute`,`the given key`)}function ve(e){let t=typeof e;return e==null||t===`number`||t===`boolean`||u(e)||t===`string`}function ye(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(l(e)&&l(n)){for(let t=0;t<e.length&&t<n.length;t++)if(u(e[t])&&(n[t]=v(e[t])),!ye(e[t],n[t],a))return!1}else{if(!d(e))return ve(e);for(let t of p(e)){let r=e[t];if(i&&!_e(t)||(u(r)&&(n[t]=v(r)),!ye(r,n[t],a)))return!1}}return!0}function be(e,n,r,i,a){let o;return o=d(e)||l(e)?ye(e,n,a?1:-1):ve(e),o||t.error(`Cannot ${r} because ${i} "${e}" is invalid.`),o}function F(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 xe(e,n,r,i,a){if(e??={},typeof e!=`object`||l(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 c=JSON.stringify(e);if(re(c)>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(c)}catch{return t.error(`Could not ${i} because ${r} did not contain valid JSON.`),[!1,null]}for(let t in e){if(n===`setCustomUserAttribute`&&!_e(t)||!P(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(u(r)&&(d[t]=v(r)),!be(r,d[t],i,`the ${a} property "${t}"`,n===`setCustomUserAttribute`))return[!1,null]}return[!0,d]}function Se(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(!P(t,`set custom user attribute "${e}"`,`the element in the given array`))return[!1,!1];r=!0}else{if(!d(t)||r)return a(),[!1,!1];if(!xe(t,`setCustomUserAttribute`,`attribute value`,`set custom user attribute "${e}"`,`custom user attribute`))return[!1,!1];i=!0}return[r,i]}function Ce(e){return typeof e==`string`&&e.toLowerCase().match(me)!=null}function we(e){if(!(N.properties.type in e))return!1;switch(e[N.properties.type]){case N.types.io:if(N.properties.eo in e)return!0;break;case N.types.logCustomEvent:case N.types.setEmailNotificationSubscriptionType:case N.types.setPushNotificationSubscriptionType:case N.types.setCustomUserAttribute:case N.types.addToSubscriptionGroup:case N.types.removeFromSubscriptionGroup:case N.types.addToCustomAttributeArray:case N.types.removeFromCustomAttributeArray:case N.types.co:case N.types.mo:if(N.properties.so in e)return!0;break;case N.types.requestPushPermission:return!0;default:return!1}return!1}function Te(e){let t=!1;return Object.keys(N.types).forEach(n=>{N.types[n]!==e.toString()||(t=!0)}),t}function Ee(e){return ge.test(e)}var I=class e{constructor(e,t){this.Cs=e,this.Fi=t,this.Cs=e,this.Fi=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!F(e,`add alias`,`the alias`,!1)||e.length<=0?(t.error(`addAlias requires a non-empty alias`),!1):!F(n,`add alias`,`the label`,!1)||n.length<=0?(t.error(`addAlias requires a non-empty label`),!1):this.Fi.Cn(e,n).tt}setFirstName(e){return!!F(e,`set first name`,`the firstName`,!0)&&this.Cs.nu(`first_name`,e)}setLastName(e){return!!F(e,`set last name`,`the lastName`,!0)&&this.Cs.nu(`last_name`,e)}setEmail(e){return e===null||Ce(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&&!c(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!!F(e,`set country`,`the country`,!0)&&this.Cs.nu(`country`,e)}setHomeCity(e){return!!F(e,`set home city`,`the homeCity`,!0)&&this.Cs.nu(`home_city`,e)}setLanguage(e){return!!F(e,`set language`,`the language`,!0)&&this.Cs.nu(`language`,e)}setEmailNotificationSubscriptionType(t){return!!c(e.NotificationSubscriptionTypes,t,`Email notification setting "${t}" is not a valid subscription type.`,`User.NotificationSubscriptionTypes`)&&this.Cs.nu(`email_subscribe`,t)}setPushNotificationSubscriptionType(t){return!!c(e.NotificationSubscriptionTypes,t,`Push notification setting "${t}" is not a valid subscription type.`,`User.NotificationSubscriptionTypes`)&&this.Cs.nu(`push_subscribe`,t)}setPhoneNumber(n){return!!F(n,`set phone number`,`the phoneNumber`,!0)&&(n===null||n.match(e.Fn)?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.Fi.setLastKnownLocation(this.Cs.getUserId(),e,n,i,r,a).tt)}setCustomUserAttribute(e,t,r){if(!_e(e))return!1;let i=t=>{let[n]=xe(t,T,`attribute value`,`set custom user attribute "${e}"`,`custom user attribute`);return n};if(l(t)){let[r,a]=Se(e,t);if(!r&&!a&&t.length!==0)return!1;if(r||t.length===0)return this.Fi.Ln(n.$n,e,t).tt;for(let e of t)if(!i(e))return!1}else if(d(t)){if(!i(t))return!1;if(r)return this.Fi.Ln(n.Bn,e,t).tt}else if(!(t!==void 0&&ve(t))||(u(t)&&(t=v(t)),typeof t==`string`&&!P(t,`set custom user attribute "${e}"`,`the element in the given array`)))return!1;return this.Cs.setCustomUserAttribute(e,t)}addToCustomAttributeArray(e,t){return!!P(e,`add to custom user attribute array`,`the given key`)&&!(t!=null&&!P(t,`add to custom user attribute array`,`the given value`))&&this.Fi.Ln(n.On,e,t).tt}removeFromCustomAttributeArray(e,t){return!!P(e,`remove from custom user attribute array`,`the given key`)&&!(t!=null&&!P(t,`remove from custom user attribute array`,`the given value`))&&this.Fi.Ln(n.Gn,e,t).tt}incrementCustomUserAttribute(e,r){if(!P(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.Fi.Ln(n.Hn,e,i).tt}setCustomLocationAttribute(e,n,r){return!!P(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>
2180||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.Fi.Kn(e,n,r).tt)}addToSubscriptionGroup(n){return!F(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.Fi.Mn(n,e.Yn.SUBSCRIBED).tt}removeFromSubscriptionGroup(n){return!F(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.Fi.Mn(n,e.Yn.UNSUBSCRIBED).tt}setLineId(n){return F(n,`set LINE user ID`,`the ID`,!0)&&n?.length!==0?n&&n.length>e.Jn?(t.error(`Rejected LINE user ID ${n} because it is longer than ${e.Jn} characters.`),!1):this.Cs.nu(`native_line_id`,n):(t.error(`setLineId requires a non-empty ID`),!1)}An(e,t,n,r,i){this.Cs.An(e,t,n,r,i),this.Fi.Qn()}xn(e){this.Cs.xn(e)}};I.Genders={MALE:`m`,FEMALE:`f`,OTHER:`o`,UNKNOWN:`u`,NOT_APPLICABLE:`n`,PREFER_NOT_TO_SAY:`p`},I.NotificationSubscriptionTypes={OPTED_IN:`opted_in`,SUBSCRIBED:`subscribed`,UNSUBSCRIBED:`unsubscribed`},I.Fn=/^[0-9 .\\(\\)\\+\\-]+$/,I.Yn={SUBSCRIBED:`subscribed`,UNSUBSCRIBED:`unsubscribed`},I.Xn=`user_id`,I.lu=`custom`,I.ur=997,I.Jn=33;var De=class{constructor(){}ef(){}ff(){}ec(e){}static nf(e,t){if(e&&t){if(e=e.toLowerCase(),l(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}}},L={rO:`Chrome`,eO:`Edge`,oO:`Opera`,Bg:`Safari`,OO:`Firefox`},R={xg:`Android`,ao:`iOS`,Pg:`Mac`,Og:`Windows`},Oe=class e extends De{constructor(){if(super(),this.userAgentData=navigator.userAgentData,this.browser=null,this.version=null,this.userAgentData){let e=this.Bc();this.browser=e.browser||`Unknown Browser`,this.version=e.version||`Unknown Version`}this.OS=null}ef(){return this.browser}ff(){return this.version}ec(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)}Bc(){let e={},t=this.userAgentData.brands;if(t&&t.length)for(let n of t){let t=this.Vc(L),r=n.brand.match(t);if(r&&r.length>0){e.browser=r[0],e.version=n.version;break}}return e}Vc(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()}},ke=class e extends De{constructor(){super(),this.fd=e.Bc(navigator.userAgent||``)}ef(){return this.fd[0]||`Unknown Browser`}ff(){return this.fd[1]||`Unknown Version`}ec(t){for(let n=0;n<t.length;n++){let r=t[n].string,i=e.nf(r,t[n]);if(i)return i===R.Pg&&navigator.maxTouchPoints>1&&(i=R.ao),Promise.resolve(i)}return Promise.resolve(navigator.platform)}static Bc(e){let t,n=e.match(/(samsungbrowser|tizen|roku|konqueror|icab|crios|opera|ucbrowser|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]===L.rO&&(t=e.match(/\b(OPR|Edge|EdgA|Edg|UCBrowser)\/(\.?\d+(\.\d+)*)/),t!=null))return t=t.slice(1),t[0]=t[0].replace(`OPR`,L.oO),t[0]=t[0].replace(`EdgA`,L.eO),t[0]===`Edg`&&(t[0]=L.eO),[t[0],t[1]];if(n[1]===L.Bg&&(t=e.match(/\b(EdgiOS)\/(\.?\d+(\.\d+)*)/),t!=null))return t=t.slice(1),t[0]=t[0].replace(`EdgiOS`,L.eO),[t[0],t[1]];if(n=n[2]?[n[1],n[2]]:[null,null],n[0]===L.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]===L.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]=L.rO),e===`tizen`&&(n[0]=`Samsung Smart TV`,n[1]=null),e===`samsungbrowser`&&(n[0]=`Samsung Browser`)}return n}},Ae=class e{constructor(){let t=navigator.userAgentData?Oe:ke;this.Sg=new t,this.userAgent=navigator.userAgent,this.browser=this.Sg.ef(),this.version=this.Sg.ff(),this.OS=null,this.ec().then(e=>this.OS=e);let n=navigator;this.language=(n.userLanguage||n.language||n.browserLanguage||n.systemLanguage||``).toLowerCase(),this.Ja=e.vg(this.userAgent)}fE(){return this.browser===L.Bg}ic(){return this.OS||null}ec(){return this.OS?Promise.resolve(this.OS):this.Sg.ec(e.kg).then(e=>(this.OS=e,e))}static vg(e){e=e.toLowerCase();let t=[`googlebot`,`bingbot`,`slurp`,`duckduckbot`,`baiduspider`,`yandex`,`facebookexternalhit`,`sogou`,`ia_archiver`,`https://github.com/prerender/prerender`,`aolbuild`,`bingpreview`,`msnbot`,`adsbot`,`mediapartners-google`,`teoma`,`taiko`];for(let n=0;n<t.length;n++)if(e.indexOf(t[n])!==-1)return!0;return!1}};Ae.kg=[{string:navigator.platform,cf:`Win`,identity:R.Og},{string:navigator.platform,cf:`Mac`,identity:R.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:R.ao},{string:navigator.platform,cf:`Pike v`,identity:R.ao},{string:navigator.userAgent,cf:[`Web0S`],identity:`WebOS`},{string:navigator.userAgent,cf:`Tizen`,identity:`Tizen`},{string:navigator.platform,cf:[`Linux armv7l`,`Android`],identity:R.xg},{string:navigator.userAgent,cf:[`Android`],identity:R.xg},{string:navigator.platform,cf:`Linux`,identity:`Linux`}];var z=new Ae,B={iu:{su:`ab.storage.userId`,Na:`ab.storage.deviceId`,Nl:`ab.storage.sessionId`},gt:{ac:`ab.test`,tE:`ab.storage.events`,eE:`ab.storage.attributes`,sE:`ab.storage.attributes.anonymous_user`,oc:`ab.storage.device`,pu:`ab.storage.sdk_metadata`,Ru:`ab.storage.session_id_for_cached_metadata`,zn:`ab.storage.pushToken`,qi:`ab.storage.newsFeed`,zi:`ab.storage.lastNewsFeedRefresh`,Zt:`ab.storage.cardImpressions`,ml:`ab.storage.serverConfig`,rE:`ab.storage.triggers`,oE:`ab.storage.triggers.ts`,Hl:`ab.storage.messagingSessionStart`,Hs:`ab.storage.cc`,Os:`ab.storage.ccLastFullSync`,Qs:`ab.storage.ccLastCardUpdated`,Hu:`ab.storage.globalRateLimitCurrentTokenCount`,_u:`ab.storage.dynamicRateLimitCurrentTokenCount`,Kt:`ab.storage.ccClicks`,Yt:`ab.storage.ccImpressions`,Vt:`ab.storage.ccDismissals`,nE:`ab.storage.lastDisplayedTriggerTimesById`,aE:`ab.storage.lastDisplayedTriggerTime`,iE:`ab.storage.triggerFireInstancesById`,qh:`ab.storage.signature`,EE:`ab.storage.brazeSyncRetryCount`,Zs:`ab.storage.sdkVersion`,Xe:`ab.storage.ff`,Ge:`ab.storage.ffImpressions`,Ze:`ab.storage.ff
2LastRefreshAt`,Ve:`ab.storage.ff.sessionId`,lE:`ab.storage.lastReqToEndpoint`,SE:`ab.storage.requestAttempts`,Kr:`ab.storage.deferredIam`,Ku:`ab.storage.lastSdkReq`,_E:`ab.storage.alias`,vt:`ab.storage.banners`,Nt:`ab.storage.banners.impressions`,yt:`ab.storage.banners.sessionId`},me:`ab.optOut`},V=class e{constructor(e,t){this.uE=e,this.cE=t,this.uE=e,this.cE=t}Ha(t){let n=p(B.iu),r=new e.se(t);for(let e of n)r.remove(B.iu[e])}uu(e,t){let n=null;t!=null&&t instanceof M&&(n=t.bt()),this.uE.store(e,n)}TE(e){let t=this.tu(e);t!=null&&(t.ql=new Date().valueOf(),this.uu(e,t))}tu(e){let t=this.uE.gr(e),n=(e=>{let t;try{t=JSON.parse(e)}catch{t=null}return t})(t),r;if(n)r=M.Rn(n)||null,r&&this.uu(e,r);else{let n=M.hE(t);r=M.Rn(n)||null,n!==t&&r&&this.uu(e,r)}return r}Jl(e){this.uE.remove(e)}Xa(){let e=p(B.iu),t;for(let n of e)t=this.tu(B.iu[n]),t!=null&&this.uu(B.iu[n],t)}Vo(e){let t;if(e==null||e.length===0)return!1;t=l(e)?e:[e];let n=this.cE.gr(B.gt.tE);n!=null&&l(n)||(n=[]);for(let e=0;e<t.length;e++)n.push(t[e].bt());return this.cE.store(B.gt.tE,n)}Al(e){return e!=null&&this.Vo([e])}AE(){let e=this.cE.gr(B.gt.tE);this.cE.remove(B.gt.tE),e??=[];let t=[],r=!1,i=null;if(l(e))for(let n=0;n<e.length;n++)A.RE(e[n])?t.push(A.Rn(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 A(null,n.qu,new Date().valueOf(),null,{e:a}))}return t}Bt(e,t){return!!c(B.gt,e,`StorageManager cannot store object.`,`STORAGE_KEYS.OBJECTS`)&&this.cE.store(e,t)}ft(e){return!!c(B.gt,e,`StorageManager cannot retrieve object.`,`STORAGE_KEYS.OBJECTS`)&&this.cE.gr(e)}Ut(e){return!!c(B.gt,e,`StorageManager cannot remove object.`,`STORAGE_KEYS.OBJECTS`)&&(this.cE.remove(e),!0)}clearData(){let e=p(B.iu),t=p(B.gt);for(let t=0;t<e.length;t++){let n=e[t];this.uE.remove(B.iu[n])}for(let e=0;e<t.length;e++){let n=t[e];this.cE.remove(B.gt[n])}}gE(e){return e||B.gt.sE}Cu(e){let t=this.cE.gr(B.gt.eE);t??={};let n=this.gE(e[I.Xn]),r=t[n];for(let i in e)i!==I.Xn&&(t[n]==null||r&&r[i]==null)&&this.mu(e[I.Xn],i,e[i])}mu(e,t,n){let r=this.cE.gr(B.gt.eE);r??={};let i=this.gE(e),a=r[i];if(a??(a={},e!=null&&(a[I.Xn]=e)),t===I.lu){a[t]??(a[t]={});for(let e in n)a[t][e]=n[e]}else a[t]=n;return r[i]=a,this.cE.store(B.gt.eE,r)}OE(){let e=this.cE.gr(B.gt.eE);this.cE.remove(B.gt.eE);let t=[];for(let n in e)e[n]!=null&&t.push(e[n]);return t}ru(e){let t=this.cE.gr(B.gt.eE);if(t!=null){let n=this.gE(null),r=t[n];r!=null&&(t[n]=void 0,this.cE.store(B.gt.eE,t),r[I.Xn]=e,this.Cu(r))}let n=this.tu(B.iu.Nl),r=null;n!=null&&(r=n.eu);let i=this.AE();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.Al(n)}}IE(){return this.cE.dE}};V.gc=class{constructor(e){this.an=e,this.an=e,this.dE=z.fE()?3:10}bE(e){return e+`.`+this.an}store(e,n){let r={v:n};try{return localStorage.setItem(this.bE(e),JSON.stringify(r)),!0}catch(e){return t.info(`Storage failure: `+j(e)),!1}}gr(e){try{let t=null,n=localStorage.getItem(this.bE(e));return n!=null&&(t=JSON.parse(n)),t==null?null:t.v}catch(e){return t.info(`Storage retrieval failure: `+j(e)),null}}remove(e){try{localStorage.removeItem(this.bE(e))}catch(e){return t.info(`Storage removal failure: `+j(e)),!1}}},V.uc=class{constructor(){this.KE={},this.mE=5242880,this.dE=3}store(e,n){let r={value:n},i=this.YE(n);return i>this.mE?(t.info(`Storage failure: object is â`+i+` bytes which is greater than the max of `+this.mE),!1):(this.KE[e]=r,!0)}YE(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}gr(e){let t=this.KE[e];return t==null?null:t.value}remove(e){this.KE[e]=null}},V.se=class{constructor(e,t){this.an=e,this.NE=t,this.an=e,this.GE=this.DE(),this.CE=576e3,this.NE=!!t}bE(e){return this.an==null?e:e+`.`+this.an}DE(){let e=0,t=document.location.hostname,n=t.split(`.`);for(;e<n.length-1&&document.cookie.indexOf(`ab._gd=ab._gd`)===-1;)e++,t=`.`+n.slice(-1-e).join(`.`),document.cookie=`ab._gd=ab._gd;domain=`+t+`;`;return document.cookie=`ab._gd=;expires=`+new Date(0).toUTCString()+`;domain=`+t+`;`,t}le(){let e=new Date;return e.setTime(e.getTime()+60*this.CE*1e3),e.getFullYear()}ME(){let e=s(B.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.an)===-1&&this.pE(e)}}}store(e,n){this.ME();let r=new Date;r.setTime(r.getTime()+60*this.CE*1e3);let i=`expires=`+r.toUTCString(),a=`domain=`+this.GE,o;o=this.NE?n:encodeURIComponent(n);let s=this.bE(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)}gr(e){let n=[],r=this.bE(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.NE?o.substring(r.length,o.length):decodeURIComponent(o.substring(r.length,o.length)),n.push(e)}catch(n){return t.info(`Storage retrieval failure: `+j(n)),this.remove(e),null}}return n.length>0?n[n.length-1]:null}remove(e){this.pE(this.bE(e))}pE(e){let t=e+`=;expires=`+new Date(0).toUTCString();document.cookie=t,document.cookie=t+`;path=/`;let n=t+`;domain=`+this.GE;document.cookie=n,document.cookie=n+`;path=/`}},V.lc=class{constructor(e,t,n){this.an=e,this.vE=[],t&&this.vE.push(new V.se(e)),n&&this.vE.push(new V.gc(e)),this.vE.push(new V.uc)}store(e,t){let n=!0;for(let r=0;r<this.vE.length;r++)n=this.vE[r].store(e,t)&&n;return n}gr(e){for(let t=0;t<this.vE.length;t++){let n=this.vE[t].gr(e);if(n!=null)return n}return null}remove(e){new V.se(this.an).remove(e);for(let t=0;t<this.vE.length;t++)this.vE[t].remove(e)}};var je=class{constructor(e,t,n){this.C=e,this.gh=t,this.Fh=n,this.C=e,this.gh=t||!1,this.Fh=n,this.kh=new O,this.fh=0,this.wh=1}jh(){return this.gh}xh(){return this.C.ft(B.gt.qh)}setSdkAuthenticationSignature(e){let n=this.xh();this.C.Bt(B.gt.qh,e);let r=a.Ls.Fs;new a(r,t).setItem(r.Ms.yh,this.wh,e),n!==e&&this.it()}Bh(){this.C.Ut(B.gt.qh);let e=a.Ls.Fs;new a(e,t).ge(e.Ms.yh,this.wh)}subscribeToSdkAuthenticationFailures(e){return this.Fh.Dt(e)}Gh(e){this.Fh.X(e)}Hh(){this.kh.removeAllSubscriptions()}Jh(){this.fh+=1}Kh(){return this.fh}it(){this.fh=0}},Me=class{constructor(){}U(e){}changeUser(e=!1){}clearData(e=!1){}},Ne=class{constructor(e){this.id=e,this.id=e}Nr(){let e={};return this.browser!=null&&(e.browser=this.browser),this.tc!=null&&(e.browser_version=this.tc),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}},H={BROWSER:`browser`,BROWSER_VERSION:`browserVersion`,OS:`os`,RESOLUTION:`resolution`,LANGUAGE:`language`,TIME_ZONE:`timeZone`,USER_AGENT:`userAgent`},Pe=class{constructor(e,t){this.C=e,this.Qa=t,this.C=e,t??=s(H),this.Qa=t}ve(e=!0){let t=this.C.tu(B.iu.Na);t??(t=new M(i.ce()),e&&this.C.uu(B.iu.Na,t));let n=new Ne(t.eu);for(let e=0;e<this.Qa.length;e++)switch(this.Qa[e]){case H.BROWSER:n.browser=z.browser;break;case H.BROWSER_VERSION:n.tc=z.version;break;case H.OS:n.os=this.ec();break;case H.RESOLUTION:n.rc=screen.width+`x`+screen.height;break;case H.LANGUAGE:n.language=z.language;break;case H.TIME_ZONE:n.timeZone=this.sc(new Date);break;case H.USER_AGENT:n.userAgent=z.userAgent}return n}ec(){if(z.ic())return z.ic();let e=this.C.ft(B.gt.oc);return e&&e.os_version?e.os_version:z.ec()}sc(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:`+j(e)),n=!0}if(n)return``;let r=e.getTimezoneOffset();return this.nc(r)}nc(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}},Fe={Du:`invalid_api_key`,Tu:`blacklisted`,ku:`no_device_identifier`,Au:`invalid_json_response`,bu:`empty_response`,__:`sdk_auth_error`},U={O:{Nu:`data`,wi:`content_cards/sync`,Le:`feature_flags/sync`,Er:`template`,K:`banners/sync`},Vu:e=>e?.ft(B.gt.lE),sm:e=>e?.ft(B.gt.SE),nm:(e,t)=>{e?.Bt(B.gt.lE,t)},rm:(e,t)=>
2{e?.Bt(B.gt.SE,t)},zu:(e,t)=>{if(!e||!t)return-1;let n=U.Vu(e);if(n==null)return-1;let r=n[t];return r==null||isNaN(r)?-1:r},ju:(e,t)=>{let n=1;if(!e||!t)return n;let r=U.sm(e);return r==null?n:(n=r[t],n==null||isNaN(n)?1:n)},W:(e,t,n)=>{if(!e||!t)return;let r=U.Vu(e);r??={},r[t]=n,U.nm(e,r)},Mu:(e,t,n)=>{if(!e||!t)return;let r=U.sm(e);r??={},r[t]=n,U.rm(e,r)},vi:(e,t)=>{e&&t&&U.Mu(e,t,1)},Uu:(e,t)=>{if(!e||!t)return;let n=U.ju(e,t);U.Mu(e,t,n+1)}},Ie={Y: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.nt==`function`&&e.nt(!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.tt==`function`){let t;try{t=JSON.parse(n.responseText)}catch{let t={error:n.responseText===``?Fe.bu:Fe.Au,response:n.responseText};(0,e.tt)(t,r)}t&&e.tt(t,r)}typeof e.nt==`function`&&e.nt(!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: ${j(e)}`)}}},Le=e=>{let t={},n=e.toString().split(`\r 3`);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},Re=class{constructor(e,t,n,r,i,a,o,s,c,l,u,d){this.hn=e,this.C=t,this.Pa=n,this.Cs=r,this.T=i,this.B=a,this.an=o,this.La=s,this.Ta=c,this.Ra=l,this.appVersion=u,this.au=d,this.du=e=>e==null?``:`${e} `,this.hn=e,this.C=t,this.Pa=n,this.Cs=r,this.T=i,this.B=a,this.an=o,this.La=s,this.Ta=c,this.Ra=l,this.appVersion=u,this.au=d,this.fu=[`npm`],this.vu=[]}H(e,t=!1,n=!1){let r=this.hn.ve(!n),i=r.Nr();m(this.C.ft(B.gt.oc),i)||(e.device=i),e.api_key=this.an,e.time=h(new Date().valueOf(),!0);let a=this.C.ft(B.gt.pu)||[],o=this.C.ft(B.gt.Ru)||``;this.fu.length>0&&(!m(a,this.fu)||o!==this.T.St())&&(e.sdk_metadata=this.fu),e.sdk_version=this.Ta,this.Ra&&(e.sdk_flavor=this.Ra),e.app_version=this.appVersion,e.app_version_code=this.au,e.device_id=r.id;let s=this.Cs.getUserId();if(t&&s!==null&&(e.user_id=s),!s&&!this.Pa.jh()){let t=k(this.C);t&&(e.alias=t)}return e}st(e,r,i){let a=r.auth_error,o=r.error;if(!a&&!o)return!0;if(a){let n;this.Pa.Jh();let r={errorCode:a.error_code};for(let e of i)l(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.Pa.jh()||(n+=` Please use the "enableSdkAuthentication" initialization option to enable authentication.`),t.error(`SDK Authentication failed ${n}`),this.gu(e.events||[],e.attributes||[]),this.Pa.Gh(r),!1}if(o){let i,a=o;switch(a){case Fe.bu:return i=`Received successful response with empty body.`,$.ut(n.qu,{e:i}),t.info(i),!1;case Fe.Au:return i=`Received successful response with invalid JSON`,$.ut(n.qu,{e:i+`: `+r.response}),t.info(i),!1;case Fe.Du:a=`The API key "${e.api_key}" is invalid for the baseUrl ${this.La}`;break;case Fe.Tu:a=`Sorry, we are not currently accepting your requests. If you think this is in error, please contact us.`;break;case Fe.ku:a=`No device identifier. Please contact [email protected]`}t.error(`Backend error: `+a)}return!1}yu(e,t,n,r){return!!(e&&e.length!==0||t&&t.length!==0||n||r)}wu(e,t,n,r,i=!1){let a=[],o=e=>e||``,s=o(this.Cs.getUserId()),c=this.Gr(e,t),l=[],u=[],d,f=null;if(n.length>0){let e=[];for(let t of n){if(d=t.Nr(),this.Pa.jh()){if(s&&!d.user_id){f||={},f.events||=[],f.events.push(d);continue}if(o(d.user_id)!==s){u.push(d);continue}}e.push(d)}e.length>0&&(c.events=e)}if(r.length>0){let e=[];for(let t of r)t&&(this.Pa.jh()&&o(t.user_id)!==s?l.push(t):e.push(t));e.length>0&&(c.attributes=e)}if(this.gu(u,l),c=this.H(c,!1,i),f){f=this.H(f,!1,i);let e={requestData:f,headers:this.J(f,U.O.Nu)};a.push(e)}if(c&&!this.yu(c.events,c.attributes,e,t))return f?a:null;let p={requestData:c,headers:this.J(c,U.O.Nu)};return a.push(p),a}gu(e,t){if(e){let t=[];for(let n of e){let e=A.fromJson(n);e.time=g(e.time),t.push(e)}this.C.Vo(t)}if(t)for(let e of t)this.C.Cu(e)}et(e,n){let r=`HTTP error `;e!=null&&(r+=e+` `),r+=n,t.error(r)}zr(e){return $.ut(n.Su,{n:e})}Gr(e,t,n){let r={};e&&(r.feed=!0),t&&(r.triggers=!0);let i=n??this.Cs.getUserId();if(i&&(r.user_id=i),!r.user_id&&!this.Pa.jh()){let e=k(this.C);e&&(r.alias=e)}return r.config={config_time:this.B.Et()},{respond_with:r}}Bu(e){let t=new Date().valueOf(),n=ne.toString(),r=U.zu(this.C,e);return r!==-1&&(n=(t-r).toString()),n}J(e,t,n=!1){let r=[[`X-Braze-Api-Key`,this.an]],i=this.Bu(t);r.push([`X-Braze-Last-Req-Ms-Ago`,i]);let a=U.ju(this.C,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),e.respond_with!=null&&e.respond_with.feed&&(r.push([`X-Braze-FeedRequest`,`true`]),o=!0),t===U.O.wi){r.push([`X-Braze-ContentCardsRequest`,`true`]);let e=U.ju(this.C,U.O.wi);e&&!n||(e=1,U.Mu(this.C,U.O.wi,e));let t=Math.max(0,e-1);r.push([`BRAZE-SYNC-RETRY-COUNT`,t.toString()]),o=!0}if(t===U.O.Le&&(r.push([`X-Braze-FeatureFlagsRequest`,`true`]),o=!0),o&&r.push([`X-Braze-DataRequest`,`true`]),this.Pa.jh()){let e=this.Pa.xh();e!=null&&r.push([`X-Braze-Auth-Signature`,e])}return r}Xu(e,n,r,i){let a=window.setTimeout(()=>{t.info(`Retrying rate limited ${this.du(i)}SDK request.`),this.V(n,r,i)},e);this.vu.push(a)}fo(){for(let e of this.vu)window.clearTimeout(e);this.vu=[]}V(e,n,r,i){if(!this.$u(r))return t.info(`${this.du(r)}SDK request being rate limited.`),void(typeof i==`function`&&i());let a=this.Fu();if(!a.Lu)return t.info(`${this.du(r)}SDK request being rate limited. Request will be retried in ${Math.trunc(a.Eu/1e3)} seconds.`),void this.Xu(a.Eu,e,n,r);this.C.Bt(B.gt.Ku,new Date().valueOf());let o=e.device;o&&o.os_version instanceof Promise?o.os_version.then(t=>
3{e.device.os_version=t,n(a.Iu)}):n(a.Iu)}Pu(e){let t=e?Le(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()))?($.ut(n.qu,{e:`Received unexpected value for retry-after header in /sync response: `+r}),null):{type:`timestamp`,value:1e3*parseFloat(r.toString())}}rt(e,t,n,r,i,a){if(U.ju(this.C,n)>=15)return;let o;a||=0;let s=this.Pu(e);i();let c=e=>{r(window.setTimeout(()=>{t()},e)),U.Uu(this.C,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):U.vi(this.C,n)}xu(e){var t;(t=this.C)==null||t.Bt(B.gt.Hu,e)}Ou(e,t){let n=this.Gu();n??={},n[e]=t,this.C.Bt(B.gt._u,n)}Wu(){return this.C?.ft(B.gt.Hu)}Gu(){return this.C?.ft(B.gt._u)}Yu(e,t,n,r,i=``){let a;if(i){let e=this.Gu();a=e==null||isNaN(e[i])?t:e[i]}else a=this.Wu(),(a==null||isNaN(a))&&(a=t);let o=(e-r)/1e3;return a=Math.min(a+o/n,t),a}Ju(e,t){return Math.max(0,(1-e)*t*1e3)}Qu(e,t=``){let n={Lu:!0,Iu:-1,Eu:0};if(e??=!0,!e&&!t)return n;let r,i,a=null;if(e)a=this.C?.ft(B.gt.Ku);else{let e=U.Vu(this.C);if(e==null||e[t]==null)return n;a=e[t]}if(a==null||isNaN(a)||(e?(r=this.B?.Zu()||-1,i=this.B?.tl()||-1):(r=this.B?.el(t)||-1,i=this.B?.il(t)||-1),r===-1||i===-1))return n;let o=new Date().valueOf(),s=this.Yu(o,r,i,a,t);return s<1?(n.Lu=!1,n.Eu=this.Ju(s,i),n):(s=Math.trunc(s)-1,n.Iu=s,e?this.xu(s):this.Ou(t,s),n)}Fu(){return this.Qu(!0)}$u(e){let t=this.Qu(!1,e);return!(t&&!t.Lu)}it(){this.Pa.it()}Z(){return this.La}addSdkMetadata(e){for(let t of e)this.fu.indexOf(t)===-1&&this.fu.push(t)}},ze=(e,t)=>(e=Math.ceil(e),t=Math.floor(t),Math.floor(Math.random()*(t-e+1))+e),Be=class{constructor(e=!1,t=[]){this.tt=e,this.$e=t,this.tt=e,this.$e=t}ns(e){this.tt=this.tt&&e.tt,this.$e.push(...e.$e)}},W={mn:()=>`serviceWorker`in navigator&&typeof ServiceWorkerRegistration<`u`&&`showNotification`in ServiceWorkerRegistration.prototype&&`PushManager`in window,vn:()=>`safari`in window&&`pushNotification`in window.safari&&typeof window.safari.pushNotification.permission==`function`&&typeof window.safari.pushNotification.requestPermission==`function`,isPushSupported:()=>W.mn()||W.vn(),isPushBlocked:()=>{let e=W.isPushSupported()&&`Notification`in window&&window.Notification!=null&&window.Notification.permission!=null&&window.Notification.permission===`denied`,t=W.isPushSupported()&&(!(`Notification`in window)||window.Notification==null);return e||t},isPushPermissionGranted:()=>W.isPushSupported()&&`Notification`in window&&window.Notification!=null&&window.Notification.permission!=null&&window.Notification.permission===`granted`,Tr:()=>!W.isPushBlocked()&&W.isPushSupported()&&!W.isPushPermissionGranted()},Ve=class{constructor(e,t,n,r,i,a,o,s,c,l){this.an=e,this.baseUrl=t,this.T=n,this.hn=r,this.Cs=i,this.B=a,this.C=o,this.$l=s,this.Pa=c,this.S=l,this.an=e,this.baseUrl=t,this.Tl=0,this.dE=o.IE()||0,this.Ml=null,this.T=n,this.hn=r,this.Cs=i,this.B=a,this.C=o,this.Pa=c,this.S=l,this.$l=s,this.Pl=new O,this.Ol=null,this.Ul=50,this._l=!1}Kl(e,t){return!e&&!t&&this.Pa.Kh()>=this.Ul}Xl(e){let t=this.T.zl();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.Fl&&e&&(t=!0)}}return t}Ql(e=!1,n=!1,r=!0,i,a,o,s=!1,c=!1){r&&this.Yl();let l=this.C.AE(),u=this.C.OE(),d=!1,f=(e,t,n=-1)=>{let s=new Date().valueOf();U.W(this.C,U.O.Nu,s),n!==-1&&t.push([`X-Braze-Req-Tokens-Remaining`,n.toString()]);let c=!1;Ie.Y({url:this.baseUrl+`/data/`,data:e,headers:t,tt:n=>{e.respond_with!=null&&e.respond_with.triggers&&(this.Tl=Math.max(this.Tl-1,0)),this.S.st(e,n,t)?(this.Pa.it(),this.B.gl(n),e.respond_with!=null&&e.respond_with.user_id!=this.Cs.getUserId()||(e.device!=null&&this.C.Bt(B.gt.oc,e.device),e.sdk_metadata!=null&&(this.C.Bt(B.gt.pu,e.sdk_metadata),this.C.Bt(B.gt.Ru,this.T.St())),this.$l(n),U.Mu(this.C,U.O.Nu,1),typeof i==`function`&&i())):n.auth_error&&(c=!0)},error:()=>{c=!0,e.respond_with!=null&&e.respond_with.triggers&&(this.Tl=Math.max(this.Tl-1,0)),this.S.gu(e.events,e.attributes),typeof a==`function`&&a()},nt:(e,t)=>
3{typeof o==`function`&&o(!c);let n=this.S.Pu(t),i=0;if(n)switch(n.type){case`date`:i=Math.max(n.value-new Date().valueOf(),0);break;case`timestamp`:i=n.value}if(r&&!d){if(c){U.Uu(this.C,U.O.Nu);let e=this.Ml;(e==null||e<1e3*this.dE)&&(e=1e3*this.dE);let t=Math.min(3e5,ze(1e3*this.dE,3*e))+i;this.Zl(t)}else this.Zl(Math.max(1e3*this.dE,i));d=!0}}})},p=this.Xl(l),m=n||p;if(this.Kl(s,p))return void t.info(`Declining to flush data due to 50 consecutive authentication failures`);if(r&&!this.S.yu(l,u,e,m))return this.Zl(),void(typeof o==`function`&&o(!0));let h=this.S.wu(e,m,l,u,c);m&&this.Tl++;let g=!1;if(h)for(let e of h)this.S.V(e.requestData,t=>f(e.requestData,e.headers,t),U.O.Nu,a),g=!0;this.Pa.jh()&&r&&!g?this.Zl():p&&(t.info(`Invoking new session subscriptions`),this.Pl.X())}dc(){return this.Tl>0}Zl(e=1e3*this.dE){this._l||(this.Yl(),this.Ol=window.setTimeout(()=>{if(document.hidden){let e=`visibilitychange`,t=()=>{document.hidden||(document.removeEventListener(e,t,!1),this.Ql())};document.addEventListener(e,t,!1)}else this.Ql()},e),this.Ml=e)}Yl(){this.Ol!=null&&(clearTimeout(this.Ol),this.Ol=null)}initialize(){this._l=!1,this.Zl()}destroy(){this.Pl.removeAllSubscriptions(),this.Pa.Hh(),this.Yl(),this._l=!0,this.Ql(void 0,void 0,!1,void 0,void 0,void 0,void 0,!0),this.Ol=null}on(e){return this.Pl.Dt(e)}openSession(){let n=this.T.St()!==this.T.Qo();n&&(this.C.TE(B.iu.Na),this.C.TE(B.iu.su)),this.Ql(void 0,!1,void 0,()=>{this.C.Ut(B.gt.Ge)}),this.Qn(),n&&e(()=>import(`./push-manager-factory-CkKg32XS.js`).then(e=>e.t).then(e=>{if(this._l)return;let n=e.default.ea();if(n!=null&&(W.isPushPermissionGranted()||W.isPushBlocked())){let e=()=>{n.wn()?t.info(`Push token maintenance is disabled, not refreshing token for backend.`):n.subscribe()},r=(t,n)=>{n&&e()},i=()=>{let t=this.C.ft(B.gt.zn);(t==null||t)&&e()},o=a.Ls.Fs;new a(o,t).cr(o.Ms.cu,r,i)}}),__vite__mapDeps([0,1]))}mc(){this.C.Ut(B.gt.Xe),this.C.Ut(B.gt.Hs),this.C.Ut(B.gt.Kr)}fc(){this.C.Ut(B.gt.Ku),this.C.Ut(B.gt.lE);let e=U.O;for(let t in e){let n=e[t];this.S.Ou(n,this.B?.el(n))}this.S.xu(this.B?.Zu())}changeUser(e,n,r){let i=this.Cs.getUserId();if(i!==e){this.T.Il(),this.mc(),i!=null&&this.Ql(void 0,!1,void 0,void 0,void 0),this.Cs.ou(e),r?this.Pa.setSdkAuthenticationSignature(r):this.Pa.Bh();for(let e=0;e<n.length;e++)n[e].changeUser(i==null);this.S.fo(),i!=null&&this.C.Ut(B.gt.Zt),this.C.Ut(B.gt.oc),this.C.Ut(B.gt._E),this.fc(),this.openSession(),t.info(`Changed user to "`+e+`".`)}else{let n=`Doing nothing.`;r&&this.Pa.xh()!==r&&(this.Pa.setSdkAuthenticationSignature(r),n=`Updated SDK authentication signature`),t.info(`Current user is already ${e}. ${n}`)}}requestImmediateDataFlush(e){this.Yl(),this.T.Qo(),this.Ql(void 0,void 0,void 0,void 0,()=>{t.error(`Failed to flush data, request will be retried automatically.`)},e,!0)}requestFeedRefresh(){this.T.Qo(),this.Ql(!0)}br(e,n){this.T.Qo(),t.info(`Requesting explicit trigger refresh.`),this.Ql(void 0,!0,void 0,e,n)}Cn(e,r){let i=n.vc,a={a:e,l:r},o=$.ut(i,a);return o&&(t.info(`Logged alias ${e} with label ${r}`),this.C.Bt(B.gt._E,a)),o}Ln(e,n,r){if(this.B.hu(n))return t.info(`Custom Attribute "${n}" is blocklisted, ignoring.`),new Be;let i={key:n,value:r},a=$.ut(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=$.ut(n.bc,c,e||void 0);return l&&t.info(`Set user last known location as ${JSON.stringify(c,null,2)}`),l}lr(e,t){let r=this.T.Qo();return new A(this.Cs.getUserId(),n.wc,e,r,{cid:t})}kc(e,t){return new a(e,t)}Qn(){let e=a.Ls.Fs;this.kc(e,t).setItem(e.Ms.Nu,1,{baseUrl:this.baseUrl,data:{api_key:this.an,device_id:this.hn.ve().id},userId:this.Cs.getUserId(),sdkAuthEnabled:this.Pa.jh()})}vr(e){for(let n of e)if(n.api_key===this.an)this.S.gu(n.events,n.attributes);else{let e=a.Ls.Fs;new a(e,t).setItem(e.Ms.kr,i.ce(),n)}}Kn(e,r,i){if(this.B.hu(e))return t.info(`Custom Attribute "${e}" is blocklisted, ignoring.`),new Be;let a,o;return r===null&&i===null?(a=n.yc,o={key:e}):(a=n.Sc,o={key:e,latitude:r,longitude:i}),$.ut(a,o)}Mn(e,t){let r={group_id:e,status:t};return $.ut(n.jc,r)}},He=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){this.dl=e,this.Rl=t,this.Cl=n,this.El=r,this.yl=i,this.fl=a,this.vl=o,this.De=s,this.bl=c,this.banners=l,this.dl=e,this.Rl=t,this.Cl=n,this.El=r,this.yl=i,this.fl=a,this.vl=o,this.De=s,this.bl=c,this.banners=l}bt(){return{s:`5.9.1`,l:this.dl,e:this.Rl,a:this.Cl,p:this.El,m:this.yl,v:this.fl,c:this.vl,f:this.De,grl:this.bl,b:this.banners}}static Rn(t){let n=t.l;return t.s!==`5.9.1`&&(n=0),new e(n,t.e,t.a,t.p,t.m,t.v,t.c,t.f,t.grl,t.b)}},Ue=class{constructor(e){this.C=e,this.C=e,this.sl=new O,this.rl=ne
3w O,this.ul=new O,this.al=new O,this.hl=null,this.ol=null}cl(){if(this.ol==null){let e=this.C.ft(B.gt.ml);this.ol=e==null?new He:He.Rn(e)}return this.ol}Et(){return this.cl().dl}gl(e){if(e!=null&&e.config!=null){let t=e.config;if(t.time>this.cl().dl){let e=new He(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.cl().bl)(t.global_request_rate_limit),t.banners),n=!1;e.fl!=null&&this.In()!==e.fl&&(n=!0);let r=!1;e.vl.enabled!=null&&this.yi()!==e.vl.enabled&&(r=!0);let i=!1;e.De.enabled!=null&&this.ke()!==e.De.enabled&&(i=!0);let a=!1;e.banners?.enabled!=null&&this.zt()!==e.banners?.enabled&&(a=!0),this.ol=e,this.C.Bt(B.gt.ml,e.bt()),n&&this.sl.X(),r&&this.rl.X(),i&&this.ul.X(),a&&this.al.X()}}}Vn(e){let t=this.sl.Dt(e);return this.hl&&this.sl.removeSubscription(this.hl),this.hl=t,t}gi(e){return this.rl.Dt(e)}Ke(e){return this.ul.Dt(e)}A(e){return this.al.Dt(e)}je(e){return this.cl().Rl.indexOf(e)!==-1}hu(e){return this.cl().Cl.indexOf(e)!==-1}Dr(e){return this.cl().El.indexOf(e)!==-1}wl(){return this.cl().yl}In(){return this.cl().fl}yi(){return this.cl().vl.enabled||!1}Ll(){let e=this.cl().bl;return!(!e||e.enabled==null)&&e.enabled}Zu(){if(!this.Ll())return-1;let e=this.cl().bl;return e.capacity==null||e.capacity<10?-1:e.capacity}tl(){if(!this.Ll())return-1;let e=this.cl().bl;return e.refill_rate==null||e.refill_rate<=0?-1:e.refill_rate}Bl(e){let t=this.cl().bl.endpoint_overrides;return t==null?null:t[e]}el(e){let t=this.Bl(e);return t==null||isNaN(t.capacity)||t.capacity<=0?-1:t.capacity}il(e){let t=this.Bl(e);return t==null||isNaN(t.refill_rate)||t.refill_rate<=0?-1:t.refill_rate}ke(){return this.cl().De.enabled&&this.Oe()==null?($.ut(n.qu,{e:`Missing feature flag refresh_rate_limit.`}),!1):this.cl().De.enabled||!1}Oe(){return this.cl().De.refresh_rate_limit}zt(){return this.cl().banners?.enabled||null}ne(){return this.cl().banners?.max_placements||0}},We=class{constructor(e,n,r,i){this.C=e,this.Cs=n,this.B=r,this.Sl=i,this.C=e,this.Cs=n,this.B=r,this.jl=1e3,(i==null||isNaN(i))&&(i=1800),i<this.jl/1e3&&(t.info(`Specified session timeout of `+i+`s is too small, using the minimum session timeout of `+this.jl/1e3+`s instead.`),i=this.jl/1e3),this.Sl=i}xl(e,t){return new A(this.Cs.getUserId(),n.Dl,e,t.eu,{d:h(e-t.Gl)})}St(){let e=this.C.tu(B.iu.Nl);return e==null?null:e.eu}zl(){let e=new Date().valueOf(),t=this.B.wl();if(t==null)return!1;let n=this.C.ft(B.gt.Hl),r=n==null||e-n>1e3*t;return r&&this.C.Bt(B.gt.Hl,e),r}Wl(e,t){return t==null||t.kl==null||!(e-t.Gl<this.jl)&&t.kl<e}Qo(){let e=new Date().valueOf(),r=e+1e3*this.Sl,a=this.C.tu(B.iu.Nl);if(this.Wl(e,a)){let o=`Generating session start event with time `+e;if(a!=null){let e=a.ql;e-a.Gl<this.jl&&(e=a.Gl+this.jl),this.C.Al(this.xl(e,a)),o+=` (old session ended `+e+`)`}o+=`. Will expire `+r.valueOf(),t.info(o);let s=new M(i.ce(),r);return this.C.Al(new A(this.Cs.getUserId(),n.Fl,e,s.eu)),this.C.uu(B.iu.Nl,s),this.C.ft(B.gt.Hl)??this.C.Bt(B.gt.Hl,e),s.eu}if(a!=null)return a.ql=e,a.kl=r,this.C.uu(B.iu.Nl,a),a.eu}Il(){let e=this.C.tu(B.iu.Nl);e!=null&&(this.C.Jl(B.iu.Nl),this.C.Al(this.xl(new Date().valueOf(),e)))}},Ge={Ya:function(e,n=!1){let r=!1;try{if(localStorage&&localStorage.getItem)try{localStorage.setItem(B.gt.ac,`true`),localStorage.getItem(B.gt.ac)&&(localStorage.removeItem(B.gt.ac),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=Ge.cc(),a=new V.lc(e,i&&!n,r),o;return o=r?new V.gc(e):new V.uc,new V(a,o)},cc:function(){return navigator.cookieEnabled||`cookie`in document&&(document.cookie.length>0||(document.cookie=`test`).indexOf.call(document.cookie,`test`)>-1)}},Ke=class e{constructor(e,t){this.triggerId=e,this.messageExtras=t,this.triggerId=e,this.messageExtras=t,this.extras={},this.isControl=!0,this.Ht=!1}static fromJson(t){return new e(t.trigger_id,t.message_extras)}_t(){return!this.Ht&&(this.Ht=!0,!0)}Bo(){return this.Ht}};function qe(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)||
3!r)}var Je={Ic:null,Ho:qe},Ye={qo:`up`,yo:`down`,ie:`left`,de:`right`};function Xe(){if(Je.Ic==null){Je.Ic=!1;try{let e=Object.defineProperty({},"passive",{get:()=>{Je.Ic=!0}});window.addEventListener(`testPassive`,()=>{},e),window.removeEventListener(`testPassive`,()=>{},e)}catch(e){t.error(j(e))}}return Je.Ic}function Ze(e,t,n=()=>{}){e.addEventListener(t,n,!!Xe()&&{passive:!0})}function Qe(e){return Je.Ho(e,!0,!1,!1)}function $e(e){return Je.Ho(e,!1,!0,!1)}function et(e){if(e.onclick){let t=document.createEvent(`MouseEvents`);t.initEvent(`click`,!0,!0),e.onclick.apply(e,[t])}}function tt(e,t,n){let r=null,i=null;Ze(e,`touchstart`,e=>{r=e.touches[0].clientX,i=e.touches[0].clientY}),Ze(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===Ye.ie||o<0&&t===Ye.de)&&n(a),r=null,i=null):Math.abs(s)>=25&&((s>0&&t===Ye.qo&&e.scrollTop===e.scrollHeight-e.offsetHeight||s<0&&t===Ye.yo&&e.scrollTop===0)&&n(a),r=null,i=null)})}function nt(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 rt={Wo:32,Ao:9,Xo:13,_h:27},it=e=>e!==null&&e.tagName===`IFRAME`,G=class e{constructor(t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,ee,C,w,T,te,ne,E,D){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=ee,this.frameColor=C,this.buttons=w,this.cropType=T,this.orientation=te,this.htmlId=ne,this.css=E,this.messageExtras=D,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=ee||e.th.hh,this.frameColor=C||e.th.Eh,this.buttons=w||[],this.cropType=T||e.CropType.FIT_CENTER,this.orientation=te,this.htmlId=ne,this.css=E,this.isControl=!1,this.messageExtras=D,this.nh=!1,this.Ht=!1,this.So=!1,this.Th=!1,this.jo=null,this.wo=null,this.ti=new O,this.oh=new O,this.$o=e.TextAlignment.CENTER}subscribeToClickedEvent(e){return this.ti.Dt(e)}subscribeToDismissedEvent(e){return this.oh.Dt(e)}removeSubscription(e){this.ti.removeSubscription(e),this.oh.removeSubscription(e)}removeAllSubscriptions(){this.ti.removeAllSubscriptions(),this.oh.removeAllSubscriptions()}closeMessage(){this.ll(this.jo)}vo(){return!0}Po(){return this.vo()}ho(){return this.htmlId!=null&&this.htmlId.length>4}lo(){return this.ho()&&this.css!=null&&this.css.length>0}do(){if(this.ho()&&this.lo())return this.htmlId+`-css`}_t(){return!this.Ht&&(this.Ht=!0,!0)}Bo(){return this.Ht}$t(e){return!this.So&&(this.So=!0,this.ti.X(),!0)}Qt(){return!this.Th&&(this.Th=!0,this.oh.X(),!0)}hide(t){if(t&&t.parentNode){let n=t.closest(`.ab-iam-root`);if(n??=t,this.vo()&&n.parentNode!=null){let t=n.parentNode.classList;t&&t.contains(e.rh)&&t.remove(e.rh),document.body.removeEventListener(`touchmove`,e.lh)}n.className=n.className.replace(e.uh,e.ah)}return this.animateOut||!1}ll(t,n){if(t==null)return;let r;this.jo=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=()=>
3{if(t&&t.parentNode){let e=t.closest(`.ab-iam-root`);e??=t,e.parentNode&&e.parentNode.removeChild(e)}let e=this.do();if(e!=null){let t=document.getElementById(e);t&&t.parentNode&&t.parentNode.removeChild(t)}a!=null&&z.browser===`Safari`&&(a.scrollTop=o),n?n():this.Qt()};i?setTimeout(s,e.Ih):s(),this.wo&&this.wo.focus()}zo(){return document.createTextNode(this.message||``)}ko(e){let t=``;this.message||this.header||!this.vo()||(t=`Modal Image`),e.setAttribute(`alt`,t)}static lh(t){if(t.targetTouches&&t.targetTouches.length>1)return;let n=t.target;n&&n.classList&&n.classList.contains(`ab-message-text`)&&n.scrollHeight>n.clientHeight||document.querySelector(`.${e.rh}`)&&t.cancelable&&t.preventDefault()}Ah(t){let n=t.parentNode;this.vo()&&n!=null&&this.orientation!==e.Orientation.LANDSCAPE&&(n.classList!=null&&n.classList.add(e.rh),document.body.addEventListener(`touchmove`,e.lh,!!Xe()&&{passive:!1})),t.className+=` `+e.uh}static Oh(e){if(e.keyCode===rt._h&&!Q.ee(Z.mh)&&document.querySelectorAll(`.ab-modal-interactions`).length>0){let e=document.getElementsByClassName(`ab-html-message`),t=!1;for(let n of e){let e=null;it(n)&&n.contentWindow&&(e=n.contentWindow.document.getElementsByClassName(`ab-programmatic-close-button`)[0]),e!=null&&(et(e),t=!0)}if(!t){let e=document.querySelectorAll(`.ab-modal-interactions > .ab-close-button`)[0];e!=null&&et(e)}}}Lh(){this.nh||Q.ee(Z.mh)||(document.addEventListener(`keydown`,e.Oh,!1),Q.Nh(()=>{document.removeEventListener(`keydown`,e.Oh)}),this.nh=!0)}bt(t){let n={};return t?(n[e.es.ra]=this.message,n[e.es.sa]=this.messageAlignment,n[e.es.Sh]=this.slideFrom,n[e.es.qs]=this.extras,n[e.es.ta]=this.triggerId,n[e.es.ia]=this.clickAction,n[e.es.URI]=this.uri,n[e.es.oa]=this.openTarget,n[e.es.pa]=this.dismissType,n[e.es.ma]=this.duration,n[e.es.na]=this.icon,n[e.es.ls]=this.imageUrl,n[e.es.ua]=this.imageStyle,n[e.es.ca]=this.iconColor,n[e.es.fa]=this.iconBackgroundColor,n[e.es.da]=this.backgroundColor,n[e.es.la]=this.textColor,n[e.es.ga]=this.closeButtonColor,n[e.es.ja]=this.animateIn,n[e.es.xa]=this.animateOut,n[e.es.za]=this.header,n[e.es.ha]=this.headerAlignment,n[e.es.va]=this.headerTextColor,n[e.es.wa]=this.frameColor,n[e.es.ya]=this.buttons,n[e.es.Sa]=this.cropType,n[e.es.ba]=this.orientation,n[e.es.ka]=this.htmlId,n[e.es.CSS]=this.css,n[e.es.hs]=t,n[e.es.qa]=this.messageExtras,n):n}};G.th={hh:4281545523,ih:4294967295,sh:4278219733,Rh:4293914607,Mh:4283782485,Eh:3224580915,eh:4288387995},G.Co={Dh:`hd`,xo:`ias`,Ch:`of`,dh:`do`,Uh:`umt`,bh:`tf`,Ph:`te`},G.SlideFrom={TOP:`TOP`,BOTTOM:`BOTTOM`},G.ClickAction={NEWS_FEED:`NEWS_FEED`,URI:`URI`,NONE:`NONE`},G.DismissType={AUTO_DISMISS:`AUTO_DISMISS`,MANUAL:`SWIPE`},G.OpenTarget={NONE:`NONE`,BLANK:`BLANK`},G.ImageStyle={TOP:`TOP`,GRAPHIC:`GRAPHIC`},G.Orientation={PORTRAIT:`PORTRAIT`,LANDSCAPE:`LANDSCAPE`},G.TextAlignment={START:`START`,CENTER:`CENTER`,END:`END`},G.CropType={CENTER_CROP:`CENTER_CROP`,FIT_CENTER:`FIT_CENTER`},G.bo={Wr:`SLIDEUP`,Vr:`MODAL`,Fo:`MODAL_STYLED`,Lr:`FULL`,Ur:`WEB_HTML`,po:`HTML`,Jo:`HTML_FULL`},G.Ih=500,G.ph=200,G.uh=`ab-show`,G.ah=`ab-hide`,G.rh=`ab-pause-scrolling`,G.es={ra:`m`,sa:`ma`,Sh:`sf`,qs:`e`,ta:`ti`,ia:`ca`,URI:`u`,oa:`oa`,pa:`dt`,ma:`d`,na:`i`,ls:`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`,hs:`type`,Eo:`messageFields`,qa:`me`};var at=class e extends G{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||=G.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),this.messageFields=u,this.messageFields=u}Po(){return!1}$t(e){if(this.uo===G.bo.Ur){if(this.So)return!1;this.So=!0}return this.ti.X(e),!0}bt(){let t=super.bt(e.cs);return t[G.es.Eo]=this.messageFields,t}static Qr(t){return new e(t[G.es.ra],t[G.es.qs],t[G.es.ta],t[G.es.pa],t[G.es.ma],t[G.es.ja],t[G.es.xa],t[G.es.wa],t[G.es.ka],t[G.es.CSS],t[G.es.Eo],t[G.es.qa])}};at.cs=G.bo.Ur;var ot=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||G.th.sh,this.textColor=r||G.th.ih,this.borderColor=i||this.backgroundColor,this.clickAction=a||G.ClickAction.NONE,this.uri=o,s??=e.Yi,this.id=s,this.So=!1,this.ti=new O}subscribeToClickedEvent(e){return this.ti.Dt(e)}removeSubscription(e){this.ti.removeSubscription(e)}removeAllSubscriptions(){this.ti.removeAllSubscriptions()}$t(){return!this.So&&(this.So=!0,this.ti.X(),!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)}};ot.Yi=-1;var st=class e extends G{constructor(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,ee,C,w,T,te,ne){s||=G.DismissType.MANUAL,w||=G.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,ee,C||=G.CropType.CENTER_CROP,w,T,te,ne),this.$o=G.TextAlignment.CENTER}bt(){return super.bt(e.cs)}static Qr(t){return new e(t[G.es.ra],t[G.es.sa],t[G.es.qs],t[G.es.ta],t[G.es.ia],t[G.es.URI],t[G.es.oa],t[G.es.pa],t[G.es.ma],t[G.es.na],t[G.es.ls],t[G.es.ua],t[G.es.ca],t[G.es.fa],t[G.es.da],t[G.es.la],t[G.es.ga],t[G.es.ja],t[G.es.xa],t[G.es.za],t[G.es.ha],t[G.es.va],t[G.es.wa],dt(t[G.es.ya]),t[G.es.Sa],t[G.es.ba],t[G.es.ka],t[G.es.CSS],t[G.es.qa])}};st.cs=G.bo.Lr;var ct=class e extends G{constructor(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,ee,C,w,T,te){super(e,t,void 0,n,r,i,a,o,s||=G.DismissType.MANUAL,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,ee,C||=G.CropType.FIT_CENTER,void 0,w,T,te),this.$o=G.TextAlignment.CENTER}bt(){return super.bt(e.cs)}static Qr(t){return new e(t[G.es.ra],t[G.es.sa],t[G.es.qs],t[G.es.ta],t[G.es.ia],t[G.es.URI],t[G.es.oa],t[G.es.pa],t[G.es.ma],t[G.es.na],t[G.es.ls],t[G.es.ua],t[G.es.ca],t[G.es.fa],t[G.es.da],t[G.es.la],t[G.es.ga],t[G.es.ja],t[G.es.xa],t[G.es.za],t[G.es.ha],t[G.es.va],t[G.es.wa],dt(t[G.es.ya]),t[G.es.Sa],t[G.es.ka],t[G.es.CSS],t[G.es.qa])}};ct.cs=G.bo.Vr;var lt=class e extends G{constructor(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x){h||=G.th.Mh,m||=G.th.Rh,super(e,t||=G.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),this.$o=G.TextAlignment.START}vo(){return!1}zo(){let e=document.createElement(`span`);return e.appendChild(document.createTextNode(this.message||``)),e}Ah(e){let t=e.getElementsByClassName(`ab-in-app-message`)[0];Je.Ho(t,!0,!0)||(this.slideFrom===G.SlideFrom.TOP?t.style.top=`0px`:t.style.bottom=`0px`),super.Ah(e)}bt(){return super.bt(e.cs)}static Qr(t){return new e(t[G.es.ra],t[G.es.sa],t[G.es.Sh],t[G.es.qs],t[G.es.ta],t[G.es.ia],t[G.es.URI],t[G.es.oa],t[G.es.pa],t[G.es.ma],t[G.es.na],t[G.es.ls],t[G.es.ca],t[G.es.fa],t[G.es.da],t[G.es.la],t[G.es.ga],t[G.es.ja],t[G.es.xa],t[G.es.ka],t[G.es.CSS],t[G.es.qa])}};lt.cs=G.bo.Wr;function ut(e){if(!e)return null;if(e.is_control)return Ke.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,ee=e.header_text_color,C=e.frame_color,w=[],T=e.btns;T??=[];for(let e=0;e<T.length;e++)w.push(ot.fromJson(T[e]));let te=e.crop_type,ne=e.orientation,E=e.animate_in,D=e.animate_out,O=e.html_id,k=e.css;O!=null&&O!==``&&k!=null&&k!==``||(O=void 0,k=void 0);let A=e.message_extras,j;if(n===ct.cs||n===G.bo.Fo)j=new ct(r,i,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,E,D,x,S,ee,C,w,te,O,k,A);else if(n===st.cs)j=new st(r,i,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,E,D,x,S,ee,C,w,te,ne,O,k,A);else if(n===lt.cs)j=new lt(r,i,a,o,s,c,l,u,d,f,p,m,g,_,v,y,b,E,D,O,k,A);else{if(n!==at.cs&&n!==G.bo.po&&n!==G.bo.Jo)return void t.error(`Ignoring message with unknown type `+n);{let t=e.message_fields;j=new at(r,o,s,d,f,E,D,C,O,k,t,A),j.trusted=e.trusted||!1}}return j.uo=n,j}function dt(e){let t=[];for(let n of e)t.push(new ot(n.text,n.backgroundColor,n.textColor,n.borderColor,n.clickAction,n.uri,n.id));return t}var ft=class e{constructor(e){this.xc=e,this.xc=e}zc(e){return this.xc==null||this.xc===e[0]}static fromJson(t){return new e(t?t.event_name:null)}bt(){return this.xc}
3},pt=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.QE.UE&&this.comparator!==e.wE.XE&&this.comparator!==e.wE.BE&&this.comparator!==e.wE.jE&&this.comparator!==e.wE.zE&&(this.LE=_(this.LE))}zc(t){let n=null;switch(t!=null&&(n=t[this.yE]),this.comparator){case e.wE.FE:return n!=null&&n.valueOf()===this.LE.valueOf();case e.wE.kE:return n==null||n.valueOf()!==this.LE.valueOf();case e.wE.xE:return n!=null&&typeof n==typeof this.LE&&n>this.LE;case e.wE.XE:return this.HE===e.QE.UE?n!=null&&u(n)&&x(n)<=this.LE.valueOf():n!=null&&typeof n==typeof this.LE&&n>=this.LE;case e.wE.JE:return n!=null&&typeof n==typeof this.LE&&n<this.LE;case e.wE.BE:return this.HE===e.QE.UE?n!=null&&u(n)&&x(n)>=this.LE.valueOf():n!=null&&typeof n==typeof this.LE&&n<=this.LE;case e.wE.VE:return n!=null&&typeof n==`string`&&typeof n==typeof this.LE&&n.match(this.LE)!=null;case e.wE.qE:return n!=null;case e.wE.PE:return n==null;case e.wE.jE:return n!=null&&u(n)&&S(n)<this.LE;case e.wE.zE:return n!=null&&u(n)&&S(n)>this.LE;case e.wE.WE: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)}bt(){let e=this.LE;return u(this.LE)&&(e=h(e.valueOf())),{k:this.yE,t:this.HE,c:this.comparator,v:e}}static Rn(t){return new e(t.k,t.t,t.c,t.v)}};pt.QE={ZE:`boolean`,$E:`number`,tT:`string`,UE:`date`},pt.wE={FE:1,kE:2,xE:3,XE:4,JE:5,BE:6,VE:10,qE:11,PE:12,jE:15,zE:16,WE:17};var mt=class e{constructor(e){this.filters=e,this.filters=e}zc(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].zc(e)){i=!0;break}if(!i){t=!1;break}}return t}static fromJson(t){if(t==null||!l(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(pt.fromJson(i[e]));n.push(r)}return new e(n)}bt(){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].bt());e.push(r)}return e}static Rn(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(pt.Rn(i[e]));n.push(r)}return new e(n)}},ht=class e{constructor(e,t){this.xc=e,this.tf=t,this.xc=e,this.tf=t}zc(e){if(this.xc==null||this.tf==null)return!1;let t=e[0],n=e[1];return t===this.xc&&this.tf.zc(n)}static fromJson(t){return new e(t?t.event_name:null,t?mt.fromJson(t.property_filters):null)}bt(){return{e:this.xc,pf:this.tf?this.tf.bt():null}}},gt=class e{constructor(e,t){this.if=e,this.rf=t,this.if=e,this.rf=t}zc(e){if(this.if==null)return!1;let t=q.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)}bt(){return this.if}},_t=class e{constructor(e){this.productId=e,this.productId=e}zc(e){return this.productId==null||e[0]===this.productId}static fromJson(t){return new e(t?t.product_id:null)}bt(){return this.productId}},vt=class e{constructor(e,t){this.productId=e,this.tf=t,this.productId=e,this.tf=t}zc(e){if(this.productId==null||this.tf==null)return!1;let t=e[0],n=e[1];return t===this.productId&&this.tf.zc(n)}static fromJson(t){return new e(t?t.product_id:null,t?mt.fromJson(t.property_filters):null)}bt(){return{id:this.productId,pf:this.tf?this.tf.bt():null}}},yt=class e{constructor(e){this.if=e,this.if=e}zc(e){return this.if==null||q.sf(e[0],this.if)}static fromJson(t){return new e(t?t.campaign_id:null)}bt(){return this.if}},K={OPEN:`open`,Rr:`purchase`,hr:`push_click`,Ee:`custom_event`,Zr:`iam_click`,As:`test`},q=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.zc(n))}static sf(e,n){let r=null;try{r=window.atob(e)}catch(n){return t.info(`Failed to unencode analytics id `+e+`: `+j(n)),!1}return n===r.split(`_`)[0]}static fromJson(t){let n=t.type,r=null;switch(n){case e.Or.OPEN:case e.Or.As:break;case e.Or.Rr:r=_t.fromJson(t.data);break;case e.Or.Cc:r=vt.fromJson(t.data);break;case e.Or.hr:r=yt.fromJson(t.data);break;case e.Or.Ee:r=ft.fromJson(t.data);break;case e.Or.Pc:r=ht.fromJson(t.data);break;case e.Or.Zr:r=gt.fromJson(t.data)}return new e(n,r)}
3bt(){return{t:this.type,d:this.data?this.data.bt():null}}static Rn(t){let n,r=null;switch(t.t){case e.Or.OPEN:case e.Or.As:break;case e.Or.Rr:r=new _t(t.d);break;case e.Or.Cc:n=t.d||{},r=new vt(n.id,mt.Rn(n.pf||[]));break;case e.Or.hr:r=new yt(t.d);break;case e.Or.Ee:r=new ft(t.d);break;case e.Or.Pc:n=t.d||{},r=new ht(n.e,mt.Rn(n.pf||[]));break;case e.Or.Zr:r=new gt(t.d)}return new e(t.t,r)}};q.Or={OPEN:`open`,Rr:`purchase`,Cc:`purchase_property`,hr:`push_click`,Ee:`custom_event`,Pc:`custom_event_property`,Zr:`iam_click`,As:`test`},q.Ec={},q.Ec[q.Or.OPEN]=K.OPEN,q.Ec[q.Or.Rr]=K.Rr,q.Ec[q.Or.Cc]=K.Rr,q.Ec[q.Or.hr]=K.hr,q.Ec[q.Or.Ee]=K.Ee,q.Ec[q.Or.Pc]=K.Ee,q.Ec[q.Or.Zr]=K.Zr,q.Ec[q.Or.As]=K.As;var J=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.Jr=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.Jr=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.Jr==null||n<this.Jr;return r||t.info(`Trigger action ${this.type} is no longer eligible for display - fired ${n}ms ago and has a timeout of ${this.Jr}ms.`),!r}static fromJson(t){let n=t.id,r=[];for(let e=0;e<t.trigger_condition.length;e++)r.push(q.fromJson(t.trigger_condition[e]));let i=_(t.start_time),a=_(t.end_time),o=t.priority,s=t.type,l=t.delay,u=t.re_eligibility,d=t.timeout,f=t.data,p=t.min_seconds_since_last_trigger;return c(e.Or,s,`Could not construct Trigger from server data`,`Trigger.Types`)?new e(n,r,i,a,o,s,f,l,u,d,p):null}bt(){let e=[];for(let t=0;t<this.sd.length;t++)e.push(this.sd[t].bt());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.Jr,ss:this.hd,ld:this.od}}static Rn(t){let n=[],r=t.c||[];for(let e=0;e<r.length;e++)n.push(q.Rn(r[e]));return new e(t.i,n,y(t.s),y(t.e),t.p,t.t,t.da,t.d,t.r,t.tm,t.ss,t.ld)}};J.Or={Cr:`inapp`,md:`templated_iam`},J.td=-1;var bt={PORTRAIT:0,LANDSCAPE:1};function xt(){return screen.width<=600}function St(){if(`orientation`in window)return Math.abs(window.orientation)===90||window.orientation===270?bt.LANDSCAPE:bt.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`?bt.LANDSCAPE:bt.PORTRAIT}return bt.PORTRAIT}function Ct(e,t,n){e&&(t||n!=null&&n.metaKey?window.open(e):window.location=e)}function wt(){return window.location.href}var Tt={openUri:Ct,Uo:xt,No:St,$a:wt};function Et(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 Dt(e){return!(!e||(e=e.toString().toLowerCase()).lastIndexOf(`javascript:`,0)!==0&&e.lastIndexOf(`data:`,0)!==0)}var Ot=class{constructor(e,t,n,r){this.S=e,this.T=t,this.C=n,this.Cs=r,this.S=e,this.T=t,this.C=n,this.Cs=r,this.Mi=new O,Q.F(this.Mi),this.Bi=1e3,this._i=6e4,this.Pi=null,this.Gi=null,this.$i=null}Oi(){return this.Mi}Xi(e){return this.Mi.Dt(e)}Hi(){return this.Pi}Ji(e){this.Pi=e}ut(e,r,i,a){let o=new Be,s;if(r===n.Ki||e instanceof Ke){if(!e._t())return t.info(`This in-app message has already received an impression. Ignoring analytics event.`),o}else if((r===n.Li||e instanceof at&&r===n.Qi)&&!e.$t(a))return t.info(`This in-app message has already received a click. Ignoring analytics event.`),o;return s=e instanceof Ke?{trigger_ids:[e.triggerId]}:this.Vi(e),s==null?o:(e.messageExtras&&(s.message_extras=e.messageExtras),i!=null&&(s.bid=i),$.ut(r,s))}Wi(e,r){let i=new Be;if(!e.$t())return t.info(`This in-app message button has already received a click. Ignoring analytics event.`),i;let a=this.Vi(r);return a==null?i:e.id===ot.Yi?(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),$.ut(n.Qi,a))}Zi(e){let t=e.messageFields;return t!=null&&t.is_push_primer||!1}Ir(e){if(!(e instanceof G))return;let t=e=>{if(!e)return;let t=se(e);return le(t)?oe(ae.Mr,`In-App Message`):ue(t)&&!W.Tr()?oe(ae.wr,`In-App Message`):void 0};if(this.Zi(e)&&!W.Tr())return`In-App Message contains a push prompt, but is not eligible for a push prompt. Ignoring.`;let n=e.buttons||[],r;for(let e of n)if(e.clickAction===G.ClickAction.URI&&e.uri&&he.test(e.uri)&&
3(r=t(e.uri),r))return r;return e.clickAction===G.ClickAction.URI&&e.uri&&he.test(e.uri)?t(e.uri):void 0}Br(e,t){t!==this.$i&&this._r(),this.Gi=e,this.$i=t}_r(){this.Gi!=null&&(clearTimeout(this.Gi),this.Gi=null,this.$i=null)}qr(e,n,r,i){let a=this.S;if(!a)return;this.$i&&e.triggerId!==this.$i&&(this._r(),U.vi(this.C,U.O.Er));let o=a.Gr(!1,!1),s=a.H(o);s.template={trigger_id:e.triggerId,trigger_event_type:n},r!=null&&(s.template.data=r.Nr());let c=a.J(s,U.O.Er);a.V(s,(a=-1)=>{let o=this.S;if(!o)return;let l=new Date().valueOf();U.W(this.C,U.O.Er,l),a!==-1&&c.push([`X-Braze-Req-Tokens-Remaining`,a.toString()]);let u,d,f=!1;Ie.Y({url:`${o.Z()}/template/`,data:s,headers:c,tt:n=>{if(!o.st(s,n,c))return void(typeof e.$r==`function`&&e.$r());if(o.it(),n==null||n.templated_message==null)return;let r=n.templated_message;if(r.type!==J.Or.Cr)return;let i=ut(r.data);if(i==null)return;let a=this.Ir(i);if(a)return t.error(a),void(typeof e.$r==`function`&&e.$r());typeof e.Xr==`function`&&e.Xr(i)},error:t=>{f=!0,u=t,d=`getting user personalization for message ${e.triggerId}.`},nt:(t,a)=>{if(new Date().valueOf()-e.Hr<e.Jr){let t=0;if(f){let n=Math.min(e.Jr,this._i),r=this.Bi;i??=r,t=Math.min(n,ze(r,3*i))}o.rt(a,()=>{this.qr(e,n,r,t)},U.O.Er,t=>this.Br(t,e.triggerId),()=>this._r(),t)}f&&o.et(u,d)}})},U.O.Er)}Vi(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}sn(e){return!!this.C&&!(!(e&&e instanceof G&&e.constructor!==G)||e instanceof Ke)&&this.C.Bt(B.gt.Kr,e.bt())}Ar(){if(!this.C)return null;let e=this.C.ft(B.gt.Kr);if(!e)return null;let t;switch(e.type){case G.bo.Lr:t=st.Qr(e);break;case G.bo.Ur:case G.bo.po:case G.bo.Jo:t=at.Qr(e);break;case G.bo.Vr:case G.bo.Fo:t=ct.Qr(e);break;case G.bo.Wr:t=lt.Qr(e)}return t&&this.Yr(),t}Yr(){this.C&&this.C.Ut(B.gt.Kr)}},Y={aa:null,l:!1,ea:()=>(Y.p(),Y.aa||=new Ot(Q.g(),Q.P(),Q.j(),Q.ir()),Y.aa),p:()=>{Y.l||=(Q.h(Y),!0)},destroy:()=>{Y.aa=null,Y.l=!1}},kt=class e{constructor(e,t,n,r,i){this.triggerId=e,this.Xr=t,this.$r=n,this.Hr=r,this.Jr=i,this.triggerId=e,this.Xr=t,this.$r=n,this.Hr=r,this.Jr=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)}},At=class extends Me{constructor(e,t,n,r,i){super(),this.tg=e,this.Ts=t,this.C=n,this.Fi=r,this.ig=i,this.tg=e,this.Ts=t,this.C=n,this.Fi=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.C){this.hg=this.C.ft(B.gt.aE)||this.hg,this.ng=this.C.ft(B.gt.iE)||this.ng,this.og=this.C.ft(B.gt.nE)||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.C)return;this.lg=this.C.ft(B.gt.oE)||0;let e=this.C.ft(B.gt.rE)||[],t=[];for(let n=0;n<e.length;n++)t.push(J.Rn(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.Hr||0);if(s>0){let e,r;a.push(o),o.ug!=null&&(e=o.ug),o.dg!=null&&A.RE(o.dg)&&(r=A.Rn(o.dg));let c=[];if(o.pg&&l(o.pg))for(let e=0;e<o.pg.length;e++){let t=n[o.pg[e]];t!=null&&c.push(t)}this.eg.push(window.setTimeout(t(i,o.Hr||0,e,r,c),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.C&&this.C.Bt(B.gt.iE,this.ng)}mg(){if(!this.C)return;let e=[];for(let t=0;t<this.triggers.length;t++)e.push(this.triggers[t].bt());this.lg=new Date().valueOf(),this.C.Bt(B.gt.rE,e),this.C.Bt(B.gt.oE,this.lg)}bg(){this.C&&((this.C.ft(B.gt.oE)||0)>this.lg?this.ag():this.fg())}U(e){let n=!1;if(e!=null&&e.triggers){this.ig.Yr(),this.fg();let r={},i={};this.triggers=[];for(let t=0;t<e.triggers.length;t++){let a=J.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(K.As,null)){n=!0;break}this.triggers.push(a)}}m(this.og,r)||(this.og=r,this.C&&this.C.Bt(B.gt.nE,this.og)),m(this.ng,i)||(this.ng=i,this.C&&this.C.Bt(B.gt.iE,this.ng)),this.mg(),n&&(t.info(`Trigger with test c
3ondition found, firing test.`),this.Ce(K.As)),this.Ce(K.OPEN);let a=this.sg,o;this.sg=[];for(let e=0;e<a.length;e++)o=Array.prototype.slice.call(a[e]),this.Ce(...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===J.Or.Cr&&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.Ts.hc()===0?t.info(`Not displaying trigger ${e.id} because neither automaticallyShowInAppMessages() nor subscribeToInAppMessage() were called.`):(this.Ts.X([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 J.Or.Cr:if(c=ut(e.data),c==null){t.error(`Could not parse trigger data for trigger ${e.id}, ignoring.`);break}if(l=this.ig.Ir(c),l){t.error(l),s();break}o(c);break;case J.Or.md:if(u=kt.fromJson(e.data,o,s,n,e.Jr||0),u==null){t.error(`Could not parse trigger data for trigger ${e.id}, ignoring.`);break}this.ig.qr(u,r,i);break;default:t.error(`Trigger ${e.id} was of unexpected type ${e.type}, ignoring.`)}}Ce(e,n=null,r){if(!c(K,e,`Cannot fire trigger action.`,`TriggerEvents`))return;if(this.Fi&&this.Fi.dc())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,s=!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)&&(s=!1,l.push(r)))}}if(o)return void t.info(`Trigger event ${e} did not match any trigger conditions.`);if(s)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.C&&this.C.Ut(B.gt.rE),!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.C&&(this.C.Ut(B.gt.aE),this.C.Ut(B.gt.nE),this.C.Ut(B.gt.iE))}}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===K.As)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.Hr=t,a.ug=n,r!=null&&(o=r.bt()),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.C&&this.C.Bt(B.gt.iE,this.ng)}yg(e,t){this.fg(),e.ad(t),this.hg=t,e.id&&(this.og[e.id]=t),this.C&&(this.C.Bt(B.gt.aE,t),this.C.Bt(B.gt.nE,this.og))}},X={l:!1,provider:null,m:()=>(X.p(),X.provider||X.rg(),X.provider),rg:()=>{X.provider||(X.provider=new At(Q.ee(Z.Xh)??30,Y.ea().Oi(),Q.j(),Q.rn(),Y.ea()),Q._(X.provider))},p:()=>{X.l||=(X.rg(),Q.h(X),!0)},destroy:()=>{X.provider=null,X.l=!1}},jt=class e{constructor(e,t,n,r,i){this.endpoint=e,this.En=t,this.publicKey=n,this.Vl=r,this.fl=i,this.endpoint=e||null,this.En=t||null,this.publicKey=n||null,this.Vl=r||null,this.fl=i||null}bt(){return{e:this.endpoint,c:this.En,p:this.publicKey,u:this.Vl,v:this.fl}}static Rn(t){return new e(t.e,y(t.c),t.p,t.u,t.v)}},Mt=class{constructor(e,t){this.B=e,this.C=t,this.B=e,this.C=t}getUserId(){let e=this.C.tu(B.iu.su);if(e==null)return null;let t=e.eu,n=re(t);if(n>I.ur){for(;n>I.ur;)t=t.slice(0,t.length-1),n=re(t);e.eu=t,this.C.uu(B.iu.su,e)}return t}ou(e){let t=this.getUserId()==null;this.C.uu(B.iu.su,new M(e)),t&&this.C.ru(e)}setCustomUserAttribute(e,n){if(this.B.hu(e))return t.info(`Custom Attribute "`+e+`" is blocklisted, ignoring.`),!1;let r={};return r[e]=n,this.nu(I.lu,r,!0)}nu(e,n,r=!1,i=!1){let a=this.C.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}An(e,n,r,i,o){this.nu(`push_token`,e,!1,!0),this.nu(`custom_push_public_key`,r,!1,!0),this.nu(`custom_push_user_auth`,i,!1,!0),this.nu(`custom_push_vapid_public_key`,o,!1,!0);let s=a.Ls.Fs,c=new a(s,t),l=new jt(e,n,r,i,o);this.C.Bt(B.gt.zn,l.bt()),c.setItem(s.Ms.cu,s.be,!0)}xn(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=a.Ls.Fs,n=new a(e,t);this.C.Bt(B.gt.zn,!1),n.setItem(e.Ms.cu,e.be,!1)}}},Z={Yo:`allowCrawlerActivity`,Zo:`baseUrl`,Wh:`noCookies`,Vh:`devicePropertyAllowlist`,Da:`disablePushTokenMaintenance`,$h:`enableLogging`,Yh:`enableSdkAuthentication`,Ca:`manageServiceWorkerExternally`,Xh:`minimumIntervalBetweenTriggerActionsInSeconds`,Zh:`sessionTimeoutInSeconds`,Qh:`appVersion`,Ea:`appVersionNumber`,_a:`serviceWorkerLocation`,Ba:`safariWebsitePushId`,Zn:`localization`,er:`contentSecurityNonce`,re:`allowUserSuppliedJavascript`,Go:`inAppMessageZIndex`,Ko:`openInAppMessagesInNewTab`,tn:`openCardsInNewTab`,en:`openNewsFeedCardsInNewTab`,mh:`requireExplicitInAppMessageDismissal`,Ia:`doNotLoadFontAwesome`,Na:`deviceId`,Aa:`serviceWorker
3Scope`,Oa:`sdkFlavor`},Q=new class{constructor(){this.an=``,this.Ta=``,this.Ra=void 0,this.Pa=null,this.hn=null,this.S=null,this.Fi=null,this.B=null,this.T=null,this.C=null,this.Cs=null,this.La=``,this.isInitialized=!1,this.Ua=!1,this.Wa=new O,this.Va=new O,this.options={},this.Fa=[],this.Ka=[],this.Mi=[],this.Ta=`5.9.1`}Ga(e){this.Wa.Dt(e)}Nh(e){this.Va.Dt(e)}initialize(n,r){if(this.nn())return t.info(`Braze has already been initialized with an API key.`),!0;this.options=r||{};let i=this.ee(Z.$h),a=Et(Tt.$a());if(a&&a.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.an=n;let u=this.ee(Z.Zo);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 d=u;if(u=document.createElement(`a`),u.href=d,u.pathname===`/`&&(u=`${u}api/v3`),this.La=u.toString(),z.Ja&&!this.ee(Z.Yo))return t.info(`Ignoring activity from crawler bot `+navigator.userAgent),this.Ua=!0,!1;let f=this.ee(Z.Wh)||!1;if(this.C=Ge.Ya(n,f),f&&this.C.Ha(n),new V.se(null,!0).gr(B.me))return t.info(`Ignoring all activity due to previous opt out`),this.Ua=!0,!1;for(let e of p(this.options))s(o).indexOf(e)===-1&&t.warn(`Ignoring unknown initialization option '${e}'.`);let m=[`mparticle`,`wordpress`,`tealium`];if(this.ee(Z.Oa)!=null){let e=this.ee(Z.Oa);m.indexOf(e)===-1?t.error(`Invalid sdk flavor passed: `+e):this.Ra=e}let h=this.ee(o.Vh);if(h!=null)if(l(h)){let e=[];for(let t=0;t<h.length;t++)c(H,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.Na);if(g){let e=new M(g);this.C.uu(B.iu.Na,e)}this.hn=new Pe(this.C,h),this.B=new Ue(this.C),this.Cs=new Mt(this.B,this.C),this.T=new We(this.C,this.Cs,this.B,this.ee(Z.Zh));let _=new O;return this.Pa=new je(this.C,this.ee(Z.Yh),_),this.F(_),this.S=new Re(this.hn,this.C,this.Pa,this.Cs,this.T,this.B,this.an,this.La,this.Ta,this.Ra||``,this.ee(Z.Qh),this.ee(Z.Ea)),this.Fi=new Ve(this.an,this.La,this.T,this.hn,this.Cs,this.B,this.C,e=>{if(this.nn())for(let t of this.ar())t.U(e)},this.Pa,this.S),this.Fi.initialize(),f||this.C.Xa(),t.info(`Initialized for the Braze backend at "${this.ee(Z.Zo)}" with API key "${this.an}".`),X.p(),this.B.Ke(()=>{var t;this.isInitialized&&(t=this.B)!=null&&t.ke()&&e(()=>import(`./refresh-feature-flags-BmV-CkXS.js`).then(e=>e.n).then(e=>{this.isInitialized&&(0,e.default)()}),__vite__mapDeps([2,1]))}),this.Fi.on(()=>{var t;this.isInitialized&&(t=this.B)!=null&&t.ke()&&e(()=>import(`./refresh-feature-flags-BmV-CkXS.js`).then(e=>e.n).then(e=>{this.isInitialized&&(0,e.default)(void 0,void 0,!0)}),__vite__mapDeps([2,1]))}),this.Wa.X(this.options),this.isInitialized=!0,window.dispatchEvent(new CustomEvent(`braze.initialized`)),!0}destroy(e){if(t.destroy(),this.nn()){this.Va.X(),this.Va.removeAllSubscriptions();for(let e of this.Fa)e.destroy();this.Fa=[];for(let e of this.Ka)e.clearData(!1);this.S&&this.S.fo(),this.Ka=[],this.removeAllSubscriptions(),this.Mi=[],this.Fi!=null&&this.Fi.destroy(),this.Fi=null,this.Pa=null,this.hn=null,this.S=null,this.B=null,this.T=null,this.Cs=null,this.options={},this.Ra=void 0,this.isInitialized=!1,this.Ua=!1,e&&(this.C=null)}}rr(){return!this.Za()&&(!!this.nn()||(console.warn(`Braze must be initialized before calling methods.`),!1))}Ma(){return this.an}Sr(){return this.Pa}Z(){return this.La}ue(){return this.hn}g(){return this.S}ee(e){return this.options[e]}ar(){return this.Ka}rn(){return this.Fi}v(){return this.B}P(){return this.T}j(){return this.C}mr(){if(this.Cs&&this.Fi)return new I(this.Cs,this.Fi)}ir(){return this.Cs}tr(){return!0===this.ee(Z.re)}h(e){let t=!1;for(let n of this.Fa)n===e&&(t=!0);t||this.Fa.push(e)}_(e){let t=!1;for(let n of this.Ka)n.constructor===e.constructor&&(t=!0);e instanceof Me&&!t&&this.Ka.push(e)}F(e){e instanceof O&&this.Mi.push(e)}removeAllSubscriptions(){if(this.rr())for(let e of this.Mi)e.removeAllSubscriptions()}removeSubscription(e){if(this.rr())for(let t of this.Mi)t.removeSubscription(e)}fe(e){this.Ua=e}nn(){return this.isInitialized}Za(){return this.Ua}fi(){return this.Ta}},$={ut:(e,n,r)=>{let i=new Be,a=Q.P();if(!a)return t.info(`Not logging event with type "${e}" because the current session ID could not be found.`),i;let o=a.Qo();return i.$e.push(new A(r||Q.ir()?.getUserId(),e,new Date().valueOf(),o,n)),i.tt=Q.j()?.Vo(i.$e)||!1,i}};export{D as $,Ie as A,Ee as B,nt as C,W as D,Ke as E,V as F,N as G,xe as H,z as I,se as J,ae as K,R as L,H as M,Me as N,Be as O,B as P,O as Q,I as R,$e as S,Qe as T,P as U,we as V,F as W,re as X,oe as Y,j as Z,G as _,t as _t,X as a,h as at,Ye as b,Et as c,f as ct,K as d,p as dt,te as et,lt as f,c as ft,at as g,r as gt,ot as h,n as ht,jt as i,E as it,U as j,ze as k,bt as l,l as lt,st as m,i as mt,Q as n,C as nt,Y as o,_ as ot,ct as p,a as pt,le as q,Z as r,ee as rt,Dt as s,y as st,$ as t,w as tt,Tt as u,m as ut,it as v,tt as w,Ze as x,rt as y,he as z}; 4//# sourceMappingURL=event-logger-26BnyWLh.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.