var Ae = Object.defineProperty, De = Object.defineProperties;
var Re = Object.getOwnPropertyDescriptors;
var he = Object.getOwnPropertySymbols;
var Ue = Object.prototype.hasOwnProperty, je = Object.prototype.propertyIsEnumerable;
var pe = (s, e, i) => e in s ? Ae(s, e, { enumerable: !0, configurable: !0, writable: !0, value: i }) : s[e] = i, ae = (s, e) => {
  for (var i in e || (e = {}))
    Ue.call(e, i) && pe(s, i, e[i]);
  if (he)
    for (var i of he(e))
      je.call(e, i) && pe(s, i, e[i]);
  return s;
}, fe = (s, e) => De(s, Re(e));
var G = (s, e, i) => new Promise((l, t) => {
  var r = (p) => {
    try {
      a(i.next(p));
    } catch (f) {
      t(f);
    }
  }, o = (p) => {
    try {
      a(i.throw(p));
    } catch (f) {
      t(f);
    }
  }, a = (p) => p.done ? l(p.value) : Promise.resolve(p.value).then(r, o);
  a((i = i.apply(s, e)).next());
});
import { a as Ze, $ as Ie, S as Ee, i as Ne, s as Ge, f as $, b as Ye, n as te, d as H, r as We, c as M, z as se, g as B, h as n, l as J, j as d, k as v, t as T, e as c, m as qe, p as Ve, o as Je, u as Ke, A as K, B as le, C as ne, D as _e, w as ie, x as Xe, y as Qe } from "./CasinoCoinroyaleContainer-8oDWnwX4.js";
import "../stencil/ui-skeleton-xXZA3rYO.js";
import { f as $e } from "./CasinoCoinroyaleList-C3iX4SIK.js";
const ge = (s) => window.postMessage(s, window.location.href), et = "data:image/svg+xml,%3csvg%20width='32'%20height='32'%20viewBox='0%200%2032%2032'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M12.1978%2013.2348C12.1978%209.60751%2015.1383%206.66699%2018.7656%206.66699C22.3929%206.66699%2025.3334%209.60751%2025.3334%2013.2348C25.3334%2016.8621%2022.3929%2019.8026%2018.7656%2019.8026C18.467%2019.8026%2018.1725%2019.7826%2017.8835%2019.7438C17.6825%2019.7168%2017.557%2019.7001%2017.4658%2019.6909C17.4218%2019.7326%2017.3626%2019.7916%2017.2673%2019.8869L12.5565%2024.5977C12.5457%2024.6085%2012.5344%2024.6198%2012.5229%2024.6315C12.4009%2024.7542%2012.2356%2024.9205%2012.0329%2025.0448C11.8576%2025.1522%2011.6665%2025.2313%2011.4666%2025.2793C11.2354%2025.3348%2011.001%2025.3341%2010.8279%2025.3335C10.8115%2025.3335%2010.7956%2025.3334%2010.7803%2025.3334L9.14719%2025.3334C8.91663%2025.3335%208.68571%2025.3335%208.48899%2025.3174C8.27114%2025.2996%208.00565%2025.2571%207.7365%2025.1199C7.36793%2024.9321%207.06826%2024.6325%206.88046%2024.2639C6.74332%2023.9948%206.70076%2023.7293%206.68297%2023.5114C6.66689%2023.3147%206.66693%2023.0838%206.66696%2022.8532L6.66696%2021.2201C6.66696%2021.2049%206.66691%2021.189%206.66686%2021.1725C6.66631%2020.9994%206.66557%2020.765%206.72109%2020.5338C6.76907%2020.3339%206.84822%2020.1428%206.95562%2019.9676C7.07986%2019.7648%207.24617%2019.5995%207.36894%2019.4776C7.3806%2019.466%207.39188%2019.4548%207.40268%2019.4439L12.1135%2014.7331C12.2088%2014.6378%2012.2678%2014.5786%2012.3095%2014.5346C12.3003%2014.4434%2012.2836%2014.3179%2012.2566%2014.1169C12.2178%2013.8279%2012.1978%2013.5334%2012.1978%2013.2348ZM18.7656%208.74104C16.2837%208.74104%2014.2718%2010.753%2014.2718%2013.2348C14.2718%2013.4408%2014.2856%2013.6429%2014.3122%2013.8406L14.3146%2013.8585C14.3394%2014.0432%2014.3618%2014.2097%2014.3749%2014.3451C14.3874%2014.4747%2014.4011%2014.6598%2014.3736%2014.8525C14.3367%2015.1105%2014.2715%2015.3033%2014.1443%2015.5308C14.0078%2015.7751%2013.7931%2015.9881%2013.629%2016.151C13.6121%2016.1678%2013.5958%2016.184%2013.5801%2016.1997L8.86926%2020.9105C8.82845%2020.9513%208.79718%2020.9826%208.77036%2021.0099C8.75929%2021.0212%208.74992%2021.0308%208.74194%2021.0392C8.7417%2021.0507%208.74151%2021.0641%208.74137%2021.0799C8.74102%2021.1182%208.74101%2021.1624%208.74101%2021.2201V22.8215C8.74101%2023.0268%208.74146%2023.1591%208.74514%2023.2553C8.84132%2023.2589%208.97362%2023.2594%209.17887%2023.2594H10.7803C10.838%2023.2594%2010.8822%2023.2594%2010.9205%2023.259C10.9363%2023.2589%2010.9497%2023.2587%2010.9613%2023.2585C10.9696%2023.2505%2010.9792%2023.2411%2010.9905%2023.2301C11.0178%2023.2032%2011.0491%2023.172%2011.0899%2023.1312L15.8007%2018.4203C15.8164%2018.4046%2015.8327%2018.3883%2015.8494%2018.3714C16.0123%2018.2073%2016.2253%2017.9926%2016.4696%2017.8561C16.6971%2017.7289%2016.8899%2017.6638%2017.1479%2017.6268C17.3406%2017.5993%2017.5257%2017.613%2017.6553%2017.6255C17.7907%2017.6386%2017.9572%2017.661%2018.1419%2017.6858L18.1598%2017.6882C18.3575%2017.7148%2018.5597%2017.7286%2018.7656%2017.7286C21.2474%2017.7286%2023.2594%2015.7167%2023.2594%2013.2348C23.2594%2010.753%2021.2474%208.74104%2018.7656%208.74104ZM17.7286%2013.2348C17.7286%2012.6621%2018.1929%2012.1978%2018.7656%2012.1978H18.7748C19.3475%2012.1978%2019.8118%2012.6621%2019.8118%2013.2348C19.8118%2013.8076%2019.3475%2014.2718%2018.7748%2014.2718H18.7656C18.1929%2014.2718%2017.7286%2013.8076%2017.7286%2013.2348Z'%20fill='url(%23paint0_linear_714_605)'/%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_714_605'%20x1='6.66675'%20y1='16.0003'%20x2='25.3334'%20y2='16.0003'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%2375FFE9'/%3e%3cstop%20offset='1'%20stop-color='%23B2FF6D'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e", be = "data:image/svg+xml,%3csvg%20width='18'%20height='18'%20viewBox='0%200%2018%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M3.96967%203.96967C4.26256%203.67678%204.73744%203.67678%205.03033%203.96967L9%207.93934L12.9697%203.96967C13.2626%203.67678%2013.7374%203.67678%2014.0303%203.96967C14.3232%204.26256%2014.3232%204.73744%2014.0303%205.03033L10.0607%209L14.0303%2012.9697C14.3232%2013.2626%2014.3232%2013.7374%2014.0303%2014.0303C13.7374%2014.3232%2013.2626%2014.3232%2012.9697%2014.0303L9%2010.0607L5.03033%2014.0303C4.73744%2014.3232%204.26256%2014.3232%203.96967%2014.0303C3.67678%2013.7374%203.67678%2013.2626%203.96967%2012.9697L7.93934%209L3.96967%205.03033C3.67678%204.73744%203.67678%204.26256%203.96967%203.96967Z'%20fill='%23FF9B59'/%3e%3c/svg%3e", we = "data:image/svg+xml,%3csvg%20width='18'%20height='18'%20viewBox='0%200%2018%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M15.1724%204.72381C15.4708%205.02223%2015.4708%205.50607%2015.1724%205.80449L7.70071%2013.2762C7.40229%2013.5746%206.91846%2013.5746%206.62004%2013.2762L3.22381%209.87996C2.9254%209.58154%202.9254%209.09771%203.22381%208.79929C3.52223%208.50087%204.00607%208.50087%204.30449%208.79929L7.16038%2011.6552L14.0917%204.72381C14.3902%204.4254%2014.874%204.4254%2015.1724%204.72381Z'%20fill='%2358DB4A'/%3e%3c/svg%3e", tt = "data:image/svg+xml,%3csvg%20width='14'%20height='14'%20viewBox='0%200%2014%2014'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M10.9124%204.83736C11.1402%205.06516%2011.1402%205.43451%2010.9124%205.66232L7.41243%209.16232C7.18462%209.39012%206.81528%209.39012%206.58747%209.16232L3.08747%205.66232C2.85966%205.43451%202.85966%205.06516%203.08747%204.83736C3.31528%204.60955%203.68462%204.60955%203.91243%204.83736L6.99995%207.92488L10.0875%204.83736C10.3153%204.60955%2010.6846%204.60955%2010.9124%204.83736Z'%20fill='url(%23paint0_linear_738_1669)'/%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_738_1669'%20x1='6.99995'%20y1='4.6665'%20x2='6.99995'%20y2='9.33317'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%2375FFE9'/%3e%3cstop%20offset='1'%20stop-color='%23B2FF6D'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e";
var re = /* @__PURE__ */ ((s) => (s.lotteries = "lotteries", s.outcome = "outcome", s.draw = "draw", s))(re || {}), ee = /* @__PURE__ */ ((s) => (s.en = "en", s.default = "*", s))(ee || {});
const st = (s) => G(void 0, null, function* () {
  const { path: e, params: i = {}, options: l = {} } = s, t = new URL(e);
  return Object.keys(i).map((r) => {
    t.searchParams.append(r, i[r]);
  }), yield it(t, l);
}), it = (i, ...l) => G(void 0, [i, ...l], function* (s, e = {}) {
  let t;
  try {
    t = yield fetch(s, e), t = yield t.text(), t = JSON.parse(t);
  } catch (r) {
    throw new Error(r.message);
  }
  return t;
}), ve = (s, e, i) => G(void 0, null, function* () {
  const { session: l } = i, t = {
    headers: ae({
      "Content-Type": "application/json",
      accept: "text/plain"
    }, l ? { "x-SessionId": l } : {})
  }, o = {
    [re.lotteries]: () => ({
      path: "/wof/lotteries",
      params: {
        filter: "Types[]=mysteryChest"
      },
      options: t
    }),
    [re.outcome]: () => {
      const { id: a } = i;
      return {
        path: `/wof/outcome/${a}`,
        params: {
          filter: "Types[]=mysteryChest"
        },
        options: t
      };
    }
  }[s]();
  return o.path = e + "/v1" + o.path, yield st(o);
}), ye = {
  lotteries: (s, e) => G(void 0, null, function* () {
    const i = yield ve(re.lotteries, s, { session: e });
    return (i == null ? void 0 : i.items) || [];
  }),
  outcome: (s, e, i) => G(void 0, null, function* () {
    return yield ve(re.outcome, s, { session: e, id: i });
  })
}, lt = (s) => {
  var e;
  return +((e = s == null ? void 0 : s.current) == null ? void 0 : e.remainingTimes) > 0;
};
function xe(s, e) {
  Ze(s, e);
}
function ot(s) {
  Ie.set(s);
}
const ke = {
  en: {
    infoTooltip: "Open Mystery Chest and find your reward!",
    play: "Play",
    history: "History",
    rules: "Rules",
    noChestYet: "There are no available Chests",
    noHistoryYet: "There is no history yet",
    more: "More",
    rulesDescription: "Mystery Chest is a particularly interesting game, will bring you a lot of surprises; When you obtained the Mystery Chest, means you got a key to open the Chest, and if you are lucky, you can get the surprise prize.",
    terms: "Terms&Conditions link",
    prizeAgenda: "Prize agenda",
    tournamentTicket: "Tournament ticket",
    freeSpins: "Free spins",
    bonusMoney: "Bonus Money",
    loyaltyPoints: "Loyalty Points&Coins",
    luckyWheel: "LuckyWheel",
    mysteryChest: "Mystery Chest",
    customRewards: "Custom Rewards"
  }
};
function rt(s) {
  Ye(s, "svelte-1io3gkk", `.mobile.drawer{width:100%;height:100%;border-top-left-radius:28px;border-top-right-radius:28px;padding:20px 28px}.mobile.drawer .Skeleton.Text{width:var(--emw-skeleton-text-width-100, 135px)}.mobile .tooltip-backdrop{padding:60px 20px 0;border-top-left-radius:28px;border-top-right-radius:28px}.mobile .tooltip-backdrop .tooltip{padding:20px;font-size:var(--emw--font-size-x-small, 12px)}.mobile .icon-button{width:24px;height:24px}.mobile .chests-header__title{font-size:var(--emw--font-size-medium, 16px);font-weight:var(--emw--font-weight-medium, 500);line-height:14px}.mobile .chests-tabs{margin:20px 0}.mobile .chests-tabs__container{border-bottom:1px solid var(--emw--color-secondary, #729787)}.mobile .chests-tabs__tab{font-size:var(--emw--font-size-x-small, 12px);line-height:15px}.mobile .chests-tabs__tab.active{border-bottom:1px solid}.mobile .chests-list{gap:16px}.mobile .chests-list__item{font-weight:var(--emw--font-weight-normal, 400);padding:20px;font-size:var(--emw--font-size-x-small, 12px);line-height:15px;border-radius:16px;height:56px}.mobile .chests-list__item__keys{gap:5px;font-size:var(--emw--font-size-medium, 16px)}.mobile .chests-rules{gap:24px}.mobile .chests-rules__description{font-size:var(--emw--font-size-x-small, 12px);line-height:24px}.mobile .chests-rules__terms{font-weight:var(--emw--font-weight-normal, 400);font-size:var(--emw--font-size-x-small, 12px)}.mobile .chests-rules__prize-title{font-size:var(--emw--font-size-x-small, 12px);line-height:24px}.mobile .chests-rules__list{padding-inline-start:15px;margin:5px 0 0}.mobile .chests-rules__list__item{margin-bottom:5px;font-size:var(--emw--font-size-x-small, 12px);line-height:24px}.mobile .chests-empty{margin-top:50px;font-size:var(--emw--font-size-x-small, 12px)}.mobile .chests-history__title{font-size:var(--emw--font-size-x-small, 12px);line-height:14px;margin-bottom:12px}.mobile .chests-history__list{margin-bottom:32px}.mobile .chests-history__list__item{font-weight:var(--emw--font-weight-normal, 400);font-size:var(--emw--font-size-x-small, 12px);line-height:14px;margin-bottom:12px}.mobile .chests-history__list__item .name img{width:14px;height:14px}.mobile .chests-loader{border-radius:var(--emw--border-radius-large, 16px);padding:20px;line-height:15px}.drawer{position:fixed;left:50%;transform:translateX(-50%);background:linear-gradient(180deg, var(--emw--color-background, #213841) 0%, var(--emw--color-background-secondary, #0c1a1c) 100%);box-sizing:border-box;z-index:100;bottom:0;width:60%;height:90%;border-top-left-radius:72px;border-top-right-radius:72px;padding:40px 80px}@container (max-width: 1300px){.drawer{padding:20px 40px}}@container (max-width: 992px){.drawer{width:70%}}@container (max-width: 768px){.drawer{width:80%}}@container (max-width: 576px){.drawer{width:90%}}.drawer .Skeleton{border-radius:var(--emw--border-radius-small, 12px);--emw-skeleton-primary-color:var(--emw--color-primary, #d9d9d9);--emw-skeleton-secondary-color:var(--emw--color-secondary, #999999)}.drawer .Skeleton.Text{width:var(--emw-skeleton-text-width-100, 155px)}.overlay{border:none;position:fixed;top:0;left:0;width:100%;height:100%;background-color:var(--emw--color-gray-transparency-20, rgba(21, 43, 48, 0.5019607843));z-index:0;bottom:0;opacity:1;transition:opacity 0.5s ease-in-out}.icon-button{width:30px;height:30px;border:0px;cursor:pointer}.icon-button.help{background:center/100% url('data:image/svg+xml,<svg width="24" height="24" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M11.708 4.583a7.125 7.125 0 1 0 0 14.25 7.125 7.125 0 0 0 0-14.25ZM3 11.708a8.708 8.708 0 1 1 17.417 0 8.708 8.708 0 0 1-17.417 0Zm8.913-3.147a1.583 1.583 0 0 0-1.762 1.035.792.792 0 0 1-1.493-.525 3.167 3.167 0 0 1 6.154 1.055c0 1.211-.899 2.011-1.54 2.439a6.37 6.37 0 0 1-1.335.672l-.028.01-.008.002-.003.001h-.002l-.251-.75.25.751a.792.792 0 0 1-.5-1.502l.011-.004.06-.022a4.778 4.778 0 0 0 .928-.476c.545-.363.834-.75.834-1.122v-.001a1.583 1.583 0 0 0-1.315-1.563Zm-.996 7.106c0-.438.354-.792.791-.792h.008a.792.792 0 1 1 0 1.583h-.008a.792.792 0 0 1-.791-.791Z" fill="%23729787"/></svg>') no-repeat}.icon-button.close{background:center/100% url('data:image/svg+xml,<svg width="24" height="24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M18 6 6 18M6 6l12 12" stroke="%23729787" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>') no-repeat}.tooltip-backdrop{box-sizing:border-box;z-index:200;position:absolute;width:100%;height:100%;inset:0;background-color:rgba(0, 0, 0, 0.5);padding:90px 30px 0;border-top-left-radius:72px;border-top-right-radius:72px}.tooltip-backdrop .tooltip{border:1px solid var(--emw--button-border-color, #75ffe9);background:var(--emw--color-background, #213841);border-radius:var(--emw--border-radius-large, 8px);line-height:24px;color:var(--emw--color-secondary, #bbb9c3);position:relative;padding:32px;font-size:var(--emw--font-size-medium, 16px)}.tooltip-backdrop .tooltip .icon-button{top:12px;right:12px;position:absolute}.chests-header{display:flex;justify-content:space-between;align-items:center;padding:12px 8px 8px}.chests-header__title{color:var(--emw--color-primary, #d3ffed);font-size:var(--emw--font-size-large, 22px);font-weight:var(--emw--font-weight-bold, 700);line-height:25px}.chests-tabs{margin:28px 0}.chests-tabs__container{display:flex;position:relative;border-bottom:2px solid var(--emw--color-secondary, #729787)}.chests-tabs__tab{padding:8px 10px;font-weight:var(--emw--font-weight-bold, 700);color:var(--emw--color-gray-300, #729787);cursor:pointer;flex-grow:1;text-align:center;background:transparent;border:none;font-size:var(--emw--font-size-medium, 16px);line-height:18px}.chests-tabs__tab.active{color:var(--emw--color-typography, #fff);border-image-source:linear-gradient(90deg, var(--emw--button-border-color, #75ffe9) 0%, var(--emw--button-border-color-secondary, #b2ff6d) 100%);border-image-slice:1;margin-bottom:-2px;border-bottom:2px solid}@media screen and (max-width: 1300px){.chests-tabs{margin:15px 0 28px}}.chests-list{max-height:85%;overflow:auto;gap:24px;display:flex;flex-wrap:wrap}.chests-list__item{font-weight:var(--emw--font-weight-bold, 700);font-size:var(--emw--font-size-large, 22px);line-height:25px;padding:35px 48px;border-radius:28px;color:var(--emw--color-primary, #d3ffed);width:100%;display:flex;justify-content:space-between;align-items:center;box-sizing:border-box;background:var(--emw--color-background-secondary, #233e42);border:1px solid var(--emw--button-border-color-secondary, #244346);cursor:pointer}.chests-list__item__keys{display:flex;align-items:center;font-weight:var(--emw--font-weight-bold, 700);background:linear-gradient(90deg, var(--emw--button-border-color, #75ffe9) 0%, var(--emw--button-border-color-secondary, #b2ff6d) 100%);-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent;font-size:var(--emw--font-size-large, 22px);gap:7px}@media screen and (max-width: 992px){.chests-list__item{font-size:var(--emw--font-size-medium, 16px);padding:20px 24px}.chests-list__item__keys{font-size:var(--emw--font-size-medium, 16px)}}@media screen and (max-width: 1300px){.chests-list{gap:20px}.chests-list__item{padding:25px 24px}}.chests-rules{display:flex;flex-flow:column;gap:40px;color:var(--emw--color-primary-variant, #a9ccbe)}.chests-rules__description{font-weight:var(--emw--font-weight-normal, 400);font-size:var(--emw--font-size-medium, 16px);line-height:32px}.chests-rules__terms{display:flex;gap:5px;font-weight:var(--emw--font-weight-semibold, 500);font-size:var(--emw--font-size-medium, 16px);border:none;padding:0;cursor:pointer;background:linear-gradient(90deg, var(--emw--button-border-color, #75ffe9) 0%, var(--emw--button-border-color-secondary, #b2ff6d) 100%);-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent}.chests-rules__terms .arrow-icon{width:14px;height:14px;background:center/100% url('data:image/svg+xml,<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M4.41 7.744a.833.833 0 0 0 0 1.179l5 5a.833.833 0 0 0 1.18 0l5-5a.833.833 0 1 0-1.18-1.179L10 12.154l-4.41-4.41a.833.833 0 0 0-1.18 0Z" fill="url(%23a)"/><defs><linearGradient id="a" x1="10" y1="7.5" x2="10" y2="14.167" gradientUnits="userSpaceOnUse"><stop stop-color="%2375FFE9"/><stop offset="1" stop-color="%23B2FF6D"/></linearGradient></defs></svg>') no-repeat}.chests-rules__prize-title{color:#ffffff;font-weight:var(--emw--font-weight-bold, 700);font-size:var(--emw--font-size-medium, 16px);line-height:18px}.chests-rules__list{padding-inline-start:25px;margin:15px 0 0}.chests-rules__list__item{font-weight:var(--emw--font-weight-normal, 400);margin-bottom:12px;font-size:var(--emw--font-size-medium, 16px);line-height:32px}.chests-empty{text-align:center;color:var(--emw--color-primary-variant, #a9ccbe);font-weight:var(--emw--font-weight-normal, 400);line-height:24px;margin-top:75px;font-size:var(--emw--font-size-medium, 16px)}.chests-history__title{font-weight:var(--emw--font-weight-bold, 700);color:#ffffff;font-size:var(--emw--font-size-medium, 16px);line-height:18px;margin-bottom:16px}.chests-history__more{border:none;display:flex;gap:4px;padding:0;background:linear-gradient(90deg, var(--emw--button-border-color, #75ffe9) 0%, var(--emw--button-border-color-secondary, #b2ff6d) 100%);-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent;cursor:pointer;font-weight:var(--emw--font-weight-medium, 500);font-size:var(--emw--font-size-medium, 16px);line-height:18px}.chests-history__list{margin-bottom:40px;overflow:auto}.chests-history__list__body{overflow:auto;max-height:200px;padding-right:10px}.chests-history__list__item{display:flex;color:var(--emw--color-primary-variant, #a9ccbe);font-weight:var(--emw--font-weight-normal, 400);font-size:var(--emw--font-size-medium, 16px);line-height:16px;margin-bottom:16px}.chests-history__list__item .index{margin-right:20px}.chests-history__list__item .name{flex-grow:1;margin:0;display:flex;gap:6px}.chests-history__list__item .name img{width:18px;height:18px}.chests-loader{border-radius:var(--emw--border-radius-large, 28px);display:flex;padding:45px 48px;background:var(--emw--color-background-secondary, #233e42);border:1px solid var(--emw--button-border-color-secondary, #244346);justify-content:space-between;line-height:35px;overflow:hidden;margin-bottom:24px}.chests-history-loader{display:flex;flex-direction:column;gap:16px;margin-bottom:32px}.chests-history-loader-body{display:flex;justify-content:space-between}.chests-history-loader-left{display:flex}.chests-history-dot .Skeleton{border-radius:var(--emw--border-radius-large, 50%);margin-right:10px}.chests-history-text .Skeleton{margin-right:20px}::-webkit-scrollbar{width:4px}::-webkit-scrollbar-track{background:transparent}::-webkit-scrollbar-thumb{background:var(--emw--color-gray-105, #1b2e31)}::-webkit-scrollbar-thumb:hover{background:var(--emw--color-gray-290, #284044)}`);
}
function Ce(s, e, i) {
  const l = s.slice();
  return l[43] = e[i], l;
}
function ze(s, e, i) {
  const l = s.slice();
  return l[46] = e[i], l[48] = i, l;
}
function Le(s, e, i) {
  const l = s.slice();
  return l[40] = e[i], l[42] = i, l;
}
function nt(s, e, i) {
  const l = s.slice();
  return l[33] = e[i], l;
}
function at(s, e, i) {
  const l = s.slice();
  return l[33] = e[i], l;
}
function ct(s, e, i) {
  const l = s.slice();
  return l[33] = e[i], l;
}
function Me(s) {
  let e, i, l, t, r, o = (
    /*$_*/
    s[10]("infoTooltip") + ""
  ), a, p, f;
  return {
    c() {
      e = d("div"), i = d("div"), l = d("button"), t = v(), r = d("span"), a = T(o), c(l, "class", "icon-button close"), c(i, "class", "tooltip"), c(e, "class", "tooltip-backdrop");
    },
    m(u, _) {
      B(u, e, _), n(e, i), n(i, l), n(i, t), n(i, r), n(r, a), p || (f = J(
        l,
        "click",
        /*showHideToolip*/
        s[13]
      ), p = !0);
    },
    p(u, _) {
      _[0] & /*$_*/
      1024 && o !== (o = /*$_*/
      u[10]("infoTooltip") + "") && M(a, o);
    },
    d(u) {
      u && H(e), p = !1, f();
    }
  };
}
function dt(s) {
  let e, i, l = (
    /*$_*/
    s[10]("rulesDescription") + ""
  ), t, r, o, a, p, f = (
    /*$_*/
    s[10]("prizeAgenda") + ""
  ), u, _, y, h, w = (
    /*$_*/
    s[10]("tournamentTicket") + ""
  ), g, x, b, L = (
    /*$_*/
    s[10]("freeSpins") + ""
  ), z, O, Z, Y = (
    /*$_*/
    s[10]("bonusMoney") + ""
  ), j, W, I, E = (
    /*$_*/
    s[10]("loyaltyPoints") + ""
  ), q, Q, F, V = (
    /*$_*/
    s[10]("luckyWheel") + ""
  ), N, R, k, A = (
    /*$_*/
    s[10]("mysteryChest") + ""
  ), oe, m, C, P = (
    /*$_*/
    s[10]("customRewards") + ""
  ), X, U = (
    /*hasUrl*/
    s[8] && Te(s)
  );
  return {
    c() {
      e = d("div"), i = d("span"), t = T(l), r = v(), U && U.c(), o = v(), a = d("section"), p = d("span"), u = T(f), _ = v(), y = d("ul"), h = d("li"), g = T(w), x = v(), b = d("li"), z = T(L), O = v(), Z = d("li"), j = T(Y), W = v(), I = d("li"), q = T(E), Q = v(), F = d("li"), N = T(V), R = v(), k = d("li"), oe = T(A), m = v(), C = d("li"), X = T(P), c(i, "class", "chests-rules__description"), c(p, "class", "chests-rules__prize-title"), c(h, "class", "chests-rules__list__item"), c(b, "class", "chests-rules__list__item"), c(Z, "class", "chests-rules__list__item"), c(I, "class", "chests-rules__list__item"), c(F, "class", "chests-rules__list__item"), c(k, "class", "chests-rules__list__item"), c(C, "class", "chests-rules__list__item"), c(y, "class", "chests-rules__list"), c(e, "class", "chests-rules");
    },
    m(S, D) {
      B(S, e, D), n(e, i), n(i, t), n(e, r), U && U.m(e, null), n(e, o), n(e, a), n(a, p), n(p, u), n(a, _), n(a, y), n(y, h), n(h, g), n(y, x), n(y, b), n(b, z), n(y, O), n(y, Z), n(Z, j), n(y, W), n(y, I), n(I, q), n(y, Q), n(y, F), n(F, N), n(y, R), n(y, k), n(k, oe), n(y, m), n(y, C), n(C, X);
    },
    p(S, D) {
      D[0] & /*$_*/
      1024 && l !== (l = /*$_*/
      S[10]("rulesDescription") + "") && M(t, l), /*hasUrl*/
      S[8] ? U ? U.p(S, D) : (U = Te(S), U.c(), U.m(e, o)) : U && (U.d(1), U = null), D[0] & /*$_*/
      1024 && f !== (f = /*$_*/
      S[10]("prizeAgenda") + "") && M(u, f), D[0] & /*$_*/
      1024 && w !== (w = /*$_*/
      S[10]("tournamentTicket") + "") && M(g, w), D[0] & /*$_*/
      1024 && L !== (L = /*$_*/
      S[10]("freeSpins") + "") && M(z, L), D[0] & /*$_*/
      1024 && Y !== (Y = /*$_*/
      S[10]("bonusMoney") + "") && M(j, Y), D[0] & /*$_*/
      1024 && E !== (E = /*$_*/
      S[10]("loyaltyPoints") + "") && M(q, E), D[0] & /*$_*/
      1024 && V !== (V = /*$_*/
      S[10]("luckyWheel") + "") && M(N, V), D[0] & /*$_*/
      1024 && A !== (A = /*$_*/
      S[10]("mysteryChest") + "") && M(oe, A), D[0] & /*$_*/
      1024 && P !== (P = /*$_*/
      S[10]("customRewards") + "") && M(X, P);
    },
    d(S) {
      S && H(e), U && U.d();
    }
  };
}
function mt(s) {
  let e;
  function i(r, o) {
    return (
      /*mysteryChestsHistory*/
      r[9].length > 0 ? _t : ft
    );
  }
  let l = i(s), t = l(s);
  return {
    c() {
      t.c(), e = ne();
    },
    m(r, o) {
      t.m(r, o), B(r, e, o);
    },
    p(r, o) {
      l === (l = i(r)) && t ? t.p(r, o) : (t.d(1), t = l(r), t && (t.c(), t.m(e.parentNode, e)));
    },
    d(r) {
      r && H(e), t.d(r);
    }
  };
}
function ut(s) {
  let e;
  function i(r, o) {
    return (
      /*mysteryChests*/
      r[6].length > 0 ? vt : wt
    );
  }
  let l = i(s), t = l(s);
  return {
    c() {
      t.c(), e = ne();
    },
    m(r, o) {
      t.m(r, o), B(r, e, o);
    },
    p(r, o) {
      l === (l = i(r)) && t ? t.p(r, o) : (t.d(1), t = l(r), t && (t.c(), t.m(e.parentNode, e)));
    },
    d(r) {
      r && H(e), t.d(r);
    }
  };
}
function ht(s) {
  let e, i = K([1, 2, 3]), l = [];
  for (let t = 0; t < 3; t += 1)
    l[t] = xt(nt(s, i, t));
  return {
    c() {
      for (let t = 0; t < 3; t += 1)
        l[t].c();
      e = ne();
    },
    m(t, r) {
      for (let o = 0; o < 3; o += 1)
        l[o] && l[o].m(t, r);
      B(t, e, r);
    },
    p: te,
    d(t) {
      t && H(e), le(l, t);
    }
  };
}
function pt(s) {
  let e, i = K([1, 2, 3, 4, 5, 6, 7]), l = [];
  for (let t = 0; t < 7; t += 1)
    l[t] = kt(ct(s, i, t));
  return {
    c() {
      for (let t = 0; t < 7; t += 1)
        l[t].c();
      e = ne();
    },
    m(t, r) {
      for (let o = 0; o < 7; o += 1)
        l[o] && l[o].m(t, r);
      B(t, e, r);
    },
    p: te,
    d(t) {
      t && H(e), le(l, t);
    }
  };
}
function Te(s) {
  let e, i, l = (
    /*$_*/
    s[10]("terms") + ""
  ), t, r, o;
  return {
    c() {
      e = d("a"), i = d("span"), t = T(l), r = v(), o = d("span"), c(o, "class", "arrow-icon"), c(e, "class", "chests-rules__terms"), c(
        e,
        "href",
        /*terms*/
        s[0]
      ), c(e, "target", "_blank");
    },
    m(a, p) {
      B(a, e, p), n(e, i), n(i, t), n(e, r), n(e, o);
    },
    p(a, p) {
      p[0] & /*$_*/
      1024 && l !== (l = /*$_*/
      a[10]("terms") + "") && M(t, l), p[0] & /*terms*/
      1 && c(
        e,
        "href",
        /*terms*/
        a[0]
      );
    },
    d(a) {
      a && H(e);
    }
  };
}
function ft(s) {
  let e, i = (
    /*$_*/
    s[10]("noHistoryYet") + ""
  ), l;
  return {
    c() {
      e = d("div"), l = T(i), c(e, "class", "chests-empty");
    },
    m(t, r) {
      B(t, e, r), n(e, l);
    },
    p(t, r) {
      r[0] & /*$_*/
      1024 && i !== (i = /*$_*/
      t[10]("noHistoryYet") + "") && M(l, i);
    },
    d(t) {
      t && H(e);
    }
  };
}
function _t(s) {
  let e, i = K(
    /*mysteryChestsHistory*/
    s[9]
  ), l = [];
  for (let t = 0; t < i.length; t += 1)
    l[t] = Se(Ce(s, i, t));
  return {
    c() {
      for (let t = 0; t < l.length; t += 1)
        l[t].c();
      e = ne();
    },
    m(t, r) {
      for (let o = 0; o < l.length; o += 1)
        l[o] && l[o].m(t, r);
      B(t, e, r);
    },
    p(t, r) {
      if (r[0] & /*showMore, mysteryChestsHistory, $_*/
      17920) {
        i = K(
          /*mysteryChestsHistory*/
          t[9]
        );
        let o;
        for (o = 0; o < i.length; o += 1) {
          const a = Ce(t, i, o);
          l[o] ? l[o].p(a, r) : (l[o] = Se(a), l[o].c(), l[o].m(e.parentNode, e));
        }
        for (; o < l.length; o += 1)
          l[o].d(1);
        l.length = i.length;
      }
    },
    d(t) {
      t && H(e), le(l, t);
    }
  };
}
function gt(s) {
  let e, i;
  return {
    c() {
      e = d("img"), ie(e.src, i = /*outcome*/
      s[46].assets) || c(e, "src", i), c(e, "alt", "");
    },
    m(l, t) {
      B(l, e, t);
    },
    p(l, t) {
      t[0] & /*mysteryChestsHistory*/
      512 && !ie(e.src, i = /*outcome*/
      l[46].assets) && c(e, "src", i);
    },
    d(l) {
      l && H(e);
    }
  };
}
function bt(s) {
  let e = (
    /*outcome*/
    s[46].name + ""
  ), i;
  return {
    c() {
      i = T(e);
    },
    m(l, t) {
      B(l, i, t);
    },
    p(l, t) {
      t[0] & /*mysteryChestsHistory*/
      512 && e !== (e = /*outcome*/
      l[46].name + "") && M(i, e);
    },
    d(l) {
      l && H(i);
    }
  };
}
function Fe(s) {
  var x;
  let e, i, l, t, r, o, a, p, f, u = (
    /*outcome*/
    ((x = s[46]) == null ? void 0 : x.date) + ""
  ), _, y;
  function h(b, L) {
    var z;
    return (
      /*outcome*/
      (z = b[46]) != null && z.name ? bt : gt
    );
  }
  let w = h(s), g = w(s);
  return {
    c() {
      var b;
      e = d("div"), i = d("span"), i.textContent = `${/*index*/
      s[48] + 1}`, l = v(), t = d("p"), g.c(), r = v(), o = d("img"), p = v(), f = d("span"), _ = T(u), y = v(), c(i, "class", "index"), ie(o.src, a = /*outcome*/
      (b = s[46]) != null && b.state ? we : be) || c(o, "src", a), c(o, "alt", ""), c(t, "class", "name"), c(f, "class", "time"), c(e, "class", "chests-history__list__item");
    },
    m(b, L) {
      B(b, e, L), n(e, i), n(e, l), n(e, t), g.m(t, null), n(t, r), n(t, o), n(e, p), n(e, f), n(f, _), n(e, y);
    },
    p(b, L) {
      var z, O;
      w === (w = h(b)) && g ? g.p(b, L) : (g.d(1), g = w(b), g && (g.c(), g.m(t, r))), L[0] & /*mysteryChestsHistory*/
      512 && !ie(o.src, a = /*outcome*/
      (z = b[46]) != null && z.state ? we : be) && c(o, "src", a), L[0] & /*mysteryChestsHistory*/
      512 && u !== (u = /*outcome*/
      ((O = b[46]) == null ? void 0 : O.date) + "") && M(_, u);
    },
    d(b) {
      b && H(e), g.d();
    }
  };
}
function Pe(s) {
  let e, i = (
    /*$_*/
    s[10]("more") + ""
  ), l, t, r, o, a, p;
  function f() {
    return (
      /*click_handler_1*/
      s[23](
        /*history*/
        s[43]
      )
    );
  }
  return {
    c() {
      e = d("button"), l = T(i), t = v(), r = d("img"), ie(r.src, o = tt) || c(r, "src", o), c(r, "alt", "More"), c(e, "class", "chests-history__more");
    },
    m(u, _) {
      B(u, e, _), n(e, l), n(e, t), n(e, r), a || (p = J(e, "click", f), a = !0);
    },
    p(u, _) {
      s = u, _[0] & /*$_*/
      1024 && i !== (i = /*$_*/
      s[10]("more") + "") && M(l, i);
    },
    d(u) {
      u && H(e), a = !1, p();
    }
  };
}
function Se(s) {
  var y;
  let e, i, l = (
    /*history*/
    s[43].name + ""
  ), t, r, o, a, p, f = K(
    /*history*/
    s[43].outcomes.slice(
      0,
      /*history*/
      s[43].endPos
    )
  ), u = [];
  for (let h = 0; h < f.length; h += 1)
    u[h] = Fe(ze(s, f, h));
  let _ = (
    /*history*/
    ((y = s[43].outcomes) == null ? void 0 : y.length) > 3 && /*history*/
    s[43].endPos === 3 && Pe(s)
  );
  return {
    c() {
      e = d("div"), i = d("div"), t = T(l), r = v(), o = d("div");
      for (let h = 0; h < u.length; h += 1)
        u[h].c();
      a = v(), _ && _.c(), p = v(), c(i, "class", "chests-history__title"), c(o, "class", "chests-history__list__body"), c(e, "class", "chests-history__list");
    },
    m(h, w) {
      B(h, e, w), n(e, i), n(i, t), n(e, r), n(e, o);
      for (let g = 0; g < u.length; g += 1)
        u[g] && u[g].m(o, null);
      n(e, a), _ && _.m(e, null), n(e, p);
    },
    p(h, w) {
      var g;
      if (w[0] & /*mysteryChestsHistory*/
      512 && l !== (l = /*history*/
      h[43].name + "") && M(t, l), w[0] & /*mysteryChestsHistory*/
      512) {
        f = K(
          /*history*/
          h[43].outcomes.slice(
            0,
            /*history*/
            h[43].endPos
          )
        );
        let x;
        for (x = 0; x < f.length; x += 1) {
          const b = ze(h, f, x);
          u[x] ? u[x].p(b, w) : (u[x] = Fe(b), u[x].c(), u[x].m(o, null));
        }
        for (; x < u.length; x += 1)
          u[x].d(1);
        u.length = f.length;
      }
      /*history*/
      ((g = h[43].outcomes) == null ? void 0 : g.length) > 3 && /*history*/
      h[43].endPos === 3 ? _ ? _.p(h, w) : (_ = Pe(h), _.c(), _.m(e, p)) : _ && (_.d(1), _ = null);
    },
    d(h) {
      h && H(e), le(u, h), _ && _.d();
    }
  };
}
function wt(s) {
  let e, i = (
    /*$_*/
    s[10]("noChestYet") + ""
  ), l;
  return {
    c() {
      e = d("div"), l = T(i), c(e, "class", "chests-empty");
    },
    m(t, r) {
      B(t, e, r), n(e, l);
    },
    p(t, r) {
      r[0] & /*$_*/
      1024 && i !== (i = /*$_*/
      t[10]("noChestYet") + "") && M(l, i);
    },
    d(t) {
      t && H(e);
    }
  };
}
function vt(s) {
  let e, i = K(
    /*mysteryChests*/
    s[6]
  ), l = [];
  for (let t = 0; t < i.length; t += 1)
    l[t] = He(Le(s, i, t));
  return {
    c() {
      e = d("div");
      for (let t = 0; t < l.length; t += 1)
        l[t].c();
      c(e, "class", "chests-list");
    },
    m(t, r) {
      B(t, e, r);
      for (let o = 0; o < l.length; o += 1)
        l[o] && l[o].m(e, null);
    },
    p(t, r) {
      if (r[0] & /*openChestDetails, mysteryChests, lang*/
      65602) {
        i = K(
          /*mysteryChests*/
          t[6]
        );
        let o;
        for (o = 0; o < i.length; o += 1) {
          const a = Le(t, i, o);
          l[o] ? l[o].p(a, r) : (l[o] = He(a), l[o].c(), l[o].m(e, null));
        }
        for (; o < l.length; o += 1)
          l[o].d(1);
        l.length = i.length;
      }
    },
    d(t) {
      t && H(e), le(l, t);
    }
  };
}
function He(s) {
  var x, b;
  let e, i = (
    /*chest*/
    (s[40].program.name[
      /*lang*/
      s[1]
    ] || /*chest*/
    s[40].program.name[ee.default]) + ""
  ), l, t, r, o, a, p, f, u = (
    /*chest*/
    ((b = (x = s[40]) == null ? void 0 : x.current) == null ? void 0 : b.remainingTimes) + ""
  ), _, y, h, w;
  function g() {
    return (
      /*click_handler*/
      s[22](
        /*chest*/
        s[40]
      )
    );
  }
  return {
    c() {
      e = d("button"), l = T(i), t = v(), r = d("div"), o = d("img"), p = v(), f = d("span"), _ = T(u), y = v(), ie(o.src, a = et) || c(o, "src", a), c(o, "alt", "Key"), c(r, "class", "chests-list__item__keys"), c(e, "class", "chests-list__item");
    },
    m(L, z) {
      B(L, e, z), n(e, l), n(e, t), n(e, r), n(r, o), n(r, p), n(r, f), n(f, _), n(e, y), h || (w = J(e, "click", g), h = !0);
    },
    p(L, z) {
      var O, Z;
      s = L, z[0] & /*mysteryChests, lang*/
      66 && i !== (i = /*chest*/
      (s[40].program.name[
        /*lang*/
        s[1]
      ] || /*chest*/
      s[40].program.name[ee.default]) + "") && M(l, i), z[0] & /*mysteryChests*/
      64 && u !== (u = /*chest*/
      ((Z = (O = s[40]) == null ? void 0 : O.current) == null ? void 0 : Z.remainingTimes) + "") && M(_, u);
    },
    d(L) {
      L && H(e), h = !1, w();
    }
  };
}
function yt(s) {
  let e;
  return {
    c() {
      e = d("div"), e.innerHTML = '<div class="chests-history-loader-left"><ui-skeleton class="chests-history-dot" structure="rectangle" width="16px" height="16px"></ui-skeleton> <ui-skeleton class="chests-history-text" structure="text" height="16px"></ui-skeleton></div> <ui-skeleton structure="text" width="50px" height="16px"></ui-skeleton>', c(e, "class", "chests-history-loader-body");
    },
    m(i, l) {
      B(i, e, l);
    },
    p: te,
    d(i) {
      i && H(e);
    }
  };
}
function xt(s) {
  let e, i, l, t, r = K([1, 2, 3]), o = [];
  for (let a = 0; a < 3; a += 1)
    o[a] = yt(at(s, r, a));
  return {
    c() {
      e = d("div"), i = d("ui-skeleton"), l = v();
      for (let a = 0; a < 3; a += 1)
        o[a].c();
      t = v(), _e(i, "structure", "text"), _e(i, "height", "16px"), c(e, "class", "chests-history-loader");
    },
    m(a, p) {
      B(a, e, p), n(e, i), n(e, l);
      for (let f = 0; f < 3; f += 1)
        o[f] && o[f].m(e, null);
      n(e, t);
    },
    p: te,
    d(a) {
      a && H(e), le(o, a);
    }
  };
}
function kt(s) {
  let e;
  return {
    c() {
      e = d("div"), e.innerHTML = '<ui-skeleton structure="text" height="16px"></ui-skeleton> <ui-skeleton structure="rectangle" width="50px" height="16px"></ui-skeleton> ', c(e, "class", "chests-loader");
    },
    m(i, l) {
      B(i, e, l);
    },
    p: te,
    d(i) {
      i && H(e);
    }
  };
}
function Ct(s) {
  let e, i, l, t, r, o, a, p, f, u, _, y, h, w, g, x = (
    /*$_*/
    s[10]("play") + ""
  ), b, L, z, O = (
    /*$_*/
    s[10]("history") + ""
  ), Z, Y, j, W = (
    /*$_*/
    s[10]("rules") + ""
  ), I, E, q, Q, F = (
    /*tooltip*/
    s[7] && Me(s)
  );
  function V(k, A) {
    return (
      /*chestsLoading*/
      k[5] ? pt : (
        /*historyLoading*/
        k[4] ? ht : (
          /*activeTab*/
          k[3] === 1 ? ut : (
            /*activeTab*/
            k[3] === 2 ? mt : dt
          )
        )
      )
    );
  }
  let N = V(s), R = N(s);
  return {
    c() {
      e = d("div"), i = d("button"), l = v(), t = d("div"), F && F.c(), r = v(), o = d("div"), a = d("button"), p = v(), f = d("div"), f.textContent = "Mystery Chests", u = v(), _ = d("button"), y = v(), h = d("div"), w = d("div"), g = d("button"), b = T(x), L = v(), z = d("button"), Z = T(O), Y = v(), j = d("button"), I = T(W), E = v(), R.c(), c(i, "class", "overlay"), c(a, "class", "icon-button help"), c(f, "class", "chests-header__title"), c(_, "class", "icon-button close"), c(o, "class", "chests-header"), c(g, "data-index", "1"), c(g, "class", "chests-tabs__tab"), se(
        g,
        "active",
        /*activeTab*/
        s[3] === 1
      ), c(z, "data-index", "2"), c(z, "class", "chests-tabs__tab"), se(
        z,
        "active",
        /*activeTab*/
        s[3] === 2
      ), c(j, "data-index", "3"), c(j, "class", "chests-tabs__tab"), se(
        j,
        "active",
        /*activeTab*/
        s[3] === 3
      ), c(w, "class", "chests-tabs__container"), c(h, "class", "chests-tabs"), c(t, "class", "drawer " + /*mobileView*/
      (s[11] ? "mobile" : "")), c(e, "part", "CustomStylingContainer");
    },
    m(k, A) {
      B(k, e, A), n(e, i), n(e, l), n(e, t), F && F.m(t, null), n(t, r), n(t, o), n(o, a), n(o, p), n(o, f), n(o, u), n(o, _), n(t, y), n(t, h), n(h, w), n(w, g), n(g, b), n(w, L), n(w, z), n(z, Z), n(w, Y), n(w, j), n(j, I), n(t, E), R.m(t, null), s[24](e), q || (Q = [
        J(
          i,
          "click",
          /*onClose*/
          s[12]
        ),
        J(
          a,
          "click",
          /*showHideToolip*/
          s[13]
        ),
        J(
          _,
          "click",
          /*onClose*/
          s[12]
        ),
        J(
          g,
          "click",
          /*handleTabChange*/
          s[15]
        ),
        J(
          z,
          "click",
          /*handleTabChange*/
          s[15]
        ),
        J(
          j,
          "click",
          /*handleTabChange*/
          s[15]
        )
      ], q = !0);
    },
    p(k, A) {
      /*tooltip*/
      k[7] ? F ? F.p(k, A) : (F = Me(k), F.c(), F.m(t, r)) : F && (F.d(1), F = null), A[0] & /*$_*/
      1024 && x !== (x = /*$_*/
      k[10]("play") + "") && M(b, x), A[0] & /*activeTab*/
      8 && se(
        g,
        "active",
        /*activeTab*/
        k[3] === 1
      ), A[0] & /*$_*/
      1024 && O !== (O = /*$_*/
      k[10]("history") + "") && M(Z, O), A[0] & /*activeTab*/
      8 && se(
        z,
        "active",
        /*activeTab*/
        k[3] === 2
      ), A[0] & /*$_*/
      1024 && W !== (W = /*$_*/
      k[10]("rules") + "") && M(I, W), A[0] & /*activeTab*/
      8 && se(
        j,
        "active",
        /*activeTab*/
        k[3] === 3
      ), N === (N = V(k)) && R ? R.p(k, A) : (R.d(1), R = N(k), R && (R.c(), R.m(t, null)));
    },
    i: te,
    o: te,
    d(k) {
      k && H(e), F && F.d(), R.d(), s[24](null), q = !1, We(Q);
    }
  };
}
function zt(s, e, i) {
  let l;
  qe(s, Qe, (m) => i(10, l = m));
  let { terms: t = "" } = e, { lang: r = ee.en } = e, { endpoint: o = "" } = e, { session: a = "" } = e, { clientstyling: p = "" } = e, { clientstylingurl: f = "" } = e, { translationurl: u = "" } = e, _ = window.navigator.userAgent, y = Ve(_), h, w = 1, g = !1, x = !1, b = [], L = !1, z = !1, O;
  const Z = (m) => /(https?:\/\/[^\s]+)/g.test(m), Y = () => {
    ge({ type: "CloseMysteryChestDrawer" });
  }, j = () => {
    i(7, L = !L);
  }, W = () => G(this, null, function* () {
    i(4, g = !0);
    let m = b.map((C) => ({
      id: C.program.id,
      name: C.program.name[r] || C.program.name[ee.default],
      partitions: C.program.wheelOfFortune.partitions,
      endPos: 0,
      outcomes: []
    }));
    if (m.length > 0) {
      const C = m.map((P, X) => G(this, null, function* () {
        const S = (yield ye.outcome(o, a, P == null ? void 0 : P.id)).items || [];
        if (S.length === 0) {
          m[X] = null;
          return;
        }
        m[X] = fe(ae({}, P), {
          endPos: S.length > 3 ? 3 : S.length,
          outcomes: S.map((D) => {
            var me, ue;
            const ce = ((me = P.partitions[D.draw.result.wheelOfFortunePartitionIndex]) == null ? void 0 : me.name) || {}, de = ((ue = P.partitions[D.draw.result.wheelOfFortunePartitionIndex]) == null ? void 0 : ue.image1) || {}, Be = D.draw.state === "fulfilled", Oe = $e(new Date(D.draw.time), "LLL d, yyyy HH:mm:ss");
            return {
              name: ce[r] || ce[ee.default],
              state: Be,
              date: Oe,
              assets: de[r] || de[ee.default]
            };
          })
        });
      }));
      yield Promise.all(C);
    }
    i(9, O = m.filter((C) => !!C)), i(4, g = !1);
  }), I = () => G(this, null, function* () {
    i(5, x = !0);
    const m = yield ye.lotteries(o, a);
    i(6, b = m.filter((C) => lt(C))), i(5, x = !1);
  }), E = (m) => {
    var P;
    const C = O.findIndex((X) => X.id === m);
    i(9, O[C].endPos = (P = O[C].outcomes) == null ? void 0 : P.length, O);
  }, q = (m) => G(this, null, function* () {
    i(3, w = +m.target.getAttribute("data-index")), w === 2 && (yield W());
  }), Q = () => {
    let m = document.createElement("style");
    m.innerHTML = p, h.appendChild(m);
  }, F = () => {
    let m = new URL(f), C = document.createElement("style");
    fetch(m.href).then((P) => P.text()).then((P) => {
      C.innerHTML = P, setTimeout(
        () => {
          h.appendChild(C);
        },
        1
      );
    });
  }, V = () => {
    fetch(u).then((C) => C.json()).then((C) => {
      Object.keys(C).forEach((P) => {
        xe(P, C[P]);
      });
    });
  };
  Object.keys(ke).forEach((m) => {
    xe(m, ke[m]);
  });
  const N = () => {
    ot(r);
  }, R = (m) => {
    ge({
      type: "OpenMysteryChestDetails",
      data: m
    });
  };
  Je(() => {
    i(8, z = Z(t)), I();
  });
  const k = (m) => {
    R(m);
  }, A = (m) => E(m.id);
  function oe(m) {
    Ke[m ? "unshift" : "push"](() => {
      h = m, i(2, h);
    });
  }
  return s.$$set = (m) => {
    "terms" in m && i(0, t = m.terms), "lang" in m && i(1, r = m.lang), "endpoint" in m && i(17, o = m.endpoint), "session" in m && i(18, a = m.session), "clientstyling" in m && i(19, p = m.clientstyling), "clientstylingurl" in m && i(20, f = m.clientstylingurl), "translationurl" in m && i(21, u = m.translationurl);
  }, s.$$.update = () => {
    s.$$.dirty[0] & /*lang*/
    2 && r && N(), s.$$.dirty[0] & /*clientstyling, customStylingContainer*/
    524292 && p && h && Q(), s.$$.dirty[0] & /*clientstylingurl, customStylingContainer*/
    1048580 && f && h && F(), s.$$.dirty[0] & /*translationurl*/
    2097152 && u && V();
  }, [
    t,
    r,
    h,
    w,
    g,
    x,
    b,
    L,
    z,
    O,
    l,
    y,
    Y,
    j,
    E,
    q,
    R,
    o,
    a,
    p,
    f,
    u,
    k,
    A,
    oe
  ];
}
class Lt extends Ee {
  constructor(e) {
    super(), Ne(
      this,
      e,
      zt,
      Ct,
      Ge,
      {
        terms: 0,
        lang: 1,
        endpoint: 17,
        session: 18,
        clientstyling: 19,
        clientstylingurl: 20,
        translationurl: 21
      },
      rt,
      [-1, -1]
    );
  }
  get terms() {
    return this.$$.ctx[0];
  }
  set terms(e) {
    this.$$set({ terms: e }), $();
  }
  get lang() {
    return this.$$.ctx[1];
  }
  set lang(e) {
    this.$$set({ lang: e }), $();
  }
  get endpoint() {
    return this.$$.ctx[17];
  }
  set endpoint(e) {
    this.$$set({ endpoint: e }), $();
  }
  get session() {
    return this.$$.ctx[18];
  }
  set session(e) {
    this.$$set({ session: e }), $();
  }
  get clientstyling() {
    return this.$$.ctx[19];
  }
  set clientstyling(e) {
    this.$$set({ clientstyling: e }), $();
  }
  get clientstylingurl() {
    return this.$$.ctx[20];
  }
  set clientstylingurl(e) {
    this.$$set({ clientstylingurl: e }), $();
  }
  get translationurl() {
    return this.$$.ctx[21];
  }
  set translationurl(e) {
    this.$$set({ translationurl: e }), $();
  }
}
Xe(Lt, { terms: {}, lang: {}, endpoint: {}, session: {}, clientstyling: {}, clientstylingurl: {}, translationurl: {} }, [], [], !0);
export {
  Lt as default
};
