@braze/web-sdk 5.7.0 → 5.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 (142) hide show
  1. package/index.d.ts +4 -4
  2. package/package.json +1 -1
  3. package/shared-lib/encoding-utils.js +1 -1
  4. package/shared-lib/event-types.js +23 -23
  5. package/shared-lib/guid.js +1 -1
  6. package/shared-lib/indexed-db-adapter.js +21 -21
  7. package/shared-lib/logger.js +2 -2
  8. package/shared-lib/supported-options.js +18 -18
  9. package/src/Banner/banner-provider.js +79 -79
  10. package/src/Banner/banner.js +9 -9
  11. package/src/Banner/display/banner-to-html.js +2 -2
  12. package/src/Banner/get-all-banners.js +3 -4
  13. package/src/Banner/get-banner.js +11 -11
  14. package/src/Banner/log-banner-click.js +2 -2
  15. package/src/Banner/log-banner-impressions.js +4 -4
  16. package/src/Banner/request-banners-refresh.js +21 -13
  17. package/src/Banner/subscribe-to-banners-updates.js +14 -13
  18. package/src/Banner/ui/insert-banner.js +11 -9
  19. package/src/Card/card-manager.js +35 -35
  20. package/src/Card/display/card-display.js +8 -8
  21. package/src/Card/log-card-click.js +1 -1
  22. package/src/Card/log-card-dismissal.js +1 -1
  23. package/src/Card/log-card-impressions.js +3 -3
  24. package/src/Card/models/captioned-image.js +21 -21
  25. package/src/Card/models/card.js +92 -92
  26. package/src/Card/models/classic-card.js +21 -21
  27. package/src/Card/models/control-card.js +11 -11
  28. package/src/Card/models/image-only.js +19 -19
  29. package/src/Card/util/card-factory.js +39 -39
  30. package/src/ContentCards/content-cards-provider-factory.js +1 -1
  31. package/src/ContentCards/content-cards-provider.js +142 -142
  32. package/src/ContentCards/content-cards.js +3 -3
  33. package/src/ContentCards/get-cached-content-cards.js +1 -1
  34. package/src/ContentCards/request-content-cards-refresh.js +1 -1
  35. package/src/ContentCards/subscribe-to-content-cards-updates.js +4 -4
  36. package/src/ContentCards/ui/show-content-cards.js +8 -8
  37. package/src/Core/add-sdk-metadata.js +2 -2
  38. package/src/Core/change-user.js +3 -3
  39. package/src/Core/disable-sdk.js +7 -7
  40. package/src/Core/enable-sdk.js +5 -5
  41. package/src/Core/get-device-id.js +2 -2
  42. package/src/Core/get-user.js +1 -1
  43. package/src/Core/handle-braze-action.js +2 -2
  44. package/src/Core/is-disabled.js +2 -2
  45. package/src/Core/is-initialized.js +1 -1
  46. package/src/Core/log-custom-event.js +5 -5
  47. package/src/Core/log-purchase.js +4 -4
  48. package/src/Core/open-session.js +7 -7
  49. package/src/Core/wipe-data.js +3 -3
  50. package/src/FeatureFlags/feature-flag-factory.js +10 -10
  51. package/src/FeatureFlags/feature-flag.js +19 -19
  52. package/src/FeatureFlags/feature-flags-provider.js +61 -61
  53. package/src/FeatureFlags/get-all-feature-flags.js +6 -7
  54. package/src/FeatureFlags/get-feature-flag.js +5 -6
  55. package/src/FeatureFlags/log-feature-flag-impression.js +4 -4
  56. package/src/FeatureFlags/subscribe-to-feature-flags-updates.js +2 -2
  57. package/src/Feed/feed-provider.js +41 -41
  58. package/src/Feed/feed.js +2 -2
  59. package/src/Feed/get-cached-feed.js +1 -1
  60. package/src/Feed/log-feed-displayed.js +1 -1
  61. package/src/Feed/request-feed-refresh.js +1 -1
  62. package/src/Feed/subscribe-to-feed-updates.js +1 -1
  63. package/src/Feed/ui/show-feed.js +5 -5
  64. package/src/InAppMessage/defer-in-app-message.js +1 -1
  65. package/src/InAppMessage/display/html-message-to-html.js +6 -6
  66. package/src/InAppMessage/display/in-app-message-to-html.js +20 -20
  67. package/src/InAppMessage/display/modal-utils.js +4 -4
  68. package/src/InAppMessage/in-app-message-factory.js +7 -7
  69. package/src/InAppMessage/in-app-message-manager-factory.js +1 -1
  70. package/src/InAppMessage/in-app-message-manager.js +89 -89
  71. package/src/InAppMessage/log-in-app-message-button-click.js +6 -6
  72. package/src/InAppMessage/log-in-app-message-click.js +5 -5
  73. package/src/InAppMessage/log-in-app-message-html-click.js +7 -7
  74. package/src/InAppMessage/log-in-app-message-impression.js +2 -2
  75. package/src/InAppMessage/models/control-message.js +5 -5
  76. package/src/InAppMessage/models/full-screen-message.js +34 -34
  77. package/src/InAppMessage/models/html-message.js +20 -20
  78. package/src/InAppMessage/models/in-app-message-button.js +8 -8
  79. package/src/InAppMessage/models/in-app-message.js +83 -83
  80. package/src/InAppMessage/models/modal-message.js +33 -33
  81. package/src/InAppMessage/models/slide-up-message.js +30 -30
  82. package/src/InAppMessage/models/templated-in-app-message.js +8 -8
  83. package/src/InAppMessage/subscribe-to-in-app-message.js +1 -1
  84. package/src/InAppMessage/ui/automatically-show-in-app-messages.js +3 -3
  85. package/src/InAppMessage/ui/show-in-app-message.js +19 -19
  86. package/src/Push/push-manager-factory.js +8 -8
  87. package/src/Push/push-manager.js +96 -96
  88. package/src/Push/utils/push-utils.js +4 -4
  89. package/src/User/user-manager.js +19 -19
  90. package/src/User/user.js +41 -41
  91. package/src/common/base-feed.js +3 -3
  92. package/src/common/base-provider.js +1 -1
  93. package/src/common/event-logger.js +6 -6
  94. package/src/common/feed-display.js +10 -10
  95. package/src/l10n/l10n-manager-factory.js +2 -2
  96. package/src/l10n/l10n-manager.js +1 -1
  97. package/src/managers/auth-manager.js +31 -31
  98. package/src/managers/braze-instance.js +139 -139
  99. package/src/managers/device-manager.js +24 -24
  100. package/src/managers/network-manager.js +151 -151
  101. package/src/managers/server-config-manager.js +86 -86
  102. package/src/managers/session-manager.js +38 -38
  103. package/src/managers/storage-manager-factory.js +12 -12
  104. package/src/managers/storage-manager.js +96 -96
  105. package/src/managers/subscription-manager.js +10 -10
  106. package/src/managers/utils.js +4 -4
  107. package/src/models/backend-errors.js +5 -5
  108. package/src/models/braze-event.js +4 -4
  109. package/src/models/device.js +2 -2
  110. package/src/models/identifier.js +12 -12
  111. package/src/models/push-token.js +8 -8
  112. package/src/models/request-result.js +3 -3
  113. package/src/models/server-config.js +31 -31
  114. package/src/request-controller.js +152 -152
  115. package/src/triggers/models/custom-event-data.js +1 -1
  116. package/src/triggers/models/custom-event-property-data.js +2 -2
  117. package/src/triggers/models/filter-set.js +6 -6
  118. package/src/triggers/models/filter.js +2 -2
  119. package/src/triggers/models/in-app-message-click-data.js +1 -1
  120. package/src/triggers/models/purchase-data.js +1 -1
  121. package/src/triggers/models/purchase-property-data.js +2 -2
  122. package/src/triggers/models/push-click-data.js +1 -1
  123. package/src/triggers/models/trigger-condition.js +33 -33
  124. package/src/triggers/models/trigger-events.js +3 -3
  125. package/src/triggers/models/trigger.js +11 -11
  126. package/src/triggers/triggers-provider-factory.js +3 -3
  127. package/src/triggers/triggers-provider.js +74 -74
  128. package/src/ui/js/attach-css.js +3 -3
  129. package/src/ui/js/load-font-awesome.js +2 -2
  130. package/src/util/base-device-parser.js +3 -3
  131. package/src/util/braze-actions.js +4 -4
  132. package/src/util/browser-detector.js +5 -5
  133. package/src/util/client-hints-parser.js +1 -1
  134. package/src/util/component-utils.js +1 -1
  135. package/src/util/dom-utils.js +7 -7
  136. package/src/util/html-display-utils.js +6 -6
  137. package/src/util/key-codes.js +1 -1
  138. package/src/util/net.js +6 -6
  139. package/src/util/request-header-utils.js +21 -21
  140. package/src/util/user-agent-parser.js +1 -1
  141. package/src/util/validation-utils.js +4 -4
  142. package/src/util/window-utils.js +1 -1
@@ -1,10 +1,10 @@
1
1
  import kt from "./auth-manager.js";
2
- import s from "../common/base-provider.js";
2
+ import t from "../common/base-provider.js";
3
3
  import ro from "../util/browser-detector.js";
4
4
  import Ot from "./device-manager.js";
5
5
  import DeviceProperties from "../Core/device-properties.js";
6
6
  import {
7
- isArray as w,
7
+ isArray as z,
8
8
  keys as y,
9
9
  validateValueIsFromEnum as ta,
10
10
  values as Rt,
@@ -13,7 +13,7 @@ import Pt from "./network-manager.js";
13
13
  import Lt from "../request-controller.js";
14
14
  import Mt from "./server-config-manager.js";
15
15
  import Wt from "./session-manager.js";
16
- import ne, { STORAGE_KEYS as t } from "./storage-manager.js";
16
+ import ne, { STORAGE_KEYS as s } from "./storage-manager.js";
17
17
  import Bt from "./storage-manager-factory.js";
18
18
  import u from "./subscription-manager.js";
19
19
  import { TriggersProviderFactory as ot } from "../triggers/triggers-provider-factory.js";
@@ -24,81 +24,81 @@ import { WindowUtils as no } from "../util/window-utils.js";
24
24
  import { BRAZE_MUST_BE_INITIALIZED_ERROR as p } from "../common/constants.js";
25
25
  import { SupportedOptions as zt, logger as N } from "../../shared-lib/index.js";
26
26
  import _t from "../models/identifier.js";
27
- const z = {
28
- Oo: "allowCrawlerActivity",
29
- Wo: "baseUrl",
30
- Vo: "noCookies",
31
- Ko: "devicePropertyAllowlist",
27
+ const w = {
28
+ Yo: "allowCrawlerActivity",
29
+ Zo: "baseUrl",
30
+ Wh: "noCookies",
31
+ Vh: "devicePropertyAllowlist",
32
32
  Da: "disablePushTokenMaintenance",
33
- Yo: "enableLogging",
34
- Ho: "enableSdkAuthentication",
33
+ Kh: "enableLogging",
34
+ $h: "enableSdkAuthentication",
35
35
  Ca: "manageServiceWorkerExternally",
36
- Xo: "minimumIntervalBetweenTriggerActionsInSeconds",
37
- Zo: "sessionTimeoutInSeconds",
38
- Qo: "appVersion",
39
- Wh: "appVersionNumber",
36
+ Yh: "minimumIntervalBetweenTriggerActionsInSeconds",
37
+ Xh: "sessionTimeoutInSeconds",
38
+ Zh: "appVersion",
39
+ Qh: "appVersionNumber",
40
40
  _a: "serviceWorkerLocation",
41
41
  Ba: "safariWebsitePushId",
42
- Ea: "localization",
43
- ir: "contentSecurityNonce",
44
- er: "allowUserSuppliedJavascript",
45
- Do: "inAppMessageZIndex",
46
- To: "openInAppMessagesInNewTab",
42
+ Xn: "localization",
43
+ er: "contentSecurityNonce",
44
+ re: "allowUserSuppliedJavascript",
45
+ No: "inAppMessageZIndex",
46
+ Ko: "openInAppMessagesInNewTab",
47
47
  tn: "openCardsInNewTab",
48
48
  en: "openNewsFeedCardsInNewTab",
49
49
  mh: "requireExplicitInAppMessageDismissal",
50
- Vh: "doNotLoadFontAwesome",
51
- $h: "deviceId",
50
+ Ea: "doNotLoadFontAwesome",
51
+ Ia: "deviceId",
52
52
  Aa: "serviceWorkerScope",
53
- Yh: "sdkFlavor",
53
+ Na: "sdkFlavor",
54
54
  };
55
55
  class Vt {
56
56
  constructor() {
57
- (this.fn = ""),
58
- (this.Xh = ""),
59
- (this.Zh = void 0),
60
- (this.Qh = null),
61
- (this.dn = null),
57
+ (this.un = ""),
58
+ (this.Oa = ""),
59
+ (this.Ta = void 0),
60
+ (this.Ra = null),
61
+ (this.an = null),
62
62
  (this.S = null),
63
- (this.Bi = null),
63
+ (this.Fi = null),
64
64
  (this.B = null),
65
65
  (this.T = null),
66
66
  (this.C = null),
67
- (this.As = null),
68
- (this.Ia = ""),
67
+ (this.Cs = null),
68
+ (this.Pa = ""),
69
69
  (this.isInitialized = !1),
70
- (this.Na = !1),
71
- (this.Oa = new u()),
72
- (this.Ta = new u()),
70
+ (this.La = !1),
71
+ (this.Ua = new u()),
72
+ (this.Wa = new u()),
73
73
  (this.options = {}),
74
- (this.Ra = []),
75
- (this.Pa = []),
76
- (this._i = []),
77
- (this.Xh = "5.7.0");
74
+ (this.Va = []),
75
+ (this.Fa = []),
76
+ (this.Mi = []),
77
+ (this.Oa = "5.8.1");
78
78
  }
79
- La(t) {
80
- this.Oa.Fs(t);
79
+ Ka(t) {
80
+ this.Ua.Ft(t);
81
81
  }
82
82
  Nh(t) {
83
- this.Ta.Fs(t);
83
+ this.Wa.Ft(t);
84
84
  }
85
- initialize(i, s) {
86
- if (this.nt())
85
+ initialize(t, i) {
86
+ if (this._t())
87
87
  return N.info("Braze has already been initialized with an API key."), !0;
88
- this.options = s || {};
89
- let e = this.sr(z.Yo);
90
- const r = ll(no.Ua());
88
+ this.options = i || {};
89
+ let e = this.ee(w.Kh);
90
+ const r = ll(no.Ga());
91
91
  if (
92
92
  (r && "true" === r.brazeLogging && (e = !0),
93
93
  N.init(e),
94
94
  N.info(
95
95
  `Initialization Options: ${JSON.stringify(this.options, null, 2)}`,
96
96
  ),
97
- null == i || "" === i || "string" != typeof i)
97
+ null == t || "" === t || "string" != typeof t)
98
98
  )
99
99
  return N.error("Braze requires a valid API key to be initialized."), !1;
100
- this.fn = i;
101
- let n = this.sr(z.Wo);
100
+ this.un = t;
101
+ let n = this.ee(w.Zo);
102
102
  if (null == n || "" === n || "string" != typeof n)
103
103
  return N.error("Braze requires a valid baseUrl to be initialized."), !1;
104
104
  !1 === /^https?:/.test(n) && (n = `https://${n}`);
@@ -107,36 +107,36 @@ class Vt {
107
107
  ((n = document.createElement("a")),
108
108
  (n.href = o),
109
109
  "/" === n.pathname && (n = `${n}api/v3`),
110
- (this.Ia = n.toString()),
111
- ro.Wa && !this.sr(z.Oo))
110
+ (this.Pa = n.toString()),
111
+ ro.$a && !this.ee(w.Yo))
112
112
  )
113
113
  return (
114
114
  N.info("Ignoring activity from crawler bot " + navigator.userAgent),
115
- (this.Na = !0),
115
+ (this.La = !0),
116
116
  !1
117
117
  );
118
- const h = this.sr(z.Vo) || !1;
118
+ const h = this.ee(w.Wh) || !1;
119
119
  if (
120
- ((this.C = Bt.Va(i, h)), h && this.C.Fa(i), new ne.ne(null, !0).gr(t.ae))
120
+ ((this.C = Bt.Ja(t, h)), h && this.C.Ya(t), new ne.se(null, !0).gr(s.me))
121
121
  )
122
122
  return (
123
123
  N.info("Ignoring all activity due to previous opt out"),
124
- (this.Na = !0),
124
+ (this.La = !0),
125
125
  !1
126
126
  );
127
127
  for (const t of y(this.options))
128
128
  -1 === Rt(zt).indexOf(t) &&
129
129
  N.warn(`Ignoring unknown initialization option '${t}'.`);
130
130
  const a = ["mparticle", "wordpress", "tealium"];
131
- if (null != this.sr(z.Yh)) {
132
- const t = this.sr(z.Yh);
131
+ if (null != this.ee(w.Na)) {
132
+ const t = this.ee(w.Na);
133
133
  -1 !== a.indexOf(t)
134
- ? (this.Zh = t)
134
+ ? (this.Ta = t)
135
135
  : N.error("Invalid sdk flavor passed: " + t);
136
136
  }
137
- let l = this.sr(zt.Ko);
137
+ let l = this.ee(zt.Vh);
138
138
  if (null != l)
139
- if (w(l)) {
139
+ if (z(l)) {
140
140
  const t = [];
141
141
  for (let i = 0; i < l.length; i++)
142
142
  ta(
@@ -151,129 +151,129 @@ class Vt {
151
151
  "devicePropertyAllowlist must be an array. Defaulting to all properties.",
152
152
  ),
153
153
  (l = null);
154
- const c = this.sr(z.$h);
154
+ const c = this.ee(w.Ia);
155
155
  if (c) {
156
- const i = new _t(c);
157
- this.C.uu(t.iu.$h, i);
156
+ const t = new _t(c);
157
+ this.C.uu(s.iu.Ia, t);
158
158
  }
159
- (this.dn = new Ot(this.C, l)),
159
+ (this.an = new Ot(this.C, l)),
160
160
  (this.B = new Mt(this.C)),
161
- (this.As = new bt(this.B, this.C)),
162
- (this.T = new Wt(this.C, this.As, this.B, this.sr(z.Zo)));
161
+ (this.Cs = new bt(this.B, this.C)),
162
+ (this.T = new Wt(this.C, this.Cs, this.B, this.ee(w.Xh)));
163
163
  const f = new u();
164
164
  return (
165
- (this.Qh = new kt(this.C, this.sr(z.Ho), f)),
165
+ (this.Ra = new kt(this.C, this.ee(w.$h), f)),
166
166
  this.N(f),
167
167
  (this.S = new Pt(
168
- this.dn,
168
+ this.an,
169
169
  this.C,
170
- this.Qh,
171
- this.As,
170
+ this.Ra,
171
+ this.Cs,
172
172
  this.T,
173
173
  this.B,
174
- this.fn,
175
- this.Ia,
176
- this.Xh,
177
- this.Zh || "",
178
- this.sr(z.Qo),
179
- this.sr(z.Wh),
174
+ this.un,
175
+ this.Pa,
176
+ this.Oa,
177
+ this.Ta || "",
178
+ this.ee(w.Zh),
179
+ this.ee(w.Qh),
180
180
  )),
181
- (this.Bi = new Lt(
182
- this.fn,
183
- this.Ia,
181
+ (this.Fi = new Lt(
182
+ this.un,
183
+ this.Pa,
184
184
  this.T,
185
- this.dn,
186
- this.As,
185
+ this.an,
186
+ this.Cs,
187
187
  this.B,
188
188
  this.C,
189
189
  (t) => {
190
- if (this.nt()) for (const i of this.lr()) i.U(t);
190
+ if (this._t()) for (const i of this.ar()) i.U(t);
191
191
  },
192
- this.Qh,
192
+ this.Ra,
193
193
  this.S,
194
194
  )),
195
- this.Bi.initialize(),
196
- h || this.C.Ka(),
195
+ this.Fi.initialize(),
196
+ h || this.C.Ha(),
197
197
  N.info(
198
- `Initialized for the Braze backend at "${this.sr(
199
- z.Wo,
200
- )}" with API key "${this.fn}".`,
198
+ `Initialized for the Braze backend at "${this.ee(
199
+ w.Zo,
200
+ )}" with API key "${this.un}".`,
201
201
  ),
202
202
  ot.p(),
203
- this.B.Me(() => {
203
+ this.B.Ke(() => {
204
204
  var t;
205
205
  this.isInitialized &&
206
- (null === (t = this.B) || void 0 === t ? void 0 : t.De()) &&
206
+ (null === (t = this.B) || void 0 === t ? void 0 : t.Be()) &&
207
207
  import("../FeatureFlags/refresh-feature-flags.js").then((t) => {
208
208
  if (!this.isInitialized) return;
209
209
  (0, t.default)();
210
210
  });
211
211
  }),
212
- this.Bi.rn(() => {
212
+ this.Fi.rn(() => {
213
213
  var t;
214
214
  this.isInitialized &&
215
- (null === (t = this.B) || void 0 === t ? void 0 : t.De()) &&
215
+ (null === (t = this.B) || void 0 === t ? void 0 : t.Be()) &&
216
216
  import("../FeatureFlags/refresh-feature-flags.js").then((t) => {
217
217
  if (!this.isInitialized) return;
218
218
  (0, t.default)(void 0, void 0, !0);
219
219
  });
220
220
  }),
221
- this.Oa.X(this.options),
221
+ this.Ua.X(this.options),
222
222
  (this.isInitialized = !0),
223
223
  window.dispatchEvent(new CustomEvent("braze.initialized")),
224
224
  !0
225
225
  );
226
226
  }
227
227
  destroy(t) {
228
- if ((N.destroy(), this.nt())) {
229
- this.Ta.X(), this.Ta.removeAllSubscriptions();
230
- for (const t of this.Ra) t.destroy();
231
- this.Ra = [];
232
- for (const t of this.Pa) t.clearData(!1);
233
- (this.Pa = []),
228
+ if ((N.destroy(), this._t())) {
229
+ this.Wa.X(), this.Wa.removeAllSubscriptions();
230
+ for (const t of this.Va) t.destroy();
231
+ this.Va = [];
232
+ for (const t of this.Fa) t.clearData(!1);
233
+ (this.Fa = []),
234
234
  this.removeAllSubscriptions(),
235
- (this._i = []),
236
- null != this.Bi && this.Bi.destroy(),
237
- (this.Bi = null),
238
- (this.Qh = null),
239
- (this.dn = null),
235
+ (this.Mi = []),
236
+ null != this.Fi && this.Fi.destroy(),
237
+ (this.Fi = null),
238
+ (this.Ra = null),
239
+ (this.an = null),
240
240
  (this.S = null),
241
241
  (this.B = null),
242
242
  (this.T = null),
243
- (this.As = null),
243
+ (this.Cs = null),
244
244
  (this.options = {}),
245
- (this.Zh = void 0),
245
+ (this.Ta = void 0),
246
246
  (this.isInitialized = !1),
247
- (this.Na = !1),
247
+ (this.La = !1),
248
248
  t && (this.C = null);
249
249
  }
250
250
  }
251
251
  rr() {
252
- return !this.Ga() && (!!this.nt() || (console.warn(p), !1));
252
+ return !this.Xa() && (!!this._t() || (console.warn(p), !1));
253
253
  }
254
254
  Ma() {
255
- return this.fn;
255
+ return this.un;
256
256
  }
257
257
  Sr() {
258
- return this.Qh;
258
+ return this.Ra;
259
259
  }
260
260
  Z() {
261
- return this.Ia;
261
+ return this.Pa;
262
262
  }
263
- te() {
264
- return this.dn;
263
+ ue() {
264
+ return this.an;
265
265
  }
266
266
  g() {
267
267
  return this.S;
268
268
  }
269
- sr(t) {
269
+ ee(t) {
270
270
  return this.options[t];
271
271
  }
272
- lr() {
273
- return this.Pa;
272
+ ar() {
273
+ return this.Fa;
274
274
  }
275
275
  nn() {
276
- return this.Bi;
276
+ return this.Fi;
277
277
  }
278
278
  v() {
279
279
  return this.B;
@@ -284,46 +284,46 @@ class Vt {
284
284
  j() {
285
285
  return this.C;
286
286
  }
287
- cr() {
288
- if (this.As && this.Bi) return new User(this.As, this.Bi);
287
+ mr() {
288
+ if (this.Cs && this.Fi) return new User(this.Cs, this.Fi);
289
289
  }
290
- tr() {
291
- return this.As;
290
+ ir() {
291
+ return this.Cs;
292
292
  }
293
- nr() {
294
- return !0 === this.sr(z.er);
293
+ tr() {
294
+ return !0 === this.ee(w.re);
295
295
  }
296
296
  h(t) {
297
297
  let i = !1;
298
- for (const s of this.Ra) s === t && (i = !0);
299
- i || this.Ra.push(t);
298
+ for (const s of this.Va) s === t && (i = !0);
299
+ i || this.Va.push(t);
300
300
  }
301
- _(t) {
302
- let i = !1;
303
- for (const s of this.Pa) s.constructor === t.constructor && (i = !0);
304
- t instanceof s && !i && this.Pa.push(t);
301
+ _(i) {
302
+ let s = !1;
303
+ for (const t of this.Fa) t.constructor === i.constructor && (s = !0);
304
+ i instanceof t && !s && this.Fa.push(i);
305
305
  }
306
306
  N(t) {
307
- t instanceof u && this._i.push(t);
307
+ t instanceof u && this.Mi.push(t);
308
308
  }
309
309
  removeAllSubscriptions() {
310
- if (this.rr()) for (const t of this._i) t.removeAllSubscriptions();
310
+ if (this.rr()) for (const t of this.Mi) t.removeAllSubscriptions();
311
311
  }
312
312
  removeSubscription(t) {
313
- if (this.rr()) for (const i of this._i) i.removeSubscription(t);
313
+ if (this.rr()) for (const i of this.Mi) i.removeSubscription(t);
314
314
  }
315
- re(t) {
316
- this.Na = t;
315
+ fe(t) {
316
+ this.La = t;
317
317
  }
318
- nt() {
318
+ _t() {
319
319
  return this.isInitialized;
320
320
  }
321
- Ga() {
322
- return this.Na;
321
+ Xa() {
322
+ return this.La;
323
323
  }
324
- Si() {
325
- return this.Xh;
324
+ di() {
325
+ return this.Oa;
326
326
  }
327
327
  }
328
328
  const r = new Vt();
329
- export { r as default, Vt as BrazeSdkInstance, z as OPTIONS };
329
+ export { r as default, Vt as BrazeSdkInstance, w as OPTIONS };
@@ -3,53 +3,53 @@ import Gt from "../models/device.js";
3
3
  import DeviceProperties from "../Core/device-properties.js";
4
4
  import _t from "../models/identifier.js";
5
5
  import { logger as N, Guid as G } from "../../shared-lib/index.js";
6
- import { STORAGE_KEYS as t } from "../managers/storage-manager.js";
6
+ import { STORAGE_KEYS as s } from "../managers/storage-manager.js";
7
7
  import { values as Rt } from "../util/code-utils.js";
8
8
  import { getErrorMessage as si } from "../util/error-utils.js";
9
9
  export default class Ot {
10
10
  constructor(t, e) {
11
11
  (this.C = t),
12
- (this.Ja = e),
12
+ (this.Qa = e),
13
13
  (this.C = t),
14
14
  null == e && (e = Rt(DeviceProperties)),
15
- (this.Ja = e);
15
+ (this.Qa = e);
16
16
  }
17
- ce(e = !0) {
18
- let r = this.C.tu(t.iu.$h);
19
- null == r && ((r = new _t(G.Rt())), e && this.C.uu(t.iu.$h, r));
20
- const s = new Gt(r.eu);
21
- for (let t = 0; t < this.Ja.length; t++) {
22
- switch (this.Ja[t]) {
17
+ ve(t = !0) {
18
+ let e = this.C.tu(s.iu.Ia);
19
+ null == e && ((e = new _t(G.ce())), t && this.C.uu(s.iu.Ia, e));
20
+ const r = new Gt(e.eu);
21
+ for (let t = 0; t < this.Qa.length; t++) {
22
+ switch (this.Qa[t]) {
23
23
  case DeviceProperties.BROWSER:
24
- s.browser = ro.browser;
24
+ r.browser = ro.browser;
25
25
  break;
26
26
  case DeviceProperties.BROWSER_VERSION:
27
- s.Ha = ro.version;
27
+ r.Za = ro.version;
28
28
  break;
29
29
  case DeviceProperties.OS:
30
- s.os = this.Qa();
30
+ r.os = this.tc();
31
31
  break;
32
32
  case DeviceProperties.RESOLUTION:
33
- s.Xa = screen.width + "x" + screen.height;
33
+ r.ec = screen.width + "x" + screen.height;
34
34
  break;
35
35
  case DeviceProperties.LANGUAGE:
36
- s.language = ro.language;
36
+ r.language = ro.language;
37
37
  break;
38
38
  case DeviceProperties.TIME_ZONE:
39
- s.timeZone = this.Ya(new Date());
39
+ r.timeZone = this.rc(new Date());
40
40
  break;
41
41
  case DeviceProperties.USER_AGENT:
42
- s.userAgent = ro.userAgent;
42
+ r.userAgent = ro.userAgent;
43
43
  }
44
44
  }
45
- return s;
45
+ return r;
46
46
  }
47
- Qa() {
48
- if (ro.Za()) return ro.Za();
49
- const e = this.C.vs(t.gs.$a);
50
- return e && e.os_version ? e.os_version : ro.Qa();
47
+ tc() {
48
+ if (ro.sc()) return ro.sc();
49
+ const t = this.C.ft(s.gt.ic);
50
+ return t && t.os_version ? t.os_version : ro.tc();
51
51
  }
52
- Ya(t) {
52
+ rc(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 Ot {
66
66
  }
67
67
  if (e) return "";
68
68
  const r = t.getTimezoneOffset();
69
- return this.tc(r);
69
+ return this.oc(r);
70
70
  }
71
- tc(t) {
71
+ oc(t) {
72
72
  const e = Math.trunc(t / 60),
73
73
  r = Math.trunc(t % 60);
74
74
  let s = "GMT";