1import{r as p,j as t}from"./index-DnpRIAmU.js";import{l as me,a as ue,g as fe,b as be,x as ye,c as Se,y as je,z as we,G as w,S as R,A as F,p as q,D as ke,n as J,U as I,B as Y,C as $e,E as Oe,W as ze,t as Ee,s as De,F as X,H as Q,I as Ce,J as Z}from"./vendor-portal-Ds_-CKYX.js";import{s as Re}from"./demo-ops-BkVJXOcK.js";import{f as k}from"./P360_Landed_Cost_VSG-lXQHSAq-.js";import"./BrandIcon-CSLf_0Lr.js";import"./ProximaMark-9gSbc8v0.js";import"./brand-tokens-aDiy2ad6.js";import"./index-BDbnnScJ.js";import"./roxi-intents-BTNpDfdc.js";import"./autopilot-core-BO1s-Ux1.js";import"./geo-map-D8WqbLL9.js";const T=(l,x)=>{try{return JSON.parse(localStorage.getItem(l))??x}catch{return x}},ee=(l,x)=>{try{localStorage.setItem(l,JSON.stringify(x))}catch{}},o=l=>String(l??"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">"),Te=l=>{try{window.dispatchEvent(new CustomEvent("p360:stores-changed",{detail:{keys:l}}))}catch{}};function He({skus:l,retailFor:x,setActive:W,portfolioName:L}){const[v,te]=p.useState("gates"),[g,re]=p.useState(()=>{const e=T("p360_shipments",[]);return Array.isArray(e)?e:[]}),[y,ie]=p.useState(()=>me()),[f]=p.useState(()=>ue()),[m,ne]=p.useState(()=>fe()),[$,B]=p.useState(()=>be()),[N,A]=p.useState(null),[z,M]=p.useState(()=>ye()),[P,se]=p.useState(!1),b=new Date().toISOString().slice(0,10),U=p.useMemo(()=>{const e=T("p360_quality_history",[]);return Array.isArray(e)?e:[]},[]),E=p.useMemo(()=>{const e={};return l.forEach(r=>{e[r.sku]=r}),e},[l]),u=p.useMemo(()=>g.filter(e=>Re(e.stage)<6).map(e=>{const r=Se({supplier:e.supplier,origin:e.origin,store:y,chain:f,shipments:g,todayISO:b}),i=E[e.sku],n=(e.unitCost||0)*(e.units||0),d=i&&x?Math.max(0,(x(i)-(parseFloat(i.cost)||0))*(e.units||0)):0,s=je({tier:r.tier,coverage:r.file.of?r.file.onFile/r.file.of:0,valueUSD:n,units:e.units,gpUSD:d,model:z});return{sh:e,gate:r,det:s,valueUSD:n,gpUSD:d,overridden:!!$[e.id],routeFlags:we(e)}}),[g,y,f,E,x,$,b,z]),oe=(e,r)=>{const i=Ee(y,e,r,b);ie(i),De(i),Te(["p360_compliance"])},ae=(e,r)=>{const i=parseFloat(r);if(!isFinite(i)||i<0)return;const n=e.set(z,i);M(n),X(n)},de=()=>{M(Q),X(Q)},D=u.filter(e=>!e.gate.ok&&!e.overridden),_=u.reduce((e,r)=>e+r.det.expected,0),G=u.filter(e=>!e.gate.ok).reduce((e,r)=>e+r.det.marginAtRisk,0),S=[...new Set(g.map(e=>e.supplier).filter(e=>e&&e!=="â"))],le=S.filter(e=>(f[e]?.declared||[]).length>0),C=u.filter(e=>e.routeFlags.length>0),ce=()=>{const e=m==="enforce"?"monitor":"enforce";ne(e),Ce(e)},H=(e,r,i,n,d)=>{try{const s=T("p360_po_audit",[]),c=Array.isArray(s)?s:[];c.unshift({ts:new Date().toISOString().slice(0,16).replace("T"," "),action:e,po:r,field:i,from:String(n??""),to:String(d??"")}),ee("p360_po_audit",c.slice(0,300))}catch{}},pe=e=>{const r=(N?.reason||"").trim();if(!r)return;const i={...$,[e.sh.id]:{reason:r,at:b}};B(i),Z(i),A(null),H("gate-override",e.sh.po||e.sh.sku,"compliance gate","BLOCKED",`overridden: ${r}`)},he=e=>{const r={...$};delete r[e.sh.id],B(r),Z(r),H("gate-reinstate",e.sh.po||e.sh.sku,"compliance gate","overridden","BLOCKED")},ge=(e,r)=>{const i=T("p360_shipments",[]),d=(Array.isArray(i)?i:[]).map(s=>s.id===e?{...s,via:r||void 0}:s);re(d),ee("p360_shipments",d)},xe=e=>{const r=Y({sh:e.sh,sku:E[e.sh.sku],store:y,chain:f,quality:U,todayISO:b}),i=r.sections,n=i.evidence.map(a=>`<tr><td>${o(a.label)}</td><td>${a.date?`On file · ${o(a.date)}`:"<b style='color:#B91C1C'>NOT ON FILE</b>"}</td></tr>`).join(""),d=i.shipmentDocs.map(a=>`<tr><td>${o(a.name)}</td><td>${o(a.type)} · ${o(a.at)}</td></tr>`).join("")||"<tr><td colspan=2>None attached</td></tr>",s=i.inspections.map(a=>`<tr><td>${o(a.date)}</td><td>${o(a.result)} · ${Number(a.defectPct)||0}% defects</td></tr>`).join("")||"<tr><td colspan=2>No inspection history</td></tr>",c=i.parties.network.map(a=>`<tr><td>${o(a.name)}</td><td>${o(a.country||"â")} · ${o(a.material||"â")} · declared ${o(a.at||"")}</td></tr>`).join("")||"<tr><td colspan=2><b style='color:#B91C1C'>No declared sub-supplier network</b></td></tr>",j=r.gaps.map(a=>`<li>${o(a)}</li>`).join(""),ve=`<html><head><meta charset="utf-8"><title>Detention Response Dossier â ${o(i.entry.po)}</title></head> 2<body style="font-family:Calibri,Arial,sans-serif;max-width:8in;margin:24px auto;color:#0F1628;font-size:10.5pt"> 3<div style="border-bottom:3px solid #C9A84C;padding-bottom:10px;display:flex;justify-content:space-between"> 4<div><div style="font-size:9pt;letter-spacing:3px;color:#C9A84C;font-weight:bold">DETENTION RESPONSE DOSSIER</div> 5<h1 style="margin:4px 0;font-size:18pt">${o(i.entry.po)} â ${o(i.entry.desc)}</h1></div> 6<div style="text-align:right;font-size:9pt;color:#64748B">Assembled ${o(r.generatedAt)}<br/>Completeness <b>${r.completeness}%</b></div></div> 7<h3>1 · Entry</h3><table border="1" style="border-collapse:collapse;width:100%"><tr><td>PO</td><td>${o(i.entry.po)}</td></tr><tr><td>SKU</td><td>${o(i.entry.sku)}</td></tr><tr><td>Origin</td><td>${o(i.entry.origin)} (${o(J(i.entry.origin).tier||"n/a")} exposure, MODELED)</td></tr><tr><td>Incoterm</td><td>${o(i.entry.incoterm)}</td></tr><tr><td>Units / Value</td><td>
7${(i.entry.units||0).toLocaleString()} / $${(i.entry.valueUSD||0).toLocaleString()}</td></tr><tr><td>ETA</td><td>${o(i.entry.eta||"â")}</td></tr></table> 8<h3>2 · Parties & declared chain</h3><p>Supplier of record: <b>${o(i.parties.supplier)}</b></p><table border="1" style="border-collapse:collapse;width:100%">${c}</table> 9<h3>3 · Movement</h3><table border="1" style="border-collapse:collapse;width:100%"><tr><td>Stage</td><td>${o(i.movement.stage)}</td></tr><tr><td>Vessel</td><td>${o(i.movement.vessel||"â")}</td></tr><tr><td>Transshipment</td><td>${o(i.movement.via||"none declared")}</td></tr><tr><td>Arrived</td><td>${o(i.movement.arrivedAt||"â")}</td></tr></table> 10<h3>4 · UFLPA evidence file â ${o(i.parties.supplier)}</h3><table border="1" style="border-collapse:collapse;width:100%">${n}</table> 11<h3>5 · Shipment documents</h3><table border="1" style="border-collapse:collapse;width:100%">${d}</table> 12<h3>6 · Inspection history</h3><table border="1" style="border-collapse:collapse;width:100%">${s}</table> 13${r.gaps.length?`<h3 style="color:#B91C1C">7 · Gaps to close before filing</h3><ul style="color:#B91C1C">${j}</ul>`:"<h3 style='color:#059669'>7 · No gaps â file-ready</h3>"} 14<p style="font-size:8.5pt;color:#64748B;margin-top:16px">Assembled by P360 from the live PO register, portal document references, supplier evidence files and cascade declarations. Exposure tiers are MODELED screening priors, not legal determinations. Review with your customs counsel before submission.</p> 15</body></html>`,K=URL.createObjectURL(new Blob([ve],{type:"text/html"}));if(!window.open(K,"_blank")){const a=document.createElement("a");a.href=K,a.download=`Dossier-${e.sh.po||e.sh.sku}.html`,a.click()}},O=(e,r)=>t.jsx("button",{onClick:()=>te(e),style:{padding:"8px 16px",borderRadius:8,cursor:"pointer",fontSize:12,fontWeight:700,fontFamily:"inherit",border:`1px solid ${v===e?"rgba(37,99,235,0.35)":"var(--border)"}`,background:v===e?"var(--brand-light)":"transparent",color:v===e?"var(--brand)":"var(--text-2)"},children:r},e),h=(e,r,i)=>t.jsx("span",{style:{padding:"2px 8px",borderRadius:5,fontSize:9,fontWeight:800,letterSpacing:"0.04em",background:r,color:i,whiteSpace:"nowrap"},children:e}),V=e=>e==="high"?h("HIGH · MODELED","var(--red-bg)","var(--red)"):e==="medium"?h("MEDIUM · MODELED","var(--amber-bg)","#B45309"):e?h("LOW","var(--green-bg)","var(--green)"):h("NO DATA","var(--bg-2)","var(--text-3)");return t.jsxs("div",{className:"tab-content",style:{display:"flex",flexDirection:"column",gap:16},children:[t.jsxs("div",{className:"card",style:{padding:"16px 20px",display:"flex",alignItems:"center",gap:12,flexWrap:"wrap"},children:[t.jsxs("div",{style:{flex:1,minWidth:260},children:[t.jsxs("div",{style:{fontSize:15,fontWeight:800,letterSpacing:"-0.01em"},children:["ð§¿ Supplier compliance",L?` â ${L}`:""]}),t.jsxs("div",{style:{fontSize:11.5,color:"var(--text-3)",marginTop:2},children:["Forced-labour compliance under the UFLPA (",w.UFLPA,") priced in dollars, gated in the PO lifecycle and evidenced by the suppliers themselves, not a questionnaire silo. CBP is ",w.CBP,"; a WRO is a ",w.WRO,"; SMETA/BSCI are ",w["SMETA/BSCI"],"; tier-N means ",w["tier-N"],"; transshipment is ",w.transshipment,"."]})]}),t.jsxs("div",{style:{display:"flex",gap:6,flexWrap:"wrap"},children:[O("gates",`ð¦ Gates${D.length?` (${D.length})`:""}`),O("evidence","ð Evidence files"),O("dossier","ð Dossiers"),O("chain","ð¸ Tier-N chain"),O("routes",`ð§ Routes${C.length?` (${C.length}â )`:""}`)]})]}),t.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(5,1fr)",gap:10},children:[{l:"POs gate-blocked",v:String(D.length),c:D.length?"var(--red)":"var(--green)",sub:m==="enforce"?"ENFORCE: the In-transit tab refuses the factory-to-port advance for these POs":"MONITOR: flagged here, nothing blocked"},{l:"Expected detention cost",v:k(_),c:_>0?"var(--amber)":"var(--green)",sub:"sum of p(detain) x cost if detained, MODELED, printed per PO"},{l:"Margin exposed on blocked POs",v:k(G),c:G>0?"var(--red)":"var(--green)",sub:"gross profit behind blocked high-exposure POs; shown, never summed into the expectation"},{l:"Suppliers chain-mapped",v:`${le.length}/${S.length}`,c:"var(--brand)",sub:"declared at least one sub-supplier through the portal cascade"},{l:"Routes flagged",v:String(C.length),c:C.length?"var(--amber)":"var(--green)",sub:"transshipment watch-list hits (MODELED)"}].map(e=>t.jsxs("div",{className:"card",style:{padding:"13px 15px"},children:[t.jsx("div",{style:{fontSize:9.5,fontWeight:700,color:"var(--text-3)",textTransform:"uppercase",letterSpacing:"0.07em",marginBottom:5},children:e.l}),t.jsx("div",{style:{fontSize:19,fontWeight:800,color:e.c,fontVariantNumeric:"tabular-nums",letterSpacing:"-0.02em"},children:e.v}),t.jsx("div",{style:{fontSize:9.5,color:"var(--text-3)",marginTop:3},children:e.sub})]},e.l))}),v==="gates"&&t.jsxs("div",{className:"card",style:{overflow:"hidden"},children:[t.jsxs("div",{style:{padding:"12px 20px",borderBottom:"1px solid var(--border)",display:"flex",alignItems:"center",gap:10,flexWrap:"wrap"},children:[t.jsxs("div",{style:{flex:1,minWidth:240},children:[t.jsx("div",{style:{fontSize:12.5,fontWeight:700}
15,children:"Compliance gate per PO: evidence rules by exposure tier, detention risk priced"}),t.jsxs("div",{style:{fontSize:10,color:"var(--text-3)",marginTop:2},children:["High-exposure origins need ",F("high").join(", "),"; medium-exposure origins need ",F("medium").join(", "),"; low-exposure origins need nothing. The audit counts as stale after ",R.audit," days and the origin attestation after ",R.origin,' days. The business licence is kept on file but not gated. "Gate evidence" counts the needed documents that are on file and fresh; "file" counts all five.']})]}),t.jsxs("button",{onClick:ce,title:"Monitor: the gate flags and nothing is blocked. Enforce: the In-transit tab refuses the factory-to-origin-port advance for a flagged PO until the file is fixed or a reasoned override is recorded here. This screen only labels the state.",style:{padding:"6px 14px",borderRadius:99,cursor:"pointer",fontSize:10.5,fontWeight:800,fontFamily:"inherit",border:`1px solid ${m==="enforce"?"rgba(220,38,38,0.4)":"var(--border)"}`,background:m==="enforce"?"var(--red-bg)":"transparent",color:m==="enforce"?"var(--red)":"var(--text-2)"},children:[m==="enforce"?"â ENFORCE mode":"ð MONITOR mode",": tap to switch"]})]}),t.jsx("div",{style:{padding:"6px 20px",borderBottom:"1px solid var(--border)",fontSize:10,color:"var(--text-3)",lineHeight:1.5},children:m==="enforce"?"ENFORCE is on: the block happens on the In-transit tab, whose stage control refuses the factory-to-origin-port advance for any PO the gate flags. Override with a reason below to let one through; the override is audited.":"MONITOR is on: flagged POs move freely. Switch to ENFORCE to make the In-transit stage control refuse the factory-to-origin-port advance for flagged POs."}),u.length===0&&t.jsx("div",{style:{padding:"16px 20px",fontSize:11.5,color:"var(--text-3)"},children:"No open shipments: load the sample fleet in In transit to see the gate work."}),u.map(e=>t.jsxs("div",{style:{padding:"11px 20px",borderBottom:"1px solid var(--border)"},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,flexWrap:"wrap"},children:[t.jsxs("div",{style:{minWidth:170},children:[t.jsxs("div",{style:{fontSize:12,fontWeight:700},children:[e.sh.po||e.sh.sku," ",t.jsxs("span",{style:{fontSize:9.5,color:"var(--text-3)",fontWeight:400},children:["· ",e.sh.supplier]})]}),t.jsxs("div",{style:{fontSize:9.5,color:"var(--text-3)"},children:[e.sh.origin," · ",k(e.valueUSD)," · ",e.sh.stage.replace("_"," ")]})]}),V(e.gate.tier),t.jsxs("span",{style:{fontSize:10,color:"var(--text-3)"},title:e.gate.evidence.of?`Gate needs: ${e.gate.evidence.needs.join(", ")}`:"This tier needs no documents",children:["gate evidence ",e.gate.evidence.onFile,"/",e.gate.evidence.of," · file ",e.gate.file.onFile,"/",e.gate.file.of]}),e.overridden?h("OVERRIDDEN · AUDITED","var(--amber-bg)","#B45309"):e.gate.ok?h("GATE CLEAR","var(--green-bg)","var(--green)"):h(m==="enforce"?"BLOCKED":"FLAGGED","var(--red-bg)","var(--red)"),t.jsxs("div",{style:{marginLeft:"auto",textAlign:"right"},children:[t.jsx("div",{style:{fontSize:11.5,fontWeight:800,fontVariantNumeric:"tabular-nums",color:e.det.expected>0?"var(--amber)":"var(--text-3)"},children:e.det.expected>0?`${k(e.det.expected)} expected`:"no priced risk"}),e.det.marginAtRisk>0&&!e.gate.ok&&t.jsxs("div",{style:{fontSize:8.5,color:"var(--red)"},children:[k(e.det.marginAtRisk)," GP behind it"]})]})]}),!e.gate.ok&&t.jsxs("div",{style:{marginTop:6,padding:"7px 10px",borderRadius:7,background:"var(--red-bg)",fontSize:10.5,lineHeight:1.5},children:[e.gate.blockers.map((r,i)=>t.jsxs("div",{children:["⢠",r]},i)),t.jsxs("div",{style:{marginTop:5,display:"flex",gap:6,flexWrap:"wrap",alignItems:"center"},children:[t.jsx("button",{onClick:()=>{const r=q(e.sh.supplier);window.open(`${window.location.pathname}?vendor=${r}`,"_blank")},style:{padding:"4px 10px",borderRadius:6,border:"none",cursor:"pointer",background:"var(--brand)",color:"#fff",fontSize:9.5,fontWeight:700,fontFamily:"inherit"},children:"â Send vendor to fix it"}),!e.overridden&&(N?.id===e.sh.id?t.jsxs(t.Fragment,{children:[t.jsx("input",{className:"input-base",autoFocus:!0,placeholder:"Override reason (audited)â¦",value:N.reason,onChange:r=>A({id:e.sh.id,reason:r.target.value}),style:{fontSize:10,padding:"4px 8px",width:220}}),t.jsx("button",{onClick:()=>pe(e),style:{padding:"4px 10px",borderRadius:6,border:"1px solid rgba(217,119,6,0.4)",cursor:"pointer",background:"var(--amber-bg)",color:"#B45309",fontSize:9.5,fontWeight:700,fontFamily:"inherit"},children:"Confirm override"})]}):t.jsx("button",{onClick:()=>A({id:e.sh.id,reason:""}),style:{padding:"4px 10px",borderRadius:6,border:"1px solid var(--border)",cursor:"pointer",background:"transparent",color:"var(--text-2)",fontSize:9.5,fontWeight:700,fontFamily:"inherit"},children:"Override with reasonâ¦"})),e.overridden&&t.jsxs("button",{onClick:()=>he(e),style:{padding:"4px 10px",borderRadius:6,border:"1px solid var(--border)",cursor:"pointer",background:"transparent",color:"var(--text-2)",fontSize:9.5,fontWeight:700,fontFamily:"inherit"},children:["Reinstate gate (",$[e.sh.id]?.reason,")"]})]})]}),e.det.expected>0&&t.jsx("div",{style:{marginTop:4,fontSize:8.5,color:"var(--text-3)"},children:e.det.why.join(" · ")})]},e.sh.id)),t.jsxs("div",{style:{padding:"10px 20px",borderTop:"1px solid var(--border)"},children:[t.jsxs("button",{onClick:()=>se(e=>!e),style:{padding:"5px 11px",borderRadius:6,border:"1px solid var(--border)",background:"transparent",curs
15or:"pointer",fontSize:10.5,fontWeight:700,fontFamily:"inherit",color:"var(--text-2)"},children:[P?"Hide":"Show"," detention assumptions (modelled, editable)"]}),P&&t.jsxs("div",{style:{marginTop:8},children:[t.jsx("div",{style:{fontSize:10.5,color:"var(--text-3)",marginBottom:6,lineHeight:1.5},children:"Every term in the priced detention risk is a modelled assumption with no external source. Replace them with your own detention history; the expected-cost column re-prices instantly."}),t.jsx("div",{style:{overflowX:"auto"},children:t.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:11},children:[t.jsx("thead",{children:t.jsx("tr",{style:{background:"var(--bg-2)"},children:["Assumption","Value","Unit","Source"].map(e=>t.jsx("th",{style:{padding:"6px 12px",textAlign:"left",fontSize:9,fontWeight:700,color:"var(--text-3)",textTransform:"uppercase",letterSpacing:"0.05em"},children:e},e))})}),t.jsx("tbody",{children:ke.map(e=>t.jsxs("tr",{style:{borderTop:"1px solid var(--border)"},children:[t.jsx("td",{style:{padding:"5px 12px"},children:e.label}),t.jsx("td",{style:{padding:"5px 12px"},children:t.jsx("input",{className:"input-base",type:"number",step:"any",value:+e.get(z).toFixed(3),onChange:r=>ae(e,r.target.value),style:{width:90,fontSize:11,padding:"3px 6px"}})}),t.jsx("td",{style:{padding:"5px 12px",color:"var(--text-3)"},children:e.unit}),t.jsx("td",{style:{padding:"5px 12px",color:"var(--text-3)",fontSize:10},children:e.source})]},e.key))})]})}),t.jsx("button",{onClick:de,style:{marginTop:6,padding:"4px 10px",borderRadius:6,border:"1px solid var(--border)",background:"transparent",cursor:"pointer",fontSize:10,fontFamily:"inherit",color:"var(--text-3)"},children:"Reset to modelled defaults"})]})]})]}),v==="evidence"&&t.jsxs("div",{className:"card",style:{overflow:"hidden"},children:[t.jsxs("div",{style:{padding:"12px 20px",borderBottom:"1px solid var(--border)"},children:[t.jsx("div",{style:{fontSize:12.5,fontWeight:700},children:"UFLPA evidence file per supplier: the five documents CBP expects an importer to produce"}),t.jsxs("div",{style:{fontSize:10.5,color:"var(--text-3)",marginTop:2},children:["Tap a document to mark it on file (today's date is recorded) or to remove it. The gate, the detention pricing, the dossiers and the risk radar all read this file; nothing else edits it. Stale rule: audit after ",R.audit," days, origin attestation after ",R.origin," days."]})]}),S.length===0&&t.jsx("div",{style:{padding:"16px 20px",fontSize:11.5,color:"var(--text-3)"},children:"No suppliers on the register yet."}),S.map(e=>{const r=y.suppliers?.[e]||{},i=l.find(s=>s.supplier===e)?.country||g.find(s=>s.supplier===e)?.origin,n=J(i).tier,d=new Set(n&&F(n)||[]);return t.jsxs("div",{style:{padding:"10px 20px",borderBottom:"1px solid var(--border)"},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,flexWrap:"wrap",marginBottom:6},children:[t.jsx("span",{style:{fontSize:12,fontWeight:700},children:e}),t.jsxs("span",{style:{fontSize:9.5,color:"var(--text-3)"},children:["· ",i||"origin unknown"]}),V(n),t.jsxs("span",{style:{fontSize:9.5,color:"var(--text-3)"},children:["file ",I.filter(s=>r[s.key]).length,"/",I.length,d.size?` · gate needs ${d.size}`:" · nothing gated at this tier"]})]}),t.jsx("div",{style:{display:"flex",gap:4,flexWrap:"wrap"},children:I.map(s=>{const c=!!r[s.key],j=c&&s.staleDays&&(new Date(b)-new Date(r[s.key]))/864e5>s.staleDays;return t.jsxs("button",{onClick:()=>oe(e,s.key),title:`${s.label}: ${s.hint}${c?` · on file ${r[s.key]}`:" · tap to mark on file"}${d.has(s.label)?" · gated for this origin":""}`,style:{padding:"3px 9px",borderRadius:99,cursor:"pointer",fontSize:9,fontWeight:700,fontFamily:"inherit",border:`1px solid ${j?"rgba(217,119,6,0.5)":c?"rgba(5,150,105,0.4)":"var(--border)"}`,background:j?"var(--amber-bg)":c?"var(--green-bg)":"transparent",color:j?"#B45309":c?"var(--green)":"var(--text-3)"},children:[c?j?"â ":"â ":"",s.label,c?` (${r[s.key]})`:""]},s.key)})})]},e)})]}),v==="dossier"&&t.jsxs("div",{className:"card",style:{overflow:"hidden"},children:[t.jsxs("div",{style:{padding:"12px 20px",borderBottom:"1px solid var(--border)"},children:[t.jsx("div",{style:{fontSize:12.5,fontWeight:700},children:"Detention-response dossiers: answer CBP in hours, not weeks. Assembled from what the platform already tracks."}
15),t.jsx("div",{style:{fontSize:10,color:"var(--text-3)",marginTop:2},children:"File-ready % counts ten points: one per UFLPA document (five), plus the declared sub-supplier network, packing list, commercial invoice, inspection history and ETA. Each gap listed is one point."})]}),g.length===0&&t.jsx("div",{style:{padding:"16px 20px",fontSize:11.5,color:"var(--text-3)"},children:"No shipments on record."}),g.map(e=>{const r=Y({sh:e,sku:E[e.sku],store:y,chain:f,quality:U,todayISO:b});return t.jsxs("div",{style:{padding:"10px 20px",borderBottom:"1px solid var(--border)",display:"flex",alignItems:"center",gap:12,flexWrap:"wrap"},children:[t.jsxs("div",{style:{minWidth:170},children:[t.jsxs("div",{style:{fontSize:12,fontWeight:700},children:[e.po||e.sku," ",t.jsxs("span",{style:{fontSize:9.5,color:"var(--text-3)",fontWeight:400},children:["· ",e.supplier," · ",e.origin]})]}),t.jsxs("div",{style:{fontSize:9.5,color:"var(--text-3)"},children:[k((e.unitCost||0)*(e.units||0))," · ",e.stage.replace("_"," ")]})]}),t.jsxs("div",{style:{flex:1,minWidth:140},children:[t.jsx("div",{style:{height:7,borderRadius:4,background:"var(--bg-2)",overflow:"hidden"},children:t.jsx("div",{style:{width:`${r.completeness}%`,height:"100%",background:r.completeness===100?"var(--green)":r.completeness>=60?"var(--amber)":"var(--red)"}})}),t.jsxs("div",{style:{fontSize:8.5,color:"var(--text-3)",marginTop:2},children:[r.completeness,"% file-ready · ",r.gaps.length?`${r.gaps.length} gap${r.gaps.length===1?"":"s"}: ${r.gaps[0]}${r.gaps.length>1?" â¦":""}`:"no gaps"]})]}),t.jsx("button",{onClick:()=>xe({sh:e}),style:{padding:"6px 13px",borderRadius:7,border:"1px solid rgba(37,99,235,0.35)",cursor:"pointer",background:"var(--brand-light)",color:"var(--brand)",fontSize:10.5,fontWeight:700,fontFamily:"inherit"},children:"ð Assemble dossier"})]},e.id)})]}),v==="chain"&&t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:12},children:[S.length===0&&t.jsx("div",{className:"card",style:{padding:"16px 20px",fontSize:11.5,color:"var(--text-3)"},children:"No suppliers on the register yet."}),S.map(e=>{const r=$e(f,e),i=Oe(g,e,f,l.find(n=>n.supplier===e)?.country||g.find(n=>n.supplier===e)?.origin);return t.jsxs("div",{className:"card",style:{overflow:"hidden"},children:[t.jsxs("div",{style:{padding:"12px 20px",borderBottom:"1px solid var(--border)",display:"flex",alignItems:"center",gap:10,flexWrap:"wrap"},children:[t.jsxs("div",{style:{flex:1,minWidth:200},children:[t.jsx("span",{style:{fontSize:12.5,fontWeight:800},children:e}),t.jsx("span",{style:{fontSize:10,color:"var(--text-3)",marginLeft:8},children:r.length?`${r.length} declared node${r.length===1?"":"s"} to tier ${Math.max(...r.map(n=>n.tier))}`:"chain not yet declared"})]}),i.length>0&&h(`UNDISCLOSED: ${i.join(", ")}`,"var(--red-bg)","var(--red)"),t.jsx("button",{onClick:()=>{const n=q(e);window.open(`${window.location.pathname}?vendor=${n}`,"_blank")},style:{padding:"5px 11px",borderRadius:6,border:"1px solid rgba(37,99,235,0.35)",cursor:"pointer",background:"var(--brand-light)",color:"var(--brand)",fontSize:10,fontWeight:700,fontFamily:"inherit"},children:"â Ask vendor to declare"})]}),r.length>0&&t.jsx("div",{style:{padding:"8px 20px 12px"},children:r.map((n,d)=>t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"5px 0",fontSize:11,marginLeft:(n.tier-2)*22},children:[t.jsx("span",{style:{color:"var(--text-3)"},children:"â".padStart(1)}),h(`T${n.tier}`,"var(--bg-2)","var(--text-3)"),t.jsx("b",{children:n.name}),t.jsxs("span",{style:{color:"var(--text-3)"},children:[n.country||"â",n.material?` · ${n.material}`:""," · declared by ",n.parent," ",n.at]})]},d))})]},e)}),t.jsx("div",{style:{fontSize:10,color:"var(--text-3)",lineHeight:1.5,padding:"0 4px"},children:"The map is built by the vendors themselves: each tier declares the next in their portal and can generate cascade inv
15ites for their own suppliers. Undisclosed flags fire only when a declared network contradicts actual shipment origins â silence is never treated as guilt."})]}),v==="routes"&&t.jsxs("div",{className:"card",style:{overflow:"hidden"},children:[t.jsx("div",{style:{padding:"12px 20px",borderBottom:"1px solid var(--border)",fontSize:12.5,fontWeight:700},children:"Transport-leg screening â declare each PO's transshipment hub; the watch list (MODELED) prices the attention it needs"}),t.jsx("datalist",{id:"hubList",children:ze.map(e=>t.jsx("option",{value:e.hub},e.hub))}),u.length===0&&t.jsx("div",{style:{padding:"16px 20px",fontSize:11.5,color:"var(--text-3)"},children:"No open shipments."}),u.map(e=>t.jsxs("div",{style:{padding:"10px 20px",borderBottom:"1px solid var(--border)"},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,flexWrap:"wrap"},children:[t.jsxs("div",{style:{minWidth:170},children:[t.jsxs("div",{style:{fontSize:12,fontWeight:700},children:[e.sh.po||e.sh.sku," ",t.jsxs("span",{style:{fontSize:9.5,color:"var(--text-3)",fontWeight:400},children:["· ",e.sh.origin," â US"]})]}),t.jsxs("div",{style:{fontSize:9.5,color:"var(--text-3)"},children:[e.sh.vessel||"vessel â"," · ",e.sh.stage.replace("_"," ")]})]}),t.jsxs("label",{style:{fontSize:10,color:"var(--text-3)"},children:["via",t.jsx("input",{className:"input-base",list:"hubList",placeholder:"direct / hubâ¦",value:e.sh.via||"",onChange:r=>ge(e.sh.id,r.target.value),style:{fontSize:10.5,padding:"4px 8px",width:150,marginLeft:6}})]}),e.routeFlags.length===0&&h("NO FLAGS","var(--green-bg)","var(--green)")]}),e.routeFlags.map((r,i)=>t.jsx("div",{style:{marginTop:5,padding:"6px 10px",borderRadius:7,background:r.sev==="high"?"var(--red-bg)":"var(--amber-bg)",fontSize:10.5,color:r.sev==="high"?"var(--red)":"#92400E"},children:r.msg},i))]},e.sh.id))]}),t.jsxs("div",{style:{fontSize:10,color:"var(--text-3)",lineHeight:1.5,padding:"0 4px"},children:["Exposure tiers, detention priors, dwell and demurrage figures and the hub watch list are MODELED screening inputs, printed in full and editable above, never presented as determinations. Evidence files and chain declarations are yours and your suppliers'. Overrides are always available and always audited. Nothing here files with CBP or renders legal judgment.",W&&t.jsxs(t.Fragment,{children:[" Related: ",t.jsx("b",{style:{cursor:"pointer",color:"var(--brand)"},onClick:()=>W("radar"),children:"Risk radar"})," · ",t.jsx("b",{style:{cursor:"pointer",color:"var(--brand)"},onClick:()=>W("transit"),children:"In transit"}),"."]})]})]})}export{He 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.