@burdenoff/microfe-theglobalfuel 2026.804.2 → 2026.827.1

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.
@@ -5,41 +5,43 @@ import { formatDate as r, formatEnumLabel as i, formatMoney as ee, formatUnit as
5
5
  import { StatusBadge as c } from "../../components/StatusBadge.js";
6
6
  import { MiniBar as te } from "../../components/MiniBar.js";
7
7
  import { DataTable as ne } from "../../components/DataTable.js";
8
- import { ErrorView as re, LoadingView as ie, Section as ae } from "../../components/StateViews.js";
9
- import { EmptyState as oe } from "../../components/EmptyState.js";
8
+ import { ErrorView as l, LoadingView as u, Section as re } from "../../components/StateViews.js";
9
+ import { EmptyState as ie } from "../../components/EmptyState.js";
10
10
  import "../../context/index.js";
11
- import { useTheContract as se, useTheDeliverShipment as ce, useTheScheduleShipment as le, useTheShipments as ue, useTheTransitionContract as de, useTheUpdateContract as fe } from "../../hooks/useTheGlobalFuelApi.js";
12
- import { useCursorPager as pe } from "../../hooks/useCursorPager.js";
13
- import { useNotify as me } from "../../hooks/useNotify.js";
14
- import { useThePageView as he } from "../../hooks/useThePageView.js";
15
- import { useTheNativeControls as ge } from "../../hooks/useTheNativeControls.js";
11
+ import { useTheContract as ae, useTheDeliverShipment as oe, useTheScheduleShipment as se, useTheShipments as ce, useTheTransitionContract as le, useTheUpdateContract as ue } from "../../hooks/useTheGlobalFuelApi.js";
12
+ import { useCursorPager as de } from "../../hooks/useCursorPager.js";
13
+ import { useNotify as fe } from "../../hooks/useNotify.js";
14
+ import { useThePageView as pe } from "../../hooks/useThePageView.js";
15
+ import { useTheNativeControls as me } from "../../hooks/useTheNativeControls.js";
16
16
  import "../../hooks/index.js";
17
- import { CONTRACT_TRANSITIONS as _e, nextStatuses as ve } from "../../utils/transitions.js";
18
- import { Tabs as ye } from "../../components/Tabs.js";
19
- import { Pagination as be } from "../../components/Pagination.js";
20
- import { EvidenceUpload as xe } from "../../components/EvidenceUpload.js";
21
- import { FileLink as Se } from "../../components/FileLink.js";
22
- import { TheDiscussion as Ce } from "../../components/TheDiscussion.js";
23
- import { TheTags as we } from "../../components/TheTags.js";
24
- import { useState as l } from "react";
25
- import { ArrowLeft as Te, Building2 as Ee, Calendar as De, CheckCircle2 as Oe, Coins as ke, FileSignature as Ae, Gauge as je, MapPin as Me, MessageSquare as Ne, Package as Pe, Pencil as Fe, Plus as u, Ship as d, Tag as Ie } from "lucide-react";
26
- import { useParams as Le } from "react-router";
17
+ import { toCsv as he } from "../../utils/csv.js";
18
+ import { downloadTextFile as ge, slugify as _e } from "../../utils/provenance.js";
19
+ import { CONTRACT_TRANSITIONS as ve, nextStatuses as ye } from "../../utils/transitions.js";
20
+ import { Tabs as be } from "../../components/Tabs.js";
21
+ import { Pagination as xe } from "../../components/Pagination.js";
22
+ import { EvidenceUpload as Se } from "../../components/EvidenceUpload.js";
23
+ import { FileLink as Ce } from "../../components/FileLink.js";
24
+ import { TheDiscussion as we } from "../../components/TheDiscussion.js";
25
+ import { TheTags as Te } from "../../components/TheTags.js";
26
+ import { useState as d } from "react";
27
+ import { ArrowLeft as Ee, Building2 as De, Calendar as Oe, CheckCircle2 as ke, Coins as Ae, Download as je, FileSignature as Me, Gauge as Ne, MapPin as Pe, MessageSquare as Fe, Package as Ie, Pencil as Le, Plus as Re, Ship as ze, Tag as Be } from "lucide-react";
28
+ import { useParams as Ve } from "react-router";
27
29
  import { Fragment as f, jsx as p, jsxs as m } from "react/jsx-runtime";
28
- import { Button as h, GlassCard as g, Input as _, Label as v, ResponsiveDialog as y, ResponsiveDialogContent as b, ResponsiveDialogDescription as x, ResponsiveDialogFooter as S, ResponsiveDialogHeader as C, ResponsiveDialogTitle as w, Select as T, SelectContent as E, SelectItem as D, SelectTrigger as O, SelectValue as k, Textarea as A } from "@burdenoff/fe-libs/ui";
30
+ import { Button as h, GlassCard as He, Input as g, Label as _, ResponsiveDialog as v, ResponsiveDialogContent as y, ResponsiveDialogDescription as b, ResponsiveDialogFooter as x, ResponsiveDialogHeader as S, ResponsiveDialogTitle as C, Select as w, SelectContent as T, SelectItem as E, SelectTrigger as D, SelectValue as O, Textarea as k } from "@burdenoff/fe-libs/ui";
29
31
  //#region src/theglobalfuel/pages/contracts/ContractDetailPage.tsx
30
- var Re = [
32
+ var Ue = [
31
33
  "FIXED",
32
34
  "INDEX_LINKED",
33
35
  "FORMULA",
34
36
  "SPOT"
35
- ], ze = [
37
+ ], We = [
36
38
  "PIPELINE",
37
39
  "TANKER",
38
40
  "VESSEL_BULK",
39
41
  "RAIL",
40
42
  "TRUCK",
41
43
  "GRID"
42
- ], Be = [
44
+ ], Ge = [
43
45
  "BARRELS",
44
46
  "CUBIC_METERS",
45
47
  "TONNES",
@@ -47,14 +49,15 @@ var Re = [
47
49
  "MWH",
48
50
  "GJ",
49
51
  "MCF"
50
- ], Ve = new Set([
52
+ ], Ke = new Set([
51
53
  "SCHEDULED",
52
54
  "LOADING",
53
55
  "IN_TRANSIT"
54
- ]), j = 25, He = (e) => Math.max(0, Math.min(100, e)), Ue = (e) => e ? e.slice(0, 10) : "", M = (e) => ({
56
+ ]), A = 25, qe = (e) => Math.max(0, Math.min(100, e)), j = (e) => e ? e.slice(0, 10) : "", M = (e) => ({
55
57
  reference: "",
56
58
  mode: "VESSEL_BULK",
57
59
  carrier: "",
60
+ trackingId: "",
58
61
  origin: "",
59
62
  destination: "",
60
63
  volume: "",
@@ -63,31 +66,31 @@ var Re = [
63
66
  notes: ""
64
67
  });
65
68
  function N() {
66
- let { id: N } = Le(), { navigateTo: P } = e(), F = me();
67
- he("contract-detail");
68
- let { haptic: We } = ge(), { data: I, isLoading: Ge, isError: Ke, refetch: qe } = se(N), L = fe(), Je = de(), R = le(), Ye = ce(), z = pe(), B = ue(N, void 0, {
69
- limit: j,
70
- offset: z.page * j
71
- }), [V, Xe] = l("shipments"), [Ze, H] = l(!1), [U, W] = l(null), [Qe, G] = l(!1), [K, q] = l(M("BARRELS")), [$e, J] = l(null), [Y, X] = l(null);
72
- if (Ge) return /* @__PURE__ */ p(t, {
69
+ let { id: N } = Ve(), { navigateTo: P } = e(), F = fe();
70
+ pe("contract-detail");
71
+ let { haptic: Je } = me(), { data: I, isLoading: Ye, isError: L, refetch: Xe } = ae(N), R = ue(), Ze = le(), z = se(), B = oe(), V = de(), H = ce(N, void 0, {
72
+ limit: A,
73
+ offset: V.page * A
74
+ }), [U, Qe] = d("shipments"), [$e, W] = d(!1), [G, K] = d(null), [et, q] = d(!1), [J, Y] = d(M("BARRELS")), [tt, X] = d(null), [Z, Q] = d(null);
75
+ if (Ye) return /* @__PURE__ */ p(t, {
73
76
  title: "Contract",
74
77
  dataTour: "theglobalfuel-contract-detail-page",
75
- children: /* @__PURE__ */ p(ie, {})
78
+ children: /* @__PURE__ */ p(u, {})
76
79
  });
77
- if (Ke || !I) return /* @__PURE__ */ p(t, {
80
+ if (L || !I) return /* @__PURE__ */ p(t, {
78
81
  title: "Contract",
79
82
  dataTour: "theglobalfuel-contract-detail-page",
80
83
  actions: /* @__PURE__ */ m(h, {
81
84
  variant: "ghost",
82
85
  onClick: () => P("contracts"),
83
- children: [/* @__PURE__ */ p(Te, { className: "mr-1.5 h-4 w-4" }), " Back"]
86
+ children: [/* @__PURE__ */ p(Ee, { className: "mr-1.5 h-4 w-4" }), " Back"]
84
87
  }),
85
- children: Ke ? /* @__PURE__ */ p(re, {
88
+ children: L ? /* @__PURE__ */ p(l, {
86
89
  message: "This contract could not be loaded.",
87
- onRetry: () => qe()
88
- }) : /* @__PURE__ */ p(oe, {
90
+ onRetry: () => Xe()
91
+ }) : /* @__PURE__ */ p(ie, {
89
92
  illustration: "empty-search",
90
- icon: /* @__PURE__ */ p(Ae, { className: "h-10 w-10" }),
93
+ icon: /* @__PURE__ */ p(Me, { className: "h-10 w-10" }),
91
94
  title: "Contract not found",
92
95
  description: "This contract may have been removed or you may not have access to it.",
93
96
  action: /* @__PURE__ */ p(h, {
@@ -96,8 +99,8 @@ function N() {
96
99
  })
97
100
  })
98
101
  });
99
- let Z = B.data?.items ?? [], et = I.contractedVolume > 0 ? He(I.deliveredVolume / I.contractedVolume * 100) : 0, Q = ve(_e, I.status), tt = () => {
100
- W({
102
+ let $ = H.data?.items ?? [], nt = I.contractedVolume > 0 ? qe(I.deliveredVolume / I.contractedVolume * 100) : 0, rt = ye(ve, I.status), it = () => {
103
+ K({
101
104
  counterparty: I.counterparty,
102
105
  pricingBasis: I.pricingBasis,
103
106
  pricePerUnit: I.pricePerUnit ? String(I.pricePerUnit) : "",
@@ -106,86 +109,139 @@ function N() {
106
109
  contractedVolume: I.contractedVolume ? String(I.contractedVolume) : "",
107
110
  unit: I.unit,
108
111
  deliveryLocation: I.deliveryLocation ?? "",
109
- startDate: Ue(I.startDate),
110
- endDate: Ue(I.endDate),
112
+ startDate: j(I.startDate),
113
+ endDate: j(I.endDate),
111
114
  notes: I.notes ?? ""
112
- }), X(null), H(!0);
113
- }, $ = () => {
114
- We("light"), q(M(I.unit)), J(null), X(null), G(!0);
115
- }, nt = (e) => {
116
- e !== I.status && (X(null), Je.mutate({
115
+ }), Q(null), W(!0);
116
+ }, at = () => {
117
+ Je("light"), Y(M(I.unit)), X(null), Q(null), q(!0);
118
+ }, ot = (e) => {
119
+ e !== I.status && (Q(null), Ze.mutate({
117
120
  id: I.id,
118
121
  status: e
119
122
  }, {
120
123
  onSuccess: () => F.success("Contract status updated"),
121
124
  onError: (e) => {
122
- X(e instanceof Error ? e.message : "Failed to update contract status."), F.fromError(e);
125
+ Q(e instanceof Error ? e.message : "Failed to update contract status."), F.fromError(e);
123
126
  }
124
127
  }));
125
- }, rt = async () => {
126
- if (U) {
127
- if (!U.counterparty.trim()) {
128
- X("Counterparty is required.");
128
+ }, st = async () => {
129
+ if (G) {
130
+ if (!G.counterparty.trim()) {
131
+ Q("Counterparty is required.");
129
132
  return;
130
133
  }
131
- X(null);
134
+ Q(null);
132
135
  try {
133
- await L.mutateAsync({
136
+ await R.mutateAsync({
134
137
  id: I.id,
135
138
  input: {
136
- counterparty: U.counterparty.trim(),
137
- pricingBasis: U.pricingBasis,
138
- pricePerUnit: U.pricePerUnit ? Number(U.pricePerUnit) : null,
139
- priceIndex: U.priceIndex.trim() || null,
140
- currency: U.currency.trim().toUpperCase() || "USD",
141
- contractedVolume: U.contractedVolume ? Number(U.contractedVolume) : null,
142
- unit: U.unit,
143
- deliveryLocation: U.deliveryLocation.trim() || null,
144
- startDate: s(U.startDate) ?? null,
145
- endDate: s(U.endDate) ?? null,
146
- notes: U.notes.trim() || null
139
+ counterparty: G.counterparty.trim(),
140
+ pricingBasis: G.pricingBasis,
141
+ pricePerUnit: G.pricePerUnit ? Number(G.pricePerUnit) : null,
142
+ priceIndex: G.priceIndex.trim() || null,
143
+ currency: G.currency.trim().toUpperCase() || "USD",
144
+ contractedVolume: G.contractedVolume ? Number(G.contractedVolume) : null,
145
+ unit: G.unit,
146
+ deliveryLocation: G.deliveryLocation.trim() || null,
147
+ startDate: s(G.startDate) ?? null,
148
+ endDate: s(G.endDate) ?? null,
149
+ notes: G.notes.trim() || null
147
150
  }
148
- }), F.success("Contract updated"), H(!1);
151
+ }), F.success("Contract updated"), W(!1);
149
152
  } catch (e) {
150
- X(e instanceof Error ? e.message : "Failed to update contract."), F.fromError(e);
153
+ Q(e instanceof Error ? e.message : "Failed to update contract."), F.fromError(e);
151
154
  }
152
155
  }
153
- }, it = async () => {
154
- if (!K.reference.trim()) {
155
- X("Shipment reference is required.");
156
+ }, ct = async () => {
157
+ if (!J.reference.trim()) {
158
+ Q("Shipment reference is required.");
156
159
  return;
157
160
  }
158
- let e = Number(K.volume);
159
- if (!K.volume || Number.isNaN(e) || e <= 0) {
160
- X("Enter a volume greater than zero."), F.error("Enter a volume greater than zero.");
161
+ let e = Number(J.volume);
162
+ if (!J.volume || Number.isNaN(e) || e <= 0) {
163
+ Q("Enter a volume greater than zero."), F.error("Enter a volume greater than zero.");
161
164
  return;
162
165
  }
163
- X(null);
166
+ Q(null);
164
167
  try {
165
- await R.mutateAsync({
168
+ await z.mutateAsync({
166
169
  contractId: I.id,
167
- reference: K.reference.trim(),
168
- mode: K.mode,
169
- carrier: K.carrier.trim() || null,
170
- origin: K.origin.trim() || null,
171
- destination: K.destination.trim() || null,
170
+ reference: J.reference.trim(),
171
+ mode: J.mode,
172
+ carrier: J.carrier.trim() || null,
173
+ trackingId: J.trackingId.trim() || null,
174
+ origin: J.origin.trim() || null,
175
+ destination: J.destination.trim() || null,
172
176
  volume: e,
173
- unit: K.unit,
174
- scheduledAt: s(K.scheduledAt) ?? null,
175
- documentFileId: $e?.fileId ?? null,
176
- notes: K.notes.trim() || null
177
- }), F.success("Shipment scheduled"), G(!1);
177
+ unit: J.unit,
178
+ scheduledAt: s(J.scheduledAt) ?? null,
179
+ documentFileId: tt?.fileId ?? null,
180
+ notes: J.notes.trim() || null
181
+ }), F.success("Shipment scheduled"), q(!1);
178
182
  } catch (e) {
179
- X(e instanceof Error ? e.message : "Failed to schedule shipment."), F.fromError(e);
183
+ Q(e instanceof Error ? e.message : "Failed to schedule shipment."), F.fromError(e);
180
184
  }
181
- }, at = (e) => {
182
- X(null), Ye.mutate(e, {
185
+ }, lt = (e) => {
186
+ Q(null), B.mutate(e, {
183
187
  onSuccess: () => F.success("Shipment delivered"),
184
188
  onError: (e) => {
185
- X(e instanceof Error ? e.message : "Failed to mark shipment delivered."), F.fromError(e);
189
+ Q(e instanceof Error ? e.message : "Failed to mark shipment delivered."), F.fromError(e);
186
190
  }
187
191
  });
188
- }, ot = [
192
+ }, ut = () => {
193
+ let e = he([
194
+ {
195
+ header: "Reference",
196
+ value: (e) => e.reference
197
+ },
198
+ {
199
+ header: "Mode",
200
+ value: (e) => i(e.mode)
201
+ },
202
+ {
203
+ header: "Status",
204
+ value: (e) => i(e.status)
205
+ },
206
+ {
207
+ header: "Carrier",
208
+ value: (e) => e.carrier ?? ""
209
+ },
210
+ {
211
+ header: "Tracking ID",
212
+ value: (e) => e.trackingId ?? ""
213
+ },
214
+ {
215
+ header: "Origin",
216
+ value: (e) => e.origin ?? ""
217
+ },
218
+ {
219
+ header: "Destination",
220
+ value: (e) => e.destination ?? ""
221
+ },
222
+ {
223
+ header: "Volume",
224
+ value: (e) => e.volume
225
+ },
226
+ {
227
+ header: "Unit",
228
+ value: (e) => e.unit
229
+ },
230
+ {
231
+ header: "Scheduled",
232
+ value: (e) => e.scheduledAt ?? ""
233
+ },
234
+ {
235
+ header: "Departed",
236
+ value: (e) => e.departedAt ?? ""
237
+ },
238
+ {
239
+ header: "Delivered",
240
+ value: (e) => e.deliveredAt ?? ""
241
+ }
242
+ ], $);
243
+ ge(`${_e(I.reference)}-shipments.csv`, "text/csv", e) ? F.success("Shipments exported") : F.error("This browser can't download the export.");
244
+ }, dt = [
189
245
  {
190
246
  key: "reference",
191
247
  header: "Shipment",
@@ -211,6 +267,18 @@ function N() {
211
267
  children: e.carrier ?? "—"
212
268
  })
213
269
  },
270
+ {
271
+ key: "trackingId",
272
+ header: "Tracking ID",
273
+ hideOnMobile: !0,
274
+ render: (e) => e.trackingId ? /* @__PURE__ */ p("span", {
275
+ className: "truncate font-mono text-xs text-text-secondary",
276
+ children: e.trackingId
277
+ }) : /* @__PURE__ */ p("span", {
278
+ className: "text-text-tertiary",
279
+ children: "—"
280
+ })
281
+ },
214
282
  {
215
283
  key: "route",
216
284
  header: "Route",
@@ -244,18 +312,28 @@ function N() {
244
312
  },
245
313
  {
246
314
  key: "schedule",
247
- header: "Scheduled",
315
+ header: "Schedule",
248
316
  hideOnMobile: !0,
249
- render: (e) => /* @__PURE__ */ p("span", {
250
- className: "text-text-tertiary",
251
- children: r(e.scheduledAt)
317
+ sortValue: (e) => e.scheduledAt ?? "",
318
+ render: (e) => /* @__PURE__ */ m("div", {
319
+ className: "min-w-0",
320
+ children: [/* @__PURE__ */ p("p", {
321
+ className: "text-text-tertiary",
322
+ children: r(e.scheduledAt)
323
+ }), e.deliveredAt ? /* @__PURE__ */ m("p", {
324
+ className: "text-xs text-status-success-text",
325
+ children: ["Delivered ", r(e.deliveredAt)]
326
+ }) : e.departedAt ? /* @__PURE__ */ m("p", {
327
+ className: "text-xs text-text-secondary",
328
+ children: ["Departed ", r(e.departedAt)]
329
+ }) : null]
252
330
  })
253
331
  },
254
332
  {
255
333
  key: "document",
256
334
  header: "Document",
257
335
  hideOnMobile: !0,
258
- render: (e) => e.document?.id ? /* @__PURE__ */ p(Se, { fileId: e.document.id }) : /* @__PURE__ */ p("span", {
336
+ render: (e) => e.document?.id ? /* @__PURE__ */ p(Ce, { fileId: e.document.id }) : /* @__PURE__ */ p("span", {
259
337
  className: "text-text-tertiary",
260
338
  children: "—"
261
339
  })
@@ -264,64 +342,64 @@ function N() {
264
342
  key: "action",
265
343
  header: "",
266
344
  align: "right",
267
- render: (e) => Ve.has(e.status) ? /* @__PURE__ */ m(h, {
345
+ render: (e) => Ke.has(e.status) ? /* @__PURE__ */ m(h, {
268
346
  size: "sm",
269
347
  variant: "outline",
270
- onClick: () => at(e.id),
271
- disabled: Ye.isPending,
272
- children: [/* @__PURE__ */ p(Oe, { className: "mr-1.5 h-4 w-4" }), " Mark delivered"]
348
+ onClick: () => lt(e.id),
349
+ disabled: B.isPending,
350
+ children: [/* @__PURE__ */ p(ke, { className: "mr-1.5 h-4 w-4" }), " Mark delivered"]
273
351
  }) : null
274
352
  }
275
- ], st = [
353
+ ], ft = [
276
354
  {
277
355
  value: "shipments",
278
356
  label: "Shipments",
279
- icon: /* @__PURE__ */ p(d, { className: "h-4 w-4" }),
280
- count: Z.length
357
+ icon: /* @__PURE__ */ p(ze, { className: "h-4 w-4" }),
358
+ count: $.length
281
359
  },
282
360
  {
283
361
  value: "tags",
284
362
  label: "Tags",
285
- icon: /* @__PURE__ */ p(Ie, { className: "h-4 w-4" })
363
+ icon: /* @__PURE__ */ p(Be, { className: "h-4 w-4" })
286
364
  },
287
365
  {
288
366
  value: "discussion",
289
367
  label: "Discussion",
290
- icon: /* @__PURE__ */ p(Ne, { className: "h-4 w-4" })
368
+ icon: /* @__PURE__ */ p(Fe, { className: "h-4 w-4" })
291
369
  }
292
- ], ct = I.startDate || I.endDate ? `${r(I.startDate)} – ${r(I.endDate)}` : "—";
370
+ ], pt = I.startDate || I.endDate ? `${r(I.startDate)} – ${r(I.endDate)}` : "—";
293
371
  return /* @__PURE__ */ m(t, {
294
372
  title: I.reference,
295
373
  description: `${I.counterparty} · ${i(I.commodity)}`,
296
374
  dataTour: "theglobalfuel-contract-detail-page",
297
375
  actions: /* @__PURE__ */ m(f, { children: [
298
376
  /* @__PURE__ */ p(c, { status: I.status }),
299
- /* @__PURE__ */ m(T, {
377
+ /* @__PURE__ */ m(w, {
300
378
  value: I.status,
301
- onValueChange: (e) => nt(e),
302
- disabled: Q.length === 0,
303
- children: [/* @__PURE__ */ p(O, {
379
+ onValueChange: (e) => ot(e),
380
+ disabled: rt.length === 0,
381
+ children: [/* @__PURE__ */ p(D, {
304
382
  className: "h-9 w-40",
305
383
  "aria-label": "Change contract status",
306
- children: /* @__PURE__ */ p(k, {})
307
- }), /* @__PURE__ */ m(E, { children: [/* @__PURE__ */ p(D, {
384
+ children: /* @__PURE__ */ p(O, {})
385
+ }), /* @__PURE__ */ m(T, { children: [/* @__PURE__ */ p(E, {
308
386
  value: I.status,
309
387
  disabled: !0,
310
388
  children: i(I.status)
311
- }), Q.map((e) => /* @__PURE__ */ p(D, {
389
+ }), rt.map((e) => /* @__PURE__ */ p(E, {
312
390
  value: e,
313
391
  children: i(e)
314
392
  }, e))] })]
315
393
  }),
316
394
  /* @__PURE__ */ m(h, {
317
395
  variant: "outline",
318
- onClick: tt,
319
- children: [/* @__PURE__ */ p(Fe, { className: "mr-1.5 h-4 w-4" }), " Edit"]
396
+ onClick: it,
397
+ children: [/* @__PURE__ */ p(Le, { className: "mr-1.5 h-4 w-4" }), " Edit"]
320
398
  }),
321
399
  /* @__PURE__ */ m(h, {
322
400
  variant: "ghost",
323
401
  onClick: () => P("contracts"),
324
- children: [/* @__PURE__ */ p(Te, { className: "mr-1.5 h-4 w-4" }), " Back"]
402
+ children: [/* @__PURE__ */ p(Ee, { className: "mr-1.5 h-4 w-4" }), " Back"]
325
403
  })
326
404
  ] }),
327
405
  children: [
@@ -329,41 +407,41 @@ function N() {
329
407
  className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4",
330
408
  children: [
331
409
  /* @__PURE__ */ p(n, {
332
- icon: /* @__PURE__ */ p(Ee, { className: "h-5 w-5" }),
410
+ icon: /* @__PURE__ */ p(De, { className: "h-5 w-5" }),
333
411
  value: I.counterparty,
334
412
  label: "Counterparty",
335
413
  featured: !0
336
414
  }),
337
415
  /* @__PURE__ */ p(n, {
338
- icon: /* @__PURE__ */ p(Pe, { className: "h-5 w-5" }),
416
+ icon: /* @__PURE__ */ p(Ie, { className: "h-5 w-5" }),
339
417
  value: i(I.commodity),
340
418
  label: "Commodity & side",
341
419
  footer: /* @__PURE__ */ p(c, { status: I.side })
342
420
  }),
343
421
  /* @__PURE__ */ p(n, {
344
- icon: /* @__PURE__ */ p(ke, { className: "h-5 w-5" }),
422
+ icon: /* @__PURE__ */ p(Ae, { className: "h-5 w-5" }),
345
423
  value: ee(I.pricePerUnit, I.currency),
346
424
  label: `Price per ${a(I.unit)}`,
347
425
  footer: /* @__PURE__ */ p(c, { status: I.pricingBasis })
348
426
  }),
349
427
  /* @__PURE__ */ p(n, {
350
- icon: /* @__PURE__ */ p(je, { className: "h-5 w-5" }),
428
+ icon: /* @__PURE__ */ p(Ne, { className: "h-5 w-5" }),
351
429
  value: o(I.deliveredVolume, I.unit),
352
430
  label: `of ${o(I.contractedVolume, I.unit)} delivered`,
353
431
  footer: /* @__PURE__ */ m("div", {
354
432
  className: "space-y-2",
355
433
  children: [/* @__PURE__ */ p(te, {
356
- value: et,
434
+ value: nt,
357
435
  barClassName: "bg-[var(--color-status-success-text)]"
358
436
  }), /* @__PURE__ */ m("p", {
359
437
  className: "text-xs tabular-nums text-text-tertiary",
360
- children: [Math.round(et), "% fulfilled"]
438
+ children: [Math.round(nt), "% fulfilled"]
361
439
  })]
362
440
  })
363
441
  })
364
442
  ]
365
443
  }),
366
- /* @__PURE__ */ m(g, {
444
+ /* @__PURE__ */ m(He, {
367
445
  treatment: "glass",
368
446
  className: "mt-4 p-6",
369
447
  children: [/* @__PURE__ */ m("dl", {
@@ -395,7 +473,7 @@ function N() {
395
473
  children: "Delivery location"
396
474
  }), /* @__PURE__ */ p("dd", {
397
475
  className: "mt-0.5 flex items-center gap-1.5 text-sm text-text-primary",
398
- children: I.deliveryLocation ? /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(Me, { className: "h-3.5 w-3.5 shrink-0 text-text-tertiary" }), I.deliveryLocation] }) : "—"
476
+ children: I.deliveryLocation ? /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(Pe, { className: "h-3.5 w-3.5 shrink-0 text-text-tertiary" }), I.deliveryLocation] }) : "—"
399
477
  })] }),
400
478
  /* @__PURE__ */ m("div", {
401
479
  className: "col-span-2",
@@ -404,7 +482,7 @@ function N() {
404
482
  children: "Term"
405
483
  }), /* @__PURE__ */ m("dd", {
406
484
  className: "mt-0.5 flex items-center gap-1.5 text-sm text-text-primary tabular-nums",
407
- children: [/* @__PURE__ */ p(De, { className: "h-3.5 w-3.5 shrink-0 text-text-tertiary" }), ct]
485
+ children: [/* @__PURE__ */ p(Oe, { className: "h-3.5 w-3.5 shrink-0 text-text-tertiary" }), pt]
408
486
  })]
409
487
  }),
410
488
  /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("dt", {
@@ -427,84 +505,93 @@ function N() {
427
505
  children: I.notes
428
506
  })]
429
507
  }),
430
- Y && /* @__PURE__ */ p("p", {
508
+ Z && /* @__PURE__ */ p("p", {
431
509
  className: "mt-4 text-sm text-status-error-text",
432
- children: Y
510
+ children: Z
433
511
  }),
434
512
  /* @__PURE__ */ p("div", {
435
513
  className: "mt-6",
436
- children: /* @__PURE__ */ p(ye, {
437
- items: st,
438
- value: V,
439
- onChange: Xe
514
+ children: /* @__PURE__ */ p(be, {
515
+ items: ft,
516
+ value: U,
517
+ onChange: Qe
440
518
  })
441
519
  }),
442
- V === "shipments" && /* @__PURE__ */ p("div", {
520
+ U === "shipments" && /* @__PURE__ */ p("div", {
443
521
  className: "mt-6",
444
- children: /* @__PURE__ */ p(ae, {
522
+ children: /* @__PURE__ */ p(re, {
445
523
  title: "Shipments",
446
524
  description: "Physical movements delivering against this contract's volume.",
447
- action: /* @__PURE__ */ m(h, {
448
- size: "sm",
449
- onClick: $,
450
- children: [/* @__PURE__ */ p(u, { className: "mr-1.5 h-4 w-4" }), " Schedule shipment"]
525
+ action: /* @__PURE__ */ m("div", {
526
+ className: "flex items-center gap-2",
527
+ children: [/* @__PURE__ */ m(h, {
528
+ size: "sm",
529
+ variant: "outline",
530
+ onClick: ut,
531
+ disabled: $.length === 0,
532
+ children: [/* @__PURE__ */ p(je, { className: "mr-1.5 h-4 w-4" }), " Export"]
533
+ }), /* @__PURE__ */ m(h, {
534
+ size: "sm",
535
+ onClick: at,
536
+ children: [/* @__PURE__ */ p(Re, { className: "mr-1.5 h-4 w-4" }), " Schedule shipment"]
537
+ })]
451
538
  }),
452
- children: B.isLoading ? /* @__PURE__ */ p(ie, { label: "Loading shipments…" }) : B.isError ? /* @__PURE__ */ p(re, {
539
+ children: H.isLoading ? /* @__PURE__ */ p(u, { label: "Loading shipments…" }) : H.isError ? /* @__PURE__ */ p(l, {
453
540
  message: "Couldn't load shipments.",
454
- onRetry: () => B.refetch()
455
- }) : Z.length === 0 ? /* @__PURE__ */ p(oe, {
541
+ onRetry: () => H.refetch()
542
+ }) : $.length === 0 ? /* @__PURE__ */ p(ie, {
456
543
  illustration: "empty-data",
457
- icon: /* @__PURE__ */ p(d, { className: "h-10 w-10" }),
544
+ icon: /* @__PURE__ */ p(ze, { className: "h-10 w-10" }),
458
545
  title: "No shipments scheduled",
459
546
  description: "Schedule a shipment to start delivering against this contract.",
460
547
  action: /* @__PURE__ */ m(h, {
461
- onClick: $,
462
- children: [/* @__PURE__ */ p(u, { className: "mr-1.5 h-4 w-4" }), " Schedule shipment"]
548
+ onClick: at,
549
+ children: [/* @__PURE__ */ p(Re, { className: "mr-1.5 h-4 w-4" }), " Schedule shipment"]
463
550
  })
464
551
  }) : /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(ne, {
465
- columns: ot,
466
- rows: Z,
552
+ columns: dt,
553
+ rows: $,
467
554
  rowKey: (e) => e.id
468
- }), /* @__PURE__ */ p(be, {
469
- page: z.page,
470
- pageSize: j,
471
- itemCount: Z.length,
472
- hasMore: B.data?.pageInfo?.hasMore ?? !1,
473
- onPageChange: z.onPageChange
555
+ }), /* @__PURE__ */ p(xe, {
556
+ page: V.page,
557
+ pageSize: A,
558
+ itemCount: $.length,
559
+ hasMore: H.data?.pageInfo?.hasMore ?? !1,
560
+ onPageChange: V.onPageChange
474
561
  })] })
475
562
  })
476
563
  }),
477
- V === "tags" && /* @__PURE__ */ p("div", {
564
+ U === "tags" && /* @__PURE__ */ p("div", {
478
565
  className: "mt-6",
479
- children: /* @__PURE__ */ p(g, {
566
+ children: /* @__PURE__ */ p(He, {
480
567
  treatment: "glass",
481
568
  className: "p-6",
482
- children: /* @__PURE__ */ p(we, {
569
+ children: /* @__PURE__ */ p(Te, {
483
570
  entityType: "theglobalfuel-contract",
484
571
  entityId: I.id
485
572
  })
486
573
  })
487
574
  }),
488
- V === "discussion" && /* @__PURE__ */ p("div", {
575
+ U === "discussion" && /* @__PURE__ */ p("div", {
489
576
  className: "mt-6",
490
- children: /* @__PURE__ */ p(Ce, {
577
+ children: /* @__PURE__ */ p(we, {
491
578
  entityType: "theglobalfuel-contract",
492
579
  entityId: I.id,
493
580
  description: "Coordinate negotiation, delivery and settlement with your team."
494
581
  })
495
582
  }),
496
- /* @__PURE__ */ p(y, {
497
- open: Qe,
583
+ /* @__PURE__ */ p(v, {
584
+ open: et,
498
585
  onOpenChange: (e) => {
499
- G(e), e || (q(M(I.unit)), J(null), X(null));
586
+ q(e), e || (Y(M(I.unit)), X(null), Q(null));
500
587
  },
501
- children: /* @__PURE__ */ m(b, { children: [/* @__PURE__ */ m(C, { children: [/* @__PURE__ */ p(w, { children: "Schedule shipment" }), /* @__PURE__ */ m(x, { children: [
588
+ children: /* @__PURE__ */ m(y, { children: [/* @__PURE__ */ m(S, { children: [/* @__PURE__ */ p(C, { children: "Schedule shipment" }), /* @__PURE__ */ m(b, { children: [
502
589
  "Log a physical movement delivering against ",
503
590
  I.reference,
504
591
  "."
505
592
  ] })] }), /* @__PURE__ */ m("form", {
506
593
  onSubmit: (e) => {
507
- e.preventDefault(), it();
594
+ e.preventDefault(), ct();
508
595
  },
509
596
  children: [/* @__PURE__ */ m("div", {
510
597
  className: "grid gap-4 py-2",
@@ -513,33 +600,33 @@ function N() {
513
600
  className: "grid gap-2 sm:grid-cols-2",
514
601
  children: [/* @__PURE__ */ m("div", {
515
602
  className: "grid gap-1.5",
516
- children: [/* @__PURE__ */ p(v, {
603
+ children: [/* @__PURE__ */ p(_, {
517
604
  htmlFor: "shipReference",
518
605
  children: "Reference *"
519
- }), /* @__PURE__ */ p(_, {
606
+ }), /* @__PURE__ */ p(g, {
520
607
  id: "shipReference",
521
- value: K.reference,
522
- onChange: (e) => q({
523
- ...K,
608
+ value: J.reference,
609
+ onChange: (e) => Y({
610
+ ...J,
524
611
  reference: e.target.value
525
612
  }),
526
613
  placeholder: "SHP-2026-0031"
527
614
  })]
528
615
  }), /* @__PURE__ */ m("div", {
529
616
  className: "grid gap-1.5",
530
- children: [/* @__PURE__ */ p(v, {
617
+ children: [/* @__PURE__ */ p(_, {
531
618
  htmlFor: "shipMode",
532
619
  children: "Mode"
533
- }), /* @__PURE__ */ m(T, {
534
- value: K.mode,
535
- onValueChange: (e) => q({
536
- ...K,
620
+ }), /* @__PURE__ */ m(w, {
621
+ value: J.mode,
622
+ onValueChange: (e) => Y({
623
+ ...J,
537
624
  mode: e
538
625
  }),
539
- children: [/* @__PURE__ */ p(O, {
626
+ children: [/* @__PURE__ */ p(D, {
540
627
  id: "shipMode",
541
- children: /* @__PURE__ */ p(k, {})
542
- }), /* @__PURE__ */ p(E, { children: ze.map((e) => /* @__PURE__ */ p(D, {
628
+ children: /* @__PURE__ */ p(O, {})
629
+ }), /* @__PURE__ */ p(T, { children: We.map((e) => /* @__PURE__ */ p(E, {
543
630
  value: e,
544
631
  children: i(e)
545
632
  }, e)) })]
@@ -547,46 +634,63 @@ function N() {
547
634
  })]
548
635
  }),
549
636
  /* @__PURE__ */ m("div", {
550
- className: "grid gap-1.5",
551
- children: [/* @__PURE__ */ p(v, {
552
- htmlFor: "shipCarrier",
553
- children: "Carrier"
554
- }), /* @__PURE__ */ p(_, {
555
- id: "shipCarrier",
556
- value: K.carrier,
557
- onChange: (e) => q({
558
- ...K,
559
- carrier: e.target.value
560
- }),
561
- placeholder: "Maersk Tankers"
637
+ className: "grid gap-2 sm:grid-cols-2",
638
+ children: [/* @__PURE__ */ m("div", {
639
+ className: "grid gap-1.5",
640
+ children: [/* @__PURE__ */ p(_, {
641
+ htmlFor: "shipCarrier",
642
+ children: "Carrier"
643
+ }), /* @__PURE__ */ p(g, {
644
+ id: "shipCarrier",
645
+ value: J.carrier,
646
+ onChange: (e) => Y({
647
+ ...J,
648
+ carrier: e.target.value
649
+ }),
650
+ placeholder: "Maersk Tankers"
651
+ })]
652
+ }), /* @__PURE__ */ m("div", {
653
+ className: "grid gap-1.5",
654
+ children: [/* @__PURE__ */ p(_, {
655
+ htmlFor: "shipTracking",
656
+ children: "Tracking ID"
657
+ }), /* @__PURE__ */ p(g, {
658
+ id: "shipTracking",
659
+ value: J.trackingId,
660
+ onChange: (e) => Y({
661
+ ...J,
662
+ trackingId: e.target.value
663
+ }),
664
+ placeholder: "Waybill / B-L number"
665
+ })]
562
666
  })]
563
667
  }),
564
668
  /* @__PURE__ */ m("div", {
565
669
  className: "grid gap-2 sm:grid-cols-2",
566
670
  children: [/* @__PURE__ */ m("div", {
567
671
  className: "grid gap-1.5",
568
- children: [/* @__PURE__ */ p(v, {
672
+ children: [/* @__PURE__ */ p(_, {
569
673
  htmlFor: "shipOrigin",
570
674
  children: "Origin"
571
- }), /* @__PURE__ */ p(_, {
675
+ }), /* @__PURE__ */ p(g, {
572
676
  id: "shipOrigin",
573
- value: K.origin,
574
- onChange: (e) => q({
575
- ...K,
677
+ value: J.origin,
678
+ onChange: (e) => Y({
679
+ ...J,
576
680
  origin: e.target.value
577
681
  }),
578
682
  placeholder: "Ras Tanura"
579
683
  })]
580
684
  }), /* @__PURE__ */ m("div", {
581
685
  className: "grid gap-1.5",
582
- children: [/* @__PURE__ */ p(v, {
686
+ children: [/* @__PURE__ */ p(_, {
583
687
  htmlFor: "shipDestination",
584
688
  children: "Destination"
585
- }), /* @__PURE__ */ p(_, {
689
+ }), /* @__PURE__ */ p(g, {
586
690
  id: "shipDestination",
587
- value: K.destination,
588
- onChange: (e) => q({
589
- ...K,
691
+ value: J.destination,
692
+ onChange: (e) => Y({
693
+ ...J,
590
694
  destination: e.target.value
591
695
  }),
592
696
  placeholder: "Rotterdam"
@@ -598,17 +702,17 @@ function N() {
598
702
  children: [
599
703
  /* @__PURE__ */ m("div", {
600
704
  className: "grid gap-1.5",
601
- children: [/* @__PURE__ */ p(v, {
705
+ children: [/* @__PURE__ */ p(_, {
602
706
  htmlFor: "shipVolume",
603
707
  children: "Volume *"
604
- }), /* @__PURE__ */ p(_, {
708
+ }), /* @__PURE__ */ p(g, {
605
709
  id: "shipVolume",
606
710
  type: "number",
607
711
  min: "0",
608
712
  step: "any",
609
- value: K.volume,
610
- onChange: (e) => q({
611
- ...K,
713
+ value: J.volume,
714
+ onChange: (e) => Y({
715
+ ...J,
612
716
  volume: e.target.value
613
717
  }),
614
718
  placeholder: "50000"
@@ -616,19 +720,19 @@ function N() {
616
720
  }),
617
721
  /* @__PURE__ */ m("div", {
618
722
  className: "grid gap-1.5",
619
- children: [/* @__PURE__ */ p(v, {
723
+ children: [/* @__PURE__ */ p(_, {
620
724
  htmlFor: "shipUnit",
621
725
  children: "Unit"
622
- }), /* @__PURE__ */ m(T, {
623
- value: K.unit,
624
- onValueChange: (e) => q({
625
- ...K,
726
+ }), /* @__PURE__ */ m(w, {
727
+ value: J.unit,
728
+ onValueChange: (e) => Y({
729
+ ...J,
626
730
  unit: e
627
731
  }),
628
- children: [/* @__PURE__ */ p(O, {
732
+ children: [/* @__PURE__ */ p(D, {
629
733
  id: "shipUnit",
630
- children: /* @__PURE__ */ p(k, {})
631
- }), /* @__PURE__ */ p(E, { children: Be.map((e) => /* @__PURE__ */ p(D, {
734
+ children: /* @__PURE__ */ p(O, {})
735
+ }), /* @__PURE__ */ p(T, { children: Ge.map((e) => /* @__PURE__ */ p(E, {
632
736
  value: e,
633
737
  children: a(e)
634
738
  }, e)) })]
@@ -636,88 +740,88 @@ function N() {
636
740
  }),
637
741
  /* @__PURE__ */ m("div", {
638
742
  className: "grid gap-1.5",
639
- children: [/* @__PURE__ */ p(v, {
743
+ children: [/* @__PURE__ */ p(_, {
640
744
  htmlFor: "shipScheduled",
641
745
  children: "Scheduled at"
642
- }), /* @__PURE__ */ p(_, {
746
+ }), /* @__PURE__ */ p(g, {
643
747
  id: "shipScheduled",
644
748
  type: "date",
645
- value: K.scheduledAt,
646
- onChange: (e) => q({
647
- ...K,
749
+ value: J.scheduledAt,
750
+ onChange: (e) => Y({
751
+ ...J,
648
752
  scheduledAt: e.target.value
649
753
  })
650
754
  })]
651
755
  })
652
756
  ]
653
757
  }),
654
- /* @__PURE__ */ p(xe, {
758
+ /* @__PURE__ */ p(Se, {
655
759
  id: "ship-doc",
656
760
  label: "Bill of lading / document",
657
- value: $e,
658
- onChange: J,
761
+ value: tt,
762
+ onChange: X,
659
763
  accept: "image/*,application/pdf",
660
764
  hint: "Attach the bill of lading or shipping document (PDF or image)."
661
765
  }),
662
766
  /* @__PURE__ */ m("div", {
663
767
  className: "grid gap-1.5",
664
- children: [/* @__PURE__ */ p(v, {
768
+ children: [/* @__PURE__ */ p(_, {
665
769
  htmlFor: "shipNotes",
666
770
  children: "Notes"
667
- }), /* @__PURE__ */ p(A, {
771
+ }), /* @__PURE__ */ p(k, {
668
772
  id: "shipNotes",
669
773
  rows: 2,
670
- value: K.notes,
671
- onChange: (e) => q({
672
- ...K,
774
+ value: J.notes,
775
+ onChange: (e) => Y({
776
+ ...J,
673
777
  notes: e.target.value
674
778
  }),
675
779
  placeholder: "Optional context about this shipment."
676
780
  })]
677
781
  }),
678
- Y && /* @__PURE__ */ p("p", {
782
+ Z && /* @__PURE__ */ p("p", {
679
783
  className: "text-sm text-status-error-text",
680
- children: Y
784
+ children: Z
681
785
  })
682
786
  ]
683
- }), /* @__PURE__ */ m(S, { children: [/* @__PURE__ */ p(h, {
787
+ }), /* @__PURE__ */ m(x, { children: [/* @__PURE__ */ p(h, {
684
788
  type: "button",
685
789
  variant: "outline",
686
790
  onClick: () => {
687
- G(!1), q(M(I.unit)), J(null), X(null);
791
+ q(!1), Y(M(I.unit)), X(null), Q(null);
688
792
  },
689
793
  children: "Cancel"
690
794
  }), /* @__PURE__ */ p(h, {
691
795
  type: "submit",
692
- disabled: R.isPending,
693
- children: R.isPending ? "Scheduling…" : "Schedule shipment"
796
+ disabled: z.isPending,
797
+ children: z.isPending ? "Scheduling…" : "Schedule shipment"
694
798
  })] })]
695
799
  })] })
696
800
  }),
697
- /* @__PURE__ */ p(y, {
698
- open: Ze,
699
- onOpenChange: H,
700
- children: /* @__PURE__ */ m(b, { children: [/* @__PURE__ */ m(C, { children: [/* @__PURE__ */ p(w, { children: "Edit contract" }), /* @__PURE__ */ m(x, { children: [
801
+ /* @__PURE__ */ p(v, {
802
+ open: $e,
803
+ onOpenChange: W,
804
+ children: /* @__PURE__ */ m(y, { children: [/* @__PURE__ */ m(S, { children: [/* @__PURE__ */ p(C, { children: "Edit contract" }), /* @__PURE__ */ m(b, { children: [
701
805
  "Update the commercial terms of ",
702
806
  I.reference,
703
807
  "."
704
808
  ] })] }), /* @__PURE__ */ m("form", {
705
809
  onSubmit: (e) => {
706
- e.preventDefault(), rt();
810
+ e.preventDefault(), st();
707
811
  },
708
- children: [U && /* @__PURE__ */ m("div", {
812
+ children: [G && /* @__PURE__ */ m("div", {
709
813
  className: "grid gap-4 py-2",
710
814
  children: [
711
815
  /* @__PURE__ */ m("div", {
712
816
  className: "grid gap-1.5",
713
- children: [/* @__PURE__ */ p(v, {
817
+ children: [/* @__PURE__ */ p(_, {
714
818
  htmlFor: "editCounterparty",
715
819
  children: "Counterparty *"
716
- }), /* @__PURE__ */ p(_, {
820
+ }), /* @__PURE__ */ p(g, {
717
821
  id: "editCounterparty",
718
- value: U.counterparty,
719
- onChange: (e) => W({
720
- ...U,
822
+ value: G.counterparty,
823
+ onChange: (e) => K({
824
+ ...G,
721
825
  counterparty: e.target.value
722
826
  }),
723
827
  placeholder: "Vitol S.A."
@@ -727,33 +831,33 @@ function N() {
727
831
  className: "grid gap-2 sm:grid-cols-2",
728
832
  children: [/* @__PURE__ */ m("div", {
729
833
  className: "grid gap-1.5",
730
- children: [/* @__PURE__ */ p(v, {
834
+ children: [/* @__PURE__ */ p(_, {
731
835
  htmlFor: "editPricingBasis",
732
836
  children: "Pricing basis"
733
- }), /* @__PURE__ */ m(T, {
734
- value: U.pricingBasis,
735
- onValueChange: (e) => W({
736
- ...U,
837
+ }), /* @__PURE__ */ m(w, {
838
+ value: G.pricingBasis,
839
+ onValueChange: (e) => K({
840
+ ...G,
737
841
  pricingBasis: e
738
842
  }),
739
- children: [/* @__PURE__ */ p(O, {
843
+ children: [/* @__PURE__ */ p(D, {
740
844
  id: "editPricingBasis",
741
- children: /* @__PURE__ */ p(k, {})
742
- }), /* @__PURE__ */ p(E, { children: Re.map((e) => /* @__PURE__ */ p(D, {
845
+ children: /* @__PURE__ */ p(O, {})
846
+ }), /* @__PURE__ */ p(T, { children: Ue.map((e) => /* @__PURE__ */ p(E, {
743
847
  value: e,
744
848
  children: i(e)
745
849
  }, e)) })]
746
850
  })]
747
851
  }), /* @__PURE__ */ m("div", {
748
852
  className: "grid gap-1.5",
749
- children: [/* @__PURE__ */ p(v, {
853
+ children: [/* @__PURE__ */ p(_, {
750
854
  htmlFor: "editPriceIndex",
751
855
  children: "Price index"
752
- }), /* @__PURE__ */ p(_, {
856
+ }), /* @__PURE__ */ p(g, {
753
857
  id: "editPriceIndex",
754
- value: U.priceIndex,
755
- onChange: (e) => W({
756
- ...U,
858
+ value: G.priceIndex,
859
+ onChange: (e) => K({
860
+ ...G,
757
861
  priceIndex: e.target.value
758
862
  }),
759
863
  placeholder: "Brent, TTF, Henry Hub"
@@ -765,17 +869,17 @@ function N() {
765
869
  children: [
766
870
  /* @__PURE__ */ m("div", {
767
871
  className: "grid gap-1.5",
768
- children: [/* @__PURE__ */ p(v, {
872
+ children: [/* @__PURE__ */ p(_, {
769
873
  htmlFor: "editPrice",
770
874
  children: "Price / unit"
771
- }), /* @__PURE__ */ p(_, {
875
+ }), /* @__PURE__ */ p(g, {
772
876
  id: "editPrice",
773
877
  type: "number",
774
878
  min: "0",
775
879
  step: "any",
776
- value: U.pricePerUnit,
777
- onChange: (e) => W({
778
- ...U,
880
+ value: G.pricePerUnit,
881
+ onChange: (e) => K({
882
+ ...G,
779
883
  pricePerUnit: e.target.value
780
884
  }),
781
885
  placeholder: "82.50"
@@ -783,14 +887,14 @@ function N() {
783
887
  }),
784
888
  /* @__PURE__ */ m("div", {
785
889
  className: "grid gap-1.5",
786
- children: [/* @__PURE__ */ p(v, {
890
+ children: [/* @__PURE__ */ p(_, {
787
891
  htmlFor: "editCurrency",
788
892
  children: "Currency"
789
- }), /* @__PURE__ */ p(_, {
893
+ }), /* @__PURE__ */ p(g, {
790
894
  id: "editCurrency",
791
- value: U.currency,
792
- onChange: (e) => W({
793
- ...U,
895
+ value: G.currency,
896
+ onChange: (e) => K({
897
+ ...G,
794
898
  currency: e.target.value
795
899
  }),
796
900
  placeholder: "USD"
@@ -798,19 +902,19 @@ function N() {
798
902
  }),
799
903
  /* @__PURE__ */ m("div", {
800
904
  className: "grid gap-1.5",
801
- children: [/* @__PURE__ */ p(v, {
905
+ children: [/* @__PURE__ */ p(_, {
802
906
  htmlFor: "editUnit",
803
907
  children: "Unit"
804
- }), /* @__PURE__ */ m(T, {
805
- value: U.unit,
806
- onValueChange: (e) => W({
807
- ...U,
908
+ }), /* @__PURE__ */ m(w, {
909
+ value: G.unit,
910
+ onValueChange: (e) => K({
911
+ ...G,
808
912
  unit: e
809
913
  }),
810
- children: [/* @__PURE__ */ p(O, {
914
+ children: [/* @__PURE__ */ p(D, {
811
915
  id: "editUnit",
812
- children: /* @__PURE__ */ p(k, {})
813
- }), /* @__PURE__ */ p(E, { children: Be.map((e) => /* @__PURE__ */ p(D, {
916
+ children: /* @__PURE__ */ p(O, {})
917
+ }), /* @__PURE__ */ p(T, { children: Ge.map((e) => /* @__PURE__ */ p(E, {
814
918
  value: e,
815
919
  children: a(e)
816
920
  }, e)) })]
@@ -822,31 +926,31 @@ function N() {
822
926
  className: "grid gap-2 sm:grid-cols-2",
823
927
  children: [/* @__PURE__ */ m("div", {
824
928
  className: "grid gap-1.5",
825
- children: [/* @__PURE__ */ p(v, {
929
+ children: [/* @__PURE__ */ p(_, {
826
930
  htmlFor: "editVolume",
827
931
  children: "Contracted volume"
828
- }), /* @__PURE__ */ p(_, {
932
+ }), /* @__PURE__ */ p(g, {
829
933
  id: "editVolume",
830
934
  type: "number",
831
935
  min: "0",
832
936
  step: "any",
833
- value: U.contractedVolume,
834
- onChange: (e) => W({
835
- ...U,
937
+ value: G.contractedVolume,
938
+ onChange: (e) => K({
939
+ ...G,
836
940
  contractedVolume: e.target.value
837
941
  }),
838
942
  placeholder: "500000"
839
943
  })]
840
944
  }), /* @__PURE__ */ m("div", {
841
945
  className: "grid gap-1.5",
842
- children: [/* @__PURE__ */ p(v, {
946
+ children: [/* @__PURE__ */ p(_, {
843
947
  htmlFor: "editLocation",
844
948
  children: "Delivery location"
845
- }), /* @__PURE__ */ p(_, {
949
+ }), /* @__PURE__ */ p(g, {
846
950
  id: "editLocation",
847
- value: U.deliveryLocation,
848
- onChange: (e) => W({
849
- ...U,
951
+ value: G.deliveryLocation,
952
+ onChange: (e) => K({
953
+ ...G,
850
954
  deliveryLocation: e.target.value
851
955
  }),
852
956
  placeholder: "Rotterdam"
@@ -857,29 +961,29 @@ function N() {
857
961
  className: "grid gap-2 sm:grid-cols-2",
858
962
  children: [/* @__PURE__ */ m("div", {
859
963
  className: "grid gap-1.5",
860
- children: [/* @__PURE__ */ p(v, {
964
+ children: [/* @__PURE__ */ p(_, {
861
965
  htmlFor: "editStart",
862
966
  children: "Start date"
863
- }), /* @__PURE__ */ p(_, {
967
+ }), /* @__PURE__ */ p(g, {
864
968
  id: "editStart",
865
969
  type: "date",
866
- value: U.startDate,
867
- onChange: (e) => W({
868
- ...U,
970
+ value: G.startDate,
971
+ onChange: (e) => K({
972
+ ...G,
869
973
  startDate: e.target.value
870
974
  })
871
975
  })]
872
976
  }), /* @__PURE__ */ m("div", {
873
977
  className: "grid gap-1.5",
874
- children: [/* @__PURE__ */ p(v, {
978
+ children: [/* @__PURE__ */ p(_, {
875
979
  htmlFor: "editEnd",
876
980
  children: "End date"
877
- }), /* @__PURE__ */ p(_, {
981
+ }), /* @__PURE__ */ p(g, {
878
982
  id: "editEnd",
879
983
  type: "date",
880
- value: U.endDate,
881
- onChange: (e) => W({
882
- ...U,
984
+ value: G.endDate,
985
+ onChange: (e) => K({
986
+ ...G,
883
987
  endDate: e.target.value
884
988
  })
885
989
  })]
@@ -887,34 +991,34 @@ function N() {
887
991
  }),
888
992
  /* @__PURE__ */ m("div", {
889
993
  className: "grid gap-1.5",
890
- children: [/* @__PURE__ */ p(v, {
994
+ children: [/* @__PURE__ */ p(_, {
891
995
  htmlFor: "editNotes",
892
996
  children: "Notes"
893
- }), /* @__PURE__ */ p(A, {
997
+ }), /* @__PURE__ */ p(k, {
894
998
  id: "editNotes",
895
999
  rows: 2,
896
- value: U.notes,
897
- onChange: (e) => W({
898
- ...U,
1000
+ value: G.notes,
1001
+ onChange: (e) => K({
1002
+ ...G,
899
1003
  notes: e.target.value
900
1004
  }),
901
1005
  placeholder: "Optional context about this contract."
902
1006
  })]
903
1007
  }),
904
- Y && /* @__PURE__ */ p("p", {
1008
+ Z && /* @__PURE__ */ p("p", {
905
1009
  className: "text-sm text-status-error-text",
906
- children: Y
1010
+ children: Z
907
1011
  })
908
1012
  ]
909
- }), /* @__PURE__ */ m(S, { children: [/* @__PURE__ */ p(h, {
1013
+ }), /* @__PURE__ */ m(x, { children: [/* @__PURE__ */ p(h, {
910
1014
  type: "button",
911
1015
  variant: "outline",
912
- onClick: () => H(!1),
1016
+ onClick: () => W(!1),
913
1017
  children: "Cancel"
914
1018
  }), /* @__PURE__ */ p(h, {
915
1019
  type: "submit",
916
- disabled: L.isPending,
917
- children: L.isPending ? "Saving…" : "Save changes"
1020
+ disabled: R.isPending,
1021
+ children: R.isPending ? "Saving…" : "Save changes"
918
1022
  })] })]
919
1023
  })] })
920
1024
  })