@burdenoff/microfe-healthybowl 2026.1119.2 → 2026.1120.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/dist/healthybowl/pages/GettingStartedPage.js +76 -76
  2. package/dist/healthybowl/pages/contracts/contract-forms/CreateContractModal.js +80 -80
  3. package/dist/healthybowl/pages/contracts/contract-forms/RecordDeliveryModal.js +54 -54
  4. package/dist/healthybowl/pages/crops/HarvestDetailsPage.js +26 -24
  5. package/dist/healthybowl/pages/distribution/CsaPlanDetailPage.js +239 -239
  6. package/dist/healthybowl/pages/distribution/PickupLocationFormModal.js +125 -125
  7. package/dist/healthybowl/pages/distribution/PickupManifestPage.js +75 -75
  8. package/dist/healthybowl/pages/field-capture/ObservationLogPage.js +40 -39
  9. package/dist/healthybowl/pages/financial/BankReconciliationPage.js +220 -219
  10. package/dist/healthybowl/pages/financial/ChartOfAccountsPage.js +59 -59
  11. package/dist/healthybowl/pages/financial/CostByCropPage.js +58 -58
  12. package/dist/healthybowl/pages/financial/JournalEntryModal.js +102 -99
  13. package/dist/healthybowl/pages/financial/MachinerySpendPage.js +55 -54
  14. package/dist/healthybowl/pages/inputs-insurance/InputPlanFormModal.js +117 -114
  15. package/dist/healthybowl/pages/inputs-insurance/InputsInsuranceOverviewPage.js +247 -245
  16. package/dist/healthybowl/pages/inputs-insurance/LoanFacilitationPage.js +92 -90
  17. package/dist/healthybowl/pages/inputs-insurance/PolicyClaimsPage.js +74 -72
  18. package/dist/healthybowl/pages/irrigation/IrrigationPage.js +244 -243
  19. package/dist/healthybowl/pages/market/market-prices/PriceAlertRuleModal.js +97 -96
  20. package/dist/healthybowl/pages/marketplace/AuctionsView.js +76 -76
  21. package/dist/healthybowl/pages/marketplace/SharedMarketView.js +104 -104
  22. package/dist/healthybowl/pages/nursery/NurseryProvenancePage.js +395 -395
  23. package/dist/healthybowl/pages/reports-api/ReportsApiPage.js +103 -103
  24. package/dist/healthybowl/pages/soil/field-sensors/RegisterProbeModal.js +62 -61
  25. package/dist/healthybowl/pages/soil/field-sensors/ThresholdsModal.js +54 -53
  26. package/dist/healthybowl/pages/tasks/JobCardPage.js +18 -18
  27. package/dist/healthybowl/pages/traceability/PrintLabelDialog.js +91 -91
  28. package/dist/healthybowl/pages/traceability/QRCodesPage.js +134 -134
  29. package/dist/healthybowl/pages/weather/WeatherAlertRulesPage.js +243 -242
  30. package/dist/healthybowl/pages/weather/WeatherSettingsPage.js +239 -239
  31. package/dist/healthybowl/utils/selectLayout.d.ts +27 -0
  32. package/dist/healthybowl/utils/selectLayout.js +3 -0
  33. package/dist/node_modules/@burdenoff/planmagnet-fe-sdk/dist/index.js +1068 -1068
  34. package/package.json +3 -3
@@ -11,65 +11,65 @@ import { useI18n as c } from "@burdenoff/fe-libs/shared/providers/shell/I18nProv
11
11
  import { ArrowRight as l, CheckCircle2 as u, Sprout as d } from "lucide-react";
12
12
  import { useNavigate as f } from "react-router";
13
13
  import { jsx as p, jsxs as m } from "react/jsx-runtime";
14
- import { EmphasisPanel as h, GlassCard as g } from "@burdenoff/fe-libs/ui";
14
+ import { EmphasisPanel as h, GlassCard as g, ThemedSelect as _ } from "@burdenoff/fe-libs/ui";
15
15
  // src/healthybowl/pages/GettingStartedPage.tsx
16
- var _ = {
16
+ var v = {
17
17
  name: "",
18
18
  owner: "",
19
19
  location: "",
20
20
  totalArea: 0,
21
21
  areaUnit: "acres",
22
22
  organicCertified: !1
23
- }, v = "w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]", y = () => {
24
- let { t: y } = c(), { farm: b, createFarm: x, loadings: S, errors: C, refetch: w } = o(), T = f(), { buildPath: E } = a(), { toasts: D, toast: O, dismiss: k } = i(), [A, j] = s(_), [M, N] = s(!1), P = !!b?.id, F = async () => {
25
- if (!S.dashboard) {
26
- if (!A.name.trim() || !A.owner.trim() || !A.location.trim()) O({
27
- title: y("healthybowl.gettingStarted.toast.missingDetails.title", "Missing details"),
28
- description: y("healthybowl.gettingStarted.toast.missingDetails.description", "Please fill in farm name, owner, and location."),
23
+ }, y = "w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]", b = () => {
24
+ let { t: b } = c(), { farm: x, createFarm: S, loadings: C, errors: w, refetch: T } = o(), E = f(), { buildPath: D } = a(), { toasts: O, toast: k, dismiss: A } = i(), [j, M] = s(v), [N, P] = s(!1), F = !!x?.id, I = async () => {
25
+ if (!C.dashboard) {
26
+ if (!j.name.trim() || !j.owner.trim() || !j.location.trim()) k({
27
+ title: b("healthybowl.gettingStarted.toast.missingDetails.title", "Missing details"),
28
+ description: b("healthybowl.gettingStarted.toast.missingDetails.description", "Please fill in farm name, owner, and location."),
29
29
  variant: "warning"
30
30
  });
31
- else if (!Number.isFinite(A.totalArea) || A.totalArea <= 0) O({
32
- title: y("healthybowl.gettingStarted.toast.invalidArea.title", "Invalid area"),
33
- description: y("healthybowl.gettingStarted.toast.invalidArea.description", "Total area must be greater than zero."),
31
+ else if (!Number.isFinite(j.totalArea) || j.totalArea <= 0) k({
32
+ title: b("healthybowl.gettingStarted.toast.invalidArea.title", "Invalid area"),
33
+ description: b("healthybowl.gettingStarted.toast.invalidArea.description", "Total area must be greater than zero."),
34
34
  variant: "warning"
35
35
  });
36
36
  else {
37
- N(!0);
37
+ P(!0);
38
38
  try {
39
- await x({
40
- name: A.name.trim(),
41
- owner: A.owner.trim(),
42
- location: A.location.trim(),
43
- totalArea: A.totalArea,
44
- areaUnit: A.areaUnit,
45
- organicCertified: A.organicCertified
46
- }), O({
47
- title: y("healthybowl.gettingStarted.toast.farmCreated.title", "Farm created"),
48
- description: y("healthybowl.gettingStarted.toast.farmCreated.description", "{{name}} is ready — next, add a field.", { name: A.name }),
39
+ await S({
40
+ name: j.name.trim(),
41
+ owner: j.owner.trim(),
42
+ location: j.location.trim(),
43
+ totalArea: j.totalArea,
44
+ areaUnit: j.areaUnit,
45
+ organicCertified: j.organicCertified
46
+ }), k({
47
+ title: b("healthybowl.gettingStarted.toast.farmCreated.title", "Farm created"),
48
+ description: b("healthybowl.gettingStarted.toast.farmCreated.description", "{{name}} is ready — next, add a field.", { name: j.name }),
49
49
  variant: "success"
50
- }), j(_);
50
+ }), M(v);
51
51
  } catch (e) {
52
- O({
53
- title: y("healthybowl.gettingStarted.toast.createFarmError.title", "Could not create farm"),
52
+ k({
53
+ title: b("healthybowl.gettingStarted.toast.createFarmError.title", "Could not create farm"),
54
54
  description: e instanceof Error ? e.message : String(e),
55
55
  variant: "error"
56
56
  });
57
57
  } finally {
58
- N(!1);
58
+ P(!1);
59
59
  }
60
60
  }
61
61
  }
62
62
  };
63
63
  return /* @__PURE__ */ m(e, {
64
64
  testId: "getting-started-page",
65
- title: y("healthybowl.gettingStarted.title", "Get Started"),
66
- titleAccent: y("healthybowl.gettingStarted.titleAccent", "Started"),
67
- description: y("healthybowl.gettingStarted.description", "Set up your farm to start tracking operations"),
65
+ title: b("healthybowl.gettingStarted.title", "Get Started"),
66
+ titleAccent: b("healthybowl.gettingStarted.titleAccent", "Started"),
67
+ description: b("healthybowl.gettingStarted.description", "Set up your farm to start tracking operations"),
68
68
  purpose: "New here? This is the quickest way to get going. Create your farm, then add a field and your first crop — once that's done, the dashboard, weather, finances and the rest of HealthyBowl come to life with your own data.",
69
- children: [S.dashboard ? /* @__PURE__ */ p(r, {}) : C.dashboard ? /* @__PURE__ */ p(t, { onRetry: w }) : /* @__PURE__ */ m("div", {
69
+ children: [C.dashboard ? /* @__PURE__ */ p(r, {}) : w.dashboard ? /* @__PURE__ */ p(t, { onRetry: T }) : /* @__PURE__ */ m("div", {
70
70
  className: "mx-auto max-w-2xl space-y-6",
71
71
  children: [
72
- P && /* @__PURE__ */ m(h, {
72
+ F && /* @__PURE__ */ m(h, {
73
73
  className: "flex items-center gap-3",
74
74
  children: [
75
75
  /* @__PURE__ */ p(u, { className: "h-5 w-5 shrink-0 text-primary" }),
@@ -77,22 +77,22 @@ var _ = {
77
77
  className: "flex-1",
78
78
  children: [/* @__PURE__ */ p("p", {
79
79
  className: "text-sm font-medium text-text-primary",
80
- children: y("healthybowl.gettingStarted.banner.ready", "Farm ready: {{name}}", { name: b.name })
80
+ children: b("healthybowl.gettingStarted.banner.ready", "Farm ready: {{name}}", { name: x.name })
81
81
  }), /* @__PURE__ */ p("p", {
82
82
  className: "text-xs text-text-secondary",
83
- children: y("healthybowl.gettingStarted.banner.next", "Next, add a field — or add another farm below.")
83
+ children: b("healthybowl.gettingStarted.banner.next", "Next, add a field — or add another farm below.")
84
84
  })]
85
85
  }),
86
86
  /* @__PURE__ */ m("div", {
87
87
  className: "flex items-center gap-2",
88
88
  children: [/* @__PURE__ */ p("button", {
89
- onClick: () => T(E("crops/fields")),
89
+ onClick: () => E(D("crops/fields")),
90
90
  className: "min-h-[44px] rounded-md bg-action-primary-bg px-3 py-1.5 text-sm font-medium text-action-primary-text transition-colors hover:bg-action-primary-bg/90 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus focus-visible:ring-offset-2 focus-visible:ring-offset-bg-canvas",
91
- children: y("healthybowl.gettingStarted.banner.addField", "Add a field")
91
+ children: b("healthybowl.gettingStarted.banner.addField", "Add a field")
92
92
  }), /* @__PURE__ */ p("button", {
93
- onClick: () => T(E("")),
93
+ onClick: () => E(D("")),
94
94
  className: "min-h-[44px] rounded-md border border-border-seam px-3 py-1.5 text-sm text-text-primary transition-colors hover:bg-bg-sunken/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus focus-visible:ring-offset-2 focus-visible:ring-offset-bg-canvas",
95
- children: y("healthybowl.gettingStarted.banner.dashboard", "Dashboard")
95
+ children: b("healthybowl.gettingStarted.banner.dashboard", "Dashboard")
96
96
  })]
97
97
  })
98
98
  ]
@@ -105,24 +105,24 @@ var _ = {
105
105
  children: [
106
106
  /* @__PURE__ */ p(d, { className: "h-4 w-4 text-primary" }),
107
107
  " ",
108
- y("healthybowl.gettingStarted.steps.farm", "1. Farm")
108
+ b("healthybowl.gettingStarted.steps.farm", "1. Farm")
109
109
  ]
110
110
  }),
111
111
  /* @__PURE__ */ p(l, { className: "h-4 w-4" }),
112
- /* @__PURE__ */ p("span", { children: y("healthybowl.gettingStarted.steps.field", "2. Field") }),
112
+ /* @__PURE__ */ p("span", { children: b("healthybowl.gettingStarted.steps.field", "2. Field") }),
113
113
  /* @__PURE__ */ p(l, { className: "h-4 w-4" }),
114
- /* @__PURE__ */ p("span", { children: y("healthybowl.gettingStarted.steps.crop", "3. Crop") })
114
+ /* @__PURE__ */ p("span", { children: b("healthybowl.gettingStarted.steps.crop", "3. Crop") })
115
115
  ]
116
116
  }),
117
117
  /* @__PURE__ */ m("form", {
118
118
  onSubmit: (e) => {
119
- e.preventDefault(), F();
119
+ e.preventDefault(), I();
120
120
  },
121
121
  className: "space-y-4 rounded-xl border border-border-seam bg-gloss-card p-6 shadow-pop",
122
122
  children: [
123
123
  /* @__PURE__ */ p("h2", {
124
124
  className: "text-lg font-semibold text-text-primary",
125
- children: y("healthybowl.gettingStarted.form.heading", "Create your farm")
125
+ children: b("healthybowl.gettingStarted.form.heading", "Create your farm")
126
126
  }),
127
127
  /* @__PURE__ */ m("div", {
128
128
  className: "grid gap-4 sm:grid-cols-2",
@@ -131,85 +131,85 @@ var _ = {
131
131
  className: "block",
132
132
  children: [/* @__PURE__ */ p("span", {
133
133
  className: "mb-1 block text-sm font-medium text-text-primary",
134
- children: y("healthybowl.gettingStarted.form.fields.name.label", "Farm name *")
134
+ children: b("healthybowl.gettingStarted.form.fields.name.label", "Farm name *")
135
135
  }), /* @__PURE__ */ p("input", {
136
- value: A.name,
137
- onChange: (e) => j((t) => ({
136
+ value: j.name,
137
+ onChange: (e) => M((t) => ({
138
138
  ...t,
139
139
  name: e.target.value
140
140
  })),
141
- placeholder: y("healthybowl.gettingStarted.form.fields.name.placeholder", "Green Valley Organic Farm"),
141
+ placeholder: b("healthybowl.gettingStarted.form.fields.name.placeholder", "Green Valley Organic Farm"),
142
142
  maxLength: 200,
143
- className: v
143
+ className: y
144
144
  })]
145
145
  }),
146
146
  /* @__PURE__ */ m("label", {
147
147
  className: "block",
148
148
  children: [/* @__PURE__ */ p("span", {
149
149
  className: "mb-1 block text-sm font-medium text-text-primary",
150
- children: y("healthybowl.gettingStarted.form.fields.owner.label", "Owner *")
150
+ children: b("healthybowl.gettingStarted.form.fields.owner.label", "Owner *")
151
151
  }), /* @__PURE__ */ p("input", {
152
- value: A.owner,
153
- onChange: (e) => j((t) => ({
152
+ value: j.owner,
153
+ onChange: (e) => M((t) => ({
154
154
  ...t,
155
155
  owner: e.target.value
156
156
  })),
157
- placeholder: y("healthybowl.gettingStarted.form.fields.owner.placeholder", "Your name"),
157
+ placeholder: b("healthybowl.gettingStarted.form.fields.owner.placeholder", "Your name"),
158
158
  maxLength: 200,
159
- className: v
159
+ className: y
160
160
  })]
161
161
  }),
162
162
  /* @__PURE__ */ m("label", {
163
163
  className: "block sm:col-span-2",
164
164
  children: [/* @__PURE__ */ p("span", {
165
165
  className: "mb-1 block text-sm font-medium text-text-primary",
166
- children: y("healthybowl.gettingStarted.form.fields.location.label", "Location *")
166
+ children: b("healthybowl.gettingStarted.form.fields.location.label", "Location *")
167
167
  }), /* @__PURE__ */ p("input", {
168
- value: A.location,
169
- onChange: (e) => j((t) => ({
168
+ value: j.location,
169
+ onChange: (e) => M((t) => ({
170
170
  ...t,
171
171
  location: e.target.value
172
172
  })),
173
- placeholder: y("healthybowl.gettingStarted.form.fields.location.placeholder", "District, State"),
173
+ placeholder: b("healthybowl.gettingStarted.form.fields.location.placeholder", "District, State"),
174
174
  maxLength: 500,
175
- className: v
175
+ className: y
176
176
  })]
177
177
  }),
178
178
  /* @__PURE__ */ m("label", {
179
179
  className: "block",
180
180
  children: [/* @__PURE__ */ p("span", {
181
181
  className: "mb-1 block text-sm font-medium text-text-primary",
182
- children: y("healthybowl.gettingStarted.form.fields.totalArea.label", "Total area *")
182
+ children: b("healthybowl.gettingStarted.form.fields.totalArea.label", "Total area *")
183
183
  }), /* @__PURE__ */ p("input", {
184
184
  type: "number",
185
185
  min: 0,
186
- value: A.totalArea || "",
187
- onChange: (e) => j((t) => ({
186
+ value: j.totalArea || "",
187
+ onChange: (e) => M((t) => ({
188
188
  ...t,
189
189
  totalArea: Number(e.target.value)
190
190
  })),
191
191
  placeholder: "0",
192
- className: v
192
+ className: y
193
193
  })]
194
194
  }),
195
195
  /* @__PURE__ */ m("label", {
196
196
  className: "block",
197
197
  children: [/* @__PURE__ */ p("span", {
198
198
  className: "mb-1 block text-sm font-medium text-text-primary",
199
- children: y("healthybowl.gettingStarted.form.fields.unit.label", "Unit")
200
- }), /* @__PURE__ */ m("select", {
201
- value: A.areaUnit,
202
- onChange: (e) => j((t) => ({
199
+ children: b("healthybowl.gettingStarted.form.fields.unit.label", "Unit")
200
+ }), /* @__PURE__ */ m(_, {
201
+ value: j.areaUnit,
202
+ onChange: (e) => M((t) => ({
203
203
  ...t,
204
204
  areaUnit: e.target.value
205
205
  })),
206
- className: v,
206
+ className: y,
207
207
  children: [/* @__PURE__ */ p("option", {
208
208
  value: "acres",
209
- children: y("healthybowl.gettingStarted.form.fields.unit.options.acres", "Acres")
209
+ children: b("healthybowl.gettingStarted.form.fields.unit.options.acres", "Acres")
210
210
  }), /* @__PURE__ */ p("option", {
211
211
  value: "hectares",
212
- children: y("healthybowl.gettingStarted.form.fields.unit.options.hectares", "Hectares")
212
+ children: b("healthybowl.gettingStarted.form.fields.unit.options.hectares", "Hectares")
213
213
  })]
214
214
  })]
215
215
  }),
@@ -217,15 +217,15 @@ var _ = {
217
217
  className: "flex items-center gap-2 sm:col-span-2",
218
218
  children: [/* @__PURE__ */ p("input", {
219
219
  type: "checkbox",
220
- checked: A.organicCertified,
221
- onChange: (e) => j((t) => ({
220
+ checked: j.organicCertified,
221
+ onChange: (e) => M((t) => ({
222
222
  ...t,
223
223
  organicCertified: e.target.checked
224
224
  })),
225
225
  className: "h-4 w-4 rounded border-border-subtle text-primary focus:ring-[var(--color-focus-ring)]"
226
226
  }), /* @__PURE__ */ p("span", {
227
227
  className: "text-sm text-text-primary",
228
- children: y("healthybowl.gettingStarted.form.fields.organicCertified.label", "This farm is organic certified")
228
+ children: b("healthybowl.gettingStarted.form.fields.organicCertified.label", "This farm is organic certified")
229
229
  })]
230
230
  })
231
231
  ]
@@ -234,18 +234,18 @@ var _ = {
234
234
  className: "flex justify-end pt-2",
235
235
  children: /* @__PURE__ */ m("button", {
236
236
  type: "submit",
237
- disabled: M || S.dashboard,
237
+ disabled: N || C.dashboard,
238
238
  className: "flex min-h-[44px] items-center gap-1.5 rounded-md bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text transition-colors hover:bg-action-primary-bg/90 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus focus-visible:ring-offset-2 focus-visible:ring-offset-bg-canvas disabled:opacity-60",
239
- children: [M ? y("healthybowl.gettingStarted.form.submit.creating", "Creating...") : S.dashboard ? y("healthybowl.common.loading", "Loading…") : y("healthybowl.gettingStarted.form.submit.create", "Create Farm"), !M && !S.dashboard && /* @__PURE__ */ p(l, { className: "h-4 w-4" })]
239
+ children: [N ? b("healthybowl.gettingStarted.form.submit.creating", "Creating...") : C.dashboard ? b("healthybowl.common.loading", "Loading…") : b("healthybowl.gettingStarted.form.submit.create", "Create Farm"), !N && !C.dashboard && /* @__PURE__ */ p(l, { className: "h-4 w-4" })]
240
240
  })
241
241
  })
242
242
  ]
243
243
  })
244
244
  ]
245
245
  }), /* @__PURE__ */ p(n, {
246
- toasts: D,
247
- onDismiss: k
246
+ toasts: O,
247
+ onDismiss: A
248
248
  })]
249
249
  });
250
250
  };
251
- export { y as GettingStartedPage };
251
+ export { b as GettingStartedPage };
@@ -5,55 +5,55 @@ import { PRICING_MODELS as n } from "../../../utils/contracts.js";
5
5
  import { useEffect as r, useRef as i, useState as a } from "react";
6
6
  import { useI18n as o } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
7
7
  import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
8
- import { Button as u, Input as d } from "@burdenoff/fe-libs/ui";
8
+ import { Button as u, Input as d, ThemedSelect as f } from "@burdenoff/fe-libs/ui";
9
9
  // src/healthybowl/pages/contracts/contract-forms/CreateContractModal.tsx
10
- var f = "mb-1 block text-sm font-medium text-text-primary", p = "flex h-9 w-full rounded-md border border-border bg-bg-surface px-3 py-1 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-primary";
11
- function m({ open: m, onClose: h, onSubmit: g }) {
12
- let { t: _ } = o(), [v, y] = a(""), [b, x] = a(""), [S, C] = a(""), [w, T] = a("quintal"), [E, D] = a(""), [O, k] = a("FIXED"), [A, j] = a(""), M = i(0), N = () => ({
13
- key: M.current += 1,
10
+ var p = "mb-1 block text-sm font-medium text-text-primary", m = "flex h-9 w-full rounded-md border border-border bg-bg-surface px-3 py-1 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-primary";
11
+ function h({ open: h, onClose: g, onSubmit: _ }) {
12
+ let { t: v } = o(), [y, b] = a(""), [x, S] = a(""), [C, w] = a(""), [T, E] = a("quintal"), [D, O] = a(""), [k, A] = a("FIXED"), [j, M] = a(""), N = i(0), P = () => ({
13
+ key: N.current += 1,
14
14
  label: "",
15
15
  requirement: ""
16
- }), [P, F] = a(() => [N()]), [I, L] = a(""), [R, z] = a(!1), [B, V] = a(null);
16
+ }), [F, I] = a(() => [P()]), [L, R] = a(""), [z, B] = a(!1), [V, H] = a(null);
17
17
  r(() => {
18
- m && (V(null), z(!1), y(""), x(""), C(""), T("quintal"), D(""), k("FIXED"), j(""), F([N()]), L(""));
19
- }, [m]);
20
- let H = Number(S), U = Number(E), W = v.trim() !== "" && Number.isFinite(H) && H > 0 && Number.isFinite(U) && U >= 0;
18
+ h && (H(null), B(!1), b(""), S(""), w(""), E("quintal"), O(""), A("FIXED"), M(""), I([P()]), R(""));
19
+ }, [h]);
20
+ let U = Number(C), W = Number(D), G = y.trim() !== "" && Number.isFinite(U) && U > 0 && Number.isFinite(W) && W >= 0;
21
21
  return /* @__PURE__ */ c(e, {
22
- open: m,
23
- onClose: h,
24
- title: _("healthybowl.contracts.create.title", "New farming contract"),
25
- description: _("healthybowl.contracts.create.description", "Define a forward crop programme — crop, quota and agreed price. It starts as a draft; invite farms next."),
22
+ open: h,
23
+ onClose: g,
24
+ title: v("healthybowl.contracts.create.title", "New farming contract"),
25
+ description: v("healthybowl.contracts.create.description", "Define a forward crop programme — crop, quota and agreed price. It starts as a draft; invite farms next."),
26
26
  size: "md",
27
27
  footer: /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ c(u, {
28
28
  variant: "outline",
29
- onClick: h,
30
- disabled: R,
31
- children: _("healthybowl.common.cancel", "Cancel")
29
+ onClick: g,
30
+ disabled: z,
31
+ children: v("healthybowl.common.cancel", "Cancel")
32
32
  }), /* @__PURE__ */ c(u, {
33
33
  onClick: async () => {
34
- if (!W) V(_("healthybowl.contracts.create.validation", "Enter a crop, a positive quota and an agreed price."));
34
+ if (!G) H(v("healthybowl.contracts.create.validation", "Enter a crop, a positive quota and an agreed price."));
35
35
  else {
36
- z(!0), V(null);
36
+ B(!0), H(null);
37
37
  try {
38
- await g({
39
- crop: v.trim(),
40
- variety: b.trim() || null,
41
- quotaQty: H,
42
- unit: w.trim() || "quintal",
43
- agreedPrice: U,
44
- pricingModel: O,
45
- documentFileId: A.trim() || null,
46
- qualitySpec: t(P, I)
47
- }), h();
38
+ await _({
39
+ crop: y.trim(),
40
+ variety: x.trim() || null,
41
+ quotaQty: U,
42
+ unit: T.trim() || "quintal",
43
+ agreedPrice: W,
44
+ pricingModel: k,
45
+ documentFileId: j.trim() || null,
46
+ qualitySpec: t(F, L)
47
+ }), g();
48
48
  } catch (e) {
49
- V(e instanceof Error ? e.message : String(e));
49
+ H(e instanceof Error ? e.message : String(e));
50
50
  } finally {
51
- z(!1);
51
+ B(!1);
52
52
  }
53
53
  }
54
54
  },
55
- disabled: R || !W,
56
- children: R ? _("healthybowl.contracts.create.saving", "Creating…") : _("healthybowl.contracts.create.submit", "Create contract")
55
+ disabled: z || !G,
56
+ children: z ? v("healthybowl.contracts.create.saving", "Creating…") : v("healthybowl.contracts.create.submit", "Create contract")
57
57
  })] }),
58
58
  children: /* @__PURE__ */ l("div", {
59
59
  className: "space-y-4",
@@ -61,86 +61,86 @@ function m({ open: m, onClose: h, onSubmit: g }) {
61
61
  /* @__PURE__ */ l("div", {
62
62
  className: "grid grid-cols-1 gap-3 sm:grid-cols-2",
63
63
  children: [/* @__PURE__ */ l("div", { children: [/* @__PURE__ */ c("label", {
64
- className: f,
64
+ className: p,
65
65
  htmlFor: "ct-crop",
66
- children: _("healthybowl.contracts.create.crop", "Crop")
66
+ children: v("healthybowl.contracts.create.crop", "Crop")
67
67
  }), /* @__PURE__ */ c(d, {
68
68
  id: "ct-crop",
69
- value: v,
70
- onChange: (e) => y(e.target.value),
69
+ value: y,
70
+ onChange: (e) => b(e.target.value),
71
71
  placeholder: "Maize"
72
72
  })] }), /* @__PURE__ */ l("div", { children: [/* @__PURE__ */ c("label", {
73
- className: f,
73
+ className: p,
74
74
  htmlFor: "ct-variety",
75
- children: _("healthybowl.contracts.create.variety", "Variety (optional)")
75
+ children: v("healthybowl.contracts.create.variety", "Variety (optional)")
76
76
  }), /* @__PURE__ */ c(d, {
77
77
  id: "ct-variety",
78
- value: b,
79
- onChange: (e) => x(e.target.value)
78
+ value: x,
79
+ onChange: (e) => S(e.target.value)
80
80
  })] })]
81
81
  }),
82
82
  /* @__PURE__ */ l("div", {
83
83
  className: "grid grid-cols-1 gap-3 sm:grid-cols-3",
84
84
  children: [
85
85
  /* @__PURE__ */ l("div", { children: [/* @__PURE__ */ c("label", {
86
- className: f,
86
+ className: p,
87
87
  htmlFor: "ct-quota",
88
- children: _("healthybowl.contracts.create.quota", "Quota qty")
88
+ children: v("healthybowl.contracts.create.quota", "Quota qty")
89
89
  }), /* @__PURE__ */ c(d, {
90
90
  id: "ct-quota",
91
91
  type: "number",
92
92
  min: 0,
93
- value: S,
94
- onChange: (e) => C(e.target.value),
93
+ value: C,
94
+ onChange: (e) => w(e.target.value),
95
95
  placeholder: "400"
96
96
  })] }),
97
97
  /* @__PURE__ */ l("div", { children: [/* @__PURE__ */ c("label", {
98
- className: f,
98
+ className: p,
99
99
  htmlFor: "ct-unit",
100
- children: _("healthybowl.contracts.create.unit", "Unit")
100
+ children: v("healthybowl.contracts.create.unit", "Unit")
101
101
  }), /* @__PURE__ */ c(d, {
102
102
  id: "ct-unit",
103
- value: w,
104
- onChange: (e) => T(e.target.value),
103
+ value: T,
104
+ onChange: (e) => E(e.target.value),
105
105
  placeholder: "quintal"
106
106
  })] }),
107
107
  /* @__PURE__ */ l("div", { children: [/* @__PURE__ */ c("label", {
108
- className: f,
108
+ className: p,
109
109
  htmlFor: "ct-price",
110
- children: _("healthybowl.contracts.create.price", "Agreed price (₹/unit)")
110
+ children: v("healthybowl.contracts.create.price", "Agreed price (₹/unit)")
111
111
  }), /* @__PURE__ */ c(d, {
112
112
  id: "ct-price",
113
113
  type: "number",
114
114
  min: 0,
115
- value: E,
116
- onChange: (e) => D(e.target.value),
115
+ value: D,
116
+ onChange: (e) => O(e.target.value),
117
117
  placeholder: "2150"
118
118
  })] })
119
119
  ]
120
120
  }),
121
121
  /* @__PURE__ */ l("div", { children: [/* @__PURE__ */ c("label", {
122
- className: f,
122
+ className: p,
123
123
  htmlFor: "ct-pricing",
124
- children: _("healthybowl.contracts.create.pricingModel", "Pricing model")
125
- }), /* @__PURE__ */ c("select", {
124
+ children: v("healthybowl.contracts.create.pricingModel", "Pricing model")
125
+ }), /* @__PURE__ */ c(f, {
126
126
  id: "ct-pricing",
127
- className: p,
128
- value: O,
129
- onChange: (e) => k(e.target.value),
127
+ className: m,
128
+ value: k,
129
+ onChange: (e) => A(e.target.value),
130
130
  children: n.map((e) => /* @__PURE__ */ c("option", {
131
131
  value: e.value,
132
132
  children: e.label
133
133
  }, e.value))
134
134
  })] }),
135
135
  /* @__PURE__ */ l("div", { children: [/* @__PURE__ */ c("label", {
136
- className: f,
136
+ className: p,
137
137
  htmlFor: "ct-doc",
138
- children: _("healthybowl.contracts.create.document", "Signed contract file id (optional)")
138
+ children: v("healthybowl.contracts.create.document", "Signed contract file id (optional)")
139
139
  }), /* @__PURE__ */ c(d, {
140
140
  id: "ct-doc",
141
- value: A,
142
- onChange: (e) => j(e.target.value),
143
- placeholder: _("healthybowl.contracts.create.documentPlaceholder", "files-svc file id")
141
+ value: j,
142
+ onChange: (e) => M(e.target.value),
143
+ placeholder: v("healthybowl.contracts.create.documentPlaceholder", "files-svc file id")
144
144
  })] }),
145
145
  /* @__PURE__ */ l("div", {
146
146
  className: "rounded-lg border border-border-subtle p-3",
@@ -148,49 +148,49 @@ function m({ open: m, onClose: h, onSubmit: g }) {
148
148
  /* @__PURE__ */ l("div", {
149
149
  className: "mb-1 flex items-center justify-between",
150
150
  children: [/* @__PURE__ */ c("span", {
151
- className: f,
152
- children: _("healthybowl.contracts.create.quality", "Quality standard (optional)")
151
+ className: p,
152
+ children: v("healthybowl.contracts.create.quality", "Quality standard (optional)")
153
153
  }), /* @__PURE__ */ c(u, {
154
154
  type: "button",
155
155
  size: "sm",
156
156
  variant: "ghost",
157
- onClick: () => F((e) => [...e, N()]),
158
- children: _("healthybowl.contracts.create.quality.add", "Add criterion")
157
+ onClick: () => I((e) => [...e, P()]),
158
+ children: v("healthybowl.contracts.create.quality.add", "Add criterion")
159
159
  })]
160
160
  }),
161
161
  /* @__PURE__ */ c("p", {
162
162
  className: "mb-2 text-xs text-text-secondary",
163
- children: _("healthybowl.contracts.create.quality.help", "What the produce must meet. Agreed now, shown to the grader at delivery, and recorded on the result — so an accept or reject can be explained.")
163
+ children: v("healthybowl.contracts.create.quality.help", "What the produce must meet. Agreed now, shown to the grader at delivery, and recorded on the result — so an accept or reject can be explained.")
164
164
  }),
165
165
  /* @__PURE__ */ c("div", {
166
166
  className: "space-y-2",
167
- children: P.map((e, t) => /* @__PURE__ */ l("div", {
167
+ children: F.map((e, t) => /* @__PURE__ */ l("div", {
168
168
  className: "flex items-center gap-2",
169
169
  children: [
170
170
  /* @__PURE__ */ c(d, {
171
171
  "aria-label": `Criterion ${t + 1} name`,
172
172
  value: e.label,
173
- onChange: (e) => F((n) => n.map((n, r) => r === t ? {
173
+ onChange: (e) => I((n) => n.map((n, r) => r === t ? {
174
174
  ...n,
175
175
  label: e.target.value
176
176
  } : n)),
177
- placeholder: _("healthybowl.contracts.create.quality.label", "Moisture")
177
+ placeholder: v("healthybowl.contracts.create.quality.label", "Moisture")
178
178
  }),
179
179
  /* @__PURE__ */ c(d, {
180
180
  "aria-label": `Criterion ${t + 1} requirement`,
181
181
  value: e.requirement,
182
- onChange: (e) => F((n) => n.map((n, r) => r === t ? {
182
+ onChange: (e) => I((n) => n.map((n, r) => r === t ? {
183
183
  ...n,
184
184
  requirement: e.target.value
185
185
  } : n)),
186
- placeholder: _("healthybowl.contracts.create.quality.requirement", "max 12%")
186
+ placeholder: v("healthybowl.contracts.create.quality.requirement", "max 12%")
187
187
  }),
188
188
  /* @__PURE__ */ c(u, {
189
189
  type: "button",
190
190
  size: "sm",
191
191
  variant: "ghost",
192
192
  "aria-label": `Remove criterion ${t + 1}`,
193
- onClick: () => F((e) => e.filter((e, n) => n !== t)),
193
+ onClick: () => I((e) => e.filter((e, n) => n !== t)),
194
194
  children: "×"
195
195
  })
196
196
  ]
@@ -199,18 +199,18 @@ function m({ open: m, onClose: h, onSubmit: g }) {
199
199
  /* @__PURE__ */ c(d, {
200
200
  className: "mt-2",
201
201
  "aria-label": "Quality notes",
202
- value: I,
203
- onChange: (e) => L(e.target.value),
204
- placeholder: _("healthybowl.contracts.create.quality.notes", "How and when it is sampled (optional)")
202
+ value: L,
203
+ onChange: (e) => R(e.target.value),
204
+ placeholder: v("healthybowl.contracts.create.quality.notes", "How and when it is sampled (optional)")
205
205
  })
206
206
  ]
207
207
  }),
208
- B ? /* @__PURE__ */ c("div", {
208
+ V ? /* @__PURE__ */ c("div", {
209
209
  className: "rounded-md border border-status-error-border bg-status-error-bg-subtle px-3 py-2 text-sm text-status-error-text",
210
- children: B
210
+ children: V
211
211
  }) : null
212
212
  ]
213
213
  })
214
214
  });
215
215
  }
216
- export { m as CreateContractModal };
216
+ export { h as CreateContractModal };