import { S as Oe, b as Be, s as Me, f as y, c as Le, n as Z, e as C, J as O, m as S, p as w, v as V, w as X, K as Q, L as xe, D, q as T, A as qe, o as k, B as H, y as Fe, z as ze, E as Ie } from "./CashierConfirmModal-CoKn35XS.js";
import { a as Ee, i as Re, $ as Ue, b as He } from "./CashierError-2HPZABjH.js";
import { d as $, u as Ne, x as je } from "./CashierMethodDetails-DW31X8vw.js";
function ee(t, i) {
  Ee(t, i);
}
function We(t) {
  Re({
    fallbackLocale: "en"
  }), Ue.set(t);
}
const ie = {
  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-Q13et8h2.js").then(({ default: i }) => {
    !customElements.get("cashier-video-modal") && customElements.define("cashier-video-modal", i.element);
  });
}
function Ke(t) {
  Le(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 te(t, i, r) {
  const n = t.slice();
  return n[53] = i[r], n[55] = r, n;
}
function re(t) {
  let i, r, n, c, d = Q(
    /*displayMessages*/
    t[4]
  ), f = [];
  for (let a = 0; a < d.length; a += 1)
    f[a] = se(te(t, d, a));
  let h = (
    /*videoExists*/
    t[7] && ne(t)
  );
  return {
    c() {
      i = w("div");
      for (let a = 0; a < f.length; a += 1)
        f[a].c();
      r = T(), h && h.c(), n = T(), c = w("cashier-video-modal"), V(i, "class", "CashierVerificationsWrapper"), D(
        c,
        "clientstylingurl",
        /*clientstylingurl*/
        t[1]
      ), D(
        c,
        "clientstyling",
        /*clientstyling*/
        t[0]
      ), D(
        c,
        "ismobileview",
        /*ismobileview*/
        t[2]
      ), D(
        c,
        "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, c, u);
    },
    p(a, u) {
      if (u[0] & /*allVerificationsVisible, showAllVerifications, displayMessages*/
      1072) {
        d = Q(
          /*displayMessages*/
          a[4]
        );
        let s;
        for (s = 0; s < d.length; s += 1) {
          const P = te(a, d, s);
          f[s] ? f[s].p(P, u) : (f[s] = se(P), 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 = ne(a), h.c(), h.m(n.parentNode, n)) : h && (h.d(1), h = null), u[0] & /*clientstylingurl*/
      2 && D(
        c,
        "clientstylingurl",
        /*clientstylingurl*/
        a[1]
      ), u[0] & /*clientstyling*/
      1 && D(
        c,
        "clientstyling",
        /*clientstyling*/
        a[0]
      ), u[0] & /*ismobileview*/
      4 && D(
        c,
        "ismobileview",
        /*ismobileview*/
        a[2]
      ), u[0] & /*videoSrc*/
      256 && D(
        c,
        "videosrc",
        /*videoSrc*/
        a[8]
      );
    },
    d(a) {
      a && (C(i), C(r), C(n), C(c)), xe(f, a), h && h.d(a);
    }
  };
}
function oe(t) {
  let i, r, n;
  function c(...d) {
    return (
      /*click_handler*/
      t[19](
        /*index*/
        t[55],
        ...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>', V(i, "class", "CashierVerificationChevron");
    },
    m(d, f) {
      S(d, i, f), r || (n = H(i, "click", c), r = !0);
    },
    p(d, f) {
      t = d;
    },
    d(d) {
      d && C(i), r = !1, n();
    }
  };
}
function se(t) {
  let i, r, n, c, d = (
    /*message*/
    t[53] + ""
  ), f, h, a, u, s = (
    /*displayMessages*/
    t[4].length > 1 && /*index*/
    t[55] === 0 && oe(t)
  );
  function P(...g) {
    return (
      /*click_handler_1*/
      t[20](
        /*index*/
        t[55],
        ...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 = T(), c = w("p"), f = T(), s && s.c(), h = T(), V(r, "class", "IconVerification"), V(c, "class", "text"), V(i, "class", "CashierVerificationMessage"), O(
        i,
        "ShowAll",
        /*allVerificationsVisible*/
        t[5]
      );
    },
    m(g, v) {
      S(g, i, v), k(i, r), k(i, n), k(i, c), c.innerHTML = d, k(i, f), s && s.m(i, null), k(i, h), a || (u = H(i, "click", P), a = !0);
    },
    p(g, v) {
      t = g, v[0] & /*displayMessages*/
      16 && d !== (d = /*message*/
      t[53] + "") && (c.innerHTML = d), /*displayMessages*/
      t[4].length > 1 && /*index*/
      t[55] === 0 ? s ? s.p(t, v) : (s = oe(t), s.c(), s.m(i, h)) : s && (s.d(1), s = null), v[0] & /*allVerificationsVisible*/
      32 && O(
        i,
        "ShowAll",
        /*allVerificationsVisible*/
        t[5]
      );
    },
    d(g) {
      g && C(i), s && s.d(), a = !1, u();
    }
  };
}
function ne(t) {
  let i, r, n, c, 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 = T(), c = w("div"), f = ze(d), V(r, "class", "IconVideo"), V(c, "class", "CashierVerificationVideoLink"), O(
        c,
        "CashierVerificationVideoLinkDesktop",
        /*desktopView*/
        t[6]
      ), V(i, "class", "CashierVerificationVideo");
    },
    m(u, s) {
      S(u, i, s), k(i, r), k(i, n), k(i, c), k(c, f), h || (a = H(
        c,
        "click",
        /*click_handler_2*/
        t[21]
      ), h = !0);
    },
    p(u, s) {
      s[0] & /*$_*/
      512 && d !== (d = /*$_*/
      u[9]("verification.video.how-to") + "") && Fe(f, d), s[0] & /*desktopView*/
      64 && O(
        c,
        "CashierVerificationVideoLinkDesktop",
        /*desktopView*/
        u[6]
      );
    },
    d(u) {
      u && C(i), h = !1, a();
    }
  };
}
function Ye(t) {
  let i, r = (
    /*displayMessages*/
    t[4] && re(t)
  );
  return {
    c() {
      i = w("div"), r && r.c(), V(i, "class", "CashierVerifications"), O(
        i,
        "CashierVerificationsDesktop",
        /*desktopView*/
        t[6]
      );
    },
    m(n, c) {
      S(n, i, c), r && r.m(i, null), t[22](i);
    },
    p(n, c) {
      /*displayMessages*/
      n[4] ? r ? r.p(n, c) : (r = re(n), r.c(), r.m(i, null)) : r && (r.d(1), r = null), c[0] & /*desktopView*/
      64 && O(
        i,
        "CashierVerificationsDesktop",
        /*desktopView*/
        n[6]
      );
    },
    i: Z,
    o: Z,
    d(n) {
      n && C(i), r && r.d(), t[22](null);
    }
  };
}
const Ge = "verification_explanation_video_widgets.MP4";
function Je(t, i, r) {
  let n, c;
  X(t, He, (e) => r(9, n = e)), X(t, je, (e) => r(28, c = e)), $.extend(Ne);
  let { endpoint: d } = i, { lang: f = "en" } = i, { translationurl: h = "" } = i, { clientstyling: a = "" } = i, { clientstylingurl: u = "" } = i, { session: s = "" } = i, { customerid: P = "" } = i, { ismobileview: g = "" } = i, { playersession: v = "" } = i, _, N = /* @__PURE__ */ new Set(), j = /* @__PURE__ */ new Set(), L, x, F, z = !0, W = !0, I = !1, E = "";
  var B;
  (function(e) {
    e.Manual = "Manual", e.ShuftiPro = "ShuftiPro";
  })(B || (B = {}));
  var R;
  (function(e) {
    e.Requested = "Requested";
  })(R || (R = {}));
  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 ae = [
    p.InProgress,
    p.Referred,
    p.AwaitingForResponse
  ], le = () => {
    let e = h;
    if (e)
      return fetch(e).then((o) => o.json()).then((o) => {
        Object.keys(o).forEach((l) => {
          ee(l, o[l]);
        });
      }).catch((o) => {
        console.log(o);
      });
  };
  Object.keys(ie).forEach((e) => {
    ee(e, ie[e]);
  });
  const ce = () => {
    We(f);
  }, fe = () => {
    let e = document.createElement("style");
    e.innerHTML = a, _.appendChild(e);
  }, de = () => {
    let e = new URL(u), o = document.createElement("style");
    fetch(e.href).then((l) => l.text()).then((l) => {
      o.innerHTML = l, setTimeout(
        () => {
          _.appendChild(o);
        },
        1
      );
    });
  }, K = () => {
    r(18, x = me());
    const e = new URL(`${d}/v1/player/${P}/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", $.utc().format("YYYY-MM-DD HH:mm:ss.SSS"));
    const l = {
      method: "POST",
      headers: o,
      body: JSON.stringify({})
    };
    fetch(e, l).then((m) => m.json()).then((m) => {
      const b = ue(m == null ? void 0 : m.Verifications);
      L = pe(b), L.VerificationStatuses.forEach((q) => {
        q.VerificationUrlType !== "Widget" && N.add(q.Vendor);
      }), r(4, F = G());
    });
  }, ue = (e) => e ? e.sort((o, l) => new Date(l.Created).getTime() - new Date(o.Created).getTime()) : [], he = () => {
    c && K();
  }, me = () => {
    let e = (s || c).split(".")[1];
    if (e) {
      let o = JSON.parse(atob(e));
      return o.cdn + "/cashier/operator-assets/" + (o == null ? void 0 : o.mid);
    }
    return "";
  }, pe = (e) => {
    var l;
    if (!e || !e.length)
      return {
        VerificationSummaryStatus: p.Unverified,
        VerificationStatuses: []
      };
    const o = ve(e);
    if (o && o.length) {
      const m = ge(o);
      return {
        VerificationSummaryStatus: m.Status,
        VerificationUrl: (l = m.Flags) == null ? void 0 : l.DeferredUrlKey,
        VerificationStatuses: Y(o, m.Status)
      };
    } else
      return {
        VerificationSummaryStatus: e.some((b) => b.Status === p.Failed) ? p.Failed : p.Verified,
        VerificationStatuses: Y(e, [p.Failed])
      };
  }, ge = (e) => e.reduce(
    (o, l) => o ? new Date(o) < new Date(l) ? l : o : l,
    0
  ), Y = (e, o) => e.filter((l) => o.includes(l.Status)).map((l) => {
    var m, b;
    return {
      Type: l.Type,
      Vendor: l.VendorName,
      VerificationDocuments: l.Documents ? [...l.Documents] : [],
      VerificationUrlType: (m = l.FlowInfo) == null ? void 0 : m.Type,
      VerificationUrl: (b = l.FlowInfo) == null ? void 0 : b.Url
    };
  }), ve = (e) => e.filter((o) => ae.includes(o.Status) ? o.FlowInfo && o.FlowInfo.Url || we(o) || ye(o) : !1), we = (e) => {
    const o = e.Documents && e.VendorName === B.Manual, l = e.Documents && e.Documents.some((m) => m.Status === R.Requested);
    return o && l;
  }, ye = (e) => e.VendorName === B.ShuftiPro && e.Status === p.Referred, G = () => {
    switch (L.VerificationSummaryStatus) {
      case p.InProgress:
        const e = [];
        return N.forEach((o) => {
          e.push(ke(o));
        }), e;
      case p.Referred:
        return [n("verification.idenfy.referred-awaiting")];
      case p.Failed:
        return [n("verification.message.failed")];
    }
  }, ke = (e) => {
    const o = L.VerificationStatuses.filter((l) => l.Vendor === e);
    if (e === B.ShuftiPro)
      return Ve(o);
    {
      const l = n("verification.idenfy.link-name"), m = {
        link: `<a href="${o[0].VerificationUrl}" target="_blank">${l}</a>`
      };
      return n("verification.idenfy.in-progress", { values: m });
    }
  }, Ve = (e) => {
    const o = [], l = {}, m = [
      M.Biometric,
      M.Documents,
      M.ProofOfAddress
    ];
    e.forEach((A) => {
      m.includes(A.Type) && (o.push(A.Type), l[A.Type] = Pe(A, be(A.Type)));
    });
    let b = o.every((A) => j.has(A)), q = `verification.shuftipro.in-progress.${o.sort().join(".")}`;
    return b ? n("verification.shuftipro.validations-started") : n(q, { values: l });
  }, Pe = (e, o) => `<a class="verificationLink ${e.Type}" href=" ${e.VerificationUrl} " target="_blank">${o}</a>`, be = (e) => n(`verification.shuftipro.link-name.${e}`), U = (e, o) => {
    if (e.stopPropagation(), e.target && (e.target.href || e.target.closest("a"))) {
      if (e.target.closest(".verificationLink")) {
        const l = e.target.className.split(" ")[1];
        j.add(l), r(4, F = G());
      }
      return;
    }
    o === 0 && r(5, z = !z);
  }, De = () => {
    r(6, W = g === "false");
  }, Ce = () => {
    r(8, E = x + "/" + f + "/" + Ge);
    try {
      fetch(E, { method: "HEAD" }).then((e) => {
        r(7, I = e.ok);
      });
    } catch (e) {
      r(7, I = !1);
    }
  }, J = () => {
    window.postMessage({ type: "ShowCashierVideoModal" }, window.location.href);
  }, Se = (e, o) => U(o, e), _e = (e, o) => U(o, e), Ae = () => J();
  function Te(e) {
    qe[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, P = 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 && ce(), t.$$.dirty[0] & /*endpoint, session, playersession*/
    167936 && d && s && v && K(), t.$$.dirty[0] & /*endpoint, session, playersession*/
    167936 && d && !s && v && he(), t.$$.dirty[0] & /*translationurl*/
    16384 && h && le(), t.$$.dirty[0] & /*clientstyling, customStylingContainer*/
    9 && a && _ && fe(), t.$$.dirty[0] & /*clientstylingurl, customStylingContainer*/
    10 && u && _ && de(), t.$$.dirty[0] & /*ismobileview*/
    4 && g && De(), t.$$.dirty[0] & /*staticCdnUrl*/
    262144 && x && Ce();
  }, [
    a,
    u,
    g,
    _,
    F,
    z,
    W,
    I,
    E,
    n,
    U,
    J,
    d,
    f,
    h,
    s,
    P,
    v,
    x,
    Se,
    _e,
    Ae,
    Te
  ];
}
class Ze extends Oe {
  constructor(i) {
    super(), Be(
      this,
      i,
      Je,
      Ye,
      Me,
      {
        endpoint: 12,
        lang: 13,
        translationurl: 14,
        clientstyling: 0,
        clientstylingurl: 1,
        session: 15,
        customerid: 16,
        ismobileview: 2,
        playersession: 17
      },
      Ke,
      [-1, -1]
    );
  }
  get endpoint() {
    return this.$$.ctx[12];
  }
  set endpoint(i) {
    this.$$set({ endpoint: i }), y();
  }
  get lang() {
    return this.$$.ctx[13];
  }
  set lang(i) {
    this.$$set({ lang: i }), y();
  }
  get translationurl() {
    return this.$$.ctx[14];
  }
  set translationurl(i) {
    this.$$set({ translationurl: i }), y();
  }
  get clientstyling() {
    return this.$$.ctx[0];
  }
  set clientstyling(i) {
    this.$$set({ clientstyling: i }), y();
  }
  get clientstylingurl() {
    return this.$$.ctx[1];
  }
  set clientstylingurl(i) {
    this.$$set({ clientstylingurl: i }), y();
  }
  get session() {
    return this.$$.ctx[15];
  }
  set session(i) {
    this.$$set({ session: i }), y();
  }
  get customerid() {
    return this.$$.ctx[16];
  }
  set customerid(i) {
    this.$$set({ customerid: i }), y();
  }
  get ismobileview() {
    return this.$$.ctx[2];
  }
  set ismobileview(i) {
    this.$$set({ ismobileview: i }), y();
  }
  get playersession() {
    return this.$$.ctx[17];
  }
  set playersession(i) {
    this.$$set({ playersession: i }), y();
  }
}
Ie(Ze, { endpoint: {}, lang: {}, translationurl: {}, clientstyling: {}, clientstylingurl: {}, session: {}, customerid: {}, ismobileview: {}, playersession: {} }, [], [], !0);
export {
  Ze as default
};
