import { a3 as B, S as P, i as U, s as j, f, b as q, d as L, U as w, V as m, X as A, W as H, e as D, L as N, o as R, Z as V, a4 as S, P as X, _ as Z, a0 as p, a1 as F, p as k, g as _, t as y, k as v, B as G, C as I, D as J, c as K } from "./PlayerAccountController-D0b5nEtR.js";
function C(e, { delay: t = 0, duration: n = 400, easing: i = B } = {}) {
  const s = +getComputedStyle(e).opacity;
  return {
    delay: t,
    duration: n,
    easing: i,
    css: (o) => `opacity: ${o * s}`
  };
}
function O(e) {
  q(e, "svelte-126fglp", "*,*::before,*::after{margin:0;padding:0;box-sizing:border-box}.ModalWindow{display:flex;position:fixed;align-items:center;justify-content:center;width:100%;height:100%;z-index:300;top:0;left:0}");
}
function M(e) {
  let t, n, i, s, o;
  const d = (
    /*#slots*/
    e[9].default
  ), r = V(
    d,
    e,
    /*$$scope*/
    e[8],
    null
  );
  return {
    c() {
      t = _("div"), n = _("div"), i = _("div"), r && r.c(), y(i, "class", "ModalContainer"), y(n, "class", "ModalWindow"), y(n, "id", "Modal");
    },
    m(a, u) {
      D(a, t, u), k(t, n), k(n, i), r && r.m(i, null), e[10](n), e[11](t), o = !0;
    },
    p(a, u) {
      e = a, r && r.p && (!o || u & /*$$scope*/
      256) && Z(
        r,
        d,
        e,
        /*$$scope*/
        e[8],
        o ? F(
          d,
          /*$$scope*/
          e[8],
          u,
          null
        ) : p(
          /*$$scope*/
          e[8]
        ),
        null
      );
    },
    i(a) {
      o || (m(r, a), a && X(() => {
        o && (s || (s = S(n, C, { transitionDuration: (
          /*duration*/
          e[1]
        ) }, !0)), s.run(1));
      }), o = !0);
    },
    o(a) {
      w(r, a), a && (s || (s = S(n, C, { transitionDuration: (
        /*duration*/
        e[1]
      ) }, !1)), s.run(0)), o = !1;
    },
    d(a) {
      a && L(t), r && r.d(a), e[10](null), a && s && s.end(), e[11](null);
    }
  };
}
function Q(e) {
  let t, n, i = (
    /*show*/
    e[0] && M(e)
  );
  return {
    c() {
      i && i.c(), t = N();
    },
    m(s, o) {
      i && i.m(s, o), D(s, t, o), n = !0;
    },
    p(s, [o]) {
      /*show*/
      s[0] ? i ? (i.p(s, o), o & /*show*/
      1 && m(i, 1)) : (i = M(s), i.c(), m(i, 1), i.m(t.parentNode, t)) : i && (A(), w(i, 1, 1, () => {
        i = null;
      }), H());
    },
    i(s) {
      n || (m(i), n = !0);
    },
    o(s) {
      w(i), n = !1;
    },
    d(s) {
      s && L(t), i && i.d(s);
    }
  };
}
function T(e, t, n) {
  let { $$slots: i = {}, $$scope: s } = t, { show: o = !1 } = t, { duration: d = 350 } = t, { clientstyling: r = "" } = t, { clientstylingurl: a = "" } = t, { mbsource: u } = t, { showmodaleventname: g = "ShowLimitsConfirmationModal" } = t, c, E, h;
  const b = (l) => {
    switch (l.data.type) {
      case "ModalClosed":
        n(0, o = !1);
        break;
      case g:
        n(0, o = !0), window.postMessage({ type: "DisableScroll" }, window.location.href);
        break;
    }
  };
  R(() => (window.addEventListener("message", b, !1), () => {
    window.removeEventListener("message", b);
  }));
  function W(l) {
    v[l ? "unshift" : "push"](() => {
      h = l, n(3, h);
    });
  }
  function z(l) {
    v[l ? "unshift" : "push"](() => {
      c = l, n(2, c);
    });
  }
  return e.$$set = (l) => {
    "show" in l && n(0, o = l.show), "duration" in l && n(1, d = l.duration), "clientstyling" in l && n(4, r = l.clientstyling), "clientstylingurl" in l && n(5, a = l.clientstylingurl), "mbsource" in l && n(6, u = l.mbsource), "showmodaleventname" in l && n(7, g = l.showmodaleventname), "$$scope" in l && n(8, s = l.$$scope);
  }, e.$$.update = () => {
    e.$$.dirty & /*clientstyling, customStylingContainer*/
    20 && r && c && G(c, r), e.$$.dirty & /*clientstylingurl, customStylingContainer*/
    36 && a && c && I(c, a), e.$$.dirty & /*mbsource, customStylingContainer*/
    68 && u && c && J(c, `${u}.Style`, E);
  }, [
    o,
    d,
    c,
    h,
    r,
    a,
    u,
    g,
    s,
    i,
    W,
    z
  ];
}
class Y extends P {
  constructor(t) {
    super(), U(
      this,
      t,
      T,
      Q,
      j,
      {
        show: 0,
        duration: 1,
        clientstyling: 4,
        clientstylingurl: 5,
        mbsource: 6,
        showmodaleventname: 7
      },
      O
    );
  }
  get show() {
    return this.$$.ctx[0];
  }
  set show(t) {
    this.$$set({ show: t }), f();
  }
  get duration() {
    return this.$$.ctx[1];
  }
  set duration(t) {
    this.$$set({ duration: t }), f();
  }
  get clientstyling() {
    return this.$$.ctx[4];
  }
  set clientstyling(t) {
    this.$$set({ clientstyling: t }), f();
  }
  get clientstylingurl() {
    return this.$$.ctx[5];
  }
  set clientstylingurl(t) {
    this.$$set({ clientstylingurl: t }), f();
  }
  get mbsource() {
    return this.$$.ctx[6];
  }
  set mbsource(t) {
    this.$$set({ mbsource: t }), f();
  }
  get showmodaleventname() {
    return this.$$.ctx[7];
  }
  set showmodaleventname(t) {
    this.$$set({ showmodaleventname: t }), f();
  }
}
K(Y, { show: { type: "Boolean" }, duration: {}, clientstyling: {}, clientstylingurl: {}, mbsource: {}, showmodaleventname: {} }, ["default"], [], !0);
export {
  Y as default
};
