@braze/web-sdk 5.4.0 → 5.5.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 (77) hide show
  1. package/index.d.ts +3 -3
  2. package/package.json +1 -1
  3. package/shared-lib/event-types.js +12 -12
  4. package/shared-lib/indexed-db-adapter.js +14 -14
  5. package/shared-lib/logger.js +2 -2
  6. package/shared-lib/supported-options.js +5 -5
  7. package/src/Card/card-manager.js +46 -42
  8. package/src/Card/models/card.js +61 -55
  9. package/src/Card/models/classic-card.js +1 -1
  10. package/src/Card/models/control-card.js +1 -1
  11. package/src/Card/models/image-only.js +1 -1
  12. package/src/Card/util/card-factory.js +20 -20
  13. package/src/ContentCards/content-cards-provider.js +140 -140
  14. package/src/ContentCards/get-cached-content-cards.js +1 -1
  15. package/src/ContentCards/request-content-cards-refresh.js +1 -1
  16. package/src/ContentCards/subscribe-to-content-cards-updates.js +4 -4
  17. package/src/ContentCards/ui/show-content-cards.js +3 -3
  18. package/src/Core/disable-sdk.js +2 -2
  19. package/src/Core/enable-sdk.js +2 -2
  20. package/src/Core/log-custom-event.js +14 -14
  21. package/src/Core/log-purchase.js +8 -8
  22. package/src/Core/open-session.js +4 -4
  23. package/src/Core/wipe-data.js +2 -2
  24. package/src/FeatureFlags/feature-flag-factory.js +5 -5
  25. package/src/FeatureFlags/feature-flag.js +1 -1
  26. package/src/FeatureFlags/feature-flags-provider.js +74 -74
  27. package/src/FeatureFlags/get-all-feature-flags.js +2 -2
  28. package/src/FeatureFlags/get-feature-flag.js +2 -2
  29. package/src/FeatureFlags/log-feature-flag-impression.js +12 -12
  30. package/src/FeatureFlags/subscribe-to-feature-flags-updates.js +2 -2
  31. package/src/Feed/feed-provider.js +29 -29
  32. package/src/Feed/get-cached-feed.js +1 -1
  33. package/src/Feed/request-feed-refresh.js +1 -1
  34. package/src/Feed/subscribe-to-feed-updates.js +1 -1
  35. package/src/Feed/ui/show-feed.js +1 -1
  36. package/src/InAppMessage/in-app-message-manager.js +63 -63
  37. package/src/InAppMessage/log-in-app-message-button-click.js +2 -2
  38. package/src/InAppMessage/log-in-app-message-click.js +2 -2
  39. package/src/InAppMessage/log-in-app-message-html-click.js +2 -2
  40. package/src/InAppMessage/log-in-app-message-impression.js +1 -1
  41. package/src/InAppMessage/models/full-screen-message.js +10 -10
  42. package/src/InAppMessage/models/html-message.js +13 -13
  43. package/src/InAppMessage/models/in-app-message-button.js +4 -4
  44. package/src/InAppMessage/models/in-app-message.js +59 -59
  45. package/src/InAppMessage/models/modal-message.js +9 -9
  46. package/src/InAppMessage/models/slide-up-message.js +11 -11
  47. package/src/InAppMessage/models/templated-in-app-message.js +8 -8
  48. package/src/Push/push-manager-factory.js +4 -4
  49. package/src/Push/push-manager.js +6 -6
  50. package/src/Push/utils/push-utils.js +1 -1
  51. package/src/User/user-manager.js +6 -6
  52. package/src/User/user.js +27 -27
  53. package/src/common/base-provider.js +1 -1
  54. package/src/common/event-logger.js +7 -7
  55. package/src/common/feed-display.js +1 -1
  56. package/src/managers/auth-manager.js +9 -9
  57. package/src/managers/braze-instance.js +44 -44
  58. package/src/managers/network-manager.js +100 -100
  59. package/src/managers/server-config-manager.js +24 -24
  60. package/src/managers/session-manager.js +10 -10
  61. package/src/managers/storage-manager.js +20 -20
  62. package/src/managers/subscription-manager.js +2 -2
  63. package/src/models/backend-errors.js +4 -4
  64. package/src/models/braze-event.js +1 -1
  65. package/src/models/device.js +1 -1
  66. package/src/models/request-result.js +1 -1
  67. package/src/models/server-config.js +5 -5
  68. package/src/request-controller.js +121 -121
  69. package/src/triggers/models/filter.js +9 -9
  70. package/src/triggers/models/trigger-condition.js +26 -26
  71. package/src/triggers/models/trigger-events.js +1 -1
  72. package/src/triggers/models/trigger.js +7 -7
  73. package/src/triggers/triggers-provider.js +27 -27
  74. package/src/ui/js/attach-css.js +1 -1
  75. package/src/util/braze-actions.js +4 -4
  76. package/src/util/net.js +4 -4
  77. package/src/util/request-header-utils.js +17 -17
@@ -10,7 +10,7 @@ import {
10
10
  } from "../Card/util/card-factory.js";
11
11
  import { STORAGE_KEYS as o } from "../managers/storage-manager.js";
12
12
  import T from "../managers/subscription-manager.js";
13
- import s from "../common/event-logger.js";
13
+ import t from "../common/event-logger.js";
14
14
  import D from "../util/request-header-utils.js";
15
15
  import { randomInclusive as U } from "../util/math.js";
16
16
  import { MAX_ERROR_RETRIES_CONTENT_CARDS as k } from "../common/constants.js";
@@ -22,59 +22,59 @@ import {
22
22
  export default class v extends y {
23
23
  constructor(t, s, i, h, n) {
24
24
  super(),
25
- (this.wt = t),
25
+ (this.yt = t),
26
26
  (this.u = s),
27
- (this.yt = i),
28
- (this.Ft = h),
29
- (this.qt = n),
30
- (this.wt = t),
27
+ (this.qt = i),
28
+ (this.Jt = h),
29
+ (this.$t = n),
30
+ (this.yt = t),
31
31
  (this.u = s),
32
- (this.yt = i),
33
- (this.Ft = h),
34
- (this.qt = n),
35
- (this.Jt = new T()),
36
- e.$t(this.Jt),
37
- (this.Bt = 0),
38
- (this.Ht = 0),
32
+ (this.qt = i),
33
+ (this.Jt = h),
34
+ (this.$t = n),
35
+ (this.Bt = new T()),
36
+ e.Ht(this.Bt),
37
+ (this.Kt = 0),
38
+ (this.Qt = 0),
39
39
  (this.cards = []),
40
- this.Kt();
41
- const o = A.Yt.Qt;
42
- new A(o, r).Zt(o.ss.ts, (t) => {
43
- this.es(t);
40
+ this.Yt();
41
+ const o = A.ts.Zt;
42
+ new A(o, r).ss(o.hs.es, (t) => {
43
+ this.rs(t);
44
44
  }),
45
- (this.hs = null),
46
- (this.rs = null),
47
45
  (this.ns = null),
48
46
  (this.os = null),
49
47
  (this.ls = null),
50
- (this.us = 10),
51
- (this.cs = 0);
52
- }
53
- fs() {
54
- return this.hs;
55
- }
56
- ds(t) {
57
- this.hs = t;
48
+ (this.us = null),
49
+ (this.cs = null),
50
+ (this.fs = 10),
51
+ (this.ds = 0);
58
52
  }
59
53
  ps() {
60
- return this.rs;
54
+ return this.ns;
61
55
  }
62
56
  vs(t) {
63
- this.rs = t;
57
+ this.ns = t;
58
+ }
59
+ ws() {
60
+ return this.os;
61
+ }
62
+ Cs(t) {
63
+ this.os = t;
64
64
  }
65
- Kt() {
65
+ Yt() {
66
66
  if (!this.u) return;
67
- const t = this.u.j(o.C.ws) || [],
67
+ const t = this.u.j(o.C.bs) || [],
68
68
  s = [];
69
69
  for (let i = 0; i < t.length; i++) {
70
70
  const e = S(t[i]);
71
71
  null != e && s.push(e);
72
72
  }
73
- (this.cards = this.Cs(this.bs(s, !1))),
74
- (this.Bt = this.u.j(o.C.gs) || this.Bt),
75
- (this.Ht = this.u.j(o.C.ys) || this.Ht);
73
+ (this.cards = this.gs(this.ys(s, !1))),
74
+ (this.Kt = this.u.j(o.C.js) || this.Kt),
75
+ (this.Qt = this.u.j(o.C.Rs) || this.Qt);
76
76
  }
77
- js(t, s = !1, i = 0, e = 0) {
77
+ Ns(t, s = !1, i = 0, e = 0) {
78
78
  let h;
79
79
  if (s) {
80
80
  h = [];
@@ -95,7 +95,7 @@ export default class v extends y {
95
95
  const t = N(e);
96
96
  null != t && h.push(t);
97
97
  } else {
98
- if (!r.Ct(e))
98
+ if (!r.Lt(e))
99
99
  for (let t = 0; t < h.length; t++)
100
100
  if (e.id === h[t].id) {
101
101
  h.splice(t, 1);
@@ -103,57 +103,57 @@ export default class v extends y {
103
103
  }
104
104
  }
105
105
  }
106
- (this.cards = this.Cs(this.bs(h, s))),
107
- this.Rs(),
108
- (this.Bt = i),
109
- (this.Ht = e),
110
- this.u && (this.u.k(o.C.gs, this.Bt), this.u.k(o.C.ys, this.Ht));
106
+ (this.cards = this.gs(this.ys(h, s))),
107
+ this.Ts(),
108
+ (this.Kt = i),
109
+ (this.Qt = e),
110
+ this.u && (this.u.I(o.C.js, this.Kt), this.u.I(o.C.Rs, this.Qt));
111
111
  }
112
- Ns(t) {
113
- if (this.Ts() && null != t && t.cards) {
114
- this.u && this.u.k(o.C.Ss, e.Ds());
112
+ Ss(t) {
113
+ if (this.Ds() && null != t && t.cards) {
114
+ this.u && this.u.I(o.C.Us, e.ks());
115
115
  const s = t.full_sync;
116
- s || this.Kt(),
117
- this.js(t.cards, s, t.last_full_sync_at, t.last_card_updated_at),
118
- this.Jt.Dt(this.Us(!0));
116
+ s || this.Yt(),
117
+ this.Ns(t.cards, s, t.last_full_sync_at, t.last_card_updated_at),
118
+ this.Bt.Rt(this.As(!0));
119
119
  }
120
120
  }
121
- ks(t) {
122
- this.u && this.u.k(o.C.As, t);
121
+ Fs(t) {
122
+ this.u && this.u.I(o.C.xs, t);
123
123
  }
124
- Fs(t, e, h) {
124
+ zs(s, e, h) {
125
125
  const r = () => {
126
- this.xs(e, h, !0);
126
+ this.qs(e, h, !0);
127
127
  },
128
- n = t ? b(t) : null;
128
+ n = s ? b(s) : null;
129
129
  let l;
130
- if ((this.zs(), !n || !n["retry-after"])) return void this.ks(0);
130
+ if ((this.Es(), !n || !n["retry-after"])) return void this.Fs(0);
131
131
  const a = n["retry-after"];
132
132
  if (isNaN(a) && !isNaN(Date.parse(a)))
133
133
  (l = Date.parse(a) - new Date().getTime()), l < 0 && r();
134
134
  else {
135
135
  if (isNaN(parseFloat(a.toString()))) {
136
- const t =
136
+ const s =
137
137
  "Received unexpected value for retry-after header in /sync response";
138
- return s.q(i.qs, { e: t + ": " + a }), void this.ks(0);
138
+ return t.q(i.Ls, { e: s + ": " + a }), void this.Fs(0);
139
139
  }
140
140
  l = 1e3 * parseFloat(a.toString());
141
141
  }
142
- this.ns = window.setTimeout(() => {
142
+ this.ls = window.setTimeout(() => {
143
143
  r();
144
144
  }, l);
145
145
  let u = 0;
146
- this.u && (u = this.u.j(o.C.As)),
146
+ this.u && (u = this.u.j(o.C.xs)),
147
147
  (null == u || isNaN(parseInt(u.toString()))) && (u = 0),
148
- this.ks(parseInt(u.toString()) + 1);
148
+ this.Fs(parseInt(u.toString()) + 1);
149
149
  }
150
- es(t) {
150
+ rs(t) {
151
151
  var s;
152
- if (!this.Ts()) return;
153
- this.Kt();
152
+ if (!this.Ds()) return;
153
+ this.Yt();
154
154
  const i = this.cards.slice();
155
155
  let e = null;
156
- e = null === (s = this.wt) || void 0 === s ? void 0 : s.getUserId();
156
+ e = null === (s = this.yt) || void 0 === s ? void 0 : s.getUserId();
157
157
  for (let s = 0; s < t.length; s++)
158
158
  if (e === t[s].userId || (null == e && null == t[s].userId)) {
159
159
  const e = t[s].card;
@@ -167,7 +167,7 @@ export default class v extends y {
167
167
  const t = N(e);
168
168
  null != t && i.push(t);
169
169
  } else {
170
- if (!h.Ct(e))
170
+ if (!h.Lt(e))
171
171
  for (let t = 0; t < i.length; t++)
172
172
  if (e.id === i[t].id) {
173
173
  i.splice(t, 1);
@@ -175,9 +175,9 @@ export default class v extends y {
175
175
  }
176
176
  }
177
177
  }
178
- (this.cards = this.Cs(this.bs(i, !1))), this.Rs(), this.Jt.Dt(this.Us(!0));
178
+ (this.cards = this.gs(this.ys(i, !1))), this.Ts(), this.Bt.Rt(this.As(!0));
179
179
  }
180
- bs(t, s) {
180
+ ys(t, s) {
181
181
  let i = {},
182
182
  e = {},
183
183
  h = {};
@@ -198,11 +198,11 @@ export default class v extends y {
198
198
  return (
199
199
  s &&
200
200
  this.u &&
201
- (this.u.k(o.C.v, r), this.u.k(o.C.H, n), this.u.k(o.C.A, l)),
201
+ (this.u.I(o.C.v, r), this.u.I(o.C.H, n), this.u.I(o.C.A, l)),
202
202
  t
203
203
  );
204
204
  }
205
- Cs(t) {
205
+ gs(t) {
206
206
  const s = [],
207
207
  i = new Date();
208
208
  let e = {};
@@ -210,7 +210,7 @@ export default class v extends y {
210
210
  let h = !1;
211
211
  for (let n = 0; n < t.length; n++) {
212
212
  const o = t[n].url;
213
- if (!this.Ft && o && R(o)) {
213
+ if (!this.Jt && o && R(o)) {
214
214
  r.error(
215
215
  `Card with url ${o} will not be displayed because Javascript URLs are disabled. Use the "allowUserSuppliedJavascript" option for braze.initialize to enable this card.`,
216
216
  );
@@ -225,92 +225,92 @@ export default class v extends y {
225
225
  s && (e[s] = !0), (h = !0);
226
226
  }
227
227
  }
228
- return h && this.u && this.u.k(o.C.A, e), s;
228
+ return h && this.u && this.u.I(o.C.A, e), s;
229
229
  }
230
- Rs() {
230
+ Ts() {
231
231
  var t;
232
232
  const s = [];
233
233
  for (let t = 0; t < this.cards.length; t++) s.push(this.cards[t].Y());
234
- null === (t = this.u) || void 0 === t || t.k(o.C.ws, s);
235
- }
236
- zs() {
237
- this.ns && (clearTimeout(this.ns), (this.ns = null));
234
+ null === (t = this.u) || void 0 === t || t.I(o.C.bs, s);
238
235
  }
239
236
  Es() {
240
- null != this.os && (clearTimeout(this.os), (this.os = null));
237
+ this.ls && (clearTimeout(this.ls), (this.ls = null));
241
238
  }
242
- Ls(t = 1e3 * this.us, s, i) {
243
- this.Es(),
244
- (this.os = window.setTimeout(() => {
245
- this.xs(s, i, !0);
239
+ Is() {
240
+ null != this.us && (clearTimeout(this.us), (this.us = null));
241
+ }
242
+ Js(t = 1e3 * this.fs, s, i) {
243
+ this.Is(),
244
+ (this.us = window.setTimeout(() => {
245
+ this.qs(s, i, !0);
246
246
  }, t)),
247
- (this.ls = t);
247
+ (this.cs = t);
248
248
  }
249
- xs(t, s, i = !1, h = !0) {
249
+ qs(t, s, i = !1, h = !0) {
250
250
  var r;
251
- const n = this.qt,
251
+ const n = this.$t,
252
252
  l = this.u;
253
253
  if (!n || !l) return void ("function" == typeof s && s());
254
- if ((!i && (this.zs(), this.ks(0)), !this.Ts()))
254
+ if ((!i && (this.Es(), this.Fs(0)), !this.Ds()))
255
255
  return void (
256
- null === (r = this.yt) ||
256
+ null === (r = this.qt) ||
257
257
  void 0 === r ||
258
- r.Is(() => {
259
- this.xs(t, s);
258
+ r.Ms(() => {
259
+ this.qs(t, s);
260
260
  })
261
261
  );
262
- h && this.Es();
263
- const a = n.Js({}, !0);
264
- l.j(o.C.Ss) !== e.Ds() && this.Ms(),
265
- (a.last_full_sync_at = this.Bt),
266
- (a.last_card_updated_at = this.Ht);
267
- const u = n.$s(a, D.Ps.Bs, i);
262
+ h && this.Is();
263
+ const a = n.$s({}, !0);
264
+ l.j(o.C.Us) !== e.ks() && this.Bs(),
265
+ (a.last_full_sync_at = this.Kt),
266
+ (a.last_card_updated_at = this.Qt);
267
+ const u = n.Ps(a, D._s.Xs, i);
268
268
  let c = !1;
269
- n.Xs(
269
+ n.Gs(
270
270
  a,
271
271
  (i = -1) => {
272
272
  if (this.u) {
273
273
  const t = new Date().valueOf();
274
- D._s(this.u, D.Ps.Bs, t);
274
+ D.Hs(this.u, D._s.Xs, t);
275
275
  }
276
276
  -1 !== i && u.push(["X-Braze-Req-Tokens-Remaining", i.toString()]),
277
- C.Gs({
278
- url: `${n.Hs()}/content_cards/sync`,
277
+ C.Ks({
278
+ url: `${n.Os()}/content_cards/sync`,
279
279
  data: a,
280
280
  headers: u,
281
281
  L: (i, e) => {
282
- if (!n.Ks(a, i, u))
282
+ if (!n.Qs(a, i, u))
283
283
  return (c = !0), void ("function" == typeof s && s());
284
- n.Os(),
285
- this.Fs(e, t, s),
286
- this.Ns(i),
284
+ n.Vs(),
285
+ this.zs(e, t, s),
286
+ this.Ss(i),
287
287
  (c = !1),
288
- D.Qs(this.u, D.Ps.Bs, 1),
288
+ D.Ws(this.u, D._s.Xs, 1),
289
289
  "function" == typeof t && t();
290
290
  },
291
291
  error: (t) => {
292
- n.Vs(t, "retrieving content cards"),
292
+ n.Ys(t, "retrieving content cards"),
293
293
  (c = !0),
294
294
  "function" == typeof s && s();
295
295
  },
296
- Ws: () => {
297
- if (c && h && !this.os && this.cs + 1 < k) {
298
- D.Ys(this.u, D.Ps.Bs);
299
- let i = this.ls;
300
- (null == i || i < 1e3 * this.us) && (i = 1e3 * this.us),
301
- this.Ls(Math.min(3e5, U(1e3 * this.us, 3 * i)), t, s),
302
- (this.cs = this.cs + 1);
296
+ Zs: () => {
297
+ if (c && h && !this.us && this.ds + 1 < k) {
298
+ D.ti(this.u, D._s.Xs);
299
+ let i = this.cs;
300
+ (null == i || i < 1e3 * this.fs) && (i = 1e3 * this.fs),
301
+ this.Js(Math.min(3e5, U(1e3 * this.fs, 3 * i)), t, s),
302
+ (this.ds = this.ds + 1);
303
303
  }
304
304
  },
305
305
  });
306
306
  },
307
- D.Ps.Bs,
307
+ D._s.Xs,
308
308
  s,
309
309
  );
310
310
  }
311
- Us(t) {
312
- t || this.Kt();
313
- const s = this.Cs(this.cards);
311
+ As(t) {
312
+ t || this.Yt();
313
+ const s = this.gs(this.cards);
314
314
  s.sort((t, s) =>
315
315
  t.pinned && !s.pinned
316
316
  ? -1
@@ -322,52 +322,52 @@ export default class v extends y {
322
322
  ? 1
323
323
  : 0,
324
324
  );
325
- let i = Math.max(this.Ht || 0, this.Bt || 0);
325
+ let i = Math.max(this.Qt || 0, this.Kt || 0);
326
326
  return (
327
327
  0 === i && (i = void 0),
328
- this.u && this.u.j(o.C.ys) === this.Ht && void 0 === i && (i = this.Ht),
328
+ this.u && this.u.j(o.C.Rs) === this.Qt && void 0 === i && (i = this.Qt),
329
329
  new ContentCards(s, l(i))
330
330
  );
331
331
  }
332
- Zs(t) {
333
- return this.Jt.It(t);
332
+ si(t) {
333
+ return this.Bt.Nt(t);
334
334
  }
335
- Ms() {
336
- (this.Bt = 0),
337
- (this.Ht = 0),
338
- this.u && (this.u.ti(o.C.gs), this.u.ti(o.C.ys));
335
+ Bs() {
336
+ (this.Kt = 0),
337
+ (this.Qt = 0),
338
+ this.u && (this.u.ii(o.C.js), this.u.ii(o.C.Rs));
339
339
  }
340
340
  changeUser(t) {
341
341
  t ||
342
342
  ((this.cards = []),
343
- this.Jt.Dt(new ContentCards(this.cards.slice(), null)),
343
+ this.Bt.Rt(new ContentCards(this.cards.slice(), null)),
344
344
  this.u &&
345
- (this.u.ti(o.C.ws),
346
- this.u.ti(o.C.v),
347
- this.u.ti(o.C.H),
348
- this.u.ti(o.C.A))),
349
- this.Ms();
345
+ (this.u.ii(o.C.bs),
346
+ this.u.ii(o.C.v),
347
+ this.u.ii(o.C.H),
348
+ this.u.ii(o.C.A))),
349
+ this.Bs();
350
350
  }
351
351
  clearData(t) {
352
- (this.Bt = 0),
353
- (this.Ht = 0),
352
+ (this.Kt = 0),
353
+ (this.Qt = 0),
354
354
  (this.cards = []),
355
- this.Jt.Dt(new ContentCards(this.cards.slice(), null)),
355
+ this.Bt.Rt(new ContentCards(this.cards.slice(), null)),
356
356
  t &&
357
357
  this.u &&
358
- (this.u.ti(o.C.ws),
359
- this.u.ti(o.C.v),
360
- this.u.ti(o.C.H),
361
- this.u.ti(o.C.A),
362
- this.u.ti(o.C.gs),
363
- this.u.ti(o.C.ys));
358
+ (this.u.ii(o.C.bs),
359
+ this.u.ii(o.C.v),
360
+ this.u.ii(o.C.H),
361
+ this.u.ii(o.C.A),
362
+ this.u.ii(o.C.js),
363
+ this.u.ii(o.C.Rs));
364
364
  }
365
- Ts() {
365
+ Ds() {
366
366
  return (
367
- !!this.yt && (!!this.yt.si() || (0 !== this.yt.ii() && this.ei(), !1))
367
+ !!this.qt && (!!this.qt.ei() || (0 !== this.qt.hi() && this.ri(), !1))
368
368
  );
369
369
  }
370
- ei() {
371
- this.Jt.Dt(new ContentCards([], new Date())), this.u && this.u.ti(o.C.ws);
370
+ ri() {
371
+ this.Bt.Rt(new ContentCards([], new Date())), this.u && this.u.ii(o.C.bs);
372
372
  }
373
373
  }
@@ -1,5 +1,5 @@
1
1
  import g from "./content-cards-provider-factory.js";
2
2
  import e from "../managers/braze-instance.js";
3
3
  export function getCachedContentCards() {
4
- if (e.X()) return g.rr().Us(!1);
4
+ if (e.X()) return g.rr().As(!1);
5
5
  }
@@ -1,5 +1,5 @@
1
1
  import e from "../managers/braze-instance.js";
2
2
  import g from "./content-cards-provider-factory.js";
3
3
  export function requestContentCardsRefresh(r, t) {
4
- if (e.X()) return g.rr().xs(r, t);
4
+ if (e.X()) return g.rr().qs(r, t);
5
5
  }
@@ -3,14 +3,14 @@ import g from "./content-cards-provider-factory.js";
3
3
  export function subscribeToContentCardsUpdates(r) {
4
4
  if (!e.X()) return;
5
5
  const t = g.rr(),
6
- n = t.Zs(r);
7
- if (!t.ps()) {
6
+ n = t.si(r);
7
+ if (!t.ws()) {
8
8
  const r = e.cr();
9
9
  if (r) {
10
10
  const n = r.mr(() => {
11
- t.xs();
11
+ t.qs();
12
12
  });
13
- n && t.vs(n);
13
+ n && t.Cs(n);
14
14
  }
15
15
  }
16
16
  return n;
@@ -19,11 +19,11 @@ export function showContentCards(n, t) {
19
19
  let o = !1;
20
20
  null == n && ((n = document.body), (o = !0));
21
21
  const i = e.nn(L.tn) || e.nn(L.en) || !1,
22
- a = g.rr().Us(!1);
22
+ a = g.rr().As(!1);
23
23
  "function" == typeof t && F(a, t(a.cards.slice()), a.lastUpdated, null, i);
24
24
  const s = I(a, i, o),
25
25
  f = g.rr(),
26
- l = f.fs();
26
+ l = f.ps();
27
27
  (null == a.lastUpdated ||
28
28
  new Date().valueOf() - a.lastUpdated.valueOf() > ContentCards.ur) &&
29
29
  (null == l || new Date().valueOf() - l > ContentCards.ur) &&
@@ -31,7 +31,7 @@ export function showContentCards(n, t) {
31
31
  `Cached content cards were older than max TTL of ${ContentCards.ur} ms, requesting an update from the server.`,
32
32
  ),
33
33
  $(a, s),
34
- f.ds(new Date().valueOf()));
34
+ f.vs(new Date().valueOf()));
35
35
  const c = new Date().valueOf(),
36
36
  u = subscribeToContentCardsUpdates(function (n) {
37
37
  const e = s.querySelectorAll(".ab-refresh-button")[0];
@@ -7,8 +7,8 @@ export function disableSDK() {
7
7
  const s = new Q.ee(null, !0),
8
8
  a = "This-cookie-will-expire-in-" + s.ne();
9
9
  s.store(o.se, a);
10
- const i = A.Yt.Qt;
11
- new A(i, r).setItem(i.ss.ae, i.ie, !0),
10
+ const i = A.ts.Zt;
11
+ new A(i, r).setItem(i.hs.ae, i.ie, !0),
12
12
  r.info("disableSDK was called"),
13
13
  e.destroy(!1),
14
14
  e.oe(!0);
@@ -3,8 +3,8 @@ import { logger as r, IndexedDBAdapter as A } from "../../shared-lib/index.js";
3
3
  import Q, { STORAGE_KEYS as o } from "../managers/storage-manager.js";
4
4
  export function enableSDK() {
5
5
  new Q.ee(null, !0).remove(o.se);
6
- const a = A.Yt.Qt;
7
- new A(a, r).re(a.ss.ae, a.ie),
6
+ const a = A.ts.Zt;
7
+ new A(a, r).re(a.hs.ae, a.ie),
8
8
  r.info("enableSDK was called"),
9
9
  e.destroy(!1),
10
10
  e.oe(!1);
@@ -1,5 +1,5 @@
1
1
  import e from "../managers/braze-instance.js";
2
- import s from "../common/event-logger.js";
2
+ import t from "../common/event-logger.js";
3
3
  import { logger as r, EventTypes as i } from "../../shared-lib/index.js";
4
4
  import tt from "../triggers/models/trigger-events.js";
5
5
  import { TriggersProviderFactory as et } from "../triggers/triggers-provider-factory.js";
@@ -8,31 +8,31 @@ import {
8
8
  validateCustomString as rt,
9
9
  } from "../util/validation-utils.js";
10
10
  import { LOG_CUSTOM_EVENT_STRING as nt } from "../common/constants.js";
11
- export function logCustomEvent(t, o) {
11
+ export function logCustomEvent(o, n) {
12
12
  if (!e.X()) return !1;
13
- if (null == t || t.length <= 0)
13
+ if (null == o || o.length <= 0)
14
14
  return (
15
15
  r.error(
16
- `logCustomEvent requires a non-empty eventName, got "${t}". Ignoring event.`,
16
+ `logCustomEvent requires a non-empty eventName, got "${o}". Ignoring event.`,
17
17
  ),
18
18
  !1
19
19
  );
20
- if (!rt(t, "log custom event", "the event name")) return !1;
21
- const [n, m] = ot(
22
- o,
20
+ if (!rt(o, "log custom event", "the event name")) return !1;
21
+ const [s, m] = ot(
22
+ n,
23
23
  nt,
24
24
  "eventProperties",
25
- `log custom event "${t}"`,
25
+ `log custom event "${o}"`,
26
26
  "event",
27
27
  );
28
- if (!n) return !1;
28
+ if (!s) return !1;
29
29
  const g = e.ir();
30
- if (g && g.me(t))
31
- return r.info(`Custom Event "${t}" is blocklisted, ignoring.`), !1;
32
- const f = s.q(i.CustomEvent, { n: t, p: m });
30
+ if (g && g.me(o))
31
+ return r.info(`Custom Event "${o}" is blocklisted, ignoring.`), !1;
32
+ const f = t.q(i.CustomEvent, { n: o, p: m });
33
33
  if (f.L) {
34
- r.info(`Logged custom event "${t}".`);
35
- for (const e of f.ge) et.rr().fe(tt.ue, [t, o], e);
34
+ r.info(`Logged custom event "${o}".`);
35
+ for (const t of f.ge) et.rr().fe(tt.ue, [o, n], t);
36
36
  }
37
37
  return f.L;
38
38
  }
@@ -7,11 +7,11 @@ import {
7
7
  validateCustomProperties as ot,
8
8
  validateCustomString as rt,
9
9
  } from "../util/validation-utils.js";
10
- import s from "../common/event-logger.js";
11
- export function logPurchase(o, n, t, D, u) {
10
+ import t from "../common/event-logger.js";
11
+ export function logPurchase(o, n, s, D, u) {
12
12
  if (!e.X()) return !1;
13
13
  if (
14
- (null == t && (t = "USD"), null == D && (D = 1), null == o || o.length <= 0)
14
+ (null == s && (s = "USD"), null == D && (D = 1), null == o || o.length <= 0)
15
15
  )
16
16
  return (
17
17
  r.error(
@@ -38,7 +38,7 @@ export function logPurchase(o, n, t, D, u) {
38
38
  ),
39
39
  !1
40
40
  );
41
- t = null != t ? t.toUpperCase() : t;
41
+ s = null != s ? s.toUpperCase() : s;
42
42
  if (
43
43
  -1 ===
44
44
  [
@@ -213,10 +213,10 @@ export function logPurchase(o, n, t, D, u) {
213
213
  "ZMK",
214
214
  "ZMW",
215
215
  "ZWL",
216
- ].indexOf(t)
216
+ ].indexOf(s)
217
217
  )
218
218
  return (
219
- r.error(`logPurchase requires a valid currencyCode, got ${t}, ignoring.`),
219
+ r.error(`logPurchase requires a valid currencyCode, got ${s}, ignoring.`),
220
220
  !1
221
221
  );
222
222
  const [P, R] = ot(
@@ -230,9 +230,9 @@ export function logPurchase(o, n, t, D, u) {
230
230
  const c = e.ir();
231
231
  if (c && c.Dr(o))
232
232
  return r.info(`Purchase "${o}" is blocklisted, ignoring.`), !1;
233
- const l = s.q(i.Pr, { pid: o, c: t, p: a, q: g, pr: R });
233
+ const l = t.q(i.Pr, { pid: o, c: s, p: a, q: g, pr: R });
234
234
  if (l.L) {
235
- r.info(`Logged ${g} purchase${g > 1 ? "s" : ""} of "${o}" for ${t} ${a}.`);
235
+ r.info(`Logged ${g} purchase${g > 1 ? "s" : ""} of "${o}" for ${s} ${a}.`);
236
236
  for (const r of l.ge) et.rr().fe(tt.Rr, [o, u], r);
237
237
  }
238
238
  return l.L;
@@ -7,9 +7,9 @@ export function openSession() {
7
7
  const i = e.cr();
8
8
  if (!i) return;
9
9
  i.openSession();
10
- const t = A.Yt.Qt,
10
+ const t = A.ts.Zt,
11
11
  o = new A(t, r);
12
- o.jr(t.ss.hr, (n, e) => {
12
+ o.jr(t.hs.hr, (n, e) => {
13
13
  const s = e.lastClick,
14
14
  c = e.trackingString;
15
15
  r.info(`Firing push click trigger from ${c} push click at ${s}`);
@@ -17,9 +17,9 @@ export function openSession() {
17
17
  f = function () {
18
18
  et.rr().fe(tt.vr, [c], g);
19
19
  };
20
- i.$r(f, f), o.re(t.ss.hr, n);
20
+ i.$r(f, f), o.re(t.hs.hr, n);
21
21
  }),
22
- o.Zt(t.ss.wr, function (r) {
22
+ o.ss(t.hs.wr, function (r) {
23
23
  i.yr(r);
24
24
  });
25
25
  }