1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[14001],{14001:(e,t,r)=>{r.r(t),r.d(t,{default:()=>p});var l=r(95155),n=r(11228),o=r(12115),s=r(68209),i=r(4373),a=r(31034);let c={REQUESTED:i.C.muted,IMPACT_ASSESSED:i.C.amber,APPROVED:i.C.blue,IMPLEMENTED:i.C.purple,VERIFIED:i.C.green,REJECTED:i.C.red,WITHDRAWN:i.C.muted},d={LOW:i.C.green,MEDIUM:i.C.amber,HIGH:i.C.red};function p(){var e,t;let{studyId:r}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},[n,p]=(0,o.useState)([]),[x,b]=(0,o.useState)({}),[C,g]=(0,o.useState)(!0),[y,j]=(0,o.useState)(""),[f,m]=(0,o.useState)(null),S=(0,o.useCallback)(async()=>{g(!0),j("");try{var e,t;let l=await (0,s.apiFetch)("/api/quality/change-controls".concat(r?"?studyId=".concat(r):"")),n=await l.json();if(!l.ok)throw Error(n.error||"Failed");p(null!=(e=n.changeControls)?e:[]),b(null!=(t=n.counts)?t:{})}catch(e){j(e.message)}g(!1)},[r]);return(0,o.useEffect)(()=>{S()},[S]),(0,l.jsxs)("div",{style:{display:"flex",gap:16},children:[(0,l.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,l.jsxs)("div",{style:{display:"flex",gap:16,alignItems:"baseline",marginBottom:12},children:[(0,l.jsx)("h2",{style:{margin:0,color:i.C.text,fontSize:18},children:"Change control"}),(0,l.jsxs)("span",{style:{color:i.C.muted,fontSize:13},children:[(0,l.jsxs)("span",{style:{color:i.C.amber},children:[null!=(e=x.open)?e:0," open"]}),(null!=(t=x.highRiskOpen)?t:0)>0&&(0,l.jsxs)("span",{style:{color:i.C.red},children:[" \xb7 ",x.highRiskOpen," HIGH-risk in flight"]})]}),(0,l.jsx)("div",{style:{flex:1}}),(0,l.jsx)("button",{onClick:()=>m("new"),style:{...a.rT,borderColor:i.C.accent,color:"#fff",background:i.C.accent},children:"+ New"})]}),y&&(0,l.jsx)(a.lZ,{color:i.C.red,children:y}),C?(0,l.jsx)(a.lZ,{color:i.C.muted,children:"Loadingâ¦"}):(0,l.jsxs)("table",{style:a.c1,children:[(0,l.jsx)("thead",{children:(0,l.jsxs)("tr",{children:[(0,l.jsx)(a.Th,{children:"#"}),(0,l.jsx)(a.Th,{children:"Title"}),(0,l.jsx)(a.Th,{children:"Type"}),(0,l.jsx)(a.Th,{children:"Risk"}),(0,l.jsx)(a.Th,{children:"Status"}),(0,l.jsx)(a.Th,{children:"Updated"})]})}),(0,l.jsxs)("tbody",{children:[0===n.length&&(0,l.jsx)("tr",{children:(0,l.jsx)("td",{colSpan:6,style:{...h,textAlign:"center",color:i.C.muted},children:"No change controls."})}),n.map(e=>{var t,r;return(0,l.jsxs)("tr",{onClick:()=>m(e.id),style:{cursor:"pointer"},children:[(0,l.jsx)(a.Td,{children:null!=(t=e.ccNumber)?t:e.id.slice(-6)}),(0,l.jsx)(a.Td,{children:(0,l.jsx)("span",{style:{color:i.C.text},children:e.title})}),(0,l.jsx)(a.Td,{children:e.changeType}),(0,l.jsx)(a.Td,{children:(0,l.jsx)(a.ab,{color:null!=(r=d[e.riskLevel])?r:i.C.muted,children:e.riskLevel})}),(0,l.jsx)(a.Td,{children:(0,l.jsx)(a.ab,{color:c[e.status],children:e.status})}),(0,l.jsx)(a.Td,{children:(0,a.qw)(e.updatedAt)})]},e.id)})]})]})]}),f&&(0,l.jsx)(u,{id:f,onClose:()=>m(null),onChanged:S})]})}let h={padding:"8px 10px",fontSize:13,color:i.C.textSec,borderBottom:"1px solid ".concat(i.C.border)};function u(e){var t;let{id:r,onClose:p,onChanged:h}=e,[u,b]=(0,o.useState)(null),[C,g]=(0,o.useState)(!1),[y,j]=(0,o.useState)(""),f=(0,o.useCallback)(async()=>{if("new"===r)return void b({isNew:!0});try{let e=await (0,s.apiFetch)("/api/quality/change-controls?id=".concat(r)),t=await e.json();if(!e.ok)throw Error(t.error);b(t.changeControl)}catch(e){j(e.message)}},[r]);(0,o.useEffect)(()=>{f()},[f]);let m=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],l={};for(let e of t){let t=await (0,n.Vb)(e);if(!t)return;"riskLevel"===e?l[e]=t.toUpperCase():l[e]=t}g(!0),j("");try{let t=await (0,s.apiFetch)("/api/quality/change-controls",{method:"PATCH",body:JSON.stringify({id:r,action:e,...l})}),n=await t.json();if(!t.ok)throw Error(n.error);await f(),h()}catch(e){j(e.message)}g(!1)};if(!u)return null;if(u.isNew)return(0,l.jsx)(x,{onClose:p,onCreated:()=>{p(),h()}});let S=function(e){switch(e){case"REQUESTED":return[{key:"assess",label:"Assess impact",needs:["impactAssessment","riskLevel"]},{key:"reject",label:"Reject",needs:["rejectionReason"],danger:!0},{key:"withdraw",label:"Withdraw"}];case"IMPACT_ASSESSED":return[{key:"approve",label:"Approve"},{key:"reject",label:"Reject",needs:["rejectionReason"],danger:!0},{key:"withdraw",label:"Withdraw"}];case"APPROVED":return[{key:"implement",label:"Mark implemented",needs:["implementationPlan"]}];
1case"IMPLEMENTED":return[{key:"verify",label:"Verify effectiveness",needs:["verificationNotes"]}];default:return[]}}(u.status);return(0,l.jsxs)("aside",{style:a.ip,children:[(0,l.jsxs)("div",{style:{display:"flex",gap:8,marginBottom:12},children:[(0,l.jsxs)("strong",{style:{flex:1,color:i.C.text},children:[null!=(t=u.ccNumber)?t:u.id.slice(-6)," \xb7 ",u.title]}),(0,l.jsx)("button",{onClick:p,style:a.wJ,children:"â"})]}),y&&(0,l.jsx)(a.lZ,{color:i.C.red,children:y}),(0,l.jsx)(a.KV,{label:"Type",value:u.changeType}),(0,l.jsx)(a.KV,{label:"Risk",value:(0,l.jsx)(a.ab,{color:d[u.riskLevel],children:u.riskLevel})}),(0,l.jsx)(a.KV,{label:"Status",value:(0,l.jsx)(a.ab,{color:c[u.status],children:u.status})}),(0,l.jsx)(a.KV,{label:"Description",value:(0,l.jsx)("span",{style:{whiteSpace:"pre-wrap"},children:u.description})}),u.impactAssessment&&(0,l.jsx)(a.KV,{label:"Impact",value:(0,l.jsx)("span",{style:{whiteSpace:"pre-wrap"},children:u.impactAssessment})}),u.cardanoTxHash&&(0,l.jsx)(a.KV,{label:"Anchor",value:(0,l.jsxs)("span",{style:{color:i.C.green,fontFamily:"monospace",fontSize:11},children:[u.cardanoTxHash.slice(0,12),"â¦"]})}),S.length>0&&(0,l.jsx)("div",{style:{display:"flex",flexWrap:"wrap",gap:6,marginTop:12},children:S.map(e=>(0,l.jsx)("button",{disabled:C,onClick:()=>m(e.key,e.needs),style:{...a.rT,borderColor:e.danger?i.C.red:i.C.accent,color:e.danger?i.C.red:i.C.text},children:e.label},e.key))})]})}function x(e){let{onClose:t,onCreated:r}=e,[n,c]=(0,o.useState)({title:"",description:"",changeType:"PROCESS",riskLevel:"MEDIUM"}),[d,p]=(0,o.useState)(!1),[h,u]=(0,o.useState)(""),x=async()=>{p(!0),u("");try{let e=await (0,s.apiFetch)("/api/quality/change-controls",{method:"POST",body:JSON.stringify(n)}),t=await e.json();if(!e.ok)throw Error(t.error);r()}catch(e){u(e.message)}p(!1)};return(0,l.jsxs)("aside",{style:a.ip,children:[(0,l.jsxs)("div",{style:{display:"flex",gap:8,marginBottom:12},children:[(0,l.jsx)("strong",{style:{flex:1,color:i.C.text},children:"New change control"}),(0,l.jsx)("button",{onClick:t,style:a.wJ,children:"â"})]}),h&&(0,l.jsx)(a.lZ,{color:i.C.red,children:h}),(0,l.jsx)(a.pd,{label:"Title",value:n.title,onChange:e=>c({...n,title:e})}),(0,l.jsx)(a.pd,{label:"Description",value:n.description,onChange:e=>c({...n,description:e}),multiline:!0}),(0,l.jsx)(a.l6,{label:"Type",value:n.changeType,onChange:e=>c({...n,changeType:e}),options:["PROCESS","SYSTEM","DOCUMENT","INFRASTRUCTURE","PROTOCOL","SUPPLIER"]}),(0,l.jsx)(a.l6,{label:"Risk",value:n.riskLevel,onChange:e=>c({...n,riskLevel:e}),options:["LOW","MEDIUM","HIGH"]}),(0,l.jsx)("button",{disabled:d,onClick:x,style:{...a.rT,borderColor:i.C.accent},children:d?"â¦":"Create"})]})}},31034:(e,t,r)=>{r.d(t,{KV:()=>i,Td:()=>x,Th:()=>u,ab:()=>o,c1:()=>d,ip:()=>b,l6:()=>c,lZ:()=>s,pd:()=>a,qw:()=>j,rT:()=>y,rf:()=>C,wJ:()=>g});var l=r(95155),n=r(4373);function o(e){let{color:t,children:r}=e;return(0,l.jsx)("span",{style:{padding:"1px 8px",borderRadius:999,background:"".concat(t,"22"),color:t,border:"1px solid ".concat(t,"66"),fontSize:11,whiteSpace:"nowrap"},children:r})}function s(e){let{color:t,children:r}=e;return(0,l.jsx)("div",{style:{padding:8,borderRadius:6,background:"".concat(t,"22"),color:t,border:"1px solid ".concat(t,"66"),fontSize:12,marginBottom:8},children:r})}function i(e){let{label:t,value:r}=e;return(0,l.jsxs)("div",{style:{display:"flex",gap:8,marginBottom:6,fontSize:12},children:[(0,l.jsx)("span",{style:{color:n.C.muted,width:110},children:t}),(0,l.jsx)("span",{style:{color:n.C.text,flex:1,wordBreak:"break-word"},children:r})]})}function a(e){let{label:t,value:r,onChange:o,multiline:s,type:i,placeholder:a}=e;return(0,l.jsxs)("label",{style:{display:"block",marginBottom:8},children:[t&&(0,l.jsx)("div",{style:{color:n.C.muted,fontSize:11,marginBottom:2},children:t}),(0,l.jsx)(s?"textarea":"input",{type:i,value:null!=r?r:"",placeholder:a,onChange:e=>o(e.target.value),style:{width:"100%",padding:"6px 8px",borderRadius:6,background:n.C.inputBg,border:"1px solid ".concat(n.C.border),color:n.C.text,fontSize:13,minHeight:s?60:void 0,fontFamily:"inherit"}})]})}function c(e){let{label:t,value:r,onChange:o,options:s}=e;return(0,l.jsxs)("label",{style:{display:"block",marginBottom:8},children:[t&&(0,l.jsx)("div",{style:{color:n.C.muted,fontSize:11,marginBottom:2},children:t}),(0,l.jsx)("select",{value:r,onChange:e=>o(e.target.value),style:{width:"100%",padding:"6px 8px",borderRadius:6,background:n.C.inputBg,border:"1px solid ".concat(n.C.border),color:n.C.text,fontSize:13},children:s.map(e=>(0,l.jsx)("option",{value:e,children:e},e))})]})}let d={width:"100%",borderCollapse:"collapse",background:n.C.card,border:"1px solid ".concat(n.C.border),borderRadius:8},p={padding:"8px 10px",textAlign:"left",color:n.C.textSec,fontSize:11,borderBottom:"1px solid ".concat(n.C.border),fontWeight:600},h={padding:"8px 10px",fontSize:13,color:n.C.textSec,borderBottom:"1px solid ".concat(n.C.border)};function u(e){let{children:t}=e;return(0,l.jsx)("th",{style:p,children:t})}function x(e){let{children:t,style:r}=e;return(0,l.jsx)("td",{style:{...h,...null!=r?r:{}},children:t})}let b={width:380,flex:"0 0 380px",padding:16,borderRadius:8,background:n.C.card,border:"1px solid ".concat(n.C.border),color:n.C.text,fontSize:13},C={padding:10,borderRadius:6,background:n.C.cardAlt,border:"1px solid ".concat(n.C.border)},g={background:"transparent",border:"none",color:n.C.muted,fontSize:16,cursor:"pointer"},y={padding:"4px 10px",fontSize:12,borderRadius:6,background:"transparent",border:"1px solid ".concat(n.C.border),color:n.C.text,cursor:"pointer"};function j(e){return e?new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}):"â"}}}]);
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.