import{r as i,c as s,h as t}from"./p-dfbe004d.js";import{o as h,a as o}from"./p-10aa7556.js";import"./p-35c4916d.js";import"./p-1c2e2695.js";const l=class{constructor(t){i(this,t),this.scChange=s(this,"scChange",7),this.scClear=s(this,"scClear",7),this.scInput=s(this,"scInput",7),this.scFocus=s(this,"scFocus",7),this.scBlur=s(this,"scBlur",7),this.size="medium",this.value="",this.pill=!1,this.showLabel=!0,this.help="",this.disabled=!1,this.readonly=!1,this.required=!1,this.invalid=!1}async handleChange(){this.value=this.input.value,this.scChange.emit()}async reportValidity(){var i,s;return null===(s=null===(i=this.input)||void 0===i?void 0:i.reportValidity)||void 0===s?void 0:s.call(i)}componentWillLoad(){this.handleCheckoutChange(),this.removeChangeListener=h("checkout",(()=>this.handleCheckoutChange()))}disconnectedCallback(){this.removeChangeListener()}handleCheckoutChange(){var i,s,t,h,l,n;(null==this?void 0:this.value)||((null===(i=o.checkout)||void 0===i?void 0:i.phone)?this.value=null===(s=o.checkout)||void 0===s?void 0:s.phone:(null===(h=null===(t=o.checkout)||void 0===t?void 0:t.customer)||void 0===h?void 0:h.phone)&&(this.value=null===(n=null===(l=o.checkout)||void 0===l?void 0:l.customer)||void 0===n?void 0:n.phone))}render(){return t("sc-phone-input",{name:"phone",ref:i=>this.input=i,value:this.value,label:this.label,help:this.help,autocomplete:"phone",placeholder:this.placeholder,readonly:this.readonly,required:this.required,invalid:this.invalid,autofocus:this.autofocus,hasFocus:this.hasFocus,onScChange:()=>this.handleChange(),onScInput:()=>this.scInput.emit(),onScFocus:()=>this.scFocus.emit(),onScBlur:()=>this.scBlur.emit()})}};l.style=":host{display:block}";export{l as sc_customer_phone}