@braze/web-sdk 5.7.0 → 5.8.1

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 (142) 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 +23 -23
  5. package/shared-lib/guid.js +1 -1
  6. package/shared-lib/indexed-db-adapter.js +21 -21
  7. package/shared-lib/logger.js +2 -2
  8. package/shared-lib/supported-options.js +18 -18
  9. package/src/Banner/banner-provider.js +79 -79
  10. package/src/Banner/banner.js +9 -9
  11. package/src/Banner/display/banner-to-html.js +2 -2
  12. package/src/Banner/get-all-banners.js +3 -4
  13. package/src/Banner/get-banner.js +11 -11
  14. package/src/Banner/log-banner-click.js +2 -2
  15. package/src/Banner/log-banner-impressions.js +4 -4
  16. package/src/Banner/request-banners-refresh.js +21 -13
  17. package/src/Banner/subscribe-to-banners-updates.js +14 -13
  18. package/src/Banner/ui/insert-banner.js +11 -9
  19. package/src/Card/card-manager.js +35 -35
  20. package/src/Card/display/card-display.js +8 -8
  21. package/src/Card/log-card-click.js +1 -1
  22. package/src/Card/log-card-dismissal.js +1 -1
  23. package/src/Card/log-card-impressions.js +3 -3
  24. package/src/Card/models/captioned-image.js +21 -21
  25. package/src/Card/models/card.js +92 -92
  26. package/src/Card/models/classic-card.js +21 -21
  27. package/src/Card/models/control-card.js +11 -11
  28. package/src/Card/models/image-only.js +19 -19
  29. package/src/Card/util/card-factory.js +39 -39
  30. package/src/ContentCards/content-cards-provider-factory.js +1 -1
  31. package/src/ContentCards/content-cards-provider.js +142 -142
  32. package/src/ContentCards/content-cards.js +3 -3
  33. package/src/ContentCards/get-cached-content-cards.js +1 -1
  34. package/src/ContentCards/request-content-cards-refresh.js +1 -1
  35. package/src/ContentCards/subscribe-to-content-cards-updates.js +4 -4
  36. package/src/ContentCards/ui/show-content-cards.js +8 -8
  37. package/src/Core/add-sdk-metadata.js +2 -2
  38. package/src/Core/change-user.js +3 -3
  39. package/src/Core/disable-sdk.js +7 -7
  40. package/src/Core/enable-sdk.js +5 -5
  41. package/src/Core/get-device-id.js +2 -2
  42. package/src/Core/get-user.js +1 -1
  43. package/src/Core/handle-braze-action.js +2 -2
  44. package/src/Core/is-disabled.js +2 -2
  45. package/src/Core/is-initialized.js +1 -1
  46. package/src/Core/log-custom-event.js +5 -5
  47. package/src/Core/log-purchase.js +4 -4
  48. package/src/Core/open-session.js +7 -7
  49. package/src/Core/wipe-data.js +3 -3
  50. package/src/FeatureFlags/feature-flag-factory.js +10 -10
  51. package/src/FeatureFlags/feature-flag.js +19 -19
  52. package/src/FeatureFlags/feature-flags-provider.js +61 -61
  53. package/src/FeatureFlags/get-all-feature-flags.js +6 -7
  54. package/src/FeatureFlags/get-feature-flag.js +5 -6
  55. package/src/FeatureFlags/log-feature-flag-impression.js +4 -4
  56. package/src/FeatureFlags/subscribe-to-feature-flags-updates.js +2 -2
  57. package/src/Feed/feed-provider.js +41 -41
  58. package/src/Feed/feed.js +2 -2
  59. package/src/Feed/get-cached-feed.js +1 -1
  60. package/src/Feed/log-feed-displayed.js +1 -1
  61. package/src/Feed/request-feed-refresh.js +1 -1
  62. package/src/Feed/subscribe-to-feed-updates.js +1 -1
  63. package/src/Feed/ui/show-feed.js +5 -5
  64. package/src/InAppMessage/defer-in-app-message.js +1 -1
  65. package/src/InAppMessage/display/html-message-to-html.js +6 -6
  66. package/src/InAppMessage/display/in-app-message-to-html.js +20 -20
  67. package/src/InAppMessage/display/modal-utils.js +4 -4
  68. package/src/InAppMessage/in-app-message-factory.js +7 -7
  69. package/src/InAppMessage/in-app-message-manager-factory.js +1 -1
  70. package/src/InAppMessage/in-app-message-manager.js +89 -89
  71. package/src/InAppMessage/log-in-app-message-button-click.js +6 -6
  72. package/src/InAppMessage/log-in-app-message-click.js +5 -5
  73. package/src/InAppMessage/log-in-app-message-html-click.js +7 -7
  74. package/src/InAppMessage/log-in-app-message-impression.js +2 -2
  75. package/src/InAppMessage/models/control-message.js +5 -5
  76. package/src/InAppMessage/models/full-screen-message.js +34 -34
  77. package/src/InAppMessage/models/html-message.js +20 -20
  78. package/src/InAppMessage/models/in-app-message-button.js +8 -8
  79. package/src/InAppMessage/models/in-app-message.js +83 -83
  80. package/src/InAppMessage/models/modal-message.js +33 -33
  81. package/src/InAppMessage/models/slide-up-message.js +30 -30
  82. package/src/InAppMessage/models/templated-in-app-message.js +8 -8
  83. package/src/InAppMessage/subscribe-to-in-app-message.js +1 -1
  84. package/src/InAppMessage/ui/automatically-show-in-app-messages.js +3 -3
  85. package/src/InAppMessage/ui/show-in-app-message.js +19 -19
  86. package/src/Push/push-manager-factory.js +8 -8
  87. package/src/Push/push-manager.js +96 -96
  88. package/src/Push/utils/push-utils.js +4 -4
  89. package/src/User/user-manager.js +19 -19
  90. package/src/User/user.js +41 -41
  91. package/src/common/base-feed.js +3 -3
  92. package/src/common/base-provider.js +1 -1
  93. package/src/common/event-logger.js +6 -6
  94. package/src/common/feed-display.js +10 -10
  95. package/src/l10n/l10n-manager-factory.js +2 -2
  96. package/src/l10n/l10n-manager.js +1 -1
  97. package/src/managers/auth-manager.js +31 -31
  98. package/src/managers/braze-instance.js +139 -139
  99. package/src/managers/device-manager.js +24 -24
  100. package/src/managers/network-manager.js +151 -151
  101. package/src/managers/server-config-manager.js +86 -86
  102. package/src/managers/session-manager.js +38 -38
  103. package/src/managers/storage-manager-factory.js +12 -12
  104. package/src/managers/storage-manager.js +96 -96
  105. package/src/managers/subscription-manager.js +10 -10
  106. package/src/managers/utils.js +4 -4
  107. package/src/models/backend-errors.js +5 -5
  108. package/src/models/braze-event.js +4 -4
  109. package/src/models/device.js +2 -2
  110. package/src/models/identifier.js +12 -12
  111. package/src/models/push-token.js +8 -8
  112. package/src/models/request-result.js +3 -3
  113. package/src/models/server-config.js +31 -31
  114. package/src/request-controller.js +152 -152
  115. package/src/triggers/models/custom-event-data.js +1 -1
  116. package/src/triggers/models/custom-event-property-data.js +2 -2
  117. package/src/triggers/models/filter-set.js +6 -6
  118. package/src/triggers/models/filter.js +2 -2
  119. package/src/triggers/models/in-app-message-click-data.js +1 -1
  120. package/src/triggers/models/purchase-data.js +1 -1
  121. package/src/triggers/models/purchase-property-data.js +2 -2
  122. package/src/triggers/models/push-click-data.js +1 -1
  123. package/src/triggers/models/trigger-condition.js +33 -33
  124. package/src/triggers/models/trigger-events.js +3 -3
  125. package/src/triggers/models/trigger.js +11 -11
  126. package/src/triggers/triggers-provider-factory.js +3 -3
  127. package/src/triggers/triggers-provider.js +74 -74
  128. package/src/ui/js/attach-css.js +3 -3
  129. package/src/ui/js/load-font-awesome.js +2 -2
  130. package/src/util/base-device-parser.js +3 -3
  131. package/src/util/braze-actions.js +4 -4
  132. package/src/util/browser-detector.js +5 -5
  133. package/src/util/client-hints-parser.js +1 -1
  134. package/src/util/component-utils.js +1 -1
  135. package/src/util/dom-utils.js +7 -7
  136. package/src/util/html-display-utils.js +6 -6
  137. package/src/util/key-codes.js +1 -1
  138. package/src/util/net.js +6 -6
  139. package/src/util/request-header-utils.js +21 -21
  140. package/src/util/user-agent-parser.js +1 -1
  141. package/src/util/validation-utils.js +4 -4
  142. package/src/util/window-utils.js +1 -1
@@ -15,46 +15,46 @@ export default class Jt {
15
15
  n = { enabled: !0, capacity: Zt, refill_rate: hi, endpoint_overrides: {} },
16
16
  o = { enabled: !1, max_placements: 0 },
17
17
  ) {
18
- (this.Rl = t),
19
- (this.yl = i),
20
- (this.Ll = s),
21
- (this.Bl = h),
22
- (this.Tl = e),
23
- (this.vl = l),
24
- (this.wl = r),
25
- (this.je = a),
26
- (this.El = n),
18
+ (this.ml = t),
19
+ (this.Rl = i),
20
+ (this.Cl = s),
21
+ (this.El = h),
22
+ (this.wl = e),
23
+ (this.fl = l),
24
+ (this.dl = r),
25
+ (this.De = a),
26
+ (this.bl = n),
27
27
  (this.banners = o),
28
- (this.Rl = t),
29
- (this.yl = i),
30
- (this.Ll = s),
31
- (this.Bl = h),
32
- (this.Tl = e),
33
- (this.vl = l),
34
- (this.wl = r),
35
- (this.je = a),
36
- (this.El = n),
28
+ (this.ml = t),
29
+ (this.Rl = i),
30
+ (this.Cl = s),
31
+ (this.El = h),
32
+ (this.wl = e),
33
+ (this.fl = l),
34
+ (this.dl = r),
35
+ (this.De = a),
36
+ (this.bl = n),
37
37
  (this.banners = o);
38
38
  }
39
- bs() {
39
+ bt() {
40
40
  return {
41
- s: "5.7.0",
42
- l: this.Rl,
43
- e: this.yl,
44
- a: this.Ll,
45
- p: this.Bl,
46
- m: this.Tl,
47
- v: this.vl,
48
- c: this.wl,
49
- f: this.je,
50
- grl: this.El,
41
+ s: "5.8.1",
42
+ l: this.ml,
43
+ e: this.Rl,
44
+ a: this.Cl,
45
+ p: this.El,
46
+ m: this.wl,
47
+ v: this.fl,
48
+ c: this.dl,
49
+ f: this.De,
50
+ grl: this.bl,
51
51
  b: this.banners,
52
52
  };
53
53
  }
54
- static Yn(t) {
54
+ static En(t) {
55
55
  let i = t.l;
56
56
  return (
57
- "5.7.0" !== t.s && (i = 0),
57
+ "5.8.1" !== t.s && (i = 0),
58
58
  new Jt(i, t.e, t.a, t.p, t.m, t.v, t.c, t.f, t.grl, t.b)
59
59
  );
60
60
  }
@@ -9,97 +9,97 @@ import {
9
9
  Guid as G,
10
10
  EventTypes as d,
11
11
  } from "../shared-lib/index.js";
12
- import { STORAGE_KEYS as t } from "./managers/storage-manager.js";
12
+ import { STORAGE_KEYS as s } from "./managers/storage-manager.js";
13
13
  import u from "./managers/subscription-manager.js";
14
14
  import vt from "./Push/utils/push-utils.js";
15
15
  import h from "./util/request-header-utils.js";
16
16
  export default class Lt {
17
17
  constructor(t, i, s, e, h, o, n, r, l, a) {
18
- (this.fn = t),
18
+ (this.un = t),
19
19
  (this.baseUrl = i),
20
20
  (this.T = s),
21
- (this.dn = e),
22
- (this.As = h),
21
+ (this.an = e),
22
+ (this.Cs = h),
23
23
  (this.B = o),
24
24
  (this.C = n),
25
25
  (this.$l = r),
26
- (this.Qh = l),
26
+ (this.Ra = l),
27
27
  (this.S = a),
28
- (this.fn = t),
28
+ (this.un = t),
29
29
  (this.baseUrl = i),
30
- (this.Pl = 0),
30
+ (this.Tl = 0),
31
31
  (this.dE = n.IE() || 0),
32
- (this.Ul = null),
32
+ (this.Ml = null),
33
33
  (this.T = s),
34
- (this.dn = e),
35
- (this.As = h),
34
+ (this.an = e),
35
+ (this.Cs = h),
36
36
  (this.B = o),
37
37
  (this.C = n),
38
- (this.Qh = l),
38
+ (this.Ra = l),
39
39
  (this.S = a),
40
40
  (this.$l = r),
41
- (this._l = new u()),
42
- (this.Xl = null),
43
- (this.Ql = 50),
44
- (this.Yl = !1);
41
+ (this.Pl = new u()),
42
+ (this.Ol = null),
43
+ (this.Ul = 50),
44
+ (this._l = !1);
45
45
  }
46
- Zl(t, i) {
47
- return !t && !i && this.Qh.Kh() >= this.Ql;
46
+ Jl(t, i) {
47
+ return !t && !i && this.Ra.Jh() >= this.Ul;
48
48
  }
49
- sc(t) {
50
- let i = this.T.Wl();
49
+ Kl(t) {
50
+ let i = this.T.zl();
51
51
  if (t.length > 0) {
52
- const s = this.As.getUserId();
52
+ const s = this.Cs.getUserId();
53
53
  for (const e of t) {
54
54
  const t = (!e.userId && !s) || e.userId === s;
55
- e.type === d.Kl && t && (i = !0);
55
+ e.type === d.Bl && t && (i = !0);
56
56
  }
57
57
  }
58
58
  return i;
59
59
  }
60
- hc(i = !1, s = !1, e = !0, o, n, r, u = !1, c = !1) {
61
- e && this.uc();
60
+ Xl(t = !1, i = !1, e = !0, o, n, r, u = !1, c = !1) {
61
+ e && this.Ql();
62
62
  const d = this.C.AE(),
63
63
  m = this.C.OE();
64
64
  let f = !1;
65
- const g = (i, s, u = -1) => {
65
+ const g = (t, i, u = -1) => {
66
66
  const c = new Date().valueOf();
67
- h.W(this.C, h.O.zu, c),
68
- -1 !== u && s.push(["X-Braze-Req-Tokens-Remaining", u.toString()]);
67
+ h.W(this.C, h.O.Nu, c),
68
+ -1 !== u && i.push(["X-Braze-Req-Tokens-Remaining", u.toString()]);
69
69
  let d = !1;
70
70
  l.Y({
71
71
  url: this.baseUrl + "/data/",
72
- data: i,
73
- headers: s,
74
- ss: (e) => {
75
- null != i.respond_with &&
76
- i.respond_with.triggers &&
77
- (this.Pl = Math.max(this.Pl - 1, 0)),
78
- this.S.ts(i, e, s)
79
- ? (this.Qh.es(),
80
- this.B.Cl(e),
81
- (null != i.respond_with &&
82
- i.respond_with.user_id != this.As.getUserId()) ||
83
- (null != i.device && this.C.Bs(t.gs.$a, i.device),
84
- null != i.sdk_metadata &&
85
- (this.C.Bs(t.gs.qu, i.sdk_metadata),
86
- this.C.Bs(t.gs.Au, this.T.Ss())),
72
+ data: t,
73
+ headers: i,
74
+ tt: (e) => {
75
+ null != t.respond_with &&
76
+ t.respond_with.triggers &&
77
+ (this.Tl = Math.max(this.Tl - 1, 0)),
78
+ this.S.st(t, e, i)
79
+ ? (this.Ra.it(),
80
+ this.B.gl(e),
81
+ (null != t.respond_with &&
82
+ t.respond_with.user_id != this.Cs.getUserId()) ||
83
+ (null != t.device && this.C.Bt(s.gt.ic, t.device),
84
+ null != t.sdk_metadata &&
85
+ (this.C.Bt(s.gt.vu, t.sdk_metadata),
86
+ this.C.Bt(s.gt.pu, this.T.St())),
87
87
  this.$l(e),
88
- h.Lu(this.C, h.O.zu, 1),
88
+ h.ju(this.C, h.O.Nu, 1),
89
89
  "function" == typeof o && o()))
90
90
  : e.auth_error && (d = !0);
91
91
  },
92
92
  error: () => {
93
93
  (d = !0),
94
- null != i.respond_with &&
95
- i.respond_with.triggers &&
96
- (this.Pl = Math.max(this.Pl - 1, 0)),
97
- this.S.Du(i.events, i.attributes),
94
+ null != t.respond_with &&
95
+ t.respond_with.triggers &&
96
+ (this.Tl = Math.max(this.Tl - 1, 0)),
97
+ this.S.Ru(t.events, t.attributes),
98
98
  "function" == typeof n && n();
99
99
  },
100
- rs: (t, i) => {
100
+ nt: (t, i) => {
101
101
  "function" == typeof r && r(!d);
102
- const s = this.S.Ou(i);
102
+ const s = this.S.Iu(i);
103
103
  let o = 0;
104
104
  if (s)
105
105
  switch (s.type) {
@@ -111,139 +111,139 @@ export default class Lt {
111
111
  }
112
112
  if (e && !f) {
113
113
  if (d) {
114
- h.Gu(this.C, h.O.zu);
115
- let t = this.Ul;
114
+ h.Pu(this.C, h.O.Nu);
115
+ let t = this.Ml;
116
116
  (null == t || t < 1e3 * this.dE) && (t = 1e3 * this.dE);
117
117
  const i = Math.min(3e5, a(1e3 * this.dE, 3 * t)) + o;
118
- this.lc(i);
119
- } else this.lc(Math.max(1e3 * this.dE, o));
118
+ this.Yl(i);
119
+ } else this.Yl(Math.max(1e3 * this.dE, o));
120
120
  f = !0;
121
121
  }
122
122
  },
123
123
  });
124
124
  },
125
- p = this.sc(d),
126
- v = s || p;
127
- if (this.Zl(u, p))
125
+ p = this.Kl(d),
126
+ v = i || p;
127
+ if (this.Jl(u, p))
128
128
  return void N.info(
129
129
  "Declining to flush data due to 50 consecutive authentication failures",
130
130
  );
131
- if (e && !this.S.Su(d, m, i, v))
132
- return this.lc(), void ("function" == typeof r && r(!0));
133
- const b = this.S.Bu(i, v, d, m, c);
134
- v && this.Pl++;
131
+ if (e && !this.S.Tu(d, m, t, v))
132
+ return this.Yl(), void ("function" == typeof r && r(!0));
133
+ const b = this.S.yu(t, v, d, m, c);
134
+ v && this.Tl++;
135
135
  let w = !1;
136
136
  if (b)
137
137
  for (const t of b)
138
138
  this.S.V(
139
139
  t.requestData,
140
140
  (i) => g(t.requestData, t.headers, i),
141
- h.O.zu,
141
+ h.O.Nu,
142
142
  n,
143
143
  ),
144
144
  (w = !0);
145
- this.Qh.jh() && e && !w
146
- ? this.lc()
147
- : p && (N.info("Invoking new session subscriptions"), this._l.X());
145
+ this.Ra.wh() && e && !w
146
+ ? this.Yl()
147
+ : p && (N.info("Invoking new session subscriptions"), this.Pl.X());
148
148
  }
149
- cc() {
150
- return this.Pl > 0;
149
+ Zl() {
150
+ return this.Tl > 0;
151
151
  }
152
- lc(t = 1e3 * this.dE) {
153
- this.Yl ||
154
- (this.uc(),
155
- (this.Xl = window.setTimeout(() => {
152
+ Yl(t = 1e3 * this.dE) {
153
+ this._l ||
154
+ (this.Ql(),
155
+ (this.Ol = window.setTimeout(() => {
156
156
  if (document.hidden) {
157
157
  const t = "visibilitychange",
158
158
  i = () => {
159
159
  document.hidden ||
160
- (document.removeEventListener(t, i, !1), this.hc());
160
+ (document.removeEventListener(t, i, !1), this.Xl());
161
161
  };
162
162
  document.addEventListener(t, i, !1);
163
- } else this.hc();
163
+ } else this.Xl();
164
164
  }, t)),
165
- (this.Ul = t));
165
+ (this.Ml = t));
166
166
  }
167
- uc() {
168
- null != this.Xl && (clearTimeout(this.Xl), (this.Xl = null));
167
+ Ql() {
168
+ null != this.Ol && (clearTimeout(this.Ol), (this.Ol = null));
169
169
  }
170
170
  initialize() {
171
- (this.Yl = !1), this.lc();
171
+ (this._l = !1), this.Yl();
172
172
  }
173
173
  destroy() {
174
- this._l.removeAllSubscriptions(),
175
- this.Qh.Hh(),
176
- this.uc(),
177
- (this.Yl = !0),
178
- this.hc(void 0, void 0, !1, void 0, void 0, void 0, void 0, !0),
179
- (this.Xl = null);
174
+ this.Pl.removeAllSubscriptions(),
175
+ this.Ra.Gh(),
176
+ this.Ql(),
177
+ (this._l = !0),
178
+ this.Xl(void 0, void 0, !1, void 0, void 0, void 0, void 0, !0),
179
+ (this.Ol = null);
180
180
  }
181
181
  rn(t) {
182
- return this._l.Fs(t);
182
+ return this.Pl.Ft(t);
183
183
  }
184
184
  openSession() {
185
- const i = this.T.Ss() !== this.T.Eo();
186
- i && (this.C.TE(t.iu.$h), this.C.TE(t.iu.su)),
187
- this.hc(void 0, !1, void 0, () => {
188
- this.C.Es(t.gs.$e);
185
+ const t = this.T.St() !== this.T.Qo();
186
+ t && (this.C.TE(s.iu.Ia), this.C.TE(s.iu.su)),
187
+ this.Xl(void 0, !1, void 0, () => {
188
+ this.C.Ut(s.gt.Ge);
189
189
  }),
190
- this.bu(),
191
- i &&
192
- import("./Push/push-manager-factory.js").then((i) => {
193
- if (this.Yl) return;
194
- const s = i.default.ea();
190
+ this.Jn(),
191
+ t &&
192
+ import("./Push/push-manager-factory.js").then((t) => {
193
+ if (this._l) return;
194
+ const i = t.default.ea();
195
195
  if (
196
- null != s &&
196
+ null != i &&
197
197
  (vt.isPushPermissionGranted() || vt.isPushBlocked())
198
198
  ) {
199
- const i = () => {
200
- s.jn()
199
+ const t = () => {
200
+ i.vn()
201
201
  ? N.info(
202
202
  "Push token maintenance is disabled, not refreshing token for backend.",
203
203
  )
204
- : s.subscribe();
204
+ : i.subscribe();
205
205
  },
206
- e = (t, s) => {
207
- s && i();
206
+ e = (i, s) => {
207
+ s && t();
208
208
  },
209
209
  h = () => {
210
- const s = this.C.vs(t.gs.Bn);
211
- (null == s || s) && i();
210
+ const i = this.C.ft(s.gt.qn);
211
+ (null == i || i) && t();
212
212
  },
213
- o = tt._s.Xs;
214
- new tt(o, N).jr(o.Ks.cu, e, h);
213
+ o = tt.Ls.Fs;
214
+ new tt(o, N).cr(o.Ms.cu, e, h);
215
215
  }
216
216
  });
217
217
  }
218
- dc() {
219
- this.C.Es(t.gs.xe), this.C.Es(t.gs.di), this.C.Es(t.gs.on);
218
+ hc() {
219
+ this.C.Ut(s.gt.Xe), this.C.Ut(s.gt.Is), this.C.Ut(s.gt.Lr);
220
220
  }
221
- changeUser(i, s, e) {
222
- const h = this.As.getUserId();
223
- if (h !== i) {
224
- this.T.Ml(),
225
- this.dc(),
226
- null != h && this.hc(void 0, !1, void 0, void 0, void 0),
227
- this.As.ou(i),
228
- e ? this.Qh.setSdkAuthenticationSignature(e) : this.Qh.Bh();
229
- for (let t = 0; t < s.length; t++) s[t].changeUser(null == h);
230
- null != h && this.C.Es(t.gs.Ct),
231
- this.C.Es(t.gs.$a),
232
- this.C.Es(t.gs._E),
221
+ changeUser(t, i, e) {
222
+ const h = this.Cs.getUserId();
223
+ if (h !== t) {
224
+ this.T.Fl(),
225
+ this.hc(),
226
+ null != h && this.Xl(void 0, !1, void 0, void 0, void 0),
227
+ this.Cs.ou(t),
228
+ e ? this.Ra.setSdkAuthenticationSignature(e) : this.Ra.yh();
229
+ for (let t = 0; t < i.length; t++) i[t].changeUser(null == h);
230
+ null != h && this.C.Ut(s.gt.Zt),
231
+ this.C.Ut(s.gt.ic),
232
+ this.C.Ut(s.gt._E),
233
233
  this.openSession(),
234
- N.info('Changed user to "' + i + '".');
234
+ N.info('Changed user to "' + t + '".');
235
235
  } else {
236
- let t = "Doing nothing.";
236
+ let i = "Doing nothing.";
237
237
  e &&
238
- this.Qh.xh() !== e &&
239
- (this.Qh.setSdkAuthenticationSignature(e),
240
- (t = "Updated SDK authentication signature")),
241
- N.info(`Current user is already ${i}. ${t}`);
238
+ this.Ra.jh() !== e &&
239
+ (this.Ra.setSdkAuthenticationSignature(e),
240
+ (i = "Updated SDK authentication signature")),
241
+ N.info(`Current user is already ${t}. ${i}`);
242
242
  }
243
243
  }
244
244
  requestImmediateDataFlush(t) {
245
- this.uc(), this.T.Eo();
246
- this.hc(
245
+ this.Ql(), this.T.Qo();
246
+ this.Xl(
247
247
  void 0,
248
248
  void 0,
249
249
  void 0,
@@ -256,29 +256,29 @@ export default class Lt {
256
256
  );
257
257
  }
258
258
  requestFeedRefresh() {
259
- this.T.Eo(), this.hc(!0);
259
+ this.T.Qo(), this.Xl(!0);
260
260
  }
261
- vr(t, i) {
262
- this.T.Eo(),
261
+ br(t, i) {
262
+ this.T.Qo(),
263
263
  N.info("Requesting explicit trigger refresh."),
264
- this.hc(void 0, !0, void 0, t, i);
264
+ this.Xl(void 0, !0, void 0, t, i);
265
265
  }
266
- Ln(i, s) {
267
- const e = d.mc,
268
- h = { a: i, l: s },
269
- o = c.cs(e, h);
266
+ Cn(t, i) {
267
+ const e = d.dc,
268
+ h = { a: t, l: i },
269
+ o = c.ut(e, h);
270
270
  return (
271
- o && (N.info(`Logged alias ${i} with label ${s}`), this.C.Bs(t.gs._E, h)),
271
+ o && (N.info(`Logged alias ${t} with label ${i}`), this.C.Bt(s.gt._E, h)),
272
272
  o
273
273
  );
274
274
  }
275
- Gn(t, i, s) {
275
+ Ln(t, i, s) {
276
276
  if (this.B.hu(i))
277
277
  return (
278
278
  N.info(`Custom Attribute "${i}" is blocklisted, ignoring.`), new E()
279
279
  );
280
280
  const e = { key: i, value: s },
281
- h = c.cs(t, e);
281
+ h = c.ut(t, e);
282
282
  if (h) {
283
283
  const t = "object" == typeof s ? JSON.stringify(s, null, 2) : s;
284
284
  N.info(`Logged custom attribute: ${i} with value: ${t}`);
@@ -290,38 +290,38 @@ export default class Lt {
290
290
  null != e && (n.altitude = e),
291
291
  null != h && (n.ll_accuracy = h),
292
292
  null != o && (n.alt_accuracy = o);
293
- const r = c.cs(d.fc, n, t || void 0);
293
+ const r = c.ut(d.mc, n, t || void 0);
294
294
  return (
295
295
  r &&
296
296
  N.info(`Set user last known location as ${JSON.stringify(n, null, 2)}`),
297
297
  r
298
298
  );
299
299
  }
300
- br(t, i) {
301
- const s = this.T.Eo();
302
- return new ve(this.As.getUserId(), d.gc, t, s, { cid: i });
300
+ lr(t, i) {
301
+ const s = this.T.Qo();
302
+ return new ve(this.Cs.getUserId(), d.fc, t, s, { cid: i });
303
303
  }
304
304
  vc(t, i) {
305
305
  return new tt(t, i);
306
306
  }
307
- bu() {
308
- const t = tt._s.Xs;
309
- this.vc(t, N).setItem(t.Ks.zu, 1, {
307
+ Jn() {
308
+ const t = tt.Ls.Fs;
309
+ this.vc(t, N).setItem(t.Ms.Nu, 1, {
310
310
  baseUrl: this.baseUrl,
311
- data: { api_key: this.fn, device_id: this.dn.ce().id },
312
- userId: this.As.getUserId(),
313
- sdkAuthEnabled: this.Qh.jh(),
311
+ data: { api_key: this.un, device_id: this.an.ve().id },
312
+ userId: this.Cs.getUserId(),
313
+ sdkAuthEnabled: this.Ra.wh(),
314
314
  });
315
315
  }
316
- wr(t) {
316
+ vr(t) {
317
317
  for (const i of t)
318
- if (i.api_key === this.fn) this.S.Du(i.events, i.attributes);
318
+ if (i.api_key === this.un) this.S.Ru(i.events, i.attributes);
319
319
  else {
320
- const t = tt._s.Xs;
321
- new tt(t, N).setItem(t.Ks.$r, G.Rt(), i);
320
+ const t = tt.Ls.Fs;
321
+ new tt(t, N).setItem(t.Ms.kr, G.ce(), i);
322
322
  }
323
323
  }
324
- Zn(t, i, s) {
324
+ Hn(t, i, s) {
325
325
  if (this.B.hu(t))
326
326
  return (
327
327
  N.info(`Custom Attribute "${t}" is blocklisted, ignoring.`), new E()
@@ -331,11 +331,11 @@ export default class Lt {
331
331
  null === i && null === s
332
332
  ? ((e = d.bc), (h = { key: t }))
333
333
  : ((e = d.wc), (h = { key: t, latitude: i, longitude: s })),
334
- c.cs(e, h)
334
+ c.ut(e, h)
335
335
  );
336
336
  }
337
- au(t, i) {
337
+ Kn(t, i) {
338
338
  const s = { group_id: t, status: i };
339
- return c.cs(d.kc, s);
339
+ return c.ut(d.kc, s);
340
340
  }
341
341
  }
@@ -8,7 +8,7 @@ export default class ts {
8
8
  static fromJson(t) {
9
9
  return new ts(t ? t.event_name : null);
10
10
  }
11
- bs() {
11
+ bt() {
12
12
  return this.xc;
13
13
  }
14
14
  }
@@ -15,7 +15,7 @@ export default class rs {
15
15
  t ? is.fromJson(t.property_filters) : null,
16
16
  );
17
17
  }
18
- bs() {
19
- return { e: this.xc, pf: this.tf ? this.tf.bs() : null };
18
+ bt() {
19
+ return { e: this.xc, pf: this.tf ? this.tf.bt() : null };
20
20
  }
21
21
  }
@@ -1,5 +1,5 @@
1
1
  import fr from "./filter.js";
2
- import { isArray as w } from "../../util/code-utils.js";
2
+ import { isArray as z } from "../../util/code-utils.js";
3
3
  export default class is {
4
4
  constructor(t) {
5
5
  (this.filters = t), (this.filters = t);
@@ -22,7 +22,7 @@ export default class is {
22
22
  return r;
23
23
  }
24
24
  static fromJson(t) {
25
- if (null == t || !w(t)) return null;
25
+ if (null == t || !z(t)) return null;
26
26
  const r = [];
27
27
  for (let e = 0; e < t.length; e++) {
28
28
  const o = [],
@@ -32,22 +32,22 @@ export default class is {
32
32
  }
33
33
  return new is(r);
34
34
  }
35
- bs() {
35
+ bt() {
36
36
  const t = [];
37
37
  for (let r = 0; r < this.filters.length; r++) {
38
38
  const e = this.filters[r],
39
39
  o = [];
40
- for (let t = 0; t < e.length; t++) o.push(e[t].bs());
40
+ for (let t = 0; t < e.length; t++) o.push(e[t].bt());
41
41
  t.push(o);
42
42
  }
43
43
  return t;
44
44
  }
45
- static Yn(t) {
45
+ static En(t) {
46
46
  const r = [];
47
47
  for (let e = 0; e < t.length; e++) {
48
48
  const o = [],
49
49
  s = t[e];
50
- for (let t = 0; t < s.length; t++) o.push(fr.Yn(s[t]));
50
+ for (let t = 0; t < s.length; t++) o.push(fr.En(s[t]));
51
51
  r.push(o);
52
52
  }
53
53
  return new is(r);
@@ -74,14 +74,14 @@ export default class fr {
74
74
  t.property_value,
75
75
  );
76
76
  }
77
- bs() {
77
+ bt() {
78
78
  let t = this.LE;
79
79
  return (
80
80
  Nt(this.LE) && (t = L(t.valueOf())),
81
81
  { k: this.yE, t: this.HE, c: this.comparator, v: t }
82
82
  );
83
83
  }
84
- static Yn(t) {
84
+ static En(t) {
85
85
  return new fr(t.k, t.t, t.c, t.v);
86
86
  }
87
87
  }
@@ -19,7 +19,7 @@ export default class ni {
19
19
  static fromJson(t) {
20
20
  return new ni(t ? t.id : null, t ? t.buttons : null);
21
21
  }
22
- bs() {
22
+ bt() {
23
23
  return this.if;
24
24
  }
25
25
  }
@@ -8,7 +8,7 @@ export default class ns {
8
8
  static fromJson(t) {
9
9
  return new ns(t ? t.product_id : null);
10
10
  }
11
- bs() {
11
+ bt() {
12
12
  return this.productId;
13
13
  }
14
14
  }
@@ -15,7 +15,7 @@ export default class hs {
15
15
  t ? is.fromJson(t.property_filters) : null,
16
16
  );
17
17
  }
18
- bs() {
19
- return { id: this.productId, pf: this.tf ? this.tf.bs() : null };
18
+ bt() {
19
+ return { id: this.productId, pf: this.tf ? this.tf.bt() : null };
20
20
  }
21
21
  }
@@ -9,7 +9,7 @@ export default class ur {
9
9
  static fromJson(t) {
10
10
  return new ur(t ? t.campaign_id : null);
11
11
  }
12
- bs() {
12
+ bt() {
13
13
  return this.if;
14
14
  }
15
15
  }