PageSourceSearch

https://writer-gpt.com/assets/AdminAnalytics-C1h3aBX-.js

js writer-gpt.com collected 2026-10-03 19:31:33 UTC 21,731 bytes, 11 lines download raw bytes

1import{c as re,u as C,s as q,r as me,j as e}from"./index-DEE2k2I2.js";import{A as xe}from"./AdminLayout-DHnOVgVE.js";import{C as b,b as N,c as v,a as f}from"./card-hR8LrYZW.js";import{B as V}from"./badge-CaBntYTQ.js";import{S as he,a as ue,b as je,c as ge,d as T}from"./select-C4Cs7y8V.js";import{T as ye,a as pe,b as Q,c as D,d as be,e as k}from"./table-DedSQ1xo.js";import{S as p}from"./skeleton-B9c9vUc2.js";import{P as fe}from"./progress-BLnj8olY.js";import{n as ie}from"./adminLocation-GAwk_kAt.js";import{e as ne}from"./endOfDay-A-ioHiWL.js";import{s as X}from"./subDays-zfsdsliS.js";import{s as oe,f as K}from"./format-RyfQyywz.js";import{s as le}from"./startOfMonth-BqpJtJQc.js";import{U as J}from"./users-DZCCYaxO.js";import{U as Ne}from"./user-check-heblp7Kn.js";import{F as ve}from"./file-text-pAMgX0O6.js";import{C as we}from"./circle-check-big-CvLIafCe.js";import{C as _e}from"./circle-x-DyTKaApg.js";import{A as ee}from"./activity-BsucUwj8.js";import{Z as Ce}from"./zap-CCzOhOHw.js";import{C as Se}from"./credit-card-BaPfOH75.js";import{G as M}from"./globe-DTrW5Acr.js";import{R as S,X as E,Y as $,T as A,L as se,B as Z,C as F}from"./generateCategoricalChart-BJpyqk32.js";import{C as Ae}from"./ComposedChart-DgTizIZc.js";import{C as P}from"./CartesianGrid-D8g0O-T3.js";import{A as Le}from"./Area-CJQhmKIP.js";import{B as te}from"./BarChart-CXlmoJPT.js";import{P as G,a as W}from"./PieChart-CBEvkDAE.js";import{T as Ue}from"./trending-up-DR-R7eFg.js";import{L as Te}from"./LineChart-DsbfVn8p.js";import{L as ae}from"./Line-CwrTZc2w.js";import{C as De}from"./chart-column-BHp4UUJ8.js";import{S as ke}from"./smartphone-DtHhZI9n.js";import"./wand-sparkles-CVL6x7yr.js";import"./chevron-left-2DGVj3CW.js";import"./layout-dashboard-DwbrXrmv.js";import"./heart-pulse-CorWDZzm.js";import"./dollar-sign-Cqd03hUz.js";import"./sparkles-BwOLhAcY.js";import"./crown-CvaVEfF_.js";import"./key-xcyo2xlX.js";import"./circle-alert-C2xxRh9c.js";import"./percent-DdGVG1Nh.js";import"./message-square-Dlsl3Y9Q.js";import"./megaphone-BZ4f1ELR.js";import"./users-round-gkUEP4PV.js";import"./database-CLumb1kj.js";import"./upload-Bwx8W7w3.js";import"./settings-C6TVzL8g.js";import"./shield-check-Dn-pjJPz.js";import"./code-BOdb_rRF.js";import"./mail-D08Bbiyo.js";import"./book-open-BKS5JB5d.js";import"./gauge-JwuxuJzc.js";import"./download-BJWcL-lJ.js";import"./loader-circle-BSyeuoBS.js";import"./sheet-CXfuNT9N.js";import"./index-BzPNQJpr.js";import"./Combination-BWs1x3Zl.js";import"./arrow-left-C8BycZXi.js";import"./index-BdQq_4o_.js";import"./index-B8mvpLaw.js";import"./check-D2tgyCPN.js";import"./constructFrom-rJN6zrQ_.js";import"./en-US-DgaeWpfW.js";import"./startOfWeek-CGNiWUve.js";/**
2 * @license lucide-react v0.462.0 - ISC
3 *
4 * This source code is licensed under the ISC license.
5 * See the LICENSE file in the root directory of this source tree.
6 */const H=re("Monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);/**
7 * @license lucide-react v0.462.0 - ISC
8 *
9 * This source code is licensed under the ISC license.
10 * See the LICENSE file in the root directory of this source tree.
11 */const Re=re("Tablet",[["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",ry:"2",key:"76otgf"}],["line",{x1:"12",x2:"12.01",y1:"18",y2:"18",key:"1dp563"}]]);async function w(i,n,a){let o=[],r=0;for(;;){let l=q.from(i).select(n).range(r,r+1e3-1);a&&(l=a(l));const{data:c,error:u}=await l;if(u)throw u;const _=c??[];if(_.length===0||(o=o.concat(_),_.length<1e3))break;r+=1e3}return o}function Ke(i=30){return C({queryKey:["admin-daily-stats",i],queryFn:async()=>{const n=[],a=i===0||i===1?1:i,s=i===1?1:0;for(let o=a-1;o>=0;o--){const r=X(new Date,o+s),l=oe(r).toISOString(),c=ne(r).toISOString(),{count:u}=await q.from("articles").select("*",{count:"exact",head:!0}).gte("created_at",l).lt("created_at",c),h=(await w("articles","word_count",t=>t.gte("created_at",l).lt("created_at",c))).reduce((t,O)=>t+(O.word_count||0),0),{count:g}=await q.from("jobs").select("*",{count:"exact",head:!0}).gte("created_at",l).lt("created_at",c);n.push({date:K(r,"MMM dd"),articles:u||0,words:h,jobs:g||0})}return n},refetchInterval:3e5})}function Oe(i=30){return C({queryKey:["admin-user-growth",i],queryFn:async()=>{var _;const n=await w("profiles","created_at",h=>h.order("created_at",{ascending:!0})),a=i===0||i===1?1:i,s=i===1?1:0,o={};
11n.forEach(h=>{if(!h.created_at)return;const g=K(new Date(h.created_at),"yyyy-MM-dd");o[g]=(o[g]||0)+1});const r=[];for(let h=a-1;h>=0;h--){const g=X(new Date,h+s);r.push({key:K(g,"yyyy-MM-dd"),label:K(g,"MMM dd")})}const l=((_=r[0])==null?void 0:_.key)??K(new Date,"yyyy-MM-dd");let c=Object.entries(o).reduce((h,[g,t])=>g<l?h+t:h,0);return r.map(({key:h,label:g})=>{const t=o[h]||0;return c+=t,{date:g,users:t,cumulative:c}})},refetchInterval:3e5})}function Ie(){return C({queryKey:["admin-seo-distribution"],queryFn:async()=>{const i=await w("articles","seo_mode"),n={};return i.forEach(a=>{const s=a.seo_mode||"None";n[s]=(n[s]||0)+1}),Object.entries(n).map(([a,s])=>({name:a,value:s}))}})}function $e(){return C({queryKey:["admin-language-distribution"],queryFn:async()=>{const i=await w("articles","language"),n={};return i.forEach(a=>{const s=a.language||"Unknown";n[s]=(n[s]||0)+1}),Object.entries(n).map(([a,s])=>({name:a,value:s}))}})}function qe(){return C({queryKey:["admin-user-demographics"],queryFn:async()=>{const i=await w("profiles","country, device_type, browser, os"),n={},a={},s={},o={};i.forEach(l=>{const c=ie(l.country);n[c]=(n[c]||0)+1,l.device_type&&(a[l.device_type]=(a[l.device_type]||0)+1),l.browser&&(s[l.browser]=(s[l.browser]||0)+1),l.os&&(o[l.os]=(o[l.os]||0)+1)});const r=l=>Object.entries(l).map(([c,u])=>({name:c,value:u})).sort((c,u)=>u.value-c.value).slice(0,10);return{countries:r(n),devices:r(a),browsers:r(s),os:r(o)}}})}function Ee(){return C({queryKey:["admin-subscription-stats"],queryFn:async()=>{const i=await w("profiles","subscription_status, subscription_tier"),n={},a={};return i.forEach(s=>{const o=s.subscription_status||"inactive",r=s.subscription_tier||"free";n[o]=(n[o]||0)+1,a[r]=(a[r]||0)+1}),{byStatus:Object.entries(n).map(([s,o])=>({name:s,value:o})),byTier:Object.entries(a).map(([s,o])=>({name:s,value:o}))}}})}function Fe(){return C({queryKey:["admin-top-users"],queryFn:async()=>{const i=await w("profiles","user_id, email, first_name, last_name, country, device_type"),n=le(new Date),a=await w("articles","user_id, word_count",r=>r.gte("created_at",n.toISOString())),s={};a.forEach(r=>{r.user_id&&(s[r.user_id]||(s[r.user_id]={articles:0,words:0}),s[r.user_id].articles+=1,s[r.user_id].words+=r.word_count||0)});const o=new Map(i.map(r=>[r.user_id,r]));return Object.entries(s).sort((r,l)=>l[1].words-r[1].words).slice(0,10).map(([r,l])=>{const c=o.get(r);return{email:(c==null?void 0:c.email)||"Unknown",name:c?`${c.first_name||""} ${c.last_name||""}`.trim()||c.email:"Unknown",articles:l.articles,words:l.words,country:ie(c==null?void 0:c.country),device:(c==null?void 0:c.device_type)||null}})}})}function Pe(){return C({queryKey:["admin-performance-metrics"],queryFn:async()=>{const i=await w("jobs","status"),n=i.length,a=i.filter(j=>j.status==="completed").length,s=i.filter(j=>j.status==="failed").length,o=n>0?a/n*100:0,r=n>0?s/n*100:0,l=await w("articles","word_count"),c=l.length,u=l.reduce((j,I)=>j+(I.word_count||0),0),_=c>0?Math.round(u/c):0,{count:h}=await q.from("profiles").select("*",{count:"exact",head:!0}),g=le(new Date),t=await w("articles","user_id",j=>j.gte("created_at",g.toISOString())),O=new Set(t.map(j=>j.user_id)),x=await w("profiles","subscription_status, subscription_tier"),R=x.filter(j=>j.subscription_status==="active").length,y=x.filter(j=>!j.subscription_status||j.subscription_status==="inactive").length;return{totalJobs:n,completedJobs:a,failedJobs:s,successRate:Math.round(o*10)/10,errorRate:Math.round(r*10)/10,avgWordsPerArticle:_,totalArticles:c,totalUsers:h||0,activeUsers:O.size,totalWords:u,paidUsers:R,trialUsers:y}}})}function Ge(i=7){return C({queryKey:["admin-login-activity",i],queryFn:async()=>{const n=[];for(let a=i-1;a>=0;a--){const s=X(new Date,a),o=oe(s).toISOString(),r=ne(s).toISOString(),{count:l}=await q.from("profiles").select("*",{count:"exact",head:!0}).gte("last_login_at",o).lt("last_login_at",r);n.push({date:K(s,"MMM dd"),logins:l||0})}return n}})}const L=["hsl(var(--primary))","hsl(var(--chart-2))","hsl(var(--chart-3))","hsl(var(--chart-4))","hsl(var(--chart-5))","#10b981","#f59e0b","#ef4444","#8b5cf6","#ec4899"];function U({title:i,value:n,icon:a,subtitle:s,trend:o}){return e.jsx(b,{className:"bg-card border-border",children:e.jsx(f,{className:"pt-6",children:e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("div",{className:"p-3 rounded-full bg-primary/10",children:e.jsx(a,{className:"h-5 w-5 text-primary"})}),e.jsxs("div",{className:"flex-1",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:i}),e.jsx("p",{className:"text-2xl font-bold",children:n}),s&&e.jsx("p",{className:"text-xs text-muted-foreground",children:s})]})]})})})}function B({data:i,title:n}){const a=i.reduce((s,o)=>s+o.value,0);return e.jsxs("div",{className:"space-y-3",children:[e.jsx("h4",{className:"font-medium text-sm",children:n}),i.slice(0,5).map((s,o)=>e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex justify-between text-sm",children:[e.jsx("span",{className:"text-muted-foreground",children:s.name}),e.jsxs("span",{className:"font-medium",children:[s.value," (",a>0?Math.round(s.value/a*100):0,"%)"]})]}),e.jsx(fe,{value:a>0?s.value/a*100:0,className:"h-2"})]},s.name))]})}function st(){var Y,z;const[i,n]=me.useState("7"),{data:a,isLoading:s}=Ke(parseInt(i)),{data:o,isLoading:r}=Oe(parseInt(i)),{data:l,isLoading:c}=Ie(),{data:u,isLoading:_}=$e(),{data:h,isLoading:g}=Fe(),{data:t,isLoading:O}=Pe(),{data:x,isLoading:R}=qe(),{data:y,isLoading:j}=Ee(),{data:I,isLoading:ce}=Ge(7),de=d=>{switch(d==null?void 0:d.toLowerCase()){case"mobile":return e.jsx(ke,{className:"h-4 w-4"});case"tablet":return e.jsx(Re,{className:"h-4 w-4"});default:return e.jsx(H,{className:"h-4 w-4"})}};return e.jsx(xe,{children:e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold",children:"Analytics"}),e.jsx("p",{className:"text-muted-foreground",children:"Detailed analytics and user insights"})]}),e.jsxs(he,{value:i,onValueChange:n,children:[e.jsx(ue,{className:"w-[150px]",children:e.jsx(je,{placeholder:"Time range"})}),e.jsxs(ge,{children:[e.jsx(T,{value:"0",children:"Today"}),e.jsx(T,{value:"1",children:"Yesterday"}),e.jsx(T,{value:"7",children:"Last 7 days"}),e.jsx(T,{value:"14",children:"Last 14 days"}),e.jsx(T,{value:"30",children:"Last 30 days"}),e.jsx(T,{value:"60",children:"Last 60 days"}),e.jsx(T,{value:"90",children:"Last 90 days"})]})]})]}),O?e.jsx("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-4",children:[...Array(8)].map((d,m)=>e.jsx(p,{className:"h-[100px]"},m))}):e.jsxs("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-4",children:[e.jsx(U,{title:"Total Users",value:(t==null?void 0:t.totalUsers)||0,icon:J,subtitle:`${(t==null?void 0:t.activeUsers)||0} active this month`}),e.jsx(U,{title:"Paid Users",value:(t==null?void 0:t.paidUsers)||0,icon:Ne,subtitle:`${(t==null?void 0:t.trialUsers)||0} on trial`}),e.jsx(U,{title:"Total Articles",value:(t==null?void 0:t.totalArticles)||0,icon:ve,subtitle:`${((Y=t==null?void 0:t.totalWords)==null?void 0:Y.toLocaleStr
11ing())||0} total words`}),e.jsx(U,{title:"Success Rate",value:`${(t==null?void 0:t.successRate)||0}%`,icon:we,subtitle:`${(t==null?void 0:t.completedJobs)||0} completed jobs`}),e.jsx(U,{title:"Error Rate",value:`${(t==null?void 0:t.errorRate)||0}%`,icon:_e,subtitle:`${(t==null?void 0:t.failedJobs)||0} failed jobs`}),e.jsx(U,{title:"Total Jobs",value:(t==null?void 0:t.totalJobs)||0,icon:ee}),e.jsx(U,{title:"Avg Words/Article",value:((z=t==null?void 0:t.avgWordsPerArticle)==null?void 0:z.toLocaleString())||0,icon:Ce}),e.jsx(U,{title:"Conversion Rate",value:`${t!=null&&t.totalUsers?Math.round(t.paidUsers/t.totalUsers*100):0}%`,icon:Se,subtitle:"Trial to paid"})]}),e.jsxs("div",{className:"grid gap-6 md:grid-cols-2 lg:grid-cols-4",children:[e.jsxs(b,{className:"bg-card border-border",children:[e.jsx(N,{className:"pb-2",children:e.jsxs(v,{className:"text-base flex items-center gap-2",children:[e.jsx(M,{className:"h-4 w-4"}),"Top Countries"]})}),e.jsx(f,{children:R?e.jsx(p,{className:"h-[200px]"}):x!=null&&x.countries&&x.countries.length>0?e.jsx(B,{data:x.countries,title:""}):e.jsx("p",{className:"text-sm text-muted-foreground text-center py-8",children:"No data yet"})})]}),e.jsxs(b,{className:"bg-card border-border",children:[e.jsx(N,{className:"pb-2",children:e.jsxs(v,{className:"text-base flex items-center gap-2",children:[e.jsx(H,{className:"h-4 w-4"}),"Devices"]})}),e.jsx(f,{children:R?e.jsx(p,{className:"h-[200px]"}):x!=null&&x.devices&&x.devices.length>0?e.jsx(B,{data:x.devices,title:""}):e.jsx("p",{className:"text-sm text-muted-foreground text-center py-8",children:"No data yet"})})]}),e.jsxs(b,{className:"bg-card border-border",children:[e.jsx(N,{className:"pb-2",children:e.jsxs(v,{className:"text-base flex items-center gap-2",children:[e.jsx(M,{className:"h-4 w-4"}),"Browsers"]})}),e.jsx(f,{children:R?e.jsx(p,{className:"h-[200px]"}):x!=null&&x.browsers&&x.browsers.length>0?e.jsx(B,{data:x.browsers,title:""}):e.jsx("p",{className:"text-sm text-muted-foreground text-center py-8",children:"No data yet"})})]}),e.jsxs(b,{className:"bg-card border-border",children:[e.jsx(N,{className:"pb-2",children:e.jsxs(v,{className:"text-base flex items-center gap-2",children:[e.jsx(H,{className:"h-4 w-4"}),"Operating Systems"]})}),e.jsx(f,{children:R?e.jsx(p,{className:"h-[200px]"}):x!=null&&x.os&&x.os.length>0?e.jsx(B,{data:x.os,title:""}):e.jsx("p",{className:"text-sm text-muted-foreground text-center py-8",children:"No data yet"})})]})]}),e.jsxs("div",{className:"grid gap-6 md:grid-cols-2",children:[e.jsxs(b,{className:"bg-card border-border",children:[e.jsx(N,{children:e.jsxs(v,{className:"flex items-center gap-2",children:[e.jsx(J,{className:"h-5 w-5"}),"User Growth"]})}),e.jsx(f,{children:r?e.jsx(p,{className:"h-[300px] w-full"}):o&&o.length>0?e.jsx(S,{width:"100%",height:300,children:e.jsxs(Ae,{data:o,children:[e.jsx(P,{strokeDasharray:"3 3",className:"opacity-30"}),e.jsx(E,{dataKey:"date",className:"text-xs"}),e.jsx($,{yAxisId:"total",className:"text-xs"}),e.jsx($,{yAxisId:"new",orientation:"right",allowDecimals:!1,className:"text-xs"}),e.jsx(A,{contentStyle:{backgroundColor:"hsl(var(--card))",border:"1px solid hsl(var(--border))",borderRadius:"8px"}}),e.jsx(se,{}),e.jsx(Le,{yAxisId:"total",type:"monotone",dataKey:"cumulative",name:"Total Users",stroke:"hsl(var(--primary))",fill:"hsl(var(--primary))",fillOpacity:.2,strokeWidth:2}),e.jsx(Z,{yAxisId:"new",dataKey:"users",name:"New Users",fill:"hsl(var(--chart-2))",radius:[4,4,0,0]})]})}):e.jsx("div",{className:"h-[300px] flex items-center justify-center text-muted-foreground",children:"No data available"})})]}),e.jsxs(b,{className:"bg-card border-border",children:[e.jsx(N,{children:e.jsxs(v,{className:"flex items-center gap-2",children:[e.jsx(ee,{className:"h-5 w-5"}),"Login Activity (Last 7 Days)"]})}),e.jsx(f,{children:ce?e.jsx(p,{className:"h-[300px] w-full"}):I&&I.length>0?e.jsx(S,{width:"100%",height:300,children:e.jsxs(te,{data:I,children:[e.jsx(P,{strokeDasharray:"3 3",className:"opacity-30"}),e.jsx(E,{dataKey:"date",className:"text-xs"}),e.jsx($,{className:"text-xs"}),e.jsx(A,{contentStyle:{backgroundColor:"hsl(var(--card))",border:"1px solid hsl(var(--border))",borderRadius:"8px"}}),e.jsx(Z,{dataKey:"logins",name:"Logins",fill:"hsl(var(--chart-3))",radius:[4,4,0,0]})]})}):e.jsx("div",{className:"h-[300px] flex items-center justify-center text-muted-foreground",children:"No login data available"})})]})]}),e.jsxs("div",{className:"grid gap-6 md:grid-cols-2",children:[e.jsxs(b,{className:"bg-card border-border",children:[e.jsx(N,{children:e.jsx(v,{children:"Subscription Status"})}),e.jsx(f,{children:j?e.jsx(p,{className:"h-[250px] w-full"}):y!=null&&y.byStatus&&y.byStatus.length>0?e.jsx(S,{width:"100%",height:250,children:e.jsxs(G,{children:[e.jsx(W,{data:y.byStatus,cx:"50%",cy:"50%",innerRadius:60,outerRadius:100,paddingAngle:2,dataKey:"value",label:({name:d,percent:m})=>`${d} (${(m*100).toFixed(0)}%)`,children:y.byStatus.map((d,m)=>e.jsx(F,{fill:L[m%L.length]},`cell-${m}`))}),e.jsx(A,{})]})}):e.jsx("div",{className:"h-[250px] flex items-center justify-center text-muted-foreground",children:"No data available"})})]}),e.jsxs(b,{className:"bg-card border-border",children:[e.jsx(N,{children:e.jsx(v,{children:"Users by Plan"})}),e.jsx(f,{children:j?e.jsx(p,{className:"h-[250px] w-full"}):y!=null&&y.byTier&&y.byTier.length>0?e.jsx(S,{width:"100%",height:250,children:e.jsxs(G,{children:[e.jsx(W,{data:y.byTier,cx:"50%",cy:"50%",innerRadius:60,outerRadius:100,paddingAngle:2,dataKey:"value",label:({name:d,percent:m})=>`${d} (${(m*100).toFixed(0)}%)`,children:y.byTier.map((d,m)=>e.jsx(F,{fill:L[m%L.length]},`cell-${m}`))}),e.jsx(A,{})]})}):e.jsx("div",{className:"h-[250px] flex items-center justify-center text-muted-foreground",children:"No data available"})})]})]}),e.jsxs(b,{className:"bg-card border-border",children:[e.jsx(N,{children:e.jsxs(v,{className:"flex items-center gap-2",children:[e.jsx(Ue,{className:"h-5 w-5"}),"Content Generation Trends"]})}),e.jsx(f,{children:s?e.jsx(p,{className:"h-[350px] w-full"}):e.jsx(S,{width:"100%",height:350,children:e.jsxs(Te,{data:a,children:[e.jsx(P,{strokeDasharray:"3 3",className:"opacity-30"}),e.jsx(E,{dataKey:"date",className:"text-xs"}),e.jsx($,{className:"text-xs"}),e.jsx(A,{contentStyle:{backgroundColor:"hsl(var(--card))",border:"1px solid hsl(var(--border))",borderRadius:"8px"}}),e.jsx(se,{}),e.jsx(ae,{type:"monotone",dataKey:"articles",name:"Articles",stroke:"hsl(var(--primary))",strokeWidth:2,dot:!1}),e.jsx(ae,{type:"monotone",dataKey:"jobs",name:"Jobs",stroke:"hsl(var(--chart-2))",strokeWidth:2,dot:!1})]})})})]}),e.jsxs(b,{className:"bg-card border-border",children:[e.jsx(N,{children:e.jsxs(v,{className:"flex items-center gap-2",children:[e.jsx(De,{className:"h-5 w-5"}),"Words Generated by Day"]})}),e.jsx(f,{children:s?e.jsx(p,{className:"h-[300px] w-full"}):e.jsx(S,{width:"100%",height:300,children:e.jsxs(te,{data:a,children:[e.jsx(P,{strokeDasharray:"3 3",className:"opacity-30"}),e.jsx(E,{dataKey:"date",className:"text-xs"}),e.jsx($,{className:"text-xs"}),e.jsx(A,{contentStyle:{backgroundColor:"hsl(var(--card))",border:"1px solid hsl(var(--border))",borderRadius:"8px"},formatter:d=>
11[d.toLocaleString(),"Words"]}),e.jsx(Z,{dataKey:"words",fill:"hsl(var(--primary))",radius:[4,4,0,0]})]})})})]}),e.jsxs("div",{className:"grid gap-6 md:grid-cols-2",children:[e.jsxs(b,{className:"bg-card border-border",children:[e.jsx(N,{children:e.jsx(v,{children:"SEO Mode Distribution"})}),e.jsx(f,{children:c?e.jsx(p,{className:"h-[250px] w-full"}):l&&l.length>0?e.jsx(S,{width:"100%",height:250,children:e.jsxs(G,{children:[e.jsx(W,{data:l,cx:"50%",cy:"50%",innerRadius:60,outerRadius:100,paddingAngle:2,dataKey:"value",label:({name:d,percent:m})=>`${d} (${(m*100).toFixed(0)}%)`,children:l.map((d,m)=>e.jsx(F,{fill:L[m%L.length]},`cell-${m}`))}),e.jsx(A,{})]})}):e.jsx("div",{className:"h-[250px] flex items-center justify-center text-muted-foreground",children:"No data available"})})]}),e.jsxs(b,{className:"bg-card border-border",children:[e.jsx(N,{children:e.jsx(v,{children:"Language Distribution"})}),e.jsx(f,{children:_?e.jsx(p,{className:"h-[250px] w-full"}):u&&u.length>0?e.jsx(S,{width:"100%",height:250,children:e.jsxs(G,{children:[e.jsx(W,{data:u,cx:"50%",cy:"50%",innerRadius:60,outerRadius:100,paddingAngle:2,dataKey:"value",label:({name:d,percent:m})=>`${d} (${(m*100).toFixed(0)}%)`,children:u.map((d,m)=>e.jsx(F,{fill:L[m%L.length]},`cell-${m}`))}),e.jsx(A,{})]})}):e.jsx("div",{className:"h-[250px] flex items-center justify-center text-muted-foreground",children:"No data available"})})]})]}),e.jsxs(b,{className:"bg-card border-border",children:[e.jsx(N,{children:e.jsxs(v,{className:"flex items-center gap-2",children:[e.jsx(J,{className:"h-5 w-5"}),"Top Users by Usage (This Month)"]})}),e.jsx(f,{children:g?e.jsx("div",{className:"space-y-4",children:[...Array(5)].map((d,m)=>e.jsx(p,{className:"h-12 w-full"},m))}):h&&h.length>0?e.jsxs(ye,{children:[e.jsx(pe,{children:e.jsxs(Q,{children:[e.jsx(D,{children:"Rank"}),e.jsx(D,{children:"User"}),e.jsx(D,{children:"Email"}),e.jsx(D,{children:"Country"}),e.jsx(D,{children:"Device"}),e.jsx(D,{className:"text-right",children:"Articles"}),e.jsx(D,{className:"text-right",children:"Words"})]})}),e.jsx(be,{children:h.map((d,m)=>e.jsxs(Q,{children:[e.jsxs(k,{className:"font-medium",children:["#",m+1]}),e.jsx(k,{children:d.name}),e.jsx(k,{className:"text-muted-foreground",children:d.email}),e.jsx(k,{children:e.jsxs(V,{variant:"outline",className:"flex items-center gap-1 w-fit",children:[e.jsx(M,{className:"h-3 w-3"}),d.country||"Not tracked"]})}),e.jsx(k,{children:e.jsxs(V,{variant:"secondary",className:"flex items-center gap-1 w-fit",children:[de(d.device||""),d.device||"Not tracked"]})}),e.jsx(k,{className:"text-right",children:d.articles}),e.jsx(k,{className:"text-right font-medium",children:d.words.toLocaleString()})]},d.email))})]}):e.jsx("div",{className:"py-8 text-center text-muted-foreground",children:"No usage data available"})})]})]})})}export{st 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.