import { S as N, b as U, s as Z, f as C, c as F, n as v, e as k, D as c, C as R, v as b, m as E, o as L, B, p as y, q as H, A as P, E as G } from "./CashierConfirmModal-CNzEOcOZ.js";
import { a as J, i as K, $ as Q } from "./CashierError-DUTIaWmP.js";
function T(i, e) {
  J(i, e);
}
function V(i) {
  K({
    fallbackLocale: "en"
  }), Q.set(i);
}
const D = {
  en: {
    redirectHeader: "Deposit redirect"
  },
  "pt-br": {
    redirectHeader: "Redirecionar depósito"
  },
  "es-mx": {
    redirectHeader: "Redirigir depósito"
  },
  tr: {
    redirectHeader: "Para yatırma yönlendirmesi"
  },
  "en-us": {
    redirectHeader: "Deposit redirect"
  }
};
if (typeof window != "undefined") {
  let i = function(e) {
    return function(...t) {
      try {
        return e.apply(this, t);
      } catch (l) {
        if (l instanceof DOMException && l.message.includes("has already been used with this registry") || l.message.includes("Cannot define multiple custom elements with the same tag name"))
          return !1;
        throw l;
      }
    };
  };
  customElements.define = i(customElements.define), import("./CashierHeader-8k60mA2q.js").then(({ default: e }) => {
    !customElements.get("cashier-header") && customElements.define("cashier-header", e.element);
  });
}
if (typeof window != "undefined") {
  let i = function(e) {
    return function(...t) {
      try {
        return e.apply(this, t);
      } catch (l) {
        if (l instanceof DOMException && l.message.includes("has already been used with this registry") || l.message.includes("Cannot define multiple custom elements with the same tag name"))
          return !1;
        throw l;
      }
    };
  };
  customElements.define = i(customElements.define), import("./CashierSpinner-C6y-LmOW.js").then(({ default: e }) => {
    !customElements.get("cashier-spinner") && customElements.define("cashier-spinner", e.element);
  });
}
function W(i) {
  F(i, "svelte-10xutbi", ".CashierRedirectIframe{height:inherit;width:inherit}iframe{border-radius:0 0 6px 6px;border:1px solid var(--mmw--color-grey-105, #E8E9EB);height:calc(100% - var(--mmw--header-height, 40px));width:100%;box-sizing:border-box}.CashierHeaderLeftButton{color:var(--mmw--color-grey-10, #111);font-size:var(--emw--font-size-small, 14px);font-weight:var(--emw--font-weight-semibold, 500);margin-bottom:0;position:absolute;display:flex;align-items:center;font-variant:all-small-caps;height:32px;left:7px;gap:2px;cursor:pointer}.CashierHeaderLeftButton svg path{fill:var(--mmw--color-grey-10, #111)}.CashierHeaderRightButton{position:absolute;display:flex;justify-content:space-between;align-items:center;padding:0 var(--emw--spacing-small, 12px);height:inherit;right:0;gap:var(--emw--spacing-small, 12px);cursor:pointer}");
}
function S(i) {
  let e, t, l;
  return {
    c() {
      e = y("div"), e.innerHTML = '<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="none"><path fill-rule="evenodd" clip-rule="evenodd" d="M12.5632 3.47782C12.4787 3.50138 12.3362 3.57505 12.2465 3.64153C12.1567 3.70806 10.8069 5.04216 9.24694 6.60626C6.11944 9.74192 6.25999 9.58204 6.25999 10.0037C6.25999 10.4243 6.13093 10.2784 9.34296 13.4903C12.4449 16.5921 12.356 16.5116 12.7278 16.5556C13.1855 16.6098 13.6413 16.2585 13.7301 15.783C13.7612 15.6164 13.7212 15.3395 13.6437 15.1847C13.6158 15.129 12.451 13.9396 11.0553 12.5417L8.51768 10L11.0553 7.45837C12.451 6.06048 13.6158 4.87114 13.6437 4.81544C13.7729 4.55751 13.7703 4.2006 13.6374 3.94274C13.4469 3.5731 12.9668 3.36532 12.5632 3.47782Z" fill="#111111"></path></svg>', b(e, "slot", "leftButton"), b(e, "class", "CashierHeaderLeftButton");
    },
    m(u, h) {
      E(u, e, h), t || (l = B(
        e,
        "click",
        /*close*/
        i[9]
      ), t = !0);
    },
    p: v,
    d(u) {
      u && k(e), t = !1, l();
    }
  };
}
function I(i) {
  let e, t, l;
  return {
    c() {
      e = y("div"), e.innerHTML = '<svg xmlns="http://www.w3.org/2000/svg" width="13" height="20" viewBox="0 0 13 13" fill="none"><path d="M12.7711 0.229435C13.0582 0.517619 13.0755 0.973729 12.8215 1.28141L12.7711 1.33721L7.60685 6.50068L12.7711 11.6641C12.9128 11.8066 12.9944 11.998 12.999 12.1988C13.0035 12.3997 12.9308 12.5946 12.7957 12.7433C12.6606 12.892 12.4735 12.9832 12.2731 12.9979C12.0728 13.0126 11.8744 12.9497 11.7191 12.8223L11.6633 12.7719L6.49958 7.60791L1.3359 12.7719C1.19349 12.9136 1.00207 12.9952 0.801203 12.9998C0.60034 13.0044 0.405398 12.9316 0.256676 12.7965C0.107955 12.6614 0.0168256 12.4744 0.00212786 12.274C-0.0125699 12.0736 0.0502877 11.8753 0.177706 11.7199L0.228086 11.6641L5.3923 6.50068L0.228086 1.33721C0.0863637 1.1948 0.00478102 1.00338 0.000203544 0.802529C-0.00437393 0.601674 0.0684038 0.40674 0.203491 0.258024C0.338579 0.109308 0.525647 0.0181829 0.726024 0.00348576C0.9264 -0.0112114 1.12476 0.0516437 1.28011 0.179057L1.3359 0.229435L6.49958 5.39345L11.6633 0.229435C11.736 0.156695 11.8223 0.0989949 11.9174 0.0596283C12.0124 0.0202617 12.1143 0 12.2172 0C12.32 0 12.4219 0.0202617 12.5169 0.0596283C12.612 0.0989949 12.6983 0.156695 12.7711 0.229435Z" fill="#111111"></path></svg>', b(e, "slot", "rightButton"), b(e, "class", "CashierHeaderRightButton");
    },
    m(u, h) {
      E(u, e, h), t || (l = B(
        e,
        "click",
        /*close*/
        i[9]
      ), t = !0);
    },
    p: v,
    d(u) {
      u && k(e), t = !1, l();
    }
  };
}
function O(i) {
  let e;
  return {
    c() {
      e = y("cashier-spinner"), c(
        e,
        "clientstylingurl",
        /*clientstylingurl*/
        i[5]
      ), c(
        e,
        "clientstyling",
        /*clientstyling*/
        i[4]
      );
    },
    m(t, l) {
      E(t, e, l);
    },
    p(t, l) {
      l & /*clientstylingurl*/
      32 && c(
        e,
        "clientstylingurl",
        /*clientstylingurl*/
        t[5]
      ), l & /*clientstyling*/
      16 && c(
        e,
        "clientstyling",
        /*clientstyling*/
        t[4]
      );
    },
    d(t) {
      t && k(e);
    }
  };
}
function X(i) {
  let e, t, l, u, h, d, g, w, _, a = !!/*showbackbutton*/
  i[3] && /*showbackbutton*/
  i[3] !== "false" && S(i), r = (!/*showbackbutton*/
  i[3] || /*showbackbutton*/
  i[3] === "false") && I(i), o = (
    /*isLoading*/
    i[8] && O(i)
  );
  return {
    c() {
      e = y("div"), t = y("cashier-header"), a && a.c(), l = H(), r && r.c(), u = H(), o && o.c(), h = H(), d = y("iframe"), c(
        t,
        "lang",
        /*lang*/
        i[0]
      ), c(
        t,
        "translationurl",
        /*translationurl*/
        i[2]
      ), c(
        t,
        "title",
        /*title*/
        i[6]
      ), c(
        t,
        "showbackbutton",
        /*showbackbutton*/
        i[3]
      ), c(
        t,
        "clientstylingurl",
        /*clientstylingurl*/
        i[5]
      ), c(
        t,
        "clientstyling",
        /*clientstyling*/
        i[4]
      ), R(d.src, g = /*iframeurl*/
      i[1]) || b(d, "src", g), b(d, "frameborder", "0"), b(e, "class", "CashierRedirectIframe");
    },
    m(s, f) {
      E(s, e, f), L(e, t), a && a.m(t, null), L(t, l), r && r.m(t, null), L(e, u), o && o.m(e, null), L(e, h), L(e, d), i[12](e), w || (_ = B(
        d,
        "load",
        /*load_handler*/
        i[11]
      ), w = !0);
    },
    p(s, [f]) {
      /*showbackbutton*/
      s[3] && /*showbackbutton*/
      s[3] !== "false" ? a ? a.p(s, f) : (a = S(s), a.c(), a.m(t, l)) : a && (a.d(1), a = null), !/*showbackbutton*/
      s[3] || /*showbackbutton*/
      s[3] === "false" ? r ? r.p(s, f) : (r = I(s), r.c(), r.m(t, null)) : r && (r.d(1), r = null), f & /*lang*/
      1 && c(
        t,
        "lang",
        /*lang*/
        s[0]
      ), f & /*translationurl*/
      4 && c(
        t,
        "translationurl",
        /*translationurl*/
        s[2]
      ), f & /*title*/
      64 && c(
        t,
        "title",
        /*title*/
        s[6]
      ), f & /*showbackbutton*/
      8 && c(
        t,
        "showbackbutton",
        /*showbackbutton*/
        s[3]
      ), f & /*clientstylingurl*/
      32 && c(
        t,
        "clientstylingurl",
        /*clientstylingurl*/
        s[5]
      ), f & /*clientstyling*/
      16 && c(
        t,
        "clientstyling",
        /*clientstyling*/
        s[4]
      ), /*isLoading*/
      s[8] ? o ? o.p(s, f) : (o = O(s), o.c(), o.m(e, h)) : o && (o.d(1), o = null), f & /*iframeurl*/
      2 && !R(d.src, g = /*iframeurl*/
      s[1]) && b(d, "src", g);
    },
    i: v,
    o: v,
    d(s) {
      s && k(e), a && a.d(), r && r.d(), o && o.d(), i[12](null), w = !1, _();
    }
  };
}
function Y(i, e, t) {
  let { lang: l = "en" } = e, { iframeurl: u } = e, { translationurl: h = "" } = e, { showbackbutton: d = "" } = e, { clientstyling: g = "" } = e, { clientstylingurl: w = "" } = e, { title: _ = "" } = e, a = !0, r;
  const o = () => {
    let n = h;
    if (n)
      return fetch(n).then((m) => m.json()).then((m) => {
        Object.keys(m).forEach((p) => {
          T(p, m[p]);
        });
      }).catch((m) => {
        console.log(m);
      });
  };
  Object.keys(D).forEach((n) => {
    T(n, D[n]);
  });
  const s = () => {
    V(l);
  }, f = () => {
    let n = document.createElement("style");
    n.innerHTML = g, r.appendChild(n);
  }, j = () => {
    let n = new URL(w), m = document.createElement("style");
    fetch(n.href).then((p) => p.text()).then((p) => {
      m.innerHTML = p, setTimeout(
        () => {
          r.appendChild(m);
        },
        1
      );
    });
  }, A = () => {
    window.postMessage({ type: "CloseIframe" }, window.location.href);
  }, M = (n) => {
    n.target.src && t(8, a = !1);
  }, q = (n) => M(n);
  function z(n) {
    P[n ? "unshift" : "push"](() => {
      r = n, t(7, r);
    });
  }
  return i.$$set = (n) => {
    "lang" in n && t(0, l = n.lang), "iframeurl" in n && t(1, u = n.iframeurl), "translationurl" in n && t(2, h = n.translationurl), "showbackbutton" in n && t(3, d = n.showbackbutton), "clientstyling" in n && t(4, g = n.clientstyling), "clientstylingurl" in n && t(5, w = n.clientstylingurl), "title" in n && t(6, _ = n.title);
  }, i.$$.update = () => {
    i.$$.dirty & /*lang*/
    1 && l && s(), i.$$.dirty & /*translationurl*/
    4 && h && o(), i.$$.dirty & /*clientstyling, customStylingContainer*/
    144 && g && r && f(), i.$$.dirty & /*clientstylingurl, customStylingContainer*/
    160 && w && r && j();
  }, [
    l,
    u,
    h,
    d,
    g,
    w,
    _,
    r,
    a,
    A,
    M,
    q,
    z
  ];
}
class x extends N {
  constructor(e) {
    super(), U(
      this,
      e,
      Y,
      X,
      Z,
      {
        lang: 0,
        iframeurl: 1,
        translationurl: 2,
        showbackbutton: 3,
        clientstyling: 4,
        clientstylingurl: 5,
        title: 6
      },
      W
    );
  }
  get lang() {
    return this.$$.ctx[0];
  }
  set lang(e) {
    this.$$set({ lang: e }), C();
  }
  get iframeurl() {
    return this.$$.ctx[1];
  }
  set iframeurl(e) {
    this.$$set({ iframeurl: e }), C();
  }
  get translationurl() {
    return this.$$.ctx[2];
  }
  set translationurl(e) {
    this.$$set({ translationurl: e }), C();
  }
  get showbackbutton() {
    return this.$$.ctx[3];
  }
  set showbackbutton(e) {
    this.$$set({ showbackbutton: e }), C();
  }
  get clientstyling() {
    return this.$$.ctx[4];
  }
  set clientstyling(e) {
    this.$$set({ clientstyling: e }), C();
  }
  get clientstylingurl() {
    return this.$$.ctx[5];
  }
  set clientstylingurl(e) {
    this.$$set({ clientstylingurl: e }), C();
  }
  get title() {
    return this.$$.ctx[6];
  }
  set title(e) {
    this.$$set({ title: e }), C();
  }
}
G(x, { lang: {}, iframeurl: {}, translationurl: {}, showbackbutton: {}, clientstyling: {}, clientstylingurl: {}, title: {} }, [], [], !0);
export {
  x as default
};
