@braze/web-sdk 5.7.0 → 5.8.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 (98) hide show
  1. package/index.d.ts +4 -4
  2. package/package.json +1 -1
  3. package/shared-lib/encoding-utils.js +1 -1
  4. package/shared-lib/event-types.js +8 -8
  5. package/shared-lib/indexed-db-adapter.js +7 -7
  6. package/shared-lib/logger.js +2 -2
  7. package/shared-lib/supported-options.js +17 -17
  8. package/src/Banner/get-all-banners.js +2 -3
  9. package/src/Banner/get-banner.js +11 -11
  10. package/src/Banner/request-banners-refresh.js +20 -12
  11. package/src/Banner/subscribe-to-banners-updates.js +14 -13
  12. package/src/Banner/ui/insert-banner.js +11 -9
  13. package/src/Card/log-card-impressions.js +2 -2
  14. package/src/ContentCards/content-cards-provider-factory.js +1 -1
  15. package/src/ContentCards/content-cards.js +3 -3
  16. package/src/ContentCards/ui/show-content-cards.js +5 -5
  17. package/src/Core/add-sdk-metadata.js +2 -2
  18. package/src/Core/change-user.js +3 -3
  19. package/src/Core/disable-sdk.js +5 -5
  20. package/src/Core/enable-sdk.js +3 -3
  21. package/src/Core/get-device-id.js +2 -2
  22. package/src/Core/get-user.js +1 -1
  23. package/src/Core/is-disabled.js +1 -1
  24. package/src/Core/open-session.js +6 -6
  25. package/src/Core/wipe-data.js +1 -1
  26. package/src/FeatureFlags/feature-flag-factory.js +4 -4
  27. package/src/FeatureFlags/feature-flag.js +17 -17
  28. package/src/FeatureFlags/feature-flags-provider.js +37 -37
  29. package/src/FeatureFlags/get-all-feature-flags.js +6 -7
  30. package/src/FeatureFlags/get-feature-flag.js +5 -6
  31. package/src/FeatureFlags/log-feature-flag-impression.js +3 -3
  32. package/src/FeatureFlags/subscribe-to-feature-flags-updates.js +1 -1
  33. package/src/Feed/feed.js +2 -2
  34. package/src/Feed/ui/show-feed.js +4 -4
  35. package/src/InAppMessage/defer-in-app-message.js +1 -1
  36. package/src/InAppMessage/display/html-message-to-html.js +6 -6
  37. package/src/InAppMessage/display/in-app-message-to-html.js +18 -18
  38. package/src/InAppMessage/display/modal-utils.js +4 -4
  39. package/src/InAppMessage/in-app-message-factory.js +4 -4
  40. package/src/InAppMessage/in-app-message-manager-factory.js +1 -1
  41. package/src/InAppMessage/in-app-message-manager.js +49 -49
  42. package/src/InAppMessage/log-in-app-message-button-click.js +1 -1
  43. package/src/InAppMessage/log-in-app-message-click.js +1 -1
  44. package/src/InAppMessage/log-in-app-message-impression.js +1 -1
  45. package/src/InAppMessage/models/control-message.js +1 -1
  46. package/src/InAppMessage/models/full-screen-message.js +3 -3
  47. package/src/InAppMessage/models/html-message.js +5 -5
  48. package/src/InAppMessage/models/in-app-message-button.js +2 -2
  49. package/src/InAppMessage/models/in-app-message.js +32 -32
  50. package/src/InAppMessage/models/modal-message.js +3 -3
  51. package/src/InAppMessage/models/slide-up-message.js +6 -6
  52. package/src/InAppMessage/models/templated-in-app-message.js +8 -8
  53. package/src/InAppMessage/ui/show-in-app-message.js +18 -18
  54. package/src/Push/push-manager-factory.js +8 -8
  55. package/src/Push/push-manager.js +83 -83
  56. package/src/Push/utils/push-utils.js +4 -4
  57. package/src/User/user-manager.js +6 -6
  58. package/src/User/user.js +18 -18
  59. package/src/common/base-feed.js +3 -3
  60. package/src/common/event-logger.js +1 -1
  61. package/src/common/feed-display.js +8 -8
  62. package/src/l10n/l10n-manager-factory.js +2 -2
  63. package/src/l10n/l10n-manager.js +1 -1
  64. package/src/managers/braze-instance.js +107 -107
  65. package/src/managers/device-manager.js +18 -18
  66. package/src/managers/network-manager.js +117 -117
  67. package/src/managers/server-config-manager.js +61 -61
  68. package/src/managers/session-manager.js +25 -25
  69. package/src/managers/storage-manager-factory.js +8 -8
  70. package/src/managers/storage-manager.js +57 -57
  71. package/src/models/backend-errors.js +5 -5
  72. package/src/models/braze-event.js +2 -2
  73. package/src/models/device.js +2 -2
  74. package/src/models/identifier.js +10 -10
  75. package/src/models/push-token.js +7 -7
  76. package/src/models/server-config.js +30 -30
  77. package/src/request-controller.js +93 -93
  78. package/src/triggers/models/filter-set.js +4 -4
  79. package/src/triggers/models/filter.js +1 -1
  80. package/src/triggers/models/trigger-condition.js +29 -29
  81. package/src/triggers/models/trigger-events.js +1 -1
  82. package/src/triggers/models/trigger.js +9 -9
  83. package/src/triggers/triggers-provider-factory.js +2 -2
  84. package/src/triggers/triggers-provider.js +15 -15
  85. package/src/ui/js/attach-css.js +3 -3
  86. package/src/ui/js/load-font-awesome.js +2 -2
  87. package/src/util/base-device-parser.js +3 -3
  88. package/src/util/braze-actions.js +4 -4
  89. package/src/util/browser-detector.js +5 -5
  90. package/src/util/client-hints-parser.js +1 -1
  91. package/src/util/component-utils.js +1 -1
  92. package/src/util/dom-utils.js +6 -6
  93. package/src/util/key-codes.js +1 -1
  94. package/src/util/net.js +1 -1
  95. package/src/util/request-header-utils.js +13 -13
  96. package/src/util/user-agent-parser.js +1 -1
  97. package/src/util/validation-utils.js +4 -4
  98. package/src/util/window-utils.js +1 -1
@@ -5,7 +5,7 @@ import {
5
5
  convertSecondsToMs as Xt,
6
6
  } from "../util/date-utils.js";
7
7
  import c from "../common/event-logger.js";
8
- import { isArray as w, isEqual as ii } from "../util/code-utils.js";
8
+ import { isArray as z, isEqual as ii } from "../util/code-utils.js";
9
9
  import { logger as N, EventTypes as d } from "../../shared-lib/index.js";
10
10
  import { STORAGE_KEYS as t } from "./storage-manager.js";
11
11
  import h from "../util/request-header-utils.js";
@@ -17,52 +17,52 @@ import { getAlias as Ht } from "./utils.js";
17
17
  import { readResponseHeaders as Yt } from "../util/net.js";
18
18
  export default class Pt {
19
19
  constructor(t, e, i, s, r, n, o, a, h, u, l, c) {
20
- (this.dn = t),
20
+ (this.fn = t),
21
21
  (this.C = e),
22
- (this.Qh = i),
22
+ (this.Na = i),
23
23
  (this.As = s),
24
24
  (this.T = r),
25
25
  (this.B = n),
26
- (this.fn = o),
27
- (this.Ia = a),
28
- (this.Xh = h),
29
- (this.Zh = u),
26
+ (this.cn = o),
27
+ (this.Oa = a),
28
+ (this.Qh = h),
29
+ (this.Ia = u),
30
30
  (this.appVersion = l),
31
- (this.vu = c),
32
- (this.Ru = (t) => (null == t ? "" : `${t} `)),
33
- (this.dn = t),
31
+ (this.fu = c),
32
+ (this.vu = (t) => (null == t ? "" : `${t} `)),
33
+ (this.fn = t),
34
34
  (this.C = e),
35
- (this.Qh = i),
35
+ (this.Na = i),
36
36
  (this.As = s),
37
37
  (this.T = r),
38
38
  (this.B = n),
39
- (this.fn = o),
40
- (this.Ia = a),
41
- (this.Xh = h),
42
- (this.Zh = u),
39
+ (this.cn = o),
40
+ (this.Oa = a),
41
+ (this.Qh = h),
42
+ (this.Ia = u),
43
43
  (this.appVersion = l),
44
- (this.vu = c),
45
- (this.gu = ["npm"]);
44
+ (this.fu = c),
45
+ (this.Ru = ["npm"]);
46
46
  }
47
47
  H(e, i = !1, s = !1) {
48
- const r = this.dn.ce(!s),
49
- n = r.Qr(),
50
- o = this.C.vs(t.gs.$a);
48
+ const r = this.fn.de(!s),
49
+ n = r.Kr(),
50
+ o = this.C.vs(t.gs.ec);
51
51
  ii(o, n) || (e.device = n),
52
- (e.api_key = this.fn),
52
+ (e.api_key = this.cn),
53
53
  (e.time = L(new Date().valueOf(), !0));
54
- const a = this.C.vs(t.gs.qu) || [],
55
- h = this.C.vs(t.gs.Au) || "";
56
- this.gu.length > 0 &&
57
- (!ii(a, this.gu) || h !== this.T.Ss()) &&
58
- (e.sdk_metadata = this.gu),
59
- (e.sdk_version = this.Xh),
60
- this.Zh && (e.sdk_flavor = this.Zh),
54
+ const a = this.C.vs(t.gs.gu) || [],
55
+ h = this.C.vs(t.gs.bu) || "";
56
+ this.Ru.length > 0 &&
57
+ (!ii(a, this.Ru) || h !== this.T.Ss()) &&
58
+ (e.sdk_metadata = this.Ru),
59
+ (e.sdk_version = this.Qh),
60
+ this.Ia && (e.sdk_flavor = this.Ia),
61
61
  (e.app_version = this.appVersion),
62
- (e.app_version_code = this.vu),
62
+ (e.app_version_code = this.fu),
63
63
  (e.device_id = r.id);
64
64
  const u = this.As.getUserId();
65
- if ((i && null !== u && (e.user_id = u), !u && !this.Qh.jh())) {
65
+ if ((i && null !== u && (e.user_id = u), !u && !this.Na.jh())) {
66
66
  const t = Ht(this.C);
67
67
  t && (e.alias = t);
68
68
  }
@@ -74,10 +74,10 @@ export default class Pt {
74
74
  if (!s && !r) return !0;
75
75
  if (s) {
76
76
  let e;
77
- this.Qh.Jh();
77
+ this.Na.Jh();
78
78
  const r = { errorCode: s.error_code };
79
79
  for (const t of i)
80
- w(t) && "X-Braze-Auth-Signature" === t[0] && (r.signature = t[1]);
80
+ z(t) && "X-Braze-Auth-Signature" === t[0] && (r.signature = t[1]);
81
81
  t.respond_with && t.respond_with.user_id
82
82
  ? (r.userId = t.respond_with.user_id)
83
83
  : t.user_id && (r.userId = t.user_id);
@@ -86,12 +86,12 @@ export default class Pt {
86
86
  n
87
87
  ? ((r.reason = n), (e = `due to ${n}`))
88
88
  : (e = `with error code ${s.error_code}.`),
89
- this.Qh.jh() ||
89
+ this.Na.jh() ||
90
90
  (e +=
91
91
  ' Please use the "enableSdkAuthentication" initialization option to enable authentication.'),
92
92
  N.error(`SDK Authentication failed ${e}`),
93
- this.Du(t.events || [], t.attributes || []),
94
- this.Qh.Gh(r),
93
+ this.qu(t.events || [], t.attributes || []),
94
+ this.Na.Gh(r),
95
95
  !1
96
96
  );
97
97
  }
@@ -99,42 +99,42 @@ export default class Pt {
99
99
  let i,
100
100
  s = r;
101
101
  switch (s) {
102
- case qt.ku:
102
+ case qt.Au:
103
103
  return (
104
104
  (i = "Received successful response with empty body."),
105
- c.cs(d.Tu, { e: i }),
105
+ c.cs(d.Du, { e: i }),
106
106
  N.info(i),
107
107
  !1
108
108
  );
109
- case qt.yu:
109
+ case qt.ku:
110
110
  return (
111
111
  (i = "Received successful response with invalid JSON"),
112
- c.cs(d.Tu, { e: i + ": " + e.response }),
112
+ c.cs(d.Du, { e: i + ": " + e.response }),
113
113
  N.info(i),
114
114
  !1
115
115
  );
116
- case qt.Nu:
117
- s = `The API key "${t.api_key}" is invalid for the baseUrl ${this.Ia}`;
116
+ case qt.Tu:
117
+ s = `The API key "${t.api_key}" is invalid for the baseUrl ${this.Oa}`;
118
118
  break;
119
- case qt.wu:
119
+ case qt.yu:
120
120
  s =
121
121
  "Sorry, we are not currently accepting your requests. If you think this is in error, please contact us.";
122
122
  break;
123
- case qt.Cu:
123
+ case qt.Nu:
124
124
  s = "No device identifier. Please contact support@braze.com";
125
125
  }
126
126
  N.error("Backend error: " + s);
127
127
  }
128
128
  return !1;
129
129
  }
130
- Su(t, e, i, s) {
130
+ wu(t, e, i, s) {
131
131
  return !!((t && 0 !== t.length) || (e && 0 !== e.length) || i || s);
132
132
  }
133
- Bu(t, e, i, s, r = !1) {
133
+ Cu(t, e, i, s, r = !1) {
134
134
  const n = [],
135
135
  o = (t) => t || "",
136
136
  a = o(this.As.getUserId());
137
- let u = this.Lr(t, e);
137
+ let u = this.Jr(t, e);
138
138
  const l = [],
139
139
  c = [];
140
140
  let d,
@@ -142,7 +142,7 @@ export default class Pt {
142
142
  if (i.length > 0) {
143
143
  const t = [];
144
144
  for (const e of i) {
145
- if (((d = e.Qr()), this.Qh.jh())) {
145
+ if (((d = e.Kr()), this.Na.jh())) {
146
146
  if (a && !d.user_id) {
147
147
  f || (f = {}), f.events || (f.events = []), f.events.push(d);
148
148
  continue;
@@ -159,19 +159,19 @@ export default class Pt {
159
159
  if (s.length > 0) {
160
160
  const t = [];
161
161
  for (const e of s)
162
- e && (this.Qh.jh() && o(e.user_id) !== a ? l.push(e) : t.push(e));
162
+ e && (this.Na.jh() && o(e.user_id) !== a ? l.push(e) : t.push(e));
163
163
  t.length > 0 && (u.attributes = t);
164
164
  }
165
- if ((this.Du(c, l), (u = this.H(u, !1, r)), f)) {
165
+ if ((this.qu(c, l), (u = this.H(u, !1, r)), f)) {
166
166
  f = this.H(f, !1, r);
167
- const t = { requestData: f, headers: this.J(f, h.O.zu) };
167
+ const t = { requestData: f, headers: this.J(f, h.O.Su) };
168
168
  n.push(t);
169
169
  }
170
- if (u && !this.Su(u.events, u.attributes, t, e)) return f ? n : null;
171
- const m = { requestData: u, headers: this.J(u, h.O.zu) };
170
+ if (u && !this.wu(u.events, u.attributes, t, e)) return f ? n : null;
171
+ const m = { requestData: u, headers: this.J(u, h.O.Su) };
172
172
  return n.push(m), n;
173
173
  }
174
- Du(t, e) {
174
+ qu(t, e) {
175
175
  if (t) {
176
176
  const e = [];
177
177
  for (const i of t) {
@@ -180,39 +180,39 @@ export default class Pt {
180
180
  }
181
181
  this.C.Go(e);
182
182
  }
183
- if (e) for (const t of e) this.C.ju(t);
183
+ if (e) for (const t of e) this.C.Bu(t);
184
184
  }
185
185
  ns(t, e) {
186
186
  let i = "HTTP error ";
187
187
  null != t && (i += t + " "), (i += e), N.error(i);
188
188
  }
189
189
  zr(t) {
190
- return c.cs(d.Mu, { n: t });
190
+ return c.cs(d.zu, { n: t });
191
191
  }
192
- Lr(t, e, i) {
192
+ Jr(t, e, i) {
193
193
  const s = {};
194
194
  t && (s.feed = !0), e && (s.triggers = !0);
195
195
  const r = null != i ? i : this.As.getUserId();
196
- if ((r && (s.user_id = r), !s.user_id && !this.Qh.jh())) {
196
+ if ((r && (s.user_id = r), !s.user_id && !this.Na.jh())) {
197
197
  const t = Ht(this.C);
198
198
  t && (s.alias = t);
199
199
  }
200
200
  return (s.config = { config_time: this.B.Us() }), { respond_with: s };
201
201
  }
202
- Xu(t) {
202
+ ju(t) {
203
203
  const e = new Date().valueOf();
204
204
  let i = $t.toString();
205
- const s = h.$u(this.C, t);
205
+ const s = h.Mu(this.C, t);
206
206
  if (-1 !== s) {
207
207
  i = (e - s).toString();
208
208
  }
209
209
  return i;
210
210
  }
211
211
  J(t, e, i = !1) {
212
- const s = [["X-Braze-Api-Key", this.fn]],
213
- r = this.Xu(e);
212
+ const s = [["X-Braze-Api-Key", this.cn]],
213
+ r = this.ju(e);
214
214
  s.push(["X-Braze-Last-Req-Ms-Ago", r]);
215
- const n = h.Fu(this.C, e).toString();
215
+ const n = h.Xu(this.C, e).toString();
216
216
  s.push(["X-Braze-Req-Attempt", n]);
217
217
  let o = !1;
218
218
  if (
@@ -225,55 +225,55 @@ export default class Pt {
225
225
  e === h.O.Ai)
226
226
  ) {
227
227
  s.push(["X-Braze-ContentCardsRequest", "true"]);
228
- let t = h.Fu(this.C, h.O.Ai);
229
- (t && !i) || ((t = 1), h.Lu(this.C, h.O.Ai, t));
228
+ let t = h.Xu(this.C, h.O.Ai);
229
+ (t && !i) || ((t = 1), h.$u(this.C, h.O.Ai, t));
230
230
  const e = Math.max(0, t - 1);
231
231
  s.push(["BRAZE-SYNC-RETRY-COUNT", e.toString()]), (o = !0);
232
232
  }
233
233
  if (
234
- (e === h.O.Ue &&
234
+ (e === h.O._e &&
235
235
  (s.push(["X-Braze-FeatureFlagsRequest", "true"]), (o = !0)),
236
236
  o && s.push(["X-Braze-DataRequest", "true"]),
237
- this.Qh.jh())
237
+ this.Na.jh())
238
238
  ) {
239
- const t = this.Qh.xh();
239
+ const t = this.Na.xh();
240
240
  null != t && s.push(["X-Braze-Auth-Signature", t]);
241
241
  }
242
242
  return s;
243
243
  }
244
- Eu(t, e, i, s) {
244
+ Fu(t, e, i, s) {
245
245
  window.setTimeout(() => {
246
- N.info(`Retrying rate limited ${this.Ru(s)}SDK request.`),
246
+ N.info(`Retrying rate limited ${this.vu(s)}SDK request.`),
247
247
  this.V(e, i, s);
248
248
  }, t);
249
249
  }
250
250
  V(e, i, s, r) {
251
- if (!this.Ku(s))
251
+ if (!this.Lu(s))
252
252
  return (
253
- N.info(`${this.Ru(s)}SDK request being rate limited.`),
253
+ N.info(`${this.vu(s)}SDK request being rate limited.`),
254
254
  void ("function" == typeof r && r())
255
255
  );
256
- const n = this.Iu();
257
- if (!n.Pu)
256
+ const n = this.Eu();
257
+ if (!n.Ku)
258
258
  return (
259
259
  N.info(
260
- `${this.Ru(
260
+ `${this.vu(
261
261
  s,
262
262
  )}SDK request being rate limited. Request will be retried in ${Math.trunc(
263
- n.Uu / 1e3,
263
+ n.Iu / 1e3,
264
264
  )} seconds.`,
265
265
  ),
266
- void this.Eu(n.Uu, e, i, s)
266
+ void this.Fu(n.Iu, e, i, s)
267
267
  );
268
- this.C.Bs(t.gs.xu, new Date().valueOf());
268
+ this.C.Bs(t.gs.Pu, new Date().valueOf());
269
269
  const o = e.device;
270
270
  o && o.os_version instanceof Promise
271
271
  ? o.os_version.then((t) => {
272
- (e.device.os_version = t), i(n.Hu);
272
+ (e.device.os_version = t), i(n.Uu);
273
273
  })
274
- : i(n.Hu);
274
+ : i(n.Uu);
275
275
  }
276
- Ou(t) {
276
+ xu(t) {
277
277
  const e = t ? Yt(t) : null;
278
278
  if (!e || !e["retry-after"]) return null;
279
279
  const i = e["retry-after"];
@@ -284,21 +284,21 @@ export default class Pt {
284
284
  {
285
285
  const t =
286
286
  "Received unexpected value for retry-after header in /sync response";
287
- c.cs(d.Tu, { e: t + ": " + i });
287
+ c.cs(d.Du, { e: t + ": " + i });
288
288
  }
289
289
  return null;
290
290
  }
291
291
  os(t, e, i, s, r, n) {
292
- if (h.Fu(this.C, i) >= Kt) return;
292
+ if (h.Xu(this.C, i) >= Kt) return;
293
293
  let o;
294
294
  n = n || 0;
295
- const a = this.Ou(t);
295
+ const a = this.xu(t);
296
296
  r();
297
297
  const u = (t) => {
298
298
  const r = window.setTimeout(() => {
299
299
  e();
300
300
  }, t);
301
- s(r), h.Gu(this.C, i);
301
+ s(r), h.Hu(this.C, i);
302
302
  };
303
303
  if (a && !isNaN(a.value)) {
304
304
  switch (a.type) {
@@ -311,44 +311,44 @@ export default class Pt {
311
311
  u(o);
312
312
  } else n ? u(n) : h.zi(this.C, i);
313
313
  }
314
- _u(e) {
314
+ Ou(e) {
315
315
  var i;
316
- null === (i = this.C) || void 0 === i || i.Bs(t.gs.Wu, e);
316
+ null === (i = this.C) || void 0 === i || i.Bs(t.gs.Gu, e);
317
317
  }
318
- Yu(e, i) {
319
- let s = this.Ju();
320
- null == s && (s = {}), (s[e] = i), this.C.Bs(t.gs.Qu, s);
318
+ _u(e, i) {
319
+ let s = this.Wu();
320
+ null == s && (s = {}), (s[e] = i), this.C.Bs(t.gs.Yu, s);
321
321
  }
322
- Vu() {
322
+ Ju() {
323
323
  var e;
324
- return null === (e = this.C) || void 0 === e ? void 0 : e.vs(t.gs.Wu);
324
+ return null === (e = this.C) || void 0 === e ? void 0 : e.vs(t.gs.Gu);
325
325
  }
326
- Ju() {
326
+ Wu() {
327
327
  var e;
328
- return null === (e = this.C) || void 0 === e ? void 0 : e.vs(t.gs.Qu);
328
+ return null === (e = this.C) || void 0 === e ? void 0 : e.vs(t.gs.Yu);
329
329
  }
330
- Zu(t, e, i, s, r = "") {
330
+ Qu(t, e, i, s, r = "") {
331
331
  let n;
332
332
  if (r) {
333
- const t = this.Ju();
333
+ const t = this.Wu();
334
334
  n = null == t || isNaN(t[r]) ? e : t[r];
335
- } else (n = this.Vu()), (null == n || isNaN(n)) && (n = e);
335
+ } else (n = this.Ju()), (null == n || isNaN(n)) && (n = e);
336
336
  const o = (t - s) / 1e3;
337
337
  return (n = Math.min(n + o / i, e)), n;
338
338
  }
339
- tl(t, e) {
339
+ Vu(t, e) {
340
340
  return Math.max(0, (1 - t) * e * 1e3);
341
341
  }
342
- el(e, i = "") {
342
+ Zu(e, i = "") {
343
343
  var s, r, n, o, a;
344
- const u = { Pu: !0, Hu: -1, Uu: 0 };
344
+ const u = { Ku: !0, Uu: -1, Iu: 0 };
345
345
  if ((null == e && (e = !0), !e && !i)) return u;
346
346
  let l,
347
347
  c,
348
348
  d = null;
349
- if (e) d = null === (s = this.C) || void 0 === s ? void 0 : s.vs(t.gs.xu);
349
+ if (e) d = null === (s = this.C) || void 0 === s ? void 0 : s.vs(t.gs.Pu);
350
350
  else {
351
- const t = h.il(this.C);
351
+ const t = h.tl(this.C);
352
352
  if (null == t || null == t[i]) return u;
353
353
  d = t[i];
354
354
  }
@@ -356,38 +356,38 @@ export default class Pt {
356
356
  if (
357
357
  (e
358
358
  ? ((l =
359
- (null === (r = this.B) || void 0 === r ? void 0 : r.sl()) || -1),
360
- (c = (null === (n = this.B) || void 0 === n ? void 0 : n.rl()) || -1))
359
+ (null === (r = this.B) || void 0 === r ? void 0 : r.el()) || -1),
360
+ (c = (null === (n = this.B) || void 0 === n ? void 0 : n.il()) || -1))
361
361
  : ((l =
362
- (null === (o = this.B) || void 0 === o ? void 0 : o.ol(i)) || -1),
362
+ (null === (o = this.B) || void 0 === o ? void 0 : o.sl(i)) || -1),
363
363
  (c =
364
- (null === (a = this.B) || void 0 === a ? void 0 : a.al(i)) || -1)),
364
+ (null === (a = this.B) || void 0 === a ? void 0 : a.rl(i)) || -1)),
365
365
  -1 === l || -1 === c)
366
366
  )
367
367
  return u;
368
368
  const f = new Date().valueOf();
369
- let m = this.Zu(f, l, c, d, i);
369
+ let m = this.Qu(f, l, c, d, i);
370
370
  return m < 1
371
- ? ((u.Pu = !1), (u.Uu = this.tl(m, c)), u)
371
+ ? ((u.Ku = !1), (u.Iu = this.Vu(m, c)), u)
372
372
  : ((m = Math.trunc(m) - 1),
373
- (u.Hu = m),
374
- e ? this._u(m) : this.Yu(i, m),
373
+ (u.Uu = m),
374
+ e ? this.Ou(m) : this._u(i, m),
375
375
  u);
376
376
  }
377
- Iu() {
378
- return this.el(!0);
377
+ Eu() {
378
+ return this.Zu(!0);
379
379
  }
380
- Ku(t) {
381
- const e = this.el(!1, t);
382
- return !(e && !e.Pu);
380
+ Lu(t) {
381
+ const e = this.Zu(!1, t);
382
+ return !(e && !e.Ku);
383
383
  }
384
384
  es() {
385
- this.Qh.es();
385
+ this.Na.es();
386
386
  }
387
387
  Z() {
388
- return this.Ia;
388
+ return this.Oa;
389
389
  }
390
390
  addSdkMetadata(t) {
391
- for (const e of t) -1 === this.gu.indexOf(e) && this.gu.push(e);
391
+ for (const e of t) -1 === this.Ru.indexOf(e) && this.Ru.push(e);
392
392
  }
393
393
  }
@@ -7,28 +7,28 @@ export default class Mt {
7
7
  constructor(t) {
8
8
  (this.C = t),
9
9
  (this.C = t),
10
+ (this.al = new u()),
10
11
  (this.hl = new u()),
11
12
  (this.ul = new u()),
12
- (this.cl = new u()),
13
- (this.ml = new u()),
14
- (this.gl = null),
15
- (this.bl = null);
16
- }
17
- fl() {
18
- if (null == this.bl) {
19
- const e = this.C.vs(t.gs.dl);
20
- this.bl = null != e ? Jt.Yn(e) : new Jt();
13
+ (this.ol = new u()),
14
+ (this.cl = null),
15
+ (this.ml = null);
16
+ }
17
+ gl() {
18
+ if (null == this.ml) {
19
+ const e = this.C.vs(t.gs.bl);
20
+ this.ml = null != e ? Jt.Bn(e) : new Jt();
21
21
  }
22
- return this.bl;
22
+ return this.ml;
23
23
  }
24
24
  Us() {
25
- return this.fl().Rl;
25
+ return this.gl().fl;
26
26
  }
27
- Cl(e) {
27
+ dl(e) {
28
28
  if (null != e && null != e.config) {
29
29
  const i = e.config;
30
- if (i.time > this.fl().Rl) {
31
- const e = (t) => (null == t ? this.fl().El : t),
30
+ if (i.time > this.gl().fl) {
31
+ const e = (t) => (null == t ? this.gl().Rl : t),
32
32
  s = new Jt(
33
33
  i.time,
34
34
  i.events_blacklist,
@@ -42,95 +42,95 @@ export default class Mt {
42
42
  i.banners,
43
43
  );
44
44
  let n = !1;
45
- null != s.vl && this.Cn() !== s.vl && (n = !0);
45
+ null != s.Cl && this.En() !== s.Cl && (n = !0);
46
46
  let r = !1;
47
- null != s.wl.enabled && this.Fi() !== s.wl.enabled && (r = !0);
47
+ null != s.El.enabled && this.Fi() !== s.El.enabled && (r = !0);
48
48
  let l = !1;
49
- null != s.je.enabled && this.De() !== s.je.enabled && (l = !0);
49
+ null != s.we.enabled && this.qe() !== s.we.enabled && (l = !0);
50
50
  let a = !1;
51
51
  null != s.banners.enabled &&
52
52
  this.Ds() !== s.banners.enabled &&
53
53
  (a = !0),
54
- (this.bl = s),
55
- this.C.Bs(t.gs.dl, s.bs()),
56
- n && this.hl.X(),
57
- r && this.ul.X(),
58
- l && this.cl.X(),
59
- a && this.ml.X();
54
+ (this.ml = s),
55
+ this.C.Bs(t.gs.bl, s.bs()),
56
+ n && this.al.X(),
57
+ r && this.hl.X(),
58
+ l && this.ul.X(),
59
+ a && this.ol.X();
60
60
  }
61
61
  }
62
62
  }
63
- Fn(t) {
64
- const e = this.hl.Fs(t);
65
- return this.gl && this.hl.removeSubscription(this.gl), (this.gl = e), e;
63
+ Rn(t) {
64
+ const e = this.al.Fs(t);
65
+ return this.cl && this.al.removeSubscription(this.cl), (this.cl = e), e;
66
66
  }
67
67
  qi(t) {
68
- return this.ul.Fs(t);
68
+ return this.hl.Fs(t);
69
69
  }
70
- Me(t) {
71
- return this.cl.Fs(t);
70
+ Xe(t) {
71
+ return this.ul.Fs(t);
72
72
  }
73
73
  A(t) {
74
- return this.ml.Fs(t);
74
+ return this.ol.Fs(t);
75
75
  }
76
76
  ge(t) {
77
- return -1 !== this.fl().yl.indexOf(t);
77
+ return -1 !== this.gl().vl.indexOf(t);
78
78
  }
79
79
  hu(t) {
80
- return -1 !== this.fl().Ll.indexOf(t);
80
+ return -1 !== this.gl().wl.indexOf(t);
81
81
  }
82
82
  Dr(t) {
83
- return -1 !== this.fl().Bl.indexOf(t);
83
+ return -1 !== this.gl().yl.indexOf(t);
84
84
  }
85
- Fl() {
86
- return this.fl().Tl;
85
+ Ll() {
86
+ return this.gl().Bl;
87
87
  }
88
- Cn() {
89
- return this.fl().vl;
88
+ En() {
89
+ return this.gl().Cl;
90
90
  }
91
91
  Fi() {
92
- return this.fl().wl.enabled || !1;
92
+ return this.gl().El.enabled || !1;
93
93
  }
94
- jl() {
95
- const t = this.fl().El;
94
+ Fl() {
95
+ const t = this.gl().Rl;
96
96
  return !(!t || null == t.enabled) && t.enabled;
97
97
  }
98
- sl() {
99
- if (!this.jl()) return -1;
100
- const t = this.fl().El;
98
+ el() {
99
+ if (!this.Fl()) return -1;
100
+ const t = this.gl().Rl;
101
101
  return null == t.capacity || t.capacity < 10 ? -1 : t.capacity;
102
102
  }
103
- rl() {
104
- if (!this.jl()) return -1;
105
- const t = this.fl().El;
103
+ il() {
104
+ if (!this.Fl()) return -1;
105
+ const t = this.gl().Rl;
106
106
  return null == t.refill_rate || t.refill_rate <= 0 ? -1 : t.refill_rate;
107
107
  }
108
- Nl(t) {
109
- const e = this.fl().El.endpoint_overrides;
108
+ Tl(t) {
109
+ const e = this.gl().Rl.endpoint_overrides;
110
110
  return null == e ? null : e[t];
111
111
  }
112
- ol(t) {
113
- const e = this.Nl(t);
112
+ sl(t) {
113
+ const e = this.Tl(t);
114
114
  return null == e || isNaN(e.capacity) || e.capacity <= 0 ? -1 : e.capacity;
115
115
  }
116
- al(t) {
117
- const e = this.Nl(t);
116
+ rl(t) {
117
+ const e = this.Tl(t);
118
118
  return null == e || isNaN(e.refill_rate) || e.refill_rate <= 0
119
119
  ? -1
120
120
  : e.refill_rate;
121
121
  }
122
- De() {
123
- return this.fl().je.enabled && null == this.Xe()
124
- ? (c.cs(d.Tu, { e: "Missing feature flag refresh_rate_limit." }), !1)
125
- : this.fl().je.enabled || !1;
122
+ qe() {
123
+ return this.gl().we.enabled && null == this.Ae()
124
+ ? (c.cs(d.Du, { e: "Missing feature flag refresh_rate_limit." }), !1)
125
+ : this.gl().we.enabled || !1;
126
126
  }
127
- Xe() {
128
- return this.fl().je.refresh_rate_limit;
127
+ Ae() {
128
+ return this.gl().we.refresh_rate_limit;
129
129
  }
130
130
  Ds() {
131
- return this.fl().banners.enabled || !1;
131
+ return this.gl().banners.enabled || !1;
132
132
  }
133
- ee() {
134
- return this.fl().banners.max_placements || 0;
133
+ ne() {
134
+ return this.gl().banners.max_placements || 0;
135
135
  }
136
136
  }