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,c,o,a,i,l,d;const n=null===(e=state.checkout)||void 0===e?void 0:e.manual_payment_method;return h(Host,{key:"265d1e33c0e48a3e133ca523e56cbb121df5f947"},h("slot",{key:"baf81adf55e3cf252f2623341cbeb62bf7a86093"}),isBusy()&&h("sc-block-ui",{key:"b188f69bcd10d23797e099f1c74298b8b013cc5d",style:{"z-index":"30","--sc-block-ui-position":"fixed"}}),h("sc-dialog",{key:"306d16fc510dc1abdd79fd0c728cf050cd9902c7",open:"complete"===state.loading,style:{"--body-spacing":"var(--sc-spacing-xxx-large)"},noHeader:!0,onScRequestClose:e=>e.preventDefault()},h("div",{key:"9e0235e66e4bd2e73991925ee83a1fe661f8525f",class:"confirm__icon"},h("div",{key:"c7b15fae542b50bc70a1be8b93b3faaf50c85f08",class:"confirm__icon-container"},h("sc-icon",{key:"ab4201d117a356cb9292fdbaf1ee458ed40a5c4e",name:"check"}))),h("sc-dashboard-module",{key:"24536ea537ede8ed42d03144f547c668d66ea539",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:"a44463227785e00dbea056caf0c7f385c834d922",slot:"description"},(null===(o=null===(c=null==state?void 0:state.text)||void 0===c?void 0:c.success)||void 0===o?void 0:o.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:"55a3d0104c8b4337fde61a72cca6c389461210cb",type:"info",open:!0,style:{"text-align":"left"}},h("span",{key:"e3246f0d7e29e169cc8499253a0bf877f6cf2880",slot:"title"},null==n?void 0:n.name),h("div",{key:"e9f627a6faf27ada7246f85cc12920405c074f10",innerHTML:null==n?void 0:n.instructions})),h("sc-button",{key:"bb6d5b94b6c96a91a6d2db06b181843e173834f7",href:null===(i=null===(a=null===window||void 0===window?void 0:window.scData)||void 0===a?void 0:a.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:"f9fe742c68227ba107d62029af64f3b4a5b7f860",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"]}}}