import{s as Y}from"./BRrjJgJc.js";import{a as j}from"./BLsGNFkl.js";import{s as M}from"./BeiPJ-Ey.js";import{s as H}from"./CG5Ae_0g.js";import{s as L}from"./BuPR-zpu.js";import{s as P}from"./BmkZKiAf.js";import{S as R,u as q}from"./ZIw2O0V5.js";import{E as F,I as G,J as u,b as J,p as k,o as r,c,K as e,v as n,y as s,L as d,u as p,m as h,z as x,C,O as m,Q as K,N as z,S as O}from"./CVN9mXi8.js";import"./Cnr6hwyY.js";import"./ByD9s0OG.js";import"./DOlpiDlz.js";import"./BzjqEU2Y.js";import"./2PnuRw05.js";import"./CeHl1rk9.js";import"./U-WKJCH1.js";import"./1kJjC6_k.js";import"./O5JmsoSo.js";import"./oLVS05MJ.js";const Q={class:"flex justify-between"},U={class:"text-xl m-2"},W=["href","onClick"],X={class:"text-primary font-semibold"},Z=["href","target"],oo={class:"text-surface-700 dark:text-surface-0"},so={class:"base-grid"},eo={class:"col-span-5"},to={class:"col-span-5 mt-6"},zo=F({__name:"index",setup(ao){const I=G(),A=u([{label:"Início",icon:"pi pi-home"},{label:"Segurança",icon:"pi pi-shield"},{label:"Grupos de usuários",faIcon:"users"}]),D=q(),l=u(),f=u([]);function N(t){return t?D(t).format("DD/MM/YYYY"):""}async function _(){R.gruposAcesso.findAll(l.value).then(t=>{f.value=t}).catch(t=>{console.error("Erro ao buscar grupos de acesso:",t),I.add({severity:"error",summary:"Erro ao buscar",detail:t})})}function V(t){O(`/seguranca/gruposAcesso/${t.data.id}`)}return J(()=>{_()}),(t,a)=>{const i=k("fa-icon"),w=k("router-link"),B=P,y=L,$=H,g=M,b=j,E=Y;return r(),c("div",null,[e(g,{class:"m-4 p-4"},{header:n(()=>[s("div",Q,[s("div",U,[e(B,{model:d(A)},{item:n(({item:o,props:v})=>[o.route?(r(),p(w,{key:0,to:o.route,custom:""},{default:n(({href:S,navigate:T})=>[s("a",h({href:S},v.action,{onClick:T}),[o.icon?(r(),c("i",{key:0,class:x([o.icon,"text-color"]),style:{"font-size":"1.5rem"}},null,2)):o.faIcon?(r(),p(i,{key:1,icon:o.faIcon,style:{"font-size":"1.5rem"}},null,8,["icon"])):C("",!0),s("span",X,m(o.label),1)],16,W)]),_:2},1032,["to"])):(r(),c("a",h({key:1,href:o.url,target:o.target},v.action),[o.icon?(r(),c("i",{key:0,class:x([o.icon,"text-color"]),style:{"font-size":"1.2rem"}},null,2)):o.faIcon?(r(),p(i,{key:1,icon:o.faIcon,style:{"font-size":"1.2rem"}},null,8,["icon"])):C("",!0),s("span",oo,m(o.label),1)],16,Z))]),_:1},8,["model"])]),s("div",null,[e(y,{as:"router-link",to:"/seguranca/gruposAcesso/_novo"},{default:n(()=>[e(i,{icon:"fas fa-file"}),a[1]||(a[1]=s("span",null,"Adicionar",-1))]),_:1})])])]),content:n(()=>[s("div",so,[s("div",eo,[a[2]||(a[2]=s("label",{for:"localizar"},"Localizar:",-1)),e($,{id:"localizar",modelValue:d(l),"onUpdate:modelValue":a[0]||(a[0]=o=>K(l)?l.value=o:null),fluid:""},null,8,["modelValue"])]),s("div",to,[e(y,{onClick:_},{default:n(()=>[e(i,{icon:"fas fa-magnifying-glass"}),a[3]||(a[3]=s("span",null,"Pesquisar",-1))]),_:1})])])]),_:1}),e(g,{class:"m-4"},{content:n(()=>[e(E,{"table-style":"min-width: 50rem",paginator:"",value:d(f),rows:10,"rows-per-page-options":[5,10,20],"selection-mode":"single",onRowClick:V},{empty:n(()=>a[4]||(a[4]=[z("Não há dados.")])),default:n(()=>[e(b,{field:"descricao",header:"Nome",sortable:""}),e(b,{field:"datHorAlteracao",header:"Data de alteração",sortable:""},{body:n(({data:o})=>[z(m(N(o.datHorAlteracao)),1)]),_:1})]),_:1},8,["value"])]),_:1})])}}});export{zo as default};
