@streamlayer/sdk-web 0.33.1 → 0.33.2

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.
package/lib/es/index.js CHANGED
@@ -1,50 +1,50 @@
1
- import { pino as Wn } from "pino";
2
- import { QuestionType as D, QuestionStatus as Ee, SilenceSetting as Jn } from "@streamlayer/sl-eslib/interactive/interactive.common_pb";
1
+ import { pino as Jn } from "pino";
2
+ import { QuestionType as D, QuestionStatus as ce, SilenceSetting as Yn } from "@streamlayer/sl-eslib/interactive/interactive.common_pb";
3
3
  import { PickHistoryStatus as at } from "@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb";
4
4
  import { SdkOverlayType as N } from "@streamlayer/sl-eslib/sdkSettings/sdkSettings.common_pb";
5
5
  import { InvitationCategory as Sr, InvitationFrom as wr } from "@streamlayer/sl-eslib/analytics/v1/invitations/invitations_pb";
6
- import { computed as Yn, map as Xn, atom as At, batched as Ar, onMount as sr } from "nanostores";
6
+ import { computed as Xn, map as Zn, atom as At, batched as Ar, onMount as sr } from "nanostores";
7
7
  import { nanoid as Gt } from "nanoid";
8
- import { ConnectError as et, Code as ee, createContextKey as Er, createPromiseClient as Ir, createContextValues as Zn } from "@connectrpc/connect";
8
+ import { ConnectError as et, Code as ee, createContextKey as Ir, createPromiseClient as Er, createContextValues as ei } from "@connectrpc/connect";
9
9
  import { createGrpcWebTransport as Tr } from "@connectrpc/connect-web";
10
10
  import { nanoquery as Or } from "@nanostores/query";
11
- import { Events as ei } from "@streamlayer/sl-eslib/sports/events/events_connect";
11
+ import { Events as ti } from "@streamlayer/sl-eslib/sports/events/events_connect";
12
12
  import { Client as rt } from "@streamlayer/sl-eslib/sdkSettings/client/client_connect";
13
13
  import { Users as ar } from "@streamlayer/sl-eslib/users/users_connect";
14
- import { Feed as be } from "@streamlayer/sl-eslib/interactive/feed/interactive.feed_connect";
14
+ import { Feed as ve } from "@streamlayer/sl-eslib/interactive/feed/interactive.feed_connect";
15
15
  import { Leaderboard as nn } from "@streamlayer/sl-eslib/interactive/leaderboard/interactive.leaderboard_connect";
16
16
  import "@streamlayer/sl-eslib/interactive/leaderboard/interactive.leaderboard_pb";
17
- import { LinksClient as ti } from "@streamlayer/sl-eslib/shortLinks/linksClient_connect";
18
- import { Kind as W, TopicType as K, Category as Q, PollOpenedFrom as De, ScreenOrientation as Cr } from "@streamlayer/sl-eslib/analytics/v1/common/analytics.common_pb";
17
+ import { LinksClient as ri } from "@streamlayer/sl-eslib/shortLinks/linksClient_connect";
18
+ import { Kind as H, TopicType as K, Category as Q, PollOpenedFrom as De, ScreenOrientation as Cr } from "@streamlayer/sl-eslib/analytics/v1/common/analytics.common_pb";
19
19
  import { AnalyticsService as on } from "@streamlayer/sl-eslib/analytics/v2/streaming/streaming_connect";
20
20
  import { InteractionActionType as Lr } from "@streamlayer/sl-eslib/analytics/v1/interactions/interactions_pb";
21
- import { NotificationKind as ue, NotificationType as _r } from "@streamlayer/sl-eslib/analytics/v1/notifications/notifications_pb";
22
- function ri(t) {
21
+ import { NotificationKind as ae, NotificationType as _r } from "@streamlayer/sl-eslib/analytics/v1/notifications/notifications_pb";
22
+ function ni(t) {
23
23
  return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
24
24
  }
25
- var sn = { exports: {} }, V = sn.exports = {}, te, re;
26
- function zt() {
25
+ var sn = { exports: {} }, $ = sn.exports = {}, te, re;
26
+ function Kt() {
27
27
  throw new Error("setTimeout has not been defined");
28
28
  }
29
- function Kt() {
29
+ function zt() {
30
30
  throw new Error("clearTimeout has not been defined");
31
31
  }
32
32
  (function() {
33
33
  try {
34
- typeof setTimeout == "function" ? te = setTimeout : te = zt;
34
+ typeof setTimeout == "function" ? te = setTimeout : te = Kt;
35
35
  } catch {
36
- te = zt;
36
+ te = Kt;
37
37
  }
38
38
  try {
39
- typeof clearTimeout == "function" ? re = clearTimeout : re = Kt;
39
+ typeof clearTimeout == "function" ? re = clearTimeout : re = zt;
40
40
  } catch {
41
- re = Kt;
41
+ re = zt;
42
42
  }
43
43
  })();
44
44
  function an(t) {
45
45
  if (te === setTimeout)
46
46
  return setTimeout(t, 0);
47
- if ((te === zt || !te) && setTimeout)
47
+ if ((te === Kt || !te) && setTimeout)
48
48
  return te = setTimeout, setTimeout(t, 0);
49
49
  try {
50
50
  return te(t, 0);
@@ -56,10 +56,10 @@ function an(t) {
56
56
  }
57
57
  }
58
58
  }
59
- function ni(t) {
59
+ function ii(t) {
60
60
  if (re === clearTimeout)
61
61
  return clearTimeout(t);
62
- if ((re === Kt || !re) && clearTimeout)
62
+ if ((re === zt || !re) && clearTimeout)
63
63
  return re = clearTimeout, clearTimeout(t);
64
64
  try {
65
65
  return re(t);
@@ -71,28 +71,28 @@ function ni(t) {
71
71
  }
72
72
  }
73
73
  }
74
- var pe = [], xe = !1, Ie, lt = -1;
75
- function ii() {
76
- !xe || !Ie || (xe = !1, Ie.length ? pe = Ie.concat(pe) : lt = -1, pe.length && un());
74
+ var he = [], xe = !1, Ee, lt = -1;
75
+ function oi() {
76
+ !xe || !Ee || (xe = !1, Ee.length ? he = Ee.concat(he) : lt = -1, he.length && un());
77
77
  }
78
78
  function un() {
79
79
  if (!xe) {
80
- var t = an(ii);
80
+ var t = an(oi);
81
81
  xe = !0;
82
- for (var e = pe.length; e; ) {
83
- for (Ie = pe, pe = []; ++lt < e; )
84
- Ie && Ie[lt].run();
85
- lt = -1, e = pe.length;
82
+ for (var e = he.length; e; ) {
83
+ for (Ee = he, he = []; ++lt < e; )
84
+ Ee && Ee[lt].run();
85
+ lt = -1, e = he.length;
86
86
  }
87
- Ie = null, xe = !1, ni(t);
87
+ Ee = null, xe = !1, ii(t);
88
88
  }
89
89
  }
90
- V.nextTick = function(t) {
90
+ $.nextTick = function(t) {
91
91
  var e = new Array(arguments.length - 1);
92
92
  if (arguments.length > 1)
93
93
  for (var r = 1; r < arguments.length; r++)
94
94
  e[r - 1] = arguments[r];
95
- pe.push(new cn(t, e)), pe.length === 1 && !xe && an(un);
95
+ he.push(new cn(t, e)), he.length === 1 && !xe && an(un);
96
96
  };
97
97
  function cn(t, e) {
98
98
  this.fun = t, this.array = e;
@@ -100,40 +100,40 @@ function cn(t, e) {
100
100
  cn.prototype.run = function() {
101
101
  this.fun.apply(null, this.array);
102
102
  };
103
- V.title = "browser";
104
- V.browser = !0;
105
- V.env = {};
106
- V.argv = [];
107
- V.version = "";
108
- V.versions = {};
109
- function ye() {
103
+ $.title = "browser";
104
+ $.browser = !0;
105
+ $.env = {};
106
+ $.argv = [];
107
+ $.version = "";
108
+ $.versions = {};
109
+ function ge() {
110
110
  }
111
- V.on = ye;
112
- V.addListener = ye;
113
- V.once = ye;
114
- V.off = ye;
115
- V.removeListener = ye;
116
- V.removeAllListeners = ye;
117
- V.emit = ye;
118
- V.prependListener = ye;
119
- V.prependOnceListener = ye;
120
- V.listeners = function(t) {
111
+ $.on = ge;
112
+ $.addListener = ge;
113
+ $.once = ge;
114
+ $.off = ge;
115
+ $.removeListener = ge;
116
+ $.removeAllListeners = ge;
117
+ $.emit = ge;
118
+ $.prependListener = ge;
119
+ $.prependOnceListener = ge;
120
+ $.listeners = function(t) {
121
121
  return [];
122
122
  };
123
- V.binding = function(t) {
123
+ $.binding = function(t) {
124
124
  throw new Error("process.binding is not supported");
125
125
  };
126
- V.cwd = function() {
126
+ $.cwd = function() {
127
127
  return "/";
128
128
  };
129
- V.chdir = function(t) {
129
+ $.chdir = function(t) {
130
130
  throw new Error("process.chdir is not supported");
131
131
  };
132
- V.umask = function() {
132
+ $.umask = function() {
133
133
  return 0;
134
134
  };
135
- var oi = sn.exports;
136
- const S = /* @__PURE__ */ ri(oi), si = Wn({
135
+ var si = sn.exports;
136
+ const S = /* @__PURE__ */ ni(si), ai = Jn({
137
137
  level: "trace",
138
138
  enabled: !!window.localStorage.getItem("SL_DEBUG"),
139
139
  browser: {
@@ -141,23 +141,23 @@ const S = /* @__PURE__ */ ri(oi), si = Wn({
141
141
  console.log(t);
142
142
  }
143
143
  }
144
- }), ve = (t, e) => si.child({ name: t }, e);
145
- class ai extends Event {
144
+ }), Se = (t, e) => ai.child({ name: t }, e);
145
+ class ui extends Event {
146
146
  slEventBus;
147
147
  constructor(e, r) {
148
148
  super(e), this.slEventBus = r;
149
149
  }
150
150
  }
151
- const ui = ve("event-bus");
152
- class ci {
151
+ const ci = Se("event-bus");
152
+ class li {
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 ai(this.name, { ...r, type: e });
160
- ui.debug(n, "Emitting event"), window.dispatchEvent(n);
159
+ const n = new ui(this.name, { ...r, type: e });
160
+ ci.debug(n, "Emitting event"), window.dispatchEvent(n);
161
161
  };
162
162
  listen(e) {
163
163
  return window.addEventListener(this.name, e), this.listeners.add(e), () => {
@@ -173,10 +173,10 @@ class ci {
173
173
  }), this.listeners.clear();
174
174
  };
175
175
  }
176
- class li {
176
+ class di {
177
177
  }
178
178
  window.slStore = /* @__PURE__ */ Object.create(null);
179
- class Et {
179
+ class It {
180
180
  /**
181
181
  * store instance (nanostores)
182
182
  */
@@ -192,23 +192,23 @@ class Et {
192
192
  return this.store;
193
193
  }
194
194
  }
195
- const di = (t) => {
195
+ const fi = (t) => {
196
196
  const e = Object.keys(t);
197
- return Yn(e.map((r) => t[r].getStore()), (...r) => Object.fromEntries(e.map((n, i) => [n, r[i]])));
197
+ return Xn(e.map((r) => t[r].getStore()), (...r) => Object.fromEntries(e.map((n, i) => [n, r[i]])));
198
198
  };
199
- class Te extends Et {
199
+ class Te extends It {
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 ie = (t) => Xn(t);
206
+ const ie = (t) => Zn(t);
207
207
  var le;
208
208
  (function(t) {
209
209
  t.ORGANIZATION = "ORGANIZATION", t.STREAM = "STREAM";
210
210
  })(le || (le = {}));
211
- const fi = {
211
+ const hi = {
212
212
  [N.BETTING]: "betting",
213
213
  [N.GAMES]: "games",
214
214
  [N.PUBLIC_CHAT]: "publicChat",
@@ -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 = fi[r.type], this.status = At(Je.Suspended), this.config = new Te(ie(r), `feature:config:${this.settingsKey}`), this.settingsKey !== void 0 && e?.overlaySettings.case === this.settingsKey ? this.settings = new Te(ie(e.overlaySettings.value), `feature:settings:${this.settingsKey}`) : this.settings = new Te(ie({}), `feature:settings:${this.settingsKey}`), this.source = n;
229
+ this.settingsKey = hi[r.type], this.status = At(Je.Suspended), this.config = new Te(ie(r), `feature:config:${this.settingsKey}`), this.settingsKey !== void 0 && e?.overlaySettings.case === this.settingsKey ? this.settings = new Te(ie(e.overlaySettings.value), `feature:settings:${this.settingsKey}`) : this.settings = new Te(ie({}), `feature:settings:${this.settingsKey}`), this.source = n;
230
230
  }
231
231
  get featureConfig() {
232
232
  return this.config.getStore();
@@ -268,7 +268,7 @@ class ln {
268
268
  }
269
269
  }
270
270
  }
271
- class z extends Et {
271
+ class W extends It {
272
272
  getValue = () => this.getStore().get();
273
273
  getValues() {
274
274
  throw new Error("not implemented");
@@ -284,7 +284,7 @@ class z extends Et {
284
284
  }
285
285
  }
286
286
  const B = (t) => At(t);
287
- class oe extends Et {
287
+ class ye extends It {
288
288
  atomStore;
289
289
  constructor(e, r, n) {
290
290
  super(e, `api:${r}`), this.atomStore = At(), n && e.subscribe((i) => {
@@ -315,7 +315,7 @@ class oe extends Et {
315
315
  key = () => this.getStore().key;
316
316
  off = () => this.getStore().off();
317
317
  }
318
- const he = new ci();
318
+ const pe = new li();
319
319
  async function* pi(t, e) {
320
320
  for await (const r of e) {
321
321
  t.response.message = r, t.received_at = Date.now();
@@ -326,7 +326,7 @@ async function* pi(t, e) {
326
326
  window.postMessage(n), yield r;
327
327
  }
328
328
  }
329
- const hi = () => (t) => async (e) => {
329
+ const yi = () => (t) => async (e) => {
330
330
  const r = {
331
331
  name: e.url,
332
332
  stream: e.stream,
@@ -378,7 +378,7 @@ var Y;
378
378
  (function(t) {
379
379
  t.Init = "init", t.Ready = "ready", t.Connecting = "connecting", t.Connected = "connected", t.Disconnected = "disconnected", t.Failed = "failed", t.Reconnect = "reconnect", t.Reconnecting = "reconnecting";
380
380
  })(Y || (Y = {}));
381
- class yi {
381
+ class gi {
382
382
  params;
383
383
  streamCancel;
384
384
  method;
@@ -402,7 +402,7 @@ class yi {
402
402
  reconnectMaxDelay: i.reconnectMaxDelay ?? 3e4,
403
403
  reconnectMaxAttempts: i.reconnectMaxAttempts ?? 10,
404
404
  withStore: i.withStore ?? !1
405
- }, this.headers = e, this.listeners = /* @__PURE__ */ new Map(), this.params = n, this.method = r, i.withStore && (this.store = new z(B(null), `subscription:${i.name}:store`)), "subscribe" in n && typeof n.subscribe == "function" && (this.paramsListener = n.subscribe((s) => {
405
+ }, this.headers = e, this.listeners = /* @__PURE__ */ new Map(), this.params = n, this.method = r, i.withStore && (this.store = new W(B(null), `subscription:${i.name}:store`)), "subscribe" in n && typeof n.subscribe == "function" && (this.paramsListener = n.subscribe((s) => {
406
406
  this.state.getValue("status") === Y.Connected && (this.addStateLog(`params updated, reconnect => ${JSON.stringify(s)}`), this.reconnect());
407
407
  })), this.updateState(Y.Ready);
408
408
  }
@@ -414,7 +414,8 @@ class yi {
414
414
  r.push(n), this.state.setValue("log", r), window.sessionStorage.setItem("slstreamlogs", window.sessionStorage.getItem("slstreamlogs") + `
415
415
  ` + n);
416
416
  };
417
- addListener = (e, r) => this.listeners.has(e) ? (this.addStateLog(`listener '${e}' not added, already exists`), !1) : (this.listeners.set(e, r), this.addStateLog(`listener '${e}' added`), !0);
417
+ addListener = (e, r) => this.listeners.has(e) ? (this.addStateLog(`listener '${e}' not added, already exists`), () => {
418
+ }) : (this.listeners.set(e, r), this.addStateLog(`listener '${e}' added`), () => this.removeListener(e));
418
419
  removeListener = (e) => {
419
420
  this.listeners.delete(e), this.addStateLog(`listener '${e}' removed`);
420
421
  };
@@ -479,7 +480,7 @@ class yi {
479
480
  }
480
481
  };
481
482
  }
482
- const gi = /* @__PURE__ */ new Set([
483
+ const mi = /* @__PURE__ */ new Set([
483
484
  ee.Unknown,
484
485
  ee.Internal,
485
486
  ee.DeadlineExceeded,
@@ -487,7 +488,7 @@ const gi = /* @__PURE__ */ new Set([
487
488
  ee.FailedPrecondition,
488
489
  ee.Unavailable,
489
490
  ee.DataLoss
490
- ]), kr = ve("grpc:retry"), mi = (t) => async (e) => {
491
+ ]), kr = Se("grpc:retry"), bi = (t) => async (e) => {
491
492
  const r = e.contextValues.get(Ht.retryAttempts), n = 300, i = e.contextValues.get(Ht.retryDelay);
492
493
  if (e.stream || r === 0)
493
494
  return t(e);
@@ -498,21 +499,21 @@ const gi = /* @__PURE__ */ new Set([
498
499
  } catch (s) {
499
500
  kr.trace({ attempt: o, error: s }, "retry attempt");
500
501
  const a = et.from(s);
501
- if (o >= r || !(a instanceof et) || !gi.has(a.code))
502
+ if (o >= r || !(a instanceof et) || !mi.has(a.code))
502
503
  throw s;
503
504
  const u = Math.min(i, Math.pow(2, o) * n), d = Math.round(u * (1 + Math.random()) / 2);
504
505
  await new Promise((c) => setTimeout(c, d));
505
506
  }
506
507
  }, Ht = {
507
- retryAttempts: Er(5, { description: "Number of attempts to retry" }),
508
- retryDelay: Er(3e4, { description: "Max delay between retries in milliseconds" })
509
- }, bi = () => {
508
+ retryAttempts: Ir(5, { description: "Number of attempts to retry" }),
509
+ retryDelay: Ir(3e4, { description: "Max delay between retries in milliseconds" })
510
+ }, vi = () => {
510
511
  const t = localStorage.getItem("sl-device-id");
511
512
  if (t)
512
513
  return t;
513
514
  const e = Gt();
514
515
  return localStorage.setItem("sl-device-id", e), e;
515
- }, vi = () => navigator.userAgentData?.platform || navigator.platform;
516
+ }, Si = () => navigator.userAgentData?.platform || navigator.platform;
516
517
  class Pr {
517
518
  toJsonOptions = {
518
519
  emitDefaultValues: !1,
@@ -530,16 +531,17 @@ class Pr {
530
531
  clients;
531
532
  streamClients;
532
533
  subscriptions;
533
- constructor(e) {
534
- this.host = e, this.$headers = new Te(ie({
535
- "sl-device-id": bi(),
536
- "sl-device-os": vi()
534
+ opts;
535
+ constructor(e, r) {
536
+ this.host = e, this.opts = r, this.$headers = new Te(ie({
537
+ "sl-device-id": vi(),
538
+ "sl-device-os": Si()
537
539
  }), "transport:headers"), this.initInterceptors(), this.clients = /* @__PURE__ */ new Map(), this.streamClients = /* @__PURE__ */ new Map(), this.subscriptions = /* @__PURE__ */ new Map();
538
- const [r, n, i] = Or({
539
- dedupeTime: 1e3 * 60 * 5,
540
- refetchInterval: 1e3 * 60 * 5
540
+ const [n, i, o] = Or({
541
+ dedupeTime: r?.dedupeTime,
542
+ refetchInterval: r?.refetchInterval
541
543
  });
542
- this.nanoquery = { createFetcherStore: r, createMutatorStore: n, utils: i }, this.transport = Tr({
544
+ this.nanoquery = { createFetcherStore: n, createMutatorStore: i, utils: o }, this.transport = Tr({
543
545
  baseUrl: e,
544
546
  defaultTimeoutMs: 1e4,
545
547
  interceptors: this.interceptors,
@@ -557,7 +559,7 @@ class Pr {
557
559
  const i = this.subscriptions.get(r);
558
560
  if (i)
559
561
  return i;
560
- const o = new yi(this.$headers, e, r, n);
562
+ const o = new gi(this.$headers, e, r, n);
561
563
  return this.subscriptions.set(r, o), o;
562
564
  };
563
565
  removeSubscription = (e) => {
@@ -568,7 +570,10 @@ class Pr {
568
570
  for (const [i, o] of this.subscriptions)
569
571
  o.disconnect(), this.subscriptions.delete(i);
570
572
  this.clients.clear(), this.streamClients.clear(), this.subscriptions.clear();
571
- const [e, r, n] = Or();
573
+ const [e, r, n] = Or({
574
+ dedupeTime: 1e3 * 60 * 5,
575
+ refetchInterval: 1e3 * 60 * 5
576
+ });
572
577
  this.nanoquery = { createFetcherStore: e, createMutatorStore: r, utils: n };
573
578
  };
574
579
  registerInterceptor = (e) => {
@@ -581,14 +586,14 @@ class Pr {
581
586
  const r = e.typeName;
582
587
  if (this.clients.has(r))
583
588
  return this.clients.get(r);
584
- const n = Ir(e, this.transport);
589
+ const n = Er(e, this.transport);
585
590
  return this.clients.set(r, n), n;
586
591
  };
587
592
  getStreamClient = (e) => {
588
593
  const r = `stream-${e.typeName}`;
589
594
  if (this.clients.has(r))
590
595
  return this.clients.get(r);
591
- const n = Ir(e, this.streamTransport);
596
+ const n = Er(e, this.streamTransport);
592
597
  return this.clients.set(r, n), n;
593
598
  };
594
599
  // create unary client, used for query request
@@ -599,10 +604,10 @@ class Pr {
599
604
  ...Array.isArray(r) ? r : [r]
600
605
  ], a = [e.typeName, o.charAt(0).toLowerCase() + o.slice(1)];
601
606
  return { client: i, createRequestOptions: (d) => {
602
- const c = Zn();
607
+ const c = ei();
603
608
  for (const f in d) {
604
- const y = Ht[f];
605
- c.set(y, d[f]);
609
+ const p = Ht[f];
610
+ c.set(p, d[f]);
606
611
  }
607
612
  return c;
608
613
  }, queryKey: s, queryKeyStr: a.join("") };
@@ -627,11 +632,11 @@ class Pr {
627
632
  n.header.set(o, i[o]);
628
633
  return r(n);
629
634
  };
630
- this.interceptors.push(e), this.interceptors.push(hi()), this.interceptors.push(mi);
635
+ this.interceptors.push(e), this.interceptors.push(yi()), this.opts?.retryable && this.interceptors.push(bi);
631
636
  };
632
637
  }
633
- const Si = (t, e) => {
634
- const { client: r, queryKey: n } = e.createPromiseClient(ei, {
638
+ const wi = (t, e) => {
639
+ const { client: r, queryKey: n } = e.createPromiseClient(ti, {
635
640
  method: "retrieveEventId",
636
641
  params: [t]
637
642
  });
@@ -648,7 +653,7 @@ const Si = (t, e) => {
648
653
  }
649
654
  }
650
655
  });
651
- }, wi = (t, e) => {
656
+ }, Ai = (t, e) => {
652
657
  const { client: r, queryKey: n } = e.createPromiseClient(rt, { method: "getStream", params: [t] });
653
658
  return e.nanoquery.createFetcherStore(n, {
654
659
  fetcher: async (i, o, s) => s ? (await r.getStream({
@@ -656,7 +661,7 @@ const Si = (t, e) => {
656
661
  // we are sure that id is a string
657
662
  })).data?.attributes : void 0
658
663
  });
659
- }, Ai = (t, e) => {
664
+ }, Ii = (t, e) => {
660
665
  const { queryKey: r, client: n } = e.createPromiseClient(ar, { method: "me", params: [t] });
661
666
  return e.nanoquery.createFetcherStore(r, {
662
667
  fetcher: () => n.me({})
@@ -664,12 +669,12 @@ const Si = (t, e) => {
664
669
  }, Ei = (t) => {
665
670
  const { client: e, createRequestOptions: r } = t.createPromiseClient(ar, { method: "bypassAuth" }), n = r({ retryAttempts: 0 });
666
671
  return ({ userKey: i, schema: o, init: s, inviterKey: a }) => e.bypassAuth({ userKey: i, schema: o, init: s, inviterKey: a }, { contextValues: n });
667
- }, Ii = (t, e) => {
672
+ }, Ti = (t, e) => {
668
673
  const { client: r, queryKey: n } = e.createPromiseClient(rt, { method: "get", params: [t] });
669
674
  return e.nanoquery.createFetcherStore(n, {
670
675
  fetcher: async () => (await r.get({})).data?.attributes
671
676
  });
672
- }, Ti = (t, e) => {
677
+ }, Oi = (t, e) => {
673
678
  const { client: r, queryKey: n } = e.createPromiseClient(rt, { method: "getOrganization", params: [t] });
674
679
  return e.nanoquery.createFetcherStore(n, {
675
680
  fetcher: async () => {
@@ -680,7 +685,7 @@ const Si = (t, e) => {
680
685
  } : void 0;
681
686
  }
682
687
  });
683
- }, Oi = (t, e) => {
688
+ }, Ci = (t, e) => {
684
689
  const { client: r, queryKey: n } = e.createPromiseClient(rt, {
685
690
  method: "getOrganizationAdvertising",
686
691
  params: [t]
@@ -688,14 +693,18 @@ const Si = (t, e) => {
688
693
  return e.nanoquery.createFetcherStore(n, {
689
694
  fetcher: async () => (await r.getOrganizationAdvertising({})).data?.attributes
690
695
  });
691
- }, Ci = (t, e, r) => {
692
- t.transport = new Pr(e.host), t.analyticsTransport = new Pr(e.analyticsHost), t.sdk.host = t.transport.host, t.transport.setSdkKey(e.sdkKey), t.transport.setHeader("sl-sdk-version", e.version || "-"), t.transport.$headers.subscribe((n) => {
696
+ }, Li = (t, e, r) => {
697
+ t.transport = new Pr(e.host, {
698
+ dedupeTime: 1e3 * 60 * 5,
699
+ refetchInterval: 1e3 * 60 * 5,
700
+ retryable: !0
701
+ }), t.analyticsTransport = new Pr(e.analyticsHost), t.sdk.host = t.transport.host, t.transport.setSdkKey(e.sdkKey), t.transport.setHeader("sl-sdk-version", e.version || "-"), t.transport.$headers.subscribe((n) => {
693
702
  t.analyticsTransport.$headers.getStore().set(n);
694
703
  }), t.sdk.onMount(() => () => {
695
704
  t.transport.disconnect(), t.analyticsTransport.disconnect();
696
705
  }), r();
697
706
  };
698
- class It {
707
+ class Et {
699
708
  delimiter = ":";
700
709
  prefix;
701
710
  storage;
@@ -719,50 +728,50 @@ class It {
719
728
  this.storage.removeItem(this.generateKey(e));
720
729
  };
721
730
  }
722
- var ce;
731
+ var ue;
723
732
  (function(t) {
724
733
  t.SCHEMA = "schema", t.EXTERNAL_TOKEN = "eToken", t.TOKEN = "token";
725
- })(ce || (ce = {}));
726
- class je extends It {
734
+ })(ue || (ue = {}));
735
+ class je extends Et {
727
736
  constructor() {
728
737
  super("user");
729
738
  }
730
739
  // Schema
731
740
  setSchema = (e) => {
732
- this.write(ce.SCHEMA, e);
741
+ this.write(ue.SCHEMA, e);
733
742
  };
734
- getSchema = () => this.read(ce.SCHEMA);
743
+ getSchema = () => this.read(ue.SCHEMA);
735
744
  // Token
736
745
  setToken = (e) => {
737
- this.write(ce.TOKEN, e);
746
+ this.write(ue.TOKEN, e);
738
747
  };
739
- getToken = () => this.read(ce.TOKEN);
748
+ getToken = () => this.read(ue.TOKEN);
740
749
  // External Token
741
750
  setExternalToken = (e) => {
742
- this.write(ce.EXTERNAL_TOKEN, e);
751
+ this.write(ue.EXTERNAL_TOKEN, e);
743
752
  };
744
- getExternalToken = () => this.read(ce.EXTERNAL_TOKEN);
753
+ getExternalToken = () => this.read(ue.EXTERNAL_TOKEN);
745
754
  removeToken = () => {
746
- this.remove(ce.TOKEN);
755
+ this.remove(ue.TOKEN);
747
756
  };
748
757
  }
749
758
  var de;
750
759
  (function(t) {
751
760
  t.DISABLED = "disabled", t.INITIALIZATION = "initialization", t.READY = "ready", t.FAILED = "failed", t.SUSPENDED = "suspended";
752
761
  })(de || (de = {}));
753
- const Li = (t) => {
754
- const e = new je(), r = new z(B(e.getExternalToken()), "userKey"), n = new z(B(e.getToken()), "userToken"), i = new oe(Ai(n.getStore(), t), "user", ({ data: s, error: a, loading: u }, d) => {
762
+ const _i = (t) => {
763
+ const e = new je(), r = new W(B(e.getExternalToken()), "userKey"), n = new W(B(e.getToken()), "userToken"), i = new ye(Ii(n.getStore(), t), "user", ({ data: s, error: a, loading: u }, d) => {
755
764
  if (!a)
756
765
  return s?.data?.id ? s.data.id : u === !1 ? void 0 : d;
757
- }), o = new oe(Ii(n.getStore(), t), "userSettings");
766
+ }), o = new ye(Ti(n.getStore(), t), "userSettings");
758
767
  return {
759
768
  userKey: r,
760
769
  userToken: n,
761
770
  user: i,
762
771
  userSettings: o
763
772
  };
764
- }, _i = (t) => {
765
- const e = new z(B(void 0), "providerStreamId"), r = new oe(Si(e.getStore(), t), "slStreamId", (i) => i?.data), n = new oe(wi(r.getAtomStore(), t), "streamSettings");
773
+ }, ki = (t) => {
774
+ const e = new W(B(void 0), "providerStreamId"), r = new ye(wi(e.getStore(), t), "slStreamId", (i) => i?.data), n = new ye(Ai(r.getAtomStore(), t), "streamSettings");
766
775
  return r.getAtomStore().listen((i) => {
767
776
  (i === "" || i === void 0) && n.getStore().mutate(void 0);
768
777
  }), {
@@ -770,8 +779,8 @@ const Li = (t) => {
770
779
  slStreamId: r,
771
780
  streamSettings: n
772
781
  };
773
- }, ki = (t) => {
774
- const e = new z(B(void 0), "enabled"), r = new z(B(de.DISABLED), "status"), n = new oe(Ti(e.getStore(), t), "organizationSettings", (a) => a?.data?.id), i = new oe(Oi(n.getAtomStore(), t), "organizationAdvertising"), o = Li(t), s = _i(t);
782
+ }, Pi = (t) => {
783
+ const e = new W(B(void 0), "enabled"), r = new W(B(de.DISABLED), "status"), n = new ye(Oi(e.getStore(), t), "organizationSettings", (a) => a?.data?.id), i = new ye(Ci(n.getAtomStore(), t), "organizationAdvertising"), o = _i(t), s = ki(t);
775
784
  return {
776
785
  enabled: e,
777
786
  status: r,
@@ -786,10 +795,10 @@ const Li = (t) => {
786
795
  organizationAdvertising: i
787
796
  };
788
797
  };
789
- class Pi extends Et {
798
+ class Fi extends It {
790
799
  stores;
791
800
  constructor(e) {
792
- const r = ki(e), n = di(r);
801
+ const r = Pi(e), n = fi(r);
793
802
  super(n, "core"), this.stores = r;
794
803
  }
795
804
  getValue() {
@@ -810,14 +819,14 @@ class Pi extends Et {
810
819
  };
811
820
  unsubscribe = () => this.getStore().off();
812
821
  }
813
- const Fi = (t, e, r) => {
814
- t.store = new Pi(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.storeUnsubscribe = () => {
822
+ const Ni = (t, e, r) => {
823
+ t.store = new Fi(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.storeUnsubscribe = () => {
815
824
  t.store.unsubscribe();
816
825
  }, r();
817
- }, Ni = (t) => {
826
+ }, Di = (t) => {
818
827
  const { client: e } = t.createPromiseClient(nn, { method: "list" });
819
828
  return (r) => e.list(r);
820
- }, Di = (t) => {
829
+ }, dn = (t) => {
821
830
  const { client: e } = t.createPromiseClient(nn, { method: "summary" });
822
831
  return (r) => e.summary(r);
823
832
  }, Ri = (t, e) => {
@@ -829,7 +838,7 @@ const Fi = (t, e, r) => {
829
838
  fetcher: async (i, o, s) => s ? (await r.getFriends({})).data : []
830
839
  });
831
840
  }, Vi = (t, e) => {
832
- const { client: r, queryKey: n } = e.createPromiseClient(be, { method: "get", params: [t] });
841
+ const { client: r, queryKey: n } = e.createPromiseClient(ve, { method: "get", params: [t] });
833
842
  return e.nanoquery.createFetcherStore(n, {
834
843
  fetcher: async (i, o, s) => (await r.get({
835
844
  eventId: s
@@ -838,7 +847,7 @@ const Fi = (t, e, r) => {
838
847
  dedupeTime: 1e3 * 60 * 60
839
848
  });
840
849
  }, $i = (t, e) => {
841
- const { client: r, queryKey: n } = e.createPromiseClient(be, { method: "syncQuestion", params: [t] });
850
+ const { client: r, queryKey: n } = e.createPromiseClient(ve, { method: "syncQuestion", params: [t] });
842
851
  return e.nanoquery.createFetcherStore(n, {
843
852
  fetcher: async (i, o, s) => s ? (await r.syncQuestion({
844
853
  filter: {
@@ -850,23 +859,23 @@ const Fi = (t, e, r) => {
850
859
  refetchInterval: 0
851
860
  });
852
861
  }, ji = (t, e) => {
853
- const { client: r } = e.createStreamClient(be), n = At({ eventId: t.get() || "", feedId: "" });
862
+ const { client: r } = e.createStreamClient(ve), n = At({ eventId: t.get() || "", feedId: "" });
854
863
  return t.subscribe((o = "") => {
855
864
  n.set({ eventId: o, feedId: "" });
856
865
  }), e.addSubscription(r.subscription, n, { name: "feedSubscription" });
857
- }, Ui = (t, e) => {
858
- const { client: r } = e.createStreamClient(be);
866
+ }, Mi = (t, e) => {
867
+ const { client: r } = e.createStreamClient(ve);
859
868
  return e.addSubscription(r.questionSubscription, { questionId: t }, { name: "questionSubscription" });
860
869
  }, Wt = (t, e) => {
861
- const { client: r, queryKey: n } = e.createPromiseClient(be, { method: "questionByUser", params: [t] });
870
+ const { client: r, queryKey: n } = e.createPromiseClient(ve, { method: "questionByUser", params: [t] });
862
871
  return e.nanoquery.createFetcherStore(n, {
863
872
  fetcher: async (i, o, s) => (await r.questionByUser({
864
873
  questionId: s
865
874
  })).data?.attributes?.question,
866
875
  dedupeTime: 1e3 * 60 * 5
867
876
  });
868
- }, Mi = (t, e, r) => {
869
- const { client: n, queryKey: i } = r.createPromiseClient(be, {
877
+ }, Ui = (t, e, r) => {
878
+ const { client: n, queryKey: i } = r.createPromiseClient(ve, {
870
879
  method: "list",
871
880
  params: [t, e]
872
881
  });
@@ -875,7 +884,7 @@ const Fi = (t, e, r) => {
875
884
  eventId: a,
876
885
  filter: {
877
886
  types: u === Oe.ALLOWED ? [] : [D.FACTOID, D.PROMOTION, D.TWEET],
878
- statuses: [Ee.ACTIVE, Ee.RESOLVED]
887
+ statuses: [ce.ACTIVE, ce.RESOLVED]
879
888
  }
880
889
  })).data : [],
881
890
  dedupeTime: 0,
@@ -893,16 +902,16 @@ const Fi = (t, e, r) => {
893
902
  const u = o.get().data, d = (c, f) => {
894
903
  if (!c || !f)
895
904
  return c || f || [];
896
- const y = [];
905
+ const p = [];
897
906
  for (let m = 0; m < c.length; m++)
898
- y.push({
907
+ p.push({
899
908
  ...c[m],
900
909
  ...f[m],
901
910
  correct: c[m].correct,
902
911
  youVoted: c[m].youVoted,
903
912
  pointsEarned: c[m].pointsEarned
904
913
  });
905
- return y;
914
+ return p;
906
915
  };
907
916
  o.mutate({
908
917
  ...a,
@@ -947,22 +956,27 @@ class Bi {
947
956
  notifications;
948
957
  log;
949
958
  transport;
959
+ cancels = /* @__PURE__ */ new Set();
950
960
  constructor(e) {
951
- this.transport = e.transport, this.log = ve("gamification-background"), this.slStreamId = e.stores.slStreamId.getAtomStore(), this.organizationId = e.stores.organizationSettings.getAtomStore(), this.userId = e.stores.user.getAtomStore(), this.moderationId = new z(B(void 0), "moderationId").getStore(), this.interactiveAllowed = new z(B(Oe.DISALLOWED), "interactiveAllowed").getStore(), this.openedQuestionId = new z(B(void 0), "openedQuestionId").getStore(), this.notifications = e.notifications, this.moderation = new oe(Vi(this.slStreamId, e.transport), "gamification:moderation"), this.feedList = new oe(Mi(this.slStreamId, this.interactiveAllowed, e.transport), "gamification:feedList"), this.activeQuestionId = new oe($i(this.slStreamId, e.transport), "gamification:activeQuestionId"), this.openedQuestion = xi(e.transport, this.openedQuestionId, this.feedList.getStore()), this.openedQuestionId.listen((r) => {
952
- this.log.debug({ item: r }, "received question"), r?.questionId ? (this.questionSubscription = Ui(r.questionId, e.transport), this.questionSubscription.addListener("feed-subscription-opened-question", (n) => {
961
+ this.transport = e.transport, this.log = Se("gamification-background"), this.slStreamId = e.stores.slStreamId.getAtomStore(), this.organizationId = e.stores.organizationSettings.getAtomStore(), this.userId = e.stores.user.getAtomStore(), this.moderationId = new W(B(void 0), "moderationId").getStore(), this.interactiveAllowed = new W(B(Oe.DISALLOWED), "interactiveAllowed").getStore(), this.openedQuestionId = new W(B(void 0), "openedQuestionId").getStore(), this.notifications = e.notifications, this.moderation = new ye(Vi(this.slStreamId, e.transport), "gamification:moderation"), this.feedList = new ye(Ui(this.slStreamId, this.interactiveAllowed, e.transport), "gamification:feedList"), this.activeQuestionId = $i(this.slStreamId, e.transport), this.openedQuestion = xi(e.transport, this.openedQuestionId, this.feedList.getStore()), this.cancels.add(this.openedQuestionId.listen((r) => {
962
+ this.log.debug({ item: r }, "received question"), r?.questionId ? (this.questionSubscription = Mi(r.questionId, e.transport), this.questionSubscription.addListener("feed-subscription-opened-question", (n) => {
953
963
  this.openedQuestion.updateExtendedQuestion(n.data?.attributes?.question);
954
964
  }), this.questionSubscription.connect()) : (this.log.info("cleanup on close question"), this.questionSubscription !== void 0 && (e.transport.removeSubscription(this.questionSubscription), this.questionSubscription = void 0));
955
- }), this.feedSubscription = ji(this.slStreamId, e.transport), this.feedSubscription.addListener("feed-subscription-active-question", (r) => {
956
- const n = this.activeQuestionId.store, i = n.get().data?.question?.id, o = r.data?.attributes?.question;
957
- o && (i && o.status === Ee.RESOLVED && o.id !== i || n && n.mutate(r.data?.attributes));
958
- }), this.feedSubscription.addListener("moderation update", (r) => {
965
+ })), this.feedSubscription = ji(this.slStreamId, e.transport), this.cancels.add(this.feedSubscription.addListener("feed-subscription-active-question", (r) => {
966
+ const n = this.activeQuestionId.get().data?.question?.id, i = r.data?.attributes?.question;
967
+ i && (n && i.status === ce.RESOLVED && i.id !== n || this.activeQuestionId.mutate(r.data?.attributes));
968
+ })), this.cancels.add(this.feedSubscription.addListener("moderation update", (r) => {
959
969
  window.requestAnimationFrame(() => {
960
970
  r.data?.attributes?.question === void 0 && r.data?.attributes?.moderation && this.moderation.invalidate();
961
971
  });
962
- }), this.feedSubscription.connect(), this.interactiveAllowed.listen(() => {
972
+ })), this.feedSubscription.connect(), this.cancels.add(this.interactiveAllowed.listen(() => {
963
973
  window.requestAnimationFrame(() => {
964
974
  this.activeQuestionId.invalidate();
965
975
  });
976
+ })), e.sdk.onMount(() => () => {
977
+ this.activeQuestionId.off();
978
+ for (const r of this.cancels)
979
+ r(), this.cancels.delete(r);
966
980
  });
967
981
  }
968
982
  /**
@@ -995,7 +1009,6 @@ class Bi {
995
1009
  }
996
1010
  class qi {
997
1011
  notificationsList;
998
- notifications;
999
1012
  store;
1000
1013
  timeouts;
1001
1014
  waitingQueue;
@@ -1003,7 +1016,7 @@ class qi {
1003
1016
  options;
1004
1017
  logger;
1005
1018
  constructor(e) {
1006
- this.options = e, this.logger = ve("notifications"), this.store = /* @__PURE__ */ new Map(), this.timeouts = /* @__PURE__ */ new Map(), this.waitingQueue = /* @__PURE__ */ new Set(), this.activeQueue = /* @__PURE__ */ new Set(), this.notifications = new z(B(/* @__PURE__ */ new Map()), "notifications-queue"), this.notificationsList = this.notifications.getStore();
1019
+ this.options = e, this.logger = Se("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());
1007
1020
  }
1008
1021
  addToQueue = (e) => {
1009
1022
  if (this.store.has(e.id)) {
@@ -1048,8 +1061,8 @@ class qi {
1048
1061
  return;
1049
1062
  }
1050
1063
  const n = setTimeout(() => {
1051
- const i = e, o = new Map(this.notifications.getValue());
1052
- o.set(r.id, r), this.notifications.setValue(o);
1064
+ const i = e, o = new Map(this.notificationsList.get());
1065
+ o.set(r.id, r), this.notificationsList.set(o);
1053
1066
  const s = setTimeout(() => {
1054
1067
  this.logger.debug({ notificationId: i, delay: r.autoHideDuration || 5e3 }, "notification hiding by autoHideDuration"), this.closeNotification(i);
1055
1068
  }, r.autoHideDuration || 5e3);
@@ -1058,12 +1071,12 @@ class qi {
1058
1071
  this.timeouts.set(e, n), this.logger.debug({ notificationId: e }, "active queue tick completed"), this.tickWaitingQueue();
1059
1072
  };
1060
1073
  closeNotification = (e) => {
1061
- const r = new Map(this.notifications.getValue()), n = r.get(e);
1074
+ const r = new Map(this.notificationsList.get()), n = r.get(e);
1062
1075
  if (n) {
1063
- n.hiding = !(this.waitingQueue.size >= this.options.concurrency), this.notifications.setValue(r);
1076
+ n.hiding = !(this.waitingQueue.size >= this.options.concurrency), this.notificationsList.set(r);
1064
1077
  const i = setTimeout(() => {
1065
- const o = new Map(this.notifications.getValue());
1066
- o.delete(e), this.notifications.setValue(o);
1078
+ const o = new Map(this.notificationsList.get());
1079
+ o.delete(e), this.notificationsList.set(o);
1067
1080
  const s = this.timeouts.get(e);
1068
1081
  s !== void 0 && (clearTimeout(s), this.timeouts.delete(e)), this.logger.debug({ notificationId: e }, "notification hidden");
1069
1082
  }, this.options.animationDelay || 0);
@@ -1071,12 +1084,15 @@ class qi {
1071
1084
  }
1072
1085
  return this.store.delete(e), this.activeQueue.delete(e), this.waitingQueue.delete(e), this.tickWaitingQueue(), this.logger.debug({ notificationId: e }, "notification hiding"), n;
1073
1086
  };
1087
+ drain = () => {
1088
+ this.store.clear(), this.timeouts.clear(), this.waitingQueue.clear(), this.activeQueue.clear(), this.notificationsList.off(), this.notificationsList.set(/* @__PURE__ */ new Map());
1089
+ };
1074
1090
  }
1075
1091
  var gt;
1076
1092
  (function(t) {
1077
1093
  t.OPENED = "opened";
1078
1094
  })(gt || (gt = {}));
1079
- class Qi extends It {
1095
+ class Qi extends Et {
1080
1096
  constructor() {
1081
1097
  super("notification");
1082
1098
  }
@@ -1088,10 +1104,10 @@ class Qi extends It {
1088
1104
  this.clear();
1089
1105
  };
1090
1106
  }
1091
- var me;
1107
+ var be;
1092
1108
  (function(t) {
1093
1109
  t[t.ONBOARDING = 1] = "ONBOARDING", t[t.QUESTION = 2] = "QUESTION", t[t.QUESTION_RESOLVED = 3] = "QUESTION_RESOLVED";
1094
- })(me || (me = {}));
1110
+ })(be || (be = {}));
1095
1111
  class Gi {
1096
1112
  queue;
1097
1113
  storage;
@@ -1103,7 +1119,7 @@ class Gi {
1103
1119
  if (e.data && e.emitEvent) {
1104
1120
  const n = e.action;
1105
1121
  e.action = (...i) => {
1106
- n && n(...i), he.emit("notification", {
1122
+ n && n(...i), pe.emit("notification", {
1107
1123
  action: "opened",
1108
1124
  payload: {
1109
1125
  questionId: e.data.questionId,
@@ -1123,7 +1139,7 @@ class Gi {
1123
1139
  if (!e?.size)
1124
1140
  return null;
1125
1141
  for (const n of e.values())
1126
- if (n.type === me.ONBOARDING)
1142
+ if (n.type === be.ONBOARDING)
1127
1143
  return n;
1128
1144
  return e.values().next().value;
1129
1145
  };
@@ -1132,42 +1148,44 @@ class Gi {
1132
1148
  this.storage.setOpened(e);
1133
1149
  };
1134
1150
  }
1135
- const zi = (t, e, r) => {
1136
- t.notifications = new Gi(void 0), t.addNotification = t.notifications.add, t.sdk.getNotificationsStore = () => t.notifications.getQueueStore(), t.sdk.getActiveNotification = () => t.notifications.getActiveNotification(), r();
1151
+ const Ki = (t, e, r) => {
1152
+ t.notifications = new Gi(void 0), t.addNotification = t.notifications.add, t.sdk.getNotificationsStore = () => t.notifications.getQueueStore(), t.sdk.getActiveNotification = () => t.notifications.getActiveNotification(), t.sdk.onMount(() => () => {
1153
+ t.notifications.queue.drain();
1154
+ }), r();
1137
1155
  };
1138
1156
  var tt;
1139
1157
  (function(t) {
1140
1158
  t.UNKNOWN = "unknown", t.ALREADY_VOTED = "already_voted";
1141
1159
  })(tt || (tt = {}));
1142
- const Ki = async (t, e) => {
1143
- const { client: r, createRequestOptions: n } = t.createPromiseClient(be, { method: "submitAnswer" }), i = n({ retryAttempts: 0 });
1160
+ const zi = async (t, e) => {
1161
+ const { client: r, createRequestOptions: n } = t.createPromiseClient(ve, { method: "submitAnswer" }), i = n({ retryAttempts: 0 });
1144
1162
  try {
1145
1163
  return await r.submitAnswer({ data: e }, { contextValues: i });
1146
1164
  } catch (o) {
1147
1165
  throw et.from(o)?.code === ee.AlreadyExists ? new Error(tt.ALREADY_VOTED) : new Error(tt.UNKNOWN);
1148
1166
  }
1149
1167
  }, Hi = (t, e) => {
1150
- const { client: r, createRequestOptions: n } = t.createPromiseClient(be, { method: "submitInplay" }), i = n({ retryAttempts: 0 });
1168
+ const { client: r, createRequestOptions: n } = t.createPromiseClient(ve, { method: "submitInplay" }), i = n({ retryAttempts: 0 });
1151
1169
  return r.submitInplay({ data: { eventId: +e } }, { contextValues: i });
1152
1170
  };
1153
- var Ue;
1171
+ var Me;
1154
1172
  (function(t) {
1155
1173
  t.ONBOARDING = "onboarding", t.ONBOARDING_IO = "onboarding_io";
1156
- })(Ue || (Ue = {}));
1157
- class dn extends It {
1174
+ })(Me || (Me = {}));
1175
+ class fn extends Et {
1158
1176
  constructor() {
1159
1177
  super("gamification");
1160
1178
  }
1161
1179
  saveOnboardingStatus = ({ userId: e, eventId: r, organizationId: n }, i) => {
1162
- this.write(Ue.ONBOARDING, n, e, r, i);
1180
+ this.write(Me.ONBOARDING, n, e, r, i);
1163
1181
  };
1164
- getOnboardingStatus = ({ userId: e, eventId: r, organizationId: n }) => this.read(Ue.ONBOARDING, n, e, r);
1182
+ getOnboardingStatus = ({ userId: e, eventId: r, organizationId: n }) => this.read(Me.ONBOARDING, n, e, r);
1165
1183
  setOnboardingInstantOpen = ({ userId: e, eventId: r, organizationId: n }) => {
1166
- const i = this.generateKey([Ue.ONBOARDING_IO, n, e, r]);
1184
+ const i = this.generateKey([Me.ONBOARDING_IO, n, e, r]);
1167
1185
  window.sessionStorage.setItem(i, "1");
1168
1186
  };
1169
1187
  getOnboardingInstantOpen = ({ userId: e, eventId: r, organizationId: n }) => {
1170
- const i = this.generateKey([Ue.ONBOARDING_IO, n, e, r]);
1188
+ const i = this.generateKey([Me.ONBOARDING_IO, n, e, r]);
1171
1189
  return window.sessionStorage.getItem(i);
1172
1190
  };
1173
1191
  }
@@ -1181,36 +1199,39 @@ const Wi = {
1181
1199
  hasMore: !0,
1182
1200
  loading: void 0,
1183
1201
  error: void 0
1184
- }), u = Ni(t), d = async () => {
1185
- const y = e.get(), m = n.getStore().get().data?.map((b) => b.slId) || [];
1186
- if (y && m?.length) {
1202
+ }), u = Di(t), d = async () => {
1203
+ const p = e.get(), m = n.getStore().get().data?.map((b) => b.slId) || [];
1204
+ if (p && m?.length) {
1187
1205
  const b = r.get();
1188
1206
  b && m.push(b), a.setKey("loading", !0), a.setKey("data", []);
1189
- const I = await u({
1190
- eventId: y,
1207
+ const E = await u({
1208
+ eventId: p,
1191
1209
  usersIds: m
1192
1210
  });
1193
1211
  a.set({
1194
- data: I.data.map((F) => F.attributes),
1212
+ data: E.data.map((F, V) => ({
1213
+ ...F.attributes,
1214
+ rank: V + 1
1215
+ })),
1195
1216
  hasMore: !1,
1196
1217
  key: Date.now(),
1197
1218
  loading: !1
1198
- }), I.meta && (o = Math.round(I.meta.count / I.meta.pageSize));
1219
+ }), E.meta && (o = Math.round(E.meta.count / E.meta.pageSize));
1199
1220
  }
1200
1221
  }, c = () => {
1201
1222
  d();
1202
- }, f = (y) => {
1203
- const m = s.get(), b = y || m.page + 1;
1223
+ }, f = (p) => {
1224
+ const m = s.get(), b = p || m.page + 1;
1204
1225
  b <= o && s.set({ ...m, page: b });
1205
1226
  };
1206
1227
  return sr(a, () => {
1207
- const y = e.listen(d), m = n.listen(d);
1228
+ const p = e.listen(d), m = n.listen(d);
1208
1229
  return () => {
1209
- y(), m();
1230
+ p(), m();
1210
1231
  };
1211
1232
  }), { $store: a, fetchMore: f, invalidate: c };
1212
1233
  };
1213
- class Yi extends It {
1234
+ class Yi extends Et {
1214
1235
  get = this.read;
1215
1236
  set = this.write;
1216
1237
  del = this.remove;
@@ -1218,7 +1239,7 @@ class Yi extends It {
1218
1239
  super("deep-link-context", window.sessionStorage);
1219
1240
  }
1220
1241
  }
1221
- const Fr = "sldl", Tt = "sldl_uid", fn = "sldl_eid", pn = "sldl_e_eid", Xi = /* @__PURE__ */ new Set([Tt, fn, pn]), Nr = (t) => {
1242
+ const Fr = "sldl", Tt = "sldl_uid", hn = "sldl_eid", pn = "sldl_e_eid", Xi = /* @__PURE__ */ new Set([Tt, hn, pn]), Nr = (t) => {
1222
1243
  const e = {}, r = {};
1223
1244
  for (const [n, i] of t)
1224
1245
  Xi.has(n) ? e[n] = i : r[n] = i;
@@ -1233,12 +1254,12 @@ const Fr = "sldl", Tt = "sldl_uid", fn = "sldl_eid", pn = "sldl_e_eid", Xi = /*
1233
1254
  return { search: Nr(r) };
1234
1255
  }
1235
1256
  return null;
1236
- }, Dr = ve("deep_link"), ne = {
1257
+ }, Dr = Se("deep_link"), ne = {
1237
1258
  debug: (...t) => {
1238
- Dr.debug(...t), console.log(...t);
1259
+ Dr.debug(...t), localStorage.getItem("SL_DEBUG") && console.log(...t);
1239
1260
  },
1240
1261
  trace: (...t) => {
1241
- Dr.trace(...t), console.log(...t);
1262
+ Dr.trace(...t), localStorage.getItem("SL_DEBUG") && console.log(...t);
1242
1263
  }
1243
1264
  }, eo = (t, e) => {
1244
1265
  const { hash: r, search: n } = window.location;
@@ -1288,7 +1309,7 @@ const Fr = "sldl", Tt = "sldl_uid", fn = "sldl_eid", pn = "sldl_e_eid", Xi = /*
1288
1309
  }, t.sdk.inviteDisplayed = () => {
1289
1310
  t.deepLink.$store.getStore().set({}), t.deepLink.$store.getStore().off(), n.del("sl-deep-link-store");
1290
1311
  }, t.deepLink.$store.subscribe((a) => n.set("sl-deep-link-store", JSON.stringify(a))), t.sdk.addDeepLinkHandler = (a) => {
1291
- ne.trace("adding deep link handler"), t.deepLink.onDeepLinkHandlers.add(a);
1312
+ localStorage.getItem("SL_DEBUG") && ne.trace("adding deep link handler"), t.deepLink.onDeepLinkHandlers.add(a);
1292
1313
  }, e.onDeepLinkHandled && t.sdk.addDeepLinkHandler(e.onDeepLinkHandled), t.sdk.removeDeepLinkHandler = (a) => {
1293
1314
  ne.trace("removing deep link handler"), t.deepLink.onDeepLinkHandlers.delete(a);
1294
1315
  };
@@ -1302,8 +1323,8 @@ const Fr = "sldl", Tt = "sldl_uid", fn = "sldl_eid", pn = "sldl_e_eid", Xi = /*
1302
1323
  }
1303
1324
  };
1304
1325
  eo(t.deepLink.$store, s), r();
1305
- }, ro = ve("bypass");
1306
- class no extends li {
1326
+ }, ro = Se("bypass");
1327
+ class no extends di {
1307
1328
  $coreStore;
1308
1329
  deepLink;
1309
1330
  transport;
@@ -1403,12 +1424,12 @@ const We = new je(), io = (t, e, r) => {
1403
1424
  }, t.sdk.logout = () => {
1404
1425
  t.auth.logout(), We.clear();
1405
1426
  }, t.sdk.getUserStore = () => t.stores.user.getStore(), t.sdk.isUserAuthorized = () => t.auth.isAuthenticated(), r();
1406
- }, Rr = ve("video_player"), ut = {
1427
+ }, Rr = Se("video_player"), ut = {
1407
1428
  debug: (...t) => {
1408
- Rr.debug(...t), console.log(...t);
1429
+ Rr.debug(...t), localStorage.getItem("SL_DEBUG") && console.log(...t);
1409
1430
  },
1410
1431
  trace: (...t) => {
1411
- Rr.trace(...t), console.log(...t);
1432
+ Rr.trace(...t), localStorage.getItem("SL_DEBUG") && console.log(...t);
1412
1433
  }
1413
1434
  }, oo = (t, e, r) => {
1414
1435
  t.videoPlayer = {
@@ -1429,27 +1450,27 @@ const We = new je(), io = (t, e, r) => {
1429
1450
  }
1430
1451
  }, r();
1431
1452
  }, so = (t, e, r) => {
1432
- const n = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set();
1433
- t.sdk = /* @__PURE__ */ Object.create(null), t.sdk.onMount = (o) => {
1434
- n.add(o);
1453
+ const n = { onMountedFired: !1 }, i = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Set();
1454
+ t.sdk = /* @__PURE__ */ Object.create(null), t.sdk.onMount = (s) => {
1455
+ i.has(s) || (i.add(s), t?.stores?.enabled?.get() === "on" && o.add(s()));
1435
1456
  }, t.ready = () => {
1436
- t.stores.enabled.subscribe((o) => {
1437
- o === "on" ? n.forEach((s) => i.add(s())) : i.forEach((s) => s());
1457
+ t.stores.enabled.subscribe((s) => {
1458
+ s === "on" && n.onMountedFired === !1 && (i.forEach((a) => o.add(a())), n.onMountedFired = !0), s !== "on" && n.onMountedFired === !0 && (o.forEach((a) => a()), o.clear(), n.onMountedFired = !1);
1438
1459
  });
1439
- }, t.sdk.initializeApp = async (o) => {
1440
- if (t.contextConfig = o, t.stores.enabled.get() === "on")
1460
+ }, t.sdk.initializeApp = async (s) => {
1461
+ if (t.contextConfig = s, t.stores.enabled.get() === "on")
1441
1462
  return { enabled: !0 };
1442
1463
  t.storeSubscribe(), t.stores.enabled.setValue("on"), t.stores.status.setValue(de.INITIALIZATION);
1443
1464
  try {
1444
- const s = await t.stores.organizationSettings.getValue();
1445
- return s ? (t.stores.status.setValue(de.READY), { enabled: !!s }) : (t.stores.status.setValue(de.FAILED), { err: "failed" });
1446
- } catch (s) {
1447
- return t.stores.enabled.setValue(), t.stores.status.setValue(de.FAILED), { err: `${s}` };
1465
+ const a = await t.stores.organizationSettings.getValue();
1466
+ return a ? (t.stores.status.setValue(de.READY), { enabled: !!a }) : (t.stores.status.setValue(de.FAILED), { err: "failed" });
1467
+ } catch (a) {
1468
+ return t.stores.enabled.setValue(), t.stores.status.setValue(de.FAILED), { err: `${a}` };
1448
1469
  }
1449
1470
  }, t.sdk.disableApp = () => {
1450
1471
  t.stores.enabled.get() === "on" && (t.stores.enabled.setValue(), t.stores.status.setValue(de.DISABLED), t.stores.slStreamId.setValue(), t.stores.providerStreamId.setValue(), t.sdk.closeFeature(!0), t.storeUnsubscribe(), t.transport.disconnect());
1451
- }, t.sdk.createEventSession = (o) => {
1452
- t.stores.providerStreamId.setValue(o);
1472
+ }, t.sdk.createEventSession = (s) => {
1473
+ t.stores.providerStreamId.setValue(s);
1453
1474
  }, r();
1454
1475
  }, ao = (t, e) => {
1455
1476
  const { client: r, queryKey: n } = t.createPromiseClient(rt, {
@@ -1465,7 +1486,7 @@ const We = new je(), io = (t, e, r) => {
1465
1486
  refetchInterval: 0
1466
1487
  });
1467
1488
  }, uo = (t, { web: e, mobile: r }) => {
1468
- const { client: n } = t.createPromiseClient(ti, { method: "generate" });
1489
+ const { client: n } = t.createPromiseClient(ri, { method: "generate" });
1469
1490
  return n.generate({ web: e, mobile: r });
1470
1491
  }, Vr = (t, e) => {
1471
1492
  const r = new URLSearchParams(t);
@@ -1475,32 +1496,32 @@ const We = new je(), io = (t, e, r) => {
1475
1496
  }, co = (t, e, r, n) => {
1476
1497
  const i = ie({});
1477
1498
  return sr(i, () => ao(t, [e, r]).subscribe(async ({ data: a, error: u, loading: d }) => {
1478
- const c = u ? "https://masters.com" : a?.url, f = n.get() || "", y = e.get() || "", m = r.get() || "", b = {
1499
+ const c = u ? "https://masters.com" : a?.url, f = n.get() || "", p = e.get() || "", m = r.get() || "", b = {
1479
1500
  [Tt]: f,
1480
- [fn]: y,
1501
+ [hn]: p,
1481
1502
  [pn]: m
1482
1503
  };
1483
1504
  if (!d && c) {
1484
1505
  i.setKey("loading", !0);
1485
- let T = window.location.search, I = window.location.hash;
1486
- T && I || I ? T = `?${Vr(T, b)}` : I = `#${Vr("", b)}`;
1487
- const F = window.location.origin + window.location.pathname + T + I, $ = await uo(t, { web: F, mobile: c });
1506
+ let T = window.location.search, E = window.location.hash;
1507
+ T && E || E ? T = `?${Vr(T, b)}` : E = `#${Vr("", b)}`;
1508
+ const F = window.location.origin + window.location.pathname + T + E, V = await uo(t, { web: F, mobile: c });
1488
1509
  i.set({
1489
- data: $.data?.link,
1510
+ data: V.data?.link,
1490
1511
  loading: !1
1491
1512
  });
1492
1513
  } else
1493
1514
  i.setKey("loading", !0);
1494
1515
  })), { $store: i, fetch };
1495
1516
  };
1496
- var M;
1517
+ var U;
1497
1518
  (function(t) {
1498
1519
  t.Unset = "unset", t.Required = "required", t.Optional = "optional", t.Completed = "completed", t.Disabled = "disabled", t.Unavailable = "unavailable";
1499
- })(M || (M = {}));
1520
+ })(U || (U = {}));
1500
1521
  const lo = (t, e, r, n) => {
1501
1522
  const { inplayGame: i } = t.featureSettings.get(), o = e.getCurrentSessionId({ prefix: "onboarding" });
1502
1523
  i && r.add({
1503
- type: me.ONBOARDING,
1524
+ type: be.ONBOARDING,
1504
1525
  id: o,
1505
1526
  action: t.openFeature,
1506
1527
  persistent: !0,
@@ -1527,32 +1548,32 @@ const lo = (t, e, r, n) => {
1527
1548
  userId: s,
1528
1549
  organizationId: e.organizationId.get() || "",
1529
1550
  eventId: e.slStreamId.get() || ""
1530
- }) === M.Completed) {
1531
- t.set(M.Completed);
1532
- for (const y of o)
1533
- y();
1551
+ }) === U.Completed) {
1552
+ t.set(U.Completed);
1553
+ for (const p of o)
1554
+ p();
1534
1555
  return;
1535
1556
  }
1536
1557
  const u = e.moderation.getStore().value?.data, d = r.featureSettings.get().inplayGame;
1537
1558
  if (u === void 0 || d === void 0)
1538
1559
  return;
1539
1560
  const c = u?.options?.onboardingEnabled, f = d?.titleCard?.optIn;
1540
- c ? f ? t.set(M.Required) : t.set(M.Optional) : (f ? t.set(M.Unavailable) : t.set(M.Disabled), n.close(e.getCurrentSessionId({ prefix: "onboarding" }), !1));
1561
+ c ? f ? t.set(U.Required) : t.set(U.Optional) : (f ? t.set(U.Unavailable) : t.set(U.Disabled), n.close(e.getCurrentSessionId({ prefix: "onboarding" }), !1));
1541
1562
  } catch (s) {
1542
1563
  console.error(s);
1543
1564
  }
1544
1565
  }, fo = (t, e, r, n) => {
1545
1566
  let i = !1;
1546
- const o = new dn(), s = B(M.Unset);
1567
+ const o = new fn(), s = B(U.Unset);
1547
1568
  s.subscribe((d) => {
1548
- d !== M.Unset && ((d === M.Optional || d === M.Required) && i === !1 && (lo(t, e, n, o), i = !0), d === M.Completed && e.activeQuestionId.invalidate(), o.setOnboardingInstantOpen({
1569
+ d !== U.Unset && ((d === U.Optional || d === U.Required) && i === !1 && (lo(t, e, n, o), i = !0), d === U.Completed && e.activeQuestionId.invalidate(), o.setOnboardingInstantOpen({
1549
1570
  userId: e.userId.get() || "",
1550
1571
  organizationId: e.organizationId.get() || "",
1551
1572
  eventId: e.slStreamId.get() || ""
1552
1573
  }));
1553
1574
  });
1554
1575
  const a = [];
1555
- return ct(s, e, t, n, o, a), s.get() !== M.Completed && (a.push(e.userId.listen((d) => {
1576
+ return ct(s, e, t, n, o, a), s.get() !== U.Completed && (a.push(e.userId.listen((d) => {
1556
1577
  d && ct(s, e, t, n, o, a);
1557
1578
  })), a.push(e.moderation.listen((d) => {
1558
1579
  d.data && ct(s, e, t, n, o, a);
@@ -1561,26 +1582,29 @@ const lo = (t, e, r, n) => {
1561
1582
  }))), { $store: s, submitInplay: async () => {
1562
1583
  const d = e.slStreamId.get();
1563
1584
  if (d) {
1564
- await Hi(r, d), s.set(M.Completed), o.saveOnboardingStatus({
1585
+ await Hi(r, d), s.set(U.Completed), o.saveOnboardingStatus({
1565
1586
  organizationId: e.organizationId.get() || "",
1566
1587
  userId: e.userId.get() || "",
1567
1588
  eventId: d
1568
- }, M.Completed), he.emit("poll", {
1589
+ }, U.Completed), pe.emit("poll", {
1569
1590
  action: "onboardingPassed",
1570
1591
  payload: {}
1571
- });
1592
+ }), t.openFeature();
1572
1593
  const c = e.getCurrentSessionId({ prefix: "onboarding" });
1573
1594
  n.close(c);
1574
1595
  }
1575
1596
  } };
1576
- }, po = (t, e, r, n) => {
1577
- const i = ie(void 0), o = Di(n), s = async () => {
1578
- const u = t.get(), d = e.get(), c = r.getStore().get().data?.map((m) => m.slId) || [], f = {
1597
+ }, ho = (t, e, r, n) => {
1598
+ const i = ie(void 0), o = dn(n), s = async () => {
1599
+ const u = t.get(), d = e.get(), c = r.getStore().get().data?.map((b) => b.slId);
1600
+ if (!c)
1601
+ return;
1602
+ const f = {
1579
1603
  eventId: u,
1580
1604
  userId: d,
1581
1605
  usersIds: [...c, d]
1582
- }, y = await o(f);
1583
- i.set(y.data?.attributes);
1606
+ }, p = await o(f), m = i.get()?.summary?.friendsRank;
1607
+ p.data?.attributes?.summary?.friendsRank && m !== void 0 && (p.data.attributes.summary.friendsRank = m), i.set(p.data?.attributes);
1584
1608
  }, a = () => {
1585
1609
  s();
1586
1610
  };
@@ -1590,8 +1614,15 @@ const lo = (t, e, r, n) => {
1590
1614
  u(), d(), c();
1591
1615
  };
1592
1616
  }), { $store: i, invalidate: a };
1593
- }, ho = /* @__PURE__ */ new Set([D.POLL, D.PREDICTION, D.TRIVIA]);
1594
- class yo extends ln {
1617
+ }, po = async (t, e, r, n, i) => {
1618
+ const o = dn(i), s = t.get(), a = e.get(), u = r.getStore().get().data?.map((p) => p.slId) || [], d = {
1619
+ eventId: s,
1620
+ userId: n,
1621
+ usersIds: [...u, a]
1622
+ };
1623
+ return (await o(d)).data?.attributes?.summary;
1624
+ }, yo = /* @__PURE__ */ new Set([D.POLL, D.PREDICTION, D.TRIVIA]);
1625
+ class go extends ln {
1595
1626
  /** user statistics (leaderboard panel) */
1596
1627
  userSummary;
1597
1628
  /** feed list (pick history) */
@@ -1623,77 +1654,87 @@ class yo extends ln {
1623
1654
  /** Browser cache */
1624
1655
  storage;
1625
1656
  submitAnswerTimeout;
1657
+ cancels = /* @__PURE__ */ new Set();
1626
1658
  constructor(e, r, n) {
1627
- super(e, r), this.background = new Bi(n), this.feedSubscription = this.background.feedSubscription, this.activeQuestionId = this.background.activeQuestionId, this.openedQuestionId = this.background.openedQuestionId, this.storage = new dn(), this.feedList = this.background.feedList, this.friends = new oe(Ri(this.background.userId, n.transport), "gamification:friends"), this.currentUserId = this.background.userId, this.openedUser = B(void 0), this.leaderboardId = new z(B(this.settings.getValue("pinnedLeaderboardId")), "pinnedLeaderboardId").getStore(), this.onboardingStatus = fo(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(N.GAMES), this.openedQuestion = this.background.openedQuestion, this.deepLink = co(this.transport, this.background.slStreamId, n.stores.providerStreamId.getStore(), this.background.userId), this.userSummary = po(this.background.slStreamId, this.background.userId, this.friends, this.transport), this.leaderboardList = Ji(this.transport, this.background.slStreamId, this.background.userId, this.friends), this.connect(), this.userSummary.$store.listen((i) => {
1628
- this.leaderboardList.$store.lc !== 0 && i?.summary && this.leaderboardList.invalidate();
1629
- }), this.background.activeQuestionId.listen(this.showInApp), this.onboardingStatus.$store.listen(this.checkInteractiveFlag), this.background.moderation.getStore().listen(this.checkInteractiveFlag), this.settings.subscribe(this.checkInteractiveFlag);
1659
+ super(e, r), this.background = new Bi(n), 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 ye(Ri(this.background.userId, n.transport), "gamification:friends"), this.currentUserId = this.background.userId, this.openedUser = B(void 0), this.leaderboardId = new W(B(this.settings.getValue("pinnedLeaderboardId")), "pinnedLeaderboardId").getStore(), this.onboardingStatus = fo(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(N.GAMES), this.openedQuestion = this.background.openedQuestion, this.deepLink = co(this.transport, this.background.slStreamId, n.stores.providerStreamId.getStore(), this.background.userId), this.userSummary = ho(this.background.slStreamId, this.background.userId, this.friends, this.transport), this.leaderboardList = Ji(this.transport, this.background.slStreamId, this.background.userId, this.friends), this.connect(), this.cancels.add(this.userSummary.$store.listen((i, o) => {
1660
+ o?.summary && i?.summary && !i.fromLeaderboard && this.leaderboardList.invalidate();
1661
+ })), this.cancels.add(this.leaderboardList.$store.subscribe((i) => {
1662
+ const o = { ...this.userSummary.$store.get() || {} }, s = o?.summary?.userId;
1663
+ if (i.data.length && s) {
1664
+ const a = i.data.find((u) => u.userId === s)?.rank;
1665
+ a !== void 0 && o?.summary && (o.fromLeaderboard = !0, o.summary.friendsRank = a, this.userSummary.$store.set(o));
1666
+ }
1667
+ })), this.cancels.add(this.background.activeQuestionId.listen(this.showInApp)), 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)), n.sdk.onMount(() => () => {
1668
+ for (const i of this.cancels)
1669
+ i(), this.cancels.delete(i);
1670
+ });
1630
1671
  }
1631
1672
  get isInteractiveAllowed() {
1632
1673
  return this.background.interactiveAllowed.get() === Oe.ALLOWED;
1633
1674
  }
1634
1675
  checkInteractiveFlag = () => {
1635
- const e = this.onboardingStatus.$store.get(), r = this.background.moderation.getStore().value?.data?.options?.onboardingEnabled, n = this.settings.getValues().inplayGame?.titleCard?.optIn, i = e === M.Completed, o = !r || i || n !== !0;
1676
+ 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;
1636
1677
  this.background.interactiveAllowed.set(o ? Oe.ALLOWED : Oe.DISALLOWED);
1637
1678
  };
1638
1679
  connect = () => {
1639
- this.background.feedSubscription.addListener("feed-subscription-prediction-close", async (e) => {
1680
+ this.cancels.add(this.background.feedSubscription.addListener("feed-subscription-prediction-close", async (e) => {
1640
1681
  if (!this.isInteractiveAllowed)
1641
1682
  return;
1642
1683
  const r = e.data?.attributes?.question, n = e.data?.attributes?.feedItem;
1643
1684
  if (!r || !n?.attributes)
1644
1685
  return;
1645
1686
  const { status: i, type: o, id: s, answers: a } = r;
1646
- if (i === Ee.RESOLVED && o === D.PREDICTION) {
1687
+ if (i === ce.RESOLVED && o === D.PREDICTION) {
1647
1688
  const u = this.background.getCurrentSessionId({
1648
1689
  prefix: `notification-id:${s}`
1649
1690
  }), d = [...this.feedList.getValues().data || []], c = d.findIndex((q) => q.id === s), f = d[c];
1650
- let y = f?.attributes?.attributes?.value?.answerId;
1691
+ let p = f?.attributes?.attributes?.value?.answerId;
1651
1692
  const m = Wt(s, this.transport), b = m.subscribe(() => {
1652
1693
  });
1653
1694
  await m.get().promise;
1654
1695
  const T = m.get().data;
1655
1696
  b(), window.requestAnimationFrame(() => {
1656
1697
  m.invalidate();
1657
- }), y || (y = T?.answers.find(({ youVoted: q }) => q)?.id);
1658
- const I = a.find(({ correct: q }) => q), F = y ? a.find(({ id: q }) => q === y) : void 0, $ = !!F?.correct;
1698
+ }), p || (p = T?.answers.find(({ youVoted: q }) => q)?.id);
1699
+ const E = a.find(({ correct: q }) => q), F = p ? a.find(({ id: q }) => q === p) : void 0, V = !!F?.correct;
1659
1700
  if (f && d[c]?.attributes?.attributes.case === "question") {
1660
1701
  try {
1661
- d[c].attributes.attributes.value.answerId = y, d[c].attributes.attributes.value.openForVoting = !1, y && (d[c].attributes.attributes.value.status = $ ? at.WON : at.LOST);
1702
+ d[c].attributes.attributes.value.answerId = p, d[c].attributes.attributes.value.openForVoting = !1, p && (d[c].attributes.attributes.value.status = V ? at.WON : at.LOST);
1662
1703
  } catch {
1663
1704
  }
1664
1705
  this.feedList.getStore().mutate(d);
1665
1706
  }
1666
- if (!F || !I)
1707
+ if (!F || !E)
1667
1708
  return;
1668
1709
  this.openedQuestionId.get()?.questionId !== r.id && this.notifications.add({
1669
- type: me.QUESTION_RESOLVED,
1710
+ type: be.QUESTION_RESOLVED,
1670
1711
  action: () => this.openQuestion(r.id, n),
1671
1712
  close: () => this.closeQuestion(s),
1672
- autoHideDuration: $ ? 15e3 : 12e3,
1713
+ autoHideDuration: V ? 15e3 : 12e3,
1673
1714
  id: u,
1674
1715
  emitEvent: !1,
1675
1716
  data: {
1676
1717
  questionId: s,
1677
1718
  questionType: D.PREDICTION,
1678
1719
  question: {
1679
- title: $ ? `Congratulations! You answered correctly! You won ${I.points} pts!` : `Better luck next time! Correct: ${I?.text}!`,
1720
+ title: V ? `Congratulations! You answered correctly! You won ${E.points} pts!` : `Better luck next time! Correct: ${E?.text}!`,
1680
1721
  votedAnswer: {
1681
1722
  title: F?.text,
1682
1723
  points: F?.points
1683
1724
  },
1684
- correctAnswerTitle: I?.text,
1685
- correct: !!$,
1686
- predictionResult: i === Ee.RESOLVED,
1725
+ correctAnswerTitle: E?.text,
1726
+ correct: !!V,
1727
+ predictionResult: i === ce.RESOLVED,
1687
1728
  questionTitle: r?.subject
1688
1729
  }
1689
1730
  }
1690
1731
  }), this.userSummary.invalidate();
1691
1732
  }
1692
- }), this.background.feedSubscription.addListener("feed-subscription-questions-list", (e) => {
1733
+ })), this.cancels.add(this.background.feedSubscription.addListener("feed-subscription-questions-list", (e) => {
1693
1734
  const r = [...this.feedList.getStore().value?.data || []], n = e.data?.attributes?.feedItem, i = r.findIndex((o) => o.id === n?.id);
1694
- if (n) {
1735
+ if (n?.attributes && !(n.attributes.status !== ce.ACTIVE && n.attributes.status !== ce.RESOLVED)) {
1695
1736
  if (i !== -1)
1696
- if (n.attributes?.attributes.case === "question" && r[i].attributes?.attributes.case === "question") {
1737
+ if (n.attributes.attributes.case === "question" && r[i].attributes?.attributes.case === "question") {
1697
1738
  const o = r[i];
1698
1739
  o.attributes && (r[i] = {
1699
1740
  ...r[i],
@@ -1737,7 +1778,7 @@ class yo extends ln {
1737
1778
  }
1738
1779
  });
1739
1780
  }
1740
- i === -1 && (r.unshift(n), he.emit("poll", {
1781
+ i === -1 && (r.unshift(n), pe.emit("poll", {
1741
1782
  action: "received",
1742
1783
  payload: {
1743
1784
  questionId: n.id,
@@ -1745,7 +1786,7 @@ class yo extends ln {
1745
1786
  }
1746
1787
  })), this.feedList.getStore().mutate(r);
1747
1788
  }
1748
- });
1789
+ }));
1749
1790
  };
1750
1791
  // not used
1751
1792
  disconnect = () => {
@@ -1758,7 +1799,7 @@ class yo extends ln {
1758
1799
  return;
1759
1800
  const s = o.findIndex((d) => d.id === e), a = o[s], u = a?.attributes?.attributes.case === "question" && a.attributes.attributes.value;
1760
1801
  if (u) {
1761
- he.emit("poll", {
1802
+ pe.emit("poll", {
1762
1803
  action: "voted",
1763
1804
  payload: {
1764
1805
  questionId: e,
@@ -1768,10 +1809,10 @@ class yo extends ln {
1768
1809
  const d = n.subscribe(() => {
1769
1810
  }), c = n.get().data;
1770
1811
  if (d(), c) {
1771
- const f = c.answers.find((b) => b.correct === !0), y = c.answers.findIndex((b) => b.id === r), m = c.answers[y];
1772
- o[s].attributes.attributes.value.answerId = r, o[s].attributes.attributes.value.openForVoting = !1, o[s].attributes.attributes.value.text = m?.text || "", f && (o[s].attributes.attributes.value.status = f.id === r ? at.WON : at.LOST), this.feedList.getStore().mutate([...o]), c.answers[y].correct = f?.id === r, c.answers[y].youVoted = !0, c.answers.forEach((b) => {
1812
+ const f = c.answers.find((b) => b.correct === !0), p = c.answers.findIndex((b) => b.id === r), m = c.answers[p];
1813
+ o[s].attributes.attributes.value.answerId = r, o[s].attributes.attributes.value.openForVoting = !1, o[s].attributes.attributes.value.text = m?.text || "", f && (o[s].attributes.attributes.value.status = f.id === r ? at.WON : at.LOST), this.feedList.getStore().mutate([...o]), c.answers[p].correct = f?.id === r, c.answers[p].youVoted = !0, c.answers.forEach((b) => {
1773
1814
  b.percentageDecimal = 0;
1774
- }), f?.id === r && (c.answers[y].pointsEarned = c.status === Ee.RESOLVED ? 0 : f.points), n.mutate({ ...c });
1815
+ }), f?.id === r && (c.answers[p].pointsEarned = c.status === ce.RESOLVED ? 0 : f.points), n.mutate({ ...c });
1775
1816
  }
1776
1817
  this.submitAnswerTimeout && clearTimeout(this.submitAnswerTimeout), this.submitAnswerTimeout = setTimeout(() => {
1777
1818
  this.userSummary.invalidate();
@@ -1779,7 +1820,7 @@ class yo extends ln {
1779
1820
  }
1780
1821
  };
1781
1822
  try {
1782
- await Ki(this.transport, { questionId: e, answerId: r }), i();
1823
+ await zi(this.transport, { questionId: e, answerId: r }), i();
1783
1824
  } catch (o) {
1784
1825
  if (o.message === tt.ALREADY_VOTED) {
1785
1826
  this.userSummary.invalidate();
@@ -1791,12 +1832,15 @@ class yo extends ln {
1791
1832
  }
1792
1833
  };
1793
1834
  openQuestion = (e, r) => {
1835
+ if (!e)
1836
+ return () => {
1837
+ };
1794
1838
  this.notifications.close(this.background.getCurrentSessionId({
1795
1839
  prefix: "notification",
1796
1840
  entity: e
1797
1841
  }));
1798
1842
  let n = r?.attributes?.type;
1799
- return n || (n = (this.feedList.getStore().value?.data || []).find((o) => o.id === e)?.attributes?.type), he.emit("poll", {
1843
+ return n || (n = (this.feedList.getStore().value?.data || []).find((o) => o.id === e)?.attributes?.type), pe.emit("poll", {
1800
1844
  action: "opened",
1801
1845
  payload: {
1802
1846
  questionId: e,
@@ -1806,9 +1850,24 @@ class yo extends ln {
1806
1850
  }), this.background.openQuestion(e, r);
1807
1851
  };
1808
1852
  closeQuestion = (e) => this.background.closeQuestion(e);
1809
- openUser = (e) => {
1810
- const r = this.leaderboardList.$store.get().data?.find((n) => n.userId === e);
1811
- this.openedUser.set(r);
1853
+ openUser = async (e) => {
1854
+ const r = this.leaderboardList.$store.get().data?.find((i) => i.userId === e);
1855
+ if (!r) {
1856
+ this.openedUser.set(r);
1857
+ return;
1858
+ }
1859
+ if (r.summaryLoaded) {
1860
+ this.openedUser.set(r);
1861
+ return;
1862
+ }
1863
+ const n = { ...r };
1864
+ try {
1865
+ const i = await po(this.background.slStreamId, this.background.userId, this.friends, e, this.transport);
1866
+ 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);
1867
+ } catch (i) {
1868
+ console.error(i);
1869
+ }
1870
+ this.openedUser.set(n);
1812
1871
  };
1813
1872
  closeUser = () => {
1814
1873
  this.openedUser.set(void 0);
@@ -1821,12 +1880,12 @@ class yo extends ln {
1821
1880
  */
1822
1881
  showInApp = (e) => {
1823
1882
  const r = this.onboardingStatus.$store.get();
1824
- if (e && e.data && r && r !== M.Unset && e.data.question?.id !== void 0 && e.data.question.notification !== void 0 && e.data.question?.bypassNotifications?.inAppSilence !== Jn.ON && e.data.question.status === Ee.ACTIVE && !e.data.question.marketClosed) {
1825
- if (ho.has(e.data.question.type))
1883
+ 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 !== Yn.ON && e.data.question.status === ce.ACTIVE && !e.data.question.marketClosed) {
1884
+ if (yo.has(e.data.question.type))
1826
1885
  this.isInteractiveAllowed && this.notifications.add({
1827
- type: me.QUESTION,
1828
- action: () => e.data?.question && this.openQuestion(e.data.question.id, e.data.feedItem),
1829
- close: () => e.data?.question && this.closeQuestion(e.data.question.id),
1886
+ type: be.QUESTION,
1887
+ action: () => this.openQuestion(e.data?.question?.id, e.data?.feedItem),
1888
+ close: () => this.closeQuestion(e.data?.question?.id),
1830
1889
  autoHideDuration: 1e3 * 60,
1831
1890
  id: this.background.getCurrentSessionId({
1832
1891
  prefix: "notification",
@@ -1858,9 +1917,9 @@ class yo extends ln {
1858
1917
  }
1859
1918
  };
1860
1919
  this.notifications.add({
1861
- type: me.QUESTION,
1862
- action: () => e.data?.question && this.openQuestion(e.data.question.id, e.data.feedItem),
1863
- close: () => e.data?.question && this.closeQuestion(e.data.question.id),
1920
+ type: be.QUESTION,
1921
+ action: () => this.openQuestion(e?.data?.question?.id, e?.data?.feedItem),
1922
+ close: () => this.closeQuestion(e?.data?.question?.id),
1864
1923
  autoHideDuration: 1e3 * 120,
1865
1924
  emitEvent: !0,
1866
1925
  id: this.background.getCurrentSessionId({ prefix: "notification", entity: e.data.question.id }),
@@ -1881,9 +1940,9 @@ class yo extends ln {
1881
1940
  tweetId: e.data.question.id
1882
1941
  };
1883
1942
  this.notifications.add({
1884
- type: me.QUESTION,
1885
- action: () => e.data?.question && this.openQuestion(e.data.question.id, e.data.feedItem),
1886
- close: () => e.data?.question && this.closeQuestion(e.data.question.id),
1943
+ type: be.QUESTION,
1944
+ action: () => this.openQuestion(e.data?.question?.id, e.data?.feedItem),
1945
+ close: () => this.closeQuestion(e.data?.question?.id),
1887
1946
  autoHideDuration: 1e3 * 120,
1888
1947
  emitEvent: !0,
1889
1948
  id: this.background.getCurrentSessionId({ prefix: "notification", entity: e.data.question.id }),
@@ -1897,16 +1956,16 @@ class yo extends ln {
1897
1956
  }
1898
1957
  };
1899
1958
  }
1900
- const go = {
1959
+ const mo = {
1901
1960
  [N.GAMES]: !0
1902
1961
  };
1903
- class mo extends ln {
1962
+ class bo extends ln {
1904
1963
  constructor(e, r) {
1905
1964
  super(e, r);
1906
1965
  }
1907
1966
  }
1908
- const bo = (t, e, r) => t.type === N.GAMES ? new yo(t, e, r) : new mo(t, e), vo = (t, e, r) => {
1909
- t.features = /* @__PURE__ */ new Map(), t.sdk.featuresList = new z(B(/* @__PURE__ */ new Set()), "features-list"), t.activeFeature = new z(B(N.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) => {
1967
+ const vo = (t, e, r) => t.type === N.GAMES ? new go(t, e, r) : new bo(t, e), So = (t, e, r) => {
1968
+ t.features = /* @__PURE__ */ new Map(), t.sdk.featuresList = new W(B(/* @__PURE__ */ new Set()), "features-list"), t.activeFeature = new W(B(N.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) => {
1910
1969
  t.activeFeature.setValue(n);
1911
1970
  }, t.sdk.closeFeature = (n = !1) => {
1912
1971
  const i = t.activeFeature.getValue();
@@ -1916,8 +1975,8 @@ const bo = (t, e, r) => t.type === N.GAMES ? new yo(t, e, r) : new mo(t, e), vo
1916
1975
  o && o.delete(i), t.sdk.featuresList.setValue(o);
1917
1976
  }
1918
1977
  }, t.initFeature = (n, i = le.ORGANIZATION) => {
1919
- if (n.type in go && !t.features.has(n.type)) {
1920
- const o = bo(n, i, t);
1978
+ if (n.type in mo && !t.features.has(n.type)) {
1979
+ const o = vo(n, i, t);
1921
1980
  t.features.set(n.type, o);
1922
1981
  let s = t.sdk.featuresList.getValue();
1923
1982
  s ? s.add(n.type) : s = /* @__PURE__ */ new Set([n.type]), t.sdk.featuresList.setValue(new Set(s));
@@ -1970,7 +2029,7 @@ const bo = (t, e, r) => t.type === N.GAMES ? new yo(t, e, r) : new mo(t, e), vo
1970
2029
  t.store.subscribe(i);
1971
2030
  }, r();
1972
2031
  };
1973
- class So {
2032
+ class wo {
1974
2033
  analytics;
1975
2034
  constructor(e) {
1976
2035
  this.analytics = e, this.analytics.onConnect(() => {
@@ -1982,14 +2041,14 @@ class So {
1982
2041
  break;
1983
2042
  }
1984
2043
  };
1985
- return he.listen(r);
2044
+ return pe.listen(r);
1986
2045
  });
1987
2046
  }
1988
2047
  accepted = () => {
1989
2048
  this.analytics.write("invitation", {
1990
2049
  common: {
1991
2050
  ...this.analytics.commonStore.getValues(),
1992
- kind: W.INVITATION_ACCEPTED
2051
+ kind: H.INVITATION_ACCEPTED
1993
2052
  },
1994
2053
  category: Sr.GAMES,
1995
2054
  from: wr.UNSET
@@ -1999,14 +2058,14 @@ class So {
1999
2058
  this.analytics.write("invitation", {
2000
2059
  common: {
2001
2060
  ...this.analytics.commonStore.getValues(),
2002
- kind: W.INVITATION_SENT
2061
+ kind: H.INVITATION_SENT
2003
2062
  },
2004
2063
  category: Sr.GAMES,
2005
2064
  from: e || wr.UNSET
2006
2065
  });
2007
2066
  };
2008
2067
  }
2009
- class wo {
2068
+ class Ao {
2010
2069
  analytics;
2011
2070
  constructor(e) {
2012
2071
  this.analytics = e, this.analytics.onConnect(() => {
@@ -2021,14 +2080,14 @@ class wo {
2021
2080
  break;
2022
2081
  }
2023
2082
  };
2024
- return he.listen(r);
2083
+ return pe.listen(r);
2025
2084
  });
2026
2085
  }
2027
2086
  tap = () => {
2028
2087
  this.analytics.write("interactions", {
2029
2088
  common: {
2030
2089
  ...this.analytics.commonStore.getValues(),
2031
- kind: W.INTERACTIONS
2090
+ kind: H.INTERACTIONS
2032
2091
  },
2033
2092
  actionType: Lr.TAP
2034
2093
  });
@@ -2037,7 +2096,7 @@ class wo {
2037
2096
  this.analytics.write("interactions", {
2038
2097
  common: {
2039
2098
  ...this.analytics.commonStore.getValues(),
2040
- kind: W.INTERACTIONS
2099
+ kind: H.INTERACTIONS
2041
2100
  },
2042
2101
  actionType: Lr.SCROLL
2043
2102
  });
@@ -2052,8 +2111,8 @@ const Ye = {
2052
2111
  [D.TRIVIA]: K.POLLS_TRIVIA,
2053
2112
  [D.TWEET]: K.POLLS_TWITTER
2054
2113
  };
2055
- D.UNSET + "", ue.UNSET, D.FACTOID + "", ue.POLLS, D.POLL + "", ue.POLLS, D.PREDICTION + "", ue.POLLS, D.PROMOTION + "", ue.POLLS, D.TRIVIA + "", ue.POLLS, D.TWEET + "", ue.POLLS;
2056
- const Ao = {
2114
+ D.UNSET + "", ae.UNSET, D.FACTOID + "", ae.POLLS, D.POLL + "", ae.POLLS, D.PREDICTION + "", ae.POLLS, D.PROMOTION + "", ae.POLLS, D.TRIVIA + "", ae.POLLS, D.TWEET + "", ae.POLLS;
2115
+ const Io = {
2057
2116
  [N.UNSET]: Q.UNSET,
2058
2117
  [N.INPLAY]: Q.INPLAY,
2059
2118
  [N.MESSAGING]: Q.MESSAGING,
@@ -2088,18 +2147,18 @@ class Eo {
2088
2147
  break;
2089
2148
  }
2090
2149
  };
2091
- return he.listen(r);
2150
+ return pe.listen(r);
2092
2151
  });
2093
2152
  }
2094
2153
  received = ({ questionId: e, questionType: r }) => {
2095
2154
  this.analytics.write("notification", {
2096
2155
  common: {
2097
2156
  ...this.analytics.commonStore.getValues(),
2098
- kind: W.NOTIFICATION_RECEIVED,
2157
+ kind: H.NOTIFICATION_RECEIVED,
2099
2158
  topicId: e,
2100
2159
  topicType: r ? Ye[r] : K.UNSET
2101
2160
  },
2102
- notificationKind: ue.POLLS,
2161
+ notificationKind: ae.POLLS,
2103
2162
  notificationType: _r.IN_APP
2104
2163
  });
2105
2164
  };
@@ -2107,16 +2166,16 @@ class Eo {
2107
2166
  this.analytics.write("notification", {
2108
2167
  common: {
2109
2168
  ...this.analytics.commonStore.getValues(),
2110
- kind: W.NOTIFICATION_OPENED,
2169
+ kind: H.NOTIFICATION_OPENED,
2111
2170
  topicId: e,
2112
2171
  topicType: r ? Ye[r] : K.UNSET
2113
2172
  },
2114
- notificationKind: ue.POLLS,
2173
+ notificationKind: ae.POLLS,
2115
2174
  notificationType: _r.IN_APP
2116
2175
  });
2117
2176
  };
2118
2177
  }
2119
- class Io {
2178
+ class To {
2120
2179
  analytics;
2121
2180
  constructor(e) {
2122
2181
  this.analytics = e, this.analytics.onConnect(() => {
@@ -2140,7 +2199,7 @@ class Io {
2140
2199
  break;
2141
2200
  }
2142
2201
  };
2143
- return he.listen(r);
2202
+ return pe.listen(r);
2144
2203
  });
2145
2204
  }
2146
2205
  // event when a poll is received from subscription or active question request
@@ -2148,7 +2207,7 @@ class Io {
2148
2207
  this.analytics.write("games", {
2149
2208
  common: {
2150
2209
  ...this.analytics.commonStore.getValues(),
2151
- kind: W.POLLS_RECEIVED,
2210
+ kind: H.POLLS_RECEIVED,
2152
2211
  topicId: e,
2153
2212
  topicType: r ? Ye[r] : K.UNSET
2154
2213
  },
@@ -2160,7 +2219,7 @@ class Io {
2160
2219
  this.analytics.write("games", {
2161
2220
  common: {
2162
2221
  ...this.analytics.commonStore.getValues(),
2163
- kind: W.POLLS_OPENED,
2222
+ kind: H.POLLS_OPENED,
2164
2223
  topicId: e,
2165
2224
  topicType: r ? Ye[r] : K.UNSET
2166
2225
  },
@@ -2172,7 +2231,7 @@ class Io {
2172
2231
  this.analytics.write("games", {
2173
2232
  common: {
2174
2233
  ...this.analytics.commonStore.getValues(),
2175
- kind: W.POLLS_VOTE,
2234
+ kind: H.POLLS_VOTE,
2176
2235
  topicId: e,
2177
2236
  topicType: r ? Ye[r] : K.UNSET
2178
2237
  },
@@ -2184,7 +2243,7 @@ class Io {
2184
2243
  this.analytics.write("games", {
2185
2244
  common: {
2186
2245
  ...this.analytics.commonStore.getValues(),
2187
- kind: W.GAMES_JOINED
2246
+ kind: H.GAMES_JOINED
2188
2247
  },
2189
2248
  pollOpenedFrom: De.UNSET
2190
2249
  });
@@ -2194,28 +2253,28 @@ class Io {
2194
2253
  this.analytics.write("games", {
2195
2254
  common: {
2196
2255
  ...this.analytics.commonStore.getValues(),
2197
- kind: W.POLLS_NAVIGATED
2256
+ kind: H.POLLS_NAVIGATED
2198
2257
  },
2199
2258
  pollOpenedFrom: De.UNSET
2200
2259
  });
2201
2260
  };
2202
2261
  }
2203
- const To = ({ transport: t, $commonStore: e }) => {
2262
+ const Oo = ({ transport: t, $commonStore: e }) => {
2204
2263
  let r;
2205
2264
  const n = B(!1), i = 5e3, { client: o, queryKey: s } = t.createPromiseClient(on, {
2206
2265
  method: "send",
2207
2266
  params: [n]
2208
2267
  }), a = t.nanoquery.createFetcherStore(s, {
2209
2268
  fetcher: async () => {
2210
- const y = e.getStore().get();
2269
+ const p = e.getStore().get();
2211
2270
  try {
2212
2271
  await o.unary({
2213
2272
  message: {
2214
2273
  case: "heartbeat",
2215
2274
  value: {
2216
2275
  common: {
2217
- ...y,
2218
- kind: W.SESSION_HEARTBEAT
2276
+ ...p,
2277
+ kind: H.SESSION_HEARTBEAT
2219
2278
  }
2220
2279
  }
2221
2280
  }
@@ -2237,8 +2296,8 @@ const To = ({ transport: t, $commonStore: e }) => {
2237
2296
  return { enable: d, disable: c, mount: u, unmount: () => {
2238
2297
  fe.debug("unmounted heartbeat"), a.off(), r?.(), r = void 0, c();
2239
2298
  } };
2240
- }, fe = ve("analytics");
2241
- class Oo {
2299
+ }, fe = Se("analytics");
2300
+ class Co {
2242
2301
  commonStore;
2243
2302
  notifications;
2244
2303
  polls;
@@ -2250,7 +2309,7 @@ class Oo {
2250
2309
  listenersCancels;
2251
2310
  connected = !1;
2252
2311
  constructor(e) {
2253
- this.listeners = /* @__PURE__ */ new Set(), this.listenersCancels = /* @__PURE__ */ new Set(), this.commonStore = new Te(ie({}), "common-analytics"), this.connectToSDK(e), this.heartbeat = To({ transport: e.analyticsTransport, $commonStore: this.commonStore }), this.notifications = new Eo(this), this.polls = new Io(this), this.invitation = new So(this), this.interactions = new wo(this);
2312
+ this.listeners = /* @__PURE__ */ new Set(), this.listenersCancels = /* @__PURE__ */ new Set(), this.commonStore = new Te(ie({}), "common-analytics"), this.connectToSDK(e), this.heartbeat = Oo({ transport: e.analyticsTransport, $commonStore: this.commonStore }), this.notifications = new Eo(this), this.polls = new To(this), this.invitation = new wo(this), this.interactions = new Ao(this);
2254
2313
  const { client: r } = e.analyticsTransport.createPromiseClient(on, {
2255
2314
  method: "send"
2256
2315
  });
@@ -2280,7 +2339,7 @@ class Oo {
2280
2339
  this.onConnect(() => e.stores.slStreamId.getAtomStore().subscribe((r) => {
2281
2340
  this.writeCommon("eventId", r);
2282
2341
  })), this.onConnect(() => e.sdk.getActiveFeature().subscribe((r) => {
2283
- r && this.writeCommon("category", Ao[r]), r !== N.UNSET ? this.writeCommon("overlaySessionId", Gt()) : this.writeCommon("overlaySessionId", "");
2342
+ r && this.writeCommon("category", Io[r]), r !== N.UNSET ? this.writeCommon("overlaySessionId", Gt()) : this.writeCommon("overlaySessionId", "");
2284
2343
  })), this.onConnect(() => {
2285
2344
  const r = window.matchMedia("(orientation: portrait)"), n = (i) => {
2286
2345
  this.writeCommon("screenOrientation", i.matches ? Cr.PORTRAIT : Cr.LANDSCAPE);
@@ -2293,17 +2352,17 @@ class Oo {
2293
2352
  }));
2294
2353
  };
2295
2354
  }
2296
- const Co = (t, e, r) => {
2297
- t.analytics = new Oo(t), t.sdk.onMount(() => (t.analytics.connect(), () => {
2355
+ const Lo = (t, e, r) => {
2356
+ t.analytics = new Co(t), t.sdk.onMount(() => (t.analytics.connect(), () => {
2298
2357
  t.analytics.disconnect();
2299
2358
  })), r();
2300
2359
  };
2301
- var hn = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
2302
- function Lo(t) {
2360
+ var yn = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
2361
+ function _o(t) {
2303
2362
  return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
2304
2363
  }
2305
2364
  var ur = { exports: {} }, cr = { exports: {} };
2306
- function _o(t) {
2365
+ function ko(t) {
2307
2366
  var e = new t(), r = e;
2308
2367
  function n() {
2309
2368
  var o = e;
@@ -2317,14 +2376,14 @@ function _o(t) {
2317
2376
  release: i
2318
2377
  };
2319
2378
  }
2320
- var ko = _o, Po = ko;
2321
- function yn(t, e, r) {
2379
+ var Po = ko, Fo = Po;
2380
+ function gn(t, e, r) {
2322
2381
  if (typeof t == "function" && (r = e, e = t, t = null), r < 1)
2323
2382
  throw new Error("fastqueue concurrency must be greater than 1");
2324
- var n = Po(Fo), i = null, o = null, s = 0, a = null, u = {
2383
+ var n = Fo(No), i = null, o = null, s = 0, a = null, u = {
2325
2384
  push: T,
2326
- drain: H,
2327
- saturated: H,
2385
+ drain: z,
2386
+ saturated: z,
2328
2387
  pause: c,
2329
2388
  paused: !1,
2330
2389
  concurrency: r,
@@ -2332,10 +2391,10 @@ function yn(t, e, r) {
2332
2391
  resume: m,
2333
2392
  idle: b,
2334
2393
  length: f,
2335
- getQueue: y,
2336
- unshift: I,
2337
- empty: H,
2338
- kill: $,
2394
+ getQueue: p,
2395
+ unshift: E,
2396
+ empty: z,
2397
+ kill: V,
2339
2398
  killAndDrain: q,
2340
2399
  error: J
2341
2400
  };
@@ -2351,7 +2410,7 @@ function yn(t, e, r) {
2351
2410
  _ = _.next, R++;
2352
2411
  return R;
2353
2412
  }
2354
- function y() {
2413
+ function p() {
2355
2414
  for (var _ = i, R = []; _; )
2356
2415
  R.push(_.value), _ = _.next;
2357
2416
  return R;
@@ -2367,87 +2426,87 @@ function yn(t, e, r) {
2367
2426
  return s === 0 && u.length() === 0;
2368
2427
  }
2369
2428
  function T(_, R) {
2370
- var E = n.get();
2371
- E.context = t, E.release = F, E.value = _, E.callback = R || H, E.errorHandler = a, s === u.concurrency || u.paused ? o ? (o.next = E, o = E) : (i = E, o = E, u.saturated()) : (s++, e.call(t, E.value, E.worked));
2429
+ var I = n.get();
2430
+ I.context = t, I.release = F, I.value = _, I.callback = R || z, I.errorHandler = a, s === u.concurrency || u.paused ? o ? (o.next = I, o = I) : (i = I, o = I, u.saturated()) : (s++, e.call(t, I.value, I.worked));
2372
2431
  }
2373
- function I(_, R) {
2374
- var E = n.get();
2375
- E.context = t, E.release = F, E.value = _, E.callback = R || H, E.errorHandler = a, s === u.concurrency || u.paused ? i ? (E.next = i, i = E) : (i = E, o = E, u.saturated()) : (s++, e.call(t, E.value, E.worked));
2432
+ function E(_, R) {
2433
+ var I = n.get();
2434
+ I.context = t, I.release = F, I.value = _, I.callback = R || z, I.errorHandler = a, s === u.concurrency || u.paused ? i ? (I.next = i, i = I) : (i = I, o = I, u.saturated()) : (s++, e.call(t, I.value, I.worked));
2376
2435
  }
2377
2436
  function F(_) {
2378
2437
  _ && n.release(_);
2379
2438
  var R = i;
2380
2439
  R ? u.paused ? s-- : (o === i && (o = null), i = R.next, R.next = null, e.call(t, R.value, R.worked), o === null && u.empty()) : --s === 0 && u.drain();
2381
2440
  }
2382
- function $() {
2383
- i = null, o = null, u.drain = H;
2441
+ function V() {
2442
+ i = null, o = null, u.drain = z;
2384
2443
  }
2385
2444
  function q() {
2386
- i = null, o = null, u.drain(), u.drain = H;
2445
+ i = null, o = null, u.drain(), u.drain = z;
2387
2446
  }
2388
2447
  function J(_) {
2389
2448
  a = _;
2390
2449
  }
2391
2450
  }
2392
- function H() {
2451
+ function z() {
2393
2452
  }
2394
- function Fo() {
2395
- this.value = null, this.callback = H, this.next = null, this.release = H, this.context = null, this.errorHandler = null;
2453
+ function No() {
2454
+ this.value = null, this.callback = z, this.next = null, this.release = z, this.context = null, this.errorHandler = null;
2396
2455
  var t = this;
2397
2456
  this.worked = function(r, n) {
2398
2457
  var i = t.callback, o = t.errorHandler, s = t.value;
2399
- t.value = null, t.callback = H, t.errorHandler && o(r, s), i.call(t.context, r, n), t.release(t);
2458
+ t.value = null, t.callback = z, t.errorHandler && o(r, s), i.call(t.context, r, n), t.release(t);
2400
2459
  };
2401
2460
  }
2402
- function No(t, e, r) {
2461
+ function Do(t, e, r) {
2403
2462
  typeof t == "function" && (r = e, e = t, t = null);
2404
2463
  function n(c, f) {
2405
- e.call(this, c).then(function(y) {
2406
- f(null, y);
2464
+ e.call(this, c).then(function(p) {
2465
+ f(null, p);
2407
2466
  }, f);
2408
2467
  }
2409
- var i = yn(t, n, r), o = i.push, s = i.unshift;
2468
+ var i = gn(t, n, r), o = i.push, s = i.unshift;
2410
2469
  return i.push = a, i.unshift = u, i.drained = d, i;
2411
2470
  function a(c) {
2412
- var f = new Promise(function(y, m) {
2471
+ var f = new Promise(function(p, m) {
2413
2472
  o(c, function(b, T) {
2414
2473
  if (b) {
2415
2474
  m(b);
2416
2475
  return;
2417
2476
  }
2418
- y(T);
2477
+ p(T);
2419
2478
  });
2420
2479
  });
2421
- return f.catch(H), f;
2480
+ return f.catch(z), f;
2422
2481
  }
2423
2482
  function u(c) {
2424
- var f = new Promise(function(y, m) {
2483
+ var f = new Promise(function(p, m) {
2425
2484
  s(c, function(b, T) {
2426
2485
  if (b) {
2427
2486
  m(b);
2428
2487
  return;
2429
2488
  }
2430
- y(T);
2489
+ p(T);
2431
2490
  });
2432
2491
  });
2433
- return f.catch(H), f;
2492
+ return f.catch(z), f;
2434
2493
  }
2435
2494
  function d() {
2436
2495
  if (i.idle())
2437
- return new Promise(function(y) {
2438
- y();
2496
+ return new Promise(function(p) {
2497
+ p();
2439
2498
  });
2440
- var c = i.drain, f = new Promise(function(y) {
2499
+ var c = i.drain, f = new Promise(function(p) {
2441
2500
  i.drain = function() {
2442
- c(), y();
2501
+ c(), p();
2443
2502
  };
2444
2503
  });
2445
2504
  return f;
2446
2505
  }
2447
2506
  }
2448
- cr.exports = yn;
2449
- cr.exports.promise = No;
2450
- var gn = cr.exports, lr = { exports: {} }, Be = typeof Reflect == "object" ? Reflect : null, $r = Be && typeof Be.apply == "function" ? Be.apply : function(e, r, n) {
2507
+ cr.exports = gn;
2508
+ cr.exports.promise = Do;
2509
+ var mn = cr.exports, lr = { exports: {} }, Be = typeof Reflect == "object" ? Reflect : null, $r = Be && typeof Be.apply == "function" ? Be.apply : function(e, r, n) {
2451
2510
  return Function.prototype.apply.call(e, r, n);
2452
2511
  }, dt;
2453
2512
  Be && typeof Be.ownKeys == "function" ? dt = Be.ownKeys : Object.getOwnPropertySymbols ? dt = function(e) {
@@ -2455,17 +2514,17 @@ Be && typeof Be.ownKeys == "function" ? dt = Be.ownKeys : Object.getOwnPropertyS
2455
2514
  } : dt = function(e) {
2456
2515
  return Object.getOwnPropertyNames(e);
2457
2516
  };
2458
- function Do(t) {
2517
+ function Ro(t) {
2459
2518
  console && console.warn && console.warn(t);
2460
2519
  }
2461
- var mn = Number.isNaN || function(e) {
2520
+ var bn = Number.isNaN || function(e) {
2462
2521
  return e !== e;
2463
2522
  };
2464
2523
  function k() {
2465
2524
  k.init.call(this);
2466
2525
  }
2467
2526
  lr.exports = k;
2468
- lr.exports.once = jo;
2527
+ lr.exports.once = Mo;
2469
2528
  k.EventEmitter = k;
2470
2529
  k.prototype._events = void 0;
2471
2530
  k.prototype._eventsCount = 0;
@@ -2481,7 +2540,7 @@ Object.defineProperty(k, "defaultMaxListeners", {
2481
2540
  return jr;
2482
2541
  },
2483
2542
  set: function(t) {
2484
- if (typeof t != "number" || t < 0 || mn(t))
2543
+ if (typeof t != "number" || t < 0 || bn(t))
2485
2544
  throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + t + ".");
2486
2545
  jr = t;
2487
2546
  }
@@ -2490,15 +2549,15 @@ k.init = function() {
2490
2549
  (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;
2491
2550
  };
2492
2551
  k.prototype.setMaxListeners = function(e) {
2493
- if (typeof e != "number" || e < 0 || mn(e))
2552
+ if (typeof e != "number" || e < 0 || bn(e))
2494
2553
  throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + e + ".");
2495
2554
  return this._maxListeners = e, this;
2496
2555
  };
2497
- function bn(t) {
2556
+ function vn(t) {
2498
2557
  return t._maxListeners === void 0 ? k.defaultMaxListeners : t._maxListeners;
2499
2558
  }
2500
2559
  k.prototype.getMaxListeners = function() {
2501
- return bn(this);
2560
+ return vn(this);
2502
2561
  };
2503
2562
  k.prototype.emit = function(e) {
2504
2563
  for (var r = [], n = 1; n < arguments.length; n++)
@@ -2525,7 +2584,7 @@ k.prototype.emit = function(e) {
2525
2584
  $r(c[n], this, r);
2526
2585
  return !0;
2527
2586
  };
2528
- function vn(t, e, r, n) {
2587
+ function Sn(t, e, r, n) {
2529
2588
  var i, o, s;
2530
2589
  if (Ot(r), o = t._events, o === void 0 ? (o = t._events = /* @__PURE__ */ Object.create(null), t._eventsCount = 0) : (o.newListener !== void 0 && (t.emit(
2531
2590
  "newListener",
@@ -2533,33 +2592,33 @@ function vn(t, e, r, n) {
2533
2592
  r.listener ? r.listener : r
2534
2593
  ), o = t._events), s = o[e]), s === void 0)
2535
2594
  s = o[e] = r, ++t._eventsCount;
2536
- else if (typeof s == "function" ? s = o[e] = n ? [r, s] : [s, r] : n ? s.unshift(r) : s.push(r), i = bn(t), i > 0 && s.length > i && !s.warned) {
2595
+ else if (typeof s == "function" ? s = o[e] = n ? [r, s] : [s, r] : n ? s.unshift(r) : s.push(r), i = vn(t), i > 0 && s.length > i && !s.warned) {
2537
2596
  s.warned = !0;
2538
2597
  var a = new Error("Possible EventEmitter memory leak detected. " + s.length + " " + String(e) + " listeners added. Use emitter.setMaxListeners() to increase limit");
2539
- a.name = "MaxListenersExceededWarning", a.emitter = t, a.type = e, a.count = s.length, Do(a);
2598
+ a.name = "MaxListenersExceededWarning", a.emitter = t, a.type = e, a.count = s.length, Ro(a);
2540
2599
  }
2541
2600
  return t;
2542
2601
  }
2543
2602
  k.prototype.addListener = function(e, r) {
2544
- return vn(this, e, r, !1);
2603
+ return Sn(this, e, r, !1);
2545
2604
  };
2546
2605
  k.prototype.on = k.prototype.addListener;
2547
2606
  k.prototype.prependListener = function(e, r) {
2548
- return vn(this, e, r, !0);
2607
+ return Sn(this, e, r, !0);
2549
2608
  };
2550
- function Ro() {
2609
+ function Vo() {
2551
2610
  if (!this.fired)
2552
2611
  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);
2553
2612
  }
2554
- function Sn(t, e, r) {
2555
- var n = { fired: !1, wrapFn: void 0, target: t, type: e, listener: r }, i = Ro.bind(n);
2613
+ function wn(t, e, r) {
2614
+ var n = { fired: !1, wrapFn: void 0, target: t, type: e, listener: r }, i = Vo.bind(n);
2556
2615
  return i.listener = r, n.wrapFn = i, i;
2557
2616
  }
2558
2617
  k.prototype.once = function(e, r) {
2559
- return Ot(r), this.on(e, Sn(this, e, r)), this;
2618
+ return Ot(r), this.on(e, wn(this, e, r)), this;
2560
2619
  };
2561
2620
  k.prototype.prependOnceListener = function(e, r) {
2562
- return Ot(r), this.prependListener(e, Sn(this, e, r)), this;
2621
+ return Ot(r), this.prependListener(e, wn(this, e, r)), this;
2563
2622
  };
2564
2623
  k.prototype.removeListener = function(e, r) {
2565
2624
  var n, i, o, s, a;
@@ -2577,7 +2636,7 @@ k.prototype.removeListener = function(e, r) {
2577
2636
  }
2578
2637
  if (o < 0)
2579
2638
  return this;
2580
- o === 0 ? n.shift() : Vo(n, o), n.length === 1 && (i[e] = n[0]), i.removeListener !== void 0 && this.emit("removeListener", e, a || r);
2639
+ o === 0 ? n.shift() : $o(n, o), n.length === 1 && (i[e] = n[0]), i.removeListener !== void 0 && this.emit("removeListener", e, a || r);
2581
2640
  }
2582
2641
  return this;
2583
2642
  };
@@ -2601,24 +2660,24 @@ k.prototype.removeAllListeners = function(e) {
2601
2660
  this.removeListener(e, r[i]);
2602
2661
  return this;
2603
2662
  };
2604
- function wn(t, e, r) {
2663
+ function An(t, e, r) {
2605
2664
  var n = t._events;
2606
2665
  if (n === void 0)
2607
2666
  return [];
2608
2667
  var i = n[e];
2609
- return i === void 0 ? [] : typeof i == "function" ? r ? [i.listener || i] : [i] : r ? $o(i) : En(i, i.length);
2668
+ return i === void 0 ? [] : typeof i == "function" ? r ? [i.listener || i] : [i] : r ? jo(i) : En(i, i.length);
2610
2669
  }
2611
2670
  k.prototype.listeners = function(e) {
2612
- return wn(this, e, !0);
2671
+ return An(this, e, !0);
2613
2672
  };
2614
2673
  k.prototype.rawListeners = function(e) {
2615
- return wn(this, e, !1);
2674
+ return An(this, e, !1);
2616
2675
  };
2617
2676
  k.listenerCount = function(t, e) {
2618
- return typeof t.listenerCount == "function" ? t.listenerCount(e) : An.call(t, e);
2677
+ return typeof t.listenerCount == "function" ? t.listenerCount(e) : In.call(t, e);
2619
2678
  };
2620
- k.prototype.listenerCount = An;
2621
- function An(t) {
2679
+ k.prototype.listenerCount = In;
2680
+ function In(t) {
2622
2681
  var e = this._events;
2623
2682
  if (e !== void 0) {
2624
2683
  var r = e[t];
@@ -2637,17 +2696,17 @@ function En(t, e) {
2637
2696
  r[n] = t[n];
2638
2697
  return r;
2639
2698
  }
2640
- function Vo(t, e) {
2699
+ function $o(t, e) {
2641
2700
  for (; e + 1 < t.length; e++)
2642
2701
  t[e] = t[e + 1];
2643
2702
  t.pop();
2644
2703
  }
2645
- function $o(t) {
2704
+ function jo(t) {
2646
2705
  for (var e = new Array(t.length), r = 0; r < e.length; ++r)
2647
2706
  e[r] = t[r].listener || t[r];
2648
2707
  return e;
2649
2708
  }
2650
- function jo(t, e) {
2709
+ function Mo(t, e) {
2651
2710
  return new Promise(function(r, n) {
2652
2711
  function i(s) {
2653
2712
  t.removeListener(e, o), n(s);
@@ -2655,13 +2714,13 @@ function jo(t, e) {
2655
2714
  function o() {
2656
2715
  typeof t.removeListener == "function" && t.removeListener("error", i), r([].slice.call(arguments));
2657
2716
  }
2658
- In(t, e, o, { once: !0 }), e !== "error" && Uo(t, i, { once: !0 });
2717
+ Tn(t, e, o, { once: !0 }), e !== "error" && Uo(t, i, { once: !0 });
2659
2718
  });
2660
2719
  }
2661
2720
  function Uo(t, e, r) {
2662
- typeof t.on == "function" && In(t, "error", e, r);
2721
+ typeof t.on == "function" && Tn(t, "error", e, r);
2663
2722
  }
2664
- function In(t, e, r, n) {
2723
+ function Tn(t, e, r, n) {
2665
2724
  if (typeof t.on == "function")
2666
2725
  n.once ? t.once(e, r) : t.on(e, r);
2667
2726
  else if (typeof t.addEventListener == "function")
@@ -2671,7 +2730,7 @@ function In(t, e, r, n) {
2671
2730
  else
2672
2731
  throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type ' + typeof t);
2673
2732
  }
2674
- var Tn = lr.exports, Ct = {}, On = {}, Cn = function() {
2733
+ var On = lr.exports, Ct = {}, Cn = {}, Ln = function() {
2675
2734
  if (typeof Symbol != "function" || typeof Object.getOwnPropertySymbols != "function")
2676
2735
  return !1;
2677
2736
  if (typeof Symbol.iterator == "symbol")
@@ -2694,33 +2753,33 @@ var Tn = lr.exports, Ct = {}, On = {}, Cn = function() {
2694
2753
  return !1;
2695
2754
  }
2696
2755
  return !0;
2697
- }, Mo = Cn, dr = function() {
2698
- return Mo() && !!Symbol.toStringTag;
2699
- }, Ur = typeof Symbol < "u" && Symbol, xo = Cn, Bo = function() {
2700
- return typeof Ur != "function" || typeof Symbol != "function" || typeof Ur("foo") != "symbol" || typeof Symbol("bar") != "symbol" ? !1 : xo();
2701
- }, Mr = {
2756
+ }, xo = Ln, dr = function() {
2757
+ return xo() && !!Symbol.toStringTag;
2758
+ }, Mr = typeof Symbol < "u" && Symbol, Bo = Ln, qo = function() {
2759
+ return typeof Mr != "function" || typeof Symbol != "function" || typeof Mr("foo") != "symbol" || typeof Symbol("bar") != "symbol" ? !1 : Bo();
2760
+ }, Ur = {
2702
2761
  foo: {}
2703
- }, qo = Object, Qo = function() {
2704
- return { __proto__: Mr }.foo === Mr.foo && !({ __proto__: null } instanceof qo);
2705
- }, Go = "Function.prototype.bind called on incompatible ", zo = Object.prototype.toString, Ko = Math.max, Ho = "[object Function]", xr = function(e, r) {
2762
+ }, Qo = Object, Go = function() {
2763
+ return { __proto__: Ur }.foo === Ur.foo && !({ __proto__: null } instanceof Qo);
2764
+ }, Ko = "Function.prototype.bind called on incompatible ", zo = Object.prototype.toString, Ho = Math.max, Wo = "[object Function]", xr = function(e, r) {
2706
2765
  for (var n = [], i = 0; i < e.length; i += 1)
2707
2766
  n[i] = e[i];
2708
2767
  for (var o = 0; o < r.length; o += 1)
2709
2768
  n[o + e.length] = r[o];
2710
2769
  return n;
2711
- }, Wo = function(e, r) {
2770
+ }, Jo = function(e, r) {
2712
2771
  for (var n = [], i = r || 0, o = 0; i < e.length; i += 1, o += 1)
2713
2772
  n[o] = e[i];
2714
2773
  return n;
2715
- }, Jo = function(t, e) {
2774
+ }, Yo = function(t, e) {
2716
2775
  for (var r = "", n = 0; n < t.length; n += 1)
2717
2776
  r += t[n], n + 1 < t.length && (r += e);
2718
2777
  return r;
2719
- }, Yo = function(e) {
2778
+ }, Xo = function(e) {
2720
2779
  var r = this;
2721
- if (typeof r != "function" || zo.apply(r) !== Ho)
2722
- throw new TypeError(Go + r);
2723
- for (var n = Wo(arguments, 1), i, o = function() {
2780
+ if (typeof r != "function" || zo.apply(r) !== Wo)
2781
+ throw new TypeError(Ko + r);
2782
+ for (var n = Jo(arguments, 1), i, o = function() {
2724
2783
  if (this instanceof i) {
2725
2784
  var c = r.apply(
2726
2785
  this,
@@ -2732,17 +2791,17 @@ var Tn = lr.exports, Ct = {}, On = {}, Cn = function() {
2732
2791
  e,
2733
2792
  xr(n, arguments)
2734
2793
  );
2735
- }, s = Ko(0, r.length - n.length), a = [], u = 0; u < s; u++)
2794
+ }, s = Ho(0, r.length - n.length), a = [], u = 0; u < s; u++)
2736
2795
  a[u] = "$" + u;
2737
- if (i = Function("binder", "return function (" + Jo(a, ",") + "){ return binder.apply(this,arguments); }")(o), r.prototype) {
2796
+ if (i = Function("binder", "return function (" + Yo(a, ",") + "){ return binder.apply(this,arguments); }")(o), r.prototype) {
2738
2797
  var d = function() {
2739
2798
  };
2740
2799
  d.prototype = r.prototype, i.prototype = new d(), d.prototype = null;
2741
2800
  }
2742
2801
  return i;
2743
- }, Xo = Yo, fr = Function.prototype.bind || Xo, Zo = Function.prototype.call, es = Object.prototype.hasOwnProperty, ts = fr, rs = ts.call(Zo, es), A, Qe = SyntaxError, Ln = Function, qe = TypeError, Pt = function(t) {
2802
+ }, Zo = Xo, fr = Function.prototype.bind || Zo, es = Function.prototype.call, ts = Object.prototype.hasOwnProperty, rs = fr, ns = rs.call(es, ts), A, Qe = SyntaxError, _n = Function, qe = TypeError, Pt = function(t) {
2744
2803
  try {
2745
- return Ln('"use strict"; return (' + t + ").constructor;")();
2804
+ return _n('"use strict"; return (' + t + ").constructor;")();
2746
2805
  } catch {
2747
2806
  }
2748
2807
  }, Ce = Object.getOwnPropertyDescriptor;
@@ -2754,7 +2813,7 @@ if (Ce)
2754
2813
  }
2755
2814
  var Ft = function() {
2756
2815
  throw new qe();
2757
- }, ns = Ce ? function() {
2816
+ }, is = Ce ? function() {
2758
2817
  try {
2759
2818
  return arguments.callee, Ft;
2760
2819
  } catch {
@@ -2764,9 +2823,9 @@ var Ft = function() {
2764
2823
  return Ft;
2765
2824
  }
2766
2825
  }
2767
- }() : Ft, Re = Bo(), is = Qo(), j = Object.getPrototypeOf || (is ? function(t) {
2826
+ }() : Ft, Re = qo(), os = Go(), j = Object.getPrototypeOf || (os ? function(t) {
2768
2827
  return t.__proto__;
2769
- } : null), $e = {}, os = typeof Uint8Array > "u" || !j ? A : j(Uint8Array), Le = {
2828
+ } : null), $e = {}, ss = typeof Uint8Array > "u" || !j ? A : j(Uint8Array), Le = {
2770
2829
  "%AggregateError%": typeof AggregateError > "u" ? A : AggregateError,
2771
2830
  "%Array%": Array,
2772
2831
  "%ArrayBuffer%": typeof ArrayBuffer > "u" ? A : ArrayBuffer,
@@ -2794,7 +2853,7 @@ var Ft = function() {
2794
2853
  "%Float32Array%": typeof Float32Array > "u" ? A : Float32Array,
2795
2854
  "%Float64Array%": typeof Float64Array > "u" ? A : Float64Array,
2796
2855
  "%FinalizationRegistry%": typeof FinalizationRegistry > "u" ? A : FinalizationRegistry,
2797
- "%Function%": Ln,
2856
+ "%Function%": _n,
2798
2857
  "%GeneratorFunction%": $e,
2799
2858
  "%Int8Array%": typeof Int8Array > "u" ? A : Int8Array,
2800
2859
  "%Int16Array%": typeof Int16Array > "u" ? A : Int16Array,
@@ -2823,8 +2882,8 @@ var Ft = function() {
2823
2882
  "%StringIteratorPrototype%": Re && j ? j(""[Symbol.iterator]()) : A,
2824
2883
  "%Symbol%": Re ? Symbol : A,
2825
2884
  "%SyntaxError%": Qe,
2826
- "%ThrowTypeError%": ns,
2827
- "%TypedArray%": os,
2885
+ "%ThrowTypeError%": is,
2886
+ "%TypedArray%": ss,
2828
2887
  "%TypeError%": qe,
2829
2888
  "%Uint8Array%": typeof Uint8Array > "u" ? A : Uint8Array,
2830
2889
  "%Uint8ClampedArray%": typeof Uint8ClampedArray > "u" ? A : Uint8ClampedArray,
@@ -2839,10 +2898,10 @@ if (j)
2839
2898
  try {
2840
2899
  null.error;
2841
2900
  } catch (t) {
2842
- var ss = j(j(t));
2843
- Le["%Error.prototype%"] = ss;
2901
+ var as = j(j(t));
2902
+ Le["%Error.prototype%"] = as;
2844
2903
  }
2845
- var as = function t(e) {
2904
+ var us = function t(e) {
2846
2905
  var r;
2847
2906
  if (e === "%AsyncFunction%")
2848
2907
  r = Pt("async function () {}");
@@ -2910,21 +2969,21 @@ var as = function t(e) {
2910
2969
  "%URIErrorPrototype%": ["URIError", "prototype"],
2911
2970
  "%WeakMapPrototype%": ["WeakMap", "prototype"],
2912
2971
  "%WeakSetPrototype%": ["WeakSet", "prototype"]
2913
- }, nt = fr, mt = rs, us = nt.call(Function.call, Array.prototype.concat), cs = nt.call(Function.apply, Array.prototype.splice), qr = nt.call(Function.call, String.prototype.replace), bt = nt.call(Function.call, String.prototype.slice), ls = nt.call(Function.call, RegExp.prototype.exec), ds = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g, fs = /\\(\\)?/g, ps = function(e) {
2972
+ }, nt = fr, mt = ns, cs = nt.call(Function.call, Array.prototype.concat), ls = nt.call(Function.apply, Array.prototype.splice), qr = nt.call(Function.call, String.prototype.replace), bt = nt.call(Function.call, String.prototype.slice), ds = nt.call(Function.call, RegExp.prototype.exec), fs = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g, hs = /\\(\\)?/g, ps = function(e) {
2914
2973
  var r = bt(e, 0, 1), n = bt(e, -1);
2915
2974
  if (r === "%" && n !== "%")
2916
2975
  throw new Qe("invalid intrinsic syntax, expected closing `%`");
2917
2976
  if (n === "%" && r !== "%")
2918
2977
  throw new Qe("invalid intrinsic syntax, expected opening `%`");
2919
2978
  var i = [];
2920
- return qr(e, ds, function(o, s, a, u) {
2921
- i[i.length] = a ? qr(u, fs, "$1") : s || o;
2979
+ return qr(e, fs, function(o, s, a, u) {
2980
+ i[i.length] = a ? qr(u, hs, "$1") : s || o;
2922
2981
  }), i;
2923
- }, hs = function(e, r) {
2982
+ }, ys = function(e, r) {
2924
2983
  var n = e, i;
2925
2984
  if (mt(Br, n) && (i = Br[n], n = "%" + i[0] + "%"), mt(Le, n)) {
2926
2985
  var o = Le[n];
2927
- if (o === $e && (o = as(n)), typeof o > "u" && !r)
2986
+ if (o === $e && (o = us(n)), typeof o > "u" && !r)
2928
2987
  throw new qe("intrinsic " + e + " exists, but is not available. Please file an issue!");
2929
2988
  return {
2930
2989
  alias: i,
@@ -2933,37 +2992,37 @@ var as = function t(e) {
2933
2992
  };
2934
2993
  }
2935
2994
  throw new Qe("intrinsic " + e + " does not exist!");
2936
- }, ze = function(e, r) {
2995
+ }, Ke = function(e, r) {
2937
2996
  if (typeof e != "string" || e.length === 0)
2938
2997
  throw new qe("intrinsic name must be a non-empty string");
2939
2998
  if (arguments.length > 1 && typeof r != "boolean")
2940
2999
  throw new qe('"allowMissing" argument must be a boolean');
2941
- if (ls(/^%?[^%]*%?$/, e) === null)
3000
+ if (ds(/^%?[^%]*%?$/, e) === null)
2942
3001
  throw new Qe("`%` may not be present anywhere but at the beginning and end of the intrinsic name");
2943
- var n = ps(e), i = n.length > 0 ? n[0] : "", o = hs("%" + i + "%", r), s = o.name, a = o.value, u = !1, d = o.alias;
2944
- d && (i = d[0], cs(n, us([0, 1], d)));
3002
+ var n = ps(e), i = n.length > 0 ? n[0] : "", o = ys("%" + i + "%", r), s = o.name, a = o.value, u = !1, d = o.alias;
3003
+ d && (i = d[0], ls(n, cs([0, 1], d)));
2945
3004
  for (var c = 1, f = !0; c < n.length; c += 1) {
2946
- var y = n[c], m = bt(y, 0, 1), b = bt(y, -1);
3005
+ var p = n[c], m = bt(p, 0, 1), b = bt(p, -1);
2947
3006
  if ((m === '"' || m === "'" || m === "`" || b === '"' || b === "'" || b === "`") && m !== b)
2948
3007
  throw new Qe("property names with quotes must have matching quotes");
2949
- if ((y === "constructor" || !f) && (u = !0), i += "." + y, s = "%" + i + "%", mt(Le, s))
3008
+ if ((p === "constructor" || !f) && (u = !0), i += "." + p, s = "%" + i + "%", mt(Le, s))
2950
3009
  a = Le[s];
2951
3010
  else if (a != null) {
2952
- if (!(y in a)) {
3011
+ if (!(p in a)) {
2953
3012
  if (!r)
2954
3013
  throw new qe("base intrinsic for " + e + " exists, but the property is not available.");
2955
3014
  return;
2956
3015
  }
2957
3016
  if (Ce && c + 1 >= n.length) {
2958
- var T = Ce(a, y);
2959
- f = !!T, f && "get" in T && !("originalValue" in T.get) ? a = T.get : a = a[y];
3017
+ var T = Ce(a, p);
3018
+ f = !!T, f && "get" in T && !("originalValue" in T.get) ? a = T.get : a = a[p];
2960
3019
  } else
2961
- f = mt(a, y), a = a[y];
3020
+ f = mt(a, p), a = a[p];
2962
3021
  f && !u && (Le[s] = a);
2963
3022
  }
2964
3023
  }
2965
3024
  return a;
2966
- }, _n = { exports: {} }, ys = ze, Jt = ys("%Object.defineProperty%", !0), Yt = function() {
3025
+ }, kn = { exports: {} }, gs = Ke, Jt = gs("%Object.defineProperty%", !0), Yt = function() {
2967
3026
  if (Jt)
2968
3027
  try {
2969
3028
  return Jt({}, "a", { value: 1 }), !0;
@@ -2981,21 +3040,21 @@ Yt.hasArrayLengthDefineBug = function() {
2981
3040
  return !0;
2982
3041
  }
2983
3042
  };
2984
- var kn = Yt, gs = ze, ft = gs("%Object.getOwnPropertyDescriptor%", !0);
3043
+ var Pn = Yt, ms = Ke, ft = ms("%Object.getOwnPropertyDescriptor%", !0);
2985
3044
  if (ft)
2986
3045
  try {
2987
3046
  ft([], "length");
2988
3047
  } catch {
2989
3048
  ft = null;
2990
3049
  }
2991
- var pr = ft, ms = kn(), hr = ze, Xe = ms && hr("%Object.defineProperty%", !0);
3050
+ var hr = ft, bs = Pn(), pr = Ke, Xe = bs && pr("%Object.defineProperty%", !0);
2992
3051
  if (Xe)
2993
3052
  try {
2994
3053
  Xe({}, "a", { value: 1 });
2995
3054
  } catch {
2996
3055
  Xe = !1;
2997
3056
  }
2998
- var bs = hr("%SyntaxError%"), Ve = hr("%TypeError%"), Qr = pr, vs = function(e, r, n) {
3057
+ var vs = pr("%SyntaxError%"), Ve = pr("%TypeError%"), Qr = hr, Ss = function(e, r, n) {
2999
3058
  if (!e || typeof e != "object" && typeof e != "function")
3000
3059
  throw new Ve("`obj` must be an object or a function`");
3001
3060
  if (typeof r != "string" && typeof r != "symbol")
@@ -3019,18 +3078,18 @@ var bs = hr("%SyntaxError%"), Ve = hr("%TypeError%"), Qr = pr, vs = function(e,
3019
3078
  else if (a || !i && !o && !s)
3020
3079
  e[r] = n;
3021
3080
  else
3022
- throw new bs("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");
3023
- }, Pn = ze, Gr = vs, Ss = kn(), zr = pr, Kr = Pn("%TypeError%"), ws = Pn("%Math.floor%"), As = function(e, r) {
3081
+ throw new vs("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");
3082
+ }, Fn = Ke, Gr = Ss, ws = Pn(), Kr = hr, zr = Fn("%TypeError%"), As = Fn("%Math.floor%"), Is = function(e, r) {
3024
3083
  if (typeof e != "function")
3025
- throw new Kr("`fn` is not a function");
3026
- if (typeof r != "number" || r < 0 || r > 4294967295 || ws(r) !== r)
3027
- throw new Kr("`length` must be a positive 32-bit integer");
3084
+ throw new zr("`fn` is not a function");
3085
+ if (typeof r != "number" || r < 0 || r > 4294967295 || As(r) !== r)
3086
+ throw new zr("`length` must be a positive 32-bit integer");
3028
3087
  var n = arguments.length > 2 && !!arguments[2], i = !0, o = !0;
3029
- if ("length" in e && zr) {
3030
- var s = zr(e, "length");
3088
+ if ("length" in e && Kr) {
3089
+ var s = Kr(e, "length");
3031
3090
  s && !s.configurable && (i = !1), s && !s.writable && (o = !1);
3032
3091
  }
3033
- return (i || o || !n) && (Ss ? Gr(
3092
+ return (i || o || !n) && (ws ? Gr(
3034
3093
  /** @type {Parameters<define>[0]} */
3035
3094
  e,
3036
3095
  "length",
@@ -3045,20 +3104,20 @@ var bs = hr("%SyntaxError%"), Ve = hr("%TypeError%"), Qr = pr, vs = function(e,
3045
3104
  )), e;
3046
3105
  };
3047
3106
  (function(t) {
3048
- var e = fr, r = ze, n = As, i = r("%TypeError%"), o = r("%Function.prototype.apply%"), s = r("%Function.prototype.call%"), a = r("%Reflect.apply%", !0) || e.call(s, o), u = r("%Object.defineProperty%", !0), d = r("%Math.max%");
3107
+ var e = fr, r = Ke, n = Is, i = r("%TypeError%"), o = r("%Function.prototype.apply%"), s = r("%Function.prototype.call%"), a = r("%Reflect.apply%", !0) || e.call(s, o), u = r("%Object.defineProperty%", !0), d = r("%Math.max%");
3049
3108
  if (u)
3050
3109
  try {
3051
3110
  u({}, "a", { value: 1 });
3052
3111
  } catch {
3053
3112
  u = null;
3054
3113
  }
3055
- t.exports = function(y) {
3056
- if (typeof y != "function")
3114
+ t.exports = function(p) {
3115
+ if (typeof p != "function")
3057
3116
  throw new i("a function is required");
3058
3117
  var m = a(e, s, arguments);
3059
3118
  return n(
3060
3119
  m,
3061
- 1 + d(0, y.length - (arguments.length - 1)),
3120
+ 1 + d(0, p.length - (arguments.length - 1)),
3062
3121
  !0
3063
3122
  );
3064
3123
  };
@@ -3066,93 +3125,93 @@ var bs = hr("%SyntaxError%"), Ve = hr("%TypeError%"), Qr = pr, vs = function(e,
3066
3125
  return a(e, o, arguments);
3067
3126
  };
3068
3127
  u ? u(t.exports, "apply", { value: c }) : t.exports.apply = c;
3069
- })(_n);
3070
- var Fn = _n.exports, Nn = ze, Dn = Fn, Es = Dn(Nn("String.prototype.indexOf")), Rn = function(e, r) {
3071
- var n = Nn(e, !!r);
3072
- return typeof n == "function" && Es(e, ".prototype.") > -1 ? Dn(n) : n;
3073
- }, Is = dr(), Ts = Rn, Xt = Ts("Object.prototype.toString"), Lt = function(e) {
3074
- return Is && e && typeof e == "object" && Symbol.toStringTag in e ? !1 : Xt(e) === "[object Arguments]";
3075
- }, Vn = function(e) {
3128
+ })(kn);
3129
+ var Nn = kn.exports, Dn = Ke, Rn = Nn, Es = Rn(Dn("String.prototype.indexOf")), Vn = function(e, r) {
3130
+ var n = Dn(e, !!r);
3131
+ return typeof n == "function" && Es(e, ".prototype.") > -1 ? Rn(n) : n;
3132
+ }, Ts = dr(), Os = Vn, Xt = Os("Object.prototype.toString"), Lt = function(e) {
3133
+ return Ts && e && typeof e == "object" && Symbol.toStringTag in e ? !1 : Xt(e) === "[object Arguments]";
3134
+ }, $n = function(e) {
3076
3135
  return Lt(e) ? !0 : e !== null && typeof e == "object" && typeof e.length == "number" && e.length >= 0 && Xt(e) !== "[object Array]" && Xt(e.callee) === "[object Function]";
3077
- }, Os = function() {
3136
+ }, Cs = function() {
3078
3137
  return Lt(arguments);
3079
3138
  }();
3080
- Lt.isLegacyArguments = Vn;
3081
- var Cs = Os ? Lt : Vn, Ls = Object.prototype.toString, _s = Function.prototype.toString, ks = /^\s*(?:function)?\*/, $n = dr(), Nt = Object.getPrototypeOf, Ps = function() {
3082
- if (!$n)
3139
+ Lt.isLegacyArguments = $n;
3140
+ var Ls = Cs ? Lt : $n, _s = Object.prototype.toString, ks = Function.prototype.toString, Ps = /^\s*(?:function)?\*/, jn = dr(), Nt = Object.getPrototypeOf, Fs = function() {
3141
+ if (!jn)
3083
3142
  return !1;
3084
3143
  try {
3085
3144
  return Function("return function*() {}")();
3086
3145
  } catch {
3087
3146
  }
3088
- }, Dt, Fs = function(e) {
3147
+ }, Dt, Ns = function(e) {
3089
3148
  if (typeof e != "function")
3090
3149
  return !1;
3091
- if (ks.test(_s.call(e)))
3150
+ if (Ps.test(ks.call(e)))
3092
3151
  return !0;
3093
- if (!$n) {
3094
- var r = Ls.call(e);
3152
+ if (!jn) {
3153
+ var r = _s.call(e);
3095
3154
  return r === "[object GeneratorFunction]";
3096
3155
  }
3097
3156
  if (!Nt)
3098
3157
  return !1;
3099
3158
  if (typeof Dt > "u") {
3100
- var n = Ps();
3159
+ var n = Fs();
3101
3160
  Dt = n ? Nt(n) : !1;
3102
3161
  }
3103
3162
  return Nt(e) === Dt;
3104
- }, jn = Function.prototype.toString, Me = typeof Reflect == "object" && Reflect !== null && Reflect.apply, Zt, pt;
3105
- if (typeof Me == "function" && typeof Object.defineProperty == "function")
3163
+ }, Mn = Function.prototype.toString, Ue = typeof Reflect == "object" && Reflect !== null && Reflect.apply, Zt, ht;
3164
+ if (typeof Ue == "function" && typeof Object.defineProperty == "function")
3106
3165
  try {
3107
3166
  Zt = Object.defineProperty({}, "length", {
3108
3167
  get: function() {
3109
- throw pt;
3168
+ throw ht;
3110
3169
  }
3111
- }), pt = {}, Me(function() {
3170
+ }), ht = {}, Ue(function() {
3112
3171
  throw 42;
3113
3172
  }, null, Zt);
3114
3173
  } catch (t) {
3115
- t !== pt && (Me = null);
3174
+ t !== ht && (Ue = null);
3116
3175
  }
3117
3176
  else
3118
- Me = null;
3119
- var Ns = /^\s*class\b/, er = function(e) {
3177
+ Ue = null;
3178
+ var Ds = /^\s*class\b/, er = function(e) {
3120
3179
  try {
3121
- var r = jn.call(e);
3122
- return Ns.test(r);
3180
+ var r = Mn.call(e);
3181
+ return Ds.test(r);
3123
3182
  } catch {
3124
3183
  return !1;
3125
3184
  }
3126
3185
  }, Rt = function(e) {
3127
3186
  try {
3128
- return er(e) ? !1 : (jn.call(e), !0);
3187
+ return er(e) ? !1 : (Mn.call(e), !0);
3129
3188
  } catch {
3130
3189
  return !1;
3131
3190
  }
3132
- }, ht = Object.prototype.toString, Ds = "[object Object]", Rs = "[object Function]", Vs = "[object GeneratorFunction]", $s = "[object HTMLAllCollection]", js = "[object HTML document.all class]", Us = "[object HTMLCollection]", Ms = typeof Symbol == "function" && !!Symbol.toStringTag, xs = !(0 in [,]), tr = function() {
3191
+ }, pt = Object.prototype.toString, Rs = "[object Object]", Vs = "[object Function]", $s = "[object GeneratorFunction]", js = "[object HTMLAllCollection]", Ms = "[object HTML document.all class]", Us = "[object HTMLCollection]", xs = typeof Symbol == "function" && !!Symbol.toStringTag, Bs = !(0 in [,]), tr = function() {
3133
3192
  return !1;
3134
3193
  };
3135
3194
  if (typeof document == "object") {
3136
- var Bs = document.all;
3137
- ht.call(Bs) === ht.call(document.all) && (tr = function(e) {
3138
- if ((xs || !e) && (typeof e > "u" || typeof e == "object"))
3195
+ var qs = document.all;
3196
+ pt.call(qs) === pt.call(document.all) && (tr = function(e) {
3197
+ if ((Bs || !e) && (typeof e > "u" || typeof e == "object"))
3139
3198
  try {
3140
- var r = ht.call(e);
3141
- return (r === $s || r === js || r === Us || r === Ds) && e("") == null;
3199
+ var r = pt.call(e);
3200
+ return (r === js || r === Ms || r === Us || r === Rs) && e("") == null;
3142
3201
  } catch {
3143
3202
  }
3144
3203
  return !1;
3145
3204
  });
3146
3205
  }
3147
- var qs = Me ? function(e) {
3206
+ var Qs = Ue ? function(e) {
3148
3207
  if (tr(e))
3149
3208
  return !0;
3150
3209
  if (!e || typeof e != "function" && typeof e != "object")
3151
3210
  return !1;
3152
3211
  try {
3153
- Me(e, null, Zt);
3212
+ Ue(e, null, Zt);
3154
3213
  } catch (r) {
3155
- if (r !== pt)
3214
+ if (r !== ht)
3156
3215
  return !1;
3157
3216
  }
3158
3217
  return !er(e) && Rt(e);
@@ -3161,27 +3220,27 @@ var qs = Me ? function(e) {
3161
3220
  return !0;
3162
3221
  if (!e || typeof e != "function" && typeof e != "object")
3163
3222
  return !1;
3164
- if (Ms)
3223
+ if (xs)
3165
3224
  return Rt(e);
3166
3225
  if (er(e))
3167
3226
  return !1;
3168
- var r = ht.call(e);
3169
- return r !== Rs && r !== Vs && !/^\[object HTML/.test(r) ? !1 : Rt(e);
3170
- }, Qs = qs, Gs = Object.prototype.toString, Un = Object.prototype.hasOwnProperty, zs = function(e, r, n) {
3227
+ var r = pt.call(e);
3228
+ return r !== Vs && r !== $s && !/^\[object HTML/.test(r) ? !1 : Rt(e);
3229
+ }, Gs = Qs, Ks = Object.prototype.toString, Un = Object.prototype.hasOwnProperty, zs = function(e, r, n) {
3171
3230
  for (var i = 0, o = e.length; i < o; i++)
3172
3231
  Un.call(e, i) && (n == null ? r(e[i], i, e) : r.call(n, e[i], i, e));
3173
- }, Ks = function(e, r, n) {
3232
+ }, Hs = function(e, r, n) {
3174
3233
  for (var i = 0, o = e.length; i < o; i++)
3175
3234
  n == null ? r(e.charAt(i), i, e) : r.call(n, e.charAt(i), i, e);
3176
- }, Hs = function(e, r, n) {
3235
+ }, Ws = function(e, r, n) {
3177
3236
  for (var i in e)
3178
3237
  Un.call(e, i) && (n == null ? r(e[i], i, e) : r.call(n, e[i], i, e));
3179
- }, Ws = function(e, r, n) {
3180
- if (!Qs(r))
3238
+ }, Js = function(e, r, n) {
3239
+ if (!Gs(r))
3181
3240
  throw new TypeError("iterator must be a function");
3182
3241
  var i;
3183
- arguments.length >= 3 && (i = n), Gs.call(e) === "[object Array]" ? zs(e, r, i) : typeof e == "string" ? Ks(e, r, i) : Hs(e, r, i);
3184
- }, Js = Ws, Vt = [
3242
+ arguments.length >= 3 && (i = n), Ks.call(e) === "[object Array]" ? zs(e, r, i) : typeof e == "string" ? Hs(e, r, i) : Ws(e, r, i);
3243
+ }, Ys = Js, Vt = [
3185
3244
  "BigInt64Array",
3186
3245
  "BigUint64Array",
3187
3246
  "Float32Array",
@@ -3193,17 +3252,17 @@ var qs = Me ? function(e) {
3193
3252
  "Uint32Array",
3194
3253
  "Uint8Array",
3195
3254
  "Uint8ClampedArray"
3196
- ], Ys = typeof globalThis > "u" ? hn : globalThis, Xs = function() {
3255
+ ], Xs = typeof globalThis > "u" ? yn : globalThis, Zs = function() {
3197
3256
  for (var e = [], r = 0; r < Vt.length; r++)
3198
- typeof Ys[Vt[r]] == "function" && (e[e.length] = Vt[r]);
3257
+ typeof Xs[Vt[r]] == "function" && (e[e.length] = Vt[r]);
3199
3258
  return e;
3200
- }, vt = Js, Zs = Xs, Hr = Fn, yr = Rn, yt = pr, ea = yr("Object.prototype.toString"), Mn = dr(), Wr = typeof globalThis > "u" ? hn : globalThis, rr = Zs(), gr = yr("String.prototype.slice"), $t = Object.getPrototypeOf, ta = yr("Array.prototype.indexOf", !0) || function(e, r) {
3259
+ }, vt = Ys, ea = Zs, Hr = Nn, yr = Vn, yt = hr, ta = yr("Object.prototype.toString"), xn = dr(), Wr = typeof globalThis > "u" ? yn : globalThis, rr = ea(), gr = yr("String.prototype.slice"), $t = Object.getPrototypeOf, ra = yr("Array.prototype.indexOf", !0) || function(e, r) {
3201
3260
  for (var n = 0; n < e.length; n += 1)
3202
3261
  if (e[n] === r)
3203
3262
  return n;
3204
3263
  return -1;
3205
3264
  }, St = { __proto__: null };
3206
- Mn && yt && $t ? vt(rr, function(t) {
3265
+ xn && yt && $t ? vt(rr, function(t) {
3207
3266
  var e = new Wr[t]();
3208
3267
  if (Symbol.toStringTag in e) {
3209
3268
  var r = $t(e), n = yt(r, Symbol.toStringTag);
@@ -3217,7 +3276,7 @@ Mn && yt && $t ? vt(rr, function(t) {
3217
3276
  var e = new Wr[t](), r = e.slice || e.set;
3218
3277
  r && (St["$" + t] = Hr(r));
3219
3278
  });
3220
- var ra = function(e) {
3279
+ var na = function(e) {
3221
3280
  var r = !1;
3222
3281
  return vt(St, function(n, i) {
3223
3282
  if (!r)
@@ -3226,7 +3285,7 @@ var ra = function(e) {
3226
3285
  } catch {
3227
3286
  }
3228
3287
  }), r;
3229
- }, na = function(e) {
3288
+ }, ia = function(e) {
3230
3289
  var r = !1;
3231
3290
  return vt(St, function(n, i) {
3232
3291
  if (!r)
@@ -3235,202 +3294,202 @@ var ra = function(e) {
3235
3294
  } catch {
3236
3295
  }
3237
3296
  }), r;
3238
- }, xn = function(e) {
3297
+ }, Bn = function(e) {
3239
3298
  if (!e || typeof e != "object")
3240
3299
  return !1;
3241
- if (!Mn) {
3242
- var r = gr(ea(e), 8, -1);
3243
- return ta(rr, r) > -1 ? r : r !== "Object" ? !1 : na(e);
3300
+ if (!xn) {
3301
+ var r = gr(ta(e), 8, -1);
3302
+ return ra(rr, r) > -1 ? r : r !== "Object" ? !1 : ia(e);
3244
3303
  }
3245
- return yt ? ra(e) : null;
3246
- }, ia = xn, oa = function(e) {
3247
- return !!ia(e);
3304
+ return yt ? na(e) : null;
3305
+ }, oa = Bn, sa = function(e) {
3306
+ return !!oa(e);
3248
3307
  };
3249
3308
  (function(t) {
3250
- var e = Cs, r = Fs, n = xn, i = oa;
3251
- function o(h) {
3252
- return h.call.bind(h);
3309
+ var e = Ls, r = Ns, n = Bn, i = sa;
3310
+ function o(y) {
3311
+ return y.call.bind(y);
3253
3312
  }
3254
3313
  var s = typeof BigInt < "u", a = typeof Symbol < "u", u = o(Object.prototype.toString), d = o(Number.prototype.valueOf), c = o(String.prototype.valueOf), f = o(Boolean.prototype.valueOf);
3255
3314
  if (s)
3256
- var y = o(BigInt.prototype.valueOf);
3315
+ var p = o(BigInt.prototype.valueOf);
3257
3316
  if (a)
3258
3317
  var m = o(Symbol.prototype.valueOf);
3259
- function b(h, Hn) {
3260
- if (typeof h != "object")
3318
+ function b(y, Wn) {
3319
+ if (typeof y != "object")
3261
3320
  return !1;
3262
3321
  try {
3263
- return Hn(h), !0;
3322
+ return Wn(y), !0;
3264
3323
  } catch {
3265
3324
  return !1;
3266
3325
  }
3267
3326
  }
3268
3327
  t.isArgumentsObject = e, t.isGeneratorFunction = r, t.isTypedArray = i;
3269
- function T(h) {
3270
- return typeof Promise < "u" && h instanceof Promise || h !== null && typeof h == "object" && typeof h.then == "function" && typeof h.catch == "function";
3328
+ function T(y) {
3329
+ return typeof Promise < "u" && y instanceof Promise || y !== null && typeof y == "object" && typeof y.then == "function" && typeof y.catch == "function";
3271
3330
  }
3272
3331
  t.isPromise = T;
3273
- function I(h) {
3274
- return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? ArrayBuffer.isView(h) : i(h) || p(h);
3332
+ function E(y) {
3333
+ return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? ArrayBuffer.isView(y) : i(y) || h(y);
3275
3334
  }
3276
- t.isArrayBufferView = I;
3277
- function F(h) {
3278
- return n(h) === "Uint8Array";
3335
+ t.isArrayBufferView = E;
3336
+ function F(y) {
3337
+ return n(y) === "Uint8Array";
3279
3338
  }
3280
3339
  t.isUint8Array = F;
3281
- function $(h) {
3282
- return n(h) === "Uint8ClampedArray";
3340
+ function V(y) {
3341
+ return n(y) === "Uint8ClampedArray";
3283
3342
  }
3284
- t.isUint8ClampedArray = $;
3285
- function q(h) {
3286
- return n(h) === "Uint16Array";
3343
+ t.isUint8ClampedArray = V;
3344
+ function q(y) {
3345
+ return n(y) === "Uint16Array";
3287
3346
  }
3288
3347
  t.isUint16Array = q;
3289
- function J(h) {
3290
- return n(h) === "Uint32Array";
3348
+ function J(y) {
3349
+ return n(y) === "Uint32Array";
3291
3350
  }
3292
3351
  t.isUint32Array = J;
3293
- function _(h) {
3294
- return n(h) === "Int8Array";
3352
+ function _(y) {
3353
+ return n(y) === "Int8Array";
3295
3354
  }
3296
3355
  t.isInt8Array = _;
3297
- function R(h) {
3298
- return n(h) === "Int16Array";
3356
+ function R(y) {
3357
+ return n(y) === "Int16Array";
3299
3358
  }
3300
3359
  t.isInt16Array = R;
3301
- function E(h) {
3302
- return n(h) === "Int32Array";
3360
+ function I(y) {
3361
+ return n(y) === "Int32Array";
3303
3362
  }
3304
- t.isInt32Array = E;
3305
- function X(h) {
3306
- return n(h) === "Float32Array";
3363
+ t.isInt32Array = I;
3364
+ function X(y) {
3365
+ return n(y) === "Float32Array";
3307
3366
  }
3308
3367
  t.isFloat32Array = X;
3309
- function Z(h) {
3310
- return n(h) === "Float64Array";
3368
+ function Z(y) {
3369
+ return n(y) === "Float64Array";
3311
3370
  }
3312
3371
  t.isFloat64Array = Z;
3313
- function _e(h) {
3314
- return n(h) === "BigInt64Array";
3372
+ function _e(y) {
3373
+ return n(y) === "BigInt64Array";
3315
3374
  }
3316
3375
  t.isBigInt64Array = _e;
3317
- function Se(h) {
3318
- return n(h) === "BigUint64Array";
3376
+ function we(y) {
3377
+ return n(y) === "BigUint64Array";
3319
3378
  }
3320
- t.isBigUint64Array = Se;
3321
- function se(h) {
3322
- return u(h) === "[object Map]";
3379
+ t.isBigUint64Array = we;
3380
+ function oe(y) {
3381
+ return u(y) === "[object Map]";
3323
3382
  }
3324
- se.working = typeof Map < "u" && se(/* @__PURE__ */ new Map());
3325
- function _t(h) {
3326
- return typeof Map > "u" ? !1 : se.working ? se(h) : h instanceof Map;
3383
+ oe.working = typeof Map < "u" && oe(/* @__PURE__ */ new Map());
3384
+ function _t(y) {
3385
+ return typeof Map > "u" ? !1 : oe.working ? oe(y) : y instanceof Map;
3327
3386
  }
3328
3387
  t.isMap = _t;
3329
- function ge(h) {
3330
- return u(h) === "[object Set]";
3388
+ function me(y) {
3389
+ return u(y) === "[object Set]";
3331
3390
  }
3332
- ge.working = typeof Set < "u" && ge(/* @__PURE__ */ new Set());
3333
- function He(h) {
3334
- return typeof Set > "u" ? !1 : ge.working ? ge(h) : h instanceof Set;
3391
+ me.working = typeof Set < "u" && me(/* @__PURE__ */ new Set());
3392
+ function He(y) {
3393
+ return typeof Set > "u" ? !1 : me.working ? me(y) : y instanceof Set;
3335
3394
  }
3336
3395
  t.isSet = He;
3337
- function ke(h) {
3338
- return u(h) === "[object WeakMap]";
3396
+ function ke(y) {
3397
+ return u(y) === "[object WeakMap]";
3339
3398
  }
3340
3399
  ke.working = typeof WeakMap < "u" && ke(/* @__PURE__ */ new WeakMap());
3341
- function kt(h) {
3342
- return typeof WeakMap > "u" ? !1 : ke.working ? ke(h) : h instanceof WeakMap;
3400
+ function kt(y) {
3401
+ return typeof WeakMap > "u" ? !1 : ke.working ? ke(y) : y instanceof WeakMap;
3343
3402
  }
3344
3403
  t.isWeakMap = kt;
3345
- function Pe(h) {
3346
- return u(h) === "[object WeakSet]";
3404
+ function Pe(y) {
3405
+ return u(y) === "[object WeakSet]";
3347
3406
  }
3348
3407
  Pe.working = typeof WeakSet < "u" && Pe(/* @__PURE__ */ new WeakSet());
3349
- function ae(h) {
3350
- return Pe(h);
3408
+ function se(y) {
3409
+ return Pe(y);
3351
3410
  }
3352
- t.isWeakSet = ae;
3353
- function Fe(h) {
3354
- return u(h) === "[object ArrayBuffer]";
3411
+ t.isWeakSet = se;
3412
+ function Fe(y) {
3413
+ return u(y) === "[object ArrayBuffer]";
3355
3414
  }
3356
3415
  Fe.working = typeof ArrayBuffer < "u" && Fe(new ArrayBuffer());
3357
- function it(h) {
3358
- return typeof ArrayBuffer > "u" ? !1 : Fe.working ? Fe(h) : h instanceof ArrayBuffer;
3416
+ function it(y) {
3417
+ return typeof ArrayBuffer > "u" ? !1 : Fe.working ? Fe(y) : y instanceof ArrayBuffer;
3359
3418
  }
3360
3419
  t.isArrayBuffer = it;
3361
- function l(h) {
3362
- return u(h) === "[object DataView]";
3420
+ function l(y) {
3421
+ return u(y) === "[object DataView]";
3363
3422
  }
3364
3423
  l.working = typeof ArrayBuffer < "u" && typeof DataView < "u" && l(new DataView(new ArrayBuffer(1), 0, 1));
3365
- function p(h) {
3366
- return typeof DataView > "u" ? !1 : l.working ? l(h) : h instanceof DataView;
3424
+ function h(y) {
3425
+ return typeof DataView > "u" ? !1 : l.working ? l(y) : y instanceof DataView;
3367
3426
  }
3368
- t.isDataView = p;
3427
+ t.isDataView = h;
3369
3428
  var g = typeof SharedArrayBuffer < "u" ? SharedArrayBuffer : void 0;
3370
- function v(h) {
3371
- return u(h) === "[object SharedArrayBuffer]";
3429
+ function v(y) {
3430
+ return u(y) === "[object SharedArrayBuffer]";
3372
3431
  }
3373
- function C(h) {
3374
- return typeof g > "u" ? !1 : (typeof v.working > "u" && (v.working = v(new g())), v.working ? v(h) : h instanceof g);
3432
+ function C(y) {
3433
+ return typeof g > "u" ? !1 : (typeof v.working > "u" && (v.working = v(new g())), v.working ? v(y) : y instanceof g);
3375
3434
  }
3376
3435
  t.isSharedArrayBuffer = C;
3377
- function L(h) {
3378
- return u(h) === "[object AsyncFunction]";
3436
+ function L(y) {
3437
+ return u(y) === "[object AsyncFunction]";
3379
3438
  }
3380
3439
  t.isAsyncFunction = L;
3381
- function w(h) {
3382
- return u(h) === "[object Map Iterator]";
3440
+ function w(y) {
3441
+ return u(y) === "[object Map Iterator]";
3383
3442
  }
3384
3443
  t.isMapIterator = w;
3385
- function O(h) {
3386
- return u(h) === "[object Set Iterator]";
3444
+ function O(y) {
3445
+ return u(y) === "[object Set Iterator]";
3387
3446
  }
3388
3447
  t.isSetIterator = O;
3389
- function P(h) {
3390
- return u(h) === "[object Generator]";
3448
+ function P(y) {
3449
+ return u(y) === "[object Generator]";
3391
3450
  }
3392
3451
  t.isGeneratorObject = P;
3393
- function G(h) {
3394
- return u(h) === "[object WebAssembly.Module]";
3452
+ function G(y) {
3453
+ return u(y) === "[object WebAssembly.Module]";
3395
3454
  }
3396
3455
  t.isWebAssemblyCompiledModule = G;
3397
- function we(h) {
3398
- return b(h, d);
3456
+ function Ae(y) {
3457
+ return b(y, d);
3399
3458
  }
3400
- t.isNumberObject = we;
3401
- function ot(h) {
3402
- return b(h, c);
3459
+ t.isNumberObject = Ae;
3460
+ function ot(y) {
3461
+ return b(y, c);
3403
3462
  }
3404
3463
  t.isStringObject = ot;
3405
- function Ne(h) {
3406
- return b(h, f);
3464
+ function Ne(y) {
3465
+ return b(y, f);
3407
3466
  }
3408
3467
  t.isBooleanObject = Ne;
3409
- function st(h) {
3410
- return s && b(h, y);
3468
+ function st(y) {
3469
+ return s && b(y, p);
3411
3470
  }
3412
3471
  t.isBigIntObject = st;
3413
- function vr(h) {
3414
- return a && b(h, m);
3472
+ function vr(y) {
3473
+ return a && b(y, m);
3415
3474
  }
3416
3475
  t.isSymbolObject = vr;
3417
- function zn(h) {
3418
- return we(h) || ot(h) || Ne(h) || st(h) || vr(h);
3476
+ function zn(y) {
3477
+ return Ae(y) || ot(y) || Ne(y) || st(y) || vr(y);
3419
3478
  }
3420
3479
  t.isBoxedPrimitive = zn;
3421
- function Kn(h) {
3422
- return typeof Uint8Array < "u" && (it(h) || C(h));
3480
+ function Hn(y) {
3481
+ return typeof Uint8Array < "u" && (it(y) || C(y));
3423
3482
  }
3424
- t.isAnyArrayBuffer = Kn, ["isProxy", "isExternal", "isModuleNamespaceObject"].forEach(function(h) {
3425
- Object.defineProperty(t, h, {
3483
+ t.isAnyArrayBuffer = Hn, ["isProxy", "isExternal", "isModuleNamespaceObject"].forEach(function(y) {
3484
+ Object.defineProperty(t, y, {
3426
3485
  enumerable: !1,
3427
3486
  value: function() {
3428
- throw new Error(h + " is not supported in userland");
3487
+ throw new Error(y + " is not supported in userland");
3429
3488
  }
3430
3489
  });
3431
3490
  });
3432
- })(On);
3433
- var sa = function(e) {
3491
+ })(Cn);
3492
+ var aa = function(e) {
3434
3493
  return e && typeof e == "object" && typeof e.copy == "function" && typeof e.fill == "function" && typeof e.readUInt8 == "function";
3435
3494
  }, nr = { exports: {} };
3436
3495
  typeof Object.create == "function" ? nr.exports = function(e, r) {
@@ -3450,18 +3509,18 @@ typeof Object.create == "function" ? nr.exports = function(e, r) {
3450
3509
  n.prototype = r.prototype, e.prototype = new n(), e.prototype.constructor = e;
3451
3510
  }
3452
3511
  };
3453
- var aa = nr.exports;
3512
+ var ua = nr.exports;
3454
3513
  (function(t) {
3455
- var e = Object.getOwnPropertyDescriptors || function(p) {
3456
- for (var g = Object.keys(p), v = {}, C = 0; C < g.length; C++)
3457
- v[g[C]] = Object.getOwnPropertyDescriptor(p, g[C]);
3514
+ var e = Object.getOwnPropertyDescriptors || function(h) {
3515
+ for (var g = Object.keys(h), v = {}, C = 0; C < g.length; C++)
3516
+ v[g[C]] = Object.getOwnPropertyDescriptor(h, g[C]);
3458
3517
  return v;
3459
3518
  }, r = /%[sdj%]/g;
3460
3519
  t.format = function(l) {
3461
3520
  if (!_(l)) {
3462
- for (var p = [], g = 0; g < arguments.length; g++)
3463
- p.push(s(arguments[g]));
3464
- return p.join(" ");
3521
+ for (var h = [], g = 0; g < arguments.length; g++)
3522
+ h.push(s(arguments[g]));
3523
+ return h.join(" ");
3465
3524
  }
3466
3525
  for (var g = 1, v = arguments, C = v.length, L = String(l).replace(r, function(O) {
3467
3526
  if (O === "%%")
@@ -3483,21 +3542,21 @@ var aa = nr.exports;
3483
3542
  return O;
3484
3543
  }
3485
3544
  }), w = v[g]; g < C; w = v[++g])
3486
- $(w) || !Z(w) ? L += " " + w : L += " " + s(w);
3545
+ V(w) || !Z(w) ? L += " " + w : L += " " + s(w);
3487
3546
  return L;
3488
- }, t.deprecate = function(l, p) {
3547
+ }, t.deprecate = function(l, h) {
3489
3548
  if (typeof S < "u" && S.noDeprecation === !0)
3490
3549
  return l;
3491
3550
  if (typeof S > "u")
3492
3551
  return function() {
3493
- return t.deprecate(l, p).apply(this, arguments);
3552
+ return t.deprecate(l, h).apply(this, arguments);
3494
3553
  };
3495
3554
  var g = !1;
3496
3555
  function v() {
3497
3556
  if (!g) {
3498
3557
  if (S.throwDeprecation)
3499
- throw new Error(p);
3500
- S.traceDeprecation ? console.trace(p) : console.error(p), g = !0;
3558
+ throw new Error(h);
3559
+ S.traceDeprecation ? console.trace(h) : console.error(h), g = !0;
3501
3560
  }
3502
3561
  return l.apply(this, arguments);
3503
3562
  }
@@ -3511,22 +3570,22 @@ var aa = nr.exports;
3511
3570
  t.debuglog = function(l) {
3512
3571
  if (l = l.toUpperCase(), !n[l])
3513
3572
  if (i.test(l)) {
3514
- var p = S.pid;
3573
+ var h = S.pid;
3515
3574
  n[l] = function() {
3516
3575
  var g = t.format.apply(t, arguments);
3517
- console.error("%s %d: %s", l, p, g);
3576
+ console.error("%s %d: %s", l, h, g);
3518
3577
  };
3519
3578
  } else
3520
3579
  n[l] = function() {
3521
3580
  };
3522
3581
  return n[l];
3523
3582
  };
3524
- function s(l, p) {
3583
+ function s(l, h) {
3525
3584
  var g = {
3526
3585
  seen: [],
3527
3586
  stylize: u
3528
3587
  };
3529
- return arguments.length >= 3 && (g.depth = arguments[2]), arguments.length >= 4 && (g.colors = arguments[3]), F(p) ? g.showHidden = p : p && t._extend(g, p), E(g.showHidden) && (g.showHidden = !1), E(g.depth) && (g.depth = 2), E(g.colors) && (g.colors = !1), E(g.customInspect) && (g.customInspect = !0), g.colors && (g.stylize = a), c(g, l, g.depth);
3588
+ return arguments.length >= 3 && (g.depth = arguments[2]), arguments.length >= 4 && (g.colors = arguments[3]), F(h) ? g.showHidden = h : h && t._extend(g, h), I(g.showHidden) && (g.showHidden = !1), I(g.depth) && (g.depth = 2), I(g.colors) && (g.colors = !1), I(g.customInspect) && (g.customInspect = !0), g.colors && (g.stylize = a), c(g, l, g.depth);
3530
3589
  }
3531
3590
  t.inspect = s, s.colors = {
3532
3591
  bold: [1, 22],
@@ -3553,81 +3612,81 @@ var aa = nr.exports;
3553
3612
  // "name": intentionally not styling
3554
3613
  regexp: "red"
3555
3614
  };
3556
- function a(l, p) {
3557
- var g = s.styles[p];
3615
+ function a(l, h) {
3616
+ var g = s.styles[h];
3558
3617
  return g ? "\x1B[" + s.colors[g][0] + "m" + l + "\x1B[" + s.colors[g][1] + "m" : l;
3559
3618
  }
3560
- function u(l, p) {
3619
+ function u(l, h) {
3561
3620
  return l;
3562
3621
  }
3563
3622
  function d(l) {
3564
- var p = {};
3623
+ var h = {};
3565
3624
  return l.forEach(function(g, v) {
3566
- p[g] = !0;
3567
- }), p;
3568
- }
3569
- function c(l, p, g) {
3570
- if (l.customInspect && p && se(p.inspect) && // Filter out the util module, it's inspect function is special
3571
- p.inspect !== t.inspect && // Also filter out any prototype objects using the circular check.
3572
- !(p.constructor && p.constructor.prototype === p)) {
3573
- var v = p.inspect(g, l);
3625
+ h[g] = !0;
3626
+ }), h;
3627
+ }
3628
+ function c(l, h, g) {
3629
+ if (l.customInspect && h && oe(h.inspect) && // Filter out the util module, it's inspect function is special
3630
+ h.inspect !== t.inspect && // Also filter out any prototype objects using the circular check.
3631
+ !(h.constructor && h.constructor.prototype === h)) {
3632
+ var v = h.inspect(g, l);
3574
3633
  return _(v) || (v = c(l, v, g)), v;
3575
3634
  }
3576
- var C = f(l, p);
3635
+ var C = f(l, h);
3577
3636
  if (C)
3578
3637
  return C;
3579
- var L = Object.keys(p), w = d(L);
3580
- if (l.showHidden && (L = Object.getOwnPropertyNames(p)), Se(p) && (L.indexOf("message") >= 0 || L.indexOf("description") >= 0))
3581
- return y(p);
3638
+ var L = Object.keys(h), w = d(L);
3639
+ if (l.showHidden && (L = Object.getOwnPropertyNames(h)), we(h) && (L.indexOf("message") >= 0 || L.indexOf("description") >= 0))
3640
+ return p(h);
3582
3641
  if (L.length === 0) {
3583
- if (se(p)) {
3584
- var O = p.name ? ": " + p.name : "";
3642
+ if (oe(h)) {
3643
+ var O = h.name ? ": " + h.name : "";
3585
3644
  return l.stylize("[Function" + O + "]", "special");
3586
3645
  }
3587
- if (X(p))
3588
- return l.stylize(RegExp.prototype.toString.call(p), "regexp");
3589
- if (_e(p))
3590
- return l.stylize(Date.prototype.toString.call(p), "date");
3591
- if (Se(p))
3592
- return y(p);
3646
+ if (X(h))
3647
+ return l.stylize(RegExp.prototype.toString.call(h), "regexp");
3648
+ if (_e(h))
3649
+ return l.stylize(Date.prototype.toString.call(h), "date");
3650
+ if (we(h))
3651
+ return p(h);
3593
3652
  }
3594
- var P = "", G = !1, we = ["{", "}"];
3595
- if (I(p) && (G = !0, we = ["[", "]"]), se(p)) {
3596
- var ot = p.name ? ": " + p.name : "";
3653
+ var P = "", G = !1, Ae = ["{", "}"];
3654
+ if (E(h) && (G = !0, Ae = ["[", "]"]), oe(h)) {
3655
+ var ot = h.name ? ": " + h.name : "";
3597
3656
  P = " [Function" + ot + "]";
3598
3657
  }
3599
- if (X(p) && (P = " " + RegExp.prototype.toString.call(p)), _e(p) && (P = " " + Date.prototype.toUTCString.call(p)), Se(p) && (P = " " + y(p)), L.length === 0 && (!G || p.length == 0))
3600
- return we[0] + P + we[1];
3658
+ if (X(h) && (P = " " + RegExp.prototype.toString.call(h)), _e(h) && (P = " " + Date.prototype.toUTCString.call(h)), we(h) && (P = " " + p(h)), L.length === 0 && (!G || h.length == 0))
3659
+ return Ae[0] + P + Ae[1];
3601
3660
  if (g < 0)
3602
- return X(p) ? l.stylize(RegExp.prototype.toString.call(p), "regexp") : l.stylize("[Object]", "special");
3603
- l.seen.push(p);
3661
+ return X(h) ? l.stylize(RegExp.prototype.toString.call(h), "regexp") : l.stylize("[Object]", "special");
3662
+ l.seen.push(h);
3604
3663
  var Ne;
3605
- return G ? Ne = m(l, p, g, w, L) : Ne = L.map(function(st) {
3606
- return b(l, p, g, w, st, G);
3607
- }), l.seen.pop(), T(Ne, P, we);
3664
+ return G ? Ne = m(l, h, g, w, L) : Ne = L.map(function(st) {
3665
+ return b(l, h, g, w, st, G);
3666
+ }), l.seen.pop(), T(Ne, P, Ae);
3608
3667
  }
3609
- function f(l, p) {
3610
- if (E(p))
3668
+ function f(l, h) {
3669
+ if (I(h))
3611
3670
  return l.stylize("undefined", "undefined");
3612
- if (_(p)) {
3613
- var g = "'" + JSON.stringify(p).replace(/^"|"$/g, "").replace(/'/g, "\\'").replace(/\\"/g, '"') + "'";
3671
+ if (_(h)) {
3672
+ var g = "'" + JSON.stringify(h).replace(/^"|"$/g, "").replace(/'/g, "\\'").replace(/\\"/g, '"') + "'";
3614
3673
  return l.stylize(g, "string");
3615
3674
  }
3616
- if (J(p))
3617
- return l.stylize("" + p, "number");
3618
- if (F(p))
3619
- return l.stylize("" + p, "boolean");
3620
- if ($(p))
3675
+ if (J(h))
3676
+ return l.stylize("" + h, "number");
3677
+ if (F(h))
3678
+ return l.stylize("" + h, "boolean");
3679
+ if (V(h))
3621
3680
  return l.stylize("null", "null");
3622
3681
  }
3623
- function y(l) {
3682
+ function p(l) {
3624
3683
  return "[" + Error.prototype.toString.call(l) + "]";
3625
3684
  }
3626
- function m(l, p, g, v, C) {
3627
- for (var L = [], w = 0, O = p.length; w < O; ++w)
3628
- Pe(p, String(w)) ? L.push(b(
3685
+ function m(l, h, g, v, C) {
3686
+ for (var L = [], w = 0, O = h.length; w < O; ++w)
3687
+ Pe(h, String(w)) ? L.push(b(
3629
3688
  l,
3630
- p,
3689
+ h,
3631
3690
  g,
3632
3691
  v,
3633
3692
  String(w),
@@ -3636,7 +3695,7 @@ var aa = nr.exports;
3636
3695
  return C.forEach(function(P) {
3637
3696
  P.match(/^\d+$/) || L.push(b(
3638
3697
  l,
3639
- p,
3698
+ h,
3640
3699
  g,
3641
3700
  v,
3642
3701
  P,
@@ -3644,9 +3703,9 @@ var aa = nr.exports;
3644
3703
  ));
3645
3704
  }), L;
3646
3705
  }
3647
- function b(l, p, g, v, C, L) {
3706
+ function b(l, h, g, v, C, L) {
3648
3707
  var w, O, P;
3649
- if (P = Object.getOwnPropertyDescriptor(p, C) || { value: p[C] }, P.get ? P.set ? O = l.stylize("[Getter/Setter]", "special") : O = l.stylize("[Getter]", "special") : P.set && (O = l.stylize("[Setter]", "special")), Pe(v, C) || (w = "[" + C + "]"), O || (l.seen.indexOf(P.value) < 0 ? ($(g) ? O = c(l, P.value, null) : O = c(l, P.value, g - 1), O.indexOf(`
3708
+ if (P = Object.getOwnPropertyDescriptor(h, C) || { value: h[C] }, P.get ? P.set ? O = l.stylize("[Getter/Setter]", "special") : O = l.stylize("[Getter]", "special") : P.set && (O = l.stylize("[Setter]", "special")), Pe(v, C) || (w = "[" + C + "]"), O || (l.seen.indexOf(P.value) < 0 ? (V(g) ? O = c(l, P.value, null) : O = c(l, P.value, g - 1), O.indexOf(`
3650
3709
  `) > -1 && (L ? O = O.split(`
3651
3710
  `).map(function(G) {
3652
3711
  return " " + G;
@@ -3656,35 +3715,35 @@ var aa = nr.exports;
3656
3715
  `).map(function(G) {
3657
3716
  return " " + G;
3658
3717
  }).join(`
3659
- `))) : O = l.stylize("[Circular]", "special")), E(w)) {
3718
+ `))) : O = l.stylize("[Circular]", "special")), I(w)) {
3660
3719
  if (L && C.match(/^\d+$/))
3661
3720
  return O;
3662
3721
  w = JSON.stringify("" + C), w.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/) ? (w = w.slice(1, -1), w = l.stylize(w, "name")) : (w = w.replace(/'/g, "\\'").replace(/\\"/g, '"').replace(/(^"|"$)/g, "'"), w = l.stylize(w, "string"));
3663
3722
  }
3664
3723
  return w + ": " + O;
3665
3724
  }
3666
- function T(l, p, g) {
3725
+ function T(l, h, g) {
3667
3726
  var v = l.reduce(function(C, L) {
3668
3727
  return L.indexOf(`
3669
3728
  `) >= 0, C + L.replace(/\u001b\[\d\d?m/g, "").length + 1;
3670
3729
  }, 0);
3671
- return v > 60 ? g[0] + (p === "" ? "" : p + `
3730
+ return v > 60 ? g[0] + (h === "" ? "" : h + `
3672
3731
  `) + " " + l.join(`,
3673
- `) + " " + g[1] : g[0] + p + " " + l.join(", ") + " " + g[1];
3732
+ `) + " " + g[1] : g[0] + h + " " + l.join(", ") + " " + g[1];
3674
3733
  }
3675
- t.types = On;
3676
- function I(l) {
3734
+ t.types = Cn;
3735
+ function E(l) {
3677
3736
  return Array.isArray(l);
3678
3737
  }
3679
- t.isArray = I;
3738
+ t.isArray = E;
3680
3739
  function F(l) {
3681
3740
  return typeof l == "boolean";
3682
3741
  }
3683
3742
  t.isBoolean = F;
3684
- function $(l) {
3743
+ function V(l) {
3685
3744
  return l === null;
3686
3745
  }
3687
- t.isNull = $;
3746
+ t.isNull = V;
3688
3747
  function q(l) {
3689
3748
  return l == null;
3690
3749
  }
@@ -3701,12 +3760,12 @@ var aa = nr.exports;
3701
3760
  return typeof l == "symbol";
3702
3761
  }
3703
3762
  t.isSymbol = R;
3704
- function E(l) {
3763
+ function I(l) {
3705
3764
  return l === void 0;
3706
3765
  }
3707
- t.isUndefined = E;
3766
+ t.isUndefined = I;
3708
3767
  function X(l) {
3709
- return Z(l) && ge(l) === "[object RegExp]";
3768
+ return Z(l) && me(l) === "[object RegExp]";
3710
3769
  }
3711
3770
  t.isRegExp = X, t.types.isRegExp = X;
3712
3771
  function Z(l) {
@@ -3714,23 +3773,23 @@ var aa = nr.exports;
3714
3773
  }
3715
3774
  t.isObject = Z;
3716
3775
  function _e(l) {
3717
- return Z(l) && ge(l) === "[object Date]";
3776
+ return Z(l) && me(l) === "[object Date]";
3718
3777
  }
3719
3778
  t.isDate = _e, t.types.isDate = _e;
3720
- function Se(l) {
3721
- return Z(l) && (ge(l) === "[object Error]" || l instanceof Error);
3779
+ function we(l) {
3780
+ return Z(l) && (me(l) === "[object Error]" || l instanceof Error);
3722
3781
  }
3723
- t.isError = Se, t.types.isNativeError = Se;
3724
- function se(l) {
3782
+ t.isError = we, t.types.isNativeError = we;
3783
+ function oe(l) {
3725
3784
  return typeof l == "function";
3726
3785
  }
3727
- t.isFunction = se;
3786
+ t.isFunction = oe;
3728
3787
  function _t(l) {
3729
3788
  return l === null || typeof l == "boolean" || typeof l == "number" || typeof l == "string" || typeof l == "symbol" || // ES6 symbol
3730
3789
  typeof l > "u";
3731
3790
  }
3732
- t.isPrimitive = _t, t.isBuffer = sa;
3733
- function ge(l) {
3791
+ t.isPrimitive = _t, t.isBuffer = aa;
3792
+ function me(l) {
3734
3793
  return Object.prototype.toString.call(l);
3735
3794
  }
3736
3795
  function He(l) {
@@ -3751,34 +3810,34 @@ var aa = nr.exports;
3751
3810
  "Dec"
3752
3811
  ];
3753
3812
  function kt() {
3754
- var l = /* @__PURE__ */ new Date(), p = [
3813
+ var l = /* @__PURE__ */ new Date(), h = [
3755
3814
  He(l.getHours()),
3756
3815
  He(l.getMinutes()),
3757
3816
  He(l.getSeconds())
3758
3817
  ].join(":");
3759
- return [l.getDate(), ke[l.getMonth()], p].join(" ");
3818
+ return [l.getDate(), ke[l.getMonth()], h].join(" ");
3760
3819
  }
3761
3820
  t.log = function() {
3762
3821
  console.log("%s - %s", kt(), t.format.apply(t, arguments));
3763
- }, t.inherits = aa, t._extend = function(l, p) {
3764
- if (!p || !Z(p))
3822
+ }, t.inherits = ua, t._extend = function(l, h) {
3823
+ if (!h || !Z(h))
3765
3824
  return l;
3766
- for (var g = Object.keys(p), v = g.length; v--; )
3767
- l[g[v]] = p[g[v]];
3825
+ for (var g = Object.keys(h), v = g.length; v--; )
3826
+ l[g[v]] = h[g[v]];
3768
3827
  return l;
3769
3828
  };
3770
- function Pe(l, p) {
3771
- return Object.prototype.hasOwnProperty.call(l, p);
3829
+ function Pe(l, h) {
3830
+ return Object.prototype.hasOwnProperty.call(l, h);
3772
3831
  }
3773
- var ae = typeof Symbol < "u" ? Symbol("util.promisify.custom") : void 0;
3774
- t.promisify = function(p) {
3775
- if (typeof p != "function")
3832
+ var se = typeof Symbol < "u" ? Symbol("util.promisify.custom") : void 0;
3833
+ t.promisify = function(h) {
3834
+ if (typeof h != "function")
3776
3835
  throw new TypeError('The "original" argument must be of type Function');
3777
- if (ae && p[ae]) {
3778
- var g = p[ae];
3836
+ if (se && h[se]) {
3837
+ var g = h[se];
3779
3838
  if (typeof g != "function")
3780
3839
  throw new TypeError('The "util.promisify.custom" argument must be of type Function');
3781
- return Object.defineProperty(g, ae, {
3840
+ return Object.defineProperty(g, se, {
3782
3841
  value: g,
3783
3842
  enumerable: !1,
3784
3843
  writable: !1,
@@ -3794,33 +3853,33 @@ var aa = nr.exports;
3794
3853
  P ? C(P) : v(G);
3795
3854
  });
3796
3855
  try {
3797
- p.apply(this, w);
3856
+ h.apply(this, w);
3798
3857
  } catch (P) {
3799
3858
  C(P);
3800
3859
  }
3801
3860
  return L;
3802
3861
  }
3803
- return Object.setPrototypeOf(g, Object.getPrototypeOf(p)), ae && Object.defineProperty(g, ae, {
3862
+ return Object.setPrototypeOf(g, Object.getPrototypeOf(h)), se && Object.defineProperty(g, se, {
3804
3863
  value: g,
3805
3864
  enumerable: !1,
3806
3865
  writable: !1,
3807
3866
  configurable: !0
3808
3867
  }), Object.defineProperties(
3809
3868
  g,
3810
- e(p)
3869
+ e(h)
3811
3870
  );
3812
- }, t.promisify.custom = ae;
3813
- function Fe(l, p) {
3871
+ }, t.promisify.custom = se;
3872
+ function Fe(l, h) {
3814
3873
  if (!l) {
3815
3874
  var g = new Error("Promise was rejected with a falsy value");
3816
3875
  g.reason = l, l = g;
3817
3876
  }
3818
- return p(l);
3877
+ return h(l);
3819
3878
  }
3820
3879
  function it(l) {
3821
3880
  if (typeof l != "function")
3822
3881
  throw new TypeError('The "original" argument must be of type Function');
3823
- function p() {
3882
+ function h() {
3824
3883
  for (var g = [], v = 0; v < arguments.length; v++)
3825
3884
  g.push(arguments[v]);
3826
3885
  var C = g.pop();
@@ -3838,15 +3897,15 @@ var aa = nr.exports;
3838
3897
  }
3839
3898
  );
3840
3899
  }
3841
- return Object.setPrototypeOf(p, Object.getPrototypeOf(l)), Object.defineProperties(
3842
- p,
3900
+ return Object.setPrototypeOf(h, Object.getPrototypeOf(l)), Object.defineProperties(
3901
+ h,
3843
3902
  e(l)
3844
- ), p;
3903
+ ), h;
3845
3904
  }
3846
3905
  t.callbackify = it;
3847
3906
  })(Ct);
3848
- const { inherits: ua, format: jt } = Ct;
3849
- function Ae(t, e, r = Error) {
3907
+ const { inherits: ca, format: jt } = Ct;
3908
+ function Ie(t, e, r = Error) {
3850
3909
  if (!t)
3851
3910
  throw new Error("Avvio error code must not be empty");
3852
3911
  if (!e)
@@ -3858,35 +3917,35 @@ function Ae(t, e, r = Error) {
3858
3917
  }
3859
3918
  return n.prototype[Symbol.toStringTag] = "Error", n.prototype.toString = function() {
3860
3919
  return `${this.name} [${this.code}]: ${this.message}`;
3861
- }, ua(n, r), n;
3920
+ }, ca(n, r), n;
3862
3921
  }
3863
- var Bn = {
3864
- createError: Ae,
3865
- AVV_ERR_EXPOSE_ALREADY_DEFINED: Ae(
3922
+ var qn = {
3923
+ createError: Ie,
3924
+ AVV_ERR_EXPOSE_ALREADY_DEFINED: Ie(
3866
3925
  "AVV_ERR_EXPOSE_ALREADY_DEFINED",
3867
3926
  "'%s' () is already defined, specify an expose option"
3868
3927
  ),
3869
- AVV_ERR_CALLBACK_NOT_FN: Ae(
3928
+ AVV_ERR_CALLBACK_NOT_FN: Ie(
3870
3929
  "AVV_ERR_CALLBACK_NOT_FN",
3871
3930
  "Callback for '%s' hook is not a function. Received: '%s'"
3872
3931
  ),
3873
- AVV_ERR_PLUGIN_NOT_VALID: Ae(
3932
+ AVV_ERR_PLUGIN_NOT_VALID: Ie(
3874
3933
  "AVV_ERR_PLUGIN_NOT_VALID",
3875
3934
  "Plugin must be a function or a promise. Received: '%s'"
3876
3935
  ),
3877
- AVV_ERR_ROOT_PLG_BOOTED: Ae(
3936
+ AVV_ERR_ROOT_PLG_BOOTED: Ie(
3878
3937
  "AVV_ERR_PLUGIN_NOT_VALID",
3879
3938
  "Root plugin has already booted"
3880
3939
  ),
3881
- AVV_ERR_PARENT_PLG_LOADED: Ae(
3940
+ AVV_ERR_PARENT_PLG_LOADED: Ie(
3882
3941
  "AVV_ERR_PARENT_PLG_LOADED",
3883
3942
  "Impossible to load '%s' plugin because the parent '%s' was already loaded"
3884
3943
  ),
3885
- AVV_ERR_READY_TIMEOUT: Ae(
3944
+ AVV_ERR_READY_TIMEOUT: Ie(
3886
3945
  "AVV_ERR_READY_TIMEOUT",
3887
3946
  "Plugin did not start in time: '%s'. You may have forgotten to call 'done' function or to resolve a Promise"
3888
3947
  )
3889
- }, ca = function t(e, r, n) {
3948
+ }, la = function t(e, r, n) {
3890
3949
  r === void 0 && (r = ""), n || (n = {});
3891
3950
  var i = function(u) {
3892
3951
  var d = {
@@ -3904,16 +3963,16 @@ var Bn = {
3904
3963
  ` + r + (o.length ? i("│") : " ") + " ";
3905
3964
  return r + s.join(a) + `
3906
3965
  ` + o.map(function(u, d) {
3907
- var c = d === o.length - 1, f = u.nodes && u.nodes.length, y = r + (c ? " " : i("│")) + " ";
3908
- return r + i(c ? "└" : "├") + i("─") + i(f ? "┬" : "─") + " " + t(u, y, n).slice(r.length + 2);
3966
+ var c = d === o.length - 1, f = u.nodes && u.nodes.length, p = r + (c ? " " : i("│")) + " ";
3967
+ return r + i(c ? "└" : "├") + i("─") + i(f ? "┬" : "─") + " " + t(u, p, n).slice(r.length + 2);
3909
3968
  }).join("");
3910
3969
  };
3911
- const la = ca, Jr = Symbol("avvio.TimeTree.untrackNode"), Ut = Symbol("avvio.TimeTree.trackNode"), Yr = Symbol("avvio.TimeTree.getParent"), Xr = Symbol("avvio.TimeTree.getNode"), Zr = Symbol("avvio.TimeTree.addNode");
3912
- let da = class {
3970
+ const da = la, Jr = Symbol("avvio.TimeTree.untrackNode"), Mt = Symbol("avvio.TimeTree.trackNode"), Yr = Symbol("avvio.TimeTree.getParent"), Xr = Symbol("avvio.TimeTree.getNode"), Zr = Symbol("avvio.TimeTree.addNode");
3971
+ let fa = class {
3913
3972
  constructor() {
3914
3973
  this.root = null, this.tableId = /* @__PURE__ */ new Map(), this.tableLabel = /* @__PURE__ */ new Map();
3915
3974
  }
3916
- [Ut](e) {
3975
+ [Mt](e) {
3917
3976
  this.tableId.set(e.id, e), this.tableLabel.has(e.label) ? this.tableLabel.get(e.label).push(e) : this.tableLabel.set(e.label, [e]);
3918
3977
  }
3919
3978
  [Jr](e) {
@@ -3941,7 +4000,7 @@ let da = class {
3941
4000
  label: r,
3942
4001
  start: n,
3943
4002
  nodes: []
3944
- }, this[Ut](this.root), this.root.id;
4003
+ }, this[Mt](this.root), this.root.id;
3945
4004
  const o = this[Yr](e), s = `${r}-${Math.random()}`, a = {
3946
4005
  id: s,
3947
4006
  parent: e,
@@ -3949,7 +4008,7 @@ let da = class {
3949
4008
  label: r,
3950
4009
  nodes: []
3951
4010
  };
3952
- return o.nodes.push(a), this[Ut](a), s;
4011
+ return o.nodes.push(a), this[Mt](a), s;
3953
4012
  }
3954
4013
  start(e, r, n = Date.now()) {
3955
4014
  return this[Zr](e, r, n);
@@ -3963,21 +4022,21 @@ let da = class {
3963
4022
  }
3964
4023
  prittyPrint() {
3965
4024
  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());
3966
- return la(r);
4025
+ return da(r);
3967
4026
  }
3968
4027
  };
3969
- var fa = da, mr = { exports: {} }, ir = { exports: {} }, Mt, en;
4028
+ var ha = fa, mr = { exports: {} }, ir = { exports: {} }, Ut, en;
3970
4029
  function pa() {
3971
4030
  if (en)
3972
- return Mt;
4031
+ return Ut;
3973
4032
  en = 1;
3974
4033
  var t = 1e3, e = t * 60, r = e * 60, n = r * 24, i = n * 7, o = n * 365.25;
3975
- Mt = function(c, f) {
4034
+ Ut = function(c, f) {
3976
4035
  f = f || {};
3977
- var y = typeof c;
3978
- if (y === "string" && c.length > 0)
4036
+ var p = typeof c;
4037
+ if (p === "string" && c.length > 0)
3979
4038
  return s(c);
3980
- if (y === "number" && isFinite(c))
4039
+ if (p === "number" && isFinite(c))
3981
4040
  return f.long ? u(c) : a(c);
3982
4041
  throw new Error(
3983
4042
  "val is not a non-empty string or a valid number. val=" + JSON.stringify(c)
@@ -3989,46 +4048,46 @@ function pa() {
3989
4048
  c
3990
4049
  );
3991
4050
  if (f) {
3992
- var y = parseFloat(f[1]), m = (f[2] || "ms").toLowerCase();
4051
+ var p = parseFloat(f[1]), m = (f[2] || "ms").toLowerCase();
3993
4052
  switch (m) {
3994
4053
  case "years":
3995
4054
  case "year":
3996
4055
  case "yrs":
3997
4056
  case "yr":
3998
4057
  case "y":
3999
- return y * o;
4058
+ return p * o;
4000
4059
  case "weeks":
4001
4060
  case "week":
4002
4061
  case "w":
4003
- return y * i;
4062
+ return p * i;
4004
4063
  case "days":
4005
4064
  case "day":
4006
4065
  case "d":
4007
- return y * n;
4066
+ return p * n;
4008
4067
  case "hours":
4009
4068
  case "hour":
4010
4069
  case "hrs":
4011
4070
  case "hr":
4012
4071
  case "h":
4013
- return y * r;
4072
+ return p * r;
4014
4073
  case "minutes":
4015
4074
  case "minute":
4016
4075
  case "mins":
4017
4076
  case "min":
4018
4077
  case "m":
4019
- return y * e;
4078
+ return p * e;
4020
4079
  case "seconds":
4021
4080
  case "second":
4022
4081
  case "secs":
4023
4082
  case "sec":
4024
4083
  case "s":
4025
- return y * t;
4084
+ return p * t;
4026
4085
  case "milliseconds":
4027
4086
  case "millisecond":
4028
4087
  case "msecs":
4029
4088
  case "msec":
4030
4089
  case "ms":
4031
- return y;
4090
+ return p;
4032
4091
  default:
4033
4092
  return;
4034
4093
  }
@@ -4043,62 +4102,62 @@ function pa() {
4043
4102
  var f = Math.abs(c);
4044
4103
  return f >= n ? d(c, f, n, "day") : f >= r ? d(c, f, r, "hour") : f >= e ? d(c, f, e, "minute") : f >= t ? d(c, f, t, "second") : c + " ms";
4045
4104
  }
4046
- function d(c, f, y, m) {
4047
- var b = f >= y * 1.5;
4048
- return Math.round(c / y) + " " + m + (b ? "s" : "");
4105
+ function d(c, f, p, m) {
4106
+ var b = f >= p * 1.5;
4107
+ return Math.round(c / p) + " " + m + (b ? "s" : "");
4049
4108
  }
4050
- return Mt;
4109
+ return Ut;
4051
4110
  }
4052
- function ha(t) {
4111
+ function ya(t) {
4053
4112
  r.debug = r, r.default = r, r.coerce = u, r.disable = o, r.enable = i, r.enabled = s, r.humanize = pa(), r.destroy = d, Object.keys(t).forEach((c) => {
4054
4113
  r[c] = t[c];
4055
4114
  }), r.names = [], r.skips = [], r.formatters = {};
4056
4115
  function e(c) {
4057
4116
  let f = 0;
4058
- for (let y = 0; y < c.length; y++)
4059
- f = (f << 5) - f + c.charCodeAt(y), f |= 0;
4117
+ for (let p = 0; p < c.length; p++)
4118
+ f = (f << 5) - f + c.charCodeAt(p), f |= 0;
4060
4119
  return r.colors[Math.abs(f) % r.colors.length];
4061
4120
  }
4062
4121
  r.selectColor = e;
4063
4122
  function r(c) {
4064
- let f, y = null, m, b;
4065
- function T(...I) {
4123
+ let f, p = null, m, b;
4124
+ function T(...E) {
4066
4125
  if (!T.enabled)
4067
4126
  return;
4068
- const F = T, $ = Number(/* @__PURE__ */ new Date()), q = $ - (f || $);
4069
- F.diff = q, F.prev = f, F.curr = $, f = $, I[0] = r.coerce(I[0]), typeof I[0] != "string" && I.unshift("%O");
4127
+ const F = T, V = Number(/* @__PURE__ */ new Date()), q = V - (f || V);
4128
+ F.diff = q, F.prev = f, F.curr = V, f = V, E[0] = r.coerce(E[0]), typeof E[0] != "string" && E.unshift("%O");
4070
4129
  let J = 0;
4071
- I[0] = I[0].replace(/%([a-zA-Z%])/g, (R, E) => {
4130
+ E[0] = E[0].replace(/%([a-zA-Z%])/g, (R, I) => {
4072
4131
  if (R === "%%")
4073
4132
  return "%";
4074
4133
  J++;
4075
- const X = r.formatters[E];
4134
+ const X = r.formatters[I];
4076
4135
  if (typeof X == "function") {
4077
- const Z = I[J];
4078
- R = X.call(F, Z), I.splice(J, 1), J--;
4136
+ const Z = E[J];
4137
+ R = X.call(F, Z), E.splice(J, 1), J--;
4079
4138
  }
4080
4139
  return R;
4081
- }), r.formatArgs.call(F, I), (F.log || r.log).apply(F, I);
4140
+ }), r.formatArgs.call(F, E), (F.log || r.log).apply(F, E);
4082
4141
  }
4083
4142
  return T.namespace = c, T.useColors = r.useColors(), T.color = r.selectColor(c), T.extend = n, T.destroy = r.destroy, Object.defineProperty(T, "enabled", {
4084
4143
  enumerable: !0,
4085
4144
  configurable: !1,
4086
- get: () => y !== null ? y : (m !== r.namespaces && (m = r.namespaces, b = r.enabled(c)), b),
4087
- set: (I) => {
4088
- y = I;
4145
+ get: () => p !== null ? p : (m !== r.namespaces && (m = r.namespaces, b = r.enabled(c)), b),
4146
+ set: (E) => {
4147
+ p = E;
4089
4148
  }
4090
4149
  }), typeof r.init == "function" && r.init(T), T;
4091
4150
  }
4092
4151
  function n(c, f) {
4093
- const y = r(this.namespace + (typeof f > "u" ? ":" : f) + c);
4094
- return y.log = this.log, y;
4152
+ const p = r(this.namespace + (typeof f > "u" ? ":" : f) + c);
4153
+ return p.log = this.log, p;
4095
4154
  }
4096
4155
  function i(c) {
4097
4156
  r.save(c), r.namespaces = c, r.names = [], r.skips = [];
4098
4157
  let f;
4099
- const y = (typeof c == "string" ? c : "").split(/[\s,]+/), m = y.length;
4158
+ const p = (typeof c == "string" ? c : "").split(/[\s,]+/), m = p.length;
4100
4159
  for (f = 0; f < m; f++)
4101
- y[f] && (c = y[f].replace(/\*/g, ".*?"), c[0] === "-" ? r.skips.push(new RegExp("^" + c.slice(1) + "$")) : r.names.push(new RegExp("^" + c + "$")));
4160
+ p[f] && (c = p[f].replace(/\*/g, ".*?"), c[0] === "-" ? r.skips.push(new RegExp("^" + c.slice(1) + "$")) : r.names.push(new RegExp("^" + c + "$")));
4102
4161
  }
4103
4162
  function o() {
4104
4163
  const c = [
@@ -4110,11 +4169,11 @@ function ha(t) {
4110
4169
  function s(c) {
4111
4170
  if (c[c.length - 1] === "*")
4112
4171
  return !0;
4113
- let f, y;
4114
- for (f = 0, y = r.skips.length; f < y; f++)
4172
+ let f, p;
4173
+ for (f = 0, p = r.skips.length; f < p; f++)
4115
4174
  if (r.skips[f].test(c))
4116
4175
  return !1;
4117
- for (f = 0, y = r.names.length; f < y; f++)
4176
+ for (f = 0, p = r.names.length; f < p; f++)
4118
4177
  if (r.names[f].test(c))
4119
4178
  return !0;
4120
4179
  return !1;
@@ -4130,7 +4189,7 @@ function ha(t) {
4130
4189
  }
4131
4190
  return r.enable(r.load()), r;
4132
4191
  }
4133
- var ya = ha;
4192
+ var ga = ya;
4134
4193
  (function(t, e) {
4135
4194
  e.formatArgs = n, e.save = i, e.load = o, e.useColors = r, e.storage = s(), e.destroy = /* @__PURE__ */ (() => {
4136
4195
  let u = !1;
@@ -4228,8 +4287,8 @@ var ya = ha;
4228
4287
  const d = "color: " + this.color;
4229
4288
  u.splice(1, 0, d, "color: inherit");
4230
4289
  let c = 0, f = 0;
4231
- u[0].replace(/%[a-zA-Z%]/g, (y) => {
4232
- y !== "%%" && (c++, y === "%c" && (f = c));
4290
+ u[0].replace(/%[a-zA-Z%]/g, (p) => {
4291
+ p !== "%%" && (c++, p === "%c" && (f = c));
4233
4292
  }), u.splice(f, 0, d);
4234
4293
  }
4235
4294
  e.log = console.debug || console.log || (() => {
@@ -4254,7 +4313,7 @@ var ya = ha;
4254
4313
  } catch {
4255
4314
  }
4256
4315
  }
4257
- t.exports = ya(e);
4316
+ t.exports = ga(e);
4258
4317
  const { formatters: a } = t.exports;
4259
4318
  a.j = function(u) {
4260
4319
  try {
@@ -4264,28 +4323,28 @@ var ya = ha;
4264
4323
  }
4265
4324
  };
4266
4325
  })(ir, ir.exports);
4267
- var qn = ir.exports;
4268
- const ga = gn, ma = Tn.EventEmitter, ba = Ct.inherits, U = qn("avvio"), { AVV_ERR_READY_TIMEOUT: va } = Bn, xt = Symbol.for("plugin-meta");
4269
- function Sa(t, e) {
4326
+ var Qn = ir.exports;
4327
+ const ma = mn, ba = On.EventEmitter, va = Ct.inherits, M = Qn("avvio"), { AVV_ERR_READY_TIMEOUT: Sa } = qn, xt = Symbol.for("plugin-meta");
4328
+ function wa(t, e) {
4270
4329
  return t[xt] && t[xt].name ? t[xt].name : typeof e < "u" && typeof e != "function" && e.name ? e.name : t.name ? t.name : t.toString().split(`
4271
4330
  `).slice(0, 2).map((r) => r.trim()).join(" -- ");
4272
4331
  }
4273
- function wa() {
4332
+ function Aa() {
4274
4333
  const t = {};
4275
4334
  return t.promise = new Promise((e, r) => {
4276
4335
  t.resolve = e, t.reject = r;
4277
4336
  }), t;
4278
4337
  }
4279
- function Ke(t, e, r, n, i) {
4280
- 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 = Sa(e, r), this.isAfter = n, this.q = ga(t, Aa, 1), this.q.pause(), this._error = null, this.loaded = !1, this._promise = null;
4338
+ function ze(t, e, r, n, i) {
4339
+ 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 = wa(e, r), this.isAfter = n, this.q = ma(t, Ia, 1), this.q.pause(), this._error = null, this.loaded = !1, this._promise = null;
4281
4340
  }
4282
- ba(Ke, ma);
4283
- Ke.prototype.exec = function(t, e) {
4341
+ va(ze, ba);
4342
+ ze.prototype.exec = function(t, e) {
4284
4343
  const r = this.func;
4285
4344
  let n = !1;
4286
4345
  const i = this.name;
4287
4346
  if (this.parent._error && !this.isAfter) {
4288
- U("skipping loading of plugin as parent errored and it is not an after", i), S.nextTick(e);
4347
+ M("skipping loading of plugin as parent errored and it is not an after", i), S.nextTick(e);
4289
4348
  return;
4290
4349
  }
4291
4350
  if (this.isAfter)
@@ -4294,68 +4353,68 @@ Ke.prototype.exec = function(t, e) {
4294
4353
  try {
4295
4354
  this.server = this.parent.override(t, r, this.opts);
4296
4355
  } catch (u) {
4297
- return U("override errored", i), e(u);
4356
+ return M("override errored", i), e(u);
4298
4357
  }
4299
- this.opts = typeof this.opts == "function" ? this.opts(this.server) : this.opts, U("exec", i);
4358
+ this.opts = typeof this.opts == "function" ? this.opts(this.server) : this.opts, M("exec", i);
4300
4359
  let o;
4301
4360
  const s = (u) => {
4302
4361
  if (n) {
4303
- U("loading complete", i);
4362
+ M("loading complete", i);
4304
4363
  return;
4305
4364
  }
4306
- this._error = u, U(u ? "exec errored" : "exec completed", i), n = !0, o && clearTimeout(o), e(u);
4365
+ this._error = u, M(u ? "exec errored" : "exec completed", i), n = !0, o && clearTimeout(o), e(u);
4307
4366
  };
4308
- this.timeout > 0 && (U("setting up timeout", i, this.timeout), o = setTimeout(function() {
4309
- U("timed out", i), o = null;
4310
- const u = new va(i);
4367
+ this.timeout > 0 && (M("setting up timeout", i, this.timeout), o = setTimeout(function() {
4368
+ M("timed out", i), o = null;
4369
+ const u = new Sa(i);
4311
4370
  u.fn = r, s(u);
4312
4371
  }, this.timeout)), this.started = !0, this.emit("start", this.server ? this.server.name : null, this.name, Date.now());
4313
4372
  const a = r(this.server, this.opts, s);
4314
- a && typeof a.then == "function" && (U("exec: resolving promise", i), a.then(
4373
+ a && typeof a.then == "function" && (M("exec: resolving promise", i), a.then(
4315
4374
  () => S.nextTick(s),
4316
4375
  (u) => S.nextTick(s, u)
4317
4376
  ));
4318
4377
  };
4319
- Ke.prototype.loadedSoFar = function() {
4378
+ ze.prototype.loadedSoFar = function() {
4320
4379
  if (this.loaded)
4321
4380
  return Promise.resolve();
4322
4381
  const t = () => {
4323
4382
  this.server.after((r, n) => {
4324
- this._error = r, this.q.pause(), r ? (U("rejecting promise", this.name, r), this._promise.reject(r)) : (U("resolving promise", this.name), this._promise.resolve()), this._promise = null, S.nextTick(n, r);
4383
+ this._error = r, this.q.pause(), r ? (M("rejecting promise", this.name, r), this._promise.reject(r)) : (M("resolving promise", this.name), this._promise.resolve()), this._promise = null, S.nextTick(n, r);
4325
4384
  }), this.q.resume();
4326
4385
  };
4327
4386
  let e;
4328
- return this._promise ? e = Promise.resolve() : (this._promise = wa(), e = this._promise.promise, this.server ? t() : this.on("start", t)), e;
4387
+ return this._promise ? e = Promise.resolve() : (this._promise = Aa(), e = this._promise.promise, this.server ? t() : this.on("start", t)), e;
4329
4388
  };
4330
- Ke.prototype.enqueue = function(t, e) {
4331
- U("enqueue", this.name, t.name), this.emit("enqueue", this.server ? this.server.name : null, this.name, Date.now()), this.q.push(t, e);
4389
+ ze.prototype.enqueue = function(t, e) {
4390
+ M("enqueue", this.name, t.name), this.emit("enqueue", this.server ? this.server.name : null, this.name, Date.now()), this.q.push(t, e);
4332
4391
  };
4333
- Ke.prototype.finish = function(t, e) {
4334
- U("finish", this.name, t);
4392
+ ze.prototype.finish = function(t, e) {
4393
+ M("finish", this.name, t);
4335
4394
  const r = () => {
4336
- this.loaded || (U("loaded", this.name), this.emit("loaded", this.server ? this.server.name : null, this.name, Date.now()), this.loaded = !0, e(t));
4395
+ this.loaded || (M("loaded", this.name), this.emit("loaded", this.server ? this.server.name : null, this.name, Date.now()), this.loaded = !0, e(t));
4337
4396
  };
4338
4397
  if (t) {
4339
4398
  this._promise && (this._promise.reject(t), this._promise = null), r();
4340
4399
  return;
4341
4400
  }
4342
4401
  const n = () => {
4343
- if (U("check", this.name, this.q.length(), this.q.running(), this._promise), this.q.length() === 0 && this.q.running() === 0)
4402
+ if (M("check", this.name, this.q.length(), this.q.running(), this._promise), this.q.length() === 0 && this.q.running() === 0)
4344
4403
  if (this._promise) {
4345
4404
  const i = () => {
4346
- U("wrap"), queueMicrotask(n);
4405
+ M("wrap"), queueMicrotask(n);
4347
4406
  };
4348
4407
  this._promise.resolve(), this._promise.promise.then(i, i), this._promise = null;
4349
4408
  } else
4350
4409
  r();
4351
4410
  else
4352
- U("delayed", this.name), this.q.drain = () => {
4353
- U("drain", this.name), this.q.drain = Ea, queueMicrotask(n);
4411
+ M("delayed", this.name), this.q.drain = () => {
4412
+ M("drain", this.name), this.q.drain = Ea, queueMicrotask(n);
4354
4413
  };
4355
4414
  };
4356
4415
  queueMicrotask(n), this.q.resume();
4357
4416
  };
4358
- function Aa(t, e) {
4417
+ function Ia(t, e) {
4359
4418
  const r = this;
4360
4419
  S.nextTick(br.bind(r), t, e);
4361
4420
  }
@@ -4375,17 +4434,17 @@ function br(t, e) {
4375
4434
  }
4376
4435
  function Ea() {
4377
4436
  }
4378
- mr.exports = Ke;
4437
+ mr.exports = ze;
4379
4438
  mr.exports.loadPlugin = br;
4380
- var Ia = mr.exports;
4381
- const tn = gn, Ta = Tn.EventEmitter, Oa = Ct.inherits, {
4439
+ var Ta = mr.exports;
4440
+ const tn = mn, Oa = On.EventEmitter, Ca = Ct.inherits, {
4382
4441
  AVV_ERR_EXPOSE_ALREADY_DEFINED: Bt,
4383
4442
  AVV_ERR_CALLBACK_NOT_FN: Ze,
4384
- AVV_ERR_PLUGIN_NOT_VALID: Ca,
4385
- AVV_ERR_ROOT_PLG_BOOTED: La,
4386
- AVV_ERR_READY_TIMEOUT: _a
4387
- } = Bn, ka = fa, or = Ia, Ge = qn("avvio"), wt = Symbol("kAvvio"), qt = Symbol("kThenifyDoNotWrap");
4388
- function Pa(t, e, r) {
4443
+ AVV_ERR_PLUGIN_NOT_VALID: La,
4444
+ AVV_ERR_ROOT_PLG_BOOTED: _a,
4445
+ AVV_ERR_READY_TIMEOUT: ka
4446
+ } = qn, Pa = ha, or = Ta, Ge = Qn("avvio"), wt = Symbol("kAvvio"), qt = Symbol("kThenifyDoNotWrap");
4447
+ function Fa(t, e, r) {
4389
4448
  const n = e.expose || {}, i = n.use || "use", o = n.after || "after", s = n.ready || "ready", a = n.onClose || "onClose", u = n.close || "close";
4390
4449
  if (t[i])
4391
4450
  throw new Bt(i);
@@ -4395,7 +4454,7 @@ function Pa(t, e, r) {
4395
4454
  throw new Bt(s);
4396
4455
  t[i] = function(d, c) {
4397
4456
  return r.use(d, c), this;
4398
- }, Object.defineProperty(t, "then", { get: Qn.bind(r) }), t[wt] = !0, t[o] = function(d) {
4457
+ }, Object.defineProperty(t, "then", { get: Gn.bind(r) }), t[wt] = !0, t[o] = function(d) {
4399
4458
  return typeof d != "function" ? r._loadRegistered() : (r.after(Qt(d, this)), this);
4400
4459
  }, t[s] = function(d) {
4401
4460
  if (d && typeof d != "function")
@@ -4404,7 +4463,7 @@ function Pa(t, e, r) {
4404
4463
  }, t[a] = function(d) {
4405
4464
  if (typeof d != "function")
4406
4465
  throw new Ze(a, typeof d);
4407
- return r.onClose(Va(d, this)), this;
4466
+ return r.onClose($a(d, this)), this;
4408
4467
  }, t[u] = function(d) {
4409
4468
  if (d && typeof d != "function")
4410
4469
  throw new Ze(u, typeof d);
@@ -4414,13 +4473,13 @@ function Pa(t, e, r) {
4414
4473
  function x(t, e, r) {
4415
4474
  if (typeof t == "function" && arguments.length === 1 && (r = t, e = {}, t = null), typeof e == "function" && (r = e, e = {}), e = e || {}, !(this instanceof x)) {
4416
4475
  const n = new x(t, e, r);
4417
- return t && Pa(t, e, n), n;
4476
+ return t && Fa(t, e, n), n;
4418
4477
  }
4419
- 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 ka(), this._readyQ = tn(this, Gn, 1), this._readyQ.pause(), this._readyQ.drain = () => {
4478
+ 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 Pa(), this._readyQ = tn(this, Kn, 1), this._readyQ.pause(), this._readyQ.drain = () => {
4420
4479
  this.emit("start"), this._readyQ.drain = rn;
4421
- }, this._closeQ = tn(this, Ra, 1), this._closeQ.pause(), this._closeQ.drain = () => {
4480
+ }, this._closeQ = tn(this, Va, 1), this._closeQ.pause(), this._closeQ.drain = () => {
4422
4481
  this.emit("close"), this._closeQ.drain = rn;
4423
- }, this._doStart = null, this._root = new or(this, Fa.bind(this), e, !1, 0), this._root.once("start", (n, i, o) => {
4482
+ }, this._doStart = null, this._root = new or(this, Na.bind(this), e, !1, 0), this._root.once("start", (n, i, o) => {
4424
4483
  const s = this.pluginTree.start(null, i, o);
4425
4484
  this._root.once("loaded", (a, u, d) => {
4426
4485
  this.pluginTree.stop(s, d);
@@ -4440,19 +4499,19 @@ function x(t, e, r) {
4440
4499
  this._readyQ.resume();
4441
4500
  });
4442
4501
  }
4443
- function Fa(t, e, r) {
4502
+ function Na(t, e, r) {
4444
4503
  this._doStart = r, e.autostart && this.start();
4445
4504
  }
4446
- Oa(x, Ta);
4505
+ Ca(x, Oa);
4447
4506
  x.prototype.start = function() {
4448
4507
  return this.started = !0, S.nextTick(this._doStart), this;
4449
4508
  };
4450
4509
  x.prototype.override = function(t, e, r) {
4451
4510
  return t;
4452
4511
  };
4453
- function Na(t) {
4512
+ function Da(t) {
4454
4513
  if (t && typeof t == "object" && typeof t.default == "function" && (t = t.default), !(t && (typeof t == "function" || typeof t.then == "function")))
4455
- throw new Ca(typeof t);
4514
+ throw new La(typeof t);
4456
4515
  return t;
4457
4516
  }
4458
4517
  x.prototype[wt] = !0;
@@ -4463,10 +4522,10 @@ x.prototype._loadRegistered = function() {
4463
4522
  const t = this._current[0];
4464
4523
  return !this.started && !this.booted && S.nextTick(() => this._root.q.resume()), t ? t.loadedSoFar() : Promise.resolve();
4465
4524
  };
4466
- Object.defineProperty(x.prototype, "then", { get: Qn });
4525
+ Object.defineProperty(x.prototype, "then", { get: Gn });
4467
4526
  x.prototype._addPlugin = function(t, e, r) {
4468
- if (t = Na(t), e = e || {}, this.booted)
4469
- throw new La();
4527
+ if (t = Da(t), e = e || {}, this.booted)
4528
+ throw new _a();
4470
4529
  const n = this._current[0], i = new or(this, t, e, r);
4471
4530
  if (i.once("start", (o, s, a) => {
4472
4531
  const u = this.pluginTree.start(n.name, s, a);
@@ -4484,7 +4543,7 @@ x.prototype.after = function(t) {
4484
4543
  return this._loadRegistered();
4485
4544
  this._addPlugin(e.bind(this), {}, !0);
4486
4545
  function e(r, n, i) {
4487
- Gn.call(this, t, i);
4546
+ Kn.call(this, t, i);
4488
4547
  }
4489
4548
  return this;
4490
4549
  };
@@ -4537,7 +4596,7 @@ x.prototype.toJSON = function() {
4537
4596
  };
4538
4597
  function rn() {
4539
4598
  }
4540
- function Qn() {
4599
+ function Gn() {
4541
4600
  if (this.booted) {
4542
4601
  Ge("thenify returning null because we are already booted");
4543
4602
  return;
@@ -4548,7 +4607,7 @@ function Qn() {
4548
4607
  }
4549
4608
  return Ge("thenify"), (t, e) => this._loadRegistered().then(() => (this[qt] = !0, t(this._server)), e);
4550
4609
  }
4551
- function Gn(t, e) {
4610
+ function Kn(t, e) {
4552
4611
  const r = this._server, n = this._error;
4553
4612
  let i;
4554
4613
  if (this._error = null, t.length === 0)
@@ -4561,14 +4620,14 @@ function Gn(t, e) {
4561
4620
  };
4562
4621
  t.length === 2 ? t(n, o) : t(n, r, o);
4563
4622
  } else
4564
- Da.call(this, t, n, r, e);
4623
+ Ra.call(this, t, n, r, e);
4565
4624
  }
4566
- function Da(t, e, r, n) {
4625
+ function Ra(t, e, r, n) {
4567
4626
  const i = t.name;
4568
4627
  Ge("setting up ready timeout", i, this._timeout);
4569
4628
  let o = setTimeout(() => {
4570
4629
  Ge("timed out", i), o = null;
4571
- const a = new _a(i);
4630
+ const a = new ka(i);
4572
4631
  a.fn = t, this._error = a, n(a);
4573
4632
  }, this._timeout);
4574
4633
  t.length === 2 ? t(e, s.bind(this)) : t(e, r, s.bind(this));
@@ -4576,7 +4635,7 @@ function Da(t, e, r, n) {
4576
4635
  o && (clearTimeout(o), this._error = a, n(this._error));
4577
4636
  }
4578
4637
  }
4579
- function Ra(t, e) {
4638
+ function Va(t, e) {
4580
4639
  const r = this._server, n = t[this._isOnCloseHandlerKey];
4581
4640
  if (t.length === 0 || t.length === 1) {
4582
4641
  let i;
@@ -4587,7 +4646,7 @@ function Ra(t, e) {
4587
4646
  } else
4588
4647
  t.length === 2 ? t(n ? r : this._error, e) : n ? t(r, e) : t(this._error, r, e);
4589
4648
  }
4590
- function Va(t, e) {
4649
+ function $a(t, e) {
4591
4650
  return r.bind(e);
4592
4651
  function r(n, i) {
4593
4652
  let o;
@@ -4617,8 +4676,8 @@ ur.exports.express = function(t) {
4617
4676
  }
4618
4677
  });
4619
4678
  };
4620
- var $a = ur.exports;
4621
- const ja = /* @__PURE__ */ Lo($a);
4679
+ var ja = ur.exports;
4680
+ const Ma = /* @__PURE__ */ _o(ja);
4622
4681
  (function() {
4623
4682
  if (window.requestAnimationFrame && window.cancelAnimationFrame)
4624
4683
  return;
@@ -4636,10 +4695,9 @@ const ja = /* @__PURE__ */ Lo($a);
4636
4695
  }, window.cancelAnimationFrame = clearTimeout;
4637
4696
  }
4638
4697
  })();
4639
- function uu(t, e = !0, r = !0, n) {
4640
- console.log("start sdk");
4641
- 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 = ja(/* @__PURE__ */ Object.create({}), { autostart: !1 });
4642
- return s.use(so), s.use(to, { onDeepLinkHandled: n?.onDeepLinkHandled }), s.use(oo, { videoPlayerController: n?.videoPlayerController }), s.use(Ci, { sdkKey: t, host: i, analyticsHost: o, version: n?.version }), s.use(Fi), s.use(io), s.use(vo), s.use(zi), s.use(Co), s.after((a, u, d) => {
4698
+ function cu(t, e = !0, r = !0, n) {
4699
+ 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 = Ma(/* @__PURE__ */ Object.create({}), { autostart: !1 });
4700
+ return s.use(so), s.use(to, { onDeepLinkHandled: n?.onDeepLinkHandled }), s.use(oo, { videoPlayerController: n?.videoPlayerController }), s.use(Li, { sdkKey: t, host: i, analyticsHost: o, version: n?.version }), s.use(Ni), s.use(io), s.use(So), s.use(Ki), s.use(Lo), s.after((a, u, d) => {
4643
4701
  if (a)
4644
4702
  throw a;
4645
4703
  u.ready(), d();
@@ -4652,5 +4710,5 @@ function uu(t, e = !0, r = !0, n) {
4652
4710
  }), s;
4653
4711
  }
4654
4712
  export {
4655
- uu as StreamLayer
4713
+ cu as StreamLayer
4656
4714
  };