import { a as I, E as K, $ as V, x as G, S as J, i as P, s as Q, f as y, b as X, n as v, d as p, e as b, g as _, h as k, j as m, k as z, m as Y, o as Z, p as $, A as E, B as ee, u as te, c as ne, z as S, l as ie, t as se, D as c, y as le } from "./CasinoCoinroyaleContainer-Iy5XfJlk.js";
import { s as ae, a as oe, b as re } from "./CasinoCoinroyaleDetails-C4xHvlo0.js";
if (typeof window < "u") {
  let t = function(e) {
    return function(...n) {
      try {
        return e.apply(this, n);
      } catch (i) {
        if (i instanceof DOMException && i.message.includes("has already been used with this registry") || i.message.includes("Cannot define multiple custom elements with the same tag name"))
          return !1;
        throw i;
      }
    };
  };
  customElements.define = t(customElements.define), import("./CasinoMysteryChestContainer-CahzX-vH.js").then(({ default: e }) => {
    !customElements.get("casino-mystery-chest-container") && customElements.define("casino-mystery-chest-container", e.element);
  });
}
if (typeof window < "u") {
  let t = function(e) {
    return function(...n) {
      try {
        return e.apply(this, n);
      } catch (i) {
        if (i instanceof DOMException && i.message.includes("has already been used with this registry") || i.message.includes("Cannot define multiple custom elements with the same tag name"))
          return !1;
        throw i;
      }
    };
  };
  customElements.define = t(customElements.define), import("./CasinoCoinroyaleContainer-Iy5XfJlk.js").then((e) => e.K).then(({ default: e }) => {
    !customElements.get("casino-coinroyale-container") && customElements.define("casino-coinroyale-container", e.element);
  });
}
var f = /* @__PURE__ */ ((t) => (t.MysteryChest = "Mystery Chests", t.FlipCoin = "FlipCoin", t.LuckyWheel = "Lucky Wheel", t.Dices = "Dices", t))(f || {}), D = /* @__PURE__ */ ((t) => (t.Showed = "Showed", t.Hiden = "Hiden", t))(D || {});
const W = {
  en: {
    MysteryChest: "Mystery Chests",
    LuckyWheel: "Lucky Wheel",
    Dices: "Dices",
    FlipCoin: "Flip Coin"
  }
};
function A(t, e) {
  I(t, e);
}
function ce(t) {
  K({
    fallbackLocale: "en"
  }), V.set(t);
}
function de(t) {
  X(t, "svelte-dp9rm6", "*,*::before,*::after{margin:0;padding:0;list-style:none;text-decoration:none;outline:none;box-sizing:border-box;font-family:inherit}.container{padding:0 16.5%}.container.mobile{padding:0 28px}.container.mobile .header{padding:16px 0 13px}.container.mobile .header .slider__container{gap:16px;justify-content:space-between;padding:0 24px}.container.mobile .header .slider__container__tab{font-size:var(--emw--font-size-2x-small, 10px)}.header{background:linear-gradient(89.94deg, var(--emw--color-background, #003e5c) 0.05%, var(--emw--color-background-secondary, #113b21) 87.69%);padding:23px 0 17px;border-radius:12px}.header .slider__container{display:flex;position:relative;gap:60px;justify-content:center}.header .slider__tab{padding:8px 0 13px;font-weight:var(--emw--font-weight-bold, 700);color:var(--emw--color-gray-300, #729787);cursor:pointer;text-align:center;background:transparent;border:none;font-size:var(--emw--font-size-x-small, 12px);line-height:15px}.header .slider__tab.active{color:var(--emw--color-typography, #fff);border-bottom:2px solid var(--emw--button-border-color, #00b74f);margin-bottom:-2px}");
}
function F(t, e, n) {
  const i = t.slice();
  return i[20] = e[n], i;
}
function O(t) {
  let e, n, i, d = E(
    /*tabs*/
    t[4].split(",")
  ), l = [];
  for (let a = 0; a < d.length; a += 1)
    l[a] = j(F(t, d, a));
  return {
    c() {
      e = m("div"), n = m("div"), i = m("div");
      for (let a = 0; a < l.length; a += 1)
        l[a].c();
      b(i, "class", "slider__container"), b(n, "class", "slider"), b(e, "class", "header");
    },
    m(a, u) {
      _(a, e, u), k(e, n), k(n, i);
      for (let s = 0; s < l.length; s += 1)
        l[s] && l[s].m(i, null);
    },
    p(a, u) {
      if (u & /*tabs, activeTab, handleTabChange, $_*/
      2448) {
        d = E(
          /*tabs*/
          a[4].split(",")
        );
        let s;
        for (s = 0; s < d.length; s += 1) {
          const o = F(a, d, s);
          l[s] ? l[s].p(o, u) : (l[s] = j(o), l[s].c(), l[s].m(i, null));
        }
        for (; s < l.length; s += 1)
          l[s].d(1);
        l.length = d.length;
      }
    },
    d(a) {
      a && p(e), ee(l, a);
    }
  };
}
function j(t) {
  let e, n = (
    /*$_*/
    t[8](
      /*tab*/
      t[20]
    ) + ""
  ), i, d, l, a, u;
  return {
    c() {
      e = m("button"), i = se(n), d = z(), b(e, "data-index", l = f[
        /*tab*/
        t[20]
      ]), b(e, "class", "slider__tab"), S(
        e,
        "active",
        /*activeTab*/
        t[7] === f[
          /*tab*/
          t[20]
        ]
      );
    },
    m(s, o) {
      _(s, e, o), k(e, i), k(e, d), a || (u = ie(
        e,
        "click",
        /*handleTabChange*/
        t[11]
      ), a = !0);
    },
    p(s, o) {
      o & /*$_, tabs*/
      272 && n !== (n = /*$_*/
      s[8](
        /*tab*/
        s[20]
      ) + "") && ne(i, n), o & /*tabs*/
      16 && l !== (l = f[
        /*tab*/
        s[20]
      ]) && b(e, "data-index", l), o & /*activeTab, tabs*/
      144 && S(
        e,
        "active",
        /*activeTab*/
        s[7] === f[
          /*tab*/
          s[20]
        ]
      );
    },
    d(s) {
      s && p(e), a = !1, u();
    }
  };
}
function ue(t) {
  let e;
  return {
    c() {
      e = m("div"), e.textContent = "Comming soon";
    },
    m(n, i) {
      _(n, e, i);
    },
    p: v,
    d(n) {
      n && p(e);
    }
  };
}
function fe(t) {
  let e;
  return {
    c() {
      e = m("casino-coinroyale-container"), c(
        e,
        "endpoint",
        /*endpoint*/
        t[1]
      ), c(
        e,
        "session",
        /*session*/
        t[2]
      ), c(
        e,
        "lang",
        /*lang*/
        t[3]
      ), c(
        e,
        "clientstylingurl",
        /*clientstylingurl*/
        t[0]
      ), c(e, "gameoverlay", D.Hiden), c(e, "openedbydefauls", !0), c(
        e,
        "clientstyling",
        /*coinroyaleDrawerStyles*/
        t[10] + this.clientstyling
      );
    },
    m(n, i) {
      _(n, e, i);
    },
    p(n, i) {
      i & /*endpoint*/
      2 && c(
        e,
        "endpoint",
        /*endpoint*/
        n[1]
      ), i & /*session*/
      4 && c(
        e,
        "session",
        /*session*/
        n[2]
      ), i & /*lang*/
      8 && c(
        e,
        "lang",
        /*lang*/
        n[3]
      ), i & /*clientstylingurl*/
      1 && c(
        e,
        "clientstylingurl",
        /*clientstylingurl*/
        n[0]
      );
    },
    d(n) {
      n && p(e);
    }
  };
}
function he(t) {
  let e;
  return {
    c() {
      e = m("div"), e.textContent = "Comming soon";
    },
    m(n, i) {
      _(n, e, i);
    },
    p: v,
    d(n) {
      n && p(e);
    }
  };
}
function ge(t) {
  let e;
  return {
    c() {
      e = m("casino-mystery-chest-container"), c(
        e,
        "endpoint",
        /*endpoint*/
        t[1]
      ), c(
        e,
        "session",
        /*session*/
        t[2]
      ), c(
        e,
        "lang",
        /*lang*/
        t[3]
      ), c(
        e,
        "clientstylingurl",
        /*clientstylingurl*/
        t[0]
      ), c(e, "gameoverlay", D.Hiden), c(e, "openedbydefauls", !0), c(
        e,
        "clientstyling",
        /*mysteryChestDrawerStyles*/
        t[9] + this.clientstyling
      );
    },
    m(n, i) {
      _(n, e, i);
    },
    p(n, i) {
      i & /*endpoint*/
      2 && c(
        e,
        "endpoint",
        /*endpoint*/
        n[1]
      ), i & /*session*/
      4 && c(
        e,
        "session",
        /*session*/
        n[2]
      ), i & /*lang*/
      8 && c(
        e,
        "lang",
        /*lang*/
        n[3]
      ), i & /*clientstylingurl*/
      1 && c(
        e,
        "clientstylingurl",
        /*clientstylingurl*/
        n[0]
      );
    },
    d(n) {
      n && p(e);
    }
  };
}
function me(t) {
  let e, n = (
    /*tabs*/
    t[4].split(",").length >= 2
  ), i, d, l = n && O(t);
  function a(o, h) {
    if (
      /*activeTab*/
      o[7] === f.MysteryChest
    )
      return ge;
    if (
      /*activeTab*/
      o[7] === f.LuckyWheel
    )
      return he;
    if (
      /*activeTab*/
      o[7] === f.FlipCoin
    )
      return fe;
    if (
      /*activeTab*/
      o[7] === f.Dices
    )
      return ue;
  }
  let u = a(t), s = u && u(t);
  return {
    c() {
      e = m("div"), l && l.c(), i = z(), s && s.c(), b(e, "class", d = "container " + /*mobileView*/
      (t[6] ? "mobile" : ""));
    },
    m(o, h) {
      _(o, e, h), l && l.m(e, null), k(e, i), s && s.m(e, null), t[15](e);
    },
    p(o, [h]) {
      h & /*tabs*/
      16 && (n = /*tabs*/
      o[4].split(",").length >= 2), n ? l ? l.p(o, h) : (l = O(o), l.c(), l.m(e, i)) : l && (l.d(1), l = null), u === (u = a(o)) && s ? s.p(o, h) : (s && s.d(1), s = u && u(o), s && (s.c(), s.m(e, null))), h & /*mobileView*/
      64 && d !== (d = "container " + /*mobileView*/
      (o[6] ? "mobile" : "")) && b(e, "class", d);
    },
    i: v,
    o: v,
    d(o) {
      o && p(e), l && l.d(), s && s.d(), t[15](null);
    }
  };
}
function ye(t, e, n) {
  let i;
  Y(t, le, (r) => n(8, i = r));
  let { clientstyling: d = "" } = e, { clientstylingurl: l = "" } = e, { translationurl: a = "" } = e, { mbsource: u } = e, { endpoint: s = "" } = e, { session: o = "" } = e, { lang: h = "en" } = e, { tabs: M = "MysteryChest,FlipCoin,LuckyWheel,Dices" } = e, x = !0, H = window.navigator.userAgent, g, w = f[M.split(",")[0]];
  const N = ".overlay { display: none; } .drawer { position: unset; transform: none; background: transparent; width: initial; height: initial; padding: 0; border-radius: 0; } .chests-header,.close,.chest-header__title { display: none } .mobile.drawer { padding: 0 } .back { height: 40px; width: 40px;} .chest-header {padding: 20px 0 0}", R = ".overlay { display: none; } .drawer { position: unset; transform: none; background: transparent; width: initial; height: initial; padding: 0; border-radius: 0; } .coins-header,.close,.coin-header__title { display: none } .mobile.drawer { padding: 0 } .back { height: 40px; width: 40px;} .coin-header {padding: 20px 0 0}", T = async (r) => {
    n(7, w = r.target.getAttribute("data-index")), w === f.MysteryChest && window.postMessage({ type: "OpenMysteryChestDrawer" }), w === f.FlipCoin && window.postMessage({ type: "OpenCoinRoyaleDrawer" }), w === f.LuckyWheel && window.postMessage({ type: "OpenLuckyWheelDrawer" });
  }, U = () => {
    ce(h);
  }, q = () => {
    fetch(a).then((C) => C.json()).then((C) => {
      Object.keys(C).forEach((L) => {
        A(L, C[L]);
      });
    });
  };
  Object.keys(W).forEach((r) => {
    A(r, W[r]);
  }), Z(() => (n(6, x = $(H)), () => {
  }));
  function B(r) {
    te[r ? "unshift" : "push"](() => {
      g = r, n(5, g);
    });
  }
  return t.$$set = (r) => {
    "clientstyling" in r && n(12, d = r.clientstyling), "clientstylingurl" in r && n(0, l = r.clientstylingurl), "translationurl" in r && n(13, a = r.translationurl), "mbsource" in r && n(14, u = r.mbsource), "endpoint" in r && n(1, s = r.endpoint), "session" in r && n(2, o = r.session), "lang" in r && n(3, h = r.lang), "tabs" in r && n(4, M = r.tabs);
  }, t.$$.update = () => {
    t.$$.dirty & /*lang*/
    8 && h && U(), t.$$.dirty & /*translationurl*/
    8192 && a && q(), t.$$.dirty & /*clientstyling, customStylingContainer*/
    4128 && d && g && ae(g, d), t.$$.dirty & /*clientstylingurl, customStylingContainer*/
    33 && l && g && oe(g, l), t.$$.dirty & /*mbsource, customStylingContainer*/
    16416 && u && g && re(g, `${u}.Style`);
  }, [
    l,
    s,
    o,
    h,
    M,
    g,
    x,
    w,
    i,
    N,
    R,
    T,
    d,
    a,
    u,
    B
  ];
}
class be extends J {
  constructor(e) {
    super(), P(
      this,
      e,
      ye,
      me,
      Q,
      {
        clientstyling: 12,
        clientstylingurl: 0,
        translationurl: 13,
        mbsource: 14,
        endpoint: 1,
        session: 2,
        lang: 3,
        tabs: 4
      },
      de
    );
  }
  get clientstyling() {
    return this.$$.ctx[12];
  }
  set clientstyling(e) {
    this.$$set({ clientstyling: e }), y();
  }
  get clientstylingurl() {
    return this.$$.ctx[0];
  }
  set clientstylingurl(e) {
    this.$$set({ clientstylingurl: e }), y();
  }
  get translationurl() {
    return this.$$.ctx[13];
  }
  set translationurl(e) {
    this.$$set({ translationurl: e }), y();
  }
  get mbsource() {
    return this.$$.ctx[14];
  }
  set mbsource(e) {
    this.$$set({ mbsource: e }), y();
  }
  get endpoint() {
    return this.$$.ctx[1];
  }
  set endpoint(e) {
    this.$$set({ endpoint: e }), y();
  }
  get session() {
    return this.$$.ctx[2];
  }
  set session(e) {
    this.$$set({ session: e }), y();
  }
  get lang() {
    return this.$$.ctx[3];
  }
  set lang(e) {
    this.$$set({ lang: e }), y();
  }
  get tabs() {
    return this.$$.ctx[4];
  }
  set tabs(e) {
    this.$$set({ tabs: e }), y();
  }
}
G(be, { clientstyling: {}, clientstylingurl: {}, translationurl: {}, mbsource: {}, endpoint: {}, session: {}, lang: {}, tabs: {} }, [], [], !0);
export {
  be as C
};
