@streamlayer/sdk-web 1.2.7 → 1.3.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 (3) hide show
  1. package/lib/cjs/index.js +7 -7
  2. package/lib/es/index.js +1072 -1136
  3. package/package.json +12 -12
package/lib/es/index.js CHANGED
@@ -1,28 +1,28 @@
1
- import { pino as yi } from "pino";
2
- import { QuestionType as F, QuestionStatus as H, NotificationEnabled as gi, SilenceSetting as mi, PromotionType as Te } from "@streamlayer/sl-eslib/interactive/interactive.common_pb";
3
- import { PickHistoryStatus as lt } from "@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb";
1
+ import { pino as mi } from "pino";
2
+ import { QuestionType as _, QuestionStatus as W, NotificationEnabled as gi, SilenceSetting as vi, PromotionType as Te } from "@streamlayer/sl-eslib/interactive/interactive.common_pb";
3
+ import { PickHistoryStatus as ct } from "@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb";
4
4
  import { SdkOverlayType as D } from "@streamlayer/sl-eslib/sdkSettings/sdkSettings.common_pb";
5
5
  import { InvitationCategory as Dr, InvitationFrom as Rr } from "@streamlayer/sl-eslib/analytics/v1/invitations/invitations_pb";
6
- import { computed as vi, map as bi, atom as Ct, batched as Vr, onMount as nt } from "nanostores";
6
+ import { computed as bi, map as Si, atom as Ct, batched as Vr, onMount as Lt } from "nanostores";
7
7
  import { nanoid as nr } from "nanoid";
8
- import { ConnectError as tt, Code as se, createContextKey as $r, createPromiseClient as Mr, createContextValues as Si } from "@connectrpc/connect";
8
+ import { ConnectError as tt, Code as oe, createContextKey as $r, createPromiseClient as Mr, createContextValues as wi } from "@connectrpc/connect";
9
9
  import { createGrpcWebTransport as jr } from "@connectrpc/connect-web";
10
10
  import { nanoquery as Ur } from "@nanostores/query";
11
11
  import { Events as wn } from "@streamlayer/sl-eslib/sports/events/events_connect";
12
- import { Client as it } from "@streamlayer/sl-eslib/sdkSettings/client/client_connect";
12
+ import { Client as nt } from "@streamlayer/sl-eslib/sdkSettings/client/client_connect";
13
13
  import { Users as vr } from "@streamlayer/sl-eslib/users/users_connect";
14
- import { Feed as ne } from "@streamlayer/sl-eslib/interactive/feed/interactive.feed_connect";
14
+ import { Feed as re } from "@streamlayer/sl-eslib/interactive/feed/interactive.feed_connect";
15
15
  import { Leaderboard as An } from "@streamlayer/sl-eslib/interactive/leaderboard/interactive.leaderboard_connect";
16
16
  import "@streamlayer/sl-eslib/interactive/leaderboard/interactive.leaderboard_pb";
17
- import { LinksClient as wi } from "@streamlayer/sl-eslib/shortLinks/linksClient_connect";
18
- import { Kind as x, TopicSubType as we, TopicType as z, PollOpenedFrom as ee, Category as G, ScreenOrientation as Br } from "@streamlayer/sl-eslib/analytics/v1/common/analytics.common_pb";
17
+ import { LinksClient as Ai } from "@streamlayer/sl-eslib/shortLinks/linksClient_connect";
18
+ import { Kind as q, TopicSubType as we, TopicType as z, PollOpenedFrom as ee, Category as G, ScreenOrientation as Br } from "@streamlayer/sl-eslib/analytics/v1/common/analytics.common_pb";
19
19
  import { AnalyticsService as En } from "@streamlayer/sl-eslib/analytics/v2/streaming/streaming_connect";
20
20
  import { InteractionActionType as qr } from "@streamlayer/sl-eslib/analytics/v1/interactions/interactions_pb";
21
- import { NotificationKind as he, NotificationType as xr } from "@streamlayer/sl-eslib/analytics/v1/notifications/notifications_pb";
22
- function Ai(t) {
21
+ import { NotificationKind as fe, NotificationType as xr } from "@streamlayer/sl-eslib/analytics/v1/notifications/notifications_pb";
22
+ function Ei(t) {
23
23
  return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
24
24
  }
25
- var In = { exports: {} }, $ = In.exports = {}, ae, ue;
25
+ var In = { exports: {} }, $ = In.exports = {}, se, ae;
26
26
  function ir() {
27
27
  throw new Error("setTimeout has not been defined");
28
28
  }
@@ -31,60 +31,60 @@ function or() {
31
31
  }
32
32
  (function() {
33
33
  try {
34
- typeof setTimeout == "function" ? ae = setTimeout : ae = ir;
34
+ typeof setTimeout == "function" ? se = setTimeout : se = ir;
35
35
  } catch {
36
- ae = ir;
36
+ se = ir;
37
37
  }
38
38
  try {
39
- typeof clearTimeout == "function" ? ue = clearTimeout : ue = or;
39
+ typeof clearTimeout == "function" ? ae = clearTimeout : ae = or;
40
40
  } catch {
41
- ue = or;
41
+ ae = or;
42
42
  }
43
43
  })();
44
44
  function Tn(t) {
45
- if (ae === setTimeout)
45
+ if (se === setTimeout)
46
46
  return setTimeout(t, 0);
47
- if ((ae === ir || !ae) && setTimeout)
48
- return ae = setTimeout, setTimeout(t, 0);
47
+ if ((se === ir || !se) && setTimeout)
48
+ return se = setTimeout, setTimeout(t, 0);
49
49
  try {
50
- return ae(t, 0);
50
+ return se(t, 0);
51
51
  } catch {
52
52
  try {
53
- return ae.call(null, t, 0);
53
+ return se.call(null, t, 0);
54
54
  } catch {
55
- return ae.call(this, t, 0);
55
+ return se.call(this, t, 0);
56
56
  }
57
57
  }
58
58
  }
59
- function Ei(t) {
60
- if (ue === clearTimeout)
59
+ function Ii(t) {
60
+ if (ae === clearTimeout)
61
61
  return clearTimeout(t);
62
- if ((ue === or || !ue) && clearTimeout)
63
- return ue = clearTimeout, clearTimeout(t);
62
+ if ((ae === or || !ae) && clearTimeout)
63
+ return ae = clearTimeout, clearTimeout(t);
64
64
  try {
65
- return ue(t);
65
+ return ae(t);
66
66
  } catch {
67
67
  try {
68
- return ue.call(null, t);
68
+ return ae.call(null, t);
69
69
  } catch {
70
- return ue.call(this, t);
70
+ return ae.call(this, t);
71
71
  }
72
72
  }
73
73
  }
74
- var ve = [], xe = !1, _e, ht = -1;
75
- function Ii() {
76
- !xe || !_e || (xe = !1, _e.length ? ve = _e.concat(ve) : ht = -1, ve.length && On());
74
+ var ge = [], xe = !1, _e, ft = -1;
75
+ function Ti() {
76
+ !xe || !_e || (xe = !1, _e.length ? ge = _e.concat(ge) : ft = -1, ge.length && On());
77
77
  }
78
78
  function On() {
79
79
  if (!xe) {
80
- var t = Tn(Ii);
80
+ var t = Tn(Ti);
81
81
  xe = !0;
82
- for (var e = ve.length; e; ) {
83
- for (_e = ve, ve = []; ++ht < e; )
84
- _e && _e[ht].run();
85
- ht = -1, e = ve.length;
82
+ for (var e = ge.length; e; ) {
83
+ for (_e = ge, ge = []; ++ft < e; )
84
+ _e && _e[ft].run();
85
+ ft = -1, e = ge.length;
86
86
  }
87
- _e = null, xe = !1, Ei(t);
87
+ _e = null, xe = !1, Ii(t);
88
88
  }
89
89
  }
90
90
  $.nextTick = function(t) {
@@ -92,7 +92,7 @@ $.nextTick = function(t) {
92
92
  if (arguments.length > 1)
93
93
  for (var r = 1; r < arguments.length; r++)
94
94
  e[r - 1] = arguments[r];
95
- ve.push(new _n(t, e)), ve.length === 1 && !xe && Tn(On);
95
+ ge.push(new _n(t, e)), ge.length === 1 && !xe && Tn(On);
96
96
  };
97
97
  function _n(t, e) {
98
98
  this.fun = t, this.array = e;
@@ -106,17 +106,17 @@ $.env = {};
106
106
  $.argv = [];
107
107
  $.version = "";
108
108
  $.versions = {};
109
- function be() {
109
+ function ve() {
110
110
  }
111
- $.on = be;
112
- $.addListener = be;
113
- $.once = be;
114
- $.off = be;
115
- $.removeListener = be;
116
- $.removeAllListeners = be;
117
- $.emit = be;
118
- $.prependListener = be;
119
- $.prependOnceListener = be;
111
+ $.on = ve;
112
+ $.addListener = ve;
113
+ $.once = ve;
114
+ $.off = ve;
115
+ $.removeListener = ve;
116
+ $.removeAllListeners = ve;
117
+ $.emit = ve;
118
+ $.prependListener = ve;
119
+ $.prependOnceListener = ve;
120
120
  $.listeners = function(t) {
121
121
  return [];
122
122
  };
@@ -132,8 +132,8 @@ $.chdir = function(t) {
132
132
  $.umask = function() {
133
133
  return 0;
134
134
  };
135
- var Ti = In.exports;
136
- const A = /* @__PURE__ */ Ai(Ti), Oi = yi({
135
+ var Oi = In.exports;
136
+ const w = /* @__PURE__ */ Ei(Oi), _i = mi({
137
137
  level: "trace",
138
138
  enabled: typeof window < "u" && !!window.localStorage.getItem("SL_DEBUG"),
139
139
  browser: {
@@ -141,22 +141,22 @@ const A = /* @__PURE__ */ Ai(Ti), Oi = yi({
141
141
  console.log(t);
142
142
  }
143
143
  }
144
- }), le = (t, e) => Oi.child({ name: t }, e);
145
- class _i extends Event {
144
+ }), be = (t, e) => _i.child({ name: t }, e);
145
+ class Ci extends Event {
146
146
  slEventBus;
147
147
  constructor(e, r) {
148
148
  super(e), this.slEventBus = r;
149
149
  }
150
150
  }
151
- const Li = le("event-bus");
152
- class Ci {
151
+ const Li = be("event-bus");
152
+ class ki {
153
153
  name;
154
154
  listeners;
155
155
  constructor(e = "sl-event-bus") {
156
156
  this.name = e, this.listeners = /* @__PURE__ */ new Set();
157
157
  }
158
158
  emit = (e, r) => {
159
- const n = new _i(this.name, { ...r, type: e });
159
+ const n = new Ci(this.name, { ...r, type: e });
160
160
  Li.debug(n, "Emitting event"), window.dispatchEvent(n);
161
161
  };
162
162
  listen(e) {
@@ -173,7 +173,7 @@ class Ci {
173
173
  }), this.listeners.clear();
174
174
  };
175
175
  }
176
- class ki {
176
+ class Pi {
177
177
  }
178
178
  window.slStore = /* @__PURE__ */ Object.create(null);
179
179
  class kt {
@@ -192,23 +192,23 @@ class kt {
192
192
  return this.store;
193
193
  }
194
194
  }
195
- const Pi = (t) => {
195
+ const Ni = (t) => {
196
196
  const e = Object.keys(t);
197
- return vi(e.map((r) => t[r].getStore()), (...r) => Object.fromEntries(e.map((n, i) => [n, r[i]])));
197
+ return bi(e.map((r) => t[r].getStore()), (...r) => Object.fromEntries(e.map((n, i) => [n, r[i]])));
198
198
  };
199
- class Le extends kt {
199
+ class Ce extends kt {
200
200
  getValues = () => this.getStore().get();
201
201
  getValue = (e) => this.getStore().get()[e];
202
202
  setValue = (e, r) => this.getStore().setKey(e, r);
203
203
  subscribe = (...e) => this.getStore().subscribe(...e);
204
204
  unsubscribe = () => this.getStore().off();
205
205
  }
206
- const te = (t) => bi(t);
207
- var ye;
206
+ const te = (t) => Si(t);
207
+ var pe;
208
208
  (function(t) {
209
209
  t.ORGANIZATION = "ORGANIZATION", t.STREAM = "STREAM";
210
- })(ye || (ye = {}));
211
- const Ni = {
210
+ })(pe || (pe = {}));
211
+ const Fi = {
212
212
  [D.BETTING]: "betting",
213
213
  [D.GAMES]: "games",
214
214
  [D.PUBLIC_CHAT]: "publicChat",
@@ -218,7 +218,7 @@ var Xe;
218
218
  (function(t) {
219
219
  t.Ready = "ready", t.Suspended = "suspended";
220
220
  })(Xe || (Xe = {}));
221
- class Ln {
221
+ class Cn {
222
222
  status;
223
223
  source;
224
224
  config;
@@ -226,7 +226,7 @@ class Ln {
226
226
  listeners = /* @__PURE__ */ new Set();
227
227
  settingsKey;
228
228
  constructor({ settings: e, ...r }, n) {
229
- this.settingsKey = Ni[r.type], this.status = Ct(Xe.Suspended), this.config = new Le(te(r), `feature:config:${this.settingsKey}`), this.settingsKey !== void 0 && e?.overlaySettings.case === this.settingsKey ? this.settings = new Le(te(e.overlaySettings.value), `feature:settings:${this.settingsKey}`) : this.settings = new Le(te({}), `feature:settings:${this.settingsKey}`), this.source = n;
229
+ this.settingsKey = Fi[r.type], this.status = Ct(Xe.Suspended), this.config = new Ce(te(r), `feature:config:${this.settingsKey}`), this.settingsKey !== void 0 && e?.overlaySettings.case === this.settingsKey ? this.settings = new Ce(te(e.overlaySettings.value), `feature:settings:${this.settingsKey}`) : this.settings = new Ce(te({}), `feature:settings:${this.settingsKey}`), this.source = n;
230
230
  }
231
231
  get featureConfig() {
232
232
  return this.config.getStore();
@@ -257,7 +257,7 @@ class Ln {
257
257
  }
258
258
  };
259
259
  update = (e, r) => {
260
- this.source === ye.STREAM && r === ye.ORGANIZATION || (this.setFeatureConfig(e), this.source = r);
260
+ this.source === pe.STREAM && r === pe.ORGANIZATION || (this.setFeatureConfig(e), this.source = r);
261
261
  };
262
262
  fireEvent(e) {
263
263
  for (const r of this.listeners.values())
@@ -283,8 +283,8 @@ class Y extends kt {
283
283
  return this.getStore().get();
284
284
  }
285
285
  }
286
- const B = (t) => Ct(t);
287
- class re extends kt {
286
+ const x = (t) => Ct(t);
287
+ class ce extends kt {
288
288
  atomStore;
289
289
  constructor(e, r, n) {
290
290
  super(e, `api:${r}`), this.atomStore = Ct(), n && e.subscribe((i) => {
@@ -315,10 +315,10 @@ class re extends kt {
315
315
  key = () => this.getStore().key;
316
316
  off = () => this.getStore().off();
317
317
  }
318
- const J = new Ci();
319
- async function* Fi(t, e) {
318
+ const J = new ki();
319
+ async function* Di(t, e) {
320
320
  for await (const r of e) {
321
- t.response.message = r, t.received_at = Date.now(), t.id = Cn++;
321
+ t.response.message = r, t.received_at = Date.now(), t.id = Ln++;
322
322
  const n = {
323
323
  type: "__GRPC_DEVTOOLS_EXTENSION__",
324
324
  data: t
@@ -326,10 +326,10 @@ async function* Fi(t, e) {
326
326
  window.postMessage(n), yield r;
327
327
  }
328
328
  }
329
- let Cn = 0;
330
- const Di = () => (t) => async (e) => {
329
+ let Ln = 0;
330
+ const Ri = () => (t) => async (e) => {
331
331
  const r = {
332
- id: Cn++,
332
+ id: Ln++,
333
333
  name: e.url,
334
334
  stream: e.stream,
335
335
  sent_at: Date.now(),
@@ -356,7 +356,7 @@ const Di = () => (t) => async (e) => {
356
356
  };
357
357
  return window.postMessage(i), {
358
358
  ...n,
359
- message: Fi(r, n.message)
359
+ message: Di(r, n.message)
360
360
  };
361
361
  } else {
362
362
  r.response.message = n.message, r.latency = r.received_at - r.sent_at;
@@ -420,7 +420,7 @@ var Z;
420
420
  (function(t) {
421
421
  t.Init = "init", t.Ready = "ready", t.Connecting = "connecting", t.Connected = "connected", t.Disconnected = "disconnected", t.Failed = "failed", t.Reconnect = "reconnect", t.Reconnecting = "reconnecting";
422
422
  })(Z || (Z = {}));
423
- class Ri {
423
+ class Vi {
424
424
  params;
425
425
  streamCancel;
426
426
  method;
@@ -438,13 +438,13 @@ class Ri {
438
438
  ts: /* @__PURE__ */ new Date(),
439
439
  log: []
440
440
  };
441
- this.state = new Le(te(o), `subscription:${i.name}:state`), this.options = {
441
+ this.state = new Ce(te(o), `subscription:${i.name}:state`), this.options = {
442
442
  ...i,
443
443
  reconnectDelay: i.reconnectDelay ?? 1e3,
444
444
  reconnectMaxDelay: i.reconnectMaxDelay ?? 3e4,
445
445
  reconnectMaxAttempts: i.reconnectMaxAttempts ?? 10,
446
446
  withStore: i.withStore ?? !1
447
- }, this.headers = e, this.listeners = /* @__PURE__ */ new Map(), this.params = n, this.method = r, i.withStore && (this.store = new Y(B(null), `subscription:${i.name}:store`)), "subscribe" in n && typeof n.subscribe == "function" && (this.paramsListener = n.subscribe((s) => {
447
+ }, this.headers = e, this.listeners = /* @__PURE__ */ new Map(), this.params = n, this.method = r, i.withStore && (this.store = new Y(x(null), `subscription:${i.name}:store`)), "subscribe" in n && typeof n.subscribe == "function" && (this.paramsListener = n.subscribe((s) => {
448
448
  this.state.getValue("status") === Z.Connected && (this.addStateLog(`params updated, reconnect => ${JSON.stringify(s)}`), this.reconnect());
449
449
  })), this.updateState(Z.Ready);
450
450
  }
@@ -479,7 +479,7 @@ class Ri {
479
479
  for await (const o of i)
480
480
  this.attempt = 0, this.onData(o);
481
481
  } catch (n) {
482
- n instanceof tt && n.code != se.Canceled && this.onStreamError(n);
482
+ n instanceof tt && n.code != oe.Canceled && this.onStreamError(n);
483
483
  }
484
484
  })(), this.updateState(Z.Connected);
485
485
  };
@@ -519,7 +519,7 @@ class Ri {
519
519
  */
520
520
  onStreamError = (e) => {
521
521
  if (this.addStateLog(`error => ${e ? JSON.stringify(e) : "undefined"}}`), e !== void 0) {
522
- if (e instanceof tt && e.code !== se.Canceled) {
522
+ if (e instanceof tt && e.code !== oe.Canceled) {
523
523
  this.updateState(Z.Failed), this.state.setValue("error", e), this.reconnect();
524
524
  return;
525
525
  }
@@ -527,15 +527,15 @@ class Ri {
527
527
  }
528
528
  };
529
529
  }
530
- const Vi = /* @__PURE__ */ new Set([
531
- se.Unknown,
532
- se.Internal,
533
- se.DeadlineExceeded,
534
- se.ResourceExhausted,
535
- se.FailedPrecondition,
536
- se.Unavailable,
537
- se.DataLoss
538
- ]), Qr = le("grpc:retry"), $i = (t) => async (e) => {
530
+ const $i = /* @__PURE__ */ new Set([
531
+ oe.Unknown,
532
+ oe.Internal,
533
+ oe.DeadlineExceeded,
534
+ oe.ResourceExhausted,
535
+ oe.FailedPrecondition,
536
+ oe.Unavailable,
537
+ oe.DataLoss
538
+ ]), Qr = be("grpc:retry"), Mi = (t) => async (e) => {
539
539
  const r = e.contextValues.get(sr.retryAttempts), n = 300, i = e.contextValues.get(sr.retryDelay);
540
540
  if (e.stream || r === 0)
541
541
  return t(e);
@@ -546,7 +546,7 @@ const Vi = /* @__PURE__ */ new Set([
546
546
  } catch (s) {
547
547
  Qr.trace({ attempt: o, error: s }, "retry attempt");
548
548
  const a = tt.from(s);
549
- if (o >= r || !(a instanceof tt) || !Vi.has(a.code))
549
+ if (o >= r || !(a instanceof tt) || !$i.has(a.code))
550
550
  throw s;
551
551
  const u = Math.min(i, Math.pow(2, o) * n), f = Math.round(u * (1 + Math.random()) / 2);
552
552
  await new Promise((c) => setTimeout(c, f));
@@ -554,13 +554,13 @@ const Vi = /* @__PURE__ */ new Set([
554
554
  }, sr = {
555
555
  retryAttempts: $r(10, { description: "Number of attempts to retry" }),
556
556
  retryDelay: $r(3e4, { description: "Max delay between retries in milliseconds" })
557
- }, Mi = () => {
557
+ }, ji = () => {
558
558
  const t = localStorage.getItem("sl-device-id");
559
559
  if (t)
560
560
  return t;
561
561
  const e = nr();
562
562
  return localStorage.setItem("sl-device-id", e), e;
563
- }, ji = () => navigator.userAgentData?.platform || navigator.platform;
563
+ }, Ui = () => navigator.userAgentData?.platform || navigator.platform;
564
564
  class Gr {
565
565
  toJsonOptions = {
566
566
  emitDefaultValues: !1,
@@ -580,9 +580,9 @@ class Gr {
580
580
  subscriptions;
581
581
  opts;
582
582
  constructor(e, r) {
583
- this.host = e, this.opts = r, this.$headers = new Le(te({
584
- "sl-device-id": Mi(),
585
- "sl-device-os": ji()
583
+ this.host = e, this.opts = r, this.$headers = new Ce(te({
584
+ "sl-device-id": ji(),
585
+ "sl-device-os": Ui()
586
586
  }), "transport:headers"), this.initInterceptors(), this.clients = /* @__PURE__ */ new Map(), this.streamClients = /* @__PURE__ */ new Map(), this.subscriptions = /* @__PURE__ */ new Map();
587
587
  const [n, i, o] = Ur({
588
588
  dedupeTime: r?.dedupeTime,
@@ -606,7 +606,7 @@ class Gr {
606
606
  const i = this.subscriptions.get(r);
607
607
  if (i)
608
608
  return i;
609
- const o = new Ri(this.$headers, e, r, n);
609
+ const o = new Vi(this.$headers, e, r, n);
610
610
  return this.subscriptions.set(r, o), o;
611
611
  };
612
612
  removeSubscription = (e) => {
@@ -651,10 +651,10 @@ class Gr {
651
651
  ...Array.isArray(r) ? r : [r]
652
652
  ], a = [e.typeName, o.charAt(0).toLowerCase() + o.slice(1)];
653
653
  return { client: i, createRequestOptions: (f) => {
654
- const c = Si();
655
- for (const h in f) {
656
- const l = sr[h];
657
- c.set(l, f[h]);
654
+ const c = wi();
655
+ for (const l in f) {
656
+ const h = sr[l];
657
+ c.set(h, f[l]);
658
658
  }
659
659
  return c;
660
660
  }, queryKey: s, queryKeyStr: a.join("") };
@@ -679,10 +679,10 @@ class Gr {
679
679
  n.header.set(o, i[o]);
680
680
  return r(n);
681
681
  };
682
- this.interceptors.push(e), this.interceptors.push(Di()), this.opts?.retryable && this.interceptors.push($i);
682
+ this.interceptors.push(e), this.interceptors.push(Ri()), this.opts?.retryable && this.interceptors.push(Mi);
683
683
  };
684
684
  }
685
- const Ui = (t, e) => {
685
+ const Bi = (t, e) => {
686
686
  const { client: r, queryKey: n } = e.createPromiseClient(wn, {
687
687
  method: "retrieveEventId",
688
688
  params: [t]
@@ -700,22 +700,22 @@ const Ui = (t, e) => {
700
700
  }
701
701
  }
702
702
  });
703
- }, Bi = (t, e) => {
704
- const { client: r, queryKey: n } = e.createPromiseClient(it, { method: "getStream", params: [t] });
703
+ }, qi = (t, e) => {
704
+ const { client: r, queryKey: n } = e.createPromiseClient(nt, { method: "getStream", params: [t] });
705
705
  return e.nanoquery.createFetcherStore(n, {
706
706
  fetcher: async (i, o, s) => s ? (await r.getStream({
707
707
  id: s
708
708
  // we are sure that id is a string
709
709
  })).data?.attributes : void 0
710
710
  });
711
- }, qi = (t, e) => {
711
+ }, xi = (t, e) => {
712
712
  const { client: r, queryKey: n } = e.createPromiseClient(wn, { method: "summary", params: [t] });
713
713
  return e.nanoquery.createFetcherStore(n, {
714
714
  fetcher: async (i, o, s) => s ? (await r.summary({
715
715
  id: s
716
716
  })).data?.attributes : void 0
717
717
  });
718
- }, xi = (t, e) => {
718
+ }, Qi = (t, e) => {
719
719
  const { queryKey: r, client: n } = e.createPromiseClient(vr, { method: "me", params: [t] });
720
720
  return e.nanoquery.createFetcherStore(r, {
721
721
  fetcher: async () => {
@@ -723,16 +723,16 @@ const Ui = (t, e) => {
723
723
  return { data: i };
724
724
  }
725
725
  });
726
- }, Qi = (t) => {
726
+ }, Gi = (t) => {
727
727
  const { client: e, createRequestOptions: r } = t.createPromiseClient(vr, { method: "bypassAuth" }), n = r({ retryAttempts: 0 });
728
728
  return ({ userKey: i, schema: o, init: s, inviterKey: a }) => e.bypassAuth({ userKey: i, schema: o, init: s, inviterKey: a }, { contextValues: n });
729
- }, Gi = (t, e) => {
730
- const { client: r, queryKey: n } = e.createPromiseClient(it, { method: "get", params: [t] });
729
+ }, Ki = (t, e) => {
730
+ const { client: r, queryKey: n } = e.createPromiseClient(nt, { method: "get", params: [t] });
731
731
  return e.nanoquery.createFetcherStore(n, {
732
732
  fetcher: async () => (await r.get({})).data?.attributes
733
733
  });
734
- }, Ki = (t, e) => {
735
- const { client: r, queryKey: n } = e.createPromiseClient(it, { method: "getOrganization", params: [t] });
734
+ }, zi = (t, e) => {
735
+ const { client: r, queryKey: n } = e.createPromiseClient(nt, { method: "getOrganization", params: [t] });
736
736
  return e.nanoquery.createFetcherStore(n, {
737
737
  fetcher: async () => {
738
738
  const i = await r.getOrganization({});
@@ -742,15 +742,15 @@ const Ui = (t, e) => {
742
742
  } : void 0;
743
743
  }
744
744
  });
745
- }, zi = (t, e) => {
746
- const { client: r, queryKey: n } = e.createPromiseClient(it, {
745
+ }, Hi = (t, e) => {
746
+ const { client: r, queryKey: n } = e.createPromiseClient(nt, {
747
747
  method: "getOrganizationAdvertising",
748
748
  params: [t]
749
749
  });
750
750
  return e.nanoquery.createFetcherStore(n, {
751
751
  fetcher: async () => (await r.getOrganizationAdvertising({})).data?.attributes
752
752
  });
753
- }, Hi = (t, e, r) => {
753
+ }, Wi = (t, e, r) => {
754
754
  t.transport = new Gr(e.host, {
755
755
  dedupeTime: 1e3 * 60 * 5,
756
756
  refetchInterval: 1e3 * 60 * 5,
@@ -761,50 +761,50 @@ const Ui = (t, e) => {
761
761
  t.transport.disconnect(), t.analyticsTransport.disconnect();
762
762
  }), r();
763
763
  };
764
- var pe;
764
+ var he;
765
765
  (function(t) {
766
766
  t.SCHEMA = "schema", t.EXTERNAL_TOKEN = "eToken", t.TOKEN = "token";
767
- })(pe || (pe = {}));
767
+ })(he || (he = {}));
768
768
  class Ue extends He {
769
769
  constructor() {
770
770
  super("user");
771
771
  }
772
772
  // Schema
773
773
  setSchema = (e) => {
774
- this.write(pe.SCHEMA, e);
774
+ this.write(he.SCHEMA, e);
775
775
  };
776
- getSchema = () => this.read(pe.SCHEMA);
776
+ getSchema = () => this.read(he.SCHEMA);
777
777
  // Token
778
778
  setToken = (e) => {
779
- this.write(pe.TOKEN, e);
779
+ this.write(he.TOKEN, e);
780
780
  };
781
- getToken = () => this.read(pe.TOKEN);
781
+ getToken = () => this.read(he.TOKEN);
782
782
  // External Token
783
783
  setExternalToken = (e) => {
784
- this.write(pe.EXTERNAL_TOKEN, e);
784
+ this.write(he.EXTERNAL_TOKEN, e);
785
785
  };
786
- getExternalToken = () => this.read(pe.EXTERNAL_TOKEN);
786
+ getExternalToken = () => this.read(he.EXTERNAL_TOKEN);
787
787
  removeToken = () => {
788
- this.remove(pe.TOKEN);
788
+ this.remove(he.TOKEN);
789
789
  };
790
790
  }
791
- var ge;
791
+ var ye;
792
792
  (function(t) {
793
793
  t.DISABLED = "disabled", t.INITIALIZATION = "initialization", t.READY = "ready", t.FAILED = "failed", t.SUSPENDED = "suspended";
794
- })(ge || (ge = {}));
795
- const Wi = (t) => {
796
- const e = new Ue(), r = new Y(B(e.getExternalToken()), "userKey"), n = new Y(B(e.getToken()), "userToken"), i = new re(xi(n.getStore(), t), "user", ({ data: s, error: a, loading: u }, f) => {
794
+ })(ye || (ye = {}));
795
+ const Yi = (t) => {
796
+ const e = new Ue(), r = new Y(x(e.getExternalToken()), "userKey"), n = new Y(x(e.getToken()), "userToken"), i = new ce(Qi(n.getStore(), t), "user", ({ data: s, error: a, loading: u }, f) => {
797
797
  if (!a)
798
798
  return s?.data?.id ? s.data.id : u === !1 ? void 0 : f;
799
- }), o = new re(Gi(n.getStore(), t), "userSettings");
799
+ }), o = new ce(Ki(n.getStore(), t), "userSettings");
800
800
  return {
801
801
  userKey: r,
802
802
  userToken: n,
803
803
  user: i,
804
804
  userSettings: o
805
805
  };
806
- }, Yi = (t) => {
807
- const e = new Y(B(void 0), "providerStreamId"), r = new re(Ui(e.getStore(), t), "slStreamId", (o) => o?.data), n = new re(Bi(r.getAtomStore(), t), "streamSettings"), i = new re(qi(r.getAtomStore(), t), "streamSettings");
806
+ }, Ji = (t) => {
807
+ const e = new Y(x(void 0), "providerStreamId"), r = new ce(Bi(e.getStore(), t), "slStreamId", (o) => o?.data), n = new ce(qi(r.getAtomStore(), t), "streamSettings"), i = new ce(xi(r.getAtomStore(), t), "streamSettings");
808
808
  return r.getAtomStore().listen((o) => {
809
809
  (o === "" || o === void 0) && (n.getStore().mutate(void 0), i.getStore().mutate(void 0));
810
810
  }), {
@@ -813,8 +813,8 @@ const Wi = (t) => {
813
813
  streamSettings: n,
814
814
  streamSummary: i
815
815
  };
816
- }, Ji = (t) => {
817
- const e = new Y(B(void 0), "enabled"), r = new Y(B(ge.DISABLED), "status"), n = new re(Ki(e.getStore(), t), "organizationSettings", (a) => a?.data?.id), i = new re(zi(n.getAtomStore(), t), "organizationAdvertising"), o = Wi(t), s = Yi(t);
816
+ }, Xi = (t) => {
817
+ const e = new Y(x(void 0), "enabled"), r = new Y(x(ye.DISABLED), "status"), n = new ce(zi(e.getStore(), t), "organizationSettings", (a) => a?.data?.id), i = new ce(Hi(n.getAtomStore(), t), "organizationAdvertising"), o = Yi(t), s = Ji(t);
818
818
  return {
819
819
  enabled: e,
820
820
  status: r,
@@ -830,10 +830,10 @@ const Wi = (t) => {
830
830
  organizationAdvertising: i
831
831
  };
832
832
  };
833
- class Xi extends kt {
833
+ class Zi extends kt {
834
834
  stores;
835
835
  constructor(e) {
836
- const r = Ji(e), n = Pi(r);
836
+ const r = Xi(e), n = Ni(r);
837
837
  super(n, "core"), this.stores = r;
838
838
  }
839
839
  getValue() {
@@ -854,17 +854,17 @@ class Xi extends kt {
854
854
  };
855
855
  unsubscribe = () => this.getStore().off();
856
856
  }
857
- const Zi = (t, e, r) => {
858
- t.store = new Xi(t.transport), t.stores = t.store.getValues(), t.sdk.enabled = t.stores.enabled.getStore(), t.sdk.status = t.stores.status.getStore(), t.sdk.sdkStore = Object.fromEntries(Object.entries(t.stores).map(([n, i]) => [n, i.getStore()])), t.sdk.organizationStore = () => t.stores.organizationSettings.getStore(), t.sdk.streamStore = () => t.stores.streamSettings.getStore(), t.sdk.streamSummary = () => t.stores.streamSummary.getStore(), t.storeUnsubscribe = () => {
857
+ const eo = (t, e, r) => {
858
+ t.store = new Zi(t.transport), t.stores = t.store.getValues(), t.sdk.enabled = t.stores.enabled.getStore(), t.sdk.status = t.stores.status.getStore(), t.sdk.sdkStore = Object.fromEntries(Object.entries(t.stores).map(([n, i]) => [n, i.getStore()])), t.sdk.organizationStore = () => t.stores.organizationSettings.getStore(), t.sdk.streamStore = () => t.stores.streamSettings.getStore(), t.sdk.streamSummary = () => t.stores.streamSummary.getStore(), t.storeUnsubscribe = () => {
859
859
  t.store.unsubscribe();
860
860
  }, r();
861
- }, eo = (t) => {
861
+ }, to = (t) => {
862
862
  const { client: e } = t.createPromiseClient(An, { method: "list" });
863
863
  return (r) => e.list(r);
864
864
  }, Pn = (t) => {
865
865
  const { client: e } = t.createPromiseClient(An, { method: "summary" });
866
866
  return (r) => e.summary(r);
867
- }, to = (t, e) => {
867
+ }, ro = (t, e) => {
868
868
  const { client: r, queryKey: n } = e.createPromiseClient(vr, {
869
869
  method: "getFriends",
870
870
  params: [t]
@@ -880,8 +880,8 @@ const Zi = (t, e, r) => {
880
880
  }
881
881
  }
882
882
  });
883
- }, ro = (t, e) => {
884
- const { client: r, queryKey: n } = e.createPromiseClient(ne, { method: "get", params: [t] });
883
+ }, no = (t, e) => {
884
+ const { client: r, queryKey: n } = e.createPromiseClient(re, { method: "get", params: [t] });
885
885
  return e.nanoquery.createFetcherStore(n, {
886
886
  fetcher: async (i, o, s) => (await r.get({
887
887
  eventId: s
@@ -889,8 +889,8 @@ const Zi = (t, e, r) => {
889
889
  refetchInterval: 0,
890
890
  dedupeTime: 1e3 * 60 * 60
891
891
  });
892
- }, no = (t, e) => {
893
- const { client: r, queryKey: n } = e.createPromiseClient(ne, { method: "syncQuestion", params: [t] });
892
+ }, io = (t, e) => {
893
+ const { client: r, queryKey: n } = e.createPromiseClient(re, { method: "syncQuestion", params: [t] });
894
894
  return e.nanoquery.createFetcherStore(n, {
895
895
  fetcher: async (i, o, s) => s ? (await r.syncQuestion({
896
896
  filter: {
@@ -901,36 +901,39 @@ const Zi = (t, e, r) => {
901
901
  // 10 minutes
902
902
  refetchInterval: 0
903
903
  });
904
- }, io = async (t, e) => {
905
- const { client: r } = e.createPromiseClient(ne, { method: "item", params: [t] });
904
+ }, oo = async (t, e) => {
905
+ const { client: r } = e.createPromiseClient(re, { method: "item", params: [t] });
906
906
  return (await r.item({
907
907
  id: t
908
908
  })).data;
909
- }, oo = (t, e) => {
910
- const { client: r } = e.createStreamClient(ne), n = Ct({ eventId: t.get() || "", feedId: "" });
909
+ }, so = (t, e) => {
910
+ const { client: r } = e.createStreamClient(re), n = Ct({ eventId: t.get() || "", feedId: "" });
911
911
  return t.subscribe((o = "") => {
912
912
  n.set({ eventId: o, feedId: "" });
913
913
  }), e.addSubscription(r.subscription, n, { name: "feedSubscription" });
914
- }, so = (t, e) => {
915
- const { client: r } = e.createStreamClient(ne);
914
+ }, ao = (t, e) => {
915
+ const { client: r } = e.createStreamClient(re);
916
916
  return e.addSubscription(r.questionSubscription, { questionId: t }, { name: "questionSubscription" });
917
917
  }, ar = (t, e) => {
918
- const { client: r, queryKey: n } = e.createPromiseClient(ne, { method: "questionByUser", params: [t] });
918
+ const { client: r, queryKey: n } = e.createPromiseClient(re, { method: "questionByUser", params: [t] });
919
919
  return e.nanoquery.createFetcherStore(n, {
920
920
  fetcher: async (i, o, s) => (await r.questionByUser({
921
921
  questionId: s
922
922
  })).data?.attributes?.question,
923
923
  dedupeTime: 1e3 * 60 * 5
924
924
  });
925
- }, ao = async (t, e) => {
925
+ }, Nn = async (t, e) => {
926
926
  if (!t)
927
927
  return;
928
- const { client: r } = e.createPromiseClient(ne, { method: "getQuestion", params: [t] }), n = await r.getQuestion({
928
+ const { client: r } = e.createPromiseClient(re, { method: "getQuestion", params: [t] }), n = await r.getQuestion({
929
929
  id: t
930
- }), i = n.data?.attributes?.options?.options.case === "promotion" ? n.data?.attributes?.options?.options.value : void 0;
931
- return i ? { promotions: i, notification: n.data?.attributes?.notification } : void 0;
930
+ });
931
+ if (!n.data?.attributes)
932
+ return;
933
+ const { options: i, notification: o, ...s } = n.data.attributes, a = i?.options.case === "promotion" ? i?.options.value : void 0;
934
+ return { id: s.id, question: s, promotion: a, notification: o };
932
935
  }, uo = (t, e, r) => {
933
- const { client: n, queryKey: i } = r.createPromiseClient(ne, {
936
+ const { client: n, queryKey: i } = r.createPromiseClient(re, {
934
937
  method: "list",
935
938
  params: [t, e]
936
939
  });
@@ -938,32 +941,36 @@ const Zi = (t, e, r) => {
938
941
  fetcher: async (o, s, a, u) => a ? (await n.list({
939
942
  eventId: a,
940
943
  filter: {
941
- types: u === Ce.ALLOWED ? [] : [F.FACTOID, F.PROMOTION, F.TWEET],
942
- statuses: [H.ACTIVE, H.RESOLVED]
944
+ types: u === Le.ALLOWED ? [] : [_.FACTOID, _.PROMOTION, _.TWEET],
945
+ statuses: [W.ACTIVE, W.RESOLVED]
943
946
  }
944
947
  })).data : [],
945
948
  dedupeTime: 0,
946
949
  refetchInterval: 0
947
950
  });
948
951
  }, co = (t, e) => {
949
- const { client: r, queryKey: n } = e.createPromiseClient(ne, {
952
+ const { client: r, queryKey: n } = e.createPromiseClient(re, {
950
953
  method: "list",
951
954
  params: [t]
952
955
  });
953
956
  return e.nanoquery.createFetcherStore(n, {
954
- fetcher: async (i, o, s) => s ? (await r.list({
955
- eventId: s,
956
- filter: {
957
- types: [F.PROMOTION],
958
- statuses: [H.ACTIVE]
959
- }
960
- })).data.map(({ attributes: u }) => {
961
- if (!(!u || u.attributes.case !== "promotion"))
962
- return {
963
- ...u,
964
- attributes: u.attributes.value
965
- };
966
- }).filter(Boolean) : [],
957
+ fetcher: async (i, o, s) => {
958
+ if (!s)
959
+ return;
960
+ const u = (await r.list({
961
+ eventId: s,
962
+ filter: {
963
+ types: [_.PROMOTION],
964
+ statuses: [W.ACTIVE]
965
+ },
966
+ pagination: {
967
+ page: 0,
968
+ pageSize: 1
969
+ }
970
+ })).data?.[0];
971
+ if (u.type === "promotion")
972
+ return Nn(u.id, e);
973
+ },
967
974
  dedupeTime: 0,
968
975
  refetchInterval: 0
969
976
  });
@@ -976,19 +983,19 @@ const Zi = (t, e, r) => {
976
983
  return u ? (u.openedFrom = f, u) : a.question;
977
984
  }), i = Vr(n, (a) => a && a.type === "question" ? a.id : void 0), o = ar(i, t);
978
985
  return { $store: n, $extendedStore: o, updateExtendedQuestion: (a) => {
979
- const u = o.get().data, f = (c, h) => {
980
- if (!c || !h)
981
- return c || h || [];
982
- const l = [];
986
+ const u = o.get().data, f = (c, l) => {
987
+ if (!c || !l)
988
+ return c || l || [];
989
+ const h = [];
983
990
  for (let g = 0; g < c.length; g++)
984
- l.push({
991
+ h.push({
985
992
  ...c[g],
986
- ...h[g],
993
+ ...l[g],
987
994
  correct: c[g].correct,
988
995
  youVoted: c[g].youVoted,
989
996
  pointsEarned: c[g].pointsEarned
990
997
  });
991
- return l;
998
+ return h;
992
999
  };
993
1000
  o.mutate({
994
1001
  ...a,
@@ -999,202 +1006,100 @@ const Zi = (t, e, r) => {
999
1006
  });
1000
1007
  } };
1001
1008
  };
1002
- var St;
1009
+ var bt;
1003
1010
  (function(t) {
1004
1011
  t.SHOWED = "showed";
1005
- })(St || (St = {}));
1012
+ })(bt || (bt = {}));
1006
1013
  class fo extends He {
1007
1014
  constructor() {
1008
1015
  super("advertisement");
1009
1016
  }
1010
1017
  setShowed = (e) => {
1011
- this.write(St.SHOWED, e, "true");
1018
+ this.write(bt.SHOWED, e, "true");
1012
1019
  };
1013
- isShowed = (e) => this.read(St.SHOWED, e);
1020
+ isViewed = (e) => this.read(bt.SHOWED, e);
1014
1021
  }
1015
- class ho {
1016
- advertisementList;
1017
- store;
1018
- timeouts;
1019
- waitingQueue;
1020
- activeQueue;
1021
- options;
1022
- logger;
1023
- constructor(e) {
1024
- this.options = e, this.logger = le("advertisement_queue"), this.store = /* @__PURE__ */ new Map(), this.timeouts = /* @__PURE__ */ new Map(), this.waitingQueue = /* @__PURE__ */ new Set(), this.activeQueue = /* @__PURE__ */ new Set(), this.advertisementList = B(/* @__PURE__ */ new Map());
1025
- }
1026
- addToQueue = (e) => {
1027
- if (this.store.has(e.id)) {
1028
- this.logger.debug({ advertisement: e }, "skip existed advertisement: %o");
1029
- return;
1030
- }
1031
- const r = e.close, n = e.action;
1032
- if (this.store.set(e.id, {
1033
- ...e,
1034
- close: (...i) => {
1035
- r && r(...i), this.closeAdvertisement(e.id);
1036
- },
1037
- action: (...i) => {
1038
- n && n(...i), this.closeAdvertisement(e.id, { animateHiding: !1 });
1039
- }
1040
- }), this.waitingQueue.add(e.id), this.activeQueue.size === this.options.concurrency) {
1041
- const [i] = this.activeQueue;
1042
- this.closeAdvertisement(i);
1043
- } else
1044
- this.tickWaitingQueue();
1045
- };
1046
- tickWaitingQueue = () => {
1047
- if (this.activeQueue.size < this.options.concurrency) {
1048
- const [e] = this.waitingQueue;
1049
- if (!e)
1050
- return;
1051
- this.activeQueue.add(e), this.waitingQueue.delete(e), this.logger.debug({ job: e }, "waiting queue tick"), this.tickActiveQueue(e);
1052
- } else
1053
- this.logger.debug({ queueSize: this.activeQueue.size, concurrency: this.options.concurrency }, "waiting queue tick skipped");
1054
- };
1055
- tickActiveQueue = (e) => {
1056
- if (!e)
1057
- return;
1058
- const r = this.store.get(e);
1059
- if (!r) {
1060
- this.logger.debug({ advertisementId: e }, "active queue tick skipped, advertisement not exist");
1061
- return;
1062
- }
1063
- const n = setTimeout(() => {
1064
- const i = e, o = new Map(this.advertisementList.get());
1065
- if (o.set(r.id, r), this.advertisementList.set(o), r.autoHideDuration !== 1 / 0) {
1066
- const s = setTimeout(() => {
1067
- this.logger.debug({ advertisementId: i, delay: r.autoHideDuration || 5e3 }, "advertisement hiding by autoHideDuration"), this.closeAdvertisement(i);
1068
- }, r.autoHideDuration || 5e3);
1069
- this.timeouts.set(i, s);
1070
- }
1071
- this.logger.debug({ advertisementId: i, queue: [...o.values()] }, "advertisement displayed");
1072
- }, r.delay || 0);
1073
- this.timeouts.set(e, n), this.logger.debug({ advertisementId: e }, "active queue tick completed"), this.tickWaitingQueue();
1074
- };
1075
- removeFromList = (e) => {
1076
- const r = new Map(this.advertisementList.get());
1077
- r.delete(e), this.advertisementList.set(r), this.store.delete(e), this.activeQueue.delete(e), this.waitingQueue.delete(e), this.logger.debug({ advertisementId: e }, "advertisement removed from list");
1078
- };
1079
- closeAdvertisement = (e, { animateHiding: r = !0 } = {}) => {
1080
- const n = new Map(this.advertisementList.get()), i = n.get(e);
1081
- if (i) {
1082
- i.hiding = !(this.waitingQueue.size >= this.options.concurrency) && r, this.advertisementList.set(n);
1083
- const o = setTimeout(() => {
1084
- const s = new Map(this.advertisementList.get());
1085
- s.delete(e), this.advertisementList.set(s);
1086
- const a = this.timeouts.get(e);
1087
- a !== void 0 && (clearTimeout(a), this.timeouts.delete(e)), this.logger.debug({ advertisementId: e }, "advertisement hidden");
1088
- }, r && this.options.animationDelay || 0);
1089
- this.timeouts.set(e, o);
1090
- }
1091
- return this.store.delete(e), this.activeQueue.delete(e), this.waitingQueue.delete(e), this.tickWaitingQueue(), this.logger.debug({ advertisementId: e }, "advertisement hiding"), i;
1022
+ const ho = (t) => {
1023
+ const e = t.data?.attributes?.question;
1024
+ if ((t.data?.attributes?.feedItem?.type === "promotion" ? t.data.attributes.feedItem : void 0) === void 0 || !e)
1025
+ return;
1026
+ const { options: n, notification: i, ...o } = e, s = n?.options.case === "promotion" ? n.options.value : void 0;
1027
+ return {
1028
+ id: o.id,
1029
+ question: o,
1030
+ notification: i,
1031
+ promotion: s
1092
1032
  };
1093
- drain = () => {
1094
- this.store.clear(), this.timeouts.clear(), this.waitingQueue.clear(), this.activeQueue.clear(), this.advertisementList.off(), this.advertisementList.set(/* @__PURE__ */ new Map());
1033
+ }, po = (t, e, r) => {
1034
+ const n = r.transport, i = be("advertisement"), o = new fo(), s = te({}), a = co(t, n), u = (l, h) => {
1035
+ h ? s.set({
1036
+ loading: !1,
1037
+ error: void 0,
1038
+ data: h,
1039
+ close: () => c(h.question.id),
1040
+ isViewed: !!o.isViewed(h.question.id)
1041
+ }) : (s.setKey("loading", !0), Nn(l, n).then((g) => s.set({
1042
+ loading: !1,
1043
+ error: void 0,
1044
+ data: g,
1045
+ close: () => c(g?.question.id),
1046
+ isViewed: g && !!o.isViewed(g.question.id)
1047
+ })).catch((g) => s.set({
1048
+ loading: !1,
1049
+ error: g,
1050
+ data: void 0
1051
+ })));
1095
1052
  };
1096
- }
1097
- const po = (t, e, r) => {
1098
- const n = r.transport, i = le("advertisement_queue"), o = new ho({ concurrency: 1, animationDelay: 1e3 }), s = new fo(), a = new re(co(t, n), "gamification:promotionList"), u = (l, g) => {
1099
- J.emit("advertisement", {
1053
+ a.subscribe((l, h) => {
1054
+ l.data && (J.emit("advertisement", {
1100
1055
  action: "received",
1101
1056
  payload: {
1102
- advertisementId: l,
1103
- advertisementType: g?.promotions.type
1057
+ advertisementId: l.data.question.id,
1058
+ advertisementType: l.data?.promotion?.type
1104
1059
  }
1105
- }), o.addToQueue({
1106
- id: l,
1107
- autoHideDuration: 1 / 0,
1108
- data: te({ loading: !1, error: void 0, data: void 0 }),
1109
- close: () => c(l),
1110
- promise: async function() {
1111
- this.data.setKey("loading", !0);
1112
- try {
1113
- const v = g || await ao(l, n);
1114
- r.sdk.onAdvertisementActivate({
1115
- stage: "activate",
1116
- id: l,
1117
- hasNotification: v?.notification?.enabled === gi.NOTIFICATION_ENABLED,
1118
- isShowed: !!s.isShowed(l)
1119
- }), v ? this.data.setKey("data", v) : this.data.setKey("error", new Error("No promotion found"));
1120
- } catch (v) {
1121
- this.data.setKey("error", v);
1122
- } finally {
1123
- this.data.setKey("loading", !1);
1124
- }
1125
- }
1126
- });
1127
- }, f = (l) => {
1128
- i.debug({ notificationId: l }, "markAsViewed: %o"), s.setShowed(l);
1129
- }, c = (l) => {
1130
- o.closeAdvertisement(l), f(l), r.sdk.onAdvertisementActivate({
1131
- stage: "deactivate",
1132
- id: l
1133
- });
1134
- }, h = (l) => {
1135
- const g = o.advertisementList.get();
1136
- if (!g?.size)
1137
- return null;
1138
- const v = g.values().next().value, w = v.data.get();
1139
- return !l && s.isShowed(v.id) ? (o.removeFromList(v.id), h(l)) : (!w.data && !w.error && !w.loading && v.promise(), J.emit("advertisement", {
1060
+ }), (!h?.data || l.data.id !== h.data.id) && u(l.data.question.id, l.data));
1061
+ }), s.subscribe((l, h) => {
1062
+ l.data && (r.sdk.onAdvertisementActivate({
1063
+ stage: "activate",
1064
+ id: l.data.question.id,
1065
+ hasNotification: l.data.notification?.enabled === gi.NOTIFICATION_ENABLED,
1066
+ isViewed: !!o.isViewed(l.data.question.id)
1067
+ }), J.emit("advertisement", {
1140
1068
  action: "opened",
1141
1069
  payload: {
1142
- advertisementId: v.id,
1143
- advertisementType: w.data?.promotions.type
1070
+ advertisementId: l.data.question.id,
1071
+ advertisementType: l.data?.promotion?.type
1144
1072
  }
1145
- }), v);
1073
+ })), !l?.data && h?.data && r.sdk.onAdvertisementActivate({
1074
+ stage: "deactivate",
1075
+ id: h.data.question.id,
1076
+ isViewed: !!o.isViewed(h.data.question.id)
1077
+ });
1078
+ });
1079
+ const f = (l) => {
1080
+ i.debug({ notificationId: l }, "markAsViewed: %o"), o.setShowed(l);
1081
+ }, c = (l) => {
1082
+ (!l || s.get()?.data?.question.id === l) && s.set({}), l && f(l);
1146
1083
  };
1147
- return a.subscribe((l) => {
1148
- if (l.data) {
1149
- const g = l.data[l.data.length - 1];
1150
- g && u(g.id);
1151
- }
1152
- }), e.addListener("promotion cb", (l) => {
1153
- const g = l.data?.attributes?.feedItem?.attributes?.attributes?.case === "promotion" ? l.data.attributes.feedItem.attributes : void 0, v = l.data?.attributes?.question?.options?.options.case === "promotion" ? l.data.attributes.question.options.options.value : void 0;
1154
- if (g === void 0 || v === void 0) {
1155
- i.debug("not promotion");
1156
- return;
1157
- }
1158
- if (g.status === H.RESOLVED) {
1159
- c(g.id), i.debug({ feedItem: g }, "resolved: %o");
1160
- return;
1161
- }
1162
- if (g.status === H.ACTIVE) {
1163
- i.debug({ feedItem: g }, "active: %o"), u(g.id);
1164
- return;
1165
- }
1166
- i.debug({ feedItem: g }, "skip: %o");
1167
- }), nt(o.advertisementList, () => {
1168
- a.subscribe((l) => {
1169
- if (l.data) {
1170
- const g = l.data[l.data.length - 1];
1171
- g && u(g.id);
1172
- }
1173
- }), e.addListener("promotion", (l) => {
1174
- const g = l.data?.attributes?.feedItem?.attributes?.attributes?.case === "promotion" ? l.data.attributes.feedItem.attributes : void 0, v = l.data?.attributes?.question?.options?.options.case === "promotion" ? l.data.attributes.question.options.options.value : void 0;
1175
- if (g === void 0 || v === void 0) {
1176
- i.debug("not promotion");
1084
+ return e.addListener("promotion", (l) => {
1085
+ const h = ho(l);
1086
+ if (h) {
1087
+ if (h.question.status === W.RESOLVED) {
1088
+ c(h.question.id), i.debug({ promotion: h }, "resolved: %o");
1177
1089
  return;
1178
1090
  }
1179
- if (g.status === H.RESOLVED) {
1180
- c(g.id), i.debug({ feedItem: g }, "resolved: %o");
1091
+ if (h.question.status === W.ACTIVE) {
1092
+ i.debug({ promotion: h }, "active: %o"), u(h.question.id, h);
1181
1093
  return;
1182
1094
  }
1183
- if (g.status === H.ACTIVE) {
1184
- i.debug({ feedItem: g }, "active: %o"), u(g.id, {
1185
- promotions: v,
1186
- notification: l.data?.attributes?.question?.notification
1187
- });
1188
- return;
1189
- }
1190
- i.debug({ feedItem: g }, "skip: %o");
1191
- });
1192
- }), { hide: c, show: u, $list: o.advertisementList, getActiveAdvertisement: h };
1095
+ i.debug({ promotion: h }, "skip: %o");
1096
+ }
1097
+ }), { hide: c, show: u, $store: s };
1193
1098
  };
1194
- var Ce;
1099
+ var Le;
1195
1100
  (function(t) {
1196
1101
  t.ALLOWED = "allowed", t.DISALLOWED = "disallowed";
1197
- })(Ce || (Ce = {}));
1102
+ })(Le || (Le = {}));
1198
1103
  class yo {
1199
1104
  /** sl event id */
1200
1105
  slStreamId;
@@ -1228,17 +1133,37 @@ class yo {
1228
1133
  transport;
1229
1134
  cancels = /* @__PURE__ */ new Set();
1230
1135
  constructor(e) {
1231
- this.transport = e.transport, this.log = le("gamification-background"), this.slStreamId = e.stores.slStreamId.getAtomStore(), this.organizationId = e.stores.organizationSettings.getAtomStore(), this.userId = e.stores.user.getAtomStore(), this.moderationId = new Y(B(void 0), "moderationId").getStore(), this.interactiveAllowed = new Y(B(Ce.DISALLOWED), "interactiveAllowed").getStore(), this.openedQuestionId = new Y(B(void 0), "openedQuestionId").getStore(), this.notifications = e.notifications, this.moderation = new re(ro(this.slStreamId, e.transport), "gamification:moderation"), this.feedList = new re(uo(this.slStreamId, this.interactiveAllowed, e.transport), "gamification:feedList"), this.activeQuestionId = no(this.slStreamId, e.transport), this.openedQuestion = lo(e.transport, this.openedQuestionId, this.feedList.getStore()), this.cancels.add(this.openedQuestionId.listen((r) => {
1232
- this.log.debug({ item: r }, "received question"), r?.questionId ? (this.questionSubscription = so(r.questionId, e.transport), this.questionSubscription.addListener("feed-subscription-opened-question", (n) => {
1136
+ this.transport = e.transport, this.log = be("gamification-background"), this.slStreamId = e.stores.slStreamId.getAtomStore(), this.organizationId = e.stores.organizationSettings.getAtomStore(), this.userId = e.stores.user.getAtomStore(), this.moderationId = new Y(x(void 0), "moderationId").getStore(), this.interactiveAllowed = new Y(x(Le.DISALLOWED), "interactiveAllowed").getStore(), this.openedQuestionId = new Y(x(void 0), "openedQuestionId").getStore(), this.notifications = e.notifications, this.moderation = new ce(no(this.slStreamId, e.transport), "gamification:moderation"), this.feedList = new ce(uo(this.slStreamId, this.interactiveAllowed, e.transport), "gamification:feedList"), this.activeQuestionId = io(this.slStreamId, e.transport), this.openedQuestion = lo(e.transport, this.openedQuestionId, this.feedList.getStore()), this.cancels.add(this.openedQuestionId.listen((r) => {
1137
+ this.log.debug({ item: r }, "received question"), r?.questionId ? (this.questionSubscription = ao(r.questionId, e.transport), this.questionSubscription.addListener("feed-subscription-opened-question", (n) => {
1233
1138
  this.openedQuestion.updateExtendedQuestion(n.data?.attributes?.question);
1234
1139
  }), this.questionSubscription.connect()) : (this.log.info("cleanup on close question"), this.questionSubscription !== void 0 && (e.transport.removeSubscription(this.questionSubscription), this.questionSubscription = void 0));
1235
- })), this.feedSubscription = oo(this.slStreamId, e.transport), this.cancels.add(this.feedSubscription.addListener("feed-subscription-active-question", (r) => {
1140
+ })), this.feedSubscription = so(this.slStreamId, e.transport), this.cancels.add(this.feedSubscription.addListener("feed-subscription-active-question", (r) => {
1236
1141
  const n = this.activeQuestionId.get().data?.question?.id, i = r.data?.attributes?.question;
1237
- !i || i.type === F.PROMOTION || n && i.status === H.RESOLVED && i.id !== n || this.activeQuestionId.mutate(r.data?.attributes);
1142
+ if (!(!i || i.type === _.PROMOTION)) {
1143
+ if (i.status === W.RESOLVED) {
1144
+ n === i.id && this.activeQuestionId.mutate(void 0);
1145
+ return;
1146
+ }
1147
+ this.activeQuestionId.mutate(r.data?.attributes);
1148
+ }
1238
1149
  })), this.cancels.add(this.feedSubscription.addListener("moderation update", (r) => {
1239
1150
  window.requestAnimationFrame(() => {
1240
1151
  r.data?.attributes?.question === void 0 && r.data?.attributes?.moderation && this.moderation.invalidate();
1241
1152
  });
1153
+ })), this.cancels.add(this.activeQuestionId.subscribe((r, n) => {
1154
+ r.data?.feedItem && e.sdk.onQuestionActivate({
1155
+ stage: "activate",
1156
+ id: r.data.feedItem.id,
1157
+ isViewed: !!this.notifications.isViewed(r.data.feedItem.id),
1158
+ hasNotification: !0,
1159
+ type: r.data.feedItem.type
1160
+ }), !r.data?.feedItem && n?.data?.feedItem && e.sdk.onQuestionActivate({
1161
+ stage: "deactivate",
1162
+ id: n.data.feedItem.id,
1163
+ isViewed: !!this.notifications.isViewed(n.data.feedItem.id),
1164
+ hasNotification: !0,
1165
+ type: n.data.feedItem.type
1166
+ });
1242
1167
  })), this.feedSubscription.connect(), this.cancels.add(this.interactiveAllowed.listen(() => {
1243
1168
  window.requestAnimationFrame(() => {
1244
1169
  this.activeQuestionId.invalidate();
@@ -1277,7 +1202,7 @@ class yo {
1277
1202
  this.openedQuestionId.set(void 0), e && this.notifications.markAsViewed(this.getCurrentSessionId({ prefix: "notification", entity: e }));
1278
1203
  };
1279
1204
  }
1280
- class go {
1205
+ class mo {
1281
1206
  notificationsList;
1282
1207
  store;
1283
1208
  timeouts;
@@ -1286,7 +1211,7 @@ class go {
1286
1211
  options;
1287
1212
  logger;
1288
1213
  constructor(e) {
1289
- this.options = e, this.logger = le("notifications"), this.store = /* @__PURE__ */ new Map(), this.timeouts = /* @__PURE__ */ new Map(), this.waitingQueue = /* @__PURE__ */ new Set(), this.activeQueue = /* @__PURE__ */ new Set(), this.notificationsList = B(/* @__PURE__ */ new Map());
1214
+ this.options = e, this.logger = be("notifications"), this.store = /* @__PURE__ */ new Map(), this.timeouts = /* @__PURE__ */ new Map(), this.waitingQueue = /* @__PURE__ */ new Set(), this.activeQueue = /* @__PURE__ */ new Set(), this.notificationsList = x(/* @__PURE__ */ new Map());
1290
1215
  }
1291
1216
  addToQueue = (e) => {
1292
1217
  if (this.store.has(e.id)) {
@@ -1358,18 +1283,18 @@ class go {
1358
1283
  this.store.clear(), this.timeouts.clear(), this.waitingQueue.clear(), this.activeQueue.clear(), this.notificationsList.off(), this.notificationsList.set(/* @__PURE__ */ new Map());
1359
1284
  };
1360
1285
  }
1361
- var wt;
1286
+ var St;
1362
1287
  (function(t) {
1363
1288
  t.OPENED = "opened";
1364
- })(wt || (wt = {}));
1365
- class mo extends He {
1289
+ })(St || (St = {}));
1290
+ class go extends He {
1366
1291
  constructor() {
1367
1292
  super("notification");
1368
1293
  }
1369
1294
  setOpened = (e) => {
1370
- this.write(wt.OPENED, e, "true");
1295
+ this.write(St.OPENED, e, "true");
1371
1296
  };
1372
- isOpened = (e) => this.read(wt.OPENED, e);
1297
+ isOpened = (e) => this.read(St.OPENED, e);
1373
1298
  clearNotification = () => {
1374
1299
  this.clear();
1375
1300
  };
@@ -1382,7 +1307,7 @@ class vo {
1382
1307
  queue;
1383
1308
  storage;
1384
1309
  constructor(e = {}) {
1385
- this.storage = new mo(), this.queue = new go({ concurrency: 1, animationDelay: 1600, ...e });
1310
+ this.storage = new go(), this.queue = new mo({ concurrency: 1, animationDelay: 1600, ...e });
1386
1311
  }
1387
1312
  isViewed = (e) => this.storage.isOpened(e);
1388
1313
  add = (e) => {
@@ -1429,14 +1354,14 @@ var rt;
1429
1354
  t.UNKNOWN = "unknown", t.ALREADY_VOTED = "already_voted";
1430
1355
  })(rt || (rt = {}));
1431
1356
  const So = async (t, e) => {
1432
- const { client: r, createRequestOptions: n } = t.createPromiseClient(ne, { method: "submitAnswer" }), i = n({ retryAttempts: 0 });
1357
+ const { client: r, createRequestOptions: n } = t.createPromiseClient(re, { method: "submitAnswer" }), i = n({ retryAttempts: 0 });
1433
1358
  try {
1434
1359
  return await r.submitAnswer({ data: e }, { contextValues: i });
1435
1360
  } catch (o) {
1436
- throw tt.from(o)?.code === se.AlreadyExists ? new Error(rt.ALREADY_VOTED) : new Error(rt.UNKNOWN);
1361
+ throw tt.from(o)?.code === oe.AlreadyExists ? new Error(rt.ALREADY_VOTED) : new Error(rt.UNKNOWN);
1437
1362
  }
1438
1363
  }, wo = (t, e) => {
1439
- const { client: r, createRequestOptions: n } = t.createPromiseClient(ne, { method: "submitInplay" }), i = n({ retryAttempts: 0 });
1364
+ const { client: r, createRequestOptions: n } = t.createPromiseClient(re, { method: "submitInplay" }), i = n({ retryAttempts: 0 });
1440
1365
  return r.submitInplay({ data: { eventId: +e } }, { contextValues: i });
1441
1366
  };
1442
1367
  var Be;
@@ -1452,7 +1377,7 @@ class Ao extends He {
1452
1377
  };
1453
1378
  readValue = (e) => this.read(...e);
1454
1379
  }
1455
- class Nn extends He {
1380
+ class Fn extends He {
1456
1381
  sessionStorage;
1457
1382
  constructor() {
1458
1383
  super("gamification"), this.sessionStorage = new Ao();
@@ -1470,19 +1395,19 @@ const Eo = {
1470
1395
  pageSize: 10
1471
1396
  }, Io = (t, e, r, n, i) => {
1472
1397
  let o = 0;
1473
- const s = B({ pageSize: Eo.pageSize, page: 0 }), a = te({
1398
+ const s = x({ pageSize: Eo.pageSize, page: 0 }), a = te({
1474
1399
  data: [],
1475
1400
  key: Date.now(),
1476
1401
  hasMore: !0,
1477
1402
  loading: void 0,
1478
1403
  error: void 0
1479
- }), u = eo(t), f = async () => {
1480
- const l = e.get(), g = n.getStore().get().data?.map((v) => v.slId) || [];
1481
- if (l && g?.length) {
1404
+ }), u = to(t), f = async () => {
1405
+ const h = e.get(), g = n.getStore().get().data?.map((v) => v.slId) || [];
1406
+ if (h && g?.length) {
1482
1407
  const v = r.get();
1483
1408
  v && g.push(v), a.setKey("loading", !0), a.setKey("data", []);
1484
1409
  const b = await u({
1485
- eventId: l,
1410
+ eventId: h,
1486
1411
  usersIds: g
1487
1412
  });
1488
1413
  a.set({
@@ -1497,16 +1422,16 @@ const Eo = {
1497
1422
  }
1498
1423
  }, c = () => {
1499
1424
  f();
1500
- }, h = (l) => {
1501
- const g = s.get(), v = l || g.page + 1;
1425
+ }, l = (h) => {
1426
+ const g = s.get(), v = h || g.page + 1;
1502
1427
  v <= o && s.set({ ...g, page: v });
1503
1428
  };
1504
- return nt(a, () => {
1505
- const l = e.listen(f), g = n.listen(f);
1429
+ return Lt(a, () => {
1430
+ const h = e.listen(f), g = n.listen(f);
1506
1431
  return () => {
1507
- l(), g();
1432
+ h(), g();
1508
1433
  };
1509
- }), { $store: a, fetchMore: h, invalidate: c };
1434
+ }), { $store: a, fetchMore: l, invalidate: c };
1510
1435
  };
1511
1436
  class To extends He {
1512
1437
  get = this.read;
@@ -1516,7 +1441,7 @@ class To extends He {
1516
1441
  super("deep-link-context", window.sessionStorage);
1517
1442
  }
1518
1443
  }
1519
- const Kr = "sldl", Pt = "sldl_uid", Fn = "sldl_eid", Dn = "sldl_e_eid", Oo = /* @__PURE__ */ new Set([Pt, Fn, Dn]), zr = (t) => {
1444
+ const Kr = "sldl", Pt = "sldl_uid", Dn = "sldl_eid", Rn = "sldl_e_eid", Oo = /* @__PURE__ */ new Set([Pt, Dn, Rn]), zr = (t) => {
1520
1445
  const e = {}, r = {};
1521
1446
  for (const [n, i] of t)
1522
1447
  Oo.has(n) ? e[n] = i : r[n] = i;
@@ -1531,53 +1456,53 @@ const Kr = "sldl", Pt = "sldl_uid", Fn = "sldl_eid", Dn = "sldl_e_eid", Oo = /*
1531
1456
  return { search: zr(r) };
1532
1457
  }
1533
1458
  return null;
1534
- }, Hr = le("deep_link"), ce = {
1459
+ }, Hr = be("deep_link"), ue = {
1535
1460
  debug: (...t) => {
1536
1461
  Hr.debug(...t), localStorage.getItem("SL_DEBUG") && console.log(...t);
1537
1462
  },
1538
1463
  trace: (...t) => {
1539
1464
  Hr.trace(...t), localStorage.getItem("SL_DEBUG") && console.log(...t);
1540
1465
  }
1541
- }, Lo = (t, e) => {
1466
+ }, Co = (t, e) => {
1542
1467
  const { hash: r, search: n } = window.location;
1543
- if (ce.debug({ hash: r, search: n }, "get deep link data from"), r || n) {
1468
+ if (ue.debug({ hash: r, search: n }, "get deep link data from"), r || n) {
1544
1469
  const i = _o({ hash: r, search: n });
1545
- if (ce.debug(i, "parse deep link result"), i) {
1470
+ if (ue.debug(i, "parse deep link result"), i) {
1546
1471
  const { hash: o, search: s } = i, { result: a, remain: u } = o || s;
1547
1472
  if (Object.keys(a).length !== 0) {
1548
1473
  t.setValue("data", a);
1549
1474
  const f = Object.keys(u).length !== 0;
1550
1475
  if (o) {
1551
1476
  let c = "";
1552
- f && (c = `#${new URLSearchParams(u).toString()}`, ce.debug({ updatedHash: c }, "update hash")), window.history.replaceState(null, "", window.location.pathname + window.location.search + c);
1477
+ f && (c = `#${new URLSearchParams(u).toString()}`, ue.debug({ updatedHash: c }, "update hash")), window.history.replaceState(null, "", window.location.pathname + window.location.search + c);
1553
1478
  }
1554
1479
  if (s) {
1555
1480
  let c = "";
1556
- f && (c = `?${new URLSearchParams(u).toString()}`, ce.debug({ updatedSearch: c }, "update search")), window.history.replaceState(null, "", window.location.pathname + c + window.location.hash);
1481
+ f && (c = `?${new URLSearchParams(u).toString()}`, ue.debug({ updatedSearch: c }, "update search")), window.history.replaceState(null, "", window.location.pathname + c + window.location.hash);
1557
1482
  }
1558
1483
  e(a);
1559
1484
  }
1560
1485
  }
1561
1486
  }
1562
1487
  t.setValue("parsed", !0);
1563
- }, Co = (t, e, r) => {
1488
+ }, Lo = (t, e, r) => {
1564
1489
  const n = new To(), i = n.get("sl-deep-link-store");
1565
1490
  let o = {};
1566
1491
  if (i)
1567
1492
  try {
1568
1493
  o = JSON.parse(i);
1569
1494
  } catch (a) {
1570
- ce.debug(a);
1495
+ ue.debug(a);
1571
1496
  }
1572
1497
  t.deepLink = {
1573
- $store: new Le(te(o), "deep-link-context"),
1498
+ $store: new Ce(te(o), "deep-link-context"),
1574
1499
  getDeepLinkData: () => {
1575
1500
  const { data: a, used: u } = t.deepLink.$store.getValues();
1576
1501
  return { data: a, used: u };
1577
1502
  },
1578
1503
  // we are logged in with inviter id
1579
1504
  deepLinkUsed: (a) => {
1580
- ce.debug(`logged in with inviterId: ${a}`), t.deepLink.$store.setValue("used", !0);
1505
+ ue.debug(`logged in with inviterId: ${a}`), t.deepLink.$store.setValue("used", !0);
1581
1506
  },
1582
1507
  onDeepLinkHandlers: /* @__PURE__ */ new Set()
1583
1508
  }, t.sdk.getInviter = () => {
@@ -1586,28 +1511,28 @@ const Kr = "sldl", Pt = "sldl_uid", Fn = "sldl_eid", Dn = "sldl_e_eid", Oo = /*
1586
1511
  }, t.sdk.inviteDisplayed = () => {
1587
1512
  t.deepLink.$store.getStore().set({}), t.deepLink.$store.getStore().off(), n.del("sl-deep-link-store");
1588
1513
  }, t.deepLink.$store.subscribe((a) => n.set("sl-deep-link-store", JSON.stringify(a))), t.sdk.addDeepLinkHandler = (a) => {
1589
- localStorage.getItem("SL_DEBUG") && ce.trace("adding deep link handler"), t.deepLink.onDeepLinkHandlers.add(a);
1514
+ localStorage.getItem("SL_DEBUG") && ue.trace("adding deep link handler"), t.deepLink.onDeepLinkHandlers.add(a);
1590
1515
  }, e.onDeepLinkHandled && t.sdk.addDeepLinkHandler(e.onDeepLinkHandled), t.sdk.removeDeepLinkHandler = (a) => {
1591
- ce.trace("removing deep link handler"), t.deepLink.onDeepLinkHandlers.delete(a);
1516
+ ue.trace("removing deep link handler"), t.deepLink.onDeepLinkHandlers.delete(a);
1592
1517
  };
1593
1518
  const s = (a) => {
1594
- t.deepLink.$store.setValue("handled", !0), ce.trace({ size: t.deepLink.onDeepLinkHandlers.size }, "deep link handled, call callbacks");
1519
+ t.deepLink.$store.setValue("handled", !0), ue.trace({ size: t.deepLink.onDeepLinkHandlers.size }, "deep link handled, call callbacks");
1595
1520
  for (const u of t.deepLink.onDeepLinkHandlers)
1596
1521
  try {
1597
- ce.trace("called handler"), u(a);
1522
+ ue.trace("called handler"), u(a);
1598
1523
  } catch (f) {
1599
1524
  console.error(f);
1600
1525
  }
1601
1526
  };
1602
- Lo(t.deepLink.$store, s), r();
1603
- }, ko = le("bypass");
1604
- class Po extends ki {
1527
+ Co(t.deepLink.$store, s), r();
1528
+ }, ko = be("bypass");
1529
+ class Po extends Pi {
1605
1530
  $coreStore;
1606
1531
  deepLink;
1607
1532
  transport;
1608
1533
  bypassLogin;
1609
1534
  constructor(e, r, n) {
1610
- super(), this.$coreStore = e, this.deepLink = n, this.transport = r, this.bypassLogin = Qi(this.transport), this.connect();
1535
+ super(), this.$coreStore = e, this.deepLink = n, this.transport = r, this.bypassLogin = Gi(this.transport), this.connect();
1611
1536
  }
1612
1537
  me = async () => (this.$coreStore.getValues().user.invalidate(), (await this.$coreStore.getValues().user.getValue())?.data);
1613
1538
  /**
@@ -1690,7 +1615,7 @@ class Po extends ki {
1690
1615
  }
1691
1616
  const Je = new Ue(), No = (t, e, r) => {
1692
1617
  t.auth = new Po(t.store, t.transport, t.deepLink), t.stores.status.listen((n) => {
1693
- n === ge.READY && t.auth.reLogin();
1618
+ n === ye.READY && t.auth.reLogin();
1694
1619
  }), t.sdk.userId = t.stores.user.getAtomStore, t.sdk.authorizationBypass = async (n, i) => {
1695
1620
  if (!(Je.getSchema() === n && Je.getExternalToken() === i && t.transport.getHeader("authorization")))
1696
1621
  try {
@@ -1701,7 +1626,7 @@ const Je = new Ue(), No = (t, e, r) => {
1701
1626
  }, t.sdk.logout = () => {
1702
1627
  t.auth.logout(), Je.clear();
1703
1628
  }, t.sdk.getUserStore = () => t.stores.user.getStore(), t.sdk.isUserAuthorized = () => t.auth.isAuthenticated(), r();
1704
- }, Wr = le("video_player"), dt = {
1629
+ }, Wr = be("video_player"), lt = {
1705
1630
  debug: (...t) => {
1706
1631
  Wr.debug(...t), localStorage.getItem("SL_DEBUG") && console.log(...t);
1707
1632
  },
@@ -1712,13 +1637,13 @@ const Je = new Ue(), No = (t, e, r) => {
1712
1637
  t.videoPlayer = {
1713
1638
  controllers: /* @__PURE__ */ new Set()
1714
1639
  }, t.sdk.addVideoPlayerController = (n) => {
1715
- dt.trace("adding video player controller"), t.videoPlayer.controllers.add(n);
1640
+ lt.trace("adding video player controller"), t.videoPlayer.controllers.add(n);
1716
1641
  }, e.videoPlayerController && t.sdk.addVideoPlayerController(e.videoPlayerController), t.sdk.removeVideoPlayerController = (n) => {
1717
- dt.trace("removing video player controller"), t.videoPlayer.controllers.delete(n);
1642
+ lt.trace("removing video player controller"), t.videoPlayer.controllers.delete(n);
1718
1643
  }, t.sdk.controlVideoPlayer = (n) => {
1719
- dt.trace("controlling video player");
1644
+ lt.trace("controlling video player");
1720
1645
  for (const i of t.videoPlayer.controllers) {
1721
- dt.trace("calling video player controller");
1646
+ lt.trace("calling video player controller");
1722
1647
  try {
1723
1648
  i(n);
1724
1649
  } catch (o) {
@@ -1726,13 +1651,24 @@ const Je = new Ue(), No = (t, e, r) => {
1726
1651
  }
1727
1652
  }
1728
1653
  }, r();
1729
- }, Do = (t, e, r) => {
1654
+ }, Do = {
1655
+ [_.FACTOID]: "insight",
1656
+ [_.POLL]: "poll",
1657
+ [_.TRIVIA]: "trivia",
1658
+ [_.PREDICTION]: "prediction",
1659
+ [_.TWEET]: "tweet"
1660
+ }, Ro = (t, e, r) => {
1730
1661
  t.ui = {
1731
1662
  state: /* @__PURE__ */ new Set()
1732
1663
  }, e.onContentActivate && (t.ui.onContentActivate = e.onContentActivate), t.sdk.onAdvertisementActivate = (n) => {
1733
1664
  t.ui.onContentActivate && t.ui.onContentActivate({ ...n, type: "advertisement" });
1665
+ }, t.sdk.onQuestionActivate = ({ questionType: n, ...i }) => {
1666
+ if (t.ui.onContentActivate) {
1667
+ const o = i.type || n && Do[n] || "question";
1668
+ o === "insight" && t.ui.onContentActivate({ ...i, type: o });
1669
+ }
1734
1670
  }, r();
1735
- }, Ro = (t, e, r) => {
1671
+ }, Vo = (t, e, r) => {
1736
1672
  const n = { onMountedFired: !1 }, i = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map();
1737
1673
  t.sdk = /* @__PURE__ */ Object.create(null), t.sdk.onMount = ({ name: s, clear: a }, u) => {
1738
1674
  if (i.has(s)) {
@@ -1747,20 +1683,20 @@ const Je = new Ue(), No = (t, e, r) => {
1747
1683
  }, t.sdk.initializeApp = async (s) => {
1748
1684
  if (t.contextConfig = s, t.stores.enabled.get() === "on")
1749
1685
  return { enabled: !0 };
1750
- t.storeSubscribe(), t.stores.enabled.setValue("on"), t.stores.status.setValue(ge.INITIALIZATION);
1686
+ t.storeSubscribe(), t.stores.enabled.setValue("on"), t.stores.status.setValue(ye.INITIALIZATION);
1751
1687
  try {
1752
1688
  const a = await t.stores.organizationSettings.getValue();
1753
- return a ? (t.stores.status.setValue(ge.READY), { enabled: !!a }) : (t.stores.status.setValue(ge.FAILED), { err: "failed" });
1689
+ return a ? (t.stores.status.setValue(ye.READY), { enabled: !!a }) : (t.stores.status.setValue(ye.FAILED), { err: "failed" });
1754
1690
  } catch (a) {
1755
- return t.stores.enabled.setValue(), t.stores.status.setValue(ge.FAILED), { err: `${a}` };
1691
+ return t.stores.enabled.setValue(), t.stores.status.setValue(ye.FAILED), { err: `${a}` };
1756
1692
  }
1757
1693
  }, t.sdk.disableApp = () => {
1758
- t.stores.enabled.get() === "on" && (t.stores.enabled.setValue(), t.stores.status.setValue(ge.DISABLED), t.stores.slStreamId.setValue(), t.stores.providerStreamId.setValue(), t.sdk.closeFeature(!0), t.storeUnsubscribe(), t.transport.disconnect());
1694
+ t.stores.enabled.get() === "on" && (t.stores.enabled.setValue(), t.stores.status.setValue(ye.DISABLED), t.stores.slStreamId.setValue(), t.stores.providerStreamId.setValue(), t.sdk.closeFeature(!0), t.storeUnsubscribe(), t.transport.disconnect());
1759
1695
  }, t.sdk.createEventSession = (s) => {
1760
1696
  t.stores.providerStreamId.setValue(s);
1761
1697
  }, r();
1762
- }, Vo = (t, e) => {
1763
- const { client: r, queryKey: n } = t.createPromiseClient(it, {
1698
+ }, $o = (t, e) => {
1699
+ const { client: r, queryKey: n } = t.createPromiseClient(nt, {
1764
1700
  method: "generateDeepLink",
1765
1701
  params: e
1766
1702
  });
@@ -1780,29 +1716,29 @@ const Je = new Ue(), No = (t, e, r) => {
1780
1716
  // 24 hours
1781
1717
  refetchInterval: 0
1782
1718
  });
1783
- }, $o = (t, { web: e, mobile: r }) => {
1784
- const { client: n } = t.createPromiseClient(wi, { method: "generate" });
1719
+ }, Mo = (t, { web: e, mobile: r }) => {
1720
+ const { client: n } = t.createPromiseClient(Ai, { method: "generate" });
1785
1721
  return n.generate({ web: e, mobile: r });
1786
1722
  }, Yr = (t, e) => {
1787
1723
  const r = new URLSearchParams(t);
1788
1724
  for (const [n, i] of Object.entries(e))
1789
1725
  r.append(n, i);
1790
1726
  return r.toString();
1791
- }, Mo = (t, e, r, n) => {
1727
+ }, jo = (t, e, r, n) => {
1792
1728
  const i = te({});
1793
- return nt(i, () => Vo(t, [e, r]).subscribe(async ({ data: a, error: u, loading: f }) => {
1794
- const c = u ? "https://masters.com" : a?.url, h = n.get() || "", l = e.get() || "", g = r.get() || "", v = {
1795
- [Pt]: h,
1796
- [Fn]: l,
1797
- [Dn]: g
1729
+ return Lt(i, () => $o(t, [e, r]).subscribe(async ({ data: a, error: u, loading: f }) => {
1730
+ const c = u ? "https://masters.com" : a?.url, l = n.get() || "", h = e.get() || "", g = r.get() || "", v = {
1731
+ [Pt]: l,
1732
+ [Dn]: h,
1733
+ [Rn]: g
1798
1734
  };
1799
1735
  if (!f && c) {
1800
1736
  i.setKey("loading", !0);
1801
- let w = window.location.search, b = window.location.hash;
1802
- w && b || b ? w = `?${Yr(w, v)}` : b = `#${Yr("", v)}`;
1803
- const L = window.location.origin + window.location.pathname + w + b;
1737
+ let I = window.location.search, b = window.location.hash;
1738
+ I && b || b ? I = `?${Yr(I, v)}` : b = `#${Yr("", v)}`;
1739
+ const L = window.location.origin + window.location.pathname + I + b;
1804
1740
  try {
1805
- const R = await $o(t, { web: L, mobile: c });
1741
+ const R = await Mo(t, { web: L, mobile: c });
1806
1742
  i.set({
1807
1743
  data: R.data?.link,
1808
1744
  loading: !1
@@ -1822,7 +1758,7 @@ var U;
1822
1758
  (function(t) {
1823
1759
  t.Unset = "unset", t.Required = "required", t.Optional = "optional", t.Completed = "completed", t.Disabled = "disabled", t.Unavailable = "unavailable";
1824
1760
  })(U || (U = {}));
1825
- const jo = (t, e, r, n) => {
1761
+ const Uo = (t, e, r, n) => {
1826
1762
  const { inplayGame: i } = t.featureSettings.get(), o = e.getCurrentSessionId({ prefix: "onboarding" });
1827
1763
  i && r.add({
1828
1764
  type: Ae.ONBOARDING,
@@ -1832,7 +1768,7 @@ const jo = (t, e, r, n) => {
1832
1768
  autoHideDuration: 1e6,
1833
1769
  data: {
1834
1770
  questionId: "onboarding",
1835
- questionType: F.UNSET,
1771
+ questionType: _.UNSET,
1836
1772
  onboarding: {
1837
1773
  ...i,
1838
1774
  instantOpen: !n.getOnboardingInstantOpen({
@@ -1843,7 +1779,7 @@ const jo = (t, e, r, n) => {
1843
1779
  }
1844
1780
  }
1845
1781
  });
1846
- }, ft = (t, e, r, n, i, o) => {
1782
+ }, dt = (t, e, r, n, i, o) => {
1847
1783
  try {
1848
1784
  const s = e.userId.get();
1849
1785
  if (!s)
@@ -1854,35 +1790,35 @@ const jo = (t, e, r, n) => {
1854
1790
  eventId: e.slStreamId.get() || ""
1855
1791
  }) === U.Completed) {
1856
1792
  t.set(U.Completed);
1857
- for (const l of o)
1858
- l();
1793
+ for (const h of o)
1794
+ h();
1859
1795
  return;
1860
1796
  }
1861
1797
  const u = e.moderation.getStore().value?.data, f = r.featureSettings.get().inplayGame;
1862
1798
  if (u === void 0 || f === void 0)
1863
1799
  return;
1864
- const c = u?.options?.onboardingEnabled, h = f?.titleCard?.optIn;
1865
- c ? h ? t.set(U.Required) : t.set(U.Optional) : (h ? t.set(U.Unavailable) : t.set(U.Disabled), n.close(e.getCurrentSessionId({ prefix: "onboarding" }), { markAsViewed: !1 }));
1800
+ const c = u?.options?.onboardingEnabled, l = f?.titleCard?.optIn;
1801
+ c ? l ? t.set(U.Required) : t.set(U.Optional) : (l ? t.set(U.Unavailable) : t.set(U.Disabled), n.close(e.getCurrentSessionId({ prefix: "onboarding" }), { markAsViewed: !1 }));
1866
1802
  } catch (s) {
1867
1803
  console.error(s);
1868
1804
  }
1869
- }, Uo = (t, e, r, n) => {
1805
+ }, Bo = (t, e, r, n) => {
1870
1806
  let i = !1;
1871
- const o = new Nn(), s = B(U.Unset);
1807
+ const o = new Fn(), s = x(U.Unset);
1872
1808
  s.subscribe((f) => {
1873
- f !== U.Unset && ((f === U.Optional || f === U.Required) && i === !1 && (jo(t, e, n, o), i = !0), f === U.Completed && e.activeQuestionId.invalidate(), o.setOnboardingInstantOpen({
1809
+ f !== U.Unset && ((f === U.Optional || f === U.Required) && i === !1 && (Uo(t, e, n, o), i = !0), f === U.Completed && e.activeQuestionId.invalidate(), o.setOnboardingInstantOpen({
1874
1810
  userId: e.userId.get() || "",
1875
1811
  organizationId: e.organizationId.get() || "",
1876
1812
  eventId: e.slStreamId.get() || ""
1877
1813
  }));
1878
1814
  });
1879
1815
  const a = [];
1880
- return ft(s, e, t, n, o, a), s.get() !== U.Completed && (a.push(e.userId.listen((f) => {
1881
- f && ft(s, e, t, n, o, a);
1816
+ return dt(s, e, t, n, o, a), s.get() !== U.Completed && (a.push(e.userId.listen((f) => {
1817
+ f && dt(s, e, t, n, o, a);
1882
1818
  })), a.push(e.moderation.listen((f) => {
1883
- f.data && ft(s, e, t, n, o, a);
1819
+ f.data && dt(s, e, t, n, o, a);
1884
1820
  })), a.push(t.featureSettings.listen((f) => {
1885
- f && ft(s, e, t, n, o, a);
1821
+ f && dt(s, e, t, n, o, a);
1886
1822
  }))), { $store: s, submitInplay: async () => {
1887
1823
  const f = e.slStreamId.get();
1888
1824
  if (f) {
@@ -1898,35 +1834,35 @@ const jo = (t, e, r, n) => {
1898
1834
  n.close(c);
1899
1835
  }
1900
1836
  } };
1901
- }, Bo = (t, e, r, n) => {
1837
+ }, qo = (t, e, r, n) => {
1902
1838
  const i = te(void 0), o = Pn(n), s = async () => {
1903
1839
  const u = t.get(), f = e.get(), c = r.getStore().get().data?.map((g) => g.slId);
1904
1840
  if (!c)
1905
1841
  return;
1906
- const h = {
1842
+ const l = {
1907
1843
  eventId: u,
1908
1844
  userId: f,
1909
1845
  usersIds: [...c, f]
1910
- }, l = await o(h);
1911
- i.set(l.data?.attributes);
1846
+ }, h = await o(l);
1847
+ i.set(h.data?.attributes);
1912
1848
  }, a = () => {
1913
1849
  s();
1914
1850
  };
1915
- return nt(i, () => {
1851
+ return Lt(i, () => {
1916
1852
  const u = t.listen(s), f = r.listen(s), c = e.listen(s);
1917
1853
  return () => {
1918
1854
  u(), f(), c();
1919
1855
  };
1920
1856
  }), { $store: i, invalidate: a };
1921
- }, qo = async (t, e, r, n, i) => {
1922
- const o = Pn(i), s = t.get(), a = e.get(), u = r.getStore().get().data?.map((l) => l.slId) || [], f = {
1857
+ }, xo = async (t, e, r, n, i) => {
1858
+ const o = Pn(i), s = t.get(), a = e.get(), u = r.getStore().get().data?.map((h) => h.slId) || [], f = {
1923
1859
  eventId: s,
1924
1860
  userId: n,
1925
1861
  usersIds: [...u, a]
1926
1862
  };
1927
1863
  return (await o(f)).data?.attributes?.summary;
1928
- }, xo = /* @__PURE__ */ new Set([F.POLL, F.PREDICTION, F.TRIVIA]);
1929
- class Qo extends Ln {
1864
+ }, Qo = /* @__PURE__ */ new Set([_.POLL, _.PREDICTION, _.TRIVIA]);
1865
+ class Go extends Cn {
1930
1866
  /** user statistics (leaderboard panel) */
1931
1867
  userSummary;
1932
1868
  /** feed list (pick history) */
@@ -1961,9 +1897,9 @@ class Qo extends Ln {
1961
1897
  submitAnswerTimeout;
1962
1898
  cancels = /* @__PURE__ */ new Set();
1963
1899
  constructor(e, r, n) {
1964
- super(e, r), this.background = new yo(n), this.advertisement = this.background.advertisement, this.feedSubscription = this.background.feedSubscription, this.activeQuestionId = this.background.activeQuestionId, this.openedQuestionId = this.background.openedQuestionId, this.storage = new Nn(), this.feedList = this.background.feedList, this.friends = new re(to(this.background.userId, n.transport), "gamification:friends"), this.currentUserId = this.background.userId, this.openedUser = B(void 0), this.leaderboardId = new Y(B(this.settings.getValue("pinnedLeaderboardId")), "pinnedLeaderboardId").getStore(), this.onboardingStatus = Uo(this, this.background, n.transport, n.notifications), this.notifications = n.notifications, this.transport = n.transport, this.closeFeature = () => n.sdk.closeFeature(!0), this.openFeature = () => n.sdk.openFeature(D.GAMES), this.openedQuestion = this.background.openedQuestion, this.deepLink = Mo(this.transport, this.background.slStreamId, n.stores.providerStreamId.getStore(), this.background.userId), this.userSummary = Bo(this.background.slStreamId, this.background.userId, this.friends, this.transport), this.leaderboardList = Io(this.transport, this.background.slStreamId, this.background.userId, this.friends), this.connect(), this.cancels.add(this.userSummary.$store.listen((i, o) => {
1900
+ super(e, r), this.background = new yo(n), this.advertisement = this.background.advertisement, this.feedSubscription = this.background.feedSubscription, this.activeQuestionId = this.background.activeQuestionId, this.openedQuestionId = this.background.openedQuestionId, this.storage = new Fn(), this.feedList = this.background.feedList, this.friends = new ce(ro(this.background.userId, n.transport), "gamification:friends"), this.currentUserId = this.background.userId, this.openedUser = x(void 0), this.leaderboardId = new Y(x(this.settings.getValue("pinnedLeaderboardId")), "pinnedLeaderboardId").getStore(), this.onboardingStatus = Bo(this, this.background, n.transport, n.notifications), this.notifications = n.notifications, this.transport = n.transport, this.closeFeature = () => n.sdk.closeFeature(!0), this.openFeature = () => n.sdk.openFeature(D.GAMES), this.openedQuestion = this.background.openedQuestion, this.deepLink = jo(this.transport, this.background.slStreamId, n.stores.providerStreamId.getStore(), this.background.userId), this.userSummary = qo(this.background.slStreamId, this.background.userId, this.friends, this.transport), this.leaderboardList = Io(this.transport, this.background.slStreamId, this.background.userId, this.friends), this.connect(), this.cancels.add(this.userSummary.$store.listen((i, o) => {
1965
1901
  o?.summary && i?.summary && this.leaderboardList.invalidate();
1966
- })), this.cancels.add(this.onboardingStatus.$store.listen(this.checkInteractiveFlag)), this.cancels.add(this.background.moderation.getStore().listen(this.checkInteractiveFlag)), this.cancels.add(this.settings.subscribe(this.checkInteractiveFlag)), nt(this.background.activeQuestionId, () => {
1902
+ })), this.cancels.add(this.onboardingStatus.$store.listen(this.checkInteractiveFlag)), this.cancels.add(this.background.moderation.getStore().listen(this.checkInteractiveFlag)), this.cancels.add(this.settings.subscribe(this.checkInteractiveFlag)), Lt(this.background.activeQuestionId, () => {
1967
1903
  this.background.activeQuestionId.listen(this.showInApp);
1968
1904
  }), n.sdk.onMount({ name: "gamification", clear: !0 }, () => () => {
1969
1905
  for (const i of this.cancels)
@@ -1971,11 +1907,11 @@ class Qo extends Ln {
1971
1907
  });
1972
1908
  }
1973
1909
  get isInteractiveAllowed() {
1974
- return this.background.interactiveAllowed.get() === Ce.ALLOWED;
1910
+ return this.background.interactiveAllowed.get() === Le.ALLOWED;
1975
1911
  }
1976
1912
  checkInteractiveFlag = () => {
1977
1913
  const e = this.onboardingStatus.$store.get(), r = this.background.moderation.getStore().value?.data?.options?.onboardingEnabled, n = this.settings.getValues().inplayGame?.titleCard?.optIn, i = e === U.Completed, o = !r || i || n !== !0;
1978
- this.background.interactiveAllowed.set(o ? Ce.ALLOWED : Ce.DISALLOWED);
1914
+ this.background.interactiveAllowed.set(o ? Le.ALLOWED : Le.DISALLOWED);
1979
1915
  };
1980
1916
  connect = () => {
1981
1917
  this.cancels.add(this.background.feedSubscription.addListener("feed-subscription-prediction-close", async (e) => {
@@ -1985,22 +1921,22 @@ class Qo extends Ln {
1985
1921
  if (!r || !n?.attributes)
1986
1922
  return;
1987
1923
  const { status: i, type: o, id: s, answers: a } = r;
1988
- if (i === H.RESOLVED && o === F.PREDICTION) {
1924
+ if (i === W.RESOLVED && o === _.PREDICTION) {
1989
1925
  const u = this.background.getCurrentSessionId({
1990
1926
  prefix: `notification-id:${s}`
1991
- }), f = [...this.feedList.getValues().data || []], c = f.findIndex((Q) => Q.id === s), h = f[c];
1992
- let l = h?.attributes?.attributes?.value?.answerId;
1927
+ }), f = [...this.feedList.getValues().data || []], c = f.findIndex((Q) => Q.id === s), l = f[c];
1928
+ let h = l?.attributes?.attributes?.value?.answerId;
1993
1929
  const g = ar(s, this.transport), v = g.subscribe(() => {
1994
1930
  });
1995
1931
  await g.get().promise;
1996
- const w = g.get().data;
1932
+ const I = g.get().data;
1997
1933
  v(), window.requestAnimationFrame(() => {
1998
1934
  g.invalidate();
1999
- }), l || (l = w?.answers.find(({ youVoted: Q }) => Q)?.id);
2000
- const b = a.find(({ correct: Q }) => Q), L = l ? a.find(({ id: Q }) => Q === l) : void 0, R = !!L?.correct;
2001
- if (h && f[c]?.attributes?.attributes.case === "question") {
1935
+ }), h || (h = I?.answers.find(({ youVoted: Q }) => Q)?.id);
1936
+ const b = a.find(({ correct: Q }) => Q), L = h ? a.find(({ id: Q }) => Q === h) : void 0, R = !!L?.correct;
1937
+ if (l && f[c]?.attributes?.attributes.case === "question") {
2002
1938
  try {
2003
- f[c].attributes.attributes.value.answerId = l, f[c].attributes.attributes.value.openForVoting = !1, l && (f[c].attributes.attributes.value.status = R ? lt.WON : lt.LOST);
1939
+ f[c].attributes.attributes.value.answerId = h, f[c].attributes.attributes.value.openForVoting = !1, h && (f[c].attributes.attributes.value.status = R ? ct.WON : ct.LOST);
2004
1940
  } catch {
2005
1941
  }
2006
1942
  this.feedList.getStore().mutate(f);
@@ -2016,7 +1952,7 @@ class Qo extends Ln {
2016
1952
  emitEvent: !1,
2017
1953
  data: {
2018
1954
  questionId: s,
2019
- questionType: F.PREDICTION,
1955
+ questionType: _.PREDICTION,
2020
1956
  question: {
2021
1957
  title: R ? `Congratulations! You answered correctly! You won ${b.points} pts!` : `Better luck next time! Correct: ${b?.text}!`,
2022
1958
  votedAnswer: {
@@ -2025,7 +1961,7 @@ class Qo extends Ln {
2025
1961
  },
2026
1962
  correctAnswerTitle: b?.text,
2027
1963
  correct: !!R,
2028
- predictionResult: i === H.RESOLVED,
1964
+ predictionResult: i === W.RESOLVED,
2029
1965
  questionTitle: r?.subject
2030
1966
  }
2031
1967
  }
@@ -2033,7 +1969,7 @@ class Qo extends Ln {
2033
1969
  }
2034
1970
  })), this.cancels.add(this.background.feedSubscription.addListener("feed-subscription-questions-list", (e) => {
2035
1971
  const r = [...this.feedList.getStore().value?.data || []], n = e.data?.attributes?.feedItem, i = r.findIndex((o) => o.id === n?.id);
2036
- if (n?.attributes && n.attributes.attributes.case !== "promotion" && !(n.attributes.status !== H.ACTIVE && n.attributes.status !== H.RESOLVED)) {
1972
+ if (n?.attributes && n.attributes.attributes.case !== "promotion" && !(n.attributes.status !== W.ACTIVE && n.attributes.status !== W.RESOLVED)) {
2037
1973
  if (i !== -1)
2038
1974
  if (n.attributes.attributes.case === "question" && r[i].attributes?.attributes.case === "question") {
2039
1975
  const o = r[i];
@@ -2099,7 +2035,7 @@ class Qo extends Ln {
2099
2035
  const a = this.feedList.getValues().data;
2100
2036
  if (!a)
2101
2037
  return;
2102
- const u = a.findIndex((h) => h.id === e), f = a[u], c = f?.attributes?.attributes.case === "question" && f.attributes.attributes.value;
2038
+ const u = a.findIndex((l) => l.id === e), f = a[u], c = f?.attributes?.attributes.case === "question" && f.attributes.attributes.value;
2103
2039
  if (c) {
2104
2040
  J.emit("poll", {
2105
2041
  action: "voted",
@@ -2108,12 +2044,12 @@ class Qo extends Ln {
2108
2044
  questionType: c.questionType
2109
2045
  }
2110
2046
  });
2111
- const h = n.get().data;
2112
- if (i(), h) {
2113
- const l = h.answers.find((b) => b.correct === !0), g = h.answers.findIndex((b) => b.id === r), v = h.answers[g], w = h.answers.every(({ percentageDecimal: b }, L) => b === o?.answers[L].percentageDecimal);
2114
- a[u].attributes.attributes.value.answerId = r, a[u].attributes.attributes.value.openForVoting = !1, a[u].attributes.attributes.value.text = v?.text || "", l && (a[u].attributes.attributes.value.status = l.id === r ? lt.WON : lt.LOST), this.feedList.getStore().mutate([...a]), h.answers[g].correct = l?.id === r, h.answers[g].youVoted = !0, w && h.answers.forEach((b) => {
2047
+ const l = n.get().data;
2048
+ if (i(), l) {
2049
+ const h = l.answers.find((b) => b.correct === !0), g = l.answers.findIndex((b) => b.id === r), v = l.answers[g], I = l.answers.every(({ percentageDecimal: b }, L) => b === o?.answers[L].percentageDecimal);
2050
+ a[u].attributes.attributes.value.answerId = r, a[u].attributes.attributes.value.openForVoting = !1, a[u].attributes.attributes.value.text = v?.text || "", h && (a[u].attributes.attributes.value.status = h.id === r ? ct.WON : ct.LOST), this.feedList.getStore().mutate([...a]), l.answers[g].correct = h?.id === r, l.answers[g].youVoted = !0, I && l.answers.forEach((b) => {
2115
2051
  b.percentageDecimal = 0;
2116
- }), l?.id === r && (h.answers[g].pointsEarned = h.status === H.RESOLVED ? 0 : l.points), n.mutate({ ...h });
2052
+ }), h?.id === r && (l.answers[g].pointsEarned = l.status === W.RESOLVED ? 0 : h.points), n.mutate({ ...l });
2117
2053
  }
2118
2054
  this.submitAnswerTimeout && clearTimeout(this.submitAnswerTimeout), this.submitAnswerTimeout = setTimeout(() => {
2119
2055
  this.userSummary.invalidate();
@@ -2152,8 +2088,8 @@ class Qo extends Ln {
2152
2088
  }
2153
2089
  }), this.background.openQuestion(e, r);
2154
2090
  };
2155
- getFeedItem = (e) => io(e, this.transport);
2156
- isOpenedQuestion = (e) => this.notifications.isViewed(e);
2091
+ getFeedItem = (e) => oo(e, this.transport);
2092
+ isOpenedQuestion = (e) => !!this.notifications.isViewed(e);
2157
2093
  closeQuestion = (e) => this.background.closeQuestion(e);
2158
2094
  openUser = async (e) => {
2159
2095
  const r = this.leaderboardList.$store.get().data?.find((i) => i.userId === e);
@@ -2167,7 +2103,7 @@ class Qo extends Ln {
2167
2103
  }
2168
2104
  const n = { ...r };
2169
2105
  try {
2170
- const i = await qo(this.background.slStreamId, this.background.userId, this.friends, e, this.transport);
2106
+ const i = await xo(this.background.slStreamId, this.background.userId, this.friends, e, this.transport);
2171
2107
  i?.inTop !== void 0 && (this.leaderboardList.$store.setKey("data", this.leaderboardList.$store.get().data?.map((o) => (o.userId === e && (o.inTop = i.inTop), o))), n.inTop = i.inTop);
2172
2108
  } catch (i) {
2173
2109
  console.error(i);
@@ -2185,8 +2121,8 @@ class Qo extends Ln {
2185
2121
  */
2186
2122
  showInApp = (e) => {
2187
2123
  const r = this.onboardingStatus.$store.get();
2188
- if (e && e.data && r && r !== U.Unset && e.data.question?.id !== void 0 && e.data.question.notification !== void 0 && e.data.question?.bypassNotifications?.inAppSilence !== mi.ON && e.data.question.status === H.ACTIVE && !e.data.question.marketClosed) {
2189
- if (xo.has(e.data.question.type))
2124
+ if (e && e.data && r && r !== U.Unset && e.data.question?.id !== void 0 && e.data.question.notification !== void 0 && e.data.question?.bypassNotifications?.inAppSilence !== vi.ON && e.data.question.status === W.ACTIVE && !e.data.question.marketClosed) {
2125
+ if (Qo.has(e.data.question.type))
2190
2126
  this.isInteractiveAllowed && this.notifications.add({
2191
2127
  type: Ae.QUESTION,
2192
2128
  action: () => this.openQuestion(e.data?.question?.id, e.data?.feedItem),
@@ -2205,7 +2141,7 @@ class Qo extends Ln {
2205
2141
  }
2206
2142
  }
2207
2143
  });
2208
- else if (e.data.question.type === F.FACTOID) {
2144
+ else if (e.data.question.type === _.FACTOID) {
2209
2145
  const n = e.data.question.options?.options.value, i = {
2210
2146
  heading: e.data.question.notification.title,
2211
2147
  body: e.data.question.notification.body,
@@ -2234,7 +2170,7 @@ class Qo extends Ln {
2234
2170
  insight: i
2235
2171
  }
2236
2172
  });
2237
- } else if (e.data.question.type === F.TWEET) {
2173
+ } else if (e.data.question.type === _.TWEET) {
2238
2174
  const n = e.data.question.options?.options.value, i = {
2239
2175
  title: e.data.question.notification?.title,
2240
2176
  body: e.data.question.notification?.body,
@@ -2261,16 +2197,16 @@ class Qo extends Ln {
2261
2197
  }
2262
2198
  };
2263
2199
  }
2264
- const Go = {
2200
+ const Ko = {
2265
2201
  [D.GAMES]: !0
2266
2202
  };
2267
- class Ko extends Ln {
2203
+ class zo extends Cn {
2268
2204
  constructor(e, r) {
2269
2205
  super(e, r);
2270
2206
  }
2271
2207
  }
2272
- const zo = (t, e, r) => t.type === D.GAMES ? new Qo(t, e, r) : new Ko(t, e), Ho = (t, e, r) => {
2273
- t.features = /* @__PURE__ */ new Map(), t.sdk.featuresList = new Y(B(/* @__PURE__ */ new Set()), "features-list"), t.activeFeature = new Y(B(D.UNSET), "activeFeature"), t.sdk.getFeatures = () => t.features, t.sdk.getFeature = (n) => t.features.get(n), t.sdk.getActiveFeature = () => t.activeFeature.getStore(), t.sdk.openFeature = (n) => {
2208
+ const Ho = (t, e, r) => t.type === D.GAMES ? new Go(t, e, r) : new zo(t, e), Wo = (t, e, r) => {
2209
+ t.features = /* @__PURE__ */ new Map(), t.sdk.featuresList = new Y(x(/* @__PURE__ */ new Set()), "features-list"), t.activeFeature = new Y(x(D.UNSET), "activeFeature"), t.sdk.getFeatures = () => t.features, t.sdk.getFeature = (n) => t.features.get(n), t.sdk.getActiveFeature = () => t.activeFeature.getStore(), t.sdk.openFeature = (n) => {
2274
2210
  t.activeFeature.setValue(n);
2275
2211
  }, t.sdk.closeFeature = (n = !1) => {
2276
2212
  const i = t.activeFeature.getValue();
@@ -2279,9 +2215,9 @@ const zo = (t, e, r) => t.type === D.GAMES ? new Qo(t, e, r) : new Ko(t, e), Ho
2279
2215
  const o = t.sdk.featuresList.getValue();
2280
2216
  o && o.delete(i), t.sdk.featuresList.setValue(o);
2281
2217
  }
2282
- }, t.initFeature = (n, i = ye.ORGANIZATION) => {
2283
- if (n.type in Go && !t.features.has(n.type)) {
2284
- const o = zo(n, i, t);
2218
+ }, t.initFeature = (n, i = pe.ORGANIZATION) => {
2219
+ if (n.type in Ko && !t.features.has(n.type)) {
2220
+ const o = Ho(n, i, t);
2285
2221
  t.features.set(n.type, o);
2286
2222
  let s = t.sdk.featuresList.getValue();
2287
2223
  s ? s.add(n.type) : s = /* @__PURE__ */ new Set([n.type]), t.sdk.featuresList.setValue(new Set(s));
@@ -2296,12 +2232,12 @@ const zo = (t, e, r) => t.type === D.GAMES ? new Qo(t, e, r) : new Ko(t, e), Ho
2296
2232
  const n = await t.stores.organizationSettings.getValue();
2297
2233
  t.features.clear(), t.sdk.featuresList.setValue(/* @__PURE__ */ new Set());
2298
2234
  for (const i of n?.overlays || [])
2299
- t.initFeature(i, ye.ORGANIZATION);
2235
+ t.initFeature(i, pe.ORGANIZATION);
2300
2236
  }, t.stores.providerStreamId.listen((n) => {
2301
2237
  n || t.reinitializeFeatures();
2302
2238
  }), t.storeSubscribe = () => {
2303
2239
  const n = (o, s) => {
2304
- if (s?.overlays && !(t.contextConfig?.skipOrganizationSettings && o === ye.ORGANIZATION))
2240
+ if (s?.overlays && !(t.contextConfig?.skipOrganizationSettings && o === pe.ORGANIZATION))
2305
2241
  for (const a of s.overlays)
2306
2242
  a.sdkEnable === !0 && (t.features.has(a.type) ? t.updateFeature(a, o) : t.initFeature(a, o));
2307
2243
  }, i = {
@@ -2317,7 +2253,7 @@ const zo = (t, e, r) => t.type === D.GAMES ? new Qo(t, e, r) : new Ko(t, e), Ho
2317
2253
  organizationSettings: (o) => {
2318
2254
  if (o.data)
2319
2255
  try {
2320
- n(ye.ORGANIZATION, o.data);
2256
+ n(pe.ORGANIZATION, o.data);
2321
2257
  } catch (s) {
2322
2258
  console.log(s);
2323
2259
  }
@@ -2325,7 +2261,7 @@ const zo = (t, e, r) => t.type === D.GAMES ? new Qo(t, e, r) : new Ko(t, e), Ho
2325
2261
  streamSettings: (o) => {
2326
2262
  if (o.data)
2327
2263
  try {
2328
- n(ye.STREAM, o.data);
2264
+ n(pe.STREAM, o.data);
2329
2265
  } catch (s) {
2330
2266
  console.log(s);
2331
2267
  }
@@ -2334,7 +2270,7 @@ const zo = (t, e, r) => t.type === D.GAMES ? new Qo(t, e, r) : new Ko(t, e), Ho
2334
2270
  t.store.subscribe(i);
2335
2271
  }, r();
2336
2272
  };
2337
- class Wo {
2273
+ class Yo {
2338
2274
  analytics;
2339
2275
  constructor(e) {
2340
2276
  this.analytics = e, this.analytics.onConnect(() => {
@@ -2353,7 +2289,7 @@ class Wo {
2353
2289
  this.analytics.write("invitation", {
2354
2290
  common: {
2355
2291
  ...this.analytics.commonStore.getValues(),
2356
- kind: x.INVITATION_ACCEPTED
2292
+ kind: q.INVITATION_ACCEPTED
2357
2293
  },
2358
2294
  category: Dr.GAMES,
2359
2295
  from: Rr.UNSET
@@ -2363,14 +2299,14 @@ class Wo {
2363
2299
  this.analytics.write("invitation", {
2364
2300
  common: {
2365
2301
  ...this.analytics.commonStore.getValues(),
2366
- kind: x.INVITATION_SENT
2302
+ kind: q.INVITATION_SENT
2367
2303
  },
2368
2304
  category: Dr.GAMES,
2369
2305
  from: e || Rr.UNSET
2370
2306
  });
2371
2307
  };
2372
2308
  }
2373
- class Yo {
2309
+ class Jo {
2374
2310
  analytics;
2375
2311
  constructor(e) {
2376
2312
  this.analytics = e, this.analytics.onConnect(() => {
@@ -2392,7 +2328,7 @@ class Yo {
2392
2328
  this.analytics.write("interactions", {
2393
2329
  common: {
2394
2330
  ...this.analytics.commonStore.getValues(),
2395
- kind: x.INTERACTIONS
2331
+ kind: q.INTERACTIONS
2396
2332
  },
2397
2333
  actionType: qr.TAP
2398
2334
  });
@@ -2401,13 +2337,13 @@ class Yo {
2401
2337
  this.analytics.write("interactions", {
2402
2338
  common: {
2403
2339
  ...this.analytics.commonStore.getValues(),
2404
- kind: x.INTERACTIONS
2340
+ kind: q.INTERACTIONS
2405
2341
  },
2406
2342
  actionType: qr.SCROLL
2407
2343
  });
2408
2344
  };
2409
2345
  }
2410
- const Jo = {
2346
+ const Xo = {
2411
2347
  [Te.UNSET]: we.UNSET,
2412
2348
  [Te.INGAME_IAB21]: we.PROMOTION_INGAME_IAB21,
2413
2349
  [Te.INGAME_IAB11_LBAR]: we.PROMOTION_INGAME_IAB11_LBAR,
@@ -2416,13 +2352,13 @@ const Jo = {
2416
2352
  [Te.INGAME_IAB61]: we.PROMOTION_INGAME_IAB61,
2417
2353
  [Te.EXTERNAL_AD]: we.PROMOTION_GAM
2418
2354
  };
2419
- class Xo {
2355
+ class Zo {
2420
2356
  analytics;
2421
2357
  constructor(e) {
2422
2358
  this.analytics = e, this.analytics.onConnect(() => {
2423
2359
  const r = (n) => {
2424
2360
  if (n.slEventBus?.type === "advertisement") {
2425
- const i = n.slEventBus.payload.advertisementType ? Jo[n.slEventBus.payload.advertisementType] : we.UNSET;
2361
+ const i = n.slEventBus.payload.advertisementType ? Xo[n.slEventBus.payload.advertisementType] : we.UNSET;
2426
2362
  switch (n.slEventBus.action) {
2427
2363
  case "videoPlay":
2428
2364
  this.videoPlay(n.slEventBus.payload, { topicSubType: i });
@@ -2449,7 +2385,7 @@ class Xo {
2449
2385
  this.analytics.write("games", {
2450
2386
  common: {
2451
2387
  ...this.analytics.commonStore.getValues(),
2452
- kind: x.POLLS_RECEIVED,
2388
+ kind: q.POLLS_RECEIVED,
2453
2389
  topicId: e,
2454
2390
  topicType: z.POLLS_PROMOTION,
2455
2391
  topicSubType: r
@@ -2461,7 +2397,7 @@ class Xo {
2461
2397
  this.analytics.write("games", {
2462
2398
  common: {
2463
2399
  ...this.analytics.commonStore.getValues(),
2464
- kind: x.POLLS_OPENED,
2400
+ kind: q.POLLS_OPENED,
2465
2401
  topicId: e,
2466
2402
  topicType: z.POLLS_PROMOTION,
2467
2403
  topicSubType: r
@@ -2474,7 +2410,7 @@ class Xo {
2474
2410
  common: {
2475
2411
  ...this.analytics.commonStore.getValues(),
2476
2412
  topicId: e,
2477
- kind: x.AD_VIDEO_PLAYED,
2413
+ kind: q.AD_VIDEO_PLAYED,
2478
2414
  topicSubType: r
2479
2415
  },
2480
2416
  pollOpenedFrom: ee.UNSET
@@ -2485,7 +2421,7 @@ class Xo {
2485
2421
  common: {
2486
2422
  ...this.analytics.commonStore.getValues(),
2487
2423
  topicId: e,
2488
- kind: x.AD_BUTTON_NAVIGATED,
2424
+ kind: q.AD_BUTTON_NAVIGATED,
2489
2425
  topicSubType: r
2490
2426
  },
2491
2427
  pollOpenedFrom: ee.UNSET
@@ -2496,7 +2432,7 @@ class Xo {
2496
2432
  common: {
2497
2433
  ...this.analytics.commonStore.getValues(),
2498
2434
  topicId: e,
2499
- kind: x.AD_BANNER_NAVIGATED,
2435
+ kind: q.AD_BANNER_NAVIGATED,
2500
2436
  topicSubType: r
2501
2437
  },
2502
2438
  pollOpenedFrom: ee.UNSET
@@ -2504,16 +2440,16 @@ class Xo {
2504
2440
  };
2505
2441
  }
2506
2442
  const Ze = {
2507
- [F.UNSET]: z.UNSET,
2508
- [F.FACTOID]: z.POLLS_INSIGHT,
2509
- [F.POLL]: z.POLLS_POLL,
2510
- [F.PREDICTION]: z.POLLS_PREDICTION,
2511
- [F.PROMOTION]: z.POLLS_PROMOTION,
2512
- [F.TRIVIA]: z.POLLS_TRIVIA,
2513
- [F.TWEET]: z.POLLS_TWITTER
2443
+ [_.UNSET]: z.UNSET,
2444
+ [_.FACTOID]: z.POLLS_INSIGHT,
2445
+ [_.POLL]: z.POLLS_POLL,
2446
+ [_.PREDICTION]: z.POLLS_PREDICTION,
2447
+ [_.PROMOTION]: z.POLLS_PROMOTION,
2448
+ [_.TRIVIA]: z.POLLS_TRIVIA,
2449
+ [_.TWEET]: z.POLLS_TWITTER
2514
2450
  };
2515
- F.UNSET + "", he.UNSET, F.FACTOID + "", he.POLLS, F.POLL + "", he.POLLS, F.PREDICTION + "", he.POLLS, F.PROMOTION + "", he.POLLS, F.TRIVIA + "", he.POLLS, F.TWEET + "", he.POLLS;
2516
- const Zo = {
2451
+ _.UNSET + "", fe.UNSET, _.FACTOID + "", fe.POLLS, _.POLL + "", fe.POLLS, _.PREDICTION + "", fe.POLLS, _.PROMOTION + "", fe.POLLS, _.TRIVIA + "", fe.POLLS, _.TWEET + "", fe.POLLS;
2452
+ const es = {
2517
2453
  [D.UNSET]: G.UNSET,
2518
2454
  [D.INPLAY]: G.INPLAY,
2519
2455
  [D.MESSAGING]: G.MESSAGING,
@@ -2533,7 +2469,7 @@ const Zo = {
2533
2469
  [D.HIGHLIGHTS]: G.HIGHLIGHTS,
2534
2470
  [D.PUBLIC_CHAT]: G.PUBLIC_CHAT
2535
2471
  };
2536
- class es {
2472
+ class ts {
2537
2473
  analytics;
2538
2474
  constructor(e) {
2539
2475
  this.analytics = e, this.analytics.onConnect(() => {
@@ -2555,11 +2491,11 @@ class es {
2555
2491
  this.analytics.write("notification", {
2556
2492
  common: {
2557
2493
  ...this.analytics.commonStore.getValues(),
2558
- kind: x.NOTIFICATION_RECEIVED,
2494
+ kind: q.NOTIFICATION_RECEIVED,
2559
2495
  topicId: e,
2560
2496
  topicType: r ? Ze[r] : z.UNSET
2561
2497
  },
2562
- notificationKind: he.POLLS,
2498
+ notificationKind: fe.POLLS,
2563
2499
  notificationType: xr.IN_APP
2564
2500
  });
2565
2501
  };
@@ -2567,16 +2503,16 @@ class es {
2567
2503
  this.analytics.write("notification", {
2568
2504
  common: {
2569
2505
  ...this.analytics.commonStore.getValues(),
2570
- kind: x.NOTIFICATION_OPENED,
2506
+ kind: q.NOTIFICATION_OPENED,
2571
2507
  topicId: e,
2572
2508
  topicType: r ? Ze[r] : z.UNSET
2573
2509
  },
2574
- notificationKind: he.POLLS,
2510
+ notificationKind: fe.POLLS,
2575
2511
  notificationType: xr.IN_APP
2576
2512
  });
2577
2513
  };
2578
2514
  }
2579
- class ts {
2515
+ class rs {
2580
2516
  analytics;
2581
2517
  constructor(e) {
2582
2518
  this.analytics = e, this.analytics.onConnect(() => {
@@ -2608,7 +2544,7 @@ class ts {
2608
2544
  this.analytics.write("games", {
2609
2545
  common: {
2610
2546
  ...this.analytics.commonStore.getValues(),
2611
- kind: x.POLLS_RECEIVED,
2547
+ kind: q.POLLS_RECEIVED,
2612
2548
  topicId: e,
2613
2549
  topicType: r ? Ze[r] : z.UNSET
2614
2550
  },
@@ -2620,7 +2556,7 @@ class ts {
2620
2556
  this.analytics.write("games", {
2621
2557
  common: {
2622
2558
  ...this.analytics.commonStore.getValues(),
2623
- kind: x.POLLS_OPENED,
2559
+ kind: q.POLLS_OPENED,
2624
2560
  topicId: e,
2625
2561
  topicType: r ? Ze[r] : z.UNSET
2626
2562
  },
@@ -2632,7 +2568,7 @@ class ts {
2632
2568
  this.analytics.write("games", {
2633
2569
  common: {
2634
2570
  ...this.analytics.commonStore.getValues(),
2635
- kind: x.POLLS_VOTE,
2571
+ kind: q.POLLS_VOTE,
2636
2572
  topicId: e,
2637
2573
  topicType: r ? Ze[r] : z.UNSET
2638
2574
  },
@@ -2644,7 +2580,7 @@ class ts {
2644
2580
  this.analytics.write("games", {
2645
2581
  common: {
2646
2582
  ...this.analytics.commonStore.getValues(),
2647
- kind: x.GAMES_JOINED
2583
+ kind: q.GAMES_JOINED
2648
2584
  },
2649
2585
  pollOpenedFrom: ee.UNSET
2650
2586
  });
@@ -2654,28 +2590,28 @@ class ts {
2654
2590
  this.analytics.write("games", {
2655
2591
  common: {
2656
2592
  ...this.analytics.commonStore.getValues(),
2657
- kind: x.POLLS_NAVIGATED
2593
+ kind: q.POLLS_NAVIGATED
2658
2594
  },
2659
2595
  pollOpenedFrom: ee.UNSET
2660
2596
  });
2661
2597
  };
2662
2598
  }
2663
- const rs = ({ transport: t, $commonStore: e }) => {
2599
+ const ns = ({ transport: t, $commonStore: e }) => {
2664
2600
  let r;
2665
- const n = B(!1), i = 5e3, { client: o, queryKey: s } = t.createPromiseClient(En, {
2601
+ const n = x(!1), i = 5e3, { client: o, queryKey: s } = t.createPromiseClient(En, {
2666
2602
  method: "send",
2667
2603
  params: [n]
2668
2604
  }), a = t.nanoquery.createFetcherStore(s, {
2669
2605
  fetcher: async () => {
2670
- const l = e.getStore().get();
2606
+ const h = e.getStore().get();
2671
2607
  try {
2672
2608
  await o.unary({
2673
2609
  message: {
2674
2610
  case: "heartbeat",
2675
2611
  value: {
2676
2612
  common: {
2677
- ...l,
2678
- kind: x.SESSION_HEARTBEAT
2613
+ ...h,
2614
+ kind: q.SESSION_HEARTBEAT
2679
2615
  }
2680
2616
  }
2681
2617
  }
@@ -2697,8 +2633,8 @@ const rs = ({ transport: t, $commonStore: e }) => {
2697
2633
  return { enable: f, disable: c, mount: u, unmount: () => {
2698
2634
  me.debug("unmounted heartbeat"), a.off(), r?.(), r = void 0, c();
2699
2635
  } };
2700
- }, me = le("analytics");
2701
- class ns {
2636
+ }, me = be("analytics");
2637
+ class is {
2702
2638
  commonStore;
2703
2639
  notifications;
2704
2640
  polls;
@@ -2711,7 +2647,7 @@ class ns {
2711
2647
  listenersCancels;
2712
2648
  connected = !1;
2713
2649
  constructor(e) {
2714
- this.listeners = /* @__PURE__ */ new Set(), this.listenersCancels = /* @__PURE__ */ new Set(), this.commonStore = new Le(te({}), "common-analytics"), this.connectToSDK(e), this.heartbeat = rs({ transport: e.analyticsTransport, $commonStore: this.commonStore }), this.notifications = new es(this), this.polls = new ts(this), this.invitation = new Wo(this), this.interactions = new Yo(this), this.advertisement = new Xo(this);
2650
+ this.listeners = /* @__PURE__ */ new Set(), this.listenersCancels = /* @__PURE__ */ new Set(), this.commonStore = new Ce(te({}), "common-analytics"), this.connectToSDK(e), this.heartbeat = ns({ transport: e.analyticsTransport, $commonStore: this.commonStore }), this.notifications = new ts(this), this.polls = new rs(this), this.invitation = new Yo(this), this.interactions = new Jo(this), this.advertisement = new Zo(this);
2715
2651
  const { client: r } = e.analyticsTransport.createPromiseClient(En, {
2716
2652
  method: "send"
2717
2653
  });
@@ -2741,7 +2677,7 @@ class ns {
2741
2677
  this.onConnect(() => e.stores.slStreamId.getAtomStore().subscribe((r) => {
2742
2678
  this.writeCommon("eventId", r);
2743
2679
  })), this.onConnect(() => e.sdk.getActiveFeature().subscribe((r) => {
2744
- r && this.writeCommon("category", Zo[r]), r !== D.UNSET ? this.writeCommon("overlaySessionId", nr()) : this.writeCommon("overlaySessionId", "");
2680
+ r && this.writeCommon("category", es[r]), r !== D.UNSET ? this.writeCommon("overlaySessionId", nr()) : this.writeCommon("overlaySessionId", "");
2745
2681
  })), this.onConnect(() => {
2746
2682
  const r = window.matchMedia("(orientation: portrait)"), n = (i) => {
2747
2683
  this.writeCommon("screenOrientation", i.matches ? Br.PORTRAIT : Br.LANDSCAPE);
@@ -2754,17 +2690,17 @@ class ns {
2754
2690
  }));
2755
2691
  };
2756
2692
  }
2757
- const is = (t, e, r) => {
2758
- t.analytics = new ns(t), t.sdk.onMount({ name: "analytics" }, () => (t.analytics.connect(), () => {
2693
+ const os = (t, e, r) => {
2694
+ t.analytics = new is(t), t.sdk.onMount({ name: "analytics" }, () => (t.analytics.connect(), () => {
2759
2695
  t.analytics.disconnect();
2760
2696
  })), r();
2761
2697
  };
2762
2698
  var br = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
2763
- function os(t) {
2699
+ function ss(t) {
2764
2700
  return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
2765
2701
  }
2766
2702
  var Sr = { exports: {} }, wr = { exports: {} };
2767
- function ss(t) {
2703
+ function as(t) {
2768
2704
  var e = new t(), r = e;
2769
2705
  function n() {
2770
2706
  var o = e;
@@ -2778,33 +2714,33 @@ function ss(t) {
2778
2714
  release: i
2779
2715
  };
2780
2716
  }
2781
- var as = ss, us = as;
2782
- function Rn(t, e, r) {
2717
+ var us = as, cs = us;
2718
+ function Vn(t, e, r) {
2783
2719
  if (typeof t == "function" && (r = e, e = t, t = null), !(r >= 1))
2784
2720
  throw new Error("fastqueue concurrency must be equal to or greater than 1");
2785
- var n = us(cs), i = null, o = null, s = 0, a = null, u = {
2786
- push: w,
2787
- drain: W,
2788
- saturated: W,
2721
+ var n = cs(ls), i = null, o = null, s = 0, a = null, u = {
2722
+ push: I,
2723
+ drain: H,
2724
+ saturated: H,
2789
2725
  pause: c,
2790
2726
  paused: !1,
2791
2727
  get concurrency() {
2792
2728
  return r;
2793
2729
  },
2794
- set concurrency(k) {
2795
- if (!(k >= 1))
2730
+ set concurrency(P) {
2731
+ if (!(P >= 1))
2796
2732
  throw new Error("fastqueue concurrency must be equal to or greater than 1");
2797
- if (r = k, !u.paused)
2733
+ if (r = P, !u.paused)
2798
2734
  for (; i && s < r; )
2799
2735
  s++, L();
2800
2736
  },
2801
2737
  running: f,
2802
2738
  resume: g,
2803
2739
  idle: v,
2804
- length: h,
2805
- getQueue: l,
2740
+ length: l,
2741
+ getQueue: h,
2806
2742
  unshift: b,
2807
- empty: W,
2743
+ empty: H,
2808
2744
  kill: R,
2809
2745
  killAndDrain: Q,
2810
2746
  error: X
@@ -2816,14 +2752,14 @@ function Rn(t, e, r) {
2816
2752
  function c() {
2817
2753
  u.paused = !0;
2818
2754
  }
2819
- function h() {
2820
- for (var k = i, V = 0; k; )
2821
- k = k.next, V++;
2755
+ function l() {
2756
+ for (var P = i, V = 0; P; )
2757
+ P = P.next, V++;
2822
2758
  return V;
2823
2759
  }
2824
- function l() {
2825
- for (var k = i, V = []; k; )
2826
- V.push(k.value), k = k.next;
2760
+ function h() {
2761
+ for (var P = i, V = []; P; )
2762
+ V.push(P.value), P = P.next;
2827
2763
  return V;
2828
2764
  }
2829
2765
  function g() {
@@ -2839,141 +2775,141 @@ function Rn(t, e, r) {
2839
2775
  function v() {
2840
2776
  return s === 0 && u.length() === 0;
2841
2777
  }
2842
- function w(k, V) {
2778
+ function I(P, V) {
2843
2779
  var T = n.get();
2844
- T.context = t, T.release = L, T.value = k, T.callback = V || W, T.errorHandler = a, s >= r || u.paused ? o ? (o.next = T, o = T) : (i = T, o = T, u.saturated()) : (s++, e.call(t, T.value, T.worked));
2780
+ T.context = t, T.release = L, T.value = P, T.callback = V || H, T.errorHandler = a, s >= r || u.paused ? o ? (o.next = T, o = T) : (i = T, o = T, u.saturated()) : (s++, e.call(t, T.value, T.worked));
2845
2781
  }
2846
- function b(k, V) {
2782
+ function b(P, V) {
2847
2783
  var T = n.get();
2848
- T.context = t, T.release = L, T.value = k, T.callback = V || W, T.errorHandler = a, s >= r || u.paused ? i ? (T.next = i, i = T) : (i = T, o = T, u.saturated()) : (s++, e.call(t, T.value, T.worked));
2784
+ T.context = t, T.release = L, T.value = P, T.callback = V || H, T.errorHandler = a, s >= r || u.paused ? i ? (T.next = i, i = T) : (i = T, o = T, u.saturated()) : (s++, e.call(t, T.value, T.worked));
2849
2785
  }
2850
- function L(k) {
2851
- k && n.release(k);
2786
+ function L(P) {
2787
+ P && n.release(P);
2852
2788
  var V = i;
2853
2789
  V && s <= r ? u.paused ? s-- : (o === i && (o = null), i = V.next, V.next = null, e.call(t, V.value, V.worked), o === null && u.empty()) : --s === 0 && u.drain();
2854
2790
  }
2855
2791
  function R() {
2856
- i = null, o = null, u.drain = W;
2792
+ i = null, o = null, u.drain = H;
2857
2793
  }
2858
2794
  function Q() {
2859
- i = null, o = null, u.drain(), u.drain = W;
2795
+ i = null, o = null, u.drain(), u.drain = H;
2860
2796
  }
2861
- function X(k) {
2862
- a = k;
2797
+ function X(P) {
2798
+ a = P;
2863
2799
  }
2864
2800
  }
2865
- function W() {
2801
+ function H() {
2866
2802
  }
2867
- function cs() {
2868
- this.value = null, this.callback = W, this.next = null, this.release = W, this.context = null, this.errorHandler = null;
2803
+ function ls() {
2804
+ this.value = null, this.callback = H, this.next = null, this.release = H, this.context = null, this.errorHandler = null;
2869
2805
  var t = this;
2870
2806
  this.worked = function(r, n) {
2871
2807
  var i = t.callback, o = t.errorHandler, s = t.value;
2872
- t.value = null, t.callback = W, t.errorHandler && o(r, s), i.call(t.context, r, n), t.release(t);
2808
+ t.value = null, t.callback = H, t.errorHandler && o(r, s), i.call(t.context, r, n), t.release(t);
2873
2809
  };
2874
2810
  }
2875
- function ls(t, e, r) {
2811
+ function ds(t, e, r) {
2876
2812
  typeof t == "function" && (r = e, e = t, t = null);
2877
- function n(c, h) {
2878
- e.call(this, c).then(function(l) {
2879
- h(null, l);
2880
- }, h);
2813
+ function n(c, l) {
2814
+ e.call(this, c).then(function(h) {
2815
+ l(null, h);
2816
+ }, l);
2881
2817
  }
2882
- var i = Rn(t, n, r), o = i.push, s = i.unshift;
2818
+ var i = Vn(t, n, r), o = i.push, s = i.unshift;
2883
2819
  return i.push = a, i.unshift = u, i.drained = f, i;
2884
2820
  function a(c) {
2885
- var h = new Promise(function(l, g) {
2886
- o(c, function(v, w) {
2821
+ var l = new Promise(function(h, g) {
2822
+ o(c, function(v, I) {
2887
2823
  if (v) {
2888
2824
  g(v);
2889
2825
  return;
2890
2826
  }
2891
- l(w);
2827
+ h(I);
2892
2828
  });
2893
2829
  });
2894
- return h.catch(W), h;
2830
+ return l.catch(H), l;
2895
2831
  }
2896
2832
  function u(c) {
2897
- var h = new Promise(function(l, g) {
2898
- s(c, function(v, w) {
2833
+ var l = new Promise(function(h, g) {
2834
+ s(c, function(v, I) {
2899
2835
  if (v) {
2900
2836
  g(v);
2901
2837
  return;
2902
2838
  }
2903
- l(w);
2839
+ h(I);
2904
2840
  });
2905
2841
  });
2906
- return h.catch(W), h;
2842
+ return l.catch(H), l;
2907
2843
  }
2908
2844
  function f() {
2909
2845
  if (i.idle())
2910
- return new Promise(function(l) {
2911
- l();
2846
+ return new Promise(function(h) {
2847
+ h();
2912
2848
  });
2913
- var c = i.drain, h = new Promise(function(l) {
2849
+ var c = i.drain, l = new Promise(function(h) {
2914
2850
  i.drain = function() {
2915
- c(), l();
2851
+ c(), h();
2916
2852
  };
2917
2853
  });
2918
- return h;
2854
+ return l;
2919
2855
  }
2920
2856
  }
2921
- wr.exports = Rn;
2922
- wr.exports.promise = ls;
2923
- var Vn = wr.exports, Ar = { exports: {} }, Qe = typeof Reflect == "object" ? Reflect : null, Jr = Qe && typeof Qe.apply == "function" ? Qe.apply : function(e, r, n) {
2857
+ wr.exports = Vn;
2858
+ wr.exports.promise = ds;
2859
+ var $n = wr.exports, Ar = { exports: {} }, Qe = typeof Reflect == "object" ? Reflect : null, Jr = Qe && typeof Qe.apply == "function" ? Qe.apply : function(e, r, n) {
2924
2860
  return Function.prototype.apply.call(e, r, n);
2925
- }, pt;
2926
- Qe && typeof Qe.ownKeys == "function" ? pt = Qe.ownKeys : Object.getOwnPropertySymbols ? pt = function(e) {
2861
+ }, ht;
2862
+ Qe && typeof Qe.ownKeys == "function" ? ht = Qe.ownKeys : Object.getOwnPropertySymbols ? ht = function(e) {
2927
2863
  return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e));
2928
- } : pt = function(e) {
2864
+ } : ht = function(e) {
2929
2865
  return Object.getOwnPropertyNames(e);
2930
2866
  };
2931
- function ds(t) {
2867
+ function fs(t) {
2932
2868
  console && console.warn && console.warn(t);
2933
2869
  }
2934
- var $n = Number.isNaN || function(e) {
2870
+ var Mn = Number.isNaN || function(e) {
2935
2871
  return e !== e;
2936
2872
  };
2937
- function P() {
2938
- P.init.call(this);
2873
+ function N() {
2874
+ N.init.call(this);
2939
2875
  }
2940
- Ar.exports = P;
2941
- Ar.exports.once = ys;
2942
- P.EventEmitter = P;
2943
- P.prototype._events = void 0;
2944
- P.prototype._eventsCount = 0;
2945
- P.prototype._maxListeners = void 0;
2876
+ Ar.exports = N;
2877
+ Ar.exports.once = ms;
2878
+ N.EventEmitter = N;
2879
+ N.prototype._events = void 0;
2880
+ N.prototype._eventsCount = 0;
2881
+ N.prototype._maxListeners = void 0;
2946
2882
  var Xr = 10;
2947
2883
  function Nt(t) {
2948
2884
  if (typeof t != "function")
2949
2885
  throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof t);
2950
2886
  }
2951
- Object.defineProperty(P, "defaultMaxListeners", {
2887
+ Object.defineProperty(N, "defaultMaxListeners", {
2952
2888
  enumerable: !0,
2953
2889
  get: function() {
2954
2890
  return Xr;
2955
2891
  },
2956
2892
  set: function(t) {
2957
- if (typeof t != "number" || t < 0 || $n(t))
2893
+ if (typeof t != "number" || t < 0 || Mn(t))
2958
2894
  throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + t + ".");
2959
2895
  Xr = t;
2960
2896
  }
2961
2897
  });
2962
- P.init = function() {
2898
+ N.init = function() {
2963
2899
  (this._events === void 0 || this._events === Object.getPrototypeOf(this)._events) && (this._events = /* @__PURE__ */ Object.create(null), this._eventsCount = 0), this._maxListeners = this._maxListeners || void 0;
2964
2900
  };
2965
- P.prototype.setMaxListeners = function(e) {
2966
- if (typeof e != "number" || e < 0 || $n(e))
2901
+ N.prototype.setMaxListeners = function(e) {
2902
+ if (typeof e != "number" || e < 0 || Mn(e))
2967
2903
  throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + e + ".");
2968
2904
  return this._maxListeners = e, this;
2969
2905
  };
2970
- function Mn(t) {
2971
- return t._maxListeners === void 0 ? P.defaultMaxListeners : t._maxListeners;
2906
+ function jn(t) {
2907
+ return t._maxListeners === void 0 ? N.defaultMaxListeners : t._maxListeners;
2972
2908
  }
2973
- P.prototype.getMaxListeners = function() {
2974
- return Mn(this);
2909
+ N.prototype.getMaxListeners = function() {
2910
+ return jn(this);
2975
2911
  };
2976
- P.prototype.emit = function(e) {
2912
+ N.prototype.emit = function(e) {
2977
2913
  for (var r = [], n = 1; n < arguments.length; n++) r.push(arguments[n]);
2978
2914
  var i = e === "error", o = this._events;
2979
2915
  if (o !== void 0)
@@ -2993,11 +2929,11 @@ P.prototype.emit = function(e) {
2993
2929
  if (typeof u == "function")
2994
2930
  Jr(u, this, r);
2995
2931
  else
2996
- for (var f = u.length, c = xn(u, f), n = 0; n < f; ++n)
2932
+ for (var f = u.length, c = Qn(u, f), n = 0; n < f; ++n)
2997
2933
  Jr(c[n], this, r);
2998
2934
  return !0;
2999
2935
  };
3000
- function jn(t, e, r, n) {
2936
+ function Un(t, e, r, n) {
3001
2937
  var i, o, s;
3002
2938
  if (Nt(r), o = t._events, o === void 0 ? (o = t._events = /* @__PURE__ */ Object.create(null), t._eventsCount = 0) : (o.newListener !== void 0 && (t.emit(
3003
2939
  "newListener",
@@ -3005,35 +2941,35 @@ function jn(t, e, r, n) {
3005
2941
  r.listener ? r.listener : r
3006
2942
  ), o = t._events), s = o[e]), s === void 0)
3007
2943
  s = o[e] = r, ++t._eventsCount;
3008
- else if (typeof s == "function" ? s = o[e] = n ? [r, s] : [s, r] : n ? s.unshift(r) : s.push(r), i = Mn(t), i > 0 && s.length > i && !s.warned) {
2944
+ else if (typeof s == "function" ? s = o[e] = n ? [r, s] : [s, r] : n ? s.unshift(r) : s.push(r), i = jn(t), i > 0 && s.length > i && !s.warned) {
3009
2945
  s.warned = !0;
3010
2946
  var a = new Error("Possible EventEmitter memory leak detected. " + s.length + " " + String(e) + " listeners added. Use emitter.setMaxListeners() to increase limit");
3011
- a.name = "MaxListenersExceededWarning", a.emitter = t, a.type = e, a.count = s.length, ds(a);
2947
+ a.name = "MaxListenersExceededWarning", a.emitter = t, a.type = e, a.count = s.length, fs(a);
3012
2948
  }
3013
2949
  return t;
3014
2950
  }
3015
- P.prototype.addListener = function(e, r) {
3016
- return jn(this, e, r, !1);
2951
+ N.prototype.addListener = function(e, r) {
2952
+ return Un(this, e, r, !1);
3017
2953
  };
3018
- P.prototype.on = P.prototype.addListener;
3019
- P.prototype.prependListener = function(e, r) {
3020
- return jn(this, e, r, !0);
2954
+ N.prototype.on = N.prototype.addListener;
2955
+ N.prototype.prependListener = function(e, r) {
2956
+ return Un(this, e, r, !0);
3021
2957
  };
3022
- function fs() {
2958
+ function hs() {
3023
2959
  if (!this.fired)
3024
2960
  return this.target.removeListener(this.type, this.wrapFn), this.fired = !0, arguments.length === 0 ? this.listener.call(this.target) : this.listener.apply(this.target, arguments);
3025
2961
  }
3026
- function Un(t, e, r) {
3027
- var n = { fired: !1, wrapFn: void 0, target: t, type: e, listener: r }, i = fs.bind(n);
2962
+ function Bn(t, e, r) {
2963
+ var n = { fired: !1, wrapFn: void 0, target: t, type: e, listener: r }, i = hs.bind(n);
3028
2964
  return i.listener = r, n.wrapFn = i, i;
3029
2965
  }
3030
- P.prototype.once = function(e, r) {
3031
- return Nt(r), this.on(e, Un(this, e, r)), this;
2966
+ N.prototype.once = function(e, r) {
2967
+ return Nt(r), this.on(e, Bn(this, e, r)), this;
3032
2968
  };
3033
- P.prototype.prependOnceListener = function(e, r) {
3034
- return Nt(r), this.prependListener(e, Un(this, e, r)), this;
2969
+ N.prototype.prependOnceListener = function(e, r) {
2970
+ return Nt(r), this.prependListener(e, Bn(this, e, r)), this;
3035
2971
  };
3036
- P.prototype.removeListener = function(e, r) {
2972
+ N.prototype.removeListener = function(e, r) {
3037
2973
  var n, i, o, s, a;
3038
2974
  if (Nt(r), i = this._events, i === void 0)
3039
2975
  return this;
@@ -3049,12 +2985,12 @@ P.prototype.removeListener = function(e, r) {
3049
2985
  }
3050
2986
  if (o < 0)
3051
2987
  return this;
3052
- o === 0 ? n.shift() : hs(n, o), n.length === 1 && (i[e] = n[0]), i.removeListener !== void 0 && this.emit("removeListener", e, a || r);
2988
+ o === 0 ? n.shift() : ps(n, o), n.length === 1 && (i[e] = n[0]), i.removeListener !== void 0 && this.emit("removeListener", e, a || r);
3053
2989
  }
3054
2990
  return this;
3055
2991
  };
3056
- P.prototype.off = P.prototype.removeListener;
3057
- P.prototype.removeAllListeners = function(e) {
2992
+ N.prototype.off = N.prototype.removeListener;
2993
+ N.prototype.removeAllListeners = function(e) {
3058
2994
  var r, n, i;
3059
2995
  if (n = this._events, n === void 0)
3060
2996
  return this;
@@ -3073,24 +3009,24 @@ P.prototype.removeAllListeners = function(e) {
3073
3009
  this.removeListener(e, r[i]);
3074
3010
  return this;
3075
3011
  };
3076
- function Bn(t, e, r) {
3012
+ function qn(t, e, r) {
3077
3013
  var n = t._events;
3078
3014
  if (n === void 0)
3079
3015
  return [];
3080
3016
  var i = n[e];
3081
- return i === void 0 ? [] : typeof i == "function" ? r ? [i.listener || i] : [i] : r ? ps(i) : xn(i, i.length);
3017
+ return i === void 0 ? [] : typeof i == "function" ? r ? [i.listener || i] : [i] : r ? ys(i) : Qn(i, i.length);
3082
3018
  }
3083
- P.prototype.listeners = function(e) {
3084
- return Bn(this, e, !0);
3019
+ N.prototype.listeners = function(e) {
3020
+ return qn(this, e, !0);
3085
3021
  };
3086
- P.prototype.rawListeners = function(e) {
3087
- return Bn(this, e, !1);
3022
+ N.prototype.rawListeners = function(e) {
3023
+ return qn(this, e, !1);
3088
3024
  };
3089
- P.listenerCount = function(t, e) {
3090
- return typeof t.listenerCount == "function" ? t.listenerCount(e) : qn.call(t, e);
3025
+ N.listenerCount = function(t, e) {
3026
+ return typeof t.listenerCount == "function" ? t.listenerCount(e) : xn.call(t, e);
3091
3027
  };
3092
- P.prototype.listenerCount = qn;
3093
- function qn(t) {
3028
+ N.prototype.listenerCount = xn;
3029
+ function xn(t) {
3094
3030
  var e = this._events;
3095
3031
  if (e !== void 0) {
3096
3032
  var r = e[t];
@@ -3101,25 +3037,25 @@ function qn(t) {
3101
3037
  }
3102
3038
  return 0;
3103
3039
  }
3104
- P.prototype.eventNames = function() {
3105
- return this._eventsCount > 0 ? pt(this._events) : [];
3040
+ N.prototype.eventNames = function() {
3041
+ return this._eventsCount > 0 ? ht(this._events) : [];
3106
3042
  };
3107
- function xn(t, e) {
3043
+ function Qn(t, e) {
3108
3044
  for (var r = new Array(e), n = 0; n < e; ++n)
3109
3045
  r[n] = t[n];
3110
3046
  return r;
3111
3047
  }
3112
- function hs(t, e) {
3048
+ function ps(t, e) {
3113
3049
  for (; e + 1 < t.length; e++)
3114
3050
  t[e] = t[e + 1];
3115
3051
  t.pop();
3116
3052
  }
3117
- function ps(t) {
3053
+ function ys(t) {
3118
3054
  for (var e = new Array(t.length), r = 0; r < e.length; ++r)
3119
3055
  e[r] = t[r].listener || t[r];
3120
3056
  return e;
3121
3057
  }
3122
- function ys(t, e) {
3058
+ function ms(t, e) {
3123
3059
  return new Promise(function(r, n) {
3124
3060
  function i(s) {
3125
3061
  t.removeListener(e, o), n(s);
@@ -3127,13 +3063,13 @@ function ys(t, e) {
3127
3063
  function o() {
3128
3064
  typeof t.removeListener == "function" && t.removeListener("error", i), r([].slice.call(arguments));
3129
3065
  }
3130
- Qn(t, e, o, { once: !0 }), e !== "error" && gs(t, i, { once: !0 });
3066
+ Gn(t, e, o, { once: !0 }), e !== "error" && gs(t, i, { once: !0 });
3131
3067
  });
3132
3068
  }
3133
3069
  function gs(t, e, r) {
3134
- typeof t.on == "function" && Qn(t, "error", e, r);
3070
+ typeof t.on == "function" && Gn(t, "error", e, r);
3135
3071
  }
3136
- function Qn(t, e, r, n) {
3072
+ function Gn(t, e, r, n) {
3137
3073
  if (typeof t.on == "function")
3138
3074
  n.once ? t.once(e, r) : t.on(e, r);
3139
3075
  else if (typeof t.addEventListener == "function")
@@ -3143,7 +3079,7 @@ function Qn(t, e, r, n) {
3143
3079
  else
3144
3080
  throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type ' + typeof t);
3145
3081
  }
3146
- var Gn = Ar.exports, Ft = {}, Kn = {}, zn = function() {
3082
+ var Kn = Ar.exports, Ft = {}, zn = {}, Hn = function() {
3147
3083
  if (typeof Symbol != "function" || typeof Object.getOwnPropertySymbols != "function")
3148
3084
  return !1;
3149
3085
  if (typeof Symbol.iterator == "symbol")
@@ -3166,34 +3102,34 @@ var Gn = Ar.exports, Ft = {}, Kn = {}, zn = function() {
3166
3102
  return !1;
3167
3103
  }
3168
3104
  return !0;
3169
- }, ms = zn, Dt = function() {
3170
- return ms() && !!Symbol.toStringTag;
3171
- }, vs = Error, bs = EvalError, Ss = RangeError, ws = ReferenceError, Hn = SyntaxError, Rt = TypeError, As = URIError, Zr = typeof Symbol < "u" && Symbol, Es = zn, Is = function() {
3172
- return typeof Zr != "function" || typeof Symbol != "function" || typeof Zr("foo") != "symbol" || typeof Symbol("bar") != "symbol" ? !1 : Es();
3105
+ }, vs = Hn, Dt = function() {
3106
+ return vs() && !!Symbol.toStringTag;
3107
+ }, bs = Error, Ss = EvalError, ws = RangeError, As = ReferenceError, Wn = SyntaxError, Rt = TypeError, Es = URIError, Zr = typeof Symbol < "u" && Symbol, Is = Hn, Ts = function() {
3108
+ return typeof Zr != "function" || typeof Symbol != "function" || typeof Zr("foo") != "symbol" || typeof Symbol("bar") != "symbol" ? !1 : Is();
3173
3109
  }, Ut = {
3174
3110
  __proto__: null,
3175
3111
  foo: {}
3176
- }, Ts = Object, Os = function() {
3177
- return { __proto__: Ut }.foo === Ut.foo && !(Ut instanceof Ts);
3178
- }, _s = "Function.prototype.bind called on incompatible ", Ls = Object.prototype.toString, Cs = Math.max, ks = "[object Function]", en = function(e, r) {
3112
+ }, Os = Object, _s = function() {
3113
+ return { __proto__: Ut }.foo === Ut.foo && !(Ut instanceof Os);
3114
+ }, Cs = "Function.prototype.bind called on incompatible ", Ls = Object.prototype.toString, ks = Math.max, Ps = "[object Function]", en = function(e, r) {
3179
3115
  for (var n = [], i = 0; i < e.length; i += 1)
3180
3116
  n[i] = e[i];
3181
3117
  for (var o = 0; o < r.length; o += 1)
3182
3118
  n[o + e.length] = r[o];
3183
3119
  return n;
3184
- }, Ps = function(e, r) {
3120
+ }, Ns = function(e, r) {
3185
3121
  for (var n = [], i = r, o = 0; i < e.length; i += 1, o += 1)
3186
3122
  n[o] = e[i];
3187
3123
  return n;
3188
- }, Ns = function(t, e) {
3124
+ }, Fs = function(t, e) {
3189
3125
  for (var r = "", n = 0; n < t.length; n += 1)
3190
3126
  r += t[n], n + 1 < t.length && (r += e);
3191
3127
  return r;
3192
- }, Fs = function(e) {
3128
+ }, Ds = function(e) {
3193
3129
  var r = this;
3194
- if (typeof r != "function" || Ls.apply(r) !== ks)
3195
- throw new TypeError(_s + r);
3196
- for (var n = Ps(arguments, 1), i, o = function() {
3130
+ if (typeof r != "function" || Ls.apply(r) !== Ps)
3131
+ throw new TypeError(Cs + r);
3132
+ for (var n = Ns(arguments, 1), i, o = function() {
3197
3133
  if (this instanceof i) {
3198
3134
  var c = r.apply(
3199
3135
  this,
@@ -3205,17 +3141,17 @@ var Gn = Ar.exports, Ft = {}, Kn = {}, zn = function() {
3205
3141
  e,
3206
3142
  en(n, arguments)
3207
3143
  );
3208
- }, s = Cs(0, r.length - n.length), a = [], u = 0; u < s; u++)
3144
+ }, s = ks(0, r.length - n.length), a = [], u = 0; u < s; u++)
3209
3145
  a[u] = "$" + u;
3210
- if (i = Function("binder", "return function (" + Ns(a, ",") + "){ return binder.apply(this,arguments); }")(o), r.prototype) {
3146
+ if (i = Function("binder", "return function (" + Fs(a, ",") + "){ return binder.apply(this,arguments); }")(o), r.prototype) {
3211
3147
  var f = function() {
3212
3148
  };
3213
3149
  f.prototype = r.prototype, i.prototype = new f(), f.prototype = null;
3214
3150
  }
3215
3151
  return i;
3216
- }, Ds = Fs, Er = Function.prototype.bind || Ds, Rs = Function.prototype.call, Vs = Object.prototype.hasOwnProperty, $s = Er, Ms = $s.call(Rs, Vs), I, js = vs, Us = bs, Bs = Ss, qs = ws, Ke = Hn, Ge = Rt, xs = As, Wn = Function, Bt = function(t) {
3152
+ }, Rs = Ds, Er = Function.prototype.bind || Rs, Vs = Function.prototype.call, $s = Object.prototype.hasOwnProperty, Ms = Er, js = Ms.call(Vs, $s), E, Us = bs, Bs = Ss, qs = ws, xs = As, Ke = Wn, Ge = Rt, Qs = Es, Yn = Function, Bt = function(t) {
3217
3153
  try {
3218
- return Wn('"use strict"; return (' + t + ").constructor;")();
3154
+ return Yn('"use strict"; return (' + t + ").constructor;")();
3219
3155
  } catch {
3220
3156
  }
3221
3157
  }, ke = Object.getOwnPropertyDescriptor;
@@ -3227,7 +3163,7 @@ if (ke)
3227
3163
  }
3228
3164
  var qt = function() {
3229
3165
  throw new Ge();
3230
- }, Qs = ke ? function() {
3166
+ }, Gs = ke ? function() {
3231
3167
  try {
3232
3168
  return arguments.callee, qt;
3233
3169
  } catch {
@@ -3237,86 +3173,86 @@ var qt = function() {
3237
3173
  return qt;
3238
3174
  }
3239
3175
  }
3240
- }() : qt, $e = Is(), Gs = Os(), M = Object.getPrototypeOf || (Gs ? function(t) {
3176
+ }() : qt, $e = Ts(), Ks = _s(), M = Object.getPrototypeOf || (Ks ? function(t) {
3241
3177
  return t.__proto__;
3242
- } : null), je = {}, Ks = typeof Uint8Array > "u" || !M ? I : M(Uint8Array), Pe = {
3178
+ } : null), je = {}, zs = typeof Uint8Array > "u" || !M ? E : M(Uint8Array), Pe = {
3243
3179
  __proto__: null,
3244
- "%AggregateError%": typeof AggregateError > "u" ? I : AggregateError,
3180
+ "%AggregateError%": typeof AggregateError > "u" ? E : AggregateError,
3245
3181
  "%Array%": Array,
3246
- "%ArrayBuffer%": typeof ArrayBuffer > "u" ? I : ArrayBuffer,
3247
- "%ArrayIteratorPrototype%": $e && M ? M([][Symbol.iterator]()) : I,
3248
- "%AsyncFromSyncIteratorPrototype%": I,
3182
+ "%ArrayBuffer%": typeof ArrayBuffer > "u" ? E : ArrayBuffer,
3183
+ "%ArrayIteratorPrototype%": $e && M ? M([][Symbol.iterator]()) : E,
3184
+ "%AsyncFromSyncIteratorPrototype%": E,
3249
3185
  "%AsyncFunction%": je,
3250
3186
  "%AsyncGenerator%": je,
3251
3187
  "%AsyncGeneratorFunction%": je,
3252
3188
  "%AsyncIteratorPrototype%": je,
3253
- "%Atomics%": typeof Atomics > "u" ? I : Atomics,
3254
- "%BigInt%": typeof BigInt > "u" ? I : BigInt,
3255
- "%BigInt64Array%": typeof BigInt64Array > "u" ? I : BigInt64Array,
3256
- "%BigUint64Array%": typeof BigUint64Array > "u" ? I : BigUint64Array,
3189
+ "%Atomics%": typeof Atomics > "u" ? E : Atomics,
3190
+ "%BigInt%": typeof BigInt > "u" ? E : BigInt,
3191
+ "%BigInt64Array%": typeof BigInt64Array > "u" ? E : BigInt64Array,
3192
+ "%BigUint64Array%": typeof BigUint64Array > "u" ? E : BigUint64Array,
3257
3193
  "%Boolean%": Boolean,
3258
- "%DataView%": typeof DataView > "u" ? I : DataView,
3194
+ "%DataView%": typeof DataView > "u" ? E : DataView,
3259
3195
  "%Date%": Date,
3260
3196
  "%decodeURI%": decodeURI,
3261
3197
  "%decodeURIComponent%": decodeURIComponent,
3262
3198
  "%encodeURI%": encodeURI,
3263
3199
  "%encodeURIComponent%": encodeURIComponent,
3264
- "%Error%": js,
3200
+ "%Error%": Us,
3265
3201
  "%eval%": eval,
3266
3202
  // eslint-disable-line no-eval
3267
- "%EvalError%": Us,
3268
- "%Float32Array%": typeof Float32Array > "u" ? I : Float32Array,
3269
- "%Float64Array%": typeof Float64Array > "u" ? I : Float64Array,
3270
- "%FinalizationRegistry%": typeof FinalizationRegistry > "u" ? I : FinalizationRegistry,
3271
- "%Function%": Wn,
3203
+ "%EvalError%": Bs,
3204
+ "%Float32Array%": typeof Float32Array > "u" ? E : Float32Array,
3205
+ "%Float64Array%": typeof Float64Array > "u" ? E : Float64Array,
3206
+ "%FinalizationRegistry%": typeof FinalizationRegistry > "u" ? E : FinalizationRegistry,
3207
+ "%Function%": Yn,
3272
3208
  "%GeneratorFunction%": je,
3273
- "%Int8Array%": typeof Int8Array > "u" ? I : Int8Array,
3274
- "%Int16Array%": typeof Int16Array > "u" ? I : Int16Array,
3275
- "%Int32Array%": typeof Int32Array > "u" ? I : Int32Array,
3209
+ "%Int8Array%": typeof Int8Array > "u" ? E : Int8Array,
3210
+ "%Int16Array%": typeof Int16Array > "u" ? E : Int16Array,
3211
+ "%Int32Array%": typeof Int32Array > "u" ? E : Int32Array,
3276
3212
  "%isFinite%": isFinite,
3277
3213
  "%isNaN%": isNaN,
3278
- "%IteratorPrototype%": $e && M ? M(M([][Symbol.iterator]())) : I,
3279
- "%JSON%": typeof JSON == "object" ? JSON : I,
3280
- "%Map%": typeof Map > "u" ? I : Map,
3281
- "%MapIteratorPrototype%": typeof Map > "u" || !$e || !M ? I : M((/* @__PURE__ */ new Map())[Symbol.iterator]()),
3214
+ "%IteratorPrototype%": $e && M ? M(M([][Symbol.iterator]())) : E,
3215
+ "%JSON%": typeof JSON == "object" ? JSON : E,
3216
+ "%Map%": typeof Map > "u" ? E : Map,
3217
+ "%MapIteratorPrototype%": typeof Map > "u" || !$e || !M ? E : M((/* @__PURE__ */ new Map())[Symbol.iterator]()),
3282
3218
  "%Math%": Math,
3283
3219
  "%Number%": Number,
3284
3220
  "%Object%": Object,
3285
3221
  "%parseFloat%": parseFloat,
3286
3222
  "%parseInt%": parseInt,
3287
- "%Promise%": typeof Promise > "u" ? I : Promise,
3288
- "%Proxy%": typeof Proxy > "u" ? I : Proxy,
3289
- "%RangeError%": Bs,
3290
- "%ReferenceError%": qs,
3291
- "%Reflect%": typeof Reflect > "u" ? I : Reflect,
3223
+ "%Promise%": typeof Promise > "u" ? E : Promise,
3224
+ "%Proxy%": typeof Proxy > "u" ? E : Proxy,
3225
+ "%RangeError%": qs,
3226
+ "%ReferenceError%": xs,
3227
+ "%Reflect%": typeof Reflect > "u" ? E : Reflect,
3292
3228
  "%RegExp%": RegExp,
3293
- "%Set%": typeof Set > "u" ? I : Set,
3294
- "%SetIteratorPrototype%": typeof Set > "u" || !$e || !M ? I : M((/* @__PURE__ */ new Set())[Symbol.iterator]()),
3295
- "%SharedArrayBuffer%": typeof SharedArrayBuffer > "u" ? I : SharedArrayBuffer,
3229
+ "%Set%": typeof Set > "u" ? E : Set,
3230
+ "%SetIteratorPrototype%": typeof Set > "u" || !$e || !M ? E : M((/* @__PURE__ */ new Set())[Symbol.iterator]()),
3231
+ "%SharedArrayBuffer%": typeof SharedArrayBuffer > "u" ? E : SharedArrayBuffer,
3296
3232
  "%String%": String,
3297
- "%StringIteratorPrototype%": $e && M ? M(""[Symbol.iterator]()) : I,
3298
- "%Symbol%": $e ? Symbol : I,
3233
+ "%StringIteratorPrototype%": $e && M ? M(""[Symbol.iterator]()) : E,
3234
+ "%Symbol%": $e ? Symbol : E,
3299
3235
  "%SyntaxError%": Ke,
3300
- "%ThrowTypeError%": Qs,
3301
- "%TypedArray%": Ks,
3236
+ "%ThrowTypeError%": Gs,
3237
+ "%TypedArray%": zs,
3302
3238
  "%TypeError%": Ge,
3303
- "%Uint8Array%": typeof Uint8Array > "u" ? I : Uint8Array,
3304
- "%Uint8ClampedArray%": typeof Uint8ClampedArray > "u" ? I : Uint8ClampedArray,
3305
- "%Uint16Array%": typeof Uint16Array > "u" ? I : Uint16Array,
3306
- "%Uint32Array%": typeof Uint32Array > "u" ? I : Uint32Array,
3307
- "%URIError%": xs,
3308
- "%WeakMap%": typeof WeakMap > "u" ? I : WeakMap,
3309
- "%WeakRef%": typeof WeakRef > "u" ? I : WeakRef,
3310
- "%WeakSet%": typeof WeakSet > "u" ? I : WeakSet
3239
+ "%Uint8Array%": typeof Uint8Array > "u" ? E : Uint8Array,
3240
+ "%Uint8ClampedArray%": typeof Uint8ClampedArray > "u" ? E : Uint8ClampedArray,
3241
+ "%Uint16Array%": typeof Uint16Array > "u" ? E : Uint16Array,
3242
+ "%Uint32Array%": typeof Uint32Array > "u" ? E : Uint32Array,
3243
+ "%URIError%": Qs,
3244
+ "%WeakMap%": typeof WeakMap > "u" ? E : WeakMap,
3245
+ "%WeakRef%": typeof WeakRef > "u" ? E : WeakRef,
3246
+ "%WeakSet%": typeof WeakSet > "u" ? E : WeakSet
3311
3247
  };
3312
3248
  if (M)
3313
3249
  try {
3314
3250
  null.error;
3315
3251
  } catch (t) {
3316
- var zs = M(M(t));
3317
- Pe["%Error.prototype%"] = zs;
3252
+ var Hs = M(M(t));
3253
+ Pe["%Error.prototype%"] = Hs;
3318
3254
  }
3319
- var Hs = function t(e) {
3255
+ var Ws = function t(e) {
3320
3256
  var r;
3321
3257
  if (e === "%AsyncFunction%")
3322
3258
  r = Bt("async function () {}");
@@ -3385,21 +3321,21 @@ var Hs = function t(e) {
3385
3321
  "%URIErrorPrototype%": ["URIError", "prototype"],
3386
3322
  "%WeakMapPrototype%": ["WeakMap", "prototype"],
3387
3323
  "%WeakSetPrototype%": ["WeakSet", "prototype"]
3388
- }, ot = Er, At = Ms, Ws = ot.call(Function.call, Array.prototype.concat), Ys = ot.call(Function.apply, Array.prototype.splice), rn = ot.call(Function.call, String.prototype.replace), Et = ot.call(Function.call, String.prototype.slice), Js = ot.call(Function.call, RegExp.prototype.exec), Xs = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g, Zs = /\\(\\)?/g, ea = function(e) {
3389
- var r = Et(e, 0, 1), n = Et(e, -1);
3324
+ }, it = Er, wt = js, Ys = it.call(Function.call, Array.prototype.concat), Js = it.call(Function.apply, Array.prototype.splice), rn = it.call(Function.call, String.prototype.replace), At = it.call(Function.call, String.prototype.slice), Xs = it.call(Function.call, RegExp.prototype.exec), Zs = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g, ea = /\\(\\)?/g, ta = function(e) {
3325
+ var r = At(e, 0, 1), n = At(e, -1);
3390
3326
  if (r === "%" && n !== "%")
3391
3327
  throw new Ke("invalid intrinsic syntax, expected closing `%`");
3392
3328
  if (n === "%" && r !== "%")
3393
3329
  throw new Ke("invalid intrinsic syntax, expected opening `%`");
3394
3330
  var i = [];
3395
- return rn(e, Xs, function(o, s, a, u) {
3396
- i[i.length] = a ? rn(u, Zs, "$1") : s || o;
3331
+ return rn(e, Zs, function(o, s, a, u) {
3332
+ i[i.length] = a ? rn(u, ea, "$1") : s || o;
3397
3333
  }), i;
3398
- }, ta = function(e, r) {
3334
+ }, ra = function(e, r) {
3399
3335
  var n = e, i;
3400
- if (At(tn, n) && (i = tn[n], n = "%" + i[0] + "%"), At(Pe, n)) {
3336
+ if (wt(tn, n) && (i = tn[n], n = "%" + i[0] + "%"), wt(Pe, n)) {
3401
3337
  var o = Pe[n];
3402
- if (o === je && (o = Hs(n)), typeof o > "u" && !r)
3338
+ if (o === je && (o = Ws(n)), typeof o > "u" && !r)
3403
3339
  throw new Ge("intrinsic " + e + " exists, but is not available. Please file an issue!");
3404
3340
  return {
3405
3341
  alias: i,
@@ -3408,41 +3344,41 @@ var Hs = function t(e) {
3408
3344
  };
3409
3345
  }
3410
3346
  throw new Ke("intrinsic " + e + " does not exist!");
3411
- }, st = function(e, r) {
3347
+ }, ot = function(e, r) {
3412
3348
  if (typeof e != "string" || e.length === 0)
3413
3349
  throw new Ge("intrinsic name must be a non-empty string");
3414
3350
  if (arguments.length > 1 && typeof r != "boolean")
3415
3351
  throw new Ge('"allowMissing" argument must be a boolean');
3416
- if (Js(/^%?[^%]*%?$/, e) === null)
3352
+ if (Xs(/^%?[^%]*%?$/, e) === null)
3417
3353
  throw new Ke("`%` may not be present anywhere but at the beginning and end of the intrinsic name");
3418
- var n = ea(e), i = n.length > 0 ? n[0] : "", o = ta("%" + i + "%", r), s = o.name, a = o.value, u = !1, f = o.alias;
3419
- f && (i = f[0], Ys(n, Ws([0, 1], f)));
3420
- for (var c = 1, h = !0; c < n.length; c += 1) {
3421
- var l = n[c], g = Et(l, 0, 1), v = Et(l, -1);
3354
+ var n = ta(e), i = n.length > 0 ? n[0] : "", o = ra("%" + i + "%", r), s = o.name, a = o.value, u = !1, f = o.alias;
3355
+ f && (i = f[0], Js(n, Ys([0, 1], f)));
3356
+ for (var c = 1, l = !0; c < n.length; c += 1) {
3357
+ var h = n[c], g = At(h, 0, 1), v = At(h, -1);
3422
3358
  if ((g === '"' || g === "'" || g === "`" || v === '"' || v === "'" || v === "`") && g !== v)
3423
3359
  throw new Ke("property names with quotes must have matching quotes");
3424
- if ((l === "constructor" || !h) && (u = !0), i += "." + l, s = "%" + i + "%", At(Pe, s))
3360
+ if ((h === "constructor" || !l) && (u = !0), i += "." + h, s = "%" + i + "%", wt(Pe, s))
3425
3361
  a = Pe[s];
3426
3362
  else if (a != null) {
3427
- if (!(l in a)) {
3363
+ if (!(h in a)) {
3428
3364
  if (!r)
3429
3365
  throw new Ge("base intrinsic for " + e + " exists, but the property is not available.");
3430
3366
  return;
3431
3367
  }
3432
3368
  if (ke && c + 1 >= n.length) {
3433
- var w = ke(a, l);
3434
- h = !!w, h && "get" in w && !("originalValue" in w.get) ? a = w.get : a = a[l];
3369
+ var I = ke(a, h);
3370
+ l = !!I, l && "get" in I && !("originalValue" in I.get) ? a = I.get : a = a[h];
3435
3371
  } else
3436
- h = At(a, l), a = a[l];
3437
- h && !u && (Pe[s] = a);
3372
+ l = wt(a, h), a = a[h];
3373
+ l && !u && (Pe[s] = a);
3438
3374
  }
3439
3375
  }
3440
3376
  return a;
3441
- }, Yn = { exports: {} }, xt, nn;
3377
+ }, Jn = { exports: {} }, xt, nn;
3442
3378
  function Ir() {
3443
3379
  if (nn) return xt;
3444
3380
  nn = 1;
3445
- var t = st, e = t("%Object.defineProperty%", !0) || !1;
3381
+ var t = ot, e = t("%Object.defineProperty%", !0) || !1;
3446
3382
  if (e)
3447
3383
  try {
3448
3384
  e({}, "a", { value: 1 });
@@ -3451,14 +3387,14 @@ function Ir() {
3451
3387
  }
3452
3388
  return xt = e, xt;
3453
3389
  }
3454
- var ra = st, yt = ra("%Object.getOwnPropertyDescriptor%", !0);
3455
- if (yt)
3390
+ var na = ot, pt = na("%Object.getOwnPropertyDescriptor%", !0);
3391
+ if (pt)
3456
3392
  try {
3457
- yt([], "length");
3393
+ pt([], "length");
3458
3394
  } catch {
3459
- yt = null;
3395
+ pt = null;
3460
3396
  }
3461
- var Vt = yt, on = Ir(), na = Hn, Me = Rt, sn = Vt, ia = function(e, r, n) {
3397
+ var Vt = pt, on = Ir(), ia = Wn, Me = Rt, sn = Vt, oa = function(e, r, n) {
3462
3398
  if (!e || typeof e != "object" && typeof e != "function")
3463
3399
  throw new Me("`obj` must be an object or a function`");
3464
3400
  if (typeof r != "string" && typeof r != "symbol")
@@ -3482,11 +3418,11 @@ var Vt = yt, on = Ir(), na = Hn, Me = Rt, sn = Vt, ia = function(e, r, n) {
3482
3418
  else if (a || !i && !o && !s)
3483
3419
  e[r] = n;
3484
3420
  else
3485
- throw new na("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");
3486
- }, ur = Ir(), Jn = function() {
3421
+ throw new ia("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");
3422
+ }, ur = Ir(), Xn = function() {
3487
3423
  return !!ur;
3488
3424
  };
3489
- Jn.hasArrayLengthDefineBug = function() {
3425
+ Xn.hasArrayLengthDefineBug = function() {
3490
3426
  if (!ur)
3491
3427
  return null;
3492
3428
  try {
@@ -3495,17 +3431,17 @@ Jn.hasArrayLengthDefineBug = function() {
3495
3431
  return !0;
3496
3432
  }
3497
3433
  };
3498
- var oa = Jn, sa = st, an = ia, aa = oa(), un = Vt, cn = Rt, ua = sa("%Math.floor%"), ca = function(e, r) {
3434
+ var sa = Xn, aa = ot, an = oa, ua = sa(), un = Vt, cn = Rt, ca = aa("%Math.floor%"), la = function(e, r) {
3499
3435
  if (typeof e != "function")
3500
3436
  throw new cn("`fn` is not a function");
3501
- if (typeof r != "number" || r < 0 || r > 4294967295 || ua(r) !== r)
3437
+ if (typeof r != "number" || r < 0 || r > 4294967295 || ca(r) !== r)
3502
3438
  throw new cn("`length` must be a positive 32-bit integer");
3503
3439
  var n = arguments.length > 2 && !!arguments[2], i = !0, o = !0;
3504
3440
  if ("length" in e && un) {
3505
3441
  var s = un(e, "length");
3506
3442
  s && !s.configurable && (i = !1), s && !s.writable && (o = !1);
3507
3443
  }
3508
- return (i || o || !n) && (aa ? an(
3444
+ return (i || o || !n) && (ua ? an(
3509
3445
  /** @type {Parameters<define>[0]} */
3510
3446
  e,
3511
3447
  "length",
@@ -3520,14 +3456,14 @@ var oa = Jn, sa = st, an = ia, aa = oa(), un = Vt, cn = Rt, ua = sa("%Math.floor
3520
3456
  )), e;
3521
3457
  };
3522
3458
  (function(t) {
3523
- var e = Er, r = st, n = ca, i = Rt, o = r("%Function.prototype.apply%"), s = r("%Function.prototype.call%"), a = r("%Reflect.apply%", !0) || e.call(s, o), u = Ir(), f = r("%Math.max%");
3524
- t.exports = function(l) {
3525
- if (typeof l != "function")
3459
+ var e = Er, r = ot, n = la, i = Rt, o = r("%Function.prototype.apply%"), s = r("%Function.prototype.call%"), a = r("%Reflect.apply%", !0) || e.call(s, o), u = Ir(), f = r("%Math.max%");
3460
+ t.exports = function(h) {
3461
+ if (typeof h != "function")
3526
3462
  throw new i("a function is required");
3527
3463
  var g = a(e, s, arguments);
3528
3464
  return n(
3529
3465
  g,
3530
- 1 + f(0, l.length - (arguments.length - 1)),
3466
+ 1 + f(0, h.length - (arguments.length - 1)),
3531
3467
  !0
3532
3468
  );
3533
3469
  };
@@ -3535,85 +3471,85 @@ var oa = Jn, sa = st, an = ia, aa = oa(), un = Vt, cn = Rt, ua = sa("%Math.floor
3535
3471
  return a(e, o, arguments);
3536
3472
  };
3537
3473
  u ? u(t.exports, "apply", { value: c }) : t.exports.apply = c;
3538
- })(Yn);
3539
- var Tr = Yn.exports, Xn = st, Zn = Tr, la = Zn(Xn("String.prototype.indexOf")), Or = function(e, r) {
3540
- var n = Xn(e, !!r);
3541
- return typeof n == "function" && la(e, ".prototype.") > -1 ? Zn(n) : n;
3542
- }, da = Dt(), fa = Or, cr = fa("Object.prototype.toString"), $t = function(e) {
3543
- return da && e && typeof e == "object" && Symbol.toStringTag in e ? !1 : cr(e) === "[object Arguments]";
3544
- }, ei = function(e) {
3474
+ })(Jn);
3475
+ var Tr = Jn.exports, Zn = ot, ei = Tr, da = ei(Zn("String.prototype.indexOf")), Or = function(e, r) {
3476
+ var n = Zn(e, !!r);
3477
+ return typeof n == "function" && da(e, ".prototype.") > -1 ? ei(n) : n;
3478
+ }, fa = Dt(), ha = Or, cr = ha("Object.prototype.toString"), $t = function(e) {
3479
+ return fa && e && typeof e == "object" && Symbol.toStringTag in e ? !1 : cr(e) === "[object Arguments]";
3480
+ }, ti = function(e) {
3545
3481
  return $t(e) ? !0 : e !== null && typeof e == "object" && typeof e.length == "number" && e.length >= 0 && cr(e) !== "[object Array]" && cr(e.callee) === "[object Function]";
3546
- }, ha = function() {
3482
+ }, pa = function() {
3547
3483
  return $t(arguments);
3548
3484
  }();
3549
- $t.isLegacyArguments = ei;
3550
- var pa = ha ? $t : ei, ya = Object.prototype.toString, ga = Function.prototype.toString, ma = /^\s*(?:function)?\*/, ti = Dt(), Qt = Object.getPrototypeOf, va = function() {
3551
- if (!ti)
3485
+ $t.isLegacyArguments = ti;
3486
+ var ya = pa ? $t : ti, ma = Object.prototype.toString, ga = Function.prototype.toString, va = /^\s*(?:function)?\*/, ri = Dt(), Qt = Object.getPrototypeOf, ba = function() {
3487
+ if (!ri)
3552
3488
  return !1;
3553
3489
  try {
3554
3490
  return Function("return function*() {}")();
3555
3491
  } catch {
3556
3492
  }
3557
- }, Gt, ba = function(e) {
3493
+ }, Gt, Sa = function(e) {
3558
3494
  if (typeof e != "function")
3559
3495
  return !1;
3560
- if (ma.test(ga.call(e)))
3496
+ if (va.test(ga.call(e)))
3561
3497
  return !0;
3562
- if (!ti) {
3563
- var r = ya.call(e);
3498
+ if (!ri) {
3499
+ var r = ma.call(e);
3564
3500
  return r === "[object GeneratorFunction]";
3565
3501
  }
3566
3502
  if (!Qt)
3567
3503
  return !1;
3568
3504
  if (typeof Gt > "u") {
3569
- var n = va();
3505
+ var n = ba();
3570
3506
  Gt = n ? Qt(n) : !1;
3571
3507
  }
3572
3508
  return Qt(e) === Gt;
3573
- }, ri = Function.prototype.toString, qe = typeof Reflect == "object" && Reflect !== null && Reflect.apply, lr, gt;
3509
+ }, ni = Function.prototype.toString, qe = typeof Reflect == "object" && Reflect !== null && Reflect.apply, lr, yt;
3574
3510
  if (typeof qe == "function" && typeof Object.defineProperty == "function")
3575
3511
  try {
3576
3512
  lr = Object.defineProperty({}, "length", {
3577
3513
  get: function() {
3578
- throw gt;
3514
+ throw yt;
3579
3515
  }
3580
- }), gt = {}, qe(function() {
3516
+ }), yt = {}, qe(function() {
3581
3517
  throw 42;
3582
3518
  }, null, lr);
3583
3519
  } catch (t) {
3584
- t !== gt && (qe = null);
3520
+ t !== yt && (qe = null);
3585
3521
  }
3586
3522
  else
3587
3523
  qe = null;
3588
- var Sa = /^\s*class\b/, dr = function(e) {
3524
+ var wa = /^\s*class\b/, dr = function(e) {
3589
3525
  try {
3590
- var r = ri.call(e);
3591
- return Sa.test(r);
3526
+ var r = ni.call(e);
3527
+ return wa.test(r);
3592
3528
  } catch {
3593
3529
  return !1;
3594
3530
  }
3595
3531
  }, Kt = function(e) {
3596
3532
  try {
3597
- return dr(e) ? !1 : (ri.call(e), !0);
3533
+ return dr(e) ? !1 : (ni.call(e), !0);
3598
3534
  } catch {
3599
3535
  return !1;
3600
3536
  }
3601
- }, mt = Object.prototype.toString, wa = "[object Object]", Aa = "[object Function]", Ea = "[object GeneratorFunction]", Ia = "[object HTMLAllCollection]", Ta = "[object HTML document.all class]", Oa = "[object HTMLCollection]", _a = typeof Symbol == "function" && !!Symbol.toStringTag, La = !(0 in [,]), fr = function() {
3537
+ }, mt = Object.prototype.toString, Aa = "[object Object]", Ea = "[object Function]", Ia = "[object GeneratorFunction]", Ta = "[object HTMLAllCollection]", Oa = "[object HTML document.all class]", _a = "[object HTMLCollection]", Ca = typeof Symbol == "function" && !!Symbol.toStringTag, La = !(0 in [,]), fr = function() {
3602
3538
  return !1;
3603
3539
  };
3604
3540
  if (typeof document == "object") {
3605
- var Ca = document.all;
3606
- mt.call(Ca) === mt.call(document.all) && (fr = function(e) {
3541
+ var ka = document.all;
3542
+ mt.call(ka) === mt.call(document.all) && (fr = function(e) {
3607
3543
  if ((La || !e) && (typeof e > "u" || typeof e == "object"))
3608
3544
  try {
3609
3545
  var r = mt.call(e);
3610
- return (r === Ia || r === Ta || r === Oa || r === wa) && e("") == null;
3546
+ return (r === Ta || r === Oa || r === _a || r === Aa) && e("") == null;
3611
3547
  } catch {
3612
3548
  }
3613
3549
  return !1;
3614
3550
  });
3615
3551
  }
3616
- var ka = qe ? function(e) {
3552
+ var Pa = qe ? function(e) {
3617
3553
  if (fr(e))
3618
3554
  return !0;
3619
3555
  if (!e || typeof e != "function" && typeof e != "object")
@@ -3621,7 +3557,7 @@ var ka = qe ? function(e) {
3621
3557
  try {
3622
3558
  qe(e, null, lr);
3623
3559
  } catch (r) {
3624
- if (r !== gt)
3560
+ if (r !== yt)
3625
3561
  return !1;
3626
3562
  }
3627
3563
  return !dr(e) && Kt(e);
@@ -3630,27 +3566,27 @@ var ka = qe ? function(e) {
3630
3566
  return !0;
3631
3567
  if (!e || typeof e != "function" && typeof e != "object")
3632
3568
  return !1;
3633
- if (_a)
3569
+ if (Ca)
3634
3570
  return Kt(e);
3635
3571
  if (dr(e))
3636
3572
  return !1;
3637
3573
  var r = mt.call(e);
3638
- return r !== Aa && r !== Ea && !/^\[object HTML/.test(r) ? !1 : Kt(e);
3639
- }, Pa = ka, Na = Object.prototype.toString, ni = Object.prototype.hasOwnProperty, Fa = function(e, r, n) {
3574
+ return r !== Ea && r !== Ia && !/^\[object HTML/.test(r) ? !1 : Kt(e);
3575
+ }, Na = Pa, Fa = Object.prototype.toString, ii = Object.prototype.hasOwnProperty, Da = function(e, r, n) {
3640
3576
  for (var i = 0, o = e.length; i < o; i++)
3641
- ni.call(e, i) && (n == null ? r(e[i], i, e) : r.call(n, e[i], i, e));
3642
- }, Da = function(e, r, n) {
3577
+ ii.call(e, i) && (n == null ? r(e[i], i, e) : r.call(n, e[i], i, e));
3578
+ }, Ra = function(e, r, n) {
3643
3579
  for (var i = 0, o = e.length; i < o; i++)
3644
3580
  n == null ? r(e.charAt(i), i, e) : r.call(n, e.charAt(i), i, e);
3645
- }, Ra = function(e, r, n) {
3646
- for (var i in e)
3647
- ni.call(e, i) && (n == null ? r(e[i], i, e) : r.call(n, e[i], i, e));
3648
3581
  }, Va = function(e, r, n) {
3649
- if (!Pa(r))
3582
+ for (var i in e)
3583
+ ii.call(e, i) && (n == null ? r(e[i], i, e) : r.call(n, e[i], i, e));
3584
+ }, $a = function(e, r, n) {
3585
+ if (!Na(r))
3650
3586
  throw new TypeError("iterator must be a function");
3651
3587
  var i;
3652
- arguments.length >= 3 && (i = n), Na.call(e) === "[object Array]" ? Fa(e, r, i) : typeof e == "string" ? Da(e, r, i) : Ra(e, r, i);
3653
- }, ii = Va, $a = [
3588
+ arguments.length >= 3 && (i = n), Fa.call(e) === "[object Array]" ? Da(e, r, i) : typeof e == "string" ? Ra(e, r, i) : Va(e, r, i);
3589
+ }, oi = $a, Ma = [
3654
3590
  "Float32Array",
3655
3591
  "Float64Array",
3656
3592
  "Int8Array",
@@ -3662,83 +3598,83 @@ var ka = qe ? function(e) {
3662
3598
  "Uint32Array",
3663
3599
  "BigInt64Array",
3664
3600
  "BigUint64Array"
3665
- ], zt = $a, Ma = typeof globalThis > "u" ? br : globalThis, oi = function() {
3601
+ ], zt = Ma, ja = typeof globalThis > "u" ? br : globalThis, si = function() {
3666
3602
  for (var e = [], r = 0; r < zt.length; r++)
3667
- typeof Ma[zt[r]] == "function" && (e[e.length] = zt[r]);
3603
+ typeof ja[zt[r]] == "function" && (e[e.length] = zt[r]);
3668
3604
  return e;
3669
- }, It = ii, ja = oi, ln = Tr, _r = Or, vt = Vt, Ua = _r("Object.prototype.toString"), si = Dt(), dn = typeof globalThis > "u" ? br : globalThis, hr = ja(), Lr = _r("String.prototype.slice"), Ht = Object.getPrototypeOf, Ba = _r("Array.prototype.indexOf", !0) || function(e, r) {
3605
+ }, Et = oi, Ua = si, ln = Tr, _r = Or, gt = Vt, Ba = _r("Object.prototype.toString"), ai = Dt(), dn = typeof globalThis > "u" ? br : globalThis, hr = Ua(), Cr = _r("String.prototype.slice"), Ht = Object.getPrototypeOf, qa = _r("Array.prototype.indexOf", !0) || function(e, r) {
3670
3606
  for (var n = 0; n < e.length; n += 1)
3671
3607
  if (e[n] === r)
3672
3608
  return n;
3673
3609
  return -1;
3674
- }, Tt = { __proto__: null };
3675
- si && vt && Ht ? It(hr, function(t) {
3610
+ }, It = { __proto__: null };
3611
+ ai && gt && Ht ? Et(hr, function(t) {
3676
3612
  var e = new dn[t]();
3677
3613
  if (Symbol.toStringTag in e) {
3678
- var r = Ht(e), n = vt(r, Symbol.toStringTag);
3614
+ var r = Ht(e), n = gt(r, Symbol.toStringTag);
3679
3615
  if (!n) {
3680
3616
  var i = Ht(r);
3681
- n = vt(i, Symbol.toStringTag);
3617
+ n = gt(i, Symbol.toStringTag);
3682
3618
  }
3683
- Tt["$" + t] = ln(n.get);
3619
+ It["$" + t] = ln(n.get);
3684
3620
  }
3685
- }) : It(hr, function(t) {
3621
+ }) : Et(hr, function(t) {
3686
3622
  var e = new dn[t](), r = e.slice || e.set;
3687
- r && (Tt["$" + t] = ln(r));
3623
+ r && (It["$" + t] = ln(r));
3688
3624
  });
3689
- var qa = function(e) {
3625
+ var xa = function(e) {
3690
3626
  var r = !1;
3691
- return It(Tt, function(n, i) {
3627
+ return Et(It, function(n, i) {
3692
3628
  if (!r)
3693
3629
  try {
3694
- "$" + n(e) === i && (r = Lr(i, 1));
3630
+ "$" + n(e) === i && (r = Cr(i, 1));
3695
3631
  } catch {
3696
3632
  }
3697
3633
  }), r;
3698
- }, xa = function(e) {
3634
+ }, Qa = function(e) {
3699
3635
  var r = !1;
3700
- return It(Tt, function(n, i) {
3636
+ return Et(It, function(n, i) {
3701
3637
  if (!r)
3702
3638
  try {
3703
- n(e), r = Lr(i, 1);
3639
+ n(e), r = Cr(i, 1);
3704
3640
  } catch {
3705
3641
  }
3706
3642
  }), r;
3707
- }, Qa = function(e) {
3643
+ }, Ga = function(e) {
3708
3644
  if (!e || typeof e != "object")
3709
3645
  return !1;
3710
- if (!si) {
3711
- var r = Lr(Ua(e), 8, -1);
3712
- return Ba(hr, r) > -1 ? r : r !== "Object" ? !1 : xa(e);
3646
+ if (!ai) {
3647
+ var r = Cr(Ba(e), 8, -1);
3648
+ return qa(hr, r) > -1 ? r : r !== "Object" ? !1 : Qa(e);
3713
3649
  }
3714
- return vt ? qa(e) : null;
3715
- }, Ot = ii, Ga = oi, fn = Tr, Cr = Or, bt = Vt, Ka = Cr("Object.prototype.toString"), ai = Dt(), hn = typeof globalThis > "u" ? br : globalThis, pr = Ga(), kr = Cr("String.prototype.slice"), Wt = Object.getPrototypeOf, za = Cr("Array.prototype.indexOf", !0) || function(e, r) {
3650
+ return gt ? xa(e) : null;
3651
+ }, Tt = oi, Ka = si, fn = Tr, Lr = Or, vt = Vt, za = Lr("Object.prototype.toString"), ui = Dt(), hn = typeof globalThis > "u" ? br : globalThis, pr = Ka(), kr = Lr("String.prototype.slice"), Wt = Object.getPrototypeOf, Ha = Lr("Array.prototype.indexOf", !0) || function(e, r) {
3716
3652
  for (var n = 0; n < e.length; n += 1)
3717
3653
  if (e[n] === r)
3718
3654
  return n;
3719
3655
  return -1;
3720
- }, _t = { __proto__: null };
3721
- ai && bt && Wt ? Ot(pr, function(t) {
3656
+ }, Ot = { __proto__: null };
3657
+ ui && vt && Wt ? Tt(pr, function(t) {
3722
3658
  var e = new hn[t]();
3723
3659
  if (Symbol.toStringTag in e) {
3724
- var r = Wt(e), n = bt(r, Symbol.toStringTag);
3660
+ var r = Wt(e), n = vt(r, Symbol.toStringTag);
3725
3661
  if (!n) {
3726
3662
  var i = Wt(r);
3727
- n = bt(i, Symbol.toStringTag);
3663
+ n = vt(i, Symbol.toStringTag);
3728
3664
  }
3729
- _t["$" + t] = fn(n.get);
3665
+ Ot["$" + t] = fn(n.get);
3730
3666
  }
3731
- }) : Ot(pr, function(t) {
3667
+ }) : Tt(pr, function(t) {
3732
3668
  var e = new hn[t](), r = e.slice || e.set;
3733
- r && (_t["$" + t] = fn(r));
3669
+ r && (Ot["$" + t] = fn(r));
3734
3670
  });
3735
- var Ha = function(e) {
3671
+ var Wa = function(e) {
3736
3672
  var r = !1;
3737
- return Ot(
3673
+ return Tt(
3738
3674
  // eslint-disable-next-line no-extra-parens
3739
3675
  /** @type {Record<`\$${TypedArrayName}`, Getter>} */
3740
3676
  /** @type {any} */
3741
- _t,
3677
+ Ot,
3742
3678
  /** @type {(getter: Getter, name: `\$${import('.').TypedArrayName}`) => void} */
3743
3679
  function(n, i) {
3744
3680
  if (!r)
@@ -3748,13 +3684,13 @@ var Ha = function(e) {
3748
3684
  }
3749
3685
  }
3750
3686
  ), r;
3751
- }, Wa = function(e) {
3687
+ }, Ya = function(e) {
3752
3688
  var r = !1;
3753
- return Ot(
3689
+ return Tt(
3754
3690
  // eslint-disable-next-line no-extra-parens
3755
3691
  /** @type {Record<`\$${TypedArrayName}`, Getter>} */
3756
3692
  /** @type {any} */
3757
- _t,
3693
+ Ot,
3758
3694
  /** @type {(getter: typeof cache, name: `\$${import('.').TypedArrayName}`) => void} */
3759
3695
  function(n, i) {
3760
3696
  if (!r)
@@ -3764,41 +3700,41 @@ var Ha = function(e) {
3764
3700
  }
3765
3701
  }
3766
3702
  ), r;
3767
- }, Ya = function(e) {
3703
+ }, Ja = function(e) {
3768
3704
  if (!e || typeof e != "object")
3769
3705
  return !1;
3770
- if (!ai) {
3771
- var r = kr(Ka(e), 8, -1);
3772
- return za(pr, r) > -1 ? r : r !== "Object" ? !1 : Wa(e);
3706
+ if (!ui) {
3707
+ var r = kr(za(e), 8, -1);
3708
+ return Ha(pr, r) > -1 ? r : r !== "Object" ? !1 : Ya(e);
3773
3709
  }
3774
- return bt ? Ha(e) : null;
3775
- }, Ja = Ya, Xa = function(e) {
3776
- return !!Ja(e);
3710
+ return vt ? Wa(e) : null;
3711
+ }, Xa = Ja, Za = function(e) {
3712
+ return !!Xa(e);
3777
3713
  };
3778
3714
  (function(t) {
3779
- var e = pa, r = ba, n = Qa, i = Xa;
3715
+ var e = ya, r = Sa, n = Ga, i = Za;
3780
3716
  function o(y) {
3781
3717
  return y.call.bind(y);
3782
3718
  }
3783
- var s = typeof BigInt < "u", a = typeof Symbol < "u", u = o(Object.prototype.toString), f = o(Number.prototype.valueOf), c = o(String.prototype.valueOf), h = o(Boolean.prototype.valueOf);
3719
+ var s = typeof BigInt < "u", a = typeof Symbol < "u", u = o(Object.prototype.toString), f = o(Number.prototype.valueOf), c = o(String.prototype.valueOf), l = o(Boolean.prototype.valueOf);
3784
3720
  if (s)
3785
- var l = o(BigInt.prototype.valueOf);
3721
+ var h = o(BigInt.prototype.valueOf);
3786
3722
  if (a)
3787
3723
  var g = o(Symbol.prototype.valueOf);
3788
- function v(y, pi) {
3724
+ function v(y, yi) {
3789
3725
  if (typeof y != "object")
3790
3726
  return !1;
3791
3727
  try {
3792
- return pi(y), !0;
3728
+ return yi(y), !0;
3793
3729
  } catch {
3794
3730
  return !1;
3795
3731
  }
3796
3732
  }
3797
3733
  t.isArgumentsObject = e, t.isGeneratorFunction = r, t.isTypedArray = i;
3798
- function w(y) {
3734
+ function I(y) {
3799
3735
  return typeof Promise < "u" && y instanceof Promise || y !== null && typeof y == "object" && typeof y.then == "function" && typeof y.catch == "function";
3800
3736
  }
3801
- t.isPromise = w;
3737
+ t.isPromise = I;
3802
3738
  function b(y) {
3803
3739
  return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? ArrayBuffer.isView(y) : i(y) || p(y);
3804
3740
  }
@@ -3819,10 +3755,10 @@ var Ha = function(e) {
3819
3755
  return n(y) === "Uint32Array";
3820
3756
  }
3821
3757
  t.isUint32Array = X;
3822
- function k(y) {
3758
+ function P(y) {
3823
3759
  return n(y) === "Int8Array";
3824
3760
  }
3825
- t.isInt8Array = k;
3761
+ t.isInt8Array = P;
3826
3762
  function V(y) {
3827
3763
  return n(y) === "Int16Array";
3828
3764
  }
@@ -3831,14 +3767,14 @@ var Ha = function(e) {
3831
3767
  return n(y) === "Int32Array";
3832
3768
  }
3833
3769
  t.isInt32Array = T;
3834
- function ie(y) {
3770
+ function ne(y) {
3835
3771
  return n(y) === "Float32Array";
3836
3772
  }
3837
- t.isFloat32Array = ie;
3838
- function oe(y) {
3773
+ t.isFloat32Array = ne;
3774
+ function ie(y) {
3839
3775
  return n(y) === "Float64Array";
3840
3776
  }
3841
- t.isFloat64Array = oe;
3777
+ t.isFloat64Array = ie;
3842
3778
  function Ne(y) {
3843
3779
  return n(y) === "BigInt64Array";
3844
3780
  }
@@ -3847,12 +3783,12 @@ var Ha = function(e) {
3847
3783
  return n(y) === "BigUint64Array";
3848
3784
  }
3849
3785
  t.isBigUint64Array = Ee;
3850
- function de(y) {
3786
+ function le(y) {
3851
3787
  return u(y) === "[object Map]";
3852
3788
  }
3853
- de.working = typeof Map < "u" && de(/* @__PURE__ */ new Map());
3789
+ le.working = typeof Map < "u" && le(/* @__PURE__ */ new Map());
3854
3790
  function Mt(y) {
3855
- return typeof Map > "u" ? !1 : de.working ? de(y) : y instanceof Map;
3791
+ return typeof Map > "u" ? !1 : le.working ? le(y) : y instanceof Map;
3856
3792
  }
3857
3793
  t.isMap = Mt;
3858
3794
  function Se(y) {
@@ -3875,18 +3811,18 @@ var Ha = function(e) {
3875
3811
  return u(y) === "[object WeakSet]";
3876
3812
  }
3877
3813
  De.working = typeof WeakSet < "u" && De(/* @__PURE__ */ new WeakSet());
3878
- function fe(y) {
3814
+ function de(y) {
3879
3815
  return De(y);
3880
3816
  }
3881
- t.isWeakSet = fe;
3817
+ t.isWeakSet = de;
3882
3818
  function Re(y) {
3883
3819
  return u(y) === "[object ArrayBuffer]";
3884
3820
  }
3885
3821
  Re.working = typeof ArrayBuffer < "u" && Re(new ArrayBuffer());
3886
- function at(y) {
3822
+ function st(y) {
3887
3823
  return typeof ArrayBuffer > "u" ? !1 : Re.working ? Re(y) : y instanceof ArrayBuffer;
3888
3824
  }
3889
- t.isArrayBuffer = at;
3825
+ t.isArrayBuffer = st;
3890
3826
  function d(y) {
3891
3827
  return u(y) === "[object DataView]";
3892
3828
  }
@@ -3899,26 +3835,26 @@ var Ha = function(e) {
3899
3835
  function S(y) {
3900
3836
  return u(y) === "[object SharedArrayBuffer]";
3901
3837
  }
3902
- function _(y) {
3838
+ function C(y) {
3903
3839
  return typeof m > "u" ? !1 : (typeof S.working > "u" && (S.working = S(new m())), S.working ? S(y) : y instanceof m);
3904
3840
  }
3905
- t.isSharedArrayBuffer = _;
3906
- function C(y) {
3841
+ t.isSharedArrayBuffer = C;
3842
+ function k(y) {
3907
3843
  return u(y) === "[object AsyncFunction]";
3908
3844
  }
3909
- t.isAsyncFunction = C;
3910
- function E(y) {
3845
+ t.isAsyncFunction = k;
3846
+ function A(y) {
3911
3847
  return u(y) === "[object Map Iterator]";
3912
3848
  }
3913
- t.isMapIterator = E;
3849
+ t.isMapIterator = A;
3914
3850
  function O(y) {
3915
3851
  return u(y) === "[object Set Iterator]";
3916
3852
  }
3917
3853
  t.isSetIterator = O;
3918
- function N(y) {
3854
+ function F(y) {
3919
3855
  return u(y) === "[object Generator]";
3920
3856
  }
3921
- t.isGeneratorObject = N;
3857
+ t.isGeneratorObject = F;
3922
3858
  function K(y) {
3923
3859
  return u(y) === "[object WebAssembly.Module]";
3924
3860
  }
@@ -3927,30 +3863,30 @@ var Ha = function(e) {
3927
3863
  return v(y, f);
3928
3864
  }
3929
3865
  t.isNumberObject = Ie;
3930
- function ut(y) {
3866
+ function at(y) {
3931
3867
  return v(y, c);
3932
3868
  }
3933
- t.isStringObject = ut;
3869
+ t.isStringObject = at;
3934
3870
  function Ve(y) {
3935
- return v(y, h);
3871
+ return v(y, l);
3936
3872
  }
3937
3873
  t.isBooleanObject = Ve;
3938
- function ct(y) {
3939
- return s && v(y, l);
3874
+ function ut(y) {
3875
+ return s && v(y, h);
3940
3876
  }
3941
- t.isBigIntObject = ct;
3877
+ t.isBigIntObject = ut;
3942
3878
  function Fr(y) {
3943
3879
  return a && v(y, g);
3944
3880
  }
3945
3881
  t.isSymbolObject = Fr;
3946
- function fi(y) {
3947
- return Ie(y) || ut(y) || Ve(y) || ct(y) || Fr(y);
3948
- }
3949
- t.isBoxedPrimitive = fi;
3950
3882
  function hi(y) {
3951
- return typeof Uint8Array < "u" && (at(y) || _(y));
3883
+ return Ie(y) || at(y) || Ve(y) || ut(y) || Fr(y);
3952
3884
  }
3953
- t.isAnyArrayBuffer = hi, ["isProxy", "isExternal", "isModuleNamespaceObject"].forEach(function(y) {
3885
+ t.isBoxedPrimitive = hi;
3886
+ function pi(y) {
3887
+ return typeof Uint8Array < "u" && (st(y) || C(y));
3888
+ }
3889
+ t.isAnyArrayBuffer = pi, ["isProxy", "isExternal", "isModuleNamespaceObject"].forEach(function(y) {
3954
3890
  Object.defineProperty(t, y, {
3955
3891
  enumerable: !1,
3956
3892
  value: function() {
@@ -3958,8 +3894,8 @@ var Ha = function(e) {
3958
3894
  }
3959
3895
  });
3960
3896
  });
3961
- })(Kn);
3962
- var Za = function(e) {
3897
+ })(zn);
3898
+ var eu = function(e) {
3963
3899
  return e && typeof e == "object" && typeof e.copy == "function" && typeof e.fill == "function" && typeof e.readUInt8 == "function";
3964
3900
  }, yr = { exports: {} };
3965
3901
  typeof Object.create == "function" ? yr.exports = function(e, r) {
@@ -3979,22 +3915,22 @@ typeof Object.create == "function" ? yr.exports = function(e, r) {
3979
3915
  n.prototype = r.prototype, e.prototype = new n(), e.prototype.constructor = e;
3980
3916
  }
3981
3917
  };
3982
- var eu = yr.exports;
3918
+ var tu = yr.exports;
3983
3919
  (function(t) {
3984
3920
  var e = Object.getOwnPropertyDescriptors || function(p) {
3985
- for (var m = Object.keys(p), S = {}, _ = 0; _ < m.length; _++)
3986
- S[m[_]] = Object.getOwnPropertyDescriptor(p, m[_]);
3921
+ for (var m = Object.keys(p), S = {}, C = 0; C < m.length; C++)
3922
+ S[m[C]] = Object.getOwnPropertyDescriptor(p, m[C]);
3987
3923
  return S;
3988
3924
  }, r = /%[sdj%]/g;
3989
3925
  t.format = function(d) {
3990
- if (!k(d)) {
3926
+ if (!P(d)) {
3991
3927
  for (var p = [], m = 0; m < arguments.length; m++)
3992
3928
  p.push(s(arguments[m]));
3993
3929
  return p.join(" ");
3994
3930
  }
3995
- for (var m = 1, S = arguments, _ = S.length, C = String(d).replace(r, function(O) {
3931
+ for (var m = 1, S = arguments, C = S.length, k = String(d).replace(r, function(O) {
3996
3932
  if (O === "%%") return "%";
3997
- if (m >= _) return O;
3933
+ if (m >= C) return O;
3998
3934
  switch (O) {
3999
3935
  case "%s":
4000
3936
  return String(S[m++]);
@@ -4009,36 +3945,36 @@ var eu = yr.exports;
4009
3945
  default:
4010
3946
  return O;
4011
3947
  }
4012
- }), E = S[m]; m < _; E = S[++m])
4013
- R(E) || !oe(E) ? C += " " + E : C += " " + s(E);
4014
- return C;
3948
+ }), A = S[m]; m < C; A = S[++m])
3949
+ R(A) || !ie(A) ? k += " " + A : k += " " + s(A);
3950
+ return k;
4015
3951
  }, t.deprecate = function(d, p) {
4016
- if (typeof A < "u" && A.noDeprecation === !0)
3952
+ if (typeof w < "u" && w.noDeprecation === !0)
4017
3953
  return d;
4018
- if (typeof A > "u")
3954
+ if (typeof w > "u")
4019
3955
  return function() {
4020
3956
  return t.deprecate(d, p).apply(this, arguments);
4021
3957
  };
4022
3958
  var m = !1;
4023
3959
  function S() {
4024
3960
  if (!m) {
4025
- if (A.throwDeprecation)
3961
+ if (w.throwDeprecation)
4026
3962
  throw new Error(p);
4027
- A.traceDeprecation ? console.trace(p) : console.error(p), m = !0;
3963
+ w.traceDeprecation ? console.trace(p) : console.error(p), m = !0;
4028
3964
  }
4029
3965
  return d.apply(this, arguments);
4030
3966
  }
4031
3967
  return S;
4032
3968
  };
4033
3969
  var n = {}, i = /^$/;
4034
- if (A.env.NODE_DEBUG) {
4035
- var o = A.env.NODE_DEBUG;
3970
+ if (w.env.NODE_DEBUG) {
3971
+ var o = w.env.NODE_DEBUG;
4036
3972
  o = o.replace(/[|\\{}()[\]^$+?.]/g, "\\$&").replace(/\*/g, ".*").replace(/,/g, "$|^").toUpperCase(), i = new RegExp("^" + o + "$", "i");
4037
3973
  }
4038
3974
  t.debuglog = function(d) {
4039
3975
  if (d = d.toUpperCase(), !n[d])
4040
3976
  if (i.test(d)) {
4041
- var p = A.pid;
3977
+ var p = w.pid;
4042
3978
  n[d] = function() {
4043
3979
  var m = t.format.apply(t, arguments);
4044
3980
  console.error("%s %d: %s", d, p, m);
@@ -4094,49 +4030,49 @@ var eu = yr.exports;
4094
4030
  }), p;
4095
4031
  }
4096
4032
  function c(d, p, m) {
4097
- if (d.customInspect && p && de(p.inspect) && // Filter out the util module, it's inspect function is special
4033
+ if (d.customInspect && p && le(p.inspect) && // Filter out the util module, it's inspect function is special
4098
4034
  p.inspect !== t.inspect && // Also filter out any prototype objects using the circular check.
4099
4035
  !(p.constructor && p.constructor.prototype === p)) {
4100
4036
  var S = p.inspect(m, d);
4101
- return k(S) || (S = c(d, S, m)), S;
4037
+ return P(S) || (S = c(d, S, m)), S;
4102
4038
  }
4103
- var _ = h(d, p);
4104
- if (_)
4105
- return _;
4106
- var C = Object.keys(p), E = f(C);
4107
- if (d.showHidden && (C = Object.getOwnPropertyNames(p)), Ee(p) && (C.indexOf("message") >= 0 || C.indexOf("description") >= 0))
4108
- return l(p);
4109
- if (C.length === 0) {
4110
- if (de(p)) {
4039
+ var C = l(d, p);
4040
+ if (C)
4041
+ return C;
4042
+ var k = Object.keys(p), A = f(k);
4043
+ if (d.showHidden && (k = Object.getOwnPropertyNames(p)), Ee(p) && (k.indexOf("message") >= 0 || k.indexOf("description") >= 0))
4044
+ return h(p);
4045
+ if (k.length === 0) {
4046
+ if (le(p)) {
4111
4047
  var O = p.name ? ": " + p.name : "";
4112
4048
  return d.stylize("[Function" + O + "]", "special");
4113
4049
  }
4114
- if (ie(p))
4050
+ if (ne(p))
4115
4051
  return d.stylize(RegExp.prototype.toString.call(p), "regexp");
4116
4052
  if (Ne(p))
4117
4053
  return d.stylize(Date.prototype.toString.call(p), "date");
4118
4054
  if (Ee(p))
4119
- return l(p);
4055
+ return h(p);
4120
4056
  }
4121
- var N = "", K = !1, Ie = ["{", "}"];
4122
- if (b(p) && (K = !0, Ie = ["[", "]"]), de(p)) {
4123
- var ut = p.name ? ": " + p.name : "";
4124
- N = " [Function" + ut + "]";
4057
+ var F = "", K = !1, Ie = ["{", "}"];
4058
+ if (b(p) && (K = !0, Ie = ["[", "]"]), le(p)) {
4059
+ var at = p.name ? ": " + p.name : "";
4060
+ F = " [Function" + at + "]";
4125
4061
  }
4126
- if (ie(p) && (N = " " + RegExp.prototype.toString.call(p)), Ne(p) && (N = " " + Date.prototype.toUTCString.call(p)), Ee(p) && (N = " " + l(p)), C.length === 0 && (!K || p.length == 0))
4127
- return Ie[0] + N + Ie[1];
4062
+ if (ne(p) && (F = " " + RegExp.prototype.toString.call(p)), Ne(p) && (F = " " + Date.prototype.toUTCString.call(p)), Ee(p) && (F = " " + h(p)), k.length === 0 && (!K || p.length == 0))
4063
+ return Ie[0] + F + Ie[1];
4128
4064
  if (m < 0)
4129
- return ie(p) ? d.stylize(RegExp.prototype.toString.call(p), "regexp") : d.stylize("[Object]", "special");
4065
+ return ne(p) ? d.stylize(RegExp.prototype.toString.call(p), "regexp") : d.stylize("[Object]", "special");
4130
4066
  d.seen.push(p);
4131
4067
  var Ve;
4132
- return K ? Ve = g(d, p, m, E, C) : Ve = C.map(function(ct) {
4133
- return v(d, p, m, E, ct, K);
4134
- }), d.seen.pop(), w(Ve, N, Ie);
4068
+ return K ? Ve = g(d, p, m, A, k) : Ve = k.map(function(ut) {
4069
+ return v(d, p, m, A, ut, K);
4070
+ }), d.seen.pop(), I(Ve, F, Ie);
4135
4071
  }
4136
- function h(d, p) {
4072
+ function l(d, p) {
4137
4073
  if (T(p))
4138
4074
  return d.stylize("undefined", "undefined");
4139
- if (k(p)) {
4075
+ if (P(p)) {
4140
4076
  var m = "'" + JSON.stringify(p).replace(/^"|"$/g, "").replace(/'/g, "\\'").replace(/\\"/g, '"') + "'";
4141
4077
  return d.stylize(m, "string");
4142
4078
  }
@@ -4147,34 +4083,34 @@ var eu = yr.exports;
4147
4083
  if (R(p))
4148
4084
  return d.stylize("null", "null");
4149
4085
  }
4150
- function l(d) {
4086
+ function h(d) {
4151
4087
  return "[" + Error.prototype.toString.call(d) + "]";
4152
4088
  }
4153
- function g(d, p, m, S, _) {
4154
- for (var C = [], E = 0, O = p.length; E < O; ++E)
4155
- De(p, String(E)) ? C.push(v(
4089
+ function g(d, p, m, S, C) {
4090
+ for (var k = [], A = 0, O = p.length; A < O; ++A)
4091
+ De(p, String(A)) ? k.push(v(
4156
4092
  d,
4157
4093
  p,
4158
4094
  m,
4159
4095
  S,
4160
- String(E),
4096
+ String(A),
4161
4097
  !0
4162
- )) : C.push("");
4163
- return _.forEach(function(N) {
4164
- N.match(/^\d+$/) || C.push(v(
4098
+ )) : k.push("");
4099
+ return C.forEach(function(F) {
4100
+ F.match(/^\d+$/) || k.push(v(
4165
4101
  d,
4166
4102
  p,
4167
4103
  m,
4168
4104
  S,
4169
- N,
4105
+ F,
4170
4106
  !0
4171
4107
  ));
4172
- }), C;
4108
+ }), k;
4173
4109
  }
4174
- function v(d, p, m, S, _, C) {
4175
- var E, O, N;
4176
- if (N = Object.getOwnPropertyDescriptor(p, _) || { value: p[_] }, N.get ? N.set ? O = d.stylize("[Getter/Setter]", "special") : O = d.stylize("[Getter]", "special") : N.set && (O = d.stylize("[Setter]", "special")), De(S, _) || (E = "[" + _ + "]"), O || (d.seen.indexOf(N.value) < 0 ? (R(m) ? O = c(d, N.value, null) : O = c(d, N.value, m - 1), O.indexOf(`
4177
- `) > -1 && (C ? O = O.split(`
4110
+ function v(d, p, m, S, C, k) {
4111
+ var A, O, F;
4112
+ if (F = Object.getOwnPropertyDescriptor(p, C) || { value: p[C] }, F.get ? F.set ? O = d.stylize("[Getter/Setter]", "special") : O = d.stylize("[Getter]", "special") : F.set && (O = d.stylize("[Setter]", "special")), De(S, C) || (A = "[" + C + "]"), O || (d.seen.indexOf(F.value) < 0 ? (R(m) ? O = c(d, F.value, null) : O = c(d, F.value, m - 1), O.indexOf(`
4113
+ `) > -1 && (k ? O = O.split(`
4178
4114
  `).map(function(K) {
4179
4115
  return " " + K;
4180
4116
  }).join(`
@@ -4183,23 +4119,23 @@ var eu = yr.exports;
4183
4119
  `).map(function(K) {
4184
4120
  return " " + K;
4185
4121
  }).join(`
4186
- `))) : O = d.stylize("[Circular]", "special")), T(E)) {
4187
- if (C && _.match(/^\d+$/))
4122
+ `))) : O = d.stylize("[Circular]", "special")), T(A)) {
4123
+ if (k && C.match(/^\d+$/))
4188
4124
  return O;
4189
- E = JSON.stringify("" + _), E.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/) ? (E = E.slice(1, -1), E = d.stylize(E, "name")) : (E = E.replace(/'/g, "\\'").replace(/\\"/g, '"').replace(/(^"|"$)/g, "'"), E = d.stylize(E, "string"));
4125
+ A = JSON.stringify("" + C), A.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/) ? (A = A.slice(1, -1), A = d.stylize(A, "name")) : (A = A.replace(/'/g, "\\'").replace(/\\"/g, '"').replace(/(^"|"$)/g, "'"), A = d.stylize(A, "string"));
4190
4126
  }
4191
- return E + ": " + O;
4127
+ return A + ": " + O;
4192
4128
  }
4193
- function w(d, p, m) {
4194
- var S = d.reduce(function(_, C) {
4195
- return C.indexOf(`
4196
- `) >= 0, _ + C.replace(/\u001b\[\d\d?m/g, "").length + 1;
4129
+ function I(d, p, m) {
4130
+ var S = d.reduce(function(C, k) {
4131
+ return k.indexOf(`
4132
+ `) >= 0, C + k.replace(/\u001b\[\d\d?m/g, "").length + 1;
4197
4133
  }, 0);
4198
4134
  return S > 60 ? m[0] + (p === "" ? "" : p + `
4199
4135
  `) + " " + d.join(`,
4200
4136
  `) + " " + m[1] : m[0] + p + " " + d.join(", ") + " " + m[1];
4201
4137
  }
4202
- t.types = Kn;
4138
+ t.types = zn;
4203
4139
  function b(d) {
4204
4140
  return Array.isArray(d);
4205
4141
  }
@@ -4220,10 +4156,10 @@ var eu = yr.exports;
4220
4156
  return typeof d == "number";
4221
4157
  }
4222
4158
  t.isNumber = X;
4223
- function k(d) {
4159
+ function P(d) {
4224
4160
  return typeof d == "string";
4225
4161
  }
4226
- t.isString = k;
4162
+ t.isString = P;
4227
4163
  function V(d) {
4228
4164
  return typeof d == "symbol";
4229
4165
  }
@@ -4232,31 +4168,31 @@ var eu = yr.exports;
4232
4168
  return d === void 0;
4233
4169
  }
4234
4170
  t.isUndefined = T;
4235
- function ie(d) {
4236
- return oe(d) && Se(d) === "[object RegExp]";
4171
+ function ne(d) {
4172
+ return ie(d) && Se(d) === "[object RegExp]";
4237
4173
  }
4238
- t.isRegExp = ie, t.types.isRegExp = ie;
4239
- function oe(d) {
4174
+ t.isRegExp = ne, t.types.isRegExp = ne;
4175
+ function ie(d) {
4240
4176
  return typeof d == "object" && d !== null;
4241
4177
  }
4242
- t.isObject = oe;
4178
+ t.isObject = ie;
4243
4179
  function Ne(d) {
4244
- return oe(d) && Se(d) === "[object Date]";
4180
+ return ie(d) && Se(d) === "[object Date]";
4245
4181
  }
4246
4182
  t.isDate = Ne, t.types.isDate = Ne;
4247
4183
  function Ee(d) {
4248
- return oe(d) && (Se(d) === "[object Error]" || d instanceof Error);
4184
+ return ie(d) && (Se(d) === "[object Error]" || d instanceof Error);
4249
4185
  }
4250
4186
  t.isError = Ee, t.types.isNativeError = Ee;
4251
- function de(d) {
4187
+ function le(d) {
4252
4188
  return typeof d == "function";
4253
4189
  }
4254
- t.isFunction = de;
4190
+ t.isFunction = le;
4255
4191
  function Mt(d) {
4256
4192
  return d === null || typeof d == "boolean" || typeof d == "number" || typeof d == "string" || typeof d == "symbol" || // ES6 symbol
4257
4193
  typeof d > "u";
4258
4194
  }
4259
- t.isPrimitive = Mt, t.isBuffer = Za;
4195
+ t.isPrimitive = Mt, t.isBuffer = eu;
4260
4196
  function Se(d) {
4261
4197
  return Object.prototype.toString.call(d);
4262
4198
  }
@@ -4287,8 +4223,8 @@ var eu = yr.exports;
4287
4223
  }
4288
4224
  t.log = function() {
4289
4225
  console.log("%s - %s", jt(), t.format.apply(t, arguments));
4290
- }, t.inherits = eu, t._extend = function(d, p) {
4291
- if (!p || !oe(p)) return d;
4226
+ }, t.inherits = tu, t._extend = function(d, p) {
4227
+ if (!p || !ie(p)) return d;
4292
4228
  for (var m = Object.keys(p), S = m.length; S--; )
4293
4229
  d[m[S]] = p[m[S]];
4294
4230
  return d;
@@ -4296,15 +4232,15 @@ var eu = yr.exports;
4296
4232
  function De(d, p) {
4297
4233
  return Object.prototype.hasOwnProperty.call(d, p);
4298
4234
  }
4299
- var fe = typeof Symbol < "u" ? Symbol("util.promisify.custom") : void 0;
4235
+ var de = typeof Symbol < "u" ? Symbol("util.promisify.custom") : void 0;
4300
4236
  t.promisify = function(p) {
4301
4237
  if (typeof p != "function")
4302
4238
  throw new TypeError('The "original" argument must be of type Function');
4303
- if (fe && p[fe]) {
4304
- var m = p[fe];
4239
+ if (de && p[de]) {
4240
+ var m = p[de];
4305
4241
  if (typeof m != "function")
4306
4242
  throw new TypeError('The "util.promisify.custom" argument must be of type Function');
4307
- return Object.defineProperty(m, fe, {
4243
+ return Object.defineProperty(m, de, {
4308
4244
  value: m,
4309
4245
  enumerable: !1,
4310
4246
  writable: !1,
@@ -4312,21 +4248,21 @@ var eu = yr.exports;
4312
4248
  }), m;
4313
4249
  }
4314
4250
  function m() {
4315
- for (var S, _, C = new Promise(function(N, K) {
4316
- S = N, _ = K;
4317
- }), E = [], O = 0; O < arguments.length; O++)
4318
- E.push(arguments[O]);
4319
- E.push(function(N, K) {
4320
- N ? _(N) : S(K);
4251
+ for (var S, C, k = new Promise(function(F, K) {
4252
+ S = F, C = K;
4253
+ }), A = [], O = 0; O < arguments.length; O++)
4254
+ A.push(arguments[O]);
4255
+ A.push(function(F, K) {
4256
+ F ? C(F) : S(K);
4321
4257
  });
4322
4258
  try {
4323
- p.apply(this, E);
4324
- } catch (N) {
4325
- _(N);
4259
+ p.apply(this, A);
4260
+ } catch (F) {
4261
+ C(F);
4326
4262
  }
4327
- return C;
4263
+ return k;
4328
4264
  }
4329
- return Object.setPrototypeOf(m, Object.getPrototypeOf(p)), fe && Object.defineProperty(m, fe, {
4265
+ return Object.setPrototypeOf(m, Object.getPrototypeOf(p)), de && Object.defineProperty(m, de, {
4330
4266
  value: m,
4331
4267
  enumerable: !1,
4332
4268
  writable: !1,
@@ -4335,7 +4271,7 @@ var eu = yr.exports;
4335
4271
  m,
4336
4272
  e(p)
4337
4273
  );
4338
- }, t.promisify.custom = fe;
4274
+ }, t.promisify.custom = de;
4339
4275
  function Re(d, p) {
4340
4276
  if (!d) {
4341
4277
  var m = new Error("Promise was rejected with a falsy value");
@@ -4343,24 +4279,24 @@ var eu = yr.exports;
4343
4279
  }
4344
4280
  return p(d);
4345
4281
  }
4346
- function at(d) {
4282
+ function st(d) {
4347
4283
  if (typeof d != "function")
4348
4284
  throw new TypeError('The "original" argument must be of type Function');
4349
4285
  function p() {
4350
4286
  for (var m = [], S = 0; S < arguments.length; S++)
4351
4287
  m.push(arguments[S]);
4352
- var _ = m.pop();
4353
- if (typeof _ != "function")
4288
+ var C = m.pop();
4289
+ if (typeof C != "function")
4354
4290
  throw new TypeError("The last argument must be of type Function");
4355
- var C = this, E = function() {
4356
- return _.apply(C, arguments);
4291
+ var k = this, A = function() {
4292
+ return C.apply(k, arguments);
4357
4293
  };
4358
4294
  d.apply(this, m).then(
4359
4295
  function(O) {
4360
- A.nextTick(E.bind(null, null, O));
4296
+ w.nextTick(A.bind(null, null, O));
4361
4297
  },
4362
4298
  function(O) {
4363
- A.nextTick(Re.bind(null, O, E));
4299
+ w.nextTick(Re.bind(null, O, A));
4364
4300
  }
4365
4301
  );
4366
4302
  }
@@ -4369,9 +4305,9 @@ var eu = yr.exports;
4369
4305
  e(d)
4370
4306
  ), p;
4371
4307
  }
4372
- t.callbackify = at;
4308
+ t.callbackify = st;
4373
4309
  })(Ft);
4374
- const { inherits: tu, format: Yt } = Ft;
4310
+ const { inherits: ru, format: Yt } = Ft;
4375
4311
  function Oe(t, e, r = Error) {
4376
4312
  if (!t) throw new Error("Avvio error code must not be empty");
4377
4313
  if (!e) throw new Error("Avvio base error message must not be empty");
@@ -4382,9 +4318,9 @@ function Oe(t, e, r = Error) {
4382
4318
  }
4383
4319
  return n.prototype[Symbol.toStringTag] = "Error", n.prototype.toString = function() {
4384
4320
  return `${this.name} [${this.code}]: ${this.message}`;
4385
- }, tu(n, r), n;
4321
+ }, ru(n, r), n;
4386
4322
  }
4387
- var ui = {
4323
+ var ci = {
4388
4324
  createError: Oe,
4389
4325
  AVV_ERR_EXPOSE_ALREADY_DEFINED: Oe(
4390
4326
  "AVV_ERR_EXPOSE_ALREADY_DEFINED",
@@ -4410,7 +4346,7 @@ var ui = {
4410
4346
  "AVV_ERR_READY_TIMEOUT",
4411
4347
  "Plugin did not start in time: '%s'. You may have forgotten to call 'done' function or to resolve a Promise"
4412
4348
  )
4413
- }, ru = function t(e, r, n) {
4349
+ }, nu = function t(e, r, n) {
4414
4350
  r === void 0 && (r = ""), n || (n = {});
4415
4351
  var i = function(u) {
4416
4352
  var f = {
@@ -4428,12 +4364,12 @@ var ui = {
4428
4364
  ` + r + (o.length ? i("│") : " ") + " ";
4429
4365
  return r + s.join(a) + `
4430
4366
  ` + o.map(function(u, f) {
4431
- var c = f === o.length - 1, h = u.nodes && u.nodes.length, l = r + (c ? " " : i("│")) + " ";
4432
- return r + i(c ? "└" : "├") + i("─") + i(h ? "┬" : "─") + " " + t(u, l, n).slice(r.length + 2);
4367
+ var c = f === o.length - 1, l = u.nodes && u.nodes.length, h = r + (c ? " " : i("│")) + " ";
4368
+ return r + i(c ? "└" : "├") + i("─") + i(l ? "┬" : "─") + " " + t(u, h, n).slice(r.length + 2);
4433
4369
  }).join("");
4434
4370
  };
4435
- const nu = ru, pn = Symbol("avvio.TimeTree.untrackNode"), Jt = Symbol("avvio.TimeTree.trackNode"), yn = Symbol("avvio.TimeTree.getParent"), gn = Symbol("avvio.TimeTree.getNode"), mn = Symbol("avvio.TimeTree.addNode");
4436
- let iu = class {
4371
+ const iu = nu, pn = Symbol("avvio.TimeTree.untrackNode"), Jt = Symbol("avvio.TimeTree.trackNode"), yn = Symbol("avvio.TimeTree.getParent"), mn = Symbol("avvio.TimeTree.getNode"), gn = Symbol("avvio.TimeTree.addNode");
4372
+ let ou = class {
4437
4373
  constructor() {
4438
4374
  this.root = null, this.tableId = /* @__PURE__ */ new Map(), this.tableLabel = /* @__PURE__ */ new Map();
4439
4375
  }
@@ -4455,10 +4391,10 @@ let iu = class {
4455
4391
  const r = this.tableLabel.get(e);
4456
4392
  return r.id ? r : r[r.length - 1];
4457
4393
  }
4458
- [gn](e) {
4394
+ [mn](e) {
4459
4395
  return this.tableId.get(e);
4460
4396
  }
4461
- [mn](e, r, n) {
4397
+ [gn](e, r, n) {
4462
4398
  if (e === null)
4463
4399
  return this.root = {
4464
4400
  id: "root",
@@ -4476,10 +4412,10 @@ let iu = class {
4476
4412
  return o.nodes.push(a), this[Jt](a), s;
4477
4413
  }
4478
4414
  start(e, r, n = Date.now()) {
4479
- return this[mn](e, r, n);
4415
+ return this[gn](e, r, n);
4480
4416
  }
4481
4417
  stop(e, r = Date.now()) {
4482
- const n = this[gn](e);
4418
+ const n = this[mn](e);
4483
4419
  n && (n.stop = r, n.diff = n.stop - n.start || 0, this[pn](n));
4484
4420
  }
4485
4421
  toJSON() {
@@ -4487,71 +4423,71 @@ let iu = class {
4487
4423
  }
4488
4424
  prittyPrint() {
4489
4425
  const e = (n) => (n.label = `${n.label} ${n.diff} ms`, n.nodes.length > 0 && (n.nodes = n.nodes.map((i) => e(i))), n), r = e(this.toJSON());
4490
- return nu(r);
4426
+ return iu(r);
4491
4427
  }
4492
4428
  };
4493
- var ou = iu, Pr = { exports: {} }, gr = { exports: {} }, Xt, vn;
4494
- function su() {
4429
+ var su = ou, Pr = { exports: {} }, mr = { exports: {} }, Xt, vn;
4430
+ function au() {
4495
4431
  if (vn) return Xt;
4496
4432
  vn = 1;
4497
4433
  var t = 1e3, e = t * 60, r = e * 60, n = r * 24, i = n * 7, o = n * 365.25;
4498
- Xt = function(c, h) {
4499
- h = h || {};
4500
- var l = typeof c;
4501
- if (l === "string" && c.length > 0)
4434
+ Xt = function(c, l) {
4435
+ l = l || {};
4436
+ var h = typeof c;
4437
+ if (h === "string" && c.length > 0)
4502
4438
  return s(c);
4503
- if (l === "number" && isFinite(c))
4504
- return h.long ? u(c) : a(c);
4439
+ if (h === "number" && isFinite(c))
4440
+ return l.long ? u(c) : a(c);
4505
4441
  throw new Error(
4506
4442
  "val is not a non-empty string or a valid number. val=" + JSON.stringify(c)
4507
4443
  );
4508
4444
  };
4509
4445
  function s(c) {
4510
4446
  if (c = String(c), !(c.length > 100)) {
4511
- var h = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
4447
+ var l = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
4512
4448
  c
4513
4449
  );
4514
- if (h) {
4515
- var l = parseFloat(h[1]), g = (h[2] || "ms").toLowerCase();
4450
+ if (l) {
4451
+ var h = parseFloat(l[1]), g = (l[2] || "ms").toLowerCase();
4516
4452
  switch (g) {
4517
4453
  case "years":
4518
4454
  case "year":
4519
4455
  case "yrs":
4520
4456
  case "yr":
4521
4457
  case "y":
4522
- return l * o;
4458
+ return h * o;
4523
4459
  case "weeks":
4524
4460
  case "week":
4525
4461
  case "w":
4526
- return l * i;
4462
+ return h * i;
4527
4463
  case "days":
4528
4464
  case "day":
4529
4465
  case "d":
4530
- return l * n;
4466
+ return h * n;
4531
4467
  case "hours":
4532
4468
  case "hour":
4533
4469
  case "hrs":
4534
4470
  case "hr":
4535
4471
  case "h":
4536
- return l * r;
4472
+ return h * r;
4537
4473
  case "minutes":
4538
4474
  case "minute":
4539
4475
  case "mins":
4540
4476
  case "min":
4541
4477
  case "m":
4542
- return l * e;
4478
+ return h * e;
4543
4479
  case "seconds":
4544
4480
  case "second":
4545
4481
  case "secs":
4546
4482
  case "sec":
4547
4483
  case "s":
4548
- return l * t;
4484
+ return h * t;
4549
4485
  case "milliseconds":
4550
4486
  case "millisecond":
4551
4487
  case "msecs":
4552
4488
  case "msec":
4553
4489
  case "ms":
4554
- return l;
4490
+ return h;
4555
4491
  default:
4556
4492
  return;
4557
4493
  }
@@ -4559,86 +4495,86 @@ function su() {
4559
4495
  }
4560
4496
  }
4561
4497
  function a(c) {
4562
- var h = Math.abs(c);
4563
- return h >= n ? Math.round(c / n) + "d" : h >= r ? Math.round(c / r) + "h" : h >= e ? Math.round(c / e) + "m" : h >= t ? Math.round(c / t) + "s" : c + "ms";
4498
+ var l = Math.abs(c);
4499
+ return l >= n ? Math.round(c / n) + "d" : l >= r ? Math.round(c / r) + "h" : l >= e ? Math.round(c / e) + "m" : l >= t ? Math.round(c / t) + "s" : c + "ms";
4564
4500
  }
4565
4501
  function u(c) {
4566
- var h = Math.abs(c);
4567
- return h >= n ? f(c, h, n, "day") : h >= r ? f(c, h, r, "hour") : h >= e ? f(c, h, e, "minute") : h >= t ? f(c, h, t, "second") : c + " ms";
4502
+ var l = Math.abs(c);
4503
+ return l >= n ? f(c, l, n, "day") : l >= r ? f(c, l, r, "hour") : l >= e ? f(c, l, e, "minute") : l >= t ? f(c, l, t, "second") : c + " ms";
4568
4504
  }
4569
- function f(c, h, l, g) {
4570
- var v = h >= l * 1.5;
4571
- return Math.round(c / l) + " " + g + (v ? "s" : "");
4505
+ function f(c, l, h, g) {
4506
+ var v = l >= h * 1.5;
4507
+ return Math.round(c / h) + " " + g + (v ? "s" : "");
4572
4508
  }
4573
4509
  return Xt;
4574
4510
  }
4575
- function au(t) {
4576
- r.debug = r, r.default = r, r.coerce = u, r.disable = o, r.enable = i, r.enabled = s, r.humanize = su(), r.destroy = f, Object.keys(t).forEach((c) => {
4511
+ function uu(t) {
4512
+ r.debug = r, r.default = r, r.coerce = u, r.disable = o, r.enable = i, r.enabled = s, r.humanize = au(), r.destroy = f, Object.keys(t).forEach((c) => {
4577
4513
  r[c] = t[c];
4578
4514
  }), r.names = [], r.skips = [], r.formatters = {};
4579
4515
  function e(c) {
4580
- let h = 0;
4581
- for (let l = 0; l < c.length; l++)
4582
- h = (h << 5) - h + c.charCodeAt(l), h |= 0;
4583
- return r.colors[Math.abs(h) % r.colors.length];
4516
+ let l = 0;
4517
+ for (let h = 0; h < c.length; h++)
4518
+ l = (l << 5) - l + c.charCodeAt(h), l |= 0;
4519
+ return r.colors[Math.abs(l) % r.colors.length];
4584
4520
  }
4585
4521
  r.selectColor = e;
4586
4522
  function r(c) {
4587
- let h, l = null, g, v;
4588
- function w(...b) {
4589
- if (!w.enabled)
4523
+ let l, h = null, g, v;
4524
+ function I(...b) {
4525
+ if (!I.enabled)
4590
4526
  return;
4591
- const L = w, R = Number(/* @__PURE__ */ new Date()), Q = R - (h || R);
4592
- L.diff = Q, L.prev = h, L.curr = R, h = R, b[0] = r.coerce(b[0]), typeof b[0] != "string" && b.unshift("%O");
4527
+ const L = I, R = Number(/* @__PURE__ */ new Date()), Q = R - (l || R);
4528
+ L.diff = Q, L.prev = l, L.curr = R, l = R, b[0] = r.coerce(b[0]), typeof b[0] != "string" && b.unshift("%O");
4593
4529
  let X = 0;
4594
4530
  b[0] = b[0].replace(/%([a-zA-Z%])/g, (V, T) => {
4595
4531
  if (V === "%%")
4596
4532
  return "%";
4597
4533
  X++;
4598
- const ie = r.formatters[T];
4599
- if (typeof ie == "function") {
4600
- const oe = b[X];
4601
- V = ie.call(L, oe), b.splice(X, 1), X--;
4534
+ const ne = r.formatters[T];
4535
+ if (typeof ne == "function") {
4536
+ const ie = b[X];
4537
+ V = ne.call(L, ie), b.splice(X, 1), X--;
4602
4538
  }
4603
4539
  return V;
4604
4540
  }), r.formatArgs.call(L, b), (L.log || r.log).apply(L, b);
4605
4541
  }
4606
- return w.namespace = c, w.useColors = r.useColors(), w.color = r.selectColor(c), w.extend = n, w.destroy = r.destroy, Object.defineProperty(w, "enabled", {
4542
+ return I.namespace = c, I.useColors = r.useColors(), I.color = r.selectColor(c), I.extend = n, I.destroy = r.destroy, Object.defineProperty(I, "enabled", {
4607
4543
  enumerable: !0,
4608
4544
  configurable: !1,
4609
- get: () => l !== null ? l : (g !== r.namespaces && (g = r.namespaces, v = r.enabled(c)), v),
4545
+ get: () => h !== null ? h : (g !== r.namespaces && (g = r.namespaces, v = r.enabled(c)), v),
4610
4546
  set: (b) => {
4611
- l = b;
4547
+ h = b;
4612
4548
  }
4613
- }), typeof r.init == "function" && r.init(w), w;
4549
+ }), typeof r.init == "function" && r.init(I), I;
4614
4550
  }
4615
- function n(c, h) {
4616
- const l = r(this.namespace + (typeof h > "u" ? ":" : h) + c);
4617
- return l.log = this.log, l;
4551
+ function n(c, l) {
4552
+ const h = r(this.namespace + (typeof l > "u" ? ":" : l) + c);
4553
+ return h.log = this.log, h;
4618
4554
  }
4619
4555
  function i(c) {
4620
4556
  r.save(c), r.namespaces = c, r.names = [], r.skips = [];
4621
- let h;
4622
- const l = (typeof c == "string" ? c : "").split(/[\s,]+/), g = l.length;
4623
- for (h = 0; h < g; h++)
4624
- l[h] && (c = l[h].replace(/\*/g, ".*?"), c[0] === "-" ? r.skips.push(new RegExp("^" + c.slice(1) + "$")) : r.names.push(new RegExp("^" + c + "$")));
4557
+ let l;
4558
+ const h = (typeof c == "string" ? c : "").split(/[\s,]+/), g = h.length;
4559
+ for (l = 0; l < g; l++)
4560
+ h[l] && (c = h[l].replace(/\*/g, ".*?"), c[0] === "-" ? r.skips.push(new RegExp("^" + c.slice(1) + "$")) : r.names.push(new RegExp("^" + c + "$")));
4625
4561
  }
4626
4562
  function o() {
4627
4563
  const c = [
4628
4564
  ...r.names.map(a),
4629
- ...r.skips.map(a).map((h) => "-" + h)
4565
+ ...r.skips.map(a).map((l) => "-" + l)
4630
4566
  ].join(",");
4631
4567
  return r.enable(""), c;
4632
4568
  }
4633
4569
  function s(c) {
4634
4570
  if (c[c.length - 1] === "*")
4635
4571
  return !0;
4636
- let h, l;
4637
- for (h = 0, l = r.skips.length; h < l; h++)
4638
- if (r.skips[h].test(c))
4572
+ let l, h;
4573
+ for (l = 0, h = r.skips.length; l < h; l++)
4574
+ if (r.skips[l].test(c))
4639
4575
  return !1;
4640
- for (h = 0, l = r.names.length; h < l; h++)
4641
- if (r.names[h].test(c))
4576
+ for (l = 0, h = r.names.length; l < h; l++)
4577
+ if (r.names[l].test(c))
4642
4578
  return !0;
4643
4579
  return !1;
4644
4580
  }
@@ -4653,7 +4589,7 @@ function au(t) {
4653
4589
  }
4654
4590
  return r.enable(r.load()), r;
4655
4591
  }
4656
- var uu = au;
4592
+ var cu = uu;
4657
4593
  (function(t, e) {
4658
4594
  e.formatArgs = n, e.save = i, e.load = o, e.useColors = r, e.storage = s(), e.destroy = /* @__PURE__ */ (() => {
4659
4595
  let u = !1;
@@ -4750,10 +4686,10 @@ var uu = au;
4750
4686
  return;
4751
4687
  const f = "color: " + this.color;
4752
4688
  u.splice(1, 0, f, "color: inherit");
4753
- let c = 0, h = 0;
4754
- u[0].replace(/%[a-zA-Z%]/g, (l) => {
4755
- l !== "%%" && (c++, l === "%c" && (h = c));
4756
- }), u.splice(h, 0, f);
4689
+ let c = 0, l = 0;
4690
+ u[0].replace(/%[a-zA-Z%]/g, (h) => {
4691
+ h !== "%%" && (c++, h === "%c" && (l = c));
4692
+ }), u.splice(l, 0, f);
4757
4693
  }
4758
4694
  e.log = console.debug || console.log || (() => {
4759
4695
  });
@@ -4769,7 +4705,7 @@ var uu = au;
4769
4705
  u = e.storage.getItem("debug");
4770
4706
  } catch {
4771
4707
  }
4772
- return !u && typeof A < "u" && "env" in A && (u = A.env.DEBUG), u;
4708
+ return !u && typeof w < "u" && "env" in w && (u = w.env.DEBUG), u;
4773
4709
  }
4774
4710
  function s() {
4775
4711
  try {
@@ -4777,7 +4713,7 @@ var uu = au;
4777
4713
  } catch {
4778
4714
  }
4779
4715
  }
4780
- t.exports = uu(e);
4716
+ t.exports = cu(e);
4781
4717
  const { formatters: a } = t.exports;
4782
4718
  a.j = function(u) {
4783
4719
  try {
@@ -4786,29 +4722,29 @@ var uu = au;
4786
4722
  return "[UnexpectedJSONParseError]: " + f.message;
4787
4723
  }
4788
4724
  };
4789
- })(gr, gr.exports);
4790
- var ci = gr.exports;
4791
- const cu = Vn, lu = Gn.EventEmitter, du = Ft.inherits, j = ci("avvio"), { AVV_ERR_READY_TIMEOUT: fu } = ui, Zt = Symbol.for("plugin-meta");
4792
- function hu(t, e) {
4725
+ })(mr, mr.exports);
4726
+ var li = mr.exports;
4727
+ const lu = $n, du = Kn.EventEmitter, fu = Ft.inherits, j = li("avvio"), { AVV_ERR_READY_TIMEOUT: hu } = ci, Zt = Symbol.for("plugin-meta");
4728
+ function pu(t, e) {
4793
4729
  return t[Zt] && t[Zt].name ? t[Zt].name : typeof e < "u" && typeof e != "function" && e.name ? e.name : t.name ? t.name : t.toString().split(`
4794
4730
  `).slice(0, 2).map((r) => r.trim()).join(" -- ");
4795
4731
  }
4796
- function pu() {
4732
+ function yu() {
4797
4733
  const t = {};
4798
4734
  return t.promise = new Promise((e, r) => {
4799
4735
  t.resolve = e, t.reject = r;
4800
4736
  }), t;
4801
4737
  }
4802
4738
  function We(t, e, r, n, i) {
4803
- this.started = !1, this.func = e, this.opts = r, this.onFinish = null, this.parent = t, this.timeout = i === void 0 ? t._timeout : i, this.name = hu(e, r), this.isAfter = n, this.q = cu(t, yu, 1), this.q.pause(), this._error = null, this.loaded = !1, this._promise = null;
4739
+ this.started = !1, this.func = e, this.opts = r, this.onFinish = null, this.parent = t, this.timeout = i === void 0 ? t._timeout : i, this.name = pu(e, r), this.isAfter = n, this.q = lu(t, mu, 1), this.q.pause(), this._error = null, this.loaded = !1, this._promise = null;
4804
4740
  }
4805
- du(We, lu);
4741
+ fu(We, du);
4806
4742
  We.prototype.exec = function(t, e) {
4807
4743
  const r = this.func;
4808
4744
  let n = !1;
4809
4745
  const i = this.name;
4810
4746
  if (this.parent._error && !this.isAfter) {
4811
- j("skipping loading of plugin as parent errored and it is not an after", i), A.nextTick(e);
4747
+ j("skipping loading of plugin as parent errored and it is not an after", i), w.nextTick(e);
4812
4748
  return;
4813
4749
  }
4814
4750
  if (this.isAfter)
@@ -4830,13 +4766,13 @@ We.prototype.exec = function(t, e) {
4830
4766
  };
4831
4767
  this.timeout > 0 && (j("setting up timeout", i, this.timeout), o = setTimeout(function() {
4832
4768
  j("timed out", i), o = null;
4833
- const u = new fu(i);
4769
+ const u = new hu(i);
4834
4770
  u.fn = r, s(u);
4835
4771
  }, this.timeout)), this.started = !0, this.emit("start", this.server ? this.server.name : null, this.name, Date.now());
4836
4772
  const a = r(this.server, this.opts, s);
4837
4773
  a && typeof a.then == "function" && (j("exec: resolving promise", i), a.then(
4838
- () => A.nextTick(s),
4839
- (u) => A.nextTick(s, u)
4774
+ () => w.nextTick(s),
4775
+ (u) => w.nextTick(s, u)
4840
4776
  ));
4841
4777
  };
4842
4778
  We.prototype.loadedSoFar = function() {
@@ -4844,11 +4780,11 @@ We.prototype.loadedSoFar = function() {
4844
4780
  return Promise.resolve();
4845
4781
  const t = () => {
4846
4782
  this.server.after((r, n) => {
4847
- this._error = r, this.q.pause(), r ? (j("rejecting promise", this.name, r), this._promise.reject(r)) : (j("resolving promise", this.name), this._promise.resolve()), this._promise = null, A.nextTick(n, r);
4783
+ this._error = r, this.q.pause(), r ? (j("rejecting promise", this.name, r), this._promise.reject(r)) : (j("resolving promise", this.name), this._promise.resolve()), this._promise = null, w.nextTick(n, r);
4848
4784
  }), this.q.resume();
4849
4785
  };
4850
4786
  let e;
4851
- return this._promise ? e = Promise.resolve() : (this._promise = pu(), e = this._promise.promise, this.server ? t() : this.on("start", t)), e;
4787
+ return this._promise ? e = Promise.resolve() : (this._promise = yu(), e = this._promise.promise, this.server ? t() : this.on("start", t)), e;
4852
4788
  };
4853
4789
  We.prototype.enqueue = function(t, e) {
4854
4790
  j("enqueue", this.name, t.name), this.emit("enqueue", this.server ? this.server.name : null, this.name, Date.now()), this.q.push(t, e);
@@ -4878,9 +4814,9 @@ We.prototype.finish = function(t, e) {
4878
4814
  };
4879
4815
  queueMicrotask(n), this.q.resume();
4880
4816
  };
4881
- function yu(t, e) {
4817
+ function mu(t, e) {
4882
4818
  const r = this;
4883
- A.nextTick(Nr.bind(r), t, e);
4819
+ w.nextTick(Nr.bind(r), t, e);
4884
4820
  }
4885
4821
  function Nr(t, e) {
4886
4822
  if (typeof t.func.then == "function") {
@@ -4900,15 +4836,15 @@ function gu() {
4900
4836
  }
4901
4837
  Pr.exports = We;
4902
4838
  Pr.exports.loadPlugin = Nr;
4903
- var mu = Pr.exports;
4904
- const bn = Vn, vu = Gn.EventEmitter, bu = Ft.inherits, {
4839
+ var vu = Pr.exports;
4840
+ const bn = $n, bu = Kn.EventEmitter, Su = Ft.inherits, {
4905
4841
  AVV_ERR_EXPOSE_ALREADY_DEFINED: er,
4906
4842
  AVV_ERR_CALLBACK_NOT_FN: et,
4907
- AVV_ERR_PLUGIN_NOT_VALID: Su,
4908
- AVV_ERR_ROOT_PLG_BOOTED: wu,
4909
- AVV_ERR_READY_TIMEOUT: Au
4910
- } = ui, Eu = ou, mr = mu, ze = ci("avvio"), Lt = Symbol("kAvvio"), tr = Symbol("kThenifyDoNotWrap");
4911
- function Iu(t, e, r) {
4843
+ AVV_ERR_PLUGIN_NOT_VALID: wu,
4844
+ AVV_ERR_ROOT_PLG_BOOTED: Au,
4845
+ AVV_ERR_READY_TIMEOUT: Eu
4846
+ } = ci, Iu = su, gr = vu, ze = li("avvio"), _t = Symbol("kAvvio"), tr = Symbol("kThenifyDoNotWrap");
4847
+ function Tu(t, e, r) {
4912
4848
  const n = e.expose || {}, i = n.use || "use", o = n.after || "after", s = n.ready || "ready", a = n.onClose || "onClose", u = n.close || "close";
4913
4849
  if (t[i])
4914
4850
  throw new er(i);
@@ -4918,7 +4854,7 @@ function Iu(t, e, r) {
4918
4854
  throw new er(s);
4919
4855
  t[i] = function(f, c) {
4920
4856
  return r.use(f, c), this;
4921
- }, Object.defineProperty(t, "then", { get: li.bind(r) }), t[Lt] = !0, t[o] = function(f) {
4857
+ }, Object.defineProperty(t, "then", { get: di.bind(r) }), t[_t] = !0, t[o] = function(f) {
4922
4858
  return typeof f != "function" ? r._loadRegistered() : (r.after(rr(f, this)), this);
4923
4859
  }, t[s] = function(f) {
4924
4860
  if (f && typeof f != "function")
@@ -4927,28 +4863,28 @@ function Iu(t, e, r) {
4927
4863
  }, t[a] = function(f) {
4928
4864
  if (typeof f != "function")
4929
4865
  throw new et(a, typeof f);
4930
- return r.onClose(Cu(f, this)), this;
4866
+ return r.onClose(ku(f, this)), this;
4931
4867
  }, t[u] = function(f) {
4932
4868
  if (f && typeof f != "function")
4933
4869
  throw new et(u, typeof f);
4934
4870
  return f ? (r.close(rr(f, this)), this) : r.close();
4935
4871
  };
4936
4872
  }
4937
- function q(t, e, r) {
4938
- if (typeof t == "function" && arguments.length === 1 && (r = t, e = {}, t = null), typeof e == "function" && (r = e, e = {}), e = e || {}, !(this instanceof q)) {
4939
- const n = new q(t, e, r);
4940
- return t && Iu(t, e, n), n;
4873
+ function B(t, e, r) {
4874
+ if (typeof t == "function" && arguments.length === 1 && (r = t, e = {}, t = null), typeof e == "function" && (r = e, e = {}), e = e || {}, !(this instanceof B)) {
4875
+ const n = new B(t, e, r);
4876
+ return t && Tu(t, e, n), n;
4941
4877
  }
4942
- e.autostart !== !1 && (e.autostart = !0), t = t || this, this._timeout = Number(e.timeout) || 0, this._server = t, this._current = [], this._error = null, this._isOnCloseHandlerKey = Symbol("isOnCloseHandler"), this._lastUsed = null, this.setMaxListeners(0), r && this.once("start", r), this.started = !1, this.booted = !1, this.pluginTree = new Eu(), this._readyQ = bn(this, di, 1), this._readyQ.pause(), this._readyQ.drain = () => {
4878
+ e.autostart !== !1 && (e.autostart = !0), t = t || this, this._timeout = Number(e.timeout) || 0, this._server = t, this._current = [], this._error = null, this._isOnCloseHandlerKey = Symbol("isOnCloseHandler"), this._lastUsed = null, this.setMaxListeners(0), r && this.once("start", r), this.started = !1, this.booted = !1, this.pluginTree = new Iu(), this._readyQ = bn(this, fi, 1), this._readyQ.pause(), this._readyQ.drain = () => {
4943
4879
  this.emit("start"), this._readyQ.drain = Sn;
4944
4880
  }, this._closeQ = bn(this, Lu, 1), this._closeQ.pause(), this._closeQ.drain = () => {
4945
4881
  this.emit("close"), this._closeQ.drain = Sn;
4946
- }, this._doStart = null, this._root = new mr(this, Tu.bind(this), e, !1, 0), this._root.once("start", (n, i, o) => {
4882
+ }, this._doStart = null, this._root = new gr(this, Ou.bind(this), e, !1, 0), this._root.once("start", (n, i, o) => {
4947
4883
  const s = this.pluginTree.start(null, i, o);
4948
4884
  this._root.once("loaded", (a, u, f) => {
4949
4885
  this.pluginTree.stop(s, f);
4950
4886
  });
4951
- }), mr.loadPlugin.call(this, this._root, (n) => {
4887
+ }), gr.loadPlugin.call(this, this._root, (n) => {
4952
4888
  ze("root plugin ready");
4953
4889
  try {
4954
4890
  this.emit("preReady"), this._root = null;
@@ -4963,38 +4899,38 @@ function q(t, e, r) {
4963
4899
  this._readyQ.resume();
4964
4900
  });
4965
4901
  }
4966
- function Tu(t, e, r) {
4902
+ function Ou(t, e, r) {
4967
4903
  this._doStart = r, e.autostart && this.start();
4968
4904
  }
4969
- bu(q, vu);
4970
- q.prototype.start = function() {
4971
- return this.started = !0, A.nextTick(this._doStart), this;
4905
+ Su(B, bu);
4906
+ B.prototype.start = function() {
4907
+ return this.started = !0, w.nextTick(this._doStart), this;
4972
4908
  };
4973
- q.prototype.override = function(t, e, r) {
4909
+ B.prototype.override = function(t, e, r) {
4974
4910
  return t;
4975
4911
  };
4976
- function Ou(t) {
4912
+ function _u(t) {
4977
4913
  if (t && typeof t == "object" && typeof t.default == "function" && (t = t.default), !(t && (typeof t == "function" || typeof t.then == "function")))
4978
- throw new Su(typeof t);
4914
+ throw new wu(typeof t);
4979
4915
  return t;
4980
4916
  }
4981
- q.prototype[Lt] = !0;
4982
- q.prototype.use = function(t, e) {
4917
+ B.prototype[_t] = !0;
4918
+ B.prototype.use = function(t, e) {
4983
4919
  return this._lastUsed = this._addPlugin(t, e, !1), this;
4984
4920
  };
4985
- q.prototype._loadRegistered = function() {
4921
+ B.prototype._loadRegistered = function() {
4986
4922
  const t = this._current[0];
4987
- return !this.started && !this.booted && A.nextTick(() => this._root.q.resume()), t ? t.loadedSoFar() : Promise.resolve();
4923
+ return !this.started && !this.booted && w.nextTick(() => this._root.q.resume()), t ? t.loadedSoFar() : Promise.resolve();
4988
4924
  };
4989
- Object.defineProperty(q.prototype, "then", { get: li });
4990
- q.prototype._addPlugin = function(t, e, r) {
4991
- if (t = Ou(t), e = e || {}, this.booted)
4992
- throw new wu();
4993
- const n = this._current[0], i = new mr(this, t, e, r);
4925
+ Object.defineProperty(B.prototype, "then", { get: di });
4926
+ B.prototype._addPlugin = function(t, e, r) {
4927
+ if (t = _u(t), e = e || {}, this.booted)
4928
+ throw new Au();
4929
+ const n = this._current[0], i = new gr(this, t, e, r);
4994
4930
  if (i.once("start", (o, s, a) => {
4995
4931
  const u = this.pluginTree.start(n.name, s, a);
4996
- i.once("loaded", (f, c, h) => {
4997
- this.pluginTree.stop(u, h);
4932
+ i.once("loaded", (f, c, l) => {
4933
+ this.pluginTree.stop(u, l);
4998
4934
  });
4999
4935
  }), n.loaded)
5000
4936
  throw new Error(i.name, n.name);
@@ -5002,16 +4938,16 @@ q.prototype._addPlugin = function(t, e, r) {
5002
4938
  o && (this._error = o);
5003
4939
  }), i;
5004
4940
  };
5005
- q.prototype.after = function(t) {
4941
+ B.prototype.after = function(t) {
5006
4942
  if (!t)
5007
4943
  return this._loadRegistered();
5008
4944
  this._addPlugin(e.bind(this), {}, !0);
5009
4945
  function e(r, n, i) {
5010
- di.call(this, t, i);
4946
+ fi.call(this, t, i);
5011
4947
  }
5012
4948
  return this;
5013
4949
  };
5014
- q.prototype.onClose = function(t) {
4950
+ B.prototype.onClose = function(t) {
5015
4951
  if (typeof t != "function")
5016
4952
  throw new Error("not a function");
5017
4953
  t[this._isOnCloseHandlerKey] = !0, this._closeQ.unshift(t, e.bind(this));
@@ -5020,7 +4956,7 @@ q.prototype.onClose = function(t) {
5020
4956
  }
5021
4957
  return this;
5022
4958
  };
5023
- q.prototype.close = function(t) {
4959
+ B.prototype.close = function(t) {
5024
4960
  let e;
5025
4961
  if (t) {
5026
4962
  if (typeof t != "function")
@@ -5034,10 +4970,10 @@ q.prototype.close = function(t) {
5034
4970
  };
5035
4971
  });
5036
4972
  return this.ready(() => {
5037
- this._error = null, this._closeQ.push(t), A.nextTick(this._closeQ.resume.bind(this._closeQ));
4973
+ this._error = null, this._closeQ.push(t), w.nextTick(this._closeQ.resume.bind(this._closeQ));
5038
4974
  }), e;
5039
4975
  };
5040
- q.prototype.ready = function(t) {
4976
+ B.prototype.ready = function(t) {
5041
4977
  if (t) {
5042
4978
  if (typeof t != "function")
5043
4979
  throw new et("ready", typeof t);
@@ -5048,19 +4984,19 @@ q.prototype.ready = function(t) {
5048
4984
  this._readyQ.push(i), this.start();
5049
4985
  const n = this._current[0].server;
5050
4986
  function i(o, s, a) {
5051
- o ? r(o) : e(n), A.nextTick(a);
4987
+ o ? r(o) : e(n), w.nextTick(a);
5052
4988
  }
5053
4989
  });
5054
4990
  };
5055
- q.prototype.prettyPrint = function() {
4991
+ B.prototype.prettyPrint = function() {
5056
4992
  return this.pluginTree.prittyPrint();
5057
4993
  };
5058
- q.prototype.toJSON = function() {
4994
+ B.prototype.toJSON = function() {
5059
4995
  return this.pluginTree.toJSON();
5060
4996
  };
5061
4997
  function Sn() {
5062
4998
  }
5063
- function li() {
4999
+ function di() {
5064
5000
  if (this.booted) {
5065
5001
  ze("thenify returning null because we are already booted");
5066
5002
  return;
@@ -5071,27 +5007,27 @@ function li() {
5071
5007
  }
5072
5008
  return ze("thenify"), (t, e) => this._loadRegistered().then(() => (this[tr] = !0, t(this._server)), e);
5073
5009
  }
5074
- function di(t, e) {
5010
+ function fi(t, e) {
5075
5011
  const r = this._server, n = this._error;
5076
5012
  let i;
5077
5013
  if (this._error = null, t.length === 0)
5078
- this._error = n, i = t(), i && !i[Lt] && typeof i.then == "function" ? i.then(() => A.nextTick(e), (o) => A.nextTick(e, o)) : A.nextTick(e);
5014
+ this._error = n, i = t(), i && !i[_t] && typeof i.then == "function" ? i.then(() => w.nextTick(e), (o) => w.nextTick(e, o)) : w.nextTick(e);
5079
5015
  else if (t.length === 1)
5080
- i = t(n), i && !i[Lt] && typeof i.then == "function" ? i.then(() => A.nextTick(e), (o) => A.nextTick(e, o)) : A.nextTick(e);
5016
+ i = t(n), i && !i[_t] && typeof i.then == "function" ? i.then(() => w.nextTick(e), (o) => w.nextTick(e, o)) : w.nextTick(e);
5081
5017
  else if (this._timeout === 0) {
5082
5018
  const o = (s) => {
5083
5019
  this._error = s, e(this._error);
5084
5020
  };
5085
5021
  t.length === 2 ? t(n, o) : t(n, r, o);
5086
5022
  } else
5087
- _u.call(this, t, n, r, e);
5023
+ Cu.call(this, t, n, r, e);
5088
5024
  }
5089
- function _u(t, e, r, n) {
5025
+ function Cu(t, e, r, n) {
5090
5026
  const i = t.name;
5091
5027
  ze("setting up ready timeout", i, this._timeout);
5092
5028
  let o = setTimeout(() => {
5093
5029
  ze("timed out", i), o = null;
5094
- const a = new Au(i);
5030
+ const a = new Eu(i);
5095
5031
  a.fn = t, this._error = a, n(a);
5096
5032
  }, this._timeout);
5097
5033
  t.length === 2 ? t(e, s.bind(this)) : t(e, r, s.bind(this));
@@ -5104,20 +5040,20 @@ function Lu(t, e) {
5104
5040
  if (t.length === 0 || t.length === 1) {
5105
5041
  let i;
5106
5042
  n ? i = t(r) : i = t(this._error), i && typeof i.then == "function" ? (ze("resolving close/onClose promise"), i.then(
5107
- () => A.nextTick(e),
5108
- (o) => A.nextTick(e, o)
5109
- )) : A.nextTick(e);
5043
+ () => w.nextTick(e),
5044
+ (o) => w.nextTick(e, o)
5045
+ )) : w.nextTick(e);
5110
5046
  } else t.length === 2 ? t(n ? r : this._error, e) : n ? t(r, e) : t(this._error, r, e);
5111
5047
  }
5112
- function Cu(t, e) {
5048
+ function ku(t, e) {
5113
5049
  return r.bind(e);
5114
5050
  function r(n, i) {
5115
5051
  let o;
5116
5052
  t.length === 0 ? (o = t(), o && o.then ? o.then(function() {
5117
- A.nextTick(i);
5118
- }, i) : A.nextTick(i)) : t.length === 1 ? (o = t(this), o && o.then ? o.then(function() {
5119
- A.nextTick(i);
5120
- }, i) : A.nextTick(i)) : t(this, i);
5053
+ w.nextTick(i);
5054
+ }, i) : w.nextTick(i)) : t.length === 1 ? (o = t(this), o && o.then ? o.then(function() {
5055
+ w.nextTick(i);
5056
+ }, i) : w.nextTick(i)) : t(this, i);
5121
5057
  }
5122
5058
  }
5123
5059
  function rr(t, e) {
@@ -5125,22 +5061,22 @@ function rr(t, e) {
5125
5061
  function r(n, i) {
5126
5062
  let o;
5127
5063
  t ? t.length === 0 ? (o = t(), o && o.then ? o.then(function() {
5128
- A.nextTick(i, n);
5129
- }, i) : A.nextTick(i, n)) : t.length === 1 ? (o = t(n), o && o.then ? o.then(function() {
5130
- A.nextTick(i);
5131
- }, i) : A.nextTick(i)) : t.length === 2 ? t(n, i) : t(n, this, i) : A.nextTick(i);
5064
+ w.nextTick(i, n);
5065
+ }, i) : w.nextTick(i, n)) : t.length === 1 ? (o = t(n), o && o.then ? o.then(function() {
5066
+ w.nextTick(i);
5067
+ }, i) : w.nextTick(i)) : t.length === 2 ? t(n, i) : t(n, this, i) : w.nextTick(i);
5132
5068
  }
5133
5069
  }
5134
- Sr.exports = q;
5070
+ Sr.exports = B;
5135
5071
  Sr.exports.express = function(t) {
5136
- return q(t, {
5072
+ return B(t, {
5137
5073
  expose: {
5138
5074
  use: "load"
5139
5075
  }
5140
5076
  });
5141
5077
  };
5142
- var ku = Sr.exports;
5143
- const Pu = /* @__PURE__ */ os(ku);
5078
+ var Pu = Sr.exports;
5079
+ const Nu = /* @__PURE__ */ ss(Pu);
5144
5080
  (function() {
5145
5081
  if (window.requestAnimationFrame && window.cancelAnimationFrame)
5146
5082
  return;
@@ -5158,9 +5094,9 @@ const Pu = /* @__PURE__ */ os(ku);
5158
5094
  }, window.cancelAnimationFrame = clearTimeout;
5159
5095
  }
5160
5096
  })();
5161
- function tc(t, e = !0, r = !0, n) {
5162
- const i = e ? "https://grpc-sdk.streamlayer.io:443" : "https://grpc-sdk.next.streamlayer.io:443", o = e ? "https://grpc.streamlayer.io:443" : "https://grpc.next.streamlayer.io:443", s = Pu(/* @__PURE__ */ Object.create({}), { autostart: !1 });
5163
- return s.use(Ro), s.use(Co, { onDeepLinkHandled: n?.onDeepLinkHandled }), s.use(Fo, { videoPlayerController: n?.videoPlayerController }), s.use(Do, { onContentActivate: n?.onContentActivate }), s.use(Hi, { sdkKey: t, host: i, analyticsHost: o, version: n?.version }), s.use(Zi), s.use(No), s.use(Ho), s.use(bo), s.use(is), s.after((a, u, f) => {
5097
+ function rc(t, e = !0, r = !0, n) {
5098
+ const i = e ? "https://grpc-sdk.streamlayer.io:443" : "https://grpc-sdk.next.streamlayer.io:443", o = e ? "https://grpc.streamlayer.io:443" : "https://grpc.next.streamlayer.io:443", s = Nu(/* @__PURE__ */ Object.create({}), { autostart: !1 });
5099
+ return s.use(Vo), s.use(Lo, { onDeepLinkHandled: n?.onDeepLinkHandled }), s.use(Fo, { videoPlayerController: n?.videoPlayerController }), s.use(Ro, { onContentActivate: n?.onContentActivate }), s.use(Wi, { sdkKey: t, host: i, analyticsHost: o, version: n?.version }), s.use(eo), s.use(No), s.use(Wo), s.use(bo), s.use(os), s.after((a, u, f) => {
5164
5100
  if (a)
5165
5101
  throw a;
5166
5102
  u.ready(), f();
@@ -5173,5 +5109,5 @@ function tc(t, e = !0, r = !0, n) {
5173
5109
  }), s;
5174
5110
  }
5175
5111
  export {
5176
- tc as StreamLayer
5112
+ rc as StreamLayer
5177
5113
  };