import{proxyCustomElement,HTMLElement,h,Host}from"@stencil/core/internal/client";import"./watchers2.js";import{s as state}from"./store.js";import{a as isBusy}from"./getters.js";import{t as trackOffer,p as preview}from"./mutations.js";import{d as defineCustomElement$8}from"./sc-alert2.js";import{d as defineCustomElement$7}from"./sc-block-ui2.js";import{d as defineCustomElement$6}from"./sc-button2.js";import{d as defineCustomElement$5}from"./sc-dashboard-module2.js";import{d as defineCustomElement$4}from"./sc-dialog2.js";import{d as defineCustomElement$3}from"./sc-icon2.js";import{d as defineCustomElement$2}from"./sc-spinner2.js";const scUpsellCss=":host{display:block}.confirm__icon{margin-bottom:var(--sc-spacing-medium);display:flex;justify-content:center}.confirm__icon-container{background:var(--sc-color-primary-500);width:55px;height:55px;border-radius:999999px;display:flex;align-items:center;justify-content:center;font-size:26px;line-height:1;color:white}",ScUpsellStyle0=scUpsellCss,ScUpsell$1=proxyCustomElement(class extends HTMLElement{constructor(){super(),this.__registerHost(),this.__attachShadow()}componentWillLoad(){trackOffer(),preview()}render(){var e,s,t,o,c,n,i,a,l;const d=null===(e=state.checkout)||void 0===e?void 0:e.manual_payment_method;return h(Host,{key:"20bce298c7b9408c722334096903abb9cb59229d"},h("slot",{key:"fa9cacb7af0ae3120afbd7f289df7f8f539d00af"}),isBusy()&&h("sc-block-ui",{key:"02d6413900e28b4b31e1fd1f3ca361e193963b65",style:{"z-index":"30","--sc-block-ui-position":"fixed"}}),h("sc-dialog",{key:"d1050d52b2635ed0ec48c4cb03319f9516996604",open:"complete"===state.loading,style:{"--body-spacing":"var(--sc-spacing-xxx-large)"},noHeader:!0,onScRequestClose:e=>e.preventDefault()},h("div",{key:"d950bd5caa790b421a4bd9b44a842f96af1ffa4f",class:"confirm__icon"},h("div",{key:"fb53fc6bfc865c18be6a81498ba6c5eaf9048aaf",class:"confirm__icon-container"},h("sc-icon",{key:"cd81a2a7b9b76e63233d2c64f51e9540fa65c39b",name:"check"}))),h("sc-dashboard-module",{key:"f0347549bc1c94a5ec5d5e84f0aca02f73db366f",heading:(null===(t=null===(s=null==state?void 0:state.text)||void 0===s?void 0:s.success)||void 0===t?void 0:t.title)||wp.i18n.__("Thank you!","surecart"),style:{"--sc-dashboard-module-spacing":"var(--sc-spacing-x-large)",textAlign:"center"}},h("span",{key:"c71a0eed59d771a96081f0f5dbe565b73f65b347",slot:"description"},(null===(c=null===(o=null==state?void 0:state.text)||void 0===o?void 0:o.success)||void 0===c?void 0:c.description)||wp.i18n.__("Your purchase was successful. A receipt is on its way to your inbox.","surecart")),!!(null==d?void 0:d.name)&&!!(null==d?void 0:d.instructions)&&h("sc-alert",{key:"6ac05dbc57c36b4237067b6f825b81e3d7daec5c",type:"info",open:!0,style:{"text-align":"left"}},h("span",{key:"c4da44791c31c54f7553f98833ea54e9c51e3726",slot:"title"},null==d?void 0:d.name),h("div",{key:"aa7ffb085176b05b704b3e7cc8882bf99d507ae7",innerHTML:null==d?void 0:d.instructions})),h("sc-button",{key:"f0d51dc6ed1a7b41aecde1fe26b8d3337c4f8004",href:null===(i=null===(n=null===window||void 0===window?void 0:window.scData)||void 0===n?void 0:n.pages)||void 0===i?void 0:i.dashboard,size:"large",type:"primary",autofocus:!0},(null===(l=null===(a=null==state?void 0:state.text)||void 0===a?void 0:a.success)||void 0===l?void 0:l.button)||wp.i18n.__("Continue","surecart"),h("sc-icon",{key:"12943ba8e153a0f9b535fa8f1e4079068f4aec53",name:"arrow-right",slot:"suffix"})))))}static get style(){return ScUpsellStyle0}},[1,"sc-upsell"]);function defineCustomElement$1(){"undefined"!=typeof customElements&&["sc-upsell","sc-alert","sc-block-ui","sc-button","sc-dashboard-module","sc-dialog","sc-icon","sc-spinner"].forEach((e=>{switch(e){case"sc-upsell":customElements.get(e)||customElements.define(e,ScUpsell$1);break;case"sc-alert":customElements.get(e)||defineCustomElement$8();break;case"sc-block-ui":customElements.get(e)||defineCustomElement$7();break;case"sc-button":customElements.get(e)||defineCustomElement$6();break;case"sc-dashboard-module":customElements.get(e)||defineCustomElement$5();break;case"sc-dialog":customElements.get(e)||defineCustomElement$4();break;case"sc-icon":customElements.get(e)||defineCustomElement$3();break;case"sc-spinner":customElements.get(e)||defineCustomElement$2()}}))}const ScUpsell=ScUpsell$1,defineCustomElement=defineCustomElement$1;export{ScUpsell,defineCustomElement};