@burdenoff/microfe-theglobalfuel 2026.704.1 → 2026.705.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.
Files changed (133) hide show
  1. package/dist/node_modules/{.bun/clsx@2.1.1/node_modules/clsx → clsx}/dist/clsx.js +1 -1
  2. package/dist/node_modules/clsx/dist/clsx.js.map +1 -0
  3. package/dist/node_modules/{.bun/tailwind-merge@3.5.0/node_modules/tailwind-merge → tailwind-merge}/dist/bundle-mjs.js +212 -170
  4. package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js.map +1 -0
  5. package/dist/theglobalfuel/components/DataTable.js +37 -27
  6. package/dist/theglobalfuel/components/DataTable.js.map +1 -1
  7. package/dist/theglobalfuel/hooks/index.js +1 -0
  8. package/dist/theglobalfuel/hooks/useNotify.js +19 -0
  9. package/dist/theglobalfuel/hooks/useNotify.js.map +1 -0
  10. package/dist/theglobalfuel/hooks/useTheFiles.js +4 -1
  11. package/dist/theglobalfuel/hooks/useTheFiles.js.map +1 -1
  12. package/dist/theglobalfuel/hooks/useTheGlobalFuelApi.js +59 -31
  13. package/dist/theglobalfuel/hooks/useTheGlobalFuelApi.js.map +1 -1
  14. package/dist/theglobalfuel/pages/assets/AssetDetailPage.js +367 -321
  15. package/dist/theglobalfuel/pages/assets/AssetDetailPage.js.map +1 -1
  16. package/dist/theglobalfuel/pages/assets/AssetsPage.js +66 -54
  17. package/dist/theglobalfuel/pages/assets/AssetsPage.js.map +1 -1
  18. package/dist/theglobalfuel/pages/compliance/CompliancePage.js +346 -182
  19. package/dist/theglobalfuel/pages/compliance/CompliancePage.js.map +1 -1
  20. package/dist/theglobalfuel/pages/contracts/ContractDetailPage.js +418 -390
  21. package/dist/theglobalfuel/pages/contracts/ContractDetailPage.js.map +1 -1
  22. package/dist/theglobalfuel/pages/contracts/ContractsPage.js +238 -230
  23. package/dist/theglobalfuel/pages/contracts/ContractsPage.js.map +1 -1
  24. package/dist/theglobalfuel/pages/dashboard/DashboardPage.js +5 -3
  25. package/dist/theglobalfuel/pages/dashboard/DashboardPage.js.map +1 -1
  26. package/dist/theglobalfuel/pages/emissions/EmissionsPage.js +201 -177
  27. package/dist/theglobalfuel/pages/emissions/EmissionsPage.js.map +1 -1
  28. package/dist/theglobalfuel/pages/inventory/InventoryPage.js +271 -238
  29. package/dist/theglobalfuel/pages/inventory/InventoryPage.js.map +1 -1
  30. package/dist/theglobalfuel/pages/production/ProductionPage.js +185 -177
  31. package/dist/theglobalfuel/pages/production/ProductionPage.js.map +1 -1
  32. package/dist/theglobalfuel/pages/reserves/ReservesPage.js +160 -138
  33. package/dist/theglobalfuel/pages/reserves/ReservesPage.js.map +1 -1
  34. package/dist/theglobalfuel/pages/shipments/ShipmentsPage.js +250 -198
  35. package/dist/theglobalfuel/pages/shipments/ShipmentsPage.js.map +1 -1
  36. package/dist/theglobalfuel/utils/cn.js +2 -2
  37. package/dist/theglobalfuel/utils/formatters.js +6 -1
  38. package/dist/theglobalfuel/utils/formatters.js.map +1 -1
  39. package/dist/theglobalfuel/utils/transitions.js +70 -0
  40. package/dist/theglobalfuel/utils/transitions.js.map +1 -0
  41. package/package.json +1 -1
  42. package/dist/dev/main.d.ts +0 -2
  43. package/dist/dev/main.d.ts.map +0 -1
  44. package/dist/index.d.ts +0 -2
  45. package/dist/index.d.ts.map +0 -1
  46. package/dist/node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.js.map +0 -1
  47. package/dist/node_modules/.bun/tailwind-merge@3.5.0/node_modules/tailwind-merge/dist/bundle-mjs.js.map +0 -1
  48. package/dist/theglobalfuel/TheGlobalFuelRoot.d.ts +0 -5
  49. package/dist/theglobalfuel/TheGlobalFuelRoot.d.ts.map +0 -1
  50. package/dist/theglobalfuel/TheGlobalFuelRoutes.d.ts +0 -4
  51. package/dist/theglobalfuel/TheGlobalFuelRoutes.d.ts.map +0 -1
  52. package/dist/theglobalfuel/components/DataTable.d.ts +0 -28
  53. package/dist/theglobalfuel/components/DataTable.d.ts.map +0 -1
  54. package/dist/theglobalfuel/components/EmptyState.d.ts +0 -18
  55. package/dist/theglobalfuel/components/EmptyState.d.ts.map +0 -1
  56. package/dist/theglobalfuel/components/EvidenceUpload.d.ts +0 -14
  57. package/dist/theglobalfuel/components/EvidenceUpload.d.ts.map +0 -1
  58. package/dist/theglobalfuel/components/FileLink.d.ts +0 -15
  59. package/dist/theglobalfuel/components/FileLink.d.ts.map +0 -1
  60. package/dist/theglobalfuel/components/FilterTabs.d.ts +0 -18
  61. package/dist/theglobalfuel/components/FilterTabs.d.ts.map +0 -1
  62. package/dist/theglobalfuel/components/MetricsCard.d.ts +0 -23
  63. package/dist/theglobalfuel/components/MetricsCard.d.ts.map +0 -1
  64. package/dist/theglobalfuel/components/MiniBar.d.ts +0 -16
  65. package/dist/theglobalfuel/components/MiniBar.d.ts.map +0 -1
  66. package/dist/theglobalfuel/components/PageLayout.d.ts +0 -16
  67. package/dist/theglobalfuel/components/PageLayout.d.ts.map +0 -1
  68. package/dist/theglobalfuel/components/Pagination.d.ts +0 -22
  69. package/dist/theglobalfuel/components/Pagination.d.ts.map +0 -1
  70. package/dist/theglobalfuel/components/StateViews.d.ts +0 -24
  71. package/dist/theglobalfuel/components/StateViews.d.ts.map +0 -1
  72. package/dist/theglobalfuel/components/StatusBadge.d.ts +0 -9
  73. package/dist/theglobalfuel/components/StatusBadge.d.ts.map +0 -1
  74. package/dist/theglobalfuel/components/Tabs.d.ts +0 -17
  75. package/dist/theglobalfuel/components/Tabs.d.ts.map +0 -1
  76. package/dist/theglobalfuel/components/TheDiscussion.d.ts +0 -18
  77. package/dist/theglobalfuel/components/TheDiscussion.d.ts.map +0 -1
  78. package/dist/theglobalfuel/components/TheTags.d.ts +0 -17
  79. package/dist/theglobalfuel/components/TheTags.d.ts.map +0 -1
  80. package/dist/theglobalfuel/components/index.d.ts +0 -19
  81. package/dist/theglobalfuel/components/index.d.ts.map +0 -1
  82. package/dist/theglobalfuel/context/TheGlobalFuelContext.d.ts +0 -16
  83. package/dist/theglobalfuel/context/TheGlobalFuelContext.d.ts.map +0 -1
  84. package/dist/theglobalfuel/context/index.d.ts +0 -6
  85. package/dist/theglobalfuel/context/index.d.ts.map +0 -1
  86. package/dist/theglobalfuel/hooks/index.d.ts +0 -10
  87. package/dist/theglobalfuel/hooks/index.d.ts.map +0 -1
  88. package/dist/theglobalfuel/hooks/useCursorPager.d.ts +0 -33
  89. package/dist/theglobalfuel/hooks/useCursorPager.d.ts.map +0 -1
  90. package/dist/theglobalfuel/hooks/useTheComments.d.ts +0 -36
  91. package/dist/theglobalfuel/hooks/useTheComments.d.ts.map +0 -1
  92. package/dist/theglobalfuel/hooks/useTheFiles.d.ts +0 -47
  93. package/dist/theglobalfuel/hooks/useTheFiles.d.ts.map +0 -1
  94. package/dist/theglobalfuel/hooks/useTheGlobalFuelApi.d.ts +0 -75
  95. package/dist/theglobalfuel/hooks/useTheGlobalFuelApi.d.ts.map +0 -1
  96. package/dist/theglobalfuel/hooks/useTheTags.d.ts +0 -44
  97. package/dist/theglobalfuel/hooks/useTheTags.d.ts.map +0 -1
  98. package/dist/theglobalfuel/index.d.ts +0 -9
  99. package/dist/theglobalfuel/index.d.ts.map +0 -1
  100. package/dist/theglobalfuel/pages/assets/AssetDetailPage.d.ts +0 -13
  101. package/dist/theglobalfuel/pages/assets/AssetDetailPage.d.ts.map +0 -1
  102. package/dist/theglobalfuel/pages/assets/AssetsPage.d.ts +0 -10
  103. package/dist/theglobalfuel/pages/assets/AssetsPage.d.ts.map +0 -1
  104. package/dist/theglobalfuel/pages/compliance/CompliancePage.d.ts +0 -11
  105. package/dist/theglobalfuel/pages/compliance/CompliancePage.d.ts.map +0 -1
  106. package/dist/theglobalfuel/pages/contracts/ContractDetailPage.d.ts +0 -9
  107. package/dist/theglobalfuel/pages/contracts/ContractDetailPage.d.ts.map +0 -1
  108. package/dist/theglobalfuel/pages/contracts/ContractsPage.d.ts +0 -8
  109. package/dist/theglobalfuel/pages/contracts/ContractsPage.d.ts.map +0 -1
  110. package/dist/theglobalfuel/pages/dashboard/DashboardPage.d.ts +0 -13
  111. package/dist/theglobalfuel/pages/dashboard/DashboardPage.d.ts.map +0 -1
  112. package/dist/theglobalfuel/pages/emissions/EmissionsPage.d.ts +0 -12
  113. package/dist/theglobalfuel/pages/emissions/EmissionsPage.d.ts.map +0 -1
  114. package/dist/theglobalfuel/pages/inventory/InventoryPage.d.ts +0 -11
  115. package/dist/theglobalfuel/pages/inventory/InventoryPage.d.ts.map +0 -1
  116. package/dist/theglobalfuel/pages/production/ProductionPage.d.ts +0 -11
  117. package/dist/theglobalfuel/pages/production/ProductionPage.d.ts.map +0 -1
  118. package/dist/theglobalfuel/pages/reserves/ReservesPage.d.ts +0 -10
  119. package/dist/theglobalfuel/pages/reserves/ReservesPage.d.ts.map +0 -1
  120. package/dist/theglobalfuel/pages/shipments/ShipmentsPage.d.ts +0 -10
  121. package/dist/theglobalfuel/pages/shipments/ShipmentsPage.d.ts.map +0 -1
  122. package/dist/theglobalfuel/types/index.d.ts +0 -376
  123. package/dist/theglobalfuel/types/index.d.ts.map +0 -1
  124. package/dist/theglobalfuel/utils/cn.d.ts +0 -4
  125. package/dist/theglobalfuel/utils/cn.d.ts.map +0 -1
  126. package/dist/theglobalfuel/utils/formatters.d.ts +0 -36
  127. package/dist/theglobalfuel/utils/formatters.d.ts.map +0 -1
  128. package/dist/theglobalfuel/utils/i18n.d.ts +0 -6
  129. package/dist/theglobalfuel/utils/i18n.d.ts.map +0 -1
  130. package/dist/theglobalfuel/utils/index.d.ts +0 -9
  131. package/dist/theglobalfuel/utils/index.d.ts.map +0 -1
  132. package/dist/theglobalfuel/utils/navigation.d.ts +0 -14
  133. package/dist/theglobalfuel/utils/navigation.d.ts.map +0 -1
@@ -1,32 +1,27 @@
1
1
  import { useTheGlobalFuel as e } from "../../context/TheGlobalFuelContext.js";
2
2
  import { PageLayout as t } from "../../components/PageLayout.js";
3
3
  import { MetricsCard as n } from "../../components/MetricsCard.js";
4
- import { formatCoords as ee, formatDate as r, formatEnumLabel as i, formatNumber as a, formatPercent as te, formatRelativeTime as o, formatTonnesCo2e as ne, formatVolume as s } from "../../utils/formatters.js";
5
- import { StatusBadge as c } from "../../components/StatusBadge.js";
6
- import { DataTable as l } from "../../components/DataTable.js";
7
- import { ErrorView as u, LoadingView as d, Section as f } from "../../components/StateViews.js";
4
+ import { formatCoords as ee, formatDate as r, formatEnumLabel as i, formatNumber as a, formatPercent as te, formatRelativeTime as o, formatTonnesCo2e as ne, formatVolume as s, toBackendDate as c } from "../../utils/formatters.js";
5
+ import { StatusBadge as l } from "../../components/StatusBadge.js";
6
+ import { DataTable as u } from "../../components/DataTable.js";
7
+ import { ErrorView as re, LoadingView as d, Section as f } from "../../components/StateViews.js";
8
8
  import { EmptyState as p } from "../../components/EmptyState.js";
9
9
  import "../../context/index.js";
10
- import { useTheAsset as re, useTheCreateReserveEstimate as ie, useTheEmissionRecords as ae, useTheRecordProduction as oe, useTheRetireAsset as se, useTheTransitionAsset as ce } from "../../hooks/useTheGlobalFuelApi.js";
10
+ import { useTheAsset as ie, useTheCreateReserveEstimate as ae, useTheEmissionRecords as oe, useTheRecordProduction as se, useTheRetireAsset as ce, useTheTransitionAsset as le } from "../../hooks/useTheGlobalFuelApi.js";
11
+ import { useNotify as ue } from "../../hooks/useNotify.js";
11
12
  import "../../hooks/index.js";
12
- import { Tabs as le } from "../../components/Tabs.js";
13
- import { TheDiscussion as ue } from "../../components/TheDiscussion.js";
14
- import { TheTags as de } from "../../components/TheTags.js";
13
+ import { ASSET_TRANSITIONS as de, nextStatuses as fe } from "../../utils/transitions.js";
14
+ import { Tabs as pe } from "../../components/Tabs.js";
15
+ import { TheDiscussion as me } from "../../components/TheDiscussion.js";
16
+ import { TheTags as he } from "../../components/TheTags.js";
15
17
  import "../../components/index.js";
16
18
  import { useState as m } from "react";
17
- import { Activity as fe, Archive as pe, ArrowLeft as me, CalendarClock as he, Factory as ge, Fuel as _e, Gauge as ve, Layers as h, MapPin as ye, MessageSquare as be, Percent as xe, Plus as g, Tag as Se } from "lucide-react";
18
- import { useParams as Ce } from "react-router-dom";
19
- import { Fragment as we, jsx as _, jsxs as v } from "react/jsx-runtime";
20
- import { Button as y, GlassCard as Te, Input as b, Label as x, ResponsiveDialog as S, ResponsiveDialogContent as C, ResponsiveDialogDescription as Ee, ResponsiveDialogFooter as De, ResponsiveDialogHeader as Oe, 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";
19
+ import { Activity as ge, Archive as _e, ArrowLeft as h, CalendarClock as ve, Factory as g, Fuel as ye, Gauge as be, Layers as _, MapPin as xe, MessageSquare as Se, Percent as Ce, Plus as v, Tag as we } from "lucide-react";
20
+ import { useParams as Te } from "react-router-dom";
21
+ import { Fragment as Ee, jsx as y, jsxs as b } from "react/jsx-runtime";
22
+ import { Button as x, GlassCard as De, Input as S, Label as C, ResponsiveDialog as Oe, ResponsiveDialogContent as ke, ResponsiveDialogDescription as Ae, ResponsiveDialogFooter as je, ResponsiveDialogHeader as Me, ResponsiveDialogTitle as Ne, Select as w, SelectContent as T, SelectItem as E, SelectTrigger as D, SelectValue as O, Textarea as k } from "@burdenoff/fe-libs/ui";
21
23
  //#region src/theglobalfuel/pages/assets/AssetDetailPage.tsx
22
- var ke = [
23
- "EXPLORATION",
24
- "APPRAISAL",
25
- "DEVELOPMENT",
26
- "PRODUCING",
27
- "SUSPENDED",
28
- "DECOMMISSIONING"
29
- ], j = [
24
+ var A = [
30
25
  "BARRELS",
31
26
  "CUBIC_METERS",
32
27
  "TONNES",
@@ -34,15 +29,15 @@ var ke = [
34
29
  "MWH",
35
30
  "GJ",
36
31
  "MCF"
37
- ], Ae = [
32
+ ], Pe = [
38
33
  "PROVED",
39
34
  "PROBABLE",
40
35
  "POSSIBLE",
41
36
  "CONTINGENT",
42
37
  "PROSPECTIVE"
43
- ], M = () => (/* @__PURE__ */ new Date()).toISOString().slice(0, 10);
44
- function N() {
45
- let { id: N } = Ce(), { navigateTo: P } = e(), { data: F, isLoading: je, isError: I, refetch: Me } = re(N), L = ae({ assetId: N }), Ne = ce(), R = se(), z = oe(), B = ie(), [V, Pe] = m("production"), [H, U] = m(null), [Fe, W] = m(!1), [G, K] = m({
38
+ ], j = () => (/* @__PURE__ */ new Date()).toISOString().slice(0, 10);
39
+ function M() {
40
+ let { id: M } = Te(), { navigateTo: N } = e(), P = ue(), { data: F, isLoading: Fe, isError: I, refetch: Ie } = ie(M), L = oe({ assetId: M }), Le = le(), Re = ce(), R = se(), z = ae(), [B, ze] = m("production"), [V, H] = m(null), [Be, U] = m(!1), [W, G] = m({
46
41
  periodStart: "",
47
42
  periodEnd: "",
48
43
  volume: "",
@@ -50,7 +45,7 @@ function N() {
50
45
  grade: "",
51
46
  downtimeHours: "",
52
47
  notes: ""
53
- }), [Ie, q] = m(!1), [J, Y] = m({
48
+ }), [Ve, K] = m(!1), [q, J] = m({
54
49
  category: "PROVED",
55
50
  asOfDate: "",
56
51
  recoverable: "",
@@ -59,117 +54,152 @@ function N() {
59
54
  methodology: "",
60
55
  notes: ""
61
56
  });
62
- if (je) return /* @__PURE__ */ _(t, {
57
+ if (Fe) return /* @__PURE__ */ y(t, {
63
58
  title: "Asset",
64
- children: /* @__PURE__ */ _(d, { label: "Loading asset…" })
59
+ children: /* @__PURE__ */ y(d, { label: "Loading asset…" })
65
60
  });
66
- if (I || !F) return /* @__PURE__ */ _(t, {
61
+ if (I || !F) return /* @__PURE__ */ y(t, {
67
62
  title: "Asset",
68
- actions: /* @__PURE__ */ v(y, {
63
+ actions: /* @__PURE__ */ b(x, {
69
64
  variant: "ghost",
70
- onClick: () => P("assets"),
71
- children: [/* @__PURE__ */ _(me, { className: "mr-1.5 h-4 w-4" }), " Back"]
65
+ onClick: () => N("assets"),
66
+ children: [/* @__PURE__ */ y(h, { className: "mr-1.5 h-4 w-4" }), " Back"]
72
67
  }),
73
- children: I ? /* @__PURE__ */ _(u, {
68
+ children: I ? /* @__PURE__ */ y(re, {
74
69
  message: "This asset could not be loaded.",
75
- onRetry: () => Me()
76
- }) : /* @__PURE__ */ _(p, {
70
+ onRetry: () => Ie()
71
+ }) : /* @__PURE__ */ y(p, {
77
72
  illustration: "empty-search",
78
- icon: /* @__PURE__ */ _(_e, { className: "h-10 w-10" }),
73
+ icon: /* @__PURE__ */ y(ye, { className: "h-10 w-10" }),
79
74
  title: "Asset not found",
80
75
  description: "This asset may have been retired or you may not have access to it.",
81
- action: /* @__PURE__ */ _(y, {
82
- onClick: () => P("assets"),
76
+ action: /* @__PURE__ */ y(x, {
77
+ onClick: () => N("assets"),
83
78
  children: "Back to assets"
84
79
  })
85
80
  })
86
81
  });
87
- let X = F.productionRecords ?? [], Z = F.reserveEstimates ?? [], Q = L.data?.items ?? [], Le = F.status === "RETIRED", Re = () => {
88
- U(null), K({
89
- periodStart: M(),
90
- periodEnd: M(),
82
+ let Y = F.productionRecords ?? [], X = F.reserveEstimates ?? [], Z = L.data?.items ?? [], He = F.status === "RETIRED", Ue = fe(de, F.status), We = () => {
83
+ H(null), G({
84
+ periodStart: j(),
85
+ periodEnd: j(),
91
86
  volume: "",
92
87
  unit: F.capacityUnit,
93
88
  grade: "",
94
89
  downtimeHours: "",
95
90
  notes: ""
96
- }), W(!0);
97
- }, $ = () => {
98
- U(null), Y({
91
+ }), U(!0);
92
+ }, Ge = () => {
93
+ H(null), J({
99
94
  category: "PROVED",
100
- asOfDate: M(),
95
+ asOfDate: j(),
101
96
  recoverable: "",
102
97
  recoveryFactor: "",
103
98
  unit: F.capacityUnit,
104
99
  methodology: "",
105
100
  notes: ""
106
- }), q(!0);
107
- }, ze = async (e) => {
108
- if (!(!N || e === F.status)) {
109
- U(null);
101
+ }), K(!0);
102
+ }, Q = () => {
103
+ U(!1), H(null), G({
104
+ periodStart: "",
105
+ periodEnd: "",
106
+ volume: "",
107
+ unit: "BARRELS",
108
+ grade: "",
109
+ downtimeHours: "",
110
+ notes: ""
111
+ });
112
+ }, $ = () => {
113
+ K(!1), H(null), J({
114
+ category: "PROVED",
115
+ asOfDate: "",
116
+ recoverable: "",
117
+ recoveryFactor: "",
118
+ unit: "BARRELS",
119
+ methodology: "",
120
+ notes: ""
121
+ });
122
+ }, Ke = async (e) => {
123
+ if (!(!M || e === F.status)) {
124
+ H(null);
110
125
  try {
111
- await Ne.mutateAsync({
112
- id: N,
126
+ await Le.mutateAsync({
127
+ id: M,
113
128
  status: e
114
- });
129
+ }), P.success(`Status changed to ${i(e)}`);
115
130
  } catch (e) {
116
- U(e instanceof Error ? e.message : "Failed to change asset status.");
131
+ P.fromError(e), H(e instanceof Error ? e.message : "Failed to change asset status.");
117
132
  }
118
133
  }
119
- }, Be = async () => {
120
- if (N && window.confirm(`Retire ${F.name}? This marks the asset as decommissioned.`)) {
121
- U(null);
134
+ }, qe = async () => {
135
+ if (M && window.confirm(`Retire ${F.name}? This marks the asset as decommissioned.`)) {
136
+ H(null);
122
137
  try {
123
- await R.mutateAsync(N), P("assets");
138
+ await Re.mutateAsync(M), P.success("Asset retired"), N("assets");
124
139
  } catch (e) {
125
- U(e instanceof Error ? e.message : "Failed to retire asset.");
140
+ P.fromError(e), H(e instanceof Error ? e.message : "Failed to retire asset.");
126
141
  }
127
142
  }
128
- }, Ve = async () => {
129
- if (!N || !G.periodStart || !G.periodEnd || !G.volume) {
130
- U("Period start, period end and volume are required.");
143
+ }, Je = async () => {
144
+ let e = c(W.periodStart), t = c(W.periodEnd);
145
+ if (!M || !e || !t) {
146
+ H("Period start and period end are required.");
131
147
  return;
132
148
  }
133
- U(null);
149
+ let n = Number(W.volume);
150
+ if (!W.volume || !Number.isFinite(n) || n <= 0) {
151
+ let e = "Volume must be greater than zero.";
152
+ H(e), P.error(e);
153
+ return;
154
+ }
155
+ H(null);
134
156
  try {
135
- await z.mutateAsync({
136
- assetId: N,
137
- periodStart: new Date(G.periodStart).toISOString(),
138
- periodEnd: new Date(G.periodEnd).toISOString(),
139
- volume: Number(G.volume),
140
- unit: G.unit,
141
- grade: G.grade ? Number(G.grade) : null,
142
- downtimeHours: G.downtimeHours ? Number(G.downtimeHours) : null,
143
- notes: G.notes.trim() || null
144
- }), W(!1);
157
+ await R.mutateAsync({
158
+ assetId: M,
159
+ periodStart: e,
160
+ periodEnd: t,
161
+ volume: n,
162
+ unit: W.unit,
163
+ grade: W.grade ? Number(W.grade) : null,
164
+ downtimeHours: W.downtimeHours ? Number(W.downtimeHours) : null,
165
+ notes: W.notes.trim() || null
166
+ }), P.success("Production recorded"), Q();
145
167
  } catch (e) {
146
- U(e instanceof Error ? e.message : "Failed to record production.");
168
+ P.fromError(e), H(e instanceof Error ? e.message : "Failed to record production.");
147
169
  }
148
- }, He = async () => {
149
- if (!N || !J.asOfDate || !J.recoverable) {
150
- U("As-of date and recoverable volume are required.");
170
+ }, Ye = async () => {
171
+ let e = c(q.asOfDate);
172
+ if (!M || !e) {
173
+ H("As-of date is required.");
151
174
  return;
152
175
  }
153
- U(null);
176
+ let t = Number(q.recoverable);
177
+ if (!q.recoverable || !Number.isFinite(t) || t <= 0) {
178
+ let e = "Recoverable volume must be greater than zero.";
179
+ H(e), P.error(e);
180
+ return;
181
+ }
182
+ H(null);
154
183
  try {
155
- await B.mutateAsync({
156
- assetId: N,
157
- category: J.category,
158
- asOfDate: new Date(J.asOfDate).toISOString(),
159
- recoverable: Number(J.recoverable),
160
- recoveryFactor: J.recoveryFactor ? Number(J.recoveryFactor) : null,
161
- unit: J.unit,
162
- methodology: J.methodology.trim() || null,
163
- notes: J.notes.trim() || null
164
- }), q(!1);
184
+ await z.mutateAsync({
185
+ assetId: M,
186
+ category: q.category,
187
+ asOfDate: e,
188
+ recoverable: t,
189
+ recoveryFactor: q.recoveryFactor ? Number(q.recoveryFactor) : null,
190
+ unit: q.unit,
191
+ methodology: q.methodology.trim() || null,
192
+ notes: q.notes.trim() || null
193
+ }), P.success("Reserve estimate added"), $();
165
194
  } catch (e) {
166
- U(e instanceof Error ? e.message : "Failed to add reserve estimate.");
195
+ P.fromError(e), H(e instanceof Error ? e.message : "Failed to add reserve estimate.");
167
196
  }
168
- }, Ue = [
197
+ }, Xe = [
169
198
  {
170
199
  key: "period",
171
200
  header: "Period",
172
- render: (e) => /* @__PURE__ */ v("span", {
201
+ sortValue: (e) => new Date(e.periodEnd || e.createdAt).getTime(),
202
+ render: (e) => /* @__PURE__ */ b("span", {
173
203
  className: "font-medium text-text-primary",
174
204
  children: [
175
205
  r(e.periodStart),
@@ -183,7 +213,7 @@ function N() {
183
213
  header: "Volume",
184
214
  align: "right",
185
215
  sortValue: (e) => e.volume,
186
- render: (e) => /* @__PURE__ */ _("span", {
216
+ render: (e) => /* @__PURE__ */ y("span", {
187
217
  className: "tabular-nums font-medium text-text-primary",
188
218
  children: s(e.volume, e.unit)
189
219
  })
@@ -193,10 +223,10 @@ function N() {
193
223
  header: "Grade",
194
224
  align: "right",
195
225
  hideOnMobile: !0,
196
- render: (e) => e.grade == null ? /* @__PURE__ */ _("span", {
226
+ render: (e) => e.grade == null ? /* @__PURE__ */ y("span", {
197
227
  className: "text-text-tertiary",
198
228
  children: "—"
199
- }) : /* @__PURE__ */ _("span", {
229
+ }) : /* @__PURE__ */ y("span", {
200
230
  className: "tabular-nums text-text-secondary",
201
231
  children: a(e.grade)
202
232
  })
@@ -207,7 +237,7 @@ function N() {
207
237
  align: "right",
208
238
  hideOnMobile: !0,
209
239
  sortValue: (e) => e.downtimeHours,
210
- render: (e) => /* @__PURE__ */ v("span", {
240
+ render: (e) => /* @__PURE__ */ b("span", {
211
241
  className: "tabular-nums text-text-secondary",
212
242
  children: [a(e.downtimeHours), " h"]
213
243
  })
@@ -216,10 +246,10 @@ function N() {
216
246
  key: "notes",
217
247
  header: "Notes",
218
248
  hideOnMobile: !0,
219
- render: (e) => e.notes ? /* @__PURE__ */ _("span", {
249
+ render: (e) => e.notes ? /* @__PURE__ */ y("span", {
220
250
  className: "block max-w-[16rem] truncate text-text-secondary",
221
251
  children: e.notes
222
- }) : /* @__PURE__ */ _("span", {
252
+ }) : /* @__PURE__ */ y("span", {
223
253
  className: "text-text-tertiary",
224
254
  children: "—"
225
255
  })
@@ -229,21 +259,21 @@ function N() {
229
259
  header: "Recorded",
230
260
  align: "right",
231
261
  hideOnMobile: !0,
232
- render: (e) => /* @__PURE__ */ _("span", {
262
+ render: (e) => /* @__PURE__ */ y("span", {
233
263
  className: "text-text-tertiary",
234
264
  children: o(e.createdAt)
235
265
  })
236
266
  }
237
- ], We = [
267
+ ], Ze = [
238
268
  {
239
269
  key: "category",
240
270
  header: "Category",
241
- render: (e) => /* @__PURE__ */ _(c, { status: e.category })
271
+ render: (e) => /* @__PURE__ */ y(l, { status: e.category })
242
272
  },
243
273
  {
244
274
  key: "asOf",
245
275
  header: "As of",
246
- render: (e) => /* @__PURE__ */ _("span", {
276
+ render: (e) => /* @__PURE__ */ y("span", {
247
277
  className: "text-text-secondary",
248
278
  children: r(e.asOfDate)
249
279
  })
@@ -253,7 +283,7 @@ function N() {
253
283
  header: "Recoverable",
254
284
  align: "right",
255
285
  sortValue: (e) => e.recoverable,
256
- render: (e) => /* @__PURE__ */ _("span", {
286
+ render: (e) => /* @__PURE__ */ y("span", {
257
287
  className: "tabular-nums font-medium text-text-primary",
258
288
  children: s(e.recoverable, e.unit)
259
289
  })
@@ -263,10 +293,10 @@ function N() {
263
293
  header: "Recovery factor",
264
294
  align: "right",
265
295
  hideOnMobile: !0,
266
- render: (e) => e.recoveryFactor == null ? /* @__PURE__ */ _("span", {
296
+ render: (e) => e.recoveryFactor == null ? /* @__PURE__ */ y("span", {
267
297
  className: "text-text-tertiary",
268
298
  children: "—"
269
- }) : /* @__PURE__ */ _("span", {
299
+ }) : /* @__PURE__ */ y("span", {
270
300
  className: "tabular-nums text-text-secondary",
271
301
  children: te(e.recoveryFactor)
272
302
  })
@@ -275,10 +305,10 @@ function N() {
275
305
  key: "methodology",
276
306
  header: "Methodology",
277
307
  hideOnMobile: !0,
278
- render: (e) => e.methodology ? /* @__PURE__ */ _("span", {
308
+ render: (e) => e.methodology ? /* @__PURE__ */ y("span", {
279
309
  className: "block max-w-[14rem] truncate text-text-secondary",
280
310
  children: e.methodology
281
- }) : /* @__PURE__ */ _("span", {
311
+ }) : /* @__PURE__ */ y("span", {
282
312
  className: "text-text-tertiary",
283
313
  children: "—"
284
314
  })
@@ -288,23 +318,23 @@ function N() {
288
318
  header: "Added",
289
319
  align: "right",
290
320
  hideOnMobile: !0,
291
- render: (e) => /* @__PURE__ */ _("span", {
321
+ render: (e) => /* @__PURE__ */ y("span", {
292
322
  className: "text-text-tertiary",
293
323
  children: o(e.createdAt)
294
324
  })
295
325
  }
296
- ], Ge = [
326
+ ], Qe = [
297
327
  {
298
328
  key: "scope",
299
329
  header: "Scope",
300
- render: (e) => /* @__PURE__ */ _(c, { status: e.scope })
330
+ render: (e) => /* @__PURE__ */ y(l, { status: e.scope })
301
331
  },
302
332
  {
303
333
  key: "co2e",
304
334
  header: "CO₂e",
305
335
  align: "right",
306
336
  sortValue: (e) => e.co2eTonnes,
307
- render: (e) => /* @__PURE__ */ _("span", {
337
+ render: (e) => /* @__PURE__ */ y("span", {
308
338
  className: "tabular-nums font-medium text-text-primary",
309
339
  children: ne(e.co2eTonnes)
310
340
  })
@@ -313,7 +343,7 @@ function N() {
313
343
  key: "period",
314
344
  header: "Period",
315
345
  hideOnMobile: !0,
316
- render: (e) => /* @__PURE__ */ v("span", {
346
+ render: (e) => /* @__PURE__ */ b("span", {
317
347
  className: "text-text-secondary",
318
348
  children: [
319
349
  r(e.periodStart),
@@ -326,7 +356,7 @@ function N() {
326
356
  key: "source",
327
357
  header: "Source",
328
358
  hideOnMobile: !0,
329
- render: (e) => /* @__PURE__ */ _("span", {
359
+ render: (e) => /* @__PURE__ */ y("span", {
330
360
  className: "text-text-secondary",
331
361
  children: e.source ?? "—"
332
362
  })
@@ -334,10 +364,10 @@ function N() {
334
364
  {
335
365
  key: "verified",
336
366
  header: "Verified",
337
- render: (e) => e.verified ? /* @__PURE__ */ _("span", {
367
+ render: (e) => e.verified ? /* @__PURE__ */ y("span", {
338
368
  className: "text-sm font-medium text-status-success-text",
339
369
  children: "Verified"
340
- }) : /* @__PURE__ */ _("span", {
370
+ }) : /* @__PURE__ */ y("span", {
341
371
  className: "text-sm text-text-tertiary",
342
372
  children: "Unverified"
343
373
  })
@@ -347,138 +377,142 @@ function N() {
347
377
  header: "Recorded",
348
378
  align: "right",
349
379
  hideOnMobile: !0,
350
- render: (e) => /* @__PURE__ */ _("span", {
380
+ render: (e) => /* @__PURE__ */ y("span", {
351
381
  className: "text-text-tertiary",
352
382
  children: o(e.createdAt)
353
383
  })
354
384
  }
355
- ], Ke = [
385
+ ], $e = [
356
386
  {
357
387
  value: "production",
358
388
  label: "Production",
359
- icon: /* @__PURE__ */ _(fe, { className: "h-4 w-4" }),
360
- count: X.length
389
+ icon: /* @__PURE__ */ y(ge, { className: "h-4 w-4" }),
390
+ count: Y.length
361
391
  },
362
392
  {
363
393
  value: "reserves",
364
394
  label: "Reserves",
365
- icon: /* @__PURE__ */ _(h, { className: "h-4 w-4" }),
366
- count: Z.length
395
+ icon: /* @__PURE__ */ y(_, { className: "h-4 w-4" }),
396
+ count: X.length
367
397
  },
368
398
  {
369
399
  value: "emissions",
370
400
  label: "Emissions",
371
- icon: /* @__PURE__ */ _(ge, { className: "h-4 w-4" }),
372
- count: Q.length
401
+ icon: /* @__PURE__ */ y(g, { className: "h-4 w-4" }),
402
+ count: Z.length
373
403
  },
374
404
  {
375
405
  value: "tags",
376
406
  label: "Tags",
377
- icon: /* @__PURE__ */ _(Se, { className: "h-4 w-4" })
407
+ icon: /* @__PURE__ */ y(we, { className: "h-4 w-4" })
378
408
  },
379
409
  {
380
410
  value: "discussion",
381
411
  label: "Discussion",
382
- icon: /* @__PURE__ */ _(be, { className: "h-4 w-4" })
412
+ icon: /* @__PURE__ */ y(Se, { className: "h-4 w-4" })
383
413
  }
384
414
  ];
385
- return /* @__PURE__ */ v(t, {
415
+ return /* @__PURE__ */ b(t, {
386
416
  title: F.name,
387
417
  description: [F.code, i(F.kind)].filter(Boolean).join(" · "),
388
- actions: /* @__PURE__ */ v(we, { children: [
389
- /* @__PURE__ */ _(c, { status: F.status }),
390
- !Le && /* @__PURE__ */ v(T, {
418
+ actions: /* @__PURE__ */ b(Ee, { children: [
419
+ /* @__PURE__ */ y(l, { status: F.status }),
420
+ !He && Ue.length > 0 && /* @__PURE__ */ b(w, {
391
421
  value: F.status,
392
- onValueChange: (e) => ze(e),
393
- children: [/* @__PURE__ */ _(O, {
422
+ onValueChange: (e) => Ke(e),
423
+ children: [/* @__PURE__ */ y(D, {
394
424
  className: "h-9 w-44",
395
425
  "aria-label": "Change asset status",
396
- children: /* @__PURE__ */ _(k, { placeholder: "Change status" })
397
- }), /* @__PURE__ */ _(E, { children: ke.map((e) => /* @__PURE__ */ _(D, {
426
+ children: /* @__PURE__ */ y(O, { placeholder: "Change status" })
427
+ }), /* @__PURE__ */ b(T, { children: [/* @__PURE__ */ y(E, {
428
+ value: F.status,
429
+ disabled: !0,
430
+ children: i(F.status)
431
+ }), Ue.map((e) => /* @__PURE__ */ y(E, {
398
432
  value: e,
399
433
  children: i(e)
400
- }, e)) })]
434
+ }, e))] })]
401
435
  }),
402
- !Le && /* @__PURE__ */ v(y, {
436
+ !He && /* @__PURE__ */ b(x, {
403
437
  variant: "ghost",
404
- onClick: Be,
405
- disabled: R.isPending,
438
+ onClick: qe,
439
+ disabled: Re.isPending,
406
440
  className: "text-status-error-text hover:text-status-error-text",
407
- children: [/* @__PURE__ */ _(pe, { className: "mr-1.5 h-4 w-4" }), " Retire"]
441
+ children: [/* @__PURE__ */ y(_e, { className: "mr-1.5 h-4 w-4" }), " Retire"]
408
442
  }),
409
- /* @__PURE__ */ v(y, {
443
+ /* @__PURE__ */ b(x, {
410
444
  variant: "ghost",
411
- onClick: () => P("assets"),
412
- children: [/* @__PURE__ */ _(me, { className: "mr-1.5 h-4 w-4" }), " Back"]
445
+ onClick: () => N("assets"),
446
+ children: [/* @__PURE__ */ y(h, { className: "mr-1.5 h-4 w-4" }), " Back"]
413
447
  })
414
448
  ] }),
415
449
  children: [
416
- /* @__PURE__ */ v("div", {
450
+ /* @__PURE__ */ b("div", {
417
451
  className: "grid grid-cols-2 gap-4 sm:grid-cols-3 lg:grid-cols-5",
418
452
  children: [
419
- /* @__PURE__ */ _(n, {
420
- icon: /* @__PURE__ */ _(ve, { className: "h-5 w-5" }),
453
+ /* @__PURE__ */ y(n, {
454
+ icon: /* @__PURE__ */ y(be, { className: "h-5 w-5" }),
421
455
  value: F.capacityPerDay > 0 ? `${s(F.capacityPerDay, F.capacityUnit)}/day` : "—",
422
456
  label: "Capacity"
423
457
  }),
424
- /* @__PURE__ */ _(n, {
425
- icon: /* @__PURE__ */ _(xe, { className: "h-5 w-5" }),
458
+ /* @__PURE__ */ y(n, {
459
+ icon: /* @__PURE__ */ y(Ce, { className: "h-5 w-5" }),
426
460
  value: te(F.workingInterestPct),
427
461
  label: "Working interest"
428
462
  }),
429
- /* @__PURE__ */ _(n, {
430
- icon: /* @__PURE__ */ _(_e, { className: "h-5 w-5" }),
463
+ /* @__PURE__ */ y(n, {
464
+ icon: /* @__PURE__ */ y(ye, { className: "h-5 w-5" }),
431
465
  value: i(F.commodity),
432
466
  label: "Commodity"
433
467
  }),
434
- /* @__PURE__ */ _(n, {
435
- icon: /* @__PURE__ */ _(he, { className: "h-5 w-5" }),
468
+ /* @__PURE__ */ y(n, {
469
+ icon: /* @__PURE__ */ y(ve, { className: "h-5 w-5" }),
436
470
  value: r(F.commissionedAt),
437
471
  label: "Commissioned"
438
472
  }),
439
- /* @__PURE__ */ _(n, {
440
- icon: /* @__PURE__ */ _(ye, { className: "h-5 w-5" }),
473
+ /* @__PURE__ */ y(n, {
474
+ icon: /* @__PURE__ */ y(xe, { className: "h-5 w-5" }),
441
475
  value: ee(F.latitude, F.longitude),
442
476
  label: "Location",
443
- footer: F.location ? /* @__PURE__ */ _("p", {
477
+ footer: F.location ? /* @__PURE__ */ y("p", {
444
478
  className: "truncate text-xs text-text-tertiary",
445
479
  children: F.location
446
480
  }) : void 0
447
481
  })
448
482
  ]
449
483
  }),
450
- H && /* @__PURE__ */ _("p", {
484
+ V && /* @__PURE__ */ y("p", {
451
485
  className: "mt-4 text-sm text-status-error-text",
452
- children: H
486
+ children: V
453
487
  }),
454
- /* @__PURE__ */ _("div", {
488
+ /* @__PURE__ */ y("div", {
455
489
  className: "mt-6",
456
- children: /* @__PURE__ */ _(le, {
457
- items: Ke,
458
- value: V,
459
- onChange: Pe
490
+ children: /* @__PURE__ */ y(pe, {
491
+ items: $e,
492
+ value: B,
493
+ onChange: ze
460
494
  })
461
495
  }),
462
- V === "production" && /* @__PURE__ */ _(f, {
496
+ B === "production" && /* @__PURE__ */ y(f, {
463
497
  title: "Production",
464
498
  description: "Volumes produced per reporting period, with grade & downtime.",
465
- action: /* @__PURE__ */ v(y, {
499
+ action: /* @__PURE__ */ b(x, {
466
500
  size: "sm",
467
- onClick: Re,
468
- children: [/* @__PURE__ */ _(g, { className: "mr-1.5 h-4 w-4" }), " Record production"]
501
+ onClick: We,
502
+ children: [/* @__PURE__ */ y(v, { className: "mr-1.5 h-4 w-4" }), " Record production"]
469
503
  }),
470
- children: X.length === 0 ? /* @__PURE__ */ _(p, {
504
+ children: Y.length === 0 ? /* @__PURE__ */ y(p, {
471
505
  illustration: "empty-data",
472
- icon: /* @__PURE__ */ _(fe, { className: "h-10 w-10" }),
506
+ icon: /* @__PURE__ */ y(ge, { className: "h-10 w-10" }),
473
507
  title: "No production recorded",
474
508
  description: "Record a production period to start tracking volumes for this asset.",
475
- action: /* @__PURE__ */ v(y, {
476
- onClick: Re,
477
- children: [/* @__PURE__ */ _(g, { className: "mr-1.5 h-4 w-4" }), " Record production"]
509
+ action: /* @__PURE__ */ b(x, {
510
+ onClick: We,
511
+ children: [/* @__PURE__ */ y(v, { className: "mr-1.5 h-4 w-4" }), " Record production"]
478
512
  })
479
- }) : /* @__PURE__ */ _(l, {
480
- columns: Ue,
481
- rows: X,
513
+ }) : /* @__PURE__ */ y(u, {
514
+ columns: Xe,
515
+ rows: Y,
482
516
  rowKey: (e) => e.id,
483
517
  defaultSort: {
484
518
  key: "period",
@@ -486,325 +520,335 @@ function N() {
486
520
  }
487
521
  })
488
522
  }),
489
- V === "reserves" && /* @__PURE__ */ _(f, {
523
+ B === "reserves" && /* @__PURE__ */ y(f, {
490
524
  title: "Reserve estimates",
491
525
  description: "Recoverable volumes by SPE-PRMS reserve category & as-of date.",
492
- action: /* @__PURE__ */ v(y, {
526
+ action: /* @__PURE__ */ b(x, {
493
527
  size: "sm",
494
- onClick: $,
495
- children: [/* @__PURE__ */ _(g, { className: "mr-1.5 h-4 w-4" }), " Add reserve estimate"]
528
+ onClick: Ge,
529
+ children: [/* @__PURE__ */ y(v, { className: "mr-1.5 h-4 w-4" }), " Add reserve estimate"]
496
530
  }),
497
- children: Z.length === 0 ? /* @__PURE__ */ _(p, {
531
+ children: X.length === 0 ? /* @__PURE__ */ y(p, {
498
532
  illustration: "empty-data",
499
- icon: /* @__PURE__ */ _(h, { className: "h-10 w-10" }),
533
+ icon: /* @__PURE__ */ y(_, { className: "h-10 w-10" }),
500
534
  title: "No reserve estimates",
501
535
  description: "Add a reserve estimate to record recoverable volumes for this asset.",
502
- action: /* @__PURE__ */ v(y, {
503
- onClick: $,
504
- children: [/* @__PURE__ */ _(g, { className: "mr-1.5 h-4 w-4" }), " Add reserve estimate"]
536
+ action: /* @__PURE__ */ b(x, {
537
+ onClick: Ge,
538
+ children: [/* @__PURE__ */ y(v, { className: "mr-1.5 h-4 w-4" }), " Add reserve estimate"]
505
539
  })
506
- }) : /* @__PURE__ */ _(l, {
507
- columns: We,
508
- rows: Z,
540
+ }) : /* @__PURE__ */ y(u, {
541
+ columns: Ze,
542
+ rows: X,
509
543
  rowKey: (e) => e.id
510
544
  })
511
545
  }),
512
- V === "emissions" && /* @__PURE__ */ _(f, {
546
+ B === "emissions" && /* @__PURE__ */ y(f, {
513
547
  title: "Emissions",
514
548
  description: "GHG emission records attributed to this asset (Scope 1 / 2 / 3).",
515
- children: L.isLoading ? /* @__PURE__ */ _(d, { label: "Loading emissions…" }) : L.isError ? /* @__PURE__ */ _(u, {
549
+ children: L.isLoading ? /* @__PURE__ */ y(d, { label: "Loading emissions…" }) : L.isError ? /* @__PURE__ */ y(re, {
516
550
  message: "Couldn't load emission records.",
517
551
  onRetry: () => L.refetch()
518
- }) : Q.length === 0 ? /* @__PURE__ */ _(p, {
552
+ }) : Z.length === 0 ? /* @__PURE__ */ y(p, {
519
553
  illustration: "empty-data",
520
- icon: /* @__PURE__ */ _(ge, { className: "h-10 w-10" }),
554
+ icon: /* @__PURE__ */ y(g, { className: "h-10 w-10" }),
521
555
  title: "No emissions recorded",
522
556
  description: "Emission records attributed to this asset will appear here."
523
- }) : /* @__PURE__ */ _(l, {
524
- columns: Ge,
525
- rows: Q,
557
+ }) : /* @__PURE__ */ y(u, {
558
+ columns: Qe,
559
+ rows: Z,
526
560
  rowKey: (e) => e.id
527
561
  })
528
562
  }),
529
- V === "tags" && /* @__PURE__ */ _(f, {
563
+ B === "tags" && /* @__PURE__ */ y(f, {
530
564
  title: "Tags",
531
565
  description: "Label this asset for search, grouping & reporting.",
532
- children: /* @__PURE__ */ _(Te, {
566
+ children: /* @__PURE__ */ y(De, {
533
567
  treatment: "glass",
534
568
  className: "p-6",
535
- children: /* @__PURE__ */ _(de, {
569
+ children: /* @__PURE__ */ y(he, {
536
570
  entityType: "theglobalfuel-asset",
537
571
  entityId: F.id
538
572
  })
539
573
  })
540
574
  }),
541
- V === "discussion" && /* @__PURE__ */ _("div", {
575
+ B === "discussion" && /* @__PURE__ */ y("div", {
542
576
  className: "mt-8",
543
- children: /* @__PURE__ */ _(ue, {
577
+ children: /* @__PURE__ */ y(me, {
544
578
  entityType: "theglobalfuel-asset",
545
579
  entityId: F.id,
546
580
  title: "Discussion",
547
581
  description: "Notes & coordination for this asset."
548
582
  })
549
583
  }),
550
- /* @__PURE__ */ _(S, {
551
- open: Fe,
552
- onOpenChange: W,
553
- children: /* @__PURE__ */ v(C, { children: [
554
- /* @__PURE__ */ v(Oe, { children: [/* @__PURE__ */ _(w, { children: "Record production" }), /* @__PURE__ */ v(Ee, { children: [
584
+ /* @__PURE__ */ y(Oe, {
585
+ open: Be,
586
+ onOpenChange: (e) => e ? U(!0) : Q(),
587
+ children: /* @__PURE__ */ b(ke, { children: [
588
+ /* @__PURE__ */ b(Me, { children: [/* @__PURE__ */ y(Ne, { children: "Record production" }), /* @__PURE__ */ b(Ae, { children: [
555
589
  "Log a production period for ",
556
590
  F.name,
557
591
  "."
558
592
  ] })] }),
559
- /* @__PURE__ */ v("div", {
593
+ /* @__PURE__ */ b("form", {
594
+ id: "recordProductionForm",
595
+ onSubmit: (e) => {
596
+ e.preventDefault(), Je();
597
+ },
560
598
  className: "grid gap-4 py-2",
561
599
  children: [
562
- /* @__PURE__ */ v("div", {
600
+ /* @__PURE__ */ b("div", {
563
601
  className: "grid gap-2 sm:grid-cols-2",
564
- children: [/* @__PURE__ */ v("div", {
602
+ children: [/* @__PURE__ */ b("div", {
565
603
  className: "grid gap-1.5",
566
- children: [/* @__PURE__ */ _(x, {
604
+ children: [/* @__PURE__ */ y(C, {
567
605
  htmlFor: "prodStart",
568
606
  children: "Period start *"
569
- }), /* @__PURE__ */ _(b, {
607
+ }), /* @__PURE__ */ y(S, {
570
608
  id: "prodStart",
571
609
  type: "date",
572
- value: G.periodStart,
573
- onChange: (e) => K({
574
- ...G,
610
+ value: W.periodStart,
611
+ onChange: (e) => G({
612
+ ...W,
575
613
  periodStart: e.target.value
576
614
  })
577
615
  })]
578
- }), /* @__PURE__ */ v("div", {
616
+ }), /* @__PURE__ */ b("div", {
579
617
  className: "grid gap-1.5",
580
- children: [/* @__PURE__ */ _(x, {
618
+ children: [/* @__PURE__ */ y(C, {
581
619
  htmlFor: "prodEnd",
582
620
  children: "Period end *"
583
- }), /* @__PURE__ */ _(b, {
621
+ }), /* @__PURE__ */ y(S, {
584
622
  id: "prodEnd",
585
623
  type: "date",
586
- value: G.periodEnd,
587
- onChange: (e) => K({
588
- ...G,
624
+ value: W.periodEnd,
625
+ onChange: (e) => G({
626
+ ...W,
589
627
  periodEnd: e.target.value
590
628
  })
591
629
  })]
592
630
  })]
593
631
  }),
594
- /* @__PURE__ */ v("div", {
632
+ /* @__PURE__ */ b("div", {
595
633
  className: "grid gap-2 sm:grid-cols-2",
596
- children: [/* @__PURE__ */ v("div", {
634
+ children: [/* @__PURE__ */ b("div", {
597
635
  className: "grid gap-1.5",
598
- children: [/* @__PURE__ */ _(x, {
636
+ children: [/* @__PURE__ */ y(C, {
599
637
  htmlFor: "prodVolume",
600
638
  children: "Volume *"
601
- }), /* @__PURE__ */ _(b, {
639
+ }), /* @__PURE__ */ y(S, {
602
640
  id: "prodVolume",
603
641
  type: "number",
604
642
  min: "0",
605
643
  step: "any",
606
- value: G.volume,
607
- onChange: (e) => K({
608
- ...G,
644
+ value: W.volume,
645
+ onChange: (e) => G({
646
+ ...W,
609
647
  volume: e.target.value
610
648
  }),
611
649
  placeholder: "118500"
612
650
  })]
613
- }), /* @__PURE__ */ v("div", {
651
+ }), /* @__PURE__ */ b("div", {
614
652
  className: "grid gap-1.5",
615
- children: [/* @__PURE__ */ _(x, {
653
+ children: [/* @__PURE__ */ y(C, {
616
654
  htmlFor: "prodUnit",
617
655
  children: "Unit"
618
- }), /* @__PURE__ */ v(T, {
619
- value: G.unit,
620
- onValueChange: (e) => K({
621
- ...G,
656
+ }), /* @__PURE__ */ b(w, {
657
+ value: W.unit,
658
+ onValueChange: (e) => G({
659
+ ...W,
622
660
  unit: e
623
661
  }),
624
- children: [/* @__PURE__ */ _(O, {
662
+ children: [/* @__PURE__ */ y(D, {
625
663
  id: "prodUnit",
626
- children: /* @__PURE__ */ _(k, {})
627
- }), /* @__PURE__ */ _(E, { children: j.map((e) => /* @__PURE__ */ _(D, {
664
+ children: /* @__PURE__ */ y(O, {})
665
+ }), /* @__PURE__ */ y(T, { children: A.map((e) => /* @__PURE__ */ y(E, {
628
666
  value: e,
629
667
  children: i(e)
630
668
  }, e)) })]
631
669
  })]
632
670
  })]
633
671
  }),
634
- /* @__PURE__ */ v("div", {
672
+ /* @__PURE__ */ b("div", {
635
673
  className: "grid gap-2 sm:grid-cols-2",
636
- children: [/* @__PURE__ */ v("div", {
674
+ children: [/* @__PURE__ */ b("div", {
637
675
  className: "grid gap-1.5",
638
- children: [/* @__PURE__ */ _(x, {
676
+ children: [/* @__PURE__ */ y(C, {
639
677
  htmlFor: "prodGrade",
640
678
  children: "Grade"
641
- }), /* @__PURE__ */ _(b, {
679
+ }), /* @__PURE__ */ y(S, {
642
680
  id: "prodGrade",
643
681
  type: "number",
644
682
  step: "any",
645
- value: G.grade,
646
- onChange: (e) => K({
647
- ...G,
683
+ value: W.grade,
684
+ onChange: (e) => G({
685
+ ...W,
648
686
  grade: e.target.value
649
687
  }),
650
688
  placeholder: "Optional (e.g. API / assay)"
651
689
  })]
652
- }), /* @__PURE__ */ v("div", {
690
+ }), /* @__PURE__ */ b("div", {
653
691
  className: "grid gap-1.5",
654
- children: [/* @__PURE__ */ _(x, {
692
+ children: [/* @__PURE__ */ y(C, {
655
693
  htmlFor: "prodDowntime",
656
694
  children: "Downtime (hours)"
657
- }), /* @__PURE__ */ _(b, {
695
+ }), /* @__PURE__ */ y(S, {
658
696
  id: "prodDowntime",
659
697
  type: "number",
660
698
  min: "0",
661
699
  step: "any",
662
- value: G.downtimeHours,
663
- onChange: (e) => K({
664
- ...G,
700
+ value: W.downtimeHours,
701
+ onChange: (e) => G({
702
+ ...W,
665
703
  downtimeHours: e.target.value
666
704
  }),
667
705
  placeholder: "0"
668
706
  })]
669
707
  })]
670
708
  }),
671
- /* @__PURE__ */ v("div", {
709
+ /* @__PURE__ */ b("div", {
672
710
  className: "grid gap-1.5",
673
- children: [/* @__PURE__ */ _(x, {
711
+ children: [/* @__PURE__ */ y(C, {
674
712
  htmlFor: "prodNotes",
675
713
  children: "Notes"
676
- }), /* @__PURE__ */ _(A, {
714
+ }), /* @__PURE__ */ y(k, {
677
715
  id: "prodNotes",
678
716
  rows: 2,
679
- value: G.notes,
680
- onChange: (e) => K({
681
- ...G,
717
+ value: W.notes,
718
+ onChange: (e) => G({
719
+ ...W,
682
720
  notes: e.target.value
683
721
  }),
684
722
  placeholder: "Optional context about this period."
685
723
  })]
686
724
  }),
687
- H && Fe && /* @__PURE__ */ _("p", {
725
+ V && Be && /* @__PURE__ */ y("p", {
688
726
  className: "text-sm text-status-error-text",
689
- children: H
727
+ children: V
690
728
  })
691
729
  ]
692
730
  }),
693
- /* @__PURE__ */ v(De, { children: [/* @__PURE__ */ _(y, {
731
+ /* @__PURE__ */ b(je, { children: [/* @__PURE__ */ y(x, {
694
732
  variant: "outline",
695
- onClick: () => W(!1),
733
+ type: "button",
734
+ onClick: Q,
696
735
  children: "Cancel"
697
- }), /* @__PURE__ */ _(y, {
698
- onClick: Ve,
699
- disabled: z.isPending,
700
- children: z.isPending ? "Recording…" : "Record production"
736
+ }), /* @__PURE__ */ y(x, {
737
+ type: "submit",
738
+ form: "recordProductionForm",
739
+ disabled: R.isPending,
740
+ children: R.isPending ? "Recording…" : "Record production"
701
741
  })] })
702
742
  ] })
703
743
  }),
704
- /* @__PURE__ */ _(S, {
705
- open: Ie,
706
- onOpenChange: q,
707
- children: /* @__PURE__ */ v(C, { children: [
708
- /* @__PURE__ */ v(Oe, { children: [/* @__PURE__ */ _(w, { children: "Add reserve estimate" }), /* @__PURE__ */ v(Ee, { children: [
744
+ /* @__PURE__ */ y(Oe, {
745
+ open: Ve,
746
+ onOpenChange: (e) => e ? K(!0) : $(),
747
+ children: /* @__PURE__ */ b(ke, { children: [
748
+ /* @__PURE__ */ b(Me, { children: [/* @__PURE__ */ y(Ne, { children: "Add reserve estimate" }), /* @__PURE__ */ b(Ae, { children: [
709
749
  "Record a recoverable-volume estimate for ",
710
750
  F.name,
711
751
  "."
712
752
  ] })] }),
713
- /* @__PURE__ */ v("div", {
753
+ /* @__PURE__ */ b("form", {
754
+ id: "reserveEstimateForm",
755
+ onSubmit: (e) => {
756
+ e.preventDefault(), Ye();
757
+ },
714
758
  className: "grid gap-4 py-2",
715
759
  children: [
716
- /* @__PURE__ */ v("div", {
760
+ /* @__PURE__ */ b("div", {
717
761
  className: "grid gap-2 sm:grid-cols-2",
718
- children: [/* @__PURE__ */ v("div", {
762
+ children: [/* @__PURE__ */ b("div", {
719
763
  className: "grid gap-1.5",
720
- children: [/* @__PURE__ */ _(x, {
764
+ children: [/* @__PURE__ */ y(C, {
721
765
  htmlFor: "resCategory",
722
766
  children: "Category"
723
- }), /* @__PURE__ */ v(T, {
724
- value: J.category,
725
- onValueChange: (e) => Y({
726
- ...J,
767
+ }), /* @__PURE__ */ b(w, {
768
+ value: q.category,
769
+ onValueChange: (e) => J({
770
+ ...q,
727
771
  category: e
728
772
  }),
729
- children: [/* @__PURE__ */ _(O, {
773
+ children: [/* @__PURE__ */ y(D, {
730
774
  id: "resCategory",
731
- children: /* @__PURE__ */ _(k, {})
732
- }), /* @__PURE__ */ _(E, { children: Ae.map((e) => /* @__PURE__ */ _(D, {
775
+ children: /* @__PURE__ */ y(O, {})
776
+ }), /* @__PURE__ */ y(T, { children: Pe.map((e) => /* @__PURE__ */ y(E, {
733
777
  value: e,
734
778
  children: i(e)
735
779
  }, e)) })]
736
780
  })]
737
- }), /* @__PURE__ */ v("div", {
781
+ }), /* @__PURE__ */ b("div", {
738
782
  className: "grid gap-1.5",
739
- children: [/* @__PURE__ */ _(x, {
783
+ children: [/* @__PURE__ */ y(C, {
740
784
  htmlFor: "resAsOf",
741
785
  children: "As-of date *"
742
- }), /* @__PURE__ */ _(b, {
786
+ }), /* @__PURE__ */ y(S, {
743
787
  id: "resAsOf",
744
788
  type: "date",
745
- value: J.asOfDate,
746
- onChange: (e) => Y({
747
- ...J,
789
+ value: q.asOfDate,
790
+ onChange: (e) => J({
791
+ ...q,
748
792
  asOfDate: e.target.value
749
793
  })
750
794
  })]
751
795
  })]
752
796
  }),
753
- /* @__PURE__ */ v("div", {
797
+ /* @__PURE__ */ b("div", {
754
798
  className: "grid gap-2 sm:grid-cols-3",
755
799
  children: [
756
- /* @__PURE__ */ v("div", {
800
+ /* @__PURE__ */ b("div", {
757
801
  className: "grid gap-1.5",
758
- children: [/* @__PURE__ */ _(x, {
802
+ children: [/* @__PURE__ */ y(C, {
759
803
  htmlFor: "resRecoverable",
760
804
  children: "Recoverable *"
761
- }), /* @__PURE__ */ _(b, {
805
+ }), /* @__PURE__ */ y(S, {
762
806
  id: "resRecoverable",
763
807
  type: "number",
764
808
  min: "0",
765
809
  step: "any",
766
- value: J.recoverable,
767
- onChange: (e) => Y({
768
- ...J,
810
+ value: q.recoverable,
811
+ onChange: (e) => J({
812
+ ...q,
769
813
  recoverable: e.target.value
770
814
  }),
771
815
  placeholder: "2400000"
772
816
  })]
773
817
  }),
774
- /* @__PURE__ */ v("div", {
818
+ /* @__PURE__ */ b("div", {
775
819
  className: "grid gap-1.5",
776
- children: [/* @__PURE__ */ _(x, {
820
+ children: [/* @__PURE__ */ y(C, {
777
821
  htmlFor: "resUnit",
778
822
  children: "Unit"
779
- }), /* @__PURE__ */ v(T, {
780
- value: J.unit,
781
- onValueChange: (e) => Y({
782
- ...J,
823
+ }), /* @__PURE__ */ b(w, {
824
+ value: q.unit,
825
+ onValueChange: (e) => J({
826
+ ...q,
783
827
  unit: e
784
828
  }),
785
- children: [/* @__PURE__ */ _(O, {
829
+ children: [/* @__PURE__ */ y(D, {
786
830
  id: "resUnit",
787
- children: /* @__PURE__ */ _(k, {})
788
- }), /* @__PURE__ */ _(E, { children: j.map((e) => /* @__PURE__ */ _(D, {
831
+ children: /* @__PURE__ */ y(O, {})
832
+ }), /* @__PURE__ */ y(T, { children: A.map((e) => /* @__PURE__ */ y(E, {
789
833
  value: e,
790
834
  children: i(e)
791
835
  }, e)) })]
792
836
  })]
793
837
  }),
794
- /* @__PURE__ */ v("div", {
838
+ /* @__PURE__ */ b("div", {
795
839
  className: "grid gap-1.5",
796
- children: [/* @__PURE__ */ _(x, {
840
+ children: [/* @__PURE__ */ y(C, {
797
841
  htmlFor: "resFactor",
798
842
  children: "Recovery factor (%)"
799
- }), /* @__PURE__ */ _(b, {
843
+ }), /* @__PURE__ */ y(S, {
800
844
  id: "resFactor",
801
845
  type: "number",
802
846
  min: "0",
803
847
  max: "100",
804
848
  step: "any",
805
- value: J.recoveryFactor,
806
- onChange: (e) => Y({
807
- ...J,
849
+ value: q.recoveryFactor,
850
+ onChange: (e) => J({
851
+ ...q,
808
852
  recoveryFactor: e.target.value
809
853
  }),
810
854
  placeholder: "35"
@@ -812,51 +856,53 @@ function N() {
812
856
  })
813
857
  ]
814
858
  }),
815
- /* @__PURE__ */ v("div", {
859
+ /* @__PURE__ */ b("div", {
816
860
  className: "grid gap-1.5",
817
- children: [/* @__PURE__ */ _(x, {
861
+ children: [/* @__PURE__ */ y(C, {
818
862
  htmlFor: "resMethodology",
819
863
  children: "Methodology"
820
- }), /* @__PURE__ */ _(b, {
864
+ }), /* @__PURE__ */ y(S, {
821
865
  id: "resMethodology",
822
- value: J.methodology,
823
- onChange: (e) => Y({
824
- ...J,
866
+ value: q.methodology,
867
+ onChange: (e) => J({
868
+ ...q,
825
869
  methodology: e.target.value
826
870
  }),
827
871
  placeholder: "Volumetric / material balance / decline curve"
828
872
  })]
829
873
  }),
830
- /* @__PURE__ */ v("div", {
874
+ /* @__PURE__ */ b("div", {
831
875
  className: "grid gap-1.5",
832
- children: [/* @__PURE__ */ _(x, {
876
+ children: [/* @__PURE__ */ y(C, {
833
877
  htmlFor: "resNotes",
834
878
  children: "Notes"
835
- }), /* @__PURE__ */ _(A, {
879
+ }), /* @__PURE__ */ y(k, {
836
880
  id: "resNotes",
837
881
  rows: 2,
838
- value: J.notes,
839
- onChange: (e) => Y({
840
- ...J,
882
+ value: q.notes,
883
+ onChange: (e) => J({
884
+ ...q,
841
885
  notes: e.target.value
842
886
  }),
843
887
  placeholder: "Optional context about this estimate."
844
888
  })]
845
889
  }),
846
- H && Ie && /* @__PURE__ */ _("p", {
890
+ V && Ve && /* @__PURE__ */ y("p", {
847
891
  className: "text-sm text-status-error-text",
848
- children: H
892
+ children: V
849
893
  })
850
894
  ]
851
895
  }),
852
- /* @__PURE__ */ v(De, { children: [/* @__PURE__ */ _(y, {
896
+ /* @__PURE__ */ b(je, { children: [/* @__PURE__ */ y(x, {
853
897
  variant: "outline",
854
- onClick: () => q(!1),
898
+ type: "button",
899
+ onClick: $,
855
900
  children: "Cancel"
856
- }), /* @__PURE__ */ _(y, {
857
- onClick: He,
858
- disabled: B.isPending,
859
- children: B.isPending ? "Adding…" : "Add estimate"
901
+ }), /* @__PURE__ */ y(x, {
902
+ type: "submit",
903
+ form: "reserveEstimateForm",
904
+ disabled: z.isPending,
905
+ children: z.isPending ? "Adding…" : "Add estimate"
860
906
  })] })
861
907
  ] })
862
908
  })
@@ -864,6 +910,6 @@ function N() {
864
910
  });
865
911
  }
866
912
  //#endregion
867
- export { N as AssetDetailPage };
913
+ export { M as AssetDetailPage };
868
914
 
869
915
  //# sourceMappingURL=AssetDetailPage.js.map