1import{j as B,u as E,k as O,B as j,x as q,h as e,o as i,c as u,I as A,J as c,K as f,a,t as n,n as y,e as m,N as S,f as x,L as $,i as P}from"./DhJzAL7L.js";import{u as D}from"./CfSsbgfj.js";const J=["id"],K={key:0,class:"text-red-500 text-sm"},T={key:0,class:"text-red-500 text-sm"},X={key:0,class:"text-red-500 text-sm"},z={key:0,class:"text-red-500 text-sm"},H={key:0,class:"text-red-500 text-sm"},L={key:0,class:"text-red-500 text-sm"},Q={class:"flex items-center space-x-2"},R={for:"privacy",class:"text-sm"},W={key:0,class:"text-red-500 text-sm"},Z={class:"flex justify-end space-x-2"},G=["disabled"],Y={key:1,class:"text-green-600 mt-2"},ee={key:2,class:"text-red-600 mt-2"},se=B({__name:"ContactForm",props:{uniqueId:{}},emits:["submitted","error"],setup(_,{emit:V}){const{t:d}=E(),{$axios:ae,$gtag:C}=O(),N=V,M=_,k=x(!1),s=$({firstName:"",lastName:"",company:"",position:"",email:"",phone:"",message:"",privacy:!1,gotcha:""}),o=$({}),v=x(!1),g=x(!1),h=x(""),p=x(null),b=t=>`form-input w-full px-3 py-2 border rounded ${o[t]?"border-red-500":"border-gray-300"}`,U=t=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t),w=t=>!t||/^\+?[0-9\s\-()]{7,}$/.test(t),F=j(),I=async()=>{if(Object.keys(o).forEach(l=>o[l]=""),p.value=null,g.value=!1,v.value=!0,s.firstName||(o.firstName=d("global.form.val_name")),s.lastName||(o.lastName=d("global.form.val_surname")),s.email?U(s.email)||(o.email=d("global.form.val_email_b")):o.email=d("global.form.val_email"),w(s.phone)||(o.phone=d("global.form.val_phone")),s.privacy||(o.privacy=d("global.form.val_accept")),s.gotcha){p.value="SPAM",v.value=!1;return}if(Object.values(o).some(Boolean)){v.value=!1;return}const t=()=>{Object.assign(s,{firstName:"",lastName:"",company:"",position:"",email:"",phone:"",message:"",privacy:!1,gotcha:""})};try{const{data:l,error:r}=await D("/api/contact",{method:"POST",body:{...s,formId:M.uniqueId}},"$iJwb0X1XdV");r.value?(p.value=d("global.form.errorMsd"),N("error",p.value),g.value=!1):l.value&&l.value.success?(g.value=!0,N("submitted"),t(),h.value==="onlyoffice"&&C?.event?.("conversion",{send_to:"AW-17579066067/HS-kCNOxwqQbENOFrb5B",value:1,currency:"CZK"}),h.value=""):(g.value=!1,p.value=l.value?.error||d("global.form.errorMsd"))}catch(l){p.value=l?.response?.data?.message||d("global.form.errorMsd"),N("error",p.value)}finally{v.value=!1}};return q(()=>{k.value=!0;const t=F.query.from??null;Array.isArray(t)?h.value=t[0]??"":typeof t=="string"?h.value=t:h.value=""}),(t,l)=>e(k)?(i(),u("form",{key:0,id:_.uniqueId??"contact-form",onSubmit:A(I,["prevent"]),class:"space-y-4"},[c(a("input",{"onUpdate:modelValue":l[0]||(l[0]=r=>e(s).gotcha=r),type:"text",name:"gotcha",class:"hidden"},null,512),[[f,e(s).gotcha]]),a("div",null,[a("label",null,n(t.$t("global.form.name"))+" *",1),c(a("input",{"onUpdate:modelValue":l[1]||(l[1]=r=>e(s).firstName=r),class:y(b("firstName"))},null,2),[[f,e(s).firstName]]),e(o).firstName?(i(),u("p",K,n(e(o).firstName),1)):m("",!0)]),a("div",null,[a("label",null,n(t.$t("global.form.surname"))+" *",1),c(a("input",{"onUpdate:modelValue":l[2]||(l[2]=r=>e(s).lastName=r),class:y(b("lastName"))},null,2),[[f,e(s).lastName]]),e(o).lastName?(i(),u("p",T,n(e(o).lastName),1)):m("",!0)]),a("div",null,[a("label",null,n(t.$t("global.form.companyName")),1),c(a("input",{"onUpdate:modelValue":l[3]||(l[3]=r=>e(s).company=r),class:y(b("company"))},null,2),[[f,e(s).company]]),e(o).company?(i(),u("p",X,n(e(o).company),1)):m("",!0)]),a("div",null,[a("label",null,n(t.$t("global.form.position")),1),c(a("input",{"onUpdate:modelValue":l[4]||(l[4]=r=>e(s).position=r),class:y(b("position"))},null,2),[[f,e(s).position]]),e(o).position?(i(),u("p",z,n(e(o).position),1)):m("",!0)]),a("div",null,[a("label",null,n(t.$t("global.form.email"))+" *",1),c(a("input",{"onUpdate:modelValue":l[5]||(l[5]=r=>e(s).email=r),type:"email",class:y(b("email"))},null,2),[[f,e(s).email]]),e(o).email?(i(),u("p",H,n(e(o).email),1)):m("",!0)]),a("div",null,[a("label",null,n(t.$t("global.form.phone")),1),c(a("input",{"onUpdate:modelValue":l[6]||(l[6]=r=>e(s).phone=r),class:y(b("phone"))},null,2),[[f,e(s).phone]]),e(o).phone?(i(),u("p",L,n(e(o).phone),1)):m("",!0)]),a("div",null,[a("label",null,n(t.$t("global.form.message")),1),c(a("textarea",{"onUpdate:modelValue":l[7]||
1(l[7]=r=>e(s).message=r),rows:"4",class:"form-textarea"},null,512),[[f,e(s).message]])]),a("div",Q,[c(a("input",{id:"privacy","onUpdate:modelValue":l[8]||(l[8]=r=>e(s).privacy=r),type:"checkbox"},null,512),[[S,e(s).privacy]]),a("label",R,n(t.$t("global.form.accept"))+" *",1)]),e(o).privacy?(i(),u("p",W,n(e(o).privacy),1)):m("",!0),a("div",Z,[a("button",{type:"submit",class:"bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 rounded disabled:opacity-50",disabled:e(v)},n(e(v)?t.$t("global.form.sending"):t.$t("global.form.send")),9,G)]),e(g)?(i(),u("p",Y,n(t.$t("global.form.successMsg")),1)):m("",!0),e(p)?(i(),u("p",ee,n(e(p)),1)):m("",!0)],40,J)):m("",!0)}}),oe=P(se,[["__scopeId","data-v-4879f7fe"]]);export{oe as _};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.