1"use strict";(self.rspackChunknewapi_web=self.rspackChunknewapi_web||[]).push([[4471],{68010(e,t,s){s.r(t),s.d(t,{component:()=>u});var r=s(72361),a=s(68413),i=s(53540),n=s(6702),l=s(64577),c=s(67267),x=s(46775);let d=[1,7,30,90];function h(e,t){return t<=0?"â":`${(e/t*100).toFixed(1)}%`}let u=function(){let{t:e}=(0,n.Bd)(),[t,s]=(0,a.useState)(30),{data:u,isLoading:p}=(0,i.I)({queryKey:["source-stats",t],queryFn:async()=>{let e=await l.FH.get(`/api/source_stats?days=${t}`);return e.data?.data},staleTime:6e4}),o=u?.summary??[];return(0,r.jsxs)(c.Ni,{children:[(0,r.jsx)(c.Ni.Title,{children:e("Source Analytics")}),(0,r.jsx)(c.Ni.Description,{children:e("Visit â registration â payment funnel by promotion source (utm_source / referrer)")}),(0,r.jsx)(c.Ni.Actions,{children:(0,r.jsx)("div",{className:"flex gap-1",children:d.map(a=>(0,r.jsx)(x.$,{size:"sm",variant:t===a?"default":"outline",onClick:()=>s(a),children:1===a?e("Today"):`${a} ${e("days")}`},a))})}),(0,r.jsx)(c.Ni.Content,{children:(0,r.jsx)("div",{className:"overflow-x-auto rounded-md border",children:(0,r.jsxs)("table",{className:"w-full text-sm",children:[(0,r.jsx)("thead",{children:(0,r.jsxs)("tr",{className:"border-b text-left",children:[(0,r.jsx)("th",{className:"px-3 py-2",children:e("Source")}),(0,r.jsx)("th",{className:"px-3 py-2 text-right",children:e("Visits")}),(0,r.jsx)("th",{className:"px-3 py-2 text-right",children:e("Registrations")}),(0,r.jsx)("th",{className:"px-3 py-2 text-right",children:e("Registration rate")}),(0,r.jsx)("th",{className:"px-3 py-2 text-right",children:e("Paying users")}),(0,r.jsx)("th",{className:"px-3 py-2 text-right",children:e("Paying rate")}),(0,r.jsx)("th",{className:"px-3 py-2 text-right",children:e("Repeat buyers")}),(0,r.jsx)("th",{className:"px-3 py-2 text-right",children:e("Repeat rate")}),(0,r.jsx)("th",{className:"px-3 py-2 text-right",children:e("Revenue (USD)")})]})}),(0,r.jsxs)("tbody",{children:[p&&(0,r.jsx)("tr",{children:(0,r.jsx)("td",{className:"text-muted-foreground px-3 py-6",colSpan:9,children:e("Loading...")})}),!p&&0===o.length&&(0,r.jsx)("tr",{children:(0,r.jsx)("td",{className:"text-muted-foreground px-3 py-6",colSpan:9,children:e("No data yet. Promote with ?utm_source=xxx links to start attribution.")})}),o.map(t=>(0,r.jsxs)("tr",{className:"border-b last:border-0",children:[(0,r.jsx)("td",{className:"px-3 py-2 font-mono",children:"unknown"===t.source?e("Legacy users (untraceable)"):t.source}),(0,r.jsx)("td",{className:"px-3 py-2 text-right tabular-nums",children:t.visits}),(0,r.jsx)("td",{className:"px-3 py-2 text-right tabular-nums",children:t.registrations}),(0,r.jsx)("td",{className:"px-3 py-2 text-right tabular-nums",children:h(t.registrations,t.visits)}),(0,r.jsx)("td",{className:"px-3 py-2 text-right tabular-nums",children:t.paying_users}),(0,r.jsx)("td",{className:"px-3 py-2 text-right tabular-nums",children:h(t.paying_users,t.registrations)}),(0,r.jsx)("td",{className:"px-3 py-2 text-right tabular-nums",children:t.repeat_users}),(0,r.jsx)("td",{className:"px-3 py-2 text-right tabular-nums",children:h(t.repeat_users,t.paying_users)}),(0,r.jsxs)("td",{className:"px-3 py-2 text-right tabular-nums",children:["$",t.revenue.toFixed(2)]})]},t.source))]})]})})})]})}}}]);
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.