PageSourceSearch

https://hantavirusmap.com/assets/x9k2-console.email.reports-CEaAP8PL.js

js hantavirusmap.com collected 2026-10-02 23:21:17 UTC 6,246 bytes, 1 lines download raw bytes

1import{r as s,j as e}from"./main-BZn_dPrE.js";import{i as S,j as C,k as _}from"./email.functions-Bcy2AdfR.js";function E(){const[o,j]=s.useState([]),[g,y]=s.useState(0),[x,N]=s.useState(""),[p,f]=s.useState("all"),[u,k]=s.useState(""),[d,l]=s.useState(!1),[m,r]=s.useState(null),[h,a]=s.useState(null),[b,c]=s.useState(null),n=async()=>{l(!0),a(null);try{const t=await S({data:{weekStart:x||void 0,locale:p,iso2:u||void 0}});j(t.rows),y(t.totalTokens)}catch(t){a(t instanceof Error?t.message:String(t))}finally{l(!1)}};s.useEffect(()=>{n()},[]);const v=async t=>{l(!0),r(null),a(null);try{await _({data:{iso2:t.iso2,locale:t.locale,weekStart:t.week_start}}),r(`Regenerated ${t.iso2}/${t.locale}`),await n()}catch(i){a(i instanceof Error?i.message:String(i))}finally{l(!1)}},w=async()=>{l(!0),r(null),a(null);try{const t=await C();r(`Built ${t.built} new, ${t.cached} cached, ${t.quiet} quiet, ${t.errors} errors (week ${t.week}).`),await n()}catch(t){a(t instanceof Error?t.message:String(t))}finally{l(!1)}};return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"rounded-lg border border-border bg-card p-3 flex flex-wrap gap-2 items-end",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-[11px] text-muted-foreground",children:"Week (YYYY-MM-DD)"}),e.jsx("input",{value:x,onChange:t=>N(t.target.value),placeholder:"(latest)",className:"rounded border border-border bg-background px-2 py-1.5 text-xs font-mono"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[11px] text-muted-foreground",children:"Locale"}),e.jsxs("select",{value:p,onChange:t=>f(t.target.value),className:"rounded border border-border bg-background px-2 py-1.5 text-xs",children:[e.jsx("option",{value:"all",children:"all"}),e.jsx("option",{value:"en",children:"en"}),e.jsx("option",{value:"nl",children:"nl"}),e.jsx("option",{value:"es",children:"es"}),e.jsx("option",{value:"pt",children:"pt"}),e.jsx("option",{value:"de",children:"de"}),e.jsx("option",{value:"fr",children:"fr"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[11px] text-muted-foreground",children:"ISO2"}),e.jsx("input",{value:u,onChange:t=>k(t.target.value.toUpperCase()),maxLength:2,className:"w-20 rounded border border-border bg-background px-2 py-1.5 text-xs font-mono uppercase"})]}),e.jsx("button",{onClick:n,disabled:d,className:"rounded bg-primary px-3 py-1.5 text-xs text-primary-foreground",children:"Filter"}),e.jsx("button",{onClick:w,disabled:d,className:"rounded border border-border px-3 py-1.5 text-xs",children:"Build now"}),e.jsxs("div",{className:"ml-auto text-[11px] text-muted-foreground",children:[o.length," reports · ",g.toLocaleString()," tokens"]})]}),m&&e.jsx("div",{className:"text-[11px] text-muted-foreground",children:m}),h&&e.jsx("div",{className:"text-[11px] text-destructive",children:h}),e.jsx("div",{className:"rounded-lg border border-border bg-card overflow-x-auto",children:e.jsxs("table",{className:"w-full text-xs",children:[e.jsx("thead",{className:"bg-muted/40",children:e.jsxs("tr",{children:[e.jsx("th",{className:"text-left px-2 py-2",children:"Country"}),e.jsx("th",{className:"px-2 py-2",children:"Locale"}),e.jsx("th",{className:"px-2 py-2",children:"Week"}),e.jsx("th",{className:"px-2 py-2",children:"Score"}),e.jsx("th",{className:"px-2 py-2",children:"Δ"}),e.jsx("th",{className:"px-2 py-2",children:"Alerts"}),e.jsx("th",{className:"px-2 py-2",children:"Status"}),e.jsx("th",{className:"px-2 py-2",children:"Tokens"}),e.jsx("th",{className:"px-2 py-2",children:"Generated"}),e.jsx("th",{className:"px-2 py-2",children:"Actions"})]})}),e.jsxs("tbody",{children:[o.map(t=>e.jsxs("tr",{className:"border-t border-border",children:[e.jsxs("td",{className:"px-2 py-1.5",children:[e.jsxs("div",{className:"font-medium",children:[t.country_name," ",e.jsxs("span",{className:"text-muted-foreground",children:["(",t.iso2,")"]})]}),t.ai_headline&&e.jsx("div",{className:"text-[10px] text-muted-foreground line-clamp-1",children:t.ai_headline})]}),e.jsx("td",{className:"px-2 py-1.5 text-center font-mono",children:t.locale}),e.jsx("td",{className:"px-2 py-1.5 text-center font-mono",children:t.week_start}),e.jsx("td",{className:"px-2 py-1.5 text-center font-bold",children:t.risk_score}),e.jsx("td",{className:"px-2 py-1.5 text-center",children:t.risk_delta===null?"—":t.risk_delta>0?`+${t.risk_delta}`:t.risk_delta}),e.jsx("td",{className:"px-2 py-1.5 text-center",children:t.alerts_count}),e.jsx("td",{className:"px-2 py-1.5 text-center",children:t.error?e.jsx("span",{className:"text-destructive",children:"error"}):t.is_quiet?e.jsx("span",{className:"text-muted-foreground",children:"quiet"}):e.jsx("span",{className:"text-emerald-500",children:"ok"})}),e.jsx("td",{className:"px-2 py-1.5 text-right",children:t.tokens_used.toLocaleStr
1ing()}),e.jsx("td",{className:"px-2 py-1.5 text-[10px] text-muted-foreground",children:new Date(t.generated_at).toUTCString().slice(5,22)}),e.jsx("td",{className:"px-2 py-1.5",children:e.jsxs("div",{className:"flex gap-1",children:[e.jsx("button",{onClick:()=>c(t.rendered_html),className:"rounded border border-border px-1.5 py-0.5 text-[10px] hover:bg-muted",children:"Preview"}),e.jsx("button",{onClick:()=>v(t),disabled:d,className:"rounded border border-border px-1.5 py-0.5 text-[10px] hover:bg-muted",children:"Regen"})]})})]},`${t.iso2}-${t.locale}-${t.week_start}`)),o.length===0&&e.jsx("tr",{children:e.jsx("td",{colSpan:10,className:"text-center px-2 py-4 text-muted-foreground",children:"No reports."})})]})]})}),b!==null&&e.jsx("div",{className:"fixed inset-0 z-50 bg-black/60 p-4 overflow-auto",onClick:()=>c(null),children:e.jsxs("div",{className:"mx-auto max-w-2xl bg-white rounded-lg p-4",onClick:t=>t.stopPropagation(),children:[e.jsxs("div",{className:"flex justify-between mb-2",children:[e.jsx("h3",{className:"text-sm font-medium text-black",children:"Block preview"}),e.jsx("button",{onClick:()=>c(null),className:"text-xs text-black",children:"Close"})]}),e.jsx("iframe",{srcDoc:`<!doctype html><html><body style="margin:0;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Arial,sans-serif">${b}</body></html>`,className:"w-full h-[600px] border border-border rounded"})]})})]})}export{E as component};

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.