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