import{d as N,r as U,B,D as l,o as i,a as d,b as c,e as s,h as E,w as p,t as u,j as f,f as e,v as S,x as V,g as y,l as g,i as $,F as _,n as j,E as b,s as x,q as A}from"./app-bWy6VYs1.js";import{_ as D}from"./ListTableActionLabel.vue_vue_type_script_setup_true_lang-BIAl7X25.js";import{u as w}from"./useAuthAbilities-Cb-lR8-z.js";import{_ as K}from"./AppLayout.vue_vue_type_script_setup_true_lang-BwuDxc8O.js";import{u as a}from"./index-B6UBqE7P.js";import{S as T}from"./square-pen-VTID55Gt.js";import"./index-C32fBP6Q.js";import"./index-CMWG4mbA.js";import"./useForwardExpose-Cx2E44RD.js";import"./VisuallyHidden-0BfmsMPn.js";import"./RovingFocusGroup-D20OvR_w.js";import"./useArrowNavigation-C6Y-ieo6.js";import"./_plugin-vue_export-helper-DmjF0He4.js";const W={key:0,class:"mx-4 mt-4 rounded border border-amber-300 bg-amber-50 px-4 py-3 text-amber-900"},q={class:"flex items-center justify-between gap-3 p-4"},z={class:"p-4"},F={class:"overflow-x-auto"},M={class:"min-w-full border"},I=["onClick","onKeydown"],L={class:"p-2"},P={class:"p-2"},G={class:"p-2"},ie=N({__name:"Index",props:{users:{},filters:{},licenseComplianceWarning:{}},setup(v){const k=w("users","create"),C=w("users","edit"),o=v,m=U(o.filters?.search??"");return B(m,n=>{const r={};n&&n.trim()&&(r.search=n.trim()),l.get(a.index().url,r,{preserveState:!0,replace:!0})}),(n,r)=>(i(),d(_,null,[c(s(E),{title:"Users"}),c(K,{breadcrumbs:[{title:"Users",href:s(a).index().url}]},{default:p(()=>[o.licenseComplianceWarning?(i(),d("div",W,u(o.licenseComplianceWarning),1)):f("",!0),e("div",q,[S(e("input",{"onUpdate:modelValue":r[0]||(r[0]=t=>m.value=t),type:"search",placeholder:"Search users...",class:"w-full max-w-sm rounded border px-3 py-2"},null,512),[[V,m.value]]),s(k)?(i(),y(s(g),{key:0,href:s(a).create().url,class:"rounded bg-blue-600 px-3 py-2 text-white"},{default:p(()=>[...r[2]||(r[2]=[$("New User",-1)])]),_:1},8,["href"])):f("",!0)]),e("div",z,[e("div",F,[e("table",M,[r[3]||(r[3]=e("thead",null,[e("tr",{class:"bg-gray-50"},[e("th",{class:"p-2 text-left"},"Name"),e("th",{class:"p-2 text-left"},"Email"),e("th",{class:"p-2 text-left"},"Type"),e("th",{class:"p-2 text-right"},"Actions")])],-1)),e("tbody",null,[(i(!0),d(_,null,j(o.users.data,t=>(i(),d("tr",{key:t.id,class:"cursor-pointer border-t hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-inset focus:ring-blue-500",tabindex:"0",role:"link",onClick:h=>s(l).visit(s(a).show(t.id).url),onKeydown:[b(x(h=>s(l).visit(s(a).show(t.id).url),["prevent"]),["enter"]),b(x(h=>s(l).visit(s(a).show(t.id).url),["prevent"]),["space"])]},[e("td",L,u(t.name),1),e("td",P,u(t.email),1),e("td",G,[e("span",{class:A([{"bg-green-100 text-green-800":t.user_type==="standard"||!t.user_type,"bg-yellow-100 text-yellow-800":t.user_type==="limited","bg-gray-100 text-gray-600":t.user_type==="info","bg-indigo-100 text-indigo-800":t.user_type==="client"},"inline-flex rounded-full px-2 py-0.5 text-xs font-semibold capitalize"])},u(t.user_type||"standard"),3)]),e("td",{class:"p-2 text-right",onClick:r[1]||(r[1]=x(()=>{},["stop"]))},[s(C)?(i(),y(s(g),{key:0,href:s(a).edit(t.id).url,class:"inline-flex items-center justify-center rounded bg-gray-200 px-2 py-1.5 md:px-3 md:py-1 text-sm font-medium text-gray-800 hover:bg-gray-300"},{default:p(()=>[c(D,{label:"Edit"},{default:p(()=>[c(s(T),{class:"h-4 w-4"})]),_:1})]),_:1},8,["href"])):f("",!0)])],40,I))),128))])])])])]),_:1},8,["breadcrumbs"])],64))}});export{ie as default};
