@burdenoff/microfe-healthybowl 2026.727.2 → 2026.727.4
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/HomePage.js +53 -52
- package/dist/healthybowl/pages/HomePage.js.map +1 -1
- package/dist/healthybowl/pages/pest-management/AiPestDetectionPage.js +289 -262
- package/dist/healthybowl/pages/pest-management/AiPestDetectionPage.js.map +1 -1
- package/dist/healthybowl/utils/weatherPresence.js +8 -0
- package/dist/healthybowl/utils/weatherPresence.js.map +1 -0
- package/dist/utils/assistantAttachments.js +38 -37
- package/dist/utils/assistantAttachments.js.map +1 -1
- package/dist/utils/gatewayLimits.js +6 -0
- package/dist/utils/gatewayLimits.js.map +1 -0
- package/package.json +1 -1
|
@@ -5,19 +5,31 @@ import { EmptyState as r } from "../../components/EmptyState.js";
|
|
|
5
5
|
import { ErrorState as i } from "../../components/ErrorState.js";
|
|
6
6
|
import { ToastContainer as a } from "../../components/Toast.js";
|
|
7
7
|
import { Modal as o } from "../../components/Modal.js";
|
|
8
|
-
import { useToast as
|
|
9
|
-
import
|
|
8
|
+
import { useToast as s } from "../../hooks/useToast.js";
|
|
9
|
+
import "../../../utils/gatewayLimits.js";
|
|
10
|
+
import { downscaleImage as c } from "../../utils/imageDownscale.js";
|
|
10
11
|
import "../../components/index.js";
|
|
11
|
-
import { useHealthyBowlData as
|
|
12
|
-
import { resolvePlantScanImageUrl as
|
|
13
|
-
import { useCallback as
|
|
14
|
-
import { useI18n as
|
|
15
|
-
import { AlertTriangle as
|
|
16
|
-
import { Fragment as
|
|
17
|
-
import { Button as
|
|
18
|
-
import { useSaveToFiles as
|
|
12
|
+
import { useHealthyBowlData as l } from "../../hooks/useHealthyBowlData.js";
|
|
13
|
+
import { resolvePlantScanImageUrl as u, usePlantScans as d } from "../../hooks/usePlantScans.js";
|
|
14
|
+
import { useCallback as f, useEffect as p, useMemo as m, useRef as h, useState as g } from "react";
|
|
15
|
+
import { useI18n as ee } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
16
|
+
import { AlertTriangle as _, Camera as te, ClipboardList as v, Leaf as y, Loader2 as b, ScanSearch as x, Sparkles as S, Upload as ne } from "lucide-react";
|
|
17
|
+
import { Fragment as C, jsx as w, jsxs as T } from "react/jsx-runtime";
|
|
18
|
+
import { Button as E, Select as D, SelectContent as O, SelectItem as k, SelectTrigger as A, SelectValue as j } from "@burdenoff/fe-libs/ui";
|
|
19
|
+
import { useSaveToFiles as re } from "@burdenoff/fe-libs/storage";
|
|
19
20
|
//#region src/healthybowl/pages/pest-management/AiPestDetectionPage.tsx
|
|
20
|
-
var
|
|
21
|
+
var ie = 10 * 1024 * 1024, ae = {
|
|
22
|
+
maxDim: 768,
|
|
23
|
+
quality: .6
|
|
24
|
+
};
|
|
25
|
+
function M(e) {
|
|
26
|
+
let t = e.indexOf(",");
|
|
27
|
+
return t >= 0 ? e.slice(t + 1) : e;
|
|
28
|
+
}
|
|
29
|
+
function N(e) {
|
|
30
|
+
return e.inlineDataUrl ? M(e.inlineDataUrl) : e.base64;
|
|
31
|
+
}
|
|
32
|
+
var P = "w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-tertiary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]", F = {
|
|
21
33
|
LOW: "bg-status-success-bgSubtle text-status-success-text",
|
|
22
34
|
MEDIUM: "bg-status-warning-bgSubtle text-status-warning-text",
|
|
23
35
|
MODERATE: "bg-status-warning-bgSubtle text-status-warning-text",
|
|
@@ -25,76 +37,91 @@ var j = "w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 t
|
|
|
25
37
|
CRITICAL: "bg-status-error-bg/10 text-status-error-text",
|
|
26
38
|
NONE: "bg-bg-sunken text-text-secondary"
|
|
27
39
|
};
|
|
28
|
-
function
|
|
40
|
+
function I(e, t) {
|
|
29
41
|
let n = (e ?? "").toUpperCase();
|
|
30
42
|
return n === "MEDIUM" ? t("healthybowl.plantScan.severity.moderate", "Moderate") : n === "LOW" ? t("healthybowl.plantScan.severity.low", "Low") : n === "HIGH" ? t("healthybowl.plantScan.severity.high", "High") : n === "CRITICAL" ? t("healthybowl.plantScan.severity.critical", "Critical") : t("healthybowl.plantScan.severity.none", "None");
|
|
31
43
|
}
|
|
32
|
-
function
|
|
33
|
-
return
|
|
44
|
+
function L(e) {
|
|
45
|
+
return F[(e ?? "NONE").toUpperCase()] ?? F.NONE;
|
|
34
46
|
}
|
|
35
|
-
function
|
|
36
|
-
let { workspaceId: r } = e(), [i, a] =
|
|
37
|
-
return
|
|
47
|
+
function oe({ fileId: t, alt: n }) {
|
|
48
|
+
let { workspaceId: r } = e(), [i, a] = g(null);
|
|
49
|
+
return p(() => {
|
|
38
50
|
let e = !0;
|
|
39
|
-
return t && r &&
|
|
51
|
+
return t && r && u(t, r).then((t) => {
|
|
40
52
|
e && a(t);
|
|
41
53
|
}), () => {
|
|
42
54
|
e = !1;
|
|
43
55
|
};
|
|
44
|
-
}, [t, r]), /* @__PURE__ */
|
|
56
|
+
}, [t, r]), /* @__PURE__ */ w("div", {
|
|
45
57
|
className: "h-12 w-12 shrink-0 overflow-hidden rounded-lg bg-bg-sunken",
|
|
46
|
-
children: i ? /* @__PURE__ */
|
|
58
|
+
children: i ? /* @__PURE__ */ w("img", {
|
|
47
59
|
src: i,
|
|
48
60
|
alt: n,
|
|
49
61
|
className: "h-full w-full object-cover",
|
|
50
62
|
loading: "lazy"
|
|
51
|
-
}) : /* @__PURE__ */
|
|
63
|
+
}) : /* @__PURE__ */ w("div", {
|
|
52
64
|
className: "flex h-full w-full items-center justify-center text-text-tertiary",
|
|
53
|
-
children: /* @__PURE__ */
|
|
65
|
+
children: /* @__PURE__ */ w(y, { size: 18 })
|
|
54
66
|
})
|
|
55
67
|
});
|
|
56
68
|
}
|
|
57
|
-
function
|
|
58
|
-
return /* @__PURE__ */
|
|
69
|
+
function R({ value: e }) {
|
|
70
|
+
return /* @__PURE__ */ w("div", {
|
|
59
71
|
className: "h-2 w-24 overflow-hidden rounded-full bg-bg-sunken",
|
|
60
72
|
"aria-hidden": !0,
|
|
61
|
-
children: /* @__PURE__ */
|
|
73
|
+
children: /* @__PURE__ */ w("div", {
|
|
62
74
|
className: "h-full rounded-full bg-action-primary-bg",
|
|
63
75
|
style: { width: `${Math.max(0, Math.min(100, Math.round(e)))}%` }
|
|
64
76
|
})
|
|
65
77
|
});
|
|
66
78
|
}
|
|
67
|
-
function
|
|
68
|
-
let { t: e } =
|
|
79
|
+
function z() {
|
|
80
|
+
let { t: e } = ee(), { fields: o, crops: u } = l(), { data: p, loading: _, error: y, refetch: M, diagnose: P, logToPest: F } = d(), { save: I } = re(), { toasts: L, toast: R, dismiss: z } = s(), B = h(null), [V, H] = g(null), [U, W] = g(""), [G, K] = g(""), [q, le] = g(""), [J, Y] = g(!1), [X, Z] = g(null), [ue, Q] = g(!1), de = m(() => o.find((e) => e.id === U), [o, U]), fe = m(() => u.find((e) => e.id === G), [u, G]), pe = m(() => U ? u.filter((e) => e.field === U) : u, [u, U]), me = f(async (t) => {
|
|
69
81
|
if (t) try {
|
|
70
|
-
|
|
82
|
+
let n = await c(t, { inline: ae });
|
|
83
|
+
if (!n.downscaled && n.blob.size > ie) {
|
|
84
|
+
R({
|
|
85
|
+
title: e("healthybowl.plantScan.tooLarge", "That photo is too large to analyse. Try a JPEG or PNG, or a smaller photo."),
|
|
86
|
+
variant: "error"
|
|
87
|
+
});
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
if (N(n).length > 229376) {
|
|
91
|
+
R({
|
|
92
|
+
title: e("healthybowl.plantScan.tooLargeToSend", "That photo is too detailed to send for analysis. Try a smaller photo."),
|
|
93
|
+
variant: "error"
|
|
94
|
+
});
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
H(n), Z(null);
|
|
71
98
|
} catch {
|
|
72
|
-
|
|
99
|
+
R({
|
|
73
100
|
title: e("healthybowl.plantScan.readError", "Could not read that image. Try another photo."),
|
|
74
101
|
variant: "error"
|
|
75
102
|
});
|
|
76
103
|
}
|
|
77
|
-
}, [e,
|
|
78
|
-
if (!
|
|
79
|
-
|
|
104
|
+
}, [e, R]), he = f(async () => {
|
|
105
|
+
if (!V) {
|
|
106
|
+
R({
|
|
80
107
|
title: e("healthybowl.plantScan.needPhoto", "Take or upload a plant photo first."),
|
|
81
108
|
variant: "error"
|
|
82
109
|
});
|
|
83
110
|
return;
|
|
84
111
|
}
|
|
85
|
-
|
|
112
|
+
Y(!0);
|
|
86
113
|
try {
|
|
87
114
|
let t = null;
|
|
88
115
|
try {
|
|
89
|
-
t = (await
|
|
116
|
+
t = (await I({
|
|
90
117
|
source: {
|
|
91
118
|
kind: "blob",
|
|
92
|
-
filename:
|
|
93
|
-
mimeType:
|
|
119
|
+
filename: V.filename,
|
|
120
|
+
mimeType: V.mimeType,
|
|
94
121
|
getBlob: async () => ({
|
|
95
|
-
blob:
|
|
96
|
-
filename:
|
|
97
|
-
mimeType:
|
|
122
|
+
blob: V.blob,
|
|
123
|
+
filename: V.filename,
|
|
124
|
+
mimeType: V.mimeType
|
|
98
125
|
})
|
|
99
126
|
},
|
|
100
127
|
folderPath: "/HealthyBowl/PestScan"
|
|
@@ -102,243 +129,243 @@ function I() {
|
|
|
102
129
|
} catch {
|
|
103
130
|
t = null;
|
|
104
131
|
}
|
|
105
|
-
let n = await
|
|
106
|
-
fieldId:
|
|
107
|
-
fieldName:
|
|
108
|
-
cropName:
|
|
132
|
+
let n = await P({
|
|
133
|
+
fieldId: U || null,
|
|
134
|
+
fieldName: de?.name ?? null,
|
|
135
|
+
cropName: fe?.name ?? null,
|
|
109
136
|
photoFileId: t,
|
|
110
|
-
imageBase64:
|
|
111
|
-
notes:
|
|
137
|
+
imageBase64: N(V),
|
|
138
|
+
notes: q.trim() || null
|
|
112
139
|
});
|
|
113
|
-
|
|
140
|
+
Z(n), await M(), R({
|
|
114
141
|
title: e("healthybowl.plantScan.done", "Diagnosis ready"),
|
|
115
142
|
description: n.topDiagnosis ?? "",
|
|
116
143
|
variant: "success"
|
|
117
144
|
});
|
|
118
145
|
} catch (t) {
|
|
119
|
-
|
|
146
|
+
R({
|
|
120
147
|
title: e("healthybowl.plantScan.failed", "Diagnosis failed"),
|
|
121
148
|
description: t instanceof Error ? t.message : String(t),
|
|
122
149
|
variant: "error"
|
|
123
150
|
});
|
|
124
151
|
} finally {
|
|
125
|
-
|
|
152
|
+
Y(!1);
|
|
126
153
|
}
|
|
127
154
|
}, [
|
|
128
|
-
z,
|
|
129
|
-
P,
|
|
130
|
-
M,
|
|
131
155
|
V,
|
|
132
|
-
Z,
|
|
133
|
-
Q,
|
|
134
|
-
G,
|
|
135
|
-
j,
|
|
136
156
|
I,
|
|
157
|
+
P,
|
|
158
|
+
U,
|
|
159
|
+
de,
|
|
160
|
+
fe,
|
|
161
|
+
q,
|
|
162
|
+
M,
|
|
163
|
+
R,
|
|
137
164
|
e
|
|
138
|
-
]), $ =
|
|
139
|
-
return /* @__PURE__ */
|
|
165
|
+
]), $ = p?.stats, ge = p?.scans ?? [];
|
|
166
|
+
return /* @__PURE__ */ T(n, {
|
|
140
167
|
title: e("healthybowl.plantScan.title", "AI Pest & Disease Detection"),
|
|
141
168
|
titleAccent: e("healthybowl.plantScan.titleAccent", "AI"),
|
|
142
169
|
description: e("healthybowl.plantScan.subtitle", "Photograph a plant — AI names the likely pest or disease, with organic-safe next steps."),
|
|
143
170
|
hero: !0,
|
|
144
171
|
purpose: e("healthybowl.plantScan.purpose", "Snap or upload a leaf photo and get an AI second opinion — the most likely pest or disease with a confidence score, ranked alternatives, and organic-safe actions. Log it to Pest Issues in one tap to start tracking it."),
|
|
145
|
-
actions:
|
|
146
|
-
onClick: () =>
|
|
172
|
+
actions: X ? /* @__PURE__ */ T(E, {
|
|
173
|
+
onClick: () => Q(!0),
|
|
147
174
|
className: "gap-2",
|
|
148
175
|
children: [
|
|
149
|
-
/* @__PURE__ */
|
|
176
|
+
/* @__PURE__ */ w(v, { size: 16 }),
|
|
150
177
|
" ",
|
|
151
178
|
e("healthybowl.plantScan.logToIssues", "Log to Pest Issues")
|
|
152
179
|
]
|
|
153
180
|
}) : void 0,
|
|
154
181
|
children: [
|
|
155
|
-
/* @__PURE__ */
|
|
156
|
-
ref:
|
|
182
|
+
/* @__PURE__ */ w("input", {
|
|
183
|
+
ref: B,
|
|
157
184
|
type: "file",
|
|
158
185
|
accept: "image/*",
|
|
159
186
|
capture: "environment",
|
|
160
187
|
className: "hidden",
|
|
161
|
-
onChange: (e) => void
|
|
188
|
+
onChange: (e) => void me(e.target.files?.[0])
|
|
162
189
|
}),
|
|
163
|
-
/* @__PURE__ */
|
|
190
|
+
/* @__PURE__ */ T("div", {
|
|
164
191
|
className: "grid grid-cols-1 gap-6 lg:grid-cols-3",
|
|
165
192
|
children: [
|
|
166
|
-
/* @__PURE__ */
|
|
193
|
+
/* @__PURE__ */ T("section", {
|
|
167
194
|
className: "rounded-2xl border border-border-subtle bg-bg-surface p-5",
|
|
168
195
|
children: [
|
|
169
|
-
/* @__PURE__ */
|
|
196
|
+
/* @__PURE__ */ w("h2", {
|
|
170
197
|
className: "mb-4 text-lg font-semibold text-text-primary",
|
|
171
198
|
children: e("healthybowl.plantScan.scanCard", "Scan a Plant")
|
|
172
199
|
}),
|
|
173
|
-
/* @__PURE__ */
|
|
200
|
+
/* @__PURE__ */ w("div", {
|
|
174
201
|
className: "mb-4 flex aspect-square w-full items-center justify-center overflow-hidden rounded-xl bg-bg-sunken",
|
|
175
|
-
children:
|
|
176
|
-
src:
|
|
202
|
+
children: V ? /* @__PURE__ */ w("img", {
|
|
203
|
+
src: V.dataUrl,
|
|
177
204
|
alt: e("healthybowl.plantScan.previewAlt", "Plant to diagnose"),
|
|
178
205
|
className: "h-full w-full object-cover"
|
|
179
|
-
}) : /* @__PURE__ */
|
|
206
|
+
}) : /* @__PURE__ */ T("div", {
|
|
180
207
|
className: "flex flex-col items-center gap-2 p-6 text-center text-text-tertiary",
|
|
181
|
-
children: [/* @__PURE__ */
|
|
208
|
+
children: [/* @__PURE__ */ w(x, { size: 40 }), /* @__PURE__ */ w("span", {
|
|
182
209
|
className: "text-sm",
|
|
183
210
|
children: e("healthybowl.plantScan.previewHint", "Take or upload a photo of the affected leaf")
|
|
184
211
|
})]
|
|
185
212
|
})
|
|
186
213
|
}),
|
|
187
|
-
/* @__PURE__ */
|
|
214
|
+
/* @__PURE__ */ T("div", {
|
|
188
215
|
className: "grid grid-cols-2 gap-3",
|
|
189
|
-
children: [/* @__PURE__ */
|
|
216
|
+
children: [/* @__PURE__ */ T(E, {
|
|
190
217
|
variant: "outline",
|
|
191
218
|
className: "gap-2",
|
|
192
|
-
onClick: () =>
|
|
193
|
-
disabled:
|
|
219
|
+
onClick: () => B.current?.click(),
|
|
220
|
+
disabled: J,
|
|
194
221
|
children: [
|
|
195
|
-
/* @__PURE__ */
|
|
222
|
+
/* @__PURE__ */ w(te, { size: 16 }),
|
|
196
223
|
" ",
|
|
197
224
|
e("healthybowl.plantScan.takePhoto", "Take Photo")
|
|
198
225
|
]
|
|
199
|
-
}), /* @__PURE__ */
|
|
226
|
+
}), /* @__PURE__ */ T(E, {
|
|
200
227
|
variant: "outline",
|
|
201
228
|
className: "gap-2",
|
|
202
|
-
onClick: () =>
|
|
203
|
-
disabled:
|
|
229
|
+
onClick: () => B.current?.click(),
|
|
230
|
+
disabled: J,
|
|
204
231
|
children: [
|
|
205
|
-
/* @__PURE__ */
|
|
232
|
+
/* @__PURE__ */ w(ne, { size: 16 }),
|
|
206
233
|
" ",
|
|
207
234
|
e("healthybowl.plantScan.upload", "Upload Image")
|
|
208
235
|
]
|
|
209
236
|
})]
|
|
210
237
|
}),
|
|
211
|
-
/* @__PURE__ */
|
|
238
|
+
/* @__PURE__ */ T("div", {
|
|
212
239
|
className: "mt-4 grid grid-cols-1 gap-3 sm:grid-cols-2",
|
|
213
|
-
children: [/* @__PURE__ */
|
|
240
|
+
children: [/* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("label", {
|
|
214
241
|
className: "mb-1 block text-xs font-medium text-text-secondary",
|
|
215
242
|
children: e("healthybowl.plantScan.field", "Field")
|
|
216
|
-
}), /* @__PURE__ */
|
|
217
|
-
value:
|
|
243
|
+
}), /* @__PURE__ */ T(D, {
|
|
244
|
+
value: U,
|
|
218
245
|
onValueChange: (e) => {
|
|
219
|
-
|
|
246
|
+
W(e), K("");
|
|
220
247
|
},
|
|
221
|
-
children: [/* @__PURE__ */
|
|
248
|
+
children: [/* @__PURE__ */ w(A, {
|
|
222
249
|
className: "w-full",
|
|
223
|
-
children: /* @__PURE__ */
|
|
224
|
-
}), /* @__PURE__ */
|
|
250
|
+
children: /* @__PURE__ */ w(j, { placeholder: e("healthybowl.plantScan.selectField", "Select field") })
|
|
251
|
+
}), /* @__PURE__ */ w(O, { children: o.map((e) => /* @__PURE__ */ w(k, {
|
|
225
252
|
value: e.id,
|
|
226
253
|
children: e.name
|
|
227
254
|
}, e.id)) })]
|
|
228
|
-
})] }), /* @__PURE__ */
|
|
255
|
+
})] }), /* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("label", {
|
|
229
256
|
className: "mb-1 block text-xs font-medium text-text-secondary",
|
|
230
257
|
children: e("healthybowl.plantScan.crop", "Crop")
|
|
231
|
-
}), /* @__PURE__ */
|
|
232
|
-
value:
|
|
233
|
-
onValueChange:
|
|
234
|
-
children: [/* @__PURE__ */
|
|
258
|
+
}), /* @__PURE__ */ T(D, {
|
|
259
|
+
value: G,
|
|
260
|
+
onValueChange: K,
|
|
261
|
+
children: [/* @__PURE__ */ w(A, {
|
|
235
262
|
className: "w-full",
|
|
236
|
-
children: /* @__PURE__ */
|
|
237
|
-
}), /* @__PURE__ */
|
|
263
|
+
children: /* @__PURE__ */ w(j, { placeholder: e("healthybowl.plantScan.selectCrop", "Select crop") })
|
|
264
|
+
}), /* @__PURE__ */ w(O, { children: pe.map((e) => /* @__PURE__ */ w(k, {
|
|
238
265
|
value: e.id,
|
|
239
266
|
children: e.name
|
|
240
267
|
}, e.id)) })]
|
|
241
268
|
})] })]
|
|
242
269
|
}),
|
|
243
|
-
/* @__PURE__ */
|
|
270
|
+
/* @__PURE__ */ T("div", {
|
|
244
271
|
className: "mt-3",
|
|
245
|
-
children: [/* @__PURE__ */
|
|
272
|
+
children: [/* @__PURE__ */ w("label", {
|
|
246
273
|
className: "mb-1 block text-xs font-medium text-text-secondary",
|
|
247
274
|
children: e("healthybowl.plantScan.notes", "Symptoms (optional)")
|
|
248
|
-
}), /* @__PURE__ */
|
|
249
|
-
value:
|
|
250
|
-
onChange: (e) =>
|
|
275
|
+
}), /* @__PURE__ */ w("textarea", {
|
|
276
|
+
value: q,
|
|
277
|
+
onChange: (e) => le(e.target.value),
|
|
251
278
|
rows: 2,
|
|
252
279
|
placeholder: e("healthybowl.plantScan.notesPlaceholder", "e.g. brown spots spreading on lower leaves"),
|
|
253
280
|
className: "w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-tertiary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
|
|
254
281
|
})]
|
|
255
282
|
}),
|
|
256
|
-
/* @__PURE__ */
|
|
257
|
-
onClick: () => void
|
|
258
|
-
disabled: !
|
|
283
|
+
/* @__PURE__ */ w(E, {
|
|
284
|
+
onClick: () => void he(),
|
|
285
|
+
disabled: !V || J,
|
|
259
286
|
className: "mt-4 w-full gap-2",
|
|
260
|
-
children:
|
|
261
|
-
/* @__PURE__ */
|
|
287
|
+
children: J ? /* @__PURE__ */ T(C, { children: [
|
|
288
|
+
/* @__PURE__ */ w(b, {
|
|
262
289
|
size: 16,
|
|
263
290
|
className: "animate-spin"
|
|
264
291
|
}),
|
|
265
292
|
" ",
|
|
266
293
|
e("healthybowl.plantScan.analyzing", "Analyzing…")
|
|
267
|
-
] }) : /* @__PURE__ */
|
|
268
|
-
/* @__PURE__ */
|
|
294
|
+
] }) : /* @__PURE__ */ T(C, { children: [
|
|
295
|
+
/* @__PURE__ */ w(S, { size: 16 }),
|
|
269
296
|
" ",
|
|
270
297
|
e("healthybowl.plantScan.diagnose", "Diagnose with AI")
|
|
271
298
|
] })
|
|
272
299
|
})
|
|
273
300
|
]
|
|
274
301
|
}),
|
|
275
|
-
/* @__PURE__ */
|
|
302
|
+
/* @__PURE__ */ T("section", {
|
|
276
303
|
className: "rounded-2xl border border-border-subtle bg-bg-surface p-5",
|
|
277
|
-
children: [/* @__PURE__ */
|
|
304
|
+
children: [/* @__PURE__ */ w("h2", {
|
|
278
305
|
className: "mb-4 text-lg font-semibold text-text-primary",
|
|
279
306
|
children: e("healthybowl.plantScan.diagnosisCard", "AI Diagnosis")
|
|
280
|
-
}),
|
|
281
|
-
scan:
|
|
307
|
+
}), X ? /* @__PURE__ */ w(se, {
|
|
308
|
+
scan: X,
|
|
282
309
|
t: e
|
|
283
|
-
}) : /* @__PURE__ */
|
|
310
|
+
}) : /* @__PURE__ */ T("div", {
|
|
284
311
|
className: "flex h-64 flex-col items-center justify-center gap-2 text-center text-text-tertiary",
|
|
285
|
-
children: [/* @__PURE__ */
|
|
312
|
+
children: [/* @__PURE__ */ w(S, { size: 32 }), /* @__PURE__ */ w("p", {
|
|
286
313
|
className: "text-sm",
|
|
287
314
|
children: e("healthybowl.plantScan.diagnosisEmpty", "Your AI diagnosis will appear here after you scan a plant.")
|
|
288
315
|
})]
|
|
289
316
|
})]
|
|
290
317
|
}),
|
|
291
|
-
/* @__PURE__ */
|
|
318
|
+
/* @__PURE__ */ T("section", {
|
|
292
319
|
className: "space-y-4",
|
|
293
|
-
children: [/* @__PURE__ */
|
|
320
|
+
children: [/* @__PURE__ */ T("div", {
|
|
294
321
|
className: "rounded-2xl border border-border-subtle bg-bg-surface p-5",
|
|
295
|
-
children: [/* @__PURE__ */
|
|
322
|
+
children: [/* @__PURE__ */ w("h2", {
|
|
296
323
|
className: "mb-4 text-lg font-semibold text-text-primary",
|
|
297
324
|
children: e("healthybowl.plantScan.recentScans", "Recent Scans")
|
|
298
|
-
}),
|
|
325
|
+
}), _ ? /* @__PURE__ */ w("div", {
|
|
299
326
|
className: "flex h-32 items-center justify-center text-text-tertiary",
|
|
300
|
-
children: /* @__PURE__ */
|
|
327
|
+
children: /* @__PURE__ */ w(b, {
|
|
301
328
|
size: 20,
|
|
302
329
|
className: "animate-spin"
|
|
303
330
|
})
|
|
304
|
-
}) :
|
|
305
|
-
icon: /* @__PURE__ */
|
|
331
|
+
}) : y ? /* @__PURE__ */ w(i, { onRetry: () => void M() }) : ge.length === 0 ? /* @__PURE__ */ w(r, {
|
|
332
|
+
icon: /* @__PURE__ */ w(x, { size: 28 }),
|
|
306
333
|
title: e("healthybowl.plantScan.noScans", "No scans yet"),
|
|
307
334
|
description: e("healthybowl.plantScan.noScansHint", "Point your phone at a sick-looking plant and let HealthyBowl AI name the likely pest or disease.")
|
|
308
|
-
}) : /* @__PURE__ */
|
|
335
|
+
}) : /* @__PURE__ */ w("ul", {
|
|
309
336
|
className: "divide-y divide-border-subtle",
|
|
310
|
-
children:
|
|
337
|
+
children: ge.slice(0, 8).map((n) => /* @__PURE__ */ w("li", { children: /* @__PURE__ */ T("button", {
|
|
311
338
|
type: "button",
|
|
312
|
-
onClick: () =>
|
|
339
|
+
onClick: () => Z(n),
|
|
313
340
|
className: "flex w-full items-center gap-3 py-3 text-start hover:opacity-80",
|
|
314
341
|
children: [
|
|
315
|
-
/* @__PURE__ */
|
|
342
|
+
/* @__PURE__ */ w(oe, {
|
|
316
343
|
fileId: n.photoFileIds?.[0],
|
|
317
344
|
alt: n.topDiagnosis ?? "scan"
|
|
318
345
|
}),
|
|
319
|
-
/* @__PURE__ */
|
|
346
|
+
/* @__PURE__ */ T("div", {
|
|
320
347
|
className: "min-w-0 flex-1",
|
|
321
|
-
children: [/* @__PURE__ */
|
|
348
|
+
children: [/* @__PURE__ */ T("p", {
|
|
322
349
|
className: "truncate text-sm font-medium text-text-primary",
|
|
323
350
|
children: [n.cropName || e("healthybowl.plantScan.unknownCrop", "Unknown crop"), n.topDiagnosis ? ` · ${n.topDiagnosis}` : ""]
|
|
324
|
-
}), /* @__PURE__ */
|
|
351
|
+
}), /* @__PURE__ */ w("p", {
|
|
325
352
|
className: "text-xs text-text-tertiary",
|
|
326
353
|
children: t(n.createdAt)
|
|
327
354
|
})]
|
|
328
355
|
}),
|
|
329
|
-
n.loggedPestIssueId ? /* @__PURE__ */
|
|
356
|
+
n.loggedPestIssueId ? /* @__PURE__ */ w("span", {
|
|
330
357
|
className: "rounded-full bg-status-success-bgSubtle px-2 py-0.5 text-[11px] font-medium text-status-success-text",
|
|
331
358
|
children: e("healthybowl.plantScan.logged", "Logged")
|
|
332
359
|
}) : null
|
|
333
360
|
]
|
|
334
361
|
}) }, n.id))
|
|
335
362
|
})]
|
|
336
|
-
}), $ ? /* @__PURE__ */
|
|
363
|
+
}), $ ? /* @__PURE__ */ T("div", {
|
|
337
364
|
className: "rounded-2xl border border-border-subtle bg-bg-surface p-5",
|
|
338
|
-
children: [/* @__PURE__ */
|
|
365
|
+
children: [/* @__PURE__ */ T("p", {
|
|
339
366
|
className: "text-sm text-text-secondary",
|
|
340
367
|
children: [
|
|
341
|
-
/* @__PURE__ */
|
|
368
|
+
/* @__PURE__ */ w("span", {
|
|
342
369
|
className: "text-lg font-semibold text-text-primary",
|
|
343
370
|
children: $.scansThisSeason
|
|
344
371
|
}),
|
|
@@ -346,14 +373,14 @@ function I() {
|
|
|
346
373
|
e("healthybowl.plantScan.statScans", "scans this season"),
|
|
347
374
|
" ·",
|
|
348
375
|
" ",
|
|
349
|
-
/* @__PURE__ */
|
|
376
|
+
/* @__PURE__ */ w("span", {
|
|
350
377
|
className: "text-lg font-semibold text-text-primary",
|
|
351
378
|
children: $.issuesCaughtEarly
|
|
352
379
|
}),
|
|
353
380
|
" ",
|
|
354
381
|
e("healthybowl.plantScan.statIssues", "issues caught early")
|
|
355
382
|
]
|
|
356
|
-
}), $.avgConfidence > 0 ? /* @__PURE__ */
|
|
383
|
+
}), $.avgConfidence > 0 ? /* @__PURE__ */ T("p", {
|
|
357
384
|
className: "mt-1 text-xs text-text-tertiary",
|
|
358
385
|
children: [
|
|
359
386
|
e("healthybowl.plantScan.statAvg", "Average confidence"),
|
|
@@ -366,24 +393,24 @@ function I() {
|
|
|
366
393
|
})
|
|
367
394
|
]
|
|
368
395
|
}),
|
|
369
|
-
|
|
370
|
-
open:
|
|
371
|
-
onClose: () =>
|
|
372
|
-
scan:
|
|
396
|
+
X ? /* @__PURE__ */ w(ce, {
|
|
397
|
+
open: ue,
|
|
398
|
+
onClose: () => Q(!1),
|
|
399
|
+
scan: X,
|
|
373
400
|
fields: o,
|
|
374
|
-
defaultFieldId:
|
|
401
|
+
defaultFieldId: U,
|
|
375
402
|
t: e,
|
|
376
403
|
onSubmit: async (t) => {
|
|
377
404
|
try {
|
|
378
|
-
await
|
|
405
|
+
await F(t), await M(), Z((e) => e && {
|
|
379
406
|
...e,
|
|
380
407
|
loggedPestIssueId: "logged"
|
|
381
|
-
}),
|
|
408
|
+
}), Q(!1), R({
|
|
382
409
|
title: e("healthybowl.plantScan.loggedToast", "Logged to Pest Issues"),
|
|
383
410
|
variant: "success"
|
|
384
411
|
});
|
|
385
412
|
} catch (t) {
|
|
386
|
-
|
|
413
|
+
R({
|
|
387
414
|
title: e("healthybowl.plantScan.logFailed", "Could not log the issue"),
|
|
388
415
|
description: t instanceof Error ? t.message : String(t),
|
|
389
416
|
variant: "error"
|
|
@@ -391,83 +418,83 @@ function I() {
|
|
|
391
418
|
}
|
|
392
419
|
}
|
|
393
420
|
}) : null,
|
|
394
|
-
/* @__PURE__ */
|
|
395
|
-
toasts:
|
|
396
|
-
onDismiss:
|
|
421
|
+
/* @__PURE__ */ w(a, {
|
|
422
|
+
toasts: L,
|
|
423
|
+
onDismiss: z
|
|
397
424
|
})
|
|
398
425
|
]
|
|
399
426
|
});
|
|
400
427
|
}
|
|
401
|
-
function
|
|
428
|
+
function se({ scan: e, t }) {
|
|
402
429
|
let n = e.candidates ?? [], r = n[0], i = n.slice(1), a = e.advisorySource === "MODEL";
|
|
403
|
-
return /* @__PURE__ */
|
|
430
|
+
return /* @__PURE__ */ T("div", {
|
|
404
431
|
className: "space-y-4",
|
|
405
432
|
children: [
|
|
406
|
-
/* @__PURE__ */
|
|
433
|
+
/* @__PURE__ */ T("div", {
|
|
407
434
|
className: "rounded-xl bg-status-success-bgSubtle p-4",
|
|
408
|
-
children: [/* @__PURE__ */
|
|
435
|
+
children: [/* @__PURE__ */ T("div", {
|
|
409
436
|
className: "flex items-start justify-between gap-3",
|
|
410
|
-
children: [/* @__PURE__ */
|
|
437
|
+
children: [/* @__PURE__ */ T("div", {
|
|
411
438
|
className: "min-w-0",
|
|
412
|
-
children: [/* @__PURE__ */
|
|
439
|
+
children: [/* @__PURE__ */ w("p", {
|
|
413
440
|
className: "text-lg font-bold text-text-primary",
|
|
414
441
|
children: e.topDiagnosis ?? r?.name ?? "—"
|
|
415
|
-
}), e.topScientificName ? /* @__PURE__ */
|
|
442
|
+
}), e.topScientificName ? /* @__PURE__ */ w("p", {
|
|
416
443
|
className: "text-sm italic text-text-secondary",
|
|
417
444
|
children: e.topScientificName
|
|
418
445
|
}) : null]
|
|
419
|
-
}), e.topConfidence == null ? null : /* @__PURE__ */
|
|
446
|
+
}), e.topConfidence == null ? null : /* @__PURE__ */ T("div", {
|
|
420
447
|
className: "shrink-0 rounded-lg bg-action-primary-bg px-3 py-1.5 text-center text-action-primary-text",
|
|
421
|
-
children: [/* @__PURE__ */
|
|
448
|
+
children: [/* @__PURE__ */ w("p", {
|
|
422
449
|
className: "text-[10px] uppercase leading-none opacity-80",
|
|
423
450
|
children: t("healthybowl.plantScan.confidence", "Confidence")
|
|
424
|
-
}), /* @__PURE__ */
|
|
451
|
+
}), /* @__PURE__ */ T("p", {
|
|
425
452
|
className: "text-lg font-bold leading-tight",
|
|
426
453
|
children: [Math.round(e.topConfidence), "%"]
|
|
427
454
|
})]
|
|
428
455
|
})]
|
|
429
|
-
}), /* @__PURE__ */
|
|
430
|
-
className: `mt-3 inline-block rounded-full px-3 py-1 text-xs font-semibold ${
|
|
456
|
+
}), /* @__PURE__ */ T("span", {
|
|
457
|
+
className: `mt-3 inline-block rounded-full px-3 py-1 text-xs font-semibold ${L(e.severity)}`,
|
|
431
458
|
children: [
|
|
432
459
|
t("healthybowl.plantScan.severityLabel", "Severity"),
|
|
433
460
|
": ",
|
|
434
|
-
|
|
461
|
+
I(e.severity, t)
|
|
435
462
|
]
|
|
436
463
|
})]
|
|
437
464
|
}),
|
|
438
|
-
i.length > 0 ? /* @__PURE__ */
|
|
465
|
+
i.length > 0 ? /* @__PURE__ */ T("div", {
|
|
439
466
|
className: "space-y-2",
|
|
440
|
-
children: [/* @__PURE__ */
|
|
467
|
+
children: [/* @__PURE__ */ w("p", {
|
|
441
468
|
className: "text-xs font-medium uppercase tracking-wide text-text-tertiary",
|
|
442
469
|
children: t("healthybowl.plantScan.alternatives", "Alternative candidates")
|
|
443
|
-
}), i.map((e, t) => /* @__PURE__ */
|
|
470
|
+
}), i.map((e, t) => /* @__PURE__ */ T("div", {
|
|
444
471
|
className: "flex items-center gap-3 text-sm",
|
|
445
472
|
children: [
|
|
446
|
-
/* @__PURE__ */
|
|
473
|
+
/* @__PURE__ */ w("span", {
|
|
447
474
|
className: "flex h-5 w-5 items-center justify-center rounded-full bg-bg-sunken text-xs text-text-secondary",
|
|
448
475
|
children: t + 1
|
|
449
476
|
}),
|
|
450
|
-
/* @__PURE__ */
|
|
477
|
+
/* @__PURE__ */ w("span", {
|
|
451
478
|
className: "flex-1 truncate text-text-primary",
|
|
452
479
|
children: e.name
|
|
453
480
|
}),
|
|
454
|
-
/* @__PURE__ */
|
|
455
|
-
/* @__PURE__ */
|
|
481
|
+
/* @__PURE__ */ w(R, { value: e.confidence }),
|
|
482
|
+
/* @__PURE__ */ T("span", {
|
|
456
483
|
className: "w-10 text-end text-text-secondary",
|
|
457
484
|
children: [Math.round(e.confidence), "%"]
|
|
458
485
|
})
|
|
459
486
|
]
|
|
460
487
|
}, `${e.name}-${t}`))]
|
|
461
488
|
}) : null,
|
|
462
|
-
/* @__PURE__ */
|
|
489
|
+
/* @__PURE__ */ T("div", {
|
|
463
490
|
className: "rounded-xl border border-border-subtle p-4",
|
|
464
491
|
children: [
|
|
465
|
-
/* @__PURE__ */
|
|
492
|
+
/* @__PURE__ */ T("p", {
|
|
466
493
|
className: "mb-2 text-sm font-semibold text-text-primary",
|
|
467
494
|
children: [
|
|
468
495
|
t("healthybowl.plantScan.recommendedAction", "Recommended Action"),
|
|
469
496
|
" ",
|
|
470
|
-
/* @__PURE__ */
|
|
497
|
+
/* @__PURE__ */ T("span", {
|
|
471
498
|
className: "font-normal text-text-tertiary",
|
|
472
499
|
children: [
|
|
473
500
|
"(",
|
|
@@ -477,29 +504,29 @@ function oe({ scan: e, t }) {
|
|
|
477
504
|
})
|
|
478
505
|
]
|
|
479
506
|
}),
|
|
480
|
-
e.recommendedActions?.length ? /* @__PURE__ */
|
|
507
|
+
e.recommendedActions?.length ? /* @__PURE__ */ w("ul", {
|
|
481
508
|
className: "space-y-1.5",
|
|
482
|
-
children: e.recommendedActions.map((e, t) => /* @__PURE__ */
|
|
509
|
+
children: e.recommendedActions.map((e, t) => /* @__PURE__ */ T("li", {
|
|
483
510
|
className: "flex gap-2 text-sm text-text-secondary",
|
|
484
|
-
children: [/* @__PURE__ */
|
|
511
|
+
children: [/* @__PURE__ */ w(y, {
|
|
485
512
|
size: 16,
|
|
486
513
|
className: "mt-0.5 shrink-0 text-accent-teal"
|
|
487
|
-
}), /* @__PURE__ */
|
|
514
|
+
}), /* @__PURE__ */ w("span", { children: e })]
|
|
488
515
|
}, t))
|
|
489
|
-
}) : /* @__PURE__ */
|
|
516
|
+
}) : /* @__PURE__ */ w("p", {
|
|
490
517
|
className: "text-sm text-text-tertiary",
|
|
491
518
|
children: e.advisoryText ?? "—"
|
|
492
519
|
}),
|
|
493
|
-
/* @__PURE__ */
|
|
520
|
+
/* @__PURE__ */ T("p", {
|
|
494
521
|
className: "mt-3 border-t border-border-subtle pt-2 text-xs text-text-tertiary",
|
|
495
|
-
children: [a ? /* @__PURE__ */
|
|
496
|
-
/* @__PURE__ */
|
|
522
|
+
children: [a ? /* @__PURE__ */ T(C, { children: [
|
|
523
|
+
/* @__PURE__ */ w(S, {
|
|
497
524
|
size: 12,
|
|
498
525
|
className: "mr-1 inline"
|
|
499
526
|
}),
|
|
500
527
|
t("healthybowl.plantScan.aiAttribution", "AI diagnosis"),
|
|
501
528
|
e.modelName ? ` · ${e.modelName}` : ""
|
|
502
|
-
] }) : /* @__PURE__ */
|
|
529
|
+
] }) : /* @__PURE__ */ T(C, { children: [/* @__PURE__ */ w(_, {
|
|
503
530
|
size: 12,
|
|
504
531
|
className: "mr-1 inline"
|
|
505
532
|
}), t("healthybowl.plantScan.ruleAttribution", "Rule-based estimate (not AI) — confirm before treating")] }), e.processingMs ? ` · ${(e.processingMs / 1e3).toFixed(1)}s` : ""]
|
|
@@ -509,69 +536,69 @@ function oe({ scan: e, t }) {
|
|
|
509
536
|
]
|
|
510
537
|
});
|
|
511
538
|
}
|
|
512
|
-
var
|
|
539
|
+
var B = [
|
|
513
540
|
"DISEASE",
|
|
514
541
|
"FUNGUS",
|
|
515
542
|
"INSECT",
|
|
516
543
|
"WEED"
|
|
517
|
-
],
|
|
544
|
+
], V = [
|
|
518
545
|
"ACTIVE",
|
|
519
546
|
"MONITORING",
|
|
520
547
|
"TREATING",
|
|
521
548
|
"RESOLVED"
|
|
522
|
-
],
|
|
549
|
+
], H = [
|
|
523
550
|
"LOW",
|
|
524
551
|
"MEDIUM",
|
|
525
552
|
"HIGH",
|
|
526
553
|
"CRITICAL"
|
|
527
554
|
];
|
|
528
|
-
function
|
|
555
|
+
function U(e) {
|
|
529
556
|
let t = (e ?? "").toUpperCase();
|
|
530
|
-
return
|
|
557
|
+
return B.includes(t) ? t : "DISEASE";
|
|
531
558
|
}
|
|
532
|
-
function
|
|
533
|
-
let [
|
|
534
|
-
|
|
535
|
-
e &&
|
|
559
|
+
function ce({ open: e, onClose: t, scan: n, fields: r, defaultFieldId: i, t: a, onSubmit: s }) {
|
|
560
|
+
let [c, l] = g(() => G(n, i)), [u, d] = g(!1);
|
|
561
|
+
p(() => {
|
|
562
|
+
e && l(G(n, i));
|
|
536
563
|
}, [
|
|
537
564
|
e,
|
|
538
565
|
n,
|
|
539
566
|
i
|
|
540
567
|
]);
|
|
541
|
-
let
|
|
568
|
+
let f = (e, t) => l((n) => ({
|
|
542
569
|
...n,
|
|
543
570
|
[e]: t
|
|
544
|
-
})),
|
|
545
|
-
|
|
571
|
+
})), m = async () => {
|
|
572
|
+
d(!0);
|
|
546
573
|
try {
|
|
547
|
-
await
|
|
574
|
+
await s(c);
|
|
548
575
|
} finally {
|
|
549
|
-
|
|
576
|
+
d(!1);
|
|
550
577
|
}
|
|
551
|
-
},
|
|
552
|
-
return /* @__PURE__ */
|
|
578
|
+
}, h = !!c.fieldId && !!c.pestName.trim();
|
|
579
|
+
return /* @__PURE__ */ T(o, {
|
|
553
580
|
open: e,
|
|
554
581
|
onClose: t,
|
|
555
582
|
title: a("healthybowl.plantScan.logModalTitle", "Log to Pest Issues"),
|
|
556
583
|
size: "lg",
|
|
557
|
-
footer: /* @__PURE__ */
|
|
584
|
+
footer: /* @__PURE__ */ T("div", {
|
|
558
585
|
className: "flex justify-end gap-2",
|
|
559
|
-
children: [/* @__PURE__ */
|
|
586
|
+
children: [/* @__PURE__ */ w(E, {
|
|
560
587
|
variant: "outline",
|
|
561
588
|
onClick: t,
|
|
562
589
|
children: a("common.cancel", "Cancel")
|
|
563
|
-
}), /* @__PURE__ */
|
|
564
|
-
onClick: () => void
|
|
565
|
-
disabled: !
|
|
590
|
+
}), /* @__PURE__ */ T(E, {
|
|
591
|
+
onClick: () => void m(),
|
|
592
|
+
disabled: !h || u,
|
|
566
593
|
className: "gap-2",
|
|
567
|
-
children: [
|
|
594
|
+
children: [u ? /* @__PURE__ */ w(b, {
|
|
568
595
|
size: 16,
|
|
569
596
|
className: "animate-spin"
|
|
570
|
-
}) : /* @__PURE__ */
|
|
597
|
+
}) : /* @__PURE__ */ w(v, { size: 16 }), a("healthybowl.plantScan.createIssue", "Create Pest Issue")]
|
|
571
598
|
})]
|
|
572
599
|
}),
|
|
573
600
|
children: [
|
|
574
|
-
/* @__PURE__ */
|
|
601
|
+
/* @__PURE__ */ T("div", {
|
|
575
602
|
className: "rounded-lg bg-status-success-bgSubtle px-3 py-2 text-sm text-status-success-text",
|
|
576
603
|
children: [
|
|
577
604
|
a("healthybowl.plantScan.prefill", "Pre-filled from AI scan"),
|
|
@@ -580,76 +607,76 @@ function se({ open: e, onClose: t, scan: n, fields: r, defaultFieldId: i, t: a,
|
|
|
580
607
|
n.topConfidence == null ? "" : `, ${Math.round(n.topConfidence)}% ${a("healthybowl.plantScan.confidenceLower", "confidence")}`
|
|
581
608
|
]
|
|
582
609
|
}),
|
|
583
|
-
/* @__PURE__ */
|
|
610
|
+
/* @__PURE__ */ T("div", {
|
|
584
611
|
className: "mt-4 grid grid-cols-1 gap-4 sm:grid-cols-2",
|
|
585
612
|
children: [
|
|
586
|
-
/* @__PURE__ */
|
|
613
|
+
/* @__PURE__ */ w(W, {
|
|
587
614
|
label: a("healthybowl.plantScan.pestDisease", "Pest / Disease"),
|
|
588
|
-
children: /* @__PURE__ */
|
|
589
|
-
value:
|
|
590
|
-
onChange: (e) =>
|
|
591
|
-
className:
|
|
615
|
+
children: /* @__PURE__ */ w("input", {
|
|
616
|
+
value: c.pestName,
|
|
617
|
+
onChange: (e) => f("pestName", e.target.value),
|
|
618
|
+
className: P
|
|
592
619
|
})
|
|
593
620
|
}),
|
|
594
|
-
/* @__PURE__ */
|
|
621
|
+
/* @__PURE__ */ w(W, {
|
|
595
622
|
label: a("healthybowl.plantScan.type", "Type"),
|
|
596
|
-
children: /* @__PURE__ */
|
|
597
|
-
value:
|
|
598
|
-
onValueChange: (e) =>
|
|
599
|
-
children: [/* @__PURE__ */
|
|
623
|
+
children: /* @__PURE__ */ T(D, {
|
|
624
|
+
value: c.type,
|
|
625
|
+
onValueChange: (e) => f("type", e),
|
|
626
|
+
children: [/* @__PURE__ */ w(A, {
|
|
600
627
|
className: "w-full",
|
|
601
|
-
children: /* @__PURE__ */
|
|
602
|
-
}), /* @__PURE__ */
|
|
628
|
+
children: /* @__PURE__ */ w(j, {})
|
|
629
|
+
}), /* @__PURE__ */ w(O, { children: B.map((e) => /* @__PURE__ */ w(k, {
|
|
603
630
|
value: e,
|
|
604
631
|
children: e
|
|
605
632
|
}, e)) })]
|
|
606
633
|
})
|
|
607
634
|
}),
|
|
608
|
-
/* @__PURE__ */
|
|
635
|
+
/* @__PURE__ */ w(W, {
|
|
609
636
|
label: a("healthybowl.plantScan.affectedCrop", "Affected Crop"),
|
|
610
|
-
children: /* @__PURE__ */
|
|
611
|
-
value:
|
|
612
|
-
onChange: (e) =>
|
|
613
|
-
className:
|
|
637
|
+
children: /* @__PURE__ */ w("input", {
|
|
638
|
+
value: c.cropAffected,
|
|
639
|
+
onChange: (e) => f("cropAffected", e.target.value),
|
|
640
|
+
className: P
|
|
614
641
|
})
|
|
615
642
|
}),
|
|
616
|
-
/* @__PURE__ */
|
|
643
|
+
/* @__PURE__ */ w(W, {
|
|
617
644
|
label: a("healthybowl.plantScan.fieldLocation", "Field / Location"),
|
|
618
|
-
children: /* @__PURE__ */
|
|
619
|
-
value:
|
|
620
|
-
onValueChange: (e) =>
|
|
621
|
-
children: [/* @__PURE__ */
|
|
645
|
+
children: /* @__PURE__ */ T(D, {
|
|
646
|
+
value: c.fieldId,
|
|
647
|
+
onValueChange: (e) => f("fieldId", e),
|
|
648
|
+
children: [/* @__PURE__ */ w(A, {
|
|
622
649
|
className: "w-full",
|
|
623
|
-
children: /* @__PURE__ */
|
|
624
|
-
}), /* @__PURE__ */
|
|
650
|
+
children: /* @__PURE__ */ w(j, { placeholder: a("healthybowl.plantScan.selectField", "Select field") })
|
|
651
|
+
}), /* @__PURE__ */ w(O, { children: r.map((e) => /* @__PURE__ */ w(k, {
|
|
625
652
|
value: e.id,
|
|
626
653
|
children: e.name
|
|
627
654
|
}, e.id)) })]
|
|
628
655
|
})
|
|
629
656
|
}),
|
|
630
|
-
/* @__PURE__ */
|
|
657
|
+
/* @__PURE__ */ w(W, {
|
|
631
658
|
label: a("healthybowl.plantScan.severityLabel", "Severity"),
|
|
632
|
-
children: /* @__PURE__ */
|
|
633
|
-
value:
|
|
634
|
-
onValueChange: (e) =>
|
|
635
|
-
children: [/* @__PURE__ */
|
|
659
|
+
children: /* @__PURE__ */ T(D, {
|
|
660
|
+
value: c.severity,
|
|
661
|
+
onValueChange: (e) => f("severity", e),
|
|
662
|
+
children: [/* @__PURE__ */ w(A, {
|
|
636
663
|
className: "w-full",
|
|
637
|
-
children: /* @__PURE__ */
|
|
638
|
-
}), /* @__PURE__ */
|
|
664
|
+
children: /* @__PURE__ */ w(j, {})
|
|
665
|
+
}), /* @__PURE__ */ w(O, { children: H.map((e) => /* @__PURE__ */ w(k, {
|
|
639
666
|
value: e,
|
|
640
667
|
children: e
|
|
641
668
|
}, e)) })]
|
|
642
669
|
})
|
|
643
670
|
}),
|
|
644
|
-
/* @__PURE__ */
|
|
671
|
+
/* @__PURE__ */ w(W, {
|
|
645
672
|
label: a("healthybowl.plantScan.status", "Status"),
|
|
646
|
-
children: /* @__PURE__ */
|
|
647
|
-
value:
|
|
648
|
-
onValueChange: (e) =>
|
|
649
|
-
children: [/* @__PURE__ */
|
|
673
|
+
children: /* @__PURE__ */ T(D, {
|
|
674
|
+
value: c.status,
|
|
675
|
+
onValueChange: (e) => f("status", e),
|
|
676
|
+
children: [/* @__PURE__ */ w(A, {
|
|
650
677
|
className: "w-full",
|
|
651
|
-
children: /* @__PURE__ */
|
|
652
|
-
}), /* @__PURE__ */
|
|
678
|
+
children: /* @__PURE__ */ w(j, {})
|
|
679
|
+
}), /* @__PURE__ */ w(O, { children: V.map((e) => /* @__PURE__ */ w(k, {
|
|
653
680
|
value: e,
|
|
654
681
|
children: e
|
|
655
682
|
}, e)) })]
|
|
@@ -657,61 +684,61 @@ function se({ open: e, onClose: t, scan: n, fields: r, defaultFieldId: i, t: a,
|
|
|
657
684
|
})
|
|
658
685
|
]
|
|
659
686
|
}),
|
|
660
|
-
/* @__PURE__ */
|
|
687
|
+
/* @__PURE__ */ w("div", {
|
|
661
688
|
className: "mt-4",
|
|
662
|
-
children: /* @__PURE__ */
|
|
663
|
-
label: /* @__PURE__ */
|
|
689
|
+
children: /* @__PURE__ */ w(W, {
|
|
690
|
+
label: /* @__PURE__ */ T(C, { children: [
|
|
664
691
|
a("healthybowl.plantScan.suggestedTreatment", "Suggested Treatment"),
|
|
665
692
|
" ",
|
|
666
|
-
/* @__PURE__ */
|
|
693
|
+
/* @__PURE__ */ w("span", {
|
|
667
694
|
className: "rounded bg-status-success-bgSubtle px-1.5 py-0.5 text-[11px] text-status-success-text",
|
|
668
695
|
children: a("healthybowl.plantScan.aiSuggested", "AI-suggested (organic-safe)")
|
|
669
696
|
})
|
|
670
697
|
] }),
|
|
671
|
-
children: /* @__PURE__ */
|
|
672
|
-
value:
|
|
673
|
-
onChange: (e) =>
|
|
698
|
+
children: /* @__PURE__ */ w("textarea", {
|
|
699
|
+
value: c.treatment,
|
|
700
|
+
onChange: (e) => f("treatment", e.target.value),
|
|
674
701
|
rows: 2,
|
|
675
|
-
className:
|
|
702
|
+
className: P
|
|
676
703
|
})
|
|
677
704
|
})
|
|
678
705
|
}),
|
|
679
|
-
/* @__PURE__ */
|
|
706
|
+
/* @__PURE__ */ w("div", {
|
|
680
707
|
className: "mt-4",
|
|
681
|
-
children: /* @__PURE__ */
|
|
708
|
+
children: /* @__PURE__ */ w(W, {
|
|
682
709
|
label: a("healthybowl.plantScan.notesField", "Notes"),
|
|
683
|
-
children: /* @__PURE__ */
|
|
684
|
-
value:
|
|
685
|
-
onChange: (e) =>
|
|
710
|
+
children: /* @__PURE__ */ w("textarea", {
|
|
711
|
+
value: c.notes,
|
|
712
|
+
onChange: (e) => f("notes", e.target.value),
|
|
686
713
|
rows: 2,
|
|
687
714
|
placeholder: a("healthybowl.plantScan.addObservations", "Add any observations…"),
|
|
688
|
-
className:
|
|
715
|
+
className: P
|
|
689
716
|
})
|
|
690
717
|
})
|
|
691
718
|
}),
|
|
692
|
-
/* @__PURE__ */
|
|
719
|
+
/* @__PURE__ */ T("label", {
|
|
693
720
|
className: "mt-4 flex items-center gap-2 text-sm text-text-secondary",
|
|
694
|
-
children: [/* @__PURE__ */
|
|
721
|
+
children: [/* @__PURE__ */ w("input", {
|
|
695
722
|
type: "checkbox",
|
|
696
|
-
checked:
|
|
697
|
-
onChange: (e) =>
|
|
723
|
+
checked: c.attachPhoto,
|
|
724
|
+
onChange: (e) => f("attachPhoto", e.target.checked)
|
|
698
725
|
}), a("healthybowl.plantScan.attachPhoto", "Attach scan photo to this issue")]
|
|
699
726
|
})
|
|
700
727
|
]
|
|
701
728
|
});
|
|
702
729
|
}
|
|
703
|
-
function
|
|
704
|
-
return /* @__PURE__ */
|
|
730
|
+
function W({ label: e, children: t }) {
|
|
731
|
+
return /* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("label", {
|
|
705
732
|
className: "mb-1 flex items-center gap-2 text-xs font-medium text-text-secondary",
|
|
706
733
|
children: e
|
|
707
734
|
}), t] });
|
|
708
735
|
}
|
|
709
|
-
function
|
|
736
|
+
function G(e, t) {
|
|
710
737
|
return {
|
|
711
738
|
scanId: e.id,
|
|
712
739
|
fieldId: e.fieldId ?? t ?? "",
|
|
713
740
|
pestName: e.topScientificName ? `${e.topDiagnosis ?? ""} (${e.topScientificName})`.trim() : e.topDiagnosis ?? "",
|
|
714
|
-
type:
|
|
741
|
+
type: U(e.topType),
|
|
715
742
|
cropAffected: e.cropName ?? "",
|
|
716
743
|
severity: (e.severity ?? "MEDIUM").toUpperCase() === "MODERATE" ? "MEDIUM" : (e.severity ?? "MEDIUM").toUpperCase(),
|
|
717
744
|
status: "ACTIVE",
|
|
@@ -721,6 +748,6 @@ function H(e, t) {
|
|
|
721
748
|
};
|
|
722
749
|
}
|
|
723
750
|
//#endregion
|
|
724
|
-
export {
|
|
751
|
+
export { z as AiPestDetectionPage };
|
|
725
752
|
|
|
726
753
|
//# sourceMappingURL=AiPestDetectionPage.js.map
|