@braze/web-sdk 6.3.0 → 6.4.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 (132) hide show
  1. package/index.d.ts +35 -3
  2. package/package.json +1 -1
  3. package/shared-lib/encoding-utils.js +1 -1
  4. package/shared-lib/event-types.js +23 -23
  5. package/shared-lib/guid.js +25 -6
  6. package/shared-lib/indexed-db-adapter.js +7 -7
  7. package/shared-lib/logger.js +2 -2
  8. package/shared-lib/supported-options.js +22 -21
  9. package/src/Banner/display/banner-to-html.js +2 -2
  10. package/src/Banner/display/detect-banner-impressions.js +7 -7
  11. package/src/Banner/index.js +2 -0
  12. package/src/Banner/request-banners-refresh.js +6 -6
  13. package/src/Banner/ui/insert-banner.js +4 -4
  14. package/src/Card/card-manager-factory.js +5 -5
  15. package/src/Card/card-manager.js +4 -4
  16. package/src/Card/display/card-display.js +7 -7
  17. package/src/Card/log-card-dismissal.js +3 -3
  18. package/src/Card/log-content-card-click.js +3 -3
  19. package/src/Card/log-content-card-impressions.js +6 -6
  20. package/src/Card/models/card.js +7 -7
  21. package/src/Card/util/card-factory.js +6 -6
  22. package/src/ContentCards/content-cards-provider-factory.js +14 -10
  23. package/src/ContentCards/content-cards-provider.js +28 -28
  24. package/src/ContentCards/content-cards.js +4 -4
  25. package/src/ContentCards/get-cached-content-cards.js +2 -2
  26. package/src/ContentCards/request-content-cards-refresh.js +2 -2
  27. package/src/ContentCards/subscribe-to-content-cards-updates.js +3 -3
  28. package/src/ContentCards/ui/show-content-cards.js +8 -8
  29. package/src/Core/add-sdk-metadata.js +2 -2
  30. package/src/Core/change-user.js +5 -5
  31. package/src/Core/disable-sdk.js +3 -3
  32. package/src/Core/enable-sdk.js +3 -3
  33. package/src/Core/get-user.js +1 -1
  34. package/src/Core/is-disabled.js +1 -1
  35. package/src/Core/log-custom-event.js +9 -9
  36. package/src/Core/log-purchase.js +7 -7
  37. package/src/Core/open-session.js +11 -11
  38. package/src/Core/set-sdk-authentication-signature.js +2 -2
  39. package/src/Core/wipe-data.js +5 -5
  40. package/src/DUST/dust-provider-factory.js +20 -0
  41. package/src/DUST/dust-provider.js +288 -0
  42. package/src/DUST/index.js +3 -0
  43. package/src/DUST/subscribe-to-dust.js +24 -0
  44. package/src/DUST/types.js +1 -0
  45. package/src/FeatureFlags/feature-flags-provider-factory.js +9 -9
  46. package/src/FeatureFlags/feature-flags-provider.js +38 -38
  47. package/src/FeatureFlags/get-all-feature-flags.js +3 -3
  48. package/src/FeatureFlags/get-feature-flag.js +3 -3
  49. package/src/FeatureFlags/log-feature-flag-impression.js +5 -5
  50. package/src/FeatureFlags/refresh-feature-flags.js +5 -5
  51. package/src/FeatureFlags/subscribe-to-feature-flags-updates.js +3 -3
  52. package/src/InAppMessage/defer-in-app-message.js +1 -1
  53. package/src/InAppMessage/display/html-message-to-html.js +5 -5
  54. package/src/InAppMessage/display/in-app-message-to-html.js +22 -22
  55. package/src/InAppMessage/display/modal-utils.js +5 -5
  56. package/src/InAppMessage/get-deferred-in-app-message.js +1 -1
  57. package/src/InAppMessage/in-app-message-factory.js +4 -4
  58. package/src/InAppMessage/in-app-message-manager.js +80 -80
  59. package/src/InAppMessage/log-in-app-message-button-click.js +5 -5
  60. package/src/InAppMessage/log-in-app-message-click.js +5 -5
  61. package/src/InAppMessage/log-in-app-message-html-click.js +5 -5
  62. package/src/InAppMessage/log-in-app-message-impression.js +1 -1
  63. package/src/InAppMessage/models/control-message.js +1 -1
  64. package/src/InAppMessage/models/full-screen-message.js +12 -12
  65. package/src/InAppMessage/models/html-message.js +14 -14
  66. package/src/InAppMessage/models/in-app-message-button.js +4 -4
  67. package/src/InAppMessage/models/in-app-message.js +119 -121
  68. package/src/InAppMessage/models/modal-message.js +12 -12
  69. package/src/InAppMessage/models/slide-up-message.js +21 -21
  70. package/src/InAppMessage/models/templated-in-app-message.js +8 -8
  71. package/src/InAppMessage/subscribe-to-in-app-message.js +1 -1
  72. package/src/InAppMessage/ui/automatically-show-in-app-messages.js +3 -3
  73. package/src/InAppMessage/ui/remove-all-visible-in-app-messages.js +18 -0
  74. package/src/InAppMessage/ui/show-in-app-message.js +24 -24
  75. package/src/Push/is-push-blocked.js +2 -2
  76. package/src/Push/is-push-permission-granted.js +2 -2
  77. package/src/Push/is-push-supported.js +2 -2
  78. package/src/Push/push-manager-factory.js +8 -8
  79. package/src/Push/push-manager.js +90 -90
  80. package/src/Push/utils/push-utils.js +17 -17
  81. package/src/User/user-manager.js +12 -12
  82. package/src/User/user.js +48 -48
  83. package/src/common/constants.js +1 -0
  84. package/src/common/content-cards-display.js +20 -20
  85. package/src/common/event-logger.js +4 -4
  86. package/src/common/properties-base.js +16 -16
  87. package/src/l10n/l10n-manager-factory.js +2 -2
  88. package/src/l10n/l10n-manager.js +1 -1
  89. package/src/managers/auth-manager.js +29 -29
  90. package/src/managers/braze-instance.js +141 -133
  91. package/src/managers/device-manager.js +18 -18
  92. package/src/managers/network-manager.js +139 -139
  93. package/src/managers/server-config-manager.js +99 -82
  94. package/src/managers/session-manager.js +32 -32
  95. package/src/managers/storage-manager-factory.js +8 -8
  96. package/src/managers/storage-manager.js +76 -74
  97. package/src/managers/subscription-manager.js +10 -10
  98. package/src/models/backend-errors.js +5 -5
  99. package/src/models/braze-event.js +9 -9
  100. package/src/models/device.js +2 -2
  101. package/src/models/identifier.js +12 -12
  102. package/src/models/push-token.js +12 -12
  103. package/src/models/request-result.js +1 -1
  104. package/src/models/server-config.js +38 -34
  105. package/src/request-controller.js +136 -134
  106. package/src/triggers/models/custom-event-data.js +4 -4
  107. package/src/triggers/models/custom-event-property-data.js +5 -5
  108. package/src/triggers/models/filter-set.js +8 -8
  109. package/src/triggers/models/filter.js +30 -30
  110. package/src/triggers/models/in-app-message-click-data.js +1 -1
  111. package/src/triggers/models/purchase-data.js +1 -1
  112. package/src/triggers/models/purchase-property-data.js +2 -2
  113. package/src/triggers/models/push-click-data.js +1 -1
  114. package/src/triggers/models/trigger-condition.js +36 -36
  115. package/src/triggers/models/trigger-events.js +2 -2
  116. package/src/triggers/models/trigger.js +15 -15
  117. package/src/triggers/triggers-provider-factory.js +3 -3
  118. package/src/triggers/triggers-provider.js +25 -25
  119. package/src/ui/js/attach-css.js +3 -3
  120. package/src/ui/js/load-font-awesome.js +2 -2
  121. package/src/util/base-device-parser.js +3 -3
  122. package/src/util/braze-actions.js +3 -3
  123. package/src/util/browser-detector.js +13 -13
  124. package/src/util/client-hints-parser.js +6 -6
  125. package/src/util/component-utils.js +1 -1
  126. package/src/util/dom-utils.js +10 -10
  127. package/src/util/key-codes.js +1 -1
  128. package/src/util/net.js +1 -1
  129. package/src/util/request-header-utils.js +22 -22
  130. package/src/util/user-agent-parser.js +14 -14
  131. package/src/util/validation-utils.js +14 -13
  132. package/src/util/window-utils.js +1 -1
package/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Type definitions for @braze/web-sdk v6.3.0
2
+ * Type definitions for @braze/web-sdk v6.4.0
3
3
  * Project: https://github.com/braze-inc/braze-web-sdk
4
4
  * (c) Braze, Inc. 2025 - http://braze.com
5
5
  * License available at https://github.com/braze-inc/braze-web-sdk/blob/master/LICENSE
@@ -2006,6 +2006,38 @@ export function logContentCardImpressions(contentCards: Card[]): boolean;
2006
2006
  */
2007
2007
  export function logContentCardClick(contentCard: Card): boolean;
2008
2008
 
2009
+ /**
2010
+ * Logs that the user saw the given Banners.
2011
+ * This is done automatically when you use Braze's display module and should only be called
2012
+ * if you're bypassing that and manually building the DOM for displaying banners in
2013
+ * your own code.
2014
+ *
2015
+ * @param placementIds - array of placement IDs (strings) that received impressions
2016
+ *
2017
+ * @returns Whether or not the event was successfully logged (to be flushed later).
2018
+ * Returns undefined if the SDK has not been initialized.
2019
+ */
2020
+ export function logBannerImpressions(
2021
+ placementIds: Array<string>,
2022
+ ): boolean | undefined;
2023
+
2024
+ /**
2025
+ * Logs when user clicks on a Banner.
2026
+ * This is done automatically when you use Braze's display module and should only be called
2027
+ * if you're bypassing that and manually building the DOM for displaying banners in
2028
+ * your own code.
2029
+ *
2030
+ * @param banner - the `Banner` object that received a click
2031
+ * @param buttonId - optional button ID if the click was on a specific button within the banner
2032
+ *
2033
+ * @returns Whether or not the event was successfully logged (to be flushed later).
2034
+ * Returns undefined if the SDK has not been initialized.
2035
+ */
2036
+ export function logBannerClick(
2037
+ banner: Banner,
2038
+ buttonId?: string,
2039
+ ): boolean | undefined;
2040
+
2009
2041
  /**
2010
2042
  * Reports that the current user performed a custom named event.
2011
2043
  *
@@ -2138,7 +2170,7 @@ export function openSession(): void;
2138
2170
  * - Create a `service-worker.js` file with the content below and place it in the root directory of your website:
2139
2171
  *
2140
2172
  * ```
2141
- * self.importScripts('https://js.appboycdn.com/web-sdk/6.3/service-worker.js');
2173
+ * self.importScripts('https://js.appboycdn.com/web-sdk/6.4/service-worker.js');
2142
2174
  * ```
2143
2175
  *
2144
2176
  * For more details, see [Our Product Documentation](https://www.braze.com/docs/developer_guide/platform_integration_guides/web/push_notifications/integration).
@@ -2561,7 +2593,7 @@ export type InitializationOptions = {
2561
2593
  * lifecycle of, set this option to true and the Braze SDK will not register or unregister a service worker. If you set this
2562
2594
  * option to true, in order for push to function correctly you must register the service worker yourself BEFORE calling
2563
2595
  * `requestPushPermission`, and ensure that it contains Braze's service worker code, either with
2564
- * `self.importScripts('https://js.appboycdn.com/web-sdk/6.3/service-worker.js');` or by including the content
2596
+ * `self.importScripts('https://js.appboycdn.com/web-sdk/6.4/service-worker.js');` or by including the content
2565
2597
  * of that file directly. When this option is true, the `serviceWorkerLocation` option is irrelevant and is ignored.
2566
2598
  */
2567
2599
  manageServiceWorkerExternally?: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@braze/web-sdk",
3
- "version": "6.3.0",
3
+ "version": "6.4.0",
4
4
  "description": "Braze SDK for web sites and other JS platforms.",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -1,5 +1,5 @@
1
1
  const ei = {
2
- Tn: function (t) {
2
+ No: function (t) {
3
3
  const r = (t + "=".repeat((4 - (t.length % 4)) % 4))
4
4
  .replace(/\-/g, "+")
5
5
  .replace(/_/g, "/"),
@@ -1,34 +1,34 @@
1
1
  const m = {
2
2
  CustomEvent: "ce",
3
3
  Pr: "p",
4
- uc: "pc",
5
- Cc: "ca",
6
- wu: "i",
7
- pu: "ie",
4
+ Ic: "pc",
5
+ Jc: "ca",
6
+ Hu: "i",
7
+ ju: "ie",
8
8
  Ut: "cci",
9
9
  Wt: "ccic",
10
10
  Ht: "ccc",
11
11
  Mt: "ccd",
12
- Al: "ss",
13
- Dl: "se",
14
- Gi: "si",
15
- $i: "sc",
16
- Fi: "sbc",
17
- yc: "sfe",
18
- zo: "iec",
19
- lc: "lr",
20
- nc: "uae",
21
- mc: "lcaa",
22
- dc: "lcar",
23
- Gn: "inc",
24
- Rn: "add",
25
- On: "rem",
26
- $n: "set",
27
- Bn: "ncam",
28
- fc: "sgu",
29
- Fr: "ffi",
12
+ sm: "ss",
13
+ Jl: "se",
14
+ Jr: "si",
15
+ Kr: "sc",
16
+ Lr: "sbc",
17
+ Kc: "sfe",
18
+ Mo: "iec",
19
+ Fc: "lr",
20
+ Rc: "uae",
21
+ Nc: "lcaa",
22
+ xc: "lcar",
23
+ vu: "inc",
24
+ Nu: "add",
25
+ yu: "rem",
26
+ fu: "set",
27
+ gu: "ncam",
28
+ Oc: "sgu",
29
+ Ir: "ffi",
30
30
  ro: "bi",
31
31
  ot: "bc",
32
32
  },
33
- Ee = { Mc: "content_cards_displayed" };
33
+ Ee = { Qc: "content_cards_displayed" };
34
34
  export { m as EventTypes, Ee as InternalEventTypes };
@@ -1,10 +1,29 @@
1
- const P = {
1
+ const L = {
2
2
  oe: function () {
3
- const t = (t = !1) => {
4
- const n = (Math.random().toString(16) + "000000000").substr(2, 8);
5
- return t ? "-" + n.substr(0, 4) + "-" + n.substr(4, 4) : n;
3
+ if ("undefined" != typeof window && window.crypto) {
4
+ if ("function" == typeof window.crypto.randomUUID)
5
+ return window.crypto.randomUUID();
6
+ if ("function" == typeof window.crypto.getRandomValues)
7
+ try {
8
+ const n = new Uint8Array(16);
9
+ window.crypto.getRandomValues(n),
10
+ (n[6] = (15 & n[6]) | 64),
11
+ (n[8] = (63 & n[8]) | 128);
12
+ const t = Array.from(n, (n) => ("0" + n.toString(16)).slice(-2));
13
+ return [
14
+ t.slice(0, 4).join(""),
15
+ t.slice(4, 6).join(""),
16
+ t.slice(6, 8).join(""),
17
+ t.slice(8, 10).join(""),
18
+ t.slice(10, 16).join(""),
19
+ ].join("-");
20
+ } catch (n) {}
21
+ }
22
+ const n = (n = !1) => {
23
+ const t = (Math.random().toString(16) + "000000000").substr(2, 8);
24
+ return n ? "-" + t.substr(0, 4) + "-" + t.substr(4, 4) : t;
6
25
  };
7
- return t() + t(!0) + t(!0) + t();
26
+ return n() + n(!0) + n(!0) + n();
8
27
  },
9
28
  };
10
- export default P;
29
+ export default L;
@@ -1,4 +1,4 @@
1
- export default class et {
1
+ export default class it {
2
2
  constructor(t, e) {
3
3
  (this.database = t),
4
4
  (this.vd = e),
@@ -180,7 +180,7 @@ export default class et {
180
180
  });
181
181
  });
182
182
  }
183
- jr(t, e, n) {
183
+ kr(t, e, n) {
184
184
  if (!this.isSupported()) return "function" == typeof n && n(), !1;
185
185
  const o = this;
186
186
  return this.Bd((i) => {
@@ -333,19 +333,19 @@ export default class et {
333
333
  });
334
334
  }
335
335
  }
336
- et.Us = {
336
+ it.Us = {
337
337
  Rs: {
338
338
  Sd: "AppboyServiceWorkerAsyncStorage",
339
339
  VERSION: 6,
340
340
  Fs: {
341
- Tu: "data",
342
- hr: "pushClicks",
341
+ Yi: "data",
342
+ vr: "pushClicks",
343
343
  cu: "pushSubscribed",
344
344
  Cd: "fallbackDevice",
345
345
  As: "cardUpdates",
346
346
  le: "optOut",
347
- wr: "pendingData",
348
- xh: "sdkAuthenticationSignature",
347
+ zr: "pendingData",
348
+ qh: "sdkAuthenticationSignature",
349
349
  },
350
350
  me: 1,
351
351
  },
@@ -24,13 +24,13 @@ const E = {
24
24
  },
25
25
  warn: function (n) {
26
26
  if (E.zg) {
27
- const o = "Braze SDK Warning: " + n + " (v6.3.0)";
27
+ const o = "Braze SDK Warning: " + n + " (v6.4.0)";
28
28
  null != E.vd ? E.vd(o) : console.warn(o);
29
29
  }
30
30
  },
31
31
  error: function (n) {
32
32
  if (E.zg) {
33
- const o = "Braze SDK Error: " + n + " (v6.3.0)";
33
+ const o = "Braze SDK Error: " + n + " (v6.4.0)";
34
34
  null != E.vd ? E.vd(o) : console.error(o);
35
35
  }
36
36
  },
@@ -1,27 +1,28 @@
1
1
  export default {
2
- _o: "allowCrawlerActivity",
3
- Ro: "baseUrl",
4
- Wo: "noCookies",
5
- Vo: "devicePropertyAllowlist",
6
- Aa: "disablePushTokenMaintenance",
7
- Yo: "enableLogging",
8
- Xo: "enableSdkAuthentication",
9
- qa: "manageServiceWorkerExternally",
10
- Zo: "minimumIntervalBetweenTriggerActionsInSeconds",
11
- Wh: "sessionTimeoutInSeconds",
12
- Vh: "appVersion",
13
- Kh: "appVersionNumber",
14
- Ma: "serviceWorkerLocation",
15
- ka: "safariWebsitePushId",
16
- Xn: "localization",
2
+ Ph: "allowCrawlerActivity",
3
+ Wh: "baseUrl",
4
+ Vh: "noCookies",
5
+ Kh: "devicePropertyAllowlist",
6
+ Da: "disablePushTokenMaintenance",
7
+ $h: "enableLogging",
8
+ Yh: "enableSdkAuthentication",
9
+ Ca: "manageServiceWorkerExternally",
10
+ Xh: "minimumIntervalBetweenTriggerActionsInSeconds",
11
+ Zh: "sessionTimeoutInSeconds",
12
+ Qh: "appVersion",
13
+ Ia: "appVersionNumber",
14
+ _a: "serviceWorkerLocation",
15
+ Ba: "safariWebsitePushId",
16
+ Ea: "localization",
17
17
  er: "contentSecurityNonce",
18
18
  re: "allowUserSuppliedJavascript",
19
19
  Jo: "inAppMessageZIndex",
20
- Do: "openInAppMessagesInNewTab",
21
- Lh: "requireExplicitInAppMessageDismissal",
22
- $h: "doNotLoadFontAwesome",
23
- Jh: "deviceId",
24
- _a: "serviceWorkerScope",
25
- Yh: "sdkFlavor",
20
+ To: "openInAppMessagesInNewTab",
21
+ Oh: "requireExplicitInAppMessageDismissal",
22
+ Na: "doNotLoadFontAwesome",
23
+ Oa: "deviceId",
24
+ Aa: "serviceWorkerScope",
25
+ zi: "dustHost",
26
+ Ta: "sdkFlavor",
26
27
  tn: "openCardsInNewTab",
27
28
  };
@@ -3,7 +3,7 @@ import {
3
3
  buildBrazeBridge as N,
4
4
  } from "../../util/html-display-utils.js";
5
5
  import E from "../../../shared-lib/logger.js";
6
- import { logBannerClick as _ } from "../log-banner-click.js";
6
+ import { logBannerClick } from "../log-banner-click.js";
7
7
  export const BANNER_PLACEMENT_ID = "data-ab-banner-placement-id";
8
8
  export const BANNER_HTML_CLASS = "ab-html-banner";
9
9
  export const CONTROL_BANNER_HTML_CLASS = "ab-html-control-banner";
@@ -32,7 +32,7 @@ export function bannerToHtml(n, t) {
32
32
  o && o.length > 0 && e.setAttribute("title", o[0].textContent || "");
33
33
  const r = Object.assign(Object.assign({}, N(e)), {
34
34
  logClick: function () {
35
- _(n, ...arguments);
35
+ logBannerClick(n, ...arguments);
36
36
  },
37
37
  closeMessage: function () {},
38
38
  setBannerHeight: (n) => {
@@ -4,18 +4,18 @@ import {
4
4
  detectImpression as $,
5
5
  } from "../../common/detect-impression.js";
6
6
  import { topIsInView as g, bottomIsInView as x } from "../../util/dom-utils.js";
7
- import { logBannerImpressions as B } from "../log-banner-impressions.js";
7
+ import { logBannerImpressions } from "../log-banner-impressions.js";
8
8
  import {
9
- BANNER_HTML_CLASS as I,
10
- BANNER_PLACEMENT_ID as k,
11
- CONTROL_BANNER_HTML_CLASS as q,
9
+ BANNER_HTML_CLASS as B,
10
+ BANNER_PLACEMENT_ID as I,
11
+ CONTROL_BANNER_HTML_CLASS as k,
12
12
  } from "./banner-to-html.js";
13
13
  export function detectBannerImpressions() {
14
- const o = document.querySelectorAll(`.${I}, .${q}`),
14
+ const o = document.querySelectorAll(`.${B}, .${k}`),
15
15
  t = [];
16
16
  for (let n = 0; n < o.length; n++) {
17
17
  const s = o[n],
18
- i = s.getAttribute(k);
18
+ i = s.getAttribute(I);
19
19
  if (!i) continue;
20
20
  const m = $.oo(s),
21
21
  r = $.no(s);
@@ -24,5 +24,5 @@ export function detectBannerImpressions() {
24
24
  c = x(s);
25
25
  e && !m && j(s), c && !r && d(s), $.oo(s) && $.no(s) && t.push(i);
26
26
  }
27
- t.length > 0 && B(t);
27
+ t.length > 0 && logBannerImpressions(t);
28
28
  }
@@ -4,3 +4,5 @@ export { insertBanner } from "./ui/insert-banner.js";
4
4
  export { requestBannersRefresh } from "./request-banners-refresh.js";
5
5
  export { getAllBanners } from "./get-all-banners.js";
6
6
  export { subscribeToBannersUpdates } from "./subscribe-to-banners-updates.js";
7
+ export { logBannerImpressions } from "./log-banner-impressions.js";
8
+ export { logBannerClick } from "./log-banner-click.js";
@@ -3,17 +3,17 @@ import {
3
3
  BANNERS_DISABLED_MESSAGE as v,
4
4
  BRAZE_MUST_BE_INITIALIZED_ERROR as w,
5
5
  } from "../common/constants.js";
6
- import r, { OPTIONS as z } from "../managers/braze-instance.js";
7
- import { isArray as D } from "../util/code-utils.js";
8
- import { isValidBannerPlacementId as R } from "../util/validation-utils.js";
6
+ import r, { OPTIONS as q } from "../managers/braze-instance.js";
7
+ import { isArray as z } from "../util/code-utils.js";
8
+ import { isValidBannerPlacementId as D } from "../util/validation-utils.js";
9
9
  import i from "./banner-provider-factory.js";
10
10
  export function requestBannersRefresh(e, t, n) {
11
11
  if (!r.rr()) return void E.warn(w);
12
12
  const o = r.l();
13
13
  if (!o) return;
14
- if (!D(e) || 0 === e.length)
14
+ if (!z(e) || 0 === e.length)
15
15
  return void E.warn("placementIds should be a non-empty array.");
16
- if (!r.ee(z.re))
16
+ if (!r.ee(q.re))
17
17
  return void E.error(
18
18
  "Banners are disabled. Use the 'allowUserSuppliedJavascript' option for braze.initialize to enable these messages.",
19
19
  );
@@ -31,7 +31,7 @@ export function requestBannersRefresh(e, t, n) {
31
31
  0 !==
32
32
  (e = e.filter(
33
33
  (e) =>
34
- !!R(e) ||
34
+ !!D(e) ||
35
35
  (E.warn(
36
36
  `Placement ID should be a valid utf8 string with no whitespaces, filtering out: ${e}`,
37
37
  ),
@@ -1,6 +1,6 @@
1
1
  import E from "../../../shared-lib/logger.js";
2
2
  import { SUBSCRIPTION_ID_DATA_ATTRIBUTE as f } from "../../common/constants.js";
3
- import r, { OPTIONS as z } from "../../managers/braze-instance.js";
3
+ import r, { OPTIONS as q } from "../../managers/braze-instance.js";
4
4
  import { setupBannerUI as U } from "../../ui/js/banner-css.js";
5
5
  import { addPassiveEventListener as J } from "../../util/dom-utils.js";
6
6
  import { bannerToHtml as S } from "../display/banner-to-html.js";
@@ -12,15 +12,15 @@ export function insertBanner(o, e) {
12
12
  if (!o) return void E.error("Not inserting banner: banner was not provided.");
13
13
  if (!e)
14
14
  return void E.error("Not inserting banner: parentNode was not provided.");
15
- if (!r.ee(z.re))
15
+ if (!r.ee(q.re))
16
16
  return void E.error(
17
17
  "Banners are disabled. Use the 'allowUserSuppliedJavascript' option for braze.initialize to enable these messages.",
18
18
  );
19
19
  U();
20
- const n = S(o, r.ee(z.er)),
20
+ const n = S(o, r.ee(q.er)),
21
21
  s = subscribeToBannersUpdates((s) => {
22
22
  const i = s[o.placementId];
23
- i ? e.replaceChildren(S(i, r.ee(z.er))) : A(n);
23
+ i ? e.replaceChildren(S(i, r.ee(q.er))) : A(n);
24
24
  });
25
25
  s && n.setAttribute(f, s), e.replaceChildren(n), J(window, "scroll", F), F();
26
26
  }
@@ -1,14 +1,14 @@
1
1
  import M from "./card-manager.js";
2
2
  import r from "../managers/braze-instance.js";
3
- const G = {
3
+ const _ = {
4
4
  i: !1,
5
5
  aa: null,
6
- ea: () => (G.t(), G.aa || (G.aa = new M(r.p())), G.aa),
6
+ ea: () => (_.t(), _.aa || (_.aa = new M(r.p())), _.aa),
7
7
  t: () => {
8
- G.i || (r.g(G), (G.i = !0));
8
+ _.i || (r.g(_), (_.i = !0));
9
9
  },
10
10
  destroy: () => {
11
- (G.aa = null), (G.i = !1);
11
+ (_.aa = null), (_.i = !1);
12
12
  },
13
13
  };
14
- export default G;
14
+ export default _;
@@ -1,6 +1,6 @@
1
1
  import { ControlCard } from "./models/index.js";
2
2
  import c from "../common/event-logger.js";
3
- import H from "../models/request-result.js";
3
+ import G from "../models/request-result.js";
4
4
  import { logger as E, EventTypes as m } from "../../shared-lib/index.js";
5
5
  import { STORAGE_KEYS as s } from "../managers/storage-manager.js";
6
6
  export default class M {
@@ -8,7 +8,7 @@ export default class M {
8
8
  (this.j = t), (this.j = t);
9
9
  }
10
10
  logClick(t) {
11
- const n = new H();
11
+ const n = new G();
12
12
  if ((t.$t(), null == t.url || "" === t.url))
13
13
  return (
14
14
  E.info(`Card ${t.id} has no url. Not logging click to Braze servers.`),
@@ -24,7 +24,7 @@ export default class M {
24
24
  return c.rt(i, r);
25
25
  }
26
26
  Jt(t) {
27
- const n = new H();
27
+ const n = new G();
28
28
  if (!t.Kt())
29
29
  return (
30
30
  E.info(
@@ -40,7 +40,7 @@ export default class M {
40
40
  return null == r ? n : c.rt(m.Mt, r);
41
41
  }
42
42
  Ot(t) {
43
- const n = new H(!0),
43
+ const n = new G(!0),
44
44
  r = [],
45
45
  i = [];
46
46
  let o = {};
@@ -1,8 +1,8 @@
1
1
  import { createCloseButton as T } from "../../util/component-utils.js";
2
- import { detectSwipe as K, DIRECTIONS as L } from "../../util/dom-utils.js";
3
- import { _handleBrazeAction as O } from "../../Core/handle-braze-action.js";
2
+ import { detectSwipe as H, DIRECTIONS as R } from "../../util/dom-utils.js";
3
+ import { _handleBrazeAction as K } from "../../Core/handle-braze-action.js";
4
4
  import { logCardDismissal } from "../index.js";
5
- import { Guid as P } from "../../../shared-lib/index.js";
5
+ import { Guid as L } from "../../../shared-lib/index.js";
6
6
  export function markCardAsRead(t) {
7
7
  if (null != t) {
8
8
  const e = t.querySelectorAll(".ab-unread-indicator")[0];
@@ -37,7 +37,7 @@ export function cardToHtml(t, e, a, o = "ltr") {
37
37
  let n = "",
38
38
  d = !1;
39
39
  t.url && "" !== t.url && ((n = t.url), (d = !0));
40
- const r = (o) => (markCardAsRead(i), d && (e(t), O(n, a, o)), !1);
40
+ const r = (o) => (markCardAsRead(i), d && (e(t), K(n, a, o)), !1);
41
41
  if (t.pinned) {
42
42
  const t = document.createElement("div");
43
43
  t.className = "ab-pinned-indicator";
@@ -74,10 +74,10 @@ export function cardToHtml(t, e, a, o = "ltr") {
74
74
  t.logCardDismissal = () => logCardDismissal(t);
75
75
  const e = T("Dismiss Card", void 0, t.dismissCard.bind(t), o);
76
76
  i.appendChild(e),
77
- K(c, L.Zt, (t) => {
77
+ H(c, R.Zt, (t) => {
78
78
  (i.className += " ab-swiped-left"), e.onclick(t);
79
79
  }),
80
- K(c, L.ae, (t) => {
80
+ H(c, R.ae, (t) => {
81
81
  (i.className += " ab-swiped-right"), e.onclick(t);
82
82
  });
83
83
  }
@@ -87,7 +87,7 @@ export function cardToHtml(t, e, a, o = "ltr") {
87
87
  const t = document.createElement("h1");
88
88
  if (
89
89
  ((t.className = "ab-title"),
90
- (t.id = P.oe()),
90
+ (t.id = L.oe()),
91
91
  i.setAttribute("aria-labelledby", t.id),
92
92
  d)
93
93
  ) {
@@ -1,11 +1,11 @@
1
1
  import { Card } from "./models/index.js";
2
- import G from "./card-manager-factory.js";
3
- import { MUST_BE_CARD_WARNING_SUFFIX as Q } from "../common/constants.js";
2
+ import _ from "./card-manager-factory.js";
3
+ import { MUST_BE_CARD_WARNING_SUFFIX as O } from "../common/constants.js";
4
4
  import r from "../managers/braze-instance.js";
5
5
  import { logger as E } from "../../shared-lib/index.js";
6
6
  export function logCardDismissal(o) {
7
7
  return (
8
8
  !!r.rr() &&
9
- (o instanceof Card ? G.ea().Jt(o).W : (E.error("card " + Q), !1))
9
+ (o instanceof Card ? _.ea().Jt(o).W : (E.error("card " + O), !1))
10
10
  );
11
11
  }
@@ -1,11 +1,11 @@
1
1
  import E from "../../shared-lib/logger.js";
2
- import { MUST_BE_CARD_WARNING_SUFFIX as Q } from "../common/constants.js";
2
+ import { MUST_BE_CARD_WARNING_SUFFIX as O } from "../common/constants.js";
3
3
  import r from "../managers/braze-instance.js";
4
- import G from "./card-manager-factory.js";
4
+ import _ from "./card-manager-factory.js";
5
5
  import { Card } from "./models/index.js";
6
6
  export function logContentCardClick(o) {
7
7
  return (
8
8
  !!r.rr() &&
9
- (o instanceof Card ? G.ea().logClick(o).W : (E.error("card " + Q), !1))
9
+ (o instanceof Card ? _.ea().logClick(o).W : (E.error("card " + O), !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
- import { isArray as D } from "../util/code-utils.js";
3
+ import { isArray as z } from "../util/code-utils.js";
4
4
  import E from "../../shared-lib/logger.js";
5
- import { MUST_BE_CARD_WARNING_SUFFIX as Q } from "../common/constants.js";
6
- import G from "./card-manager-factory.js";
5
+ import { MUST_BE_CARD_WARNING_SUFFIX as O } from "../common/constants.js";
6
+ import _ from "./card-manager-factory.js";
7
7
  export function logContentCardImpressions(o) {
8
8
  if (!r.rr()) return !1;
9
- if (!D(o)) return E.error("cards must be an array"), !1;
9
+ if (!z(o)) return E.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 ${Q}`), !1;
12
- return G.ea().Ot(o).W;
11
+ if (!(r instanceof Card)) return E.error(`Each card in cards ${O}`), !1;
12
+ return _.ea().Ot(o).W;
13
13
  }
@@ -1,8 +1,8 @@
1
1
  import {
2
- convertMsToSeconds as X,
3
- dateFromUnixTimestamp as V,
2
+ convertMsToSeconds as P,
3
+ dateFromUnixTimestamp as X,
4
4
  } from "../../util/date-utils.js";
5
- import { FEED_ANIMATION_DURATION as W } from "../../common/constants.js";
5
+ import { FEED_ANIMATION_DURATION as V } from "../../common/constants.js";
6
6
  import u from "../../managers/subscription-manager.js";
7
7
  import E from "../../../shared-lib/logger.js";
8
8
  export default class Card {
@@ -77,7 +77,7 @@ export default class Card {
77
77
  setTimeout(function () {
78
78
  t && t.parentNode && t.parentNode.removeChild(t);
79
79
  }, Card.ni));
80
- }, W));
80
+ }, V));
81
81
  }
82
82
  hi() {
83
83
  return null == this.ti && (this.ti = new u()), this.ti;
@@ -107,7 +107,7 @@ export default class Card {
107
107
  if (
108
108
  null != t[Card.ui.ps] &&
109
109
  null != this.updated &&
110
- parseInt(t[Card.ui.ps]) < X(this.updated.valueOf())
110
+ parseInt(t[Card.ui.ps]) < P(this.updated.valueOf())
111
111
  )
112
112
  return !0;
113
113
  if (
@@ -118,12 +118,12 @@ export default class Card {
118
118
  null != t[Card.ui.ds] && (this.description = t[Card.ui.ds]),
119
119
  null != t[Card.ui.ps])
120
120
  ) {
121
- const i = V(t[Card.ui.ps]);
121
+ const i = X(t[Card.ui.ps]);
122
122
  null != i && (this.updated = i);
123
123
  }
124
124
  if (null != t[Card.ui.us]) {
125
125
  let i;
126
- (i = t[Card.ui.us] === Card.Ti ? null : V(t[Card.ui.us])),
126
+ (i = t[Card.ui.us] === Card.Ti ? null : X(t[Card.ui.us])),
127
127
  (this.expiresAt = i);
128
128
  }
129
129
  if (
@@ -6,8 +6,8 @@ import {
6
6
  ImageOnly,
7
7
  } from "../index.js";
8
8
  import {
9
- dateFromUnixTimestamp as V,
10
- rehydrateDateAfterJsonization as Y,
9
+ dateFromUnixTimestamp as X,
10
+ rehydrateDateAfterJsonization as Q,
11
11
  } from "../../util/date-utils.js";
12
12
  import { logger as E } from "../../../shared-lib/index.js";
13
13
  export function newCard(e, n, r, t, i, o, l, u, d, a, f, s, w, m, p, C, c, x) {
@@ -33,9 +33,9 @@ export function newCardFromContentCardsJson(e) {
33
33
  i = e[Card.ui.cs],
34
34
  o = e[Card.ui.ns],
35
35
  l = e[Card.ui.ds],
36
- u = V(e[Card.ui.ps]);
36
+ u = X(e[Card.ui.ps]);
37
37
  let d;
38
- d = e[Card.ui.us] === Card.Ti ? null : V(e[Card.ui.us]);
38
+ d = e[Card.ui.us] === Card.Ti ? null : X(e[Card.ui.us]);
39
39
  return newCard(
40
40
  n,
41
41
  r,
@@ -66,8 +66,8 @@ export function newCardFromSerializedValue(e) {
66
66
  e[Card.ss.cs],
67
67
  e[Card.ss.ns],
68
68
  e[Card.ss.ds],
69
- Y(e[Card.ss.ps]),
70
- Y(e[Card.ss.us]),
69
+ Q(e[Card.ss.ps]),
70
+ Q(e[Card.ss.us]),
71
71
  e[Card.ss.URL],
72
72
  e[Card.ss.ls],
73
73
  e[Card.ss.fs],