New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@braze/web-sdk

Package Overview
Dependencies
Maintainers
1
Versions
56
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@braze/web-sdk - npm Package Compare versions

Comparing version 4.9.0 to 4.10.0

2

package.json
{
"name": "@braze/web-sdk",
"version": "4.9.0",
"version": "4.10.0",
"description": "Braze SDK for web sites and other JS platforms.",

@@ -5,0 +5,0 @@ "main": "src/index.js",

@@ -7,3 +7,3 @@ import ve from "./encoding-utils.js";

import ke from "./supported-options.js";
const r = { On: ve, q: De, Cr: Be, Z: Ge, xt: Oe, zt: Oe.ep, j: Ue, Jo: ke };
const r = { On: ve, q: De, Cr: Be, Z: Ge, xt: Oe, zt: Oe.ep, j: Ue, Yo: ke };
export default r;
const De = {
CustomEvent: "ce",
Pr: "p",
$u: "pc",
dc: "ca",
Va: "i",
Mu: "pc",
cc: "ca",
Ka: "i",
qs: "ie",

@@ -19,8 +19,8 @@ P: "cci",

eo: "iec",
Su: "lr",
ju: "uae",
Lu: "lr",
Tu: "uae",
R: "ci",
B: "cc",
Au: "lcaa",
qu: "lcar",
Ru: "lcaa",
Pu: "lcar",
Xn: "inc",

@@ -31,6 +31,6 @@ Jn: "add",

Kn: "ncam",
Cu: "sgu",
Nu: "sgu",
Fr: "ffi",
},
Be = { Br: "feed_displayed", vc: "content_cards_displayed" };
Be = { Br: "feed_displayed", dc: "content_cards_displayed" };
export { De as EventTypes, Be as InternalEventTypes };

@@ -341,3 +341,3 @@ export default class Oe {

Jt: {
Ja: "data",
Na: "data",
kr: "pushClicks",

@@ -344,0 +344,0 @@ cu: "pushSubscribed",

@@ -27,3 +27,3 @@ const Ue = {

if (Ue.zg) {
const o = "Braze SDK Warning: " + n + " (v4.9.0)";
const o = "Braze SDK Warning: " + n + " (v4.10.0)";
null != Ue.j ? Ue.j(o) : console.warn(o);

@@ -34,3 +34,3 @@ }

if (Ue.zg) {
const o = "Braze SDK Error: " + n + " (v4.9.0)";
const o = "Braze SDK Error: " + n + " (v4.10.0)";
null != Ue.j ? Ue.j(o) : console.error(o);

@@ -37,0 +37,0 @@ }

@@ -13,2 +13,3 @@ export default {

Oo: "appVersion",
Po: "appVersionNumber",
_a: "serviceWorkerLocation",

@@ -18,4 +19,4 @@ ka: "safariWebsitePushId",

po: "contentSecurityNonce",
Co: "enableHtmlInAppMessages",
Lo: "allowUserSuppliedJavascript",
Ro: "enableHtmlInAppMessages",
Co: "allowUserSuppliedJavascript",
lo: "inAppMessageZIndex",

@@ -25,5 +26,5 @@ fo: "openInAppMessagesInNewTab",

mh: "requireExplicitInAppMessageDismissal",
Po: "doNotLoadFontAwesome",
Ro: "sdkFlavor",
Lo: "doNotLoadFontAwesome",
Mo: "sdkFlavor",
tn: "openCardsInNewTab",
};
import e from "../managers/braze-instance.js";
import r from "../../shared-lib/braze-shared-lib.js";
export function getDeviceId(i) {
export function getDeviceId(t) {
if (!e.rr()) return;
null == i &&
r.j.error(
"getDeviceId must be supplied with a callback. e.g., braze.getDeviceId(function(deviceId) {console.log('the device id is ' + deviceId)})",
);
const t = e.te();
"function" == typeof i && t && i(t.ce().id);
const i = e.te();
if (!i) return;
const c = i.ce().id;
if ("function" != typeof t) return c;
r.j.warn(
"The callback for getDeviceId is deprecated. You can access its return value directly instead (e.g. `const id = braze.getDeviceId()`)",
),
t(c);
}

@@ -10,7 +10,7 @@ import kt from "./auth-manager.js";

validateValueIsFromEnum as H,
values as Lt,
values as Pt,
} from "../util/code-utils.js";
import { logDeprecationWarning as z } from "../util/deprecation-utils.js";
import Pt from "./network-manager.js";
import Rt from "../request-controller.js";
import Rt from "./network-manager.js";
import Lt from "../request-controller.js";
import Mt from "./server-config-manager.js";

@@ -40,2 +40,3 @@ import Dt from "./session-manager.js";

Oo: "appVersion",
Po: "appVersionNumber",
_a: "serviceWorkerLocation",

@@ -45,4 +46,4 @@ ka: "safariWebsitePushId",

po: "contentSecurityNonce",
Co: "enableHtmlInAppMessages",
Lo: "allowUserSuppliedJavascript",
Ro: "enableHtmlInAppMessages",
Co: "allowUserSuppliedJavascript",
lo: "inAppMessageZIndex",

@@ -53,4 +54,4 @@ fo: "openInAppMessagesInNewTab",

mh: "requireExplicitInAppMessageDismissal",
Po: "doNotLoadFontAwesome",
Ro: "sdkFlavor",
Lo: "doNotLoadFontAwesome",
Mo: "sdkFlavor",
};

@@ -60,5 +61,5 @@ class Wt {

(this.cn = ""),
(this.Mo = ""),
(this.jo = void 0),
(this.Do = null),
(this.jo = ""),
(this.Do = void 0),
(this.Uo = null),
(this.fn = null),

@@ -71,18 +72,18 @@ (this.gt = null),

(this.ft = null),
(this.Uo = ""),
(this.Bo = !1),
(this.Bo = ""),
(this.Wo = !1),
(this.zo = new E()),
(this.zo = !1),
(this.Vo = new E()),
(this.Go = new E()),
(this.options = {}),
(this.Go = []),
(this.Ko = []),
(this.Ho = []),
(this.Ve = []),
(this.Mo = "4.9.0");
(this.jo = "4.10.0");
}
Ho(t) {
this.zo.lt(t);
$o(t) {
this.Vo.lt(t);
}
Rh(t) {
this.Vo.lt(t);
this.Go.lt(t);
}

@@ -116,8 +117,8 @@ initialize(t, s) {

"/" === o.pathname && (o = `${o}api/v3`),
(this.Uo = o.toString()),
V.$o && !this.nn(L.ho))
(this.Bo = o.toString()),
V.qo && !this.nn(L.ho))
)
return (
r.j.info("Ignoring activity from crawler bot " + navigator.userAgent),
(this.Wo = !0),
(this.zo = !0),
!1

@@ -127,20 +128,20 @@ );

if (
((this.u = Bt.qo(t, a)), a && this.u.xo(t), new O.ee(null, !0).jr(i.re))
((this.u = Bt.xo(t, a)), a && this.u.Jo(t), new O.ee(null, !0).jr(i.re))
)
return (
r.j.info("Ignoring all activity due to previous opt out"),
(this.Wo = !0),
(this.zo = !0),
!1
);
for (const t of oo(this.options))
-1 === Lt(r.Jo).indexOf(t) &&
-1 === Pt(r.Yo).indexOf(t) &&
r.j.warn(`Ignoring unknown initialization option '${t}'.`);
const l = ["mparticle", "wordpress", "tealium"];
if (null != this.nn(L.Ro)) {
const t = this.nn(L.Ro);
if (null != this.nn(L.Mo)) {
const t = this.nn(L.Mo);
-1 !== l.indexOf(t)
? (this.jo = t)
? (this.Do = t)
: r.j.error("Invalid sdk flavor passed: " + t);
}
let u = this.nn(r.Jo.Io);
let u = this.nn(r.Yo.Io);
if (null != u)

@@ -168,8 +169,8 @@ if (p(u)) {

return (
(this.Do = new kt(this.u, this.nn(L.So), f)),
(this.Uo = new kt(this.u, this.nn(L.So), f)),
this.jt(f),
(this.gt = new Pt(
(this.gt = new Rt(
this.fn,
this.u,
this.Do,
this.Uo,
this.ft,

@@ -179,10 +180,11 @@ this._e,

this.cn,
this.Uo,
this.Mo,
this.jo || "",
this.Bo,
this.jo,
this.Do || "",
this.nn(L.Oo),
this.nn(L.Po),
)),
(this.ki = new Rt(
(this.ki = new Lt(
this.cn,
this.Uo,
this.Bo,
this._e,

@@ -196,3 +198,3 @@ this.fn,

},
this.Do,
this.Uo,
this.gt,

@@ -206,3 +208,3 @@ )),

),
null != this.nn(L.Co) &&
null != this.nn(L.Ro) &&
z(

@@ -215,7 +217,7 @@ "enableHtmlInAppMessages",

this.wt.Ci(() => {
this.Bo &&
this.Wo &&
this.wt &&
this.wt.vi() &&
import("../FeatureFlags/refresh-feature-flags.js").then((t) => {
if (!this.Bo) return;
if (!this.Wo) return;
(0, t.default)();

@@ -225,12 +227,12 @@ });

this.ki.pr(() => {
this.Bo &&
this.Wo &&
this.wt &&
this.wt.vi() &&
import("../FeatureFlags/refresh-feature-flags.js").then((t) => {
if (!this.Bo) return;
if (!this.Wo) return;
(0, t.default)(void 0, void 0, !0);
});
}),
this.zo.Et(this.options),
(this.Bo = !0),
this.Vo.Et(this.options),
(this.Wo = !0),
!0

@@ -241,7 +243,7 @@ );

if ((r.j.destroy(), this.fe())) {
this.Vo.Et(), this.Vo.removeAllSubscriptions();
for (const t of this.Go) t.destroy();
this.Go = [];
for (const t of this.Ko) t.clearData(!1);
(this.Ko = []),
this.Go.Et(), this.Go.removeAllSubscriptions();
for (const t of this.Ko) t.destroy();
this.Ko = [];
for (const t of this.Ho) t.clearData(!1);
(this.Ho = []),
this.removeAllSubscriptions(),

@@ -251,3 +253,3 @@ (this.Ve = []),

(this.ki = null),
(this.Do = null),
(this.Uo = null),
(this.fn = null),

@@ -259,5 +261,5 @@ (this.gt = null),

(this.options = {}),
(this.jo = void 0),
(this.Bo = !1),
(this.Do = void 0),
(this.Wo = !1),
(this.zo = !1),
t && (this.u = null);

@@ -267,3 +269,3 @@ }

rr() {
if (this.Yo()) return !1;
if (this.Xo()) return !1;
if (!this.fe()) throw new Error(P);

@@ -276,6 +278,6 @@ return !0;

Sr() {
return this.Do;
return this.Uo;
}
Ys() {
return this.Uo;
return this.Bo;
}

@@ -292,3 +294,3 @@ te() {

gr() {
return this.Ko;
return this.Ho;
}

@@ -314,13 +316,13 @@ cr() {

nr() {
return !0 === this.nn(L.Lo) || !0 === this.nn(L.Co);
return !0 === this.nn(L.Co) || !0 === this.nn(L.Ro);
}
g(t) {
let i = !1;
for (const s of this.Go) s === t && (i = !0);
i || this.Go.push(t);
for (const s of this.Ko) s === t && (i = !0);
i || this.Ko.push(t);
}
dr(t) {
let i = !1;
for (const s of this.Ko) s.constructor === t.constructor && (i = !0);
t instanceof y && !i && this.Ko.push(t);
for (const s of this.Ho) s.constructor === t.constructor && (i = !0);
t instanceof y && !i && this.Ho.push(t);
}

@@ -337,12 +339,12 @@ jt(t) {

ne(t) {
this.Wo = t;
this.zo = t;
}
fe() {
return this.Bo;
}
Yo() {
return this.Wo;
}
Xo() {
return this.zo;
}
ks() {
return this.Mo;
return this.jo;
}

@@ -349,0 +351,0 @@ }

@@ -7,3 +7,3 @@ import V from "../util/browser-detector.js";

import { STORAGE_KEYS as i } from "../managers/storage-manager.js";
import { values as Lt } from "../util/code-utils.js";
import { values as Pt } from "../util/code-utils.js";
import { getErrorMessage as ei } from "../util/error-utils.js";

@@ -15,8 +15,8 @@ export default class Ot {

(this.u = t),
null == e && (e = Lt(DeviceProperties)),
null == e && (e = Pt(DeviceProperties)),
(this.Qo = e);
}
ce(t = !0) {
let e = this.u.tu(i.eu.Xo);
null == e && ((e = new _t(r.Z.Y())), t && this.u.uu(i.eu.Xo, e));
let e = this.u.tu(i.eu.Zo);
null == e && ((e = new _t(r.Z.Y())), t && this.u.uu(i.eu.Zo, e));
const s = new xt(e.iu);

@@ -29,9 +29,9 @@ for (let t = 0; t < this.Qo.length; t++) {

case DeviceProperties.BROWSER_VERSION:
s.Zo = V.version;
s.Ia = V.version;
break;
case DeviceProperties.OS:
s.os = this.Ia();
s.os = this.Ta();
break;
case DeviceProperties.RESOLUTION:
s.Ta = screen.width + "x" + screen.height;
s.Da = screen.width + "x" + screen.height;
break;

@@ -42,3 +42,3 @@ case DeviceProperties.LANGUAGE:

case DeviceProperties.TIME_ZONE:
s.timeZone = this.Da(new Date());
s.timeZone = this.Oa(new Date());
break;

@@ -51,8 +51,8 @@ case DeviceProperties.USER_AGENT:

}
Ia() {
if (V.Oa()) return V.Oa();
const t = this.u.v(i.k.Ca);
return t && t.os_version ? t.os_version : V.Ia();
Ta() {
if (V.Ca()) return V.Ca();
const t = this.u.v(i.k.Fa);
return t && t.os_version ? t.os_version : V.Ta();
}
Da(t) {
Oa(t) {
let e = !1;

@@ -74,5 +74,5 @@ if ("undefined" != typeof Intl && "function" == typeof Intl.DateTimeFormat)

const s = t.getTimezoneOffset();
return this.Fa(s);
return this.Ga(s);
}
Fa(t) {
Ga(t) {
const e = Math.trunc(t / 60),

@@ -79,0 +79,0 @@ r = Math.trunc(t % 60);

@@ -13,7 +13,7 @@ import qt from "../models/backend-errors.js";

import { LAST_REQUEST_TO_ENDPOINT_MS_AGO_DEFAULT as Ht } from "../common/constants.js";
export default class Pt {
constructor(t, e, s, i, r, o, n, a, h, u, c) {
export default class Rt {
constructor(t, e, s, i, r, o, n, h, a, u, c, l) {
(this.fn = t),
(this.u = e),
(this.Do = s),
(this.Uo = s),
(this.ft = i),

@@ -23,9 +23,10 @@ (this._e = r),

(this.cn = n),
(this.Uo = a),
(this.Mo = h),
(this.jo = u),
(this.Bo = h),
(this.jo = a),
(this.Do = u),
(this.appVersion = c),
(this.Xh = l),
(this.fn = t),
(this.u = e),
(this.Do = s),
(this.Uo = s),
(this.ft = i),

@@ -35,7 +36,8 @@ (this._e = r),

(this.cn = n),
(this.Uo = a),
(this.Mo = h),
(this.jo = u),
(this.Bo = h),
(this.jo = a),
(this.Do = u),
(this.appVersion = c),
(this.Ra = ["npm"]);
(this.Xh = l),
(this.$h = ["npm"]);
}

@@ -45,15 +47,16 @@ Bs(t, e = !1, s = !1) {

o = r.Kr(),
n = this.u.v(i.k.Ca);
n = this.u.v(i.k.Fa);
ii(n, o) || (t.device = o),
(t.api_key = this.cn),
(t.time = h(new Date().valueOf(), !0));
const a = this.u.v(i.k.Xa) || [],
u = this.u.v(i.k.Ea) || "";
const a = this.u.v(i.k.Kh) || [],
u = this.u.v(i.k.Wh) || "";
if (
(this.Ra.length > 0 &&
(!ii(a, this.Ra) || u !== this._e.Pa()) &&
(t.sdk_metadata = this.Ra),
(t.sdk_version = this.Mo),
this.jo && (t.sdk_flavor = this.jo),
(this.$h.length > 0 &&
(!ii(a, this.$h) || u !== this._e.Yh()) &&
(t.sdk_metadata = this.$h),
(t.sdk_version = this.jo),
this.Do && (t.sdk_flavor = this.Do),
(t.app_version = this.appVersion),
(t.app_version_code = this.Xh),
(t.device_id = r.id),

@@ -73,3 +76,3 @@ e)

let e;
this.Do.Hh();
this.Uo.Hh();
const s = { errorCode: o.error_code };

@@ -86,8 +89,8 @@ for (const t of i)

: (e = `with error code ${o.error_code}.`),
this.Do.wh() ||
this.Uo.wh() ||
(e +=
' Please use the "enableSdkAuthentication" initialization option to enable authentication.'),
r.j.error(`SDK Authentication failed ${e}`),
this.$a(t.events || [], t.attributes || []),
this.Do.Bh(s),
this.Qh(t.events || [], t.attributes || []),
this.Uo.Bh(s),
!1

@@ -100,3 +103,3 @@ );

switch (o) {
case qt.Na:
case qt.Vh:
return (

@@ -108,3 +111,3 @@ (i = "Received successful response with empty body."),

);
case qt.Ha:
case qt.Zh:
return (

@@ -116,10 +119,10 @@ (i = "Received successful response with invalid JSON"),

);
case qt.Ka:
o = `The API key "${t.api_key}" is invalid for the baseUrl ${this.Uo}`;
case qt.Ra:
o = `The API key "${t.api_key}" is invalid for the baseUrl ${this.Bo}`;
break;
case qt.Ua:
case qt.Xa:
o =
"Sorry, we are not currently accepting your requests. If you think this is in error, please contact us.";
break;
case qt.La:
case qt.Ea:
o = "No device identifier. Please contact support@braze.com";

@@ -131,10 +134,10 @@ }

}
Wa(t, e, s, i) {
Pa(t, e, s, i) {
return !!((t && 0 !== t.length) || (e && 0 !== e.length) || s || i);
}
Ya(t, e, s, i, r = !1) {
$a(t, e, s, i, r = !1) {
const o = [],
n = (t) => t || "",
a = n(this.ft.getUserId());
let h = this.Jr(t, e);
h = n(this.ft.getUserId());
let a = this.Jr(t, e);
const u = [],

@@ -147,8 +150,8 @@ c = [];

for (const e of s) {
if (((l = e.Kr()), this.Do.wh())) {
if (a && !l.user_id) {
if (((l = e.Kr()), this.Uo.wh())) {
if (h && !l.user_id) {
f || (f = {}), f.events || (f.events = []), f.events.push(l);
continue;
}
if (n(l.user_id) !== a) {
if (n(l.user_id) !== h) {
c.push(l);

@@ -160,3 +163,3 @@ continue;

}
t.length > 0 && (h.events = t);
t.length > 0 && (a.events = t);
}

@@ -166,15 +169,15 @@ if (i.length > 0) {

for (const e of i)
e && (this.Do.wh() && n(e.user_id) !== a ? u.push(e) : t.push(e));
t.length > 0 && (h.attributes = t);
e && (this.Uo.wh() && n(e.user_id) !== h ? u.push(e) : t.push(e));
t.length > 0 && (a.attributes = t);
}
if ((this.$a(c, u), (h = this.Bs(h, !0, r)), f)) {
if ((this.Qh(c, u), (a = this.Bs(a, !0, r)), f)) {
f = this.Bs(f, !1, r);
const t = { requestData: f, headers: this.Hs(f, T.Os.Ja) };
const t = { requestData: f, headers: this.Hs(f, T.Os.Na) };
o.push(t);
}
if (h && !this.Wa(h.events, h.attributes, t, e)) return f ? o : null;
const d = { requestData: h, headers: this.Hs(h, T.Os.Ja) };
if (a && !this.Pa(a.events, a.attributes, t, e)) return f ? o : null;
const d = { requestData: a, headers: this.Hs(a, T.Os.Na) };
return o.push(d), o;
}
$a(t, e) {
Qh(t, e) {
if (t) {

@@ -188,3 +191,3 @@ const e = [];

}
if (e) for (const t of e) this.u.Qa(t);
if (e) for (const t of e) this.u.Ha(t);
}

@@ -196,3 +199,3 @@ ii(t, e) {

qr(t) {
return s.N(r.q.Va, { n: t });
return s.N(r.q.Ka, { n: t });
}

@@ -209,6 +212,6 @@ Jr(t, e, s) {

}
Za(t) {
Ua(t) {
const e = new Date().valueOf();
let s = Ht.toString();
const i = T.Ga(this.u, t);
const i = T.La(this.u, t);
if (-1 !== i) {

@@ -221,14 +224,14 @@ s = (e - i).toString();

const r = [["X-Braze-Api-Key", this.cn]],
o = this.Za(e);
o = this.Ua(e);
r.push(["X-Braze-Last-Req-Ms-Ago", o]);
const n = T.Xh(this.u, e).toString();
const n = T.Wa(this.u, e).toString();
r.push(["X-Braze-Req-Attempt", n]);
let a = !1;
let h = !1;
if (
(null != t.respond_with &&
t.respond_with.triggers &&
(r.push(["X-Braze-TriggersRequest", "true"]), (a = !0)),
(r.push(["X-Braze-TriggersRequest", "true"]), (h = !0)),
null != t.respond_with &&
t.respond_with.feed &&
(r.push(["X-Braze-FeedRequest", "true"]), (a = !0)),
(r.push(["X-Braze-FeedRequest", "true"]), (h = !0)),
e === T.Os.Ks)

@@ -240,11 +243,11 @@ ) {

r.push(["BRAZE-SYNC-RETRY-COUNT", t.toString()]),
(a = !0);
(h = !0);
}
if (
(e === T.Os.Si &&
(r.push(["X-Braze-FeatureFlagsRequest", "true"]), (a = !0)),
a && r.push(["X-Braze-DataRequest", "true"]),
this.Do.wh())
(r.push(["X-Braze-FeatureFlagsRequest", "true"]), (h = !0)),
h && r.push(["X-Braze-DataRequest", "true"]),
this.Uo.wh())
) {
const t = this.Do.jh();
const t = this.Uo.jh();
null != t && r.push(["X-Braze-Auth-Signature", t]);

@@ -263,10 +266,10 @@ }

ti() {
this.Do.ti();
this.Uo.ti();
}
Ys() {
return this.Uo;
return this.Bo;
}
addSdkMetadata(t) {
for (const e of t) -1 === this.Ra.indexOf(e) && this.Ra.push(e);
for (const e of t) -1 === this.$h.indexOf(e) && this.$h.push(e);
}
}

@@ -31,3 +31,3 @@ import { STORAGE_KEYS as i } from "../managers/storage-manager.js";

}
Pa() {
Yh() {
const s = this.u.tu(i.eu.Dl);

@@ -34,0 +34,0 @@ return null == s ? null : s.iu;

import O, { STORAGE_KEYS as i } from "./storage-manager.js";
import r from "../../shared-lib/braze-shared-lib.js";
const Bt = {
qo: function (e, o = !1) {
xo: function (e, o = !1) {
let t = !1;

@@ -9,5 +9,5 @@ try {

try {
localStorage.setItem(i.k.ec, "true"),
localStorage.getItem(i.k.ec) &&
(localStorage.removeItem(i.k.ec), (t = !0));
localStorage.setItem(i.k.Qa, "true"),
localStorage.getItem(i.k.Qa) &&
(localStorage.removeItem(i.k.Qa), (t = !0));
} catch (e) {

@@ -28,8 +28,8 @@ if (

}
const a = Bt.oc(),
n = new O.tc(e, a && !o, t);
const a = Bt.Ja(),
n = new O.Va(e, a && !o, t);
let c;
return (c = t ? new O.rc(e) : new O.ac()), new O(n, c);
return (c = t ? new O.Ya(e) : new O.Za()), new O(n, c);
},
oc: function () {
Ja: function () {
return (

@@ -36,0 +36,0 @@ navigator.cookieEnabled ||

@@ -7,3 +7,3 @@ import be from "../models/braze-event.js";

validateValueIsFromEnum as H,
values as Lt,
values as Pt,
} from "../util/code-utils.js";

@@ -17,13 +17,13 @@ import r from "../../shared-lib/braze-shared-lib.js";

su: "ab.storage.userId",
Xo: "ab.storage.deviceId",
Zo: "ab.storage.deviceId",
Dl: "ab.storage.sessionId",
},
k: {
ec: "ab.test",
Qa: "ab.test",
tE: "ab.storage.events",
eE: "ab.storage.attributes",
sE: "ab.storage.attributes.anonymous_user",
Ca: "ab.storage.device",
Xa: "ab.storage.sdk_metadata",
Ea: "ab.storage.session_id_for_cached_metadata",
Fa: "ab.storage.device",
Kh: "ab.storage.sdk_metadata",
Wh: "ab.storage.session_id_for_cached_metadata",
Bn: "ab.storage.pushToken",

@@ -64,3 +64,3 @@ Bi: "ab.storage.newsFeed",

}
xo(t) {
Jo(t) {
const e = oo(STORAGE_KEYS.eu),

@@ -166,3 +166,3 @@ s = new O.ee(t);

}
Qa(t) {
Ha(t) {
let e = this._E.jr(STORAGE_KEYS.k.eE);

@@ -206,3 +206,3 @@ null == e && (e = {});

(r[User.bu] = t),
this.Qa(r));
this.Ha(r));
}

@@ -223,3 +223,3 @@ const s = this.tu(STORAGE_KEYS.eu.Dl);

}
(O.rc = class {
(O.Ya = class {
constructor(t) {

@@ -256,3 +256,3 @@ (this.cn = t), (this.cn = t), (this.gE = V.OE() ? 3 : 10);

}),
(O.ac = class {
(O.Za = class {
constructor() {

@@ -331,3 +331,3 @@ (this.fE = {}), (this.bE = 5242880), (this.gE = 3);

DE() {
const t = Lt(STORAGE_KEYS.eu),
const t = Pt(STORAGE_KEYS.eu),
e = document.cookie.split(";");

@@ -403,3 +403,3 @@ for (let s = 0; s < e.length; s++) {

}),
(O.tc = class {
(O.Va = class {
constructor(t, e, s) {

@@ -409,4 +409,4 @@ (this.cn = t),

e && this.GE.push(new O.ee(t)),
s && this.GE.push(new O.rc(t)),
this.GE.push(new O.ac());
s && this.GE.push(new O.Ya(t)),
this.GE.push(new O.Za());
}

@@ -413,0 +413,0 @@ store(t, e) {

@@ -17,3 +17,3 @@ import r from "../../shared-lib/braze-shared-lib.js";

}
ic() {
tc() {
return Object.keys(this.Ve).length;

@@ -20,0 +20,0 @@ }

export default {
Ka: "invalid_api_key",
Ua: "blacklisted",
La: "no_device_identifier",
Ha: "invalid_json_response",
Na: "empty_response",
Ra: "invalid_api_key",
Xa: "blacklisted",
Ea: "no_device_identifier",
Zh: "invalid_json_response",
Vh: "empty_response",
__: "sdk_auth_error",
};

@@ -1,2 +0,2 @@

import { isObject as yt } from "../util/code-utils.js";
import { isObject as Nt } from "../util/code-utils.js";
import {

@@ -42,3 +42,3 @@ convertMsToSeconds as h,

static TE(t) {
return null != t && yt(t) && null != t.t && "" !== t.t;
return null != t && Nt(t) && null != t.t && "" !== t.t;
}

@@ -45,0 +45,0 @@ static Yn(t) {

@@ -9,3 +9,3 @@ export default class xt {

null != this.browser && (s.browser = this.browser),
null != this.Zo && (s.browser_version = this.Zo),
null != this.Ia && (s.browser_version = this.Ia),
null != this.os && (s.os_version = this.os),

@@ -12,0 +12,0 @@ null != this.resolution && (s.resolution = this.resolution),

@@ -31,3 +31,3 @@ export default class Kt {

return {
s: "4.9.0",
s: "4.10.0",
l: this.ol,

@@ -46,5 +46,5 @@ e: this.cl,

return (
"4.9.0" !== t.s && (i = 0), new Kt(i, t.e, t.a, t.p, t.m, t.v, t.c, t.f)
"4.10.0" !== t.s && (i = 0), new Kt(i, t.e, t.a, t.p, t.m, t.v, t.c, t.f)
);
}
}

@@ -11,4 +11,4 @@ import C from "./util/net.js";

import T from "./util/request-header-utils.js";
export default class Rt {
constructor(t, i, s, e, o, h, n, r, u, l) {
export default class Lt {
constructor(t, i, s, e, h, o, n, r, u, l) {
(this.cn = t),

@@ -18,30 +18,30 @@ (this.baseUrl = i),

(this.fn = e),
(this.ft = o),
(this.wt = h),
(this.ft = h),
(this.wt = o),
(this.u = n),
(this.$h = r),
(this.Do = u),
(this.fu = r),
(this.Uo = u),
(this.gt = l),
(this.cn = t),
(this.baseUrl = i),
(this.Kh = 0),
(this.gu = 0),
(this.gE = n.RE() || 0),
(this.Wh = null),
(this.vu = null),
(this._e = s),
(this.fn = e),
(this.ft = o),
(this.wt = h),
(this.ft = h),
(this.wt = o),
(this.u = n),
(this.Do = u),
(this.Uo = u),
(this.gt = l),
(this.$h = r),
(this.Qh = new E()),
(this.Vh = null),
(this.Yh = 50),
(this.Zh = !1);
(this.fu = r),
(this.wu = new E()),
(this.ku = null),
(this.yu = 50),
(this.ju = !1);
}
fu(t, i) {
return !t && !i && this.Do.Jh() >= this.Yh;
Su(t, i) {
return !t && !i && this.Uo.Jh() >= this.yu;
}
gu(t) {
$u(t) {
let i = this._e.El();

@@ -57,4 +57,4 @@ if (t.length > 0) {

}
vu(t = !1, s = !1, e = !0, o, h, n, u = !1, l = !1) {
e && this.wu();
qu(t = !1, s = !1, e = !0, h, o, n, u = !1, l = !1) {
e && this.Au();
const a = this.u.cE(),

@@ -65,3 +65,3 @@ c = this.u.AE();

let r = !1;
T.Ws(this.u, T.Os.Ja, new Date().valueOf()),
T.Ws(this.u, T.Os.Na, new Date().valueOf()),
C.Xs({

@@ -74,15 +74,15 @@ url: this.baseUrl + "/data/",

t.respond_with.triggers &&
(this.Kh = Math.max(this.Kh - 1, 0)),
(this.gu = Math.max(this.gu - 1, 0)),
this.gt.Zs(t, e, s)
? (this.Do.ti(),
? (this.Uo.ti(),
this.wt.ul(e),
(null != t.respond_with &&
t.respond_with.user_id != this.ft.getUserId()) ||
(null != t.device && this.u.D(i.k.Ca, t.device),
(null != t.device && this.u.D(i.k.Fa, t.device),
null != t.sdk_metadata &&
(this.u.D(i.k.Xa, t.sdk_metadata),
this.u.D(i.k.Ea, this._e.Pa())),
this.$h(e),
T.si(this.u, T.Os.Ja, 1),
"function" == typeof o && o()))
(this.u.D(i.k.Kh, t.sdk_metadata),
this.u.D(i.k.Wh, this._e.Yh())),
this.fu(e),
T.si(this.u, T.Os.Na, 1),
"function" == typeof h && h()))
: e.auth_error && (r = !0);

@@ -93,14 +93,14 @@ },

t.respond_with.triggers &&
(this.Kh = Math.max(this.Kh - 1, 0)),
this.gt.$a(t.events, t.attributes),
"function" == typeof h && h();
(this.gu = Math.max(this.gu - 1, 0)),
this.gt.Qh(t.events, t.attributes),
"function" == typeof o && o();
},
ei: (t) => {
if (("function" == typeof n && n(t), e && !d)) {
if (t && !r) this.ku();
if (t && !r) this.Cu();
else {
T.hi(this.u, T.Os.Ja);
let t = this.Wh;
T.hi(this.u, T.Os.Na);
let t = this.vu;
(null == t || t < 1e3 * this.gE) && (t = 1e3 * this.gE),
this.ku(Math.min(3e5, D(1e3 * this.gE, 3 * t)));
this.Cu(Math.min(3e5, D(1e3 * this.gE, 3 * t)));
}

@@ -112,12 +112,12 @@ d = !0;

},
m = this.gu(a),
m = this.$u(a),
g = s || m;
if (this.fu(u, m))
if (this.Su(u, m))
return void r.j.info(
"Declining to flush data due to 50 consecutive authentication failures",
);
if (e && !this.gt.Wa(a, c, t, g))
return this.ku(), void ("function" == typeof n && n(!0));
const v = this.gt.Ya(t, g, a, c, l);
g && this.Kh++;
if (e && !this.gt.Pa(a, c, t, g))
return this.Cu(), void ("function" == typeof n && n(!0));
const v = this.gt.$a(t, g, a, c, l);
g && this.gu++;
let p = !1;

@@ -127,13 +127,13 @@ if (v)

this.gt.Qs(t.requestData, () => f(t.requestData, t.headers)), (p = !0);
this.Do.wh() && e && !p
? this.ku()
: m && (r.j.info("Invoking new session subscriptions"), this.Qh.Et());
this.Uo.wh() && e && !p
? this.Cu()
: m && (r.j.info("Invoking new session subscriptions"), this.wu.Et());
}
yu() {
return this.Kh > 0;
Du() {
return this.gu > 0;
}
ku(t = 1e3 * this.gE) {
this.Zh ||
(this.wu(),
(this.Vh = window.setTimeout(() => {
Cu(t = 1e3 * this.gE) {
this.ju ||
(this.Au(),
(this.ku = window.setTimeout(() => {
if (document.hidden) {

@@ -143,34 +143,34 @@ const t = "visibilitychange",

document.hidden ||
(document.removeEventListener(t, i, !1), this.vu());
(document.removeEventListener(t, i, !1), this.qu());
};
document.addEventListener(t, i, !1);
} else this.vu();
} else this.qu();
}, t)),
(this.Wh = t));
(this.vu = t));
}
wu() {
null != this.Vh && (clearTimeout(this.Vh), (this.Vh = null));
Au() {
null != this.ku && (clearTimeout(this.ku), (this.ku = null));
}
initialize() {
(this.Zh = !1), this.ku();
(this.ju = !1), this.Cu();
}
destroy() {
this.Qh.removeAllSubscriptions(),
this.Do.Gh(),
this.wu(),
(this.Zh = !0),
this.vu(void 0, void 0, !1, void 0, void 0, void 0, void 0, !0),
(this.Vh = null);
this.wu.removeAllSubscriptions(),
this.Uo.Gh(),
this.Au(),
(this.ju = !0),
this.qu(void 0, void 0, !1, void 0, void 0, void 0, void 0, !0),
(this.ku = null);
}
pr(t) {
return this.Qh.lt(t);
return this.wu.lt(t);
}
openSession() {
const t = this._e.Pa() !== this._e.co();
t && (this.u.uE(i.eu.Xo), this.u.uE(i.eu.su), this.u.ni(i.k.qi)),
this.vu(void 0, !1, void 0, void 0, void 0),
const t = this._e.Yh() !== this._e.co();
t && (this.u.uE(i.eu.Zo), this.u.uE(i.eu.su)),
this.qu(void 0, !1, void 0, void 0, void 0),
this.pu(),
t &&
import("./Push/push-manager-factory.js").then((t) => {
if (this.Zh) return;
if (this.ju) return;
const s = t.default.m();

@@ -191,21 +191,25 @@ if (

},
o = () => {
h = () => {
const s = this.u.v(i.k.Bn);
(null == s || s) && t();
},
h = r.zt.Ft;
new r.xt(h, r.j).hr(h.Jt.cu, e, o);
o = r.zt.Ft;
new r.xt(o, r.j).hr(o.Jt.cu, e, h);
}
});
}
Fu() {
this.u.ni(i.k.Ri), this.u.ni(i.k.Yt), this.u.ni(i.k.rn);
}
changeUser(t, s, e) {
const o = this.ft.getUserId();
if (o !== t) {
const h = this.ft.getUserId();
if (h !== t) {
this._e.kl(),
null != o && this.vu(void 0, !1, void 0, void 0, void 0),
this.Fu(),
null != h && this.qu(void 0, !1, void 0, void 0, void 0),
this.ft.ru(t),
e ? this.Do.setSdkAuthenticationSignature(e) : this.Do.yh();
for (let t = 0; t < s.length; t++) s[t].changeUser(null == o);
null != o && this.u.ni(i.k.L),
this.u.ni(i.k.Ca),
e ? this.Uo.setSdkAuthenticationSignature(e) : this.Uo.yh();
for (let t = 0; t < s.length; t++) s[t].changeUser(null == h);
null != h && this.u.ni(i.k.L),
this.u.ni(i.k.Fa),
this.openSession(),

@@ -216,4 +220,4 @@ r.j.info('Changed user to "' + t + '".');

e &&
this.Do.jh() !== e &&
(this.Do.setSdkAuthenticationSignature(e),
this.Uo.jh() !== e &&
(this.Uo.setSdkAuthenticationSignature(e),
(i = "Updated SDK authentication signature")),

@@ -224,4 +228,4 @@ r.j.info(`Current user is already ${t}. ${i}`);

requestImmediateDataFlush(t) {
this.wu(), this._e.co();
this.vu(
this.Au(), this._e.co();
this.qu(
void 0,

@@ -241,3 +245,3 @@ void 0,

requestFeedRefresh() {
this._e.co(), this.vu(!0);
this._e.co(), this.qu(!0);
}

@@ -247,11 +251,11 @@ $r(t, i) {

r.j.info("Requesting explicit trigger refresh."),
this.vu(void 0, !0, void 0, t, i);
this.qu(void 0, !0, void 0, t, i);
}
$n(t, i) {
const e = r.q.ju,
o = { a: t, l: i },
h = s.N(e, o);
return h && r.j.info(`Logged alias ${t} with label ${i}`), h;
const e = r.q.Tu,
h = { a: t, l: i },
o = s.N(e, h);
return o && r.j.info(`Logged alias ${t} with label ${i}`), o;
}
Gn(i, e, o) {
Gn(i, e, h) {
if (this.wt.hu(e))

@@ -261,6 +265,6 @@ return (

);
const h = { key: e, value: o },
n = s.N(i, h);
const o = { key: e, value: h },
n = s.N(i, o);
if (n) {
const t = "object" == typeof o ? JSON.stringify(o, null, 2) : o;
const t = "object" == typeof h ? JSON.stringify(h, null, 2) : h;
r.j.info(`Logged custom attribute: ${e} with value: ${t}`);

@@ -270,8 +274,8 @@ }

}
setLastKnownLocation(t, i, e, o, h, n) {
setLastKnownLocation(t, i, e, h, o, n) {
const u = { latitude: i, longitude: e };
null != o && (u.altitude = o),
null != h && (u.ll_accuracy = h),
null != h && (u.altitude = h),
null != o && (u.ll_accuracy = o),
null != n && (u.alt_accuracy = n);
const l = s.N(r.q.Su, u, t || void 0);
const l = s.N(r.q.Lu, u, t || void 0);
return (

@@ -287,11 +291,11 @@ l &&

const s = this._e.co();
return new be(this.ft.getUserId(), r.q.$u, t, s, { cid: i });
return new be(this.ft.getUserId(), r.q.Mu, t, s, { cid: i });
}
pu() {
const t = r.zt.Ft;
new r.xt(t, r.j).setItem(t.Jt.Ja, 1, {
new r.xt(t, r.j).setItem(t.Jt.Na, 1, {
baseUrl: this.baseUrl,
data: { api_key: this.cn, device_id: this.fn.ce().id },
userId: this.ft.getUserId(),
sdkAuthEnabled: this.Do.wh(),
sdkAuthEnabled: this.Uo.wh(),
});

@@ -301,3 +305,3 @@ }

for (const i of t)
if (i.api_key === this.cn) this.gt.$a(i.events, i.attributes);
if (i.api_key === this.cn) this.gt.Qh(i.events, i.attributes);
else {

@@ -308,3 +312,3 @@ const t = r.zt.Ft;

}
Zn(i, e, o) {
Zn(i, e, h) {
if (this.wt.hu(i))

@@ -314,8 +318,8 @@ return (

);
let h, n;
let o, n;
return (
null === e && null === o
? ((h = r.q.qu), (n = { key: i }))
: ((h = r.q.Au), (n = { key: i, latitude: e, longitude: o })),
s.N(h, n)
null === e && null === h
? ((o = r.q.Pu), (n = { key: i }))
: ((o = r.q.Ru), (n = { key: i, latitude: e, longitude: h })),
s.N(o, n)
);

@@ -325,4 +329,4 @@ }

const e = { group_id: t, status: i };
return s.N(r.q.Cu, e);
return s.N(r.q.Nu, e);
}
}

@@ -1,2 +0,2 @@

import { isDate as Nt } from "../../util/code-utils.js";
import { isDate as yt } from "../../util/code-utils.js";
import {

@@ -36,3 +36,3 @@ convertMsToSeconds as h,

return this.Al === sr.Rl.Ml
? null != s && Nt(s) && ts(s) <= this._l.valueOf()
? null != s && yt(s) && ts(s) <= this._l.valueOf()
: null != s && typeof s == typeof this._l && s >= this._l;

@@ -43,3 +43,3 @@ case sr.Il.Pl:

return this.Al === sr.Rl.Ml
? null != s && Nt(s) && ts(s) >= this._l.valueOf()
? null != s && yt(s) && ts(s) >= this._l.valueOf()
: null != s && typeof s == typeof this._l && s <= this._l;

@@ -58,5 +58,5 @@ case sr.Il.Yl:

case sr.Il.Ul:
return null != s && Nt(s) && es(s) < this._l;
return null != s && yt(s) && es(s) < this._l;
case sr.Il.Ql:
return null != s && Nt(s) && es(s) > this._l;
return null != s && yt(s) && es(s) > this._l;
case sr.Il.Eu:

@@ -83,3 +83,3 @@ return (

return (
Nt(this._l) && (t = h(t.valueOf())),
yt(this._l) && (t = h(t.valueOf())),
{ k: this.Tl, t: this.Al, c: this.comparator, v: t }

@@ -92,3 +92,3 @@ );

}
(sr.Rl = { Tu: "boolean", _u: "number", Nu: "string", Ml: "date" }),
(sr.Rl = { _u: "boolean", Hu: "number", Iu: "string", Ml: "date" }),
(sr.Il = {

@@ -95,0 +95,0 @@ Xl: 1,

@@ -15,4 +15,4 @@ import Qt from "./custom-event-data.js";

}
sc(e, t) {
return ri.cc[this.type] === e && (null == this.data || this.data.Bl(t));
ec(e, t) {
return ri.rc[this.type] === e && (null == this.data || this.data.Bl(t));
}

@@ -40,3 +40,3 @@ static Bu(e, t) {

break;
case ri.Wr.nc:
case ri.Wr.sc:
r = is.fromJson(e.data);

@@ -50,3 +50,3 @@ break;

break;
case ri.Wr.lc:
case ri.Wr.ac:
r = Zt.fromJson(e.data);

@@ -72,3 +72,3 @@ break;

break;
case ri.Wr.nc:
case ri.Wr.sc:
(t = e.d || {}), (r = new is(t.id, Yt.Yn(t.pf || [])));

@@ -82,3 +82,3 @@ break;

break;
case ri.Wr.lc:
case ri.Wr.ac:
(t = e.d || {}), (r = new Zt(t.e, Yt.Yn(t.pf || [])));

@@ -95,17 +95,17 @@ break;

Rr: "purchase",
nc: "purchase_property",
sc: "purchase_property",
zr: "push_click",
$e: "custom_event",
lc: "custom_event_property",
ac: "custom_event_property",
ro: "iam_click",
zs: "test",
}),
(ri.cc = {}),
(ri.cc[ri.Wr.OPEN] = tt.OPEN),
(ri.cc[ri.Wr.Rr] = tt.Rr),
(ri.cc[ri.Wr.nc] = tt.Rr),
(ri.cc[ri.Wr.zr] = tt.zr),
(ri.cc[ri.Wr.$e] = tt.$e),
(ri.cc[ri.Wr.lc] = tt.$e),
(ri.cc[ri.Wr.ro] = tt.ro),
(ri.cc[ri.Wr.zs] = tt.zs);
(ri.rc = {}),
(ri.rc[ri.Wr.OPEN] = tt.OPEN),
(ri.rc[ri.Wr.Rr] = tt.Rr),
(ri.rc[ri.Wr.sc] = tt.Rr),
(ri.rc[ri.Wr.zr] = tt.zr),
(ri.rc[ri.Wr.$e] = tt.$e),
(ri.rc[ri.Wr.ac] = tt.$e),
(ri.rc[ri.Wr.ro] = tt.ro),
(ri.rc[ri.Wr.zs] = tt.zs);

@@ -9,5 +9,5 @@ import {

export default class mt {
constructor(t, i = [], s, e, r = 0, h, l, o = 0, n = mt.Du, a, u, d) {
constructor(t, i = [], s, e, r = 0, h, l, o = 0, n = mt.Ju, a, u, d) {
(this.id = t),
(this.Pu = i),
(this.Vu = i),
(this.startTime = s),

@@ -18,9 +18,9 @@ (this.endTime = e),

(this.data = l),
(this.Iu = o),
(this.Mu = n),
(this.Gu = o),
(this.Ku = n),
(this.sn = a),
(this.Fu = u),
(this.Hu = d),
(this.Ou = u),
(this.Qu = d),
(this.id = t),
(this.Pu = i || []),
(this.Vu = i || []),
void 0 === s && (s = null),

@@ -32,23 +32,23 @@ (this.startTime = s),

(this.type = h),
(this.Iu = o || 0),
null == a && (a = 1e3 * (this.Iu + 30)),
(this.Gu = o || 0),
null == a && (a = 1e3 * (this.Gu + 30)),
(this.sn = a),
(this.data = l),
null != n && (this.Mu = n),
(this.Fu = u),
(this.Hu = d || null);
null != n && (this.Ku = n),
(this.Ou = u),
(this.Qu = d || null);
}
Ju(t) {
Uu(t) {
return (
null == this.Hu || (this.Mu !== mt.Du && t - this.Hu >= 1e3 * this.Mu)
null == this.Qu || (this.Ku !== mt.Ju && t - this.Qu >= 1e3 * this.Ku)
);
}
Lu(t) {
this.Hu = t;
Wu(t) {
this.Qu = t;
}
Ru(t) {
const i = t + 1e3 * this.Iu;
Xu(t) {
const i = t + 1e3 * this.Gu;
return Math.max(i - new Date().valueOf(), 0);
}
Vu(t) {
Yu(t) {
const i = new Date().valueOf() - t,

@@ -89,3 +89,3 @@ s = null == t || isNaN(i) || null == this.sn || i < this.sn;

const t = [];
for (let i = 0; i < this.Pu.length; i++) t.push(this.Pu[i].ss());
for (let i = 0; i < this.Vu.length; i++) t.push(this.Vu[i].ss());
return {

@@ -99,7 +99,7 @@ i: this.id,

da: this.data,
d: this.Iu,
r: this.Mu,
d: this.Gu,
r: this.Ku,
tm: this.sn,
ss: this.Fu,
ld: this.Hu,
ss: this.Ou,
ld: this.Qu,
};

@@ -127,2 +127,2 @@ }

}
(mt.Wr = { Vr: "inapp", Gu: "templated_iam" }), (mt.Du = -1);
(mt.Wr = { Vr: "inapp", Zu: "templated_iam" }), (mt.Ju = -1);

@@ -45,3 +45,3 @@ import y from "../common/base-provider.js";

const i = this.triggers[t];
i.id && null != this.og[i.id] && i.Lu(this.og[i.id]);
i.id && null != this.og[i.id] && i.Wu(this.og[i.id]);
}

@@ -75,3 +75,3 @@ }

const n = t[r],
o = i.Ru(n.Zr || 0);
o = i.Xu(n.Zr || 0);
if (o > 0) {

@@ -124,6 +124,6 @@ let t, r;

null != this.og[r.id] &&
(r.Lu(this.og[r.id]), (e[r.id] = this.og[r.id])),
(r.Wu(this.og[r.id]), (e[r.id] = this.og[r.id])),
r.id && null != this.ng[r.id] && (h[r.id] = this.ng[r.id]);
for (let t = 0; t < r.Pu.length; t++)
if (r.Pu[t].sc(tt.zs, null)) {
for (let t = 0; t < r.Vu.length; t++)
if (r.Vu[t].ec(tt.zs, null)) {
s = !0;

@@ -153,3 +153,3 @@ break;

const h = new Date().valueOf();
if (!t.Vu(i))
if (!t.Yu(i))
return !1 === navigator.onLine && t.type === mt.Wr.Vr && e.imageUrl

@@ -160,4 +160,4 @@ ? (r.j.info(

void this.ig.Ji(t.id, InAppMessage.Ie.Uh))
: void (t.Ju(h) && this.wg(t, h, s)
? 0 === this.yt.ic()
: void (t.Uu(h) && this.wg(t, h, s)
? 0 === this.yt.tc()
? r.j.info(

@@ -170,3 +170,3 @@ `Not displaying trigger ${t.id} because neither automaticallyShowInAppMessages() nor subscribeToInAppMessage() were called.`,

));
t.type === mt.Wr.Gu
t.type === mt.Wr.Zu
? this.ig.Ji(t.id, InAppMessage.Ie.Qr)

@@ -179,3 +179,3 @@ : this.ig.Ji(t.id, InAppMessage.Ie.bh);

if (null != n)
if ((this.Tg(n, i, s, e, h), n.Vu(i))) {
if ((this.Tg(n, i, s, e, h), n.Yu(i))) {
let t = `Server aborted in-app message display, but the timeout on fallback trigger ${n.id} has already elapsed.`;

@@ -190,3 +190,3 @@ h.length > 0 && (t += " Continuing to fall back."),

);
const o = 1e3 * n.Iu - (new Date().valueOf() - i);
const o = 1e3 * n.Gu - (new Date().valueOf() - i);
o > 0

@@ -217,3 +217,3 @@ ? this.eg.push(

break;
case mt.Wr.Gu:
case mt.Wr.Zu:
if (((g = wt.fromJson(t.data, n, o, i, t.sn || 0)), null == g)) {

@@ -237,3 +237,3 @@ r.j.error(

if (!H(tt, t, "Cannot fire trigger action.", "TriggerEvents")) return;
if (this.ki && this.ki.yu())
if (this.ki && this.ki.Du())
return (

@@ -253,5 +253,5 @@ r.j.info(

const r = this.triggers[s],
h = e + 1e3 * r.Iu;
h = e + 1e3 * r.Gu;
if (
r.Ju(h) &&
r.Uu(h) &&
(null == r.startTime || r.startTime.valueOf() <= e) &&

@@ -261,4 +261,4 @@ (null == r.endTime || r.endTime.valueOf() >= e)

let s = !1;
for (let e = 0; e < r.Pu.length; e++)
if (r.Pu[e].sc(t, i)) {
for (let e = 0; e < r.Vu.length; e++)
if (r.Vu[e].ec(t, i)) {
s = !0;

@@ -287,3 +287,3 @@ break;

this.Tg(l, e, t, s, a),
0 === l.Iu
0 === l.Gu
? this.cg(l, e, t, s, a)

@@ -293,3 +293,3 @@ : this.eg.push(

this.cg(l, e, t, s, a);
}, 1e3 * l.Iu),
}, 1e3 * l.Gu),
));

@@ -319,3 +319,3 @@ }

);
let e = t.Fu;
let e = t.Ou;
return null == e && (e = this.tg), i - this.hg >= 1e3 * e;

@@ -336,3 +336,3 @@ }

this.fg(),
t.Lu(s),
t.Wu(s),
(this.hg = s),

@@ -339,0 +339,0 @@ t.id && (this.og[t.id] = s),

import e, { OPTIONS as L } from "../../managers/braze-instance.js";
export function attachCSS(n, t, o) {
const c = n || document.querySelector("head"),
s = `ab-${t}-css-definitions-${"4.9.0".replace(/\./g, "-")}`;
s = `ab-${t}-css-definitions-${"4.10.0".replace(/\./g, "-")}`;
if (!c) return;

@@ -6,0 +6,0 @@ const a = c.ownerDocument || document;

import e, { OPTIONS as L } from "../../managers/braze-instance.js";
export function loadFontAwesome() {
if (e.nn(L.Po)) return;
if (e.nn(L.Lo)) return;
const t = "https://use.fontawesome.com/7f85a56ba4.css";

@@ -5,0 +5,0 @@ if (

import {
isArray as p,
isDate as Nt,
isObject as yt,
isDate as yt,
isObject as Nt,
validateValueIsFromEnum as H,

@@ -24,7 +24,8 @@ } from "../util/code-utils.js";

getUserId(t) {
null == t &&
r.j.error(
"getUserId must be supplied with a callback. e.g., braze.getUser().getUserId(function(userId) {console.log('the user id is ' + userId)})",
),
"function" == typeof t && t(this.ft.getUserId());
const e = this.ft.getUserId();
if ("function" != typeof t) return e;
r.j.warn(
"The callback for getUserId is deprecated. You can access its return value directly instead (e.g. `const id = braze.getUser().getUserId()`)",
),
t(e);
}

@@ -186,3 +187,3 @@ addAlias(t, e) {

for (const t of e) if (!i(t)) return !1;
} else if (yt(e)) {
} else if (Nt(e)) {
if (!i(e)) return !1;

@@ -193,3 +194,3 @@ if (s) return this.ki.Gn(r.q.Kn, t, e).O;

if (
(Nt(e) && (e = $t(e)),
(yt(e) && (e = $t(e)),
"string" == typeof e &&

@@ -196,0 +197,0 @@ !ot(

@@ -6,3 +6,3 @@ import { isArray as p } from "./code-utils.js";

ef() {}
Ia(t) {}
Ta(t) {}
static rf(t, e) {

@@ -9,0 +9,0 @@ if (t && e)

@@ -12,3 +12,3 @@ import ni from "./client-hints-parser.js";

(this.OS = null),
this.Ia().then((t) => (this.OS = t));
this.Ta().then((t) => (this.OS = t));
const i = navigator;

@@ -22,3 +22,3 @@ (this.language = (

).toLowerCase()),
(this.$o = gi.vg(this.userAgent));
(this.qo = gi.vg(this.userAgent));
}

@@ -28,9 +28,9 @@ OE() {

}
Oa() {
Ca() {
return this.OS || null;
}
Ia() {
Ta() {
return this.OS
? Promise.resolve(this.OS)
: this.Sg.Ia(gi.Og).then((t) => ((this.OS = t), t));
: this.Sg.Ta(gi.Og).then((t) => ((this.OS = t), t));
}

@@ -37,0 +37,0 @@ static vg(t) {

@@ -12,3 +12,3 @@ import ge from "./base-device-parser.js";

) {
const t = this.Uu();
const t = this.ic();
(this.browser = t.browser || "Unknown Browser"),

@@ -25,3 +25,3 @@ (this.version = t.version || "Unknown Version");

}
Ia(t) {
Ta(t) {
if (this.OS) return Promise.resolve(this.OS);

@@ -41,3 +41,3 @@ const s = (s) => {

}
Uu() {
ic() {
const t = {},

@@ -47,3 +47,3 @@ s = this.userAgentData.brands;

for (const r of s) {
const s = this.Ou(oi),
const s = this.nc(oi),
i = r.brand.match(s);

@@ -57,7 +57,7 @@ if (i && i.length > 0) {

}
Ou(t) {
nc(t) {
const s = [];
for (const r in t) {
const i = r;
t[i] !== oi.Ku && s.push(t[i]);
t[i] !== oi.oc && s.push(t[i]);
}

@@ -64,0 +64,0 @@ return new RegExp("(" + s.join("|") + ")", "i");

@@ -1,2 +0,2 @@

import { isDate as Nt } from "./code-utils.js";
import { isDate as yt } from "./code-utils.js";
export function convertMsToSeconds(e, n = !1) {

@@ -15,3 +15,3 @@ let t = e / 1e3;

export function toValidBackendTimeString(e) {
return null != e && Nt(e) ? e.toISOString().replace(/\.[0-9]{3}Z$/, "") : e;
return null != e && yt(e) ? e.toISOString().replace(/\.[0-9]{3}Z$/, "") : e;
}

@@ -18,0 +18,0 @@ export function rehydrateDateAfterJsonization(e) {

export const Browsers = {
pE: "Chrome",
xE: "Edge",
Ku: "Internet Explorer",
oc: "Internet Explorer",
FE: "Opera",

@@ -6,0 +6,0 @@ Bg: "Safari",

@@ -21,11 +21,11 @@ import r from "../../shared-lib/braze-shared-lib.js";

}
export const DOMUtils = { Wu: null, no: _isInView };
export const DOMUtils = { lc: null, no: _isInView };
export const DIRECTIONS = { Oe: "up", Qe: "down", W: "left", X: "right" };
export function supportsPassive() {
if (null == DOMUtils.Wu) {
DOMUtils.Wu = !1;
if (null == DOMUtils.lc) {
DOMUtils.lc = !1;
try {
const t = Object.defineProperty({}, "passive", {
get: () => {
DOMUtils.Wu = !0;
DOMUtils.lc = !0;
},

@@ -39,3 +39,3 @@ });

}
return DOMUtils.Wu;
return DOMUtils.lc;
}

@@ -42,0 +42,0 @@ export function addPassiveEventListener(t, n, e = () => {}) {

@@ -31,3 +31,3 @@ import r from "../../shared-lib/braze-shared-lib.js";

const s = {
error: "" === e.responseText ? qt.Na : qt.Ha,
error: "" === e.responseText ? qt.Vh : qt.Zh,
response: e.responseText,

@@ -34,0 +34,0 @@ };

import { REQUEST_ATTEMPT_DEFAULT as Ae } from "../common/constants.js";
import { STORAGE_KEYS as i } from "../managers/storage-manager.js";
const T = {
Os: { Ja: "d", Ks: "cc", Si: "ff", Lr: "t" },
Qu: (e) => {
Os: { Na: "d", Ks: "cc", Si: "ff", Lr: "t" },
rm: (e) => {
if (e) return e.v(i.k.EE);
},
Xu: (e) => {
sm: (e) => {
if (e) return e.v(i.k.lE);
},
Yu: (e, t) => {
nm: (e, t) => {
e && e.D(i.k.EE, t);
},
Zu: (e, t) => {
um: (e, t) => {
e && e.D(i.k.lE, t);
},
Ga: (e, t) => {
La: (e, t) => {
if (!e || !t) return -1;
const r = T.Qu(e);
const r = T.rm(e);
if (null == r) return -1;

@@ -24,6 +24,6 @@ const s = r[t];

},
Xh: (e, t) => {
Wa: (e, t) => {
let r = Ae;
if (!e || !t) return r;
const s = T.Xu(e);
const s = T.sm(e);
return null == s ? r : ((r = s[t]), null == r || isNaN(r) ? Ae : r);

@@ -33,13 +33,13 @@ },

if (!e || !t) return;
let s = T.Qu(e);
null == s && (s = {}), (s[t] = r), T.Yu(e, s);
let s = T.rm(e);
null == s && (s = {}), (s[t] = r), T.nm(e, s);
},
si: (e, t, r) => {
if (!e || !t) return;
let s = T.Xu(e);
null == s && (s = {}), (s[t] = r), T.Zu(e, s);
let s = T.sm(e);
null == s && (s = {}), (s[t] = r), T.um(e, s);
},
hi: (e, t) => {
if (!e || !t) return;
const r = T.Xh(e, t);
const r = T.Wa(e, t);
T.si(e, t, r + 1);

@@ -46,0 +46,0 @@ },

@@ -5,3 +5,3 @@ import ge from "./base-device-parser.js";

constructor() {
super(), (this.rd = ai.Uu(navigator.userAgent || ""));
super(), (this.rd = ai.ic(navigator.userAgent || ""));
}

@@ -14,3 +14,3 @@ tf() {

}
Ia(r) {
Ta(r) {
for (let n = 0; n < r.length; n++) {

@@ -27,3 +27,3 @@ const e = r[n].string;

}
static Uu(r) {
static ic(r) {
let n,

@@ -36,3 +36,3 @@ e =

return (
(n = /\brv[ :]+(\.?\d+(\.\d+)*)/g.exec(r) || []), [oi.Ku, n[1] || ""]
(n = /\brv[ :]+(\.?\d+(\.\d+)*)/g.exec(r) || []), [oi.oc, n[1] || ""]
);

@@ -82,3 +82,3 @@ if (-1 !== r.indexOf("(Web0S; Linux/SmartTV)"))

const r = e[0].toLowerCase();
"msie" === r && (e[0] = oi.Ku),
"msie" === r && (e[0] = oi.oc),
"crios" === r && (e[0] = oi.pE),

@@ -85,0 +85,0 @@ "tizen" === r && ((e[0] = "Samsung Smart TV"), (e[1] = null)),

import {
isArray as p,
isDate as Nt,
isObject as yt,
isDate as yt,
isObject as Nt,
keys as oo,

@@ -49,3 +49,3 @@ } from "./code-utils.js";

return (
null == t || "number" === e || "boolean" === e || Nt(t) || "string" === e
null == t || "number" === e || "boolean" === e || yt(t) || "string" === e
);

@@ -63,3 +63,3 @@ }

if (
(Nt(t[r]) && (e[r] = $t(t[r])),
(yt(t[r]) && (e[r] = $t(t[r])),
!_validateNestedProperties(t[r], e[r], i))

@@ -69,7 +69,7 @@ )

} else {
if (!yt(t)) return validatePropertyType(t);
if (!Nt(t)) return validatePropertyType(t);
for (const r of oo(t)) {
const n = t[r];
if (o && !validateCustomAttributeKey(r)) return !1;
if (Nt(n)) {
if (yt(n)) {
e[r] = $t(n);

@@ -86,3 +86,3 @@ }

(a =
yt(t) || p(t)
Nt(t) || p(t)
? _validateNestedProperties(t, e, i ? 1 : -1)

@@ -132,3 +132,3 @@ : validatePropertyType(t)),

}
Nt(n) && (l[r] = $t(n));
yt(n) && (l[r] = $t(n));
if (

@@ -168,3 +168,3 @@ !_validateEventPropertyValue(

} else {
if (!yt(r)) return i(), [!1, !1];
if (!Nt(r)) return i(), [!1, !1];
if (n) return i(), [!1, !1];

@@ -171,0 +171,0 @@ if (

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc