@everymatrix/casino-header-controller 1.72.1 → 1.73.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.
@@ -26,7 +26,7 @@ var $e = (l, t, n) => new Promise((h, f) => {
26
26
  }, p = (y) => y.done ? h(y.value) : Promise.resolve(y.value).then(c, g);
27
27
  p((n = n.apply(l, t)).next());
28
28
  });
29
- import { b as gt, $ as yt, O as vt, S as bt, i as wt, s as Bt, f as z, d as Tt, n as Ke, e as ue, h as fe, x as D, k as N, j as pe, v as U, l as Ct, o as St, y as Ne, p as At, w as we, A as Be, r as _t, B as je, C as lt, t as Rt, J as Et, K as xt, L as Dt, c as Lt, I as Ft } from "./CasinoHamburgerMenu-CGX_L0rr.js";
29
+ import { b as gt, $ as yt, O as vt, S as bt, i as wt, s as Bt, f as z, d as Tt, n as Ke, e as ue, h as fe, x as D, k as N, j as pe, v as U, l as Ct, o as St, y as Ne, p as At, w as we, A as Be, r as _t, B as je, C as lt, t as Rt, J as xt, K as Et, L as Dt, c as Lt, I as Ft } from "./CasinoHamburgerMenu-CGX_L0rr.js";
30
30
  function et(l, t) {
31
31
  gt(l, t);
32
32
  }
@@ -241,7 +241,7 @@ var qe = { exports: {} };
241
241
  */
242
242
  (function(l, t) {
243
243
  (function(n) {
244
- var h = n.setTimeout, f = n.clearTimeout, c = n.XMLHttpRequest, g = n.XDomainRequest, p = n.ActiveXObject, y = n.EventSource, C = n.document, S = n.Promise, A = n.fetch, x = n.Response, R = n.TextDecoder, M = n.TextEncoder, Q = n.AbortController;
244
+ var h = n.setTimeout, f = n.clearTimeout, c = n.XMLHttpRequest, g = n.XDomainRequest, p = n.ActiveXObject, y = n.EventSource, C = n.document, S = n.Promise, A = n.fetch, E = n.Response, R = n.TextDecoder, M = n.TextEncoder, Q = n.AbortController;
245
245
  if (typeof window != "undefined" && typeof C != "undefined" && !("readyState" in C) && C.body == null && (C.readyState = "loading", window.addEventListener("load", function(e) {
246
246
  C.readyState = "complete";
247
247
  }, !1)), c == null && p != null && (c = function() {
@@ -300,8 +300,8 @@ var qe = { exports: {} };
300
300
  return 3;
301
301
  throw new Error();
302
302
  }
303
- for (var o = 65533, r = "", d = this.bitsNeeded, m = this.codePoint, E = 0; E < e.length; E += 1) {
304
- var w = e[E];
303
+ for (var o = 65533, r = "", d = this.bitsNeeded, m = this.codePoint, x = 0; x < e.length; x += 1) {
304
+ var w = e[x];
305
305
  d !== 0 && (w < 128 || w > 191 || !a(m << 6 | w & 63, d - 6, i(d, m))) && (d = 0, m = o, r += String.fromCharCode(m)), d === 0 ? (w >= 0 && w <= 127 ? (d = 0, m = w) : w >= 192 && w <= 223 ? (d = 6 * 1, m = w & 31) : w >= 224 && w <= 239 ? (d = 6 * 2, m = w & 15) : w >= 240 && w <= 247 ? (d = 6 * 3, m = w & 7) : (d = 0, m = o), d !== 0 && !a(m, d, i(d, m)) && (d = 0, m = o)) : (d -= 6, m = m << 6 | w & 63), d === 0 && (m <= 65535 ? r += String.fromCharCode(m) : (r += String.fromCharCode(55296 + (m - 65535 - 1 >> 10)), r += String.fromCharCode(56320 + (m - 65535 - 1 & 1023))));
306
306
  }
307
307
  return this.bitsNeeded = d, this.codePoint = m, r;
@@ -339,7 +339,7 @@ var qe = { exports: {} };
339
339
  }
340
340
  v !== 0 && (r = 2, i.readyState = 2, i.status = v, i.statusText = k, i._contentType = se, i.onreadystatechange());
341
341
  }
342
- }, E = function() {
342
+ }, x = function() {
343
343
  if (m(), r === 2 || r === 3) {
344
344
  r = 3;
345
345
  var v = "";
@@ -352,7 +352,7 @@ var qe = { exports: {} };
352
352
  }, w = function(v, k) {
353
353
  if ((k == null || k.preventDefault == null) && (k = {
354
354
  preventDefault: _
355
- }), E(), r === 1 || r === 2 || r === 3) {
355
+ }), x(), r === 1 || r === 2 || r === 3) {
356
356
  if (r = 4, d !== 0 && (f(d), d = 0), i.readyState = 4, v === "load")
357
357
  i.onload(k);
358
358
  else if (v === "error")
@@ -364,11 +364,11 @@ var qe = { exports: {} };
364
364
  i.onreadystatechange();
365
365
  }
366
366
  }, T = function(v) {
367
- o != null && (o.readyState === 4 ? (!("onload" in o) || !("onerror" in o) || !("onabort" in o)) && w(o.responseText === "" ? "error" : "load", v) : o.readyState === 3 ? "onprogress" in o || E() : o.readyState === 2 && m());
367
+ o != null && (o.readyState === 4 ? (!("onload" in o) || !("onerror" in o) || !("onabort" in o)) && w(o.responseText === "" ? "error" : "load", v) : o.readyState === 3 ? "onprogress" in o || x() : o.readyState === 2 && m());
368
368
  }, F = function() {
369
369
  d = h(function() {
370
370
  F();
371
- }, 500), o.readyState === 3 && E();
371
+ }, 500), o.readyState === 3 && x();
372
372
  };
373
373
  "onload" in o && (o.onload = function(v) {
374
374
  w("load", v);
@@ -376,7 +376,7 @@ var qe = { exports: {} };
376
376
  w("error", v);
377
377
  }), "onabort" in o && (o.onabort = function(v) {
378
378
  w("abort", v);
379
- }), "onprogress" in o && (o.onprogress = E), "onreadystatechange" in o && (o.onreadystatechange = function(v) {
379
+ }), "onprogress" in o && (o.onprogress = x), "onreadystatechange" in o && (o.onreadystatechange = function(v) {
380
380
  T(v);
381
381
  }), ("contentType" in o || !("ontimeout" in c.prototype)) && (a += (a.indexOf("?") === -1 ? "?" : "&") + "padding=true"), o.open(e, a, !0), "readyState" in o && (d = h(function() {
382
382
  F();
@@ -414,8 +414,8 @@ var qe = { exports: {} };
414
414
  function L(e) {
415
415
  for (var a = /* @__PURE__ */ Object.create(null), i = e.split(`\r
416
416
  `), o = 0; o < i.length; o += 1) {
417
- var r = i[o], d = r.split(": "), m = d.shift(), E = d.join(": ");
418
- a[I(m)] = E;
417
+ var r = i[o], d = r.split(": "), m = d.shift(), x = d.join(": ");
418
+ a[I(m)] = x;
419
419
  }
420
420
  this._map = a;
421
421
  }
@@ -426,10 +426,10 @@ var qe = { exports: {} };
426
426
  }
427
427
  $.prototype.open = function(e, a, i, o, r, d, m) {
428
428
  e.open("GET", r);
429
- var E = 0;
429
+ var x = 0;
430
430
  e.onprogress = function() {
431
- var T = e.responseText, F = T.slice(E);
432
- E += F.length, i(F);
431
+ var T = e.responseText, F = T.slice(x);
432
+ x += F.length, i(F);
433
433
  }, e.onerror = function(T) {
434
434
  T.preventDefault(), o(new Error("NetworkError"));
435
435
  }, e.onload = function() {
@@ -455,16 +455,16 @@ var qe = { exports: {} };
455
455
  function re() {
456
456
  }
457
457
  re.prototype.open = function(e, a, i, o, r, d, m) {
458
- var E = null, w = new Q(), T = w.signal, F = new R();
458
+ var x = null, w = new Q(), T = w.signal, F = new R();
459
459
  return A(r, {
460
460
  headers: m,
461
461
  credentials: d ? "include" : "same-origin",
462
462
  signal: T,
463
463
  cache: "no-store"
464
464
  }).then(function(v) {
465
- return E = v.body.getReader(), a(v.status, v.statusText, v.headers.get("Content-Type"), new oe(v.headers)), new S(function(k, se) {
465
+ return x = v.body.getReader(), a(v.status, v.statusText, v.headers.get("Content-Type"), new oe(v.headers)), new S(function(k, se) {
466
466
  var De = function() {
467
- E.read().then(function(W) {
467
+ x.read().then(function(W) {
468
468
  if (W.done)
469
469
  k(void 0);
470
470
  else {
@@ -484,7 +484,7 @@ var qe = { exports: {} };
484
484
  o(v);
485
485
  }), {
486
486
  abort: function() {
487
- E != null && E.cancel(), w.abort();
487
+ x != null && x.cancel(), w.abort();
488
488
  }
489
489
  };
490
490
  };
@@ -539,10 +539,10 @@ var qe = { exports: {} };
539
539
  u.call(this, e), this.error = a.error;
540
540
  }
541
541
  Fe.prototype = Object.create(u.prototype);
542
- var Re = -1, te = 0, ge = 1, ie = 2, Te = -1, ne = 0, ve = 1, Ee = 2, Ie = 3, Me = /^text\/event\-stream(;.*)?$/i, He = 1e3, ze = 18e6, Ce = function(e, a) {
542
+ var Re = -1, te = 0, ge = 1, ie = 2, Te = -1, ne = 0, ve = 1, xe = 2, Ie = 3, Me = /^text\/event\-stream(;.*)?$/i, He = 1e3, ze = 18e6, Ce = function(e, a) {
543
543
  var i = e == null ? a : parseInt(e, 10);
544
- return i !== i && (i = a), xe(i);
545
- }, xe = function(e) {
544
+ return i !== i && (i = a), Ee(i);
545
+ }, Ee = function(e) {
546
546
  return Math.min(Math.max(e, He), ze);
547
547
  }, ye = function(e, a, i) {
548
548
  try {
@@ -557,10 +557,10 @@ var qe = { exports: {} };
557
557
  function Ue() {
558
558
  return c != null && "withCredentials" in c.prototype || g == null ? new c() : new g();
559
559
  }
560
- var Pe = A != null && x != null && "body" in x.prototype;
560
+ var Pe = A != null && E != null && "body" in E.prototype;
561
561
  function s(e, a, i) {
562
562
  a = String(a);
563
- var o = !!i.withCredentials, r = i.lastEventIdQueryParameterName || "lastEventId", d = xe(1e3), m = Ce(i.heartbeatTimeout, 45e3), E = "", w = d, T = !1, F = 0, v = i.headers || {}, k = i.Transport, se = Pe && k == null ? void 0 : new B(k != null ? new k() : Ue()), De = k != null && typeof k != "string" ? new k() : se == null ? new re() : new $(), W = void 0, P = 0, ee = Re, Se = "", ke = "", le = "", Oe = "", V = ne, Ve = 0, be = 0, ct = function(j, O, Y, J) {
563
+ var o = !!i.withCredentials, r = i.lastEventIdQueryParameterName || "lastEventId", d = Ee(1e3), m = Ce(i.heartbeatTimeout, 45e3), x = "", w = d, T = !1, F = 0, v = i.headers || {}, k = i.Transport, se = Pe && k == null ? void 0 : new B(k != null ? new k() : Ue()), De = k != null && typeof k != "string" ? new k() : se == null ? new re() : new $(), W = void 0, P = 0, ee = Re, Se = "", ke = "", le = "", Oe = "", V = ne, Ve = 0, be = 0, ct = function(j, O, Y, J) {
564
564
  if (ee === te)
565
565
  if (j === 200 && Y != null && Me.test(Y)) {
566
566
  ee = ge, T = Date.now(), w = d, e.readyState = ge;
@@ -603,7 +603,7 @@ var qe = { exports: {} };
603
603
  }
604
604
  if (V === ne) {
605
605
  if (Se !== "") {
606
- E = ke, le === "" && (le = "message");
606
+ x = ke, le === "" && (le = "message");
607
607
  var Ae = new me(le, {
608
608
  data: Se.slice(1),
609
609
  lastEventId: ke
@@ -615,14 +615,14 @@ var qe = { exports: {} };
615
615
  }
616
616
  V = J === 13 ? Te : ne;
617
617
  } else
618
- V === ne && (Ve = H, V = ve), V === ve ? J === 58 && (be = H + 1, V = Ee) : V === Ee && (V = Ie);
618
+ V === ne && (Ve = H, V = ve), V === ve ? J === 58 && (be = H + 1, V = xe) : V === xe && (V = Ie);
619
619
  }
620
620
  }
621
621
  }, We = function(j) {
622
622
  if (ee === ge || ee === te) {
623
623
  ee = Re, P !== 0 && (f(P), P = 0), P = h(function() {
624
624
  Le();
625
- }, w), w = xe(Math.min(d * 16, w * 2)), e.readyState = te;
625
+ }, w), w = Ee(Math.min(d * 16, w * 2)), e.readyState = te;
626
626
  var O = new Fe("error", { error: j });
627
627
  e.dispatchEvent(O), ye(e, e.onerror, O), j != null && console.error(j);
628
628
  }
@@ -642,13 +642,13 @@ var qe = { exports: {} };
642
642
  }
643
643
  T = !1, F = 0, P = h(function() {
644
644
  Le();
645
- }, m), ee = te, Se = "", le = "", ke = E, Oe = "", Ve = 0, be = 0, V = ne;
645
+ }, m), ee = te, Se = "", le = "", ke = x, Oe = "", Ve = 0, be = 0, V = ne;
646
646
  var O = a;
647
- if (a.slice(0, 5) !== "data:" && a.slice(0, 5) !== "blob:" && E !== "") {
647
+ if (a.slice(0, 5) !== "data:" && a.slice(0, 5) !== "blob:" && x !== "") {
648
648
  var Y = a.indexOf("?");
649
649
  O = Y === -1 ? a : a.slice(0, Y + 1) + a.slice(Y + 1).replace(/(?:^|&)([^=&]*)(?:=[^&]*)?/g, function(de, Ae) {
650
650
  return Ae === r ? "" : de;
651
- }), O += (a.indexOf("?") === -1 ? "?" : "&") + r + "=" + encodeURIComponent(E);
651
+ }), O += (a.indexOf("?") === -1 ? "?" : "&") + r + "=" + encodeURIComponent(x);
652
652
  }
653
653
  var J = e.withCredentials, G = {};
654
654
  G.Accept = "text/event-stream";
@@ -708,16 +708,16 @@ function Nt(l) {
708
708
  c() {
709
709
  t = N("button"), h = Be(n), f = pe(), c = N("span"), c.innerHTML = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 11.435"><defs><style>.a{fill:var(--emw--color-white, #FFFFFF);}</style></defs><path class="a" d="M16.191,19.235l7.562-7.568a1.423,1.423,0,0,1,2.019,0,1.441,1.441,0,0,1,0,2.025L17.2,22.265a1.427,1.427,0,0,1-1.971.042L6.6,13.7a1.429,1.429,0,0,1,2.019-2.025Z" transform="translate(-6.188 -11.246)"></path></svg>', g = pe(), S && S.c(), p = _t(), U(t, "class", "BalanceValue");
710
710
  },
711
- m(A, x) {
712
- fe(A, t, x), D(t, h), D(t, f), D(t, c), fe(A, g, x), S && S.m(A, x), fe(A, p, x), y || (C = Ne(
711
+ m(A, E) {
712
+ fe(A, t, E), D(t, h), D(t, f), D(t, c), fe(A, g, E), S && S.m(A, E), fe(A, p, E), y || (C = Ne(
713
713
  t,
714
714
  "click",
715
715
  /*click_handler*/
716
716
  l[23]
717
717
  ), y = !0);
718
718
  },
719
- p(A, x) {
720
- x[0] & /*balances*/
719
+ p(A, E) {
720
+ E[0] & /*balances*/
721
721
  8 && n !== (n = /*balances*/
722
722
  (A[3].Total ? (
723
723
  /*formatBalance*/
@@ -726,7 +726,7 @@ function Nt(l) {
726
726
  A[3].Total[0].amount
727
727
  )
728
728
  ) : "0") + "") && we(h, n), /*isModalDisplayed*/
729
- A[2] ? S ? S.p(A, x) : (S = ot(A), S.c(), S.m(p.parentNode, p)) : S && (S.d(1), S = null);
729
+ A[2] ? S ? S.p(A, E) : (S = ot(A), S.c(), S.m(p.parentNode, p)) : S && (S.d(1), S = null);
730
730
  },
731
731
  d(A) {
732
732
  A && (ue(t), ue(g), ue(p)), S && S.d(A), y = !1, C();
@@ -759,7 +759,7 @@ function ot(l) {
759
759
  let t, n, h, f, c, g, p = (
760
760
  /*$_*/
761
761
  l[4]("Title") + ""
762
- ), y, C, S, A, x, R, M = (
762
+ ), y, C, S, A, E, R, M = (
763
763
  /*$_*/
764
764
  l[4]("DepositButton") + ""
765
765
  ), Q, ae, Z, X = je(Object.keys(
@@ -773,13 +773,13 @@ function ot(l) {
773
773
  t = N("div"), n = N("button"), h = pe(), f = N("div"), c = N("div"), g = N("p"), y = Be(p), C = pe(), S = N("div");
774
774
  for (let B = 0; B < _.length; B += 1)
775
775
  _[B].c();
776
- A = pe(), x = N("div"), R = N("button"), Q = Be(M), U(n, "class", "BalanceModalClose"), U(g, "class", "BalanceModalTitle"), U(c, "class", "BalanceModalHeader"), U(S, "class", "BalanceModalBody"), U(R, "class", "BalanceModalAction"), U(x, "class", "BalanceModalFooter"), U(f, "class", "BalanceModal"), U(t, "class", "BalanceModalWrapper");
776
+ A = pe(), E = N("div"), R = N("button"), Q = Be(M), U(n, "class", "BalanceModalClose"), U(g, "class", "BalanceModalTitle"), U(c, "class", "BalanceModalHeader"), U(S, "class", "BalanceModalBody"), U(R, "class", "BalanceModalAction"), U(E, "class", "BalanceModalFooter"), U(f, "class", "BalanceModal"), U(t, "class", "BalanceModalWrapper");
777
777
  },
778
778
  m(B, I) {
779
779
  fe(B, t, I), D(t, n), D(t, h), D(t, f), D(f, c), D(c, g), D(g, y), D(f, C), D(f, S);
780
780
  for (let L = 0; L < _.length; L += 1)
781
781
  _[L] && _[L].m(S, null);
782
- D(f, A), D(f, x), D(x, R), D(R, Q), ae || (Z = [
782
+ D(f, A), D(f, E), D(E, R), D(R, Q), ae || (Z = [
783
783
  Ne(
784
784
  n,
785
785
  "click",
@@ -838,21 +838,18 @@ function rt(l) {
838
838
  )
839
839
  ) : "") + ""
840
840
  ), p, y, C, S, A = (
841
- /*b*/
842
- (l[51].amount ? (
843
- /*formatBalance*/
844
- l[5](
845
- /*b*/
846
- l[51].amount
847
- )
848
- ) : "0") + ""
849
- ), x;
841
+ /*formatBalance*/
842
+ l[5](
843
+ /*b*/
844
+ l[51].amount
845
+ ) + ""
846
+ ), E;
850
847
  return {
851
848
  c() {
852
- t = N("div"), n = N("p"), f = Be(h), c = pe(), p = Be(g), y = pe(), C = N("p"), S = N("span"), x = Be(A), U(n, "class", "BalanceModalText"), U(S, "class", "BalanceModalAmount"), U(C, "class", "BalanceModalValue"), U(t, "class", "BalanceModalRowLine");
849
+ t = N("div"), n = N("p"), f = Be(h), c = pe(), p = Be(g), y = pe(), C = N("p"), S = N("span"), E = Be(A), U(n, "class", "BalanceModalText"), U(S, "class", "BalanceModalAmount"), U(C, "class", "BalanceModalValue"), U(t, "class", "BalanceModalRowLine");
853
850
  },
854
851
  m(R, M) {
855
- fe(R, t, M), D(t, n), D(n, f), D(n, c), D(n, p), D(t, y), D(t, C), D(C, S), D(S, x);
852
+ fe(R, t, M), D(t, n), D(n, f), D(n, c), D(n, p), D(t, y), D(t, C), D(C, S), D(S, E);
856
853
  },
857
854
  p(R, M) {
858
855
  M[0] & /*$_, balances*/
@@ -869,14 +866,11 @@ function rt(l) {
869
866
  R[51].productType
870
867
  )
871
868
  ) : "") + "") && we(p, g), M[0] & /*balances*/
872
- 8 && A !== (A = /*b*/
873
- (R[51].amount ? (
874
- /*formatBalance*/
875
- R[5](
876
- /*b*/
877
- R[51].amount
878
- )
879
- ) : "0") + "") && we(x, A);
869
+ 8 && A !== (A = /*formatBalance*/
870
+ R[5](
871
+ /*b*/
872
+ R[51].amount
873
+ ) + "") && we(E, A);
880
874
  },
881
875
  d(R) {
882
876
  R && ue(t);
@@ -907,7 +901,7 @@ function it(l) {
907
901
  D(t, n);
908
902
  },
909
903
  p(c, g) {
910
- if (g[0] & /*balances, formatBalance, $_*/
904
+ if (g[0] & /*formatBalance, balances, $_*/
911
905
  56) {
912
906
  h = je(
913
907
  /*balances*/
@@ -984,7 +978,7 @@ function It(l) {
984
978
  function Ht(l, t, n) {
985
979
  let h;
986
980
  Ct(l, Ft, (s) => n(4, h = s));
987
- let { userid: f = "" } = t, { session: c = "" } = t, { endpoint: g = "" } = t, { lang: p = "en" } = t, { mbsource: y } = t, { clientstyling: C = "" } = t, { clientstylingurl: S = "" } = t, { translationurl: A = "" } = t, { gmversion: x = "gm16" } = t, { displaybalanceoption: R = "All" } = t, { totalcalculationmode: M = "totalCashAmount" } = t, { currencylocale: Q = "en" } = t, { currencydisplay: ae = "symbol" } = t, { maximumfractiondigits: Z = "2" } = t, { minimumfractiondigits: X = "0" } = t, { customdisplayformat: _ = "" } = t, B, I = !0, L = !1, $ = !1, oe, re = "", K = [], he;
981
+ let { userid: f = "" } = t, { session: c = "" } = t, { endpoint: g = "" } = t, { lang: p = "en" } = t, { mbsource: y } = t, { clientstyling: C = "" } = t, { clientstylingurl: S = "" } = t, { translationurl: A = "" } = t, { gmversion: E = "gm16" } = t, { displaybalanceoption: R = "All" } = t, { totalcalculationmode: M = "totalCashAmount" } = t, { currencylocale: Q = "en" } = t, { currencydisplay: ae = "symbol" } = t, { maximumfractiondigits: Z = "2" } = t, { minimumfractiondigits: X = "0" } = t, { customdisplayformat: _ = "" } = t, B, I = !0, L = !1, $ = !1, oe, re = "", K = [], he;
988
982
  const u = {}, me = ["totalCashAmount", "totalRealAmount"], _e = () => {
989
983
  fetch(A).then((s) => s.json()).then((s) => Object.keys(s).forEach((b) => et(b, s[b]))).catch((s) => console.log(s));
990
984
  };
@@ -1019,10 +1013,10 @@ function Ht(l, t, n) {
1019
1013
  else if (i.toLowerCase() === "amount") {
1020
1014
  let r = ",", d = ".", m = 2;
1021
1015
  o && (o[0] !== " " && (r = o[0]), o[1] !== " " && (d = o[1]), o[2] !== " " && !isNaN(Number(o[2])) && (m = Number(o[2])));
1022
- let [E, w] = String(Math.floor(s * Xe(10, m)) / Xe(10, m)).split(".");
1023
- e += E[0];
1024
- for (let T = 1; T < E.length; ++T)
1025
- (E.length - T) % 3 === 0 ? e += r + E[T] : e += E[T];
1016
+ let [x, w] = String(Math.floor(s * Xe(10, m)) / Xe(10, m)).split(".");
1017
+ e += x[0];
1018
+ for (let T = 1; T < x.length; ++T)
1019
+ (x.length - T) % 3 === 0 ? e += r + x[T] : e += x[T];
1026
1020
  w && (e += d + w);
1027
1021
  }
1028
1022
  e && b.push(e), e = "";
@@ -1122,7 +1116,7 @@ function Ht(l, t, n) {
1122
1116
  break;
1123
1117
  }
1124
1118
  }
1125
- Ee();
1119
+ xe();
1126
1120
  for (const [r, d] of Object.entries(u))
1127
1121
  d.length < 1 && delete u[r];
1128
1122
  n(1, I = !1);
@@ -1133,7 +1127,7 @@ function Ht(l, t, n) {
1133
1127
  if (oe && oe.close(), c.length < 1)
1134
1128
  return;
1135
1129
  let s, b;
1136
- switch (x) {
1130
+ switch (E) {
1137
1131
  case "gm16":
1138
1132
  s = new URL(`${g}/v2/player/${f}/information/updates`), b = (i) => Ie(i);
1139
1133
  break;
@@ -1180,7 +1174,7 @@ function Ht(l, t, n) {
1180
1174
  a = e.afterAmount;
1181
1175
  }
1182
1176
  return a === null ? s : a;
1183
- }, Ee = () => {
1177
+ }, xe = () => {
1184
1178
  switch (M) {
1185
1179
  case "totalCashAmount":
1186
1180
  let s = 0;
@@ -1215,13 +1209,13 @@ function Ht(l, t, n) {
1215
1209
  }
1216
1210
  i.productType === o.productType && (o.amount = a === "Real" ? ve(o.amount, he[o.productType], i) : i.afterAmount);
1217
1211
  }
1218
- Ee();
1212
+ xe();
1219
1213
  }, Me = () => {
1220
1214
  n(2, L = !1), window.postMessage({ type: "GoToDeposit" }, window.location.href), typeof gtag == "function" && gtag("event", "GoToDeposit", { context: "PlayerAccountBalanceModal" });
1221
1215
  }, He = () => {
1222
1216
  me.includes(M) || (console.error(`Unsupported value ('${M}') for totalcalculationmode parameter. Only the following values are supported ${me}. Using default value ('${me[0]}').`), n(7, M = me[0]));
1223
1217
  }, ze = () => {
1224
- switch (Mt(p), He(), x) {
1218
+ switch (Mt(p), He(), E) {
1225
1219
  case "gmcore":
1226
1220
  te();
1227
1221
  break;
@@ -1229,26 +1223,26 @@ function Ht(l, t, n) {
1229
1223
  ge();
1230
1224
  break;
1231
1225
  default:
1232
- throw Error(`Invalid apiversion attribute: ${x}`);
1226
+ throw Error(`Invalid apiversion attribute: ${E}`);
1233
1227
  }
1234
1228
  }, Ce = (s) => s.data && s.data.type === "LogoutSuccessfull" && oe.close();
1235
1229
  St(() => (window.addEventListener("message", Ce, !1), () => {
1236
1230
  window.removeEventListener("message", Ce), oe && oe.close();
1237
1231
  }));
1238
- const xe = () => n(2, L = !0), ye = () => n(2, L = !1), q = () => Me(), Ue = () => n(2, L = !1);
1232
+ const Ee = () => n(2, L = !0), ye = () => n(2, L = !1), q = () => Me(), Ue = () => n(2, L = !1);
1239
1233
  function Pe(s) {
1240
1234
  At[s ? "unshift" : "push"](() => {
1241
1235
  B = s, n(0, B);
1242
1236
  });
1243
1237
  }
1244
1238
  return l.$$set = (s) => {
1245
- "userid" in s && n(8, f = s.userid), "session" in s && n(9, c = s.session), "endpoint" in s && n(10, g = s.endpoint), "lang" in s && n(11, p = s.lang), "mbsource" in s && n(12, y = s.mbsource), "clientstyling" in s && n(13, C = s.clientstyling), "clientstylingurl" in s && n(14, S = s.clientstylingurl), "translationurl" in s && n(15, A = s.translationurl), "gmversion" in s && n(16, x = s.gmversion), "displaybalanceoption" in s && n(17, R = s.displaybalanceoption), "totalcalculationmode" in s && n(7, M = s.totalcalculationmode), "currencylocale" in s && n(18, Q = s.currencylocale), "currencydisplay" in s && n(19, ae = s.currencydisplay), "maximumfractiondigits" in s && n(20, Z = s.maximumfractiondigits), "minimumfractiondigits" in s && n(21, X = s.minimumfractiondigits), "customdisplayformat" in s && n(22, _ = s.customdisplayformat);
1239
+ "userid" in s && n(8, f = s.userid), "session" in s && n(9, c = s.session), "endpoint" in s && n(10, g = s.endpoint), "lang" in s && n(11, p = s.lang), "mbsource" in s && n(12, y = s.mbsource), "clientstyling" in s && n(13, C = s.clientstyling), "clientstylingurl" in s && n(14, S = s.clientstylingurl), "translationurl" in s && n(15, A = s.translationurl), "gmversion" in s && n(16, E = s.gmversion), "displaybalanceoption" in s && n(17, R = s.displaybalanceoption), "totalcalculationmode" in s && n(7, M = s.totalcalculationmode), "currencylocale" in s && n(18, Q = s.currencylocale), "currencydisplay" in s && n(19, ae = s.currencydisplay), "maximumfractiondigits" in s && n(20, Z = s.maximumfractiondigits), "minimumfractiondigits" in s && n(21, X = s.minimumfractiondigits), "customdisplayformat" in s && n(22, _ = s.customdisplayformat);
1246
1240
  }, l.$$.update = () => {
1247
1241
  l.$$.dirty[0] & /*endpoint, userid, session, lang, gmversion, displaybalanceoption*/
1248
- 200448 && g && f && c && p && x && R && ze(), l.$$.dirty[0] & /*endpoint, userid, session, gmversion*/
1249
- 67328 && g && f && c && x && ie(), l.$$.dirty[0] & /*clientstyling, customStylingContainer*/
1250
- 8193 && C && B && Et(B, C), l.$$.dirty[0] & /*clientstylingurl, customStylingContainer*/
1251
- 16385 && S && B && xt(B, S), l.$$.dirty[0] & /*customStylingContainer, mbsource*/
1242
+ 200448 && g && f && c && p && E && R && ze(), l.$$.dirty[0] & /*endpoint, userid, session, gmversion*/
1243
+ 67328 && g && f && c && E && ie(), l.$$.dirty[0] & /*clientstyling, customStylingContainer*/
1244
+ 8193 && C && B && xt(B, C), l.$$.dirty[0] & /*clientstylingurl, customStylingContainer*/
1245
+ 16385 && S && B && Et(B, S), l.$$.dirty[0] & /*customStylingContainer, mbsource*/
1252
1246
  4097 && B && Dt(B, `${y}.Style`), l.$$.dirty[0] & /*translationurl*/
1253
1247
  32768 && A && _e();
1254
1248
  }, [
@@ -1268,14 +1262,14 @@ function Ht(l, t, n) {
1268
1262
  C,
1269
1263
  S,
1270
1264
  A,
1271
- x,
1265
+ E,
1272
1266
  R,
1273
1267
  Q,
1274
1268
  ae,
1275
1269
  Z,
1276
1270
  X,
1277
1271
  _,
1278
- xe,
1272
+ Ee,
1279
1273
  ye,
1280
1274
  q,
1281
1275
  Ue,
@@ -2,6 +2,6 @@
2
2
  * eventsource.js
3
3
  * Available under MIT License (MIT)
4
4
  * https://github.com/Yaffle/EventSource/
5
- */(function(c,n){(function(a){var m=a.setTimeout,p=a.clearTimeout,d=a.XMLHttpRequest,g=a.XDomainRequest,h=a.ActiveXObject,v=a.EventSource,C=a.document,_=a.Promise,A=a.fetch,D=a.Response,x=a.TextDecoder,F=a.TextEncoder,W=a.AbortController;if(typeof window!="undefined"&&typeof C!="undefined"&&!("readyState"in C)&&C.body==null&&(C.readyState="loading",window.addEventListener("load",function(e){C.readyState="complete"},!1)),d==null&&h!=null&&(d=function(){return new h("Microsoft.XMLHTTP")}),Object.create==null&&(Object.create=function(e){function o(){}return o.prototype=e,new o}),Date.now||(Date.now=function(){return new Date().getTime()}),W==null){var ee=A;A=function(e,o){var l=o.signal;return ee(e,{headers:o.headers,credentials:o.credentials,cache:o.cache}).then(function(r){var i=r.body.getReader();return l._reader=i,l._aborted&&l._reader.cancel(),{status:r.status,statusText:r.statusText,headers:r.headers,body:{getReader:function(){return i}}}})},W=function(){this.signal={_reader:null,_aborted:!1},this.abort=function(){this.signal._reader!=null&&this.signal._reader.cancel(),this.signal._aborted=!0}}}function Y(){this.bitsNeeded=0,this.codePoint=0}Y.prototype.decode=function(e){function o(S,M,b){if(b===1)return S>=128>>M&&S<<M<=2047;if(b===2)return S>=2048>>M&&S<<M<=55295||S>=57344>>M&&S<<M<=65535;if(b===3)return S>=65536>>M&&S<<M<=1114111;throw new Error}function l(S,M){if(S===6*1)return M>>6>15?3:M>31?2:1;if(S===6*2)return M>15?3:2;if(S===6*3)return 3;throw new Error}for(var r=65533,i="",u=this.bitsNeeded,y=this.codePoint,E=0;E<e.length;E+=1){var B=e[E];u!==0&&(B<128||B>191||!o(y<<6|B&63,u-6,l(u,y)))&&(u=0,y=r,i+=String.fromCharCode(y)),u===0?(B>=0&&B<=127?(u=0,y=B):B>=192&&B<=223?(u=6*1,y=B&31):B>=224&&B<=239?(u=6*2,y=B&15):B>=240&&B<=247?(u=6*3,y=B&7):(u=0,y=r),u!==0&&!o(y,u,l(u,y))&&(u=0,y=r)):(u-=6,y=y<<6|B&63),u===0&&(y<=65535?i+=String.fromCharCode(y):(i+=String.fromCharCode(55296+(y-65535-1>>10)),i+=String.fromCharCode(56320+(y-65535-1&1023))))}return this.bitsNeeded=u,this.codePoint=y,i};var P=function(){try{return new x().decode(new F().encode("test"),{stream:!0})==="test"}catch(e){console.debug("TextDecoder does not support streaming option. Using polyfill instead: "+e)}return!1};(x==null||F==null||!P())&&(x=Y);var R=function(){};function T(e){this.withCredentials=!1,this.readyState=0,this.status=0,this.statusText="",this.responseText="",this.onprogress=R,this.onload=R,this.onerror=R,this.onreadystatechange=R,this._contentType="",this._xhr=e,this._sendTimeout=0,this._abort=R}T.prototype.open=function(e,o){this._abort(!0);var l=this,r=this._xhr,i=1,u=0;this._abort=function(b){l._sendTimeout!==0&&(p(l._sendTimeout),l._sendTimeout=0),(i===1||i===2||i===3)&&(i=4,r.onload=R,r.onerror=R,r.onabort=R,r.onprogress=R,r.onreadystatechange=R,r.abort(),u!==0&&(p(u),u=0),b||(l.readyState=4,l.onabort(null),l.onreadystatechange())),i=0};var y=function(){if(i===1){var b=0,k="",oe=void 0;if("contentType"in r)b=200,k="OK",oe=r.contentType;else try{b=r.status,k=r.statusText,oe=r.getResponseHeader("Content-Type")}catch(Te){b=0,k="",oe=void 0}b!==0&&(i=2,l.readyState=2,l.status=b,l.statusText=k,l._contentType=oe,l.onreadystatechange())}},E=function(){if(y(),i===2||i===3){i=3;var b="";try{b=r.responseText}catch(k){}l.readyState=3,l.responseText=b,l.onprogress()}},B=function(b,k){if((k==null||k.preventDefault==null)&&(k={preventDefault:R}),E(),i===1||i===2||i===3){if(i=4,u!==0&&(p(u),u=0),l.readyState=4,b==="load")l.onload(k);else if(b==="error")l.onerror(k);else if(b==="abort")l.onabort(k);else throw new TypeError;l.onreadystatechange()}},S=function(b){r!=null&&(r.readyState===4?(!("onload"in r)||!("onerror"in r)||!("onabort"in r))&&B(r.responseText===""?"error":"load",b):r.readyState===3?"onprogress"in r||E():r.readyState===2&&y())},M=function(){u=m(function(){M()},500),r.readyState===3&&E()};"onload"in r&&(r.onload=function(b){B("load",b)}),"onerror"in r&&(r.onerror=function(b){B("error",b)}),"onabort"in r&&(r.onabort=function(b){B("abort",b)}),"onprogress"in r&&(r.onprogress=E),"onreadystatechange"in r&&(r.onreadystatechange=function(b){S(b)}),("contentType"in r||!("ontimeout"in d.prototype))&&(o+=(o.indexOf("?")===-1?"?":"&")+"padding=true"),r.open(e,o,!0),"readyState"in r&&(u=m(function(){M()},0))},T.prototype.abort=function(){this._abort(!1)},T.prototype.getResponseHeader=function(e){return this._contentType},T.prototype.setRequestHeader=function(e,o){var l=this._xhr;"setRequestHeader"in l&&l.setRequestHeader(e,o)},T.prototype.getAllResponseHeaders=function(){return this._xhr.getAllResponseHeaders!=null&&this._xhr.getAllResponseHeaders()||""},T.prototype.send=function(){if((!("ontimeout"in d.prototype)||!("sendAsBinary"in d.prototype)&&!("mozAnon"in d.prototype))&&C!=null&&C.readyState!=null&&C.readyState!=="complete"){var e=this;e._sendTimeout=m(function(){e._sendTimeout=0,e.send()},4);return}var o=this._xhr;"withCredentials"in o&&(o.withCredentials=this.withCredentials);try{o.send(void 0)}catch(l){throw l}};function j(e){return e.replace(/[A-Z]/g,function(o){return String.fromCharCode(o.charCodeAt(0)+32)})}function L(e){for(var o=Object.create(null),l=e.split(`\r
6
- `),r=0;r<l.length;r+=1){var i=l[r],u=i.split(": "),y=u.shift(),E=u.join(": ");o[j(y)]=E}this._map=o}L.prototype.get=function(e){return this._map[j(e)]},d!=null&&d.HEADERS_RECEIVED==null&&(d.HEADERS_RECEIVED=2);function Q(){}Q.prototype.open=function(e,o,l,r,i,u,y){e.open("GET",i);var E=0;e.onprogress=function(){var S=e.responseText,M=S.slice(E);E+=M.length,l(M)},e.onerror=function(S){S.preventDefault(),r(new Error("NetworkError"))},e.onload=function(){r(null)},e.onabort=function(){r(null)},e.onreadystatechange=function(){if(e.readyState===d.HEADERS_RECEIVED){var S=e.status,M=e.statusText,b=e.getResponseHeader("Content-Type"),k=e.getAllResponseHeaders();o(S,M,b,new L(k))}},e.withCredentials=u;for(var B in y)Object.prototype.hasOwnProperty.call(y,B)&&e.setRequestHeader(B,y[B]);return e.send(),e};function te(e){this._headers=e}te.prototype.get=function(e){return this._headers.get(e)};function ne(){}ne.prototype.open=function(e,o,l,r,i,u,y){var E=null,B=new W,S=B.signal,M=new x;return A(i,{headers:y,credentials:u?"include":"same-origin",signal:S,cache:"no-store"}).then(function(b){return E=b.body.getReader(),o(b.status,b.statusText,b.headers.get("Content-Type"),new te(b.headers)),new _(function(k,oe){var Te=function(){E.read().then(function(X){if(X.done)k(void 0);else{var I=M.decode(X.value,{stream:!0});l(I),Te()}}).catch(function(X){oe(X)})};Te()})}).catch(function(b){if(b.name!=="AbortError")return b}).then(function(b){r(b)}),{abort:function(){E!=null&&E.cancel(),B.abort()}}};function V(){this._listeners=Object.create(null)}function se(e){m(function(){throw e},0)}V.prototype.dispatchEvent=function(e){e.target=this;var o=this._listeners[e.type];if(o!=null)for(var l=o.length,r=0;r<l;r+=1){var i=o[r];try{typeof i.handleEvent=="function"?i.handleEvent(e):i.call(this,e)}catch(u){se(u)}}},V.prototype.addEventListener=function(e,o){e=String(e);var l=this._listeners,r=l[e];r==null&&(r=[],l[e]=r);for(var i=!1,u=0;u<r.length;u+=1)r[u]===o&&(i=!0);i||r.push(o)},V.prototype.removeEventListener=function(e,o){e=String(e);var l=this._listeners,r=l[e];if(r!=null){for(var i=[],u=0;u<r.length;u+=1)r[u]!==o&&i.push(r[u]);i.length===0?delete l[e]:l[e]=i}};function f(e){this.type=e,this.target=void 0}function ce(e,o){f.call(this,e),this.data=o.data,this.lastEventId=o.lastEventId}ce.prototype=Object.create(f.prototype);function ve(e,o){f.call(this,e),this.status=o.status,this.statusText=o.statusText,this.headers=o.headers}ve.prototype=Object.create(f.prototype);function Ce(e,o){f.call(this,e),this.error=o.error}Ce.prototype=Object.create(f.prototype);var be=-1,J=0,de=1,ae=2,he=-1,$=0,fe=1,we=2,xe=3,_e=/^text\/event\-stream(;.*)?$/i,Ee=1e3,De=18e6,me=function(e,o){var l=e==null?o:parseInt(e,10);return l!==l&&(l=o),Be(l)},Be=function(e){return Math.min(Math.max(e,Ee),De)},ue=function(e,o,l){try{typeof o=="function"&&o.call(e,l)}catch(r){se(r)}};function G(e,o){V.call(this),o=o||{},this.onopen=void 0,this.onmessage=void 0,this.onerror=void 0,this.url=void 0,this.readyState=void 0,this.withCredentials=void 0,this.headers=void 0,this._close=void 0,s(this,e,o)}function Le(){return d!=null&&"withCredentials"in d.prototype||g==null?new d:new g}var Me=A!=null&&D!=null&&"body"in D.prototype;function s(e,o,l){o=String(o);var r=!!l.withCredentials,i=l.lastEventIdQueryParameterName||"lastEventId",u=Be(1e3),y=me(l.heartbeatTimeout,45e3),E="",B=u,S=!1,M=0,b=l.headers||{},k=l.Transport,oe=Me&&k==null?void 0:new T(k!=null?new k:Le()),Te=k!=null&&typeof k!="string"?new k:oe==null?new ne:new Q,X=void 0,I=0,Z=be,ye="",Ae="",re="",Re="",z=$,Fe=0,pe=0,Je=function(N,O,q,K){if(Z===J)if(N===200&&q!=null&&_e.test(q)){Z=de,S=Date.now(),B=u,e.readyState=de;var U=new ve("open",{status:N,statusText:O,headers:K});e.dispatchEvent(U),ue(e,e.onopen,U)}else{var H="";N!==200?(O&&(O=O.replace(/\s+/g," ")),H="EventSource's response has a status "+N+" "+O+" that is not 200. Aborting the connection."):H="EventSource's response has a Content-Type specifying an unsupported type: "+(q==null?"-":q.replace(/\s+/g," "))+". Aborting the connection.",ke();var U=new ve("error",{status:N,statusText:O,headers:K});e.dispatchEvent(U),ue(e,e.onerror,U),console.error(H)}},$e=function(N){if(Z===de){for(var O=-1,q=0;q<N.length;q+=1){var K=N.charCodeAt(q);(K===10||K===13)&&(O=q)}var U=(O!==-1?Re:"")+N.slice(0,O+1);Re=(O===-1?Re:"")+N.slice(O+1),N!==""&&(S=Date.now(),M+=N.length);for(var H=0;H<U.length;H+=1){var K=U.charCodeAt(H);if(z===he&&K===10)z=$;else if(z===he&&(z=$),K===13||K===10){if(z!==$){z===fe&&(pe=H+1);var ie=U.slice(Fe,pe-1),le=U.slice(pe+(pe<H&&U.charCodeAt(pe)===32?1:0),H);ie==="data"?(ye+=`
7
- `,ye+=le):ie==="id"?Ae=le:ie==="event"?re=le:ie==="retry"?(u=me(le,u),B=u):ie==="heartbeatTimeout"&&(y=me(le,y),I!==0&&(p(I),I=m(function(){Se()},y)))}if(z===$){if(ye!==""){E=Ae,re===""&&(re="message");var ge=new ce(re,{data:ye.slice(1),lastEventId:Ae});if(e.dispatchEvent(ge),re==="open"?ue(e,e.onopen,ge):re==="message"?ue(e,e.onmessage,ge):re==="error"&&ue(e,e.onerror,ge),Z===ae)return}ye="",re=""}z=K===13?he:$}else z===$&&(Fe=H,z=fe),z===fe?K===58&&(pe=H+1,z=we):z===we&&(z=xe)}}},je=function(N){if(Z===de||Z===J){Z=be,I!==0&&(p(I),I=0),I=m(function(){Se()},B),B=Be(Math.min(u*16,B*2)),e.readyState=J;var O=new Ce("error",{error:N});e.dispatchEvent(O),ue(e,e.onerror,O),N!=null&&console.error(N)}},ke=function(){Z=ae,X!=null&&(X.abort(),X=void 0),I!==0&&(p(I),I=0),e.readyState=ae},Se=function(){if(I=0,Z!==be){if(!S&&X!=null)je(new Error("No activity within "+y+" milliseconds. "+(Z===J?"No response received.":M+" chars received.")+" Reconnecting.")),X!=null&&(X.abort(),X=void 0);else{var N=Math.max((S||Date.now())+y-Date.now(),1);S=!1,I=m(function(){Se()},N)}return}S=!1,M=0,I=m(function(){Se()},y),Z=J,ye="",re="",Ae=E,Re="",Fe=0,pe=0,z=$;var O=o;if(o.slice(0,5)!=="data:"&&o.slice(0,5)!=="blob:"&&E!==""){var q=o.indexOf("?");O=q===-1?o:o.slice(0,q+1)+o.slice(q+1).replace(/(?:^|&)([^=&]*)(?:=[^&]*)?/g,function(le,ge){return ge===i?"":le}),O+=(o.indexOf("?")===-1?"?":"&")+i+"="+encodeURIComponent(E)}var K=e.withCredentials,U={};U.Accept="text/event-stream";var H=e.headers;if(H!=null)for(var ie in H)Object.prototype.hasOwnProperty.call(H,ie)&&(U[ie]=H[ie]);try{X=Te.open(oe,Je,$e,je,O,K,U)}catch(le){throw ke(),le}};e.url=o,e.readyState=J,e.withCredentials=r,e.headers=b,e._close=ke,Se()}G.prototype=Object.create(V.prototype),G.prototype.CONNECTING=J,G.prototype.OPEN=de,G.prototype.CLOSED=ae,G.prototype.close=function(){this._close()},G.CONNECTING=J,G.OPEN=de,G.CLOSED=ae,G.prototype.withCredentials=void 0;var w=v;d!=null&&(v==null||!("withCredentials"in v.prototype))&&(w=G),function(e){{var o=e(n);o!==void 0&&(c.exports=o)}}(function(e){e.EventSourcePolyfill=G,e.NativeEventSource=v,e.EventSource=w})})(typeof globalThis=="undefined"?typeof window!="undefined"?window:typeof self!="undefined"?self:t.commonjsGlobal:globalThis)})(Ne,Ne.exports);var it=Ne.exports;function lt(c){t.append_styles(c,"svelte-gv6dm2",'*,*::before,*::after{font-family:inherit}:host{font-family:inherit}input,textarea,button{font-family:inherit}p{padding:0;margin:0}.ShowBalance{position:relative}.ShowBalance .Loading{font-size:14px;white-space:nowrap;padding-right:10px}.ShowBalance .BalanceValue{font-size:14px;cursor:pointer;display:flex;flex-wrap:nowrap;white-space:nowrap;background:transparent;border:none;font:inherit;color:inherit}.ShowBalance .BalanceValue svg{width:16px}.ShowBalance .BalanceValue span{padding-left:8px}@media only screen and (max-width: 360px){.ShowBalance .BalanceValue{font-size:12px}.ShowBalance .BalanceValue svg{width:12px}}.BalanceModalWrapper{background-color:var(--emw--color-white, #FFFFFF);position:absolute;top:45px;left:50%;transform:translateX(-60%);padding:10px;box-shadow:0px 30px 30px var(--emw--header-color-primary, var(--emw--color-primary, #22B04E));border-radius:5px;z-index:17;box-shadow:0px 5px 20px 0px #191919}.BalanceModalWrapper:before{content:"";background:var(--emw--color-white, #FFFFFF);clip-path:polygon(50% 0, 0% 100%, 100% 100%);position:absolute;top:-8px;left:60%;width:25px;height:10px;transform:translateX(-50%);z-index:1}.BalanceModalClose{position:absolute;top:5px;right:5px;width:20px;height:20px;z-index:1;cursor:pointer;font:inherit}.BalanceModalClose:before{content:"";background:var(--emw--color-secondary, var(--emw--color-secondary, #FD2839));position:absolute;top:8px;left:0;width:20px;height:2px;transform:rotate(45deg)}.BalanceModalClose:after{content:"";background:var(--emw--color-secondary, var(--emw--color-secondary, #FD2839));position:absolute;top:8px;left:0;width:20px;height:2px;transform:rotate(-45deg)}.BalanceModal{position:relative;width:280px}.BalanceModalHeader{display:flex;align-items:center;justify-content:center;padding:20px 0}.BalanceModalHeader .BalanceModalTitle{font-size:16px;font-weight:bold;color:var(--emw--header-contrast, var(--emw--color-contrast, #07072A))}.BalanceModalRowBoth{display:flex;flex-direction:column;gap:5px;padding:20px 0;border-bottom:1px solid var(--emw--color-gray-100, #E6E6E6)}.BalanceModalRowBoth:last-child{border-bottom:none}.BalanceModalRowBoth .BalanceModalRowLine{display:flex;width:100%;justify-content:space-between}.BalanceModalRowBoth .BalanceModalText{color:var(--emw--header-contrast, var(--emw--color-contrast, #07072A));font-size:14px;text-transform:capitalize}.BalanceModalRowBoth .BalanceModalValue{font-size:14px;font-weight:bold;color:var(--emw--header-contrast, var(--emw--color-contrast, #07072A))}.BalanceModalFooter{display:flex;align-items:center;padding:20px 0 10px}.BalanceModalFooter .BalanceModalAction{background:var(--emw--header-color-primary, var(--emw--color-primary, #22B04E));font-size:12px;color:white;text-transform:uppercase;width:100%;border-radius:5px;border:none;padding:10px 0;cursor:pointer}.BalanceModalFooter .BalanceModalAction:hover,.BalanceModalFooter .BalanceModalActionactive{background:var(--emw--header-contrast, var(--emw--color-background, #07072A))}.ShowBalanceModalOverlay{background-color:rgba(0, 0, 0, 0.7);position:fixed;top:0;bottom:0;left:0;right:0;z-index:16}')}function Xe(c,n,a){const m=c.slice();return m[48]=n[a],m}function qe(c,n,a){const m=c.slice();return m[51]=n[a],m}function st(c){let n,a=(c[3].Total?c[5](c[3].Total[0].amount):"0")+"",m,p,d,g,h,v,C,_=c[2]&&Ke(c);return{c(){n=t.element("button"),m=t.text(a),p=t.space(),d=t.element("span"),d.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 11.435"><defs><style>.a{fill:var(--emw--color-white, #FFFFFF);}</style></defs><path class="a" d="M16.191,19.235l7.562-7.568a1.423,1.423,0,0,1,2.019,0,1.441,1.441,0,0,1,0,2.025L17.2,22.265a1.427,1.427,0,0,1-1.971.042L6.6,13.7a1.429,1.429,0,0,1,2.019-2.025Z" transform="translate(-6.188 -11.246)"></path></svg>',g=t.space(),_&&_.c(),h=t.empty(),t.attr(n,"class","BalanceValue")},m(A,D){t.insert(A,n,D),t.append(n,m),t.append(n,p),t.append(n,d),t.insert(A,g,D),_&&_.m(A,D),t.insert(A,h,D),v||(C=t.listen(n,"click",c[23]),v=!0)},p(A,D){D[0]&8&&a!==(a=(A[3].Total?A[5](A[3].Total[0].amount):"0")+"")&&t.set_data(m,a),A[2]?_?_.p(A,D):(_=Ke(A),_.c(),_.m(h.parentNode,h)):_&&(_.d(1),_=null)},d(A){A&&(t.detach(n),t.detach(g),t.detach(h)),_&&_.d(A),v=!1,C()}}}function ct(c){let n,a=c[4]("Loading")+"",m;return{c(){n=t.element("p"),m=t.text(a)},m(p,d){t.insert(p,n,d),t.append(n,m)},p(p,d){d[0]&16&&a!==(a=p[4]("Loading")+"")&&t.set_data(m,a)},d(p){p&&t.detach(n)}}}function Ke(c){let n,a,m,p,d,g,h=c[4]("Title")+"",v,C,_,A,D,x,F=c[4]("DepositButton")+"",W,ee,Y,P=t.ensure_array_like(Object.keys(c[3])),R=[];for(let T=0;T<P.length;T+=1)R[T]=Ye(Xe(c,P,T));return{c(){n=t.element("div"),a=t.element("button"),m=t.space(),p=t.element("div"),d=t.element("div"),g=t.element("p"),v=t.text(h),C=t.space(),_=t.element("div");for(let T=0;T<R.length;T+=1)R[T].c();A=t.space(),D=t.element("div"),x=t.element("button"),W=t.text(F),t.attr(a,"class","BalanceModalClose"),t.attr(g,"class","BalanceModalTitle"),t.attr(d,"class","BalanceModalHeader"),t.attr(_,"class","BalanceModalBody"),t.attr(x,"class","BalanceModalAction"),t.attr(D,"class","BalanceModalFooter"),t.attr(p,"class","BalanceModal"),t.attr(n,"class","BalanceModalWrapper")},m(T,j){t.insert(T,n,j),t.append(n,a),t.append(n,m),t.append(n,p),t.append(p,d),t.append(d,g),t.append(g,v),t.append(p,C),t.append(p,_);for(let L=0;L<R.length;L+=1)R[L]&&R[L].m(_,null);t.append(p,A),t.append(p,D),t.append(D,x),t.append(x,W),ee||(Y=[t.listen(a,"click",c[24]),t.listen(x,"click",c[25])],ee=!0)},p(T,j){if(j[0]&16&&h!==(h=T[4]("Title")+"")&&t.set_data(v,h),j[0]&56){P=t.ensure_array_like(Object.keys(T[3]));let L;for(L=0;L<P.length;L+=1){const Q=Xe(T,P,L);R[L]?R[L].p(Q,j):(R[L]=Ye(Q),R[L].c(),R[L].m(_,null))}for(;L<R.length;L+=1)R[L].d(1);R.length=P.length}j[0]&16&&F!==(F=T[4]("DepositButton")+"")&&t.set_data(W,F)},d(T){T&&t.detach(n),t.destroy_each(R,T),ee=!1,t.run_all(Y)}}}function We(c){let n,a,m=c[4](c[48])+"",p,d,g=(c[51].productType?c[4](c[51].productType):"")+"",h,v,C,_,A=(c[51].amount?c[5](c[51].amount):"0")+"",D;return{c(){n=t.element("div"),a=t.element("p"),p=t.text(m),d=t.space(),h=t.text(g),v=t.space(),C=t.element("p"),_=t.element("span"),D=t.text(A),t.attr(a,"class","BalanceModalText"),t.attr(_,"class","BalanceModalAmount"),t.attr(C,"class","BalanceModalValue"),t.attr(n,"class","BalanceModalRowLine")},m(x,F){t.insert(x,n,F),t.append(n,a),t.append(a,p),t.append(a,d),t.append(a,h),t.append(n,v),t.append(n,C),t.append(C,_),t.append(_,D)},p(x,F){F[0]&24&&m!==(m=x[4](x[48])+"")&&t.set_data(p,m),F[0]&24&&g!==(g=(x[51].productType?x[4](x[51].productType):"")+"")&&t.set_data(h,g),F[0]&8&&A!==(A=(x[51].amount?x[5](x[51].amount):"0")+"")&&t.set_data(D,A)},d(x){x&&t.detach(n)}}}function Ye(c){let n,a,m=t.ensure_array_like(c[3][c[48]]),p=[];for(let d=0;d<m.length;d+=1)p[d]=We(qe(c,m,d));return{c(){n=t.element("div");for(let d=0;d<p.length;d+=1)p[d].c();a=t.space(),t.attr(n,"class","BalanceModalRowBoth")},m(d,g){t.insert(d,n,g);for(let h=0;h<p.length;h+=1)p[h]&&p[h].m(n,null);t.append(n,a)},p(d,g){if(g[0]&56){m=t.ensure_array_like(d[3][d[48]]);let h;for(h=0;h<m.length;h+=1){const v=qe(d,m,h);p[h]?p[h].p(v,g):(p[h]=We(v),p[h].c(),p[h].m(n,a))}for(;h<p.length;h+=1)p[h].d(1);p.length=m.length}},d(d){d&&t.detach(n),t.destroy_each(p,d)}}}function Qe(c){let n,a,m;return{c(){n=t.element("button"),t.attr(n,"class","ShowBalanceModalOverlay")},m(p,d){t.insert(p,n,d),a||(m=t.listen(n,"click",c[26]),a=!0)},p:t.noop,d(p){p&&t.detach(n),a=!1,m()}}}function dt(c){let n,a,m;function p(v,C){return v[1]?ct:st}let d=p(c),g=d(c),h=c[2]&&Qe(c);return{c(){n=t.element("div"),a=t.element("div"),g.c(),m=t.space(),h&&h.c(),t.attr(a,"class","ShowBalance")},m(v,C){t.insert(v,n,C),t.append(n,a),g.m(a,null),t.append(n,m),h&&h.m(n,null),c[27](n)},p(v,C){d===(d=p(v))&&g?g.p(v,C):(g.d(1),g=d(v),g&&(g.c(),g.m(a,null))),v[2]?h?h.p(v,C):(h=Qe(v),h.c(),h.m(n,null)):h&&(h.d(1),h=null)},i:t.noop,o:t.noop,d(v){v&&t.detach(n),g.d(),h&&h.d(),c[27](null)}}}function ut(c,n,a){let m;t.component_subscribe(c,t.$format,s=>a(4,m=s));let{userid:p=""}=n,{session:d=""}=n,{endpoint:g=""}=n,{lang:h="en"}=n,{mbsource:v}=n,{clientstyling:C=""}=n,{clientstylingurl:_=""}=n,{translationurl:A=""}=n,{gmversion:D="gm16"}=n,{displaybalanceoption:x="All"}=n,{totalcalculationmode:F="totalCashAmount"}=n,{currencylocale:W="en"}=n,{currencydisplay:ee="symbol"}=n,{maximumfractiondigits:Y="2"}=n,{minimumfractiondigits:P="0"}=n,{customdisplayformat:R=""}=n,T,j=!0,L=!1,Q=!1,te,ne="",V=[],se;const f={},ce=["totalCashAmount","totalRealAmount"],ve=()=>{fetch(A).then(s=>s.json()).then(s=>Object.keys(s).forEach(w=>Ve(w,s[w]))).catch(s=>console.log(s))};Object.keys(Ge).forEach(s=>Ve(s,Ge[s]));const Ce=s=>{if(R)return be(s);const w=W||h,e={style:"currency",currency:ne,useGrouping:!0,currencyDisplay:ee||"code",maximumFractionDigits:Y===""||isNaN(Number(Y))?2:Number(Y),minimumFractionDigits:P===""||isNaN(Number(P))?0:Number(P)};return new Intl.NumberFormat(w,e).format(s)},be=s=>{const w=[];let e="";for(const o of R)switch(o){default:e+=o;break;case"{":e&&w.push(e),e="";break;case"}":const[l,r]=e.split("|");if(e="",l.toLowerCase()==="currency")e=ne;else if(l.toLowerCase()==="amount"){let i=",",u=".",y=2;r&&(r[0]!==" "&&(i=r[0]),r[1]!==" "&&(u=r[1]),r[2]!==" "&&!isNaN(Number(r[2]))&&(y=Number(r[2])));let[E,B]=String(Math.floor(s*Oe(10,y))/Oe(10,y)).split(".");e+=E[0];for(let S=1;S<E.length;++S)(E.length-S)%3===0?e+=i+E[S]:e+=E[S];B&&(e+=u+B)}e&&w.push(e),e="";break}return w.push(e),w.join("")},J=()=>Pe(this,null,function*(){var w,e,o;a(1,j=!0);const s=new URL(`${g}/v1/player/${p}/account`);try{const l=yield fetch(s,{method:"GET",headers:{"X-SessionID":d}}),r=yield l.json();if(l.ok)V=r.items,ne=(w=V.find(i=>i.displayName==="Casino"))==null?void 0:w.currency,a(3,f.Total=[{amount:r.totalAmount[ne]}],f),a(3,f.Real=[{amount:(e=V.find(i=>i.displayName==="Casino"))==null?void 0:e.balanceAmount}],f),a(3,f.Bonus=[{amount:(o=V.find(i=>i.displayName==="UBS"))==null?void 0:o.balanceAmount}],f);else throw new Error("Failed to fetch balance data !")}catch(l){console.log("Balance error: ",l)}finally{a(1,j=!1)}}),de=()=>{a(1,j=!0);const s=new URL(`${g}/v2/player/${p}/balance`),w=new Headers;w.append("X-SessionID",d),fetch(s,{method:"GET",headers:w}).then(o=>o.json()).then(o=>{o[F]||a(7,F=ce[0]);const l=o.items.find(i=>i.type==="Real"&&i.walletAccountType==="Ordinary");if(ne=l.currency,Q=!!l.productType,a(3,f.Total=[{amount:0}],f),a(3,f.Real=[],f),a(3,f.Bonus=[],f),a(3,f.Credit=[],f),!Q){se={lastOrdinaryAfterAmount:0,showCreditLineAfterAmount:!1},a(3,f.Total[0].amount=o[F][ne],f);for(const i of o.items)switch(i.type){case"Bonus":f.Bonus.length===0?f.Bonus.push({amount:i.amount}):a(3,f.Bonus[0].amount+=i.amount,f);break;case"Real":if(i.creditLine&&f.Credit.length===0&&f.Credit.push({amount:i.creditLine}),F==="totalRealAmount")continue;f.Real.length===0?f.Real.push({amount:i.amount}):a(3,f.Real[0].amount+=i.amount,f);break}for(const[i,u]of Object.entries(f))u.length<1&&delete f[i];a(1,j=!1);return}se={Casino:{lastOrdinaryAfterAmount:0,showCreditLineAfterAmount:!1},Sports:{lastOrdinaryAfterAmount:0,showCreditLineAfterAmount:!1}};let r=o.items;x&&x!=="All"&&(r=o.items.filter(i=>i.productType===x));for(const i of r){let u;switch(i.type){case"Bonus":u=f.Bonus.findIndex(y=>y.productType===i.productType),u>0?a(3,f.Bonus[u].amount+=i.amount,f):f.Bonus.push({amount:i.amount,productType:i.productType});break;case"Real":i.creditLine&&f.Credit.push({amount:i.creditLine,productType:i.productType}),u=f.Real.findIndex(y=>y.productType===i.productType),u>0?a(3,f.Real[u].amount+=i.amount,f):f.Real.push({amount:i.amount,productType:i.productType});break}}we();for(const[i,u]of Object.entries(f))u.length<1&&delete f[i];a(1,j=!1)}).catch(()=>{throw a(1,j=!1),new Error("Failed to fetch balance data !")})},ae=()=>{if(te&&te.close(),d.length<1)return;let s,w;switch(D){case"gm16":s=new URL(`${g}/v2/player/${p}/information/updates`),w=l=>xe(l);break;case"gmcore":s=new URL(`${g}/v1/player/${p}/balance/updates`),w=l=>$(l);break}const e={accept:"text/event-stream","X-SessionId":d},o=new it.EventSourcePolyfill(s,{headers:e});te=o,o.addEventListener("message",w)},he=s=>{let w;try{w=JSON.parse(s)}catch(e){console.log("Balance stream failed: ",e);return}return w},$=s=>{var l,r;const w=he(s.data);if(!w){ae();return}let e="0";const o=w.balanceChange;V=V.map(i=>(o&&o[i.id]&&(i=Ue(ze({},i),{balanceAmount:o[i.id].afterAmount})),e=(parseFloat(i==null?void 0:i.balanceAmount)+parseFloat(e)).toString(),i)),a(3,f.Real=[{amount:(l=V[0])==null?void 0:l.balanceAmount}],f),a(3,f.Bonus=[{amount:(r=V[1])==null?void 0:r.balanceAmount}],f),a(3,f.Total=[{amount:Number(e)}],f)},fe=(s,w,e)=>{let o=null;switch(e.walletAccountType){case"Ordinary":(e.afterAmount!==e.affectedAmount||w.lastOrdinaryAfterAmount===0)&&(w.lastOrdinaryAfterAmount=e.afterAmount,w.showCreditLineAfterAmount||(o=e.afterAmount));break;case"CreditLine":e.afterAmount!==0?(o=e.afterAmount,w.showCreditLineAfterAmount=!0):(o=w.lastOrdinaryAfterAmount,w.showCreditLineAfterAmount=!1);break;default:o=e.afterAmount}return o===null?s:o},we=()=>{switch(F){case"totalCashAmount":let s=0;for(const e of["Real","Bonus"])for(const o of f[e])s+=Math.max(o.amount,0);a(3,f.Total[0].amount=s,f);break;case"totalRealAmount":if(!Q)return;let w=0;for(const e of f.Real)w+=e.amount;a(3,f.Total[0].amount=w,f)}},xe=s=>{const w=he(s.data);if(!w){ae();return}if(w.type!=="BALANCE_UPDATE_V2")return;const e=w.body.balanceChange;for(const[o,l]of Object.entries(e))if(F==="totalRealAmount"&&o==="Real"&&!Q&&a(3,f.Total[0].amount=fe(f.Total[0].amount,se,l),f),!!f[o])for(const r of f[o]){if(!Q){r.amount=o==="Real"?fe(r.amount,se,l):l.afterAmount;continue}l.productType===r.productType&&(r.amount=o==="Real"?fe(r.amount,se[r.productType],l):l.afterAmount)}we()},_e=()=>{a(2,L=!1),window.postMessage({type:"GoToDeposit"},window.location.href),typeof gtag=="function"&&gtag("event","GoToDeposit",{context:"PlayerAccountBalanceModal"})},Ee=()=>{ce.includes(F)||(console.error(`Unsupported value ('${F}') for totalcalculationmode parameter. Only the following values are supported ${ce}. Using default value ('${ce[0]}').`),a(7,F=ce[0]))},De=()=>{switch(rt(h),Ee(),D){case"gmcore":J();break;case"gm16":de();break;default:throw Error(`Invalid apiversion attribute: ${D}`)}},me=s=>s.data&&s.data.type==="LogoutSuccessfull"&&te.close();t.onMount(()=>(window.addEventListener("message",me,!1),()=>{window.removeEventListener("message",me),te&&te.close()}));const Be=()=>a(2,L=!0),ue=()=>a(2,L=!1),G=()=>_e(),Le=()=>a(2,L=!1);function Me(s){t.binding_callbacks[s?"unshift":"push"](()=>{T=s,a(0,T)})}return c.$$set=s=>{"userid"in s&&a(8,p=s.userid),"session"in s&&a(9,d=s.session),"endpoint"in s&&a(10,g=s.endpoint),"lang"in s&&a(11,h=s.lang),"mbsource"in s&&a(12,v=s.mbsource),"clientstyling"in s&&a(13,C=s.clientstyling),"clientstylingurl"in s&&a(14,_=s.clientstylingurl),"translationurl"in s&&a(15,A=s.translationurl),"gmversion"in s&&a(16,D=s.gmversion),"displaybalanceoption"in s&&a(17,x=s.displaybalanceoption),"totalcalculationmode"in s&&a(7,F=s.totalcalculationmode),"currencylocale"in s&&a(18,W=s.currencylocale),"currencydisplay"in s&&a(19,ee=s.currencydisplay),"maximumfractiondigits"in s&&a(20,Y=s.maximumfractiondigits),"minimumfractiondigits"in s&&a(21,P=s.minimumfractiondigits),"customdisplayformat"in s&&a(22,R=s.customdisplayformat)},c.$$.update=()=>{c.$$.dirty[0]&200448&&g&&p&&d&&h&&D&&x&&De(),c.$$.dirty[0]&67328&&g&&p&&d&&D&&ae(),c.$$.dirty[0]&8193&&C&&T&&t.setClientStyling(T,C),c.$$.dirty[0]&16385&&_&&T&&t.setClientStylingURL(T,_),c.$$.dirty[0]&4097&&T&&t.setStreamStyling(T,`${v}.Style`),c.$$.dirty[0]&32768&&A&&ve()},[T,j,L,f,m,Ce,_e,F,p,d,g,h,v,C,_,A,D,x,W,ee,Y,P,R,Be,ue,G,Le,Me]}class Ze extends t.SvelteComponent{constructor(n){super(),t.init(this,n,ut,dt,t.safe_not_equal,{userid:8,session:9,endpoint:10,lang:11,mbsource:12,clientstyling:13,clientstylingurl:14,translationurl:15,gmversion:16,displaybalanceoption:17,totalcalculationmode:7,currencylocale:18,currencydisplay:19,maximumfractiondigits:20,minimumfractiondigits:21,customdisplayformat:22},lt,[-1,-1])}get userid(){return this.$$.ctx[8]}set userid(n){this.$$set({userid:n}),t.flush()}get session(){return this.$$.ctx[9]}set session(n){this.$$set({session:n}),t.flush()}get endpoint(){return this.$$.ctx[10]}set endpoint(n){this.$$set({endpoint:n}),t.flush()}get lang(){return this.$$.ctx[11]}set lang(n){this.$$set({lang:n}),t.flush()}get mbsource(){return this.$$.ctx[12]}set mbsource(n){this.$$set({mbsource:n}),t.flush()}get clientstyling(){return this.$$.ctx[13]}set clientstyling(n){this.$$set({clientstyling:n}),t.flush()}get clientstylingurl(){return this.$$.ctx[14]}set clientstylingurl(n){this.$$set({clientstylingurl:n}),t.flush()}get translationurl(){return this.$$.ctx[15]}set translationurl(n){this.$$set({translationurl:n}),t.flush()}get gmversion(){return this.$$.ctx[16]}set gmversion(n){this.$$set({gmversion:n}),t.flush()}get displaybalanceoption(){return this.$$.ctx[17]}set displaybalanceoption(n){this.$$set({displaybalanceoption:n}),t.flush()}get totalcalculationmode(){return this.$$.ctx[7]}set totalcalculationmode(n){this.$$set({totalcalculationmode:n}),t.flush()}get currencylocale(){return this.$$.ctx[18]}set currencylocale(n){this.$$set({currencylocale:n}),t.flush()}get currencydisplay(){return this.$$.ctx[19]}set currencydisplay(n){this.$$set({currencydisplay:n}),t.flush()}get maximumfractiondigits(){return this.$$.ctx[20]}set maximumfractiondigits(n){this.$$set({maximumfractiondigits:n}),t.flush()}get minimumfractiondigits(){return this.$$.ctx[21]}set minimumfractiondigits(n){this.$$set({minimumfractiondigits:n}),t.flush()}get customdisplayformat(){return this.$$.ctx[22]}set customdisplayformat(n){this.$$set({customdisplayformat:n}),t.flush()}}t.create_custom_element(Ze,{userid:{},session:{},endpoint:{},lang:{},mbsource:{},clientstyling:{},clientstylingurl:{},translationurl:{},gmversion:{},displaybalanceoption:{},totalcalculationmode:{},currencylocale:{},currencydisplay:{},maximumfractiondigits:{},minimumfractiondigits:{},customdisplayformat:{}},[],[],!0);exports.default=Ze;
5
+ */(function(c,n){(function(a){var m=a.setTimeout,p=a.clearTimeout,d=a.XMLHttpRequest,g=a.XDomainRequest,h=a.ActiveXObject,v=a.EventSource,C=a.document,_=a.Promise,A=a.fetch,D=a.Response,R=a.TextDecoder,F=a.TextEncoder,W=a.AbortController;if(typeof window!="undefined"&&typeof C!="undefined"&&!("readyState"in C)&&C.body==null&&(C.readyState="loading",window.addEventListener("load",function(e){C.readyState="complete"},!1)),d==null&&h!=null&&(d=function(){return new h("Microsoft.XMLHTTP")}),Object.create==null&&(Object.create=function(e){function o(){}return o.prototype=e,new o}),Date.now||(Date.now=function(){return new Date().getTime()}),W==null){var ee=A;A=function(e,o){var l=o.signal;return ee(e,{headers:o.headers,credentials:o.credentials,cache:o.cache}).then(function(r){var i=r.body.getReader();return l._reader=i,l._aborted&&l._reader.cancel(),{status:r.status,statusText:r.statusText,headers:r.headers,body:{getReader:function(){return i}}}})},W=function(){this.signal={_reader:null,_aborted:!1},this.abort=function(){this.signal._reader!=null&&this.signal._reader.cancel(),this.signal._aborted=!0}}}function Y(){this.bitsNeeded=0,this.codePoint=0}Y.prototype.decode=function(e){function o(S,M,b){if(b===1)return S>=128>>M&&S<<M<=2047;if(b===2)return S>=2048>>M&&S<<M<=55295||S>=57344>>M&&S<<M<=65535;if(b===3)return S>=65536>>M&&S<<M<=1114111;throw new Error}function l(S,M){if(S===6*1)return M>>6>15?3:M>31?2:1;if(S===6*2)return M>15?3:2;if(S===6*3)return 3;throw new Error}for(var r=65533,i="",u=this.bitsNeeded,y=this.codePoint,E=0;E<e.length;E+=1){var B=e[E];u!==0&&(B<128||B>191||!o(y<<6|B&63,u-6,l(u,y)))&&(u=0,y=r,i+=String.fromCharCode(y)),u===0?(B>=0&&B<=127?(u=0,y=B):B>=192&&B<=223?(u=6*1,y=B&31):B>=224&&B<=239?(u=6*2,y=B&15):B>=240&&B<=247?(u=6*3,y=B&7):(u=0,y=r),u!==0&&!o(y,u,l(u,y))&&(u=0,y=r)):(u-=6,y=y<<6|B&63),u===0&&(y<=65535?i+=String.fromCharCode(y):(i+=String.fromCharCode(55296+(y-65535-1>>10)),i+=String.fromCharCode(56320+(y-65535-1&1023))))}return this.bitsNeeded=u,this.codePoint=y,i};var P=function(){try{return new R().decode(new F().encode("test"),{stream:!0})==="test"}catch(e){console.debug("TextDecoder does not support streaming option. Using polyfill instead: "+e)}return!1};(R==null||F==null||!P())&&(R=Y);var x=function(){};function T(e){this.withCredentials=!1,this.readyState=0,this.status=0,this.statusText="",this.responseText="",this.onprogress=x,this.onload=x,this.onerror=x,this.onreadystatechange=x,this._contentType="",this._xhr=e,this._sendTimeout=0,this._abort=x}T.prototype.open=function(e,o){this._abort(!0);var l=this,r=this._xhr,i=1,u=0;this._abort=function(b){l._sendTimeout!==0&&(p(l._sendTimeout),l._sendTimeout=0),(i===1||i===2||i===3)&&(i=4,r.onload=x,r.onerror=x,r.onabort=x,r.onprogress=x,r.onreadystatechange=x,r.abort(),u!==0&&(p(u),u=0),b||(l.readyState=4,l.onabort(null),l.onreadystatechange())),i=0};var y=function(){if(i===1){var b=0,k="",oe=void 0;if("contentType"in r)b=200,k="OK",oe=r.contentType;else try{b=r.status,k=r.statusText,oe=r.getResponseHeader("Content-Type")}catch(Te){b=0,k="",oe=void 0}b!==0&&(i=2,l.readyState=2,l.status=b,l.statusText=k,l._contentType=oe,l.onreadystatechange())}},E=function(){if(y(),i===2||i===3){i=3;var b="";try{b=r.responseText}catch(k){}l.readyState=3,l.responseText=b,l.onprogress()}},B=function(b,k){if((k==null||k.preventDefault==null)&&(k={preventDefault:x}),E(),i===1||i===2||i===3){if(i=4,u!==0&&(p(u),u=0),l.readyState=4,b==="load")l.onload(k);else if(b==="error")l.onerror(k);else if(b==="abort")l.onabort(k);else throw new TypeError;l.onreadystatechange()}},S=function(b){r!=null&&(r.readyState===4?(!("onload"in r)||!("onerror"in r)||!("onabort"in r))&&B(r.responseText===""?"error":"load",b):r.readyState===3?"onprogress"in r||E():r.readyState===2&&y())},M=function(){u=m(function(){M()},500),r.readyState===3&&E()};"onload"in r&&(r.onload=function(b){B("load",b)}),"onerror"in r&&(r.onerror=function(b){B("error",b)}),"onabort"in r&&(r.onabort=function(b){B("abort",b)}),"onprogress"in r&&(r.onprogress=E),"onreadystatechange"in r&&(r.onreadystatechange=function(b){S(b)}),("contentType"in r||!("ontimeout"in d.prototype))&&(o+=(o.indexOf("?")===-1?"?":"&")+"padding=true"),r.open(e,o,!0),"readyState"in r&&(u=m(function(){M()},0))},T.prototype.abort=function(){this._abort(!1)},T.prototype.getResponseHeader=function(e){return this._contentType},T.prototype.setRequestHeader=function(e,o){var l=this._xhr;"setRequestHeader"in l&&l.setRequestHeader(e,o)},T.prototype.getAllResponseHeaders=function(){return this._xhr.getAllResponseHeaders!=null&&this._xhr.getAllResponseHeaders()||""},T.prototype.send=function(){if((!("ontimeout"in d.prototype)||!("sendAsBinary"in d.prototype)&&!("mozAnon"in d.prototype))&&C!=null&&C.readyState!=null&&C.readyState!=="complete"){var e=this;e._sendTimeout=m(function(){e._sendTimeout=0,e.send()},4);return}var o=this._xhr;"withCredentials"in o&&(o.withCredentials=this.withCredentials);try{o.send(void 0)}catch(l){throw l}};function j(e){return e.replace(/[A-Z]/g,function(o){return String.fromCharCode(o.charCodeAt(0)+32)})}function L(e){for(var o=Object.create(null),l=e.split(`\r
6
+ `),r=0;r<l.length;r+=1){var i=l[r],u=i.split(": "),y=u.shift(),E=u.join(": ");o[j(y)]=E}this._map=o}L.prototype.get=function(e){return this._map[j(e)]},d!=null&&d.HEADERS_RECEIVED==null&&(d.HEADERS_RECEIVED=2);function Q(){}Q.prototype.open=function(e,o,l,r,i,u,y){e.open("GET",i);var E=0;e.onprogress=function(){var S=e.responseText,M=S.slice(E);E+=M.length,l(M)},e.onerror=function(S){S.preventDefault(),r(new Error("NetworkError"))},e.onload=function(){r(null)},e.onabort=function(){r(null)},e.onreadystatechange=function(){if(e.readyState===d.HEADERS_RECEIVED){var S=e.status,M=e.statusText,b=e.getResponseHeader("Content-Type"),k=e.getAllResponseHeaders();o(S,M,b,new L(k))}},e.withCredentials=u;for(var B in y)Object.prototype.hasOwnProperty.call(y,B)&&e.setRequestHeader(B,y[B]);return e.send(),e};function te(e){this._headers=e}te.prototype.get=function(e){return this._headers.get(e)};function ne(){}ne.prototype.open=function(e,o,l,r,i,u,y){var E=null,B=new W,S=B.signal,M=new R;return A(i,{headers:y,credentials:u?"include":"same-origin",signal:S,cache:"no-store"}).then(function(b){return E=b.body.getReader(),o(b.status,b.statusText,b.headers.get("Content-Type"),new te(b.headers)),new _(function(k,oe){var Te=function(){E.read().then(function(X){if(X.done)k(void 0);else{var I=M.decode(X.value,{stream:!0});l(I),Te()}}).catch(function(X){oe(X)})};Te()})}).catch(function(b){if(b.name!=="AbortError")return b}).then(function(b){r(b)}),{abort:function(){E!=null&&E.cancel(),B.abort()}}};function V(){this._listeners=Object.create(null)}function se(e){m(function(){throw e},0)}V.prototype.dispatchEvent=function(e){e.target=this;var o=this._listeners[e.type];if(o!=null)for(var l=o.length,r=0;r<l;r+=1){var i=o[r];try{typeof i.handleEvent=="function"?i.handleEvent(e):i.call(this,e)}catch(u){se(u)}}},V.prototype.addEventListener=function(e,o){e=String(e);var l=this._listeners,r=l[e];r==null&&(r=[],l[e]=r);for(var i=!1,u=0;u<r.length;u+=1)r[u]===o&&(i=!0);i||r.push(o)},V.prototype.removeEventListener=function(e,o){e=String(e);var l=this._listeners,r=l[e];if(r!=null){for(var i=[],u=0;u<r.length;u+=1)r[u]!==o&&i.push(r[u]);i.length===0?delete l[e]:l[e]=i}};function f(e){this.type=e,this.target=void 0}function ce(e,o){f.call(this,e),this.data=o.data,this.lastEventId=o.lastEventId}ce.prototype=Object.create(f.prototype);function ve(e,o){f.call(this,e),this.status=o.status,this.statusText=o.statusText,this.headers=o.headers}ve.prototype=Object.create(f.prototype);function Ce(e,o){f.call(this,e),this.error=o.error}Ce.prototype=Object.create(f.prototype);var be=-1,J=0,de=1,ae=2,he=-1,$=0,fe=1,we=2,Re=3,_e=/^text\/event\-stream(;.*)?$/i,Ee=1e3,De=18e6,me=function(e,o){var l=e==null?o:parseInt(e,10);return l!==l&&(l=o),Be(l)},Be=function(e){return Math.min(Math.max(e,Ee),De)},ue=function(e,o,l){try{typeof o=="function"&&o.call(e,l)}catch(r){se(r)}};function G(e,o){V.call(this),o=o||{},this.onopen=void 0,this.onmessage=void 0,this.onerror=void 0,this.url=void 0,this.readyState=void 0,this.withCredentials=void 0,this.headers=void 0,this._close=void 0,s(this,e,o)}function Le(){return d!=null&&"withCredentials"in d.prototype||g==null?new d:new g}var Me=A!=null&&D!=null&&"body"in D.prototype;function s(e,o,l){o=String(o);var r=!!l.withCredentials,i=l.lastEventIdQueryParameterName||"lastEventId",u=Be(1e3),y=me(l.heartbeatTimeout,45e3),E="",B=u,S=!1,M=0,b=l.headers||{},k=l.Transport,oe=Me&&k==null?void 0:new T(k!=null?new k:Le()),Te=k!=null&&typeof k!="string"?new k:oe==null?new ne:new Q,X=void 0,I=0,Z=be,ye="",Ae="",re="",xe="",z=$,Fe=0,pe=0,Je=function(N,O,q,K){if(Z===J)if(N===200&&q!=null&&_e.test(q)){Z=de,S=Date.now(),B=u,e.readyState=de;var U=new ve("open",{status:N,statusText:O,headers:K});e.dispatchEvent(U),ue(e,e.onopen,U)}else{var H="";N!==200?(O&&(O=O.replace(/\s+/g," ")),H="EventSource's response has a status "+N+" "+O+" that is not 200. Aborting the connection."):H="EventSource's response has a Content-Type specifying an unsupported type: "+(q==null?"-":q.replace(/\s+/g," "))+". Aborting the connection.",ke();var U=new ve("error",{status:N,statusText:O,headers:K});e.dispatchEvent(U),ue(e,e.onerror,U),console.error(H)}},$e=function(N){if(Z===de){for(var O=-1,q=0;q<N.length;q+=1){var K=N.charCodeAt(q);(K===10||K===13)&&(O=q)}var U=(O!==-1?xe:"")+N.slice(0,O+1);xe=(O===-1?xe:"")+N.slice(O+1),N!==""&&(S=Date.now(),M+=N.length);for(var H=0;H<U.length;H+=1){var K=U.charCodeAt(H);if(z===he&&K===10)z=$;else if(z===he&&(z=$),K===13||K===10){if(z!==$){z===fe&&(pe=H+1);var ie=U.slice(Fe,pe-1),le=U.slice(pe+(pe<H&&U.charCodeAt(pe)===32?1:0),H);ie==="data"?(ye+=`
7
+ `,ye+=le):ie==="id"?Ae=le:ie==="event"?re=le:ie==="retry"?(u=me(le,u),B=u):ie==="heartbeatTimeout"&&(y=me(le,y),I!==0&&(p(I),I=m(function(){Se()},y)))}if(z===$){if(ye!==""){E=Ae,re===""&&(re="message");var ge=new ce(re,{data:ye.slice(1),lastEventId:Ae});if(e.dispatchEvent(ge),re==="open"?ue(e,e.onopen,ge):re==="message"?ue(e,e.onmessage,ge):re==="error"&&ue(e,e.onerror,ge),Z===ae)return}ye="",re=""}z=K===13?he:$}else z===$&&(Fe=H,z=fe),z===fe?K===58&&(pe=H+1,z=we):z===we&&(z=Re)}}},je=function(N){if(Z===de||Z===J){Z=be,I!==0&&(p(I),I=0),I=m(function(){Se()},B),B=Be(Math.min(u*16,B*2)),e.readyState=J;var O=new Ce("error",{error:N});e.dispatchEvent(O),ue(e,e.onerror,O),N!=null&&console.error(N)}},ke=function(){Z=ae,X!=null&&(X.abort(),X=void 0),I!==0&&(p(I),I=0),e.readyState=ae},Se=function(){if(I=0,Z!==be){if(!S&&X!=null)je(new Error("No activity within "+y+" milliseconds. "+(Z===J?"No response received.":M+" chars received.")+" Reconnecting.")),X!=null&&(X.abort(),X=void 0);else{var N=Math.max((S||Date.now())+y-Date.now(),1);S=!1,I=m(function(){Se()},N)}return}S=!1,M=0,I=m(function(){Se()},y),Z=J,ye="",re="",Ae=E,xe="",Fe=0,pe=0,z=$;var O=o;if(o.slice(0,5)!=="data:"&&o.slice(0,5)!=="blob:"&&E!==""){var q=o.indexOf("?");O=q===-1?o:o.slice(0,q+1)+o.slice(q+1).replace(/(?:^|&)([^=&]*)(?:=[^&]*)?/g,function(le,ge){return ge===i?"":le}),O+=(o.indexOf("?")===-1?"?":"&")+i+"="+encodeURIComponent(E)}var K=e.withCredentials,U={};U.Accept="text/event-stream";var H=e.headers;if(H!=null)for(var ie in H)Object.prototype.hasOwnProperty.call(H,ie)&&(U[ie]=H[ie]);try{X=Te.open(oe,Je,$e,je,O,K,U)}catch(le){throw ke(),le}};e.url=o,e.readyState=J,e.withCredentials=r,e.headers=b,e._close=ke,Se()}G.prototype=Object.create(V.prototype),G.prototype.CONNECTING=J,G.prototype.OPEN=de,G.prototype.CLOSED=ae,G.prototype.close=function(){this._close()},G.CONNECTING=J,G.OPEN=de,G.CLOSED=ae,G.prototype.withCredentials=void 0;var w=v;d!=null&&(v==null||!("withCredentials"in v.prototype))&&(w=G),function(e){{var o=e(n);o!==void 0&&(c.exports=o)}}(function(e){e.EventSourcePolyfill=G,e.NativeEventSource=v,e.EventSource=w})})(typeof globalThis=="undefined"?typeof window!="undefined"?window:typeof self!="undefined"?self:t.commonjsGlobal:globalThis)})(Ne,Ne.exports);var it=Ne.exports;function lt(c){t.append_styles(c,"svelte-gv6dm2",'*,*::before,*::after{font-family:inherit}:host{font-family:inherit}input,textarea,button{font-family:inherit}p{padding:0;margin:0}.ShowBalance{position:relative}.ShowBalance .Loading{font-size:14px;white-space:nowrap;padding-right:10px}.ShowBalance .BalanceValue{font-size:14px;cursor:pointer;display:flex;flex-wrap:nowrap;white-space:nowrap;background:transparent;border:none;font:inherit;color:inherit}.ShowBalance .BalanceValue svg{width:16px}.ShowBalance .BalanceValue span{padding-left:8px}@media only screen and (max-width: 360px){.ShowBalance .BalanceValue{font-size:12px}.ShowBalance .BalanceValue svg{width:12px}}.BalanceModalWrapper{background-color:var(--emw--color-white, #FFFFFF);position:absolute;top:45px;left:50%;transform:translateX(-60%);padding:10px;box-shadow:0px 30px 30px var(--emw--header-color-primary, var(--emw--color-primary, #22B04E));border-radius:5px;z-index:17;box-shadow:0px 5px 20px 0px #191919}.BalanceModalWrapper:before{content:"";background:var(--emw--color-white, #FFFFFF);clip-path:polygon(50% 0, 0% 100%, 100% 100%);position:absolute;top:-8px;left:60%;width:25px;height:10px;transform:translateX(-50%);z-index:1}.BalanceModalClose{position:absolute;top:5px;right:5px;width:20px;height:20px;z-index:1;cursor:pointer;font:inherit}.BalanceModalClose:before{content:"";background:var(--emw--color-secondary, var(--emw--color-secondary, #FD2839));position:absolute;top:8px;left:0;width:20px;height:2px;transform:rotate(45deg)}.BalanceModalClose:after{content:"";background:var(--emw--color-secondary, var(--emw--color-secondary, #FD2839));position:absolute;top:8px;left:0;width:20px;height:2px;transform:rotate(-45deg)}.BalanceModal{position:relative;width:280px}.BalanceModalHeader{display:flex;align-items:center;justify-content:center;padding:20px 0}.BalanceModalHeader .BalanceModalTitle{font-size:16px;font-weight:bold;color:var(--emw--header-contrast, var(--emw--color-contrast, #07072A))}.BalanceModalRowBoth{display:flex;flex-direction:column;gap:5px;padding:20px 0;border-bottom:1px solid var(--emw--color-gray-100, #E6E6E6)}.BalanceModalRowBoth:last-child{border-bottom:none}.BalanceModalRowBoth .BalanceModalRowLine{display:flex;width:100%;justify-content:space-between}.BalanceModalRowBoth .BalanceModalText{color:var(--emw--header-contrast, var(--emw--color-contrast, #07072A));font-size:14px;text-transform:capitalize}.BalanceModalRowBoth .BalanceModalValue{font-size:14px;font-weight:bold;color:var(--emw--header-contrast, var(--emw--color-contrast, #07072A))}.BalanceModalFooter{display:flex;align-items:center;padding:20px 0 10px}.BalanceModalFooter .BalanceModalAction{background:var(--emw--header-color-primary, var(--emw--color-primary, #22B04E));font-size:12px;color:white;text-transform:uppercase;width:100%;border-radius:5px;border:none;padding:10px 0;cursor:pointer}.BalanceModalFooter .BalanceModalAction:hover,.BalanceModalFooter .BalanceModalActionactive{background:var(--emw--header-contrast, var(--emw--color-background, #07072A))}.ShowBalanceModalOverlay{background-color:rgba(0, 0, 0, 0.7);position:fixed;top:0;bottom:0;left:0;right:0;z-index:16}')}function Xe(c,n,a){const m=c.slice();return m[48]=n[a],m}function qe(c,n,a){const m=c.slice();return m[51]=n[a],m}function st(c){let n,a=(c[3].Total?c[5](c[3].Total[0].amount):"0")+"",m,p,d,g,h,v,C,_=c[2]&&Ke(c);return{c(){n=t.element("button"),m=t.text(a),p=t.space(),d=t.element("span"),d.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 11.435"><defs><style>.a{fill:var(--emw--color-white, #FFFFFF);}</style></defs><path class="a" d="M16.191,19.235l7.562-7.568a1.423,1.423,0,0,1,2.019,0,1.441,1.441,0,0,1,0,2.025L17.2,22.265a1.427,1.427,0,0,1-1.971.042L6.6,13.7a1.429,1.429,0,0,1,2.019-2.025Z" transform="translate(-6.188 -11.246)"></path></svg>',g=t.space(),_&&_.c(),h=t.empty(),t.attr(n,"class","BalanceValue")},m(A,D){t.insert(A,n,D),t.append(n,m),t.append(n,p),t.append(n,d),t.insert(A,g,D),_&&_.m(A,D),t.insert(A,h,D),v||(C=t.listen(n,"click",c[23]),v=!0)},p(A,D){D[0]&8&&a!==(a=(A[3].Total?A[5](A[3].Total[0].amount):"0")+"")&&t.set_data(m,a),A[2]?_?_.p(A,D):(_=Ke(A),_.c(),_.m(h.parentNode,h)):_&&(_.d(1),_=null)},d(A){A&&(t.detach(n),t.detach(g),t.detach(h)),_&&_.d(A),v=!1,C()}}}function ct(c){let n,a=c[4]("Loading")+"",m;return{c(){n=t.element("p"),m=t.text(a)},m(p,d){t.insert(p,n,d),t.append(n,m)},p(p,d){d[0]&16&&a!==(a=p[4]("Loading")+"")&&t.set_data(m,a)},d(p){p&&t.detach(n)}}}function Ke(c){let n,a,m,p,d,g,h=c[4]("Title")+"",v,C,_,A,D,R,F=c[4]("DepositButton")+"",W,ee,Y,P=t.ensure_array_like(Object.keys(c[3])),x=[];for(let T=0;T<P.length;T+=1)x[T]=Ye(Xe(c,P,T));return{c(){n=t.element("div"),a=t.element("button"),m=t.space(),p=t.element("div"),d=t.element("div"),g=t.element("p"),v=t.text(h),C=t.space(),_=t.element("div");for(let T=0;T<x.length;T+=1)x[T].c();A=t.space(),D=t.element("div"),R=t.element("button"),W=t.text(F),t.attr(a,"class","BalanceModalClose"),t.attr(g,"class","BalanceModalTitle"),t.attr(d,"class","BalanceModalHeader"),t.attr(_,"class","BalanceModalBody"),t.attr(R,"class","BalanceModalAction"),t.attr(D,"class","BalanceModalFooter"),t.attr(p,"class","BalanceModal"),t.attr(n,"class","BalanceModalWrapper")},m(T,j){t.insert(T,n,j),t.append(n,a),t.append(n,m),t.append(n,p),t.append(p,d),t.append(d,g),t.append(g,v),t.append(p,C),t.append(p,_);for(let L=0;L<x.length;L+=1)x[L]&&x[L].m(_,null);t.append(p,A),t.append(p,D),t.append(D,R),t.append(R,W),ee||(Y=[t.listen(a,"click",c[24]),t.listen(R,"click",c[25])],ee=!0)},p(T,j){if(j[0]&16&&h!==(h=T[4]("Title")+"")&&t.set_data(v,h),j[0]&56){P=t.ensure_array_like(Object.keys(T[3]));let L;for(L=0;L<P.length;L+=1){const Q=Xe(T,P,L);x[L]?x[L].p(Q,j):(x[L]=Ye(Q),x[L].c(),x[L].m(_,null))}for(;L<x.length;L+=1)x[L].d(1);x.length=P.length}j[0]&16&&F!==(F=T[4]("DepositButton")+"")&&t.set_data(W,F)},d(T){T&&t.detach(n),t.destroy_each(x,T),ee=!1,t.run_all(Y)}}}function We(c){let n,a,m=c[4](c[48])+"",p,d,g=(c[51].productType?c[4](c[51].productType):"")+"",h,v,C,_,A=c[5](c[51].amount)+"",D;return{c(){n=t.element("div"),a=t.element("p"),p=t.text(m),d=t.space(),h=t.text(g),v=t.space(),C=t.element("p"),_=t.element("span"),D=t.text(A),t.attr(a,"class","BalanceModalText"),t.attr(_,"class","BalanceModalAmount"),t.attr(C,"class","BalanceModalValue"),t.attr(n,"class","BalanceModalRowLine")},m(R,F){t.insert(R,n,F),t.append(n,a),t.append(a,p),t.append(a,d),t.append(a,h),t.append(n,v),t.append(n,C),t.append(C,_),t.append(_,D)},p(R,F){F[0]&24&&m!==(m=R[4](R[48])+"")&&t.set_data(p,m),F[0]&24&&g!==(g=(R[51].productType?R[4](R[51].productType):"")+"")&&t.set_data(h,g),F[0]&8&&A!==(A=R[5](R[51].amount)+"")&&t.set_data(D,A)},d(R){R&&t.detach(n)}}}function Ye(c){let n,a,m=t.ensure_array_like(c[3][c[48]]),p=[];for(let d=0;d<m.length;d+=1)p[d]=We(qe(c,m,d));return{c(){n=t.element("div");for(let d=0;d<p.length;d+=1)p[d].c();a=t.space(),t.attr(n,"class","BalanceModalRowBoth")},m(d,g){t.insert(d,n,g);for(let h=0;h<p.length;h+=1)p[h]&&p[h].m(n,null);t.append(n,a)},p(d,g){if(g[0]&56){m=t.ensure_array_like(d[3][d[48]]);let h;for(h=0;h<m.length;h+=1){const v=qe(d,m,h);p[h]?p[h].p(v,g):(p[h]=We(v),p[h].c(),p[h].m(n,a))}for(;h<p.length;h+=1)p[h].d(1);p.length=m.length}},d(d){d&&t.detach(n),t.destroy_each(p,d)}}}function Qe(c){let n,a,m;return{c(){n=t.element("button"),t.attr(n,"class","ShowBalanceModalOverlay")},m(p,d){t.insert(p,n,d),a||(m=t.listen(n,"click",c[26]),a=!0)},p:t.noop,d(p){p&&t.detach(n),a=!1,m()}}}function dt(c){let n,a,m;function p(v,C){return v[1]?ct:st}let d=p(c),g=d(c),h=c[2]&&Qe(c);return{c(){n=t.element("div"),a=t.element("div"),g.c(),m=t.space(),h&&h.c(),t.attr(a,"class","ShowBalance")},m(v,C){t.insert(v,n,C),t.append(n,a),g.m(a,null),t.append(n,m),h&&h.m(n,null),c[27](n)},p(v,C){d===(d=p(v))&&g?g.p(v,C):(g.d(1),g=d(v),g&&(g.c(),g.m(a,null))),v[2]?h?h.p(v,C):(h=Qe(v),h.c(),h.m(n,null)):h&&(h.d(1),h=null)},i:t.noop,o:t.noop,d(v){v&&t.detach(n),g.d(),h&&h.d(),c[27](null)}}}function ut(c,n,a){let m;t.component_subscribe(c,t.$format,s=>a(4,m=s));let{userid:p=""}=n,{session:d=""}=n,{endpoint:g=""}=n,{lang:h="en"}=n,{mbsource:v}=n,{clientstyling:C=""}=n,{clientstylingurl:_=""}=n,{translationurl:A=""}=n,{gmversion:D="gm16"}=n,{displaybalanceoption:R="All"}=n,{totalcalculationmode:F="totalCashAmount"}=n,{currencylocale:W="en"}=n,{currencydisplay:ee="symbol"}=n,{maximumfractiondigits:Y="2"}=n,{minimumfractiondigits:P="0"}=n,{customdisplayformat:x=""}=n,T,j=!0,L=!1,Q=!1,te,ne="",V=[],se;const f={},ce=["totalCashAmount","totalRealAmount"],ve=()=>{fetch(A).then(s=>s.json()).then(s=>Object.keys(s).forEach(w=>Ve(w,s[w]))).catch(s=>console.log(s))};Object.keys(Ge).forEach(s=>Ve(s,Ge[s]));const Ce=s=>{if(x)return be(s);const w=W||h,e={style:"currency",currency:ne,useGrouping:!0,currencyDisplay:ee||"code",maximumFractionDigits:Y===""||isNaN(Number(Y))?2:Number(Y),minimumFractionDigits:P===""||isNaN(Number(P))?0:Number(P)};return new Intl.NumberFormat(w,e).format(s)},be=s=>{const w=[];let e="";for(const o of x)switch(o){default:e+=o;break;case"{":e&&w.push(e),e="";break;case"}":const[l,r]=e.split("|");if(e="",l.toLowerCase()==="currency")e=ne;else if(l.toLowerCase()==="amount"){let i=",",u=".",y=2;r&&(r[0]!==" "&&(i=r[0]),r[1]!==" "&&(u=r[1]),r[2]!==" "&&!isNaN(Number(r[2]))&&(y=Number(r[2])));let[E,B]=String(Math.floor(s*Oe(10,y))/Oe(10,y)).split(".");e+=E[0];for(let S=1;S<E.length;++S)(E.length-S)%3===0?e+=i+E[S]:e+=E[S];B&&(e+=u+B)}e&&w.push(e),e="";break}return w.push(e),w.join("")},J=()=>Pe(this,null,function*(){var w,e,o;a(1,j=!0);const s=new URL(`${g}/v1/player/${p}/account`);try{const l=yield fetch(s,{method:"GET",headers:{"X-SessionID":d}}),r=yield l.json();if(l.ok)V=r.items,ne=(w=V.find(i=>i.displayName==="Casino"))==null?void 0:w.currency,a(3,f.Total=[{amount:r.totalAmount[ne]}],f),a(3,f.Real=[{amount:(e=V.find(i=>i.displayName==="Casino"))==null?void 0:e.balanceAmount}],f),a(3,f.Bonus=[{amount:(o=V.find(i=>i.displayName==="UBS"))==null?void 0:o.balanceAmount}],f);else throw new Error("Failed to fetch balance data !")}catch(l){console.log("Balance error: ",l)}finally{a(1,j=!1)}}),de=()=>{a(1,j=!0);const s=new URL(`${g}/v2/player/${p}/balance`),w=new Headers;w.append("X-SessionID",d),fetch(s,{method:"GET",headers:w}).then(o=>o.json()).then(o=>{o[F]||a(7,F=ce[0]);const l=o.items.find(i=>i.type==="Real"&&i.walletAccountType==="Ordinary");if(ne=l.currency,Q=!!l.productType,a(3,f.Total=[{amount:0}],f),a(3,f.Real=[],f),a(3,f.Bonus=[],f),a(3,f.Credit=[],f),!Q){se={lastOrdinaryAfterAmount:0,showCreditLineAfterAmount:!1},a(3,f.Total[0].amount=o[F][ne],f);for(const i of o.items)switch(i.type){case"Bonus":f.Bonus.length===0?f.Bonus.push({amount:i.amount}):a(3,f.Bonus[0].amount+=i.amount,f);break;case"Real":if(i.creditLine&&f.Credit.length===0&&f.Credit.push({amount:i.creditLine}),F==="totalRealAmount")continue;f.Real.length===0?f.Real.push({amount:i.amount}):a(3,f.Real[0].amount+=i.amount,f);break}for(const[i,u]of Object.entries(f))u.length<1&&delete f[i];a(1,j=!1);return}se={Casino:{lastOrdinaryAfterAmount:0,showCreditLineAfterAmount:!1},Sports:{lastOrdinaryAfterAmount:0,showCreditLineAfterAmount:!1}};let r=o.items;R&&R!=="All"&&(r=o.items.filter(i=>i.productType===R));for(const i of r){let u;switch(i.type){case"Bonus":u=f.Bonus.findIndex(y=>y.productType===i.productType),u>0?a(3,f.Bonus[u].amount+=i.amount,f):f.Bonus.push({amount:i.amount,productType:i.productType});break;case"Real":i.creditLine&&f.Credit.push({amount:i.creditLine,productType:i.productType}),u=f.Real.findIndex(y=>y.productType===i.productType),u>0?a(3,f.Real[u].amount+=i.amount,f):f.Real.push({amount:i.amount,productType:i.productType});break}}we();for(const[i,u]of Object.entries(f))u.length<1&&delete f[i];a(1,j=!1)}).catch(()=>{throw a(1,j=!1),new Error("Failed to fetch balance data !")})},ae=()=>{if(te&&te.close(),d.length<1)return;let s,w;switch(D){case"gm16":s=new URL(`${g}/v2/player/${p}/information/updates`),w=l=>Re(l);break;case"gmcore":s=new URL(`${g}/v1/player/${p}/balance/updates`),w=l=>$(l);break}const e={accept:"text/event-stream","X-SessionId":d},o=new it.EventSourcePolyfill(s,{headers:e});te=o,o.addEventListener("message",w)},he=s=>{let w;try{w=JSON.parse(s)}catch(e){console.log("Balance stream failed: ",e);return}return w},$=s=>{var l,r;const w=he(s.data);if(!w){ae();return}let e="0";const o=w.balanceChange;V=V.map(i=>(o&&o[i.id]&&(i=Ue(ze({},i),{balanceAmount:o[i.id].afterAmount})),e=(parseFloat(i==null?void 0:i.balanceAmount)+parseFloat(e)).toString(),i)),a(3,f.Real=[{amount:(l=V[0])==null?void 0:l.balanceAmount}],f),a(3,f.Bonus=[{amount:(r=V[1])==null?void 0:r.balanceAmount}],f),a(3,f.Total=[{amount:Number(e)}],f)},fe=(s,w,e)=>{let o=null;switch(e.walletAccountType){case"Ordinary":(e.afterAmount!==e.affectedAmount||w.lastOrdinaryAfterAmount===0)&&(w.lastOrdinaryAfterAmount=e.afterAmount,w.showCreditLineAfterAmount||(o=e.afterAmount));break;case"CreditLine":e.afterAmount!==0?(o=e.afterAmount,w.showCreditLineAfterAmount=!0):(o=w.lastOrdinaryAfterAmount,w.showCreditLineAfterAmount=!1);break;default:o=e.afterAmount}return o===null?s:o},we=()=>{switch(F){case"totalCashAmount":let s=0;for(const e of["Real","Bonus"])for(const o of f[e])s+=Math.max(o.amount,0);a(3,f.Total[0].amount=s,f);break;case"totalRealAmount":if(!Q)return;let w=0;for(const e of f.Real)w+=e.amount;a(3,f.Total[0].amount=w,f)}},Re=s=>{const w=he(s.data);if(!w){ae();return}if(w.type!=="BALANCE_UPDATE_V2")return;const e=w.body.balanceChange;for(const[o,l]of Object.entries(e))if(F==="totalRealAmount"&&o==="Real"&&!Q&&a(3,f.Total[0].amount=fe(f.Total[0].amount,se,l),f),!!f[o])for(const r of f[o]){if(!Q){r.amount=o==="Real"?fe(r.amount,se,l):l.afterAmount;continue}l.productType===r.productType&&(r.amount=o==="Real"?fe(r.amount,se[r.productType],l):l.afterAmount)}we()},_e=()=>{a(2,L=!1),window.postMessage({type:"GoToDeposit"},window.location.href),typeof gtag=="function"&&gtag("event","GoToDeposit",{context:"PlayerAccountBalanceModal"})},Ee=()=>{ce.includes(F)||(console.error(`Unsupported value ('${F}') for totalcalculationmode parameter. Only the following values are supported ${ce}. Using default value ('${ce[0]}').`),a(7,F=ce[0]))},De=()=>{switch(rt(h),Ee(),D){case"gmcore":J();break;case"gm16":de();break;default:throw Error(`Invalid apiversion attribute: ${D}`)}},me=s=>s.data&&s.data.type==="LogoutSuccessfull"&&te.close();t.onMount(()=>(window.addEventListener("message",me,!1),()=>{window.removeEventListener("message",me),te&&te.close()}));const Be=()=>a(2,L=!0),ue=()=>a(2,L=!1),G=()=>_e(),Le=()=>a(2,L=!1);function Me(s){t.binding_callbacks[s?"unshift":"push"](()=>{T=s,a(0,T)})}return c.$$set=s=>{"userid"in s&&a(8,p=s.userid),"session"in s&&a(9,d=s.session),"endpoint"in s&&a(10,g=s.endpoint),"lang"in s&&a(11,h=s.lang),"mbsource"in s&&a(12,v=s.mbsource),"clientstyling"in s&&a(13,C=s.clientstyling),"clientstylingurl"in s&&a(14,_=s.clientstylingurl),"translationurl"in s&&a(15,A=s.translationurl),"gmversion"in s&&a(16,D=s.gmversion),"displaybalanceoption"in s&&a(17,R=s.displaybalanceoption),"totalcalculationmode"in s&&a(7,F=s.totalcalculationmode),"currencylocale"in s&&a(18,W=s.currencylocale),"currencydisplay"in s&&a(19,ee=s.currencydisplay),"maximumfractiondigits"in s&&a(20,Y=s.maximumfractiondigits),"minimumfractiondigits"in s&&a(21,P=s.minimumfractiondigits),"customdisplayformat"in s&&a(22,x=s.customdisplayformat)},c.$$.update=()=>{c.$$.dirty[0]&200448&&g&&p&&d&&h&&D&&R&&De(),c.$$.dirty[0]&67328&&g&&p&&d&&D&&ae(),c.$$.dirty[0]&8193&&C&&T&&t.setClientStyling(T,C),c.$$.dirty[0]&16385&&_&&T&&t.setClientStylingURL(T,_),c.$$.dirty[0]&4097&&T&&t.setStreamStyling(T,`${v}.Style`),c.$$.dirty[0]&32768&&A&&ve()},[T,j,L,f,m,Ce,_e,F,p,d,g,h,v,C,_,A,D,R,W,ee,Y,P,x,Be,ue,G,Le,Me]}class Ze extends t.SvelteComponent{constructor(n){super(),t.init(this,n,ut,dt,t.safe_not_equal,{userid:8,session:9,endpoint:10,lang:11,mbsource:12,clientstyling:13,clientstylingurl:14,translationurl:15,gmversion:16,displaybalanceoption:17,totalcalculationmode:7,currencylocale:18,currencydisplay:19,maximumfractiondigits:20,minimumfractiondigits:21,customdisplayformat:22},lt,[-1,-1])}get userid(){return this.$$.ctx[8]}set userid(n){this.$$set({userid:n}),t.flush()}get session(){return this.$$.ctx[9]}set session(n){this.$$set({session:n}),t.flush()}get endpoint(){return this.$$.ctx[10]}set endpoint(n){this.$$set({endpoint:n}),t.flush()}get lang(){return this.$$.ctx[11]}set lang(n){this.$$set({lang:n}),t.flush()}get mbsource(){return this.$$.ctx[12]}set mbsource(n){this.$$set({mbsource:n}),t.flush()}get clientstyling(){return this.$$.ctx[13]}set clientstyling(n){this.$$set({clientstyling:n}),t.flush()}get clientstylingurl(){return this.$$.ctx[14]}set clientstylingurl(n){this.$$set({clientstylingurl:n}),t.flush()}get translationurl(){return this.$$.ctx[15]}set translationurl(n){this.$$set({translationurl:n}),t.flush()}get gmversion(){return this.$$.ctx[16]}set gmversion(n){this.$$set({gmversion:n}),t.flush()}get displaybalanceoption(){return this.$$.ctx[17]}set displaybalanceoption(n){this.$$set({displaybalanceoption:n}),t.flush()}get totalcalculationmode(){return this.$$.ctx[7]}set totalcalculationmode(n){this.$$set({totalcalculationmode:n}),t.flush()}get currencylocale(){return this.$$.ctx[18]}set currencylocale(n){this.$$set({currencylocale:n}),t.flush()}get currencydisplay(){return this.$$.ctx[19]}set currencydisplay(n){this.$$set({currencydisplay:n}),t.flush()}get maximumfractiondigits(){return this.$$.ctx[20]}set maximumfractiondigits(n){this.$$set({maximumfractiondigits:n}),t.flush()}get minimumfractiondigits(){return this.$$.ctx[21]}set minimumfractiondigits(n){this.$$set({minimumfractiondigits:n}),t.flush()}get customdisplayformat(){return this.$$.ctx[22]}set customdisplayformat(n){this.$$set({customdisplayformat:n}),t.flush()}}t.create_custom_element(Ze,{userid:{},session:{},endpoint:{},lang:{},mbsource:{},clientstyling:{},clientstylingurl:{},translationurl:{},gmversion:{},displaybalanceoption:{},totalcalculationmode:{},currencylocale:{},currencydisplay:{},maximumfractiondigits:{},minimumfractiondigits:{},customdisplayformat:{}},[],[],!0);exports.default=Ze;