@burdenoff/microfe-healthybowl 2026.812.9 → 2026.812.11
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/pages/satellite/SatelliteFieldDetailPage.js +182 -168
- package/dist/healthybowl/pages/satellite/SatelliteFieldDetailPage.js.map +1 -1
- package/dist/healthybowl/pages/satellite/SatelliteSettingsPage.js +100 -100
- package/dist/healthybowl/pages/satellite/SatelliteSettingsPage.js.map +1 -1
- package/dist/healthybowl/pages/satellite/ndviColors.js +29 -1
- package/dist/healthybowl/pages/satellite/ndviColors.js.map +1 -1
- package/dist/healthybowl/utils/fertility.js.map +1 -1
- package/package.json +1 -1
|
@@ -16,40 +16,40 @@ import { XAxis as f } from "../../../node_modules/recharts/es6/cartesian/XAxis.j
|
|
|
16
16
|
import { YAxis as p } from "../../../node_modules/recharts/es6/cartesian/YAxis.js";
|
|
17
17
|
import { ComposedChart as m } from "../../../node_modules/recharts/es6/chart/ComposedChart.js";
|
|
18
18
|
import { useSatelliteApi as te } from "./useSatelliteApi.js";
|
|
19
|
-
import { formatDate as
|
|
20
|
-
import { NdviHeatmapMap as
|
|
19
|
+
import { formatDate as h, formatNdvi as g, formatTonnes as _, healthBandVariant as ne, ndviSourceBadge as v, reasonLabel as y, severityVariant as b, trendArrow as x } from "./ndviColors.js";
|
|
20
|
+
import { NdviHeatmapMap as re } from "./NdviHeatmapMap.js";
|
|
21
21
|
import { YieldSimulationPanel as S } from "./YieldSimulationPanel.js";
|
|
22
22
|
import { NdviComparePanel as C } from "./NdviComparePanel.js";
|
|
23
23
|
import { YieldReportPanel as w } from "./YieldReportPanel.js";
|
|
24
|
-
import { useCallback as T, useEffect as
|
|
25
|
-
import { ArrowLeft as ie, Bug as
|
|
26
|
-
import { useNavigate as A, useParams as
|
|
27
|
-
import { jsx as
|
|
28
|
-
import { Button as
|
|
24
|
+
import { useCallback as T, useEffect as E, useMemo as D, useState as O } from "react";
|
|
25
|
+
import { ArrowLeft as ie, Bug as k, ClipboardList as ae, Minus as oe, RefreshCw as se, TrendingDown as ce, TrendingUp as le } from "lucide-react";
|
|
26
|
+
import { useNavigate as A, useParams as ue } from "react-router";
|
|
27
|
+
import { jsx as j, jsxs as M } from "react/jsx-runtime";
|
|
28
|
+
import { Button as N } from "@burdenoff/fe-libs/ui";
|
|
29
29
|
//#region src/healthybowl/pages/satellite/SatelliteFieldDetailPage.tsx
|
|
30
|
-
var
|
|
31
|
-
let { fieldId: s = "" } =
|
|
32
|
-
|
|
30
|
+
var P = () => {
|
|
31
|
+
let { fieldId: s = "" } = ue(), { api: c } = te(), l = A(), { buildPath: u } = e(), { toast: d } = o(), [f, p] = O(null), [m, _] = O(!0), [D, P] = O(null), [L, R] = O(!1), [z, B] = O("overview"), [V, H] = O(null), [U, W] = O(!1), G = T(async () => {
|
|
32
|
+
P(null);
|
|
33
33
|
try {
|
|
34
34
|
p(await c.getFieldCropHealth(s));
|
|
35
35
|
} catch (e) {
|
|
36
|
-
|
|
36
|
+
P(e instanceof Error ? e.message : "Failed to load field crop health.");
|
|
37
37
|
} finally {
|
|
38
|
-
|
|
38
|
+
_(!1);
|
|
39
39
|
}
|
|
40
40
|
}, [c, s]);
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}, [
|
|
44
|
-
let
|
|
45
|
-
|
|
41
|
+
E(() => {
|
|
42
|
+
G();
|
|
43
|
+
}, [G]);
|
|
44
|
+
let de = T(async () => {
|
|
45
|
+
R(!0);
|
|
46
46
|
try {
|
|
47
47
|
let e = (f?.timeline.length ?? 0) > 0, t = await c.refreshNdvi(s, e ? 0 : 5);
|
|
48
48
|
d({
|
|
49
49
|
title: "NDVI refreshed",
|
|
50
50
|
description: `${t.readingsCreated} reading(s), ${t.stressedZonesDetected} stressed zone(s) detected.`,
|
|
51
51
|
variant: "success"
|
|
52
|
-
}), await
|
|
52
|
+
}), await G();
|
|
53
53
|
} catch (e) {
|
|
54
54
|
d({
|
|
55
55
|
title: "Refresh failed",
|
|
@@ -57,23 +57,23 @@ var F = () => {
|
|
|
57
57
|
variant: "error"
|
|
58
58
|
});
|
|
59
59
|
} finally {
|
|
60
|
-
|
|
60
|
+
R(!1);
|
|
61
61
|
}
|
|
62
62
|
}, [
|
|
63
63
|
c,
|
|
64
64
|
s,
|
|
65
65
|
f,
|
|
66
66
|
d,
|
|
67
|
-
|
|
68
|
-
]),
|
|
69
|
-
if (
|
|
70
|
-
|
|
67
|
+
G
|
|
68
|
+
]), K = T(async (e) => {
|
|
69
|
+
if (V) {
|
|
70
|
+
W(!0);
|
|
71
71
|
try {
|
|
72
|
-
await c.escalateZone(
|
|
72
|
+
await c.escalateZone(V.id, e), d({
|
|
73
73
|
title: e === "PEST" ? "Pest issue created" : "Scouting task created",
|
|
74
|
-
description: `${
|
|
74
|
+
description: `${V.label} escalated. ${e === "PEST" ? "Track it under Pest Management." : "Track it under the field activity log."}`,
|
|
75
75
|
variant: "success"
|
|
76
|
-
}),
|
|
76
|
+
}), H(null), await G();
|
|
77
77
|
} catch (e) {
|
|
78
78
|
d({
|
|
79
79
|
title: "Escalation failed",
|
|
@@ -81,61 +81,61 @@ var F = () => {
|
|
|
81
81
|
variant: "error"
|
|
82
82
|
});
|
|
83
83
|
} finally {
|
|
84
|
-
|
|
84
|
+
W(!1);
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
87
|
}, [
|
|
88
88
|
c,
|
|
89
|
-
|
|
89
|
+
V,
|
|
90
90
|
d,
|
|
91
|
-
|
|
91
|
+
G
|
|
92
92
|
]);
|
|
93
|
-
if (m) return /* @__PURE__ */
|
|
94
|
-
if (
|
|
93
|
+
if (m) return /* @__PURE__ */ j(i, {});
|
|
94
|
+
if (D) return /* @__PURE__ */ j(ee, {
|
|
95
95
|
title: "Couldn't load field crop health",
|
|
96
|
-
description:
|
|
97
|
-
onRetry: () => void
|
|
96
|
+
description: D,
|
|
97
|
+
onRetry: () => void G()
|
|
98
98
|
});
|
|
99
99
|
if (!f) return null;
|
|
100
|
-
let { field:
|
|
101
|
-
return /* @__PURE__ */
|
|
100
|
+
let { field: q, healthScore: J, latestReading: Y, stressedZones: X, timeline: Z, yieldForecast: Q } = f, $ = Y ? v(Y.source, Y.cloudCoverPct) : null, fe = J.trendDirection === "UP" ? le : J.trendDirection === "DOWN" ? ce : oe;
|
|
101
|
+
return /* @__PURE__ */ M(t, {
|
|
102
102
|
title: "Satellite Crop Health & Yield Forecast",
|
|
103
|
-
description: `Field: ${
|
|
103
|
+
description: `Field: ${q.name} · ${q.areaAcres.toFixed(1)} ${q.unit}${q.cropName ? ` · ${q.cropName}${q.variety ? ` (${q.variety})` : ""}` : ""}${q.farmName ? ` · ${q.farmName}` : ""}`,
|
|
104
104
|
helpPrompt: "Explain this field's NDVI heatmap, stressed zones, health score and yield forecast.",
|
|
105
|
-
actions: /* @__PURE__ */
|
|
105
|
+
actions: /* @__PURE__ */ M("div", {
|
|
106
106
|
className: "flex flex-wrap items-center gap-2",
|
|
107
|
-
children: [/* @__PURE__ */ N
|
|
107
|
+
children: [/* @__PURE__ */ M(N, {
|
|
108
108
|
variant: "ghost",
|
|
109
109
|
size: "sm",
|
|
110
110
|
onClick: () => l(u("satellite")),
|
|
111
|
-
children: [/* @__PURE__ */
|
|
112
|
-
}), /* @__PURE__ */ N
|
|
111
|
+
children: [/* @__PURE__ */ j(ie, { className: "me-1.5 h-4 w-4" }), " All fields"]
|
|
112
|
+
}), /* @__PURE__ */ M(N, {
|
|
113
113
|
size: "sm",
|
|
114
|
-
onClick: () => void
|
|
115
|
-
disabled:
|
|
116
|
-
children: [/* @__PURE__ */
|
|
114
|
+
onClick: () => void de(),
|
|
115
|
+
disabled: L,
|
|
116
|
+
children: [/* @__PURE__ */ j(se, { className: `me-1.5 h-4 w-4 ${L ? "animate-spin" : ""}` }), " Refresh NDVI"]
|
|
117
117
|
})]
|
|
118
118
|
}),
|
|
119
119
|
children: [
|
|
120
|
-
/* @__PURE__ */
|
|
120
|
+
/* @__PURE__ */ j("div", {
|
|
121
121
|
className: "mb-4 flex flex-wrap gap-1 border-b border-border-subtle",
|
|
122
122
|
children: [
|
|
123
123
|
["overview", "Overview"],
|
|
124
124
|
["simulation", "Yield Simulation"],
|
|
125
125
|
["compare", "NDVI Comparison"],
|
|
126
126
|
["report", "Season Report"]
|
|
127
|
-
].map(([e, t]) => /* @__PURE__ */
|
|
128
|
-
onClick: () =>
|
|
129
|
-
className: `-mb-px border-b-2 px-3 py-2 text-sm font-medium transition-colors ${
|
|
127
|
+
].map(([e, t]) => /* @__PURE__ */ j("button", {
|
|
128
|
+
onClick: () => B(e),
|
|
129
|
+
className: `-mb-px border-b-2 px-3 py-2 text-sm font-medium transition-colors ${z === e ? "border-accent-teal text-text-primary" : "border-transparent text-text-secondary hover:text-text-primary"}`,
|
|
130
130
|
children: t
|
|
131
131
|
}, e))
|
|
132
132
|
}),
|
|
133
|
-
!
|
|
133
|
+
!q.hasBoundary && /* @__PURE__ */ M("div", {
|
|
134
134
|
className: "mb-4 rounded-lg border border-warning/40 bg-warning/10 p-3 text-sm text-text-primary",
|
|
135
135
|
children: [
|
|
136
136
|
"This field has no saved boundary yet, so no NDVI heatmap can be clipped to it. Draw the field boundary on the",
|
|
137
137
|
" ",
|
|
138
|
-
/* @__PURE__ */
|
|
138
|
+
/* @__PURE__ */ j("button", {
|
|
139
139
|
className: "underline",
|
|
140
140
|
onClick: () => l(u("field-map")),
|
|
141
141
|
children: "Field Map"
|
|
@@ -144,181 +144,195 @@ var F = () => {
|
|
|
144
144
|
"first."
|
|
145
145
|
]
|
|
146
146
|
}),
|
|
147
|
-
|
|
147
|
+
z === "overview" && /* @__PURE__ */ M("div", {
|
|
148
148
|
className: "grid grid-cols-1 gap-4 lg:grid-cols-3",
|
|
149
|
-
children: [/* @__PURE__ */
|
|
149
|
+
children: [/* @__PURE__ */ M("div", {
|
|
150
150
|
className: "lg:col-span-2",
|
|
151
|
-
children: [
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
151
|
+
children: [
|
|
152
|
+
Y && $ && /* @__PURE__ */ M("div", {
|
|
153
|
+
className: "mb-2 flex items-center justify-between gap-2",
|
|
154
|
+
children: [/* @__PURE__ */ M("span", {
|
|
155
|
+
className: "text-xs text-text-secondary",
|
|
156
|
+
children: ["Latest reading · ", h(Y.capturedDate)]
|
|
157
|
+
}), /* @__PURE__ */ j(n, {
|
|
158
|
+
label: $.label,
|
|
159
|
+
variant: $.variant,
|
|
160
|
+
dot: $.variant === "info"
|
|
161
|
+
})]
|
|
162
|
+
}),
|
|
163
|
+
/* @__PURE__ */ j(re, {
|
|
164
|
+
boundary: q.boundary,
|
|
165
|
+
grid: Y?.grid ?? null,
|
|
166
|
+
zones: X,
|
|
167
|
+
onZoneClick: (e) => {
|
|
168
|
+
let t = X.find((t) => t.id === e);
|
|
169
|
+
t && H(t);
|
|
170
|
+
}
|
|
171
|
+
}),
|
|
172
|
+
/* @__PURE__ */ j(r, {
|
|
173
|
+
title: "NDVI over time",
|
|
174
|
+
className: "mt-4",
|
|
175
|
+
children: Z.length === 0 ? /* @__PURE__ */ j("p", {
|
|
176
|
+
className: "py-6 text-center text-sm text-text-secondary",
|
|
177
|
+
children: "No readings yet — refresh NDVI."
|
|
178
|
+
}) : /* @__PURE__ */ j("div", {
|
|
179
|
+
className: "flex gap-3 overflow-x-auto pb-1",
|
|
180
|
+
children: Z.map((e) => /* @__PURE__ */ M("div", {
|
|
181
|
+
className: "flex min-w-[92px] flex-col items-center",
|
|
182
|
+
children: [
|
|
183
|
+
/* @__PURE__ */ j(F, {
|
|
184
|
+
band: e.healthBand,
|
|
185
|
+
ndvi: e.meanNdvi
|
|
186
|
+
}),
|
|
187
|
+
/* @__PURE__ */ j("span", {
|
|
188
|
+
className: "mt-1 text-xs font-medium text-text-primary",
|
|
189
|
+
children: g(e.meanNdvi)
|
|
190
|
+
}),
|
|
191
|
+
/* @__PURE__ */ j("span", {
|
|
192
|
+
className: "text-[11px] text-text-secondary",
|
|
193
|
+
children: h(e.capturedDate)
|
|
194
|
+
})
|
|
195
|
+
]
|
|
196
|
+
}, e.readingId))
|
|
197
|
+
})
|
|
184
198
|
})
|
|
185
|
-
|
|
186
|
-
}), /* @__PURE__ */
|
|
199
|
+
]
|
|
200
|
+
}), /* @__PURE__ */ M("div", {
|
|
187
201
|
className: "flex flex-col gap-4",
|
|
188
202
|
children: [
|
|
189
|
-
/* @__PURE__ */
|
|
203
|
+
/* @__PURE__ */ M(r, {
|
|
190
204
|
title: "Field Health Score",
|
|
191
|
-
children: [/* @__PURE__ */
|
|
205
|
+
children: [/* @__PURE__ */ M("div", {
|
|
192
206
|
className: "flex items-start justify-between",
|
|
193
|
-
children: [/* @__PURE__ */
|
|
207
|
+
children: [/* @__PURE__ */ M("div", { children: [/* @__PURE__ */ M("div", {
|
|
194
208
|
className: "text-4xl font-bold tabular-nums text-text-primary",
|
|
195
209
|
children: [
|
|
196
|
-
|
|
210
|
+
g(J.meanNdvi),
|
|
197
211
|
" ",
|
|
198
|
-
/* @__PURE__ */
|
|
212
|
+
/* @__PURE__ */ j("span", {
|
|
199
213
|
className: "text-lg font-medium text-text-secondary",
|
|
200
214
|
children: "NDVI"
|
|
201
215
|
})
|
|
202
216
|
]
|
|
203
|
-
}), /* @__PURE__ */
|
|
217
|
+
}), /* @__PURE__ */ j("div", {
|
|
204
218
|
className: "mt-1",
|
|
205
|
-
children: /* @__PURE__ */
|
|
206
|
-
label:
|
|
207
|
-
variant:
|
|
219
|
+
children: /* @__PURE__ */ j(n, {
|
|
220
|
+
label: J.healthLabel,
|
|
221
|
+
variant: ne(J.healthBand)
|
|
208
222
|
})
|
|
209
|
-
})] }), /* @__PURE__ */
|
|
210
|
-
className: `flex items-center gap-1 rounded-md px-2 py-1 text-sm ${
|
|
211
|
-
children: [/* @__PURE__ */
|
|
223
|
+
})] }), /* @__PURE__ */ M("div", {
|
|
224
|
+
className: `flex items-center gap-1 rounded-md px-2 py-1 text-sm ${J.trendDirection === "DOWN" ? "text-destructive" : J.trendDirection === "UP" ? "text-success" : "text-text-secondary"}`,
|
|
225
|
+
children: [/* @__PURE__ */ j(fe, { className: "h-4 w-4" }), J.readingsCount >= 2 ? `${Math.abs(J.trendPct).toFixed(1)}%` : "—"]
|
|
212
226
|
})]
|
|
213
|
-
}), /* @__PURE__ */
|
|
227
|
+
}), /* @__PURE__ */ j("p", {
|
|
214
228
|
className: "mt-2 text-xs text-text-secondary",
|
|
215
|
-
children:
|
|
229
|
+
children: J.readingsCount >= 2 ? `${x(J.trendDirection)} ${J.trendDelta >= 0 ? "+" : ""}${J.trendDelta.toFixed(2)} NDVI vs previous reading (${g(J.previousNdvi)})` : `From ${J.readingsCount} reading(s) — refresh again for a trend.`
|
|
216
230
|
})]
|
|
217
231
|
}),
|
|
218
|
-
/* @__PURE__ */
|
|
219
|
-
title: `Stressed Zones Detected: ${
|
|
220
|
-
children:
|
|
232
|
+
/* @__PURE__ */ j(r, {
|
|
233
|
+
title: `Stressed Zones Detected: ${X.length}`,
|
|
234
|
+
children: X.length === 0 ? /* @__PURE__ */ j("p", {
|
|
221
235
|
className: "py-2 text-sm text-text-secondary",
|
|
222
236
|
children: "No stressed zones on the latest reading. 🎉"
|
|
223
|
-
}) : /* @__PURE__ */
|
|
237
|
+
}) : /* @__PURE__ */ j("ul", {
|
|
224
238
|
className: "space-y-2",
|
|
225
|
-
children:
|
|
239
|
+
children: X.map((e) => /* @__PURE__ */ M("li", {
|
|
226
240
|
className: "rounded-lg border border-border-subtle p-2.5",
|
|
227
241
|
children: [
|
|
228
|
-
/* @__PURE__ */
|
|
242
|
+
/* @__PURE__ */ M("div", {
|
|
229
243
|
className: "flex items-center justify-between gap-2",
|
|
230
|
-
children: [/* @__PURE__ */
|
|
244
|
+
children: [/* @__PURE__ */ M("span", {
|
|
231
245
|
className: "flex items-center gap-2 text-sm font-medium text-text-primary",
|
|
232
246
|
children: [
|
|
233
|
-
/* @__PURE__ */
|
|
247
|
+
/* @__PURE__ */ j("span", { className: `h-2.5 w-2.5 rounded-full ${e.severity === "HIGH" ? "bg-destructive" : e.severity === "MEDIUM" ? "bg-warning" : "bg-warning/60"}` }),
|
|
234
248
|
e.label,
|
|
235
249
|
" — ",
|
|
236
|
-
|
|
250
|
+
y(e.reason)
|
|
237
251
|
]
|
|
238
|
-
}), /* @__PURE__ */
|
|
252
|
+
}), /* @__PURE__ */ j(n, {
|
|
239
253
|
label: e.status,
|
|
240
|
-
variant: e.status === "ESCALATED" ? "info" :
|
|
254
|
+
variant: e.status === "ESCALATED" ? "info" : b(e.severity)
|
|
241
255
|
})]
|
|
242
256
|
}),
|
|
243
|
-
/* @__PURE__ */
|
|
257
|
+
/* @__PURE__ */ M("p", {
|
|
244
258
|
className: "mt-1 text-xs text-text-secondary",
|
|
245
259
|
children: [
|
|
246
260
|
e.reasonDetail,
|
|
247
261
|
" · NDVI ",
|
|
248
|
-
|
|
262
|
+
g(e.zoneNdvi),
|
|
249
263
|
" (",
|
|
250
264
|
e.deltaPct,
|
|
251
265
|
"% vs field avg)"
|
|
252
266
|
]
|
|
253
267
|
}),
|
|
254
|
-
e.status !== "ESCALATED" && /* @__PURE__ */
|
|
268
|
+
e.status !== "ESCALATED" && /* @__PURE__ */ j("div", {
|
|
255
269
|
className: "mt-2 flex gap-2",
|
|
256
|
-
children: /* @__PURE__ */ N
|
|
270
|
+
children: /* @__PURE__ */ M(N, {
|
|
257
271
|
variant: "outline",
|
|
258
272
|
size: "sm",
|
|
259
|
-
onClick: () =>
|
|
260
|
-
children: [/* @__PURE__ */
|
|
273
|
+
onClick: () => H(e),
|
|
274
|
+
children: [/* @__PURE__ */ j(k, { className: "me-1 h-3.5 w-3.5" }), " Escalate"]
|
|
261
275
|
})
|
|
262
276
|
})
|
|
263
277
|
]
|
|
264
278
|
}, e.id))
|
|
265
279
|
})
|
|
266
280
|
}),
|
|
267
|
-
|
|
281
|
+
Q && /* @__PURE__ */ j(r, {
|
|
268
282
|
title: "Yield Forecast",
|
|
269
|
-
children: /* @__PURE__ */
|
|
283
|
+
children: /* @__PURE__ */ j(I, { forecast: Q })
|
|
270
284
|
})
|
|
271
285
|
]
|
|
272
286
|
})]
|
|
273
287
|
}),
|
|
274
|
-
|
|
288
|
+
z === "simulation" && /* @__PURE__ */ j(S, {
|
|
275
289
|
fieldId: s,
|
|
276
|
-
field:
|
|
277
|
-
baseForecast:
|
|
290
|
+
field: q,
|
|
291
|
+
baseForecast: Q
|
|
278
292
|
}),
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
293
|
+
z === "compare" && /* @__PURE__ */ j(C, { fieldId: s }),
|
|
294
|
+
z === "report" && /* @__PURE__ */ j(w, { data: f }),
|
|
295
|
+
V && /* @__PURE__ */ M(a, {
|
|
282
296
|
open: !0,
|
|
283
|
-
onClose: () =>
|
|
284
|
-
title: `Escalate ${
|
|
297
|
+
onClose: () => H(null),
|
|
298
|
+
title: `Escalate ${V.label}`,
|
|
285
299
|
children: [
|
|
286
|
-
/* @__PURE__ */
|
|
300
|
+
/* @__PURE__ */ j("p", {
|
|
287
301
|
className: "text-sm text-text-secondary",
|
|
288
|
-
children:
|
|
302
|
+
children: V.reasonDetail ?? y(V.reason)
|
|
289
303
|
}),
|
|
290
|
-
/* @__PURE__ */
|
|
304
|
+
/* @__PURE__ */ M("p", {
|
|
291
305
|
className: "mt-1 text-xs text-text-secondary",
|
|
292
306
|
children: [
|
|
293
307
|
"NDVI ",
|
|
294
|
-
|
|
308
|
+
g(V.zoneNdvi),
|
|
295
309
|
" (",
|
|
296
|
-
|
|
310
|
+
V.deltaPct,
|
|
297
311
|
"% vs field average)."
|
|
298
312
|
]
|
|
299
313
|
}),
|
|
300
|
-
/* @__PURE__ */
|
|
314
|
+
/* @__PURE__ */ M("div", {
|
|
301
315
|
className: "mt-4 flex flex-col gap-2 sm:flex-row",
|
|
302
|
-
children: [/* @__PURE__ */ N
|
|
316
|
+
children: [/* @__PURE__ */ M(N, {
|
|
303
317
|
className: "flex-1",
|
|
304
|
-
onClick: () => void
|
|
305
|
-
disabled:
|
|
306
|
-
children: [/* @__PURE__ */
|
|
307
|
-
}), /* @__PURE__ */ N
|
|
318
|
+
onClick: () => void K("PEST"),
|
|
319
|
+
disabled: U,
|
|
320
|
+
children: [/* @__PURE__ */ j(k, { className: "me-1.5 h-4 w-4" }), " Create Pest Issue"]
|
|
321
|
+
}), /* @__PURE__ */ M(N, {
|
|
308
322
|
variant: "outline",
|
|
309
323
|
className: "flex-1",
|
|
310
|
-
onClick: () => void
|
|
311
|
-
disabled:
|
|
312
|
-
children: [/* @__PURE__ */
|
|
324
|
+
onClick: () => void K("TASK"),
|
|
325
|
+
disabled: U,
|
|
326
|
+
children: [/* @__PURE__ */ j(ae, { className: "me-1.5 h-4 w-4" }), " Create Task"]
|
|
313
327
|
})]
|
|
314
328
|
})
|
|
315
329
|
]
|
|
316
330
|
})
|
|
317
331
|
]
|
|
318
332
|
});
|
|
319
|
-
},
|
|
333
|
+
}, F = ({ band: e, ndvi: t }) => {
|
|
320
334
|
let n = e === "STRESSED" ? "#d73027" : e === "BELOW_AVERAGE" ? "#fee08b" : e === "EXCELLENT" ? "#1a9850" : "#66bd63";
|
|
321
|
-
return /* @__PURE__ */
|
|
335
|
+
return /* @__PURE__ */ j("div", {
|
|
322
336
|
className: "h-14 w-full rounded-md ring-1 ring-border-subtle",
|
|
323
337
|
style: {
|
|
324
338
|
background: `linear-gradient(135deg, ${n}, ${n}cc)`,
|
|
@@ -326,17 +340,17 @@ var F = () => {
|
|
|
326
340
|
},
|
|
327
341
|
"aria-hidden": !0
|
|
328
342
|
});
|
|
329
|
-
},
|
|
330
|
-
let t =
|
|
343
|
+
}, I = ({ forecast: e }) => {
|
|
344
|
+
let t = D(() => (e?.trajectory ?? []).map((e) => ({
|
|
331
345
|
label: e.label,
|
|
332
346
|
simulated: e.simulated,
|
|
333
347
|
band: [e.lower, e.upper]
|
|
334
348
|
})), [e]);
|
|
335
|
-
return e ? /* @__PURE__ */
|
|
336
|
-
/* @__PURE__ */
|
|
349
|
+
return e ? /* @__PURE__ */ M("div", { children: [
|
|
350
|
+
/* @__PURE__ */ j(c, {
|
|
337
351
|
width: "100%",
|
|
338
352
|
height: 130,
|
|
339
|
-
children: /* @__PURE__ */
|
|
353
|
+
children: /* @__PURE__ */ M(m, {
|
|
340
354
|
data: t,
|
|
341
355
|
margin: {
|
|
342
356
|
top: 5,
|
|
@@ -345,37 +359,37 @@ var F = () => {
|
|
|
345
359
|
bottom: 0
|
|
346
360
|
},
|
|
347
361
|
children: [
|
|
348
|
-
/* @__PURE__ */
|
|
362
|
+
/* @__PURE__ */ j("defs", { children: /* @__PURE__ */ M("linearGradient", {
|
|
349
363
|
id: "yieldBand",
|
|
350
364
|
x1: "0",
|
|
351
365
|
y1: "0",
|
|
352
366
|
x2: "0",
|
|
353
367
|
y2: "1",
|
|
354
|
-
children: [/* @__PURE__ */
|
|
368
|
+
children: [/* @__PURE__ */ j("stop", {
|
|
355
369
|
offset: "5%",
|
|
356
370
|
stopColor: "var(--color-success)",
|
|
357
371
|
stopOpacity: .28
|
|
358
|
-
}), /* @__PURE__ */
|
|
372
|
+
}), /* @__PURE__ */ j("stop", {
|
|
359
373
|
offset: "95%",
|
|
360
374
|
stopColor: "var(--color-success)",
|
|
361
375
|
stopOpacity: .04
|
|
362
376
|
})]
|
|
363
377
|
}) }),
|
|
364
|
-
/* @__PURE__ */
|
|
378
|
+
/* @__PURE__ */ j(l, {
|
|
365
379
|
strokeDasharray: "3 3",
|
|
366
380
|
className: "stroke-border"
|
|
367
381
|
}),
|
|
368
|
-
/* @__PURE__ */
|
|
382
|
+
/* @__PURE__ */ j(f, {
|
|
369
383
|
dataKey: "label",
|
|
370
384
|
className: "text-[10px]",
|
|
371
385
|
tick: { fill: "currentColor" }
|
|
372
386
|
}),
|
|
373
|
-
/* @__PURE__ */
|
|
387
|
+
/* @__PURE__ */ j(p, {
|
|
374
388
|
className: "text-[10px]",
|
|
375
389
|
tick: { fill: "currentColor" },
|
|
376
390
|
width: 28
|
|
377
391
|
}),
|
|
378
|
-
/* @__PURE__ */
|
|
392
|
+
/* @__PURE__ */ j(s, {
|
|
379
393
|
contentStyle: {
|
|
380
394
|
backgroundColor: "var(--color-card)",
|
|
381
395
|
border: "1px solid var(--color-border)",
|
|
@@ -383,13 +397,13 @@ var F = () => {
|
|
|
383
397
|
},
|
|
384
398
|
labelStyle: { color: "var(--color-foreground)" }
|
|
385
399
|
}),
|
|
386
|
-
/* @__PURE__ */
|
|
400
|
+
/* @__PURE__ */ j(d, {
|
|
387
401
|
dataKey: "band",
|
|
388
402
|
stroke: "none",
|
|
389
403
|
fill: "url(#yieldBand)",
|
|
390
404
|
isAnimationActive: !1
|
|
391
405
|
}),
|
|
392
|
-
/* @__PURE__ */
|
|
406
|
+
/* @__PURE__ */ j(u, {
|
|
393
407
|
dataKey: "simulated",
|
|
394
408
|
stroke: "var(--color-success)",
|
|
395
409
|
strokeWidth: 2,
|
|
@@ -399,39 +413,39 @@ var F = () => {
|
|
|
399
413
|
]
|
|
400
414
|
})
|
|
401
415
|
}),
|
|
402
|
-
/* @__PURE__ */
|
|
416
|
+
/* @__PURE__ */ M("div", {
|
|
403
417
|
className: "mt-2 flex items-end justify-between",
|
|
404
|
-
children: [/* @__PURE__ */
|
|
418
|
+
children: [/* @__PURE__ */ M("div", { children: [/* @__PURE__ */ M("div", {
|
|
405
419
|
className: "text-3xl font-bold tabular-nums text-text-primary",
|
|
406
420
|
children: [
|
|
407
|
-
|
|
421
|
+
_(e.estimatedTonnes),
|
|
408
422
|
" ",
|
|
409
|
-
/* @__PURE__ */
|
|
423
|
+
/* @__PURE__ */ j("span", {
|
|
410
424
|
className: "text-base font-medium text-text-secondary",
|
|
411
425
|
children: "t"
|
|
412
426
|
})
|
|
413
427
|
]
|
|
414
|
-
}), /* @__PURE__ */
|
|
428
|
+
}), /* @__PURE__ */ M("div", {
|
|
415
429
|
className: "text-xs text-text-secondary",
|
|
416
430
|
children: [
|
|
417
431
|
"± ",
|
|
418
|
-
|
|
432
|
+
_(e.confidenceBand),
|
|
419
433
|
" t · ",
|
|
420
434
|
e.confidenceLabel.toLowerCase(),
|
|
421
435
|
" confidence"
|
|
422
436
|
]
|
|
423
|
-
})] }), e.harvestWindowLabel && /* @__PURE__ */
|
|
437
|
+
})] }), e.harvestWindowLabel && /* @__PURE__ */ M("div", {
|
|
424
438
|
className: "text-end",
|
|
425
|
-
children: [/* @__PURE__ */
|
|
439
|
+
children: [/* @__PURE__ */ j("div", {
|
|
426
440
|
className: "text-xs text-text-secondary",
|
|
427
441
|
children: "Harvest window"
|
|
428
|
-
}), /* @__PURE__ */
|
|
442
|
+
}), /* @__PURE__ */ j("div", {
|
|
429
443
|
className: "text-sm font-medium text-text-primary",
|
|
430
444
|
children: e.harvestWindowLabel
|
|
431
445
|
})]
|
|
432
446
|
})]
|
|
433
447
|
}),
|
|
434
|
-
/* @__PURE__ */
|
|
448
|
+
/* @__PURE__ */ M("p", {
|
|
435
449
|
className: "mt-2 text-[11px] leading-snug text-text-secondary",
|
|
436
450
|
children: [
|
|
437
451
|
"Estimate only — not a guarantee. ",
|
|
@@ -442,6 +456,6 @@ var F = () => {
|
|
|
442
456
|
] }) : null;
|
|
443
457
|
};
|
|
444
458
|
//#endregion
|
|
445
|
-
export {
|
|
459
|
+
export { P as SatelliteFieldDetailPage };
|
|
446
460
|
|
|
447
461
|
//# sourceMappingURL=SatelliteFieldDetailPage.js.map
|