import{_ as e}from"./CO2Nw6qc.js";import{_ as a}from"./DHEi_Tis.js";import{_ as l}from"./DM8RJc9W.js";import{_ as t}from"./BXles9rK.js";import{u as n,a as s,b as o,l as p}from"./arA1miDk.js";import{c as r,a as i}from"./phuT2Rrd.js";import{c as m,B as u,L as c,M as d,$ as h,a2 as b,x as v,P as g,u as F,V as _,Z as y,W as R}from"./CFGNYEIb.js";import"./CAFZTnck.js";import"./vtHCjVGu.js";import"./DXf-yl0A.js";import"./Cgx_ccjr.js";const S={class:"bg-[#F6F7FC] py-6 lg:py-10 px-2 lg:px-14 h-fit"},f={class:"font-bold text-3xl lg:mb-12 mb-6"},x={class:"grid grid-cols-1 [&_label]:!bg-[#F6F7FC] [&_input]:!bg-[#FFFFFF03] [&_button[aria-haspopup=listbox]]:!bg-[#FFFFFF03] gap-8"},E={class:"[&_textarea]:!h-[160px] [&_textarea]:!bg-[#FFFFFF03] [&_textarea]:!p-6"},$=["loading"],j={__name:"contact-us",setup(j){const L=n(),U=s().$axios,I=m(!1),{t:A}=o(),O=m(r().shape({phone:r().shape({phone_number:i().required(A("ERRORS.phone")).test("phone-length",(function(e){const{phone_limit:a}=this.parent;return!!e&&(e.length===a||this.createError({message:A("ERRORS.phone_limit",{phone_limit:a})}))}))}),name:i().required(A("ERRORS.name")),email:i().email(A("ERRORS.invalid_email")).required(A("ERRORS.email")),country:r().required(A("ERRORS.country")),message:i().required(A("ERRORS.message"))})),B=m({}),N=m(!1),P=m(null),T=async(e,a)=>{N.value=!0;const l=new FormData;l.append("full_name",e.name),l.append("email",e.email),l.append("country_id",e.country.id),l.append("content",e.message),l.append("phone_code",e.phone.phone_code),l.append("phone",e.phone.phone_number),U.post("contact-us",l).then((e=>{I.value=!0,B.value={},a.resetForm(),P.value.clearInput()})).catch((e=>{p.error(e.response.data.message)})).finally((()=>{N.value=!1}))};return(n,s)=>{const o=e,p=a,r=l,i=u("VeeForm"),m=t;return c(),d("div",S,[h("h3",f,b(n.$t("NAV.contact")),1),v(i,{"validation-schema":F(O),onSubmit:T,initialValues:F(B)},{default:g((()=>[h("div",x,[h("div",null,[v(o,{name:"name",label:n.$t("LABELS.name"),placeholder:n.$t("INPUTS.name"),type:"text",value:F(B).name,"onUpdate:value":s[0]||(s[0]=e=>F(B).name=e)},null,8,["label","placeholder","value"])]),h("div",null,[v(p,{name:"phone",label:n.$t("LABELS.phone"),placeholder:n.$t("INPUTS.phone"),value:F(B).phone,"onUpdate:value":s[1]||(s[1]=e=>F(B).phone=e),ref_key:"phoneInput",ref:P},null,8,["label","placeholder","value"])]),h("div",null,[v(o,{name:"email",label:n.$t("LABELS.email"),placeholder:n.$t("INPUTS.email"),type:"email",value:F(B).email,"onUpdate:value":s[2]||(s[2]=e=>F(B).email=e)},null,8,["label","placeholder","value"])]),h("div",null,[v(r,{name:"country",label:n.$t("LABELS.country"),placeholder:n.$t("INPUTS.country"),value:F(B).country,"onUpdate:value":s[3]||(s[3]=e=>F(B).country=e),items:F(L).countries},null,8,["label","placeholder","value","items"])]),h("div",E,[v(o,{name:"message",type:"textarea",label:n.$t("LABELS.message"),placeholder:n.$t("INPUTS.message"),value:F(B).message,"onUpdate:value":s[4]||(s[4]=e=>F(B).message=e)},null,8,["label","placeholder","value"])]),h("div",null,[h("button",{loading:F(N),type:"submit",class:"base-btn capitalize !w-[480px] max-w-[100%]"}," Send message ",8,$)])])])),_:1},8,["validation-schema","initialValues"]),F(I)?(c(),_(y,{key:0,custom:"",to:"body"},[v(m,{class:"[&_h2]:!font-Montserrat [&_h2]:!not-italic [&_h2]:!font-semibold",onClose:s[5]||(s[5]=e=>I.value=!1),title:"Send message",desc:"The message has been sent successfully."})])):R("",!0)])}}};export{j as default};
