@burdenoff/microfe-healthybowl 2026.813.21 → 2026.813.23
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/generated/wspace-operations.js +6 -0
- package/dist/generated/wspace-operations.js.map +1 -1
- package/dist/generated/wspace-types.js.map +1 -1
- package/dist/healthybowl/components/GrowGeometryInputs.js +109 -0
- package/dist/healthybowl/components/GrowGeometryInputs.js.map +1 -0
- package/dist/healthybowl/hooks/useHealthyBowlData.js +1 -0
- package/dist/healthybowl/hooks/useHealthyBowlData.js.map +1 -1
- package/dist/healthybowl/pages/crops/CropFieldsPage.js +63 -51
- package/dist/healthybowl/pages/crops/CropFieldsPage.js.map +1 -1
- package/dist/healthybowl/pages/crops/CropPlanningPage.js +517 -432
- package/dist/healthybowl/pages/crops/CropPlanningPage.js.map +1 -1
- package/dist/healthybowl/pages/crops/FieldDetailsPage.js +813 -751
- package/dist/healthybowl/pages/crops/FieldDetailsPage.js.map +1 -1
- package/dist/healthybowl/pages/farm/FarmProfilePage.js +242 -143
- package/dist/healthybowl/pages/farm/FarmProfilePage.js.map +1 -1
- package/dist/healthybowl/pages/field-capture/CaptureObservationForm.js +8 -8
- package/dist/healthybowl/pages/fields/FieldMapPage.js +549 -536
- package/dist/healthybowl/pages/fields/FieldMapPage.js.map +1 -1
- package/dist/healthybowl/utils/farmCoordinates.js +17 -0
- package/dist/healthybowl/utils/farmCoordinates.js.map +1 -0
- package/dist/healthybowl/utils/growLocationType.js +19 -8
- package/dist/healthybowl/utils/growLocationType.js.map +1 -1
- package/dist/healthybowl/utils/plantingCapacity.js +73 -17
- package/dist/healthybowl/utils/plantingCapacity.js.map +1 -1
- package/package.json +1 -1
|
@@ -6,22 +6,22 @@ import { StatusBadge as a } from "../../components/StatusBadge.js";
|
|
|
6
6
|
import { EmptyState as o } from "../../components/EmptyState.js";
|
|
7
7
|
import { ErrorState as s } from "../../components/ErrorState.js";
|
|
8
8
|
import { ToastContainer as c } from "../../components/Toast.js";
|
|
9
|
-
import { Breadcrumbs as
|
|
10
|
-
import { PageLoader as
|
|
11
|
-
import { Modal as
|
|
12
|
-
import { useToast as
|
|
9
|
+
import { Breadcrumbs as l } from "../../components/Breadcrumbs.js";
|
|
10
|
+
import { PageLoader as u } from "../../components/PageLoader.js";
|
|
11
|
+
import { Modal as ee } from "../../components/Modal.js";
|
|
12
|
+
import { useToast as te } from "../../hooks/useToast.js";
|
|
13
13
|
import "../../components/index.js";
|
|
14
|
-
import { useHealthyBowlData as
|
|
15
|
-
import { BED_GEOMETRY_NOTICE as
|
|
16
|
-
import { DEFAULT_BED_WIDTH_M as
|
|
17
|
-
import { useEffect as ae, useMemo as
|
|
14
|
+
import { useHealthyBowlData as d } from "../../hooks/useHealthyBowlData.js";
|
|
15
|
+
import { BED_GEOMETRY_NOTICE as f, BED_GEOMETRY_NOTICE_SHORT as p, GROW_GEOMETRY_PROMPT as m, capacityModelFor as h, growLocationTypeLabel as g, usesBedGeometry as _ } from "../../utils/growLocationType.js";
|
|
16
|
+
import { DEFAULT_BED_WIDTH_M as v, DEFAULT_CROP_SPACING_PRESET as ne, DEFAULT_PATH_WIDTH_M as y, estimateGrowCapacity as re, estimatePlantingCapacity as ie, getCropSpacingPreset as b } from "../../utils/plantingCapacity.js";
|
|
17
|
+
import { useEffect as ae, useMemo as x, useState as S } from "react";
|
|
18
18
|
import { useI18n as oe } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
19
|
-
import { ArrowRight as
|
|
19
|
+
import { ArrowRight as C, Beaker as w, Calendar as se, ClipboardList as ce, MapPin as le, Plus as ue, Search as de, Sprout as fe, Target as pe } from "lucide-react";
|
|
20
20
|
import { useNavigate as me } from "react-router";
|
|
21
|
-
import { Fragment as he, jsx as
|
|
22
|
-
import { Button as
|
|
21
|
+
import { Fragment as he, jsx as T, jsxs as E } from "react/jsx-runtime";
|
|
22
|
+
import { Button as D, Select as O, SelectContent as k, SelectItem as A, SelectTrigger as j, SelectValue as M } from "@burdenoff/fe-libs/ui";
|
|
23
23
|
//#region src/healthybowl/pages/crops/CropPlanningPage.tsx
|
|
24
|
-
var
|
|
24
|
+
var N = (e) => {
|
|
25
25
|
switch (e) {
|
|
26
26
|
case "active": return "success";
|
|
27
27
|
case "approved": return "info";
|
|
@@ -49,670 +49,728 @@ var A = (e) => {
|
|
|
49
49
|
case "perennial": return t("healthybowl.crops.planning.season.perennial", "Perennial");
|
|
50
50
|
default: return e;
|
|
51
51
|
}
|
|
52
|
-
},
|
|
52
|
+
}, P = (e) => (e ?? "").trim().toLowerCase(), ye = (e, t) => t.find((t) => e.fieldId ? t.id === e.fieldId : P(t.name) === P(e.fieldName)), F = (e, t) => t.find((t) => t.id === e.field || P(t.name) === P(e.fieldName)), be = (e, t) => e.cropId ? e.cropId === t.id : P(e.cropName) === P(t.name), I = (e, t) => {
|
|
53
53
|
let n = Number(e);
|
|
54
54
|
return Number.isFinite(n) && n > 0 ? n : t;
|
|
55
|
-
},
|
|
55
|
+
}, xe = (e, t) => {
|
|
56
56
|
let n = Number(e);
|
|
57
57
|
return Number.isFinite(n) && n >= 0 ? n : t;
|
|
58
|
-
},
|
|
59
|
-
if (!t || !
|
|
60
|
-
let n =
|
|
58
|
+
}, Se = (e, t = 1) => new Intl.NumberFormat("en-US", { maximumFractionDigits: t }).format(e), Ce = (e, t) => {
|
|
59
|
+
if (!t || !_(t.type)) return null;
|
|
60
|
+
let n = b(e);
|
|
61
61
|
return ie({
|
|
62
62
|
fieldArea: t.area,
|
|
63
63
|
fieldUnit: t.unit,
|
|
64
|
-
bedWidthM:
|
|
65
|
-
pathWidthM:
|
|
64
|
+
bedWidthM: v,
|
|
65
|
+
pathWidthM: y,
|
|
66
66
|
plantSpacingCm: n.plantSpacingCm,
|
|
67
67
|
rowSpacingCm: n.rowSpacingCm
|
|
68
68
|
});
|
|
69
|
-
},
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
plantSpacingCm:
|
|
78
|
-
rowSpacingCm:
|
|
69
|
+
}, we = (e, t) => {
|
|
70
|
+
if (!t) return null;
|
|
71
|
+
let n = b(e);
|
|
72
|
+
return re({
|
|
73
|
+
type: t.type,
|
|
74
|
+
geometry: t.growGeometry,
|
|
75
|
+
fieldArea: t.area,
|
|
76
|
+
fieldUnit: t.unit,
|
|
77
|
+
plantSpacingCm: n.plantSpacingCm,
|
|
78
|
+
rowSpacingCm: n.rowSpacingCm
|
|
79
|
+
});
|
|
80
|
+
}, L = () => {
|
|
81
|
+
let { plantingPlans: e, fields: C, crops: w, errors: se, loadings: N, createPlantingPlan: ge, refetch: _e } = d(), { t: P } = oe(), L = me(), { buildPath: De } = n(), { toasts: Oe, toast: ke, dismiss: Ae } = te(), [je, Me] = S(""), [Ne, Pe] = S("all"), [Fe, Ie] = S("all"), [Le, B] = S(!1), [V, Re] = S(""), [H, ze] = S(""), [Be, Ve] = S("kharif"), [He, Ue] = S("low"), [We, Ge] = S(""), [Ke, qe] = S(""), [Je, Ye] = S(""), [Xe, Ze] = S(""), [U, Qe] = S(""), [W, $e] = S(""), [G, et] = S(String(ne.plantSpacingCm)), [K, tt] = S(String(ne.rowSpacingCm)), [nt, rt] = S(String(v)), [it, at] = S(String(y)), ot = () => {
|
|
82
|
+
Re(""), ze(""), Ve("kharif"), Ue("low"), Ge(""), qe(""), Ye(""), Ze("");
|
|
83
|
+
}, st = x(() => w.find((e) => e.id === U) ?? null, [U, w]), q = x(() => C.find((e) => e.id === W) ?? null, [W, C]), J = x(() => b(st), [st]), Y = _(q?.type), X = x(() => !q || !_(q.type) ? null : ie({
|
|
84
|
+
fieldArea: q.area,
|
|
85
|
+
fieldUnit: q.unit,
|
|
86
|
+
bedWidthM: I(nt, v),
|
|
87
|
+
pathWidthM: xe(it, y),
|
|
88
|
+
plantSpacingCm: I(G, J.plantSpacingCm),
|
|
89
|
+
rowSpacingCm: I(K, J.rowSpacingCm)
|
|
79
90
|
}), [
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
]),
|
|
87
|
-
|
|
88
|
-
|
|
91
|
+
nt,
|
|
92
|
+
it,
|
|
93
|
+
G,
|
|
94
|
+
K,
|
|
95
|
+
q,
|
|
96
|
+
J
|
|
97
|
+
]), Z = x(() => !q || !st ? null : re({
|
|
98
|
+
type: q.type,
|
|
99
|
+
geometry: q.growGeometry,
|
|
100
|
+
fieldArea: q.area,
|
|
101
|
+
fieldUnit: q.unit,
|
|
102
|
+
plantSpacingCm: I(G, J.plantSpacingCm),
|
|
103
|
+
rowSpacingCm: I(K, J.rowSpacingCm)
|
|
104
|
+
}), [
|
|
105
|
+
q,
|
|
106
|
+
st,
|
|
107
|
+
G,
|
|
108
|
+
K,
|
|
109
|
+
J
|
|
110
|
+
]), ct = x(() => w.find((e) => e.id === V) ?? null, [w, V]), Q = x(() => C.find((e) => e.id === H) ?? null, [C, H]), lt = _(Q?.type), $ = x(() => {
|
|
111
|
+
if (!ct || !Q || !_(Q.type)) return null;
|
|
112
|
+
let e = b(ct);
|
|
89
113
|
return ie({
|
|
90
114
|
fieldArea: Q.area,
|
|
91
115
|
fieldUnit: Q.unit,
|
|
92
|
-
bedWidthM:
|
|
93
|
-
pathWidthM:
|
|
116
|
+
bedWidthM: v,
|
|
117
|
+
pathWidthM: y,
|
|
94
118
|
plantSpacingCm: e.plantSpacingCm,
|
|
95
119
|
rowSpacingCm: e.rowSpacingCm
|
|
96
120
|
});
|
|
97
|
-
}, [
|
|
121
|
+
}, [ct, Q]);
|
|
98
122
|
ae(() => {
|
|
99
|
-
if (
|
|
100
|
-
let e =
|
|
101
|
-
|
|
123
|
+
if (U || w.length === 0) return;
|
|
124
|
+
let e = w[0], t = b(e), n = F(e, C);
|
|
125
|
+
Qe(e.id), et(String(t.plantSpacingCm)), tt(String(t.rowSpacingCm)), n && $e(n.id);
|
|
102
126
|
}, [
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
127
|
+
U,
|
|
128
|
+
w,
|
|
129
|
+
C
|
|
106
130
|
]), ae(() => {
|
|
107
|
-
|
|
108
|
-
}, [
|
|
109
|
-
let
|
|
110
|
-
let t = (e.cropName ?? "").toLowerCase().includes(
|
|
131
|
+
W || C.length === 0 || $e(C[0].id);
|
|
132
|
+
}, [W, C]);
|
|
133
|
+
let ut = e.filter((e) => {
|
|
134
|
+
let t = (e.cropName ?? "").toLowerCase().includes(je.toLowerCase()) || (e.fieldName ?? "").toLowerCase().includes(je.toLowerCase()), n = Ne === "all" || e.status === Ne, r = Fe === "all" || e.season === Fe;
|
|
111
135
|
return t && n && r;
|
|
112
|
-
}),
|
|
113
|
-
let n = ye(t,
|
|
136
|
+
}), dt = e.length, ft = e.reduce((e, t) => e + t.expectedYield, 0), pt = e.filter((e) => e.status === "active" || e.status === "approved").length, mt = [...new Set(e.map((e) => e.season))], ht = [...new Set(e.map((e) => e.status))], gt = e.reduce((e, t) => {
|
|
137
|
+
let n = ye(t, C);
|
|
114
138
|
return e + (n ? n.area : 0);
|
|
115
|
-
}, 0),
|
|
116
|
-
let n = e.filter((e) => be(e, t)), r =
|
|
139
|
+
}, 0), _t = w.map((t) => {
|
|
140
|
+
let n = e.filter((e) => be(e, t)), r = F(t, C);
|
|
117
141
|
return {
|
|
118
142
|
crop: t,
|
|
119
143
|
plans: n,
|
|
120
144
|
activePlan: n.find((e) => e.status !== "completed") ?? n[0],
|
|
121
|
-
capacityEstimate:
|
|
122
|
-
|
|
145
|
+
capacityEstimate: Ce(t, r),
|
|
146
|
+
growCapacityEstimate: we(t, r),
|
|
147
|
+
capacityNotApplicableFor: r && !_(r.type) && h(r.type) === "NONE" ? r : null,
|
|
148
|
+
awaitingGeometryFor: r && !_(r.type) && h(r.type) !== "NONE" && we(t, r) === null ? r : null
|
|
123
149
|
};
|
|
124
|
-
}),
|
|
125
|
-
let t =
|
|
126
|
-
if (
|
|
127
|
-
let n =
|
|
128
|
-
|
|
129
|
-
},
|
|
130
|
-
let t =
|
|
131
|
-
if (
|
|
132
|
-
let n =
|
|
133
|
-
|
|
134
|
-
},
|
|
135
|
-
let t =
|
|
136
|
-
|
|
150
|
+
}), vt = _t.filter((e) => e.plans.length > 0).length, yt = (e) => {
|
|
151
|
+
let t = w.find((t) => t.id === e);
|
|
152
|
+
if (Qe(e), !t) return;
|
|
153
|
+
let n = b(t), r = F(t, C);
|
|
154
|
+
et(String(n.plantSpacingCm)), tt(String(n.rowSpacingCm)), r && $e(r.id);
|
|
155
|
+
}, bt = (e) => {
|
|
156
|
+
let t = w.find((t) => t.id === e);
|
|
157
|
+
if (Re(e), !t) return;
|
|
158
|
+
let n = F(t, C);
|
|
159
|
+
Ve(t.season), n && ze(n.id);
|
|
160
|
+
}, xt = (e) => {
|
|
161
|
+
let t = F(e, C);
|
|
162
|
+
Re(e.id), ze(t?.id ?? ""), Ve(e.season), Ge(e.plantingDate || ""), qe(e.expectedHarvestDate || ""), Ye(e.yieldEstimate ? String(e.yieldEstimate) : ""), Ze(""), B(!0);
|
|
137
163
|
};
|
|
138
|
-
return /* @__PURE__ */
|
|
139
|
-
title:
|
|
140
|
-
description:
|
|
164
|
+
return /* @__PURE__ */ E(r, {
|
|
165
|
+
title: P("healthybowl.crops.planning.title", "Crop Planning"),
|
|
166
|
+
description: P("healthybowl.crops.planning.subtitle", "Manage planting plans and schedules"),
|
|
141
167
|
purpose: "Decide what to plant where and when, before the season starts. A good plan helps you rotate crops, stagger planting for steady harvests, and make sure every field is working toward your goals.",
|
|
142
|
-
actions: /* @__PURE__ */
|
|
143
|
-
onClick: () =>
|
|
168
|
+
actions: /* @__PURE__ */ E(D, {
|
|
169
|
+
onClick: () => B(!0),
|
|
144
170
|
children: [
|
|
145
|
-
/* @__PURE__ */
|
|
171
|
+
/* @__PURE__ */ T(ue, { className: "h-4 w-4" }),
|
|
146
172
|
" ",
|
|
147
|
-
|
|
173
|
+
P("healthybowl.crops.planning.actions.addPlan", "Add New Plan")
|
|
148
174
|
]
|
|
149
175
|
}),
|
|
150
176
|
children: [
|
|
151
|
-
/* @__PURE__ */
|
|
152
|
-
label:
|
|
153
|
-
href:
|
|
154
|
-
}, { label:
|
|
155
|
-
/* @__PURE__ */
|
|
177
|
+
/* @__PURE__ */ T(l, { items: [{
|
|
178
|
+
label: P("healthybowl.crops.planning.breadcrumbs.crops", "Crops"),
|
|
179
|
+
href: De("crops")
|
|
180
|
+
}, { label: P("healthybowl.crops.planning.breadcrumbs.planning", "Planning") }] }),
|
|
181
|
+
/* @__PURE__ */ E("div", {
|
|
156
182
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4",
|
|
157
183
|
children: [
|
|
158
|
-
/* @__PURE__ */
|
|
184
|
+
/* @__PURE__ */ T(i, {
|
|
159
185
|
hero: !0,
|
|
160
|
-
label:
|
|
161
|
-
value: ot,
|
|
162
|
-
icon: /* @__PURE__ */ S(ce, { className: "h-5 w-5" })
|
|
163
|
-
}),
|
|
164
|
-
/* @__PURE__ */ S(i, {
|
|
165
|
-
label: j("healthybowl.crops.planning.stats.plannedArea.label", "Planned Area"),
|
|
186
|
+
label: P("healthybowl.crops.planning.stats.totalPlans.label", "Total Plans"),
|
|
166
187
|
value: dt,
|
|
188
|
+
icon: /* @__PURE__ */ T(ce, { className: "h-5 w-5" })
|
|
189
|
+
}),
|
|
190
|
+
/* @__PURE__ */ T(i, {
|
|
191
|
+
label: P("healthybowl.crops.planning.stats.plannedArea.label", "Planned Area"),
|
|
192
|
+
value: gt,
|
|
167
193
|
unit: "acres",
|
|
168
|
-
icon: /* @__PURE__ */
|
|
194
|
+
icon: /* @__PURE__ */ T(le, { className: "h-5 w-5" })
|
|
169
195
|
}),
|
|
170
|
-
/* @__PURE__ */
|
|
171
|
-
label:
|
|
172
|
-
value:
|
|
196
|
+
/* @__PURE__ */ T(i, {
|
|
197
|
+
label: P("healthybowl.crops.planning.stats.expectedYield.label", "Expected Yield"),
|
|
198
|
+
value: ft,
|
|
173
199
|
unit: "kg",
|
|
174
|
-
icon: /* @__PURE__ */
|
|
200
|
+
icon: /* @__PURE__ */ T(pe, { className: "h-5 w-5" })
|
|
175
201
|
}),
|
|
176
|
-
/* @__PURE__ */
|
|
177
|
-
label:
|
|
178
|
-
value:
|
|
179
|
-
icon: /* @__PURE__ */
|
|
202
|
+
/* @__PURE__ */ T(i, {
|
|
203
|
+
label: P("healthybowl.crops.planning.stats.activePlans.label", "Active Plans"),
|
|
204
|
+
value: pt,
|
|
205
|
+
icon: /* @__PURE__ */ T(fe, { className: "h-5 w-5" })
|
|
180
206
|
})
|
|
181
207
|
]
|
|
182
208
|
}),
|
|
183
|
-
/* @__PURE__ */
|
|
209
|
+
/* @__PURE__ */ E("div", {
|
|
184
210
|
className: "flex flex-col gap-3 sm:flex-row sm:items-center",
|
|
185
211
|
children: [
|
|
186
|
-
/* @__PURE__ */
|
|
212
|
+
/* @__PURE__ */ E("div", {
|
|
187
213
|
className: "relative flex-1",
|
|
188
|
-
children: [/* @__PURE__ */
|
|
214
|
+
children: [/* @__PURE__ */ T(de, { className: "absolute start-3 top-1/2 h-4 w-4 -translate-y-1/2 text-text-secondary" }), /* @__PURE__ */ T("input", {
|
|
189
215
|
type: "text",
|
|
190
|
-
value:
|
|
191
|
-
onChange: (e) =>
|
|
192
|
-
placeholder:
|
|
216
|
+
value: je,
|
|
217
|
+
onChange: (e) => Me(e.target.value),
|
|
218
|
+
placeholder: P("healthybowl.crops.planning.search.placeholder", "Search plans by crop or field..."),
|
|
193
219
|
className: "w-full rounded-md border border-border-subtle bg-bg-surface py-2 ps-10 pe-4 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
|
|
194
220
|
})]
|
|
195
221
|
}),
|
|
196
|
-
/* @__PURE__ */
|
|
197
|
-
value:
|
|
198
|
-
onValueChange:
|
|
199
|
-
children: [/* @__PURE__ */
|
|
222
|
+
/* @__PURE__ */ E(O, {
|
|
223
|
+
value: Ne,
|
|
224
|
+
onValueChange: Pe,
|
|
225
|
+
children: [/* @__PURE__ */ T(j, {
|
|
200
226
|
className: "h-9 w-auto",
|
|
201
|
-
children: /* @__PURE__ */
|
|
202
|
-
}), /* @__PURE__ */
|
|
227
|
+
children: /* @__PURE__ */ T(M, { placeholder: P("healthybowl.crops.planning.filters.allStatuses", "All Statuses") })
|
|
228
|
+
}), /* @__PURE__ */ E(k, { children: [/* @__PURE__ */ T(A, {
|
|
203
229
|
value: "all",
|
|
204
|
-
children:
|
|
205
|
-
}),
|
|
230
|
+
children: P("healthybowl.crops.planning.filters.allStatuses", "All Statuses")
|
|
231
|
+
}), ht.map((e) => /* @__PURE__ */ T(A, {
|
|
206
232
|
value: e,
|
|
207
233
|
children: (e ?? "").charAt(0).toUpperCase() + (e ?? "").slice(1)
|
|
208
234
|
}, e))] })]
|
|
209
235
|
}),
|
|
210
|
-
/* @__PURE__ */
|
|
211
|
-
value:
|
|
212
|
-
onValueChange:
|
|
213
|
-
children: [/* @__PURE__ */
|
|
236
|
+
/* @__PURE__ */ E(O, {
|
|
237
|
+
value: Fe,
|
|
238
|
+
onValueChange: Ie,
|
|
239
|
+
children: [/* @__PURE__ */ T(j, {
|
|
214
240
|
className: "h-9 w-auto",
|
|
215
|
-
children: /* @__PURE__ */
|
|
216
|
-
}), /* @__PURE__ */
|
|
241
|
+
children: /* @__PURE__ */ T(M, { placeholder: P("healthybowl.crops.planning.filters.allSeasons", "All Seasons") })
|
|
242
|
+
}), /* @__PURE__ */ E(k, { children: [/* @__PURE__ */ T(A, {
|
|
217
243
|
value: "all",
|
|
218
|
-
children:
|
|
219
|
-
}),
|
|
244
|
+
children: P("healthybowl.crops.planning.filters.allSeasons", "All Seasons")
|
|
245
|
+
}), mt.map((e) => /* @__PURE__ */ T(A, {
|
|
220
246
|
value: e,
|
|
221
|
-
children: ve(e,
|
|
247
|
+
children: ve(e, P)
|
|
222
248
|
}, e))] })]
|
|
223
249
|
})
|
|
224
250
|
]
|
|
225
251
|
}),
|
|
226
|
-
/* @__PURE__ */
|
|
252
|
+
/* @__PURE__ */ E("div", {
|
|
227
253
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-4 shadow-sm",
|
|
228
254
|
children: [
|
|
229
|
-
/* @__PURE__ */
|
|
255
|
+
/* @__PURE__ */ E("div", {
|
|
230
256
|
className: "flex flex-wrap items-center justify-between gap-3",
|
|
231
|
-
children: [/* @__PURE__ */
|
|
257
|
+
children: [/* @__PURE__ */ T("h2", {
|
|
232
258
|
className: "text-sm font-semibold text-text-primary",
|
|
233
|
-
children:
|
|
234
|
-
}), /* @__PURE__ */
|
|
235
|
-
label:
|
|
259
|
+
children: P("healthybowl.crops.planning.capacity.title", "Planting capacity")
|
|
260
|
+
}), /* @__PURE__ */ T(a, {
|
|
261
|
+
label: Y ? J.label : g(P, q?.type),
|
|
236
262
|
variant: "muted"
|
|
237
263
|
})]
|
|
238
264
|
}),
|
|
239
|
-
/* @__PURE__ */
|
|
265
|
+
/* @__PURE__ */ E("div", {
|
|
240
266
|
className: "mt-4 grid gap-3 md:grid-cols-2 xl:grid-cols-6",
|
|
241
267
|
children: [
|
|
242
|
-
/* @__PURE__ */
|
|
268
|
+
/* @__PURE__ */ E("div", {
|
|
243
269
|
className: "xl:col-span-2",
|
|
244
|
-
children: [/* @__PURE__ */
|
|
270
|
+
children: [/* @__PURE__ */ T("label", {
|
|
245
271
|
className: "text-xs font-medium text-text-secondary",
|
|
246
|
-
children:
|
|
247
|
-
}), /* @__PURE__ */
|
|
248
|
-
value:
|
|
249
|
-
onValueChange:
|
|
250
|
-
children: [/* @__PURE__ */
|
|
272
|
+
children: P("healthybowl.crops.planning.capacity.crop", "Crop")
|
|
273
|
+
}), /* @__PURE__ */ E(O, {
|
|
274
|
+
value: U,
|
|
275
|
+
onValueChange: yt,
|
|
276
|
+
children: [/* @__PURE__ */ T(j, {
|
|
251
277
|
className: "mt-1 w-full",
|
|
252
|
-
children: /* @__PURE__ */
|
|
253
|
-
}), /* @__PURE__ */
|
|
278
|
+
children: /* @__PURE__ */ T(M, { placeholder: P("healthybowl.crops.planning.capacity.cropPlaceholder", "Select crop") })
|
|
279
|
+
}), /* @__PURE__ */ T(k, { children: w.map((e) => /* @__PURE__ */ T(A, {
|
|
254
280
|
value: e.id,
|
|
255
281
|
children: e.variety ? `${e.name} - ${e.variety}` : e.name
|
|
256
282
|
}, e.id)) })]
|
|
257
283
|
})]
|
|
258
284
|
}),
|
|
259
|
-
/* @__PURE__ */
|
|
285
|
+
/* @__PURE__ */ E("div", {
|
|
260
286
|
className: "xl:col-span-2",
|
|
261
|
-
children: [/* @__PURE__ */
|
|
287
|
+
children: [/* @__PURE__ */ T("label", {
|
|
262
288
|
className: "text-xs font-medium text-text-secondary",
|
|
263
|
-
children:
|
|
264
|
-
}), /* @__PURE__ */
|
|
265
|
-
value:
|
|
266
|
-
onValueChange:
|
|
267
|
-
children: [/* @__PURE__ */
|
|
289
|
+
children: P("healthybowl.crops.planning.capacity.field", "Field")
|
|
290
|
+
}), /* @__PURE__ */ E(O, {
|
|
291
|
+
value: W,
|
|
292
|
+
onValueChange: $e,
|
|
293
|
+
children: [/* @__PURE__ */ T(j, {
|
|
268
294
|
className: "mt-1 w-full",
|
|
269
|
-
children: /* @__PURE__ */
|
|
270
|
-
}), /* @__PURE__ */
|
|
295
|
+
children: /* @__PURE__ */ T(M, { placeholder: P("healthybowl.crops.planning.capacity.fieldPlaceholder", "Select field") })
|
|
296
|
+
}), /* @__PURE__ */ T(k, { children: C.map((e) => /* @__PURE__ */ T(A, {
|
|
271
297
|
value: e.id,
|
|
272
|
-
children: `${e.name} · ${
|
|
298
|
+
children: `${e.name} · ${g(P, e.type)}`
|
|
273
299
|
}, e.id)) })]
|
|
274
300
|
})]
|
|
275
301
|
}),
|
|
276
|
-
|
|
277
|
-
/* @__PURE__ */
|
|
278
|
-
label:
|
|
302
|
+
(Y || q != null && h(q.type) !== "NONE") && /* @__PURE__ */ E(he, { children: [
|
|
303
|
+
/* @__PURE__ */ T(R, {
|
|
304
|
+
label: P("healthybowl.crops.planning.capacity.plantSpacing", "Plant spacing"),
|
|
279
305
|
unit: "cm",
|
|
280
|
-
value:
|
|
306
|
+
value: G,
|
|
281
307
|
min: "1",
|
|
282
308
|
step: "1",
|
|
283
|
-
onChange:
|
|
309
|
+
onChange: et
|
|
284
310
|
}),
|
|
285
|
-
/* @__PURE__ */
|
|
286
|
-
label:
|
|
311
|
+
/* @__PURE__ */ T(R, {
|
|
312
|
+
label: P("healthybowl.crops.planning.capacity.rowSpacing", "Row spacing"),
|
|
287
313
|
unit: "cm",
|
|
288
|
-
value:
|
|
314
|
+
value: K,
|
|
289
315
|
min: "1",
|
|
290
316
|
step: "1",
|
|
291
|
-
onChange:
|
|
317
|
+
onChange: tt
|
|
292
318
|
}),
|
|
293
|
-
/* @__PURE__ */
|
|
294
|
-
label:
|
|
319
|
+
Y && /* @__PURE__ */ E(he, { children: [/* @__PURE__ */ T(R, {
|
|
320
|
+
label: P("healthybowl.crops.planning.capacity.bedWidth", "Bed width"),
|
|
295
321
|
unit: "m",
|
|
296
|
-
value:
|
|
322
|
+
value: nt,
|
|
297
323
|
min: "0.1",
|
|
298
324
|
step: "0.1",
|
|
299
|
-
onChange:
|
|
300
|
-
}),
|
|
301
|
-
|
|
302
|
-
label: j("healthybowl.crops.planning.capacity.pathWidth", "Path width"),
|
|
325
|
+
onChange: rt
|
|
326
|
+
}), /* @__PURE__ */ T(R, {
|
|
327
|
+
label: P("healthybowl.crops.planning.capacity.pathWidth", "Path width"),
|
|
303
328
|
unit: "m",
|
|
304
|
-
value:
|
|
329
|
+
value: it,
|
|
305
330
|
min: "0",
|
|
306
331
|
step: "0.05",
|
|
307
|
-
onChange:
|
|
308
|
-
})
|
|
332
|
+
onChange: at
|
|
333
|
+
})] })
|
|
309
334
|
] })
|
|
310
335
|
]
|
|
311
336
|
}),
|
|
312
|
-
|
|
337
|
+
Z ? /* @__PURE__ */ E("div", {
|
|
338
|
+
className: "mt-4 grid grid-cols-2 gap-3 md:grid-cols-3 xl:grid-cols-5",
|
|
339
|
+
"data-testid": "planning-grow-capacity",
|
|
340
|
+
"data-model": Z.model,
|
|
341
|
+
children: [
|
|
342
|
+
/* @__PURE__ */ T(z, {
|
|
343
|
+
label: Z.model === "TREE" ? P("healthybowl.crops.planning.capacity.metrics.block", "Block") : Z.model === "RACK" ? P("healthybowl.crops.planning.capacity.metrics.racks", "Racks") : P("healthybowl.crops.planning.capacity.metrics.benches", "Benches"),
|
|
344
|
+
value: t(Z.unitCount)
|
|
345
|
+
}),
|
|
346
|
+
/* @__PURE__ */ T(z, {
|
|
347
|
+
label: P("healthybowl.crops.planning.capacity.metrics.plantsPerUnit", "Plants / unit"),
|
|
348
|
+
value: t(Z.plantsPerUnit)
|
|
349
|
+
}),
|
|
350
|
+
/* @__PURE__ */ T(z, {
|
|
351
|
+
label: Z.model === "TREE" ? P("healthybowl.crops.planning.capacity.metrics.totalTrees", "Total trees") : P("healthybowl.crops.planning.capacity.metrics.totalPlants", "Total plants"),
|
|
352
|
+
value: t(Z.totalPlants)
|
|
353
|
+
}),
|
|
354
|
+
Z.seedlingTarget != null && /* @__PURE__ */ T(z, {
|
|
355
|
+
label: P("healthybowl.crops.planning.capacity.metrics.seedlings", "Seedlings"),
|
|
356
|
+
value: t(Z.seedlingTarget)
|
|
357
|
+
}),
|
|
358
|
+
/* @__PURE__ */ T(z, {
|
|
359
|
+
label: P("healthybowl.crops.planning.capacity.metrics.growingArea", "Growing area"),
|
|
360
|
+
value: Se(Z.usableAreaSqm, 1),
|
|
361
|
+
unit: "m²"
|
|
362
|
+
})
|
|
363
|
+
]
|
|
364
|
+
}) : q && !Y && h(q.type) !== "NONE" ? /* @__PURE__ */ T("p", {
|
|
313
365
|
className: "mt-4 rounded-md border border-border-subtle bg-bg-sunken/60 p-3 text-sm text-text-secondary",
|
|
314
|
-
|
|
315
|
-
|
|
366
|
+
"data-testid": "planning-grow-geometry-prompt",
|
|
367
|
+
children: P(m.key, m.defaultValue, { type: g(P, q.type) })
|
|
368
|
+
}) : !Y && q ? /* @__PURE__ */ T("p", {
|
|
369
|
+
className: "mt-4 rounded-md border border-border-subtle bg-bg-sunken/60 p-3 text-sm text-text-secondary",
|
|
370
|
+
children: P(f.key, f.defaultValue, { type: g(P, q.type) })
|
|
371
|
+
}) : X ? /* @__PURE__ */ E("div", {
|
|
316
372
|
className: "mt-4 grid grid-cols-2 gap-3 md:grid-cols-3 xl:grid-cols-6",
|
|
317
373
|
children: [
|
|
318
|
-
/* @__PURE__ */
|
|
319
|
-
label:
|
|
320
|
-
value: t(
|
|
374
|
+
/* @__PURE__ */ T(z, {
|
|
375
|
+
label: P("healthybowl.crops.planning.capacity.metrics.beds", "Beds"),
|
|
376
|
+
value: t(X.bedCount)
|
|
321
377
|
}),
|
|
322
|
-
/* @__PURE__ */
|
|
323
|
-
label:
|
|
324
|
-
value: t(
|
|
378
|
+
/* @__PURE__ */ T(z, {
|
|
379
|
+
label: P("healthybowl.crops.planning.capacity.metrics.rowsPerBed", "Rows / bed"),
|
|
380
|
+
value: t(X.rowsPerBed)
|
|
325
381
|
}),
|
|
326
|
-
/* @__PURE__ */
|
|
327
|
-
label:
|
|
328
|
-
value: t(
|
|
382
|
+
/* @__PURE__ */ T(z, {
|
|
383
|
+
label: P("healthybowl.crops.planning.capacity.metrics.plantsPerBed", "Plants / bed"),
|
|
384
|
+
value: t(X.plantsPerBed)
|
|
329
385
|
}),
|
|
330
|
-
/* @__PURE__ */
|
|
331
|
-
label:
|
|
332
|
-
value: t(
|
|
386
|
+
/* @__PURE__ */ T(z, {
|
|
387
|
+
label: P("healthybowl.crops.planning.capacity.metrics.totalPlants", "Total plants"),
|
|
388
|
+
value: t(X.totalPlants)
|
|
333
389
|
}),
|
|
334
|
-
/* @__PURE__ */
|
|
335
|
-
label:
|
|
336
|
-
value: t(
|
|
390
|
+
/* @__PURE__ */ T(z, {
|
|
391
|
+
label: P("healthybowl.crops.planning.capacity.metrics.seedlings", "Seedlings"),
|
|
392
|
+
value: t(X.seedlingTarget)
|
|
337
393
|
}),
|
|
338
|
-
/* @__PURE__ */
|
|
339
|
-
label:
|
|
340
|
-
value:
|
|
394
|
+
/* @__PURE__ */ T(z, {
|
|
395
|
+
label: P("healthybowl.crops.planning.capacity.metrics.bedLength", "Bed length"),
|
|
396
|
+
value: Se(X.bedLengthM),
|
|
341
397
|
unit: "m"
|
|
342
398
|
})
|
|
343
399
|
]
|
|
344
|
-
}) : /* @__PURE__ */
|
|
400
|
+
}) : /* @__PURE__ */ T("p", {
|
|
345
401
|
className: "mt-4 rounded-md border border-border-subtle bg-bg-sunken/60 p-3 text-sm text-text-secondary",
|
|
346
|
-
children:
|
|
402
|
+
children: P("healthybowl.crops.planning.capacity.empty", "Select a crop and field to calculate beds and plants.")
|
|
347
403
|
})
|
|
348
404
|
]
|
|
349
405
|
}),
|
|
350
|
-
/* @__PURE__ */
|
|
406
|
+
/* @__PURE__ */ E("div", {
|
|
351
407
|
className: "space-y-3",
|
|
352
|
-
children: [/* @__PURE__ */
|
|
408
|
+
children: [/* @__PURE__ */ E("div", {
|
|
353
409
|
className: "flex flex-wrap items-center justify-between gap-3",
|
|
354
|
-
children: [/* @__PURE__ */
|
|
410
|
+
children: [/* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("h2", {
|
|
355
411
|
className: "text-sm font-semibold text-text-primary",
|
|
356
|
-
children:
|
|
357
|
-
}), /* @__PURE__ */
|
|
412
|
+
children: P("healthybowl.crops.planning.coverage.title", "Crop planning coverage")
|
|
413
|
+
}), /* @__PURE__ */ T("p", {
|
|
358
414
|
className: "mt-1 text-xs text-text-secondary",
|
|
359
|
-
children:
|
|
360
|
-
})] }), /* @__PURE__ */
|
|
361
|
-
label:
|
|
362
|
-
planned:
|
|
363
|
-
total:
|
|
415
|
+
children: P("healthybowl.crops.planning.coverage.description", "Every crop is listed here so missing plans are easy to spot.")
|
|
416
|
+
})] }), /* @__PURE__ */ T(a, {
|
|
417
|
+
label: P("healthybowl.crops.planning.coverage.status", "{{planned}} / {{total}} planned", {
|
|
418
|
+
planned: vt,
|
|
419
|
+
total: w.length
|
|
364
420
|
}),
|
|
365
|
-
variant:
|
|
421
|
+
variant: vt === w.length && w.length > 0 ? "success" : "warning"
|
|
366
422
|
})]
|
|
367
|
-
}),
|
|
423
|
+
}), w.length > 0 ? /* @__PURE__ */ T("div", {
|
|
368
424
|
className: "grid grid-cols-1 gap-4 md:grid-cols-2 xl:grid-cols-3",
|
|
369
|
-
children:
|
|
425
|
+
children: _t.map(({ crop: e, activePlan: t, plans: n, capacityEstimate: r, capacityNotApplicableFor: i, growCapacityEstimate: a, awaitingGeometryFor: o }) => /* @__PURE__ */ T(Te, {
|
|
370
426
|
crop: e,
|
|
371
427
|
plan: t,
|
|
372
428
|
planCount: n.length,
|
|
373
429
|
capacityEstimate: r,
|
|
374
430
|
capacityNotApplicableFor: i,
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
431
|
+
growCapacityEstimate: a,
|
|
432
|
+
awaitingGeometryFor: o,
|
|
433
|
+
onPlan: () => xt(e),
|
|
434
|
+
onViewCrop: () => L(De(`crops/${e.id}`)),
|
|
435
|
+
onViewPlan: () => t && L(De(`crops/planning/${t.id}`))
|
|
378
436
|
}, e.id))
|
|
379
|
-
}) :
|
|
437
|
+
}) : N.crops ? /* @__PURE__ */ T(u, {}) : /* @__PURE__ */ T("p", {
|
|
380
438
|
className: "rounded-md border border-border-subtle bg-bg-surface p-4 text-sm text-text-secondary",
|
|
381
|
-
children:
|
|
439
|
+
children: P("healthybowl.crops.planning.coverage.empty", "No crops available yet. Add crops before planning.")
|
|
382
440
|
})]
|
|
383
441
|
}),
|
|
384
|
-
|
|
442
|
+
ut.length > 0 ? /* @__PURE__ */ T("div", {
|
|
385
443
|
className: "grid grid-cols-1 gap-4 md:grid-cols-2 xl:grid-cols-3",
|
|
386
|
-
children:
|
|
444
|
+
children: ut.map((e) => /* @__PURE__ */ T(Ee, {
|
|
387
445
|
plan: e,
|
|
388
|
-
onClick: () =>
|
|
446
|
+
onClick: () => L(De(`crops/planning/${e.id}`))
|
|
389
447
|
}, e.id))
|
|
390
|
-
}) :
|
|
391
|
-
title:
|
|
392
|
-
description:
|
|
393
|
-
action: /* @__PURE__ */
|
|
394
|
-
onClick: () =>
|
|
395
|
-
children:
|
|
448
|
+
}) : N.crops ? /* @__PURE__ */ T(u, {}) : se.crops ? /* @__PURE__ */ T(s, { onRetry: _e }) : /* @__PURE__ */ T(o, {
|
|
449
|
+
title: P("healthybowl.crops.planning.emptyState.title", "No plans found"),
|
|
450
|
+
description: je || Ne !== "all" || Fe !== "all" ? P("healthybowl.crops.planning.emptyState.filtered", "Try adjusting your search or filters.") : P("healthybowl.crops.planning.emptyState.message", "Get started by creating a new planting plan."),
|
|
451
|
+
action: /* @__PURE__ */ T(D, {
|
|
452
|
+
onClick: () => B(!0),
|
|
453
|
+
children: P("healthybowl.crops.planning.actions.createPlan", "Create Plan")
|
|
396
454
|
})
|
|
397
455
|
}),
|
|
398
|
-
/* @__PURE__ */
|
|
399
|
-
open:
|
|
456
|
+
/* @__PURE__ */ T(ee, {
|
|
457
|
+
open: Le,
|
|
400
458
|
onClose: () => {
|
|
401
|
-
|
|
459
|
+
B(!1), ot();
|
|
402
460
|
},
|
|
403
|
-
title:
|
|
404
|
-
description:
|
|
461
|
+
title: P("healthybowl.crops.planning.modal.title", "Add New Planting Plan"),
|
|
462
|
+
description: P("healthybowl.crops.planning.modal.description", "Create a new planting plan for your farm"),
|
|
405
463
|
size: "lg",
|
|
406
|
-
footer: /* @__PURE__ */
|
|
464
|
+
footer: /* @__PURE__ */ E(he, { children: [/* @__PURE__ */ T(D, {
|
|
407
465
|
variant: "outline",
|
|
408
466
|
onClick: () => {
|
|
409
|
-
|
|
467
|
+
B(!1), ot();
|
|
410
468
|
},
|
|
411
|
-
children:
|
|
412
|
-
}), /* @__PURE__ */
|
|
469
|
+
children: P("healthybowl.common.cancel", "Cancel")
|
|
470
|
+
}), /* @__PURE__ */ T(D, {
|
|
413
471
|
onClick: async () => {
|
|
414
|
-
if (!
|
|
415
|
-
|
|
416
|
-
title:
|
|
417
|
-
description:
|
|
472
|
+
if (!V || !H) {
|
|
473
|
+
ke({
|
|
474
|
+
title: P("healthybowl.crops.planning.toast.missingFields.title", "Missing required fields"),
|
|
475
|
+
description: P("healthybowl.crops.planning.toast.missingFields.description", "Please select a crop and field."),
|
|
418
476
|
variant: "warning"
|
|
419
477
|
});
|
|
420
478
|
return;
|
|
421
479
|
}
|
|
422
480
|
try {
|
|
423
|
-
let e =
|
|
481
|
+
let e = w.find((e) => e.id === V);
|
|
424
482
|
if (!e) {
|
|
425
|
-
|
|
426
|
-
title:
|
|
427
|
-
description:
|
|
483
|
+
ke({
|
|
484
|
+
title: P("healthybowl.crops.planning.toast.cropNotFound.title", "Crop not found"),
|
|
485
|
+
description: P("healthybowl.crops.planning.toast.cropNotFound.description", "Please select a valid crop."),
|
|
428
486
|
variant: "warning"
|
|
429
487
|
});
|
|
430
488
|
return;
|
|
431
489
|
}
|
|
432
490
|
await ge({
|
|
433
491
|
cropId: e.id,
|
|
434
|
-
fieldId:
|
|
435
|
-
season:
|
|
436
|
-
startDate:
|
|
437
|
-
endDate:
|
|
438
|
-
expectedYield: Number(
|
|
439
|
-
seedRequired: Number(
|
|
492
|
+
fieldId: H,
|
|
493
|
+
season: Be,
|
|
494
|
+
startDate: We || (/* @__PURE__ */ new Date()).toISOString().split("T")[0],
|
|
495
|
+
endDate: Ke || void 0,
|
|
496
|
+
expectedYield: Number(Je) || 0,
|
|
497
|
+
seedRequired: Number(Xe) || 0,
|
|
440
498
|
fertilizers: [],
|
|
441
|
-
priority:
|
|
499
|
+
priority: He,
|
|
442
500
|
weatherRisk: "low"
|
|
443
|
-
}),
|
|
444
|
-
title:
|
|
445
|
-
description:
|
|
501
|
+
}), ke({
|
|
502
|
+
title: P("healthybowl.crops.planning.toast.planCreated.title", "Plan created"),
|
|
503
|
+
description: P("healthybowl.crops.planning.toast.planCreated.description", "New planting plan has been added."),
|
|
446
504
|
variant: "success"
|
|
447
|
-
}),
|
|
505
|
+
}), B(!1), ot();
|
|
448
506
|
} catch (e) {
|
|
449
|
-
|
|
450
|
-
title:
|
|
451
|
-
description: e instanceof Error ? e.message :
|
|
507
|
+
ke({
|
|
508
|
+
title: P("healthybowl.crops.planning.toast.error.title", "Error"),
|
|
509
|
+
description: e instanceof Error ? e.message : P("healthybowl.crops.planning.toast.error.description", "Failed to create planting plan"),
|
|
452
510
|
variant: "error"
|
|
453
511
|
});
|
|
454
512
|
}
|
|
455
513
|
},
|
|
456
|
-
children:
|
|
514
|
+
children: P("healthybowl.crops.planning.actions.createPlan", "Create Plan")
|
|
457
515
|
})] }),
|
|
458
|
-
children: /* @__PURE__ */
|
|
516
|
+
children: /* @__PURE__ */ E("div", {
|
|
459
517
|
className: "grid gap-4 sm:grid-cols-2",
|
|
460
518
|
children: [
|
|
461
|
-
/* @__PURE__ */
|
|
519
|
+
/* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("label", {
|
|
462
520
|
className: "text-sm font-medium text-text-primary",
|
|
463
|
-
children:
|
|
464
|
-
}), /* @__PURE__ */
|
|
465
|
-
value:
|
|
466
|
-
onValueChange:
|
|
467
|
-
children: [/* @__PURE__ */
|
|
521
|
+
children: P("healthybowl.crops.planning.form.fields.cropName.label", "Crop Name")
|
|
522
|
+
}), /* @__PURE__ */ E(O, {
|
|
523
|
+
value: V,
|
|
524
|
+
onValueChange: bt,
|
|
525
|
+
children: [/* @__PURE__ */ T(j, {
|
|
468
526
|
className: "mt-1 w-full",
|
|
469
|
-
children: /* @__PURE__ */
|
|
470
|
-
}), /* @__PURE__ */
|
|
527
|
+
children: /* @__PURE__ */ T(M, { placeholder: P("healthybowl.crops.planning.form.fields.cropName.placeholder", "Select crop...") })
|
|
528
|
+
}), /* @__PURE__ */ T(k, { children: w.map((e) => /* @__PURE__ */ T(A, {
|
|
471
529
|
value: e.id,
|
|
472
530
|
children: e.variety ? `${e.name} - ${e.variety}` : e.name
|
|
473
531
|
}, e.id)) })]
|
|
474
532
|
})] }),
|
|
475
|
-
/* @__PURE__ */
|
|
533
|
+
/* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("label", {
|
|
476
534
|
className: "text-sm font-medium text-text-primary",
|
|
477
|
-
children:
|
|
478
|
-
}), /* @__PURE__ */
|
|
479
|
-
value:
|
|
480
|
-
onValueChange:
|
|
481
|
-
children: [/* @__PURE__ */
|
|
535
|
+
children: P("healthybowl.crops.planning.form.fields.field.label", "Field")
|
|
536
|
+
}), /* @__PURE__ */ E(O, {
|
|
537
|
+
value: H,
|
|
538
|
+
onValueChange: ze,
|
|
539
|
+
children: [/* @__PURE__ */ T(j, {
|
|
482
540
|
className: "mt-1 w-full",
|
|
483
|
-
children: /* @__PURE__ */
|
|
484
|
-
}), /* @__PURE__ */
|
|
541
|
+
children: /* @__PURE__ */ T(M, { placeholder: P("healthybowl.crops.planning.form.fields.field.placeholder", "Select field...") })
|
|
542
|
+
}), /* @__PURE__ */ T(k, { children: C.map((e) => /* @__PURE__ */ T(A, {
|
|
485
543
|
value: e.id,
|
|
486
|
-
children: `${e.name} · ${
|
|
544
|
+
children: `${e.name} · ${g(P, e.type)}`
|
|
487
545
|
}, e.id)) })]
|
|
488
546
|
})] }),
|
|
489
|
-
Q && !
|
|
547
|
+
Q && !lt && h(Q.type) === "NONE" && /* @__PURE__ */ T("p", {
|
|
490
548
|
className: "rounded-md border border-border-subtle bg-bg-sunken/60 p-3 text-xs text-text-secondary sm:col-span-2",
|
|
491
|
-
children:
|
|
549
|
+
children: P(p.key, p.defaultValue, { type: g(P, Q.type) })
|
|
492
550
|
}),
|
|
493
|
-
$ && /* @__PURE__ */
|
|
551
|
+
$ && /* @__PURE__ */ T("div", {
|
|
494
552
|
className: "rounded-md border border-border-subtle bg-bg-sunken/60 p-3 sm:col-span-2",
|
|
495
|
-
children: /* @__PURE__ */
|
|
553
|
+
children: /* @__PURE__ */ E("div", {
|
|
496
554
|
className: "grid grid-cols-2 gap-3 sm:grid-cols-4",
|
|
497
555
|
children: [
|
|
498
|
-
/* @__PURE__ */
|
|
556
|
+
/* @__PURE__ */ T(z, {
|
|
499
557
|
compact: !0,
|
|
500
|
-
label:
|
|
558
|
+
label: P("healthybowl.crops.planning.capacity.metrics.beds", "Beds"),
|
|
501
559
|
value: t($.bedCount)
|
|
502
560
|
}),
|
|
503
|
-
/* @__PURE__ */
|
|
561
|
+
/* @__PURE__ */ T(z, {
|
|
504
562
|
compact: !0,
|
|
505
|
-
label:
|
|
563
|
+
label: P("healthybowl.crops.planning.capacity.metrics.plantsPerBed", "Plants / bed"),
|
|
506
564
|
value: t($.plantsPerBed)
|
|
507
565
|
}),
|
|
508
|
-
/* @__PURE__ */
|
|
566
|
+
/* @__PURE__ */ T(z, {
|
|
509
567
|
compact: !0,
|
|
510
|
-
label:
|
|
568
|
+
label: P("healthybowl.crops.planning.capacity.metrics.totalPlants", "Total plants"),
|
|
511
569
|
value: t($.totalPlants)
|
|
512
570
|
}),
|
|
513
|
-
/* @__PURE__ */
|
|
571
|
+
/* @__PURE__ */ T(z, {
|
|
514
572
|
compact: !0,
|
|
515
|
-
label:
|
|
573
|
+
label: P("healthybowl.crops.planning.capacity.metrics.seedlings", "Seedlings"),
|
|
516
574
|
value: t($.seedlingTarget)
|
|
517
575
|
})
|
|
518
576
|
]
|
|
519
577
|
})
|
|
520
578
|
}),
|
|
521
|
-
/* @__PURE__ */
|
|
579
|
+
/* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("label", {
|
|
522
580
|
className: "text-sm font-medium text-text-primary",
|
|
523
|
-
children:
|
|
524
|
-
}), /* @__PURE__ */
|
|
525
|
-
value:
|
|
526
|
-
onValueChange: (e) =>
|
|
527
|
-
children: [/* @__PURE__ */
|
|
581
|
+
children: P("healthybowl.crops.planning.form.fields.season.label", "Season")
|
|
582
|
+
}), /* @__PURE__ */ E(O, {
|
|
583
|
+
value: Be,
|
|
584
|
+
onValueChange: (e) => Ve(e),
|
|
585
|
+
children: [/* @__PURE__ */ T(j, {
|
|
528
586
|
className: "mt-1 w-full",
|
|
529
|
-
children: /* @__PURE__ */
|
|
530
|
-
}), /* @__PURE__ */
|
|
531
|
-
/* @__PURE__ */
|
|
587
|
+
children: /* @__PURE__ */ T(M, {})
|
|
588
|
+
}), /* @__PURE__ */ E(k, { children: [
|
|
589
|
+
/* @__PURE__ */ T(A, {
|
|
532
590
|
value: "kharif",
|
|
533
|
-
children:
|
|
591
|
+
children: P("healthybowl.crops.planning.season.kharif", "Kharif")
|
|
534
592
|
}),
|
|
535
|
-
/* @__PURE__ */
|
|
593
|
+
/* @__PURE__ */ T(A, {
|
|
536
594
|
value: "rabi",
|
|
537
|
-
children:
|
|
595
|
+
children: P("healthybowl.crops.planning.season.rabi", "Rabi")
|
|
538
596
|
}),
|
|
539
|
-
/* @__PURE__ */
|
|
597
|
+
/* @__PURE__ */ T(A, {
|
|
540
598
|
value: "zaid",
|
|
541
|
-
children:
|
|
599
|
+
children: P("healthybowl.crops.planning.season.zaid", "Zaid")
|
|
542
600
|
}),
|
|
543
|
-
/* @__PURE__ */
|
|
601
|
+
/* @__PURE__ */ T(A, {
|
|
544
602
|
value: "perennial",
|
|
545
|
-
children:
|
|
603
|
+
children: P("healthybowl.crops.planning.season.perennial", "Perennial")
|
|
546
604
|
})
|
|
547
605
|
] })]
|
|
548
606
|
})] }),
|
|
549
|
-
/* @__PURE__ */
|
|
607
|
+
/* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("label", {
|
|
550
608
|
className: "text-sm font-medium text-text-primary",
|
|
551
|
-
children:
|
|
552
|
-
}), /* @__PURE__ */
|
|
553
|
-
value:
|
|
554
|
-
onValueChange: (e) =>
|
|
555
|
-
children: [/* @__PURE__ */
|
|
609
|
+
children: P("healthybowl.crops.planning.form.fields.priority.label", "Priority")
|
|
610
|
+
}), /* @__PURE__ */ E(O, {
|
|
611
|
+
value: He,
|
|
612
|
+
onValueChange: (e) => Ue(e),
|
|
613
|
+
children: [/* @__PURE__ */ T(j, {
|
|
556
614
|
className: "mt-1 w-full",
|
|
557
|
-
children: /* @__PURE__ */
|
|
558
|
-
}), /* @__PURE__ */
|
|
559
|
-
/* @__PURE__ */
|
|
615
|
+
children: /* @__PURE__ */ T(M, {})
|
|
616
|
+
}), /* @__PURE__ */ E(k, { children: [
|
|
617
|
+
/* @__PURE__ */ T(A, {
|
|
560
618
|
value: "low",
|
|
561
|
-
children:
|
|
619
|
+
children: P("healthybowl.crops.planning.priority.low", "Low")
|
|
562
620
|
}),
|
|
563
|
-
/* @__PURE__ */
|
|
621
|
+
/* @__PURE__ */ T(A, {
|
|
564
622
|
value: "medium",
|
|
565
|
-
children:
|
|
623
|
+
children: P("healthybowl.crops.planning.priority.medium", "Medium")
|
|
566
624
|
}),
|
|
567
|
-
/* @__PURE__ */
|
|
625
|
+
/* @__PURE__ */ T(A, {
|
|
568
626
|
value: "high",
|
|
569
|
-
children:
|
|
627
|
+
children: P("healthybowl.crops.planning.priority.high", "High")
|
|
570
628
|
})
|
|
571
629
|
] })]
|
|
572
630
|
})] }),
|
|
573
|
-
/* @__PURE__ */
|
|
631
|
+
/* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("label", {
|
|
574
632
|
className: "text-sm font-medium text-text-primary",
|
|
575
|
-
children:
|
|
576
|
-
}), /* @__PURE__ */
|
|
633
|
+
children: P("healthybowl.crops.planning.form.fields.startDate.label", "Start Date")
|
|
634
|
+
}), /* @__PURE__ */ T("input", {
|
|
577
635
|
type: "date",
|
|
578
|
-
value:
|
|
579
|
-
onChange: (e) =>
|
|
636
|
+
value: We,
|
|
637
|
+
onChange: (e) => Ge(e.target.value),
|
|
580
638
|
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)]"
|
|
581
639
|
})] }),
|
|
582
|
-
/* @__PURE__ */
|
|
640
|
+
/* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("label", {
|
|
583
641
|
className: "text-sm font-medium text-text-primary",
|
|
584
|
-
children:
|
|
585
|
-
}), /* @__PURE__ */
|
|
642
|
+
children: P("healthybowl.crops.planning.form.fields.endDate.label", "End Date")
|
|
643
|
+
}), /* @__PURE__ */ T("input", {
|
|
586
644
|
type: "date",
|
|
587
|
-
value:
|
|
588
|
-
onChange: (e) =>
|
|
645
|
+
value: Ke,
|
|
646
|
+
onChange: (e) => qe(e.target.value),
|
|
589
647
|
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)]"
|
|
590
648
|
})] }),
|
|
591
|
-
/* @__PURE__ */
|
|
649
|
+
/* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("label", {
|
|
592
650
|
className: "text-sm font-medium text-text-primary",
|
|
593
|
-
children:
|
|
594
|
-
}), /* @__PURE__ */
|
|
651
|
+
children: P("healthybowl.crops.planning.form.fields.expectedYield.label", "Expected Yield (kg)")
|
|
652
|
+
}), /* @__PURE__ */ T("input", {
|
|
595
653
|
type: "number",
|
|
596
654
|
placeholder: "0",
|
|
597
|
-
value:
|
|
598
|
-
onChange: (e) =>
|
|
655
|
+
value: Je,
|
|
656
|
+
onChange: (e) => Ye(e.target.value),
|
|
599
657
|
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)]"
|
|
600
658
|
})] }),
|
|
601
|
-
/* @__PURE__ */
|
|
659
|
+
/* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("label", {
|
|
602
660
|
className: "text-sm font-medium text-text-primary",
|
|
603
|
-
children:
|
|
604
|
-
}), /* @__PURE__ */
|
|
661
|
+
children: P("healthybowl.crops.planning.form.fields.seedRequired.label", "Seed Required (kg)")
|
|
662
|
+
}), /* @__PURE__ */ T("input", {
|
|
605
663
|
type: "number",
|
|
606
664
|
placeholder: "0",
|
|
607
|
-
value:
|
|
608
|
-
onChange: (e) =>
|
|
665
|
+
value: Xe,
|
|
666
|
+
onChange: (e) => Ze(e.target.value),
|
|
609
667
|
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)]"
|
|
610
668
|
})] })
|
|
611
669
|
]
|
|
612
670
|
})
|
|
613
671
|
}),
|
|
614
|
-
/* @__PURE__ */
|
|
615
|
-
toasts:
|
|
616
|
-
onDismiss:
|
|
672
|
+
/* @__PURE__ */ T(c, {
|
|
673
|
+
toasts: Oe,
|
|
674
|
+
onDismiss: Ae
|
|
617
675
|
})
|
|
618
676
|
]
|
|
619
677
|
});
|
|
620
|
-
},
|
|
678
|
+
}, R = ({ label: e, unit: t, value: n, min: r, step: i, onChange: a }) => /* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("label", {
|
|
621
679
|
className: "text-xs font-medium text-text-secondary",
|
|
622
680
|
children: e
|
|
623
|
-
}), /* @__PURE__ */
|
|
681
|
+
}), /* @__PURE__ */ E("div", {
|
|
624
682
|
className: "relative mt-1",
|
|
625
|
-
children: [/* @__PURE__ */
|
|
683
|
+
children: [/* @__PURE__ */ T("input", {
|
|
626
684
|
type: "number",
|
|
627
685
|
value: n,
|
|
628
686
|
min: r,
|
|
629
687
|
step: i,
|
|
630
688
|
onChange: (e) => a(e.target.value),
|
|
631
689
|
className: "h-10 w-full rounded-md border border-border-subtle bg-bg-surface px-3 pe-10 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
|
|
632
|
-
}), /* @__PURE__ */
|
|
690
|
+
}), /* @__PURE__ */ T("span", {
|
|
633
691
|
className: "pointer-events-none absolute end-3 top-1/2 -translate-y-1/2 text-xs text-text-secondary",
|
|
634
692
|
children: t
|
|
635
693
|
})]
|
|
636
|
-
})] }),
|
|
694
|
+
})] }), z = ({ label: e, value: t, unit: n, compact: r = !1 }) => /* @__PURE__ */ E("div", {
|
|
637
695
|
className: r ? "min-w-0" : "min-w-0 rounded-md border border-border-subtle bg-bg-sunken/60 p-3",
|
|
638
|
-
children: [/* @__PURE__ */
|
|
696
|
+
children: [/* @__PURE__ */ T("span", {
|
|
639
697
|
className: "block truncate text-xs text-text-secondary",
|
|
640
698
|
children: e
|
|
641
|
-
}), /* @__PURE__ */
|
|
699
|
+
}), /* @__PURE__ */ E("p", {
|
|
642
700
|
className: r ? "mt-0.5 truncate text-sm font-semibold text-text-primary" : "mt-1 text-lg font-semibold text-text-primary",
|
|
643
|
-
children: [t, n && /* @__PURE__ */
|
|
701
|
+
children: [t, n && /* @__PURE__ */ T("span", {
|
|
644
702
|
className: "ms-1 text-xs font-medium text-text-secondary",
|
|
645
703
|
children: n
|
|
646
704
|
})]
|
|
647
705
|
})]
|
|
648
|
-
}), Te = ({ crop: n, plan: r, planCount: i, capacityEstimate: o, capacityNotApplicableFor: s,
|
|
649
|
-
let { t:
|
|
650
|
-
return /* @__PURE__ */
|
|
706
|
+
}), Te = ({ crop: n, plan: r, planCount: i, capacityEstimate: o, capacityNotApplicableFor: s, growCapacityEstimate: c, awaitingGeometryFor: l, onPlan: u, onViewCrop: ee, onViewPlan: te }) => {
|
|
707
|
+
let { t: d } = oe(), f = !!r;
|
|
708
|
+
return /* @__PURE__ */ E("div", {
|
|
651
709
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-4 shadow-sm",
|
|
652
710
|
children: [
|
|
653
|
-
/* @__PURE__ */
|
|
711
|
+
/* @__PURE__ */ E("div", {
|
|
654
712
|
className: "flex items-start justify-between gap-3",
|
|
655
|
-
children: [/* @__PURE__ */
|
|
713
|
+
children: [/* @__PURE__ */ E("div", {
|
|
656
714
|
className: "min-w-0",
|
|
657
|
-
children: [/* @__PURE__ */
|
|
715
|
+
children: [/* @__PURE__ */ T("h3", {
|
|
658
716
|
className: "truncate text-sm font-semibold text-text-primary",
|
|
659
717
|
children: n.name
|
|
660
|
-
}), /* @__PURE__ */
|
|
718
|
+
}), /* @__PURE__ */ T("p", {
|
|
661
719
|
className: "mt-0.5 truncate text-xs text-text-secondary",
|
|
662
720
|
children: n.variety || n.category
|
|
663
721
|
})]
|
|
664
|
-
}), /* @__PURE__ */
|
|
665
|
-
label:
|
|
666
|
-
variant:
|
|
722
|
+
}), /* @__PURE__ */ T(a, {
|
|
723
|
+
label: f ? d("healthybowl.crops.planning.coverage.card.planned", "Planned") : d("healthybowl.crops.planning.coverage.card.missing", "Needs plan"),
|
|
724
|
+
variant: f ? "success" : "warning"
|
|
667
725
|
})]
|
|
668
726
|
}),
|
|
669
|
-
/* @__PURE__ */
|
|
727
|
+
/* @__PURE__ */ E("div", {
|
|
670
728
|
className: "mt-3 grid grid-cols-2 gap-3 text-xs",
|
|
671
729
|
children: [
|
|
672
|
-
/* @__PURE__ */
|
|
730
|
+
/* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("span", {
|
|
673
731
|
className: "text-text-secondary",
|
|
674
|
-
children:
|
|
675
|
-
}), /* @__PURE__ */
|
|
732
|
+
children: d("healthybowl.crops.planning.coverage.card.field", "Field")
|
|
733
|
+
}), /* @__PURE__ */ T("p", {
|
|
676
734
|
className: "mt-0.5 truncate font-medium text-text-primary",
|
|
677
735
|
children: n.fieldName
|
|
678
736
|
})] }),
|
|
679
|
-
/* @__PURE__ */
|
|
737
|
+
/* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("span", {
|
|
680
738
|
className: "text-text-secondary",
|
|
681
|
-
children:
|
|
682
|
-
}), /* @__PURE__ */
|
|
739
|
+
children: d("healthybowl.crops.planning.coverage.card.season", "Season")
|
|
740
|
+
}), /* @__PURE__ */ T("p", {
|
|
683
741
|
className: "mt-0.5 font-medium text-text-primary",
|
|
684
|
-
children: ve(n.season,
|
|
742
|
+
children: ve(n.season, d)
|
|
685
743
|
})] }),
|
|
686
|
-
/* @__PURE__ */
|
|
744
|
+
/* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("span", {
|
|
687
745
|
className: "text-text-secondary",
|
|
688
|
-
children:
|
|
689
|
-
}), /* @__PURE__ */
|
|
746
|
+
children: d("healthybowl.crops.planning.coverage.card.status", "Crop")
|
|
747
|
+
}), /* @__PURE__ */ T("p", {
|
|
690
748
|
className: "mt-0.5 capitalize font-medium text-text-primary",
|
|
691
749
|
children: n.status.replace(/_/g, " ")
|
|
692
750
|
})] }),
|
|
693
|
-
/* @__PURE__ */
|
|
751
|
+
/* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("span", {
|
|
694
752
|
className: "text-text-secondary",
|
|
695
|
-
children:
|
|
696
|
-
}), /* @__PURE__ */
|
|
753
|
+
children: d("healthybowl.crops.planning.coverage.card.harvest", "Harvest")
|
|
754
|
+
}), /* @__PURE__ */ T("p", {
|
|
697
755
|
className: "mt-0.5 font-medium text-text-primary",
|
|
698
756
|
children: e(n.expectedHarvestDate)
|
|
699
757
|
})] })
|
|
700
758
|
]
|
|
701
759
|
}),
|
|
702
|
-
r && /* @__PURE__ */
|
|
760
|
+
r && /* @__PURE__ */ E("div", {
|
|
703
761
|
className: "mt-3 rounded-md bg-bg-sunken/60 p-3",
|
|
704
762
|
children: [
|
|
705
|
-
/* @__PURE__ */
|
|
763
|
+
/* @__PURE__ */ E("div", {
|
|
706
764
|
className: "flex items-center justify-between gap-2",
|
|
707
|
-
children: [/* @__PURE__ */
|
|
765
|
+
children: [/* @__PURE__ */ T("span", {
|
|
708
766
|
className: "text-xs text-text-secondary",
|
|
709
|
-
children:
|
|
710
|
-
}), /* @__PURE__ */
|
|
767
|
+
children: d("healthybowl.crops.planning.coverage.card.currentPlan", "Current plan")
|
|
768
|
+
}), /* @__PURE__ */ T(a, {
|
|
711
769
|
label: r.status,
|
|
712
|
-
variant:
|
|
770
|
+
variant: N(r.status ?? "unknown")
|
|
713
771
|
})]
|
|
714
772
|
}),
|
|
715
|
-
/* @__PURE__ */
|
|
773
|
+
/* @__PURE__ */ E("p", {
|
|
716
774
|
className: "mt-1 text-xs font-medium text-text-primary",
|
|
717
775
|
children: [
|
|
718
776
|
e(r.startDate),
|
|
@@ -720,184 +778,211 @@ var A = (e) => {
|
|
|
720
778
|
e(r.endDate)
|
|
721
779
|
]
|
|
722
780
|
}),
|
|
723
|
-
i > 1 && /* @__PURE__ */
|
|
781
|
+
i > 1 && /* @__PURE__ */ T("p", {
|
|
724
782
|
className: "mt-1 text-xs text-text-secondary",
|
|
725
|
-
children:
|
|
783
|
+
children: d("healthybowl.crops.planning.coverage.card.planCount", "{{count}} plans total", { count: i })
|
|
726
784
|
})
|
|
727
785
|
]
|
|
728
786
|
}),
|
|
729
|
-
s && /* @__PURE__ */
|
|
787
|
+
s && /* @__PURE__ */ T("p", {
|
|
788
|
+
className: "mt-3 rounded-md bg-bg-sunken/60 p-3 text-xs text-text-secondary",
|
|
789
|
+
children: d(p.key, p.defaultValue, { type: g(d, s.type) })
|
|
790
|
+
}),
|
|
791
|
+
l && /* @__PURE__ */ T("p", {
|
|
730
792
|
className: "mt-3 rounded-md bg-bg-sunken/60 p-3 text-xs text-text-secondary",
|
|
731
|
-
|
|
793
|
+
"data-testid": "coverage-grow-geometry-prompt",
|
|
794
|
+
children: d(m.key, m.defaultValue, { type: g(d, l.type) })
|
|
795
|
+
}),
|
|
796
|
+
c && /* @__PURE__ */ E("div", {
|
|
797
|
+
className: "mt-3 grid grid-cols-3 gap-2 rounded-md bg-bg-sunken/60 p-3",
|
|
798
|
+
"data-testid": "coverage-grow-capacity",
|
|
799
|
+
"data-model": c.model,
|
|
800
|
+
children: [
|
|
801
|
+
/* @__PURE__ */ T(z, {
|
|
802
|
+
compact: !0,
|
|
803
|
+
label: c.model === "TREE" ? d("healthybowl.crops.planning.capacity.metrics.block", "Block") : c.model === "RACK" ? d("healthybowl.crops.planning.capacity.metrics.racks", "Racks") : d("healthybowl.crops.planning.capacity.metrics.benches", "Benches"),
|
|
804
|
+
value: t(c.unitCount)
|
|
805
|
+
}),
|
|
806
|
+
/* @__PURE__ */ T(z, {
|
|
807
|
+
compact: !0,
|
|
808
|
+
label: d("healthybowl.crops.planning.capacity.metrics.plantsPerUnit", "Plants / unit"),
|
|
809
|
+
value: t(c.plantsPerUnit)
|
|
810
|
+
}),
|
|
811
|
+
/* @__PURE__ */ T(z, {
|
|
812
|
+
compact: !0,
|
|
813
|
+
label: c.model === "TREE" ? d("healthybowl.crops.planning.capacity.metrics.totalTrees", "Total trees") : d("healthybowl.crops.planning.capacity.metrics.totalPlants", "Total plants"),
|
|
814
|
+
value: t(c.totalPlants)
|
|
815
|
+
})
|
|
816
|
+
]
|
|
732
817
|
}),
|
|
733
|
-
o && /* @__PURE__ */
|
|
818
|
+
o && /* @__PURE__ */ E("div", {
|
|
734
819
|
className: "mt-3 grid grid-cols-3 gap-2 rounded-md bg-bg-sunken/60 p-3",
|
|
735
820
|
children: [
|
|
736
|
-
/* @__PURE__ */
|
|
821
|
+
/* @__PURE__ */ T(z, {
|
|
737
822
|
compact: !0,
|
|
738
|
-
label:
|
|
823
|
+
label: d("healthybowl.crops.planning.capacity.metrics.beds", "Beds"),
|
|
739
824
|
value: t(o.bedCount)
|
|
740
825
|
}),
|
|
741
|
-
/* @__PURE__ */
|
|
826
|
+
/* @__PURE__ */ T(z, {
|
|
742
827
|
compact: !0,
|
|
743
|
-
label:
|
|
828
|
+
label: d("healthybowl.crops.planning.capacity.metrics.plantsPerBed", "Plants / bed"),
|
|
744
829
|
value: t(o.plantsPerBed)
|
|
745
830
|
}),
|
|
746
|
-
/* @__PURE__ */
|
|
831
|
+
/* @__PURE__ */ T(z, {
|
|
747
832
|
compact: !0,
|
|
748
|
-
label:
|
|
833
|
+
label: d("healthybowl.crops.planning.capacity.metrics.totalPlants", "Total plants"),
|
|
749
834
|
value: t(o.totalPlants)
|
|
750
835
|
})
|
|
751
836
|
]
|
|
752
837
|
}),
|
|
753
|
-
/* @__PURE__ */
|
|
838
|
+
/* @__PURE__ */ E("div", {
|
|
754
839
|
className: "mt-4 flex gap-2",
|
|
755
|
-
children: [/* @__PURE__ */
|
|
840
|
+
children: [/* @__PURE__ */ E(D, {
|
|
756
841
|
variant: "outline",
|
|
757
842
|
size: "sm",
|
|
758
843
|
onClick: ee,
|
|
759
844
|
className: "min-w-0 flex-1",
|
|
760
845
|
children: [
|
|
761
|
-
/* @__PURE__ */
|
|
846
|
+
/* @__PURE__ */ T(fe, { className: "h-4 w-4" }),
|
|
762
847
|
" ",
|
|
763
|
-
|
|
848
|
+
d("healthybowl.crops.planning.coverage.card.cropAction", "Crop")
|
|
764
849
|
]
|
|
765
|
-
}),
|
|
850
|
+
}), f ? /* @__PURE__ */ E(D, {
|
|
766
851
|
variant: "default",
|
|
767
852
|
size: "sm",
|
|
768
|
-
onClick:
|
|
853
|
+
onClick: te,
|
|
769
854
|
className: "min-w-0 flex-1",
|
|
770
855
|
children: [
|
|
771
|
-
/* @__PURE__ */
|
|
856
|
+
/* @__PURE__ */ T(ce, { className: "h-4 w-4" }),
|
|
772
857
|
" ",
|
|
773
|
-
|
|
858
|
+
d("healthybowl.crops.planning.coverage.card.planAction", "Plan")
|
|
774
859
|
]
|
|
775
|
-
}) : /* @__PURE__ */
|
|
860
|
+
}) : /* @__PURE__ */ E(D, {
|
|
776
861
|
variant: "default",
|
|
777
862
|
size: "sm",
|
|
778
|
-
onClick:
|
|
863
|
+
onClick: u,
|
|
779
864
|
className: "min-w-0 flex-1",
|
|
780
865
|
children: [
|
|
781
|
-
/* @__PURE__ */
|
|
866
|
+
/* @__PURE__ */ T(ue, { className: "h-4 w-4" }),
|
|
782
867
|
" ",
|
|
783
|
-
|
|
868
|
+
d("healthybowl.crops.planning.coverage.card.createAction", "Plan crop")
|
|
784
869
|
]
|
|
785
870
|
})]
|
|
786
871
|
})
|
|
787
872
|
]
|
|
788
873
|
});
|
|
789
874
|
}, Ee = ({ plan: n, onClick: r }) => {
|
|
790
|
-
let { t: i } = oe(), o = /* @__PURE__ */ new Date(), s = new Date(n.startDate), c = new Date(n.endDate).getTime() - s.getTime(),
|
|
791
|
-
return /* @__PURE__ */
|
|
875
|
+
let { t: i } = oe(), o = /* @__PURE__ */ new Date(), s = new Date(n.startDate), c = new Date(n.endDate).getTime() - s.getTime(), l = o.getTime() - s.getTime(), u = c > 0 ? Math.max(0, Math.min(100, Math.round(l / c * 100))) : 0;
|
|
876
|
+
return /* @__PURE__ */ E("div", {
|
|
792
877
|
onClick: r,
|
|
793
878
|
className: "group cursor-pointer rounded-lg border border-border-subtle bg-bg-surface p-5 shadow-sm transition-all hover:border-primary/30 hover:shadow-md",
|
|
794
879
|
children: [
|
|
795
|
-
/* @__PURE__ */
|
|
880
|
+
/* @__PURE__ */ E("div", {
|
|
796
881
|
className: "flex items-start justify-between",
|
|
797
|
-
children: [/* @__PURE__ */
|
|
882
|
+
children: [/* @__PURE__ */ E("div", {
|
|
798
883
|
className: "min-w-0 flex-1",
|
|
799
|
-
children: [/* @__PURE__ */
|
|
884
|
+
children: [/* @__PURE__ */ T("h3", {
|
|
800
885
|
className: "truncate text-sm font-semibold text-text-primary group-hover:text-primary",
|
|
801
886
|
children: n.cropName
|
|
802
|
-
}), /* @__PURE__ */
|
|
887
|
+
}), /* @__PURE__ */ E("div", {
|
|
803
888
|
className: "mt-1 flex items-center gap-1.5 text-xs text-text-secondary",
|
|
804
|
-
children: [/* @__PURE__ */
|
|
889
|
+
children: [/* @__PURE__ */ T(le, { className: "h-3 w-3 shrink-0" }), /* @__PURE__ */ T("span", {
|
|
805
890
|
className: "truncate",
|
|
806
891
|
children: n.fieldName
|
|
807
892
|
})]
|
|
808
893
|
})]
|
|
809
|
-
}), /* @__PURE__ */
|
|
894
|
+
}), /* @__PURE__ */ T(a, {
|
|
810
895
|
label: n.status,
|
|
811
|
-
variant:
|
|
896
|
+
variant: N(n.status ?? "unknown")
|
|
812
897
|
})]
|
|
813
898
|
}),
|
|
814
|
-
/* @__PURE__ */
|
|
899
|
+
/* @__PURE__ */ E("div", {
|
|
815
900
|
className: "mt-3 flex flex-wrap items-center gap-2",
|
|
816
901
|
children: [
|
|
817
|
-
/* @__PURE__ */
|
|
902
|
+
/* @__PURE__ */ T(a, {
|
|
818
903
|
label: i("healthybowl.crops.planning.card.priorityBadge", "Priority: {{priority}}", { priority: n.priority }),
|
|
819
904
|
variant: ge(n.priority)
|
|
820
905
|
}),
|
|
821
|
-
/* @__PURE__ */
|
|
906
|
+
/* @__PURE__ */ T(a, {
|
|
822
907
|
label: i("healthybowl.crops.planning.card.riskBadge", "Risk: {{risk}}", { risk: n.weatherRisk }),
|
|
823
908
|
variant: _e(n.weatherRisk)
|
|
824
909
|
}),
|
|
825
|
-
/* @__PURE__ */
|
|
910
|
+
/* @__PURE__ */ T(a, {
|
|
826
911
|
label: ve(n.season, i),
|
|
827
912
|
variant: "muted"
|
|
828
913
|
})
|
|
829
914
|
]
|
|
830
915
|
}),
|
|
831
|
-
/* @__PURE__ */
|
|
916
|
+
/* @__PURE__ */ E("div", {
|
|
832
917
|
className: "mt-4 grid grid-cols-2 gap-3",
|
|
833
|
-
children: [/* @__PURE__ */
|
|
918
|
+
children: [/* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("span", {
|
|
834
919
|
className: "text-xs text-text-secondary",
|
|
835
920
|
children: i("healthybowl.crops.planning.card.startDate", "Start Date")
|
|
836
|
-
}), /* @__PURE__ */
|
|
921
|
+
}), /* @__PURE__ */ E("p", {
|
|
837
922
|
className: "flex items-center gap-1 text-xs font-medium text-text-primary",
|
|
838
|
-
children: [/* @__PURE__ */
|
|
839
|
-
})] }), /* @__PURE__ */
|
|
923
|
+
children: [/* @__PURE__ */ T(se, { className: "h-3 w-3 text-text-secondary" }), e(n.startDate)]
|
|
924
|
+
})] }), /* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("span", {
|
|
840
925
|
className: "text-xs text-text-secondary",
|
|
841
926
|
children: i("healthybowl.crops.planning.card.endDate", "End Date")
|
|
842
|
-
}), /* @__PURE__ */
|
|
927
|
+
}), /* @__PURE__ */ E("p", {
|
|
843
928
|
className: "flex items-center gap-1 text-xs font-medium text-text-primary",
|
|
844
|
-
children: [/* @__PURE__ */
|
|
929
|
+
children: [/* @__PURE__ */ T(se, { className: "h-3 w-3 text-text-secondary" }), e(n.endDate)]
|
|
845
930
|
})] })]
|
|
846
931
|
}),
|
|
847
|
-
n.status === "active" && /* @__PURE__ */
|
|
932
|
+
n.status === "active" && /* @__PURE__ */ E("div", {
|
|
848
933
|
className: "mt-3",
|
|
849
|
-
children: [/* @__PURE__ */
|
|
934
|
+
children: [/* @__PURE__ */ E("div", {
|
|
850
935
|
className: "flex items-center justify-between text-xs text-text-secondary",
|
|
851
|
-
children: [/* @__PURE__ */
|
|
852
|
-
}), /* @__PURE__ */
|
|
936
|
+
children: [/* @__PURE__ */ T("span", { children: i("healthybowl.crops.planning.card.progress", "Progress") }), /* @__PURE__ */ E("span", { children: [u, "%"] })]
|
|
937
|
+
}), /* @__PURE__ */ T("div", {
|
|
853
938
|
className: "mt-1 h-1.5 rounded-full bg-bg-sunken",
|
|
854
|
-
children: /* @__PURE__ */
|
|
939
|
+
children: /* @__PURE__ */ T("div", {
|
|
855
940
|
className: "h-1.5 rounded-full bg-action-primary-bg transition-all",
|
|
856
|
-
style: { width: `${
|
|
941
|
+
style: { width: `${u}%` }
|
|
857
942
|
})
|
|
858
943
|
})]
|
|
859
944
|
}),
|
|
860
|
-
/* @__PURE__ */
|
|
945
|
+
/* @__PURE__ */ E("div", {
|
|
861
946
|
className: "mt-4 grid grid-cols-2 gap-3",
|
|
862
|
-
children: [/* @__PURE__ */
|
|
947
|
+
children: [/* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("span", {
|
|
863
948
|
className: "text-xs text-text-secondary",
|
|
864
949
|
children: i("healthybowl.crops.planning.card.expectedYield", "Expected Yield")
|
|
865
|
-
}), /* @__PURE__ */
|
|
950
|
+
}), /* @__PURE__ */ E("p", {
|
|
866
951
|
className: "text-sm font-semibold text-text-primary",
|
|
867
952
|
children: [t(n.expectedYield), " kg"]
|
|
868
|
-
})] }), /* @__PURE__ */
|
|
953
|
+
})] }), /* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("span", {
|
|
869
954
|
className: "text-xs text-text-secondary",
|
|
870
955
|
children: i("healthybowl.crops.planning.card.seedRequired", "Seed Required")
|
|
871
|
-
}), /* @__PURE__ */
|
|
956
|
+
}), /* @__PURE__ */ E("p", {
|
|
872
957
|
className: "text-sm font-semibold text-text-primary",
|
|
873
958
|
children: [t(n.seedRequired), " kg"]
|
|
874
959
|
})] })]
|
|
875
960
|
}),
|
|
876
|
-
(n.fertilizers ?? []).length > 0 && /* @__PURE__ */
|
|
961
|
+
(n.fertilizers ?? []).length > 0 && /* @__PURE__ */ E("div", {
|
|
877
962
|
className: "mt-3",
|
|
878
|
-
children: [/* @__PURE__ */
|
|
963
|
+
children: [/* @__PURE__ */ T("span", {
|
|
879
964
|
className: "text-xs text-text-secondary",
|
|
880
965
|
children: i("healthybowl.crops.planning.card.fertilizers", "Fertilizers")
|
|
881
|
-
}), /* @__PURE__ */
|
|
966
|
+
}), /* @__PURE__ */ T("div", {
|
|
882
967
|
className: "mt-1 flex flex-wrap gap-1",
|
|
883
|
-
children: (n.fertilizers ?? []).map((e) => /* @__PURE__ */
|
|
968
|
+
children: (n.fertilizers ?? []).map((e) => /* @__PURE__ */ E("span", {
|
|
884
969
|
className: "inline-flex items-center gap-1 rounded-full bg-bg-sunken px-2 py-0.5 text-xs font-medium text-text-primary",
|
|
885
|
-
children: [/* @__PURE__ */
|
|
970
|
+
children: [/* @__PURE__ */ T(w, { className: "h-2.5 w-2.5" }), e]
|
|
886
971
|
}, e))
|
|
887
972
|
})]
|
|
888
973
|
}),
|
|
889
|
-
/* @__PURE__ */
|
|
974
|
+
/* @__PURE__ */ E("div", {
|
|
890
975
|
className: "mt-4 flex items-center justify-end text-xs font-medium text-primary opacity-0 transition-opacity group-hover:opacity-100",
|
|
891
976
|
children: [
|
|
892
977
|
i("healthybowl.crops.planning.card.viewDetails", "View Details"),
|
|
893
978
|
" ",
|
|
894
|
-
/* @__PURE__ */
|
|
979
|
+
/* @__PURE__ */ T(C, { className: "ms-1 h-3 w-3" })
|
|
895
980
|
]
|
|
896
981
|
})
|
|
897
982
|
]
|
|
898
983
|
});
|
|
899
984
|
};
|
|
900
985
|
//#endregion
|
|
901
|
-
export {
|
|
986
|
+
export { L as CropPlanningPage };
|
|
902
987
|
|
|
903
988
|
//# sourceMappingURL=CropPlanningPage.js.map
|