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