@braze/web-sdk 5.6.1 → 5.7.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 (121) hide show
  1. package/README.md +1 -1
  2. package/index.d.ts +14 -4
  3. package/package.json +1 -1
  4. package/shared-lib/encoding-utils.js +1 -1
  5. package/shared-lib/event-types.js +20 -20
  6. package/shared-lib/indexed-db-adapter.js +15 -15
  7. package/shared-lib/logger.js +2 -2
  8. package/shared-lib/supported-options.js +14 -14
  9. package/src/Banner/banner-provider.js +53 -50
  10. package/src/Banner/banner.js +1 -1
  11. package/src/Banner/get-all-banners.js +2 -2
  12. package/src/Banner/get-banner.js +2 -2
  13. package/src/Banner/log-banner-click.js +1 -1
  14. package/src/Banner/log-banner-impressions.js +4 -4
  15. package/src/Banner/request-banners-refresh.js +2 -2
  16. package/src/Banner/subscribe-to-banners-updates.js +5 -5
  17. package/src/Card/card-manager.js +10 -10
  18. package/src/Card/models/captioned-image.js +1 -1
  19. package/src/Card/models/card.js +3 -3
  20. package/src/Card/models/classic-card.js +1 -1
  21. package/src/Card/models/control-card.js +1 -1
  22. package/src/Card/models/image-only.js +1 -1
  23. package/src/ContentCards/content-cards-provider.js +139 -180
  24. package/src/ContentCards/get-cached-content-cards.js +1 -1
  25. package/src/ContentCards/request-content-cards-refresh.js +1 -1
  26. package/src/ContentCards/subscribe-to-content-cards-updates.js +10 -10
  27. package/src/ContentCards/ui/show-content-cards.js +3 -3
  28. package/src/Core/disable-sdk.js +3 -3
  29. package/src/Core/enable-sdk.js +3 -3
  30. package/src/Core/log-custom-event.js +3 -3
  31. package/src/Core/log-purchase.js +1 -1
  32. package/src/Core/open-session.js +6 -6
  33. package/src/Core/wipe-data.js +4 -4
  34. package/src/FeatureFlags/feature-flag.js +1 -1
  35. package/src/FeatureFlags/feature-flags-provider.js +81 -78
  36. package/src/FeatureFlags/get-all-feature-flags.js +2 -2
  37. package/src/FeatureFlags/get-feature-flag.js +2 -2
  38. package/src/FeatureFlags/log-feature-flag-impression.js +4 -4
  39. package/src/FeatureFlags/subscribe-to-feature-flags-updates.js +2 -2
  40. package/src/Feed/feed-provider.js +34 -34
  41. package/src/Feed/get-cached-feed.js +1 -1
  42. package/src/Feed/request-feed-refresh.js +1 -1
  43. package/src/Feed/subscribe-to-feed-updates.js +1 -1
  44. package/src/Feed/ui/show-feed.js +1 -1
  45. package/src/InAppMessage/defer-in-app-message.js +1 -1
  46. package/src/InAppMessage/display/html-message-to-html.js +9 -9
  47. package/src/InAppMessage/display/in-app-message-to-html.js +16 -16
  48. package/src/InAppMessage/display/modal-utils.js +5 -5
  49. package/src/InAppMessage/in-app-message-factory.js +4 -4
  50. package/src/InAppMessage/in-app-message-manager.js +115 -91
  51. package/src/InAppMessage/log-in-app-message-button-click.js +2 -2
  52. package/src/InAppMessage/log-in-app-message-click.js +2 -2
  53. package/src/InAppMessage/log-in-app-message-html-click.js +4 -4
  54. package/src/InAppMessage/log-in-app-message-impression.js +2 -2
  55. package/src/InAppMessage/models/full-screen-message.js +5 -5
  56. package/src/InAppMessage/models/html-message.js +10 -10
  57. package/src/InAppMessage/models/in-app-message-button.js +5 -5
  58. package/src/InAppMessage/models/in-app-message.js +37 -37
  59. package/src/InAppMessage/models/modal-message.js +5 -5
  60. package/src/InAppMessage/models/slide-up-message.js +7 -7
  61. package/src/InAppMessage/models/templated-in-app-message.js +8 -8
  62. package/src/InAppMessage/subscribe-to-in-app-message.js +1 -1
  63. package/src/InAppMessage/ui/automatically-show-in-app-messages.js +3 -3
  64. package/src/InAppMessage/ui/show-in-app-message.js +14 -14
  65. package/src/Push/is-push-blocked.js +2 -2
  66. package/src/Push/is-push-permission-granted.js +2 -2
  67. package/src/Push/is-push-supported.js +2 -2
  68. package/src/Push/push-manager.js +88 -88
  69. package/src/Push/utils/push-utils.js +12 -12
  70. package/src/User/user-manager.js +10 -10
  71. package/src/User/user.js +46 -34
  72. package/src/common/constants.js +1 -1
  73. package/src/common/event-logger.js +3 -3
  74. package/src/common/feed-display.js +10 -10
  75. package/src/l10n/l10n-manager.js +1 -1
  76. package/src/managers/auth-manager.js +10 -10
  77. package/src/managers/braze-instance.js +110 -110
  78. package/src/managers/device-manager.js +17 -17
  79. package/src/managers/network-manager.js +180 -143
  80. package/src/managers/server-config-manager.js +65 -65
  81. package/src/managers/session-manager.js +22 -22
  82. package/src/managers/storage-manager-factory.js +9 -9
  83. package/src/managers/storage-manager.js +134 -134
  84. package/src/managers/subscription-manager.js +8 -8
  85. package/src/managers/utils.js +1 -1
  86. package/src/models/backend-errors.js +5 -5
  87. package/src/models/braze-event.js +8 -8
  88. package/src/models/device.js +2 -2
  89. package/src/models/identifier.js +10 -10
  90. package/src/models/push-token.js +8 -8
  91. package/src/models/server-config.js +31 -31
  92. package/src/request-controller.js +158 -146
  93. package/src/triggers/models/custom-event-data.js +5 -5
  94. package/src/triggers/models/custom-event-property-data.js +6 -6
  95. package/src/triggers/models/filter-set.js +6 -6
  96. package/src/triggers/models/filter.js +16 -16
  97. package/src/triggers/models/in-app-message-click-data.js +2 -2
  98. package/src/triggers/models/purchase-data.js +2 -2
  99. package/src/triggers/models/purchase-property-data.js +4 -4
  100. package/src/triggers/models/push-click-data.js +2 -2
  101. package/src/triggers/models/trigger-condition.js +36 -36
  102. package/src/triggers/models/trigger-events.js +1 -1
  103. package/src/triggers/models/trigger.js +11 -11
  104. package/src/triggers/triggers-provider-factory.js +2 -2
  105. package/src/triggers/triggers-provider.js +37 -37
  106. package/src/ui/js/attach-css.js +1 -1
  107. package/src/ui/js/iam-css.js +1 -1
  108. package/src/ui/js/load-font-awesome.js +1 -1
  109. package/src/util/base-device-parser.js +1 -1
  110. package/src/util/braze-actions.js +4 -4
  111. package/src/util/browser-detector.js +6 -6
  112. package/src/util/client-hints-parser.js +1 -1
  113. package/src/util/component-utils.js +2 -2
  114. package/src/util/dom-utils.js +3 -3
  115. package/src/util/html-display-utils.js +1 -0
  116. package/src/util/key-codes.js +1 -1
  117. package/src/util/net.js +22 -23
  118. package/src/util/request-header-utils.js +23 -20
  119. package/src/util/user-agent-parser.js +1 -1
  120. package/src/util/validation-utils.js +14 -14
  121. package/src/util/window-utils.js +2 -2
@@ -1,80 +1,72 @@
1
- import l, { readResponseHeaders as X } from "../util/net.js";
1
+ import l from "../util/net.js";
2
2
  import s from "../common/base-provider.js";
3
3
  import r from "../managers/braze-instance.js";
4
4
  import ContentCards from "./content-cards.js";
5
5
  import { dateFromUnixTimestamp as O } from "../util/date-utils.js";
6
- import { isURIJavascriptOrData as Y } from "../util/url-utils.js";
6
+ import { isURIJavascriptOrData as X } from "../util/url-utils.js";
7
7
  import {
8
- newCardFromContentCardsJson as Z,
9
- newCardFromSerializedValue as tt,
8
+ newCardFromContentCardsJson as Y,
9
+ newCardFromSerializedValue as Z,
10
10
  } from "../Card/util/card-factory.js";
11
11
  import { STORAGE_KEYS as t } from "../managers/storage-manager.js";
12
12
  import u from "../managers/subscription-manager.js";
13
- import c from "../common/event-logger.js";
14
13
  import h from "../util/request-header-utils.js";
15
14
  import { randomInclusive as a } from "../util/math.js";
16
- import { MAX_ERROR_RETRIES_CONTENT_CARDS as st } from "../common/constants.js";
17
- import {
18
- logger as N,
19
- IndexedDBAdapter as it,
20
- EventTypes as d,
21
- } from "../../shared-lib/index.js";
15
+ import { logger as N, IndexedDBAdapter as tt } from "../../shared-lib/index.js";
22
16
  export default class Q extends s {
23
17
  constructor(t, s, i, e, h) {
24
18
  super(),
25
19
  (this.As = t),
26
20
  (this.C = s),
27
21
  (this.B = i),
28
- (this.Js = e),
22
+ (this.Ls = e),
29
23
  (this.S = h),
30
24
  (this.As = t),
31
25
  (this.C = s),
32
26
  (this.B = i),
33
- (this.Js = e),
27
+ (this.Ls = e),
34
28
  (this.S = h),
35
- (this.Ms = new u()),
36
- r.N(this.Ms),
29
+ (this.Js = new u()),
30
+ r.N(this.Js),
31
+ (this.Ms = 0),
37
32
  (this.$s = 0),
38
- (this.Ps = 0),
39
33
  (this.cards = []),
40
- this.Xs();
41
- const n = it.Gs._s;
42
- new it(n, N).Hs(n.Os.Ks, (t) => {
43
- this.Qs(t);
34
+ this.Ps();
35
+ const n = tt._s.Xs;
36
+ new tt(n, N).Gs(n.Ks.Hs, (t) => {
37
+ this.Os(t);
44
38
  }),
45
- (this.Vs = null),
39
+ (this.Qs = null),
46
40
  (this.k = null),
41
+ (this.Vs = null),
47
42
  (this.Ws = null),
48
- (this.Ys = null),
49
- (this.Zs = null),
50
- (this.fi = 10),
51
- (this.di = 0);
43
+ (this.Ys = 10);
52
44
  }
53
- pi() {
54
- return this.Vs;
45
+ Zs() {
46
+ return this.Qs;
55
47
  }
56
- vi(t) {
57
- this.Vs = t;
48
+ fi(t) {
49
+ this.Qs = t;
58
50
  }
59
- Ts() {
51
+ Cs() {
60
52
  return this.k;
61
53
  }
62
- Rs(t) {
54
+ Ts(t) {
63
55
  this.k = t;
64
56
  }
65
- Xs() {
57
+ Ps() {
66
58
  if (!this.C) return;
67
- const s = this.C.ps(t.bs.wi) || [],
59
+ const s = this.C.vs(t.gs.di) || [],
68
60
  i = [];
69
61
  for (let t = 0; t < s.length; t++) {
70
- const e = tt(s[t]);
62
+ const e = Z(s[t]);
71
63
  null != e && i.push(e);
72
64
  }
73
- (this.cards = this.Ci(this.bi(i, !1))),
74
- (this.$s = this.C.ps(t.bs.gi) || this.$s),
75
- (this.Ps = this.C.ps(t.bs.yi) || this.Ps);
65
+ (this.cards = this.pi(this.Ci(i, !1))),
66
+ (this.Ms = this.C.vs(t.gs.bi) || this.Ms),
67
+ (this.$s = this.C.vs(t.gs.vi) || this.$s);
76
68
  }
77
- ji(s, i = !1, e = 0, h = 0) {
69
+ wi(s, i = !1, e = 0, h = 0) {
78
70
  let r;
79
71
  if (i) {
80
72
  r = [];
@@ -89,10 +81,10 @@ export default class Q extends s {
89
81
  break;
90
82
  }
91
83
  if (i) {
92
- const t = Z(e);
84
+ const t = Y(e);
93
85
  null != h && h.viewed && t && (t.viewed = !0), null != t && r.push(t);
94
86
  } else if (null == h) {
95
- const t = Z(e);
87
+ const t = Y(e);
96
88
  null != t && r.push(t);
97
89
  } else {
98
90
  if (!h.ni(e))
@@ -103,54 +95,28 @@ export default class Q extends s {
103
95
  }
104
96
  }
105
97
  }
106
- (this.cards = this.Ci(this.bi(r, i))),
107
- this.Ri(),
108
- (this.$s = e),
109
- (this.Ps = h),
110
- this.C && (this.C.js(t.bs.gi, this.$s), this.C.js(t.bs.yi, this.Ps));
98
+ (this.cards = this.pi(this.Ci(r, i))),
99
+ this.gi(),
100
+ (this.Ms = e),
101
+ (this.$s = h),
102
+ this.C && (this.C.Bs(t.gs.bi, this.Ms), this.C.Bs(t.gs.vi, this.$s));
111
103
  }
112
104
  U(s) {
113
- if (this.Si() && null != s && s.cards) {
114
- this.C && this.C.js(t.bs.Di, r.Ui());
105
+ if (this.ji() && null != s && s.cards) {
106
+ this.C && this.C.Bs(t.gs.yi, r.Si());
115
107
  const i = s.full_sync;
116
- i || this.Xs(),
117
- this.ji(s.cards, i, s.last_full_sync_at, s.last_card_updated_at),
118
- this.Ms.X(this.ki(!0));
108
+ i || this.Ps(),
109
+ this.wi(s.cards, i, s.last_full_sync_at, s.last_card_updated_at),
110
+ this.Js.X(this.Ri(!0));
119
111
  }
120
112
  }
121
- Ai(s) {
122
- this.C && this.C.js(t.bs.Fi, s);
113
+ Ui(t) {
114
+ this.ki(), (this.Vs = t);
123
115
  }
124
- xi(s, i, e) {
125
- const h = () => {
126
- this.zi(i, e, !0);
127
- },
128
- r = s ? X(s) : null;
129
- let n;
130
- if ((this.qi(), !r || !r["retry-after"])) return void this.Ai(0);
131
- const o = r["retry-after"];
132
- if (isNaN(o) && !isNaN(Date.parse(o)))
133
- (n = Date.parse(o) - new Date().getTime()), n < 0 && h();
134
- else {
135
- if (isNaN(parseFloat(o.toString()))) {
136
- const t =
137
- "Received unexpected value for retry-after header in /sync response";
138
- return c.ds(d.Li, { e: t + ": " + o }), void this.Ai(0);
139
- }
140
- n = 1e3 * parseFloat(o.toString());
141
- }
142
- this.Ws = window.setTimeout(() => {
143
- h();
144
- }, n);
145
- let l = 0;
146
- this.C && (l = this.C.ps(t.bs.Fi)),
147
- (null == l || isNaN(parseInt(l.toString()))) && (l = 0),
148
- this.Ai(parseInt(l.toString()) + 1);
149
- }
150
- Qs(t) {
116
+ Os(t) {
151
117
  var s;
152
- if (!this.Si()) return;
153
- this.Xs();
118
+ if (!this.ji()) return;
119
+ this.Ps();
154
120
  const i = this.cards.slice();
155
121
  let e = null;
156
122
  e = null === (s = this.As) || void 0 === s ? void 0 : s.getUserId();
@@ -164,7 +130,7 @@ export default class Q extends s {
164
130
  break;
165
131
  }
166
132
  if (null == h) {
167
- const t = Z(e);
133
+ const t = Y(e);
168
134
  null != t && i.push(t);
169
135
  } else {
170
136
  if (!h.ni(e))
@@ -175,16 +141,16 @@ export default class Q extends s {
175
141
  }
176
142
  }
177
143
  }
178
- (this.cards = this.Ci(this.bi(i, !1))), this.Ri(), this.Ms.X(this.ki(!0));
144
+ (this.cards = this.pi(this.Ci(i, !1))), this.gi(), this.Js.X(this.Ri(!0));
179
145
  }
180
- bi(s, i) {
146
+ Ci(s, i) {
181
147
  let e = {},
182
148
  h = {},
183
149
  r = {};
184
150
  this.C &&
185
- ((e = this.C.ps(t.bs.ot) || {}),
186
- (h = this.C.ps(t.bs.vt) || {}),
187
- (r = this.C.ps(t.bs.gt) || {}));
151
+ ((e = this.C.vs(t.gs.ot) || {}),
152
+ (h = this.C.vs(t.gs.vt) || {}),
153
+ (r = this.C.vs(t.gs.gt) || {}));
188
154
  const n = {},
189
155
  o = {},
190
156
  l = {};
@@ -198,19 +164,19 @@ export default class Q extends s {
198
164
  return (
199
165
  i &&
200
166
  this.C &&
201
- (this.C.js(t.bs.ot, n), this.C.js(t.bs.vt, o), this.C.js(t.bs.gt, l)),
167
+ (this.C.Bs(t.gs.ot, n), this.C.Bs(t.gs.vt, o), this.C.Bs(t.gs.gt, l)),
202
168
  s
203
169
  );
204
170
  }
205
- Ci(s) {
171
+ pi(s) {
206
172
  const i = [],
207
173
  e = new Date();
208
174
  let h = {};
209
- this.C && (h = this.C.ps(t.bs.gt) || {});
175
+ this.C && (h = this.C.vs(t.gs.gt) || {});
210
176
  let r = !1;
211
177
  for (let t = 0; t < s.length; t++) {
212
178
  const n = s[t].url;
213
- if (!this.Js && n && Y(n)) {
179
+ if (!this.Ls && n && X(n)) {
214
180
  N.error(
215
181
  `Card with url ${n} will not be displayed because Javascript URLs are disabled. Use the "allowUserSuppliedJavascript" option for braze.initialize to enable this card.`,
216
182
  );
@@ -225,92 +191,85 @@ export default class Q extends s {
225
191
  i && (h[i] = !0), (r = !0);
226
192
  }
227
193
  }
228
- return r && this.C && this.C.js(t.bs.gt, h), i;
194
+ return r && this.C && this.C.Bs(t.gs.gt, h), i;
229
195
  }
230
- Ri() {
196
+ gi() {
231
197
  var s;
232
198
  const i = [];
233
- for (let t = 0; t < this.cards.length; t++) i.push(this.cards[t].Bs());
234
- null === (s = this.C) || void 0 === s || s.js(t.bs.wi, i);
235
- }
236
- qi() {
237
- this.Ws && (clearTimeout(this.Ws), (this.Ws = null));
238
- }
239
- Ji() {
240
- null != this.Ys && (clearTimeout(this.Ys), (this.Ys = null));
199
+ for (let t = 0; t < this.cards.length; t++) i.push(this.cards[t].bs());
200
+ null === (s = this.C) || void 0 === s || s.Bs(t.gs.di, i);
241
201
  }
242
- Mi(t = 1e3 * this.fi, s, i) {
243
- this.Ji(),
244
- (this.Ys = window.setTimeout(() => {
245
- this.zi(s, i, !0);
246
- }, t)),
247
- (this.Zs = t);
202
+ ki() {
203
+ this.Vs && (clearTimeout(this.Vs), (this.Vs = null));
248
204
  }
249
- zi(s, i, e = !1, n = !0) {
250
- var o;
251
- const u = this.S,
252
- c = this.C;
253
- if (!u || !c) return void ("function" == typeof i && i());
254
- if ((!e && (this.qi(), this.Ai(0)), !this.Si()))
205
+ Di(s, i, e = !1) {
206
+ var n;
207
+ const o = this.S,
208
+ u = this.C;
209
+ if (!o || !u) return void ("function" == typeof i && i());
210
+ if ((e && (h.zi(u, h.O.Ai), this.ki()), !this.ji()))
255
211
  return void (
256
- null === (o = this.B) ||
257
- void 0 === o ||
258
- o.$i(() => {
259
- this.zi(s, i);
212
+ null === (n = this.B) ||
213
+ void 0 === n ||
214
+ n.qi(() => {
215
+ this.Di(s, i, !0);
260
216
  })
261
217
  );
262
- n && this.Ji();
263
- const f = u.H({}, !0);
264
- c.ps(t.bs.Di) !== r.Ui() && this.Bi(),
265
- (f.last_full_sync_at = this.$s),
266
- (f.last_card_updated_at = this.Ps);
267
- const d = u.J(f, h.O.Pi, e);
268
- let m = !1;
269
- u.V(
270
- f,
218
+ const c = o.H({}, !0);
219
+ u.vs(t.gs.yi) !== r.Si() && this.xi(),
220
+ (c.last_full_sync_at = this.Ms),
221
+ (c.last_card_updated_at = this.$s);
222
+ const f = o.J(c, h.O.Ai, e);
223
+ let d = !1;
224
+ o.V(
225
+ c,
271
226
  (t = -1) => {
272
227
  if (this.C) {
273
228
  const t = new Date().valueOf();
274
- h.W(this.C, h.O.Pi, t);
229
+ h.W(this.C, h.O.Ai, t);
275
230
  }
276
- -1 !== t && d.push(["X-Braze-Req-Tokens-Remaining", t.toString()]),
231
+ -1 !== t && f.push(["X-Braze-Req-Tokens-Remaining", t.toString()]),
277
232
  l.Y({
278
- url: `${u.Z()}/content_cards/sync`,
279
- data: f,
280
- headers: d,
281
- ss: (t, e) => {
282
- if (!u.ts(f, t, d))
283
- return (m = !0), void ("function" == typeof i && i());
284
- u.es(),
285
- this.xi(e, s, i),
286
- this.U(t),
287
- (m = !1),
288
- h.ns(this.C, h.O.Pi, 1),
289
- "function" == typeof s && s();
233
+ url: `${o.Z()}/content_cards/sync`,
234
+ data: c,
235
+ headers: f,
236
+ ss: (t) => {
237
+ if (!o.ts(c, t, f))
238
+ return (d = !0), void ("function" == typeof i && i());
239
+ o.es(), this.U(t), (d = !1), "function" == typeof s && s();
290
240
  },
291
241
  error: (t) => {
292
- u.rs(t, "retrieving content cards"),
293
- (m = !0),
242
+ o.ns(t, "retrieving content cards"),
243
+ (d = !0),
294
244
  "function" == typeof i && i();
295
245
  },
296
- os: () => {
297
- if (m && n && !this.Ys && this.di + 1 < st) {
298
- h.hs(this.C, h.O.Pi);
299
- let t = this.Zs;
300
- (null == t || t < 1e3 * this.fi) && (t = 1e3 * this.fi),
301
- this.Mi(Math.min(3e5, a(1e3 * this.fi, 3 * t)), s, i),
302
- (this.di = this.di + 1);
246
+ rs: (t, e) => {
247
+ let r;
248
+ if (d) {
249
+ let t = this.Ws;
250
+ (null == t || t < 1e3 * this.Ys) && (t = 1e3 * this.Ys),
251
+ (r = Math.min(3e5, a(1e3 * this.Ys, 3 * t)));
303
252
  }
253
+ o.os(
254
+ e,
255
+ () => {
256
+ this.Di(s, i, !1);
257
+ },
258
+ h.O.Ai,
259
+ (t) => this.Ui(t),
260
+ () => this.ki(),
261
+ r,
262
+ );
304
263
  },
305
264
  });
306
265
  },
307
- h.O.Pi,
266
+ h.O.Ai,
308
267
  i,
309
268
  );
310
269
  }
311
- ki(s) {
312
- s || this.Xs();
313
- const i = this.Ci(this.cards);
270
+ Ri(s) {
271
+ s || this.Ps();
272
+ const i = this.pi(this.cards);
314
273
  i.sort((t, s) =>
315
274
  t.pinned && !s.pinned
316
275
  ? -1
@@ -322,50 +281,50 @@ export default class Q extends s {
322
281
  ? 1
323
282
  : 0,
324
283
  );
325
- let e = Math.max(this.Ps || 0, this.$s || 0);
284
+ let e = Math.max(this.$s || 0, this.Ms || 0);
326
285
  return (
327
286
  0 === e && (e = void 0),
328
- this.C && this.C.ps(t.bs.yi) === this.Ps && void 0 === e && (e = this.Ps),
287
+ this.C && this.C.vs(t.gs.vi) === this.$s && void 0 === e && (e = this.$s),
329
288
  new ContentCards(i, O(e))
330
289
  );
331
290
  }
332
- Fs(t) {
333
- return this.Ms.Ns(t);
291
+ qs(t) {
292
+ return this.Js.Fs(t);
334
293
  }
335
- Bi() {
336
- (this.$s = 0),
337
- (this.Ps = 0),
338
- this.C && (this.C.Ls(t.bs.gi), this.C.Ls(t.bs.yi));
294
+ xi() {
295
+ (this.Ms = 0),
296
+ (this.$s = 0),
297
+ this.C && (this.C.Es(t.gs.bi), this.C.Es(t.gs.vi));
339
298
  }
340
299
  changeUser(s) {
341
300
  s ||
342
301
  ((this.cards = []),
343
- this.Ms.X(new ContentCards(this.cards.slice(), null)),
302
+ this.Js.X(new ContentCards(this.cards.slice(), null)),
344
303
  this.C &&
345
- (this.C.Ls(t.bs.wi),
346
- this.C.Ls(t.bs.ot),
347
- this.C.Ls(t.bs.vt),
348
- this.C.Ls(t.bs.gt))),
349
- this.Bi();
304
+ (this.C.Es(t.gs.di),
305
+ this.C.Es(t.gs.ot),
306
+ this.C.Es(t.gs.vt),
307
+ this.C.Es(t.gs.gt))),
308
+ this.xi();
350
309
  }
351
310
  clearData(s) {
352
- (this.$s = 0),
353
- (this.Ps = 0),
311
+ (this.Ms = 0),
312
+ (this.$s = 0),
354
313
  (this.cards = []),
355
- this.Ms.X(new ContentCards(this.cards.slice(), null)),
314
+ this.Js.X(new ContentCards(this.cards.slice(), null)),
356
315
  s &&
357
316
  this.C &&
358
- (this.C.Ls(t.bs.wi),
359
- this.C.Ls(t.bs.ot),
360
- this.C.Ls(t.bs.vt),
361
- this.C.Ls(t.bs.gt),
362
- this.C.Ls(t.bs.gi),
363
- this.C.Ls(t.bs.yi));
317
+ (this.C.Es(t.gs.di),
318
+ this.C.Es(t.gs.ot),
319
+ this.C.Es(t.gs.vt),
320
+ this.C.Es(t.gs.gt),
321
+ this.C.Es(t.gs.bi),
322
+ this.C.Es(t.gs.vi));
364
323
  }
365
- Si() {
366
- return !!this.B && (!!this.B.Xi() || (0 !== this.B.Es() && this._i(), !1));
324
+ ji() {
325
+ return !!this.B && (!!this.B.Fi() || (0 !== this.B.Us() && this.Li(), !1));
367
326
  }
368
- _i() {
369
- this.Ms.X(new ContentCards([], new Date())), this.C && this.C.Ls(t.bs.wi);
327
+ Li() {
328
+ this.Js.X(new ContentCards([], new Date())), this.C && this.C.Es(t.gs.di);
370
329
  }
371
330
  }
@@ -1,5 +1,5 @@
1
1
  import W from "./content-cards-provider-factory.js";
2
2
  import r from "../managers/braze-instance.js";
3
3
  export function getCachedContentCards() {
4
- if (r.rr()) return W.m().ki(!1);
4
+ if (r.rr()) return W.m().Ri(!1);
5
5
  }
@@ -1,5 +1,5 @@
1
1
  import r from "../managers/braze-instance.js";
2
2
  import W from "./content-cards-provider-factory.js";
3
3
  export function requestContentCardsRefresh(e, t) {
4
- if (r.rr()) return W.m().zi(e, t);
4
+ if (r.rr()) return W.m().Di(e, t, !0);
5
5
  }
@@ -1,17 +1,17 @@
1
1
  import r from "../managers/braze-instance.js";
2
2
  import W from "./content-cards-provider-factory.js";
3
- export function subscribeToContentCardsUpdates(t) {
3
+ export function subscribeToContentCardsUpdates(o) {
4
4
  if (!r.rr()) return;
5
- const n = W.m(),
6
- o = n.Fs(t);
7
- if (!n.Ts()) {
8
- const t = r.nn();
9
- if (t) {
10
- const r = t.rn(() => {
11
- n.zi();
5
+ const t = W.m(),
6
+ n = t.qs(o);
7
+ if (!t.Cs()) {
8
+ const o = r.nn();
9
+ if (o) {
10
+ const r = o.rn(() => {
11
+ t.Di(void 0, void 0, !0);
12
12
  });
13
- r && n.Rs(r);
13
+ r && t.Ts(r);
14
14
  }
15
15
  }
16
- return o;
16
+ return n;
17
17
  }
@@ -19,11 +19,11 @@ export function showContentCards(n, t) {
19
19
  let e = !1;
20
20
  null == n && ((n = document.body), (e = !0));
21
21
  const o = r.sr(z.tn) || r.sr(z.en) || !1,
22
- i = W.m().ki(!1);
22
+ i = W.m().Ri(!1);
23
23
  "function" == typeof t && an(i, t(i.cards.slice()), i.lastUpdated, null, o);
24
24
  const a = tn(i, o, e),
25
25
  s = W.m(),
26
- f = s.pi();
26
+ f = s.Zs();
27
27
  (null == i.lastUpdated ||
28
28
  new Date().valueOf() - i.lastUpdated.valueOf() > ContentCards.ar) &&
29
29
  (null == f || new Date().valueOf() - f > ContentCards.ar) &&
@@ -31,7 +31,7 @@ export function showContentCards(n, t) {
31
31
  `Cached content cards were older than max TTL of ${ContentCards.ar} ms, requesting an update from the server.`,
32
32
  ),
33
33
  on(i, a),
34
- s.vi(new Date().valueOf()));
34
+ s.fi(new Date().valueOf()));
35
35
  const l = new Date().valueOf(),
36
36
  c = subscribeToContentCardsUpdates(function (n) {
37
37
  const e = a.querySelectorAll(".ab-refresh-button")[0];
@@ -1,5 +1,5 @@
1
1
  import r from "../managers/braze-instance.js";
2
- import { logger as N, IndexedDBAdapter as it } from "../../shared-lib/index.js";
2
+ import { logger as N, IndexedDBAdapter as tt } from "../../shared-lib/index.js";
3
3
  import ne, { STORAGE_KEYS as t } from "../managers/storage-manager.js";
4
4
  export function disableSDK() {
5
5
  const e = r.nn();
@@ -7,8 +7,8 @@ export function disableSDK() {
7
7
  const n = new ne.ne(null, !0),
8
8
  s = "This-cookie-will-expire-in-" + n.se();
9
9
  n.store(t.ae, s);
10
- const a = it.Gs._s;
11
- new it(a, N).setItem(a.Os.ie, a.oe, !0),
10
+ const a = tt._s.Xs;
11
+ new tt(a, N).setItem(a.Ks.ie, a.oe, !0),
12
12
  N.info("disableSDK was called"),
13
13
  r.destroy(!1),
14
14
  r.re(!0);
@@ -1,10 +1,10 @@
1
1
  import r from "../managers/braze-instance.js";
2
- import { logger as N, IndexedDBAdapter as it } from "../../shared-lib/index.js";
2
+ import { logger as N, IndexedDBAdapter as tt } from "../../shared-lib/index.js";
3
3
  import ne, { STORAGE_KEYS as t } from "../managers/storage-manager.js";
4
4
  export function enableSDK() {
5
5
  new ne.ne(null, !0).remove(t.ae);
6
- const e = it.Gs._s;
7
- new it(e, N).me(e.Os.ie, e.oe),
6
+ const e = tt._s.Xs;
7
+ new tt(e, N).me(e.Ks.ie, e.oe),
8
8
  N.info("enableSDK was called"),
9
9
  r.destroy(!1),
10
10
  r.re(!1);
@@ -7,7 +7,7 @@ import {
7
7
  validateCustomProperties as rt,
8
8
  validateCustomString as nt,
9
9
  } from "../util/validation-utils.js";
10
- import { LOG_CUSTOM_EVENT_STRING as mt } from "../common/constants.js";
10
+ import { LOG_CUSTOM_EVENT_STRING as it } from "../common/constants.js";
11
11
  export function logCustomEvent(t, e) {
12
12
  if (!r.rr()) return !1;
13
13
  if (null == t || t.length <= 0)
@@ -20,7 +20,7 @@ export function logCustomEvent(t, e) {
20
20
  if (!nt(t, "log custom event", "the event name")) return !1;
21
21
  const [o, n] = rt(
22
22
  e,
23
- mt,
23
+ it,
24
24
  "eventProperties",
25
25
  `log custom event "${t}"`,
26
26
  "event",
@@ -29,7 +29,7 @@ export function logCustomEvent(t, e) {
29
29
  const i = r.v();
30
30
  if (i && i.ge(t))
31
31
  return N.info(`Custom Event "${t}" is blocklisted, ignoring.`), !1;
32
- const s = c.ds(d.CustomEvent, { n: t, p: n });
32
+ const s = c.cs(d.CustomEvent, { n: t, p: n });
33
33
  if (s.ss) {
34
34
  N.info(`Logged custom event "${t}".`);
35
35
  for (const o of s.fe) ot.m().ue(et.ve, [t, e], o);
@@ -230,7 +230,7 @@ export function logPurchase(e, o, i, n, t) {
230
230
  const g = r.v();
231
231
  if (g && g.Dr(e))
232
232
  return N.info(`Purchase "${e}" is blocklisted, ignoring.`), !1;
233
- const P = c.ds(d.Pr, { pid: e, c: i, p: s, q: D, pr: a });
233
+ const P = c.cs(d.Pr, { pid: e, c: i, p: s, q: D, pr: a });
234
234
  if (P.ss) {
235
235
  N.info(`Logged ${D} purchase${D > 1 ? "s" : ""} of "${e}" for ${i} ${s}.`);
236
236
  for (const r of P.fe) ot.m().ue(et.Rr, [e, t], r);
@@ -1,5 +1,5 @@
1
1
  import r from "../managers/braze-instance.js";
2
- import { logger as N, IndexedDBAdapter as it } from "../../shared-lib/index.js";
2
+ import { logger as N, IndexedDBAdapter as tt } from "../../shared-lib/index.js";
3
3
  import et from "../triggers/models/trigger-events.js";
4
4
  import { TriggersProviderFactory as ot } from "../triggers/triggers-provider-factory.js";
5
5
  export function openSession() {
@@ -7,9 +7,9 @@ export function openSession() {
7
7
  const i = r.nn();
8
8
  if (!i) return;
9
9
  i.openSession();
10
- const t = it.Gs._s,
11
- o = new it(t, N);
12
- o.jr(t.Os.hr, (r, n) => {
10
+ const t = tt._s.Xs,
11
+ o = new tt(t, N);
12
+ o.jr(t.Ks.hr, (r, n) => {
13
13
  const e = n.lastClick,
14
14
  s = n.trackingString;
15
15
  N.info(`Firing push click trigger from ${s} push click at ${e}`);
@@ -17,9 +17,9 @@ export function openSession() {
17
17
  g = function () {
18
18
  ot.m().ue(et.kr, [s], c);
19
19
  };
20
- i.vr(g, g), o.me(t.Os.hr, r);
20
+ i.vr(g, g), o.me(t.Ks.hr, r);
21
21
  }),
22
- o.Hs(t.Os.$r, function (r) {
22
+ o.Gs(t.Ks.$r, function (r) {
23
23
  i.wr(r);
24
24
  });
25
25
  }
@@ -1,16 +1,16 @@
1
1
  import r from "../managers/braze-instance.js";
2
2
  import { keys as y } from "../util/code-utils.js";
3
- import { logger as N, IndexedDBAdapter as it } from "../../shared-lib/index.js";
3
+ import { logger as N, IndexedDBAdapter as tt } from "../../shared-lib/index.js";
4
4
  import { BRAZE_MUST_BE_INITIALIZED_ERROR as p } from "../common/constants.js";
5
5
  export function wipeData() {
6
6
  const o = r.j();
7
7
  if (null == o) return void N.warn(p);
8
8
  o.clearData();
9
- const t = y(it.Gs);
9
+ const t = y(tt._s);
10
10
  for (let o = 0; o < t.length; o++) {
11
11
  const n = t[o],
12
- r = it.Gs[n];
13
- new it(r, N).clearData();
12
+ r = tt._s[n];
13
+ new tt(r, N).clearData();
14
14
  }
15
15
  if (r.rr()) for (const o of r.lr()) o.clearData(!0);
16
16
  }