import{C as e,D as t,E as n,G as r,L as i,Q as a,R as o,S as s,W as c,Y as l,Z as u,et as d,i as f,k as p,m,r as h,tt as g,v as _,w as v,x as y}from"./app-CAV_k0tk.js";import{t as b}from"./i18n-CNs07Srl.js";import{n as x,t as S}from"./AppLayout-DsKf8YtU.js";var C={class:`mx-auto max-w-[var(--c-container)]`},w={class:`mb-5 flex flex-wrap items-center gap-3`},T={class:`text-2xl font-extrabold tracking-tight`},E={class:`text-sm text-ink-muted`},D={class:`ml-auto flex items-center gap-2 rounded-full border border-line bg-surface px-4 py-2`},O=[`placeholder`],k=[`value`],A={value:`newest`},j={value:`name`},M={value:`posts`},N={key:0,class:`rounded-c border border-dashed border-line bg-surface p-12 text-center text-ink-muted`},P={key:1,class:`grid gap-4 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4`},F={class:`mt-3 flex items-center gap-1.5`},I={class:`font-bold`},L={key:0,class:`rounded bg-primary px-1.5 py-0.5 text-[10px] font-bold uppercase text-white shadow-sm`},R={key:0,class:`mt-1 line-clamp-2 text-xs text-ink-2`},z={class:`mt-3 flex items-center gap-3 text-xs text-ink-muted`},B={key:2,class:`py-6 text-center`},V=p({__name:`Index`,props:{q:{},sort:{},members:{},total:{}},setup(p){let V=p,H=l(V.q),U=null;function W(){clearTimeout(U),U=setTimeout(()=>g.get(`/members`,{q:H.value,sort:V.sort},{preserveState:!0,replace:!0}),300)}function G(e){g.get(`/members`,{q:H.value,sort:e.target.value},{preserveState:!0})}return(l,g)=>(i(),v(_,null,[t(u(h),{title:u(b)(`Members`)},null,8,[`title`]),t(S,null,{default:c(()=>[y(`div`,C,[y(`div`,w,[y(`div`,null,[y(`h1`,T,d(u(b)(`Members`)),1),y(`p`,E,d(p.total)+` `+d(p.total===1?u(b)(`member`):u(b)(`members`)),1)]),y(`div`,D,[g[1]||=y(`svg`,{width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,class:`text-ink-muted`},[y(`circle`,{cx:`11`,cy:`11`,r:`7`}),y(`path`,{d:`m21 21-4.3-4.3`})],-1),r(y(`input`,{"onUpdate:modelValue":g[0]||=e=>H.value=e,onInput:W,type:`search`,placeholder:u(b)(`Find a member…`),class:`w-44 border-0 bg-transparent p-0 text-sm text-ink placeholder:text-ink-muted focus:ring-0`},null,40,O),[[m,H.value]])]),y(`select`,{value:p.sort,onChange:G,class:`rounded-lg border-line bg-surface py-1.5 text-[13px] font-semibold text-ink-2 shadow-sm focus:ring-primary`},[y(`option`,A,d(u(b)(`Newest`)),1),y(`option`,j,d(u(b)(`Name (A–Z)`)),1),y(`option`,M,d(u(b)(`Most posts`)),1)],40,k)]),p.members.data.length?(i(),v(`div`,P,[(i(!0),v(_,null,o(p.members.data,n=>(i(),s(u(f),{key:n.id,href:n.url,class:`flex flex-col items-center rounded-c border border-line bg-surface p-6 text-center shadow-sm transition hover:-translate-y-0.5 hover:shadow-md`},{default:c(()=>[t(x,{avatar:n,size:88},null,8,[`avatar`]),y(`div`,F,[y(`span`,I,d(n.name),1),n.isAdmin?(i(),v(`span`,L,d(u(b)(`Admin`)),1)):n.trust?(i(),v(`span`,{key:1,class:a([`rounded px-1.5 py-0.5 text-[10px] font-semibold`,n.trust.level>=4?`bg-amber-400/20 text-amber-500`:n.trust.level>=1?`bg-primary/15 text-primary`:`bg-ink/10 text-ink-muted`])},d(n.trust.level>=4?`★ `:``)+d(u(b)(n.trust.label)),3)):e(``,!0)]),n.bio?(i(),v(`p`,R,d(n.bio),1)):e(``,!0),y(`div`,z,[y(`span`,null,d(u(b)(`{n} posts`,{n:n.posts})),1),g[2]||=y(`span`,null,`·`,-1),y(`span`,null,d(u(b)(`Joined {date}`,{date:n.joined})),1)])]),_:2},1032,[`href`]))),128))])):(i(),v(`div`,N,d(u(b)(`No members found.`)),1)),p.members.next?(i(),v(`div`,B,[t(u(f),{href:p.members.next,class:`rounded-c border border-line bg-surface px-5 py-2.5 text-sm font-semibold hover:bg-surface-2`},{default:c(()=>[n(d(u(b)(`Load more`)),1)]),_:1},8,[`href`])])):e(``,!0)])]),_:1})],64))}});export{V as default};