1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[85972],{448:(e,t,i)=>{i.d(t,{A6:()=>s,hQ:()=>l});var a=i(68209);async function r(e){try{var t,i;let a=await e.json();return String(null!=(i=null!=(t=null==a?void 0:a.error)?t:null==a?void 0:a.message)?i:"HTTP ".concat(e.status))}catch(t){return"HTTP ".concat(e.status)}}async function n(e){try{if((await (0,a.apiFetch)("/api/hub/files/".concat(e,"?hard=true"),{method:"DELETE"})).ok)return!0;return(await (0,a.apiFetch)("/api/hub/files/".concat(e),{method:"DELETE"})).ok}catch(e){return!1}}async function o(e,t){var i;let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,{documentType:l,category:s}=function(e){let t=e.toLowerCase();return t.endsWith(".pdf")?{documentType:"pdf",category:"Files"}:t.endsWith(".docx")||t.endsWith(".doc")?{documentType:"docx",category:"Files"}:t.endsWith(".xlsx")||t.endsWith(".xls")?{documentType:"xlsx",category:"Files"}:t.endsWith(".png")||t.endsWith(".jpg")||t.endsWith(".jpeg")?{documentType:"image",category:"Files"}:{documentType:"other",category:"Files"}}(t.name),d=await (0,a.apiFetch)("/api/hub/files",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({folderId:e,name:t.name,documentType:l,category:s})});if(!d.ok)return{ok:!1,index:o,name:t.name,stage:"create",status:d.status,error:await r(d)};let c=await d.json().catch(()=>null),p=null==c||null==(i=c.file)?void 0:i.id;if(!p)return{ok:!1,index:o,name:t.name,stage:"create",status:d.status,error:"Server did not return a file id"};let u=new FormData;u.append("file",t);let f=await (0,a.apiFetch)("/api/hub/files/".concat(p,"/upload"),{method:"POST",body:u});if(!f.ok){let e=await r(f),i=await n(p);return{ok:!1,index:o,name:t.name,fileId:p,stage:"artifact",status:f.status,error:e,orphanCleaned:i}}return{ok:!0,index:o,name:t.name,fileId:p}}async function l(e,t){return(await o(e,t)).ok}async function s(e,t,i){let a=Array.from(t),r=[],n=0,l=0;for(let t=0;t<a.length;t+=1){null==i||i(t,a[t].name,"uploading");let s=await o(e,a[t],t);r.push(s),s.ok?(n+=1,null==i||i(t,a[t].name,"done")):(l+=1,null==i||i(t,a[t].name,"failed"))}return{ok:n,failed:l,results:r}}},3680:(e,t,i)=>{i.d(t,{K7:()=>n,f5:()=>o});let a=[{key:"PROTOCOL",label:"Protocol",icon:"\uD83D\uDCCB",lifecycle:"regulated",defaultScope:"Study",defaultTmfZone:"02",retentionYearsPostClose:25,supersedeBehavior:"RE_EVALUATE",metadata:[{key:"protocolNumber",label:"Protocol number",type:"string",required:!0},{key:"version",label:"Version",type:"string",required:!0,help:"e.g. v3.1"},{key:"effectiveDate",label:"Effective date",type:"date",required:!0},{key:"indication",label:"Indication",type:"string",required:!1},{key:"phase",label:"Phase",type:"enum",required:!1,options:["Phase 1","Phase 1b","Phase 2","Phase 2b","Phase 3","Phase 4","Extension"]}],defaultObligations:[{kind:"REPORT",trigger:{type:"EVENT",eventName:"SAE_OCCURRED"},fulfillment:{kind:"DOC_FILED",docType:"SAFETY_REPORT",dueWithin:"24h"},assigneeRole:"site_pi+safety_lead",description:"Report SAE to sponsor within 24h (per Protocol \xa78)"}],description:"Clinical trial protocol with all amendments. Filed to TMF Zone 02. Drives most study obligations."},{key:"INVESTIGATOR_BROCHURE",label:"Investigator Brochure",icon:"\uD83D\uDCD5",lifecycle:"regulated",defaultScope:"Program",defaultTmfZone:"02",retentionYearsPostClose:25,supersedeBehavior:"GENERATE_ACK_TASKS",metadata:[{key:"editionNumber",label:"Edition number",type:"string",required:!0},{key:"effectiveDate",label:"Effective date",type:"date",required:!0}],defaultObligations:[{kind:"ACK",trigger:{type:"ONCE",startOffset:"on_effective"},fulfillment:{kind:"ATTESTATION",dueWithin:"30d"},assigneeRole:"all_active_investigators",description:"Each Investigator must acknowledge the new IB version"}],description:"Safety + efficacy summary distributed to Investigators. Acknowledgement tracked per-recipient on every new edition."},{key:"ICF",label:"Informed Consent Form",icon:"\uD83D\uDCDD",lifecycle:"regulated",defaultScope:"Study",defaultTmfZone:"04",retentionYearsPostClose:25,supersedeBehavior:"GENERATE_SITE_ACTIONS",metadata:[{key:"version",label:"Version",type:"string",required:!0},{key:"language",label:"Language",type:"enum",required:!0,options:["en","es","fr","de","it","pt","zh","ja","ko"]},{key:"effectiveDate",label:"Effective date",type:"date",required:!0},{key:"irbApproved",label:"IRB approved?",type:"boolean",required:!0}],defaultObligations:[],description:"Master ICF. New versions auto-spawn re-consent tasks at every site."},{key:"SOP",label:"Standard Operating Procedure",icon:"â",lifecycle:"regulated",defaultScope:"Org",retentionYearsPostClose:10,supersedeBehavior:"REASSIGN_TRAINING",metadata:[{key:"sopNumber",label:"SOP number",type:"string",required:!0},{key:"version",label:"Version",type:"string",required:!0},{key:"effectiveDate",label:"Effective date",type:"date",required:!0},{key:"department",label:"Department",type:"string",required:!1}],defaultObligations:[{kind:"TRAINING",trigger:{type:"ONCE",startOffset:"on_effective"},fulfillment:{kind:"ATTESTATION",dueWithin:"30d"},assigneeRole:"sop_audience",description:"Initial training on this SOP"},{kind:"TRAINING",trigger:{type:"RECURRING",schedule:"RRULE:FREQ=YEARLY"},fulfillment:{kind:"ATTESTATION",dueWithin:"365d"},assigneeRole:"sop_audience",description:"Annual retraining"}],description:"Process or procedure document. Effective version triggers training; supersede reassigns training to the new version."},{key:"MSA",label:"Master Services Agreement",icon:"\uD83E\uDD1D",lifecycle:"contract",defaultScope:"Org",retentionYearsPostClose:10,supersedeBehavior:"MANUAL_REVIEW",metadata:[{key:"counterparty",label:"Counterparty",type:"string",required:!0},{key:"effectiveDate",label:"Effective date",type:"date",required:!0},{key:"expiryDate",label:"Expiry date",type:"date",required:!1}],defaultObligations:[{kind:"REVIEW",trigger:{type:"RECURRING",schedule:"RRULE:FREQ=MONTHLY;INTERVAL=3"},fulfillment:{kind:"TASK_COMPLETE",dueWithin:"14d"},assigneeRole:"sponsor_contracts+counterparty_contracts",description:"Quarterly contract review"}],description:"Top-level commercial contract. Quarterly review is the default; supersede requires legal sign-off."},{key:"CDA",label:"Confidentiality / NDA",icon:"\uD83D\uDD12",lifecycle:"contract",defaultScope:"Org",retentionYearsPostClose:7,supersedeBehavior:"CLOSE_AND_RENEW",metadata:[{key:"counterparty",label:"Counterparty",type:"string",required:!0},{key:"effectiveDate",label:"Effective date",type:"date",required:!0},{key:"expiryDate",label:"Expiry date",type:"date",required:!0}],defaultObligations:[{kind:"RENEW",trigger:{type:"ONCE",startOffset:"expires_minus_60d"},fulfillment:{kind:"DOC_FILED",docType:"CDA",dueWithin:"60d"},assigneeRole:"sponsor_contracts",description:"Renew before expiry"}],description:"NDA / confidentiality agreement. Auto-renewal task fires 60 days before expiry."},{key:"CTA",label:"Clinical Trial Agreement",icon:"\uD83D\uDD2C",lifecycle:"contract",defaultScope:"Study",defaultTmfZone:"03",retentionYearsPostClose:25,supersedeBehavior:"MANUAL_REVIEW",metadata:[{key:"sponsor",label:"Sponsor",type:"string",required:!0},{key:"site",label:"Site",type:"string",required:!0},{key:"effectiveDate",label:"Effective date",type:"date",required:!0}],defaultObligations:[],description:"Per-site clinical trial agreement."},{key:"SITE_VISIT_REPORT",label:"Site Visit Report",icon:"\uD83C\uDFE5",lifecycle:"informal",defaultScope:"Study",retentionYearsPostClose:15,supersedeBehavior:"TRANSFER",metadata:[{key:"visitDate",label:"Visit date",type:"date",required:!0},{key:"visitType",label:"Visit type",type:"enum",required:!0,options:["Site Selection","Site Initiation","Routine Monitoring","Close-out","For-cause"]},{key:"site",label:"Site",type:"string",required:!0}],defaultObligations:[],description:"CRA monitoring visit report. Filed in Study Workspace; bound to Site ISF."},{key:"SAFETY_REPORT",label:"Safety Report (SAE/SUSAR)",icon:"\uD83D\uDEA8",lifecycle:"regulated",defaultScope:"Study",defaultTmfZone:"08",retentionYearsPostClose:25,supersedeBehavior:"TRANSFER",metadata:[{key:"caseNumber",label:"Case number",type:"string",required:!0},{key:"reportType",label:"Report type",type:"enum",required:!0,options:["Initial","Follow-up","Final"]},{key:"occurredDate",label:"Event date",type:"date",required:!0},{key:"reportedDate",label:"Reported to sponsor",type:"date",required:!0},{key:"severity",label:"Severity",type:"enum",required:!0,options:["MILD","MODERATE","SEVERE","LIFE_THREATENING","DEATH"]}],defaultObligations:[],description:"Serious Adverse Event report. The 24h SAE clock fires on the Protocol obligation, not here."},{key:"CV",label:"Investigator CV",icon:"\uD83D\uDC64",lifecycle:"informal",defaultScope:"Site",defaultTmfZone:"04",retentionYearsPostClose:25,supersedeBehavior:"CLOSE_AND_RENEW",metadata:[{key:"investigator",label:"Investigator name",type:"string",required:!0},{key:"dated",label:"CV dated",type:"date",required:!0}],defaultObligations:[{kind:"RENEW",trigger:{type:"RECURRING",schedule:"RRULE:FREQ=YEARLY"},fulfillment:{kind:"DOC_FILED",docType:"CV",dueWithin:"30d"}
1,assigneeRole:"investigator",description:"Annual CV renewal"}],description:"Investigator curriculum vitae. Annual renewal cycle."},{key:"MEDICAL_LICENSE",label:"Medical License",icon:"\uD83D\uDCDC",lifecycle:"informal",defaultScope:"Site",defaultTmfZone:"04",retentionYearsPostClose:25,supersedeBehavior:"CLOSE_AND_RENEW",metadata:[{key:"licenseNumber",label:"License number",type:"string",required:!0},{key:"state",label:"State / Region",type:"string",required:!0},{key:"expiryDate",label:"Expires",type:"date",required:!0}],defaultObligations:[{kind:"RENEW",trigger:{type:"ONCE",startOffset:"expires_minus_60d"},fulfillment:{kind:"DOC_FILED",docType:"MEDICAL_LICENSE",dueWithin:"60d"},assigneeRole:"investigator",description:"Renew before expiry"}],description:"State medical license. Pre-expiry renewal task auto-spawned."},{key:"IRB_APPROVAL",label:"IRB / IEC Approval",icon:"â",lifecycle:"regulated",defaultScope:"Site",defaultTmfZone:"04",retentionYearsPostClose:25,supersedeBehavior:"TRANSFER",metadata:[{key:"irbName",label:"IRB / IEC name",type:"string",required:!0},{key:"approvalDate",label:"Approval date",type:"date",required:!0},{key:"expiryDate",label:"Expires",type:"date",required:!0}],defaultObligations:[{kind:"RENEW",trigger:{type:"ONCE",startOffset:"expires_minus_60d"},fulfillment:{kind:"DOC_FILED",docType:"IRB_APPROVAL",dueWithin:"60d"},assigneeRole:"site_regulatory",description:"Continuing review before expiry"}],description:"IRB / IEC approval letter. Continuing review obligation auto-spawned 60d pre-expiry."},{key:"GCP_CERT",label:"GCP Training Certificate",icon:"\uD83C\uDF93",lifecycle:"informal",defaultScope:"Site",defaultTmfZone:"04",retentionYearsPostClose:25,supersedeBehavior:"TRANSFER",metadata:[{key:"recipient",label:"Recipient",type:"string",required:!0},{key:"completed",label:"Completed",type:"date",required:!0},{key:"expiryDate",label:"Expires",type:"date",required:!1}],defaultObligations:[],description:"Good Clinical Practice training certificate."},{key:"TEMPLATE",label:"Controlled Template",icon:"\uD83E\uDDE9",lifecycle:"template",defaultScope:"Org",retentionYearsPostClose:0,supersedeBehavior:"PROMPT_USER",metadata:[{key:"instanceType",label:"Generates instances of",type:"string",required:!0,help:"Doc Type that instances will be (e.g. PROTOCOL)"},{key:"version",label:"Template version",type:"string",required:!0}],defaultObligations:[],description:"A reusable template. Generates instances of another Type. Updates cascade per templateCascadePolicy."},{key:"DRAFT",label:"Draft",icon:"\uD83D\uDCDD",lifecycle:"informal",defaultScope:"Personal",retentionYearsPostClose:0,supersedeBehavior:"TRANSFER",metadata:[],defaultObligations:[],description:"A draft document in your private workspace. No lifecycle, no obligations â promote it (move to Org / Study) to attach those."},{key:"OTHER",label:"Other",icon:"\uD83D\uDCC4",lifecycle:"informal",defaultScope:"Org",retentionYearsPostClose:0,supersedeBehavior:"TRANSFER",metadata:[],defaultObligations:[],description:"Uncategorized document. Pick a more specific Type when possible â Type drives lifecycle, filing, and obligations."}],r=Object.fromEntries(a.map(e=>[e.key,e]));function n(e){if(e)return r[e]}function o(){return a}},85972:(e,t,i)=>{i.r(t),i.d(t,{default:()=>c});var a=i(95155),r=i(12115),n=i(47650),o=i(4373),l=i(448),s=i(68209),d=i(3680);function c(e){let{folderId:t,initialFiles:i,onClose:c,onUploaded:p,requireType:u}=e,[f,y]=(0,r.useState)("OTHER"),[g,m]=(0,r.useState)(!1),[b,h]=(0,r.useState)(Object.fromEntries(i.map(e=>[e.name,"queued"]))),[E,k]=(0,r.useState)(null),v=(0,d.f5)(),C=(0,d.K7)(f),x=!!u&&"OTHER"===f,T=async()=>{for(let n of(m(!0),k(null),i)){var e,a,r;if(h(e=>({...e,[n.name]:"uploading"})),!await (0,l.hQ)(t,n)){h(e=>({...e,[n.name]:"failed"}));continue}try{let i=await (0,s.apiFetch)("/api/hub/files?folderId=".concat(t)),r=(null!=(e=(await i.json().catch(()=>({files:[]}))).files)?e:[]).find(e=>e.name===n.name);(null==r?void 0:r.id)&&"OTHER"!==f&&await (0,s.apiFetch)("/api/hub/files/".concat(r.id),{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({documentType:f,category:null!=(a=null==C?void 0:C.label)?a:f})}),h(e=>({...e,[n.name]:"done"}))}catch(e){k("Type patch failed for ".concat(n.name,": ").concat(null!=(r=null==e?void 0:e.message)?r:"unknown")),h(e=>({...e,[n.name]:"done"}))}}m(!1),p(),c()};return(0,n.createPortal)((0,a.jsx)("div",{role:"dialog","aria-modal":"true","aria-label":"Upload files",onClick:g?void 0:c,style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.6)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e4,padding:20},children:(0,a.jsxs)("div",{onClick:e=>e.stopPropagation(),style:{background:o.C.card,border:"1px solid ".concat(o.C.border),borderRadius:10,width:"100%",maxWidth:560,maxHeight:"85vh",display:"flex",flexDirection:"column",boxShadow:"0 20px 60px rgba(0,0,0,.45)"},children:[(0,a.jsxs)("div",{style:{padding:"14px 18px 10px",borderBottom:"1px solid ".concat(o.C.border),display:"flex",alignItems:"center",justifyContent:"space-between"},children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{style:{fontSize:14,fontWeight:700,color:o.C.text},children:["Upload ",i.length," file",1===i.length?"":"s"]}),(0,a.jsx)("div",{style:{fontSize:11,color:o.C.muted,marginTop:2},children:"Pick a Document Type so the system can apply the right lifecycle, obligations, and filing rules."})]}),(0,a.jsx)("button",{onClick:g?void 0:c,"aria-label":"Close",style:{background:"transparent",border:"none",color:o.C.muted,fontSize:18,cursor:g?"not-allowed":"pointer",padding:4,lineHeight:1},children:"â"})]}),(0,a.jsxs)("div",{style:{flex:1,overflowY:"auto",padding:16},children:[(0,a.jsxs)("div",{style:{marginBottom:16},children:[(0,a.jsx)("label",{style:{display:"block",fontSize:11,fontWeight:700,color:o.C.muted,letterSpacing:"0.05em",textTransform:"uppercase",marginBottom:6},children:"Document type"}),(0,a.jsx)("select",{value:f,onChange:e=>y(e.target.value),disabled:g,style:{width:"100%",padding:"8px 12px",background:o.C.bg,color:o.C.text,border:"1px solid ".concat(o.C.border),borderRadius:6,fontSize:13,outline:"none",boxSizing:"border-box",cursor:"pointer"},children:v.map(e=>(0,a.jsxs)("option",{value:e.key,children:[e.icon," ",e.label]},e.key))}),u&&(0,a.jsx)("div",{style:{marginTop:6,fontSize:11,color:x?"#f59e0b":"#34d399"},children:x?"â Pick the document type â required in the regulatory binder so it files into the right tab and counts toward the required documents.":"â Files into its b
1inder tab and counts toward the required documents."}),C&&(0,a.jsxs)("div",{style:{marginTop:8,padding:10,background:o.C.bg,border:"1px solid ".concat(o.C.border),borderRadius:6,fontSize:11,color:o.C.muted},children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("strong",{style:{color:o.C.text},children:"Lifecycle:"})," ",C.lifecycle]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("strong",{style:{color:o.C.text},children:"Default scope:"})," ",C.defaultScope]}),C.defaultTmfZone&&(0,a.jsxs)("div",{children:[(0,a.jsx)("strong",{style:{color:o.C.text},children:"Filed to:"})," TMF Zone ",C.defaultTmfZone]}),C.retentionYearsPostClose?(0,a.jsxs)("div",{children:[(0,a.jsx)("strong",{style:{color:o.C.text},children:"Retention:"})," ",C.retentionYearsPostClose," years post-close"]}):null,(0,a.jsx)("div",{style:{marginTop:4},children:C.description})]})]}),(0,a.jsxs)("div",{style:{marginBottom:8},children:[(0,a.jsx)("label",{style:{display:"block",fontSize:11,fontWeight:700,color:o.C.muted,letterSpacing:"0.05em",textTransform:"uppercase",marginBottom:6},children:"Files"}),(0,a.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:4},children:i.map(e=>{var t,i;let r=null!=(t=b[e.name])?t:"queued";return(0,a.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"7px 10px",borderRadius:5,background:o.C.bg,border:"1px solid ".concat(o.C.border),fontSize:12},children:[(0,a.jsx)("span",{style:{flex:1,color:o.C.text,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.name}),(0,a.jsx)("span",{style:{fontSize:10,color:o.C.muted,fontVariantNumeric:"tabular-nums"},children:(i=e.size)<1024?"".concat(i," B"):i<1048576?"".concat((i/1024).toFixed(1)," KB"):"".concat((i/1048576).toFixed(1)," MB")}),(0,a.jsx)("span",{style:{padding:"1px 6px",borderRadius:3,fontSize:9,fontWeight:700,letterSpacing:"0.04em",background:"done"===r?"#10b98122":"uploading"===r?(0,o.u)(o.C.accent,13):"failed"===r?"#ef444422":(0,o.u)(o.C.muted,13),color:"done"===r?"#34d399":"uploading"===r?o.C.accent:"failed"===r?"#fca5a5":o.C.muted},children:r.toUpperCase()})]},e.name)})})]}),E&&(0,a.jsx)("div",{style:{padding:10,background:"#ef444411",border:"1px solid #ef444444",borderRadius:6,color:"#fca5a5",fontSize:11,marginTop:10},children:E})]}),(0,a.jsxs)("div",{style:{display:"flex",justifyContent:"flex-end",gap:8,padding:"10px 14px",borderTop:"1px solid ".concat(o.C.border)},children:[(0,a.jsx)("button",{onClick:g?void 0:c,disabled:g,style:{padding:"7px 14px",borderRadius:5,background:"transparent",color:o.C.muted,border:"1px solid ".concat(o.C.border),fontSize:12,cursor:g?"not-allowed":"pointer"},children:"Cancel"}),(0,a.jsx)("button",{onClick:T,disabled:g||x,title:x?"Pick a document type first":void 0,style:{padding:"7px 14px",borderRadius:5,background:o.C.accent,color:"#fff",border:"none",fontSize:12,fontWeight:600,cursor:g||x?"not-allowed":"pointer",opacity:g||x?.6:1},children:g?"Uploadingâ¦":"Upload ".concat(i.length," file").concat(1===i.length?"":"s")})]})]})}),document.body)}}}]);
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.