import{_ as y}from"./nuxt-link.40687dc5.js";import{f as h,P as D,ap as x,E as C,T as k,y as E,z as R,D as p,_ as T,r as n,o as v,g as P,w as a,b as l,a as g}from"./entry.c7cd0af6.js";import{i as B}from"./utils.1db1ba01.js";const N=h({components:{BTable:D,UserList:x,EntityDelete:C,Timeago:k},emits:["deleted"],setup(e,{emit:c}){const u=s=>{c("deleted",s)},o=E(),{realm:_,realmManagementId:f}=R(o),i={filter:{realm_id:[f.value,null]}},d=s=>B(_.value,s.realm_id),r=o.has(p.USER_EDIT),m=o.has(p.USER_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:i}}},"$VqpaJbAmv2"),U=g("i",{class:"fa-solid fa-bars"},null,-1);function q(e,c,u,o,_,f){const i=n("Timeago"),d=y,r=n("EntityDelete"),m=n("BTable"),b=n("UserList");return v(),P(b,{"header-title":{icon:"fa-solid fa-list pe-1",content:"Overview"},query:e.query,body:{tag:"div"},footer:!0,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(i,{datetime:t.item.created_at},null,8,["datetime"])]),"cell(updated_at)":a(t=>[l(i,{datetime:t.item.created_at},null,8,["datetime"])]),"cell(options)":a(t=>[l(d,{to:"/admin/users/"+t.item.id,class:"btn btn-xs btn-outline-primary me-1",disabled:!e.hasEditPermission||!e.isResourceWritable(t.item)},{default:a(()=>[U]),_:2},1032,["to","disabled"]),l(r,{class:"btn btn-xs btn-outline-danger","entity-id":t.item.id,"entity-type":"user","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 L=T(N,[["render",q]]);export{L as default};
