1import{m as v,k as e}from"./BSYLsQ-1.js";import{k1 as S,jK as T,jP as k,jo as C,jZ as E,jT as R,eL as P,aq as c,ar as o,a4 as w,aY as K,g1 as q,dt as A,aH as L,gL as M,cq as z}from"./sSvtHvyR.js";import{S as m}from"./ByMFkulf.js";import"./J_Wt1L_a.js";import"./DjlRatrT.js";import"./SFk0Fnst.js";const F={training:"/admin/e-egitimler/egitimler",exam:"/admin/sinavlar/sinavlar",member:"/admin/kullanicilar-ve-tanimlar/kullanicilar",announcement:"/admin/duyurular/duyurular"},O=[{type:"training",icon:w,titleKey:"SearchTypeTraining"},{type:"exam",icon:K,titleKey:"SearchTypeExam"},{type:"member",icon:q,titleKey:"SearchTypeMember"},{type:"announcement",icon:A,titleKey:"SearchTypeAnnouncement"}],U=20;function B(){const{t:a}=S("Shared"),{getApiLanguageParam:g}=T(),p=k(),j=C(),[y]=E(),r=(y.get("q")??"").trim(),{data:n,isFetching:u,isError:b}=R({queryKey:["admin-global-search-all",r],queryFn:()=>z.search(r,U),enabled:r.length>=2,staleTime:3e4,gcTime:6e4}),f=v.useMemo(()=>{const s=new Map;for(const t of n??[]){const d=s.get(t.type)??[];d.push(t),s.set(t.type,d)}return s},[n]),x=(n==null?void 0:n.length)??0,h=b||n===null,N=s=>{const t=F[s];t&&p(M(t,g()))};return e.jsxs("div",{style:j,className:"py-5",children:[e.jsxs("div",{className:"mb-5 flex items-center gap-3",children:[e.jsx("div",{className:"flex size-11 shrink-0 items-center justify-center rounded-xl border border-border/50 bg-muted/50 text-muted-foreground",children:e.jsx(P,{className:"size-5","aria-hidden":!0})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("h1",{className:"truncate text-xl font-semibold tracking-tight text-foreground",children:a("SearchResultsTitle")}),r?e.jsxs("p",{className:"truncate text-sm text-muted-foreground",children:[a("SearchResultsFor",{q:r}),!u&&!h?` · ${a("SearchResultsCount",{count:x})}`:""]}):null]})]}),r.length<2?e.jsx(c,{children:e.jsx(o,{className:"py-16 text-center text-base text-muted-foreground",children:a("SearchQueryTooShort")})}):u?e.jsx("div",{className:"space-y-4",children:[0,1,2].map(s=>e.jsx(c,{children:e.jsxs(o,{className:"space-y-3 py-5",children:[e.jsx(m,{className:"h-5 w-40"}),e.jsx(m,{className:"h-12 w-full"}),e.jsx(m,{className:"h-12 w-full"})]})},s))}):h?e.jsx(c,{children:e.jsx(o,{className:"py-16 text-center text-base text-muted-foreground",children:a("SearchUnavailable")})}):x===0?e.jsx(c,{children:e.jsx(o,{className:"py-16 text-center text-base text-muted-foreground",children:a("GlobalMenuSearchEmpty")})}):e.jsx("div",{className:"space-y-4",children:O.map(({type:s,icon:t,titleKey:d})=>{const i=f.get(s);return i!=null&&i.length?e.jsx(c,{children:e.jsxs(o,{className:"p-0",children:[e.jsxs("div",{className:"flex items-center gap-2 border-b border-border/50 px-4 py-3",children:[e.jsx(t,{className:"size-4 text-muted-foreground","aria-hidden":!0}),e.jsx("span",{className:"text-sm font-semibold tracking-tight text-foreground",children:a(d)}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",i.length,")"]})]}),e.jsx("ul",{className:"divide-y divide-border/40",children:i.map(l=>e.jsx("li",{children:e.jsxs("button",{type:"button",onClick:()=>N(l.type),className:"flex w-full items-center gap-3 px-4 py-3 text-left transition-colors hover:bg-primary/[0.05]",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:"truncate text-base font-medium text-foreground",children:l.label||"â"}),l.sublabel?e.jsx("div",{className:"truncate text-sm text-muted-foreground",children:l.sublabel}):null]}),e.jsx(L,{className:"size-4 shrink-0 text-muted-foreground/60","aria-hidden":!0})]})},`${l.type}-${l.id}`))})]})},s):null})})]})}export{B as AdminSearchResultsPage};
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.