1import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{h as t,l as n,r,t as i}from"./vendor-react-DFC-oW3_.js";import{f as a,u as o}from"./vendor-platform-BOpr4LIR.js";import{Cn as s,G as ee,Sn as te,W as ne,Z as re,sn as c}from"./vendor-design-system-svZhP1O5.js";import{t as l}from"./button-COWtfpJP.js";import{n as u,t as d}from"./logger-CFziGizL.js";import{t as ie}from"./auth.service-D3H0Yk-z.js";import{t as f}from"./fornecedor.service-Cw7fQHy7.js";import{C as ae,b as p,r as oe,x as se}from"./index-C4MYpc74.js";import{t as ce}from"./usePageTitle-BodlHxa3.js";import{a as m,i as le,n as ue,o as h,r as de}from"./progress-tDLeXl_O.js";import{t as g}from"./label-IWhXU81i.js";import{t as _}from"./checkbox-DJNuLzXU.js";import{t as v}from"./form-field-CI771OtJ.js";import{a as y,i as b,n as x,r as S,t as C}from"./select-BbaAz9-b.js";import{t as fe}from"./loading-m9cSlPER.js";import{n as pe,r as me,t as w}from"./validators-CCL72fXd.js";import{n as he,t as ge}from"./password-policy-BHCF3T7T.js";import{r as _e}from"./politica-privacidade-BtRTi90y.js";var T=e(t(),1),E=i(),D=[{id:`acesso`,label:`Acesso e identidade`},{id:`localizacao`,label:`Localização e contato`},{id:`fiscal`,label:`Dados fiscais e atuação`}],ve=[[`Use um e-mail corporativo válido`,`Senha com 8+ caracteres, maiúscula, minúscula, número e sÃmbolo`,`Validamos o CNPJ automaticamente na Receita`],[`CEP preenche o endereço via ViaCEP`,`Telefone para contato de emergência`,`E-mail receberá a confirmação do cadastro`],[`CNAE define em quais editais você pode participar`,`Regime tributário conforme Receita Federal`]],O=e=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e.trim()),k=e=>e.replace(/\D/g,``);function A(){ce(`Cadastro de fornecedor`);let[e,t]=(0,T.useState)(0),[i,A]=(0,T.useState)(``),[j,ye]=(0,T.useState)(``),[M,be]=(0,T.useState)(``),[N,xe]=(0,T.useState)(!1),[P,F]=(0,T.useState)({tipo_pessoa:`Juridica`,nacionalidade:`Brasil`}),[I,L]=(0,T.useState)({}),R=(0,T.useRef)(!1),[z,Se]=(0,T.useState)(!1),[B,V]=(0,T.useState)(!1),[Ce,H]=(0,T.useState)(!1),[U,we]=(0,T.useState)([]),[Te,Ee]=(0,T.useState)(!1),De=n(),{toast:W}=se(),G=!!P.tipo_pessoa&&P.tipo_pessoa!==`Fisica`,K=P.tipo_pessoa===`Fisica`,Oe=ge(j),q=he(j),J=e=>{L(t=>t[e]?{...t,[e]:``}:t)},Y=e=>{let{name:t,value:n}=e.target;F(e=>({...e,[t]:n})),J(t)},X=(e,t)=>n=>{F(r=>({...r,[e]:t(n.target.value)})),J(e)},Z=(e,t)=>{F(n=>{let r={...n,[e]:t??``};return e===`tipo_pessoa`&&(t===`Juridica`?(r.rg=``,r.orgao_emissor=``,r.data_nascimento=``,r.estado_civil=``):t===`Fisica`&&(r.nome_representante=``,r.email_representante=``)),r}),J(e)},Q=(e,t)=>{F(n=>({...n,[e]:t}))},ke=async()=>{if(!(U.length>0))try{we(await(await fetch(`https://servicodados.ibge.gov.br/api/v2/cnae/classes`)).json())}catch(e){d.error(`Erro CNAE:`,e)}},Ae=async()=>{let e=P.cep?.replace(/\D/g,``);if(e?.length===8)try{let t=await(await fetch(`https://viacep.com.br/ws/${e}/json/`)).json();t.erro||F(e=>({...e,logradouro:t.logradouro,bairro:t.bairro,cidade:t.localidade,uf:t.uf}))}catch(e){d.error(`Erro CEP:`,e)}},je=async()=>{if(!G)return;let e=P.cnpj_cpf?.replace(/\D/g,``);if(e?.length!==14)return;let t=w(e);if(!t.valido){W(t.mensagem,`error`);return}H(!0);try{let t=await me(e),n=pe(t);if(!n.elegivel){W(n.motivo||`CNPJ inelegÃvel.`,`error`),F(e=>({...e,razao_social:``}));return}F(e=>({...e,razao_social:t.razao_social,nome_fantasia:t.nome_fantasia||``,cep:t.cep||e.cep,logradouro:`${t.logradouro} ${t.numero}`.trim()||e.logradouro,bairro:t.bairro||e.bairro,cidade:t.cidade||e.cidade,uf:t.uf||e.uf,telefone:t.telefone||e.telefone})),W(`Dados preenchidos via Receita Federal`,`success`)}catch(e){d.error(`Erro ao buscar CNPJ:`,e),W(e instanceof Error?e.message:`Não foi possÃvel consultar o CNPJ. Tente novamente.`,`error`)}finally{H(!1)}},$=e=>{let t={},n=P;if(e===0){if(i?O(i)||(t.email=`Digite um e-mail válido (ex.: [email protected]).`):t.email=`Informe o e-mail.`,j?q||(t.password=`A senha ainda não atende todos os requisitos.`):t.password=`Crie uma senha.`,M?j!==M&&(t.confirmPassword=`As senhas não coincidem.`):t.confirmPassword=`Repita a senha.`,n.tipo_pessoa||(t.tipo_pessoa=`Escolha uma opção.`),!n.cnpj_cpf)t.cnpj_cpf=G?`Informe o CNPJ.`:`Informe o CPF.`;else{let e=w(n.cnpj_cpf);e.valido?G&&e.tipo===`CPF`?t.cnpj_cpf=`Para empresa, informe um CNPJ (14 dÃgitos).`:K&&e.tipo===`CNPJ`&&(t.cnpj_cpf=`Para pessoa fÃsica, informe um CPF (11 dÃgitos).`):t.cnpj_cpf=e.mensagem}if(n.razao_social||(t.razao_social=K?`Informe seu nome completo.`:`Informe a razão social.`),K)n.rg||(t.rg=`Informe o RG.`),n.orgao_emissor||(t.orgao_emissor=`Informe o órgão emissor.`),n.data_nascimento||(t.data_nascimento=`Informe a data de nascimento.`),n.estado_civil||(t.estado_civil=`Selecione o estado civil.`);else{if(n.nome_representante||(t.nome_representante=`Informe o representante legal.`),!n.cpf_representante)t.cpf_representante=`Informe o CPF do representante.`;else{let e=w(n.cpf_representante);(!e.valido||e.tipo!==`CPF`)&&(t.cpf_representante=`CPF inválido.`)}n.rg_representante||(t.rg_representante=`Informe o RG do representante.`),n.cargo_representante||(t.cargo_representante=`Informe o cargo.`),n.telefone_representante||(t.telefone_representante=`Informe o telefone.`),n.email_representante?O(n.email_representante)||(t.email_representante=`Digite um e-mail válido.`):t.email_representante=`Informe o e-mail do representante.`}}return e===1&&(n.cep?k(n.cep).length!==8&&(t.cep=`O CEP deve ter 8 números.`):t.cep=`Informe o CEP.`,n.logradouro||(t.logradouro=`Informe o endereço.`),n.numero||(t.numero=`Informe o número.`),n.bairro||(t.bairro=`Informe o bairro.`),n.cidade||(t.cidade=`Informe a cidade.`),n.uf||(t.uf=`Selecione o estado (UF).`),n.telefone?k(n.telefone).length<10&&(t.telefone=`Telefone incompleto â inclua o DDD.`):t.telefone=`Informe o telefone.`),e===2&&(G&&!n.regime_tributacao&&(t.regime_tributacao=`Selecione o regime de tributação.`),G&&!n.segmento_principal&&(t.segmento_principal=`Informe o segmento principal (CNAE).`),K&&!n.pis_nit&&(t.pis_nit=`Informe o PIS/PASEP/NIT.`),z||(t.consentLGPD=`à necessário ace
1itar a PolÃtica de Privacidade para concluir o cadastro.`)),t},Me=()=>{let n=$(e);if(Object.keys(n).length){L(n),R.current=!0;return}L({}),t(e=>e+1)};(0,T.useEffect)(()=>{if(!R.current)return;R.current=!1;let e=Object.keys(I).find(e=>I[e]);if(!e)return;let t=document.getElementById(e);if(!t)return;let n=(t.matches(`input,select,textarea,button,[tabindex]`)?t:t.querySelector(`input,select,textarea,button,[tabindex]`))??t,r=window.matchMedia(`(prefers-reduced-motion: reduce)`).matches;n.focus({preventScroll:!0}),n.scrollIntoView({block:`center`,behavior:r?`auto`:`smooth`})},[I]);let Ne=async()=>{let e=$(2);if(Object.keys(e).length){L(e),R.current=!0;return}L({}),V(!0);try{let e=null,t=!1,n=i.trim().toLowerCase();if(await ie.verificarEmailDisponivel(n)){let{data:r,error:i}=await u.auth.signUp({email:n,password:j,options:{emailRedirectTo:`${window.location.origin}/login`,data:{full_name:P.razao_social||void 0}}});if(i)throw i;if(!r.user)throw Error(`Falha ao criar usuário`);e=r.user,t=!!r.session}else{let{data:r,error:i}=await u.auth.signInWithPassword({email:n,password:j});if(i){W(`Este e-mail já está cadastrado. Faça login ou use "Esqueci minha senha".`,`error`),V(!1);return}let{data:a}=await u.from(`profiles`).select(`fornecedor_id`).eq(`id`,r.user.id).single();if(a?.fornecedor_id){W(`Este e-mail já possui um cadastro completo. Faça login para acessar o portal.`,`error`),await u.auth.signOut(),V(!1);return}e=r.user,t=!!r.session}let r={...P};r.cnpj_cpf&&=r.cnpj_cpf.replace(/\D/g,``),r.telefone&&=r.telefone.replace(/\D/g,``),r.cep&&=r.cep.replace(/\D/g,``),r.rg&&=r.rg.replace(/\D/g,``),r.pis_nit&&=r.pis_nit.replace(/\D/g,``),r.consentiu_politica=z,r.versao_politica=_e,r.email_corporativo=n,t&&e?(await f.criar(e.id,r),await f.finalizar(),u.functions.invoke(`notifier`,{body:{type:`FORNECEDOR_CADASTRADO`,payload:{email:n,razao_social:r.razao_social||`Fornecedor`}}}).catch(e=>d.warn(`Falha ao enviar e-mail de boas-vindas`,e))):ae(n,r),Ee(!0),W(`Cadastro realizado com sucesso`,`success`)}catch(e){d.error(`Erro no Registro:`,e),W(e instanceof Error?e.message:`Erro ao realizar cadastro`,`error`)}finally{V(!1)}};if(Te)return(0,E.jsx)(`div`,{className:`min-h-dvh flex items-center justify-center p-6 bg-[var(--background)]`,children:(0,E.jsx)(o.div,{initial:{opacity:0,scale:.97},animate:{opacity:1,scale:1},transition:{duration:.24,ease:[.4,.14,.3,1]},className:`max-w-md w-full bg-[var(--layer-01)] shadow-elevation-03`,children:(0,E.jsxs)(`div`,{className:`border-t-[3px] border-t-[var(--support-success)] p-8 sm:p-12 text-center flex flex-col items-center gap-4 sm:gap-6`,children:[(0,E.jsx)(`div`,{className:`flex items-center justify-center size-16 bg-[#defbe6] dark:bg-[#022d0d]`,children:(0,E.jsx)(c,{size:32,className:`text-[var(--support-success)]`})}),(0,E.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,E.jsx)(`h2`,{className:`text-2xl font-normal leading-[1.4] text-[var(--text-primary)]`,children:`Conta criada`}),(0,E.jsx)(`p`,{className:`text-sm leading-[1.43] text-[var(--text-secondary)]`,children:`Sua conta foi criada e os dados que você preencheu foram salvos com sucesso! Agora você já pode acessar o sistema para acompanhar o status do seu cadastro.`})]}),(0,E.jsxs)(`div`,{className:`w-full text-left bg-[var(--layer-02)] p-4 border-l-[3px] border-l-[var(--button-primary)]`,children:[(0,E.jsx)(`h4`,{className:`text-xs font-semibold uppercase tracking-[0.32px] text-[var(--text-secondary)] mb-3`,children:`Próximos passos`}),(0,E.jsxs)(`ul`,{className:`text-sm space-y-2 text-[var(--text-primary)] list-disc list-inside`,children:[(0,E.jsx)(`li`,{children:`Acesse a plataforma com seu e-mail e senha`}),(0,E.jsx)(`li`,{children:`Caso o seu cadastro esteja como Rascunho, conclua as etapas pendentes`}),(0,E.jsx)(`li`,{children:`Com o cadastro concluÃdo e aprovado, explore as licitações e envie propostas`})]})]}),(0,E.jsxs)(l,{variant:`primary`,size:`xl`,className:`w-full justify-between`,onClick:()=>De(`/login`),children:[`Ir para o login`,(0,E.jsx)(s,{size:20})]})]})})});let Pe=D.map((t,n)=>({label:t.label,status:n<e?`complete`:n===e?`current`:`incomplete`}));return(0,E.jsxs)(`div`,{className:`min-h-dvh flex bg-[var(--background)] text-[var(--text-primary)]`,children:[(0,E.jsxs)(`aside`,{"aria-label":`Etapas do cadastro`,className:`hidden lg:flex w-[320px] shrink-0 flex-col bg-[var(--background-inverse)] text-[var(--text-inverse)] sticky top-0 h-screen overflow-y-auto`,children:[(0,E.jsxs)(`div`,{className:`px-8 pt-10 pb-8 border-b border-[#393939]`,children:[(0,E.jsx)(`img`,{src:`/poiesis_logo_full.png`,alt:`Poiesis`,className:`h-12 w-auto object-contain mb-3`}),(0,E.jsx)(`p`,{className:`text-xs text-[#8d8d8d]`,children:`Portal do Fornecedor`})]}),(0,E.jsxs)(`div`,{className:`px-6 py-8 flex-1`,children:[(0,E.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.32px] text-[#8d8d8d] mb-4`,children:`Etapas`}),(0,E.jsx)(ue,{steps:Pe,orientation:`vertical`,className:`[&_li]:text-[var(--text-inverse)] [&_[data-status=complete]]:text-[var(--text-inverse)] [&_[data-status=incomplete]]:text-[#8d8d8d]`})]}),(0,E.jsxs)(`div`,{className:`px-6 py-6 border-t border-[#393939] space-y-6`,children:[(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.32px] text-[#8d8d8d] mb-3`,children:`Dicas desta etapa`}),(0,E.jsx)(`ul`,{className:`space-y-2 text-sm text-[#c6c6c6] leading-[1.43]`,children:ve[e]?.map((e,t)=>(0,E.jsxs)(`li`,{className:`flex items-start gap-2`,children:[(0,E.jsx)(`span`,{"aria-hidden":!0,
1className:`text-[var(--button-primary)] shrink-0`,children:`âº`}),e]},t))})]}),(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.32px] text-[#8d8d8d] mb-2`,children:`Já tem acesso?`}),(0,E.jsx)(r,{to:`/login`,className:`text-sm font-semibold text-[var(--button-primary)] hover:underline outline-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-white`,children:`Fazer login â`})]})]})]}),(0,E.jsxs)(`div`,{className:`flex-1 flex flex-col min-h-screen`,children:[(0,E.jsxs)(`header`,{className:`h-12 bg-[var(--layer-01)] border-b border-[var(--border-subtle-01)] flex items-center justify-between px-6 sm:px-8 sticky top-0 z-30`,children:[(0,E.jsxs)(`div`,{className:`flex items-center gap-3 text-sm`,children:[(0,E.jsxs)(`span`,{className:`text-[var(--text-secondary)]`,children:[`Etapa `,e+1,` de `,D.length]}),(0,E.jsx)(`span`,{className:`text-[var(--border-strong-01)]`,children:`·`}),(0,E.jsx)(`span`,{className:`font-semibold text-[var(--text-primary)]`,children:D[e].label})]}),(0,E.jsx)(r,{to:`/login`,className:`text-sm text-[var(--link-primary)] hover:underline outline-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[var(--focus)]`,children:`Já tenho acesso`})]}),(0,E.jsx)(`main`,{className:`flex-1 flex flex-col py-10 px-6 sm:px-10 lg:px-12`,children:(0,E.jsxs)(`div`,{className:`max-w-3xl w-full mx-auto lg:mx-0`,children:[(0,E.jsxs)(`div`,{className:`mb-10 pb-8 border-b border-[var(--border-subtle-01)] flex flex-col gap-2`,children:[(0,E.jsx)(`h1`,{className:`text-3xl font-normal leading-[1.2] tracking-[-0.01em] text-[var(--text-primary)]`,children:`Cadastro de novo fornecedor`}),(0,E.jsxs)(`p`,{className:`text-sm text-[var(--text-secondary)] leading-[1.43]`,children:[`Campos obrigatórios marcados com`,` `,(0,E.jsx)(`span`,{className:`text-[var(--support-error)] font-semibold`,children:`*`}),`.`]})]}),(0,E.jsx)(a,{mode:`wait`,children:(0,E.jsxs)(o.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},exit:{opacity:0,y:-8},transition:{duration:.24,ease:[.2,0,.38,.9]},children:[e===0&&(0,E.jsxs)(`div`,{className:`flex flex-col gap-8`,children:[(0,E.jsxs)(`section`,{children:[(0,E.jsx)(`h2`,{className:`text-xl font-normal leading-[1.4] text-[var(--text-primary)] mb-1`,children:`Credenciais de acesso`}),(0,E.jsx)(`p`,{className:`text-sm text-[var(--text-secondary)] mb-6`,children:`Defina o e-mail e a senha que serão usados para entrar no portal.`}),(0,E.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-4 sm:gap-6`,children:[(0,E.jsx)(v,{label:`E-mail corporativo`,required:!0,id:`email`,error:I.email,children:(0,E.jsx)(p,{type:`email`,inputMode:`email`,value:i,onChange:e=>{A(e.target.value),J(`email`)},placeholder:`[email protected]`,autoComplete:`email`})}),(0,E.jsx)(v,{label:`Senha`,required:!0,id:`password`,error:I.password??(j&&!q?`A senha ainda não atende todos os requisitos abaixo`:void 0),children:(0,E.jsxs)(`div`,{className:`relative w-full`,children:[(0,E.jsx)(p,{type:N?`text`:`password`,value:j,onChange:e=>{ye(e.target.value),J(`password`)},placeholder:`â¢â¢â¢â¢â¢â¢â¢â¢`,autoComplete:`new-password`,className:`pr-10`,"aria-describedby":`password-requirements`}),(0,E.jsx)(`button`,{type:`button`,onClick:()=>xe(e=>!e),"aria-label":N?`Ocultar senha`:`Mostrar senha`,className:`absolute right-1 top-1/2 -translate-y-1/2 flex items-center justify-center size-11 text-[var(--icon-primary)] hover:bg-[var(--layer-hover-01)] transition-colors duration-fast-02 ease-productive outline-none focus-visible:outline-2 focus-visible:outline-offset-[-2px] focus-visible:outline-[var(--focus)]`,children:N?(0,E.jsx)(ee,{size:20}):(0,E.jsx)(ne,{size:20})})]})}),(0,E.jsx)(`div`,{className:`md:col-span-2`,children:(0,E.jsx)(`ul`,{id:`password-requirements`,className:`grid grid-cols-1 sm:grid-cols-2 gap-2 p-3 bg-[var(--layer-02)] border border-[var(--border-subtle-01)]`,"aria-live":`polite`,children:Oe.map(e=>(0,E.jsxs)(`li`,{className:`flex items-center gap-2 text-xs leading-[1.33] ${e.met?`text-[var(--support-success)]`:`text-[var(--text-secondary)]`}
1`,children:[(0,E.jsx)(c,{size:14,"aria-hidden":!0,className:e.met?`text-[var(--support-success)] shrink-0`:`text-[var(--text-helper)] opacity-35 shrink-0`}),(0,E.jsx)(`span`,{children:e.label})]},e.id))})}),(0,E.jsx)(v,{label:`Confirmar senha`,required:!0,id:`confirmPassword`,error:I.confirmPassword??(M&&j!==M?`As senhas não coincidem`:void 0),children:(0,E.jsx)(p,{type:N?`text`:`password`,value:M,onChange:e=>{be(e.target.value),J(`confirmPassword`)},placeholder:`Repita a senha`,autoComplete:`new-password`})})]})]}),(0,E.jsxs)(`section`,{className:`pt-6 border-t border-[var(--border-subtle-01)]`,children:[(0,E.jsx)(`h2`,{className:`text-xl font-normal leading-[1.4] text-[var(--text-primary)] mb-1`,children:`Identificação`}),(0,E.jsx)(`p`,{className:`text-sm text-[var(--text-secondary)] mb-6`,children:`Informe o tipo de cadastro e os dados básicos.`}),(0,E.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-4 sm:gap-6`,children:[(0,E.jsx)(`div`,{className:`md:col-span-2`,children:(0,E.jsx)(v,{label:`Porte / natureza do proponente`,required:!0,id:`tipo_pessoa`,error:I.tipo_pessoa,children:(0,E.jsxs)(C,{onValueChange:e=>Z(`tipo_pessoa`,e),value:P.tipo_pessoa??``,children:[(0,E.jsx)(b,{children:(0,E.jsx)(y,{placeholder:`Selecione o tipo`})}),(0,E.jsxs)(x,{children:[(0,E.jsx)(S,{value:`Juridica`,children:`Pessoa JurÃdica (CNPJ) â Empresa, MEI, LTDA, S/A`}),(0,E.jsx)(S,{value:`Fisica`,children:`Pessoa FÃsica (CPF) â Autônomo, Consultor`})]})]})})}),(0,E.jsx)(v,{label:G?`CNPJ`:`CPF`,required:!0,id:`cnpj_cpf`,error:I.cnpj_cpf,children:(0,E.jsx)(p,{name:`cnpj_cpf`,inputMode:`numeric`,autoComplete:`off`,value:P.cnpj_cpf||``,onChange:X(`cnpj_cpf`,G?le:m),onBlur:je,placeholder:G?`00.000.000/0000-00`:`000.000.000-00`,disabled:Ce,className:`font-mono`})}),(0,E.jsx)(v,{label:K?`Nome completo`:`Razão social / nome completo`,required:!0,id:`razao_social`,error:I.razao_social,children:(0,E.jsx)(p,{name:`razao_social`,value:P.razao_social||``,onChange:Y,placeholder:K?`Seu nome completo`:`Razão social conforme cartão CNPJ`})}),K&&(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(v,{label:`RG`,required:!0,id:`rg`,error:I.rg,children:(0,E.jsx)(p,{name:`rg`,inputMode:`numeric`,value:P.rg||``,onChange:Y,placeholder:`00.000.000-0`})}),(0,E.jsx)(v,{label:`Ãrgão emissor`,required:!0,id:`orgao_emissor`,error:I.orgao_emissor,children:(0,E.jsx)(p,{name:`orgao_emissor`,value:P.orgao_emissor||``,onChange:Y,placeholder:`SSP/UF`})}),(0,E.jsx)(v,{label:`Data de nascimento`,required:!0,id:`data_nascimento`,error:I.data_nascimento,children:(0,E.jsx)(p,{name:`data_nascimento`,type:`date`,value:P.data_nascimento||``,onChange:Y})}),(0,E.jsx)(v,{label:`Estado civil`,required:!0,id:`estado_civil`,error:I.estado_civil,children:(0,E.jsxs)(C,{onValueChange:e=>Z(`estado_civil`,e),value:P.estado_civil??``,children:[(0,E.jsx)(b,{children:(0,E.jsx)(y,{placeholder:`Selecione`})}),(0,E.jsxs)(x,{children:[(0,E.jsx)(S,{value:`Solteiro`,children:`Solteiro`}),(0,E.jsx)(S,{value:`Casado`,children:`Casado`}),(0,E.jsx)(S,{value:`Divorciado`,children:`Divorciado`}),(0,E.jsx)(S,{value:`Viúvo`,children:`Viúvo`})]})]})})]}),G&&(0,E.jsxs)(`div`,{className:`md:col-span-2 grid grid-cols-1 md:grid-cols-2 gap-4`,children:[(0,E.jsx)(v,{label:`Nome do representante legal`,required:!0,id:`nome_representante`,error:I.nome_representante,children:(0,E.jsx)(p,{name:`nome_representante`,value:P.nome_representante||``,onChange:Y,placeholder:`Responsável pela empresa`})}),(0,E.jsx)(v,{label:`CPF do Representante`,required:!0,id:`cpf_representante`,error:I.cpf_representante,children:(0,E.jsx)(p,{name:`cpf_representante`,value:P.cpf_representante||``,onChange:X(`cpf_representante`,m),placeholder:`000.000.000-00`})}),(0,E.jsx)(v,{label:`RG do Representante`,required:!0,id:`rg_representante`,error:I.rg_representante,children:(0,E.jsx)(p,{name:`rg_representante`,value:P.rg_representante||``,onChange:Y,placeholder:`00.000.000-0`})}),(0,E.jsx)(v,{label:`Cargo do Representante`,required:!0,id:`cargo_representante`,error:I.cargo_representante,children:(0,E.jsx)(p,{name:`cargo_representante`,value:P.cargo_representante||``,onChange:Y,placeholder:`Ex.: Diretor, Sócio`})}),(0,E.jsx)(v,{label:`Telefone do Representante`,required:!0,id:`telefone_representante`,error:I.telefone_representante,children:(0,E.jsx)(p,{name:`telefone_representante`,value:P.telefone_representante||``,onChange:X(`telefone_representante`,h),placeholder:`(00) 00000-0000`})}),(0,E.jsx)(v,{label:`E-mail do Representante`,required:!0,id:`email_representante`,error:I.email_representante,children:(0,E.jsx)(p,{name:`email_representante`,type:`email`,inputMode:`email`,value:P.email_representante||``,onChange:Y,placeholder:`E-mail do responsável`})})]})]})]})]}),e===1&&(0,E.jsx)(`div`,{className:`flex flex-col gap-6`,children:(0,E.jsxs)(`section`,{children:[(0,E.jsx)(`h2`,{className:`text-xl font-normal leading-[1.4] text-[var(--text-primary)] mb-1`,children:`Localização e c
1ontato`}),(0,E.jsx)(`p`,{className:`text-sm text-[var(--text-secondary)] mb-6`,children:`Endereço e canais de contato usados em comunicações e contratos oficiais.`}),(0,E.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-6`,children:[(0,E.jsx)(v,{label:`CEP`,required:!0,id:`cep`,error:I.cep,children:(0,E.jsx)(p,{name:`cep`,inputMode:`numeric`,value:P.cep||``,onChange:X(`cep`,de),onBlur:Ae,placeholder:`00000-000`,className:`font-mono`})}),(0,E.jsx)(v,{label:`Telefone principal`,required:!0,id:`telefone`,error:I.telefone,children:(0,E.jsx)(p,{name:`telefone`,inputMode:`tel`,value:P.telefone||``,onChange:X(`telefone`,h),placeholder:`(00) 00000-0000`,className:`font-mono`})}),(0,E.jsx)(`div`,{className:`md:col-span-2`,children:(0,E.jsx)(v,{label:`Logradouro`,required:!0,id:`logradouro`,error:I.logradouro,children:(0,E.jsx)(p,{name:`logradouro`,value:P.logradouro||``,onChange:Y})})}),(0,E.jsx)(v,{label:`Número`,required:!0,id:`numero`,error:I.numero,children:(0,E.jsx)(p,{name:`numero`,value:P.numero||``,onChange:Y})}),(0,E.jsx)(v,{label:`Bairro`,required:!0,id:`bairro`,error:I.bairro,children:(0,E.jsx)(p,{name:`bairro`,value:P.bairro||``,onChange:Y})}),(0,E.jsx)(`div`,{className:`md:col-span-2`,children:(0,E.jsx)(v,{label:`Complemento (opcional)`,children:(0,E.jsx)(p,{name:`complemento`,value:P.complemento||``,onChange:Y})})}),(0,E.jsx)(v,{label:`Cidade`,required:!0,id:`cidade`,error:I.cidade,children:(0,E.jsx)(p,{name:`cidade`,value:P.cidade||``,onChange:Y})}),(0,E.jsx)(v,{label:`UF`,required:!0,id:`uf`,error:I.uf,children:(0,E.jsx)(p,{name:`uf`,value:P.uf||``,onChange:Y,maxLength:2,className:`uppercase`})})]})]})}),e===2&&(0,E.jsx)(`div`,{className:`flex flex-col gap-6`,children:(0,E.jsxs)(`section`,{children:[(0,E.jsx)(`h2`,{className:`text-xl font-normal leading-[1.4] text-[var(--text-primary)] mb-1`,children:`Dados fiscais e atuação`}),(0,E.jsx)(`p`,{className:`text-sm text-[var(--text-secondary)] mb-6`,children:`Informações exigidas para emissão de notas fiscais e compliance contratual.`}),(0,E.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-6`,children:[G&&(0,E.jsx)(`div`,{className:`md:col-span-2`,children:(0,E.jsx)(v,{label:`Regime de tributação`,required:!0,id:`regime_tributacao`,error:I.regime_tributacao,children:(0,E.jsxs)(C,{onValueChange:e=>Z(`regime_tributacao`,e),value:P.regime_tributacao??``,children:[(0,E.jsx)(b,{children:(0,E.jsx)(y,{placeholder:`Selecione`})}),(0,E.jsxs)(x,{children:[(0,E.jsx)(S,{value:`Simples Nacional`,children:`Simples Nacional`}),(0,E.jsx)(S,{value:`Lucro Presumido`,children:`Lucro Presumido`}),(0,E.jsx)(S,{value:`Lucro Real`,children:`Lucro Real`})]})]})})}),G&&(0,E.jsx)(v,{label:`Inscrição estadual`,helperText:`Para MEIs ou prestadores de serviço, marque 'Isento'.`,children:(0,E.jsxs)(`div`,{className:`flex flex-col gap-2 w-full`,children:[(0,E.jsx)(p,{name:`inscricao_estadual`,disabled:!!P.is_inscricao_estadual_isento,value:P.is_inscricao_estadual_isento?`Isento`:P.inscricao_estadual||``,onChange:Y}),(0,E.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,E.jsx)(_,{id:`isento_ie`,checked:!!P.is_inscricao_estadual_isento,onCheckedChange:e=>Q(`is_inscricao_estadual_isento`,!!e)}),(0,E.jsx)(g,{htmlFor:`isento_ie`,children:`Isento`})]})]})}),(0,E.jsx)(v,{label:`Inscrição municipal`,helperText:`Caso não possua ou seja isento na sua cidade, marque 'Isento'.`,children:(0,E.jsxs)(`div`,{className:`flex flex-col gap-2 w-full`,children:[(0,E.jsx)(p,{name:`inscricao_municipal`,disabled:!!P.is_inscricao_municipal_isento,value:P.is_inscricao_municipal_isento?`Isento`:P.inscricao_municipal||``,onChange:Y}),(0,E.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,E.jsx)(_,{id:`isento_im`,checked:!!P.is_inscricao_municipal_isento,onCheckedChange:e=>Q(`is_inscricao_municipal_isento`,!!e)}),(0,E.jsx)(g,{htmlFor:`isento_im`,children:`Isento`})]})]})}),K&&(0,E.jsx)(`div`,{className:`md:col-span-2`,children:(0,E.jsx)(v,{label:`PIS / PASEP / NIT`,required:!0,id:`pis_nit`,error:I.pis_nit,helperText:`Número do PIS, NIS ou NIT para contribuição.`,children:(0,E.jsx)(p,{name:`pis_
1nit`,inputMode:`numeric`,value:P.pis_nit||``,onChange:Y,placeholder:`000.00000.00-0`})})}),G&&(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(`datalist`,{id:`cnae-reg-options`,children:U.map(e=>(0,E.jsx)(`option`,{value:`${e.id} - ${e.descricao}`},e.id))}),(0,E.jsx)(`div`,{className:`md:col-span-2`,children:(0,E.jsx)(v,{label:`Segmento principal (CNAE)`,required:!0,id:`segmento_principal`,error:I.segmento_principal,helperText:`Código de Atividade - Encontrado no seu Cartão CNPJ`,children:(0,E.jsx)(p,{onFocus:ke,list:`cnae-reg-options`,name:`segmento_principal`,value:P.segmento_principal||``,onChange:Y})})}),(0,E.jsx)(`div`,{className:`md:col-span-2`,children:(0,E.jsx)(v,{label:`Segmento secundário (opcional)`,children:(0,E.jsx)(p,{onFocus:ke,list:`cnae-reg-options`,name:`segmento_secundario`,value:P.segmento_secundario||``,onChange:Y})})})]})]}),(0,E.jsxs)(`div`,{className:`mt-8 pt-6 border-t border-[var(--border-subtle-01)]`,children:[(0,E.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,E.jsx)(_,{id:`consentLGPD`,checked:z,onCheckedChange:e=>{Se(!!e),J(`consentLGPD`)},"aria-invalid":I.consentLGPD?!0:void 0,"aria-describedby":I.consentLGPD?`consentLGPD-error`:void 0}),(0,E.jsxs)(g,{htmlFor:`consentLGPD`,className:`text-sm font-normal leading-[1.43] text-[var(--text-secondary)] cursor-pointer`,children:[`Li e concordo com a`,` `,(0,E.jsx)(`a`,{href:`https://site.poiesis.org.br/politica-de-privacidade/`,target:`_blank`,rel:`noopener noreferrer`,className:`font-semibold text-[var(--link-primary)] hover:underline`,children:`PolÃtica de Privacidade`}),` `,`e autorizo o tratamento dos meus dados pessoais conforme a Lei Geral de Proteção de Dados (LGPD).`]})]}),I.consentLGPD&&(0,E.jsxs)(`p`,{id:`consentLGPD-error`,role:`alert`,className:`mt-2 inline-flex items-start gap-1 text-xs leading-[1.33] text-[var(--support-error)]`,children:[(0,E.jsx)(re,{size:16,className:`shrink-0 mt-0.5`}),(0,E.jsx)(`span`,{children:I.consentLGPD})]})]})]})}),(0,E.jsxs)(`footer`,{className:`mt-10 pt-6 border-t border-[var(--border-subtle-01)] flex flex-col-reverse sm:flex-row sm:justify-between gap-3`,children:[(0,E.jsxs)(l,{variant:`ghost`,disabled:e===0||B,onClick:()=>t(e=>e-1),children:[(0,E.jsx)(te,{size:20}),`Voltar`]}),e<D.length-1?(0,E.jsxs)(l,{variant:`primary`,onClick:Me,children:[`Próximo`,(0,E.jsx)(s,{size:20})]}):(0,E.jsx)(l,{variant:`primary`,disabled:B,onClick:Ne,children:B?(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(fe,{size:16,active:!0}),`Processando...`]}):(0,E.jsxs)(E.Fragment,{children:[`Finalizar e criar acesso`,(0,E.jsx)(s,{size:20})]})})]})]},e)})]})})]}),(0,E.jsx)(oe,{})]})}export{A 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.