import{k as e}from"./index-BVfpSx5Q.js";import{L as n}from"./layout-NiehYZnq.js";import{P as c,K as a,S as i,C as x,f as d,c as o}from"./ui-DGkmnhL-.js";import{U as t}from"./hatunDoctrine-Cq1LMtli.js";const m={human:"ok","likely-human":"ok",uncertain:"warn","likely-ai":"error",ai:"error"},p={pass:"pass","soft-warn":"soft-warn","block-and-reroute":"block + reroute"};function f(){const r=t.filter(s=>s.recommendedAction!=="pass").length,l=t.filter(s=>s.recommendedAction==="block-and-reroute").length;return e.jsxs(n,{children:[e.jsx(c,{label:"DOCTRINE · AI USER-TURN DETECTOR",title:"AI-Generated User-Turn Detector",subtitle:"Approvals are checked for human authorship. Typing dynamics, perplexity, burstiness, and session context decide if the human-in-the-loop was actually human.",status:"LIVE"}),e.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3 mb-6",children:[e.jsx(a,{label:"APPROVALS CHECKED",value:t.length,sub:"this window",accent:"#c9b787"}),e.jsx(a,{label:"FLAGGED",value:r,sub:"non-pass verdict",accent:"#8a8a8a"}),e.jsx(a,{label:"BLOCKED",value:l,sub:"re-routed for verification",accent:"#c9b787"}),e.jsx(a,{label:"SIGNALS / DECISION",value:4,sub:"typing, perplexity, burst, ctx",accent:"#c9b787"})]}),e.jsx(i,{children:"Recent Approval Checks"}),e.jsx("div",{className:"flex flex-col gap-3",children:t.map(s=>e.jsxs(x,{children:[e.jsxs("div",{className:"flex items-start justify-between gap-3 mb-3 flex-wrap",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1 flex-wrap",children:[e.jsxs("span",{className:"font-mono text-xs",style:{color:"var(--color-a11oy-text-ghost)"},children:[s.id," · ",s.approvalRef]}),e.jsx(d,{status:m[s.verdict],label:s.verdict.toUpperCase()}),e.jsxs("span",{className:"text-xs px-2 py-0.5 rounded font-mono",style:{backgroundColor:"var(--color-a11oy-muted)",color:"var(--color-a11oy-text-ghost)"},children:["action: ",p[s.recommendedAction]]})]}),e.jsxs("div",{className:"text-sm font-semibold",style:{color:"var(--color-a11oy-text)"},children:[s.actor," — ",s.actorRole]})]}),e.jsx("div",{className:"text-xs font-mono",style:{color:"var(--color-a11oy-text-ghost)"},children:new Date(s.submittedAt).toLocaleString()})]}),e.jsxs("div",{className:"grid sm:grid-cols-2 gap-3 text-xs",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"w-44 flex-shrink-0",style:{color:"var(--color-a11oy-text-ghost)"},children:"Typing dynamics"}),e.jsx("div",{className:"flex-1",children:e.jsx(o,{value:s.signals.typingDynamicsScore*100})}),e.jsx("span",{className:"font-mono w-10 text-right",style:{color:"var(--color-a11oy-text)"},children:Math.round(s.signals.typingDynamicsScore*100)})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"w-44 flex-shrink-0",style:{color:"var(--color-a11oy-text-ghost)"},children:"Burstiness"}),e.jsx("div",{className:"flex-1",children:e.jsx(o,{value:s.signals.burstinessScore*100})}),e.jsx("span",{className:"font-mono w-10 text-right",style:{color:"var(--color-a11oy-text)"},children:Math.round(s.signals.burstinessScore*100)})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"w-44 flex-shrink-0",style:{color:"var(--color-a11oy-text-ghost)"},children:"Perplexity vs human corpus"}),e.jsx("span",{className:"font-mono",style:{color:s.signals.perplexityVsHumanCorpus<12?"#8a8a8a":"#c9b787"},children:s.signals.perplexityVsHumanCorpus.toFixed(1)})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"w-44 flex-shrink-0",style:{color:"var(--color-a11oy-text-ghost)"},children:"Session context"}),e.jsx("div",{className:"flex-1",children:e.jsx(o,{value:s.signals.sessionContextScore*100})}),e.jsx("span",{className:"font-mono w-10 text-right",style:{color:"var(--color-a11oy-text)"},children:Math.round(s.signals.sessionContextScore*100)})]})]})]},s.id))})]})}export{f as AIUserTurn};