PageSourceSearch

https://santabarbara.ba.gov.br/assets/EmendasParlamentaresLista-CbOQ6mUs.js

js santabarbara.ba.gov.br collected 2026-10-02 22:38:03 UTC 6,643 bytes, 1 lines download raw bytes

1import{j as e,u as V}from"./vendor-query-CAW0R6Fd.js";import{j as Z,N as ee,r as t,L as B}from"./vendor-react-BIBNHc4z.js";import{a7 as se,S as ae,H as te,B as H,A as re,j as S,k as v,p as oe,t as O,v as P,V as le,a as ne,o as ie,c as ce,b3 as de,F as me}from"./index-Dr2jZQpy.js";import{I as L}from"./input-Bu5ViSvB.js";import{S as N,a as b,b as C,c as T,d as l}from"./select-FsSDRbDW.js";import{T as ue,a as xe,b as M,c as u,d as he,e as x}from"./table-DreTqTUZ.js";import{e as je,a as pe}from"./emendas.service-CURCAidt.js";import{b as R,S as U,c as fe,a as ge,d as Se}from"./emendas-helpers-DKlxE0HY.js";import"./ui-radix-CMPBktV5.js";import"./utils-objBp_8x.js";function $(n,h,r=""){var m;const i=(m=n==null?void 0:n[h])==null?void 0:m.valor;if(i==null)return r;if(typeof i=="string")return i;try{return String(i)}catch{return r}}function _e(){const{esfera:n=""}=Z(),{configuracoes:h}=se(),r=Se[n];if(!r)return e.jsx(ee,{to:"/emendas-parlamentares",replace:!0});const i=$(h,`emendas_titulo_${n}`,`Emendas ${R[r]}is`),m=$(h,`emendas_texto_${n}`,""),[y,I]=t.useState(""),[w,q]=t.useState(""),[j,z]=t.useState("todos"),[d,D]=t.useState("todos"),[p,K]=t.useState("todos"),[f,k]=t.useState("todos"),[E,G]=t.useState(""),{data:o=[],isLoading:Q}=V({queryKey:["emendas","public",r],queryFn:()=>je.listPublic({esfera:r,pageSize:200})}),{data:A=[]}=V({queryKey:["emendas","declaracoes","public",r],queryFn:()=>pe.listPublic({escopo:r==="federal"?"federal":"estadual_municipal"})}),_=t.useMemo(()=>{const s=y.trim().toLowerCase(),a=w.trim().toLowerCase(),g=E.trim().toLowerCase();return o.filter(c=>{var F;return!(s&&!((F=c.titulo)!=null&&F.toLowerCase().includes(s))||a&&!(c.orgao||"").toLowerCase().includes(a)||j!=="todos"&&c.status!==j||d!=="todos"&&String(c.ano??"")!==d||p!=="todos"&&c.parlamentar!==p||f!=="todos"&&(c.tipo_emenda||"")!==f||g&&!(c.objeto||"").toLowerCase().includes(g))})},[o,y,w,j,d,p,f,E]),J=t.useMemo(()=>{const s=new Set;return o.forEach(a=>{a.ano&&s.add(a.ano)}),Array.from(s).sort((a,g)=>g-a)},[o]),W=t.useMemo(()=>{const s=new Set;return o.forEach(a=>a.parlamentar&&s.add(a.parlamentar)),Array.from(s).sort()},[o]),X=t.useMemo(()=>{const s=new Set;return o.forEach(a=>a.tipo_emenda&&s.add(a.tipo_emenda)),Array.from(s).sort()},[o]),Y=t.useMemo(()=>{const s=new Set;return o.forEach(a=>a.status&&s.add(a.status)),Array.from(s)},[o]);return e.jsxs("div",{className:"min-h-screen flex flex-col",children:[e.jsx(ae,{title:`${i} | Emendas Parlamentares`,description:`Consulta pública de emendas parlamentares ${R[r].toLowerCase()}is`}),e.jsx(te,{}),e.jsx("main",{className:"flex-1 container mx-auto py-8 px-4",children:e.jsxs("div",{className:"max-w-6xl mx-auto space-y-6",children:[e.jsx(H,{asChild:!0,variant:"ghost",size:"sm",className:"-ml-2",children:e.jsxs(B,{to:"/emendas-parlamentares",children:[e.jsx(re,{className:"h-4 w-4 mr-2"})," Voltar"]})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-3xl md:text-4xl font-bold mb-2",children:i}),e.jsx("p",{className:"text-muted-foreground",children:"Consulte as emendas de forma transparente e acessível."})]}),m&&e.jsx(S,{className:"bg-muted/40",children:e.jsx(v,{className:"pt-6",children:e.jsx("div",{className:"prose prose-sm md:prose-base max-w-none text-foreground",dangerouslySetInnerHTML:{__html:oe.sanitize(m)}})})}),e.jsxs(S,{children:[e.jsx(O,{children:e.jsxs(P,{className:"flex items-center gap-2 text-lg",children:[e.jsx(le,{className:"h-5 w-5"})," Filtros"]})}),e.jsxs(v,{className:"grid grid-cols-1 md:grid-cols-3 gap-3",children:[e.jsxs(N,{value:d,onValueChange:D,children:[e.jsx(b,{children:e.jsx(C,{placeholder:"Exercício"})}),e.jsxs(T,{children:[e.jsx(l,{value:"todos",children:"Todos os exercícios"}),J.map(s=>e.jsx(l,{value:String(s),children:s},s))]})]}),e.jsxs(N,{value:p,onValueChange:K,children:[e.jsx(b,{children:e.jsx(C,{placeholder:"Autor"})}),e.jsxs(T,{children:[e.jsx(l,{value:"todos",children:"Todos os autores"}),W.map(s=>e.jsx(l,{value:s,children:s},s))]})]}),e.jsxs(N,{value:f,onValueChange:k,children:[e.jsx(b,{children:e.jsx(C,{placeholder:"Tipo"})}),e.jsxs(T,{children:[e.jsx(l,{value:"todos",children:"Todos os tipos"}),X.map(s=>e.jsx(l,{value:s,children:s},s))]})]}),e.jsx(L,{placeholder:"Objeto",value:E,onChange:s=>G(s.target.value.slice(0,100)),maxLength:100}),e.jsxs("div",{className:"relative",children:[e.jsx(ne,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),e.jsx(L,{className:"pl-9",placeholder:"Buscar por título...",value:y,onChange:s=>I(s.target.value.slice(0,100)),maxLength:100})]}),e.jsx(L,{placeholder:"Órgão",value:w,onChange:s=>q(s.target.value.slice(0,100)),maxLength:100}),e.jsxs(N,{value:j,onValueChange:z,children:[e.jsx(b,{children:e.jsx(C,{placeholder:"Status"})}),e.jsxs(T,{children:[e.jsx(l,{value:"todos",children:"Todos os status"}),Y.map(s=>e.jsx(l,{value:s,children:U[s]||s},s))]})]})]})]}),A.length>0&&e.jsxs(S,{className:"border-dashed",children:[e.jsx(O,{children:e.jsx(P,{className:"text-lg",children:"Exercícios sem ocorrência"})}),e.jsx(v,{className:"space-y-2",children:A.filter(s=>d==="todos"||String(s.ano)===d).map(s=>e.jsxs("p",{className:"text-sm",children:[e.jsxs("span",{className:"font-medium",children:[s.ano,":"]})," ",s.descricao]},s.id))})]}),e.jsx(S,{children:e.jsx(v,{className:"pt-6",children:Q?e.jsx("div",{className:"space-y-3",children:Array.from({length:4}).map((s,a)=>e.jsx("div",{className:"h-12 bg-muted animate-pulse rounded"},a))}):_.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center py-12",children:[e.jsx(ie,{className:"h-12 w-12 text-muted-foreground mb-4"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Nenhuma emenda encontrada com os filtros aplicad
1os."})]}):e.jsx("div",{className:"overflow-x-auto",children:e.jsxs(ue,{children:[e.jsx(xe,{children:e.jsxs(M,{children:[e.jsx(u,{children:"Órgão"}),e.jsx(u,{children:"Título da Emenda"}),e.jsx(u,{children:"Status"}),e.jsx(u,{children:"Data"}),e.jsx(u,{className:"text-right",children:"Ações"})]})}),e.jsx(he,{children:_.map(s=>e.jsxs(M,{children:[e.jsx(x,{className:"max-w-[200px] truncate",children:s.orgao||"—"}),e.jsx(x,{className:"font-medium max-w-[320px] truncate",children:s.titulo}),e.jsx(x,{children:e.jsx(ce,{variant:fe[s.status]||"outline",children:U[s.status]||s.status})}),e.jsx(x,{children:ge(s.data_emenda||s.data_indicacao)}),e.jsx(x,{className:"text-right",children:e.jsx(H,{asChild:!0,variant:"outline",size:"sm",children:e.jsxs(B,{to:`/emendas-parlamentares/${s.id}`,children:[e.jsx(de,{className:"h-4 w-4 mr-1"})," Ver"]})})})]},s.id))})]})})})})]})}),e.jsx(me,{})]})}export{_e 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.