import{_ as y}from"./nuxt-link.40687dc5.js";import{f as h,P as D,ah as x,E as C,T as R,y as k,z as E,D as p,_ as T,r as i,o as P,g as v,w as a,b as l,a as g}from"./entry.c7cd0af6.js";import{i as B}from"./utils.1db1ba01.js";const L=h({components:{BTable:D,RoleList:x,EntityDelete:C,Timeago:R},emits:["deleted"],setup(e,{emit:c}){const u=s=>{c("deleted",s)},o=k(),{realm:_,realmManagementId:f}=E(o),n={filter:{realm_id:[f.value,null]}},d=s=>B(_.value,s.realm_id),r=o.has(p.ROLE_EDIT),m=o.has(p.ROLE_DROP);return{fields:[{key:"id",label:"ID",thClass:"text-left",tdClass:"text-left"},{key:"name",label:"Name",thClass:"text-left",tdClass:"text-left"},{key:"created_at",label:"Created at",thClass:"text-center",tdClass:"text-center"},{key:"updated_at",label:"Updated at",thClass:"text-left",tdClass:"text-left"},{key:"options",label:"",tdClass:"text-left"}],isResourceWritable:d,hasEditPermission:r,hasDropPermission:m,handleDeleted:u,query:n}}},"$yv05xeSROq"),N=g("i",{class:"fa-solid fa-bars"},null,-1);function q(e,c,u,o,_,f){const n=i("Timeago"),d=y,r=i("EntityDelete"),m=i("BTable"),b=i("RoleList");return P(),v(b,{"header-title":{icon:"fa-solid fa-list pe-1",content:"Overview"},query:e.query,onDeleted:e.handleDeleted},{body:a(s=>[l(m,{items:s.data,fields:e.fields,busy:s.busy,"head-variant":"'dark'",outlined:""},{"cell(created_at)":a(t=>[l(n,{datetime:t.item.created_at},null,8,["datetime"])]),"cell(updated_at)":a(t=>[l(n,{datetime:t.item.created_at},null,8,["datetime"])]),"cell(options)":a(t=>[l(d,{to:"/admin/roles/"+t.item.id,class:"btn btn-xs btn-outline-primary me-1",disabled:!e.hasEditPermission||!e.isResourceWritable(t.item)},{default:a(()=>[N]),_:2},1032,["to","disabled"]),l(r,{class:"btn btn-xs btn-outline-danger","entity-id":t.item.id,"entity-type":"role","with-text":!1,disabled:!e.hasDropPermission||!e.isResourceWritable(t.item),onDeleted:s.deleted},null,8,["entity-id","disabled","onDeleted"])]),_:2},1032,["items","fields","busy"])]),_:1},8,["query","onDeleted"])}const W=T(L,[["render",q]]);export{W as default};
