@braze/web-sdk 6.7.1 → 6.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (138) hide show
  1. package/index.d.ts +165 -38
  2. package/package.json +1 -1
  3. package/shared-lib/encoding-utils.js +2 -2
  4. package/shared-lib/event-types.js +16 -16
  5. package/shared-lib/indexed-db-adapter.js +65 -65
  6. package/shared-lib/logger.js +18 -18
  7. package/shared-lib/supported-options.js +1 -1
  8. package/src/Banner/banner-provider.js +67 -59
  9. package/src/Banner/banner.js +40 -19
  10. package/src/Banner/dismiss-banner.js +4 -0
  11. package/src/Banner/display/banner-to-html.js +10 -10
  12. package/src/Banner/display/destroy-banner-html.js +2 -2
  13. package/src/Banner/get-all-banners.js +6 -6
  14. package/src/Banner/get-banner.js +6 -6
  15. package/src/Banner/index.js +1 -0
  16. package/src/Banner/log-banner-click.js +7 -7
  17. package/src/Banner/log-banner-dismissal.js +7 -7
  18. package/src/Banner/log-banner-impressions.js +27 -18
  19. package/src/Banner/request-banners-refresh.js +8 -8
  20. package/src/Banner/subscribe-to-banners-updates.js +5 -5
  21. package/src/Banner/ui/insert-banner.js +8 -8
  22. package/src/Card/card-manager.js +31 -31
  23. package/src/Card/log-card-dismissal.js +2 -2
  24. package/src/Card/log-content-card-click.js +2 -2
  25. package/src/Card/log-content-card-impressions.js +4 -4
  26. package/src/Card/models/captioned-image.js +15 -15
  27. package/src/Card/models/card.js +89 -89
  28. package/src/Card/models/classic-card.js +16 -16
  29. package/src/Card/models/control-card.js +7 -7
  30. package/src/Card/models/image-only.js +13 -13
  31. package/src/Card/util/card-factory.js +32 -32
  32. package/src/ContentCards/content-cards-provider-factory.js +13 -11
  33. package/src/ContentCards/content-cards-provider.js +105 -105
  34. package/src/ContentCards/get-cached-content-cards.js +2 -2
  35. package/src/ContentCards/request-content-cards-refresh.js +2 -2
  36. package/src/ContentCards/subscribe-to-content-cards-updates.js +10 -10
  37. package/src/ContentCards/ui/show-content-cards.js +7 -7
  38. package/src/Core/add-sdk-metadata.js +2 -2
  39. package/src/Core/change-user.js +5 -5
  40. package/src/Core/destroy.js +2 -2
  41. package/src/Core/disable-sdk.js +4 -4
  42. package/src/Core/enable-sdk.js +4 -4
  43. package/src/Core/get-device-id.js +2 -2
  44. package/src/Core/handle-braze-action.js +5 -5
  45. package/src/Core/index.js +1 -0
  46. package/src/Core/log-custom-event.js +5 -5
  47. package/src/Core/log-ecommerce-event.js +29 -0
  48. package/src/Core/log-purchase.js +23 -198
  49. package/src/Core/open-session.js +10 -10
  50. package/src/Core/set-logger.js +2 -2
  51. package/src/Core/set-sdk-authentication-signature.js +1 -1
  52. package/src/Core/subscribe-to-sdk-authentication-failures.js +1 -1
  53. package/src/Core/toggle-logging.js +2 -2
  54. package/src/Core/wipe-data.js +6 -6
  55. package/src/DUST/dust-connection-core.js +1 -0
  56. package/src/DUST/dust-provider-factory.js +10 -10
  57. package/src/DUST/dust-provider.js +258 -226
  58. package/src/DUST/dust-shared-worker-code.js +1 -1
  59. package/src/DUST/dust-shared-worker-impl.js +97 -103
  60. package/src/DUST/dust-worker-bridge.js +55 -40
  61. package/src/DUST/subscribe-to-dust.js +7 -7
  62. package/src/FeatureFlags/feature-flag-factory.js +8 -8
  63. package/src/FeatureFlags/feature-flag.js +3 -3
  64. package/src/FeatureFlags/feature-flags-provider.js +21 -21
  65. package/src/FeatureFlags/log-feature-flag-impression.js +5 -5
  66. package/src/FeatureFlags/subscribe-to-feature-flags-updates.js +1 -1
  67. package/src/InAppMessage/constants.js +3 -3
  68. package/src/InAppMessage/defer-in-app-message.js +3 -3
  69. package/src/InAppMessage/display/html-message-to-html.js +4 -4
  70. package/src/InAppMessage/display/in-app-message-to-html.js +32 -32
  71. package/src/InAppMessage/display/modal-utils.js +2 -2
  72. package/src/InAppMessage/in-app-message-factory.js +36 -36
  73. package/src/InAppMessage/in-app-message-manager.js +35 -35
  74. package/src/InAppMessage/log-in-app-message-button-click.js +3 -3
  75. package/src/InAppMessage/log-in-app-message-click.js +3 -3
  76. package/src/InAppMessage/log-in-app-message-html-click.js +3 -3
  77. package/src/InAppMessage/log-in-app-message-impression.js +3 -3
  78. package/src/InAppMessage/models/control-message.js +4 -4
  79. package/src/InAppMessage/models/full-screen-message.js +9 -9
  80. package/src/InAppMessage/models/html-message.js +2 -2
  81. package/src/InAppMessage/models/in-app-message-button.js +4 -4
  82. package/src/InAppMessage/models/in-app-message.js +34 -34
  83. package/src/InAppMessage/models/modal-message.js +7 -7
  84. package/src/InAppMessage/models/slide-up-message.js +8 -8
  85. package/src/InAppMessage/ui/show-in-app-message.js +20 -20
  86. package/src/Push/push-manager.js +44 -44
  87. package/src/User/user-manager.js +19 -19
  88. package/src/User/user.js +17 -17
  89. package/src/common/base-provider.js +1 -1
  90. package/src/common/constants.js +1 -0
  91. package/src/common/content-cards-display.js +6 -6
  92. package/src/common/event-logger.js +3 -3
  93. package/src/common/properties-base.js +3 -3
  94. package/src/l10n/l10n-manager.js +2 -2
  95. package/src/managers/auth-manager.js +11 -11
  96. package/src/managers/braze-instance.js +59 -59
  97. package/src/managers/device-manager.js +9 -9
  98. package/src/managers/network-manager.js +65 -63
  99. package/src/managers/server-config-manager.js +110 -93
  100. package/src/managers/session-manager.js +20 -20
  101. package/src/managers/storage-manager-factory.js +9 -9
  102. package/src/managers/storage-manager.js +137 -137
  103. package/src/managers/subscription-manager.js +2 -2
  104. package/src/managers/utils.js +1 -1
  105. package/src/models/braze-event.js +2 -2
  106. package/src/models/identifier.js +5 -5
  107. package/src/models/push-token.js +8 -8
  108. package/src/models/request-result.js +1 -1
  109. package/src/models/server-config.js +46 -28
  110. package/src/request-controller.js +124 -124
  111. package/src/triggers/models/custom-event-data.js +4 -4
  112. package/src/triggers/models/custom-event-property-data.js +5 -5
  113. package/src/triggers/models/filter-set.js +2 -2
  114. package/src/triggers/models/filter.js +1 -1
  115. package/src/triggers/models/in-app-message-click-data.js +5 -5
  116. package/src/triggers/models/purchase-data.js +1 -1
  117. package/src/triggers/models/purchase-property-data.js +2 -2
  118. package/src/triggers/models/push-click-data.js +5 -5
  119. package/src/triggers/models/trigger-condition.js +45 -45
  120. package/src/triggers/models/trigger-events.js +3 -3
  121. package/src/triggers/models/trigger.js +30 -30
  122. package/src/triggers/triggers-provider.js +63 -63
  123. package/src/types.js +5 -1
  124. package/src/ui/js/attach-css.js +1 -1
  125. package/src/util/braze-actions.js +6 -6
  126. package/src/util/browser-detector.js +13 -13
  127. package/src/util/client-hints-parser.js +5 -5
  128. package/src/util/code-utils.js +2 -2
  129. package/src/util/deprecation-utils.js +2 -2
  130. package/src/util/dom-utils.js +8 -8
  131. package/src/util/ecommerce-event-validation.js +343 -0
  132. package/src/util/html-display-utils.js +11 -11
  133. package/src/util/iso-4217-currency-codes.js +176 -0
  134. package/src/util/net.js +4 -4
  135. package/src/util/request-header-utils.js +10 -10
  136. package/src/util/string-utils.js +2 -2
  137. package/src/util/user-agent-parser.js +15 -15
  138. package/src/util/validation-utils.js +14 -14
@@ -1,33 +1,54 @@
1
- import { PropertiesBase as x } from "../common/properties-base.js";
2
- export default class Banner extends x {
3
- constructor(t, s, i, h = !1, r = !1, e = -1, o = {}, n = null) {
4
- super(o),
5
- (this.id = t),
6
- (this.placementId = s),
7
- (this.html = i),
8
- (this.Vt = h),
1
+ import { PropertiesBase as D } from "../common/properties-base.js";
2
+ import f from "../managers/subscription-manager.js";
3
+ export default class Banner extends D {
4
+ constructor(s, i, t, h = !1, r = !1, e = -1, n = {}, o = null) {
5
+ super(n),
6
+ (this.id = s),
7
+ (this.placementId = i),
8
+ (this.html = t),
9
+ (this.ss = h),
9
10
  (this.isControl = r),
10
- (this.Yt = e),
11
- (this.G = n),
12
- (this.id = t),
13
- (this.placementId = s),
14
- (this.html = i),
15
- (this.Vt = h),
11
+ (this.ts = e),
12
+ (this.G = o),
13
+ (this.id = s),
14
+ (this.placementId = i),
15
+ (this.html = t),
16
+ (this.ss = h),
16
17
  (this.isControl = r),
17
- (this.Yt = e),
18
- (this.Zt = !1);
18
+ (this.ts = e),
19
+ (this.hs = !1),
20
+ (this.rs = !1),
21
+ (this.es = null);
19
22
  }
20
- ts() {
23
+ subscribeToDismissedEvent(s) {
24
+ return this.ns().Ut(s);
25
+ }
26
+ removeSubscription(s) {
27
+ null != this.es && this.es.removeSubscription(s);
28
+ }
29
+ removeAllSubscriptions() {
30
+ null != this.es && this.es.removeAllSubscriptions();
31
+ }
32
+ os() {
21
33
  return this.isControl;
22
34
  }
35
+ ns() {
36
+ return null == this.es && (this.es = new f()), this.es;
37
+ }
38
+ Ft() {
39
+ return (
40
+ !this.rs &&
41
+ ((this.rs = !0), this.ns().A(), this.removeAllSubscriptions(), !0)
42
+ );
43
+ }
23
44
  qt() {
24
45
  return {
25
46
  id: this.id,
26
47
  pid: this.placementId,
27
48
  html: this.html,
28
- its: this.Vt,
49
+ its: this.ss,
29
50
  ic: this.isControl,
30
- eat: this.Yt,
51
+ eat: this.ts,
31
52
  pr: this.properties,
32
53
  sk: this.G,
33
54
  };
@@ -0,0 +1,4 @@
1
+ import { logBannerDismissal as j } from "./log-banner-dismissal.js";
2
+ export function dismissBanner(n) {
3
+ return j(n);
4
+ }
@@ -1,11 +1,11 @@
1
1
  import {
2
- attachHtmlToIframeWithNonce as b,
3
- buildBrazeBridge as N,
2
+ attachHtmlToIframeWithNonce as N,
3
+ buildBrazeBridge as E,
4
4
  } from "../../util/html-display-utils.js";
5
- import E from "../../../shared-lib/logger.js";
5
+ import b from "../../../shared-lib/logger.js";
6
6
  import { logBannerClick } from "../log-banner-click.js";
7
- import { logBannerDismissal as _ } from "../log-banner-dismissal.js";
8
- import { destroyBannerHtml as A } from "./destroy-banner-html.js";
7
+ import { logBannerDismissal as j } from "../log-banner-dismissal.js";
8
+ import { destroyBannerHtml as _ } from "./destroy-banner-html.js";
9
9
  export const BANNER_PLACEMENT_ID = "data-ab-banner-placement-id";
10
10
  export const BANNER_HTML_CLASS = "ab-html-banner";
11
11
  export const CONTROL_BANNER_HTML_CLASS = "ab-html-control-banner";
@@ -19,7 +19,7 @@ export function controlBannerToHtml(n) {
19
19
  );
20
20
  }
21
21
  export function bannerToHtml(n, t) {
22
- if (n.ts()) return controlBannerToHtml(n);
22
+ if (n.os()) return controlBannerToHtml(n);
23
23
  const o = document.createElement("iframe");
24
24
  return (
25
25
  (o.id = n.id),
@@ -27,24 +27,24 @@ export function bannerToHtml(n, t) {
27
27
  (o.className = "ab-html-banner"),
28
28
  o.setAttribute(BANNER_PLACEMENT_ID, n.placementId),
29
29
  o.setAttribute("title", "Banner"),
30
- b(o, n.html, t),
30
+ N(o, n.html, t),
31
31
  (o.onload = () => {
32
32
  const t = o.contentWindow,
33
33
  e = t.document.getElementsByTagName("title");
34
34
  e && e.length > 0 && o.setAttribute("title", e[0].textContent || "");
35
- const r = Object.assign(Object.assign({}, N(o)), {
35
+ const r = Object.assign(Object.assign({}, E(o)), {
36
36
  logClick: function () {
37
37
  logBannerClick(n, ...arguments);
38
38
  },
39
39
  closeMessage: function () {
40
40
  !(function (n) {
41
41
  const t = document.getElementById(n.id);
42
- t && A(t), _(n);
42
+ t && _(t), j(n);
43
43
  })(n);
44
44
  },
45
45
  setBannerHeight: (n) => {
46
46
  isNaN(n) || !isFinite(n) || n < 0
47
- ? E.warn(`Invalid banner height: ${n}`)
47
+ ? b.warn(`Invalid banner height: ${n}`)
48
48
  : (o.style.height = `${n}px`);
49
49
  },
50
50
  });
@@ -1,7 +1,7 @@
1
1
  import { removeSubscription } from "../../Core/remove-subscription.js";
2
- import { BannerStrings as j } from "../constants.js";
2
+ import { BannerStrings as x } from "../constants.js";
3
3
  export function destroyBannerHtml(o) {
4
- const r = o.getAttribute(j.ea);
4
+ const r = o.getAttribute(x.ea);
5
5
  null != r && removeSubscription(r),
6
6
  o && o.parentNode && o.parentNode.removeChild(o);
7
7
  }
@@ -1,18 +1,18 @@
1
- import { logger as E } from "../../shared-lib/index.js";
2
- import { BannerStrings as j } from "./constants.js";
1
+ import { logger as b } from "../../shared-lib/index.js";
2
+ import { BannerStrings as x } from "./constants.js";
3
3
  import r from "../managers/braze-instance.js";
4
4
  import i from "./banner-provider-factory.js";
5
- import { getBannerIfNotExpired as C } from "./get-banner.js";
5
+ import { getBannerIfNotExpired as A } from "./get-banner.js";
6
6
  export function getAllBanners() {
7
7
  if (!r.rr()) return;
8
8
  const n = {},
9
9
  o = r.l();
10
10
  if (
11
- (!1 === (null == o ? void 0 : o.Jt()) && E.error(j.aa),
12
- !(null == o ? void 0 : o.Jt()))
11
+ (!1 === (null == o ? void 0 : o.Ot()) && b.error(x.aa),
12
+ !(null == o ? void 0 : o.Ot()))
13
13
  )
14
14
  return n;
15
15
  const t = i.o().k();
16
- for (const r in t) n[r] = C(t, r);
16
+ for (const r in t) n[r] = A(t, r);
17
17
  return n;
18
18
  }
@@ -1,22 +1,22 @@
1
- import { logger as E } from "../../shared-lib/index.js";
2
- import { BannerStrings as j } from "./constants.js";
1
+ import { logger as b } from "../../shared-lib/index.js";
2
+ import { BannerStrings as x } from "./constants.js";
3
3
  import r from "../managers/braze-instance.js";
4
4
  import i from "./banner-provider-factory.js";
5
5
  export function getBannerIfNotExpired(n, r) {
6
6
  const e = n[r];
7
7
  if (!e) return null;
8
- const t = e.Yt,
8
+ const t = e.ts,
9
9
  o = new Date().valueOf();
10
10
  return -1 !== t && 1e3 * t < o
11
- ? (E.info(`Banner with ID: ${e.id} and placement ID: ${r} has expired.`),
11
+ ? (b.info(`Banner with ID: ${e.id} and placement ID: ${r} has expired.`),
12
12
  null)
13
13
  : e;
14
14
  }
15
15
  export function getBanner(n) {
16
16
  var e;
17
17
  if (!r.rr()) return;
18
- !1 === (null === (e = r.l()) || void 0 === e ? void 0 : e.Jt()) &&
19
- E.error(j.aa);
18
+ !1 === (null === (e = r.l()) || void 0 === e ? void 0 : e.Ot()) &&
19
+ b.error(x.aa);
20
20
  const t = i.o();
21
21
  if (!t.P()) return null;
22
22
  return getBannerIfNotExpired(t.k(), n);
@@ -6,3 +6,4 @@ export { getAllBanners } from "./get-all-banners.js";
6
6
  export { subscribeToBannersUpdates } from "./subscribe-to-banners-updates.js";
7
7
  export { logBannerImpressions } from "./log-banner-impressions.js";
8
8
  export { logBannerClick } from "./log-banner-click.js";
9
+ export { dismissBanner } from "./dismiss-banner.js";
@@ -1,21 +1,21 @@
1
1
  import r from "../managers/braze-instance.js";
2
2
  import Banner from "./banner.js";
3
- import { logger as E } from "../../shared-lib/index.js";
3
+ import { logger as b } from "../../shared-lib/index.js";
4
4
  import i from "./banner-provider-factory.js";
5
- import { keys as D } from "../util/code-utils.js";
5
+ import { keys as C } from "../util/code-utils.js";
6
6
  export function logBannerClick(n, o) {
7
7
  if (!r.rr()) return;
8
8
  if (!(n instanceof Banner))
9
9
  return (
10
- E.error("Banner argument to logBannerClick must be an Banner object."), !1
10
+ b.error("Banner argument to logBannerClick must be an Banner object."), !1
11
11
  );
12
12
  const e = i.o(),
13
13
  t = e.k();
14
- return 0 === D(t).length
15
- ? (E.info("Not logging banner click. No banners exist."), !1)
14
+ return 0 === C(t).length
15
+ ? (b.info("Not logging banner click. No banners exist."), !1)
16
16
  : t[n.placementId]
17
- ? e.jt(n, o)
18
- : (E.info(
17
+ ? e.Ct(n, o)
18
+ : (b.info(
19
19
  `Not logging banner click for ID ${n.placementId}. The placement ID did not correspond to any banner.`,
20
20
  ),
21
21
  !1);
@@ -1,22 +1,22 @@
1
1
  import r from "../managers/braze-instance.js";
2
2
  import Banner from "./banner.js";
3
- import { logger as E } from "../../shared-lib/index.js";
3
+ import { logger as b } from "../../shared-lib/index.js";
4
4
  import i from "./banner-provider-factory.js";
5
- import { keys as D } from "../util/code-utils.js";
5
+ import { keys as C } from "../util/code-utils.js";
6
6
  export function logBannerDismissal(n) {
7
7
  if (!r.rr()) return;
8
8
  if (!(n instanceof Banner))
9
9
  return (
10
- E.error("Banner argument to logBannerDismissal must be a Banner object."),
10
+ b.error("Banner argument to logBannerDismissal must be a Banner object."),
11
11
  !1
12
12
  );
13
13
  const o = i.o(),
14
14
  e = o.k();
15
- return 0 === D(e).length
16
- ? (E.info("Not logging banner dismissal. No banners exist."), !1)
15
+ return 0 === C(e).length
16
+ ? (b.info("Not logging banner dismissal. No banners exist."), !1)
17
17
  : e[n.placementId]
18
- ? o.Nt(n)
19
- : (E.info(
18
+ ? o.wt(n)
19
+ : (b.info(
20
20
  `Not logging banner dismissal for ID ${n.placementId}. The placement ID did not correspond to any banner.`,
21
21
  ),
22
22
  !1);
@@ -1,31 +1,40 @@
1
- import { logger as E, EventTypes as p } from "../../shared-lib/index.js";
1
+ import { logger as b, EventTypes as p } from "../../shared-lib/index.js";
2
2
  import v from "../common/event-logger.js";
3
3
  import r from "../managers/braze-instance.js";
4
- import { keys as D } from "../util/code-utils.js";
4
+ import { keys as C } from "../util/code-utils.js";
5
5
  import i from "./banner-provider-factory.js";
6
6
  export function logBannerImpressions(o) {
7
7
  if (!r.rr()) return;
8
8
  if (!o || o.length <= 0) return !1;
9
9
  const n = i.o(),
10
10
  s = n.k();
11
- if (0 === D(s).length)
12
- return E.info("Not logging banners impression. No banners exist."), !1;
13
- const e = n.Ut(),
14
- t = [];
15
- for (const r of o) {
16
- const o = s[r];
11
+ if (0 === C(s).length)
12
+ return b.info("Not logging banners impression. No banners exist."), !1;
13
+ let e = n.Wt(),
14
+ t = !1;
15
+ if (Object.keys(e).some((o) => void 0 !== s[o])) {
16
+ const o = {};
17
+ for (const n of Object.keys(e)) {
18
+ const r = s[n];
19
+ r && e[n] && (o[r.id] = !0);
20
+ }
21
+ (e = o), (t = !0);
22
+ }
23
+ const a = [];
24
+ for (const n of o) {
25
+ const o = s[n];
17
26
  o
18
- ? e[o.placementId]
19
- ? E.info(
20
- `Not logging banners impression for ID ${r}. This ID was already logged this session.`,
27
+ ? e[o.id]
28
+ ? b.info(
29
+ `Not logging banners impression for ID ${n}. This ID was already logged this session.`,
21
30
  )
22
- : ((e[o.placementId] = !0), t.push(o.id))
23
- : E.info(
24
- `Not logging banners impression for ID ${r}. The placement ID did not correspond to any banner.`,
31
+ : ((e[o.id] = !0), a.push(o.id))
32
+ : b.info(
33
+ `Not logging banners impression for ID ${n}. The placement ID did not correspond to any banner.`,
25
34
  );
26
35
  }
27
- if (0 === t.length) return !1;
28
- n.At(e);
29
- const a = { ids: t };
30
- return v.wt(p.ro, a).lt;
36
+ if (0 === a.length) return t && n.Mt(e), !1;
37
+ n.Mt(e);
38
+ const f = { ids: a };
39
+ return v.Dt(p.ro, f).lt;
31
40
  }
@@ -1,24 +1,24 @@
1
- import { logger as E } from "../../shared-lib/index.js";
1
+ import { logger as b } from "../../shared-lib/index.js";
2
2
  import { CoreStrings as R } from "../common/constants.js";
3
- import { BannerStrings as j } from "./constants.js";
3
+ import { BannerStrings as x } from "./constants.js";
4
4
  import r from "../managers/braze-instance.js";
5
5
  import { isArray as g } from "../util/code-utils.js";
6
6
  import { isValidBannerPlacementId as J } from "../util/validation-utils.js";
7
7
  import i from "./banner-provider-factory.js";
8
8
  export function requestBannersRefresh(e, t, o) {
9
- if (!r.rr()) return void E.warn(R.ee);
9
+ if (!r.rr()) return void b.warn(R.ee);
10
10
  const n = r.l();
11
11
  if (!n) return;
12
12
  if (!g(e) || 0 === e.length)
13
- return void E.warn("placementIds should be a non-empty array.");
13
+ return void b.warn("placementIds should be a non-empty array.");
14
14
  const s = i.o();
15
- if ((!1 === n.Jt() && E.error(j.aa), !s.P()))
15
+ if ((!1 === n.Ot() && b.error(x.aa), !s.P()))
16
16
  return void n.V(() => {
17
17
  requestBannersRefresh(e, t, o);
18
18
  });
19
19
  const a = n.re();
20
20
  e.length > a &&
21
- (E.warn(
21
+ (b.warn(
22
22
  `Number of placement IDs requested exceeds the max allowed. Trimming placementIds array from length ${e.length} to ${a} (max allowed).`,
23
23
  ),
24
24
  (e = e.slice(0, a))),
@@ -26,11 +26,11 @@ export function requestBannersRefresh(e, t, o) {
26
26
  (e = e.filter(
27
27
  (e) =>
28
28
  !!J(e) ||
29
- (E.warn(
29
+ (b.warn(
30
30
  `Placement ID should be a valid utf8 string with no whitespaces, filtering out: ${e}`,
31
31
  ),
32
32
  !1),
33
33
  )).length &&
34
- (E.info(`Requesting banners for placement IDs: ${JSON.stringify(e)}`),
34
+ (b.info(`Requesting banners for placement IDs: ${JSON.stringify(e)}`),
35
35
  s.O(e, t, o));
36
36
  }
@@ -5,20 +5,20 @@ export function subscribeToBannersUpdates(n) {
5
5
  var o;
6
6
  if (!r.rr()) return;
7
7
  const t = i.o();
8
- if (t.xt()) {
8
+ if (t.zt()) {
9
9
  const r = getAllBanners();
10
10
  r && "function" == typeof n && n(r);
11
11
  }
12
- const s = t.zt(n);
13
- if (!t.Lt()) {
12
+ const s = t.Kt(n);
13
+ if (!t.Et()) {
14
14
  const n =
15
15
  null === (o = r.nn()) || void 0 === o
16
16
  ? void 0
17
17
  : o.rn(() => {
18
- const n = t.Ct();
18
+ const n = t.jt();
19
19
  n && n.length > 0 && t.O(n);
20
20
  });
21
- n && t.$t(n);
21
+ n && t.Lt(n);
22
22
  }
23
23
  return s;
24
24
  }
@@ -1,28 +1,28 @@
1
- import E from "../../../shared-lib/logger.js";
2
- import { BannerStrings as j } from "../constants.js";
1
+ import b from "../../../shared-lib/logger.js";
2
+ import { BannerStrings as x } from "../constants.js";
3
3
  import r, { OPTIONS as U } from "../../managers/braze-instance.js";
4
4
  import { setupBannerUI as S } from "../../ui/js/banner-css.js";
5
5
  import { addPassiveEventListener as F } from "../../util/dom-utils.js";
6
6
  import { bannerToHtml as G } from "../display/banner-to-html.js";
7
- import { destroyBannerHtml as A } from "../display/destroy-banner-html.js";
7
+ import { destroyBannerHtml as _ } from "../display/destroy-banner-html.js";
8
8
  import { detectBannerImpressions as H } from "../display/detect-banner-impressions.js";
9
9
  import { subscribeToBannersUpdates } from "../subscribe-to-banners-updates.js";
10
10
  export function insertBanner(e, n) {
11
11
  if (!r.rr()) return;
12
- if (!e) return void E.error("Not inserting banner: banner was not provided.");
12
+ if (!e) return void b.error("Not inserting banner: banner was not provided.");
13
13
  if (!n)
14
- return void E.error("Not inserting banner: parentNode was not provided.");
14
+ return void b.error("Not inserting banner: parentNode was not provided.");
15
15
  if (!r.er(U.nr))
16
- return void E.error(
16
+ return void b.error(
17
17
  "Banners are disabled. Use the 'allowUserSuppliedJavascript' option for braze.initialize to enable these messages.",
18
18
  );
19
19
  S();
20
20
  const o = G(e, r.er(U.sr)),
21
21
  s = subscribeToBannersUpdates((s) => {
22
22
  const i = s[e.placementId];
23
- i ? n.replaceChildren(G(i, r.er(U.sr))) : A(o);
23
+ i ? n.replaceChildren(G(i, r.er(U.sr))) : _(o);
24
24
  });
25
- s && o.setAttribute(j.ea, s),
25
+ s && o.setAttribute(x.ea, s),
26
26
  n.replaceChildren(o),
27
27
  F(window, "scroll", H),
28
28
  H();
@@ -1,73 +1,73 @@
1
1
  import { ControlCard } from "./models/index.js";
2
2
  import v from "../common/event-logger.js";
3
3
  import L from "../models/request-result.js";
4
- import { logger as E, EventTypes as p } from "../../shared-lib/index.js";
4
+ import { logger as b, EventTypes as p } from "../../shared-lib/index.js";
5
5
  import { STORAGE_KEYS as s } from "../managers/storage-manager.js";
6
6
  export default class M {
7
7
  constructor(t) {
8
- (this.C = t), (this.C = t);
8
+ (this.j = t), (this.j = t);
9
9
  }
10
10
  logClick(t) {
11
11
  const n = new L();
12
- if ((t.ss(), null == t.url || "" === t.url))
12
+ if ((t.Yt(), null == t.url || "" === t.url))
13
13
  return (
14
- E.info(`Card ${t.id} has no url. Not logging click to Braze servers.`),
14
+ b.info(`Card ${t.id} has no url. Not logging click to Braze servers.`),
15
15
  n
16
16
  );
17
- if (t.id && this.C) {
18
- const n = this.C.Rt(s.Tt.ns) || {};
19
- (n[t.id] = !0), this.C.It(s.Tt.ns, n);
17
+ if (t.id && this.j) {
18
+ const n = this.j.St(s.It.Zt) || {};
19
+ (n[t.id] = !0), this.j.Pt(s.It.Zt, n);
20
20
  }
21
- const r = this.rs([t]);
21
+ const r = this.ls([t]);
22
22
  if (null == r) return n;
23
- const i = p.os;
24
- return v.wt(i, r);
23
+ const i = p.us;
24
+ return v.Dt(i, r);
25
25
  }
26
- es(t) {
26
+ cs(t) {
27
27
  const n = new L();
28
- if (!t.ls())
28
+ if (!t.Ft())
29
29
  return (
30
- E.info(
30
+ b.info(
31
31
  `Card ${t.id} refused this dismissal. Ignoring analytics event.`,
32
32
  ),
33
33
  n
34
34
  );
35
- if (t.id && this.C) {
36
- const n = this.C.Rt(s.Tt.us) || {};
37
- (n[t.id] = !0), this.C.It(s.Tt.us, n);
35
+ if (t.id && this.j) {
36
+ const n = this.j.St(s.It.fs) || {};
37
+ (n[t.id] = !0), this.j.Pt(s.It.fs, n);
38
38
  }
39
- const r = this.rs([t]);
40
- return null == r ? n : v.wt(p.cs, r);
39
+ const r = this.ls([t]);
40
+ return null == r ? n : v.Dt(p.gs, r);
41
41
  }
42
- fs(t) {
42
+ ds(t) {
43
43
  const n = new L(!0),
44
44
  r = [],
45
45
  i = [];
46
46
  let o = {};
47
- this.C && (o = this.C.Rt(s.Tt.hs) || {});
47
+ this.j && (o = this.j.St(s.It.ps) || {});
48
48
  for (const s of t) {
49
- s.gs()
49
+ s.js()
50
50
  ? (s instanceof ControlCard ? i.push(s) : r.push(s),
51
51
  s.id && (o[s.id] = !0))
52
- : E.info(
52
+ : b.info(
53
53
  `Card ${s.id} logged an impression too recently. Ignoring analytics event.`,
54
54
  );
55
55
  }
56
- const e = this.rs(r),
57
- l = this.rs(i);
56
+ const e = this.ls(r),
57
+ l = this.ls(i);
58
58
  if (null == e && null == l) return (n.lt = !1), n;
59
- if ((this.C && this.C.It(s.Tt.hs, o), null != e)) {
60
- const t = p.ds,
61
- s = v.wt(t, e);
62
- n.ps(s);
59
+ if ((this.j && this.j.Pt(s.It.ps, o), null != e)) {
60
+ const t = p.vs,
61
+ s = v.Dt(t, e);
62
+ n.Cs(s);
63
63
  }
64
64
  if (null != l) {
65
- const t = v.wt(p.js, l);
66
- n.ps(t);
65
+ const t = v.Dt(p.ws, l);
66
+ n.Cs(t);
67
67
  }
68
68
  return n;
69
69
  }
70
- rs(t) {
70
+ ls(t) {
71
71
  let s,
72
72
  n = null;
73
73
  for (let r = 0; r < t.length; r++)
@@ -2,10 +2,10 @@ import { Card } from "./models/index.js";
2
2
  import K from "./card-manager-factory.js";
3
3
  import { CardStrings as W } from "./constants.js";
4
4
  import r from "../managers/braze-instance.js";
5
- import { logger as E } from "../../shared-lib/index.js";
5
+ import { logger as b } from "../../shared-lib/index.js";
6
6
  export function logCardDismissal(o) {
7
7
  return (
8
8
  !!r.rr() &&
9
- (o instanceof Card ? K.ra().es(o).lt : (E.error("card " + W.tr), !1))
9
+ (o instanceof Card ? K.ra().cs(o).lt : (b.error("card " + W.tr), !1))
10
10
  );
11
11
  }
@@ -1,4 +1,4 @@
1
- import E from "../../shared-lib/logger.js";
1
+ import b from "../../shared-lib/logger.js";
2
2
  import { CardStrings as W } from "./constants.js";
3
3
  import r from "../managers/braze-instance.js";
4
4
  import K from "./card-manager-factory.js";
@@ -6,6 +6,6 @@ import { Card } from "./models/index.js";
6
6
  export function logContentCardClick(o) {
7
7
  return (
8
8
  !!r.rr() &&
9
- (o instanceof Card ? K.ra().logClick(o).lt : (E.error("card " + W.tr), !1))
9
+ (o instanceof Card ? K.ra().logClick(o).lt : (b.error("card " + W.tr), !1))
10
10
  );
11
11
  }
@@ -1,13 +1,13 @@
1
1
  import { Card } from "./models/index.js";
2
2
  import r from "../managers/braze-instance.js";
3
3
  import { isArray as g } from "../util/code-utils.js";
4
- import E from "../../shared-lib/logger.js";
4
+ import b from "../../shared-lib/logger.js";
5
5
  import { CardStrings as W } from "./constants.js";
6
6
  import K from "./card-manager-factory.js";
7
7
  export function logContentCardImpressions(o) {
8
8
  if (!r.rr()) return !1;
9
- if (!g(o)) return E.error("cards must be an array"), !1;
9
+ if (!g(o)) return b.error("cards must be an array"), !1;
10
10
  for (const r of o)
11
- if (!(r instanceof Card)) return E.error(`Each card in cards ${W.tr}`), !1;
12
- return K.ra().fs(o).lt;
11
+ if (!(r instanceof Card)) return b.error(`Each card in cards ${W.tr}`), !1;
12
+ return K.ra().ds(o).lt;
13
13
  }
@@ -11,22 +11,22 @@ export default class CaptionedImage extends Card {
11
11
  return (
12
12
  (t[Card.bs.xs] = Card.ks.zs),
13
13
  (t[Card.bs.qs] = this.id),
14
- (t[Card.bs.vs] = this.viewed),
15
- (t[Card.bs.ws] = this.title),
16
- (t[Card.bs.ys] = this.imageUrl),
17
- (t[Card.bs.As] = this.description),
18
- (t[Card.bs.Bs] = this.updated),
19
- (t[Card.bs.Cs] = this.expiresAt),
14
+ (t[Card.bs.ys] = this.viewed),
15
+ (t[Card.bs.As] = this.title),
16
+ (t[Card.bs.Bs] = this.imageUrl),
17
+ (t[Card.bs.Ds] = this.description),
18
+ (t[Card.bs.Es] = this.updated),
19
+ (t[Card.bs.Fs] = this.expiresAt),
20
20
  (t[Card.bs.URL] = this.url),
21
- (t[Card.bs.Ds] = this.linkText),
22
- (t[Card.bs.Es] = this.aspectRatio),
23
- (t[Card.bs.Fs] = this.extras),
24
- (t[Card.bs.Gs] = this.pinned),
25
- (t[Card.bs.Hs] = this.dismissible),
26
- (t[Card.bs.Is] = this.clicked),
27
- (t[Card.bs.Js] = this.language),
28
- (t[Card.bs.Ks] = this.altImageText),
29
- (t[Card.bs.Ls] = this.test),
21
+ (t[Card.bs.Gs] = this.linkText),
22
+ (t[Card.bs.Hs] = this.aspectRatio),
23
+ (t[Card.bs.Is] = this.extras),
24
+ (t[Card.bs.Js] = this.pinned),
25
+ (t[Card.bs.Ks] = this.dismissible),
26
+ (t[Card.bs.Ls] = this.clicked),
27
+ (t[Card.bs.Ms] = this.language),
28
+ (t[Card.bs.Ns] = this.altImageText),
29
+ (t[Card.bs.Os] = this.test),
30
30
  t
31
31
  );
32
32
  }