@burdenoff/microfe-theglobalfuel 2026.705.3 → 2026.705.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/dist/theglobalfuel/TheGlobalFuelRoot.js +54 -46
  2. package/dist/theglobalfuel/TheGlobalFuelRoot.js.map +1 -1
  3. package/dist/theglobalfuel/TheGlobalFuelRoutes.js +10 -6
  4. package/dist/theglobalfuel/TheGlobalFuelRoutes.js.map +1 -1
  5. package/dist/theglobalfuel/components/DataTable.js +126 -58
  6. package/dist/theglobalfuel/components/DataTable.js.map +1 -1
  7. package/dist/theglobalfuel/components/EmptyState.js +4 -4
  8. package/dist/theglobalfuel/components/EmptyState.js.map +1 -1
  9. package/dist/theglobalfuel/components/MetricsCard.js +2 -2
  10. package/dist/theglobalfuel/components/MetricsCard.js.map +1 -1
  11. package/dist/theglobalfuel/components/WorldMap.js +115 -0
  12. package/dist/theglobalfuel/components/WorldMap.js.map +1 -0
  13. package/dist/theglobalfuel/components/index.js +9 -0
  14. package/dist/theglobalfuel/components/viz/AllocationBar.js +68 -0
  15. package/dist/theglobalfuel/components/viz/AllocationBar.js.map +1 -0
  16. package/dist/theglobalfuel/components/viz/AreaChart.js +102 -0
  17. package/dist/theglobalfuel/components/viz/AreaChart.js.map +1 -0
  18. package/dist/theglobalfuel/components/viz/AvatarStack.js +2 -0
  19. package/dist/theglobalfuel/components/viz/BarChart.js +4 -0
  20. package/dist/theglobalfuel/components/viz/CertificateCard.js +4 -0
  21. package/dist/theglobalfuel/components/viz/DonutChart.js +109 -0
  22. package/dist/theglobalfuel/components/viz/DonutChart.js.map +1 -0
  23. package/dist/theglobalfuel/components/viz/HBarFunnel.js +3 -0
  24. package/dist/theglobalfuel/components/viz/Heatmap.js +3 -0
  25. package/dist/theglobalfuel/components/viz/KanbanBoard.js +2 -0
  26. package/dist/theglobalfuel/components/viz/LineChart.js +4 -0
  27. package/dist/theglobalfuel/components/viz/OrgTree.js +2 -0
  28. package/dist/theglobalfuel/components/viz/PathSteps.js +68 -0
  29. package/dist/theglobalfuel/components/viz/PathSteps.js.map +1 -0
  30. package/dist/theglobalfuel/components/viz/ProgressRing.js +6 -0
  31. package/dist/theglobalfuel/components/viz/ProgressRing.js.map +1 -0
  32. package/dist/theglobalfuel/components/viz/RatingStars.js +3 -0
  33. package/dist/theglobalfuel/components/viz/SegmentedTabs.js +3 -0
  34. package/dist/theglobalfuel/components/viz/SkillBar.js +3 -0
  35. package/dist/theglobalfuel/components/viz/Sparkline.js +74 -0
  36. package/dist/theglobalfuel/components/viz/Sparkline.js.map +1 -0
  37. package/dist/theglobalfuel/components/viz/StatCard.js +3 -0
  38. package/dist/theglobalfuel/components/viz/StepProgress.js +64 -0
  39. package/dist/theglobalfuel/components/viz/StepProgress.js.map +1 -0
  40. package/dist/theglobalfuel/components/viz/Timeline.js +66 -0
  41. package/dist/theglobalfuel/components/viz/Timeline.js.map +1 -0
  42. package/dist/theglobalfuel/components/viz/index.js +23 -0
  43. package/dist/theglobalfuel/components/viz/lib/Avatar.js +1 -0
  44. package/dist/theglobalfuel/components/viz/lib/CartesianFrame.js +119 -0
  45. package/dist/theglobalfuel/components/viz/lib/CartesianFrame.js.map +1 -0
  46. package/dist/theglobalfuel/components/viz/lib/ResponsiveSvg.js +35 -0
  47. package/dist/theglobalfuel/components/viz/lib/ResponsiveSvg.js.map +1 -0
  48. package/dist/theglobalfuel/components/viz/lib/format.js +17 -0
  49. package/dist/theglobalfuel/components/viz/lib/format.js.map +1 -0
  50. package/dist/theglobalfuel/components/viz/lib/geometry.js +61 -0
  51. package/dist/theglobalfuel/components/viz/lib/geometry.js.map +1 -0
  52. package/dist/theglobalfuel/components/viz/lib/hooks.js +39 -0
  53. package/dist/theglobalfuel/components/viz/lib/hooks.js.map +1 -0
  54. package/dist/theglobalfuel/components/viz/lib/palette.js +27 -0
  55. package/dist/theglobalfuel/components/viz/lib/palette.js.map +1 -0
  56. package/dist/theglobalfuel/pages/assets/AssetDetailPage.js +431 -316
  57. package/dist/theglobalfuel/pages/assets/AssetDetailPage.js.map +1 -1
  58. package/dist/theglobalfuel/pages/dashboard/DashboardPage.js +525 -227
  59. package/dist/theglobalfuel/pages/dashboard/DashboardPage.js.map +1 -1
  60. package/dist/theglobalfuel/pages/emissions/EmissionsPage.js +255 -206
  61. package/dist/theglobalfuel/pages/emissions/EmissionsPage.js.map +1 -1
  62. package/dist/theglobalfuel/pages/provenance/ProvenancePage.js +465 -0
  63. package/dist/theglobalfuel/pages/provenance/ProvenancePage.js.map +1 -0
  64. package/dist/theglobalfuel/pages/shipments/ShipmentsPage.js +356 -227
  65. package/dist/theglobalfuel/pages/shipments/ShipmentsPage.js.map +1 -1
  66. package/package.json +1 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ProvenancePage.js","names":[],"sources":["../../../../src/theglobalfuel/pages/provenance/ProvenancePage.tsx"],"sourcesContent":["/**\n * Provenance — chain-of-custody traceability (pit → port → certificate).\n * @module theglobalfuel/pages/provenance\n *\n * The flagship end-to-end traceability view. The user picks a resource asset and\n * we assemble its custody chain entirely from REAL linked records:\n * Asset (registry) → Production → Inventory lot → Shipment (+ document) →\n * Delivered → Chain-of-custody certificate (+ evidence)\n *\n * Sources — all `the*` endpoints, no mock data:\n * - useTheAsset(id) → the asset + nested productionRecords/reserves\n * - useTheInventoryLots() → filtered client-side to lot.assetId === id\n * - useTheEmissionRecords() → attributed emissions for the summary\n * - useTheComplianceCerts(id) → CHAIN_OF_CUSTODY / evidence certs\n * - useTheContracts({commodity}) + useTheContract() → offtake + nested shipments\n *\n * The chain renders as a StepProgress flow + a row of rich node cards (each\n * carrying the real record and a FileLink for its document/evidence), a Timeline\n * of the real dated events, an origin map and a provenance summary. Every stage\n * degrades gracefully when its downstream record does not exist yet (pre-launch).\n */\n\nimport { useMemo, useState, type ReactNode } from 'react';\nimport {\n Link2,\n MapPin,\n Gauge,\n Boxes,\n Ship,\n CheckCircle2,\n ShieldCheck,\n Shield,\n Fuel,\n Factory,\n Route,\n Layers,\n} from 'lucide-react';\nimport {\n GlassCard,\n Select,\n SelectContent,\n SelectItem,\n SelectTrigger,\n SelectValue,\n} from '@burdenoff/fe-libs/ui';\nimport {\n PageLayout,\n StatusBadge,\n LoadingView,\n ErrorView,\n EmptyState,\n FileLink,\n WorldMap,\n StepProgress,\n Timeline,\n type TimelineItem,\n type StepProgressStep,\n type PathStepState,\n} from '../../components';\nimport { useTheGlobalFuel } from '../../context';\nimport {\n useTheAssets,\n useTheAsset,\n useTheInventoryLots,\n useTheEmissionRecords,\n useTheComplianceCerts,\n useTheContracts,\n useTheContract,\n} from '../../hooks';\nimport { cn } from '../../utils/cn';\nimport {\n formatDate,\n formatVolume,\n formatEnumLabel,\n formatCoords,\n formatNumber,\n formatTonnesCo2e,\n} from '../../utils';\nimport type { TheProductionRecord, TheInventoryLot, TheShipment } from '../../types';\n\nconst PAGE: { limit: number } = { limit: 200 };\n\n/** Latest-first by an optional date field, falling back to createdAt. */\nfunction byDateDesc<T extends { createdAt: string }>(pick: (row: T) => string | null | undefined) {\n return (a: T, b: T): number => {\n const av = new Date(pick(a) ?? a.createdAt).getTime();\n const bv = new Date(pick(b) ?? b.createdAt).getTime();\n return bv - av;\n };\n}\n\n// ── Chain node card ──────────────────────────────────────────────────────────\n\ninterface ChainNodeVM {\n step: number;\n icon: ReactNode;\n label: string;\n /** Real primary value; shown muted as \"Pending\" when the artifact is absent. */\n primary: ReactNode;\n secondary?: ReactNode;\n badge?: ReactNode;\n fileId?: string | null;\n state: PathStepState;\n present: boolean;\n}\n\nconst NUMBER_STYLE: Record<PathStepState, string> = {\n done: 'bg-status-success-bg-subtle text-status-success-text',\n active: 'bg-[var(--color-accent-soft)] text-accent',\n todo: 'bg-bg-sunken text-text-muted',\n locked: 'bg-bg-sunken text-text-muted',\n};\n\nconst ICON_STYLE: Record<PathStepState, string> = {\n done: 'bg-status-success-bg-subtle text-status-success-text',\n active: 'bg-[var(--color-accent-soft)] text-accent',\n todo: 'bg-bg-sunken text-text-tertiary',\n locked: 'bg-bg-sunken text-text-tertiary',\n};\n\nconst DOT_STYLE: Record<PathStepState, string> = {\n done: 'bg-status-success-text',\n active: 'bg-[var(--color-accent-primary)] motion-safe:animate-vc-glow-pulse',\n todo: 'bg-border-strong',\n locked: 'bg-border-strong',\n};\n\nfunction ChainNodeCard({ node }: { node: ChainNodeVM }) {\n return (\n <GlassCard\n treatment=\"glass\"\n className={cn(\n 'relative flex h-full flex-col gap-3 p-5 transition-shadow',\n node.state === 'done' && 'shadow-[inset_0_2px_0_0_var(--color-status-success-text)]',\n node.state === 'active' && 'shadow-[inset_0_2px_0_0_var(--color-accent-primary)]'\n )}\n >\n <div className=\"flex items-center justify-between\">\n <span\n className={cn(\n 'flex size-7 items-center justify-center rounded-full text-xs font-semibold tabular-nums',\n NUMBER_STYLE[node.state]\n )}\n >\n {node.step}\n </span>\n <span aria-hidden=\"true\" className={cn('size-2 rounded-full', DOT_STYLE[node.state])} />\n </div>\n\n <span\n className={cn(\n 'flex size-11 items-center justify-center rounded-xl [&_svg]:size-6',\n ICON_STYLE[node.state]\n )}\n >\n {node.icon}\n </span>\n\n <div className=\"min-w-0\">\n <p className=\"text-xs font-medium uppercase tracking-wide text-text-tertiary\">\n {node.label}\n </p>\n <p\n className={cn(\n 'mt-1 truncate text-base font-semibold',\n node.present ? 'text-text-primary' : 'text-text-muted'\n )}\n title={typeof node.primary === 'string' ? node.primary : undefined}\n >\n {node.present ? node.primary : 'Pending'}\n </p>\n {node.present && node.secondary && (\n <p className=\"mt-0.5 line-clamp-2 text-xs text-text-secondary\">{node.secondary}</p>\n )}\n </div>\n\n {(node.badge || (node.present && node.fileId)) && (\n <div className=\"mt-auto flex flex-wrap items-center gap-2 pt-1\">\n {node.badge}\n {node.present && node.fileId && <FileLink fileId={node.fileId} />}\n </div>\n )}\n </GlassCard>\n );\n}\n\n// ── Summary cell ─────────────────────────────────────────────────────────────\n\nfunction SummaryCell({\n icon,\n label,\n value,\n caption,\n}: {\n icon: ReactNode;\n label: string;\n value: ReactNode;\n caption?: ReactNode;\n}) {\n return (\n <div className=\"flex items-start gap-3\">\n <span className=\"mt-0.5 flex size-9 shrink-0 items-center justify-center rounded-lg bg-[var(--color-accent-soft)] text-accent [&_svg]:size-4\">\n {icon}\n </span>\n <div className=\"min-w-0\">\n <p className=\"text-xs font-medium uppercase tracking-wide text-text-tertiary\">{label}</p>\n <p className=\"mt-0.5 truncate text-sm font-semibold text-text-primary\">{value}</p>\n {caption && <p className=\"truncate text-xs text-text-tertiary\">{caption}</p>}\n </div>\n </div>\n );\n}\n\n// ── Page ─────────────────────────────────────────────────────────────────────\n\nexport function ProvenancePage() {\n const { navigateTo } = useTheGlobalFuel();\n\n const assets = useTheAssets({ pagination: PAGE });\n const assetRows = useMemo(() => assets.data?.items ?? [], [assets.data]);\n\n const [selectedAssetId, setSelectedAssetId] = useState<string>('');\n // Auto-focus the first asset (no effect needed) so the chain renders at once;\n // an explicit user selection always wins.\n const effectiveAssetId = selectedAssetId || assetRows[0]?.id || '';\n\n const asset = useTheAsset(effectiveAssetId || undefined);\n const inventory = useTheInventoryLots({ pagination: PAGE });\n const emissions = useTheEmissionRecords({\n assetId: effectiveAssetId || undefined,\n pagination: PAGE,\n });\n const compliance = useTheComplianceCerts(\n effectiveAssetId || undefined,\n undefined,\n undefined,\n PAGE\n );\n const contracts = useTheContracts({ commodity: asset.data?.commodity, pagination: PAGE });\n\n // Pick the contract most likely to carry a delivered shipment for this\n // commodity: prefer one that has already delivered volume (SELL first), else\n // the most recent. Its nested shipments give us the movement + delivery nodes.\n const pickedContractId = useMemo(() => {\n const rows = [...(contracts.data?.items ?? [])].sort(byDateDesc((c) => c.createdAt));\n const pick =\n rows.find((c) => c.deliveredVolume > 0 && c.side === 'SELL') ??\n rows.find((c) => c.deliveredVolume > 0) ??\n rows.find((c) => c.side === 'SELL') ??\n rows[0];\n return pick?.id;\n }, [contracts.data]);\n\n const contractDetail = useTheContract(pickedContractId);\n\n // ── Derive the chain from real linked records ──────────────────────────────\n const productionRecords = useMemo(\n () => [...(asset.data?.productionRecords ?? [])].sort(byDateDesc((r) => r.periodEnd)),\n [asset.data]\n );\n const latestProduction: TheProductionRecord | undefined = productionRecords[0];\n\n const assetLots = useMemo<TheInventoryLot[]>(\n () =>\n (inventory.data?.items ?? [])\n .filter((l) => l.assetId === effectiveAssetId)\n .sort(byDateDesc((l) => l.producedAt)),\n [inventory.data, effectiveAssetId]\n );\n const latestLot: TheInventoryLot | undefined = assetLots[0];\n\n const shipments = useMemo<TheShipment[]>(\n () => contractDetail.data?.shipments ?? [],\n [contractDetail.data]\n );\n const deliveredShipment = useMemo<TheShipment | undefined>(\n () =>\n [...shipments]\n .filter((s) => s.status === 'DELIVERED')\n .sort(byDateDesc((s) => s.deliveredAt))[0],\n [shipments]\n );\n const primaryShipment = useMemo<TheShipment | undefined>(\n () =>\n deliveredShipment ?? [...shipments].sort(byDateDesc((s) => s.departedAt ?? s.scheduledAt))[0],\n [deliveredShipment, shipments]\n );\n const pickedContract = useMemo(\n () => contracts.data?.items.find((c) => c.id === pickedContractId),\n [contracts.data, pickedContractId]\n );\n\n const certRows = useMemo(() => compliance.data?.items ?? [], [compliance.data]);\n const custodyCert = useMemo(\n () =>\n certRows.find((c) => c.category === 'CHAIN_OF_CUSTODY') ??\n certRows.find((c) => c.status === 'APPROVED') ??\n certRows[0],\n [certRows]\n );\n const certApproved = custodyCert?.status === 'APPROVED';\n\n const emissionRows = useMemo(() => emissions.data?.items ?? [], [emissions.data]);\n const totalTonnes = emissionRows.reduce((sum, e) => sum + (e.co2eTonnes ?? 0), 0);\n const verifiedEmissions = emissionRows.filter((e) => e.verified).length;\n\n const a = asset.data;\n\n // Stage completeness, in chain order.\n const completeFlags = [\n Boolean(a),\n productionRecords.length > 0,\n assetLots.length > 0,\n Boolean(primaryShipment),\n Boolean(deliveredShipment),\n certApproved,\n ];\n const completeCount = completeFlags.filter(Boolean).length;\n const firstIncomplete = completeFlags.findIndex((f) => !f);\n const current = firstIncomplete === -1 ? completeFlags.length : firstIncomplete;\n const verified = certApproved && Boolean(deliveredShipment);\n\n const stateFor = (i: number): PathStepState =>\n completeFlags[i] ? 'done' : i === current ? 'active' : 'todo';\n\n const progressSteps: StepProgressStep[] = [\n { label: 'Asset', description: 'Origin' },\n { label: 'Production', description: 'Extracted' },\n { label: 'Inventory', description: 'Lotted' },\n { label: 'Shipment', description: 'In transit' },\n { label: 'Delivered', description: 'Received' },\n { label: 'Certificate', description: 'Verified' },\n ];\n\n const shipmentRoute =\n primaryShipment && (primaryShipment.origin || primaryShipment.destination)\n ? [primaryShipment.origin, primaryShipment.destination].filter(Boolean).join(' → ')\n : undefined;\n\n const nodes: ChainNodeVM[] = a\n ? [\n {\n step: 1,\n icon: <MapPin />,\n label: 'Asset',\n primary: a.name,\n secondary: a.location ?? formatCoords(a.latitude, a.longitude),\n badge: <StatusBadge status={a.status} />,\n state: stateFor(0),\n present: true,\n },\n {\n step: 2,\n icon: <Gauge />,\n label: 'Production',\n primary: latestProduction\n ? formatVolume(latestProduction.volume, latestProduction.unit)\n : 'Not yet recorded',\n secondary: latestProduction\n ? `${formatDate(latestProduction.periodStart)} – ${formatDate(latestProduction.periodEnd)}`\n : undefined,\n state: stateFor(1),\n present: Boolean(latestProduction),\n },\n {\n step: 3,\n icon: <Boxes />,\n label: 'Inventory lot',\n primary: latestLot ? latestLot.lotCode : 'No lot yet',\n secondary: latestLot ? formatVolume(latestLot.quantity, latestLot.unit) : undefined,\n badge: latestLot ? <StatusBadge status={latestLot.status} /> : undefined,\n state: stateFor(2),\n present: Boolean(latestLot),\n },\n {\n step: 4,\n icon: <Ship />,\n label: 'Shipment',\n primary: primaryShipment ? primaryShipment.reference : 'Not shipped',\n secondary: primaryShipment\n ? [formatEnumLabel(primaryShipment.mode), shipmentRoute].filter(Boolean).join(' · ')\n : undefined,\n badge: primaryShipment ? <StatusBadge status={primaryShipment.status} /> : undefined,\n fileId: primaryShipment?.document?.id,\n state: stateFor(3),\n present: Boolean(primaryShipment),\n },\n {\n step: 5,\n icon: <CheckCircle2 />,\n label: 'Delivered',\n primary: deliveredShipment\n ? formatVolume(deliveredShipment.volume, deliveredShipment.unit)\n : 'Awaiting delivery',\n secondary: deliveredShipment\n ? [\n deliveredShipment.deliveredAt ? formatDate(deliveredShipment.deliveredAt) : null,\n pickedContract ? `Contract ${pickedContract.reference}` : null,\n ]\n .filter(Boolean)\n .join(' · ') || undefined\n : undefined,\n state: stateFor(4),\n present: Boolean(deliveredShipment),\n },\n {\n step: 6,\n icon: <ShieldCheck />,\n label: 'Certificate',\n primary: custodyCert ? (custodyCert.certNumber ?? custodyCert.title) : 'No certificate',\n secondary: custodyCert ? formatEnumLabel(custodyCert.category) : undefined,\n badge: custodyCert ? <StatusBadge status={custodyCert.status} /> : undefined,\n fileId: custodyCert?.evidence?.id,\n state: stateFor(5),\n present: Boolean(custodyCert),\n },\n ]\n : [];\n\n // ── Timeline (real dated events, ascending) ────────────────────────────────\n const timelineItems = useMemo<TimelineItem[]>(() => {\n if (!a) return [];\n const raw: { date: string; item: Omit<TimelineItem, 'time'> }[] = [];\n const push = (date: string | null | undefined, item: Omit<TimelineItem, 'time'>) => {\n if (!date) return;\n const t = new Date(date).getTime();\n if (Number.isNaN(t)) return;\n raw.push({ date, item });\n };\n\n push(a.commissionedAt ?? a.createdAt, {\n title: 'Asset registered',\n meta: a.name,\n tone: 'accent',\n icon: <MapPin className=\"h-3 w-3\" />,\n });\n if (latestProduction) {\n push(latestProduction.periodEnd ?? latestProduction.createdAt, {\n title: 'Production recorded',\n meta: formatVolume(latestProduction.volume, latestProduction.unit),\n tone: 'info',\n icon: <Gauge className=\"h-3 w-3\" />,\n });\n }\n if (latestLot) {\n push(latestLot.producedAt ?? latestLot.createdAt, {\n title: 'Inventory lot created',\n meta: `${latestLot.lotCode} · ${formatVolume(latestLot.quantity, latestLot.unit)}`,\n tone: 'info',\n icon: <Boxes className=\"h-3 w-3\" />,\n });\n }\n if (primaryShipment) {\n push(primaryShipment.departedAt ?? primaryShipment.scheduledAt ?? primaryShipment.createdAt, {\n title: primaryShipment.departedAt ? 'Shipment departed' : 'Shipment scheduled',\n meta: [primaryShipment.reference, shipmentRoute].filter(Boolean).join(' · '),\n tone: 'accent',\n icon: <Ship className=\"h-3 w-3\" />,\n });\n }\n if (deliveredShipment?.deliveredAt) {\n push(deliveredShipment.deliveredAt, {\n title: 'Delivered',\n meta: formatVolume(deliveredShipment.volume, deliveredShipment.unit),\n tone: 'success',\n icon: <CheckCircle2 className=\"h-3 w-3\" />,\n });\n }\n if (custodyCert) {\n push(custodyCert.issuedAt ?? custodyCert.createdAt, {\n title: certApproved ? 'Certificate approved' : 'Certificate registered',\n meta: custodyCert.certNumber ?? custodyCert.title,\n tone: certApproved ? 'success' : 'warning',\n icon: <ShieldCheck className=\"h-3 w-3\" />,\n });\n }\n\n return raw\n .sort((x, y) => new Date(x.date).getTime() - new Date(y.date).getTime())\n .map(({ date, item }) => ({ ...item, time: formatDate(date) }));\n }, [\n a,\n latestProduction,\n latestLot,\n primaryShipment,\n deliveredShipment,\n custodyCert,\n certApproved,\n shipmentRoute,\n ]);\n\n const originPoint =\n a && typeof a.latitude === 'number' && typeof a.longitude === 'number'\n ? { lat: a.latitude, lng: a.longitude, label: a.name, primary: true }\n : null;\n\n const description =\n 'Pit to port to certificate — end-to-end traceability from origin to verified certificate.';\n\n // ── Render ─────────────────────────────────────────────────────────────────\n if (assets.isLoading && assetRows.length === 0) {\n return (\n <PageLayout title=\"Provenance\" description={description}>\n <LoadingView label=\"Loading assets…\" />\n </PageLayout>\n );\n }\n if (assets.isError) {\n return (\n <PageLayout title=\"Provenance\" description={description}>\n <ErrorView message=\"Couldn't load assets to trace.\" onRetry={() => assets.refetch()} />\n </PageLayout>\n );\n }\n if (assetRows.length === 0) {\n return (\n <PageLayout title=\"Provenance\" description={description}>\n <EmptyState\n illustration=\"empty-data\"\n icon={<Link2 className=\"h-10 w-10\" />}\n title=\"No assets to trace\"\n description=\"Register a resource asset to build its end-to-end chain of custody.\"\n action={\n <button\n type=\"button\"\n onClick={() => navigateTo('assets')}\n className=\"rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:opacity-90\"\n >\n Go to assets\n </button>\n }\n />\n </PageLayout>\n );\n }\n\n return (\n <PageLayout title=\"Provenance\" description={description}>\n {/* Control bar: asset picker + trust state */}\n <GlassCard\n treatment=\"glass\"\n className=\"flex flex-col gap-4 p-5 sm:flex-row sm:items-center sm:justify-between\"\n >\n <div className=\"flex min-w-0 flex-1 flex-col gap-1.5\">\n <label\n htmlFor=\"provenance-asset\"\n className=\"text-xs font-medium uppercase tracking-wide text-text-tertiary\"\n >\n Trace asset\n </label>\n <Select value={effectiveAssetId} onValueChange={setSelectedAssetId}>\n <SelectTrigger\n id=\"provenance-asset\"\n className=\"h-10 w-full sm:w-96\"\n aria-label=\"Select an asset to trace\"\n >\n <SelectValue placeholder=\"Select an asset to trace\" />\n </SelectTrigger>\n <SelectContent>\n {assetRows.map((row) => (\n <SelectItem key={row.id} value={row.id}>\n {row.name} · {formatEnumLabel(row.commodity)}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n </div>\n <div\n className={cn(\n 'flex items-center gap-2 self-start rounded-full px-3.5 py-1.5 text-sm font-medium',\n verified\n ? 'bg-status-success-bg-subtle text-status-success-text'\n : 'bg-bg-sunken text-text-secondary'\n )}\n >\n {verified ? <ShieldCheck className=\"h-4 w-4\" /> : <Shield className=\"h-4 w-4\" />}\n {verified ? 'Chain of custody verified' : `Traceability in progress · ${completeCount}/6`}\n </div>\n </GlassCard>\n\n {asset.isLoading ? (\n <div className=\"mt-6\">\n <LoadingView label=\"Assembling chain of custody…\" />\n </div>\n ) : asset.isError || !a ? (\n <div className=\"mt-6\">\n <ErrorView\n message=\"Couldn't load this asset's provenance.\"\n onRetry={() => asset.refetch()}\n />\n </div>\n ) : (\n <>\n {/* Flow ribbon */}\n <GlassCard treatment=\"glass\" className=\"mt-6 p-5\">\n <StepProgress steps={progressSteps} current={current} />\n </GlassCard>\n\n {/* Chain nodes */}\n <div className=\"mt-6 grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-6\">\n {nodes.map((node) => (\n <ChainNodeCard key={node.step} node={node} />\n ))}\n </div>\n\n {/* Timeline + origin */}\n <div className=\"mt-6 grid grid-cols-1 gap-6 lg:grid-cols-3\">\n <GlassCard treatment=\"glass\" className=\"p-5 lg:col-span-2\">\n <div className=\"mb-4 flex items-center gap-2.5\">\n <span className=\"flex size-8 items-center justify-center rounded-lg bg-[var(--color-accent-soft)] text-accent\">\n <Route className=\"h-4 w-4\" />\n </span>\n <div>\n <h2 className=\"text-base font-semibold text-text-primary\">\n Traceability timeline\n </h2>\n <p className=\"text-xs text-text-tertiary\">\n Recorded custody events, oldest to newest.\n </p>\n </div>\n </div>\n {timelineItems.length > 0 ? (\n <Timeline items={timelineItems} />\n ) : (\n <div className=\"rounded-xl border border-dashed border-border-seam py-8 text-center text-sm text-text-secondary\">\n No dated custody events yet.\n </div>\n )}\n </GlassCard>\n\n <GlassCard treatment=\"glass\" className=\"flex flex-col gap-4 p-5\">\n <div className=\"flex items-center gap-2.5\">\n <span className=\"flex size-8 items-center justify-center rounded-lg bg-[var(--color-accent-soft)] text-accent\">\n <MapPin className=\"h-4 w-4\" />\n </span>\n <div className=\"min-w-0\">\n <h2 className=\"text-base font-semibold text-text-primary\">Origin</h2>\n <p className=\"truncate text-xs text-text-tertiary\">\n {a.location ?? formatEnumLabel(a.kind)}\n </p>\n </div>\n </div>\n {originPoint ? (\n <WorldMap points={[originPoint]} />\n ) : (\n <div className=\"rounded-xl border border-dashed border-border-seam py-8 text-center text-sm text-text-secondary\">\n No coordinates recorded for this asset.\n </div>\n )}\n </GlassCard>\n </div>\n\n {/* Provenance summary */}\n <GlassCard treatment=\"glass\" className=\"mt-6 p-5\">\n <h2 className=\"mb-4 text-base font-semibold text-text-primary\">Provenance summary</h2>\n <div className=\"grid grid-cols-1 gap-5 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-6\">\n <SummaryCell\n icon={<Fuel />}\n label=\"Commodity\"\n value={formatEnumLabel(a.commodity)}\n caption={formatEnumLabel(a.kind)}\n />\n <SummaryCell\n icon={<MapPin />}\n label=\"Origin\"\n value={a.location ?? a.name}\n caption={formatCoords(a.latitude, a.longitude)}\n />\n <SummaryCell\n icon={<Gauge />}\n label=\"Production\"\n value={`${formatNumber(productionRecords.length)} records`}\n caption={\n latestProduction\n ? `Latest ${formatVolume(latestProduction.volume, latestProduction.unit)}`\n : 'None yet'\n }\n />\n <SummaryCell\n icon={<Boxes />}\n label=\"Inventory\"\n value={`${formatNumber(assetLots.length)} lots`}\n caption={latestLot ? latestLot.lotCode : 'None yet'}\n />\n <SummaryCell\n icon={<Factory />}\n label=\"Emissions\"\n value={emissions.isError ? '—' : formatTonnesCo2e(totalTonnes)}\n caption={`${verifiedEmissions} verified`}\n />\n <SummaryCell\n icon={<ShieldCheck />}\n label=\"Certificates\"\n value={`${formatNumber(certRows.length)} tracked`}\n caption={\n certApproved ? 'Custody approved' : custodyCert ? 'Under review' : 'None yet'\n }\n />\n </div>\n </GlassCard>\n\n {/* Reserves footnote — surface proved reserves when present */}\n {(a.reserveEstimates?.length ?? 0) > 0 && (\n <p className=\"mt-4 flex items-center gap-1.5 text-xs text-text-tertiary\">\n <Layers className=\"h-3.5 w-3.5\" />\n {formatNumber(a.reserveEstimates?.length ?? 0)} reserve estimate\n {(a.reserveEstimates?.length ?? 0) === 1 ? '' : 's'} on record for this asset.\n </p>\n )}\n </>\n )}\n </PageLayout>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAgFA,IAAM,IAA0B,EAAE,OAAO,KAAK;AAG9C,SAAS,EAA4C,GAA6C;AAChG,SAAQ,GAAM,MAAiB;EAC7B,IAAM,IAAK,IAAI,KAAK,EAAK,EAAE,IAAI,EAAE,UAAU,CAA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