"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./CashierConfirmModal-CiWxBakF.cjs");function y(i){t.append_styles(i,"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 b(i){let e,s,c,f,o,a,l,d;return{c(){e=t.element("div"),s=t.element("span"),c=t.text(i[0]),f=t.space(),o=t.element("button"),a=t.text(i[1]),t.attr(e,"class","CashierNotifications")},m(r,u){t.insert(r,e,u),t.append(e,s),t.append(s,c),t.append(e,f),t.append(e,o),t.append(o,a),i[6](e),l||(d=t.listen(o,"click",i[3]),l=!0)},p(r,[u]){u&1&&t.set_data(c,r[0]),u&2&&t.set_data(a,r[1])},i:t.noop,o:t.noop,d(r){r&&t.detach(e),i[6](null),l=!1,d()}}}function x(i,e,s){let{text:c}=e,{button:f}=e,{clientstyling:o=""}=e,{clientstylingurl:a=""}=e,l;const d=()=>{window.postMessage({type:"NotificationButtonClick"},window.location.href)},r=()=>{let n=document.createElement("style");n.innerHTML=o,l.appendChild(n)},u=()=>{let n=new URL(a),h=document.createElement("style");fetch(n.href).then(m=>m.text()).then(m=>{h.innerHTML=m,setTimeout(()=>{l.appendChild(h)},1)})};function p(n){t.binding_callbacks[n?"unshift":"push"](()=>{l=n,s(2,l)})}return i.$$set=n=>{"text"in n&&s(0,c=n.text),"button"in n&&s(1,f=n.button),"clientstyling"in n&&s(4,o=n.clientstyling),"clientstylingurl"in n&&s(5,a=n.clientstylingurl)},i.$$.update=()=>{i.$$.dirty&20&&o&&l&&r(),i.$$.dirty&36&&a&&l&&u()},[c,f,l,d,o,a,p]}class g extends t.SvelteComponent{constructor(e){super(),t.init(this,e,x,b,t.safe_not_equal,{text:0,button:1,clientstyling:4,clientstylingurl:5},y)}get text(){return this.$$.ctx[0]}set text(e){this.$$set({text:e}),t.flush()}get button(){return this.$$.ctx[1]}set button(e){this.$$set({button:e}),t.flush()}get clientstyling(){return this.$$.ctx[4]}set clientstyling(e){this.$$set({clientstyling:e}),t.flush()}get clientstylingurl(){return this.$$.ctx[5]}set clientstylingurl(e){this.$$set({clientstylingurl:e}),t.flush()}}t.create_custom_element(g,{text:{},button:{},clientstyling:{},clientstylingurl:{}},[],[],!0);exports.default=g;
