@burdenoff/microfe-healthybowl 2026.904.21 → 2026.904.22

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 (140) hide show
  1. package/dist/components/assistant/AssistantChatArea.js +7 -9
  2. package/dist/components/assistant/AssistantChatArea.js.map +1 -1
  3. package/dist/healthybowl/HealthyBowlRoot.js +56 -57
  4. package/dist/healthybowl/HealthyBowlRoot.js.map +1 -1
  5. package/dist/healthybowl/HealthyBowlRoutes.js +36 -48
  6. package/dist/healthybowl/HealthyBowlRoutes.js.map +1 -1
  7. package/dist/healthybowl/components/CreateFarmTaskButton.js.map +1 -1
  8. package/dist/healthybowl/components/PageLayout.js +10 -11
  9. package/dist/healthybowl/components/PageLayout.js.map +1 -1
  10. package/dist/healthybowl/context/HealthyBowlContext.js +7 -7
  11. package/dist/healthybowl/context/HealthyBowlContext.js.map +1 -1
  12. package/dist/healthybowl/hooks/useHealthyBowlCompliance.js +141 -157
  13. package/dist/healthybowl/hooks/useHealthyBowlCompliance.js.map +1 -1
  14. package/dist/healthybowl/hooks/useHealthyBowlData.js +0 -18
  15. package/dist/healthybowl/hooks/useHealthyBowlData.js.map +1 -1
  16. package/dist/healthybowl/hooks/useHealthyBowlDistribution.js +37 -52
  17. package/dist/healthybowl/hooks/useHealthyBowlDistribution.js.map +1 -1
  18. package/dist/healthybowl/hooks/useHealthyBowlLivestockDepth.js +78 -135
  19. package/dist/healthybowl/hooks/useHealthyBowlLivestockDepth.js.map +1 -1
  20. package/dist/healthybowl/hooks/useIrrigationAutomation.js +1 -1
  21. package/dist/healthybowl/hooks/useIrrigationAutomation.js.map +1 -1
  22. package/dist/healthybowl/hooks/useSuccessionPlanning.js +1 -1
  23. package/dist/healthybowl/hooks/useSuccessionPlanning.js.map +1 -1
  24. package/dist/healthybowl/hooks/useWeatherIntelligence.js +1 -1
  25. package/dist/healthybowl/hooks/useWeatherIntelligence.js.map +1 -1
  26. package/dist/healthybowl/offline/OfflineStatusPill.js +21 -40
  27. package/dist/healthybowl/offline/OfflineStatusPill.js.map +1 -1
  28. package/dist/healthybowl/offline/OfflineSyncProvider.js +130 -153
  29. package/dist/healthybowl/offline/OfflineSyncProvider.js.map +1 -1
  30. package/dist/healthybowl/offline/graphql.js.map +1 -1
  31. package/dist/healthybowl/offline/store.js +1 -1
  32. package/dist/healthybowl/offline/syncEngine.js +1 -2
  33. package/dist/healthybowl/offline/syncEngine.js.map +1 -1
  34. package/dist/healthybowl/offline/types.js.map +1 -1
  35. package/dist/healthybowl/pages/GettingStartedPage.js +0 -1
  36. package/dist/healthybowl/pages/GettingStartedPage.js.map +1 -1
  37. package/dist/healthybowl/pages/analytics/InsightsPage.js +2 -2
  38. package/dist/healthybowl/pages/analytics/InsightsPage.js.map +1 -1
  39. package/dist/healthybowl/pages/analytics/ReportsPage.js +99 -136
  40. package/dist/healthybowl/pages/analytics/ReportsPage.js.map +1 -1
  41. package/dist/healthybowl/pages/compliance/ComplianceOverviewPage.js +162 -204
  42. package/dist/healthybowl/pages/compliance/ComplianceOverviewPage.js.map +1 -1
  43. package/dist/healthybowl/pages/compliance/IcsGroupDetailPage.js +178 -196
  44. package/dist/healthybowl/pages/compliance/IcsGroupDetailPage.js.map +1 -1
  45. package/dist/healthybowl/pages/compliance/IcsGrowerDetailPage.js +141 -142
  46. package/dist/healthybowl/pages/compliance/IcsGrowerDetailPage.js.map +1 -1
  47. package/dist/healthybowl/pages/crops/CropFieldsPage.js +0 -2
  48. package/dist/healthybowl/pages/crops/CropFieldsPage.js.map +1 -1
  49. package/dist/healthybowl/pages/crops/CropHarvestPage.js +272 -316
  50. package/dist/healthybowl/pages/crops/CropHarvestPage.js.map +1 -1
  51. package/dist/healthybowl/pages/crops/CropPlanningPage.js +0 -6
  52. package/dist/healthybowl/pages/crops/CropPlanningPage.js.map +1 -1
  53. package/dist/healthybowl/pages/crops/FieldDetailsPage.js +846 -871
  54. package/dist/healthybowl/pages/crops/FieldDetailsPage.js.map +1 -1
  55. package/dist/healthybowl/pages/crops/HarvestDetailsPage.js +334 -376
  56. package/dist/healthybowl/pages/crops/HarvestDetailsPage.js.map +1 -1
  57. package/dist/healthybowl/pages/distribution/CsaPlanDetailPage.js +188 -415
  58. package/dist/healthybowl/pages/distribution/CsaPlanDetailPage.js.map +1 -1
  59. package/dist/healthybowl/pages/distribution/labels.js +2 -10
  60. package/dist/healthybowl/pages/distribution/labels.js.map +1 -1
  61. package/dist/healthybowl/pages/farm/FarmProfilePage.js +0 -1
  62. package/dist/healthybowl/pages/farm/FarmProfilePage.js.map +1 -1
  63. package/dist/healthybowl/pages/field-capture/CaptureObservationForm.js +8 -8
  64. package/dist/healthybowl/pages/fields/FieldMapPage.js +0 -2
  65. package/dist/healthybowl/pages/fields/FieldMapPage.js.map +1 -1
  66. package/dist/healthybowl/pages/financial/FinancialReportsPage.js +107 -92
  67. package/dist/healthybowl/pages/financial/FinancialReportsPage.js.map +1 -1
  68. package/dist/healthybowl/pages/government-schemes/ApplicationTrackingPage.js +188 -228
  69. package/dist/healthybowl/pages/government-schemes/ApplicationTrackingPage.js.map +1 -1
  70. package/dist/healthybowl/pages/government-schemes/SchemeDetailsPage.js +191 -261
  71. package/dist/healthybowl/pages/government-schemes/SchemeDetailsPage.js.map +1 -1
  72. package/dist/healthybowl/pages/inputs-insurance/InputsInsuranceOverviewPage.js +14 -14
  73. package/dist/healthybowl/pages/inputs-insurance/InputsInsuranceOverviewPage.js.map +1 -1
  74. package/dist/healthybowl/pages/irrigation/IrrigationPage.js +307 -338
  75. package/dist/healthybowl/pages/irrigation/IrrigationPage.js.map +1 -1
  76. package/dist/healthybowl/pages/livestock/AnimalDepthFormModal.js +102 -126
  77. package/dist/healthybowl/pages/livestock/AnimalDepthFormModal.js.map +1 -1
  78. package/dist/healthybowl/pages/livestock/AnimalDepthPage.js +215 -257
  79. package/dist/healthybowl/pages/livestock/AnimalDepthPage.js.map +1 -1
  80. package/dist/healthybowl/pages/livestock/GrazingPage.js +0 -1
  81. package/dist/healthybowl/pages/livestock/GrazingPage.js.map +1 -1
  82. package/dist/healthybowl/pages/livestock/HerdDepthPage.js +0 -4
  83. package/dist/healthybowl/pages/livestock/HerdDepthPage.js.map +1 -1
  84. package/dist/healthybowl/pages/livestock/grazing/RecordGrazingMoveModal.js +9 -8
  85. package/dist/healthybowl/pages/livestock/grazing/RecordGrazingMoveModal.js.map +1 -1
  86. package/dist/healthybowl/pages/network/ExpertsPage.js +419 -520
  87. package/dist/healthybowl/pages/network/ExpertsPage.js.map +1 -1
  88. package/dist/healthybowl/pages/weather/WeatherAlertHistoryPage.js +130 -129
  89. package/dist/healthybowl/pages/weather/WeatherAlertHistoryPage.js.map +1 -1
  90. package/dist/healthybowl/pages/weather/WeatherSettingsPage.js +237 -285
  91. package/dist/healthybowl/pages/weather/WeatherSettingsPage.js.map +1 -1
  92. package/dist/healthybowl/utils/plantingCapacity.js +10 -10
  93. package/dist/healthybowl/utils/plantingCapacity.js.map +1 -1
  94. package/dist/node_modules/fast-equals/dist/es/index.js +86 -74
  95. package/dist/node_modules/fast-equals/dist/es/index.js.map +1 -1
  96. package/dist/services/assistantApi.js +30 -59
  97. package/dist/services/assistantApi.js.map +1 -1
  98. package/dist/utils/pageContext.js +1 -15
  99. package/dist/utils/pageContext.js.map +1 -1
  100. package/package.json +1 -1
  101. package/dist/healthybowl/hooks/useAgronomyDecisions.js +0 -79
  102. package/dist/healthybowl/hooks/useAgronomyDecisions.js.map +0 -1
  103. package/dist/healthybowl/hooks/useAnalyticsReports.js +0 -173
  104. package/dist/healthybowl/hooks/useAnalyticsReports.js.map +0 -1
  105. package/dist/healthybowl/hooks/useComplianceExports.js +0 -74
  106. package/dist/healthybowl/hooks/useComplianceExports.js.map +0 -1
  107. package/dist/healthybowl/hooks/useConsultationPayments.js +0 -59
  108. package/dist/healthybowl/hooks/useConsultationPayments.js.map +0 -1
  109. package/dist/healthybowl/hooks/usePlantingEstimate.js +0 -88
  110. package/dist/healthybowl/hooks/usePlantingEstimate.js.map +0 -1
  111. package/dist/healthybowl/offline/HeaderOfflinePill.js +0 -28
  112. package/dist/healthybowl/offline/HeaderOfflinePill.js.map +0 -1
  113. package/dist/healthybowl/offline/captureCache.js +0 -30
  114. package/dist/healthybowl/offline/captureCache.js.map +0 -1
  115. package/dist/healthybowl/offline/headerSlot.js +0 -24
  116. package/dist/healthybowl/offline/headerSlot.js.map +0 -1
  117. package/dist/healthybowl/pages/ai/AiDecisionsPage.js +0 -287
  118. package/dist/healthybowl/pages/ai/AiDecisionsPage.js.map +0 -1
  119. package/dist/healthybowl/pages/compliance/ResidueTestsPage.js +0 -291
  120. package/dist/healthybowl/pages/compliance/ResidueTestsPage.js.map +0 -1
  121. package/dist/healthybowl/pages/compliance/SubstanceRulesPage.js +0 -300
  122. package/dist/healthybowl/pages/compliance/SubstanceRulesPage.js.map +0 -1
  123. package/dist/healthybowl/pages/compliance/substanceRuleForm.js +0 -135
  124. package/dist/healthybowl/pages/compliance/substanceRuleForm.js.map +0 -1
  125. package/dist/healthybowl/pages/government-schemes/schemeApplicationTransitions.js +0 -49
  126. package/dist/healthybowl/pages/government-schemes/schemeApplicationTransitions.js.map +0 -1
  127. package/dist/healthybowl/pages/government-schemes/schemeDocumentSlots.js +0 -48
  128. package/dist/healthybowl/pages/government-schemes/schemeDocumentSlots.js.map +0 -1
  129. package/dist/healthybowl/pages/government-schemes/useSchemeApplicationTransition.js +0 -54
  130. package/dist/healthybowl/pages/government-schemes/useSchemeApplicationTransition.js.map +0 -1
  131. package/dist/healthybowl/pages/livestock/PedigreeTree.js +0 -154
  132. package/dist/healthybowl/pages/livestock/PedigreeTree.js.map +0 -1
  133. package/dist/healthybowl/pages/livestock/eidTagInput.js +0 -39
  134. package/dist/healthybowl/pages/livestock/eidTagInput.js.map +0 -1
  135. package/dist/healthybowl/pages/livestock/pedigreeLayout.js +0 -68
  136. package/dist/healthybowl/pages/livestock/pedigreeLayout.js.map +0 -1
  137. package/dist/healthybowl/pages/weather/alertDelivery.js +0 -105
  138. package/dist/healthybowl/pages/weather/alertDelivery.js.map +0 -1
  139. package/dist/healthybowl/utils/icsInspection.js +0 -18
  140. package/dist/healthybowl/utils/icsInspection.js.map +0 -1
@@ -10,29 +10,28 @@ import { useConfirm as ne } from "../../components/ConfirmDialog.js";
10
10
  import { PageLoader as re } from "../../components/PageLoader.js";
11
11
  import { Modal as c } from "../../components/Modal.js";
12
12
  import { useToast as ie } from "../../hooks/useToast.js";
13
- import { CreateFarmTaskButton as ae } from "../../components/CreateFarmTaskButton.js";
14
13
  import "../../components/index.js";
15
- import { useHealthyBowlData as oe } from "../../hooks/useHealthyBowlData.js";
16
- import { Tooltip as se } from "../../../node_modules/recharts/es6/component/Tooltip.js";
17
- import { ResponsiveContainer as l } from "../../../node_modules/recharts/es6/component/ResponsiveContainer.js";
18
- import { CartesianGrid as u } from "../../../node_modules/recharts/es6/cartesian/CartesianGrid.js";
19
- import { Area as ce } from "../../../node_modules/recharts/es6/cartesian/Area.js";
20
- import { XAxis as d } from "../../../node_modules/recharts/es6/cartesian/XAxis.js";
21
- import { YAxis as f } from "../../../node_modules/recharts/es6/cartesian/YAxis.js";
22
- import { AreaChart as p } from "../../../node_modules/recharts/es6/chart/AreaChart.js";
23
- import { useIrrigation as m } from "../../hooks/useIrrigation.js";
14
+ import { useHealthyBowlData as ae } from "../../hooks/useHealthyBowlData.js";
15
+ import { Tooltip as oe } from "../../../node_modules/recharts/es6/component/Tooltip.js";
16
+ import { ResponsiveContainer as se } from "../../../node_modules/recharts/es6/component/ResponsiveContainer.js";
17
+ import { CartesianGrid as l } from "../../../node_modules/recharts/es6/cartesian/CartesianGrid.js";
18
+ import { Area as u } from "../../../node_modules/recharts/es6/cartesian/Area.js";
19
+ import { XAxis as ce } from "../../../node_modules/recharts/es6/cartesian/XAxis.js";
20
+ import { YAxis as d } from "../../../node_modules/recharts/es6/cartesian/YAxis.js";
21
+ import { AreaChart as f } from "../../../node_modules/recharts/es6/chart/AreaChart.js";
22
+ import { useIrrigation as p } from "../../hooks/useIrrigation.js";
24
23
  import { useIrrigationAutomation as le } from "../../hooks/useIrrigationAutomation.js";
25
- import { useMemo as h, useState as g } from "react";
24
+ import { useMemo as m, useState as h } from "react";
26
25
  import { useI18n as ue } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
27
- import { CalendarClock as _, Droplet as v, Droplets as y, GitBranch as de, Loader2 as b, Pause as fe, Pencil as x, Play as pe, Plus as S, Sparkles as C, Trash2 as me, Waves as w, Zap as he } from "lucide-react";
28
- import { Fragment as T, jsx as E, jsxs as D } from "react/jsx-runtime";
29
- import { Button as O } from "@burdenoff/fe-libs/ui";
26
+ import { CalendarClock as g, Droplet as _, Droplets as v, GitBranch as de, Loader2 as y, Pause as fe, Pencil as b, Play as pe, Plus as x, Sparkles as S, Trash2 as me, Waves as C, Zap as he } from "lucide-react";
27
+ import { Fragment as w, jsx as T, jsxs as E } from "react/jsx-runtime";
28
+ import { Button as D } from "@burdenoff/fe-libs/ui";
30
29
  //#region src/healthybowl/pages/irrigation/IrrigationPage.tsx
31
- var k = "h-9 w-full rounded-md border border-border-subtle bg-bg-surface px-3 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]", A = [
30
+ var O = "h-9 w-full rounded-md border border-border-subtle bg-bg-surface px-3 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]", k = [
32
31
  "DRIP",
33
32
  "SPRINKLER",
34
33
  "FLOOD"
35
- ], j = [
34
+ ], A = [
36
35
  "mon",
37
36
  "tue",
38
37
  "wed",
@@ -48,12 +47,12 @@ var k = "h-9 w-full rounded-md border border-border-subtle bg-bg-surface px-3 te
48
47
  "Fri",
49
48
  "Sat",
50
49
  "Sun"
51
- ], M = (e) => {
50
+ ], j = (e) => {
52
51
  let t = e.trim();
53
52
  if (!t) return;
54
53
  let n = Number(t);
55
54
  return Number.isFinite(n) ? n : void 0;
56
- }, N = {
55
+ }, M = {
57
56
  fieldId: "",
58
57
  cropId: "",
59
58
  method: "DRIP",
@@ -61,15 +60,15 @@ var k = "h-9 w-full rounded-md border border-border-subtle bg-bg-surface px-3 te
61
60
  durationMin: "30",
62
61
  startTime: "06:00",
63
62
  status: "active"
64
- }, P = {
63
+ }, N = {
65
64
  fieldId: "",
66
65
  scheduleId: "",
67
66
  litres: "",
68
67
  date: n(),
69
68
  status: "ran",
70
69
  skippedReason: ""
71
- }, _e = () => {
72
- let { t } = ue(), de = ne(), { schedules: b, runs: C, loading: _e, error: F, refetch: ye, createSchedule: be, updateSchedule: xe, deleteSchedule: Se, setScheduleStatus: Ce, logWateringRun: we } = m(), { fields: I, crops: L } = oe(), { automations: Te } = le(), { toasts: Ee, toast: R, dismiss: De } = ie(), Oe = h(() => new Map(I.map((e) => [e.id, e])), [I]), ke = h(() => new Map(L.map((e) => [e.id, e])), [L]), z = (e) => e && Oe.get(e)?.name || t("healthybowl.irrigation.unknownField", "Unknown field"), Ae = (e) => e ? ke.get(e)?.name ?? null : null, B = (e) => t(`healthybowl.irrigation.method.${e.toLowerCase()}`, e.charAt(0) + e.slice(1).toLowerCase()), V = h(() => b.filter((e) => e.status === "active"), [b]), je = h(() => Te.filter((e) => e.status === "active").length, [!0, Te]), Me = h(() => new Set(V.map((e) => e.fieldId)).size, [V]), Ne = n(), Pe = h(() => C.filter((e) => e.status === "ran" && (e.runAt ?? "").slice(0, 10) === Ne).reduce((e, t) => e + (t.litres ?? 0), 0), [C, Ne]), H = h(() => {
70
+ }, P = () => {
71
+ let { t } = ue(), de = ne(), { schedules: y, runs: S, loading: P, error: F, refetch: ve, createSchedule: ye, updateSchedule: be, deleteSchedule: xe, setScheduleStatus: Se, logWateringRun: Ce } = p(), { fields: I, crops: L } = ae(), { automations: we } = le(), { toasts: Te, toast: R, dismiss: Ee } = ie(), De = m(() => new Map(I.map((e) => [e.id, e])), [I]), Oe = m(() => new Map(L.map((e) => [e.id, e])), [L]), z = (e) => e && De.get(e)?.name || t("healthybowl.irrigation.unknownField", "Unknown field"), ke = (e) => e ? Oe.get(e)?.name ?? null : null, B = (e) => t(`healthybowl.irrigation.method.${e.toLowerCase()}`, e.charAt(0) + e.slice(1).toLowerCase()), V = m(() => y.filter((e) => e.status === "active"), [y]), Ae = m(() => we.filter((e) => e.status === "active").length, [!0, we]), je = m(() => new Set(V.map((e) => e.fieldId)).size, [V]), Me = n(), Ne = m(() => S.filter((e) => e.status === "ran" && (e.runAt ?? "").slice(0, 10) === Me).reduce((e, t) => e + (t.litres ?? 0), 0), [S, Me]), H = m(() => {
73
72
  let e = /* @__PURE__ */ new Date(), t = null;
74
73
  for (let n of V) {
75
74
  let [r, i] = (n.startTime || "00:00").split(":").map((e) => Number(e) || 0), a = new Date(e);
@@ -84,17 +83,17 @@ var k = "h-9 w-full rounded-md border border-border-subtle bg-bg-surface px-3 te
84
83
  fieldId: t.fieldId,
85
84
  hours: n
86
85
  };
87
- }, [V]), Fe = H ? H.hours <= 48 ? t("healthybowl.irrigation.stats.nextRun.inHours", "{{field}} · in {{hours}}h", {
86
+ }, [V]), Pe = H ? H.hours <= 48 ? t("healthybowl.irrigation.stats.nextRun.inHours", "{{field}} · in {{hours}}h", {
88
87
  field: z(H.fieldId),
89
88
  hours: String(H.hours)
90
- }) : z(H.fieldId) : "—", Ie = h(() => {
91
- let e = j.map(() => []);
89
+ }) : z(H.fieldId) : "—", Fe = m(() => {
90
+ let e = A.map(() => []);
92
91
  for (let t of V) {
93
92
  let n = Math.max(1, t.frequencyDays || 1);
94
93
  for (let r = 0; r < 7; r += 1) r % n === 0 && e[r].push(t);
95
94
  }
96
95
  return e;
97
- }, [V]), Le = h(() => {
96
+ }, [V]), Ie = m(() => {
98
97
  let e = [];
99
98
  for (let t = 6; t >= 0; --t) {
100
99
  let n = /* @__PURE__ */ new Date();
@@ -107,7 +106,7 @@ var k = "h-9 w-full rounded-md border border-border-subtle bg-bg-surface px-3 te
107
106
  });
108
107
  }
109
108
  let t = new Map(e.map((e) => [e.key, e]));
110
- for (let e of C) {
109
+ for (let e of S) {
111
110
  if (e.status !== "ran") continue;
112
111
  let n = t.get((e.runAt ?? "").slice(0, 10));
113
112
  n && (n.litres += e.litres ?? 0);
@@ -116,32 +115,32 @@ var k = "h-9 w-full rounded-md border border-border-subtle bg-bg-surface px-3 te
116
115
  day: e.label,
117
116
  litres: Math.round(e.litres)
118
117
  }));
119
- }, [C]), Re = h(() => {
118
+ }, [S]), Le = m(() => {
120
119
  let e = /* @__PURE__ */ new Map();
121
- for (let t of C) t.scheduleId && e.set(t.scheduleId, (e.get(t.scheduleId) ?? 0) + 1);
120
+ for (let t of S) t.scheduleId && e.set(t.scheduleId, (e.get(t.scheduleId) ?? 0) + 1);
122
121
  return e;
123
- }, [C]), [ze, U] = g(!1), [W, G] = g(null), [K, q] = g(N), [Be, Ve] = g(!1), J = (e, t) => q((n) => ({
122
+ }, [S]), [Re, U] = h(!1), [W, G] = h(null), [K, q] = h(M), [ze, Be] = h(!1), J = (e, t) => q((n) => ({
124
123
  ...n,
125
124
  [e]: t
126
- })), He = () => {
125
+ })), Ve = () => {
127
126
  q({
128
- ...N,
127
+ ...M,
129
128
  fieldId: I[0]?.id ?? ""
130
129
  }), G(null), U(!0);
131
- }, Ue = (e) => {
130
+ }, He = (e) => {
132
131
  q({
133
132
  fieldId: e.fieldId,
134
133
  cropId: e.cropId ?? "",
135
- method: A.includes(e.method) ? e.method : "DRIP",
134
+ method: k.includes(e.method) ? e.method : "DRIP",
136
135
  frequencyDays: String(e.frequencyDays ?? 1),
137
136
  durationMin: String(e.durationMin ?? 0),
138
137
  startTime: e.startTime || "06:00",
139
138
  status: e.status === "paused" ? "paused" : "active"
140
139
  }), G(e.id), U(!0);
141
140
  }, Y = () => {
142
- q(N), G(null), U(!1);
143
- }, We = async () => {
144
- let e = M(K.frequencyDays), n = M(K.durationMin);
141
+ q(M), G(null), U(!1);
142
+ }, Ue = async () => {
143
+ let e = j(K.frequencyDays), n = j(K.durationMin);
145
144
  if (!K.fieldId || !e || !n || !K.startTime) {
146
145
  R({
147
146
  title: t("healthybowl.irrigation.schedule.toast.required.title", "Missing required fields"),
@@ -159,12 +158,12 @@ var k = "h-9 w-full rounded-md border border-border-subtle bg-bg-surface px-3 te
159
158
  startTime: K.startTime,
160
159
  status: K.status
161
160
  };
162
- Ve(!0);
161
+ Be(!0);
163
162
  try {
164
- W ? (await xe(W, r), R({
163
+ W ? (await be(W, r), R({
165
164
  title: t("healthybowl.irrigation.schedule.toast.updated.title", "Schedule updated"),
166
165
  variant: "success"
167
- })) : (await be(r), R({
166
+ })) : (await ye(r), R({
168
167
  title: t("healthybowl.irrigation.schedule.toast.added.title", "Schedule created"),
169
168
  description: t("healthybowl.irrigation.schedule.toast.added.description", "{{field}} is now on a watering schedule.", { field: z(r.fieldId) }),
170
169
  variant: "success"
@@ -176,11 +175,11 @@ var k = "h-9 w-full rounded-md border border-border-subtle bg-bg-surface px-3 te
176
175
  variant: "error"
177
176
  });
178
177
  } finally {
179
- Ve(!1);
178
+ Be(!1);
180
179
  }
181
- }, Ge = async (e) => {
180
+ }, We = async (e) => {
182
181
  if (await de({ message: t("healthybowl.irrigation.schedule.confirm.delete", "Delete the irrigation schedule for {{field}}? This cannot be undone.", { field: z(e.fieldId) }) })) try {
183
- await Se(e.id), R({
182
+ await xe(e.id), R({
184
183
  title: t("healthybowl.irrigation.schedule.toast.deleted.title", "Schedule deleted"),
185
184
  variant: "success"
186
185
  });
@@ -191,10 +190,10 @@ var k = "h-9 w-full rounded-md border border-border-subtle bg-bg-surface px-3 te
191
190
  variant: "error"
192
191
  });
193
192
  }
194
- }, Ke = async (e) => {
193
+ }, Ge = async (e) => {
195
194
  let n = e.status === "active" ? "paused" : "active";
196
195
  try {
197
- await Ce(e.id, n), R({
196
+ await Se(e.id, n), R({
198
197
  title: n === "active" ? t("healthybowl.irrigation.schedule.toast.resumed.title", "Schedule resumed") : t("healthybowl.irrigation.schedule.toast.paused.title", "Schedule paused"),
199
198
  variant: "success"
200
199
  });
@@ -205,16 +204,16 @@ var k = "h-9 w-full rounded-md border border-border-subtle bg-bg-surface px-3 te
205
204
  variant: "error"
206
205
  });
207
206
  }
208
- }, [qe, X] = g(!1), [Z, Q] = g(P), [Je, Ye] = g(!1), $ = (e, t) => Q((n) => ({
207
+ }, [Ke, X] = h(!1), [Z, Q] = h(N), [qe, Je] = h(!1), $ = (e, t) => Q((n) => ({
209
208
  ...n,
210
209
  [e]: t
211
- })), Xe = () => {
210
+ })), Ye = () => {
212
211
  Q({
213
- ...P,
212
+ ...N,
214
213
  fieldId: I[0]?.id ?? "",
215
214
  date: n()
216
215
  }), X(!0);
217
- }, Ze = h(() => b.filter((e) => e.fieldId === Z.fieldId), [b, Z.fieldId]), Qe = async () => {
216
+ }, Xe = m(() => y.filter((e) => e.fieldId === Z.fieldId), [y, Z.fieldId]), Ze = async () => {
218
217
  if (!Z.fieldId) {
219
218
  R({
220
219
  title: t("healthybowl.irrigation.run.toast.required.title", "Field required"),
@@ -223,12 +222,12 @@ var k = "h-9 w-full rounded-md border border-border-subtle bg-bg-surface px-3 te
223
222
  });
224
223
  return;
225
224
  }
226
- Ye(!0);
225
+ Je(!0);
227
226
  try {
228
- await we({
227
+ await Ce({
229
228
  fieldId: Z.fieldId,
230
229
  scheduleId: Z.scheduleId || void 0,
231
- litres: Z.status === "ran" ? M(Z.litres) : void 0,
230
+ litres: Z.status === "ran" ? j(Z.litres) : void 0,
232
231
  runAt: `${Z.date}T12:00:00`,
233
232
  status: Z.status,
234
233
  skippedReason: Z.status === "skipped" && Z.skippedReason.trim() || void 0,
@@ -237,7 +236,7 @@ var k = "h-9 w-full rounded-md border border-border-subtle bg-bg-surface px-3 te
237
236
  title: t("healthybowl.irrigation.run.toast.logged.title", "Watering run logged"),
238
237
  description: t("healthybowl.irrigation.run.toast.logged.description", "Recorded for {{field}}.", { field: z(Z.fieldId) }),
239
238
  variant: "success"
240
- }), X(!1), Q(P);
239
+ }), X(!1), Q(N);
241
240
  } catch (e) {
242
241
  R({
243
242
  title: t("healthybowl.irrigation.run.toast.error.title", "Could not log watering run"),
@@ -245,13 +244,13 @@ var k = "h-9 w-full rounded-md border border-border-subtle bg-bg-surface px-3 te
245
244
  variant: "error"
246
245
  });
247
246
  } finally {
248
- Ye(!1);
247
+ Je(!1);
249
248
  }
250
- }, $e = [
249
+ }, Qe = [
251
250
  {
252
251
  key: "field",
253
252
  header: t("healthybowl.irrigation.columns.field", "Field"),
254
- render: (e) => /* @__PURE__ */ E("span", {
253
+ render: (e) => /* @__PURE__ */ T("span", {
255
254
  className: "font-medium text-text-primary",
256
255
  children: z(e.fieldId)
257
256
  })
@@ -259,15 +258,15 @@ var k = "h-9 w-full rounded-md border border-border-subtle bg-bg-surface px-3 te
259
258
  {
260
259
  key: "crop",
261
260
  header: t("healthybowl.irrigation.columns.crop", "Crop"),
262
- render: (e) => /* @__PURE__ */ E("span", {
261
+ render: (e) => /* @__PURE__ */ T("span", {
263
262
  className: "text-text-secondary",
264
- children: Ae(e.cropId) ?? "—"
263
+ children: ke(e.cropId) ?? "—"
265
264
  })
266
265
  },
267
266
  {
268
267
  key: "method",
269
268
  header: t("healthybowl.irrigation.columns.method", "Method"),
270
- render: (e) => /* @__PURE__ */ E(o, {
269
+ render: (e) => /* @__PURE__ */ T(o, {
271
270
  label: B(e.method),
272
271
  variant: "info"
273
272
  })
@@ -275,7 +274,7 @@ var k = "h-9 w-full rounded-md border border-border-subtle bg-bg-surface px-3 te
275
274
  {
276
275
  key: "frequency",
277
276
  header: t("healthybowl.irrigation.columns.frequency", "Frequency"),
278
- render: (e) => /* @__PURE__ */ E("span", {
277
+ render: (e) => /* @__PURE__ */ T("span", {
279
278
  className: "text-text-secondary",
280
279
  children: t("healthybowl.irrigation.everyNDays", "Every {{n}} day(s)", { n: String(e.frequencyDays) })
281
280
  })
@@ -283,7 +282,7 @@ var k = "h-9 w-full rounded-md border border-border-subtle bg-bg-surface px-3 te
283
282
  {
284
283
  key: "duration",
285
284
  header: t("healthybowl.irrigation.columns.duration", "Duration"),
286
- render: (e) => /* @__PURE__ */ D("span", {
285
+ render: (e) => /* @__PURE__ */ E("span", {
287
286
  className: "tabular-nums text-text-secondary",
288
287
  children: [
289
288
  t("healthybowl.irrigation.minutes", "{{n}} min", { n: String(e.durationMin) }),
@@ -295,14 +294,14 @@ var k = "h-9 w-full rounded-md border border-border-subtle bg-bg-surface px-3 te
295
294
  {
296
295
  key: "status",
297
296
  header: t("healthybowl.irrigation.columns.status", "Status"),
298
- render: (n) => /* @__PURE__ */ D("button", {
297
+ render: (n) => /* @__PURE__ */ E("button", {
299
298
  type: "button",
300
299
  onClick: (e) => {
301
- e.stopPropagation(), Ke(n);
300
+ e.stopPropagation(), Ge(n);
302
301
  },
303
302
  className: e("inline-flex items-center gap-1.5 rounded-full border px-2.5 py-1 text-xs font-medium transition-colors", n.status === "active" ? "border-status-success-text/30 bg-status-success-bg/10 text-status-success-text" : "border-border-subtle bg-bg-sunken text-text-secondary"),
304
303
  "aria-label": n.status === "active" ? t("healthybowl.irrigation.actions.pause", "Pause schedule") : t("healthybowl.irrigation.actions.resume", "Resume schedule"),
305
- children: [n.status === "active" ? /* @__PURE__ */ E(pe, { className: "h-3 w-3" }) : /* @__PURE__ */ E(fe, { className: "h-3 w-3" }), n.status === "active" ? t("healthybowl.irrigation.status.active", "Active") : t("healthybowl.irrigation.status.paused", "Paused")]
304
+ children: [n.status === "active" ? /* @__PURE__ */ T(pe, { className: "h-3 w-3" }) : /* @__PURE__ */ T(fe, { className: "h-3 w-3" }), n.status === "active" ? t("healthybowl.irrigation.status.active", "Active") : t("healthybowl.irrigation.status.paused", "Paused")]
306
305
  })
307
306
  },
308
307
  {
@@ -310,149 +309,138 @@ var k = "h-9 w-full rounded-md border border-border-subtle bg-bg-surface px-3 te
310
309
  header: "",
311
310
  sortable: !1,
312
311
  className: "text-end",
313
- render: (e) => /* @__PURE__ */ D("div", {
312
+ render: (e) => /* @__PURE__ */ E("div", {
314
313
  className: "flex items-center justify-end gap-2",
315
- children: [
316
- /* @__PURE__ */ E(ae, {
317
- entityType: "IRRIGATION_SCHEDULE",
318
- entityId: e.id,
319
- entityLabel: z(e.fieldId),
320
- iconOnly: !0,
321
- size: "icon-sm",
322
- title: t("healthybowl.irrigation.createTask", "Create a task for this schedule")
323
- }),
324
- /* @__PURE__ */ E(O, {
325
- variant: "outline",
326
- size: "icon-sm",
327
- onClick: (t) => {
328
- t.stopPropagation(), Ue(e);
329
- },
330
- "aria-label": t("healthybowl.common.edit", "Edit"),
331
- children: /* @__PURE__ */ E(x, { className: "h-4 w-4" })
332
- }),
333
- /* @__PURE__ */ E(O, {
334
- variant: "ghost",
335
- size: "icon-sm",
336
- onClick: (t) => {
337
- t.stopPropagation(), Ge(e);
338
- },
339
- "aria-label": t("healthybowl.common.delete", "Delete"),
340
- className: "text-status-error-text hover:bg-status-error-bg/10 hover:text-status-error-text",
341
- children: /* @__PURE__ */ E(me, { className: "h-4 w-4" })
342
- })
343
- ]
314
+ children: [/* @__PURE__ */ T(D, {
315
+ variant: "outline",
316
+ size: "icon-sm",
317
+ onClick: (t) => {
318
+ t.stopPropagation(), He(e);
319
+ },
320
+ "aria-label": t("healthybowl.common.edit", "Edit"),
321
+ children: /* @__PURE__ */ T(b, { className: "h-4 w-4" })
322
+ }), /* @__PURE__ */ T(D, {
323
+ variant: "ghost",
324
+ size: "icon-sm",
325
+ onClick: (t) => {
326
+ t.stopPropagation(), We(e);
327
+ },
328
+ "aria-label": t("healthybowl.common.delete", "Delete"),
329
+ className: "text-status-error-text hover:bg-status-error-bg/10 hover:text-status-error-text",
330
+ children: /* @__PURE__ */ T(me, { className: "h-4 w-4" })
331
+ })]
344
332
  })
345
333
  }
346
- ], et = b.length > 0 || C.length > 0, tt = Math.max(1, ...Le.map((e) => e.litres));
347
- return /* @__PURE__ */ D(r, {
334
+ ], $e = y.length > 0 || S.length > 0, et = Math.max(1, ...Ie.map((e) => e.litres));
335
+ return /* @__PURE__ */ E(r, {
348
336
  title: t("healthybowl.irrigation.title", "Irrigation Scheduling & Automation"),
349
337
  description: t("healthybowl.irrigation.description", "Schedule watering per field, log runs, and track water usage"),
350
338
  purpose: "Define a watering schedule for each field — method, cadence, duration and daily start time — then log the runs you carry out. HealthyBowl tallies your water usage and previews the automation rules that will run these schedules for you in Phase B.",
351
- actions: /* @__PURE__ */ D("div", {
339
+ actions: /* @__PURE__ */ E("div", {
352
340
  className: "flex items-center gap-2",
353
- children: [/* @__PURE__ */ D(O, {
341
+ children: [/* @__PURE__ */ E(D, {
354
342
  variant: "outline",
355
- onClick: Xe,
343
+ onClick: Ye,
356
344
  disabled: I.length === 0,
357
345
  children: [
358
- /* @__PURE__ */ E(v, { className: "h-4 w-4" }),
346
+ /* @__PURE__ */ T(_, { className: "h-4 w-4" }),
359
347
  " ",
360
348
  t("healthybowl.irrigation.actions.logRun", "Log Watering Run")
361
349
  ]
362
- }), /* @__PURE__ */ D(O, {
363
- onClick: He,
350
+ }), /* @__PURE__ */ E(D, {
351
+ onClick: Ve,
364
352
  disabled: I.length === 0,
365
353
  children: [
366
- /* @__PURE__ */ E(S, { className: "h-4 w-4" }),
354
+ /* @__PURE__ */ T(x, { className: "h-4 w-4" }),
367
355
  " ",
368
356
  t("healthybowl.irrigation.actions.addSchedule", "Add Schedule")
369
357
  ]
370
358
  })]
371
359
  }),
372
360
  children: [
373
- _e && !et ? /* @__PURE__ */ E(re, {}) : F && !et ? /* @__PURE__ */ E(s, { onRetry: () => void ye() }) : /* @__PURE__ */ D("div", {
361
+ P && !$e ? /* @__PURE__ */ T(re, {}) : F && !$e ? /* @__PURE__ */ T(s, { onRetry: () => void ve() }) : /* @__PURE__ */ E("div", {
374
362
  className: "space-y-8",
375
- children: [/* @__PURE__ */ D("div", {
363
+ children: [/* @__PURE__ */ E("div", {
376
364
  className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4",
377
365
  children: [
378
- /* @__PURE__ */ E(i, {
366
+ /* @__PURE__ */ T(i, {
379
367
  label: t("healthybowl.irrigation.stats.fieldsOnSchedule", "Fields on Schedule"),
380
- value: Me,
381
- icon: /* @__PURE__ */ E(w, {})
368
+ value: je,
369
+ icon: /* @__PURE__ */ T(C, {})
382
370
  }),
383
- /* @__PURE__ */ E(i, {
371
+ /* @__PURE__ */ T(i, {
384
372
  label: t("healthybowl.irrigation.stats.waterToday", "Water Used Today"),
385
- value: Math.round(Pe),
373
+ value: Math.round(Ne),
386
374
  unit: "L",
387
- icon: /* @__PURE__ */ E(y, {})
375
+ icon: /* @__PURE__ */ T(v, {})
388
376
  }),
389
- /* @__PURE__ */ E(i, {
377
+ /* @__PURE__ */ T(i, {
390
378
  label: t("healthybowl.irrigation.stats.nextRun", "Next Run"),
391
- value: Fe,
392
- icon: /* @__PURE__ */ E(_, {})
379
+ value: Pe,
380
+ icon: /* @__PURE__ */ T(g, {})
393
381
  }),
394
- /* @__PURE__ */ E(i, {
382
+ /* @__PURE__ */ T(i, {
395
383
  label: t("healthybowl.irrigation.stats.automations", "Active Automations"),
396
- value: je,
397
- icon: /* @__PURE__ */ E(he, {})
384
+ value: Ae,
385
+ icon: /* @__PURE__ */ T(he, {})
398
386
  })
399
387
  ]
400
- }), b.length === 0 ? /* @__PURE__ */ D("div", {
388
+ }), y.length === 0 ? /* @__PURE__ */ E("div", {
401
389
  className: "flex flex-col items-center justify-center gap-3 rounded-xl border border-border-seam bg-gloss-card p-12 text-center",
402
390
  children: [
403
- /* @__PURE__ */ E("div", {
391
+ /* @__PURE__ */ T("div", {
404
392
  className: "flex h-12 w-12 items-center justify-center rounded-full bg-bg-sunken",
405
- children: /* @__PURE__ */ E(y, { className: "h-6 w-6 text-text-secondary" })
393
+ children: /* @__PURE__ */ T(v, { className: "h-6 w-6 text-text-secondary" })
406
394
  }),
407
- /* @__PURE__ */ E("p", {
395
+ /* @__PURE__ */ T("p", {
408
396
  className: "text-sm font-medium text-text-primary",
409
397
  children: t("healthybowl.irrigation.empty.title", "No irrigation schedules yet")
410
398
  }),
411
- /* @__PURE__ */ E("p", {
399
+ /* @__PURE__ */ T("p", {
412
400
  className: "max-w-sm text-sm text-text-secondary",
413
401
  children: I.length === 0 ? t("healthybowl.irrigation.empty.needField", "Add a field first, then set up a watering schedule for it.") : t("healthybowl.irrigation.empty.description", "Create a watering schedule for one of your fields to get started.")
414
402
  }),
415
- I.length > 0 && /* @__PURE__ */ D(O, {
416
- onClick: He,
403
+ I.length > 0 && /* @__PURE__ */ E(D, {
404
+ onClick: Ve,
417
405
  className: "mt-1",
418
406
  children: [
419
- /* @__PURE__ */ E(S, { className: "h-4 w-4" }),
407
+ /* @__PURE__ */ T(x, { className: "h-4 w-4" }),
420
408
  " ",
421
409
  t("healthybowl.irrigation.actions.addSchedule", "Add Schedule")
422
410
  ]
423
411
  })
424
412
  ]
425
- }) : /* @__PURE__ */ D(T, { children: [
426
- /* @__PURE__ */ D("section", {
413
+ }) : /* @__PURE__ */ E(w, { children: [
414
+ /* @__PURE__ */ E("section", {
427
415
  className: "space-y-3",
428
- children: [/* @__PURE__ */ D("div", {
416
+ children: [/* @__PURE__ */ E("div", {
429
417
  className: "flex items-center gap-2",
430
- children: [/* @__PURE__ */ E(_, { className: "h-5 w-5 text-text-secondary" }), /* @__PURE__ */ E("h2", {
418
+ children: [/* @__PURE__ */ T(g, { className: "h-5 w-5 text-text-secondary" }), /* @__PURE__ */ T("h2", {
431
419
  className: "text-lg font-semibold text-text-primary",
432
420
  children: t("healthybowl.irrigation.calendar.heading", "Weekly Schedule")
433
421
  })]
434
- }), /* @__PURE__ */ E("div", {
422
+ }), /* @__PURE__ */ T("div", {
435
423
  className: "overflow-x-auto",
436
- children: /* @__PURE__ */ E("div", {
424
+ children: /* @__PURE__ */ T("div", {
437
425
  className: "grid min-w-[720px] grid-cols-7 gap-3",
438
- children: j.map((e, n) => /* @__PURE__ */ D("div", {
426
+ children: A.map((e, n) => /* @__PURE__ */ E("div", {
439
427
  className: "flex flex-col gap-2",
440
- children: [/* @__PURE__ */ E("div", {
428
+ children: [/* @__PURE__ */ T("div", {
441
429
  className: "text-center text-xs font-semibold uppercase tracking-wider text-text-secondary",
442
430
  children: t(`healthybowl.irrigation.weekday.${e}`, ge[n])
443
- }), /* @__PURE__ */ E("div", {
431
+ }), /* @__PURE__ */ T("div", {
444
432
  className: "flex min-h-[96px] flex-col gap-2 rounded-lg border border-border-seam bg-bg-sunken/30 p-2",
445
- children: Ie[n].length === 0 ? /* @__PURE__ */ E("span", {
433
+ children: Fe[n].length === 0 ? /* @__PURE__ */ T("span", {
446
434
  className: "mt-6 text-center text-[11px] text-text-secondary",
447
435
  children: "—"
448
- }) : Ie[n].map((e) => /* @__PURE__ */ D("div", {
436
+ }) : Fe[n].map((e) => /* @__PURE__ */ E("div", {
449
437
  className: "rounded-md border border-border-subtle bg-gloss-card p-2 text-start shadow-pop",
450
438
  children: [
451
- /* @__PURE__ */ E("p", {
439
+ /* @__PURE__ */ T("p", {
452
440
  className: "truncate text-xs font-medium text-text-primary",
453
441
  children: z(e.fieldId)
454
442
  }),
455
- /* @__PURE__ */ D("p", {
443
+ /* @__PURE__ */ E("p", {
456
444
  className: "mt-0.5 truncate text-[11px] text-text-secondary",
457
445
  children: [
458
446
  B(e.method),
@@ -460,7 +448,7 @@ var k = "h-9 w-full rounded-md border border-border-subtle bg-bg-surface px-3 te
460
448
  e.startTime
461
449
  ]
462
450
  }),
463
- /* @__PURE__ */ E("span", {
451
+ /* @__PURE__ */ T("span", {
464
452
  className: "mt-1 inline-block rounded-full bg-[var(--color-accent-soft)] px-1.5 py-0.5 text-[10px] font-medium text-text-primary",
465
453
  children: t("healthybowl.irrigation.everyNShort", "every {{n}}d", { n: String(e.frequencyDays) })
466
454
  })
@@ -471,53 +459,53 @@ var k = "h-9 w-full rounded-md border border-border-subtle bg-bg-surface px-3 te
471
459
  })
472
460
  })]
473
461
  }),
474
- /* @__PURE__ */ D("section", {
462
+ /* @__PURE__ */ E("section", {
475
463
  className: "space-y-3",
476
- children: [/* @__PURE__ */ D("div", {
464
+ children: [/* @__PURE__ */ E("div", {
477
465
  className: "flex items-center gap-2",
478
- children: [/* @__PURE__ */ E(y, { className: "h-5 w-5 text-text-secondary" }), /* @__PURE__ */ E("h2", {
466
+ children: [/* @__PURE__ */ T(v, { className: "h-5 w-5 text-text-secondary" }), /* @__PURE__ */ T("h2", {
479
467
  className: "text-lg font-semibold text-text-primary",
480
468
  children: t("healthybowl.irrigation.table.heading", "Water Schedule")
481
469
  })]
482
- }), /* @__PURE__ */ E(a, {
483
- columns: $e,
484
- data: b,
470
+ }), /* @__PURE__ */ T(a, {
471
+ columns: Qe,
472
+ data: y,
485
473
  keyField: "id"
486
474
  })]
487
475
  }),
488
- /* @__PURE__ */ D("div", {
476
+ /* @__PURE__ */ E("div", {
489
477
  className: "grid grid-cols-1 gap-6 lg:grid-cols-2",
490
- children: [/* @__PURE__ */ E(ve, {
491
- schedules: b,
478
+ children: [/* @__PURE__ */ T(_e, {
479
+ schedules: y,
492
480
  fieldName: z
493
- }), /* @__PURE__ */ D(ee, {
481
+ }), /* @__PURE__ */ E(ee, {
494
482
  title: t("healthybowl.irrigation.usage.title", "Weekly Water Usage"),
495
483
  description: t("healthybowl.irrigation.usage.description", "Litres logged over the last 7 days"),
496
- children: [C.length === 0 ? /* @__PURE__ */ D("div", {
484
+ children: [S.length === 0 ? /* @__PURE__ */ E("div", {
497
485
  className: "flex h-[240px] flex-col items-center justify-center gap-2 text-center",
498
486
  children: [
499
- /* @__PURE__ */ E(v, { className: "h-8 w-8 text-text-secondary" }),
500
- /* @__PURE__ */ E("p", {
487
+ /* @__PURE__ */ T(_, { className: "h-8 w-8 text-text-secondary" }),
488
+ /* @__PURE__ */ T("p", {
501
489
  className: "text-sm text-text-secondary",
502
490
  children: t("healthybowl.irrigation.usage.empty", "No watering runs logged yet.")
503
491
  }),
504
- /* @__PURE__ */ D(O, {
492
+ /* @__PURE__ */ E(D, {
505
493
  variant: "outline",
506
494
  size: "sm",
507
- onClick: Xe,
495
+ onClick: Ye,
508
496
  className: "mt-1",
509
497
  children: [
510
- /* @__PURE__ */ E(v, { className: "h-4 w-4" }),
498
+ /* @__PURE__ */ T(_, { className: "h-4 w-4" }),
511
499
  " ",
512
500
  t("healthybowl.irrigation.actions.logRun", "Log Watering Run")
513
501
  ]
514
502
  })
515
503
  ]
516
- }) : /* @__PURE__ */ E(l, {
504
+ }) : /* @__PURE__ */ T(se, {
517
505
  width: "100%",
518
506
  height: 240,
519
- children: /* @__PURE__ */ D(p, {
520
- data: Le,
507
+ children: /* @__PURE__ */ E(f, {
508
+ data: Ie,
521
509
  margin: {
522
510
  top: 5,
523
511
  right: 12,
@@ -525,38 +513,38 @@ var k = "h-9 w-full rounded-md border border-border-subtle bg-bg-surface px-3 te
525
513
  bottom: 5
526
514
  },
527
515
  children: [
528
- /* @__PURE__ */ E("defs", { children: /* @__PURE__ */ D("linearGradient", {
516
+ /* @__PURE__ */ T("defs", { children: /* @__PURE__ */ E("linearGradient", {
529
517
  id: "waterGrad",
530
518
  x1: "0",
531
519
  y1: "0",
532
520
  x2: "0",
533
521
  y2: "1",
534
- children: [/* @__PURE__ */ E("stop", {
522
+ children: [/* @__PURE__ */ T("stop", {
535
523
  offset: "5%",
536
524
  stopColor: "var(--color-info, #38bdf8)",
537
525
  stopOpacity: .35
538
- }), /* @__PURE__ */ E("stop", {
526
+ }), /* @__PURE__ */ T("stop", {
539
527
  offset: "95%",
540
528
  stopColor: "var(--color-info, #38bdf8)",
541
529
  stopOpacity: 0
542
530
  })]
543
531
  }) }),
544
- /* @__PURE__ */ E(u, {
532
+ /* @__PURE__ */ T(l, {
545
533
  strokeDasharray: "3 3",
546
534
  className: "stroke-border"
547
535
  }),
548
- /* @__PURE__ */ E(d, {
536
+ /* @__PURE__ */ T(ce, {
549
537
  dataKey: "day",
550
538
  className: "text-xs",
551
539
  tick: { fill: "currentColor" }
552
540
  }),
553
- /* @__PURE__ */ E(f, {
541
+ /* @__PURE__ */ T(d, {
554
542
  className: "text-xs",
555
543
  tick: { fill: "currentColor" },
556
544
  tickFormatter: (e) => `${e}L`,
557
545
  width: 44
558
546
  }),
559
- /* @__PURE__ */ E(se, {
547
+ /* @__PURE__ */ T(oe, {
560
548
  formatter: (e) => [`${e} L`, t("healthybowl.irrigation.usage.series", "Water")],
561
549
  contentStyle: {
562
550
  backgroundColor: "var(--color-card)",
@@ -565,7 +553,7 @@ var k = "h-9 w-full rounded-md border border-border-subtle bg-bg-surface px-3 te
565
553
  },
566
554
  labelStyle: { color: "var(--color-foreground)" }
567
555
  }),
568
- /* @__PURE__ */ E(ce, {
556
+ /* @__PURE__ */ T(u, {
569
557
  type: "monotone",
570
558
  dataKey: "litres",
571
559
  name: t("healthybowl.irrigation.usage.series", "Water"),
@@ -575,97 +563,97 @@ var k = "h-9 w-full rounded-md border border-border-subtle bg-bg-surface px-3 te
575
563
  })
576
564
  ]
577
565
  })
578
- }), C.length > 0 && /* @__PURE__ */ E("p", {
566
+ }), S.length > 0 && /* @__PURE__ */ T("p", {
579
567
  className: "mt-2 text-center text-[11px] text-text-secondary",
580
- children: t("healthybowl.irrigation.usage.peak", "Peak day: {{n}} L", { n: String(tt) })
568
+ children: t("healthybowl.irrigation.usage.peak", "Peak day: {{n}} L", { n: String(et) })
581
569
  })]
582
570
  })]
583
571
  })
584
572
  ] })]
585
573
  }),
586
- /* @__PURE__ */ E(c, {
587
- open: ze,
574
+ /* @__PURE__ */ T(c, {
575
+ open: Re,
588
576
  onClose: Y,
589
577
  title: W ? t("healthybowl.irrigation.schedule.modal.editTitle", "Edit Irrigation Schedule") : t("healthybowl.irrigation.schedule.modal.title", "New Irrigation Schedule"),
590
578
  description: t("healthybowl.irrigation.schedule.modal.description", "Set the field, method, cadence, duration and daily start time."),
591
579
  size: "md",
592
- footer: /* @__PURE__ */ D(T, { children: [/* @__PURE__ */ E(O, {
580
+ footer: /* @__PURE__ */ E(w, { children: [/* @__PURE__ */ T(D, {
593
581
  variant: "outline",
594
582
  onClick: Y,
595
583
  children: t("healthybowl.common.cancel", "Cancel")
596
- }), /* @__PURE__ */ E(O, {
597
- onClick: We,
598
- disabled: Be,
599
- children: Be ? t("healthybowl.irrigation.actions.saving", "Saving...") : W ? t("healthybowl.common.saveChanges", "Save Changes") : t("healthybowl.irrigation.actions.addSchedule", "Add Schedule")
584
+ }), /* @__PURE__ */ T(D, {
585
+ onClick: Ue,
586
+ disabled: ze,
587
+ children: ze ? t("healthybowl.irrigation.actions.saving", "Saving...") : W ? t("healthybowl.common.saveChanges", "Save Changes") : t("healthybowl.irrigation.actions.addSchedule", "Add Schedule")
600
588
  })] }),
601
- children: /* @__PURE__ */ D("div", {
589
+ children: /* @__PURE__ */ E("div", {
602
590
  className: "space-y-4",
603
591
  children: [
604
- /* @__PURE__ */ D("div", {
592
+ /* @__PURE__ */ E("div", {
605
593
  className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
606
- children: [/* @__PURE__ */ D("div", { children: [
607
- /* @__PURE__ */ E("label", {
594
+ children: [/* @__PURE__ */ E("div", { children: [
595
+ /* @__PURE__ */ T("label", {
608
596
  htmlFor: "irr-field",
609
597
  className: "mb-1 block text-sm font-medium text-text-primary",
610
598
  children: t("healthybowl.irrigation.form.field.label", "Field *")
611
599
  }),
612
- /* @__PURE__ */ D("select", {
600
+ /* @__PURE__ */ E("select", {
613
601
  id: "irr-field",
614
602
  value: K.fieldId,
615
603
  onChange: (e) => J("fieldId", e.target.value),
616
- className: k,
617
- children: [/* @__PURE__ */ E("option", {
604
+ className: O,
605
+ children: [/* @__PURE__ */ T("option", {
618
606
  value: "",
619
607
  children: t("healthybowl.irrigation.form.field.placeholder", "Select a field")
620
- }), I.map((e) => /* @__PURE__ */ E("option", {
608
+ }), I.map((e) => /* @__PURE__ */ T("option", {
621
609
  value: e.id,
622
610
  children: e.name
623
611
  }, e.id))]
624
612
  }),
625
- I.length === 0 && /* @__PURE__ */ E("p", {
613
+ I.length === 0 && /* @__PURE__ */ T("p", {
626
614
  className: "mt-1 text-xs text-status-warning-text",
627
615
  children: t("healthybowl.irrigation.form.field.none", "No fields found. Add a field first.")
628
616
  })
629
- ] }), /* @__PURE__ */ D("div", { children: [/* @__PURE__ */ E("label", {
617
+ ] }), /* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("label", {
630
618
  htmlFor: "irr-crop",
631
619
  className: "mb-1 block text-sm font-medium text-text-primary",
632
620
  children: t("healthybowl.irrigation.form.crop.label", "Crop")
633
- }), /* @__PURE__ */ D("select", {
621
+ }), /* @__PURE__ */ E("select", {
634
622
  id: "irr-crop",
635
623
  value: K.cropId,
636
624
  onChange: (e) => J("cropId", e.target.value),
637
- className: k,
638
- children: [/* @__PURE__ */ E("option", {
625
+ className: O,
626
+ children: [/* @__PURE__ */ T("option", {
639
627
  value: "",
640
628
  children: t("healthybowl.irrigation.form.crop.placeholder", "Any / none")
641
- }), L.map((e) => /* @__PURE__ */ E("option", {
629
+ }), L.map((e) => /* @__PURE__ */ T("option", {
642
630
  value: e.id,
643
631
  children: e.name
644
632
  }, e.id))]
645
633
  })] })]
646
634
  }),
647
- /* @__PURE__ */ D("div", { children: [/* @__PURE__ */ E("label", {
635
+ /* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("label", {
648
636
  htmlFor: "irr-method",
649
637
  className: "mb-1 block text-sm font-medium text-text-primary",
650
638
  children: t("healthybowl.irrigation.form.method.label", "Method *")
651
- }), /* @__PURE__ */ E("select", {
639
+ }), /* @__PURE__ */ T("select", {
652
640
  id: "irr-method",
653
641
  value: K.method,
654
642
  onChange: (e) => J("method", e.target.value),
655
- className: k,
656
- children: A.map((e) => /* @__PURE__ */ E("option", {
643
+ className: O,
644
+ children: k.map((e) => /* @__PURE__ */ T("option", {
657
645
  value: e,
658
646
  children: B(e)
659
647
  }, e))
660
648
  })] }),
661
- /* @__PURE__ */ D("div", {
649
+ /* @__PURE__ */ E("div", {
662
650
  className: "grid grid-cols-1 gap-4 sm:grid-cols-3",
663
651
  children: [
664
- /* @__PURE__ */ D("div", { children: [/* @__PURE__ */ E("label", {
652
+ /* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("label", {
665
653
  htmlFor: "irr-freq",
666
654
  className: "mb-1 block text-sm font-medium text-text-primary",
667
655
  children: t("healthybowl.irrigation.form.frequency.label", "Frequency (days) *")
668
- }), /* @__PURE__ */ E("input", {
656
+ }), /* @__PURE__ */ T("input", {
669
657
  id: "irr-freq",
670
658
  type: "number",
671
659
  min: "1",
@@ -673,13 +661,13 @@ var k = "h-9 w-full rounded-md border border-border-subtle bg-bg-surface px-3 te
673
661
  value: K.frequencyDays,
674
662
  onChange: (e) => J("frequencyDays", e.target.value),
675
663
  placeholder: "1",
676
- className: k
664
+ className: O
677
665
  })] }),
678
- /* @__PURE__ */ D("div", { children: [/* @__PURE__ */ E("label", {
666
+ /* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("label", {
679
667
  htmlFor: "irr-duration",
680
668
  className: "mb-1 block text-sm font-medium text-text-primary",
681
669
  children: t("healthybowl.irrigation.form.duration.label", "Duration (min) *")
682
- }), /* @__PURE__ */ E("input", {
670
+ }), /* @__PURE__ */ T("input", {
683
671
  id: "irr-duration",
684
672
  type: "number",
685
673
  min: "1",
@@ -687,34 +675,34 @@ var k = "h-9 w-full rounded-md border border-border-subtle bg-bg-surface px-3 te
687
675
  value: K.durationMin,
688
676
  onChange: (e) => J("durationMin", e.target.value),
689
677
  placeholder: "30",
690
- className: k
678
+ className: O
691
679
  })] }),
692
- /* @__PURE__ */ D("div", { children: [/* @__PURE__ */ E("label", {
680
+ /* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("label", {
693
681
  htmlFor: "irr-start",
694
682
  className: "mb-1 block text-sm font-medium text-text-primary",
695
683
  children: t("healthybowl.irrigation.form.startTime.label", "Start Time *")
696
- }), /* @__PURE__ */ E("input", {
684
+ }), /* @__PURE__ */ T("input", {
697
685
  id: "irr-start",
698
686
  type: "time",
699
687
  value: K.startTime,
700
688
  onChange: (e) => J("startTime", e.target.value),
701
- className: k
689
+ className: O
702
690
  })] })
703
691
  ]
704
692
  }),
705
- /* @__PURE__ */ D("div", { children: [/* @__PURE__ */ E("label", {
693
+ /* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("label", {
706
694
  htmlFor: "irr-status",
707
695
  className: "mb-1 block text-sm font-medium text-text-primary",
708
696
  children: t("healthybowl.irrigation.form.status.label", "Status")
709
- }), /* @__PURE__ */ D("select", {
697
+ }), /* @__PURE__ */ E("select", {
710
698
  id: "irr-status",
711
699
  value: K.status,
712
700
  onChange: (e) => J("status", e.target.value),
713
- className: k,
714
- children: [/* @__PURE__ */ E("option", {
701
+ className: O,
702
+ children: [/* @__PURE__ */ T("option", {
715
703
  value: "active",
716
704
  children: t("healthybowl.irrigation.status.active", "Active")
717
- }), /* @__PURE__ */ E("option", {
705
+ }), /* @__PURE__ */ T("option", {
718
706
  value: "paused",
719
707
  children: t("healthybowl.irrigation.status.paused", "Paused")
720
708
  })]
@@ -722,56 +710,56 @@ var k = "h-9 w-full rounded-md border border-border-subtle bg-bg-surface px-3 te
722
710
  ]
723
711
  })
724
712
  }),
725
- /* @__PURE__ */ E(c, {
726
- open: qe,
713
+ /* @__PURE__ */ T(c, {
714
+ open: Ke,
727
715
  onClose: () => X(!1),
728
716
  title: t("healthybowl.irrigation.run.modal.title", "Log Watering Run"),
729
717
  description: t("healthybowl.irrigation.run.modal.description", "Record a watering that took place — this feeds the usage totals."),
730
718
  size: "md",
731
- footer: /* @__PURE__ */ D(T, { children: [/* @__PURE__ */ E(O, {
719
+ footer: /* @__PURE__ */ E(w, { children: [/* @__PURE__ */ T(D, {
732
720
  variant: "outline",
733
721
  onClick: () => X(!1),
734
722
  children: t("healthybowl.common.cancel", "Cancel")
735
- }), /* @__PURE__ */ E(O, {
736
- onClick: Qe,
737
- disabled: Je,
738
- children: Je ? t("healthybowl.irrigation.actions.saving", "Saving...") : t("healthybowl.irrigation.run.actions.log", "Log Run")
723
+ }), /* @__PURE__ */ T(D, {
724
+ onClick: Ze,
725
+ disabled: qe,
726
+ children: qe ? t("healthybowl.irrigation.actions.saving", "Saving...") : t("healthybowl.irrigation.run.actions.log", "Log Run")
739
727
  })] }),
740
- children: /* @__PURE__ */ D("div", {
728
+ children: /* @__PURE__ */ E("div", {
741
729
  className: "space-y-4",
742
730
  children: [
743
- /* @__PURE__ */ D("div", { children: [/* @__PURE__ */ E("label", {
731
+ /* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("label", {
744
732
  htmlFor: "run-field",
745
733
  className: "mb-1 block text-sm font-medium text-text-primary",
746
734
  children: t("healthybowl.irrigation.run.form.field.label", "Field *")
747
- }), /* @__PURE__ */ D("select", {
735
+ }), /* @__PURE__ */ E("select", {
748
736
  id: "run-field",
749
737
  value: Z.fieldId,
750
738
  onChange: (e) => {
751
739
  $("fieldId", e.target.value), $("scheduleId", "");
752
740
  },
753
- className: k,
754
- children: [/* @__PURE__ */ E("option", {
741
+ className: O,
742
+ children: [/* @__PURE__ */ T("option", {
755
743
  value: "",
756
744
  children: t("healthybowl.irrigation.run.form.field.placeholder", "Select a field")
757
- }), I.map((e) => /* @__PURE__ */ E("option", {
745
+ }), I.map((e) => /* @__PURE__ */ T("option", {
758
746
  value: e.id,
759
747
  children: e.name
760
748
  }, e.id))]
761
749
  })] }),
762
- Ze.length > 0 && /* @__PURE__ */ D("div", { children: [/* @__PURE__ */ E("label", {
750
+ Xe.length > 0 && /* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("label", {
763
751
  htmlFor: "run-schedule",
764
752
  className: "mb-1 block text-sm font-medium text-text-primary",
765
753
  children: t("healthybowl.irrigation.run.form.schedule.label", "Against Schedule")
766
- }), /* @__PURE__ */ D("select", {
754
+ }), /* @__PURE__ */ E("select", {
767
755
  id: "run-schedule",
768
756
  value: Z.scheduleId,
769
757
  onChange: (e) => $("scheduleId", e.target.value),
770
- className: k,
771
- children: [/* @__PURE__ */ E("option", {
758
+ className: O,
759
+ children: [/* @__PURE__ */ T("option", {
772
760
  value: "",
773
761
  children: t("healthybowl.irrigation.run.form.schedule.placeholder", "None (ad-hoc)")
774
- }), Ze.map((e) => /* @__PURE__ */ D("option", {
762
+ }), Xe.map((e) => /* @__PURE__ */ E("option", {
775
763
  value: e.id,
776
764
  children: [
777
765
  B(e.method),
@@ -780,46 +768,46 @@ var k = "h-9 w-full rounded-md border border-border-subtle bg-bg-surface px-3 te
780
768
  " ·",
781
769
  " ",
782
770
  t("healthybowl.irrigation.everyNShort", "every {{n}}d", { n: String(e.frequencyDays) }),
783
- Re.get(e.id) ? ` (${Re.get(e.id)})` : ""
771
+ Le.get(e.id) ? ` (${Le.get(e.id)})` : ""
784
772
  ]
785
773
  }, e.id))]
786
774
  })] }),
787
- /* @__PURE__ */ D("div", {
775
+ /* @__PURE__ */ E("div", {
788
776
  className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
789
- children: [/* @__PURE__ */ D("div", { children: [/* @__PURE__ */ E("label", {
777
+ children: [/* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("label", {
790
778
  htmlFor: "run-status",
791
779
  className: "mb-1 block text-sm font-medium text-text-primary",
792
780
  children: t("healthybowl.irrigation.run.form.status.label", "Outcome")
793
- }), /* @__PURE__ */ D("select", {
781
+ }), /* @__PURE__ */ E("select", {
794
782
  id: "run-status",
795
783
  value: Z.status,
796
784
  onChange: (e) => $("status", e.target.value),
797
- className: k,
798
- children: [/* @__PURE__ */ E("option", {
785
+ className: O,
786
+ children: [/* @__PURE__ */ T("option", {
799
787
  value: "ran",
800
788
  children: t("healthybowl.irrigation.run.status.ran", "Ran")
801
- }), /* @__PURE__ */ E("option", {
789
+ }), /* @__PURE__ */ T("option", {
802
790
  value: "skipped",
803
791
  children: t("healthybowl.irrigation.run.status.skipped", "Skipped")
804
792
  })]
805
- })] }), /* @__PURE__ */ D("div", { children: [/* @__PURE__ */ E("label", {
793
+ })] }), /* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("label", {
806
794
  htmlFor: "run-date",
807
795
  className: "mb-1 block text-sm font-medium text-text-primary",
808
796
  children: t("healthybowl.irrigation.run.form.date.label", "Date")
809
- }), /* @__PURE__ */ E("input", {
797
+ }), /* @__PURE__ */ T("input", {
810
798
  id: "run-date",
811
799
  type: "date",
812
800
  max: n(),
813
801
  value: Z.date,
814
802
  onChange: (e) => $("date", e.target.value),
815
- className: k
803
+ className: O
816
804
  })] })]
817
805
  }),
818
- Z.status === "ran" ? /* @__PURE__ */ D("div", { children: [/* @__PURE__ */ E("label", {
806
+ Z.status === "ran" ? /* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("label", {
819
807
  htmlFor: "run-litres",
820
808
  className: "mb-1 block text-sm font-medium text-text-primary",
821
809
  children: t("healthybowl.irrigation.run.form.litres.label", "Litres Used")
822
- }), /* @__PURE__ */ E("input", {
810
+ }), /* @__PURE__ */ T("input", {
823
811
  id: "run-litres",
824
812
  type: "number",
825
813
  min: "0",
@@ -827,25 +815,25 @@ var k = "h-9 w-full rounded-md border border-border-subtle bg-bg-surface px-3 te
827
815
  value: Z.litres,
828
816
  onChange: (e) => $("litres", e.target.value),
829
817
  placeholder: "500",
830
- className: k
831
- })] }) : /* @__PURE__ */ D("div", { children: [/* @__PURE__ */ E("label", {
818
+ className: O
819
+ })] }) : /* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("label", {
832
820
  htmlFor: "run-reason",
833
821
  className: "mb-1 block text-sm font-medium text-text-primary",
834
822
  children: t("healthybowl.irrigation.run.form.reason.label", "Skip Reason")
835
- }), /* @__PURE__ */ E("input", {
823
+ }), /* @__PURE__ */ T("input", {
836
824
  id: "run-reason",
837
825
  type: "text",
838
826
  value: Z.skippedReason,
839
827
  onChange: (e) => $("skippedReason", e.target.value),
840
828
  placeholder: t("healthybowl.irrigation.run.form.reason.placeholder", "e.g., Rainfall — soil already wet"),
841
- className: k
829
+ className: O
842
830
  })] })
843
831
  ]
844
832
  })
845
833
  }),
846
- /* @__PURE__ */ E(te, {
847
- toasts: Ee,
848
- onDismiss: De
834
+ /* @__PURE__ */ T(te, {
835
+ toasts: Te,
836
+ onDismiss: Ee
849
837
  })
850
838
  ]
851
839
  });
@@ -854,21 +842,20 @@ var k = "h-9 w-full rounded-md border border-border-subtle bg-bg-surface px-3 te
854
842
  soilThresholdPct: "30",
855
843
  skipIfRain: !0,
856
844
  rainProbThreshold: "50",
857
- notifyInApp: !0,
858
- autoTaskEnabled: !1
859
- }, ve = ({ schedules: e, fieldName: n }) => {
860
- let { t: r } = ue(), i = ne(), { toast: a } = ie(), { automations: s, loading: te, createAutomation: re, updateAutomation: ae, deleteAutomation: oe, runAutomation: se } = le(), l = h(() => new Map(e.map((e) => [e.id, e])), [e]), u = (e) => e ? r(`healthybowl.irrigation.method.${e.toLowerCase()}`, e.charAt(0) + e.slice(1).toLowerCase()) : r("healthybowl.irrigation.automation.unknownMethod", "Schedule"), [ce, d] = g(!1), [f, p] = g(F), [m, _] = g(!1), [v, y] = g(null), x = (e, t) => p((n) => ({
845
+ notifyInApp: !0
846
+ }, _e = ({ schedules: e, fieldName: n }) => {
847
+ let { t: r } = ue(), i = ne(), { toast: a } = ie(), { automations: s, loading: te, createAutomation: re, updateAutomation: ae, deleteAutomation: oe, runAutomation: se } = le(), l = m(() => new Map(e.map((e) => [e.id, e])), [e]), u = (e) => e ? r(`healthybowl.irrigation.method.${e.toLowerCase()}`, e.charAt(0) + e.slice(1).toLowerCase()) : r("healthybowl.irrigation.automation.unknownMethod", "Schedule"), [ce, d] = h(!1), [f, p] = h(F), [g, _] = h(!1), [v, b] = h(null), C = (e, t) => p((n) => ({
861
848
  ...n,
862
849
  [e]: t
863
- })), w = () => {
850
+ })), k = () => {
864
851
  p({
865
852
  ...F,
866
853
  scheduleId: e[0]?.id ?? ""
867
854
  }), d(!0);
868
855
  }, A = () => {
869
856
  p(F), d(!1);
870
- }, j = async () => {
871
- let e = M(f.soilThresholdPct);
857
+ }, ge = async () => {
858
+ let e = j(f.soilThresholdPct);
872
859
  if (!f.scheduleId || e === void 0) {
873
860
  a({
874
861
  title: r("healthybowl.irrigation.automation.toast.required.title", "Missing required fields"),
@@ -881,9 +868,8 @@ var k = "h-9 w-full rounded-md border border-border-subtle bg-bg-surface px-3 te
881
868
  scheduleId: f.scheduleId,
882
869
  soilThresholdPct: e,
883
870
  skipIfRain: f.skipIfRain,
884
- rainProbThreshold: f.skipIfRain ? M(f.rainProbThreshold) : void 0,
871
+ rainProbThreshold: f.skipIfRain ? j(f.rainProbThreshold) : void 0,
885
872
  notifyInApp: f.notifyInApp,
886
- autoTaskEnabled: f.autoTaskEnabled,
887
873
  status: "active"
888
874
  };
889
875
  _(!0);
@@ -901,7 +887,7 @@ var k = "h-9 w-full rounded-md border border-border-subtle bg-bg-surface px-3 te
901
887
  } finally {
902
888
  _(!1);
903
889
  }
904
- }, ge = async (e) => {
890
+ }, M = async (e) => {
905
891
  let t = e.status === "active" ? "paused" : "active";
906
892
  try {
907
893
  await ae(e.id, { status: t }), a({
@@ -929,7 +915,7 @@ var k = "h-9 w-full rounded-md border border-border-subtle bg-bg-surface px-3 te
929
915
  });
930
916
  }
931
917
  }, P = async (e) => {
932
- y(e.id);
918
+ b(e.id);
933
919
  try {
934
920
  let t = await se(e.id);
935
921
  if (!t) {
@@ -952,168 +938,167 @@ var k = "h-9 w-full rounded-md border border-border-subtle bg-bg-surface px-3 te
952
938
  variant: "error"
953
939
  });
954
940
  } finally {
955
- y(null);
941
+ b(null);
956
942
  }
957
943
  };
958
- return /* @__PURE__ */ D(ee, {
944
+ return /* @__PURE__ */ E(ee, {
959
945
  title: r("healthybowl.irrigation.automation.title", "Automation Rules"),
960
946
  description: r("healthybowl.irrigation.automation.rules.description", "Auto-irrigate when soil runs dry"),
961
- actions: /* @__PURE__ */ D("div", {
947
+ actions: /* @__PURE__ */ E("div", {
962
948
  className: "flex items-center gap-2",
963
- children: [/* @__PURE__ */ D("span", {
949
+ children: [/* @__PURE__ */ E("span", {
964
950
  className: "inline-flex items-center gap-1 rounded-full border border-border-subtle bg-bg-sunken px-2 py-0.5 text-[11px] font-medium text-text-secondary",
965
951
  children: [
966
- /* @__PURE__ */ E(de, { className: "h-3 w-3" }),
952
+ /* @__PURE__ */ T(de, { className: "h-3 w-3" }),
967
953
  " ",
968
954
  r("healthybowl.irrigation.automation.poweredBy", "Powered by FluidGrids")
969
955
  ]
970
- }), /* @__PURE__ */ D(O, {
956
+ }), /* @__PURE__ */ E(D, {
971
957
  size: "sm",
972
- onClick: w,
958
+ onClick: k,
973
959
  disabled: e.length === 0,
974
960
  children: [
975
- /* @__PURE__ */ E(S, { className: "h-4 w-4" }),
961
+ /* @__PURE__ */ T(x, { className: "h-4 w-4" }),
976
962
  " ",
977
963
  r("healthybowl.irrigation.automation.actions.newRule", "New Rule")
978
964
  ]
979
965
  })]
980
966
  }),
981
- children: [s.length === 0 ? /* @__PURE__ */ D("div", {
967
+ children: [s.length === 0 ? /* @__PURE__ */ E("div", {
982
968
  className: "flex flex-col items-center justify-center gap-2 py-10 text-center",
983
969
  children: [
984
- /* @__PURE__ */ E("span", {
970
+ /* @__PURE__ */ T("span", {
985
971
  className: "flex h-10 w-10 items-center justify-center rounded-full bg-[var(--color-accent-soft)] text-text-primary",
986
- children: /* @__PURE__ */ E(he, { className: "h-5 w-5" })
972
+ children: /* @__PURE__ */ T(he, { className: "h-5 w-5" })
987
973
  }),
988
- /* @__PURE__ */ E("p", {
974
+ /* @__PURE__ */ T("p", {
989
975
  className: "text-sm font-medium text-text-primary",
990
976
  children: r("healthybowl.irrigation.automation.empty.title", "No automation rules yet")
991
977
  }),
992
- /* @__PURE__ */ E("p", {
978
+ /* @__PURE__ */ T("p", {
993
979
  className: "max-w-xs text-xs text-text-secondary",
994
980
  children: e.length === 0 ? r("healthybowl.irrigation.automation.empty.needSchedule", "Add an irrigation schedule first, then automate it.") : r("healthybowl.irrigation.automation.empty.description", "Create a rule to water automatically when soil moisture drops below a threshold.")
995
981
  }),
996
- e.length > 0 && /* @__PURE__ */ D(O, {
982
+ e.length > 0 && /* @__PURE__ */ E(D, {
997
983
  size: "sm",
998
- onClick: w,
984
+ onClick: k,
999
985
  className: "mt-1",
1000
986
  children: [
1001
- /* @__PURE__ */ E(S, { className: "h-4 w-4" }),
987
+ /* @__PURE__ */ T(x, { className: "h-4 w-4" }),
1002
988
  " ",
1003
989
  r("healthybowl.irrigation.automation.actions.newRule", "New Rule")
1004
990
  ]
1005
991
  })
1006
992
  ]
1007
- }) : /* @__PURE__ */ D("div", {
993
+ }) : /* @__PURE__ */ E("div", {
1008
994
  className: "space-y-3",
1009
995
  children: [s.map((e) => {
1010
996
  let i = l.get(e.scheduleId), a = e.status === "active", s = v === e.id;
1011
- return /* @__PURE__ */ E("div", {
997
+ return /* @__PURE__ */ T("div", {
1012
998
  className: "rounded-lg border border-border-seam bg-bg-sunken/30 p-3",
1013
- children: /* @__PURE__ */ D("div", {
999
+ children: /* @__PURE__ */ E("div", {
1014
1000
  className: "flex flex-wrap items-start justify-between gap-3",
1015
- children: [/* @__PURE__ */ D("div", {
1001
+ children: [/* @__PURE__ */ E("div", {
1016
1002
  className: "min-w-0",
1017
1003
  children: [
1018
- /* @__PURE__ */ D("p", {
1004
+ /* @__PURE__ */ E("p", {
1019
1005
  className: "flex items-center gap-2 text-sm font-medium text-text-primary",
1020
1006
  children: [
1021
1007
  n(i?.fieldId),
1022
- /* @__PURE__ */ E(o, {
1008
+ /* @__PURE__ */ T(o, {
1023
1009
  label: u(i?.method),
1024
1010
  variant: "info"
1025
1011
  }),
1026
- /* @__PURE__ */ E(o, {
1012
+ /* @__PURE__ */ T(o, {
1027
1013
  label: a ? r("healthybowl.irrigation.status.active", "Active") : r("healthybowl.irrigation.status.paused", "Paused"),
1028
1014
  variant: a ? "success" : "muted",
1029
1015
  dot: a
1030
1016
  })
1031
1017
  ]
1032
1018
  }),
1033
- /* @__PURE__ */ D("p", {
1019
+ /* @__PURE__ */ E("p", {
1034
1020
  className: "mt-1 text-xs text-text-secondary",
1035
1021
  children: [
1036
1022
  r("healthybowl.irrigation.automation.rule.threshold", "Water below {{n}}% soil moisture", { n: String(e.soilThresholdPct) }),
1037
1023
  e.skipIfRain ? ` · ${r("healthybowl.irrigation.automation.rule.skipRain", "skip if rain > {{n}}%", { n: String(e.rainProbThreshold ?? 50) })}` : "",
1038
- e.notifyInApp ? ` · ${r("healthybowl.irrigation.automation.rule.notify", "notify in-app")}` : "",
1039
- e.autoTaskEnabled ? ` · ${r("healthybowl.irrigation.automation.rule.autoTask", "create a task")}` : ""
1024
+ e.notifyInApp ? ` · ${r("healthybowl.irrigation.automation.rule.notify", "notify in-app")}` : ""
1040
1025
  ]
1041
1026
  }),
1042
- /* @__PURE__ */ E("p", {
1027
+ /* @__PURE__ */ T("p", {
1043
1028
  className: "mt-1 text-[11px] text-text-secondary",
1044
1029
  children: e.lastEvaluatedAt ? r("healthybowl.irrigation.automation.rule.lastRun", "Last run: {{outcome}} · {{when}}", {
1045
1030
  outcome: e.lastOutcome ?? r("healthybowl.irrigation.automation.rule.noOutcome", "evaluated"),
1046
1031
  when: t(e.lastEvaluatedAt)
1047
1032
  }) : r("healthybowl.irrigation.automation.rule.neverRun", "Not evaluated yet")
1048
1033
  }),
1049
- !e.workflowKey && /* @__PURE__ */ E("p", {
1034
+ !e.workflowKey && /* @__PURE__ */ T("p", {
1050
1035
  className: "mt-1 inline-flex items-center gap-1 rounded-md border border-dashed border-border-subtle bg-bg-surface px-2 py-0.5 text-[10px] text-text-secondary",
1051
1036
  children: r("healthybowl.irrigation.automation.rule.notProvisioned", "Workflow not provisioned yet")
1052
1037
  })
1053
1038
  ]
1054
- }), /* @__PURE__ */ D("div", {
1039
+ }), /* @__PURE__ */ E("div", {
1055
1040
  className: "flex shrink-0 items-center gap-2",
1056
1041
  children: [
1057
- /* @__PURE__ */ D(O, {
1042
+ /* @__PURE__ */ E(D, {
1058
1043
  size: "sm",
1059
1044
  onClick: () => void P(e),
1060
1045
  disabled: s,
1061
- children: [s ? /* @__PURE__ */ E(b, { className: "h-4 w-4 animate-spin" }) : /* @__PURE__ */ E(C, { className: "h-4 w-4" }), r("healthybowl.irrigation.automation.actions.runNow", "Run now")]
1046
+ children: [s ? /* @__PURE__ */ T(y, { className: "h-4 w-4 animate-spin" }) : /* @__PURE__ */ T(S, { className: "h-4 w-4" }), r("healthybowl.irrigation.automation.actions.runNow", "Run now")]
1062
1047
  }),
1063
- /* @__PURE__ */ E(O, {
1048
+ /* @__PURE__ */ T(D, {
1064
1049
  variant: "outline",
1065
1050
  size: "icon-sm",
1066
- onClick: () => void ge(e),
1051
+ onClick: () => void M(e),
1067
1052
  "aria-label": a ? r("healthybowl.irrigation.actions.pause", "Pause schedule") : r("healthybowl.irrigation.actions.resume", "Resume schedule"),
1068
- children: E(a ? fe : pe, { className: "h-4 w-4" })
1053
+ children: T(a ? fe : pe, { className: "h-4 w-4" })
1069
1054
  }),
1070
- /* @__PURE__ */ E(O, {
1055
+ /* @__PURE__ */ T(D, {
1071
1056
  variant: "ghost",
1072
1057
  size: "icon-sm",
1073
1058
  onClick: () => void N(e),
1074
1059
  "aria-label": r("healthybowl.common.delete", "Delete"),
1075
1060
  className: "text-status-error-text hover:bg-status-error-bg/10 hover:text-status-error-text",
1076
- children: /* @__PURE__ */ E(me, { className: "h-4 w-4" })
1061
+ children: /* @__PURE__ */ T(me, { className: "h-4 w-4" })
1077
1062
  })
1078
1063
  ]
1079
1064
  })]
1080
1065
  })
1081
1066
  }, e.id);
1082
- }), te && /* @__PURE__ */ E("p", {
1067
+ }), te && /* @__PURE__ */ T("p", {
1083
1068
  className: "text-center text-[11px] text-text-secondary",
1084
1069
  children: r("healthybowl.irrigation.automation.refreshing", "Refreshing…")
1085
1070
  })]
1086
- }), /* @__PURE__ */ E(c, {
1071
+ }), /* @__PURE__ */ T(c, {
1087
1072
  open: ce,
1088
1073
  onClose: A,
1089
1074
  title: r("healthybowl.irrigation.automation.modal.title", "New Automation Rule"),
1090
1075
  description: r("healthybowl.irrigation.automation.modal.description", "Automatically run an irrigation schedule when soil moisture drops."),
1091
1076
  size: "md",
1092
- footer: /* @__PURE__ */ D(T, { children: [/* @__PURE__ */ E(O, {
1077
+ footer: /* @__PURE__ */ E(w, { children: [/* @__PURE__ */ T(D, {
1093
1078
  variant: "outline",
1094
1079
  onClick: A,
1095
1080
  children: r("healthybowl.common.cancel", "Cancel")
1096
- }), /* @__PURE__ */ E(O, {
1097
- onClick: j,
1098
- disabled: m,
1099
- children: m ? r("healthybowl.irrigation.actions.saving", "Saving...") : r("healthybowl.irrigation.automation.actions.createRule", "Create Rule")
1081
+ }), /* @__PURE__ */ T(D, {
1082
+ onClick: ge,
1083
+ disabled: g,
1084
+ children: g ? r("healthybowl.irrigation.actions.saving", "Saving...") : r("healthybowl.irrigation.automation.actions.createRule", "Create Rule")
1100
1085
  })] }),
1101
- children: /* @__PURE__ */ D("div", {
1086
+ children: /* @__PURE__ */ E("div", {
1102
1087
  className: "space-y-4",
1103
1088
  children: [
1104
- /* @__PURE__ */ D("div", { children: [/* @__PURE__ */ E("label", {
1089
+ /* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("label", {
1105
1090
  htmlFor: "auto-schedule",
1106
1091
  className: "mb-1 block text-sm font-medium text-text-primary",
1107
1092
  children: r("healthybowl.irrigation.automation.form.schedule.label", "Schedule *")
1108
- }), /* @__PURE__ */ D("select", {
1093
+ }), /* @__PURE__ */ E("select", {
1109
1094
  id: "auto-schedule",
1110
1095
  value: f.scheduleId,
1111
- onChange: (e) => x("scheduleId", e.target.value),
1112
- className: k,
1113
- children: [/* @__PURE__ */ E("option", {
1096
+ onChange: (e) => C("scheduleId", e.target.value),
1097
+ className: O,
1098
+ children: [/* @__PURE__ */ T("option", {
1114
1099
  value: "",
1115
1100
  children: r("healthybowl.irrigation.automation.form.schedule.placeholder", "Select a schedule")
1116
- }), e.map((e) => /* @__PURE__ */ D("option", {
1101
+ }), e.map((e) => /* @__PURE__ */ E("option", {
1117
1102
  value: e.id,
1118
1103
  children: [
1119
1104
  n(e.fieldId),
@@ -1125,73 +1110,57 @@ var k = "h-9 w-full rounded-md border border-border-subtle bg-bg-surface px-3 te
1125
1110
  ]
1126
1111
  }, e.id))]
1127
1112
  })] }),
1128
- /* @__PURE__ */ D("div", { children: [/* @__PURE__ */ E("label", {
1113
+ /* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("label", {
1129
1114
  htmlFor: "auto-soil",
1130
1115
  className: "mb-1 block text-sm font-medium text-text-primary",
1131
1116
  children: r("healthybowl.irrigation.automation.form.soil.label", "Soil Moisture Threshold (%) *")
1132
- }), /* @__PURE__ */ E("input", {
1117
+ }), /* @__PURE__ */ T("input", {
1133
1118
  id: "auto-soil",
1134
1119
  type: "number",
1135
1120
  min: "0",
1136
1121
  max: "100",
1137
1122
  step: "1",
1138
1123
  value: f.soilThresholdPct,
1139
- onChange: (e) => x("soilThresholdPct", e.target.value),
1124
+ onChange: (e) => C("soilThresholdPct", e.target.value),
1140
1125
  placeholder: "30",
1141
- className: k
1126
+ className: O
1142
1127
  })] }),
1143
- /* @__PURE__ */ D("label", {
1128
+ /* @__PURE__ */ E("label", {
1144
1129
  className: "flex items-center justify-between gap-3 rounded-md border border-border-subtle bg-bg-surface px-3 py-2",
1145
- children: [/* @__PURE__ */ E("span", {
1130
+ children: [/* @__PURE__ */ T("span", {
1146
1131
  className: "text-sm text-text-primary",
1147
1132
  children: r("healthybowl.irrigation.automation.form.skipRain.label", "Skip if rain is forecast")
1148
- }), /* @__PURE__ */ E("input", {
1133
+ }), /* @__PURE__ */ T("input", {
1149
1134
  type: "checkbox",
1150
1135
  checked: f.skipIfRain,
1151
- onChange: (e) => x("skipIfRain", e.target.checked),
1136
+ onChange: (e) => C("skipIfRain", e.target.checked),
1152
1137
  className: "h-4 w-4 accent-[var(--color-primary)]"
1153
1138
  })]
1154
1139
  }),
1155
- f.skipIfRain && /* @__PURE__ */ D("div", { children: [/* @__PURE__ */ E("label", {
1140
+ f.skipIfRain && /* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("label", {
1156
1141
  htmlFor: "auto-rain",
1157
1142
  className: "mb-1 block text-sm font-medium text-text-primary",
1158
1143
  children: r("healthybowl.irrigation.automation.form.rainProb.label", "Rain Probability Threshold (%)")
1159
- }), /* @__PURE__ */ E("input", {
1144
+ }), /* @__PURE__ */ T("input", {
1160
1145
  id: "auto-rain",
1161
1146
  type: "number",
1162
1147
  min: "0",
1163
1148
  max: "100",
1164
1149
  step: "1",
1165
1150
  value: f.rainProbThreshold,
1166
- onChange: (e) => x("rainProbThreshold", e.target.value),
1151
+ onChange: (e) => C("rainProbThreshold", e.target.value),
1167
1152
  placeholder: "50",
1168
- className: k
1153
+ className: O
1169
1154
  })] }),
1170
- /* @__PURE__ */ D("label", {
1155
+ /* @__PURE__ */ E("label", {
1171
1156
  className: "flex items-center justify-between gap-3 rounded-md border border-border-subtle bg-bg-surface px-3 py-2",
1172
- children: [/* @__PURE__ */ E("span", {
1157
+ children: [/* @__PURE__ */ T("span", {
1173
1158
  className: "text-sm text-text-primary",
1174
1159
  children: r("healthybowl.irrigation.automation.form.notify.label", "Send in-app notification")
1175
- }), /* @__PURE__ */ E("input", {
1160
+ }), /* @__PURE__ */ T("input", {
1176
1161
  type: "checkbox",
1177
1162
  checked: f.notifyInApp,
1178
- onChange: (e) => x("notifyInApp", e.target.checked),
1179
- className: "h-4 w-4 accent-[var(--color-primary)]"
1180
- })]
1181
- }),
1182
- /* @__PURE__ */ D("label", {
1183
- className: "flex items-center justify-between gap-3 rounded-md border border-border-subtle bg-bg-surface px-3 py-2",
1184
- children: [/* @__PURE__ */ D("span", {
1185
- className: "text-sm text-text-primary",
1186
- children: [r("healthybowl.irrigation.automation.form.autoTask.label", "Create a task when a run fires"), /* @__PURE__ */ E("span", {
1187
- className: "mt-0.5 block text-xs text-text-secondary",
1188
- children: r("healthybowl.irrigation.automation.form.autoTask.help", "Adds a card to Farm Tasks when this rule waters. A skipped run adds nothing.")
1189
- })]
1190
- }), /* @__PURE__ */ E("input", {
1191
- type: "checkbox",
1192
- "data-testid": "irrigation-auto-task-toggle",
1193
- checked: f.autoTaskEnabled,
1194
- onChange: (e) => x("autoTaskEnabled", e.target.checked),
1163
+ onChange: (e) => C("notifyInApp", e.target.checked),
1195
1164
  className: "h-4 w-4 accent-[var(--color-primary)]"
1196
1165
  })]
1197
1166
  })
@@ -1201,6 +1170,6 @@ var k = "h-9 w-full rounded-md border border-border-subtle bg-bg-surface px-3 te
1201
1170
  });
1202
1171
  };
1203
1172
  //#endregion
1204
- export { _e as IrrigationPage };
1173
+ export { P as IrrigationPage };
1205
1174
 
1206
1175
  //# sourceMappingURL=IrrigationPage.js.map