import{_ as y}from"./BasePage-C3DiNX0e.js";import{_ as f}from"./AddressForm-D5NP75jV.js";import{u as g,O as v,c as i}from"./index-_-ijfL1Q.js";import{u as C}from"./usePaymentMethods-B3q2fI3f.js";import{l as h,r as S,k as m,f as _,h as P,o as k,w as N,a as x,u as z}from"./index-DRopsKkO.js";import"./USelect.vue_vue_type_script_setup_true_lang-BgoCOcXc.js";import"./ULabel.vue_vue_type_script_setup_true_lang-B9XE8rwf.js";import"./UDivider.vue_vue_type_script_setup_true_lang-CGxguuHo.js";import"./useMutationObserver-DtW-3lQD.js";import"./UInput.vue_vue_type_script_setup_true_lang-eIU5RwOc.js";const M={__name:"Page",setup(A){const e=g(),{activatePaymentMethods:o}=C(e),t=h({accountName:"",address:"",city:"",state:"",zipCode:""}),s=S([]),p=m(()=>{var a;return!t.accountName||!t.address||!t.city||!t.zipCode||((a=s.value)==null?void 0:a.length)>0&&!t.state}),c=m(()=>{let a=1;return e.payments.banktransfer.isActive&&(a=3),a}),u=m(()=>{let a=1;return e.payments.banktransfer.isActive&&(a=3),a}),d=m(()=>e.payments.banktransfer.isActive?{name:"GettingStarted/Payments/Step3"}:{name:"GettingStarted/Payments/Step1"});_(async()=>{var a;e.hasCompanyData||await e.getCompany(),e.hasPaymentData||await e.getPayments(),s.value=e.statesForSelectedCountry,t.state=((a=s.value)==null?void 0:a.length)&&(e.payments.mailin.params.state||e.company.address.state||""),t.accountName=e.payments.mailin.params.accountName,t.address=e.payments.mailin.params.address||e.company.address.streetAddress,t.city=e.payments.mailin.params.city||e.company.address.city,t.zipCode=e.payments.mailin.params.zipCode||e.company.address.zip});async function l(a){var n;(i(t,e.payments)||i(t,e.payments.mailin.params))&&(e.payments.mailin.params.accountName=String(t.accountName),e.payments.mailin.params.address=t.address,e.payments.mailin.params.city=t.city,e.payments.mailin.params.state=(n=s.value)!=null&&n.length?t.state:"",e.payments.mailin.params.zipCode=t.zipCode,await o()),a()}return(a,r)=>(k(),P(y,{group:a.$t("group.payments"),"group-step":z(v)*4,title:a.$t("title.checkPayment"),description:a.$t("pageDescription.checkPayment"),step:c.value,"max-steps":u.value,"prevent-next":p.value,prev:d.value,next:{name:"GettingStarted/Domains/Step1"},onContinue:l},{default:N(()=>[x(f,{modelValue:t,"onUpdate:modelValue":r[0]||(r[0]=n=>t=n),states:s.value},null,8,["modelValue","states"])]),_:1},8,["group","group-step","title","description","step","max-steps","prevent-next","prev"]))}};export{M as default};
