1import{r as l,j as e}from"./react-daO8XSXc.js";import{x as be,a as oe,A as ge,b as ve,al as F,a6 as je,a7 as W,$ as we,ao as Z,a1 as re,n as Ne,a0 as Ce}from"./index-B58ZFblL.js";import{I as $}from"./Input-BllD4-Ae.js";import{S as D}from"./Select-u90BfzQK.js";import{A as se,m as ye,a as ke,C as Ee,R as ie,b as Se,O as Ie}from"./PecasDoFormulario-BIS-O8Mu.js";import{_ as Re,J as Ae,H as me,a9 as De,aa as _e,a5 as Pe,ab as Oe,y as ne,ad as ze,M as Le,w as Te,ae as $e}from"./lucide-DgiROqw5.js";import{C as Me,D as Ve,a as Fe}from"./inscricao-gdpE1a3T.js";import{P as z,H,C as q}from"./patrocine-DGczbG_T.js";import{P as We,a as J,e as Be,p as Ge,T as He,b as U,c as qe,v as Je,l as le,d as Ue,g as Ze,f as Ke}from"./Patrocine-CxR2TWpR.js";import{I as Qe}from"./inscricao.pt-DS6Sdim7.js";import{u as Xe}from"./useFocoInicial-B7rNVo93.js";import{r as Ye,c as ea}from"./capturaService-C4n6BgZw.js";import"./supabase-CWGMQrOR.js";import"./framer-CJI0BPWU.js";import"./validacaoDeCadastro-C6n4R1Rr.js";import"./evento-_qg0cpiw.js";import"./contentService-D-YtiaGk.js";import"./LogoDaEmpresa-DSr9CmB1.js";import"./tamanhosDe-DxExLeqZ.js";const aa=({label:b,error:p,options:x,value:m,onChange:L,placeholder:o="Selecione...",rotuloDe:t=r=>r,textoDeVarios:T=r=>`${r} selecionados`,max:P,id:C,...I})=>{const r=l.useId(),j=C??r,v=`${j}-erro`,O=`${j}-lista`,[s,R]=l.useState(!1),y=l.useRef(null),S=l.useRef(null),k=l.useRef(null);l.useEffect(()=>{var c;s&&((c=k.current)==null||c.scrollIntoView({block:"nearest"}))},[s]),l.useEffect(()=>{if(!s)return;const c=u=>{var w;(w=y.current)!=null&&w.contains(u.target)||R(!1)},d=u=>{var w;u.key==="Escape"&&(u.stopPropagation(),R(!1),(w=S.current)==null||w.focus())};return document.addEventListener("mousedown",c),document.addEventListener("keydown",d,!0),()=>{document.removeEventListener("mousedown",c),document.removeEventListener("keydown",d,!0)}},[s]);const g=m??[],i=c=>L(d=>d.includes(c)?d.filter(u=>u!==c):P&&d.length>=P?d:[...d,c]),A=g.length===0?o:g.length===1?t(g[0]):T(g.length),B=p?"border-red-500":"border-white/10 [&:hover:not(:focus-within)]:border-white/20 focus-within:border-crimson";return e.jsxs("div",{className:"w-full",ref:y,children:[e.jsxs("fieldset",{role:"presentation",className:`relative m-0 w-full min-w-0 rounded-xl border bg-[#0A0A0A] p-0 transition-all duration-200 ${B}`,children:[b&&e.jsx("legend",{className:"ml-3 max-w-[calc(100%-1.5rem)] px-1.5",children:e.jsx("label",{htmlFor:j,className:`block cursor-pointer truncate text-[10px] font-bold uppercase tracking-widest ${p?"text-red-400":"text-gray-400/75"}`,children:b})}),e.jsxs("div",{className:"relative",children:[e.jsx("button",{ref:S,type:"button",id:j,role:"combobox","aria-haspopup":"listbox","aria-expanded":s,"aria-controls":s?O:void 0,"aria-invalid":p?!0:void 0,"aria-describedby":p?v:void 0,onClick:()=>R(c=>!c),className:`flex w-full cursor-pointer items-center justify-between gap-2 rounded-xl border-0 bg-transparent pl-4 pr-10 text-left text-base focus:outline-none sm:text-sm ${b?"pb-4 pt-2":"py-3.5"} text-white`,...I,children:e.jsx("span",{className:"truncate",children:A})}),e.jsx(Re,{size:14,"aria-hidden":"true",className:`pointer-events-none absolute right-4 top-[calc(50%-4px)] -translate-y-1/2 text-gray-500 transition-transform ${s?"rotate-180":""}`})]})]}),s&&e.jsx("div",{ref:k,id:O,role:"listbox","aria-multiselectable":"true","aria-labelledby":b?j:void 0,className:"relative z-20 mt-1.5 max-h-56 overflow-y-auto rounded-xl border border-white/10 bg-[#0A0A0A] p-1.5 shadow-2xl shadow-black/60",children:x.map(c=>{const d=g.includes(c),u=!!P&&!d&&g.length>=P;return e.jsxs("button",{type:"button",role:"option","aria-selected":d,disabled:u,onClick:()=>i(c),className:`flex w-full items-center gap-2.5 rounded-lg px-3 py-2.5 text-left text-sm transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-crimson/60 ${d?"text-white":"text-gray-400 hover:bg-white/[0.04] hover:text-gray-200"} ${u?"cursor-not-allowed opacity-40":""}`,children:[e.jsx("span",{className:`flex h-4 w-4 shrink-0 items-center justify-center rounded border ${d?"border-crimson bg-crimson text-white":"border-white/25"}`,"aria-hidden":"true",children:d&&e.jsx(Ae,{size:11,strokeWidth:3})}),e.jsx("span",{className:"leading-snug",children:t(c)})]},c)})}),p&&e.jsx("p",{id:v,className:"mt-1 animate-in fade-in slide-in-from-top-1 text-[10px] font-medium text-red-500",children:p})]})},ta={plataforma:Le,reuniao:ze,decidir_agora:me},oa=["plataforma","reuniao","decidir_agora"],ce={src:H.logo.src,largura:H.logo.largura,altura:H.logo.altura,alt:"Growth Conference PREVIEW"},ra=(b,p)=>{const x=new Map(b.map((m,L)=>[m,p[L]??m]));return m=>x.get(m)??m},_=(b,p)=>b.map((x,m)=>({value:x,label:p[m]??x})),de=()=>
1qe(we(Z)),ya=({isOpen:b,onClose:p,via:x,cotaInicial:m=""})=>{const L=be(),o=oe(We).proposta,t=o.ficha,T=oe(Qe).opcoes,P=ge("/termos-e-politicas",ve()),[C,I]=l.useState("ficha"),[r,j]=l.useState(J),[v,O]=l.useState(m),[s,R]=l.useState({}),[y,S]=l.useState(""),[k,g]=l.useState(!1),[i,A]=l.useState(null),[B,c]=l.useState(!1),[d,u]=l.useState(""),[w,K]=l.useState(""),Q=l.useRef(null),M=l.useRef(null),X=l.useRef(null),V=l.useRef(null),ue=Xe(C==="ficha");l.useEffect(()=>{if(!b)return;const a=Be();A(a),I(a?a.passo?"fim":"passo":"ficha"),j(a?J:de()),O((a==null?void 0:a.cota)||m),u((a==null?void 0:a.cota)??""),R({}),S(""),g(!1),c(!1),K(""),a||F("patrocinio_aberto",m?{via:x,cota:m}:{via:x})},[b,x,m]);const Y=l.useRef(!0);l.useEffect(()=>{var a,n;if(Y.current){Y.current=!1;return}(a=Q.current)==null||a.scrollIntoView({block:"nearest"}),C!=="ficha"&&((n=M.current)==null||n.focus())},[C]);const ee=(a,n)=>{j(h=>{const E={...h,[a]:n(h[a])};return re({...E,aceite:!1},Z),E}),s[a]&&R(h=>({...h,[a]:""}))},f=(a,n)=>ee(a,()=>n),pe=()=>requestAnimationFrame(()=>{var n;const a=(n=X.current)==null?void 0:n.querySelector('[aria-invalid="true"], #proposta-aceite');a==null||a.scrollIntoView({block:"center"}),a==null||a.focus()});l.useEffect(()=>{var a,n;y&&((a=V.current)==null||a.scrollIntoView({block:"center"}),(n=V.current)==null||n.focus())},[y]);const xe=async a=>{a.preventDefault();const n=Je(r,o.validacao);if(R(n),Object.keys(n).length){pe();return}await he()},he=async()=>{S("");const a=Ze(),n={chave:a,nome:`${r.nome.trim()} ${r.sobrenome.trim()}`.trim(),email:r.email.trim(),cota:v,em:Date.now()};if(w){A(n),u(v),I("passo");return}g(!0);const h=await ea(Ke(r,a,v));if(g(!1),h!=="ok"){S(h==="limite"?o.erros.limite:h==="campo-longo"?o.erros.campoLongo:o.erros.falha);return}F("patrocinio_enviado",v?{via:x,cota:v}:{via:x}),re({nome:r.nome.trim(),sobrenome:r.sobrenome.trim(),email:r.email.trim().toLowerCase(),whatsapp:r.whatsapp,cargo:r.cargo,departamento:r.departamento,empresa:r.empresa.trim(),colaboradores:r.colaboradores,aceiteTermos:!1}),Ce(Z),le(n),A(n),u(v),j(J),I("passo")},ae=()=>{p(),L("inscricao","patrocinar")},te=async a=>{if(!i||k)return;const n=d===q?"":d,h=a==="decidir_agora"?n:i.cota;if(!w){S(""),g(!0);const N=await Ye(i.chave,a,a==="decidir_agora"?n:"");if(g(!1),N==="falha"){S(o.erros.passo);return}N==="ok"?F("patrocinio_passo",h?{passo:a,cota:h}:{passo:a}):Ne(new Error("Próximo passo da proposta não gravado"),{passo:a})}const E={...i,passo:a,cota:h};if(w||le(E),A(E),a==="plataforma"){ae();return}I("fim")},fe=()=>{Ue(),A(null),j(de()),O(m),u(""),c(!1),I("ficha"),F("patrocinio_aberto",m?{via:x,cota:m}:{via:x})},G={nome:Ge((i==null?void 0:i.nome)??""),email:(i==null?void 0:i.email)??"",cota:(i==null?void 0:i.cota)??"",prazo:o.prazo};return e.jsx(je,{isOpen:b,onClose:p,size:"md",rotuladoPor:"proposta-titulo",className:`p-0 overflow-hidden border border-white/10 ${C==="passo"?"sm:!max-w-3xl":"sm:!max-w-xl"}`,children:e.jsxs("div",{ref:Q,className:"w-full relative bg-[#050505]",children:[e.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-crimson/10 via-trans
1parent to-blue-900/10 opacity-60 pointer-events-none"}),e.jsxs("div",{className:"p-6 sm:p-8 md:p-10 relative z-10",children:[C==="ficha"&&e.jsxs("form",{ref:X,onSubmit:xe,noValidate:!0,children:[e.jsxs("div",{className:"mb-6",children:[e.jsxs("h2",{id:"proposta-titulo",ref:M,tabIndex:-1,className:"mb-1.5 flex items-center gap-2.5 text-2xl font-bold tracking-tight text-white focus:outline-none",children:[e.jsx(me,{size:22,className:"shrink-0 text-crimson","aria-hidden":"true"}),e.jsx("span",{className:"sm:hidden",children:o.tituloCurto}),e.jsx("span",{className:"hidden sm:inline",children:o.titulo})]}),e.jsx("p",{className:"hidden text-[13px] font-light text-gray-400 sm:block sm:whitespace-nowrap",children:o.subtitulo}),v&&e.jsxs("p",{className:"mt-3 inline-flex items-center gap-2 rounded-full border border-white/10 bg-white/[0.04] px-3 py-1 text-[11px] text-gray-300",children:[t.cota," ",e.jsx("span",{className:"font-semibold text-white",children:v}),e.jsx("span",{"aria-hidden":"true",className:"text-gray-600",children:"·"}),e.jsx("button",{type:"button",onClick:()=>O(""),className:"underline underline-offset-2 hover:text-white",children:t.trocar})]})]}),y&&e.jsx("div",{ref:V,tabIndex:-1,className:"focus:outline-none",children:e.jsx(se,{children:y})}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx($,{label:t.nome,"aria-label":t.nome,value:r.nome,onChange:a=>f("nome",a.target.value),error:s.nome,icon:e.jsx(De,{size:16}),ref:ue,maxLength:120,autoComplete:"given-name"}),e.jsx($,{label:t.sobrenome,"aria-label":t.sobrenome,value:r.sobrenome,onChange:a=>f("sobrenome",a.target.value),error:s.sobrenome,maxLength:120,autoComplete:"family-name"})]}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx($,{label:t.whatsapp,"aria-label":t.whatsapp,type:"tel",inputMode:"tel",placeholder:t.whatsappExemplo,value:r.whatsapp,onChange:a=>f("whatsapp",o.whatsappInternacional?ye(a.target.value):ke(a.target.value)),error:s.whatsapp,icon:e.jsx(_e,{size:16}),autoComplete:o.whatsappInternacional?"tel":"tel-national"}),e.jsx($,{label:t.email,"aria-label":t.email,type:"email",placeholder:t.emailExemplo,value:r.email,onChange:a=>f("email",a.target.value),error:s.email,icon:e.jsx(Pe,{size:16}),autoComplete:"email",maxLength:160})]}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(D,{label:t.cargo,"aria-label":t.cargo,options:_(Me,T.cargos),placeholder:t.selecione,value:r.cargo,onChange:a=>f("cargo",a.target.value),error:s.cargo}),e.jsx(D,{label:t.departamento,"aria-label":t.departamento,options:_(Ve,T.departamentos),placeholder:t.selecione,value:r.departamento,onChange:a=>f("departamento",a.target.value),error:s.departamento})]}),e.jsx($,{label:t.empresa,"aria-label":t.empresa,value:r.empresa,onChange:a=>f("empresa",a.target.value),error:s.empresa,icon:e.jsx(Oe,{size:16}),maxLength:120,autoComplete:"organization"}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(D,{label:t.tipoDeSolucao,"aria-label":t.tipoDeSolucao,options:_(z.tiposDeSolucao,o.rotulos.tiposDeSolucao),placeholder:t.selecione,value:r.tipoDeSolucao,onChange:a=>f("tipoDeSolucao",a.target.value),error:s.tipoDeSolucao}),e.jsx(D,{label:t.colaboradores,"aria-label":t.colaboradoresExtenso,options:_(Fe,T.colaboradores),placeholder:t.selecione,value:r.colaboradores,onChange:a=>f("colaboradores",a.target.value),error:s.colaboradores})]}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(D,{label:t.ticket,"aria-label":t.ticketExtenso,options:_(z.tickets,o.rotulos.tickets),placeholder:t.selecione,value:r.ticketMedio,onChange:a=>f("ticketMedio",a.target.value),error:s.ticketMedio}),e.jsx(D,{label:t.cac,"aria-label":t.cacExtenso,options:_(z.cacs,o.rotulos.cacs),placeholder:t.selecione,value:r.cac,onChange:a=>f("cac",a.target.value),error:s.cac})]}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(aa,{label:t.objetivo,"aria-label":t.objetivoExtenso,options:z.objetivos,rotuloDe:ra(z.objetivos,o.rotulos.objetivos),textoDeVarios:t.selecionados,placeholder:t.selecione,value:r.objetivos,onChange:a=>ee("objetivos",a),max:He,error:s.objetivos}),e.jsx(D,{label:t.orcamento,"aria-label":t.orcamento,options:_(z.investimentos,o.rotulos.investimentos),placeholder:t.selecione,value:r.faixaInvestimento,onChange:a=>f("faixaInvestimento",a.target.value),error:s.faixaInvestimento})]}),e.jsx("input",{type:"text",tabIndex:-1,autoComplete:"off","aria-hidden":"true",value:w,onChange:a=>K(a.target.value),className:"absolute left-[-9999px] h-0 w-0 opacity-0"}),e.jsxs("div",{className:"border-t border-white/5 pt-5",children:[e.jsxs(Ee,{id:"proposta-aceite",marcada:r.aceite,aoMudar:a=>f("aceite",a),idDoErro:s.aceite?"proposta-aceite-erro":void 0,children:[t.aceite[0],e.jsx("a",{href:P,target:"_blank",rel:"noopener noreferrer",className:"underline underline-offset-2 hover:text-white",children:t.aceite[1]}),t.aceite[2]]}),s.aceite&&e.jsx("p",{id:"proposta-aceite-erro",className:"mt-1 text-[10px] text-red-500 font-medium",children:s.aceite})]})]}),e.jsx("div",{className:"mt-8",children:e.jsx(W,{type:"submit",variant:"primary",fullWidth:!0,isLoading:k,className:"shadow-[0_0_20px_rgba(255,0,0,0.15)]",rightIcon:!k&&e.jsx(ne,{size:14}),children:t.continuar})}),e.jsx(ie,{logo:ce,children:e.jsx("p",{className:"text-xs text-gray-500",children:o.rodape})})]}),C==="passo"&&i&&e.jsxs("div",{children:[e.jsxs("div",{className:"mb-6",children:[e.jsx("h2",{id:"proposta-titulo",ref:M,tabIndex:-1,
1className:"text-2xl font-bold text-white mb-1.5 tracking-tight focus:outline-none",children:U(o.confirmacao,G)}),e.jsx("p",{className:"text-gray-400 text-[13px] font-light",children:o.pergunta})]}),y&&e.jsx("div",{ref:V,tabIndex:-1,className:"focus:outline-none",children:e.jsx(se,{children:y})}),e.jsx("div",{className:"grid gap-3 sm:grid-cols-3 sm:items-start",children:oa.map(a=>{const n=o.cards[a],h=ta[a],E=a==="decidir_agora"&&B;return e.jsxs("div",{className:`rounded-2xl border transition-colors ${E?"border-crimson/60 bg-crimson/[0.06] sm:col-span-3":"border-white/10 bg-[#0A0A0A] hover:border-white/20"}`,children:[e.jsxs("button",{type:"button",disabled:k,"aria-expanded":a==="decidir_agora"?E:void 0,onClick:()=>a==="decidir_agora"?c(N=>!N):void te(a),className:"flex h-full w-full flex-col items-start gap-3 rounded-2xl p-4 text-left focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-crimson/60 disabled:cursor-wait sm:p-5",children:[e.jsx("span",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-xl border border-white/10 bg-white/5 text-white",children:e.jsx(h,{size:18,"aria-hidden":"true"})}),e.jsxs("span",{className:"min-w-0",children:[e.jsx("span",{className:"block text-sm font-semibold text-white",children:n.titulo}),e.jsx("span",{className:"mt-1 block text-[13px] font-light leading-relaxed text-gray-400",children:n.descricao})]})]}),E&&e.jsxs("div",{className:"border-t border-white/5 px-4 pb-4 pt-4 sm:px-5 sm:pb-5",children:[e.jsxs("div",{role:"radiogroup","aria-labelledby":"rotulo-cota",children:[e.jsx(Se,{id:"rotulo-cota",children:o.cards.decidir_agora.perguntaDaCota}),e.jsx("div",{className:"grid gap-2 sm:grid-cols-2",children:[...o.cotas,q].map(N=>e.jsx(Ie,{ativo:d===N,onClick:()=>u(N),children:N===q?o.cotaIndefinida:N},N))})]}),e.jsx(W,{type:"button",variant:"primary",fullWidth:!0,isLoading:k,disabled:!d,onClick:()=>void te("decidir_agora"),className:"mt-4 shadow-[0_0_20px_rgba(255,0,0,0.15)]",rightIcon:!k&&e.jsx(ne,{size:14}),children:o.cards.decidir_agora.confirmar})]})]},a)})}),e.jsx(ie,{logo:ce,children:e.jsx("p",{className:"text-xs text-gray-500",children:o.rodapeDosCards})})]}),C==="fim"&&(i==null?void 0:i.passo)&&e.jsxs("div",{className:"py-6 text-center",role:"status","aria-live":"polite",children:[e.jsx("div",{className:"mx-auto mb-5 flex h-12 w-12 items-center justify-center rounded-full border border-white/10 bg-white/5 text-emerald-400",children:e.jsx(Te,{size:22,"aria-hidden":"true"})}),e.jsx("h2",{id:"proposta-titulo",ref:M,tabIndex:-1,className:"text-2xl font-bold text-white mb-2 focus:outline-none",children:o.cards[i.passo].titulo}),e.jsx("p",{className:"mx-auto max-w-sm text-sm font-light leading-relaxed text-gray-400",children:i.passo==="reuniao"&&o.agenda?o.cards.reuniao.sucessoComAgenda:i.passo==="decidir_agora"&&!i.cota?U(o.cards.decidir_agora.sucessoSemCota,G):U(o.cards[i.passo].sucesso,G)}),e.jsxs("div",{className:"mt-7 flex flex-col items-center gap-3",children:[i.passo==="reuniao"&&o.agenda&&e.jsxs("a",{href:o.agenda,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-2 rounded-xl bg-crimson px-6 py-3 text-sm font-bold text-white transition-colors hover:bg-crimson/90 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-marca-azul-claro",children:[o.cards.reuniao.botaoAgenda,e.jsx($e,{size:14,"aria-hidden":"true"})]}),e.jsx(W,{variant:"outline",onClick:ae,children:o.botaoPlataforma}),e.jsx(W,{variant:"ghost",onClick:p,children:o.fechar}),e.jsx("button",{type:"button",onClick:fe,className:"text-xs text-gray-500 underline underline-offset-4 transition-colors hover:text-white",children:o.outraProposta})]})]})]})]})})};export{ya as default};
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.