import { S as C, b as v, s as _, f as d, c as N, n as b, e as k, x as p, l as z, m as f, A as E, o as h, y as x, p as S, q as L, z as M, E as T } from "./CashierConfirmModal-untxGhsx.js";
function q(n) {
  N(n, "svelte-ags340", ".CashierNotifications{position:absolute;z-index:2;background-color:var(--emw--color-background, #111);color:var(--emw--color-white, #fff);display:flex;border-radius:var(--emw--border-radius-medium, 4px);align-items:center;gap:var(--emw--spacing-small, 12px);font-size:var(--emw--font-size-small, 14px);padding:var(--emw--spacing-small, 12px) var(--emw--spacing-medium, 15px);min-height:50px;pointer-events:auto;bottom:0;width:calc(100% - 30px)}.CashierNotifications span,.CashierNotifications button{font-family:inherit;border:none;font-variant:normal}.CashierNotifications span{line-height:normal}.CashierNotifications button{color:var(--emw--color-primary, #7EC51E);background-color:transparent;cursor:pointer;font-size:var(--emw--font-size-medium, 16px);font-style:normal;font-weight:var(--emw--font-weight-bold, 700);font-family:inherit}");
}
function H(n) {
  let t, s, r, u, l, a, i, m;
  return {
    c() {
      t = h("div"), s = h("span"), r = x(
        /*text*/
        n[0]
      ), u = S(), l = h("button"), a = x(
        /*button*/
        n[1]
      ), L(t, "class", "CashierNotifications");
    },
    m(o, c) {
      z(o, t, c), f(t, s), f(s, r), f(t, u), f(t, l), f(l, a), n[6](t), i || (m = E(
        l,
        "click",
        /*notificationClick*/
        n[3]
      ), i = !0);
    },
    p(o, [c]) {
      c & /*text*/
      1 && p(
        r,
        /*text*/
        o[0]
      ), c & /*button*/
      2 && p(
        a,
        /*button*/
        o[1]
      );
    },
    i: b,
    o: b,
    d(o) {
      o && k(t), n[6](null), i = !1, m();
    }
  };
}
function R(n, t, s) {
  let { text: r } = t, { button: u } = t, { clientstyling: l = "" } = t, { clientstylingurl: a = "" } = t, i;
  const m = () => {
    window.postMessage({ type: "NotificationButtonClick" }, window.location.href);
  }, o = () => {
    let e = document.createElement("style");
    e.innerHTML = l, i.appendChild(e);
  }, c = () => {
    let e = new URL(a), y = document.createElement("style");
    fetch(e.href).then((g) => g.text()).then((g) => {
      y.innerHTML = g, setTimeout(
        () => {
          i.appendChild(y);
        },
        1
      );
    });
  };
  function w(e) {
    M[e ? "unshift" : "push"](() => {
      i = e, s(2, i);
    });
  }
  return n.$$set = (e) => {
    "text" in e && s(0, r = e.text), "button" in e && s(1, u = e.button), "clientstyling" in e && s(4, l = e.clientstyling), "clientstylingurl" in e && s(5, a = e.clientstylingurl);
  }, n.$$.update = () => {
    n.$$.dirty & /*clientstyling, customStylingContainer*/
    20 && l && i && o(), n.$$.dirty & /*clientstylingurl, customStylingContainer*/
    36 && a && i && c();
  }, [
    r,
    u,
    i,
    m,
    l,
    a,
    w
  ];
}
class U extends C {
  constructor(t) {
    super(), v(
      this,
      t,
      R,
      H,
      _,
      {
        text: 0,
        button: 1,
        clientstyling: 4,
        clientstylingurl: 5
      },
      q
    );
  }
  get text() {
    return this.$$.ctx[0];
  }
  set text(t) {
    this.$$set({ text: t }), d();
  }
  get button() {
    return this.$$.ctx[1];
  }
  set button(t) {
    this.$$set({ button: t }), d();
  }
  get clientstyling() {
    return this.$$.ctx[4];
  }
  set clientstyling(t) {
    this.$$set({ clientstyling: t }), d();
  }
  get clientstylingurl() {
    return this.$$.ctx[5];
  }
  set clientstylingurl(t) {
    this.$$set({ clientstylingurl: t }), d();
  }
}
T(U, { text: {}, button: {}, clientstyling: {}, clientstylingurl: {} }, [], [], !0);
export {
  U as default
};
