1import{n as e}from"./chunk-Bh1tDfsg.js";import{n as t,r as n}from"./prospecta-logo.svg.asset-DmmLgNN_.js";import{t as r}from"./jsx-runtime-BpRO-UL9.js";var i=e(n(),1),a=r(),o=`prospecta_lang`;function s(){if(typeof window>`u`)return`en`;try{let e=new URLSearchParams(window.location.search).get(`lang`);if(e===`pt`||e===`pt-BR`)return`pt`;if(e===`en`)return`en`;let t=window.localStorage.getItem(o);return t===`pt`||t===`en`?t:((navigator.languages&&navigator.languages.length?navigator.languages:[navigator.language])||[]).some(e=>typeof e==`string`&&e.toLowerCase().startsWith(`pt`))?`pt`:`en`}catch{return`en`}}var c=(0,i.createContext)({lang:`en`,setLang:()=>{},toggle:()=>{}});function l({children:e}){let[t,n]=(0,i.useState)(`en`);(0,i.useEffect)(()=>{n(s())},[]),(0,i.useEffect)(()=>{typeof document<`u`&&(document.documentElement.lang=t===`pt`?`pt-BR`:`en`)},[t]);let r=(0,i.useMemo)(()=>({lang:t,setLang:e=>{n(e);try{window.localStorage.setItem(o,e)}catch{}},toggle:()=>{n(e=>{let t=e===`en`?`pt`:`en`;try{window.localStorage.setItem(o,t)}catch{}return t})}}),[t]);return(0,a.jsx)(c.Provider,{value:r,children:e})}function u(){return(0,i.useContext)(c)}function d(e,t){return e[t]}function f(e,t){let{lang:n}=u();(0,i.useEffect)(()=>{if(typeof document>`u`)return;if(document.title=e[n],t){let e=(e,t)=>{let n=document.querySelector(e);n&&n.setAttribute(`content`,t)};e(`meta[name="description"]`,t[n]),e(`meta[property="og:description"]`,t[n]),e(`meta[name="twitter:description"]`,t[n])}let r=(e,t)=>{let n=document.querySelector(e);n&&n.setAttribute(`content`,t)};r(`meta[property="og:title"]`,e[n]),r(`meta[name="twitter:title"]`,e[n])},[n,e,t])}var p=t(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),m=t(`send`,[[`path`,{d:`M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z`,key:`1ffxy3`}],[`path`,{d:`m21.854 2.147-10.94 10.939`,key:`12cjpa`}]]),h=t(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),g=`https://vinqrwa7p262lrsspnqdmaexry0lpbik.lambda-url.us-east-1.on.aws/`,_={name:100,company:120,email:255,source:160,subject:160,message:1e3},v=[`Busca no Google`,`Instagram`,`Facebook`,`LinkedIn`,`YouTube`,`Indicação`,`Evento`,`Outro`],y=[`Google Search`,`Instagram`,`Facebook`,`LinkedIn`,`YouTube`,`Referral`,`Event`,`Other`];function b({open:e,onClose:t}){let{lang:n}=u(),r=(0,i.useRef)(null),[o,s]=(0,i.useState)(``),[c,l]=(0,i.useState)(``),[d,f]=(0,i.useState)(``),[b,w]=(0,i.useState)(``),[T,E]=(0,i.useState)(``),[D,O]=(0,i.useState)(``),[k,A]=(0,i.useState)(``),[j,M]=(0,i.useState)({}),[N,P]=(0,i.useState)(!1),[F,I]=(0,i.useState)(!1),[L,R]=(0,i.useState)(null),z=n===`pt`?{title:`Fale com a gente`,subtitle:`Preencha o formulário e nossa equipe retorna o quanto antes.`,name:`Nome`,namePh:`Seu nome completo`,company:`Empresa`,companyPh:`Nome da sua empresa`,email:`E-mail`,emailPh:`[email protected]`,isCustomer:`Já é nosso cliente?`,yes:`Sim`,no:`Não`,subject:`Sobre o que você quer falar?`,subjectPh:`Descreva brevemente o assunto`,source:`Como nos conheceu?`,sourcePlaceholder:`Selecione uma opção`,sourceOptions:v,message:`Mensagem`,messagePh:`Como podemos ajudar?`,submit:`Enviar mensagem`,sending:`Enviando...`,close:`Fechar`,required:`Campo obrigatório.`,invalidEmail:`Informe um e-mail válido.`,selectOption:`Selecione uma opção.`,sentTitle:`Mensagem enviada!`,sentDesc:`Recebemos seu contato e vamos responder o quanto antes.`,errorGeneric:`Não foi possÃvel enviar sua mensagem. Tente novamente em instantes.`}:{title:`Get in touch`,subtitle:`Fill out the form and our team will get back to you soon.`,name:`Name`,namePh:`Your full name`,company:`Company`,companyPh:`Your company name`,email:`Email`,emailPh:`[email protected]`,isCustomer:`Are you already a customer?`,yes:`Yes`,no:`No`,subject:`What would you like to talk about?`,subjectPh:`Briefly describe the topic`,source:`How did you hear about us?`,sourcePlaceholder:`Select an option`,sourceOptions:y,message:`Me
1ssage`,messagePh:`How can we help?`,submit:`Send message`,sending:`Sending...`,close:`Close`,required:`This field is required.`,invalidEmail:`Enter a valid email.`,selectOption:`Select an option.`,sentTitle:`Message sent!`,sentDesc:`We received your message and will get back to you soon.`,errorGeneric:`We couldn't send your message. Please try again in a moment.`};if((0,i.useEffect)(()=>{if(!e)return;let n=document.body.style.overflow;document.body.style.overflow=`hidden`;let i=e=>{e.key===`Escape`&&t()};window.addEventListener(`keydown`,i);let a=setTimeout(()=>r.current?.focus(),60);return()=>{document.body.style.overflow=n,window.removeEventListener(`keydown`,i),clearTimeout(a)}},[e,t]),(0,i.useEffect)(()=>{e&&(M({}),R(null),I(!1))},[e]),!e)return null;function B(){s(``),l(``),f(``),w(``),E(``),O(``),A(``)}function V(){let e={};return o.trim()||(e.name=z.required),c.trim()||(e.company=z.required),d.trim()?/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(d.trim())||(e.email=z.invalidEmail):e.email=z.required,b===``&&(e.isCustomer=z.selectOption),b===`yes`&&!T.trim()&&(e.subject=z.required),b===`no`&&!D.trim()&&(e.source=z.selectOption),k.trim()||(e.message=z.required),M(e),Object.keys(e).length===0}async function H(e){if(e.preventDefault(),N||(R(null),!V()))return;let t=b===`yes`,r={language:n===`pt`?`pt`:`en`,name:o.trim(),company:c.trim(),email:d.trim(),is_customer:t,source:t?``:D.trim(),subject:t?T.trim():``,message:k.trim()};P(!0);try{let e=await fetch(g,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(r)}),t=null;try{t=await e.json()}catch{t=null}let n=!t||t.success!==!1;e.ok&&n?(B(),I(!0)):R(z.errorGeneric)}catch{R(z.errorGeneric)}finally{P(!1)}}function U(e){e.target===e.currentTarget&&t()}return(0,a.jsx)(`div`,{onMouseDown:U,className:`fixed inset-0 z-[100] flex items-center justify-center overflow-y-auto bg-ink/50 px-4 py-6 backdrop-blur-sm`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`contact-modal-title`,children:(0,a.jsxs)(`div`,{className:`relative my-auto w-full max-w-lg overflow-hidden rounded-2xl border border-divider bg-white shadow-[0_24px_80px_rgba(15,23,42,0.24)]`,children:[(0,a.jsx)(`button`,{type:`button`,onClick:t,"aria-label":z.close,className:`absolute right-4 top-4 z-10 grid h-9 w-9 place-items-center rounded-full border border-border bg-white text-ink-muted transition-colors hover:bg-surface hover:text-ink`,children:(0,a.jsx)(h,{className:`h-4 w-4`})}),F?(0,a.jsxs)(`div`,{className:`px-6 pb-8 pt-10 text-center sm:px-8`,children:[(0,a.jsx)(`div`,{className:`mx-auto mb-4 grid h-14 w-14 place-items-center rounded-full bg-brand-light text-brand-action`,children:(0,a.jsx)(p,{className:`h-7 w-7`})}),(0,a.jsx)(`h2`,{id:`contact-modal-title`,className:`text-xl font-extrabold tracking-tight text-ink`,children:z.sentTitle}),(0,a.jsx)(`p`,{className:`mx-auto mt-2 max-w-sm text-sm text-ink-muted`,children:z.sentDesc}),(0,a.jsx)(`button`,{type:`button`,onClick:t,className:`btn-primary mt-6`,children:z.close})]}):(0,a.jsxs)(`form`,{onSubmit:H,className:`px-6 pb-6 pt-8 sm:px-8`,children:[(0,a.jsx)(`h2`,{id:`contact-modal-title`,className:`text-xl font-extrabold tracking-tight text-ink sm:text-2xl`,children:z.title}),(0,a.jsx)(`p`,{className:`mt-1 text-sm text-ink-muted`,children:z.subtitle}),(0,a.jsxs)(`div`,{className:`mt-5 space-y-4`,children:[(0,a.jsx)(S,{id:`cf-name`,label:z.name,error:j.name,children:(0,a.jsx)(`input`,{ref:r,id:`cf-name`,type:`text`,value:o,onChange:e=>s(e.target.value),placeholder:z.namePh,className:x(!!j.name),maxLength:_.name,autoComplete:`name`})}),(0,a.jsx)(S,{id:`cf-company`,label:z.company,error:j.company,children:(0,a.jsx)(`input`,{id:`cf-company`,type:`text`,value:c,onChange:e=>l(e.target.value),placeholder:z.companyPh,className:x(!!j.company),maxLength:_.company,autoComplete:`organization`})}),(0,a.jsx)(S,{id:`cf-email`,label:z.email,error:j.email,children:(0,a.jsx)(`input`,{id:`cf-email`,type:`email`,value:d,onChange:e=>f(e.target.value),placeholder:z.emailPh,className:x(!!j.email),maxLength:_.email,autoComplete:`email`})}),(0,a.jsx)(S,{id:`cf-iscustomer`,label:z.isCustomer,error:j.isCustomer,children:(0,a.jsxs)(`div`,{className:`flex gap-2`,children:[(0,a.jsx)(C,{name:`is_customer`,value:`yes`,checked:b===`yes`,onChange:()=>w(`yes`),label:z.yes}
1),(0,a.jsx)(C,{name:`is_customer`,value:`no`,checked:b===`no`,onChange:()=>w(`no`),label:z.no})]})}),b===`yes`&&(0,a.jsx)(S,{id:`cf-subject`,label:z.subject,error:j.subject,children:(0,a.jsx)(`input`,{id:`cf-subject`,type:`text`,value:T,onChange:e=>E(e.target.value),placeholder:z.subjectPh,className:x(!!j.subject),maxLength:_.subject})}),b===`no`&&(0,a.jsx)(S,{id:`cf-source`,label:z.source,error:j.source,children:(0,a.jsxs)(`select`,{id:`cf-source`,value:D,onChange:e=>O(e.target.value),className:x(!!j.source),children:[(0,a.jsx)(`option`,{value:``,children:z.sourcePlaceholder}),z.sourceOptions.map(e=>(0,a.jsx)(`option`,{value:e,children:e},e))]})}),(0,a.jsx)(S,{id:`cf-message`,label:z.message,error:j.message,children:(0,a.jsx)(`textarea`,{id:`cf-message`,value:k,onChange:e=>A(e.target.value),placeholder:z.messagePh,rows:4,maxLength:_.message,className:`${x(!!j.message)} resize-none`})})]}),L&&(0,a.jsx)(`p`,{className:`mt-4 rounded-lg border border-danger/40 bg-danger-light px-3 py-2 text-sm text-danger`,children:L}),(0,a.jsxs)(`button`,{type:`submit`,disabled:N,className:`btn-primary mt-6 w-full disabled:cursor-not-allowed disabled:opacity-70`,children:[(0,a.jsx)(m,{className:`h-4 w-4`}),N?z.sending:z.submit]})]})]})})}function x(e){return`w-full rounded-xl border bg-white px-3.5 py-2.5 text-sm text-ink placeholder:text-ink-subtle outline-none transition-colors focus:border-brand-action focus:ring-2 focus:ring-brand-action/20 ${e?`border-danger`:`border-border`}`}function S({id:e,label:t,error:n,children:r}){return(0,a.jsxs)(`div`,{children:[(0,a.jsx)(`label`,{htmlFor:e,className:`mb-1.5 block text-xs font-semibold uppercase tracking-wider text-ink-muted`,children:t}),r,n&&(0,a.jsx)(`p`,{className:`mt-1 text-xs text-danger`,children:n})]})}function C({name:e,value:t,checked:n,onChange:r,label:i}){return(0,a.jsxs)(`label`,{className:`flex flex-1 cursor-pointer items-center justify-center gap-2 rounded-xl border px-3 py-2.5 text-sm font-medium transition-colors ${n?`border-brand-action bg-brand-light text-brand-action`:`border-border bg-white text-ink-muted hover:bg-surface`}`,children:[(0,a.jsx)(`input`,{type:`radio`,name:e,value:t,checked:n,onChange:r,className:`sr-only`}),(0,a.jsx)(`span`,{children:i})]})}export{l as a,f as c,p as i,h as n,d as o,m as r,u as s,b as t};
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.