From 27d75d9e499546500d94ce7056d0bd12bff4e072 Mon Sep 17 00:00:00 2001 From: Jonathan Singer Date: Mon, 20 Jul 2026 22:27:57 -0400 Subject: [PATCH] Trim the privacy toast to the local-only promise --- .../viewer_dist/assets/{index-5M4xOhKX.js => index-B_UeT2c7.js} | 2 +- strix/viewer/viewer_dist/index.html | 2 +- strix/viewer_src/src/App.tsx | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) rename strix/viewer/viewer_dist/assets/{index-5M4xOhKX.js => index-B_UeT2c7.js} (98%) diff --git a/strix/viewer/viewer_dist/assets/index-5M4xOhKX.js b/strix/viewer/viewer_dist/assets/index-B_UeT2c7.js similarity index 98% rename from strix/viewer/viewer_dist/assets/index-5M4xOhKX.js rename to strix/viewer/viewer_dist/assets/index-B_UeT2c7.js index 7aaff940..e676d49c 100644 --- a/strix/viewer/viewer_dist/assets/index-5M4xOhKX.js +++ b/strix/viewer/viewer_dist/assets/index-B_UeT2c7.js @@ -512,6 +512,6 @@ https://github.com/highlightjs/highlight.js/issues/2277`),Ht=ye,ft=Le),Qe===void ... more content available`:"")})})()]})}function mU({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,f=d?d.error??null:null,h=d?d.status_code??null:null,m=d?d.response_time_ms??null:null,p=d?d.body:null,x=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 ${ZN[i]??"text-[#888]"}`,children:i}),g.jsx("span",{className:"text-[#888] ml-1 break-all",children:Yi(a,180)})]}),s&&typeof s=="object"&&Object.entries(s).slice(0,5).map(([y,_])=>g.jsxs("div",{className:"text-[#555] pl-5",children:[y,": ",cp(String(_),150)]},y))]}),c&&g.jsx(vr,{className:"text-[#888]",children:up(c,4)}),f&&g.jsx("div",{className:"text-red-400/70 text-[13px] mt-1.5",children:cp(f,150)}),h!=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 ${cg(h)}`,children:h}),m!=null&&g.jsxs("span",{className:"text-[#555] ml-2",children:[m,"ms"]})]}),x&&g.jsx(vr,{className:"text-[#666]",children:up(x,6)})]})}function pU({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,f=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(([h,m])=>g.jsxs("div",{children:[g.jsxs("span",{className:"text-orange-400/60",children:[h,":"]})," ",g.jsx("span",{className:"text-[#777]",children:cp(typeof m=="string"?m:JSON.stringify(m),150)})]},h))}),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 ${cg(o)}`,children:o}),c!=null&&g.jsxs("span",{className:"text-[#555] ml-2",children:[c,"ms"]})]}),f&&g.jsx(vr,{className:"text-[#666]",children:up(f,5)})]})}const gU={get:"getting",list:"listing",create:"creating",update:"updating",delete:"deleting"};function bU({args:e}){const t=e.action??"",i=e.scope_name??"",a=gU[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:Yi(i,50)})]})}function xU({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 #",Yi(String(t),20)]})]})}function yU({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:["#",Yi(String(t),20)]})]})}function vU(e){switch(e.toolName){case"list_requests":return g.jsx(fU,{...e});case"view_request":return g.jsx(hU,{...e});case"send_request":return g.jsx(mU,{...e});case"repeat_request":return g.jsx(pU,{...e});case"scope_rules":return g.jsx(bU,{...e});case"list_sitemap":return g.jsx(xU,{...e});case"view_sitemap_entry":return g.jsx(yU,{...e});default:return g.jsx("span",{className:"text-purple-400/80 font-semibold text-sm",children:e.toolName.replace(/_/g," ")})}}function _U({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 wU({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 EU({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 NU=50,r_=200,a_=25,s_=24,SU=/\x1b(?:[@-Z\\-_]|\[[0-?]*[ -/]*[@-~]|\][^\x07]*\x07)/g,kU=/\.\.\. \[(stdout|stderr|result|output|error) truncated at \d+k? chars\]/g;function TU(e){return e.replace(SU,"")}function Om(e){const t=TU(e);return t.length>r_?t.slice(0,r_-3)+"...":t}function AU(e){return e.replace(kU,"").trim()}function CU(e){const t=e.split(` `);if(t.length<=NU)return t.map(Om).join(` `);const i=t.length-a_-s_;return[...t.slice(0,a_).map(Om),`... ${i} lines truncated ...`,...t.slice(-s_).map(Om)].join(` -`)}function MU({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?CU(AU(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(lg,{code:a,language:"python",collapsible:!0}),d&&g.jsx(vr,{className:"text-[#666]",children:d})]})}function OU({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 RU({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 DU(e){return e.toolName==="subagent_start_info"?g.jsx(RU,{...e}):g.jsx(OU,{...e})}function jU({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 LU({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(Us,{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(Us,{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(Us,{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(Us,{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 zU={create_todo:{label:"Task added",Icon:KT},list_todos:{label:"Plan",Icon:B2},update_todo:{label:"Task updated",Icon:YT},mark_todo_done:{label:"Task completed",Icon:S_},mark_todo_pending:{label:"Task reopened",Icon:iA},delete_todo:{label:"Task removed",Icon:hA}};function IU({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(K2,{className:"w-3.5 h-3.5 text-purple-400/70 shrink-0 animate-pulse"}):g.jsx(Q2,{className:"w-3.5 h-3.5 text-[#444] shrink-0"})}function BU({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(IU,{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=zU[e]??{label:"Plan",Icon:JT},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,f;if(o&&typeof o=="object"){if(d=o.error??null,o.success){const m=o.todos;c=Array.isArray(m)?m:[]}f=o.id??t.todo_id??void 0}const h=e!=="list_todos"?f: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(BU,{todos:c,highlightId:h})})]})}function l_(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 QN({toolName:e,args:t,result:i}){const a=l_(t),s=l_(i);return g.jsxs("div",{children:[g.jsx("span",{className:"text-[#888] font-semibold text-sm",children:e.replace(/_/g," ")}),a&&g.jsx(vr,{className:"text-[#777]",children:a}),s&&g.jsx(vr,{className:"text-[#666]",children:s})]})}function HU({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 rd={terminal:{renderer:W9,icon:R_,color:"text-emerald-400"},python:{renderer:MU,icon:eT,color:"text-yellow-400"},browser:{renderer:eU,icon:pp,color:"text-blue-400"},filesystem:{renderer:tU,icon:T_,color:"text-sky-400"},proxy:{renderer:vU,icon:Ps,color:"text-purple-400",match:/request|sitemap|scope/},reporting:{renderer:dU,icon:sA,color:"text-red-400"},thinking:{renderer:_U,icon:w_,color:"text-purple-400"},agents:{renderer:wU,icon:fp,color:"text-cyan-400",match:/agent/},search:{renderer:EU,icon:O_,color:"text-amber-400"},lifecycle:{renderer:DU,icon:A_,color:"text-emerald-400"},notes:{renderer:LU,icon:uA,color:"text-amber-400",match:/note/},skills:{renderer:HU,icon:_u,color:"text-emerald-400"},todos:{renderer:UU,icon:MT,color:"text-purple-400",match:/todo/},telemetry:{renderer:QN,icon:_u,color:"text-[#555]"}},$U={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"]},qU=Object.fromEntries(Object.entries($U).flatMap(([e,t])=>t.map(i=>[i,e]))),PU={finish_scan:jU,apply_patch:oU,view_image:cU},FU={agent_finish:{icon:A_,color:"text-cyan-400"},send_message_to_agent:{icon:W0,color:"text-cyan-400"},wait_for_message:{icon:W0,color:"text-cyan-400"},view_agent_graph:{icon:lT,color:"text-cyan-400"},stop_agent:{icon:__,color:"text-red-400"},scan_start_info:{icon:iT,color:"text-emerald-400"},subagent_start_info:{icon:fp,color:"text-purple-400"},view_image:{icon:wT,color:"text-sky-400"}},GU=rd.telemetry;function WN(e){var i;const t=qU[e];if(t)return t;for(const[a,s]of Object.entries(rd))if((i=s.match)!=null&&i.test(e))return a;return null}function VU(e){const t=PU[e];if(t)return t;const i=WN(e);return i?rd[i].renderer:QN}function YU(e){const t=FU[e];if(t)return t;const i=WN(e),a=i?rd[i]:GU;return{icon:a.icon,color:a.color}}const XU=30;function KU({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:XU})})]})}class ZU extends ee.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 QU(e){const t=VU(e.toolName);return g.jsx(ZU,{toolName:e.toolName,children:g.jsx(t,{...e})})}function JN(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 eS(e){const t=JN(e);return t&&typeof t=="object"&&!Array.isArray(t)?t:t==null?{}:{__raw:typeof t=="string"?t:JSON.stringify(t)}}function o_(e){const t=/(\d+)$/.exec(e);return t?parseInt(t[1],10):0}function ug(e){var i;const t=(i=e.data)==null?void 0:i.role;return e.type==="chat"&&(t==="user"||t==="human")}function WU(e){var t;return ug(e)&&String(((t=e.data)==null?void 0:t.content)??"").startsWith("[Message from ")}function JU(e){const t=new Set;let i=!1;for(const a of e)if(ug(a)){if(WU(a)){t.add(a.id);continue}i||(i=!0,t.add(a.id))}return t}const e7={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 t7(e){return e==="completed"?"completed":e==="running"?"running":e==="failed"||e==="crashed"?"failed":e}function n7(e,t){var d;const i=new Map;for(const f of e)if(f.parent_id){const h=i.get(f.parent_id)??[];h.push(f.id),i.set(f.parent_id,h)}const a=new Map,s=new Map,o=new Map;for(const f of t)if(f.type==="tool"){if(a.set(f.agent_id,(a.get(f.agent_id)??0)+1),((d=f.data)==null?void 0:d.tool_name)==="create_agent"){const h=eS(f.data.args),m=h.name??h.agent_name??"",p=h.task??"";m&&p&&o.set(m,p)}}else ug(f)||s.set(f.agent_id,(s.get(f.agent_id)??0)+1);const c=new Map;for(const f of e)c.set(f.id,{id:f.id,name:f.name,task:o.get(f.name)??"",status:t7(f.status),parentId:f.parent_id,children:i.get(f.id)??[],createdAt:f.created_at,toolCount:a.get(f.id)??0,messageCount:s.get(f.id)??0});return c}function i7({agent:e,events:t,showHeader:i=!0}){const a=ee.useMemo(()=>{const c=t.filter(f=>f.agent_id===e.id).sort((f,h)=>o_(f.id)-o_(h.id)),d=JU(c);return c.filter(f=>!d.has(f.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 ${e7[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,M;const f=d===a.length-1,h=c.type==="tool",m=h?String(((N=c.data)==null?void 0:N.tool_name)??"tool"):"",p=h?"":String(((S=c.data)==null?void 0:S.role)??"assistant");let x,y;if(h){const U=YU(m);x=U.icon,y=U.color}else{const U=p==="user"||p==="human";x=U?fp:w_,y=U?"text-blue-400":"text-purple-400"}const _=h?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 ${h&&_==="running"?"border-blue-500/40 animate-pulse":h&&_==="failed"?"border-red-500/30":"border-[#222]"}`,children:g.jsx(x,{className:`w-3.5 h-3.5 ${y}`})}),!f&&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:h?g.jsx(QU,{toolName:m,args:eS((k=c.data)==null?void 0:k.args),result:JN((E=c.data)==null?void 0:E.result)??null,status:_}):g.jsx(KU,{role:p,content:String(((M=c.data)==null?void 0:M.content)??"")})})]},c.id)})})]})}class Uu extends Error{constructor(t){super(t),this.name="RunParseError"}}const r7=["critical","high","medium","low"];function a7(e){const t=String(e??"").toLowerCase().trim();return r7.includes(t)?t:"low"}function s7(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 l7(e){return typeof e=="number"&&Number.isFinite(e)?e:null}function tS(e,t){try{return JSON.parse(e)}catch{throw new Uu(`${t} isn't valid JSON. Make sure you selected a Strix run directory.`)}}function o7(e){const t=tS(e,"run.json");if(!t||typeof t!="object"||Array.isArray(t))throw new Uu("run.json is not an object.");const i=t,a=[],s=i.targets_info;if(Array.isArray(s)){for(const y of s)if(y&&typeof y=="object"){const _=y.original;typeof _=="string"&&_&&a.push(_)}}const o=Ot(i.start_time),c=Ot(i.end_time);let d=null;if(o&&c){const y=new Date(o).getTime(),_=new Date(c).getTime();!Number.isNaN(y)&&!Number.isNaN(_)&&_>=y&&(d=Math.round((_-y)/1e3))}let f=null,h=null,m=null,p=null;const x=i.scan_results;if(x&&typeof x=="object"){const y=x;f=Ot(y.executive_summary),h=Ot(y.technical_analysis),m=Ot(y.methodology),p=Ot(y.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:f,technicalAnalysis:h,methodology:m,recommendations:p}}function c7(){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 u7(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{...c7(),id:Ot(e.id)??`vuln-${t+1}`,scan_id:i,title:Ot(e.title)??"Untitled finding",description:Ot(e.description)??"",severity:a7(e.severity),status:"open",created_at:s7(e.timestamp),cve:Ot(e.cve),cvss:l7(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 d7(e,t=null){const i=tS(e,"vulnerabilities.json");if(!Array.isArray(i))throw new Uu("vulnerabilities.json is not a JSON array.");return i.map((a,s)=>{if(!a||typeof a!="object")throw new Uu(`vulnerabilities.json entry #${s+1} is not an object.`);return u7(a,s,t)})}function f7(e){const t={critical:0,high:0,medium:0,low:0};for(const i of e)t[i.severity]+=1;return t}async function Za(e){const t=await fetch(e,{cache:"no-store"});if(!t.ok)throw new Error(`${e} responded ${t.status}`);return t.json()}function ad(e){return e?`?run=${encodeURIComponent(e)}`:""}async function nS(e){const t=await Za("/api/run"+ad(e)),i=o7(JSON.stringify(t)),a=t.finished===!0;return{summary:i,raw:t,finished:a}}async function iS(e,t){const i=await Za("/api/vulnerabilities"+ad(t));return d7(JSON.stringify(i),e)}async function h7(e){const t=await Za("/api/report"+ad(e));return(t==null?void 0:t.markdown)??null}async function rS(e){const t=await Za("/api/transcript"+ad(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 c_(e){const{summary:t,raw:i,finished:a}=await nS(e),[s,o,c]=await Promise.all([iS(t.runId,e).catch(()=>[]),h7(e).catch(()=>null),rS(e).catch(()=>({agents:[],events:[]}))]);return{summary:t,raw:i,finished:a,vulnerabilities:s,reportMarkdown:o,transcript:c}}async function Uo(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 m7(){const e=await Za("/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 p7(){const e=await Za("/api/capabilities");return{can_steer:(e==null?void 0:e.can_steer)===!0}}async function g7(e,t){const{ok:i,data:a}=await Uo("/api/agents/steer",{agent_id:e,message:t});return i&&a.ok===!0?{ok:!0}:{ok:!1,error:String(a.error??"unavailable")}}async function b7(){const e=await Za("/api/auth/status");return{verified:(e==null?void 0:e.verified)===!0,email:(e==null?void 0:e.email)??null}}async function aS(e){const{ok:t,data:i}=await Uo("/api/auth/otp/start",{email:e});return t&&i.ok===!0?{ok:!0}:{ok:!1,error:String(i.error??"unavailable")}}async function sS(e,t){const{ok:i,data:a}=await Uo("/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 x7(){await Uo("/api/auth/forget",{})}async function y7(e){const{ok:t,data:i}=await Uo("/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 Ls="__root__";function lS({agents:e,fixedAgentId:t,className:i}){const a=ee.useRef(null),[s,o]=ee.useState(!1),[c,d]=ee.useState(!1),[f,h]=ee.useState(""),[m,p]=ee.useState(!1),[x,y]=ee.useState(null),_=t!=null,N=ee.useMemo(()=>e.find(z=>!z.parent_id)??e[0]??null,[e]),S=ee.useMemo(()=>e.filter(z=>z.parent_id&&z.status==="running"),[e]),[w,k]=ee.useState(Ls),[E,M]=ee.useState(!1);ee.useEffect(()=>{w!==Ls&&!S.some(z=>z.id===w)&&k(Ls)},[w,S]);const{targetId:U,targetName:R}=ee.useMemo(()=>{if(_){const V=e.find(G=>G.id===t)??null;return{targetId:t??null,targetName:(V==null?void 0:V.name)??"this agent"}}if(w===Ls)return{targetId:(N==null?void 0:N.id)??null,targetName:"Root agent"};const z=e.find(V=>V.id===w)??null;return{targetId:(z==null?void 0:z.id)??(N==null?void 0:N.id)??null,targetName:(z==null?void 0:z.name)??"Root agent"}},[e,t,_,N,w]),B=f.trim().length===0;ee.useLayoutEffect(()=>{const z=a.current;z&&(z.style.height="auto",z.style.height=`${z.scrollHeight}px`)},[f]);const I=ee.useCallback(()=>{o(!0),requestAnimationFrame(()=>{var z;return(z=a.current)==null?void 0:z.focus()})},[]),Z=ee.useCallback(()=>{o(!1),d(!1),M(!1)},[]),j=ee.useCallback(async()=>{if(m)return;const z=f.trim();if(!z||!U)return;p(!0),y(null);const V=R,G=await g7(U,z);p(!1),G.ok?(h(""),y(`Sent to ${V}`),Ti("agent_steered")):G.error==="not_delivered"?y("Could not reach that agent (it may have finished)."):y("Could not send that message. Try again.")},[m,f,U,R]);return s?g.jsxs("div",{className:la("mt-4 rounded-2xl border border-white/[0.08] bg-[#050505] overflow-hidden transition-colors duration-300",c?"border-white/[0.18]":"hover:border-white/[0.12]",i),children:[g.jsxs("div",{className:"flex items-center justify-between gap-3 border-b border-white/[0.06] px-5 py-3",children:[g.jsxs("div",{className:"min-w-0",children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx(J0,{className:"h-4 w-4 text-[#666]"}),g.jsx("p",{className:"text-sm font-medium text-white",children:"Live prompt"})]}),g.jsx("p",{className:"mt-0.5 text-xs text-[#777]",children:"Connected"})]}),g.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[_?g.jsxs("div",{className:"rounded-full border border-white/[0.08] bg-white/[0.03] px-3 py-1 text-xs text-[#aaa]",children:["Target: ",g.jsx("span",{className:"text-white",children:R})]}):g.jsxs("div",{className:"flex items-center gap-1.5",children:[g.jsx("span",{className:"text-xs text-[#aaa]",children:"Target:"}),g.jsxs("div",{className:"relative",children:[g.jsxs("button",{type:"button",onClick:()=>M(z=>!z),onBlur:()=>requestAnimationFrame(()=>M(!1)),className:"inline-flex h-7 items-center gap-1 rounded-full border border-white/[0.08] bg-white/[0.03] px-3 text-xs text-white transition-colors hover:border-white/[0.16] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white/20","aria-haspopup":"listbox","aria-expanded":E,children:[g.jsx("span",{className:"max-w-[140px] truncate",children:R}),g.jsx(fo,{className:"h-3.5 w-3.5 text-[#999]"})]}),E&&g.jsxs("div",{className:"absolute right-0 z-10 mt-1 min-w-[160px] overflow-hidden rounded-lg border border-[#333] bg-[#0a0a0a] py-1 shadow-xl",role:"listbox",children:[g.jsx(u_,{label:"Root agent",active:w===Ls,onSelect:()=>{k(Ls),M(!1)}}),S.map(z=>g.jsx(u_,{label:z.name,active:w===z.id,onSelect:()=>{k(z.id),M(!1)}},z.id))]})]})]}),g.jsx("button",{type:"button",onClick:Z,className:"inline-flex h-7 w-7 items-center justify-center rounded-full text-[#777] transition-colors hover:bg-white/[0.06] hover:text-white focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white/20","aria-label":"Collapse live prompt composer",children:g.jsx(fo,{className:"h-4 w-4"})})]})]}),g.jsx("div",{className:"px-5 pt-4 pb-3",children:g.jsx("textarea",{ref:a,rows:1,value:f,onChange:z=>h(z.target.value),onFocus:()=>d(!0),onBlur:()=>d(!1),onKeyDown:z=>{z.key==="Enter"&&!z.shiftKey&&(z.preventDefault(),j())},placeholder:"Send a live prompt to the running scan…",maxLength:4e3,disabled:m,className:"block w-full resize-none border-0 bg-transparent p-0 text-[15px] leading-6 text-white placeholder:text-[#444] focus:outline-none disabled:opacity-60 max-h-[160px] overflow-y-auto"})}),g.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 pb-4",children:[g.jsx("div",{className:"text-xs text-[#666]",children:x??"Press Enter to send."}),g.jsxs("button",{type:"button",onClick:z=>{z.stopPropagation(),j()},disabled:m||B,className:la("inline-flex h-10 min-w-[112px] items-center justify-center gap-2 rounded-full px-4 text-sm font-medium transition-colors",m||B?"bg-white/[0.08] text-[#666]":"bg-white text-black hover:bg-neutral-200"),children:[m?g.jsx(Hs,{className:"h-4 w-4 animate-spin"}):g.jsx(A2,{className:"h-4 w-4",strokeWidth:2.5}),g.jsx("span",{children:"Send prompt"})]})]})]}):g.jsxs("button",{type:"button",onClick:I,className:la("mt-4 flex w-full items-center justify-between gap-3 rounded-2xl border border-white/[0.08] bg-[#050505] px-5 py-3 text-left transition-colors duration-300 hover:border-white/[0.12] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white/20",i),"aria-expanded":!1,"aria-label":"Expand live prompt composer",children:[g.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[g.jsx(J0,{className:"h-4 w-4 shrink-0 text-[#666]"}),g.jsx("span",{className:"truncate text-sm font-medium text-white",children:"Guide the agent"})]}),g.jsx(N_,{className:"h-4 w-4 shrink-0 text-[#777]"})]})}function u_({label:e,active:t,onSelect:i}){return g.jsx("button",{type:"button",role:"option","aria-selected":t,onMouseDown:a=>{a.preventDefault(),i()},className:la("block w-full truncate px-3 py-1.5 text-left text-xs transition-colors hover:bg-white/[0.06]",t?"text-white":"text-[#aaa]"),children:e})}const v7={completed:"bg-emerald-400",running:"bg-blue-400",waiting:"bg-yellow-400",stopped:"bg-[#888]",crashed:"bg-red-400",failed:"bg-red-400"},_7=80;function w7({agent:e,events:t,steerable:i,onClose:a}){const s=ee.useRef(null),o=ee.useRef(!1),c=ee.useCallback(()=>{const d=s.current;d&&(o.current=d.scrollHeight-d.scrollTop-d.clientHeight<_7)},[]);return ee.useEffect(()=>{const d=s.current;!d||!o.current||requestAnimationFrame(()=>{d.scrollTo({top:d.scrollHeight,behavior:"smooth"})})},[t]),ee.useEffect(()=>{const d=h=>{h.key==="Escape"&&a()};document.addEventListener("keydown",d);const f=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",d),document.body.style.overflow=f}},[a]),g.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/70 p-4 sm:p-8",onClick:a,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:d=>d.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 ${v7[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:a,"aria-label":"Close",className:"flex-shrink-0 rounded-md p-1 text-[#888] transition-colors hover:bg-[#1a1a1a] hover:text-white",children:g.jsx(L_,{className:"h-4 w-4"})})]}),g.jsx("div",{ref:s,onScroll:c,className:"flex-1 overflow-y-auto p-5",children:g.jsx(i7,{agent:e,events:t,showHeader:!1})}),i&&g.jsx("div",{className:"border-t border-[#222] px-5 py-3",children:g.jsx(lS,{agents:[e],fixedAgentId:e.id,className:"mt-0"})})]})})}const E7=[{slug:"pr_reviews",title:"PR Reviews",icon:mp,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:kT,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:pp,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:C_,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:D_,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:O_,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:AT,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:pA,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:UT,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:$T,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:aT,tier:"Pro",navDesc:"Give agents context",headline:"Give agents context",description:"Teach Strix about your systems and business logic so every run gets smarter."}],dp=Object.fromEntries(E7.map(e=>[e.slug,e])),N7=["pr_reviews","repositories","domains","integrations","members","pentests","networks","chat","dashboard","platform_issues","knowledge"],d_="strix_viewer_sidebar_collapsed";function S7({view:e,onSelectView:t,activeFeature:i,onSelectFeature:a,issuesCount:s,agentCount:o,runCount:c,verified:d,email:f,onOpenEmail:h,onOpenHistory:m,onForget:p}){const[x,y]=ee.useState(!1);ee.useEffect(()=>{try{y(localStorage.getItem(d_)==="1")}catch{}},[]);const _=()=>{y(N=>{const S=!N;try{localStorage.setItem(d_,S?"1":"0")}catch{}return S})};return g.jsx("aside",{className:`hidden flex-shrink-0 border-r border-[#222] lg:block ${x?"w-14":"w-72"}`,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("div",{className:`flex items-center ${x?"flex-col gap-2":"justify-between"}`,children:[g.jsxs("a",{href:ca("https://app.strix.ai","logo"),target:"_blank",rel:"noopener noreferrer",onClick:()=>Ci("logo","sidebar"),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"}),!x&&g.jsx("span",{className:"text-base font-medium tracking-tight text-white",children:"Strix"})]}),g.jsx("button",{onClick:_,title:x?"Expand sidebar":"Collapse sidebar","aria-label":x?"Expand sidebar":"Collapse sidebar",className:"flex-shrink-0 cursor-pointer rounded-md p-1.5 text-[#666] transition-colors hover:bg-[rgba(255,255,255,0.06)] hover:text-white",children:x?g.jsx(GT,{className:"h-4 w-4","aria-hidden":"true"}):g.jsx(PT,{className:"h-4 w-4","aria-hidden":"true"})})]}),g.jsxs("a",{href:ca(Ao,"sidebar_start_free"),target:"_blank",rel:"noopener noreferrer",onClick:()=>Ci("sidebar_start_free","sidebar"),title:"Explore full platform",className:`mt-3 flex w-full cursor-pointer items-center justify-center gap-1.5 rounded-lg bg-white font-semibold text-black transition-opacity hover:opacity-90 ${x?"px-0 py-2":"px-3 py-2 text-sm"}`,children:[!x&&"Explore full platform",g.jsx(Ps,{className:"h-3.5 w-3.5","aria-hidden":"true"})]}),d&&f&&(x?g.jsx("div",{className:"mt-2.5 flex items-center justify-center rounded-lg py-2",style:{border:"1px solid #222",background:"rgba(255,255,255,0.02)"},title:`Linked email: ${f}`,children:g.jsx(vu,{className:"h-3.5 w-3.5 flex-shrink-0 text-emerald-400","aria-hidden":"true"})}):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(vu,{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:"Linked email"}),g.jsx("p",{className:"truncate text-xs text-[#aaa]",title:f,children:f})]}),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(LT,{className:"h-3.5 w-3.5"})})]}))]}),g.jsxs("div",{className:"mt-6 space-y-0.5",children:[g.jsx(to,{icon:T_,label:"Overview",desc:"This run's executive report",active:e==="overview",onClick:()=>t("overview"),collapsed:x}),g.jsx(to,{icon:L2,label:"Issues",desc:"Findings from this run",count:s>0?s:void 0,active:e==="issues",onClick:()=>t("issues"),collapsed:x}),o>0&&g.jsx(to,{icon:j_,label:"Agents",desc:"What each agent did",count:o,active:e==="agents",onClick:()=>t("agents"),collapsed:x}),g.jsx(to,{icon:Gs,label:"Past runs",desc:"Every run on this machine",count:c>0?c:void 0,active:e==="history",onClick:m,collapsed:x}),g.jsx(to,{icon:gp,label:"Email report",desc:"Get an encrypted PDF by email",active:e==="email",onClick:h,collapsed:x}),N7.map(N=>{const S=dp[N];return S?g.jsx(CA,{feature:S,active:e==="feature"&&i===N,onClick:()=>a(N),collapsed:x},N):null})]})]})})}function to({icon:e,label:t,desc:i,count:a,active:s,onClick:o,collapsed:c=!1}){return c?g.jsx("button",{onClick:o,title:a!=null?`${t} (${a})`:t,className:`flex w-full cursor-pointer items-center justify-center rounded-md px-2.5 py-2 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:"h-4 w-4 flex-shrink-0","aria-hidden":"true"})}):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 f_={work_email_required:"Please use your work email, not a personal one.",rate_limited:"Too many requests. Wait a minute and try again.",invalid_email:"That email does not look right. Check it and try again.",unavailable:"The email service is unavailable right now. Try again shortly."},k7=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 T7({onVerified:e}){const[t,i]=ee.useState("email"),[a,s]=ee.useState(""),[o,c]=ee.useState(""),[d,f]=ee.useState(!1),[h,m]=ee.useState(null),[p,x]=ee.useState(null),y=async()=>{const N=a.trim();if(!N){m("Enter your email to continue.");return}const S=N.slice(N.lastIndexOf("@")+1).toLowerCase();if(k7.has(S)){Ti("work_email_required"),m(f_.work_email_required);return}f(!0),m(null);const w=await aS(N);f(!1),w.ok?(Ti("email_submitted",{purpose:"verify"}),x(`We sent a 6-digit code to ${N}.`),i("code")):(w.error==="work_email_required"&&Ti("work_email_required"),m(f_[w.error]??"Could not send a code. Try again."))},_=async()=>{const N=o.trim();if(N.length<4){m("Enter the 6-digit code from your email.");return}f(!0),m(null);const S=await sS(a.trim(),N);if(f(!1),!S.verified){m("That code did not match. Check it and try again.");return}Ti("email_verified",{purpose:"verify"}),e()};return g.jsxs("div",{className:"mx-auto mt-5 max-w-sm text-left",children:[h&&g.jsxs("div",{className:"mb-3 flex items-start gap-2 rounded-lg border border-red-500/30 bg-red-500/5 px-3 py-2",children:[g.jsx(hp,{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:h})]}),p&&!h&&g.jsx("p",{className:"mb-3 text-xs text-[#888]",children:p}),t==="email"?g.jsxs("form",{className:"space-y-3",onSubmit:N=>{N.preventDefault(),y()},children:[g.jsxs("label",{className:"block",children:[g.jsx("span",{className:"mb-1.5 block text-xs text-[#888]",children:"Your work email"}),g.jsx("input",{type:"email",autoFocus:!0,value:a,onChange:N=>s(N.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-[11px] text-[#666]",children:"Use your work email."})]}),g.jsxs("button",{type:"submit",disabled:d,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:[d&&g.jsx(Hs,{className:"h-4 w-4 animate-spin","aria-hidden":"true"}),"Send me a code"]})]}):g.jsxs("form",{className:"space-y-3",onSubmit:N=>{N.preventDefault(),_()},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:o,onChange:N=>c(N.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:d,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:[d&&g.jsx(Hs,{className:"h-4 w-4 animate-spin","aria-hidden":"true"}),"Verify"]}),g.jsx("button",{type:"button",onClick:()=>{i("email"),m(null),x(null)},className:"w-full cursor-pointer text-center text-xs text-[#666] transition-colors hover:text-[#aaa]",children:"Use a different email"})]})]})}const A7=[{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 C7({counts:e}){const t=A7.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 M7(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 h_(e){if(!e)return null;const t=e.trim().replace(" UTC","Z").replace(" ","T"),i=new Date(t);if(Number.isNaN(i.getTime()))return null;const a=Date.now()-i.getTime(),s=Math.floor(a/6e4);if(s<1)return"just now";if(s<60)return`${s}m ago`;const o=Math.floor(s/60);if(o<24)return`${o}h ago`;const c=Math.floor(o/24);return c<7?`${c}d ago`:M7(e)}function O7({runs:e,activeRun:t,onSelectRun:i,onVerified:a}){const s=(e==null?void 0:e.count)??0,[o,c]=ee.useState(!1);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(Gs,{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."]}),o?g.jsxs(g.Fragment,{children:[g.jsx("p",{className:"mx-auto mt-3 max-w-sm text-xs text-[#666]",children:"Verify your email with a one-time code to unlock the full history."}),g.jsx(T7,{onVerified:a})]}):g.jsx("button",{onClick:()=>{Ci("history_unlock","past_runs"),c(!0)},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(R_,{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(d=>{const f=d.name===t,h=h_(d.start_time)??h_(d.end_time),m=go(d.target,d.name);return g.jsxs("button",{onClick:()=>i(d.name),className:`group flex w-full cursor-pointer items-center gap-4 rounded-lg border px-4 py-3 text-left transition-colors ${f?"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:m}),f&&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:[d.scan_mode&&g.jsx("span",{className:"capitalize",children:d.scan_mode}),d.scan_mode&&(h||d.status)&&g.jsx("span",{className:"text-[#333]",children:"·"}),h&&g.jsx("span",{children:h}),h&&d.status&&g.jsx("span",{className:"text-[#333]",children:"·"}),d.status&&g.jsx("span",{className:"capitalize",children:d.status})]})]}),g.jsx(C7,{counts:d.severity_counts}),g.jsx(q2,{className:"h-4 w-4 flex-shrink-0 text-[#555] transition-colors group-hover:text-[#aaa]","aria-hidden":"true"})]},d.name)})})}const m_={work_email_required:"Please use your work email, not a personal one.",rate_limited:"Too many requests. Wait a minute and try again.",invalid_email:"That email does not look right. Check it and try again.",unavailable:"The email service is unavailable right now. Try again shortly."},R7={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."},D7=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 j7({activeRun:e,auth:t,purpose:i,skipDisclosure:a=!1,onAuthChanged:s,onExit:o}){const c=(t==null?void 0:t.verified)===!0,d=i==="verify",[f,h]=ee.useState(()=>d?"email":a?c?"sending":"email":"disclosure"),[m,p]=ee.useState((t==null?void 0:t.email)??""),[x,y]=ee.useState(""),[_,N]=ee.useState(!1),[S,w]=ee.useState(null),[k,E]=ee.useState(null),[M,U]=ee.useState(""),[R,B]=ee.useState(""),[I,Z]=ee.useState(!1),[j,z]=ee.useState(""),V=ee.useRef(!1),G=async()=>{h("sending"),w(null);const X=await y7(e);if(X.ok){Ti("report_sent"),U(X.password),B(X.filename),h("password");return}if(X.error==="reverify"||X.error==="unverified"){E("Your verification expired. Enter your email to verify again."),h("email");return}w(R7[X.error]??"Could not send the report. Try again."),h("disclosure")},A=()=>{w(null),E(null),c?G():h("email")};ee.useEffect(()=>{!d&&a&&c&&!V.current&&(V.current=!0,G())},[]);const q=async()=>{const X=m.trim();if(!X){w("Enter your email to continue.");return}const C=X.slice(X.lastIndexOf("@")+1).toLowerCase();if(D7.has(C)){Ti("work_email_required"),w(m_.work_email_required);return}N(!0),w(null);const L=await aS(X);N(!1),L.ok?(Ti("email_submitted",{purpose:i}),E(`We sent a 6-digit code to ${X}.`),h("code")):(L.error==="work_email_required"&&Ti("work_email_required"),w(m_[L.error]??"Could not send a code. Try again."))},O=async()=>{const X=x.trim();if(X.length<4){w("Enter the 6-digit code from your email.");return}N(!0),w(null);const C=await sS(m.trim(),X);if(N(!1),!C.verified){w("That code did not match. Check it and try again.");return}Ti("email_verified",{purpose:i}),z(C.email),s(),d?o("history"):G()},H=async()=>{try{await navigator.clipboard.writeText(M),Z(!0),setTimeout(()=>Z(!1),1500)}catch{}},K=j||(t==null?void 0:t.email)||m.trim();return g.jsxs("div",{className:"mx-auto max-w-md space-y-4",children:[g.jsxs("button",{onClick:()=>o(d?"history":"overview"),className:"cursor-pointer inline-flex items-center gap-1.5 text-sm text-[#888] transition-colors hover:text-white",children:[g.jsx(v_,{className:"h-4 w-4"}),d?"Back to past runs":"Back to results"]}),g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx(gp,{className:"h-5 w-5 text-[#888]","aria-hidden":"true"}),g.jsx("h1",{className:"text-2xl font-semibold text-white",children:d?"Verify your email":"Email report"})]}),g.jsxs("div",{className:"w-full rounded-2xl bg-[rgba(255,255,255,0.02)] p-6",style:{border:"1px solid #2a2a2a"},children:[g.jsx("p",{className:"mb-4 text-xs text-[#666]",children:d?"We send a one-time code to confirm it is you.":"Verified by a one-time code sent to your email"}),S&&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(hp,{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:S})]}),k&&!S&&f!=="password"&&g.jsx("p",{className:"mb-4 text-xs text-[#888]",children:k}),f==="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(vu,{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(DT,{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:A,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&&(t==null?void 0:t.email)&&g.jsxs("p",{className:"text-center text-xs text-[#666]",children:["Sending to ",t.email]})]}),f==="email"&&g.jsxs("form",{className:"space-y-4",onSubmit:X=>{X.preventDefault(),q()},children:[g.jsxs("label",{className:"block",children:[g.jsx("span",{className:"mb-1.5 block text-xs text-[#888]",children:"Your work email"}),g.jsx("input",{type:"email",autoFocus:!0,value:m,onChange:X=>p(X.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-[11px] text-[#666]",children:"Use your work email."})]}),g.jsxs("button",{type:"submit",disabled:_,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:[_&&g.jsx(Hs,{className:"h-4 w-4 animate-spin","aria-hidden":"true"}),"Send me a code"]})]}),f==="code"&&g.jsxs("form",{className:"space-y-4",onSubmit:X=>{X.preventDefault(),O()},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:x,onChange:X=>y(X.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:_,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:[_&&g.jsx(Hs,{className:"h-4 w-4 animate-spin","aria-hidden":"true"}),d?"Verify":"Verify and send"]}),g.jsx("button",{type:"button",onClick:()=>{h("email"),w(null),E(null)},className:"w-full cursor-pointer text-center text-xs text-[#666] transition-colors hover:text-[#aaa]",children:"Use a different email"})]}),f==="sending"&&g.jsxs("div",{className:"flex flex-col items-center gap-3 py-8",children:[g.jsx(Hs,{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..."})]}),f==="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(Fs,{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 ",K,". 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:M}),g.jsxs("button",{onClick:H,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:[I?g.jsx(Fs,{className:"h-3.5 w-3.5"}):g.jsx(ho,{className:"h-3.5 w-3.5"}),I?"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:R})]})]}),g.jsx("button",{onClick:()=>o("overview"),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"})]})]})]})}function ja(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:{}}function no(e){return Array.isArray(e)?e:[]}function Pi(e){return typeof e=="string"&&e.trim()?e:null}function La(e){return typeof e=="number"&&Number.isFinite(e)?e:null}function L7(e){return e.replace(/_/g," ")}function p_(e){return e&&e.charAt(0).toUpperCase()+e.slice(1)}function z7(e){if(e==null||e<0)return"n/a";const t=Math.floor(e/3600),i=Math.floor(e%3600/60),a=e%60;return t?`${t}h ${i}m ${a}s`:i?`${i}m ${a}s`:`${a}s`}function Dn({label:e,children:t}){return g.jsxs("div",{className:"grid grid-cols-[7rem_1fr] gap-3 items-baseline",children:[g.jsx("dt",{className:"text-[11px] uppercase tracking-wide text-[#666]",children:e}),g.jsx("dd",{className:"min-w-0 break-words text-sm text-[#ddd]",children:t})]})}function I7({raw:e,durationSeconds:t}){const[i,a]=ee.useState(!0),s=no(e.targets_info).map(V=>{const G=ja(V),A=Pi(G.original)??Pi(ja(G.details).target_url)??"unknown target",q=Pi(G.type);return{display:A,type:q?L7(q):null}}),o=Pi(e.instruction),c=p_(Pi(e.scan_mode)),d=Pi(e.scope_mode),f=ja(e.diff_scope),h=f.active===!0,m=Pi(f.mode),p=Pi(e.diff_base),x=e.non_interactive===!0,y=no(e.local_sources).map(V=>String(V)).filter(Boolean),_=p_(Pi(e.status));let N=d??"auto";h&&(N+=` (diff${m?`: ${m}`:""}${p?` vs ${p}`:""})`);const S=ja(e.llm_usage),w=Object.keys(S).length>0,k=no(S.agents).map(ja),E=Array.from(new Set(k.map(V=>Pi(V.model)).filter(V=>!!V))),M=La(S.requests),U=La(S.input_tokens),R=La(ja(no(S.input_tokens_details)[0]).cached_tokens),B=La(S.output_tokens),I=La(ja(no(S.output_tokens_details)[0]).reasoning_tokens),Z=La(S.total_tokens),j=La(S.cost),z=(V,G)=>g.jsxs("span",{className:"text-[#666]",children:[" (",Os(V)," ",G,")"]});return g.jsxs("div",{className:"rounded-xl border border-[#222] bg-[rgba(255,255,255,0.02)] p-5",children:[g.jsxs("button",{type:"button",onClick:()=>a(V=>!V),"aria-expanded":i,className:"flex w-full cursor-pointer items-center gap-2 text-left",children:[g.jsx(NT,{className:"h-4 w-4 text-[#888]","aria-hidden":"true"}),g.jsx("h2",{className:"text-sm font-semibold text-white",children:"Run details"}),i?g.jsx(N_,{className:"ml-auto h-4 w-4 text-[#666]","aria-hidden":"true"}):g.jsx(fo,{className:"ml-auto h-4 w-4 text-[#666]","aria-hidden":"true"})]}),i&&g.jsxs("div",{className:"mt-4 grid grid-cols-1 gap-x-8 gap-y-6 md:grid-cols-2",children:[g.jsxs("section",{children:[g.jsx("h3",{className:"mb-3 text-[11px] font-semibold uppercase tracking-wide text-[#555]",children:"Configuration"}),g.jsxs("dl",{className:"space-y-2.5",children:[s.length>0&&g.jsx(Dn,{label:"Targets",children:g.jsx("div",{className:"space-y-1",children:s.map((V,G)=>g.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[g.jsx("span",{className:"font-mono text-[#ddd]",children:V.display}),V.type&&g.jsx("span",{className:"rounded-full border border-[#2a2a2a] px-1.5 py-0.5 text-[10px] text-[#888]",children:V.type})]},G))})}),g.jsx(Dn,{label:"Instruction",children:o?g.jsx("span",{className:"whitespace-pre-wrap",children:o}):g.jsx("span",{className:"text-[#666]",children:"None"})}),c&&g.jsx(Dn,{label:"Scan mode",children:c}),g.jsx(Dn,{label:"Scope",children:N}),g.jsx(Dn,{label:"Mode",children:x?"Non-interactive":"Interactive"}),y.length>0&&g.jsx(Dn,{label:"Local sources",children:g.jsx("div",{className:"space-y-0.5 font-mono text-[#ddd]",children:y.map((V,G)=>g.jsx("div",{children:V},G))})}),_&&g.jsx(Dn,{label:"Status",children:_})]})]}),g.jsxs("section",{children:[g.jsx("h3",{className:"mb-3 text-[11px] font-semibold uppercase tracking-wide text-[#555]",children:"Usage & cost"}),w?g.jsxs("dl",{className:"space-y-2.5 tabular-nums",children:[g.jsx(Dn,{label:"Model",children:E.length?E.join(", "):"n/a"}),g.jsx(Dn,{label:"Run time",children:z7(t)}),M!=null&&g.jsx(Dn,{label:"Requests",children:Os(M)}),U!=null&&g.jsxs(Dn,{label:"Input tokens",children:[Os(U),R!=null&&z(R,"cached")]}),B!=null&&g.jsxs(Dn,{label:"Output tokens",children:[Os(B),I!=null&&z(I,"reasoning")]}),Z!=null&&g.jsx(Dn,{label:"Total tokens",children:Os(Z)}),j!=null&&g.jsxs(Dn,{label:"Cost",children:["$",j.toFixed(2)]}),k.length>0&&g.jsx(Dn,{label:"Agents",children:Os(k.length)})]}):g.jsx("p",{className:"text-sm text-[#666]",children:"Not available yet."})]})]})]})}const g_="strix_viewer_trust_dismissed";function B7({message:e}){const[t,i]=ee.useState(()=>{try{return localStorage.getItem(g_)==="1"}catch{return!1}});if(t)return null;const a=()=>{try{localStorage.setItem(g_,"1")}catch{}i(!0)};return g.jsx("div",{className:"fixed bottom-3 left-3 z-[60] max-w-xs rounded-lg bg-[#0a0a0a] p-3 shadow-2xl",style:{border:"1px solid #2a2a2a"},role:"status",children:g.jsxs("div",{className:"flex gap-2.5",children:[g.jsx(vu,{className:"mt-0.5 h-4 w-4 flex-shrink-0 text-emerald-400","aria-hidden":"true"}),g.jsx("p",{className:"text-xs leading-relaxed text-[#aaa]",children:e}),g.jsx("button",{onClick:a,"aria-label":"Dismiss",className:"-mr-0.5 -mt-0.5 flex-shrink-0 cursor-pointer rounded p-0.5 text-[#666] transition-colors hover:text-white",children:g.jsx(L_,{className:"h-3.5 w-3.5"})})]})})}const U7=[{icon:E_,text:"Continuous coverage: scheduled pentests and attack surface monitoring"},{icon:xA,text:"One-click autofix that opens a retested pull request"},{icon:C_,text:"Two-way sync to Jira, Linear, and Slack"},{icon:D_,text:"Your whole team, with roles and shared history"}];function H7({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(Hu,{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:U7.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:ca(Ao,e.slug),target:"_blank",rel:"noopener noreferrer",onClick:()=>Ci(e.slug,"feature_page"),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(Ps,{className:"h-3.5 w-3.5","aria-hidden":"true"})]}),g.jsxs("a",{href:ca(kA,e.slug),target:"_blank",rel:"noopener noreferrer",onClick:()=>Ci(e.slug,"feature_page_plans"),className:"inline-flex items-center gap-1 text-xs text-[#888] transition-colors hover:text-white",children:["View all plans",g.jsx(Ps,{className:"h-3 w-3","aria-hidden":"true"})]})]})]})})}const $7="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.",b_=["critical","high","medium","low"],q7=500,P7=[{title:"One-click autofix + open a fix PR",desc:"Fix it for you and open a PR, retested.",slug:"autofix",icon:_u},{title:"Export SOC 2 / ISO 27001 report",desc:"Share an auditor-ready report with your team.",slug:"compliance",icon:cT}],F7=[{title:"Scheduled pentesting",desc:"Continuous coverage for your whole org.",slug:"scheduled",icon:E_},{title:"Attack surface monitoring",desc:"Continuous coverage for your whole org.",slug:"asm",icon:M_},{title:"PR reviews",desc:"Pentest every pull request your team opens.",slug:"pr_reviews",icon:mp}];function G7(){const[e,t]=ee.useState(null),[i,a]=ee.useState(null),[s,o]=ee.useState(null),[c,d]=ee.useState(null),[f,h]=ee.useState("overview"),[m,p]=ee.useState(null),[x,y]=ee.useState(null),[_,N]=ee.useState(null),[S,w]=ee.useState("report"),[k,E]=ee.useState(!1),[M,U]=ee.useState(!1),R=ee.useCallback(async()=>{try{y(await b7())}catch{}},[]),B=ee.useCallback(async()=>{try{N(await m7())}catch{}},[]);ee.useEffect(()=>{R(),B(),p7().then(D=>U(D.can_steer)).catch(()=>{})},[R,B]);const I=ee.useRef(!1);ee.useEffect(()=>{let D=!1,F;I.current=!1;const $=()=>{F=setTimeout(Q,q7)},Q=async()=>{if(!D)try{const{summary:J,raw:W,finished:te}=await nS(e);if(D)return;if(te&&!I.current){I.current=!0;const be=await c_(e);D||a(be);return}const[oe,fe]=await Promise.all([rS(e).catch(()=>({agents:[],events:[]})),iS(J.runId,e).catch(()=>[])]);if(D)return;a(be=>({summary:J,raw:W,finished:te,transcript:oe,vulnerabilities:fe,reportMarkdown:(be==null?void 0:be.reportMarkdown)??null})),$()}catch(J){if(D)return;o(J instanceof Error?J.message:"Could not load run data."),$()}};return(async()=>{try{const J=await c_(e);if(D)return;a(J),J.finished?I.current=!0:$()}catch(J){if(D)return;o(J instanceof Error?J.message:"Could not load run data."),$()}})(),()=>{D=!0,F&&clearTimeout(F)}},[e]);const Z=ee.useMemo(()=>i?f7(i.vulnerabilities):null,[i]),j=(i==null?void 0:i.vulnerabilities.find(D=>D.id===c))??null,z=(i==null?void 0:i.transcript.agents.length)??0,V=(x==null?void 0:x.verified)===!0,G=ee.useRef(!1);ee.useEffect(()=>{G.current=!1},[e]),ee.useEffect(()=>{G.current||!i||(i.finished?(G.current=!0,h("overview")):z>0&&(G.current=!0,h("agents")))},[i,z]);const A=ee.useCallback(D=>{G.current=!0,h(D)},[]),q=ee.useCallback(D=>{t(D),d(null),a(null),o(null),G.current=!1},[]),O=ee.useCallback((D,F)=>{Ci("email_report",F),w("report"),E(D),A("email")},[A]),H=ee.useCallback(()=>O(!1,"sidebar"),[O]),K=ee.useCallback(()=>O(!0,"overview"),[O]),X=ee.useCallback(()=>{B(),A("history")},[B,A]),C=ee.useCallback(async()=>{await R(),await B()},[R,B]),L=ee.useCallback(D=>{Ci(D,"sidebar_nav"),p(D),A("feature")},[A]),Y=ee.useCallback(async()=>{await x7(),await R(),await B()},[R,B]);return g.jsxs("div",{className:"min-h-screen bg-black text-white flex",children:[g.jsx(S7,{view:f,onSelectView:D=>{D==="history"?X():A(D)},activeFeature:m,onSelectFeature:L,issuesCount:(i==null?void 0:i.vulnerabilities.length)??0,agentCount:z,runCount:(_==null?void 0:_.count)??0,verified:V,email:(x==null?void 0:x.email)??null,onOpenEmail:H,onOpenHistory:X,onForget:()=>void Y()}),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:ca("https://app.strix.ai","logo"),target:"_blank",rel:"noopener noreferrer",onClick:()=>Ci("logo","topbar"),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(Y7,{finished:i.finished}),g.jsxs("div",{className:"ml-auto flex items-center gap-3",children:[V&&_&&!_.locked&&_.runs.length>0&&g.jsx(V7,{runs:_,activeRun:e,launchedName:go((i==null?void 0:i.summary.targets[0])??null,(i==null?void 0:i.summary.runName)??(i==null?void 0:i.summary.runId)??"Current run"),onSelect:q}),g.jsxs("a",{href:ca(Ao,"run_in_cloud"),target:"_blank",rel:"noopener noreferrer",onClick:()=>Ci("run_in_cloud","topbar"),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(Ps,{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:[s&&!i&&f!=="history"&&f!=="email"&&f!=="feature"&&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(hp,{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})]}),f==="email"?g.jsx(j7,{activeRun:e,auth:x,purpose:S,skipDisclosure:k,onAuthChanged:()=>{R(),B()},onExit:D=>h(D==="history"?"history":"overview")}):f==="feature"&&m&&dp[m]?g.jsx(H7,{feature:dp[m]}):f==="history"?g.jsxs("div",{className:"space-y-4",children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx(Gs,{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(O7,{runs:_,activeRun:e,onSelectRun:q,onVerified:()=>void C()})]}):!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&&Z?g.jsxs(g.Fragment,{children:[g.jsx(K7,{summary:i.summary}),g.jsxs("div",{className:"flex gap-5 border-b border-[#2a2a2a] lg:hidden",children:[g.jsx(Dm,{active:f==="overview",onClick:()=>A("overview"),children:"Overview"}),g.jsxs(Dm,{active:f==="issues",onClick:()=>A("issues"),children:["Issues",i.vulnerabilities.length>0?` (${i.vulnerabilities.length})`:""]}),z>0&&g.jsxs(Dm,{active:f==="agents",onClick:()=>A("agents"),children:["Agents (",z,")"]})]}),f==="overview"?g.jsx(eH,{summary:i.summary,counts:Z,total:i.vulnerabilities.length,reportMarkdown:i.reportMarkdown,raw:i.raw,onOpenEmail:K}):f==="agents"&&z>0?g.jsx(tH,{run:i,canSteer:M}):j?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(v_,{className:"w-4 h-4"})," Back to all findings"]}),g.jsx(JD,{vulnerability:j})]}):g.jsx(Z7,{vulnerabilities:i.vulnerabilities,finished:i.finished,onSelect:D=>d(D)})]}):null]})]}),g.jsx(B7,{message:$7})]})}function V7({runs:e,activeRun:t,launchedName:i,onSelect:a}){const[s,o]=ee.useState(!1),c=e.runs.find(f=>f.name===t),d=c?go(c.target,c.name):i;return g.jsxs("div",{className:"relative",children:[g.jsxs("button",{onClick:()=>o(f=>!f),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(Gs,{className:"w-3.5 h-3.5","aria-hidden":"true"}),g.jsx("span",{className:"max-w-[160px] truncate",children:d}),g.jsx(fo,{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(f=>{const h=f.name===t;return g.jsxs("button",{onMouseDown:()=>a(f.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:go(f.target,f.name)}),f.target&&g.jsx("span",{className:"block truncate font-mono text-[#666]",children:f.target})]}),h&&g.jsx("span",{className:"h-1.5 w-1.5 flex-shrink-0 rounded-full bg-emerald-400"})]},f.name)})})]})}function Y7({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 X7(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 K7({summary:e}){const t=X7(e.durationSeconds);return g.jsxs("div",{children:[g.jsx("h1",{className:"text-2xl font-semibold text-white",children:go(e.targets[0]??null,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(Rm,{label:e.scanMode}),t&&g.jsx(Rm,{label:t}),e.status&&g.jsx(Rm,{label:e.status})]})]})}function Rm({label:e}){return g.jsxs(g.Fragment,{children:[g.jsx("span",{className:"text-[#333]",children:"·"}),g.jsx("span",{className:"capitalize",children:e})]})}function Z7({vulnerabilities:e,finished:t,onSelect:i}){const a=[...e].sort((s,o)=>b_.indexOf(s.severity)-b_.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(ao,{label:"Attack surface monitoring",desc:"Continuous coverage for your whole org.",slug:"asm",surface:"empty_state",icon:M_})]})]}):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 ${bp(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 ${z_[s.severity]}`,children:s.severity})]},s.id))})}function Q7(e){return e.replace(/^\s*#{1,6}[ \t]+.*(?:\r?\n)+/,"").trimStart()}function W7(e){const t=[];let i=null;for(const a of e.split(` +`)}function MU({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?CU(AU(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(lg,{code:a,language:"python",collapsible:!0}),d&&g.jsx(vr,{className:"text-[#666]",children:d})]})}function OU({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 RU({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 DU(e){return e.toolName==="subagent_start_info"?g.jsx(RU,{...e}):g.jsx(OU,{...e})}function jU({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 LU({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(Us,{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(Us,{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(Us,{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(Us,{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 zU={create_todo:{label:"Task added",Icon:KT},list_todos:{label:"Plan",Icon:B2},update_todo:{label:"Task updated",Icon:YT},mark_todo_done:{label:"Task completed",Icon:S_},mark_todo_pending:{label:"Task reopened",Icon:iA},delete_todo:{label:"Task removed",Icon:hA}};function IU({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(K2,{className:"w-3.5 h-3.5 text-purple-400/70 shrink-0 animate-pulse"}):g.jsx(Q2,{className:"w-3.5 h-3.5 text-[#444] shrink-0"})}function BU({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(IU,{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=zU[e]??{label:"Plan",Icon:JT},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,f;if(o&&typeof o=="object"){if(d=o.error??null,o.success){const m=o.todos;c=Array.isArray(m)?m:[]}f=o.id??t.todo_id??void 0}const h=e!=="list_todos"?f: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(BU,{todos:c,highlightId:h})})]})}function l_(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 QN({toolName:e,args:t,result:i}){const a=l_(t),s=l_(i);return g.jsxs("div",{children:[g.jsx("span",{className:"text-[#888] font-semibold text-sm",children:e.replace(/_/g," ")}),a&&g.jsx(vr,{className:"text-[#777]",children:a}),s&&g.jsx(vr,{className:"text-[#666]",children:s})]})}function HU({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 rd={terminal:{renderer:W9,icon:R_,color:"text-emerald-400"},python:{renderer:MU,icon:eT,color:"text-yellow-400"},browser:{renderer:eU,icon:pp,color:"text-blue-400"},filesystem:{renderer:tU,icon:T_,color:"text-sky-400"},proxy:{renderer:vU,icon:Ps,color:"text-purple-400",match:/request|sitemap|scope/},reporting:{renderer:dU,icon:sA,color:"text-red-400"},thinking:{renderer:_U,icon:w_,color:"text-purple-400"},agents:{renderer:wU,icon:fp,color:"text-cyan-400",match:/agent/},search:{renderer:EU,icon:O_,color:"text-amber-400"},lifecycle:{renderer:DU,icon:A_,color:"text-emerald-400"},notes:{renderer:LU,icon:uA,color:"text-amber-400",match:/note/},skills:{renderer:HU,icon:_u,color:"text-emerald-400"},todos:{renderer:UU,icon:MT,color:"text-purple-400",match:/todo/},telemetry:{renderer:QN,icon:_u,color:"text-[#555]"}},$U={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"]},qU=Object.fromEntries(Object.entries($U).flatMap(([e,t])=>t.map(i=>[i,e]))),PU={finish_scan:jU,apply_patch:oU,view_image:cU},FU={agent_finish:{icon:A_,color:"text-cyan-400"},send_message_to_agent:{icon:W0,color:"text-cyan-400"},wait_for_message:{icon:W0,color:"text-cyan-400"},view_agent_graph:{icon:lT,color:"text-cyan-400"},stop_agent:{icon:__,color:"text-red-400"},scan_start_info:{icon:iT,color:"text-emerald-400"},subagent_start_info:{icon:fp,color:"text-purple-400"},view_image:{icon:wT,color:"text-sky-400"}},GU=rd.telemetry;function WN(e){var i;const t=qU[e];if(t)return t;for(const[a,s]of Object.entries(rd))if((i=s.match)!=null&&i.test(e))return a;return null}function VU(e){const t=PU[e];if(t)return t;const i=WN(e);return i?rd[i].renderer:QN}function YU(e){const t=FU[e];if(t)return t;const i=WN(e),a=i?rd[i]:GU;return{icon:a.icon,color:a.color}}const XU=30;function KU({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:XU})})]})}class ZU extends ee.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 QU(e){const t=VU(e.toolName);return g.jsx(ZU,{toolName:e.toolName,children:g.jsx(t,{...e})})}function JN(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 eS(e){const t=JN(e);return t&&typeof t=="object"&&!Array.isArray(t)?t:t==null?{}:{__raw:typeof t=="string"?t:JSON.stringify(t)}}function o_(e){const t=/(\d+)$/.exec(e);return t?parseInt(t[1],10):0}function ug(e){var i;const t=(i=e.data)==null?void 0:i.role;return e.type==="chat"&&(t==="user"||t==="human")}function WU(e){var t;return ug(e)&&String(((t=e.data)==null?void 0:t.content)??"").startsWith("[Message from ")}function JU(e){const t=new Set;let i=!1;for(const a of e)if(ug(a)){if(WU(a)){t.add(a.id);continue}i||(i=!0,t.add(a.id))}return t}const e7={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 t7(e){return e==="completed"?"completed":e==="running"?"running":e==="failed"||e==="crashed"?"failed":e}function n7(e,t){var d;const i=new Map;for(const f of e)if(f.parent_id){const h=i.get(f.parent_id)??[];h.push(f.id),i.set(f.parent_id,h)}const a=new Map,s=new Map,o=new Map;for(const f of t)if(f.type==="tool"){if(a.set(f.agent_id,(a.get(f.agent_id)??0)+1),((d=f.data)==null?void 0:d.tool_name)==="create_agent"){const h=eS(f.data.args),m=h.name??h.agent_name??"",p=h.task??"";m&&p&&o.set(m,p)}}else ug(f)||s.set(f.agent_id,(s.get(f.agent_id)??0)+1);const c=new Map;for(const f of e)c.set(f.id,{id:f.id,name:f.name,task:o.get(f.name)??"",status:t7(f.status),parentId:f.parent_id,children:i.get(f.id)??[],createdAt:f.created_at,toolCount:a.get(f.id)??0,messageCount:s.get(f.id)??0});return c}function i7({agent:e,events:t,showHeader:i=!0}){const a=ee.useMemo(()=>{const c=t.filter(f=>f.agent_id===e.id).sort((f,h)=>o_(f.id)-o_(h.id)),d=JU(c);return c.filter(f=>!d.has(f.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 ${e7[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,M;const f=d===a.length-1,h=c.type==="tool",m=h?String(((N=c.data)==null?void 0:N.tool_name)??"tool"):"",p=h?"":String(((S=c.data)==null?void 0:S.role)??"assistant");let x,y;if(h){const U=YU(m);x=U.icon,y=U.color}else{const U=p==="user"||p==="human";x=U?fp:w_,y=U?"text-blue-400":"text-purple-400"}const _=h?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 ${h&&_==="running"?"border-blue-500/40 animate-pulse":h&&_==="failed"?"border-red-500/30":"border-[#222]"}`,children:g.jsx(x,{className:`w-3.5 h-3.5 ${y}`})}),!f&&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:h?g.jsx(QU,{toolName:m,args:eS((k=c.data)==null?void 0:k.args),result:JN((E=c.data)==null?void 0:E.result)??null,status:_}):g.jsx(KU,{role:p,content:String(((M=c.data)==null?void 0:M.content)??"")})})]},c.id)})})]})}class Uu extends Error{constructor(t){super(t),this.name="RunParseError"}}const r7=["critical","high","medium","low"];function a7(e){const t=String(e??"").toLowerCase().trim();return r7.includes(t)?t:"low"}function s7(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 l7(e){return typeof e=="number"&&Number.isFinite(e)?e:null}function tS(e,t){try{return JSON.parse(e)}catch{throw new Uu(`${t} isn't valid JSON. Make sure you selected a Strix run directory.`)}}function o7(e){const t=tS(e,"run.json");if(!t||typeof t!="object"||Array.isArray(t))throw new Uu("run.json is not an object.");const i=t,a=[],s=i.targets_info;if(Array.isArray(s)){for(const y of s)if(y&&typeof y=="object"){const _=y.original;typeof _=="string"&&_&&a.push(_)}}const o=Ot(i.start_time),c=Ot(i.end_time);let d=null;if(o&&c){const y=new Date(o).getTime(),_=new Date(c).getTime();!Number.isNaN(y)&&!Number.isNaN(_)&&_>=y&&(d=Math.round((_-y)/1e3))}let f=null,h=null,m=null,p=null;const x=i.scan_results;if(x&&typeof x=="object"){const y=x;f=Ot(y.executive_summary),h=Ot(y.technical_analysis),m=Ot(y.methodology),p=Ot(y.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:f,technicalAnalysis:h,methodology:m,recommendations:p}}function c7(){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 u7(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{...c7(),id:Ot(e.id)??`vuln-${t+1}`,scan_id:i,title:Ot(e.title)??"Untitled finding",description:Ot(e.description)??"",severity:a7(e.severity),status:"open",created_at:s7(e.timestamp),cve:Ot(e.cve),cvss:l7(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 d7(e,t=null){const i=tS(e,"vulnerabilities.json");if(!Array.isArray(i))throw new Uu("vulnerabilities.json is not a JSON array.");return i.map((a,s)=>{if(!a||typeof a!="object")throw new Uu(`vulnerabilities.json entry #${s+1} is not an object.`);return u7(a,s,t)})}function f7(e){const t={critical:0,high:0,medium:0,low:0};for(const i of e)t[i.severity]+=1;return t}async function Za(e){const t=await fetch(e,{cache:"no-store"});if(!t.ok)throw new Error(`${e} responded ${t.status}`);return t.json()}function ad(e){return e?`?run=${encodeURIComponent(e)}`:""}async function nS(e){const t=await Za("/api/run"+ad(e)),i=o7(JSON.stringify(t)),a=t.finished===!0;return{summary:i,raw:t,finished:a}}async function iS(e,t){const i=await Za("/api/vulnerabilities"+ad(t));return d7(JSON.stringify(i),e)}async function h7(e){const t=await Za("/api/report"+ad(e));return(t==null?void 0:t.markdown)??null}async function rS(e){const t=await Za("/api/transcript"+ad(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 c_(e){const{summary:t,raw:i,finished:a}=await nS(e),[s,o,c]=await Promise.all([iS(t.runId,e).catch(()=>[]),h7(e).catch(()=>null),rS(e).catch(()=>({agents:[],events:[]}))]);return{summary:t,raw:i,finished:a,vulnerabilities:s,reportMarkdown:o,transcript:c}}async function Uo(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 m7(){const e=await Za("/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 p7(){const e=await Za("/api/capabilities");return{can_steer:(e==null?void 0:e.can_steer)===!0}}async function g7(e,t){const{ok:i,data:a}=await Uo("/api/agents/steer",{agent_id:e,message:t});return i&&a.ok===!0?{ok:!0}:{ok:!1,error:String(a.error??"unavailable")}}async function b7(){const e=await Za("/api/auth/status");return{verified:(e==null?void 0:e.verified)===!0,email:(e==null?void 0:e.email)??null}}async function aS(e){const{ok:t,data:i}=await Uo("/api/auth/otp/start",{email:e});return t&&i.ok===!0?{ok:!0}:{ok:!1,error:String(i.error??"unavailable")}}async function sS(e,t){const{ok:i,data:a}=await Uo("/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 x7(){await Uo("/api/auth/forget",{})}async function y7(e){const{ok:t,data:i}=await Uo("/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 Ls="__root__";function lS({agents:e,fixedAgentId:t,className:i}){const a=ee.useRef(null),[s,o]=ee.useState(!1),[c,d]=ee.useState(!1),[f,h]=ee.useState(""),[m,p]=ee.useState(!1),[x,y]=ee.useState(null),_=t!=null,N=ee.useMemo(()=>e.find(z=>!z.parent_id)??e[0]??null,[e]),S=ee.useMemo(()=>e.filter(z=>z.parent_id&&z.status==="running"),[e]),[w,k]=ee.useState(Ls),[E,M]=ee.useState(!1);ee.useEffect(()=>{w!==Ls&&!S.some(z=>z.id===w)&&k(Ls)},[w,S]);const{targetId:U,targetName:R}=ee.useMemo(()=>{if(_){const V=e.find(G=>G.id===t)??null;return{targetId:t??null,targetName:(V==null?void 0:V.name)??"this agent"}}if(w===Ls)return{targetId:(N==null?void 0:N.id)??null,targetName:"Root agent"};const z=e.find(V=>V.id===w)??null;return{targetId:(z==null?void 0:z.id)??(N==null?void 0:N.id)??null,targetName:(z==null?void 0:z.name)??"Root agent"}},[e,t,_,N,w]),B=f.trim().length===0;ee.useLayoutEffect(()=>{const z=a.current;z&&(z.style.height="auto",z.style.height=`${z.scrollHeight}px`)},[f]);const I=ee.useCallback(()=>{o(!0),requestAnimationFrame(()=>{var z;return(z=a.current)==null?void 0:z.focus()})},[]),Z=ee.useCallback(()=>{o(!1),d(!1),M(!1)},[]),j=ee.useCallback(async()=>{if(m)return;const z=f.trim();if(!z||!U)return;p(!0),y(null);const V=R,G=await g7(U,z);p(!1),G.ok?(h(""),y(`Sent to ${V}`),Ti("agent_steered")):G.error==="not_delivered"?y("Could not reach that agent (it may have finished)."):y("Could not send that message. Try again.")},[m,f,U,R]);return s?g.jsxs("div",{className:la("mt-4 rounded-2xl border border-white/[0.08] bg-[#050505] overflow-hidden transition-colors duration-300",c?"border-white/[0.18]":"hover:border-white/[0.12]",i),children:[g.jsxs("div",{className:"flex items-center justify-between gap-3 border-b border-white/[0.06] px-5 py-3",children:[g.jsxs("div",{className:"min-w-0",children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx(J0,{className:"h-4 w-4 text-[#666]"}),g.jsx("p",{className:"text-sm font-medium text-white",children:"Live prompt"})]}),g.jsx("p",{className:"mt-0.5 text-xs text-[#777]",children:"Connected"})]}),g.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[_?g.jsxs("div",{className:"rounded-full border border-white/[0.08] bg-white/[0.03] px-3 py-1 text-xs text-[#aaa]",children:["Target: ",g.jsx("span",{className:"text-white",children:R})]}):g.jsxs("div",{className:"flex items-center gap-1.5",children:[g.jsx("span",{className:"text-xs text-[#aaa]",children:"Target:"}),g.jsxs("div",{className:"relative",children:[g.jsxs("button",{type:"button",onClick:()=>M(z=>!z),onBlur:()=>requestAnimationFrame(()=>M(!1)),className:"inline-flex h-7 items-center gap-1 rounded-full border border-white/[0.08] bg-white/[0.03] px-3 text-xs text-white transition-colors hover:border-white/[0.16] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white/20","aria-haspopup":"listbox","aria-expanded":E,children:[g.jsx("span",{className:"max-w-[140px] truncate",children:R}),g.jsx(fo,{className:"h-3.5 w-3.5 text-[#999]"})]}),E&&g.jsxs("div",{className:"absolute right-0 z-10 mt-1 min-w-[160px] overflow-hidden rounded-lg border border-[#333] bg-[#0a0a0a] py-1 shadow-xl",role:"listbox",children:[g.jsx(u_,{label:"Root agent",active:w===Ls,onSelect:()=>{k(Ls),M(!1)}}),S.map(z=>g.jsx(u_,{label:z.name,active:w===z.id,onSelect:()=>{k(z.id),M(!1)}},z.id))]})]})]}),g.jsx("button",{type:"button",onClick:Z,className:"inline-flex h-7 w-7 items-center justify-center rounded-full text-[#777] transition-colors hover:bg-white/[0.06] hover:text-white focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white/20","aria-label":"Collapse live prompt composer",children:g.jsx(fo,{className:"h-4 w-4"})})]})]}),g.jsx("div",{className:"px-5 pt-4 pb-3",children:g.jsx("textarea",{ref:a,rows:1,value:f,onChange:z=>h(z.target.value),onFocus:()=>d(!0),onBlur:()=>d(!1),onKeyDown:z=>{z.key==="Enter"&&!z.shiftKey&&(z.preventDefault(),j())},placeholder:"Send a live prompt to the running scan…",maxLength:4e3,disabled:m,className:"block w-full resize-none border-0 bg-transparent p-0 text-[15px] leading-6 text-white placeholder:text-[#444] focus:outline-none disabled:opacity-60 max-h-[160px] overflow-y-auto"})}),g.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 pb-4",children:[g.jsx("div",{className:"text-xs text-[#666]",children:x??"Press Enter to send."}),g.jsxs("button",{type:"button",onClick:z=>{z.stopPropagation(),j()},disabled:m||B,className:la("inline-flex h-10 min-w-[112px] items-center justify-center gap-2 rounded-full px-4 text-sm font-medium transition-colors",m||B?"bg-white/[0.08] text-[#666]":"bg-white text-black hover:bg-neutral-200"),children:[m?g.jsx(Hs,{className:"h-4 w-4 animate-spin"}):g.jsx(A2,{className:"h-4 w-4",strokeWidth:2.5}),g.jsx("span",{children:"Send prompt"})]})]})]}):g.jsxs("button",{type:"button",onClick:I,className:la("mt-4 flex w-full items-center justify-between gap-3 rounded-2xl border border-white/[0.08] bg-[#050505] px-5 py-3 text-left transition-colors duration-300 hover:border-white/[0.12] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white/20",i),"aria-expanded":!1,"aria-label":"Expand live prompt composer",children:[g.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[g.jsx(J0,{className:"h-4 w-4 shrink-0 text-[#666]"}),g.jsx("span",{className:"truncate text-sm font-medium text-white",children:"Guide the agent"})]}),g.jsx(N_,{className:"h-4 w-4 shrink-0 text-[#777]"})]})}function u_({label:e,active:t,onSelect:i}){return g.jsx("button",{type:"button",role:"option","aria-selected":t,onMouseDown:a=>{a.preventDefault(),i()},className:la("block w-full truncate px-3 py-1.5 text-left text-xs transition-colors hover:bg-white/[0.06]",t?"text-white":"text-[#aaa]"),children:e})}const v7={completed:"bg-emerald-400",running:"bg-blue-400",waiting:"bg-yellow-400",stopped:"bg-[#888]",crashed:"bg-red-400",failed:"bg-red-400"},_7=80;function w7({agent:e,events:t,steerable:i,onClose:a}){const s=ee.useRef(null),o=ee.useRef(!1),c=ee.useCallback(()=>{const d=s.current;d&&(o.current=d.scrollHeight-d.scrollTop-d.clientHeight<_7)},[]);return ee.useEffect(()=>{const d=s.current;!d||!o.current||requestAnimationFrame(()=>{d.scrollTo({top:d.scrollHeight,behavior:"smooth"})})},[t]),ee.useEffect(()=>{const d=h=>{h.key==="Escape"&&a()};document.addEventListener("keydown",d);const f=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",d),document.body.style.overflow=f}},[a]),g.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/70 p-4 sm:p-8",onClick:a,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:d=>d.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 ${v7[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:a,"aria-label":"Close",className:"flex-shrink-0 rounded-md p-1 text-[#888] transition-colors hover:bg-[#1a1a1a] hover:text-white",children:g.jsx(L_,{className:"h-4 w-4"})})]}),g.jsx("div",{ref:s,onScroll:c,className:"flex-1 overflow-y-auto p-5",children:g.jsx(i7,{agent:e,events:t,showHeader:!1})}),i&&g.jsx("div",{className:"border-t border-[#222] px-5 py-3",children:g.jsx(lS,{agents:[e],fixedAgentId:e.id,className:"mt-0"})})]})})}const E7=[{slug:"pr_reviews",title:"PR Reviews",icon:mp,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:kT,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:pp,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:C_,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:D_,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:O_,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:AT,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:pA,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:UT,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:$T,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:aT,tier:"Pro",navDesc:"Give agents context",headline:"Give agents context",description:"Teach Strix about your systems and business logic so every run gets smarter."}],dp=Object.fromEntries(E7.map(e=>[e.slug,e])),N7=["pr_reviews","repositories","domains","integrations","members","pentests","networks","chat","dashboard","platform_issues","knowledge"],d_="strix_viewer_sidebar_collapsed";function S7({view:e,onSelectView:t,activeFeature:i,onSelectFeature:a,issuesCount:s,agentCount:o,runCount:c,verified:d,email:f,onOpenEmail:h,onOpenHistory:m,onForget:p}){const[x,y]=ee.useState(!1);ee.useEffect(()=>{try{y(localStorage.getItem(d_)==="1")}catch{}},[]);const _=()=>{y(N=>{const S=!N;try{localStorage.setItem(d_,S?"1":"0")}catch{}return S})};return g.jsx("aside",{className:`hidden flex-shrink-0 border-r border-[#222] lg:block ${x?"w-14":"w-72"}`,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("div",{className:`flex items-center ${x?"flex-col gap-2":"justify-between"}`,children:[g.jsxs("a",{href:ca("https://app.strix.ai","logo"),target:"_blank",rel:"noopener noreferrer",onClick:()=>Ci("logo","sidebar"),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"}),!x&&g.jsx("span",{className:"text-base font-medium tracking-tight text-white",children:"Strix"})]}),g.jsx("button",{onClick:_,title:x?"Expand sidebar":"Collapse sidebar","aria-label":x?"Expand sidebar":"Collapse sidebar",className:"flex-shrink-0 cursor-pointer rounded-md p-1.5 text-[#666] transition-colors hover:bg-[rgba(255,255,255,0.06)] hover:text-white",children:x?g.jsx(GT,{className:"h-4 w-4","aria-hidden":"true"}):g.jsx(PT,{className:"h-4 w-4","aria-hidden":"true"})})]}),g.jsxs("a",{href:ca(Ao,"sidebar_start_free"),target:"_blank",rel:"noopener noreferrer",onClick:()=>Ci("sidebar_start_free","sidebar"),title:"Explore full platform",className:`mt-3 flex w-full cursor-pointer items-center justify-center gap-1.5 rounded-lg bg-white font-semibold text-black transition-opacity hover:opacity-90 ${x?"px-0 py-2":"px-3 py-2 text-sm"}`,children:[!x&&"Explore full platform",g.jsx(Ps,{className:"h-3.5 w-3.5","aria-hidden":"true"})]}),d&&f&&(x?g.jsx("div",{className:"mt-2.5 flex items-center justify-center rounded-lg py-2",style:{border:"1px solid #222",background:"rgba(255,255,255,0.02)"},title:`Linked email: ${f}`,children:g.jsx(vu,{className:"h-3.5 w-3.5 flex-shrink-0 text-emerald-400","aria-hidden":"true"})}):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(vu,{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:"Linked email"}),g.jsx("p",{className:"truncate text-xs text-[#aaa]",title:f,children:f})]}),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(LT,{className:"h-3.5 w-3.5"})})]}))]}),g.jsxs("div",{className:"mt-6 space-y-0.5",children:[g.jsx(to,{icon:T_,label:"Overview",desc:"This run's executive report",active:e==="overview",onClick:()=>t("overview"),collapsed:x}),g.jsx(to,{icon:L2,label:"Issues",desc:"Findings from this run",count:s>0?s:void 0,active:e==="issues",onClick:()=>t("issues"),collapsed:x}),o>0&&g.jsx(to,{icon:j_,label:"Agents",desc:"What each agent did",count:o,active:e==="agents",onClick:()=>t("agents"),collapsed:x}),g.jsx(to,{icon:Gs,label:"Past runs",desc:"Every run on this machine",count:c>0?c:void 0,active:e==="history",onClick:m,collapsed:x}),g.jsx(to,{icon:gp,label:"Email report",desc:"Get an encrypted PDF by email",active:e==="email",onClick:h,collapsed:x}),N7.map(N=>{const S=dp[N];return S?g.jsx(CA,{feature:S,active:e==="feature"&&i===N,onClick:()=>a(N),collapsed:x},N):null})]})]})})}function to({icon:e,label:t,desc:i,count:a,active:s,onClick:o,collapsed:c=!1}){return c?g.jsx("button",{onClick:o,title:a!=null?`${t} (${a})`:t,className:`flex w-full cursor-pointer items-center justify-center rounded-md px-2.5 py-2 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:"h-4 w-4 flex-shrink-0","aria-hidden":"true"})}):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 f_={work_email_required:"Please use your work email, not a personal one.",rate_limited:"Too many requests. Wait a minute and try again.",invalid_email:"That email does not look right. Check it and try again.",unavailable:"The email service is unavailable right now. Try again shortly."},k7=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 T7({onVerified:e}){const[t,i]=ee.useState("email"),[a,s]=ee.useState(""),[o,c]=ee.useState(""),[d,f]=ee.useState(!1),[h,m]=ee.useState(null),[p,x]=ee.useState(null),y=async()=>{const N=a.trim();if(!N){m("Enter your email to continue.");return}const S=N.slice(N.lastIndexOf("@")+1).toLowerCase();if(k7.has(S)){Ti("work_email_required"),m(f_.work_email_required);return}f(!0),m(null);const w=await aS(N);f(!1),w.ok?(Ti("email_submitted",{purpose:"verify"}),x(`We sent a 6-digit code to ${N}.`),i("code")):(w.error==="work_email_required"&&Ti("work_email_required"),m(f_[w.error]??"Could not send a code. Try again."))},_=async()=>{const N=o.trim();if(N.length<4){m("Enter the 6-digit code from your email.");return}f(!0),m(null);const S=await sS(a.trim(),N);if(f(!1),!S.verified){m("That code did not match. Check it and try again.");return}Ti("email_verified",{purpose:"verify"}),e()};return g.jsxs("div",{className:"mx-auto mt-5 max-w-sm text-left",children:[h&&g.jsxs("div",{className:"mb-3 flex items-start gap-2 rounded-lg border border-red-500/30 bg-red-500/5 px-3 py-2",children:[g.jsx(hp,{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:h})]}),p&&!h&&g.jsx("p",{className:"mb-3 text-xs text-[#888]",children:p}),t==="email"?g.jsxs("form",{className:"space-y-3",onSubmit:N=>{N.preventDefault(),y()},children:[g.jsxs("label",{className:"block",children:[g.jsx("span",{className:"mb-1.5 block text-xs text-[#888]",children:"Your work email"}),g.jsx("input",{type:"email",autoFocus:!0,value:a,onChange:N=>s(N.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-[11px] text-[#666]",children:"Use your work email."})]}),g.jsxs("button",{type:"submit",disabled:d,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:[d&&g.jsx(Hs,{className:"h-4 w-4 animate-spin","aria-hidden":"true"}),"Send me a code"]})]}):g.jsxs("form",{className:"space-y-3",onSubmit:N=>{N.preventDefault(),_()},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:o,onChange:N=>c(N.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:d,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:[d&&g.jsx(Hs,{className:"h-4 w-4 animate-spin","aria-hidden":"true"}),"Verify"]}),g.jsx("button",{type:"button",onClick:()=>{i("email"),m(null),x(null)},className:"w-full cursor-pointer text-center text-xs text-[#666] transition-colors hover:text-[#aaa]",children:"Use a different email"})]})]})}const A7=[{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 C7({counts:e}){const t=A7.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 M7(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 h_(e){if(!e)return null;const t=e.trim().replace(" UTC","Z").replace(" ","T"),i=new Date(t);if(Number.isNaN(i.getTime()))return null;const a=Date.now()-i.getTime(),s=Math.floor(a/6e4);if(s<1)return"just now";if(s<60)return`${s}m ago`;const o=Math.floor(s/60);if(o<24)return`${o}h ago`;const c=Math.floor(o/24);return c<7?`${c}d ago`:M7(e)}function O7({runs:e,activeRun:t,onSelectRun:i,onVerified:a}){const s=(e==null?void 0:e.count)??0,[o,c]=ee.useState(!1);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(Gs,{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."]}),o?g.jsxs(g.Fragment,{children:[g.jsx("p",{className:"mx-auto mt-3 max-w-sm text-xs text-[#666]",children:"Verify your email with a one-time code to unlock the full history."}),g.jsx(T7,{onVerified:a})]}):g.jsx("button",{onClick:()=>{Ci("history_unlock","past_runs"),c(!0)},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(R_,{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(d=>{const f=d.name===t,h=h_(d.start_time)??h_(d.end_time),m=go(d.target,d.name);return g.jsxs("button",{onClick:()=>i(d.name),className:`group flex w-full cursor-pointer items-center gap-4 rounded-lg border px-4 py-3 text-left transition-colors ${f?"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:m}),f&&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:[d.scan_mode&&g.jsx("span",{className:"capitalize",children:d.scan_mode}),d.scan_mode&&(h||d.status)&&g.jsx("span",{className:"text-[#333]",children:"·"}),h&&g.jsx("span",{children:h}),h&&d.status&&g.jsx("span",{className:"text-[#333]",children:"·"}),d.status&&g.jsx("span",{className:"capitalize",children:d.status})]})]}),g.jsx(C7,{counts:d.severity_counts}),g.jsx(q2,{className:"h-4 w-4 flex-shrink-0 text-[#555] transition-colors group-hover:text-[#aaa]","aria-hidden":"true"})]},d.name)})})}const m_={work_email_required:"Please use your work email, not a personal one.",rate_limited:"Too many requests. Wait a minute and try again.",invalid_email:"That email does not look right. Check it and try again.",unavailable:"The email service is unavailable right now. Try again shortly."},R7={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."},D7=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 j7({activeRun:e,auth:t,purpose:i,skipDisclosure:a=!1,onAuthChanged:s,onExit:o}){const c=(t==null?void 0:t.verified)===!0,d=i==="verify",[f,h]=ee.useState(()=>d?"email":a?c?"sending":"email":"disclosure"),[m,p]=ee.useState((t==null?void 0:t.email)??""),[x,y]=ee.useState(""),[_,N]=ee.useState(!1),[S,w]=ee.useState(null),[k,E]=ee.useState(null),[M,U]=ee.useState(""),[R,B]=ee.useState(""),[I,Z]=ee.useState(!1),[j,z]=ee.useState(""),V=ee.useRef(!1),G=async()=>{h("sending"),w(null);const X=await y7(e);if(X.ok){Ti("report_sent"),U(X.password),B(X.filename),h("password");return}if(X.error==="reverify"||X.error==="unverified"){E("Your verification expired. Enter your email to verify again."),h("email");return}w(R7[X.error]??"Could not send the report. Try again."),h("disclosure")},A=()=>{w(null),E(null),c?G():h("email")};ee.useEffect(()=>{!d&&a&&c&&!V.current&&(V.current=!0,G())},[]);const q=async()=>{const X=m.trim();if(!X){w("Enter your email to continue.");return}const C=X.slice(X.lastIndexOf("@")+1).toLowerCase();if(D7.has(C)){Ti("work_email_required"),w(m_.work_email_required);return}N(!0),w(null);const L=await aS(X);N(!1),L.ok?(Ti("email_submitted",{purpose:i}),E(`We sent a 6-digit code to ${X}.`),h("code")):(L.error==="work_email_required"&&Ti("work_email_required"),w(m_[L.error]??"Could not send a code. Try again."))},O=async()=>{const X=x.trim();if(X.length<4){w("Enter the 6-digit code from your email.");return}N(!0),w(null);const C=await sS(m.trim(),X);if(N(!1),!C.verified){w("That code did not match. Check it and try again.");return}Ti("email_verified",{purpose:i}),z(C.email),s(),d?o("history"):G()},H=async()=>{try{await navigator.clipboard.writeText(M),Z(!0),setTimeout(()=>Z(!1),1500)}catch{}},K=j||(t==null?void 0:t.email)||m.trim();return g.jsxs("div",{className:"mx-auto max-w-md space-y-4",children:[g.jsxs("button",{onClick:()=>o(d?"history":"overview"),className:"cursor-pointer inline-flex items-center gap-1.5 text-sm text-[#888] transition-colors hover:text-white",children:[g.jsx(v_,{className:"h-4 w-4"}),d?"Back to past runs":"Back to results"]}),g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx(gp,{className:"h-5 w-5 text-[#888]","aria-hidden":"true"}),g.jsx("h1",{className:"text-2xl font-semibold text-white",children:d?"Verify your email":"Email report"})]}),g.jsxs("div",{className:"w-full rounded-2xl bg-[rgba(255,255,255,0.02)] p-6",style:{border:"1px solid #2a2a2a"},children:[g.jsx("p",{className:"mb-4 text-xs text-[#666]",children:d?"We send a one-time code to confirm it is you.":"Verified by a one-time code sent to your email"}),S&&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(hp,{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:S})]}),k&&!S&&f!=="password"&&g.jsx("p",{className:"mb-4 text-xs text-[#888]",children:k}),f==="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(vu,{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(DT,{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:A,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&&(t==null?void 0:t.email)&&g.jsxs("p",{className:"text-center text-xs text-[#666]",children:["Sending to ",t.email]})]}),f==="email"&&g.jsxs("form",{className:"space-y-4",onSubmit:X=>{X.preventDefault(),q()},children:[g.jsxs("label",{className:"block",children:[g.jsx("span",{className:"mb-1.5 block text-xs text-[#888]",children:"Your work email"}),g.jsx("input",{type:"email",autoFocus:!0,value:m,onChange:X=>p(X.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-[11px] text-[#666]",children:"Use your work email."})]}),g.jsxs("button",{type:"submit",disabled:_,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:[_&&g.jsx(Hs,{className:"h-4 w-4 animate-spin","aria-hidden":"true"}),"Send me a code"]})]}),f==="code"&&g.jsxs("form",{className:"space-y-4",onSubmit:X=>{X.preventDefault(),O()},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:x,onChange:X=>y(X.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:_,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:[_&&g.jsx(Hs,{className:"h-4 w-4 animate-spin","aria-hidden":"true"}),d?"Verify":"Verify and send"]}),g.jsx("button",{type:"button",onClick:()=>{h("email"),w(null),E(null)},className:"w-full cursor-pointer text-center text-xs text-[#666] transition-colors hover:text-[#aaa]",children:"Use a different email"})]}),f==="sending"&&g.jsxs("div",{className:"flex flex-col items-center gap-3 py-8",children:[g.jsx(Hs,{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..."})]}),f==="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(Fs,{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 ",K,". 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:M}),g.jsxs("button",{onClick:H,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:[I?g.jsx(Fs,{className:"h-3.5 w-3.5"}):g.jsx(ho,{className:"h-3.5 w-3.5"}),I?"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:R})]})]}),g.jsx("button",{onClick:()=>o("overview"),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"})]})]})]})}function ja(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:{}}function no(e){return Array.isArray(e)?e:[]}function Pi(e){return typeof e=="string"&&e.trim()?e:null}function La(e){return typeof e=="number"&&Number.isFinite(e)?e:null}function L7(e){return e.replace(/_/g," ")}function p_(e){return e&&e.charAt(0).toUpperCase()+e.slice(1)}function z7(e){if(e==null||e<0)return"n/a";const t=Math.floor(e/3600),i=Math.floor(e%3600/60),a=e%60;return t?`${t}h ${i}m ${a}s`:i?`${i}m ${a}s`:`${a}s`}function Dn({label:e,children:t}){return g.jsxs("div",{className:"grid grid-cols-[7rem_1fr] gap-3 items-baseline",children:[g.jsx("dt",{className:"text-[11px] uppercase tracking-wide text-[#666]",children:e}),g.jsx("dd",{className:"min-w-0 break-words text-sm text-[#ddd]",children:t})]})}function I7({raw:e,durationSeconds:t}){const[i,a]=ee.useState(!0),s=no(e.targets_info).map(V=>{const G=ja(V),A=Pi(G.original)??Pi(ja(G.details).target_url)??"unknown target",q=Pi(G.type);return{display:A,type:q?L7(q):null}}),o=Pi(e.instruction),c=p_(Pi(e.scan_mode)),d=Pi(e.scope_mode),f=ja(e.diff_scope),h=f.active===!0,m=Pi(f.mode),p=Pi(e.diff_base),x=e.non_interactive===!0,y=no(e.local_sources).map(V=>String(V)).filter(Boolean),_=p_(Pi(e.status));let N=d??"auto";h&&(N+=` (diff${m?`: ${m}`:""}${p?` vs ${p}`:""})`);const S=ja(e.llm_usage),w=Object.keys(S).length>0,k=no(S.agents).map(ja),E=Array.from(new Set(k.map(V=>Pi(V.model)).filter(V=>!!V))),M=La(S.requests),U=La(S.input_tokens),R=La(ja(no(S.input_tokens_details)[0]).cached_tokens),B=La(S.output_tokens),I=La(ja(no(S.output_tokens_details)[0]).reasoning_tokens),Z=La(S.total_tokens),j=La(S.cost),z=(V,G)=>g.jsxs("span",{className:"text-[#666]",children:[" (",Os(V)," ",G,")"]});return g.jsxs("div",{className:"rounded-xl border border-[#222] bg-[rgba(255,255,255,0.02)] p-5",children:[g.jsxs("button",{type:"button",onClick:()=>a(V=>!V),"aria-expanded":i,className:"flex w-full cursor-pointer items-center gap-2 text-left",children:[g.jsx(NT,{className:"h-4 w-4 text-[#888]","aria-hidden":"true"}),g.jsx("h2",{className:"text-sm font-semibold text-white",children:"Run details"}),i?g.jsx(N_,{className:"ml-auto h-4 w-4 text-[#666]","aria-hidden":"true"}):g.jsx(fo,{className:"ml-auto h-4 w-4 text-[#666]","aria-hidden":"true"})]}),i&&g.jsxs("div",{className:"mt-4 grid grid-cols-1 gap-x-8 gap-y-6 md:grid-cols-2",children:[g.jsxs("section",{children:[g.jsx("h3",{className:"mb-3 text-[11px] font-semibold uppercase tracking-wide text-[#555]",children:"Configuration"}),g.jsxs("dl",{className:"space-y-2.5",children:[s.length>0&&g.jsx(Dn,{label:"Targets",children:g.jsx("div",{className:"space-y-1",children:s.map((V,G)=>g.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[g.jsx("span",{className:"font-mono text-[#ddd]",children:V.display}),V.type&&g.jsx("span",{className:"rounded-full border border-[#2a2a2a] px-1.5 py-0.5 text-[10px] text-[#888]",children:V.type})]},G))})}),g.jsx(Dn,{label:"Instruction",children:o?g.jsx("span",{className:"whitespace-pre-wrap",children:o}):g.jsx("span",{className:"text-[#666]",children:"None"})}),c&&g.jsx(Dn,{label:"Scan mode",children:c}),g.jsx(Dn,{label:"Scope",children:N}),g.jsx(Dn,{label:"Mode",children:x?"Non-interactive":"Interactive"}),y.length>0&&g.jsx(Dn,{label:"Local sources",children:g.jsx("div",{className:"space-y-0.5 font-mono text-[#ddd]",children:y.map((V,G)=>g.jsx("div",{children:V},G))})}),_&&g.jsx(Dn,{label:"Status",children:_})]})]}),g.jsxs("section",{children:[g.jsx("h3",{className:"mb-3 text-[11px] font-semibold uppercase tracking-wide text-[#555]",children:"Usage & cost"}),w?g.jsxs("dl",{className:"space-y-2.5 tabular-nums",children:[g.jsx(Dn,{label:"Model",children:E.length?E.join(", "):"n/a"}),g.jsx(Dn,{label:"Run time",children:z7(t)}),M!=null&&g.jsx(Dn,{label:"Requests",children:Os(M)}),U!=null&&g.jsxs(Dn,{label:"Input tokens",children:[Os(U),R!=null&&z(R,"cached")]}),B!=null&&g.jsxs(Dn,{label:"Output tokens",children:[Os(B),I!=null&&z(I,"reasoning")]}),Z!=null&&g.jsx(Dn,{label:"Total tokens",children:Os(Z)}),j!=null&&g.jsxs(Dn,{label:"Cost",children:["$",j.toFixed(2)]}),k.length>0&&g.jsx(Dn,{label:"Agents",children:Os(k.length)})]}):g.jsx("p",{className:"text-sm text-[#666]",children:"Not available yet."})]})]})]})}const g_="strix_viewer_trust_dismissed";function B7({message:e}){const[t,i]=ee.useState(()=>{try{return localStorage.getItem(g_)==="1"}catch{return!1}});if(t)return null;const a=()=>{try{localStorage.setItem(g_,"1")}catch{}i(!0)};return g.jsx("div",{className:"fixed bottom-3 left-3 z-[60] max-w-xs rounded-lg bg-[#0a0a0a] p-3 shadow-2xl",style:{border:"1px solid #2a2a2a"},role:"status",children:g.jsxs("div",{className:"flex gap-2.5",children:[g.jsx(vu,{className:"mt-0.5 h-4 w-4 flex-shrink-0 text-emerald-400","aria-hidden":"true"}),g.jsx("p",{className:"text-xs leading-relaxed text-[#aaa]",children:e}),g.jsx("button",{onClick:a,"aria-label":"Dismiss",className:"-mr-0.5 -mt-0.5 flex-shrink-0 cursor-pointer rounded p-0.5 text-[#666] transition-colors hover:text-white",children:g.jsx(L_,{className:"h-3.5 w-3.5"})})]})})}const U7=[{icon:E_,text:"Continuous coverage: scheduled pentests and attack surface monitoring"},{icon:xA,text:"One-click autofix that opens a retested pull request"},{icon:C_,text:"Two-way sync to Jira, Linear, and Slack"},{icon:D_,text:"Your whole team, with roles and shared history"}];function H7({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(Hu,{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:U7.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:ca(Ao,e.slug),target:"_blank",rel:"noopener noreferrer",onClick:()=>Ci(e.slug,"feature_page"),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(Ps,{className:"h-3.5 w-3.5","aria-hidden":"true"})]}),g.jsxs("a",{href:ca(kA,e.slug),target:"_blank",rel:"noopener noreferrer",onClick:()=>Ci(e.slug,"feature_page_plans"),className:"inline-flex items-center gap-1 text-xs text-[#888] transition-colors hover:text-white",children:["View all plans",g.jsx(Ps,{className:"h-3 w-3","aria-hidden":"true"})]})]})]})})}const $7="Your findings stay on your machine. They're rendered here locally in your browser and never uploaded or stored by Strix.",b_=["critical","high","medium","low"],q7=500,P7=[{title:"One-click autofix + open a fix PR",desc:"Fix it for you and open a PR, retested.",slug:"autofix",icon:_u},{title:"Export SOC 2 / ISO 27001 report",desc:"Share an auditor-ready report with your team.",slug:"compliance",icon:cT}],F7=[{title:"Scheduled pentesting",desc:"Continuous coverage for your whole org.",slug:"scheduled",icon:E_},{title:"Attack surface monitoring",desc:"Continuous coverage for your whole org.",slug:"asm",icon:M_},{title:"PR reviews",desc:"Pentest every pull request your team opens.",slug:"pr_reviews",icon:mp}];function G7(){const[e,t]=ee.useState(null),[i,a]=ee.useState(null),[s,o]=ee.useState(null),[c,d]=ee.useState(null),[f,h]=ee.useState("overview"),[m,p]=ee.useState(null),[x,y]=ee.useState(null),[_,N]=ee.useState(null),[S,w]=ee.useState("report"),[k,E]=ee.useState(!1),[M,U]=ee.useState(!1),R=ee.useCallback(async()=>{try{y(await b7())}catch{}},[]),B=ee.useCallback(async()=>{try{N(await m7())}catch{}},[]);ee.useEffect(()=>{R(),B(),p7().then(D=>U(D.can_steer)).catch(()=>{})},[R,B]);const I=ee.useRef(!1);ee.useEffect(()=>{let D=!1,F;I.current=!1;const $=()=>{F=setTimeout(Q,q7)},Q=async()=>{if(!D)try{const{summary:J,raw:W,finished:te}=await nS(e);if(D)return;if(te&&!I.current){I.current=!0;const be=await c_(e);D||a(be);return}const[oe,fe]=await Promise.all([rS(e).catch(()=>({agents:[],events:[]})),iS(J.runId,e).catch(()=>[])]);if(D)return;a(be=>({summary:J,raw:W,finished:te,transcript:oe,vulnerabilities:fe,reportMarkdown:(be==null?void 0:be.reportMarkdown)??null})),$()}catch(J){if(D)return;o(J instanceof Error?J.message:"Could not load run data."),$()}};return(async()=>{try{const J=await c_(e);if(D)return;a(J),J.finished?I.current=!0:$()}catch(J){if(D)return;o(J instanceof Error?J.message:"Could not load run data."),$()}})(),()=>{D=!0,F&&clearTimeout(F)}},[e]);const Z=ee.useMemo(()=>i?f7(i.vulnerabilities):null,[i]),j=(i==null?void 0:i.vulnerabilities.find(D=>D.id===c))??null,z=(i==null?void 0:i.transcript.agents.length)??0,V=(x==null?void 0:x.verified)===!0,G=ee.useRef(!1);ee.useEffect(()=>{G.current=!1},[e]),ee.useEffect(()=>{G.current||!i||(i.finished?(G.current=!0,h("overview")):z>0&&(G.current=!0,h("agents")))},[i,z]);const A=ee.useCallback(D=>{G.current=!0,h(D)},[]),q=ee.useCallback(D=>{t(D),d(null),a(null),o(null),G.current=!1},[]),O=ee.useCallback((D,F)=>{Ci("email_report",F),w("report"),E(D),A("email")},[A]),H=ee.useCallback(()=>O(!1,"sidebar"),[O]),K=ee.useCallback(()=>O(!0,"overview"),[O]),X=ee.useCallback(()=>{B(),A("history")},[B,A]),C=ee.useCallback(async()=>{await R(),await B()},[R,B]),L=ee.useCallback(D=>{Ci(D,"sidebar_nav"),p(D),A("feature")},[A]),Y=ee.useCallback(async()=>{await x7(),await R(),await B()},[R,B]);return g.jsxs("div",{className:"min-h-screen bg-black text-white flex",children:[g.jsx(S7,{view:f,onSelectView:D=>{D==="history"?X():A(D)},activeFeature:m,onSelectFeature:L,issuesCount:(i==null?void 0:i.vulnerabilities.length)??0,agentCount:z,runCount:(_==null?void 0:_.count)??0,verified:V,email:(x==null?void 0:x.email)??null,onOpenEmail:H,onOpenHistory:X,onForget:()=>void Y()}),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:ca("https://app.strix.ai","logo"),target:"_blank",rel:"noopener noreferrer",onClick:()=>Ci("logo","topbar"),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(Y7,{finished:i.finished}),g.jsxs("div",{className:"ml-auto flex items-center gap-3",children:[V&&_&&!_.locked&&_.runs.length>0&&g.jsx(V7,{runs:_,activeRun:e,launchedName:go((i==null?void 0:i.summary.targets[0])??null,(i==null?void 0:i.summary.runName)??(i==null?void 0:i.summary.runId)??"Current run"),onSelect:q}),g.jsxs("a",{href:ca(Ao,"run_in_cloud"),target:"_blank",rel:"noopener noreferrer",onClick:()=>Ci("run_in_cloud","topbar"),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(Ps,{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:[s&&!i&&f!=="history"&&f!=="email"&&f!=="feature"&&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(hp,{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})]}),f==="email"?g.jsx(j7,{activeRun:e,auth:x,purpose:S,skipDisclosure:k,onAuthChanged:()=>{R(),B()},onExit:D=>h(D==="history"?"history":"overview")}):f==="feature"&&m&&dp[m]?g.jsx(H7,{feature:dp[m]}):f==="history"?g.jsxs("div",{className:"space-y-4",children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx(Gs,{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(O7,{runs:_,activeRun:e,onSelectRun:q,onVerified:()=>void C()})]}):!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&&Z?g.jsxs(g.Fragment,{children:[g.jsx(K7,{summary:i.summary}),g.jsxs("div",{className:"flex gap-5 border-b border-[#2a2a2a] lg:hidden",children:[g.jsx(Dm,{active:f==="overview",onClick:()=>A("overview"),children:"Overview"}),g.jsxs(Dm,{active:f==="issues",onClick:()=>A("issues"),children:["Issues",i.vulnerabilities.length>0?` (${i.vulnerabilities.length})`:""]}),z>0&&g.jsxs(Dm,{active:f==="agents",onClick:()=>A("agents"),children:["Agents (",z,")"]})]}),f==="overview"?g.jsx(eH,{summary:i.summary,counts:Z,total:i.vulnerabilities.length,reportMarkdown:i.reportMarkdown,raw:i.raw,onOpenEmail:K}):f==="agents"&&z>0?g.jsx(tH,{run:i,canSteer:M}):j?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(v_,{className:"w-4 h-4"})," Back to all findings"]}),g.jsx(JD,{vulnerability:j})]}):g.jsx(Z7,{vulnerabilities:i.vulnerabilities,finished:i.finished,onSelect:D=>d(D)})]}):null]})]}),g.jsx(B7,{message:$7})]})}function V7({runs:e,activeRun:t,launchedName:i,onSelect:a}){const[s,o]=ee.useState(!1),c=e.runs.find(f=>f.name===t),d=c?go(c.target,c.name):i;return g.jsxs("div",{className:"relative",children:[g.jsxs("button",{onClick:()=>o(f=>!f),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(Gs,{className:"w-3.5 h-3.5","aria-hidden":"true"}),g.jsx("span",{className:"max-w-[160px] truncate",children:d}),g.jsx(fo,{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(f=>{const h=f.name===t;return g.jsxs("button",{onMouseDown:()=>a(f.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:go(f.target,f.name)}),f.target&&g.jsx("span",{className:"block truncate font-mono text-[#666]",children:f.target})]}),h&&g.jsx("span",{className:"h-1.5 w-1.5 flex-shrink-0 rounded-full bg-emerald-400"})]},f.name)})})]})}function Y7({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 X7(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 K7({summary:e}){const t=X7(e.durationSeconds);return g.jsxs("div",{children:[g.jsx("h1",{className:"text-2xl font-semibold text-white",children:go(e.targets[0]??null,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(Rm,{label:e.scanMode}),t&&g.jsx(Rm,{label:t}),e.status&&g.jsx(Rm,{label:e.status})]})]})}function Rm({label:e}){return g.jsxs(g.Fragment,{children:[g.jsx("span",{className:"text-[#333]",children:"·"}),g.jsx("span",{className:"capitalize",children:e})]})}function Z7({vulnerabilities:e,finished:t,onSelect:i}){const a=[...e].sort((s,o)=>b_.indexOf(s.severity)-b_.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(ao,{label:"Attack surface monitoring",desc:"Continuous coverage for your whole org.",slug:"asm",surface:"empty_state",icon:M_})]})]}):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 ${bp(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 ${z_[s.severity]}`,children:s.severity})]},s.id))})}function Q7(e){return e.replace(/^\s*#{1,6}[ \t]+.*(?:\r?\n)+/,"").trimStart()}function W7(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 J7({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(gp,{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 eH({summary:e,counts:t,total:i,reportMarkdown:a,raw:s,onOpenEmail:o}){const c=[["Executive Summary",e.executiveSummary],["Technical Analysis",e.technicalAnalysis],["Methodology",e.methodology],["Recommendations",e.recommendations]].filter(([,d])=>!!d).map(([d,f])=>({title:d,content:Q7(f)}));return g.jsxs("div",{className:"space-y-6",children:[g.jsx(I7,{raw:s,durationSeconds:e.durationSeconds}),i>0&&g.jsx("div",{className:"rounded-xl border border-[#222] bg-[rgba(255,255,255,0.02)] p-5",children:g.jsx(ej,{findings:{total:i,...t}})}),g.jsx(J7,{onOpenEmail:o}),c.length>0?g.jsx("div",{className:"rounded-xl border border-[#222] bg-[rgba(255,255,255,0.02)] p-5 space-y-8",children:c.map(d=>g.jsx(aa,{title:d.title,content:d.content},d.title))}):a?g.jsx("div",{className:"rounded-xl border border-[#222] bg-[rgba(255,255,255,0.02)] p-5",children:g.jsx(aa,{content:W7(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:P7.map(d=>g.jsx(ey,{item:d,surface:"overview"},d.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:F7.map(d=>g.jsx(ey,{item:d,surface:"overview"},d.slug))})]})]})}function Dm({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 tH({run:e,canSteer:t}){const{agents:i,events:a}=e.transcript,s=ee.useMemo(()=>n7(i,a),[i,a]),[o,c]=ee.useState(null),d=o?i.find(h=>h.id===o)??null:null,f=t&&!e.finished;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(j_,{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:[i.length," agent",i.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(P9,{agents:s,selectedAgentId:o,onSelectAgent:h=>c(h),eventsLoaded:!0,eventsEmpty:s.size===0,scanCompleted:e.finished})})]}),f&&g.jsx(lS,{agents:i}),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:"Run this scan with more depth"}),g.jsx("p",{className:"mt-0.5 text-xs text-[#666]",children:"Re-run this scan on managed infra in the cloud."}),g.jsx("div",{className:"mt-3 flex flex-wrap gap-2.5",children:g.jsx(ao,{label:"Re-run in Strix Cloud with more depth",desc:"Run this scan on managed infra with more depth.",slug:"live_scan",surface:"agents",icon:tA})})]}),d&&g.jsx(w7,{agent:d,events:a,steerable:f,onClose:()=>c(null)})]})}y2.createRoot(document.getElementById("root")).render(g.jsx(ee.StrictMode,{children:g.jsx(G7,{})})); diff --git a/strix/viewer/viewer_dist/index.html b/strix/viewer/viewer_dist/index.html index 405f969c..e6d4816b 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 697f249e..d8618b87 100644 --- a/strix/viewer_src/src/App.tsx +++ b/strix/viewer_src/src/App.tsx @@ -52,7 +52,7 @@ import { FEATURES } from "@/lib/pro-features"; export type View = "overview" | "issues" | "agents" | "history" | "feature" | "email"; const TRUST_BANNER = - "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."; + "Your findings stay on your machine. They're rendered here locally in your browser and never uploaded or stored by Strix."; const SEVERITY_ORDER: VulnerabilitySeverity[] = ["critical", "high", "medium", "low"]; const POLL_MS = 500;