@burdenoff/microfe-theglobalfuel 2026.716.1 → 2026.720.2
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.
- package/dist/theglobalfuel/TheGlobalFuelRoutes.d.ts.map +1 -1
- package/dist/theglobalfuel/TheGlobalFuelRoutes.js +34 -22
- package/dist/theglobalfuel/TheGlobalFuelRoutes.js.map +1 -1
- package/dist/theglobalfuel/components/DataTable.js +1 -1
- package/dist/theglobalfuel/components/DataTable.js.map +1 -1
- package/dist/theglobalfuel/components/MiniBar.d.ts.map +1 -1
- package/dist/theglobalfuel/components/MiniBar.js +1 -1
- package/dist/theglobalfuel/components/MiniBar.js.map +1 -1
- package/dist/theglobalfuel/components/Tabs.js +1 -1
- package/dist/theglobalfuel/components/Tabs.js.map +1 -1
- package/dist/theglobalfuel/components/index.js +2 -0
- package/dist/theglobalfuel/components/viz/BarChart.js +83 -4
- package/dist/theglobalfuel/components/viz/BarChart.js.map +1 -0
- package/dist/theglobalfuel/components/viz/StatCard.js +60 -3
- package/dist/theglobalfuel/components/viz/StatCard.js.map +1 -0
- package/dist/theglobalfuel/hooks/useTheGlobalFuelApi.d.ts +10 -1
- package/dist/theglobalfuel/hooks/useTheGlobalFuelApi.d.ts.map +1 -1
- package/dist/theglobalfuel/hooks/useTheGlobalFuelApi.js +1 -1
- package/dist/theglobalfuel/hooks/useTheGlobalFuelApi.js.map +1 -1
- package/dist/theglobalfuel/pages/alerts/AlertsPage.d.ts +16 -0
- package/dist/theglobalfuel/pages/alerts/AlertsPage.d.ts.map +1 -0
- package/dist/theglobalfuel/pages/alerts/AlertsPage.js +295 -0
- package/dist/theglobalfuel/pages/alerts/AlertsPage.js.map +1 -0
- package/dist/theglobalfuel/pages/analytics/AnalyticsPage.d.ts +13 -0
- package/dist/theglobalfuel/pages/analytics/AnalyticsPage.d.ts.map +1 -0
- package/dist/theglobalfuel/pages/analytics/AnalyticsPage.js +358 -0
- package/dist/theglobalfuel/pages/analytics/AnalyticsPage.js.map +1 -0
- package/dist/theglobalfuel/pages/assets/AssetDetailPage.d.ts.map +1 -1
- package/dist/theglobalfuel/pages/assets/AssetDetailPage.js +386 -342
- package/dist/theglobalfuel/pages/assets/AssetDetailPage.js.map +1 -1
- package/dist/theglobalfuel/pages/assets/AssetsPage.d.ts.map +1 -1
- package/dist/theglobalfuel/pages/assets/AssetsPage.js +277 -199
- package/dist/theglobalfuel/pages/assets/AssetsPage.js.map +1 -1
- package/dist/theglobalfuel/pages/contracts/ContractsPage.js +1 -1
- package/dist/theglobalfuel/pages/contracts/ContractsPage.js.map +1 -1
- package/dist/theglobalfuel/pages/dashboard/DashboardPage.js +6 -6
- package/dist/theglobalfuel/pages/dashboard/DashboardPage.js.map +1 -1
- package/dist/theglobalfuel/pages/emissions/EmissionsPage.js +1 -1
- package/dist/theglobalfuel/pages/emissions/EmissionsPage.js.map +1 -1
- package/dist/theglobalfuel/pages/inventory/InventoryPage.js +1 -1
- package/dist/theglobalfuel/pages/inventory/InventoryPage.js.map +1 -1
- package/dist/theglobalfuel/pages/provenance/ProvenancePage.d.ts.map +1 -1
- package/dist/theglobalfuel/pages/provenance/ProvenancePage.js +372 -216
- package/dist/theglobalfuel/pages/provenance/ProvenancePage.js.map +1 -1
- package/dist/theglobalfuel/pages/reports/ReportsPage.d.ts +16 -0
- package/dist/theglobalfuel/pages/reports/ReportsPage.d.ts.map +1 -0
- package/dist/theglobalfuel/pages/reports/ReportsPage.js +578 -0
- package/dist/theglobalfuel/pages/reports/ReportsPage.js.map +1 -0
- package/dist/theglobalfuel/pages/shipments/ShipmentsPage.d.ts.map +1 -1
- package/dist/theglobalfuel/pages/shipments/ShipmentsPage.js +43 -12
- package/dist/theglobalfuel/pages/shipments/ShipmentsPage.js.map +1 -1
- package/dist/theglobalfuel/types/index.d.ts +37 -8
- package/dist/theglobalfuel/types/index.d.ts.map +1 -1
- package/dist/theglobalfuel/utils/csv.d.ts +16 -0
- package/dist/theglobalfuel/utils/csv.d.ts.map +1 -0
- package/dist/theglobalfuel/utils/csv.js +14 -0
- package/dist/theglobalfuel/utils/csv.js.map +1 -0
- package/dist/theglobalfuel/utils/index.d.ts +2 -0
- package/dist/theglobalfuel/utils/index.d.ts.map +1 -1
- package/dist/theglobalfuel/utils/pageContext.d.ts.map +1 -1
- package/dist/theglobalfuel/utils/pageContext.js +32 -0
- package/dist/theglobalfuel/utils/pageContext.js.map +1 -1
- package/dist/theglobalfuel/utils/provenance.d.ts +135 -0
- package/dist/theglobalfuel/utils/provenance.d.ts.map +1 -0
- package/dist/theglobalfuel/utils/provenance.js +57 -0
- package/dist/theglobalfuel/utils/provenance.js.map +1 -0
- package/package.json +1 -1
|
@@ -3,108 +3,118 @@ import { cn as t } from "../../utils/cn.js";
|
|
|
3
3
|
import { PageLayout as n } from "../../components/PageLayout.js";
|
|
4
4
|
import { formatCoords as r, formatDate as i, formatEnumLabel as a, formatNumber as o, formatTonnesCo2e as ee, formatVolume as s } from "../../utils/formatters.js";
|
|
5
5
|
import { StatusBadge as c } from "../../components/StatusBadge.js";
|
|
6
|
-
import { ErrorView as
|
|
7
|
-
import { EmptyState as
|
|
8
|
-
import { Timeline as
|
|
9
|
-
import { StepProgress as
|
|
6
|
+
import { ErrorView as te, LoadingView as ne } from "../../components/StateViews.js";
|
|
7
|
+
import { EmptyState as re } from "../../components/EmptyState.js";
|
|
8
|
+
import { Timeline as ie } from "../../components/viz/Timeline.js";
|
|
9
|
+
import { StepProgress as ae } from "../../components/viz/StepProgress.js";
|
|
10
10
|
import "../../context/index.js";
|
|
11
|
-
import { useTheAsset as
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
11
|
+
import { useTheAsset as oe, useTheAssets as se, useTheComplianceCerts as ce, useTheContract as le, useTheContracts as ue, useTheEmissionRecords as de, useTheInventoryLots as fe } from "../../hooks/useTheGlobalFuelApi.js";
|
|
12
|
+
import { useNotify as pe } from "../../hooks/useNotify.js";
|
|
13
|
+
import { useThePageView as me } from "../../hooks/useThePageView.js";
|
|
14
|
+
import { useTheTranslation as he } from "../../hooks/useTheTranslation.js";
|
|
14
15
|
import "../../hooks/index.js";
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
16
|
+
import { buildProvenanceDocument as ge, downloadTextFile as _e, shortDigest as ve, slugify as ye } from "../../utils/provenance.js";
|
|
17
|
+
import { FileLink as l } from "../../components/FileLink.js";
|
|
18
|
+
import { WorldMap as be } from "../../components/WorldMap.js";
|
|
17
19
|
import "../../components/index.js";
|
|
18
|
-
import { useMemo as
|
|
19
|
-
import { Boxes as
|
|
20
|
-
import { Fragment as
|
|
21
|
-
import { GlassCard as
|
|
20
|
+
import { useMemo as u, useState as xe } from "react";
|
|
21
|
+
import { Boxes as d, CheckCircle2 as Se, Download as Ce, Factory as we, Fingerprint as Te, Fuel as Ee, Gauge as f, Layers as De, Link2 as Oe, MapPin as p, Network as ke, Route as Ae, Share2 as je, Shield as Me, ShieldCheck as m, Ship as h } from "lucide-react";
|
|
22
|
+
import { Fragment as Ne, jsx as g, jsxs as _ } from "react/jsx-runtime";
|
|
23
|
+
import { Button as Pe, GlassCard as v, Select as Fe, SelectContent as Ie, SelectItem as Le, SelectTrigger as Re, SelectValue as ze } from "@burdenoff/fe-libs/ui";
|
|
22
24
|
//#region src/theglobalfuel/pages/provenance/ProvenancePage.tsx
|
|
23
|
-
var
|
|
24
|
-
function
|
|
25
|
+
var y = { limit: 200 }, Be = 6;
|
|
26
|
+
function Ve() {
|
|
27
|
+
return typeof window > "u" ? "" : new URLSearchParams(window.location.search).get("assetId") ?? "";
|
|
28
|
+
}
|
|
29
|
+
function He(e) {
|
|
30
|
+
if (typeof window > "u") return "";
|
|
31
|
+
let t = new URL(window.location.href);
|
|
32
|
+
return t.searchParams.set("assetId", e), t.hash = "", t.toString();
|
|
33
|
+
}
|
|
34
|
+
function b(e) {
|
|
25
35
|
return (t, n) => {
|
|
26
36
|
let r = new Date(e(t) ?? t.createdAt).getTime();
|
|
27
37
|
return new Date(e(n) ?? n.createdAt).getTime() - r;
|
|
28
38
|
};
|
|
29
39
|
}
|
|
30
|
-
var
|
|
40
|
+
var Ue = {
|
|
31
41
|
done: "bg-status-success-bg-subtle text-status-success-text",
|
|
32
|
-
active: "bg-[var(--color-accent-soft)] text-
|
|
42
|
+
active: "bg-[var(--color-accent-soft)] text-action-primary-bg",
|
|
33
43
|
todo: "bg-bg-sunken text-text-muted",
|
|
34
44
|
locked: "bg-bg-sunken text-text-muted"
|
|
35
|
-
},
|
|
45
|
+
}, x = {
|
|
36
46
|
done: "bg-status-success-bg-subtle text-status-success-text",
|
|
37
|
-
active: "bg-[var(--color-accent-soft)] text-
|
|
47
|
+
active: "bg-[var(--color-accent-soft)] text-action-primary-bg",
|
|
38
48
|
todo: "bg-bg-sunken text-text-tertiary",
|
|
39
49
|
locked: "bg-bg-sunken text-text-tertiary"
|
|
40
|
-
},
|
|
50
|
+
}, S = {
|
|
41
51
|
done: "bg-status-success-text",
|
|
42
52
|
active: "bg-[var(--color-accent-primary)] motion-safe:animate-vc-glow-pulse",
|
|
43
53
|
todo: "bg-border-strong",
|
|
44
54
|
locked: "bg-border-strong"
|
|
45
55
|
};
|
|
46
|
-
function
|
|
47
|
-
return /* @__PURE__ */
|
|
56
|
+
function We({ node: e }) {
|
|
57
|
+
return /* @__PURE__ */ _(v, {
|
|
48
58
|
treatment: "glass",
|
|
49
59
|
className: t("relative flex h-full flex-col gap-3 p-5 transition-shadow", e.state === "done" && "shadow-[inset_0_2px_0_0_var(--color-status-success-text)]", e.state === "active" && "shadow-[inset_0_2px_0_0_var(--color-accent-primary)]"),
|
|
50
60
|
children: [
|
|
51
|
-
/* @__PURE__ */
|
|
61
|
+
/* @__PURE__ */ _("div", {
|
|
52
62
|
className: "flex items-center justify-between",
|
|
53
|
-
children: [/* @__PURE__ */
|
|
54
|
-
className: t("flex size-7 items-center justify-center rounded-full text-xs font-semibold tabular-nums",
|
|
63
|
+
children: [/* @__PURE__ */ g("span", {
|
|
64
|
+
className: t("flex size-7 items-center justify-center rounded-full text-xs font-semibold tabular-nums", Ue[e.state]),
|
|
55
65
|
children: e.step
|
|
56
|
-
}), /* @__PURE__ */
|
|
66
|
+
}), /* @__PURE__ */ g("span", {
|
|
57
67
|
"aria-hidden": "true",
|
|
58
|
-
className: t("size-2 rounded-full",
|
|
68
|
+
className: t("size-2 rounded-full", S[e.state])
|
|
59
69
|
})]
|
|
60
70
|
}),
|
|
61
|
-
/* @__PURE__ */
|
|
62
|
-
className: t("flex size-11 items-center justify-center rounded-xl [&_svg]:size-6",
|
|
71
|
+
/* @__PURE__ */ g("span", {
|
|
72
|
+
className: t("flex size-11 items-center justify-center rounded-xl [&_svg]:size-6", x[e.state]),
|
|
63
73
|
children: e.icon
|
|
64
74
|
}),
|
|
65
|
-
/* @__PURE__ */
|
|
75
|
+
/* @__PURE__ */ _("div", {
|
|
66
76
|
className: "min-w-0",
|
|
67
77
|
children: [
|
|
68
|
-
/* @__PURE__ */
|
|
78
|
+
/* @__PURE__ */ g("p", {
|
|
69
79
|
className: "text-xs font-medium uppercase tracking-wide text-text-tertiary",
|
|
70
80
|
children: e.label
|
|
71
81
|
}),
|
|
72
|
-
/* @__PURE__ */
|
|
82
|
+
/* @__PURE__ */ g("p", {
|
|
73
83
|
className: t("mt-1 truncate text-base font-semibold", e.present ? "text-text-primary" : "text-text-muted"),
|
|
74
84
|
title: typeof e.primary == "string" ? e.primary : void 0,
|
|
75
85
|
children: e.present ? e.primary : "Pending"
|
|
76
86
|
}),
|
|
77
|
-
e.present && e.secondary && /* @__PURE__ */
|
|
87
|
+
e.present && e.secondary && /* @__PURE__ */ g("p", {
|
|
78
88
|
className: "mt-0.5 line-clamp-2 text-xs text-text-secondary",
|
|
79
89
|
children: e.secondary
|
|
80
90
|
})
|
|
81
91
|
]
|
|
82
92
|
}),
|
|
83
|
-
(e.badge || e.present && e.fileId) && /* @__PURE__ */
|
|
93
|
+
(e.badge || e.present && e.fileId) && /* @__PURE__ */ _("div", {
|
|
84
94
|
className: "mt-auto flex flex-wrap items-center gap-2 pt-1",
|
|
85
|
-
children: [e.badge, e.present && e.fileId && /* @__PURE__ */
|
|
95
|
+
children: [e.badge, e.present && e.fileId && /* @__PURE__ */ g(l, { fileId: e.fileId })]
|
|
86
96
|
})
|
|
87
97
|
]
|
|
88
98
|
});
|
|
89
99
|
}
|
|
90
|
-
function
|
|
91
|
-
return /* @__PURE__ */
|
|
100
|
+
function C({ icon: e, label: t, value: n, caption: r }) {
|
|
101
|
+
return /* @__PURE__ */ _("div", {
|
|
92
102
|
className: "flex items-start gap-3",
|
|
93
|
-
children: [/* @__PURE__ */
|
|
94
|
-
className: "mt-0.5 flex size-9 shrink-0 items-center justify-center rounded-lg bg-[var(--color-accent-soft)] text-
|
|
103
|
+
children: [/* @__PURE__ */ g("span", {
|
|
104
|
+
className: "mt-0.5 flex size-9 shrink-0 items-center justify-center rounded-lg bg-[var(--color-accent-soft)] text-action-primary-bg [&_svg]:size-4",
|
|
95
105
|
children: e
|
|
96
|
-
}), /* @__PURE__ */
|
|
106
|
+
}), /* @__PURE__ */ _("div", {
|
|
97
107
|
className: "min-w-0",
|
|
98
108
|
children: [
|
|
99
|
-
/* @__PURE__ */
|
|
109
|
+
/* @__PURE__ */ g("p", {
|
|
100
110
|
className: "text-xs font-medium uppercase tracking-wide text-text-tertiary",
|
|
101
111
|
children: t
|
|
102
112
|
}),
|
|
103
|
-
/* @__PURE__ */
|
|
113
|
+
/* @__PURE__ */ g("p", {
|
|
104
114
|
className: "mt-0.5 truncate text-sm font-semibold text-text-primary",
|
|
105
115
|
children: n
|
|
106
116
|
}),
|
|
107
|
-
r && /* @__PURE__ */
|
|
117
|
+
r && /* @__PURE__ */ g("p", {
|
|
108
118
|
className: "truncate text-xs text-text-tertiary",
|
|
109
119
|
children: r
|
|
110
120
|
})
|
|
@@ -112,25 +122,25 @@ function T({ icon: e, label: t, value: n, caption: r }) {
|
|
|
112
122
|
})]
|
|
113
123
|
});
|
|
114
124
|
}
|
|
115
|
-
function
|
|
116
|
-
|
|
117
|
-
let
|
|
118
|
-
assetId:
|
|
119
|
-
pagination:
|
|
120
|
-
}),
|
|
121
|
-
commodity:
|
|
122
|
-
pagination:
|
|
123
|
-
}),
|
|
124
|
-
let e = [...
|
|
125
|
+
function w() {
|
|
126
|
+
me("provenance");
|
|
127
|
+
let l = he(), { navigateTo: Ue } = e(), x = se({ pagination: y }), S = u(() => x.data?.items ?? [], [x.data]), w = pe(), [Ge, Ke] = xe(Ve), qe = u(() => S.find((e) => e.status === "PRODUCING")?.id ?? S[0]?.id ?? "", [S]), T = Ge || qe, E = oe(T || void 0), Je = fe({ pagination: y }), D = de({
|
|
128
|
+
assetId: T || void 0,
|
|
129
|
+
pagination: y
|
|
130
|
+
}), Ye = ce(T || void 0, void 0, void 0, y), O = ue({
|
|
131
|
+
commodity: E.data?.commodity,
|
|
132
|
+
pagination: y
|
|
133
|
+
}), k = u(() => {
|
|
134
|
+
let e = [...O.data?.items ?? []].sort(b((e) => e.createdAt));
|
|
125
135
|
return (e.find((e) => e.deliveredVolume > 0 && e.side === "SELL") ?? e.find((e) => e.deliveredVolume > 0) ?? e.find((e) => e.side === "SELL") ?? e[0])?.id;
|
|
126
|
-
}, [
|
|
127
|
-
!!
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
!!
|
|
131
|
-
!!
|
|
132
|
-
|
|
133
|
-
],
|
|
136
|
+
}, [O.data]), Xe = le(k), A = u(() => [...E.data?.productionRecords ?? []].sort(b((e) => e.periodEnd)), [E.data]), j = A[0], M = u(() => (Je.data?.items ?? []).filter((e) => e.assetId === T).sort(b((e) => e.producedAt)), [Je.data, T]), N = M[0], P = u(() => Xe.data?.shipments ?? [], [Xe.data]), F = u(() => [...P].filter((e) => e.status === "DELIVERED").sort(b((e) => e.deliveredAt))[0], [P]), I = u(() => F ?? [...P].sort(b((e) => e.departedAt ?? e.scheduledAt))[0], [F, P]), L = u(() => O.data?.items.find((e) => e.id === k), [O.data, k]), R = u(() => Ye.data?.items ?? [], [Ye.data]), z = u(() => R.find((e) => e.category === "CHAIN_OF_CUSTODY") ?? R.find((e) => e.status === "APPROVED") ?? R[0], [R]), B = z?.status === "APPROVED", V = u(() => D.data?.items ?? [], [D.data]), H = V.reduce((e, t) => e + (t.co2eTonnes ?? 0), 0), U = V.filter((e) => e.verified).length, W = E.data, G = [
|
|
137
|
+
!!W,
|
|
138
|
+
A.length > 0,
|
|
139
|
+
M.length > 0,
|
|
140
|
+
!!I,
|
|
141
|
+
!!F,
|
|
142
|
+
B
|
|
143
|
+
], K = G.filter(Boolean).length, Ze = G.findIndex((e) => !e), Qe = Ze === -1 ? G.length : Ze, q = B && !!F, J = (e) => G[e] ? "done" : e === Qe ? "active" : "todo", $e = [
|
|
134
144
|
{
|
|
135
145
|
label: "Asset",
|
|
136
146
|
description: "Origin"
|
|
@@ -155,69 +165,69 @@ function E() {
|
|
|
155
165
|
label: "Certificate",
|
|
156
166
|
description: "Verified"
|
|
157
167
|
}
|
|
158
|
-
],
|
|
168
|
+
], Y = I && (I.origin || I.destination) ? [I.origin, I.destination].filter(Boolean).join(" → ") : void 0, et = W ? [
|
|
159
169
|
{
|
|
160
170
|
step: 1,
|
|
161
|
-
icon: /* @__PURE__ */
|
|
171
|
+
icon: /* @__PURE__ */ g(p, {}),
|
|
162
172
|
label: "Asset",
|
|
163
|
-
primary:
|
|
164
|
-
secondary:
|
|
165
|
-
badge: /* @__PURE__ */
|
|
166
|
-
state:
|
|
173
|
+
primary: W.name,
|
|
174
|
+
secondary: W.location ?? r(W.latitude, W.longitude),
|
|
175
|
+
badge: /* @__PURE__ */ g(c, { status: W.status }),
|
|
176
|
+
state: J(0),
|
|
167
177
|
present: !0
|
|
168
178
|
},
|
|
169
179
|
{
|
|
170
180
|
step: 2,
|
|
171
|
-
icon: /* @__PURE__ */
|
|
181
|
+
icon: /* @__PURE__ */ g(f, {}),
|
|
172
182
|
label: "Production",
|
|
173
|
-
primary:
|
|
174
|
-
secondary:
|
|
175
|
-
state:
|
|
176
|
-
present: !!
|
|
183
|
+
primary: j ? s(j.volume, j.unit) : "Not yet recorded",
|
|
184
|
+
secondary: j ? `${i(j.periodStart)} – ${i(j.periodEnd)}` : void 0,
|
|
185
|
+
state: J(1),
|
|
186
|
+
present: !!j
|
|
177
187
|
},
|
|
178
188
|
{
|
|
179
189
|
step: 3,
|
|
180
|
-
icon: /* @__PURE__ */
|
|
190
|
+
icon: /* @__PURE__ */ g(d, {}),
|
|
181
191
|
label: "Inventory lot",
|
|
182
|
-
primary:
|
|
183
|
-
secondary:
|
|
184
|
-
badge:
|
|
185
|
-
state:
|
|
186
|
-
present: !!
|
|
192
|
+
primary: N ? N.lotCode : "No lot yet",
|
|
193
|
+
secondary: N ? s(N.quantity, N.unit) : void 0,
|
|
194
|
+
badge: N ? /* @__PURE__ */ g(c, { status: N.status }) : void 0,
|
|
195
|
+
state: J(2),
|
|
196
|
+
present: !!N
|
|
187
197
|
},
|
|
188
198
|
{
|
|
189
199
|
step: 4,
|
|
190
|
-
icon: /* @__PURE__ */
|
|
200
|
+
icon: /* @__PURE__ */ g(h, {}),
|
|
191
201
|
label: "Shipment",
|
|
192
|
-
primary:
|
|
193
|
-
secondary:
|
|
194
|
-
badge:
|
|
195
|
-
fileId:
|
|
196
|
-
state:
|
|
197
|
-
present: !!
|
|
202
|
+
primary: I ? I.reference : "Not shipped",
|
|
203
|
+
secondary: I ? [a(I.mode), Y].filter(Boolean).join(" · ") : void 0,
|
|
204
|
+
badge: I ? /* @__PURE__ */ g(c, { status: I.status }) : void 0,
|
|
205
|
+
fileId: I?.document?.id,
|
|
206
|
+
state: J(3),
|
|
207
|
+
present: !!I
|
|
198
208
|
},
|
|
199
209
|
{
|
|
200
210
|
step: 5,
|
|
201
|
-
icon: /* @__PURE__ */
|
|
211
|
+
icon: /* @__PURE__ */ g(Se, {}),
|
|
202
212
|
label: "Delivered",
|
|
203
|
-
primary:
|
|
204
|
-
secondary:
|
|
205
|
-
state:
|
|
206
|
-
present: !!
|
|
213
|
+
primary: F ? s(F.volume, F.unit) : "Awaiting delivery",
|
|
214
|
+
secondary: F && [F.deliveredAt ? i(F.deliveredAt) : null, L ? `Contract ${L.reference}` : null].filter(Boolean).join(" · ") || void 0,
|
|
215
|
+
state: J(4),
|
|
216
|
+
present: !!F
|
|
207
217
|
},
|
|
208
218
|
{
|
|
209
219
|
step: 6,
|
|
210
|
-
icon: /* @__PURE__ */
|
|
220
|
+
icon: /* @__PURE__ */ g(m, {}),
|
|
211
221
|
label: "Certificate",
|
|
212
|
-
primary:
|
|
213
|
-
secondary:
|
|
214
|
-
badge:
|
|
215
|
-
fileId:
|
|
216
|
-
state:
|
|
217
|
-
present: !!
|
|
222
|
+
primary: z ? z.certNumber ?? z.title : "No certificate",
|
|
223
|
+
secondary: z ? a(z.category) : void 0,
|
|
224
|
+
badge: z ? /* @__PURE__ */ g(c, { status: z.status }) : void 0,
|
|
225
|
+
fileId: z?.evidence?.id,
|
|
226
|
+
state: J(5),
|
|
227
|
+
present: !!z
|
|
218
228
|
}
|
|
219
|
-
] : [],
|
|
220
|
-
if (!
|
|
229
|
+
] : [], tt = u(() => {
|
|
230
|
+
if (!W) return [];
|
|
221
231
|
let e = [], t = (t, n) => {
|
|
222
232
|
if (!t) return;
|
|
223
233
|
let r = new Date(t).getTime();
|
|
@@ -226,106 +236,217 @@ function E() {
|
|
|
226
236
|
item: n
|
|
227
237
|
});
|
|
228
238
|
};
|
|
229
|
-
return t(
|
|
239
|
+
return t(W.commissionedAt ?? W.createdAt, {
|
|
230
240
|
title: "Asset registered",
|
|
231
|
-
meta:
|
|
241
|
+
meta: W.name,
|
|
232
242
|
tone: "accent",
|
|
233
|
-
icon: /* @__PURE__ */
|
|
234
|
-
}),
|
|
243
|
+
icon: /* @__PURE__ */ g(p, { className: "h-3 w-3" })
|
|
244
|
+
}), j && t(j.periodEnd ?? j.createdAt, {
|
|
235
245
|
title: "Production recorded",
|
|
236
|
-
meta: s(
|
|
246
|
+
meta: s(j.volume, j.unit),
|
|
237
247
|
tone: "info",
|
|
238
|
-
icon: /* @__PURE__ */
|
|
239
|
-
}),
|
|
248
|
+
icon: /* @__PURE__ */ g(f, { className: "h-3 w-3" })
|
|
249
|
+
}), N && t(N.producedAt ?? N.createdAt, {
|
|
240
250
|
title: "Inventory lot created",
|
|
241
|
-
meta: `${
|
|
251
|
+
meta: `${N.lotCode} · ${s(N.quantity, N.unit)}`,
|
|
242
252
|
tone: "info",
|
|
243
|
-
icon: /* @__PURE__ */
|
|
244
|
-
}),
|
|
245
|
-
title:
|
|
246
|
-
meta: [
|
|
253
|
+
icon: /* @__PURE__ */ g(d, { className: "h-3 w-3" })
|
|
254
|
+
}), I && t(I.departedAt ?? I.scheduledAt ?? I.createdAt, {
|
|
255
|
+
title: I.departedAt ? "Shipment departed" : "Shipment scheduled",
|
|
256
|
+
meta: [I.reference, Y].filter(Boolean).join(" · "),
|
|
247
257
|
tone: "accent",
|
|
248
|
-
icon: /* @__PURE__ */
|
|
249
|
-
}),
|
|
258
|
+
icon: /* @__PURE__ */ g(h, { className: "h-3 w-3" })
|
|
259
|
+
}), F?.deliveredAt && t(F.deliveredAt, {
|
|
250
260
|
title: "Delivered",
|
|
251
|
-
meta: s(
|
|
261
|
+
meta: s(F.volume, F.unit),
|
|
252
262
|
tone: "success",
|
|
253
|
-
icon: /* @__PURE__ */
|
|
254
|
-
}),
|
|
255
|
-
title:
|
|
256
|
-
meta:
|
|
257
|
-
tone:
|
|
258
|
-
icon: /* @__PURE__ */
|
|
263
|
+
icon: /* @__PURE__ */ g(Se, { className: "h-3 w-3" })
|
|
264
|
+
}), z && t(z.issuedAt ?? z.createdAt, {
|
|
265
|
+
title: B ? "Certificate approved" : "Certificate registered",
|
|
266
|
+
meta: z.certNumber ?? z.title,
|
|
267
|
+
tone: B ? "success" : "warning",
|
|
268
|
+
icon: /* @__PURE__ */ g(m, { className: "h-3 w-3" })
|
|
259
269
|
}), e.sort((e, t) => new Date(e.date).getTime() - new Date(t.date).getTime()).map(({ date: e, item: t }) => ({
|
|
260
270
|
...t,
|
|
261
271
|
time: i(e)
|
|
262
272
|
}));
|
|
263
273
|
}, [
|
|
264
|
-
|
|
274
|
+
W,
|
|
275
|
+
j,
|
|
276
|
+
N,
|
|
265
277
|
I,
|
|
266
|
-
|
|
267
|
-
|
|
278
|
+
F,
|
|
279
|
+
z,
|
|
268
280
|
B,
|
|
281
|
+
Y
|
|
282
|
+
]), X = u(() => W ? {
|
|
283
|
+
asset: {
|
|
284
|
+
id: W.id,
|
|
285
|
+
name: W.name,
|
|
286
|
+
code: W.code ?? null,
|
|
287
|
+
commodity: W.commodity,
|
|
288
|
+
kind: W.kind,
|
|
289
|
+
status: W.status,
|
|
290
|
+
location: W.location ?? null,
|
|
291
|
+
latitude: W.latitude ?? null,
|
|
292
|
+
longitude: W.longitude ?? null,
|
|
293
|
+
commissionedAt: W.commissionedAt ?? null,
|
|
294
|
+
createdAt: W.createdAt
|
|
295
|
+
},
|
|
296
|
+
production: j ? {
|
|
297
|
+
id: j.id,
|
|
298
|
+
periodStart: j.periodStart,
|
|
299
|
+
periodEnd: j.periodEnd,
|
|
300
|
+
volume: j.volume,
|
|
301
|
+
unit: j.unit,
|
|
302
|
+
source: j.source ?? null,
|
|
303
|
+
createdAt: j.createdAt
|
|
304
|
+
} : null,
|
|
305
|
+
lot: N ? {
|
|
306
|
+
id: N.id,
|
|
307
|
+
lotCode: N.lotCode,
|
|
308
|
+
quantity: N.quantity,
|
|
309
|
+
unit: N.unit,
|
|
310
|
+
status: N.status,
|
|
311
|
+
location: N.location ?? null,
|
|
312
|
+
producedAt: N.producedAt ?? null,
|
|
313
|
+
createdAt: N.createdAt
|
|
314
|
+
} : null,
|
|
315
|
+
shipment: I ? {
|
|
316
|
+
id: I.id,
|
|
317
|
+
reference: I.reference,
|
|
318
|
+
status: I.status,
|
|
319
|
+
mode: I.mode,
|
|
320
|
+
volume: I.volume,
|
|
321
|
+
unit: I.unit,
|
|
322
|
+
carrier: I.carrier ?? null,
|
|
323
|
+
trackingId: I.trackingId ?? null,
|
|
324
|
+
origin: I.origin ?? null,
|
|
325
|
+
destination: I.destination ?? null,
|
|
326
|
+
scheduledAt: I.scheduledAt ?? null,
|
|
327
|
+
departedAt: I.departedAt ?? null,
|
|
328
|
+
deliveredAt: I.deliveredAt ?? null,
|
|
329
|
+
createdAt: I.createdAt
|
|
330
|
+
} : null,
|
|
331
|
+
contract: L ? {
|
|
332
|
+
id: L.id,
|
|
333
|
+
reference: L.reference,
|
|
334
|
+
counterparty: L.counterparty,
|
|
335
|
+
side: L.side,
|
|
336
|
+
status: L.status
|
|
337
|
+
} : null,
|
|
338
|
+
certificate: z ? {
|
|
339
|
+
id: z.id,
|
|
340
|
+
title: z.title,
|
|
341
|
+
category: z.category,
|
|
342
|
+
status: z.status,
|
|
343
|
+
certNumber: z.certNumber ?? null,
|
|
344
|
+
authority: z.authority ?? null,
|
|
345
|
+
issuedAt: z.issuedAt ?? null,
|
|
346
|
+
expiresAt: z.expiresAt ?? null,
|
|
347
|
+
createdAt: z.createdAt
|
|
348
|
+
} : null,
|
|
349
|
+
emissions: {
|
|
350
|
+
totalCo2eTonnes: H,
|
|
351
|
+
recordCount: V.length,
|
|
352
|
+
verifiedCount: U
|
|
353
|
+
}
|
|
354
|
+
} : null, [
|
|
355
|
+
W,
|
|
356
|
+
j,
|
|
357
|
+
N,
|
|
358
|
+
I,
|
|
359
|
+
L,
|
|
360
|
+
z,
|
|
361
|
+
H,
|
|
362
|
+
V.length,
|
|
363
|
+
U
|
|
364
|
+
]), Z = u(() => X && W ? ge(W.workspaceId, X, K, Be, q) : null, [
|
|
365
|
+
X,
|
|
269
366
|
W,
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
]),
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
367
|
+
K,
|
|
368
|
+
q
|
|
369
|
+
]), nt = () => {
|
|
370
|
+
!Z || !W || (_e(`${ye(W.name)}-chain-of-custody.json`, "application/json", JSON.stringify(Z, null, 2)) ? w.success("Chain of custody exported") : w.error("This browser can't download the export."));
|
|
371
|
+
}, rt = () => {
|
|
372
|
+
if (!T) return;
|
|
373
|
+
let e = He(T), t = typeof navigator < "u" ? navigator.clipboard : void 0;
|
|
374
|
+
if (!t) {
|
|
375
|
+
w.error("This browser doesn't allow copying to the clipboard.");
|
|
376
|
+
return;
|
|
377
|
+
}
|
|
378
|
+
t.writeText(e).then(() => w.success("Provenance link copied"), () => w.error("Couldn't copy the provenance link."));
|
|
379
|
+
}, it = W && typeof W.latitude == "number" && typeof W.longitude == "number" ? {
|
|
380
|
+
lat: W.latitude,
|
|
381
|
+
lng: W.longitude,
|
|
382
|
+
label: W.name,
|
|
276
383
|
primary: !0
|
|
277
|
-
} : null, Q =
|
|
278
|
-
return
|
|
384
|
+
} : null, Q = l("theglobalfuel.pages.provenance.description", "Pit to port to certificate — end-to-end traceability from origin to verified certificate."), $ = l("theglobalfuel.pages.provenance.title", "Provenance");
|
|
385
|
+
return x.isLoading && S.length === 0 ? /* @__PURE__ */ g(n, {
|
|
279
386
|
title: $,
|
|
280
387
|
description: Q,
|
|
281
388
|
dataTour: "theglobalfuel-provenance-page",
|
|
282
|
-
children: /* @__PURE__ */
|
|
283
|
-
}) :
|
|
389
|
+
children: /* @__PURE__ */ g(ne, { label: "Loading assets…" })
|
|
390
|
+
}) : x.isError ? /* @__PURE__ */ g(n, {
|
|
284
391
|
title: $,
|
|
285
392
|
description: Q,
|
|
286
393
|
dataTour: "theglobalfuel-provenance-page",
|
|
287
|
-
children: /* @__PURE__ */
|
|
394
|
+
children: /* @__PURE__ */ g(te, {
|
|
288
395
|
message: "Couldn't load assets to trace.",
|
|
289
|
-
onRetry: () =>
|
|
396
|
+
onRetry: () => x.refetch()
|
|
290
397
|
})
|
|
291
|
-
}) :
|
|
398
|
+
}) : S.length === 0 ? /* @__PURE__ */ g(n, {
|
|
292
399
|
title: $,
|
|
293
400
|
description: Q,
|
|
294
401
|
dataTour: "theglobalfuel-provenance-page",
|
|
295
|
-
children: /* @__PURE__ */
|
|
402
|
+
children: /* @__PURE__ */ g(re, {
|
|
296
403
|
illustration: "empty-data",
|
|
297
|
-
icon: /* @__PURE__ */
|
|
404
|
+
icon: /* @__PURE__ */ g(Oe, { className: "h-10 w-10" }),
|
|
298
405
|
title: "No assets to trace",
|
|
299
406
|
description: "Register a resource asset to build its end-to-end chain of custody.",
|
|
300
|
-
action: /* @__PURE__ */
|
|
407
|
+
action: /* @__PURE__ */ g("button", {
|
|
301
408
|
type: "button",
|
|
302
|
-
onClick: () =>
|
|
409
|
+
onClick: () => Ue("assets"),
|
|
303
410
|
className: "rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:opacity-90",
|
|
304
411
|
children: "Go to assets"
|
|
305
412
|
})
|
|
306
413
|
})
|
|
307
|
-
}) : /* @__PURE__ */
|
|
414
|
+
}) : /* @__PURE__ */ _(n, {
|
|
308
415
|
title: $,
|
|
309
416
|
description: Q,
|
|
310
417
|
dataTour: "theglobalfuel-provenance-page",
|
|
311
|
-
children: [/* @__PURE__ */
|
|
418
|
+
actions: /* @__PURE__ */ _(Ne, { children: [/* @__PURE__ */ _(Pe, {
|
|
419
|
+
variant: "outline",
|
|
420
|
+
size: "sm",
|
|
421
|
+
onClick: rt,
|
|
422
|
+
disabled: !T,
|
|
423
|
+
"data-tour": "theglobalfuel-provenance-share",
|
|
424
|
+
children: [/* @__PURE__ */ g(je, { className: "mr-2 h-4 w-4" }), "Share"]
|
|
425
|
+
}), /* @__PURE__ */ _(Pe, {
|
|
426
|
+
size: "sm",
|
|
427
|
+
onClick: nt,
|
|
428
|
+
disabled: !Z,
|
|
429
|
+
"data-tour": "theglobalfuel-provenance-export",
|
|
430
|
+
children: [/* @__PURE__ */ g(Ce, { className: "mr-2 h-4 w-4" }), "Export"]
|
|
431
|
+
})] }),
|
|
432
|
+
children: [/* @__PURE__ */ _(v, {
|
|
312
433
|
treatment: "glass",
|
|
313
434
|
className: "flex flex-col gap-4 p-5 sm:flex-row sm:items-center sm:justify-between",
|
|
314
|
-
children: [/* @__PURE__ */
|
|
435
|
+
children: [/* @__PURE__ */ _("div", {
|
|
315
436
|
className: "flex min-w-0 flex-1 flex-col gap-1.5",
|
|
316
|
-
children: [/* @__PURE__ */
|
|
437
|
+
children: [/* @__PURE__ */ g("label", {
|
|
317
438
|
htmlFor: "provenance-asset",
|
|
318
439
|
className: "text-xs font-medium uppercase tracking-wide text-text-tertiary",
|
|
319
440
|
children: "Trace asset"
|
|
320
|
-
}), /* @__PURE__ */
|
|
321
|
-
value:
|
|
322
|
-
onValueChange:
|
|
323
|
-
children: [/* @__PURE__ */
|
|
441
|
+
}), /* @__PURE__ */ _(Fe, {
|
|
442
|
+
value: T,
|
|
443
|
+
onValueChange: Ke,
|
|
444
|
+
children: [/* @__PURE__ */ g(Re, {
|
|
324
445
|
id: "provenance-asset",
|
|
325
446
|
className: "h-10 w-full sm:w-96",
|
|
326
447
|
"aria-label": "Select an asset to trace",
|
|
327
|
-
children: /* @__PURE__ */
|
|
328
|
-
}), /* @__PURE__ */
|
|
448
|
+
children: /* @__PURE__ */ g(ze, { placeholder: "Select an asset to trace" })
|
|
449
|
+
}), /* @__PURE__ */ g(Ie, { children: S.map((e) => /* @__PURE__ */ _(Le, {
|
|
329
450
|
value: e.id,
|
|
330
451
|
children: [
|
|
331
452
|
e.name,
|
|
@@ -334,132 +455,167 @@ function E() {
|
|
|
334
455
|
]
|
|
335
456
|
}, e.id)) })]
|
|
336
457
|
})]
|
|
337
|
-
}), /* @__PURE__ */
|
|
338
|
-
className: t("flex items-center gap-2 self-start rounded-full px-3.5 py-1.5 text-sm font-medium",
|
|
339
|
-
children: [
|
|
458
|
+
}), /* @__PURE__ */ _("div", {
|
|
459
|
+
className: t("flex items-center gap-2 self-start rounded-full px-3.5 py-1.5 text-sm font-medium", q ? "bg-status-success-bg-subtle text-status-success-text" : "bg-bg-sunken text-text-secondary"),
|
|
460
|
+
children: [g(q ? m : Me, { className: "h-4 w-4" }), q ? "Chain of custody verified" : `Traceability in progress · ${K}/6`]
|
|
340
461
|
})]
|
|
341
|
-
}),
|
|
462
|
+
}), E.isLoading ? /* @__PURE__ */ g("div", {
|
|
342
463
|
className: "mt-6",
|
|
343
|
-
children: /* @__PURE__ */
|
|
344
|
-
}) :
|
|
464
|
+
children: /* @__PURE__ */ g(ne, { label: "Assembling chain of custody…" })
|
|
465
|
+
}) : E.isError || !W ? /* @__PURE__ */ g("div", {
|
|
345
466
|
className: "mt-6",
|
|
346
|
-
children: /* @__PURE__ */
|
|
467
|
+
children: /* @__PURE__ */ g(te, {
|
|
347
468
|
message: "Couldn't load this asset's provenance.",
|
|
348
|
-
onRetry: () =>
|
|
469
|
+
onRetry: () => E.refetch()
|
|
349
470
|
})
|
|
350
|
-
}) : /* @__PURE__ */
|
|
351
|
-
/* @__PURE__ */
|
|
471
|
+
}) : /* @__PURE__ */ _(Ne, { children: [
|
|
472
|
+
/* @__PURE__ */ _("div", {
|
|
473
|
+
className: t("mt-6 flex flex-col gap-2 rounded-xl border p-4 sm:flex-row sm:items-center sm:gap-3", q ? "border-status-success-border bg-status-success-bg-subtle" : "border-border-seam bg-bg-sunken"),
|
|
474
|
+
role: "status",
|
|
475
|
+
children: [/* @__PURE__ */ g("span", {
|
|
476
|
+
className: t("flex size-9 shrink-0 items-center justify-center rounded-lg", q ? "bg-status-success-bg-subtle text-status-success-text" : "bg-bg-surface text-text-secondary"),
|
|
477
|
+
children: g(q ? m : Me, { className: "h-5 w-5" })
|
|
478
|
+
}), /* @__PURE__ */ _("div", {
|
|
479
|
+
className: "min-w-0",
|
|
480
|
+
children: [/* @__PURE__ */ g("p", {
|
|
481
|
+
className: t("text-sm font-semibold", q ? "text-status-success-text" : "text-text-primary"),
|
|
482
|
+
children: q ? "Verified chain of custody" : `Chain of custody incomplete · ${K} of ${Be} stages`
|
|
483
|
+
}), /* @__PURE__ */ g("p", {
|
|
484
|
+
className: "text-xs text-text-secondary",
|
|
485
|
+
children: q ? "Every stage from origin to delivery is backed by a linked record, and the chain-of-custody certificate is approved." : "Stages without a linked record are shown as pending below. A chain is only marked verified once it is delivered and its custody certificate is approved."
|
|
486
|
+
})]
|
|
487
|
+
})]
|
|
488
|
+
}),
|
|
489
|
+
/* @__PURE__ */ g(v, {
|
|
352
490
|
treatment: "glass",
|
|
353
491
|
className: "mt-6 p-5",
|
|
354
|
-
children: /* @__PURE__ */
|
|
355
|
-
steps:
|
|
356
|
-
current:
|
|
492
|
+
children: /* @__PURE__ */ g(ae, {
|
|
493
|
+
steps: $e,
|
|
494
|
+
current: Qe
|
|
357
495
|
})
|
|
358
496
|
}),
|
|
359
|
-
/* @__PURE__ */
|
|
497
|
+
/* @__PURE__ */ g("div", {
|
|
360
498
|
className: "mt-6 grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-6",
|
|
361
|
-
children:
|
|
499
|
+
children: et.map((e) => /* @__PURE__ */ g(We, { node: e }, e.step))
|
|
362
500
|
}),
|
|
363
|
-
/* @__PURE__ */
|
|
501
|
+
/* @__PURE__ */ _("div", {
|
|
364
502
|
className: "mt-6 grid grid-cols-1 gap-6 lg:grid-cols-3",
|
|
365
|
-
children: [/* @__PURE__ */
|
|
503
|
+
children: [/* @__PURE__ */ _(v, {
|
|
366
504
|
treatment: "glass",
|
|
367
505
|
className: "p-5 lg:col-span-2",
|
|
368
|
-
children: [/* @__PURE__ */
|
|
506
|
+
children: [/* @__PURE__ */ _("div", {
|
|
369
507
|
className: "mb-4 flex items-center gap-2.5",
|
|
370
|
-
children: [/* @__PURE__ */
|
|
371
|
-
className: "flex size-8 items-center justify-center rounded-lg bg-[var(--color-accent-soft)] text-
|
|
372
|
-
children: /* @__PURE__ */
|
|
373
|
-
}), /* @__PURE__ */
|
|
508
|
+
children: [/* @__PURE__ */ g("span", {
|
|
509
|
+
className: "flex size-8 items-center justify-center rounded-lg bg-[var(--color-accent-soft)] text-action-primary-bg",
|
|
510
|
+
children: /* @__PURE__ */ g(Ae, { className: "h-4 w-4" })
|
|
511
|
+
}), /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("h2", {
|
|
374
512
|
className: "text-base font-semibold text-text-primary",
|
|
375
513
|
children: "Traceability timeline"
|
|
376
|
-
}), /* @__PURE__ */
|
|
514
|
+
}), /* @__PURE__ */ g("p", {
|
|
377
515
|
className: "text-xs text-text-tertiary",
|
|
378
516
|
children: "Recorded custody events, oldest to newest."
|
|
379
517
|
})] })]
|
|
380
|
-
}),
|
|
518
|
+
}), tt.length > 0 ? /* @__PURE__ */ g(ie, { items: tt }) : /* @__PURE__ */ g("div", {
|
|
381
519
|
className: "rounded-xl border border-dashed border-border-seam py-8 text-center text-sm text-text-secondary",
|
|
382
520
|
children: "No dated custody events yet."
|
|
383
521
|
})]
|
|
384
|
-
}), /* @__PURE__ */
|
|
522
|
+
}), /* @__PURE__ */ _(v, {
|
|
385
523
|
treatment: "glass",
|
|
386
524
|
className: "flex flex-col gap-4 p-5",
|
|
387
|
-
children: [/* @__PURE__ */
|
|
525
|
+
children: [/* @__PURE__ */ _("div", {
|
|
388
526
|
className: "flex items-center gap-2.5",
|
|
389
|
-
children: [/* @__PURE__ */
|
|
390
|
-
className: "flex size-8 items-center justify-center rounded-lg bg-[var(--color-accent-soft)] text-
|
|
391
|
-
children: /* @__PURE__ */
|
|
392
|
-
}), /* @__PURE__ */
|
|
527
|
+
children: [/* @__PURE__ */ g("span", {
|
|
528
|
+
className: "flex size-8 items-center justify-center rounded-lg bg-[var(--color-accent-soft)] text-action-primary-bg",
|
|
529
|
+
children: /* @__PURE__ */ g(p, { className: "h-4 w-4" })
|
|
530
|
+
}), /* @__PURE__ */ _("div", {
|
|
393
531
|
className: "min-w-0",
|
|
394
|
-
children: [/* @__PURE__ */
|
|
532
|
+
children: [/* @__PURE__ */ g("h2", {
|
|
395
533
|
className: "text-base font-semibold text-text-primary",
|
|
396
534
|
children: "Origin"
|
|
397
|
-
}), /* @__PURE__ */
|
|
535
|
+
}), /* @__PURE__ */ g("p", {
|
|
398
536
|
className: "truncate text-xs text-text-tertiary",
|
|
399
|
-
children:
|
|
537
|
+
children: W.location ?? a(W.kind)
|
|
400
538
|
})]
|
|
401
539
|
})]
|
|
402
|
-
}),
|
|
540
|
+
}), it ? /* @__PURE__ */ g(be, { points: [it] }) : /* @__PURE__ */ g("div", {
|
|
403
541
|
className: "rounded-xl border border-dashed border-border-seam py-8 text-center text-sm text-text-secondary",
|
|
404
542
|
children: "No coordinates recorded for this asset."
|
|
405
543
|
})]
|
|
406
544
|
})]
|
|
407
545
|
}),
|
|
408
|
-
/* @__PURE__ */
|
|
546
|
+
/* @__PURE__ */ _(v, {
|
|
409
547
|
treatment: "glass",
|
|
410
548
|
className: "mt-6 p-5",
|
|
411
|
-
children: [/* @__PURE__ */
|
|
549
|
+
children: [/* @__PURE__ */ g("h2", {
|
|
412
550
|
className: "mb-4 text-base font-semibold text-text-primary",
|
|
413
551
|
children: "Provenance summary"
|
|
414
|
-
}), /* @__PURE__ */
|
|
552
|
+
}), /* @__PURE__ */ _("div", {
|
|
415
553
|
className: "grid grid-cols-1 gap-5 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-6",
|
|
416
554
|
children: [
|
|
417
|
-
/* @__PURE__ */
|
|
418
|
-
icon: /* @__PURE__ */
|
|
555
|
+
/* @__PURE__ */ g(C, {
|
|
556
|
+
icon: /* @__PURE__ */ g(Ee, {}),
|
|
419
557
|
label: "Commodity",
|
|
420
|
-
value: a(
|
|
421
|
-
caption: a(
|
|
558
|
+
value: a(W.commodity),
|
|
559
|
+
caption: a(W.kind)
|
|
422
560
|
}),
|
|
423
|
-
/* @__PURE__ */
|
|
424
|
-
icon: /* @__PURE__ */
|
|
561
|
+
/* @__PURE__ */ g(C, {
|
|
562
|
+
icon: /* @__PURE__ */ g(p, {}),
|
|
425
563
|
label: "Origin",
|
|
426
|
-
value:
|
|
427
|
-
caption: r(
|
|
564
|
+
value: W.location ?? W.name,
|
|
565
|
+
caption: r(W.latitude, W.longitude)
|
|
428
566
|
}),
|
|
429
|
-
/* @__PURE__ */
|
|
430
|
-
icon: /* @__PURE__ */
|
|
567
|
+
/* @__PURE__ */ g(C, {
|
|
568
|
+
icon: /* @__PURE__ */ g(f, {}),
|
|
431
569
|
label: "Production",
|
|
432
|
-
value: `${o(
|
|
433
|
-
caption:
|
|
570
|
+
value: `${o(A.length)} records`,
|
|
571
|
+
caption: j ? `Latest ${s(j.volume, j.unit)}` : "None yet"
|
|
434
572
|
}),
|
|
435
|
-
/* @__PURE__ */
|
|
436
|
-
icon: /* @__PURE__ */
|
|
573
|
+
/* @__PURE__ */ g(C, {
|
|
574
|
+
icon: /* @__PURE__ */ g(d, {}),
|
|
437
575
|
label: "Inventory",
|
|
438
|
-
value: `${o(
|
|
439
|
-
caption:
|
|
576
|
+
value: `${o(M.length)} lots`,
|
|
577
|
+
caption: N ? N.lotCode : "None yet"
|
|
440
578
|
}),
|
|
441
|
-
/* @__PURE__ */
|
|
442
|
-
icon: /* @__PURE__ */
|
|
579
|
+
/* @__PURE__ */ g(C, {
|
|
580
|
+
icon: /* @__PURE__ */ g(we, {}),
|
|
443
581
|
label: "Emissions",
|
|
444
|
-
value:
|
|
445
|
-
caption: `${
|
|
582
|
+
value: D.isError ? "—" : ee(H),
|
|
583
|
+
caption: `${U} verified`
|
|
446
584
|
}),
|
|
447
|
-
/* @__PURE__ */
|
|
448
|
-
icon: /* @__PURE__ */
|
|
585
|
+
/* @__PURE__ */ g(C, {
|
|
586
|
+
icon: /* @__PURE__ */ g(m, {}),
|
|
449
587
|
label: "Certificates",
|
|
450
|
-
value: `${o(
|
|
451
|
-
caption:
|
|
588
|
+
value: `${o(R.length)} tracked`,
|
|
589
|
+
caption: B ? "Custody approved" : z ? "Under review" : "None yet"
|
|
590
|
+
}),
|
|
591
|
+
/* @__PURE__ */ g(C, {
|
|
592
|
+
icon: /* @__PURE__ */ g(h, {}),
|
|
593
|
+
label: "Tracking ID",
|
|
594
|
+
value: I?.trackingId ?? "Not issued",
|
|
595
|
+
caption: I ? [I.reference, I.carrier].filter(Boolean).join(" · ") : "No shipment yet"
|
|
596
|
+
}),
|
|
597
|
+
/* @__PURE__ */ g(C, {
|
|
598
|
+
icon: /* @__PURE__ */ g(Te, {}),
|
|
599
|
+
label: "Data integrity",
|
|
600
|
+
value: Z ? ve(Z.integrityDigest) : "Unavailable",
|
|
601
|
+
caption: "Checksum over the linked records — re-export to compare"
|
|
602
|
+
}),
|
|
603
|
+
/* @__PURE__ */ g(C, {
|
|
604
|
+
icon: /* @__PURE__ */ g(ke, {}),
|
|
605
|
+
label: "Record network",
|
|
606
|
+
value: "Federated workspace records",
|
|
607
|
+
caption: "Registry · Commerce · Sustainability subgraphs"
|
|
452
608
|
})
|
|
453
609
|
]
|
|
454
610
|
})]
|
|
455
611
|
}),
|
|
456
|
-
(
|
|
612
|
+
(W.reserveEstimates?.length ?? 0) > 0 && /* @__PURE__ */ _("p", {
|
|
457
613
|
className: "mt-4 flex items-center gap-1.5 text-xs text-text-tertiary",
|
|
458
614
|
children: [
|
|
459
|
-
/* @__PURE__ */
|
|
460
|
-
o(
|
|
615
|
+
/* @__PURE__ */ g(De, { className: "h-3.5 w-3.5" }),
|
|
616
|
+
o(W.reserveEstimates?.length ?? 0),
|
|
461
617
|
" reserve estimate",
|
|
462
|
-
(
|
|
618
|
+
(W.reserveEstimates?.length ?? 0) === 1 ? "" : "s",
|
|
463
619
|
" on record for this asset."
|
|
464
620
|
]
|
|
465
621
|
})
|
|
@@ -467,6 +623,6 @@ function E() {
|
|
|
467
623
|
});
|
|
468
624
|
}
|
|
469
625
|
//#endregion
|
|
470
|
-
export {
|
|
626
|
+
export { w as ProvenancePage };
|
|
471
627
|
|
|
472
628
|
//# sourceMappingURL=ProvenancePage.js.map
|