From f91a8317618df8471540a077818f9b9228929db3 Mon Sep 17 00:00:00 2001 From: Jonathan Singer Date: Mon, 20 Jul 2026 13:36:07 -0400 Subject: [PATCH] Hide the trust banner on the Pro feature pages --- .../assets/{index-DQjB5huW.js => index-BFNT20u6.js} | 2 +- strix/viewer/viewer_dist/index.html | 2 +- strix/viewer_src/src/App.tsx | 12 +++++++----- 3 files changed, 9 insertions(+), 7 deletions(-) rename strix/viewer/viewer_dist/assets/{index-DQjB5huW.js => index-BFNT20u6.js} (99%) diff --git a/strix/viewer/viewer_dist/assets/index-DQjB5huW.js b/strix/viewer/viewer_dist/assets/index-BFNT20u6.js similarity index 99% rename from strix/viewer/viewer_dist/assets/index-DQjB5huW.js rename to strix/viewer/viewer_dist/assets/index-BFNT20u6.js index 4cdadc03..e21185da 100644 --- a/strix/viewer/viewer_dist/assets/index-DQjB5huW.js +++ b/strix/viewer/viewer_dist/assets/index-BFNT20u6.js @@ -487,6 +487,6 @@ https://github.com/highlightjs/highlight.js/issues/2277`),Ht=ye,ft=ze),Qe===void ... more content available`:"")})})()]})}function U9({args:e,result:t}){const i=(e.method??"GET").toUpperCase(),a=e.url??"",s=e.headers,o=e.body,c=typeof o=="string"?o:"",d=t,h=d?d.error??null:null,f=d?d.status_code??null:null,m=d?d.response_time_ms??null:null,p=d?d.body:null,y=typeof p=="string"?p:null;return g.jsxs("div",{children:[g.jsx("span",{className:"text-purple-400/80 font-semibold text-sm",children:"request"}),g.jsxs("div",{className:"mt-1.5 font-mono text-[13px] space-y-0.5",children:[g.jsxs("div",{children:[g.jsx("span",{className:"text-[#555] select-none mr-1",children:">>"}),g.jsx("span",{className:`font-bold ${MN[i]??"text-[#888]"}`,children:i}),g.jsx("span",{className:"text-[#888] ml-1 break-all",children:Fi(a,180)})]}),s&&typeof s=="object"&&Object.entries(s).slice(0,5).map(([x,_])=>g.jsxs("div",{className:"text-[#555] pl-5",children:[x,": ",Qm(String(_),150)]},x))]}),c&&g.jsx(br,{className:"text-[#888]",children:Wm(c,4)}),h&&g.jsx("div",{className:"text-red-400/70 text-[13px] mt-1.5",children:Qm(h,150)}),f!=null&&g.jsxs("div",{className:"font-mono text-[13px] mt-1.5",children:[g.jsx("span",{className:"text-[#555] select-none mr-1",children:"<<"}),g.jsx("span",{className:`font-bold ${Qp(f)}`,children:f}),m!=null&&g.jsxs("span",{className:"text-[#555] ml-2",children:[m,"ms"]})]}),y&&g.jsx(br,{className:"text-[#666]",children:Wm(y,6)})]})}function H9({args:e,result:t}){const i=e.request_id,a=e.modifications,s=t,o=s?s.status_code??null:null,c=s?s.response_time_ms??null:null,d=s?s.body:null,h=typeof d=="string"?d:null;return g.jsxs("div",{children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("span",{className:"text-purple-400/80 font-semibold text-sm",children:"repeating request"}),i!=null&&g.jsxs("span",{className:"text-[#888] text-[13px]",children:["#",i]})]}),a&&typeof a=="object"&&Object.keys(a).length>0&&g.jsx("div",{className:"mt-1.5 font-mono text-[13px] space-y-0.5",children:Object.entries(a).slice(0,5).map(([f,m])=>g.jsxs("div",{children:[g.jsxs("span",{className:"text-orange-400/60",children:[f,":"]})," ",g.jsx("span",{className:"text-[#777]",children:Qm(typeof m=="string"?m:JSON.stringify(m),150)})]},f))}),o!=null&&g.jsxs("div",{className:"font-mono text-[13px] mt-1.5",children:[g.jsx("span",{className:"text-[#555] select-none mr-1",children:"<<"}),g.jsx("span",{className:`font-bold ${Qp(o)}`,children:o}),c!=null&&g.jsxs("span",{className:"text-[#555] ml-2",children:[c,"ms"]})]}),h&&g.jsx(br,{className:"text-[#666]",children:Wm(h,5)})]})}const $9={get:"getting",list:"listing",create:"creating",update:"updating",delete:"deleting"};function q9({args:e}){const t=e.action??"",i=e.scope_name??"",a=$9[t]??(t||"managing");return g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsxs("span",{className:"text-purple-400/80 font-semibold text-sm",children:[a," proxy scope"]}),i&&g.jsx("span",{className:"text-[#888] text-[13px]",children:Fi(i,50)})]})}function P9({args:e}){const t=e.parent_id;return g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("span",{className:"text-purple-400/80 font-semibold text-sm",children:"listing sitemap"}),t&&g.jsxs("span",{className:"text-[#888] text-[13px]",children:["under #",Fi(String(t),20)]})]})}function F9({args:e}){const t=e.entry_id;return g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("span",{className:"text-purple-400/80 font-semibold text-sm",children:"viewing sitemap entry"}),t&&g.jsxs("span",{className:"text-[#888] text-[13px]",children:["#",Fi(String(t),20)]})]})}function G9(e){switch(e.toolName){case"list_requests":return g.jsx(I9,{...e});case"view_request":return g.jsx(B9,{...e});case"send_request":return g.jsx(U9,{...e});case"repeat_request":return g.jsx(H9,{...e});case"scope_rules":return g.jsx(q9,{...e});case"list_sitemap":return g.jsx(P9,{...e});case"view_sitemap_entry":return g.jsx(F9,{...e});default:return g.jsx("span",{className:"text-purple-400/80 font-semibold text-sm",children:e.toolName.replace(/_/g," ")})}}function V9({args:e}){const t=e.thought??e.content??"";return t?g.jsxs("div",{children:[g.jsx("span",{className:"text-purple-400/80 font-semibold text-sm",children:"Agent is thinking"}),g.jsx("div",{className:"mt-1.5 italic text-[#888]",children:g.jsx(Ln,{text:t,maxLines:20})})]}):null}function Y9({toolName:e,args:t}){if(e==="create_agent"){const i=t.name??t.agent_name??"",a=t.task??"";return g.jsxs("div",{children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("span",{className:"text-cyan-400/80 font-semibold text-sm",children:"spawning"}),i&&g.jsx("span",{className:"text-cyan-400 font-semibold text-sm",children:i})]}),a&&g.jsx("div",{className:"mt-1.5",children:g.jsx(Ln,{text:a,maxLines:15})})]})}if(e==="agent_finish"){const i=t.result_summary??"",a=t.success,s=t.findings,o=Array.isArray(s)?s:void 0;return g.jsxs("div",{children:[g.jsx("span",{className:`font-semibold text-sm ${a===!1?"text-red-400/80":"text-emerald-400/80"}`,children:a===!1?"Agent failed":"Agent completed"}),i&&g.jsx("div",{className:"mt-1.5",children:g.jsx(Ln,{text:i,maxLines:20})}),o&&o.length>0&&g.jsx("div",{className:"mt-1.5 space-y-0.5",children:o.map((c,d)=>g.jsxs("div",{className:"text-[13px] text-[#888]",children:[g.jsx("span",{className:"text-red-400/50 mr-1",children:"•"}),typeof c=="string"?c:JSON.stringify(c)]},d))})]})}if(e==="send_message_to_agent"){const i=t.message??"",a=t.target_agent_id??t.agent_id??"";return g.jsxs("div",{children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("span",{className:"text-cyan-400/80 font-semibold text-sm",children:"message"}),a&&g.jsxs("span",{className:"text-[#888] text-[13px]",children:["to ",a.slice(0,16)]})]}),i&&g.jsx("div",{className:"mt-1.5",children:g.jsx(Ln,{text:i,maxLines:20})})]})}if(e==="wait_for_message"){const i=t.reason??"";return g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("span",{className:"text-cyan-400/80 font-semibold text-sm",children:"waiting"}),i&&g.jsx("span",{className:"text-[#888] text-[13px] truncate",children:i})]})}if(e==="stop_agent"){const i=t.target_agent_id??"",a=t.cascade!==!1,s=t.reason??"";return g.jsxs("div",{children:[g.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[g.jsx("span",{className:"text-red-400/80 font-semibold text-sm",children:"stopping"}),i&&g.jsx("span",{className:"text-[#888] text-[13px]",children:i.slice(0,16)}),a&&g.jsx("span",{className:"text-[#555] text-[13px] italic",children:"+ descendants"})]}),s&&g.jsx("div",{className:"mt-1.5 text-[#888] text-[13px]",children:s})]})}return e==="view_agent_graph"?g.jsx("span",{className:"text-cyan-400/80 font-semibold text-sm",children:"viewing agents graph"}):g.jsx("span",{className:"text-cyan-400/80 font-semibold text-sm",children:e.replace(/_/g," ")})}function X9({args:e,result:t}){const i=e.query??e.search_query??"",a=t,s=a?a.content??null:null,o=a&&!a.success?a.message??null:null;return g.jsxs("div",{children:[g.jsx("span",{className:"text-amber-400/80 font-semibold text-sm",children:"Searching the web"}),i&&g.jsx("div",{className:"text-[#888] text-[13px] mt-0.5",children:i}),o&&g.jsx("div",{className:"text-red-400/70 text-[13px] mt-1.5",children:o}),s&&g.jsx("div",{className:"mt-2",children:g.jsx(Ln,{text:s,maxLines:15})})]})}const K9=50,F1=200,G1=25,V1=24,Z9=/\x1b(?:[@-Z\\-_]|\[[0-?]*[ -/]*[@-~]|\][^\x07]*\x07)/g,Q9=/\.\.\. \[(stdout|stderr|result|output|error) truncated at \d+k? chars\]/g;function W9(e){return e.replace(Z9,"")}function ym(e){const t=W9(e);return t.length>F1?t.slice(0,F1-3)+"...":t}function J9(e){return e.replace(Q9,"").trim()}function eU(e){const t=e.split(` `);if(t.length<=K9)return t.map(ym).join(` `);const i=t.length-G1-V1;return[...t.slice(0,G1).map(ym),`... ${i} lines truncated ...`,...t.slice(-V1).map(ym)].join(` -`)}function tU({args:e,result:t}){const i=e.action??"",a=e.code??e.script??"",s=t;let o=null;s&&typeof s=="object"?o=typeof s.stdout=="string"?s.stdout:null:typeof s=="string"&&(o=s);const c=i==="new_session"?"new session":i==="close"?"close session":i==="list_sessions"?"list sessions":null,d=o?eU(J9(o)):null;return g.jsxs("div",{children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("span",{className:"text-yellow-400/80 font-semibold text-sm",children:"Python"}),c&&g.jsx("span",{className:"text-[#888] text-[13px]",children:c})]}),a&&g.jsx(Kp,{code:a,language:"python",collapsible:!0}),d&&g.jsx(br,{className:"text-[#666]",children:d})]})}function nU({args:e}){const t=e.targets,a=(Array.isArray(t)?t:[]).map(s=>typeof s=="object"&&s?s.original??null:null).filter(Boolean);return g.jsxs("div",{children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("span",{className:"text-emerald-400/80 font-semibold text-sm",children:"Starting penetration test"}),a.length===1&&g.jsxs("span",{className:"text-[#888] text-[13px]",children:["on ",a[0]]})]}),a.length>1&&g.jsx("div",{className:"mt-1.5 space-y-0.5",children:a.map((s,o)=>g.jsxs("div",{className:"text-[13px] text-[#888]",children:[g.jsx("span",{className:"text-[#555] mr-1",children:"•"}),s]},o))})]})}function iU({args:e}){const t=e.name??"Unknown Agent",i=e.task??"";return g.jsxs("div",{children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("span",{className:"text-[#888] text-[13px]",children:"subagent"}),g.jsx("span",{className:"text-purple-400 font-semibold text-sm",children:t})]}),i&&g.jsx("div",{className:"mt-1.5",children:g.jsx(Ln,{text:i,maxLines:15})})]})}function rU(e){return e.toolName==="subagent_start_info"?g.jsx(iU,{...e}):g.jsx(nU,{...e})}function aU({args:e}){const t=e.executive_summary??"",i=e.methodology??"",a=e.technical_analysis??"",s=e.recommendations??"";return g.jsxs("div",{className:"space-y-3",children:[g.jsx("span",{className:"text-emerald-400/80 font-semibold text-sm",children:"Penetration test completed"}),t&&g.jsxs("div",{children:[g.jsx("span",{className:"text-emerald-400/60 text-sm font-semibold",children:"Executive Summary"}),g.jsx("div",{className:"mt-1",children:g.jsx(Ln,{text:t,maxLines:25})})]}),i&&g.jsxs("div",{children:[g.jsx("span",{className:"text-emerald-400/60 text-sm font-semibold",children:"Methodology"}),g.jsx("div",{className:"mt-1",children:g.jsx(Ln,{text:i,maxLines:25})})]}),a&&g.jsxs("div",{children:[g.jsx("span",{className:"text-emerald-400/60 text-sm font-semibold",children:"Technical Analysis"}),g.jsx("div",{className:"mt-1",children:g.jsx(Ln,{text:a,maxLines:25})})]}),s&&g.jsxs("div",{children:[g.jsx("span",{className:"text-emerald-400/60 text-sm font-semibold",children:"Recommendations"}),g.jsx("div",{className:"mt-1",children:g.jsx(Ln,{text:s,maxLines:25})})]}),!t&&!i&&!a&&!s&&g.jsx("div",{className:"text-[#555] text-xs",children:"Generating final report..."})]})}function sU({toolName:e,args:t,result:i}){if(e==="create_note"){const a=t.title??"",s=t.content??"",o=t.category??"general";return g.jsxs("div",{children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("span",{className:"text-amber-400/80 font-semibold text-sm",children:"note"}),g.jsxs("span",{className:"text-[#555] text-[13px]",children:["(",o,")"]})]}),a&&g.jsx("div",{className:"mt-1.5 text-[#999] text-[13px]",children:a}),s&&g.jsx("div",{className:"mt-1",children:g.jsx(Cs,{text:s})})]})}if(e==="delete_note")return g.jsx("span",{className:"text-amber-400/80 font-semibold text-sm",children:"note removed"});if(e==="update_note"){const a=t.title??"",s=t.content??"";return g.jsxs("div",{children:[g.jsx("span",{className:"text-amber-400/80 font-semibold text-sm",children:"note updated"}),a&&g.jsx("div",{className:"mt-1.5 text-[#999] text-[13px]",children:a}),s&&g.jsx("div",{className:"mt-1",children:g.jsx(Cs,{text:s})})]})}if(e==="get_note"){const a=i,s=a&&typeof a=="object"&&a.success?a.note:void 0;return g.jsxs("div",{children:[g.jsx("span",{className:"text-amber-400/80 font-semibold text-sm",children:"note read"}),s&&g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"mt-1.5 text-[#999] text-[13px]",children:[s.title??"(untitled)",g.jsxs("span",{className:"text-[#555] ml-1",children:["(",s.category??"general",")"]})]}),s.content&&g.jsx("div",{className:"mt-1",children:g.jsx(Cs,{text:s.content})})]})]})}if(e==="list_notes"){const a=i;let s=[];if(a&&typeof a=="object"&&a.success){const o=a.notes;s=Array.isArray(o)?o:[]}return g.jsxs("div",{children:[g.jsx("span",{className:"text-amber-400/80 font-semibold text-sm",children:"notes"}),s.length>0?g.jsx("div",{className:"mt-1.5 space-y-0.5",children:s.map((o,c)=>g.jsxs("div",{className:"text-[13px]",children:[g.jsx("span",{className:"text-[#555] mr-1",children:"-"}),g.jsx("span",{className:"text-[#999]",children:o.title??"(untitled)"}),g.jsxs("span",{className:"text-[#555] ml-1",children:["(",o.category??"general",")"]}),o.content&&g.jsx("div",{className:"ml-3",children:g.jsx(Cs,{text:o.content})})]},c))}):g.jsx("div",{className:"mt-1 text-[#555] text-xs",children:"No notes"})]})}return g.jsx("span",{className:"text-amber-400/80 font-semibold text-sm",children:"note"})}const lU={create_todo:{label:"Task added",Icon:yT},list_todos:{label:"Plan",Icon:p2},update_todo:{label:"Task updated",Icon:bT},mark_todo_done:{label:"Task completed",Icon:s_},mark_todo_pending:{label:"Task reopened",Icon:CT},delete_todo:{label:"Task removed",Icon:BT}};function oU({status:e}){return e==="done"?g.jsx(s_,{className:"w-3.5 h-3.5 text-emerald-400/70 shrink-0"}):e==="in_progress"?g.jsx(S2,{className:"w-3.5 h-3.5 text-purple-400/70 shrink-0 animate-pulse"}):g.jsx(T2,{className:"w-3.5 h-3.5 text-[#444] shrink-0"})}function cU({todos:e,highlightId:t}){return g.jsx("div",{className:"space-y-0",children:e.map((i,a)=>{const s=i.status??"pending",o=t&&i.id===t;return g.jsxs("div",{className:`flex items-start gap-2.5 py-1.5 px-2 -mx-2 rounded-md transition-colors ${o?"bg-purple-500/[0.08]":""}`,children:[g.jsx("div",{className:"mt-[1px]",children:g.jsx(oU,{status:s})}),g.jsx("span",{className:`text-[13px] leading-snug ${s==="done"?"text-[#555] line-through":s==="in_progress"?"text-[#bbb]":"text-[#999]"}`,children:i.title??"(untitled)"})]},i.id??a)})})}function uU({toolName:e,args:t,result:i}){const a=lU[e]??{label:"Plan",Icon:ST},s=a.Icon,o=i;if(typeof o=="string"&&o.trim())return g.jsxs("div",{children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx(s,{className:"w-3.5 h-3.5 text-purple-400/60"}),g.jsx("span",{className:"text-purple-400/80 font-semibold text-sm",children:a.label})]}),g.jsx("div",{className:"mt-1.5 text-[#888] text-[13px]",children:o.trim()})]});let c=[],d=null,h;if(o&&typeof o=="object"){if(d=o.error??null,o.success){const m=o.todos;c=Array.isArray(m)?m:[]}h=o.id??t.todo_id??void 0}const f=e!=="list_todos"?h:void 0;return c.length===0&&!d?g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx(s,{className:"w-3.5 h-3.5 text-purple-400/60"}),g.jsx("span",{className:"text-purple-400/80 font-semibold text-sm",children:a.label})]}):g.jsxs("div",{children:[g.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[g.jsx(s,{className:"w-3.5 h-3.5 text-purple-400/60"}),g.jsx("span",{className:"text-purple-400/80 font-semibold text-sm",children:a.label})]}),d&&g.jsx("div",{className:"text-red-400/70 text-[13px] mb-2",children:d}),c.length>0&&g.jsx("div",{className:"rounded-lg border border-white/[0.06] bg-white/[0.015] px-3 py-2",children:g.jsx(cU,{todos:c,highlightId:f})})]})}function Y1(e){if(e==null)return null;if(typeof e=="string")return e.trim()?e:null;if(typeof e=="object"){const t=e;if(typeof t.__raw=="string")return t.__raw;if(Object.keys(t).length===0)return null;try{return JSON.stringify(e,null,2)}catch{return String(e)}}return String(e)}function ON({toolName:e,args:t,result:i}){const a=Y1(t),s=Y1(i);return g.jsxs("div",{children:[g.jsx("span",{className:"text-[#888] font-semibold text-sm",children:e.replace(/_/g," ")}),a&&g.jsx(br,{className:"text-[#777]",children:a}),s&&g.jsx(br,{className:"text-[#666]",children:s})]})}function dU({args:e}){const i=(e.skills??"").split(",").map(a=>a.trim()).filter(Boolean);return g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("span",{className:"text-emerald-400/80 font-semibold text-sm",children:"Loading skill"}),i.length>0&&g.jsx("span",{className:"text-[#888] text-[13px]",children:i.join(", ")})]})}const Fu={terminal:{renderer:E9,icon:h_,color:"text-emerald-400"},python:{renderer:tU,icon:M2,color:"text-yellow-400"},browser:{renderer:S9,icon:np,color:"text-blue-400"},filesystem:{renderer:k9,icon:o_,color:"text-sky-400"},proxy:{renderer:G9,icon:Ds,color:"text-purple-400",match:/request|sitemap|scope/},reporting:{renderer:j9,icon:RT,color:"text-red-400"},thinking:{renderer:V9,icon:n_,color:"text-purple-400"},agents:{renderer:Y9,icon:ep,color:"text-cyan-400",match:/agent/},search:{renderer:X9,icon:f_,color:"text-amber-400"},lifecycle:{renderer:rU,icon:c_,color:"text-emerald-400"},notes:{renderer:sU,icon:zT,color:"text-amber-400",match:/note/},skills:{renderer:dU,icon:lu,color:"text-emerald-400"},todos:{renderer:uU,icon:rT,color:"text-purple-400",match:/todo/},telemetry:{renderer:ON,icon:lu,color:"text-[#555]"}},fU={terminal:["exec_command","write_stdin","terminal_execute"],python:["python_action"],browser:["browser_action"],filesystem:["apply_patch","view_image","str_replace_editor","list_files","search_files"],proxy:["list_requests","view_request","repeat_request","list_sitemap","view_sitemap_entry","scope_rules","send_request"],reporting:["create_vulnerability_report"],thinking:["think"],agents:["create_agent","agent_finish","send_message_to_agent","wait_for_message","view_agent_graph","stop_agent"],search:["web_search"],lifecycle:["scan_start_info","subagent_start_info","finish_scan"],notes:["create_note","delete_note","update_note","list_notes","get_note"],skills:["load_skill"],todos:["create_todo","list_todos","update_todo","mark_todo_done","mark_todo_pending","delete_todo"],telemetry:["sandbox_error_details","llm_error_details"]},hU=Object.fromEntries(Object.entries(fU).flatMap(([e,t])=>t.map(i=>[i,e]))),mU={finish_scan:aU,apply_patch:D9,view_image:L9},pU={agent_finish:{icon:c_,color:"text-cyan-400"},send_message_to_agent:{icon:Ux,color:"text-cyan-400"},wait_for_message:{icon:Ux,color:"text-cyan-400"},view_agent_graph:{icon:I2,color:"text-cyan-400"},stop_agent:{icon:t_,color:"text-red-400"},scan_start_info:{icon:D2,color:"text-emerald-400"},subagent_start_info:{icon:ep,color:"text-purple-400"},view_image:{icon:W2,color:"text-sky-400"}},gU=Fu.telemetry;function RN(e){var i;const t=hU[e];if(t)return t;for(const[a,s]of Object.entries(Fu))if((i=s.match)!=null&&i.test(e))return a;return null}function bU(e){const t=mU[e];if(t)return t;const i=RN(e);return i?Fu[i].renderer:ON}function xU(e){const t=pU[e];if(t)return t;const i=RN(e),a=i?Fu[i]:gU;return{icon:a.icon,color:a.color}}const yU=30;function vU({role:e,content:t}){const i=e==="user"||e==="human";return g.jsxs("div",{children:[g.jsx("span",{className:`font-semibold text-sm ${i?"text-blue-400/80":"text-purple-400/80"}`,children:i?"User":"Thinking"}),g.jsx("div",{className:"mt-1.5 italic text-[#888]",children:g.jsx(Ln,{text:t,maxLines:yU})})]})}class _U extends re.Component{constructor(t){super(t),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}render(){return this.state.hasError?g.jsx("span",{className:"text-[#555] font-semibold text-sm",children:this.props.toolName.replace(/_/g," ")}):this.props.children}}function wU(e){const t=bU(e.toolName);return g.jsx(_U,{toolName:e.toolName,children:g.jsx(t,{...e})})}function DN(e){if(e==null||typeof e!="string")return e;const t=e.trim();if(!t)return e;try{return JSON.parse(t)}catch{}try{const i=t.replace(/\bNone\b/g,"null").replace(/\bTrue\b/g,"true").replace(/\bFalse\b/g,"false").replace(/'/g,'"');return JSON.parse(i)}catch{return{__raw:e}}}function LN(e){const t=DN(e);return t&&typeof t=="object"&&!Array.isArray(t)?t:t==null?{}:{__raw:typeof t=="string"?t:JSON.stringify(t)}}function X1(e){const t=/(\d+)$/.exec(e);return t?parseInt(t[1],10):0}function zN(e){var i;const t=(i=e.data)==null?void 0:i.role;return e.type==="chat"&&(t==="user"||t==="human")}const EU={completed:"text-emerald-400 border-emerald-500/30 bg-emerald-500/10",running:"text-blue-400 border-blue-500/30 bg-blue-500/10",waiting:"text-yellow-400 border-yellow-500/30 bg-yellow-500/10",stopped:"text-[#aaa] border-[#333] bg-[#1a1a1a]",crashed:"text-red-400 border-red-500/30 bg-red-500/10",failed:"text-red-400 border-red-500/30 bg-red-500/10"};function NU(e){return e==="completed"?"completed":e==="running"?"running":e==="failed"||e==="crashed"?"failed":e}function SU(e,t){var d;const i=new Map;for(const h of e)if(h.parent_id){const f=i.get(h.parent_id)??[];f.push(h.id),i.set(h.parent_id,f)}const a=new Map,s=new Map,o=new Map;for(const h of t)if(h.type==="tool"){if(a.set(h.agent_id,(a.get(h.agent_id)??0)+1),((d=h.data)==null?void 0:d.tool_name)==="create_agent"){const f=LN(h.data.args),m=f.name??f.agent_name??"",p=f.task??"";m&&p&&o.set(m,p)}}else zN(h)||s.set(h.agent_id,(s.get(h.agent_id)??0)+1);const c=new Map;for(const h of e)c.set(h.id,{id:h.id,name:h.name,task:o.get(h.name)??"",status:NU(h.status),parentId:h.parent_id,children:i.get(h.id)??[],createdAt:h.created_at,toolCount:a.get(h.id)??0,messageCount:s.get(h.id)??0});return c}function kU({agent:e,events:t,showHeader:i=!0}){const a=re.useMemo(()=>t.filter(c=>c.agent_id===e.id&&!zN(c)).sort((c,d)=>X1(c.id)-X1(d.id)),[t,e.id]),s=a.filter(c=>c.type==="tool").length,o=a.length-s;return g.jsxs("div",{children:[i&&g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"flex items-center gap-2 flex-wrap mb-1",children:[g.jsx("span",{className:"text-base font-semibold text-white truncate",children:e.name}),g.jsx("span",{className:`flex-shrink-0 text-xs font-medium capitalize px-2 py-0.5 rounded-full border ${EU[e.status]??"text-[#aaa] border-[#333] bg-[#1a1a1a]"}`,children:e.status}),g.jsx("span",{className:"font-mono text-xs text-[#555]",children:e.id})]}),g.jsxs("p",{className:"text-xs text-[#666] mb-4",children:[o," message",o===1?"":"s"," · ",s," tool call",s===1?"":"s"]})]}),a.length===0?g.jsx("p",{className:"text-sm text-[#666]",children:"No recorded activity for this agent."}):g.jsx("div",{className:"py-1",children:a.map((c,d)=>{var N,S,w,k,E,O;const h=d===a.length-1,f=c.type==="tool",m=f?String(((N=c.data)==null?void 0:N.tool_name)??"tool"):"",p=f?"":String(((S=c.data)==null?void 0:S.role)??"assistant");let y,x;if(f){const B=xU(m);y=B.icon,x=B.color}else{const B=p==="user"||p==="human";y=B?ep:n_,x=B?"text-blue-400":"text-purple-400"}const _=f?String(((w=c.data)==null?void 0:w.status)??"completed"):"completed";return g.jsxs("div",{className:"flex gap-3",children:[g.jsxs("div",{className:"flex flex-col items-center shrink-0",children:[g.jsx("div",{className:`w-[30px] h-[30px] rounded-full bg-black border flex items-center justify-center shrink-0 ${f&&_==="running"?"border-blue-500/40 animate-pulse":f&&_==="failed"?"border-red-500/30":"border-[#222]"}`,children:g.jsx(y,{className:`w-3.5 h-3.5 ${x}`})}),!h&&g.jsx("div",{className:"w-px flex-1 bg-[#1a1a1a] mt-1"})]}),g.jsx("div",{className:"flex-1 min-w-0 pt-[5px] pb-6",children:f?g.jsx(wU,{toolName:m,args:LN((k=c.data)==null?void 0:k.args),result:DN((E=c.data)==null?void 0:E.result)??null,status:_}):g.jsx(vU,{role:p,content:String(((O=c.data)==null?void 0:O.content)??"")})})]},c.id)})})]})}const TU={completed:"bg-emerald-400",running:"bg-blue-400",waiting:"bg-yellow-400",stopped:"bg-[#888]",crashed:"bg-red-400",failed:"bg-red-400"},AU=80;function CU({agent:e,events:t,onClose:i}){const a=re.useRef(null),s=re.useRef(!1),o=re.useCallback(()=>{const c=a.current;c&&(s.current=c.scrollHeight-c.scrollTop-c.clientHeight{const c=a.current;!c||!s.current||requestAnimationFrame(()=>{c.scrollTo({top:c.scrollHeight,behavior:"smooth"})})},[t]),re.useEffect(()=>{const c=h=>{h.key==="Escape"&&i()};document.addEventListener("keydown",c);const d=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",c),document.body.style.overflow=d}},[i]),g.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/70 p-4 sm:p-8",onClick:i,role:"dialog","aria-modal":"true","aria-label":`Agent ${e.name}`,children:g.jsxs("div",{className:"relative flex h-[80vh] w-full max-w-5xl flex-col rounded-xl border border-[#222] bg-[#0a0a0a] shadow-2xl",onClick:c=>c.stopPropagation(),children:[g.jsxs("div",{className:"flex items-center justify-between gap-3 border-b border-[#222] px-5 py-3.5",children:[g.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[g.jsx("span",{className:`h-2 w-2 flex-shrink-0 rounded-full ${TU[e.status]??"bg-[#888]"}`}),g.jsx("span",{className:"truncate text-sm font-semibold text-white",children:e.name}),g.jsx("span",{className:"flex-shrink-0 font-mono text-xs text-[#555]",children:e.id})]}),g.jsx("button",{type:"button",onClick:i,"aria-label":"Close",className:"flex-shrink-0 rounded-md p-1 text-[#888] transition-colors hover:bg-[#1a1a1a] hover:text-white",children:g.jsx(g_,{className:"h-4 w-4"})})]}),g.jsx("div",{ref:a,onScroll:o,className:"flex-1 overflow-y-auto p-5",children:g.jsx(kU,{agent:e,events:t,showHeader:!1})}),g.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 border-t border-[#222] px-5 py-3",children:[g.jsx("span",{className:"text-xs text-[#888]",children:"Steer agents live from your terminal."}),g.jsx("a",{href:Fs,target:"_blank",rel:"noopener noreferrer",onClick:()=>gi("steer_agent"),className:"text-xs font-medium text-[#60a5fa] hover:underline",children:"Upgrade to Pro to steer agents from the web →"})]})]})})}class Su extends Error{constructor(t){super(t),this.name="RunParseError"}}const MU=["critical","high","medium","low"];function OU(e){const t=String(e??"").toLowerCase().trim();return MU.includes(t)?t:"low"}function RU(e){if(typeof e=="string"&&e.trim()){const t=e.trim().replace(" UTC","Z").replace(" ","T"),i=new Date(t);if(!Number.isNaN(i.getTime()))return i.toISOString();const a=new Date(e);if(!Number.isNaN(a.getTime()))return a.toISOString()}return new Date().toISOString()}function Ot(e){return typeof e=="string"&&e.length>0?e:null}function DU(e){return typeof e=="number"&&Number.isFinite(e)?e:null}function jN(e,t){try{return JSON.parse(e)}catch{throw new Su(`${t} isn't valid JSON. Make sure you selected a Strix run directory.`)}}function LU(e){const t=jN(e,"run.json");if(!t||typeof t!="object"||Array.isArray(t))throw new Su("run.json is not an object.");const i=t,a=[],s=i.targets_info;if(Array.isArray(s)){for(const x of s)if(x&&typeof x=="object"){const _=x.original;typeof _=="string"&&_&&a.push(_)}}const o=Ot(i.start_time),c=Ot(i.end_time);let d=null;if(o&&c){const x=new Date(o).getTime(),_=new Date(c).getTime();!Number.isNaN(x)&&!Number.isNaN(_)&&_>=x&&(d=Math.round((_-x)/1e3))}let h=null,f=null,m=null,p=null;const y=i.scan_results;if(y&&typeof y=="object"){const x=y;h=Ot(x.executive_summary),f=Ot(x.technical_analysis),m=Ot(x.methodology),p=Ot(x.recommendations)}return{runId:Ot(i.run_id),runName:Ot(i.run_name),targets:a,scanMode:Ot(i.scan_mode),status:Ot(i.status),startTime:o,endTime:c,durationSeconds:d,executiveSummary:h,technicalAnalysis:f,methodology:m,recommendations:p}}function zU(){return{pr_review_id:null,cve:null,cvss:null,potential_risk_saving:null,risk_saving_description:null,impact:null,endpoint:null,method:null,target:null,technical_analysis:null,poc_description:null,poc_script_code:null,code_diff:null,code_file:null,code_before:null,code_after:null,cwe:null,code_locations:null,remediation_steps:null,fix_pr_body:null,evidence:null,assumptions:null,fix_effort:null,cvss_breakdown:null,status_changed_at:null,status_changed_by:null,status_note:null,snoozed_until:null,reopened_at:null,reopened_by:null,original_severity:null,severity_changed_at:null,severity_changed_by:null,severity_override_reason:null,retest_of_vulnerability_id:null}}function jU(e,t,i){const a=e.cwe,s=typeof a=="string"&&a.trim()?[a.trim()]:Array.isArray(a)?a.filter(c=>typeof c=="string"&&c):null;return{...zU(),id:Ot(e.id)??`vuln-${t+1}`,scan_id:i,title:Ot(e.title)??"Untitled finding",description:Ot(e.description)??"",severity:OU(e.severity),status:"open",created_at:RU(e.timestamp),cve:Ot(e.cve),cvss:DU(e.cvss),impact:Ot(e.impact),endpoint:Ot(e.endpoint),method:Ot(e.method),target:Ot(e.target),technical_analysis:Ot(e.technical_analysis),poc_description:Ot(e.poc_description),poc_script_code:Ot(e.poc_script_code),cwe:s,code_locations:Array.isArray(e.code_locations)?e.code_locations:null,remediation_steps:Ot(e.remediation_steps),fix_pr_body:Ot(e.fix_pr_body),evidence:Ot(e.evidence),assumptions:Ot(e.assumptions),fix_effort:Ot(e.fix_effort)??null,cvss_breakdown:e.cvss_breakdown??null}}function IU(e,t=null){const i=jN(e,"vulnerabilities.json");if(!Array.isArray(i))throw new Su("vulnerabilities.json is not a JSON array.");return i.map((a,s)=>{if(!a||typeof a!="object")throw new Su(`vulnerabilities.json entry #${s+1} is not an object.`);return jU(a,s,t)})}function BU(e){const t={critical:0,high:0,medium:0,low:0};for(const i of e)t[i.severity]+=1;return t}async function Ys(e){const t=await fetch(e,{cache:"no-store"});if(!t.ok)throw new Error(`${e} responded ${t.status}`);return t.json()}function Gu(e){return e?`?run=${encodeURIComponent(e)}`:""}async function IN(e){const t=await Ys("/api/run"+Gu(e)),i=LU(JSON.stringify(t)),a=t.finished===!0;return{summary:i,raw:t,finished:a}}async function BN(e,t){const i=await Ys("/api/vulnerabilities"+Gu(t));return IU(JSON.stringify(i),e)}async function UU(e){const t=await Ys("/api/report"+Gu(e));return(t==null?void 0:t.markdown)??null}async function UN(e){const t=await Ys("/api/transcript"+Gu(e));return{agents:Array.isArray(t==null?void 0:t.agents)?t.agents:[],events:Array.isArray(t==null?void 0:t.events)?t.events:[]}}async function K1(e){const{summary:t,raw:i,finished:a}=await IN(e),[s,o,c]=await Promise.all([BN(t.runId,e).catch(()=>[]),UU(e).catch(()=>null),UN(e).catch(()=>({agents:[],events:[]}))]);return{summary:t,raw:i,finished:a,vulnerabilities:s,reportMarkdown:o,transcript:c}}async function Vu(e,t){const i=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t),cache:"no-store"});let a={};try{const s=await i.json();s&&typeof s=="object"&&(a=s)}catch{}return{ok:i.ok,status:i.status,data:a}}async function HU(){const e=await Ys("/api/runs");return{locked:(e==null?void 0:e.locked)??!0,count:typeof(e==null?void 0:e.count)=="number"?e.count:0,runs:Array.isArray(e==null?void 0:e.runs)?e.runs:[]}}async function $U(){const e=await Ys("/api/auth/status");return{verified:(e==null?void 0:e.verified)===!0,email:(e==null?void 0:e.email)??null}}async function qU(e){const{ok:t,data:i}=await Vu("/api/auth/otp/start",{email:e});return t&&i.ok===!0?{ok:!0}:{ok:!1,error:String(i.error??"unavailable")}}async function PU(e,t){const{ok:i,data:a}=await Vu("/api/auth/otp/verify",{email:e,code:t});return i&&a.verified===!0?{verified:!0,email:String(a.email??e)}:{verified:!1,error:String(a.error??"invalid_code")}}async function FU(){await Vu("/api/auth/forget",{})}async function GU(e){const{ok:t,data:i}=await Vu("/api/report/send",e?{run:e}:{});return t&&i.ok===!0?{ok:!0,password:String(i.password??""),filename:String(i.filename??"strix-report.pdf")}:{ok:!1,error:String(i.error??"unavailable")}}const VU=[{slug:"pr_reviews",title:"PR Reviews",icon:tp,tier:"Pro",navDesc:"Pentest every pull request",headline:"Pentest every pull request",description:"Strix reviews every pull request your team opens and catches exploitable changes before they merge."},{slug:"repositories",title:"Repositories",icon:eT,tier:"Pro",navDesc:"Connect your team's repos",headline:"Connect your team's repositories",description:"Link your org's repositories so Strix can scan them continuously and track findings over time."},{slug:"domains",title:"Domains",icon:np,tier:"Pro",navDesc:"Cover the domains you own",headline:"Cover every domain you own",description:"Add the domains your team owns and let Strix watch them for newly exposed paths and drift."},{slug:"integrations",title:"Integrations",icon:u_,tier:"Pro",navDesc:"Sync to Jira, Linear, Slack",headline:"Sync findings to your tools",description:"Two-way sync findings to Jira, Linear, and Slack so fixes happen where your team already works."},{slug:"members",title:"Members",icon:m_,tier:"Pro",navDesc:"Invite your team, set roles",headline:"Bring your whole team",description:"Invite your team, set roles, and share findings and run history across your org."},{slug:"pentests",title:"Pentests",icon:f_,tier:"Pro",navDesc:"Deeper scans on managed infra",headline:"Launch deeper pentests",description:"Run deeper, longer pentests on managed infrastructure whenever you need them."},{slug:"dashboard",title:"Dashboard",icon:nT,tier:"Pro",navDesc:"Everything in one place",headline:"See everything in one place",description:"Track every project, run, and finding across your org from a single dashboard."},{slug:"platform_issues",title:"Issues",icon:HT,tier:"Pro",navDesc:"Triage across your org",headline:"Triage findings across your org",description:"Manage and triage findings across every project and repository in one queue."},{slug:"chat",title:"Chat",icon:hT,tier:"Pro",navDesc:"Ask about any finding",headline:"Ask Strix anything",description:"Ask the agents about any finding, run, or part of your app in natural language."},{slug:"networks",title:"Networks",icon:pT,tier:"Enterprise",navDesc:"Reach internal, VPN-only targets",headline:"Scan internal networks",description:"Connect private networks to scan internal applications, VPN-only services, and RFC1918 targets."},{slug:"knowledge",title:"Knowledge",icon:z2,tier:"Pro",navDesc:"Give agents context",headline:"Give agents context",description:"Teach Strix about your systems and business logic so every run gets smarter."}],Jm=Object.fromEntries(VU.map(e=>[e.slug,e])),YU=["pr_reviews","repositories","domains","integrations","members","pentests","networks","chat","dashboard","platform_issues","knowledge"];function XU({view:e,onSelectView:t,activeFeature:i,onSelectFeature:a,issuesCount:s,agentCount:o,runCount:c,verified:d,email:h,onOpenEmail:f,onOpenHistory:m,onForget:p}){return g.jsx("aside",{className:"hidden w-72 flex-shrink-0 border-r border-[#222] lg:block",children:g.jsxs("div",{className:"sticky top-0 flex h-screen flex-col overflow-y-auto px-3 py-4",children:[g.jsxs("div",{className:"px-1.5",children:[g.jsxs("a",{href:"https://app.strix.ai",target:"_blank",rel:"noopener noreferrer",onClick:()=>gi("logo"),className:"flex items-center gap-1.5 opacity-90 transition-opacity hover:opacity-100",title:"Open Strix Cloud",children:[g.jsx("img",{src:"./logo.png",alt:"Strix",className:"h-8 w-10 object-cover"}),g.jsx("span",{className:"text-base font-medium tracking-tight text-white",children:"Strix"})]}),g.jsxs("a",{href:Fs,target:"_blank",rel:"noopener noreferrer",onClick:()=>gi("sidebar_start_free"),className:"mt-3 flex w-full cursor-pointer items-center justify-center gap-1.5 rounded-lg bg-white px-3 py-2 text-sm font-semibold text-black transition-opacity hover:opacity-90",children:["Start free",g.jsx(Ds,{className:"h-3.5 w-3.5","aria-hidden":"true"})]}),d&&h&&g.jsxs("div",{className:"mt-2.5 flex items-center gap-2 rounded-lg px-2.5 py-2",style:{border:"1px solid #222",background:"rgba(255,255,255,0.02)"},children:[g.jsx(rp,{className:"h-3.5 w-3.5 flex-shrink-0 text-emerald-400","aria-hidden":"true"}),g.jsxs("div",{className:"min-w-0 flex-1",children:[g.jsx("p",{className:"truncate text-[11px] text-[#666]",children:"Signed in as"}),g.jsx("p",{className:"truncate text-xs text-[#aaa]",title:h,children:h})]}),g.jsx("button",{onClick:p,title:"Forget this email on this machine",className:"flex-shrink-0 cursor-pointer text-[#666] transition-colors hover:text-white","aria-label":"Forget",children:g.jsx(cT,{className:"h-3.5 w-3.5"})})]})]}),g.jsxs("div",{className:"mt-6 space-y-0.5",children:[g.jsx(Yl,{icon:o_,label:"Overview",desc:"This run's executive report",active:e==="overview",onClick:()=>t("overview")}),g.jsx(Yl,{icon:f2,label:"Issues",desc:"Findings from this run",count:s>0?s:void 0,active:e==="issues",onClick:()=>t("issues")}),o>0&&g.jsx(Yl,{icon:p_,label:"Agents",desc:"What each agent did",count:o,active:e==="agents",onClick:()=>t("agents")}),g.jsx(Yl,{icon:zs,label:"Past runs",desc:"Every run on this machine",count:c>0?c:void 0,active:e==="history",onClick:m}),g.jsx(Yl,{icon:ip,label:"Email report",desc:"Get an encrypted PDF by email",onClick:f}),YU.map(y=>{const x=Jm[y];return x?g.jsx(JT,{feature:x,active:e==="feature"&&i===y,onClick:()=>a(y)},y):null})]})]})})}function Yl({icon:e,label:t,desc:i,count:a,active:s,onClick:o}){return g.jsxs("button",{onClick:o,className:`flex w-full cursor-pointer items-start gap-2.5 rounded-md px-2.5 py-1.5 text-left transition-colors ${s?"text-white":"text-[#888] hover:bg-[rgba(255,255,255,0.06)] hover:text-white"}`,style:s?{background:"rgba(255,255,255,0.12)"}:void 0,children:[g.jsx(e,{className:"mt-0.5 h-4 w-4 flex-shrink-0","aria-hidden":"true"}),g.jsxs("span",{className:"min-w-0 flex-1",children:[g.jsxs("span",{className:"flex items-center gap-1.5",children:[g.jsx("span",{className:"flex-1 truncate text-sm",children:t}),a!=null&&g.jsx("span",{className:"text-xs text-[#666] tabular-nums",children:a})]}),g.jsx("span",{className:"mt-0.5 block text-[11px] leading-snug text-[#666]",children:i})]})]})}const KU=[{key:"critical",dot:"bg-red-500",text:"text-red-500"},{key:"high",dot:"bg-orange-500",text:"text-orange-500"},{key:"medium",dot:"bg-yellow-500",text:"text-yellow-500"},{key:"low",dot:"bg-blue-500",text:"text-blue-500"}];function ZU({counts:e}){const t=KU.filter(i=>e[i.key]>0);return t.length===0?g.jsx("span",{className:"text-xs text-[#555]",children:"No findings"}):g.jsx("div",{className:"flex items-center gap-3",children:t.map(i=>g.jsxs("div",{className:"flex items-center gap-1.5",children:[g.jsx("span",{className:`h-2 w-2 rounded-full ${i.dot}`,"aria-hidden":"true"}),g.jsx("span",{className:`text-xs tabular-nums ${i.text}`,children:e[i.key]})]},i.key))})}function Z1(e){if(!e)return null;const t=e.trim().replace(" UTC","Z").replace(" ","T"),i=new Date(t);return Number.isNaN(i.getTime())?null:i.toLocaleString(void 0,{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}function QU({runs:e,activeRun:t,onSelectRun:i,onVerifyClick:a}){const s=(e==null?void 0:e.count)??0;return!e||e.locked?g.jsxs("div",{className:"rounded-xl border border-[#222] bg-[rgba(255,255,255,0.02)] p-8 text-center",children:[g.jsx("div",{className:"mx-auto mb-4 flex h-11 w-11 items-center justify-center rounded-xl",style:{border:"1px solid #2a2a2a",background:"rgba(255,255,255,0.04)"},children:g.jsx(zs,{className:"h-5 w-5 text-[#888]","aria-hidden":"true"})}),g.jsx("h2",{className:"text-base font-semibold text-white",children:"Browse every run on this machine"}),g.jsxs("p",{className:"mx-auto mt-1.5 max-w-md text-sm text-[#888]",children:["You have ",s," past ",s===1?"run":"runs"," on this machine."]}),g.jsx("button",{onClick:a,className:"mt-4 cursor-pointer rounded-lg bg-white px-4 py-2 text-sm font-semibold text-black transition-opacity hover:opacity-90",children:"View runs"}),g.jsxs("p",{className:"mt-4 flex items-center justify-center gap-1.5 text-xs text-[#555]",children:[g.jsx(h_,{className:"h-3.5 w-3.5","aria-hidden":"true"}),"Or open one from the CLI with"," ",g.jsx("code",{className:"font-mono text-[#888]",children:"strix view "})]})]}):e.runs.length===0?g.jsx("div",{className:"rounded-xl border border-[#222] bg-[rgba(255,255,255,0.02)] p-8 text-center text-sm text-[#888]",children:"No past runs found on this machine yet."}):g.jsx("div",{className:"space-y-2",children:e.runs.map(o=>{const c=o.name===t,d=Z1(o.start_time)??Z1(o.end_time);return g.jsxs("button",{onClick:()=>i(o.name),className:`group flex w-full cursor-pointer items-center gap-4 rounded-lg border px-4 py-3 text-left transition-colors ${c?"border-[#444] bg-[rgba(255,255,255,0.04)]":"border-[#222] bg-[rgba(255,255,255,0.02)] hover:border-[#444]"}`,children:[g.jsxs("div",{className:"min-w-0 flex-1",children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("span",{className:"truncate text-sm font-medium text-white",children:o.name}),c&&g.jsx("span",{className:"rounded-full px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-wide text-emerald-400",style:{border:"1px solid rgba(16,185,129,0.3)"},children:"Active"})]}),g.jsxs("div",{className:"mt-0.5 flex flex-wrap items-center gap-x-2 gap-y-0.5 text-xs text-[#666]",children:[o.target&&g.jsx("span",{className:"truncate font-mono text-[#888]",children:o.target}),o.target&&(o.scan_mode||d||o.status)&&g.jsx("span",{className:"text-[#333]",children:"·"}),o.scan_mode&&g.jsx("span",{className:"capitalize",children:o.scan_mode}),d&&g.jsx("span",{className:"text-[#333]",children:"·"}),d&&g.jsx("span",{children:d}),o.status&&g.jsx("span",{className:"text-[#333]",children:"·"}),o.status&&g.jsx("span",{className:"capitalize",children:o.status})]})]}),g.jsx(ZU,{counts:o.severity_counts}),g.jsx(y2,{className:"h-4 w-4 flex-shrink-0 text-[#555] transition-colors group-hover:text-[#aaa]","aria-hidden":"true"})]},o.name)})})}const Q1={rate_limited:"Too many requests. Wait a minute and try again.",invalid_email:"That email does not look right. Check it and try again.",work_email_required:"Please use your work email, not a personal one.",unavailable:"The email service is unavailable right now. Try again shortly."},WU=new Set(["gmail.com","googlemail.com","yahoo.com","ymail.com","outlook.com","hotmail.com","live.com","icloud.com","me.com","aol.com","proton.me","protonmail.com","gmx.com","mail.com"]);function JU(e){var i;const t=(i=e.split("@")[1])==null?void 0:i.trim().toLowerCase();return t!=null&&WU.has(t)}const eH={forbidden:"This email was unsubscribed from Strix, so we cannot send to it.",too_large:"This report is too large to email. Try a smaller run.",unavailable:"The email service is unavailable right now. Try again shortly."};function tH({open:e,onClose:t,activeRun:i,auth:a,purpose:s,onVerified:o}){const c=(a==null?void 0:a.verified)===!0,[d,h]=re.useState("disclosure"),[f,m]=re.useState(""),[p,y]=re.useState(""),[x,_]=re.useState(!1),[N,S]=re.useState(null),[w,k]=re.useState(null),[E,O]=re.useState(""),[B,R]=re.useState(""),[U,I]=re.useState(!1),K=re.useRef("");if(re.useEffect(()=>{e&&(h(s==="verify"?"email":"disclosure"),y(""),_(!1),S(null),k(null),O(""),R(""),I(!1),m((a==null?void 0:a.email)??""))},[e,a==null?void 0:a.email,s]),re.useEffect(()=>{if(!e)return;const A=j=>{j.key==="Escape"&&d!=="password"&&t()};return window.addEventListener("keydown",A),()=>window.removeEventListener("keydown",A)},[e,d,t]),!e)return null;const z=async()=>{h("sending"),S(null);const A=await GU(i);if(A.ok){O(A.password),R(A.filename),h("password");return}if(A.error==="reverify"||A.error==="unverified"){k("Your verification expired. Enter your email to verify again."),h("email");return}S(eH[A.error]??"Could not send the report. Try again."),h("disclosure")},q=()=>{S(null),k(null),c?z():h("email")},X=async()=>{const A=f.trim();if(!A){S("Enter your email to continue.");return}if(JU(A)){S(Q1.work_email_required);return}_(!0),S(null);const j=await qU(A);_(!1),j.ok?(k(`We sent a 6-digit code to ${A}.`),h("code")):S(Q1[j.error]??"Could not send a code. Try again.")},Y=async()=>{const A=p.trim();if(A.length<4){S("Enter the 6-digit code from your email.");return}_(!0),S(null);const j=await PU(f.trim(),A);if(_(!1),j.verified){if(K.current=j.email,o(),s==="verify"){t();return}z()}else S("That code did not match. Check it and try again.")},C=async()=>{try{await navigator.clipboard.writeText(E),I(!0),setTimeout(()=>I(!1),1500)}catch{}},$=K.current||(a==null?void 0:a.email)||f.trim();return g.jsxs("div",{className:"fixed inset-0 z-[100] flex items-center justify-center p-4",role:"dialog","aria-modal":"true","aria-label":"Email an encrypted report",children:[g.jsx("div",{className:"absolute inset-0 bg-black/70",onClick:()=>d!=="password"&&t()}),g.jsxs("div",{className:"relative z-10 w-full max-w-md rounded-2xl bg-[#0a0a0a] p-6 shadow-2xl",style:{border:"1px solid #2a2a2a"},children:[g.jsx("button",{onClick:t,className:"absolute right-4 top-4 cursor-pointer text-[#666] transition-colors hover:text-white","aria-label":"Close",children:g.jsx(g_,{className:"h-5 w-5"})}),g.jsxs("div",{className:"mb-4 flex items-center gap-2.5",children:[g.jsx("div",{className:"flex h-9 w-9 items-center justify-center rounded-lg",style:{border:"1px solid #2a2a2a",background:"rgba(255,255,255,0.04)"},children:g.jsx(ip,{className:"h-4 w-4 text-emerald-400","aria-hidden":"true"})}),g.jsxs("div",{children:[g.jsx("h2",{className:"text-base font-semibold text-white",children:s==="verify"?"Verify your email to view your runs":"Email an encrypted PDF report of this run"}),g.jsx("p",{className:"text-xs text-[#666]",children:s==="verify"?"We send a one-time code to confirm it is you.":"Verified by a one-time code sent to your email"})]})]}),N&&g.jsxs("div",{className:"mb-4 flex items-start gap-2 rounded-lg border border-red-500/30 bg-red-500/5 px-3 py-2",children:[g.jsx(a_,{className:"mt-0.5 h-4 w-4 flex-shrink-0 text-red-400","aria-hidden":"true"}),g.jsx("p",{className:"text-xs text-red-300",children:N})]}),w&&!N&&d!=="password"&&g.jsx("p",{className:"mb-4 text-xs text-[#888]",children:w}),d==="disclosure"&&g.jsxs("div",{className:"space-y-4",children:[g.jsxs("div",{className:"space-y-2.5 rounded-lg p-3.5",style:{border:"1px solid #222",background:"rgba(255,255,255,0.02)"},children:[g.jsxs("div",{className:"flex items-start gap-2.5",children:[g.jsx(rp,{className:"mt-0.5 h-4 w-4 flex-shrink-0 text-emerald-400","aria-hidden":"true"}),g.jsxs("p",{className:"text-xs leading-relaxed text-[#aaa]",children:["Viewing stays local and nothing is uploaded. Emailing is an explicit opt-in: we send an ",g.jsx("span",{className:"text-white",children:"encrypted PDF"}),"."]})]}),g.jsxs("div",{className:"flex items-start gap-2.5",children:[g.jsx(lT,{className:"mt-0.5 h-4 w-4 flex-shrink-0 text-[#888]","aria-hidden":"true"}),g.jsx("p",{className:"text-xs leading-relaxed text-[#aaa]",children:"The report is encrypted with a password that only you hold. Strix cannot read it and never stores it. We collect only your email so we can send it."})]})]}),g.jsx("button",{onClick:q,className:"w-full cursor-pointer rounded-lg bg-white px-4 py-2.5 text-sm font-semibold text-black transition-opacity hover:opacity-90",children:c?"Email me the encrypted PDF":"Continue with your email"}),c&&(a==null?void 0:a.email)&&g.jsxs("p",{className:"text-center text-xs text-[#666]",children:["Sending to ",a.email]})]}),d==="email"&&g.jsxs("form",{className:"space-y-4",onSubmit:A=>{A.preventDefault(),X()},children:[g.jsxs("label",{className:"block",children:[g.jsx("span",{className:"mb-1.5 block text-xs text-[#888]",children:"Your email"}),g.jsx("input",{type:"email",autoFocus:!0,value:f,onChange:A=>m(A.target.value),placeholder:"you@company.com",className:"w-full rounded-lg bg-black px-3 py-2.5 text-sm text-white outline-none transition-colors focus:border-[#444]",style:{border:"1px solid #2a2a2a"}}),g.jsx("span",{className:"mt-1.5 block text-xs text-[#666]",children:"Use your work email."})]}),g.jsxs("button",{type:"submit",disabled:x,className:"flex w-full cursor-pointer items-center justify-center gap-2 rounded-lg bg-white px-4 py-2.5 text-sm font-semibold text-black transition-opacity hover:opacity-90 disabled:opacity-60",children:[x&&g.jsx(eh,{className:"h-4 w-4 animate-spin","aria-hidden":"true"}),"Send me a code"]})]}),d==="code"&&g.jsxs("form",{className:"space-y-4",onSubmit:A=>{A.preventDefault(),Y()},children:[g.jsxs("label",{className:"block",children:[g.jsx("span",{className:"mb-1.5 block text-xs text-[#888]",children:"6-digit code"}),g.jsx("input",{inputMode:"numeric",autoFocus:!0,value:p,onChange:A=>y(A.target.value.replace(/\D/g,"").slice(0,6)),placeholder:"123456",className:"w-full rounded-lg bg-black px-3 py-2.5 text-center text-lg font-mono tracking-[0.4em] text-white outline-none transition-colors focus:border-[#444]",style:{border:"1px solid #2a2a2a"}})]}),g.jsxs("button",{type:"submit",disabled:x,className:"flex w-full cursor-pointer items-center justify-center gap-2 rounded-lg bg-white px-4 py-2.5 text-sm font-semibold text-black transition-opacity hover:opacity-90 disabled:opacity-60",children:[x&&g.jsx(eh,{className:"h-4 w-4 animate-spin","aria-hidden":"true"}),s==="verify"?"Verify":"Verify and send"]}),g.jsx("button",{type:"button",onClick:()=>{h("email"),S(null),k(null)},className:"w-full cursor-pointer text-center text-xs text-[#666] transition-colors hover:text-[#aaa]",children:"Use a different email"})]}),d==="sending"&&g.jsxs("div",{className:"flex flex-col items-center gap-3 py-8",children:[g.jsx(eh,{className:"h-6 w-6 animate-spin text-white","aria-hidden":"true"}),g.jsx("p",{className:"text-sm text-[#aaa]",children:"Generating and encrypting locally..."})]}),d==="password"&&g.jsxs("div",{className:"space-y-4",children:[g.jsxs("div",{className:"flex items-start gap-2.5 rounded-lg border border-emerald-500/30 bg-emerald-500/5 px-3 py-2.5",children:[g.jsx(Ls,{className:"mt-0.5 h-4 w-4 flex-shrink-0 text-emerald-400","aria-hidden":"true"}),g.jsxs("p",{className:"text-xs text-emerald-200",children:["Sent to ",$,". Open the attached PDF with this password."]})]}),g.jsxs("div",{children:[g.jsx("span",{className:"mb-1.5 block text-xs text-[#888]",children:"Your one-time password"}),g.jsxs("div",{className:"flex items-center gap-2 rounded-lg bg-black p-3",style:{border:"1px solid #2a2a2a"},children:[g.jsx("code",{className:"flex-1 break-all font-mono text-base text-white",children:E}),g.jsxs("button",{onClick:C,className:"flex cursor-pointer items-center gap-1 rounded-md px-2 py-1 text-xs text-[#aaa] transition-colors hover:bg-[rgba(255,255,255,0.06)] hover:text-white",style:{border:"1px solid #2a2a2a"},children:[U?g.jsx(Ls,{className:"h-3.5 w-3.5"}):g.jsx(to,{className:"h-3.5 w-3.5"}),U?"Copied":"Copy"]})]}),g.jsxs("p",{className:"mt-2 text-xs text-[#666]",children:["Save this now. Strix never stores it, so we cannot show it again. File:"," ",g.jsx("span",{className:"font-mono text-[#888]",children:B})]})]}),g.jsx("button",{onClick:t,className:"w-full cursor-pointer rounded-lg px-4 py-2.5 text-sm font-semibold text-white transition-colors hover:bg-[rgba(255,255,255,0.06)]",style:{border:"1px solid #2a2a2a"},children:"Done"})]})]})]})}const nH=[{icon:i_,text:"Continuous coverage: scheduled pentests and attack surface monitoring"},{icon:PT,text:"One-click autofix that opens a retested pull request"},{icon:u_,text:"Two-way sync to Jira, Linear, and Slack"},{icon:m_,text:"Your whole team, with roles and shared history"}];function iH({feature:e}){const t=e.icon;return g.jsx("div",{className:"mx-auto w-full max-w-lg",children:g.jsxs("div",{className:"rounded-2xl border border-[#222] bg-[rgba(255,255,255,0.02)] p-8 text-center",children:[g.jsx("div",{className:"mx-auto flex h-12 w-12 items-center justify-center rounded-xl",style:{border:"1px solid #2a2a2a",background:"rgba(255,255,255,0.04)"},children:g.jsx(t,{className:"h-5 w-5 text-[#888]","aria-hidden":"true"})}),g.jsx("div",{className:"mt-4 flex justify-center",children:g.jsx(ku,{label:e.tier})}),g.jsx("h2",{className:"mt-3 text-2xl font-semibold text-white",children:e.headline}),g.jsx("p",{className:"mx-auto mt-2 max-w-md text-sm text-[#888]",children:e.description}),g.jsxs("div",{className:"mt-6 rounded-xl p-4 text-left",style:{border:"1px solid #222",background:"rgba(255,255,255,0.02)"},children:[g.jsx("p",{className:"mb-3 text-xs font-semibold uppercase tracking-wide text-[#666]",children:"Included in Strix Pro"}),g.jsx("ul",{className:"space-y-2.5",children:nH.map(i=>{const a=i.icon;return g.jsxs("li",{className:"flex items-start gap-2.5",children:[g.jsx(a,{className:"mt-0.5 h-4 w-4 flex-shrink-0 text-[#888]","aria-hidden":"true"}),g.jsx("span",{className:"text-sm text-[#aaa]",children:i.text})]},i.text)})})]}),g.jsxs("div",{className:"mt-6 flex flex-col items-center gap-3",children:[g.jsxs("a",{href:Fs,target:"_blank",rel:"noopener noreferrer",onClick:()=>gi(e.slug),className:"inline-flex w-full items-center justify-center gap-1.5 rounded-lg bg-white px-4 py-2.5 text-sm font-semibold text-black transition-opacity hover:opacity-90",children:["Start free",g.jsx(Ds,{className:"h-3.5 w-3.5","aria-hidden":"true"})]}),g.jsxs("a",{href:QT,target:"_blank",rel:"noopener noreferrer",onClick:()=>gi(`${e.slug}_pricing`),className:"inline-flex items-center gap-1 text-xs text-[#888] transition-colors hover:text-white",children:["View all plans",g.jsx(Ds,{className:"h-3 w-3","aria-hidden":"true"})]})]})]})})}const rH="Your findings stay on your machine. They're rendered here locally in your browser and never uploaded or stored by Strix. Emailing a report is an explicit opt-in that sends an encrypted copy only you can open.",W1=["critical","high","medium","low"],aH=500,sH=[{title:"One-click autofix + open a fix PR",desc:"Fix it for you and open a PR, retested.",slug:"autofix",icon:lu},{title:"Export SOC 2 / ISO 27001 report",desc:"Share an auditor-ready report with your team.",slug:"compliance",icon:U2}],lH=[{title:"Scheduled pentesting",desc:"Continuous coverage for your whole org.",slug:"scheduled",icon:i_},{title:"Attack surface monitoring",desc:"Continuous coverage for your whole org.",slug:"asm",icon:d_},{title:"PR reviews",desc:"Pentest every pull request your team opens.",slug:"pr_reviews",icon:tp}];function oH(){const[e,t]=re.useState(null),[i,a]=re.useState(null),[s,o]=re.useState(null),[c,d]=re.useState(null),[h,f]=re.useState("overview"),[m,p]=re.useState(null),[y,x]=re.useState(null),[_,N]=re.useState(null),[S,w]=re.useState(!1),[k,E]=re.useState("report"),O=re.useCallback(async()=>{try{x(await $U())}catch{}},[]),B=re.useCallback(async()=>{try{N(await HU())}catch{}},[]);re.useEffect(()=>{O(),B()},[O,B]);const R=re.useRef(!1);re.useEffect(()=>{let j=!1,V;R.current=!1;const Q=()=>{V=setTimeout(M,aH)},M=async()=>{if(!j)try{const{summary:D,raw:G,finished:L}=await IN(e);if(j)return;if(L&&!R.current){R.current=!0;const Z=await K1(e);j||a(Z);return}const[F,H]=await Promise.all([UN(e).catch(()=>({agents:[],events:[]})),BN(D.runId,e).catch(()=>[])]);if(j)return;a(Z=>({summary:D,raw:G,finished:L,transcript:F,vulnerabilities:H,reportMarkdown:(Z==null?void 0:Z.reportMarkdown)??null})),Q()}catch(D){if(j)return;o(D instanceof Error?D.message:"Could not load run data."),Q()}};return(async()=>{try{const D=await K1(e);if(j)return;a(D),D.finished?R.current=!0:Q()}catch(D){if(j)return;o(D instanceof Error?D.message:"Could not load run data."),Q()}})(),()=>{j=!0,V&&clearTimeout(V)}},[e]);const U=re.useMemo(()=>i?BU(i.vulnerabilities):null,[i]),I=(i==null?void 0:i.vulnerabilities.find(j=>j.id===c))??null,K=(i==null?void 0:i.transcript.agents.length)??0,z=(y==null?void 0:y.verified)===!0,q=re.useCallback(j=>{t(j),d(null),a(null),o(null),f("overview")},[]),X=re.useCallback(()=>{gi("email_report"),E("report"),w(!0)},[]),Y=re.useCallback(()=>{gi("history_unlock"),E("verify"),w(!0)},[]),C=re.useCallback(()=>{B(),f("history")},[B]),$=re.useCallback(j=>{gi(`nav_${j}`),p(j),f("feature")},[]),A=re.useCallback(async()=>{await FU(),await O(),await B()},[O,B]);return g.jsxs("div",{className:"min-h-screen bg-black text-white flex",children:[g.jsx(XU,{view:h,onSelectView:j=>{j==="history"?C():f(j)},activeFeature:m,onSelectFeature:$,issuesCount:(i==null?void 0:i.vulnerabilities.length)??0,agentCount:K,runCount:(_==null?void 0:_.count)??0,verified:z,email:(y==null?void 0:y.email)??null,onOpenEmail:X,onOpenHistory:C,onForget:()=>void A()}),g.jsxs("div",{className:"flex-1 min-w-0",children:[g.jsx("div",{className:"border-b border-[#222]",children:g.jsxs("div",{className:"max-w-[72rem] mx-auto px-6 py-4 flex items-center gap-1.5",children:[g.jsxs("a",{href:"https://app.strix.ai",target:"_blank",rel:"noopener noreferrer",onClick:()=>gi("logo"),className:"flex items-center gap-1.5 opacity-90 transition-opacity hover:opacity-100 lg:hidden",title:"Open Strix Cloud",children:[g.jsx("img",{src:"./logo.png",alt:"Strix",className:"w-10 h-8 object-cover"}),g.jsx("div",{className:"text-base text-white font-medium tracking-tight",children:"Strix"})]}),g.jsx("span",{className:"text-xs text-[#666]",children:"Local results"}),i&&g.jsx(uH,{finished:i.finished}),g.jsxs("div",{className:"ml-auto flex items-center gap-3",children:[z&&_&&!_.locked&&_.runs.length>0&&g.jsx(cH,{runs:_,activeRun:e,launchedName:(i==null?void 0:i.summary.runName)??(i==null?void 0:i.summary.runId)??"Current run",onSelect:q}),g.jsxs("a",{href:Fs,target:"_blank",rel:"noopener noreferrer",onClick:()=>gi("run_in_cloud"),className:"inline-flex items-center gap-1 rounded-lg bg-white px-3 py-1.5 text-xs font-semibold text-black transition-opacity hover:opacity-90",children:["Run in the cloud",g.jsx(Ds,{className:"w-3 h-3","aria-hidden":"true"})]})]})]})}),g.jsxs("div",{className:"max-w-[72rem] mx-auto px-6 py-8 space-y-6",children:[g.jsxs("div",{className:"rounded-lg px-4 py-3 flex gap-3 items-start",style:{border:"1px solid rgba(255,255,255,0.08)"},children:[g.jsx(rp,{className:"w-5 h-5 flex-shrink-0 mt-0.5 text-emerald-400","aria-hidden":"true"}),g.jsx("p",{className:"text-sm text-[#aaa] leading-relaxed",children:rH})]}),s&&!i&&h!=="history"&&g.jsxs("div",{className:"rounded-lg px-4 py-3 flex gap-3 items-start border border-red-500/30 bg-red-500/5",children:[g.jsx(a_,{className:"w-5 h-5 flex-shrink-0 mt-0.5 text-red-400","aria-hidden":"true"}),g.jsx("p",{className:"text-sm text-red-300",children:s})]}),h==="feature"&&m&&Jm[m]?g.jsx(iH,{feature:Jm[m]}):h==="history"?g.jsxs("div",{className:"space-y-4",children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx(zs,{className:"w-5 h-5 text-[#888]","aria-hidden":"true"}),g.jsx("h1",{className:"text-2xl font-semibold text-white",children:"Past runs"})]}),g.jsx(QU,{runs:_,activeRun:e,onSelectRun:q,onVerifyClick:Y})]}):!i&&!s?g.jsxs("div",{className:"rounded-xl border border-[#222] bg-[rgba(255,255,255,0.02)] p-10 text-center",children:[g.jsx("div",{className:"w-6 h-6 mx-auto mb-3 rounded-full border-2 border-[#333] border-t-white animate-spin"}),g.jsx("p",{className:"text-sm text-[#888]",children:"Loading run data…"})]}):i&&U?g.jsxs(g.Fragment,{children:[g.jsx(fH,{summary:i.summary}),g.jsxs("div",{className:"flex gap-5 border-b border-[#2a2a2a] lg:hidden",children:[g.jsx(_m,{active:h==="overview",onClick:()=>f("overview"),children:"Overview"}),g.jsxs(_m,{active:h==="issues",onClick:()=>f("issues"),children:["Issues",i.vulnerabilities.length>0?` (${i.vulnerabilities.length})`:""]}),K>0&&g.jsxs(_m,{active:h==="agents",onClick:()=>f("agents"),children:["Agents (",K,")"]})]}),h==="overview"?g.jsx(bH,{summary:i.summary,counts:U,total:i.vulnerabilities.length,reportMarkdown:i.reportMarkdown,onOpenEmail:X}):h==="agents"&&K>0?g.jsx(xH,{run:i}):I?g.jsxs("div",{className:"space-y-4",children:[g.jsxs("button",{onClick:()=>d(null),className:"cursor-pointer inline-flex items-center gap-1.5 text-sm text-[#888] hover:text-white transition-colors",children:[g.jsx(r2,{className:"w-4 h-4"})," Back to all findings"]}),g.jsx(N4,{vulnerability:I})]}):g.jsx(hH,{vulnerabilities:i.vulnerabilities,finished:i.finished,onSelect:j=>d(j)})]}):null]})]}),g.jsx(tH,{open:S,onClose:()=>w(!1),activeRun:e,auth:y,purpose:k,onVerified:()=>{O(),B()}})]})}function cH({runs:e,activeRun:t,launchedName:i,onSelect:a}){const[s,o]=re.useState(!1),c=t??i;return g.jsxs("div",{className:"relative",children:[g.jsxs("button",{onClick:()=>o(d=>!d),onBlur:()=>setTimeout(()=>o(!1),150),className:"flex items-center gap-1.5 rounded-lg px-2.5 py-1.5 text-xs text-[#aaa] transition-colors hover:text-white",style:{border:"1px solid #2a2a2a"},children:[g.jsx(zs,{className:"w-3.5 h-3.5","aria-hidden":"true"}),g.jsx("span",{className:"max-w-[160px] truncate",children:c}),g.jsx(r_,{className:"w-3.5 h-3.5","aria-hidden":"true"})]}),s&&g.jsx("div",{className:"absolute right-0 z-50 mt-1.5 max-h-80 w-64 overflow-y-auto rounded-lg py-1 shadow-xl",style:{border:"1px solid #2a2a2a",background:"#0a0a0a"},children:e.runs.map(d=>{const h=d.name===t;return g.jsxs("button",{onMouseDown:()=>a(d.name),className:`flex w-full items-center gap-2 px-3 py-2 text-left text-xs transition-colors hover:bg-[rgba(255,255,255,0.06)] ${h?"text-white":"text-[#aaa]"}`,children:[g.jsxs("span",{className:"min-w-0 flex-1",children:[g.jsx("span",{className:"block truncate",children:d.name}),d.target&&g.jsx("span",{className:"block truncate font-mono text-[#666]",children:d.target})]}),h&&g.jsx("span",{className:"h-1.5 w-1.5 flex-shrink-0 rounded-full bg-emerald-400"})]},d.name)})})]})}function uH({finished:e}){return e?g.jsxs("span",{className:"ml-3 inline-flex items-center gap-1.5 text-xs text-[#888]",children:[g.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-[#555]"}),"Complete"]}):g.jsxs("span",{className:"ml-3 inline-flex items-center gap-1.5 text-xs text-emerald-400",children:[g.jsxs("span",{className:"relative flex h-1.5 w-1.5",children:[g.jsx("span",{className:"absolute inline-flex h-full w-full rounded-full bg-emerald-400 opacity-75 animate-ping"}),g.jsx("span",{className:"relative inline-flex h-1.5 w-1.5 rounded-full bg-emerald-400"})]}),"Live"]})}function dH(e){if(e==null)return null;if(e<60)return`${e}s`;const t=Math.floor(e/60);return t<60?`${t}m`:`${Math.floor(t/60)}h ${t%60}m`}function fH({summary:e}){const t=dH(e.durationSeconds);return g.jsxs("div",{children:[g.jsx("h1",{className:"text-2xl font-semibold text-white",children:e.runName??e.runId??"Scan results"}),g.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-x-3 gap-y-1 text-sm text-[#888]",children:[e.targets.length>0&&g.jsx("span",{className:"font-mono text-[#aaa]",children:e.targets.join(", ")}),e.scanMode&&g.jsx(vm,{label:e.scanMode}),t&&g.jsx(vm,{label:t}),e.status&&g.jsx(vm,{label:e.status})]})]})}function vm({label:e}){return g.jsxs(g.Fragment,{children:[g.jsx("span",{className:"text-[#333]",children:"·"}),g.jsx("span",{className:"capitalize",children:e})]})}function hH({vulnerabilities:e,finished:t,onSelect:i}){const a=[...e].sort((s,o)=>W1.indexOf(s.severity)-W1.indexOf(o.severity));return a.length===0?g.jsxs("div",{className:"space-y-4",children:[g.jsx("div",{className:"rounded-xl border border-[#222] bg-[rgba(255,255,255,0.02)] p-8 text-center text-sm text-[#888]",children:t?"No findings in this run.":"No findings yet. The scan is still running…"}),t&&g.jsxs("div",{className:"rounded-xl border border-[#222] bg-[rgba(255,255,255,0.02)] p-5",children:[g.jsx("p",{className:"text-sm font-medium text-white",children:"Stay ahead of new exposures"}),g.jsx("p",{className:"mt-0.5 mb-3 text-xs text-[#666]",children:"Attack surface monitoring catches new exposures for your org over time."}),g.jsx(Ms,{label:"Attack surface monitoring",desc:"Continuous coverage for your whole org.",slug:"asm",icon:d_})]})]}):g.jsx("div",{className:"space-y-2",children:a.map(s=>g.jsxs("button",{onClick:()=>i(s.id),className:"cursor-pointer w-full text-left rounded-lg border border-[#222] hover:border-[#444] bg-[rgba(255,255,255,0.02)] px-4 py-3 transition-colors flex items-center gap-3",children:[g.jsx("span",{className:`w-2.5 h-2.5 rounded-full flex-shrink-0 ${ap(s.severity)}`,"aria-hidden":"true"}),g.jsxs("span",{className:"flex-1 min-w-0",children:[g.jsx("span",{className:"block text-sm font-medium text-white truncate",children:s.title}),s.target&&g.jsx("span",{className:"block text-xs text-[#666] font-mono truncate",children:s.target})]}),g.jsx("span",{className:`text-xs font-semibold px-2 py-0.5 rounded-full border capitalize ${b_[s.severity]}`,children:s.severity})]},s.id))})}function mH(e){return e.replace(/^\s*#{1,6}[ \t]+.*(?:\r?\n)+/,"").trimStart()}function pH(e){const t=[];let i=null;for(const a of e.split(` +`)}function tU({args:e,result:t}){const i=e.action??"",a=e.code??e.script??"",s=t;let o=null;s&&typeof s=="object"?o=typeof s.stdout=="string"?s.stdout:null:typeof s=="string"&&(o=s);const c=i==="new_session"?"new session":i==="close"?"close session":i==="list_sessions"?"list sessions":null,d=o?eU(J9(o)):null;return g.jsxs("div",{children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("span",{className:"text-yellow-400/80 font-semibold text-sm",children:"Python"}),c&&g.jsx("span",{className:"text-[#888] text-[13px]",children:c})]}),a&&g.jsx(Kp,{code:a,language:"python",collapsible:!0}),d&&g.jsx(br,{className:"text-[#666]",children:d})]})}function nU({args:e}){const t=e.targets,a=(Array.isArray(t)?t:[]).map(s=>typeof s=="object"&&s?s.original??null:null).filter(Boolean);return g.jsxs("div",{children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("span",{className:"text-emerald-400/80 font-semibold text-sm",children:"Starting penetration test"}),a.length===1&&g.jsxs("span",{className:"text-[#888] text-[13px]",children:["on ",a[0]]})]}),a.length>1&&g.jsx("div",{className:"mt-1.5 space-y-0.5",children:a.map((s,o)=>g.jsxs("div",{className:"text-[13px] text-[#888]",children:[g.jsx("span",{className:"text-[#555] mr-1",children:"•"}),s]},o))})]})}function iU({args:e}){const t=e.name??"Unknown Agent",i=e.task??"";return g.jsxs("div",{children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("span",{className:"text-[#888] text-[13px]",children:"subagent"}),g.jsx("span",{className:"text-purple-400 font-semibold text-sm",children:t})]}),i&&g.jsx("div",{className:"mt-1.5",children:g.jsx(Ln,{text:i,maxLines:15})})]})}function rU(e){return e.toolName==="subagent_start_info"?g.jsx(iU,{...e}):g.jsx(nU,{...e})}function aU({args:e}){const t=e.executive_summary??"",i=e.methodology??"",a=e.technical_analysis??"",s=e.recommendations??"";return g.jsxs("div",{className:"space-y-3",children:[g.jsx("span",{className:"text-emerald-400/80 font-semibold text-sm",children:"Penetration test completed"}),t&&g.jsxs("div",{children:[g.jsx("span",{className:"text-emerald-400/60 text-sm font-semibold",children:"Executive Summary"}),g.jsx("div",{className:"mt-1",children:g.jsx(Ln,{text:t,maxLines:25})})]}),i&&g.jsxs("div",{children:[g.jsx("span",{className:"text-emerald-400/60 text-sm font-semibold",children:"Methodology"}),g.jsx("div",{className:"mt-1",children:g.jsx(Ln,{text:i,maxLines:25})})]}),a&&g.jsxs("div",{children:[g.jsx("span",{className:"text-emerald-400/60 text-sm font-semibold",children:"Technical Analysis"}),g.jsx("div",{className:"mt-1",children:g.jsx(Ln,{text:a,maxLines:25})})]}),s&&g.jsxs("div",{children:[g.jsx("span",{className:"text-emerald-400/60 text-sm font-semibold",children:"Recommendations"}),g.jsx("div",{className:"mt-1",children:g.jsx(Ln,{text:s,maxLines:25})})]}),!t&&!i&&!a&&!s&&g.jsx("div",{className:"text-[#555] text-xs",children:"Generating final report..."})]})}function sU({toolName:e,args:t,result:i}){if(e==="create_note"){const a=t.title??"",s=t.content??"",o=t.category??"general";return g.jsxs("div",{children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("span",{className:"text-amber-400/80 font-semibold text-sm",children:"note"}),g.jsxs("span",{className:"text-[#555] text-[13px]",children:["(",o,")"]})]}),a&&g.jsx("div",{className:"mt-1.5 text-[#999] text-[13px]",children:a}),s&&g.jsx("div",{className:"mt-1",children:g.jsx(Cs,{text:s})})]})}if(e==="delete_note")return g.jsx("span",{className:"text-amber-400/80 font-semibold text-sm",children:"note removed"});if(e==="update_note"){const a=t.title??"",s=t.content??"";return g.jsxs("div",{children:[g.jsx("span",{className:"text-amber-400/80 font-semibold text-sm",children:"note updated"}),a&&g.jsx("div",{className:"mt-1.5 text-[#999] text-[13px]",children:a}),s&&g.jsx("div",{className:"mt-1",children:g.jsx(Cs,{text:s})})]})}if(e==="get_note"){const a=i,s=a&&typeof a=="object"&&a.success?a.note:void 0;return g.jsxs("div",{children:[g.jsx("span",{className:"text-amber-400/80 font-semibold text-sm",children:"note read"}),s&&g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"mt-1.5 text-[#999] text-[13px]",children:[s.title??"(untitled)",g.jsxs("span",{className:"text-[#555] ml-1",children:["(",s.category??"general",")"]})]}),s.content&&g.jsx("div",{className:"mt-1",children:g.jsx(Cs,{text:s.content})})]})]})}if(e==="list_notes"){const a=i;let s=[];if(a&&typeof a=="object"&&a.success){const o=a.notes;s=Array.isArray(o)?o:[]}return g.jsxs("div",{children:[g.jsx("span",{className:"text-amber-400/80 font-semibold text-sm",children:"notes"}),s.length>0?g.jsx("div",{className:"mt-1.5 space-y-0.5",children:s.map((o,c)=>g.jsxs("div",{className:"text-[13px]",children:[g.jsx("span",{className:"text-[#555] mr-1",children:"-"}),g.jsx("span",{className:"text-[#999]",children:o.title??"(untitled)"}),g.jsxs("span",{className:"text-[#555] ml-1",children:["(",o.category??"general",")"]}),o.content&&g.jsx("div",{className:"ml-3",children:g.jsx(Cs,{text:o.content})})]},c))}):g.jsx("div",{className:"mt-1 text-[#555] text-xs",children:"No notes"})]})}return g.jsx("span",{className:"text-amber-400/80 font-semibold text-sm",children:"note"})}const lU={create_todo:{label:"Task added",Icon:yT},list_todos:{label:"Plan",Icon:p2},update_todo:{label:"Task updated",Icon:bT},mark_todo_done:{label:"Task completed",Icon:s_},mark_todo_pending:{label:"Task reopened",Icon:CT},delete_todo:{label:"Task removed",Icon:BT}};function oU({status:e}){return e==="done"?g.jsx(s_,{className:"w-3.5 h-3.5 text-emerald-400/70 shrink-0"}):e==="in_progress"?g.jsx(S2,{className:"w-3.5 h-3.5 text-purple-400/70 shrink-0 animate-pulse"}):g.jsx(T2,{className:"w-3.5 h-3.5 text-[#444] shrink-0"})}function cU({todos:e,highlightId:t}){return g.jsx("div",{className:"space-y-0",children:e.map((i,a)=>{const s=i.status??"pending",o=t&&i.id===t;return g.jsxs("div",{className:`flex items-start gap-2.5 py-1.5 px-2 -mx-2 rounded-md transition-colors ${o?"bg-purple-500/[0.08]":""}`,children:[g.jsx("div",{className:"mt-[1px]",children:g.jsx(oU,{status:s})}),g.jsx("span",{className:`text-[13px] leading-snug ${s==="done"?"text-[#555] line-through":s==="in_progress"?"text-[#bbb]":"text-[#999]"}`,children:i.title??"(untitled)"})]},i.id??a)})})}function uU({toolName:e,args:t,result:i}){const a=lU[e]??{label:"Plan",Icon:ST},s=a.Icon,o=i;if(typeof o=="string"&&o.trim())return g.jsxs("div",{children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx(s,{className:"w-3.5 h-3.5 text-purple-400/60"}),g.jsx("span",{className:"text-purple-400/80 font-semibold text-sm",children:a.label})]}),g.jsx("div",{className:"mt-1.5 text-[#888] text-[13px]",children:o.trim()})]});let c=[],d=null,h;if(o&&typeof o=="object"){if(d=o.error??null,o.success){const m=o.todos;c=Array.isArray(m)?m:[]}h=o.id??t.todo_id??void 0}const f=e!=="list_todos"?h:void 0;return c.length===0&&!d?g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx(s,{className:"w-3.5 h-3.5 text-purple-400/60"}),g.jsx("span",{className:"text-purple-400/80 font-semibold text-sm",children:a.label})]}):g.jsxs("div",{children:[g.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[g.jsx(s,{className:"w-3.5 h-3.5 text-purple-400/60"}),g.jsx("span",{className:"text-purple-400/80 font-semibold text-sm",children:a.label})]}),d&&g.jsx("div",{className:"text-red-400/70 text-[13px] mb-2",children:d}),c.length>0&&g.jsx("div",{className:"rounded-lg border border-white/[0.06] bg-white/[0.015] px-3 py-2",children:g.jsx(cU,{todos:c,highlightId:f})})]})}function Y1(e){if(e==null)return null;if(typeof e=="string")return e.trim()?e:null;if(typeof e=="object"){const t=e;if(typeof t.__raw=="string")return t.__raw;if(Object.keys(t).length===0)return null;try{return JSON.stringify(e,null,2)}catch{return String(e)}}return String(e)}function ON({toolName:e,args:t,result:i}){const a=Y1(t),s=Y1(i);return g.jsxs("div",{children:[g.jsx("span",{className:"text-[#888] font-semibold text-sm",children:e.replace(/_/g," ")}),a&&g.jsx(br,{className:"text-[#777]",children:a}),s&&g.jsx(br,{className:"text-[#666]",children:s})]})}function dU({args:e}){const i=(e.skills??"").split(",").map(a=>a.trim()).filter(Boolean);return g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("span",{className:"text-emerald-400/80 font-semibold text-sm",children:"Loading skill"}),i.length>0&&g.jsx("span",{className:"text-[#888] text-[13px]",children:i.join(", ")})]})}const Fu={terminal:{renderer:E9,icon:h_,color:"text-emerald-400"},python:{renderer:tU,icon:M2,color:"text-yellow-400"},browser:{renderer:S9,icon:np,color:"text-blue-400"},filesystem:{renderer:k9,icon:o_,color:"text-sky-400"},proxy:{renderer:G9,icon:Ds,color:"text-purple-400",match:/request|sitemap|scope/},reporting:{renderer:j9,icon:RT,color:"text-red-400"},thinking:{renderer:V9,icon:n_,color:"text-purple-400"},agents:{renderer:Y9,icon:ep,color:"text-cyan-400",match:/agent/},search:{renderer:X9,icon:f_,color:"text-amber-400"},lifecycle:{renderer:rU,icon:c_,color:"text-emerald-400"},notes:{renderer:sU,icon:zT,color:"text-amber-400",match:/note/},skills:{renderer:dU,icon:lu,color:"text-emerald-400"},todos:{renderer:uU,icon:rT,color:"text-purple-400",match:/todo/},telemetry:{renderer:ON,icon:lu,color:"text-[#555]"}},fU={terminal:["exec_command","write_stdin","terminal_execute"],python:["python_action"],browser:["browser_action"],filesystem:["apply_patch","view_image","str_replace_editor","list_files","search_files"],proxy:["list_requests","view_request","repeat_request","list_sitemap","view_sitemap_entry","scope_rules","send_request"],reporting:["create_vulnerability_report"],thinking:["think"],agents:["create_agent","agent_finish","send_message_to_agent","wait_for_message","view_agent_graph","stop_agent"],search:["web_search"],lifecycle:["scan_start_info","subagent_start_info","finish_scan"],notes:["create_note","delete_note","update_note","list_notes","get_note"],skills:["load_skill"],todos:["create_todo","list_todos","update_todo","mark_todo_done","mark_todo_pending","delete_todo"],telemetry:["sandbox_error_details","llm_error_details"]},hU=Object.fromEntries(Object.entries(fU).flatMap(([e,t])=>t.map(i=>[i,e]))),mU={finish_scan:aU,apply_patch:D9,view_image:L9},pU={agent_finish:{icon:c_,color:"text-cyan-400"},send_message_to_agent:{icon:Ux,color:"text-cyan-400"},wait_for_message:{icon:Ux,color:"text-cyan-400"},view_agent_graph:{icon:I2,color:"text-cyan-400"},stop_agent:{icon:t_,color:"text-red-400"},scan_start_info:{icon:D2,color:"text-emerald-400"},subagent_start_info:{icon:ep,color:"text-purple-400"},view_image:{icon:W2,color:"text-sky-400"}},gU=Fu.telemetry;function RN(e){var i;const t=hU[e];if(t)return t;for(const[a,s]of Object.entries(Fu))if((i=s.match)!=null&&i.test(e))return a;return null}function bU(e){const t=mU[e];if(t)return t;const i=RN(e);return i?Fu[i].renderer:ON}function xU(e){const t=pU[e];if(t)return t;const i=RN(e),a=i?Fu[i]:gU;return{icon:a.icon,color:a.color}}const yU=30;function vU({role:e,content:t}){const i=e==="user"||e==="human";return g.jsxs("div",{children:[g.jsx("span",{className:`font-semibold text-sm ${i?"text-blue-400/80":"text-purple-400/80"}`,children:i?"User":"Thinking"}),g.jsx("div",{className:"mt-1.5 italic text-[#888]",children:g.jsx(Ln,{text:t,maxLines:yU})})]})}class _U extends re.Component{constructor(t){super(t),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}render(){return this.state.hasError?g.jsx("span",{className:"text-[#555] font-semibold text-sm",children:this.props.toolName.replace(/_/g," ")}):this.props.children}}function wU(e){const t=bU(e.toolName);return g.jsx(_U,{toolName:e.toolName,children:g.jsx(t,{...e})})}function DN(e){if(e==null||typeof e!="string")return e;const t=e.trim();if(!t)return e;try{return JSON.parse(t)}catch{}try{const i=t.replace(/\bNone\b/g,"null").replace(/\bTrue\b/g,"true").replace(/\bFalse\b/g,"false").replace(/'/g,'"');return JSON.parse(i)}catch{return{__raw:e}}}function LN(e){const t=DN(e);return t&&typeof t=="object"&&!Array.isArray(t)?t:t==null?{}:{__raw:typeof t=="string"?t:JSON.stringify(t)}}function X1(e){const t=/(\d+)$/.exec(e);return t?parseInt(t[1],10):0}function zN(e){var i;const t=(i=e.data)==null?void 0:i.role;return e.type==="chat"&&(t==="user"||t==="human")}const EU={completed:"text-emerald-400 border-emerald-500/30 bg-emerald-500/10",running:"text-blue-400 border-blue-500/30 bg-blue-500/10",waiting:"text-yellow-400 border-yellow-500/30 bg-yellow-500/10",stopped:"text-[#aaa] border-[#333] bg-[#1a1a1a]",crashed:"text-red-400 border-red-500/30 bg-red-500/10",failed:"text-red-400 border-red-500/30 bg-red-500/10"};function NU(e){return e==="completed"?"completed":e==="running"?"running":e==="failed"||e==="crashed"?"failed":e}function SU(e,t){var d;const i=new Map;for(const h of e)if(h.parent_id){const f=i.get(h.parent_id)??[];f.push(h.id),i.set(h.parent_id,f)}const a=new Map,s=new Map,o=new Map;for(const h of t)if(h.type==="tool"){if(a.set(h.agent_id,(a.get(h.agent_id)??0)+1),((d=h.data)==null?void 0:d.tool_name)==="create_agent"){const f=LN(h.data.args),m=f.name??f.agent_name??"",p=f.task??"";m&&p&&o.set(m,p)}}else zN(h)||s.set(h.agent_id,(s.get(h.agent_id)??0)+1);const c=new Map;for(const h of e)c.set(h.id,{id:h.id,name:h.name,task:o.get(h.name)??"",status:NU(h.status),parentId:h.parent_id,children:i.get(h.id)??[],createdAt:h.created_at,toolCount:a.get(h.id)??0,messageCount:s.get(h.id)??0});return c}function kU({agent:e,events:t,showHeader:i=!0}){const a=re.useMemo(()=>t.filter(c=>c.agent_id===e.id&&!zN(c)).sort((c,d)=>X1(c.id)-X1(d.id)),[t,e.id]),s=a.filter(c=>c.type==="tool").length,o=a.length-s;return g.jsxs("div",{children:[i&&g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"flex items-center gap-2 flex-wrap mb-1",children:[g.jsx("span",{className:"text-base font-semibold text-white truncate",children:e.name}),g.jsx("span",{className:`flex-shrink-0 text-xs font-medium capitalize px-2 py-0.5 rounded-full border ${EU[e.status]??"text-[#aaa] border-[#333] bg-[#1a1a1a]"}`,children:e.status}),g.jsx("span",{className:"font-mono text-xs text-[#555]",children:e.id})]}),g.jsxs("p",{className:"text-xs text-[#666] mb-4",children:[o," message",o===1?"":"s"," · ",s," tool call",s===1?"":"s"]})]}),a.length===0?g.jsx("p",{className:"text-sm text-[#666]",children:"No recorded activity for this agent."}):g.jsx("div",{className:"py-1",children:a.map((c,d)=>{var N,S,w,k,E,O;const h=d===a.length-1,f=c.type==="tool",m=f?String(((N=c.data)==null?void 0:N.tool_name)??"tool"):"",p=f?"":String(((S=c.data)==null?void 0:S.role)??"assistant");let y,x;if(f){const B=xU(m);y=B.icon,x=B.color}else{const B=p==="user"||p==="human";y=B?ep:n_,x=B?"text-blue-400":"text-purple-400"}const _=f?String(((w=c.data)==null?void 0:w.status)??"completed"):"completed";return g.jsxs("div",{className:"flex gap-3",children:[g.jsxs("div",{className:"flex flex-col items-center shrink-0",children:[g.jsx("div",{className:`w-[30px] h-[30px] rounded-full bg-black border flex items-center justify-center shrink-0 ${f&&_==="running"?"border-blue-500/40 animate-pulse":f&&_==="failed"?"border-red-500/30":"border-[#222]"}`,children:g.jsx(y,{className:`w-3.5 h-3.5 ${x}`})}),!h&&g.jsx("div",{className:"w-px flex-1 bg-[#1a1a1a] mt-1"})]}),g.jsx("div",{className:"flex-1 min-w-0 pt-[5px] pb-6",children:f?g.jsx(wU,{toolName:m,args:LN((k=c.data)==null?void 0:k.args),result:DN((E=c.data)==null?void 0:E.result)??null,status:_}):g.jsx(vU,{role:p,content:String(((O=c.data)==null?void 0:O.content)??"")})})]},c.id)})})]})}const TU={completed:"bg-emerald-400",running:"bg-blue-400",waiting:"bg-yellow-400",stopped:"bg-[#888]",crashed:"bg-red-400",failed:"bg-red-400"},AU=80;function CU({agent:e,events:t,onClose:i}){const a=re.useRef(null),s=re.useRef(!1),o=re.useCallback(()=>{const c=a.current;c&&(s.current=c.scrollHeight-c.scrollTop-c.clientHeight{const c=a.current;!c||!s.current||requestAnimationFrame(()=>{c.scrollTo({top:c.scrollHeight,behavior:"smooth"})})},[t]),re.useEffect(()=>{const c=h=>{h.key==="Escape"&&i()};document.addEventListener("keydown",c);const d=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",c),document.body.style.overflow=d}},[i]),g.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/70 p-4 sm:p-8",onClick:i,role:"dialog","aria-modal":"true","aria-label":`Agent ${e.name}`,children:g.jsxs("div",{className:"relative flex h-[80vh] w-full max-w-5xl flex-col rounded-xl border border-[#222] bg-[#0a0a0a] shadow-2xl",onClick:c=>c.stopPropagation(),children:[g.jsxs("div",{className:"flex items-center justify-between gap-3 border-b border-[#222] px-5 py-3.5",children:[g.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[g.jsx("span",{className:`h-2 w-2 flex-shrink-0 rounded-full ${TU[e.status]??"bg-[#888]"}`}),g.jsx("span",{className:"truncate text-sm font-semibold text-white",children:e.name}),g.jsx("span",{className:"flex-shrink-0 font-mono text-xs text-[#555]",children:e.id})]}),g.jsx("button",{type:"button",onClick:i,"aria-label":"Close",className:"flex-shrink-0 rounded-md p-1 text-[#888] transition-colors hover:bg-[#1a1a1a] hover:text-white",children:g.jsx(g_,{className:"h-4 w-4"})})]}),g.jsx("div",{ref:a,onScroll:o,className:"flex-1 overflow-y-auto p-5",children:g.jsx(kU,{agent:e,events:t,showHeader:!1})}),g.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 border-t border-[#222] px-5 py-3",children:[g.jsx("span",{className:"text-xs text-[#888]",children:"Steer agents live from your terminal."}),g.jsx("a",{href:Fs,target:"_blank",rel:"noopener noreferrer",onClick:()=>gi("steer_agent"),className:"text-xs font-medium text-[#60a5fa] hover:underline",children:"Upgrade to Pro to steer agents from the web →"})]})]})})}class Su extends Error{constructor(t){super(t),this.name="RunParseError"}}const MU=["critical","high","medium","low"];function OU(e){const t=String(e??"").toLowerCase().trim();return MU.includes(t)?t:"low"}function RU(e){if(typeof e=="string"&&e.trim()){const t=e.trim().replace(" UTC","Z").replace(" ","T"),i=new Date(t);if(!Number.isNaN(i.getTime()))return i.toISOString();const a=new Date(e);if(!Number.isNaN(a.getTime()))return a.toISOString()}return new Date().toISOString()}function Ot(e){return typeof e=="string"&&e.length>0?e:null}function DU(e){return typeof e=="number"&&Number.isFinite(e)?e:null}function jN(e,t){try{return JSON.parse(e)}catch{throw new Su(`${t} isn't valid JSON. Make sure you selected a Strix run directory.`)}}function LU(e){const t=jN(e,"run.json");if(!t||typeof t!="object"||Array.isArray(t))throw new Su("run.json is not an object.");const i=t,a=[],s=i.targets_info;if(Array.isArray(s)){for(const x of s)if(x&&typeof x=="object"){const _=x.original;typeof _=="string"&&_&&a.push(_)}}const o=Ot(i.start_time),c=Ot(i.end_time);let d=null;if(o&&c){const x=new Date(o).getTime(),_=new Date(c).getTime();!Number.isNaN(x)&&!Number.isNaN(_)&&_>=x&&(d=Math.round((_-x)/1e3))}let h=null,f=null,m=null,p=null;const y=i.scan_results;if(y&&typeof y=="object"){const x=y;h=Ot(x.executive_summary),f=Ot(x.technical_analysis),m=Ot(x.methodology),p=Ot(x.recommendations)}return{runId:Ot(i.run_id),runName:Ot(i.run_name),targets:a,scanMode:Ot(i.scan_mode),status:Ot(i.status),startTime:o,endTime:c,durationSeconds:d,executiveSummary:h,technicalAnalysis:f,methodology:m,recommendations:p}}function zU(){return{pr_review_id:null,cve:null,cvss:null,potential_risk_saving:null,risk_saving_description:null,impact:null,endpoint:null,method:null,target:null,technical_analysis:null,poc_description:null,poc_script_code:null,code_diff:null,code_file:null,code_before:null,code_after:null,cwe:null,code_locations:null,remediation_steps:null,fix_pr_body:null,evidence:null,assumptions:null,fix_effort:null,cvss_breakdown:null,status_changed_at:null,status_changed_by:null,status_note:null,snoozed_until:null,reopened_at:null,reopened_by:null,original_severity:null,severity_changed_at:null,severity_changed_by:null,severity_override_reason:null,retest_of_vulnerability_id:null}}function jU(e,t,i){const a=e.cwe,s=typeof a=="string"&&a.trim()?[a.trim()]:Array.isArray(a)?a.filter(c=>typeof c=="string"&&c):null;return{...zU(),id:Ot(e.id)??`vuln-${t+1}`,scan_id:i,title:Ot(e.title)??"Untitled finding",description:Ot(e.description)??"",severity:OU(e.severity),status:"open",created_at:RU(e.timestamp),cve:Ot(e.cve),cvss:DU(e.cvss),impact:Ot(e.impact),endpoint:Ot(e.endpoint),method:Ot(e.method),target:Ot(e.target),technical_analysis:Ot(e.technical_analysis),poc_description:Ot(e.poc_description),poc_script_code:Ot(e.poc_script_code),cwe:s,code_locations:Array.isArray(e.code_locations)?e.code_locations:null,remediation_steps:Ot(e.remediation_steps),fix_pr_body:Ot(e.fix_pr_body),evidence:Ot(e.evidence),assumptions:Ot(e.assumptions),fix_effort:Ot(e.fix_effort)??null,cvss_breakdown:e.cvss_breakdown??null}}function IU(e,t=null){const i=jN(e,"vulnerabilities.json");if(!Array.isArray(i))throw new Su("vulnerabilities.json is not a JSON array.");return i.map((a,s)=>{if(!a||typeof a!="object")throw new Su(`vulnerabilities.json entry #${s+1} is not an object.`);return jU(a,s,t)})}function BU(e){const t={critical:0,high:0,medium:0,low:0};for(const i of e)t[i.severity]+=1;return t}async function Ys(e){const t=await fetch(e,{cache:"no-store"});if(!t.ok)throw new Error(`${e} responded ${t.status}`);return t.json()}function Gu(e){return e?`?run=${encodeURIComponent(e)}`:""}async function IN(e){const t=await Ys("/api/run"+Gu(e)),i=LU(JSON.stringify(t)),a=t.finished===!0;return{summary:i,raw:t,finished:a}}async function BN(e,t){const i=await Ys("/api/vulnerabilities"+Gu(t));return IU(JSON.stringify(i),e)}async function UU(e){const t=await Ys("/api/report"+Gu(e));return(t==null?void 0:t.markdown)??null}async function UN(e){const t=await Ys("/api/transcript"+Gu(e));return{agents:Array.isArray(t==null?void 0:t.agents)?t.agents:[],events:Array.isArray(t==null?void 0:t.events)?t.events:[]}}async function K1(e){const{summary:t,raw:i,finished:a}=await IN(e),[s,o,c]=await Promise.all([BN(t.runId,e).catch(()=>[]),UU(e).catch(()=>null),UN(e).catch(()=>({agents:[],events:[]}))]);return{summary:t,raw:i,finished:a,vulnerabilities:s,reportMarkdown:o,transcript:c}}async function Vu(e,t){const i=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t),cache:"no-store"});let a={};try{const s=await i.json();s&&typeof s=="object"&&(a=s)}catch{}return{ok:i.ok,status:i.status,data:a}}async function HU(){const e=await Ys("/api/runs");return{locked:(e==null?void 0:e.locked)??!0,count:typeof(e==null?void 0:e.count)=="number"?e.count:0,runs:Array.isArray(e==null?void 0:e.runs)?e.runs:[]}}async function $U(){const e=await Ys("/api/auth/status");return{verified:(e==null?void 0:e.verified)===!0,email:(e==null?void 0:e.email)??null}}async function qU(e){const{ok:t,data:i}=await Vu("/api/auth/otp/start",{email:e});return t&&i.ok===!0?{ok:!0}:{ok:!1,error:String(i.error??"unavailable")}}async function PU(e,t){const{ok:i,data:a}=await Vu("/api/auth/otp/verify",{email:e,code:t});return i&&a.verified===!0?{verified:!0,email:String(a.email??e)}:{verified:!1,error:String(a.error??"invalid_code")}}async function FU(){await Vu("/api/auth/forget",{})}async function GU(e){const{ok:t,data:i}=await Vu("/api/report/send",e?{run:e}:{});return t&&i.ok===!0?{ok:!0,password:String(i.password??""),filename:String(i.filename??"strix-report.pdf")}:{ok:!1,error:String(i.error??"unavailable")}}const VU=[{slug:"pr_reviews",title:"PR Reviews",icon:tp,tier:"Pro",navDesc:"Pentest every pull request",headline:"Pentest every pull request",description:"Strix reviews every pull request your team opens and catches exploitable changes before they merge."},{slug:"repositories",title:"Repositories",icon:eT,tier:"Pro",navDesc:"Connect your team's repos",headline:"Connect your team's repositories",description:"Link your org's repositories so Strix can scan them continuously and track findings over time."},{slug:"domains",title:"Domains",icon:np,tier:"Pro",navDesc:"Cover the domains you own",headline:"Cover every domain you own",description:"Add the domains your team owns and let Strix watch them for newly exposed paths and drift."},{slug:"integrations",title:"Integrations",icon:u_,tier:"Pro",navDesc:"Sync to Jira, Linear, Slack",headline:"Sync findings to your tools",description:"Two-way sync findings to Jira, Linear, and Slack so fixes happen where your team already works."},{slug:"members",title:"Members",icon:m_,tier:"Pro",navDesc:"Invite your team, set roles",headline:"Bring your whole team",description:"Invite your team, set roles, and share findings and run history across your org."},{slug:"pentests",title:"Pentests",icon:f_,tier:"Pro",navDesc:"Deeper scans on managed infra",headline:"Launch deeper pentests",description:"Run deeper, longer pentests on managed infrastructure whenever you need them."},{slug:"dashboard",title:"Dashboard",icon:nT,tier:"Pro",navDesc:"Everything in one place",headline:"See everything in one place",description:"Track every project, run, and finding across your org from a single dashboard."},{slug:"platform_issues",title:"Issues",icon:HT,tier:"Pro",navDesc:"Triage across your org",headline:"Triage findings across your org",description:"Manage and triage findings across every project and repository in one queue."},{slug:"chat",title:"Chat",icon:hT,tier:"Pro",navDesc:"Ask about any finding",headline:"Ask Strix anything",description:"Ask the agents about any finding, run, or part of your app in natural language."},{slug:"networks",title:"Networks",icon:pT,tier:"Enterprise",navDesc:"Reach internal, VPN-only targets",headline:"Scan internal networks",description:"Connect private networks to scan internal applications, VPN-only services, and RFC1918 targets."},{slug:"knowledge",title:"Knowledge",icon:z2,tier:"Pro",navDesc:"Give agents context",headline:"Give agents context",description:"Teach Strix about your systems and business logic so every run gets smarter."}],Jm=Object.fromEntries(VU.map(e=>[e.slug,e])),YU=["pr_reviews","repositories","domains","integrations","members","pentests","networks","chat","dashboard","platform_issues","knowledge"];function XU({view:e,onSelectView:t,activeFeature:i,onSelectFeature:a,issuesCount:s,agentCount:o,runCount:c,verified:d,email:h,onOpenEmail:f,onOpenHistory:m,onForget:p}){return g.jsx("aside",{className:"hidden w-72 flex-shrink-0 border-r border-[#222] lg:block",children:g.jsxs("div",{className:"sticky top-0 flex h-screen flex-col overflow-y-auto px-3 py-4",children:[g.jsxs("div",{className:"px-1.5",children:[g.jsxs("a",{href:"https://app.strix.ai",target:"_blank",rel:"noopener noreferrer",onClick:()=>gi("logo"),className:"flex items-center gap-1.5 opacity-90 transition-opacity hover:opacity-100",title:"Open Strix Cloud",children:[g.jsx("img",{src:"./logo.png",alt:"Strix",className:"h-8 w-10 object-cover"}),g.jsx("span",{className:"text-base font-medium tracking-tight text-white",children:"Strix"})]}),g.jsxs("a",{href:Fs,target:"_blank",rel:"noopener noreferrer",onClick:()=>gi("sidebar_start_free"),className:"mt-3 flex w-full cursor-pointer items-center justify-center gap-1.5 rounded-lg bg-white px-3 py-2 text-sm font-semibold text-black transition-opacity hover:opacity-90",children:["Start free",g.jsx(Ds,{className:"h-3.5 w-3.5","aria-hidden":"true"})]}),d&&h&&g.jsxs("div",{className:"mt-2.5 flex items-center gap-2 rounded-lg px-2.5 py-2",style:{border:"1px solid #222",background:"rgba(255,255,255,0.02)"},children:[g.jsx(rp,{className:"h-3.5 w-3.5 flex-shrink-0 text-emerald-400","aria-hidden":"true"}),g.jsxs("div",{className:"min-w-0 flex-1",children:[g.jsx("p",{className:"truncate text-[11px] text-[#666]",children:"Signed in as"}),g.jsx("p",{className:"truncate text-xs text-[#aaa]",title:h,children:h})]}),g.jsx("button",{onClick:p,title:"Forget this email on this machine",className:"flex-shrink-0 cursor-pointer text-[#666] transition-colors hover:text-white","aria-label":"Forget",children:g.jsx(cT,{className:"h-3.5 w-3.5"})})]})]}),g.jsxs("div",{className:"mt-6 space-y-0.5",children:[g.jsx(Yl,{icon:o_,label:"Overview",desc:"This run's executive report",active:e==="overview",onClick:()=>t("overview")}),g.jsx(Yl,{icon:f2,label:"Issues",desc:"Findings from this run",count:s>0?s:void 0,active:e==="issues",onClick:()=>t("issues")}),o>0&&g.jsx(Yl,{icon:p_,label:"Agents",desc:"What each agent did",count:o,active:e==="agents",onClick:()=>t("agents")}),g.jsx(Yl,{icon:zs,label:"Past runs",desc:"Every run on this machine",count:c>0?c:void 0,active:e==="history",onClick:m}),g.jsx(Yl,{icon:ip,label:"Email report",desc:"Get an encrypted PDF by email",onClick:f}),YU.map(y=>{const x=Jm[y];return x?g.jsx(JT,{feature:x,active:e==="feature"&&i===y,onClick:()=>a(y)},y):null})]})]})})}function Yl({icon:e,label:t,desc:i,count:a,active:s,onClick:o}){return g.jsxs("button",{onClick:o,className:`flex w-full cursor-pointer items-start gap-2.5 rounded-md px-2.5 py-1.5 text-left transition-colors ${s?"text-white":"text-[#888] hover:bg-[rgba(255,255,255,0.06)] hover:text-white"}`,style:s?{background:"rgba(255,255,255,0.12)"}:void 0,children:[g.jsx(e,{className:"mt-0.5 h-4 w-4 flex-shrink-0","aria-hidden":"true"}),g.jsxs("span",{className:"min-w-0 flex-1",children:[g.jsxs("span",{className:"flex items-center gap-1.5",children:[g.jsx("span",{className:"flex-1 truncate text-sm",children:t}),a!=null&&g.jsx("span",{className:"text-xs text-[#666] tabular-nums",children:a})]}),g.jsx("span",{className:"mt-0.5 block text-[11px] leading-snug text-[#666]",children:i})]})]})}const KU=[{key:"critical",dot:"bg-red-500",text:"text-red-500"},{key:"high",dot:"bg-orange-500",text:"text-orange-500"},{key:"medium",dot:"bg-yellow-500",text:"text-yellow-500"},{key:"low",dot:"bg-blue-500",text:"text-blue-500"}];function ZU({counts:e}){const t=KU.filter(i=>e[i.key]>0);return t.length===0?g.jsx("span",{className:"text-xs text-[#555]",children:"No findings"}):g.jsx("div",{className:"flex items-center gap-3",children:t.map(i=>g.jsxs("div",{className:"flex items-center gap-1.5",children:[g.jsx("span",{className:`h-2 w-2 rounded-full ${i.dot}`,"aria-hidden":"true"}),g.jsx("span",{className:`text-xs tabular-nums ${i.text}`,children:e[i.key]})]},i.key))})}function Z1(e){if(!e)return null;const t=e.trim().replace(" UTC","Z").replace(" ","T"),i=new Date(t);return Number.isNaN(i.getTime())?null:i.toLocaleString(void 0,{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}function QU({runs:e,activeRun:t,onSelectRun:i,onVerifyClick:a}){const s=(e==null?void 0:e.count)??0;return!e||e.locked?g.jsxs("div",{className:"rounded-xl border border-[#222] bg-[rgba(255,255,255,0.02)] p-8 text-center",children:[g.jsx("div",{className:"mx-auto mb-4 flex h-11 w-11 items-center justify-center rounded-xl",style:{border:"1px solid #2a2a2a",background:"rgba(255,255,255,0.04)"},children:g.jsx(zs,{className:"h-5 w-5 text-[#888]","aria-hidden":"true"})}),g.jsx("h2",{className:"text-base font-semibold text-white",children:"Browse every run on this machine"}),g.jsxs("p",{className:"mx-auto mt-1.5 max-w-md text-sm text-[#888]",children:["You have ",s," past ",s===1?"run":"runs"," on this machine."]}),g.jsx("button",{onClick:a,className:"mt-4 cursor-pointer rounded-lg bg-white px-4 py-2 text-sm font-semibold text-black transition-opacity hover:opacity-90",children:"View runs"}),g.jsxs("p",{className:"mt-4 flex items-center justify-center gap-1.5 text-xs text-[#555]",children:[g.jsx(h_,{className:"h-3.5 w-3.5","aria-hidden":"true"}),"Or open one from the CLI with"," ",g.jsx("code",{className:"font-mono text-[#888]",children:"strix view "})]})]}):e.runs.length===0?g.jsx("div",{className:"rounded-xl border border-[#222] bg-[rgba(255,255,255,0.02)] p-8 text-center text-sm text-[#888]",children:"No past runs found on this machine yet."}):g.jsx("div",{className:"space-y-2",children:e.runs.map(o=>{const c=o.name===t,d=Z1(o.start_time)??Z1(o.end_time);return g.jsxs("button",{onClick:()=>i(o.name),className:`group flex w-full cursor-pointer items-center gap-4 rounded-lg border px-4 py-3 text-left transition-colors ${c?"border-[#444] bg-[rgba(255,255,255,0.04)]":"border-[#222] bg-[rgba(255,255,255,0.02)] hover:border-[#444]"}`,children:[g.jsxs("div",{className:"min-w-0 flex-1",children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("span",{className:"truncate text-sm font-medium text-white",children:o.name}),c&&g.jsx("span",{className:"rounded-full px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-wide text-emerald-400",style:{border:"1px solid rgba(16,185,129,0.3)"},children:"Active"})]}),g.jsxs("div",{className:"mt-0.5 flex flex-wrap items-center gap-x-2 gap-y-0.5 text-xs text-[#666]",children:[o.target&&g.jsx("span",{className:"truncate font-mono text-[#888]",children:o.target}),o.target&&(o.scan_mode||d||o.status)&&g.jsx("span",{className:"text-[#333]",children:"·"}),o.scan_mode&&g.jsx("span",{className:"capitalize",children:o.scan_mode}),d&&g.jsx("span",{className:"text-[#333]",children:"·"}),d&&g.jsx("span",{children:d}),o.status&&g.jsx("span",{className:"text-[#333]",children:"·"}),o.status&&g.jsx("span",{className:"capitalize",children:o.status})]})]}),g.jsx(ZU,{counts:o.severity_counts}),g.jsx(y2,{className:"h-4 w-4 flex-shrink-0 text-[#555] transition-colors group-hover:text-[#aaa]","aria-hidden":"true"})]},o.name)})})}const Q1={rate_limited:"Too many requests. Wait a minute and try again.",invalid_email:"That email does not look right. Check it and try again.",work_email_required:"Please use your work email, not a personal one.",unavailable:"The email service is unavailable right now. Try again shortly."},WU=new Set(["gmail.com","googlemail.com","yahoo.com","ymail.com","outlook.com","hotmail.com","live.com","icloud.com","me.com","aol.com","proton.me","protonmail.com","gmx.com","mail.com"]);function JU(e){var i;const t=(i=e.split("@")[1])==null?void 0:i.trim().toLowerCase();return t!=null&&WU.has(t)}const eH={forbidden:"This email was unsubscribed from Strix, so we cannot send to it.",too_large:"This report is too large to email. Try a smaller run.",unavailable:"The email service is unavailable right now. Try again shortly."};function tH({open:e,onClose:t,activeRun:i,auth:a,purpose:s,onVerified:o}){const c=(a==null?void 0:a.verified)===!0,[d,h]=re.useState("disclosure"),[f,m]=re.useState(""),[p,y]=re.useState(""),[x,_]=re.useState(!1),[N,S]=re.useState(null),[w,k]=re.useState(null),[E,O]=re.useState(""),[B,R]=re.useState(""),[U,I]=re.useState(!1),K=re.useRef("");if(re.useEffect(()=>{e&&(h(s==="verify"?"email":"disclosure"),y(""),_(!1),S(null),k(null),O(""),R(""),I(!1),m((a==null?void 0:a.email)??""))},[e,a==null?void 0:a.email,s]),re.useEffect(()=>{if(!e)return;const A=j=>{j.key==="Escape"&&d!=="password"&&t()};return window.addEventListener("keydown",A),()=>window.removeEventListener("keydown",A)},[e,d,t]),!e)return null;const z=async()=>{h("sending"),S(null);const A=await GU(i);if(A.ok){O(A.password),R(A.filename),h("password");return}if(A.error==="reverify"||A.error==="unverified"){k("Your verification expired. Enter your email to verify again."),h("email");return}S(eH[A.error]??"Could not send the report. Try again."),h("disclosure")},q=()=>{S(null),k(null),c?z():h("email")},X=async()=>{const A=f.trim();if(!A){S("Enter your email to continue.");return}if(JU(A)){S(Q1.work_email_required);return}_(!0),S(null);const j=await qU(A);_(!1),j.ok?(k(`We sent a 6-digit code to ${A}.`),h("code")):S(Q1[j.error]??"Could not send a code. Try again.")},Y=async()=>{const A=p.trim();if(A.length<4){S("Enter the 6-digit code from your email.");return}_(!0),S(null);const j=await PU(f.trim(),A);if(_(!1),j.verified){if(K.current=j.email,o(),s==="verify"){t();return}z()}else S("That code did not match. Check it and try again.")},C=async()=>{try{await navigator.clipboard.writeText(E),I(!0),setTimeout(()=>I(!1),1500)}catch{}},$=K.current||(a==null?void 0:a.email)||f.trim();return g.jsxs("div",{className:"fixed inset-0 z-[100] flex items-center justify-center p-4",role:"dialog","aria-modal":"true","aria-label":"Email an encrypted report",children:[g.jsx("div",{className:"absolute inset-0 bg-black/70",onClick:()=>d!=="password"&&t()}),g.jsxs("div",{className:"relative z-10 w-full max-w-md rounded-2xl bg-[#0a0a0a] p-6 shadow-2xl",style:{border:"1px solid #2a2a2a"},children:[g.jsx("button",{onClick:t,className:"absolute right-4 top-4 cursor-pointer text-[#666] transition-colors hover:text-white","aria-label":"Close",children:g.jsx(g_,{className:"h-5 w-5"})}),g.jsxs("div",{className:"mb-4 flex items-center gap-2.5",children:[g.jsx("div",{className:"flex h-9 w-9 items-center justify-center rounded-lg",style:{border:"1px solid #2a2a2a",background:"rgba(255,255,255,0.04)"},children:g.jsx(ip,{className:"h-4 w-4 text-emerald-400","aria-hidden":"true"})}),g.jsxs("div",{children:[g.jsx("h2",{className:"text-base font-semibold text-white",children:s==="verify"?"Verify your email to view your runs":"Email an encrypted PDF report of this run"}),g.jsx("p",{className:"text-xs text-[#666]",children:s==="verify"?"We send a one-time code to confirm it is you.":"Verified by a one-time code sent to your email"})]})]}),N&&g.jsxs("div",{className:"mb-4 flex items-start gap-2 rounded-lg border border-red-500/30 bg-red-500/5 px-3 py-2",children:[g.jsx(a_,{className:"mt-0.5 h-4 w-4 flex-shrink-0 text-red-400","aria-hidden":"true"}),g.jsx("p",{className:"text-xs text-red-300",children:N})]}),w&&!N&&d!=="password"&&g.jsx("p",{className:"mb-4 text-xs text-[#888]",children:w}),d==="disclosure"&&g.jsxs("div",{className:"space-y-4",children:[g.jsxs("div",{className:"space-y-2.5 rounded-lg p-3.5",style:{border:"1px solid #222",background:"rgba(255,255,255,0.02)"},children:[g.jsxs("div",{className:"flex items-start gap-2.5",children:[g.jsx(rp,{className:"mt-0.5 h-4 w-4 flex-shrink-0 text-emerald-400","aria-hidden":"true"}),g.jsxs("p",{className:"text-xs leading-relaxed text-[#aaa]",children:["Viewing stays local and nothing is uploaded. Emailing is an explicit opt-in: we send an ",g.jsx("span",{className:"text-white",children:"encrypted PDF"}),"."]})]}),g.jsxs("div",{className:"flex items-start gap-2.5",children:[g.jsx(lT,{className:"mt-0.5 h-4 w-4 flex-shrink-0 text-[#888]","aria-hidden":"true"}),g.jsx("p",{className:"text-xs leading-relaxed text-[#aaa]",children:"The report is encrypted with a password that only you hold. Strix cannot read it and never stores it. We collect only your email so we can send it."})]})]}),g.jsx("button",{onClick:q,className:"w-full cursor-pointer rounded-lg bg-white px-4 py-2.5 text-sm font-semibold text-black transition-opacity hover:opacity-90",children:c?"Email me the encrypted PDF":"Continue with your email"}),c&&(a==null?void 0:a.email)&&g.jsxs("p",{className:"text-center text-xs text-[#666]",children:["Sending to ",a.email]})]}),d==="email"&&g.jsxs("form",{className:"space-y-4",onSubmit:A=>{A.preventDefault(),X()},children:[g.jsxs("label",{className:"block",children:[g.jsx("span",{className:"mb-1.5 block text-xs text-[#888]",children:"Your email"}),g.jsx("input",{type:"email",autoFocus:!0,value:f,onChange:A=>m(A.target.value),placeholder:"you@company.com",className:"w-full rounded-lg bg-black px-3 py-2.5 text-sm text-white outline-none transition-colors focus:border-[#444]",style:{border:"1px solid #2a2a2a"}}),g.jsx("span",{className:"mt-1.5 block text-xs text-[#666]",children:"Use your work email."})]}),g.jsxs("button",{type:"submit",disabled:x,className:"flex w-full cursor-pointer items-center justify-center gap-2 rounded-lg bg-white px-4 py-2.5 text-sm font-semibold text-black transition-opacity hover:opacity-90 disabled:opacity-60",children:[x&&g.jsx(eh,{className:"h-4 w-4 animate-spin","aria-hidden":"true"}),"Send me a code"]})]}),d==="code"&&g.jsxs("form",{className:"space-y-4",onSubmit:A=>{A.preventDefault(),Y()},children:[g.jsxs("label",{className:"block",children:[g.jsx("span",{className:"mb-1.5 block text-xs text-[#888]",children:"6-digit code"}),g.jsx("input",{inputMode:"numeric",autoFocus:!0,value:p,onChange:A=>y(A.target.value.replace(/\D/g,"").slice(0,6)),placeholder:"123456",className:"w-full rounded-lg bg-black px-3 py-2.5 text-center text-lg font-mono tracking-[0.4em] text-white outline-none transition-colors focus:border-[#444]",style:{border:"1px solid #2a2a2a"}})]}),g.jsxs("button",{type:"submit",disabled:x,className:"flex w-full cursor-pointer items-center justify-center gap-2 rounded-lg bg-white px-4 py-2.5 text-sm font-semibold text-black transition-opacity hover:opacity-90 disabled:opacity-60",children:[x&&g.jsx(eh,{className:"h-4 w-4 animate-spin","aria-hidden":"true"}),s==="verify"?"Verify":"Verify and send"]}),g.jsx("button",{type:"button",onClick:()=>{h("email"),S(null),k(null)},className:"w-full cursor-pointer text-center text-xs text-[#666] transition-colors hover:text-[#aaa]",children:"Use a different email"})]}),d==="sending"&&g.jsxs("div",{className:"flex flex-col items-center gap-3 py-8",children:[g.jsx(eh,{className:"h-6 w-6 animate-spin text-white","aria-hidden":"true"}),g.jsx("p",{className:"text-sm text-[#aaa]",children:"Generating and encrypting locally..."})]}),d==="password"&&g.jsxs("div",{className:"space-y-4",children:[g.jsxs("div",{className:"flex items-start gap-2.5 rounded-lg border border-emerald-500/30 bg-emerald-500/5 px-3 py-2.5",children:[g.jsx(Ls,{className:"mt-0.5 h-4 w-4 flex-shrink-0 text-emerald-400","aria-hidden":"true"}),g.jsxs("p",{className:"text-xs text-emerald-200",children:["Sent to ",$,". Open the attached PDF with this password."]})]}),g.jsxs("div",{children:[g.jsx("span",{className:"mb-1.5 block text-xs text-[#888]",children:"Your one-time password"}),g.jsxs("div",{className:"flex items-center gap-2 rounded-lg bg-black p-3",style:{border:"1px solid #2a2a2a"},children:[g.jsx("code",{className:"flex-1 break-all font-mono text-base text-white",children:E}),g.jsxs("button",{onClick:C,className:"flex cursor-pointer items-center gap-1 rounded-md px-2 py-1 text-xs text-[#aaa] transition-colors hover:bg-[rgba(255,255,255,0.06)] hover:text-white",style:{border:"1px solid #2a2a2a"},children:[U?g.jsx(Ls,{className:"h-3.5 w-3.5"}):g.jsx(to,{className:"h-3.5 w-3.5"}),U?"Copied":"Copy"]})]}),g.jsxs("p",{className:"mt-2 text-xs text-[#666]",children:["Save this now. Strix never stores it, so we cannot show it again. File:"," ",g.jsx("span",{className:"font-mono text-[#888]",children:B})]})]}),g.jsx("button",{onClick:t,className:"w-full cursor-pointer rounded-lg px-4 py-2.5 text-sm font-semibold text-white transition-colors hover:bg-[rgba(255,255,255,0.06)]",style:{border:"1px solid #2a2a2a"},children:"Done"})]})]})]})}const nH=[{icon:i_,text:"Continuous coverage: scheduled pentests and attack surface monitoring"},{icon:PT,text:"One-click autofix that opens a retested pull request"},{icon:u_,text:"Two-way sync to Jira, Linear, and Slack"},{icon:m_,text:"Your whole team, with roles and shared history"}];function iH({feature:e}){const t=e.icon;return g.jsx("div",{className:"mx-auto w-full max-w-lg",children:g.jsxs("div",{className:"rounded-2xl border border-[#222] bg-[rgba(255,255,255,0.02)] p-8 text-center",children:[g.jsx("div",{className:"mx-auto flex h-12 w-12 items-center justify-center rounded-xl",style:{border:"1px solid #2a2a2a",background:"rgba(255,255,255,0.04)"},children:g.jsx(t,{className:"h-5 w-5 text-[#888]","aria-hidden":"true"})}),g.jsx("div",{className:"mt-4 flex justify-center",children:g.jsx(ku,{label:e.tier})}),g.jsx("h2",{className:"mt-3 text-2xl font-semibold text-white",children:e.headline}),g.jsx("p",{className:"mx-auto mt-2 max-w-md text-sm text-[#888]",children:e.description}),g.jsxs("div",{className:"mt-6 rounded-xl p-4 text-left",style:{border:"1px solid #222",background:"rgba(255,255,255,0.02)"},children:[g.jsx("p",{className:"mb-3 text-xs font-semibold uppercase tracking-wide text-[#666]",children:"Included in Strix Pro"}),g.jsx("ul",{className:"space-y-2.5",children:nH.map(i=>{const a=i.icon;return g.jsxs("li",{className:"flex items-start gap-2.5",children:[g.jsx(a,{className:"mt-0.5 h-4 w-4 flex-shrink-0 text-[#888]","aria-hidden":"true"}),g.jsx("span",{className:"text-sm text-[#aaa]",children:i.text})]},i.text)})})]}),g.jsxs("div",{className:"mt-6 flex flex-col items-center gap-3",children:[g.jsxs("a",{href:Fs,target:"_blank",rel:"noopener noreferrer",onClick:()=>gi(e.slug),className:"inline-flex w-full items-center justify-center gap-1.5 rounded-lg bg-white px-4 py-2.5 text-sm font-semibold text-black transition-opacity hover:opacity-90",children:["Start free",g.jsx(Ds,{className:"h-3.5 w-3.5","aria-hidden":"true"})]}),g.jsxs("a",{href:QT,target:"_blank",rel:"noopener noreferrer",onClick:()=>gi(`${e.slug}_pricing`),className:"inline-flex items-center gap-1 text-xs text-[#888] transition-colors hover:text-white",children:["View all plans",g.jsx(Ds,{className:"h-3 w-3","aria-hidden":"true"})]})]})]})})}const rH="Your findings stay on your machine. They're rendered here locally in your browser and never uploaded or stored by Strix. Emailing a report is an explicit opt-in that sends an encrypted copy only you can open.",W1=["critical","high","medium","low"],aH=500,sH=[{title:"One-click autofix + open a fix PR",desc:"Fix it for you and open a PR, retested.",slug:"autofix",icon:lu},{title:"Export SOC 2 / ISO 27001 report",desc:"Share an auditor-ready report with your team.",slug:"compliance",icon:U2}],lH=[{title:"Scheduled pentesting",desc:"Continuous coverage for your whole org.",slug:"scheduled",icon:i_},{title:"Attack surface monitoring",desc:"Continuous coverage for your whole org.",slug:"asm",icon:d_},{title:"PR reviews",desc:"Pentest every pull request your team opens.",slug:"pr_reviews",icon:tp}];function oH(){const[e,t]=re.useState(null),[i,a]=re.useState(null),[s,o]=re.useState(null),[c,d]=re.useState(null),[h,f]=re.useState("overview"),[m,p]=re.useState(null),[y,x]=re.useState(null),[_,N]=re.useState(null),[S,w]=re.useState(!1),[k,E]=re.useState("report"),O=re.useCallback(async()=>{try{x(await $U())}catch{}},[]),B=re.useCallback(async()=>{try{N(await HU())}catch{}},[]);re.useEffect(()=>{O(),B()},[O,B]);const R=re.useRef(!1);re.useEffect(()=>{let j=!1,V;R.current=!1;const Q=()=>{V=setTimeout(M,aH)},M=async()=>{if(!j)try{const{summary:D,raw:G,finished:L}=await IN(e);if(j)return;if(L&&!R.current){R.current=!0;const Z=await K1(e);j||a(Z);return}const[F,H]=await Promise.all([UN(e).catch(()=>({agents:[],events:[]})),BN(D.runId,e).catch(()=>[])]);if(j)return;a(Z=>({summary:D,raw:G,finished:L,transcript:F,vulnerabilities:H,reportMarkdown:(Z==null?void 0:Z.reportMarkdown)??null})),Q()}catch(D){if(j)return;o(D instanceof Error?D.message:"Could not load run data."),Q()}};return(async()=>{try{const D=await K1(e);if(j)return;a(D),D.finished?R.current=!0:Q()}catch(D){if(j)return;o(D instanceof Error?D.message:"Could not load run data."),Q()}})(),()=>{j=!0,V&&clearTimeout(V)}},[e]);const U=re.useMemo(()=>i?BU(i.vulnerabilities):null,[i]),I=(i==null?void 0:i.vulnerabilities.find(j=>j.id===c))??null,K=(i==null?void 0:i.transcript.agents.length)??0,z=(y==null?void 0:y.verified)===!0,q=re.useCallback(j=>{t(j),d(null),a(null),o(null),f("overview")},[]),X=re.useCallback(()=>{gi("email_report"),E("report"),w(!0)},[]),Y=re.useCallback(()=>{gi("history_unlock"),E("verify"),w(!0)},[]),C=re.useCallback(()=>{B(),f("history")},[B]),$=re.useCallback(j=>{gi(`nav_${j}`),p(j),f("feature")},[]),A=re.useCallback(async()=>{await FU(),await O(),await B()},[O,B]);return g.jsxs("div",{className:"min-h-screen bg-black text-white flex",children:[g.jsx(XU,{view:h,onSelectView:j=>{j==="history"?C():f(j)},activeFeature:m,onSelectFeature:$,issuesCount:(i==null?void 0:i.vulnerabilities.length)??0,agentCount:K,runCount:(_==null?void 0:_.count)??0,verified:z,email:(y==null?void 0:y.email)??null,onOpenEmail:X,onOpenHistory:C,onForget:()=>void A()}),g.jsxs("div",{className:"flex-1 min-w-0",children:[g.jsx("div",{className:"border-b border-[#222]",children:g.jsxs("div",{className:"max-w-[72rem] mx-auto px-6 py-4 flex items-center gap-1.5",children:[g.jsxs("a",{href:"https://app.strix.ai",target:"_blank",rel:"noopener noreferrer",onClick:()=>gi("logo"),className:"flex items-center gap-1.5 opacity-90 transition-opacity hover:opacity-100 lg:hidden",title:"Open Strix Cloud",children:[g.jsx("img",{src:"./logo.png",alt:"Strix",className:"w-10 h-8 object-cover"}),g.jsx("div",{className:"text-base text-white font-medium tracking-tight",children:"Strix"})]}),g.jsx("span",{className:"text-xs text-[#666]",children:"Local results"}),i&&g.jsx(uH,{finished:i.finished}),g.jsxs("div",{className:"ml-auto flex items-center gap-3",children:[z&&_&&!_.locked&&_.runs.length>0&&g.jsx(cH,{runs:_,activeRun:e,launchedName:(i==null?void 0:i.summary.runName)??(i==null?void 0:i.summary.runId)??"Current run",onSelect:q}),g.jsxs("a",{href:Fs,target:"_blank",rel:"noopener noreferrer",onClick:()=>gi("run_in_cloud"),className:"inline-flex items-center gap-1 rounded-lg bg-white px-3 py-1.5 text-xs font-semibold text-black transition-opacity hover:opacity-90",children:["Run in the cloud",g.jsx(Ds,{className:"w-3 h-3","aria-hidden":"true"})]})]})]})}),g.jsxs("div",{className:"max-w-[72rem] mx-auto px-6 py-8 space-y-6",children:[h!=="feature"&&g.jsxs("div",{className:"rounded-lg px-4 py-3 flex gap-3 items-start",style:{border:"1px solid rgba(255,255,255,0.08)"},children:[g.jsx(rp,{className:"w-5 h-5 flex-shrink-0 mt-0.5 text-emerald-400","aria-hidden":"true"}),g.jsx("p",{className:"text-sm text-[#aaa] leading-relaxed",children:rH})]}),s&&!i&&h!=="history"&&g.jsxs("div",{className:"rounded-lg px-4 py-3 flex gap-3 items-start border border-red-500/30 bg-red-500/5",children:[g.jsx(a_,{className:"w-5 h-5 flex-shrink-0 mt-0.5 text-red-400","aria-hidden":"true"}),g.jsx("p",{className:"text-sm text-red-300",children:s})]}),h==="feature"&&m&&Jm[m]?g.jsx(iH,{feature:Jm[m]}):h==="history"?g.jsxs("div",{className:"space-y-4",children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx(zs,{className:"w-5 h-5 text-[#888]","aria-hidden":"true"}),g.jsx("h1",{className:"text-2xl font-semibold text-white",children:"Past runs"})]}),g.jsx(QU,{runs:_,activeRun:e,onSelectRun:q,onVerifyClick:Y})]}):!i&&!s?g.jsxs("div",{className:"rounded-xl border border-[#222] bg-[rgba(255,255,255,0.02)] p-10 text-center",children:[g.jsx("div",{className:"w-6 h-6 mx-auto mb-3 rounded-full border-2 border-[#333] border-t-white animate-spin"}),g.jsx("p",{className:"text-sm text-[#888]",children:"Loading run data…"})]}):i&&U?g.jsxs(g.Fragment,{children:[g.jsx(fH,{summary:i.summary}),g.jsxs("div",{className:"flex gap-5 border-b border-[#2a2a2a] lg:hidden",children:[g.jsx(_m,{active:h==="overview",onClick:()=>f("overview"),children:"Overview"}),g.jsxs(_m,{active:h==="issues",onClick:()=>f("issues"),children:["Issues",i.vulnerabilities.length>0?` (${i.vulnerabilities.length})`:""]}),K>0&&g.jsxs(_m,{active:h==="agents",onClick:()=>f("agents"),children:["Agents (",K,")"]})]}),h==="overview"?g.jsx(bH,{summary:i.summary,counts:U,total:i.vulnerabilities.length,reportMarkdown:i.reportMarkdown,onOpenEmail:X}):h==="agents"&&K>0?g.jsx(xH,{run:i}):I?g.jsxs("div",{className:"space-y-4",children:[g.jsxs("button",{onClick:()=>d(null),className:"cursor-pointer inline-flex items-center gap-1.5 text-sm text-[#888] hover:text-white transition-colors",children:[g.jsx(r2,{className:"w-4 h-4"})," Back to all findings"]}),g.jsx(N4,{vulnerability:I})]}):g.jsx(hH,{vulnerabilities:i.vulnerabilities,finished:i.finished,onSelect:j=>d(j)})]}):null]})]}),g.jsx(tH,{open:S,onClose:()=>w(!1),activeRun:e,auth:y,purpose:k,onVerified:()=>{O(),B()}})]})}function cH({runs:e,activeRun:t,launchedName:i,onSelect:a}){const[s,o]=re.useState(!1),c=t??i;return g.jsxs("div",{className:"relative",children:[g.jsxs("button",{onClick:()=>o(d=>!d),onBlur:()=>setTimeout(()=>o(!1),150),className:"flex items-center gap-1.5 rounded-lg px-2.5 py-1.5 text-xs text-[#aaa] transition-colors hover:text-white",style:{border:"1px solid #2a2a2a"},children:[g.jsx(zs,{className:"w-3.5 h-3.5","aria-hidden":"true"}),g.jsx("span",{className:"max-w-[160px] truncate",children:c}),g.jsx(r_,{className:"w-3.5 h-3.5","aria-hidden":"true"})]}),s&&g.jsx("div",{className:"absolute right-0 z-50 mt-1.5 max-h-80 w-64 overflow-y-auto rounded-lg py-1 shadow-xl",style:{border:"1px solid #2a2a2a",background:"#0a0a0a"},children:e.runs.map(d=>{const h=d.name===t;return g.jsxs("button",{onMouseDown:()=>a(d.name),className:`flex w-full items-center gap-2 px-3 py-2 text-left text-xs transition-colors hover:bg-[rgba(255,255,255,0.06)] ${h?"text-white":"text-[#aaa]"}`,children:[g.jsxs("span",{className:"min-w-0 flex-1",children:[g.jsx("span",{className:"block truncate",children:d.name}),d.target&&g.jsx("span",{className:"block truncate font-mono text-[#666]",children:d.target})]}),h&&g.jsx("span",{className:"h-1.5 w-1.5 flex-shrink-0 rounded-full bg-emerald-400"})]},d.name)})})]})}function uH({finished:e}){return e?g.jsxs("span",{className:"ml-3 inline-flex items-center gap-1.5 text-xs text-[#888]",children:[g.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-[#555]"}),"Complete"]}):g.jsxs("span",{className:"ml-3 inline-flex items-center gap-1.5 text-xs text-emerald-400",children:[g.jsxs("span",{className:"relative flex h-1.5 w-1.5",children:[g.jsx("span",{className:"absolute inline-flex h-full w-full rounded-full bg-emerald-400 opacity-75 animate-ping"}),g.jsx("span",{className:"relative inline-flex h-1.5 w-1.5 rounded-full bg-emerald-400"})]}),"Live"]})}function dH(e){if(e==null)return null;if(e<60)return`${e}s`;const t=Math.floor(e/60);return t<60?`${t}m`:`${Math.floor(t/60)}h ${t%60}m`}function fH({summary:e}){const t=dH(e.durationSeconds);return g.jsxs("div",{children:[g.jsx("h1",{className:"text-2xl font-semibold text-white",children:e.runName??e.runId??"Scan results"}),g.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-x-3 gap-y-1 text-sm text-[#888]",children:[e.targets.length>0&&g.jsx("span",{className:"font-mono text-[#aaa]",children:e.targets.join(", ")}),e.scanMode&&g.jsx(vm,{label:e.scanMode}),t&&g.jsx(vm,{label:t}),e.status&&g.jsx(vm,{label:e.status})]})]})}function vm({label:e}){return g.jsxs(g.Fragment,{children:[g.jsx("span",{className:"text-[#333]",children:"·"}),g.jsx("span",{className:"capitalize",children:e})]})}function hH({vulnerabilities:e,finished:t,onSelect:i}){const a=[...e].sort((s,o)=>W1.indexOf(s.severity)-W1.indexOf(o.severity));return a.length===0?g.jsxs("div",{className:"space-y-4",children:[g.jsx("div",{className:"rounded-xl border border-[#222] bg-[rgba(255,255,255,0.02)] p-8 text-center text-sm text-[#888]",children:t?"No findings in this run.":"No findings yet. The scan is still running…"}),t&&g.jsxs("div",{className:"rounded-xl border border-[#222] bg-[rgba(255,255,255,0.02)] p-5",children:[g.jsx("p",{className:"text-sm font-medium text-white",children:"Stay ahead of new exposures"}),g.jsx("p",{className:"mt-0.5 mb-3 text-xs text-[#666]",children:"Attack surface monitoring catches new exposures for your org over time."}),g.jsx(Ms,{label:"Attack surface monitoring",desc:"Continuous coverage for your whole org.",slug:"asm",icon:d_})]})]}):g.jsx("div",{className:"space-y-2",children:a.map(s=>g.jsxs("button",{onClick:()=>i(s.id),className:"cursor-pointer w-full text-left rounded-lg border border-[#222] hover:border-[#444] bg-[rgba(255,255,255,0.02)] px-4 py-3 transition-colors flex items-center gap-3",children:[g.jsx("span",{className:`w-2.5 h-2.5 rounded-full flex-shrink-0 ${ap(s.severity)}`,"aria-hidden":"true"}),g.jsxs("span",{className:"flex-1 min-w-0",children:[g.jsx("span",{className:"block text-sm font-medium text-white truncate",children:s.title}),s.target&&g.jsx("span",{className:"block text-xs text-[#666] font-mono truncate",children:s.target})]}),g.jsx("span",{className:`text-xs font-semibold px-2 py-0.5 rounded-full border capitalize ${b_[s.severity]}`,children:s.severity})]},s.id))})}function mH(e){return e.replace(/^\s*#{1,6}[ \t]+.*(?:\r?\n)+/,"").trimStart()}function pH(e){const t=[];let i=null;for(const a of e.split(` `)){const s=a.match(/^#{1,6}\s+(.*)$/);if(s){const o=s[1].trim().toLowerCase();if(o===i)continue;i=o}else a.trim()!==""&&(i=null);t.push(a)}return t.join(` `)}function gH({onOpenEmail:e}){return g.jsx("button",{onClick:e,className:"group w-full cursor-pointer rounded-xl border border-emerald-500/25 bg-emerald-500/[0.06] p-4 text-left transition-colors hover:border-emerald-500/40",children:g.jsxs("div",{className:"flex items-center gap-3",children:[g.jsx("div",{className:"flex h-9 w-9 flex-shrink-0 items-center justify-center rounded-lg",style:{border:"1px solid rgba(16,185,129,0.3)",background:"rgba(16,185,129,0.08)"},children:g.jsx(ip,{className:"h-4 w-4 text-emerald-400","aria-hidden":"true"})}),g.jsxs("div",{className:"min-w-0 flex-1",children:[g.jsx("p",{className:"text-sm font-semibold text-white",children:"Email an encrypted PDF report of this run"}),g.jsx("p",{className:"mt-0.5 text-xs text-[#888]",children:"Encrypted with a key only you can see, email verified with a one-time code before sending."})]}),g.jsx("span",{className:"flex-shrink-0 rounded-lg bg-white px-3 py-1.5 text-xs font-semibold text-black transition-opacity group-hover:opacity-90",children:"Email report"})]})})}function bH({summary:e,counts:t,total:i,reportMarkdown:a,onOpenEmail:s}){const o=[["Executive Summary",e.executiveSummary],["Technical Analysis",e.technicalAnalysis],["Methodology",e.methodology],["Recommendations",e.recommendations]].filter(([,c])=>!!c).map(([c,d])=>({title:c,content:mH(d)}));return g.jsxs("div",{className:"space-y-6",children:[i>0&&g.jsx("div",{className:"rounded-xl border border-[#222] bg-[rgba(255,255,255,0.02)] p-5",children:g.jsx(S4,{findings:{total:i,...t}})}),g.jsx(gH,{onOpenEmail:s}),o.length>0?g.jsx("div",{className:"rounded-xl border border-[#222] bg-[rgba(255,255,255,0.02)] p-5 space-y-8",children:o.map(c=>g.jsx(na,{title:c.title,content:c.content},c.title))}):a?g.jsx("div",{className:"rounded-xl border border-[#222] bg-[rgba(255,255,255,0.02)] p-5",children:g.jsx(na,{content:pH(a)})}):i===0&&g.jsx("p",{className:"text-sm text-[#888]",children:"No summary available for this run yet."}),g.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:sH.map(c=>g.jsx(Hx,{item:c},c.slug))}),g.jsxs("div",{children:[g.jsx("p",{className:"mb-2 text-sm font-semibold text-white",children:"Continuous coverage for your org"}),g.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-3",children:lH.map(c=>g.jsx(Hx,{item:c},c.slug))})]})]})}function _m({active:e,onClick:t,children:i}){return g.jsxs("button",{onClick:t,className:`cursor-pointer relative pb-2.5 text-sm font-semibold transition-colors ${e?"text-white":"text-[#666] hover:text-white"}`,children:[i,e&&g.jsx("span",{className:"absolute bottom-0 inset-x-0 h-0.5 bg-white rounded-full"})]})}function xH({run:e}){const{agents:t,events:i}=e.transcript,a=re.useMemo(()=>SU(t,i),[t,i]),[s,o]=re.useState(null),c=s?t.find(d=>d.id===s)??null:null;return g.jsxs("div",{className:"space-y-5",children:[g.jsxs("div",{className:"rounded-xl border border-[#222] bg-[rgba(255,255,255,0.02)] p-5",children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx(p_,{className:"w-4 h-4 text-[#888]","aria-hidden":"true"}),g.jsx("h2",{className:"text-sm font-semibold text-white",children:"Agent graph"}),g.jsxs("span",{className:"text-xs text-[#666]",children:[t.length," agent",t.length===1?"":"s"]})]}),g.jsx("p",{className:"mt-1 mb-4 text-xs text-[#666]",children:"Click an agent to open its full transcript."}),g.jsx("div",{className:"h-[480px] rounded-lg border border-[#1a1a1a] overflow-hidden",children:g.jsx(m9,{agents:a,selectedAgentId:s,onSelectAgent:d=>o(d),eventsLoaded:!0,eventsEmpty:a.size===0,scanCompleted:e.finished})})]}),g.jsxs("div",{className:"rounded-xl border border-[#222] bg-[rgba(255,255,255,0.02)] p-5",children:[g.jsx("p",{className:"text-sm font-semibold text-white",children:"Drive the agents live"}),g.jsx("p",{className:"mt-0.5 text-xs text-[#666]",children:"Steer and re-run this scan from the web."}),g.jsxs("div",{className:"mt-3 flex flex-wrap gap-2.5",children:[g.jsx(Ms,{label:"Steer agents from the web",desc:"Guide the agents live while they scan.",slug:"live_scan_prompt",icon:ET}),g.jsx(Ms,{label:"Re-run in Strix Cloud with more depth",desc:"Run this scan on managed infra with more depth.",slug:"live_scan",icon:TT})]})]}),c&&g.jsx(CU,{agent:c,events:i,onClose:()=>o(null)})]})}Qk.createRoot(document.getElementById("root")).render(g.jsx(re.StrictMode,{children:g.jsx(oH,{})})); diff --git a/strix/viewer/viewer_dist/index.html b/strix/viewer/viewer_dist/index.html index 71647b06..da71430a 100644 --- a/strix/viewer/viewer_dist/index.html +++ b/strix/viewer/viewer_dist/index.html @@ -6,7 +6,7 @@ Strix Results - + diff --git a/strix/viewer_src/src/App.tsx b/strix/viewer_src/src/App.tsx index d84d536d..db522b3c 100644 --- a/strix/viewer_src/src/App.tsx +++ b/strix/viewer_src/src/App.tsx @@ -273,11 +273,13 @@ export default function App() {
- {/* Trust banner */} -
-
+ {/* Trust banner (not on the Pro feature upsell pages) */} + {view !== "feature" && ( +
+
+ )} {error && !run && view !== "history" && (