PageSourceSearch

https://handytoolsbox-e2feb.firebaseapp.com/assets/AdminSearchDiscovery-BI9s2wYH.js

js handytoolsbox-e2feb.firebaseapp.com collected 2026-10-03 14:06:42 UTC 13,810 bytes, 1 lines download raw bytes

1import{r,j as e}from"./vendor-react-D-uCNEDE.js";import{a as m,c,A as P,m as g}from"./index-CYbSp8wT.js";import{g as h,R as D,m as I,b1 as b,z as u,aF as p,bb as B,am as M,Z as j,a8 as w,U as v,P as f,bc as F,T as U,a5 as V,a9 as W}from"./vendor-lucide-bLAIetMD.js";import"./vendor-router-WJFc8BDG.js";const d=({title:i,value:o,change:a,icon:x,color:l})=>e.jsxs("div",{className:"bg-white dark:bg-slate-900 p-8 rounded-[40px] border border-slate-100 dark:border-slate-800 shadow-sm relative overflow-hidden group",children:[e.jsxs("div",{className:"relative z-10",children:[e.jsx("div",{className:c("w-14 h-14 rounded-2xl flex items-center justify-center mb-6 transition-all shadow-inner",l),children:e.jsx(x,{size:24})}),e.jsx("h3",{className:"text-[11px] font-black text-slate-400 dark:text-slate-500 uppercase tracking-[0.2em] mb-2",children:i}),e.jsxs("div",{className:"flex items-end gap-3",children:[e.jsx("span",{className:"text-[32px] font-black text-slate-900 dark:text-white leading-none tracking-tighter italic",children:o}),a&&e.jsxs("div",{className:c("flex items-center gap-1 text-[10px] font-bold pb-1",a.startsWith("+")?"text-emerald-500":"text-rose-500"),children:[a.startsWith("+")?e.jsx(w,{size:10}):e.jsx(W,{size:10}),a]})]})]}),e.jsx("div",{className:c("absolute top-0 right-0 w-32 h-32 opacity-[0.03] group-hover:opacity-[0.07] transition-opacity -mr-16 -mt-16 rounded-full blur-3xl",l.split(" ")[0].replace("bg-","bg-"))})]});function Q(){const[i,o]=r.useState("dashboard"),[a,x]=r.useState(null),[l,k]=r.useState([]),[G,N]=r.useState([]),[y,S]=r.useState(!0);r.useEffect(()=>{z(),R(),T()},[]);const z=async()=>{try{const s=await(await m("/api/admin/search/dashboard")).json();x(s)}catch{}},R=async()=>{try{const s=await(await m("/api/admin/search/synonyms")).json();k(s)}catch{}},T=async()=>{try{const s=await(await m("/api/admin/search/boosts")).json();N(s)}catch{}finally{S(!1)}},C=[{id:"dashboard",label:"Search Ops",icon:I},{id:"ranking",label:"Ranking Engine",icon:b},{id:"synonyms",label:"Intent Map",icon:u},{id:"discover",label:"Discovery Rules",icon:p},{id:"analytics",label:"Query Intel",icon:h}];if(y&&!a)return e.jsx("div",{className:"flex items-center justify-center h-64",children:e.jsx("div",{className:"w-12 h-12 border-4 border-emerald-500 border-t-transparent animate-spin rounded-full"})});const n=a?.summary||{totalSearches:0,zeroResultRate:0,ctr:0,avgTimeToClick:0};return e.jsxs("div",{className:"space-y-10 animate-in fade-in duration-700",children:[e.jsxs("div",{className:"flex flex-col md:flex-row justify-between items-start md:items-center gap-6",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-12 h-12 rounded-[20px] bg-emerald-600 text-white flex items-center justify-center shadow-xl shadow-emerald-900/20",children:e.jsx(h,{size:24})}),e.jsx("h1",{className:"text-[36px] font-black text-slate-900 dark:text-white tracking-tighter uppercase italic",children:"Search & Discovery"})]}),e.jsx("p",{className:"text-slate-500 dark:text-slate-400 font-bold uppercase tracking-[0.2em] text-[11px] ml-1",children:"ENGINEERING INTENT & DISCOVERY RELEVANCE"})]}),e.jsx("div",{className:"flex items-center gap-4",children:e.jsxs("button",{className:"h-14 px-8 bg-slate-900 dark:bg-white text-white dark:text-slate-950 rounded-3xl font-black text-[11px] uppercase tracking-[0.2em] shadow-2xl hover:scale-105 active:scale-95 transition-all flex items-center gap-3",children:[e.jsx(D,{size:16}),"Force Reindex"]})})]}),e.jsx("div",{className:"flex items-center gap-2 overflow-x-auto pb-4 no-scrollbar",children:C.map(t=>e.jsxs("button",{onClick:()=>o(t.id),className:c("h-14 px-8 rounded-2xl text-[11px] font-black uppercase tracking-widest whitespace-nowrap transition-all flex items-center gap-3 border shadow-sm",i===t.id?"bg-emerald-600 text-white border-emerald-600 shadow-xl":"bg-white dark:bg-slate-900 text-slate-400 dark:text-slate-500 border-slate-50 dark:border-slate-800 hover:border-slate-200"),children:[e.jsx(t.icon,{size:16}),t.label]},t.id))}),e.jsx(P,{mode:"wait",children:e.jsxs(g.div,{initial:{opacity:0,y:20}
1,animate:{opacity:1,y:0},exit:{opacity:0,y:-20},transition:{duration:.3,ease:"easeOut"},children:[i==="dashboard"&&e.jsxs("div",{className:"space-y-10",children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-8",children:[e.jsx(d,{title:"Total Searches",value:(n.totalSearches/1e3).toFixed(1)+"k",change:"+12.4%",icon:h,color:"bg-emerald-600 text-white"}),e.jsx(d,{title:"Discovery CTR",value:n.ctr+"%",change:"+4.2%",icon:B,color:"bg-brand text-white"}),e.jsx(d,{title:"Zero Results",value:n.zeroResultRate+"%",change:"-1.2%",icon:M,color:"bg-rose-600 text-white"}),e.jsx(d,{title:"Avg Click Time",value:n.avgTimeToClick+"s",change:"-0.4s",icon:j,color:"bg-slate-900 text-white"})]}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-12 gap-8",children:[e.jsxs("div",{className:"lg:col-span-8 bg-white dark:bg-slate-900 border border-slate-100 dark:border-slate-800 rounded-[56px] p-10 space-y-8 shadow-sm",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h3",{className:"text-xl font-black text-slate-900 dark:text-white uppercase tracking-tighter italic",children:"High Volume Queries"}),e.jsxs("button",{className:"text-[10px] font-black text-emerald-600 uppercase tracking-widest hover:underline flex items-center gap-2",children:["Full Analytics ",e.jsx(w,{size:14})]})]}),e.jsxs("table",{className:"w-full text-left",children:[e.jsx("thead",{className:"bg-slate-50 dark:bg-slate-800/50",children:e.jsxs("tr",{children:[e.jsx("th",{className:"p-6 text-[10px] font-black uppercase tracking-widest text-slate-400",children:"Search Term"}),e.jsx("th",{className:"p-6 text-[10px] font-black uppercase tracking-widest text-slate-400",children:"Volume"}),e.jsx("th",{className:"p-6 text-[10px] font-black uppercase tracking-widest text-slate-400",children:"CTR"}),e.jsx("th",{className:"p-6 text-[10px] font-black uppercase tracking-widest text-slate-400 text-right",children:"Yield"})]})}),e.jsx("tbody",{className:"divide-y divide-slate-50 dark:divide-slate-800",children:(a?.topTerms||[]).map((t,s)=>e.jsxs("tr",{className:"hover:bg-slate-50 dark:hover:bg-slate-800/30 transition-all font-bold group",children:[e.jsx("td",{className:"p-6 text-sm text-slate-900 dark:text-white italic",children:t.term}),e.jsx("td",{className:"p-6 text-sm text-slate-500",children:t.volume}),e.jsx("td",{className:"p-6 text-sm text-slate-900 dark:text-white",children:t.ctr}),e.jsx("td",{className:c("p-6 text-sm text-right font-black",t.growth.startsWith("+")?"text-emerald-500":"text-rose-500"),children:t.growth})]},s))})]})]}),e.jsxs("div",{className:"lg:col-span-4 bg-slate-950 rounded-[56px] p-10 text-white space-y-8 relative overflow-hidden",children:[e.jsxs("div",{className:"relative z-10",children:[e.jsx("h3",{className:"text-2xl font-black italic tracking-tight mb-2",children:"Rising Context"}),e.jsx("p",{className:"text-slate-500 font-bold text-[10px] uppercase tracking-widest leading-relaxed",children:"Identified emerging intent patterns in real-time."})]}),e.jsx("div",{className:"space-y-6 relative z-10",children:(a?.risingTerms||[]).map((t,s)=>e.jsxs("div",{className:"p-6 bg-white/5 rounded-3xl border border-white/10 flex justify-between items-center group cursor-pointer hover:bg-white/10 transition-all",children:[e.jsx("span",{className:"text-[11px] font-black uppercase tracking-widest italic",children:t.term}),e.jsxs("div",{className:"flex items-center gap-1 text-emerald-400 text-[10px] font-black",children:[e.jsx(v,{size:12}),t.growth]})]},s))}),e.jsx(p,{className:"absolute -right-20 -bottom-20 w-80 h-80 opacity-10 rotate-12"})]})]})]}),i==="synonyms"&&e.jsx("div",{className:"space-y-8",children:e.jsxs("div",{className:"bg-white dark:bg-slate-900 rounded-[48px] border border-slate-100 dark:border-slate-800 shadow-sm overflow-hidden",children:[e.jsxs("div",{className:"p-10 border-b border-slate-50 dark:border-slate-800 flex flex-col md:flex-row justify-between items-start md:items-center gap-6",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("h3",{className:"text-xl font-black text-slate-900 dark:text-white uppercase tracking-tighter italic",children:"Intent & Synonym Mapping"}),e.jsx("p",{className:"text-[10px] font-bold text-slate-400 uppercase tracking-widest",children:"Map user slang and variations to correct tool intent."})]}),e.jsxs("button",{className:"h-12 px-8 bg-brand text-white rounded-2xl text-[10px] font-black uppercase tracking-widest shadow-lg shadow-brand/20 flex items-center gap-2",children:[e.jsx(f,{size:16}),"Add Semantic Pair"]})]}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-0 divide-x divide-y divide-slate-50 dark:divide-slate-800",children:(l.length>0?l:[{term:"pic",synonyms:["image","photo","graphic"],active:!0},{term:"word to pdf",synonyms:["convert doc","document export"],active:!0},{term:"resize",synonyms:["compress","smaller","dimension"],active:!0}]).map((t,s)=>e.jsxs("div",{className:"p-10 hover:bg-slate-50 dark:hover:bg-slate-800/30 transition-all space-y-4 group",children:[e.jsxs("div",{className:"flex justify-between items-start",children:[e.jsx("h4",{className:"text-lg font-black text-slate-900 dark:text-white uppercase tracking-tight italic",children:t.term}),e.jsxs("div",{className:"flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity",children:[e.jsx("button",{className:"p-2 hover:text-brand",children:e.jsx(F,{size:16})}),e.jsx("button",{className:"p-2 hover:text-rose-500",children:e.jsx(U,{size:16})})]})]}),e.jsx("div",{className:"flex flex-wrap gap-2",children:t.synonyms&&t.synonyms.map((A,E)=>
1e.jsx("span",{className:"px-3 py-1 bg-slate-100 dark:bg-slate-800 rounded-lg text-[9px] font-black uppercase tracking-widest text-slate-500",children:A},E))})]},s))})]})}),i==="ranking"&&e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-8",children:[e.jsxs("div",{className:"lg:col-span-2 bg-white dark:bg-slate-900 rounded-[48px] border border-slate-100 dark:border-slate-800 shadow-sm overflow-hidden p-10 space-y-8",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h3",{className:"text-xl font-black text-slate-900 dark:text-white uppercase tracking-tighter italic",children:"Weighted Signal Bias"}),e.jsx("button",{className:"h-10 px-6 bg-slate-900 dark:bg-white text-white dark:text-slate-950 rounded-xl text-[10px] font-black uppercase tracking-[0.2em]",children:"Save Config"})]}),e.jsx("div",{className:"space-y-10",children:[{name:"Semantic Relevance",val:95,icon:u},{name:"Tool Popularity",val:65,icon:V},{name:"Completion Rate",val:80,icon:b},{name:"Growth Metric (New)",val:40,icon:v},{name:"Monetization Yield",val:30,icon:j}].map((t,s)=>e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(t.icon,{size:16,className:"text-slate-400"}),e.jsx("span",{className:"text-[11px] font-black uppercase tracking-widest text-slate-900 dark:text-white",children:t.name})]}),e.jsxs("span",{className:"text-sm font-black italic",children:[t.val,"%"]})]}),e.jsx("div",{className:"h-2 bg-slate-100 dark:bg-slate-800 rounded-full overflow-hidden",children:e.jsx(g.div,{initial:{width:0},animate:{width:`${t.val}%`},className:"h-full bg-emerald-600 rounded-full"})})]},s))})]}),e.jsxs("div",{className:"space-y-8",children:[e.jsxs("div",{className:"bg-slate-950 text-white p-10 rounded-[48px] space-y-6 relative overflow-hidden",children:[e.jsx("h4",{className:"text-xl font-black uppercase italic tracking-tighter relative z-10",children:"Premium Boost"}),e.jsxs("div",{className:"flex items-center gap-6 relative z-10",children:[e.jsxs("div",{className:"flex-1",children:[e.jsx("p",{className:"text-[10px] font-bold text-slate-400 uppercase tracking-widest leading-relaxed mb-4 italic",children:"Automatically elevate premium tool variants in discovery matrix."}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-12 h-6 bg-emerald-600 rounded-full relative cursor-pointer",children:e.jsx("div",{className:"absolute right-1 top-1 w-4 h-4 bg-white rounded-full"})}),e.jsx("span",{className:"text-[10px] font-black uppercase tracking-widest",children:"Enabled"})]})]}),e.jsx(p,{size:48,className:"text-emerald-500 opacity-20"})]})]}),e.jsxs("div",{className:"bg-white dark:bg-slate-900 p-10 rounded-[48px] border border-slate-100 dark:border-slate-800 space-y-6 shadow-sm",children:[e.jsx("h4",{className:"text-xl font-black uppercase italic tracking-tighter text-slate-900 dark:text-white",children:"Pin Rules"}),e.jsx("div",{className:"space-y-4",children:[{term:"pdf",tool:"Bulk Compress PDF",type:"Pinned Top"},{term:"seo",tool:"Keyword Matrix Pro",type:"Boosted"}].map((t,s)=>e.jsxs("div",{className:"p-4 bg-slate-50 dark:bg-slate-800 rounded-2xl flex justify-between items-center",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-[9px] font-black text-slate-400 uppercase tracking-widest",children:t.term}),e.jsx("div",{className:"text-[11px] font-black uppercase italic tracking-tight",children:t.tool})]}),e.jsx("span",{className:"text-[9px] font-black text-emerald-500 uppercase tracking-widest",children:t.type})]},s))}),e.jsxs("button",{className:"w-full h-12 rounded-2xl border-2 border-dashed border-slate-100 dark:border-slate-800 text-slate-400 text-[10px] font-black uppercase tracking-widest hover:border-brand hover:text-brand transition-all flex items-center justify-center gap-2",children:[e.jsx(f,{size:14})," New Manual Pin"]})]})]})]})]},i)})]})}export{Q as default};

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.