import { S as Oe, b as Te, s as Be, f as k, c as Me, n as J, e as C, J as T, m as S, p as w, v as P, w as Z, K as X, L as Le, D, q as O, A as xe, o as V, B as U, y as qe, z as Fe, E as ze } from "./CashierConfirmModal-4RYp7Eiq.js";
import { a as Ie, i as Ee, $ as Re, b as Ue } from "./CashierError-DUzkCsXh.js";
import { d as Q, u as He, x as Ne } from "./CashierMethodDetails-CCXOr2gb.js";
function $(t, i) {
  Ie(t, i);
}
function je(t) {
  Ee({
    fallbackLocale: "en"
  }), Re.set(t);
}
const ee = {
  en: {
    "verification.video.how-to": "How to verify yourself",
    "verification.idenfy.referred-awaiting": "ID verification is in progress. We will inform you as soon as verification is completed and you can withdraw money back",
    "verification.message.failed": "We apologize, but we were unable to verify your account. Please contact support team",
    "verification.idenfy.link-name": "link",
    "verification.idenfy.in-progress": "To withdraw funds to your account you are required to pass user verification. Please have your ID ready and follow the {link} to start verification",
    "verification.shuftipro.in-progress.Biometric": "To proceed with a transaction you are required to pass user verification. Please follow the link to start {Biometric} verification.",
    "verification.shuftipro.in-progress.Biometric.Documents": "To proceed with a transaction you are required to pass user verification. Please follow the link to start {Biometric} verification and {Documents} verification.",
    "verification.shuftipro.in-progress.Biometric.Documents.ProofOfAddress": "To proceed with a transaction you are required to pass user verification. Please follow the link to start {Biometric} verification, {Documents} verification and {ProofOfAddress} verification.",
    "verification.shuftipro.in-progress.Biometric.ProofOfAddress": "To proceed with a transaction you are required to pass user verification. Please follow the link to start {Biometric} verification and {ProofOfAddress} verification.",
    "verification.shuftipro.in-progress.Documents": "To proceed with a transaction you are required to pass user verification. Please follow the link to start {Documents} verification.",
    "verification.shuftipro.in-progress.Documents.ProofOfAddress": "To proceed with a transaction you are required to pass user verification. Please follow the link to start {Documents} verification and {ProofOfAddress} verification.",
    "verification.shuftipro.in-progress.ProofOfAddress": "To proceed with a transaction you are required to pass user verification. Please follow the link to start {ProofOfAddress} verification.",
    "verification.shuftipro.link-name.Biometric": "Biometric",
    "verification.shuftipro.link-name.Documents": "Documents",
    "verification.shuftipro.link-name.ProofOfAddress": "Proof Of Address",
    "verification.shuftipro.validations-started": "After completing verification, please proceed with the transaction"
  },
  tr: {
    "verification.video.how-to": "Kimlik doğrulama nasıl yapılır",
    "verification.idenfy.referred-awaiting": "Kimlik doğrulaması işlemde. Doğrulama tamamlandığında size haber vereceğiz",
    "verification.message.failed": "Döküman doğrulama başarısız, hesabınız doğrulanamadı",
    "verification.idenfy.link-name": "link",
    "verification.idenfy.in-progress": "Hesabınızdan çekim yapabilmek için kullanıcı doğrulaması gerekiyor. Lütfen kimliğinizi hazır edin ve {link} adresinden doğrulamayı başlatın",
    "verification.shuftipro.in-progress.Biometric": "İşlemi gerçekleştirmek için kullanıcı doğrulamasını geçmeniz gerekmektedir. Doğrulamayı başlatmak için Lütfen linke tıklayın {Biometric}",
    "verification.shuftipro.in-progress.Biometric.Documents": "To proceed with a transaction you are required to pass user verification. Please follow the link to start {Biometric} verification and {Documents} verification.",
    "verification.shuftipro.in-progress.Biometric.Documents.ProofOfAddress": "To proceed with a transaction you are required to pass user verification. Please follow the link to start {Biometric} verification, {Documents} verification and {ProofOfAddress} verification.",
    "verification.shuftipro.in-progress.Biometric.ProofOfAddress": "To proceed with a transaction you are required to pass user verification. Please follow the link to start {Biometric} verification and {ProofOfAddress} verification.",
    "verification.shuftipro.in-progress.Documents": "To proceed with a transaction you are required to pass user verification. Please follow the link to start {Documents} verification.",
    "verification.shuftipro.in-progress.Documents.ProofOfAddress": "To proceed with a transaction you are required to pass user verification. Please follow the link to start {Documents} verification and {ProofOfAddress} verification.",
    "verification.shuftipro.in-progress.ProofOfAddress": "To proceed with a transaction you are required to pass user verification. Please follow the link to start {ProofOfAddress} verification.",
    "verification.shuftipro.link-name.Biometric": "Doğrulama Yap",
    "verification.shuftipro.link-name.Documents": "Documents",
    "verification.shuftipro.link-name.ProofOfAddress": "Proof Of Address",
    "verification.shuftipro.validations-started": "Lütfen Doğrulamayı tamamladıktan sonra işleme devam ediniz"
  },
  hr: {
    "verification.video.how-to": "How to verify yourself",
    "verification.idenfy.referred-awaiting": "ID verification is in progress. We will inform you as soon as verification is completed and you can withdraw money back",
    "verification.message.failed": "We apologize, but we were unable to verify your account. Please contact support team",
    "verification.idenfy.link-name": "link",
    "verification.idenfy.in-progress": "To withdraw funds to your account you are required to pass user verification. Please have your ID ready and follow the {link} to start verification",
    "verification.shuftipro.in-progress.Biometric": "To proceed with a transaction you are required to pass user verification. Please follow the link to start {Biometric} verification.",
    "verification.shuftipro.in-progress.Biometric.Documents": "To proceed with a transaction you are required to pass user verification. Please follow the link to start {Biometric} verification and {Documents} verification.",
    "verification.shuftipro.in-progress.Biometric.Documents.ProofOfAddress": "To proceed with a transaction you are required to pass user verification. Please follow the link to start {Biometric} verification, {Documents} verification and {ProofOfAddress} verification.",
    "verification.shuftipro.in-progress.Biometric.ProofOfAddress": "To proceed with a transaction you are required to pass user verification. Please follow the link to start {Biometric} verification and {ProofOfAddress} verification.",
    "verification.shuftipro.in-progress.Documents": "To proceed with a transaction you are required to pass user verification. Please follow the link to start {Documents} verification.",
    "verification.shuftipro.in-progress.Documents.ProofOfAddress": "To proceed with a transaction you are required to pass user verification. Please follow the link to start {Documents} verification and {ProofOfAddress} verification.",
    "verification.shuftipro.in-progress.ProofOfAddress": "To proceed with a transaction you are required to pass user verification. Please follow the link to start {ProofOfAddress} verification.",
    "verification.shuftipro.link-name.Biometric": "Biometric",
    "verification.shuftipro.link-name.Documents": "Documents",
    "verification.shuftipro.link-name.ProofOfAddress": "Proof Of Address",
    "verification.shuftipro.validations-started": "After completing verification, please proceed with the transaction"
  }
};
if (typeof window != "undefined") {
  let t = function(i) {
    return function(...r) {
      try {
        return i.apply(this, r);
      } catch (n) {
        if (n instanceof DOMException && n.message.includes("has already been used with this registry") || n.message.includes("Cannot define multiple custom elements with the same tag name"))
          return !1;
        throw n;
      }
    };
  };
  customElements.define = t(customElements.define), import("./CashierVideoModal-DHNu0BQz.js").then(({ default: i }) => {
    !customElements.get("cashier-video-modal") && customElements.define("cashier-video-modal", i.element);
  });
}
function We(t) {
  Me(t, "svelte-1emynn4", "*,*::before,*::after{margin:0;padding:0;list-style:none;text-decoration:none;outline:none;box-sizing:border-box;-webkit-tap-highlight-color:transparent}.CashierVerifications{box-shadow:0 0 4px var(--mmw--color-black-transparency-10, rgba(0, 0, 0, 0.1))}.CashierVerifications.CashierVerificationsDesktop{border-radius:var(--mmw--border-radius-medium-plus, 6px);overflow:hidden}.CashierVerifications.CashierVerificationsDesktop:has(.CashierVerificationMessage){margin-bottom:var(--emw--spacing-small, 12px)}.CashierVerificationsWrapper{display:flex;flex-direction:column;width:100%}.IconVerification{width:30px;display:flex}.CashierVerificationMessage{display:flex;align-items:center;box-sizing:border-box;background:var(--emw--color-gray-50, #F7F8FA);border-bottom:1px solid var(--mmw--color-grey-105, #E8E9EB);padding:0 var(--emw--spacing-small, 12px);transition:0.5s;max-height:500px}.CashierVerificationMessage:first-child{transition:none;cursor:pointer}.CashierVerificationMessage:first-child:hover{background:linear-gradient(0, var(--emw--color-gray-50, #F7F8FA) 0%, var(--emw--color-white, #fff) 100%)}.CashierVerificationMessage:not(.ShowAll):not(:first-child){max-height:0;overflow:hidden}.CashierVerificationMessage:hover .CashierVerificationChevron svg path{opacity:1}svg{height:20px}svg .IconColor{fill:var(--emw--color-warning, #ec9109)}p{color:var(--mmw--color-grey-10, #111);font-size:var(--emw--font-size-small, 14px);font-family:inherit;line-height:120%;margin:var(--emw--spacing-small, 12px)}.CashierVerificationsDesktop p{font-size:var(--emw--font-size-medium, 16px)}.text{word-break:break-word}.CashierVerificationChevron{cursor:pointer;margin-left:auto}.CashierVerificationChevron svg{transition:0.25s}.CashierVerificationChevron svg path{fill:var(--mmw--color-grey-290, #666);opacity:0.5}.CashierVerificationChevron:hover svg path{opacity:1}.ShowAll .CashierVerificationChevron svg{-o-transform:rotate(180deg);-ms-transform:rotate(180deg);-moz-transform:rotate(180deg);-webkit-transform:rotate(180deg);transform:rotate(180deg)}.CashierVerificationVideo{display:flex;width:100%;align-items:center;box-sizing:border-box;background:var(--emw--color-gray-50, #F7F8FA);border-bottom:1px solid var(--mmw--color-grey-105, #E8E9EB);padding:0 var(--emw--spacing-small, 12px);transition:0.5s;max-height:500px}.IconVideo{width:30px;display:flex;justify-content:center}.CashierVerificationVideoLink{cursor:pointer;color:var(--mmw--color-grey-10, #111);font-family:inherit;font-size:var(--emw--font-size-small, 14px);line-height:120%;margin:var(--emw--spacing-small, 12px);text-decoration:underline}.CashierVerificationVideoLinkDesktop{font-size:var(--emw--font-size-medium, 16px)}");
}
function ie(t, i, r) {
  const n = t.slice();
  return n[52] = i[r], n[54] = r, n;
}
function te(t) {
  let i, r, n, l, d = X(
    /*displayMessages*/
    t[4]
  ), f = [];
  for (let a = 0; a < d.length; a += 1)
    f[a] = oe(ie(t, d, a));
  let h = (
    /*videoExists*/
    t[7] && se(t)
  );
  return {
    c() {
      i = w("div");
      for (let a = 0; a < f.length; a += 1)
        f[a].c();
      r = O(), h && h.c(), n = O(), l = w("cashier-video-modal"), P(i, "class", "CashierVerificationsWrapper"), D(
        l,
        "clientstylingurl",
        /*clientstylingurl*/
        t[1]
      ), D(
        l,
        "clientstyling",
        /*clientstyling*/
        t[0]
      ), D(
        l,
        "ismobileview",
        /*ismobileview*/
        t[2]
      ), D(
        l,
        "videosrc",
        /*videoSrc*/
        t[8]
      );
    },
    m(a, u) {
      S(a, i, u);
      for (let s = 0; s < f.length; s += 1)
        f[s] && f[s].m(i, null);
      S(a, r, u), h && h.m(a, u), S(a, n, u), S(a, l, u);
    },
    p(a, u) {
      if (u[0] & /*allVerificationsVisible, showAllVerifications, displayMessages*/
      1072) {
        d = X(
          /*displayMessages*/
          a[4]
        );
        let s;
        for (s = 0; s < d.length; s += 1) {
          const b = ie(a, d, s);
          f[s] ? f[s].p(b, u) : (f[s] = oe(b), f[s].c(), f[s].m(i, null));
        }
        for (; s < f.length; s += 1)
          f[s].d(1);
        f.length = d.length;
      }
      /*videoExists*/
      a[7] ? h ? h.p(a, u) : (h = se(a), h.c(), h.m(n.parentNode, n)) : h && (h.d(1), h = null), u[0] & /*clientstylingurl*/
      2 && D(
        l,
        "clientstylingurl",
        /*clientstylingurl*/
        a[1]
      ), u[0] & /*clientstyling*/
      1 && D(
        l,
        "clientstyling",
        /*clientstyling*/
        a[0]
      ), u[0] & /*ismobileview*/
      4 && D(
        l,
        "ismobileview",
        /*ismobileview*/
        a[2]
      ), u[0] & /*videoSrc*/
      256 && D(
        l,
        "videosrc",
        /*videoSrc*/
        a[8]
      );
    },
    d(a) {
      a && (C(i), C(r), C(n), C(l)), Le(f, a), h && h.d(a);
    }
  };
}
function re(t) {
  let i, r, n;
  function l(...d) {
    return (
      /*click_handler*/
      t[19](
        /*index*/
        t[54],
        ...d
      )
    );
  }
  return {
    c() {
      i = w("span"), i.innerHTML = '<svg width="25px" height="25px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M12 1C5.92487 1 1 5.92487 1 12C1 18.0751 5.92487 23 12 23C18.0751 23 23 18.0751 23 12C23 5.92487 18.0751 1 12 1ZM8.70711 9.79289C8.31658 9.40237 7.68342 9.40237 7.29289 9.79289C6.90237 10.1834 6.90237 10.8166 7.29289 11.2071L11.2929 15.2071C11.6834 15.5976 12.3166 15.5976 12.7071 15.2071L16.7071 11.2071C17.0976 10.8166 17.0976 10.1834 16.7071 9.79289C16.3166 9.40237 15.6834 9.40237 15.2929 9.79289L12 13.0858L8.70711 9.79289Z" fill="#000000"></path></svg>', P(i, "class", "CashierVerificationChevron");
    },
    m(d, f) {
      S(d, i, f), r || (n = U(i, "click", l), r = !0);
    },
    p(d, f) {
      t = d;
    },
    d(d) {
      d && C(i), r = !1, n();
    }
  };
}
function oe(t) {
  let i, r, n, l, d = (
    /*message*/
    t[52] + ""
  ), f, h, a, u, s = (
    /*displayMessages*/
    t[4].length > 1 && /*index*/
    t[54] === 0 && re(t)
  );
  function b(...g) {
    return (
      /*click_handler_1*/
      t[20](
        /*index*/
        t[54],
        ...g
      )
    );
  }
  return {
    c() {
      i = w("div"), r = w("div"), r.innerHTML = '<svg width="64px" height="64px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" stroke="#ffffff"><g id="SVGRepo_bgCarrier" stroke-width="0"></g><g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g><g id="SVGRepo_iconCarrier"><path d="M4.39254 16.2614C2.64803 13.1941 1.66074 9.71783 1.51646 6.15051C1.50127 5.77507 1.70918 5.42812 2.04153 5.25282L11.5335 0.246091C11.8254 0.0920859 12.1746 0.0920859 12.4665 0.246091L21.9585 5.25282C22.2908 5.42812 22.4987 5.77507 22.4835 6.15051C22.3393 9.71783 21.352 13.1941 19.6075 16.2614C17.8618 19.3307 15.4169 21.8869 12.4986 23.7001C12.1931 23.8899 11.8069 23.8899 11.5014 23.7001C8.58313 21.8869 6.13817 19.3307 4.39254 16.2614Z" fill="#fa9200"></path><path d="M8.25 12.75L11.25 15L17.25 9" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path></g></svg>', n = O(), l = w("p"), f = O(), s && s.c(), h = O(), P(r, "class", "IconVerification"), P(l, "class", "text"), P(i, "class", "CashierVerificationMessage"), T(
        i,
        "ShowAll",
        /*allVerificationsVisible*/
        t[5]
      );
    },
    m(g, v) {
      S(g, i, v), V(i, r), V(i, n), V(i, l), l.innerHTML = d, V(i, f), s && s.m(i, null), V(i, h), a || (u = U(i, "click", b), a = !0);
    },
    p(g, v) {
      t = g, v[0] & /*displayMessages*/
      16 && d !== (d = /*message*/
      t[52] + "") && (l.innerHTML = d), /*displayMessages*/
      t[4].length > 1 && /*index*/
      t[54] === 0 ? s ? s.p(t, v) : (s = re(t), s.c(), s.m(i, h)) : s && (s.d(1), s = null), v[0] & /*allVerificationsVisible*/
      32 && T(
        i,
        "ShowAll",
        /*allVerificationsVisible*/
        t[5]
      );
    },
    d(g) {
      g && C(i), s && s.d(), a = !1, u();
    }
  };
}
function se(t) {
  let i, r, n, l, d = (
    /*$_*/
    t[9]("verification.video.how-to") + ""
  ), f, h, a;
  return {
    c() {
      i = w("div"), r = w("div"), r.innerHTML = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M256 8C119.043 8 8 119.083 8 256c0 136.997 111.043 248 248 248s248-111.003 248-248C504 119.083 392.957 8 256 8zm0 448c-110.532 0-200-89.431-200-200 0-110.495 89.472-200 200-200 110.491 0 200 89.471 200 200 0 110.53-89.431 200-200 200zm107.244-255.2c0 67.052-72.421 68.084-72.421 92.863V300c0 6.627-5.373 12-12 12h-45.647c-6.627 0-12-5.373-12-12v-8.659c0-35.745 27.1-50.034 47.579-61.516 17.561-9.845 28.324-16.541 28.324-29.579 0-17.246-21.999-28.693-39.784-28.693-23.189 0-33.894 10.977-48.942 29.969-4.057 5.12-11.46 6.071-16.666 2.124l-27.824-21.098c-5.107-3.872-6.251-11.066-2.644-16.363C184.846 131.491 214.94 112 261.794 112c49.071 0 101.45 38.304 101.45 88.8zM298 368c0 23.159-18.841 42-42 42s-42-18.841-42-42 18.841-42 42-42 42 18.841 42 42z"></path></svg>', n = O(), l = w("div"), f = Fe(d), P(r, "class", "IconVideo"), P(l, "class", "CashierVerificationVideoLink"), T(
        l,
        "CashierVerificationVideoLinkDesktop",
        /*desktopView*/
        t[6]
      ), P(i, "class", "CashierVerificationVideo");
    },
    m(u, s) {
      S(u, i, s), V(i, r), V(i, n), V(i, l), V(l, f), h || (a = U(
        l,
        "click",
        /*click_handler_2*/
        t[21]
      ), h = !0);
    },
    p(u, s) {
      s[0] & /*$_*/
      512 && d !== (d = /*$_*/
      u[9]("verification.video.how-to") + "") && qe(f, d), s[0] & /*desktopView*/
      64 && T(
        l,
        "CashierVerificationVideoLinkDesktop",
        /*desktopView*/
        u[6]
      );
    },
    d(u) {
      u && C(i), h = !1, a();
    }
  };
}
function Ke(t) {
  let i, r = (
    /*displayMessages*/
    t[4] && te(t)
  );
  return {
    c() {
      i = w("div"), r && r.c(), P(i, "class", "CashierVerifications"), T(
        i,
        "CashierVerificationsDesktop",
        /*desktopView*/
        t[6]
      );
    },
    m(n, l) {
      S(n, i, l), r && r.m(i, null), t[22](i);
    },
    p(n, l) {
      /*displayMessages*/
      n[4] ? r ? r.p(n, l) : (r = te(n), r.c(), r.m(i, null)) : r && (r.d(1), r = null), l[0] & /*desktopView*/
      64 && T(
        i,
        "CashierVerificationsDesktop",
        /*desktopView*/
        n[6]
      );
    },
    i: J,
    o: J,
    d(n) {
      n && C(i), r && r.d(), t[22](null);
    }
  };
}
const Ye = "verification_explanation_video_widgets.MP4";
function Ge(t, i, r) {
  let n, l;
  Z(t, Ue, (e) => r(9, n = e)), Z(t, Ne, (e) => r(28, l = e)), Q.extend(He);
  let { endpoint: d } = i, { lang: f = "en" } = i, { translationurl: h = "" } = i, { clientstyling: a = "" } = i, { clientstylingurl: u = "" } = i, { session: s = "" } = i, { customerid: b = "" } = i, { ismobileview: g = "" } = i, { playersession: v = "" } = i, _, H = /* @__PURE__ */ new Set(), N = /* @__PURE__ */ new Set(), L, x, q, F = !0, j = !0, z = !1, I = "";
  var B;
  (function(e) {
    e.Manual = "Manual", e.ShuftiPro = "ShuftiPro";
  })(B || (B = {}));
  var E;
  (function(e) {
    e.Requested = "Requested";
  })(E || (E = {}));
  var p;
  (function(e) {
    e.Unknown = "Unknown", e.Unverified = "Unverified", e.InProgress = "InProgress", e.Failed = "Failed", e.Verified = "Verified", e.Referred = "Referred", e.True = "True", e.False = "False", e.AwaitingForResponse = "AwaitingForResponse";
  })(p || (p = {}));
  var M;
  (function(e) {
    e.Unknown = "Unknown", e.Documents = "Documents", e.Age = "Age", e.Pep = "Pep", e.Sanction = "Sanction", e.Aml = "Aml", e.ProofOfAddress = "ProofOfAddress", e.SourceOfWealth = "SourceOfWealth", e.SocialMedia = "SocialMedia", e.Biometric = "Biometric";
  })(M || (M = {}));
  const ne = [
    p.InProgress,
    p.Referred,
    p.AwaitingForResponse
  ], ae = () => {
    let e = h;
    if (e)
      return fetch(e).then((o) => o.json()).then((o) => {
        Object.keys(o).forEach((c) => {
          $(c, o[c]);
        });
      }).catch((o) => {
        console.log(o);
      });
  };
  Object.keys(ee).forEach((e) => {
    $(e, ee[e]);
  });
  const le = () => {
    je(f);
  }, ce = () => {
    let e = document.createElement("style");
    e.innerHTML = a, _.appendChild(e);
  }, fe = () => {
    let e = new URL(u), o = document.createElement("style");
    fetch(e.href).then((c) => c.text()).then((c) => {
      o.innerHTML = c, setTimeout(
        () => {
          _.appendChild(o);
        },
        1
      );
    });
  }, W = () => {
    r(18, x = ue());
    const e = new URL(`${d}/v1/player/${b}/verification/GetKYCCustomerStatus?language=${f}`), o = new Headers();
    o.append("accept", "application/json"), o.append("Content-Type", "application/json"), o.append("x-sessionid", `${v}`), o.append("X-Client-Request-Timestamp", Q.utc().format("YYYY-MM-DD HH:mm:ss.SSS"));
    const c = {
      method: "POST",
      headers: o,
      body: JSON.stringify({})
    };
    fetch(e, c).then((m) => m.json()).then((m) => {
      L = he(m.Verifications), L.VerificationStatuses.forEach((y) => {
        y.VerificationUrlType !== "Widget" && H.add(y.Vendor);
      }), r(4, q = Y());
    });
  }, de = () => {
    l && W();
  }, ue = () => {
    let e = (s || l).split(".")[1];
    if (e) {
      let o = JSON.parse(atob(e));
      return o.cdn + "/cashier/operator-assets/" + (o == null ? void 0 : o.mid);
    }
    return "";
  }, he = (e) => {
    var c;
    if (!e || !e.length)
      return {
        VerificationSummaryStatus: p.Unverified,
        VerificationStatuses: []
      };
    const o = pe(e);
    if (o && o.length) {
      const m = me(o);
      return {
        VerificationSummaryStatus: m.Status,
        VerificationUrl: (c = m.Flags) == null ? void 0 : c.DeferredUrlKey,
        VerificationStatuses: K(o, m.Status)
      };
    } else
      return {
        VerificationSummaryStatus: e.some((y) => y.Status === p.Failed) ? p.Failed : p.Verified,
        VerificationStatuses: K(e, [p.Failed])
      };
  }, me = (e) => e.reduce(
    (o, c) => o ? new Date(o) < new Date(c) ? c : o : c,
    0
  ), K = (e, o) => e.filter((c) => o.includes(c.Status)).map((c) => {
    var m, y;
    return {
      Type: c.Type,
      Vendor: c.VendorName,
      VerificationDocuments: c.Documents ? [...c.Documents] : [],
      VerificationUrlType: (m = c.FlowInfo) == null ? void 0 : m.Type,
      VerificationUrl: (y = c.FlowInfo) == null ? void 0 : y.Url
    };
  }), pe = (e) => e.filter((o) => ne.includes(o.Status) ? o.FlowInfo && o.FlowInfo.Url || ge(o) || ve(o) : !1), ge = (e) => {
    const o = e.Documents && e.VendorName === B.Manual, c = e.Documents && e.Documents.some((m) => m.Status === E.Requested);
    return o && c;
  }, ve = (e) => e.VendorName === B.ShuftiPro && e.Status === p.Referred, Y = () => {
    switch (L.VerificationSummaryStatus) {
      case p.InProgress:
        const e = [];
        return H.forEach((o) => {
          e.push(we(o));
        }), e;
      case p.Referred:
        return [n("verification.idenfy.referred-awaiting")];
      case p.Failed:
        return [n("verification.message.failed")];
    }
  }, we = (e) => {
    const o = L.VerificationStatuses.filter((c) => c.Vendor === e);
    if (e === B.ShuftiPro)
      return ye(o);
    {
      const c = n("verification.idenfy.link-name"), m = {
        link: `<a href="${o[0].VerificationUrl}" target="_blank">${c}</a>`
      };
      return n("verification.idenfy.in-progress", { values: m });
    }
  }, ye = (e) => {
    const o = [], c = {}, m = [
      M.Biometric,
      M.Documents,
      M.ProofOfAddress
    ];
    e.forEach((A) => {
      m.includes(A.Type) && (o.push(A.Type), c[A.Type] = ke(A, Ve(A.Type)));
    });
    let y = o.every((A) => N.has(A)), Ae = `verification.shuftipro.in-progress.${o.sort().join(".")}`;
    return y ? n("verification.shuftipro.validations-started") : n(Ae, { values: c });
  }, ke = (e, o) => `<a class="verificationLink ${e.Type}" href=" ${e.VerificationUrl} " target="_blank">${o}</a>`, Ve = (e) => n(`verification.shuftipro.link-name.${e}`), R = (e, o) => {
    if (e.stopPropagation(), e.target && (e.target.href || e.target.closest("a"))) {
      if (e.target.closest(".verificationLink")) {
        const c = e.target.className.split(" ")[1];
        N.add(c), r(4, q = Y());
      }
      return;
    }
    o === 0 && r(5, F = !F);
  }, Pe = () => {
    r(6, j = g === "false");
  }, be = () => {
    r(8, I = x + "/" + f + "/" + Ye);
    try {
      fetch(I, { method: "HEAD" }).then((e) => {
        r(7, z = e.ok);
      });
    } catch (e) {
      r(7, z = !1);
    }
  }, G = () => {
    window.postMessage({ type: "ShowCashierVideoModal" }, window.location.href);
  }, De = (e, o) => R(o, e), Ce = (e, o) => R(o, e), Se = () => G();
  function _e(e) {
    xe[e ? "unshift" : "push"](() => {
      _ = e, r(3, _);
    });
  }
  return t.$$set = (e) => {
    "endpoint" in e && r(12, d = e.endpoint), "lang" in e && r(13, f = e.lang), "translationurl" in e && r(14, h = e.translationurl), "clientstyling" in e && r(0, a = e.clientstyling), "clientstylingurl" in e && r(1, u = e.clientstylingurl), "session" in e && r(15, s = e.session), "customerid" in e && r(16, b = e.customerid), "ismobileview" in e && r(2, g = e.ismobileview), "playersession" in e && r(17, v = e.playersession);
  }, t.$$.update = () => {
    t.$$.dirty[0] & /*lang*/
    8192 && f && le(), t.$$.dirty[0] & /*endpoint, session, playersession*/
    167936 && d && s && v && W(), t.$$.dirty[0] & /*endpoint, session, playersession*/
    167936 && d && !s && v && de(), t.$$.dirty[0] & /*translationurl*/
    16384 && h && ae(), t.$$.dirty[0] & /*clientstyling, customStylingContainer*/
    9 && a && _ && ce(), t.$$.dirty[0] & /*clientstylingurl, customStylingContainer*/
    10 && u && _ && fe(), t.$$.dirty[0] & /*ismobileview*/
    4 && g && Pe(), t.$$.dirty[0] & /*staticCdnUrl*/
    262144 && x && be();
  }, [
    a,
    u,
    g,
    _,
    q,
    F,
    j,
    z,
    I,
    n,
    R,
    G,
    d,
    f,
    h,
    s,
    b,
    v,
    x,
    De,
    Ce,
    Se,
    _e
  ];
}
class Je extends Oe {
  constructor(i) {
    super(), Te(
      this,
      i,
      Ge,
      Ke,
      Be,
      {
        endpoint: 12,
        lang: 13,
        translationurl: 14,
        clientstyling: 0,
        clientstylingurl: 1,
        session: 15,
        customerid: 16,
        ismobileview: 2,
        playersession: 17
      },
      We,
      [-1, -1]
    );
  }
  get endpoint() {
    return this.$$.ctx[12];
  }
  set endpoint(i) {
    this.$$set({ endpoint: i }), k();
  }
  get lang() {
    return this.$$.ctx[13];
  }
  set lang(i) {
    this.$$set({ lang: i }), k();
  }
  get translationurl() {
    return this.$$.ctx[14];
  }
  set translationurl(i) {
    this.$$set({ translationurl: i }), k();
  }
  get clientstyling() {
    return this.$$.ctx[0];
  }
  set clientstyling(i) {
    this.$$set({ clientstyling: i }), k();
  }
  get clientstylingurl() {
    return this.$$.ctx[1];
  }
  set clientstylingurl(i) {
    this.$$set({ clientstylingurl: i }), k();
  }
  get session() {
    return this.$$.ctx[15];
  }
  set session(i) {
    this.$$set({ session: i }), k();
  }
  get customerid() {
    return this.$$.ctx[16];
  }
  set customerid(i) {
    this.$$set({ customerid: i }), k();
  }
  get ismobileview() {
    return this.$$.ctx[2];
  }
  set ismobileview(i) {
    this.$$set({ ismobileview: i }), k();
  }
  get playersession() {
    return this.$$.ctx[17];
  }
  set playersession(i) {
    this.$$set({ playersession: i }), k();
  }
}
ze(Je, { endpoint: {}, lang: {}, translationurl: {}, clientstyling: {}, clientstylingurl: {}, session: {}, customerid: {}, ismobileview: {}, playersession: {} }, [], [], !0);
export {
  Je as default
};
