@burdenoff/microfe-ecoimpacthub 2026.819.4 → 2026.830.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.
Files changed (51) hide show
  1. package/dist/ecoimpacthub/hooks/index.d.ts +2 -0
  2. package/dist/ecoimpacthub/hooks/index.d.ts.map +1 -1
  3. package/dist/ecoimpacthub/hooks/index.js +2 -0
  4. package/dist/ecoimpacthub/hooks/useActiveEcoEntity.d.ts +11 -0
  5. package/dist/ecoimpacthub/hooks/useActiveEcoEntity.d.ts.map +1 -0
  6. package/dist/ecoimpacthub/hooks/useActiveEcoEntity.js +21 -0
  7. package/dist/ecoimpacthub/hooks/useActiveEcoEntity.js.map +1 -0
  8. package/dist/ecoimpacthub/hooks/useTr.d.ts +4 -0
  9. package/dist/ecoimpacthub/hooks/useTr.d.ts.map +1 -0
  10. package/dist/ecoimpacthub/hooks/useTr.js +20 -0
  11. package/dist/ecoimpacthub/hooks/useTr.js.map +1 -0
  12. package/dist/ecoimpacthub/pages/DashboardPage.d.ts.map +1 -1
  13. package/dist/ecoimpacthub/pages/DashboardPage.js +162 -138
  14. package/dist/ecoimpacthub/pages/DashboardPage.js.map +1 -1
  15. package/dist/ecoimpacthub/pages/_shared/MethodPicker.d.ts +15 -0
  16. package/dist/ecoimpacthub/pages/_shared/MethodPicker.d.ts.map +1 -0
  17. package/dist/ecoimpacthub/pages/_shared/MethodPicker.js +36 -0
  18. package/dist/ecoimpacthub/pages/_shared/MethodPicker.js.map +1 -0
  19. package/dist/ecoimpacthub/pages/_shared/UseMyLocationButton.d.ts +15 -0
  20. package/dist/ecoimpacthub/pages/_shared/UseMyLocationButton.d.ts.map +1 -0
  21. package/dist/ecoimpacthub/pages/_shared/UseMyLocationButton.js +66 -0
  22. package/dist/ecoimpacthub/pages/_shared/UseMyLocationButton.js.map +1 -0
  23. package/dist/ecoimpacthub/pages/habitat/HabitatProjectDetailPage.d.ts.map +1 -1
  24. package/dist/ecoimpacthub/pages/habitat/HabitatProjectDetailPage.js +127 -124
  25. package/dist/ecoimpacthub/pages/habitat/HabitatProjectDetailPage.js.map +1 -1
  26. package/dist/ecoimpacthub/pages/observations/ObservationsPage.d.ts.map +1 -1
  27. package/dist/ecoimpacthub/pages/observations/ObservationsPage.js +226 -224
  28. package/dist/ecoimpacthub/pages/observations/ObservationsPage.js.map +1 -1
  29. package/dist/ecoimpacthub/pages/reports/ReportDetailPage.d.ts.map +1 -1
  30. package/dist/ecoimpacthub/pages/reports/ReportDetailPage.js +159 -156
  31. package/dist/ecoimpacthub/pages/reports/ReportDetailPage.js.map +1 -1
  32. package/dist/ecoimpacthub/pages/sites/SiteDetailPage.d.ts.map +1 -1
  33. package/dist/ecoimpacthub/pages/sites/SiteDetailPage.js +40 -37
  34. package/dist/ecoimpacthub/pages/sites/SiteDetailPage.js.map +1 -1
  35. package/dist/ecoimpacthub/pages/sites/SitesPage.d.ts.map +1 -1
  36. package/dist/ecoimpacthub/pages/sites/SitesPage.js +208 -171
  37. package/dist/ecoimpacthub/pages/sites/SitesPage.js.map +1 -1
  38. package/dist/ecoimpacthub/pages/species/SpeciesDetailPage.d.ts.map +1 -1
  39. package/dist/ecoimpacthub/pages/species/SpeciesDetailPage.js +211 -214
  40. package/dist/ecoimpacthub/pages/species/SpeciesDetailPage.js.map +1 -1
  41. package/dist/ecoimpacthub/pages/species/SpeciesPage.d.ts.map +1 -1
  42. package/dist/ecoimpacthub/pages/species/SpeciesPage.js +174 -157
  43. package/dist/ecoimpacthub/pages/species/SpeciesPage.js.map +1 -1
  44. package/dist/ecoimpacthub/utils/activeEntity.d.ts +30 -0
  45. package/dist/ecoimpacthub/utils/activeEntity.d.ts.map +1 -0
  46. package/dist/ecoimpacthub/utils/activeEntity.js +12 -0
  47. package/dist/ecoimpacthub/utils/activeEntity.js.map +1 -0
  48. package/dist/ecoimpacthub/utils/pageContext.d.ts.map +1 -1
  49. package/dist/ecoimpacthub/utils/pageContext.js +30 -25
  50. package/dist/ecoimpacthub/utils/pageContext.js.map +1 -1
  51. package/package.json +1 -1
@@ -6,218 +6,221 @@ import { ErrorView as a, LoadingView as o, Section as s } from "../../components
6
6
  import { EmptyState as c } from "../../components/EmptyState.js";
7
7
  import "../../context/index.js";
8
8
  import { useEcoAddReportLineItem as l, useEcoPublishReport as u, useEcoReport as d } from "../../hooks/useEcoImpactHubApi.js";
9
+ import { useActiveEcoEntity as f } from "../../hooks/useActiveEcoEntity.js";
9
10
  import "../../hooks/index.js";
10
- import { FrameworkBadge as f } from "../badges.js";
11
- import { EvidenceUpload as p } from "../../components/EvidenceUpload.js";
12
- import { FileLink as m } from "../../components/FileLink.js";
13
- import { EcoDiscussion as h } from "../../components/EcoDiscussion.js";
14
- import { useMemo as g, useState as _ } from "react";
15
- import { ArrowLeft as v, ListPlus as y, Send as b } from "lucide-react";
16
- import { useParams as x } from "react-router";
17
- import { Fragment as S, jsx as C, jsxs as w } from "react/jsx-runtime";
18
- import { Button as T, GlassCard as E, Input as D, Label as O, ResponsiveDialog as k, ResponsiveDialogContent as ee, ResponsiveDialogDescription as A, ResponsiveDialogFooter as j, ResponsiveDialogHeader as M, ResponsiveDialogTitle as N } from "@burdenoff/fe-libs/ui";
11
+ import { FrameworkBadge as p } from "../badges.js";
12
+ import { EvidenceUpload as m } from "../../components/EvidenceUpload.js";
13
+ import { FileLink as h } from "../../components/FileLink.js";
14
+ import { EcoDiscussion as g } from "../../components/EcoDiscussion.js";
15
+ import { useMemo as _, useState as v } from "react";
16
+ import { ArrowLeft as y, ListPlus as b, Send as x } from "lucide-react";
17
+ import { useParams as S } from "react-router";
18
+ import { Fragment as C, jsx as w, jsxs as T } from "react/jsx-runtime";
19
+ import { Button as E, GlassCard as D, Input as O, Label as k, ResponsiveDialog as A, ResponsiveDialogContent as ee, ResponsiveDialogDescription as j, ResponsiveDialogFooter as M, ResponsiveDialogHeader as N, ResponsiveDialogTitle as P } from "@burdenoff/fe-libs/ui";
19
20
  //#region src/ecoimpacthub/pages/reports/ReportDetailPage.tsx
20
- function P({ label: e, children: t }) {
21
- return /* @__PURE__ */ w("div", { children: [/* @__PURE__ */ C("dt", {
21
+ function F({ label: e, children: t }) {
22
+ return /* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("dt", {
22
23
  className: "text-xs text-text-tertiary",
23
24
  children: e
24
- }), /* @__PURE__ */ C("dd", {
25
+ }), /* @__PURE__ */ w("dd", {
25
26
  className: "mt-1 text-sm text-text-primary",
26
27
  children: t
27
28
  })] });
28
29
  }
29
- function F() {
30
- let { id: F } = x(), { navigateTo: I } = e(), { data: L, isLoading: R, isError: z, refetch: B } = d(F), V = l(), H = u(), [U, W] = _(!1), [G, K] = _({
30
+ function I() {
31
+ let { id: I } = S(), { navigateTo: L } = e(), { data: R, isLoading: z, isError: B, refetch: V } = d(I);
32
+ f(R?.id, R?.title);
33
+ let H = l(), U = u(), [W, G] = v(!1), [K, q] = v({
31
34
  label: "",
32
35
  value: "",
33
36
  unit: "",
34
37
  category: "",
35
38
  carbonEntryId: ""
36
- }), [q, J] = _(null), [Y, X] = _(null), Z = g(() => L?.lineItems ?? [], [L]), Q = g(() => Z.reduce((e, t) => e + t.value, 0), [Z]), $ = g(() => {
37
- let e = new Set(Z.map((e) => e.unit));
39
+ }), [J, Y] = v(null), [X, Z] = v(null), Q = _(() => R?.lineItems ?? [], [R]), te = _(() => Q.reduce((e, t) => e + t.value, 0), [Q]), $ = _(() => {
40
+ let e = new Set(Q.map((e) => e.unit));
38
41
  return e.size === 1 ? [...e][0] : null;
39
- }, [Z]);
40
- if (R) return /* @__PURE__ */ C(t, {
42
+ }, [Q]);
43
+ if (z) return /* @__PURE__ */ w(t, {
41
44
  title: "Report",
42
- children: /* @__PURE__ */ C(o, {})
45
+ children: /* @__PURE__ */ w(o, {})
43
46
  });
44
- if (z || !L) return /* @__PURE__ */ C(t, {
47
+ if (B || !R) return /* @__PURE__ */ w(t, {
45
48
  title: "Report",
46
- children: /* @__PURE__ */ C(a, {
49
+ children: /* @__PURE__ */ w(a, {
47
50
  message: "This report could not be loaded.",
48
- onRetry: () => B()
51
+ onRetry: () => V()
49
52
  })
50
53
  });
51
- let te = L.status === "PUBLISHED";
52
- return /* @__PURE__ */ w(t, {
53
- title: /* @__PURE__ */ w("span", {
54
+ let ne = R.status === "PUBLISHED";
55
+ return /* @__PURE__ */ T(t, {
56
+ title: /* @__PURE__ */ T("span", {
54
57
  className: "flex flex-wrap items-center gap-x-3 gap-y-2",
55
- children: [/* @__PURE__ */ C("span", {
58
+ children: [/* @__PURE__ */ w("span", {
56
59
  className: "text-text-primary",
57
- children: L.title
58
- }), /* @__PURE__ */ C(f, { framework: L.framework })]
60
+ children: R.title
61
+ }), /* @__PURE__ */ w(p, { framework: R.framework })]
59
62
  }),
60
- description: `Reporting period ${n(L.periodStart)} – ${n(L.periodEnd)}`,
61
- actions: /* @__PURE__ */ w(S, { children: [/* @__PURE__ */ C(i, { status: L.status }), /* @__PURE__ */ w(T, {
63
+ description: `Reporting period ${n(R.periodStart)} – ${n(R.periodEnd)}`,
64
+ actions: /* @__PURE__ */ T(C, { children: [/* @__PURE__ */ w(i, { status: R.status }), /* @__PURE__ */ T(E, {
62
65
  variant: "ghost",
63
- onClick: () => I("reports"),
64
- children: [/* @__PURE__ */ C(v, { className: "mr-1.5 h-4 w-4" }), " Back"]
66
+ onClick: () => L("reports"),
67
+ children: [/* @__PURE__ */ w(y, { className: "mr-1.5 h-4 w-4" }), " Back"]
65
68
  })] }),
66
69
  children: [
67
- /* @__PURE__ */ w("div", {
70
+ /* @__PURE__ */ T("div", {
68
71
  className: "grid grid-cols-1 gap-4 lg:grid-cols-3",
69
- children: [/* @__PURE__ */ w(E, {
72
+ children: [/* @__PURE__ */ T(D, {
70
73
  treatment: "glass",
71
74
  className: "p-6 lg:col-span-2",
72
- children: [/* @__PURE__ */ w("dl", {
75
+ children: [/* @__PURE__ */ T("dl", {
73
76
  className: "grid grid-cols-2 gap-x-6 gap-y-4 sm:grid-cols-3",
74
77
  children: [
75
- /* @__PURE__ */ C(P, {
78
+ /* @__PURE__ */ w(F, {
76
79
  label: "Framework",
77
- children: /* @__PURE__ */ C(f, { framework: L.framework })
80
+ children: /* @__PURE__ */ w(p, { framework: R.framework })
78
81
  }),
79
- /* @__PURE__ */ C(P, {
82
+ /* @__PURE__ */ w(F, {
80
83
  label: "Status",
81
- children: /* @__PURE__ */ C(i, { status: L.status })
84
+ children: /* @__PURE__ */ w(i, { status: R.status })
82
85
  }),
83
- /* @__PURE__ */ C(P, {
86
+ /* @__PURE__ */ w(F, {
84
87
  label: "Period",
85
- children: /* @__PURE__ */ w("span", {
88
+ children: /* @__PURE__ */ T("span", {
86
89
  className: "tabular-nums",
87
90
  children: [
88
- n(L.periodStart),
91
+ n(R.periodStart),
89
92
  " – ",
90
- n(L.periodEnd)
93
+ n(R.periodEnd)
91
94
  ]
92
95
  })
93
96
  }),
94
- /* @__PURE__ */ C(P, {
97
+ /* @__PURE__ */ w(F, {
95
98
  label: "Published",
96
- children: n(L.publishedAt)
99
+ children: n(R.publishedAt)
97
100
  }),
98
- /* @__PURE__ */ C(P, {
101
+ /* @__PURE__ */ w(F, {
99
102
  label: "Line items",
100
- children: /* @__PURE__ */ C("span", {
103
+ children: /* @__PURE__ */ w("span", {
101
104
  className: "tabular-nums",
102
- children: Z.length
105
+ children: Q.length
103
106
  })
104
107
  }),
105
- /* @__PURE__ */ C(P, {
108
+ /* @__PURE__ */ w(F, {
106
109
  label: "Attachment",
107
- children: L.file?.id ? /* @__PURE__ */ C(m, { fileId: L.file.id }) : /* @__PURE__ */ C("span", {
110
+ children: R.file?.id ? /* @__PURE__ */ w(h, { fileId: R.file.id }) : /* @__PURE__ */ w("span", {
108
111
  className: "text-text-tertiary",
109
112
  children: "—"
110
113
  })
111
114
  })
112
115
  ]
113
- }), L.summary && /* @__PURE__ */ C("p", {
116
+ }), R.summary && /* @__PURE__ */ w("p", {
114
117
  className: "mt-5 rounded-lg bg-bg-sunken/60 p-3 text-sm text-text-secondary",
115
- children: L.summary
118
+ children: R.summary
116
119
  })]
117
- }), /* @__PURE__ */ w(E, {
120
+ }), /* @__PURE__ */ T(D, {
118
121
  treatment: "glass",
119
122
  className: "flex flex-col gap-3 p-6",
120
123
  children: [
121
- /* @__PURE__ */ C("p", {
124
+ /* @__PURE__ */ w("p", {
122
125
  className: "text-xs font-medium uppercase tracking-wide text-text-tertiary",
123
126
  children: "Actions"
124
127
  }),
125
- /* @__PURE__ */ w(T, {
126
- onClick: () => W(!0),
127
- children: [/* @__PURE__ */ C(y, { className: "mr-1.5 h-4 w-4" }), " Add line item"]
128
+ /* @__PURE__ */ T(E, {
129
+ onClick: () => G(!0),
130
+ children: [/* @__PURE__ */ w(b, { className: "mr-1.5 h-4 w-4" }), " Add line item"]
128
131
  }),
129
- te ? /* @__PURE__ */ w("p", {
132
+ ne ? /* @__PURE__ */ T("p", {
130
133
  className: "mt-1 text-sm text-text-secondary",
131
134
  children: [
132
135
  "Published ",
133
- n(L.publishedAt),
136
+ n(R.publishedAt),
134
137
  ". This disclosure is finalised."
135
138
  ]
136
- }) : /* @__PURE__ */ w(S, { children: [/* @__PURE__ */ C(p, {
139
+ }) : /* @__PURE__ */ T(C, { children: [/* @__PURE__ */ w(m, {
137
140
  id: "reportAttachment",
138
141
  label: "Attach file (optional)",
139
- value: Y,
140
- onChange: X,
142
+ value: X,
143
+ onChange: Z,
141
144
  hint: "Attach the signed report PDF or supporting document, then publish."
142
- }), /* @__PURE__ */ w(T, {
145
+ }), /* @__PURE__ */ T(E, {
143
146
  variant: "outline",
144
147
  onClick: async () => {
145
- if (F) {
146
- J(null);
148
+ if (I) {
149
+ Y(null);
147
150
  try {
148
- await H.mutateAsync({
149
- id: F,
150
- fileId: Y?.fileId ?? null
151
- }), X(null);
151
+ await U.mutateAsync({
152
+ id: I,
153
+ fileId: X?.fileId ?? null
154
+ }), Z(null);
152
155
  } catch (e) {
153
- J(e instanceof Error ? e.message : "Failed to publish report.");
156
+ Y(e instanceof Error ? e.message : "Failed to publish report.");
154
157
  }
155
158
  }
156
159
  },
157
- disabled: H.isPending,
158
- children: [/* @__PURE__ */ C(b, { className: "mr-1.5 h-4 w-4" }), H.isPending ? "Publishing…" : "Publish report"]
160
+ disabled: U.isPending,
161
+ children: [/* @__PURE__ */ w(x, { className: "mr-1.5 h-4 w-4" }), U.isPending ? "Publishing…" : "Publish report"]
159
162
  })] })
160
163
  ]
161
164
  })]
162
165
  }),
163
- q && /* @__PURE__ */ C("p", {
166
+ J && /* @__PURE__ */ w("p", {
164
167
  className: "mt-4 text-sm text-status-error-text",
165
- children: q
168
+ children: J
166
169
  }),
167
- /* @__PURE__ */ C(s, {
170
+ /* @__PURE__ */ w(s, {
168
171
  title: "Line items",
169
172
  description: "Quantified disclosures that make up this report.",
170
- action: /* @__PURE__ */ w(T, {
173
+ action: /* @__PURE__ */ T(E, {
171
174
  size: "sm",
172
- onClick: () => W(!0),
173
- children: [/* @__PURE__ */ C(y, { className: "mr-1.5 h-4 w-4" }), " Add line item"]
175
+ onClick: () => G(!0),
176
+ children: [/* @__PURE__ */ w(b, { className: "mr-1.5 h-4 w-4" }), " Add line item"]
174
177
  }),
175
- children: Z.length === 0 ? /* @__PURE__ */ C(c, {
178
+ children: Q.length === 0 ? /* @__PURE__ */ w(c, {
176
179
  illustration: "empty-data",
177
180
  title: "No line items",
178
181
  description: "Add a line item to record a quantified disclosure for this report.",
179
- action: /* @__PURE__ */ w(T, {
182
+ action: /* @__PURE__ */ T(E, {
180
183
  size: "sm",
181
- onClick: () => W(!0),
182
- children: [/* @__PURE__ */ C(y, { className: "mr-1.5 h-4 w-4" }), " Add line item"]
184
+ onClick: () => G(!0),
185
+ children: [/* @__PURE__ */ w(b, { className: "mr-1.5 h-4 w-4" }), " Add line item"]
183
186
  })
184
- }) : /* @__PURE__ */ C(E, {
187
+ }) : /* @__PURE__ */ w(D, {
185
188
  treatment: "plain",
186
189
  className: "overflow-hidden",
187
- children: /* @__PURE__ */ C("div", {
190
+ children: /* @__PURE__ */ w("div", {
188
191
  className: "overflow-x-auto",
189
- children: /* @__PURE__ */ w("table", {
192
+ children: /* @__PURE__ */ T("table", {
190
193
  className: "w-full border-collapse text-sm",
191
194
  children: [
192
- /* @__PURE__ */ C("thead", { children: /* @__PURE__ */ w("tr", {
195
+ /* @__PURE__ */ w("thead", { children: /* @__PURE__ */ T("tr", {
193
196
  className: "border-b border-border-seam text-left",
194
197
  children: [
195
- /* @__PURE__ */ C("th", {
198
+ /* @__PURE__ */ w("th", {
196
199
  className: "px-4 py-3 font-medium text-text-secondary",
197
200
  children: "Line item"
198
201
  }),
199
- /* @__PURE__ */ C("th", {
202
+ /* @__PURE__ */ w("th", {
200
203
  className: "hidden px-4 py-3 font-medium text-text-secondary md:table-cell",
201
204
  children: "Category"
202
205
  }),
203
- /* @__PURE__ */ C("th", {
206
+ /* @__PURE__ */ w("th", {
204
207
  className: "px-4 py-3 text-right font-medium text-text-secondary",
205
208
  children: "Value"
206
209
  })
207
210
  ]
208
211
  }) }),
209
- /* @__PURE__ */ C("tbody", { children: Z.map((e) => /* @__PURE__ */ w("tr", {
212
+ /* @__PURE__ */ w("tbody", { children: Q.map((e) => /* @__PURE__ */ T("tr", {
210
213
  className: "border-b border-border-seam/60",
211
214
  children: [
212
- /* @__PURE__ */ C("td", {
215
+ /* @__PURE__ */ w("td", {
213
216
  className: "px-4 py-3 font-medium text-text-primary",
214
217
  children: e.label
215
218
  }),
216
- /* @__PURE__ */ C("td", {
219
+ /* @__PURE__ */ w("td", {
217
220
  className: "hidden px-4 py-3 text-text-secondary md:table-cell",
218
221
  children: e.category ?? "—"
219
222
  }),
220
- /* @__PURE__ */ w("td", {
223
+ /* @__PURE__ */ T("td", {
221
224
  className: "px-4 py-3 text-right text-text-primary tabular-nums",
222
225
  children: [
223
226
  r(e.value),
@@ -227,15 +230,15 @@ function F() {
227
230
  })
228
231
  ]
229
232
  }, e.id)) }),
230
- /* @__PURE__ */ C("tfoot", { children: /* @__PURE__ */ w("tr", {
233
+ /* @__PURE__ */ w("tfoot", { children: /* @__PURE__ */ T("tr", {
231
234
  className: "border-t-2 border-border-seam bg-bg-sunken/40",
232
- children: [/* @__PURE__ */ C("td", {
235
+ children: [/* @__PURE__ */ w("td", {
233
236
  className: "px-4 py-3 text-sm font-semibold text-text-primary",
234
237
  colSpan: 2,
235
238
  children: "Total"
236
- }), /* @__PURE__ */ w("td", {
239
+ }), /* @__PURE__ */ T("td", {
237
240
  className: "px-4 py-3 text-right text-base font-bold text-text-primary tabular-nums",
238
- children: [r(Q), $ ? ` ${$}` : ""]
241
+ children: [r(te), $ ? ` ${$}` : ""]
239
242
  })]
240
243
  }) })
241
244
  ]
@@ -243,97 +246,97 @@ function F() {
243
246
  })
244
247
  })
245
248
  }),
246
- /* @__PURE__ */ C(h, {
249
+ /* @__PURE__ */ w(g, {
247
250
  entityType: "ecoimpacthub-report",
248
- entityId: L.id,
251
+ entityId: R.id,
249
252
  description: "Coordinate review and sign-off on this disclosure with your team."
250
253
  }),
251
- /* @__PURE__ */ C(k, {
252
- open: U,
253
- onOpenChange: W,
254
- children: /* @__PURE__ */ w(ee, { children: [
255
- /* @__PURE__ */ w(M, { children: [/* @__PURE__ */ C(N, { children: "Add line item" }), /* @__PURE__ */ w(A, { children: [
254
+ /* @__PURE__ */ w(A, {
255
+ open: W,
256
+ onOpenChange: G,
257
+ children: /* @__PURE__ */ T(ee, { children: [
258
+ /* @__PURE__ */ T(N, { children: [/* @__PURE__ */ w(P, { children: "Add line item" }), /* @__PURE__ */ T(j, { children: [
256
259
  "Record a quantified disclosure for ",
257
- L.title,
260
+ R.title,
258
261
  "."
259
262
  ] })] }),
260
- /* @__PURE__ */ w("div", {
263
+ /* @__PURE__ */ T("div", {
261
264
  className: "grid gap-4 py-2",
262
265
  children: [
263
- /* @__PURE__ */ w("div", {
266
+ /* @__PURE__ */ T("div", {
264
267
  className: "grid gap-1.5",
265
- children: [/* @__PURE__ */ C(O, {
268
+ children: [/* @__PURE__ */ w(k, {
266
269
  htmlFor: "liLabel",
267
270
  children: "Label *"
268
- }), /* @__PURE__ */ C(D, {
271
+ }), /* @__PURE__ */ w(O, {
269
272
  id: "liLabel",
270
- value: G.label,
271
- onChange: (e) => K({
272
- ...G,
273
+ value: K.label,
274
+ onChange: (e) => q({
275
+ ...K,
273
276
  label: e.target.value
274
277
  }),
275
278
  placeholder: "Scope 1 emissions"
276
279
  })]
277
280
  }),
278
- /* @__PURE__ */ w("div", {
281
+ /* @__PURE__ */ T("div", {
279
282
  className: "grid gap-2 sm:grid-cols-2",
280
- children: [/* @__PURE__ */ w("div", {
283
+ children: [/* @__PURE__ */ T("div", {
281
284
  className: "grid gap-1.5",
282
- children: [/* @__PURE__ */ C(O, {
285
+ children: [/* @__PURE__ */ w(k, {
283
286
  htmlFor: "liValue",
284
287
  children: "Value *"
285
- }), /* @__PURE__ */ C(D, {
288
+ }), /* @__PURE__ */ w(O, {
286
289
  id: "liValue",
287
290
  type: "number",
288
291
  step: "any",
289
- value: G.value,
290
- onChange: (e) => K({
291
- ...G,
292
+ value: K.value,
293
+ onChange: (e) => q({
294
+ ...K,
292
295
  value: e.target.value
293
296
  }),
294
297
  placeholder: "1250"
295
298
  })]
296
- }), /* @__PURE__ */ w("div", {
299
+ }), /* @__PURE__ */ T("div", {
297
300
  className: "grid gap-1.5",
298
- children: [/* @__PURE__ */ C(O, {
301
+ children: [/* @__PURE__ */ w(k, {
299
302
  htmlFor: "liUnit",
300
303
  children: "Unit *"
301
- }), /* @__PURE__ */ C(D, {
304
+ }), /* @__PURE__ */ w(O, {
302
305
  id: "liUnit",
303
- value: G.unit,
304
- onChange: (e) => K({
305
- ...G,
306
+ value: K.unit,
307
+ onChange: (e) => q({
308
+ ...K,
306
309
  unit: e.target.value
307
310
  }),
308
311
  placeholder: "t CO₂e"
309
312
  })]
310
313
  })]
311
314
  }),
312
- /* @__PURE__ */ w("div", {
315
+ /* @__PURE__ */ T("div", {
313
316
  className: "grid gap-1.5",
314
- children: [/* @__PURE__ */ C(O, {
317
+ children: [/* @__PURE__ */ w(k, {
315
318
  htmlFor: "liCategory",
316
319
  children: "Category"
317
- }), /* @__PURE__ */ C(D, {
320
+ }), /* @__PURE__ */ w(O, {
318
321
  id: "liCategory",
319
- value: G.category,
320
- onChange: (e) => K({
321
- ...G,
322
+ value: K.category,
323
+ onChange: (e) => q({
324
+ ...K,
322
325
  category: e.target.value
323
326
  }),
324
327
  placeholder: "Optional grouping, e.g. Energy"
325
328
  })]
326
329
  }),
327
- /* @__PURE__ */ w("div", {
330
+ /* @__PURE__ */ T("div", {
328
331
  className: "grid gap-1.5",
329
- children: [/* @__PURE__ */ C(O, {
332
+ children: [/* @__PURE__ */ w(k, {
330
333
  htmlFor: "liCarbonEntry",
331
334
  children: "Carbon entry ID"
332
- }), /* @__PURE__ */ C(D, {
335
+ }), /* @__PURE__ */ w(O, {
333
336
  id: "liCarbonEntry",
334
- value: G.carbonEntryId,
335
- onChange: (e) => K({
336
- ...G,
337
+ value: K.carbonEntryId,
338
+ onChange: (e) => q({
339
+ ...K,
337
340
  carbonEntryId: e.target.value
338
341
  }),
339
342
  placeholder: "Optional linked carbon-ledger entry"
@@ -341,27 +344,27 @@ function F() {
341
344
  })
342
345
  ]
343
346
  }),
344
- /* @__PURE__ */ w(j, { children: [/* @__PURE__ */ C(T, {
347
+ /* @__PURE__ */ T(M, { children: [/* @__PURE__ */ w(E, {
345
348
  variant: "outline",
346
- onClick: () => W(!1),
349
+ onClick: () => G(!1),
347
350
  children: "Cancel"
348
- }), /* @__PURE__ */ C(T, {
351
+ }), /* @__PURE__ */ w(E, {
349
352
  onClick: async () => {
350
- if (F) {
351
- if (!G.label.trim() || !G.value || !G.unit.trim()) {
352
- J("Label, value and unit are required.");
353
+ if (I) {
354
+ if (!K.label.trim() || !K.value || !K.unit.trim()) {
355
+ Y("Label, value and unit are required.");
353
356
  return;
354
357
  }
355
- J(null);
358
+ Y(null);
356
359
  try {
357
- await V.mutateAsync({
358
- reportId: F,
359
- label: G.label.trim(),
360
- value: Number(G.value),
361
- unit: G.unit.trim(),
362
- category: G.category.trim() || null,
363
- carbonEntryId: G.carbonEntryId.trim() || null
364
- }), W(!1), K({
360
+ await H.mutateAsync({
361
+ reportId: I,
362
+ label: K.label.trim(),
363
+ value: Number(K.value),
364
+ unit: K.unit.trim(),
365
+ category: K.category.trim() || null,
366
+ carbonEntryId: K.carbonEntryId.trim() || null
367
+ }), G(!1), q({
365
368
  label: "",
366
369
  value: "",
367
370
  unit: "",
@@ -369,12 +372,12 @@ function F() {
369
372
  carbonEntryId: ""
370
373
  });
371
374
  } catch (e) {
372
- J(e instanceof Error ? e.message : "Failed to add line item.");
375
+ Y(e instanceof Error ? e.message : "Failed to add line item.");
373
376
  }
374
377
  }
375
378
  },
376
- disabled: V.isPending,
377
- children: V.isPending ? "Adding…" : "Add line item"
379
+ disabled: H.isPending,
380
+ children: H.isPending ? "Adding…" : "Add line item"
378
381
  })] })
379
382
  ] })
380
383
  })
@@ -382,6 +385,6 @@ function F() {
382
385
  });
383
386
  }
384
387
  //#endregion
385
- export { F as ReportDetailPage };
388
+ export { I as ReportDetailPage };
386
389
 
387
390
  //# sourceMappingURL=ReportDetailPage.js.map