col-browser 2.6.6 → 2.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -282,12 +282,13 @@ A [browsable taxonomic tree](https://www.catalogueoflife.org/data/browse). Compo
282
282
  1. `datasetKey` - the dataset key from the [Catalogue of Life ChecklistBank](https://www.checklistbank.org/).
283
283
  2. `expandedTaxonKey` - (Optional, controlled) which taxon the tree is expanded down to. Pair with `onExpandedTaxonKeyChange` to keep host state in sync.
284
284
  3. `onExpandedTaxonKeyChange` - (Optional) called with the new key when the user expands a different taxon.
285
- 4. `defaultTaxonKey` - (Optional, uncontrolled fallback) initial taxon to expand to when `expandedTaxonKey` is not provided. Nothing is expanded unless one of these is set — pass a root id to open it on load, e.g. `defaultTaxonKey="CS5HF"` opens Eukaryota in current Catalogue of Life releases.
285
+ 4. `defaultTaxonKey` - (Optional, uncontrolled fallback) initial taxon to expand to when `expandedTaxonKey` is not provided. Nothing is expanded unless one of these is set — pass a root id to open it on load, e.g. `defaultTaxonKey="CS5HF"` opens Eukaryota in current Catalogue of Life releases. The page scrolls to an `expandedTaxonKey` on load, but not to a `defaultTaxonKey`.
286
286
  5. `showTreeOptions` - (Optional) show toggles for extinct taxa and info (estimates, providers etc).
287
287
  6. `linkToSpeciesPage` - (Optional) when the searchbox finds a species or infraspecific taxon, jump directly to the taxon page rather than opening the tree.
288
288
  7. `citation` - (Optional) either `"top"` or `"bottom"`; include the necessary dataset citation above or below the tree component.
289
289
  8. `type` - (Optional) e.g. `type="project"` will show info about contributing sources on the tree nodes.
290
290
  9. `insertPlaceholder` - (Optional, defaults to `true`) when true, the API virtually groups children of lower ranks into a "Not assigned" placeholder node for a more compact browsing experience. Pass `false` to disable.
291
+ 10. `autoFocus` - (Optional, defaults to `true`) focus the search box when the tree loads. Pass `false` when the tree is not the main thing on the page, so it does not take the focus or scroll the page to itself.
291
292
 
292
293
  ```html
293
294
  <div id="tree"></div> <!-- Dom element for the tree to attach to -->
@@ -444,11 +445,11 @@ ColBrowser.ReactDOM.createRoot(document.querySelector('#taxon')).render(
444
445
 
445
446
  ### ColBrowser.TaxonBreakdown
446
447
 
447
- A Highcharts pie chart breaking the accepted children of a taxon down by rank, with click-to-drill into each child. Rendered inside the Taxon page but also exported standalone for use on dashboards or summary pages. Component-specific props:
448
+ A Highcharts pie chart breaking the accepted children of a taxon down by rank, with click-to-drill into each child. The API decides what the slices count (species, or genera where genera outnumber species more than twofold) and which ranks form the rings, and adds a "Not assigned" slice for what sits in no child. Rendered inside the Taxon page but also exported standalone for use on dashboards or summary pages. Component-specific props:
448
449
 
449
450
  1. `datasetKey` - the dataset key from the [Catalogue of Life ChecklistBank](https://www.checklistbank.org/).
450
- 2. `taxonId` - (controlled) the taxon to break down. The chart loads the taxon, its rank vocabulary, and the dataset citation itself, so no preloading is needed.
451
- 3. `level` - (Optional, `1` or `2`, default `1`) controls how deep the breakdown nests. `1` renders a single-ring donut (direct children of `taxonId`). `2` renders a two-ring donut adding grandchildren. The value is passed through as the `level` query parameter on the `/dataset/{key}/taxon/{id}/breakdown` API.
451
+ 2. `taxonId` - (controlled) the taxon to break down. The chart loads the taxon and the dataset citation itself, so no preloading is needed.
452
+ 3. `level` - (Optional, `1` or `2`, default `1`) the most rings to draw. `1` renders a single-ring donut (direct children of `taxonId`). `2` adds grandchildren as a second ring, unless the API decides that ring is not worth drawing (it would be the counted rank itself, or hold more than 1000 taxa). The value is passed through as the `level` query parameter on the `/dataset/{key}/taxon/{id}/breakdown` API, which returns a `TaxonBreakdown` object since ChecklistBank API 2026-11; older API versions are not supported.
452
453
  4. `showLevelSwitch` - (Optional, default `false`) when `true`, render an in-chart antd `Switch` that lets the user toggle between level 1 and 2 at runtime.
453
454
  5. `darkMode` - (Optional) when `true`, use the dark-mode outer-ring gap colour. Falls back to `prefers-color-scheme` when unset.
454
455
 
@@ -0,0 +1,174 @@
1
+ import { j as a } from "./jsx-runtime-BzflLqGi.js";
2
+ import { useState as y, useEffect as v } from "react";
3
+ import { c as q } from "./config--bs_09I6.js";
4
+ import { u as F, c as J } from "./router-CssZk5qZ.js";
5
+ import C from "highcharts";
6
+ import "highcharts/modules/exporting";
7
+ import K from "highcharts-react-official";
8
+ import { startCase as Q, get as T } from "lodash-es";
9
+ import { Row as Z, Col as L, Spin as tt, Switch as et } from "antd";
10
+ import { r as nt, w as ot } from "./storage-BgdCo9fV.js";
11
+ const R = "breakdown-level", w = 100, z = (n) => n ? `Not assigned ${n}` : "Not assigned", it = (n, d) => {
12
+ const e = (n || []).filter((r) => r.id).sort((r, u) => (u.count || 0) - (r.count || 0)).slice(0, w), c = e.reduce((r, u) => r + (u.count || 0), 0), s = T(n, "[0].rank", "");
13
+ return c < d ? [
14
+ ...e,
15
+ { name: z(s), count: d - c, children: [] }
16
+ ] : e;
17
+ }, kt = ({
18
+ taxon: n,
19
+ datasetKey: d,
20
+ dataset: e,
21
+ level: c = 1,
22
+ showLevelSwitch: s = !1,
23
+ darkMode: r
24
+ }) => {
25
+ const u = F("taxon"), [E, A] = y(null), [B, k] = y(!1), [W, x] = y(!1), [f, O] = y(
26
+ () => s ? nt(R, c) : c
27
+ );
28
+ v(() => {
29
+ s || O(c);
30
+ }, [c, s]), v(() => {
31
+ s && ot(R, f);
32
+ }, [f, s]), v(() => {
33
+ n != null && n.id && d && G();
34
+ }, [n, d, f]);
35
+ const G = async () => {
36
+ k(!0);
37
+ try {
38
+ const l = (await J(
39
+ `${q.dataApi}dataset/${d}/taxon/${encodeURIComponent(
40
+ n.id
41
+ )}/breakdown?level=${f}`
42
+ )).data || {};
43
+ if (k(!1), !l.countRank || !l.children || l.children.length === 0) {
44
+ x(!0);
45
+ return;
46
+ }
47
+ x(!1), H(l);
48
+ } catch {
49
+ k(!1), x(!0);
50
+ }
51
+ }, H = ({ children: p, total: l, countRank: j }) => {
52
+ const D = Q(j === "genus" ? "genera" : j), P = e.doi ? "https://doi.org/" + e.doi : null, N = C.getOptions().colors, S = (typeof r == "boolean" ? r : typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia("(prefers-color-scheme: dark)").matches) ? "#1f1f1f" : "#ffffff", $ = {
53
+ click: (t) => {
54
+ t.point._id && u(t.point._id);
55
+ }
56
+ }, g = it(p, l).map((t, o) => ({
57
+ name: t.name,
58
+ y: t.count,
59
+ _id: t.id,
60
+ color: N[o % N.length],
61
+ _kids: t.children
62
+ })), _ = [], m = g.some((t) => t._kids && t._kids.length > 0);
63
+ m && g.forEach((t) => {
64
+ const o = (t._kids || []).filter((i) => i.id).sort((i, h) => (h.count || 0) - (i.count || 0)).slice(0, w), b = o.reduce((i, h) => i + (h.count || 0), 0);
65
+ o.forEach((i, h) => {
66
+ const Y = -0.1 + (o.length > 1 ? h / (o.length - 1) : 0) * 0.4;
67
+ _.push({
68
+ name: i.name,
69
+ y: i.count,
70
+ _id: i.id,
71
+ color: C.color(t.color).brighten(Y).get()
72
+ });
73
+ }), b < t.y && _.push({
74
+ name: z(T(t._kids, "[0].rank", "")),
75
+ y: t.y - b,
76
+ color: S,
77
+ borderColor: S,
78
+ borderWidth: 0,
79
+ dataLabels: { enabled: !1 }
80
+ });
81
+ });
82
+ const U = (t) => t.map(({ _kids: o, ...b }) => b), V = l || g.reduce((t, o) => t + o.y, 0), X = m ? {
83
+ formatter: function() {
84
+ return this.y > V / 10 ? this.point.name : null;
85
+ },
86
+ distance: -30,
87
+ style: {
88
+ color: "contrast",
89
+ textOutline: "1px contrast",
90
+ fontWeight: "bold"
91
+ }
92
+ } : {
93
+ formatter: function() {
94
+ return this.y > 0 ? "<b>" + this.point.name + ":</b> " + this.y.toLocaleString("en-GB") : null;
95
+ }
96
+ }, I = [
97
+ {
98
+ name: D,
99
+ data: U(g),
100
+ size: m ? "60%" : "85%",
101
+ dataLabels: X,
102
+ point: { events: $ }
103
+ }
104
+ ];
105
+ m && I.push({
106
+ name: D,
107
+ data: _,
108
+ size: "85%",
109
+ innerSize: "60%",
110
+ dataLabels: {
111
+ formatter: function() {
112
+ return this.y > 0 ? "<b>" + this.point.name + ":</b> " + this.y.toLocaleString("en-GB") : null;
113
+ }
114
+ },
115
+ point: { events: $ }
116
+ }), A({
117
+ chart: { type: "pie" },
118
+ credits: {
119
+ text: `${n.name.scientificName} in ${e.title}${e.version ? " (" + e.version + ")" : ""}. ${(e.doi ? "DOI:" + e.doi : null) || e.url || ""}`,
120
+ href: P || e.url || ""
121
+ },
122
+ title: { text: "" },
123
+ plotOptions: { pie: { shadow: !1, center: ["50%", "50%"] } },
124
+ tooltip: {},
125
+ series: I,
126
+ responsive: {
127
+ rules: [
128
+ {
129
+ condition: { maxWidth: 400 },
130
+ chartOptions: {
131
+ series: m ? [{}, { dataLabels: { enabled: !1 } }] : [{}]
132
+ }
133
+ }
134
+ ]
135
+ },
136
+ exporting: {
137
+ chartOptions: {
138
+ plotOptions: { series: { dataLabels: { enabled: !0 } } }
139
+ },
140
+ fallbackToExportServer: !1
141
+ }
142
+ });
143
+ };
144
+ if (W) return null;
145
+ const M = s ? /* @__PURE__ */ a.jsx(
146
+ et,
147
+ {
148
+ size: "small",
149
+ checked: f === 2,
150
+ onChange: (p) => O(p ? 2 : 1),
151
+ checkedChildren: "lvl2",
152
+ unCheckedChildren: "lvl1",
153
+ style: {
154
+ position: "absolute",
155
+ top: 11,
156
+ right: 44,
157
+ zIndex: 2,
158
+ background: f === 2 ? "#8c8c8c" : "#bfbfbf"
159
+ }
160
+ }
161
+ ) : null;
162
+ return /* @__PURE__ */ a.jsxs("div", { style: { position: "relative" }, children: [
163
+ M,
164
+ B || !E ? /* @__PURE__ */ a.jsxs(Z, { style: { padding: "48px" }, children: [
165
+ /* @__PURE__ */ a.jsx(L, { flex: "auto" }),
166
+ /* @__PURE__ */ a.jsx(L, { children: /* @__PURE__ */ a.jsx(tt, { size: "large" }) }),
167
+ /* @__PURE__ */ a.jsx(L, { flex: "auto" })
168
+ ] }) : /* @__PURE__ */ a.jsx(K, { highcharts: C, options: E })
169
+ ] });
170
+ };
171
+ export {
172
+ kt as T
173
+ };
174
+ //# sourceMappingURL=TaxonBreakdown-CyHl1YES.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TaxonBreakdown-CyHl1YES.js","sources":["../../src/Taxon/TaxonBreakdown.js"],"sourcesContent":["import React, { useState, useEffect } from \"react\";\nimport config from \"../config\";\nimport client from \"../api/client\";\nimport Highcharts from \"highcharts\";\nimport \"highcharts/modules/exporting\";\nimport HighchartsReact from \"highcharts-react-official\";\nimport { get, startCase } from \"lodash-es\";\nimport { Spin, Row, Col, Switch } from \"antd\";\nimport { useNavigateTo } from \"../router\";\nimport { readSetting, writeSetting } from \"../storage\";\n\nconst BREAKDOWN_LEVEL_KEY = \"breakdown-level\";\n\nconst MAX_SLICES_PER_RING = 100;\n\nconst notAssignedLabel = (rk) => (rk ? `Not assigned ${rk}` : \"Not assigned\");\n\n// The breakdown endpoint returns the nodes of a ring plus at most one\n// remainder node without an id for the parent's counted descendants placed in\n// no node of the ring. Sort the named nodes, clip them to MAX_SLICES_PER_RING\n// and fold whatever the clipped nodes and the remainder held into a single\n// \"Not assigned <rank>\" slice, so the ring always adds up to the parent.\nconst ringNodes = (nodes, parentCount) => {\n const named = (nodes || [])\n .filter((n) => n.id)\n .sort((a, b) => (b.count || 0) - (a.count || 0))\n .slice(0, MAX_SLICES_PER_RING);\n const sum = named.reduce((a, n) => a + (n.count || 0), 0);\n const rank = get(nodes, \"[0].rank\", \"\");\n return sum < parentCount\n ? [\n ...named,\n { name: notAssignedLabel(rank), count: parentCount - sum, children: [] },\n ]\n : named;\n};\n\nconst TaxonBreakdown = ({\n taxon,\n datasetKey,\n dataset,\n level = 1,\n showLevelSwitch = false,\n darkMode,\n}) => {\n const navigateToTaxon = useNavigateTo(\"taxon\");\n const [options, setOptions] = useState(null);\n const [loading, setLoading] = useState(false);\n const [invalid, setInvalid] = useState(false);\n // The chart's effective level is controlled internally when the switch\n // is enabled, so toggling can refetch + re-render the chart. Otherwise\n // the prop drives directly.\n const [activeLevel, setActiveLevel] = useState(() =>\n showLevelSwitch ? readSetting(BREAKDOWN_LEVEL_KEY, level) : level\n );\n useEffect(() => {\n // When the 1/2 switch is shown the remembered choice owns the level, so a\n // (usually static) `level` prop must not clobber it; otherwise the prop\n // drives directly.\n if (!showLevelSwitch) setActiveLevel(level);\n }, [level, showLevelSwitch]);\n useEffect(() => {\n if (showLevelSwitch) writeSetting(BREAKDOWN_LEVEL_KEY, activeLevel);\n }, [activeLevel, showLevelSwitch]);\n useEffect(() => {\n if (taxon?.id && datasetKey) {\n getData();\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [taxon, datasetKey, activeLevel]);\n\n // The backend decides what to count (species, or genera where they\n // outnumber species), which ranks form the rings and the total; the switch\n // only caps the rings at one or two.\n const getData = async () => {\n setLoading(true);\n try {\n const res = await client(\n `${config.dataApi}dataset/${datasetKey}/taxon/${encodeURIComponent(\n taxon.id\n )}/breakdown?level=${activeLevel}`\n );\n const bd = res.data || {};\n setLoading(false);\n if (!bd.countRank || !bd.children || bd.children.length === 0) {\n setInvalid(true);\n return;\n }\n setInvalid(false);\n buildChart(bd);\n } catch (err) {\n setLoading(false);\n setInvalid(true);\n }\n };\n\n const buildChart = ({ children, total, countRank }) => {\n const seriesName = startCase(countRank === \"genus\" ? \"genera\" : countRank);\n const DOI = dataset.doi ? \"https://doi.org/\" + dataset.doi : null;\n const baseColors = Highcharts.getOptions().colors;\n // Colour used for outer-ring \"gap\" slices: match the page background so\n // the wedge reads as empty space rather than overlapping the inner pie.\n // Follows the explicit `darkMode` prop if given, otherwise prefers-color-scheme.\n const prefersDark =\n typeof darkMode === \"boolean\"\n ? darkMode\n : typeof window !== \"undefined\" &&\n typeof window.matchMedia === \"function\" &&\n window.matchMedia(\"(prefers-color-scheme: dark)\").matches;\n const gapColor = prefersDark ? \"#1f1f1f\" : \"#ffffff\";\n const taxonClickHandler = {\n click: (e) => {\n if (e.point._id) {\n navigateToTaxon(e.point._id);\n }\n },\n };\n\n // Inner pie: direct children of the focal taxon, with a single\n // \"Not assigned <rank>\" slice for what they do not hold.\n const innerNodes = ringNodes(children, total);\n const innerData = innerNodes.map((n, i) => ({\n name: n.name,\n y: n.count,\n _id: n.id,\n color: baseColors[i % baseColors.length],\n _kids: n.children,\n }));\n\n // Outer ring: children of each inner slice (grandchildren of focal),\n // coloured as a monochrome brightness shift of the parent so each\n // family of arcs reads as one hue group. Only rendered when the response\n // carries that depth, which it does for level=2 unless the backend\n // decided a second ring is not worth drawing.\n const outerData = [];\n const hasOuterData = innerData.some((s) => s._kids && s._kids.length > 0);\n if (hasOuterData) {\n innerData.forEach((slice) => {\n const sorted = (slice._kids || [])\n .filter((n) => n.id)\n .sort((a, b) => (b.count || 0) - (a.count || 0))\n .slice(0, MAX_SLICES_PER_RING);\n const sum = sorted.reduce((a, n) => a + (n.count || 0), 0);\n sorted.forEach((g, j) => {\n const t = sorted.length > 1 ? j / (sorted.length - 1) : 0;\n const shift = -0.1 + t * 0.4;\n outerData.push({\n name: g.name,\n y: g.count,\n _id: g.id,\n color: Highcharts.color(slice.color).brighten(shift).get(),\n });\n });\n // Where children don't fully account for the inner slice, add a\n // transparent gap slice so the outer ring stays angularly aligned\n // with the inner pie but the missing portion reads as empty space\n // (rather than a labelled \"Not assigned\" wedge).\n if (sum < slice.y) {\n outerData.push({\n name: notAssignedLabel(get(slice._kids, \"[0].rank\", \"\")),\n y: slice.y - sum,\n color: gapColor,\n borderColor: gapColor,\n borderWidth: 0,\n dataLabels: { enabled: false },\n });\n }\n });\n }\n\n const clean = (rows) => rows.map(({ _kids, ...rest }) => rest);\n const grandTotal = total || innerData.reduce((a, s) => a + s.y, 0);\n\n const innerLabelStyle = {\n color: \"contrast\",\n textOutline: \"1px contrast\",\n fontWeight: \"bold\",\n };\n\n // Inner-ring data labels: only positioned inside the ring when there's\n // an outer ring fighting for the external label gutter. With just one\n // ring (level=1) the labels live outside the chart, same as the outer\n // ring at level=2, with the slice name + species count.\n const innerDataLabels = hasOuterData\n ? {\n formatter: function () {\n return this.y > grandTotal / 10 ? this.point.name : null;\n },\n distance: -30,\n style: innerLabelStyle,\n }\n : {\n formatter: function () {\n return this.y > 0\n ? \"<b>\" +\n this.point.name +\n \":</b> \" +\n this.y.toLocaleString(\"en-GB\")\n : null;\n },\n };\n\n const series = [\n {\n name: seriesName,\n data: clean(innerData),\n size: hasOuterData ? \"60%\" : \"85%\",\n dataLabels: innerDataLabels,\n point: { events: taxonClickHandler },\n },\n ];\n if (hasOuterData) {\n series.push({\n name: seriesName,\n data: outerData,\n size: \"85%\",\n innerSize: \"60%\",\n dataLabels: {\n formatter: function () {\n return this.y > 0\n ? \"<b>\" +\n this.point.name +\n \":</b> \" +\n this.y.toLocaleString(\"en-GB\")\n : null;\n },\n },\n point: { events: taxonClickHandler },\n });\n }\n\n setOptions({\n chart: { type: \"pie\" },\n credits: {\n text: `${taxon.name.scientificName} in ${dataset.title}${\n dataset.version ? \" (\" + dataset.version + \")\" : \"\"\n }. ${(dataset.doi ? \"DOI:\" + dataset.doi : null) || dataset.url || \"\"}`,\n href: DOI || dataset.url || \"\",\n },\n title: { text: \"\" },\n plotOptions: { pie: { shadow: false, center: [\"50%\", \"50%\"] } },\n tooltip: {},\n series,\n responsive: {\n rules: [\n {\n condition: { maxWidth: 400 },\n chartOptions: {\n series: hasOuterData\n ? [{}, { dataLabels: { enabled: false } }]\n : [{}],\n },\n },\n ],\n },\n exporting: {\n chartOptions: {\n plotOptions: { series: { dataLabels: { enabled: true } } },\n },\n fallbackToExportServer: false,\n },\n });\n };\n\n if (invalid) return null;\n\n // Place the level toggle inside the chart's top-right area, just left of\n // the Highcharts context-menu (≡) icon, so it doesn't consume an extra\n // row. Colourless switch with lvl1 / lvl2 labels.\n const levelSwitch = showLevelSwitch ? (\n <Switch\n size=\"small\"\n checked={activeLevel === 2}\n onChange={(checked) => setActiveLevel(checked ? 2 : 1)}\n checkedChildren=\"lvl2\"\n unCheckedChildren=\"lvl1\"\n style={{\n position: \"absolute\",\n top: 11,\n right: 44,\n zIndex: 2,\n background: activeLevel === 2 ? \"#8c8c8c\" : \"#bfbfbf\",\n }}\n />\n ) : null;\n\n return (\n <div style={{ position: \"relative\" }}>\n {levelSwitch}\n {loading || !options ? (\n <Row style={{ padding: \"48px\" }}>\n <Col flex=\"auto\"></Col>\n <Col>\n <Spin size=\"large\" />\n </Col>\n <Col flex=\"auto\"></Col>\n </Row>\n ) : (\n <HighchartsReact highcharts={Highcharts} options={options} />\n )}\n </div>\n );\n};\n\nexport default TaxonBreakdown;\n"],"names":["BREAKDOWN_LEVEL_KEY","MAX_SLICES_PER_RING","notAssignedLabel","rk","ringNodes","nodes","parentCount","named","n","a","b","sum","rank","get","TaxonBreakdown","taxon","datasetKey","dataset","level","showLevelSwitch","darkMode","navigateToTaxon","useNavigateTo","options","setOptions","useState","loading","setLoading","invalid","setInvalid","activeLevel","setActiveLevel","readSetting","useEffect","writeSetting","getData","bd","client","config","buildChart","children","total","countRank","seriesName","startCase","DOI","baseColors","Highcharts","gapColor","taxonClickHandler","e","innerData","i","outerData","hasOuterData","s","slice","sorted","g","j","shift","clean","rows","_kids","rest","grandTotal","innerDataLabels","series","levelSwitch","jsx","Switch","checked","jsxs","Row","Col","Spin","HighchartsReact"],"mappings":";;;;;;;;;;AAWA,MAAMA,IAAsB,mBAEtBC,IAAsB,KAEtBC,IAAmB,CAACC,MAAQA,IAAK,gBAAgBA,CAAE,KAAK,gBAOxDC,KAAY,CAACC,GAAOC,MAAgB;AACxC,QAAMC,KAASF,KAAS,CAAA,GACrB,OAAO,CAACG,MAAMA,EAAE,EAAE,EAClB,KAAK,CAACC,GAAGC,OAAOA,EAAE,SAAS,MAAMD,EAAE,SAAS,EAAE,EAC9C,MAAM,GAAGR,CAAmB,GACzBU,IAAMJ,EAAM,OAAO,CAACE,GAAGD,MAAMC,KAAKD,EAAE,SAAS,IAAI,CAAC,GAClDI,IAAOC,EAAIR,GAAO,YAAY,EAAE;AACtC,SAAOM,IAAML,IAC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