import{W as _,ck as q,d as F,a as D,j as e,cl as U,c as r,aQ as d,aR as z,D as H,T as t,aj as V,ak as Y,t as a,aN as T,a9 as A,bA as J,E as K,L as Q,U as X,cm as Z,bJ as $,n as ee,a6 as se,cn as re,Z as le,G as S,aq as ae}from"../index.Crez7j-Y.bundle.js";import{R as te,a as ie}from"./RadioGroup.y4U8G8TN.bundle.js";function W(){var b,g,f,y,v,P,C,k;const[n]=_(),c=n.get("from")||window.location.href,M=n.get("category")||"인바디",{ProductCategoryEnum:h,methods:w,isPrivacyPolicyAgreed:I,togglePrivacyPolicyAgreed:R,onSubmitAsync:E}=q(c,M,"page"),{register:l,handleSubmit:L,control:u,setValue:p,trigger:m,formState:{errors:s}}=w,[N,x]=F.useState(!1),B=()=>{x(!1)},G=o=>{p("address",o.address),p("zipCode",o.zipCode),x(!1),m("address"),m("zipCode")},{isDesktop:O,isMobile:j}=D();return e.jsxs("form",{onSubmit:L(E),children:[e.jsx(U,{severity:"info",sx:{mb:2},children:"구매 문의를 남기시면 담당자가 확인 후 고객님께 연락드리겠습니다."}),e.jsxs(r,{display:"flex",flexDirection:"column",gap:1,children:[e.jsxs(r,{children:[e.jsx(d,{variant:"subtitle1",children:"제품군"}),O&&e.jsx(z,{name:"productCategory",control:u,render:({field:o})=>e.jsx(te,{...o,row:!0,children:h.options.map(i=>e.jsx(H,{value:i,control:e.jsx(ie,{}),label:e.jsx(t,{variant:"body",children:i})},i))})}),j&&e.jsx(z,{name:"productCategory",control:u,render:({field:o})=>e.jsx(V,{...o,fullWidth:!0,size:"small",MenuProps:{disableScrollLock:!0},children:h.options.map(i=>e.jsx(Y,{value:i,children:e.jsx(t,{variant:"subtitle1",children:i})},i))})})]}),e.jsxs(r,{children:[e.jsx(d,{variant:"subtitle1",children:"상호(소속)"}),e.jsx(a,{...l("companyName"),fullWidth:!0,size:"small",placeholder:"상호(소속)을 입력해주세요.",error:!!s.companyName,helperText:(b=s.companyName)==null?void 0:b.message})]}),e.jsxs(r,{children:[e.jsx(t,{variant:"subtitle1",children:"성함"}),e.jsx(a,{...l("name"),fullWidth:!0,size:"small",placeholder:"성함을 입력해주세요.",error:!!s.name,helperText:(g=s.name)==null?void 0:g.message})]}),e.jsxs(r,{children:[e.jsx(d,{variant:"subtitle1",children:"연락처"}),e.jsx(a,{...l("phoneNumber"),fullWidth:!0,size:"small",placeholder:"연락처를 입력해주세요.",error:!!s.phoneNumber,helperText:(f=s.phoneNumber)==null?void 0:f.message})]}),e.jsxs(r,{children:[e.jsx(t,{variant:"subtitle1",children:"이메일 주소"}),e.jsx(a,{...l("email"),fullWidth:!0,size:"small",placeholder:"이메일 주소를 입력해주세요.",error:!!s.email,helperText:(y=s.email)==null?void 0:y.message})]}),e.jsxs(r,{children:[e.jsx(d,{variant:"subtitle1",children:"주소"}),e.jsxs(r,{display:"flex",flexDirection:"column",gap:1,children:[e.jsxs(r,{display:"inline-flex",gap:1,alignItems:"center",flexDirection:"row",children:[e.jsx(a,{...l("zipCode"),size:"small",sx:{flex:j?1:3,bgcolor:T},inputProps:{readOnly:!0},error:!!s.zipCode,helperText:(v=s.zipCode)==null?void 0:v.message}),e.jsx(A,{id:"find-address-modal-button",variant:"outlined",color:"error",sx:{flex:1},onClick:()=>x(!0),children:"우편번호 검색"})]}),e.jsx(a,{...l("address"),fullWidth:!0,size:"small",placeholder:"우편변호를 검색하여 배송지를 입력해주세요.",inputProps:{readOnly:!0},sx:{bgcolor:T},error:!!s.address,helperText:(P=s.address)==null?void 0:P.message}),e.jsx(a,{...l("addressDetail"),fullWidth:!0,size:"small",placeholder:"상세주소를 입력해주세요.",error:!!s.addressDetail,helperText:(C=s.addressDetail)==null?void 0:C.message})]})]}),e.jsxs(r,{children:[e.jsx(t,{variant:"subtitle1",children:"문의 내용"}),e.jsx(a,{...l("content"),fullWidth:!0,size:"small",inputProps:{style:{padding:0}},multiline:!0,rows:3,placeholder:"문의 내용을 입력해주세요.",error:!!s.content,helperText:(k=s.content)==null?void 0:k.message})]}),e.jsx(r,{my:1,children:e.jsxs(J,{sx:{whiteSpace:"wrap"},children:[e.jsx(K,{sx:{py:0,pl:0},checked:I,onChange:R}),e.jsxs(t,{variant:"body",children:[e.jsx(Q,{variant:"body",href:X.PRIVACY_POLICY,target:"_blank",sx:{color:Z},children:"개인정보 수집 및 이용약관"}),"을 확인하였으며, 이에 동의합니다."]})]})}),e.jsx(A,{type:"submit",fullWidth:!0,variant:"contained",color:"black",sx:{py:1},children:e.jsx(t,{variant:"body",children:"문의 신청"})}),e.jsx($,{open:N,onModalClose:B,onAddressSelect:G})]})]})}function de(){const{isMobile:n,isDesktop:c}=D();return e.jsxs(e.Fragment,{children:[c&&e.jsx(r,{bgcolor:ee,py:8,component:"main",children:e.jsx(r,{bgcolor:se,width:re,mx:"auto",borderRadius:2,p:10,children:e.jsxs(r,{width:700,m:"auto",display:"flex",flexDirection:"column",gap:3,children:[e.jsx(t,{variant:"title",children:"구매 문의"}),e.jsx(W,{})]})})}),n&&e.jsxs(le,{children:[e.jsx(S,{item:!0,desktop:10,mobile:12,mx:"auto",component:"article",children:e.jsx(ae,{title:"구매 문의"})}),e.jsx(S,{item:!0,desktop:10,mobile:11,mt:3,mx:"auto",component:"article",children:e.jsx(W,{})})]})]})}export{de as default};