@braze/web-sdk 4.5.0 → 4.6.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 (86) hide show
  1. package/README.md +1 -1
  2. package/index.d.ts +49 -8
  3. package/package.json +1 -1
  4. package/shared-lib/braze-shared-lib.js +7 -7
  5. package/shared-lib/encoding-utils.js +3 -3
  6. package/shared-lib/event-types.js +14 -14
  7. package/shared-lib/guid.js +2 -2
  8. package/shared-lib/indexed-db-adapter.js +3 -3
  9. package/shared-lib/logger.js +18 -18
  10. package/shared-lib/supported-options.js +15 -15
  11. package/src/Card/index.js +1 -0
  12. package/src/Card/log-content-card-click.js +4 -0
  13. package/src/FeatureFlags/feature-flag-factory.js +13 -5
  14. package/src/FeatureFlags/feature-flag.js +36 -8
  15. package/src/FeatureFlags/feature-flags-provider.js +58 -33
  16. package/src/FeatureFlags/get-all-feature-flags.js +3 -3
  17. package/src/FeatureFlags/get-feature-flag.js +5 -5
  18. package/src/FeatureFlags/index.js +1 -0
  19. package/src/Feed/feed-provider-factory.js +8 -8
  20. package/src/Feed/feed-provider.js +3 -3
  21. package/src/Feed/get-cached-feed.js +2 -2
  22. package/src/Feed/log-feed-displayed.js +1 -1
  23. package/src/Feed/request-feed-refresh.js +2 -2
  24. package/src/Feed/subscribe-to-feed-updates.js +2 -2
  25. package/src/Feed/ui/show-feed.js +2 -2
  26. package/src/InAppMessage/display/html-message-to-html.js +3 -3
  27. package/src/InAppMessage/display/in-app-message-to-html.js +101 -86
  28. package/src/InAppMessage/display/modal-utils.js +9 -9
  29. package/src/InAppMessage/in-app-message-factory.js +1 -1
  30. package/src/InAppMessage/in-app-message-manager-factory.js +3 -3
  31. package/src/InAppMessage/in-app-message-manager.js +52 -52
  32. package/src/InAppMessage/log-in-app-message-button-click.js +2 -2
  33. package/src/InAppMessage/log-in-app-message-click.js +2 -2
  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/full-screen-message.js +1 -1
  37. package/src/InAppMessage/models/in-app-message-button.js +4 -4
  38. package/src/InAppMessage/models/in-app-message.js +68 -68
  39. package/src/InAppMessage/models/modal-message.js +2 -2
  40. package/src/InAppMessage/models/slide-up-message.js +8 -8
  41. package/src/InAppMessage/models/templated-in-app-message.js +4 -4
  42. package/src/InAppMessage/subscribe-to-in-app-message.js +1 -1
  43. package/src/InAppMessage/ui/automatically-show-in-app-messages.js +3 -3
  44. package/src/InAppMessage/ui/show-in-app-message.js +24 -21
  45. package/src/Push/push-manager.js +54 -54
  46. package/src/Push/utils/push-utils.js +4 -4
  47. package/src/User/user-manager.js +4 -4
  48. package/src/User/user.js +13 -13
  49. package/src/common/base-feed.js +1 -1
  50. package/src/common/feed-display.js +22 -22
  51. package/src/l10n/l10n-manager-factory.js +7 -7
  52. package/src/managers/auth-manager.js +23 -23
  53. package/src/managers/braze-instance.js +93 -93
  54. package/src/managers/device-manager.js +2 -2
  55. package/src/managers/network-manager.js +42 -42
  56. package/src/managers/server-config-manager.js +9 -9
  57. package/src/managers/session-manager.js +27 -27
  58. package/src/managers/storage-manager-factory.js +1 -1
  59. package/src/managers/storage-manager.js +61 -61
  60. package/src/managers/subscription-manager.js +6 -6
  61. package/src/models/backend-errors.js +5 -5
  62. package/src/models/braze-event.js +2 -2
  63. package/src/models/device.js +1 -1
  64. package/src/models/identifier.js +6 -6
  65. package/src/models/push-token.js +3 -3
  66. package/src/models/server-config.js +3 -3
  67. package/src/request-controller.js +52 -52
  68. package/src/triggers/models/filter-set.js +2 -2
  69. package/src/triggers/models/filter.js +34 -34
  70. package/src/triggers/models/in-app-message-click-data.js +6 -6
  71. package/src/triggers/models/push-click-data.js +1 -1
  72. package/src/triggers/models/trigger-condition.js +8 -8
  73. package/src/triggers/models/trigger-events.js +1 -1
  74. package/src/triggers/models/trigger.js +30 -30
  75. package/src/triggers/triggers-provider-factory.js +2 -2
  76. package/src/triggers/triggers-provider.js +37 -37
  77. package/src/ui/js/attach-css.js +1 -1
  78. package/src/ui/js/feed-css.js +1 -1
  79. package/src/ui/js/iam-css.js +1 -1
  80. package/src/ui/js/load-font-awesome.js +1 -1
  81. package/src/util/braze-actions.js +4 -4
  82. package/src/util/browser-detector.js +2 -2
  83. package/src/util/dom-utils.js +8 -8
  84. package/src/util/key-codes.js +1 -1
  85. package/src/util/net.js +3 -3
  86. package/src/util/window-utils.js +1 -1
@@ -1,7 +1,7 @@
1
1
  import b from "./util/net.js";
2
2
  import ue from "./models/braze-event.js";
3
3
  import s from "./common/event-logger.js";
4
- import { randomInclusive as pt } from "./util/math.js";
4
+ import { randomInclusive as tt } from "./util/math.js";
5
5
  import t from "./models/request-result.js";
6
6
  import r from "../shared-lib/braze-shared-lib.js";
7
7
  import { STORAGE_KEYS as o } from "./managers/storage-manager.js";
@@ -10,44 +10,44 @@ import dt from "./Push/utils/push-utils.js";
10
10
  export default class Lt {
11
11
  constructor(t, s, i, e, n, l, h, o, r, a) {
12
12
  (this._r = t),
13
- (this.Bo = s),
13
+ (this.Wo = s),
14
14
  (this.kl = 0),
15
- (this.yl = h.Pa()),
15
+ (this.yl = h.xa()),
16
16
  (this.jl = null),
17
17
  (this.j = i),
18
18
  (this.Ur = e),
19
19
  (this.v = n),
20
20
  (this.gt = l),
21
21
  (this.h = h),
22
- (this.Ko = r),
22
+ (this.Ho = r),
23
23
  (this.vt = a),
24
24
  (this.$l = o),
25
25
  (this.Al = new u()),
26
- (this.Tl = 50);
26
+ (this.ql = 50);
27
27
  }
28
- ql(t, s) {
29
- return !t && !s && this.Ko.Yn() >= this.Tl;
28
+ Fl(t, s) {
29
+ return !t && !s && this.Ho.au() >= this.ql;
30
30
  }
31
- Fl(t) {
32
- let s = this.j.gh();
31
+ Dl(t) {
32
+ let s = this.j.jh();
33
33
  if (t.length > 0) {
34
34
  const i = this.v.getUserId();
35
35
  for (const e of t) {
36
36
  const t = (!e.userId && !i) || e.userId === i;
37
- e.type === r.A.Ch && t && (s = !0);
37
+ e.type === r.A._h && t && (s = !0);
38
38
  }
39
39
  }
40
40
  return s;
41
41
  }
42
- Dl(t, s, i, e, n, l, h) {
43
- null == i && (i = !0), i && this.Ll();
42
+ Ll(t, s, i, e, n, l, h) {
43
+ null == i && (i = !0), i && this.Pl();
44
44
  const u = this.h.Ua(),
45
- a = this.h.Ba();
45
+ a = this.h.Pa();
46
46
  let c = !1;
47
47
  const d = (t, s) => {
48
48
  let h = !1;
49
49
  b.Hs({
50
- url: this.Bo + "/data/",
50
+ url: this.Wo + "/data/",
51
51
  data: t,
52
52
  headers: s,
53
53
  S: i => {
@@ -55,14 +55,14 @@ export default class Lt {
55
55
  t.respond_with.triggers &&
56
56
  (this.kl = Math.max(this.kl - 1, 0)),
57
57
  this.vt.Os(t, i, s)
58
- ? (this.Ko.Qs(),
58
+ ? (this.Ho.Qs(),
59
59
  this.gt.al(i),
60
60
  (null != t.respond_with &&
61
61
  t.respond_with.user_id != this.v.getUserId()) ||
62
62
  (null != t.device && this.h.B(o.q.Yo, t.device),
63
63
  null != t.sdk_metadata &&
64
- (this.h.B(o.q.ua, t.sdk_metadata),
65
- this.h.B(o.q.ha, this.j.ca())),
64
+ (this.h.B(o.q.ha, t.sdk_metadata),
65
+ this.h.B(o.q.ca, this.j.la())),
66
66
  this.$l(i),
67
67
  "function" == typeof e && e()))
68
68
  : i.auth_error && (h = !0);
@@ -71,37 +71,37 @@ export default class Lt {
71
71
  null != t.respond_with &&
72
72
  t.respond_with.triggers &&
73
73
  (this.kl = Math.max(this.kl - 1, 0)),
74
- this.vt.la(t.events, t.attributes),
74
+ this.vt.fa(t.events, t.attributes),
75
75
  "function" == typeof n && n();
76
76
  },
77
- Pl: t => {
77
+ Ue: t => {
78
78
  if (("function" == typeof l && l(t), i && !c)) {
79
79
  if (t && !h) this.Rl();
80
80
  else {
81
81
  let t = this.jl;
82
82
  (null == t || t < 1e3 * this.yl) && (t = 1e3 * this.yl),
83
- this.Rl(Math.min(3e5, pt(1e3 * this.yl, 3 * t)));
83
+ this.Rl(Math.min(3e5, tt(1e3 * this.yl, 3 * t)));
84
84
  }
85
85
  c = !0;
86
86
  }
87
87
  }
88
88
  });
89
89
  },
90
- m = this.Fl(u),
90
+ m = this.Dl(u),
91
91
  f = s || m;
92
- if (this.ql(h, m))
92
+ if (this.Fl(h, m))
93
93
  return void r.D.info(
94
94
  "Declining to flush data due to 50 consecutive authentication failures"
95
95
  );
96
- if (i && !this.vt.ga(u, a, t, f))
96
+ if (i && !this.vt.qa(u, a, t, f))
97
97
  return this.Rl(), void ("function" == typeof l && l(!0));
98
- const g = this.vt.qa(t, f, u, a);
98
+ const g = this.vt.Aa(t, f, u, a);
99
99
  f && this.kl++;
100
100
  let p = !1;
101
101
  if (g)
102
102
  for (const t of g)
103
103
  this.vt.Gs(t.requestData, () => d(t.requestData, t.headers)), (p = !0);
104
- this.Ko.Jn() && i && !p
104
+ this.Ho.Kn() && i && !p
105
105
  ? this.Rl()
106
106
  : m && (r.D.info("Invoking new session subscriptions"), this.Al.St());
107
107
  }
@@ -111,20 +111,20 @@ export default class Lt {
111
111
  Rl(t) {
112
112
  this.Il ||
113
113
  (null == t && (t = 1e3 * this.yl),
114
- this.Ll(),
114
+ this.Pl(),
115
115
  (this.Nl = setTimeout(() => {
116
116
  if (document.hidden) {
117
117
  const t = "visibilitychange",
118
118
  s = () => {
119
119
  document.hidden ||
120
- (document.removeEventListener(t, s, !1), this.Dl());
120
+ (document.removeEventListener(t, s, !1), this.Ll());
121
121
  };
122
122
  document.addEventListener(t, s, !1);
123
- } else this.Dl();
123
+ } else this.Ll();
124
124
  }, t)),
125
125
  (this.jl = t));
126
126
  }
127
- Ll() {
127
+ Pl() {
128
128
  null != this.Nl && (clearTimeout(this.Nl), (this.Nl = null));
129
129
  }
130
130
  initialize() {
@@ -132,20 +132,20 @@ export default class Lt {
132
132
  }
133
133
  destroy() {
134
134
  this.Al.removeAllSubscriptions(),
135
- this.Ko.Wn(),
136
- this.Ll(),
135
+ this.Ho.Yn(),
136
+ this.Pl(),
137
137
  (this.Il = !0),
138
- this.Dl(null, null, !1),
138
+ this.Ll(null, null, !1),
139
139
  (this.Nl = null);
140
140
  }
141
141
  cr(t) {
142
142
  return this.Al.ut(t);
143
143
  }
144
144
  openSession() {
145
- const t = this.j.ca() !== this.j.mo();
145
+ const t = this.j.la() !== this.j.mo();
146
146
  t && (this.h.ya(o.eu.Jo), this.h.ya(o.eu.su)),
147
- this.Dl(null, !1, null, null, null),
148
- this.Ln(),
147
+ this.Ll(null, !1, null, null, null),
148
+ this.Rn(),
149
149
  t &&
150
150
  import("./Push/push-manager-factory.js").then(t => {
151
151
  if (this.Il) return;
@@ -155,7 +155,7 @@ export default class Lt {
155
155
  (dt.isPushPermissionGranted() || dt.isPushBlocked())
156
156
  ) {
157
157
  const t = () => {
158
- s.Gr()
158
+ s.Jr()
159
159
  ? r.D.info(
160
160
  "Push token maintenance is disabled, not refreshing token for backend."
161
161
  )
@@ -165,7 +165,7 @@ export default class Lt {
165
165
  i && t();
166
166
  },
167
167
  e = () => {
168
- const s = this.h.I(o.q.Pn);
168
+ const s = this.h.I(o.q.Sn);
169
169
  (null == s || s) && t();
170
170
  },
171
171
  n = r.xt.Ft;
@@ -176,10 +176,10 @@ export default class Lt {
176
176
  changeUser(t, s, i) {
177
177
  const e = this.v.getUserId();
178
178
  if (e !== t) {
179
- this.j.Gh(),
180
- null != e && this.Dl(null, !1, null, null, null),
179
+ this.j.Fh(),
180
+ null != e && this.Ll(null, !1, null, null, null),
181
181
  this.v.uu(t),
182
- i ? this.Ko.setSdkAuthenticationSignature(i) : this.Ko.Qn();
182
+ i ? this.Ho.setSdkAuthenticationSignature(i) : this.Ho.Wn();
183
183
  for (let t = 0; t < s.length; t++) s[t].changeUser(null == e);
184
184
  null != e && this.h.Xs(o.q.P),
185
185
  this.h.Xs(o.q.Yo),
@@ -188,15 +188,15 @@ export default class Lt {
188
188
  } else {
189
189
  let s = "Doing nothing.";
190
190
  i &&
191
- this.Ko.Kn() !== i &&
192
- (this.Ko.setSdkAuthenticationSignature(i),
191
+ this.Ho.Mn() !== i &&
192
+ (this.Ho.setSdkAuthenticationSignature(i),
193
193
  (s = "Updated SDK authentication signature")),
194
194
  r.D.info(`Current user is already ${t}. ${s}`);
195
195
  }
196
196
  }
197
197
  requestImmediateDataFlush(t) {
198
- this.Ll(), this.j.mo();
199
- this.Dl(
198
+ this.Pl(), this.j.mo();
199
+ this.Ll(
200
200
  null,
201
201
  null,
202
202
  null,
@@ -211,12 +211,12 @@ export default class Lt {
211
211
  );
212
212
  }
213
213
  requestFeedRefresh() {
214
- this.j.mo(), this.Dl(!0);
214
+ this.j.mo(), this.Ll(!0);
215
215
  }
216
216
  zr(t, s) {
217
217
  this.j.mo(),
218
218
  r.D.info("Requesting explicit trigger refresh."),
219
- this.Dl(null, !0, null, t, s);
219
+ this.Ll(null, !0, null, t, s);
220
220
  }
221
221
  Nn(t, i) {
222
222
  const e = r.A.Ol,
@@ -251,24 +251,24 @@ export default class Lt {
251
251
  const i = this.j.mo();
252
252
  return new ue(this.v.getUserId(), r.A.xl, t, i, { cid: s });
253
253
  }
254
- Ln() {
254
+ Rn() {
255
255
  const t = r.xt.Ft;
256
256
  new r.qt(t, r.D).setItem(t.$t.Kl, 1, {
257
- baseUrl: this.Bo,
257
+ baseUrl: this.Wo,
258
258
  data: { api_key: this._r, device_id: this.Ur.te().id },
259
259
  userId: this.v.getUserId(),
260
- sdkAuthEnabled: this.Ko.Jn()
260
+ sdkAuthEnabled: this.Ho.Kn()
261
261
  });
262
262
  }
263
263
  wr(t) {
264
264
  for (const s of t)
265
- if (s.api_key === this._r) this.vt.la(s.events, s.attributes);
265
+ if (s.api_key === this._r) this.vt.fa(s.events, s.attributes);
266
266
  else {
267
267
  const t = r.xt.Ft;
268
268
  new r.qt(t, r.D).setItem(t.$t.$r, r.it.nt(), s);
269
269
  }
270
270
  }
271
- Tn(i, e, n) {
271
+ $n(i, e, n) {
272
272
  if (this.gt.hu(i))
273
273
  return (
274
274
  r.D.info(`Custom Attribute "${i}" is blocklisted, ignoring.`), new t()
@@ -281,7 +281,7 @@ export default class Lt {
281
281
  s.G(l, h)
282
282
  );
283
283
  }
284
- $n(t, i) {
284
+ Bn(t, i) {
285
285
  const e = { group_id: t, status: i };
286
286
  return s.G(r.A.Gl, e);
287
287
  }
@@ -42,12 +42,12 @@ export default class kt {
42
42
  }
43
43
  return t;
44
44
  }
45
- static Sn(t) {
45
+ static jn(t) {
46
46
  const r = [];
47
47
  for (let e = 0; e < t.length; e++) {
48
48
  const o = [],
49
49
  s = t[e];
50
- for (let t = 0; t < s.length; t++) o.push(Gt.Sn(s[t]));
50
+ for (let t = 0; t < s.length; t++) o.push(Gt.jn(s[t]));
51
51
  r.push(o);
52
52
  }
53
53
  return new kt(r);
@@ -11,48 +11,48 @@ export default class Gt {
11
11
  (this.Vl = s),
12
12
  (this.comparator = e),
13
13
  (this.Yl = i),
14
- this.Vl === Gt.Th.Zl &&
15
- this.comparator !== Gt._h.Ah &&
16
- this.comparator !== Gt._h.yh &&
17
- this.comparator !== Gt._h.Mh &&
18
- this.comparator !== Gt._h.Rh &&
14
+ this.Vl === Gt.yh.Zl &&
15
+ this.comparator !== Gt.Rh.Mh &&
16
+ this.comparator !== Gt.Rh.Lh &&
17
+ this.comparator !== Gt.Rh.Oh &&
18
+ this.comparator !== Gt.Rh.Uh &&
19
19
  (this.Yl = h(this.Yl));
20
20
  }
21
21
  Hl(t) {
22
22
  let s = null;
23
23
  switch ((null != t && (s = t[this.Xl]), this.comparator)) {
24
- case Gt._h.Hh:
24
+ case Gt.Rh.Qh:
25
25
  return null != s && s.valueOf() === this.Yl.valueOf();
26
- case Gt._h.Lh:
26
+ case Gt.Rh.Xh:
27
27
  return null == s || s.valueOf() !== this.Yl.valueOf();
28
- case Gt._h.Ih:
28
+ case Gt.Rh.Bh:
29
29
  return typeof s == typeof this.Yl && s > this.Yl;
30
- case Gt._h.Ah:
31
- return this.Vl === Gt.Th.Zl
30
+ case Gt.Rh.Mh:
31
+ return this.Vl === Gt.yh.Zl
32
32
  ? null != s && yt(s) && Ht(s) <= this.Yl
33
33
  : typeof s == typeof this.Yl && s >= this.Yl;
34
- case Gt._h.Oh:
34
+ case Gt.Rh.kh:
35
35
  return typeof s == typeof this.Yl && s < this.Yl;
36
- case Gt._h.yh:
37
- return this.Vl === Gt.Th.Zl
36
+ case Gt.Rh.Lh:
37
+ return this.Vl === Gt.yh.Zl
38
38
  ? null != s && yt(s) && Ht(s) >= this.Yl
39
39
  : typeof s == typeof this.Yl && s <= this.Yl;
40
- case Gt._h.Uh:
40
+ case Gt.Rh.Jh:
41
41
  return (
42
42
  null != s &&
43
43
  "string" == typeof s &&
44
44
  typeof s == typeof this.Yl &&
45
45
  null != s.match(this.Yl)
46
46
  );
47
- case Gt._h.Qh:
47
+ case Gt.Rh.Vh:
48
48
  return null != s;
49
- case Gt._h.Xh:
49
+ case Gt.Rh.qh:
50
50
  return null == s;
51
- case Gt._h.Mh:
51
+ case Gt.Rh.Oh:
52
52
  return null != s && yt(s) && Ut(s) < this.Yl;
53
- case Gt._h.Rh:
53
+ case Gt.Rh.Uh:
54
54
  return null != s && yt(s) && Ut(s) > this.Yl;
55
- case Gt._h.Bh:
55
+ case Gt.Rh.Kh:
56
56
  return (
57
57
  null == s ||
58
58
  typeof s != typeof this.Yl ||
@@ -77,22 +77,22 @@ export default class Gt {
77
77
  { k: this.Xl, t: this.Vl, c: this.comparator, v: t }
78
78
  );
79
79
  }
80
- static Sn(t) {
80
+ static jn(t) {
81
81
  return new Gt(t.k, t.t, t.c, t.v);
82
82
  }
83
83
  }
84
- (Gt._h = {
85
- Hh: 1,
86
- Lh: 2,
87
- Ih: 3,
88
- Ah: 4,
89
- Oh: 5,
90
- yh: 6,
91
- Uh: 10,
92
- Qh: 11,
93
- Xh: 12,
94
- Mh: 15,
95
- Rh: 16,
96
- Bh: 17
84
+ (Gt.Rh = {
85
+ Qh: 1,
86
+ Xh: 2,
87
+ Bh: 3,
88
+ Mh: 4,
89
+ kh: 5,
90
+ Lh: 6,
91
+ Jh: 10,
92
+ Vh: 11,
93
+ qh: 12,
94
+ Oh: 15,
95
+ Uh: 16,
96
+ Kh: 17
97
97
  }),
98
- (Gt.Th = { Fh: "boolean", kh: "number", Jh: "string", Zl: "date" });
98
+ (Gt.yh = { Ph: "boolean", Wh: "number", Yh: "string", Zl: "date" });
@@ -1,16 +1,16 @@
1
1
  import Kt from "./trigger-condition.js";
2
2
  export default class Qt {
3
3
  constructor(t, i) {
4
- (this.fu = t), (this.au = i);
4
+ (this.fu = t), (this.du = i);
5
5
  }
6
6
  Hl(t) {
7
7
  if (null == this.fu) return !1;
8
- const i = Kt.du(t[0], this.fu);
8
+ const i = Kt.gu(t[0], this.fu);
9
9
  if (!i) return !1;
10
- let r = null == this.au || 0 === this.au.length;
11
- if (null != this.au)
12
- for (let i = 0; i < this.au.length; i++)
13
- if (this.au[i] === t[1]) {
10
+ let r = null == this.du || 0 === this.du.length;
11
+ if (null != this.du)
12
+ for (let i = 0; i < this.du.length; i++)
13
+ if (this.du[i] === t[1]) {
14
14
  r = !0;
15
15
  break;
16
16
  }
@@ -4,7 +4,7 @@ export default class Yt {
4
4
  this.fu = t;
5
5
  }
6
6
  Hl(t) {
7
- return null == this.fu || Kt.du(t[0], this.fu);
7
+ return null == this.fu || Kt.gu(t[0], this.fu);
8
8
  }
9
9
  static fromJson(t) {
10
10
  return new Yt(t ? t.campaign_id : null);
@@ -14,7 +14,7 @@ export default class Kt {
14
14
  ec(e, t) {
15
15
  return Kt.tc[this.type] === e && (null == this.data || this.data.Hl(t));
16
16
  }
17
- static du(e, t) {
17
+ static gu(e, t) {
18
18
  let a = null;
19
19
  try {
20
20
  a = window.atob(e);
@@ -47,7 +47,7 @@ export default class Kt {
47
47
  case Kt.rc.sc:
48
48
  r = Dt.fromJson(e.data);
49
49
  break;
50
- case Kt.rc.Ar:
50
+ case Kt.rc.Br:
51
51
  r = Qt.fromJson(e.data);
52
52
  break;
53
53
  case Kt.rc.ks:
@@ -58,7 +58,7 @@ export default class Kt {
58
58
  ss() {
59
59
  return { t: this.type, d: this.data ? this.data.ss() : null };
60
60
  }
61
- static Sn(e) {
61
+ static jn(e) {
62
62
  let t, r;
63
63
  switch (e.t) {
64
64
  case Kt.rc.OPEN:
@@ -68,7 +68,7 @@ export default class Kt {
68
68
  t = new Wt(e.d);
69
69
  break;
70
70
  case Kt.rc.ac:
71
- (r = e.d || {}), (t = new Xt(r.id, kt.Sn(r.pf || [])));
71
+ (r = e.d || {}), (t = new Xt(r.id, kt.jn(r.pf || [])));
72
72
  break;
73
73
  case Kt.rc.vr:
74
74
  t = new Yt(e.d);
@@ -77,9 +77,9 @@ export default class Kt {
77
77
  t = new xt(e.d);
78
78
  break;
79
79
  case Kt.rc.sc:
80
- (r = e.d || {}), (t = new Dt(r.e, kt.Sn(r.pf || [])));
80
+ (r = e.d || {}), (t = new Dt(r.e, kt.jn(r.pf || [])));
81
81
  break;
82
- case Kt.rc.Ar:
82
+ case Kt.rc.Br:
83
83
  t = new Qt(e.d);
84
84
  break;
85
85
  case Kt.rc.ks:
@@ -95,7 +95,7 @@ export default class Kt {
95
95
  vr: "push_click",
96
96
  be: "custom_event",
97
97
  sc: "custom_event_property",
98
- Ar: "iam_click",
98
+ Br: "iam_click",
99
99
  ks: "test"
100
100
  }),
101
101
  (Kt.tc = {}),
@@ -105,5 +105,5 @@ export default class Kt {
105
105
  (Kt.tc[Kt.rc.vr] = V.vr),
106
106
  (Kt.tc[Kt.rc.be] = V.be),
107
107
  (Kt.tc[Kt.rc.sc] = V.be),
108
- (Kt.tc[Kt.rc.Ar] = V.Ar),
108
+ (Kt.tc[Kt.rc.Br] = V.Br),
109
109
  (Kt.tc[Kt.rc.ks] = V.ks);
@@ -3,6 +3,6 @@ export default {
3
3
  Rr: "purchase",
4
4
  vr: "push_click",
5
5
  be: "custom_event",
6
- Ar: "iam_click",
6
+ Br: "iam_click",
7
7
  ks: "test"
8
8
  };
@@ -5,44 +5,44 @@ import {
5
5
  import r from "../../../shared-lib/braze-shared-lib.js";
6
6
  import Kt from "./trigger-condition.js";
7
7
  import { validateValueIsFromEnum as F } from "../../util/code-utils.js";
8
- export default class mt {
8
+ export default class pt {
9
9
  constructor(t, i, s, e, r, l, o, n, h, a, u, d) {
10
10
  (this.id = t),
11
- (this.Ph = i || []),
11
+ (this.$h = i || []),
12
12
  void 0 === s && (s = null),
13
13
  (this.startTime = s),
14
14
  void 0 === e && (e = null),
15
15
  (this.endTime = e),
16
16
  (this.priority = r || 0),
17
17
  (this.type = l),
18
- (this.$h = n || 0),
19
- null == a && (a = 1e3 * (this.$h + 30)),
20
- (this.$i = a),
18
+ (this.Zh = n || 0),
19
+ null == a && (a = 1e3 * (this.Zh + 30)),
20
+ (this.xi = a),
21
21
  (this.data = o),
22
- null == h && (h = mt.Vh),
23
- (this.qh = h),
24
- (this.Kh = u),
25
- (this.Wh = d || null);
22
+ null == h && (h = pt.pu),
23
+ (this.Tu = h),
24
+ (this.Du = u),
25
+ (this.Pu = d || null);
26
26
  }
27
- Yh(t) {
27
+ yu(t) {
28
28
  return (
29
- null == this.Wh || (this.qh !== mt.Vh && t - this.Wh >= 1e3 * this.qh)
29
+ null == this.Pu || (this.Tu !== pt.pu && t - this.Pu >= 1e3 * this.Tu)
30
30
  );
31
31
  }
32
- Zh(t) {
33
- this.Wh = t;
32
+ ju(t) {
33
+ this.Pu = t;
34
34
  }
35
- gu(t) {
36
- const i = t + 1e3 * this.$h;
35
+ wu(t) {
36
+ const i = t + 1e3 * this.Zh;
37
37
  return Math.max(i - new Date().valueOf(), 0);
38
38
  }
39
- pu(t) {
39
+ Eu(t) {
40
40
  const i = new Date().valueOf() - t,
41
- s = null == t || isNaN(i) || null == this.$i || i < this.$i;
41
+ s = null == t || isNaN(i) || null == this.xi || i < this.xi;
42
42
  return (
43
43
  s ||
44
44
  r.D.info(
45
- `Trigger action ${this.type} is no longer eligible for display - fired ${i}ms ago and has a timeout of ${this.$i}ms.`
45
+ `Trigger action ${this.type} is no longer eligible for display - fired ${i}ms ago and has a timeout of ${this.xi}ms.`
46
46
  ),
47
47
  !s
48
48
  );
@@ -62,17 +62,17 @@ export default class mt {
62
62
  d = t.data,
63
63
  m = t.min_seconds_since_last_trigger;
64
64
  return F(
65
- mt._i,
65
+ pt.Fi,
66
66
  o,
67
67
  "Could not construct Trigger from server data",
68
68
  "Trigger.Types"
69
69
  )
70
- ? new mt(i, s, e, r, l, o, d, n, a, u, m)
70
+ ? new pt(i, s, e, r, l, o, d, n, a, u, m)
71
71
  : null;
72
72
  }
73
73
  ss() {
74
74
  const t = [];
75
- for (let i = 0; i < this.Ph.length; i++) t.push(this.Ph[i].ss());
75
+ for (let i = 0; i < this.$h.length; i++) t.push(this.$h[i].ss());
76
76
  return {
77
77
  i: this.id,
78
78
  c: t,
@@ -81,17 +81,17 @@ export default class mt {
81
81
  p: this.priority,
82
82
  t: this.type,
83
83
  da: this.data,
84
- d: this.$h,
85
- r: this.qh,
86
- tm: this.$i,
87
- ss: this.Kh,
88
- ld: this.Wh
84
+ d: this.Zh,
85
+ r: this.Tu,
86
+ tm: this.xi,
87
+ ss: this.Du,
88
+ ld: this.Pu
89
89
  };
90
90
  }
91
- static Sn(t) {
91
+ static jn(t) {
92
92
  const i = [];
93
- for (let s = 0; s < t.c.length; s++) i.push(Kt.Sn(t.c[s]));
94
- return new mt(
93
+ for (let s = 0; s < t.c.length; s++) i.push(Kt.jn(t.c[s]));
94
+ return new pt(
95
95
  t.i,
96
96
  i,
97
97
  w(t.s),
@@ -107,4 +107,4 @@ export default class mt {
107
107
  );
108
108
  }
109
109
  }
110
- (mt.Vh = -1), (mt._i = { Ti: "inapp", Tu: "templated_iam" });
110
+ (pt.pu = -1), (pt.Fi = { Ei: "inapp", Nu: "templated_iam" });
@@ -7,10 +7,10 @@ export const TriggersProviderFactory = {
7
7
  er: () => (TriggersProviderFactory.init(), TriggersProviderFactory.provider),
8
8
  rg: () => {
9
9
  if (!TriggersProviderFactory.provider) {
10
- const r = e.nn(T.Ao);
10
+ const r = e.nn(T.So);
11
11
  (TriggersProviderFactory.provider = new gr(
12
12
  null != r ? r : 30,
13
- pe.m().Ve(),
13
+ pe.m().pi(),
14
14
  e.l(),
15
15
  e.mr(),
16
16
  pe.m()