@braze/web-sdk 6.12.1 → 6.13.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 (149) hide show
  1. package/index.d.ts +240 -3
  2. package/package.json +1 -1
  3. package/shared-lib/event-types.js +18 -18
  4. package/shared-lib/indexed-db-adapter.js +58 -58
  5. package/shared-lib/logger.js +7 -7
  6. package/shared-lib/supported-options.js +25 -24
  7. package/src/ConversationalChat/automatically-manage-chat.js +5 -0
  8. package/src/ConversationalChat/chat-message-factory.js +25 -0
  9. package/src/ConversationalChat/chat-message.js +33 -0
  10. package/src/ConversationalChat/constants.js +1 -0
  11. package/src/ConversationalChat/conversational-chat-provider-factory.js +26 -0
  12. package/src/ConversationalChat/conversational-chat-provider.js +372 -0
  13. package/src/ConversationalChat/display/chat-widget-manager.js +113 -0
  14. package/src/ConversationalChat/display/chat-widget-to-html.js +58 -0
  15. package/src/ConversationalChat/get-chat-messages.js +7 -0
  16. package/src/ConversationalChat/index.js +12 -0
  17. package/src/ConversationalChat/is-chat-conversation-ended.js +7 -0
  18. package/src/ConversationalChat/is-chat-turn-errored.js +7 -0
  19. package/src/ConversationalChat/is-chat-turn-in-progress.js +7 -0
  20. package/src/ConversationalChat/register-chat-action-handler.js +10 -0
  21. package/src/ConversationalChat/reset-chat-conversation.js +5 -0
  22. package/src/ConversationalChat/retrieve-chat-config.js +7 -0
  23. package/src/ConversationalChat/send-chat-message.js +17 -0
  24. package/src/ConversationalChat/subscribe-to-chat-action.js +5 -0
  25. package/src/ConversationalChat/subscribe-to-chat-conversation-updated.js +5 -0
  26. package/src/ConversationalChat/subscribe-to-chat-message-received.js +5 -0
  27. package/src/ConversationalChat/trigger-chat-action.js +11 -0
  28. package/src/ConversationalChat/types.js +1 -0
  29. package/src/Core/add-sdk-metadata.js +5 -5
  30. package/src/Core/change-user.js +6 -6
  31. package/src/Core/disable-sdk.js +6 -6
  32. package/src/Core/enable-sdk.js +3 -3
  33. package/src/Core/get-device-id.js +2 -2
  34. package/src/Core/handle-braze-action.js +20 -13
  35. package/src/Core/is-disabled.js +1 -1
  36. package/src/Core/is-initialized.js +1 -1
  37. package/src/Core/log-custom-event.js +9 -9
  38. package/src/Core/log-ecommerce-event.js +4 -4
  39. package/src/Core/log-purchase.js +14 -14
  40. package/src/Core/open-session.js +8 -8
  41. package/src/Core/set-sdk-authentication-signature.js +3 -3
  42. package/src/Core/subscribe-to-sdk-authentication-failures.js +1 -1
  43. package/src/Core/wipe-data.js +1 -1
  44. package/src/DUST/dust-config-store.js +35 -35
  45. package/src/DUST/dust-message-dedup.js +3 -3
  46. package/src/DUST/dust-provider-factory.js +10 -10
  47. package/src/DUST/dust-provider.js +234 -234
  48. package/src/DUST/subscribe-to-dust.js +7 -7
  49. package/src/FeatureFlags/feature-flag-factory.js +2 -2
  50. package/src/FeatureFlags/feature-flag.js +4 -4
  51. package/src/FeatureFlags/feature-flags-provider-factory.js +11 -11
  52. package/src/FeatureFlags/feature-flags-provider.js +38 -38
  53. package/src/FeatureFlags/get-all-feature-flags.js +3 -3
  54. package/src/FeatureFlags/get-feature-flag.js +3 -3
  55. package/src/FeatureFlags/log-feature-flag-impression.js +4 -4
  56. package/src/FeatureFlags/refresh-feature-flags.js +5 -5
  57. package/src/FeatureFlags/subscribe-to-feature-flags-updates.js +3 -3
  58. package/src/InAppMessage/defer-in-app-message.js +1 -1
  59. package/src/InAppMessage/display/html-message-display-utils.js +4 -4
  60. package/src/InAppMessage/display/html-message-to-html.js +13 -13
  61. package/src/InAppMessage/display/in-app-message-to-html.js +20 -20
  62. package/src/InAppMessage/display/modal-utils.js +7 -7
  63. package/src/InAppMessage/in-app-message-factory.js +6 -6
  64. package/src/InAppMessage/in-app-message-manager.js +92 -92
  65. package/src/InAppMessage/log-in-app-message-button-click.js +9 -9
  66. package/src/InAppMessage/log-in-app-message-click.js +7 -7
  67. package/src/InAppMessage/log-in-app-message-html-click.js +6 -6
  68. package/src/InAppMessage/log-in-app-message-impression.js +3 -3
  69. package/src/InAppMessage/models/full-screen-message.js +39 -39
  70. package/src/InAppMessage/models/html-message.js +20 -20
  71. package/src/InAppMessage/models/in-app-message-button.js +2 -2
  72. package/src/InAppMessage/models/in-app-message.js +102 -102
  73. package/src/InAppMessage/models/modal-message.js +38 -38
  74. package/src/InAppMessage/models/slide-up-message.js +34 -34
  75. package/src/InAppMessage/models/templated-in-app-message.js +8 -8
  76. package/src/InAppMessage/subscribe-to-in-app-message.js +1 -1
  77. package/src/InAppMessage/ui/automatically-show-in-app-messages.js +3 -3
  78. package/src/InAppMessage/ui/remove-all-visible-in-app-messages.js +3 -3
  79. package/src/InAppMessage/ui/show-in-app-message.js +23 -23
  80. package/src/Push/is-push-blocked.js +2 -2
  81. package/src/Push/is-push-permission-granted.js +2 -2
  82. package/src/Push/is-push-supported.js +2 -2
  83. package/src/Push/push-manager-factory.js +15 -15
  84. package/src/Push/push-manager.js +13 -13
  85. package/src/Push/register-push.js +2 -2
  86. package/src/Push/request-push-permission.js +2 -2
  87. package/src/Push/unregister-push-token-on-server.js +3 -3
  88. package/src/Push/unregister-push.js +3 -3
  89. package/src/Push/utils/push-utils.js +15 -15
  90. package/src/User/user-manager.js +9 -9
  91. package/src/User/user.js +50 -50
  92. package/src/common/constants.js +1 -1
  93. package/src/common/content-cards-display.js +22 -22
  94. package/src/common/event-logger.js +3 -3
  95. package/src/index.js +2 -9
  96. package/src/l10n/l10n-manager-factory.js +4 -4
  97. package/src/l10n/l10n-manager.js +6 -6
  98. package/src/managers/auth-manager.js +28 -28
  99. package/src/managers/braze-action-manager.js +14 -0
  100. package/src/managers/braze-instance.js +159 -151
  101. package/src/managers/device-manager.js +26 -26
  102. package/src/managers/network-manager.js +120 -120
  103. package/src/managers/server-config-manager.js +95 -86
  104. package/src/managers/session-manager.js +25 -25
  105. package/src/managers/storage-manager-factory.js +12 -12
  106. package/src/managers/storage-manager.js +129 -124
  107. package/src/managers/subscription-manager.js +8 -8
  108. package/src/models/backend-errors.js +5 -5
  109. package/src/models/braze-event.js +5 -5
  110. package/src/models/device.js +2 -2
  111. package/src/models/identifier.js +8 -8
  112. package/src/models/push-token.js +6 -6
  113. package/src/models/request-result.js +2 -2
  114. package/src/models/server-config.js +27 -27
  115. package/src/request-controller.js +117 -117
  116. package/src/standard-index.js +9 -0
  117. package/src/triggers/models/custom-event-data.js +4 -4
  118. package/src/triggers/models/custom-event-property-data.js +5 -5
  119. package/src/triggers/models/filter-set.js +5 -5
  120. package/src/triggers/models/filter.js +31 -31
  121. package/src/triggers/models/in-app-message-click-data.js +9 -9
  122. package/src/triggers/models/purchase-data.js +1 -1
  123. package/src/triggers/models/purchase-property-data.js +5 -5
  124. package/src/triggers/models/push-click-data.js +4 -4
  125. package/src/triggers/models/trigger-condition.js +35 -35
  126. package/src/triggers/models/trigger-events.js +3 -3
  127. package/src/triggers/models/trigger.js +36 -36
  128. package/src/triggers/triggers-provider-factory.js +5 -5
  129. package/src/triggers/triggers-provider.js +128 -128
  130. package/src/types.js +2 -2
  131. package/src/ui/js/attach-css.js +1 -1
  132. package/src/ui/js/chat-widget-css.js +11 -0
  133. package/src/ui/js/load-font-awesome.js +1 -1
  134. package/src/util/base-device-parser.js +7 -7
  135. package/src/util/braze-actions.js +5 -5
  136. package/src/util/browser-detector.js +41 -41
  137. package/src/util/client-hints-parser.js +10 -10
  138. package/src/util/component-utils.js +1 -1
  139. package/src/util/date-utils.js +2 -2
  140. package/src/util/device-constants.js +5 -5
  141. package/src/util/dom-utils.js +8 -8
  142. package/src/util/ecommerce-event-validation.js +13 -13
  143. package/src/util/html-display-utils.js +6 -6
  144. package/src/util/key-codes.js +1 -1
  145. package/src/util/net.js +82 -44
  146. package/src/util/request-header-utils.js +26 -24
  147. package/src/util/user-agent-parser.js +21 -21
  148. package/src/util/validation-utils.js +29 -21
  149. 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 v6.12.1
2
+ * Type definitions for @braze/web-sdk v6.13.0
3
3
  * Project: https://github.com/braze-inc/braze-web-sdk
4
4
  * (c) Braze, Inc. 2026 - http://braze.com
5
5
  * License available at https://github.com/braze-inc/braze-web-sdk/blob/master/LICENSE
@@ -2590,7 +2590,7 @@ export function logout(
2590
2590
  * - Create a `service-worker.js` file with the content below and place it in the root directory of your website:
2591
2591
  *
2592
2592
  * ```
2593
- * self.importScripts('https://js.appboycdn.com/web-sdk/6.12/service-worker.js');
2593
+ * self.importScripts('https://js.appboycdn.com/web-sdk/6.13/service-worker.js');
2594
2594
  * ```
2595
2595
  *
2596
2596
  * For more details, see [Our Product Documentation](https://www.braze.com/docs/developer_guide/platform_integration_guides/web/push_notifications/integration).
@@ -2937,6 +2937,237 @@ export function subscribeToBannersUpdates(
2937
2937
 
2938
2938
 
2939
2939
 
2940
+ /*
2941
+ * Conversational Chat
2942
+ *
2943
+ * On npm these are available like any other method and are tree-shaken out if unused. On the CDN,
2944
+ * the headless chat APIs and SDK-managed widget ship only in braze.conversational.min.js.
2945
+ */
2946
+
2947
+ /**
2948
+ * A paragraph block item: a snippet of HTML to render inline.
2949
+ */
2950
+ export interface ChatParagraphItem {
2951
+ html: string;
2952
+ }
2953
+
2954
+ /**
2955
+ * An unordered-list block item: a snippet of HTML (often an anchor) to render as a list entry.
2956
+ */
2957
+ export interface ChatListItem {
2958
+ html: string;
2959
+ }
2960
+
2961
+
2962
+ export type ChatMessageBlockType = "paragraph" | "unorderedList";
2963
+
2964
+ /**
2965
+ * A single block of agent content. `items` are HTML snippets for paragraph/unorderedList blocks.
2966
+ * The SDK passes these through verbatim — it never parses, sanitizes, or markdown-converts them;
2967
+ * rendering (and any sanitization) is the consumer's responsibility.
2968
+ */
2969
+ export interface ChatMessageBlock {
2970
+ type: ChatMessageBlockType;
2971
+ items: Array<ChatParagraphItem | ChatListItem>;
2972
+ }
2973
+
2974
+ /**
2975
+ * A directive the agent attaches to a turn. The set of actions depends on what the customer
2976
+ * configures, so `type` is open and `data` optional; the SDK passes every action through to
2977
+ * subscribers untouched (and acts on the few it recognizes, like ending the conversation).
2978
+ */
2979
+ export interface ChatAction {
2980
+ type: string;
2981
+ data?: Record<string, unknown>;
2982
+ }
2983
+
2984
+ /**
2985
+ * Action types the Braze SDK recognizes. Directives with unrecognized types are ignored.
2986
+ */
2987
+ export type BrazeChatActionType = "error" | "end_conversation" | "user_action";
2988
+
2989
+ /**
2990
+ * Properties attached to a sent message. Use `completedActions` to report actions the app already
2991
+ * performed (named in past tense, e.g. `added_to_cart`), with supporting detail in `data`.
2992
+ */
2993
+ export interface ChatMessageProperties {
2994
+ completedActions?: Array<{ name: string; data?: Record<string, unknown> }>;
2995
+ }
2996
+
2997
+ /**
2998
+ * Event dispatched to `subscribeToChatAction` subscribers when the agent attaches a recognized
2999
+ * action to a turn, or when the user clicks an action button whose Braze Action URI triggers
3000
+ * a `user_action`.
3001
+ */
3002
+ export type ChatActionEvent =
3003
+ | { type: "user_action"; name: string; data?: Record<string, unknown> }
3004
+ | { type: "end_conversation"; data?: Record<string, unknown> }
3005
+ | { type: "error"; data?: Record<string, unknown> };
3006
+
3007
+ /**
3008
+ * The agent's message object for a turn. `content` is always present — the list of blocks a consumer
3009
+ * renders. The SDK otherwise treats this as an opaque pass-through, so additional fields the backend
3010
+ * may add (e.g. an id or timestamp) flow through untouched.
3011
+ */
3012
+ export interface ChatMessageContent {
3013
+ content: ChatMessageBlock[];
3014
+ [key: string]: unknown;
3015
+ }
3016
+
3017
+ /**
3018
+ * Who sent a turn: the end user, or the conversational agent.
3019
+ */
3020
+ export type ChatRole = "user" | "assistant";
3021
+
3022
+ /**
3023
+ * A single turn in the conversation. Agent turns are delivered to
3024
+ * `subscribeToChatMessageReceived` subscribers as they arrive; `getChatMessages` returns
3025
+ * the full transcript (both user and agent turns) for rendering history on reload. Use `role` to
3026
+ * tell them apart: `"assistant"` turns carry `message`, `"user"` turns carry `userMessage`.
3027
+ */
3028
+ export class ChatMessage {
3029
+ /** Who sent this turn. */
3030
+ role: ChatRole;
3031
+
3032
+ /** The conversation session this turn belongs to. */
3033
+ sessionId: string;
3034
+
3035
+ /** Server-assigned identifier for this message. */
3036
+ messageId: string;
3037
+
3038
+ /** The directives the agent attached to this turn, e.g. ending the conversation (assistant turns only). */
3039
+ actions: ChatAction[];
3040
+
3041
+ /** The agent's content for this turn (assistant turns only). */
3042
+ message?: ChatMessageContent;
3043
+
3044
+ /** The event type of this turn (assistant turns only). */
3045
+ eventType?: string;
3046
+
3047
+ /** The text the user sent (user turns only). */
3048
+ userMessage?: string;
3049
+ }
3050
+
3051
+ /**
3052
+ * Requests the conversational chat opening message for the current user. The opening message is not
3053
+ * returned synchronously — it is delivered asynchronously and surfaced through
3054
+ * `subscribeToChatMessageReceived`, like any other agent turn.
3055
+ *
3056
+ * @param successCallback - Called when the request is accepted.
3057
+ * @param errorCallback - Called on failure, including when the SDK or conversational chat is disabled.
3058
+ */
3059
+ export function retrieveChatConfig(
3060
+ successCallback?: () => void,
3061
+ errorCallback?: () => void,
3062
+ ): void;
3063
+
3064
+ /**
3065
+ * Sends a user message to the conversational agent. The agent's reply is delivered asynchronously
3066
+ * (see `subscribeToChatMessageReceived`).
3067
+ *
3068
+ * @param message - The user's message. Must be a non-empty string.
3069
+ * @param messageProperties - Optional properties attached to the message (see `ChatMessageProperties`).
3070
+ * @param successCallback - Called when the message is accepted.
3071
+ * @param errorCallback - Called on failure.
3072
+ *
3073
+ * @returns false if the message is invalid, the SDK is disabled, a turn is already in progress, the
3074
+ * agent has ended the conversation, or the request was rate limited; true once the send is initiated.
3075
+ */
3076
+ export function sendChatMessage(
3077
+ message: string,
3078
+ messageProperties?: ChatMessageProperties,
3079
+ successCallback?: () => void,
3080
+ errorCallback?: () => void,
3081
+ ): boolean;
3082
+
3083
+ /**
3084
+ * Registers a callback invoked with each agent turn as it arrives. Every turn is delivered, including
3085
+ * ones carrying an `error` or `end_conversation` action, so the host can inspect `actions`.
3086
+ *
3087
+ * @param subscriber - The callback function to handle each received `ChatMessage`.
3088
+ *
3089
+ * @returns The identifier of the subscription created. This can be passed to `removeSubscription`
3090
+ * to cancel the subscription. Returns undefined if the SDK has not been initialized, null if the
3091
+ * subscriber is not a function.
3092
+ */
3093
+ export function subscribeToChatMessageReceived(
3094
+ subscriber: (message: ChatMessage) => void,
3095
+ ): string | null | undefined;
3096
+
3097
+ /**
3098
+ * Registers a callback invoked (with no arguments) when the conversation state changes — a new
3099
+ * message, a cross-tab write, a user switch (`changeUser`), a data wipe (`wipeData`), or a
3100
+ * reset. Use it to refresh — re-read `getChatMessages`, `isChatTurnInProgress`,
3101
+ * `isChatConversationEnded`, and `isChatTurnErrored` — and re-render.
3102
+ *
3103
+ * @param subscriber - The callback function, invoked when conversation state changes.
3104
+ *
3105
+ * @returns The identifier of the subscription created. This can be passed to `removeSubscription`
3106
+ * to cancel the subscription. Returns undefined if the SDK has not been initialized, null if the
3107
+ * subscriber is not a function.
3108
+ */
3109
+ export function subscribeToChatUpdates(
3110
+ subscriber: () => void,
3111
+ ): string | null | undefined;
3112
+
3113
+ /**
3114
+ * Registers a callback invoked when the agent or an action button fires an action. Use this
3115
+ * to react to agent directives (e.g. `end_conversation`) or user-triggered front-end actions
3116
+ * (e.g. `user_action` with `name: "add_to_cart"`).
3117
+ *
3118
+ * @param subscriber - The callback function to handle each `ChatActionEvent`.
3119
+ *
3120
+ * @returns The identifier of the subscription created. This can be passed to `removeSubscription`
3121
+ * to cancel the subscription. Returns undefined if the SDK has not been initialized, null if the
3122
+ * subscriber is not a function.
3123
+ */
3124
+ export function subscribeToChatAction(
3125
+ subscriber: (action: ChatActionEvent) => void,
3126
+ ): string | null | undefined;
3127
+
3128
+ /**
3129
+ * Returns the conversation's turns so far so a host can render existing history on load; new turns
3130
+ * then arrive through `subscribeToChatMessageReceived`. Returns null if conversational chat is not
3131
+ * enabled for this user, or undefined if the SDK has not been initialized.
3132
+ */
3133
+ export function getChatMessages(): ChatMessage[] | null | undefined;
3134
+
3135
+ /**
3136
+ * Resets the current conversation (session, transcript, in-flight turn, ended state, error state) so
3137
+ * the user can restart from scratch; call `retrieveChatConfig` afterward to fetch a new opening
3138
+ * message.
3139
+ */
3140
+ export function resetChatConversation(): void;
3141
+
3142
+ /**
3143
+ * Whether a chat turn (the opening message or a sent message) is awaiting its reply. Returns null if
3144
+ * conversational chat is not enabled for this user, or undefined if the SDK has not been initialized.
3145
+ */
3146
+ export function isChatTurnInProgress(): boolean | null | undefined;
3147
+
3148
+ /**
3149
+ * Whether the agent has ended the current conversation. While ended, `sendChatMessage` is rejected
3150
+ * until `resetChatConversation` is called. Returns null if conversational chat is not enabled for
3151
+ * this user, or undefined if the SDK has not been initialized.
3152
+ */
3153
+ export function isChatConversationEnded(): boolean | null | undefined;
3154
+
3155
+ /**
3156
+ * Whether the last chat turn resulted in an error (agent error or send failure). Tracked separately from
3157
+ * the conversation's ended state, so an error never reopens an ended conversation and never blocks a
3158
+ * send on its own. Cleared when the next turn starts, when a reply arrives, or on conversation reset.
3159
+ * Returns null if conversational chat is not enabled for this user, or undefined if the SDK has not
3160
+ * been initialized.
3161
+ */
3162
+ export function isChatTurnErrored(): boolean | null | undefined;
3163
+
3164
+ /**
3165
+ * Opt into SDK-managed conversational chat: mounts and manages the chat widget when conversational chat
3166
+ * is enabled. Call once after `initialize`. No-op if the SDK is disabled. On the CDN this method
3167
+ * ships only in `braze.conversational.min.js`.
3168
+ */
3169
+ export function automaticallyManageChat(): void;
3170
+
2940
3171
  /**
2941
3172
  * Getter method to determine if the Braze SDK has been initialized.
2942
3173
  */
@@ -2985,6 +3216,12 @@ export type InitializationOptions = {
2985
3216
  * `use.fontawesome.com` to your Content Security Policy allowlist or by using the `doNotLoadFontAwesome` option and loading it manually.
2986
3217
  */
2987
3218
  contentSecurityNonce?: string;
3219
+ /**
3220
+ * By default, the conversational chat widget is shown with a z-index of one less than the in-app message backdrop:
3221
+ * `inAppMessageZIndex - 1` when that option is set, otherwise 9000. Provide a value for this option to override that
3222
+ * default, for example to layer the widget relative to other overlay content on your site.
3223
+ */
3224
+ conversationalChatZIndex?: number;
2988
3225
  /**
2989
3226
  * By default, the Braze SDK automatically detects and collects all device properties in `DeviceProperties`. To override
2990
3227
  * this behavior, provide an array of `DeviceProperties`. To disable all properties being sent to Braze servers, provide
@@ -3036,7 +3273,7 @@ export type InitializationOptions = {
3036
3273
  * lifecycle of, set this option to true and the Braze SDK will not register or unregister a service worker. If you set this
3037
3274
  * option to true, in order for push to function correctly you must register the service worker yourself BEFORE calling
3038
3275
  * `requestPushPermission`, and ensure that it contains Braze's service worker code, either with
3039
- * `self.importScripts('https://js.appboycdn.com/web-sdk/6.12/service-worker.js');` or by including the content
3276
+ * `self.importScripts('https://js.appboycdn.com/web-sdk/6.13/service-worker.js');` or by including the content
3040
3277
  * of that file directly. When this option is true, the `serviceWorkerLocation` option is irrelevant and is ignored.
3041
3278
  */
3042
3279
  manageServiceWorkerExternally?: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@braze/web-sdk",
3
- "version": "6.12.1",
3
+ "version": "6.13.0",
4
4
  "description": "Braze SDK for web sites and other JS platforms.",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -1,35 +1,35 @@
1
1
  const p = {
2
2
  CustomEvent: "ce",
3
- Pr: "p",
4
- $c: "pc",
5
- Fc: "ca",
6
- vl: "i",
7
- _a: "ie",
3
+ qr: "p",
4
+ km: "pc",
5
+ ev: "ca",
6
+ Sc: "i",
7
+ Zl: "ie",
8
8
  vs: "cci",
9
9
  ws: "ccic",
10
10
  us: "ccc",
11
11
  gs: "ccd",
12
- wm: "ss",
12
+ Sm: "ss",
13
13
  hm: "se",
14
- On: "si",
15
- Hn: "sc",
16
- Jn: "sbc",
17
- Lc: "sfe",
14
+ ua: "si",
15
+ pa: "sc",
16
+ ha: "sbc",
17
+ tv: "sfe",
18
18
  om: "iec",
19
- Dc: "lr",
20
- Ac: "uae",
21
- Mc: "lcaa",
22
- Cc: "lcar",
23
- Na: "inc",
19
+ bm: "lr",
20
+ vm: "uae",
21
+ Dm: "lcaa",
22
+ Am: "lcar",
23
+ Ya: "inc",
24
24
  Xu: "add",
25
25
  Zu: "rem",
26
26
  Vu: "set",
27
27
  Qu: "ncam",
28
- Tc: "sgu",
28
+ $m: "sgu",
29
29
  xo: "ffi",
30
30
  ro: "bi",
31
31
  Nt: "bc",
32
32
  Rt: "bd",
33
33
  },
34
- Ee = { Gc: "content_cards_displayed" };
35
- export { p as EventTypes, Ee as InternalEventTypes };
34
+ Me = { nv: "content_cards_displayed" };
35
+ export { p as EventTypes, Me as InternalEventTypes };
@@ -1,21 +1,21 @@
1
1
  export default class et {
2
2
  constructor(t, e) {
3
3
  (this.database = t),
4
- (this.Bd = e),
4
+ (this.df = e),
5
5
  (this.parent = "undefined" == typeof window ? self : window),
6
6
  (this.database = t),
7
- (this.Bd = e);
7
+ (this.df = e);
8
8
  }
9
- Ud() {
9
+ vf() {
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.Ud()) return !1;
15
+ if (null == this.vf()) return !1;
16
16
  {
17
17
  const e =
18
- null === (t = this.Ud()) || void 0 === t
18
+ null === (t = this.vf()) || 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 et {
25
25
  "undefined" != typeof window)
26
26
  ) {
27
27
  const t = window,
28
- e = t.chrome || t.browser || t.Od;
28
+ e = t.chrome || t.browser || t.Df;
29
29
  if (e && e.runtime && e.runtime.id)
30
30
  return (
31
- this.Bd.info(
31
+ this.df.info(
32
32
  "Not using IndexedDB for storage because we are running inside an extension",
33
33
  ),
34
34
  !1
@@ -38,27 +38,27 @@ export default class et {
38
38
  }
39
39
  } catch (t) {
40
40
  return (
41
- this.Bd.info(
41
+ this.df.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
- kd(t, e) {
48
+ Bf(t, e) {
49
49
  var n;
50
50
  const o =
51
- null === (n = this.Ud()) || void 0 === n
51
+ null === (n = this.vf()) || void 0 === n
52
52
  ? void 0
53
- : n.open(this.database.Kd, this.database.VERSION);
53
+ : n.open(this.database.Sf, 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.Bd.info(
59
+ i.df.info(
60
60
  "Upgrading indexedDB " +
61
- i.database.Kd +
61
+ i.database.Sf +
62
62
  " to v" +
63
63
  i.database.VERSION +
64
64
  "...",
@@ -77,7 +77,7 @@ export default class et {
77
77
  (r.onversionchange = () => {
78
78
  r.close(),
79
79
  "function" == typeof e && e(),
80
- i.Bd.error(
80
+ i.df.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 et {
87
87
  var n;
88
88
  const o = t;
89
89
  return (
90
- i.Bd.info(
90
+ i.df.info(
91
91
  "Could not open indexedDB " +
92
- i.database.Kd +
92
+ i.database.Sf +
93
93
  " v" +
94
94
  i.database.VERSION +
95
95
  ": " +
@@ -105,16 +105,16 @@ export default class et {
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.kd((d) => {
108
+ return this.Bf((d) => {
109
109
  if (!d.objectStoreNames.contains(t))
110
110
  return (
111
- r.Bd.error(
111
+ r.df.error(
112
112
  "Could not store object " +
113
113
  e +
114
114
  " in " +
115
115
  t +
116
116
  " on indexedDB " +
117
- r.database.Kd +
117
+ r.database.Sf +
118
118
  " - " +
119
119
  t +
120
120
  " is not a valid objectStore",
@@ -126,13 +126,13 @@ export default class et {
126
126
  s.oncomplete = () => d.close();
127
127
  const u = s.objectStore(t).put(n, e);
128
128
  (u.onerror = () => {
129
- r.Bd.error(
129
+ r.df.error(
130
130
  "Could not store object " +
131
131
  e +
132
132
  " in " +
133
133
  t +
134
134
  " on indexedDB " +
135
- r.database.Kd,
135
+ r.database.Sf,
136
136
  ),
137
137
  "function" == typeof i && i();
138
138
  }),
@@ -144,16 +144,16 @@ export default class et {
144
144
  getItem(t, e, n) {
145
145
  if (!this.isSupported()) return !1;
146
146
  const o = this;
147
- return this.kd((i) => {
147
+ return this.Bf((i) => {
148
148
  if (!i.objectStoreNames.contains(t))
149
149
  return (
150
- o.Bd.error(
150
+ o.df.error(
151
151
  "Could not retrieve object " +
152
152
  e +
153
153
  " in " +
154
154
  t +
155
155
  " on indexedDB " +
156
- o.database.Kd +
156
+ o.database.Sf +
157
157
  " - " +
158
158
  t +
159
159
  " is not a valid objectStore",
@@ -164,13 +164,13 @@ export default class et {
164
164
  r.oncomplete = () => i.close();
165
165
  const d = r.objectStore(t).get(e);
166
166
  (d.onerror = () => {
167
- o.Bd.error(
167
+ o.df.error(
168
168
  "Could not retrieve object " +
169
169
  e +
170
170
  " in " +
171
171
  t +
172
172
  " on indexedDB " +
173
- o.database.Kd,
173
+ o.database.Sf,
174
174
  );
175
175
  }),
176
176
  (d.onsuccess = (t) => {
@@ -183,14 +183,14 @@ export default class et {
183
183
  kr(t, e, n) {
184
184
  if (!this.isSupported()) return "function" == typeof n && n(), !1;
185
185
  const o = this;
186
- return this.kd((i) => {
186
+ return this.Bf((i) => {
187
187
  if (!i.objectStoreNames.contains(t))
188
188
  return (
189
- o.Bd.error(
189
+ o.df.error(
190
190
  "Could not retrieve last record from " +
191
191
  t +
192
192
  " on indexedDB " +
193
- o.database.Kd +
193
+ o.database.Sf +
194
194
  " - " +
195
195
  t +
196
196
  " is not a valid objectStore",
@@ -202,8 +202,8 @@ export default class et {
202
202
  r.oncomplete = () => i.close();
203
203
  const d = r.objectStore(t).openCursor(null, "prev");
204
204
  (d.onerror = () => {
205
- o.Bd.error(
206
- "Could not open cursor for " + t + " on indexedDB " + o.database.Kd,
205
+ o.df.error(
206
+ "Could not open cursor for " + t + " on indexedDB " + o.database.Sf,
207
207
  ),
208
208
  "function" == typeof n && n();
209
209
  }),
@@ -216,19 +216,19 @@ export default class et {
216
216
  });
217
217
  }, n);
218
218
  }
219
- ge(t, e) {
219
+ Ae(t, e) {
220
220
  if (!this.isSupported()) return !1;
221
221
  const n = this;
222
- return this.kd((o) => {
222
+ return this.Bf((o) => {
223
223
  if (!o.objectStoreNames.contains(t))
224
224
  return (
225
- n.Bd.error(
225
+ n.df.error(
226
226
  "Could not delete record " +
227
227
  e +
228
228
  " from " +
229
229
  t +
230
230
  " on indexedDB " +
231
- n.database.Kd +
231
+ n.database.Sf +
232
232
  " - " +
233
233
  t +
234
234
  " is not a valid objectStore",
@@ -238,13 +238,13 @@ export default class et {
238
238
  const i = o.transaction([t], "readwrite");
239
239
  i.oncomplete = () => o.close();
240
240
  i.objectStore(t).delete(e).onerror = () => {
241
- n.Bd.error(
241
+ n.df.error(
242
242
  "Could not delete record " +
243
243
  e +
244
244
  " from " +
245
245
  t +
246
246
  " on indexedDB " +
247
- n.database.Kd,
247
+ n.database.Sf,
248
248
  );
249
249
  };
250
250
  });
@@ -252,14 +252,14 @@ export default class et {
252
252
  Qs(t, e) {
253
253
  if (!this.isSupported()) return !1;
254
254
  const n = this;
255
- return this.kd((o) => {
255
+ return this.Bf((o) => {
256
256
  if (!o.objectStoreNames.contains(t))
257
257
  return (
258
- n.Bd.error(
258
+ n.df.error(
259
259
  "Could not retrieve objects from " +
260
260
  t +
261
261
  " on indexedDB " +
262
- n.database.Kd +
262
+ n.database.Sf +
263
263
  " - " +
264
264
  t +
265
265
  " is not a valid objectStore",
@@ -273,18 +273,18 @@ export default class et {
273
273
  s = [];
274
274
  (d.onerror = () => {
275
275
  s.length > 0
276
- ? (n.Bd.info(
276
+ ? (n.df.info(
277
277
  "Cursor closed midway through for " +
278
278
  t +
279
279
  " on indexedDB " +
280
- n.database.Kd,
280
+ n.database.Sf,
281
281
  ),
282
282
  e(s))
283
- : n.Bd.error(
283
+ : n.df.error(
284
284
  "Could not open cursor for " +
285
285
  t +
286
286
  " on indexedDB " +
287
- n.database.Kd,
287
+ n.database.Sf,
288
288
  );
289
289
  }),
290
290
  (d.onsuccess = (t) => {
@@ -307,27 +307,27 @@ export default class et {
307
307
  for (const e in this.database.Ws) {
308
308
  const n = e;
309
309
  this.database.Ws.hasOwnProperty(e) &&
310
- this.database.Ws[n] !== this.database.Ws.pe &&
310
+ this.database.Ws[n] !== this.database.Ws.ke &&
311
311
  t.push(this.database.Ws[n]);
312
312
  }
313
313
  const e = this;
314
- return this.kd(function (n) {
314
+ return this.Bf(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.Bd.error(
320
+ e.df.error(
321
321
  "Could not clear " +
322
322
  this.source.name +
323
323
  " on indexedDB " +
324
- e.database.Kd,
324
+ e.database.Sf,
325
325
  );
326
326
  };
327
327
  }
328
328
  o.onerror = function () {
329
- e.Bd.error(
330
- "Could not clear object stores on indexedDB " + e.database.Kd,
329
+ e.df.error(
330
+ "Could not clear object stores on indexedDB " + e.database.Sf,
331
331
  );
332
332
  };
333
333
  });
@@ -335,18 +335,18 @@ export default class et {
335
335
  }
336
336
  et._s = {
337
337
  Xs: {
338
- Kd: "AppboyServiceWorkerAsyncStorage",
338
+ Sf: "AppboyServiceWorkerAsyncStorage",
339
339
  VERSION: 6,
340
340
  Ws: {
341
- Cn: "data",
342
- yr: "pushClicks",
341
+ Jh: "data",
342
+ Fr: "pushClicks",
343
343
  Gu: "pushSubscribed",
344
- Gd: "fallbackDevice",
344
+ Cf: "fallbackDevice",
345
345
  Vs: "cardUpdates",
346
- pe: "optOut",
347
- Br: "pendingData",
348
- wh: "sdkAuthenticationSignature",
346
+ ke: "optOut",
347
+ Dr: "pendingData",
348
+ ac: "sdkAuthenticationSignature",
349
349
  },
350
- be: 1,
350
+ ze: 1,
351
351
  },
352
352
  };