@burdenoff/microfe-ecoimpacthub 2026.704.4 → 2026.704.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.
Files changed (47) hide show
  1. package/dist/ecoimpacthub/pages/DashboardPage.js +345 -189
  2. package/dist/ecoimpacthub/pages/DashboardPage.js.map +1 -1
  3. package/dist/ecoimpacthub/pages/_shared/ConservationBadge.js +58 -0
  4. package/dist/ecoimpacthub/pages/_shared/ConservationBadge.js.map +1 -0
  5. package/dist/ecoimpacthub/pages/_shared/EvidenceThumb.js +70 -0
  6. package/dist/ecoimpacthub/pages/_shared/EvidenceThumb.js.map +1 -0
  7. package/dist/ecoimpacthub/pages/_shared/MethodBadge.js +51 -0
  8. package/dist/ecoimpacthub/pages/_shared/MethodBadge.js.map +1 -0
  9. package/dist/ecoimpacthub/pages/_shared/TaxonChip.js +29 -0
  10. package/dist/ecoimpacthub/pages/_shared/TaxonChip.js.map +1 -0
  11. package/dist/ecoimpacthub/pages/badges.js +71 -0
  12. package/dist/ecoimpacthub/pages/badges.js.map +1 -0
  13. package/dist/ecoimpacthub/pages/carbon/CarbonPage.js +337 -300
  14. package/dist/ecoimpacthub/pages/carbon/CarbonPage.js.map +1 -1
  15. package/dist/ecoimpacthub/pages/carbonVisuals.js +89 -0
  16. package/dist/ecoimpacthub/pages/carbonVisuals.js.map +1 -0
  17. package/dist/ecoimpacthub/pages/habitat/HabitatProjectDetailPage.js +252 -218
  18. package/dist/ecoimpacthub/pages/habitat/HabitatProjectDetailPage.js.map +1 -1
  19. package/dist/ecoimpacthub/pages/habitat/HabitatProjectsPage.js +15 -12
  20. package/dist/ecoimpacthub/pages/habitat/HabitatProjectsPage.js.map +1 -1
  21. package/dist/ecoimpacthub/pages/habitat/LifecycleProgress.js +168 -0
  22. package/dist/ecoimpacthub/pages/habitat/LifecycleProgress.js.map +1 -0
  23. package/dist/ecoimpacthub/pages/monitoring/MonitoringPage.js +30 -17
  24. package/dist/ecoimpacthub/pages/monitoring/MonitoringPage.js.map +1 -1
  25. package/dist/ecoimpacthub/pages/observations/ObservationsPage.js +236 -219
  26. package/dist/ecoimpacthub/pages/observations/ObservationsPage.js.map +1 -1
  27. package/dist/ecoimpacthub/pages/reports/ReportDetailPage.js +248 -212
  28. package/dist/ecoimpacthub/pages/reports/ReportDetailPage.js.map +1 -1
  29. package/dist/ecoimpacthub/pages/reports/ReportsPage.js +119 -118
  30. package/dist/ecoimpacthub/pages/reports/ReportsPage.js.map +1 -1
  31. package/dist/ecoimpacthub/pages/sites/SiteDetailPage.js +498 -370
  32. package/dist/ecoimpacthub/pages/sites/SiteDetailPage.js.map +1 -1
  33. package/dist/ecoimpacthub/pages/sites/SitesPage.js +109 -99
  34. package/dist/ecoimpacthub/pages/sites/SitesPage.js.map +1 -1
  35. package/dist/ecoimpacthub/pages/sites/siteTypeVisuals.js +64 -0
  36. package/dist/ecoimpacthub/pages/sites/siteTypeVisuals.js.map +1 -0
  37. package/dist/ecoimpacthub/pages/species/SpeciesDetailPage.js +275 -259
  38. package/dist/ecoimpacthub/pages/species/SpeciesDetailPage.js.map +1 -1
  39. package/dist/ecoimpacthub/pages/species/SpeciesPage.js +235 -177
  40. package/dist/ecoimpacthub/pages/species/SpeciesPage.js.map +1 -1
  41. package/dist/node_modules/recharts/es6/cartesian/CartesianGrid.js +305 -0
  42. package/dist/node_modules/recharts/es6/cartesian/CartesianGrid.js.map +1 -0
  43. package/dist/node_modules/recharts/es6/context/chartLayoutContext.js +44 -33
  44. package/dist/node_modules/recharts/es6/context/chartLayoutContext.js.map +1 -1
  45. package/dist/node_modules/recharts/es6/util/ChartUtils.js +31 -23
  46. package/dist/node_modules/recharts/es6/util/ChartUtils.js.map +1 -1
  47. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"SpeciesPage.js","names":[],"sources":["../../../../src/ecoimpacthub/pages/species/SpeciesPage.tsx"],"sourcesContent":["/**\n * Species — list, filter, and register tracked taxa.\n * @module ecoimpacthub/pages/species\n *\n * Reads `ecoListSpecies`; writes `ecoCreateSpecies`.\n */\n\nimport { useMemo, useState } from 'react';\nimport { Plus, Rabbit, Star } from 'lucide-react';\nimport {\n Button,\n Input,\n Label,\n Textarea,\n Select,\n SelectContent,\n SelectItem,\n SelectTrigger,\n SelectValue,\n ResponsiveDialog,\n ResponsiveDialogContent,\n ResponsiveDialogHeader,\n ResponsiveDialogTitle,\n ResponsiveDialogDescription,\n ResponsiveDialogFooter,\n} from '@burdenoff/fe-libs/ui';\nimport { PageLayout } from '../../components/PageLayout';\nimport { StatusBadge } from '../../components/StatusBadge';\nimport { DataTable, type Column } from '../../components/DataTable';\nimport { FilterTabs, type FilterOption } from '../../components/FilterTabs';\nimport { LoadingView, ErrorView } from '../../components/StateViews';\nimport { EmptyState } from '../../components/EmptyState';\nimport { Pagination } from '../../components/Pagination';\nimport { useEcoImpactHub } from '../../context';\nimport { useEcoSpecies, useEcoCreateSpecies, useCursorPager } from '../../hooks';\nimport { formatEnumLabel, formatRelativeTime } from '../../utils/formatters';\nimport type { EcoSpecies, EcoTaxonGroup, EcoConservationStatus } from '../../types';\n\nconst TAXON_GROUPS: EcoTaxonGroup[] = [\n 'MAMMAL',\n 'BIRD',\n 'REPTILE',\n 'AMPHIBIAN',\n 'FISH',\n 'INSECT',\n 'PLANT',\n 'FUNGI',\n 'OTHER',\n];\n\nconst CONSERVATION_STATUSES: EcoConservationStatus[] = [\n 'LEAST_CONCERN',\n 'NEAR_THREATENED',\n 'VULNERABLE',\n 'ENDANGERED',\n 'CRITICALLY_ENDANGERED',\n 'EXTINCT_IN_WILD',\n 'DATA_DEFICIENT',\n 'NOT_EVALUATED',\n];\n\nconst PRIORITY_FILTERS: FilterOption<'ALL' | 'PRIORITY'>[] = [\n { value: 'ALL', label: 'All species' },\n { value: 'PRIORITY', label: 'Priority only' },\n];\n\nconst PAGE_SIZE = 25;\n\ninterface CreateFormState {\n commonName: string;\n scientificName: string;\n taxonGroup: EcoTaxonGroup;\n conservationStatus: EcoConservationStatus;\n isPriority: boolean;\n description: string;\n}\n\nconst EMPTY_FORM: CreateFormState = {\n commonName: '',\n scientificName: '',\n taxonGroup: 'MAMMAL',\n conservationStatus: 'NOT_EVALUATED',\n isPriority: false,\n description: '',\n};\n\nexport function SpeciesPage() {\n const { navigateTo } = useEcoImpactHub();\n const [taxonGroup, setTaxonGroup] = useState<EcoTaxonGroup | 'ALL'>('ALL');\n const [conservationStatus, setConservationStatus] = useState<EcoConservationStatus | 'ALL'>(\n 'ALL'\n );\n const [priority, setPriority] = useState<'ALL' | 'PRIORITY'>('ALL');\n const pager = useCursorPager();\n const [dialogOpen, setDialogOpen] = useState(false);\n const [form, setForm] = useState<CreateFormState>(EMPTY_FORM);\n const [formError, setFormError] = useState<string | null>(null);\n\n const { data, isLoading, isError, refetch } = useEcoSpecies({\n taxonGroup: taxonGroup === 'ALL' ? undefined : taxonGroup,\n conservationStatus: conservationStatus === 'ALL' ? undefined : conservationStatus,\n priorityOnly: priority === 'PRIORITY' ? true : undefined,\n pagination: { limit: PAGE_SIZE, cursor: pager.cursor },\n });\n const createSpecies = useEcoCreateSpecies();\n\n const rows = useMemo(() => data?.items ?? [], [data]);\n\n const columns: Column<EcoSpecies>[] = [\n {\n key: 'name',\n header: 'Species',\n render: (s) => (\n <div>\n <p className=\"font-semibold text-text-primary\">{s.commonName}</p>\n {s.scientificName && (\n <p className=\"text-xs italic text-text-tertiary\">{s.scientificName}</p>\n )}\n </div>\n ),\n },\n {\n key: 'taxonGroup',\n header: 'Group',\n hideOnMobile: true,\n render: (s) => <span className=\"text-text-secondary\">{formatEnumLabel(s.taxonGroup)}</span>,\n },\n {\n key: 'conservationStatus',\n header: 'Conservation',\n render: (s) => <StatusBadge status={s.conservationStatus} />,\n },\n {\n key: 'priority',\n header: 'Priority',\n align: 'center',\n render: (s) =>\n s.isPriority ? (\n <span\n className=\"inline-flex justify-center text-status-warning-text\"\n title=\"Priority species\"\n >\n <Star className=\"h-4 w-4 fill-current\" />\n </span>\n ) : null,\n },\n {\n key: 'updated',\n header: 'Updated',\n align: 'right',\n hideOnMobile: true,\n render: (s) => <span className=\"text-text-tertiary\">{formatRelativeTime(s.updatedAt)}</span>,\n },\n ];\n\n const resetForm = () => {\n setForm(EMPTY_FORM);\n setFormError(null);\n };\n\n const handleCreate = async () => {\n if (!form.commonName.trim()) {\n setFormError('Common name is required.');\n return;\n }\n try {\n const created = await createSpecies.mutateAsync({\n commonName: form.commonName.trim(),\n scientificName: form.scientificName.trim() || null,\n taxonGroup: form.taxonGroup,\n conservationStatus: form.conservationStatus,\n isPriority: form.isPriority,\n description: form.description.trim() || null,\n });\n setDialogOpen(false);\n resetForm();\n navigateTo(`species/${created.id}`);\n } catch (err) {\n setFormError(err instanceof Error ? err.message : 'Failed to create species.');\n }\n };\n\n return (\n <PageLayout\n title=\"Species\"\n description=\"Tracked taxa — conservation status, priority focus & field observations.\"\n actions={\n <Button onClick={() => setDialogOpen(true)}>\n <Plus className=\"mr-1.5 h-4 w-4\" /> New species\n </Button>\n }\n >\n <div className=\"mb-5 flex flex-wrap items-center gap-3\">\n <FilterTabs\n options={PRIORITY_FILTERS}\n value={priority}\n onChange={(v) => {\n setPriority(v);\n pager.reset();\n }}\n />\n <Select\n value={taxonGroup}\n onValueChange={(v) => {\n setTaxonGroup(v as EcoTaxonGroup | 'ALL');\n pager.reset();\n }}\n >\n <SelectTrigger className=\"w-44\">\n <SelectValue placeholder=\"All groups\" />\n </SelectTrigger>\n <SelectContent>\n <SelectItem value=\"ALL\">All groups</SelectItem>\n {TAXON_GROUPS.map((t) => (\n <SelectItem key={t} value={t}>\n {formatEnumLabel(t)}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n <Select\n value={conservationStatus}\n onValueChange={(v) => {\n setConservationStatus(v as EcoConservationStatus | 'ALL');\n pager.reset();\n }}\n >\n <SelectTrigger className=\"w-52\">\n <SelectValue placeholder=\"All conservation\" />\n </SelectTrigger>\n <SelectContent>\n <SelectItem value=\"ALL\">All conservation</SelectItem>\n {CONSERVATION_STATUSES.map((c) => (\n <SelectItem key={c} value={c}>\n {formatEnumLabel(c)}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n </div>\n\n {isLoading ? (\n <LoadingView label=\"Loading species…\" />\n ) : isError ? (\n <ErrorView message=\"Couldn't load species.\" onRetry={() => refetch()} />\n ) : rows.length === 0 ? (\n <EmptyState\n illustration=\"empty-data\"\n icon={<Rabbit className=\"h-10 w-10\" />}\n title=\"No species yet\"\n description={\n taxonGroup === 'ALL' && conservationStatus === 'ALL' && priority === 'ALL'\n ? 'Register your first species to start logging field observations.'\n : 'No species match these filters.'\n }\n action={\n <Button onClick={() => setDialogOpen(true)}>\n <Plus className=\"mr-1.5 h-4 w-4\" /> New species\n </Button>\n }\n />\n ) : (\n <>\n <DataTable\n columns={columns}\n rows={rows}\n rowKey={(s) => s.id}\n onRowClick={(s) => navigateTo(`species/${s.id}`)}\n />\n <Pagination\n page={pager.page}\n pageSize={PAGE_SIZE}\n itemCount={rows.length}\n hasMore={data?.pageInfo?.hasMore ?? false}\n onPageChange={(target) => pager.onPageChange(target, data?.pageInfo?.cursor)}\n />\n </>\n )}\n\n <ResponsiveDialog\n open={dialogOpen}\n onOpenChange={(open) => {\n setDialogOpen(open);\n if (!open) resetForm();\n }}\n >\n <ResponsiveDialogContent>\n <ResponsiveDialogHeader>\n <ResponsiveDialogTitle>New species</ResponsiveDialogTitle>\n <ResponsiveDialogDescription>\n Register a taxon to track its conservation status and field observations.\n </ResponsiveDialogDescription>\n </ResponsiveDialogHeader>\n\n <div className=\"grid gap-4 py-2\">\n <div className=\"grid gap-2 sm:grid-cols-2\">\n <div className=\"grid gap-1.5\">\n <Label htmlFor=\"commonName\">Common name *</Label>\n <Input\n id=\"commonName\"\n value={form.commonName}\n onChange={(e) => setForm({ ...form, commonName: e.target.value })}\n placeholder=\"Indian Pangolin\"\n />\n </div>\n <div className=\"grid gap-1.5\">\n <Label htmlFor=\"scientificName\">Scientific name</Label>\n <Input\n id=\"scientificName\"\n value={form.scientificName}\n onChange={(e) => setForm({ ...form, scientificName: e.target.value })}\n placeholder=\"Manis crassicaudata\"\n />\n </div>\n </div>\n\n <div className=\"grid gap-2 sm:grid-cols-2\">\n <div className=\"grid gap-1.5\">\n <Label htmlFor=\"taxonGroup\">Taxon group</Label>\n <Select\n value={form.taxonGroup}\n onValueChange={(v) => setForm({ ...form, taxonGroup: v as EcoTaxonGroup })}\n >\n <SelectTrigger id=\"taxonGroup\">\n <SelectValue />\n </SelectTrigger>\n <SelectContent>\n {TAXON_GROUPS.map((t) => (\n <SelectItem key={t} value={t}>\n {formatEnumLabel(t)}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n </div>\n <div className=\"grid gap-1.5\">\n <Label htmlFor=\"conservationStatus\">Conservation status</Label>\n <Select\n value={form.conservationStatus}\n onValueChange={(v) =>\n setForm({ ...form, conservationStatus: v as EcoConservationStatus })\n }\n >\n <SelectTrigger id=\"conservationStatus\">\n <SelectValue />\n </SelectTrigger>\n <SelectContent>\n {CONSERVATION_STATUSES.map((c) => (\n <SelectItem key={c} value={c}>\n {formatEnumLabel(c)}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n </div>\n </div>\n\n <label className=\"flex items-center gap-2 text-sm text-text-primary\">\n <input\n type=\"checkbox\"\n checked={form.isPriority}\n onChange={(e) => setForm({ ...form, isPriority: e.target.checked })}\n className=\"h-4 w-4 rounded border-border-seam accent-action-primary-bg\"\n />\n Mark as priority species\n </label>\n\n <div className=\"grid gap-1.5\">\n <Label htmlFor=\"description\">Description</Label>\n <Textarea\n id=\"description\"\n value={form.description}\n onChange={(e) => setForm({ ...form, description: e.target.value })}\n placeholder=\"Optional notes on habitat, range or identification.\"\n rows={2}\n />\n </div>\n\n {formError && <p className=\"text-sm text-status-error-text\">{formError}</p>}\n </div>\n\n <ResponsiveDialogFooter>\n <Button variant=\"outline\" onClick={() => setDialogOpen(false)}>\n Cancel\n </Button>\n <Button onClick={handleCreate} disabled={createSpecies.isPending}>\n {createSpecies.isPending ? 'Creating…' : 'Create species'}\n </Button>\n </ResponsiveDialogFooter>\n </ResponsiveDialogContent>\n </ResponsiveDialog>\n </PageLayout>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAsCA,IAAM,IAAgC;CACpC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD,EAEK,IAAiD;CACrD;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD,EAEK,IAAuD,CAC3D;CAAE,OAAO;CAAO,OAAO;CAAe,EACtC;CAAE,OAAO;CAAY,OAAO;CAAiB,CAC9C,EAEK,IAAY,IAWZ,IAA8B;CAClC,YAAY;CACZ,gBAAgB;CAChB,YAAY;CACZ,oBAAoB;CACpB,YAAY;CACZ,aAAa;CACd;AAED,SAAgB,IAAc;CAC5B,IAAM,EAAE,kBAAe,GAAiB,EAClC,CAAC,GAAY,KAAiB,EAAgC,MAAM,EACpE,CAAC,GAAoB,KAAyB,EAClD,MACD,EACK,CAAC,GAAU,KAAe,EAA6B,MAAM,EAC7D,IAAQ,IAAgB,EACxB,CAAC,GAAY,KAAiB,EAAS,GAAM,EAC7C,CAAC,GAAM,KAAW,EAA0B,EAAW,EACvD,CAAC,GAAW,KAAgB,EAAwB,KAAK,EAEzD,EAAE,SAAM,eAAW,aAAS,gBAAY,EAAc;EAC1D,YAAY,MAAe,QAAQ,KAAA,IAAY;EAC/C,oBAAoB,MAAuB,QAAQ,KAAA,IAAY;EAC/D,cAAc,MAAa,aAAa,KAAO,KAAA;EAC/C,YAAY;GAAE,OAAO;GAAW,QAAQ,EAAM;GAAQ;EACvD,CAAC,EACI,IAAgB,GAAqB,EAErC,IAAO,QAAc,GAAM,SAAS,EAAE,EAAE,CAAC,EAAK,CAAC,EAE/C,KAAgC;EACpC;GACE,KAAK;GACL,QAAQ;GACR,SAAS,MACP,kBAAC,OAAD,EAAA,UAAA,CACE,kBAAC,KAAD;IAAG,WAAU;cAAmC,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;AAC3B,UAAa,2BAA2B;AACxC;;AAEF,WAAI;QACF,IAAM,IAAU,MAAM,EAAc,YAAY;SAC9C,YAAY,EAAK,WAAW,MAAM;SAClC,gBAAgB,EAAK,eAAe,MAAM,IAAI;SAC9C,YAAY,EAAK;SACjB,oBAAoB,EAAK;SACzB,YAAY,EAAK;SACjB,aAAa,EAAK,YAAY,MAAM,IAAI;SACzC,CAAC;AAGF,QAFA,EAAc,GAAM,EACpB,GAAW,EACX,EAAW,WAAW,EAAQ,KAAK;gBAC5B,GAAK;AACZ,UAAa,aAAe,QAAQ,EAAI,UAAU,4BAA4B;;;MA+MzC,UAAU,EAAc;gBACpD,EAAc,YAAY,cAAc;MAClC,CAAA,CACc,EAAA,CAAA;KACD,EAAA,CAAA;IACT,CAAA;GACR"}
1
+ {"version":3,"file":"SpeciesPage.js","names":[],"sources":["../../../../src/ecoimpacthub/pages/species/SpeciesPage.tsx"],"sourcesContent":["/**\n * Species — list, filter, and register tracked taxa.\n * @module ecoimpacthub/pages/species\n *\n * Reads `ecoListSpecies`; writes `ecoCreateSpecies`.\n */\n\nimport { useMemo, useState } from 'react';\nimport { Plus, Rabbit, Search, Star } from 'lucide-react';\nimport {\n Button,\n GlassCard,\n Input,\n Label,\n Textarea,\n Select,\n SelectContent,\n SelectItem,\n SelectTrigger,\n SelectValue,\n ResponsiveDialog,\n ResponsiveDialogContent,\n ResponsiveDialogHeader,\n ResponsiveDialogTitle,\n ResponsiveDialogDescription,\n ResponsiveDialogFooter,\n} from '@burdenoff/fe-libs/ui';\nimport { PageLayout } from '../../components/PageLayout';\nimport { DataTable, type Column } from '../../components/DataTable';\nimport { FilterTabs, type FilterOption } from '../../components/FilterTabs';\nimport { LoadingView, ErrorView } from '../../components/StateViews';\nimport { EmptyState } from '../../components/EmptyState';\nimport { Pagination } from '../../components/Pagination';\nimport { ConservationBadge } from '../_shared/ConservationBadge';\nimport { TaxonChip } from '../_shared/TaxonChip';\nimport { useEcoImpactHub } from '../../context';\nimport { useEcoSpecies, useEcoCreateSpecies, useCursorPager } from '../../hooks';\nimport { formatEnumLabel, formatRelativeTime } from '../../utils/formatters';\nimport type { EcoSpecies, EcoTaxonGroup, EcoConservationStatus } from '../../types';\n\nconst TAXON_GROUPS: EcoTaxonGroup[] = [\n 'MAMMAL',\n 'BIRD',\n 'REPTILE',\n 'AMPHIBIAN',\n 'FISH',\n 'INSECT',\n 'PLANT',\n 'FUNGI',\n 'OTHER',\n];\n\nconst CONSERVATION_STATUSES: EcoConservationStatus[] = [\n 'LEAST_CONCERN',\n 'NEAR_THREATENED',\n 'VULNERABLE',\n 'ENDANGERED',\n 'CRITICALLY_ENDANGERED',\n 'EXTINCT_IN_WILD',\n 'DATA_DEFICIENT',\n 'NOT_EVALUATED',\n];\n\nconst PRIORITY_FILTERS: FilterOption<'ALL' | 'PRIORITY'>[] = [\n { value: 'ALL', label: 'All species' },\n { value: 'PRIORITY', label: 'Priority only' },\n];\n\nconst PAGE_SIZE = 25;\n\ninterface CreateFormState {\n commonName: string;\n scientificName: string;\n taxonGroup: EcoTaxonGroup;\n conservationStatus: EcoConservationStatus;\n isPriority: boolean;\n description: string;\n}\n\nconst EMPTY_FORM: CreateFormState = {\n commonName: '',\n scientificName: '',\n taxonGroup: 'MAMMAL',\n conservationStatus: 'NOT_EVALUATED',\n isPriority: false,\n description: '',\n};\n\nexport function SpeciesPage() {\n const { navigateTo } = useEcoImpactHub();\n const [taxonGroup, setTaxonGroup] = useState<EcoTaxonGroup | 'ALL'>('ALL');\n const [conservationStatus, setConservationStatus] = useState<EcoConservationStatus | 'ALL'>(\n 'ALL'\n );\n const [priority, setPriority] = useState<'ALL' | 'PRIORITY'>('ALL');\n const [search, setSearch] = useState('');\n const pager = useCursorPager();\n const [dialogOpen, setDialogOpen] = useState(false);\n const [form, setForm] = useState<CreateFormState>(EMPTY_FORM);\n const [formError, setFormError] = useState<string | null>(null);\n\n const { data, isLoading, isError, refetch } = useEcoSpecies({\n taxonGroup: taxonGroup === 'ALL' ? undefined : taxonGroup,\n conservationStatus: conservationStatus === 'ALL' ? undefined : conservationStatus,\n priorityOnly: priority === 'PRIORITY' ? true : undefined,\n pagination: { limit: PAGE_SIZE, cursor: pager.cursor },\n });\n const createSpecies = useEcoCreateSpecies();\n\n const rows = useMemo(() => data?.items ?? [], [data]);\n\n const query = search.trim().toLowerCase();\n const visibleRows = useMemo(() => {\n if (!query) return rows;\n return rows.filter(\n (s) =>\n s.commonName.toLowerCase().includes(query) ||\n (s.scientificName?.toLowerCase().includes(query) ?? false)\n );\n }, [rows, query]);\n\n const columns: Column<EcoSpecies>[] = [\n {\n key: 'name',\n header: 'Species',\n render: (s) => (\n <div className=\"min-w-0\">\n <p className=\"font-semibold text-text-primary\">{s.commonName}</p>\n {s.scientificName && (\n <p className=\"truncate text-xs italic text-text-tertiary\">{s.scientificName}</p>\n )}\n </div>\n ),\n },\n {\n key: 'taxonGroup',\n header: 'Taxon',\n hideOnMobile: true,\n render: (s) => <TaxonChip group={s.taxonGroup} />,\n },\n {\n key: 'conservationStatus',\n header: 'Conservation status',\n render: (s) => <ConservationBadge status={s.conservationStatus} />,\n },\n {\n key: 'priority',\n header: 'Priority',\n align: 'center',\n render: (s) =>\n s.isPriority ? (\n <span\n className=\"inline-flex items-center justify-center gap-1 rounded-full bg-status-warning-bg-subtle px-2 py-0.5 text-status-warning-text\"\n title=\"Priority species\"\n >\n <Star className=\"h-3.5 w-3.5 fill-current\" />\n </span>\n ) : (\n <span className=\"text-text-tertiary\" title=\"Not prioritised\">\n —\n </span>\n ),\n },\n {\n key: 'updated',\n header: 'Updated',\n align: 'right',\n hideOnMobile: true,\n render: (s) => (\n <span className=\"whitespace-nowrap text-text-tertiary\">\n {formatRelativeTime(s.updatedAt)}\n </span>\n ),\n },\n ];\n\n const resetForm = () => {\n setForm(EMPTY_FORM);\n setFormError(null);\n };\n\n const handleCreate = async () => {\n if (!form.commonName.trim()) {\n setFormError('Common name is required.');\n return;\n }\n try {\n const created = await createSpecies.mutateAsync({\n commonName: form.commonName.trim(),\n scientificName: form.scientificName.trim() || null,\n taxonGroup: form.taxonGroup,\n conservationStatus: form.conservationStatus,\n isPriority: form.isPriority,\n description: form.description.trim() || null,\n });\n setDialogOpen(false);\n resetForm();\n navigateTo(`species/${created.id}`);\n } catch (err) {\n setFormError(err instanceof Error ? err.message : 'Failed to create species.');\n }\n };\n\n return (\n <PageLayout\n title=\"Species\"\n description=\"Tracked taxa — conservation status, priority focus & field observations.\"\n actions={\n <Button onClick={() => setDialogOpen(true)}>\n <Plus className=\"mr-1.5 h-4 w-4\" /> New species\n </Button>\n }\n >\n <GlassCard treatment=\"plain\" className=\"mb-5 p-4\">\n <div className=\"flex flex-col gap-3 lg:flex-row lg:items-end lg:justify-between\">\n <div className=\"flex flex-wrap items-end gap-3\">\n <div className=\"grid gap-1.5\">\n <span className=\"text-xs font-medium uppercase tracking-wide text-text-tertiary\">\n Taxon group\n </span>\n <Select\n value={taxonGroup}\n onValueChange={(v) => {\n setTaxonGroup(v as EcoTaxonGroup | 'ALL');\n pager.reset();\n }}\n >\n <SelectTrigger className=\"w-44\">\n <SelectValue placeholder=\"All groups\" />\n </SelectTrigger>\n <SelectContent>\n <SelectItem value=\"ALL\">All groups</SelectItem>\n {TAXON_GROUPS.map((t) => (\n <SelectItem key={t} value={t}>\n {formatEnumLabel(t)}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n </div>\n <div className=\"grid gap-1.5\">\n <span className=\"text-xs font-medium uppercase tracking-wide text-text-tertiary\">\n Conservation status\n </span>\n <Select\n value={conservationStatus}\n onValueChange={(v) => {\n setConservationStatus(v as EcoConservationStatus | 'ALL');\n pager.reset();\n }}\n >\n <SelectTrigger className=\"w-52\">\n <SelectValue placeholder=\"All conservation\" />\n </SelectTrigger>\n <SelectContent>\n <SelectItem value=\"ALL\">All conservation</SelectItem>\n {CONSERVATION_STATUSES.map((c) => (\n <SelectItem key={c} value={c}>\n {formatEnumLabel(c)}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n </div>\n <div className=\"grid gap-1.5\">\n <span className=\"text-xs font-medium uppercase tracking-wide text-text-tertiary\">\n Search this page\n </span>\n <div className=\"relative\">\n <Search className=\"pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-text-tertiary\" />\n <Input\n value={search}\n onChange={(e) => setSearch(e.target.value)}\n placeholder=\"Common or scientific name…\"\n className=\"w-full pl-9 sm:w-64\"\n aria-label=\"Search loaded species by name\"\n />\n </div>\n </div>\n </div>\n <FilterTabs\n options={PRIORITY_FILTERS}\n value={priority}\n onChange={(v) => {\n setPriority(v);\n pager.reset();\n }}\n />\n </div>\n </GlassCard>\n\n {isLoading ? (\n <LoadingView label=\"Loading species…\" />\n ) : isError ? (\n <ErrorView message=\"Couldn't load species.\" onRetry={() => refetch()} />\n ) : rows.length === 0 ? (\n <EmptyState\n illustration=\"empty-data\"\n icon={<Rabbit className=\"h-10 w-10\" />}\n title=\"No species yet\"\n description={\n taxonGroup === 'ALL' && conservationStatus === 'ALL' && priority === 'ALL'\n ? 'Register your first species to start logging field observations.'\n : 'No species match these filters.'\n }\n action={\n <Button onClick={() => setDialogOpen(true)}>\n <Plus className=\"mr-1.5 h-4 w-4\" /> New species\n </Button>\n }\n />\n ) : visibleRows.length === 0 ? (\n <EmptyState\n icon={<Search className=\"h-10 w-10\" />}\n title=\"No matches on this page\"\n description={`No species on this page match “${search.trim()}”. Clear the search or page through the catalog.`}\n action={\n <Button variant=\"outline\" onClick={() => setSearch('')}>\n Clear search\n </Button>\n }\n />\n ) : (\n <>\n <DataTable\n columns={columns}\n rows={visibleRows}\n rowKey={(s) => s.id}\n onRowClick={(s) => navigateTo(`species/${s.id}`)}\n />\n {query ? (\n <p className=\"mt-4 text-sm text-text-secondary tabular-nums\">\n {visibleRows.length} of {rows.length} on this page match “{search.trim()}”\n </p>\n ) : (\n <Pagination\n page={pager.page}\n pageSize={PAGE_SIZE}\n itemCount={rows.length}\n hasMore={data?.pageInfo?.hasMore ?? false}\n onPageChange={(target) => pager.onPageChange(target, data?.pageInfo?.cursor)}\n />\n )}\n </>\n )}\n\n <ResponsiveDialog\n open={dialogOpen}\n onOpenChange={(open) => {\n setDialogOpen(open);\n if (!open) resetForm();\n }}\n >\n <ResponsiveDialogContent>\n <ResponsiveDialogHeader>\n <ResponsiveDialogTitle>New species</ResponsiveDialogTitle>\n <ResponsiveDialogDescription>\n Register a taxon to track its conservation status and field observations.\n </ResponsiveDialogDescription>\n </ResponsiveDialogHeader>\n\n <div className=\"grid gap-4 py-2\">\n <div className=\"grid gap-2 sm:grid-cols-2\">\n <div className=\"grid gap-1.5\">\n <Label htmlFor=\"commonName\">Common name *</Label>\n <Input\n id=\"commonName\"\n value={form.commonName}\n onChange={(e) => setForm({ ...form, commonName: e.target.value })}\n placeholder=\"Indian Pangolin\"\n />\n </div>\n <div className=\"grid gap-1.5\">\n <Label htmlFor=\"scientificName\">Scientific name</Label>\n <Input\n id=\"scientificName\"\n value={form.scientificName}\n onChange={(e) => setForm({ ...form, scientificName: e.target.value })}\n placeholder=\"Manis crassicaudata\"\n />\n </div>\n </div>\n\n <div className=\"grid gap-2 sm:grid-cols-2\">\n <div className=\"grid gap-1.5\">\n <Label htmlFor=\"taxonGroup\">Taxon group</Label>\n <Select\n value={form.taxonGroup}\n onValueChange={(v) => setForm({ ...form, taxonGroup: v as EcoTaxonGroup })}\n >\n <SelectTrigger id=\"taxonGroup\">\n <SelectValue />\n </SelectTrigger>\n <SelectContent>\n {TAXON_GROUPS.map((t) => (\n <SelectItem key={t} value={t}>\n {formatEnumLabel(t)}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n </div>\n <div className=\"grid gap-1.5\">\n <Label htmlFor=\"conservationStatus\">Conservation status</Label>\n <Select\n value={form.conservationStatus}\n onValueChange={(v) =>\n setForm({ ...form, conservationStatus: v as EcoConservationStatus })\n }\n >\n <SelectTrigger id=\"conservationStatus\">\n <SelectValue />\n </SelectTrigger>\n <SelectContent>\n {CONSERVATION_STATUSES.map((c) => (\n <SelectItem key={c} value={c}>\n {formatEnumLabel(c)}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n </div>\n </div>\n\n <label className=\"flex items-center gap-2 text-sm text-text-primary\">\n <input\n type=\"checkbox\"\n checked={form.isPriority}\n onChange={(e) => setForm({ ...form, isPriority: e.target.checked })}\n className=\"h-4 w-4 rounded border-border-seam accent-action-primary-bg\"\n />\n Mark as priority species\n </label>\n\n <div className=\"grid gap-1.5\">\n <Label htmlFor=\"description\">Description</Label>\n <Textarea\n id=\"description\"\n value={form.description}\n onChange={(e) => setForm({ ...form, description: e.target.value })}\n placeholder=\"Optional notes on habitat, range or identification.\"\n rows={2}\n />\n </div>\n\n {formError && <p className=\"text-sm text-status-error-text\">{formError}</p>}\n </div>\n\n <ResponsiveDialogFooter>\n <Button variant=\"outline\" onClick={() => setDialogOpen(false)}>\n Cancel\n </Button>\n <Button onClick={handleCreate} disabled={createSpecies.isPending}>\n {createSpecies.isPending ? 'Creating…' : 'Create species'}\n </Button>\n </ResponsiveDialogFooter>\n </ResponsiveDialogContent>\n </ResponsiveDialog>\n </PageLayout>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAwCA,IAAM,IAAgC;CACpC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD,EAEK,IAAiD;CACrD;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD,EAEK,IAAuD,CAC3D;CAAE,OAAO;CAAO,OAAO;CAAe,EACtC;CAAE,OAAO;CAAY,OAAO;CAAiB,CAC9C,EAEK,IAAY,IAWZ,IAA8B;CAClC,YAAY;CACZ,gBAAgB;CAChB,YAAY;CACZ,oBAAoB;CACpB,YAAY;CACZ,aAAa;CACd;AAED,SAAgB,IAAc;CAC5B,IAAM,EAAE,kBAAe,GAAiB,EAClC,CAAC,GAAY,KAAiB,EAAgC,MAAM,EACpE,CAAC,GAAoB,KAAyB,EAClD,MACD,EACK,CAAC,GAAU,KAAe,EAA6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AAC;SACnE,WAAU;SACV,CAAA,EAAA,2BAEI;;OAER,kBAAC,OAAD;QAAK,WAAU;kBAAf,CACE,kBAAC,GAAD;SAAO,SAAQ;mBAAc;SAAmB,CAAA,EAChD,kBAAC,GAAD;SACE,IAAG;SACH,OAAO,EAAK;SACZ,WAAW,MAAM,EAAQ;UAAE,GAAG;UAAM,aAAa,EAAE,OAAO;UAAO,CAAC;SAClE,aAAY;SACZ,MAAM;SACN,CAAA,CACE;;OAEL,KAAa,kBAAC,KAAD;QAAG,WAAU;kBAAkC;QAAc,CAAA;OACvE;;KAEN,kBAAC,IAAD,EAAA,UAAA,CACE,kBAAC,GAAD;MAAQ,SAAQ;MAAU,eAAe,EAAc,GAAM;gBAAE;MAEtD,CAAA,EACT,kBAAC,GAAD;MAAQ,SA/QG,YAAY;AAC/B,WAAI,CAAC,EAAK,WAAW,MAAM,EAAE;AAC3B,UAAa,2BAA2B;AACxC;;AAEF,WAAI;QACF,IAAM,IAAU,MAAM,EAAc,YAAY;SAC9C,YAAY,EAAK,WAAW,MAAM;SAClC,gBAAgB,EAAK,eAAe,MAAM,IAAI;SAC9C,YAAY,EAAK;SACjB,oBAAoB,EAAK;SACzB,YAAY,EAAK;SACjB,aAAa,EAAK,YAAY,MAAM,IAAI;SACzC,CAAC;AAGF,QAFA,EAAc,GAAM,EACpB,GAAW,EACX,EAAW,WAAW,EAAQ,KAAK;gBAC5B,GAAK;AACZ,UAAa,aAAe,QAAQ,EAAI,UAAU,4BAA4B;;;MA6PzC,UAAU,EAAc;gBACpD,EAAc,YAAY,cAAc;MAClC,CAAA,CACc,EAAA,CAAA;KACD,EAAA,CAAA;IACT,CAAA;GACR"}
@@ -0,0 +1,305 @@
1
+ import { __toESM as e } from "../../../../_virtual/_rolldown/runtime.js";
2
+ import { require_isFunction as t } from "../../../lodash/isFunction.js";
3
+ import { isNumber as n } from "../util/DataUtils.js";
4
+ import { filterProps as r } from "../util/ReactUtils.js";
5
+ import { warn as i } from "../util/LogUtils.js";
6
+ import { getCoordinatesOfGrid as a, getTicksOfAxis as o } from "../util/ChartUtils.js";
7
+ import { useArbitraryXAxis as s, useChartHeight as c, useChartWidth as l, useOffset as u, useYAxisWithFiniteDomainOrRandom as d } from "../context/chartLayoutContext.js";
8
+ import { getTicks as f } from "./getTicks.js";
9
+ import { CartesianAxis as p } from "./CartesianAxis.js";
10
+ import m from "react";
11
+ //#region node_modules/recharts/es6/cartesian/CartesianGrid.js
12
+ var h = /* @__PURE__ */ e(t()), g = [
13
+ "x1",
14
+ "y1",
15
+ "x2",
16
+ "y2",
17
+ "key"
18
+ ], _ = ["offset"];
19
+ function v(e) {
20
+ "@babel/helpers - typeof";
21
+ return v = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
22
+ return typeof e;
23
+ } : function(e) {
24
+ return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
25
+ }, v(e);
26
+ }
27
+ function y(e, t) {
28
+ var n = Object.keys(e);
29
+ if (Object.getOwnPropertySymbols) {
30
+ var r = Object.getOwnPropertySymbols(e);
31
+ t && (r = r.filter(function(t) {
32
+ return Object.getOwnPropertyDescriptor(e, t).enumerable;
33
+ })), n.push.apply(n, r);
34
+ }
35
+ return n;
36
+ }
37
+ function b(e) {
38
+ for (var t = 1; t < arguments.length; t++) {
39
+ var n = arguments[t] == null ? {} : arguments[t];
40
+ t % 2 ? y(Object(n), !0).forEach(function(t) {
41
+ x(e, t, n[t]);
42
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : y(Object(n)).forEach(function(t) {
43
+ Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
44
+ });
45
+ }
46
+ return e;
47
+ }
48
+ function x(e, t, n) {
49
+ return t = S(t), t in e ? Object.defineProperty(e, t, {
50
+ value: n,
51
+ enumerable: !0,
52
+ configurable: !0,
53
+ writable: !0
54
+ }) : e[t] = n, e;
55
+ }
56
+ function S(e) {
57
+ var t = C(e, "string");
58
+ return v(t) == "symbol" ? t : t + "";
59
+ }
60
+ function C(e, t) {
61
+ if (v(e) != "object" || !e) return e;
62
+ var n = e[Symbol.toPrimitive];
63
+ if (n !== void 0) {
64
+ var r = n.call(e, t || "default");
65
+ if (v(r) != "object") return r;
66
+ throw TypeError("@@toPrimitive must return a primitive value.");
67
+ }
68
+ return (t === "string" ? String : Number)(e);
69
+ }
70
+ function w() {
71
+ return w = Object.assign ? Object.assign.bind() : function(e) {
72
+ for (var t = 1; t < arguments.length; t++) {
73
+ var n = arguments[t];
74
+ for (var r in n) Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r]);
75
+ }
76
+ return e;
77
+ }, w.apply(this, arguments);
78
+ }
79
+ function T(e, t) {
80
+ if (e == null) return {};
81
+ var n = E(e, t), r, i;
82
+ if (Object.getOwnPropertySymbols) {
83
+ var a = Object.getOwnPropertySymbols(e);
84
+ for (i = 0; i < a.length; i++) r = a[i], !(t.indexOf(r) >= 0) && Object.prototype.propertyIsEnumerable.call(e, r) && (n[r] = e[r]);
85
+ }
86
+ return n;
87
+ }
88
+ function E(e, t) {
89
+ if (e == null) return {};
90
+ var n = {};
91
+ for (var r in e) if (Object.prototype.hasOwnProperty.call(e, r)) {
92
+ if (t.indexOf(r) >= 0) continue;
93
+ n[r] = e[r];
94
+ }
95
+ return n;
96
+ }
97
+ var D = function(e) {
98
+ var t = e.fill;
99
+ if (!t || t === "none") return null;
100
+ var n = e.fillOpacity, r = e.x, i = e.y, a = e.width, o = e.height, s = e.ry;
101
+ return /* @__PURE__ */ m.createElement("rect", {
102
+ x: r,
103
+ y: i,
104
+ ry: s,
105
+ width: a,
106
+ height: o,
107
+ stroke: "none",
108
+ fill: t,
109
+ fillOpacity: n,
110
+ className: "recharts-cartesian-grid-bg"
111
+ });
112
+ };
113
+ function O(e, t) {
114
+ var n;
115
+ if (/* @__PURE__ */ m.isValidElement(e)) n = /* @__PURE__ */ m.cloneElement(e, t);
116
+ else if ((0, h.default)(e)) n = e(t);
117
+ else {
118
+ var i = t.x1, a = t.y1, o = t.x2, s = t.y2, c = t.key, l = r(T(t, g), !1);
119
+ l.offset;
120
+ var u = T(l, _);
121
+ n = /* @__PURE__ */ m.createElement("line", w({}, u, {
122
+ x1: i,
123
+ y1: a,
124
+ x2: o,
125
+ y2: s,
126
+ fill: "none",
127
+ key: c
128
+ }));
129
+ }
130
+ return n;
131
+ }
132
+ function k(e) {
133
+ var t = e.x, n = e.width, r = e.horizontal, i = r === void 0 ? !0 : r, a = e.horizontalPoints;
134
+ if (!i || !a || !a.length) return null;
135
+ var o = a.map(function(r, a) {
136
+ return O(i, b(b({}, e), {}, {
137
+ x1: t,
138
+ y1: r,
139
+ x2: t + n,
140
+ y2: r,
141
+ key: `line-${a}`,
142
+ index: a
143
+ }));
144
+ });
145
+ return /* @__PURE__ */ m.createElement("g", { className: "recharts-cartesian-grid-horizontal" }, o);
146
+ }
147
+ function A(e) {
148
+ var t = e.y, n = e.height, r = e.vertical, i = r === void 0 ? !0 : r, a = e.verticalPoints;
149
+ if (!i || !a || !a.length) return null;
150
+ var o = a.map(function(r, a) {
151
+ return O(i, b(b({}, e), {}, {
152
+ x1: r,
153
+ y1: t,
154
+ x2: r,
155
+ y2: t + n,
156
+ key: `line-${a}`,
157
+ index: a
158
+ }));
159
+ });
160
+ return /* @__PURE__ */ m.createElement("g", { className: "recharts-cartesian-grid-vertical" }, o);
161
+ }
162
+ function j(e) {
163
+ var t = e.horizontalFill, n = e.fillOpacity, r = e.x, i = e.y, a = e.width, o = e.height, s = e.horizontalPoints, c = e.horizontal;
164
+ if (!(c === void 0 || c) || !t || !t.length) return null;
165
+ var l = s.map(function(e) {
166
+ return Math.round(e + i - i);
167
+ }).sort(function(e, t) {
168
+ return e - t;
169
+ });
170
+ i !== l[0] && l.unshift(0);
171
+ var u = l.map(function(e, s) {
172
+ var c = l[s + 1] ? l[s + 1] - e : i + o - e;
173
+ if (c <= 0) return null;
174
+ var u = s % t.length;
175
+ return /* @__PURE__ */ m.createElement("rect", {
176
+ key: `react-${s}`,
177
+ y: e,
178
+ x: r,
179
+ height: c,
180
+ width: a,
181
+ stroke: "none",
182
+ fill: t[u],
183
+ fillOpacity: n,
184
+ className: "recharts-cartesian-grid-bg"
185
+ });
186
+ });
187
+ return /* @__PURE__ */ m.createElement("g", { className: "recharts-cartesian-gridstripes-horizontal" }, u);
188
+ }
189
+ function M(e) {
190
+ var t = e.vertical, n = t === void 0 ? !0 : t, r = e.verticalFill, i = e.fillOpacity, a = e.x, o = e.y, s = e.width, c = e.height, l = e.verticalPoints;
191
+ if (!n || !r || !r.length) return null;
192
+ var u = l.map(function(e) {
193
+ return Math.round(e + a - a);
194
+ }).sort(function(e, t) {
195
+ return e - t;
196
+ });
197
+ a !== u[0] && u.unshift(0);
198
+ var d = u.map(function(e, t) {
199
+ var n = u[t + 1] ? u[t + 1] - e : a + s - e;
200
+ if (n <= 0) return null;
201
+ var l = t % r.length;
202
+ return /* @__PURE__ */ m.createElement("rect", {
203
+ key: `react-${t}`,
204
+ x: e,
205
+ y: o,
206
+ width: n,
207
+ height: c,
208
+ stroke: "none",
209
+ fill: r[l],
210
+ fillOpacity: i,
211
+ className: "recharts-cartesian-grid-bg"
212
+ });
213
+ });
214
+ return /* @__PURE__ */ m.createElement("g", { className: "recharts-cartesian-gridstripes-vertical" }, d);
215
+ }
216
+ var N = function(e, t) {
217
+ var n = e.xAxis, r = e.width, i = e.height, s = e.offset;
218
+ return a(f(b(b(b({}, p.defaultProps), n), {}, {
219
+ ticks: o(n, !0),
220
+ viewBox: {
221
+ x: 0,
222
+ y: 0,
223
+ width: r,
224
+ height: i
225
+ }
226
+ })), s.left, s.left + s.width, t);
227
+ }, P = function(e, t) {
228
+ var n = e.yAxis, r = e.width, i = e.height, s = e.offset;
229
+ return a(f(b(b(b({}, p.defaultProps), n), {}, {
230
+ ticks: o(n, !0),
231
+ viewBox: {
232
+ x: 0,
233
+ y: 0,
234
+ width: r,
235
+ height: i
236
+ }
237
+ })), s.top, s.top + s.height, t);
238
+ }, F = {
239
+ horizontal: !0,
240
+ vertical: !0,
241
+ horizontalPoints: [],
242
+ verticalPoints: [],
243
+ stroke: "#ccc",
244
+ fill: "none",
245
+ verticalFill: [],
246
+ horizontalFill: []
247
+ };
248
+ function I(e) {
249
+ var t = l(), r = c(), a = u(), o = b(b({}, e), {}, {
250
+ stroke: e.stroke ?? F.stroke,
251
+ fill: e.fill ?? F.fill,
252
+ horizontal: e.horizontal ?? F.horizontal,
253
+ horizontalFill: e.horizontalFill ?? F.horizontalFill,
254
+ vertical: e.vertical ?? F.vertical,
255
+ verticalFill: e.verticalFill ?? F.verticalFill,
256
+ x: n(e.x) ? e.x : a.left,
257
+ y: n(e.y) ? e.y : a.top,
258
+ width: n(e.width) ? e.width : a.width,
259
+ height: n(e.height) ? e.height : a.height
260
+ }), f = o.x, p = o.y, g = o.width, _ = o.height, y = o.syncWithTicks, x = o.horizontalValues, S = o.verticalValues, C = s(), T = d();
261
+ if (!n(g) || g <= 0 || !n(_) || _ <= 0 || !n(f) || f !== +f || !n(p) || p !== +p) return null;
262
+ var E = o.verticalCoordinatesGenerator || N, O = o.horizontalCoordinatesGenerator || P, I = o.horizontalPoints, L = o.verticalPoints;
263
+ if ((!I || !I.length) && (0, h.default)(O)) {
264
+ var R = x && x.length, z = O({
265
+ yAxis: T ? b(b({}, T), {}, { ticks: R ? x : T.ticks }) : void 0,
266
+ width: t,
267
+ height: r,
268
+ offset: a
269
+ }, R ? !0 : y);
270
+ i(Array.isArray(z), `horizontalCoordinatesGenerator should return Array but instead it returned [${v(z)}]`), Array.isArray(z) && (I = z);
271
+ }
272
+ if ((!L || !L.length) && (0, h.default)(E)) {
273
+ var B = S && S.length, V = E({
274
+ xAxis: C ? b(b({}, C), {}, { ticks: B ? S : C.ticks }) : void 0,
275
+ width: t,
276
+ height: r,
277
+ offset: a
278
+ }, B ? !0 : y);
279
+ i(Array.isArray(V), `verticalCoordinatesGenerator should return Array but instead it returned [${v(V)}]`), Array.isArray(V) && (L = V);
280
+ }
281
+ return /* @__PURE__ */ m.createElement("g", { className: "recharts-cartesian-grid" }, /* @__PURE__ */ m.createElement(D, {
282
+ fill: o.fill,
283
+ fillOpacity: o.fillOpacity,
284
+ x: o.x,
285
+ y: o.y,
286
+ width: o.width,
287
+ height: o.height,
288
+ ry: o.ry
289
+ }), /* @__PURE__ */ m.createElement(k, w({}, o, {
290
+ offset: a,
291
+ horizontalPoints: I,
292
+ xAxis: C,
293
+ yAxis: T
294
+ })), /* @__PURE__ */ m.createElement(A, w({}, o, {
295
+ offset: a,
296
+ verticalPoints: L,
297
+ xAxis: C,
298
+ yAxis: T
299
+ })), /* @__PURE__ */ m.createElement(j, w({}, o, { horizontalPoints: I })), /* @__PURE__ */ m.createElement(M, w({}, o, { verticalPoints: L })));
300
+ }
301
+ I.displayName = "CartesianGrid";
302
+ //#endregion
303
+ export { I as CartesianGrid };
304
+
305
+ //# sourceMappingURL=CartesianGrid.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CartesianGrid.js","names":[],"sources":["../../../../../node_modules/recharts/es6/cartesian/CartesianGrid.js"],"sourcesContent":["var _excluded = [\"x1\", \"y1\", \"x2\", \"y2\", \"key\"],\n _excluded2 = [\"offset\"];\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } } return target; }\n/**\n * @fileOverview Cartesian Grid\n */\nimport React from 'react';\nimport isFunction from 'lodash/isFunction';\nimport { warn } from '../util/LogUtils';\nimport { isNumber } from '../util/DataUtils';\nimport { filterProps } from '../util/ReactUtils';\nimport { getCoordinatesOfGrid, getTicksOfAxis } from '../util/ChartUtils';\nimport { getTicks } from './getTicks';\nimport { CartesianAxis } from './CartesianAxis';\nimport { useArbitraryXAxis, useChartHeight, useChartWidth, useOffset, useYAxisWithFiniteDomainOrRandom } from '../context/chartLayoutContext';\n\n/**\n * The <CartesianGrid horizontal\n */\n\nvar Background = function Background(props) {\n var fill = props.fill;\n if (!fill || fill === 'none') {\n return null;\n }\n var fillOpacity = props.fillOpacity,\n x = props.x,\n y = props.y,\n width = props.width,\n height = props.height,\n ry = props.ry;\n return /*#__PURE__*/React.createElement(\"rect\", {\n x: x,\n y: y,\n ry: ry,\n width: width,\n height: height,\n stroke: \"none\",\n fill: fill,\n fillOpacity: fillOpacity,\n className: \"recharts-cartesian-grid-bg\"\n });\n};\nfunction renderLineItem(option, props) {\n var lineItem;\n if ( /*#__PURE__*/React.isValidElement(option)) {\n // @ts-expect-error typescript does not see the props type when cloning an element\n lineItem = /*#__PURE__*/React.cloneElement(option, props);\n } else if (isFunction(option)) {\n lineItem = option(props);\n } else {\n var x1 = props.x1,\n y1 = props.y1,\n x2 = props.x2,\n y2 = props.y2,\n key = props.key,\n others = _objectWithoutProperties(props, _excluded);\n var _filterProps = filterProps(others, false),\n __ = _filterProps.offset,\n restOfFilteredProps = _objectWithoutProperties(_filterProps, _excluded2);\n lineItem = /*#__PURE__*/React.createElement(\"line\", _extends({}, restOfFilteredProps, {\n x1: x1,\n y1: y1,\n x2: x2,\n y2: y2,\n fill: \"none\",\n key: key\n }));\n }\n return lineItem;\n}\nfunction HorizontalGridLines(props) {\n var x = props.x,\n width = props.width,\n _props$horizontal = props.horizontal,\n horizontal = _props$horizontal === void 0 ? true : _props$horizontal,\n horizontalPoints = props.horizontalPoints;\n if (!horizontal || !horizontalPoints || !horizontalPoints.length) {\n return null;\n }\n var items = horizontalPoints.map(function (entry, i) {\n var lineItemProps = _objectSpread(_objectSpread({}, props), {}, {\n x1: x,\n y1: entry,\n x2: x + width,\n y2: entry,\n key: \"line-\".concat(i),\n index: i\n });\n return renderLineItem(horizontal, lineItemProps);\n });\n return /*#__PURE__*/React.createElement(\"g\", {\n className: \"recharts-cartesian-grid-horizontal\"\n }, items);\n}\nfunction VerticalGridLines(props) {\n var y = props.y,\n height = props.height,\n _props$vertical = props.vertical,\n vertical = _props$vertical === void 0 ? true : _props$vertical,\n verticalPoints = props.verticalPoints;\n if (!vertical || !verticalPoints || !verticalPoints.length) {\n return null;\n }\n var items = verticalPoints.map(function (entry, i) {\n var lineItemProps = _objectSpread(_objectSpread({}, props), {}, {\n x1: entry,\n y1: y,\n x2: entry,\n y2: y + height,\n key: \"line-\".concat(i),\n index: i\n });\n return renderLineItem(vertical, lineItemProps);\n });\n return /*#__PURE__*/React.createElement(\"g\", {\n className: \"recharts-cartesian-grid-vertical\"\n }, items);\n}\nfunction HorizontalStripes(props) {\n var horizontalFill = props.horizontalFill,\n fillOpacity = props.fillOpacity,\n x = props.x,\n y = props.y,\n width = props.width,\n height = props.height,\n horizontalPoints = props.horizontalPoints,\n _props$horizontal2 = props.horizontal,\n horizontal = _props$horizontal2 === void 0 ? true : _props$horizontal2;\n if (!horizontal || !horizontalFill || !horizontalFill.length) {\n return null;\n }\n\n // Why =y -y? I was trying to find any difference that this makes, with floating point numbers and edge cases but ... nothing.\n var roundedSortedHorizontalPoints = horizontalPoints.map(function (e) {\n return Math.round(e + y - y);\n }).sort(function (a, b) {\n return a - b;\n });\n // Why is this condition `!==` instead of `<=` ?\n if (y !== roundedSortedHorizontalPoints[0]) {\n roundedSortedHorizontalPoints.unshift(0);\n }\n var items = roundedSortedHorizontalPoints.map(function (entry, i) {\n // Why do we strip only the last stripe if it is invisible, and not all invisible stripes?\n var lastStripe = !roundedSortedHorizontalPoints[i + 1];\n var lineHeight = lastStripe ? y + height - entry : roundedSortedHorizontalPoints[i + 1] - entry;\n if (lineHeight <= 0) {\n return null;\n }\n var colorIndex = i % horizontalFill.length;\n return /*#__PURE__*/React.createElement(\"rect\", {\n key: \"react-\".concat(i) // eslint-disable-line react/no-array-index-key\n ,\n y: entry,\n x: x,\n height: lineHeight,\n width: width,\n stroke: \"none\",\n fill: horizontalFill[colorIndex],\n fillOpacity: fillOpacity,\n className: \"recharts-cartesian-grid-bg\"\n });\n });\n return /*#__PURE__*/React.createElement(\"g\", {\n className: \"recharts-cartesian-gridstripes-horizontal\"\n }, items);\n}\nfunction VerticalStripes(props) {\n var _props$vertical2 = props.vertical,\n vertical = _props$vertical2 === void 0 ? true : _props$vertical2,\n verticalFill = props.verticalFill,\n fillOpacity = props.fillOpacity,\n x = props.x,\n y = props.y,\n width = props.width,\n height = props.height,\n verticalPoints = props.verticalPoints;\n if (!vertical || !verticalFill || !verticalFill.length) {\n return null;\n }\n var roundedSortedVerticalPoints = verticalPoints.map(function (e) {\n return Math.round(e + x - x);\n }).sort(function (a, b) {\n return a - b;\n });\n if (x !== roundedSortedVerticalPoints[0]) {\n roundedSortedVerticalPoints.unshift(0);\n }\n var items = roundedSortedVerticalPoints.map(function (entry, i) {\n var lastStripe = !roundedSortedVerticalPoints[i + 1];\n var lineWidth = lastStripe ? x + width - entry : roundedSortedVerticalPoints[i + 1] - entry;\n if (lineWidth <= 0) {\n return null;\n }\n var colorIndex = i % verticalFill.length;\n return /*#__PURE__*/React.createElement(\"rect\", {\n key: \"react-\".concat(i) // eslint-disable-line react/no-array-index-key\n ,\n x: entry,\n y: y,\n width: lineWidth,\n height: height,\n stroke: \"none\",\n fill: verticalFill[colorIndex],\n fillOpacity: fillOpacity,\n className: \"recharts-cartesian-grid-bg\"\n });\n });\n return /*#__PURE__*/React.createElement(\"g\", {\n className: \"recharts-cartesian-gridstripes-vertical\"\n }, items);\n}\nvar defaultVerticalCoordinatesGenerator = function defaultVerticalCoordinatesGenerator(_ref, syncWithTicks) {\n var xAxis = _ref.xAxis,\n width = _ref.width,\n height = _ref.height,\n offset = _ref.offset;\n return getCoordinatesOfGrid(getTicks(_objectSpread(_objectSpread(_objectSpread({}, CartesianAxis.defaultProps), xAxis), {}, {\n ticks: getTicksOfAxis(xAxis, true),\n viewBox: {\n x: 0,\n y: 0,\n width: width,\n height: height\n }\n })), offset.left, offset.left + offset.width, syncWithTicks);\n};\nvar defaultHorizontalCoordinatesGenerator = function defaultHorizontalCoordinatesGenerator(_ref2, syncWithTicks) {\n var yAxis = _ref2.yAxis,\n width = _ref2.width,\n height = _ref2.height,\n offset = _ref2.offset;\n return getCoordinatesOfGrid(getTicks(_objectSpread(_objectSpread(_objectSpread({}, CartesianAxis.defaultProps), yAxis), {}, {\n ticks: getTicksOfAxis(yAxis, true),\n viewBox: {\n x: 0,\n y: 0,\n width: width,\n height: height\n }\n })), offset.top, offset.top + offset.height, syncWithTicks);\n};\nvar defaultProps = {\n horizontal: true,\n vertical: true,\n // The ordinates of horizontal grid lines\n horizontalPoints: [],\n // The abscissas of vertical grid lines\n verticalPoints: [],\n stroke: '#ccc',\n fill: 'none',\n // The fill of colors of grid lines\n verticalFill: [],\n horizontalFill: []\n};\nexport function CartesianGrid(props) {\n var _props$stroke, _props$fill, _props$horizontal3, _props$horizontalFill, _props$vertical3, _props$verticalFill;\n var chartWidth = useChartWidth();\n var chartHeight = useChartHeight();\n var offset = useOffset();\n var propsIncludingDefaults = _objectSpread(_objectSpread({}, props), {}, {\n stroke: (_props$stroke = props.stroke) !== null && _props$stroke !== void 0 ? _props$stroke : defaultProps.stroke,\n fill: (_props$fill = props.fill) !== null && _props$fill !== void 0 ? _props$fill : defaultProps.fill,\n horizontal: (_props$horizontal3 = props.horizontal) !== null && _props$horizontal3 !== void 0 ? _props$horizontal3 : defaultProps.horizontal,\n horizontalFill: (_props$horizontalFill = props.horizontalFill) !== null && _props$horizontalFill !== void 0 ? _props$horizontalFill : defaultProps.horizontalFill,\n vertical: (_props$vertical3 = props.vertical) !== null && _props$vertical3 !== void 0 ? _props$vertical3 : defaultProps.vertical,\n verticalFill: (_props$verticalFill = props.verticalFill) !== null && _props$verticalFill !== void 0 ? _props$verticalFill : defaultProps.verticalFill,\n x: isNumber(props.x) ? props.x : offset.left,\n y: isNumber(props.y) ? props.y : offset.top,\n width: isNumber(props.width) ? props.width : offset.width,\n height: isNumber(props.height) ? props.height : offset.height\n });\n var x = propsIncludingDefaults.x,\n y = propsIncludingDefaults.y,\n width = propsIncludingDefaults.width,\n height = propsIncludingDefaults.height,\n syncWithTicks = propsIncludingDefaults.syncWithTicks,\n horizontalValues = propsIncludingDefaults.horizontalValues,\n verticalValues = propsIncludingDefaults.verticalValues;\n\n // @ts-expect-error the scale prop is mixed up - we need to untagle this at some point\n var xAxis = useArbitraryXAxis();\n // @ts-expect-error the scale prop is mixed up - we need to untagle this at some point\n var yAxis = useYAxisWithFiniteDomainOrRandom();\n if (!isNumber(width) || width <= 0 || !isNumber(height) || height <= 0 || !isNumber(x) || x !== +x || !isNumber(y) || y !== +y) {\n return null;\n }\n\n /*\n * verticalCoordinatesGenerator and horizontalCoordinatesGenerator are defined\n * outside of the propsIncludingDefaults because they were never part of the original props\n * and they were never passed as a prop down to horizontal/vertical custom elements.\n * If we add these two to propsIncludingDefaults then we are changing public API.\n * Not a bad thing per se but also not necessary.\n */\n var verticalCoordinatesGenerator = propsIncludingDefaults.verticalCoordinatesGenerator || defaultVerticalCoordinatesGenerator;\n var horizontalCoordinatesGenerator = propsIncludingDefaults.horizontalCoordinatesGenerator || defaultHorizontalCoordinatesGenerator;\n var horizontalPoints = propsIncludingDefaults.horizontalPoints,\n verticalPoints = propsIncludingDefaults.verticalPoints;\n\n // No horizontal points are specified\n if ((!horizontalPoints || !horizontalPoints.length) && isFunction(horizontalCoordinatesGenerator)) {\n var isHorizontalValues = horizontalValues && horizontalValues.length;\n var generatorResult = horizontalCoordinatesGenerator({\n yAxis: yAxis ? _objectSpread(_objectSpread({}, yAxis), {}, {\n ticks: isHorizontalValues ? horizontalValues : yAxis.ticks\n }) : undefined,\n width: chartWidth,\n height: chartHeight,\n offset: offset\n }, isHorizontalValues ? true : syncWithTicks);\n warn(Array.isArray(generatorResult), \"horizontalCoordinatesGenerator should return Array but instead it returned [\".concat(_typeof(generatorResult), \"]\"));\n if (Array.isArray(generatorResult)) {\n horizontalPoints = generatorResult;\n }\n }\n\n // No vertical points are specified\n if ((!verticalPoints || !verticalPoints.length) && isFunction(verticalCoordinatesGenerator)) {\n var isVerticalValues = verticalValues && verticalValues.length;\n var _generatorResult = verticalCoordinatesGenerator({\n xAxis: xAxis ? _objectSpread(_objectSpread({}, xAxis), {}, {\n ticks: isVerticalValues ? verticalValues : xAxis.ticks\n }) : undefined,\n width: chartWidth,\n height: chartHeight,\n offset: offset\n }, isVerticalValues ? true : syncWithTicks);\n warn(Array.isArray(_generatorResult), \"verticalCoordinatesGenerator should return Array but instead it returned [\".concat(_typeof(_generatorResult), \"]\"));\n if (Array.isArray(_generatorResult)) {\n verticalPoints = _generatorResult;\n }\n }\n return /*#__PURE__*/React.createElement(\"g\", {\n className: \"recharts-cartesian-grid\"\n }, /*#__PURE__*/React.createElement(Background, {\n fill: propsIncludingDefaults.fill,\n fillOpacity: propsIncludingDefaults.fillOpacity,\n x: propsIncludingDefaults.x,\n y: propsIncludingDefaults.y,\n width: propsIncludingDefaults.width,\n height: propsIncludingDefaults.height,\n ry: propsIncludingDefaults.ry\n }), /*#__PURE__*/React.createElement(HorizontalGridLines, _extends({}, propsIncludingDefaults, {\n offset: offset,\n horizontalPoints: horizontalPoints,\n xAxis: xAxis,\n yAxis: yAxis\n })), /*#__PURE__*/React.createElement(VerticalGridLines, _extends({}, propsIncludingDefaults, {\n offset: offset,\n verticalPoints: verticalPoints,\n xAxis: xAxis,\n yAxis: yAxis\n })), /*#__PURE__*/React.createElement(HorizontalStripes, _extends({}, propsIncludingDefaults, {\n horizontalPoints: horizontalPoints\n })), /*#__PURE__*/React.createElement(VerticalStripes, _extends({}, propsIncludingDefaults, {\n verticalPoints: verticalPoints\n })));\n}\nCartesianGrid.displayName = 'CartesianGrid';"],"x_google_ignoreList":[0],"mappings":";;;;;;;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mB,EAA6B;GAClD,OAAO,IAAQ,EAAc,EAAc,EAAE,EAAE,EAAM,EAAE,EAAE,EAAE,EACzD,OAAO,IAAmB,IAAiB,EAAM,OAClD,CAAC,GAAG,KAAA;GACL,OAAO;GACP,QAAQ;GACA;GACT,EAAE,IAAmB,KAAO,EAAc;AAE3C,EADA,EAAK,MAAM,QAAQ,EAAiB,EAAE,6EAAoF,EAAQ,EAAiB,IAAO,EACtJ,MAAM,QAAQ,EAAiB,KACjC,IAAiB;;AAGrB,QAAoB,kBAAM,cAAc,KAAK,EAC3C,WAAW,2BACZ,EAAe,kBAAM,cAAc,GAAY;EAC9C,MAAM,EAAuB;EAC7B,aAAa,EAAuB;EACpC,GAAG,EAAuB;EAC1B,GAAG,EAAuB;EAC1B,OAAO,EAAuB;EAC9B,QAAQ,EAAuB;EAC/B,IAAI,EAAuB;EAC5B,CAAC,EAAe,kBAAM,cAAc,GAAqB,EAAS,EAAE,EAAE,GAAwB;EACrF;EACU;EACX;EACA;EACR,CAAC,CAAC,EAAe,kBAAM,cAAc,GAAmB,EAAS,EAAE,EAAE,GAAwB;EACpF;EACQ;EACT;EACA;EACR,CAAC,CAAC,EAAe,kBAAM,cAAc,GAAmB,EAAS,EAAE,EAAE,GAAwB,EAC1E,qBACnB,CAAC,CAAC,EAAe,kBAAM,cAAc,GAAiB,EAAS,EAAE,EAAE,GAAwB,EAC1E,mBACjB,CAAC,CAAC,CAAC;;AAEN,EAAc,cAAc"}
@@ -1,46 +1,57 @@
1
- import "../../../../_virtual/_rolldown/runtime.js";
2
- import { invariant as e } from "../../../tiny-invariant/dist/esm/tiny-invariant.js";
3
- import { require_every as t } from "../../../lodash/every.js";
4
- import { require_find as n } from "../../../lodash/find.js";
5
- import { calculateViewBox as r } from "../util/calculateViewBox.js";
6
- import i, { createContext as a, useContext as o } from "react";
7
- n(), t();
8
- function s(e) {
1
+ import { __toESM as e } from "../../../../_virtual/_rolldown/runtime.js";
2
+ import { getAnyElementOfObject as t } from "../util/DataUtils.js";
3
+ import { invariant as n } from "../../../tiny-invariant/dist/esm/tiny-invariant.js";
4
+ import { require_every as r } from "../../../lodash/every.js";
5
+ import { require_find as i } from "../../../lodash/find.js";
6
+ import { calculateViewBox as a } from "../util/calculateViewBox.js";
7
+ import o, { createContext as s, useContext as c } from "react";
8
+ //#region node_modules/recharts/es6/context/chartLayoutContext.js
9
+ var l = /* @__PURE__ */ e(i()), u = /* @__PURE__ */ e(r());
10
+ function d(e) {
9
11
  "@babel/helpers - typeof";
10
- return s = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
12
+ return d = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
11
13
  return typeof e;
12
14
  } : function(e) {
13
15
  return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
14
- }, s(e);
16
+ }, d(e);
15
17
  }
16
- var c = /* @__PURE__ */ a(void 0), l = /* @__PURE__ */ a(void 0), u = /* @__PURE__ */ a(void 0), d = /* @__PURE__ */ a({}), f = /* @__PURE__ */ a(void 0), p = /* @__PURE__ */ a(0), m = /* @__PURE__ */ a(0), h = function(e) {
17
- var t = e.state, n = t.xAxisMap, a = t.yAxisMap, o = t.offset, s = e.clipPathId, h = e.children, g = e.width, _ = e.height, v = r(o);
18
- return /* @__PURE__ */ i.createElement(c.Provider, { value: n }, /* @__PURE__ */ i.createElement(l.Provider, { value: a }, /* @__PURE__ */ i.createElement(d.Provider, { value: o }, /* @__PURE__ */ i.createElement(u.Provider, { value: v }, /* @__PURE__ */ i.createElement(f.Provider, { value: s }, /* @__PURE__ */ i.createElement(p.Provider, { value: _ }, /* @__PURE__ */ i.createElement(m.Provider, { value: g }, h)))))));
19
- }, g = function() {
20
- return o(f);
18
+ var f = /* @__PURE__ */ s(void 0), p = /* @__PURE__ */ s(void 0), m = /* @__PURE__ */ s(void 0), h = /* @__PURE__ */ s({}), g = /* @__PURE__ */ s(void 0), _ = /* @__PURE__ */ s(0), v = /* @__PURE__ */ s(0), y = function(e) {
19
+ var t = e.state, n = t.xAxisMap, r = t.yAxisMap, i = t.offset, s = e.clipPathId, c = e.children, l = e.width, u = e.height, d = a(i);
20
+ return /* @__PURE__ */ o.createElement(f.Provider, { value: n }, /* @__PURE__ */ o.createElement(p.Provider, { value: r }, /* @__PURE__ */ o.createElement(h.Provider, { value: i }, /* @__PURE__ */ o.createElement(m.Provider, { value: d }, /* @__PURE__ */ o.createElement(g.Provider, { value: s }, /* @__PURE__ */ o.createElement(_.Provider, { value: u }, /* @__PURE__ */ o.createElement(v.Provider, { value: l }, c)))))));
21
+ }, b = function() {
22
+ return c(g);
21
23
  };
22
- function _(e) {
24
+ function x(e) {
23
25
  var t = Object.keys(e);
24
26
  return t.length === 0 ? "There are no available ids." : `Available ids are: ${t}.`;
25
27
  }
26
- var v = function(t) {
27
- var n = o(c);
28
- n ?? (process.env.NODE_ENV === "production" ? e(!1) : e(!1, "Could not find Recharts context; are you sure this is rendered inside a Recharts wrapper component?"));
29
- var r = n[t];
30
- return r ?? (process.env.NODE_ENV === "production" ? e(!1) : e(!1, `Could not find xAxis by id "${t}" [${s(t)}]. ${_(n)}`)), r;
31
- }, y = function(t) {
32
- var n = o(l);
33
- n ?? (process.env.NODE_ENV === "production" ? e(!1) : e(!1, "Could not find Recharts context; are you sure this is rendered inside a Recharts wrapper component?"));
34
- var r = n[t];
35
- return r ?? (process.env.NODE_ENV === "production" ? e(!1) : e(!1, `Could not find yAxis by id "${t}" [${s(t)}]. ${_(n)}`)), r;
36
- }, b = function() {
37
- return o(u);
38
- }, x = function() {
39
- return o(m);
40
- }, S = function() {
41
- return o(p);
28
+ var S = function(e) {
29
+ var t = c(f);
30
+ t ?? (process.env.NODE_ENV === "production" ? n(!1) : n(!1, "Could not find Recharts context; are you sure this is rendered inside a Recharts wrapper component?"));
31
+ var r = t[e];
32
+ return r ?? (process.env.NODE_ENV === "production" ? n(!1) : n(!1, `Could not find xAxis by id "${e}" [${d(e)}]. ${x(t)}`)), r;
33
+ }, C = function() {
34
+ return t(c(f));
35
+ }, w = function() {
36
+ var e = c(p);
37
+ return (0, l.default)(e, function(e) {
38
+ return (0, u.default)(e.domain, Number.isFinite);
39
+ }) || t(e);
40
+ }, T = function(e) {
41
+ var t = c(p);
42
+ t ?? (process.env.NODE_ENV === "production" ? n(!1) : n(!1, "Could not find Recharts context; are you sure this is rendered inside a Recharts wrapper component?"));
43
+ var r = t[e];
44
+ return r ?? (process.env.NODE_ENV === "production" ? n(!1) : n(!1, `Could not find yAxis by id "${e}" [${d(e)}]. ${x(t)}`)), r;
45
+ }, E = function() {
46
+ return c(m);
47
+ }, D = function() {
48
+ return c(h);
49
+ }, O = function() {
50
+ return c(v);
51
+ }, k = function() {
52
+ return c(_);
42
53
  };
43
54
  //#endregion
44
- export { h as ChartLayoutContextProvider, S as useChartHeight, x as useChartWidth, g as useClipPathId, b as useViewBox, v as useXAxisOrThrow, y as useYAxisOrThrow };
55
+ export { y as ChartLayoutContextProvider, C as useArbitraryXAxis, k as useChartHeight, O as useChartWidth, b as useClipPathId, D as useOffset, E as useViewBox, S as useXAxisOrThrow, T as useYAxisOrThrow, w as useYAxisWithFiniteDomainOrRandom };
45
56
 
46
57
  //# sourceMappingURL=chartLayoutContext.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"chartLayoutContext.js","names":[],"sources":["../../../../../node_modules/recharts/es6/context/chartLayoutContext.js"],"sourcesContent":["function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nimport React, { createContext, useContext } from 'react';\nimport invariant from 'tiny-invariant';\nimport find from 'lodash/find';\nimport every from 'lodash/every';\nimport { calculateViewBox } from '../util/calculateViewBox';\nimport { getAnyElementOfObject } from '../util/DataUtils';\nexport var XAxisContext = /*#__PURE__*/createContext(undefined);\nexport var YAxisContext = /*#__PURE__*/createContext(undefined);\nexport var ViewBoxContext = /*#__PURE__*/createContext(undefined);\nexport var OffsetContext = /*#__PURE__*/createContext({});\nexport var ClipPathIdContext = /*#__PURE__*/createContext(undefined);\nexport var ChartHeightContext = /*#__PURE__*/createContext(0);\nexport var ChartWidthContext = /*#__PURE__*/createContext(0);\n\n/**\n * Will add all the properties required to render all individual Recharts components into a React Context.\n *\n * If you want to read these properties, see the collection of hooks exported from this file.\n *\n * @param {object} props CategoricalChartState, plus children\n * @returns {ReactElement} React Context Provider\n */\nexport var ChartLayoutContextProvider = function ChartLayoutContextProvider(props) {\n var _props$state = props.state,\n xAxisMap = _props$state.xAxisMap,\n yAxisMap = _props$state.yAxisMap,\n offset = _props$state.offset,\n clipPathId = props.clipPathId,\n children = props.children,\n width = props.width,\n height = props.height;\n\n /**\n * Perhaps we should compute this property when reading? Let's see what is more often used\n */\n var viewBox = calculateViewBox(offset);\n\n /*\n * This pretends to be a single context but actually is split into multiple smaller ones.\n * Why?\n * Because one React Context only allows to set one value.\n * But we need to set multiple values.\n * If we do that with one context, then we force re-render on components that might not even be interested\n * in the part of the state that has changed.\n *\n * By splitting into smaller contexts, we allow each components to be optimized and only re-render when its dependencies change.\n *\n * To actually achieve the optimal re-render, it is necessary to use React.memo().\n * See the test file for details.\n */\n return /*#__PURE__*/React.createElement(XAxisContext.Provider, {\n value: xAxisMap\n }, /*#__PURE__*/React.createElement(YAxisContext.Provider, {\n value: yAxisMap\n }, /*#__PURE__*/React.createElement(OffsetContext.Provider, {\n value: offset\n }, /*#__PURE__*/React.createElement(ViewBoxContext.Provider, {\n value: viewBox\n }, /*#__PURE__*/React.createElement(ClipPathIdContext.Provider, {\n value: clipPathId\n }, /*#__PURE__*/React.createElement(ChartHeightContext.Provider, {\n value: height\n }, /*#__PURE__*/React.createElement(ChartWidthContext.Provider, {\n value: width\n }, children)))))));\n};\nexport var useClipPathId = function useClipPathId() {\n return useContext(ClipPathIdContext);\n};\nfunction getKeysForDebug(object) {\n var keys = Object.keys(object);\n if (keys.length === 0) {\n return 'There are no available ids.';\n }\n return \"Available ids are: \".concat(keys, \".\");\n}\n\n/**\n * This either finds and returns Axis by the specified ID, or throws an exception if an axis with this ID does not exist.\n *\n * @param xAxisId identifier of the axis - it's either autogenerated ('0'), or passed via `id` prop as <XAxis id='foo' />\n * @returns axis configuration object\n * @throws Error if no axis with this ID exists\n */\nexport var useXAxisOrThrow = function useXAxisOrThrow(xAxisId) {\n var xAxisMap = useContext(XAxisContext);\n !(xAxisMap != null) ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Could not find Recharts context; are you sure this is rendered inside a Recharts wrapper component?') : invariant(false) : void 0;\n var xAxis = xAxisMap[xAxisId];\n !(xAxis != null) ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"Could not find xAxis by id \\\"\".concat(xAxisId, \"\\\" [\").concat(_typeof(xAxisId), \"]. \").concat(getKeysForDebug(xAxisMap))) : invariant(false) : void 0;\n return xAxis;\n};\n\n/**\n * This will find an arbitrary first XAxis. If there's exactly one it always returns that one\n * - but if there are multiple then it can return any of those.\n *\n * If you want specific XAxis out of multiple then prefer using useXAxisOrThrow\n *\n * @returns X axisOptions, or undefined - if there are no X axes\n */\nexport var useArbitraryXAxis = function useArbitraryXAxis() {\n var xAxisMap = useContext(XAxisContext);\n return getAnyElementOfObject(xAxisMap);\n};\n\n/**\n * This will find an arbitrary first YAxis. If there's exactly one it always returns that one\n * - but if there are multiple then it can return any of those.\n *\n * If you want specific YAxis out of multiple then prefer using useXAxisOrThrow\n *\n * @returns Y axisOptions, or undefined - if there are no Y axes\n */\nexport var useArbitraryYAxis = function useArbitraryYAxis() {\n var yAxisMap = useContext(YAxisContext);\n return getAnyElementOfObject(yAxisMap);\n};\n\n/**\n * This hooks will:\n * 1st attempt to find an YAxis that has all elements in its domain finite\n * If no such axis exists, it will return an arbitrary YAxis\n * if there are no Y axes then it returns undefined\n *\n * @returns Either Y axisOptions, or undefined if there are no Y axes\n */\nexport var useYAxisWithFiniteDomainOrRandom = function useYAxisWithFiniteDomainOrRandom() {\n var yAxisMap = useContext(YAxisContext);\n var yAxisWithFiniteDomain = find(yAxisMap, function (axis) {\n return every(axis.domain, Number.isFinite);\n });\n return yAxisWithFiniteDomain || getAnyElementOfObject(yAxisMap);\n};\n\n/**\n * This either finds and returns Axis by the specified ID, or throws an exception if an axis with this ID does not exist.\n *\n * @param yAxisId identifier of the axis - it's either autogenerated ('0'), or passed via `id` prop as <YAxis id='foo' />\n * @returns axis configuration object\n * @throws Error if no axis with this ID exists\n */\nexport var useYAxisOrThrow = function useYAxisOrThrow(yAxisId) {\n var yAxisMap = useContext(YAxisContext);\n !(yAxisMap != null) ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Could not find Recharts context; are you sure this is rendered inside a Recharts wrapper component?') : invariant(false) : void 0;\n var yAxis = yAxisMap[yAxisId];\n !(yAxis != null) ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"Could not find yAxis by id \\\"\".concat(yAxisId, \"\\\" [\").concat(_typeof(yAxisId), \"]. \").concat(getKeysForDebug(yAxisMap))) : invariant(false) : void 0;\n return yAxis;\n};\nexport var useViewBox = function useViewBox() {\n var viewBox = useContext(ViewBoxContext);\n return viewBox;\n};\nexport var useOffset = function useOffset() {\n return useContext(OffsetContext);\n};\nexport var useChartWidth = function useChartWidth() {\n return useContext(ChartWidthContext);\n};\nexport var useChartHeight = function useChartHeight() {\n return useContext(ChartHeightContext);\n};"],"x_google_ignoreList":[0],"mappings":";;;;;;;AAAA,SAAS,EAAQ,GAAG;AAAE;AAA2B,QAAO,IAAwB,OAAO,UAArB,cAA2C,OAAO,OAAO,YAA1B,WAAqC,SAAU,GAAG;AAAE,SAAO,OAAO;KAAO,SAAU,GAAG;AAAE,SAAO,KAAmB,OAAO,UAArB,cAA+B,EAAE,gBAAgB,UAAU,MAAM,OAAO,YAAY,WAAW,OAAO;IAAM,EAAQ,EAAE;;AAO3T,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AAuC,OAAwB,EAAQ,EAAQ,MAAgB,EAAgB,EAAS,GAAE,GAC/L;GAoDE,IAAkB,SAAyB,GAAS;CAC7D,IAAI,IAAW,EAAW,EAAa;AACvC,CAAE,MAAY,QAAA,IAAA,aAAiC,eAAyI,EAAU,GAAM,GAA1I,EAAU,IAAO,sGAAsG;CACrL,IAAI,IAAQ,EAAS;AAErB,QADE,MAAS,QAAA,IAAA,aAAiC,eAA6J,EAAU,GAAM,GAA9J,EAAU,IAAO,+BAAuC,OAAwB,EAAQ,EAAQ,MAAgB,EAAgB,EAAS,GAAE,GAC/L;GAEE,IAAa,WAAsB;AAE5C,QADc,EAAW,EAAe;GAM/B,IAAgB,WAAyB;AAClD,QAAO,EAAW,EAAkB;GAE3B,IAAiB,WAA0B;AACpD,QAAO,EAAW,EAAmB"}
1
+ {"version":3,"file":"chartLayoutContext.js","names":[],"sources":["../../../../../node_modules/recharts/es6/context/chartLayoutContext.js"],"sourcesContent":["function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nimport React, { createContext, useContext } from 'react';\nimport invariant from 'tiny-invariant';\nimport find from 'lodash/find';\nimport every from 'lodash/every';\nimport { calculateViewBox } from '../util/calculateViewBox';\nimport { getAnyElementOfObject } from '../util/DataUtils';\nexport var XAxisContext = /*#__PURE__*/createContext(undefined);\nexport var YAxisContext = /*#__PURE__*/createContext(undefined);\nexport var ViewBoxContext = /*#__PURE__*/createContext(undefined);\nexport var OffsetContext = /*#__PURE__*/createContext({});\nexport var ClipPathIdContext = /*#__PURE__*/createContext(undefined);\nexport var ChartHeightContext = /*#__PURE__*/createContext(0);\nexport var ChartWidthContext = /*#__PURE__*/createContext(0);\n\n/**\n * Will add all the properties required to render all individual Recharts components into a React Context.\n *\n * If you want to read these properties, see the collection of hooks exported from this file.\n *\n * @param {object} props CategoricalChartState, plus children\n * @returns {ReactElement} React Context Provider\n */\nexport var ChartLayoutContextProvider = function ChartLayoutContextProvider(props) {\n var _props$state = props.state,\n xAxisMap = _props$state.xAxisMap,\n yAxisMap = _props$state.yAxisMap,\n offset = _props$state.offset,\n clipPathId = props.clipPathId,\n children = props.children,\n width = props.width,\n height = props.height;\n\n /**\n * Perhaps we should compute this property when reading? Let's see what is more often used\n */\n var viewBox = calculateViewBox(offset);\n\n /*\n * This pretends to be a single context but actually is split into multiple smaller ones.\n * Why?\n * Because one React Context only allows to set one value.\n * But we need to set multiple values.\n * If we do that with one context, then we force re-render on components that might not even be interested\n * in the part of the state that has changed.\n *\n * By splitting into smaller contexts, we allow each components to be optimized and only re-render when its dependencies change.\n *\n * To actually achieve the optimal re-render, it is necessary to use React.memo().\n * See the test file for details.\n */\n return /*#__PURE__*/React.createElement(XAxisContext.Provider, {\n value: xAxisMap\n }, /*#__PURE__*/React.createElement(YAxisContext.Provider, {\n value: yAxisMap\n }, /*#__PURE__*/React.createElement(OffsetContext.Provider, {\n value: offset\n }, /*#__PURE__*/React.createElement(ViewBoxContext.Provider, {\n value: viewBox\n }, /*#__PURE__*/React.createElement(ClipPathIdContext.Provider, {\n value: clipPathId\n }, /*#__PURE__*/React.createElement(ChartHeightContext.Provider, {\n value: height\n }, /*#__PURE__*/React.createElement(ChartWidthContext.Provider, {\n value: width\n }, children)))))));\n};\nexport var useClipPathId = function useClipPathId() {\n return useContext(ClipPathIdContext);\n};\nfunction getKeysForDebug(object) {\n var keys = Object.keys(object);\n if (keys.length === 0) {\n return 'There are no available ids.';\n }\n return \"Available ids are: \".concat(keys, \".\");\n}\n\n/**\n * This either finds and returns Axis by the specified ID, or throws an exception if an axis with this ID does not exist.\n *\n * @param xAxisId identifier of the axis - it's either autogenerated ('0'), or passed via `id` prop as <XAxis id='foo' />\n * @returns axis configuration object\n * @throws Error if no axis with this ID exists\n */\nexport var useXAxisOrThrow = function useXAxisOrThrow(xAxisId) {\n var xAxisMap = useContext(XAxisContext);\n !(xAxisMap != null) ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Could not find Recharts context; are you sure this is rendered inside a Recharts wrapper component?') : invariant(false) : void 0;\n var xAxis = xAxisMap[xAxisId];\n !(xAxis != null) ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"Could not find xAxis by id \\\"\".concat(xAxisId, \"\\\" [\").concat(_typeof(xAxisId), \"]. \").concat(getKeysForDebug(xAxisMap))) : invariant(false) : void 0;\n return xAxis;\n};\n\n/**\n * This will find an arbitrary first XAxis. If there's exactly one it always returns that one\n * - but if there are multiple then it can return any of those.\n *\n * If you want specific XAxis out of multiple then prefer using useXAxisOrThrow\n *\n * @returns X axisOptions, or undefined - if there are no X axes\n */\nexport var useArbitraryXAxis = function useArbitraryXAxis() {\n var xAxisMap = useContext(XAxisContext);\n return getAnyElementOfObject(xAxisMap);\n};\n\n/**\n * This will find an arbitrary first YAxis. If there's exactly one it always returns that one\n * - but if there are multiple then it can return any of those.\n *\n * If you want specific YAxis out of multiple then prefer using useXAxisOrThrow\n *\n * @returns Y axisOptions, or undefined - if there are no Y axes\n */\nexport var useArbitraryYAxis = function useArbitraryYAxis() {\n var yAxisMap = useContext(YAxisContext);\n return getAnyElementOfObject(yAxisMap);\n};\n\n/**\n * This hooks will:\n * 1st attempt to find an YAxis that has all elements in its domain finite\n * If no such axis exists, it will return an arbitrary YAxis\n * if there are no Y axes then it returns undefined\n *\n * @returns Either Y axisOptions, or undefined if there are no Y axes\n */\nexport var useYAxisWithFiniteDomainOrRandom = function useYAxisWithFiniteDomainOrRandom() {\n var yAxisMap = useContext(YAxisContext);\n var yAxisWithFiniteDomain = find(yAxisMap, function (axis) {\n return every(axis.domain, Number.isFinite);\n });\n return yAxisWithFiniteDomain || getAnyElementOfObject(yAxisMap);\n};\n\n/**\n * This either finds and returns Axis by the specified ID, or throws an exception if an axis with this ID does not exist.\n *\n * @param yAxisId identifier of the axis - it's either autogenerated ('0'), or passed via `id` prop as <YAxis id='foo' />\n * @returns axis configuration object\n * @throws Error if no axis with this ID exists\n */\nexport var useYAxisOrThrow = function useYAxisOrThrow(yAxisId) {\n var yAxisMap = useContext(YAxisContext);\n !(yAxisMap != null) ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Could not find Recharts context; are you sure this is rendered inside a Recharts wrapper component?') : invariant(false) : void 0;\n var yAxis = yAxisMap[yAxisId];\n !(yAxis != null) ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"Could not find yAxis by id \\\"\".concat(yAxisId, \"\\\" [\").concat(_typeof(yAxisId), \"]. \").concat(getKeysForDebug(yAxisMap))) : invariant(false) : void 0;\n return yAxis;\n};\nexport var useViewBox = function useViewBox() {\n var viewBox = useContext(ViewBoxContext);\n return viewBox;\n};\nexport var useOffset = function useOffset() {\n return useContext(OffsetContext);\n};\nexport var useChartWidth = function useChartWidth() {\n return useContext(ChartWidthContext);\n};\nexport var useChartHeight = function useChartHeight() {\n return useContext(ChartHeightContext);\n};"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;AAAA,SAAS,EAAQ,GAAG;AAAE;AAA2B,QAAO,IAAwB,OAAO,UAArB,cAA2C,OAAO,OAAO,YAA1B,WAAqC,SAAU,GAAG;AAAE,SAAO,OAAO;KAAO,SAAU,GAAG;AAAE,SAAO,KAAmB,OAAO,UAArB,cAA+B,EAAE,gBAAgB,UAAU,MAAM,OAAO,YAAY,WAAW,OAAO;IAAM,EAAQ,EAAE;;AAO3T,IAAW,IAA4B,kBAAc,KAAA,EAAU,EACpD,IAA4B,kBAAc,KAAA,EAAU,EACpD,IAA8B,kBAAc,KAAA,EAAU,EACtD,IAA6B,kBAAc,EAAE,CAAC,EAC9C,IAAiC,kBAAc,KAAA,EAAU,EACzD,IAAkC,kBAAc,EAAE,EAClD,IAAiC,kBAAc,EAAE,EAUjD,IAA6B,SAAoC,GAAO;CACjF,IAAI,IAAe,EAAM,OACvB,IAAW,EAAa,UAC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