import { a as q, $ as F, S as O, i as H, s as D, f as W, b as G, n as C, d as M, c as R, h as S, j as u, k as b, m as B, t as x, e as g, p as V, q as X, u as Y, l as Z, v as _, w as J, a2 as L, x as K, y as Q, z as $, A as ee, B as te } from "./GeneralLogout-BtP2SNPX.js";
function j(n, e) {
  q(n, e);
}
function ne(n) {
  F.set(n);
}
const A = {
  en: {
    titlePendingWithdrawals: "Pending Withdrawal",
    loading: "Loading, please wait ..."
  },
  "zh-hk": {
    titlePendingWithdrawals: "待取款",
    loading: "加載請稍候…"
  },
  fr: {
    titlePendingWithdrawals: "Retrait en cours",
    loading: "Chargement, veuillez patienter ..."
  },
  ro: {
    titlePendingWithdrawals: "Retragere în așteptare",
    loading: "Se încarcă..."
  },
  es: {
    titlePendingWithdrawals: "Retiro Pendiente",
    loading: "Cargando..."
  },
  pt: {
    titlePendingWithdrawals: "Retirada pendente",
    loading: "Carregando, por favor espere ..."
  },
  hr: {
    titlePendingWithdrawals: "Isplate na čekanju",
    loading: "Učitavanje"
  },
  tr: {
    titlePendingWithdrawals: "Çekilme Bekleniyor",
    loading: "Yükleniyor lütfen bekleyin ..."
  },
  "en-us": {
    titlePendingWithdrawals: "Pending Withdrawal",
    loading: "Loading, please wait ..."
  }
};
function ie(n) {
  G(n, "svelte-1gwync8", ".PendingWithdrawalsWrapper{background-color:var(--emw--color-pale, var(--emw--color-gray-50, #F1F1F1));border-radius:var(--emw--border-radius-large, 10px);color:var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E));padding:50px 50px 30px 50px;max-width:100%}.PendingWithdrawalsWrapper.PendingWithdrawalsWrapperMobile{padding:20px 15px;max-width:unset;border-radius:0}.MenuReturnButton{color:var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E));display:inline-flex;align-items:center;column-gap:10px;margin-bottom:10px}.MenuReturnButton svg{fill:var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E))}.PendingWithdrawalsTitle{font-size:var(--emw--font-size-x-large, 26px);color:var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E));font-weight:var(--emw--font-weigh-normal, 400)}.PendingWithdrawalsTitleMobile{font-size:var(--emw--size-standard, 16px)}.PendingWithdrawalsTitleNone{display:none}.PendingWithdrawalsIframeWrapper iframe{border:none;width:100%;height:85vh;border-radius:var(--emw--border-radius-large, 10px)}");
}
function ae(n) {
  let e, t, r, a, d, m, c, h, f, s, l = (
    /*$_*/
    n[3]("titlePendingWithdrawals") + ""
  ), o, v, k;
  return {
    c() {
      e = b("div"), t = _("svg"), r = _("defs"), a = _("style"), d = x(".aaa{fill:var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E));}"), m = _("g"), c = _("g"), h = _("path"), f = B(), s = b("h2"), o = x(l), g(h, "class", "aaa"), g(h, "d", "M7.5,0,6.136,1.364,11.3,6.526H0V8.474H11.3L6.136,13.636,7.5,15,15,7.5Z"), g(h, "transform", "translate(15 15) rotate(180)"), g(c, "transform", "translate(20 158)"), g(m, "transform", "translate(-20 -158)"), g(t, "xmlns", "http://www.w3.org/2000/svg"), g(t, "width", "15"), g(t, "height", "15"), g(t, "viewBox", "0 0 15 15"), g(s, "class", "PendingWithdrawalsTitleMobile"), g(e, "class", "MenuReturnButton");
    },
    m(w, P) {
      S(w, e, P), u(e, t), u(t, r), u(r, a), u(a, d), u(t, m), u(m, c), u(c, h), u(e, f), u(e, s), u(s, o), v || (k = Z(
        e,
        "click",
        /*click_handler*/
        n[14]
      ), v = !0);
    },
    p(w, P) {
      P & /*$_*/
      8 && l !== (l = /*$_*/
      w[3]("titlePendingWithdrawals") + "") && R(o, l);
    },
    d(w) {
      w && M(e), v = !1, k();
    }
  };
}
function le(n) {
  let e, t, r;
  return {
    c() {
      e = b("div"), t = b("iframe"), L(t.src, r = /*iframeUrl*/
      n[2]) || g(t, "src", r), g(t, "title", "Pending Withdrawals Iframe"), g(e, "class", "PendingWithdrawalsIframeWrapper");
    },
    m(a, d) {
      S(a, e, d), u(e, t);
    },
    p(a, d) {
      d & /*iframeUrl*/
      4 && !L(t.src, r = /*iframeUrl*/
      a[2]) && g(t, "src", r);
    },
    d(a) {
      a && M(e);
    }
  };
}
function re(n) {
  let e, t = (
    /*$_*/
    n[3]("loading") + ""
  ), r;
  return {
    c() {
      e = b("p"), r = x(t);
    },
    m(a, d) {
      S(a, e, d), u(e, r);
    },
    p(a, d) {
      d & /*$_*/
      8 && t !== (t = /*$_*/
      a[3]("loading") + "") && R(r, t);
    },
    d(a) {
      a && M(e);
    }
  };
}
function se(n) {
  let e, t, r, a = (
    /*$_*/
    n[3]("titlePendingWithdrawals") + ""
  ), d, m, c = (
    /*isMobile*/
    n[4] && ae(n)
  );
  function h(l, o) {
    return (
      /*isLoading*/
      l[1] ? re : le
    );
  }
  let f = h(n), s = f(n);
  return {
    c() {
      e = b("div"), c && c.c(), t = B(), r = b("h2"), d = x(a), m = B(), s.c(), g(r, "class", "PendingWithdrawalsTitle " + /*isMobile*/
      (n[4] ? "PendingWithdrawalsTitleNone" : "")), g(e, "class", "PendingWithdrawalsWrapper " + /*isMobile*/
      (n[4] ? "PendingWithdrawalsWrapperMobile" : ""));
    },
    m(l, o) {
      S(l, e, o), c && c.m(e, null), u(e, t), u(e, r), u(r, d), u(e, m), s.m(e, null), n[15](e);
    },
    p(l, [o]) {
      /*isMobile*/
      l[4] && c.p(l, o), o & /*$_*/
      8 && a !== (a = /*$_*/
      l[3]("titlePendingWithdrawals") + "") && R(d, a), f === (f = h(l)) && s ? s.p(l, o) : (s.d(1), s = f(l), s && (s.c(), s.m(e, null)));
    },
    i: C,
    o: C,
    d(l) {
      l && M(e), c && c.d(), s.d(), n[15](null);
    }
  };
}
function oe(n, e, t) {
  let r;
  V(n, te, (i) => t(3, r = i));
  let { endpoint: a = "" } = e, { session: d = "" } = e, { playerid: m = "" } = e, { lang: c = "en" } = e, { clientstyling: h = "" } = e, { clientstylingurl: f = "" } = e, { mbsource: s } = e, { translationurl: l = "" } = e, o, v = window.navigator.userAgent, k = X(v) !== "PC", w = !0, P = "";
  const E = () => {
    fetch(l).then((p) => p.json()).then((p) => {
      Object.keys(p).forEach((y) => {
        j(y, p[y]);
      });
    }).catch((p) => {
      console.log(p);
    });
  };
  Object.keys(A).forEach((i) => {
    j(i, A[i]);
  });
  const T = () => {
    window.postMessage(
      {
        type: "PlayerAccountMenuActive",
        isMobile: k
      },
      window.location.href
    );
  }, z = () => {
    let i = new URL(`${a}/v1/player/${m}/hostedcashier/pendingwithdrawals`);
    i.searchParams.append("language", c);
    let p = {
      method: "GET",
      headers: {
        "X-SessionId": d,
        accept: "application/json"
      }
    };
    fetch(i.href, p).then((y) => y.json()).then(
      (y) => {
        t(1, w = !1), t(2, P = y.CashierUrl);
      },
      (y) => {
        console.error(y);
      }
    );
  }, I = () => {
    ne(c);
  };
  Y(() => () => {
  });
  const U = () => T();
  function N(i) {
    J[i ? "unshift" : "push"](() => {
      o = i, t(0, o);
    });
  }
  return n.$$set = (i) => {
    "endpoint" in i && t(6, a = i.endpoint), "session" in i && t(7, d = i.session), "playerid" in i && t(8, m = i.playerid), "lang" in i && t(9, c = i.lang), "clientstyling" in i && t(10, h = i.clientstyling), "clientstylingurl" in i && t(11, f = i.clientstylingurl), "mbsource" in i && t(12, s = i.mbsource), "translationurl" in i && t(13, l = i.translationurl);
  }, n.$$.update = () => {
    n.$$.dirty & /*lang*/
    512 && c && I(), n.$$.dirty & /*session, playerid, endpoint, lang*/
    960 && d && m && a && c && z(), n.$$.dirty & /*clientstyling, customStylingContainer*/
    1025 && h && o && K(o, h), n.$$.dirty & /*clientstylingurl, customStylingContainer*/
    2049 && f && o && Q(o, f), n.$$.dirty & /*mbsource, customStylingContainer*/
    4097 && s && o && $(o, `${s}.Style`), n.$$.dirty & /*translationurl*/
    8192 && l && E();
  }, [
    o,
    w,
    P,
    r,
    k,
    T,
    a,
    d,
    m,
    c,
    h,
    f,
    s,
    l,
    U,
    N
  ];
}
class de extends O {
  constructor(e) {
    super(), H(
      this,
      e,
      oe,
      se,
      D,
      {
        endpoint: 6,
        session: 7,
        playerid: 8,
        lang: 9,
        clientstyling: 10,
        clientstylingurl: 11,
        mbsource: 12,
        translationurl: 13
      },
      ie
    );
  }
  get endpoint() {
    return this.$$.ctx[6];
  }
  set endpoint(e) {
    this.$$set({ endpoint: e }), W();
  }
  get session() {
    return this.$$.ctx[7];
  }
  set session(e) {
    this.$$set({ session: e }), W();
  }
  get playerid() {
    return this.$$.ctx[8];
  }
  set playerid(e) {
    this.$$set({ playerid: e }), W();
  }
  get lang() {
    return this.$$.ctx[9];
  }
  set lang(e) {
    this.$$set({ lang: e }), W();
  }
  get clientstyling() {
    return this.$$.ctx[10];
  }
  set clientstyling(e) {
    this.$$set({ clientstyling: e }), W();
  }
  get clientstylingurl() {
    return this.$$.ctx[11];
  }
  set clientstylingurl(e) {
    this.$$set({ clientstylingurl: e }), W();
  }
  get mbsource() {
    return this.$$.ctx[12];
  }
  set mbsource(e) {
    this.$$set({ mbsource: e }), W();
  }
  get translationurl() {
    return this.$$.ctx[13];
  }
  set translationurl(e) {
    this.$$set({ translationurl: e }), W();
  }
}
ee(de, { endpoint: {}, session: {}, playerid: {}, lang: {}, clientstyling: {}, clientstylingurl: {}, mbsource: {}, translationurl: {} }, [], [], !0);
export {
  de as default
};
