@burdenoff/microfe-healthybowl 2026.813.21 → 2026.813.22

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.
@@ -3,284 +3,299 @@ import { useBasePath as n } from "../../hooks/useBasePath.js";
3
3
  import { PageLayout as r } from "../../components/PageLayout.js";
4
4
  import { StatusBadge as i } from "../../components/StatusBadge.js";
5
5
  import { EmptyState as ee } from "../../components/EmptyState.js";
6
- import { ErrorState as a } from "../../components/ErrorState.js";
7
- import { ToastContainer as te } from "../../components/Toast.js";
8
- import { useConfirm as ne } from "../../components/ConfirmDialog.js";
9
- import { Breadcrumbs as re } from "../../components/Breadcrumbs.js";
10
- import { PageLoader as ie } from "../../components/PageLoader.js";
11
- import { Modal as ae } from "../../components/Modal.js";
12
- import { isUsableCoordinate as oe } from "../../utils/geo.js";
13
- import { useToast as se } from "../../hooks/useToast.js";
14
- import { FieldMap as ce } from "../../components/FieldMap.js";
15
- import { CreateFarmTaskButton as le } from "../../components/CreateFarmTaskButton.js";
6
+ import { ErrorState as te } from "../../components/ErrorState.js";
7
+ import { ToastContainer as ne } from "../../components/Toast.js";
8
+ import { useConfirm as re } from "../../components/ConfirmDialog.js";
9
+ import { Breadcrumbs as ie } from "../../components/Breadcrumbs.js";
10
+ import { PageLoader as ae } from "../../components/PageLoader.js";
11
+ import { Modal as oe } from "../../components/Modal.js";
12
+ import { isUsableCoordinate as se } from "../../utils/geo.js";
13
+ import { useToast as ce } from "../../hooks/useToast.js";
14
+ import { FieldMap as le } from "../../components/FieldMap.js";
15
+ import { CreateFarmTaskButton as ue } from "../../components/CreateFarmTaskButton.js";
16
16
  import "../../components/index.js";
17
- import { useHealthyBowlData as ue } from "../../hooks/useHealthyBowlData.js";
18
- import { usePlantCatalog as de } from "../../hooks/usePlantCatalog.js";
19
- import { BED_GEOMETRY_NOTICE as fe, DEFAULT_GROW_LOCATION_TYPE as pe, GROW_LOCATION_TYPE_OPTIONS as me, growLocationTypeLabel as he, normalizeGrowLocationType as ge, usesBedGeometry as _e } from "../../utils/growLocationType.js";
20
- import { DEFAULT_BED_WIDTH_M as ve, DEFAULT_CROP_SPACING_PRESET as ye, DEFAULT_PATH_WIDTH_M as be, estimatePlantingCapacity as xe, getCropSpacingPreset as Se } from "../../utils/plantingCapacity.js";
21
- import { useSuccessionPlanning as Ce } from "../../hooks/useSuccessionPlanning.js";
22
- import { computeSeedRate as we } from "../../utils/seedRate.js";
23
- import { buildCropComparison as Te, sortCropComparison as Ee } from "../../utils/cropComparison.js";
24
- import { BedLayoutGrid as De } from "../../components/BedLayoutGrid.js";
25
- import { useCallback as Oe, useEffect as ke, useMemo as o, useState as s } from "react";
26
- import { useI18n as Ae } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
27
- import { Activity as je, ArrowLeft as Me, BarChart3 as Ne, Calendar as Pe, ChevronDown as c, ChevronUp as Fe, CloudRain as Ie, Droplets as Le, Edit as Re, Eye as ze, Leaf as Be, Map as Ve, Plus as He, ScanSearch as Ue, Sprout as We, Sun as Ge, Table2 as Ke, Thermometer as qe, Trash2 as Je, TrendingUp as Ye, Wind as Xe } from "lucide-react";
28
- import { useNavigate as Ze, useParams as Qe } from "react-router";
29
- import { Fragment as l, jsx as u, jsxs as d } from "react/jsx-runtime";
30
- import { Button as f, GlassCard as $e, Select as p, SelectContent as m, SelectItem as h, SelectTrigger as g, SelectValue as _ } from "@burdenoff/fe-libs/ui";
17
+ import { useHealthyBowlData as de } from "../../hooks/useHealthyBowlData.js";
18
+ import { usePlantCatalog as fe } from "../../hooks/usePlantCatalog.js";
19
+ import { BED_GEOMETRY_NOTICE as pe, DEFAULT_GROW_LOCATION_TYPE as me, GROW_GEOMETRY_PROMPT as he, GROW_LOCATION_TYPE_OPTIONS as ge, capacityModelFor as _e, growLocationTypeLabel as ve, normalizeGrowLocationType as ye, usesBedGeometry as be } from "../../utils/growLocationType.js";
20
+ import { GrowGeometryInputs as xe, geometryForType as Se } from "../../components/GrowGeometryInputs.js";
21
+ import { DEFAULT_BED_WIDTH_M as Ce, DEFAULT_CROP_SPACING_PRESET as we, DEFAULT_PATH_WIDTH_M as Te, estimateGrowCapacity as Ee, estimatePlantingCapacity as De, getCropSpacingPreset as Oe } from "../../utils/plantingCapacity.js";
22
+ import { useSuccessionPlanning as ke } from "../../hooks/useSuccessionPlanning.js";
23
+ import { computeSeedRate as Ae } from "../../utils/seedRate.js";
24
+ import { buildCropComparison as je, sortCropComparison as Me } from "../../utils/cropComparison.js";
25
+ import { BedLayoutGrid as Ne } from "../../components/BedLayoutGrid.js";
26
+ import { useCallback as Pe, useEffect as Fe, useMemo as a, useState as o } from "react";
27
+ import { useI18n as Ie } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
28
+ import { Activity as Le, ArrowLeft as Re, BarChart3 as ze, Calendar as Be, ChevronDown as s, ChevronUp as Ve, CloudRain as He, Droplets as Ue, Edit as We, Eye as Ge, Leaf as Ke, Map as qe, Plus as Je, ScanSearch as Ye, Sprout as Xe, Sun as Ze, Table2 as Qe, Thermometer as $e, Trash2 as et, TrendingUp as tt, Wind as nt } from "lucide-react";
29
+ import { useNavigate as rt, useParams as it } from "react-router";
30
+ import { Fragment as c, jsx as l, jsxs as u } from "react/jsx-runtime";
31
+ import { Button as d, GlassCard as at, Select as f, SelectContent as p, SelectItem as m, SelectTrigger as h, SelectValue as g } from "@burdenoff/fe-libs/ui";
31
32
  //#region src/healthybowl/pages/crops/FieldDetailsPage.tsx
32
- var et = (e) => {
33
+ var ot = (e) => {
33
34
  switch (e) {
34
35
  case "active": return "success";
35
36
  case "fallow": return "muted";
36
37
  case "preparation": return "warning";
37
38
  default: return "default";
38
39
  }
39
- }, tt = (e) => {
40
+ }, st = (e) => {
40
41
  switch (e) {
41
42
  case "optimal": return "success";
42
43
  case "acceptable": return "info";
43
44
  case "needs_attention": return "warning";
44
45
  default: return "error";
45
46
  }
46
- }, v = (e, t) => {
47
+ }, _ = (e, t) => {
47
48
  let n = Number(e);
48
49
  return Number.isFinite(n) && n > 0 ? n : t;
49
- }, nt = (e, t) => {
50
+ }, ct = (e, t) => {
50
51
  let n = Number(e);
51
52
  return Number.isFinite(n) && n >= 0 ? n : t;
52
- }, y = (e, t = 1) => new Intl.NumberFormat("en-US", { maximumFractionDigits: t }).format(e), rt = () => {
53
- let { t: c } = Ae(), Fe = ne(), { fields: rt, crops: C, soilTests: it, weatherData: at, errors: ot, loadings: st, updateField: ct, deleteField: lt, refetch: ut } = ue(), { fieldId: dt } = Qe(), w = Ze(), { buildPath: T } = n(), { toasts: ft, toast: E, dismiss: pt } = se(), [mt, D] = s(!1), [ht, O] = s(!1), k = rt.find((e) => e.id === dt), gt = o(() => {
54
- let e = k?.location, t = {
53
+ }, v = (e, t = 1) => new Intl.NumberFormat("en-US", { maximumFractionDigits: t }).format(e), lt = () => {
54
+ let { t: s } = Ie(), Ve = re(), { fields: lt, crops: S, soilTests: ut, weatherData: dt, errors: ft, loadings: pt, updateField: mt, deleteField: ht, refetch: gt } = de(), { fieldId: _t } = it(), C = rt(), { buildPath: w } = n(), { toasts: vt, toast: T, dismiss: yt } = ce(), [bt, xt] = o(!1), [St, Ct] = o(!1), E = lt.find((e) => e.id === _t), wt = a(() => {
55
+ let e = E?.location, t = {
55
56
  lat: Number(e?.lat),
56
57
  lng: Number(e?.lng)
57
58
  };
58
- return oe(t) ? t : null;
59
- }, [k]), [A, _t] = s(""), [vt, yt] = s(""), [bt, xt] = s("acres"), [St, Ct] = s(""), [wt, Tt] = s(""), [Et, Dt] = s("active"), [Ot, kt] = s(pe), [At, jt] = s(!1), [j, Mt] = s(""), { entries: M } = de(), [N, Nt] = s(""), [Pt, Ft] = s(String(ye.plantSpacingCm)), [It, P] = s(String(ye.rowSpacingCm)), [F, Lt] = s(String(ve)), [I, Rt] = s(String(be)), [L, zt] = s(null), Bt = () => {
60
- k && (_t(k.name), yt(String(k.area)), xt(k.unit ?? "acres"), Ct(k.soilType), Tt(k.irrigationType), Dt(k.status), kt(ge(k.type) ?? "OPEN_FIELD"), jt(k.organicCertified), D(!0));
61
- }, Vt = async () => {
62
- if (k) {
63
- if (!A.trim() || !vt) {
64
- E({
65
- title: c("healthybowl.crops.fieldDetail.toast.missingFields.title", "Missing required fields"),
66
- description: c("healthybowl.crops.fieldDetail.toast.missingFields.description", "Name and area are required."),
59
+ return se(t) ? t : null;
60
+ }, [E]), [D, Tt] = o(""), [Et, Dt] = o(""), [Ot, kt] = o("acres"), [At, jt] = o(""), [Mt, Nt] = o(""), [Pt, Ft] = o("active"), [O, It] = o(me), [Lt, Rt] = o(!1), [zt, Bt] = o({}), [k, Vt] = o(""), { entries: A } = fe(), [j, Ht] = o(""), [M, N] = o(String(we.plantSpacingCm)), [P, F] = o(String(we.rowSpacingCm)), [I, Ut] = o(String(Ce)), [L, Wt] = o(String(Te)), [R, Gt] = o(null), Kt = () => {
61
+ E && (Tt(E.name), Dt(String(E.area)), kt(E.unit ?? "acres"), jt(E.soilType), Nt(E.irrigationType), Ft(E.status), It(ye(E.type) ?? "OPEN_FIELD"), Rt(E.organicCertified), Bt(E.growGeometry ?? {}), xt(!0));
62
+ }, qt = async () => {
63
+ if (E) {
64
+ if (!D.trim() || !Et) {
65
+ T({
66
+ title: s("healthybowl.crops.fieldDetail.toast.missingFields.title", "Missing required fields"),
67
+ description: s("healthybowl.crops.fieldDetail.toast.missingFields.description", "Name and area are required."),
67
68
  variant: "warning"
68
69
  });
69
70
  return;
70
71
  }
71
- O(!0);
72
+ Ct(!0);
72
73
  try {
73
- await ct({
74
- id: k.id,
75
- name: A.trim(),
76
- area: Number(vt),
77
- unit: bt,
78
- soilType: St.trim() || "Unknown",
79
- irrigationType: wt.trim() || "None",
80
- status: Et,
81
- type: Ot,
82
- organicCertified: At
83
- }), E({
84
- title: c("healthybowl.crops.fieldDetail.toast.updated.title", "Field updated"),
85
- description: c("healthybowl.crops.fieldDetail.toast.updated.description", "{{name}} has been saved.", { name: A.trim() }),
74
+ await mt({
75
+ id: E.id,
76
+ name: D.trim(),
77
+ area: Number(Et),
78
+ unit: Ot,
79
+ soilType: At.trim() || "Unknown",
80
+ irrigationType: Mt.trim() || "None",
81
+ status: Pt,
82
+ type: O,
83
+ organicCertified: Lt,
84
+ growGeometry: Se(O, zt)
85
+ }), T({
86
+ title: s("healthybowl.crops.fieldDetail.toast.updated.title", "Field updated"),
87
+ description: s("healthybowl.crops.fieldDetail.toast.updated.description", "{{name}} has been saved.", { name: D.trim() }),
86
88
  variant: "success"
87
- }), D(!1);
89
+ }), xt(!1);
88
90
  } catch (e) {
89
- E({
90
- title: c("healthybowl.crops.fieldDetail.toast.updateFailed.title", "Update failed"),
91
+ T({
92
+ title: s("healthybowl.crops.fieldDetail.toast.updateFailed.title", "Update failed"),
91
93
  description: String(e),
92
94
  variant: "error"
93
95
  });
94
96
  } finally {
95
- O(!1);
97
+ Ct(!1);
96
98
  }
97
99
  }
98
- }, Ht = async () => {
99
- if (k && await Fe({
100
- title: c("healthybowl.crops.fieldDetail.deleteConfirm.title", "Delete field?"),
101
- message: c("healthybowl.crops.fieldDetail.deleteConfirm.message", "{{name}} will be permanently removed.", { name: k.name }),
102
- okButtonTitle: c("healthybowl.common.delete", "Delete"),
103
- cancelButtonTitle: c("healthybowl.common.cancel", "Cancel")
100
+ }, Jt = async () => {
101
+ if (E && await Ve({
102
+ title: s("healthybowl.crops.fieldDetail.deleteConfirm.title", "Delete field?"),
103
+ message: s("healthybowl.crops.fieldDetail.deleteConfirm.message", "{{name}} will be permanently removed.", { name: E.name }),
104
+ okButtonTitle: s("healthybowl.common.delete", "Delete"),
105
+ cancelButtonTitle: s("healthybowl.common.cancel", "Cancel")
104
106
  }) !== !1) {
105
- O(!0);
107
+ Ct(!0);
106
108
  try {
107
- await lt(k.id), E({
108
- title: c("healthybowl.crops.fieldDetail.toast.deleted.title", "Field deleted"),
109
- description: c("healthybowl.crops.fieldDetail.toast.deleted.description", "{{name}} has been removed.", { name: k.name }),
109
+ await ht(E.id), T({
110
+ title: s("healthybowl.crops.fieldDetail.toast.deleted.title", "Field deleted"),
111
+ description: s("healthybowl.crops.fieldDetail.toast.deleted.description", "{{name}} has been removed.", { name: E.name }),
110
112
  variant: "success"
111
- }), w(T("crops/fields"));
113
+ }), C(w("crops/fields"));
112
114
  } catch (e) {
113
- E({
114
- title: c("healthybowl.crops.fieldDetail.toast.deleteFailed.title", "Delete failed"),
115
+ T({
116
+ title: s("healthybowl.crops.fieldDetail.toast.deleteFailed.title", "Delete failed"),
115
117
  description: String(e),
116
118
  variant: "error"
117
- }), O(!1);
119
+ }), Ct(!1);
118
120
  }
119
121
  }
120
- }, R = o(() => k ? C.filter((e) => e.field === k.id || e.fieldName === k.name) : [], [C, k]), Ut = k ? `${T("pest-management/ai-detection")}?${new URLSearchParams({ fieldId: k.id }).toString()}` : T("pest-management/ai-detection"), z = o(() => {
122
+ }, z = a(() => E ? S.filter((e) => e.field === E.id || e.fieldName === E.name) : [], [S, E]), Yt = E ? `${w("pest-management/ai-detection")}?${new URLSearchParams({ fieldId: E.id }).toString()}` : w("pest-management/ai-detection"), B = a(() => {
121
123
  let e = /* @__PURE__ */ new Set();
122
- return [...R, ...C].filter((t) => !e.has(t.id) && !!e.add(t.id));
123
- }, [C, R]), Wt = o(() => R[0] ?? z[0] ?? null, [z, R]), B = o(() => z.find((e) => e.id === j) ?? Wt, [
124
- j,
125
- z,
126
- Wt
127
- ]), V = o(() => Se(B), [B]), H = L != null && L > 0 ? L : k?.area ?? 0, Gt = L != null && L > 0, U = _e(k?.type), Kt = he(c, k?.type), W = o(() => !k || !U ? null : xe({
128
- fieldArea: H,
129
- fieldUnit: k.unit,
130
- bedWidthM: v(F, ve),
131
- pathWidthM: nt(I, be),
132
- plantSpacingCm: v(Pt, V.plantSpacingCm),
133
- rowSpacingCm: v(It, V.rowSpacingCm)
134
- }), [
135
- U,
136
- F,
137
- H,
124
+ return [...z, ...S].filter((t) => !e.has(t.id) && !!e.add(t.id));
125
+ }, [S, z]), Xt = a(() => z[0] ?? B[0] ?? null, [B, z]), V = a(() => B.find((e) => e.id === k) ?? Xt, [
138
126
  k,
127
+ B,
128
+ Xt
129
+ ]), H = a(() => Oe(V), [V]), U = R != null && R > 0 ? R : E?.area ?? 0, Zt = R != null && R > 0, W = be(E?.type), Qt = ve(s, E?.type), G = a(() => !E || !W ? null : De({
130
+ fieldArea: U,
131
+ fieldUnit: E.unit,
132
+ bedWidthM: _(I, Ce),
133
+ pathWidthM: ct(L, Te),
134
+ plantSpacingCm: _(M, H.plantSpacingCm),
135
+ rowSpacingCm: _(P, H.rowSpacingCm)
136
+ }), [
137
+ W,
139
138
  I,
140
- Pt,
141
- It,
142
- V
143
- ]);
144
- ke(() => {
145
- if (!B || j === B.id) return;
146
- let e = Se(B);
147
- Mt(B.id), Ft(String(e.plantSpacingCm)), P(String(e.rowSpacingCm));
148
- }, [j, B]);
149
- let qt = (e) => {
150
- let t = z.find((t) => t.id === e);
151
- Mt(e), Nt("");
152
- let n = Se(t);
153
- Ft(String(n.plantSpacingCm)), P(String(n.rowSpacingCm));
154
- }, Jt = (e) => {
155
- if (Nt(e), e === "none") {
156
- Nt("");
139
+ U,
140
+ E,
141
+ L,
142
+ M,
143
+ P,
144
+ H
145
+ ]), K = a(() => E ? Ee({
146
+ type: E.type,
147
+ geometry: E.growGeometry,
148
+ fieldArea: U,
149
+ fieldUnit: E.unit,
150
+ plantSpacingCm: _(M, H.plantSpacingCm),
151
+ rowSpacingCm: _(P, H.rowSpacingCm)
152
+ }) : null, [
153
+ E,
154
+ U,
155
+ M,
156
+ P,
157
+ H
158
+ ]), $t = !W && _e(E?.type) !== "NONE" && K === null;
159
+ Fe(() => {
160
+ if (!V || k === V.id) return;
161
+ let e = Oe(V);
162
+ Vt(V.id), N(String(e.plantSpacingCm)), F(String(e.rowSpacingCm));
163
+ }, [k, V]);
164
+ let en = (e) => {
165
+ let t = B.find((t) => t.id === e);
166
+ Vt(e), Ht("");
167
+ let n = Oe(t);
168
+ N(String(n.plantSpacingCm)), F(String(n.rowSpacingCm));
169
+ }, tn = (e) => {
170
+ if (Ht(e), e === "none") {
171
+ Ht("");
157
172
  return;
158
173
  }
159
- let t = M.find((t) => t.id === e);
160
- t && (t.plantSpacingCm != null && Ft(String(t.plantSpacingCm)), t.rowSpacingCm != null && P(String(t.rowSpacingCm)));
161
- }, G = o(() => {
162
- let e = N ? M.find((e) => e.id === N) : void 0;
174
+ let t = A.find((t) => t.id === e);
175
+ t && (t.plantSpacingCm != null && N(String(t.plantSpacingCm)), t.rowSpacingCm != null && F(String(t.rowSpacingCm)));
176
+ }, q = a(() => {
177
+ let e = j ? A.find((e) => e.id === j) : void 0;
163
178
  if (e) return e;
164
- if (!B) return;
165
- let t = (B.name ?? "").trim().toLowerCase();
179
+ if (!V) return;
180
+ let t = (V.name ?? "").trim().toLowerCase();
166
181
  if (!t) return;
167
- let n = (B.variety ?? "").trim().toLowerCase();
168
- return M.find((e) => (e.name ?? "").trim().toLowerCase() === t && (e.variety ?? "").trim().toLowerCase() === n) ?? M.find((e) => (e.name ?? "").trim().toLowerCase() === t);
182
+ let n = (V.variety ?? "").trim().toLowerCase();
183
+ return A.find((e) => (e.name ?? "").trim().toLowerCase() === t && (e.variety ?? "").trim().toLowerCase() === n) ?? A.find((e) => (e.name ?? "").trim().toLowerCase() === t);
169
184
  }, [
170
- N,
171
- M,
172
- B
173
- ]), K = o(() => W ? we({
174
- plantsNeeded: W.totalPlants,
175
- seedsPerGram: G?.seedsPerGram,
176
- germinationRate: G?.germinationRate,
177
- seedsPerCell: G?.seedsPerCell
178
- }) : null, [W, G]), [q, Yt] = s("label"), [J, Xt] = s("asc"), Zt = o(() => !k || !U || M.length === 0 ? [] : Te(M, {
179
- fieldArea: H,
180
- fieldUnit: k.unit,
181
- bedWidthM: v(F, ve),
182
- pathWidthM: nt(I, be)
185
+ j,
186
+ A,
187
+ V
188
+ ]), J = a(() => G ? Ae({
189
+ plantsNeeded: G.totalPlants,
190
+ seedsPerGram: q?.seedsPerGram,
191
+ germinationRate: q?.germinationRate,
192
+ seedsPerCell: q?.seedsPerCell
193
+ }) : null, [G, q]), [Y, nn] = o("label"), [X, rn] = o("asc"), an = a(() => !E || !W || A.length === 0 ? [] : je(A, {
194
+ fieldArea: U,
195
+ fieldUnit: E.unit,
196
+ bedWidthM: _(I, Ce),
197
+ pathWidthM: ct(L, Te)
183
198
  }), [
184
- U,
185
- F,
186
- H,
187
- k,
199
+ W,
188
200
  I,
189
- M
190
- ]), Y = o(() => Ee(Zt, q, J), [
191
- Zt,
192
- q,
193
- J
194
- ]), X = Oe((e) => {
195
- if (e === q) {
196
- Xt((e) => e === "asc" ? "desc" : "asc");
201
+ U,
202
+ E,
203
+ L,
204
+ A
205
+ ]), on = a(() => Me(an, Y, X), [
206
+ an,
207
+ Y,
208
+ X
209
+ ]), Z = Pe((e) => {
210
+ if (e === Y) {
211
+ rn((e) => e === "asc" ? "desc" : "asc");
197
212
  return;
198
213
  }
199
- Yt(e), Xt(e === "label" ? "asc" : "desc");
200
- }, [q]), { successionPlans: Qt, beds: $t, createSuccession: en, deletePlan: tn } = Ce(k?.id), [Z, nn] = s(() => (/* @__PURE__ */ new Date()).toISOString().split("T")[0]), [rn, an] = s("14"), [on, sn] = s("4"), [cn, ln] = s(""), [un, dn] = s(!1), fn = o(() => {
214
+ nn(e), rn(e === "label" ? "asc" : "desc");
215
+ }, [Y]), { successionPlans: sn, beds: cn, createSuccession: ln, deletePlan: un } = ke(E?.id), [dn, fn] = o(() => (/* @__PURE__ */ new Date()).toISOString().split("T")[0]), [pn, mn] = o("14"), [hn, gn] = o("4"), [_n, vn] = o(""), [yn, bn] = o(!1), xn = a(() => {
201
216
  let e = /* @__PURE__ */ new Map();
202
- for (let t of Qt) {
217
+ for (let t of sn) {
203
218
  let n = String(t.successionGroupId), r = e.get(n);
204
219
  r ? r.push(t) : e.set(n, [t]);
205
220
  }
206
221
  return Array.from(e.entries());
207
- }, [Qt]), pn = Oe((e) => {
208
- let t = e.cropId ? C.find((t) => t.id === e.cropId) : void 0;
222
+ }, [sn]), Sn = Pe((e) => {
223
+ let t = e.cropId ? S.find((t) => t.id === e.cropId) : void 0;
209
224
  if (t) return t.variety ? `${t.name} - ${t.variety}` : t.name;
210
- let n = e.plantCatalogId ? M.find((t) => t.id === e.plantCatalogId) : void 0;
225
+ let n = e.plantCatalogId ? A.find((t) => t.id === e.plantCatalogId) : void 0;
211
226
  if (n?.name?.trim()) return n.variety ? `${n.name} - ${n.variety}` : n.name;
212
227
  let r = e.cropName?.trim();
213
228
  if (r && !/^unknown(\s+crop)?$/i.test(r)) return r;
214
- let i = R[0];
229
+ let i = z[0];
215
230
  return i ? i.variety ? `${i.name} - ${i.variety}` : i.name : "—";
216
231
  }, [
217
- C,
218
- M,
219
- R
220
- ]), mn = async () => {
221
- if (!k) return;
222
- let e = Number(rn), t = Number(on);
223
- if (!Z || !Number.isFinite(e) || e < 1 || !Number.isFinite(t) || t < 1) {
224
- E({
225
- title: c("healthybowl.crops.fieldDetail.succession.toast.invalid.title", "Check the schedule inputs"),
226
- description: c("healthybowl.crops.fieldDetail.succession.toast.invalid.description", "A start date, an interval of at least 1 day and at least 1 sowing are required."),
232
+ S,
233
+ A,
234
+ z
235
+ ]), Cn = async () => {
236
+ if (!E) return;
237
+ let e = Number(pn), t = Number(hn);
238
+ if (!dn || !Number.isFinite(e) || e < 1 || !Number.isFinite(t) || t < 1) {
239
+ T({
240
+ title: s("healthybowl.crops.fieldDetail.succession.toast.invalid.title", "Check the schedule inputs"),
241
+ description: s("healthybowl.crops.fieldDetail.succession.toast.invalid.description", "A start date, an interval of at least 1 day and at least 1 sowing are required."),
227
242
  variant: "warning"
228
243
  });
229
244
  return;
230
245
  }
231
- dn(!0);
246
+ bn(!0);
232
247
  try {
233
- let n = await en({
234
- fieldId: k.id,
235
- bedId: cn || void 0,
236
- cropId: B?.id ?? void 0,
237
- plantCatalogId: N || void 0,
238
- season: B?.season ? B.season.toUpperCase() : void 0,
239
- year: new Date(Z).getFullYear(),
240
- startDate: Z,
248
+ let n = await ln({
249
+ fieldId: E.id,
250
+ bedId: _n || void 0,
251
+ cropId: V?.id ?? void 0,
252
+ plantCatalogId: j || void 0,
253
+ season: V?.season ? V.season.toUpperCase() : void 0,
254
+ year: new Date(dn).getFullYear(),
255
+ startDate: dn,
241
256
  intervalDays: e,
242
257
  count: t,
243
- plantsNeeded: W?.totalPlants,
244
- seedGrams: K?.seedGrams ?? void 0,
245
- seedlingsToRaise: K?.seedlingsToRaise,
246
- density: W?.densityPlantsPerSqm
258
+ plantsNeeded: G?.totalPlants,
259
+ seedGrams: J?.seedGrams ?? void 0,
260
+ seedlingsToRaise: J?.seedlingsToRaise,
261
+ density: G?.densityPlantsPerSqm
247
262
  });
248
- E({
249
- title: c("healthybowl.crops.fieldDetail.succession.toast.created.title", "Succession schedule created"),
250
- description: c("healthybowl.crops.fieldDetail.succession.toast.created.description", "{{count}} sowings scheduled.", { count: n.length || t }),
263
+ T({
264
+ title: s("healthybowl.crops.fieldDetail.succession.toast.created.title", "Succession schedule created"),
265
+ description: s("healthybowl.crops.fieldDetail.succession.toast.created.description", "{{count}} sowings scheduled.", { count: n.length || t }),
251
266
  variant: "success"
252
267
  });
253
268
  } catch (e) {
254
- E({
255
- title: c("healthybowl.crops.fieldDetail.succession.toast.failed.title", "Could not create schedule"),
269
+ T({
270
+ title: s("healthybowl.crops.fieldDetail.succession.toast.failed.title", "Could not create schedule"),
256
271
  description: e instanceof Error ? e.message : String(e),
257
272
  variant: "error"
258
273
  });
259
274
  } finally {
260
- dn(!1);
275
+ bn(!1);
261
276
  }
262
- }, hn = async (e) => {
263
- if (await Fe({
264
- title: c("healthybowl.crops.fieldDetail.succession.deleteConfirm.title", "Delete this sowing?"),
265
- message: c("healthybowl.crops.fieldDetail.succession.deleteConfirm.message", "This sowing will be permanently removed from the schedule."),
266
- okButtonTitle: c("healthybowl.common.delete", "Delete"),
267
- cancelButtonTitle: c("healthybowl.common.cancel", "Cancel")
277
+ }, wn = async (e) => {
278
+ if (await Ve({
279
+ title: s("healthybowl.crops.fieldDetail.succession.deleteConfirm.title", "Delete this sowing?"),
280
+ message: s("healthybowl.crops.fieldDetail.succession.deleteConfirm.message", "This sowing will be permanently removed from the schedule."),
281
+ okButtonTitle: s("healthybowl.common.delete", "Delete"),
282
+ cancelButtonTitle: s("healthybowl.common.cancel", "Cancel")
268
283
  }) !== !1) try {
269
- await tn(e.id), E({
270
- title: c("healthybowl.crops.fieldDetail.succession.toast.deleted.title", "Sowing removed"),
271
- description: c("healthybowl.crops.fieldDetail.succession.toast.deleted.description", "The sowing was deleted."),
284
+ await un(e.id), T({
285
+ title: s("healthybowl.crops.fieldDetail.succession.toast.deleted.title", "Sowing removed"),
286
+ description: s("healthybowl.crops.fieldDetail.succession.toast.deleted.description", "The sowing was deleted."),
272
287
  variant: "success"
273
288
  });
274
289
  } catch (e) {
275
- E({
276
- title: c("healthybowl.crops.fieldDetail.succession.toast.deleteFailed.title", "Could not delete sowing"),
290
+ T({
291
+ title: s("healthybowl.crops.fieldDetail.succession.toast.deleteFailed.title", "Could not delete sowing"),
277
292
  description: e instanceof Error ? e.message : String(e),
278
293
  variant: "error"
279
294
  });
280
295
  }
281
- }, Q = k ? it.find((e) => e.fieldName === k.name) : void 0, $ = {
282
- location: at?.location ?? "",
283
- current: at?.current ?? {
296
+ }, Q = E ? ut.find((e) => e.fieldName === E.name) : void 0, $ = {
297
+ location: dt?.location ?? "",
298
+ current: dt?.current ?? {
284
299
  temperature: 0,
285
300
  condition: "N/A",
286
301
  feelsLike: 0,
@@ -290,94 +305,94 @@ var et = (e) => {
290
305
  pressure: 0,
291
306
  visibility: 0
292
307
  },
293
- forecast: at?.forecast ?? []
294
- }, gn = o(() => {
308
+ forecast: dt?.forecast ?? []
309
+ }, Tn = a(() => {
295
310
  let e = [];
296
- return R.forEach((t) => {
311
+ return z.forEach((t) => {
297
312
  t.plantingDate && e.push({
298
313
  date: t.plantingDate,
299
- action: c("healthybowl.crops.fieldDetail.timeline.planted", "{{name}} ({{variety}}) planted", {
314
+ action: s("healthybowl.crops.fieldDetail.timeline.planted", "{{name}} ({{variety}}) planted", {
300
315
  name: t.name,
301
316
  variety: t.variety
302
317
  }),
303
318
  type: "planting"
304
319
  }), t.expectedHarvestDate && e.push({
305
320
  date: t.expectedHarvestDate,
306
- action: c("healthybowl.crops.fieldDetail.timeline.expectedHarvest", "{{name}} expected harvest", { name: t.name }),
321
+ action: s("healthybowl.crops.fieldDetail.timeline.expectedHarvest", "{{name}} expected harvest", { name: t.name }),
307
322
  type: "harvest"
308
323
  });
309
324
  }), Q && e.push({
310
325
  date: Q.date,
311
- action: c("healthybowl.crops.fieldDetail.timeline.soilTestConducted", "Soil test conducted"),
326
+ action: s("healthybowl.crops.fieldDetail.timeline.soilTestConducted", "Soil test conducted"),
312
327
  type: "testing"
313
328
  }), e.sort((e, t) => new Date(t.date).getTime() - new Date(e.date).getTime()), e.length === 0 ? [{
314
329
  date: (/* @__PURE__ */ new Date()).toISOString().split("T")[0],
315
- action: c("healthybowl.crops.fieldDetail.timeline.noActivity", "No activity recorded yet"),
330
+ action: s("healthybowl.crops.fieldDetail.timeline.noActivity", "No activity recorded yet"),
316
331
  type: "info"
317
332
  }] : e.slice(0, 5);
318
333
  }, [
319
- R,
334
+ z,
320
335
  Q,
321
- c
322
- ]), _n = o(() => R.length === 0 ? [{
323
- season: c("healthybowl.crops.fieldDetail.cropHistory.currentSeason", "Current"),
324
- crop: c("healthybowl.crops.fieldDetail.cropHistory.noCropsPlanted", "No crops planted"),
336
+ s
337
+ ]), En = a(() => z.length === 0 ? [{
338
+ season: s("healthybowl.crops.fieldDetail.cropHistory.currentSeason", "Current"),
339
+ crop: s("healthybowl.crops.fieldDetail.cropHistory.noCropsPlanted", "No crops planted"),
325
340
  status: "fallow"
326
- }] : R.map((e) => ({
341
+ }] : z.map((e) => ({
327
342
  season: `${e.season.charAt(0).toUpperCase() + e.season.slice(1)} - ${e.plantingDate ? new Date(e.plantingDate).getFullYear() : "N/A"}`,
328
343
  crop: `${e.name} (${e.variety})`,
329
344
  status: e.status === "harvested" ? "completed" : "active"
330
- })), [R, c]);
331
- return k ? /* @__PURE__ */ d(r, {
332
- title: k.name,
333
- description: c("healthybowl.crops.fieldDetail.header.description", "{{area}} {{unit}} - {{soilType}}", {
334
- area: k.area,
335
- unit: k.unit,
336
- soilType: k.soilType
345
+ })), [z, s]);
346
+ return E ? /* @__PURE__ */ u(r, {
347
+ title: E.name,
348
+ description: s("healthybowl.crops.fieldDetail.header.description", "{{area}} {{unit}} - {{soilType}}", {
349
+ area: E.area,
350
+ unit: E.unit,
351
+ soilType: E.soilType
337
352
  }),
338
- actions: /* @__PURE__ */ d("div", {
353
+ actions: /* @__PURE__ */ u("div", {
339
354
  className: "flex items-center gap-2",
340
355
  children: [
341
- /* @__PURE__ */ u(le, {
356
+ /* @__PURE__ */ l(ue, {
342
357
  entityType: "FIELD",
343
- entityId: k.id,
344
- entityLabel: k.name
358
+ entityId: E.id,
359
+ entityLabel: E.name
345
360
  }),
346
- /* @__PURE__ */ d(f, {
361
+ /* @__PURE__ */ u(d, {
347
362
  variant: "outline",
348
- onClick: () => w(Ut),
363
+ onClick: () => C(Yt),
349
364
  children: [
350
- /* @__PURE__ */ u(Ue, { className: "h-4 w-4" }),
365
+ /* @__PURE__ */ l(Ye, { className: "h-4 w-4" }),
351
366
  " ",
352
- c("healthybowl.crops.fieldDetail.actions.diagnose", "Diagnose")
367
+ s("healthybowl.crops.fieldDetail.actions.diagnose", "Diagnose")
353
368
  ]
354
369
  }),
355
- /* @__PURE__ */ d(f, {
370
+ /* @__PURE__ */ u(d, {
356
371
  variant: "outline",
357
- onClick: () => w(T("crops/fields")),
372
+ onClick: () => C(w("crops/fields")),
358
373
  children: [
359
- /* @__PURE__ */ u(Me, { className: "h-4 w-4" }),
374
+ /* @__PURE__ */ l(Re, { className: "h-4 w-4" }),
360
375
  " ",
361
- c("healthybowl.crops.fieldDetail.actions.backToFields", "Back to Fields")
376
+ s("healthybowl.crops.fieldDetail.actions.backToFields", "Back to Fields")
362
377
  ]
363
378
  }),
364
- /* @__PURE__ */ d(f, {
379
+ /* @__PURE__ */ u(d, {
365
380
  variant: "outline",
366
- onClick: Bt,
381
+ onClick: Kt,
367
382
  children: [
368
- /* @__PURE__ */ u(Re, { className: "h-4 w-4" }),
383
+ /* @__PURE__ */ l(We, { className: "h-4 w-4" }),
369
384
  " ",
370
- c("healthybowl.crops.fieldDetail.actions.editField", "Edit Field")
385
+ s("healthybowl.crops.fieldDetail.actions.editField", "Edit Field")
371
386
  ]
372
387
  }),
373
- /* @__PURE__ */ d(f, {
388
+ /* @__PURE__ */ u(d, {
374
389
  variant: "destructive",
375
- onClick: Ht,
376
- disabled: ht,
390
+ onClick: Jt,
391
+ disabled: St,
377
392
  children: [
378
- /* @__PURE__ */ u(Je, { className: "h-4 w-4" }),
393
+ /* @__PURE__ */ l(et, { className: "h-4 w-4" }),
379
394
  " ",
380
- c("healthybowl.common.delete", "Delete")
395
+ s("healthybowl.common.delete", "Delete")
381
396
  ]
382
397
  })
383
398
  ]
@@ -386,455 +401,492 @@ var et = (e) => {
386
401
  nextSteps: [
387
402
  {
388
403
  id: "diagnose",
389
- label: c("healthybowl.crops.fieldDetail.nextSteps.diagnose.label", "Diagnose a plant in this field"),
390
- description: c("healthybowl.crops.fieldDetail.nextSteps.diagnose.desc", "Upload a plant photo and check for pest or disease symptoms in this field."),
391
- href: Ut
404
+ label: s("healthybowl.crops.fieldDetail.nextSteps.diagnose.label", "Diagnose a plant in this field"),
405
+ description: s("healthybowl.crops.fieldDetail.nextSteps.diagnose.desc", "Upload a plant photo and check for pest or disease symptoms in this field."),
406
+ href: Yt
392
407
  },
393
408
  {
394
409
  id: "edit",
395
- label: c("healthybowl.crops.fieldDetail.nextSteps.edit.label", "Update field details"),
396
- description: c("healthybowl.crops.fieldDetail.nextSteps.edit.desc", "Keep area, soil type and irrigation info current."),
397
- onClick: Bt
410
+ label: s("healthybowl.crops.fieldDetail.nextSteps.edit.label", "Update field details"),
411
+ description: s("healthybowl.crops.fieldDetail.nextSteps.edit.desc", "Keep area, soil type and irrigation info current."),
412
+ onClick: Kt
398
413
  },
399
414
  {
400
415
  id: "soil",
401
- label: c("healthybowl.crops.fieldDetail.nextSteps.soil.label", "Run a soil test"),
402
- description: c("healthybowl.crops.fieldDetail.nextSteps.soil.desc", "Check fertility before you plant or fertilise this field."),
403
- href: T("soil/tests")
416
+ label: s("healthybowl.crops.fieldDetail.nextSteps.soil.label", "Run a soil test"),
417
+ description: s("healthybowl.crops.fieldDetail.nextSteps.soil.desc", "Check fertility before you plant or fertilise this field."),
418
+ href: w("soil/tests")
404
419
  },
405
420
  {
406
421
  id: "plan",
407
- label: c("healthybowl.crops.fieldDetail.nextSteps.plan.label", "Plan what to plant here"),
408
- description: c("healthybowl.crops.fieldDetail.nextSteps.plan.desc", "Add a planting plan so this field is working toward your goals."),
409
- href: T("crops/planning")
422
+ label: s("healthybowl.crops.fieldDetail.nextSteps.plan.label", "Plan what to plant here"),
423
+ description: s("healthybowl.crops.fieldDetail.nextSteps.plan.desc", "Add a planting plan so this field is working toward your goals."),
424
+ href: w("crops/planning")
410
425
  }
411
426
  ],
412
427
  nextStepsKey: "healthybowl-field-detail",
413
428
  children: [
414
- /* @__PURE__ */ u(re, { items: [
429
+ /* @__PURE__ */ l(ie, { items: [
415
430
  {
416
- label: c("healthybowl.crops.fieldDetail.breadcrumbs.crops", "Crops"),
417
- href: T("crops")
431
+ label: s("healthybowl.crops.fieldDetail.breadcrumbs.crops", "Crops"),
432
+ href: w("crops")
418
433
  },
419
434
  {
420
- label: c("healthybowl.crops.fieldDetail.breadcrumbs.fields", "Fields"),
421
- href: T("crops/fields")
435
+ label: s("healthybowl.crops.fieldDetail.breadcrumbs.fields", "Fields"),
436
+ href: w("crops/fields")
422
437
  },
423
- { label: k.name }
438
+ { label: E.name }
424
439
  ] }),
425
- /* @__PURE__ */ d("div", {
440
+ /* @__PURE__ */ u("div", {
426
441
  className: "flex flex-wrap items-center gap-3",
427
- children: [/* @__PURE__ */ u(i, {
428
- label: k.status,
429
- variant: et(k.status),
442
+ children: [/* @__PURE__ */ l(i, {
443
+ label: E.status,
444
+ variant: ot(E.status),
430
445
  dot: !0
431
- }), k.organicCertified ? /* @__PURE__ */ u(i, {
432
- label: c("healthybowl.crops.fieldDetail.badges.organicCertified", "Organic Certified"),
446
+ }), E.organicCertified ? /* @__PURE__ */ l(i, {
447
+ label: s("healthybowl.crops.fieldDetail.badges.organicCertified", "Organic Certified"),
433
448
  variant: "success"
434
- }) : /* @__PURE__ */ u(i, {
435
- label: c("healthybowl.crops.fieldDetail.badges.notCertified", "Not Certified"),
449
+ }) : /* @__PURE__ */ l(i, {
450
+ label: s("healthybowl.crops.fieldDetail.badges.notCertified", "Not Certified"),
436
451
  variant: "muted"
437
452
  })]
438
453
  }),
439
- /* @__PURE__ */ u(De, {
440
- fieldId: k.id,
441
- crops: R
454
+ /* @__PURE__ */ l(Ne, {
455
+ fieldId: E.id,
456
+ crops: z
442
457
  }),
443
- /* @__PURE__ */ d("div", {
458
+ /* @__PURE__ */ u("div", {
444
459
  className: "grid grid-cols-1 gap-6 lg:grid-cols-3",
445
- children: [/* @__PURE__ */ d("div", {
460
+ children: [/* @__PURE__ */ u("div", {
446
461
  className: "space-y-6 lg:col-span-2",
447
462
  children: [
448
- /* @__PURE__ */ d($e, {
463
+ /* @__PURE__ */ u(at, {
449
464
  treatment: "glass",
450
465
  glow: !0,
451
466
  className: "border-border-seam p-6",
452
467
  children: [
453
- /* @__PURE__ */ u("h3", {
468
+ /* @__PURE__ */ l("h3", {
454
469
  className: "mb-4 text-sm font-semibold text-text-primary",
455
- children: c("healthybowl.crops.fieldDetail.info.heading", "Field Information")
470
+ children: s("healthybowl.crops.fieldDetail.info.heading", "Field Information")
456
471
  }),
457
- /* @__PURE__ */ d("div", {
472
+ /* @__PURE__ */ u("div", {
458
473
  className: "grid grid-cols-1 gap-6 sm:grid-cols-2",
459
- children: [/* @__PURE__ */ d("div", {
474
+ children: [/* @__PURE__ */ u("div", {
460
475
  className: "space-y-4",
461
476
  children: [
462
- /* @__PURE__ */ d("div", { children: [/* @__PURE__ */ u("span", {
477
+ /* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("span", {
463
478
  className: "text-xs text-text-secondary",
464
- children: c("healthybowl.crops.fieldDetail.info.fieldName", "Field Name")
465
- }), /* @__PURE__ */ u("p", {
479
+ children: s("healthybowl.crops.fieldDetail.info.fieldName", "Field Name")
480
+ }), /* @__PURE__ */ l("p", {
466
481
  className: "text-sm font-semibold text-text-primary",
467
- children: k.name
482
+ children: E.name
468
483
  })] }),
469
- /* @__PURE__ */ d("div", { children: [/* @__PURE__ */ u("span", {
484
+ /* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("span", {
470
485
  className: "text-xs text-text-secondary",
471
- children: c("healthybowl.crops.fieldDetail.info.area", "Area")
472
- }), /* @__PURE__ */ d("p", {
486
+ children: s("healthybowl.crops.fieldDetail.info.area", "Area")
487
+ }), /* @__PURE__ */ u("p", {
473
488
  className: "text-sm font-semibold text-text-primary",
474
489
  children: [
475
- k.area,
490
+ E.area,
476
491
  " ",
477
- k.unit
492
+ E.unit
478
493
  ]
479
494
  })] }),
480
- /* @__PURE__ */ d("div", { children: [/* @__PURE__ */ u("span", {
495
+ /* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("span", {
481
496
  className: "text-xs text-text-secondary",
482
- children: c("healthybowl.crops.fieldDetail.info.status", "Status")
483
- }), /* @__PURE__ */ u("div", {
497
+ children: s("healthybowl.crops.fieldDetail.info.status", "Status")
498
+ }), /* @__PURE__ */ l("div", {
484
499
  className: "mt-1",
485
- children: /* @__PURE__ */ u(i, {
486
- label: k.status,
487
- variant: et(k.status)
500
+ children: /* @__PURE__ */ l(i, {
501
+ label: E.status,
502
+ variant: ot(E.status)
488
503
  })
489
504
  })] }),
490
- /* @__PURE__ */ d("div", { children: [/* @__PURE__ */ u("span", {
505
+ /* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("span", {
491
506
  className: "text-xs text-text-secondary",
492
- children: c("healthybowl.crops.fieldDetail.info.type", "Growing Location")
493
- }), /* @__PURE__ */ u("p", {
507
+ children: s("healthybowl.crops.fieldDetail.info.type", "Growing Location")
508
+ }), /* @__PURE__ */ l("p", {
494
509
  className: "text-sm font-semibold text-text-primary",
495
- children: Kt
510
+ children: Qt
496
511
  })] })
497
512
  ]
498
- }), /* @__PURE__ */ d("div", {
513
+ }), /* @__PURE__ */ u("div", {
499
514
  className: "space-y-4",
500
515
  children: [
501
- /* @__PURE__ */ d("div", { children: [/* @__PURE__ */ u("span", {
516
+ /* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("span", {
502
517
  className: "text-xs text-text-secondary",
503
- children: c("healthybowl.crops.fieldDetail.info.soilType", "Soil Type")
504
- }), /* @__PURE__ */ u("p", {
518
+ children: s("healthybowl.crops.fieldDetail.info.soilType", "Soil Type")
519
+ }), /* @__PURE__ */ l("p", {
505
520
  className: "text-sm font-semibold text-text-primary",
506
- children: k.soilType
521
+ children: E.soilType
507
522
  })] }),
508
- /* @__PURE__ */ d("div", { children: [/* @__PURE__ */ u("span", {
523
+ /* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("span", {
509
524
  className: "text-xs text-text-secondary",
510
- children: c("healthybowl.crops.fieldDetail.info.irrigation", "Irrigation")
511
- }), /* @__PURE__ */ u("p", {
525
+ children: s("healthybowl.crops.fieldDetail.info.irrigation", "Irrigation")
526
+ }), /* @__PURE__ */ l("p", {
512
527
  className: "text-sm font-semibold text-text-primary",
513
- children: k.irrigationType
528
+ children: E.irrigationType
514
529
  })] }),
515
- /* @__PURE__ */ d("div", { children: [/* @__PURE__ */ u("span", {
530
+ /* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("span", {
516
531
  className: "text-xs text-text-secondary",
517
- children: c("healthybowl.crops.fieldDetail.info.currentCrops", "Current Crops")
518
- }), /* @__PURE__ */ u("p", {
532
+ children: s("healthybowl.crops.fieldDetail.info.currentCrops", "Current Crops")
533
+ }), /* @__PURE__ */ l("p", {
519
534
  className: "text-sm font-semibold text-text-primary",
520
- children: (k.crops ?? []).length > 0 ? (k.crops ?? []).join(", ") : c("healthybowl.crops.fieldDetail.info.noneValue", "None")
535
+ children: (E.crops ?? []).length > 0 ? (E.crops ?? []).join(", ") : s("healthybowl.crops.fieldDetail.info.noneValue", "None")
521
536
  })] })
522
537
  ]
523
538
  })]
524
539
  }),
525
- /* @__PURE__ */ d("div", {
540
+ /* @__PURE__ */ u("div", {
526
541
  className: "mt-6 border-t border-border-subtle pt-4",
527
- children: [/* @__PURE__ */ u("span", {
542
+ children: [/* @__PURE__ */ l("span", {
528
543
  className: "text-xs text-text-secondary",
529
- children: c("healthybowl.crops.fieldDetail.info.gpsCoordinates", "GPS Coordinates")
530
- }), gt ? /* @__PURE__ */ d("div", {
544
+ children: s("healthybowl.crops.fieldDetail.info.gpsCoordinates", "GPS Coordinates")
545
+ }), wt ? /* @__PURE__ */ u("div", {
531
546
  className: "mt-1 flex items-center gap-4",
532
- children: [/* @__PURE__ */ d("span", {
547
+ children: [/* @__PURE__ */ u("span", {
533
548
  className: "text-xs text-text-secondary",
534
549
  children: [
535
- c("healthybowl.crops.fieldDetail.info.latLabel", "Lat:"),
550
+ s("healthybowl.crops.fieldDetail.info.latLabel", "Lat:"),
536
551
  " ",
537
- /* @__PURE__ */ u("span", {
552
+ /* @__PURE__ */ l("span", {
538
553
  className: "font-mono text-sm text-text-primary",
539
- children: gt.lat
554
+ children: wt.lat
540
555
  })
541
556
  ]
542
- }), /* @__PURE__ */ d("span", {
557
+ }), /* @__PURE__ */ u("span", {
543
558
  className: "text-xs text-text-secondary",
544
559
  children: [
545
- c("healthybowl.crops.fieldDetail.info.lngLabel", "Lng:"),
560
+ s("healthybowl.crops.fieldDetail.info.lngLabel", "Lng:"),
546
561
  " ",
547
- /* @__PURE__ */ u("span", {
562
+ /* @__PURE__ */ l("span", {
548
563
  className: "font-mono text-sm text-text-primary",
549
- children: gt.lng
564
+ children: wt.lng
550
565
  })
551
566
  ]
552
567
  })]
553
- }) : /* @__PURE__ */ u("p", {
568
+ }) : /* @__PURE__ */ l("p", {
554
569
  className: "mt-1 text-xs text-text-secondary",
555
- children: c("healthybowl.crops.fieldDetail.info.noCoordinates", "Not set — draw or import this field’s boundary on the map below.")
570
+ children: s("healthybowl.crops.fieldDetail.info.noCoordinates", "Not set — draw or import this field’s boundary on the map below.")
556
571
  })]
557
572
  })
558
573
  ]
559
574
  }),
560
- /* @__PURE__ */ d("div", {
575
+ /* @__PURE__ */ u("div", {
561
576
  className: "rounded-lg border border-border-subtle bg-bg-surface p-6",
562
577
  children: [
563
- /* @__PURE__ */ d("div", {
578
+ /* @__PURE__ */ u("div", {
564
579
  className: "mb-4",
565
- children: [/* @__PURE__ */ d("h3", {
580
+ children: [/* @__PURE__ */ u("h3", {
566
581
  className: "flex items-center gap-2 text-sm font-semibold text-text-primary",
567
582
  children: [
568
- /* @__PURE__ */ u(Ve, { className: "h-4 w-4 text-success" }),
583
+ /* @__PURE__ */ l(qe, { className: "h-4 w-4 text-success" }),
569
584
  " ",
570
- c("healthybowl.crops.fieldDetail.boundary.heading", "Field Boundary")
585
+ s("healthybowl.crops.fieldDetail.boundary.heading", "Field Boundary")
571
586
  ]
572
- }), /* @__PURE__ */ u("p", {
587
+ }), /* @__PURE__ */ l("p", {
573
588
  className: "mt-1 text-xs text-text-secondary",
574
- children: c("healthybowl.crops.fieldDetail.boundary.description", "Draw or import this field’s boundary on the satellite map. Saving updates the field area automatically.")
589
+ children: s("healthybowl.crops.fieldDetail.boundary.description", "Draw or import this field’s boundary on the satellite map. Saving updates the field area automatically.")
575
590
  })]
576
591
  }),
577
- /* @__PURE__ */ u(ce, {
578
- fieldId: k.id,
579
- unit: k.unit ?? "acres",
580
- center: k.location,
581
- initialBoundary: k.boundary,
582
- onSaved: ut,
583
- onAreaChange: zt
592
+ /* @__PURE__ */ l(le, {
593
+ fieldId: E.id,
594
+ unit: E.unit ?? "acres",
595
+ center: E.location,
596
+ initialBoundary: E.boundary,
597
+ onSaved: gt,
598
+ onAreaChange: Gt
584
599
  }),
585
- /* @__PURE__ */ d("div", {
600
+ /* @__PURE__ */ u("div", {
586
601
  className: "mt-5 border-t border-border-subtle pt-5",
587
- children: [/* @__PURE__ */ d("div", {
602
+ children: [/* @__PURE__ */ u("div", {
588
603
  className: "flex flex-wrap items-center justify-between gap-3",
589
- children: [/* @__PURE__ */ d("h4", {
604
+ children: [/* @__PURE__ */ u("h4", {
590
605
  className: "flex items-center gap-2 text-sm font-semibold text-text-primary",
591
- children: [c("healthybowl.crops.fieldDetail.capacity.heading", "Planting capacity"), U && Gt && /* @__PURE__ */ u("span", {
606
+ children: [s("healthybowl.crops.fieldDetail.capacity.heading", "Planting capacity"), W && Zt && /* @__PURE__ */ l("span", {
592
607
  className: "rounded-full bg-success/10 px-2 py-0.5 text-[11px] font-medium text-success",
593
- children: c("healthybowl.crops.fieldDetail.capacity.fromBoundary", "from drawn boundary")
608
+ children: s("healthybowl.crops.fieldDetail.capacity.fromBoundary", "from drawn boundary")
594
609
  })]
595
- }), /* @__PURE__ */ u(i, {
596
- label: U ? V.label : Kt,
610
+ }), /* @__PURE__ */ l(i, {
611
+ label: W ? H.label : Qt,
597
612
  variant: "muted"
598
613
  })]
599
- }), U ? /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ d("div", {
614
+ }), K ? /* @__PURE__ */ u("div", {
615
+ className: "mt-4",
616
+ "data-testid": "grow-capacity-panel",
617
+ "data-model": K.model,
618
+ children: [/* @__PURE__ */ u("div", {
619
+ className: "grid grid-cols-2 gap-3 md:grid-cols-3 xl:grid-cols-5",
620
+ children: [
621
+ /* @__PURE__ */ l(b, {
622
+ label: K.model === "TREE" ? s("healthybowl.crops.fieldDetail.capacity.metrics.block", "Block") : K.model === "RACK" ? s("healthybowl.crops.fieldDetail.capacity.metrics.racks", "Racks") : s("healthybowl.crops.fieldDetail.capacity.metrics.benches", "Benches"),
623
+ value: t(K.unitCount)
624
+ }),
625
+ /* @__PURE__ */ l(b, {
626
+ label: s("healthybowl.crops.fieldDetail.capacity.metrics.plantsPerUnit", "Plants / unit"),
627
+ value: t(K.plantsPerUnit)
628
+ }),
629
+ /* @__PURE__ */ l(b, {
630
+ label: K.model === "TREE" ? s("healthybowl.crops.fieldDetail.capacity.metrics.totalTrees", "Total trees") : s("healthybowl.crops.fieldDetail.capacity.metrics.totalPlants", "Total plants"),
631
+ value: t(K.totalPlants)
632
+ }),
633
+ K.seedlingTarget != null && /* @__PURE__ */ l(b, {
634
+ label: s("healthybowl.crops.fieldDetail.capacity.metrics.seedlings", "Seedlings"),
635
+ value: t(K.seedlingTarget)
636
+ }),
637
+ /* @__PURE__ */ l(b, {
638
+ label: s("healthybowl.crops.fieldDetail.capacity.metrics.growingArea", "Growing area"),
639
+ value: v(K.usableAreaSqm, 1),
640
+ unit: "m²"
641
+ })
642
+ ]
643
+ }), !K.usesSeed && /* @__PURE__ */ l("p", {
644
+ className: "mt-4 rounded-md border border-border-subtle bg-bg-sunken/60 p-3 text-sm text-text-secondary",
645
+ children: s("healthybowl.crops.fieldDetail.capacity.saplingsOnly", "Planted from saplings — seed weight and nursery trays do not apply to an orchard.")
646
+ })]
647
+ }) : $t ? /* @__PURE__ */ l("p", {
648
+ className: "mt-4 rounded-md border border-border-subtle bg-bg-sunken/60 p-3 text-sm text-text-secondary",
649
+ "data-testid": "grow-geometry-prompt",
650
+ children: s(he.key, he.defaultValue, { type: Qt })
651
+ }) : W ? /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ u("div", {
600
652
  className: "mt-4 grid gap-3 md:grid-cols-2 xl:grid-cols-4",
601
653
  children: [
602
- /* @__PURE__ */ d("div", {
654
+ /* @__PURE__ */ u("div", {
603
655
  className: "xl:col-span-2",
604
- children: [/* @__PURE__ */ u("label", {
656
+ children: [/* @__PURE__ */ l("label", {
605
657
  className: "text-xs font-medium text-text-secondary",
606
- children: c("healthybowl.crops.fieldDetail.capacity.crop", "Crop")
607
- }), /* @__PURE__ */ d(p, {
608
- value: j,
609
- onValueChange: qt,
610
- children: [/* @__PURE__ */ u(g, {
658
+ children: s("healthybowl.crops.fieldDetail.capacity.crop", "Crop")
659
+ }), /* @__PURE__ */ u(f, {
660
+ value: k,
661
+ onValueChange: en,
662
+ children: [/* @__PURE__ */ l(h, {
611
663
  className: "mt-1 w-full",
612
- children: /* @__PURE__ */ u(_, { placeholder: c("healthybowl.crops.fieldDetail.capacity.cropPlaceholder", "Select crop") })
613
- }), /* @__PURE__ */ u(m, { children: z.map((e) => /* @__PURE__ */ u(h, {
664
+ children: /* @__PURE__ */ l(g, { placeholder: s("healthybowl.crops.fieldDetail.capacity.cropPlaceholder", "Select crop") })
665
+ }), /* @__PURE__ */ l(p, { children: B.map((e) => /* @__PURE__ */ l(m, {
614
666
  value: e.id,
615
667
  children: e.variety ? `${e.name} - ${e.variety}` : e.name
616
668
  }, e.id)) })]
617
669
  })]
618
670
  }),
619
- M.length > 0 && /* @__PURE__ */ d("div", {
671
+ A.length > 0 && /* @__PURE__ */ u("div", {
620
672
  className: "xl:col-span-2",
621
- children: [/* @__PURE__ */ u("label", {
673
+ children: [/* @__PURE__ */ l("label", {
622
674
  className: "text-xs font-medium text-text-secondary",
623
- children: c("healthybowl.crops.fieldDetail.capacity.catalog", "Master Plant List")
624
- }), /* @__PURE__ */ d(p, {
625
- value: N || "none",
626
- onValueChange: Jt,
627
- children: [/* @__PURE__ */ u(g, {
675
+ children: s("healthybowl.crops.fieldDetail.capacity.catalog", "Master Plant List")
676
+ }), /* @__PURE__ */ u(f, {
677
+ value: j || "none",
678
+ onValueChange: tn,
679
+ children: [/* @__PURE__ */ l(h, {
628
680
  className: "mt-1 w-full",
629
- children: /* @__PURE__ */ u(_, { placeholder: c("healthybowl.crops.fieldDetail.capacity.catalogPlaceholder", "Fill spacing from catalog") })
630
- }), /* @__PURE__ */ d(m, { children: [/* @__PURE__ */ u(h, {
681
+ children: /* @__PURE__ */ l(g, { placeholder: s("healthybowl.crops.fieldDetail.capacity.catalogPlaceholder", "Fill spacing from catalog") })
682
+ }), /* @__PURE__ */ u(p, { children: [/* @__PURE__ */ l(m, {
631
683
  value: "none",
632
- children: c("healthybowl.crops.fieldDetail.capacity.catalogNone", "None")
633
- }), M.map((e) => /* @__PURE__ */ u(h, {
684
+ children: s("healthybowl.crops.fieldDetail.capacity.catalogNone", "None")
685
+ }), A.map((e) => /* @__PURE__ */ l(m, {
634
686
  value: e.id,
635
687
  children: e.variety ? `${e.name} - ${e.variety}` : e.name
636
688
  }, e.id))] })]
637
689
  })]
638
690
  }),
639
- /* @__PURE__ */ u(b, {
640
- label: c("healthybowl.crops.fieldDetail.capacity.plantSpacing", "Plant spacing"),
691
+ /* @__PURE__ */ l(y, {
692
+ label: s("healthybowl.crops.fieldDetail.capacity.plantSpacing", "Plant spacing"),
641
693
  unit: "cm",
642
- value: Pt,
694
+ value: M,
643
695
  min: "1",
644
696
  step: "1",
645
- onChange: Ft
697
+ onChange: N
646
698
  }),
647
- /* @__PURE__ */ u(b, {
648
- label: c("healthybowl.crops.fieldDetail.capacity.rowSpacing", "Row spacing"),
699
+ /* @__PURE__ */ l(y, {
700
+ label: s("healthybowl.crops.fieldDetail.capacity.rowSpacing", "Row spacing"),
649
701
  unit: "cm",
650
- value: It,
702
+ value: P,
651
703
  min: "1",
652
704
  step: "1",
653
- onChange: P
705
+ onChange: F
654
706
  }),
655
- /* @__PURE__ */ u(b, {
656
- label: c("healthybowl.crops.fieldDetail.capacity.bedWidth", "Bed width"),
707
+ /* @__PURE__ */ l(y, {
708
+ label: s("healthybowl.crops.fieldDetail.capacity.bedWidth", "Bed width"),
657
709
  unit: "m",
658
- value: F,
710
+ value: I,
659
711
  min: "0.1",
660
712
  step: "0.1",
661
- onChange: Lt
713
+ onChange: Ut
662
714
  }),
663
- /* @__PURE__ */ u(b, {
664
- label: c("healthybowl.crops.fieldDetail.capacity.pathWidth", "Path width"),
715
+ /* @__PURE__ */ l(y, {
716
+ label: s("healthybowl.crops.fieldDetail.capacity.pathWidth", "Path width"),
665
717
  unit: "m",
666
- value: I,
718
+ value: L,
667
719
  min: "0",
668
720
  step: "0.05",
669
- onChange: Rt
721
+ onChange: Wt
670
722
  })
671
723
  ]
672
- }), W ? /* @__PURE__ */ d(l, { children: [
673
- /* @__PURE__ */ d("div", {
724
+ }), G ? /* @__PURE__ */ u(c, { children: [
725
+ /* @__PURE__ */ u("div", {
674
726
  className: "mt-4 grid grid-cols-2 gap-3 md:grid-cols-3 xl:grid-cols-6",
675
727
  children: [
676
- /* @__PURE__ */ u(x, {
677
- label: c("healthybowl.crops.fieldDetail.capacity.metrics.beds", "Beds"),
678
- value: t(W.bedCount)
728
+ /* @__PURE__ */ l(b, {
729
+ label: s("healthybowl.crops.fieldDetail.capacity.metrics.beds", "Beds"),
730
+ value: t(G.bedCount)
679
731
  }),
680
- /* @__PURE__ */ u(x, {
681
- label: c("healthybowl.crops.fieldDetail.capacity.metrics.rowsPerBed", "Rows / bed"),
682
- value: t(W.rowsPerBed)
732
+ /* @__PURE__ */ l(b, {
733
+ label: s("healthybowl.crops.fieldDetail.capacity.metrics.rowsPerBed", "Rows / bed"),
734
+ value: t(G.rowsPerBed)
683
735
  }),
684
- /* @__PURE__ */ u(x, {
685
- label: c("healthybowl.crops.fieldDetail.capacity.metrics.plantsPerBed", "Plants / bed"),
686
- value: t(W.plantsPerBed)
736
+ /* @__PURE__ */ l(b, {
737
+ label: s("healthybowl.crops.fieldDetail.capacity.metrics.plantsPerBed", "Plants / bed"),
738
+ value: t(G.plantsPerBed)
687
739
  }),
688
- /* @__PURE__ */ u(x, {
689
- label: c("healthybowl.crops.fieldDetail.capacity.metrics.totalPlants", "Total plants"),
690
- value: t(W.totalPlants)
740
+ /* @__PURE__ */ l(b, {
741
+ label: s("healthybowl.crops.fieldDetail.capacity.metrics.totalPlants", "Total plants"),
742
+ value: t(G.totalPlants)
691
743
  }),
692
- /* @__PURE__ */ u(x, {
693
- label: c("healthybowl.crops.fieldDetail.capacity.metrics.seedlings", "Seedlings"),
694
- value: t(W.seedlingTarget)
744
+ /* @__PURE__ */ l(b, {
745
+ label: s("healthybowl.crops.fieldDetail.capacity.metrics.seedlings", "Seedlings"),
746
+ value: t(G.seedlingTarget)
695
747
  }),
696
- /* @__PURE__ */ u(x, {
697
- label: c("healthybowl.crops.fieldDetail.capacity.metrics.bedLength", "Bed length"),
698
- value: y(W.bedLengthM),
748
+ /* @__PURE__ */ l(b, {
749
+ label: s("healthybowl.crops.fieldDetail.capacity.metrics.bedLength", "Bed length"),
750
+ value: v(G.bedLengthM),
699
751
  unit: "m"
700
752
  }),
701
- /* @__PURE__ */ u(x, {
702
- label: c("healthybowl.crops.fieldDetail.capacity.metrics.density", "Density"),
703
- value: y(W.densityPlantsPerSqm, 2),
704
- unit: c("healthybowl.crops.fieldDetail.capacity.metrics.densityUnit", "plants/m²")
753
+ /* @__PURE__ */ l(b, {
754
+ label: s("healthybowl.crops.fieldDetail.capacity.metrics.density", "Density"),
755
+ value: v(G.densityPlantsPerSqm, 2),
756
+ unit: s("healthybowl.crops.fieldDetail.capacity.metrics.densityUnit", "plants/m²")
705
757
  })
706
758
  ]
707
759
  }),
708
- K && /* @__PURE__ */ d("div", {
760
+ J && /* @__PURE__ */ u("div", {
709
761
  className: "mt-5 border-t border-border-subtle pt-4",
710
762
  children: [
711
- /* @__PURE__ */ d("h5", {
763
+ /* @__PURE__ */ u("h5", {
712
764
  className: "mb-3 flex items-center gap-2 text-xs font-semibold uppercase tracking-wide text-text-secondary",
713
765
  children: [
714
- /* @__PURE__ */ u(We, { className: "h-3.5 w-3.5 text-success" }),
715
- c("healthybowl.crops.fieldDetail.seedRate.heading", "Seed rate"),
716
- G && /* @__PURE__ */ u("span", {
766
+ /* @__PURE__ */ l(Xe, { className: "h-3.5 w-3.5 text-success" }),
767
+ s("healthybowl.crops.fieldDetail.seedRate.heading", "Seed rate"),
768
+ q && /* @__PURE__ */ l("span", {
717
769
  className: "rounded-full bg-success/10 px-2 py-0.5 text-[11px] font-medium normal-case text-success",
718
- children: c("healthybowl.crops.fieldDetail.seedRate.fromCatalog", "from catalog")
770
+ children: s("healthybowl.crops.fieldDetail.seedRate.fromCatalog", "from catalog")
719
771
  })
720
772
  ]
721
773
  }),
722
- /* @__PURE__ */ d("div", {
774
+ /* @__PURE__ */ u("div", {
723
775
  className: "grid grid-cols-2 gap-3 md:grid-cols-3",
724
776
  children: [
725
- /* @__PURE__ */ u(x, {
726
- label: c("healthybowl.crops.fieldDetail.seedRate.seedNeeded", "Seed needed"),
727
- value: K.seedGrams == null ? "—" : y(K.seedGrams, 2),
728
- unit: K.seedGrams == null ? void 0 : "g"
777
+ /* @__PURE__ */ l(b, {
778
+ label: s("healthybowl.crops.fieldDetail.seedRate.seedNeeded", "Seed needed"),
779
+ value: J.seedGrams == null ? "—" : v(J.seedGrams, 2),
780
+ unit: J.seedGrams == null ? void 0 : "g"
729
781
  }),
730
- /* @__PURE__ */ u(x, {
731
- label: c("healthybowl.crops.fieldDetail.seedRate.seedlings", "Seedlings to raise"),
732
- value: t(K.seedlingsToRaise)
782
+ /* @__PURE__ */ l(b, {
783
+ label: s("healthybowl.crops.fieldDetail.seedRate.seedlings", "Seedlings to raise"),
784
+ value: t(J.seedlingsToRaise)
733
785
  }),
734
- /* @__PURE__ */ u(x, {
735
- label: c("healthybowl.crops.fieldDetail.seedRate.trays", "Trays"),
736
- value: K.trays == null ? "—" : t(K.trays)
786
+ /* @__PURE__ */ l(b, {
787
+ label: s("healthybowl.crops.fieldDetail.seedRate.trays", "Trays"),
788
+ value: J.trays == null ? "—" : t(J.trays)
737
789
  })
738
790
  ]
739
791
  }),
740
- K.seedGrams == null && /* @__PURE__ */ u("p", {
792
+ J.seedGrams == null && /* @__PURE__ */ l("p", {
741
793
  className: "mt-3 text-xs text-text-secondary",
742
- children: c("healthybowl.crops.fieldDetail.seedRate.noSeedsPerGram", "Set “seeds per gram” for this variety in the Master Plant List to calculate seed weight in grams.")
794
+ children: s("healthybowl.crops.fieldDetail.seedRate.noSeedsPerGram", "Set “seeds per gram” for this variety in the Master Plant List to calculate seed weight in grams.")
743
795
  })
744
796
  ]
745
797
  }),
746
- /* @__PURE__ */ d("div", {
798
+ /* @__PURE__ */ u("div", {
747
799
  className: "mt-5 border-t border-border-subtle pt-4",
748
- children: [/* @__PURE__ */ d("div", {
800
+ children: [/* @__PURE__ */ u("div", {
749
801
  className: "flex flex-wrap items-center justify-between gap-2",
750
- children: [/* @__PURE__ */ d("h5", {
802
+ children: [/* @__PURE__ */ u("h5", {
751
803
  className: "flex items-center gap-2 text-xs font-semibold uppercase tracking-wide text-text-secondary",
752
- children: [/* @__PURE__ */ u(Ke, { className: "h-3.5 w-3.5 text-success" }), c("healthybowl.crops.fieldDetail.compare.heading", "Compare crops for this field")]
753
- }), Y.length > 0 && /* @__PURE__ */ d("span", {
804
+ children: [/* @__PURE__ */ l(Qe, { className: "h-3.5 w-3.5 text-success" }), s("healthybowl.crops.fieldDetail.compare.heading", "Compare crops for this field")]
805
+ }), on.length > 0 && /* @__PURE__ */ u("span", {
754
806
  className: "text-xs text-text-secondary",
755
807
  children: [
756
- t(Y.length),
808
+ t(on.length),
757
809
  " ",
758
- c("healthybowl.crops.fieldDetail.compare.varieties", "varieties")
810
+ s("healthybowl.crops.fieldDetail.compare.varieties", "varieties")
759
811
  ]
760
812
  })]
761
- }), Y.length > 0 ? /* @__PURE__ */ d(l, { children: [
762
- /* @__PURE__ */ u("p", {
813
+ }), on.length > 0 ? /* @__PURE__ */ u(c, { children: [
814
+ /* @__PURE__ */ l("p", {
763
815
  className: "mt-1 text-xs text-text-secondary",
764
- children: c("healthybowl.crops.fieldDetail.compare.description", "What each variety in your Master Plant List would need on this field, at the bed and path widths above.")
816
+ children: s("healthybowl.crops.fieldDetail.compare.description", "What each variety in your Master Plant List would need on this field, at the bed and path widths above.")
765
817
  }),
766
- /* @__PURE__ */ u("div", {
818
+ /* @__PURE__ */ l("div", {
767
819
  className: "mt-3 overflow-x-auto rounded-md border border-border-subtle",
768
- children: /* @__PURE__ */ d("table", {
820
+ children: /* @__PURE__ */ u("table", {
769
821
  className: "w-full min-w-[680px] border-collapse text-sm",
770
- children: [/* @__PURE__ */ u("thead", { children: /* @__PURE__ */ d("tr", {
822
+ children: [/* @__PURE__ */ l("thead", { children: /* @__PURE__ */ u("tr", {
771
823
  className: "border-b border-border-subtle bg-bg-sunken/60",
772
824
  children: [
773
- /* @__PURE__ */ u(S, {
774
- label: c("healthybowl.crops.fieldDetail.compare.crop", "Crop"),
825
+ /* @__PURE__ */ l(x, {
826
+ label: s("healthybowl.crops.fieldDetail.compare.crop", "Crop"),
775
827
  sortKey: "label",
776
- activeKey: q,
777
- direction: J,
778
- onSort: X
828
+ activeKey: Y,
829
+ direction: X,
830
+ onSort: Z
779
831
  }),
780
- /* @__PURE__ */ u("th", {
832
+ /* @__PURE__ */ l("th", {
781
833
  scope: "col",
782
834
  className: "whitespace-nowrap px-3 py-2 text-end text-xs font-medium text-text-secondary",
783
- children: c("healthybowl.crops.fieldDetail.compare.spacing", "Spacing")
835
+ children: s("healthybowl.crops.fieldDetail.compare.spacing", "Spacing")
784
836
  }),
785
- /* @__PURE__ */ u("th", {
837
+ /* @__PURE__ */ l("th", {
786
838
  scope: "col",
787
839
  className: "whitespace-nowrap px-3 py-2 text-end text-xs font-medium text-text-secondary",
788
- children: c("healthybowl.crops.fieldDetail.compare.beds", "Beds")
840
+ children: s("healthybowl.crops.fieldDetail.compare.beds", "Beds")
789
841
  }),
790
- /* @__PURE__ */ u(S, {
791
- label: c("healthybowl.crops.fieldDetail.compare.totalPlants", "Total plants"),
842
+ /* @__PURE__ */ l(x, {
843
+ label: s("healthybowl.crops.fieldDetail.compare.totalPlants", "Total plants"),
792
844
  sortKey: "totalPlants",
793
- activeKey: q,
794
- direction: J,
795
- onSort: X,
845
+ activeKey: Y,
846
+ direction: X,
847
+ onSort: Z,
796
848
  align: "right"
797
849
  }),
798
- /* @__PURE__ */ u(S, {
799
- label: c("healthybowl.crops.fieldDetail.compare.seed", "Seed needed"),
850
+ /* @__PURE__ */ l(x, {
851
+ label: s("healthybowl.crops.fieldDetail.compare.seed", "Seed needed"),
800
852
  sortKey: "seedGrams",
801
- activeKey: q,
802
- direction: J,
803
- onSort: X,
853
+ activeKey: Y,
854
+ direction: X,
855
+ onSort: Z,
804
856
  align: "right"
805
857
  }),
806
- /* @__PURE__ */ u(S, {
807
- label: c("healthybowl.crops.fieldDetail.compare.trays", "Trays"),
858
+ /* @__PURE__ */ l(x, {
859
+ label: s("healthybowl.crops.fieldDetail.compare.trays", "Trays"),
808
860
  sortKey: "trays",
809
- activeKey: q,
810
- direction: J,
811
- onSort: X,
861
+ activeKey: Y,
862
+ direction: X,
863
+ onSort: Z,
812
864
  align: "right"
813
865
  }),
814
- /* @__PURE__ */ u(S, {
815
- label: c("healthybowl.crops.fieldDetail.compare.maturity", "Days to maturity"),
866
+ /* @__PURE__ */ l(x, {
867
+ label: s("healthybowl.crops.fieldDetail.compare.maturity", "Days to maturity"),
816
868
  sortKey: "daysToMaturity",
817
- activeKey: q,
818
- direction: J,
819
- onSort: X,
869
+ activeKey: Y,
870
+ direction: X,
871
+ onSort: Z,
820
872
  align: "right"
821
873
  })
822
874
  ]
823
- }) }), /* @__PURE__ */ u("tbody", { children: Y.map((e) => /* @__PURE__ */ d("tr", {
824
- className: `border-b border-border-subtle last:border-b-0 ${G?.id === e.id ? "bg-success/5" : ""}`,
875
+ }) }), /* @__PURE__ */ l("tbody", { children: on.map((e) => /* @__PURE__ */ u("tr", {
876
+ className: `border-b border-border-subtle last:border-b-0 ${q?.id === e.id ? "bg-success/5" : ""}`,
825
877
  children: [
826
- /* @__PURE__ */ d("td", {
878
+ /* @__PURE__ */ u("td", {
827
879
  className: "px-3 py-2",
828
- children: [/* @__PURE__ */ u("span", {
880
+ children: [/* @__PURE__ */ l("span", {
829
881
  className: "font-medium text-text-primary",
830
882
  children: e.label
831
- }), !e.spacingFromCatalog && /* @__PURE__ */ u("span", {
883
+ }), !e.spacingFromCatalog && /* @__PURE__ */ l("span", {
832
884
  className: "ms-2 whitespace-nowrap rounded-full bg-bg-sunken px-1.5 py-0.5 text-[10px] text-text-secondary",
833
885
  title: e.presetLabel,
834
- children: c("healthybowl.crops.fieldDetail.compare.presetSpacing", "preset spacing")
886
+ children: s("healthybowl.crops.fieldDetail.compare.presetSpacing", "preset spacing")
835
887
  })]
836
888
  }),
837
- /* @__PURE__ */ d("td", {
889
+ /* @__PURE__ */ u("td", {
838
890
  className: "whitespace-nowrap px-3 py-2 text-end tabular-nums text-text-secondary",
839
891
  children: [
840
892
  e.plantSpacingCm,
@@ -843,23 +895,23 @@ var et = (e) => {
843
895
  " cm"
844
896
  ]
845
897
  }),
846
- /* @__PURE__ */ u("td", {
898
+ /* @__PURE__ */ l("td", {
847
899
  className: "px-3 py-2 text-end tabular-nums text-text-secondary",
848
900
  children: t(e.capacity.bedCount)
849
901
  }),
850
- /* @__PURE__ */ u("td", {
902
+ /* @__PURE__ */ l("td", {
851
903
  className: "px-3 py-2 text-end font-medium tabular-nums text-text-primary",
852
904
  children: t(e.capacity.totalPlants)
853
905
  }),
854
- /* @__PURE__ */ u("td", {
906
+ /* @__PURE__ */ l("td", {
855
907
  className: "whitespace-nowrap px-3 py-2 text-end tabular-nums text-text-secondary",
856
- children: e.seed.seedGrams == null ? "—" : `${y(e.seed.seedGrams, 2)} g`
908
+ children: e.seed.seedGrams == null ? "—" : `${v(e.seed.seedGrams, 2)} g`
857
909
  }),
858
- /* @__PURE__ */ u("td", {
910
+ /* @__PURE__ */ l("td", {
859
911
  className: "px-3 py-2 text-end tabular-nums text-text-secondary",
860
912
  children: e.seed.trays == null ? "—" : t(e.seed.trays)
861
913
  }),
862
- /* @__PURE__ */ u("td", {
914
+ /* @__PURE__ */ l("td", {
863
915
  className: "px-3 py-2 text-end tabular-nums text-text-secondary",
864
916
  children: e.daysToMaturity == null ? "—" : t(e.daysToMaturity)
865
917
  })
@@ -867,278 +919,278 @@ var et = (e) => {
867
919
  }, e.id)) })]
868
920
  })
869
921
  }),
870
- /* @__PURE__ */ u("p", {
922
+ /* @__PURE__ */ l("p", {
871
923
  className: "mt-2 text-xs text-text-secondary",
872
- children: c("healthybowl.crops.fieldDetail.compare.footnote", "A dash means the variety has no seeds-per-gram recorded yet. “Preset spacing” means the figures use a crop-family default rather than spacing you have recorded.")
924
+ children: s("healthybowl.crops.fieldDetail.compare.footnote", "A dash means the variety has no seeds-per-gram recorded yet. “Preset spacing” means the figures use a crop-family default rather than spacing you have recorded.")
873
925
  })
874
- ] }) : /* @__PURE__ */ u("p", {
926
+ ] }) : /* @__PURE__ */ l("p", {
875
927
  className: "mt-3 rounded-md border border-border-subtle bg-bg-sunken/60 p-3 text-xs text-text-secondary",
876
- children: c("healthybowl.crops.fieldDetail.compare.empty", "Add varieties to your Master Plant List to compare beds and seed across crops for this field.")
928
+ children: s("healthybowl.crops.fieldDetail.compare.empty", "Add varieties to your Master Plant List to compare beds and seed across crops for this field.")
877
929
  })]
878
930
  })
879
- ] }) : /* @__PURE__ */ u("p", {
931
+ ] }) : /* @__PURE__ */ l("p", {
880
932
  className: "mt-4 rounded-md border border-border-subtle bg-bg-sunken/60 p-3 text-sm text-text-secondary",
881
- children: c("healthybowl.crops.fieldDetail.capacity.empty", "Draw a boundary on the map above, or set this field’s area, to calculate beds and plants.")
882
- })] }) : /* @__PURE__ */ u("p", {
933
+ children: s("healthybowl.crops.fieldDetail.capacity.empty", "Draw a boundary on the map above, or set this field’s area, to calculate beds and plants.")
934
+ })] }) : /* @__PURE__ */ l("p", {
883
935
  className: "mt-4 rounded-md border border-border-subtle bg-bg-sunken/60 p-3 text-sm text-text-secondary",
884
- children: c(fe.key, fe.defaultValue, { type: Kt })
936
+ children: s(pe.key, pe.defaultValue, { type: Qt })
885
937
  })]
886
938
  })
887
939
  ]
888
940
  }),
889
- /* @__PURE__ */ d("div", {
941
+ /* @__PURE__ */ u("div", {
890
942
  className: "rounded-lg border border-border-subtle bg-bg-surface p-6",
891
943
  children: [
892
- /* @__PURE__ */ d("div", {
944
+ /* @__PURE__ */ u("div", {
893
945
  className: "mb-4",
894
- children: [/* @__PURE__ */ d("h3", {
946
+ children: [/* @__PURE__ */ u("h3", {
895
947
  className: "flex items-center gap-2 text-sm font-semibold text-text-primary",
896
948
  children: [
897
- /* @__PURE__ */ u(We, { className: "h-4 w-4 text-success" }),
949
+ /* @__PURE__ */ l(Xe, { className: "h-4 w-4 text-success" }),
898
950
  " ",
899
- c("healthybowl.crops.fieldDetail.succession.heading", "Succession planting")
951
+ s("healthybowl.crops.fieldDetail.succession.heading", "Succession planting")
900
952
  ]
901
- }), /* @__PURE__ */ u("p", {
953
+ }), /* @__PURE__ */ l("p", {
902
954
  className: "mt-1 text-xs text-text-secondary",
903
- children: c("healthybowl.crops.fieldDetail.succession.description", "Generate a series of staggered sowings for a steady, continuous harvest. Uses the crop and seed-rate above.")
955
+ children: s("healthybowl.crops.fieldDetail.succession.description", "Generate a series of staggered sowings for a steady, continuous harvest. Uses the crop and seed-rate above.")
904
956
  })]
905
957
  }),
906
- /* @__PURE__ */ d("div", {
958
+ /* @__PURE__ */ u("div", {
907
959
  className: "grid gap-3 md:grid-cols-2 xl:grid-cols-4",
908
960
  children: [
909
- /* @__PURE__ */ d("div", { children: [/* @__PURE__ */ u("label", {
961
+ /* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("label", {
910
962
  className: "text-xs font-medium text-text-secondary",
911
- children: c("healthybowl.crops.fieldDetail.succession.startDate", "Start date")
912
- }), /* @__PURE__ */ u("input", {
963
+ children: s("healthybowl.crops.fieldDetail.succession.startDate", "Start date")
964
+ }), /* @__PURE__ */ l("input", {
913
965
  type: "date",
914
- value: Z,
915
- onChange: (e) => nn(e.target.value),
966
+ value: dn,
967
+ onChange: (e) => fn(e.target.value),
916
968
  className: "mt-1 h-10 w-full rounded-md border border-border-subtle bg-bg-surface px-3 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
917
969
  })] }),
918
- /* @__PURE__ */ u(b, {
919
- label: c("healthybowl.crops.fieldDetail.succession.interval", "Interval"),
920
- unit: c("healthybowl.crops.fieldDetail.succession.days", "days"),
921
- value: rn,
970
+ /* @__PURE__ */ l(y, {
971
+ label: s("healthybowl.crops.fieldDetail.succession.interval", "Interval"),
972
+ unit: s("healthybowl.crops.fieldDetail.succession.days", "days"),
973
+ value: pn,
922
974
  min: "1",
923
975
  step: "1",
924
- onChange: an
976
+ onChange: mn
925
977
  }),
926
- /* @__PURE__ */ u(b, {
927
- label: c("healthybowl.crops.fieldDetail.succession.count", "Number of sowings"),
928
- unit: c("healthybowl.crops.fieldDetail.succession.sowings", "sowings"),
929
- value: on,
978
+ /* @__PURE__ */ l(y, {
979
+ label: s("healthybowl.crops.fieldDetail.succession.count", "Number of sowings"),
980
+ unit: s("healthybowl.crops.fieldDetail.succession.sowings", "sowings"),
981
+ value: hn,
930
982
  min: "1",
931
983
  step: "1",
932
- onChange: sn
984
+ onChange: gn
933
985
  }),
934
- $t.length > 0 && /* @__PURE__ */ d("div", { children: [/* @__PURE__ */ u("label", {
986
+ cn.length > 0 && /* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("label", {
935
987
  className: "text-xs font-medium text-text-secondary",
936
- children: c("healthybowl.crops.fieldDetail.succession.bed", "Bed (optional)")
937
- }), /* @__PURE__ */ d(p, {
938
- value: cn || "none",
939
- onValueChange: (e) => ln(e === "none" ? "" : e),
940
- children: [/* @__PURE__ */ u(g, {
988
+ children: s("healthybowl.crops.fieldDetail.succession.bed", "Bed (optional)")
989
+ }), /* @__PURE__ */ u(f, {
990
+ value: _n || "none",
991
+ onValueChange: (e) => vn(e === "none" ? "" : e),
992
+ children: [/* @__PURE__ */ l(h, {
941
993
  className: "mt-1 w-full",
942
- children: /* @__PURE__ */ u(_, { placeholder: c("healthybowl.crops.fieldDetail.succession.bedPlaceholder", "No specific bed") })
943
- }), /* @__PURE__ */ d(m, { children: [/* @__PURE__ */ u(h, {
994
+ children: /* @__PURE__ */ l(g, { placeholder: s("healthybowl.crops.fieldDetail.succession.bedPlaceholder", "No specific bed") })
995
+ }), /* @__PURE__ */ u(p, { children: [/* @__PURE__ */ l(m, {
944
996
  value: "none",
945
- children: c("healthybowl.crops.fieldDetail.succession.bedNone", "No specific bed")
946
- }), $t.map((e) => /* @__PURE__ */ u(h, {
997
+ children: s("healthybowl.crops.fieldDetail.succession.bedNone", "No specific bed")
998
+ }), cn.map((e) => /* @__PURE__ */ l(m, {
947
999
  value: e.id,
948
1000
  children: e.name
949
1001
  }, e.id))] })]
950
1002
  })] })
951
1003
  ]
952
1004
  }),
953
- /* @__PURE__ */ d("div", {
1005
+ /* @__PURE__ */ u("div", {
954
1006
  className: "mt-4 flex flex-wrap items-center justify-between gap-3",
955
- children: [/* @__PURE__ */ u("p", {
1007
+ children: [/* @__PURE__ */ l("p", {
956
1008
  className: "text-xs text-text-secondary",
957
- children: B ? c("healthybowl.crops.fieldDetail.succession.forCrop", "For: {{crop}}", { crop: B.variety ? `${B.name} - ${B.variety}` : B.name }) : c("healthybowl.crops.fieldDetail.succession.noCrop", "Select a crop in the capacity planner above.")
958
- }), /* @__PURE__ */ d(f, {
959
- onClick: mn,
960
- disabled: un,
961
- children: [/* @__PURE__ */ u(He, { className: "h-4 w-4" }), un ? c("healthybowl.crops.fieldDetail.succession.generating", "Generating...") : c("healthybowl.crops.fieldDetail.succession.generate", "Generate schedule")]
1009
+ children: V ? s("healthybowl.crops.fieldDetail.succession.forCrop", "For: {{crop}}", { crop: V.variety ? `${V.name} - ${V.variety}` : V.name }) : s("healthybowl.crops.fieldDetail.succession.noCrop", "Select a crop in the capacity planner above.")
1010
+ }), /* @__PURE__ */ u(d, {
1011
+ onClick: Cn,
1012
+ disabled: yn,
1013
+ children: [/* @__PURE__ */ l(Je, { className: "h-4 w-4" }), yn ? s("healthybowl.crops.fieldDetail.succession.generating", "Generating...") : s("healthybowl.crops.fieldDetail.succession.generate", "Generate schedule")]
962
1014
  })]
963
1015
  }),
964
- fn.length > 0 ? /* @__PURE__ */ u("div", {
1016
+ xn.length > 0 ? /* @__PURE__ */ l("div", {
965
1017
  className: "mt-5 space-y-5 border-t border-border-subtle pt-5",
966
- children: fn.map(([n, r]) => /* @__PURE__ */ d("div", { children: [/* @__PURE__ */ d("div", {
1018
+ children: xn.map(([n, r]) => /* @__PURE__ */ u("div", { children: [/* @__PURE__ */ u("div", {
967
1019
  className: "mb-2 flex items-center justify-between",
968
- children: [/* @__PURE__ */ u("h4", {
1020
+ children: [/* @__PURE__ */ l("h4", {
969
1021
  className: "text-sm font-semibold text-text-primary",
970
- children: r[0] ? pn(r[0]) : c("healthybowl.crops.fieldDetail.succession.series", "Succession series")
971
- }), /* @__PURE__ */ u("span", {
1022
+ children: r[0] ? Sn(r[0]) : s("healthybowl.crops.fieldDetail.succession.series", "Succession series")
1023
+ }), /* @__PURE__ */ l("span", {
972
1024
  className: "text-xs text-text-secondary",
973
- children: c("healthybowl.crops.fieldDetail.succession.sowingCount", "{{count}} sowings", { count: r.length })
1025
+ children: s("healthybowl.crops.fieldDetail.succession.sowingCount", "{{count}} sowings", { count: r.length })
974
1026
  })]
975
- }), /* @__PURE__ */ u("div", {
1027
+ }), /* @__PURE__ */ l("div", {
976
1028
  className: "space-y-2",
977
- children: r.map((n, r) => /* @__PURE__ */ d("div", {
1029
+ children: r.map((n, r) => /* @__PURE__ */ u("div", {
978
1030
  className: "flex items-center justify-between rounded-md border border-border-subtle p-3",
979
- children: [/* @__PURE__ */ d("div", {
1031
+ children: [/* @__PURE__ */ u("div", {
980
1032
  className: "flex items-center gap-3",
981
- children: [/* @__PURE__ */ u("div", {
1033
+ children: [/* @__PURE__ */ l("div", {
982
1034
  className: "flex h-7 w-7 shrink-0 items-center justify-center rounded-full bg-success/10 text-xs font-semibold text-success",
983
1035
  children: (n.successionIndex ?? r) + 1
984
- }), /* @__PURE__ */ d("div", { children: [/* @__PURE__ */ d("p", {
1036
+ }), /* @__PURE__ */ u("div", { children: [/* @__PURE__ */ u("p", {
985
1037
  className: "text-sm font-medium text-text-primary",
986
1038
  children: [
987
- c("healthybowl.crops.fieldDetail.succession.sowingLabel", "Sowing {{n}}", { n: (n.successionIndex ?? r) + 1 }),
1039
+ s("healthybowl.crops.fieldDetail.succession.sowingLabel", "Sowing {{n}}", { n: (n.successionIndex ?? r) + 1 }),
988
1040
  " ",
989
1041
  "— ",
990
1042
  e(n.sowDate ?? n.startDate)
991
1043
  ]
992
- }), n.seedlingsToRaise != null && /* @__PURE__ */ u("p", {
1044
+ }), n.seedlingsToRaise != null && /* @__PURE__ */ l("p", {
993
1045
  className: "text-xs text-text-secondary",
994
- children: c("healthybowl.crops.fieldDetail.succession.sowingMeta", "{{seedlings}} seedlings{{grams}}", {
1046
+ children: s("healthybowl.crops.fieldDetail.succession.sowingMeta", "{{seedlings}} seedlings{{grams}}", {
995
1047
  seedlings: t(n.seedlingsToRaise),
996
- grams: n.seedGrams == null ? "" : ` · ${y(n.seedGrams, 2)} g seed`
1048
+ grams: n.seedGrams == null ? "" : ` · ${v(n.seedGrams, 2)} g seed`
997
1049
  })
998
1050
  })] })]
999
- }), /* @__PURE__ */ u(f, {
1051
+ }), /* @__PURE__ */ l(d, {
1000
1052
  variant: "ghost",
1001
1053
  size: "icon-sm",
1002
- onClick: () => void hn(n),
1003
- "aria-label": c("healthybowl.common.delete", "Delete"),
1054
+ onClick: () => void wn(n),
1055
+ "aria-label": s("healthybowl.common.delete", "Delete"),
1004
1056
  className: "text-status-error-text hover:bg-status-error-bg/10 hover:text-status-error-text",
1005
- children: /* @__PURE__ */ u(Je, { className: "h-4 w-4" })
1057
+ children: /* @__PURE__ */ l(et, { className: "h-4 w-4" })
1006
1058
  })]
1007
1059
  }, n.id))
1008
1060
  })] }, n))
1009
- }) : /* @__PURE__ */ u("p", {
1061
+ }) : /* @__PURE__ */ l("p", {
1010
1062
  className: "mt-5 rounded-md border border-border-subtle bg-bg-sunken/60 p-3 text-sm text-text-secondary",
1011
- children: c("healthybowl.crops.fieldDetail.succession.empty", "No succession schedules yet. Set a start date, interval and number of sowings, then generate a series.")
1063
+ children: s("healthybowl.crops.fieldDetail.succession.empty", "No succession schedules yet. Set a start date, interval and number of sowings, then generate a series.")
1012
1064
  })
1013
1065
  ]
1014
1066
  }),
1015
- /* @__PURE__ */ d("div", {
1067
+ /* @__PURE__ */ u("div", {
1016
1068
  className: "rounded-lg border border-border-subtle bg-bg-surface p-6",
1017
- children: [/* @__PURE__ */ d("h3", {
1069
+ children: [/* @__PURE__ */ u("h3", {
1018
1070
  className: "mb-4 flex items-center gap-2 text-sm font-semibold text-text-primary",
1019
1071
  children: [
1020
- /* @__PURE__ */ u(Be, { className: "h-4 w-4 text-success" }),
1072
+ /* @__PURE__ */ l(Ke, { className: "h-4 w-4 text-success" }),
1021
1073
  " ",
1022
- c("healthybowl.crops.fieldDetail.currentCrops.heading", "Current Crops")
1074
+ s("healthybowl.crops.fieldDetail.currentCrops.heading", "Current Crops")
1023
1075
  ]
1024
- }), R.length > 0 ? /* @__PURE__ */ u("div", {
1076
+ }), z.length > 0 ? /* @__PURE__ */ l("div", {
1025
1077
  className: "flex flex-col gap-3",
1026
- children: R.map((e) => /* @__PURE__ */ d("div", {
1027
- onClick: () => w(T(`crops/${e.id}`)),
1078
+ children: z.map((e) => /* @__PURE__ */ u("div", {
1079
+ onClick: () => C(w(`crops/${e.id}`)),
1028
1080
  className: "flex cursor-pointer items-center justify-between rounded-md border border-border-subtle p-3 transition-colors hover:bg-bg-sunken/50",
1029
- children: [/* @__PURE__ */ d("div", { children: [
1030
- /* @__PURE__ */ u("span", {
1081
+ children: [/* @__PURE__ */ u("div", { children: [
1082
+ /* @__PURE__ */ l("span", {
1031
1083
  className: "text-sm font-medium text-text-primary",
1032
1084
  children: e.name
1033
1085
  }),
1034
- /* @__PURE__ */ u("span", {
1086
+ /* @__PURE__ */ l("span", {
1035
1087
  className: "ms-2 text-xs text-text-secondary",
1036
1088
  children: e.variety
1037
1089
  }),
1038
- /* @__PURE__ */ d("div", {
1090
+ /* @__PURE__ */ u("div", {
1039
1091
  className: "mt-1 flex items-center gap-2",
1040
- children: [/* @__PURE__ */ u("div", {
1092
+ children: [/* @__PURE__ */ l("div", {
1041
1093
  className: "h-1.5 w-24 rounded-full bg-bg-sunken",
1042
- children: /* @__PURE__ */ u("div", {
1094
+ children: /* @__PURE__ */ l("div", {
1043
1095
  className: "h-1.5 rounded-full bg-action-primary-bg",
1044
1096
  style: { width: `${e.progress}%` }
1045
1097
  })
1046
- }), /* @__PURE__ */ d("span", {
1098
+ }), /* @__PURE__ */ u("span", {
1047
1099
  className: "text-xs text-text-secondary",
1048
1100
  children: [e.progress, "%"]
1049
1101
  })]
1050
1102
  })
1051
- ] }), /* @__PURE__ */ d("div", {
1103
+ ] }), /* @__PURE__ */ u("div", {
1052
1104
  className: "flex items-center gap-2",
1053
- children: [/* @__PURE__ */ u(i, {
1105
+ children: [/* @__PURE__ */ l(i, {
1054
1106
  label: e.growthStage,
1055
1107
  variant: "info"
1056
- }), /* @__PURE__ */ d("span", {
1108
+ }), /* @__PURE__ */ u("span", {
1057
1109
  className: "text-xs text-text-secondary",
1058
1110
  children: [e.daysToHarvest, "d"]
1059
1111
  })]
1060
1112
  })]
1061
1113
  }, e.id))
1062
- }) : /* @__PURE__ */ u("p", {
1114
+ }) : /* @__PURE__ */ l("p", {
1063
1115
  className: "text-sm text-text-secondary",
1064
- children: c("healthybowl.crops.fieldDetail.currentCrops.empty", "No crops currently planted.")
1116
+ children: s("healthybowl.crops.fieldDetail.currentCrops.empty", "No crops currently planted.")
1065
1117
  })]
1066
1118
  }),
1067
- Q && /* @__PURE__ */ d("div", {
1119
+ Q && /* @__PURE__ */ u("div", {
1068
1120
  className: "rounded-lg border border-border-subtle bg-bg-surface p-6",
1069
1121
  children: [
1070
- /* @__PURE__ */ d("div", {
1122
+ /* @__PURE__ */ u("div", {
1071
1123
  className: "mb-4 flex items-center justify-between",
1072
- children: [/* @__PURE__ */ d("h3", {
1124
+ children: [/* @__PURE__ */ u("h3", {
1073
1125
  className: "flex items-center gap-2 text-sm font-semibold text-text-primary",
1074
1126
  children: [
1075
- /* @__PURE__ */ u(je, { className: "h-4 w-4 text-warning" }),
1127
+ /* @__PURE__ */ l(Le, { className: "h-4 w-4 text-warning" }),
1076
1128
  " ",
1077
- c("healthybowl.crops.fieldDetail.soilHealth.heading", "Soil Health")
1129
+ s("healthybowl.crops.fieldDetail.soilHealth.heading", "Soil Health")
1078
1130
  ]
1079
- }), /* @__PURE__ */ u(i, {
1131
+ }), /* @__PURE__ */ l(i, {
1080
1132
  label: (Q.status ?? "unknown").replace("_", " "),
1081
- variant: tt(Q.status ?? "unknown")
1133
+ variant: st(Q.status ?? "unknown")
1082
1134
  })]
1083
1135
  }),
1084
- /* @__PURE__ */ u("div", {
1136
+ /* @__PURE__ */ l("div", {
1085
1137
  className: "grid grid-cols-2 gap-4 sm:grid-cols-3 lg:grid-cols-6",
1086
1138
  children: [
1087
1139
  {
1088
1140
  key: "pH",
1089
- label: c("healthybowl.crops.fieldDetail.soilHealth.metrics.ph", "pH"),
1141
+ label: s("healthybowl.crops.fieldDetail.soilHealth.metrics.ph", "pH"),
1090
1142
  value: Q.ph.toString(),
1091
1143
  good: Q.ph >= 6 && Q.ph <= 7.5
1092
1144
  },
1093
1145
  {
1094
1146
  key: "Nitrogen",
1095
- label: c("healthybowl.crops.fieldDetail.soilHealth.metrics.nitrogen", "Nitrogen"),
1147
+ label: s("healthybowl.crops.fieldDetail.soilHealth.metrics.nitrogen", "Nitrogen"),
1096
1148
  value: `${Q.nitrogen} ppm`,
1097
1149
  good: Q.nitrogen >= 30
1098
1150
  },
1099
1151
  {
1100
1152
  key: "Phosphorus",
1101
- label: c("healthybowl.crops.fieldDetail.soilHealth.metrics.phosphorus", "Phosphorus"),
1153
+ label: s("healthybowl.crops.fieldDetail.soilHealth.metrics.phosphorus", "Phosphorus"),
1102
1154
  value: `${Q.phosphorus} ppm`,
1103
1155
  good: Q.phosphorus >= 25
1104
1156
  },
1105
1157
  {
1106
1158
  key: "Potassium",
1107
- label: c("healthybowl.crops.fieldDetail.soilHealth.metrics.potassium", "Potassium"),
1159
+ label: s("healthybowl.crops.fieldDetail.soilHealth.metrics.potassium", "Potassium"),
1108
1160
  value: `${Q.potassium} ppm`,
1109
1161
  good: Q.potassium >= 150
1110
1162
  },
1111
1163
  {
1112
1164
  key: "Organic Matter",
1113
- label: c("healthybowl.crops.fieldDetail.soilHealth.metrics.organicMatter", "Organic Matter"),
1165
+ label: s("healthybowl.crops.fieldDetail.soilHealth.metrics.organicMatter", "Organic Matter"),
1114
1166
  value: `${Q.organicMatter}%`,
1115
1167
  good: Q.organicMatter >= 3
1116
1168
  },
1117
1169
  {
1118
1170
  key: "Moisture",
1119
- label: c("healthybowl.crops.fieldDetail.soilHealth.metrics.moisture", "Moisture"),
1171
+ label: s("healthybowl.crops.fieldDetail.soilHealth.metrics.moisture", "Moisture"),
1120
1172
  value: `${Q.moisture}%`,
1121
1173
  good: Q.moisture >= 20 && Q.moisture <= 40
1122
1174
  }
1123
- ].map(({ key: e, label: t, value: n, good: r }) => /* @__PURE__ */ d("div", {
1175
+ ].map(({ key: e, label: t, value: n, good: r }) => /* @__PURE__ */ u("div", {
1124
1176
  className: "text-center",
1125
- children: [/* @__PURE__ */ u("span", {
1177
+ children: [/* @__PURE__ */ l("span", {
1126
1178
  className: "text-xs text-text-secondary",
1127
1179
  children: t
1128
- }), /* @__PURE__ */ u("p", {
1180
+ }), /* @__PURE__ */ l("p", {
1129
1181
  className: `text-sm font-semibold ${r ? "text-success" : "text-warning"}`,
1130
1182
  children: n
1131
1183
  })]
1132
1184
  }, e))
1133
1185
  }),
1134
- Q.recommendations.length > 0 && /* @__PURE__ */ d("div", {
1186
+ Q.recommendations.length > 0 && /* @__PURE__ */ u("div", {
1135
1187
  className: "mt-4 border-t border-border-subtle pt-4",
1136
- children: [/* @__PURE__ */ u("h4", {
1188
+ children: [/* @__PURE__ */ l("h4", {
1137
1189
  className: "mb-2 text-xs font-medium text-text-secondary",
1138
- children: c("healthybowl.crops.fieldDetail.soilHealth.recommendations", "Recommendations")
1139
- }), /* @__PURE__ */ u("ul", {
1190
+ children: s("healthybowl.crops.fieldDetail.soilHealth.recommendations", "Recommendations")
1191
+ }), /* @__PURE__ */ l("ul", {
1140
1192
  className: "space-y-1",
1141
- children: Q.recommendations.map((e, t) => /* @__PURE__ */ d("li", {
1193
+ children: Q.recommendations.map((e, t) => /* @__PURE__ */ u("li", {
1142
1194
  className: "text-xs text-text-primary",
1143
1195
  children: ["- ", e]
1144
1196
  }, t))
@@ -1146,26 +1198,26 @@ var et = (e) => {
1146
1198
  })
1147
1199
  ]
1148
1200
  }),
1149
- /* @__PURE__ */ d("div", {
1201
+ /* @__PURE__ */ u("div", {
1150
1202
  className: "rounded-lg border border-border-subtle bg-bg-surface p-6",
1151
- children: [/* @__PURE__ */ d("h3", {
1203
+ children: [/* @__PURE__ */ u("h3", {
1152
1204
  className: "mb-4 flex items-center gap-2 text-sm font-semibold text-text-primary",
1153
1205
  children: [
1154
- /* @__PURE__ */ u(Pe, { className: "h-4 w-4 text-info" }),
1206
+ /* @__PURE__ */ l(Be, { className: "h-4 w-4 text-info" }),
1155
1207
  " ",
1156
- c("healthybowl.crops.fieldDetail.cropHistory.heading", "Crop History")
1208
+ s("healthybowl.crops.fieldDetail.cropHistory.heading", "Crop History")
1157
1209
  ]
1158
- }), /* @__PURE__ */ u("div", {
1210
+ }), /* @__PURE__ */ l("div", {
1159
1211
  className: "space-y-3",
1160
- children: _n.map((e, t) => /* @__PURE__ */ d("div", {
1212
+ children: En.map((e, t) => /* @__PURE__ */ u("div", {
1161
1213
  className: "flex items-center justify-between rounded-md border border-border-subtle p-3",
1162
- children: [/* @__PURE__ */ d("div", { children: [/* @__PURE__ */ u("span", {
1214
+ children: [/* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("span", {
1163
1215
  className: "text-sm font-medium text-text-primary",
1164
1216
  children: e.crop
1165
- }), /* @__PURE__ */ u("p", {
1217
+ }), /* @__PURE__ */ l("p", {
1166
1218
  className: "text-xs text-text-secondary",
1167
1219
  children: e.season
1168
- })] }), /* @__PURE__ */ u(i, {
1220
+ })] }), /* @__PURE__ */ l(i, {
1169
1221
  label: e.status,
1170
1222
  variant: e.status === "active" ? "success" : "muted"
1171
1223
  })]
@@ -1173,87 +1225,87 @@ var et = (e) => {
1173
1225
  })]
1174
1226
  })
1175
1227
  ]
1176
- }), /* @__PURE__ */ d("div", {
1228
+ }), /* @__PURE__ */ u("div", {
1177
1229
  className: "space-y-6",
1178
1230
  children: [
1179
- /* @__PURE__ */ d("div", {
1231
+ /* @__PURE__ */ u("div", {
1180
1232
  className: "rounded-lg border border-border-subtle bg-bg-surface p-6",
1181
- children: [/* @__PURE__ */ d("h3", {
1233
+ children: [/* @__PURE__ */ u("h3", {
1182
1234
  className: "mb-4 flex items-center gap-2 text-sm font-semibold text-text-primary",
1183
1235
  children: [
1184
- /* @__PURE__ */ u(Ie, { className: "h-4 w-4 text-info" }),
1236
+ /* @__PURE__ */ l(He, { className: "h-4 w-4 text-info" }),
1185
1237
  " ",
1186
- c("healthybowl.crops.fieldDetail.weather.heading", "Current Conditions")
1238
+ s("healthybowl.crops.fieldDetail.weather.heading", "Current Conditions")
1187
1239
  ]
1188
- }), /* @__PURE__ */ d("div", {
1240
+ }), /* @__PURE__ */ u("div", {
1189
1241
  className: "space-y-3",
1190
1242
  children: [
1191
- /* @__PURE__ */ d("div", {
1243
+ /* @__PURE__ */ u("div", {
1192
1244
  className: "flex items-center justify-between",
1193
- children: [/* @__PURE__ */ d("span", {
1245
+ children: [/* @__PURE__ */ u("span", {
1194
1246
  className: "flex items-center gap-1.5 text-xs text-text-secondary",
1195
1247
  children: [
1196
- /* @__PURE__ */ u(qe, { className: "h-3.5 w-3.5" }),
1248
+ /* @__PURE__ */ l($e, { className: "h-3.5 w-3.5" }),
1197
1249
  " ",
1198
- c("healthybowl.crops.fieldDetail.weather.temperature", "Temperature")
1250
+ s("healthybowl.crops.fieldDetail.weather.temperature", "Temperature")
1199
1251
  ]
1200
- }), /* @__PURE__ */ d("span", {
1252
+ }), /* @__PURE__ */ u("span", {
1201
1253
  className: "text-sm font-medium text-text-primary",
1202
1254
  children: [$.current.temperature, "°C"]
1203
1255
  })]
1204
1256
  }),
1205
- /* @__PURE__ */ d("div", {
1257
+ /* @__PURE__ */ u("div", {
1206
1258
  className: "flex items-center justify-between",
1207
- children: [/* @__PURE__ */ d("span", {
1259
+ children: [/* @__PURE__ */ u("span", {
1208
1260
  className: "flex items-center gap-1.5 text-xs text-text-secondary",
1209
1261
  children: [
1210
- /* @__PURE__ */ u(Le, { className: "h-3.5 w-3.5" }),
1262
+ /* @__PURE__ */ l(Ue, { className: "h-3.5 w-3.5" }),
1211
1263
  " ",
1212
- c("healthybowl.crops.fieldDetail.weather.humidity", "Humidity")
1264
+ s("healthybowl.crops.fieldDetail.weather.humidity", "Humidity")
1213
1265
  ]
1214
- }), /* @__PURE__ */ d("span", {
1266
+ }), /* @__PURE__ */ u("span", {
1215
1267
  className: "text-sm font-medium text-text-primary",
1216
1268
  children: [$.current.humidity, "%"]
1217
1269
  })]
1218
1270
  }),
1219
- /* @__PURE__ */ d("div", {
1271
+ /* @__PURE__ */ u("div", {
1220
1272
  className: "flex items-center justify-between",
1221
- children: [/* @__PURE__ */ d("span", {
1273
+ children: [/* @__PURE__ */ u("span", {
1222
1274
  className: "flex items-center gap-1.5 text-xs text-text-secondary",
1223
1275
  children: [
1224
- /* @__PURE__ */ u(Xe, { className: "h-3.5 w-3.5" }),
1276
+ /* @__PURE__ */ l(nt, { className: "h-3.5 w-3.5" }),
1225
1277
  " ",
1226
- c("healthybowl.crops.fieldDetail.weather.wind", "Wind")
1278
+ s("healthybowl.crops.fieldDetail.weather.wind", "Wind")
1227
1279
  ]
1228
- }), /* @__PURE__ */ d("span", {
1280
+ }), /* @__PURE__ */ u("span", {
1229
1281
  className: "text-sm font-medium text-text-primary",
1230
1282
  children: [$.current.windSpeed, " km/h"]
1231
1283
  })]
1232
1284
  }),
1233
- /* @__PURE__ */ d("div", {
1285
+ /* @__PURE__ */ u("div", {
1234
1286
  className: "flex items-center justify-between",
1235
- children: [/* @__PURE__ */ d("span", {
1287
+ children: [/* @__PURE__ */ u("span", {
1236
1288
  className: "flex items-center gap-1.5 text-xs text-text-secondary",
1237
1289
  children: [
1238
- /* @__PURE__ */ u(Ge, { className: "h-3.5 w-3.5" }),
1290
+ /* @__PURE__ */ l(Ze, { className: "h-3.5 w-3.5" }),
1239
1291
  " ",
1240
- c("healthybowl.crops.fieldDetail.weather.uvIndex", "UV Index")
1292
+ s("healthybowl.crops.fieldDetail.weather.uvIndex", "UV Index")
1241
1293
  ]
1242
- }), /* @__PURE__ */ u("span", {
1294
+ }), /* @__PURE__ */ l("span", {
1243
1295
  className: "text-sm font-medium text-text-primary",
1244
1296
  children: $.current.uvIndex
1245
1297
  })]
1246
1298
  }),
1247
- /* @__PURE__ */ d("div", {
1299
+ /* @__PURE__ */ u("div", {
1248
1300
  className: "flex items-center justify-between",
1249
- children: [/* @__PURE__ */ d("span", {
1301
+ children: [/* @__PURE__ */ u("span", {
1250
1302
  className: "flex items-center gap-1.5 text-xs text-text-secondary",
1251
1303
  children: [
1252
- /* @__PURE__ */ u(ze, { className: "h-3.5 w-3.5" }),
1304
+ /* @__PURE__ */ l(Ge, { className: "h-3.5 w-3.5" }),
1253
1305
  " ",
1254
- c("healthybowl.crops.fieldDetail.weather.visibility", "Visibility")
1306
+ s("healthybowl.crops.fieldDetail.weather.visibility", "Visibility")
1255
1307
  ]
1256
- }), /* @__PURE__ */ d("span", {
1308
+ }), /* @__PURE__ */ u("span", {
1257
1309
  className: "text-sm font-medium text-text-primary",
1258
1310
  children: [$.current.visibility, " km"]
1259
1311
  })]
@@ -1261,75 +1313,75 @@ var et = (e) => {
1261
1313
  ]
1262
1314
  })]
1263
1315
  }),
1264
- /* @__PURE__ */ d("div", {
1316
+ /* @__PURE__ */ u("div", {
1265
1317
  className: "rounded-lg border border-border-subtle bg-bg-surface p-6",
1266
- children: [/* @__PURE__ */ u("h3", {
1318
+ children: [/* @__PURE__ */ l("h3", {
1267
1319
  className: "mb-4 text-sm font-semibold text-text-primary",
1268
- children: c("healthybowl.crops.fieldDetail.quickActions.heading", "Quick Actions")
1269
- }), /* @__PURE__ */ d("div", {
1320
+ children: s("healthybowl.crops.fieldDetail.quickActions.heading", "Quick Actions")
1321
+ }), /* @__PURE__ */ u("div", {
1270
1322
  className: "space-y-2",
1271
1323
  children: [
1272
- /* @__PURE__ */ d(f, {
1324
+ /* @__PURE__ */ u(d, {
1273
1325
  variant: "outline",
1274
- onClick: () => w(T("weather")),
1326
+ onClick: () => C(w("weather")),
1275
1327
  className: "w-full justify-start",
1276
1328
  children: [
1277
- /* @__PURE__ */ u(Ge, { className: "h-4 w-4 text-text-secondary" }),
1329
+ /* @__PURE__ */ l(Ze, { className: "h-4 w-4 text-text-secondary" }),
1278
1330
  " ",
1279
- c("healthybowl.crops.fieldDetail.quickActions.weatherData", "Weather Data")
1331
+ s("healthybowl.crops.fieldDetail.quickActions.weatherData", "Weather Data")
1280
1332
  ]
1281
1333
  }),
1282
- /* @__PURE__ */ d(f, {
1334
+ /* @__PURE__ */ u(d, {
1283
1335
  variant: "outline",
1284
- onClick: () => w(T("soil-health")),
1336
+ onClick: () => C(w("soil-health")),
1285
1337
  className: "w-full justify-start",
1286
1338
  children: [
1287
- /* @__PURE__ */ u(Ne, { className: "h-4 w-4 text-text-secondary" }),
1339
+ /* @__PURE__ */ l(ze, { className: "h-4 w-4 text-text-secondary" }),
1288
1340
  " ",
1289
- c("healthybowl.crops.fieldDetail.quickActions.soilAnalysis", "Soil Analysis")
1341
+ s("healthybowl.crops.fieldDetail.quickActions.soilAnalysis", "Soil Analysis")
1290
1342
  ]
1291
1343
  }),
1292
- /* @__PURE__ */ d(f, {
1344
+ /* @__PURE__ */ u(d, {
1293
1345
  variant: "outline",
1294
- onClick: () => w(T("crops")),
1346
+ onClick: () => C(w("crops")),
1295
1347
  className: "w-full justify-start",
1296
1348
  children: [
1297
- /* @__PURE__ */ u(Ye, { className: "h-4 w-4 text-text-secondary" }),
1349
+ /* @__PURE__ */ l(tt, { className: "h-4 w-4 text-text-secondary" }),
1298
1350
  " ",
1299
- c("healthybowl.crops.fieldDetail.quickActions.cropHistory", "Crop History")
1351
+ s("healthybowl.crops.fieldDetail.quickActions.cropHistory", "Crop History")
1300
1352
  ]
1301
1353
  }),
1302
- /* @__PURE__ */ d(f, {
1354
+ /* @__PURE__ */ u(d, {
1303
1355
  variant: "outline",
1304
- onClick: () => w(T("analytics")),
1356
+ onClick: () => C(w("analytics")),
1305
1357
  className: "w-full justify-start",
1306
1358
  children: [
1307
- /* @__PURE__ */ u(je, { className: "h-4 w-4 text-text-secondary" }),
1359
+ /* @__PURE__ */ l(Le, { className: "h-4 w-4 text-text-secondary" }),
1308
1360
  " ",
1309
- c("healthybowl.crops.fieldDetail.quickActions.generateReport", "Generate Report")
1361
+ s("healthybowl.crops.fieldDetail.quickActions.generateReport", "Generate Report")
1310
1362
  ]
1311
1363
  })
1312
1364
  ]
1313
1365
  })]
1314
1366
  }),
1315
- /* @__PURE__ */ d("div", {
1367
+ /* @__PURE__ */ u("div", {
1316
1368
  className: "rounded-lg border border-border-subtle bg-bg-surface p-6",
1317
- children: [/* @__PURE__ */ u("h3", {
1369
+ children: [/* @__PURE__ */ l("h3", {
1318
1370
  className: "mb-4 text-sm font-semibold text-text-primary",
1319
- children: c("healthybowl.crops.fieldDetail.recentActivity.heading", "Recent Activity")
1320
- }), /* @__PURE__ */ u("div", {
1371
+ children: s("healthybowl.crops.fieldDetail.recentActivity.heading", "Recent Activity")
1372
+ }), /* @__PURE__ */ l("div", {
1321
1373
  className: "space-y-4",
1322
- children: gn.map((t, n) => /* @__PURE__ */ d("div", {
1374
+ children: Tn.map((t, n) => /* @__PURE__ */ u("div", {
1323
1375
  className: "flex gap-3",
1324
- children: [/* @__PURE__ */ d("div", {
1376
+ children: [/* @__PURE__ */ u("div", {
1325
1377
  className: "relative flex flex-col items-center",
1326
- children: [/* @__PURE__ */ u("div", { className: "h-2 w-2 rounded-full bg-action-primary-bg" }), n < gn.length - 1 && /* @__PURE__ */ u("div", { className: "w-0.5 flex-1 bg-border" })]
1327
- }), /* @__PURE__ */ d("div", {
1378
+ children: [/* @__PURE__ */ l("div", { className: "h-2 w-2 rounded-full bg-action-primary-bg" }), n < Tn.length - 1 && /* @__PURE__ */ l("div", { className: "w-0.5 flex-1 bg-border" })]
1379
+ }), /* @__PURE__ */ u("div", {
1328
1380
  className: "pb-4",
1329
- children: [/* @__PURE__ */ u("p", {
1381
+ children: [/* @__PURE__ */ l("p", {
1330
1382
  className: "text-sm text-text-primary",
1331
1383
  children: t.action
1332
- }), /* @__PURE__ */ u("p", {
1384
+ }), /* @__PURE__ */ l("p", {
1333
1385
  className: "text-xs text-text-secondary",
1334
1386
  children: e(t.date)
1335
1387
  })]
@@ -1340,193 +1392,203 @@ var et = (e) => {
1340
1392
  ]
1341
1393
  })]
1342
1394
  }),
1343
- /* @__PURE__ */ u(ae, {
1344
- open: mt,
1345
- onClose: () => D(!1),
1346
- title: c("healthybowl.crops.fieldDetail.editModal.title", "Edit Field"),
1347
- description: c("healthybowl.crops.fieldDetail.editModal.description", "Update details for {{name}}", { name: k.name }),
1395
+ /* @__PURE__ */ l(oe, {
1396
+ open: bt,
1397
+ onClose: () => xt(!1),
1398
+ title: s("healthybowl.crops.fieldDetail.editModal.title", "Edit Field"),
1399
+ description: s("healthybowl.crops.fieldDetail.editModal.description", "Update details for {{name}}", { name: E.name }),
1348
1400
  size: "lg",
1349
- footer: /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u(f, {
1401
+ footer: /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ l(d, {
1350
1402
  variant: "outline",
1351
- onClick: () => D(!1),
1352
- children: c("healthybowl.common.cancel", "Cancel")
1353
- }), /* @__PURE__ */ u(f, {
1354
- onClick: Vt,
1355
- disabled: ht,
1356
- children: ht ? c("healthybowl.crops.fieldDetail.editModal.saving", "Saving...") : c("healthybowl.crops.fieldDetail.editModal.saveChanges", "Save Changes")
1403
+ onClick: () => xt(!1),
1404
+ children: s("healthybowl.common.cancel", "Cancel")
1405
+ }), /* @__PURE__ */ l(d, {
1406
+ onClick: qt,
1407
+ disabled: St,
1408
+ children: St ? s("healthybowl.crops.fieldDetail.editModal.saving", "Saving...") : s("healthybowl.crops.fieldDetail.editModal.saveChanges", "Save Changes")
1357
1409
  })] }),
1358
- children: /* @__PURE__ */ d("div", {
1410
+ children: /* @__PURE__ */ u("div", {
1359
1411
  className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
1360
1412
  children: [
1361
- /* @__PURE__ */ d("div", { children: [/* @__PURE__ */ u("label", {
1413
+ /* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("label", {
1362
1414
  className: "text-sm font-medium text-text-primary",
1363
- children: c("healthybowl.crops.fieldDetail.form.fieldName.label", "Field Name *")
1364
- }), /* @__PURE__ */ u("input", {
1415
+ children: s("healthybowl.crops.fieldDetail.form.fieldName.label", "Field Name *")
1416
+ }), /* @__PURE__ */ l("input", {
1365
1417
  type: "text",
1366
- value: A,
1367
- onChange: (e) => _t(e.target.value),
1418
+ value: D,
1419
+ onChange: (e) => Tt(e.target.value),
1368
1420
  className: "mt-1 w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
1369
1421
  })] }),
1370
- /* @__PURE__ */ d("div", { children: [/* @__PURE__ */ u("label", {
1422
+ /* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("label", {
1371
1423
  className: "text-sm font-medium text-text-primary",
1372
- children: c("healthybowl.crops.fieldDetail.form.area.label", "Area *")
1373
- }), /* @__PURE__ */ u("input", {
1424
+ children: s("healthybowl.crops.fieldDetail.form.area.label", "Area *")
1425
+ }), /* @__PURE__ */ l("input", {
1374
1426
  type: "number",
1375
1427
  min: 0,
1376
- value: vt,
1377
- onChange: (e) => yt(e.target.value),
1428
+ value: Et,
1429
+ onChange: (e) => Dt(e.target.value),
1378
1430
  className: "mt-1 w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
1379
1431
  })] }),
1380
- /* @__PURE__ */ d("div", { children: [/* @__PURE__ */ u("label", {
1432
+ /* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("label", {
1381
1433
  className: "text-sm font-medium text-text-primary",
1382
- children: c("healthybowl.crops.fieldDetail.form.unit.label", "Unit")
1383
- }), /* @__PURE__ */ d(p, {
1384
- value: bt,
1385
- onValueChange: (e) => xt(e),
1386
- children: [/* @__PURE__ */ u(g, {
1434
+ children: s("healthybowl.crops.fieldDetail.form.unit.label", "Unit")
1435
+ }), /* @__PURE__ */ u(f, {
1436
+ value: Ot,
1437
+ onValueChange: (e) => kt(e),
1438
+ children: [/* @__PURE__ */ l(h, {
1387
1439
  className: "mt-1 w-full",
1388
- children: /* @__PURE__ */ u(_, {})
1389
- }), /* @__PURE__ */ d(m, { children: [/* @__PURE__ */ u(h, {
1440
+ children: /* @__PURE__ */ l(g, {})
1441
+ }), /* @__PURE__ */ u(p, { children: [/* @__PURE__ */ l(m, {
1390
1442
  value: "acres",
1391
- children: c("healthybowl.crops.fieldDetail.form.unit.options.acres", "Acres")
1392
- }), /* @__PURE__ */ u(h, {
1443
+ children: s("healthybowl.crops.fieldDetail.form.unit.options.acres", "Acres")
1444
+ }), /* @__PURE__ */ l(m, {
1393
1445
  value: "hectares",
1394
- children: c("healthybowl.crops.fieldDetail.form.unit.options.hectares", "Hectares")
1446
+ children: s("healthybowl.crops.fieldDetail.form.unit.options.hectares", "Hectares")
1395
1447
  })] })]
1396
1448
  })] }),
1397
- /* @__PURE__ */ d("div", { children: [/* @__PURE__ */ u("label", {
1449
+ /* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("label", {
1398
1450
  className: "text-sm font-medium text-text-primary",
1399
- children: c("healthybowl.crops.fieldDetail.form.status.label", "Status")
1400
- }), /* @__PURE__ */ d(p, {
1401
- value: Et,
1402
- onValueChange: Dt,
1403
- children: [/* @__PURE__ */ u(g, {
1451
+ children: s("healthybowl.crops.fieldDetail.form.status.label", "Status")
1452
+ }), /* @__PURE__ */ u(f, {
1453
+ value: Pt,
1454
+ onValueChange: Ft,
1455
+ children: [/* @__PURE__ */ l(h, {
1404
1456
  className: "mt-1 w-full",
1405
- children: /* @__PURE__ */ u(_, {})
1406
- }), /* @__PURE__ */ d(m, { children: [
1407
- /* @__PURE__ */ u(h, {
1457
+ children: /* @__PURE__ */ l(g, {})
1458
+ }), /* @__PURE__ */ u(p, { children: [
1459
+ /* @__PURE__ */ l(m, {
1408
1460
  value: "active",
1409
- children: c("healthybowl.crops.fieldDetail.form.status.options.active", "Active")
1461
+ children: s("healthybowl.crops.fieldDetail.form.status.options.active", "Active")
1410
1462
  }),
1411
- /* @__PURE__ */ u(h, {
1463
+ /* @__PURE__ */ l(m, {
1412
1464
  value: "preparation",
1413
- children: c("healthybowl.crops.fieldDetail.form.status.options.preparation", "Preparation")
1465
+ children: s("healthybowl.crops.fieldDetail.form.status.options.preparation", "Preparation")
1414
1466
  }),
1415
- /* @__PURE__ */ u(h, {
1467
+ /* @__PURE__ */ l(m, {
1416
1468
  value: "fallow",
1417
- children: c("healthybowl.crops.fieldDetail.form.status.options.fallow", "Fallow")
1469
+ children: s("healthybowl.crops.fieldDetail.form.status.options.fallow", "Fallow")
1418
1470
  })
1419
1471
  ] })]
1420
1472
  })] }),
1421
- /* @__PURE__ */ d("div", { children: [
1422
- /* @__PURE__ */ u("label", {
1473
+ /* @__PURE__ */ u("div", { children: [
1474
+ /* @__PURE__ */ l("label", {
1423
1475
  className: "text-sm font-medium text-text-primary",
1424
- children: c("healthybowl.crops.fieldDetail.form.type.label", "Growing Location")
1476
+ children: s("healthybowl.crops.fieldDetail.form.type.label", "Growing Location")
1425
1477
  }),
1426
- /* @__PURE__ */ d(p, {
1427
- value: Ot,
1428
- onValueChange: (e) => kt(e),
1429
- children: [/* @__PURE__ */ u(g, {
1478
+ /* @__PURE__ */ u(f, {
1479
+ value: O,
1480
+ onValueChange: (e) => It(e),
1481
+ children: [/* @__PURE__ */ l(h, {
1430
1482
  className: "mt-1 w-full",
1431
- children: /* @__PURE__ */ u(_, {})
1432
- }), /* @__PURE__ */ u(m, { children: me.map((e) => /* @__PURE__ */ u(h, {
1483
+ children: /* @__PURE__ */ l(g, {})
1484
+ }), /* @__PURE__ */ l(p, { children: ge.map((e) => /* @__PURE__ */ l(m, {
1433
1485
  value: e.value,
1434
- children: c(e.key, e.defaultValue)
1486
+ children: s(e.key, e.defaultValue)
1435
1487
  }, e.value)) })]
1436
1488
  }),
1437
- /* @__PURE__ */ u("p", {
1489
+ /* @__PURE__ */ l("p", {
1438
1490
  className: "mt-1 text-xs text-text-secondary",
1439
- children: c("healthybowl.crops.fieldDetail.form.type.hint", "Bed, plant and seed estimates are only calculated for open fields and raised beds.")
1491
+ children: s("healthybowl.crops.fieldDetail.form.type.hint", "Estimates follow the type: bed geometry for open fields and raised beds, bench, tree or rack geometry for the rest.")
1492
+ }),
1493
+ /* @__PURE__ */ l("div", {
1494
+ className: "mt-3",
1495
+ children: /* @__PURE__ */ l(xe, {
1496
+ type: O,
1497
+ value: zt,
1498
+ onChange: Bt,
1499
+ t: s,
1500
+ testIdPrefix: "field-detail-grow-geometry"
1501
+ })
1440
1502
  })
1441
1503
  ] }),
1442
- /* @__PURE__ */ d("div", { children: [/* @__PURE__ */ u("label", {
1504
+ /* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("label", {
1443
1505
  className: "text-sm font-medium text-text-primary",
1444
- children: c("healthybowl.crops.fieldDetail.form.soilType.label", "Soil Type")
1445
- }), /* @__PURE__ */ u("input", {
1506
+ children: s("healthybowl.crops.fieldDetail.form.soilType.label", "Soil Type")
1507
+ }), /* @__PURE__ */ l("input", {
1446
1508
  type: "text",
1447
- value: St,
1448
- onChange: (e) => Ct(e.target.value),
1509
+ value: At,
1510
+ onChange: (e) => jt(e.target.value),
1449
1511
  className: "mt-1 w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
1450
1512
  })] }),
1451
- /* @__PURE__ */ d("div", { children: [/* @__PURE__ */ u("label", {
1513
+ /* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("label", {
1452
1514
  className: "text-sm font-medium text-text-primary",
1453
- children: c("healthybowl.crops.fieldDetail.form.irrigationType.label", "Irrigation Type")
1454
- }), /* @__PURE__ */ u("input", {
1515
+ children: s("healthybowl.crops.fieldDetail.form.irrigationType.label", "Irrigation Type")
1516
+ }), /* @__PURE__ */ l("input", {
1455
1517
  type: "text",
1456
- value: wt,
1457
- onChange: (e) => Tt(e.target.value),
1518
+ value: Mt,
1519
+ onChange: (e) => Nt(e.target.value),
1458
1520
  className: "mt-1 w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
1459
1521
  })] }),
1460
- /* @__PURE__ */ u("div", {
1522
+ /* @__PURE__ */ l("div", {
1461
1523
  className: "sm:col-span-2",
1462
- children: /* @__PURE__ */ d("label", {
1524
+ children: /* @__PURE__ */ u("label", {
1463
1525
  className: "flex cursor-pointer items-center gap-2 text-sm font-medium text-text-primary",
1464
- children: [/* @__PURE__ */ u("input", {
1526
+ children: [/* @__PURE__ */ l("input", {
1465
1527
  type: "checkbox",
1466
- checked: At,
1467
- onChange: (e) => jt(e.target.checked),
1528
+ checked: Lt,
1529
+ onChange: (e) => Rt(e.target.checked),
1468
1530
  className: "h-4 w-4 rounded border-border-subtle text-primary focus:ring-[var(--color-focus-ring)]"
1469
- }), c("healthybowl.crops.fieldDetail.form.organicCertified.label", "Organic Certified")]
1531
+ }), s("healthybowl.crops.fieldDetail.form.organicCertified.label", "Organic Certified")]
1470
1532
  })
1471
1533
  })
1472
1534
  ]
1473
1535
  })
1474
1536
  }),
1475
- /* @__PURE__ */ u(te, {
1476
- toasts: ft,
1477
- onDismiss: pt
1537
+ /* @__PURE__ */ l(ne, {
1538
+ toasts: vt,
1539
+ onDismiss: yt
1478
1540
  })
1479
1541
  ]
1480
- }) : /* @__PURE__ */ u(r, {
1481
- title: c("healthybowl.crops.fieldDetail.notFound.pageTitle", "Field Not Found"),
1482
- children: st.crops ? /* @__PURE__ */ u(ie, {}) : ot.crops ? /* @__PURE__ */ u(a, { onRetry: ut }) : /* @__PURE__ */ u(ee, {
1483
- title: c("healthybowl.crops.fieldDetail.notFound.title", "Field not found"),
1484
- description: c("healthybowl.crops.fieldDetail.notFound.description", "The field you are looking for does not exist."),
1485
- action: /* @__PURE__ */ u(f, {
1486
- onClick: () => w(T("crops/fields")),
1487
- children: c("healthybowl.crops.fieldDetail.actions.backToFields", "Back to Fields")
1542
+ }) : /* @__PURE__ */ l(r, {
1543
+ title: s("healthybowl.crops.fieldDetail.notFound.pageTitle", "Field Not Found"),
1544
+ children: pt.crops ? /* @__PURE__ */ l(ae, {}) : ft.crops ? /* @__PURE__ */ l(te, { onRetry: gt }) : /* @__PURE__ */ l(ee, {
1545
+ title: s("healthybowl.crops.fieldDetail.notFound.title", "Field not found"),
1546
+ description: s("healthybowl.crops.fieldDetail.notFound.description", "The field you are looking for does not exist."),
1547
+ action: /* @__PURE__ */ l(d, {
1548
+ onClick: () => C(w("crops/fields")),
1549
+ children: s("healthybowl.crops.fieldDetail.actions.backToFields", "Back to Fields")
1488
1550
  })
1489
1551
  })
1490
1552
  });
1491
- }, b = ({ label: e, unit: t, value: n, min: r, step: i, onChange: ee }) => /* @__PURE__ */ d("div", { children: [/* @__PURE__ */ u("label", {
1553
+ }, y = ({ label: e, unit: t, value: n, min: r, step: i, onChange: ee }) => /* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("label", {
1492
1554
  className: "text-xs font-medium text-text-secondary",
1493
1555
  children: e
1494
- }), /* @__PURE__ */ d("div", {
1556
+ }), /* @__PURE__ */ u("div", {
1495
1557
  className: "relative mt-1",
1496
- children: [/* @__PURE__ */ u("input", {
1558
+ children: [/* @__PURE__ */ l("input", {
1497
1559
  type: "number",
1498
1560
  value: n,
1499
1561
  min: r,
1500
1562
  step: i,
1501
1563
  onChange: (e) => ee(e.target.value),
1502
1564
  className: "h-10 w-full rounded-md border border-border-subtle bg-bg-surface px-3 pe-8 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)] [appearance:textfield] [&::-webkit-inner-spin-button]:m-0 [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:m-0 [&::-webkit-outer-spin-button]:appearance-none"
1503
- }), /* @__PURE__ */ u("span", {
1565
+ }), /* @__PURE__ */ l("span", {
1504
1566
  className: "pointer-events-none absolute end-3 top-1/2 -translate-y-1/2 text-xs text-text-secondary",
1505
1567
  children: t
1506
1568
  })]
1507
- })] }), x = ({ label: e, value: t, unit: n }) => /* @__PURE__ */ d("div", {
1569
+ })] }), b = ({ label: e, value: t, unit: n }) => /* @__PURE__ */ u("div", {
1508
1570
  className: "flex min-w-0 flex-col rounded-md border border-border-subtle bg-bg-sunken/60 p-3",
1509
- children: [/* @__PURE__ */ u("span", {
1571
+ children: [/* @__PURE__ */ l("span", {
1510
1572
  className: "block text-xs leading-tight text-text-secondary",
1511
1573
  children: e
1512
- }), /* @__PURE__ */ d("p", {
1574
+ }), /* @__PURE__ */ u("p", {
1513
1575
  className: "mt-auto pt-1 text-lg font-semibold text-text-primary",
1514
- children: [t, n && /* @__PURE__ */ u("span", {
1576
+ children: [t, n && /* @__PURE__ */ l("span", {
1515
1577
  className: "ms-1 text-xs font-medium text-text-secondary",
1516
1578
  children: n
1517
1579
  })]
1518
1580
  })]
1519
- }), S = ({ label: e, sortKey: t, activeKey: n, direction: r, onSort: i, align: ee = "left" }) => {
1520
- let a = n === t;
1521
- return /* @__PURE__ */ u("th", {
1581
+ }), x = ({ label: e, sortKey: t, activeKey: n, direction: r, onSort: i, align: ee = "left" }) => {
1582
+ let te = n === t;
1583
+ return /* @__PURE__ */ l("th", {
1522
1584
  scope: "col",
1523
- "aria-sort": a ? r === "asc" ? "ascending" : "descending" : "none",
1585
+ "aria-sort": te ? r === "asc" ? "ascending" : "descending" : "none",
1524
1586
  className: `whitespace-nowrap px-3 py-2 text-xs font-medium ${ee === "right" ? "text-end" : "text-start"}`,
1525
- children: /* @__PURE__ */ d("button", {
1587
+ children: /* @__PURE__ */ u("button", {
1526
1588
  type: "button",
1527
1589
  onClick: () => i(t),
1528
- className: `inline-flex items-center gap-1 rounded focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)] ${a ? "text-text-primary" : "text-text-secondary hover:text-text-primary"}`,
1529
- children: [e, a && u(r === "asc" ? Fe : c, {
1590
+ className: `inline-flex items-center gap-1 rounded focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)] ${te ? "text-text-primary" : "text-text-secondary hover:text-text-primary"}`,
1591
+ children: [e, te && l(r === "asc" ? Ve : s, {
1530
1592
  className: "h-3 w-3",
1531
1593
  "aria-hidden": "true"
1532
1594
  })]
@@ -1534,6 +1596,6 @@ var et = (e) => {
1534
1596
  });
1535
1597
  };
1536
1598
  //#endregion
1537
- export { rt as FieldDetailsPage };
1599
+ export { lt as FieldDetailsPage };
1538
1600
 
1539
1601
  //# sourceMappingURL=FieldDetailsPage.js.map