@burdenoff/microfe-ecoimpacthub 2026.1123.2 → 2026.1124.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 (33) hide show
  1. package/dist/ecoimpacthub/EcoImpactHubRoutes.js +47 -39
  2. package/dist/ecoimpacthub/EcoImpactHubRoutes.js.map +1 -1
  3. package/dist/ecoimpacthub/hooks/ecoTransport.d.ts +2 -0
  4. package/dist/ecoimpacthub/hooks/ecoTransport.js +1 -0
  5. package/dist/ecoimpacthub/hooks/ecoTransport.js.map +1 -1
  6. package/dist/ecoimpacthub/hooks/index.d.ts +1 -0
  7. package/dist/ecoimpacthub/hooks/index.js +3 -2
  8. package/dist/ecoimpacthub/hooks/useEcoAiOperations.d.ts +15 -0
  9. package/dist/ecoimpacthub/hooks/useEcoAiOperations.js +90 -0
  10. package/dist/ecoimpacthub/hooks/useEcoAiOperations.js.map +1 -0
  11. package/dist/ecoimpacthub/hooks/useEcoImpactHubApi.js +1 -1
  12. package/dist/ecoimpacthub/hooks/useEcoImpactHubApi.js.map +1 -1
  13. package/dist/ecoimpacthub/pages/ai/AiOperationsPage.d.ts +21 -0
  14. package/dist/ecoimpacthub/pages/ai/AiOperationsPage.js +536 -0
  15. package/dist/ecoimpacthub/pages/ai/AiOperationsPage.js.map +1 -0
  16. package/dist/ecoimpacthub/pages/carbon/CarbonPage.js +346 -320
  17. package/dist/ecoimpacthub/pages/carbon/CarbonPage.js.map +1 -1
  18. package/dist/ecoimpacthub/pages/habitat/HabitatProjectsPage.js +85 -81
  19. package/dist/ecoimpacthub/pages/habitat/HabitatProjectsPage.js.map +1 -1
  20. package/dist/ecoimpacthub/pages/habitat/StewardshipPage.d.ts +1 -0
  21. package/dist/ecoimpacthub/pages/habitat/StewardshipPage.js +193 -0
  22. package/dist/ecoimpacthub/pages/habitat/StewardshipPage.js.map +1 -0
  23. package/dist/ecoimpacthub/pages/habitat/stewardship.d.ts +34 -0
  24. package/dist/ecoimpacthub/pages/habitat/stewardship.js +83 -0
  25. package/dist/ecoimpacthub/pages/habitat/stewardship.js.map +1 -0
  26. package/dist/ecoimpacthub/pages/observations/ObservationsPage.js +165 -143
  27. package/dist/ecoimpacthub/pages/observations/ObservationsPage.js.map +1 -1
  28. package/dist/ecoimpacthub/pages/reports/ReportDetailPage.js +346 -185
  29. package/dist/ecoimpacthub/pages/reports/ReportDetailPage.js.map +1 -1
  30. package/dist/ecoimpacthub/types/index.d.ts +83 -0
  31. package/dist/ecoimpacthub/utils/pageContext.js +2 -1
  32. package/dist/ecoimpacthub/utils/pageContext.js.map +1 -1
  33. package/package.json +2 -2
@@ -14,28 +14,29 @@ import "../../hooks/index.js";
14
14
  import { DraftWithAiDialog as ve } from "./DraftWithAiDialog.js";
15
15
  import { DraftReviewPanel as ye } from "./DraftReviewPanel.js";
16
16
  import { SuggestFactorPanel as be } from "./SuggestFactorPanel.js";
17
- import { formatCo2e as o, formatDate as xe, formatEnumLabel as s, formatNumber as c, formatPercent as l } from "../../utils/formatters.js";
18
- import { useMemo as Se, useState as u } from "react";
19
- import { Factory as Ce, Flame as we, Leaf as Te, Plus as d, Sparkles as Ee, Target as De, Truck as Oe, Zap as ke } from "lucide-react";
20
- import { Fragment as Ae, jsx as f, jsxs as p } from "react/jsx-runtime";
21
- import { Button as m, Input as h, Label as g, ResponsiveDialog as je, ResponsiveDialogContent as Me, ResponsiveDialogDescription as _, ResponsiveDialogFooter as v, ResponsiveDialogHeader as y, ResponsiveDialogTitle as b, Select as x, SelectContent as S, SelectItem as C, SelectTrigger as w, SelectValue as T, Textarea as Ne } from "@burdenoff/fe-libs/ui";
17
+ import { formatCo2e as o, formatDate as xe, formatEnumLabel as s, formatNumber as c, formatPercent as Se } from "../../utils/formatters.js";
18
+ import { useMemo as Ce, useState as l } from "react";
19
+ import { Factory as u, Flame as we, Leaf as Te, Plus as d, Sparkles as Ee, Target as De, Truck as Oe, Zap as ke } from "lucide-react";
20
+ import { useSearchParams as Ae } from "react-router";
21
+ import { Fragment as je, jsx as f, jsxs as p } from "react/jsx-runtime";
22
+ import { Button as m, Input as h, Label as g, ResponsiveDialog as _, ResponsiveDialogContent as v, ResponsiveDialogDescription as Me, ResponsiveDialogFooter as Ne, ResponsiveDialogHeader as Pe, ResponsiveDialogTitle as y, Select as b, SelectContent as x, SelectItem as S, SelectTrigger as C, SelectValue as w, Textarea as Fe } from "@burdenoff/fe-libs/ui";
22
23
  // src/ecoimpacthub/pages/carbon/CarbonPage.tsx
23
- var E = [
24
+ var T = [
24
25
  "SCOPE_1",
25
26
  "SCOPE_2",
26
27
  "SCOPE_3"
27
- ], Pe = [
28
+ ], Ie = [
28
29
  "DRAFT",
29
30
  "RECORDED",
30
31
  "VERIFIED",
31
32
  "ADJUSTED"
32
- ], Fe = [
33
+ ], Le = [
33
34
  "PROPOSED",
34
35
  "ACTIVE",
35
36
  "ACHIEVED",
36
37
  "MISSED",
37
38
  "RETIRED"
38
- ], Ie = 25, Le = () => (/* @__PURE__ */ new Date()).toISOString().slice(0, 10), D = {
39
+ ], Re = 25, ze = () => (/* @__PURE__ */ new Date()).toISOString().slice(0, 10), E = {
39
40
  category: "",
40
41
  scope: "SCOPE_1",
41
42
  activityValue: "",
@@ -44,14 +45,14 @@ var E = [
44
45
  siteId: "",
45
46
  periodStart: "",
46
47
  notes: ""
47
- }, O = {
48
+ }, D = {
48
49
  name: "",
49
50
  scope: "SCOPE_1",
50
51
  activityUnit: "",
51
52
  factorKgco2e: "",
52
53
  source: "",
53
54
  validYear: ""
54
- }, k = {
55
+ }, O = {
55
56
  name: "",
56
57
  metric: "",
57
58
  baselineValue: "",
@@ -60,13 +61,13 @@ var E = [
60
61
  targetYear: "",
61
62
  unit: "",
62
63
  description: ""
63
- }, Re = (e) => Math.max(0, Math.min(100, e)), ze = {
64
+ }, Be = (e) => Math.max(0, Math.min(100, e)), Ve = {
64
65
  PROPOSED: "var(--color-text-tertiary)",
65
66
  ACTIVE: "var(--color-action-primary-bg)",
66
67
  ACHIEVED: "var(--color-status-success-text)",
67
68
  MISSED: "var(--color-status-error-text)",
68
69
  RETIRED: "var(--color-text-tertiary)"
69
- }, Be = (e, t, n) => {
70
+ }, k = (e, t, n) => {
70
71
  if (e == null || t == null || t <= 0) return;
71
72
  let r = e / t * 100;
72
73
  return /* @__PURE__ */ p("div", {
@@ -77,95 +78,95 @@ var E = [
77
78
  height: 4
78
79
  }), /* @__PURE__ */ p("p", {
79
80
  className: "text-xs tabular-nums text-text-tertiary",
80
- children: [l(r), " of total"]
81
+ children: [Se(r), " of total"]
81
82
  })]
82
83
  });
83
84
  };
84
- function A() {
85
- let a = me(), [l, A] = u("ledger"), [Ve, He] = u(!1), [j, Ue] = u("ALL"), [M, We] = u("ALL"), [N, Ge] = u("ALL"), P = pe(), [F, Ke] = u("ALL"), [I, qe] = u("ALL"), [Je, L] = u(!1), [R, z] = u(D), [Ye, B] = u(!1), [V, H] = u(O), [Xe, U] = u(!1), [W, G] = u(k), [K, q] = u(null), Ze = de({ pagination: {
85
+ function He() {
86
+ let a = me(), [Se, He] = Ae(), A = Se.get("highlight"), [j, Ue] = l("ledger"), [We, Ge] = l(!1), [M, Ke] = l("ALL"), [N, qe] = l("ALL"), [P, Je] = l("ALL"), F = pe(), [I, Ye] = l("ALL"), [L, Xe] = l("ALL"), [Ze, R] = l(!1), [z, B] = l(E), [Qe, V] = l(!1), [H, U] = l(D), [$e, W] = l(!1), [G, K] = l(O), [q, J] = l(null), et = de({ pagination: {
86
87
  limit: 100,
87
88
  offset: 0
88
- } }), J = Se(() => {
89
+ } }), Y = Ce(() => {
89
90
  let e = {};
90
- for (let t of Ze.data?.items ?? []) e[t.id] = t.name;
91
+ for (let t of et.data?.items ?? []) e[t.id] = t.name;
91
92
  return e;
92
- }, [Ze.data]), Y = ie(), X = re({
93
- scope: j === "ALL" ? void 0 : j,
94
- siteId: N === "ALL" ? void 0 : N,
95
- status: M === "ALL" ? void 0 : M,
93
+ }, [et.data]), X = ie(), Z = re({
94
+ scope: M === "ALL" ? void 0 : M,
95
+ siteId: P === "ALL" ? void 0 : P,
96
+ status: N === "ALL" ? void 0 : N,
96
97
  pagination: {
97
- limit: Ie,
98
- cursor: P.cursor
98
+ limit: Re,
99
+ cursor: F.cursor
99
100
  }
100
- }), Qe = X.data?.items ?? [], $e = se(), Z = se(F === "ALL" ? void 0 : F), et = Z.data?.items ?? [], Q = le(I === "ALL" ? void 0 : I), tt = Q.data?.items ?? [], nt = ce(), rt = fe(), it = ae(), $ = oe(), at = ue(), ot = () => {
101
- z({
101
+ }), tt = Z.data?.items ?? [], nt = se(), Q = se(I === "ALL" ? void 0 : I), rt = Q.data?.items ?? [], $ = le(L === "ALL" ? void 0 : L), it = $.data?.items ?? [], at = ce(), ot = fe(), st = ae(), ct = oe(), lt = ue(), ut = () => {
102
+ B({
103
+ ...E,
104
+ periodStart: ze()
105
+ }), J(null), R(!0);
106
+ }, dt = (e) => {
107
+ U({
102
108
  ...D,
103
- periodStart: Le()
104
- }), q(null), L(!0);
105
- }, st = (e) => {
106
- H({
107
- ...O,
108
109
  ...e
109
- }), q(null), B(!0);
110
- }, ct = () => {
111
- G(k), q(null), U(!0);
112
- }, lt = async () => {
113
- if (!R.category.trim() || !R.activityValue || !R.activityUnit.trim()) q("Category, activity value and unit are required.");
110
+ }), J(null), V(!0);
111
+ }, ft = () => {
112
+ K(O), J(null), W(!0);
113
+ }, pt = async () => {
114
+ if (!z.category.trim() || !z.activityValue || !z.activityUnit.trim()) J("Category, activity value and unit are required.");
114
115
  else {
115
- q(null);
116
+ J(null);
116
117
  try {
117
- await nt.mutateAsync({
118
- category: R.category.trim(),
119
- scope: R.scope,
120
- activityValue: Number(R.activityValue),
121
- activityUnit: R.activityUnit.trim(),
122
- factorId: R.factorId || null,
123
- siteId: R.siteId || null,
124
- periodStart: new Date(R.periodStart || Le()).toISOString(),
125
- notes: R.notes.trim() || null
126
- }), L(!1), z(D);
118
+ await at.mutateAsync({
119
+ category: z.category.trim(),
120
+ scope: z.scope,
121
+ activityValue: Number(z.activityValue),
122
+ activityUnit: z.activityUnit.trim(),
123
+ factorId: z.factorId || null,
124
+ siteId: z.siteId || null,
125
+ periodStart: new Date(z.periodStart || ze()).toISOString(),
126
+ notes: z.notes.trim() || null
127
+ }), R(!1), B(E);
127
128
  } catch (e) {
128
- q(e instanceof Error ? e.message : "Failed to record carbon entry.");
129
+ J(e instanceof Error ? e.message : "Failed to record carbon entry.");
129
130
  }
130
131
  }
131
- }, ut = async () => {
132
- if (!V.name.trim() || !V.activityUnit.trim() || !V.factorKgco2e) q("Name, activity unit and factor value are required.");
132
+ }, mt = async () => {
133
+ if (!H.name.trim() || !H.activityUnit.trim() || !H.factorKgco2e) J("Name, activity unit and factor value are required.");
133
134
  else {
134
- q(null);
135
+ J(null);
135
136
  try {
136
- await it.mutateAsync({
137
- name: V.name.trim(),
138
- scope: V.scope,
139
- activityUnit: V.activityUnit.trim(),
140
- factorKgco2e: Number(V.factorKgco2e),
141
- source: V.source.trim() || null,
142
- validYear: V.validYear ? Number(V.validYear) : null
143
- }), B(!1), H(O);
137
+ await st.mutateAsync({
138
+ name: H.name.trim(),
139
+ scope: H.scope,
140
+ activityUnit: H.activityUnit.trim(),
141
+ factorKgco2e: Number(H.factorKgco2e),
142
+ source: H.source.trim() || null,
143
+ validYear: H.validYear ? Number(H.validYear) : null
144
+ }), V(!1), U(D);
144
145
  } catch (e) {
145
- q(e instanceof Error ? e.message : "Failed to create emission factor.");
146
+ J(e instanceof Error ? e.message : "Failed to create emission factor.");
146
147
  }
147
148
  }
148
- }, dt = async () => {
149
- if (!W.name.trim() || !W.metric.trim() || !W.baselineValue || !W.baselineYear || !W.targetValue || !W.targetYear || !W.unit.trim()) q("All fields except description are required.");
150
- else if (Number(W.targetYear) <= Number(W.baselineYear)) q("Target year must be later than the baseline year.");
149
+ }, ht = async () => {
150
+ if (!G.name.trim() || !G.metric.trim() || !G.baselineValue || !G.baselineYear || !G.targetValue || !G.targetYear || !G.unit.trim()) J("All fields except description are required.");
151
+ else if (Number(G.targetYear) <= Number(G.baselineYear)) J("Target year must be later than the baseline year.");
151
152
  else {
152
- q(null);
153
+ J(null);
153
154
  try {
154
- await $.mutateAsync({
155
- name: W.name.trim(),
156
- metric: W.metric.trim(),
157
- baselineValue: Number(W.baselineValue),
158
- baselineYear: Number(W.baselineYear),
159
- targetValue: Number(W.targetValue),
160
- targetYear: Number(W.targetYear),
161
- unit: W.unit.trim(),
162
- description: W.description.trim() || null
163
- }), U(!1), G(k);
155
+ await ct.mutateAsync({
156
+ name: G.name.trim(),
157
+ metric: G.metric.trim(),
158
+ baselineValue: Number(G.baselineValue),
159
+ baselineYear: Number(G.baselineYear),
160
+ targetValue: Number(G.targetValue),
161
+ targetYear: Number(G.targetYear),
162
+ unit: G.unit.trim(),
163
+ description: G.description.trim() || null
164
+ }), W(!1), K(O);
164
165
  } catch (e) {
165
- q(e instanceof Error ? e.message : "Failed to create reduction target.");
166
+ J(e instanceof Error ? e.message : "Failed to create reduction target.");
166
167
  }
167
168
  }
168
- }, ft = [
169
+ }, gt = [
169
170
  {
170
171
  key: "category",
171
172
  header: "Category",
@@ -235,17 +236,17 @@ function A() {
235
236
  render: (e) => e.status === "DRAFT" ? /* @__PURE__ */ f(m, {
236
237
  size: "sm",
237
238
  variant: "outline",
238
- onClick: () => A("drafts"),
239
+ onClick: () => Ue("drafts"),
239
240
  children: a("ecoCarbon.ai.review.reviewAction", "Review")
240
241
  }) : e.status === "VERIFIED" ? null : /* @__PURE__ */ f(m, {
241
242
  size: "sm",
242
243
  variant: "outline",
243
- onClick: () => rt.mutate(e.id),
244
- disabled: rt.isPending,
244
+ onClick: () => ot.mutate(e.id),
245
+ disabled: ot.isPending,
245
246
  children: "Verify"
246
247
  })
247
248
  }
248
- ], pt = [
249
+ ], _t = [
249
250
  {
250
251
  key: "name",
251
252
  header: "Factor",
@@ -299,7 +300,7 @@ function A() {
299
300
  align: "right",
300
301
  render: (e) => e.isActive ? /* @__PURE__ */ f(n, { status: "OK" }) : /* @__PURE__ */ f(n, { status: "Inactive" })
301
302
  }
302
- ], mt = [
303
+ ], vt = [
303
304
  {
304
305
  key: "name",
305
306
  header: "Target",
@@ -351,12 +352,12 @@ function A() {
351
352
  key: "reduction",
352
353
  header: "Planned reduction",
353
354
  render: (e) => {
354
- let t = e.baselineValue > 0 ? Re((e.baselineValue - e.targetValue) / e.baselineValue * 100) : 0;
355
+ let t = e.baselineValue > 0 ? Be((e.baselineValue - e.targetValue) / e.baselineValue * 100) : 0;
355
356
  return /* @__PURE__ */ p("div", {
356
357
  className: "flex min-w-[10rem] items-center gap-3",
357
358
  children: [/* @__PURE__ */ f(ge, {
358
359
  value: t,
359
- color: ze[e.status] ?? "var(--color-action-primary-bg)",
360
+ color: Ve[e.status] ?? "var(--color-action-primary-bg)",
360
361
  height: 8,
361
362
  className: "flex-1"
362
363
  }), /* @__PURE__ */ p("span", {
@@ -375,26 +376,26 @@ function A() {
375
376
  key: "setStatus",
376
377
  header: "",
377
378
  align: "right",
378
- render: (e) => /* @__PURE__ */ p(x, {
379
+ render: (e) => /* @__PURE__ */ p(b, {
379
380
  value: e.status,
380
- onValueChange: (t) => at.mutate({
381
+ onValueChange: (t) => lt.mutate({
381
382
  id: e.id,
382
383
  status: t
383
384
  }),
384
- children: [/* @__PURE__ */ f(w, {
385
+ children: [/* @__PURE__ */ f(C, {
385
386
  className: "h-8 w-36",
386
- children: /* @__PURE__ */ f(T, {})
387
- }), /* @__PURE__ */ f(S, { children: Fe.map((e) => /* @__PURE__ */ f(C, {
387
+ children: /* @__PURE__ */ f(w, {})
388
+ }), /* @__PURE__ */ f(x, { children: Le.map((e) => /* @__PURE__ */ f(S, {
388
389
  value: e,
389
390
  children: s(e)
390
391
  }, e)) })]
391
392
  })
392
393
  }
393
- ], ht = [
394
+ ], yt = [
394
395
  {
395
396
  value: "ledger",
396
397
  label: "Ledger",
397
- icon: /* @__PURE__ */ f(Ce, { className: "h-4 w-4" })
398
+ icon: /* @__PURE__ */ f(u, { className: "h-4 w-4" })
398
399
  },
399
400
  {
400
401
  value: "drafts",
@@ -405,17 +406,17 @@ function A() {
405
406
  value: "factors",
406
407
  label: "Emission factors",
407
408
  icon: /* @__PURE__ */ f(Te, { className: "h-4 w-4" }),
408
- count: Z.data?.items?.length
409
+ count: Q.data?.items?.length
409
410
  },
410
411
  {
411
412
  value: "targets",
412
413
  label: "Reduction targets",
413
414
  icon: /* @__PURE__ */ f(De, { className: "h-4 w-4" }),
414
- count: Q.data?.items?.length
415
+ count: $.data?.items?.length
415
416
  }
416
- ], gt = /* @__PURE__ */ p(m, {
417
+ ], bt = /* @__PURE__ */ p(m, {
417
418
  variant: "outline",
418
- onClick: () => He(!0),
419
+ onClick: () => Ge(!0),
419
420
  children: [
420
421
  /* @__PURE__ */ f(Ee, { className: "mr-1.5 h-4 w-4" }),
421
422
  " ",
@@ -425,17 +426,17 @@ function A() {
425
426
  return /* @__PURE__ */ p(e, {
426
427
  title: "Carbon & Sustainability",
427
428
  description: "Carbon ledger, emission factors & science-based reduction targets — GHG Protocol Scope 1 / 2 / 3.",
428
- actions: l === "ledger" ? /* @__PURE__ */ p("div", {
429
+ actions: j === "ledger" ? /* @__PURE__ */ p("div", {
429
430
  className: "flex flex-wrap gap-2",
430
- children: [gt, /* @__PURE__ */ p(m, {
431
- onClick: ot,
431
+ children: [bt, /* @__PURE__ */ p(m, {
432
+ onClick: ut,
432
433
  children: [/* @__PURE__ */ f(d, { className: "mr-1.5 h-4 w-4" }), " Record entry"]
433
434
  })]
434
- }) : l === "drafts" ? gt : l === "factors" ? /* @__PURE__ */ p(m, {
435
- onClick: () => st(),
435
+ }) : j === "drafts" ? bt : j === "factors" ? /* @__PURE__ */ p(m, {
436
+ onClick: () => dt(),
436
437
  children: [/* @__PURE__ */ f(d, { className: "mr-1.5 h-4 w-4" }), " New factor"]
437
438
  }) : /* @__PURE__ */ p(m, {
438
- onClick: ct,
439
+ onClick: ft,
439
440
  children: [/* @__PURE__ */ f(d, { className: "mr-1.5 h-4 w-4" }), " New target"]
440
441
  }),
441
442
  children: [
@@ -443,16 +444,16 @@ function A() {
443
444
  className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4",
444
445
  children: [
445
446
  /* @__PURE__ */ f(t, {
446
- icon: /* @__PURE__ */ f(Ce, { className: "h-5 w-5" }),
447
- value: Y.data ? o(Y.data.total) : "—",
447
+ icon: /* @__PURE__ */ f(u, { className: "h-5 w-5" }),
448
+ value: X.data ? o(X.data.total) : "—",
448
449
  label: "Total footprint",
449
450
  featured: !0,
450
- footer: Y.data && Y.data.total > 0 ? /* @__PURE__ */ p("div", {
451
+ footer: X.data && X.data.total > 0 ? /* @__PURE__ */ p("div", {
451
452
  className: "space-y-2",
452
453
  children: [/* @__PURE__ */ f(_e, {
453
- scope1: Y.data.scope1,
454
- scope2: Y.data.scope2,
455
- scope3: Y.data.scope3,
454
+ scope1: X.data.scope1,
455
+ scope2: X.data.scope2,
456
+ scope3: X.data.scope3,
456
457
  height: 6
457
458
  }), /* @__PURE__ */ f("p", {
458
459
  className: "text-xs text-text-tertiary",
@@ -462,196 +463,221 @@ function A() {
462
463
  }),
463
464
  /* @__PURE__ */ f(t, {
464
465
  icon: /* @__PURE__ */ f(we, { className: "h-5 w-5" }),
465
- value: Y.data ? o(Y.data.scope1) : "—",
466
+ value: X.data ? o(X.data.scope1) : "—",
466
467
  label: "Scope 1 · Direct",
467
- footer: Be(Y.data?.scope1, Y.data?.total, "SCOPE_1")
468
+ footer: k(X.data?.scope1, X.data?.total, "SCOPE_1")
468
469
  }),
469
470
  /* @__PURE__ */ f(t, {
470
471
  icon: /* @__PURE__ */ f(ke, { className: "h-5 w-5" }),
471
- value: Y.data ? o(Y.data.scope2) : "—",
472
+ value: X.data ? o(X.data.scope2) : "—",
472
473
  label: "Scope 2 · Purchased energy",
473
- footer: Be(Y.data?.scope2, Y.data?.total, "SCOPE_2")
474
+ footer: k(X.data?.scope2, X.data?.total, "SCOPE_2")
474
475
  }),
475
476
  /* @__PURE__ */ f(t, {
476
477
  icon: /* @__PURE__ */ f(Oe, { className: "h-5 w-5" }),
477
- value: Y.data ? o(Y.data.scope3) : "—",
478
+ value: X.data ? o(X.data.scope3) : "—",
478
479
  label: "Scope 3 · Value chain",
479
- footer: Be(Y.data?.scope3, Y.data?.total, "SCOPE_3")
480
+ footer: k(X.data?.scope3, X.data?.total, "SCOPE_3")
480
481
  })
481
482
  ]
482
483
  }),
483
484
  /* @__PURE__ */ f("div", {
484
485
  className: "mt-6",
485
486
  children: /* @__PURE__ */ f(ee, {
486
- items: ht,
487
- value: l,
488
- onChange: A
487
+ items: yt,
488
+ value: j,
489
+ onChange: Ue
489
490
  })
490
491
  }),
491
- l === "ledger" && /* @__PURE__ */ p("div", {
492
+ j === "ledger" && /* @__PURE__ */ p("div", {
492
493
  className: "mt-6",
493
494
  children: [/* @__PURE__ */ p("div", {
494
495
  className: "mb-5 flex flex-wrap items-center gap-3",
495
496
  children: [
496
- /* @__PURE__ */ p(x, {
497
- value: j,
497
+ /* @__PURE__ */ p(b, {
498
+ value: M,
498
499
  onValueChange: (e) => {
499
- Ue(e), P.reset();
500
+ Ke(e), F.reset();
500
501
  },
501
- children: [/* @__PURE__ */ f(w, {
502
+ children: [/* @__PURE__ */ f(C, {
502
503
  className: "w-40",
503
- children: /* @__PURE__ */ f(T, { placeholder: "All scopes" })
504
- }), /* @__PURE__ */ p(S, { children: [/* @__PURE__ */ f(C, {
504
+ children: /* @__PURE__ */ f(w, { placeholder: "All scopes" })
505
+ }), /* @__PURE__ */ p(x, { children: [/* @__PURE__ */ f(S, {
505
506
  value: "ALL",
506
507
  children: "All scopes"
507
- }), E.map((e) => /* @__PURE__ */ f(C, {
508
+ }), T.map((e) => /* @__PURE__ */ f(S, {
508
509
  value: e,
509
510
  children: s(e)
510
511
  }, e))] })]
511
512
  }),
512
- /* @__PURE__ */ p(x, {
513
- value: M,
513
+ /* @__PURE__ */ p(b, {
514
+ value: N,
514
515
  onValueChange: (e) => {
515
- We(e), P.reset();
516
+ qe(e), F.reset();
516
517
  },
517
- children: [/* @__PURE__ */ f(w, {
518
+ children: [/* @__PURE__ */ f(C, {
518
519
  className: "w-40",
519
- children: /* @__PURE__ */ f(T, { placeholder: "All statuses" })
520
- }), /* @__PURE__ */ p(S, { children: [/* @__PURE__ */ f(C, {
520
+ children: /* @__PURE__ */ f(w, { placeholder: "All statuses" })
521
+ }), /* @__PURE__ */ p(x, { children: [/* @__PURE__ */ f(S, {
521
522
  value: "ALL",
522
523
  children: "All statuses"
523
- }), Pe.map((e) => /* @__PURE__ */ f(C, {
524
+ }), Ie.map((e) => /* @__PURE__ */ f(S, {
524
525
  value: e,
525
526
  children: s(e)
526
527
  }, e))] })]
527
528
  }),
528
- /* @__PURE__ */ p(x, {
529
- value: N,
529
+ /* @__PURE__ */ p(b, {
530
+ value: P,
530
531
  onValueChange: (e) => {
531
- Ge(e), P.reset();
532
+ Je(e), F.reset();
532
533
  },
533
- children: [/* @__PURE__ */ f(w, {
534
+ children: [/* @__PURE__ */ f(C, {
534
535
  className: "w-48",
535
- children: /* @__PURE__ */ f(T, { placeholder: "All sites" })
536
- }), /* @__PURE__ */ p(S, { children: [/* @__PURE__ */ f(C, {
536
+ children: /* @__PURE__ */ f(w, { placeholder: "All sites" })
537
+ }), /* @__PURE__ */ p(x, { children: [/* @__PURE__ */ f(S, {
537
538
  value: "ALL",
538
539
  children: "All sites"
539
- }), Object.entries(J).map(([e, t]) => /* @__PURE__ */ f(C, {
540
+ }), Object.entries(Y).map(([e, t]) => /* @__PURE__ */ f(S, {
540
541
  value: e,
541
542
  children: t
542
543
  }, e))] })]
543
544
  })
544
545
  ]
545
- }), X.isLoading ? /* @__PURE__ */ f(ne, { label: "Loading carbon ledger…" }) : X.isError ? /* @__PURE__ */ f(te, {
546
+ }), Z.isLoading ? /* @__PURE__ */ f(ne, { label: "Loading carbon ledger…" }) : Z.isError ? /* @__PURE__ */ f(te, {
546
547
  message: "Couldn't load carbon entries.",
547
- onRetry: () => X.refetch()
548
- }) : Qe.length === 0 ? /* @__PURE__ */ f(i, {
548
+ onRetry: () => Z.refetch()
549
+ }) : tt.length === 0 ? /* @__PURE__ */ f(i, {
549
550
  illustration: "empty-data",
550
- icon: /* @__PURE__ */ f(Ce, { className: "h-10 w-10" }),
551
+ icon: /* @__PURE__ */ f(u, { className: "h-10 w-10" }),
551
552
  title: "No carbon entries",
552
- description: j === "ALL" && M === "ALL" && N === "ALL" ? "Record activity to build your Scope 1–3 emissions ledger." : "No entries match these filters.",
553
+ description: M === "ALL" && N === "ALL" && P === "ALL" ? "Record activity to build your Scope 1–3 emissions ledger." : "No entries match these filters.",
553
554
  action: /* @__PURE__ */ p(m, {
554
- onClick: ot,
555
+ onClick: ut,
555
556
  children: [/* @__PURE__ */ f(d, { className: "mr-1.5 h-4 w-4" }), " Record entry"]
556
557
  })
557
- }) : /* @__PURE__ */ p(Ae, { children: [/* @__PURE__ */ f(r, {
558
- columns: ft,
559
- rows: Qe,
560
- rowKey: (e) => e.id
561
- }), /* @__PURE__ */ f(he, {
562
- page: P.page,
563
- pageSize: Ie,
564
- itemCount: Qe.length,
565
- hasMore: X.data?.pageInfo?.hasMore ?? !1,
566
- onPageChange: (e) => P.onPageChange(e, X.data?.pageInfo?.cursor)
567
- })] })]
558
+ }) : /* @__PURE__ */ p(je, { children: [
559
+ A && /* @__PURE__ */ p("div", {
560
+ role: "status",
561
+ "data-testid": "eco-carbon-highlight-banner",
562
+ className: "mb-3 flex items-center justify-between rounded-lg border border-border-seam bg-bg-sunken px-3 py-2 text-xs text-text-primary",
563
+ children: [/* @__PURE__ */ p("span", { children: [
564
+ "Highlighting cited carbon entry",
565
+ " ",
566
+ /* @__PURE__ */ f("code", {
567
+ className: "font-mono",
568
+ children: A
569
+ })
570
+ ] }), /* @__PURE__ */ f(m, {
571
+ size: "sm",
572
+ variant: "ghost",
573
+ onClick: () => {
574
+ let e = new URLSearchParams(Se);
575
+ e.delete("highlight"), He(e, { replace: !0 });
576
+ },
577
+ children: "Clear highlight"
578
+ })]
579
+ }),
580
+ /* @__PURE__ */ f(r, {
581
+ columns: gt,
582
+ rows: tt,
583
+ rowKey: (e) => e.id,
584
+ rowClassName: (e) => A && e.id === A ? "bg-status-warning-bg-subtle/60 ring-1 ring-inset ring-border-strong" : void 0
585
+ }),
586
+ /* @__PURE__ */ f(he, {
587
+ page: F.page,
588
+ pageSize: Re,
589
+ itemCount: tt.length,
590
+ hasMore: Z.data?.pageInfo?.hasMore ?? !1,
591
+ onPageChange: (e) => F.onPageChange(e, Z.data?.pageInfo?.cursor)
592
+ })
593
+ ] })]
568
594
  }),
569
- l === "drafts" && /* @__PURE__ */ f("div", {
595
+ j === "drafts" && /* @__PURE__ */ f("div", {
570
596
  className: "mt-6",
571
597
  children: /* @__PURE__ */ f(ye, {
572
- sites: J,
573
- onDraftWithAi: () => He(!0)
598
+ sites: Y,
599
+ onDraftWithAi: () => Ge(!0)
574
600
  })
575
601
  }),
576
- l === "factors" && /* @__PURE__ */ p("div", {
602
+ j === "factors" && /* @__PURE__ */ p("div", {
577
603
  className: "mt-6",
578
604
  children: [/* @__PURE__ */ f("div", {
579
605
  className: "mb-5 flex flex-wrap items-center gap-3",
580
- children: /* @__PURE__ */ p(x, {
581
- value: F,
582
- onValueChange: (e) => Ke(e),
583
- children: [/* @__PURE__ */ f(w, {
606
+ children: /* @__PURE__ */ p(b, {
607
+ value: I,
608
+ onValueChange: (e) => Ye(e),
609
+ children: [/* @__PURE__ */ f(C, {
584
610
  className: "w-40",
585
- children: /* @__PURE__ */ f(T, { placeholder: "All scopes" })
586
- }), /* @__PURE__ */ p(S, { children: [/* @__PURE__ */ f(C, {
611
+ children: /* @__PURE__ */ f(w, { placeholder: "All scopes" })
612
+ }), /* @__PURE__ */ p(x, { children: [/* @__PURE__ */ f(S, {
587
613
  value: "ALL",
588
614
  children: "All scopes"
589
- }), E.map((e) => /* @__PURE__ */ f(C, {
615
+ }), T.map((e) => /* @__PURE__ */ f(S, {
590
616
  value: e,
591
617
  children: s(e)
592
618
  }, e))] })]
593
619
  })
594
- }), Z.isLoading ? /* @__PURE__ */ f(ne, { label: "Loading emission factors…" }) : Z.isError ? /* @__PURE__ */ f(te, {
620
+ }), Q.isLoading ? /* @__PURE__ */ f(ne, { label: "Loading emission factors…" }) : Q.isError ? /* @__PURE__ */ f(te, {
595
621
  message: "Couldn't load emission factors.",
596
- onRetry: () => Z.refetch()
597
- }) : et.length === 0 ? /* @__PURE__ */ f(i, {
622
+ onRetry: () => Q.refetch()
623
+ }) : rt.length === 0 ? /* @__PURE__ */ f(i, {
598
624
  illustration: "empty-data",
599
625
  icon: /* @__PURE__ */ f(Te, { className: "h-10 w-10" }),
600
626
  title: "No emission factors",
601
- description: F === "ALL" ? "Add emission factors (kg CO₂e per activity unit) to convert activity into CO₂e." : "No emission factors match this scope.",
627
+ description: I === "ALL" ? "Add emission factors (kg CO₂e per activity unit) to convert activity into CO₂e." : "No emission factors match this scope.",
602
628
  action: /* @__PURE__ */ p(m, {
603
- onClick: () => st(),
629
+ onClick: () => dt(),
604
630
  children: [/* @__PURE__ */ f(d, { className: "mr-1.5 h-4 w-4" }), " New factor"]
605
631
  })
606
632
  }) : /* @__PURE__ */ f(r, {
607
- columns: pt,
608
- rows: et,
633
+ columns: _t,
634
+ rows: rt,
609
635
  rowKey: (e) => e.id
610
636
  })]
611
637
  }),
612
- l === "targets" && /* @__PURE__ */ p("div", {
638
+ j === "targets" && /* @__PURE__ */ p("div", {
613
639
  className: "mt-6",
614
640
  children: [/* @__PURE__ */ f("div", {
615
641
  className: "mb-5 flex flex-wrap items-center gap-3",
616
- children: /* @__PURE__ */ p(x, {
617
- value: I,
618
- onValueChange: (e) => qe(e),
619
- children: [/* @__PURE__ */ f(w, {
642
+ children: /* @__PURE__ */ p(b, {
643
+ value: L,
644
+ onValueChange: (e) => Xe(e),
645
+ children: [/* @__PURE__ */ f(C, {
620
646
  className: "w-44",
621
- children: /* @__PURE__ */ f(T, { placeholder: "All statuses" })
622
- }), /* @__PURE__ */ p(S, { children: [/* @__PURE__ */ f(C, {
647
+ children: /* @__PURE__ */ f(w, { placeholder: "All statuses" })
648
+ }), /* @__PURE__ */ p(x, { children: [/* @__PURE__ */ f(S, {
623
649
  value: "ALL",
624
650
  children: "All statuses"
625
- }), Fe.map((e) => /* @__PURE__ */ f(C, {
651
+ }), Le.map((e) => /* @__PURE__ */ f(S, {
626
652
  value: e,
627
653
  children: s(e)
628
654
  }, e))] })]
629
655
  })
630
- }), Q.isLoading ? /* @__PURE__ */ f(ne, { label: "Loading reduction targets…" }) : Q.isError ? /* @__PURE__ */ f(te, {
656
+ }), $.isLoading ? /* @__PURE__ */ f(ne, { label: "Loading reduction targets…" }) : $.isError ? /* @__PURE__ */ f(te, {
631
657
  message: "Couldn't load reduction targets.",
632
- onRetry: () => Q.refetch()
633
- }) : tt.length === 0 ? /* @__PURE__ */ f(i, {
658
+ onRetry: () => $.refetch()
659
+ }) : it.length === 0 ? /* @__PURE__ */ f(i, {
634
660
  illustration: "empty-data",
635
661
  icon: /* @__PURE__ */ f(De, { className: "h-10 w-10" }),
636
662
  title: "No reduction targets",
637
- description: I === "ALL" ? "Set science-based reduction targets to track progress against a baseline." : "No targets match this status.",
663
+ description: L === "ALL" ? "Set science-based reduction targets to track progress against a baseline." : "No targets match this status.",
638
664
  action: /* @__PURE__ */ p(m, {
639
- onClick: ct,
665
+ onClick: ft,
640
666
  children: [/* @__PURE__ */ f(d, { className: "mr-1.5 h-4 w-4" }), " New target"]
641
667
  })
642
668
  }) : /* @__PURE__ */ f(r, {
643
- columns: mt,
644
- rows: tt,
669
+ columns: vt,
670
+ rows: it,
645
671
  rowKey: (e) => e.id
646
672
  })]
647
673
  }),
648
- /* @__PURE__ */ f(je, {
649
- open: Je,
674
+ /* @__PURE__ */ f(_, {
675
+ open: Ze,
650
676
  onOpenChange: (e) => {
651
- L(e), e || (z(D), q(null));
677
+ R(e), e || (B(E), J(null));
652
678
  },
653
- children: /* @__PURE__ */ p(Me, { children: [
654
- /* @__PURE__ */ p(y, { children: [/* @__PURE__ */ f(b, { children: "Record carbon entry" }), /* @__PURE__ */ f(_, { children: "Log an activity — CO₂e is computed server-side from activity value × emission factor." })] }),
679
+ children: /* @__PURE__ */ p(v, { children: [
680
+ /* @__PURE__ */ p(Pe, { children: [/* @__PURE__ */ f(y, { children: "Record carbon entry" }), /* @__PURE__ */ f(Me, { children: "Log an activity — CO₂e is computed server-side from activity value × emission factor." })] }),
655
681
  /* @__PURE__ */ p("div", {
656
682
  className: "grid gap-4 py-2",
657
683
  children: [
@@ -662,9 +688,9 @@ function A() {
662
688
  children: "Category *"
663
689
  }), /* @__PURE__ */ f(h, {
664
690
  id: "ceCategory",
665
- value: R.category,
666
- onChange: (e) => z({
667
- ...R,
691
+ value: z.category,
692
+ onChange: (e) => B({
693
+ ...z,
668
694
  category: e.target.value
669
695
  }),
670
696
  placeholder: "Diesel generators"
@@ -677,16 +703,16 @@ function A() {
677
703
  children: [/* @__PURE__ */ f(g, {
678
704
  htmlFor: "ceScope",
679
705
  children: "Scope"
680
- }), /* @__PURE__ */ p(x, {
681
- value: R.scope,
682
- onValueChange: (e) => z({
683
- ...R,
706
+ }), /* @__PURE__ */ p(b, {
707
+ value: z.scope,
708
+ onValueChange: (e) => B({
709
+ ...z,
684
710
  scope: e
685
711
  }),
686
- children: [/* @__PURE__ */ f(w, {
712
+ children: [/* @__PURE__ */ f(C, {
687
713
  id: "ceScope",
688
- children: /* @__PURE__ */ f(T, {})
689
- }), /* @__PURE__ */ f(S, { children: E.map((e) => /* @__PURE__ */ f(C, {
714
+ children: /* @__PURE__ */ f(w, {})
715
+ }), /* @__PURE__ */ f(x, { children: T.map((e) => /* @__PURE__ */ f(S, {
690
716
  value: e,
691
717
  children: s(e)
692
718
  }, e)) })]
@@ -699,9 +725,9 @@ function A() {
699
725
  }), /* @__PURE__ */ f(h, {
700
726
  id: "cePeriod",
701
727
  type: "date",
702
- value: R.periodStart,
703
- onChange: (e) => z({
704
- ...R,
728
+ value: z.periodStart,
729
+ onChange: (e) => B({
730
+ ...z,
705
731
  periodStart: e.target.value
706
732
  })
707
733
  })]
@@ -719,9 +745,9 @@ function A() {
719
745
  type: "number",
720
746
  min: "0",
721
747
  step: "any",
722
- value: R.activityValue,
723
- onChange: (e) => z({
724
- ...R,
748
+ value: z.activityValue,
749
+ onChange: (e) => B({
750
+ ...z,
725
751
  activityValue: e.target.value
726
752
  }),
727
753
  placeholder: "1200"
@@ -733,9 +759,9 @@ function A() {
733
759
  children: "Activity unit *"
734
760
  }), /* @__PURE__ */ f(h, {
735
761
  id: "ceUnit",
736
- value: R.activityUnit,
737
- onChange: (e) => z({
738
- ...R,
762
+ value: z.activityUnit,
763
+ onChange: (e) => B({
764
+ ...z,
739
765
  activityUnit: e.target.value
740
766
  }),
741
767
  placeholder: "L, kWh, km"
@@ -749,16 +775,16 @@ function A() {
749
775
  children: [/* @__PURE__ */ f(g, {
750
776
  htmlFor: "ceFactor",
751
777
  children: "Emission factor"
752
- }), /* @__PURE__ */ p(x, {
753
- value: R.factorId,
754
- onValueChange: (e) => z({
755
- ...R,
778
+ }), /* @__PURE__ */ p(b, {
779
+ value: z.factorId,
780
+ onValueChange: (e) => B({
781
+ ...z,
756
782
  factorId: e
757
783
  }),
758
- children: [/* @__PURE__ */ f(w, {
784
+ children: [/* @__PURE__ */ f(C, {
759
785
  id: "ceFactor",
760
- children: /* @__PURE__ */ f(T, { placeholder: "Optional" })
761
- }), /* @__PURE__ */ f(S, { children: ($e.data?.items ?? []).map((e) => /* @__PURE__ */ f(C, {
786
+ children: /* @__PURE__ */ f(w, { placeholder: "Optional" })
787
+ }), /* @__PURE__ */ f(x, { children: (nt.data?.items ?? []).map((e) => /* @__PURE__ */ f(S, {
762
788
  value: e.id,
763
789
  children: e.name
764
790
  }, e.id)) })]
@@ -768,16 +794,16 @@ function A() {
768
794
  children: [/* @__PURE__ */ f(g, {
769
795
  htmlFor: "ceSite",
770
796
  children: "Site"
771
- }), /* @__PURE__ */ p(x, {
772
- value: R.siteId,
773
- onValueChange: (e) => z({
774
- ...R,
797
+ }), /* @__PURE__ */ p(b, {
798
+ value: z.siteId,
799
+ onValueChange: (e) => B({
800
+ ...z,
775
801
  siteId: e
776
802
  }),
777
- children: [/* @__PURE__ */ f(w, {
803
+ children: [/* @__PURE__ */ f(C, {
778
804
  id: "ceSite",
779
- children: /* @__PURE__ */ f(T, { placeholder: "Optional" })
780
- }), /* @__PURE__ */ f(S, { children: Object.entries(J).map(([e, t]) => /* @__PURE__ */ f(C, {
805
+ children: /* @__PURE__ */ f(w, { placeholder: "Optional" })
806
+ }), /* @__PURE__ */ f(x, { children: Object.entries(Y).map(([e, t]) => /* @__PURE__ */ f(S, {
781
807
  value: e,
782
808
  children: t
783
809
  }, e)) })]
@@ -786,22 +812,22 @@ function A() {
786
812
  }),
787
813
  /* @__PURE__ */ f(be, {
788
814
  form: {
789
- activityType: R.category,
790
- unit: R.activityUnit,
791
- periodStart: R.periodStart,
792
- siteId: R.siteId
815
+ activityType: z.category,
816
+ unit: z.activityUnit,
817
+ periodStart: z.periodStart,
818
+ siteId: z.siteId
793
819
  },
794
- selectedFactorId: R.factorId,
795
- onUseFactor: (e, t) => z((n) => ({
820
+ selectedFactorId: z.factorId,
821
+ onUseFactor: (e, t) => B((n) => ({
796
822
  ...n,
797
823
  factorId: e,
798
824
  scope: t ?? n.scope
799
825
  })),
800
826
  onCreateFactor: (e) => {
801
- L(!1), st({
827
+ R(!1), dt({
802
828
  name: e.name,
803
829
  activityUnit: e.unit,
804
- scope: e.scope ?? R.scope
830
+ scope: e.scope ?? z.scope
805
831
  });
806
832
  }
807
833
  }),
@@ -810,41 +836,41 @@ function A() {
810
836
  children: [/* @__PURE__ */ f(g, {
811
837
  htmlFor: "ceNotes",
812
838
  children: "Notes"
813
- }), /* @__PURE__ */ f(Ne, {
839
+ }), /* @__PURE__ */ f(Fe, {
814
840
  id: "ceNotes",
815
841
  rows: 2,
816
- value: R.notes,
817
- onChange: (e) => z({
818
- ...R,
842
+ value: z.notes,
843
+ onChange: (e) => B({
844
+ ...z,
819
845
  notes: e.target.value
820
846
  }),
821
847
  placeholder: "Optional context about this entry."
822
848
  })]
823
849
  }),
824
- K && /* @__PURE__ */ f("p", {
850
+ q && /* @__PURE__ */ f("p", {
825
851
  className: "text-sm text-status-error-text",
826
- children: K
852
+ children: q
827
853
  })
828
854
  ]
829
855
  }),
830
- /* @__PURE__ */ p(v, { children: [/* @__PURE__ */ f(m, {
856
+ /* @__PURE__ */ p(Ne, { children: [/* @__PURE__ */ f(m, {
831
857
  variant: "outline",
832
- onClick: () => L(!1),
858
+ onClick: () => R(!1),
833
859
  children: "Cancel"
834
860
  }), /* @__PURE__ */ f(m, {
835
- onClick: lt,
836
- disabled: nt.isPending,
837
- children: nt.isPending ? "Recording…" : "Record entry"
861
+ onClick: pt,
862
+ disabled: at.isPending,
863
+ children: at.isPending ? "Recording…" : "Record entry"
838
864
  })] })
839
865
  ] })
840
866
  }),
841
- /* @__PURE__ */ f(je, {
842
- open: Ye,
867
+ /* @__PURE__ */ f(_, {
868
+ open: Qe,
843
869
  onOpenChange: (e) => {
844
- B(e), e || (H(O), q(null));
870
+ V(e), e || (U(D), J(null));
845
871
  },
846
- children: /* @__PURE__ */ p(Me, { children: [
847
- /* @__PURE__ */ p(y, { children: [/* @__PURE__ */ f(b, { children: "New emission factor" }), /* @__PURE__ */ f(_, { children: "Define kg CO₂e per activity unit — used to convert ledger activity into CO₂e." })] }),
872
+ children: /* @__PURE__ */ p(v, { children: [
873
+ /* @__PURE__ */ p(Pe, { children: [/* @__PURE__ */ f(y, { children: "New emission factor" }), /* @__PURE__ */ f(Me, { children: "Define kg CO₂e per activity unit — used to convert ledger activity into CO₂e." })] }),
848
874
  /* @__PURE__ */ p("div", {
849
875
  className: "grid gap-4 py-2",
850
876
  children: [
@@ -855,9 +881,9 @@ function A() {
855
881
  children: "Name *"
856
882
  }), /* @__PURE__ */ f(h, {
857
883
  id: "efName",
858
- value: V.name,
859
- onChange: (e) => H({
860
- ...V,
884
+ value: H.name,
885
+ onChange: (e) => U({
886
+ ...H,
861
887
  name: e.target.value
862
888
  }),
863
889
  placeholder: "Diesel (stationary combustion)"
@@ -870,16 +896,16 @@ function A() {
870
896
  children: [/* @__PURE__ */ f(g, {
871
897
  htmlFor: "efScope",
872
898
  children: "Scope"
873
- }), /* @__PURE__ */ p(x, {
874
- value: V.scope,
875
- onValueChange: (e) => H({
876
- ...V,
899
+ }), /* @__PURE__ */ p(b, {
900
+ value: H.scope,
901
+ onValueChange: (e) => U({
902
+ ...H,
877
903
  scope: e
878
904
  }),
879
- children: [/* @__PURE__ */ f(w, {
905
+ children: [/* @__PURE__ */ f(C, {
880
906
  id: "efScope",
881
- children: /* @__PURE__ */ f(T, {})
882
- }), /* @__PURE__ */ f(S, { children: E.map((e) => /* @__PURE__ */ f(C, {
907
+ children: /* @__PURE__ */ f(w, {})
908
+ }), /* @__PURE__ */ f(x, { children: T.map((e) => /* @__PURE__ */ f(S, {
883
909
  value: e,
884
910
  children: s(e)
885
911
  }, e)) })]
@@ -891,9 +917,9 @@ function A() {
891
917
  children: "Activity unit *"
892
918
  }), /* @__PURE__ */ f(h, {
893
919
  id: "efUnit",
894
- value: V.activityUnit,
895
- onChange: (e) => H({
896
- ...V,
920
+ value: H.activityUnit,
921
+ onChange: (e) => U({
922
+ ...H,
897
923
  activityUnit: e.target.value
898
924
  }),
899
925
  placeholder: "kWh, L, km"
@@ -912,9 +938,9 @@ function A() {
912
938
  type: "number",
913
939
  min: "0",
914
940
  step: "any",
915
- value: V.factorKgco2e,
916
- onChange: (e) => H({
917
- ...V,
941
+ value: H.factorKgco2e,
942
+ onChange: (e) => U({
943
+ ...H,
918
944
  factorKgco2e: e.target.value
919
945
  }),
920
946
  placeholder: "2.68"
@@ -928,9 +954,9 @@ function A() {
928
954
  id: "efYear",
929
955
  type: "number",
930
956
  step: "1",
931
- value: V.validYear,
932
- onChange: (e) => H({
933
- ...V,
957
+ value: H.validYear,
958
+ onChange: (e) => U({
959
+ ...H,
934
960
  validYear: e.target.value
935
961
  }),
936
962
  placeholder: "2026"
@@ -944,38 +970,38 @@ function A() {
944
970
  children: "Source"
945
971
  }), /* @__PURE__ */ f(h, {
946
972
  id: "efSource",
947
- value: V.source,
948
- onChange: (e) => H({
949
- ...V,
973
+ value: H.source,
974
+ onChange: (e) => U({
975
+ ...H,
950
976
  source: e.target.value
951
977
  }),
952
978
  placeholder: "DEFRA / IPCC / EPA"
953
979
  })]
954
980
  }),
955
- K && /* @__PURE__ */ f("p", {
981
+ q && /* @__PURE__ */ f("p", {
956
982
  className: "text-sm text-status-error-text",
957
- children: K
983
+ children: q
958
984
  })
959
985
  ]
960
986
  }),
961
- /* @__PURE__ */ p(v, { children: [/* @__PURE__ */ f(m, {
987
+ /* @__PURE__ */ p(Ne, { children: [/* @__PURE__ */ f(m, {
962
988
  variant: "outline",
963
- onClick: () => B(!1),
989
+ onClick: () => V(!1),
964
990
  children: "Cancel"
965
991
  }), /* @__PURE__ */ f(m, {
966
- onClick: ut,
967
- disabled: it.isPending,
968
- children: it.isPending ? "Creating…" : "Create factor"
992
+ onClick: mt,
993
+ disabled: st.isPending,
994
+ children: st.isPending ? "Creating…" : "Create factor"
969
995
  })] })
970
996
  ] })
971
997
  }),
972
- /* @__PURE__ */ f(je, {
973
- open: Xe,
998
+ /* @__PURE__ */ f(_, {
999
+ open: $e,
974
1000
  onOpenChange: (e) => {
975
- U(e), e || (G(k), q(null));
1001
+ W(e), e || (K(O), J(null));
976
1002
  },
977
- children: /* @__PURE__ */ p(Me, { children: [
978
- /* @__PURE__ */ p(y, { children: [/* @__PURE__ */ f(b, { children: "New reduction target" }), /* @__PURE__ */ f(_, { children: "Commit to a measurable reduction from a baseline to a target year." })] }),
1003
+ children: /* @__PURE__ */ p(v, { children: [
1004
+ /* @__PURE__ */ p(Pe, { children: [/* @__PURE__ */ f(y, { children: "New reduction target" }), /* @__PURE__ */ f(Me, { children: "Commit to a measurable reduction from a baseline to a target year." })] }),
979
1005
  /* @__PURE__ */ p("div", {
980
1006
  className: "grid gap-4 py-2",
981
1007
  children: [
@@ -988,9 +1014,9 @@ function A() {
988
1014
  children: "Name *"
989
1015
  }), /* @__PURE__ */ f(h, {
990
1016
  id: "rtName",
991
- value: W.name,
992
- onChange: (e) => G({
993
- ...W,
1017
+ value: G.name,
1018
+ onChange: (e) => K({
1019
+ ...G,
994
1020
  name: e.target.value
995
1021
  }),
996
1022
  placeholder: "Net-zero operations"
@@ -1002,9 +1028,9 @@ function A() {
1002
1028
  children: "Metric *"
1003
1029
  }), /* @__PURE__ */ f(h, {
1004
1030
  id: "rtMetric",
1005
- value: W.metric,
1006
- onChange: (e) => G({
1007
- ...W,
1031
+ value: G.metric,
1032
+ onChange: (e) => K({
1033
+ ...G,
1008
1034
  metric: e.target.value
1009
1035
  }),
1010
1036
  placeholder: "tCO2e/yr"
@@ -1023,9 +1049,9 @@ function A() {
1023
1049
  id: "rtBaseVal",
1024
1050
  type: "number",
1025
1051
  step: "any",
1026
- value: W.baselineValue,
1027
- onChange: (e) => G({
1028
- ...W,
1052
+ value: G.baselineValue,
1053
+ onChange: (e) => K({
1054
+ ...G,
1029
1055
  baselineValue: e.target.value
1030
1056
  }),
1031
1057
  placeholder: "1000"
@@ -1040,9 +1066,9 @@ function A() {
1040
1066
  id: "rtBaseYear",
1041
1067
  type: "number",
1042
1068
  step: "1",
1043
- value: W.baselineYear,
1044
- onChange: (e) => G({
1045
- ...W,
1069
+ value: G.baselineYear,
1070
+ onChange: (e) => K({
1071
+ ...G,
1046
1072
  baselineYear: e.target.value
1047
1073
  }),
1048
1074
  placeholder: "2024"
@@ -1055,9 +1081,9 @@ function A() {
1055
1081
  children: "Unit *"
1056
1082
  }), /* @__PURE__ */ f(h, {
1057
1083
  id: "rtUnit",
1058
- value: W.unit,
1059
- onChange: (e) => G({
1060
- ...W,
1084
+ value: G.unit,
1085
+ onChange: (e) => K({
1086
+ ...G,
1061
1087
  unit: e.target.value
1062
1088
  }),
1063
1089
  placeholder: "tCO2e"
@@ -1076,9 +1102,9 @@ function A() {
1076
1102
  id: "rtTargetVal",
1077
1103
  type: "number",
1078
1104
  step: "any",
1079
- value: W.targetValue,
1080
- onChange: (e) => G({
1081
- ...W,
1105
+ value: G.targetValue,
1106
+ onChange: (e) => K({
1107
+ ...G,
1082
1108
  targetValue: e.target.value
1083
1109
  }),
1084
1110
  placeholder: "0"
@@ -1092,9 +1118,9 @@ function A() {
1092
1118
  id: "rtTargetYear",
1093
1119
  type: "number",
1094
1120
  step: "1",
1095
- value: W.targetYear,
1096
- onChange: (e) => G({
1097
- ...W,
1121
+ value: G.targetYear,
1122
+ onChange: (e) => K({
1123
+ ...G,
1098
1124
  targetYear: e.target.value
1099
1125
  }),
1100
1126
  placeholder: "2030"
@@ -1106,43 +1132,43 @@ function A() {
1106
1132
  children: [/* @__PURE__ */ f(g, {
1107
1133
  htmlFor: "rtDesc",
1108
1134
  children: "Description"
1109
- }), /* @__PURE__ */ f(Ne, {
1135
+ }), /* @__PURE__ */ f(Fe, {
1110
1136
  id: "rtDesc",
1111
1137
  rows: 2,
1112
- value: W.description,
1113
- onChange: (e) => G({
1114
- ...W,
1138
+ value: G.description,
1139
+ onChange: (e) => K({
1140
+ ...G,
1115
1141
  description: e.target.value
1116
1142
  }),
1117
1143
  placeholder: "Optional context about this target."
1118
1144
  })]
1119
1145
  }),
1120
- K && /* @__PURE__ */ f("p", {
1146
+ q && /* @__PURE__ */ f("p", {
1121
1147
  className: "text-sm text-status-error-text",
1122
- children: K
1148
+ children: q
1123
1149
  })
1124
1150
  ]
1125
1151
  }),
1126
- /* @__PURE__ */ p(v, { children: [/* @__PURE__ */ f(m, {
1152
+ /* @__PURE__ */ p(Ne, { children: [/* @__PURE__ */ f(m, {
1127
1153
  variant: "outline",
1128
- onClick: () => U(!1),
1154
+ onClick: () => W(!1),
1129
1155
  children: "Cancel"
1130
1156
  }), /* @__PURE__ */ f(m, {
1131
- onClick: dt,
1132
- disabled: $.isPending,
1133
- children: $.isPending ? "Creating…" : "Create target"
1157
+ onClick: ht,
1158
+ disabled: ct.isPending,
1159
+ children: ct.isPending ? "Creating…" : "Create target"
1134
1160
  })] })
1135
1161
  ] })
1136
1162
  }),
1137
1163
  /* @__PURE__ */ f(ve, {
1138
- open: Ve,
1139
- onOpenChange: He,
1140
- sites: J,
1141
- onReviewDrafts: () => A("drafts")
1164
+ open: We,
1165
+ onOpenChange: Ge,
1166
+ sites: Y,
1167
+ onReviewDrafts: () => Ue("drafts")
1142
1168
  })
1143
1169
  ]
1144
1170
  });
1145
1171
  }
1146
- export { A as CarbonPage };
1172
+ export { He as CarbonPage };
1147
1173
 
1148
1174
  //# sourceMappingURL=CarbonPage.js.map