@kalamba/sdk 0.4.1 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/plugins.js CHANGED
@@ -2,29 +2,30 @@
2
2
  * BSD 3-Clause License
3
3
  * Copyright (c) 2024, Kalamba Games Limited
4
4
  */
5
- var Nt = Object.defineProperty;
6
- var Ht = (i, e, t) => e in i ? Nt(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t;
7
- var p = (i, e, t) => (Ht(i, typeof e != "symbol" ? e + "" : e, t), t), ot = (i, e, t) => {
5
+ var Vt = Object.defineProperty;
6
+ var zt = (i, e, t) => e in i ? Vt(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t;
7
+ var b = (i, e, t) => (zt(i, typeof e != "symbol" ? e + "" : e, t), t), dt = (i, e, t) => {
8
8
  if (!e.has(i))
9
9
  throw TypeError("Cannot " + t);
10
10
  };
11
- var y = (i, e, t) => (ot(i, e, "read from private field"), t ? t.call(i) : e.get(i)), E = (i, e, t) => {
11
+ var E = (i, e, t) => (dt(i, e, "read from private field"), t ? t.call(i) : e.get(i)), v = (i, e, t) => {
12
12
  if (e.has(i))
13
13
  throw TypeError("Cannot add the same private member more than once");
14
14
  e instanceof WeakSet ? e.add(i) : e.set(i, t);
15
- }, v = (i, e, t, n) => (ot(i, e, "write to private field"), n ? n.call(i, t) : e.set(i, t), t);
16
- import { a as rt } from "./noop-3336849b.js";
17
- function O(i, e) {
15
+ }, y = (i, e, t, n) => (dt(i, e, "write to private field"), n ? n.call(i, t) : e.set(i, t), t);
16
+ import { a as U, b as W } from "./errors-96eb18f7.js";
17
+ import { a as lt } from "./noop-3336849b.js";
18
+ function x(i, e) {
18
19
  return (t, ...n) => {
19
20
  console.log(`[%c${i}\x1B[m] %s`, e, t, ...n);
20
21
  };
21
22
  }
22
- function Ot(i, e) {
23
+ function Dt(i, e) {
23
24
  return Math.round(i * 100 / e);
24
25
  }
25
- class $ {
26
+ class Q {
26
27
  constructor(e) {
27
- p(this, "config");
28
+ b(this, "config");
28
29
  this.config = e;
29
30
  }
30
31
  on(e, t, n) {
@@ -40,10 +41,10 @@ class $ {
40
41
  });
41
42
  }
42
43
  }
43
- const Vt = O("BasicPlugin", "color:#000000;font-weight:bold;");
44
- class Oi extends $ {
44
+ const Gt = x("BasicPlugin", "color:#000000;font-weight:bold;");
45
+ class Bi extends Q {
45
46
  constructor(...e) {
46
- super(...e), this.registerToSdkEvents(), this.registerFromSdkEvents(), Vt("configured");
47
+ super(...e), this.registerToSdkEvents(), this.registerFromSdkEvents(), Gt("configured");
47
48
  }
48
49
  registerToSdkEvents() {
49
50
  window.addEventListener("message", (e) => {
@@ -55,7 +56,7 @@ class Oi extends $ {
55
56
  return;
56
57
  case "doBalanceUpdate":
57
58
  const { currency: a, coinValueInCents: c } = this.config.api;
58
- n.currency === a && typeof n.balanceInCurrency == "number" ? this.send("balance", { balance: Ot(n.balanceInCurrency, c) }) : (n.balanceInCoins, this.send("balance", { balance: n.balanceInCoins }));
59
+ n.currency === a && typeof n.balanceInCurrency == "number" ? this.send("balance", { balance: Dt(n.balanceInCurrency, c) }) : (n.balanceInCoins, this.send("balance", { balance: n.balanceInCoins }));
59
60
  return;
60
61
  case "doGamePause":
61
62
  this.send("freeze");
@@ -90,8 +91,8 @@ class Oi extends $ {
90
91
  });
91
92
  }
92
93
  }
93
- const k = O("▼ DebuggingPlugin IN ▼", "color:#444444;font-weight:bold;"), zt = O("▲ DebuggingPlugin OUT ▲", "color:#444444;font-weight:bold;");
94
- class Li extends $ {
94
+ const S = x("▼ DebuggingPlugin IN ▼", "color:#444444;font-weight:bold;"), qt = x("▲ DebuggingPlugin OUT ▲", "color:#444444;font-weight:bold;");
95
+ class Fi extends Q {
95
96
  constructor(...e) {
96
97
  super(...e), this.registerDebugToSdkEvents(), this.registerSdkToDebugEvents();
97
98
  }
@@ -112,16 +113,16 @@ class Li extends $ {
112
113
  };
113
114
  }
114
115
  registerSdkToDebugEvents() {
115
- this.on("autoplay", (e) => k("autoplay", e)), this.on("balance", (e) => k("balance", e)), this.on("bet", (e) => k("bet", e)), this.on("cashier", (e) => k("cashier", e)), this.on("choice", (e) => k("choice", e)), this.on("close", (e) => k("close", e)), this.on("error", (e) => k("error", e)), this.on("loadEnd", (e) => k("loadEnd", e)), this.on("loadProgress", (e) => k("loadProgress", e)), this.on("loadStart", (e) => k("loadStart", e)), this.on("playCycleStart", (e) => k("playCycleStart", e)), this.on("playCycleEnd", (e) => k("playCycleEnd", e)), this.on("playEnd", (e) => k("playEnd", e)), this.on("playError", (e) => k("playError", e)), this.on("playReady", (e) => k("playReady", e)), this.on("playStart", (e) => k("playStart", e)), this.on("settings", (e) => k("settings", e));
116
+ this.on("autoplay", (e) => S("autoplay", e)), this.on("balance", (e) => S("balance", e)), this.on("bet", (e) => S("bet", e)), this.on("cashier", (e) => S("cashier", e)), this.on("choice", (e) => S("choice", e)), this.on("close", (e) => S("close", e)), this.on("error", (e) => S("error", e)), this.on("loadEnd", (e) => S("loadEnd", e)), this.on("loadProgress", (e) => S("loadProgress", e)), this.on("loadStart", (e) => S("loadStart", e)), this.on("playCycleStart", (e) => S("playCycleStart", e)), this.on("playCycleEnd", (e) => S("playCycleEnd", e)), this.on("playEnd", (e) => S("playEnd", e)), this.on("playError", (e) => S("playError", e)), this.on("playReady", (e) => S("playReady", e)), this.on("playStart", (e) => S("playStart", e)), this.on("settings", (e) => S("settings", e));
116
117
  }
117
118
  _send(...e) {
118
- zt(...e), this.send(...e);
119
+ qt(...e), this.send(...e);
119
120
  }
120
121
  }
121
- const qt = O("GigPlugin", "color:#000000;font-weight:bold;");
122
- class Bi extends $ {
122
+ const Wt = x("GigPlugin", "color:#000000;font-weight:bold;");
123
+ class Ni extends Q {
123
124
  constructor(...e) {
124
- super(...e), this.registerToSdkEvents(), this.registerFromSdkEvents(), qt("configured");
125
+ super(...e), this.registerToSdkEvents(), this.registerFromSdkEvents(), Wt("configured");
125
126
  }
126
127
  postMessage(e) {
127
128
  const t = {
@@ -169,10 +170,10 @@ class Bi extends $ {
169
170
  });
170
171
  }
171
172
  }
172
- const Gt = O("OryxPlugin", "color:#000000;font-weight:bold;");
173
- class Fi extends $ {
173
+ const $t = x("OryxPlugin", "color:#000000;font-weight:bold;");
174
+ class Hi extends Q {
174
175
  constructor(...e) {
175
- super(...e), this.registerToSdkEvents(), this.registerFromSdkEvents(), Gt("configured");
176
+ super(...e), this.registerToSdkEvents(), this.registerFromSdkEvents(), $t("configured");
176
177
  }
177
178
  registerToSdkEvents() {
178
179
  window.addEventListener("message", (e) => {
@@ -224,15 +225,15 @@ class Fi extends $ {
224
225
  });
225
226
  }
226
227
  }
227
- const ct = O("PariplayPlugin", "color:#000000;font-weight:bold;");
228
- function He(i) {
228
+ const ut = x("PariplayPlugin", "color:#000000;font-weight:bold;");
229
+ function Ge(i) {
229
230
  try {
230
231
  window.top.location = i;
231
232
  } catch {
232
233
  window.location = i;
233
234
  }
234
235
  }
235
- function Ve(i, e) {
236
+ function qe(i, e) {
236
237
  return new Promise(function(n, a) {
237
238
  const c = new XMLHttpRequest();
238
239
  c.onload = function() {
@@ -240,38 +241,38 @@ function Ve(i, e) {
240
241
  }, c.open(i, e), c.send();
241
242
  });
242
243
  }
243
- function ze() {
244
+ function We() {
244
245
  }
245
- function Wt(i) {
246
+ function jt(i) {
246
247
  return i.filter(function(t) {
247
248
  return t.messageType.toUpperCase() === "DATA";
248
249
  });
249
250
  }
250
- function qe(i) {
251
+ function $e(i) {
251
252
  return i.filter(function(t) {
252
253
  return ["NOTIFICATION", "POPUP"].includes(t.messageType.toUpperCase());
253
254
  });
254
255
  }
255
- function Lt(i) {
256
+ function Rt(i) {
256
257
  try {
257
258
  return JSON.parse(i.text);
258
259
  } catch {
259
260
  return {};
260
261
  }
261
262
  }
262
- function $t(i) {
263
- return i.map(Lt).filter(Boolean).find(function(t) {
263
+ function Qt(i) {
264
+ return i.map(Rt).filter(Boolean).find(function(t) {
264
265
  return t.betId != null && t.winId != null;
265
266
  }) || {};
266
267
  }
267
- function jt(i) {
268
- return i.map(Lt).filter(Boolean).find(function(t) {
268
+ function Xt(i) {
269
+ return i.map(Rt).filter(Boolean).find(function(t) {
269
270
  return t.TotalBet != null && t.TotalWin != null;
270
271
  }) || {};
271
272
  }
272
- class _i extends $ {
273
+ class Vi extends Q {
273
274
  constructor(...e) {
274
- super(...e), this.registerToSdkEvents(), this.registerFromSdkEvents(), ct("configured");
275
+ super(...e), this.registerToSdkEvents(), this.registerFromSdkEvents(), ut("configured");
275
276
  }
276
277
  postMessage(e, t) {
277
278
  const n = {
@@ -279,26 +280,26 @@ class _i extends $ {
279
280
  sender: this.config.api.game,
280
281
  type: e
281
282
  };
282
- t != null && (n.data = t), ct("postMessage", n), window.parent.postMessage(n, "*");
283
+ t != null && (n.data = t), ut("postMessage", n), window.parent.postMessage(n, "*");
283
284
  }
284
285
  coinsToCurrency(e) {
285
286
  return e * this.config.api.coinValueInCents / 100;
286
287
  }
287
288
  handleContinueButton(e, t) {
288
- e.link && Ve("GET", e.link), t();
289
+ e.link && qe("GET", e.link), t();
289
290
  }
290
291
  handleLinkButton(e, t) {
291
292
  switch (e.linkType.toUpperCase()) {
292
293
  case "AJAX":
293
- Ve("GET", e.link), t();
294
+ qe("GET", e.link), t();
294
295
  return;
295
296
  case "AJAXRESPONSE":
296
- Ve("GET", e.link).then(() => {
297
+ qe("GET", e.link).then(() => {
297
298
  t();
298
299
  });
299
300
  return;
300
301
  case "REDIRECT":
301
- He(e.link), t();
302
+ Ge(e.link), t();
302
303
  return;
303
304
  }
304
305
  }
@@ -325,13 +326,13 @@ class _i extends $ {
325
326
  Object.assign({}, n, {
326
327
  buttons: n.buttons.filter((c) => c.action.toUpperCase() === "CASHIER" ? !!this.config.api.cashierUrl : !0).map((c) => Object.assign({}, c, {
327
328
  onRelease: () => {
328
- const s = n.messageType.toUpperCase() === "POPUP" ? ze : a, h = this.buttonActions[c.action.toUpperCase()];
329
+ const s = n.messageType.toUpperCase() === "POPUP" ? We : a, h = this.buttonActions[c.action.toUpperCase()];
329
330
  h ? h(c, s) : s();
330
331
  }
331
332
  }))
332
333
  });
333
- }).catch(ze)), Promise.resolve()).then(() => {
334
- }).catch(ze);
334
+ }).catch(We)), Promise.resolve()).then(() => {
335
+ }).catch(We);
335
336
  }
336
337
  registerToSdkEvents() {
337
338
  window.addEventListener("message", (e) => {
@@ -378,7 +379,7 @@ class _i extends $ {
378
379
  success: !0
379
380
  });
380
381
  try {
381
- const a = qe(t.data.uiMessages);
382
+ const a = $e(t.contract.uiMessages);
382
383
  this.processInfoUiMessages(a);
383
384
  } catch {
384
385
  }
@@ -395,33 +396,37 @@ class _i extends $ {
395
396
  window.history.back();
396
397
  }
397
398
  else
398
- this.config.api.homeUrl === "(api)" ? this.postMessage("quit") : He(this.config.api.homeUrl);
399
+ this.config.api.homeUrl === "(api)" ? this.postMessage("quit") : Ge(this.config.api.homeUrl);
399
400
  }), this.on("playEnd", (t) => {
400
401
  this.postMessage("roundEnded", {
401
- balanceAfter: this.coinsToCurrency(t.balance),
402
- win: this.coinsToCurrency(t.data.gameRoundResult.win)
402
+ balanceAfter: this.coinsToCurrency(t.contract.balance.coins),
403
+ win: this.coinsToCurrency(t.contract.win.round)
403
404
  });
404
405
  try {
405
- const n = qe(t.data.uiMessages);
406
+ const n = $e(t.contract.uiMessages);
406
407
  this.processInfoUiMessages(n);
407
408
  } catch {
408
409
  }
409
410
  }), this.on("playError", (t) => {
411
+ var n, a;
410
412
  this.postMessage("ticketReceived", {
411
- ErrorCode: t.data.data.data.operatorSpecificErrorCode,
412
- ErrorMessage: t.data.data.data.operatorSpecificErrorMessage,
413
+ // TODO: Operator specific error code and message
414
+ ErrorCode: (n = t.data) == null ? void 0 : n.code,
415
+ ErrorMessage: "ERROR",
413
416
  Status: {
414
- ErrCode: t.data.data.data.operatorSpecificErrorCode
417
+ ErrCode: (a = t.data) == null ? void 0 : a.code
415
418
  }
416
419
  });
417
420
  }), this.on("playResponse", (t) => {
418
421
  this.postMessage("roundStarted", {
419
- balanceBefore: this.coinsToCurrency(t.balance + t.data.gameState.totalBetFromCurrentGameCycle)
422
+ balanceBefore: this.coinsToCurrency(
423
+ t.contract.balance.coins + t.contract.bet.lastPaid.base * t.contract.bet.lastPaid.multiplier
424
+ )
420
425
  });
421
- const n = t.data.gameState.stateTypeThisRound === "BaseGame", a = Wt(t.data.uiMessages), c = qe(t.data.uiMessages), s = $t(a), h = jt(a);
426
+ const n = ["BaseGame", "PaidSpin"].includes(t.contract.stateType.thisRound), a = jt(t.contract.uiMessages), c = $e(t.contract.uiMessages), s = Qt(a), h = Xt(a);
422
427
  this.postMessage("ticketReceived", {
423
- Balance: this.coinsToCurrency(t.balance),
424
- BetAmount: n ? this.coinsToCurrency(t.data.gameState.totalBetFromCurrentGameCycle) : 0,
428
+ Balance: this.coinsToCurrency(t.contract.balance.coins),
429
+ BetAmount: n ? this.coinsToCurrency(t.contract.bet.lastPaid.base * t.contract.bet.lastPaid.multiplier) : 0,
425
430
  CreditTransactionId: s.betId,
426
431
  DebitTransactionId: s.winId,
427
432
  Message: c,
@@ -429,7 +434,7 @@ class _i extends $ {
429
434
  Status: {
430
435
  ErrCode: 0
431
436
  },
432
- WinAmount: this.coinsToCurrency(t.data.gameRoundResult.win)
437
+ WinAmount: this.coinsToCurrency(t.contract.win.round)
433
438
  });
434
439
  }), this.on("playStart", (t) => {
435
440
  t.bet && this.postMessage("roundStart", {
@@ -440,18 +445,18 @@ class _i extends $ {
440
445
  }), this.on("loadStart", () => {
441
446
  this.postMessage("onAppFrameReady");
442
447
  }), this.on("cashier", () => {
443
- this.config.api.cashierUrl && (this.config.api.cashierUrl === "(api)" ? this.postMessage("cashier") : He(this.config.api.cashierUrl));
448
+ this.config.api.cashierUrl && (this.config.api.cashierUrl === "(api)" ? this.postMessage("cashier") : Ge(this.config.api.cashierUrl));
444
449
  });
445
450
  }
446
451
  }
447
- const ue = O("RelaxFEIMPlugin", "color:#000000;font-weight:bold;");
448
- class Di extends $ {
452
+ const be = x("RelaxFEIMPlugin", "color:#000000;font-weight:bold;");
453
+ class zi extends Q {
449
454
  constructor(...t) {
450
455
  super(...t);
451
- p(this, "VERSION", "1.15.0");
456
+ b(this, "VERSION", "1.15.0");
452
457
  const n = document.createElement("script");
453
458
  n.src = `https://d3nsdzdtjbr5ml.cloudfront.net/casino/relaxlibs/feim/${this.VERSION}/rlxfeim.min.js`, n.onload = () => {
454
- ue("loaded"), window.FEIM.configure({
459
+ be("loaded"), window.FEIM.configure({
455
460
  p2pConfig: {
456
461
  currency: this.config.api.currency,
457
462
  launchParams: {
@@ -459,11 +464,11 @@ class Di extends $ {
459
464
  homeurl: "homeUrl"
460
465
  }
461
466
  }
462
- }), ue("configured"), this.registerToSdkEvents(), this.registerFromSdkEvents();
467
+ }), be("configured"), this.registerToSdkEvents(), this.registerFromSdkEvents();
463
468
  }, document.body.appendChild(n);
464
469
  }
465
470
  registerToSdkEvents() {
466
- window.FEIM.on.errorMessageDismissed(() => this.send("unfreeze")), window.FEIM.on.errorMessageDisplayed(() => this.send("freeze")), window.FEIM.on.exitingGame(() => ue("!!! NOT IMPLEMENTED: exitingGame !!!")), window.FEIM.on.freeze(() => this.send("freeze")), window.FEIM.on.initialized(() => ue("!!! NOT IMPLEMENTED: initialized !!!")), window.FEIM.on.pauseAutoPlay(() => this.send("suspend")), window.FEIM.on.refreshBalance(() => ue("!!! NOT IMPLEMENTED: refreshBalance !!!")), window.FEIM.on.toggleGameHelp(() => {
471
+ window.FEIM.on.errorMessageDismissed(() => this.send("unfreeze")), window.FEIM.on.errorMessageDisplayed(() => this.send("freeze")), window.FEIM.on.exitingGame(() => be("!!! NOT IMPLEMENTED: exitingGame !!!")), window.FEIM.on.freeze(() => this.send("freeze")), window.FEIM.on.initialized(() => be("!!! NOT IMPLEMENTED: initialized !!!")), window.FEIM.on.pauseAutoPlay(() => this.send("suspend")), window.FEIM.on.refreshBalance(() => be("!!! NOT IMPLEMENTED: refreshBalance !!!")), window.FEIM.on.toggleGameHelp(() => {
467
472
  this.send("help", {});
468
473
  }), window.FEIM.on.togglePaytable(() => {
469
474
  this.send("paytable", {});
@@ -519,20 +524,20 @@ class Di extends $ {
519
524
  });
520
525
  }
521
526
  }
522
- const Ge = O("TukoPlugin", "color:#000000;font-weight:bold;");
523
- class Ri extends $ {
527
+ const je = x("TukoPlugin", "color:#000000;font-weight:bold;");
528
+ class Gi extends Q {
524
529
  constructor(...t) {
525
530
  super(...t);
526
- p(this, "PING_INTERVAL", 1e4);
531
+ b(this, "PING_INTERVAL", 1e4);
527
532
  const a = new URLSearchParams(window.location.search).get("pingCallbackUrl");
528
533
  a && window.setInterval(() => {
529
534
  this.ping(a);
530
- }, this.PING_INTERVAL), this.registerToSdkEvents(), this.registerFromSdkEvents(), Ge("configured");
535
+ }, this.PING_INTERVAL), this.registerToSdkEvents(), this.registerFromSdkEvents(), je("configured");
531
536
  }
532
537
  ping(t) {
533
538
  const n = new XMLHttpRequest();
534
539
  n.onreadystatechange = function() {
535
- n.readyState === XMLHttpRequest.DONE && (n.status === 0 || n.status >= 200 && n.status < 400 ? Ge("ping ok", n) : Ge("ping error", n));
540
+ n.readyState === XMLHttpRequest.DONE && (n.status === 0 || n.status >= 200 && n.status < 400 ? je("ping ok", n) : je("ping error", n));
536
541
  }, n.open("GET", t), n.send();
537
542
  }
538
543
  registerToSdkEvents() {
@@ -545,7 +550,7 @@ class Ri extends $ {
545
550
  return;
546
551
  case "doBalanceUpdate":
547
552
  const { currency: c, coinValueInCents: s } = this.config.api;
548
- a.currency === c && typeof a.balanceInCurrency == "number" ? this.send("balance", { balance: Ot(a.balanceInCurrency, s) }) : (a.balanceInCoins, this.send("balance", { balance: a.balanceInCoins }));
553
+ a.currency === c && typeof a.balanceInCurrency == "number" ? this.send("balance", { balance: Dt(a.balanceInCurrency, s) }) : (a.balanceInCoins, this.send("balance", { balance: a.balanceInCoins }));
549
554
  return;
550
555
  case "doGamePause":
551
556
  this.send("freeze");
@@ -580,9 +585,9 @@ class Ri extends $ {
580
585
  });
581
586
  }
582
587
  }
583
- class Qt {
588
+ class Yt {
584
589
  constructor(e) {
585
- p(this, "config");
590
+ b(this, "config");
586
591
  this.config = e;
587
592
  }
588
593
  on(e, t, n) {
@@ -598,16 +603,16 @@ class Qt {
598
603
  });
599
604
  }
600
605
  }
601
- class Xt {
606
+ class Kt {
602
607
  constructor(e) {
603
- p(this, "socket", null);
604
- p(this, "webSocketUrl");
605
- p(this, "eventListeners", {
608
+ b(this, "socket", null);
609
+ b(this, "webSocketUrl");
610
+ b(this, "eventListeners", {
606
611
  close: [],
607
612
  error: [],
608
613
  message: []
609
614
  });
610
- p(this, "connect", () => {
615
+ b(this, "connect", () => {
611
616
  const e = new WebSocket(this.webSocketUrl);
612
617
  return e.addEventListener("message", this.handleMessage), new Promise((t) => {
613
618
  e.addEventListener("open", (n) => {
@@ -615,34 +620,34 @@ class Xt {
615
620
  });
616
621
  });
617
622
  });
618
- p(this, "send", (e) => {
623
+ b(this, "send", (e) => {
619
624
  if (this.socket == null)
620
625
  throw new Error("Cannot send message, the WebSocket connection is not open");
621
626
  this.socket.send(e);
622
627
  });
623
- p(this, "close", () => {
628
+ b(this, "close", () => {
624
629
  if (this.socket == null)
625
630
  throw new Error("Cannot close the WebSocket connection that is not open");
626
631
  this.socket.close(), this.addEventListener("error", (e) => {
627
632
  console.log(e);
628
633
  });
629
634
  });
630
- p(this, "handleClose", (e) => {
635
+ b(this, "handleClose", (e) => {
631
636
  this.eventListeners.close.forEach((t) => {
632
637
  t(e);
633
638
  });
634
639
  });
635
- p(this, "handleError", (e) => {
640
+ b(this, "handleError", (e) => {
636
641
  this.eventListeners.error.forEach((t) => {
637
642
  t(e);
638
643
  });
639
644
  });
640
- p(this, "handleMessage", (e) => {
645
+ b(this, "handleMessage", (e) => {
641
646
  this.eventListeners.message.forEach((t) => {
642
647
  t(e);
643
648
  });
644
649
  });
645
- p(this, "handleOpen", (e) => {
650
+ b(this, "handleOpen", (e) => {
646
651
  const t = e.target;
647
652
  t.addEventListener("close", this.handleClose), t.addEventListener("error", this.handleError), this.socket = t;
648
653
  });
@@ -656,40 +661,36 @@ class Xt {
656
661
  n !== -1 && this.eventListeners[e].splice(n, 1);
657
662
  }
658
663
  }
659
- function Ce(i) {
664
+ function Ae(i) {
660
665
  try {
661
666
  return JSON.parse(i == null ? void 0 : i.data);
662
667
  } catch (e) {
663
668
  return console.error("fakap", e), null;
664
669
  }
665
670
  }
666
- function be(i) {
671
+ function ye(i) {
667
672
  var e;
668
673
  return ((e = i == null ? void 0 : i.header) == null ? void 0 : e.name) === "GameEvent";
669
674
  }
670
- function Kt(i) {
671
- return be(i) && i.body.event === "OPEN_GAME";
672
- }
673
675
  function Jt(i) {
674
- return be(i) && i.body.event === "SPIN_ERROR";
675
- }
676
- function Yt(i) {
677
- return be(i) && i.body.event.includes("_RESULT");
676
+ return ye(i) && i.body.event === "OPEN_GAME";
678
677
  }
679
678
  function Zt(i) {
680
- var e;
681
- return ((e = i == null ? void 0 : i.header) == null ? void 0 : e.name) === "OpenGame";
679
+ return i.header.code !== 1 || ye(i) && i.body.event.includes("_ERROR");
682
680
  }
683
681
  function ei(i) {
682
+ return ye(i) && i.body.event.includes("_RESULT");
683
+ }
684
+ function ti(i) {
684
685
  var e;
685
686
  return ((e = i == null ? void 0 : i.header) == null ? void 0 : e.name) === "Ping";
686
687
  }
687
- function dt(i) {
688
+ function ht(i) {
688
689
  var e;
689
690
  return ((e = i == null ? void 0 : i.header) == null ? void 0 : e.name) === "RealityCheck";
690
691
  }
691
- var Z, ye;
692
- class ti extends Xt {
692
+ var ne, Me;
693
+ class ii extends Kt {
693
694
  constructor(t, n) {
694
695
  const a = new URL(t.apiUrl);
695
696
  a.searchParams.set("cageCode", t.cageCode), a.searchParams.set("gameCode", t.gameCode), a.searchParams.set("operatorCode", t.operatorCode), a.searchParams.set("playMode", t.playMode), a.searchParams.set("token", t.token), a.searchParams.set("username", t.username);
@@ -704,7 +705,7 @@ class ti extends Xt {
704
705
  * request sent. Client and server independently maintain their own
705
706
  * correlation id counter.
706
707
  */
707
- p(this, "cId", 0);
708
+ b(this, "cId", 0);
708
709
  // Initial values for header
709
710
  /*
710
711
  * Increasing message ID
@@ -716,20 +717,20 @@ class ti extends Xt {
716
717
  * received out of sync).
717
718
  */
718
719
  // TODO make sure messages are processed in order
719
- p(this, "mId", 0);
720
+ b(this, "mId", 0);
720
721
  // Initial values for body
721
722
  /*
722
723
  * Sequence ID. Action/Event correlation.
723
724
  */
724
- p(this, "seqId", 10);
725
- p(this, "gameCode");
726
- E(this, Z, void 0);
727
- E(this, ye, void 0);
728
- p(this, "onMessage", (t) => {
729
- const n = Ce(t);
730
- (be(n) || ei(n) || dt(n)) && this.sendAcknowledgement(n), dt(n) && this.handleRealityCheck(n);
725
+ b(this, "seqId", 10);
726
+ b(this, "gameCode");
727
+ v(this, ne, void 0);
728
+ v(this, Me, void 0);
729
+ b(this, "onMessage", (t) => {
730
+ const n = Ae(t);
731
+ (ye(n) || ti(n) || ht(n)) && this.sendAcknowledgement(n), ht(n) && this.handleRealityCheck(n);
731
732
  });
732
- this.eventListeners.realityCheck = [], this.gameCode = t.gameCode, v(this, Z, n.requestTimeoutMs), v(this, ye, n.gameVersion ?? "unknown"), this.addEventListener("message", this.onMessage);
733
+ this.eventListeners.realityCheck = [], this.gameCode = t.gameCode, y(this, ne, n.requestTimeoutMs), y(this, Me, n.gameVersion ?? "unknown"), this.addEventListener("message", this.onMessage);
733
734
  }
734
735
  handleRealityCheck(t) {
735
736
  this.eventListeners.realityCheck.forEach((n) => {
@@ -767,13 +768,13 @@ class ti extends Xt {
767
768
  request(t, n) {
768
769
  const a = this.buildPayload(t, n);
769
770
  return new Promise((c, s) => {
770
- setTimeout(() => s({ request: { body: n, header: t }, type: "timeout" }), y(this, Z));
771
+ setTimeout(() => s({ type: "timeout" }), E(this, ne));
771
772
  const h = (g) => {
772
- const w = Ce(g);
773
+ const w = Ae(g);
773
774
  try {
774
- t.cId === (w == null ? void 0 : w.header.cId) && (this.removeEventListener("message", h), w.header.code === 1 ? c(w) : s({ response: w, type: "response" }));
775
+ t.cId === (w == null ? void 0 : w.header.cId) && (this.removeEventListener("message", h), w.header.code === 1 ? c(w) : s({ data: w, type: "error" }));
775
776
  } catch {
776
- s({ response: w, type: "error" });
777
+ s({ data: w, type: "error" });
777
778
  }
778
779
  };
779
780
  this.addEventListener("message", h), this.send(a);
@@ -789,7 +790,7 @@ class ti extends Xt {
789
790
  authenticate(t = !1) {
790
791
  const n = this.buildHeader("Authenticate"), a = {
791
792
  clientType: 3,
792
- version: y(this, ye),
793
+ version: E(this, Me),
793
794
  reconnect: t
794
795
  };
795
796
  return this.request(
@@ -803,11 +804,11 @@ class ti extends Xt {
803
804
  };
804
805
  return new Promise((a, c) => {
805
806
  const s = (h) => {
806
- const g = Ce(h);
807
- Kt(g) && (this.removeEventListener("message", s), a(g.body));
807
+ const g = Ae(h);
808
+ Jt(g) ? (this.removeEventListener("message", s), a(g.body)) : Zt(g) && c({ data: g, type: "error" });
808
809
  };
809
810
  this.addEventListener("message", s), this.request(t, n).catch((h) => {
810
- Zt(h.response) && c(h), c(h);
811
+ c(h);
811
812
  });
812
813
  });
813
814
  }
@@ -822,22 +823,20 @@ class ti extends Xt {
822
823
  };
823
824
  return new Promise((s, h) => {
824
825
  const g = (w) => {
825
- const m = Ce(w);
826
- be(m) && c.seqId === m.body.correlationSeqId && (this.removeEventListener("message", g), Yt(m) ? s(m.body) : Jt(m) && h(m.body));
826
+ const m = Ae(w);
827
+ ye(m) && c.seqId === m.body.correlationSeqId && (this.removeEventListener("message", g), ei(m) ? s(m.body) : h({ data: m, type: "error" }));
827
828
  };
828
829
  this.addEventListener("message", g), this.request(a, c).catch(
829
- (w) => {
830
- h(w);
831
- }
830
+ (w) => h(w)
832
831
  );
833
832
  });
834
833
  }
835
834
  setRequestTimeoutMs(t) {
836
- v(this, Z, t);
835
+ y(this, ne, t);
837
836
  }
838
837
  }
839
- Z = new WeakMap(), ye = new WeakMap();
840
- function ii(i) {
838
+ ne = new WeakMap(), Me = new WeakMap();
839
+ function ni(i) {
841
840
  return i.contract ? {
842
841
  contract: {
843
842
  balance: {
@@ -866,7 +865,26 @@ function ii(i) {
866
865
  }
867
866
  };
868
867
  }
869
- function ni(i, e) {
868
+ function ai(i) {
869
+ const e = ({ code: t }) => {
870
+ switch (t) {
871
+ case 2:
872
+ return { code: U.DENIED };
873
+ case 3:
874
+ return { code: U.NOT_FOUND };
875
+ case 4:
876
+ return { code: U.ALREADY_LOGGED_IN };
877
+ case 5:
878
+ default:
879
+ return { code: U.ERROR };
880
+ }
881
+ };
882
+ return {
883
+ ...i,
884
+ data: i.data ? e(i.data) : void 0
885
+ };
886
+ }
887
+ function si(i, e) {
870
888
  return e.contract ? {
871
889
  contract: {
872
890
  bet: {
@@ -891,6 +909,7 @@ function ni(i, e) {
891
909
  },
892
910
  gameModel: e.contract.gameModelFile,
893
911
  metaData: e.contract.metaData,
912
+ roundId: e.contract.roundId,
894
913
  serverTime: e.contract.serverTime,
895
914
  sessionId: e.contract.sessionId,
896
915
  stateType: {
@@ -928,6 +947,7 @@ function ni(i, e) {
928
947
  },
929
948
  gameModel: e.data.additionalConfigData.gameModelFile,
930
949
  metaData: e.data.gameConfigData.metaData,
950
+ roundId: e.data.gameState.cycleId,
931
951
  serverTime: e.balanceVersion,
932
952
  sessionId: e.data.gameState.sessionId,
933
953
  stateType: {
@@ -943,7 +963,28 @@ function ni(i, e) {
943
963
  data: e.data
944
964
  };
945
965
  }
946
- function ai(i) {
966
+ function oi(i) {
967
+ const e = ({ code: t }) => {
968
+ switch (t) {
969
+ case 2:
970
+ return { code: U.GAME_UNAVAILABLE };
971
+ case 3:
972
+ return { code: U.BONUS_RESTRICTION };
973
+ case 5:
974
+ return { code: U.TOO_MANY_OPEN_GAMES };
975
+ case 6:
976
+ return { code: U.RECONNECT_DATA_MISMATCH };
977
+ case 4:
978
+ default:
979
+ return { code: U.ERROR };
980
+ }
981
+ };
982
+ return {
983
+ ...i,
984
+ data: i.data ? e(i.data) : void 0
985
+ };
986
+ }
987
+ function ri(i) {
947
988
  return i.contract ? {
948
989
  contract: {
949
990
  bet: {
@@ -1004,7 +1045,32 @@ function ai(i) {
1004
1045
  data: i.data
1005
1046
  };
1006
1047
  }
1007
- const si = {
1048
+ function ci(i) {
1049
+ const e = ({ code: t }) => {
1050
+ switch (t) {
1051
+ case "GAMING_LIMITS_REACHED":
1052
+ return { code: W.GAMING_LIMITS_REACHED };
1053
+ case "INVALID_CURRENCY":
1054
+ return { code: W.INVALID_CURRENCY };
1055
+ case "INVALID_SESSION":
1056
+ return { code: W.INVALID_SESSION };
1057
+ case "OUT_OF_MONEY":
1058
+ return { code: W.OUT_OF_MONEY };
1059
+ case "UNFINISHED_ROUND_IN_PROGRESS":
1060
+ return { code: W.UNFINISHED_ROUND_IN_PROGRESS };
1061
+ case "WALLET_ERROR":
1062
+ return { code: W.WALLET_ERROR };
1063
+ case "ERROR":
1064
+ default:
1065
+ return { code: W.ERROR };
1066
+ }
1067
+ };
1068
+ return {
1069
+ ...i,
1070
+ data: i.data ? e(i.data) : void 0
1071
+ };
1072
+ }
1073
+ const di = {
1008
1074
  bul: "bg",
1009
1075
  chi: "zh",
1010
1076
  zho: "zh",
@@ -1036,15 +1102,15 @@ const si = {
1036
1102
  tur: "tr",
1037
1103
  ukr: "uk",
1038
1104
  vie: "vi"
1039
- }, oi = O("KalambaBullseyePlugin", "color:#000000;font-weight:bold;");
1040
- var ve;
1041
- class Ni extends Qt {
1105
+ }, li = x("KalambaBullseyePlugin", "color:#000000;font-weight:bold;");
1106
+ var ke;
1107
+ class qi extends Yt {
1042
1108
  constructor(...t) {
1043
1109
  super(...t);
1044
1110
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
1045
1111
  // @ts-ignore
1046
- p(this, "socket");
1047
- E(this, ve, "");
1112
+ b(this, "socket");
1113
+ v(this, ke, "");
1048
1114
  this.on("openGame", async () => {
1049
1115
  try {
1050
1116
  const n = await this.openGame();
@@ -1060,20 +1126,20 @@ class Ni extends Qt {
1060
1126
  this.send("playError", a);
1061
1127
  }
1062
1128
  }), this.on("state", ({ version: n }) => {
1063
- v(this, ve, n);
1129
+ y(this, ke, n);
1064
1130
  }), this.on("configured", (n) => {
1065
1131
  this.socket.setRequestTimeoutMs(n.ui.requestTimeoutMs);
1066
1132
  }), this.registerFromSdkEvents();
1067
1133
  }
1068
1134
  initialize(t) {
1069
- this.socket = new ti(t, {
1070
- gameVersion: y(this, ve),
1135
+ this.socket = new ii(t, {
1136
+ gameVersion: E(this, ke),
1071
1137
  requestTimeoutMs: this.config.ui.requestTimeoutMs
1072
1138
  }), this.socket.addEventListener("close", (n) => {
1073
1139
  n.code === 1006 && this.reconnect(t);
1074
1140
  }), document.addEventListener("visibilitychange", () => {
1075
1141
  document.visibilityState === "visible" && this.socket.socket && this.socket.socket.readyState !== WebSocket.OPEN && this.reconnect(t);
1076
- }), this.socket.addEventListener("error", (n) => oi("error", n)), this.socket.addEventListener("realityCheck", (n) => {
1142
+ }), this.socket.addEventListener("error", (n) => li("error", n)), this.socket.addEventListener("realityCheck", (n) => {
1077
1143
  this.send("realityCheck", n);
1078
1144
  });
1079
1145
  }
@@ -1081,9 +1147,26 @@ class Ni extends Qt {
1081
1147
  this.initialize(t), await this.socket.connect(), await this.socket.authenticate(!0), await this.socket.openGame();
1082
1148
  }
1083
1149
  async openGame() {
1084
- const t = new URLSearchParams(window.location.search), n = t.get("apiUrl"), a = t.get("cageCode"), c = t.get("gameCode"), s = t.get("operatorCode"), h = t.get("playMode"), g = t.get("token"), w = t.get("username"), m = t.get("gameHistoryUrl"), A = t.get("homeUrl") ?? void 0, R = t.get("cashierUrl") ?? void 0;
1085
- this.initialize({ apiUrl: n, cageCode: a, gameCode: c, operatorCode: s, playMode: h, token: g, username: w }), await this.socket.connect();
1086
- const de = await this.socket.authenticate(), le = await this.socket.openGame(), L = ii(de), Se = ni(de, le);
1150
+ const t = new URLSearchParams(window.location.search), n = t.get("apiUrl"), a = t.get("cageCode"), c = t.get("gameCode"), s = t.get("operatorCode"), h = t.get("playMode"), g = t.get("token"), w = t.get("username"), m = t.get("gameHistoryUrl"), A = t.get("homeUrl") ?? void 0, N = t.get("cashierUrl") ?? void 0;
1151
+ this.initialize({ apiUrl: n, cageCode: a, gameCode: c, operatorCode: s, playMode: h, token: g, username: w });
1152
+ try {
1153
+ await this.socket.connect();
1154
+ } catch {
1155
+ throw { type: "error", data: { code: U.CONNECTION_ERROR } };
1156
+ }
1157
+ let X;
1158
+ try {
1159
+ X = await this.socket.authenticate();
1160
+ } catch (we) {
1161
+ throw ai(we);
1162
+ }
1163
+ let Y;
1164
+ try {
1165
+ Y = await this.socket.openGame();
1166
+ } catch (we) {
1167
+ throw oi(we);
1168
+ }
1169
+ const L = ni(X), ge = si(X, Y);
1087
1170
  this.config.api = {
1088
1171
  brand: a,
1089
1172
  game: c,
@@ -1099,24 +1182,32 @@ class Ni extends Qt {
1099
1182
  coinValueInCents: L.contract.coinValueInCents,
1100
1183
  gameHistoryUrl: m,
1101
1184
  homeUrl: A,
1102
- cashierUrl: R,
1103
- sessionId: Se.contract.sessionId
1185
+ cashierUrl: N,
1186
+ sessionId: ge.contract.sessionId,
1187
+ lastRoundId: ge.contract.roundId
1104
1188
  };
1105
- const x = t.get("languageCode");
1106
- return x && (this.config.ui.language = x.length === 3 ? si[x] ?? x : x), Se;
1189
+ const O = t.get("languageCode");
1190
+ return O && (this.config.ui.language = O.length === 3 ? di[O] ?? O : O), ge;
1107
1191
  }
1108
1192
  async play(t) {
1109
1193
  const {
1110
- contract: { bet: n, ...a },
1111
- extra: c,
1112
- actionType: s
1113
- } = t, h = await this.socket.sendAction(s, {
1194
+ contract: { bet: n, forceOutcome: a, ...c },
1195
+ extra: s,
1196
+ actionType: h
1197
+ } = t, g = {
1114
1198
  bet: n ? { baseBet: n.base, betMultiplier: n.multiplier } : void 0,
1199
+ forceOutcome: a,
1115
1200
  // TODO: get rid of contractRest - it' a legacy from old RGS
1116
- ...a,
1117
- opaqueUiToGameServer: c
1118
- }), g = ai(h);
1119
- return this.config.api.lastRoundId = g.contract.roundId, g;
1201
+ ...c,
1202
+ opaqueUiToGameServer: s
1203
+ };
1204
+ let w;
1205
+ try {
1206
+ w = await this.socket.sendAction(h, g);
1207
+ } catch (m) {
1208
+ throw ci(m);
1209
+ }
1210
+ return ri(w);
1120
1211
  }
1121
1212
  registerFromSdkEvents() {
1122
1213
  this.on("history", () => {
@@ -1128,76 +1219,76 @@ class Ni extends Qt {
1128
1219
  });
1129
1220
  }
1130
1221
  }
1131
- ve = new WeakMap();
1132
- var ri = "2.0.0-beta.2", oe = "", lt = "?", Je = "function", V = "undefined", re = "object", Ye = "string", me = "major", d = "model", o = "name", l = "type", u = "vendor", r = "version", S = "architecture", K = "console", b = "mobile", f = "tablet", I = "smarttv", X = "wearable", Ze = "embedded", ut = "user-agent", et = 500, nt = "brands", G = "formFactor", at = "fullVersionList", J = "platform", st = "platformVersion", Re = "bitness", q = "sec-ch-ua", ci = q + "-full-version-list", di = q + "-arch", li = q + "-" + Re, ui = q + "-form-factor", hi = q + "-" + b, gi = q + "-" + d, Bt = q + "-" + J, wi = Bt + "-version", Ft = [nt, at, b, d, J, st, S, G, Re], T = "browser", B = "cpu", U = "device", F = "engine", P = "os", Y = "result", Ie = "Amazon", he = "Apple", ht = "ASUS", gt = "BlackBerry", Te = "Google", wt = "Huawei", pt = "Lenovo", We = "LG", Le = "Microsoft", bt = "Motorola", Ae = "Samsung", mt = "Sharp", Pe = "Sony", $e = "Xiaomi", je = "Zebra", j = "Mobile ", Q = " Browser", xe = "Chrome", pi = "Edge", ge = "Firefox", we = "Opera", ft = "Facebook", yt = "Sogou", tt = "Windows", bi = typeof window !== V, C = bi && window.navigator ? window.navigator : void 0, N = C && C.userAgentData ? C.userAgentData : void 0, mi = function(i, e) {
1222
+ ke = new WeakMap();
1223
+ var ui = "2.0.0-beta.2", le = "", gt = "?", et = "function", z = "undefined", ue = "object", tt = "string", ve = "major", d = "model", o = "name", l = "type", u = "vendor", r = "version", k = "architecture", ee = "console", p = "mobile", f = "tablet", T = "smarttv", Z = "wearable", it = "embedded", wt = "user-agent", nt = 500, ot = "brands", $ = "formFactor", rt = "fullVersionList", te = "platform", ct = "platformVersion", Ve = "bitness", q = "sec-ch-ua", hi = q + "-full-version-list", gi = q + "-arch", wi = q + "-" + Ve, bi = q + "-form-factor", pi = q + "-" + p, mi = q + "-" + d, Bt = q + "-" + te, fi = Bt + "-version", Ft = [ot, rt, p, d, te, ct, k, $, Ve], C = "browser", D = "cpu", _ = "device", R = "engine", P = "os", ie = "result", Pe = "Amazon", pe = "Apple", bt = "ASUS", pt = "BlackBerry", Oe = "Google", mt = "Huawei", ft = "Lenovo", Qe = "LG", Re = "Microsoft", Et = "Motorola", _e = "Samsung", yt = "Sharp", Ue = "Sony", Xe = "Xiaomi", Ye = "Zebra", K = "Mobile ", J = " Browser", xe = "Chrome", Ei = "Edge", me = "Firefox", fe = "Opera", vt = "Facebook", St = "Sogou", at = "Windows", yi = typeof window !== z, I = yi && window.navigator ? window.navigator : void 0, H = I && I.userAgentData ? I.userAgentData : void 0, vi = function(i, e) {
1133
1224
  var t = {};
1134
1225
  for (var n in i)
1135
1226
  t[n] = e[n] && e[n].length % 2 === 0 ? e[n].concat(i[n]) : i[n];
1136
1227
  return t;
1137
- }, Ne = function(i) {
1228
+ }, ze = function(i) {
1138
1229
  for (var e = {}, t = 0; t < i.length; t++)
1139
1230
  e[i[t].toUpperCase()] = i[t];
1140
1231
  return e;
1141
- }, it = function(i, e) {
1142
- if (typeof i === re && i.length > 0) {
1232
+ }, st = function(i, e) {
1233
+ if (typeof i === ue && i.length > 0) {
1143
1234
  for (var t in i)
1144
- if (z(i[t]) == z(e))
1235
+ if (G(i[t]) == G(e))
1145
1236
  return !0;
1146
1237
  return !1;
1147
1238
  }
1148
- return ce(i) ? z(e).indexOf(z(i)) !== -1 : !1;
1149
- }, vt = function(i) {
1239
+ return he(i) ? G(e).indexOf(G(i)) !== -1 : !1;
1240
+ }, Mt = function(i) {
1150
1241
  for (var e in i)
1151
1242
  return /^(browser|cpu|device|engine|os)$/.test(e);
1152
- }, ce = function(i) {
1153
- return typeof i === Ye;
1154
- }, Qe = function(i) {
1243
+ }, he = function(i) {
1244
+ return typeof i === tt;
1245
+ }, Ke = function(i) {
1155
1246
  if (i) {
1156
- for (var e = [], t = W(/\\?\"/g, i).split(","), n = 0; n < t.length; n++)
1247
+ for (var e = [], t = j(/\\?\"/g, i).split(","), n = 0; n < t.length; n++)
1157
1248
  if (t[n].indexOf(";") > -1) {
1158
- var a = fe(t[n]).split(";v=");
1249
+ var a = Se(t[n]).split(";v=");
1159
1250
  e[n] = { brand: a[0], version: a[1] };
1160
1251
  } else
1161
- e[n] = fe(t[n]);
1252
+ e[n] = Se(t[n]);
1162
1253
  return e;
1163
1254
  }
1164
- }, z = function(i) {
1165
- return ce(i) ? i.toLowerCase() : i;
1166
- }, Xe = function(i) {
1167
- return ce(i) ? W(/[^\d\.]/g, i).split(".")[0] : void 0;
1168
- }, _ = function(i) {
1255
+ }, G = function(i) {
1256
+ return he(i) ? i.toLowerCase() : i;
1257
+ }, Je = function(i) {
1258
+ return he(i) ? j(/[^\d\.]/g, i).split(".")[0] : void 0;
1259
+ }, B = function(i) {
1169
1260
  for (var e in i) {
1170
1261
  var t = i[e];
1171
- typeof t == re && t.length == 2 ? this[t[0]] = t[1] : this[t] = void 0;
1262
+ typeof t == ue && t.length == 2 ? this[t[0]] = t[1] : this[t] = void 0;
1172
1263
  }
1173
1264
  return this;
1174
- }, W = function(i, e) {
1175
- return ce(e) ? e.replace(i, oe) : e;
1176
- }, pe = function(i) {
1177
- return W(/\\?\"/g, i);
1178
- }, fe = function(i, e) {
1179
- if (ce(i))
1180
- return i = W(/^\s\s*/, i), typeof e === V ? i : i.substring(0, et);
1181
- }, Et = function(i, e) {
1265
+ }, j = function(i, e) {
1266
+ return he(e) ? e.replace(i, le) : e;
1267
+ }, Ee = function(i) {
1268
+ return j(/\\?\"/g, i);
1269
+ }, Se = function(i, e) {
1270
+ if (he(i))
1271
+ return i = j(/^\s\s*/, i), typeof e === z ? i : i.substring(0, nt);
1272
+ }, kt = function(i, e) {
1182
1273
  if (!(!i || !e))
1183
1274
  for (var t = 0, n, a, c, s, h, g; t < e.length && !h; ) {
1184
1275
  var w = e[t], m = e[t + 1];
1185
1276
  for (n = a = 0; n < w.length && !h && w[n]; )
1186
1277
  if (h = w[n++].exec(i), h)
1187
1278
  for (c = 0; c < m.length; c++)
1188
- g = h[++a], s = m[c], typeof s === re && s.length > 0 ? s.length === 2 ? typeof s[1] == Je ? this[s[0]] = s[1].call(this, g) : this[s[0]] = s[1] : s.length === 3 ? typeof s[1] === Je && !(s[1].exec && s[1].test) ? this[s[0]] = g ? s[1].call(this, g, s[2]) : void 0 : this[s[0]] = g ? g.replace(s[1], s[2]) : void 0 : s.length === 4 && (this[s[0]] = g ? s[3].call(this, g.replace(s[1], s[2])) : void 0) : this[s] = g || void 0;
1279
+ g = h[++a], s = m[c], typeof s === ue && s.length > 0 ? s.length === 2 ? typeof s[1] == et ? this[s[0]] = s[1].call(this, g) : this[s[0]] = s[1] : s.length === 3 ? typeof s[1] === et && !(s[1].exec && s[1].test) ? this[s[0]] = g ? s[1].call(this, g, s[2]) : void 0 : this[s[0]] = g ? g.replace(s[1], s[2]) : void 0 : s.length === 4 && (this[s[0]] = g ? s[3].call(this, g.replace(s[1], s[2])) : void 0) : this[s] = g || void 0;
1189
1280
  t += 2;
1190
1281
  }
1191
1282
  }, Be = function(i, e) {
1192
1283
  for (var t in e)
1193
- if (typeof e[t] === re && e[t].length > 0) {
1284
+ if (typeof e[t] === ue && e[t].length > 0) {
1194
1285
  for (var n = 0; n < e[t].length; n++)
1195
- if (it(e[t][n], i))
1196
- return t === lt ? void 0 : t;
1197
- } else if (it(e[t], i))
1198
- return t === lt ? void 0 : t;
1286
+ if (st(e[t][n], i))
1287
+ return t === gt ? void 0 : t;
1288
+ } else if (st(e[t], i))
1289
+ return t === gt ? void 0 : t;
1199
1290
  return e.hasOwnProperty("*") ? e["*"] : i;
1200
- }, kt = {
1291
+ }, It = {
1201
1292
  ME: "4.90",
1202
1293
  "NT 3.11": "NT3.51",
1203
1294
  "NT 4.0": "NT4.0",
@@ -1209,7 +1300,7 @@ var ri = "2.0.0-beta.2", oe = "", lt = "?", Je = "function", V = "undefined", re
1209
1300
  "8.1": "NT 6.3",
1210
1301
  10: ["NT 6.4", "NT 10.0"],
1211
1302
  RT: "ARM"
1212
- }, Mt = {
1303
+ }, Tt = {
1213
1304
  embedded: "Automotive",
1214
1305
  mobile: "Mobile",
1215
1306
  tablet: ["Tablet", "EInk"],
@@ -1217,14 +1308,14 @@ var ri = "2.0.0-beta.2", oe = "", lt = "?", Je = "function", V = "undefined", re
1217
1308
  wearable: ["VR", "XR", "Watch"],
1218
1309
  "?": ["Desktop", "Unknown"],
1219
1310
  "*": void 0
1220
- }, St = {
1311
+ }, Ct = {
1221
1312
  browser: [
1222
1313
  [
1223
1314
  // Most common regardless engine
1224
1315
  /\b(?:crmo|crios)\/([\w\.]+)/i
1225
1316
  // Chrome for Android/iOS
1226
1317
  ],
1227
- [r, [o, j + "Chrome"]],
1318
+ [r, [o, K + "Chrome"]],
1228
1319
  [
1229
1320
  /edg(?:e|ios|a)?\/([\w\.]+)/i
1230
1321
  // Microsoft Edge
@@ -1244,17 +1335,17 @@ var ri = "2.0.0-beta.2", oe = "", lt = "?", Je = "function", V = "undefined", re
1244
1335
  /opios[\/ ]+([\w\.]+)/i
1245
1336
  // Opera mini on iphone >= 8.0
1246
1337
  ],
1247
- [r, [o, we + " Mini"]],
1338
+ [r, [o, fe + " Mini"]],
1248
1339
  [
1249
1340
  /\bop(?:rg)?x\/([\w\.]+)/i
1250
1341
  // Opera GX
1251
1342
  ],
1252
- [r, [o, we + " GX"]],
1343
+ [r, [o, fe + " GX"]],
1253
1344
  [
1254
1345
  /\bopr\/([\w\.]+)/i
1255
1346
  // Opera Webkit
1256
1347
  ],
1257
- [r, [o, we]],
1348
+ [r, [o, fe]],
1258
1349
  [
1259
1350
  // Mixed
1260
1351
  /\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i
@@ -1312,22 +1403,22 @@ var ri = "2.0.0-beta.2", oe = "", lt = "?", Je = "function", V = "undefined", re
1312
1403
  /slbrowser\/([\w\.]+)/i
1313
1404
  // Smart Lenovo Browser
1314
1405
  ],
1315
- [r, [o, "Smart " + pt + Q]],
1406
+ [r, [o, "Smart " + ft + J]],
1316
1407
  [
1317
1408
  /(avast|avg)\/([\w\.]+)/i
1318
1409
  // Avast/AVG Secure Browser
1319
1410
  ],
1320
- [[o, /(.+)/, "$1 Secure" + Q], r],
1411
+ [[o, /(.+)/, "$1 Secure" + J], r],
1321
1412
  [
1322
1413
  /\bfocus\/([\w\.]+)/i
1323
1414
  // Firefox Focus
1324
1415
  ],
1325
- [r, [o, ge + " Focus"]],
1416
+ [r, [o, me + " Focus"]],
1326
1417
  [
1327
1418
  /\bopt\/([\w\.]+)/i
1328
1419
  // Opera Touch
1329
1420
  ],
1330
- [r, [o, we + " Touch"]],
1421
+ [r, [o, fe + " Touch"]],
1331
1422
  [
1332
1423
  /coc_coc\w+\/([\w\.]+)/i
1333
1424
  // Coc Coc Browser
@@ -1342,32 +1433,32 @@ var ri = "2.0.0-beta.2", oe = "", lt = "?", Je = "function", V = "undefined", re
1342
1433
  /coast\/([\w\.]+)/i
1343
1434
  // Opera Coast
1344
1435
  ],
1345
- [r, [o, we + " Coast"]],
1436
+ [r, [o, fe + " Coast"]],
1346
1437
  [
1347
1438
  /miuibrowser\/([\w\.]+)/i
1348
1439
  // MIUI Browser
1349
1440
  ],
1350
- [r, [o, "MIUI" + Q]],
1441
+ [r, [o, "MIUI" + J]],
1351
1442
  [
1352
1443
  /fxios\/([\w\.-]+)/i
1353
1444
  // Firefox for iOS
1354
1445
  ],
1355
- [r, [o, j + ge]],
1446
+ [r, [o, K + me]],
1356
1447
  [
1357
1448
  /\bqihu|(qi?ho?o?|360)browser/i
1358
1449
  // 360
1359
1450
  ],
1360
- [[o, "360" + Q]],
1451
+ [[o, "360" + J]],
1361
1452
  [
1362
1453
  /(oculus|sailfish|huawei|vivo)browser\/([\w\.]+)/i
1363
1454
  ],
1364
- [[o, /(.+)/, "$1" + Q], r],
1455
+ [[o, /(.+)/, "$1" + J], r],
1365
1456
  [
1366
1457
  // Oculus/Sailfish/HuaweiBrowser/VivoBrowser
1367
1458
  /samsungbrowser\/([\w\.]+)/i
1368
1459
  // Samsung Internet
1369
1460
  ],
1370
- [r, [o, Ae + " Internet"]],
1461
+ [r, [o, _e + " Internet"]],
1371
1462
  [
1372
1463
  /(comodo_dragon)\/([\w\.]+)/i
1373
1464
  // Comodo Dragon
@@ -1377,12 +1468,12 @@ var ri = "2.0.0-beta.2", oe = "", lt = "?", Je = "function", V = "undefined", re
1377
1468
  /metasr[\/ ]?([\d\.]+)/i
1378
1469
  // Sogou Explorer
1379
1470
  ],
1380
- [r, [o, yt + " Explorer"]],
1471
+ [r, [o, St + " Explorer"]],
1381
1472
  [
1382
1473
  /(sogou)mo\w+\/([\d\.]+)/i
1383
1474
  // Sogou Mobile
1384
1475
  ],
1385
- [[o, yt + " Mobile"], r],
1476
+ [[o, St + " Mobile"], r],
1386
1477
  [
1387
1478
  /(electron)\/([\w\.]+) safari/i,
1388
1479
  // Electron-based App
@@ -1404,7 +1495,7 @@ var ri = "2.0.0-beta.2", oe = "", lt = "?", Je = "function", V = "undefined", re
1404
1495
  /((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i
1405
1496
  // Facebook App for iOS & Android
1406
1497
  ],
1407
- [[o, ft], r],
1498
+ [[o, vt], r],
1408
1499
  [
1409
1500
  /(Klarna)\/([\w\.]+)/i,
1410
1501
  // Klarna Shopping Browser for iOS & Android
@@ -1446,12 +1537,12 @@ var ri = "2.0.0-beta.2", oe = "", lt = "?", Je = "function", V = "undefined", re
1446
1537
  /droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i
1447
1538
  // Android Browser
1448
1539
  ],
1449
- [r, [o, "Android" + Q]],
1540
+ [r, [o, "Android" + J]],
1450
1541
  [
1451
1542
  /chrome\/([\w\.]+) mobile/i
1452
1543
  // Chrome Mobile
1453
1544
  ],
1454
- [r, [o, j + "Chrome"]],
1545
+ [r, [o, K + "Chrome"]],
1455
1546
  [
1456
1547
  /(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i
1457
1548
  // Chrome/OmniWeb/Arora/Tizen/Nokia
@@ -1461,11 +1552,11 @@ var ri = "2.0.0-beta.2", oe = "", lt = "?", Je = "function", V = "undefined", re
1461
1552
  /version\/([\w\.\,]+) .*mobile(?:\/\w+ | ?)safari/i
1462
1553
  // Safari Mobile
1463
1554
  ],
1464
- [r, [o, j + "Safari"]],
1555
+ [r, [o, K + "Safari"]],
1465
1556
  [
1466
1557
  /iphone .*mobile(?:\/\w+ | ?)safari/i
1467
1558
  ],
1468
- [[o, j + "Safari"]],
1559
+ [[o, K + "Safari"]],
1469
1560
  [
1470
1561
  /version\/([\w\.\,]+) .*(safari)/i
1471
1562
  // Safari
@@ -1485,7 +1576,7 @@ var ri = "2.0.0-beta.2", oe = "", lt = "?", Je = "function", V = "undefined", re
1485
1576
  /(?:mobile|tablet);.*(firefox)\/([\w\.-]+)/i
1486
1577
  // Firefox Mobile
1487
1578
  ],
1488
- [[o, j + ge], r],
1579
+ [[o, K + me], r],
1489
1580
  [
1490
1581
  /(navigator|netscape\d?)\/([-\w\.]+)/i
1491
1582
  // Netscape
@@ -1495,7 +1586,7 @@ var ri = "2.0.0-beta.2", oe = "", lt = "?", Je = "function", V = "undefined", re
1495
1586
  /mobile vr; rv:([\w\.]+)\).+firefox/i
1496
1587
  // Firefox Reality
1497
1588
  ],
1498
- [r, [o, ge + " Reality"]],
1589
+ [r, [o, me + " Reality"]],
1499
1590
  [
1500
1591
  /ekiohf.+(flow)\/([\w\.]+)/i,
1501
1592
  // Flow
@@ -1522,51 +1613,51 @@ var ri = "2.0.0-beta.2", oe = "", lt = "?", Je = "function", V = "undefined", re
1522
1613
  /(cobalt)\/([\w\.]+)/i
1523
1614
  // Cobalt
1524
1615
  ],
1525
- [o, [r, /[^\d\.]+./, oe]]
1616
+ [o, [r, /[^\d\.]+./, le]]
1526
1617
  ],
1527
1618
  cpu: [
1528
1619
  [
1529
1620
  /\b(?:(amd|x|x86[-_]?|wow|win)64)\b/i
1530
1621
  // AMD64 (x64)
1531
1622
  ],
1532
- [[S, "amd64"]],
1623
+ [[k, "amd64"]],
1533
1624
  [
1534
1625
  /(ia32(?=;))/i,
1535
1626
  // IA32 (quicktime)
1536
1627
  /((?:i[346]|x)86)[;\)]/i
1537
1628
  // IA32 (x86)
1538
1629
  ],
1539
- [[S, "ia32"]],
1630
+ [[k, "ia32"]],
1540
1631
  [
1541
1632
  /\b(aarch64|arm(v?8e?l?|_?64))\b/i
1542
1633
  // ARM64
1543
1634
  ],
1544
- [[S, "arm64"]],
1635
+ [[k, "arm64"]],
1545
1636
  [
1546
1637
  /\b(arm(?:v[67])?ht?n?[fl]p?)\b/i
1547
1638
  // ARMHF
1548
1639
  ],
1549
- [[S, "armhf"]],
1640
+ [[k, "armhf"]],
1550
1641
  [
1551
1642
  // PocketPC mistakenly identified as PowerPC
1552
1643
  /windows (ce|mobile); ppc;/i
1553
1644
  ],
1554
- [[S, "arm"]],
1645
+ [[k, "arm"]],
1555
1646
  [
1556
1647
  /((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i
1557
1648
  // PowerPC
1558
1649
  ],
1559
- [[S, /ower/, oe, z]],
1650
+ [[k, /ower/, le, G]],
1560
1651
  [
1561
1652
  /(sun4\w)[;\)]/i
1562
1653
  // SPARC
1563
1654
  ],
1564
- [[S, "sparc"]],
1655
+ [[k, "sparc"]],
1565
1656
  [
1566
1657
  /((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i
1567
1658
  // IA64, 68K, ARM/64, AVR/32, IRIX/64, MIPS/64, SPARC/64, PA-RISC
1568
1659
  ],
1569
- [[S, z]]
1660
+ [[k, G]]
1570
1661
  ],
1571
1662
  device: [
1572
1663
  [
@@ -1576,45 +1667,45 @@ var ri = "2.0.0-beta.2", oe = "", lt = "?", Je = "function", V = "undefined", re
1576
1667
  // Samsung
1577
1668
  /\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i
1578
1669
  ],
1579
- [d, [u, Ae], [l, f]],
1670
+ [d, [u, _e], [l, f]],
1580
1671
  [
1581
1672
  /\b((?:s[cgp]h|gt|sm)-\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,
1582
1673
  /samsung[- ]([-\w]+)/i,
1583
1674
  /sec-(sgh\w+)/i
1584
1675
  ],
1585
- [d, [u, Ae], [l, b]],
1676
+ [d, [u, _e], [l, p]],
1586
1677
  [
1587
1678
  // Apple
1588
1679
  /(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i
1589
1680
  // iPod/iPhone
1590
1681
  ],
1591
- [d, [u, he], [l, b]],
1682
+ [d, [u, pe], [l, p]],
1592
1683
  [
1593
1684
  /\((ipad);[-\w\),; ]+apple/i,
1594
1685
  // iPad
1595
1686
  /applecoremedia\/[\w\.]+ \((ipad)/i,
1596
1687
  /\b(ipad)\d\d?,\d\d?[;\]].+ios/i
1597
1688
  ],
1598
- [d, [u, he], [l, f]],
1689
+ [d, [u, pe], [l, f]],
1599
1690
  [
1600
1691
  /(macintosh);/i
1601
1692
  ],
1602
- [d, [u, he]],
1693
+ [d, [u, pe]],
1603
1694
  [
1604
1695
  // Sharp
1605
1696
  /\b(sh-?[altvz]?\d\d[a-ekm]?)/i
1606
1697
  ],
1607
- [d, [u, mt], [l, b]],
1698
+ [d, [u, yt], [l, p]],
1608
1699
  [
1609
1700
  // Huawei
1610
1701
  /\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i
1611
1702
  ],
1612
- [d, [u, wt], [l, f]],
1703
+ [d, [u, mt], [l, f]],
1613
1704
  [
1614
1705
  /(?:huawei|honor)([-\w ]+)[;\)]/i,
1615
1706
  /\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i
1616
1707
  ],
1617
- [d, [u, wt], [l, b]],
1708
+ [d, [u, mt], [l, p]],
1618
1709
  [
1619
1710
  // Xiaomi
1620
1711
  /\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,
@@ -1630,92 +1721,92 @@ var ri = "2.0.0-beta.2", oe = "", lt = "?", Je = "function", V = "undefined", re
1630
1721
  /\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i
1631
1722
  // Xiaomi Mi
1632
1723
  ],
1633
- [[d, /_/g, " "], [u, $e], [l, b]],
1724
+ [[d, /_/g, " "], [u, Xe], [l, p]],
1634
1725
  [
1635
1726
  /oid[^\)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i,
1636
1727
  // Redmi Pad
1637
1728
  /\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i
1638
1729
  // Mi Pad tablets
1639
1730
  ],
1640
- [[d, /_/g, " "], [u, $e], [l, f]],
1731
+ [[d, /_/g, " "], [u, Xe], [l, f]],
1641
1732
  [
1642
1733
  // OPPO
1643
1734
  /; (\w+) bui.+ oppo/i,
1644
1735
  /\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i
1645
1736
  ],
1646
- [d, [u, "OPPO"], [l, b]],
1737
+ [d, [u, "OPPO"], [l, p]],
1647
1738
  [
1648
1739
  // Vivo
1649
1740
  /vivo (\w+)(?: bui|\))/i,
1650
1741
  /\b(v[12]\d{3}\w?[at])(?: bui|;)/i
1651
1742
  ],
1652
- [d, [u, "Vivo"], [l, b]],
1743
+ [d, [u, "Vivo"], [l, p]],
1653
1744
  [
1654
1745
  // Realme
1655
1746
  /\b(rmx[1-3]\d{3})(?: bui|;|\))/i
1656
1747
  ],
1657
- [d, [u, "Realme"], [l, b]],
1748
+ [d, [u, "Realme"], [l, p]],
1658
1749
  [
1659
1750
  // Motorola
1660
1751
  /\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,
1661
1752
  /\bmot(?:orola)?[- ](\w*)/i,
1662
1753
  /((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i
1663
1754
  ],
1664
- [d, [u, bt], [l, b]],
1755
+ [d, [u, Et], [l, p]],
1665
1756
  [
1666
1757
  /\b(mz60\d|xoom[2 ]{0,2}) build\//i
1667
1758
  ],
1668
- [d, [u, bt], [l, f]],
1759
+ [d, [u, Et], [l, f]],
1669
1760
  [
1670
1761
  // LG
1671
1762
  /((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i
1672
1763
  ],
1673
- [d, [u, We], [l, f]],
1764
+ [d, [u, Qe], [l, f]],
1674
1765
  [
1675
1766
  /(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,
1676
1767
  /\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,
1677
1768
  /\blg-?([\d\w]+) bui/i
1678
1769
  ],
1679
- [d, [u, We], [l, b]],
1770
+ [d, [u, Qe], [l, p]],
1680
1771
  [
1681
1772
  // Lenovo
1682
1773
  /(ideatab[-\w ]+)/i,
1683
1774
  /lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i
1684
1775
  ],
1685
- [d, [u, pt], [l, f]],
1776
+ [d, [u, ft], [l, f]],
1686
1777
  [
1687
1778
  // Nokia
1688
1779
  /(?:maemo|nokia).*(n900|lumia \d+)/i,
1689
1780
  /nokia[-_ ]?([-\w\.]*)/i
1690
1781
  ],
1691
- [[d, /_/g, " "], [u, "Nokia"], [l, b]],
1782
+ [[d, /_/g, " "], [u, "Nokia"], [l, p]],
1692
1783
  [
1693
1784
  // Google
1694
1785
  /(pixel c)\b/i
1695
1786
  // Google Pixel C
1696
1787
  ],
1697
- [d, [u, Te], [l, f]],
1788
+ [d, [u, Oe], [l, f]],
1698
1789
  [
1699
1790
  /droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i
1700
1791
  // Google Pixel
1701
1792
  ],
1702
- [d, [u, Te], [l, b]],
1793
+ [d, [u, Oe], [l, p]],
1703
1794
  [
1704
1795
  // Sony
1705
1796
  /droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i
1706
1797
  ],
1707
- [d, [u, Pe], [l, b]],
1798
+ [d, [u, Ue], [l, p]],
1708
1799
  [
1709
1800
  /sony tablet [ps]/i,
1710
1801
  /\b(?:sony)?sgp\w+(?: bui|\))/i
1711
1802
  ],
1712
- [[d, "Xperia Tablet"], [u, Pe], [l, f]],
1803
+ [[d, "Xperia Tablet"], [u, Ue], [l, f]],
1713
1804
  [
1714
1805
  // OnePlus
1715
1806
  / (kb2005|in20[12]5|be20[12][59])\b/i,
1716
1807
  /(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i
1717
1808
  ],
1718
- [d, [u, "OnePlus"], [l, b]],
1809
+ [d, [u, "OnePlus"], [l, p]],
1719
1810
  [
1720
1811
  // Amazon
1721
1812
  /(alexa)webm/i,
@@ -1724,12 +1815,12 @@ var ri = "2.0.0-beta.2", oe = "", lt = "?", Je = "function", V = "undefined", re
1724
1815
  /(kf[a-z]+)( bui|\)).+silk\//i
1725
1816
  // Kindle Fire HD
1726
1817
  ],
1727
- [d, [u, Ie], [l, f]],
1818
+ [d, [u, Pe], [l, f]],
1728
1819
  [
1729
1820
  /((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i
1730
1821
  // Fire Phone
1731
1822
  ],
1732
- [[d, /(.+)/g, "Fire Phone $1"], [u, Ie], [l, b]],
1823
+ [[d, /(.+)/g, "Fire Phone $1"], [u, Pe], [l, p]],
1733
1824
  [
1734
1825
  // BlackBerry
1735
1826
  /(playbook);[-\w\),; ]+(rim)/i
@@ -1741,16 +1832,16 @@ var ri = "2.0.0-beta.2", oe = "", lt = "?", Je = "function", V = "undefined", re
1741
1832
  /\(bb10; (\w+)/i
1742
1833
  // BlackBerry 10
1743
1834
  ],
1744
- [d, [u, gt], [l, b]],
1835
+ [d, [u, pt], [l, p]],
1745
1836
  [
1746
1837
  // Asus
1747
1838
  /(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i
1748
1839
  ],
1749
- [d, [u, ht], [l, f]],
1840
+ [d, [u, bt], [l, f]],
1750
1841
  [
1751
1842
  / (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i
1752
1843
  ],
1753
- [d, [u, ht], [l, b]],
1844
+ [d, [u, bt], [l, p]],
1754
1845
  [
1755
1846
  // HTC
1756
1847
  /(nexus 9)/i
@@ -1765,7 +1856,7 @@ var ri = "2.0.0-beta.2", oe = "", lt = "?", Je = "function", V = "undefined", re
1765
1856
  /(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i
1766
1857
  // Alcatel/GeeksPhone/Nexian/Panasonic/Sony
1767
1858
  ],
1768
- [u, [d, /_/g, " "], [l, b]],
1859
+ [u, [d, /_/g, " "], [l, p]],
1769
1860
  [
1770
1861
  // Acer
1771
1862
  /droid.+; ([ab][1-7]-?[0178a]\d\d?)/i
@@ -1776,12 +1867,12 @@ var ri = "2.0.0-beta.2", oe = "", lt = "?", Je = "function", V = "undefined", re
1776
1867
  /droid.+; (m[1-5] note) bui/i,
1777
1868
  /\bmz-([-\w]{2,})/i
1778
1869
  ],
1779
- [d, [u, "Meizu"], [l, b]],
1870
+ [d, [u, "Meizu"], [l, p]],
1780
1871
  [
1781
1872
  // Ulefone
1782
1873
  /; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i
1783
1874
  ],
1784
- [d, [u, "Ulefone"], [l, b]],
1875
+ [d, [u, "Ulefone"], [l, p]],
1785
1876
  [
1786
1877
  // MIXED
1787
1878
  /(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron|infinix|tecno)[-_ ]?([-\w]*)/i,
@@ -1799,7 +1890,7 @@ var ri = "2.0.0-beta.2", oe = "", lt = "?", Je = "function", V = "undefined", re
1799
1890
  /(oppo) ?([\w ]+) bui/i
1800
1891
  // OPPO
1801
1892
  ],
1802
- [u, d, [l, b]],
1893
+ [u, d, [l, p]],
1803
1894
  [
1804
1895
  /(kobo)\s(ereader|touch)/i,
1805
1896
  // Kobo
@@ -1815,12 +1906,12 @@ var ri = "2.0.0-beta.2", oe = "", lt = "?", Je = "function", V = "undefined", re
1815
1906
  /(surface duo)/i
1816
1907
  // Surface Duo
1817
1908
  ],
1818
- [d, [u, Le], [l, f]],
1909
+ [d, [u, Re], [l, f]],
1819
1910
  [
1820
1911
  /droid [\d\.]+; (fp\du?)(?: b|\))/i
1821
1912
  // Fairphone
1822
1913
  ],
1823
- [d, [u, "Fairphone"], [l, b]],
1914
+ [d, [u, "Fairphone"], [l, p]],
1824
1915
  [
1825
1916
  /(shield[\w ]+) b/i
1826
1917
  // Nvidia Shield Tablets
@@ -1830,21 +1921,21 @@ var ri = "2.0.0-beta.2", oe = "", lt = "?", Je = "function", V = "undefined", re
1830
1921
  /(sprint) (\w+)/i
1831
1922
  // Sprint Phones
1832
1923
  ],
1833
- [u, d, [l, b]],
1924
+ [u, d, [l, p]],
1834
1925
  [
1835
1926
  /(kin\.[onetw]{3})/i
1836
1927
  // Microsoft Kin
1837
1928
  ],
1838
- [[d, /\./g, " "], [u, Le], [l, b]],
1929
+ [[d, /\./g, " "], [u, Re], [l, p]],
1839
1930
  [
1840
1931
  /droid.+; ([c6]+|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i
1841
1932
  // Zebra
1842
1933
  ],
1843
- [d, [u, je], [l, f]],
1934
+ [d, [u, Ye], [l, f]],
1844
1935
  [
1845
1936
  /droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i
1846
1937
  ],
1847
- [d, [u, je], [l, b]],
1938
+ [d, [u, Ye], [l, p]],
1848
1939
  [
1849
1940
  ///////////////////
1850
1941
  // SMARTTVS
@@ -1852,64 +1943,64 @@ var ri = "2.0.0-beta.2", oe = "", lt = "?", Je = "function", V = "undefined", re
1852
1943
  /smart-tv.+(samsung)/i
1853
1944
  // Samsung
1854
1945
  ],
1855
- [u, [l, I]],
1946
+ [u, [l, T]],
1856
1947
  [
1857
1948
  /hbbtv.+maple;(\d+)/i
1858
1949
  ],
1859
- [[d, /^/, "SmartTV"], [u, Ae], [l, I]],
1950
+ [[d, /^/, "SmartTV"], [u, _e], [l, T]],
1860
1951
  [
1861
1952
  /(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i
1862
1953
  // LG SmartTV
1863
1954
  ],
1864
- [[u, We], [l, I]],
1955
+ [[u, Qe], [l, T]],
1865
1956
  [
1866
1957
  /(apple) ?tv/i
1867
1958
  // Apple TV
1868
1959
  ],
1869
- [u, [d, he + " TV"], [l, I]],
1960
+ [u, [d, pe + " TV"], [l, T]],
1870
1961
  [
1871
1962
  /crkey/i
1872
1963
  // Google Chromecast
1873
1964
  ],
1874
- [[d, xe + "cast"], [u, Te], [l, I]],
1965
+ [[d, xe + "cast"], [u, Oe], [l, T]],
1875
1966
  [
1876
1967
  /droid.+aft(\w+)( bui|\))/i
1877
1968
  // Fire TV
1878
1969
  ],
1879
- [d, [u, Ie], [l, I]],
1970
+ [d, [u, Pe], [l, T]],
1880
1971
  [
1881
1972
  /\(dtv[\);].+(aquos)/i,
1882
1973
  /(aquos-tv[\w ]+)\)/i
1883
1974
  // Sharp
1884
1975
  ],
1885
- [d, [u, mt], [l, I]],
1976
+ [d, [u, yt], [l, T]],
1886
1977
  [
1887
1978
  /(bravia[\w ]+)( bui|\))/i
1888
1979
  // Sony
1889
1980
  ],
1890
- [d, [u, Pe], [l, I]],
1981
+ [d, [u, Ue], [l, T]],
1891
1982
  [
1892
1983
  /(mitv-\w{5}) bui/i
1893
1984
  // Xiaomi
1894
1985
  ],
1895
- [d, [u, $e], [l, I]],
1986
+ [d, [u, Xe], [l, T]],
1896
1987
  [
1897
1988
  /Hbbtv.*(technisat) (.*);/i
1898
1989
  // TechniSAT
1899
1990
  ],
1900
- [u, d, [l, I]],
1991
+ [u, d, [l, T]],
1901
1992
  [
1902
1993
  /\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,
1903
1994
  // Roku
1904
1995
  /hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i
1905
1996
  // HbbTV devices
1906
1997
  ],
1907
- [[u, fe], [d, fe], [l, I]],
1998
+ [[u, Se], [d, Se], [l, T]],
1908
1999
  [
1909
2000
  /\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i
1910
2001
  // SmartTV from Unidentified Vendors
1911
2002
  ],
1912
- [[l, I]],
2003
+ [[l, T]],
1913
2004
  [
1914
2005
  ///////////////////
1915
2006
  // CONSOLES
@@ -1919,22 +2010,22 @@ var ri = "2.0.0-beta.2", oe = "", lt = "?", Je = "function", V = "undefined", re
1919
2010
  /(nintendo) (\w+)/i
1920
2011
  // Nintendo
1921
2012
  ],
1922
- [u, d, [l, K]],
2013
+ [u, d, [l, ee]],
1923
2014
  [
1924
2015
  /droid.+; (shield) bui/i
1925
2016
  // Nvidia
1926
2017
  ],
1927
- [d, [u, "Nvidia"], [l, K]],
2018
+ [d, [u, "Nvidia"], [l, ee]],
1928
2019
  [
1929
2020
  /(playstation \w+)/i
1930
2021
  // Playstation
1931
2022
  ],
1932
- [d, [u, Pe], [l, K]],
2023
+ [d, [u, Ue], [l, ee]],
1933
2024
  [
1934
2025
  /\b(xbox(?: one)?(?!; xbox))[\); ]/i
1935
2026
  // Microsoft Xbox
1936
2027
  ],
1937
- [d, [u, Le], [l, K]],
2028
+ [d, [u, Re], [l, ee]],
1938
2029
  [
1939
2030
  ///////////////////
1940
2031
  // WEARABLES
@@ -1942,26 +2033,26 @@ var ri = "2.0.0-beta.2", oe = "", lt = "?", Je = "function", V = "undefined", re
1942
2033
  /((pebble))app/i
1943
2034
  // Pebble
1944
2035
  ],
1945
- [u, d, [l, X]],
2036
+ [u, d, [l, Z]],
1946
2037
  [
1947
2038
  /(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i
1948
2039
  // Apple Watch
1949
2040
  ],
1950
- [d, [u, he], [l, X]],
2041
+ [d, [u, pe], [l, Z]],
1951
2042
  [
1952
2043
  /droid.+; (glass) \d/i
1953
2044
  // Google Glass
1954
2045
  ],
1955
- [d, [u, Te], [l, X]],
2046
+ [d, [u, Oe], [l, Z]],
1956
2047
  [
1957
2048
  /droid.+; (wt63?0{2,3})\)/i
1958
2049
  ],
1959
- [d, [u, je], [l, X]],
2050
+ [d, [u, Ye], [l, Z]],
1960
2051
  [
1961
2052
  /(quest( 2| pro)?)/i
1962
2053
  // Oculus Quest
1963
2054
  ],
1964
- [d, [u, ft], [l, X]],
2055
+ [d, [u, vt], [l, Z]],
1965
2056
  [
1966
2057
  ///////////////////
1967
2058
  // EMBEDDED
@@ -1969,12 +2060,12 @@ var ri = "2.0.0-beta.2", oe = "", lt = "?", Je = "function", V = "undefined", re
1969
2060
  /(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i
1970
2061
  // Tesla
1971
2062
  ],
1972
- [u, [l, Ze]],
2063
+ [u, [l, it]],
1973
2064
  [
1974
2065
  /(aeobc)\b/i
1975
2066
  // Echo Dot
1976
2067
  ],
1977
- [d, [u, Ie], [l, Ze]],
2068
+ [d, [u, Pe], [l, it]],
1978
2069
  [
1979
2070
  ////////////////////
1980
2071
  // MIXED (GENERIC)
@@ -1982,7 +2073,7 @@ var ri = "2.0.0-beta.2", oe = "", lt = "?", Je = "function", V = "undefined", re
1982
2073
  /droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i
1983
2074
  // Android Phones from Unidentified Vendors
1984
2075
  ],
1985
- [d, [l, b]],
2076
+ [d, [l, p]],
1986
2077
  [
1987
2078
  /droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i
1988
2079
  // Android Tablets from Unidentified Vendors
@@ -1997,7 +2088,7 @@ var ri = "2.0.0-beta.2", oe = "", lt = "?", Je = "function", V = "undefined", re
1997
2088
  /(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i
1998
2089
  // Unidentifiable Mobile
1999
2090
  ],
2000
- [[l, b]],
2091
+ [[l, p]],
2001
2092
  [
2002
2093
  /(android[-\w\. ]{0,9});.+buil/i
2003
2094
  // Generic Android Device
@@ -2009,7 +2100,7 @@ var ri = "2.0.0-beta.2", oe = "", lt = "?", Je = "function", V = "undefined", re
2009
2100
  /windows.+ edge\/([\w\.]+)/i
2010
2101
  // EdgeHTML
2011
2102
  ],
2012
- [r, [o, pi + "HTML"]],
2103
+ [r, [o, Ei + "HTML"]],
2013
2104
  [
2014
2105
  /webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i
2015
2106
  // Blink
@@ -2046,14 +2137,14 @@ var ri = "2.0.0-beta.2", oe = "", lt = "?", Je = "function", V = "undefined", re
2046
2137
  /(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i
2047
2138
  // Windows Phone
2048
2139
  ],
2049
- [o, [r, Be, kt]],
2140
+ [o, [r, Be, It]],
2050
2141
  [
2051
2142
  /windows nt 6\.2; (arm)/i,
2052
2143
  // Windows RT
2053
2144
  /windows[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i,
2054
2145
  /(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i
2055
2146
  ],
2056
- [[r, Be, kt], [o, tt]],
2147
+ [[r, Be, It], [o, at]],
2057
2148
  [
2058
2149
  // iOS/macOS
2059
2150
  /ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,
@@ -2089,7 +2180,7 @@ var ri = "2.0.0-beta.2", oe = "", lt = "?", Je = "function", V = "undefined", re
2089
2180
  /\(bb(10);/i
2090
2181
  // BlackBerry 10
2091
2182
  ],
2092
- [r, [o, gt]],
2183
+ [r, [o, pt]],
2093
2184
  [
2094
2185
  /(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i
2095
2186
  // Symbian
@@ -2099,7 +2190,7 @@ var ri = "2.0.0-beta.2", oe = "", lt = "?", Je = "function", V = "undefined", re
2099
2190
  /mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i
2100
2191
  // Firefox OS
2101
2192
  ],
2102
- [r, [o, ge + " OS"]],
2193
+ [r, [o, me + " OS"]],
2103
2194
  [
2104
2195
  /web0s;.+rt(tv)/i,
2105
2196
  /\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i
@@ -2171,58 +2262,58 @@ var ri = "2.0.0-beta.2", oe = "", lt = "?", Je = "function", V = "undefined", re
2171
2262
  ],
2172
2263
  [o, r]
2173
2264
  ]
2174
- }, Ue = function() {
2265
+ }, Le = function() {
2175
2266
  var i = { init: {}, isIgnore: {}, isIgnoreRgx: {}, toString: {} };
2176
- return _.call(i.init, [
2177
- [T, [o, r, me]],
2178
- [B, [S]],
2179
- [U, [l, d, u]],
2180
- [F, [o, r]],
2267
+ return B.call(i.init, [
2268
+ [C, [o, r, ve]],
2269
+ [D, [k]],
2270
+ [_, [l, d, u]],
2271
+ [R, [o, r]],
2181
2272
  [P, [o, r]]
2182
- ]), _.call(i.isIgnore, [
2183
- [T, [r, me]],
2184
- [F, [r]],
2273
+ ]), B.call(i.isIgnore, [
2274
+ [C, [r, ve]],
2275
+ [R, [r]],
2185
2276
  [P, [r]]
2186
- ]), _.call(i.isIgnoreRgx, [
2187
- [T, / ?browser$/i],
2277
+ ]), B.call(i.isIgnoreRgx, [
2278
+ [C, / ?browser$/i],
2188
2279
  [P, / ?os$/i]
2189
- ]), _.call(i.toString, [
2190
- [T, [o, r]],
2191
- [B, [S]],
2192
- [U, [u, d]],
2193
- [F, [o, r]],
2280
+ ]), B.call(i.toString, [
2281
+ [C, [o, r]],
2282
+ [D, [k]],
2283
+ [_, [u, d]],
2284
+ [R, [o, r]],
2194
2285
  [P, [o, r]]
2195
2286
  ]), i;
2196
- }(), fi = function(i, e) {
2197
- var t = Ue.init[e], n = Ue.isIgnore[e] || 0, a = Ue.isIgnoreRgx[e] || 0, c = Ue.toString[e] || 0;
2287
+ }(), Si = function(i, e) {
2288
+ var t = Le.init[e], n = Le.isIgnore[e] || 0, a = Le.isIgnoreRgx[e] || 0, c = Le.toString[e] || 0;
2198
2289
  function s() {
2199
- _.call(this, t);
2290
+ B.call(this, t);
2200
2291
  }
2201
2292
  return s.prototype.getItem = function() {
2202
2293
  return i;
2203
2294
  }, s.prototype.withClientHints = function() {
2204
- return N ? N.getHighEntropyValues(Ft).then(function(h) {
2205
- return i.setCH(new _t(h, !1)).parseCH().get();
2295
+ return H ? H.getHighEntropyValues(Ft).then(function(h) {
2296
+ return i.setCH(new Nt(h, !1)).parseCH().get();
2206
2297
  }) : i.parseCH().get();
2207
2298
  }, s.prototype.withFeatureCheck = function() {
2208
2299
  return i.detectFeature().get();
2209
- }, e != Y && (s.prototype.is = function(h) {
2300
+ }, e != ie && (s.prototype.is = function(h) {
2210
2301
  var g = !1;
2211
2302
  for (var w in this)
2212
- if (this.hasOwnProperty(w) && !it(n, w) && z(a ? W(a, this[w]) : this[w]) == z(a ? W(a, h) : h)) {
2213
- if (g = !0, h != V)
2303
+ if (this.hasOwnProperty(w) && !st(n, w) && G(a ? j(a, this[w]) : this[w]) == G(a ? j(a, h) : h)) {
2304
+ if (g = !0, h != z)
2214
2305
  break;
2215
- } else if (h == V && g) {
2306
+ } else if (h == z && g) {
2216
2307
  g = !g;
2217
2308
  break;
2218
2309
  }
2219
2310
  return g;
2220
2311
  }, s.prototype.toString = function() {
2221
- var h = oe;
2312
+ var h = le;
2222
2313
  for (var g in c)
2223
- typeof this[c[g]] !== V && (h += (h ? " " : oe) + this[c[g]]);
2224
- return h || V;
2225
- }), N || (s.prototype.then = function(h) {
2314
+ typeof this[c[g]] !== z && (h += (h ? " " : le) + this[c[g]]);
2315
+ return h || z;
2316
+ }), H || (s.prototype.then = function(h) {
2226
2317
  var g = this, w = function() {
2227
2318
  for (var A in g)
2228
2319
  g.hasOwnProperty(A) && (this[A] = g[A]);
@@ -2235,24 +2326,24 @@ var ri = "2.0.0-beta.2", oe = "", lt = "?", Je = "function", V = "undefined", re
2235
2326
  return h(m), m;
2236
2327
  }), new s();
2237
2328
  };
2238
- function _t(i, e) {
2239
- if (i = i || {}, _.call(this, Ft), e)
2240
- _.call(this, [
2241
- [nt, Qe(i[q])],
2242
- [at, Qe(i[ci])],
2243
- [b, /\?1/.test(i[hi])],
2244
- [d, pe(i[gi])],
2245
- [J, pe(i[Bt])],
2246
- [st, pe(i[wi])],
2247
- [S, pe(i[di])],
2248
- [G, Qe(i[ui])],
2249
- [Re, pe(i[li])]
2329
+ function Nt(i, e) {
2330
+ if (i = i || {}, B.call(this, Ft), e)
2331
+ B.call(this, [
2332
+ [ot, Ke(i[q])],
2333
+ [rt, Ke(i[hi])],
2334
+ [p, /\?1/.test(i[pi])],
2335
+ [d, Ee(i[mi])],
2336
+ [te, Ee(i[Bt])],
2337
+ [ct, Ee(i[fi])],
2338
+ [k, Ee(i[gi])],
2339
+ [$, Ke(i[bi])],
2340
+ [Ve, Ee(i[wi])]
2250
2341
  ]);
2251
2342
  else
2252
2343
  for (var t in i)
2253
- this.hasOwnProperty(t) && typeof i[t] !== V && (this[t] = i[t]);
2344
+ this.hasOwnProperty(t) && typeof i[t] !== z && (this[t] = i[t]);
2254
2345
  }
2255
- function Ct(i, e, t, n) {
2346
+ function At(i, e, t, n) {
2256
2347
  return this.get = function(a) {
2257
2348
  return a ? this.data.hasOwnProperty(a) ? this.data[a] : void 0 : this.data;
2258
2349
  }, this.set = function(a, c) {
@@ -2260,118 +2351,118 @@ function Ct(i, e, t, n) {
2260
2351
  }, this.setCH = function(a) {
2261
2352
  return this.uaCH = a, this;
2262
2353
  }, this.detectFeature = function() {
2263
- if (C && C.userAgent == this.ua)
2354
+ if (I && I.userAgent == this.ua)
2264
2355
  switch (this.itemType) {
2265
- case T:
2266
- C.brave && typeof C.brave.isBrave == Je && this.set(o, "Brave");
2356
+ case C:
2357
+ I.brave && typeof I.brave.isBrave == et && this.set(o, "Brave");
2267
2358
  break;
2268
- case U:
2269
- !this.get(l) && N && N[b] && this.set(l, b), this.get(d) == "Macintosh" && C && typeof C.standalone !== V && C.maxTouchPoints && C.maxTouchPoints > 2 && this.set(d, "iPad").set(l, f);
2359
+ case _:
2360
+ !this.get(l) && H && H[p] && this.set(l, p), this.get(d) == "Macintosh" && I && typeof I.standalone !== z && I.maxTouchPoints && I.maxTouchPoints > 2 && this.set(d, "iPad").set(l, f);
2270
2361
  break;
2271
2362
  case P:
2272
- !this.get(o) && N && N[J] && this.set(o, N[J]);
2363
+ !this.get(o) && H && H[te] && this.set(o, H[te]);
2273
2364
  break;
2274
- case Y:
2365
+ case ie:
2275
2366
  var a = this.data, c = function(s) {
2276
2367
  return a[s].getItem().detectFeature().get();
2277
2368
  };
2278
- this.set(T, c(T)).set(B, c(B)).set(U, c(U)).set(F, c(F)).set(P, c(P));
2369
+ this.set(C, c(C)).set(D, c(D)).set(_, c(_)).set(R, c(R)).set(P, c(P));
2279
2370
  }
2280
2371
  return this;
2281
2372
  }, this.parseUA = function() {
2282
- return this.itemType != Y && Et.call(this.data, this.ua, this.rgxMap), this.itemType == T && this.set(me, Xe(this.get(r))), this;
2373
+ return this.itemType != ie && kt.call(this.data, this.ua, this.rgxMap), this.itemType == C && this.set(ve, Je(this.get(r))), this;
2283
2374
  }, this.parseCH = function() {
2284
2375
  var a = this.uaCH, c = this.rgxMap;
2285
2376
  switch (this.itemType) {
2286
- case T:
2287
- var s = a[at] || a[nt], h;
2377
+ case C:
2378
+ var s = a[rt] || a[ot], h;
2288
2379
  if (s)
2289
2380
  for (var g in s) {
2290
- var w = W(/(Google|Microsoft) /, s[g].brand || s[g]), m = s[g].version;
2291
- !/not.a.brand/i.test(w) && (!h || /chrom/i.test(h) && !/chromi/i.test(w)) && (this.set(o, w).set(r, m).set(me, Xe(m)), h = w);
2381
+ var w = j(/(Google|Microsoft) /, s[g].brand || s[g]), m = s[g].version;
2382
+ !/not.a.brand/i.test(w) && (!h || /chrom/i.test(h) && !/chromi/i.test(w)) && (this.set(o, w).set(r, m).set(ve, Je(m)), h = w);
2292
2383
  }
2293
2384
  break;
2294
- case B:
2295
- var A = a[S];
2296
- A && (A && a[Re] == "64" && (A += "64"), Et.call(this.data, A + ";", c));
2385
+ case D:
2386
+ var A = a[k];
2387
+ A && (A && a[Ve] == "64" && (A += "64"), kt.call(this.data, A + ";", c));
2297
2388
  break;
2298
- case U:
2299
- if (a[b] && this.set(l, b), a[d] && this.set(d, a[d]), a[d] == "Xbox" && this.set(l, K).set(u, Le), a[G]) {
2300
- var R;
2301
- if (typeof a[G] != "string")
2302
- for (var de = 0; !R && de < a[G].length; )
2303
- R = Be(a[G][de++], Mt);
2389
+ case _:
2390
+ if (a[p] && this.set(l, p), a[d] && this.set(d, a[d]), a[d] == "Xbox" && this.set(l, ee).set(u, Re), a[$]) {
2391
+ var N;
2392
+ if (typeof a[$] != "string")
2393
+ for (var X = 0; !N && X < a[$].length; )
2394
+ N = Be(a[$][X++], Tt);
2304
2395
  else
2305
- R = Be(a[G], Mt);
2306
- this.set(l, R);
2396
+ N = Be(a[$], Tt);
2397
+ this.set(l, N);
2307
2398
  }
2308
2399
  break;
2309
2400
  case P:
2310
- var le = a[J];
2311
- if (le) {
2312
- var L = a[st];
2313
- le == tt && (L = parseInt(Xe(L), 10) >= 13 ? "11" : "10"), this.set(o, le).set(r, L);
2401
+ var Y = a[te];
2402
+ if (Y) {
2403
+ var L = a[ct];
2404
+ Y == at && (L = parseInt(Je(L), 10) >= 13 ? "11" : "10"), this.set(o, Y).set(r, L);
2314
2405
  }
2315
- this.get(o) == tt && a[d] == "Xbox" && this.set(o, "Xbox").set(r, void 0);
2406
+ this.get(o) == at && a[d] == "Xbox" && this.set(o, "Xbox").set(r, void 0);
2316
2407
  break;
2317
- case Y:
2318
- var Se = this.data, x = function(Rt) {
2319
- return Se[Rt].getItem().setCH(a).parseCH().get();
2408
+ case ie:
2409
+ var ge = this.data, O = function(we) {
2410
+ return ge[we].getItem().setCH(a).parseCH().get();
2320
2411
  };
2321
- this.set(T, x(T)).set(B, x(B)).set(U, x(U)).set(F, x(F)).set(P, x(P));
2412
+ this.set(C, O(C)).set(D, O(D)).set(_, O(_)).set(R, O(R)).set(P, O(P));
2322
2413
  }
2323
2414
  return this;
2324
- }, _.call(this, [
2415
+ }, B.call(this, [
2325
2416
  ["itemType", i],
2326
2417
  ["ua", e],
2327
2418
  ["uaCH", n],
2328
2419
  ["rgxMap", t],
2329
- ["data", fi(this, i)]
2420
+ ["data", Si(this, i)]
2330
2421
  ]), this;
2331
2422
  }
2332
- function D(i, e, t) {
2333
- if (typeof i === re ? (vt(i) ? (typeof e === re && (t = e), e = i) : (t = i, e = void 0), i = void 0) : typeof i === Ye && !vt(e) && (t = e, e = void 0), !(this instanceof D))
2334
- return new D(i, e, t).getResult();
2335
- var n = typeof i === Ye ? i : (
2423
+ function F(i, e, t) {
2424
+ if (typeof i === ue ? (Mt(i) ? (typeof e === ue && (t = e), e = i) : (t = i, e = void 0), i = void 0) : typeof i === tt && !Mt(e) && (t = e, e = void 0), !(this instanceof F))
2425
+ return new F(i, e, t).getResult();
2426
+ var n = typeof i === tt ? i : (
2336
2427
  // Passed user-agent string
2337
- C && C.userAgent ? C.userAgent : (
2428
+ I && I.userAgent ? I.userAgent : (
2338
2429
  // navigator.userAgent
2339
- t && t[ut] ? t[ut] : (
2430
+ t && t[wt] ? t[wt] : (
2340
2431
  // User-Agent from passed headers
2341
- oe
2432
+ le
2342
2433
  )
2343
2434
  )
2344
- ), a = new _t(t, !0), c = e ? mi(St, e) : St, s = function(h) {
2345
- return h == Y ? function() {
2346
- return new Ct(h, n, c, a).set("ua", n).set(T, this.getBrowser()).set(B, this.getCPU()).set(U, this.getDevice()).set(F, this.getEngine()).set(P, this.getOS()).get();
2435
+ ), a = new Nt(t, !0), c = e ? vi(Ct, e) : Ct, s = function(h) {
2436
+ return h == ie ? function() {
2437
+ return new At(h, n, c, a).set("ua", n).set(C, this.getBrowser()).set(D, this.getCPU()).set(_, this.getDevice()).set(R, this.getEngine()).set(P, this.getOS()).get();
2347
2438
  } : function() {
2348
- return new Ct(h, n, c[h], a).parseUA().get();
2439
+ return new At(h, n, c[h], a).parseUA().get();
2349
2440
  };
2350
2441
  };
2351
- return _.call(this, [
2352
- ["getBrowser", s(T)],
2353
- ["getCPU", s(B)],
2354
- ["getDevice", s(U)],
2355
- ["getEngine", s(F)],
2442
+ return B.call(this, [
2443
+ ["getBrowser", s(C)],
2444
+ ["getCPU", s(D)],
2445
+ ["getDevice", s(_)],
2446
+ ["getEngine", s(R)],
2356
2447
  ["getOS", s(P)],
2357
- ["getResult", s(Y)],
2448
+ ["getResult", s(ie)],
2358
2449
  ["getUA", function() {
2359
2450
  return n;
2360
2451
  }],
2361
2452
  ["setUA", function(h) {
2362
- return ce(h) && (n = h.length > et ? fe(h, et) : h), this;
2453
+ return he(h) && (n = h.length > nt ? Se(h, nt) : h), this;
2363
2454
  }]
2364
2455
  ]).setUA(n), this;
2365
2456
  }
2366
- D.VERSION = ri;
2367
- D.BROWSER = Ne([o, r, me]);
2368
- D.CPU = Ne([S]);
2369
- D.DEVICE = Ne([d, u, l, K, b, I, f, X, Ze]);
2370
- D.ENGINE = D.OS = Ne([o, r]);
2371
- class yi {
2457
+ F.VERSION = ui;
2458
+ F.BROWSER = ze([o, r, ve]);
2459
+ F.CPU = ze([k]);
2460
+ F.DEVICE = ze([d, u, l, ee, p, T, f, Z, it]);
2461
+ F.ENGINE = F.OS = ze([o, r]);
2462
+ class Mi {
2372
2463
  constructor(e, t) {
2373
- p(this, "trackers");
2374
- p(this, "config");
2464
+ b(this, "trackers");
2465
+ b(this, "config");
2375
2466
  this.trackers = e, this.config = t;
2376
2467
  }
2377
2468
  on(e, t, n) {
@@ -2384,40 +2475,40 @@ class yi {
2384
2475
  this.trackers.forEach((n) => n.track(e, t));
2385
2476
  }
2386
2477
  }
2387
- function It(i) {
2478
+ function Pt(i) {
2388
2479
  return i.reduce((e, t) => e + t, 0);
2389
2480
  }
2390
- function vi(i) {
2391
- const e = i.length, t = It(i) / e, n = i.map((c) => Math.pow(c - t, 2)), a = It(n) / e;
2481
+ function ki(i) {
2482
+ const e = i.length, t = Pt(i) / e, n = i.map((c) => Math.pow(c - t, 2)), a = Pt(n) / e;
2392
2483
  return Math.sqrt(a);
2393
2484
  }
2394
- class Tt {
2485
+ class Ot {
2395
2486
  constructor() {
2396
- p(this, "rafId", -1);
2397
- p(this, "startTime", 0);
2398
- p(this, "stopTime", 0);
2399
- p(this, "frames", []);
2400
- p(this, "calculateFPS", () => {
2487
+ b(this, "rafId", -1);
2488
+ b(this, "startTime", 0);
2489
+ b(this, "stopTime", 0);
2490
+ b(this, "frames", []);
2491
+ b(this, "calculateFPS", () => {
2401
2492
  const e = Math.floor((this.stopTime - this.startTime) / 1e3);
2402
2493
  return this.frames.map((t) => Math.floor((t - this.startTime) / 1e3)).reduce((t, n, a, c) => (c[a] !== c[a - 1] ? t.push(1) : t[t.length - 1]++, t), []).slice(0, e);
2403
2494
  });
2404
- p(this, "getReport", () => {
2405
- const e = this.calculateFPS(), t = Math.floor(this.frames.length / ((this.stopTime - this.startTime) / 1e3)), n = e.length > 0 ? Math.max(...e) : t, a = e.length > 0 ? Math.min(...e) : t, c = e.length > 0 ? vi(e) : 0;
2495
+ b(this, "getReport", () => {
2496
+ const e = this.calculateFPS(), t = Math.floor(this.frames.length / ((this.stopTime - this.startTime) / 1e3)), n = e.length > 0 ? Math.max(...e) : t, a = e.length > 0 ? Math.min(...e) : t, c = e.length > 0 ? ki(e) : 0;
2406
2497
  return { fpsAvg: t, fpsMax: n, fpsMin: a, fpsStdDev: c };
2407
2498
  });
2408
- p(this, "start", () => {
2499
+ b(this, "start", () => {
2409
2500
  this.startTime = Date.now(), this.frames = [], this.trackFrames();
2410
2501
  });
2411
- p(this, "stop", () => {
2502
+ b(this, "stop", () => {
2412
2503
  cancelAnimationFrame(this.rafId), this.stopTime = Date.now();
2413
2504
  });
2414
- p(this, "trackFrames", () => {
2505
+ b(this, "trackFrames", () => {
2415
2506
  this.frames.push(Date.now()), this.rafId = requestAnimationFrame(this.trackFrames);
2416
2507
  });
2417
2508
  }
2418
2509
  }
2419
- const Ei = "landscape", ki = "portrait";
2420
- function Mi() {
2510
+ const Ii = "landscape", Ti = "portrait";
2511
+ function Ci() {
2421
2512
  try {
2422
2513
  const i = document.createElement("canvas");
2423
2514
  return !!window.WebGLRenderingContext && (i.getContext("webgl") || i.getContext("experimental-webgl")) instanceof WebGLRenderingContext;
@@ -2425,7 +2516,7 @@ function Mi() {
2425
2516
  return !1;
2426
2517
  }
2427
2518
  }
2428
- async function Si() {
2519
+ async function Ai() {
2429
2520
  if (!window.createImageBitmap)
2430
2521
  return !1;
2431
2522
  const t = await (await fetch("data:image/webp;base64,UklGRiQAAABXRUJQVlA4IBgAAAAwAQCdASoCAAEAAQAcJaQAA3AA/v3AgAA=")).blob();
@@ -2435,33 +2526,33 @@ async function Si() {
2435
2526
  return !1;
2436
2527
  }
2437
2528
  }
2438
- function Ke() {
2439
- return window.innerWidth >= window.innerHeight ? Ei : ki;
2529
+ function Ze() {
2530
+ return window.innerWidth >= window.innerHeight ? Ii : Ti;
2440
2531
  }
2441
- var Fe, ee, te, ie, Ee, _e, ke, De;
2442
- class Hi extends yi {
2532
+ var Fe, ae, se, oe, Ie, Ne, Te, He;
2533
+ class Wi extends Mi {
2443
2534
  constructor(...t) {
2444
2535
  super(...t);
2445
- p(this, "FPS_SAMPLE_INTERVAL", 1e4);
2536
+ b(this, "FPS_SAMPLE_INTERVAL", 1e4);
2446
2537
  // wrapper state
2447
- E(this, Fe, 0);
2448
- E(this, ee, "");
2449
- E(this, te, void 0);
2450
- E(this, ie, void 0);
2451
- E(this, Ee, !1);
2452
- E(this, _e, !1);
2453
- E(this, ke, "");
2454
- E(this, De, []);
2455
- v(this, te, {}), v(this, ie, this.deviceInfo()), this.on("state", ({ balance: n, version: a }) => {
2456
- v(this, ee, a), v(this, Fe, n);
2538
+ v(this, Fe, 0);
2539
+ v(this, ae, "");
2540
+ v(this, se, void 0);
2541
+ v(this, oe, void 0);
2542
+ v(this, Ie, !1);
2543
+ v(this, Ne, !1);
2544
+ v(this, Te, "");
2545
+ v(this, He, []);
2546
+ y(this, se, {}), y(this, oe, this.deviceInfo()), this.on("state", ({ balance: n, version: a }) => {
2547
+ y(this, ae, a), y(this, Fe, n);
2457
2548
  }), this.on("autoplay", ({ action: n }) => {
2458
- ["start", "resume"].includes(n) ? v(this, Ee, !0) : v(this, Ee, !1);
2549
+ ["start", "resume"].includes(n) ? y(this, Ie, !0) : y(this, Ie, !1);
2459
2550
  }), this.on("settings", ({ fastPlay: n }) => {
2460
- n !== void 0 && v(this, _e, n);
2551
+ n !== void 0 && y(this, Ne, n);
2461
2552
  }), this.registerEvents();
2462
2553
  }
2463
2554
  async registerEvents() {
2464
- y(this, ie).then((t) => {
2555
+ E(this, oe).then((t) => {
2465
2556
  this.track("Device Information", t);
2466
2557
  }), this.on("loadStart", () => {
2467
2558
  this.track("Game Loading", { progress: 0, step: "initial" });
@@ -2475,9 +2566,9 @@ class Hi extends yi {
2475
2566
  systemMessageType: t.type
2476
2567
  });
2477
2568
  }), this.on("openGameResponse", async (t) => {
2478
- v(this, ke, t.contract.stateType.nextRound), v(this, te, {
2569
+ y(this, Te, t.contract.stateType.nextRound), y(this, se, {
2479
2570
  balanceInCoins: t.contract.balance.coins,
2480
- clientVersion: y(this, ee),
2571
+ clientVersion: E(this, ae),
2481
2572
  coinValueInCents: this.config.api.coinValueInCents,
2482
2573
  coinValueInCentsFloat: this.config.api.coinValueInCents,
2483
2574
  currency: this.config.api.currency,
@@ -2499,9 +2590,9 @@ class Hi extends yi {
2499
2590
  // rtpVariant: 'unknown',
2500
2591
  serverVersion: t.contract.metaData.version
2501
2592
  // testVariants: '',
2502
- }), this.track("Game Open", y(this, te));
2593
+ }), this.track("Game Open", E(this, se));
2503
2594
  }), this.on("playCycleEnd", async (t) => {
2504
- const n = await y(this, ie), { base: a, multiplier: c, specialAction: s } = t.contract.bet.lastPaid ?? {}, h = t.contract.balance.coins, g = t.contract.bet.lastPaid.base * t.contract.bet.lastPaid.multiplier, w = t.contract.win.total, m = w - g, A = s || "spin", R = t.contract.roundId;
2595
+ const n = await E(this, oe), { base: a, multiplier: c, specialAction: s } = t.contract.bet.lastPaid ?? {}, h = t.contract.balance.coins, g = t.contract.bet.lastPaid.base * t.contract.bet.lastPaid.multiplier, w = t.contract.win.total, m = w - g, A = s || "spin", N = t.contract.roundId;
2505
2596
  this.track("Betting Activity", {
2506
2597
  balance: h - m,
2507
2598
  balanceAfter: h,
@@ -2509,7 +2600,7 @@ class Hi extends yi {
2509
2600
  // baseBetIndex,
2510
2601
  betMultiplier: c,
2511
2602
  betType: A,
2512
- gameVersion: y(this, ee),
2603
+ gameVersion: E(this, ae),
2513
2604
  coinValueInCents: this.config.api.coinValueInCents,
2514
2605
  coinValueInCentsFloat: this.config.api.coinValueInCents,
2515
2606
  currency: this.config.api.currency,
@@ -2519,18 +2610,18 @@ class Hi extends yi {
2519
2610
  isMobile: n.isMobile,
2520
2611
  netResult: m,
2521
2612
  operatorName: "kalamba",
2522
- orientation: Ke(),
2613
+ orientation: Ze(),
2523
2614
  partnerId: this.config.api.brand,
2524
2615
  partnerParentId: this.config.api.integration,
2525
2616
  platform: "WEB",
2526
2617
  playMode: this.config.api.playMode,
2527
- roundId: R,
2618
+ roundId: N,
2528
2619
  // TODO: uncomment when tracking TrackingEvent.GameSpin is implemented
2529
2620
  // roundTypes: [...this.#roundTypes],
2530
2621
  roundTypes: ["BaseGame"],
2531
2622
  totalBet: g,
2532
2623
  totalWin: w
2533
- }), v(this, De, []);
2624
+ }), y(this, He, []);
2534
2625
  }), this.on("telemetry.click", (t) => {
2535
2626
  this.track("UI Interaction", {
2536
2627
  action: "click",
@@ -2545,7 +2636,7 @@ class Hi extends yi {
2545
2636
  }), this.reportFpsSample(), this.reportFpsRound();
2546
2637
  }
2547
2638
  reportFpsSample() {
2548
- const t = new Tt(), n = () => {
2639
+ const t = new Ot(), n = () => {
2549
2640
  t.stop();
2550
2641
  const c = t.getReport();
2551
2642
  this.track("FPS Performance", { ...c, fpsType: "sample" }), a();
@@ -2555,7 +2646,7 @@ class Hi extends yi {
2555
2646
  a();
2556
2647
  }
2557
2648
  reportFpsRound() {
2558
- const t = new Tt();
2649
+ const t = new Ot();
2559
2650
  this.on("playCycleStart", () => {
2560
2651
  t.start();
2561
2652
  }), this.on("playCycleEnd", () => {
@@ -2566,13 +2657,13 @@ class Hi extends yi {
2566
2657
  }
2567
2658
  getExtraUiInteractionData() {
2568
2659
  return {
2569
- orientation: Ke(),
2570
- stateType: y(this, ke)
2660
+ orientation: Ze(),
2661
+ stateType: E(this, Te)
2571
2662
  };
2572
2663
  }
2573
2664
  async deviceInfo() {
2574
2665
  var g;
2575
- const t = new D(navigator.userAgent), n = Mi(), a = await Si(), c = t.getBrowser(), s = t.getDevice(), h = t.getOS();
2666
+ const t = new F(navigator.userAgent), n = Ci(), a = await Ai(), c = t.getBrowser(), s = t.getDevice(), h = t.getOS();
2576
2667
  return {
2577
2668
  browserName: c.name,
2578
2669
  browserVersion: c.version,
@@ -2585,7 +2676,7 @@ class Hi extends yi {
2585
2676
  manufacturer: s.vendor,
2586
2677
  operatingSystem: h.name,
2587
2678
  operatingSystemVersion: h.version,
2588
- orientation: Ke(),
2679
+ orientation: Ze(),
2589
2680
  pixelRatio: window.devicePixelRatio,
2590
2681
  screenHeight: window.screen.height,
2591
2682
  screenSize: `${window.screen.width}x${window.screen.height}`,
@@ -2597,88 +2688,88 @@ class Hi extends yi {
2597
2688
  };
2598
2689
  }
2599
2690
  }
2600
- Fe = new WeakMap(), ee = new WeakMap(), te = new WeakMap(), ie = new WeakMap(), Ee = new WeakMap(), _e = new WeakMap(), ke = new WeakMap(), De = new WeakMap();
2601
- let Oe;
2602
- const Ci = new Uint8Array(16);
2603
- function Ii() {
2604
- if (!Oe && (Oe = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !Oe))
2691
+ Fe = new WeakMap(), ae = new WeakMap(), se = new WeakMap(), oe = new WeakMap(), Ie = new WeakMap(), Ne = new WeakMap(), Te = new WeakMap(), He = new WeakMap();
2692
+ let De;
2693
+ const Pi = new Uint8Array(16);
2694
+ function Oi() {
2695
+ if (!De && (De = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !De))
2605
2696
  throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
2606
- return Oe(Ci);
2697
+ return De(Pi);
2607
2698
  }
2608
2699
  const M = [];
2609
2700
  for (let i = 0; i < 256; ++i)
2610
2701
  M.push((i + 256).toString(16).slice(1));
2611
- function Ti(i, e = 0) {
2702
+ function _i(i, e = 0) {
2612
2703
  return M[i[e + 0]] + M[i[e + 1]] + M[i[e + 2]] + M[i[e + 3]] + "-" + M[i[e + 4]] + M[i[e + 5]] + "-" + M[i[e + 6]] + M[i[e + 7]] + "-" + M[i[e + 8]] + M[i[e + 9]] + "-" + M[i[e + 10]] + M[i[e + 11]] + M[i[e + 12]] + M[i[e + 13]] + M[i[e + 14]] + M[i[e + 15]];
2613
2704
  }
2614
- const Ai = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), At = {
2615
- randomUUID: Ai
2705
+ const Ui = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), _t = {
2706
+ randomUUID: Ui
2616
2707
  };
2617
- function Pt(i, e, t) {
2618
- if (At.randomUUID && !e && !i)
2619
- return At.randomUUID();
2708
+ function Ut(i, e, t) {
2709
+ if (_t.randomUUID && !e && !i)
2710
+ return _t.randomUUID();
2620
2711
  i = i || {};
2621
- const n = i.random || (i.rng || Ii)();
2712
+ const n = i.random || (i.rng || Oi)();
2622
2713
  if (n[6] = n[6] & 15 | 64, n[8] = n[8] & 63 | 128, e) {
2623
2714
  t = t || 0;
2624
2715
  for (let a = 0; a < 16; ++a)
2625
2716
  e[t + a] = n[a];
2626
2717
  return e;
2627
2718
  }
2628
- return Ti(n);
2719
+ return _i(n);
2629
2720
  }
2630
- class Dt {
2721
+ class Ht {
2631
2722
  constructor(e) {
2632
- p(this, "config");
2723
+ b(this, "config");
2633
2724
  this.config = e;
2634
2725
  }
2635
2726
  }
2636
- const xt = 25, Ut = 1e4;
2637
- var ne, ae, se, H, Me;
2638
- class Vi extends Dt {
2727
+ const xt = 25, Lt = 1e4;
2728
+ var re, ce, de, V, Ce;
2729
+ class $i extends Ht {
2639
2730
  constructor(...t) {
2640
2731
  super(...t);
2641
- E(this, ne, "https://europe-west3-stargazer-328808.cloudfunctions.net/collect-events");
2642
- E(this, ae, void 0);
2643
- E(this, se, void 0);
2644
- E(this, H, []);
2645
- E(this, Me, void 0);
2646
- p(this, "processQueueForced");
2647
- v(this, ae, /* @__PURE__ */ (/* @__PURE__ */ new Date()).getTime()), v(this, H, []), v(this, Me, Pt()), this.processQueueForced = this.processQueue.bind(this, !0), this.schedule(), fetch(y(this, ne), {
2732
+ v(this, re, "https://europe-west3-stargazer-328808.cloudfunctions.net/collect-events");
2733
+ v(this, ce, void 0);
2734
+ v(this, de, void 0);
2735
+ v(this, V, []);
2736
+ v(this, Ce, void 0);
2737
+ b(this, "processQueueForced");
2738
+ y(this, ce, /* @__PURE__ */ (/* @__PURE__ */ new Date()).getTime()), y(this, V, []), y(this, Ce, Ut()), this.processQueueForced = this.processQueue.bind(this, !0), this.schedule(), fetch(E(this, re), {
2648
2739
  method: "OPTIONS"
2649
- }).catch(rt), this.subscribe();
2740
+ }).catch(lt), this.subscribe();
2650
2741
  }
2651
2742
  subscribe() {
2652
2743
  window.addEventListener("beforeunload", this.processQueueForced, !1), window.addEventListener("pagehide", this.processQueueForced, !1), window.addEventListener("visibilitychange", this.processQueueForced, !1);
2653
2744
  }
2654
2745
  schedule() {
2655
- y(this, se) && clearTimeout(y(this, se)), v(this, se, window.setTimeout(() => this.processQueue(), Ut));
2746
+ E(this, de) && clearTimeout(E(this, de)), y(this, de, window.setTimeout(() => this.processQueue(), Lt));
2656
2747
  }
2657
2748
  send(t) {
2658
- v(this, ae, /* @__PURE__ */ (/* @__PURE__ */ new Date()).getTime());
2749
+ y(this, ce, /* @__PURE__ */ (/* @__PURE__ */ new Date()).getTime());
2659
2750
  try {
2660
- navigator.sendBeacon(y(this, ne), JSON.stringify(t));
2751
+ navigator.sendBeacon(E(this, re), JSON.stringify(t));
2661
2752
  } catch {
2662
- fetch(y(this, ne), {
2753
+ fetch(E(this, re), {
2663
2754
  body: JSON.stringify(t),
2664
2755
  method: "POST",
2665
2756
  headers: {
2666
2757
  "Content-Type": "application/json"
2667
2758
  },
2668
2759
  keepalive: !0
2669
- }).catch(rt);
2760
+ }).catch(lt);
2670
2761
  }
2671
2762
  this.schedule();
2672
2763
  }
2673
2764
  addToQueue(t) {
2674
- y(this, H).push(t), this.processQueue();
2765
+ E(this, V).push(t), this.processQueue();
2675
2766
  }
2676
2767
  processQueue(t = !1) {
2677
- if (!(this.config == null || !this.config.ui.feature.allowTelemetry) && !(!t && y(this, H).length < xt && /* @__PURE__ */ (/* @__PURE__ */ new Date()).getTime() - y(this, ae) < Ut))
2678
- for (; y(this, H).length; ) {
2679
- const n = y(this, H).splice(0, xt).map((a) => ({
2768
+ if (!(this.config == null || !this.config.ui.feature.allowTelemetry) && !(!t && E(this, V).length < xt && /* @__PURE__ */ (/* @__PURE__ */ new Date()).getTime() - E(this, ce) < Lt))
2769
+ for (; E(this, V).length; ) {
2770
+ const n = E(this, V).splice(0, xt).map((a) => ({
2680
2771
  ...a,
2681
- sessionID: y(this, Me),
2772
+ sessionID: E(this, Ce),
2682
2773
  userID: this.config.api.user
2683
2774
  }));
2684
2775
  this.send(n);
@@ -2689,31 +2780,31 @@ class Vi extends Dt {
2689
2780
  eventName: t,
2690
2781
  eventParams: n,
2691
2782
  eventTimestamp: /* @__PURE__ */ (/* @__PURE__ */ new Date()).getTime(),
2692
- eventUUID: Pt()
2783
+ eventUUID: Ut()
2693
2784
  });
2694
2785
  }
2695
2786
  }
2696
- ne = new WeakMap(), ae = new WeakMap(), se = new WeakMap(), H = new WeakMap(), Me = new WeakMap();
2697
- const Pi = O("LoggingTracker", "color:#000000;font-weight:bold;");
2698
- class zi extends Dt {
2787
+ re = new WeakMap(), ce = new WeakMap(), de = new WeakMap(), V = new WeakMap(), Ce = new WeakMap();
2788
+ const xi = x("LoggingTracker", "color:#000000;font-weight:bold;");
2789
+ class ji extends Ht {
2699
2790
  track(e, t) {
2700
- Pi(`@${this.config.api.user}`, `[${e}]`, t);
2791
+ xi(`@${this.config.api.user}`, `[${e}]`, t);
2701
2792
  }
2702
2793
  }
2703
2794
  export {
2704
- Oi as BasicPlugin,
2705
- $ as CasinoPlugin,
2706
- Li as DebuggingPlugin,
2707
- Bi as GigPlugin,
2708
- Ni as KalambaBullseyePlugin,
2709
- Hi as KalambaStargazerPlugin,
2710
- Vi as KalambaStargazerTracker,
2711
- zi as LoggingTracker,
2712
- Fi as OryxPlugin,
2713
- _i as PariplayPlugin,
2714
- Di as RelaxFEIMPlugin,
2715
- Qt as RgsPlygin,
2716
- yi as TelemetryPlugin,
2717
- Dt as Tracker,
2718
- Ri as TukoPlugin
2795
+ Bi as BasicPlugin,
2796
+ Q as CasinoPlugin,
2797
+ Fi as DebuggingPlugin,
2798
+ Ni as GigPlugin,
2799
+ qi as KalambaBullseyePlugin,
2800
+ Wi as KalambaStargazerPlugin,
2801
+ $i as KalambaStargazerTracker,
2802
+ ji as LoggingTracker,
2803
+ Hi as OryxPlugin,
2804
+ Vi as PariplayPlugin,
2805
+ zi as RelaxFEIMPlugin,
2806
+ Yt as RgsPlygin,
2807
+ Mi as TelemetryPlugin,
2808
+ Ht as Tracker,
2809
+ Gi as TukoPlugin
2719
2810
  };