@braze/web-sdk 5.3.1 → 5.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 (83) hide show
  1. package/index.d.ts +20 -4
  2. package/package.json +1 -1
  3. package/shared-lib/event-types.js +10 -10
  4. package/shared-lib/indexed-db-adapter.js +1 -1
  5. package/shared-lib/logger.js +2 -2
  6. package/shared-lib/supported-options.js +9 -8
  7. package/src/Card/display/card-display.js +59 -58
  8. package/src/Core/index.js +1 -0
  9. package/src/Core/is-initialized.js +4 -0
  10. package/src/InAppMessage/display/html-message-display-utils.js +172 -0
  11. package/src/InAppMessage/display/html-message-to-html.js +54 -219
  12. package/src/InAppMessage/display/in-app-message-to-html.js +78 -76
  13. package/src/InAppMessage/display/modal-utils.js +7 -7
  14. package/src/InAppMessage/get-deferred-in-app-message.js +1 -1
  15. package/src/InAppMessage/in-app-message-factory.js +4 -4
  16. package/src/InAppMessage/in-app-message-manager.js +56 -56
  17. package/src/InAppMessage/log-in-app-message-button-click.js +1 -1
  18. package/src/InAppMessage/log-in-app-message-click.js +1 -1
  19. package/src/InAppMessage/log-in-app-message-html-click.js +2 -2
  20. package/src/InAppMessage/log-in-app-message-impression.js +1 -1
  21. package/src/InAppMessage/models/full-screen-message.js +2 -2
  22. package/src/InAppMessage/models/html-message.js +2 -2
  23. package/src/InAppMessage/models/in-app-message-button.js +2 -2
  24. package/src/InAppMessage/models/in-app-message.js +26 -26
  25. package/src/InAppMessage/models/modal-message.js +2 -2
  26. package/src/InAppMessage/models/slide-up-message.js +4 -4
  27. package/src/InAppMessage/models/templated-in-app-message.js +8 -8
  28. package/src/InAppMessage/subscribe-to-in-app-message.js +1 -1
  29. package/src/InAppMessage/ui/automatically-show-in-app-messages.js +3 -3
  30. package/src/InAppMessage/ui/show-in-app-message.js +47 -45
  31. package/src/InAppMessage/utils/in-app-message-utils.js +1 -18
  32. package/src/Push/is-push-blocked.js +2 -2
  33. package/src/Push/is-push-permission-granted.js +2 -2
  34. package/src/Push/is-push-supported.js +2 -2
  35. package/src/Push/push-manager-factory.js +2 -1
  36. package/src/Push/push-manager.js +80 -92
  37. package/src/Push/utils/push-utils.js +12 -12
  38. package/src/User/user-manager.js +3 -3
  39. package/src/User/user.js +19 -19
  40. package/src/common/event-logger.js +4 -4
  41. package/src/common/feed-display.js +25 -24
  42. package/src/l10n/l10n-manager-factory.js +7 -7
  43. package/src/l10n/l10n-manager.js +15 -5
  44. package/src/managers/auth-manager.js +1 -1
  45. package/src/managers/braze-instance.js +54 -52
  46. package/src/managers/device-manager.js +19 -19
  47. package/src/managers/network-manager.js +100 -100
  48. package/src/managers/server-config-manager.js +7 -7
  49. package/src/managers/session-manager.js +4 -4
  50. package/src/managers/storage-manager-factory.js +4 -4
  51. package/src/managers/storage-manager.js +18 -18
  52. package/src/models/backend-errors.js +5 -5
  53. package/src/models/braze-event.js +10 -10
  54. package/src/models/device.js +3 -3
  55. package/src/models/server-config.js +7 -7
  56. package/src/request-controller.js +77 -77
  57. package/src/triggers/models/custom-event-data.js +2 -2
  58. package/src/triggers/models/custom-event-property-data.js +4 -4
  59. package/src/triggers/models/filter-set.js +3 -3
  60. package/src/triggers/models/filter.js +9 -9
  61. package/src/triggers/models/in-app-message-click-data.js +8 -8
  62. package/src/triggers/models/purchase-data.js +2 -2
  63. package/src/triggers/models/purchase-property-data.js +4 -4
  64. package/src/triggers/models/push-click-data.js +3 -3
  65. package/src/triggers/models/trigger-condition.js +39 -39
  66. package/src/triggers/models/trigger.js +12 -12
  67. package/src/triggers/triggers-provider-factory.js +1 -1
  68. package/src/triggers/triggers-provider.js +15 -15
  69. package/src/ui/js/attach-css.js +1 -1
  70. package/src/ui/js/feed-css.js +1 -1
  71. package/src/ui/js/iam-css.js +1 -1
  72. package/src/util/base-device-parser.js +7 -7
  73. package/src/util/braze-actions.js +4 -4
  74. package/src/util/browser-detector.js +21 -21
  75. package/src/util/client-hints-parser.js +3 -3
  76. package/src/util/component-utils.js +15 -14
  77. package/src/util/date-utils.js +2 -2
  78. package/src/util/dom-utils.js +3 -3
  79. package/src/util/net.js +2 -2
  80. package/src/util/request-header-utils.js +8 -8
  81. package/src/util/user-agent-parser.js +3 -3
  82. package/src/util/validation-utils.js +17 -17
  83. package/src/util/window-utils.js +1 -1
@@ -1,10 +1,10 @@
1
- import ue from "../models/braze-event.js";
1
+ import ve from "../models/braze-event.js";
2
2
  import _t from "../models/identifier.js";
3
3
  import {
4
4
  isArray as j,
5
5
  keys as to,
6
6
  validateValueIsFromEnum as J,
7
- values as Pt,
7
+ values as Rt,
8
8
  } from "../util/code-utils.js";
9
9
  import { logger as r, EventTypes as i } from "../../shared-lib/index.js";
10
10
  import { User } from "../User/index.js";
@@ -21,9 +21,9 @@ export const STORAGE_KEYS = {
21
21
  tE: "ab.storage.events",
22
22
  eE: "ab.storage.attributes",
23
23
  sE: "ab.storage.attributes.anonymous_user",
24
- Ca: "ab.storage.device",
25
- Yh: "ab.storage.sdk_metadata",
26
- Jh: "ab.storage.session_id_for_cached_metadata",
24
+ Fa: "ab.storage.device",
25
+ Jh: "ab.storage.sdk_metadata",
26
+ Qh: "ab.storage.session_id_for_cached_metadata",
27
27
  In: "ab.storage.pushToken",
28
28
  Ui: "ab.storage.newsFeed",
29
29
  ki: "ab.storage.lastNewsFeedRefresh",
@@ -36,8 +36,8 @@ export const STORAGE_KEYS = {
36
36
  gs: "ab.storage.ccLastFullSync",
37
37
  ys: "ab.storage.ccLastCardUpdated",
38
38
  nE: "ab.storage.ccRateLimitCurrentTokenCount",
39
- au: "ab.storage.globalRateLimitCurrentTokenCount",
40
- vu: "ab.storage.dynamicRateLimitCurrentTokenCount",
39
+ fu: "ab.storage.globalRateLimitCurrentTokenCount",
40
+ gu: "ab.storage.dynamicRateLimitCurrentTokenCount",
41
41
  v: "ab.storage.ccClicks",
42
42
  H: "ab.storage.ccImpressions",
43
43
  A: "ab.storage.ccDismissals",
@@ -53,8 +53,8 @@ export const STORAGE_KEYS = {
53
53
  Di: "ab.storage.ff.sessionId",
54
54
  lE: "ab.storage.lastReqToEndpoint",
55
55
  SE: "ab.storage.requestAttempts",
56
- Cr: "ab.storage.deferredIam",
57
- Qa: "ab.storage.lastSdkReq",
56
+ Nr: "ab.storage.deferredIam",
57
+ Za: "ab.storage.lastSdkReq",
58
58
  _E: "ab.storage.alias",
59
59
  },
60
60
  se: "ab.optOut",
@@ -63,7 +63,7 @@ export default class Q {
63
63
  constructor(t, e) {
64
64
  (this.uE = t), (this.TE = e), (this.uE = t), (this.TE = e);
65
65
  }
66
- Wh(t) {
66
+ Vh(t) {
67
67
  const e = to(STORAGE_KEYS.iu),
68
68
  s = new Q.ee(t);
69
69
  for (const t of e) s.remove(STORAGE_KEYS.iu[t]);
@@ -98,14 +98,14 @@ export default class Q {
98
98
  Al(t) {
99
99
  this.uE.remove(t);
100
100
  }
101
- Vh() {
101
+ Kh() {
102
102
  const t = to(STORAGE_KEYS.iu);
103
103
  let e;
104
104
  for (const s of t)
105
105
  (e = this.tu(STORAGE_KEYS.iu[s])),
106
106
  null != e && this.uu(STORAGE_KEYS.iu[s], e);
107
107
  }
108
- xo(t) {
108
+ zo(t) {
109
109
  let e;
110
110
  if (null == t || 0 === t.length) return !1;
111
111
  e = j(t) ? t : [t];
@@ -115,7 +115,7 @@ export default class Q {
115
115
  return this.TE.store(STORAGE_KEYS.C.tE, s);
116
116
  }
117
117
  kl(t) {
118
- return null != t && this.xo([t]);
118
+ return null != t && this.zo([t]);
119
119
  }
120
120
  AE() {
121
121
  let t = this.TE.br(STORAGE_KEYS.C.tE);
@@ -125,7 +125,7 @@ export default class Q {
125
125
  r = null;
126
126
  if (j(t))
127
127
  for (let s = 0; s < t.length; s++)
128
- ue.RE(t[s]) ? e.push(ue.qn(t[s])) : (r = s);
128
+ ve.RE(t[s]) ? e.push(ve.qn(t[s])) : (r = s);
129
129
  else s = !0;
130
130
  if (s || null != r) {
131
131
  let o = "Stored events could not be deserialized as Events";
@@ -138,7 +138,7 @@ export default class Q {
138
138
  typeof t +
139
139
  ": " +
140
140
  JSON.stringify(t)),
141
- e.push(new ue(null, i.qs, new Date().valueOf(), null, { e: o }));
141
+ e.push(new ve(null, i.qs, new Date().valueOf(), null, { e: o }));
142
142
  }
143
143
  return e;
144
144
  }
@@ -187,7 +187,7 @@ export default class Q {
187
187
  gE(t) {
188
188
  return t || STORAGE_KEYS.C.sE;
189
189
  }
190
- La(t) {
190
+ Ea(t) {
191
191
  let e = this.TE.br(STORAGE_KEYS.C.eE);
192
192
  null == e && (e = {});
193
193
  const s = this.gE(t[User.Yn]),
@@ -226,7 +226,7 @@ export default class Q {
226
226
  ((e[s] = void 0),
227
227
  this.TE.store(STORAGE_KEYS.C.eE, e),
228
228
  (r[User.Yn] = t),
229
- this.La(r));
229
+ this.Ea(r));
230
230
  }
231
231
  const s = this.tu(STORAGE_KEYS.iu.El);
232
232
  let r = null;
@@ -348,7 +348,7 @@ export default class Q {
348
348
  return t.setTime(t.getTime() + 60 * this.DE * 1e3), t.getFullYear();
349
349
  }
350
350
  ME() {
351
- const t = Pt(STORAGE_KEYS.iu),
351
+ const t = Rt(STORAGE_KEYS.iu),
352
352
  e = document.cookie.split(";");
353
353
  for (let s = 0; s < e.length; s++) {
354
354
  let r = e[s];
@@ -1,8 +1,8 @@
1
1
  export default {
2
- qa: "invalid_api_key",
3
- Aa: "blacklisted",
4
- Ba: "no_device_identifier",
5
- Ra: "invalid_json_response",
6
- Zh: "empty_response",
2
+ Aa: "invalid_api_key",
3
+ Ba: "blacklisted",
4
+ Na: "no_device_identifier",
5
+ qa: "invalid_json_response",
6
+ Ra: "empty_response",
7
7
  __: "sdk_auth_error",
8
8
  };
@@ -1,11 +1,11 @@
1
1
  import e from "../managers/braze-instance.js";
2
- import { getAlias as Gt } from "../managers/utils.js";
3
- import { isObject as Nt } from "../util/code-utils.js";
2
+ import { getAlias as Yt } from "../managers/utils.js";
3
+ import { isObject as Ct } from "../util/code-utils.js";
4
4
  import {
5
5
  convertMsToSeconds as h,
6
- timestampOrNow as Jt,
6
+ timestampOrNow as Qt,
7
7
  } from "../util/date-utils.js";
8
- export default class ue {
8
+ export default class ve {
9
9
  constructor(t, s, i, r, e) {
10
10
  (this.userId = t),
11
11
  (this.type = s),
@@ -14,11 +14,11 @@ export default class ue {
14
14
  (this.data = e),
15
15
  (this.userId = t),
16
16
  (this.type = s),
17
- (this.time = Jt(i)),
17
+ (this.time = Qt(i)),
18
18
  (this.sessionId = r),
19
19
  (this.data = e);
20
20
  }
21
- Ir() {
21
+ Zi() {
22
22
  var t;
23
23
  const s = {
24
24
  name: this.type,
@@ -29,7 +29,7 @@ export default class ue {
29
29
  null != this.userId && (s.user_id = this.userId);
30
30
  const i = (null === (t = e.Sr()) || void 0 === t ? void 0 : t.Fh()) || !1;
31
31
  if (!s.user_id && !i) {
32
- const t = Gt(e.l());
32
+ const t = Yt(e.l());
33
33
  t && (s.alias = t);
34
34
  }
35
35
  return s;
@@ -44,12 +44,12 @@ export default class ue {
44
44
  };
45
45
  }
46
46
  static fromJson(t) {
47
- return new ue(t.user_id, t.name, t.time, t.session_id, t.data);
47
+ return new ve(t.user_id, t.name, t.time, t.session_id, t.data);
48
48
  }
49
49
  static RE(t) {
50
- return null != t && Nt(t) && null != t.t && "" !== t.t;
50
+ return null != t && Ct(t) && null != t.t && "" !== t.t;
51
51
  }
52
52
  static qn(t) {
53
- return new ue(t.u, t.t, t.ts, t.s, t.d);
53
+ return new ve(t.u, t.t, t.ts, t.s, t.d);
54
54
  }
55
55
  }
@@ -1,12 +1,12 @@
1
- export default class zt {
1
+ export default class Gt {
2
2
  constructor(s) {
3
3
  (this.id = s), (this.id = s);
4
4
  }
5
- Ir() {
5
+ Zi() {
6
6
  const s = {};
7
7
  return (
8
8
  null != this.browser && (s.browser = this.browser),
9
- null != this.Ia && (s.browser_version = this.Ia),
9
+ null != this.Ta && (s.browser_version = this.Ta),
10
10
  null != this.os && (s.os_version = this.os),
11
11
  null != this.resolution && (s.resolution = this.resolution),
12
12
  null != this.language && (s.locale = this.language),
@@ -1,8 +1,8 @@
1
1
  import {
2
- GLOBAL_RATE_LIMIT_CAPACITY_DEFAULT as Qt,
3
- GLOBAL_RATE_LIMIT_REFILL_RATE_DEFAULT as Yt,
2
+ GLOBAL_RATE_LIMIT_CAPACITY_DEFAULT as Zt,
3
+ GLOBAL_RATE_LIMIT_REFILL_RATE_DEFAULT as hi,
4
4
  } from "../common/constants.js";
5
- export default class Ht {
5
+ export default class Jt {
6
6
  constructor(
7
7
  t = 0,
8
8
  i = [],
@@ -12,7 +12,7 @@ export default class Ht {
12
12
  r = null,
13
13
  l = { enabled: !1 },
14
14
  a = { enabled: !1, refresh_rate_limit: void 0 },
15
- n = { enabled: !0, capacity: Qt, refill_rate: Yt, endpoint_overrides: {} },
15
+ n = { enabled: !0, capacity: Zt, refill_rate: hi, endpoint_overrides: {} },
16
16
  ) {
17
17
  (this.hl = t),
18
18
  (this.gl = i),
@@ -35,7 +35,7 @@ export default class Ht {
35
35
  }
36
36
  Y() {
37
37
  return {
38
- s: "5.3.1",
38
+ s: "5.4.0",
39
39
  l: this.hl,
40
40
  e: this.gl,
41
41
  a: this.fl,
@@ -50,8 +50,8 @@ export default class Ht {
50
50
  static qn(t) {
51
51
  let i = t.l;
52
52
  return (
53
- "5.3.1" !== t.s && (i = 0),
54
- new Ht(i, t.e, t.a, t.p, t.m, t.v, t.c, t.f, t.grl)
53
+ "5.4.0" !== t.s && (i = 0),
54
+ new Jt(i, t.e, t.a, t.p, t.m, t.v, t.c, t.f, t.grl)
55
55
  );
56
56
  }
57
57
  }
@@ -1,5 +1,5 @@
1
1
  import C from "./util/net.js";
2
- import ue from "./models/braze-event.js";
2
+ import ve from "./models/braze-event.js";
3
3
  import s from "./common/event-logger.js";
4
4
  import { randomInclusive as U } from "./util/math.js";
5
5
  import t from "./models/request-result.js";
@@ -11,7 +11,7 @@ import {
11
11
  } from "../shared-lib/index.js";
12
12
  import { STORAGE_KEYS as o } from "./managers/storage-manager.js";
13
13
  import T from "./managers/subscription-manager.js";
14
- import vt from "./Push/utils/push-utils.js";
14
+ import yt from "./Push/utils/push-utils.js";
15
15
  import D from "./util/request-header-utils.js";
16
16
  export default class Lt {
17
17
  constructor(t, i, s, e, h, o, n, r, u, l) {
@@ -23,7 +23,7 @@ export default class Lt {
23
23
  (this.yt = o),
24
24
  (this.u = n),
25
25
  (this.wu = r),
26
- (this.zo = u),
26
+ (this.Ko = u),
27
27
  (this.qt = l),
28
28
  (this.rn = t),
29
29
  (this.baseUrl = i),
@@ -35,18 +35,18 @@ export default class Lt {
35
35
  (this.wt = h),
36
36
  (this.yt = o),
37
37
  (this.u = n),
38
- (this.zo = u),
38
+ (this.Ko = u),
39
39
  (this.qt = l),
40
40
  (this.wu = r),
41
- (this.Su = new T()),
42
- (this.$u = null),
43
- (this.Cu = 50),
44
- (this.Fu = !1);
41
+ (this.$u = new T()),
42
+ (this.Fu = null),
43
+ (this.Lu = 50),
44
+ (this.Mu = !1);
45
45
  }
46
- Lu(t, i) {
47
- return !t && !i && this.zo.Gh() >= this.Cu;
46
+ Pu(t, i) {
47
+ return !t && !i && this.Ko.Gh() >= this.Lu;
48
48
  }
49
- Mu(t) {
49
+ xu(t) {
50
50
  let s = this.ri.Gl();
51
51
  if (t.length > 0) {
52
52
  const e = this.wt.getUserId();
@@ -57,15 +57,15 @@ export default class Lt {
57
57
  }
58
58
  return s;
59
59
  }
60
- Pu(t = !1, i = !1, s = !0, e, h, n, u = !1, l = !1) {
61
- s && this.xu();
60
+ Iu(t = !1, i = !1, s = !0, e, h, n, u = !1, l = !1) {
61
+ s && this.Nu();
62
62
  const a = this.u.AE(),
63
63
  c = this.u.OE();
64
64
  let d = !1;
65
65
  const m = (t, i, r = -1) => {
66
66
  let u = !1;
67
67
  const l = new Date().valueOf();
68
- D._s(this.u, D.Ps.$a, l),
68
+ D._s(this.u, D.Ps.La, l),
69
69
  -1 !== r && i.push(["X-Braze-Req-Tokens-Remaining", r.toString()]),
70
70
  C.Gs({
71
71
  url: this.baseUrl + "/data/",
@@ -76,16 +76,16 @@ export default class Lt {
76
76
  t.respond_with.triggers &&
77
77
  (this.yu = Math.max(this.yu - 1, 0)),
78
78
  this.qt.Ks(t, s, i)
79
- ? (this.zo.Os(),
79
+ ? (this.Ko.Os(),
80
80
  this.yt.al(s),
81
81
  (null != t.respond_with &&
82
82
  t.respond_with.user_id != this.wt.getUserId()) ||
83
- (null != t.device && this.u.k(o.C.Ca, t.device),
83
+ (null != t.device && this.u.k(o.C.Fa, t.device),
84
84
  null != t.sdk_metadata &&
85
- (this.u.k(o.C.Yh, t.sdk_metadata),
86
- this.u.k(o.C.Jh, this.ri.Si())),
85
+ (this.u.k(o.C.Jh, t.sdk_metadata),
86
+ this.u.k(o.C.Qh, this.ri.Si())),
87
87
  this.wu(s),
88
- D.Qs(this.u, D.Ps.$a, 1),
88
+ D.Qs(this.u, D.Ps.La, 1),
89
89
  "function" == typeof e && e()))
90
90
  : s.auth_error && (u = !0);
91
91
  },
@@ -93,32 +93,32 @@ export default class Lt {
93
93
  null != t.respond_with &&
94
94
  t.respond_with.triggers &&
95
95
  (this.yu = Math.max(this.yu - 1, 0)),
96
- this.qt.Qh(t.events, t.attributes),
96
+ this.qt.Zh(t.events, t.attributes),
97
97
  "function" == typeof h && h();
98
98
  },
99
99
  Ws: (t) => {
100
100
  if (("function" == typeof n && n(t), s && !d)) {
101
- if (t && !u) this.Iu();
101
+ if (t && !u) this.Ou();
102
102
  else {
103
- D.Ys(this.u, D.Ps.$a);
103
+ D.Ys(this.u, D.Ps.La);
104
104
  let t = this.ju;
105
105
  (null == t || t < 1e3 * this.fE) && (t = 1e3 * this.fE),
106
- this.Iu(Math.min(3e5, U(1e3 * this.fE, 3 * t)));
106
+ this.Ou(Math.min(3e5, U(1e3 * this.fE, 3 * t)));
107
107
  }
108
108
  d = !0;
109
109
  }
110
110
  },
111
111
  });
112
112
  },
113
- f = this.Mu(a),
113
+ f = this.xu(a),
114
114
  g = i || f;
115
- if (this.Lu(u, f))
115
+ if (this.Pu(u, f))
116
116
  return void r.info(
117
117
  "Declining to flush data due to 50 consecutive authentication failures",
118
118
  );
119
- if (s && !this.qt.Na(a, c, t, g))
120
- return this.Iu(), void ("function" == typeof n && n(!0));
121
- const v = this.qt.Xa(t, g, a, c, l);
119
+ if (s && !this.qt.Xa(a, c, t, g))
120
+ return this.Ou(), void ("function" == typeof n && n(!0));
121
+ const v = this.qt.$a(t, g, a, c, l);
122
122
  g && this.yu++;
123
123
  let p = !1;
124
124
  if (v)
@@ -126,63 +126,63 @@ export default class Lt {
126
126
  this.qt.Xs(
127
127
  t.requestData,
128
128
  (i) => m(t.requestData, t.headers, i),
129
- D.Ps.$a,
129
+ D.Ps.La,
130
130
  h,
131
131
  ),
132
132
  (p = !0);
133
- this.zo.Fh() && s && !p
134
- ? this.Iu()
135
- : f && (r.info("Invoking new session subscriptions"), this.Su.Dt());
133
+ this.Ko.Fh() && s && !p
134
+ ? this.Ou()
135
+ : f && (r.info("Invoking new session subscriptions"), this.$u.Dt());
136
136
  }
137
- Nu() {
137
+ zu() {
138
138
  return this.yu > 0;
139
139
  }
140
- Iu(t = 1e3 * this.fE) {
141
- this.Fu ||
142
- (this.xu(),
143
- (this.$u = window.setTimeout(() => {
140
+ Ou(t = 1e3 * this.fE) {
141
+ this.Mu ||
142
+ (this.Nu(),
143
+ (this.Fu = window.setTimeout(() => {
144
144
  if (document.hidden) {
145
145
  const t = "visibilitychange",
146
146
  i = () => {
147
147
  document.hidden ||
148
- (document.removeEventListener(t, i, !1), this.Pu());
148
+ (document.removeEventListener(t, i, !1), this.Iu());
149
149
  };
150
150
  document.addEventListener(t, i, !1);
151
- } else this.Pu();
151
+ } else this.Iu();
152
152
  }, t)),
153
153
  (this.ju = t));
154
154
  }
155
- xu() {
156
- null != this.$u && (clearTimeout(this.$u), (this.$u = null));
155
+ Nu() {
156
+ null != this.Fu && (clearTimeout(this.Fu), (this.Fu = null));
157
157
  }
158
158
  initialize() {
159
- (this.Fu = !1), this.Iu();
159
+ (this.Mu = !1), this.Ou();
160
160
  }
161
161
  destroy() {
162
- this.Su.removeAllSubscriptions(),
163
- this.zo.yh(),
164
- this.xu(),
165
- (this.Fu = !0),
166
- this.Pu(void 0, void 0, !1, void 0, void 0, void 0, void 0, !0),
167
- (this.$u = null);
162
+ this.$u.removeAllSubscriptions(),
163
+ this.Ko.yh(),
164
+ this.Nu(),
165
+ (this.Mu = !0),
166
+ this.Iu(void 0, void 0, !1, void 0, void 0, void 0, void 0, !0),
167
+ (this.Fu = null);
168
168
  }
169
169
  mr(t) {
170
- return this.Su.It(t);
170
+ return this.$u.It(t);
171
171
  }
172
172
  openSession() {
173
- const t = this.ri.Si() !== this.ri.wo();
173
+ const t = this.ri.Si() !== this.ri.xo();
174
174
  t && (this.u.cE(o.iu.Uo), this.u.cE(o.iu.su)),
175
- this.Pu(void 0, !1, void 0, () => {
175
+ this.Iu(void 0, !1, void 0, () => {
176
176
  this.u.ti(o.C.vi);
177
177
  }),
178
178
  this.Mn(),
179
179
  t &&
180
180
  import("./Push/push-manager-factory.js").then((t) => {
181
- if (this.Fu) return;
181
+ if (this.Mu) return;
182
182
  const i = t.default.m();
183
183
  if (
184
184
  null != i &&
185
- (vt.isPushPermissionGranted() || vt.isPushBlocked())
185
+ (yt.isPushPermissionGranted() || yt.isPushBlocked())
186
186
  ) {
187
187
  const t = () => {
188
188
  i.mn()
@@ -203,20 +203,20 @@ export default class Lt {
203
203
  }
204
204
  });
205
205
  }
206
- Ou() {
207
- this.u.ti(o.C.gi), this.u.ti(o.C.ws), this.u.ti(o.C.Cr);
206
+ Uu() {
207
+ this.u.ti(o.C.gi), this.u.ti(o.C.ws), this.u.ti(o.C.Nr);
208
208
  }
209
209
  changeUser(t, i, s) {
210
210
  const e = this.wt.getUserId();
211
211
  if (e !== t) {
212
212
  this.ri.yl(),
213
- this.Ou(),
214
- null != e && this.Pu(void 0, !1, void 0, void 0, void 0),
213
+ this.Uu(),
214
+ null != e && this.Iu(void 0, !1, void 0, void 0, void 0),
215
215
  this.wt.ou(t),
216
- s ? this.zo.setSdkAuthenticationSignature(s) : this.zo.xh();
216
+ s ? this.Ko.setSdkAuthenticationSignature(s) : this.Ko.xh();
217
217
  for (let t = 0; t < i.length; t++) i[t].changeUser(null == e);
218
218
  null != e && this.u.ti(o.C.J),
219
- this.u.ti(o.C.Ca),
219
+ this.u.ti(o.C.Fa),
220
220
  this.u.ti(o.C.nE),
221
221
  this.u.ti(o.C._E),
222
222
  this.openSession(),
@@ -224,15 +224,15 @@ export default class Lt {
224
224
  } else {
225
225
  let i = "Doing nothing.";
226
226
  s &&
227
- this.zo.kh() !== s &&
228
- (this.zo.setSdkAuthenticationSignature(s),
227
+ this.Ko.kh() !== s &&
228
+ (this.Ko.setSdkAuthenticationSignature(s),
229
229
  (i = "Updated SDK authentication signature")),
230
230
  r.info(`Current user is already ${t}. ${i}`);
231
231
  }
232
232
  }
233
233
  requestImmediateDataFlush(t) {
234
- this.xu(), this.ri.wo();
235
- this.Pu(
234
+ this.Nu(), this.ri.xo();
235
+ this.Iu(
236
236
  void 0,
237
237
  void 0,
238
238
  void 0,
@@ -245,15 +245,15 @@ export default class Lt {
245
245
  );
246
246
  }
247
247
  requestFeedRefresh() {
248
- this.ri.wo(), this.Pu(!0);
248
+ this.ri.xo(), this.Iu(!0);
249
249
  }
250
250
  $r(t, i) {
251
- this.ri.wo(),
251
+ this.ri.xo(),
252
252
  r.info("Requesting explicit trigger refresh."),
253
- this.Pu(void 0, !0, void 0, t, i);
253
+ this.Iu(void 0, !0, void 0, t, i);
254
254
  }
255
255
  Cn(t, e) {
256
- const h = i.zu,
256
+ const h = i._u,
257
257
  n = { a: t, l: e },
258
258
  u = s.q(h, n);
259
259
  return (
@@ -278,7 +278,7 @@ export default class Lt {
278
278
  null != o && (l.altitude = o),
279
279
  null != n && (l.ll_accuracy = n),
280
280
  null != u && (l.alt_accuracy = u);
281
- const a = s.q(i.Uu, l, t || void 0);
281
+ const a = s.q(i.Bu, l, t || void 0);
282
282
  return (
283
283
  a &&
284
284
  r.info(`Set user last known location as ${JSON.stringify(l, null, 2)}`),
@@ -286,24 +286,24 @@ export default class Lt {
286
286
  );
287
287
  }
288
288
  kr(t, s) {
289
- const e = this.ri.wo();
290
- return new ue(this.wt.getUserId(), i._u, t, e, { cid: s });
289
+ const e = this.ri.xo();
290
+ return new ve(this.wt.getUserId(), i.Eu, t, e, { cid: s });
291
291
  }
292
- Bu(t, i) {
292
+ Ju(t, i) {
293
293
  return new A(t, i);
294
294
  }
295
295
  Mn() {
296
296
  const t = A.Yt.Qt;
297
- this.Bu(t, r).setItem(t.ss.$a, 1, {
297
+ this.Ju(t, r).setItem(t.ss.La, 1, {
298
298
  baseUrl: this.baseUrl,
299
299
  data: { api_key: this.rn, device_id: this.on.ce().id },
300
300
  userId: this.wt.getUserId(),
301
- sdkAuthEnabled: this.zo.Fh(),
301
+ sdkAuthEnabled: this.Ko.Fh(),
302
302
  });
303
303
  }
304
304
  yr(t) {
305
305
  for (const i of t)
306
- if (i.api_key === this.rn) this.qt.Qh(i.events, i.attributes);
306
+ if (i.api_key === this.rn) this.qt.Zh(i.events, i.attributes);
307
307
  else {
308
308
  const t = A.Yt.Qt;
309
309
  new A(t, r).setItem(t.ss.wr, p.W(), i);
@@ -317,13 +317,13 @@ export default class Lt {
317
317
  let n, u;
318
318
  return (
319
319
  null === h && null === o
320
- ? ((n = i.Eu), (u = { key: e }))
321
- : ((n = i.Ju), (u = { key: e, latitude: h, longitude: o })),
320
+ ? ((n = i.Ku), (u = { key: e }))
321
+ : ((n = i.Wu), (u = { key: e, latitude: h, longitude: o })),
322
322
  s.q(n, u)
323
323
  );
324
324
  }
325
325
  Hn(t, e) {
326
326
  const h = { group_id: t, status: e };
327
- return s.q(i.Ku, h);
327
+ return s.q(i.Gu, h);
328
328
  }
329
329
  }
@@ -1,4 +1,4 @@
1
- export default class Zt {
1
+ export default class ts {
2
2
  constructor(t) {
3
3
  (this.Bl = t), (this.Bl = t);
4
4
  }
@@ -6,7 +6,7 @@ export default class Zt {
6
6
  return null == this.Bl || this.Bl === t[0];
7
7
  }
8
8
  static fromJson(t) {
9
- return new Zt(t ? t.event_name : null);
9
+ return new ts(t ? t.event_name : null);
10
10
  }
11
11
  Y() {
12
12
  return this.Bl;
@@ -1,5 +1,5 @@
1
- import ts from "./filter-set.js";
2
- export default class is {
1
+ import is from "./filter-set.js";
2
+ export default class rs {
3
3
  constructor(t, s) {
4
4
  (this.Bl = t), (this.Ml = s), (this.Bl = t), (this.Ml = s);
5
5
  }
@@ -10,9 +10,9 @@ export default class is {
10
10
  return s === this.Bl && this.Ml.Jl(i);
11
11
  }
12
12
  static fromJson(t) {
13
- return new is(
13
+ return new rs(
14
14
  t ? t.event_name : null,
15
- t ? ts.fromJson(t.property_filters) : null,
15
+ t ? is.fromJson(t.property_filters) : null,
16
16
  );
17
17
  }
18
18
  Y() {
@@ -1,6 +1,6 @@
1
1
  import lr from "./filter.js";
2
2
  import { isArray as j } from "../../util/code-utils.js";
3
- export default class ts {
3
+ export default class is {
4
4
  constructor(t) {
5
5
  (this.filters = t), (this.filters = t);
6
6
  }
@@ -30,7 +30,7 @@ export default class ts {
30
30
  for (let t = 0; t < s.length; t++) o.push(lr.fromJson(s[t]));
31
31
  r.push(o);
32
32
  }
33
- return new ts(r);
33
+ return new is(r);
34
34
  }
35
35
  Y() {
36
36
  const t = [];
@@ -50,6 +50,6 @@ export default class ts {
50
50
  for (let t = 0; t < s.length; t++) o.push(lr.qn(s[t]));
51
51
  r.push(o);
52
52
  }
53
- return new ts(r);
53
+ return new is(r);
54
54
  }
55
55
  }