@braze/web-sdk 5.7.0 → 5.8.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 (98) hide show
  1. package/index.d.ts +4 -4
  2. package/package.json +1 -1
  3. package/shared-lib/encoding-utils.js +1 -1
  4. package/shared-lib/event-types.js +8 -8
  5. package/shared-lib/indexed-db-adapter.js +7 -7
  6. package/shared-lib/logger.js +2 -2
  7. package/shared-lib/supported-options.js +17 -17
  8. package/src/Banner/get-all-banners.js +2 -3
  9. package/src/Banner/get-banner.js +11 -11
  10. package/src/Banner/request-banners-refresh.js +20 -12
  11. package/src/Banner/subscribe-to-banners-updates.js +14 -13
  12. package/src/Banner/ui/insert-banner.js +11 -9
  13. package/src/Card/log-card-impressions.js +2 -2
  14. package/src/ContentCards/content-cards-provider-factory.js +1 -1
  15. package/src/ContentCards/content-cards.js +3 -3
  16. package/src/ContentCards/ui/show-content-cards.js +5 -5
  17. package/src/Core/add-sdk-metadata.js +2 -2
  18. package/src/Core/change-user.js +3 -3
  19. package/src/Core/disable-sdk.js +5 -5
  20. package/src/Core/enable-sdk.js +3 -3
  21. package/src/Core/get-device-id.js +2 -2
  22. package/src/Core/get-user.js +1 -1
  23. package/src/Core/is-disabled.js +1 -1
  24. package/src/Core/open-session.js +6 -6
  25. package/src/Core/wipe-data.js +1 -1
  26. package/src/FeatureFlags/feature-flag-factory.js +4 -4
  27. package/src/FeatureFlags/feature-flag.js +17 -17
  28. package/src/FeatureFlags/feature-flags-provider.js +37 -37
  29. package/src/FeatureFlags/get-all-feature-flags.js +6 -7
  30. package/src/FeatureFlags/get-feature-flag.js +5 -6
  31. package/src/FeatureFlags/log-feature-flag-impression.js +3 -3
  32. package/src/FeatureFlags/subscribe-to-feature-flags-updates.js +1 -1
  33. package/src/Feed/feed.js +2 -2
  34. package/src/Feed/ui/show-feed.js +4 -4
  35. package/src/InAppMessage/defer-in-app-message.js +1 -1
  36. package/src/InAppMessage/display/html-message-to-html.js +6 -6
  37. package/src/InAppMessage/display/in-app-message-to-html.js +18 -18
  38. package/src/InAppMessage/display/modal-utils.js +4 -4
  39. package/src/InAppMessage/in-app-message-factory.js +4 -4
  40. package/src/InAppMessage/in-app-message-manager-factory.js +1 -1
  41. package/src/InAppMessage/in-app-message-manager.js +49 -49
  42. package/src/InAppMessage/log-in-app-message-button-click.js +1 -1
  43. package/src/InAppMessage/log-in-app-message-click.js +1 -1
  44. package/src/InAppMessage/log-in-app-message-impression.js +1 -1
  45. package/src/InAppMessage/models/control-message.js +1 -1
  46. package/src/InAppMessage/models/full-screen-message.js +3 -3
  47. package/src/InAppMessage/models/html-message.js +5 -5
  48. package/src/InAppMessage/models/in-app-message-button.js +2 -2
  49. package/src/InAppMessage/models/in-app-message.js +32 -32
  50. package/src/InAppMessage/models/modal-message.js +3 -3
  51. package/src/InAppMessage/models/slide-up-message.js +6 -6
  52. package/src/InAppMessage/models/templated-in-app-message.js +8 -8
  53. package/src/InAppMessage/ui/show-in-app-message.js +18 -18
  54. package/src/Push/push-manager-factory.js +8 -8
  55. package/src/Push/push-manager.js +83 -83
  56. package/src/Push/utils/push-utils.js +4 -4
  57. package/src/User/user-manager.js +6 -6
  58. package/src/User/user.js +18 -18
  59. package/src/common/base-feed.js +3 -3
  60. package/src/common/event-logger.js +1 -1
  61. package/src/common/feed-display.js +8 -8
  62. package/src/l10n/l10n-manager-factory.js +2 -2
  63. package/src/l10n/l10n-manager.js +1 -1
  64. package/src/managers/braze-instance.js +107 -107
  65. package/src/managers/device-manager.js +18 -18
  66. package/src/managers/network-manager.js +117 -117
  67. package/src/managers/server-config-manager.js +61 -61
  68. package/src/managers/session-manager.js +25 -25
  69. package/src/managers/storage-manager-factory.js +8 -8
  70. package/src/managers/storage-manager.js +57 -57
  71. package/src/models/backend-errors.js +5 -5
  72. package/src/models/braze-event.js +2 -2
  73. package/src/models/device.js +2 -2
  74. package/src/models/identifier.js +10 -10
  75. package/src/models/push-token.js +7 -7
  76. package/src/models/server-config.js +30 -30
  77. package/src/request-controller.js +93 -93
  78. package/src/triggers/models/filter-set.js +4 -4
  79. package/src/triggers/models/filter.js +1 -1
  80. package/src/triggers/models/trigger-condition.js +29 -29
  81. package/src/triggers/models/trigger-events.js +1 -1
  82. package/src/triggers/models/trigger.js +9 -9
  83. package/src/triggers/triggers-provider-factory.js +2 -2
  84. package/src/triggers/triggers-provider.js +15 -15
  85. package/src/ui/js/attach-css.js +3 -3
  86. package/src/ui/js/load-font-awesome.js +2 -2
  87. package/src/util/base-device-parser.js +3 -3
  88. package/src/util/braze-actions.js +4 -4
  89. package/src/util/browser-detector.js +5 -5
  90. package/src/util/client-hints-parser.js +1 -1
  91. package/src/util/component-utils.js +1 -1
  92. package/src/util/dom-utils.js +6 -6
  93. package/src/util/key-codes.js +1 -1
  94. package/src/util/net.js +1 -1
  95. package/src/util/request-header-utils.js +13 -13
  96. package/src/util/user-agent-parser.js +1 -1
  97. package/src/util/validation-utils.js +4 -4
  98. 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 v5.7.0
2
+ * Type definitions for @braze/web-sdk v5.8.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
@@ -2162,7 +2162,7 @@ export function openSession(): void;
2162
2162
  * - Create a `service-worker.js` file with the content below and place it in the root directory of your website:
2163
2163
  *
2164
2164
  * ```
2165
- * self.importScripts('https://js.appboycdn.com/web-sdk-develop/5.7/service-worker.js');
2165
+ * self.importScripts('https://js.appboycdn.com/web-sdk-develop/5.8/service-worker.js');
2166
2166
  * ```
2167
2167
  *
2168
2168
  * For more details, see [Our Product Documentation](https://www.braze.com/docs/developer_guide/platform_integration_guides/web/push_notifications/integration).
@@ -2475,7 +2475,7 @@ export function getBanner(placementId: string): Banner | null | undefined;
2475
2475
  * @param banner - The `Banner` to insert onto the page.
2476
2476
  * @param parentNode - The HTML element to render the banner into.
2477
2477
  */
2478
- export function insertBanner(banner: Banner, parentNode: HTMLElement): void;
2478
+ export function insertBanner(banner: Banner | null | undefined, parentNode: HTMLElement): void;
2479
2479
 
2480
2480
  /**
2481
2481
  * Logs that the user clicked the given banner. This should generally be called through the Braze JavaScript bridge
@@ -2630,7 +2630,7 @@ export type InitializationOptions = {
2630
2630
  * lifecycle of, set this option to true and the Braze SDK will not register or unregister a service worker. If you set this
2631
2631
  * option to true, in order for push to function correctly you must register the service worker yourself BEFORE calling
2632
2632
  * `requestPushPermission`, and ensure that it contains Braze's service worker code, either with
2633
- * `self.importScripts('https://js.appboycdn.com/web-sdk-develop/5.7/service-worker.js');` or by including the content
2633
+ * `self.importScripts('https://js.appboycdn.com/web-sdk-develop/5.8/service-worker.js');` or by including the content
2634
2634
  * of that file directly. When this option is true, the `serviceWorkerLocation` option is irrelevant and is ignored.
2635
2635
  */
2636
2636
  manageServiceWorkerExternally?: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@braze/web-sdk",
3
- "version": "5.7.0",
3
+ "version": "5.8.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
- On: function (t) {
2
+ Cn: function (t) {
3
3
  const r = (t + "=".repeat((4 - (t.length % 4)) % 4))
4
4
  .replace(/\-/g, "+")
5
5
  .replace(/_/g, "/"),
@@ -3,28 +3,28 @@ const d = {
3
3
  Pr: "p",
4
4
  gc: "pc",
5
5
  Ac: "ca",
6
- Mu: "i",
7
- Tu: "ie",
6
+ zu: "i",
7
+ Du: "ie",
8
8
  xt: "cci",
9
9
  $t: "ccic",
10
10
  lt: "ccc",
11
11
  dt: "ccd",
12
- Kl: "ss",
13
- Gl: "se",
12
+ Il: "ss",
13
+ Dl: "se",
14
14
  Ir: "si",
15
15
  Mr: "sc",
16
16
  Tr: "sbc",
17
17
  Mc: "sfe",
18
- zo: "iec",
18
+ qo: "iec",
19
19
  fc: "lr",
20
20
  mc: "uae",
21
21
  yt: "ci",
22
22
  ut: "cc",
23
23
  wc: "lcaa",
24
24
  bc: "lcar",
25
- Xn: "inc",
26
- Jn: "add",
27
- Qn: "rem",
25
+ Jn: "inc",
26
+ Mn: "add",
27
+ Yn: "rem",
28
28
  Hn: "set",
29
29
  Kn: "ncam",
30
30
  kc: "sgu",
@@ -180,7 +180,7 @@ export default class tt {
180
180
  });
181
181
  });
182
182
  }
183
- jr(t, e, n) {
183
+ cr(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) => {
@@ -307,7 +307,7 @@ export default class tt {
307
307
  for (const e in this.database.Ks) {
308
308
  const n = e;
309
309
  this.database.Ks.hasOwnProperty(e) &&
310
- this.database.Ks[n] !== this.database.Ks.ie &&
310
+ this.database.Ks[n] !== this.database.Ks.oe &&
311
311
  t.push(this.database.Ks[n]);
312
312
  }
313
313
  const e = this;
@@ -338,15 +338,15 @@ tt._s = {
338
338
  Sd: "AppboyServiceWorkerAsyncStorage",
339
339
  VERSION: 6,
340
340
  Ks: {
341
- zu: "data",
342
- hr: "pushClicks",
341
+ Su: "data",
342
+ jr: "pushClicks",
343
343
  cu: "pushSubscribed",
344
344
  Cd: "fallbackDevice",
345
345
  Hs: "cardUpdates",
346
- ie: "optOut",
347
- $r: "pendingData",
346
+ oe: "optOut",
347
+ kr: "pendingData",
348
348
  yh: "sdkAuthenticationSignature",
349
349
  },
350
- oe: 1,
350
+ te: 1,
351
351
  },
352
352
  };
@@ -24,13 +24,13 @@ const N = {
24
24
  },
25
25
  warn: function (n) {
26
26
  if (N.zg) {
27
- const o = "Braze SDK Warning: " + n + " (v5.7.0)";
27
+ const o = "Braze SDK Warning: " + n + " (v5.8.0)";
28
28
  null != N.vd ? N.vd(o) : console.warn(o);
29
29
  }
30
30
  },
31
31
  error: function (n) {
32
32
  if (N.zg) {
33
- const o = "Braze SDK Error: " + n + " (v5.7.0)";
33
+ const o = "Braze SDK Error: " + n + " (v5.8.0)";
34
34
  null != N.vd ? N.vd(o) : console.error(o);
35
35
  }
36
36
  },
@@ -1,28 +1,28 @@
1
1
  export default {
2
- Oo: "allowCrawlerActivity",
3
- Wo: "baseUrl",
4
- Vo: "noCookies",
5
- Ko: "devicePropertyAllowlist",
2
+ Wo: "allowCrawlerActivity",
3
+ Vo: "baseUrl",
4
+ Ko: "noCookies",
5
+ Yo: "devicePropertyAllowlist",
6
6
  Da: "disablePushTokenMaintenance",
7
- Yo: "enableLogging",
8
- Ho: "enableSdkAuthentication",
7
+ Xo: "enableLogging",
8
+ Zo: "enableSdkAuthentication",
9
9
  Ca: "manageServiceWorkerExternally",
10
- Xo: "minimumIntervalBetweenTriggerActionsInSeconds",
11
- Zo: "sessionTimeoutInSeconds",
12
- Qo: "appVersion",
13
- Wh: "appVersionNumber",
10
+ Qo: "minimumIntervalBetweenTriggerActionsInSeconds",
11
+ Wh: "sessionTimeoutInSeconds",
12
+ Vh: "appVersion",
13
+ $h: "appVersionNumber",
14
14
  _a: "serviceWorkerLocation",
15
15
  Ba: "safariWebsitePushId",
16
16
  Ea: "localization",
17
- ir: "contentSecurityNonce",
18
- er: "allowUserSuppliedJavascript",
19
- Do: "inAppMessageZIndex",
20
- To: "openInAppMessagesInNewTab",
17
+ er: "contentSecurityNonce",
18
+ re: "allowUserSuppliedJavascript",
19
+ To: "inAppMessageZIndex",
20
+ Fo: "openInAppMessagesInNewTab",
21
21
  en: "openNewsFeedCardsInNewTab",
22
22
  mh: "requireExplicitInAppMessageDismissal",
23
- Vh: "doNotLoadFontAwesome",
24
- $h: "deviceId",
23
+ Yh: "doNotLoadFontAwesome",
24
+ Xh: "deviceId",
25
25
  Aa: "serviceWorkerScope",
26
- Yh: "sdkFlavor",
26
+ Zh: "sdkFlavor",
27
27
  tn: "openCardsInNewTab",
28
28
  };
@@ -1,12 +1,11 @@
1
- import { logger as N } from "../../shared-lib/index.js";
2
1
  import r from "../managers/braze-instance.js";
3
2
  import i from "./banner-provider-factory.js";
4
3
  import { getBannerIfNotExpired as v } from "./get-banner.js";
5
4
  export function getAllBanners() {
6
5
  if (!r.rr()) return;
7
6
  const n = {},
8
- e = r.v();
9
- if (e && !e.Ds()) return N.info("Banners are not enabled."), n;
7
+ t = r.v();
8
+ if (t && !t.Ds()) return n;
10
9
  const o = i.m().fs();
11
10
  for (const r in o) n[r] = v(o, r);
12
11
  return n;
@@ -1,19 +1,19 @@
1
1
  import { logger as N } from "../../shared-lib/index.js";
2
2
  import r from "../managers/braze-instance.js";
3
3
  import i from "./banner-provider-factory.js";
4
- export function getBannerIfNotExpired(n, e) {
5
- const r = n[e];
6
- if (!r) return null;
7
- const t = r.it,
8
- a = new Date().valueOf();
9
- return -1 !== t && 1e3 * t < a
10
- ? (N.info(`Banner with ID: ${r.id} and placement ID: ${e} has expired.`),
4
+ export function getBannerIfNotExpired(n, r) {
5
+ const e = n[r];
6
+ if (!e) return null;
7
+ const t = e.it,
8
+ o = new Date().valueOf();
9
+ return -1 !== t && 1e3 * t < o
10
+ ? (N.info(`Banner with ID: ${e.id} and placement ID: ${r} has expired.`),
11
11
  null)
12
- : r;
12
+ : e;
13
13
  }
14
14
  export function getBanner(n) {
15
15
  if (!r.rr()) return;
16
- const e = r.v();
17
- if (e && !e.Ds()) return N.info("Banners are not enabled."), null;
18
- return getBannerIfNotExpired(i.m().fs(), n);
16
+ const e = i.m();
17
+ if (!e.L()) return null;
18
+ return getBannerIfNotExpired(e.fs(), n);
19
19
  }
@@ -1,26 +1,34 @@
1
1
  import { logger as N } from "../../shared-lib/index.js";
2
2
  import { BRAZE_MUST_BE_INITIALIZED_ERROR as p } from "../common/constants.js";
3
- import r from "../managers/braze-instance.js";
4
- import { isArray as w } from "../util/code-utils.js";
3
+ import r, { OPTIONS as w } from "../managers/braze-instance.js";
4
+ import { isArray as z } from "../util/code-utils.js";
5
5
  import { isValidBannerPlacementId as D } from "../util/validation-utils.js";
6
6
  import i from "./banner-provider-factory.js";
7
- export function requestBannersRefresh(e, n, o) {
7
+ export function requestBannersRefresh(e, n, t) {
8
8
  if (!r.rr()) return void N.warn(p);
9
- const t = r.v();
10
- if (!t) return void N.warn(p);
11
- if (!t.Ds()) return void N.info("Banners are not enabled.");
12
- if (!w(e) || 0 === e.length)
9
+ const s = r.v();
10
+ if (!s) return;
11
+ if (!z(e) || 0 === e.length)
13
12
  return void N.warn("placementIds should be a non-empty array.");
13
+ if (!r.ee(w.re))
14
+ return void N.error(
15
+ "Banners are disabled. Use the 'allowUserSuppliedJavascript' option for braze.initialize to enable these messages.",
16
+ );
17
+ const o = i.m();
14
18
  if (i.m().Rs())
15
19
  return void N.warn(
16
20
  "Banners can be refreshed only once per session per user.",
17
21
  );
18
- const s = t.ee();
19
- e.length > s &&
22
+ if (!s || !o.L())
23
+ return void s.A(() => {
24
+ requestBannersRefresh(e, n, t);
25
+ });
26
+ const a = s.ne();
27
+ e.length > a &&
20
28
  (N.warn(
21
- `Number of placement IDs requested exceeds the max allowed. Trimming placementIds array from length ${e.length} to ${s} (max allowed).`,
29
+ `Number of placement IDs requested exceeds the max allowed. Trimming placementIds array from length ${e.length} to ${a} (max allowed).`,
22
30
  ),
23
- (e = e.slice(0, s))),
31
+ (e = e.slice(0, a))),
24
32
  0 !==
25
33
  (e = e.filter(
26
34
  (e) =>
@@ -31,5 +39,5 @@ export function requestBannersRefresh(e, n, o) {
31
39
  !1),
32
40
  )).length &&
33
41
  (N.info(`Requesting banners for placement IDs: ${JSON.stringify(e)}`),
34
- i.m().$(e, n, o));
42
+ i.m().$(e, n, t));
35
43
  }
@@ -2,22 +2,23 @@ import r from "../managers/braze-instance.js";
2
2
  import i from "./banner-provider-factory.js";
3
3
  import { getAllBanners } from "./get-all-banners.js";
4
4
  export function subscribeToBannersUpdates(n) {
5
+ var o;
5
6
  if (!r.rr()) return;
6
- const o = i.m();
7
- if (o.Is()) {
7
+ const t = i.m();
8
+ if (t.Is()) {
8
9
  const r = getAllBanners();
9
10
  r && "function" == typeof n && n(r);
10
11
  }
11
- const t = o.qs(n);
12
- if (!o.Cs()) {
13
- const n = r.nn();
14
- if (n) {
15
- const r = n.rn(() => {
16
- const n = o.ls();
17
- n && n.length > 0 && o.$(n);
18
- });
19
- r && o.Ts(r);
20
- }
12
+ const s = t.qs(n);
13
+ if (!t.Cs()) {
14
+ const n =
15
+ null === (o = r.nn()) || void 0 === o
16
+ ? void 0
17
+ : o.rn(() => {
18
+ const n = t.ls();
19
+ n && n.length > 0 && t.$(n);
20
+ });
21
+ n && t.Ts(n);
21
22
  }
22
- return t;
23
+ return s;
23
24
  }
@@ -1,24 +1,26 @@
1
1
  import N 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 w } 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";
7
7
  import { destroyBannerHtml as A } from "../display/destroy-banner-html.js";
8
8
  import { detectBannerImpressions as C } from "../display/detect-banner-impressions.js";
9
9
  import { subscribeToBannersUpdates } from "../subscribe-to-banners-updates.js";
10
- export function insertBanner(o, s) {
10
+ export function insertBanner(o, e) {
11
11
  if (!r.rr()) return;
12
- if (!o || !s) return void N.error("Banner or parentNode is not provided.");
13
- if (!r.sr(z.er))
12
+ if (!o) return void N.error("Not inserting banner: banner was not provided.");
13
+ if (!e)
14
+ return void N.error("Not inserting banner: parentNode was not provided.");
15
+ if (!r.ee(w.re))
14
16
  return void N.error(
15
17
  "Banners are disabled. Use the 'allowUserSuppliedJavascript' option for braze.initialize to enable these messages.",
16
18
  );
17
19
  U();
18
- const e = S(o, r.sr(z.ir)),
19
- i = subscribeToBannersUpdates((i) => {
20
- const t = i[o.placementId];
21
- t ? s.replaceChildren(S(t, r.sr(z.ir))) : A(e);
20
+ const n = S(o, r.ee(w.er)),
21
+ s = subscribeToBannersUpdates((s) => {
22
+ const i = s[o.placementId];
23
+ i ? e.replaceChildren(S(i, r.ee(w.er))) : A(n);
22
24
  });
23
- i && e.setAttribute(f, i), s.replaceChildren(e), J(window, "scroll", C), C();
25
+ s && n.setAttribute(f, s), e.replaceChildren(n), J(window, "scroll", C), C();
24
26
  }
@@ -1,12 +1,12 @@
1
1
  import { Card } from "./models/index.js";
2
2
  import _ from "./card-manager-factory.js";
3
3
  import r from "../managers/braze-instance.js";
4
- import { isArray as w } from "../util/code-utils.js";
4
+ import { isArray as z } from "../util/code-utils.js";
5
5
  import { MUST_BE_CARD_WARNING_SUFFIX as K } from "../common/constants.js";
6
6
  import { logger as N } from "../../shared-lib/index.js";
7
7
  export function logCardImpressions(o, n) {
8
8
  if (!r.rr()) return !1;
9
- if (!w(o)) return N.error("cards must be an array"), !1;
9
+ if (!z(o)) return N.error("cards must be an array"), !1;
10
10
  for (const r of o)
11
11
  if (!(r instanceof Card)) return N.error(`Each card in cards ${K}`), !1;
12
12
  return _.ea().jt(o, n).ss;
@@ -6,7 +6,7 @@ const W = {
6
6
  m: () => (
7
7
  W.p(),
8
8
  W.provider ||
9
- ((W.provider = new Q(r.tr(), r.j(), r.v(), r.nr(), r.g())),
9
+ ((W.provider = new Q(r.ir(), r.j(), r.v(), r.tr(), r.g())),
10
10
  r._(W.provider)),
11
11
  W.provider
12
12
  ),
@@ -14,11 +14,11 @@ export default class ContentCards extends rr {
14
14
  logCardClick(r) {
15
15
  return logCardClick(r, !0);
16
16
  }
17
- dr() {
17
+ sr() {
18
18
  requestContentCardsRefresh();
19
19
  }
20
- ur() {
20
+ nr() {
21
21
  return !0;
22
22
  }
23
23
  }
24
- ContentCards.ar = 6e4;
24
+ ContentCards.dr = 6e4;
@@ -1,4 +1,4 @@
1
- import r, { OPTIONS as z } from "../../managers/braze-instance.js";
1
+ import r, { OPTIONS as w } from "../../managers/braze-instance.js";
2
2
  import { ContentCards, subscribeToContentCardsUpdates } from "../index.js";
3
3
  import W from "../content-cards-provider-factory.js";
4
4
  import {
@@ -18,17 +18,17 @@ export function showContentCards(n, t) {
18
18
  fn();
19
19
  let e = !1;
20
20
  null == n && ((n = document.body), (e = !0));
21
- const o = r.sr(z.tn) || r.sr(z.en) || !1,
21
+ const o = r.ee(w.tn) || r.ee(w.en) || !1,
22
22
  i = W.m().Ri(!1);
23
23
  "function" == typeof t && an(i, t(i.cards.slice()), i.lastUpdated, null, o);
24
24
  const a = tn(i, o, e),
25
25
  s = W.m(),
26
26
  f = s.Zs();
27
27
  (null == i.lastUpdated ||
28
- new Date().valueOf() - i.lastUpdated.valueOf() > ContentCards.ar) &&
29
- (null == f || new Date().valueOf() - f > ContentCards.ar) &&
28
+ new Date().valueOf() - i.lastUpdated.valueOf() > ContentCards.dr) &&
29
+ (null == f || new Date().valueOf() - f > ContentCards.dr) &&
30
30
  (N.info(
31
- `Cached content cards were older than max TTL of ${ContentCards.ar} ms, requesting an update from the server.`,
31
+ `Cached content cards were older than max TTL of ${ContentCards.dr} ms, requesting an update from the server.`,
32
32
  ),
33
33
  on(i, a),
34
34
  s.fi(new Date().valueOf()));
@@ -1,7 +1,7 @@
1
1
  import aa from "../managers/braze-instance.js";
2
2
  import BrazeSdkMetadata from "./braze-sdk-metadata.js";
3
3
  import {
4
- isArray as w,
4
+ isArray as z,
5
5
  validateValueIsFromEnum as ta,
6
6
  } from "../util/code-utils.js";
7
7
  import { logger as N } from "../../shared-lib/index.js";
@@ -9,7 +9,7 @@ export function addSdkMetadata(a) {
9
9
  if (!aa.rr()) return;
10
10
  const t = aa.g();
11
11
  if (t) {
12
- if (!w(a))
12
+ if (!z(a))
13
13
  return (
14
14
  N.error("Cannot set SDK metadata because metadata is not an array."), !1
15
15
  );
@@ -7,11 +7,11 @@ export function changeUser(e, i) {
7
7
  if (!r.rr()) return;
8
8
  if (null == e || 0 === e.length || e != e)
9
9
  return void N.error("changeUser requires a non-empty userId.");
10
- if (er(e) > User.mr)
10
+ if (er(e) > User.ur)
11
11
  return void N.error(
12
- `Rejected user id "${e}" because it is longer than ${User.mr} bytes.`,
12
+ `Rejected user id "${e}" because it is longer than ${User.ur} bytes.`,
13
13
  );
14
14
  if (null != i && !ir(i, "set signature for new user", "signature")) return;
15
15
  const t = r.nn();
16
- t && t.changeUser(e.toString(), r.lr(), i);
16
+ t && t.changeUser(e.toString(), r.ar(), i);
17
17
  }
@@ -4,12 +4,12 @@ import ne, { STORAGE_KEYS as t } from "../managers/storage-manager.js";
4
4
  export function disableSDK() {
5
5
  const e = r.nn();
6
6
  e && e.requestImmediateDataFlush();
7
- const n = new ne.ne(null, !0),
8
- s = "This-cookie-will-expire-in-" + n.se();
9
- n.store(t.ae, s);
7
+ const n = new ne.se(null, !0),
8
+ s = "This-cookie-will-expire-in-" + n.ae();
9
+ n.store(t.ie, s);
10
10
  const a = tt._s.Xs;
11
- new tt(a, N).setItem(a.Ks.ie, a.oe, !0),
11
+ new tt(a, N).setItem(a.Ks.oe, a.te, !0),
12
12
  N.info("disableSDK was called"),
13
13
  r.destroy(!1),
14
- r.re(!0);
14
+ r.le(!0);
15
15
  }
@@ -2,10 +2,10 @@ import r from "../managers/braze-instance.js";
2
2
  import { logger as N, IndexedDBAdapter as tt } from "../../shared-lib/index.js";
3
3
  import ne, { STORAGE_KEYS as t } from "../managers/storage-manager.js";
4
4
  export function enableSDK() {
5
- new ne.ne(null, !0).remove(t.ae);
5
+ new ne.se(null, !0).remove(t.ie);
6
6
  const e = tt._s.Xs;
7
- new tt(e, N).me(e.Ks.ie, e.oe),
7
+ new tt(e, N).me(e.Ks.oe, e.te),
8
8
  N.info("enableSDK was called"),
9
9
  r.destroy(!1),
10
- r.re(!1);
10
+ r.le(!1);
11
11
  }
@@ -2,9 +2,9 @@ import r from "../managers/braze-instance.js";
2
2
  import { logger as N } from "../../shared-lib/index.js";
3
3
  export function getDeviceId(e) {
4
4
  if (!r.rr()) return;
5
- const t = r.te();
5
+ const t = r.ce();
6
6
  if (!t) return;
7
- const i = t.ce().id;
7
+ const i = t.de().id;
8
8
  if ("function" != typeof e) return i;
9
9
  N.warn(
10
10
  "The callback for getDeviceId is deprecated. You can access its return value directly instead (e.g. `const id = braze.getDeviceId()`)",
@@ -1,4 +1,4 @@
1
1
  import r from "../managers/braze-instance.js";
2
2
  export function getUser() {
3
- if (r.rr()) return r.cr();
3
+ if (r.rr()) return r.mr();
4
4
  }
@@ -1,4 +1,4 @@
1
1
  import ne, { STORAGE_KEYS as t } from "../managers/storage-manager.js";
2
2
  export function isDisabled() {
3
- return !!new ne.ne(null, !0).gr(t.ae);
3
+ return !!new ne.se(null, !0).gr(t.ie);
4
4
  }
@@ -9,17 +9,17 @@ export function openSession() {
9
9
  i.openSession();
10
10
  const t = tt._s.Xs,
11
11
  o = new tt(t, N);
12
- o.jr(t.Ks.hr, (r, n) => {
12
+ o.cr(t.Ks.jr, (r, n) => {
13
13
  const e = n.lastClick,
14
14
  s = n.trackingString;
15
15
  N.info(`Firing push click trigger from ${s} push click at ${e}`);
16
- const c = i.br(e, s),
16
+ const c = i.lr(e, s),
17
17
  g = function () {
18
- ot.m().ue(et.kr, [s], c);
18
+ ot.m().ue(et.hr, [s], c);
19
19
  };
20
- i.vr(g, g), o.me(t.Ks.hr, r);
20
+ i.br(g, g), o.me(t.Ks.jr, r);
21
21
  }),
22
- o.Gs(t.Ks.$r, function (r) {
23
- i.wr(r);
22
+ o.Gs(t.Ks.kr, function (r) {
23
+ i.vr(r);
24
24
  });
25
25
  }
@@ -12,5 +12,5 @@ export function wipeData() {
12
12
  r = tt._s[n];
13
13
  new tt(r, N).clearData();
14
14
  }
15
- if (r.rr()) for (const o of r.lr()) o.clearData(!0);
15
+ if (r.rr()) for (const o of r.ar()) o.clearData(!0);
16
16
  }
@@ -1,22 +1,22 @@
1
1
  import { logger as N } from "../../shared-lib/index.js";
2
2
  import FeatureFlag from "./feature-flag.js";
3
3
  export function newFeatureFlagFromJson(e) {
4
- if (e[FeatureFlag.li.Et] && "boolean" == typeof e[FeatureFlag.li.le])
4
+ if (e[FeatureFlag.li.Et] && "boolean" == typeof e[FeatureFlag.li.pe])
5
5
  return new FeatureFlag(
6
6
  e[FeatureFlag.li.Et],
7
- e[FeatureFlag.li.le],
8
7
  e[FeatureFlag.li.pe],
9
8
  e[FeatureFlag.li.Fe],
9
+ e[FeatureFlag.li.be],
10
10
  );
11
11
  N.info(`Unable to create feature flag from ${JSON.stringify(e, null, 2)}`);
12
12
  }
13
13
  export function newFeatureFlagFromSerializedValue(e) {
14
- if (e[FeatureFlag.qt.Et] && "boolean" == typeof e[FeatureFlag.qt.le])
14
+ if (e[FeatureFlag.qt.Et] && "boolean" == typeof e[FeatureFlag.qt.pe])
15
15
  return new FeatureFlag(
16
16
  e[FeatureFlag.qt.Et],
17
- e[FeatureFlag.qt.le],
18
17
  e[FeatureFlag.qt.pe],
19
18
  e[FeatureFlag.qt.Fe],
19
+ e[FeatureFlag.qt.be],
20
20
  );
21
21
  N.info(
22
22
  `Unable to deserialize feature flag from ${JSON.stringify(e, null, 2)}`,