import{aw as j,j as e,ar as v,az as f,ax as o,O as a}from"./app-BgLa5dit.js";import{u as g}from"./DBvERro4.chunk.js";import{C as n}from"./CE2zsy03.chunk.js";import{C as y}from"./YSGwxiQJ.chunk.js";import{a as C}from"./CmeGmsFm.chunk.js";import{C as N}from"./BO07ARJN.chunk.js";import"./Zwjmkasg.chunk.js";import"./C9Rwpp7a.chunk.js";import"./CsH2Nu4a.chunk.js";import"./DJ0pq8J_.chunk.js";import"./CCcwLDvu.chunk.js";import"./DDfKZ_ng.chunk.js";import"./Bs6fQ2wT.chunk.js";import"./BUT90D7O.chunk.js";import"./C1fMRwzQ.chunk.js";import"./uachN0F4.chunk.js";import"./u6fIQ8Ti.chunk.js";const w="_card_1xpnd_1",S="_selected_1xpnd_6",i={card:w,selected:S};function z(){var p,x;const r=j(),{cftRegions:c,cftCountries:d,cftProvinces:l}=g(r.values.region,r.values.country,""),m=r.values.region&&((p=d.data)==null?void 0:p.length)>0,u=r.values.country&&((x=l.data)==null?void 0:x.length)>0,h=!c.hasCompleted;return e.jsxs("div",{className:"crm-studio-wizard-form",children:[e.jsx(y,{}),e.jsx("h1",{className:"h2 mb-3",children:"Customer Region"}),h?e.jsx("div",{className:"d-flex justify-content-center align-items-center mb-4",children:e.jsx(v,{as:"div",animation:"border",role:"status"})}):e.jsxs(f,{children:[e.jsx(o,{type:"radio",name:"region",id:"region",children:()=>{var t;return e.jsxs("div",{children:[e.jsx("h2",{className:"h5",children:"Select region"}),e.jsx("div",{className:"d-flex gap-3 mt-1",children:(t=c.data)==null?void 0:t.map(s=>e.jsx("div",{children:e.jsx(a,{onClick:()=>{s!==r.values.region&&r.setValues({...r.values,region:s,country:"",province:""})},className:`px-2 rounded d-flex justify-content-center align-items-center ${i.card} ${r.values.region===s?i.selected:""}`,children:s})},s))})]})}}),r.errors.region&&r.touched.region&&e.jsx(n,{errorMessage:r.errors.region}),m&&e.jsx(o,{type:"radio",name:"country",id:"country",children:()=>{var t;return e.jsxs("div",{className:"pt-1",children:[e.jsx("h2",{className:"h5",children:"Select country"}),e.jsx("div",{className:"d-flex gap-3 mt-1",children:(t=d.data)==null?void 0:t.map(s=>e.jsx("div",{children:e.jsx(a,{onClick:()=>{s!==r.values.country&&r.setValues({...r.values,country:s,province:""})},className:`px-2 rounded d-flex justify-content-center align-items-center  ${i.card} ${r.values.country===s?i.selected:""}`,children:s})},s))})]})}}),m&&r.errors.country&&r.touched.country&&e.jsx(n,{errorMessage:r.errors.country}),u&&e.jsx(o,{type:"radio",name:"province",id:"province",children:()=>{var t;return e.jsxs("div",{className:"pt-1",children:[e.jsx("h2",{className:"h5",children:"Select province"}),e.jsx("div",{className:"d-flex gap-3 mt-1 flex-wrap",children:(t=l.data)==null?void 0:t.map(s=>e.jsx("div",{children:e.jsx(a,{onClick:()=>{s!==r.values.province&&r.setFieldValue("province",s)},className:`px-2 rounded d-flex justify-content-center align-items-center  ${i.card} ${r.values.province===s?i.selected:""}`,children:s})},s))})]})}}),u&&r.errors.province&&r.touched.province&&e.jsx(n,{errorMessage:r.errors.province})]})]})}function G(r){return e.jsx(N,{queryParams:r.queryParams,currentStepId:C.CUSTOMER_REGION,children:e.jsx(z,{})})}export{G as CustomerWizardRegionView};
//# sourceMappingURL=CZPvadJm.chunk.js.map
