@braze/web-sdk 5.1.1 → 5.3.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 (99) hide show
  1. package/index.d.ts +65 -10
  2. package/package.json +1 -1
  3. package/shared-lib/encoding-utils.js +1 -1
  4. package/shared-lib/event-types.js +20 -20
  5. package/shared-lib/indexed-db-adapter.js +52 -52
  6. package/shared-lib/logger.js +7 -7
  7. package/shared-lib/supported-options.js +22 -21
  8. package/src/ContentCards/content-cards-provider.js +107 -135
  9. package/src/ContentCards/get-cached-content-cards.js +1 -1
  10. package/src/ContentCards/request-content-cards-refresh.js +1 -1
  11. package/src/ContentCards/subscribe-to-content-cards-updates.js +2 -2
  12. package/src/ContentCards/ui/show-content-cards.js +1 -1
  13. package/src/FeatureFlags/feature-flag.js +41 -30
  14. package/src/FeatureFlags/feature-flags-provider.js +88 -84
  15. package/src/FeatureFlags/get-all-feature-flags.js +2 -2
  16. package/src/FeatureFlags/get-feature-flag.js +2 -2
  17. package/src/FeatureFlags/log-feature-flag-impression.js +3 -3
  18. package/src/FeatureFlags/subscribe-to-feature-flags-updates.js +2 -2
  19. package/src/Feed/feed-provider.js +24 -24
  20. package/src/Feed/get-cached-feed.js +1 -1
  21. package/src/Feed/log-feed-displayed.js +1 -1
  22. package/src/Feed/request-feed-refresh.js +1 -1
  23. package/src/Feed/subscribe-to-feed-updates.js +1 -1
  24. package/src/Feed/ui/show-feed.js +1 -1
  25. package/src/InAppMessage/defer-in-app-message.js +1 -1
  26. package/src/InAppMessage/display/html-message-to-html.js +45 -42
  27. package/src/InAppMessage/display/in-app-message-to-html.js +22 -22
  28. package/src/InAppMessage/display/modal-utils.js +7 -7
  29. package/src/InAppMessage/get-deferred-in-app-message.js +1 -1
  30. package/src/InAppMessage/in-app-message-factory.js +23 -21
  31. package/src/InAppMessage/in-app-message-manager.js +95 -112
  32. package/src/InAppMessage/log-in-app-message-button-click.js +2 -2
  33. package/src/InAppMessage/log-in-app-message-click.js +3 -3
  34. package/src/InAppMessage/log-in-app-message-html-click.js +3 -3
  35. package/src/InAppMessage/log-in-app-message-impression.js +1 -1
  36. package/src/InAppMessage/models/control-message.js +4 -2
  37. package/src/InAppMessage/models/full-screen-message.js +14 -11
  38. package/src/InAppMessage/models/html-message.js +11 -9
  39. package/src/InAppMessage/models/in-app-message-button.js +2 -2
  40. package/src/InAppMessage/models/in-app-message.js +127 -120
  41. package/src/InAppMessage/models/modal-message.js +14 -11
  42. package/src/InAppMessage/models/slide-up-message.js +46 -21
  43. package/src/InAppMessage/models/templated-in-app-message.js +8 -8
  44. package/src/InAppMessage/subscribe-to-in-app-message.js +1 -1
  45. package/src/InAppMessage/ui/automatically-show-in-app-messages.js +3 -3
  46. package/src/InAppMessage/ui/show-in-app-message.js +37 -43
  47. package/src/InAppMessage/utils/in-app-message-utils.js +18 -1
  48. package/src/Push/push-manager-factory.js +4 -4
  49. package/src/Push/push-manager.js +118 -110
  50. package/src/Push/utils/push-utils.js +4 -4
  51. package/src/User/user-manager.js +4 -4
  52. package/src/User/user.js +19 -19
  53. package/src/common/base-feed.js +1 -1
  54. package/src/common/base-provider.js +1 -1
  55. package/src/common/constants.js +0 -2
  56. package/src/common/event-logger.js +2 -2
  57. package/src/common/feed-display.js +12 -12
  58. package/src/l10n/l10n-manager-factory.js +1 -1
  59. package/src/l10n/l10n-manager.js +4 -4
  60. package/src/managers/auth-manager.js +27 -27
  61. package/src/managers/braze-instance.js +119 -112
  62. package/src/managers/device-manager.js +19 -19
  63. package/src/managers/network-manager.js +215 -165
  64. package/src/managers/server-config-manager.js +46 -50
  65. package/src/managers/session-manager.js +21 -21
  66. package/src/managers/storage-manager-factory.js +1 -1
  67. package/src/managers/storage-manager.js +128 -125
  68. package/src/managers/utils.js +6 -0
  69. package/src/models/backend-errors.js +5 -5
  70. package/src/models/braze-event.js +19 -11
  71. package/src/models/device.js +3 -3
  72. package/src/models/identifier.js +34 -20
  73. package/src/models/push-token.js +4 -4
  74. package/src/models/server-config.js +24 -24
  75. package/src/request-controller.js +134 -124
  76. package/src/triggers/models/filter-set.js +2 -2
  77. package/src/triggers/models/filter.js +56 -56
  78. package/src/triggers/models/in-app-message-click-data.js +8 -8
  79. package/src/triggers/models/push-click-data.js +3 -3
  80. package/src/triggers/models/trigger-condition.js +30 -30
  81. package/src/triggers/models/trigger-events.js +1 -1
  82. package/src/triggers/models/trigger.js +36 -36
  83. package/src/triggers/triggers-provider-factory.js +2 -2
  84. package/src/triggers/triggers-provider.js +84 -95
  85. package/src/ui/js/attach-css.js +2 -2
  86. package/src/ui/js/load-font-awesome.js +1 -1
  87. package/src/util/base-device-parser.js +7 -7
  88. package/src/util/braze-actions.js +4 -4
  89. package/src/util/browser-detector.js +25 -24
  90. package/src/util/client-hints-parser.js +4 -4
  91. package/src/util/component-utils.js +2 -2
  92. package/src/util/device-constants.js +2 -2
  93. package/src/util/dom-utils.js +6 -6
  94. package/src/util/key-codes.js +1 -1
  95. package/src/util/net.js +4 -4
  96. package/src/util/request-header-utils.js +36 -37
  97. package/src/util/user-agent-parser.js +8 -8
  98. package/src/util/validation-utils.js +2 -0
  99. package/src/util/window-utils.js +3 -3
@@ -1,7 +1,6 @@
1
1
  import y from "../common/base-provider.js";
2
- import { newInAppMessageFromJson as lt } from "../InAppMessage/in-app-message-factory.js";
2
+ import { newInAppMessageFromJson as pt } from "../InAppMessage/in-app-message-factory.js";
3
3
  import ue from "../models/braze-event.js";
4
- import { InAppMessage } from "../InAppMessage/index.js";
5
4
  import {
6
5
  isArray as j,
7
6
  isEqual as ii,
@@ -9,7 +8,7 @@ import {
9
8
  } from "../util/code-utils.js";
10
9
  import { STORAGE_KEYS as o } from "../managers/storage-manager.js";
11
10
  import wt from "../InAppMessage/models/templated-in-app-message.js";
12
- import pt from "./models/trigger.js";
11
+ import mt from "./models/trigger.js";
13
12
  import tt from "./models/trigger-events.js";
14
13
  import { logger as r } from "../../shared-lib/index.js";
15
14
  export default class gr extends y {
@@ -18,12 +17,12 @@ export default class gr extends y {
18
17
  (this.tg = t),
19
18
  (this.Jt = i),
20
19
  (this.u = s),
21
- (this.Ei = e),
20
+ (this.zi = e),
22
21
  (this.ig = r),
23
22
  (this.tg = t),
24
23
  (this.Jt = i),
25
24
  (this.u = s),
26
- (this.Ei = e),
25
+ (this.zi = e),
27
26
  (this.ig = r),
28
27
  (this.sg = []),
29
28
  (this.eg = []),
@@ -31,27 +30,27 @@ export default class gr extends y {
31
30
  (this.ng = {}),
32
31
  (this.og = {}),
33
32
  (this.triggers = []),
34
- (this.ag = 0),
35
- this.lg(),
33
+ (this.lg = 0),
34
+ this.ag(),
36
35
  this.gg();
37
36
  }
38
37
  fg() {
39
38
  if (this.u) {
40
- (this.hg = this.u.j(o.C.aE) || this.hg),
41
- (this.ng = this.u.j(o.C.iE) || this.ng),
42
- (this.og = this.u.j(o.C.nE) || this.og);
39
+ (this.hg = this.u.j(o.C.iE) || this.hg),
40
+ (this.ng = this.u.j(o.C.EE) || this.ng),
41
+ (this.og = this.u.j(o.C.aE) || this.og);
43
42
  for (let t = 0; t < this.triggers.length; t++) {
44
43
  const i = this.triggers[t];
45
- i.id && null != this.og[i.id] && i.rd(this.og[i.id]);
44
+ i.id && null != this.og[i.id] && i.ad(this.og[i.id]);
46
45
  }
47
46
  }
48
47
  }
49
- lg() {
48
+ ag() {
50
49
  if (!this.u) return;
51
- this.ag = this.u.j(o.C.oE) || 0;
50
+ this.lg = this.u.j(o.C.oE) || 0;
52
51
  const t = this.u.j(o.C.rE) || [],
53
52
  i = [];
54
- for (let s = 0; s < t.length; s++) i.push(pt.En(t[s]));
53
+ for (let s = 0; s < t.length; s++) i.push(mt.qn(t[s]));
55
54
  (this.triggers = i), this.fg();
56
55
  }
57
56
  gg() {
@@ -71,19 +70,19 @@ export default class gr extends y {
71
70
  h = [];
72
71
  for (let e = 0; e < t.length; e++) {
73
72
  const n = t[e],
74
- o = r.hd(n.Ur || 0);
73
+ o = r.ud(n.Gr || 0);
75
74
  if (o > 0) {
76
75
  let t, e;
77
76
  h.push(n),
78
77
  null != n.ug && (t = n.ug),
79
- null != n.dg && ue.cE(n.dg) && (e = ue.En(n.dg));
80
- const a = [];
78
+ null != n.dg && ue.RE(n.dg) && (e = ue.qn(n.dg));
79
+ const l = [];
81
80
  if (n.pg && j(n.pg))
82
81
  for (let t = 0; t < n.pg.length; t++) {
83
82
  const i = s[n.pg[t]];
84
- null != i && a.push(i);
83
+ null != i && l.push(i);
85
84
  }
86
- this.eg.push(window.setTimeout(i(r, n.Ur || 0, t, e, a), o));
85
+ this.eg.push(window.setTimeout(i(r, n.Gr || 0, t, e, l), o));
87
86
  }
88
87
  }
89
88
  this.ng[r.id].length > h.length &&
@@ -92,44 +91,44 @@ export default class gr extends y {
92
91
  0 === this.ng[r.id].length && delete this.ng[r.id]);
93
92
  }
94
93
  }
95
- e && this.u && this.u.k(o.C.iE, this.ng);
94
+ e && this.u && this.u.k(o.C.EE, this.ng);
96
95
  }
97
96
  mg() {
98
97
  if (!this.u) return;
99
98
  const t = [];
100
99
  for (let i = 0; i < this.triggers.length; i++) t.push(this.triggers[i].Y());
101
- (this.ag = new Date().valueOf()),
100
+ (this.lg = new Date().valueOf()),
102
101
  this.u.k(o.C.rE, t),
103
- this.u.k(o.C.oE, this.ag);
102
+ this.u.k(o.C.oE, this.lg);
104
103
  }
105
104
  bg() {
106
105
  if (!this.u) return;
107
- (this.u.j(o.C.oE) || 0) > this.ag ? this.lg() : this.fg();
106
+ (this.u.j(o.C.oE) || 0) > this.lg ? this.ag() : this.fg();
108
107
  }
109
- Rs(t) {
108
+ Ns(t) {
110
109
  let i = !1;
111
110
  if (null != t && t.triggers) {
112
- this.ig.on(), this.fg();
111
+ this.ig.Lr(), this.fg();
113
112
  const s = {},
114
113
  e = {};
115
114
  this.triggers = [];
116
115
  for (let r = 0; r < t.triggers.length; r++) {
117
- const h = pt.fromJson(t.triggers[r]);
116
+ const h = mt.fromJson(t.triggers[r]);
118
117
  if (h) {
119
118
  h.id &&
120
119
  null != this.og[h.id] &&
121
- (h.rd(this.og[h.id]), (s[h.id] = this.og[h.id])),
120
+ (h.ad(this.og[h.id]), (s[h.id] = this.og[h.id])),
122
121
  h.id && null != this.ng[h.id] && (e[h.id] = this.ng[h.id]);
123
- for (let t = 0; t < h.Wu.length; t++)
124
- if (h.Wu[t].sc(tt.kt, null)) {
122
+ for (let t = 0; t < h.sd.length; t++)
123
+ if (h.sd[t].sc(tt.kt, null)) {
125
124
  i = !0;
126
125
  break;
127
126
  }
128
127
  this.triggers.push(h);
129
128
  }
130
129
  }
131
- ii(this.og, s) || ((this.og = s), this.u && this.u.k(o.C.nE, this.og)),
132
- ii(this.ng, e) || ((this.ng = e), this.u && this.u.k(o.C.iE, this.ng)),
130
+ ii(this.og, s) || ((this.og = s), this.u && this.u.k(o.C.aE, this.og)),
131
+ ii(this.ng, e) || ((this.ng = e), this.u && this.u.k(o.C.EE, this.ng)),
133
132
  this.mg(),
134
133
  i &&
135
134
  (r.info("Trigger with test condition found, firing test."),
@@ -146,40 +145,33 @@ export default class gr extends y {
146
145
  const n = (e) => {
147
146
  this.fg();
148
147
  const h = new Date().valueOf();
149
- if (!t.od(i))
150
- return !1 === navigator.onLine && t.type === pt.Kr.Jr && e.imageUrl
151
- ? (r.info(
148
+ t.dd(i) ||
149
+ (!1 === navigator.onLine && t.type === mt._r.Br && e.imageUrl
150
+ ? r.info(
152
151
  `Not showing ${t.type} trigger action ${t.id} due to offline state.`,
153
- ),
154
- void this.ig.Ve(t.id, InAppMessage.Me.Uh))
155
- : void (t.ed(h) && this.wg(t, h, s)
156
- ? 0 === this.Jt.ic()
157
- ? r.info(
158
- `Not displaying trigger ${t.id} because neither automaticallyShowInAppMessages() nor subscribeToInAppMessage() were called.`,
159
- )
160
- : (this.Jt.Dt([e]), this.yg(t, h))
161
- : r.info(
162
- `Not displaying trigger ${t.id} because display time fell outside of the acceptable time window.`,
163
- ));
164
- t.type === pt.Kr.nd
165
- ? this.ig.Ve(t.id, InAppMessage.Me.Or)
166
- : this.ig.Ve(t.id, InAppMessage.Me.bh);
152
+ )
153
+ : t.nd(h) && this.wg(t, h, s)
154
+ ? 0 === this.Jt.ic()
155
+ ? r.info(
156
+ `Not displaying trigger ${t.id} because neither automaticallyShowInAppMessages() nor subscribeToInAppMessage() were called.`,
157
+ )
158
+ : (this.Jt.Dt([e]), this.yg(t, h))
159
+ : r.info(
160
+ `Not displaying trigger ${t.id} because display time fell outside of the acceptable time window.`,
161
+ ));
167
162
  },
168
163
  o = () => {
169
164
  this.fg();
170
165
  const n = h.pop();
171
166
  if (null != n)
172
- if ((this.Tg(n, i, s, e, h), n.od(i))) {
167
+ if ((this.Tg(n, i, s, e, h), n.dd(i))) {
173
168
  let t = `Server aborted in-app message display, but the timeout on fallback trigger ${n.id} has already elapsed.`;
174
- h.length > 0 && (t += " Continuing to fall back."),
175
- r.info(t),
176
- this.ig.Ve(n.id, InAppMessage.Me.bh),
177
- o();
169
+ h.length > 0 && (t += " Continuing to fall back."), r.info(t), o();
178
170
  } else {
179
171
  r.info(
180
172
  `Server aborted in-app message display. Falling back to lower priority ${n.type} trigger action ${t.id}.`,
181
173
  );
182
- const o = 1e3 * n.Yu - (new Date().valueOf() - i);
174
+ const o = 1e3 * n.ed - (new Date().valueOf() - i);
183
175
  o > 0
184
176
  ? this.eg.push(
185
177
  window.setTimeout(() => {
@@ -189,40 +181,37 @@ export default class gr extends y {
189
181
  : this.cg(n, i, s, e, h);
190
182
  }
191
183
  };
192
- let a, l, g;
184
+ let l, a, g;
193
185
  switch (t.type) {
194
- case pt.Kr.Jr:
195
- if (((a = lt(t.data)), null == a)) {
186
+ case mt._r.Br:
187
+ if (((l = pt(t.data)), null == l)) {
196
188
  r.error(
197
189
  `Could not parse trigger data for trigger ${t.id}, ignoring.`,
198
- ),
199
- this.ig.Ve(t.id, InAppMessage.Me.Lr);
190
+ );
200
191
  break;
201
192
  }
202
- if (((l = this.ig.Wi(a)), l)) {
203
- r.error(l), o();
193
+ if (((a = this.ig.Li(l)), a)) {
194
+ r.error(a), o();
204
195
  break;
205
196
  }
206
- n(a);
197
+ n(l);
207
198
  break;
208
- case pt.Kr.nd:
209
- if (((g = wt.fromJson(t.data, n, o, i, t.Vr || 0)), null == g)) {
199
+ case mt._r.md:
200
+ if (((g = wt.fromJson(t.data, n, o, i, t.Nr || 0)), null == g)) {
210
201
  r.error(
211
202
  `Could not parse trigger data for trigger ${t.id}, ignoring.`,
212
- ),
213
- this.ig.Ve(t.id, InAppMessage.Me.Lr);
203
+ );
214
204
  break;
215
205
  }
216
- this.ig.Mr(g, s, e);
206
+ this.ig.Yi(g, s, e);
217
207
  break;
218
208
  default:
219
- r.error(`Trigger ${t.id} was of unexpected type ${t.type}, ignoring.`),
220
- this.ig.Ve(t.id, InAppMessage.Me.Lr);
209
+ r.error(`Trigger ${t.id} was of unexpected type ${t.type}, ignoring.`);
221
210
  }
222
211
  }
223
212
  fe(t, i = null, s) {
224
213
  if (!J(tt, t, "Cannot fire trigger action.", "TriggerEvents")) return;
225
- if (this.Ei && this.Ei.Lu())
214
+ if (this.zi && this.zi.Nu())
226
215
  return (
227
216
  r.info(
228
217
  "Trigger sync is currently in progress, awaiting sync completion before firing trigger event.",
@@ -234,22 +223,22 @@ export default class gr extends y {
234
223
  h = e - (this.hg || 0);
235
224
  let n = !0,
236
225
  o = !0;
237
- const a = [];
226
+ const l = [];
238
227
  for (let s = 0; s < this.triggers.length; s++) {
239
228
  const r = this.triggers[s],
240
- h = e + 1e3 * r.Yu;
229
+ h = e + 1e3 * r.ed;
241
230
  if (
242
- r.ed(h) &&
231
+ r.nd(h) &&
243
232
  (null == r.startTime || r.startTime.valueOf() <= e) &&
244
233
  (null == r.endTime || r.endTime.valueOf() >= e)
245
234
  ) {
246
235
  let s = !1;
247
- for (let e = 0; e < r.Wu.length; e++)
248
- if (r.Wu[e].sc(t, i)) {
236
+ for (let e = 0; e < r.sd.length; e++)
237
+ if (r.sd[e].sc(t, i)) {
249
238
  s = !0;
250
239
  break;
251
240
  }
252
- s && ((n = !1), this.wg(r, h, t) && ((o = !1), a.push(r)));
241
+ s && ((n = !1), this.wg(r, h, t) && ((o = !1), l.push(r)));
253
242
  }
254
243
  }
255
244
  if (n)
@@ -262,27 +251,27 @@ export default class gr extends y {
262
251
  h / 1e3
263
252
  }s ago.`,
264
253
  );
265
- a.sort((t, i) => t.priority - i.priority);
266
- const l = a.pop();
267
- null != l &&
254
+ l.sort((t, i) => t.priority - i.priority);
255
+ const a = l.pop();
256
+ null != a &&
268
257
  (r.info(
269
- `Firing ${l.type} trigger action ${l.id} from trigger event ${t}.`,
258
+ `Firing ${a.type} trigger action ${a.id} from trigger event ${t}.`,
270
259
  ),
271
- this.Tg(l, e, t, s, a),
272
- 0 === l.Yu
273
- ? this.cg(l, e, t, s, a)
260
+ this.Tg(a, e, t, s, l),
261
+ 0 === a.ed
262
+ ? this.cg(a, e, t, s, l)
274
263
  : this.eg.push(
275
264
  window.setTimeout(() => {
276
- this.cg(l, e, t, s, a);
277
- }, 1e3 * l.Yu),
265
+ this.cg(a, e, t, s, l);
266
+ }, 1e3 * a.ed),
278
267
  ));
279
268
  }
280
269
  changeUser(t = !1) {
281
- if (((this.triggers = []), this.u && this.u.hi(o.C.rE), !t)) {
270
+ if (((this.triggers = []), this.u && this.u.ti(o.C.rE), !t)) {
282
271
  (this.sg = []), (this.hg = null), (this.og = {}), (this.ng = {});
283
272
  for (let t = 0; t < this.eg.length; t++) clearTimeout(this.eg[t]);
284
273
  (this.eg = []),
285
- this.u && (this.u.hi(o.C.aE), this.u.hi(o.C.nE), this.u.hi(o.C.iE));
274
+ this.u && (this.u.ti(o.C.iE), this.u.ti(o.C.aE), this.u.ti(o.C.EE));
286
275
  }
287
276
  }
288
277
  clearData() {
@@ -299,25 +288,25 @@ export default class gr extends y {
299
288
  ),
300
289
  !0
301
290
  );
302
- let e = t.td;
291
+ let e = t.hd;
303
292
  return null == e && (e = this.tg), i - this.hg >= 1e3 * e;
304
293
  }
305
294
  Tg(t, i, s, e, r) {
306
295
  this.fg(), t.id && (this.ng[t.id] = this.ng[t.id] || []);
307
296
  const h = {};
308
297
  let n;
309
- (h.Ur = i), (h.ug = s), null != e && (n = e.Y()), (h.dg = n);
310
- const a = [];
311
- for (const t of r) t.id && a.push(t.id);
312
- (h.pg = a),
298
+ (h.Gr = i), (h.ug = s), null != e && (n = e.Y()), (h.dg = n);
299
+ const l = [];
300
+ for (const t of r) t.id && l.push(t.id);
301
+ (h.pg = l),
313
302
  t.id && this.ng[t.id].push(h),
314
- this.u && this.u.k(o.C.iE, this.ng);
303
+ this.u && this.u.k(o.C.EE, this.ng);
315
304
  }
316
305
  yg(t, i) {
317
306
  this.fg(),
318
- t.rd(i),
307
+ t.ad(i),
319
308
  (this.hg = i),
320
309
  t.id && (this.og[t.id] = i),
321
- this.u && (this.u.k(o.C.aE, i), this.u.k(o.C.nE, this.og));
310
+ this.u && (this.u.k(o.C.iE, i), this.u.k(o.C.aE, this.og));
322
311
  }
323
312
  }
@@ -1,13 +1,13 @@
1
1
  import e, { OPTIONS as L } from "../../managers/braze-instance.js";
2
2
  export function attachCSS(n, t, o) {
3
3
  const c = n || document.querySelector("head"),
4
- s = `ab-${t}-css-definitions-${"5.1.1".replace(/\./g, "-")}`;
4
+ s = `ab-${t}-css-definitions-${"5.3.0".replace(/\./g, "-")}`;
5
5
  if (!c) return;
6
6
  const a = c.ownerDocument || document;
7
7
  if (null == a.getElementById(s)) {
8
8
  const n = a.createElement("style");
9
9
  (n.innerHTML = o || ""), (n.id = s);
10
- const t = e.nn(L.wo);
10
+ const t = e.nn(L.bo);
11
11
  null != t && n.setAttribute("nonce", t), c.appendChild(n);
12
12
  }
13
13
  }
@@ -1,6 +1,6 @@
1
1
  import e, { OPTIONS as L } from "../../managers/braze-instance.js";
2
2
  export function loadFontAwesome() {
3
- if (e.nn(L.Uo)) return;
3
+ if (e.nn(L.Mo)) return;
4
4
  const t = "https://use.fontawesome.com/7f85a56ba4.css";
5
5
  if (
6
6
  !(null !== document.querySelector('link[rel=stylesheet][href="' + t + '"]'))
@@ -1,14 +1,14 @@
1
1
  import { isArray as j } from "./code-utils.js";
2
2
  export default class ge {
3
3
  constructor() {}
4
- tf() {}
5
4
  ef() {}
6
- Oa(t) {}
7
- static rf(t, e) {
5
+ rf() {}
6
+ Ta(t) {}
7
+ static sf(t, e) {
8
8
  if (t && e)
9
- if (((t = t.toLowerCase()), j(e.if))) {
10
- for (let r = 0; r < e.if.length; r++)
11
- if (-1 !== t.indexOf(e.if[r].toLowerCase())) return e.identity;
12
- } else if (-1 !== t.indexOf(e.if.toLowerCase())) return e.identity;
9
+ if (((t = t.toLowerCase()), j(e.ff))) {
10
+ for (let r = 0; r < e.ff.length; r++)
11
+ if (-1 !== t.indexOf(e.ff[r].toLowerCase())) return e.identity;
12
+ } else if (-1 !== t.indexOf(e.ff.toLowerCase())) return e.identity;
13
13
  }
14
14
  }
@@ -25,14 +25,14 @@ export const BRAZE_ACTIONS = {
25
25
  properties: { type: "type", oo: "steps", eo: "args" },
26
26
  };
27
27
  export const INELIGIBLE_BRAZE_ACTION_URL_ERROR_TYPES = {
28
- Xi: "unknownBrazeAction",
29
- Zi: "noPushPrompt",
28
+ Qi: "unknownBrazeAction",
29
+ Wi: "noPushPrompt",
30
30
  };
31
31
  export const ineligibleBrazeActionURLErrorMessage = (t, o) => {
32
32
  switch (t) {
33
- case INELIGIBLE_BRAZE_ACTION_URL_ERROR_TYPES.Xi:
33
+ case INELIGIBLE_BRAZE_ACTION_URL_ERROR_TYPES.Qi:
34
34
  return `${o} contains an unknown braze action type and will not be displayed.`;
35
- case INELIGIBLE_BRAZE_ACTION_URL_ERROR_TYPES.Zi:
35
+ case INELIGIBLE_BRAZE_ACTION_URL_ERROR_TYPES.Wi:
36
36
  return `${o} contains a push prompt braze action, but is not eligible for a push prompt. Ignoring.`;
37
37
  default:
38
38
  return "";
@@ -6,10 +6,10 @@ class ui {
6
6
  const t = navigator.userAgentData ? ai : oi;
7
7
  (this.Sg = new t()),
8
8
  (this.userAgent = navigator.userAgent),
9
- (this.browser = this.Sg.tf()),
10
- (this.version = this.Sg.ef()),
9
+ (this.browser = this.Sg.ef()),
10
+ (this.version = this.Sg.rf()),
11
11
  (this.OS = null),
12
- this.Oa().then((t) => (this.OS = t));
12
+ this.Ta().then((t) => (this.OS = t));
13
13
  const i = navigator;
14
14
  (this.language = (
15
15
  i.userLanguage ||
@@ -18,18 +18,18 @@ class ui {
18
18
  i.systemLanguage ||
19
19
  ""
20
20
  ).toLowerCase()),
21
- (this.Qo = ui.vg(this.userAgent));
21
+ (this.Zo = ui.vg(this.userAgent));
22
22
  }
23
- OE() {
23
+ IE() {
24
24
  return this.browser === gi.Bg;
25
25
  }
26
- Ga() {
26
+ Oa() {
27
27
  return this.OS || null;
28
28
  }
29
- Oa() {
29
+ Ta() {
30
30
  return this.OS
31
31
  ? Promise.resolve(this.OS)
32
- : this.Sg.Oa(ui.Og).then((t) => ((this.OS = t), t));
32
+ : this.Sg.Ta(ui.kg).then((t) => ((this.OS = t), t));
33
33
  }
34
34
  static vg(t) {
35
35
  t = t.toLowerCase();
@@ -50,35 +50,36 @@ class ui {
50
50
  "adsbot",
51
51
  "mediapartners-google",
52
52
  "teoma",
53
+ "taiko",
53
54
  ];
54
55
  for (let n = 0; n < i.length; n++) if (-1 !== t.indexOf(i[n])) return !0;
55
56
  return !1;
56
57
  }
57
58
  }
58
- ui.Og = [
59
- { string: navigator.platform, if: "Win", identity: Y.Pg },
60
- { string: navigator.platform, if: "Mac", identity: Y.kg },
61
- { string: navigator.platform, if: "BlackBerry", identity: "BlackBerry" },
62
- { string: navigator.platform, if: "FreeBSD", identity: "FreeBSD" },
63
- { string: navigator.platform, if: "OpenBSD", identity: "OpenBSD" },
64
- { string: navigator.platform, if: "Nintendo", identity: "Nintendo" },
65
- { string: navigator.platform, if: "SunOS", identity: "SunOS" },
66
- { string: navigator.platform, if: "PlayStation", identity: "PlayStation" },
67
- { string: navigator.platform, if: "X11", identity: "X11" },
59
+ ui.kg = [
60
+ { string: navigator.platform, ff: "Win", identity: Y.Og },
61
+ { string: navigator.platform, ff: "Mac", identity: Y.Pg },
62
+ { string: navigator.platform, ff: "BlackBerry", identity: "BlackBerry" },
63
+ { string: navigator.platform, ff: "FreeBSD", identity: "FreeBSD" },
64
+ { string: navigator.platform, ff: "OpenBSD", identity: "OpenBSD" },
65
+ { string: navigator.platform, ff: "Nintendo", identity: "Nintendo" },
66
+ { string: navigator.platform, ff: "SunOS", identity: "SunOS" },
67
+ { string: navigator.platform, ff: "PlayStation", identity: "PlayStation" },
68
+ { string: navigator.platform, ff: "X11", identity: "X11" },
68
69
  {
69
70
  string: navigator.userAgent,
70
- if: ["iPhone", "iPad", "iPod"],
71
+ ff: ["iPhone", "iPad", "iPod"],
71
72
  identity: Y.io,
72
73
  },
73
- { string: navigator.platform, if: "Pike v", identity: Y.io },
74
- { string: navigator.userAgent, if: ["Web0S"], identity: "WebOS" },
74
+ { string: navigator.platform, ff: "Pike v", identity: Y.io },
75
+ { string: navigator.userAgent, ff: ["Web0S"], identity: "WebOS" },
75
76
  {
76
77
  string: navigator.platform,
77
- if: ["Linux armv7l", "Android"],
78
+ ff: ["Linux armv7l", "Android"],
78
79
  identity: Y.xg,
79
80
  },
80
- { string: navigator.userAgent, if: ["Android"], identity: Y.xg },
81
- { string: navigator.platform, if: "Linux", identity: "Linux" },
81
+ { string: navigator.userAgent, ff: ["Android"], identity: Y.xg },
82
+ { string: navigator.platform, ff: "Linux", identity: "Linux" },
82
83
  ];
83
84
  const X = new ui();
84
85
  export { X as default, ui as BrowserDetector };
@@ -15,17 +15,17 @@ export default class ai extends ge {
15
15
  }
16
16
  this.OS = null;
17
17
  }
18
- tf() {
18
+ ef() {
19
19
  return this.browser;
20
20
  }
21
- ef() {
21
+ rf() {
22
22
  return this.version;
23
23
  }
24
- Oa(t) {
24
+ Ta(t) {
25
25
  if (this.OS) return Promise.resolve(this.OS);
26
26
  const s = (s) => {
27
27
  for (let r = 0; r < t.length; r++) {
28
- const i = ai.rf(s, t[r]);
28
+ const i = ai.sf(s, t[r]);
29
29
  if (i) return (this.OS = i), this.OS;
30
30
  }
31
31
  return s;
@@ -1,5 +1,5 @@
1
1
  import { addPassiveEventListener as oe, buildSvg as ae } from "./dom-utils.js";
2
- import { KeyCodes as at } from "./key-codes.js";
2
+ import { KeyCodes as lt } from "./key-codes.js";
3
3
  export function createCloseButton(t, o, e) {
4
4
  const n = document.createElement("button");
5
5
  n.setAttribute("aria-label", t),
@@ -15,7 +15,7 @@ export function createCloseButton(t, o, e) {
15
15
  return (
16
16
  n.appendChild(r),
17
17
  n.addEventListener("keydown", (t) => {
18
- (t.keyCode !== at.To && t.keyCode !== at.Eo) ||
18
+ (t.keyCode !== lt.Fo && t.keyCode !== lt.To) ||
19
19
  (e(), t.stopPropagation());
20
20
  }),
21
21
  (n.onclick = (t) => {
@@ -8,6 +8,6 @@ export const Browsers = {
8
8
  export const OperatingSystems = {
9
9
  xg: "Android",
10
10
  io: "iOS",
11
- kg: "Mac",
12
- Pg: "Windows",
11
+ Pg: "Mac",
12
+ Og: "Windows",
13
13
  };
@@ -18,8 +18,8 @@ export function _isInView(t, n = !1, e = !1, s = !1) {
18
18
  !s)
19
19
  );
20
20
  }
21
- export const DOMUtils = { dc: null, co: _isInView };
22
- export const DIRECTIONS = { De: "up", Ee: "down", U: "left", V: "right" };
21
+ export const DOMUtils = { dc: null, po: _isInView };
22
+ export const DIRECTIONS = { Re: "up", Se: "down", U: "left", V: "right" };
23
23
  export function supportsPassive() {
24
24
  if (null == DOMUtils.dc) {
25
25
  DOMUtils.dc = !1;
@@ -41,10 +41,10 @@ export function addPassiveEventListener(t, n, e = () => {}) {
41
41
  t.addEventListener(n, e, !!supportsPassive() && { passive: !0 });
42
42
  }
43
43
  export function topIsInView(t) {
44
- return DOMUtils.co(t, !0, !1, !1);
44
+ return DOMUtils.po(t, !0, !1, !1);
45
45
  }
46
46
  export function bottomIsInView(t) {
47
- return DOMUtils.co(t, !1, !0, !1);
47
+ return DOMUtils.po(t, !1, !0, !1);
48
48
  }
49
49
  export function clickElement(t) {
50
50
  if (t.onclick) {
@@ -69,9 +69,9 @@ export function detectSwipe(t, n, e) {
69
69
  (i = null))
70
70
  : Math.abs(u) >= 25 &&
71
71
  (((u > 0 &&
72
- n === DIRECTIONS.De &&
72
+ n === DIRECTIONS.Re &&
73
73
  t.scrollTop === t.scrollHeight - t.offsetHeight) ||
74
- (u < 0 && n === DIRECTIONS.Ee && 0 === t.scrollTop)) &&
74
+ (u < 0 && n === DIRECTIONS.Se && 0 === t.scrollTop)) &&
75
75
  e(o),
76
76
  (s = null),
77
77
  (i = null));
@@ -1 +1 @@
1
- export const KeyCodes = { To: 32, lo: 9, Eo: 13, _h: 27 };
1
+ export const KeyCodes = { Fo: 32, lo: 9, To: 13, mh: 27 };
package/src/util/net.js CHANGED
@@ -2,7 +2,7 @@ import { logger as r } from "../../shared-lib/index.js";
2
2
  import qt from "../models/backend-errors.js";
3
3
  import { getErrorMessage as si } from "./error-utils.js";
4
4
  const C = {
5
- Qs: (t) => {
5
+ Gs: (t) => {
6
6
  let e, o;
7
7
  try {
8
8
  const n = () => {
@@ -13,7 +13,7 @@ const C = {
13
13
  e = new XMLHttpRequest();
14
14
  const i = () => {
15
15
  "function" == typeof t.error && t.error(e.status),
16
- "function" == typeof t.ti && t.ti(!1);
16
+ "function" == typeof t.Ws && t.Ws(!1);
17
17
  };
18
18
  (e.onload = () => {
19
19
  let o = !1;
@@ -28,14 +28,14 @@ const C = {
28
28
  (r = e.getAllResponseHeaders());
29
29
  } catch (o) {
30
30
  const n = {
31
- error: "" === e.responseText ? qt.Ka : qt.La,
31
+ error: "" === e.responseText ? qt.Zh : qt.Ra,
32
32
  response: e.responseText,
33
33
  };
34
34
  (0, t.L)(n, r);
35
35
  }
36
36
  o && t.L(o, r);
37
37
  }
38
- "function" == typeof t.ti && t.ti(!0);
38
+ "function" == typeof t.Ws && t.Ws(!0);
39
39
  } else i();
40
40
  }),
41
41
  (e.onerror = () => {