@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.
- package/dist/healthybowl/components/BedLayoutGrid.js +128 -115
- package/dist/healthybowl/components/BedLayoutGrid.js.map +1 -1
- package/dist/healthybowl/components/CropPicker.js +37 -0
- package/dist/healthybowl/components/CropPicker.js.map +1 -0
- package/dist/healthybowl/components/DataTable.js +125 -108
- package/dist/healthybowl/components/DataTable.js.map +1 -1
- package/dist/healthybowl/components/FilterBar.js +9 -6
- package/dist/healthybowl/components/FilterBar.js.map +1 -1
- package/dist/healthybowl/components/PlantCatalogPicker.js +32 -0
- package/dist/healthybowl/components/PlantCatalogPicker.js.map +1 -0
- package/dist/healthybowl/components/WorkspaceRecordPicker.js +164 -0
- package/dist/healthybowl/components/WorkspaceRecordPicker.js.map +1 -0
- package/dist/healthybowl/components/index.js +3 -1
- package/dist/healthybowl/hooks/useCropPage.js +71 -0
- package/dist/healthybowl/hooks/useCropPage.js.map +1 -0
- package/dist/healthybowl/hooks/usePlantCatalog.js +133 -44
- package/dist/healthybowl/hooks/usePlantCatalog.js.map +1 -1
- package/dist/healthybowl/hooks/usePlantingEstimate.js +6 -6
- package/dist/healthybowl/hooks/usePlantingEstimate.js.map +1 -1
- package/dist/healthybowl/hooks/useWorkspaceRead.js +46 -0
- package/dist/healthybowl/hooks/useWorkspaceRead.js.map +1 -0
- package/dist/healthybowl/pages/HomePage.js +143 -142
- package/dist/healthybowl/pages/HomePage.js.map +1 -1
- package/dist/healthybowl/pages/analytics/ReportsPage.js +8 -8
- package/dist/healthybowl/pages/catalog/PlantCatalogPage.js +266 -192
- package/dist/healthybowl/pages/catalog/PlantCatalogPage.js.map +1 -1
- package/dist/healthybowl/pages/catalog/WorkspaceBrowseFilters.js +58 -0
- package/dist/healthybowl/pages/catalog/WorkspaceBrowseFilters.js.map +1 -0
- package/dist/healthybowl/pages/catalog/browsePagination.js +24 -0
- package/dist/healthybowl/pages/catalog/browsePagination.js.map +1 -0
- package/dist/healthybowl/pages/compliance/ComplianceDocumentsPage.js +6 -6
- package/dist/healthybowl/pages/crops/CropDetailsPage.js +340 -348
- package/dist/healthybowl/pages/crops/CropDetailsPage.js.map +1 -1
- package/dist/healthybowl/pages/crops/CropPlanningPage.js +468 -434
- package/dist/healthybowl/pages/crops/CropPlanningPage.js.map +1 -1
- package/dist/healthybowl/pages/crops/CropsPage.js +633 -542
- package/dist/healthybowl/pages/crops/CropsPage.js.map +1 -1
- package/dist/healthybowl/pages/crops/FieldDetailsPage.js +875 -800
- package/dist/healthybowl/pages/crops/FieldDetailsPage.js.map +1 -1
- package/dist/healthybowl/pages/crops/PlanningDetailsPage.js +459 -448
- package/dist/healthybowl/pages/crops/PlanningDetailsPage.js.map +1 -1
- package/dist/healthybowl/pages/crops/SuccessionCropLabel.js +21 -0
- package/dist/healthybowl/pages/crops/SuccessionCropLabel.js.map +1 -0
- package/dist/healthybowl/pages/crops/planningEdit.js +30 -0
- package/dist/healthybowl/pages/crops/planningEdit.js.map +1 -0
- package/dist/healthybowl/pages/fields/FieldMapPage.js +989 -941
- package/dist/healthybowl/pages/fields/FieldMapPage.js.map +1 -1
- package/dist/healthybowl/pages/financial/GeneralLedgerPage.js +6 -6
- package/dist/healthybowl/pages/financial/InvoiceManagementPage.js +7 -7
- package/dist/healthybowl/pages/financial/InvoiceManagementPage.js.map +1 -1
- package/dist/healthybowl/pages/financial/TransactionsPage.js +541 -541
- package/dist/healthybowl/pages/financial/TransactionsPage.js.map +1 -1
- package/dist/healthybowl/pages/government-schemes/ApplicationTrackingPage.js +10 -10
- package/dist/healthybowl/pages/government-schemes/CommunicationPage.js +207 -207
- package/dist/healthybowl/pages/government-schemes/CommunicationPage.js.map +1 -1
- package/dist/healthybowl/pages/government-schemes/SchemeAdminPage.js +38 -38
- package/dist/healthybowl/pages/government-schemes/SchemeAdminPage.js.map +1 -1
- package/dist/healthybowl/pages/government-schemes/TrainingProgramsPage.js +15 -15
- package/dist/healthybowl/pages/government-schemes/TrainingProgramsPage.js.map +1 -1
- package/dist/healthybowl/pages/livestock/AnimalRegistryPage.js +4 -4
- package/dist/healthybowl/pages/livestock/BreedingManagementPage.js +4 -4
- package/dist/healthybowl/pages/livestock/FeedManagementPage.js +4 -4
- package/dist/healthybowl/pages/livestock/HealthRecordsPage.js +16 -16
- package/dist/healthybowl/pages/livestock/HealthRecordsPage.js.map +1 -1
- package/dist/healthybowl/pages/livestock/ProductionTrackingPage.js +4 -4
- package/dist/healthybowl/pages/livestock/VaccinationSchedulePage.js +4 -4
- package/dist/healthybowl/pages/market/MarketPricesPage.js +305 -305
- package/dist/healthybowl/pages/market/MarketPricesPage.js.map +1 -1
- package/dist/healthybowl/pages/network/CohortsPage.js +107 -107
- package/dist/healthybowl/pages/network/CohortsPage.js.map +1 -1
- package/dist/healthybowl/pages/network/CommunityPage.js +247 -247
- package/dist/healthybowl/pages/network/CommunityPage.js.map +1 -1
- package/dist/healthybowl/pages/network/EventsPage.js +16 -16
- package/dist/healthybowl/pages/network/EventsPage.js.map +1 -1
- package/dist/healthybowl/pages/network/ExpertsPage.js +470 -470
- package/dist/healthybowl/pages/network/ExpertsPage.js.map +1 -1
- package/dist/healthybowl/pages/network/MentorsPage.js +6 -6
- package/dist/healthybowl/pages/pest-management/PestIssuesPage.js +8 -8
- package/dist/healthybowl/pages/pest-management/TreatmentLibraryPage.js +7 -7
- package/dist/healthybowl/pages/pest-management/TreatmentLibraryPage.js.map +1 -1
- package/dist/healthybowl/pages/production/ProductionBatchesPage.js +7 -7
- package/dist/healthybowl/pages/production/RecipeManagementPage.js +5 -5
- package/dist/healthybowl/pages/production/ValueAddedProductsPage.js +7 -7
- package/dist/healthybowl/pages/soil/SoilTestsPage.js +6 -6
- package/dist/healthybowl/pages/soil/SoilTestsPage.js.map +1 -1
- package/dist/healthybowl/pages/suppliers/SuppliersPage.js +10 -10
- package/dist/healthybowl/pages/sustainability/CarbonCreditLedgerPage.js +6 -6
- package/dist/healthybowl/pages/terrace/PlantingFormModal.js +151 -131
- package/dist/healthybowl/pages/terrace/PlantingFormModal.js.map +1 -1
- package/dist/healthybowl/pages/traceability/BatchTrackingPage.js +6 -6
- package/dist/healthybowl/utils/cropComparison.js +1 -1
- package/dist/healthybowl/utils/cropComparison.js.map +1 -1
- package/dist/healthybowl/utils/cropPicker.js +35 -0
- package/dist/healthybowl/utils/cropPicker.js.map +1 -0
- package/dist/healthybowl/utils/plantingCapacity.js +2 -2
- package/dist/healthybowl/utils/plantingCapacity.js.map +1 -1
- package/dist/healthybowl/utils/quotaLabels.js +8 -0
- package/dist/healthybowl/utils/quotaLabels.js.map +1 -0
- package/dist/healthybowl/utils/seedRate.js +1 -8
- package/dist/healthybowl/utils/seedRate.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,327 +1,360 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
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
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
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
|
|
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
|
-
},
|
|
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
|
-
},
|
|
57
|
+
}, _ = (e, t) => {
|
|
49
58
|
let n = Number(e);
|
|
50
59
|
return Number.isFinite(n) && n > 0 ? n : t;
|
|
51
|
-
},
|
|
60
|
+
}, Et = (e, t) => {
|
|
52
61
|
let n = Number(e);
|
|
53
62
|
return Number.isFinite(n) && n >= 0 ? n : t;
|
|
54
|
-
},
|
|
55
|
-
let {
|
|
56
|
-
|
|
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
|
|
61
|
-
}, [
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
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
|
-
|
|
94
|
+
Ht(!0);
|
|
74
95
|
try {
|
|
75
|
-
await
|
|
76
|
-
id:
|
|
77
|
-
name:
|
|
78
|
-
area: Number(
|
|
79
|
-
unit:
|
|
80
|
-
soilType:
|
|
81
|
-
irrigationType:
|
|
82
|
-
status:
|
|
83
|
-
type:
|
|
84
|
-
organicCertified:
|
|
85
|
-
growGeometry:
|
|
86
|
-
}),
|
|
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:
|
|
109
|
+
description: d("healthybowl.crops.fieldDetail.toast.updated.description", "{{name}} has been saved.", { name: Wt.trim() }),
|
|
89
110
|
variant: "success"
|
|
90
|
-
}),
|
|
111
|
+
}), Bt(!1);
|
|
91
112
|
} catch (e) {
|
|
92
|
-
|
|
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
|
-
|
|
119
|
+
Ht(!1);
|
|
99
120
|
}
|
|
100
121
|
}
|
|
101
|
-
},
|
|
102
|
-
if (
|
|
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:
|
|
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
|
-
|
|
129
|
+
Ht(!0);
|
|
109
130
|
try {
|
|
110
|
-
await
|
|
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:
|
|
133
|
+
description: d("healthybowl.crops.fieldDetail.toast.deleted.description", "{{name}} has been removed.", { name: E.name }),
|
|
113
134
|
variant: "success"
|
|
114
|
-
}),
|
|
135
|
+
}), C(w("crops/fields"));
|
|
115
136
|
} catch (e) {
|
|
116
|
-
|
|
137
|
+
T({
|
|
117
138
|
title: d("healthybowl.crops.fieldDetail.toast.deleteFailed.title", "Delete failed"),
|
|
118
139
|
description: String(e),
|
|
119
140
|
variant: "error"
|
|
120
|
-
}),
|
|
141
|
+
}), Ht(!1);
|
|
121
142
|
}
|
|
122
143
|
}
|
|
123
|
-
},
|
|
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 [...
|
|
126
|
-
}, [
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
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
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
I,
|
|
162
|
+
V,
|
|
163
|
+
M,
|
|
164
|
+
B,
|
|
165
|
+
E,
|
|
143
166
|
N,
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
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
|
-
|
|
155
|
-
|
|
156
|
-
|
|
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
|
-
|
|
181
|
-
]),
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
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
|
-
|
|
207
|
-
])
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
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
|
-
|
|
217
|
-
}, [
|
|
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
|
|
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
|
-
}, [
|
|
225
|
-
let
|
|
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,
|
|
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:
|
|
243
|
-
let r =
|
|
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:
|
|
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) >
|
|
275
|
+
truncated: Math.trunc(t) > Ct
|
|
251
276
|
};
|
|
252
277
|
}, [
|
|
253
278
|
Z,
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
]),
|
|
258
|
-
if (!
|
|
259
|
-
|
|
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
|
-
|
|
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
|
-
|
|
301
|
+
cr(!0);
|
|
269
302
|
try {
|
|
270
|
-
let n = await
|
|
271
|
-
fieldId:
|
|
272
|
-
bedId:
|
|
273
|
-
cropId:
|
|
274
|
-
plantCatalogId:
|
|
275
|
-
season:
|
|
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:
|
|
281
|
-
seedGrams:
|
|
282
|
-
seedlingsToRaise:
|
|
283
|
-
density:
|
|
284
|
-
plantSpacingCm:
|
|
285
|
-
rowSpacingCm:
|
|
286
|
-
bedWidthM:
|
|
287
|
-
pathWidthM:
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
334
|
+
cr(!1);
|
|
302
335
|
}
|
|
303
|
-
},
|
|
304
|
-
if (await
|
|
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
|
|
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
|
-
|
|
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
|
-
},
|
|
323
|
-
location:
|
|
324
|
-
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:
|
|
335
|
-
},
|
|
367
|
+
forecast: At?.forecast ?? []
|
|
368
|
+
}, pr = l(() => {
|
|
336
369
|
let e = [];
|
|
337
|
-
return
|
|
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
|
-
}),
|
|
351
|
-
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
|
-
|
|
361
|
-
|
|
393
|
+
F,
|
|
394
|
+
$,
|
|
362
395
|
d
|
|
363
|
-
]),
|
|
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
|
-
}] :
|
|
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
|
-
})), [
|
|
372
|
-
return
|
|
373
|
-
title:
|
|
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:
|
|
376
|
-
unit:
|
|
377
|
-
soilType:
|
|
408
|
+
area: E.area,
|
|
409
|
+
unit: E.unit,
|
|
410
|
+
soilType: E.soilType
|
|
378
411
|
}),
|
|
379
|
-
actions: /* @__PURE__ */
|
|
412
|
+
actions: /* @__PURE__ */ m("div", {
|
|
380
413
|
className: "flex items-center gap-2",
|
|
381
414
|
children: [
|
|
382
|
-
/* @__PURE__ */
|
|
415
|
+
/* @__PURE__ */ p(_e, {
|
|
383
416
|
entityType: "FIELD",
|
|
384
|
-
entityId:
|
|
385
|
-
entityLabel:
|
|
417
|
+
entityId: E.id,
|
|
418
|
+
entityLabel: E.name
|
|
386
419
|
}),
|
|
387
|
-
/* @__PURE__ */
|
|
420
|
+
/* @__PURE__ */ m(h, {
|
|
388
421
|
variant: "outline",
|
|
389
|
-
onClick: () =>
|
|
422
|
+
onClick: () => C(xn),
|
|
390
423
|
children: [
|
|
391
|
-
/* @__PURE__ */
|
|
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__ */
|
|
429
|
+
/* @__PURE__ */ m(h, {
|
|
397
430
|
variant: "outline",
|
|
398
|
-
onClick: () =>
|
|
431
|
+
onClick: () => C(w("crops/fields")),
|
|
399
432
|
children: [
|
|
400
|
-
/* @__PURE__ */
|
|
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__ */
|
|
438
|
+
/* @__PURE__ */ m(h, {
|
|
406
439
|
variant: "outline",
|
|
407
|
-
onClick:
|
|
440
|
+
onClick: vn,
|
|
408
441
|
children: [
|
|
409
|
-
/* @__PURE__ */
|
|
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__ */
|
|
447
|
+
/* @__PURE__ */ m(h, {
|
|
415
448
|
variant: "destructive",
|
|
416
|
-
onClick:
|
|
417
|
-
disabled:
|
|
449
|
+
onClick: bn,
|
|
450
|
+
disabled: Vt,
|
|
418
451
|
children: [
|
|
419
|
-
/* @__PURE__ */
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
483
|
+
href: w("crops/planning")
|
|
451
484
|
}
|
|
452
485
|
],
|
|
453
486
|
nextStepsKey: "healthybowl-field-detail",
|
|
454
487
|
children: [
|
|
455
|
-
/* @__PURE__ */
|
|
488
|
+
/* @__PURE__ */ p(de, { items: [
|
|
456
489
|
{
|
|
457
490
|
label: d("healthybowl.crops.fieldDetail.breadcrumbs.crops", "Crops"),
|
|
458
|
-
href:
|
|
491
|
+
href: w("crops")
|
|
459
492
|
},
|
|
460
493
|
{
|
|
461
494
|
label: d("healthybowl.crops.fieldDetail.breadcrumbs.fields", "Fields"),
|
|
462
|
-
href:
|
|
495
|
+
href: w("crops/fields")
|
|
463
496
|
},
|
|
464
|
-
{ label:
|
|
497
|
+
{ label: E.name }
|
|
465
498
|
] }),
|
|
466
|
-
/* @__PURE__ */
|
|
499
|
+
/* @__PURE__ */ m("div", {
|
|
467
500
|
className: "flex flex-wrap items-center gap-3",
|
|
468
|
-
children: [/* @__PURE__ */
|
|
469
|
-
label:
|
|
470
|
-
variant:
|
|
501
|
+
children: [/* @__PURE__ */ p(o, {
|
|
502
|
+
label: E.status,
|
|
503
|
+
variant: wt(E.status),
|
|
471
504
|
dot: !0
|
|
472
|
-
}),
|
|
505
|
+
}), E.organicCertified ? /* @__PURE__ */ p(o, {
|
|
473
506
|
label: d("healthybowl.crops.fieldDetail.badges.organicCertified", "Organic Certified"),
|
|
474
507
|
variant: "success"
|
|
475
|
-
}) : /* @__PURE__ */
|
|
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__ */
|
|
481
|
-
fieldId:
|
|
482
|
-
crops:
|
|
513
|
+
/* @__PURE__ */ p(Ue, {
|
|
514
|
+
fieldId: E.id,
|
|
515
|
+
crops: Sn
|
|
483
516
|
}),
|
|
484
|
-
/* @__PURE__ */
|
|
517
|
+
/* @__PURE__ */ m("div", {
|
|
485
518
|
className: "grid grid-cols-1 gap-6 lg:grid-cols-3",
|
|
486
|
-
children: [/* @__PURE__ */
|
|
519
|
+
children: [/* @__PURE__ */ m("div", {
|
|
487
520
|
className: "space-y-6 lg:col-span-2",
|
|
488
521
|
children: [
|
|
489
|
-
/* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
531
|
+
/* @__PURE__ */ m("div", {
|
|
499
532
|
className: "grid grid-cols-1 gap-6 sm:grid-cols-2",
|
|
500
|
-
children: [/* @__PURE__ */
|
|
533
|
+
children: [/* @__PURE__ */ m("div", {
|
|
501
534
|
className: "space-y-4",
|
|
502
535
|
children: [
|
|
503
|
-
/* @__PURE__ */
|
|
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__ */
|
|
539
|
+
}), /* @__PURE__ */ p("p", {
|
|
507
540
|
className: "text-sm font-semibold text-text-primary",
|
|
508
|
-
children:
|
|
541
|
+
children: E.name
|
|
509
542
|
})] }),
|
|
510
|
-
/* @__PURE__ */
|
|
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__ */
|
|
546
|
+
}), /* @__PURE__ */ m("p", {
|
|
514
547
|
className: "text-sm font-semibold text-text-primary",
|
|
515
548
|
children: [
|
|
516
|
-
|
|
549
|
+
E.area,
|
|
517
550
|
" ",
|
|
518
|
-
|
|
551
|
+
E.unit
|
|
519
552
|
]
|
|
520
553
|
})] }),
|
|
521
|
-
/* @__PURE__ */
|
|
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__ */
|
|
557
|
+
}), /* @__PURE__ */ p("div", {
|
|
525
558
|
className: "mt-1",
|
|
526
|
-
children: /* @__PURE__ */
|
|
527
|
-
label:
|
|
528
|
-
variant:
|
|
559
|
+
children: /* @__PURE__ */ p(o, {
|
|
560
|
+
label: E.status,
|
|
561
|
+
variant: wt(E.status)
|
|
529
562
|
})
|
|
530
563
|
})] }),
|
|
531
|
-
/* @__PURE__ */
|
|
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__ */
|
|
567
|
+
}), /* @__PURE__ */ p("p", {
|
|
535
568
|
className: "text-sm font-semibold text-text-primary",
|
|
536
|
-
children:
|
|
569
|
+
children: Dn
|
|
537
570
|
})] })
|
|
538
571
|
]
|
|
539
|
-
}), /* @__PURE__ */
|
|
572
|
+
}), /* @__PURE__ */ m("div", {
|
|
540
573
|
className: "space-y-4",
|
|
541
574
|
children: [
|
|
542
|
-
/* @__PURE__ */
|
|
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__ */
|
|
578
|
+
}), /* @__PURE__ */ p("p", {
|
|
546
579
|
className: "text-sm font-semibold text-text-primary",
|
|
547
|
-
children:
|
|
580
|
+
children: E.soilType
|
|
548
581
|
})] }),
|
|
549
|
-
/* @__PURE__ */
|
|
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__ */
|
|
585
|
+
}), /* @__PURE__ */ p("p", {
|
|
553
586
|
className: "text-sm font-semibold text-text-primary",
|
|
554
|
-
children:
|
|
587
|
+
children: E.irrigationType
|
|
555
588
|
})] }),
|
|
556
|
-
/* @__PURE__ */
|
|
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__ */
|
|
592
|
+
}), /* @__PURE__ */ p("p", {
|
|
560
593
|
className: "text-sm font-semibold text-text-primary",
|
|
561
|
-
children: (
|
|
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__ */
|
|
599
|
+
/* @__PURE__ */ m("div", {
|
|
567
600
|
className: "mt-6 border-t border-border-subtle pt-4",
|
|
568
|
-
children: [/* @__PURE__ */
|
|
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
|
-
}),
|
|
604
|
+
}), Ut ? /* @__PURE__ */ m("div", {
|
|
572
605
|
className: "mt-1 flex items-center gap-4",
|
|
573
|
-
children: [/* @__PURE__ */
|
|
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__ */
|
|
611
|
+
/* @__PURE__ */ p("span", {
|
|
579
612
|
className: "font-mono text-sm text-text-primary",
|
|
580
|
-
children:
|
|
613
|
+
children: Ut.lat
|
|
581
614
|
})
|
|
582
615
|
]
|
|
583
|
-
}), /* @__PURE__ */
|
|
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__ */
|
|
621
|
+
/* @__PURE__ */ p("span", {
|
|
589
622
|
className: "font-mono text-sm text-text-primary",
|
|
590
|
-
children:
|
|
623
|
+
children: Ut.lng
|
|
591
624
|
})
|
|
592
625
|
]
|
|
593
626
|
})]
|
|
594
|
-
}) : /* @__PURE__ */
|
|
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__ */
|
|
634
|
+
/* @__PURE__ */ m("div", {
|
|
602
635
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-6",
|
|
603
636
|
children: [
|
|
604
|
-
/* @__PURE__ */
|
|
637
|
+
/* @__PURE__ */ m("div", {
|
|
605
638
|
className: "mb-4",
|
|
606
|
-
children: [/* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
619
|
-
fieldId:
|
|
620
|
-
unit:
|
|
621
|
-
center:
|
|
622
|
-
initialBoundary:
|
|
623
|
-
onSaved:
|
|
624
|
-
onAreaChange:
|
|
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__ */
|
|
659
|
+
/* @__PURE__ */ m("div", {
|
|
627
660
|
className: "mt-5 border-t border-border-subtle pt-5",
|
|
628
|
-
children: [/* @__PURE__ */
|
|
661
|
+
children: [/* @__PURE__ */ m("div", {
|
|
629
662
|
className: "flex flex-wrap items-center justify-between gap-3",
|
|
630
|
-
children: [/* @__PURE__ */
|
|
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"),
|
|
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__ */
|
|
637
|
-
label:
|
|
669
|
+
}), /* @__PURE__ */ p(o, {
|
|
670
|
+
label: V ? z.label : Dn,
|
|
638
671
|
variant: "muted"
|
|
639
672
|
})]
|
|
640
|
-
}),
|
|
673
|
+
}), H ? /* @__PURE__ */ m("div", {
|
|
641
674
|
className: "mt-4",
|
|
642
675
|
"data-testid": "grow-capacity-panel",
|
|
643
|
-
"data-model":
|
|
644
|
-
children: [/* @__PURE__ */
|
|
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__ */
|
|
648
|
-
label:
|
|
649
|
-
value:
|
|
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__ */
|
|
684
|
+
/* @__PURE__ */ p(b, {
|
|
652
685
|
label: d("healthybowl.crops.fieldDetail.capacity.metrics.plantsPerUnit", "Plants / unit"),
|
|
653
|
-
value:
|
|
686
|
+
value: r(H.plantsPerUnit)
|
|
654
687
|
}),
|
|
655
|
-
/* @__PURE__ */
|
|
656
|
-
label:
|
|
657
|
-
value:
|
|
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
|
-
|
|
692
|
+
H.seedlingTarget != null && /* @__PURE__ */ p(b, {
|
|
660
693
|
label: d("healthybowl.crops.fieldDetail.capacity.metrics.seedlings", "Seedlings"),
|
|
661
|
-
value:
|
|
694
|
+
value: r(H.seedlingTarget)
|
|
662
695
|
}),
|
|
663
|
-
/* @__PURE__ */
|
|
696
|
+
/* @__PURE__ */ p(b, {
|
|
664
697
|
label: d("healthybowl.crops.fieldDetail.capacity.metrics.growingArea", "Growing area"),
|
|
665
|
-
value:
|
|
698
|
+
value: v(H.usableAreaSqm, 1),
|
|
666
699
|
unit: "m²"
|
|
667
700
|
})
|
|
668
701
|
]
|
|
669
|
-
}), !
|
|
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
|
-
}) :
|
|
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(
|
|
677
|
-
}) :
|
|
678
|
-
/* @__PURE__ */
|
|
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__ */
|
|
714
|
+
/* @__PURE__ */ m("div", {
|
|
682
715
|
className: "xl:col-span-2",
|
|
683
|
-
children: [/* @__PURE__ */
|
|
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(
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
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
|
-
|
|
729
|
+
/* @__PURE__ */ m("div", {
|
|
699
730
|
className: "xl:col-span-2",
|
|
700
|
-
children: [/* @__PURE__ */
|
|
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(
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
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
|
-
|
|
712
|
-
}
|
|
713
|
-
|
|
714
|
-
|
|
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__ */
|
|
747
|
+
/* @__PURE__ */ p(y, {
|
|
719
748
|
label: d("healthybowl.crops.fieldDetail.capacity.plantSpacing", "Plant spacing"),
|
|
720
749
|
unit: "cm",
|
|
721
|
-
value:
|
|
750
|
+
value: A,
|
|
722
751
|
min: "1",
|
|
723
752
|
step: "1",
|
|
724
|
-
onChange:
|
|
753
|
+
onChange: (e) => {
|
|
754
|
+
k.current.plant = !0, pn(e);
|
|
755
|
+
}
|
|
725
756
|
}),
|
|
726
|
-
/* @__PURE__ */
|
|
757
|
+
/* @__PURE__ */ p(y, {
|
|
727
758
|
label: d("healthybowl.crops.fieldDetail.capacity.rowSpacing", "Row spacing"),
|
|
728
759
|
unit: "cm",
|
|
729
|
-
value:
|
|
760
|
+
value: j,
|
|
730
761
|
min: "1",
|
|
731
762
|
step: "1",
|
|
732
|
-
onChange:
|
|
763
|
+
onChange: (e) => {
|
|
764
|
+
k.current.row = !0, mn(e);
|
|
765
|
+
}
|
|
733
766
|
}),
|
|
734
|
-
/* @__PURE__ */
|
|
767
|
+
/* @__PURE__ */ p(y, {
|
|
735
768
|
label: d("healthybowl.crops.fieldDetail.capacity.bedWidth", "Bed width"),
|
|
736
769
|
unit: "m",
|
|
737
|
-
value:
|
|
770
|
+
value: M,
|
|
738
771
|
min: "0.1",
|
|
739
772
|
step: "0.1",
|
|
740
|
-
onChange:
|
|
773
|
+
onChange: hn
|
|
741
774
|
}),
|
|
742
|
-
/* @__PURE__ */
|
|
775
|
+
/* @__PURE__ */ p(y, {
|
|
743
776
|
label: d("healthybowl.crops.fieldDetail.capacity.pathWidth", "Path width"),
|
|
744
777
|
unit: "m",
|
|
745
|
-
value:
|
|
778
|
+
value: N,
|
|
746
779
|
min: "0",
|
|
747
780
|
step: "0.05",
|
|
748
|
-
onChange:
|
|
781
|
+
onChange: gn
|
|
749
782
|
})
|
|
750
783
|
]
|
|
751
784
|
}),
|
|
752
|
-
|
|
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
|
-
|
|
758
|
-
/* @__PURE__ */
|
|
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__ */
|
|
795
|
+
/* @__PURE__ */ p(b, {
|
|
763
796
|
label: d("healthybowl.crops.fieldDetail.capacity.metrics.beds", "Beds"),
|
|
764
|
-
value:
|
|
797
|
+
value: r(W.bedCount)
|
|
765
798
|
}),
|
|
766
|
-
/* @__PURE__ */
|
|
799
|
+
/* @__PURE__ */ p(b, {
|
|
767
800
|
label: d("healthybowl.crops.fieldDetail.capacity.metrics.rowsPerBed", "Rows / bed"),
|
|
768
|
-
value:
|
|
801
|
+
value: r(W.rowsPerBed)
|
|
769
802
|
}),
|
|
770
|
-
/* @__PURE__ */
|
|
803
|
+
/* @__PURE__ */ p(b, {
|
|
771
804
|
label: d("healthybowl.crops.fieldDetail.capacity.metrics.plantsPerBed", "Plants / bed"),
|
|
772
|
-
value:
|
|
805
|
+
value: r(W.plantsPerBed)
|
|
773
806
|
}),
|
|
774
|
-
/* @__PURE__ */
|
|
807
|
+
/* @__PURE__ */ p(b, {
|
|
775
808
|
label: d("healthybowl.crops.fieldDetail.capacity.metrics.totalPlants", "Total plants"),
|
|
776
|
-
value:
|
|
809
|
+
value: r(W.totalPlants)
|
|
777
810
|
}),
|
|
778
|
-
/* @__PURE__ */
|
|
811
|
+
/* @__PURE__ */ p(b, {
|
|
779
812
|
label: d("healthybowl.crops.fieldDetail.capacity.metrics.seedlings", "Seedlings"),
|
|
780
|
-
value:
|
|
813
|
+
value: r(W.seedlingTarget)
|
|
781
814
|
}),
|
|
782
|
-
/* @__PURE__ */
|
|
815
|
+
/* @__PURE__ */ p(b, {
|
|
783
816
|
label: d("healthybowl.crops.fieldDetail.capacity.metrics.bedLength", "Bed length"),
|
|
784
|
-
value:
|
|
817
|
+
value: v(W.bedLengthM),
|
|
785
818
|
unit: "m"
|
|
786
819
|
}),
|
|
787
|
-
/* @__PURE__ */
|
|
820
|
+
/* @__PURE__ */ p(b, {
|
|
788
821
|
label: d("healthybowl.crops.fieldDetail.capacity.metrics.density", "Density"),
|
|
789
|
-
value:
|
|
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
|
-
|
|
827
|
+
G && /* @__PURE__ */ m("div", {
|
|
795
828
|
className: "mt-5 border-t border-border-subtle pt-4",
|
|
796
829
|
children: [
|
|
797
|
-
/* @__PURE__ */
|
|
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__ */
|
|
833
|
+
/* @__PURE__ */ p(ot, { className: "h-3.5 w-3.5 text-success" }),
|
|
801
834
|
d("healthybowl.crops.fieldDetail.seedRate.heading", "Seed rate"),
|
|
802
|
-
|
|
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__ */
|
|
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__ */
|
|
845
|
+
/* @__PURE__ */ p(b, {
|
|
813
846
|
label: d("healthybowl.crops.fieldDetail.seedRate.seedNeeded", "Seed needed"),
|
|
814
|
-
value:
|
|
815
|
-
unit:
|
|
847
|
+
value: G.seedGrams == null ? "—" : v(G.seedGrams, 2),
|
|
848
|
+
unit: G.seedGrams == null ? void 0 : "g"
|
|
816
849
|
}),
|
|
817
|
-
/* @__PURE__ */
|
|
850
|
+
/* @__PURE__ */ p(b, {
|
|
818
851
|
label: d("healthybowl.crops.fieldDetail.seedRate.seedlings", "Seedlings to raise"),
|
|
819
|
-
value:
|
|
852
|
+
value: r(G.seedlingsToRaise)
|
|
820
853
|
}),
|
|
821
|
-
/* @__PURE__ */
|
|
854
|
+
/* @__PURE__ */ p(b, {
|
|
822
855
|
label: d("healthybowl.crops.fieldDetail.seedRate.trays", "Trays"),
|
|
823
|
-
value:
|
|
856
|
+
value: G.trays == null ? "—" : r(G.trays)
|
|
824
857
|
})
|
|
825
858
|
]
|
|
826
859
|
}),
|
|
827
|
-
|
|
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__ */
|
|
866
|
+
/* @__PURE__ */ m("div", {
|
|
834
867
|
className: "mt-5 border-t border-border-subtle pt-4",
|
|
835
|
-
children: [
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
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__ */
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
e.
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
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__ */
|
|
958
|
-
|
|
959
|
-
|
|
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
|
-
]
|
|
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__ */
|
|
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__ */
|
|
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(
|
|
1044
|
+
children: d(xe.key, xe.defaultValue, { type: Dn })
|
|
974
1045
|
})]
|
|
975
1046
|
})
|
|
976
1047
|
]
|
|
977
1048
|
}),
|
|
978
|
-
/* @__PURE__ */
|
|
1049
|
+
/* @__PURE__ */ m("div", {
|
|
979
1050
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-6",
|
|
980
1051
|
children: [
|
|
981
|
-
/* @__PURE__ */
|
|
1052
|
+
/* @__PURE__ */ m("div", {
|
|
982
1053
|
className: "mb-4",
|
|
983
|
-
children: [/* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
1066
|
+
/* @__PURE__ */ m("div", {
|
|
996
1067
|
className: "grid gap-3 md:grid-cols-2 xl:grid-cols-4",
|
|
997
1068
|
children: [
|
|
998
|
-
/* @__PURE__ */
|
|
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__ */
|
|
1072
|
+
}), /* @__PURE__ */ p("input", {
|
|
1002
1073
|
type: "date",
|
|
1003
1074
|
value: Z,
|
|
1004
|
-
onChange: (e) =>
|
|
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__ */
|
|
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:
|
|
1081
|
+
value: tr,
|
|
1011
1082
|
min: "1",
|
|
1012
1083
|
step: "1",
|
|
1013
|
-
onChange:
|
|
1084
|
+
onChange: nr
|
|
1014
1085
|
}),
|
|
1015
|
-
/* @__PURE__ */
|
|
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:
|
|
1089
|
+
value: rr,
|
|
1019
1090
|
min: "1",
|
|
1020
1091
|
step: "1",
|
|
1021
|
-
onChange:
|
|
1092
|
+
onChange: ir
|
|
1022
1093
|
}),
|
|
1023
|
-
|
|
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__ */
|
|
1027
|
-
value:
|
|
1028
|
-
onValueChange: (e) =>
|
|
1029
|
-
children: [/* @__PURE__ */
|
|
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__ */
|
|
1032
|
-
}), /* @__PURE__ */
|
|
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
|
-
}),
|
|
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
|
-
|
|
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__ */
|
|
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:
|
|
1119
|
+
children: d("healthybowl.crops.fieldDetail.succession.preview.heading", "Generated schedule ({{count}} sowings)", { count: Q.rows.length })
|
|
1049
1120
|
}),
|
|
1050
|
-
/* @__PURE__ */
|
|
1121
|
+
/* @__PURE__ */ p("ul", {
|
|
1051
1122
|
className: "mt-2 space-y-1.5",
|
|
1052
|
-
children:
|
|
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__ */
|
|
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__ */
|
|
1060
|
-
e.harvestDate ? /* @__PURE__ */
|
|
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:
|
|
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__ */
|
|
1138
|
+
/* @__PURE__ */ p("p", {
|
|
1068
1139
|
className: "mt-2 text-xs text-text-secondary",
|
|
1069
|
-
children:
|
|
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
|
-
|
|
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:
|
|
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__ */
|
|
1148
|
+
/* @__PURE__ */ m("div", {
|
|
1078
1149
|
className: "mt-4 flex flex-wrap items-center justify-between gap-3",
|
|
1079
|
-
children: [/* @__PURE__ */
|
|
1150
|
+
children: [/* @__PURE__ */ p("p", {
|
|
1080
1151
|
className: "text-xs text-text-secondary",
|
|
1081
|
-
children:
|
|
1082
|
-
}), /* @__PURE__ */
|
|
1083
|
-
onClick:
|
|
1084
|
-
disabled:
|
|
1085
|
-
children: [/* @__PURE__ */
|
|
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
|
-
|
|
1159
|
+
lr.length > 0 ? /* @__PURE__ */ p("div", {
|
|
1089
1160
|
className: "mt-5 space-y-5 border-t border-border-subtle pt-5",
|
|
1090
|
-
children:
|
|
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__ */
|
|
1163
|
+
children: [/* @__PURE__ */ p("h4", {
|
|
1093
1164
|
className: "text-sm font-semibold text-text-primary",
|
|
1094
|
-
children:
|
|
1095
|
-
|
|
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:
|
|
1172
|
+
children: d("healthybowl.crops.fieldDetail.succession.sowingCount", "{{count}} sowings", { count: n.length })
|
|
1098
1173
|
})]
|
|
1099
|
-
}), /* @__PURE__ */
|
|
1174
|
+
}), /* @__PURE__ */ p("div", {
|
|
1100
1175
|
className: "space-y-2",
|
|
1101
|
-
children:
|
|
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__ */
|
|
1178
|
+
children: [/* @__PURE__ */ m("div", {
|
|
1104
1179
|
className: "flex items-center gap-3",
|
|
1105
|
-
children: [/* @__PURE__ */
|
|
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: (
|
|
1108
|
-
}), /* @__PURE__ */
|
|
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: (
|
|
1186
|
+
d("healthybowl.crops.fieldDetail.succession.sowingLabel", "Sowing {{n}}", { n: (e.successionIndex ?? n) + 1 }),
|
|
1112
1187
|
" ",
|
|
1113
1188
|
"— ",
|
|
1114
|
-
e
|
|
1189
|
+
t(e.sowDate ?? e.startDate)
|
|
1115
1190
|
]
|
|
1116
|
-
}),
|
|
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:
|
|
1120
|
-
grams:
|
|
1194
|
+
seedlings: r(e.seedlingsToRaise),
|
|
1195
|
+
grams: e.seedGrams == null ? "" : ` · ${v(e.seedGrams, 2)} g seed`
|
|
1121
1196
|
})
|
|
1122
1197
|
})] })]
|
|
1123
|
-
}), /* @__PURE__ */
|
|
1198
|
+
}), /* @__PURE__ */ p(h, {
|
|
1124
1199
|
variant: "ghost",
|
|
1125
1200
|
size: "icon-sm",
|
|
1126
|
-
onClick: () => void
|
|
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__ */
|
|
1204
|
+
children: /* @__PURE__ */ p(ut, { className: "h-4 w-4" })
|
|
1130
1205
|
})]
|
|
1131
|
-
},
|
|
1132
|
-
})] },
|
|
1133
|
-
}) : /* @__PURE__ */
|
|
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__ */
|
|
1214
|
+
/* @__PURE__ */ m("div", {
|
|
1140
1215
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-6",
|
|
1141
|
-
children: [/* @__PURE__ */
|
|
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__ */
|
|
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
|
-
}),
|
|
1223
|
+
}), F.length > 0 ? /* @__PURE__ */ p("div", {
|
|
1149
1224
|
className: "flex flex-col gap-3",
|
|
1150
|
-
children:
|
|
1151
|
-
onClick: () =>
|
|
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__ */
|
|
1154
|
-
/* @__PURE__ */
|
|
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__ */
|
|
1233
|
+
/* @__PURE__ */ p("span", {
|
|
1159
1234
|
className: "ms-2 text-xs text-text-secondary",
|
|
1160
1235
|
children: e.variety
|
|
1161
1236
|
}),
|
|
1162
|
-
/* @__PURE__ */
|
|
1237
|
+
/* @__PURE__ */ m("div", {
|
|
1163
1238
|
className: "mt-1 flex items-center gap-2",
|
|
1164
|
-
children: [/* @__PURE__ */
|
|
1239
|
+
children: [/* @__PURE__ */ p("div", {
|
|
1165
1240
|
className: "h-1.5 w-24 rounded-full bg-bg-sunken",
|
|
1166
|
-
children: /* @__PURE__ */
|
|
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__ */
|
|
1245
|
+
}), /* @__PURE__ */ m("span", {
|
|
1171
1246
|
className: "text-xs text-text-secondary",
|
|
1172
1247
|
children: [e.progress, "%"]
|
|
1173
1248
|
})]
|
|
1174
1249
|
})
|
|
1175
|
-
] }), /* @__PURE__ */
|
|
1250
|
+
] }), /* @__PURE__ */ m("div", {
|
|
1176
1251
|
className: "flex items-center gap-2",
|
|
1177
|
-
children: [/* @__PURE__ */
|
|
1252
|
+
children: [/* @__PURE__ */ p(o, {
|
|
1178
1253
|
label: e.growthStage,
|
|
1179
1254
|
variant: "info"
|
|
1180
|
-
}), /* @__PURE__ */
|
|
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__ */
|
|
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
|
-
|
|
1266
|
+
$ && /* @__PURE__ */ m("div", {
|
|
1192
1267
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-6",
|
|
1193
1268
|
children: [
|
|
1194
|
-
/* @__PURE__ */
|
|
1269
|
+
/* @__PURE__ */ m("div", {
|
|
1195
1270
|
className: "mb-4 flex items-center justify-between",
|
|
1196
|
-
children: [/* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
1204
|
-
label: (
|
|
1205
|
-
variant:
|
|
1278
|
+
}), /* @__PURE__ */ p(o, {
|
|
1279
|
+
label: ($.status ?? "unknown").replace("_", " "),
|
|
1280
|
+
variant: Tt($.status ?? "unknown")
|
|
1206
1281
|
})]
|
|
1207
1282
|
}),
|
|
1208
|
-
/* @__PURE__ */
|
|
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:
|
|
1215
|
-
good:
|
|
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: `${
|
|
1221
|
-
good:
|
|
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: `${
|
|
1227
|
-
good:
|
|
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: `${
|
|
1233
|
-
good:
|
|
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: `${
|
|
1239
|
-
good:
|
|
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: `${
|
|
1245
|
-
good:
|
|
1319
|
+
value: `${$.moisture}%`,
|
|
1320
|
+
good: $.moisture >= 20 && $.moisture <= 40
|
|
1246
1321
|
}
|
|
1247
|
-
].map(({ key: e, label: t, value: n, good: r }) => /* @__PURE__ */
|
|
1322
|
+
].map(({ key: e, label: t, value: n, good: r }) => /* @__PURE__ */ m("div", {
|
|
1248
1323
|
className: "text-center",
|
|
1249
|
-
children: [/* @__PURE__ */
|
|
1324
|
+
children: [/* @__PURE__ */ p("span", {
|
|
1250
1325
|
className: "text-xs text-text-secondary",
|
|
1251
1326
|
children: t
|
|
1252
|
-
}), /* @__PURE__ */
|
|
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
|
-
|
|
1333
|
+
$.recommendations.length > 0 && /* @__PURE__ */ m("div", {
|
|
1259
1334
|
className: "mt-4 border-t border-border-subtle pt-4",
|
|
1260
|
-
children: [/* @__PURE__ */
|
|
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__ */
|
|
1338
|
+
}), /* @__PURE__ */ p("ul", {
|
|
1264
1339
|
className: "space-y-1",
|
|
1265
|
-
children:
|
|
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__ */
|
|
1348
|
+
/* @__PURE__ */ m("div", {
|
|
1274
1349
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-6",
|
|
1275
|
-
children: [/* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
1357
|
+
}), /* @__PURE__ */ p("div", {
|
|
1283
1358
|
className: "space-y-3",
|
|
1284
|
-
children:
|
|
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__ */
|
|
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__ */
|
|
1364
|
+
}), /* @__PURE__ */ p("p", {
|
|
1290
1365
|
className: "text-xs text-text-secondary",
|
|
1291
1366
|
children: e.season
|
|
1292
|
-
})] }), /* @__PURE__ */
|
|
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__ */
|
|
1375
|
+
}), /* @__PURE__ */ m("div", {
|
|
1301
1376
|
className: "space-y-6",
|
|
1302
1377
|
children: [
|
|
1303
|
-
/* @__PURE__ */
|
|
1378
|
+
/* @__PURE__ */ m("div", {
|
|
1304
1379
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-6",
|
|
1305
|
-
children: [/* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
1387
|
+
}), /* @__PURE__ */ m("div", {
|
|
1313
1388
|
className: "space-y-3",
|
|
1314
1389
|
children: [
|
|
1315
|
-
/* @__PURE__ */
|
|
1390
|
+
/* @__PURE__ */ m("div", {
|
|
1316
1391
|
className: "flex items-center justify-between",
|
|
1317
|
-
children: [/* @__PURE__ */
|
|
1392
|
+
children: [/* @__PURE__ */ m("span", {
|
|
1318
1393
|
className: "flex items-center gap-1.5 text-xs text-text-secondary",
|
|
1319
1394
|
children: [
|
|
1320
|
-
/* @__PURE__ */
|
|
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__ */
|
|
1399
|
+
}), /* @__PURE__ */ m("span", {
|
|
1325
1400
|
className: "text-sm font-medium text-text-primary",
|
|
1326
|
-
children: [
|
|
1401
|
+
children: [fr.current.temperature, "°C"]
|
|
1327
1402
|
})]
|
|
1328
1403
|
}),
|
|
1329
|
-
/* @__PURE__ */
|
|
1404
|
+
/* @__PURE__ */ m("div", {
|
|
1330
1405
|
className: "flex items-center justify-between",
|
|
1331
|
-
children: [/* @__PURE__ */
|
|
1406
|
+
children: [/* @__PURE__ */ m("span", {
|
|
1332
1407
|
className: "flex items-center gap-1.5 text-xs text-text-secondary",
|
|
1333
1408
|
children: [
|
|
1334
|
-
/* @__PURE__ */
|
|
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__ */
|
|
1413
|
+
}), /* @__PURE__ */ m("span", {
|
|
1339
1414
|
className: "text-sm font-medium text-text-primary",
|
|
1340
|
-
children: [
|
|
1415
|
+
children: [fr.current.humidity, "%"]
|
|
1341
1416
|
})]
|
|
1342
1417
|
}),
|
|
1343
|
-
/* @__PURE__ */
|
|
1418
|
+
/* @__PURE__ */ m("div", {
|
|
1344
1419
|
className: "flex items-center justify-between",
|
|
1345
|
-
children: [/* @__PURE__ */
|
|
1420
|
+
children: [/* @__PURE__ */ m("span", {
|
|
1346
1421
|
className: "flex items-center gap-1.5 text-xs text-text-secondary",
|
|
1347
1422
|
children: [
|
|
1348
|
-
/* @__PURE__ */
|
|
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__ */
|
|
1427
|
+
}), /* @__PURE__ */ m("span", {
|
|
1353
1428
|
className: "text-sm font-medium text-text-primary",
|
|
1354
|
-
children: [
|
|
1429
|
+
children: [fr.current.windSpeed, " km/h"]
|
|
1355
1430
|
})]
|
|
1356
1431
|
}),
|
|
1357
|
-
/* @__PURE__ */
|
|
1432
|
+
/* @__PURE__ */ m("div", {
|
|
1358
1433
|
className: "flex items-center justify-between",
|
|
1359
|
-
children: [/* @__PURE__ */
|
|
1434
|
+
children: [/* @__PURE__ */ m("span", {
|
|
1360
1435
|
className: "flex items-center gap-1.5 text-xs text-text-secondary",
|
|
1361
1436
|
children: [
|
|
1362
|
-
/* @__PURE__ */
|
|
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__ */
|
|
1441
|
+
}), /* @__PURE__ */ p("span", {
|
|
1367
1442
|
className: "text-sm font-medium text-text-primary",
|
|
1368
|
-
children:
|
|
1443
|
+
children: fr.current.uvIndex
|
|
1369
1444
|
})]
|
|
1370
1445
|
}),
|
|
1371
|
-
/* @__PURE__ */
|
|
1446
|
+
/* @__PURE__ */ m("div", {
|
|
1372
1447
|
className: "flex items-center justify-between",
|
|
1373
|
-
children: [/* @__PURE__ */
|
|
1448
|
+
children: [/* @__PURE__ */ m("span", {
|
|
1374
1449
|
className: "flex items-center gap-1.5 text-xs text-text-secondary",
|
|
1375
1450
|
children: [
|
|
1376
|
-
/* @__PURE__ */
|
|
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__ */
|
|
1455
|
+
}), /* @__PURE__ */ m("span", {
|
|
1381
1456
|
className: "text-sm font-medium text-text-primary",
|
|
1382
|
-
children: [
|
|
1457
|
+
children: [fr.current.visibility, " km"]
|
|
1383
1458
|
})]
|
|
1384
1459
|
})
|
|
1385
1460
|
]
|
|
1386
1461
|
})]
|
|
1387
1462
|
}),
|
|
1388
|
-
/* @__PURE__ */
|
|
1463
|
+
/* @__PURE__ */ m("div", {
|
|
1389
1464
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-6",
|
|
1390
|
-
children: [/* @__PURE__ */
|
|
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__ */
|
|
1468
|
+
}), /* @__PURE__ */ m("div", {
|
|
1394
1469
|
className: "space-y-2",
|
|
1395
1470
|
children: [
|
|
1396
|
-
/* @__PURE__ */
|
|
1471
|
+
/* @__PURE__ */ m(h, {
|
|
1397
1472
|
variant: "outline",
|
|
1398
|
-
onClick: () =>
|
|
1473
|
+
onClick: () => C(w("weather")),
|
|
1399
1474
|
className: "w-full justify-start",
|
|
1400
1475
|
children: [
|
|
1401
|
-
/* @__PURE__ */
|
|
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__ */
|
|
1481
|
+
/* @__PURE__ */ m(h, {
|
|
1407
1482
|
variant: "outline",
|
|
1408
|
-
onClick: () =>
|
|
1483
|
+
onClick: () => C(w("soil-health")),
|
|
1409
1484
|
className: "w-full justify-start",
|
|
1410
1485
|
children: [
|
|
1411
|
-
/* @__PURE__ */
|
|
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__ */
|
|
1491
|
+
/* @__PURE__ */ m(h, {
|
|
1417
1492
|
variant: "outline",
|
|
1418
|
-
onClick: () =>
|
|
1493
|
+
onClick: () => C(w("crops")),
|
|
1419
1494
|
className: "w-full justify-start",
|
|
1420
1495
|
children: [
|
|
1421
|
-
/* @__PURE__ */
|
|
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__ */
|
|
1501
|
+
/* @__PURE__ */ m(h, {
|
|
1427
1502
|
variant: "outline",
|
|
1428
|
-
onClick: () =>
|
|
1503
|
+
onClick: () => C(w("analytics")),
|
|
1429
1504
|
className: "w-full justify-start",
|
|
1430
1505
|
children: [
|
|
1431
|
-
/* @__PURE__ */
|
|
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__ */
|
|
1514
|
+
/* @__PURE__ */ m("div", {
|
|
1440
1515
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-6",
|
|
1441
|
-
children: [/* @__PURE__ */
|
|
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__ */
|
|
1519
|
+
}), /* @__PURE__ */ p("div", {
|
|
1445
1520
|
className: "space-y-4",
|
|
1446
|
-
children:
|
|
1521
|
+
children: pr.map((e, n) => /* @__PURE__ */ m("div", {
|
|
1447
1522
|
className: "flex gap-3",
|
|
1448
|
-
children: [/* @__PURE__ */
|
|
1523
|
+
children: [/* @__PURE__ */ m("div", {
|
|
1449
1524
|
className: "relative flex flex-col items-center",
|
|
1450
|
-
children: [/* @__PURE__ */
|
|
1451
|
-
}), /* @__PURE__ */
|
|
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__ */
|
|
1528
|
+
children: [/* @__PURE__ */ p("p", {
|
|
1454
1529
|
className: "text-sm text-text-primary",
|
|
1455
|
-
children:
|
|
1456
|
-
}), /* @__PURE__ */
|
|
1530
|
+
children: e.action
|
|
1531
|
+
}), /* @__PURE__ */ p("p", {
|
|
1457
1532
|
className: "text-xs text-text-secondary",
|
|
1458
|
-
children: e
|
|
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__ */
|
|
1468
|
-
open:
|
|
1469
|
-
onClose: () =>
|
|
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:
|
|
1546
|
+
description: d("healthybowl.crops.fieldDetail.editModal.description", "Update details for {{name}}", { name: E.name }),
|
|
1472
1547
|
size: "lg",
|
|
1473
|
-
footer: /* @__PURE__ */
|
|
1548
|
+
footer: /* @__PURE__ */ m(ht, { children: [/* @__PURE__ */ p(h, {
|
|
1474
1549
|
variant: "outline",
|
|
1475
|
-
onClick: () =>
|
|
1550
|
+
onClick: () => Bt(!1),
|
|
1476
1551
|
children: d("healthybowl.common.cancel", "Cancel")
|
|
1477
|
-
}), /* @__PURE__ */
|
|
1478
|
-
onClick:
|
|
1479
|
-
disabled:
|
|
1480
|
-
children:
|
|
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__ */
|
|
1557
|
+
children: /* @__PURE__ */ m("div", {
|
|
1483
1558
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
|
|
1484
1559
|
children: [
|
|
1485
|
-
/* @__PURE__ */
|
|
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__ */
|
|
1563
|
+
}), /* @__PURE__ */ p("input", {
|
|
1489
1564
|
type: "text",
|
|
1490
|
-
value:
|
|
1491
|
-
onChange: (e) =>
|
|
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__ */
|
|
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__ */
|
|
1572
|
+
}), /* @__PURE__ */ p("input", {
|
|
1498
1573
|
type: "number",
|
|
1499
1574
|
min: 0,
|
|
1500
|
-
value:
|
|
1501
|
-
onChange: (e) =>
|
|
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__ */
|
|
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__ */
|
|
1508
|
-
value:
|
|
1509
|
-
onValueChange: (e) =>
|
|
1510
|
-
children: [/* @__PURE__ */
|
|
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__ */
|
|
1513
|
-
}), /* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
1525
|
-
value:
|
|
1526
|
-
onValueChange:
|
|
1527
|
-
children: [/* @__PURE__ */
|
|
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__ */
|
|
1530
|
-
}), /* @__PURE__ */
|
|
1531
|
-
/* @__PURE__ */
|
|
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__ */
|
|
1610
|
+
/* @__PURE__ */ p(g, {
|
|
1536
1611
|
value: "preparation",
|
|
1537
1612
|
children: d("healthybowl.crops.fieldDetail.form.status.options.preparation", "Preparation")
|
|
1538
1613
|
}),
|
|
1539
|
-
/* @__PURE__ */
|
|
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__ */
|
|
1546
|
-
/* @__PURE__ */
|
|
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__ */
|
|
1551
|
-
value:
|
|
1552
|
-
onValueChange: (e) =>
|
|
1553
|
-
children: [/* @__PURE__ */
|
|
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__ */
|
|
1556
|
-
}), /* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
1640
|
+
/* @__PURE__ */ p("div", {
|
|
1566
1641
|
className: "mt-3",
|
|
1567
|
-
children: /* @__PURE__ */
|
|
1568
|
-
type:
|
|
1569
|
-
value:
|
|
1570
|
-
onChange:
|
|
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__ */
|
|
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__ */
|
|
1654
|
+
}), /* @__PURE__ */ p("input", {
|
|
1580
1655
|
type: "text",
|
|
1581
|
-
value:
|
|
1582
|
-
onChange: (e) =>
|
|
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__ */
|
|
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__ */
|
|
1663
|
+
}), /* @__PURE__ */ p("input", {
|
|
1589
1664
|
type: "text",
|
|
1590
|
-
value:
|
|
1591
|
-
onChange: (e) =>
|
|
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__ */
|
|
1669
|
+
/* @__PURE__ */ p("div", {
|
|
1595
1670
|
className: "sm:col-span-2",
|
|
1596
|
-
children: /* @__PURE__ */
|
|
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__ */
|
|
1673
|
+
children: [/* @__PURE__ */ p("input", {
|
|
1599
1674
|
type: "checkbox",
|
|
1600
|
-
checked:
|
|
1601
|
-
onChange: (e) =>
|
|
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__ */
|
|
1610
|
-
toasts:
|
|
1611
|
-
onDismiss:
|
|
1684
|
+
/* @__PURE__ */ p(le, {
|
|
1685
|
+
toasts: Lt,
|
|
1686
|
+
onDismiss: Rt
|
|
1612
1687
|
})
|
|
1613
1688
|
]
|
|
1614
|
-
}) : /* @__PURE__ */
|
|
1689
|
+
}) : /* @__PURE__ */ p(i, {
|
|
1615
1690
|
title: d("healthybowl.crops.fieldDetail.notFound.pageTitle", "Field Not Found"),
|
|
1616
|
-
children:
|
|
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__ */
|
|
1620
|
-
onClick: () =>
|
|
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
|
-
},
|
|
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__ */
|
|
1703
|
+
}), /* @__PURE__ */ m("div", {
|
|
1629
1704
|
className: "relative mt-1",
|
|
1630
|
-
children: [/* @__PURE__ */
|
|
1705
|
+
children: [/* @__PURE__ */ p("input", {
|
|
1631
1706
|
type: "number",
|
|
1632
1707
|
value: n,
|
|
1633
1708
|
min: r,
|
|
1634
1709
|
step: i,
|
|
1635
|
-
onChange: (e) =>
|
|
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__ */
|
|
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
|
-
})] }),
|
|
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__ */
|
|
1718
|
+
children: [/* @__PURE__ */ p("span", {
|
|
1644
1719
|
className: "block text-xs leading-tight text-text-secondary",
|
|
1645
1720
|
children: e
|
|
1646
|
-
}), /* @__PURE__ */
|
|
1721
|
+
}), /* @__PURE__ */ m("p", {
|
|
1647
1722
|
className: "mt-auto pt-1 text-lg font-semibold text-text-primary",
|
|
1648
|
-
children: [t, n && /* @__PURE__ */
|
|
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
|
-
}),
|
|
1654
|
-
let
|
|
1655
|
-
return /* @__PURE__ */
|
|
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":
|
|
1658
|
-
className: `whitespace-nowrap px-3 py-2 text-xs font-medium ${
|
|
1659
|
-
children: /* @__PURE__ */
|
|
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)] ${
|
|
1663
|
-
children: [e,
|
|
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 {
|
|
1746
|
+
export { Dt as FieldDetailsPage };
|
|
1672
1747
|
|
|
1673
1748
|
//# sourceMappingURL=FieldDetailsPage.js.map
|