@braze/web-sdk 5.0.0 → 5.1.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 (158) hide show
  1. package/README.md +1 -1
  2. package/index.d.ts +12 -5
  3. package/package.json +1 -1
  4. package/shared-lib/encoding-utils.js +3 -3
  5. package/shared-lib/event-types.js +29 -29
  6. package/shared-lib/guid.js +3 -3
  7. package/shared-lib/index.js +6 -0
  8. package/shared-lib/indexed-db-adapter.js +70 -70
  9. package/shared-lib/logger.js +18 -18
  10. package/shared-lib/supported-options.js +21 -21
  11. package/src/Card/card-manager.js +43 -45
  12. package/src/Card/display/card-display.js +60 -60
  13. package/src/Card/log-card-click.js +4 -4
  14. package/src/Card/log-card-dismissal.js +2 -3
  15. package/src/Card/log-card-impressions.js +7 -7
  16. package/src/Card/models/captioned-image.js +21 -21
  17. package/src/Card/models/card.js +73 -73
  18. package/src/Card/models/classic-card.js +21 -21
  19. package/src/Card/models/control-card.js +11 -11
  20. package/src/Card/models/image-only.js +19 -19
  21. package/src/Card/util/card-factory.js +68 -68
  22. package/src/ContentCards/content-cards-provider-factory.js +3 -3
  23. package/src/ContentCards/content-cards-provider.js +255 -245
  24. package/src/ContentCards/content-cards.js +2 -2
  25. package/src/ContentCards/get-cached-content-cards.js +1 -1
  26. package/src/ContentCards/request-content-cards-refresh.js +1 -1
  27. package/src/ContentCards/subscribe-to-content-cards-updates.js +6 -6
  28. package/src/ContentCards/ui/hide-content-cards.js +1 -1
  29. package/src/ContentCards/ui/show-content-cards.js +24 -24
  30. package/src/ContentCards/ui/toggle-content-cards.js +1 -1
  31. package/src/Core/add-sdk-metadata.js +21 -19
  32. package/src/Core/change-user.js +10 -10
  33. package/src/Core/destroy.js +2 -2
  34. package/src/Core/disable-sdk.js +11 -11
  35. package/src/Core/enable-sdk.js +7 -7
  36. package/src/Core/get-device-id.js +6 -6
  37. package/src/Core/get-user.js +1 -1
  38. package/src/Core/handle-braze-action.js +41 -41
  39. package/src/Core/is-disabled.js +2 -2
  40. package/src/Core/log-custom-event.js +15 -15
  41. package/src/Core/log-purchase.js +31 -37
  42. package/src/Core/open-session.js +12 -12
  43. package/src/Core/remove-all-subscriptions.js +1 -1
  44. package/src/Core/remove-subscription.js +1 -1
  45. package/src/Core/request-immediate-data-flush.js +1 -1
  46. package/src/Core/set-logger.js +2 -2
  47. package/src/Core/set-sdk-authentication-signature.js +3 -3
  48. package/src/Core/subscribe-to-sdk-authentication-failures.js +6 -4
  49. package/src/Core/toggle-logging.js +2 -2
  50. package/src/Core/wipe-data.js +9 -9
  51. package/src/FeatureFlags/feature-flag-factory.js +12 -12
  52. package/src/FeatureFlags/feature-flag.js +10 -10
  53. package/src/FeatureFlags/feature-flags-provider-factory.js +3 -2
  54. package/src/FeatureFlags/feature-flags-provider.js +108 -80
  55. package/src/FeatureFlags/get-all-feature-flags.js +5 -5
  56. package/src/FeatureFlags/get-feature-flag.js +6 -6
  57. package/src/FeatureFlags/log-feature-flag-impression.js +15 -13
  58. package/src/FeatureFlags/refresh-feature-flags.js +1 -1
  59. package/src/FeatureFlags/subscribe-to-feature-flags-updates.js +7 -4
  60. package/src/Feed/feed-provider-factory.js +2 -2
  61. package/src/Feed/feed-provider.js +44 -44
  62. package/src/Feed/feed.js +1 -1
  63. package/src/Feed/get-cached-feed.js +1 -1
  64. package/src/Feed/log-feed-displayed.js +4 -4
  65. package/src/Feed/request-feed-refresh.js +1 -1
  66. package/src/Feed/subscribe-to-feed-updates.js +1 -1
  67. package/src/Feed/ui/hide-feed.js +1 -1
  68. package/src/Feed/ui/show-feed.js +28 -28
  69. package/src/Feed/ui/toggle-feed.js +1 -1
  70. package/src/InAppMessage/defer-in-app-message.js +5 -5
  71. package/src/InAppMessage/display/html-message-to-html.js +54 -54
  72. package/src/InAppMessage/display/in-app-message-to-html.js +79 -79
  73. package/src/InAppMessage/display/modal-utils.js +8 -8
  74. package/src/InAppMessage/get-deferred-in-app-message.js +1 -1
  75. package/src/InAppMessage/in-app-message-factory.js +49 -49
  76. package/src/InAppMessage/in-app-message-manager-factory.js +1 -1
  77. package/src/InAppMessage/in-app-message-manager.js +143 -138
  78. package/src/InAppMessage/log-in-app-message-button-click.js +12 -12
  79. package/src/InAppMessage/log-in-app-message-click.js +9 -9
  80. package/src/InAppMessage/log-in-app-message-html-click.js +12 -12
  81. package/src/InAppMessage/log-in-app-message-impression.js +6 -6
  82. package/src/InAppMessage/models/full-screen-message.js +33 -33
  83. package/src/InAppMessage/models/html-message.js +20 -20
  84. package/src/InAppMessage/models/in-app-message-button.js +6 -6
  85. package/src/InAppMessage/models/in-app-message.js +99 -99
  86. package/src/InAppMessage/models/modal-message.js +32 -32
  87. package/src/InAppMessage/models/slide-up-message.js +28 -28
  88. package/src/InAppMessage/models/templated-in-app-message.js +8 -8
  89. package/src/InAppMessage/subscribe-to-in-app-message.js +2 -2
  90. package/src/InAppMessage/ui/automatically-show-in-app-messages.js +4 -4
  91. package/src/InAppMessage/ui/show-in-app-message.js +81 -81
  92. package/src/Push/is-push-blocked.js +1 -1
  93. package/src/Push/is-push-permission-granted.js +1 -1
  94. package/src/Push/is-push-supported.js +1 -1
  95. package/src/Push/push-manager-factory.js +5 -5
  96. package/src/Push/push-manager.js +176 -173
  97. package/src/Push/request-push-permission.js +1 -1
  98. package/src/Push/unregister-push.js +1 -1
  99. package/src/Push/utils/push-utils.js +4 -4
  100. package/src/User/user-manager.js +29 -29
  101. package/src/User/user.js +72 -74
  102. package/src/common/base-feed.js +7 -7
  103. package/src/common/base-provider.js +1 -1
  104. package/src/common/constants.js +2 -0
  105. package/src/common/event-logger.js +21 -18
  106. package/src/common/feed-display.js +44 -44
  107. package/src/l10n/l10n-manager-factory.js +3 -3
  108. package/src/l10n/l10n-manager.js +7 -7
  109. package/src/managers/auth-manager.js +32 -32
  110. package/src/managers/braze-instance.js +188 -189
  111. package/src/managers/device-manager.js +28 -28
  112. package/src/managers/network-manager.js +189 -138
  113. package/src/managers/server-config-manager.js +69 -53
  114. package/src/managers/session-manager.js +34 -30
  115. package/src/managers/storage-manager-factory.js +16 -16
  116. package/src/managers/storage-manager.js +210 -188
  117. package/src/managers/subscription-manager.js +12 -12
  118. package/src/models/backend-errors.js +5 -5
  119. package/src/models/braze-event.js +3 -3
  120. package/src/models/device.js +2 -2
  121. package/src/models/identifier.js +34 -14
  122. package/src/models/push-token.js +8 -8
  123. package/src/models/request-result.js +3 -3
  124. package/src/models/server-config.js +32 -23
  125. package/src/request-controller.js +187 -180
  126. package/src/triggers/models/custom-event-data.js +7 -7
  127. package/src/triggers/models/custom-event-property-data.js +10 -10
  128. package/src/triggers/models/filter-set.js +13 -13
  129. package/src/triggers/models/filter.js +45 -45
  130. package/src/triggers/models/in-app-message-click-data.js +12 -12
  131. package/src/triggers/models/purchase-data.js +2 -2
  132. package/src/triggers/models/purchase-property-data.js +10 -10
  133. package/src/triggers/models/push-click-data.js +7 -7
  134. package/src/triggers/models/trigger-condition.js +57 -59
  135. package/src/triggers/models/trigger-events.js +4 -4
  136. package/src/triggers/models/trigger.js +38 -38
  137. package/src/triggers/triggers-provider-factory.js +4 -4
  138. package/src/triggers/triggers-provider.js +127 -130
  139. package/src/ui/js/attach-css.js +2 -2
  140. package/src/ui/js/iam-css.js +1 -1
  141. package/src/ui/js/load-font-awesome.js +1 -1
  142. package/src/util/base-device-parser.js +3 -3
  143. package/src/util/braze-actions.js +35 -35
  144. package/src/util/browser-detector.js +21 -21
  145. package/src/util/client-hints-parser.js +8 -8
  146. package/src/util/code-utils.js +2 -2
  147. package/src/util/component-utils.js +1 -1
  148. package/src/util/deprecation-utils.js +4 -4
  149. package/src/util/device-constants.js +1 -1
  150. package/src/util/dom-utils.js +18 -18
  151. package/src/util/key-codes.js +1 -1
  152. package/src/util/net.js +18 -18
  153. package/src/util/request-header-utils.js +39 -37
  154. package/src/util/string-utils.js +10 -10
  155. package/src/util/user-agent-parser.js +18 -18
  156. package/src/util/validation-utils.js +37 -39
  157. package/src/util/window-utils.js +3 -3
  158. package/shared-lib/braze-shared-lib.js +0 -8
package/README.md CHANGED
@@ -8,5 +8,5 @@ Note: The Braze Web SDK is meant to be used client-side in a web application and
8
8
 
9
9
  See the [Public Github Repo](https://github.com/braze-inc/braze-web-sdk#readme) for getting started instructions or [our documentation pages](https://www.braze.com/docs/developer_guide/platform_integration_guides/web/initial_sdk_setup/) for use-case based documentation.
10
10
 
11
- (c) Braze, Inc. 2023 - http://braze.com
11
+ (c) Braze, Inc. 2024 - http://braze.com
12
12
  License available at https://github.com/braze-inc/braze-web-sdk/blob/master/LICENSE
package/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  /*
2
- * Type definitions for @braze/web-sdk v5.0.0
2
+ * Type definitions for @braze/web-sdk v5.1.0
3
3
  * Project: https://github.com/braze-inc/braze-web-sdk
4
- * (c) Braze, Inc. 2023 - http://braze.com
4
+ * (c) Braze, Inc. 2024 - http://braze.com
5
5
  * License available at https://github.com/braze-inc/braze-web-sdk/blob/master/LICENSE
6
6
  */
7
7
 
@@ -1549,7 +1549,12 @@ export class FeatureFlag {
1549
1549
  /** Indicates whether or not this feature flag is enabled. */
1550
1550
  enabled: boolean;
1551
1551
 
1552
- /** Properties of this feature flag, listed as key-value pairs. */
1552
+ /**
1553
+ * Properties of this feature flag.
1554
+ *
1555
+ * Avoid accessing these properties directly. Instead, prefer using the `getStringProperty`, `getBooleanProperty`, `getNumberProperty` methods which ensure type safety,
1556
+ * and to avoid breaking changes in the future.
1557
+ */
1553
1558
  properties: Partial<
1554
1559
  Record<
1555
1560
  string,
@@ -2083,7 +2088,7 @@ export function openSession(): void;
2083
2088
  * - Create a `service-worker.js` file with the content below and place it in the root directory of your website:
2084
2089
  *
2085
2090
  * ```
2086
- * self.importScripts('https://js.appboycdn.com/web-sdk-develop/5.0/service-worker.js');
2091
+ * self.importScripts('https://js.appboycdn.com/web-sdk-develop/5.1/service-worker.js');
2087
2092
  * ```
2088
2093
  *
2089
2094
  * For more details, see [Our Product Documentation](https://www.braze.com/docs/developer_guide/platform_integration_guides/web/push_notifications/integration).
@@ -2389,6 +2394,8 @@ export type InitializationOptions = {
2389
2394
  /**
2390
2395
  * A numerical app version value which can be used for user segmentation. This value must be sent with four fields, such as
2391
2396
  * "1.2.3.4", otherwise it will be ignored.
2397
+ *
2398
+ * Note: `appVersion` must also be set, either with the same value or a unique name for this version.
2392
2399
  */
2393
2400
  appVersionNumber?: string;
2394
2401
  /**
@@ -2456,7 +2463,7 @@ export type InitializationOptions = {
2456
2463
  * lifecycle of, set this option to true and the Braze SDK will not register or unregister a service worker. If you set this
2457
2464
  * option to true, in order for push to function correctly you must register the service worker yourself BEFORE calling
2458
2465
  * `requestPushPermission`, and ensure that it contains Braze's service worker code, either with
2459
- * `self.importScripts('https://js.appboycdn.com/web-sdk-develop/5.0/service-worker.js');` or by including the content
2466
+ * `self.importScripts('https://js.appboycdn.com/web-sdk-develop/5.1/service-worker.js');` or by including the content
2460
2467
  * of that file directly. When this option is true, the `serviceWorkerLocation` option is irrelevant and is ignored.
2461
2468
  */
2462
2469
  manageServiceWorkerExternally?: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@braze/web-sdk",
3
- "version": "5.0.0",
3
+ "version": "5.1.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
- const ve = {
2
- Fn: function (t) {
1
+ const ei = {
2
+ qn: function (t) {
3
3
  const r = (t + "=".repeat((4 - (t.length % 4)) % 4))
4
4
  .replace(/\-/g, "+")
5
5
  .replace(/_/g, "/"),
@@ -9,4 +9,4 @@ const ve = {
9
9
  return o;
10
10
  },
11
11
  };
12
- export default ve;
12
+ export default ei;
@@ -1,34 +1,34 @@
1
- const De = {
1
+ const i = {
2
2
  CustomEvent: "ce",
3
3
  Pr: "p",
4
- Mu: "pc",
5
- cc: "ca",
6
- Ka: "i",
7
- qs: "ie",
8
- P: "cci",
9
- T: "ccic",
10
- $: "ccc",
11
- H: "ccd",
12
- Wl: "ss",
4
+ Iu: "pc",
5
+ vc: "ca",
6
+ Za: "i",
7
+ Ms: "ie",
8
+ M: "cci",
9
+ R: "ccic",
10
+ I: "ccc",
11
+ F: "ccd",
12
+ kl: "ss",
13
13
  xl: "se",
14
- Vi: "si",
15
- Li: "sc",
16
- Qi: "sbc",
17
- Ki: "sfe",
18
- eo: "iec",
19
- Lu: "lr",
20
- Tu: "uae",
21
- R: "ci",
22
- B: "cc",
23
- Ru: "lcaa",
24
- Pu: "lcar",
25
- Xn: "inc",
26
- Jn: "add",
27
- Qn: "rem",
28
- Hn: "set",
29
- Kn: "ncam",
30
- Nu: "sgu",
14
+ Ze: "si",
15
+ Xe: "sc",
16
+ Ye: "sbc",
17
+ We: "sfe",
18
+ fo: "iec",
19
+ xu: "lr",
20
+ Pu: "uae",
21
+ O: "ci",
22
+ $: "cc",
23
+ Uu: "lcaa",
24
+ Ou: "lcar",
25
+ Hn: "inc",
26
+ On: "add",
27
+ Gn: "rem",
28
+ Ln: "set",
29
+ Rn: "ncam",
30
+ _u: "sgu",
31
31
  Fr: "ffi",
32
32
  },
33
- Be = { Br: "feed_displayed", dc: "content_cards_displayed" };
34
- export { De as EventTypes, Be as InternalEventTypes };
33
+ or = { Br: "feed_displayed", Cc: "content_cards_displayed" };
34
+ export { i as EventTypes, or as InternalEventTypes };
@@ -1,5 +1,5 @@
1
- const Ge = {
2
- Y: function () {
1
+ const p = {
2
+ W: function () {
3
3
  const t = (t = !1) => {
4
4
  const n = (Math.random().toString(16) + "000000000").substr(2, 8);
5
5
  return t ? "-" + n.substr(0, 4) + "-" + n.substr(4, 4) : n;
@@ -7,4 +7,4 @@ const Ge = {
7
7
  return t() + t(!0) + t(!0) + t();
8
8
  },
9
9
  };
10
- export default Ge;
10
+ export default p;
@@ -0,0 +1,6 @@
1
+ export { default as logger } from "./logger.js";
2
+ export { default as EncodingUtils } from "./encoding-utils.js";
3
+ export { EventTypes, InternalEventTypes } from "./event-types.js";
4
+ export { default as Guid } from "./guid.js";
5
+ export { default as IndexedDBAdapter } from "./indexed-db-adapter.js";
6
+ export { default as SupportedOptions } from "./supported-options.js";
@@ -1,21 +1,21 @@
1
- export default class Oe {
1
+ export default class A {
2
2
  constructor(t, e) {
3
3
  (this.database = t),
4
- (this.j = e),
4
+ (this.dd = e),
5
5
  (this.parent = "undefined" == typeof window ? self : window),
6
6
  (this.database = t),
7
- (this.j = e);
7
+ (this.dd = e);
8
8
  }
9
- td() {
9
+ fd() {
10
10
  if ("indexedDB" in this.parent) return this.parent.indexedDB;
11
11
  }
12
12
  isSupported() {
13
13
  var t;
14
14
  try {
15
- if (null == this.td()) return !1;
15
+ if (null == this.fd()) return !1;
16
16
  {
17
17
  const e =
18
- null === (t = this.td()) || void 0 === t
18
+ null === (t = this.fd()) || void 0 === t
19
19
  ? void 0
20
20
  : t.open("Braze IndexedDB Support Test");
21
21
  if (
@@ -25,10 +25,10 @@ export default class Oe {
25
25
  "undefined" != typeof window)
26
26
  ) {
27
27
  const t = window,
28
- e = t.chrome || t.browser || t.ed;
28
+ e = t.chrome || t.browser || t.ad;
29
29
  if (e && e.runtime && e.runtime.id)
30
30
  return (
31
- this.j.info(
31
+ this.dd.info(
32
32
  "Not using IndexedDB for storage because we are running inside an extension",
33
33
  ),
34
34
  !1
@@ -38,37 +38,37 @@ export default class Oe {
38
38
  }
39
39
  } catch (t) {
40
40
  return (
41
- this.j.info(
41
+ this.dd.info(
42
42
  "Not using IndexedDB for storage due to following error: " + t,
43
43
  ),
44
44
  !1
45
45
  );
46
46
  }
47
47
  }
48
- nd(t, e) {
48
+ vd(t, e) {
49
49
  var n;
50
50
  const o =
51
- null === (n = this.td()) || void 0 === n
51
+ null === (n = this.fd()) || void 0 === n
52
52
  ? void 0
53
- : n.open(this.database.od, this.database.VERSION);
53
+ : n.open(this.database.Dd, this.database.VERSION);
54
54
  if (null == o) return "function" == typeof e && e(), !1;
55
55
  const i = this;
56
56
  return (
57
57
  (o.onupgradeneeded = (t) => {
58
58
  var e;
59
- i.j.info(
59
+ i.dd.info(
60
60
  "Upgrading indexedDB " +
61
- i.database.od +
61
+ i.database.Dd +
62
62
  " to v" +
63
63
  i.database.VERSION +
64
64
  "...",
65
65
  );
66
66
  const n = null === (e = t.target) || void 0 === e ? void 0 : e.result;
67
- for (const t in i.database.rs) {
67
+ for (const t in i.database.ss) {
68
68
  const e = t;
69
- i.database.rs.hasOwnProperty(t) &&
70
- !n.objectStoreNames.contains(i.database.rs[e]) &&
71
- n.createObjectStore(i.database.rs[e]);
69
+ i.database.ss.hasOwnProperty(t) &&
70
+ !n.objectStoreNames.contains(i.database.ss[e]) &&
71
+ n.createObjectStore(i.database.ss[e]);
72
72
  }
73
73
  }),
74
74
  (o.onsuccess = (n) => {
@@ -77,7 +77,7 @@ export default class Oe {
77
77
  (r.onversionchange = () => {
78
78
  r.close(),
79
79
  "function" == typeof e && e(),
80
- i.j.error(
80
+ i.dd.error(
81
81
  "Needed to close the database unexpectedly because of an upgrade in another tab",
82
82
  );
83
83
  }),
@@ -87,9 +87,9 @@ export default class Oe {
87
87
  var n;
88
88
  const o = t;
89
89
  return (
90
- i.j.info(
90
+ i.dd.info(
91
91
  "Could not open indexedDB " +
92
- i.database.od +
92
+ i.database.Dd +
93
93
  " v" +
94
94
  i.database.VERSION +
95
95
  ": " +
@@ -105,16 +105,16 @@ export default class Oe {
105
105
  setItem(t, e, n, o, i) {
106
106
  if (!this.isSupported()) return "function" == typeof i && i(), !1;
107
107
  const r = this;
108
- return this.nd((d) => {
108
+ return this.vd((d) => {
109
109
  if (!d.objectStoreNames.contains(t))
110
110
  return (
111
- r.j.error(
111
+ r.dd.error(
112
112
  "Could not store object " +
113
113
  e +
114
114
  " in " +
115
115
  t +
116
116
  " on indexedDB " +
117
- r.database.od +
117
+ r.database.Dd +
118
118
  " - " +
119
119
  t +
120
120
  " is not a valid objectStore",
@@ -126,13 +126,13 @@ export default class Oe {
126
126
  s.oncomplete = () => d.close();
127
127
  const u = s.objectStore(t).put(n, e);
128
128
  (u.onerror = () => {
129
- r.j.error(
129
+ r.dd.error(
130
130
  "Could not store object " +
131
131
  e +
132
132
  " in " +
133
133
  t +
134
134
  " on indexedDB " +
135
- r.database.od,
135
+ r.database.Dd,
136
136
  ),
137
137
  "function" == typeof i && i();
138
138
  }),
@@ -144,16 +144,16 @@ export default class Oe {
144
144
  getItem(t, e, n) {
145
145
  if (!this.isSupported()) return !1;
146
146
  const o = this;
147
- return this.nd((i) => {
147
+ return this.vd((i) => {
148
148
  if (!i.objectStoreNames.contains(t))
149
149
  return (
150
- o.j.error(
150
+ o.dd.error(
151
151
  "Could not retrieve object " +
152
152
  e +
153
153
  " in " +
154
154
  t +
155
155
  " on indexedDB " +
156
- o.database.od +
156
+ o.database.Dd +
157
157
  " - " +
158
158
  t +
159
159
  " is not a valid objectStore",
@@ -164,13 +164,13 @@ export default class Oe {
164
164
  r.oncomplete = () => i.close();
165
165
  const d = r.objectStore(t).get(e);
166
166
  (d.onerror = () => {
167
- o.j.error(
167
+ o.dd.error(
168
168
  "Could not retrieve object " +
169
169
  e +
170
170
  " in " +
171
171
  t +
172
172
  " on indexedDB " +
173
- o.database.od,
173
+ o.database.Dd,
174
174
  );
175
175
  }),
176
176
  (d.onsuccess = (t) => {
@@ -180,17 +180,17 @@ export default class Oe {
180
180
  });
181
181
  });
182
182
  }
183
- hr(t, e, n) {
183
+ jr(t, e, n) {
184
184
  if (!this.isSupported()) return "function" == typeof n && n(), !1;
185
185
  const o = this;
186
- return this.nd((i) => {
186
+ return this.vd((i) => {
187
187
  if (!i.objectStoreNames.contains(t))
188
188
  return (
189
- o.j.error(
189
+ o.dd.error(
190
190
  "Could not retrieve last record from " +
191
191
  t +
192
192
  " on indexedDB " +
193
- o.database.od +
193
+ o.database.Dd +
194
194
  " - " +
195
195
  t +
196
196
  " is not a valid objectStore",
@@ -202,8 +202,8 @@ export default class Oe {
202
202
  r.oncomplete = () => i.close();
203
203
  const d = r.objectStore(t).openCursor(null, "prev");
204
204
  (d.onerror = () => {
205
- o.j.error(
206
- "Could not open cursor for " + t + " on indexedDB " + o.database.od,
205
+ o.dd.error(
206
+ "Could not open cursor for " + t + " on indexedDB " + o.database.Dd,
207
207
  ),
208
208
  "function" == typeof n && n();
209
209
  }),
@@ -216,19 +216,19 @@ export default class Oe {
216
216
  });
217
217
  }, n);
218
218
  }
219
- oe(t, e) {
219
+ re(t, e) {
220
220
  if (!this.isSupported()) return !1;
221
221
  const n = this;
222
- return this.nd((o) => {
222
+ return this.vd((o) => {
223
223
  if (!o.objectStoreNames.contains(t))
224
224
  return (
225
- n.j.error(
225
+ n.dd.error(
226
226
  "Could not delete record " +
227
227
  e +
228
228
  " from " +
229
229
  t +
230
230
  " on indexedDB " +
231
- n.database.od +
231
+ n.database.Dd +
232
232
  " - " +
233
233
  t +
234
234
  " is not a valid objectStore",
@@ -238,28 +238,28 @@ export default class Oe {
238
238
  const i = o.transaction([t], "readwrite");
239
239
  i.oncomplete = () => o.close();
240
240
  i.objectStore(t).delete(e).onerror = () => {
241
- n.j.error(
241
+ n.dd.error(
242
242
  "Could not delete record " +
243
243
  e +
244
244
  " from " +
245
245
  t +
246
246
  " on indexedDB " +
247
- n.database.od,
247
+ n.database.Dd,
248
248
  );
249
249
  };
250
250
  });
251
251
  }
252
- ss(t, e) {
252
+ Zt(t, e) {
253
253
  if (!this.isSupported()) return !1;
254
254
  const n = this;
255
- return this.nd((o) => {
255
+ return this.vd((o) => {
256
256
  if (!o.objectStoreNames.contains(t))
257
257
  return (
258
- n.j.error(
258
+ n.dd.error(
259
259
  "Could not retrieve objects from " +
260
260
  t +
261
261
  " on indexedDB " +
262
- n.database.od +
262
+ n.database.Dd +
263
263
  " - " +
264
264
  t +
265
265
  " is not a valid objectStore",
@@ -273,18 +273,18 @@ export default class Oe {
273
273
  s = [];
274
274
  (d.onerror = () => {
275
275
  s.length > 0
276
- ? (n.j.info(
276
+ ? (n.dd.info(
277
277
  "Cursor closed midway through for " +
278
278
  t +
279
279
  " on indexedDB " +
280
- n.database.od,
280
+ n.database.Dd,
281
281
  ),
282
282
  e(s))
283
- : n.j.error(
283
+ : n.dd.error(
284
284
  "Could not open cursor for " +
285
285
  t +
286
286
  " on indexedDB " +
287
- n.database.od,
287
+ n.database.Dd,
288
288
  );
289
289
  }),
290
290
  (d.onsuccess = (t) => {
@@ -304,48 +304,48 @@ export default class Oe {
304
304
  clearData() {
305
305
  if (!this.isSupported()) return !1;
306
306
  const t = [];
307
- for (const e in this.database.rs) {
307
+ for (const e in this.database.ss) {
308
308
  const n = e;
309
- this.database.rs.hasOwnProperty(e) &&
310
- this.database.rs[n] !== this.database.rs.se &&
311
- t.push(this.database.rs[n]);
309
+ this.database.ss.hasOwnProperty(e) &&
310
+ this.database.ss[n] !== this.database.ss.ae &&
311
+ t.push(this.database.ss[n]);
312
312
  }
313
313
  const e = this;
314
- return this.nd(function (n) {
314
+ return this.vd(function (n) {
315
315
  const o = n.transaction(t, "readwrite");
316
316
  o.oncomplete = () => n.close();
317
317
  for (let n = 0; n < t.length; n++) {
318
318
  const i = t[n];
319
319
  o.objectStore(i).clear().onerror = function () {
320
- e.j.error(
320
+ e.dd.error(
321
321
  "Could not clear " +
322
322
  this.source.name +
323
323
  " on indexedDB " +
324
- e.database.od,
324
+ e.database.Dd,
325
325
  );
326
326
  };
327
327
  }
328
328
  o.onerror = function () {
329
- e.j.error(
330
- "Could not clear object stores on indexedDB " + e.database.od,
329
+ e.dd.error(
330
+ "Could not clear object stores on indexedDB " + e.database.Dd,
331
331
  );
332
332
  };
333
333
  });
334
334
  }
335
335
  }
336
- Oe.ep = {
337
- Zt: {
338
- od: "AppboyServiceWorkerAsyncStorage",
336
+ A.Yt = {
337
+ Qt: {
338
+ Dd: "AppboyServiceWorkerAsyncStorage",
339
339
  VERSION: 6,
340
- rs: {
341
- Na: "data",
342
- kr: "pushClicks",
340
+ ss: {
341
+ Qa: "data",
342
+ hr: "pushClicks",
343
343
  cu: "pushSubscribed",
344
- dd: "fallbackDevice",
345
- hs: "cardUpdates",
346
- se: "optOut",
344
+ pd: "fallbackDevice",
345
+ ts: "cardUpdates",
346
+ ae: "optOut",
347
347
  wr: "pendingData",
348
- qh: "sdkAuthenticationSignature",
348
+ xh: "sdkAuthenticationSignature",
349
349
  },
350
350
  ie: 1,
351
351
  },
@@ -1,38 +1,38 @@
1
- const Ue = {
1
+ const r = {
2
2
  init: function (n) {
3
- (void 0 === n && void 0 !== Ue.zg) || (Ue.zg = !!n), Ue.t || (Ue.t = !0);
3
+ (void 0 === n && void 0 !== r.zg) || (r.zg = !!n), r.t || (r.t = !0);
4
4
  },
5
5
  destroy: function () {
6
- (Ue.t = !1), (Ue.zg = void 0), (Ue.j = void 0);
6
+ (r.t = !1), (r.zg = void 0), (r.dd = void 0);
7
7
  },
8
8
  setLogger: function (n) {
9
9
  "function" == typeof n
10
- ? (Ue.init(), (Ue.j = n))
11
- : Ue.info("Ignoring setLogger call since logger is not a function");
10
+ ? (r.init(), (r.dd = n))
11
+ : r.info("Ignoring setLogger call since logger is not a function");
12
12
  },
13
13
  toggleLogging: function () {
14
- Ue.init(),
15
- Ue.zg
16
- ? (console.log("Disabling Braze logging"), (Ue.zg = !1))
17
- : (console.log("Enabled Braze logging"), (Ue.zg = !0));
14
+ r.init(),
15
+ r.zg
16
+ ? (console.log("Disabling Braze logging"), (r.zg = !1))
17
+ : (console.log("Enabled Braze logging"), (r.zg = !0));
18
18
  },
19
19
  info: function (n) {
20
- if (Ue.zg) {
20
+ if (r.zg) {
21
21
  const o = "Braze: " + n;
22
- null != Ue.j ? Ue.j(o) : console.log(o);
22
+ null != r.dd ? r.dd(o) : console.log(o);
23
23
  }
24
24
  },
25
25
  warn: function (n) {
26
- if (Ue.zg) {
27
- const o = "Braze SDK Warning: " + n + " (v5.0.0)";
28
- null != Ue.j ? Ue.j(o) : console.warn(o);
26
+ if (r.zg) {
27
+ const o = "Braze SDK Warning: " + n + " (v5.1.0)";
28
+ null != r.dd ? r.dd(o) : console.warn(o);
29
29
  }
30
30
  },
31
31
  error: function (n) {
32
- if (Ue.zg) {
33
- const o = "Braze SDK Error: " + n + " (v5.0.0)";
34
- null != Ue.j ? Ue.j(o) : console.error(o);
32
+ if (r.zg) {
33
+ const o = "Braze SDK Error: " + n + " (v5.1.0)";
34
+ null != r.dd ? r.dd(o) : console.error(o);
35
35
  }
36
36
  },
37
37
  };
38
- export default Ue;
38
+ export default r;
@@ -1,26 +1,26 @@
1
1
  export default {
2
- ho: "allowCrawlerActivity",
3
- _o: "baseUrl",
4
- Eo: "noCookies",
5
- Io: "devicePropertyAllowlist",
6
- Aa: "disablePushTokenMaintenance",
7
- Ao: "enableLogging",
8
- So: "enableSdkAuthentication",
9
- qa: "manageServiceWorkerExternally",
10
- No: "minimumIntervalBetweenTriggerActionsInSeconds",
11
- Oo: "sessionTimeoutInSeconds",
12
- wo: "appVersion",
13
- Po: "appVersionNumber",
14
- _a: "serviceWorkerLocation",
15
- ka: "safariWebsitePushId",
16
- Ba: "localization",
17
- po: "contentSecurityNonce",
18
- Ro: "allowUserSuppliedJavascript",
19
- lo: "inAppMessageZIndex",
20
- fo: "openInAppMessagesInNewTab",
2
+ _o: "allowCrawlerActivity",
3
+ Io: "baseUrl",
4
+ Ao: "noCookies",
5
+ So: "devicePropertyAllowlist",
6
+ qa: "disablePushTokenMaintenance",
7
+ No: "enableLogging",
8
+ Oo: "enableSdkAuthentication",
9
+ ka: "manageServiceWorkerExternally",
10
+ Po: "minimumIntervalBetweenTriggerActionsInSeconds",
11
+ Ro: "sessionTimeoutInSeconds",
12
+ Lo: "appVersion",
13
+ Do: "appVersionNumber",
14
+ Ma: "serviceWorkerLocation",
15
+ _a: "safariWebsitePushId",
16
+ Xn: "localization",
17
+ wo: "contentSecurityNonce",
18
+ Mo: "allowUserSuppliedJavascript",
19
+ ho: "inAppMessageZIndex",
20
+ yo: "openInAppMessagesInNewTab",
21
21
  en: "openNewsFeedCardsInNewTab",
22
22
  mh: "requireExplicitInAppMessageDismissal",
23
- Co: "doNotLoadFontAwesome",
24
- Lo: "sdkFlavor",
23
+ Uo: "doNotLoadFontAwesome",
24
+ Bo: "sdkFlavor",
25
25
  tn: "openCardsInNewTab",
26
26
  };