| (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,31713,e=>{"use strict";var t=e.i(43476),a=e.i(71645);function s({onTryNow:e}){let[s,l]=(0,a.useState)({x:0,y:0}),r=(0,a.useRef)(null);return(0,t.jsxs)("div",{ref:r,onMouseMove:e=>{if(r.current){let t=r.current.getBoundingClientRect();l({x:(e.clientX-t.left-t.width/2)/40,y:(e.clientY-t.top-t.height/2)/40})}},className:"min-h-screen flex flex-col items-center justify-center relative overflow-hidden",style:{background:"linear-gradient(135deg, #FF6B6B 0%, #FF8E53 25%, #FFC837 50%, #00BFA6 75%, #5C6BC0 100%)"},children:[(0,t.jsx)("div",{className:"absolute w-96 h-96 rounded-full opacity-20 blur-3xl",style:{background:"radial-gradient(circle, #E040FB, transparent)",top:"10%",left:"10%",transform:`translate(${2*s.x}px, ${2*s.y}px)`,transition:"transform 0.1s ease-out"},"aria-hidden":"true"}),(0,t.jsx)("div",{className:"absolute w-80 h-80 rounded-full opacity-20 blur-3xl",style:{background:"radial-gradient(circle, #FFC837, transparent)",bottom:"15%",right:"15%",transform:`translate(${-(1.5*s.x)}px, ${-(1.5*s.y)}px)`,transition:"transform 0.1s ease-out"},"aria-hidden":"true"}),(0,t.jsxs)("div",{className:"text-center z-10 animate-fade-in-up",children:[(0,t.jsx)("h1",{className:"text-6xl md:text-8xl font-bold text-white mb-6 tracking-tight",children:"Sentinel"}),(0,t.jsx)("p",{className:"text-xl md:text-2xl text-white/90 max-w-2xl mx-auto mb-4 px-4",children:"AI-powered detection of LLM misuse in information operations"}),(0,t.jsx)("p",{className:"text-base text-white/70 max-w-xl mx-auto mb-12 px-4",children:"Ensemble analysis combining AI text detection, perplexity scoring, semantic clustering, harm classification, and stylometric analysis"}),(0,t.jsx)("button",{onClick:e,className:"cta-button text-white text-xl font-semibold px-12 py-5 rounded-2xl shadow-lg focus:outline-none focus:ring-4 focus:ring-white/50","aria-label":"Try the Sentinel analyzer now",children:"Try Now →"}),(0,t.jsx)("div",{className:"mt-16 grid grid-cols-1 md:grid-cols-3 gap-6 max-w-4xl mx-auto px-4 animate-fade-in-up",style:{animationDelay:"0.35s",animationFillMode:"both"},children:[{title:"5 Detection Signals",desc:"AI generation, perplexity, embeddings, harm, stylometry"},{title:"Real-time Analysis",desc:"Sub-second results with explanation of each signal"},{title:"Production Ready",desc:"Scalable backend with async workers and caching"}].map((e,a)=>(0,t.jsxs)("div",{className:"bg-white/15 backdrop-blur-sm rounded-xl p-6 text-white border border-white/20",children:[(0,t.jsx)("h3",{className:"font-bold text-lg mb-2",children:e.title}),(0,t.jsx)("p",{className:"text-white/80 text-sm",children:e.desc})]},a))})]})]})}let l=e.i(47167).default.env.NEXT_PUBLIC_API_URL||"",r={p_ai:"AI Detection",s_perp:"Perplexity",s_embed_cluster:"Cluster Score",p_ext:"Harm/Extremism",s_styl:"Stylometry",p_watermark:"Watermark"},n={p_ai:"#FF6B6B",s_perp:"#FF8E53",s_embed_cluster:"#FFC837",p_ext:"#E040FB",s_styl:"#5C6BC0",p_watermark:"#00BFA6"};function i({value:e,color:a,label:s}){let l=Math.round(100*e);return(0,t.jsxs)("div",{className:"mb-3",children:[(0,t.jsxs)("div",{className:"flex justify-between text-sm mb-1",children:[(0,t.jsx)("span",{children:s}),(0,t.jsxs)("span",{className:"font-mono font-bold",children:[l,"%"]})]}),(0,t.jsx)("div",{className:"w-full h-3 rounded-full",style:{background:"var(--card-border)"},children:(0,t.jsx)("div",{className:"h-3 rounded-full score-bar",style:{width:`${l}%`,background:a}})})]})}function o({score:e}){return(0,t.jsxs)("span",{className:"inline-block px-4 py-2 rounded-full text-white font-bold text-lg",style:{background:e>.7?"#FF6B6B":e>.4?"#FF8E53":"#00BFA6"},children:[e>.7?"High":e>.4?"Medium":"Low"," Threat: ",Math.round(100*e),"%"]})}function d(){let[e,s]=(0,a.useState)(""),[d,c]=(0,a.useState)(!1),[m,x]=(0,a.useState)(null),[u,h]=(0,a.useState)(null),[b,p]=(0,a.useState)(!1),[g,y]=(0,a.useState)([]),f=async()=>{if(e.length<10)return void h("Text must be at least 10 characters");c(!0),h(null),x(null);try{let t=await fetch(`${l}/api/analyze`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({text:e})});if(!t.ok){let e=await t.json().catch(()=>({}));throw Error(e.detail||`Error ${t.status}`)}let a=await t.json();x(a),y(e=>[a,...e].slice(0,10))}catch(e){h(e instanceof Error?e.message:"Analysis failed")}finally{c(!1)}};return(0,t.jsx)("div",{className:"min-h-screen py-8 px-4",style:{background:"var(--background)",color:"var(--foreground)"},children:(0,t.jsxs)("div",{className:"max-w-4xl mx-auto",children:[(0,t.jsxs)("header",{className:"text-center mb-8 animate-fade-in-up",children:[(0,t.jsx)("h1",{className:"text-4xl font-bold gradient-text mb-2",children:"Sentinel Analyzer"}),(0,t.jsx)("p",{style:{color:"var(--muted)"},children:"Paste text below to analyze for LLM misuse indicators"})]}),(0,t.jsxs)("div",{className:"rounded-2xl p-6 mb-6 card-hover",style:{background:"var(--card-bg)",border:"1px solid var(--card-border)",boxShadow:"var(--shadow-md)"},children:[(0,t.jsx)("label",{htmlFor:"analysis-input",className:"block text-sm font-medium mb-2",children:"Text to analyze"}),(0,t.jsx)("textarea",{id:"analysis-input",value:e,onChange:e=>s(e.target.value),placeholder:"Paste text here to check for AI generation, extremism, disinformation patterns...",className:"w-full h-40 p-4 rounded-xl resize-none text-base focus:outline-none focus:ring-2",style:{background:"var(--background)",border:"1px solid var(--card-border)",color:"var(--foreground)"},"aria-label":"Text input for analysis"}),(0,t.jsxs)("div",{className:"flex items-center justify-between mt-4",children:[(0,t.jsxs)("span",{className:"text-sm",style:{color:"var(--muted)"},children:[e.length," characters"]}),(0,t.jsx)("button",{onClick:f,disabled:d||e.length<10,className:"cta-button text-white font-semibold px-8 py-3 rounded-xl disabled:opacity-50 disabled:cursor-not-allowed","aria-label":"Analyze text",children:d?(0,t.jsxs)("span",{className:"flex items-center gap-2",children:[(0,t.jsxs)("svg",{className:"animate-spin h-5 w-5",viewBox:"0 0 24 24","aria-hidden":"true",children:[(0,t.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),(0,t.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),"Analyzing..."]}):"Analyze"})]})]}),u&&(0,t.jsx)("div",{className:"rounded-xl p-4 mb-6 border",style:{borderColor:"#FF6B6B",background:"#FF6B6B15"},children:(0,t.jsx)("p",{className:"text-sm",style:{color:"#FF6B6B"},children:u})}),m&&null!==m.threat_score&&(0,t.jsx)("div",{className:"animate-fade-in-up",children:(0,t.jsxs)("div",{className:"rounded-2xl p-6 mb-6",style:{background:"var(--card-bg)",border:"1px solid var(--card-border)",boxShadow:"var(--shadow-md)"},children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-6",children:[(0,t.jsx)("h2",{className:"text-2xl font-bold",children:"Results"}),(0,t.jsx)(o,{score:m.threat_score})]}),m.signals&&(0,t.jsxs)("div",{className:"mb-6",children:[(0,t.jsx)("h3",{className:"font-semibold mb-4",children:"Signal Scores"}),Object.entries(m.signals).map(([e,a])=>null!=a?(0,t.jsx)(i,{value:a,color:n[e]||"#999",label:r[e]||e},e):null)]}),m.processing_time_ms&&(0,t.jsxs)("p",{className:"text-sm",style:{color:"var(--muted)"},children:["Processed in ",m.processing_time_ms,"ms"]}),m.explainability&&m.explainability.length>0&&(0,t.jsxs)("div",{className:"mt-4",children:[(0,t.jsxs)("button",{onClick:()=>p(!b),className:"text-sm font-medium px-4 py-2 rounded-lg text-white",style:{background:"#5C6BC0"},"aria-expanded":b,"aria-controls":"explainability-panel",children:[b?"Hide":"Show"," Explainability"]}),b&&(0,t.jsx)("div",{id:"explainability-panel",className:"mt-4 rounded-xl p-4 space-y-3",style:{background:"var(--background)",border:"1px solid var(--card-border)"},role:"region","aria-label":"Signal explainability breakdown",children:m.explainability.map((e,a)=>(0,t.jsxs)("div",{className:"flex items-center justify-between p-3 rounded-lg",style:{background:"var(--card-bg)"},children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"font-medium",children:r[e.signal]||e.signal}),(0,t.jsx)("p",{className:"text-xs",style:{color:"var(--muted)"},children:e.description})]}),(0,t.jsxs)("div",{className:"text-right",children:[(0,t.jsxs)("div",{className:"font-mono font-bold",children:[Math.round(100*e.value),"%"]}),(0,t.jsxs)("div",{className:"text-xs",style:{color:"var(--muted)"},children:["Weight: ",e.weight," → ",e.contribution>0?"+":"",(100*e.contribution).toFixed(1),"%"]})]})]},a))})]})]})}),g.length>0&&(0,t.jsxs)("div",{className:"mt-8",children:[(0,t.jsx)("h3",{className:"text-lg font-bold mb-4",children:"Recent Analyses"}),(0,t.jsx)("div",{className:"space-y-3",children:g.map((e,a)=>(0,t.jsxs)("div",{className:"flex items-center justify-between p-4 rounded-xl card-hover",style:{background:"var(--card-bg)",border:"1px solid var(--card-border)",boxShadow:"var(--shadow-sm)"},children:[(0,t.jsx)("span",{className:"text-sm truncate max-w-md",style:{color:"var(--muted)"},children:e.id}),null!==e.threat_score&&(0,t.jsx)(o,{score:e.threat_score})]},a))})]})]})})}function c(){return(0,a.useEffect)(()=>{let e=localStorage.getItem("theme"),t=window.matchMedia("(prefers-color-scheme: dark)").matches;document.documentElement.setAttribute("data-theme","dark"===e||!e&&t?"dark":"light")},[]),(0,t.jsxs)("button",{onClick:()=>{let e="dark"===document.documentElement.getAttribute("data-theme")?"light":"dark";document.documentElement.setAttribute("data-theme",e),localStorage.setItem("theme",e)},className:"theme-toggle fixed top-4 right-4 z-50 p-3 rounded-full shadow-md transition-colors","aria-label":"Toggle dark/light mode",children:[(0,t.jsx)("svg",{className:"theme-sun",width:"20",height:"20",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M12 3a1 1 0 011 1v1a1 1 0 01-2 0V4a1 1 0 011-1zm0 15a1 1 0 011 1v1a1 1 0 01-2 0v-1a1 1 0 011-1zm9-9a1 1 0 010 2h-1a1 1 0 010-2h1zM5 11a1 1 0 010 2H4a1 1 0 010-2h1zm14.07-5.07a1 1 0 010 1.41l-.71.71a1 1 0 01-1.41-1.41l.71-.71a1 1 0 011.41 0zM7.05 16.95a1 1 0 010 1.41l-.71.71a1 1 0 01-1.41-1.41l.71-.71a1 1 0 011.41 0zm12.02 0a1 1 0 01-1.41 1.41l-.71-.71a1 1 0 011.41-1.41l.71.71zM7.05 7.05a1 1 0 01-1.41 0l-.71-.71a1 1 0 011.41-1.41l.71.71a1 1 0 010 1.41zM12 7a5 5 0 100 10 5 5 0 000-10z"})}),(0,t.jsx)("svg",{className:"theme-moon",width:"20",height:"20",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M21 12.79A9 9 0 1111.21 3a7 7 0 009.79 9.79z"})})]})}function m(){let[e,l]=(0,a.useState)(!1);return(0,t.jsxs)("main",{children:[(0,t.jsx)(c,{}),e?(0,t.jsx)(d,{}):(0,t.jsx)(s,{onTryNow:()=>l(!0)})]})}e.s(["default",()=>m],31713)}]); |