@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
@@ -3,51 +3,51 @@ import y from "../common/base-provider.js";
3
3
  import e from "../managers/braze-instance.js";
4
4
  import { STORAGE_KEYS as o } from "../managers/storage-manager.js";
5
5
  import T from "../managers/subscription-manager.js";
6
- import { randomInclusive as k } from "../util/math.js";
6
+ import { randomInclusive as U } from "../util/math.js";
7
7
  import C from "../util/net.js";
8
8
  import {
9
9
  newFeatureFlagFromJson as st,
10
10
  newFeatureFlagFromSerializedValue as it,
11
11
  } from "./feature-flag-factory.js";
12
- import S from "../util/request-header-utils.js";
12
+ import D from "../util/request-header-utils.js";
13
13
  export default class er extends y {
14
14
  constructor(t, s, i, r) {
15
15
  super(),
16
16
  (this.yt = t),
17
17
  (this.qt = s),
18
18
  (this.u = i),
19
- (this.di = r),
20
- (this.mi = []),
21
- (this.gi = 0),
19
+ (this.ri = r),
20
+ (this.hi = []),
21
+ (this.oi = 0),
22
22
  (this.yt = t),
23
23
  (this.qt = s),
24
24
  (this.u = i),
25
- (this.di = r),
26
- (this.Fi = null),
27
- (this.vi = new T()),
28
- (this.pi = 10),
29
- (this.wi = null),
30
- (this.ji = null),
31
- e.$t(this.vi);
25
+ (this.ri = r),
26
+ (this.ai = null),
27
+ (this.ni = new T()),
28
+ (this.li = 10),
29
+ (this.ui = null),
30
+ (this.fi = null),
31
+ e.$t(this.ni);
32
32
  }
33
- Rs(t) {
33
+ Ns(t) {
34
34
  var s;
35
35
  if (
36
- (null === (s = this.yt) || void 0 === s ? void 0 : s.yi()) &&
36
+ (null === (s = this.yt) || void 0 === s ? void 0 : s.ci()) &&
37
37
  null != t &&
38
38
  t.feature_flags
39
39
  ) {
40
- this.mi = [];
40
+ this.hi = [];
41
41
  for (const s of t.feature_flags) {
42
42
  const t = st(s);
43
- t && this.mi.push(t);
43
+ t && this.hi.push(t);
44
44
  }
45
- (this.gi = new Date().getTime()), this.bi(), this.vi.Dt(this.mi);
45
+ (this.oi = new Date().getTime()), this.di(), this.ni.Dt(this.hi);
46
46
  }
47
47
  }
48
- Ci() {
48
+ mi() {
49
49
  let t = {};
50
- this.u && (t = this.u.j(o.C.Ti));
50
+ this.u && (t = this.u.j(o.C.gi));
51
51
  const s = {};
52
52
  for (const i in t) {
53
53
  const e = it(t[i]);
@@ -55,119 +55,123 @@ export default class er extends y {
55
55
  }
56
56
  return s;
57
57
  }
58
- Di() {
58
+ Fi() {
59
59
  var t;
60
- return (null === (t = this.u) || void 0 === t ? void 0 : t.j(o.C.Ii)) || {};
60
+ return (null === (t = this.u) || void 0 === t ? void 0 : t.j(o.C.vi)) || {};
61
61
  }
62
- Ri(t) {
63
- this.u && this.u.k(o.C.Ii, t);
62
+ pi(t) {
63
+ this.u && this.u.k(o.C.vi, t);
64
64
  }
65
- ei(t) {
66
- return this.vi.It(t);
65
+ Zs(t) {
66
+ return this.ni.It(t);
67
67
  }
68
68
  refreshFeatureFlags(t, s, i = !1, e = !0) {
69
69
  const r = () => {
70
- "function" == typeof s && s(), this.vi.Dt(this.mi);
70
+ "function" == typeof s && s(), this.ni.Dt(this.hi);
71
71
  };
72
- if (!this.Si(i))
72
+ if (!this.wi(i))
73
73
  return (
74
- !this.Fi &&
74
+ !this.ai &&
75
75
  this.yt &&
76
- (this.Fi = this.yt.xi(() => {
76
+ (this.ai = this.yt.ji(() => {
77
77
  this.refreshFeatureFlags(t, s);
78
78
  })),
79
79
  void r()
80
80
  );
81
- if ((e && this.Ni(), !this.qt)) return void r();
82
- const h = this.qt.Ps({}, !0),
83
- o = this.qt._s(h, S.Gs.qi);
84
- let a = !1;
85
- this.qt.Hs(
86
- h,
87
- () => {
88
- this.qt
89
- ? (S.Os(this.u, S.Gs.qi, new Date().valueOf()),
90
- C.Qs({
91
- url: `${this.qt.Vs()}/feature_flags/sync`,
92
- headers: o,
93
- data: h,
94
- L: (s) => {
95
- if (!this.qt.Ws(h, s, o)) return (a = !0), void r();
96
- this.qt.Xs(),
97
- this.Rs(s),
98
- (a = !1),
99
- S.Ys(this.u, S.Gs.qi, 1),
100
- "function" == typeof t && t();
101
- },
102
- error: (t) => {
103
- this.qt.Zs(t, "retrieving feature flags"), (a = !0), r();
104
- },
105
- ti: () => {
106
- if (e && a && !this.ji) {
107
- S.si(this.u, S.Gs.qi);
108
- let e = this.wi;
109
- (null == e || e < 1e3 * this.pi) && (e = 1e3 * this.pi),
110
- this.$i(Math.min(3e5, k(1e3 * this.pi, 3 * e)), t, s, i);
111
- }
112
- },
113
- }))
114
- : r();
81
+ const h = this.qt;
82
+ if (!h) return void r();
83
+ e && this.yi();
84
+ const o = h.Js({}, !0),
85
+ a = h.$s(o, D.Ps.bi);
86
+ let n = !1;
87
+ h.Xs(
88
+ o,
89
+ (h = -1) => {
90
+ if (!this.qt) return void r();
91
+ const l = new Date().valueOf();
92
+ D._s(this.u, D.Ps.bi, l),
93
+ -1 !== h && a.push(["X-Braze-Req-Tokens-Remaining", h.toString()]),
94
+ C.Gs({
95
+ url: `${this.qt.Hs()}/feature_flags/sync`,
96
+ headers: a,
97
+ data: o,
98
+ L: (s) => {
99
+ if (!this.qt.Ks(o, s, a)) return (n = !0), void r();
100
+ this.qt.Os(),
101
+ this.Ns(s),
102
+ (n = !1),
103
+ D.Qs(this.u, D.Ps.bi, 1),
104
+ "function" == typeof t && t();
105
+ },
106
+ error: (t) => {
107
+ this.qt.Vs(t, "retrieving feature flags"), (n = !0), r();
108
+ },
109
+ Ws: () => {
110
+ if (e && n && !this.fi) {
111
+ D.Ys(this.u, D.Ps.bi);
112
+ let e = this.ui;
113
+ (null == e || e < 1e3 * this.li) && (e = 1e3 * this.li),
114
+ this.Ci(Math.min(3e5, U(1e3 * this.li, 3 * e)), t, s, i);
115
+ }
116
+ },
117
+ });
115
118
  },
116
- S.ii.qi,
119
+ D.Ps.bi,
120
+ s,
117
121
  );
118
122
  }
119
- Ni() {
120
- null != this.ji && (clearTimeout(this.ji), (this.ji = null));
123
+ yi() {
124
+ null != this.fi && (clearTimeout(this.fi), (this.fi = null));
121
125
  }
122
- $i(t = 1e3 * this.pi, s, i, e = !1) {
123
- this.Ni(),
124
- (this.ji = window.setTimeout(() => {
126
+ Ci(t = 1e3 * this.li, s, i, e = !1) {
127
+ this.yi(),
128
+ (this.fi = window.setTimeout(() => {
125
129
  this.refreshFeatureFlags(s, i, e);
126
130
  }, t)),
127
- (this.wi = t);
131
+ (this.ui = t);
128
132
  }
129
- Si(t) {
133
+ wi(t) {
130
134
  if (!this.yt) return !1;
131
135
  if (!t) {
132
- const t = this.yt.zi();
136
+ const t = this.yt.Ri();
133
137
  if (null == t) return !1;
134
138
  let s = !1;
135
139
  if (!isNaN(t)) {
136
140
  if (-1 === t) return r.info("Feature flag refreshes not allowed"), !1;
137
- s = new Date().getTime() >= (this.gi || 0) + 1e3 * t;
141
+ s = new Date().getTime() >= (this.oi || 0) + 1e3 * t;
138
142
  }
139
143
  if (!s)
140
144
  return (
141
145
  r.info(`Feature flag refreshes were rate limited to ${t} seconds`), !1
142
146
  );
143
147
  }
144
- return this.yt.yi();
148
+ return this.yt.ci();
145
149
  }
146
- Mi() {
150
+ Ti() {
147
151
  var t;
148
152
  return (
149
- (null === (t = this.u) || void 0 === t ? void 0 : t.j(o.C.Ui)) || null
153
+ (null === (t = this.u) || void 0 === t ? void 0 : t.j(o.C.Di)) || null
150
154
  );
151
155
  }
152
- _i() {
156
+ Ii() {
153
157
  var t, s;
154
158
  null === (t = this.u) ||
155
159
  void 0 === t ||
156
- t.k(o.C.Ui, null === (s = this.di) || void 0 === s ? void 0 : s.ki());
160
+ t.k(o.C.Di, null === (s = this.ri) || void 0 === s ? void 0 : s.Si());
157
161
  }
158
- Ai() {
162
+ qi() {
159
163
  var t;
160
- const s = null === (t = this.di) || void 0 === t ? void 0 : t.ki(),
161
- i = this.Mi();
164
+ const s = null === (t = this.ri) || void 0 === t ? void 0 : t.Si(),
165
+ i = this.Ti();
162
166
  return null == i || s === i;
163
167
  }
164
- bi() {
168
+ di() {
165
169
  if (!this.u) return;
166
170
  const t = {};
167
- for (const s of this.mi) {
171
+ for (const s of this.hi) {
168
172
  const i = s.Y();
169
173
  t[s.id] = i;
170
174
  }
171
- this.u.k(o.C.Ti, t), this.u.k(o.C.Bi, this.gi), this._i();
175
+ this.u.k(o.C.gi, t), this.u.k(o.C.xi, this.oi), this.Ii();
172
176
  }
173
177
  }
@@ -5,8 +5,8 @@ export function getAllFeatureFlags() {
5
5
  if (!e.X()) return;
6
6
  const t = [],
7
7
  n = e.ir();
8
- if (n && !n.yi()) return r.info("Feature flags are not enabled."), t;
9
- const o = ir.rr().Ci();
8
+ if (n && !n.ci()) return r.info("Feature flags are not enabled."), t;
9
+ const o = ir.rr().mi();
10
10
  for (const r in o) t.push(o[r]);
11
11
  return t;
12
12
  }
@@ -4,7 +4,7 @@ import ir from "./feature-flags-provider-factory.js";
4
4
  export function getFeatureFlag(t) {
5
5
  if (!e.X()) return;
6
6
  const n = e.ir();
7
- if (n && !n.yi()) return r.info("Feature flags are not enabled."), null;
8
- const a = ir.rr().Ci();
7
+ if (n && !n.ci()) return r.info("Feature flags are not enabled."), null;
8
+ const a = ir.rr().mi();
9
9
  return a[t] ? a[t] : null;
10
10
  }
@@ -7,11 +7,11 @@ export function logFeatureFlagImpression(t) {
7
7
  if (!t) return !1;
8
8
  const o =
9
9
  "Not logging a feature flag impression. The feature flag was not part of any matching experiment.",
10
- n = ir.rr().Ci();
10
+ n = ir.rr().mi();
11
11
  if (!n[t]) return r.info(o), !1;
12
12
  const a = n[t].trackingString;
13
13
  if (!a) return r.info(o), !1;
14
- const f = ir.rr().Di();
14
+ const f = ir.rr().Fi();
15
15
  if (f[a])
16
16
  return (
17
17
  r.info(
@@ -19,7 +19,7 @@ export function logFeatureFlagImpression(t) {
19
19
  ),
20
20
  !1
21
21
  );
22
- (f[a] = !0), ir.rr().Ri(f);
22
+ (f[a] = !0), ir.rr().pi(f);
23
23
  const g = { fid: t, fts: a };
24
24
  return s.q(i.Fr, g).L;
25
25
  }
@@ -4,9 +4,9 @@ import { getAllFeatureFlags } from "./get-all-feature-flags.js";
4
4
  export function subscribeToFeatureFlagsUpdates(r) {
5
5
  if (!e.X()) return;
6
6
  const t = ir.rr();
7
- if (t.Ai()) {
7
+ if (t.qi()) {
8
8
  const t = getAllFeatureFlags();
9
9
  t && "function" == typeof r && r(t);
10
10
  }
11
- return t.ei(r);
11
+ return t.Zs(r);
12
12
  }
@@ -3,7 +3,7 @@ import e from "../managers/braze-instance.js";
3
3
  import Feed from "./feed.js";
4
4
  import {
5
5
  newCardFromFeedJson as ht,
6
- newCardFromSerializedValue as D,
6
+ newCardFromSerializedValue as S,
7
7
  } from "../Card/util/card-factory.js";
8
8
  import { rehydrateDateAfterJsonization as w } from "../util/date-utils.js";
9
9
  import { STORAGE_KEYS as o } from "../managers/storage-manager.js";
@@ -12,26 +12,26 @@ export default class ee extends y {
12
12
  constructor(t, s) {
13
13
  super(),
14
14
  (this.u = t),
15
- (this.Ei = s),
15
+ (this.zi = s),
16
16
  (this.cards = []),
17
- (this.Gi = null),
17
+ (this.Ni = null),
18
18
  (this.u = t),
19
- (this.Ei = s),
19
+ (this.zi = s),
20
20
  (this.Jt = new T()),
21
21
  e.$t(this.Jt),
22
22
  this.Kt();
23
23
  }
24
24
  Kt() {
25
25
  let t = [];
26
- this.u && (t = this.u.j(o.C.Hi) || []);
26
+ this.u && (t = this.u.j(o.C.Ui) || []);
27
27
  const s = [];
28
28
  for (let i = 0; i < t.length; i++) {
29
- const e = D(t[i]);
29
+ const e = S(t[i]);
30
30
  null != e && s.push(e);
31
31
  }
32
- (this.cards = s), this.u && (this.Gi = w(this.u.j(o.C.Ji)));
32
+ (this.cards = s), this.u && (this.Ni = w(this.u.j(o.C.ki)));
33
33
  }
34
- Ki(t) {
34
+ Ai(t) {
35
35
  const s = [];
36
36
  let i = null,
37
37
  e = {};
@@ -46,24 +46,24 @@ export default class ee extends y {
46
46
  }
47
47
  }
48
48
  (this.cards = s),
49
- this.js(),
50
- (this.Gi = new Date()),
51
- this.u && (this.u.k(o.C.J, r), this.u.k(o.C.Ji, this.Gi));
49
+ this.Rs(),
50
+ (this.Ni = new Date()),
51
+ this.u && (this.u.k(o.C.J, r), this.u.k(o.C.ki, this.Ni));
52
52
  }
53
- js() {
53
+ Rs() {
54
54
  var t;
55
55
  const s = [];
56
56
  for (let t = 0; t < this.cards.length; t++) s.push(this.cards[t].Y());
57
- null === (t = this.u) || void 0 === t || t.k(o.C.Hi, s);
57
+ null === (t = this.u) || void 0 === t || t.k(o.C.Ui, s);
58
58
  }
59
- Rs(t) {
59
+ Ns(t) {
60
60
  null != t &&
61
61
  t.feed &&
62
62
  (this.Kt(),
63
- this.Ki(t.feed),
64
- this.Jt.Dt(new Feed(this.cards.slice(), this.Gi)));
63
+ this.Ai(t.feed),
64
+ this.Jt.Dt(new Feed(this.cards.slice(), this.Ni)));
65
65
  }
66
- Li() {
66
+ Bi() {
67
67
  this.Kt();
68
68
  const t = [],
69
69
  s = new Date();
@@ -72,19 +72,19 @@ export default class ee extends y {
72
72
  let r = !0;
73
73
  null != e && (r = e >= s), r && t.push(this.cards[i]);
74
74
  }
75
- return new Feed(t, this.Gi);
75
+ return new Feed(t, this.Ni);
76
76
  }
77
- Fs() {
78
- this.Ei && this.Ei.requestFeedRefresh();
77
+ xs() {
78
+ this.zi && this.zi.requestFeedRefresh();
79
79
  }
80
- ei(t) {
80
+ Zs(t) {
81
81
  return this.Jt.It(t);
82
82
  }
83
83
  clearData(t) {
84
84
  null == t && (t = !1),
85
85
  (this.cards = []),
86
- (this.Gi = null),
87
- t && this.u && (this.u.hi(o.C.Hi), this.u.hi(o.C.Ji)),
88
- this.Jt.Dt(new Feed(this.cards.slice(), this.Gi));
86
+ (this.Ni = null),
87
+ t && this.u && (this.u.ti(o.C.Ui), this.u.ti(o.C.ki)),
88
+ this.Jt.Dt(new Feed(this.cards.slice(), this.Ni));
89
89
  }
90
90
  }
@@ -1,5 +1,5 @@
1
1
  import e from "../managers/braze-instance.js";
2
2
  import re from "./feed-provider-factory.js";
3
3
  export function getCachedFeed() {
4
- if (e.X()) return re.rr().Li();
4
+ if (e.X()) return re.rr().Bi();
5
5
  }
@@ -3,5 +3,5 @@ import { InternalEventTypes as or } from "../../shared-lib/index.js";
3
3
  export function logFeedDisplayed() {
4
4
  var r;
5
5
  if (e.X())
6
- return null === (r = e.nr()) || void 0 === r ? void 0 : r.qr(or.Br).L;
6
+ return null === (r = e.nr()) || void 0 === r ? void 0 : r.qr(or.Ar).L;
7
7
  }
@@ -1,5 +1,5 @@
1
1
  import e from "../managers/braze-instance.js";
2
2
  import re from "./feed-provider-factory.js";
3
3
  export function requestFeedRefresh() {
4
- if (e.X()) return re.rr().Fs();
4
+ if (e.X()) return re.rr().xs();
5
5
  }
@@ -1,5 +1,5 @@
1
1
  import e from "../managers/braze-instance.js";
2
2
  import re from "./feed-provider-factory.js";
3
3
  export function subscribeToFeedUpdates(r) {
4
- if (e.X()) return re.rr().ei(r);
4
+ if (e.X()) return re.rr().Zs(r);
5
5
  }
@@ -36,7 +36,7 @@ export function showFeed(t, n, o) {
36
36
  let f,
37
37
  a = !1;
38
38
  null == n
39
- ? ((f = re.rr().Li()),
39
+ ? ((f = re.rr().Bi()),
40
40
  F(f, i(f.cards, o), f.lastUpdated, null, s),
41
41
  (a = !0))
42
42
  : (f = new Feed(i(n, o), new Date()));
@@ -8,6 +8,6 @@ export function deferInAppMessage(s) {
8
8
  return s instanceof ControlMessage
9
9
  ? (r.info("Not deferring since this is a ControlMessage."), !1)
10
10
  : s instanceof InAppMessage
11
- ? se.m().de(s)
11
+ ? se.m().je(s)
12
12
  : (r.info("Not an instance of InAppMessage, ignoring."), !1);
13
13
  }
@@ -9,7 +9,8 @@ import { WindowUtils as eo } from "../../util/window-utils.js";
9
9
  import e from "../../managers/braze-instance.js";
10
10
  import { logger as r } from "../../../shared-lib/index.js";
11
11
  import { BRAZE_MUST_BE_INITIALIZED_ERROR as _ } from "../../common/constants.js";
12
- export default function ct(t, o, n, s, i, u) {
12
+ import { nodeScriptReplace as ct } from "../utils/in-app-message-utils.js";
13
+ export default function at(t, o, n, s, i, u) {
13
14
  const c = document.createElement("iframe");
14
15
  c.setAttribute("title", "Modal Message"),
15
16
  i && (c.style.zIndex = (i + 1).toString());
@@ -30,7 +31,7 @@ export default function ct(t, o, n, s, i, u) {
30
31
  a = () => {
31
32
  logInAppMessageHtmlClick(t, i, o), eo.openUri(o, u, r);
32
33
  };
33
- u ? a() : t.he(c, a);
34
+ u ? a() : t.Ae(c, a);
34
35
  } else logInAppMessageHtmlClick(t, i, o || void 0);
35
36
  return r.stopPropagation(), !1;
36
37
  };
@@ -67,24 +68,26 @@ export default function ct(t, o, n, s, i, u) {
67
68
  }
68
69
  }
69
70
  const i = c.contentWindow;
70
- i.focus(), i.document.write(s ? s.innerHTML : t.message || "");
71
- const l = i.document.getElementsByTagName("head")[0];
72
- if (null != l) {
73
- if (t.be()) {
71
+ i.focus();
72
+ const l = i.document.querySelector("html");
73
+ l && ((l.innerHTML = s ? s.innerHTML : t.message || ""), ct(l));
74
+ const f = i.document.getElementsByTagName("head")[0];
75
+ if (null != f) {
76
+ if (t.Ce()) {
74
77
  const e = document.createElement("style");
75
78
  (e.innerHTML = t.css || ""),
76
- (e.id = t.ye() || ""),
79
+ (e.id = t.ve() || ""),
77
80
  null != u && e.setAttribute("nonce", u),
78
- l.appendChild(e);
81
+ f.appendChild(e);
79
82
  }
80
83
  const e = i.document.createElement("base");
81
- null != e && (e.setAttribute("target", "_parent"), l.appendChild(e));
84
+ null != e && (e.setAttribute("target", "_parent"), f.appendChild(e));
82
85
  }
83
- const f = i.document.getElementsByTagName("title");
84
- f && f.length > 0 && c.setAttribute("title", f[0].textContent || "");
85
- const d = {
86
+ const d = i.document.getElementsByTagName("title");
87
+ d && d.length > 0 && c.setAttribute("title", d[0].textContent || "");
88
+ const p = {
86
89
  closeMessage: function () {
87
- t.he(c);
90
+ t.Ae(c);
88
91
  },
89
92
  logClick: function () {
90
93
  logInAppMessageHtmlClick(t, ...arguments);
@@ -102,7 +105,7 @@ export default function ct(t, o, n, s, i, u) {
102
105
  });
103
106
  };
104
107
  },
105
- p = {
108
+ g = {
106
109
  requestImmediateDataFlush: function () {
107
110
  const t = arguments;
108
111
  import("../../Core/request-immediate-data-flush.js").then(
@@ -152,13 +155,13 @@ export default function ct(t, o, n, s, i, u) {
152
155
  );
153
156
  },
154
157
  },
155
- g = function (t) {
158
+ h = function (t) {
156
159
  return function () {
157
- p[t](...Array.prototype.slice.call(arguments));
160
+ g[t](...Array.prototype.slice.call(arguments));
158
161
  };
159
162
  };
160
- for (const t of to(p)) d[t] = g(t);
161
- const h = [
163
+ for (const t of to(g)) p[t] = h(t);
164
+ const b = [
162
165
  "setFirstName",
163
166
  "setLastName",
164
167
  "setEmail",
@@ -179,51 +182,51 @@ export default function ct(t, o, n, s, i, u) {
179
182
  "addToSubscriptionGroup",
180
183
  "removeFromSubscriptionGroup",
181
184
  ],
182
- b = function (t) {
185
+ y = function (t) {
183
186
  return function () {
184
187
  const e = ro();
185
188
  e && e[t](...Array.prototype.slice.call(arguments));
186
189
  };
187
190
  },
188
- y = {};
189
- for (let t = 0; t < h.length; t++) y[h[t]] = b(h[t]);
190
- d.getUser = function () {
191
- return y;
191
+ A = {};
192
+ for (let t = 0; t < b.length; t++) A[b[t]] = y(b[t]);
193
+ p.getUser = function () {
194
+ return A;
192
195
  };
193
- const A = { showFeed: o },
194
- j = function (e) {
196
+ const j = { showFeed: o },
197
+ C = function (e) {
195
198
  return function () {
196
199
  const o = arguments;
197
- t.he(c, function () {
198
- A[e](...Array.prototype.slice.call(o));
200
+ t.Ae(c, function () {
201
+ j[e](...Array.prototype.slice.call(o));
199
202
  });
200
203
  };
201
204
  },
202
- C = d.display;
203
- for (const t of to(A)) C[t] = j(t);
204
- const v = { registerAppboyPushMessages: requestPushPermission() },
205
- P = function (t) {
205
+ v = p.display;
206
+ for (const t of to(j)) v[t] = C(t);
207
+ const P = { registerAppboyPushMessages: requestPushPermission() },
208
+ w = function (t) {
206
209
  return function () {
207
- v[t](...Array.prototype.slice.call(arguments));
210
+ P[t](...Array.prototype.slice.call(arguments));
208
211
  };
209
212
  },
210
- w = d.web;
211
- for (const t of to(v)) w[t] = P(t);
213
+ E = p.web;
214
+ for (const t of to(P)) E[t] = w(t);
212
215
  if (
213
- ((i.appboyBridge = d), (i.brazeBridge = d), t.Ae !== InAppMessage.Ce.je)
216
+ ((i.appboyBridge = p), (i.brazeBridge = p), t.we !== InAppMessage.qe.$e)
214
217
  ) {
215
218
  const t = i.document.getElementsByTagName("a");
216
219
  for (let e = 0; e < t.length; e++) t[e].onclick = a(t[e]);
217
220
  const e = i.document.getElementsByTagName("button");
218
221
  for (let t = 0; t < e.length; t++) e[t].onclick = a(e[t]);
219
222
  }
220
- const E = i.document.body;
221
- if (null != E) {
222
- t.ve() && (E.id = t.htmlId || "");
223
+ const $ = i.document.body;
224
+ if (null != $) {
225
+ t.xe() && ($.id = t.htmlId || "");
223
226
  const e = document.createElement("hidden");
224
- (e.onclick = d.closeMessage),
227
+ (e.onclick = p.closeMessage),
225
228
  (e.className = "ab-programmatic-close-button"),
226
- E.appendChild(e);
229
+ $.appendChild(e);
227
230
  }
228
231
  i.dispatchEvent(new CustomEvent("ab.BridgeReady")),
229
232
  -1 !== c.className.indexOf("ab-start-hidden") &&
@@ -236,8 +239,8 @@ export default function ct(t, o, n, s, i, u) {
236
239
  ) {
237
240
  const e = document.createElement("div");
238
241
  return (
239
- (e.className = "ab-ios-scroll-wrapper"), e.appendChild(c), (t.Pe = e), e
242
+ (e.className = "ab-ios-scroll-wrapper"), e.appendChild(c), (t.Me = e), e
240
243
  );
241
244
  }
242
- return (t.Pe = c), c;
245
+ return (t.Me = c), c;
243
246
  }