@burdenoff/microfe-healthybowl 2026.811.6 → 2026.811.8

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.
@@ -1,314 +1,316 @@
1
1
  import { HealthyBowlProvider as e } from "./context/HealthyBowlContext.js";
2
- import { normalizeBasePath as t } from "./utils/helpers.js";
3
- import { ErrorBoundary as n } from "./components/ErrorBoundary.js";
4
- import { ConfirmProvider as r } from "./components/ConfirmDialog.js";
5
- import { HealthyBowlRoutes as i } from "./HealthyBowlRoutes.js";
6
- import { OfflineSyncProvider as a } from "./offline/OfflineSyncProvider.js";
7
- import { useCallback as o, useEffect as s } from "react";
8
- import { useI18n as c } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
9
- import { Award as l, Banknote as u, BarChart3 as d, Bug as f, Cloud as p, CloudUpload as m, DollarSign as h, Factory as g, Fence as _, FlaskConical as v, Globe as y, Home as b, Landmark as x, Leaf as S, LineChart as C, ListChecks as w, Map as T, Package as E, PawPrint as D, Radio as O, RefreshCw as k, ScanLine as A, ScanSearch as j, ShieldAlert as M, ShieldCheck as N, ShoppingCart as P, Sprout as F, Stethoscope as I, Tractor as L, UserCheck as R, Users as z, Users2 as B, Wheat as V } from "lucide-react";
10
- import { jsx as H } from "react/jsx-runtime";
11
- import { FeatureFlagProvider as U } from "@burdenoff/fe-libs/shared/feature-flags";
2
+ import { normalizeBasePath as t, setHbFormatLocale as n } from "./utils/helpers.js";
3
+ import { ErrorBoundary as r } from "./components/ErrorBoundary.js";
4
+ import { ConfirmProvider as i } from "./components/ConfirmDialog.js";
5
+ import { HealthyBowlRoutes as a } from "./HealthyBowlRoutes.js";
6
+ import { OfflineSyncProvider as o } from "./offline/OfflineSyncProvider.js";
7
+ import { useCallback as s, useEffect as c } from "react";
8
+ import { useI18n as l } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
9
+ import { Award as u, Banknote as d, BarChart3 as f, Bug as p, Cloud as m, CloudUpload as h, DollarSign as g, Factory as _, Fence as v, FlaskConical as y, Globe as b, Home as x, Landmark as S, Leaf as C, LineChart as w, ListChecks as T, Map as E, Package as D, PawPrint as O, Radio as k, RefreshCw as A, ScanLine as j, ScanSearch as M, ShieldAlert as N, ShieldCheck as P, ShoppingCart as F, Sprout as I, Stethoscope as L, Tractor as R, UserCheck as z, Users as B, Users2 as V, Wheat as H } from "lucide-react";
10
+ import { jsx as U } from "react/jsx-runtime";
11
+ import { FeatureFlagProvider as W } from "@burdenoff/fe-libs/shared/feature-flags";
12
12
  //#region src/healthybowl/HealthyBowlRoot.tsx
13
- var W = (W) => {
14
- let { registerNavItems: G, registerFooterItems: K, basePath: q = "/" } = W, { t: J } = c(), Y = o((e, t) => {
15
- let n = J(e);
13
+ var G = (G) => {
14
+ let { registerNavItems: K, registerFooterItems: q, basePath: J = "/" } = G, { t: Y, locale: X } = l();
15
+ n(X);
16
+ let Z = s((e, t) => {
17
+ let n = Y(e);
16
18
  return n === e ? t : n;
17
- }, [J]), X = (e, t) => (e.endsWith("/") ? e.slice(0, -1) : e) + (t.startsWith("/") ? t : `/${t}`);
18
- return s(() => {
19
- if (G) return G([
19
+ }, [Y]), Q = (e, t) => (e.endsWith("/") ? e.slice(0, -1) : e) + (t.startsWith("/") ? t : `/${t}`);
20
+ return c(() => {
21
+ if (K) return K([
20
22
  {
21
23
  id: "healthybowl-dashboard",
22
- label: Y("healthybowl.nav.dashboard", "Dashboard"),
23
- path: t(q),
24
- icon: /* @__PURE__ */ H(b, { size: 20 }),
24
+ label: Z("healthybowl.nav.dashboard", "Dashboard"),
25
+ path: t(J),
26
+ icon: /* @__PURE__ */ U(x, { size: 20 }),
25
27
  order: 1,
26
28
  group: "main"
27
29
  },
28
30
  {
29
31
  id: "healthybowl-farm",
30
- label: Y("healthybowl.nav.farm", "My Farm"),
31
- path: X(q, "farm"),
32
- icon: /* @__PURE__ */ H(L, { size: 20 }),
32
+ label: Z("healthybowl.nav.farm", "My Farm"),
33
+ path: Q(J, "farm"),
34
+ icon: /* @__PURE__ */ U(R, { size: 20 }),
33
35
  order: 2,
34
36
  group: "main"
35
37
  },
36
38
  {
37
39
  id: "healthybowl-tasks",
38
- label: Y("healthybowl.nav.tasks", "Tasks"),
39
- path: X(q, "tasks"),
40
- icon: /* @__PURE__ */ H(w, { size: 20 }),
40
+ label: Z("healthybowl.nav.tasks", "Tasks"),
41
+ path: Q(J, "tasks"),
42
+ icon: /* @__PURE__ */ U(T, { size: 20 }),
41
43
  order: 3,
42
44
  group: "main"
43
45
  },
44
46
  {
45
47
  id: "healthybowl-crops",
46
- label: Y("healthybowl.nav.crops", "Crops"),
47
- path: X(q, "crops"),
48
- icon: /* @__PURE__ */ H(V, { size: 20 }),
48
+ label: Z("healthybowl.nav.crops", "Crops"),
49
+ path: Q(J, "crops"),
50
+ icon: /* @__PURE__ */ U(H, { size: 20 }),
49
51
  order: 10,
50
52
  group: "farming"
51
53
  },
52
54
  {
53
55
  id: "healthybowl-livestock",
54
- label: Y("healthybowl.nav.livestock", "Livestock"),
55
- path: X(q, "livestock"),
56
- icon: /* @__PURE__ */ H(D, { size: 20 }),
56
+ label: Z("healthybowl.nav.livestock", "Livestock"),
57
+ path: Q(J, "livestock"),
58
+ icon: /* @__PURE__ */ U(O, { size: 20 }),
57
59
  order: 11,
58
60
  group: "farming"
59
61
  },
60
62
  {
61
63
  id: "healthybowl-livestock-analytics",
62
- label: Y("healthybowl.nav.livestockAnalytics", "Livestock Analytics"),
63
- path: X(q, "livestock/analytics"),
64
- icon: /* @__PURE__ */ H(C, { size: 20 }),
64
+ label: Z("healthybowl.nav.livestockAnalytics", "Livestock Analytics"),
65
+ path: Q(J, "livestock/analytics"),
66
+ icon: /* @__PURE__ */ U(w, { size: 20 }),
65
67
  order: 11.3,
66
68
  group: "farming"
67
69
  },
68
70
  {
69
71
  id: "healthybowl-grazing",
70
- label: Y("healthybowl.nav.grazing", "Grazing"),
71
- path: X(q, "livestock/grazing"),
72
- icon: /* @__PURE__ */ H(_, { size: 20 }),
72
+ label: Z("healthybowl.nav.grazing", "Grazing"),
73
+ path: Q(J, "livestock/grazing"),
74
+ icon: /* @__PURE__ */ U(v, { size: 20 }),
73
75
  order: 11.4,
74
76
  group: "farming"
75
77
  },
76
78
  {
77
79
  id: "healthybowl-withdrawal-alerts",
78
- label: Y("healthybowl.nav.withdrawalAlerts", "Withdrawal Alerts"),
79
- path: X(q, "livestock/withdrawal-alerts"),
80
- icon: /* @__PURE__ */ H(M, { size: 20 }),
80
+ label: Z("healthybowl.nav.withdrawalAlerts", "Withdrawal Alerts"),
81
+ path: Q(J, "livestock/withdrawal-alerts"),
82
+ icon: /* @__PURE__ */ U(N, { size: 20 }),
81
83
  order: 11.5,
82
84
  group: "farming"
83
85
  },
84
86
  {
85
87
  id: "healthybowl-weather",
86
- label: Y("healthybowl.nav.weather", "Weather"),
87
- path: X(q, "weather"),
88
- icon: /* @__PURE__ */ H(p, { size: 20 }),
88
+ label: Z("healthybowl.nav.weather", "Weather"),
89
+ path: Q(J, "weather"),
90
+ icon: /* @__PURE__ */ U(m, { size: 20 }),
89
91
  order: 12,
90
92
  group: "farming"
91
93
  },
92
94
  {
93
95
  id: "healthybowl-field-map",
94
- label: Y("healthybowl.nav.fieldMap", "Field Map"),
95
- path: X(q, "field-map"),
96
- icon: /* @__PURE__ */ H(T, { size: 20 }),
96
+ label: Z("healthybowl.nav.fieldMap", "Field Map"),
97
+ path: Q(J, "field-map"),
98
+ icon: /* @__PURE__ */ U(E, { size: 20 }),
97
99
  order: 12.5,
98
100
  group: "farming"
99
101
  },
100
102
  {
101
103
  id: "healthybowl-field-capture",
102
- label: Y("healthybowl.nav.fieldCapture", "Field Capture"),
103
- path: X(q, "field-capture"),
104
- icon: /* @__PURE__ */ H(m, { size: 20 }),
104
+ label: Z("healthybowl.nav.fieldCapture", "Field Capture"),
105
+ path: Q(J, "field-capture"),
106
+ icon: /* @__PURE__ */ U(h, { size: 20 }),
105
107
  order: 12.6,
106
108
  group: "farming"
107
109
  },
108
110
  {
109
111
  id: "healthybowl-pending-sync",
110
- label: Y("healthybowl.nav.pendingSync", "Pending Sync"),
111
- path: X(q, "field-capture/pending"),
112
- icon: /* @__PURE__ */ H(k, { size: 20 }),
112
+ label: Z("healthybowl.nav.pendingSync", "Pending Sync"),
113
+ path: Q(J, "field-capture/pending"),
114
+ icon: /* @__PURE__ */ U(A, { size: 20 }),
113
115
  order: 12.7,
114
116
  group: "farming"
115
117
  },
116
118
  {
117
119
  id: "healthybowl-field-sensors",
118
- label: Y("healthybowl.nav.fieldSensors", "Field Sensors"),
119
- path: X(q, "field-sensors"),
120
- icon: /* @__PURE__ */ H(O, { size: 20 }),
120
+ label: Z("healthybowl.nav.fieldSensors", "Field Sensors"),
121
+ path: Q(J, "field-sensors"),
122
+ icon: /* @__PURE__ */ U(k, { size: 20 }),
121
123
  order: 12.75,
122
124
  group: "farming"
123
125
  },
124
126
  {
125
127
  id: "healthybowl-soil",
126
- label: Y("healthybowl.nav.soilHealth", "Soil Health"),
127
- path: X(q, "soil"),
128
- icon: /* @__PURE__ */ H(v, { size: 20 }),
128
+ label: Z("healthybowl.nav.soilHealth", "Soil Health"),
129
+ path: Q(J, "soil"),
130
+ icon: /* @__PURE__ */ U(y, { size: 20 }),
129
131
  order: 13,
130
132
  group: "farming"
131
133
  },
132
134
  {
133
135
  id: "healthybowl-pest",
134
- label: Y("healthybowl.nav.pestManagement", "Pest Management"),
135
- path: X(q, "pest-management"),
136
- icon: /* @__PURE__ */ H(f, { size: 20 }),
136
+ label: Z("healthybowl.nav.pestManagement", "Pest Management"),
137
+ path: Q(J, "pest-management"),
138
+ icon: /* @__PURE__ */ U(p, { size: 20 }),
137
139
  order: 14,
138
140
  group: "farming"
139
141
  },
140
142
  {
141
143
  id: "healthybowl-pest-ai",
142
- label: Y("healthybowl.nav.aiPestDetection", "AI Pest Detection"),
143
- path: X(q, "pest-management/ai-detection"),
144
- icon: /* @__PURE__ */ H(j, { size: 20 }),
144
+ label: Z("healthybowl.nav.aiPestDetection", "AI Pest Detection"),
145
+ path: Q(J, "pest-management/ai-detection"),
146
+ icon: /* @__PURE__ */ U(M, { size: 20 }),
145
147
  order: 14.5,
146
148
  group: "farming"
147
149
  },
148
150
  {
149
151
  id: "healthybowl-production",
150
- label: Y("healthybowl.nav.production", "Production"),
151
- path: X(q, "production"),
152
- icon: /* @__PURE__ */ H(g, { size: 20 }),
152
+ label: Z("healthybowl.nav.production", "Production"),
153
+ path: Q(J, "production"),
154
+ icon: /* @__PURE__ */ U(_, { size: 20 }),
153
155
  order: 20,
154
156
  group: "business"
155
157
  },
156
158
  {
157
159
  id: "healthybowl-products",
158
- label: Y("healthybowl.nav.products", "Products"),
159
- path: X(q, "products"),
160
- icon: /* @__PURE__ */ H(E, { size: 20 }),
160
+ label: Z("healthybowl.nav.products", "Products"),
161
+ path: Q(J, "products"),
162
+ icon: /* @__PURE__ */ U(D, { size: 20 }),
161
163
  order: 21,
162
164
  group: "business"
163
165
  },
164
166
  {
165
167
  id: "healthybowl-marketplace",
166
- label: Y("healthybowl.nav.marketplace", "Marketplace"),
167
- path: X(q, "marketplace"),
168
- icon: /* @__PURE__ */ H(P, { size: 20 }),
168
+ label: Z("healthybowl.nav.marketplace", "Marketplace"),
169
+ path: Q(J, "marketplace"),
170
+ icon: /* @__PURE__ */ U(F, { size: 20 }),
169
171
  order: 22,
170
172
  group: "business"
171
173
  },
172
174
  {
173
175
  id: "healthybowl-coop",
174
- label: Y("healthybowl.nav.coop", "Co-operative"),
175
- path: X(q, "coop"),
176
- icon: /* @__PURE__ */ H(B, { size: 20 }),
176
+ label: Z("healthybowl.nav.coop", "Co-operative"),
177
+ path: Q(J, "coop"),
178
+ icon: /* @__PURE__ */ U(V, { size: 20 }),
177
179
  order: 22.5,
178
180
  group: "business"
179
181
  },
180
182
  {
181
183
  id: "healthybowl-financial",
182
- label: Y("healthybowl.nav.financial", "Financial"),
183
- path: X(q, "financial"),
184
- icon: /* @__PURE__ */ H(h, { size: 20 }),
184
+ label: Z("healthybowl.nav.financial", "Financial"),
185
+ path: Q(J, "financial"),
186
+ icon: /* @__PURE__ */ U(g, { size: 20 }),
185
187
  order: 23,
186
188
  group: "business"
187
189
  },
188
190
  {
189
191
  id: "healthybowl-financier",
190
- label: Y("healthybowl.nav.financier", "Financier"),
191
- path: X(q, "financier"),
192
- icon: /* @__PURE__ */ H(u, { size: 20 }),
192
+ label: Z("healthybowl.nav.financier", "Financier"),
193
+ path: Q(J, "financier"),
194
+ icon: /* @__PURE__ */ U(d, { size: 20 }),
193
195
  order: 24,
194
196
  group: "business"
195
197
  },
196
198
  {
197
199
  id: "healthybowl-compliance",
198
- label: Y("healthybowl.nav.compliance", "Compliance"),
199
- path: X(q, "compliance"),
200
- icon: /* @__PURE__ */ H(N, { size: 20 }),
200
+ label: Z("healthybowl.nav.compliance", "Compliance"),
201
+ path: Q(J, "compliance"),
202
+ icon: /* @__PURE__ */ U(P, { size: 20 }),
201
203
  order: 30,
202
204
  group: "compliance"
203
205
  },
204
206
  {
205
207
  id: "healthybowl-traceability",
206
- label: Y("healthybowl.nav.traceability", "Traceability"),
207
- path: X(q, "traceability"),
208
- icon: /* @__PURE__ */ H(A, { size: 20 }),
208
+ label: Z("healthybowl.nav.traceability", "Traceability"),
209
+ path: Q(J, "traceability"),
210
+ icon: /* @__PURE__ */ U(j, { size: 20 }),
209
211
  order: 31,
210
212
  group: "compliance"
211
213
  },
212
214
  {
213
215
  id: "healthybowl-sustainability",
214
- label: Y("healthybowl.nav.sustainability", "Sustainability"),
215
- path: X(q, "sustainability"),
216
- icon: /* @__PURE__ */ H(S, { size: 20 }),
216
+ label: Z("healthybowl.nav.sustainability", "Sustainability"),
217
+ path: Q(J, "sustainability"),
218
+ icon: /* @__PURE__ */ U(C, { size: 20 }),
217
219
  order: 32,
218
220
  group: "compliance"
219
221
  },
220
222
  {
221
223
  id: "healthybowl-sustainability-carbon",
222
- label: Y("healthybowl.nav.sustainabilityCarbon", "Carbon & GHG"),
223
- path: X(q, "sustainability/carbon"),
224
- icon: /* @__PURE__ */ H(g, { size: 20 }),
224
+ label: Z("healthybowl.nav.sustainabilityCarbon", "Carbon & GHG"),
225
+ path: Q(J, "sustainability/carbon"),
226
+ icon: /* @__PURE__ */ U(_, { size: 20 }),
225
227
  order: 32.1,
226
228
  group: "compliance"
227
229
  },
228
230
  {
229
231
  id: "healthybowl-sustainability-soil",
230
- label: Y("healthybowl.nav.sustainabilitySoil", "Soil Carbon"),
231
- path: X(q, "sustainability/soil-carbon"),
232
- icon: /* @__PURE__ */ H(F, { size: 20 }),
232
+ label: Z("healthybowl.nav.sustainabilitySoil", "Soil Carbon"),
233
+ path: Q(J, "sustainability/soil-carbon"),
234
+ icon: /* @__PURE__ */ U(I, { size: 20 }),
233
235
  order: 32.2,
234
236
  group: "compliance"
235
237
  },
236
238
  {
237
239
  id: "healthybowl-sustainability-credits",
238
- label: Y("healthybowl.nav.sustainabilityCredits", "Carbon Credits"),
239
- path: X(q, "sustainability/credits"),
240
- icon: /* @__PURE__ */ H(l, { size: 20 }),
240
+ label: Z("healthybowl.nav.sustainabilityCredits", "Carbon Credits"),
241
+ path: Q(J, "sustainability/credits"),
242
+ icon: /* @__PURE__ */ U(u, { size: 20 }),
241
243
  order: 32.3,
242
244
  group: "compliance"
243
245
  },
244
246
  {
245
247
  id: "healthybowl-sustainability-eudr",
246
- label: Y("healthybowl.nav.sustainabilityEudr", "EUDR Due-Diligence"),
247
- path: X(q, "sustainability/eudr"),
248
- icon: /* @__PURE__ */ H(y, { size: 20 }),
248
+ label: Z("healthybowl.nav.sustainabilityEudr", "EUDR Due-Diligence"),
249
+ path: Q(J, "sustainability/eudr"),
250
+ icon: /* @__PURE__ */ U(b, { size: 20 }),
249
251
  order: 32.4,
250
252
  group: "compliance"
251
253
  },
252
254
  {
253
255
  id: "healthybowl-schemes",
254
- label: Y("healthybowl.nav.governmentSchemes", "Gov. Schemes"),
255
- path: X(q, "government-schemes"),
256
- icon: /* @__PURE__ */ H(x, { size: 20 }),
256
+ label: Z("healthybowl.nav.governmentSchemes", "Gov. Schemes"),
257
+ path: Q(J, "government-schemes"),
258
+ icon: /* @__PURE__ */ U(S, { size: 20 }),
257
259
  order: 40,
258
260
  group: "support"
259
261
  },
260
262
  {
261
263
  id: "healthybowl-network",
262
- label: Y("healthybowl.nav.network", "Network"),
263
- path: X(q, "network"),
264
- icon: /* @__PURE__ */ H(z, { size: 20 }),
264
+ label: Z("healthybowl.nav.network", "Network"),
265
+ path: Q(J, "network"),
266
+ icon: /* @__PURE__ */ U(B, { size: 20 }),
265
267
  order: 41,
266
268
  group: "support"
267
269
  },
268
270
  {
269
271
  id: "healthybowl-analytics",
270
- label: Y("healthybowl.nav.analytics", "Analytics"),
271
- path: X(q, "analytics"),
272
- icon: /* @__PURE__ */ H(d, { size: 20 }),
272
+ label: Z("healthybowl.nav.analytics", "Analytics"),
273
+ path: Q(J, "analytics"),
274
+ icon: /* @__PURE__ */ U(f, { size: 20 }),
273
275
  order: 42,
274
276
  group: "support"
275
277
  },
276
278
  {
277
279
  id: "healthybowl-advisors",
278
- label: Y("healthybowl.nav.advisors", "My Advisors"),
279
- path: X(q, "advisors"),
280
- icon: /* @__PURE__ */ H(R, { size: 20 }),
280
+ label: Z("healthybowl.nav.advisors", "My Advisors"),
281
+ path: Q(J, "advisors"),
282
+ icon: /* @__PURE__ */ U(z, { size: 20 }),
281
283
  order: 43,
282
284
  group: "support"
283
285
  },
284
286
  {
285
287
  id: "healthybowl-consultant",
286
- label: Y("healthybowl.nav.consultant", "Consultant"),
287
- path: X(q, "consultant"),
288
- icon: /* @__PURE__ */ H(I, { size: 20 }),
288
+ label: Z("healthybowl.nav.consultant", "Consultant"),
289
+ path: Q(J, "consultant"),
290
+ icon: /* @__PURE__ */ U(L, { size: 20 }),
289
291
  order: 44,
290
292
  group: "support"
291
293
  }
292
294
  ]);
293
- }, [G, q]), s(() => {
294
- if (K) return K([{
295
+ }, [K, J]), c(() => {
296
+ if (q) return q([{
295
297
  id: "healthybowl-status",
296
- label: Y("healthybowl.footer.ready", "HealthyBowl Ready"),
298
+ label: Z("healthybowl.footer.ready", "HealthyBowl Ready"),
297
299
  type: "status",
298
300
  order: 10,
299
301
  section: "left"
300
302
  }]);
301
- }, [K]), /* @__PURE__ */ H(U, {
303
+ }, [q]), /* @__PURE__ */ U(W, {
302
304
  workspaceId: null,
303
305
  gateway: "global",
304
306
  defaultEnabled: !0,
305
- children: /* @__PURE__ */ H(e, {
306
- ...W,
307
- children: /* @__PURE__ */ H(n, { children: /* @__PURE__ */ H(r, { children: /* @__PURE__ */ H(a, { children: /* @__PURE__ */ H(i, {}) }) }) })
307
+ children: /* @__PURE__ */ U(e, {
308
+ ...G,
309
+ children: /* @__PURE__ */ U(r, { children: /* @__PURE__ */ U(i, { children: /* @__PURE__ */ U(o, { children: /* @__PURE__ */ U(a, {}) }) }) })
308
310
  })
309
311
  });
310
312
  };
311
313
  //#endregion
312
- export { W as HealthyBowlRoot };
314
+ export { G as HealthyBowlRoot };
313
315
 
314
316
  //# sourceMappingURL=HealthyBowlRoot.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"HealthyBowlRoot.js","names":[],"sources":["../../src/healthybowl/HealthyBowlRoot.tsx"],"sourcesContent":["/**\n * HealthyBowl Root Component\n * @module healthybowl\n */\n\nimport type { FC } from 'react';\nimport { useCallback, useEffect } from 'react';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\nimport {\n Home,\n Tractor,\n ListChecks,\n Wheat,\n PawPrint,\n Cloud,\n Map as MapIcon,\n ShoppingCart,\n DollarSign,\n BarChart3,\n FlaskConical,\n Bug,\n ScanSearch,\n Factory,\n Package,\n ScanLine,\n ShieldCheck,\n Landmark,\n Banknote,\n Stethoscope,\n UserCheck,\n Users,\n CloudUpload,\n RefreshCw,\n ShieldAlert,\n LineChart,\n Fence,\n Radio,\n Leaf,\n Sprout,\n Award,\n Globe,\n Users2,\n} from 'lucide-react';\nimport { HealthyBowlProvider } from './context/HealthyBowlContext';\nimport { FeatureFlagProvider } from '@burdenoff/fe-libs/shared/feature-flags';\nimport { HealthyBowlRoutes } from './HealthyBowlRoutes';\nimport { ErrorBoundary } from './components/ErrorBoundary';\nimport { ConfirmProvider } from './components/ConfirmDialog';\nimport { OfflineSyncProvider } from './offline/OfflineSyncProvider';\nimport { normalizeBasePath } from './utils/helpers';\nimport type { HealthyBowlRootProps, NavItem } from './types';\n\nexport const HealthyBowlRoot: FC<HealthyBowlRootProps> = (props) => {\n const { registerNavItems, registerFooterItems, basePath = '/' } = props;\n const { t: translate } = useI18n();\n const t = useCallback(\n (key: string, fallback: string): string => {\n const value = translate(key);\n return value === key ? fallback : value;\n },\n [translate]\n );\n\n // Helper to join paths correctly\n const joinPath = (base: string, path: string): string => {\n const cleanBase = base.endsWith('/') ? base.slice(0, -1) : base;\n const cleanPath = path.startsWith('/') ? path : `/${path}`;\n return cleanBase + cleanPath;\n };\n\n // Register navigation items with shell on mount\n useEffect(() => {\n if (!registerNavItems) return;\n\n const navItems: NavItem[] = [\n // Dashboard\n {\n id: 'healthybowl-dashboard',\n label: t('healthybowl.nav.dashboard', 'Dashboard'),\n // The product index IS the dashboard. Normalize a trailing slash like\n // every sibling item (joinPath) so active-state highlighting matches if\n // the host ever passes '/healthybowl/'.\n path: normalizeBasePath(basePath),\n icon: <Home size={20} />,\n order: 1,\n group: 'main',\n },\n\n // My Farm\n {\n id: 'healthybowl-farm',\n label: t('healthybowl.nav.farm', 'My Farm'),\n path: joinPath(basePath, 'farm'),\n icon: <Tractor size={20} />,\n order: 2,\n group: 'main',\n },\n\n // Farm Tasks (PlanMagnet embed) — shared work-item board across the farm.\n {\n id: 'healthybowl-tasks',\n label: t('healthybowl.nav.tasks', 'Tasks'),\n path: joinPath(basePath, 'tasks'),\n icon: <ListChecks size={20} />,\n order: 3,\n group: 'main',\n },\n\n // Crops\n {\n id: 'healthybowl-crops',\n label: t('healthybowl.nav.crops', 'Crops'),\n path: joinPath(basePath, 'crops'),\n icon: <Wheat size={20} />,\n order: 10,\n group: 'farming',\n },\n\n // Livestock\n {\n id: 'healthybowl-livestock',\n label: t('healthybowl.nav.livestock', 'Livestock'),\n path: joinPath(basePath, 'livestock'),\n icon: <PawPrint size={20} />,\n order: 11,\n group: 'farming',\n },\n\n // Livestock — Analytics (BOFF-6126). The growth, feed and herd-stats charts (BOFF-5971) also\n // render inline on the livestock dashboard; this gives them a dedicated URL and full-width home.\n {\n id: 'healthybowl-livestock-analytics',\n label: t('healthybowl.nav.livestockAnalytics', 'Livestock Analytics'),\n path: joinPath(basePath, 'livestock/analytics'),\n icon: <LineChart size={20} />,\n order: 11.3,\n group: 'farming',\n },\n\n // Livestock — Grazing management (BOFF-5970). Sits next to Livestock rather than inside it\n // because rotational grazing is a daily decision about FIELDS, not a herd-record lookup.\n {\n id: 'healthybowl-grazing',\n label: t('healthybowl.nav.grazing', 'Grazing'),\n path: joinPath(basePath, 'livestock/grazing'),\n icon: <Fence size={20} />,\n order: 11.4,\n group: 'farming',\n },\n\n // Livestock — Medication Withdrawal Alerts (BOFF-2885)\n {\n id: 'healthybowl-withdrawal-alerts',\n label: t('healthybowl.nav.withdrawalAlerts', 'Withdrawal Alerts'),\n path: joinPath(basePath, 'livestock/withdrawal-alerts'),\n icon: <ShieldAlert size={20} />,\n order: 11.5,\n group: 'farming',\n },\n\n // Weather\n {\n id: 'healthybowl-weather',\n label: t('healthybowl.nav.weather', 'Weather'),\n path: joinPath(basePath, 'weather'),\n icon: <Cloud size={20} />,\n order: 12,\n group: 'farming',\n },\n\n // Field Map — draw & manage field boundaries on satellite imagery\n {\n id: 'healthybowl-field-map',\n label: t('healthybowl.nav.fieldMap', 'Field Map'),\n path: joinPath(basePath, 'field-map'),\n icon: <MapIcon size={20} />,\n order: 12.5,\n group: 'farming',\n },\n\n // Field Capture — offline-first observation capture (BOFF-2883)\n {\n id: 'healthybowl-field-capture',\n label: t('healthybowl.nav.fieldCapture', 'Field Capture'),\n path: joinPath(basePath, 'field-capture'),\n icon: <CloudUpload size={20} />,\n order: 12.6,\n group: 'farming',\n },\n\n // Pending Sync — the offline outbox / sync queue (BOFF-2883)\n {\n id: 'healthybowl-pending-sync',\n label: t('healthybowl.nav.pendingSync', 'Pending Sync'),\n path: joinPath(basePath, 'field-capture/pending'),\n icon: <RefreshCw size={20} />,\n order: 12.7,\n group: 'farming',\n },\n\n // Field Sensors — live probe monitoring (BOFF-2894)\n {\n id: 'healthybowl-field-sensors',\n label: t('healthybowl.nav.fieldSensors', 'Field Sensors'),\n path: joinPath(basePath, 'field-sensors'),\n icon: <Radio size={20} />,\n order: 12.75,\n group: 'farming',\n },\n\n // Soil Health\n {\n id: 'healthybowl-soil',\n label: t('healthybowl.nav.soilHealth', 'Soil Health'),\n path: joinPath(basePath, 'soil'),\n icon: <FlaskConical size={20} />,\n order: 13,\n group: 'farming',\n },\n\n // Pest Management\n {\n id: 'healthybowl-pest',\n label: t('healthybowl.nav.pestManagement', 'Pest Management'),\n path: joinPath(basePath, 'pest-management'),\n icon: <Bug size={20} />,\n order: 14,\n group: 'farming',\n },\n {\n id: 'healthybowl-pest-ai',\n label: t('healthybowl.nav.aiPestDetection', 'AI Pest Detection'),\n path: joinPath(basePath, 'pest-management/ai-detection'),\n icon: <ScanSearch size={20} />,\n order: 14.5,\n group: 'farming',\n },\n\n // Production\n {\n id: 'healthybowl-production',\n label: t('healthybowl.nav.production', 'Production'),\n path: joinPath(basePath, 'production'),\n icon: <Factory size={20} />,\n order: 20,\n group: 'business',\n },\n\n // Products\n {\n id: 'healthybowl-products',\n label: t('healthybowl.nav.products', 'Products'),\n path: joinPath(basePath, 'products'),\n icon: <Package size={20} />,\n order: 21,\n group: 'business',\n },\n\n // Marketplace\n {\n id: 'healthybowl-marketplace',\n label: t('healthybowl.nav.marketplace', 'Marketplace'),\n path: joinPath(basePath, 'marketplace'),\n icon: <ShoppingCart size={20} />,\n order: 22,\n group: 'business',\n },\n\n // Co-operative / FPO aggregation (BOFF-6023)\n {\n id: 'healthybowl-coop',\n label: t('healthybowl.nav.coop', 'Co-operative'),\n path: joinPath(basePath, 'coop'),\n icon: <Users2 size={20} />,\n order: 22.5,\n group: 'business',\n },\n\n // Financial\n {\n id: 'healthybowl-financial',\n label: t('healthybowl.nav.financial', 'Financial'),\n path: joinPath(basePath, 'financial'),\n icon: <DollarSign size={20} />,\n order: 23,\n group: 'business',\n },\n\n // Financier portfolio (B2B2C bridge)\n {\n id: 'healthybowl-financier',\n label: t('healthybowl.nav.financier', 'Financier'),\n path: joinPath(basePath, 'financier'),\n icon: <Banknote size={20} />,\n order: 24,\n group: 'business',\n },\n\n // Compliance\n {\n id: 'healthybowl-compliance',\n label: t('healthybowl.nav.compliance', 'Compliance'),\n path: joinPath(basePath, 'compliance'),\n icon: <ShieldCheck size={20} />,\n order: 30,\n group: 'compliance',\n },\n\n // Traceability\n {\n id: 'healthybowl-traceability',\n label: t('healthybowl.nav.traceability', 'Traceability'),\n path: joinPath(basePath, 'traceability'),\n icon: <ScanLine size={20} />,\n order: 31,\n group: 'compliance',\n },\n\n // Sustainability — Carbon & Climate (BOFF-2896)\n {\n id: 'healthybowl-sustainability',\n label: t('healthybowl.nav.sustainability', 'Sustainability'),\n path: joinPath(basePath, 'sustainability'),\n icon: <Leaf size={20} />,\n order: 32,\n group: 'compliance',\n },\n {\n id: 'healthybowl-sustainability-carbon',\n label: t('healthybowl.nav.sustainabilityCarbon', 'Carbon & GHG'),\n path: joinPath(basePath, 'sustainability/carbon'),\n icon: <Factory size={20} />,\n order: 32.1,\n group: 'compliance',\n },\n {\n id: 'healthybowl-sustainability-soil',\n label: t('healthybowl.nav.sustainabilitySoil', 'Soil Carbon'),\n path: joinPath(basePath, 'sustainability/soil-carbon'),\n icon: <Sprout size={20} />,\n order: 32.2,\n group: 'compliance',\n },\n {\n id: 'healthybowl-sustainability-credits',\n label: t('healthybowl.nav.sustainabilityCredits', 'Carbon Credits'),\n path: joinPath(basePath, 'sustainability/credits'),\n icon: <Award size={20} />,\n order: 32.3,\n group: 'compliance',\n },\n {\n id: 'healthybowl-sustainability-eudr',\n label: t('healthybowl.nav.sustainabilityEudr', 'EUDR Due-Diligence'),\n path: joinPath(basePath, 'sustainability/eudr'),\n icon: <Globe size={20} />,\n order: 32.4,\n group: 'compliance',\n },\n\n // Government Schemes\n {\n id: 'healthybowl-schemes',\n label: t('healthybowl.nav.governmentSchemes', 'Gov. Schemes'),\n path: joinPath(basePath, 'government-schemes'),\n icon: <Landmark size={20} />,\n order: 40,\n group: 'support',\n },\n\n // Network\n {\n id: 'healthybowl-network',\n label: t('healthybowl.nav.network', 'Network'),\n path: joinPath(basePath, 'network'),\n icon: <Users size={20} />,\n order: 41,\n group: 'support',\n },\n\n // Analytics\n {\n id: 'healthybowl-analytics',\n label: t('healthybowl.nav.analytics', 'Analytics'),\n path: joinPath(basePath, 'analytics'),\n icon: <BarChart3 size={20} />,\n order: 42,\n group: 'support',\n },\n\n // My Advisors (UC-16 — farmer side)\n {\n id: 'healthybowl-advisors',\n label: t('healthybowl.nav.advisors', 'My Advisors'),\n path: joinPath(basePath, 'advisors'),\n icon: <UserCheck size={20} />,\n order: 43,\n group: 'support',\n },\n\n // Consultant portfolio (UC-16 — consultant side)\n {\n id: 'healthybowl-consultant',\n label: t('healthybowl.nav.consultant', 'Consultant'),\n path: joinPath(basePath, 'consultant'),\n icon: <Stethoscope size={20} />,\n order: 44,\n group: 'support',\n },\n ];\n\n // All sections are reachable. Marketplace (UC-08), Network (UC-12) and\n // Traceability (UC-11) render real read data + their real create flows\n // (createMarketplaceProduct / createCommunityPost / createTraceBatch); the\n // few genuinely-unbacked actions (checkout, booking, QR resolution) show\n // honest \"not available yet\" states in-page rather than hiding the section.\n const cleanup = registerNavItems(navItems);\n return cleanup;\n }, [registerNavItems, basePath]);\n\n // Register footer items\n useEffect(() => {\n if (!registerFooterItems) return;\n\n const footerItems = [\n {\n id: 'healthybowl-status',\n label: t('healthybowl.footer.ready', 'HealthyBowl Ready'),\n type: 'status' as const,\n order: 10,\n section: 'left' as const,\n },\n ];\n\n const cleanup = registerFooterItems(footerItems);\n return cleanup;\n }, [registerFooterItems]);\n\n return (\n <FeatureFlagProvider workspaceId={null} gateway=\"global\" defaultEnabled={true}>\n <HealthyBowlProvider {...props}>\n <ErrorBoundary>\n <ConfirmProvider>\n <OfflineSyncProvider>\n <HealthyBowlRoutes />\n </OfflineSyncProvider>\n </ConfirmProvider>\n </ErrorBoundary>\n </HealthyBowlProvider>\n </FeatureFlagProvider>\n );\n};\n"],"mappings":";;;;;;;;;;;;AAoDA,IAAa,KAA6C,MAAU;CAClE,IAAM,EAAE,qBAAkB,wBAAqB,cAAW,QAAQ,GAC5D,EAAE,GAAG,MAAc,GAAS,EAC5B,IAAI,GACP,GAAa,MAA6B;EACzC,IAAM,IAAQ,EAAU,EAAI;AAC5B,SAAO,MAAU,IAAM,IAAW;IAEpC,CAAC,EAAU,CACZ,EAGK,KAAY,GAAc,OACZ,EAAK,SAAS,IAAI,GAAG,EAAK,MAAM,GAAG,GAAG,GAAG,MACzC,EAAK,WAAW,IAAI,GAAG,IAAO,IAAI;AAoXtD,QA/WA,QAAgB;AACT,QAyVL,QADgB,EAtVY;GAE1B;IACE,IAAI;IACJ,OAAO,EAAE,6BAA6B,YAAY;IAIlD,MAAM,EAAkB,EAAS;IACjC,MAAM,kBAAC,GAAD,EAAM,MAAM,IAAM,CAAA;IACxB,OAAO;IACP,OAAO;IACR;GAGD;IACE,IAAI;IACJ,OAAO,EAAE,wBAAwB,UAAU;IAC3C,MAAM,EAAS,GAAU,OAAO;IAChC,MAAM,kBAAC,GAAD,EAAS,MAAM,IAAM,CAAA;IAC3B,OAAO;IACP,OAAO;IACR;GAGD;IACE,IAAI;IACJ,OAAO,EAAE,yBAAyB,QAAQ;IAC1C,MAAM,EAAS,GAAU,QAAQ;IACjC,MAAM,kBAAC,GAAD,EAAY,MAAM,IAAM,CAAA;IAC9B,OAAO;IACP,OAAO;IACR;GAGD;IACE,IAAI;IACJ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OyC;IAEzC,CAAC,GAAkB,EAAS,CAAC,EAGhC,QAAgB;AACT,QAaL,QADgB,EAVI,CAClB;GACE,IAAI;GACJ,OAAO,EAAE,4BAA4B,oBAAoB;GACzD,MAAM;GACN,OAAO;GACP,SAAS;GACV,CACF,CAE+C;IAE/C,CAAC,EAAoB,CAAC,EAGvB,kBAAC,GAAD;EAAqB,aAAa;EAAM,SAAQ;EAAS,gBAAgB;YACvE,kBAAC,GAAD;GAAqB,GAAI;aACvB,kBAAC,GAAD,EAAA,UACE,kBAAC,GAAD,EAAA,UACE,kBAAC,GAAD,EAAA,UACE,kBAAC,GAAD,EAAqB,CAAA,EACD,CAAA,EACN,CAAA,EACJ,CAAA;GACI,CAAA;EACF,CAAA"}
1
+ {"version":3,"file":"HealthyBowlRoot.js","names":[],"sources":["../../src/healthybowl/HealthyBowlRoot.tsx"],"sourcesContent":["/**\n * HealthyBowl Root Component\n * @module healthybowl\n */\n\nimport type { FC } from 'react';\nimport { useCallback, useEffect } from 'react';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\nimport {\n Home,\n Tractor,\n ListChecks,\n Wheat,\n PawPrint,\n Cloud,\n Map as MapIcon,\n ShoppingCart,\n DollarSign,\n BarChart3,\n FlaskConical,\n Bug,\n ScanSearch,\n Factory,\n Package,\n ScanLine,\n ShieldCheck,\n Landmark,\n Banknote,\n Stethoscope,\n UserCheck,\n Users,\n CloudUpload,\n RefreshCw,\n ShieldAlert,\n LineChart,\n Fence,\n Radio,\n Leaf,\n Sprout,\n Award,\n Globe,\n Users2,\n} from 'lucide-react';\nimport { HealthyBowlProvider } from './context/HealthyBowlContext';\nimport { FeatureFlagProvider } from '@burdenoff/fe-libs/shared/feature-flags';\nimport { HealthyBowlRoutes } from './HealthyBowlRoutes';\nimport { ErrorBoundary } from './components/ErrorBoundary';\nimport { ConfirmProvider } from './components/ConfirmDialog';\nimport { OfflineSyncProvider } from './offline/OfflineSyncProvider';\nimport { normalizeBasePath, setHbFormatLocale } from './utils/helpers';\nimport type { HealthyBowlRootProps, NavItem } from './types';\n\nexport const HealthyBowlRoot: FC<HealthyBowlRootProps> = (props) => {\n const { registerNavItems, registerFooterItems, basePath = '/' } = props;\n const { t: translate, locale } = useI18n();\n\n // HealthyBowl's Intl.* formatters (utils/helpers.ts) are plain functions used\n // across ~490 call sites, so they can't call useI18n() themselves. Sync the\n // shell's active language into their ambient locale here — the product's\n // single I18n consumer that wraps every page — so number / currency / date\n // grouping tracks the chosen language (BOFF-6202). Done during render, not in\n // an effect, so children rendered in this same pass already format with the\n // current locale (no one-frame western-grouping flash on a language switch).\n setHbFormatLocale(locale);\n const t = useCallback(\n (key: string, fallback: string): string => {\n const value = translate(key);\n return value === key ? fallback : value;\n },\n [translate]\n );\n\n // Helper to join paths correctly\n const joinPath = (base: string, path: string): string => {\n const cleanBase = base.endsWith('/') ? base.slice(0, -1) : base;\n const cleanPath = path.startsWith('/') ? path : `/${path}`;\n return cleanBase + cleanPath;\n };\n\n // Register navigation items with shell on mount\n useEffect(() => {\n if (!registerNavItems) return;\n\n const navItems: NavItem[] = [\n // Dashboard\n {\n id: 'healthybowl-dashboard',\n label: t('healthybowl.nav.dashboard', 'Dashboard'),\n // The product index IS the dashboard. Normalize a trailing slash like\n // every sibling item (joinPath) so active-state highlighting matches if\n // the host ever passes '/healthybowl/'.\n path: normalizeBasePath(basePath),\n icon: <Home size={20} />,\n order: 1,\n group: 'main',\n },\n\n // My Farm\n {\n id: 'healthybowl-farm',\n label: t('healthybowl.nav.farm', 'My Farm'),\n path: joinPath(basePath, 'farm'),\n icon: <Tractor size={20} />,\n order: 2,\n group: 'main',\n },\n\n // Farm Tasks (PlanMagnet embed) — shared work-item board across the farm.\n {\n id: 'healthybowl-tasks',\n label: t('healthybowl.nav.tasks', 'Tasks'),\n path: joinPath(basePath, 'tasks'),\n icon: <ListChecks size={20} />,\n order: 3,\n group: 'main',\n },\n\n // Crops\n {\n id: 'healthybowl-crops',\n label: t('healthybowl.nav.crops', 'Crops'),\n path: joinPath(basePath, 'crops'),\n icon: <Wheat size={20} />,\n order: 10,\n group: 'farming',\n },\n\n // Livestock\n {\n id: 'healthybowl-livestock',\n label: t('healthybowl.nav.livestock', 'Livestock'),\n path: joinPath(basePath, 'livestock'),\n icon: <PawPrint size={20} />,\n order: 11,\n group: 'farming',\n },\n\n // Livestock — Analytics (BOFF-6126). The growth, feed and herd-stats charts (BOFF-5971) also\n // render inline on the livestock dashboard; this gives them a dedicated URL and full-width home.\n {\n id: 'healthybowl-livestock-analytics',\n label: t('healthybowl.nav.livestockAnalytics', 'Livestock Analytics'),\n path: joinPath(basePath, 'livestock/analytics'),\n icon: <LineChart size={20} />,\n order: 11.3,\n group: 'farming',\n },\n\n // Livestock — Grazing management (BOFF-5970). Sits next to Livestock rather than inside it\n // because rotational grazing is a daily decision about FIELDS, not a herd-record lookup.\n {\n id: 'healthybowl-grazing',\n label: t('healthybowl.nav.grazing', 'Grazing'),\n path: joinPath(basePath, 'livestock/grazing'),\n icon: <Fence size={20} />,\n order: 11.4,\n group: 'farming',\n },\n\n // Livestock — Medication Withdrawal Alerts (BOFF-2885)\n {\n id: 'healthybowl-withdrawal-alerts',\n label: t('healthybowl.nav.withdrawalAlerts', 'Withdrawal Alerts'),\n path: joinPath(basePath, 'livestock/withdrawal-alerts'),\n icon: <ShieldAlert size={20} />,\n order: 11.5,\n group: 'farming',\n },\n\n // Weather\n {\n id: 'healthybowl-weather',\n label: t('healthybowl.nav.weather', 'Weather'),\n path: joinPath(basePath, 'weather'),\n icon: <Cloud size={20} />,\n order: 12,\n group: 'farming',\n },\n\n // Field Map — draw & manage field boundaries on satellite imagery\n {\n id: 'healthybowl-field-map',\n label: t('healthybowl.nav.fieldMap', 'Field Map'),\n path: joinPath(basePath, 'field-map'),\n icon: <MapIcon size={20} />,\n order: 12.5,\n group: 'farming',\n },\n\n // Field Capture — offline-first observation capture (BOFF-2883)\n {\n id: 'healthybowl-field-capture',\n label: t('healthybowl.nav.fieldCapture', 'Field Capture'),\n path: joinPath(basePath, 'field-capture'),\n icon: <CloudUpload size={20} />,\n order: 12.6,\n group: 'farming',\n },\n\n // Pending Sync — the offline outbox / sync queue (BOFF-2883)\n {\n id: 'healthybowl-pending-sync',\n label: t('healthybowl.nav.pendingSync', 'Pending Sync'),\n path: joinPath(basePath, 'field-capture/pending'),\n icon: <RefreshCw size={20} />,\n order: 12.7,\n group: 'farming',\n },\n\n // Field Sensors — live probe monitoring (BOFF-2894)\n {\n id: 'healthybowl-field-sensors',\n label: t('healthybowl.nav.fieldSensors', 'Field Sensors'),\n path: joinPath(basePath, 'field-sensors'),\n icon: <Radio size={20} />,\n order: 12.75,\n group: 'farming',\n },\n\n // Soil Health\n {\n id: 'healthybowl-soil',\n label: t('healthybowl.nav.soilHealth', 'Soil Health'),\n path: joinPath(basePath, 'soil'),\n icon: <FlaskConical size={20} />,\n order: 13,\n group: 'farming',\n },\n\n // Pest Management\n {\n id: 'healthybowl-pest',\n label: t('healthybowl.nav.pestManagement', 'Pest Management'),\n path: joinPath(basePath, 'pest-management'),\n icon: <Bug size={20} />,\n order: 14,\n group: 'farming',\n },\n {\n id: 'healthybowl-pest-ai',\n label: t('healthybowl.nav.aiPestDetection', 'AI Pest Detection'),\n path: joinPath(basePath, 'pest-management/ai-detection'),\n icon: <ScanSearch size={20} />,\n order: 14.5,\n group: 'farming',\n },\n\n // Production\n {\n id: 'healthybowl-production',\n label: t('healthybowl.nav.production', 'Production'),\n path: joinPath(basePath, 'production'),\n icon: <Factory size={20} />,\n order: 20,\n group: 'business',\n },\n\n // Products\n {\n id: 'healthybowl-products',\n label: t('healthybowl.nav.products', 'Products'),\n path: joinPath(basePath, 'products'),\n icon: <Package size={20} />,\n order: 21,\n group: 'business',\n },\n\n // Marketplace\n {\n id: 'healthybowl-marketplace',\n label: t('healthybowl.nav.marketplace', 'Marketplace'),\n path: joinPath(basePath, 'marketplace'),\n icon: <ShoppingCart size={20} />,\n order: 22,\n group: 'business',\n },\n\n // Co-operative / FPO aggregation (BOFF-6023)\n {\n id: 'healthybowl-coop',\n label: t('healthybowl.nav.coop', 'Co-operative'),\n path: joinPath(basePath, 'coop'),\n icon: <Users2 size={20} />,\n order: 22.5,\n group: 'business',\n },\n\n // Financial\n {\n id: 'healthybowl-financial',\n label: t('healthybowl.nav.financial', 'Financial'),\n path: joinPath(basePath, 'financial'),\n icon: <DollarSign size={20} />,\n order: 23,\n group: 'business',\n },\n\n // Financier portfolio (B2B2C bridge)\n {\n id: 'healthybowl-financier',\n label: t('healthybowl.nav.financier', 'Financier'),\n path: joinPath(basePath, 'financier'),\n icon: <Banknote size={20} />,\n order: 24,\n group: 'business',\n },\n\n // Compliance\n {\n id: 'healthybowl-compliance',\n label: t('healthybowl.nav.compliance', 'Compliance'),\n path: joinPath(basePath, 'compliance'),\n icon: <ShieldCheck size={20} />,\n order: 30,\n group: 'compliance',\n },\n\n // Traceability\n {\n id: 'healthybowl-traceability',\n label: t('healthybowl.nav.traceability', 'Traceability'),\n path: joinPath(basePath, 'traceability'),\n icon: <ScanLine size={20} />,\n order: 31,\n group: 'compliance',\n },\n\n // Sustainability — Carbon & Climate (BOFF-2896)\n {\n id: 'healthybowl-sustainability',\n label: t('healthybowl.nav.sustainability', 'Sustainability'),\n path: joinPath(basePath, 'sustainability'),\n icon: <Leaf size={20} />,\n order: 32,\n group: 'compliance',\n },\n {\n id: 'healthybowl-sustainability-carbon',\n label: t('healthybowl.nav.sustainabilityCarbon', 'Carbon & GHG'),\n path: joinPath(basePath, 'sustainability/carbon'),\n icon: <Factory size={20} />,\n order: 32.1,\n group: 'compliance',\n },\n {\n id: 'healthybowl-sustainability-soil',\n label: t('healthybowl.nav.sustainabilitySoil', 'Soil Carbon'),\n path: joinPath(basePath, 'sustainability/soil-carbon'),\n icon: <Sprout size={20} />,\n order: 32.2,\n group: 'compliance',\n },\n {\n id: 'healthybowl-sustainability-credits',\n label: t('healthybowl.nav.sustainabilityCredits', 'Carbon Credits'),\n path: joinPath(basePath, 'sustainability/credits'),\n icon: <Award size={20} />,\n order: 32.3,\n group: 'compliance',\n },\n {\n id: 'healthybowl-sustainability-eudr',\n label: t('healthybowl.nav.sustainabilityEudr', 'EUDR Due-Diligence'),\n path: joinPath(basePath, 'sustainability/eudr'),\n icon: <Globe size={20} />,\n order: 32.4,\n group: 'compliance',\n },\n\n // Government Schemes\n {\n id: 'healthybowl-schemes',\n label: t('healthybowl.nav.governmentSchemes', 'Gov. Schemes'),\n path: joinPath(basePath, 'government-schemes'),\n icon: <Landmark size={20} />,\n order: 40,\n group: 'support',\n },\n\n // Network\n {\n id: 'healthybowl-network',\n label: t('healthybowl.nav.network', 'Network'),\n path: joinPath(basePath, 'network'),\n icon: <Users size={20} />,\n order: 41,\n group: 'support',\n },\n\n // Analytics\n {\n id: 'healthybowl-analytics',\n label: t('healthybowl.nav.analytics', 'Analytics'),\n path: joinPath(basePath, 'analytics'),\n icon: <BarChart3 size={20} />,\n order: 42,\n group: 'support',\n },\n\n // My Advisors (UC-16 — farmer side)\n {\n id: 'healthybowl-advisors',\n label: t('healthybowl.nav.advisors', 'My Advisors'),\n path: joinPath(basePath, 'advisors'),\n icon: <UserCheck size={20} />,\n order: 43,\n group: 'support',\n },\n\n // Consultant portfolio (UC-16 — consultant side)\n {\n id: 'healthybowl-consultant',\n label: t('healthybowl.nav.consultant', 'Consultant'),\n path: joinPath(basePath, 'consultant'),\n icon: <Stethoscope size={20} />,\n order: 44,\n group: 'support',\n },\n ];\n\n // All sections are reachable. Marketplace (UC-08), Network (UC-12) and\n // Traceability (UC-11) render real read data + their real create flows\n // (createMarketplaceProduct / createCommunityPost / createTraceBatch); the\n // few genuinely-unbacked actions (checkout, booking, QR resolution) show\n // honest \"not available yet\" states in-page rather than hiding the section.\n const cleanup = registerNavItems(navItems);\n return cleanup;\n }, [registerNavItems, basePath]);\n\n // Register footer items\n useEffect(() => {\n if (!registerFooterItems) return;\n\n const footerItems = [\n {\n id: 'healthybowl-status',\n label: t('healthybowl.footer.ready', 'HealthyBowl Ready'),\n type: 'status' as const,\n order: 10,\n section: 'left' as const,\n },\n ];\n\n const cleanup = registerFooterItems(footerItems);\n return cleanup;\n }, [registerFooterItems]);\n\n return (\n <FeatureFlagProvider workspaceId={null} gateway=\"global\" defaultEnabled={true}>\n <HealthyBowlProvider {...props}>\n <ErrorBoundary>\n <ConfirmProvider>\n <OfflineSyncProvider>\n <HealthyBowlRoutes />\n </OfflineSyncProvider>\n </ConfirmProvider>\n </ErrorBoundary>\n </HealthyBowlProvider>\n </FeatureFlagProvider>\n );\n};\n"],"mappings":";;;;;;;;;;;;AAoDA,IAAa,KAA6C,MAAU;CAClE,IAAM,EAAE,qBAAkB,wBAAqB,cAAW,QAAQ,GAC5D,EAAE,GAAG,GAAW,cAAW,GAAS;AAS1C,GAAkB,EAAO;CACzB,IAAM,IAAI,GACP,GAAa,MAA6B;EACzC,IAAM,IAAQ,EAAU,EAAI;AAC5B,SAAO,MAAU,IAAM,IAAW;IAEpC,CAAC,EAAU,CACZ,EAGK,KAAY,GAAc,OACZ,EAAK,SAAS,IAAI,GAAG,EAAK,MAAM,GAAG,GAAG,GAAG,MACzC,EAAK,WAAW,IAAI,GAAG,IAAO,IAAI;AAoXtD,QA/WA,QAAgB;AACT,QAyVL,QADgB,EAtVY;GAE1B;IACE,IAAI;IACJ,OAAO,EAAE,6BAA6B,YAAY;IAIlD,MAAM,EAAkB,EAAS;IACjC,MAAM,kBAAC,GAAD,EAAM,MAAM,IAAM,CAAA;IACxB,OAAO;IACP,OAAO;IACR;GAGD;IACE,IAAI;IACJ,OAAO,EAAE,wBAAwB,UAAU;IAC3C,MAAM,EAAS,GAAU,OAAO;IAChC,MAAM,kBAAC,GAAD,EAAS,MAAM,IAAM,CAAA;IAC3B,OAAO;IACP,OAAO;IACR;GAGD;IACE,IAAI;IACJ,OAAO,EAAE,yBAAyB,QAAQ;IAC1C,MAAM,EAAS,GAAU,QAAQ;IACjC,MAAM,kBAAC,GAAD,EAAY,MA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AAD,EAAa,MAAM,IAAM,CAAA;IAC/B,OAAO;IACP,OAAO;IACR;GACF,CAOyC;IAEzC,CAAC,GAAkB,EAAS,CAAC,EAGhC,QAAgB;AACT,QAaL,QADgB,EAVI,CAClB;GACE,IAAI;GACJ,OAAO,EAAE,4BAA4B,oBAAoB;GACzD,MAAM;GACN,OAAO;GACP,SAAS;GACV,CACF,CAE+C;IAE/C,CAAC,EAAoB,CAAC,EAGvB,kBAAC,GAAD;EAAqB,aAAa;EAAM,SAAQ;EAAS,gBAAgB;YACvE,kBAAC,GAAD;GAAqB,GAAI;aACvB,kBAAC,GAAD,EAAA,UACE,kBAAC,GAAD,EAAA,UACE,kBAAC,GAAD,EAAA,UACE,kBAAC,GAAD,EAAqB,CAAA,EACD,CAAA,EACN,CAAA,EACJ,CAAA;GACI,CAAA;EACF,CAAA"}
@@ -0,0 +1,46 @@
1
+ import { useI18n as e } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
2
+ import { Download as t } from "lucide-react";
3
+ import { jsx as n, jsxs as r } from "react/jsx-runtime";
4
+ //#region src/healthybowl/components/AnalyticsControls.tsx
5
+ var i = "min-h-[32px] rounded-md border border-border-subtle bg-bg-surface px-2 py-1 text-xs text-text-primary", a = ({ from: a, to: o, onFromChange: s, onToChange: c, onExportCsv: l, exportDisabled: u = !1, children: d }) => {
6
+ let { t: f } = e();
7
+ return /* @__PURE__ */ r("div", {
8
+ className: "flex flex-wrap items-center gap-1.5",
9
+ children: [
10
+ d,
11
+ /* @__PURE__ */ n("input", {
12
+ type: "date",
13
+ value: a,
14
+ max: o || void 0,
15
+ onChange: (e) => s(e.target.value),
16
+ "aria-label": f("healthybowl.livestock.analytics.fromDate", "From date"),
17
+ className: i
18
+ }),
19
+ /* @__PURE__ */ n("span", {
20
+ "aria-hidden": "true",
21
+ className: "text-xs text-text-secondary",
22
+ children: "–"
23
+ }),
24
+ /* @__PURE__ */ n("input", {
25
+ type: "date",
26
+ value: o,
27
+ min: a || void 0,
28
+ onChange: (e) => c(e.target.value),
29
+ "aria-label": f("healthybowl.livestock.analytics.toDate", "To date"),
30
+ className: i
31
+ }),
32
+ /* @__PURE__ */ r("button", {
33
+ type: "button",
34
+ onClick: l,
35
+ disabled: u,
36
+ "aria-label": f("healthybowl.livestock.analytics.exportCsv", "Export CSV"),
37
+ className: "flex min-h-[32px] items-center gap-1 rounded-md px-2 py-1 text-xs text-text-secondary transition-colors hover:bg-bg-sunken/50 disabled:cursor-not-allowed disabled:opacity-50",
38
+ children: [/* @__PURE__ */ n(t, { className: "h-3.5 w-3.5" }), f("healthybowl.livestock.analytics.csv", "CSV")]
39
+ })
40
+ ]
41
+ });
42
+ };
43
+ //#endregion
44
+ export { a as AnalyticsControls };
45
+
46
+ //# sourceMappingURL=AnalyticsControls.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AnalyticsControls.js","names":[],"sources":["../../../src/healthybowl/components/AnalyticsControls.tsx"],"sourcesContent":["/**\n * Shared header controls for the livestock analytics cards (BOFF-6124).\n *\n * Adds the two acceptance criteria BOFF-5971 shipped without — a from/to date-range\n * filter and a CSV export of the computed series — beside each card's existing\n * granularity toggle. Every card already plumbs `from`/`to` through its hook to a\n * backend that accepts them (`resolveWindow`); these are simply the missing controls\n * that bind to them, so a farmer is no longer hard-locked to the last 180 days.\n *\n * `aria-label`s (not `htmlFor`) are used deliberately: the three cards render this on\n * one screen, so element ids would collide.\n * @module healthybowl\n */\n\nimport { type FC, type ReactNode } from 'react';\nimport { Download } from 'lucide-react';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\n\ninterface AnalyticsControlsProps {\n /** ISO `yyyy-MM-dd` (empty string = unset → backend default window). */\n from: string;\n to: string;\n onFromChange: (value: string) => void;\n onToChange: (value: string) => void;\n onExportCsv: () => void;\n /** Disabled when there is no computed data to export. */\n exportDisabled?: boolean;\n /** The card's existing granularity toggle. */\n children?: ReactNode;\n}\n\nconst inputClass =\n 'min-h-[32px] rounded-md border border-border-subtle bg-bg-surface px-2 py-1 text-xs text-text-primary';\n\nexport const AnalyticsControls: FC<AnalyticsControlsProps> = ({\n from,\n to,\n onFromChange,\n onToChange,\n onExportCsv,\n exportDisabled = false,\n children,\n}) => {\n const { t } = useI18n();\n return (\n <div className=\"flex flex-wrap items-center gap-1.5\">\n {children}\n <input\n type=\"date\"\n value={from}\n max={to || undefined}\n onChange={(e) => onFromChange(e.target.value)}\n aria-label={t('healthybowl.livestock.analytics.fromDate', 'From date')}\n className={inputClass}\n />\n <span aria-hidden=\"true\" className=\"text-xs text-text-secondary\">\n –\n </span>\n <input\n type=\"date\"\n value={to}\n min={from || undefined}\n onChange={(e) => onToChange(e.target.value)}\n aria-label={t('healthybowl.livestock.analytics.toDate', 'To date')}\n className={inputClass}\n />\n <button\n type=\"button\"\n onClick={onExportCsv}\n disabled={exportDisabled}\n aria-label={t('healthybowl.livestock.analytics.exportCsv', 'Export CSV')}\n className=\"flex min-h-[32px] items-center gap-1 rounded-md px-2 py-1 text-xs text-text-secondary transition-colors hover:bg-bg-sunken/50 disabled:cursor-not-allowed disabled:opacity-50\"\n >\n <Download className=\"h-3.5 w-3.5\" />\n {t('healthybowl.livestock.analytics.csv', 'CSV')}\n </button>\n </div>\n );\n};\n"],"mappings":";;;;AA+BA,IAAM,IACJ,yGAEW,KAAiD,EAC5D,SACA,OACA,iBACA,eACA,gBACA,oBAAiB,IACjB,kBACI;CACJ,IAAM,EAAE,SAAM,GAAS;AACvB,QACE,kBAAC,OAAD;EAAK,WAAU;YAAf;GACG;GACD,kBAAC,SAAD;IACE,MAAK;IACL,OAAO;IACP,KAAK,KAAM,KAAA;IACX,WAAW,MAAM,EAAa,EAAE,OAAO,MAAM;IAC7C,cAAY,EAAE,4CAA4C,YAAY;IACtE,WAAW;IACX,CAAA;GACF,kBAAC,QAAD;IAAM,eAAY;IAAO,WAAU;cAA8B;IAE1D,CAAA;GACP,kBAAC,SAAD;IACE,MAAK;IACL,OAAO;IACP,KAAK,KAAQ,KAAA;IACb,WAAW,MAAM,EAAW,EAAE,OAAO,MAAM;IAC3C,cAAY,EAAE,0CAA0C,UAAU;IAClE,WAAW;IACX,CAAA;GACF,kBAAC,UAAD;IACE,MAAK;IACL,SAAS;IACT,UAAU;IACV,cAAY,EAAE,6CAA6C,aAAa;IACxE,WAAU;cALZ,CAOE,kBAAC,GAAD,EAAU,WAAU,eAAgB,CAAA,EACnC,EAAE,uCAAuC,MAAM,CACzC;;GACL"}
@@ -6,6 +6,7 @@ import "./EmptyState.js";
6
6
  import "./ErrorState.js";
7
7
  import "./ComingSoon.js";
8
8
  import "./ChartCard.js";
9
+ import "./AnalyticsControls.js";
9
10
  import "./FilterBar.js";
10
11
  import "./Toast.js";
11
12
  import "./ErrorBoundary.js";