@braze/web-sdk 6.3.1 → 6.4.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 (132) hide show
  1. package/index.d.ts +35 -3
  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 +2 -2
  6. package/shared-lib/indexed-db-adapter.js +7 -7
  7. package/shared-lib/logger.js +2 -2
  8. package/shared-lib/supported-options.js +22 -21
  9. package/src/Banner/display/banner-to-html.js +2 -2
  10. package/src/Banner/display/detect-banner-impressions.js +7 -7
  11. package/src/Banner/index.js +2 -0
  12. package/src/Banner/request-banners-refresh.js +6 -6
  13. package/src/Banner/ui/insert-banner.js +4 -4
  14. package/src/Card/card-manager-factory.js +5 -5
  15. package/src/Card/card-manager.js +4 -4
  16. package/src/Card/display/card-display.js +7 -7
  17. package/src/Card/log-card-dismissal.js +3 -3
  18. package/src/Card/log-content-card-click.js +3 -3
  19. package/src/Card/log-content-card-impressions.js +6 -6
  20. package/src/Card/models/card.js +7 -7
  21. package/src/Card/util/card-factory.js +6 -6
  22. package/src/ContentCards/content-cards-provider-factory.js +14 -10
  23. package/src/ContentCards/content-cards-provider.js +28 -28
  24. package/src/ContentCards/content-cards.js +4 -4
  25. package/src/ContentCards/get-cached-content-cards.js +2 -2
  26. package/src/ContentCards/request-content-cards-refresh.js +2 -2
  27. package/src/ContentCards/subscribe-to-content-cards-updates.js +3 -3
  28. package/src/ContentCards/ui/show-content-cards.js +8 -8
  29. package/src/Core/add-sdk-metadata.js +2 -2
  30. package/src/Core/change-user.js +5 -5
  31. package/src/Core/disable-sdk.js +3 -3
  32. package/src/Core/enable-sdk.js +3 -3
  33. package/src/Core/get-user.js +1 -1
  34. package/src/Core/is-disabled.js +1 -1
  35. package/src/Core/log-custom-event.js +9 -9
  36. package/src/Core/log-purchase.js +7 -7
  37. package/src/Core/open-session.js +11 -11
  38. package/src/Core/set-sdk-authentication-signature.js +2 -2
  39. package/src/Core/wipe-data.js +5 -5
  40. package/src/DUST/dust-provider-factory.js +20 -0
  41. package/src/DUST/dust-provider.js +288 -0
  42. package/src/DUST/index.js +3 -0
  43. package/src/DUST/subscribe-to-dust.js +24 -0
  44. package/src/DUST/types.js +1 -0
  45. package/src/FeatureFlags/feature-flags-provider-factory.js +9 -9
  46. package/src/FeatureFlags/feature-flags-provider.js +38 -38
  47. package/src/FeatureFlags/get-all-feature-flags.js +3 -3
  48. package/src/FeatureFlags/get-feature-flag.js +3 -3
  49. package/src/FeatureFlags/log-feature-flag-impression.js +5 -5
  50. package/src/FeatureFlags/refresh-feature-flags.js +5 -5
  51. package/src/FeatureFlags/subscribe-to-feature-flags-updates.js +3 -3
  52. package/src/InAppMessage/defer-in-app-message.js +1 -1
  53. package/src/InAppMessage/display/html-message-to-html.js +5 -5
  54. package/src/InAppMessage/display/in-app-message-to-html.js +22 -22
  55. package/src/InAppMessage/display/modal-utils.js +5 -5
  56. package/src/InAppMessage/get-deferred-in-app-message.js +1 -1
  57. package/src/InAppMessage/in-app-message-factory.js +4 -4
  58. package/src/InAppMessage/in-app-message-manager.js +80 -80
  59. package/src/InAppMessage/log-in-app-message-button-click.js +5 -5
  60. package/src/InAppMessage/log-in-app-message-click.js +5 -5
  61. package/src/InAppMessage/log-in-app-message-html-click.js +5 -5
  62. package/src/InAppMessage/log-in-app-message-impression.js +1 -1
  63. package/src/InAppMessage/models/control-message.js +1 -1
  64. package/src/InAppMessage/models/full-screen-message.js +12 -12
  65. package/src/InAppMessage/models/html-message.js +14 -14
  66. package/src/InAppMessage/models/in-app-message-button.js +4 -4
  67. package/src/InAppMessage/models/in-app-message.js +119 -121
  68. package/src/InAppMessage/models/modal-message.js +12 -12
  69. package/src/InAppMessage/models/slide-up-message.js +21 -21
  70. package/src/InAppMessage/models/templated-in-app-message.js +8 -8
  71. package/src/InAppMessage/subscribe-to-in-app-message.js +1 -1
  72. package/src/InAppMessage/ui/automatically-show-in-app-messages.js +3 -3
  73. package/src/InAppMessage/ui/remove-all-visible-in-app-messages.js +18 -0
  74. package/src/InAppMessage/ui/show-in-app-message.js +24 -24
  75. package/src/Push/is-push-blocked.js +2 -2
  76. package/src/Push/is-push-permission-granted.js +2 -2
  77. package/src/Push/is-push-supported.js +2 -2
  78. package/src/Push/push-manager-factory.js +8 -8
  79. package/src/Push/push-manager.js +90 -90
  80. package/src/Push/utils/push-utils.js +17 -17
  81. package/src/User/user-manager.js +12 -12
  82. package/src/User/user.js +48 -48
  83. package/src/common/constants.js +1 -0
  84. package/src/common/content-cards-display.js +20 -20
  85. package/src/common/event-logger.js +4 -4
  86. package/src/common/properties-base.js +16 -16
  87. package/src/l10n/l10n-manager-factory.js +2 -2
  88. package/src/l10n/l10n-manager.js +1 -1
  89. package/src/managers/auth-manager.js +29 -29
  90. package/src/managers/braze-instance.js +141 -133
  91. package/src/managers/device-manager.js +18 -18
  92. package/src/managers/network-manager.js +139 -139
  93. package/src/managers/server-config-manager.js +99 -82
  94. package/src/managers/session-manager.js +32 -32
  95. package/src/managers/storage-manager-factory.js +8 -8
  96. package/src/managers/storage-manager.js +76 -74
  97. package/src/managers/subscription-manager.js +10 -10
  98. package/src/models/backend-errors.js +5 -5
  99. package/src/models/braze-event.js +9 -9
  100. package/src/models/device.js +2 -2
  101. package/src/models/identifier.js +12 -12
  102. package/src/models/push-token.js +12 -12
  103. package/src/models/request-result.js +1 -1
  104. package/src/models/server-config.js +38 -34
  105. package/src/request-controller.js +136 -134
  106. package/src/triggers/models/custom-event-data.js +4 -4
  107. package/src/triggers/models/custom-event-property-data.js +5 -5
  108. package/src/triggers/models/filter-set.js +8 -8
  109. package/src/triggers/models/filter.js +30 -30
  110. package/src/triggers/models/in-app-message-click-data.js +1 -1
  111. package/src/triggers/models/purchase-data.js +1 -1
  112. package/src/triggers/models/purchase-property-data.js +2 -2
  113. package/src/triggers/models/push-click-data.js +1 -1
  114. package/src/triggers/models/trigger-condition.js +36 -36
  115. package/src/triggers/models/trigger-events.js +2 -2
  116. package/src/triggers/models/trigger.js +15 -15
  117. package/src/triggers/triggers-provider-factory.js +3 -3
  118. package/src/triggers/triggers-provider.js +25 -25
  119. package/src/ui/js/attach-css.js +3 -3
  120. package/src/ui/js/load-font-awesome.js +2 -2
  121. package/src/util/base-device-parser.js +3 -3
  122. package/src/util/braze-actions.js +3 -3
  123. package/src/util/browser-detector.js +13 -13
  124. package/src/util/client-hints-parser.js +6 -6
  125. package/src/util/component-utils.js +1 -1
  126. package/src/util/dom-utils.js +10 -10
  127. package/src/util/key-codes.js +1 -1
  128. package/src/util/net.js +1 -1
  129. package/src/util/request-header-utils.js +22 -22
  130. package/src/util/user-agent-parser.js +14 -14
  131. package/src/util/validation-utils.js +9 -9
  132. package/src/util/window-utils.js +1 -1
@@ -1,7 +1,7 @@
1
1
  import _t from "../models/identifier.js";
2
- import { getByteLength as er } from "../util/string-utils.js";
2
+ import { getByteLength as rr } from "../util/string-utils.js";
3
3
  import ti from "../models/push-token.js";
4
- import { logger as E, IndexedDBAdapter as et } from "../../shared-lib/index.js";
4
+ import { logger as E, IndexedDBAdapter as it } from "../../shared-lib/index.js";
5
5
  import { STORAGE_KEYS as s } from "../managers/storage-manager.js";
6
6
  import { User } from "../User/index.js";
7
7
  export default class bt {
@@ -12,9 +12,9 @@ export default class bt {
12
12
  const t = this.j.tu(s.iu.su);
13
13
  if (null == t) return null;
14
14
  let i = t.eu,
15
- e = er(i);
15
+ e = rr(i);
16
16
  if (e > User.mr) {
17
- for (; e > User.mr; ) (i = i.slice(0, i.length - 1)), (e = er(i));
17
+ for (; e > User.mr; ) (i = i.slice(0, i.length - 1)), (e = rr(i));
18
18
  (t.eu = i), this.j.uu(s.iu.su, t);
19
19
  }
20
20
  return i;
@@ -47,17 +47,17 @@ export default class bt {
47
47
  u
48
48
  );
49
49
  }
50
- Pn(t, i, e, u, o) {
50
+ Yn(t, i, e, u, o) {
51
51
  this.nu("push_token", t, !1, !0),
52
52
  this.nu("custom_push_public_key", e, !1, !0),
53
53
  this.nu("custom_push_user_auth", u, !1, !0),
54
54
  this.nu("custom_push_vapid_public_key", o, !1, !0);
55
- const r = et.Us.Rs,
56
- h = new et(r, E),
55
+ const r = it.Us.Rs,
56
+ h = new it(r, E),
57
57
  n = new ti(t, i, e, u, o);
58
- this.j.ft(s.ct.In, n.dt()), h.setItem(r.Fs.cu, r.me, !0);
58
+ this.j.ft(s.ct.Wo, n.dt()), h.setItem(r.Fs.cu, r.me, !0);
59
59
  }
60
- Sn(t) {
60
+ Hn(t) {
61
61
  if (
62
62
  (this.nu("push_token", null, !1, !0),
63
63
  this.nu("custom_push_public_key", null, !1, !0),
@@ -65,9 +65,9 @@ export default class bt {
65
65
  this.nu("custom_push_vapid_public_key", null, !1, !0),
66
66
  t)
67
67
  ) {
68
- const t = et.Us.Rs,
69
- i = new et(t, E);
70
- this.j.ft(s.ct.In, !1), i.setItem(t.Fs.cu, t.me, !1);
68
+ const t = it.Us.Rs,
69
+ i = new it(t, E);
70
+ this.j.ft(s.ct.Wo, !1), i.setItem(t.Fs.cu, t.me, !1);
71
71
  }
72
72
  }
73
73
  }
package/src/User/user.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
- isArray as D,
2
+ isArray as z,
3
3
  isDate as Nt,
4
- isObject as It,
4
+ isObject as yt,
5
5
  validateValueIsFromEnum as ta,
6
6
  } from "../util/code-utils.js";
7
7
  import { logger as E, EventTypes as m } from "../../shared-lib/index.js";
@@ -9,16 +9,16 @@ import {
9
9
  isValidEmail as Ct,
10
10
  validateCustomAttributeArrayType as St,
11
11
  validateCustomAttributeKey as Ut,
12
- validateCustomProperties as nt,
13
- validateCustomString as mt,
12
+ validateCustomProperties as rt,
13
+ validateCustomString as nt,
14
14
  validatePropertyType as Dt,
15
- validateStandardString as ir,
15
+ validateStandardString as er,
16
16
  } from "../util/validation-utils.js";
17
17
  import { SET_CUSTOM_USER_ATTRIBUTE_STRING as Ft } from "../common/constants.js";
18
18
  import { toValidBackendTimeString as Lt } from "../util/date-utils.js";
19
19
  export default class User {
20
20
  constructor(t, e) {
21
- (this.Cs = t), (this.Cn = e), (this.Cs = t), (this.Cn = e);
21
+ (this.Cs = t), (this.au = e), (this.Cs = t), (this.au = e);
22
22
  }
23
23
  getUserId(t) {
24
24
  const e = this.Cs.getUserId();
@@ -29,21 +29,21 @@ export default class User {
29
29
  t(e);
30
30
  }
31
31
  addAlias(t, e) {
32
- return !ir(t, "add alias", "the alias", !1) || t.length <= 0
32
+ return !er(t, "add alias", "the alias", !1) || t.length <= 0
33
33
  ? (E.error("addAlias requires a non-empty alias"), !1)
34
- : !ir(e, "add alias", "the label", !1) || e.length <= 0
34
+ : !er(e, "add alias", "the label", !1) || e.length <= 0
35
35
  ? (E.error("addAlias requires a non-empty label"), !1)
36
- : this.Cn.En(t, e).W;
36
+ : this.au.du(t, e).W;
37
37
  }
38
38
  setFirstName(t) {
39
39
  return (
40
- !!ir(t, "set first name", "the firstName", !0) &&
40
+ !!er(t, "set first name", "the firstName", !0) &&
41
41
  this.Cs.nu("first_name", t)
42
42
  );
43
43
  }
44
44
  setLastName(t) {
45
45
  return (
46
- !!ir(t, "set last name", "the lastName", !0) && this.Cs.nu("last_name", t)
46
+ !!er(t, "set last name", "the lastName", !0) && this.Cs.nu("last_name", t)
47
47
  );
48
48
  }
49
49
  setEmail(t) {
@@ -92,17 +92,17 @@ export default class User {
92
92
  }
93
93
  setCountry(t) {
94
94
  return (
95
- !!ir(t, "set country", "the country", !0) && this.Cs.nu("country", t)
95
+ !!er(t, "set country", "the country", !0) && this.Cs.nu("country", t)
96
96
  );
97
97
  }
98
98
  setHomeCity(t) {
99
99
  return (
100
- !!ir(t, "set home city", "the homeCity", !0) && this.Cs.nu("home_city", t)
100
+ !!er(t, "set home city", "the homeCity", !0) && this.Cs.nu("home_city", t)
101
101
  );
102
102
  }
103
103
  setLanguage(t) {
104
104
  return (
105
- !!ir(t, "set language", "the language", !0) && this.Cs.nu("language", t)
105
+ !!er(t, "set language", "the language", !0) && this.Cs.nu("language", t)
106
106
  );
107
107
  }
108
108
  setEmailNotificationSubscriptionType(t) {
@@ -127,8 +127,8 @@ export default class User {
127
127
  }
128
128
  setPhoneNumber(t) {
129
129
  return (
130
- !!ir(t, "set phone number", "the phoneNumber", !0) &&
131
- (null === t || t.match(User.Fn)
130
+ !!er(t, "set phone number", "the phoneNumber", !0) &&
131
+ (null === t || t.match(User.pu)
132
132
  ? this.Cs.nu("phone", t)
133
133
  : (E.error(`Cannot set phone number - "${t}" did not pass validation.`),
134
134
  !1))
@@ -164,12 +164,12 @@ export default class User {
164
164
  "Cannot set last-known location - accuracy and altitudeAccuracy may not be negative.",
165
165
  ),
166
166
  !1)
167
- : this.Cn.setLastKnownLocation(this.Cs.getUserId(), t, e, s, r, n).W);
167
+ : this.au.setLastKnownLocation(this.Cs.getUserId(), t, e, s, r, n).W);
168
168
  }
169
169
  setCustomUserAttribute(t, e, r) {
170
170
  if (!Ut(t)) return !1;
171
171
  const s = (e) => {
172
- const [r] = nt(
172
+ const [r] = rt(
173
173
  e,
174
174
  Ft,
175
175
  "attribute value",
@@ -178,20 +178,20 @@ export default class User {
178
178
  );
179
179
  return r;
180
180
  };
181
- if (D(e)) {
181
+ if (z(e)) {
182
182
  const [r, n] = St(t, e);
183
183
  if (!r && !n && 0 !== e.length) return !1;
184
- if (r || 0 === e.length) return this.Cn.Ln(m.$n, t, e).W;
184
+ if (r || 0 === e.length) return this.au.bu(m.fu, t, e).W;
185
185
  for (const t of e) if (!s(t)) return !1;
186
- } else if (It(e)) {
186
+ } else if (yt(e)) {
187
187
  if (!s(e)) return !1;
188
- if (r) return this.Cn.Ln(m.Bn, t, e).W;
188
+ if (r) return this.au.bu(m.gu, t, e).W;
189
189
  } else {
190
190
  if (!(void 0 !== e && Dt(e))) return !1;
191
191
  if (
192
192
  (Nt(e) && (e = Lt(e)),
193
193
  "string" == typeof e &&
194
- !mt(
194
+ !nt(
195
195
  e,
196
196
  `set custom user attribute "${t}"`,
197
197
  "the element in the given array",
@@ -203,26 +203,26 @@ export default class User {
203
203
  }
204
204
  addToCustomAttributeArray(t, e) {
205
205
  return (
206
- !!mt(t, "add to custom user attribute array", "the given key") &&
206
+ !!nt(t, "add to custom user attribute array", "the given key") &&
207
207
  !(
208
208
  null != e &&
209
- !mt(e, "add to custom user attribute array", "the given value")
209
+ !nt(e, "add to custom user attribute array", "the given value")
210
210
  ) &&
211
- this.Cn.Ln(m.Rn, t, e).W
211
+ this.au.bu(m.Nu, t, e).W
212
212
  );
213
213
  }
214
214
  removeFromCustomAttributeArray(t, e) {
215
215
  return (
216
- !!mt(t, "remove from custom user attribute array", "the given key") &&
216
+ !!nt(t, "remove from custom user attribute array", "the given key") &&
217
217
  !(
218
218
  null != e &&
219
- !mt(e, "remove from custom user attribute array", "the given value")
219
+ !nt(e, "remove from custom user attribute array", "the given value")
220
220
  ) &&
221
- this.Cn.Ln(m.On, t, e).W
221
+ this.au.bu(m.yu, t, e).W
222
222
  );
223
223
  }
224
224
  incrementCustomUserAttribute(t, e) {
225
- if (!mt(t, "increment custom user attribute", "the given key")) return !1;
225
+ if (!nt(t, "increment custom user attribute", "the given key")) return !1;
226
226
  null == e && (e = 1);
227
227
  const r = parseInt(e.toString());
228
228
  return isNaN(r) || r !== parseFloat(e.toString())
@@ -230,11 +230,11 @@ export default class User {
230
230
  `Cannot increment custom user attribute because the given incrementValue "${e}" is not an integer.`,
231
231
  ),
232
232
  !1)
233
- : this.Cn.Ln(m.Gn, t, r).W;
233
+ : this.au.bu(m.vu, t, r).W;
234
234
  }
235
235
  setCustomLocationAttribute(t, e, r) {
236
236
  return (
237
- !!mt(t, "set custom location attribute", "the given key") &&
237
+ !!nt(t, "set custom location attribute", "the given key") &&
238
238
  ((null !== e || null !== r) &&
239
239
  ((e = null != e ? parseFloat(e.toString()) : null),
240
240
  (r = null != r ? parseFloat(r.toString()) : null),
@@ -246,11 +246,11 @@ export default class User {
246
246
  "Received invalid values for latitude and/or longitude. Latitude and longitude are bounded by ±90 and ±180 respectively, or must both be null for removal.",
247
247
  ),
248
248
  !1)
249
- : this.Cn.Hn(t, e, r).W)
249
+ : this.au.Iu(t, e, r).W)
250
250
  );
251
251
  }
252
252
  addToSubscriptionGroup(t) {
253
- return !ir(
253
+ return !er(
254
254
  t,
255
255
  "add user to subscription group",
256
256
  "subscription group ID",
@@ -260,10 +260,10 @@ export default class User {
260
260
  "addToSubscriptionGroup requires a non-empty subscription group ID",
261
261
  ),
262
262
  !1)
263
- : this.Cn.Kn(t, User.Mn.SUBSCRIBED).W;
263
+ : this.au.Cu(t, User.Eu.SUBSCRIBED).W;
264
264
  }
265
265
  removeFromSubscriptionGroup(t) {
266
- return !ir(
266
+ return !er(
267
267
  t,
268
268
  "remove user from subscription group",
269
269
  "subscription group ID",
@@ -273,24 +273,24 @@ export default class User {
273
273
  "removeFromSubscriptionGroup requires a non-empty subscription group ID",
274
274
  ),
275
275
  !1)
276
- : this.Cn.Kn(t, User.Mn.UNSUBSCRIBED).W;
276
+ : this.au.Cu(t, User.Eu.UNSUBSCRIBED).W;
277
277
  }
278
278
  setLineId(t) {
279
- return ir(t, "set LINE user ID", "the ID", !0) &&
279
+ return er(t, "set LINE user ID", "the ID", !0) &&
280
280
  0 !== (null == t ? void 0 : t.length)
281
- ? t && t.length > User.Yn
281
+ ? t && t.length > User.Su
282
282
  ? (E.error(
283
- `Rejected LINE user ID ${t} because it is longer than ${User.Yn} characters.`,
283
+ `Rejected LINE user ID ${t} because it is longer than ${User.Su} characters.`,
284
284
  ),
285
285
  !1)
286
286
  : this.Cs.nu("native_line_id", t)
287
287
  : (E.error("setLineId requires a non-empty ID"), !1);
288
288
  }
289
- Pn(t, e, r, s, n) {
290
- this.Cs.Pn(t, e, r, s, n), this.Cn.zn();
289
+ Yn(t, e, r, s, n) {
290
+ this.Cs.Yn(t, e, r, s, n), this.au.Au();
291
291
  }
292
- Sn(t) {
293
- this.Cs.Sn(t);
292
+ Hn(t) {
293
+ this.Cs.Hn(t);
294
294
  }
295
295
  }
296
296
  (User.Genders = {
@@ -306,9 +306,9 @@ export default class User {
306
306
  SUBSCRIBED: "subscribed",
307
307
  UNSUBSCRIBED: "unsubscribed",
308
308
  }),
309
- (User.Fn = /^[0-9 .\\(\\)\\+\\-]+$/),
310
- (User.Mn = { SUBSCRIBED: "subscribed", UNSUBSCRIBED: "unsubscribed" }),
311
- (User.Jn = "user_id"),
309
+ (User.pu = /^[0-9 .\\(\\)\\+\\-]+$/),
310
+ (User.Eu = { SUBSCRIBED: "subscribed", UNSUBSCRIBED: "unsubscribed" }),
311
+ (User.Uu = "user_id"),
312
312
  (User.lu = "custom"),
313
313
  (User.mr = 997),
314
- (User.Yn = 33);
314
+ (User.Su = 33);
@@ -15,3 +15,4 @@ export const REQUEST_ATTEMPT_DEFAULT = 1;
15
15
  export const SUBSCRIPTION_ID_DATA_ATTRIBUTE = "data-update-subscription-id";
16
16
  export const BANNERS_DISABLED_MESSAGE =
17
17
  "Banners are disabled. Make sure you have at least one campaign and relaunch the app.";
18
+ export const PAUSE_SCROLLING_CLASS = "ab-pause-scrolling";
@@ -5,17 +5,17 @@ import {
5
5
  import { bottomIsInView as x, topIsInView as g } from "../util/dom-utils.js";
6
6
  import { Card, ControlCard } from "../Card/index.js";
7
7
  import { cardToHtml as Ht } from "../Card/display/card-display.js";
8
- import { isArray as D } from "../util/code-utils.js";
8
+ import { isArray as z } from "../util/code-utils.js";
9
9
  import { KeyCodes as ie } from "../util/key-codes.js";
10
10
  import fe from "../l10n/l10n-manager-factory.js";
11
11
  import { removeSubscription } from "../Core/remove-subscription.js";
12
- import { logger as E, Guid as P } from "../../shared-lib/index.js";
12
+ import { logger as E, Guid as L } from "../../shared-lib/index.js";
13
13
  import { BRAZE_ACTION_URI_REGEX as to } from "../util/validation-utils.js";
14
14
  import {
15
- INELIGIBLE_BRAZE_ACTION_URL_ERROR_TYPES as vt,
16
- ineligibleBrazeActionURLErrorMessage as jt,
15
+ INELIGIBLE_BRAZE_ACTION_URL_ERROR_TYPES as jt,
16
+ ineligibleBrazeActionURLErrorMessage as dt,
17
17
  getDecodedBrazeAction as eo,
18
- containsUnknownBrazeAction as dt,
18
+ containsUnknownBrazeAction as gt,
19
19
  } from "../util/braze-actions.js";
20
20
  import {
21
21
  bottomHadImpression as kt,
@@ -34,7 +34,7 @@ export function destroyContentCardsHtml(t) {
34
34
  ((t.className = t.className.replace("ab-show", "ab-hide")),
35
35
  setTimeout(() => {
36
36
  t && t.parentNode && t.parentNode.removeChild(t);
37
- }, ContentCards.cr));
37
+ }, ContentCards.hr));
38
38
  const e = t.getAttribute(f);
39
39
  null != e && removeSubscription(e);
40
40
  const n = t.getAttribute("data-listener-id");
@@ -59,11 +59,11 @@ export function generateContentCardsUI(t, e) {
59
59
  o.appendChild(t);
60
60
  } else {
61
61
  let s = !1;
62
- const r = (e) => t.nr(e);
62
+ const r = (e) => t.dr(e);
63
63
  for (const a of t.cards) {
64
64
  const i = a instanceof ControlCard;
65
- !i || t.ar()
66
- ? (o.appendChild(Ht(a, r, e, n.So())), (s = s || !i))
65
+ !i || t.cr()
66
+ ? (o.appendChild(Ht(a, r, e, n.Ho())), (s = s || !i))
67
67
  : E.error(
68
68
  "Received a control card for a legacy news feed. Control cards are only supported with content cards.",
69
69
  );
@@ -82,12 +82,12 @@ export function detectContentCardsImpressions(t, e) {
82
82
  if (null != t && null != e) {
83
83
  const n = [],
84
84
  o = e.querySelectorAll(".ab-card");
85
- t.Qn || (t.Qn = {});
85
+ t.Eo || (t.Eo = {});
86
86
  for (let e = 0; e < o.length; e++) {
87
87
  const s = xt(o[e]),
88
88
  r = g(o[e]),
89
89
  a = x(o[e]);
90
- if (t.Qn[s]) {
90
+ if (t.Eo[s]) {
91
91
  r || a || Rt(o[e]);
92
92
  continue;
93
93
  }
@@ -101,7 +101,7 @@ export function detectContentCardsImpressions(t, e) {
101
101
  if (c && f) continue;
102
102
  for (const e of t.cards)
103
103
  if (e.id === s) {
104
- (t.Qn[e.id] = !0), n.push(e);
104
+ (t.Eo[e.id] = !0), n.push(e);
105
105
  break;
106
106
  }
107
107
  }
@@ -131,8 +131,8 @@ export function refreshContentCardsUI(t, e) {
131
131
  "true" === e.getAttribute("aria-busy") &&
132
132
  e.setAttribute("aria-busy", "false");
133
133
  }
134
- }, ContentCards.Cr),
135
- t.dr();
134
+ }, ContentCards.lr),
135
+ t.ur();
136
136
  }
137
137
  export function contentCardsToHtml(t, e, n) {
138
138
  const o = document.createElement("div");
@@ -153,7 +153,7 @@ export function contentCardsToHtml(t, e, n) {
153
153
  destroyContentCardsHtml(o), t.stopPropagation();
154
154
  };
155
155
  r.addEventListener("keydown", (t) => {
156
- (t.keyCode !== ie.lo && t.keyCode !== ie.Ze) || a(t);
156
+ (t.keyCode !== ie.do && t.keyCode !== ie.lo) || a(t);
157
157
  }),
158
158
  (r.onclick = a);
159
159
  const i = document.createElement("i");
@@ -166,7 +166,7 @@ export function contentCardsToHtml(t, e, n) {
166
166
  refreshContentCardsUI(t, o), e.stopPropagation();
167
167
  };
168
168
  i.addEventListener("keydown", (t) => {
169
- (t.keyCode !== ie.lo && t.keyCode !== ie.Ze) || l(t);
169
+ (t.keyCode !== ie.do && t.keyCode !== ie.lo) || l(t);
170
170
  }),
171
171
  (i.onclick = l),
172
172
  s.appendChild(i),
@@ -175,20 +175,20 @@ export function contentCardsToHtml(t, e, n) {
175
175
  const d = () => detectContentCardsImpressions(t, o);
176
176
  if ((o.addEventListener("scroll", d), !n)) {
177
177
  window.addEventListener("scroll", d);
178
- const t = P.oe();
178
+ const t = L.oe();
179
179
  (scrollListeners[t] = d), o.setAttribute("data-listener-id", t);
180
180
  }
181
181
  return o;
182
182
  }
183
183
  export function updateContentCards(t, e, n, o, s) {
184
- if (!D(e)) return;
184
+ if (!z(e)) return;
185
185
  const r = [];
186
186
  for (const t of e)
187
187
  if (t instanceof Card) {
188
188
  if (t.url && to.test(t.url)) {
189
189
  const e = eo(t.url);
190
- if (dt(e)) {
191
- E.error(jt(vt.Li, "Content Card"));
190
+ if (gt(e)) {
191
+ E.error(dt(jt.Zr, "Content Card"));
192
192
  continue;
193
193
  }
194
194
  }
@@ -1,11 +1,11 @@
1
1
  import { logger as E } from "../../shared-lib/index.js";
2
2
  import r from "../managers/braze-instance.js";
3
3
  import ue from "../models/braze-event.js";
4
- import H from "../models/request-result.js";
4
+ import G from "../models/request-result.js";
5
5
  const c = {
6
6
  rt: (e, o, t) => {
7
7
  var n, s;
8
- const i = new H(),
8
+ const i = new G(),
9
9
  l = r.u();
10
10
  if (!l)
11
11
  return (
@@ -14,7 +14,7 @@ const c = {
14
14
  ),
15
15
  i
16
16
  );
17
- const d = l.qo();
17
+ const d = l.Fo();
18
18
  return (
19
19
  i.ue.push(
20
20
  new ue(
@@ -26,7 +26,7 @@ const c = {
26
26
  ),
27
27
  ),
28
28
  (i.W =
29
- (null === (s = r.p()) || void 0 === s ? void 0 : s.Eo(i.ue)) || !1),
29
+ (null === (s = r.p()) || void 0 === s ? void 0 : s.Go(i.ue)) || !1),
30
30
  i
31
31
  );
32
32
  },
@@ -3,54 +3,54 @@ export class PropertiesBase {
3
3
  constructor(t) {
4
4
  (this.properties = t), (this.properties = t || {});
5
5
  }
6
- To(t, r, e) {
6
+ Oo(t, r, e) {
7
7
  const o = this.properties[t];
8
- return null == o ? (this.No(t), null) : r(o) ? o.value : (this.Oo(e), null);
8
+ return null == o ? (this.Ko(t), null) : r(o) ? o.value : (this.Lo(e), null);
9
9
  }
10
10
  getStringProperty(t) {
11
- return this.To(t, this.Fo, "string");
11
+ return this.Oo(t, this.Qo, "string");
12
12
  }
13
13
  getNumberProperty(t) {
14
- return this.To(t, this.Go, "number");
14
+ return this.Oo(t, this.Ro, "number");
15
15
  }
16
16
  getBooleanProperty(t) {
17
- return this.To(t, this.Ho, "boolean");
17
+ return this.Oo(t, this.Xo, "boolean");
18
18
  }
19
19
  getImageProperty(t) {
20
- return this.To(t, this.Ko, "image");
20
+ return this.Oo(t, this.Yo, "image");
21
21
  }
22
22
  getJsonProperty(t) {
23
- return this.To(t, this.Lo, "jsonobject");
23
+ return this.Oo(t, this.Zo, "jsonobject");
24
24
  }
25
25
  getTimestampProperty(t) {
26
- return this.To(t, this.Qo, "datetime");
26
+ return this.Oo(t, this.tp, "datetime");
27
27
  }
28
- Oo(t) {
28
+ Lo(t) {
29
29
  E.info(`Property is not of type ${t}.`);
30
30
  }
31
- No(t) {
31
+ Ko(t) {
32
32
  E.info(`${t} not found in properties.`);
33
33
  }
34
- Fo(t) {
34
+ Qo(t) {
35
35
  return "string" === t.type && "string" == typeof t.value;
36
36
  }
37
- Go(t) {
37
+ Ro(t) {
38
38
  return "number" === t.type && "number" == typeof t.value;
39
39
  }
40
- Ho(t) {
40
+ Xo(t) {
41
41
  return "boolean" === t.type && "boolean" == typeof t.value;
42
42
  }
43
- Ko(t) {
43
+ Yo(t) {
44
44
  return "image" === t.type && "string" == typeof t.value;
45
45
  }
46
- Lo(t) {
46
+ Zo(t) {
47
47
  return (
48
48
  "jsonobject" === t.type &&
49
49
  "object" == typeof t.value &&
50
50
  t.value.constructor == Object
51
51
  );
52
52
  }
53
- Qo(t) {
53
+ tp(t) {
54
54
  return "datetime" === t.type && "number" == typeof t.value;
55
55
  }
56
56
  }
@@ -1,4 +1,4 @@
1
- import r, { OPTIONS as z } from "../managers/braze-instance.js";
1
+ import r, { OPTIONS as q } from "../managers/braze-instance.js";
2
2
  import ro from "../util/browser-detector.js";
3
3
  import lr from "./l10n-manager.js";
4
4
  const fe = {
@@ -8,7 +8,7 @@ const fe = {
8
8
  if ((fe.t(), !fe.aa)) {
9
9
  let e = ro.language,
10
10
  t = !1;
11
- r.ee(z.Xn) && ((e = r.ee(z.Xn)), (t = !0)), (fe.aa = new lr(e, t));
11
+ r.ee(q.Ea) && ((e = r.ee(q.Ea)), (t = !0)), (fe.aa = new lr(e, t));
12
12
  }
13
13
  return fe.aa;
14
14
  },
@@ -22,7 +22,7 @@ export default class lr {
22
22
  get(t) {
23
23
  return zt[this.language][t];
24
24
  }
25
- So() {
25
+ Ho() {
26
26
  switch (this.language) {
27
27
  case "ar":
28
28
  case "he":
@@ -1,51 +1,51 @@
1
1
  import { STORAGE_KEYS as s } from "./storage-manager.js";
2
2
  import u from "./subscription-manager.js";
3
- import { logger as E, IndexedDBAdapter as et } from "../../shared-lib/index.js";
3
+ import { logger as E, IndexedDBAdapter as it } from "../../shared-lib/index.js";
4
4
  export default class Bt {
5
5
  constructor(t, i, s) {
6
6
  (this.j = t),
7
- (this.Zn = i),
8
- (this.gh = s),
7
+ (this.gh = i),
8
+ (this.ph = s),
9
9
  (this.j = t),
10
- (this.Zn = i || !1),
11
- (this.gh = s),
12
- (this.ph = new u()),
13
- (this.Fh = 0),
14
- (this.kh = 1);
15
- }
16
- fh() {
17
- return this.Zn;
10
+ (this.gh = i || !1),
11
+ (this.ph = s),
12
+ (this.Fh = new u()),
13
+ (this.kh = 0),
14
+ (this.fh = 1);
18
15
  }
19
16
  wh() {
20
- return this.j.lt(s.ct.jh);
17
+ return this.gh;
18
+ }
19
+ jh() {
20
+ return this.j.lt(s.ct.xh);
21
21
  }
22
22
  setSdkAuthenticationSignature(t) {
23
- const i = this.wh();
24
- this.j.ft(s.ct.jh, t);
25
- const e = et.Us.Rs;
26
- new et(e, E).setItem(e.Fs.xh, this.kh, t), i !== t && this.Z();
23
+ const i = this.jh();
24
+ this.j.ft(s.ct.xh, t);
25
+ const e = it.Us.Rs;
26
+ new it(e, E).setItem(e.Fs.qh, this.fh, t), i !== t && this.Z();
27
27
  }
28
- qh() {
29
- this.j.Nt(s.ct.jh);
30
- const t = et.Us.Rs;
31
- new et(t, E).be(t.Fs.xh, this.kh);
28
+ yh() {
29
+ this.j.Nt(s.ct.xh);
30
+ const t = it.Us.Rs;
31
+ new it(t, E).be(t.Fs.qh, this.fh);
32
32
  }
33
33
  subscribeToSdkAuthenticationFailures(t) {
34
- return this.gh.wt(t);
34
+ return this.ph.wt(t);
35
35
  }
36
- yh(t) {
37
- this.gh.L(t);
38
- }
39
- Bh() {
40
- this.ph.removeAllSubscriptions();
36
+ Bh(t) {
37
+ this.ph.L(t);
41
38
  }
42
39
  Gh() {
43
- this.Fh += 1;
40
+ this.Fh.removeAllSubscriptions();
44
41
  }
45
42
  Hh() {
46
- return this.Fh;
43
+ this.kh += 1;
44
+ }
45
+ Jh() {
46
+ return this.kh;
47
47
  }
48
48
  Z() {
49
- this.Fh = 0;
49
+ this.kh = 0;
50
50
  }
51
51
  }