import { a as U, $ as H, S as X, i as Y, s as Z, f as x, b as J, W as K, d as T, w as Q, X as V, Y as $, Z as tt, _ as it, a0 as et, u as F, c as I, p as l, x as z, e as L, q as E, v as S, t as a, g as nt, h as ot, j as at, o as rt, k as st, n as lt, y as N, A as mt, B as ct, C as dt, D as gt } from "./PlayerAccountControllerNd-DobNa2EP.js";
function W(e, t) {
  U(e, t);
}
function ut(e) {
  H.set(e);
}
const O = {
  en: {
    cancel: "Cancel",
    confirm: "Confirm"
  },
  fr: {
    cancel: "Annuler",
    confirm: "Confirmer"
  },
  ro: {
    cancel: "Anulează",
    confirm: "Confirmă"
  },
  es: {
    cancel: "Cancelar",
    confirm: "Confirmar"
  },
  pt: {
    cancel: "Cancelar",
    confirm: "Confirmar"
  },
  "zh-hk": {
    cancel: "取消",
    confirm: "確認"
  },
  hr: {
    cancel: "Otkaži",
    confirm: "Potvrdi"
  },
  "pt-br": {
    cancel: "Cancelar",
    confirm: "confirme"
  },
  "es-mx": {
    cancel: "Cancelar",
    confirm: "Confirmar"
  },
  tr: {
    cancel: "İptal etmek",
    confirm: "Onaylamak"
  },
  "en-us": {
    cancel: "Cancel",
    confirm: "Confirm"
  }
};
function ft(e) {
  J(e, "svelte-n224ff", '*,*::before,*::after{margin:0;padding:0;box-sizing:border-box}.GamingLimitsConfirmationWrapper{position:fixed;top:0;right:0;bottom:0;left:0;background-color:rgba(0, 0, 0, 0.7);display:flex;justify-content:center;align-items:center;z-index:300;color:var(--emw--color-typography, #FFFFFF)}.GamingLimitsConfirmationContainer{position:relative;background:linear-gradient(to right, var(--emw--color-primary-variant, #184026), var(--emw--color-secondary-variant, #013E5C));border:5px solid transparent;padding:60px 30px 30px;background-clip:padding-box;border-radius:var(--emw--border-radius-medium, 10px)}.GamingLimitsConfirmationContainer::before{content:"";position:absolute;top:-4px;left:-8px;width:103%;height:105%;z-index:-1;background:linear-gradient(to right, var(--emw--color-primary, #22B04E), color-mix(in srgb, var(--emw--color-secondary, #E98B0F) 80%, black 20%), #22B04E);opacity:0.5;border-radius:inherit;filter:blur(6px)}.GamingLimitsConfirmationContainer::after{position:absolute;top:-4px;bottom:-4px;left:-4px;right:-4px;background:linear-gradient(to right, color-mix(in srgb, var(--emw--color-primary-variant, #184026) 80%, white 10%), color-mix(in srgb, var(--emw--color-secondary-variant, #013E5C) 80%, white 10%));content:"";z-index:-1;border-radius:var(--emw--border-radius-medium, 10px)}.GamingLimitsConfirmationContainerMobile{padding:40px;max-width:330px}.GamingLimitsConfirmationContainerMobile .GamingLimitsConfirmationControlAreaMobile .GamingLimitsCancelButton,.GamingLimitsConfirmationContainerMobile .GamingLimitsConfirmationControlAreaMobile .GamingLimitsConfirmButton{width:120px;height:auto;font-size:var(--emw--font-size-x-small, 12px)}.GamingLimitsConfirmationContent{font-size:18px;font-weight:300}.GamingLimitsConfirmationControlArea{display:grid;grid-template-columns:1fr 1fr;grid-gap:10px;direction:ltr;margin-top:30px}.GamingLimitsConfirmationControlArea .GamingLimitsCancelButton,.GamingLimitsConfirmationControlArea .GamingLimitsConfirmButton{background:transparent;border:1px solid #BFCBC3;color:#BFCBC3;cursor:pointer;border-radius:var(--emw--button-border-radius, 10px);width:200px;height:50px;font-size:var(--emw--font-size-medium, 16px);text-transform:uppercase;text-align:center;transition-duration:0.3s;box-sizing:border-box;padding:10px}.GamingLimitsConfirmationControlArea .GamingLimitsConfirmButton{background-color:var(--emw--color-primary, #22B04E);border:2px solid var(--emw--button-border-color, #063B17);border-radius:var(--emw--button-border-radius, 10px);color:var(--emw--button-typography, var(--emw--button-text-color, #FFFFFF))}.ModalCloseBtn{position:absolute;display:flex;align-items:center;justify-content:center;top:5px;right:5px;padding:8px;border-radius:50%;cursor:pointer;transition:all 150ms ease-in-out}.ModalCloseBtn svg{width:35px;height:40px}.ModalCloseBtn:hover{background:rgba(255, 255, 255, 0.2)}.GamingLimitsConfirmationMobileWrapper{border:none;padding:0}');
}
const Ct = (e) => ({}), P = (e) => ({});
function pt(e) {
  let t, n;
  return {
    c() {
      t = N("svg"), n = N("path"), a(n, "stroke-linecap", "round"), a(n, "stroke-linejoin", "round"), a(n, "stroke-width", "2"), a(n, "d", "M6 18L18 6M6 6l12 12"), a(t, "class", "w-6 h-6"), a(t, "fill", "none"), a(t, "stroke", "currentColor"), a(t, "viewBox", "0 0 24 24"), a(t, "xmlns", "http://www.w3.org/2000/svg");
    },
    m(s, v) {
      I(s, t, v), l(t, n);
    },
    p: lt,
    d(s) {
      s && T(t);
    }
  };
}
function bt(e) {
  let t, n, s, v, b, h, d, m, g, f = (
    /*$_*/
    e[2]("cancel") + ""
  ), p, w, y, r = (
    /*$_*/
    e[2]("confirm") + ""
  ), k, c, B, A;
  const _ = (
    /*#slots*/
    e[14].close
  ), G = K(
    _,
    e,
    /*$$scope*/
    e[13],
    P
  ), u = G || pt();
  return {
    c() {
      t = L("div"), n = L("div"), s = L("span"), u && u.c(), v = E(), b = L("div"), h = S(
        /*modaltext*/
        e[0]
      ), d = E(), m = L("div"), g = L("button"), p = S(f), w = E(), y = L("button"), k = S(r), a(s, "class", "ModalCloseBtn"), a(s, "role", "button"), a(b, "class", "GamingLimitsConfirmationContent"), a(g, "class", "GamingLimitsCancelButton"), a(y, "class", "GamingLimitsConfirmButton"), a(m, "class", "GamingLimitsConfirmationControlArea " + /*isMobile*/
      (e[3] ? "GamingLimitsConfirmationControlAreaMobile" : "")), a(n, "class", "GamingLimitsConfirmationContainer " + /*isMobile*/
      (e[3] ? "GamingLimitsConfirmationContainerMobile" : "")), a(t, "class", "GamingLimitsConfirmationWrapper " + /*isMobile*/
      (e[3] ? "GamingLimitsConfirmationMobileWrapper" : ""));
    },
    m(o, C) {
      I(o, t, C), l(t, n), l(n, s), u && u.m(s, null), l(n, v), l(n, b), l(b, h), l(n, d), l(n, m), l(m, g), l(g, p), l(m, w), l(m, y), l(y, k), e[15](t), c = !0, B || (A = [
        z(
          s,
          "click",
          /*close*/
          e[4]
        ),
        z(
          g,
          "click",
          /*cancelChanges*/
          e[6]
        ),
        z(
          y,
          "click",
          /*confirmChanges*/
          e[5]
        )
      ], B = !0);
    },
    p(o, [C]) {
      G && G.p && (!c || C & /*$$scope*/
      8192) && tt(
        G,
        _,
        o,
        /*$$scope*/
        o[13],
        c ? et(
          _,
          /*$$scope*/
          o[13],
          C,
          Ct
        ) : it(
          /*$$scope*/
          o[13]
        ),
        P
      ), (!c || C & /*modaltext*/
      1) && F(
        h,
        /*modaltext*/
        o[0]
      ), (!c || C & /*$_*/
      4) && f !== (f = /*$_*/
      o[2]("cancel") + "") && F(p, f), (!c || C & /*$_*/
      4) && r !== (r = /*$_*/
      o[2]("confirm") + "") && F(k, r);
    },
    i(o) {
      c || ($(u, o), c = !0);
    },
    o(o) {
      V(u, o), c = !1;
    },
    d(o) {
      o && T(t), u && u.d(o), e[15](null), B = !1, Q(A);
    }
  };
}
function ht(e, t, n) {
  let s;
  nt(e, ot, (i) => n(2, s = i));
  let { $$slots: v = {}, $$scope: b } = t, { modaltext: h = "Are you sure that you want to perform this action?" } = t, { modalsource: d = "" } = t, { lang: m = "en" } = t, { clientstyling: g = "" } = t, { clientstylingurl: f = "" } = t, { mbsource: p } = t, { translationurl: w = "" } = t;
  const y = () => {
    fetch(w).then((M) => M.json()).then((M) => {
      Object.keys(M).forEach((D) => {
        W(D, M[D]);
      });
    }).catch((M) => {
      console.log(M);
    });
  };
  Object.keys(O).forEach((i) => {
    W(i, O[i]);
  });
  let r, k, c = window.navigator.userAgent, B = at(c) !== "PC", A = {}, _ = "";
  const G = () => {
    window.postMessage({ type: "ModalClosed" }, window.location.href);
  }, u = () => {
    d === "groupEdit" ? window.postMessage({ type: "GamingLimitsConfirmChanges" }, window.location.href) : d === "infoCard" && window.postMessage(
      {
        type: "PlayerAccountGamingLimitDelete",
        limit: A,
        name: _
      },
      window.location.href
    ), window.postMessage({ type: "ModalClosed" }, window.location.href);
  }, o = () => {
    d === "groupEdit" ? window.postMessage({ type: "CancelGamingLimitsChanges" }, window.location.href) : d === "infoCard" && window.postMessage({ type: "CancelGamingLimitsRemove" }, window.location.href), window.postMessage({ type: "ModalClosed" }, window.location.href);
  }, C = (i) => i === "Time Limit" ? "cumulativeSessionLimits" : i === "Deposit Limit" ? "depositLimits" : i === "Wagering Limit" ? "wageringLimit" : "lossLimit", j = (i) => {
    if (i.data)
      switch (i.data.type) {
        case "DeleteLimitsItem":
          A = i.data.removeData, _ = C(i.data.removeName);
          break;
      }
  }, R = () => {
    ut(m);
  };
  rt(() => (window.addEventListener("message", j, !1), () => {
    window.removeEventListener("message", j);
  }));
  function q(i) {
    st[i ? "unshift" : "push"](() => {
      r = i, n(1, r);
    });
  }
  return e.$$set = (i) => {
    "modaltext" in i && n(0, h = i.modaltext), "modalsource" in i && n(7, d = i.modalsource), "lang" in i && n(8, m = i.lang), "clientstyling" in i && n(9, g = i.clientstyling), "clientstylingurl" in i && n(10, f = i.clientstylingurl), "mbsource" in i && n(11, p = i.mbsource), "translationurl" in i && n(12, w = i.translationurl), "$$scope" in i && n(13, b = i.$$scope);
  }, e.$$.update = () => {
    e.$$.dirty & /*modaltext, modalsource, lang*/
    385 && h && d && m && R(), e.$$.dirty & /*clientstyling, customStylingContainer*/
    514 && g && r && mt(r, g), e.$$.dirty & /*clientstylingurl, customStylingContainer*/
    1026 && f && r && ct(r, f), e.$$.dirty & /*mbsource, customStylingContainer*/
    2050 && p && r && dt(r, `${p}.Style`, k), e.$$.dirty & /*translationurl*/
    4096 && w && y();
  }, [
    h,
    r,
    s,
    B,
    G,
    u,
    o,
    d,
    m,
    g,
    f,
    p,
    w,
    b,
    v,
    q
  ];
}
class wt extends X {
  constructor(t) {
    super(), Y(
      this,
      t,
      ht,
      bt,
      Z,
      {
        modaltext: 0,
        modalsource: 7,
        lang: 8,
        clientstyling: 9,
        clientstylingurl: 10,
        mbsource: 11,
        translationurl: 12
      },
      ft
    );
  }
  get modaltext() {
    return this.$$.ctx[0];
  }
  set modaltext(t) {
    this.$$set({ modaltext: t }), x();
  }
  get modalsource() {
    return this.$$.ctx[7];
  }
  set modalsource(t) {
    this.$$set({ modalsource: t }), x();
  }
  get lang() {
    return this.$$.ctx[8];
  }
  set lang(t) {
    this.$$set({ lang: t }), x();
  }
  get clientstyling() {
    return this.$$.ctx[9];
  }
  set clientstyling(t) {
    this.$$set({ clientstyling: t }), x();
  }
  get clientstylingurl() {
    return this.$$.ctx[10];
  }
  set clientstylingurl(t) {
    this.$$set({ clientstylingurl: t }), x();
  }
  get mbsource() {
    return this.$$.ctx[11];
  }
  set mbsource(t) {
    this.$$set({ mbsource: t }), x();
  }
  get translationurl() {
    return this.$$.ctx[12];
  }
  set translationurl(t) {
    this.$$set({ translationurl: t }), x();
  }
}
gt(wt, { modaltext: {}, modalsource: {}, lang: {}, clientstyling: {}, clientstylingurl: {}, mbsource: {}, translationurl: {} }, ["close"], [], !0);
export {
  wt as default
};
