@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
@@ -0,0 +1,288 @@
1
+ import t from "../common/base-provider.js";
2
+ import r from "../managers/braze-instance.js";
3
+ import { STORAGE_KEYS as s } from "../managers/storage-manager.js";
4
+ import u from "../managers/subscription-manager.js";
5
+ import a from "../util/net.js";
6
+ import h from "../util/request-header-utils.js";
7
+ import { logger as E } from "../../shared-lib/index.js";
8
+ export default class tr extends t {
9
+ constructor(i, t, s) {
10
+ super(),
11
+ (this.B = i),
12
+ (this.j = t),
13
+ (this.B = i),
14
+ (this.j = t),
15
+ (this.mite = null),
16
+ (this.yi = null),
17
+ (this.$i = s || null),
18
+ (this.Ri = null),
19
+ (this.D = null),
20
+ (this.Mi = 0),
21
+ (this.ji = 5),
22
+ (this.Fi = null),
23
+ (this.Ui = !0),
24
+ (this.xi = null),
25
+ (this.Pi = null),
26
+ (this.ki = null),
27
+ (this.Bi = !1),
28
+ (this.Ji = new Map()),
29
+ this.Oi();
30
+ }
31
+ Oi() {
32
+ if (this.j) {
33
+ const i = this.j.lt(s.ct.qi),
34
+ t = this.j.lt(s.ct.zi);
35
+ i && t
36
+ ? ((this.mite = i),
37
+ (this.yi = t),
38
+ E.info("Restored DUST configuration from storage"))
39
+ : (i || t) &&
40
+ (E.warn("Incomplete DUST configuration in storage, clearing"),
41
+ this.j.Nt(s.ct.qi),
42
+ this.j.Nt(s.ct.zi));
43
+ }
44
+ }
45
+ Hi() {
46
+ this.xi ||
47
+ this.Pi ||
48
+ ((this.ki = () => {
49
+ (this.Bi = !0), (this.Ui = !1);
50
+ }),
51
+ window.addEventListener("beforeunload", this.ki),
52
+ (this.xi = () => {
53
+ (this.Bi = !0),
54
+ this.Ri &&
55
+ (E.info("Page unloading, closing real-time connection gracefully"),
56
+ (this.Ui = !1),
57
+ this.Li());
58
+ }),
59
+ window.addEventListener("pagehide", this.xi),
60
+ (this.Pi = (i) => {
61
+ i.persisted &&
62
+ this.Wi() &&
63
+ !this.Ri &&
64
+ (E.info("Page restored from bfcache, reconnecting"),
65
+ (this.Bi = !1),
66
+ (this.Ui = !0),
67
+ (this.Mi = 0),
68
+ this.Gi());
69
+ }),
70
+ window.addEventListener("pageshow", this.Pi));
71
+ }
72
+ jt() {
73
+ return this.D;
74
+ }
75
+ yt(i) {
76
+ this.D = i;
77
+ }
78
+ Ki(i, t) {
79
+ if ("function" != typeof t) return null;
80
+ let s = this.Ji.get(i);
81
+ return s || ((s = new u()), this.Ji.set(i, s), r.q(s)), s.wt(t);
82
+ }
83
+ Qi(i, t) {
84
+ const s = this.Ji.get(i);
85
+ s && s.removeSubscription(t);
86
+ }
87
+ Wi() {
88
+ return Boolean(this.mite && this.yi);
89
+ }
90
+ Vi(i, t) {
91
+ const e = () => {
92
+ "function" == typeof t && t();
93
+ },
94
+ n = this.B,
95
+ o = this.j;
96
+ if (!n || !o)
97
+ return (
98
+ E.error("NetworkManager or StorageManager not available"), void e()
99
+ );
100
+ const l = r.l();
101
+ if (l && !l.Xi())
102
+ return (
103
+ E.info("Real-time messaging is not enabled, skipping refresh"), void e()
104
+ );
105
+ this.Wi()
106
+ ? E.info("Refreshing real-time messaging configuration")
107
+ : E.info("Fetching initial real-time messaging configuration");
108
+ const g = n.$({}, !0),
109
+ c = n.A(g, h.H.Yi, !1),
110
+ u = new Date().valueOf();
111
+ h.K(o, h.H.Yi, u),
112
+ a.O({
113
+ url: `${n.V()}/dust/config`,
114
+ headers: c,
115
+ data: g,
116
+ W: (t) => {
117
+ if (!n.Y(g, t, c))
118
+ return (
119
+ E.error(
120
+ "Failed to validate server response for real-time messaging configuration",
121
+ ),
122
+ void e()
123
+ );
124
+ n.Z(),
125
+ t.mite && t.host
126
+ ? ((this.mite = t.mite),
127
+ (this.yi = t.host),
128
+ E.info(
129
+ "Received real-time messaging configuration from server",
130
+ ),
131
+ o.ft(s.ct.qi, t.mite),
132
+ o.ft(s.ct.zi, t.host),
133
+ this.Gi(),
134
+ "function" == typeof i && i())
135
+ : (t.mite ||
136
+ E.error("Missing messaging identifier in server response"),
137
+ t.host || E.error("Missing messaging host in server response"),
138
+ e());
139
+ },
140
+ error: (i) => {
141
+ n._(i, "retrieving DUST config"), e();
142
+ },
143
+ });
144
+ }
145
+ Gi() {
146
+ const i = r.l();
147
+ if (i && !i.Xi())
148
+ return void E.info(
149
+ "Real-time messaging is not enabled, skipping connection",
150
+ );
151
+ if (!this.Wi())
152
+ return void E.error(
153
+ "Cannot start real-time subscription without configuration",
154
+ );
155
+ this.Ri &&
156
+ (E.info(
157
+ "Real-time connection already exists, closing before starting new subscription",
158
+ ),
159
+ this.Li());
160
+ const t = this.mite,
161
+ s = this.$i || this.yi;
162
+ if (!t || !s) return;
163
+ const e = `${
164
+ /^https?:\/\//i.test(s) ? s : `https://${s}`
165
+ }/sse?mite=${encodeURIComponent(t)}&attempts=${this.Mi}`;
166
+ this.$i && E.info(`Using custom real-time messaging host: ${this.$i}`);
167
+ try {
168
+ (this.Ri = new EventSource(e)),
169
+ (this.Ri.onopen = () => {
170
+ E.info("Real-time messaging connection established"),
171
+ (this.Mi = 0),
172
+ (this.Ui = !0);
173
+ }),
174
+ this.Ri.addEventListener("msg", (i) => {
175
+ this.Zi(i.data);
176
+ }),
177
+ (this.Ri.onerror = (i) => {
178
+ var t;
179
+ const s =
180
+ null === (t = this.Ri) || void 0 === t ? void 0 : t.readyState;
181
+ this.Bi ||
182
+ E.error(
183
+ `Real-time messaging connection error (readyState: ${s}, eventPhase: ${
184
+ null == i ? void 0 : i.eventPhase
185
+ })`,
186
+ ),
187
+ this.Li(),
188
+ this.Ui && this.Mi < this.ji
189
+ ? this._i()
190
+ : (this.Mi >= this.ji &&
191
+ E.error(
192
+ `Max retry attempts (${this.ji}) reached for real-time messaging, giving up for current session`,
193
+ ),
194
+ (this.Ui = !1));
195
+ });
196
+ } catch (i) {
197
+ E.error(
198
+ `Failed to create real-time messaging connection: ${
199
+ i instanceof Error ? i.message : String(i)
200
+ }`,
201
+ );
202
+ }
203
+ }
204
+ _i() {
205
+ this.Mi++;
206
+ const i = Math.min(1e3 * Math.pow(2, this.Mi), 6e4);
207
+ E.info(
208
+ `Retrying real-time messaging connection in ${i}ms (attempt ${this.Mi}/${this.ji})`,
209
+ ),
210
+ (this.Fi = window.setTimeout(() => {
211
+ (this.Fi = null), this.Gi();
212
+ }, i));
213
+ }
214
+ Li() {
215
+ null !== this.Fi && (window.clearTimeout(this.Fi), (this.Fi = null)),
216
+ this.Ri &&
217
+ (this.Ri.close(),
218
+ (this.Ri = null),
219
+ E.info("Real-time messaging connection closed"));
220
+ }
221
+ Zi(i) {
222
+ try {
223
+ const t = JSON.parse(i);
224
+ if (!t.type)
225
+ return void E.error(
226
+ `Received real-time message without type: ${JSON.stringify(t)}`,
227
+ );
228
+ E.info(`Received real-time message of type '${t.type}'`);
229
+ const s = this.Ji.get(t.type);
230
+ s && s.he() > 0
231
+ ? s.L(t)
232
+ : E.info(`No subscribers for real-time message type '${t.type}'`);
233
+ } catch (i) {
234
+ E.error(
235
+ `Failed to parse real-time message: ${
236
+ i instanceof Error ? i.message : String(i)
237
+ }`,
238
+ );
239
+ }
240
+ }
241
+ changeUser(i = !1) {
242
+ this.Li(),
243
+ !i && this.j
244
+ ? (this.Wi() &&
245
+ E.info(
246
+ "Clearing cached real-time messaging configuration for user change",
247
+ ),
248
+ this.j.Nt(s.ct.qi),
249
+ this.j.Nt(s.ct.zi),
250
+ (this.mite = null),
251
+ (this.yi = null))
252
+ : i &&
253
+ this.Wi() &&
254
+ E.info(
255
+ "Preserving cached real-time messaging configuration for anonymous->identified user transition",
256
+ ),
257
+ (this.Mi = 0),
258
+ (this.Ui = !0);
259
+ }
260
+ clearData(i = !1) {
261
+ (this.Ui = !1),
262
+ this.Li(),
263
+ i &&
264
+ this.j &&
265
+ (this.Wi() &&
266
+ E.info(
267
+ "Clearing cached real-time messaging configuration (wipeData)",
268
+ ),
269
+ this.j.Nt(s.ct.qi),
270
+ this.j.Nt(s.ct.zi),
271
+ (this.mite = null),
272
+ (this.yi = null)),
273
+ (this.Mi = 0);
274
+ }
275
+ destroy() {
276
+ (this.Ui = !1),
277
+ this.Li(),
278
+ (this.mite = null),
279
+ (this.Mi = 0),
280
+ this.ki &&
281
+ (window.removeEventListener("beforeunload", this.ki), (this.ki = null)),
282
+ this.xi &&
283
+ (window.removeEventListener("pagehide", this.xi), (this.xi = null)),
284
+ this.Pi &&
285
+ (window.removeEventListener("pageshow", this.Pi), (this.Pi = null)),
286
+ this.D && (r.removeSubscription(this.D), (this.D = null));
287
+ }
288
+ }
@@ -0,0 +1,3 @@
1
+ export { default as DustProviderFactory } from "./dust-provider-factory.js";
2
+ export { default as DustProvider } from "./dust-provider.js";
3
+ export { subscribeToDust } from "./subscribe-to-dust.js";
@@ -0,0 +1,24 @@
1
+ import r from "../managers/braze-instance.js";
2
+ import ir from "./dust-provider-factory.js";
3
+ export function subscribeToDust() {
4
+ const t = r.l(),
5
+ n = r.nn();
6
+ if (!t || !n) return null;
7
+ const o = ir.o(),
8
+ s = () => {
9
+ if (!o.jt()) {
10
+ o.Hi();
11
+ const r = n.rn(() => {
12
+ t.Xi() && o.Vi();
13
+ });
14
+ return r && o.yt(r), o.Wi() && o.Gi(), r;
15
+ }
16
+ return o.jt();
17
+ };
18
+ return t.Xi()
19
+ ? s()
20
+ : (t.Tr(() => {
21
+ r.ao() && t.Xi() && (o.Vi(), s());
22
+ }),
23
+ null);
24
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -1,19 +1,19 @@
1
1
  import r from "../managers/braze-instance.js";
2
- import tr from "./feature-flags-provider.js";
3
- const nr = {
2
+ import nr from "./feature-flags-provider.js";
3
+ const ar = {
4
4
  i: !1,
5
5
  provider: null,
6
6
  o: () => (
7
- nr.t(),
8
- nr.provider ||
9
- ((nr.provider = new tr(r.l(), r.m(), r.p(), r.u())), r.v(nr.provider)),
10
- nr.provider
7
+ ar.t(),
8
+ ar.provider ||
9
+ ((ar.provider = new nr(r.l(), r.m(), r.p(), r.u())), r.v(ar.provider)),
10
+ ar.provider
11
11
  ),
12
12
  t: () => {
13
- nr.i || (r.g(nr), (nr.i = !0));
13
+ ar.i || (r.g(ar), (ar.i = !0));
14
14
  },
15
15
  destroy: () => {
16
- (nr.provider = null), (nr.i = !1);
16
+ (ar.provider = null), (ar.i = !1);
17
17
  },
18
18
  };
19
- export default nr;
19
+ export default ar;
@@ -10,44 +10,44 @@ import {
10
10
  newFeatureFlagFromSerializedValue as ht,
11
11
  } from "./feature-flag-factory.js";
12
12
  import h from "../util/request-header-utils.js";
13
- export default class tr extends t {
13
+ export default class nr extends t {
14
14
  constructor(t, s, e, i) {
15
15
  super(),
16
16
  (this.h = t),
17
17
  (this.B = s),
18
18
  (this.j = e),
19
19
  (this.C = i),
20
- (this.he = []),
21
- (this.je = 0),
20
+ (this.je = []),
21
+ (this.ye = 0),
22
22
  (this.h = t),
23
23
  (this.B = s),
24
24
  (this.j = e),
25
25
  (this.C = i),
26
- (this.ye = null),
27
- (this.Ce = new u()),
26
+ (this.Ce = null),
27
+ (this.Re = new u()),
28
28
  (this.S = 10),
29
29
  (this.T = null),
30
30
  (this.I = null),
31
- r.q(this.Ce);
31
+ r.q(this.Re);
32
32
  }
33
33
  N(t) {
34
34
  var s;
35
35
  if (
36
- (null === (s = this.h) || void 0 === s ? void 0 : s.Re()) &&
36
+ (null === (s = this.h) || void 0 === s ? void 0 : s.Te()) &&
37
37
  null != t &&
38
38
  t.feature_flags
39
39
  ) {
40
- this.he = [];
40
+ this.je = [];
41
41
  for (const s of t.feature_flags) {
42
42
  const t = at(s);
43
- t && this.he.push(t);
43
+ t && this.je.push(t);
44
44
  }
45
- (this.je = new Date().getTime()), this.Te(), this.Ce.L(this.he);
45
+ (this.ye = new Date().getTime()), this.De(), this.Re.L(this.je);
46
46
  }
47
47
  }
48
- De() {
48
+ Ie() {
49
49
  let t = {};
50
- this.j && (t = this.j.lt(s.ct.Ie));
50
+ this.j && (t = this.j.lt(s.ct.Se));
51
51
  const e = {};
52
52
  for (const s in t) {
53
53
  const i = ht(t[s]);
@@ -55,27 +55,27 @@ export default class tr extends t {
55
55
  }
56
56
  return e;
57
57
  }
58
- Se() {
58
+ qe() {
59
59
  var t;
60
60
  return (
61
- (null === (t = this.j) || void 0 === t ? void 0 : t.lt(s.ct.qe)) || {}
61
+ (null === (t = this.j) || void 0 === t ? void 0 : t.lt(s.ct.Ne)) || {}
62
62
  );
63
63
  }
64
- Ne(t) {
65
- this.j && this.j.ft(s.ct.qe, t);
64
+ ze(t) {
65
+ this.j && this.j.ft(s.ct.Ne, t);
66
66
  }
67
67
  St(t) {
68
- return this.Ce.wt(t);
68
+ return this.Re.wt(t);
69
69
  }
70
70
  refreshFeatureFlags(t, s, e = !1, i = !0) {
71
71
  const r = () => {
72
- "function" == typeof s && s(), this.Ce.L(this.he);
72
+ "function" == typeof s && s(), this.Re.L(this.je);
73
73
  };
74
- if (!this.ze(e))
74
+ if (!this.Ue(e))
75
75
  return (
76
- !this.ye &&
76
+ !this.Ce &&
77
77
  this.h &&
78
- (this.ye = this.h.Ue(() => {
78
+ (this.Ce = this.h.$e(() => {
79
79
  this.refreshFeatureFlags(t, s);
80
80
  })),
81
81
  void r()
@@ -84,7 +84,7 @@ export default class tr extends t {
84
84
  if (!o) return void r();
85
85
  i && this.X();
86
86
  const n = o.$({}, !0),
87
- u = o.A(n, h.H.$e);
87
+ u = o.A(n, h.H.ke);
88
88
  let f = !1;
89
89
  o.J(
90
90
  n,
@@ -92,7 +92,7 @@ export default class tr extends t {
92
92
  const o = this.B;
93
93
  if (!o) return void r();
94
94
  const c = new Date().valueOf();
95
- h.K(this.j, h.H.$e, c),
95
+ h.K(this.j, h.H.ke, c),
96
96
  -1 !== i && u.push(["X-Braze-Req-Tokens-Remaining", i.toString()]),
97
97
  a.O({
98
98
  url: `${o.V()}/feature_flags/sync`,
@@ -117,7 +117,7 @@ export default class tr extends t {
117
117
  () => {
118
118
  this.refreshFeatureFlags(t, s, e, !0);
119
119
  },
120
- h.H.$e,
120
+ h.H.ke,
121
121
  (t) => this.it(t),
122
122
  () => this.X(),
123
123
  a,
@@ -125,7 +125,7 @@ export default class tr extends t {
125
125
  },
126
126
  });
127
127
  },
128
- h.H.$e,
128
+ h.H.ke,
129
129
  s,
130
130
  );
131
131
  }
@@ -135,49 +135,49 @@ export default class tr extends t {
135
135
  it(t) {
136
136
  this.X(), (this.I = t);
137
137
  }
138
- ze(t) {
138
+ Ue(t) {
139
139
  if (!this.h) return !1;
140
140
  if (!t) {
141
- const t = this.h.ke();
141
+ const t = this.h.Be();
142
142
  if (null == t) return !1;
143
143
  let s = !1;
144
144
  if (!isNaN(t)) {
145
145
  if (-1 === t) return E.info("Feature flag refreshes not allowed"), !1;
146
- s = new Date().getTime() >= (this.je || 0) + 1e3 * t;
146
+ s = new Date().getTime() >= (this.ye || 0) + 1e3 * t;
147
147
  }
148
148
  if (!s)
149
149
  return (
150
150
  E.info(`Feature flag refreshes were rate limited to ${t} seconds`), !1
151
151
  );
152
152
  }
153
- return this.h.Re();
153
+ return this.h.Te();
154
154
  }
155
- Be() {
155
+ Me() {
156
156
  var t;
157
157
  return (
158
- (null === (t = this.j) || void 0 === t ? void 0 : t.lt(s.ct.Me)) || null
158
+ (null === (t = this.j) || void 0 === t ? void 0 : t.lt(s.ct.Xe)) || null
159
159
  );
160
160
  }
161
- Xe() {
161
+ _e() {
162
162
  var t, e;
163
163
  null === (t = this.j) ||
164
164
  void 0 === t ||
165
- t.ft(s.ct.Me, null === (e = this.C) || void 0 === e ? void 0 : e.bt());
165
+ t.ft(s.ct.Xe, null === (e = this.C) || void 0 === e ? void 0 : e.bt());
166
166
  }
167
- _e() {
167
+ Ae() {
168
168
  var t;
169
169
  const s = null === (t = this.C) || void 0 === t ? void 0 : t.bt(),
170
- e = this.Be();
170
+ e = this.Me();
171
171
  return null == e || s === e;
172
172
  }
173
- Te() {
173
+ De() {
174
174
  if (!this.j) return;
175
175
  const t = {};
176
- for (const s of this.he) {
176
+ for (const s of this.je) {
177
177
  const e = s.dt();
178
178
  t[s.id] = e;
179
179
  }
180
- this.j.ft(s.ct.Ie, t), this.j.ft(s.ct.Ae, this.je), this.Xe();
180
+ this.j.ft(s.ct.Se, t), this.j.ft(s.ct.Ee, this.ye), this._e();
181
181
  }
182
182
  changeUser() {
183
183
  this.X();
@@ -1,11 +1,11 @@
1
1
  import r from "../managers/braze-instance.js";
2
- import nr from "./feature-flags-provider-factory.js";
2
+ import ar from "./feature-flags-provider-factory.js";
3
3
  export function getAllFeatureFlags() {
4
4
  if (!r.rr()) return;
5
5
  const t = [],
6
6
  e = r.l();
7
- if (e && !e.Re()) return t;
8
- const n = nr.o().De();
7
+ if (e && !e.Te()) return t;
8
+ const n = ar.o().Ie();
9
9
  for (const r in n) t.push(n[r]);
10
10
  return t;
11
11
  }
@@ -1,9 +1,9 @@
1
1
  import r from "../managers/braze-instance.js";
2
- import nr from "./feature-flags-provider-factory.js";
2
+ import ar from "./feature-flags-provider-factory.js";
3
3
  export function getFeatureFlag(t) {
4
4
  if (!r.rr()) return;
5
5
  const e = r.l();
6
- if (e && !e.Re()) return null;
7
- const n = nr.o().De();
6
+ if (e && !e.Te()) return null;
7
+ const n = ar.o().Ie();
8
8
  return n[t] ? n[t] : null;
9
9
  }
@@ -1,17 +1,17 @@
1
1
  import { logger as E, EventTypes as m } from "../../shared-lib/index.js";
2
2
  import c from "../common/event-logger.js";
3
3
  import r from "../managers/braze-instance.js";
4
- import nr from "./feature-flags-provider-factory.js";
4
+ import ar from "./feature-flags-provider-factory.js";
5
5
  export function logFeatureFlagImpression(e) {
6
6
  if (!r.rr()) return;
7
7
  if (!e) return !1;
8
8
  const t =
9
9
  "Not logging a feature flag impression. The feature flag was not part of any matching experiment.",
10
- o = nr.o().De();
10
+ o = ar.o().Ie();
11
11
  if (!o[e]) return E.info(t), !1;
12
12
  const n = o[e].trackingString;
13
13
  if (!n) return E.info(t), !1;
14
- const i = nr.o().Se();
14
+ const i = ar.o().qe();
15
15
  if (i[n])
16
16
  return (
17
17
  E.info(
@@ -19,7 +19,7 @@ export function logFeatureFlagImpression(e) {
19
19
  ),
20
20
  !1
21
21
  );
22
- (i[n] = !0), nr.o().Ne(i);
22
+ (i[n] = !0), ar.o().ze(i);
23
23
  const s = { fid: e, fts: n };
24
- return c.rt(m.Fr, s).W;
24
+ return c.rt(m.Ir, s).W;
25
25
  }
@@ -1,9 +1,9 @@
1
1
  import r from "../managers/braze-instance.js";
2
- import nr from "./feature-flags-provider-factory.js";
3
- function ar(e, t, a = !1) {
4
- if (r.rr()) return nr.o().refreshFeatureFlags(e, t, a);
2
+ import ar from "./feature-flags-provider-factory.js";
3
+ function fr(e, t, a = !1) {
4
+ if (r.rr()) return ar.o().refreshFeatureFlags(e, t, a);
5
5
  }
6
6
  export function refreshFeatureFlags(r, e) {
7
- ar(r, e);
7
+ fr(r, e);
8
8
  }
9
- export default ar;
9
+ export default fr;
@@ -1,10 +1,10 @@
1
1
  import r from "../managers/braze-instance.js";
2
- import nr from "./feature-flags-provider-factory.js";
2
+ import ar from "./feature-flags-provider-factory.js";
3
3
  import { getAllFeatureFlags } from "./get-all-feature-flags.js";
4
4
  export function subscribeToFeatureFlagsUpdates(t) {
5
5
  if (!r.rr()) return;
6
- const e = nr.o();
7
- if (e._e()) {
6
+ const e = ar.o();
7
+ if (e.Ae()) {
8
8
  const r = getAllFeatureFlags();
9
9
  r && "function" == typeof t && t(r);
10
10
  }
@@ -8,6 +8,6 @@ export function deferInAppMessage(e) {
8
8
  return e instanceof ControlMessage
9
9
  ? (E.info("Not deferring since this is a ControlMessage."), !1)
10
10
  : e instanceof InAppMessage
11
- ? se.ea().Ee(e)
11
+ ? se.ea().Ge(e)
12
12
  : (E.info("Not an instance of InAppMessage, ignoring."), !1);
13
13
  }
@@ -18,7 +18,7 @@ export default function ct(t, e, o, s, n) {
18
18
  if (t.Oe()) {
19
19
  const e = document.createElement("style");
20
20
  (e.innerHTML = t.css || ""),
21
- (e.id = t.Ge() || ""),
21
+ (e.id = t.He() || ""),
22
22
  null != n && e.setAttribute("nonce", n),
23
23
  l.appendChild(e);
24
24
  }
@@ -42,7 +42,7 @@ export default function ct(t, e, o, s, n) {
42
42
  },
43
43
  );
44
44
  if (
45
- ((s.appboyBridge = r), (s.brazeBridge = r), t.He !== InAppMessage.Ke.Je)
45
+ ((s.appboyBridge = r), (s.brazeBridge = r), t.Je !== InAppMessage.Le.Ke)
46
46
  ) {
47
47
  const e = s.document.getElementsByTagName("a");
48
48
  for (let s = 0; s < e.length; s++) e[s].onclick = lt(t, i, e[s], o);
@@ -51,7 +51,7 @@ export default function ct(t, e, o, s, n) {
51
51
  }
52
52
  const c = s.document.body;
53
53
  if (null != c) {
54
- t.Le() && (c.id = t.htmlId || "");
54
+ t.Pe() && (c.id = t.htmlId || "");
55
55
  const e = document.createElement("hidden");
56
56
  (e.onclick = r.closeMessage),
57
57
  (e.className = "ab-programmatic-close-button"),
@@ -67,8 +67,8 @@ export default function ct(t, e, o, s, n) {
67
67
  ) {
68
68
  const e = document.createElement("div");
69
69
  return (
70
- (e.className = "ab-ios-scroll-wrapper"), e.appendChild(i), (t.Pe = e), e
70
+ (e.className = "ab-ios-scroll-wrapper"), e.appendChild(i), (t.Qe = e), e
71
71
  );
72
72
  }
73
- return (t.Pe = i), i;
73
+ return (t.Qe = i), i;
74
74
  }