@burdenoff/microfe-healthybowl 2026.903.4 → 2026.903.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/assistant/AssistantHeader.js +1 -1
- package/dist/components/assistant/AssistantHeader.js.map +1 -1
- package/dist/healthybowl/HealthyBowlRoot.js +57 -56
- package/dist/healthybowl/HealthyBowlRoot.js.map +1 -1
- package/dist/healthybowl/HealthyBowlRoutes.js +48 -36
- package/dist/healthybowl/HealthyBowlRoutes.js.map +1 -1
- package/dist/healthybowl/components/CreateFarmTaskButton.js.map +1 -1
- package/dist/healthybowl/components/PageLayout.js +11 -10
- package/dist/healthybowl/components/PageLayout.js.map +1 -1
- package/dist/healthybowl/context/HealthyBowlContext.js +7 -7
- package/dist/healthybowl/context/HealthyBowlContext.js.map +1 -1
- package/dist/healthybowl/hooks/useAgronomyDecisions.js +79 -0
- package/dist/healthybowl/hooks/useAgronomyDecisions.js.map +1 -0
- package/dist/healthybowl/hooks/useAnalyticsReports.js +173 -0
- package/dist/healthybowl/hooks/useAnalyticsReports.js.map +1 -0
- package/dist/healthybowl/hooks/useComplianceExports.js +74 -0
- package/dist/healthybowl/hooks/useComplianceExports.js.map +1 -0
- package/dist/healthybowl/hooks/useConsultationPayments.js +59 -0
- package/dist/healthybowl/hooks/useConsultationPayments.js.map +1 -0
- package/dist/healthybowl/hooks/useHealthyBowlCompliance.js +157 -141
- package/dist/healthybowl/hooks/useHealthyBowlCompliance.js.map +1 -1
- package/dist/healthybowl/hooks/useHealthyBowlData.js +18 -0
- package/dist/healthybowl/hooks/useHealthyBowlData.js.map +1 -1
- package/dist/healthybowl/hooks/useHealthyBowlDistribution.js +52 -37
- package/dist/healthybowl/hooks/useHealthyBowlDistribution.js.map +1 -1
- package/dist/healthybowl/hooks/useHealthyBowlLivestockDepth.js +135 -78
- package/dist/healthybowl/hooks/useHealthyBowlLivestockDepth.js.map +1 -1
- package/dist/healthybowl/hooks/useIrrigationAutomation.js +1 -1
- package/dist/healthybowl/hooks/useIrrigationAutomation.js.map +1 -1
- package/dist/healthybowl/hooks/usePlantingEstimate.js +88 -0
- package/dist/healthybowl/hooks/usePlantingEstimate.js.map +1 -0
- package/dist/healthybowl/hooks/useSuccessionPlanning.js +1 -1
- package/dist/healthybowl/hooks/useSuccessionPlanning.js.map +1 -1
- package/dist/healthybowl/hooks/useWeatherIntelligence.js +1 -1
- package/dist/healthybowl/hooks/useWeatherIntelligence.js.map +1 -1
- package/dist/healthybowl/offline/HeaderOfflinePill.js +28 -0
- package/dist/healthybowl/offline/HeaderOfflinePill.js.map +1 -0
- package/dist/healthybowl/offline/OfflineStatusPill.js +40 -21
- package/dist/healthybowl/offline/OfflineStatusPill.js.map +1 -1
- package/dist/healthybowl/offline/OfflineSyncProvider.js +153 -130
- package/dist/healthybowl/offline/OfflineSyncProvider.js.map +1 -1
- package/dist/healthybowl/offline/captureCache.js +30 -0
- package/dist/healthybowl/offline/captureCache.js.map +1 -0
- package/dist/healthybowl/offline/graphql.js.map +1 -1
- package/dist/healthybowl/offline/headerSlot.js +24 -0
- package/dist/healthybowl/offline/headerSlot.js.map +1 -0
- package/dist/healthybowl/offline/store.js +1 -1
- package/dist/healthybowl/offline/syncEngine.js +2 -1
- package/dist/healthybowl/offline/syncEngine.js.map +1 -1
- package/dist/healthybowl/offline/types.js.map +1 -1
- package/dist/healthybowl/pages/GettingStartedPage.js +1 -0
- package/dist/healthybowl/pages/GettingStartedPage.js.map +1 -1
- package/dist/healthybowl/pages/ai/AiDecisionsPage.js +287 -0
- package/dist/healthybowl/pages/ai/AiDecisionsPage.js.map +1 -0
- package/dist/healthybowl/pages/analytics/InsightsPage.js +2 -2
- package/dist/healthybowl/pages/analytics/InsightsPage.js.map +1 -1
- package/dist/healthybowl/pages/analytics/ReportsPage.js +136 -99
- package/dist/healthybowl/pages/analytics/ReportsPage.js.map +1 -1
- package/dist/healthybowl/pages/compliance/ComplianceOverviewPage.js +204 -162
- package/dist/healthybowl/pages/compliance/ComplianceOverviewPage.js.map +1 -1
- package/dist/healthybowl/pages/compliance/IcsGroupDetailPage.js +196 -178
- package/dist/healthybowl/pages/compliance/IcsGroupDetailPage.js.map +1 -1
- package/dist/healthybowl/pages/compliance/IcsGrowerDetailPage.js +142 -141
- package/dist/healthybowl/pages/compliance/IcsGrowerDetailPage.js.map +1 -1
- package/dist/healthybowl/pages/compliance/ResidueTestsPage.js +291 -0
- package/dist/healthybowl/pages/compliance/ResidueTestsPage.js.map +1 -0
- package/dist/healthybowl/pages/compliance/SubstanceRulesPage.js +300 -0
- package/dist/healthybowl/pages/compliance/SubstanceRulesPage.js.map +1 -0
- package/dist/healthybowl/pages/compliance/substanceRuleForm.js +135 -0
- package/dist/healthybowl/pages/compliance/substanceRuleForm.js.map +1 -0
- package/dist/healthybowl/pages/crops/CropFieldsPage.js +2 -0
- package/dist/healthybowl/pages/crops/CropFieldsPage.js.map +1 -1
- package/dist/healthybowl/pages/crops/CropHarvestPage.js +316 -272
- package/dist/healthybowl/pages/crops/CropHarvestPage.js.map +1 -1
- package/dist/healthybowl/pages/crops/CropPlanningPage.js +6 -0
- package/dist/healthybowl/pages/crops/CropPlanningPage.js.map +1 -1
- package/dist/healthybowl/pages/crops/FieldDetailsPage.js +871 -846
- package/dist/healthybowl/pages/crops/FieldDetailsPage.js.map +1 -1
- package/dist/healthybowl/pages/crops/HarvestDetailsPage.js +376 -334
- package/dist/healthybowl/pages/crops/HarvestDetailsPage.js.map +1 -1
- package/dist/healthybowl/pages/distribution/CsaPlanDetailPage.js +415 -188
- package/dist/healthybowl/pages/distribution/CsaPlanDetailPage.js.map +1 -1
- package/dist/healthybowl/pages/distribution/labels.js +10 -2
- package/dist/healthybowl/pages/distribution/labels.js.map +1 -1
- package/dist/healthybowl/pages/farm/FarmProfilePage.js +1 -0
- package/dist/healthybowl/pages/farm/FarmProfilePage.js.map +1 -1
- package/dist/healthybowl/pages/field-capture/CaptureObservationForm.js +8 -8
- package/dist/healthybowl/pages/fields/FieldMapPage.js +2 -0
- package/dist/healthybowl/pages/fields/FieldMapPage.js.map +1 -1
- package/dist/healthybowl/pages/financial/FinancialReportsPage.js +92 -107
- package/dist/healthybowl/pages/financial/FinancialReportsPage.js.map +1 -1
- package/dist/healthybowl/pages/government-schemes/ApplicationTrackingPage.js +228 -188
- package/dist/healthybowl/pages/government-schemes/ApplicationTrackingPage.js.map +1 -1
- package/dist/healthybowl/pages/government-schemes/SchemeDetailsPage.js +261 -191
- package/dist/healthybowl/pages/government-schemes/SchemeDetailsPage.js.map +1 -1
- package/dist/healthybowl/pages/government-schemes/schemeApplicationTransitions.js +49 -0
- package/dist/healthybowl/pages/government-schemes/schemeApplicationTransitions.js.map +1 -0
- package/dist/healthybowl/pages/government-schemes/schemeDocumentSlots.js +48 -0
- package/dist/healthybowl/pages/government-schemes/schemeDocumentSlots.js.map +1 -0
- package/dist/healthybowl/pages/government-schemes/useSchemeApplicationTransition.js +54 -0
- package/dist/healthybowl/pages/government-schemes/useSchemeApplicationTransition.js.map +1 -0
- package/dist/healthybowl/pages/inputs-insurance/InputsInsuranceOverviewPage.js +14 -14
- package/dist/healthybowl/pages/inputs-insurance/InputsInsuranceOverviewPage.js.map +1 -1
- package/dist/healthybowl/pages/irrigation/IrrigationPage.js +338 -307
- package/dist/healthybowl/pages/irrigation/IrrigationPage.js.map +1 -1
- package/dist/healthybowl/pages/livestock/AnimalDepthFormModal.js +126 -102
- package/dist/healthybowl/pages/livestock/AnimalDepthFormModal.js.map +1 -1
- package/dist/healthybowl/pages/livestock/AnimalDepthPage.js +257 -215
- package/dist/healthybowl/pages/livestock/AnimalDepthPage.js.map +1 -1
- package/dist/healthybowl/pages/livestock/GrazingPage.js +1 -0
- package/dist/healthybowl/pages/livestock/GrazingPage.js.map +1 -1
- package/dist/healthybowl/pages/livestock/HerdDepthPage.js +4 -0
- package/dist/healthybowl/pages/livestock/HerdDepthPage.js.map +1 -1
- package/dist/healthybowl/pages/livestock/PedigreeTree.js +154 -0
- package/dist/healthybowl/pages/livestock/PedigreeTree.js.map +1 -0
- package/dist/healthybowl/pages/livestock/eidTagInput.js +39 -0
- package/dist/healthybowl/pages/livestock/eidTagInput.js.map +1 -0
- package/dist/healthybowl/pages/livestock/grazing/RecordGrazingMoveModal.js +8 -9
- package/dist/healthybowl/pages/livestock/grazing/RecordGrazingMoveModal.js.map +1 -1
- package/dist/healthybowl/pages/livestock/pedigreeLayout.js +68 -0
- package/dist/healthybowl/pages/livestock/pedigreeLayout.js.map +1 -0
- package/dist/healthybowl/pages/network/ExpertsPage.js +520 -419
- package/dist/healthybowl/pages/network/ExpertsPage.js.map +1 -1
- package/dist/healthybowl/pages/weather/WeatherAlertHistoryPage.js +129 -130
- package/dist/healthybowl/pages/weather/WeatherAlertHistoryPage.js.map +1 -1
- package/dist/healthybowl/pages/weather/WeatherSettingsPage.js +285 -237
- package/dist/healthybowl/pages/weather/WeatherSettingsPage.js.map +1 -1
- package/dist/healthybowl/pages/weather/alertDelivery.js +105 -0
- package/dist/healthybowl/pages/weather/alertDelivery.js.map +1 -0
- package/dist/healthybowl/utils/icsInspection.js +18 -0
- package/dist/healthybowl/utils/icsInspection.js.map +1 -0
- package/dist/healthybowl/utils/plantingCapacity.js +10 -10
- package/dist/healthybowl/utils/plantingCapacity.js.map +1 -1
- package/dist/utils/pageContext.js +15 -1
- package/dist/utils/pageContext.js.map +1 -1
- package/package.json +3 -2
|
@@ -53,7 +53,7 @@ var u = ({ contextLabel: u, onNewConversation: d, onOpenHistory: f, historyOpen:
|
|
|
53
53
|
g && /* @__PURE__ */ c("button", {
|
|
54
54
|
type: "button",
|
|
55
55
|
onClick: g,
|
|
56
|
-
className: "hidden rounded-lg p-1.5 text-text-secondary transition-colors hover:bg-bg-sunken hover:text-text-primary
|
|
56
|
+
className: "hidden rounded-lg p-1.5 text-text-secondary transition-colors hover:bg-bg-sunken hover:text-text-primary sm:inline-flex",
|
|
57
57
|
"aria-label": h ? _("healthybowl.assistant.header.float", "Float chat window") : _("healthybowl.assistant.header.dock", "Dock to side panel"),
|
|
58
58
|
"aria-pressed": h,
|
|
59
59
|
"data-testid": "assistant-toggle-dock",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AssistantHeader.js","names":[],"sources":["../../../src/components/assistant/AssistantHeader.tsx"],"sourcesContent":["import type { FC } from 'react';\nimport { Sparkles, Plus, History, PanelRight, PanelBottom, X } from 'lucide-react';\nimport { AssistantMoreMenu } from './AssistantMoreMenu';\nimport { useTr } from '../../shared/hooks/useTr';\n\ninterface Props {\n /** Friendly label for the page the user is on (e.g. \"Inventory\"). */\n contextLabel: string;\n onNewConversation: () => void;\n onOpenHistory: () => void;\n /** True when the history drawer is currently open (drives the toggle state). */\n historyOpen: boolean;\n onClose: () => void;\n docked?: boolean;\n onToggleDock?: () => void;\n}\n\n/**\n * AssistantHeader — the v2 identity bar (per the ai-assistant-v2 mockups):\n * a ✦ brand mark + \"HealthyBowl AI\", a small availability/context subtitle\n * (\"Ready · Context: <page>\"), and a row of icon actions: New conversation,\n * History (opens the conversation list as an overlay drawer — NOT an accordion),\n * Export, Dock toggle, Close.\n *\n * Replaces the old \"Conversation History\" accordion header. HB semantic tokens\n * only; copy via useTr.\n */\nexport const AssistantHeader: FC<Props> = ({\n contextLabel,\n onNewConversation,\n onOpenHistory,\n historyOpen,\n onClose,\n docked,\n onToggleDock,\n}) => {\n const tr = useTr();\n\n return (\n <div className=\"flex items-center gap-2 border-b border-border-default bg-bg-elevated px-3 py-2.5\">\n {/* Brand + context subtitle */}\n <div className=\"flex min-w-0 flex-1 items-center gap-2\">\n <span className=\"flex size-7 flex-shrink-0 items-center justify-center rounded-lg bg-gradient-to-br from-action-primary-bg/25 to-action-primary-bg/5 text-action-primary-bg\">\n <Sparkles className=\"size-4\" />\n </span>\n <span className=\"min-w-0 flex-1\">\n <span className=\"block truncate text-[14px] font-semibold leading-tight text-text-primary\">\n {tr('healthybowl.assistant.header.title', 'HealthyBowl AI')}\n </span>\n <span className=\"block truncate text-[11px] leading-tight text-text-muted\">\n {tr('healthybowl.assistant.header.ready', 'Ready')}\n <span aria-hidden=\"true\"> · </span>\n {tr('healthybowl.assistant.header.context', 'Context: {{page}}', { page: contextLabel })}\n </span>\n </span>\n </div>\n\n {/* Actions */}\n <div className=\"flex flex-shrink-0 items-center gap-0.5\">\n <button\n type=\"button\"\n onClick={onNewConversation}\n className=\"rounded-lg p-1.5 text-text-secondary transition-colors hover:bg-bg-sunken hover:text-text-primary\"\n aria-label={tr('healthybowl.assistant.header.newConversation', 'New conversation')}\n data-testid=\"assistant-new-conversation\"\n >\n <Plus className=\"size-4\" />\n </button>\n <button\n type=\"button\"\n onClick={onOpenHistory}\n className={`rounded-lg p-1.5 transition-colors ${\n historyOpen\n ? 'bg-action-primary-bg/15 text-action-primary-bg'\n : 'text-text-secondary hover:bg-bg-sunken hover:text-text-primary'\n }`}\n aria-label={tr('healthybowl.assistant.header.history', 'Conversation history')}\n aria-pressed={historyOpen}\n data-testid=\"assistant-open-history\"\n >\n <History className=\"size-4\" />\n </button>\n {/* Renders nothing where the browser has no speech output. */}\n <AssistantMoreMenu />\n {onToggleDock && (\n <button\n type=\"button\"\n onClick={onToggleDock}\n className=\"hidden rounded-lg p-1.5 text-text-secondary transition-colors hover:bg-bg-sunken hover:text-text-primary
|
|
1
|
+
{"version":3,"file":"AssistantHeader.js","names":[],"sources":["../../../src/components/assistant/AssistantHeader.tsx"],"sourcesContent":["import type { FC } from 'react';\nimport { Sparkles, Plus, History, PanelRight, PanelBottom, X } from 'lucide-react';\nimport { AssistantMoreMenu } from './AssistantMoreMenu';\nimport { useTr } from '../../shared/hooks/useTr';\n\ninterface Props {\n /** Friendly label for the page the user is on (e.g. \"Inventory\"). */\n contextLabel: string;\n onNewConversation: () => void;\n onOpenHistory: () => void;\n /** True when the history drawer is currently open (drives the toggle state). */\n historyOpen: boolean;\n onClose: () => void;\n docked?: boolean;\n onToggleDock?: () => void;\n}\n\n/**\n * AssistantHeader — the v2 identity bar (per the ai-assistant-v2 mockups):\n * a ✦ brand mark + \"HealthyBowl AI\", a small availability/context subtitle\n * (\"Ready · Context: <page>\"), and a row of icon actions: New conversation,\n * History (opens the conversation list as an overlay drawer — NOT an accordion),\n * Export, Dock toggle, Close.\n *\n * Replaces the old \"Conversation History\" accordion header. HB semantic tokens\n * only; copy via useTr.\n */\nexport const AssistantHeader: FC<Props> = ({\n contextLabel,\n onNewConversation,\n onOpenHistory,\n historyOpen,\n onClose,\n docked,\n onToggleDock,\n}) => {\n const tr = useTr();\n\n return (\n <div className=\"flex items-center gap-2 border-b border-border-default bg-bg-elevated px-3 py-2.5\">\n {/* Brand + context subtitle */}\n <div className=\"flex min-w-0 flex-1 items-center gap-2\">\n <span className=\"flex size-7 flex-shrink-0 items-center justify-center rounded-lg bg-gradient-to-br from-action-primary-bg/25 to-action-primary-bg/5 text-action-primary-bg\">\n <Sparkles className=\"size-4\" />\n </span>\n <span className=\"min-w-0 flex-1\">\n <span className=\"block truncate text-[14px] font-semibold leading-tight text-text-primary\">\n {tr('healthybowl.assistant.header.title', 'HealthyBowl AI')}\n </span>\n <span className=\"block truncate text-[11px] leading-tight text-text-muted\">\n {tr('healthybowl.assistant.header.ready', 'Ready')}\n <span aria-hidden=\"true\"> · </span>\n {tr('healthybowl.assistant.header.context', 'Context: {{page}}', { page: contextLabel })}\n </span>\n </span>\n </div>\n\n {/* Actions */}\n <div className=\"flex flex-shrink-0 items-center gap-0.5\">\n <button\n type=\"button\"\n onClick={onNewConversation}\n className=\"rounded-lg p-1.5 text-text-secondary transition-colors hover:bg-bg-sunken hover:text-text-primary\"\n aria-label={tr('healthybowl.assistant.header.newConversation', 'New conversation')}\n data-testid=\"assistant-new-conversation\"\n >\n <Plus className=\"size-4\" />\n </button>\n <button\n type=\"button\"\n onClick={onOpenHistory}\n className={`rounded-lg p-1.5 transition-colors ${\n historyOpen\n ? 'bg-action-primary-bg/15 text-action-primary-bg'\n : 'text-text-secondary hover:bg-bg-sunken hover:text-text-primary'\n }`}\n aria-label={tr('healthybowl.assistant.header.history', 'Conversation history')}\n aria-pressed={historyOpen}\n data-testid=\"assistant-open-history\"\n >\n <History className=\"size-4\" />\n </button>\n {/* Renders nothing where the browser has no speech output. */}\n <AssistantMoreMenu />\n {onToggleDock && (\n <button\n type=\"button\"\n onClick={onToggleDock}\n // ★ `sm:`, matching where the DESKTOP LAYOUT actually starts. It was `md:`\n // while the overlay switches layouts at `sm`, so between 640px and\n // 767px the user got the desktop floating/docked window with no dock\n // control at all — and anyone whose preference was already \"docked\"\n // was stuck in the side panel with no way back.\n className=\"hidden rounded-lg p-1.5 text-text-secondary transition-colors hover:bg-bg-sunken hover:text-text-primary sm:inline-flex\"\n aria-label={\n docked\n ? tr('healthybowl.assistant.header.float', 'Float chat window')\n : tr('healthybowl.assistant.header.dock', 'Dock to side panel')\n }\n aria-pressed={docked}\n data-testid=\"assistant-toggle-dock\"\n >\n {docked ? <PanelBottom className=\"size-4\" /> : <PanelRight className=\"size-4\" />}\n </button>\n )}\n <button\n type=\"button\"\n onClick={onClose}\n className=\"rounded-lg p-1.5 text-text-secondary transition-colors hover:bg-bg-sunken hover:text-text-primary\"\n aria-label={tr('healthybowl.assistant.header.close', 'Close assistant')}\n data-testid=\"assistant-close\"\n >\n <X className=\"size-4\" />\n </button>\n </div>\n </div>\n );\n};\n"],"mappings":";;;;;AA2BA,IAAa,KAA8B,EACzC,iBACA,sBACA,kBACA,gBACA,YACA,WACA,sBACI;CACJ,IAAM,IAAK,EAAM;CAEjB,OACE,kBAAC,OAAD;EAAK,WAAU;YAAf,CAEE,kBAAC,OAAD;GAAK,WAAU;aAAf,CACE,kBAAC,QAAD;IAAM,WAAU;cACd,kBAAC,GAAD,EAAU,WAAU,SAAU,CAAA;GAC1B,CAAA,GACN,kBAAC,QAAD;IAAM,WAAU;cAAhB,CACE,kBAAC,QAAD;KAAM,WAAU;eACb,EAAG,sCAAsC,gBAAgB;IACtD,CAAA,GACN,kBAAC,QAAD;KAAM,WAAU;eAAhB;MACG,EAAG,sCAAsC,OAAO;MACjD,kBAAC,QAAD;OAAM,eAAY;iBAAO;MAAS,CAAA;MACjC,EAAG,wCAAwC,qBAAqB,EAAE,MAAM,EAAa,CAAC;KACnF;MACF;KACH;MAGL,kBAAC,OAAD;GAAK,WAAU;aAAf;IACE,kBAAC,UAAD;KACE,MAAK;KACL,SAAS;KACT,WAAU;KACV,cAAY,EAAG,gDAAgD,kBAAkB;KACjF,eAAY;eAEZ,kBAAC,GAAD,EAAM,WAAU,SAAU,CAAA;IACpB,CAAA;IACR,kBAAC,UAAD;KACE,MAAK;KACL,SAAS;KACT,WAAW,sCACT,IACI,mDACA;KAEN,cAAY,EAAG,wCAAwC,sBAAsB;KAC7E,gBAAc;KACd,eAAY;eAEZ,kBAAC,GAAD,EAAS,WAAU,SAAU,CAAA;IACvB,CAAA;IAER,kBAAC,GAAD,CAAoB,CAAA;IACnB,KACC,kBAAC,UAAD;KACE,MAAK;KACL,SAAS;KAMT,WAAU;KACV,cACE,IACI,EAAG,sCAAsC,mBAAmB,IAC5D,EAAG,qCAAqC,oBAAoB;KAElE,gBAAc;KACd,eAAY;eAEF,EAAT,IAAU,IAAqC,GAAtC,EAAa,WAAU,SAAU,CAAoC;IACzE,CAAA;IAEV,kBAAC,UAAD;KACE,MAAK;KACL,SAAS;KACT,WAAU;KACV,cAAY,EAAG,sCAAsC,iBAAiB;KACtE,eAAY;eAEZ,kBAAC,GAAD,EAAG,WAAU,SAAU,CAAA;IACjB,CAAA;GACL;IACF;;AAET"}
|
|
@@ -4,14 +4,15 @@ import { normalizeBasePath as r, setHbFormatLocale as i } from "./utils/helpers.
|
|
|
4
4
|
import { ErrorBoundary as a } from "./components/ErrorBoundary.js";
|
|
5
5
|
import { ConfirmProvider as o } from "./components/ConfirmDialog.js";
|
|
6
6
|
import { HealthyBowlRoutes as s } from "./HealthyBowlRoutes.js";
|
|
7
|
-
import { OfflineSyncProvider as
|
|
8
|
-
import {
|
|
7
|
+
import { OfflineSyncProvider as c } from "./offline/OfflineSyncProvider.js";
|
|
8
|
+
import { HeaderOfflinePill as te } from "./offline/HeaderOfflinePill.js";
|
|
9
|
+
import { useCallback as ne, useEffect as l } from "react";
|
|
9
10
|
import { useI18n as re } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
10
|
-
import { Award as ie, Banknote as ae, BarChart3 as oe, Bug as se, Cloud as
|
|
11
|
-
import { jsx as
|
|
12
|
-
import { FeatureFlagProvider as
|
|
11
|
+
import { Award as ie, Banknote as ae, BarChart3 as oe, Bug as se, Cloud as u, CloudUpload as d, DollarSign as f, Factory as p, Fence as m, FlaskConical as h, Globe as g, HardHat as _, Home as v, Landmark as y, Leaf as b, LineChart as x, ListChecks as S, Map as C, Package as w, PawPrint as T, Radio as E, RefreshCw as D, ScanLine as O, ScanSearch as k, ShieldAlert as A, ShieldCheck as j, ShoppingCart as M, Sprout as N, Stethoscope as ce, Tractor as P, UserCheck as F, Users as I, Users2 as L, Wheat as R } from "lucide-react";
|
|
12
|
+
import { jsx as z, jsxs as B } from "react/jsx-runtime";
|
|
13
|
+
import { FeatureFlagProvider as V, useFeatureFlags as H } from "@burdenoff/fe-libs/shared/feature-flags";
|
|
13
14
|
//#region src/healthybowl/HealthyBowlRoot.tsx
|
|
14
|
-
var
|
|
15
|
+
var U = /* @__PURE__ */ new Set([]), W = [
|
|
15
16
|
".lucide-arrow-right",
|
|
16
17
|
".lucide-arrow-left",
|
|
17
18
|
".lucide-chevron-right",
|
|
@@ -20,21 +21,21 @@ var H = /* @__PURE__ */ new Set([]), U = [
|
|
|
20
21
|
".lucide-chevrons-left",
|
|
21
22
|
".lucide-move-right",
|
|
22
23
|
".lucide-move-left"
|
|
23
|
-
].map((e) => `[dir="rtl"] ${e}`).join(",").concat("{transform:scaleX(-1)}"),
|
|
24
|
+
].map((e) => `[dir="rtl"] ${e}`).join(",").concat("{transform:scaleX(-1)}"), G = new Set([
|
|
24
25
|
"healthybowl-sustainability",
|
|
25
26
|
"healthybowl-sustainability-carbon",
|
|
26
27
|
"healthybowl-sustainability-soil",
|
|
27
28
|
"healthybowl-sustainability-credits",
|
|
28
29
|
"healthybowl-sustainability-eudr"
|
|
29
30
|
]);
|
|
30
|
-
function
|
|
31
|
-
return t ? e : e.filter((e) => !
|
|
31
|
+
function le(e, t) {
|
|
32
|
+
return t ? e : e.filter((e) => !G.has(e.id));
|
|
32
33
|
}
|
|
33
34
|
var K = (n) => {
|
|
34
|
-
let { registerNavItems:
|
|
35
|
+
let { registerNavItems: V, registerFooterItems: G, basePath: K = "/" } = n, { error: q, getEvaluation: ue, isLoading: de } = H(), J = ee(ue(t), de || q !== null), { t: Y, locale: X } = re();
|
|
35
36
|
i(X);
|
|
36
|
-
let Z =
|
|
37
|
-
|
|
37
|
+
let Z = U.has(X) ? "rtl" : "ltr";
|
|
38
|
+
l(() => {
|
|
38
39
|
let e = document.documentElement, t = e.getAttribute("dir");
|
|
39
40
|
return e.setAttribute("dir", Z), () => {
|
|
40
41
|
t === null ? e.removeAttribute("dir") : e.setAttribute("dir", t);
|
|
@@ -44,13 +45,13 @@ var K = (n) => {
|
|
|
44
45
|
let n = Y(e);
|
|
45
46
|
return n === e ? t : n;
|
|
46
47
|
}, [Y]), $ = (e, t) => (e.endsWith("/") ? e.slice(0, -1) : e) + (t.startsWith("/") ? t : `/${t}`);
|
|
47
|
-
return
|
|
48
|
-
if (
|
|
48
|
+
return l(() => {
|
|
49
|
+
if (V) return V(le([
|
|
49
50
|
{
|
|
50
51
|
id: "healthybowl-dashboard",
|
|
51
52
|
label: Q("healthybowl.nav.dashboard", "Dashboard"),
|
|
52
53
|
path: r(K),
|
|
53
|
-
icon: /* @__PURE__ */
|
|
54
|
+
icon: /* @__PURE__ */ z(v, { size: 20 }),
|
|
54
55
|
order: 1,
|
|
55
56
|
group: "main"
|
|
56
57
|
},
|
|
@@ -58,7 +59,7 @@ var K = (n) => {
|
|
|
58
59
|
id: "healthybowl-farm",
|
|
59
60
|
label: Q("healthybowl.nav.farm", "My Farm"),
|
|
60
61
|
path: $(K, "farm"),
|
|
61
|
-
icon: /* @__PURE__ */
|
|
62
|
+
icon: /* @__PURE__ */ z(P, { size: 20 }),
|
|
62
63
|
order: 2,
|
|
63
64
|
group: "main"
|
|
64
65
|
},
|
|
@@ -66,7 +67,7 @@ var K = (n) => {
|
|
|
66
67
|
id: "healthybowl-tasks",
|
|
67
68
|
label: Q("healthybowl.nav.tasks", "Tasks"),
|
|
68
69
|
path: $(K, "tasks"),
|
|
69
|
-
icon: /* @__PURE__ */
|
|
70
|
+
icon: /* @__PURE__ */ z(S, { size: 20 }),
|
|
70
71
|
order: 3,
|
|
71
72
|
group: "main"
|
|
72
73
|
},
|
|
@@ -74,7 +75,7 @@ var K = (n) => {
|
|
|
74
75
|
id: "healthybowl-crops",
|
|
75
76
|
label: Q("healthybowl.nav.crops", "Crops"),
|
|
76
77
|
path: $(K, "crops"),
|
|
77
|
-
icon: /* @__PURE__ */ R
|
|
78
|
+
icon: /* @__PURE__ */ z(R, { size: 20 }),
|
|
78
79
|
order: 10,
|
|
79
80
|
group: "farming"
|
|
80
81
|
},
|
|
@@ -82,7 +83,7 @@ var K = (n) => {
|
|
|
82
83
|
id: "healthybowl-livestock",
|
|
83
84
|
label: Q("healthybowl.nav.livestock", "Livestock"),
|
|
84
85
|
path: $(K, "livestock"),
|
|
85
|
-
icon: /* @__PURE__ */
|
|
86
|
+
icon: /* @__PURE__ */ z(T, { size: 20 }),
|
|
86
87
|
order: 11,
|
|
87
88
|
group: "farming"
|
|
88
89
|
},
|
|
@@ -90,7 +91,7 @@ var K = (n) => {
|
|
|
90
91
|
id: "healthybowl-livestock-analytics",
|
|
91
92
|
label: Q("healthybowl.nav.livestockAnalytics", "Livestock Analytics"),
|
|
92
93
|
path: $(K, "livestock/analytics"),
|
|
93
|
-
icon: /* @__PURE__ */
|
|
94
|
+
icon: /* @__PURE__ */ z(x, { size: 20 }),
|
|
94
95
|
order: 11.3,
|
|
95
96
|
group: "farming"
|
|
96
97
|
},
|
|
@@ -98,7 +99,7 @@ var K = (n) => {
|
|
|
98
99
|
id: "healthybowl-grazing",
|
|
99
100
|
label: Q("healthybowl.nav.grazing", "Grazing"),
|
|
100
101
|
path: $(K, "livestock/grazing"),
|
|
101
|
-
icon: /* @__PURE__ */
|
|
102
|
+
icon: /* @__PURE__ */ z(m, { size: 20 }),
|
|
102
103
|
order: 11.4,
|
|
103
104
|
group: "farming"
|
|
104
105
|
},
|
|
@@ -106,7 +107,7 @@ var K = (n) => {
|
|
|
106
107
|
id: "healthybowl-withdrawal-alerts",
|
|
107
108
|
label: Q("healthybowl.nav.withdrawalAlerts", "Withdrawal Alerts"),
|
|
108
109
|
path: $(K, "livestock/withdrawal-alerts"),
|
|
109
|
-
icon: /* @__PURE__ */
|
|
110
|
+
icon: /* @__PURE__ */ z(A, { size: 20 }),
|
|
110
111
|
order: 11.5,
|
|
111
112
|
group: "farming"
|
|
112
113
|
},
|
|
@@ -114,7 +115,7 @@ var K = (n) => {
|
|
|
114
115
|
id: "healthybowl-weather",
|
|
115
116
|
label: Q("healthybowl.nav.weather", "Weather"),
|
|
116
117
|
path: $(K, "weather"),
|
|
117
|
-
icon: /* @__PURE__ */
|
|
118
|
+
icon: /* @__PURE__ */ z(u, { size: 20 }),
|
|
118
119
|
order: 12,
|
|
119
120
|
group: "farming"
|
|
120
121
|
},
|
|
@@ -122,7 +123,7 @@ var K = (n) => {
|
|
|
122
123
|
id: "healthybowl-field-map",
|
|
123
124
|
label: Q("healthybowl.nav.fieldMap", "Field Map"),
|
|
124
125
|
path: $(K, "field-map"),
|
|
125
|
-
icon: /* @__PURE__ */
|
|
126
|
+
icon: /* @__PURE__ */ z(C, { size: 20 }),
|
|
126
127
|
order: 12.5,
|
|
127
128
|
group: "farming"
|
|
128
129
|
},
|
|
@@ -130,7 +131,7 @@ var K = (n) => {
|
|
|
130
131
|
id: "healthybowl-field-capture",
|
|
131
132
|
label: Q("healthybowl.nav.fieldCapture", "Field Capture"),
|
|
132
133
|
path: $(K, "field-capture"),
|
|
133
|
-
icon: /* @__PURE__ */
|
|
134
|
+
icon: /* @__PURE__ */ z(d, { size: 20 }),
|
|
134
135
|
order: 12.6,
|
|
135
136
|
group: "farming"
|
|
136
137
|
},
|
|
@@ -138,7 +139,7 @@ var K = (n) => {
|
|
|
138
139
|
id: "healthybowl-pending-sync",
|
|
139
140
|
label: Q("healthybowl.nav.pendingSync", "Pending Sync"),
|
|
140
141
|
path: $(K, "field-capture/pending"),
|
|
141
|
-
icon: /* @__PURE__ */
|
|
142
|
+
icon: /* @__PURE__ */ z(D, { size: 20 }),
|
|
142
143
|
order: 12.7,
|
|
143
144
|
group: "farming"
|
|
144
145
|
},
|
|
@@ -146,7 +147,7 @@ var K = (n) => {
|
|
|
146
147
|
id: "healthybowl-field-sensors",
|
|
147
148
|
label: Q("healthybowl.nav.fieldSensors", "Field Sensors"),
|
|
148
149
|
path: $(K, "field-sensors"),
|
|
149
|
-
icon: /* @__PURE__ */
|
|
150
|
+
icon: /* @__PURE__ */ z(E, { size: 20 }),
|
|
150
151
|
order: 12.75,
|
|
151
152
|
group: "farming"
|
|
152
153
|
},
|
|
@@ -154,7 +155,7 @@ var K = (n) => {
|
|
|
154
155
|
id: "healthybowl-soil",
|
|
155
156
|
label: Q("healthybowl.nav.soilHealth", "Soil Health"),
|
|
156
157
|
path: $(K, "soil"),
|
|
157
|
-
icon: /* @__PURE__ */
|
|
158
|
+
icon: /* @__PURE__ */ z(h, { size: 20 }),
|
|
158
159
|
order: 13,
|
|
159
160
|
group: "farming"
|
|
160
161
|
},
|
|
@@ -162,7 +163,7 @@ var K = (n) => {
|
|
|
162
163
|
id: "healthybowl-pest",
|
|
163
164
|
label: Q("healthybowl.nav.pestManagement", "Pest Management"),
|
|
164
165
|
path: $(K, "pest-management"),
|
|
165
|
-
icon: /* @__PURE__ */
|
|
166
|
+
icon: /* @__PURE__ */ z(se, { size: 20 }),
|
|
166
167
|
order: 14,
|
|
167
168
|
group: "farming"
|
|
168
169
|
},
|
|
@@ -170,7 +171,7 @@ var K = (n) => {
|
|
|
170
171
|
id: "healthybowl-pest-ai",
|
|
171
172
|
label: Q("healthybowl.nav.aiPestDetection", "AI Pest Detection"),
|
|
172
173
|
path: $(K, "pest-management/ai-detection"),
|
|
173
|
-
icon: /* @__PURE__ */
|
|
174
|
+
icon: /* @__PURE__ */ z(k, { size: 20 }),
|
|
174
175
|
order: 14.5,
|
|
175
176
|
group: "farming"
|
|
176
177
|
},
|
|
@@ -178,7 +179,7 @@ var K = (n) => {
|
|
|
178
179
|
id: "healthybowl-production",
|
|
179
180
|
label: Q("healthybowl.nav.production", "Production"),
|
|
180
181
|
path: $(K, "production"),
|
|
181
|
-
icon: /* @__PURE__ */
|
|
182
|
+
icon: /* @__PURE__ */ z(p, { size: 20 }),
|
|
182
183
|
order: 20,
|
|
183
184
|
group: "business"
|
|
184
185
|
},
|
|
@@ -186,7 +187,7 @@ var K = (n) => {
|
|
|
186
187
|
id: "healthybowl-products",
|
|
187
188
|
label: Q("healthybowl.nav.products", "Products"),
|
|
188
189
|
path: $(K, "products"),
|
|
189
|
-
icon: /* @__PURE__ */
|
|
190
|
+
icon: /* @__PURE__ */ z(w, { size: 20 }),
|
|
190
191
|
order: 21,
|
|
191
192
|
group: "business"
|
|
192
193
|
},
|
|
@@ -194,7 +195,7 @@ var K = (n) => {
|
|
|
194
195
|
id: "healthybowl-marketplace",
|
|
195
196
|
label: Q("healthybowl.nav.marketplace", "Marketplace"),
|
|
196
197
|
path: $(K, "marketplace"),
|
|
197
|
-
icon: /* @__PURE__ */
|
|
198
|
+
icon: /* @__PURE__ */ z(M, { size: 20 }),
|
|
198
199
|
order: 22,
|
|
199
200
|
group: "business"
|
|
200
201
|
},
|
|
@@ -202,7 +203,7 @@ var K = (n) => {
|
|
|
202
203
|
id: "healthybowl-labour",
|
|
203
204
|
label: Q("healthybowl.nav.labour", "Labour"),
|
|
204
205
|
path: $(K, "labour"),
|
|
205
|
-
icon: /* @__PURE__ */
|
|
206
|
+
icon: /* @__PURE__ */ z(_, { size: 20 }),
|
|
206
207
|
order: 22.5,
|
|
207
208
|
group: "business"
|
|
208
209
|
},
|
|
@@ -210,7 +211,7 @@ var K = (n) => {
|
|
|
210
211
|
id: "healthybowl-coop",
|
|
211
212
|
label: Q("healthybowl.nav.coop", "Co-operative"),
|
|
212
213
|
path: $(K, "coop"),
|
|
213
|
-
icon: /* @__PURE__ */
|
|
214
|
+
icon: /* @__PURE__ */ z(L, { size: 20 }),
|
|
214
215
|
order: 22.5,
|
|
215
216
|
group: "business"
|
|
216
217
|
},
|
|
@@ -218,7 +219,7 @@ var K = (n) => {
|
|
|
218
219
|
id: "healthybowl-financial",
|
|
219
220
|
label: Q("healthybowl.nav.financial", "Financial"),
|
|
220
221
|
path: $(K, "financial"),
|
|
221
|
-
icon: /* @__PURE__ */
|
|
222
|
+
icon: /* @__PURE__ */ z(f, { size: 20 }),
|
|
222
223
|
order: 23,
|
|
223
224
|
group: "business"
|
|
224
225
|
},
|
|
@@ -226,7 +227,7 @@ var K = (n) => {
|
|
|
226
227
|
id: "healthybowl-financier",
|
|
227
228
|
label: Q("healthybowl.nav.financier", "Financier"),
|
|
228
229
|
path: $(K, "financier"),
|
|
229
|
-
icon: /* @__PURE__ */
|
|
230
|
+
icon: /* @__PURE__ */ z(ae, { size: 20 }),
|
|
230
231
|
order: 24,
|
|
231
232
|
group: "business"
|
|
232
233
|
},
|
|
@@ -234,7 +235,7 @@ var K = (n) => {
|
|
|
234
235
|
id: "healthybowl-compliance",
|
|
235
236
|
label: Q("healthybowl.nav.compliance", "Compliance"),
|
|
236
237
|
path: $(K, "compliance"),
|
|
237
|
-
icon: /* @__PURE__ */
|
|
238
|
+
icon: /* @__PURE__ */ z(j, { size: 20 }),
|
|
238
239
|
order: 30,
|
|
239
240
|
group: "compliance"
|
|
240
241
|
},
|
|
@@ -242,7 +243,7 @@ var K = (n) => {
|
|
|
242
243
|
id: "healthybowl-traceability",
|
|
243
244
|
label: Q("healthybowl.nav.traceability", "Traceability"),
|
|
244
245
|
path: $(K, "traceability"),
|
|
245
|
-
icon: /* @__PURE__ */
|
|
246
|
+
icon: /* @__PURE__ */ z(O, { size: 20 }),
|
|
246
247
|
order: 31,
|
|
247
248
|
group: "compliance"
|
|
248
249
|
},
|
|
@@ -250,7 +251,7 @@ var K = (n) => {
|
|
|
250
251
|
id: "healthybowl-sustainability",
|
|
251
252
|
label: Q("healthybowl.nav.sustainability", "Sustainability"),
|
|
252
253
|
path: $(K, "sustainability"),
|
|
253
|
-
icon: /* @__PURE__ */
|
|
254
|
+
icon: /* @__PURE__ */ z(b, { size: 20 }),
|
|
254
255
|
order: 32,
|
|
255
256
|
group: "compliance"
|
|
256
257
|
},
|
|
@@ -258,7 +259,7 @@ var K = (n) => {
|
|
|
258
259
|
id: "healthybowl-sustainability-carbon",
|
|
259
260
|
label: Q("healthybowl.nav.sustainabilityCarbon", "Carbon & GHG"),
|
|
260
261
|
path: $(K, "sustainability/carbon"),
|
|
261
|
-
icon: /* @__PURE__ */
|
|
262
|
+
icon: /* @__PURE__ */ z(p, { size: 20 }),
|
|
262
263
|
order: 32.1,
|
|
263
264
|
group: "compliance"
|
|
264
265
|
},
|
|
@@ -266,7 +267,7 @@ var K = (n) => {
|
|
|
266
267
|
id: "healthybowl-sustainability-soil",
|
|
267
268
|
label: Q("healthybowl.nav.sustainabilitySoil", "Soil Carbon"),
|
|
268
269
|
path: $(K, "sustainability/soil-carbon"),
|
|
269
|
-
icon: /* @__PURE__ */
|
|
270
|
+
icon: /* @__PURE__ */ z(N, { size: 20 }),
|
|
270
271
|
order: 32.2,
|
|
271
272
|
group: "compliance"
|
|
272
273
|
},
|
|
@@ -274,7 +275,7 @@ var K = (n) => {
|
|
|
274
275
|
id: "healthybowl-sustainability-credits",
|
|
275
276
|
label: Q("healthybowl.nav.sustainabilityCredits", "Carbon Credits"),
|
|
276
277
|
path: $(K, "sustainability/credits"),
|
|
277
|
-
icon: /* @__PURE__ */
|
|
278
|
+
icon: /* @__PURE__ */ z(ie, { size: 20 }),
|
|
278
279
|
order: 32.3,
|
|
279
280
|
group: "compliance"
|
|
280
281
|
},
|
|
@@ -282,7 +283,7 @@ var K = (n) => {
|
|
|
282
283
|
id: "healthybowl-sustainability-eudr",
|
|
283
284
|
label: Q("healthybowl.nav.sustainabilityEudr", "EUDR Due-Diligence"),
|
|
284
285
|
path: $(K, "sustainability/eudr"),
|
|
285
|
-
icon: /* @__PURE__ */
|
|
286
|
+
icon: /* @__PURE__ */ z(g, { size: 20 }),
|
|
286
287
|
order: 32.4,
|
|
287
288
|
group: "compliance"
|
|
288
289
|
},
|
|
@@ -290,7 +291,7 @@ var K = (n) => {
|
|
|
290
291
|
id: "healthybowl-schemes",
|
|
291
292
|
label: Q("healthybowl.nav.governmentSchemes", "Gov. Schemes"),
|
|
292
293
|
path: $(K, "government-schemes"),
|
|
293
|
-
icon: /* @__PURE__ */
|
|
294
|
+
icon: /* @__PURE__ */ z(y, { size: 20 }),
|
|
294
295
|
order: 40,
|
|
295
296
|
group: "support"
|
|
296
297
|
},
|
|
@@ -298,7 +299,7 @@ var K = (n) => {
|
|
|
298
299
|
id: "healthybowl-network",
|
|
299
300
|
label: Q("healthybowl.nav.network", "Network"),
|
|
300
301
|
path: $(K, "network"),
|
|
301
|
-
icon: /* @__PURE__ */
|
|
302
|
+
icon: /* @__PURE__ */ z(I, { size: 20 }),
|
|
302
303
|
order: 41,
|
|
303
304
|
group: "support"
|
|
304
305
|
},
|
|
@@ -306,7 +307,7 @@ var K = (n) => {
|
|
|
306
307
|
id: "healthybowl-analytics",
|
|
307
308
|
label: Q("healthybowl.nav.analytics", "Analytics"),
|
|
308
309
|
path: $(K, "analytics"),
|
|
309
|
-
icon: /* @__PURE__ */
|
|
310
|
+
icon: /* @__PURE__ */ z(oe, { size: 20 }),
|
|
310
311
|
order: 42,
|
|
311
312
|
group: "support"
|
|
312
313
|
},
|
|
@@ -314,7 +315,7 @@ var K = (n) => {
|
|
|
314
315
|
id: "healthybowl-advisors",
|
|
315
316
|
label: Q("healthybowl.nav.advisors", "My Advisors"),
|
|
316
317
|
path: $(K, "advisors"),
|
|
317
|
-
icon: /* @__PURE__ */
|
|
318
|
+
icon: /* @__PURE__ */ z(F, { size: 20 }),
|
|
318
319
|
order: 43,
|
|
319
320
|
group: "support"
|
|
320
321
|
},
|
|
@@ -322,34 +323,34 @@ var K = (n) => {
|
|
|
322
323
|
id: "healthybowl-consultant",
|
|
323
324
|
label: Q("healthybowl.nav.consultant", "Consultant"),
|
|
324
325
|
path: $(K, "consultant"),
|
|
325
|
-
icon: /* @__PURE__ */
|
|
326
|
+
icon: /* @__PURE__ */ z(ce, { size: 20 }),
|
|
326
327
|
order: 44,
|
|
327
328
|
group: "support"
|
|
328
329
|
}
|
|
329
330
|
], J));
|
|
330
331
|
}, [
|
|
331
|
-
|
|
332
|
+
V,
|
|
332
333
|
K,
|
|
333
334
|
J,
|
|
334
335
|
Q
|
|
335
|
-
]),
|
|
336
|
-
if (
|
|
336
|
+
]), l(() => {
|
|
337
|
+
if (G) return G([{
|
|
337
338
|
id: "healthybowl-status",
|
|
338
339
|
label: Q("healthybowl.footer.ready", "HealthyBowl Ready"),
|
|
339
340
|
type: "status",
|
|
340
341
|
order: 10,
|
|
341
342
|
section: "left"
|
|
342
343
|
}]);
|
|
343
|
-
}, [
|
|
344
|
+
}, [G, Q]), /* @__PURE__ */ B(e, {
|
|
344
345
|
...n,
|
|
345
|
-
children: [/* @__PURE__ */
|
|
346
|
+
children: [/* @__PURE__ */ z("style", { children: W }), /* @__PURE__ */ z(a, { children: /* @__PURE__ */ z(o, { children: /* @__PURE__ */ B(c, { children: [/* @__PURE__ */ z(te, {}), /* @__PURE__ */ z(s, {})] }) }) })]
|
|
346
347
|
});
|
|
347
|
-
}, q = (e) => /* @__PURE__ */
|
|
348
|
+
}, q = (e) => /* @__PURE__ */ z(V, {
|
|
348
349
|
workspaceId: e.workspaceId ?? null,
|
|
349
350
|
gateway: "global",
|
|
350
351
|
flagKeys: n,
|
|
351
352
|
defaultEnabled: !0,
|
|
352
|
-
children: /* @__PURE__ */
|
|
353
|
+
children: /* @__PURE__ */ z(K, { ...e })
|
|
353
354
|
}, e.workspaceId ?? "no-workspace");
|
|
354
355
|
//#endregion
|
|
355
356
|
export { q as HealthyBowlRoot };
|
|
@@ -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 HardHat,\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, useFeatureFlags } from '@burdenoff/fe-libs/shared/feature-flags';\nimport {\n HEALTHYBOWL_CARBON_FEATURE_FLAG,\n HEALTHYBOWL_CARBON_FEATURE_FLAG_KEYS,\n isHealthyBowlCarbonEnabled,\n} from './carbonFeatureFlag';\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\n// Locales that render right-to-left.\n//\n// DELIBERATELY EMPTY — Arabic was removed here, reverting BOFF-6119's rendering decision.\n//\n// BOFF-6119 migrated *this package* to logical CSS utilities (461 logical vs 54 physical) and then\n// set `dir` on `document.documentElement`. But the document root is not this package's to mirror:\n// the surrounding shell is `fe-libs` (177 physical utilities, 0 logical) and `healthybowl-app`\n// (7 physical, 0 logical). Neither is migrated, so `dir=\"rtl\"` mirrored them incorrectly and the\n// sidebar jumped to the right — which is what the layout complaint was about.\n//\n// fe-libs documents this exact failure mode and refuses to set `dir` for ANY locale until the\n// fleet-wide migration lands (see its I18nProvider note + BOFF-5998: \"sidebars on the wrong side,\n// icons mirrored, chevrons reversed\"). HealthyBowl was the only surface on the fleet setting it,\n// so Arabic rendered differently here than in every other product.\n//\n// Keeping the Set (rather than deleting the mechanism) so BOFF-6119 can be restored as a one-line\n// change once BOFF-5998 migrates the shell. Re-adding 'ar' before then reintroduces the bug.\nconst RTL_LOCALES = new Set<string>([]);\n\n// Horizontal directional lucide icons whose glyph must point the other way under RTL. lucide-react\n// tags every icon with a `lucide-<name>` class; scaleX(-1) mirrors the horizontal ones (vertical\n// chevrons up/down are unchanged by a horizontal flip). Kept off the LTR path via the [dir=rtl] scope.\nconst RTL_ICON_MIRROR_CSS = [\n '.lucide-arrow-right',\n '.lucide-arrow-left',\n '.lucide-chevron-right',\n '.lucide-chevron-left',\n '.lucide-chevrons-right',\n '.lucide-chevrons-left',\n '.lucide-move-right',\n '.lucide-move-left',\n]\n .map((c) => `[dir=\"rtl\"] ${c}`)\n .join(',')\n .concat('{transform:scaleX(-1)}');\n\nconst SUSTAINABILITY_NAV_ITEM_IDS = new Set([\n 'healthybowl-sustainability',\n 'healthybowl-sustainability-carbon',\n 'healthybowl-sustainability-soil',\n 'healthybowl-sustainability-credits',\n 'healthybowl-sustainability-eudr',\n]);\n\nexport function filterHealthyBowlNavItemsForCarbon(navItems: NavItem[], carbonEnabled: boolean): NavItem[] {\n return carbonEnabled ? navItems : navItems.filter((item) => !SUSTAINABILITY_NAV_ITEM_IDS.has(item.id));\n}\n\nconst HealthyBowlRootContent: FC<HealthyBowlRootProps> = (props) => {\n const { registerNavItems, registerFooterItems, basePath = '/' } = props;\n const { error, getEvaluation, isLoading } = useFeatureFlags();\n const carbonEnabled = isHealthyBowlCarbonEnabled(\n getEvaluation(HEALTHYBOWL_CARBON_FEATURE_FLAG),\n isLoading || error !== null\n );\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\n // BOFF-6119 wired RTL rendering here. `RTL_LOCALES` is now empty, so this resolves to 'ltr' for\n // every locale and the effect below writes dir=\"ltr\" — matching fe-libs and every other product.\n //\n // The original claim on this line was that \"HealthyBowl's own components are migrated to logical\n // CSS utilities, so setting `dir` makes the whole HB surface mirror correctly.\" Only the first\n // half held: this package is ~90% logical, but `dir` is set on the DOCUMENT ROOT (see below), so\n // it also mirrors fe-libs (177 physical / 0 logical) and healthybowl-app (7 / 0). \"The whole HB\n // surface\" is bigger than this package, and the rest of it was never migrated.\n const dir: 'rtl' | 'ltr' = RTL_LOCALES.has(locale) ? 'rtl' : 'ltr';\n\n // Set the direction on the document root, not just an in-flow wrapper: HB's overlays\n // (confirm/alert dialogs, dropdowns, tooltips) render through Radix portals attached to\n // document.body, so a subtree wrapper would leave them LTR. The shared fe-libs I18nProvider\n // deliberately leaves document.dir unset (the app shell and other products aren't migrated to\n // logical CSS yet — fleet ticket BOFF-5998), so HB owns it here and restores the previous value\n // on unmount, keeping the effect self-contained to when a HealthyBowl surface is mounted.\n useEffect(() => {\n const el = document.documentElement;\n const previous = el.getAttribute('dir');\n el.setAttribute('dir', dir);\n return () => {\n if (previous === null) el.removeAttribute('dir');\n else el.setAttribute('dir', previous);\n };\n }, [dir]);\n\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 allNavItems: 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 // Labour, crews and timesheets (BOFF-6024). Sits between Marketplace (22) and Co-operative,\n // in the business group, because its output lands on the financial pages next to it.\n {\n id: 'healthybowl-labour',\n label: t('healthybowl.nav.labour', 'Labour'),\n path: joinPath(basePath, 'labour'),\n icon: <HardHat size={20} />,\n order: 22.5,\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 // The operational carbon kill switch hides only Sustainability items;\n // Compliance and Traceability remain available.\n const navItems = filterHealthyBowlNavItemsForCarbon(allNavItems, carbonEnabled);\n const cleanup = registerNavItems(navItems);\n return cleanup;\n }, [registerNavItems, basePath, carbonEnabled, t]);\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, t]);\n\n return (\n <HealthyBowlProvider {...props}>\n {/* Logical CSS utilities flip an icon's *position* under RTL, but not its glyph. Navigational\n arrows/chevrons must also point the other way, so mirror the horizontal ones. Vertical\n chevrons (up/down, e.g. accordions) are unaffected by scaleX. Scoped to [dir=rtl] so it is\n inert in LTR. See BOFF-6119. */}\n <style>{RTL_ICON_MIRROR_CSS}</style>\n <ErrorBoundary>\n <ConfirmProvider>\n <OfflineSyncProvider>\n <HealthyBowlRoutes />\n </OfflineSyncProvider>\n </ConfirmProvider>\n </ErrorBoundary>\n </HealthyBowlProvider>\n );\n};\n\nexport const HealthyBowlRoot: FC<HealthyBowlRootProps> = (props) => (\n <FeatureFlagProvider\n key={props.workspaceId ?? 'no-workspace'}\n workspaceId={props.workspaceId ?? null}\n gateway=\"global\"\n flagKeys={HEALTHYBOWL_CARBON_FEATURE_FLAG_KEYS}\n defaultEnabled={true}\n >\n <HealthyBowlRootContent {...props} />\n </FeatureFlagProvider>\n);\n"],"mappings":";;;;;;;;;;;;;AA2EA,IAAM,oBAAc,IAAI,IAAY,CAAC,CAAC,GAKhC,IAAsB;CAC1B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,EACG,KAAK,MAAM,eAAe,GAAG,EAC7B,KAAK,GAAG,EACR,OAAO,wBAAwB,GAE5B,IAA8B,IAAI,IAAI;CAC1C;CACA;CACA;CACA;CACA;AACF,CAAC;AAED,SAAgB,EAAmC,GAAqB,GAAmC;CACzG,OAAO,IAAgB,IAAW,EAAS,QAAQ,MAAS,CAAC,EAA4B,IAAI,EAAK,EAAE,CAAC;AACvG;AAEA,IAAM,KAAoD,MAAU;CAClE,IAAM,EAAE,qBAAkB,wBAAqB,cAAW,QAAQ,GAC5D,EAAE,UAAO,mBAAe,kBAAc,EAAgB,GACtD,IAAgB,GACpB,GA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C,MAAM,kBAAC,IAAD,EAAa,MAAM,GAAK,CAAA;IAC9B,OAAO;IACP,OAAO;GACT;EAUkD,GAAa,CAChC,CAC1B;CACT,GAAG;EAAC;EAAkB;EAAU;EAAe;CAAC,CAAC,GAGjD,QAAgB;EACT,OAaL,OADgB,EAAoB,CATlC;GACE,IAAI;GACJ,OAAO,EAAE,4BAA4B,mBAAmB;GACxD,MAAM;GACN,OAAO;GACP,SAAS;EACX,CAGkC,CAC7B;CACT,GAAG,CAAC,GAAqB,CAAC,CAAC,GAGzB,kBAAC,GAAD;EAAqB,GAAI;YAAzB,CAKE,kBAAC,SAAD,EAAA,UAAQ,EAA2B,CAAA,GACnC,kBAAC,GAAD,EAAA,UACE,kBAAC,GAAD,EAAA,UACE,kBAAC,IAAD,EAAA,UACE,kBAAC,GAAD,CAAoB,CAAA,EACD,CAAA,EACN,CAAA,EACJ,CAAA,CACI;;AAEzB,GAEa,KAA6C,MACxD,kBAAC,GAAD;CAEE,aAAa,EAAM,eAAe;CAClC,SAAQ;CACR,UAAU;CACV,gBAAgB;WAEhB,kBAAC,GAAD,EAAwB,GAAI,EAAQ,CAAA;AACjB,GAPd,EAAM,eAAe,cAOP"}
|
|
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 HardHat,\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, useFeatureFlags } from '@burdenoff/fe-libs/shared/feature-flags';\nimport {\n HEALTHYBOWL_CARBON_FEATURE_FLAG,\n HEALTHYBOWL_CARBON_FEATURE_FLAG_KEYS,\n isHealthyBowlCarbonEnabled,\n} from './carbonFeatureFlag';\nimport { HealthyBowlRoutes } from './HealthyBowlRoutes';\nimport { ErrorBoundary } from './components/ErrorBoundary';\nimport { ConfirmProvider } from './components/ConfirmDialog';\nimport { OfflineSyncProvider } from './offline/OfflineSyncProvider';\nimport { HeaderOfflinePill } from './offline/HeaderOfflinePill';\nimport { normalizeBasePath, setHbFormatLocale } from './utils/helpers';\nimport type { HealthyBowlRootProps, NavItem } from './types';\n\n// Locales that render right-to-left.\n//\n// DELIBERATELY EMPTY — Arabic was removed here, reverting BOFF-6119's rendering decision.\n//\n// BOFF-6119 migrated *this package* to logical CSS utilities (461 logical vs 54 physical) and then\n// set `dir` on `document.documentElement`. But the document root is not this package's to mirror:\n// the surrounding shell is `fe-libs` (177 physical utilities, 0 logical) and `healthybowl-app`\n// (7 physical, 0 logical). Neither is migrated, so `dir=\"rtl\"` mirrored them incorrectly and the\n// sidebar jumped to the right — which is what the layout complaint was about.\n//\n// fe-libs documents this exact failure mode and refuses to set `dir` for ANY locale until the\n// fleet-wide migration lands (see its I18nProvider note + BOFF-5998: \"sidebars on the wrong side,\n// icons mirrored, chevrons reversed\"). HealthyBowl was the only surface on the fleet setting it,\n// so Arabic rendered differently here than in every other product.\n//\n// Keeping the Set (rather than deleting the mechanism) so BOFF-6119 can be restored as a one-line\n// change once BOFF-5998 migrates the shell. Re-adding 'ar' before then reintroduces the bug.\nconst RTL_LOCALES = new Set<string>([]);\n\n// Horizontal directional lucide icons whose glyph must point the other way under RTL. lucide-react\n// tags every icon with a `lucide-<name>` class; scaleX(-1) mirrors the horizontal ones (vertical\n// chevrons up/down are unchanged by a horizontal flip). Kept off the LTR path via the [dir=rtl] scope.\nconst RTL_ICON_MIRROR_CSS = [\n '.lucide-arrow-right',\n '.lucide-arrow-left',\n '.lucide-chevron-right',\n '.lucide-chevron-left',\n '.lucide-chevrons-right',\n '.lucide-chevrons-left',\n '.lucide-move-right',\n '.lucide-move-left',\n]\n .map((c) => `[dir=\"rtl\"] ${c}`)\n .join(',')\n .concat('{transform:scaleX(-1)}');\n\nconst SUSTAINABILITY_NAV_ITEM_IDS = new Set([\n 'healthybowl-sustainability',\n 'healthybowl-sustainability-carbon',\n 'healthybowl-sustainability-soil',\n 'healthybowl-sustainability-credits',\n 'healthybowl-sustainability-eudr',\n]);\n\nexport function filterHealthyBowlNavItemsForCarbon(navItems: NavItem[], carbonEnabled: boolean): NavItem[] {\n return carbonEnabled ? navItems : navItems.filter((item) => !SUSTAINABILITY_NAV_ITEM_IDS.has(item.id));\n}\n\nconst HealthyBowlRootContent: FC<HealthyBowlRootProps> = (props) => {\n const { registerNavItems, registerFooterItems, basePath = '/' } = props;\n const { error, getEvaluation, isLoading } = useFeatureFlags();\n const carbonEnabled = isHealthyBowlCarbonEnabled(\n getEvaluation(HEALTHYBOWL_CARBON_FEATURE_FLAG),\n isLoading || error !== null\n );\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\n // BOFF-6119 wired RTL rendering here. `RTL_LOCALES` is now empty, so this resolves to 'ltr' for\n // every locale and the effect below writes dir=\"ltr\" — matching fe-libs and every other product.\n //\n // The original claim on this line was that \"HealthyBowl's own components are migrated to logical\n // CSS utilities, so setting `dir` makes the whole HB surface mirror correctly.\" Only the first\n // half held: this package is ~90% logical, but `dir` is set on the DOCUMENT ROOT (see below), so\n // it also mirrors fe-libs (177 physical / 0 logical) and healthybowl-app (7 / 0). \"The whole HB\n // surface\" is bigger than this package, and the rest of it was never migrated.\n const dir: 'rtl' | 'ltr' = RTL_LOCALES.has(locale) ? 'rtl' : 'ltr';\n\n // Set the direction on the document root, not just an in-flow wrapper: HB's overlays\n // (confirm/alert dialogs, dropdowns, tooltips) render through Radix portals attached to\n // document.body, so a subtree wrapper would leave them LTR. The shared fe-libs I18nProvider\n // deliberately leaves document.dir unset (the app shell and other products aren't migrated to\n // logical CSS yet — fleet ticket BOFF-5998), so HB owns it here and restores the previous value\n // on unmount, keeping the effect self-contained to when a HealthyBowl surface is mounted.\n useEffect(() => {\n const el = document.documentElement;\n const previous = el.getAttribute('dir');\n el.setAttribute('dir', dir);\n return () => {\n if (previous === null) el.removeAttribute('dir');\n else el.setAttribute('dir', previous);\n };\n }, [dir]);\n\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 allNavItems: 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 // Labour, crews and timesheets (BOFF-6024). Sits between Marketplace (22) and Co-operative,\n // in the business group, because its output lands on the financial pages next to it.\n {\n id: 'healthybowl-labour',\n label: t('healthybowl.nav.labour', 'Labour'),\n path: joinPath(basePath, 'labour'),\n icon: <HardHat size={20} />,\n order: 22.5,\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 // The operational carbon kill switch hides only Sustainability items;\n // Compliance and Traceability remain available.\n const navItems = filterHealthyBowlNavItemsForCarbon(allNavItems, carbonEnabled);\n const cleanup = registerNavItems(navItems);\n return cleanup;\n }, [registerNavItems, basePath, carbonEnabled, t]);\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, t]);\n\n return (\n <HealthyBowlProvider {...props}>\n {/* Logical CSS utilities flip an icon's *position* under RTL, but not its glyph. Navigational\n arrows/chevrons must also point the other way, so mirror the horizontal ones. Vertical\n chevrons (up/down, e.g. accordions) are unaffected by scaleX. Scoped to [dir=rtl] so it is\n inert in LTR. See BOFF-6119. */}\n <style>{RTL_ICON_MIRROR_CSS}</style>\n <ErrorBoundary>\n <ConfirmProvider>\n <OfflineSyncProvider>\n {/* Portals the connectivity pill into the shell's top bar. Must sit INSIDE the provider:\n the portal relocates the DOM node, not the React tree, so this is what keeps\n `useOfflineSync()` resolvable from a node rendered in the header. See BOFF-6185. */}\n <HeaderOfflinePill />\n <HealthyBowlRoutes />\n </OfflineSyncProvider>\n </ConfirmProvider>\n </ErrorBoundary>\n </HealthyBowlProvider>\n );\n};\n\nexport const HealthyBowlRoot: FC<HealthyBowlRootProps> = (props) => (\n <FeatureFlagProvider\n key={props.workspaceId ?? 'no-workspace'}\n workspaceId={props.workspaceId ?? null}\n gateway=\"global\"\n flagKeys={HEALTHYBOWL_CARBON_FEATURE_FLAG_KEYS}\n defaultEnabled={true}\n >\n <HealthyBowlRootContent {...props} />\n </FeatureFlagProvider>\n);\n"],"mappings":";;;;;;;;;;;;;;AA4EA,IAAM,oBAAc,IAAI,IAAY,CAAC,CAAC,GAKhC,IAAsB;CAC1B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,EACG,KAAK,MAAM,eAAe,GAAG,EAC7B,KAAK,GAAG,EACR,OAAO,wBAAwB,GAE5B,IAA8B,IAAI,IAAI;CAC1C;CACA;CACA;CACA;CACA;AACF,CAAC;AAED,SAAgB,GAAmC,GAAqB,GAAmC;CACzG,OAAO,IAAgB,IAAW,EAAS,QAAQ,MAAS,CAAC,EAA4B,IAAI,EAAK,EAAE,CAAC;AACvG;AAEA,IAAM,KAAoD,MAAU;CAClE,IAAM,EAAE,qBAAkB,wBAAqB,cAAW,QAAQ,GAC5D,EAAE,UAAO,mBAAe,kBAAc,EAAgB,GACtD,IAAgB,GACpB,GAAc,CAA+B,GAC7C,MAAa,MAAU,IACzB,GACM,EAAE,GAAG,GAAW,cAAW,GAAQ;CASzC,EAAkB,CAAM;CAUxB,IAAM,IAAqB,EAAY,IAAI,CAAM,IAAI,QAAQ;CAQ7D,QAAgB;EACd,IAAM,IAAK,SAAS,iBACd,IAAW,EAAG,aAAa,KAAK;EAEtC,OADA,EAAG,aAAa,OAAO,CAAG,SACb;GACX,AAAI,MAAa,OAAM,EAAG,gBAAgB,KAAK,IAC1C,EAAG,aAAa,OAAO,CAAQ;EACtC;CACF,GAAG,CAAC,CAAG,CAAC;CAER,IAAM,IAAI,IACP,GAAa,MAA6B;EACzC,IAAM,IAAQ,EAAU,CAAG;EAC3B,OAAO,MAAU,IAAM,IAAW;CACpC,GACA,CAAC,CAAS,CACZ,GAGM,KAAY,GAAc,OACZ,EAAK,SAAS,GAAG,IAAI,EAAK,MAAM,GAAG,EAAE,IAAI,M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