PageSourceSearch

https://classsight.ai/assets/VendorComplianceDetailPage-2zaxAygk.js

js classsight.ai collected 2026-09-24 13:54:26 UTC 11,237 bytes, 1 lines download raw bytes

1import{j as e}from"./vendor-markdown-Daxr8BJC.js";import{r as _}from"./vendor-charts-qvx8-m0G.js";import{aK as D,K as O,P,C as x,d as h,T as U,b as d,a9 as S,h as H,a as c,i as w,L as Y,a5 as G,r as M,Q as W,t as R,u as L,H as j,F as q}from"./index-DVHzHwfb.js";import{S as Q}from"./separator-ufW44cKs.js";import{u as J,a as X,U as E,V as Z,v as I,f as ee}from"./useComplianceAcknowledgments-Cy1-HIq5.js";import{A as T}from"./arrow-left-CbtiKeCC.js";import{S as se}from"./shield-alert-DJaRZQde.js";import{E as ae}from"./external-link-BUHz4glL.js";import{L as te}from"./link-2-Cqk1FwGs.js";import"./vendor-pdf-SjvVsPhg.js";const re={critical:{label:"Critical",cls:"bg-red-100 text-red-800 border-red-300"},high:{label:"High",cls:"bg-orange-100 text-orange-800 border-orange-300"},medium:{label:"Medium",cls:"bg-amber-100 text-amber-800 border-amber-300"},low:{label:"Low",cls:"bg-yellow-50 text-yellow-800 border-yellow-200"},clean:{label:"Clean",cls:"bg-emerald-100 text-emerald-800 border-emerald-300"}},F={failed:"bg-red-500",warning:"bg-amber-500",needs_verification:"bg-slate-400",passed:"bg-emerald-500"},le={failed:"Failed",warning:"Warning",needs_verification:"Needs review",passed:"Passed"},ne={failed:"bg-red-50 text-red-700 border-red-200",warning:"bg-amber-50 text-amber-700 border-amber-200",needs_verification:"bg-slate-50 text-slate-700 border-slate-200",passed:"bg-emerald-50 text-emerald-700 border-emerald-200"},B={critical:"bg-red-100 text-red-800 border-red-300",high:"bg-orange-100 text-orange-800 border-orange-300",medium:"bg-amber-100 text-amber-800 border-amber-300",low:"bg-slate-100 text-slate-700 border-slate-300"},ie=["privacy","dataSharing","security","accessibility","vendor"];function de(t){if(!t)return[];const l=/https?:\/\/[^\s)]+/g;return Array.from(new Set(t.match(l)||[]))}const we=()=>{const{softwareId:t}=D(),l=O(),{profiles:o,latestRunAt:p,isLoading:u,error:f,refetch:y}=J(),m=X(),[k,$]=_.useState(!1),s=_.useMemo(()=>o.find(a=>a.softwareId===t||a.softwareName===t),[o,t]);if(u)return e.jsx("div",{className:"container mx-auto py-8 px-4",children:e.jsx("div",{className:"flex items-center justify-center h-64",children:e.jsxs("div",{className:"text-center",children:[e.jsx(P,{size:40,label:""}),e.jsx("p",{className:"mt-2 text-muted-foreground",children:"Loading vendor compliance details…"})]})})});if(f)return e.jsx("div",{className:"container mx-auto py-8 px-4",children:e.jsx(x,{children:e.jsxs(h,{className:"py-10 text-center",children:[e.jsx(U,{className:"h-10 w-10 text-red-500 mx-auto mb-2"}),e.jsx("p",{className:"text-sm text-red-700",children:f}),e.jsxs(d,{variant:"outline",className:"mt-4",onClick:y,children:[e.jsx(S,{className:"h-4 w-4 mr-2"}),"Retry"]})]})})});if(!s)return e.jsxs("div",{className:"container mx-auto py-8 px-4",children:[e.jsxs(d,{variant:"ghost",size:"sm",onClick:()=>l("/compliance-report"),children:[e.jsx(T,{className:"h-4 w-4 mr-1"}),"Back to Compliance Report"]}),e.jsx(x,{className:"mt-4",children:e.jsxs(h,{className:"py-10 text-center",children:[e.jsx(H,{className:"h-10 w-10 text-emerald-500 mx-auto mb-3"}),e.jsx("p",{className:"text-sm font-medium",children:"No compliance findings for this vendor"}),e.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:['Vendor "',t,'" was not included in the latest compliance run.']})]})})]});const C=re[s.riskBand],K=[...s.items].sort((a,r)=>{const n={failed:4,warning:3,needs_verification:2,passed:1};return n[r.status]-n[a.status]}),g=m.isVendorAcked(s.softwareId),b=a=>m.isFindingAcked(s.softwareId,a.rule_id,a.rule_name),V=async()=>{try{g?(await m.unacknowledge("vendor",I(s.softwareId)),j.success(`${s.softwareName} reopened`)):(await m.acknowledge({scope:"vendor",targetKey:I(s.softwareId),softwareKey:s.softwareId,softwareName:s.softwareName}),j.success(`${s.softwareName} marked as reviewed`))}catch(a){j.error((a==null?void 0:a.message)||"Could not update acknowledgment")}},z=async a=>{const r=ee(s.softwareId,a.rule_id,a.rule_name);try{b(a)?await m.unacknowledge("finding",r):await m.acknowledge({scope:"finding",targetKey:r,softwareKey:s.softwareId,softwareName:s.softw
1areName,ruleId:a.rule_id,ruleName:a.rule_name})}catch(n){j.error((n==null?void 0:n.message)||"Could not update acknowledgment")}};return e.jsxs("div",{className:"container mx-auto py-8 px-4 space-y-6",children:[e.jsxs("div",{className:"flex items-start justify-between gap-4 flex-wrap",children:[e.jsxs("div",{children:[e.jsxs(d,{variant:"ghost",size:"sm",onClick:()=>l("/compliance-report"),className:"mb-2 -ml-2",children:[e.jsx(T,{className:"h-4 w-4 mr-1"}),"Back to Compliance Report"]}),e.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[e.jsx(se,{className:"h-6 w-6 text-muted-foreground"}),e.jsx("h1",{className:"text-2xl font-bold",children:s.softwareName}),e.jsxs(c,{variant:"outline",className:C.cls,children:[C.label," · Risk score ",s.riskScore]}),g&&e.jsxs(c,{variant:"outline",className:"bg-emerald-50 text-emerald-700 border-emerald-200",children:[e.jsx(w,{className:"h-3 w-3 mr-1"}),"Reviewed"]})]}),p&&e.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["Last evaluated ",new Date(p).toLocaleString()]})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(d,{variant:g?"outline":"default",size:"sm",onClick:V,children:g?e.jsxs(e.Fragment,{children:[e.jsx(E,{className:"h-4 w-4 mr-1"}),"Reopen vendor"]}):e.jsxs(e.Fragment,{children:[e.jsx(w,{className:"h-4 w-4 mr-1"}),"Acknowledge vendor"]})}),e.jsxs(d,{variant:"outline",size:"sm",onClick:y,children:[e.jsx(S,{className:"h-4 w-4 mr-1"}),"Refresh"]}),s.softwareId&&s.softwareId!==s.softwareName&&e.jsx(d,{asChild:!0,size:"sm",children:e.jsxs(Y,{to:`/software/${s.softwareId}`,children:[e.jsx(ae,{className:"h-4 w-4 mr-1"}),"Open software profile"]})})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(G,{id:"detail-hide-acked",checked:k,onCheckedChange:$}),e.jsxs(M,{htmlFor:"detail-hide-acked",className:"text-xs flex items-center gap-1 cursor-pointer",children:[e.jsx(W,{className:"h-3 w-3"}),"Hide acknowledged findings"]})]}),e.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3",children:[e.jsx(N,{label:"Failed",value:s.counts.failed,cls:"text-red-700"}),e.jsx(N,{label:"Warnings",value:s.counts.warning,cls:"text-amber-700"}),e.jsx(N,{label:"Needs review",value:s.counts.needsVerification,cls:"text-slate-700"}),e.jsx(N,{label:"Passed",value:s.counts.passed,cls:"text-emerald-700"})]}),e.jsxs("div",{className:"grid lg:grid-cols-3 gap-6",children:[e.jsxs("div",{className:"lg:col-span-2 space-y-6",children:[ie.map(a=>{const r=s.categories[a];if(!r.items.length)return null;const n=k?r.items.filter(i=>!b(i)):r.items;return n.length===0?null:e.jsxs(x,{children:[e.jsx(R,{className:"pb-3",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs(L,{className:"text-base flex items-center gap-2",children:[e.jsx("span",{className:`h-2.5 w-2.5 rounded-full ${F[r.status]}`}),Z[a]]}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:[r.failed," failed · ",r.warning," warning · ",r.needsVerification," needs review · ",r.passed," passed"]})]})}),e.jsx(h,{className:"space-y-3 pt-0",children:n.sort((i,v)=>{const A={failed:4,warning:3,needs_verification:2,passed:1};return A[v.status]-A[i.status]}).map((i,v)=>e.jsx(ce,{item:i,index:v,acked:b(i),onToggleAck:()=>z(i)},i.id))})]},a)}),K.length===0&&e.jsx(x,{children:e.jsx(h,{className:"py-10 text-center text-sm text-muted-foreground",children:"No findings recorded for this vendor."})})]}),e.jsx("div",{className:"space-y-4",children:e.jsxs(x,{children:[e.jsx(R,{className:"pb-3",children:e.jsx(L,{className:"text-base",children:"Recommended Remediation"})}),e.jsx(h,{className:"pt-0",children:s.recommendedActions.length===0?e.jsx("p",{className:"text-xs text-muted-foreground",children:"No remediation steps required."}):e.jsx("ol",{className:"space-y-3",children:s.recommendedActions.map((a,r)=>e.jsxs("li",{className:"text-sm",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsxs("span",{className:"font-mono text-xs text-muted-foreground mt-0.5",children:[r+1,"."]}),e.jsxs("div",{className:"flex-1",children:[e.jsx(c,{variant:"outline",className:`${B[a.priority]} text-[10px] mr-1.5 mb-1`,children:a.priority}),e.jsx("p",{className:"text-slate-700 text-sm leading-snug",children:a.label}),a.source!=="system"&&e.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["Source: ",e.jsx("span",{className:"font-medium",children:a.source})]})]})]}),r<s.recommendedActions.length-1&&e.jsx(Q,{className:"mt-3"})]},r))})})]})})]})]})},N=({label:t,value:l,cls:o})=>e.jsx(x,{children:e.jsxs(h,{className:"py-3",children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:t}),e.jsx("p",{className:`text-2xl font-bold ${o}`,children:l})]})}),ce=({item:t,acked:l,onToggleAck:o})=>{const p=de(t.details);return e.jsxs("div",{className:`border rounded-md p-3 bg-card/50 ${l?"opacity-70":""}`,children:[e.jsxs("div",{className:"flex items-start justify-between gap-2 flex-wrap",children:[e.jsxs("div",{className:"flex items-start gap-2 flex-1 min-w-0",children:[e.jsx("span",{className:`h-2 w-2 rounded-full mt-1.5 ${F[t.status]}`}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:`font-medium text-sm text-slate-800 ${l?"line-through":""}`,children:t.rule_name}),e.jsxs("div",{className:"flex flex-wrap gap-1.5 mt-1",children:[e.jsx(c,{variant:"outline",className:`${ne[t.status]} text-[10px]`,children:le[t.status]}),t.regulation_type&&e.jsx(c,{variant:"outline",className:"text-[10px]",children:t.regulation_type.toUpperCase()}),t.severity&&e.jsx(c,{variant:"outline",className:`${B[t.severity.toLowerCase()]||""} text-[10px]`,children:t.severity}),l&&e.jsxs(c,{variant:"outline",className:"bg-emerald-50 text-emerald-700 border-emerald-200 text-[10px]",children:[e.jsx(w,{className:"h-3 w-3 mr-0.5"}),"Reviewed"]})]})]})]}),e.jsx(d,{variant:"outline",size:"sm",onClick:o,className:"h-7 text-xs",children:l?e.jsxs(e.Fragment,{children:[e.jsx(E,{className:"h-3.5 w-3.5 mr-1"}),"Reopen"]}):e.jsxs(e.Fragment,{children:[e.jsx(w,{className:"h-3.5 w-3.5 mr-1"}),"Acknowledge"]})})]}),t.details&&e.jsxs("div",{className:"mt-2.5 pl-4",children:[e.jsxs("p",{className:"text-xs font-medium text-muted-foreground flex items-center gap-1",children:[e.jsx(q,{className:"h-3 w-3"}),"Evidence"]}),e.jsx("p",{className:"text-xs text-slate-600 mt-0.5 whitespace-pre-wrap",children:t.details})]}),p.length>0&&e.jsxs("div",{className:"mt-2 pl-4",children:[e.jsxs("p",{className:"text-xs font-medium text-muted-foreground flex items-center gap-1",children:[e.jsx(te,{className:"h-3 w-3"}),"Sources"]}),e.jsx("ul",{className:"mt-0.5 space-y-0.5",children:p.map((u,f)=>e.jsx("li",{children:e.jsx("a",{href:u,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-primary hover:underline break-all",children:u})},f))})]}),t.remediation_steps&&e.jsxs("div",{className:"mt-2 pl-4",children:[e.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Recommended fix"}),e.jsx("p",{className:"text-xs text-slate-700 mt-0.5 whitespace-pre-wrap",children:t.remediation_steps})]})]})};export{we as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.