@braze/web-sdk 4.10.0 → 5.0.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 (107) hide show
  1. package/index.d.ts +19 -106
  2. package/package.json +1 -1
  3. package/shared-lib/braze-shared-lib.js +1 -1
  4. package/shared-lib/indexed-db-adapter.js +12 -12
  5. package/shared-lib/logger.js +2 -2
  6. package/shared-lib/supported-options.js +7 -8
  7. package/src/Card/models/captioned-image.js +19 -19
  8. package/src/Card/models/card.js +95 -94
  9. package/src/Card/models/classic-card.js +19 -19
  10. package/src/Card/models/control-card.js +9 -9
  11. package/src/Card/models/image-only.js +21 -22
  12. package/src/Card/models/index.js +0 -1
  13. package/src/Card/util/card-factory.js +39 -39
  14. package/src/ContentCards/content-cards-provider.js +114 -114
  15. package/src/ContentCards/get-cached-content-cards.js +1 -1
  16. package/src/ContentCards/index.js +0 -1
  17. package/src/ContentCards/request-content-cards-refresh.js +1 -1
  18. package/src/ContentCards/subscribe-to-content-cards-updates.js +3 -3
  19. package/src/ContentCards/ui/hide-content-cards.js +2 -2
  20. package/src/ContentCards/ui/show-content-cards.js +14 -14
  21. package/src/Core/add-sdk-metadata.js +2 -2
  22. package/src/Core/change-user.js +2 -2
  23. package/src/Core/disable-sdk.js +4 -4
  24. package/src/Core/enable-sdk.js +4 -4
  25. package/src/Core/handle-braze-action.js +14 -14
  26. package/src/Core/is-disabled.js +2 -2
  27. package/src/Core/open-session.js +5 -5
  28. package/src/Core/set-sdk-authentication-signature.js +2 -2
  29. package/src/Core/wipe-data.js +4 -4
  30. package/src/FeatureFlags/feature-flag-factory.js +10 -10
  31. package/src/FeatureFlags/feature-flag.js +7 -7
  32. package/src/FeatureFlags/feature-flags-provider.js +50 -50
  33. package/src/FeatureFlags/get-all-feature-flags.js +1 -1
  34. package/src/FeatureFlags/get-feature-flag.js +3 -5
  35. package/src/Feed/feed-provider-factory.js +8 -8
  36. package/src/Feed/feed-provider.js +15 -15
  37. package/src/Feed/get-cached-feed.js +2 -2
  38. package/src/Feed/request-feed-refresh.js +2 -2
  39. package/src/Feed/subscribe-to-feed-updates.js +2 -2
  40. package/src/Feed/ui/hide-feed.js +2 -2
  41. package/src/Feed/ui/show-feed.js +13 -13
  42. package/src/InAppMessage/display/html-message-to-html.js +11 -12
  43. package/src/InAppMessage/display/in-app-message-to-html.js +15 -15
  44. package/src/InAppMessage/display/modal-utils.js +8 -8
  45. package/src/InAppMessage/in-app-message-factory.js +4 -4
  46. package/src/InAppMessage/in-app-message-manager.js +38 -38
  47. package/src/InAppMessage/models/full-screen-message.js +31 -31
  48. package/src/InAppMessage/models/html-message.js +16 -16
  49. package/src/InAppMessage/models/in-app-message-button.js +5 -5
  50. package/src/InAppMessage/models/in-app-message.js +46 -46
  51. package/src/InAppMessage/models/modal-message.js +30 -30
  52. package/src/InAppMessage/models/slide-up-message.js +26 -26
  53. package/src/InAppMessage/ui/show-in-app-message.js +9 -9
  54. package/src/Push/is-push-blocked.js +2 -2
  55. package/src/Push/is-push-permission-granted.js +2 -2
  56. package/src/Push/is-push-supported.js +2 -2
  57. package/src/Push/push-manager.js +31 -31
  58. package/src/Push/utils/push-utils.js +9 -9
  59. package/src/User/user-manager.js +8 -8
  60. package/src/User/user.js +29 -29
  61. package/src/common/base-feed.js +15 -14
  62. package/src/common/base-provider.js +1 -1
  63. package/src/common/event-logger.js +2 -2
  64. package/src/common/feed-display.js +32 -32
  65. package/src/l10n/l10n-manager-factory.js +9 -9
  66. package/src/managers/auth-manager.js +6 -6
  67. package/src/managers/braze-instance.js +96 -106
  68. package/src/managers/device-manager.js +17 -17
  69. package/src/managers/network-manager.js +27 -27
  70. package/src/managers/server-config-manager.js +13 -13
  71. package/src/managers/session-manager.js +8 -8
  72. package/src/managers/storage-manager-factory.js +7 -7
  73. package/src/managers/storage-manager.js +104 -104
  74. package/src/managers/subscription-manager.js +2 -2
  75. package/src/models/braze-event.js +5 -5
  76. package/src/models/device.js +1 -1
  77. package/src/models/identifier.js +1 -1
  78. package/src/models/push-token.js +1 -1
  79. package/src/models/server-config.js +6 -6
  80. package/src/request-controller.js +52 -52
  81. package/src/triggers/models/custom-event-data.js +1 -1
  82. package/src/triggers/models/custom-event-property-data.js +6 -6
  83. package/src/triggers/models/filter-set.js +8 -8
  84. package/src/triggers/models/filter.js +25 -25
  85. package/src/triggers/models/in-app-message-click-data.js +1 -1
  86. package/src/triggers/models/purchase-data.js +1 -1
  87. package/src/triggers/models/purchase-property-data.js +4 -4
  88. package/src/triggers/models/push-click-data.js +3 -3
  89. package/src/triggers/models/trigger-condition.js +14 -14
  90. package/src/triggers/models/trigger-events.js +1 -1
  91. package/src/triggers/models/trigger.js +11 -11
  92. package/src/triggers/triggers-provider.js +38 -38
  93. package/src/ui/js/attach-css.js +1 -1
  94. package/src/ui/js/feed-css.js +5 -5
  95. package/src/ui/js/iam-css.js +4 -4
  96. package/src/ui/js/load-font-awesome.js +1 -1
  97. package/src/util/base-device-parser.js +1 -1
  98. package/src/util/braze-actions.js +4 -4
  99. package/src/util/browser-detector.js +14 -14
  100. package/src/util/client-hints-parser.js +2 -2
  101. package/src/util/component-utils.js +2 -2
  102. package/src/util/device-constants.js +4 -5
  103. package/src/util/dom-utils.js +5 -5
  104. package/src/util/request-header-utils.js +4 -4
  105. package/src/util/user-agent-parser.js +10 -15
  106. package/src/Card/models/banner.js +0 -31
  107. package/src/ContentCards/log-content-cards-displayed.js +0 -5
@@ -18,59 +18,59 @@ import { MAX_ERROR_RETRIES_CONTENT_CARDS as S } from "../common/constants.js";
18
18
  export default class v extends y {
19
19
  constructor(t, s, i, h, n) {
20
20
  super(),
21
- (this.ft = t),
21
+ (this.wt = t),
22
22
  (this.u = s),
23
- (this.wt = i),
24
- (this.vt = h),
25
- (this.gt = n),
26
- (this.ft = t),
23
+ (this.yt = i),
24
+ (this.Jt = h),
25
+ (this.$t = n),
26
+ (this.wt = t),
27
27
  (this.u = s),
28
- (this.wt = i),
29
- (this.vt = h),
30
- (this.gt = n),
31
- (this.yt = new E()),
32
- e.jt(this.yt),
33
- (this.kt = 0),
34
- (this.Ut = 0),
28
+ (this.yt = i),
29
+ (this.Jt = h),
30
+ (this.$t = n),
31
+ (this.Bt = new E()),
32
+ e.Ht(this.Bt),
33
+ (this.Kt = 0),
34
+ (this.Qt = 0),
35
35
  (this.cards = []),
36
- this.Lt();
37
- const o = r.zt.Ft;
38
- new r.xt(o, r.j).Mt(o.Jt.qt, (t) => {
39
- this.Pt(t);
36
+ this.Yt();
37
+ const o = r.ts.Zt;
38
+ new r.es(o, r.j).ss(o.rs.hs, (t) => {
39
+ this.ns(t);
40
40
  }),
41
- (this.$t = null),
42
- (this._t = null),
43
- (this.Bt = null),
44
- (this.Gt = null),
45
- (this.Ht = null),
46
- (this.Kt = 10),
47
- (this.Ot = 0);
41
+ (this.os = null),
42
+ (this.ls = null),
43
+ (this.us = null),
44
+ (this.cs = null),
45
+ (this.fs = null),
46
+ (this.ds = 10),
47
+ (this.ps = 0);
48
48
  }
49
- Qt() {
50
- return this.$t;
49
+ Cs() {
50
+ return this.os;
51
51
  }
52
- Vt(t) {
53
- this.$t = t;
52
+ ws(t) {
53
+ this.os = t;
54
54
  }
55
- Wt() {
56
- return this._t;
55
+ bs() {
56
+ return this.ls;
57
57
  }
58
- Xt(t) {
59
- this._t = t;
58
+ vs(t) {
59
+ this.ls = t;
60
60
  }
61
- Lt() {
61
+ Yt() {
62
62
  if (!this.u) return;
63
- const t = this.u.v(i.k.Yt) || [],
63
+ const t = this.u.v(i.k.gs) || [],
64
64
  s = [];
65
65
  for (let i = 0; i < t.length; i++) {
66
66
  const e = R(t[i]);
67
67
  null != e && s.push(e);
68
68
  }
69
- (this.cards = this.Zt(this.Cs(s, !1))),
70
- (this.kt = this.u.v(i.k.ws) || this.kt),
71
- (this.Ut = this.u.v(i.k.vs) || this.Ut);
69
+ (this.cards = this.ys(this.Ns(s, !1))),
70
+ (this.Kt = this.u.v(i.k.js) || this.Kt),
71
+ (this.Qt = this.u.v(i.k.Rs) || this.Qt);
72
72
  }
73
- Ns(t, s = !1, e = 0, h = 0) {
73
+ Ts(t, s = !1, e = 0, h = 0) {
74
74
  let r;
75
75
  if (s) {
76
76
  r = [];
@@ -91,7 +91,7 @@ export default class v extends y {
91
91
  const t = j(e);
92
92
  null != t && r.push(t);
93
93
  } else {
94
- if (!h.ot(e))
94
+ if (!h.Ct(e))
95
95
  for (let t = 0; t < r.length; t++)
96
96
  if (e.id === r[t].id) {
97
97
  r.splice(t, 1);
@@ -99,31 +99,31 @@ export default class v extends y {
99
99
  }
100
100
  }
101
101
  }
102
- (this.cards = this.Zt(this.Cs(r, s))),
103
- this.Rs(),
104
- (this.kt = e),
105
- (this.Ut = h),
106
- this.u && (this.u.D(i.k.ws, this.kt), this.u.D(i.k.vs, this.Ut));
102
+ (this.cards = this.ys(this.Ns(r, s))),
103
+ this.Ds(),
104
+ (this.Kt = e),
105
+ (this.Qt = h),
106
+ this.u && (this.u.D(i.k.js, this.Kt), this.u.D(i.k.Rs, this.Qt));
107
107
  }
108
- Ts(t) {
109
- if (this.Ds() && null != t && t.cards) {
110
- this.u && this.u.D(i.k.Ss, e.ks());
108
+ Ss(t) {
109
+ if (this.ks() && null != t && t.cards) {
110
+ this.u && this.u.D(i.k.Us, e.As());
111
111
  const s = t.full_sync;
112
- s || this.Lt(),
113
- this.Ns(t.cards, s, t.last_full_sync_at, t.last_card_updated_at),
114
- this.yt.Et(this.Us(!0));
112
+ s || this.Yt(),
113
+ this.Ts(t.cards, s, t.last_full_sync_at, t.last_card_updated_at),
114
+ this.Bt.Dt(this.Ls(!0));
115
115
  }
116
116
  }
117
- As(t) {
118
- this.u && this.u.D(i.k.Ls, t);
117
+ Fs(t) {
118
+ this.u && this.u.D(i.k.zs, t);
119
119
  }
120
- Fs(t, e, h) {
120
+ Ms(t, e, h) {
121
121
  const n = () => {
122
- this.Ms(e, h, !0);
122
+ this.xs(e, h, !0);
123
123
  },
124
124
  o = t ? b(t) : null;
125
125
  let l;
126
- if ((this.Es(), !o || !o["retry-after"])) return void this.As(0);
126
+ if ((this.Es(), !o || !o["retry-after"])) return void this.Fs(0);
127
127
  const a = o["retry-after"];
128
128
  if (isNaN(a) && !isNaN(Date.parse(a)))
129
129
  (l = Date.parse(a) - new Date().getTime()), l < 0 && n();
@@ -131,24 +131,24 @@ export default class v extends y {
131
131
  if (isNaN(parseFloat(a.toString()))) {
132
132
  const t =
133
133
  "Received unexpected value for retry-after header in /sync response";
134
- return s.N(r.q.qs, { e: t + ": " + a }), void this.As(0);
134
+ return s.N(r.q.qs, { e: t + ": " + a }), void this.Fs(0);
135
135
  }
136
136
  l = 1e3 * parseFloat(a.toString());
137
137
  }
138
- this.Bt = window.setTimeout(() => {
138
+ this.us = window.setTimeout(() => {
139
139
  n();
140
140
  }, l);
141
141
  let u = 0;
142
- this.u && (u = this.u.v(i.k.Ls)),
142
+ this.u && (u = this.u.v(i.k.zs)),
143
143
  (null == u || isNaN(parseInt(u.toString()))) && (u = 0),
144
- this.As(parseInt(u.toString()) + 1);
144
+ this.Fs(parseInt(u.toString()) + 1);
145
145
  }
146
- Pt(t) {
147
- if (!this.Ds()) return;
148
- this.Lt();
146
+ ns(t) {
147
+ if (!this.ks()) return;
148
+ this.Yt();
149
149
  const s = this.cards.slice();
150
150
  let i = null;
151
- this.ft && (i = this.ft.getUserId());
151
+ this.wt && (i = this.wt.getUserId());
152
152
  for (let e = 0; e < t.length; e++)
153
153
  if (i === t[e].userId || (null == i && null == t[e].userId)) {
154
154
  const i = t[e].card;
@@ -162,7 +162,7 @@ export default class v extends y {
162
162
  const t = j(i);
163
163
  null != t && s.push(t);
164
164
  } else {
165
- if (!h.ot(i))
165
+ if (!h.Ct(i))
166
166
  for (let t = 0; t < s.length; t++)
167
167
  if (i.id === s[t].id) {
168
168
  s.splice(t, 1);
@@ -170,9 +170,9 @@ export default class v extends y {
170
170
  }
171
171
  }
172
172
  }
173
- (this.cards = this.Zt(this.Cs(s, !1))), this.Rs(), this.yt.Et(this.Us(!0));
173
+ (this.cards = this.ys(this.Ns(s, !1))), this.Ds(), this.Bt.Dt(this.Ls(!0));
174
174
  }
175
- Cs(t, s) {
175
+ Ns(t, s) {
176
176
  let e = {},
177
177
  h = {},
178
178
  r = {};
@@ -197,7 +197,7 @@ export default class v extends y {
197
197
  t
198
198
  );
199
199
  }
200
- Zt(t) {
200
+ ys(t) {
201
201
  const s = [],
202
202
  e = new Date();
203
203
  let h = {};
@@ -205,7 +205,7 @@ export default class v extends y {
205
205
  let n = !1;
206
206
  for (let i = 0; i < t.length; i++) {
207
207
  const o = t[i].url;
208
- if (!this.vt && o && N(o)) {
208
+ if (!this.Jt && o && N(o)) {
209
209
  r.j.error(
210
210
  `Card with url ${o} will not be displayed because Javascript URLs are disabled. Use the "allowUserSuppliedJavascript" option for braze.initialize to enable this card.`,
211
211
  );
@@ -222,51 +222,51 @@ export default class v extends y {
222
222
  }
223
223
  return n && this.u && this.u.D(i.k.G, h), s;
224
224
  }
225
- Rs() {
225
+ Ds() {
226
226
  if (!this.u) return;
227
227
  const t = [];
228
- for (let s = 0; s < this.cards.length; s++) t.push(this.cards[s].ss());
229
- this.u.D(i.k.Yt, t);
228
+ for (let s = 0; s < this.cards.length; s++) t.push(this.cards[s].tt());
229
+ this.u.D(i.k.gs, t);
230
230
  }
231
231
  Es() {
232
- this.Bt && (clearTimeout(this.Bt), (this.Bt = null));
232
+ this.us && (clearTimeout(this.us), (this.us = null));
233
233
  }
234
234
  Is() {
235
- null != this.Gt && (clearTimeout(this.Gt), (this.Gt = null));
235
+ null != this.cs && (clearTimeout(this.cs), (this.cs = null));
236
236
  }
237
- Js(t = 1e3 * this.Kt, s, i) {
237
+ Js(t = 1e3 * this.ds, s, i) {
238
238
  this.Is(),
239
- (this.Gt = window.setTimeout(() => {
240
- this.Ms(s, i, !0);
239
+ (this.cs = window.setTimeout(() => {
240
+ this.xs(s, i, !0);
241
241
  }, t)),
242
- (this.Ht = t);
242
+ (this.fs = t);
243
243
  }
244
- Ms(t, s, h = !1, n = !0) {
244
+ xs(t, s, h = !1, n = !0) {
245
245
  var o;
246
- const l = this.gt,
246
+ const l = this.$t,
247
247
  a = this.u;
248
248
  if (!l || !a) return void ("function" == typeof s && s());
249
249
  const u = !h;
250
- if ((u && (this.Es(), this.As(0)), !this.Ds()))
250
+ if ((u && (this.Es(), this.Fs(0)), !this.ks()))
251
251
  return void (
252
- this.wt &&
253
- this.wt.Ps(() => {
254
- this.Ms(t, s);
252
+ this.yt &&
253
+ this.yt.Ps(() => {
254
+ this.xs(t, s);
255
255
  })
256
256
  );
257
257
  let c = !0;
258
258
  if (
259
259
  (u &&
260
- (null === (o = this.wt) || void 0 === o ? void 0 : o.$s()) &&
260
+ (null === (o = this.yt) || void 0 === o ? void 0 : o.$s()) &&
261
261
  (c = this._s()),
262
262
  !c)
263
263
  )
264
264
  return void r.j.info("Content card sync being throttled.");
265
265
  n && this.Is();
266
266
  const f = l.Bs({}, !0);
267
- a.v(i.k.Ss) !== e.ks() && this.Gs(),
268
- (f.last_full_sync_at = this.kt),
269
- (f.last_card_updated_at = this.Ut);
267
+ a.v(i.k.Us) !== e.As() && this.Gs(),
268
+ (f.last_full_sync_at = this.Kt),
269
+ (f.last_card_updated_at = this.Qt);
270
270
  const d = l.Hs(f, T.Os.Ks, h);
271
271
  let m = !1;
272
272
  l.Qs(f, () => {
@@ -282,8 +282,8 @@ export default class v extends y {
282
282
  if (!l.Zs(f, i, d))
283
283
  return (m = !0), void ("function" == typeof s && s());
284
284
  l.ti(),
285
- this.Fs(e, t, s),
286
- this.Ts(i),
285
+ this.Ms(e, t, s),
286
+ this.Ss(i),
287
287
  (m = !1),
288
288
  T.si(this.u, T.Os.Ks, 1),
289
289
  "function" == typeof t && t();
@@ -294,20 +294,20 @@ export default class v extends y {
294
294
  "function" == typeof s && s();
295
295
  },
296
296
  ei: () => {
297
- if (m && n && !this.Gt && this.Ot + 1 < S) {
297
+ if (m && n && !this.cs && this.ps + 1 < S) {
298
298
  T.hi(this.u, T.Os.Ks);
299
- let i = this.Ht;
300
- (null == i || i < 1e3 * this.Kt) && (i = 1e3 * this.Kt),
301
- this.Js(Math.min(3e5, D(1e3 * this.Kt, 3 * i)), t, s),
302
- (this.Ot = this.Ot + 1);
299
+ let i = this.fs;
300
+ (null == i || i < 1e3 * this.ds) && (i = 1e3 * this.ds),
301
+ this.Js(Math.min(3e5, D(1e3 * this.ds, 3 * i)), t, s),
302
+ (this.ps = this.ps + 1);
303
303
  }
304
304
  },
305
305
  });
306
306
  });
307
307
  }
308
- Us(t) {
309
- t || this.Lt();
310
- const s = this.Zt(this.cards);
308
+ Ls(t) {
309
+ t || this.Yt();
310
+ const s = this.ys(this.cards);
311
311
  s.sort((t, s) =>
312
312
  t.pinned && !s.pinned
313
313
  ? -1
@@ -319,48 +319,48 @@ export default class v extends y {
319
319
  ? 1
320
320
  : 0,
321
321
  );
322
- let e = Math.max(this.Ut || 0, this.kt || 0);
322
+ let e = Math.max(this.Qt || 0, this.Kt || 0);
323
323
  return (
324
324
  0 === e && (e = void 0),
325
- this.u && this.u.v(i.k.vs) === this.Ut && void 0 === e && (e = this.Ut),
325
+ this.u && this.u.v(i.k.Rs) === this.Qt && void 0 === e && (e = this.Qt),
326
326
  new ContentCards(s, l(e))
327
327
  );
328
328
  }
329
329
  ri(t) {
330
- return this.yt.lt(t);
330
+ return this.Bt.It(t);
331
331
  }
332
332
  Gs() {
333
- (this.kt = 0),
334
- (this.Ut = 0),
335
- this.u && (this.u.ni(i.k.ws), this.u.ni(i.k.vs));
333
+ (this.Kt = 0),
334
+ (this.Qt = 0),
335
+ this.u && (this.u.ni(i.k.js), this.u.ni(i.k.Rs));
336
336
  }
337
337
  changeUser(t) {
338
338
  t ||
339
339
  ((this.cards = []),
340
- this.yt.Et(new ContentCards(this.cards.slice(), null)),
340
+ this.Bt.Dt(new ContentCards(this.cards.slice(), null)),
341
341
  this.u &&
342
- (this.u.ni(i.k.Yt),
342
+ (this.u.ni(i.k.gs),
343
343
  this.u.ni(i.k.C),
344
344
  this.u.ni(i.k.K),
345
345
  this.u.ni(i.k.G))),
346
346
  this.Gs();
347
347
  }
348
348
  clearData(t) {
349
- (this.kt = 0),
350
- (this.Ut = 0),
349
+ (this.Kt = 0),
350
+ (this.Qt = 0),
351
351
  (this.cards = []),
352
- this.yt.Et(new ContentCards(this.cards.slice(), null)),
352
+ this.Bt.Dt(new ContentCards(this.cards.slice(), null)),
353
353
  t &&
354
354
  this.u &&
355
- (this.u.ni(i.k.Yt),
355
+ (this.u.ni(i.k.gs),
356
356
  this.u.ni(i.k.C),
357
357
  this.u.ni(i.k.K),
358
358
  this.u.ni(i.k.G),
359
- this.u.ni(i.k.ws),
360
- this.u.ni(i.k.vs));
359
+ this.u.ni(i.k.js),
360
+ this.u.ni(i.k.Rs));
361
361
  }
362
- Ds() {
363
- return !(this.wt && !this.wt.oi()) || (0 !== this.wt.li() && this.ai(), !1);
362
+ ks() {
363
+ return !(this.yt && !this.yt.oi()) || (0 !== this.yt.li() && this.ai(), !1);
364
364
  }
365
365
  ui(t) {
366
366
  this.u && this.u.D(i.k.ci, t);
@@ -370,7 +370,7 @@ export default class v extends y {
370
370
  }
371
371
  _s() {
372
372
  const t = this.u,
373
- s = this.wt;
373
+ s = this.yt;
374
374
  if (!t || !s) return !0;
375
375
  const e = t.v(i.k.Vs);
376
376
  if (null == e || isNaN(e)) return !0;
@@ -386,6 +386,6 @@ export default class v extends y {
386
386
  );
387
387
  }
388
388
  ai() {
389
- this.yt.Et(new ContentCards([], new Date())), this.u && this.u.ni(i.k.Yt);
389
+ this.Bt.Dt(new ContentCards([], new Date())), this.u && this.u.ni(i.k.gs);
390
390
  }
391
391
  }
@@ -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.rr()) return g.er().Us(!1);
4
+ if (e.rr()) return g.er().Ls(!1);
5
5
  }
@@ -1,7 +1,6 @@
1
1
  export { default as ContentCards } from "./content-cards.js";
2
2
  export { getCachedContentCards } from "./get-cached-content-cards.js";
3
3
  export { hideContentCards } from "./ui/hide-content-cards.js";
4
- export { logContentCardsDisplayed } from "./log-content-cards-displayed.js";
5
4
  export { requestContentCardsRefresh } from "./request-content-cards-refresh.js";
6
5
  export { showContentCards } from "./ui/show-content-cards.js";
7
6
  export { subscribeToContentCardsUpdates } from "./subscribe-to-content-cards-updates.js";
@@ -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.rr()) return g.er().Ms(r, t);
4
+ if (e.rr()) return g.er().xs(r, t);
5
5
  }
@@ -4,13 +4,13 @@ export function subscribeToContentCardsUpdates(r) {
4
4
  if (!e.rr()) return;
5
5
  const t = g.er(),
6
6
  n = t.ri(r);
7
- if (!t.Wt()) {
7
+ if (!t.bs()) {
8
8
  const r = e.cr();
9
9
  if (r) {
10
10
  const n = r.pr(() => {
11
- t.Ms();
11
+ t.xs();
12
12
  });
13
- n && t.Xt(n);
13
+ n && t.vs(n);
14
14
  }
15
15
  }
16
16
  return n;
@@ -1,8 +1,8 @@
1
1
  import e from "../../managers/braze-instance.js";
2
- import { destroyFeedHtml as k } from "../../common/feed-display.js";
2
+ import { destroyFeedHtml as z } from "../../common/feed-display.js";
3
3
  export function hideContentCards(n) {
4
4
  if (!e.rr()) return;
5
5
  const o = document.querySelectorAll(".ab-feed");
6
6
  for (let e = 0; e < o.length; e++)
7
- (null == n || (null != n && o[e].parentNode === n)) && k(o[e]);
7
+ (null == n || (null != n && o[e].parentNode === n)) && z(o[e]);
8
8
  }
@@ -2,28 +2,28 @@ import e, { OPTIONS as L } from "../../managers/braze-instance.js";
2
2
  import { ContentCards, subscribeToContentCardsUpdates } from "../index.js";
3
3
  import g from "../content-cards-provider-factory.js";
4
4
  import {
5
- destroyFeedHtml as k,
5
+ destroyFeedHtml as z,
6
6
  detectFeedImpressions as q,
7
7
  feedToHtml as I,
8
8
  LAST_REQUESTED_REFRESH_DATA_ATTRIBUTE as M,
9
9
  refreshFeed as $,
10
- registerFeedSubscriptionId as A,
11
- updateFeedCards as B,
10
+ registerFeedSubscriptionId as k,
11
+ updateFeedCards as A,
12
12
  } from "../../common/feed-display.js";
13
- import { setCardHeight as F } from "../../Card/display/card-display.js";
14
- import { setupFeedUI as G } from "../../ui/js/index.js";
13
+ import { setCardHeight as B } from "../../Card/display/card-display.js";
14
+ import { setupFeedUI as F } from "../../ui/js/index.js";
15
15
  import r from "../../../shared-lib/braze-shared-lib.js";
16
16
  export function showContentCards(n, t) {
17
17
  if (!e.rr()) return;
18
- G();
18
+ F();
19
19
  let o = !1;
20
20
  null == n && ((n = document.body), (o = !0));
21
21
  const a = e.nn(L.tn) || e.nn(L.en) || !1,
22
- i = g.er().Us(!1);
23
- "function" == typeof t && B(i, t(i.cards.slice()), i.lastUpdated, null, a);
22
+ i = g.er().Ls(!1);
23
+ "function" == typeof t && A(i, t(i.cards.slice()), i.lastUpdated, null, a);
24
24
  const s = I(i, a, o),
25
25
  l = g.er(),
26
- f = l.Qt();
26
+ f = l.Cs();
27
27
  (null == i.lastUpdated ||
28
28
  new Date().valueOf() - i.lastUpdated.valueOf() > ContentCards.mr) &&
29
29
  (null == f || new Date().valueOf() - f > ContentCards.mr) &&
@@ -31,7 +31,7 @@ export function showContentCards(n, t) {
31
31
  `Cached content cards were older than max TTL of ${ContentCards.mr} ms, requesting an update from the server.`,
32
32
  ),
33
33
  $(i, s),
34
- l.Vt(new Date().valueOf()));
34
+ l.ws(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];
@@ -49,22 +49,22 @@ export function showContentCards(n, t) {
49
49
  }
50
50
  let o = n.cards;
51
51
  "function" == typeof t && (o = t(o.slice())),
52
- B(i, o, n.lastUpdated, s, a);
52
+ A(i, o, n.lastUpdated, s, a);
53
53
  });
54
- A(u, s);
54
+ k(u, s);
55
55
  const d = function (n) {
56
56
  const t = n.querySelectorAll(".ab-feed");
57
57
  let e = null;
58
58
  for (let o = 0; o < t.length; o++) t[o].parentNode === n && (e = t[o]);
59
59
  null != e
60
- ? (k(e), null != e.parentNode && e.parentNode.replaceChild(s, e))
60
+ ? (z(e), null != e.parentNode && e.parentNode.replaceChild(s, e))
61
61
  : n.appendChild(s),
62
62
  setTimeout(function () {
63
63
  s.className = s.className.replace("ab-hide", "ab-show");
64
64
  }, 0),
65
65
  o && s.focus(),
66
66
  q(i, s),
67
- F(i.cards, n);
67
+ B(i.cards, n);
68
68
  };
69
69
  var m;
70
70
  null != n
@@ -2,7 +2,7 @@ import K from "../managers/braze-instance.js";
2
2
  import BrazeSdkMetadata from "./braze-sdk-metadata.js";
3
3
  import {
4
4
  isArray as p,
5
- validateValueIsFromEnum as H,
5
+ validateValueIsFromEnum as G,
6
6
  } from "../util/code-utils.js";
7
7
  import r from "../../shared-lib/braze-shared-lib.js";
8
8
  export function addSdkMetadata(a) {
@@ -13,7 +13,7 @@ export function addSdkMetadata(a) {
13
13
  );
14
14
  for (const t of a)
15
15
  if (
16
- !H(
16
+ !G(
17
17
  BrazeSdkMetadata,
18
18
  t,
19
19
  "sdkMetadata contained an invalid value.",
@@ -2,7 +2,7 @@ import e from "../managers/braze-instance.js";
2
2
  import { getByteLength as U } from "../util/string-utils.js";
3
3
  import r from "../../shared-lib/braze-shared-lib.js";
4
4
  import { User } from "../User/index.js";
5
- import { validateStandardString as J } from "../util/validation-utils.js";
5
+ import { validateStandardString as H } from "../util/validation-utils.js";
6
6
  export function changeUser(i, t) {
7
7
  if (!e.rr()) return;
8
8
  if (null == i || 0 === i.length || i != i)
@@ -11,7 +11,7 @@ export function changeUser(i, t) {
11
11
  return void r.j.error(
12
12
  `Rejected user id "${i}" because it is longer than ${User.lr} bytes.`,
13
13
  );
14
- if (null != t && !J(t, "set signature for new user", "signature")) return;
14
+ if (null != t && !H(t, "set signature for new user", "signature")) return;
15
15
  const s = e.cr();
16
16
  s && s.changeUser(i.toString(), e.gr(), t);
17
17
  }
@@ -1,14 +1,14 @@
1
1
  import e from "../managers/braze-instance.js";
2
2
  import r from "../../shared-lib/braze-shared-lib.js";
3
- import O, { STORAGE_KEYS as i } from "../managers/storage-manager.js";
3
+ import J, { STORAGE_KEYS as i } from "../managers/storage-manager.js";
4
4
  export function disableSDK() {
5
5
  const a = e.cr();
6
6
  a && a.requestImmediateDataFlush();
7
- const s = new O.ee(null, !0),
7
+ const s = new J.ee(null, !0),
8
8
  n = "This-cookie-will-expire-in-" + s.ae();
9
9
  s.store(i.re, n);
10
- const o = r.zt.Ft;
11
- new r.xt(o, r.j).setItem(o.Jt.se, o.ie, !0),
10
+ const o = r.ts.Zt;
11
+ new r.es(o, r.j).setItem(o.rs.se, o.ie, !0),
12
12
  r.j.info("disableSDK was called"),
13
13
  e.destroy(!1),
14
14
  e.ne(!0);
@@ -1,10 +1,10 @@
1
1
  import e from "../managers/braze-instance.js";
2
2
  import r from "../../shared-lib/braze-shared-lib.js";
3
- import O, { STORAGE_KEYS as i } from "../managers/storage-manager.js";
3
+ import J, { STORAGE_KEYS as i } from "../managers/storage-manager.js";
4
4
  export function enableSDK() {
5
- new O.ee(null, !0).remove(i.re);
6
- const a = r.zt.Ft;
7
- new r.xt(a, r.j).oe(a.Jt.se, a.ie),
5
+ new J.ee(null, !0).remove(i.re);
6
+ const a = r.ts.Zt;
7
+ new r.es(a, r.j).oe(a.rs.se, a.ie),
8
8
  r.j.info("enableSDK was called"),
9
9
  e.destroy(!1),
10
10
  e.ne(!1);