@burdenoff/microfe-healthybowl 2026.812.9 → 2026.812.10

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 +1 @@
1
- {"version":3,"file":"fertility.js","names":[],"sources":["../../../src/healthybowl/utils/fertility.ts"],"sourcesContent":["/**\n * Fertility vocabulary and the caveats that travel with it (BOFF-6008).\n *\n * `healthyBowlLivestockFertility` is the fourth livestock analytics slice, beside growth, feed and\n * herd statistics. Its payload carries three contracts that are easy to break in JSX, so they live\n * here as pure functions and are unit-tested rather than left to the component:\n *\n * 1. **An unmeasured rate is not a zero, but a measured zero IS a zero.** The backend returns\n * `conceptionRatePct: null` when nothing was served, and `0` when services were served and\n * none conceived. Those are opposite facts about a herd — \"we have no breeding data\" versus\n * \"nothing is getting pregnant\" — and the second is the alarming one a farmer must see. So the\n * empty state is decided by whether any breeding activity exists at all\n * ({@link hasFertilityData}), never by whether a rate happens to be falsy.\n * 2. **The calving interval is withheld, with a reason, rather than guessed.** A DELIVERED record\n * with no delivery date merges two births into one gap and OVERSTATES the interval — the\n * direction that hides a fertility problem behind a number reading as merely mediocre. A farmer\n * culls animals on these figures. {@link calvingIntervalDisplay} forces the caller to render\n * the backend's sentence instead of a number, exactly as `mortalityDisplay` does for mortality.\n * 3. **The CSV must carry what the card shows.** The trend series is keyed on the MATING date and\n * therefore skips services with no mating date, so its buckets can legitimately under-sum the\n * window totals. {@link fertilityCsvRows} emits the window total as its own labelled row so the\n * headline figure is in the export, and so the difference is visible rather than hidden.\n *\n * Strings are `{ key, defaultValue }` pairs, not finished text — this module is pure and tested in\n * the repo's `node` vitest environment, so callers pass them to their own `t()`.\n *\n * @module healthybowl\n */\n\nimport type { TranslatableText } from './grazing';\n\nexport type { TranslatableText };\n\n/** One bucket of the fertility trend, mirroring `HealthyBowlFertilityBucket`. */\nexport interface FertilityBucket {\n /** Bucket start, YYYY-MM-DD, keyed on the MATING date. */\n bucket: string;\n services: number;\n conceived: number;\n conceptionRatePct: number | null;\n deliveries: number;\n}\n\n/** A pregnancy due within the horizon, mirroring `HealthyBowlDueSoon`. */\nexport interface DueSoonRow {\n animalId: string;\n expectedDeliveryDate: string;\n daysUntilDue: number;\n}\n\n// ── 1. the empty state ────────────────────────────────────────────────────────\n\n/** The fields {@link hasFertilityData} needs. Deliberately not the whole payload. */\nexport interface FertilityPresence {\n services: number | null | undefined;\n deliveries: number | null | undefined;\n damsWithInterval: number | null | undefined;\n dueSoonCount: number;\n trendCount: number;\n}\n\n/**\n * Whether this workspace has any breeding activity to describe.\n *\n * ★ Decided on ACTIVITY, never on a rate. `conceptionRatePct === 0` is a real and serious\n * measurement — four services and nothing in calf — and showing \"No breeding records yet\" over the\n * top of it would tell a farmer their herd is fine when it is barren. Conversely a workspace that\n * has genuinely recorded nothing must not be shown `0%`, which reads as the same disaster.\n *\n * Deliveries are counted separately from services because a delivery whose mating fell outside the\n * window is still evidence the herd breeds; so are dams with a computable interval, and so is a\n * pregnancy due next week.\n */\nexport function hasFertilityData(input: FertilityPresence): boolean {\n const positive = (n: number | null | undefined): boolean => typeof n === 'number' && n > 0;\n return (\n positive(input.services) ||\n positive(input.deliveries) ||\n positive(input.damsWithInterval) ||\n input.dueSoonCount > 0 ||\n input.trendCount > 0\n );\n}\n\n// ── 2. the calving-interval disclosure ────────────────────────────────────────\n\nexport type CalvingIntervalDisplay =\n { available: true; meanDays: number; medianDays: number | null } | { available: false; reason: string | null };\n\n/**\n * Whether a calving interval can honestly be shown, and if not, why.\n *\n * Mirrors `mortalityDisplay`. The backend supplies the sentence precisely so the UI does not have\n * to invent one or, far worse, print the inflated figure. `reason` non-null is authoritative even\n * if a mean somehow arrived alongside it: the guard exists because the number is WRONG, not merely\n * absent, and a caller that preferred the number would defeat the whole guard.\n */\nexport function calvingIntervalDisplay(summary: {\n meanCalvingIntervalDays: number | null;\n medianCalvingIntervalDays: number | null;\n calvingIntervalUnavailableReason: string | null;\n}): CalvingIntervalDisplay {\n const reason = summary.calvingIntervalUnavailableReason?.trim();\n if (reason && reason.length > 0) return { available: false, reason };\n const mean = summary.meanCalvingIntervalDays;\n if (typeof mean !== 'number' || !Number.isFinite(mean)) return { available: false, reason: null };\n const median = summary.medianCalvingIntervalDays;\n return {\n available: true,\n meanDays: mean,\n medianDays: typeof median === 'number' && Number.isFinite(median) ? median : null,\n };\n}\n\n// ── 2b. the pregnancy-loss disclosure ─────────────────────────────────────────\n\nexport type PregnancyLossDisplay = { available: true; ratePct: number } | { available: false; reason: string | null };\n\n/**\n * Whether a pregnancy-loss rate can honestly be shown, and if not, why.\n *\n * Same shape and same reasoning as {@link calvingIntervalDisplay}. Today the backend ALWAYS\n * withholds this: telling a lost pregnancy apart from a service that never took requires knowing it\n * was confirmed first, and `pregnancyConfirmed` has no write path in the product — so the raw ratio\n * is structurally 0 on every herd, including one losing every calf it confirmed. `optionalMetric`\n * would have printed that 0 as a measurement, indistinguishable from a genuinely perfect record.\n */\nexport function pregnancyLossDisplay(summary: {\n pregnancyLossPct: number | null;\n pregnancyLossUnavailableReason: string | null;\n}): PregnancyLossDisplay {\n const reason = summary.pregnancyLossUnavailableReason?.trim();\n if (reason && reason.length > 0) return { available: false, reason };\n const rate = summary.pregnancyLossPct;\n if (typeof rate !== 'number' || !Number.isFinite(rate)) return { available: false, reason: null };\n return { available: true, ratePct: rate };\n}\n\n// ── 3. trend + export ─────────────────────────────────────────────────────────\n\n/** Buckets in chronological order. The backend already sorts; this makes the chart independent. */\nexport function orderedFertilityBuckets(buckets: readonly FertilityBucket[]): FertilityBucket[] {\n return [...buckets].sort((a, b) => a.bucket.localeCompare(b.bucket));\n}\n\nexport interface FertilityCsvInput {\n services: number;\n conceived: number;\n conceptionRatePct: number | null;\n deliveries: number;\n trend: readonly FertilityBucket[];\n}\n\n/** Column order for {@link fertilityCsvRows}. Exported so the card and the test cannot drift. */\nexport const FERTILITY_CSV_HEADERS = ['Period', 'Services', 'Conceived', 'Conception rate %', 'Deliveries'] as const;\n\n/**\n * CSV rows for the fertility card: the window total first, then each bucket.\n *\n * The total leads because it is the figure the card headlines and the one a reader checks first.\n *\n * ★ The total is NOT the sum of the rows beneath it, and that is correct rather than a bug: buckets\n * are keyed on the mating date, so a service recorded without one contributes to the window total\n * and to no bucket. Labelling the total row explicitly is what keeps that visible — silently\n * dropping it would make the export disagree with the card, and silently summing the buckets\n * instead would under-report the herd's real service count.\n *\n * An unmeasured rate exports as an empty cell, never as `0` — a spreadsheet will average a zero.\n */\nexport function fertilityCsvRows(input: FertilityCsvInput): (string | number)[][] {\n const pct = (v: number | null): string | number => (typeof v === 'number' && Number.isFinite(v) ? v : '');\n return [\n ['Total (all services in window)', input.services, input.conceived, pct(input.conceptionRatePct), input.deliveries],\n ...orderedFertilityBuckets(input.trend).map((b) => [\n b.bucket,\n b.services,\n b.conceived,\n pct(b.conceptionRatePct),\n b.deliveries,\n ]),\n ];\n}\n\n// ── due-soon ──────────────────────────────────────────────────────────────────\n\n/**\n * How urgently a pregnancy needs attention.\n *\n * Purely a presentation band; the backend already excludes DELIVERED and FAILED records, so every\n * row here is a birth that has not happened yet. `OVERDUE` cannot occur from the current backend\n * (it drops negative `daysUntilDue`) but is handled rather than trusted — a due date that has\n * passed is precisely the row a farmer most needs to see, and silently dropping it into the\n * \"later\" bucket would bury it.\n */\nexport type DueSoonUrgency = 'OVERDUE' | 'IMMINENT' | 'SOON' | 'LATER';\n\nexport function dueSoonUrgency(daysUntilDue: number): DueSoonUrgency {\n if (!Number.isFinite(daysUntilDue) || daysUntilDue < 0) return 'OVERDUE';\n if (daysUntilDue <= 7) return 'IMMINENT';\n if (daysUntilDue <= 14) return 'SOON';\n return 'LATER';\n}\n\n/** Label for a due-soon row's urgency, for the caller's `t()`. */\nexport function dueSoonUrgencyText(urgency: DueSoonUrgency): TranslatableText {\n switch (urgency) {\n case 'OVERDUE':\n return { key: 'healthybowl.livestock.fertility.due.overdue', defaultValue: 'Overdue' };\n case 'IMMINENT':\n return { key: 'healthybowl.livestock.fertility.due.imminent', defaultValue: 'Within a week' };\n case 'SOON':\n return { key: 'healthybowl.livestock.fertility.due.soon', defaultValue: 'Within a fortnight' };\n default:\n return { key: 'healthybowl.livestock.fertility.due.later', defaultValue: 'Later this month' };\n }\n}\n\n/**\n * Soonest first — the ordering a farmer plans around.\n *\n * A non-finite `daysUntilDue` sorts to the TOP, not to wherever the comparator happens to leave it.\n * {@link dueSoonUrgency} already labels such a row `OVERDUE`, so leaving the sort to return `NaN`\n * would print \"Overdue\" against a row sitting arbitrarily in the middle of the list — the one row\n * that most needs to be first, placed by chance.\n */\nexport function orderedDueSoon(rows: readonly DueSoonRow[]): DueSoonRow[] {\n const rank = (n: number): number => (Number.isFinite(n) ? n : Number.NEGATIVE_INFINITY);\n return [...rows].sort((a, b) => rank(a.daysUntilDue) - rank(b.daysUntilDue));\n}\n"],"mappings":";AAyEA,SAAgB,EAAiB,GAAmC;CAClE,IAAM,KAAY,MAA0C,OAAO,KAAM,YAAY,IAAI;AACzF,QACE,EAAS,EAAM,SAAS,IACxB,EAAS,EAAM,WAAW,IAC1B,EAAS,EAAM,iBAAiB,IAChC,EAAM,eAAe,KACrB,EAAM,aAAa;;AAiBvB,SAAgB,EAAuB,GAIZ;CACzB,IAAM,IAAS,EAAQ,kCAAkC,MAAM;AAC/D,KAAI,KAAU,EAAO,SAAS,EAAG,QAAO;EAAE,WAAW;EAAO;EAAQ;CACpE,IAAM,IAAO,EAAQ;AACrB,KAAI,OAAO,KAAS,YAAY,CAAC,OAAO,SAAS,EAAK,CAAE,QAAO;EAAE,WAAW;EAAO,QAAQ;EAAM;CACjG,IAAM,IAAS,EAAQ;AACvB,QAAO;EACL,WAAW;EACX,UAAU;EACV,YAAY,OAAO,KAAW,YAAY,OAAO,SAAS,EAAO,GAAG,IAAS;EAC9E;;AAgBH,SAAgB,EAAqB,GAGZ;CACvB,IAAM,IAAS,EAAQ,gCAAgC,MAAM;AAC7D,KAAI,KAAU,EAAO,SAAS,EAAG,QAAO;EAA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E,aAAa,GAAG,EAAK,EAAE,aAAa,CAAC"}
1
+ {"version":3,"file":"fertility.js","names":[],"sources":["../../../src/healthybowl/utils/fertility.ts"],"sourcesContent":["/**\n * Fertility vocabulary and the caveats that travel with it (BOFF-6008).\n *\n * `healthyBowlLivestockFertility` is the fourth livestock analytics slice, beside growth, feed and\n * herd statistics. Its payload carries three contracts that are easy to break in JSX, so they live\n * here as pure functions and are unit-tested rather than left to the component:\n *\n * 1. **An unmeasured rate is not a zero, but a measured zero IS a zero.** The backend returns\n * `conceptionRatePct: null` when nothing was served, and `0` when services were served and\n * none conceived. Those are opposite facts about a herd — \"we have no breeding data\" versus\n * \"nothing is getting pregnant\" — and the second is the alarming one a farmer must see. So the\n * empty state is decided by whether any breeding activity exists at all\n * ({@link hasFertilityData}), never by whether a rate happens to be falsy.\n * 2. **The calving interval is withheld, with a reason, rather than guessed.** A DELIVERED record\n * with no delivery date merges two births into one gap and OVERSTATES the interval — the\n * direction that hides a fertility problem behind a number reading as merely mediocre. A farmer\n * culls animals on these figures. {@link calvingIntervalDisplay} forces the caller to render\n * the backend's sentence instead of a number, exactly as `mortalityDisplay` does for mortality.\n * 3. **The CSV must carry what the card shows.** {@link fertilityCsvRows} emits the window total as\n * its own labelled row, so the headline conception rate a reader checks first is in the export\n * rather than only derivable by re-aggregating the buckets.\n *\n * Strings are `{ key, defaultValue }` pairs, not finished text — this module is pure and tested in\n * the repo's `node` vitest environment, so callers pass them to their own `t()`.\n *\n * @module healthybowl\n */\n\nimport type { TranslatableText } from './grazing';\n\nexport type { TranslatableText };\n\n/** One bucket of the fertility trend, mirroring `HealthyBowlFertilityBucket`. */\nexport interface FertilityBucket {\n /** Bucket start, YYYY-MM-DD, keyed on the MATING date. */\n bucket: string;\n services: number;\n conceived: number;\n conceptionRatePct: number | null;\n deliveries: number;\n}\n\n/** A pregnancy due within the horizon, mirroring `HealthyBowlDueSoon`. */\nexport interface DueSoonRow {\n animalId: string;\n expectedDeliveryDate: string;\n daysUntilDue: number;\n}\n\n// ── 1. the empty state ────────────────────────────────────────────────────────\n\n/** The fields {@link hasFertilityData} needs. Deliberately not the whole payload. */\nexport interface FertilityPresence {\n services: number | null | undefined;\n deliveries: number | null | undefined;\n damsWithInterval: number | null | undefined;\n dueSoonCount: number;\n trendCount: number;\n}\n\n/**\n * Whether this workspace has any breeding activity to describe.\n *\n * ★ Decided on ACTIVITY, never on a rate. `conceptionRatePct === 0` is a real and serious\n * measurement — four services and nothing in calf — and showing \"No breeding records yet\" over the\n * top of it would tell a farmer their herd is fine when it is barren. Conversely a workspace that\n * has genuinely recorded nothing must not be shown `0%`, which reads as the same disaster.\n *\n * Deliveries are counted separately from services because a delivery whose mating fell outside the\n * window is still evidence the herd breeds; so are dams with a computable interval, and so is a\n * pregnancy due next week.\n */\nexport function hasFertilityData(input: FertilityPresence): boolean {\n const positive = (n: number | null | undefined): boolean => typeof n === 'number' && n > 0;\n return (\n positive(input.services) ||\n positive(input.deliveries) ||\n positive(input.damsWithInterval) ||\n input.dueSoonCount > 0 ||\n input.trendCount > 0\n );\n}\n\n// ── 2. the calving-interval disclosure ────────────────────────────────────────\n\nexport type CalvingIntervalDisplay =\n { available: true; meanDays: number; medianDays: number | null } | { available: false; reason: string | null };\n\n/**\n * Whether a calving interval can honestly be shown, and if not, why.\n *\n * Mirrors `mortalityDisplay`. The backend supplies the sentence precisely so the UI does not have\n * to invent one or, far worse, print the inflated figure. `reason` non-null is authoritative even\n * if a mean somehow arrived alongside it: the guard exists because the number is WRONG, not merely\n * absent, and a caller that preferred the number would defeat the whole guard.\n */\nexport function calvingIntervalDisplay(summary: {\n meanCalvingIntervalDays: number | null;\n medianCalvingIntervalDays: number | null;\n calvingIntervalUnavailableReason: string | null;\n}): CalvingIntervalDisplay {\n const reason = summary.calvingIntervalUnavailableReason?.trim();\n if (reason && reason.length > 0) return { available: false, reason };\n const mean = summary.meanCalvingIntervalDays;\n if (typeof mean !== 'number' || !Number.isFinite(mean)) return { available: false, reason: null };\n const median = summary.medianCalvingIntervalDays;\n return {\n available: true,\n meanDays: mean,\n medianDays: typeof median === 'number' && Number.isFinite(median) ? median : null,\n };\n}\n\n// ── 2b. the pregnancy-loss disclosure ─────────────────────────────────────────\n\nexport type PregnancyLossDisplay = { available: true; ratePct: number } | { available: false; reason: string | null };\n\n/**\n * Whether a pregnancy-loss rate can honestly be shown, and if not, why.\n *\n * Same shape and same reasoning as {@link calvingIntervalDisplay}. Today the backend ALWAYS\n * withholds this: telling a lost pregnancy apart from a service that never took requires knowing it\n * was confirmed first, and `pregnancyConfirmed` has no write path in the product — so the raw ratio\n * is structurally 0 on every herd, including one losing every calf it confirmed. `optionalMetric`\n * would have printed that 0 as a measurement, indistinguishable from a genuinely perfect record.\n */\nexport function pregnancyLossDisplay(summary: {\n pregnancyLossPct: number | null;\n pregnancyLossUnavailableReason: string | null;\n}): PregnancyLossDisplay {\n const reason = summary.pregnancyLossUnavailableReason?.trim();\n if (reason && reason.length > 0) return { available: false, reason };\n const rate = summary.pregnancyLossPct;\n if (typeof rate !== 'number' || !Number.isFinite(rate)) return { available: false, reason: null };\n return { available: true, ratePct: rate };\n}\n\n// ── 3. trend + export ─────────────────────────────────────────────────────────\n\n/** Buckets in chronological order. The backend already sorts; this makes the chart independent. */\nexport function orderedFertilityBuckets(buckets: readonly FertilityBucket[]): FertilityBucket[] {\n return [...buckets].sort((a, b) => a.bucket.localeCompare(b.bucket));\n}\n\nexport interface FertilityCsvInput {\n services: number;\n conceived: number;\n conceptionRatePct: number | null;\n deliveries: number;\n trend: readonly FertilityBucket[];\n}\n\n/** Column order for {@link fertilityCsvRows}. Exported so the card and the test cannot drift. */\nexport const FERTILITY_CSV_HEADERS = ['Period', 'Services', 'Conceived', 'Conception rate %', 'Deliveries'] as const;\n\n/**\n * CSV rows for the fertility card: the window total first, then each bucket.\n *\n * The total leads because it is the figure the card headlines and the one a reader checks first.\n *\n * The total is computed by the backend over the same window-scoped services the buckets are built\n * from, so it should agree with their sum. It is emitted anyway rather than left to be re-derived:\n * a reader opening the export wants the headline rate without adding up twelve rows, and a\n * disagreement — were the two ever to drift apart — is then visible instead of silent.\n *\n * An unmeasured rate exports as an empty cell, never as `0` — a spreadsheet will average a zero.\n */\nexport function fertilityCsvRows(input: FertilityCsvInput): (string | number)[][] {\n const pct = (v: number | null): string | number => (typeof v === 'number' && Number.isFinite(v) ? v : '');\n return [\n ['Total (all services in window)', input.services, input.conceived, pct(input.conceptionRatePct), input.deliveries],\n ...orderedFertilityBuckets(input.trend).map((b) => [\n b.bucket,\n b.services,\n b.conceived,\n pct(b.conceptionRatePct),\n b.deliveries,\n ]),\n ];\n}\n\n// ── due-soon ──────────────────────────────────────────────────────────────────\n\n/**\n * How urgently a pregnancy needs attention.\n *\n * Purely a presentation band; the backend already excludes DELIVERED and FAILED records, so every\n * row here is a birth that has not happened yet. `OVERDUE` cannot occur from the current backend\n * (it drops negative `daysUntilDue`) but is handled rather than trusted — a due date that has\n * passed is precisely the row a farmer most needs to see, and silently dropping it into the\n * \"later\" bucket would bury it.\n */\nexport type DueSoonUrgency = 'OVERDUE' | 'IMMINENT' | 'SOON' | 'LATER';\n\nexport function dueSoonUrgency(daysUntilDue: number): DueSoonUrgency {\n if (!Number.isFinite(daysUntilDue) || daysUntilDue < 0) return 'OVERDUE';\n if (daysUntilDue <= 7) return 'IMMINENT';\n if (daysUntilDue <= 14) return 'SOON';\n return 'LATER';\n}\n\n/** Label for a due-soon row's urgency, for the caller's `t()`. */\nexport function dueSoonUrgencyText(urgency: DueSoonUrgency): TranslatableText {\n switch (urgency) {\n case 'OVERDUE':\n return { key: 'healthybowl.livestock.fertility.due.overdue', defaultValue: 'Overdue' };\n case 'IMMINENT':\n return { key: 'healthybowl.livestock.fertility.due.imminent', defaultValue: 'Within a week' };\n case 'SOON':\n return { key: 'healthybowl.livestock.fertility.due.soon', defaultValue: 'Within a fortnight' };\n default:\n return { key: 'healthybowl.livestock.fertility.due.later', defaultValue: 'Later this month' };\n }\n}\n\n/**\n * Soonest first — the ordering a farmer plans around.\n *\n * A non-finite `daysUntilDue` sorts to the TOP, not to wherever the comparator happens to leave it.\n * {@link dueSoonUrgency} already labels such a row `OVERDUE`, so leaving the sort to return `NaN`\n * would print \"Overdue\" against a row sitting arbitrarily in the middle of the list — the one row\n * that most needs to be first, placed by chance.\n */\nexport function orderedDueSoon(rows: readonly DueSoonRow[]): DueSoonRow[] {\n const rank = (n: number): number => (Number.isFinite(n) ? n : Number.NEGATIVE_INFINITY);\n return [...rows].sort((a, b) => rank(a.daysUntilDue) - rank(b.daysUntilDue));\n}\n"],"mappings":";AAwEA,SAAgB,EAAiB,GAAmC;CAClE,IAAM,KAAY,MAA0C,OAAO,KAAM,YAAY,IAAI;AACzF,QACE,EAAS,EAAM,SAAS,IACxB,EAAS,EAAM,WAAW,IAC1B,EAAS,EAAM,iBAAiB,IAChC,EAAM,eAAe,KACrB,EAAM,aAAa;;AAiBvB,SAAgB,EAAuB,GAIZ;CACzB,IAAM,IAAS,EAAQ,kCAAkC,MAAM;AAC/D,KAAI,KAAU,EAAO,SAAS,EAAG,QAAO;EAAE,WAAW;EAAO;EAAQ;CACpE,IAAM,IAAO,EAAQ;AACrB,KAAI,OAAO,KAAS,YAAY,CAAC,OAAO,SAAS,EAAK,CAAE,QAAO;EAAE,WAAW;EAAO,QAAQ;EAAM;CACjG,IAAM,IAAS,EAAQ;AACvB,QAAO;EACL,WAAW;EACX,UAAU;EACV,YAAY,OAAO,KAAW,YAAY,OAAO,SAAS,EAAO,GAAG,IAAS;EAC9E;;AAgBH,SAAgB,EAAqB,GAGZ;CACvB,IAAM,IAAS,EAAQ,gCAAgC,MAAM;AAC7D,KAAI,KAAU,EAAO,SAAS,EAAG,QAAO;EAAE,WAAW;EAAO;EAAQ;CACpE,IAAM,IAAO,EAAQ;AAErB,QADI,OAAO,KAAS,YAAY,CAAC,OAAO,SAAS,EAAK,GAAS;EAAE,WAAW;EAAO,QAAQ;EAAM,GAC1F;EAAE,WAAW;EAAM,SAAS;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ff HealthyBowl Microfrontend - Comprehensive organic farming and agro-foods management platform",
5
5
  "type": "module",
6
6
  "files": [