import{Host,h}from"@stencil/core";import{state}from"../../../../store/upsell/index";import{isBusy}from"../../../../store/upsell/getters";import{preview,trackOffer}from"../../../../store/upsell/mutations";import{__}from"@wordpress/i18n";export class ScUpsell{componentWillLoad(){trackOffer(),preview()}render(){var e,s,t,a,c,o,i,l,d;const n=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)||__("Thank you!","surecart"),style:{"--sc-dashboard-module-spacing":"var(--sc-spacing-x-large)",textAlign:"center"}},h("span",{key:"c71a0eed59d771a96081f0f5dbe565b73f65b347",slot:"description"},(null===(c=null===(a=null==state?void 0:state.text)||void 0===a?void 0:a.success)||void 0===c?void 0:c.description)||__("Your purchase was successful. A receipt is on its way to your inbox.","surecart")),!!(null==n?void 0:n.name)&&!!(null==n?void 0:n.instructions)&&h("sc-alert",{key:"6ac05dbc57c36b4237067b6f825b81e3d7daec5c",type:"info",open:!0,style:{"text-align":"left"}},h("span",{key:"c4da44791c31c54f7553f98833ea54e9c51e3726",slot:"title"},null==n?void 0:n.name),h("div",{key:"aa7ffb085176b05b704b3e7cc8882bf99d507ae7",innerHTML:null==n?void 0:n.instructions})),h("sc-button",{key:"f0d51dc6ed1a7b41aecde1fe26b8d3337c4f8004",href:null===(i=null===(o=null===window||void 0===window?void 0:window.scData)||void 0===o?void 0:o.pages)||void 0===i?void 0:i.dashboard,size:"large",type:"primary",autofocus:!0},(null===(d=null===(l=null==state?void 0:state.text)||void 0===l?void 0:l.success)||void 0===d?void 0:d.button)||__("Continue","surecart"),h("sc-icon",{key:"12943ba8e153a0f9b535fa8f1e4079068f4aec53",name:"arrow-right",slot:"suffix"})))))}static get is(){return"sc-upsell"}static get encapsulation(){return"shadow"}static get originalStyleUrls(){return{$:["sc-upsell.scss"]}}static get styleUrls(){return{$:["sc-upsell.css"]}}}