1import{r as u,u as $,j as e,f as z,a as O,S as M,B as N,b as ne,c as ae,i as U,d as de,e as me,g as ue,h as be,k as pe,L as X,l as xe}from"./index-_aijvlUq.js";import{u as he,P as ge}from"./PageHeader-DCofr6qo.js";import{u as R}from"./useMemberStore-C9_FW8gS.js";import{T as fe,a as B,b as G,c as K,d as P,e as q}from"./Table-Yng-lqpt.js";import{E as ve}from"./EmptyState-CPGKooqj.js";import{M as je}from"./EmptyIllustrations-D77xBxjU.js";import{S as ye}from"./Skeleton-B3Wj6cNd.js";import{A as Se}from"./Avatar-BMcjKrGk.js";import{S as Ne}from"./StatusBadge-CHI7aYVl.js";import{I as Y}from"./InstrumentTag-CHdSvMU6.js";import{O as ke,o as we}from"./orgRoles-D1oGgqrm.js";import{m as re}from"./members-I3UAoZ9P.js";import{b as W}from"./badges-sJrwZCWE.js";import{p as Ie}from"./paletteHash-DBBw93pZ.js";import{S as Ce,a as Ae}from"./SmartImportSheet-D3pCNeZ6.js";import{B as Me}from"./BottomSheet-BiQNSujt.js";import{e as Te}from"./ensembles-WGlB365j.js";import{i as Le}from"./instruments-CRxWHJ-h.js";import{M as Pe}from"./MobileListSkeleton-BxuyWDCs.js";import{U as _e}from"./UsageLimitBanner-FQhQBbSE.js";import{A as Re}from"./ActiveFiltersBar-DPDav4h_.js";import{d as Ee}from"./exportCsv-CZAUSrIW.js";import"./Badge-DJIi163x.js";import"./downscaleImage-qyGK-a3D.js";import"./SmartImportWizard-C34JU9cR.js";import"./WizardShell-BAf42hnX.js";import"./resizeImage-BUqRBCBG.js";function ie(){const{members:t,pagination:a,filters:n,isLoading:o,error:b,fetchMembers:d,setFilters:l,resetFilters:i,deleteMember:h}=R();return u.useEffect(()=>{d({page:1})},[n.search,n.status,n.instrumentId,n.instrumentFamily,n.sectionId,n.ensembleId,n.orgRole,n.joinedAfter,n.photoPermission,n.smsConsent,n.sortBy,n.sortDir]),{members:t,pagination:a,filters:n,isLoading:o,error:b,setFilters:l,resetFilters:i,goToPage:r=>d({page:r}),deleteMember:h,refresh:()=>d()}}function Fe({member:t,canClick:a=!0,selectMode:n=!1,isSelected:o=!1,onToggleSelect:b}){const d=$(),l=t.ensembles?.filter(r=>r.instrument)??[],h=new Set(l.map(r=>r.instrument.instrumentId)).size>1,g=l[0]?.instrument??t.instruments?.[0];return e.jsxs(fe,{onClick:a?()=>d(`/members/${t.id}`):void 0,children:[n&&e.jsx("td",{className:"px-4 py-3 w-8",onClick:r=>r.stopPropagation(),children:e.jsx("input",{type:"checkbox",className:"h-4 w-4 rounded border-gray-300 text-band-600 focus:ring-band-500 cursor-pointer",checked:o,onChange:b,"aria-label":`Select ${t.firstName} ${t.lastName}`})}),e.jsx(B,{children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(Se,{src:t.photoUrl,firstName:t.firstName,lastName:t.lastName,size:"sm"}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:`font-medium ${t.memberStatus==="inactive"?"text-gray-400":"text-gray-900"}`,children:z(t)}),t.memberType==="director"&&e.jsx("span",{className:"inline-flex items-center px-1.5 py-0.5 rounded text-xs font-semibold bg-purple-100 text-purple-700",children:"Director"})]}),(()=>{const r=t.roleAliases?Object.values(t.roleAliases)[0]:null,p=r||t.emailAddress;return p?e.jsx("a",{href:`mailto:${p}`,onClick:c=>c.stopPropagation(),className:"text-xs text-gray-500 hover:text-band-600 hover:underline",title:r?"Role email":"Personal email",children:p}):null})(),t.accountAuthority&&e.jsx("div",{className:"flex flex-wrap gap-1 mt-0.5",children:e.jsx("span",{className:`inline-flex items-center px-1.5 py-0.5 rounded text-xs font-semibold ${t.accountAuthority==="owner"?"bg-amber-100 text-amber-800":"bg-slate-100 text-slate-700"}`,children:t.accountAuthority==="owner"?"Owner":"Admin"})}),(()=>{const r=[...new Set([...t.isSectionLeader?["section_leader"]:[],...t.orgRoles??[]])].filter(c=>c!=="member"),p=Object.fromEntries(ke.map((c,v)=>[c.value,v]));return r.sort((c,v)=>(p[c]??99)-(p[v]??99)),r.length===0?null:e.jsxs("div",{className:"flex flex-wrap gap-1 mt-0.5",children:[r.slice(0,2).map(c=>e.jsx("span",{className:`inline-flex items-center px-1.5 py-0.5 rounded text-xs font-semibold ${c==="section_leader"?"bg-band-100 text-band-700":"bg-teal-100 text-teal-700"}`,children:we(c)},c)),r.length>2&&e.jsxs("span",{className:"inline-flex items-center px-1.5 py-0.5 rounded text-xs font-semibold bg-gray-100 text-gray-500",children:["+",r.length-2]})]})})()]})]})}),e.jsx(B,{children:e.jsx(Ne,{status:t.memberStatus})}),e.jsx(B,{children:t.ensembles?.length>0?e.jsx("div",{className:"flex flex-wrap gap-1",children:t.ensembles.map(r=>e.jsx("span",{className:"px-2 py-0.5 rounded-full bg-accent-100 text-accent-700 text-xs font-medium",children:r.name},r.id))}):e.jsx("span",{className:"text-gray-400 text-xs",children:"â"})}),e.jsx(B,{children:h?e.jsx("div",{className:"space-y-1",children:l.map(r=>e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(Y,{name:r.instrument.name,family:r.instrument.family}),e.jsxs("span",{className:"text-gray-400 text-xs whitespace-nowrap",children:["(",r.name,")"]})]},r.id))}):g?e.jsx(Y,{name:g.name,family:g.family}):e.jsx("span",{className:"text-gray-400 text-xs",children:"â"})})]})}function ze({value:t,onChange:a}){const n=u.useRef(null);return e.jsxs("div",{className:"relative",children:[e.jsx("svg",{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-400 pointer-events-none",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),e.jsx("input",{ref:n,type:"search",value:t,onChange:o=>a(o.target.value),placeholder:"Search members...",className:"block w-64 pl-9 pr-3 py-2 rounded-md border border-gray-300 bg-white text-sm shadow-sm placeholder:text-gray-400 focus:outline-none focus:ring-2 focus:ring-band-500 focus:border-band-500"})]})}const le=(t,a)=>t.label.localeCompare(a.label,void 0,{numeric:!0}),$e=[{value:"active",label:"Active"},{value:"inactive",label:"Inactive"},{value:"retired",label:"Alumni"}].sort(le),Oe=[{value:"president",label:"President"},{value:"vice_president",label:"Vice President"},{value:"music_director",label:"Music Director"},{value:"band_manager",label:"Band Manager"},{value:"treasurer",label:"Treasurer"},{value:"secretary",label:"Secretary"},{value:"marketing_director",label:"Marketing Director"},{value:"assistant_conductor",label:"Assistant Conductor"},{value:"membership_coordinator",label:"Membership Coordinator"},{value:"fundraising_coordinator",label:"Fundraising Coordinator"},{value:"attendance_taker",label:"Attendance Taker"},{value:"equipment_manager",label:"Equipment Manager"},{value:"librarian",label:"Librarian"},{value:"section_leader",label:"Section Leader"},{value:"member",label:"Member"}].sort(le),Be={flute:"Flute",clarinet:"Clarinet",saxophone:"Saxophone","double reed":"Double Reed",horn:"Horn",trumpet:"Trumpet",trombone
1:"Trombone",euphonium:"Euphonium",tuba:"Tuba",percussion:"Percussion",string:"String",keyboard:"Keyboard",vocal:"Vocal"};function We({filters:t,onFilter:a,onReset:n}){const[o,b]=u.useState({ensembles:[],sections:[],families:[],instruments:[]}),{canFully:d}=O(),l=d("members:read_sensitive"),i=l&&!!(t.photoPermission||t.smsConsent),[h,g]=u.useState(!1),r=l&&(h||i);u.useEffect(()=>{re.filterOptions({status:t.status,ensembleId:t.ensembleId,sectionId:t.sectionId,instrumentFamily:t.instrumentFamily}).then(b).catch(()=>{})},[t.status,t.ensembleId,t.sectionId,t.instrumentFamily]);const p=!!(t.search||t.status||t.instrumentId||t.instrumentFamily||t.sectionId||t.ensembleId||t.orgRole||t.photoPermission||t.smsConsent),c=o.ensembles.map(s=>({value:s.id,label:s.name})),v=(o.sections||[]).map(s=>({value:s.id,label:s.name})),y=(o.families||[]).map(s=>({value:s,label:Be[s]??s})),k=o.instruments.map(s=>({value:s.id,label:s.name}));function x(s){a({sectionId:s.target.value,instrumentId:""})}function m(s){a({instrumentFamily:s.target.value,instrumentId:""})}return e.jsxs("div",{className:"flex flex-wrap items-center gap-3 min-w-0 pr-1",children:[e.jsx(M,{placeholder:"All statuses",options:$e,value:t.status||"",active:!!t.status&&t.status!=="active",onChange:s=>a({status:s.target.value}),className:"w-36"}),e.jsx(M,{placeholder:"All roles",options:Oe,value:t.orgRole||"",active:!!t.orgRole,onChange:s=>a({orgRole:s.target.value}),className:"w-44"}),c.length>0&&e.jsx(M,{placeholder:"All ensembles",options:c,value:t.ensembleId||"",active:!!t.ensembleId,onChange:s=>a({ensembleId:s.target.value}),className:"w-44"}),v.length>0&&e.jsx(M,{placeholder:"All sections",options:v,value:t.sectionId||"",active:!!t.sectionId,onChange:x,className:"w-40"}),y.length>0&&e.jsx(M,{placeholder:"All families",options:y,value:t.instrumentFamily||"",active:!!t.instrumentFamily,onChange:m,className:"w-40"}),k.length>0&&e.jsx(M,{placeholder:"All instruments",options:k,value:t.instrumentId||"",active:!!t.instrumentId,onChange:s=>a({instrumentId:s.target.value}),className:"w-44"}),l&&e.jsxs(N,{variant:"ghost",size:"sm",onClick:()=>g(s=>!s),"aria-expanded":r,children:["Advanced search",e.jsx("svg",{className:`h-4 w-4 ml-1 inline transition-transform ${r?"rotate-180":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})]}),p&&e.jsx(N,{variant:"ghost",size:"sm",onClick:n,children:"Clear filters"}),r&&e.jsxs("div",{className:"w-full flex flex-wrap items-center gap-3 pt-2 border-t border-gray-100",children:[e.jsx("span",{className:"text-xs font-semibold text-gray-400 uppercase tracking-wide",children:"Member details"}),e.jsx(M,{placeholder:"Photos: any answer",options:[{value:"granted",label:"Photos OK"},{value:"declined",label:"Photos declined"},{value:"none",label:"No photo answer"}],value:t.photoPermission||"",active:!!t.photoPermission,onChange:s=>a({photoPermission:s.target.value}),className:"w-44"}),e.jsx(M,{placeholder:"Texting: any status",options:[{value:"granted",label:"Text consent given"},{value:"none",label:"No text consent"}],value:t.smsConsent||"",active:!!t.smsConsent,onChange:s=>a({smsConsent:s.target.value}),className:"w-44"})]})]})}const De={active:"Active",inactive:"Inactive",retired:"Alumni",invite_sent:"Invite Sent",invite_pending_approval:"Pending Approval"},Ue={flute:"Flute",clarinet:"Clarinet",saxophone:"Saxophone","double reed":"Double Reed",horn:"Horn",trumpet:"Trumpet",trombone:"Trombone",euphonium:"Euphonium",tuba:"Tuba",percussion:"Percussion",string:"String",keyboard:"Keyboard",vocal:"Vocal"};function _({label:t,onRemove:a}){return e.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full bg-band-100 text-band-700 text-xs font-medium",children:[t,e.jsx("button",{type:"button",onClick:a,className:"hover:text-band-900 leading-none",children:"Ã"})]})}function J({label:t,sortKey:a,filters:n,setFilters:o}){const b=n.sortBy===a,d=b&&n.sortDir==="asc"?"desc":"asc";return e.jsxs("th",{className:"px-4 py-3 text-left text-xs font-semibold text-gray-500 uppercase tracking-wide cursor-pointer select-none hover:text-gray-800 whitespace-nowrap",onClick:()=>o({sortBy:a,sortDir:b?d:"desc"}),children:[t,b?e.jsx("span",{className:"ml-1 text-band-500","aria-label":n.sortDir==="asc"?"sorted ascending":"sorted descending",children:n.sortDir==="asc"?"â
1":"â"}):e.jsx("span",{className:"ml-1 text-gray-300","aria-hidden":!0,children:"â"})]})}function He(){const t=$(),{can:a,canFully:n}=O(),o=a("members:read"),b=ne(j=>j.user?.memberId),{members:d,pagination:l,filters:i,isLoading:h,error:g,setFilters:r,resetFilters:p,goToPage:c}=ie(),v=n("members:create"),y=!!(i.search||i.status||i.instrumentId||i.instrumentFamily||i.sectionId||i.ensembleId||i.joinedAfter),k=o===!0||o==="section_only",[x,m]=u.useState(!1),[s,w]=u.useState(()=>new Set);function T(j){w(L=>{const A=new Set(L);return A.has(j)?A.delete(j):A.add(j),A})}const f=d.map(j=>j.id),S=f.length>0&&f.every(j=>s.has(j)),I=f.some(j=>s.has(j));function D(){w(j=>{const L=new Set(j);return S?f.forEach(A=>L.delete(A)):f.forEach(A=>L.add(A)),L})}function C(){s.size!==0&&W.openPdf(W.urlForMembers([...s]))}function E(){s.size!==0&&W.openPdf(W.tentUrlForMembers([...s]))}function ce(){m(!1),w(new Set)}return e.jsxs("div",{children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-3 mb-4",children:[e.jsx(ze,{value:i.search,onChange:j=>r({search:j})}),e.jsx(We,{filters:i,onFilter:r,onReset:p}),k&&!x&&e.jsx(N,{variant:"ghost",size:"sm",onClick:()=>m(!0),className:"ml-auto",children:"Select to print"})]}),y&&e.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 mb-3 -mt-1",children:[i.search&&e.jsx(_,{label:`"${i.search}"`,onRemove:()=>r({search:""})}),i.status&&e.jsx(_,{label:De[i.status]||i.status,onRemove:()=>r({status:""})}),i.sectionId&&e.jsx(_,{label:"Section",onRemove:()=>r({sectionId:"",instrumentId:""})}),i.instrumentFamily&&e.jsx(_,{label:Ue[i.instrumentFamily]||i.instrumentFamily,onRemove:()=>r({instrumentFamily:"",instrumentId:""})}),i.instrumentId&&!i.instrumentFamily&&e.jsx(_,{label:"Instrument",onRemove:()=>r({instrumentId:""})}),i.ensembleId&&e.jsx(_,{label:"Ensemble",onRemove:()=>r({ensembleId:""})}),i.joinedAfter&&e.jsx(_,{label:`Joined after ${new Date(`${i.joinedAfter}T00:00:00`).toLocaleDateString("en-US",{month:"short",day:"numeric"})}`,onRemove:()=>r({joinedAfter:""})}),!h&&e.jsxs("span",{className:"text-xs text-gray-400 ml-1",children:[l.total," ",l.total===1?"result":"results"]})]}),g&&e.jsx("div",{className:"mb-4 p-3 bg-red-50 border border-red-200 rounded-lg text-sm text-red-700",children:g}),x&&e.jsxs("div",{className:"flex items-center justify-between gap-3 mb-3 px-3 py-2 bg-band-50 border border-band-200 rounded-lg",children:[e.jsx("span",{className:"text-sm font-medium text-band-700",children:s.size===0?"Check rows to include, then Print Badges.":`${s.size} selected`}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(N,{variant:"primary",size:"sm",onClick:C,disabled:s.size===0,children:"Print badges"}),e.jsx(N,{variant:"secondary",size:"sm",onClick:E,disabled:s.size===0,children:"Stand tents"}),e.jsx(N,{variant:"ghost",size:"sm",onClick:ce,children:"Cancel"})]})]}),h?e.jsxs(G,{children:[e.jsx(K,{children:e.jsxs("tr",{children:[x&&e.jsx(P,{children:e.jsx("span",{className:"sr-only",children:"Select"})}),e.jsx(P,{children:"Member"}),e.jsx(P,{children:"Status"}),e.jsx(P,{children:"Ensemble"}),e.jsx(P,{children:"Instrument"})]})}),e.jsx(q,{children:Array.from({length:8}).map((j,L)=>e.jsx(ye,{cols:x?5:4},L))})]}):d.length===0?e.jsx(ve,{variant:"illustration",icon:e.jsx(je,{}),title:"No members found",description:y?"Try adjusting your filters.":"Add the first member to get started.",action:v&&e.jsx(N,{onClick:()=>t("/members/new"),children:"Add first member"})}):e.jsxs(e.Fragment,{children:[e.jsxs(G,{children:[e.jsx(K,{children:e.jsxs("tr",{children:[x&&e.jsx("th",{className:"px-4 py-3 w-8",children:e.jsx("input",{type:"checkbox",className:"h-4 w-4 rounded border-gray-300 text-band-600 focus:ring-band-500 cursor-pointer","aria-label":"Select all visible",checked:S,ref:j=>{j&&(j.indeterminate=!S&&I)},onChange:D})}),e.jsx(J,{label:"Member",sortKey:"lastName",filters:i,setFilters:r}),e.jsx(J,{label:"Status",sortKey:"memberStatus",filters:i,setFilters:r}),e.jsx(P,{children:"Ensemble"}),e.jsx(P,{children:"Instrument"})]})}),e.jsx(q,{children:d.map(j=>e.jsx(Fe,{member:j,canClick:o===!0||o==="own_only"&&j.id===b||o==="section_only",selectMode:x,isSelected:s.has(j.id),onToggleSelect:()=>T(j.id)},j.id))})]}),l.totalPages>1&&e.jsxs("div",{className:"flex items-center justify-between mt-4 text-sm text-gray-600",children:[e.jsxs("span",{children:["Showing ",(l.page-1)*l.limit+1,"â",Math.min(l.page*l.limit,l.total)," of ",l.total]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(N,{variant:"secondary",size:"sm",disabled:l.page<=1,onClick:()=>c(l.page-1),children:"Previous"}),e.jsx(N,{variant:"secondary",size:"sm",disabled:l.page>=l.totalPages,onClick:()=>c(l.page+1),children:"Next"})]})]})]})]})}const Ve=80,Xe=.4;function Ge(t=Ve){const a=u.useRef(null),[n,o]=u.useState(0),[b,d]=u.useState(!1),l=-t,i=-(t*Xe),h=-(t+40),g=u.useCallback(y=>{a.current=y.clientX??y.touches?.[0]?.clientX??null},[]),r=u.useCallback(y=>{if(a.current==null)return;const x=(y.clientX??y.touches?.[0]?.clientX??a.current)-a.current;b&&x>0?o(Math.max(l+x,h)):!b&&x<0&&o(Math.max(x,h))},[b,l,h]),p=u.useCallback(()=>{a.current!=null&&(a.current=null,n<=i?(o(l),d(!0)):(o(0),d(!1)))},[n,l,i]),c=u.useCallback(()=>{o(0),d(!1),a.current=null},[]);return{offset:n,open:b,bind:{onPointerDown:g,onPointerMove:r,onPointerUp:p,onPointerCancel:p,onTouchStart:g,onTouchMove:r,onTouchEnd:p},reset:c}}const Q={active:{bg:"var(--bb-success-soft)",fg:"var(--bb-success-ink)",label:"Active"},inactive:{bg:"var(--bb-surface-sunken)",fg:"var(--bb-fg-muted)",label:"Inactive"},retired:{bg:"var(--bb-surface-sunken)",fg:"var(--bb-fg-muted)",label:"Alumni"},invite_sent:{bg:"var(--bb-info-soft)",fg:"var(--bb-info-ink)",label:"Invited"},invite_pending_approval:{bg:"var(--bb-warning-soft)",fg:"var(--bb-warning-ink)",label:"Pending"}};function Ke(t){const a=(t.firstName||"").trim(),n=(t.lastName||"").trim();return((a[0]||"")+(n[0]||"")).toUpperCase()||"?"}function qe(t){const a=t.ensembles?.find(n=>n.instrument);return a?.instrument?.name?a.instrument.name:t.instruments?.[0]?.name||null}function Ye(t){return t.ensembles?.[0]?.ensembleName||null}const oe=80,Je=oe*3;function Qe({member:t,canClick:a=!0}){const n=$(),[o,b]=u.useState(!1),{offset:d,open:l,bind:i,reset:h}=Ge(Je),g=Ie(t.id,6),r=Q[t.memberStatus]||Q.inactive,p=t.emailAddress,c=t.phone,v=Ye(t),y=qe(t);function k(){if(l){h();return}a&&n(`/members/${t.id}`)}function x(m){return s=>{s.stopPropagation(),h(),m&&(window.location.href=m)}}return e.jsxs("li",{"data-testid":"mobile-member-card","data-member-id":t.id,style:{position:"relative",overflow:"hidden",background:"var(--bb-surface)"},children:[e.jsxs("div",{"aria-hidden":!l,style:{position:"absolute",inset:0,display:"flex",justifyContent:"flex-end",alignItems:"stretch",background:"var(--bb-primary)"},children:[e.jsx(H,{testid:"mobile-member-card-phone",enabled:!!c,ariaLabel:`Call ${z(t)}`,onClick:x(c?`tel:${c}`:null),icon:e.jsx(tt,{}),label:"Call"}),e.jsx(H,{testid:"mobile-member-card-sms",enabled:!!c,ariaLabel:`Text ${z(t)}`,onClick:x(c?`sms:${c}`:null),icon:e.jsx(et,{}),label:"Text"}),e.jsx(H,{testid:"mobile-member-card-email",enabled:!!p,ariaLabel:`Email ${z(t)}`,onClick:x(p?`mailto:${p}`:null),icon:e.jsx(st,{}),label:"Email"})]}),e.jsxs("div",{...i,onClick:k,style:{position:"relative",display:"flex",alignItems:"center",gap:"var(--bb-space-3)",minHeight:72,padding:"12px var(--bb-space-4)",background:"var(--bb-surface)",borderTop:"1px solid var(--bb-border-soft)",transform:`translateX(${d}px)`,transition:d===0||d===-80?"transform 150ms ease-out":"none",touchAction:"pan-y",cursor:"pointer"},children:[t.photoUrl&&!o?e.jsx("img",{src:t.photoUrl,alt:"",onError:()=>b(!0),style:{width:44,height:44,borderRadius:"var(--bb-radius-pill)",objectFit:"cover",flexShrink:0}}):e.jsx("div",{"aria-hidden":"true",style:{width:44,height:44,borderRadius:"var(--bb-radius-pill)",display:"flex",alignItems:"center",justifyContent:"center",background:`var(--bb-avatar-${g})`,color:`var(--bb-avatar-${g}-ink)`,fontSize:14,fontWeight:700,flexShrink:0},children:Ke(t)}),e.jsxs("div",{style:{flex:1,minWidth:0},children:[e.jsx("div",{style:{fontSize:16,fontWeight:600,color:t.memberStatus==="inactive"?"var(--bb-fg-muted)":"var(--bb-fg)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:z(t)}),e.jsxs("div",{style:{display:"flex",gap:6,marginTop:4,flexWrap:"wrap"},children:[v&&e.jsx(Z,{bg:"var(--bb-tag-sky)",fg:"var(--bb-tag-sky-ink)",children:v}),y&&e.jsx(Z,{bg:"var(--bb-tag-mint)",fg:"var(--bb-tag-mint-ink)",children:y})]})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--bb-space-2)",flexShrink:0},children:[e.jsx("span",{style:{display:"inline-flex",alignItems:"center",padding:"3px 10px",borderRadius:"var(--bb-radius-pill)",background:r.bg,color:r.fg,fontSize:11,fontWeight:600},children:r.label}),e.jsx(Ze,{})]})]})]})}function Z({bg:t,fg:a,children:n}){return e.jsx("span",{style:{display:"inline-flex",alignItems:"center",padding:"2px 8px",borderRadius:"var(--bb-radius-pill)",background:t,color:a,fontSize:11,fontWeight:600,maxWidth:140,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:n})}function Ze(){return e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"var(--bb-fg-subtle)",strokeWidth:2,"aria-hidden":"true",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"})})}function et(){return e.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.25
15-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"})})}function tt(){return e.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z"})})}function st(){return e.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"})})}function H({testid:t,enabled:a,ariaLabel:n,onClick:o,icon:b,label:d}){return e.jsxs("button",{type:"button","data-testid":t,onClick:o,disabled:!a,"aria-label":n,style:{width:oe,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:4,background:"transparent",border:"none",borderLeft:"1px solid rgba(255,255,255,0.18)",color:"#fff",fontSize:12,fontWeight:600,cursor:a?"pointer":"not-allowed",opacity:a?1:.4},children:[b,d]})}const nt=[{value:"active",label:"Active"},{value:"inactive",label:"Inactive"},{value:"retired",label:"Alumni"},{value:"",label:"All"}];function at({isOpen:t,onClose:a,filters:n,onApply:o}){const[b,d]=u.useState([]),[l,i]=u.useState([]),[h,g]=u.useState(n.ensembleId||""),[r,p]=u.useState(n.instrumentId||""),[c,v]=u.useState(n.status??"active");u.useEffect(()=>{t&&(g(n.ensembleId||""),p(n.instrumentId||""),v(n.status??"active"))},[t,n.ensembleId,n.instrumentId,n.status]),u.useEffect(()=>{!t||b.length>0||Te.list().then(m=>d(Array.isArray(m)?m:[])).catch(()=>d([]))},[t,b.length]),u.useEffect(()=>{!t||l.length>0||Le.list("member").then(m=>i(Array.isArray(m)?m:[])).catch(()=>i([]))},[t,l.length]);function y(){o?.({ensembleId:h||"",instrumentId:r||"",status:c}),a?.()}function k(){g(""),p(""),v("active"),o?.({ensembleId:"",instrumentId:"",status:"active"}),a?.()}const x=(h?1:0)+(r?1:0)+(c!=="active"?1:0);return e.jsx(Me,{isOpen:t,onClose:a,title:"Filter members",children:e.jsxs("div",{style:{padding:"var(--bb-space-4)"},children:[e.jsx(V,{label:"Status",children:nt.map(m=>e.jsx(F,{selected:c===m.value,onClick:()=>v(m.value),label:m.label},m.value||"all"))}),e.jsxs(V,{label:"Ensemble",children:[e.jsx(F,{selected:!h,onClick:()=>g(""),label:"All ensembles"}),b.map(m=>e.jsx(F,{selected:h===m.id,onClick:()=>g(m.id),label:m.name},m.id))]}),e.jsxs(V,{label:"Instrument",children:[e.jsx(F,{selected:!r,onClick:()=>p(""),label:"All instruments"}),l.map(m=>e.jsx(F,{selected:r===m.id,onClick:()=>p(m.id),label:m.name},m.id))]}),e.jsxs("div",{style:{display:"flex",gap:"var(--bb-space-3)",marginTop:"var(--bb-space-5)"},children:[e.jsx("button",{type:"button","data-testid":"mobile-member-filter-clear",onClick:k,style:{flex:1,minHeight:48,padding:"12px 16px",border:"1px solid var(--bb-border)",borderRadius:"var(--bb-radius-md)",background:"var(--bb-surface)",color:"var(--bb-fg-body)",fontFamily:"inherit",fontSize:15,fontWeight:600,cursor:"pointer"},children:"Clear all"}),e.jsxs("button",{type:"button","data-testid":"mobile-member-filter-apply",onClick:y,style:{flex:2,minHeight:48,padding:"12px 16px",border:"none",borderRadius:"var(--bb-radius-md)",background:"var(--bb-primary)",color:"#fff",fontFamily:"inherit",fontSize:15,fontWeight:600,cursor:"pointer"},children:["Apply",x>0?` (${x})`:""]})]})]})})}function V({label:t,children:a}){return e.jsxs("div",{style:{marginBottom:"var(--bb-space-4)"},children:[e.jsx("div",{style:{fontSize:11,fontWeight:600,letterSpacing:"0.08em",textTransform:"uppercase",color:"var(--bb-fg-muted)",marginBottom:6},children:t}),e.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6},children:a})]})}function F({selected:t,onClick:a,label:n}){return e.jsx("button",{type:"button",onClick:a,style:{minHeight:44,padding:"0 14px",fontSize:13,fontWeight:600,borderRadius:"var(--bb-radius-pill)",border:"1px solid",borderColor:t?"var(--bb-primary)":"var(--bb-border-soft)",background:t?"var(--bb-primary)":"var(--bb-surface)",color:t?"#fff":"var(--bb-fg-body)",cursor:"pointer",display:"inline-flex",alignItems:"center"},children:n})}function rt(){const t=$(),{canFully:a,can:n}=O(),o=n("members:read"),b=ne(S=>S.user?.memberId),{members:d,pagination:l,filters:i,isLoading:h,error:g,setFilters:r,goToPage:p,refresh:c}=ie(),[v,y]=u.useState(i.search||""),[k,x]=u.useState(!1),[m,s]=u.useState(!1),w=a("members:create"),T=i.status&&i.status!=="active",f=(i.ensembleId?1:0)+(i.instrumentId?1:0)+(T?1:0);return u.useEffect(()=>{if(v===(i.search||""))return;const S=setTimeout(()=>r({search:v}),300);return()=>clearTimeout(S)},[v]),e.jsxs("div",{children:[e.jsx("div",{style:{padding:"var(--bb-space-3) var(--bb-space-4) var(--bb-space-2)",background:"var(--bb-bg)"},children:e.jsxs("div",{style:{position:"relative"},children:[e.jsx(it,{}
1),e.jsx("input",{type:"search",value:v,onChange:S=>y(S.target.value),placeholder:"Search members","aria-label":"Search members",style:{width:"100%",padding:"12px 14px 12px 38px",fontSize:15,borderRadius:"var(--bb-radius-md)",border:"1px solid var(--bb-border-soft)",background:"var(--bb-surface)",color:"var(--bb-fg)",outline:"none"}})]})}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--bb-space-2)",padding:"0 var(--bb-space-4) var(--bb-space-3)",background:"var(--bb-bg)"},children:[e.jsx("div",{style:{flex:1}}),e.jsxs("button",{type:"button","data-testid":"mobile-member-filter-open","aria-label":"Filter members",onClick:()=>s(!0),style:{flexShrink:0,width:44,height:44,position:"relative",borderRadius:"var(--bb-radius-pill)",border:"1px solid var(--bb-border-soft)",background:"var(--bb-surface)",color:f>0?"var(--bb-primary)":"var(--bb-fg-muted)",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center"},children:[e.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.75,"aria-hidden":"true",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 4h18M6 12h12M10 20h4"})}),f>0&&e.jsx("span",{"aria-hidden":"true",style:{position:"absolute",top:2,right:2,minWidth:18,height:18,padding:"0 5px",borderRadius:"var(--bb-radius-pill)",background:"var(--bb-primary)",color:"#fff",fontSize:10,fontWeight:700,display:"flex",alignItems:"center",justifyContent:"center"},children:f})]}),w&&e.jsx("button",{type:"button","data-testid":"mobile-member-smart-import","aria-label":"Smart Import members",onClick:()=>x(!0),style:{flexShrink:0,width:44,height:44,borderRadius:"var(--bb-radius-pill)",border:"none",background:"var(--bb-ai)",color:"#fff",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(Ce,{size:22})}),w&&e.jsx("button",{type:"button","data-testid":"mobile-member-add","aria-label":"Add member",onClick:()=>t("/members/new"),style:{flexShrink:0,width:44,height:44,borderRadius:"var(--bb-radius-pill)",border:"none",background:"var(--bb-primary)",color:"#fff",fontSize:22,lineHeight:1,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center"},children:"+"})]}),e.jsx(Ae,{isOpen:k,onClose:()=>x(!1),mode:"members",onCompleted:c}),e.jsx(at,{isOpen:m,onClose:()=>s(!1),filters:i,onApply:S=>r(S)}),g&&e.jsx("div",{style:{padding:"var(--bb-space-3) var(--bb-space-4)"},children:e.jsx("div",{style:{padding:12,background:"var(--bb-danger-soft)",color:"var(--bb-danger-ink)",borderRadius:"var(--bb-radius-md)",fontSize:14},children:g})}),h?e.jsx(Pe,{variant:"member",count:5}):d.length===0?e.jsxs("div",{style:{margin:"var(--bb-space-4)",padding:"var(--bb-space-6)",background:"var(--bb-surface)",border:"1px solid var(--bb-border-soft)",borderRadius:"var(--bb-radius-lg)",textAlign:"center"},children:[e.jsx("p",{style:{color:"var(--bb-fg)",fontSize:15,fontWeight:600,margin:0},children:"No members match."}),e.jsx("p",{style:{color:"var(--bb-fg-muted)",fontSize:13,margin:"4px 0 0 0"},children:i.search||i.status?"Try a different search or status.":"Add the first member to get started."}),w&&!i.search&&!i.status&&e.jsx("div",{style:{marginTop:"var(--bb-space-4)"},children:e.jsx(N,{onClick:()=>t("/members/new"),children:"Add first member"})})]}):e.jsx("ul",{"data-testid":"mobile-member-list",style:{listStyle:"none",margin:0,padding:0,background:"var(--bb-surface)"},children:d.map(S=>e.jsx(Qe,{member:S,canClick:o===!0||o==="own_only"&&S.id===b||o==="section_only"},S.id))}),!h&&l.totalPages>1&&e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"var(--bb-space-4)",fontSize:13,color:"var(--bb-fg-muted)"},children:[e.jsxs("span",{children:["Page ",l.page," of ",l.totalPages]}),e.jsxs("div",{style:{display:"flex",gap:8},children:[e.jsx(N,{variant:"secondary",size:"sm",disabled:l.page<=1,onClick:()=>p(l.page-1),children:"Prev"}),e.jsx(N,{variant:"secondary",size:"sm",disabled:l.page>=l.totalPages,onClick:()=>p(l.page+1),children:"Next"})]})]})]})}function it(){return e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"var(--bb-fg-subtle)",strokeWidth:2,"aria-hidden":"true",style:{position:"absolute",left:12,top:12},children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})})}const lt={invite_sent:"bg-blue-100 text-blue-700",invite_pending_approval:"bg-amber-100 text-amber-700",approved:"bg-green-100 text-green-700",expired:"bg-gray-100 text-gray-500"},ot={invite_sent:"Sent",invite_pending_approval:"Pending Approval",approved:"Approved",expired:"Expired"};function ee({status:t}){return e.jsx("span",{className:`inline-flex items-center px-2 py-0.5 rounded text-xs font-medium ${lt[t]||"bg-gray-100 text-gray-600"}`,children:ot[t]||t})}function te(t){if(!t)return"";const a=Date.now()-new Date(t).getTime(),n=Math.floor(a/6e4);if(n<1)return"just now";if(n<60)return`${n}m ago`;const o=Math.floor(n/60);if(o<24)return`${o}h ago`;const b=Math.floor(o/24);return b===1?"yesterday":`${b}d ago`}function ct(){const{canFully:t}=O(),{showSuccess:a,showError:n}=ae(),[o,b]=u.useState([]),[d,l]=u.useState(!0),[i,h]=u.useState(null),[g,r]=u.useState(null),p=t("members:approve_invite");u.useEffect(()=>{c()},[]);async function c(){try{const s=await U.list();b(Array.isArray(s)?s:[])}catch{b([])}finally{l(!1)}}async function v(s){h(s.id);try{await U.approve(s.id,{createUserAccount:s.memberType!=="guest"}),a(`${s.firstName} ${s.lastName} has been approved!`),c()}catch(w){n(w.message||"Failed to approve invite")}finally{h(null)}}async function y(s){r(s.id);
1try{await U.resend(s.id),a(`Invite resent to ${s.firstName} ${s.lastName}`),c()}catch(w){n(w.message||"Failed to resend invite")}finally{r(null)}}const k=o.filter(s=>s.status==="invite_pending_approval"),x=o.filter(s=>s.status==="invite_sent"),m=o.filter(s=>s.status==="expired");return d?e.jsx("p",{className:"text-sm text-gray-400 py-4",children:"Loading invites..."}):o.length===0?null:e.jsxs("div",{className:"mb-6",children:[k.length>0&&e.jsxs("div",{className:"bg-white rounded-xl border border-amber-200 p-4 mb-4",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx("span",{className:"inline-flex items-center justify-center w-5 h-5 rounded-full bg-amber-500 text-white text-xs font-bold",children:k.length}),e.jsx("h3",{className:"text-sm font-semibold text-gray-500 uppercase tracking-wide",children:"Pending Approval"})]}),e.jsx("p",{className:"text-xs text-gray-400 mb-3",children:"These people have submitted their registration and are waiting to be approved as members."}),e.jsx("div",{className:"space-y-2",children:k.map(s=>e.jsxs("div",{className:"flex items-start justify-between p-3 bg-amber-50 border border-amber-100 rounded-lg",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("p",{className:"text-sm font-semibold text-gray-900",children:[s.firstName," ",s.lastName]}),e.jsx(ee,{status:s.status}),e.jsx("span",{className:"text-xs text-gray-400 capitalize",children:s.memberType==="guest"?"Guest":"Member"})]}),e.jsxs("div",{className:"flex flex-wrap gap-x-4 gap-y-0.5 mt-1",children:[s.emailAddress&&e.jsx("a",{href:`mailto:${s.emailAddress}`,className:"text-xs text-band-600 hover:underline",children:s.emailAddress}),s.phone&&e.jsx("span",{className:"text-xs text-gray-500",children:s.phone})]}),e.jsxs("p",{className:"text-xs text-gray-400 mt-1",children:["Submitted ",te(s.updatedAt||s.createdAt),s.invitedBy&&e.jsxs("span",{children:[" · Invited by ",s.invitedBy]})]})]}),p&&e.jsx(N,{size:"sm",onClick:()=>v(s),isLoading:i===s.id,className:"shrink-0 ml-3",children:"Approve"})]},s.id))})]}),x.length>0&&e.jsxs("div",{className:"bg-white rounded-xl border border-gray-200 p-4 mb-4",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx("span",{className:"inline-flex items-center justify-center w-5 h-5 rounded-full bg-blue-500 text-white text-xs font-bold",children:x.length}),e.jsx("h3",{className:"text-sm font-semibold text-gray-500 uppercase tracking-wide",children:"Awaiting Response"})]}),e.jsx("div",{className:"space-y-2",children:x.map(s=>e.jsxs("div",{className:"flex items-center justify-between p-3 bg-blue-50 border border-blue-100 rounded-lg",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("p",{className:"text-sm font-medium text-gray-900",children:[s.firstName," ",s.lastName]}),e.jsx("span",{className:"text-xs text-gray-400 capitalize",children:s.memberType==="guest"?"Guest":"Member"})]}),e.jsx("p",{className:"text-xs text-gray-500",children:s.emailAddress||s.phone}),e.jsxs("p",{className:"text-xs text-gray-400 mt-0.5",children:["Sent ",te(s.createdAt),s.expiresAt&&e.jsxs("span",{children:[" · Expires ",de(s.expiresAt)]})]})]}),e.jsx(N,{variant:"secondary",size:"sm",onClick:()=>y(s),isLoading:g===s.id,className:"shrink-0 ml-3",children:"Resend"})]},s.id))})]}),m.length>0&&e.jsxs("div",{className:"bg-white rounded-xl border border-gray-200 p-4 mb-4",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx("span",{className:"inline-flex items-center justify-center w-5 h-5 rounded-full bg-gray-400 text-white text-xs font-bold",children:m.length}),e.jsx("h3",{className:"text-sm font-semibold text-gray-500 uppercase tracking-wide",children:"Expired"})]}),e.jsx("div",{className:"space-y-2",children:m.map(s=>e.jsxs("div",{className:"flex items-center justify-between p-3 bg-gray-50 border border-gray-100 rounded-lg",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("p",{className:"text-sm font-medium text-gray-900",children:[s.firstName," ",s.lastName]}),e.jsx("p",{className:"text-xs text-gray-500",children:s.emailAddress||s.phone}),e.jsx(ee,{status:s.status})]}),e.jsx(N,{variant:"secondary",size:"sm",onClick:()=>y(s),isLoading:g===s.id,className:"shrink-0 ml-3",children:"Resend"})]},s.id))})]})]})}const se=["status","instrumentId","instrumentFamily","sectionId","ensembleId","orgRole","joinedAfter","photoPermission","smsConsent"];
1function zt(){const[t,a]=me(),n=R(f=>f.filters);R(f=>f.setFilters);const o=R(f=>f.resetFilters),b=R(f=>f.pagination),d=R(f=>f.counts),l=ue(),{canFully:i}=O(),h=i("members:invite");i("members:approve_invite");const g=i("members:create"),r=i("members:update"),p=i("members:list"),c=$(),{currentOrg:v}=be(),{showError:y}=ae(),[k,x]=u.useState(!1),m=u.useRef(!1);he(),u.useEffect(()=>{const f={};for(const S of se){const I=t.get(S);I&&(f[S]=I)}o(f),m.current=!0},[]),u.useEffect(()=>{if(!m.current)return;const f=new URLSearchParams;for(const S of se){const I=n[S];I&&I!=="active"&&f.set(S,I)}a(f,{replace:!0})},[n.status,n.instrumentId,n.instrumentFamily,n.sectionId,n.ensembleId,n.orgRole,n.joinedAfter,n.photoPermission,n.smsConsent]);const s=(d?.byStatus?.invite_pending_approval||0)+(d?.byStatus?.invite_sent||0);async function w(){x(!0);try{const S=(await re.list({limit:500})).members??[],I=xe(),D=v?.shortName||"band";Ee(`members-${D}-${I}.csv`,["First Name","Last Name","Email","Phone","Instrument","Ensemble","Status","Member Since"],S.map(C=>[C.firstName,C.lastName,C.emailAddress,C.phone,C.instruments?.map(E=>E.name).join("; ")||"",C.ensembles?.map(E=>E.name).join("; ")||"",C.memberStatus,C.onboardingDate||""]))}catch{y("Export failed")}finally{x(!1)}}const T=pe(f=>f.getMetric("members"));return e.jsxs("div",{children:[!l&&e.jsx(ge,{title:"Members",subtitle:"Manage band membership roster",breadcrumbs:[{label:"Home",to:"/"},{label:"Members"}],actions:e.jsxs(e.Fragment,{children:[e.jsxs(X,{to:"/help/add-member-directly",className:"text-xs text-brand-primary hover:underline flex items-center gap-1",children:[e.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.228 9c.549-1.165 2.03-2 3.772-2 2.21 0 4 1.343 4 3 0 1.4-1.278 2.575-3.006 2.907-.542.104-.994.54-.994 1.093m0 3h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),"Help"]}),p&&e.jsx(N,{variant:"ghost",size:"sm",onClick:w,disabled:k,isLoading:k,children:"Export CSV"}),r&&e.jsx(N,{variant:"secondary",onClick:()=>c("/members/health"),children:"Member Health"}),g&&e.jsx(X,{to:"/import/members",children:e.jsx(N,{variant:"ai",children:"Smart Import"})}),g&&e.jsx(N,{onClick:()=>c("/members/new"),children:"Add member"})]})}),T&&!l&&e.jsx(_e,{metricName:"Members",current:T.current,limit:T.limit}),h&&s>0&&!l&&e.jsxs("div",{className:"flex flex-wrap gap-3 mb-4",children:[(d?.byStatus?.invite_pending_approval||0)>0&&e.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs",children:[e.jsx("span",{className:"w-2 h-2 rounded-full bg-amber-500"}),e.jsx("span",{className:"font-medium text-amber-700",children:d.byStatus.invite_pending_approval}),e.jsx("span",{className:"text-gray-500",children:"pending approval"})]}),(d?.byStatus?.invite_sent||0)>0&&e.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs",children:[e.jsx("span",{className:"w-2 h-2 rounded-full bg-blue-500"}),e.jsx("span",{className:"font-medium text-blue-700",children:d.byStatus.invite_sent}),e.jsx("span",{className:"text-gray-500",children:"awaiting response"})]})]}),h&&!l&&e.jsx(ct,{}),!l&&!!(n.search||n.status&&n.status!=="active"||n.instrumentId||n.instrumentFamily||n.sectionId||n.ensembleId||n.orgRole||n.joinedAfter)&&e.jsx(Re,{count:b.total,onClear:()=>o()}),l?e.jsx(rt,{}):e.jsx(He,{})]})}export{zt as MembersPage};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.