@braze/web-sdk 4.7.2 → 4.8.1

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 (164) hide show
  1. package/index.d.ts +32 -26
  2. package/package.json +1 -1
  3. package/shared-lib/braze-shared-lib.js +5 -5
  4. package/shared-lib/encoding-utils.js +1 -1
  5. package/shared-lib/event-types.js +25 -25
  6. package/shared-lib/guid.js +3 -3
  7. package/shared-lib/indexed-db-adapter.js +74 -74
  8. package/shared-lib/logger.js +18 -18
  9. package/shared-lib/supported-options.js +18 -18
  10. package/src/Card/card-manager-factory.js +2 -2
  11. package/src/Card/card-manager.js +48 -42
  12. package/src/Card/display/card-display.js +70 -67
  13. package/src/Card/log-card-click.js +1 -1
  14. package/src/Card/log-card-dismissal.js +1 -1
  15. package/src/Card/log-card-impressions.js +3 -3
  16. package/src/Card/models/banner.js +3 -2
  17. package/src/Card/models/captioned-image.js +6 -5
  18. package/src/Card/models/card.js +107 -87
  19. package/src/Card/models/classic-card.js +5 -5
  20. package/src/Card/models/control-card.js +5 -21
  21. package/src/Card/types.js +1 -0
  22. package/src/Card/util/card-factory.js +32 -32
  23. package/src/ContentCards/content-cards-provider-factory.js +3 -3
  24. package/src/ContentCards/content-cards-provider.js +283 -175
  25. package/src/ContentCards/content-cards.js +2 -2
  26. package/src/ContentCards/get-cached-content-cards.js +1 -1
  27. package/src/ContentCards/log-content-cards-displayed.js +2 -2
  28. package/src/ContentCards/request-content-cards-refresh.js +1 -1
  29. package/src/ContentCards/subscribe-to-content-cards-updates.js +9 -6
  30. package/src/ContentCards/types.js +1 -0
  31. package/src/ContentCards/ui/hide-content-cards.js +2 -2
  32. package/src/ContentCards/ui/show-content-cards.js +36 -34
  33. package/src/Core/add-sdk-metadata.js +17 -18
  34. package/src/Core/change-user.js +12 -14
  35. package/src/Core/destroy.js +1 -1
  36. package/src/Core/disable-sdk.js +8 -6
  37. package/src/Core/enable-sdk.js +4 -4
  38. package/src/Core/get-device-id.js +7 -6
  39. package/src/Core/get-user.js +1 -1
  40. package/src/Core/handle-braze-action.js +57 -40
  41. package/src/Core/is-disabled.js +2 -2
  42. package/src/Core/log-custom-event.js +22 -15
  43. package/src/Core/log-purchase.js +33 -33
  44. package/src/Core/open-session.js +17 -15
  45. package/src/Core/request-immediate-data-flush.js +4 -2
  46. package/src/Core/set-logger.js +1 -1
  47. package/src/Core/set-sdk-authentication-signature.js +5 -6
  48. package/src/Core/subscribe-to-sdk-authentication-failures.js +3 -1
  49. package/src/Core/toggle-logging.js +1 -1
  50. package/src/Core/types.js +1 -0
  51. package/src/Core/wipe-data.js +11 -10
  52. package/src/FeatureFlags/feature-flag-factory.js +6 -6
  53. package/src/FeatureFlags/feature-flag.js +17 -17
  54. package/src/FeatureFlags/feature-flags-provider-factory.js +2 -2
  55. package/src/FeatureFlags/feature-flags-provider.js +67 -65
  56. package/src/FeatureFlags/get-all-feature-flags.js +3 -3
  57. package/src/FeatureFlags/get-feature-flag.js +4 -4
  58. package/src/FeatureFlags/subscribe-to-feature-flags-updates.js +4 -1
  59. package/src/Feed/feed-provider-factory.js +8 -8
  60. package/src/Feed/feed-provider.js +57 -46
  61. package/src/Feed/feed.js +1 -1
  62. package/src/Feed/get-cached-feed.js +2 -2
  63. package/src/Feed/log-feed-displayed.js +3 -1
  64. package/src/Feed/request-feed-refresh.js +2 -2
  65. package/src/Feed/subscribe-to-feed-updates.js +2 -2
  66. package/src/Feed/types.js +1 -0
  67. package/src/Feed/ui/hide-feed.js +2 -2
  68. package/src/Feed/ui/show-feed.js +41 -37
  69. package/src/InAppMessage/display/html-message-to-html.js +125 -119
  70. package/src/InAppMessage/display/in-app-message-to-html.js +72 -69
  71. package/src/InAppMessage/display/modal-utils.js +18 -13
  72. package/src/InAppMessage/in-app-message-factory.js +9 -8
  73. package/src/InAppMessage/in-app-message-manager-factory.js +7 -7
  74. package/src/InAppMessage/in-app-message-manager.js +130 -110
  75. package/src/InAppMessage/log-in-app-message-button-click.js +10 -10
  76. package/src/InAppMessage/log-in-app-message-click.js +9 -9
  77. package/src/InAppMessage/log-in-app-message-html-click.js +10 -10
  78. package/src/InAppMessage/log-in-app-message-impression.js +5 -5
  79. package/src/InAppMessage/models/control-message.js +4 -1
  80. package/src/InAppMessage/models/full-screen-message.js +35 -37
  81. package/src/InAppMessage/models/html-message.js +34 -33
  82. package/src/InAppMessage/models/in-app-message-button.js +23 -16
  83. package/src/InAppMessage/models/in-app-message.js +147 -105
  84. package/src/InAppMessage/models/modal-message.js +34 -36
  85. package/src/InAppMessage/models/slide-up-message.js +25 -27
  86. package/src/InAppMessage/models/templated-in-app-message.js +12 -7
  87. package/src/InAppMessage/subscribe-to-in-app-message.js +2 -2
  88. package/src/InAppMessage/types.js +1 -0
  89. package/src/InAppMessage/ui/automatically-show-in-app-messages.js +4 -4
  90. package/src/InAppMessage/ui/show-in-app-message.js +95 -89
  91. package/src/InAppMessage/utils/in-app-message-utils.js +1 -0
  92. package/src/Push/is-push-blocked.js +2 -2
  93. package/src/Push/is-push-permission-granted.js +2 -2
  94. package/src/Push/is-push-supported.js +2 -2
  95. package/src/Push/push-manager-factory.js +20 -20
  96. package/src/Push/push-manager.js +193 -174
  97. package/src/Push/request-push-permission.js +4 -3
  98. package/src/Push/types.js +1 -0
  99. package/src/Push/unregister-push.js +2 -2
  100. package/src/Push/utils/push-utils.js +10 -10
  101. package/src/User/types.js +1 -0
  102. package/src/User/user-manager.js +24 -24
  103. package/src/User/user.js +117 -105
  104. package/src/common/base-feed.js +7 -7
  105. package/src/common/base-provider.js +2 -2
  106. package/src/common/constants.js +6 -0
  107. package/src/common/event-logger.js +6 -6
  108. package/src/common/feed-display.js +95 -85
  109. package/src/common/types.js +1 -0
  110. package/src/l10n/l10n-manager-factory.js +10 -10
  111. package/src/l10n/l10n-manager.js +1 -1
  112. package/src/managers/auth-manager.js +37 -34
  113. package/src/managers/braze-instance.js +209 -193
  114. package/src/managers/device-manager.js +43 -38
  115. package/src/managers/network-manager.js +119 -96
  116. package/src/managers/server-config-manager.js +68 -48
  117. package/src/managers/session-manager.js +52 -45
  118. package/src/managers/storage-manager-factory.js +29 -22
  119. package/src/managers/storage-manager.js +288 -273
  120. package/src/managers/subscription-manager.js +9 -6
  121. package/src/managers/types.js +1 -0
  122. package/src/models/backend-errors.js +5 -5
  123. package/src/models/braze-event.js +14 -8
  124. package/src/models/device.js +10 -18
  125. package/src/models/identifier.js +10 -11
  126. package/src/models/push-token.js +17 -12
  127. package/src/models/request-result.js +4 -4
  128. package/src/models/server-config.js +36 -20
  129. package/src/models/types.js +1 -0
  130. package/src/request-controller.js +176 -174
  131. package/src/triggers/models/custom-event-data.js +6 -6
  132. package/src/triggers/models/custom-event-property-data.js +9 -9
  133. package/src/triggers/models/filter-set.js +9 -9
  134. package/src/triggers/models/filter.js +64 -64
  135. package/src/triggers/models/in-app-message-click-data.js +12 -12
  136. package/src/triggers/models/purchase-data.js +3 -3
  137. package/src/triggers/models/purchase-property-data.js +9 -9
  138. package/src/triggers/models/push-click-data.js +7 -7
  139. package/src/triggers/models/trigger-condition.js +57 -57
  140. package/src/triggers/models/trigger-events.js +2 -2
  141. package/src/triggers/models/trigger.js +42 -42
  142. package/src/triggers/triggers-provider-factory.js +8 -8
  143. package/src/triggers/triggers-provider.js +173 -170
  144. package/src/types.js +1 -0
  145. package/src/ui/js/attach-css.js +3 -3
  146. package/src/ui/js/load-font-awesome.js +2 -2
  147. package/src/util/base-device-parser.js +2 -2
  148. package/src/util/braze-actions.js +20 -20
  149. package/src/util/browser-detector.js +22 -22
  150. package/src/util/client-hints-parser.js +7 -7
  151. package/src/util/code-utils.js +1 -1
  152. package/src/util/color-utils.js +2 -2
  153. package/src/util/component-utils.js +2 -2
  154. package/src/util/deprecation-utils.js +1 -1
  155. package/src/util/device-constants.js +3 -3
  156. package/src/util/dom-utils.js +7 -7
  157. package/src/util/error-utils.js +2 -0
  158. package/src/util/key-codes.js +1 -1
  159. package/src/util/net.js +11 -11
  160. package/src/util/request-header-utils.js +23 -0
  161. package/src/util/string-utils.js +1 -1
  162. package/src/util/user-agent-parser.js +21 -21
  163. package/src/util/validation-utils.js +44 -44
  164. package/src/util/window-utils.js +3 -3
package/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Type definitions for @braze/web-sdk v4.7.2
2
+ * Type definitions for @braze/web-sdk v4.8.1
3
3
  * Project: https://github.com/braze-inc/braze-web-sdk
4
4
  * (c) Braze, Inc. 2023 - http://braze.com
5
5
  * License available at https://github.com/braze-inc/braze-web-sdk/blob/master/LICENSE
@@ -88,9 +88,9 @@
88
88
  * no arguments when this card records a click.
89
89
  *
90
90
  * @returns The identifier of the subscription created. This can be passed to `Card.removeSubscription`
91
- * to cancel the subscription.
91
+ * to cancel the subscription. Returns null if the subscriber passed is not a function.
92
92
  */
93
- subscribeToClickedEvent(subscriber: () => void): string;
93
+ subscribeToClickedEvent(subscriber: () => void): string | null;
94
94
 
95
95
  /**
96
96
  * Subscribe to receive dismissed events. The subscriber callback will be called whenever this card is dismissed by the
@@ -100,9 +100,9 @@
100
100
  * no arguments when this card records a dismissal.
101
101
  *
102
102
  * @returns The identifier of the subscription created. This can be passed to `Card.removeSubscription`
103
- * to cancel the subscription.
103
+ * to cancel the subscription. Returns null if the subscriber passed is not a function.
104
104
  */
105
- subscribeToDismissedEvent(subscriber: () => void): string;
105
+ subscribeToDismissedEvent(subscriber: () => void): string | null;
106
106
 
107
107
  /** The id of the card. This will be reported back to Braze with events for analytics purposes. */
108
108
  id?: string;
@@ -390,6 +390,9 @@
390
390
  extras?: Record<string, string>,
391
391
  pinned?: boolean
392
392
  );
393
+
394
+ /** Whether this card is a ControlCard. */
395
+ isControl: true;
393
396
  }
394
397
 
395
398
  export class ContentCards {
@@ -473,10 +476,10 @@
473
476
  triggerId?: string;
474
477
 
475
478
  /** Object of string/string key/value pairs. */
476
- extras: Record<string, any>;
479
+ extras: Record<string, string>;
477
480
 
478
481
  /** Whether this message is a ControlMessage. */
479
- isControl: boolean;
482
+ isControl: true;
480
483
  }
481
484
 
482
485
 
@@ -562,7 +565,7 @@
562
565
  message?: string;
563
566
 
564
567
  /** Object of string/string key/value pairs. */
565
- extras: Record<string, any>;
568
+ extras: Record<string, string>;
566
569
 
567
570
  /**
568
571
  * The id of the trigger that created this message. The SDK will report back this to
@@ -598,7 +601,7 @@
598
601
  css?: string;
599
602
 
600
603
  /** Whether this message is a ControlMessage. */
601
- isControl: boolean;
604
+ isControl: false;
602
605
 
603
606
  /**
604
607
  * Call this method if you wish to programmatically remove the message from the DOM. This method will only
@@ -625,9 +628,9 @@
625
628
  * no arguments when this message records a click.
626
629
  *
627
630
  * @returns The identifier of the subscription created. This can be passed to `removeSubscription`
628
- * to cancel the subscription.
631
+ * to cancel the subscription. Returns null if the subscriber passed is not a function.
629
632
  */
630
- subscribeToClickedEvent(subscriber: () => void): string;
633
+ subscribeToClickedEvent(subscriber: () => void): string | null;
631
634
 
632
635
  /**
633
636
  * Subscribe to receive dismissed events. The subscriber callback will be called whenever this message is closed
@@ -637,9 +640,9 @@
637
640
  * no arguments when this message records a dismissal.
638
641
  *
639
642
  * @returns The identifier of the subscription created. This can be passed to `removeSubscription`
640
- * to cancel the subscription.
643
+ * to cancel the subscription. Returns null if the subscriber passed is not a function.
641
644
  */
642
- subscribeToDismissedEvent(subscriber: () => void): string;
645
+ subscribeToDismissedEvent(subscriber: () => void): string | null;
643
646
 
644
647
 
645
648
  }
@@ -698,7 +701,7 @@
698
701
  constructor(
699
702
  message?: string,
700
703
  messageAlignment?: TextAlignment,
701
- extras?: Record<string, any>,
704
+ extras?: Record<string, string>,
702
705
  triggerId?: string,
703
706
  clickAction?: ClickAction,
704
707
  uri?: string,
@@ -857,7 +860,7 @@
857
860
  constructor(
858
861
  message?: string,
859
862
  messageAlignment?: TextAlignment,
860
- extras?: Record<string, any>,
863
+ extras?: Record<string, string>,
861
864
  triggerId?: string,
862
865
  clickAction?: ClickAction,
863
866
  uri?: string,
@@ -980,7 +983,7 @@
980
983
  */
981
984
  constructor(
982
985
  message: string,
983
- extras?: Record<string, any>,
986
+ extras?: Record<string, string>,
984
987
  triggerId?: string,
985
988
  dismissType?: DismissType,
986
989
  duration?: number,
@@ -1047,7 +1050,7 @@
1047
1050
  message: string,
1048
1051
  messageAlignment?: TextAlignment,
1049
1052
  slideFrom?: SlideFrom,
1050
- extras?: Record<string, any>,
1053
+ extras?: Record<string, string>,
1051
1054
  triggerId?: string,
1052
1055
  clickAction?: ClickAction,
1053
1056
  uri?: string,
@@ -1496,9 +1499,9 @@
1496
1499
  * no arguments when this button records a click.
1497
1500
  *
1498
1501
  * @returns The identifier of the subscription created. This can be passed to `removeSubscription`
1499
- * to cancel the subscription.
1502
+ * to cancel the subscription. Returns null if the subscriber passed is not a function.
1500
1503
  */
1501
- subscribeToClickedEvent(subscriber: () => void): string;
1504
+ subscribeToClickedEvent(subscriber: () => void): string | null;
1502
1505
  }
1503
1506
 
1504
1507
  export interface FeatureFlagStringProperty {
@@ -1842,7 +1845,7 @@
1842
1845
  ): boolean;
1843
1846
 
1844
1847
  /**
1845
- * A convenience method to log that the user saw the given Content Cards. This method is equivalent to
1848
+ * A convenient method to log that the user saw the given Content Cards. This method is equivalent to
1846
1849
  * calling [`logCardImpressions` method with `forContentCards` param set to true.
1847
1850
  * This is done automatically when you use Braze's display module and should only be called
1848
1851
  * if you're bypassing that and manually building the DOM for displaying content cards in
@@ -2005,7 +2008,7 @@
2005
2008
  * - Create a `service-worker.js` file with the content below and place it in the root directory of your website:
2006
2009
  *
2007
2010
  * ```
2008
- * self.importScripts('https://js.appboycdn.com/web-sdk-develop/4.7/service-worker.js');
2011
+ * self.importScripts('https://js.appboycdn.com/web-sdk-develop/4.8/service-worker.js');
2009
2012
  * ```
2010
2013
  *
2011
2014
  * For more details, see [Our Product Documentation](https://www.braze.com/docs/developer_guide/platform_integration_guides/web/push_notifications/integration).
@@ -2138,10 +2141,11 @@
2138
2141
  * regardless of whether new cards are available, you should use the `successCallback` of `requestContentCardsRefresh`.
2139
2142
  *
2140
2143
  * @returns The identifier of the subscription created. This can be passed to `removeSubscription` to cancel the subscription.
2144
+ * Returns undefined if the SDK has not been initialized.
2141
2145
  */
2142
2146
  export function subscribeToContentCardsUpdates(
2143
2147
  subscriber: (cards: ContentCards) => void
2144
- ): string;
2148
+ ): string | undefined;
2145
2149
 
2146
2150
  /**
2147
2151
  * Subscribe to news feed updates. The subscriber callback will be called whenever the news feed is updated.
@@ -2245,15 +2249,17 @@
2245
2249
  * Subscribe to feature flag updates. The subscriber callback will be called whenever feature flags are updated. This method
2246
2250
  * should be called before calling `openSession`.
2247
2251
  *
2248
- * @param subscriber - The callback function to handle new feature flags. This function will be called with a list of `FeatureFlag`
2249
- * objects, including all feature flags currently available. If you want to be notified when a refresh has completed
2252
+ * @param subscriber - The callback function to handle new feature flags. This function is always called first with the
2253
+ * available cached list of `FeatureFlag` objects, and will also be called when feature flag updates are available.
2254
+ * If you want to be notified when a refresh has completed
2250
2255
  * regardless of whether new feature flags are available, you should use the `successCallback` of `refreshFeatureFlags`.
2251
2256
  *
2252
2257
  * @returns The identifier of the subscription created. This can be passed to `removeSubscription` to cancel the subscription.
2258
+ * Returns undefined if the SDK has not been initialized.
2253
2259
  */
2254
2260
  export function subscribeToFeatureFlagsUpdates(
2255
2261
  subscriber: (featureFlags: FeatureFlag[]) => void
2256
- ): string;
2262
+ ): string | undefined;
2257
2263
 
2258
2264
  /**
2259
2265
  * Gets all available feature flags.
@@ -2358,7 +2364,7 @@
2358
2364
  * lifecycle of, set this option to true and the Braze SDK will not register or unregister a service worker. If you set this
2359
2365
  * option to true, in order for push to function correctly you must register the service worker yourself BEFORE calling
2360
2366
  * `requestPushPermission`, and ensure that it contains Braze's service worker code, either with
2361
- * `self.importScripts('https://js.appboycdn.com/web-sdk-develop/4.7/service-worker.js');` or by including the content
2367
+ * `self.importScripts('https://js.appboycdn.com/web-sdk-develop/4.8/service-worker.js');` or by including the content
2362
2368
  * of that file directly. When this option is true, the `serviceWorkerLocation` option is irrelevant and is ignored.
2363
2369
  */
2364
2370
  manageServiceWorkerExternally?: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@braze/web-sdk",
3
- "version": "4.7.2",
3
+ "version": "4.8.1",
4
4
  "description": "Braze SDK for web sites and other JS platforms.",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -1,8 +1,8 @@
1
1
  import je from "./encoding-utils.js";
2
2
  import { EventTypes as ve, InternalEventTypes as De } from "./event-types.js";
3
- import Be from "./guid.js";
4
- import Ae from "./indexed-db-adapter.js";
5
- import Ge from "./logger.js";
6
- import Ue from "./supported-options.js";
7
- const r = { yn: je, A: ve, Ar: De, it: Be, qt: Ae, xt: Ae.ep, D: Ge, Fo: Ue };
3
+ import Ie from "./guid.js";
4
+ import Be from "./indexed-db-adapter.js";
5
+ import Ae from "./logger.js";
6
+ import Ge from "./supported-options.js";
7
+ const r = { xn: je, q: ve, Cr: De, Z: Ie, xt: Be, zt: Be.ep, j: Ae, xo: Ge };
8
8
  export default r;
@@ -1,5 +1,5 @@
1
1
  const je = {
2
- wn: function(t) {
2
+ _n: function(t) {
3
3
  const r = (t + "=".repeat((4 - (t.length % 4)) % 4))
4
4
  .replace(/\-/g, "+")
5
5
  .replace(/_/g, "/"),
@@ -1,33 +1,33 @@
1
1
  const ve = {
2
2
  CustomEvent: "ce",
3
3
  Pr: "p",
4
- Ol: "pc",
5
- cc: "ca",
6
- Aa: "i",
7
- qs: "ie",
8
- T: "cci",
9
- W: "ccic",
10
- _: "ccc",
11
- L: "ccd",
12
- yh: "ss",
13
- wh: "se",
14
- Mi: "si",
4
+ du: "pc",
5
+ dc: "ca",
6
+ ka: "i",
7
+ Is: "ie",
8
+ P: "cci",
9
+ T: "ccic",
10
+ $: "ccc",
11
+ H: "ccd",
12
+ Wl: "ss",
13
+ xl: "se",
14
+ _i: "si",
15
15
  Ii: "sc",
16
- Ai: "sbc",
16
+ Mi: "sbc",
17
17
  Ze: "sfe",
18
18
  ro: "iec",
19
- Nl: "lr",
20
- Ml: "uae",
21
- U: "ci",
22
- F: "cc",
23
- xl: "lcaa",
24
- Ul: "lcar",
25
- Fn: "inc",
26
- Un: "add",
27
- En: "rem",
28
- Sn: "set",
29
- An: "ncam",
30
- Jl: "sgu"
19
+ au: "lr",
20
+ Zh: "uae",
21
+ R: "ci",
22
+ B: "cc",
23
+ gu: "lcaa",
24
+ fu: "lcar",
25
+ Rn: "inc",
26
+ Bn: "add",
27
+ Ln: "rem",
28
+ Fn: "set",
29
+ $n: "ncam",
30
+ pu: "sgu"
31
31
  },
32
- De = { qr: "feed_displayed", dc: "content_cards_displayed" };
32
+ De = { Ar: "feed_displayed", Cc: "content_cards_displayed" };
33
33
  export { ve as EventTypes, De as InternalEventTypes };
@@ -1,5 +1,5 @@
1
- const Be = {
2
- nt: () => {
1
+ const Ie = {
2
+ Y: () => {
3
3
  const t = t => {
4
4
  const e = (Math.random().toString(16) + "000000000").substr(2, 8);
5
5
  return t ? "-" + e.substr(0, 4) + "-" + e.substr(4, 4) : e;
@@ -7,4 +7,4 @@ const Be = {
7
7
  return t() + t(!0) + t(!0) + t();
8
8
  }
9
9
  };
10
- export default Be;
10
+ export default Ie;
@@ -1,17 +1,17 @@
1
- export default class Ae {
1
+ export default class Be {
2
2
  constructor(t, e) {
3
- (this.td = "undefined" == typeof window ? self : window),
4
- (this.ed = t),
5
- (this.nd = e);
3
+ (this.nd = "undefined" == typeof window ? self : window),
4
+ (this.od = t),
5
+ (this.sd = e);
6
6
  }
7
- od() {
8
- if ("indexedDB" in this.td) return this.td.indexedDB;
7
+ dd() {
8
+ if ("indexedDB" in this.nd) return this.nd.indexedDB;
9
9
  }
10
- rd() {
10
+ ud() {
11
11
  try {
12
- if (null == this.od()) return !1;
12
+ if (null == this.dd()) return !1;
13
13
  {
14
- const t = this.od().open("Braze IndexedDB Support Test");
14
+ const t = this.dd().open("Braze IndexedDB Support Test");
15
15
  if (
16
16
  ((t.onupgradeneeded = () => t.result.close()),
17
17
  (t.onsuccess = () => t.result.close()),
@@ -20,7 +20,7 @@ export default class Ae {
20
20
  const t = window.chrome || window.browser || window.msBrowser;
21
21
  if (t && t.runtime && t.runtime.id)
22
22
  return (
23
- this.nd.info(
23
+ this.sd.info(
24
24
  "Not using IndexedDB for storage because we are running inside an extension"
25
25
  ),
26
26
  !1
@@ -30,45 +30,45 @@ export default class Ae {
30
30
  }
31
31
  } catch (t) {
32
32
  return (
33
- this.nd.info(
33
+ this.sd.info(
34
34
  "Not using IndexedDB for storage due to following error: " + t
35
35
  ),
36
36
  !1
37
37
  );
38
38
  }
39
39
  }
40
- sd(t, e) {
41
- const n = this.od().open(this.ed.dd, this.ed.VERSION);
40
+ fd(t, e) {
41
+ const n = this.dd().open(this.od.ad, this.od.VERSION);
42
42
  if (null == n) return "function" == typeof e && e(), !1;
43
43
  const o = this;
44
44
  return (
45
45
  (n.onupgradeneeded = t => {
46
- o.nd.info(
47
- "Upgrading indexedDB " + o.ed.dd + " to v" + o.ed.VERSION + "..."
46
+ o.sd.info(
47
+ "Upgrading indexedDB " + o.od.ad + " to v" + o.od.VERSION + "..."
48
48
  );
49
49
  const e = t.target.result;
50
- for (const t in o.ed.$t)
51
- o.ed.$t.hasOwnProperty(t) &&
52
- !e.objectStoreNames.contains(o.ed.$t[t]) &&
53
- e.createObjectStore(o.ed.$t[t]);
50
+ for (const t in o.od.Jt)
51
+ o.od.Jt.hasOwnProperty(t) &&
52
+ !e.objectStoreNames.contains(o.od.Jt[t]) &&
53
+ e.createObjectStore(o.od.Jt[t]);
54
54
  }),
55
55
  (n.onsuccess = n => {
56
56
  const i = n.target.result;
57
57
  (i.onversionchange = () => {
58
58
  i.close(),
59
59
  "function" == typeof e && e(),
60
- o.nd.error(
60
+ o.sd.error(
61
61
  "Needed to close the database unexpectedly because of an upgrade in another tab"
62
62
  );
63
63
  }),
64
64
  t(i);
65
65
  }),
66
66
  (n.onerror = t => (
67
- o.nd.info(
67
+ o.sd.info(
68
68
  "Could not open indexedDB " +
69
- o.ed.dd +
69
+ o.od.ad +
70
70
  " v" +
71
- o.ed.VERSION +
71
+ o.od.VERSION +
72
72
  ": " +
73
73
  t.target.errorCode
74
74
  ),
@@ -79,18 +79,18 @@ export default class Ae {
79
79
  );
80
80
  }
81
81
  setItem(t, e, n, o, i) {
82
- if (!this.rd()) return "function" == typeof i && i(), !1;
82
+ if (!this.ud()) return "function" == typeof i && i(), !1;
83
83
  const r = this;
84
- return this.sd(s => {
84
+ return this.fd(s => {
85
85
  if (!s.objectStoreNames.contains(t))
86
86
  return (
87
- r.nd.error(
87
+ r.sd.error(
88
88
  "Could not store object " +
89
89
  e +
90
90
  " in " +
91
91
  t +
92
92
  " on indexedDB " +
93
- r.ed.dd +
93
+ r.od.ad +
94
94
  " - " +
95
95
  t +
96
96
  " is not a valid objectStore"
@@ -102,13 +102,13 @@ export default class Ae {
102
102
  d.oncomplete = () => s.close();
103
103
  const u = d.objectStore(t).put(n, e);
104
104
  (u.onerror = () => {
105
- r.nd.error(
105
+ r.sd.error(
106
106
  "Could not store object " +
107
107
  e +
108
108
  " in " +
109
109
  t +
110
110
  " on indexedDB " +
111
- r.ed.dd
111
+ r.od.ad
112
112
  ),
113
113
  "function" == typeof i && i();
114
114
  }),
@@ -118,18 +118,18 @@ export default class Ae {
118
118
  }, i);
119
119
  }
120
120
  getItem(t, e, n) {
121
- if (!this.rd()) return !1;
121
+ if (!this.ud()) return !1;
122
122
  const o = this;
123
- return this.sd(i => {
123
+ return this.fd(i => {
124
124
  if (!i.objectStoreNames.contains(t))
125
125
  return (
126
- o.nd.error(
126
+ o.sd.error(
127
127
  "Could not retrieve object " +
128
128
  e +
129
129
  " in " +
130
130
  t +
131
131
  " on indexedDB " +
132
- o.ed.dd +
132
+ o.od.ad +
133
133
  " - " +
134
134
  t +
135
135
  " is not a valid objectStore"
@@ -140,13 +140,13 @@ export default class Ae {
140
140
  r.oncomplete = () => i.close();
141
141
  const s = r.objectStore(t).get(e);
142
142
  (s.onerror = () => {
143
- o.nd.error(
143
+ o.sd.error(
144
144
  "Could not retrieve object " +
145
145
  e +
146
146
  " in " +
147
147
  t +
148
148
  " on indexedDB " +
149
- o.ed.dd
149
+ o.od.ad
150
150
  );
151
151
  }),
152
152
  (s.onsuccess = t => {
@@ -156,16 +156,16 @@ export default class Ae {
156
156
  });
157
157
  }
158
158
  hr(t, e, n) {
159
- if (!this.rd()) return "function" == typeof n && n(), !1;
159
+ if (!this.ud()) return "function" == typeof n && n(), !1;
160
160
  const o = this;
161
- return this.sd(i => {
161
+ return this.fd(i => {
162
162
  if (!i.objectStoreNames.contains(t))
163
163
  return (
164
- o.nd.error(
164
+ o.sd.error(
165
165
  "Could not retrieve last record from " +
166
166
  t +
167
167
  " on indexedDB " +
168
- o.ed.dd +
168
+ o.od.ad +
169
169
  " - " +
170
170
  t +
171
171
  " is not a valid objectStore"
@@ -177,8 +177,8 @@ export default class Ae {
177
177
  r.oncomplete = () => i.close();
178
178
  const s = r.objectStore(t).openCursor(null, "prev");
179
179
  (s.onerror = () => {
180
- o.nd.error(
181
- "Could not open cursor for " + t + " on indexedDB " + o.ed.dd
180
+ o.sd.error(
181
+ "Could not open cursor for " + t + " on indexedDB " + o.od.ad
182
182
  ),
183
183
  "function" == typeof n && n();
184
184
  }),
@@ -191,18 +191,18 @@ export default class Ae {
191
191
  }, n);
192
192
  }
193
193
  br(t, e) {
194
- if (!this.rd()) return !1;
194
+ if (!this.ud()) return !1;
195
195
  const n = this;
196
- return this.sd(o => {
196
+ return this.fd(o => {
197
197
  if (!o.objectStoreNames.contains(t))
198
198
  return (
199
- n.nd.error(
199
+ n.sd.error(
200
200
  "Could not delete record " +
201
201
  e +
202
202
  " from " +
203
203
  t +
204
204
  " on indexedDB " +
205
- n.ed.dd +
205
+ n.od.ad +
206
206
  " - " +
207
207
  t +
208
208
  " is not a valid objectStore"
@@ -212,28 +212,28 @@ export default class Ae {
212
212
  const i = o.transaction([t], "readwrite");
213
213
  i.oncomplete = () => o.close();
214
214
  i.objectStore(t).delete(e).onerror = () => {
215
- n.nd.error(
215
+ n.sd.error(
216
216
  "Could not delete record " +
217
217
  e +
218
218
  " from " +
219
219
  t +
220
220
  " on indexedDB " +
221
- n.ed.dd
221
+ n.od.ad
222
222
  );
223
223
  };
224
224
  });
225
225
  }
226
- Jt(t, e) {
227
- if (!this.rd()) return !1;
226
+ Mt(t, e) {
227
+ if (!this.ud()) return !1;
228
228
  const n = this;
229
- return this.sd(o => {
229
+ return this.fd(o => {
230
230
  if (!o.objectStoreNames.contains(t))
231
231
  return (
232
- n.nd.error(
232
+ n.sd.error(
233
233
  "Could not retrieve objects from " +
234
234
  t +
235
235
  " on indexedDB " +
236
- n.ed.dd +
236
+ n.od.ad +
237
237
  " - " +
238
238
  t +
239
239
  " is not a valid objectStore"
@@ -247,15 +247,15 @@ export default class Ae {
247
247
  d = [];
248
248
  (s.onerror = () => {
249
249
  d.length > 0
250
- ? (n.nd.info(
250
+ ? (n.sd.info(
251
251
  "Cursor closed midway through for " +
252
252
  t +
253
253
  " on indexedDB " +
254
- n.ed.dd
254
+ n.od.ad
255
255
  ),
256
256
  e(d))
257
- : n.nd.error(
258
- "Could not open cursor for " + t + " on indexedDB " + n.ed.dd
257
+ : n.sd.error(
258
+ "Could not open cursor for " + t + " on indexedDB " + n.od.ad
259
259
  );
260
260
  }),
261
261
  (s.onsuccess = t => {
@@ -272,43 +272,43 @@ export default class Ae {
272
272
  });
273
273
  }
274
274
  clearData() {
275
- if (!this.rd()) return !1;
275
+ if (!this.ud()) return !1;
276
276
  const t = [];
277
- for (const e in this.ed.$t)
278
- this.ed.$t.hasOwnProperty(e) &&
279
- this.ed.$t[e] !== this.ed.$t.oe &&
280
- t.push(this.ed.$t[e]);
277
+ for (const e in this.od.Jt)
278
+ this.od.Jt.hasOwnProperty(e) &&
279
+ this.od.Jt[e] !== this.od.Jt.oe &&
280
+ t.push(this.od.Jt[e]);
281
281
  const e = this;
282
- return this.sd(function(n) {
282
+ return this.fd(function(n) {
283
283
  const o = n.transaction(t, "readwrite");
284
284
  o.oncomplete = () => n.close();
285
285
  for (let n = 0; n < t.length; n++) {
286
286
  const i = t[n];
287
287
  o.objectStore(i).clear().onerror = function() {
288
- e.nd.error(
289
- "Could not clear " + this.source.name + " on indexedDB " + e.ed.dd
288
+ e.sd.error(
289
+ "Could not clear " + this.source.name + " on indexedDB " + e.od.ad
290
290
  );
291
291
  };
292
292
  }
293
293
  o.onerror = function() {
294
- e.nd.error("Could not clear object stores on indexedDB " + e.ed.dd);
294
+ e.sd.error("Could not clear object stores on indexedDB " + e.od.ad);
295
295
  };
296
296
  });
297
297
  }
298
298
  }
299
- Ae.ep = {
299
+ Be.ep = {
300
300
  Ft: {
301
- dd: "AppboyServiceWorkerAsyncStorage",
301
+ ad: "AppboyServiceWorkerAsyncStorage",
302
302
  VERSION: 6,
303
- $t: {
304
- Il: "data",
305
- jr: "pushClicks",
303
+ Jt: {
304
+ Sa: "data",
305
+ kr: "pushClicks",
306
306
  cu: "pushSubscribed",
307
- ud: "fallbackDevice",
308
- Mt: "cardUpdates",
307
+ hd: "fallbackDevice",
308
+ qt: "cardUpdates",
309
309
  oe: "optOut",
310
- $r: "pendingData",
311
- Mn: "sdkAuthenticationSignature"
310
+ yr: "pendingData",
311
+ kh: "sdkAuthenticationSignature"
312
312
  },
313
313
  se: 1
314
314
  }