@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
@@ -1,66 +1,69 @@
1
- import Vt from "./auth-manager.js";
1
+ import mi from "./auth-manager.js";
2
2
  import t from "../common/base-provider.js";
3
- import ro from "../util/browser-detector.js";
4
- import Wt from "./device-manager.js";
3
+ import He from "./braze-action-manager.js";
4
+ import eo from "../util/browser-detector.js";
5
+ import li from "./device-manager.js";
5
6
  import DeviceProperties from "../Core/device-properties.js";
6
7
  import {
7
8
  isArray as g,
8
9
  keys as C,
9
- validateValueIsFromEnum as ta,
10
- values as Yt,
10
+ validateValueIsFromEnum as ra,
11
+ values as fi,
11
12
  } from "../util/code-utils.js";
12
- import Xt from "./network-manager.js";
13
- import Zt from "../request-controller.js";
14
- import li from "./server-config-manager.js";
15
- import fi from "./session-manager.js";
13
+ import di from "./network-manager.js";
14
+ import pi from "../request-controller.js";
15
+ import Ei from "./server-config-manager.js";
16
+ import Ii from "./session-manager.js";
16
17
  import ne, { STORAGE_KEYS as s } from "./storage-manager.js";
17
- import di from "./storage-manager-factory.js";
18
+ import _i from "./storage-manager-factory.js";
18
19
  import f from "./subscription-manager.js";
19
- import { TriggersProviderFactory as rt } from "../triggers/triggers-provider-factory.js";
20
- import dr from "../DUST/dust-provider-factory.js";
21
- import { subscribeToDust as mi } from "../DUST/subscribe-to-dust.js";
22
- import Ut from "../User/user-manager.js";
20
+ import { TriggersProviderFactory as ft } from "../triggers/triggers-provider-factory.js";
21
+ import nt from "../DUST/dust-provider-factory.js";
22
+ import { subscribeToDust as gi } from "../DUST/subscribe-to-dust.js";
23
+ import Nt from "../User/user-manager.js";
23
24
  import { User } from "../User/index.js";
24
- import { parseQueryStringKeyValues as pt } from "../util/url-utils.js";
25
+ import { parseQueryStringKeyValues as kt } from "../util/url-utils.js";
25
26
  import { WindowUtils as no } from "../util/window-utils.js";
26
27
  import { CoreStrings as R } from "../common/constants.js";
27
- import { SupportedOptions as pi, logger as b } from "../../shared-lib/index.js";
28
- import _t from "../models/identifier.js";
28
+ import { SupportedOptions as Si, logger as b } from "../../shared-lib/index.js";
29
+ import Ut from "../models/identifier.js";
29
30
  const U = {
30
- _h: "allowCrawlerActivity",
31
- Nh: "baseUrl",
32
- se: "cookieExpiryInDays",
33
- Oh: "noCookies",
34
- Th: "devicePropertyAllowlist",
35
- xa: "disablePushTokenMaintenance",
36
- Rh: "enableLogging",
37
- Ph: "enableSdkAuthentication",
38
- wa: "manageServiceWorkerExternally",
39
- Dh: "minimumIntervalBetweenTriggerActionsInSeconds",
40
- Lh: "sessionTimeoutInSeconds",
41
- yh: "appVersion",
42
- Mh: "appVersionNumber",
43
- za: "serviceWorkerLocation",
44
- ha: "safariWebsitePushId",
45
- Ma: "localization",
31
+ hl: "allowCrawlerActivity",
32
+ cl: "baseUrl",
33
+ xe: "cookieExpiryInDays",
34
+ ml: "noCookies",
35
+ fl: "devicePropertyAllowlist",
36
+ Oa: "disablePushTokenMaintenance",
37
+ El: "enableLogging",
38
+ Il: "enableSdkAuthentication",
39
+ Na: "manageServiceWorkerExternally",
40
+ _l: "minimumIntervalBetweenTriggerActionsInSeconds",
41
+ gl: "sessionTimeoutInSeconds",
42
+ Sl: "appVersion",
43
+ Al: "appVersionNumber",
44
+ Ha: "serviceWorkerLocation",
45
+ La: "safariWebsitePushId",
46
+ al: "localization",
46
47
  sr: "contentSecurityNonce",
47
48
  nr: "allowUserSuppliedJavascript",
48
- ca: "inAppMessageZIndex",
49
- da: "openInAppMessagesInNewTab",
49
+ Ee: "inAppMessageZIndex",
50
+ Te: "conversationalChatZIndex",
51
+ Ja: "openInAppMessagesInNewTab",
50
52
  tn: "openCardsInNewTab",
51
- lh: "requireExplicitInAppMessageDismissal",
52
- Uh: "doNotLoadFontAwesome",
53
- Wh: "deviceId",
54
- ba: "serviceWorkerScope",
55
- Oi: "dustHost",
56
- Bh: "sdkFlavor",
53
+ Zh: "requireExplicitInAppMessageDismissal",
54
+ vl: "doNotLoadFontAwesome",
55
+ Nl: "deviceId",
56
+ Ka: "serviceWorkerScope",
57
+ _e: "dustHost",
58
+ Ol: "sdkFlavor",
57
59
  };
58
- class Ei {
60
+ class Ai {
59
61
  constructor() {
60
62
  (this.eu = ""),
61
- (this.Vh = ""),
62
- (this.Kh = void 0),
63
- (this.Gh = null),
63
+ (this.Tl = ""),
64
+ (this.wl = void 0),
65
+ (this.Cl = null),
66
+ (this.bl = null),
64
67
  (this.tu = null),
65
68
  (this.B = null),
66
69
  (this.Ru = null),
@@ -68,30 +71,30 @@ class Ei {
68
71
  (this.C = null),
69
72
  (this.j = null),
70
73
  (this.Ss = null),
71
- (this.Yh = ""),
74
+ (this.Rl = ""),
72
75
  (this.isInitialized = !1),
73
- (this.$h = !1),
74
- (this.qh = new f()),
75
- (this.Hh = new f()),
76
+ (this.Pl = !1),
77
+ (this.Dl = new f()),
78
+ (this.Ll = new f()),
76
79
  (this.options = {}),
77
- (this.Jh = []),
78
- (this.Xh = []),
79
- (this.In = []),
80
- (this.Vh = "6.12.1");
80
+ (this.jl = []),
81
+ (this.yl = []),
82
+ (this.So = []),
83
+ (this.Tl = "6.13.0");
81
84
  }
82
- Zh(t) {
83
- this.qh.Ut(t);
85
+ Ml(t) {
86
+ this.Dl.Ut(t);
84
87
  }
85
- ah(t) {
86
- this.Hh.Ut(t);
88
+ On(t) {
89
+ this.Ll.Ut(t);
87
90
  }
88
91
  initialize(t, i) {
89
92
  var e, r, o;
90
- if (this.ao())
93
+ if (this.vr())
91
94
  return b.info("Braze has already been initialized with an API key."), !0;
92
95
  this.options = i || {};
93
- let n = this.er(U.Rh);
94
- const h = pt(no.Qh());
96
+ let n = this.er(U.El);
97
+ const h = kt(no.Ul());
95
98
  if (
96
99
  (h && "true" === h.brazeLogging && (n = !0),
97
100
  b.init(n),
@@ -102,52 +105,52 @@ class Ei {
102
105
  )
103
106
  return b.error("Braze requires a valid API key to be initialized."), !1;
104
107
  this.eu = t;
105
- let l = this.er(U.Nh);
106
- if (null == l || "" === l || "string" != typeof l)
108
+ let a = this.er(U.cl);
109
+ if (null == a || "" === a || "string" != typeof a)
107
110
  return b.error("Braze requires a valid baseUrl to be initialized."), !1;
108
- !1 === /^https?:/.test(l) && (l = `https://${l}`);
109
- const a = l;
111
+ !1 === /^https?:/.test(a) && (a = `https://${a}`);
112
+ const l = a;
110
113
  if (
111
- ((l = document.createElement("a")),
112
- (l.href = a),
113
- "/" === l.pathname && (l = `${l}api/v3`),
114
- (this.Yh = l.toString()),
115
- ro.il && !this.er(U._h))
114
+ ((a = document.createElement("a")),
115
+ (a.href = l),
116
+ "/" === a.pathname && (a = `${a}api/v3`),
117
+ (this.Rl = a.toString()),
118
+ eo.kl && !this.er(U.hl))
116
119
  )
117
120
  return (
118
121
  b.info("Ignoring activity from crawler bot " + navigator.userAgent),
119
- (this.$h = !0),
122
+ (this.Pl = !0),
120
123
  !1
121
124
  );
122
- const u = this.er(U.Oh) || !1,
123
- c = this.er(U.se),
124
- d = di.sl();
125
+ const u = this.er(U.ml) || !1,
126
+ c = this.er(U.xe),
127
+ m = _i.zl();
125
128
  if (
126
- ((this.j = di.rl(t, u, c)),
127
- u && this.j.hl(t),
128
- new ne.le(null, !0).wr(s.ce))
129
+ ((this.j = _i.Bl(t, u, c)),
130
+ u && this.j.Vl(t),
131
+ new ne.De(null, !0).wr(s.Se))
129
132
  )
130
133
  return (
131
134
  b.info("Ignoring all activity due to previous opt out"),
132
- (this.$h = !0),
135
+ (this.Pl = !0),
133
136
  !1
134
137
  );
135
138
  for (const t of C(this.options))
136
- -1 === Yt(pi).indexOf(t) &&
139
+ -1 === fi(Si).indexOf(t) &&
137
140
  b.warn(`Ignoring unknown initialization option '${t}'.`);
138
- const m = ["mparticle", "wordpress", "tealium"];
139
- if (null != this.er(U.Bh)) {
140
- const t = this.er(U.Bh);
141
- -1 !== m.indexOf(t)
142
- ? (this.Kh = t)
141
+ const d = ["mparticle", "wordpress", "tealium"];
142
+ if (null != this.er(U.Ol)) {
143
+ const t = this.er(U.Ol);
144
+ -1 !== d.indexOf(t)
145
+ ? (this.wl = t)
143
146
  : b.error("Invalid sdk flavor passed: " + t);
144
147
  }
145
- let p = this.er(pi.Th);
148
+ let p = this.er(Si.fl);
146
149
  if (null != p)
147
150
  if (g(p)) {
148
151
  const t = [];
149
152
  for (let i = 0; i < p.length; i++)
150
- ta(
153
+ ra(
151
154
  DeviceProperties,
152
155
  p[i],
153
156
  "devicePropertyAllowlist contained an invalid value.",
@@ -159,59 +162,60 @@ class Ei {
159
162
  "devicePropertyAllowlist must be an array. Defaulting to all properties.",
160
163
  ),
161
164
  (p = null);
162
- const E = this.er(U.Wh);
165
+ const E = this.er(U.Nl);
163
166
  if (E) {
164
- const t = new _t(E);
165
- this.j.Ju(s.Ou.Wh, t);
167
+ const t = new Ut(E);
168
+ this.j.Ju(s.Ou.Nl, t);
166
169
  }
167
- (this.tu = new Wt(this.j, p)),
168
- (this.h = new li(this.j)),
169
- (this.Ss = new Ut(this.h, this.j)),
170
- (this.C = new fi(this.j, this.Ss, this.h, this.er(U.Lh)));
170
+ (this.tu = new li(this.j, p)),
171
+ (this.bl = new He()),
172
+ (this.h = new Ei(this.j)),
173
+ (this.Ss = new Nt(this.h, this.j)),
174
+ (this.C = new Ii(this.j, this.Ss, this.h, this.er(U.gl)));
171
175
  const I = new f();
172
- (this.Gh = new Vt(this.j, this.er(U.Ph), I)),
176
+ (this.Cl = new mi(this.j, this.er(U.Il), I)),
173
177
  this.S(I),
174
- (this.B = new Xt(
178
+ (this.B = new di(
175
179
  this.tu,
176
180
  this.j,
177
- this.Gh,
181
+ this.Cl,
178
182
  this.Ss,
179
183
  this.C,
180
184
  this.h,
181
185
  this.eu,
182
- this.Yh,
183
- this.Vh,
184
- this.Kh || "",
185
- this.er(U.yh),
186
- this.er(U.Mh),
186
+ this.Rl,
187
+ this.Tl,
188
+ this.wl || "",
189
+ this.er(U.Sl),
190
+ this.er(U.Al),
187
191
  )),
188
- (this.Ru = new Zt(
192
+ (this.Ru = new pi(
189
193
  this.eu,
190
- this.Yh,
194
+ this.Rl,
191
195
  this.C,
192
196
  this.tu,
193
197
  this.Ss,
194
198
  this.h,
195
199
  this.j,
196
200
  (t) => {
197
- if (this.ao()) for (const i of this.vr()) i.q(t);
201
+ if (this.vr()) for (const i of this.$r()) i.q(t);
198
202
  },
199
- this.Gh,
203
+ this.Cl,
200
204
  this.B,
201
205
  )),
202
206
  this.Ru.initialize(),
203
- u || this.j.ll(),
207
+ u || this.j.Wl(),
204
208
  b.info(
205
209
  `Initialized for the Braze backend at "${this.er(
206
- U.Nh,
210
+ U.cl,
207
211
  )}" with API key "${this.eu}".`,
208
212
  ),
209
- rt.t(),
210
- mi(),
211
- this.h.do(() => {
213
+ ft.t(),
214
+ gi(),
215
+ this.h.po(() => {
212
216
  var t;
213
217
  this.isInitialized &&
214
- (null === (t = this.h) || void 0 === t ? void 0 : t.Kr()) &&
218
+ (null === (t = this.h) || void 0 === t ? void 0 : t.Qr()) &&
215
219
  import("../FeatureFlags/refresh-feature-flags.js").then((t) => {
216
220
  if (!this.isInitialized) return;
217
221
  (0, t.default)();
@@ -220,70 +224,74 @@ class Ei {
220
224
  this.Ru.rn(() => {
221
225
  var t;
222
226
  this.isInitialized &&
223
- (null === (t = this.h) || void 0 === t ? void 0 : t.Kr()) &&
227
+ (null === (t = this.h) || void 0 === t ? void 0 : t.Qr()) &&
224
228
  import("../FeatureFlags/refresh-feature-flags.js").then((t) => {
225
229
  if (!this.isInitialized) return;
226
230
  (0, t.default)(void 0, void 0, !0);
227
231
  });
228
232
  }),
229
- this.qh.A(this.options),
233
+ this.Dl.A(this.options),
230
234
  (this.isInitialized = !0),
231
235
  window.dispatchEvent(new CustomEvent("braze.initialized")),
232
236
  this.ar("tgr", () => {
233
237
  var t;
234
- null === (t = this.Ru) || void 0 === t || t.Ar(void 0, void 0, "dust");
238
+ null === (t = this.Ru) || void 0 === t || t.Br(void 0, void 0, "dust");
235
239
  });
236
- const _ = null === (e = this.C) || void 0 === e ? void 0 : e.al();
240
+ const _ = null === (e = this.C) || void 0 === e ? void 0 : e.Kl();
237
241
  return (
238
- d ||
242
+ m ||
239
243
  null == _ ||
240
244
  (null === (r = this.C) || void 0 === r
241
245
  ? void 0
242
- : r.ul(new Date().valueOf(), _)) ||
246
+ : r.Fl(new Date().valueOf(), _)) ||
243
247
  null === (o = this.Ru) ||
244
248
  void 0 === o ||
245
- o.Ar(),
249
+ o.Br(),
246
250
  !0
247
251
  );
248
252
  }
249
253
  destroy(t) {
250
- if ((b.destroy(), this.ao())) {
251
- this.Hh.A(), this.Hh.removeAllSubscriptions();
252
- for (const t of this.Jh) t.destroy();
253
- this.Jh = [];
254
- for (const t of this.Xh) t.clearData(!1);
254
+ if ((b.destroy(), this.vr())) {
255
+ this.Ll.A(), this.Ll.removeAllSubscriptions();
256
+ for (const t of this.jl) t.destroy();
257
+ this.jl = [];
258
+ for (const t of this.yl) t.clearData(!1);
255
259
  this.B && this.B.fo(),
256
- (this.Xh = []),
260
+ (this.yl = []),
257
261
  this.removeAllSubscriptions(),
258
- (this.In = []),
262
+ (this.So = []),
259
263
  null != this.Ru && this.Ru.destroy(),
260
264
  (this.Ru = null),
261
- (this.Gh = null),
265
+ (this.Cl = null),
266
+ (this.bl = null),
262
267
  (this.tu = null),
263
268
  (this.B = null),
264
269
  (this.h = null),
265
270
  (this.C = null),
266
271
  (this.Ss = null),
267
272
  (this.options = {}),
268
- (this.Kh = void 0),
273
+ (this.wl = void 0),
269
274
  (this.isInitialized = !1),
270
- (this.$h = !1),
275
+ (this.Pl = !1),
271
276
  t && (this.j = null);
272
277
  }
273
278
  }
274
279
  rr() {
275
- return !this.cl() && (!!this.ao() || (console.warn(R.ee), !1));
280
+ return !this.Gl() && (!!this.vr() || (console.warn(R.ee), !1));
276
281
  }
277
- ja() {
282
+ Fa() {
278
283
  return this.eu;
279
284
  }
280
- Er() {
281
- return this.Gh;
285
+ Gr() {
286
+ return this.Cl;
282
287
  }
283
288
  ht() {
284
- return this.Yh;
289
+ return this.Rl;
285
290
  }
286
- ue() {
291
+ br() {
292
+ return this.bl;
293
+ }
294
+ Ie() {
287
295
  return this.tu;
288
296
  }
289
297
  m() {
@@ -292,8 +300,8 @@ class Ei {
292
300
  er(t) {
293
301
  return this.options[t];
294
302
  }
295
- vr() {
296
- return this.Xh;
303
+ $r() {
304
+ return this.yl;
297
305
  }
298
306
  nn() {
299
307
  return this.Ru;
@@ -318,39 +326,39 @@ class Ei {
318
326
  }
319
327
  g(t) {
320
328
  let i = !1;
321
- for (const s of this.Jh) s === t && (i = !0);
322
- i || this.Jh.push(t);
329
+ for (const s of this.jl) s === t && (i = !0);
330
+ i || this.jl.push(t);
323
331
  }
324
332
  v(i) {
325
333
  let s = !1;
326
- for (const t of this.Xh) t.constructor === i.constructor && (s = !0);
327
- i instanceof t && !s && this.Xh.push(i);
334
+ for (const t of this.yl) t.constructor === i.constructor && (s = !0);
335
+ i instanceof t && !s && this.yl.push(i);
328
336
  }
329
337
  S(t) {
330
- t instanceof f && this.In.push(t);
338
+ t instanceof f && this.So.push(t);
331
339
  }
332
340
  removeAllSubscriptions() {
333
- if (this.rr()) for (const t of this.In) t.removeAllSubscriptions();
341
+ if (this.rr()) for (const t of this.So) t.removeAllSubscriptions();
334
342
  }
335
343
  removeSubscription(t) {
336
- if (this.rr()) for (const i of this.In) i.removeSubscription(t);
344
+ if (this.rr()) for (const i of this.So) i.removeSubscription(t);
337
345
  }
338
- fe(t) {
339
- this.$h = t;
346
+ qe(t) {
347
+ this.Pl = t;
340
348
  }
341
- ao() {
349
+ vr() {
342
350
  return this.isInitialized;
343
351
  }
344
- cl() {
345
- return this.$h;
352
+ Gl() {
353
+ return this.Pl;
346
354
  }
347
355
  ar(t, i) {
348
356
  if (!this.rr()) return null;
349
- return dr.o().mn(t, i);
357
+ return nt.o().Mh(t, i);
350
358
  }
351
359
  qi() {
352
- return this.Vh;
360
+ return this.Tl;
353
361
  }
354
362
  }
355
- const r = new Ei();
356
- export { r as default, Ei as BrazeSdkInstance, U as OPTIONS };
363
+ const r = new Ai();
364
+ export { r as default, Ai as BrazeSdkInstance, U as OPTIONS };
@@ -1,55 +1,55 @@
1
- import ro from "../util/browser-detector.js";
1
+ import eo from "../util/browser-detector.js";
2
2
  import ke from "../models/device.js";
3
3
  import DeviceProperties from "../Core/device-properties.js";
4
- import _t from "../models/identifier.js";
4
+ import Ut from "../models/identifier.js";
5
5
  import { logger as b, Guid as V } from "../../shared-lib/index.js";
6
6
  import { STORAGE_KEYS as s } from "../managers/storage-manager.js";
7
- import { values as Yt } from "../util/code-utils.js";
7
+ import { values as fi } from "../util/code-utils.js";
8
8
  import { getErrorMessage as ci } from "../util/error-utils.js";
9
- export default class Wt {
9
+ export default class li {
10
10
  constructor(t, e) {
11
11
  (this.j = t),
12
- (this.Da = e),
12
+ (this.fc = e),
13
13
  (this.j = t),
14
- null == e && (e = Yt(DeviceProperties)),
15
- (this.Da = e);
14
+ null == e && (e = fi(DeviceProperties)),
15
+ (this.fc = e);
16
16
  }
17
- ve(t = !0) {
18
- let e = this.j.$u(s.Ou.Wh);
19
- null == e && ((e = new _t(V.de())), t && this.j.Ju(s.Ou.Wh, e));
17
+ Ye(t = !0) {
18
+ let e = this.j.$u(s.Ou.Nl);
19
+ null == e && ((e = new Ut(V.de())), t && this.j.Ju(s.Ou.Nl, e));
20
20
  const r = new ke(e.Iu);
21
- for (let t = 0; t < this.Da.length; t++) {
22
- switch (this.Da[t]) {
21
+ for (let t = 0; t < this.fc.length; t++) {
22
+ switch (this.fc[t]) {
23
23
  case DeviceProperties.BROWSER:
24
- r.browser = ro.browser;
24
+ r.browser = eo.browser;
25
25
  break;
26
26
  case DeviceProperties.BROWSER_VERSION:
27
- r.Oa = ro.version;
27
+ r.dc = eo.version;
28
28
  break;
29
29
  case DeviceProperties.OS:
30
- r.os = this.Fa();
30
+ r.os = this.jc();
31
31
  break;
32
32
  case DeviceProperties.RESOLUTION:
33
- r.Ga = screen.width + "x" + screen.height;
33
+ r.kc = screen.width + "x" + screen.height;
34
34
  break;
35
35
  case DeviceProperties.LANGUAGE:
36
- r.language = ro.language;
36
+ r.language = eo.language;
37
37
  break;
38
38
  case DeviceProperties.TIME_ZONE:
39
- r.timeZone = this.Ja(new Date());
39
+ r.timeZone = this.wc(new Date());
40
40
  break;
41
41
  case DeviceProperties.USER_AGENT:
42
- r.userAgent = ro.userAgent;
42
+ r.userAgent = eo.userAgent;
43
43
  }
44
44
  }
45
45
  return r;
46
46
  }
47
- Fa() {
48
- if (ro.qa()) return ro.qa();
49
- const t = this.j.St(s.It.Aa);
50
- return t && t.os_version ? t.os_version : ro.Fa();
47
+ jc() {
48
+ if (eo.Ic()) return eo.Ic();
49
+ const t = this.j.St(s.It.Mc);
50
+ return t && t.os_version ? t.os_version : eo.jc();
51
51
  }
52
- Ja(t) {
52
+ wc(t) {
53
53
  let e = !1;
54
54
  if ("undefined" != typeof Intl && "function" == typeof Intl.DateTimeFormat)
55
55
  try {
@@ -66,9 +66,9 @@ export default class Wt {
66
66
  }
67
67
  if (e) return "";
68
68
  const r = t.getTimezoneOffset();
69
- return this.Ba(r);
69
+ return this.Tc(r);
70
70
  }
71
- Ba(t) {
71
+ Tc(t) {
72
72
  const e = Math.trunc(t / 60),
73
73
  r = Math.trunc(t % 60);
74
74
  let s = "GMT";