@burdenoff/microfe-healthybowl 2026.1005.2 → 2026.1007.2

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