@pixerate/editor 0.48.0 → 0.49.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.
Files changed (54) hide show
  1. package/dist/agent/index.cjs +24 -22
  2. package/dist/agent/index.cjs.map +1 -1
  3. package/dist/agent/index.js +6 -4
  4. package/dist/agent/index.js.map +1 -1
  5. package/dist/chart/index.cjs +81 -79
  6. package/dist/chart/index.cjs.map +1 -1
  7. package/dist/chart/index.js +52 -50
  8. package/dist/chart/index.js.map +1 -1
  9. package/dist/{chunk-TXXNBDQX.cjs → chunk-2Q46FKZK.cjs} +113 -34
  10. package/dist/chunk-2Q46FKZK.cjs.map +1 -0
  11. package/dist/{chunk-PIMCHMZE.cjs → chunk-3JNRQVTS.cjs} +16 -16
  12. package/dist/{chunk-PIMCHMZE.cjs.map → chunk-3JNRQVTS.cjs.map} +1 -1
  13. package/dist/{chunk-HXUL3LS7.js → chunk-5TWIN7ZJ.js} +2 -2
  14. package/dist/{chunk-VKPEPWKZ.js → chunk-DQPBQXKG.js} +4 -4
  15. package/dist/{chunk-MUCYWI6W.cjs → chunk-FEMIVHN3.cjs} +17 -15
  16. package/dist/chunk-FEMIVHN3.cjs.map +1 -0
  17. package/dist/{chunk-XUUD43OV.js → chunk-GJBIVWB2.js} +2 -2
  18. package/dist/{chunk-PRSJJZBS.cjs → chunk-GTZXF4BI.cjs} +191 -841
  19. package/dist/chunk-GTZXF4BI.cjs.map +1 -0
  20. package/dist/chunk-JOX6MJW4.cjs +674 -0
  21. package/dist/chunk-JOX6MJW4.cjs.map +1 -0
  22. package/dist/{chunk-WXEHCVJQ.cjs → chunk-LNKZPIQD.cjs} +52 -52
  23. package/dist/{chunk-WXEHCVJQ.cjs.map → chunk-LNKZPIQD.cjs.map} +1 -1
  24. package/dist/chunk-OV7UAKIY.js +674 -0
  25. package/dist/chunk-OV7UAKIY.js.map +1 -0
  26. package/dist/{chunk-PKBWLEL7.js → chunk-QFTVLEVN.js} +6 -4
  27. package/dist/{chunk-PKBWLEL7.js.map → chunk-QFTVLEVN.js.map} +1 -1
  28. package/dist/{chunk-KRGXUQ2Y.js → chunk-T6XU4B54.js} +82 -3
  29. package/dist/chunk-T6XU4B54.js.map +1 -0
  30. package/dist/{chunk-U6IZKC7B.cjs → chunk-TGBCBQFV.cjs} +14 -14
  31. package/dist/{chunk-U6IZKC7B.cjs.map → chunk-TGBCBQFV.cjs.map} +1 -1
  32. package/dist/{chunk-LTUM52X6.js → chunk-WBOAXDKD.js} +109 -759
  33. package/dist/chunk-WBOAXDKD.js.map +1 -0
  34. package/dist/export/index.cjs +4 -2
  35. package/dist/export/index.cjs.map +1 -1
  36. package/dist/export/index.d.cts +5 -1
  37. package/dist/export/index.d.ts +5 -1
  38. package/dist/export/index.js +3 -1
  39. package/dist/extensions/index.cjs +6 -5
  40. package/dist/extensions/index.cjs.map +1 -1
  41. package/dist/extensions/index.js +5 -4
  42. package/dist/index.cjs +12 -11
  43. package/dist/index.cjs.map +1 -1
  44. package/dist/index.js +6 -5
  45. package/dist/index.js.map +1 -1
  46. package/package.json +1 -1
  47. package/dist/chunk-KRGXUQ2Y.js.map +0 -1
  48. package/dist/chunk-LTUM52X6.js.map +0 -1
  49. package/dist/chunk-MUCYWI6W.cjs.map +0 -1
  50. package/dist/chunk-PRSJJZBS.cjs.map +0 -1
  51. package/dist/chunk-TXXNBDQX.cjs.map +0 -1
  52. /package/dist/{chunk-HXUL3LS7.js.map → chunk-5TWIN7ZJ.js.map} +0 -0
  53. /package/dist/{chunk-VKPEPWKZ.js.map → chunk-DQPBQXKG.js.map} +0 -0
  54. /package/dist/{chunk-XUUD43OV.js.map → chunk-GJBIVWB2.js.map} +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["/home/runner/work/editor/editor/packages/core/dist/chunk-JOX6MJW4.cjs","../src/chart/color.ts","../src/chart/spec.ts"],"names":["text"],"mappings":"AAAA;ACQA,IAAM,MAAA,EAAgC;AAAA,EACrC,KA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,EAAA;AACR;AF6BkH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"/home/runner/work/editor/editor/packages/core/dist/chunk-JOX6MJW4.cjs","sourcesContent":[null,"// Portions ported from gridcraft-main/crates/chart/src/resolve.rs (palette tint cycle) and\n// crates/chart/src/render.rs (`on`: label colour from the fill), and designcraft-main/crates/color/src/cms/mod.rs\n// (`simulate_cvd`, Machado–Oliveira–Fernandes 2009 matrices) (MIT OR Apache-2.0, © ArtCraft Team and contributors).\n// See THIRD_PARTY_NOTICES.md.\n\n/** An sRGB colour with channels from 0 to 1. */\nexport type ChartRgb = [number, number, number];\n\nconst NAMED: Record<string, string> = {\n\tblack: '#000000',\n\twhite: '#ffffff',\n\tred: '#ff0000',\n\tgreen: '#008000',\n\tblue: '#0000ff',\n\tyellow: '#ffff00',\n\torange: '#ffa500',\n\tpurple: '#800080',\n\tgray: '#808080',\n\tgrey: '#808080',\n\tteal: '#008080',\n\tnavy: '#000080',\n\tmaroon: '#800000',\n\tolive: '#808000',\n\tsilver: '#c0c0c0',\n\tlime: '#00ff00',\n\taqua: '#00ffff',\n\tcyan: '#00ffff',\n\tfuchsia: '#ff00ff',\n\tmagenta: '#ff00ff',\n\tpink: '#ffc0cb',\n\tbrown: '#a52a2a'\n};\n\n/**\n * Reads `#rgb`, `#rrggbb`, `#rrggbbaa`, `rgb()` / `rgba()` and a few colour names. Returns\n * `null` for anything else (CSS variables, `hsl()`, …), so callers can leave such colours alone.\n */\nexport function parseChartColor(color: string): ChartRgb | null {\n\tconst text = color.trim().toLowerCase();\n\tconst hex = NAMED[text] ?? text;\n\tlet m = /^#([0-9a-f]{3})$/.exec(hex);\n\tif (m) return [...m[1]].map((c) => parseInt(c + c, 16) / 255) as ChartRgb;\n\tm = /^#([0-9a-f]{6})([0-9a-f]{2})?$/.exec(hex);\n\tif (m) return [0, 2, 4].map((i) => parseInt(m![1].slice(i, i + 2), 16) / 255) as ChartRgb;\n\tm = /^rgba?\\(\\s*([\\d.]+)%?[\\s,]+([\\d.]+)%?[\\s,]+([\\d.]+)%?(?:[\\s,/]+[\\d.]+%?)?\\s*\\)$/.exec(text);\n\tif (m) {\n\t\tconst pct = text.includes('%');\n\t\treturn [m[1], m[2], m[3]].map((v) => Math.max(0, Math.min(1, Number(v) / (pct ? 100 : 255)))) as ChartRgb;\n\t}\n\treturn null;\n}\n\nexport function chartRgbToHex(rgb: ChartRgb): string {\n\treturn `#${rgb.map((c) => Math.round(Math.max(0, Math.min(1, c)) * 255).toString(16).padStart(2, '0')).join('')}`;\n}\n\n/**\n * A lighter (`amount` > 0, towards white) or darker (`amount` < 0, towards black) shade of\n * `color`. Colours it cannot read (CSS variables) come back unchanged.\n */\nexport function shadeChartColor(color: string, amount: number): string {\n\tconst rgb = parseChartColor(color);\n\tif (!rgb || !amount) return color;\n\tconst t = Math.max(-1, Math.min(1, amount));\n\treturn chartRgbToHex(rgb.map((c) => (t > 0 ? c + (1 - c) * t : c * (1 + t))) as ChartRgb);\n}\n\n/** Shades used once a palette is used up: the same hues, lighter then darker (GridCraft's cycle). */\nexport const CHART_PALETTE_SHADES: readonly number[] = [0, 0.4, -0.25, 0.6, -0.5, 0.2];\n\n/** The palette colour for the `index`-th item: the palette in order, then lighter and darker rounds of it. */\nexport function cyclePaletteColor(palette: readonly string[], index: number): string {\n\tconst base = palette[index % palette.length];\n\tconst round = Math.floor(index / palette.length) % CHART_PALETTE_SHADES.length;\n\treturn shadeChartColor(base, CHART_PALETTE_SHADES[round]);\n}\n\nconst toLinear = (c: number) => (c <= 0.04045 ? c / 12.92 : Math.pow((c + 0.055) / 1.055, 2.4));\nconst fromLinear = (c: number) => (c <= 0.0031308 ? c * 12.92 : 1.055 * Math.pow(c, 1 / 2.4) - 0.055);\n\n/** WCAG relative luminance (0 black – 1 white). */\nexport function chartLuminance(rgb: ChartRgb): number {\n\tconst [r, g, b] = rgb.map(toLinear);\n\treturn 0.2126 * r + 0.7152 * g + 0.0722 * b;\n}\n\n/** WCAG contrast ratio (1–21) between two colours, or `null` when either cannot be read. */\nexport function chartContrastRatio(a: string, b: string): number | null {\n\tconst ra = parseChartColor(a);\n\tconst rb = parseChartColor(b);\n\tif (!ra || !rb) return null;\n\tconst la = chartLuminance(ra);\n\tconst lb = chartLuminance(rb);\n\treturn (Math.max(la, lb) + 0.05) / (Math.min(la, lb) + 0.05);\n}\n\n/**\n * Dark or white text, whichever reads better on `fill`; `fallback` when the fill cannot be\n * read (a CSS variable).\n */\nexport function chartTextOn(fill: string, fallback: string, dark = '#0f172a', light = '#ffffff'): string {\n\tconst rgb = parseChartColor(fill);\n\tif (!rgb) return fallback;\n\tconst darkRatio = chartContrastRatio(fill, dark)!;\n\tconst lightRatio = chartContrastRatio(fill, light)!;\n\treturn darkRatio >= lightRatio ? dark : light;\n}\n\n/** OKLab (Ottosson) from sRGB. */\nexport function chartRgbToOklab(rgb: ChartRgb): [number, number, number] {\n\tconst [r, g, b] = rgb.map(toLinear);\n\tconst l = Math.cbrt(0.4122214708 * r + 0.5363325363 * g + 0.0514459929 * b);\n\tconst m = Math.cbrt(0.2119034982 * r + 0.6806995451 * g + 0.1073969566 * b);\n\tconst s = Math.cbrt(0.0883024619 * r + 0.2817188376 * g + 0.6299787005 * b);\n\treturn [\n\t\t0.2104542553 * l + 0.793617785 * m - 0.0040720468 * s,\n\t\t1.9779984951 * l - 2.428592205 * m + 0.4505937099 * s,\n\t\t0.0259040371 * l + 0.7827717662 * m - 0.808675766 * s\n\t];\n}\n\n/** Perceptual distance between two colours (Euclidean in OKLab; ≈0.02 is just noticeable). */\nexport function chartColorDistance(a: ChartRgb, b: ChartRgb): number {\n\tconst p = chartRgbToOklab(a);\n\tconst q = chartRgbToOklab(b);\n\treturn Math.hypot(p[0] - q[0], p[1] - q[1], p[2] - q[2]);\n}\n\nexport type ChartVision = 'normal' | 'protanopia' | 'deuteranopia' | 'tritanopia';\n\n// Machado, Oliveira & Fernandes (2009), severity 1.0, applied in linear RGB.\nconst CVD: Record<Exclude<ChartVision, 'normal'>, number[][]> = {\n\tprotanopia: [\n\t\t[0.152286, 1.052583, -0.204868],\n\t\t[0.114503, 0.786281, 0.099216],\n\t\t[-0.003882, -0.048116, 1.051998]\n\t],\n\tdeuteranopia: [\n\t\t[0.367322, 0.860646, -0.227968],\n\t\t[0.280085, 0.672501, 0.047413],\n\t\t[-0.01182, 0.04294, 0.968881]\n\t],\n\ttritanopia: [\n\t\t[1.255528, -0.076749, -0.178779],\n\t\t[-0.078411, 0.930809, 0.147602],\n\t\t[0.004733, 0.691367, 0.3039]\n\t]\n};\n\n/** How a colour looks with a colour-vision deficiency (Machado et al. 2009, full severity). */\nexport function simulateChartVision(rgb: ChartRgb, vision: ChartVision): ChartRgb {\n\tif (vision === 'normal') return rgb;\n\tconst lin = rgb.map(toLinear);\n\tconst m = CVD[vision];\n\treturn m.map((row) => fromLinear(Math.max(0, Math.min(1, row[0] * lin[0] + row[1] * lin[1] + row[2] * lin[2])))) as ChartRgb;\n}\n\nexport interface ChartColorPair {\n\ta: number;\n\tb: number;\n\tcolors: [string, string];\n\tdistance: number;\n}\n\nexport interface ChartColorCheck {\n\t/** No problems found. */\n\tok: boolean;\n\t/** Per vision: the closest pair of colours and their OKLab distance. */\n\tclosest: Partial<Record<ChartVision, ChartColorPair>>;\n\t/** Contrast ratio of each colour against the surface (null when unreadable). */\n\tcontrast: (number | null)[];\n\t/** Problems, as sentences. */\n\tissues: string[];\n\t/** Colours that could not be read (CSS variables, `hsl()`); they are skipped. */\n\tskipped: string[];\n}\n\nexport interface ChartColorCheckOptions {\n\t/** The page colour behind the marks (default white). */\n\tsurface?: string;\n\t/** Smallest OKLab distance two series may have (default 0.08). */\n\tminDistance?: number;\n\t/** Smallest contrast ratio against the surface (default 1.5; WCAG asks 3 for graphics). */\n\tminContrast?: number;\n\t/** Visions to check (default all four). */\n\tvisions?: readonly ChartVision[];\n}\n\n/**\n * Checks that series colours can be told apart, with normal vision and the three\n * colour-vision deficiencies, and stand out from the surface. Returns the closest pair per\n * vision and problems as sentences.\n */\nexport function checkChartColors(colors: readonly string[], options: ChartColorCheckOptions = {}): ChartColorCheck {\n\tconst surface = options.surface ?? '#ffffff';\n\tconst minDistance = options.minDistance ?? 0.08;\n\tconst minContrast = options.minContrast ?? 1.5;\n\tconst visions = options.visions ?? (['normal', 'protanopia', 'deuteranopia', 'tritanopia'] as const);\n\tconst parsed = colors.map(parseChartColor);\n\tconst skipped = colors.filter((_, i) => !parsed[i]);\n\tconst issues: string[] = [];\n\tconst closest: ChartColorCheck['closest'] = {};\n\tfor (const vision of visions) {\n\t\tconst seen = parsed.map((c) => (c ? simulateChartVision(c, vision) : null));\n\t\tlet best: ChartColorPair | undefined;\n\t\tfor (let a = 0; a < seen.length; a++) {\n\t\t\tfor (let b = a + 1; b < seen.length; b++) {\n\t\t\t\tif (!seen[a] || !seen[b]) continue;\n\t\t\t\tconst distance = chartColorDistance(seen[a]!, seen[b]!);\n\t\t\t\tif (!best || distance < best.distance) best = { a, b, colors: [colors[a], colors[b]], distance: Math.round(distance * 1000) / 1000 };\n\t\t\t}\n\t\t}\n\t\tif (best) {\n\t\t\tclosest[vision] = best;\n\t\t\tif (best.distance < minDistance) {\n\t\t\t\tconst who = vision === 'normal' ? '' : ` with ${vision}`;\n\t\t\t\tissues.push(`Colours ${best.a + 1} (${best.colors[0]}) and ${best.b + 1} (${best.colors[1]}) are hard to tell apart${who} (distance ${best.distance}, want at least ${minDistance}).`);\n\t\t\t}\n\t\t}\n\t}\n\tconst contrast = colors.map((c) => {\n\t\tconst ratio = chartContrastRatio(c, surface);\n\t\treturn ratio === null ? null : Math.round(ratio * 100) / 100;\n\t});\n\tcontrast.forEach((ratio, i) => {\n\t\tif (ratio !== null && ratio < minContrast) issues.push(`Colour ${i + 1} (${colors[i]}) barely stands out from the background ${surface} (contrast ${ratio}:1, want at least ${minContrast}:1).`);\n\t});\n\treturn { ok: issues.length === 0, closest, contrast, issues, skipped };\n}\n","import { cyclePaletteColor } from './color.js';\nimport type {\n\tChartAxis,\n\tChartCurve,\n\tChartIssue,\n\tChartLabelPosition,\n\tChartLegend,\n\tChartLegendPosition,\n\tChartMarker,\n\tChartNumberFormat,\n\tChartOrientation,\n\tChartSeries,\n\tChartSeriesType,\n\tChartSpec,\n\tChartStacking,\n\tChartTheme,\n\tChartTrendline,\n\tChartTrendlineType,\n\tChartType,\n\tChartValue\n} from './types.js';\n\nexport const CHART_TYPES: readonly ChartType[] = ['bar', 'line', 'area', 'scatter', 'bubble', 'pie', 'donut', 'radar', 'waterfall', 'histogram', 'box', 'funnel', 'treemap'];\nexport const CHART_MARKERS: readonly ChartMarker[] = ['circle', 'square', 'diamond', 'triangle', 'cross', 'none'];\nexport const CHART_TRENDLINE_TYPES: readonly ChartTrendlineType[] = ['linear', 'exponential', 'logarithmic', 'power', 'polynomial', 'moving-average'];\nexport const CHART_LABEL_POSITIONS: readonly ChartLabelPosition[] = ['auto', 'inside', 'outside', 'center'];\nexport const CHART_AXIS_KINDS: readonly NonNullable<ChartAxis['kind']>[] = ['category', 'date'];\nexport const CHART_SERIES_TYPES: readonly ChartSeriesType[] = ['bar', 'line', 'area', 'scatter'];\nexport const CHART_STACKINGS: readonly ChartStacking[] = ['none', 'stacked', 'percent'];\nexport const CHART_CURVES: readonly ChartCurve[] = ['linear', 'smooth', 'step'];\nexport const CHART_ORIENTATIONS: readonly ChartOrientation[] = ['vertical', 'horizontal'];\nexport const CHART_LEGEND_POSITIONS: readonly ChartLegendPosition[] = ['top', 'bottom', 'left', 'right'];\nexport const CHART_NUMBER_STYLES: readonly NonNullable<ChartNumberFormat['style']>[] = ['number', 'percent', 'currency', 'compact'];\n\n/** Labels for pickers, shared by the React and Svelte components. */\nexport const CHART_TYPE_LABELS: Readonly<Record<ChartType, string>> = {\n\tbar: 'Bar',\n\tline: 'Line',\n\tarea: 'Area',\n\tscatter: 'Scatter',\n\tbubble: 'Bubble',\n\tpie: 'Pie',\n\tdonut: 'Donut',\n\tradar: 'Radar',\n\twaterfall: 'Waterfall',\n\thistogram: 'Histogram',\n\tbox: 'Box plot',\n\tfunnel: 'Funnel',\n\ttreemap: 'Treemap'\n};\n\n/** How a chart type is laid out. */\nexport type ChartFamily = 'cartesian' | 'xy' | 'pie' | 'radar' | 'waterfall' | 'histogram' | 'box' | 'funnel' | 'treemap';\n\n/** A colour-blind-friendly categorical palette (Okabe–Ito order, tuned for light and dark backgrounds). */\nexport const DEFAULT_CHART_PALETTE: readonly string[] = ['#4269d0', '#efb118', '#ff725c', '#6cc5b0', '#3ca951', '#ff8ab7', '#a463f2', '#97bbf5', '#9c6b4e', '#9498a0'];\n\nexport const DEFAULT_CHART_THEME: ChartTheme = {\n\tbackground: '#ffffff',\n\tsurface: '#ffffff',\n\ttext: '#0f172a',\n\tmutedText: '#64748b',\n\tgrid: '#e2e8f0',\n\taxis: '#94a3b8',\n\tselection: '#2563eb',\n\tpositive: '#3ca951',\n\tnegative: '#e5484d',\n\tfontFamily: 'system-ui, -apple-system, \"Segoe UI\", sans-serif',\n\tfontSize: 11,\n\ttitleSize: 15\n};\n\n/**\n * A theme that reads the page's `--background`, `--foreground`, `--muted-foreground`,\n * `--border` and `--primary` colour variables (full colours, as the other components'\n * inline styles use them), with light fallbacks. The React and Svelte canvases use it.\n */\nexport const CSS_VARIABLE_CHART_THEME: ChartTheme = {\n\t...DEFAULT_CHART_THEME,\n\tbackground: 'transparent',\n\tsurface: 'var(--background, #ffffff)',\n\ttext: 'var(--foreground, #0f172a)',\n\tmutedText: 'var(--muted-foreground, #64748b)',\n\tgrid: 'var(--border, #e2e8f0)',\n\taxis: 'var(--muted-foreground, #94a3b8)',\n\tselection: 'var(--primary, #2563eb)',\n\tfontFamily: 'inherit'\n};\n\n/** Bar, line, area and scatter: categories (or numeric x) against values, series may mix. */\nexport function isCartesianChart(type: ChartType): boolean {\n\treturn type === 'bar' || type === 'line' || type === 'area' || type === 'scatter';\n}\n\n/** Whether the chart plots series against a numeric x axis (bubble charts, and scatter charts with x values). */\nexport function isXyChart(spec: Pick<ChartSpec, 'type' | 'series'>): boolean {\n\tif (spec.type === 'bubble') return true;\n\treturn spec.type === 'scatter' && spec.series.some((s) => !s.hidden && Array.isArray(s.x) && s.x.some((v) => v !== null));\n}\n\n/** How a chart is laid out (see `ChartType`). */\nexport function chartFamily(spec: Pick<ChartSpec, 'type' | 'series'>): ChartFamily {\n\tif (isXyChart(spec)) return 'xy';\n\tswitch (spec.type) {\n\t\tcase 'pie':\n\t\tcase 'donut':\n\t\t\treturn 'pie';\n\t\tcase 'radar':\n\t\tcase 'waterfall':\n\t\tcase 'histogram':\n\t\tcase 'box':\n\t\tcase 'funnel':\n\t\tcase 'treemap':\n\t\t\treturn spec.type;\n\t\tcase 'bubble':\n\t\t\treturn 'xy';\n\t\tdefault:\n\t\t\treturn 'cartesian';\n\t}\n}\n\n/** Chart types whose legend lists categories (one colour per category) rather than series. */\nexport function chartColorsByCategory(type: ChartType): boolean {\n\treturn type === 'pie' || type === 'donut' || type === 'funnel' || type === 'treemap';\n}\n\nexport function defaultChartAxis(value: boolean): ChartAxis {\n\treturn { show: true, title: '', min: null, max: null, step: null, gridlines: value, format: {} };\n}\n\n/** A complete spec with every default filled in. */\nexport function createChartSpec(partial: Partial<ChartSpec> = {}): ChartSpec {\n\treturn normalizeChartSpec(partial).spec;\n}\n\n/** The colour a series is drawn with. */\nexport function chartSeriesColor(spec: Pick<ChartSpec, 'palette' | 'series'>, seriesIndex: number): string {\n\tconst series = spec.series[seriesIndex];\n\tif (series?.color) return series.color;\n\treturn cyclePaletteColor(spec.palette.length ? spec.palette : DEFAULT_CHART_PALETTE, seriesIndex);\n}\n\n/** The colour a pie slice is drawn with (by category). */\nexport function chartSliceColor(spec: Pick<ChartSpec, 'palette'>, index: number): string {\n\treturn cyclePaletteColor(spec.palette.length ? spec.palette : DEFAULT_CHART_PALETTE, index);\n}\n\n/** The colour of one bar or point: its override, else the series colour. */\nexport function chartPointColor(spec: Pick<ChartSpec, 'palette' | 'series'>, seriesIndex: number, index: number): string {\n\treturn spec.series[seriesIndex]?.pointColors?.[index] || chartSeriesColor(spec, seriesIndex);\n}\n\n/** How a series is drawn in a cartesian chart. */\nexport function chartSeriesType(spec: Pick<ChartSpec, 'type'>, series: ChartSeries): ChartSeriesType {\n\tif (series.type) return series.type;\n\tif (spec.type === 'bubble') return 'scatter';\n\treturn isCartesianChart(spec.type) ? (spec.type as ChartSeriesType) : 'bar';\n}\n\n/** An id not used by any series (`series-1`, `series-2`, …). */\nexport function uniqueChartSeriesId(series: readonly Pick<ChartSeries, 'id'>[], base = 'series'): string {\n\tconst used = new Set(series.map((s) => s.id));\n\tfor (let i = series.length + 1; ; i++) {\n\t\tconst id = `${base}-${i}`;\n\t\tif (!used.has(id)) return id;\n\t}\n}\n\n/**\n * Reads a number the way people type it in a data grid: `1,234.5`, `12%` (→ 0.12),\n * `$40`, `(3)` (→ -3). Blank → `null`. Returns `undefined` when it is not a number.\n */\nexport function parseChartValue(input: unknown): ChartValue | undefined {\n\tif (input === null || input === undefined) return null;\n\tif (typeof input === 'number') return Number.isFinite(input) ? input : undefined;\n\tif (typeof input !== 'string') return undefined;\n\tlet text = input.trim();\n\tif (!text || text === '-' || text === '—') return null;\n\tlet negative = false;\n\tif (/^\\(.*\\)$/.test(text)) {\n\t\tnegative = true;\n\t\ttext = text.slice(1, -1).trim();\n\t}\n\tconst percent = text.endsWith('%');\n\tif (percent) text = text.slice(0, -1).trim();\n\ttext = text.replace(/^[$€£¥]/, '').replace(/,/g, '').replace(/\\s+/g, '');\n\tif (!/^[-+]?(\\d+\\.?\\d*|\\.\\d+)(e[-+]?\\d+)?$/i.test(text)) return undefined;\n\tlet value = Number(text);\n\tif (percent) value /= 100;\n\tif (negative) value = -value;\n\treturn Number.isFinite(value) ? value : undefined;\n}\n\nconst isRecord = (value: unknown): value is Record<string, unknown> => typeof value === 'object' && value !== null && !Array.isArray(value);\n\nfunction pick<T extends string>(value: unknown, options: readonly T[], fallback: T, path: string, issues: ChartIssue[]): T {\n\tif (value === undefined) return fallback;\n\tif (typeof value === 'string' && (options as readonly string[]).includes(value)) return value as T;\n\tissues.push({ path, message: `${path} must be one of ${options.map((o) => `\"${o}\"`).join(', ')}; got ${JSON.stringify(value)}.` });\n\treturn fallback;\n}\n\nfunction text(value: unknown, fallback: string, path: string, issues: ChartIssue[]): string {\n\tif (value === undefined || value === null) return fallback;\n\tif (typeof value === 'string') return value;\n\tif (typeof value === 'number' || typeof value === 'boolean') return String(value);\n\tissues.push({ path, message: `${path} must be text.` });\n\treturn fallback;\n}\n\nfunction flag(value: unknown, fallback: boolean, path: string, issues: ChartIssue[]): boolean {\n\tif (value === undefined) return fallback;\n\tif (typeof value === 'boolean') return value;\n\tissues.push({ path, message: `${path} must be true or false.` });\n\treturn fallback;\n}\n\nfunction bound(value: unknown, path: string, issues: ChartIssue[]): number | null {\n\tif (value === undefined || value === null || value === '') return null;\n\tconst n = typeof value === 'string' ? Number(value) : value;\n\tif (typeof n === 'number' && Number.isFinite(n)) return n;\n\tissues.push({ path, message: `${path} must be a number or null.` });\n\treturn null;\n}\n\nfunction normalizeFormat(value: unknown, path: string, issues: ChartIssue[]): ChartNumberFormat {\n\tif (value === undefined || value === null) return {};\n\tif (!isRecord(value)) {\n\t\tissues.push({ path, message: `${path} must be an object.` });\n\t\treturn {};\n\t}\n\tconst out: ChartNumberFormat = {};\n\tif (value.style !== undefined) out.style = pick(value.style, CHART_NUMBER_STYLES, 'number', `${path}.style`, issues);\n\tif (value.decimals !== undefined) {\n\t\tconst d = Number(value.decimals);\n\t\tif (Number.isInteger(d) && d >= 0 && d <= 10) out.decimals = d;\n\t\telse issues.push({ path: `${path}.decimals`, message: `${path}.decimals must be a whole number from 0 to 10.` });\n\t}\n\tfor (const key of ['currency', 'prefix', 'suffix', 'code'] as const) {\n\t\tif (value[key] !== undefined) out[key] = text(value[key], '', `${path}.${key}`, issues);\n\t}\n\treturn out;\n}\n\nexport function normalizeChartAxis(value: unknown, fallback: ChartAxis, path: string, issues: ChartIssue[] = []): ChartAxis {\n\tif (value === undefined) return { ...fallback, format: { ...fallback.format } };\n\tif (!isRecord(value)) {\n\t\tissues.push({ path, message: `${path} must be an object.` });\n\t\treturn { ...fallback, format: { ...fallback.format } };\n\t}\n\tlet min = 'min' in value ? bound(value.min, `${path}.min`, issues) : fallback.min;\n\tlet max = 'max' in value ? bound(value.max, `${path}.max`, issues) : fallback.max;\n\tif (min !== null && max !== null && min >= max) {\n\t\tissues.push({ path: `${path}.max`, message: `${path}.max (${max}) must be greater than ${path}.min (${min}).` });\n\t\tmin = fallback.min;\n\t\tmax = fallback.max;\n\t}\n\tlet step = 'step' in value ? bound(value.step, `${path}.step`, issues) : fallback.step;\n\tif (step !== null && !(step > 0)) {\n\t\tissues.push({ path: `${path}.step`, message: `${path}.step must be greater than 0 (or null for automatic).` });\n\t\tstep = fallback.step;\n\t}\n\tconst axis: ChartAxis = {\n\t\tshow: flag(value.show, fallback.show, `${path}.show`, issues),\n\t\ttitle: text(value.title, fallback.title, `${path}.title`, issues),\n\t\tmin,\n\t\tmax,\n\t\tstep,\n\t\tgridlines: flag(value.gridlines, fallback.gridlines, `${path}.gridlines`, issues),\n\t\tformat: 'format' in value ? normalizeFormat(value.format, `${path}.format`, issues) : { ...fallback.format }\n\t};\n\tconst kind = 'kind' in value ? (value.kind === null ? undefined : pick(value.kind, CHART_AXIS_KINDS, 'category', `${path}.kind`, issues)) : fallback.kind;\n\tif (kind && kind !== 'category') axis.kind = kind;\n\treturn axis;\n}\n\nfunction normalizeLegend(value: unknown, issues: ChartIssue[]): ChartLegend {\n\tconst fallback: ChartLegend = { show: true, position: 'bottom' };\n\tif (value === undefined) return fallback;\n\tif (!isRecord(value)) {\n\t\tissues.push({ path: 'legend', message: 'legend must be an object.' });\n\t\treturn fallback;\n\t}\n\treturn {\n\t\tshow: flag(value.show, fallback.show, 'legend.show', issues),\n\t\tposition: pick(value.position, CHART_LEGEND_POSITIONS, fallback.position, 'legend.position', issues)\n\t};\n}\n\n/** Values as numbers or nulls; bad entries become null and are reported. */\nexport function normalizeChartValues(value: unknown, length: number | undefined, path: string, issues: ChartIssue[] = []): ChartValue[] {\n\tif (value === undefined) return length ? Array(length).fill(null) : [];\n\tif (!Array.isArray(value)) {\n\t\tissues.push({ path, message: `${path} must be an array of numbers.` });\n\t\treturn length ? Array(length).fill(null) : [];\n\t}\n\tconst out = value.map((v, i) => {\n\t\tconst parsed = parseChartValue(v);\n\t\tif (parsed === undefined) {\n\t\t\tissues.push({ path: `${path}[${i}]`, message: `${path}[${i}] is not a number: ${JSON.stringify(v)}.` });\n\t\t\treturn null;\n\t\t}\n\t\treturn parsed;\n\t});\n\tif (length === undefined) return out;\n\tif (out.length > length) return out.slice(0, length);\n\twhile (out.length < length) out.push(null);\n\treturn out;\n}\n\nfunction normalizeSeries(value: unknown, length: number, used: Set<string>, index: number, issues: ChartIssue[]): ChartSeries | null {\n\tconst path = `series[${index}]`;\n\tif (!isRecord(value)) {\n\t\tissues.push({ path, message: `${path} must be an object with a name and values.` });\n\t\treturn null;\n\t}\n\tlet id = typeof value.id === 'string' && value.id.trim() ? value.id.trim() : '';\n\tif (!id || used.has(id)) {\n\t\tif (id) issues.push({ path: `${path}.id`, message: `Series id \"${id}\" is used twice; the second was renamed.` });\n\t\tfor (let n = index + 1; ; n++) {\n\t\t\tid = `series-${n}`;\n\t\t\tif (!used.has(id)) break;\n\t\t}\n\t}\n\tused.add(id);\n\tconst series: ChartSeries = {\n\t\tid,\n\t\tname: text(value.name, `Series ${index + 1}`, `${path}.name`, issues),\n\t\tvalues: normalizeChartValues(value.values, length, `${path}.values`, issues)\n\t};\n\tif (typeof value.color === 'string' && value.color.trim()) series.color = value.color.trim();\n\tif (value.type !== undefined && value.type !== null) series.type = pick(value.type, CHART_SERIES_TYPES, 'bar', `${path}.type`, issues);\n\tif (value.hidden === true) series.hidden = true;\n\tif (value.axis !== undefined && value.axis !== null && pick(value.axis, ['primary', 'secondary'] as const, 'primary', `${path}.axis`, issues) === 'secondary') series.axis = 'secondary';\n\tfor (const key of ['x', 'sizes'] as const) {\n\t\tif (value[key] === undefined || value[key] === null) continue;\n\t\tconst list = normalizeChartValues(value[key], length, `${path}.${key}`, issues);\n\t\tif (list.some((v) => v !== null)) series[key] = list;\n\t}\n\tif (key(value, 'sizes') && series.sizes?.some((v) => v !== null && v < 0)) {\n\t\tissues.push({ path: `${path}.sizes`, message: `${path}.sizes must not be negative.` });\n\t\tseries.sizes = series.sizes.map((v) => (v !== null && v < 0 ? null : v));\n\t}\n\tif (value.pointColors !== undefined && value.pointColors !== null) {\n\t\tif (!Array.isArray(value.pointColors)) issues.push({ path: `${path}.pointColors`, message: `${path}.pointColors must be an array of colours or nulls.` });\n\t\telse {\n\t\t\tconst colors = Array.from({ length }, (_, i) => {\n\t\t\t\tconst c = (value.pointColors as unknown[])[i];\n\t\t\t\treturn typeof c === 'string' && c.trim() ? c.trim() : null;\n\t\t\t});\n\t\t\tif (colors.some((c) => c !== null)) series.pointColors = colors;\n\t\t}\n\t}\n\tif (value.marker !== undefined && value.marker !== null) series.marker = pick(value.marker, CHART_MARKERS, 'circle', `${path}.marker`, issues);\n\tif (value.curve !== undefined && value.curve !== null) series.curve = pick(value.curve, CHART_CURVES, 'linear', `${path}.curve`, issues);\n\tif (value.dataLabels !== undefined && value.dataLabels !== null) series.dataLabels = flag(value.dataLabels, false, `${path}.dataLabels`, issues);\n\tif (value.format !== undefined && value.format !== null) {\n\t\tconst format = normalizeFormat(value.format, `${path}.format`, issues);\n\t\tif (Object.keys(format).length) series.format = format;\n\t}\n\tif (value.trendlines !== undefined && value.trendlines !== null) {\n\t\tif (!Array.isArray(value.trendlines)) issues.push({ path: `${path}.trendlines`, message: `${path}.trendlines must be an array.` });\n\t\telse {\n\t\t\tconst lines = value.trendlines.map((t, i) => normalizeChartTrendline(t, `${path}.trendlines[${i}]`, issues)).filter((t): t is ChartTrendline => t !== null);\n\t\t\tif (lines.length) series.trendlines = lines;\n\t\t}\n\t}\n\treturn series;\n}\n\nconst key = (value: Record<string, unknown>, name: string) => value[name] !== undefined && value[name] !== null;\n\n/** Checks one trendline; `null` (reported) when it is unusable. */\nexport function normalizeChartTrendline(value: unknown, path: string, issues: ChartIssue[] = []): ChartTrendline | null {\n\tif (!isRecord(value)) {\n\t\tissues.push({ path, message: `${path} must be an object with a type.` });\n\t\treturn null;\n\t}\n\tconst type = pick(value.type, CHART_TRENDLINE_TYPES, 'linear', `${path}.type`, issues);\n\tconst line: ChartTrendline = { type };\n\tconst whole = (name: 'order' | 'period', min: number, max: number) => {\n\t\tif (!key(value, name)) return;\n\t\tconst n = Number(value[name]);\n\t\tif (Number.isInteger(n) && n >= min && n <= max) line[name] = n;\n\t\telse issues.push({ path: `${path}.${name}`, message: `${path}.${name} must be a whole number from ${min} to ${max}.` });\n\t};\n\tif (type === 'polynomial') whole('order', 2, 6);\n\tif (type === 'moving-average') whole('period', 2, 1000);\n\tfor (const name of ['forward', 'backward'] as const) {\n\t\tif (!key(value, name)) continue;\n\t\tconst n = Number(value[name]);\n\t\tif (Number.isFinite(n) && n >= 0) {\n\t\t\tif (n > 0) line[name] = n;\n\t\t} else issues.push({ path: `${path}.${name}`, message: `${path}.${name} must be a number of x units, 0 or more.` });\n\t}\n\tif (key(value, 'intercept')) {\n\t\tconst n = Number(value.intercept);\n\t\tif (!Number.isFinite(n)) issues.push({ path: `${path}.intercept`, message: `${path}.intercept must be a number or null.` });\n\t\telse if (type === 'linear' || type === 'polynomial' || type === 'exponential') {\n\t\t\tif (type === 'exponential' && n <= 0) issues.push({ path: `${path}.intercept`, message: `${path}.intercept must be greater than 0 for an exponential trendline.` });\n\t\t\telse line.intercept = n;\n\t\t} else issues.push({ path: `${path}.intercept`, message: `A ${type} trendline cannot have a fixed intercept; use linear, polynomial or exponential.` });\n\t}\n\tfor (const name of ['showEquation', 'showR2'] as const) if (key(value, name) && flag(value[name], false, `${path}.${name}`, issues)) line[name] = true;\n\tfor (const name of ['name', 'color'] as const) {\n\t\tif (!key(value, name)) continue;\n\t\tconst t = text(value[name], '', `${path}.${name}`, issues).trim();\n\t\tif (t) line[name] = t;\n\t}\n\treturn line;\n}\n\n/**\n * Turns any input (a partial spec, saved JSON, an agent's arguments) into a complete,\n * valid `ChartSpec`. Every value is checked; problems are reported as sentences in\n * `issues` and replaced by defaults, so the result is always drawable. Series values are\n * padded or trimmed to the number of categories.\n */\nexport function normalizeChartSpec(input: unknown): { spec: ChartSpec; issues: ChartIssue[] } {\n\tconst issues: ChartIssue[] = [];\n\tconst value = isRecord(input) ? input : {};\n\tif (input !== undefined && !isRecord(input)) issues.push({ path: '', message: 'A chart must be an object.' });\n\tconst type = pick(value.type, CHART_TYPES, 'bar', 'type', issues);\n\tconst rawSeries = Array.isArray(value.series) ? value.series : [];\n\tif (value.series !== undefined && !Array.isArray(value.series)) issues.push({ path: 'series', message: 'series must be an array.' });\n\n\tlet categories: string[];\n\tif (Array.isArray(value.categories)) categories = value.categories.map((c, i) => text(c, '', `categories[${i}]`, issues));\n\telse {\n\t\tif (value.categories !== undefined) issues.push({ path: 'categories', message: 'categories must be an array of labels.' });\n\t\tconst longest = rawSeries.reduce<number>((n, s) => Math.max(n, isRecord(s) && Array.isArray(s.values) ? s.values.length : 0), 0);\n\t\tcategories = Array.from({ length: longest }, (_, i) => `${i + 1}`);\n\t}\n\n\tconst used = new Set<string>();\n\tconst series = rawSeries.map((s, i) => normalizeSeries(s, categories.length, used, i, issues)).filter((s): s is ChartSeries => s !== null);\n\n\tlet palette = [...DEFAULT_CHART_PALETTE];\n\tif (Array.isArray(value.palette)) {\n\t\tconst colors = value.palette.filter((c): c is string => typeof c === 'string' && c.trim() !== '');\n\t\tif (colors.length) palette = colors;\n\t\telse issues.push({ path: 'palette', message: 'palette must list at least one colour.' });\n\t} else if (value.palette !== undefined) issues.push({ path: 'palette', message: 'palette must be an array of colours.' });\n\n\tconst fraction = (name: string, fallback: number, min: number, max: number) => {\n\t\tif (value[name] === undefined) return fallback;\n\t\tconst r = Number(value[name]);\n\t\tif (value[name] !== null && Number.isFinite(r) && r >= min && r <= max) return r;\n\t\tissues.push({ path: name, message: `${name} must be a number from ${min} to ${max}.` });\n\t\treturn fallback;\n\t};\n\tconst innerRadius = fraction('innerRadius', 0.55, 0, 0.9);\n\tconst gapWidth = fraction('gapWidth', 0.28, 0, 0.9);\n\tconst overlap = fraction('overlap', -0.12, -1, 1);\n\tlet bins: number | null = null;\n\tif (value.bins !== undefined && value.bins !== null) {\n\t\tconst b = Number(value.bins);\n\t\tif (Number.isInteger(b) && b >= 1 && b <= 500) bins = b;\n\t\telse issues.push({ path: 'bins', message: 'bins must be a whole number from 1 to 500, or null for automatic.' });\n\t}\n\n\tconst spec: ChartSpec = {\n\t\tversion: 1,\n\t\ttype,\n\t\ttitle: text(value.title, '', 'title', issues),\n\t\tsubtitle: text(value.subtitle, '', 'subtitle', issues),\n\t\tcategories,\n\t\tseries,\n\t\txAxis: normalizeChartAxis(value.xAxis, defaultChartAxis(false), 'xAxis', issues),\n\t\tyAxis: normalizeChartAxis(value.yAxis, defaultChartAxis(true), 'yAxis', issues),\n\t\tyAxis2: normalizeChartAxis(value.yAxis2, defaultChartAxis(false), 'yAxis2', issues),\n\t\tlegend: normalizeLegend(value.legend, issues),\n\t\tstacking: pick(value.stacking, CHART_STACKINGS, 'none', 'stacking', issues),\n\t\torientation: pick(value.orientation, CHART_ORIENTATIONS, 'vertical', 'orientation', issues),\n\t\tcurve: pick(value.curve, CHART_CURVES, 'linear', 'curve', issues),\n\t\tpoints: flag(value.points, true, 'points', issues),\n\t\tdataLabels: flag(value.dataLabels, false, 'dataLabels', issues),\n\t\tlabelPosition: pick(value.labelPosition, CHART_LABEL_POSITIONS, 'auto', 'labelPosition', issues),\n\t\tpalette,\n\t\tinnerRadius,\n\t\tgapWidth,\n\t\toverlap,\n\t\tbins,\n\t\tshowTotal: flag(value.showTotal, true, 'showTotal', issues)\n\t};\n\treturn { spec, issues };\n}\n\n/** A deep copy (specs are plain JSON). */\nexport function cloneChartSpec(spec: ChartSpec): ChartSpec {\n\treturn {\n\t\t...spec,\n\t\tcategories: [...spec.categories],\n\t\tseries: spec.series.map(cloneChartSeries),\n\t\txAxis: { ...spec.xAxis, format: { ...spec.xAxis.format } },\n\t\tyAxis: { ...spec.yAxis, format: { ...spec.yAxis.format } },\n\t\tyAxis2: { ...spec.yAxis2, format: { ...spec.yAxis2.format } },\n\t\tlegend: { ...spec.legend },\n\t\tpalette: [...spec.palette]\n\t};\n}\n\nexport function cloneChartSeries(series: ChartSeries): ChartSeries {\n\tconst copy: ChartSeries = { ...series, values: [...series.values] };\n\tif (series.x) copy.x = [...series.x];\n\tif (series.sizes) copy.sizes = [...series.sizes];\n\tif (series.pointColors) copy.pointColors = [...series.pointColors];\n\tif (series.format) copy.format = { ...series.format };\n\tif (series.trendlines) copy.trendlines = series.trendlines.map((t) => ({ ...t }));\n\treturn copy;\n}\n\nexport interface ChartTableOptions {\n\t/**\n\t * `columns` (default): the first column holds categories and each other column is a\n\t * series. `rows`: the first row holds categories and each other row is a series.\n\t */\n\tseriesIn?: 'columns' | 'rows';\n\t/**\n\t * The first row (or column for `rows`) holds series names (default `true`). `auto`: only\n\t * when one of its value cells is not a number.\n\t */\n\theader?: boolean | 'auto';\n\t/**\n\t * Read the first column as numeric x values (scatter and bubble charts): every series gets\n\t * them as `x`, and the categories are their labels.\n\t */\n\txFromFirstColumn?: boolean;\n}\n\nexport interface ChartTableData {\n\tcategories: string[];\n\tseries: ChartSeries[];\n\tissues: ChartIssue[];\n}\n\n/**\n * Reads a grid of cells (from CSV, a spreadsheet range or the clipboard) as categories and\n * series. Cells that are not numbers become gaps and are reported.\n */\nexport function chartDataFromTable(rows: ReadonlyArray<ReadonlyArray<unknown>>, options: ChartTableOptions = {}): ChartTableData {\n\tlet grid = rows.map((r) => [...r]).filter((r) => r.some((c) => c !== null && c !== undefined && String(c).trim() !== ''));\n\tif (options.seriesIn === 'rows') {\n\t\tconst width = Math.max(0, ...grid.map((r) => r.length));\n\t\tgrid = Array.from({ length: width }, (_, c) => grid.map((r) => r[c]));\n\t}\n\tconst issues: ChartIssue[] = [];\n\tif (!grid.length) return { categories: [], series: [], issues };\n\tconst width = Math.max(...grid.map((r) => r.length));\n\tconst header = options.header === 'auto' ? grid[0].slice(1).some((c) => c !== null && c !== undefined && String(c).trim() !== '' && parseChartValue(c) === undefined) : (options.header ?? true);\n\tconst names = header ? grid[0] : [];\n\tconst body = header ? grid.slice(1) : grid;\n\tconst categories = body.map((r, i) => {\n\t\tconst c = r[0];\n\t\treturn c === null || c === undefined || String(c).trim() === '' ? `${i + 1}` : String(c).trim();\n\t});\n\tconst series: ChartSeries[] = [];\n\tfor (let col = 1; col < width; col++) {\n\t\tconst name = names[col] !== undefined && String(names[col]).trim() ? String(names[col]).trim() : `Series ${col}`;\n\t\tconst values = body.map((r, i) => {\n\t\t\tconst parsed = parseChartValue(r[col] ?? null);\n\t\t\tif (parsed === undefined) {\n\t\t\t\tissues.push({ path: `${name}[${i}]`, message: `\"${String(r[col])}\" in ${name} (${categories[i]}) is not a number; it was left blank.` });\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\treturn parsed;\n\t\t});\n\t\tseries.push({ id: `series-${col}`, name, values });\n\t}\n\tif (options.xFromFirstColumn) {\n\t\tconst x = body.map((r, i) => {\n\t\t\tconst parsed = parseChartValue(r[0] ?? null);\n\t\t\tif (parsed === undefined) issues.push({ path: `x[${i}]`, message: `\"${String(r[0])}\" in the first column is not a number; that point has no x.` });\n\t\t\treturn parsed ?? null;\n\t\t});\n\t\tfor (const s of series) s.x = [...x];\n\t}\n\treturn { categories, series, issues };\n}\n\n/** The chart's data as a grid: a header row of series names, then one row per category. */\nexport function chartDataToTable(spec: Pick<ChartSpec, 'categories' | 'series'>, options: { categoryHeader?: string } = {}): (string | number | null)[][] {\n\treturn [\n\t\t[options.categoryHeader ?? '', ...spec.series.map((s) => s.name)],\n\t\t...spec.categories.map((category, i) => [category, ...spec.series.map((s) => s.values[i] ?? null)])\n\t];\n}\n\n/** A colour input value (`#rrggbb`) for a CSS colour: `#abc` expands, non-hex colours show as black. */\nexport function chartColorInputValue(color: string): string {\n\tif (/^#[0-9a-f]{6}$/i.test(color)) return color.toLowerCase();\n\tif (/^#[0-9a-f]{3}$/i.test(color)) return `#${[...color.slice(1)].map((c) => c + c).join('')}`.toLowerCase();\n\treturn '#000000';\n}\n"]}
@@ -8,7 +8,7 @@ var _chunk3CC7OPUQcjs = require('./chunk-3CC7OPUQ.cjs');
8
8
 
9
9
 
10
10
 
11
- var _chunkPIMCHMZEcjs = require('./chunk-PIMCHMZE.cjs');
11
+ var _chunk3JNRQVTScjs = require('./chunk-3JNRQVTS.cjs');
12
12
 
13
13
 
14
14
 
@@ -32,10 +32,10 @@ var _chunkPIMCHMZEcjs = require('./chunk-PIMCHMZE.cjs');
32
32
 
33
33
 
34
34
 
35
- var _chunkMUCYWI6Wcjs = require('./chunk-MUCYWI6W.cjs');
35
+ var _chunkFEMIVHN3cjs = require('./chunk-FEMIVHN3.cjs');
36
36
 
37
37
 
38
- var _chunkPRSJJZBScjs = require('./chunk-PRSJJZBS.cjs');
38
+ var _chunkJOX6MJW4cjs = require('./chunk-JOX6MJW4.cjs');
39
39
 
40
40
 
41
41
  var _chunkCS6NZWWAcjs = require('./chunk-CS6NZWWA.cjs');
@@ -2461,13 +2461,13 @@ async function loadCharts(zip, Parser, root, rels, options) {
2461
2461
  const charts = /* @__PURE__ */ new Map();
2462
2462
  if (options.charts === false) return charts;
2463
2463
  for (const el of descendants(root, "chart")) {
2464
- if (el.namespaceURI !== _chunkPIMCHMZEcjs.CHART_OOXML_NS) continue;
2464
+ if (el.namespaceURI !== _chunk3JNRQVTScjs.CHART_OOXML_NS) continue;
2465
2465
  const id = attr(el, "id");
2466
2466
  const rel = id ? rels.get(id) : void 0;
2467
2467
  if (!id || !rel || rel.external || charts.has(id)) continue;
2468
2468
  const entry = zip.get(rel.target);
2469
2469
  if (!entry) continue;
2470
- const read = _chunkPIMCHMZEcjs.chartFromOoxml.call(void 0, await zip.readText(entry), { DOMParser: Parser });
2470
+ const read = _chunk3JNRQVTScjs.chartFromOoxml.call(void 0, await zip.readText(entry), { DOMParser: Parser });
2471
2471
  charts.set(id, {
2472
2472
  id: `chart-${charts.size + 1}`,
2473
2473
  path: rel.target,
@@ -2481,7 +2481,7 @@ async function loadCharts(zip, Parser, root, rels, options) {
2481
2481
  return charts;
2482
2482
  }
2483
2483
  function chartBlockHtml(chart) {
2484
- const [head, ...rows] = _chunkPRSJJZBScjs.chartDataToTable.call(void 0, chart.spec);
2484
+ const [head, ...rows] = _chunkJOX6MJW4cjs.chartDataToTable.call(void 0, chart.spec);
2485
2485
  const cell = (v, tag) => `<${tag}><p>${_chunk66IMF6ODcjs.escapeHtml.call(void 0, v === null || v === void 0 ? "" : String(v))}</p></${tag}>`;
2486
2486
  const table = `<table><tbody><tr>${head.map((h) => cell(h, "th")).join("")}</tr>${rows.map((r) => `<tr>${r.map((v, i) => cell(v, i ? "td" : "th")).join("")}</tr>`).join("")}</tbody></table>`;
2487
2487
  const caption = `<p>${_chunk66IMF6ODcjs.escapeHtml.call(void 0, `[Chart: ${chart.title || "untitled"}]`)}</p>`;
@@ -3134,7 +3134,7 @@ var ParagraphRenderer = (_class2 = class {
3134
3134
  };
3135
3135
  if (child.localName === "AlternateContent") {
3136
3136
  const branch = childElements(child).find(
3137
- (b) => descendants(b, "blip").length || descendants(b, "imagedata").length || descendants(b, "chart").some((el) => el.namespaceURI === _chunkPIMCHMZEcjs.CHART_OOXML_NS)
3137
+ (b) => descendants(b, "blip").length || descendants(b, "imagedata").length || descendants(b, "chart").some((el) => el.namespaceURI === _chunk3JNRQVTScjs.CHART_OOXML_NS)
3138
3138
  );
3139
3139
  if (branch) this.image(branch, format, push);
3140
3140
  return;
@@ -3201,7 +3201,7 @@ var ParagraphRenderer = (_class2 = class {
3201
3201
  /** Charts this paragraph contains, in order. */
3202
3202
  __init4() {this.charts = []}
3203
3203
  image(container, format, push) {
3204
- const chartRef = descendants(container, "chart").find((el) => el.namespaceURI === _chunkPIMCHMZEcjs.CHART_OOXML_NS);
3204
+ const chartRef = descendants(container, "chart").find((el) => el.namespaceURI === _chunk3JNRQVTScjs.CHART_OOXML_NS);
3205
3205
  const chart = chartRef ? this.part.charts.get(_nullishCoalesce(attr(chartRef, "id"), () => ( ""))) : void 0;
3206
3206
  if (chart) {
3207
3207
  if (!this.ctx.charts.includes(chart)) this.ctx.charts.push(chart);
@@ -3640,9 +3640,9 @@ function insertImportedDocument(target, content, options = {}) {
3640
3640
  if (!htmlSlice && from === to && !state.doc.resolve(from).parent.inlineContent) {
3641
3641
  from = to = _state.Selection.near(state.doc.resolve(from)).from;
3642
3642
  }
3643
- if (htmlSlice && _chunkMUCYWI6Wcjs.sliceContainsTable.call(void 0, htmlSlice) && _chunkMUCYWI6Wcjs.outermostTableDepth.call(void 0, state.doc.resolve(from)) >= 0) {
3643
+ if (htmlSlice && _chunkFEMIVHN3cjs.sliceContainsTable.call(void 0, htmlSlice) && _chunkFEMIVHN3cjs.outermostTableDepth.call(void 0, state.doc.resolve(from)) >= 0) {
3644
3644
  const tr2 = state.tr;
3645
- const end2 = _chunkMUCYWI6Wcjs.insertSliceAfterTable.call(void 0, tr2, from, to, htmlSlice);
3645
+ const end2 = _chunkFEMIVHN3cjs.insertSliceAfterTable.call(void 0, tr2, from, to, htmlSlice);
3646
3646
  if (end2 !== null) {
3647
3647
  if (options.at === void 0) tr2.setSelection(_state.Selection.near(tr2.doc.resolve(end2), -1));
3648
3648
  view.dispatch(tr2.scrollIntoView().setMeta("uiEvent", "drop"));
@@ -3819,7 +3819,7 @@ var RichClipboard = _core.Extension.create({
3819
3819
  const slice = _chunkHNDSPZ5Tcjs.readRichClipboard.call(void 0, event, view.state.schema, mimeType);
3820
3820
  if (!slice) return false;
3821
3821
  event.preventDefault();
3822
- if (_chunkMUCYWI6Wcjs.handleTablePasteWithoutNesting.call(void 0, view, event, slice)) return true;
3822
+ if (_chunkFEMIVHN3cjs.handleTablePasteWithoutNesting.call(void 0, view, event, slice)) return true;
3823
3823
  view.dispatch(
3824
3824
  view.state.tr.replaceSelection(slice).scrollIntoView().setMeta("paste", true).setMeta("uiEvent", "paste")
3825
3825
  );
@@ -4220,7 +4220,7 @@ function createOutlineStore(editor) {
4220
4220
  if (!editor || editor.isDestroyed) return EMPTY_SNAPSHOT;
4221
4221
  const headings = getOutline(editor);
4222
4222
  const activeId = _nullishCoalesce(_optionalChain([getActiveHeading, 'call', _161 => _161(editor, headings), 'optionalAccess', _162 => _162.id]), () => ( null));
4223
- const sameStructure = _chunkMUCYWI6Wcjs.arraysEqual.call(void 0, snapshot.headings, headings, sameHeading);
4223
+ const sameStructure = _chunkFEMIVHN3cjs.arraysEqual.call(void 0, snapshot.headings, headings, sameHeading);
4224
4224
  if (sameStructure && snapshot.activeId === activeId) return snapshot;
4225
4225
  return {
4226
4226
  headings: sameStructure ? snapshot.headings : headings,
@@ -4268,7 +4268,7 @@ function navigateToHeading(editor, heading, options = {}) {
4268
4268
  editor.view.dispatch(tr);
4269
4269
  editor.view.focus();
4270
4270
  }
4271
- _chunkMUCYWI6Wcjs.scrollDomAtPos.call(void 0, editor.view, current.pos, behavior);
4271
+ _chunkFEMIVHN3cjs.scrollDomAtPos.call(void 0, editor.view, current.pos, behavior);
4272
4272
  return true;
4273
4273
  }
4274
4274
  function assignHeadingIds(state, types, generateId) {
@@ -4293,11 +4293,11 @@ function assignHeadingIds(state, types, generateId) {
4293
4293
  }
4294
4294
  var Outline = _core.Extension.create({
4295
4295
  name: "outline",
4296
- priority: _chunkMUCYWI6Wcjs.STRUCTURE_PRIORITY,
4296
+ priority: _chunkFEMIVHN3cjs.STRUCTURE_PRIORITY,
4297
4297
  addOptions() {
4298
4298
  return {
4299
4299
  types: ["heading"],
4300
- generateId: () => _chunkMUCYWI6Wcjs.generateStructureId.call(void 0, "h"),
4300
+ generateId: () => _chunkFEMIVHN3cjs.generateStructureId.call(void 0, "h"),
4301
4301
  onUpdate: void 0
4302
4302
  };
4303
4303
  },
@@ -4330,14 +4330,14 @@ var Outline = _core.Extension.create({
4330
4330
  tr.scrollIntoView();
4331
4331
  _optionalChain([view, 'optionalAccess', _169 => _169.focus, 'optionalCall', _170 => _170()]);
4332
4332
  }
4333
- _chunkMUCYWI6Wcjs.scrollDomAtPos.call(void 0, view, heading.pos, options.behavior);
4333
+ _chunkFEMIVHN3cjs.scrollDomAtPos.call(void 0, view, heading.pos, options.behavior);
4334
4334
  }
4335
4335
  return true;
4336
4336
  },
4337
4337
  scrollToHeading: (id, options = {}) => ({ state, dispatch, view }) => {
4338
4338
  const heading = findHeading(state, id);
4339
4339
  if (!heading) return false;
4340
- if (dispatch) _chunkMUCYWI6Wcjs.scrollDomAtPos.call(void 0, view, heading.pos, options.behavior);
4340
+ if (dispatch) _chunkFEMIVHN3cjs.scrollDomAtPos.call(void 0, view, heading.pos, options.behavior);
4341
4341
  return true;
4342
4342
  }
4343
4343
  };
@@ -4358,7 +4358,7 @@ var Outline = _core.Extension.create({
4358
4358
  apply: (tr, prev, _oldState, newState) => {
4359
4359
  if (!tr.docChanged) return prev;
4360
4360
  const next = computeOutline(newState.doc, types);
4361
- if (_chunkMUCYWI6Wcjs.arraysEqual.call(void 0, prev, next, sameHeading)) return prev;
4361
+ if (_chunkFEMIVHN3cjs.arraysEqual.call(void 0, prev, next, sameHeading)) return prev;
4362
4362
  storage.headings = next;
4363
4363
  _optionalChain([onUpdate, 'call', _171 => _171(), 'optionalCall', _172 => _172(next)]);
4364
4364
  return next;
@@ -4376,7 +4376,7 @@ var Outline = _core.Extension.create({
4376
4376
  },
4377
4377
  onBeforeCreate() {
4378
4378
  const { types, generateId } = this.options;
4379
- _chunkMUCYWI6Wcjs.syncInitialContent.call(void 0, this.editor, (state) => assignHeadingIds(state, types, generateId));
4379
+ _chunkFEMIVHN3cjs.syncInitialContent.call(void 0, this.editor, (state) => assignHeadingIds(state, types, generateId));
4380
4380
  }
4381
4381
  });
4382
4382
 
@@ -4546,7 +4546,7 @@ function syncTableOfContents(state, headingTypes) {
4546
4546
  node.attrs.minLevel,
4547
4547
  node.attrs.maxLevel
4548
4548
  );
4549
- if (!_chunkMUCYWI6Wcjs.arraysEqual.call(void 0, _nullishCoalesce(node.attrs.entries, () => ( [])), entries, sameEntry)) {
4549
+ if (!_chunkFEMIVHN3cjs.arraysEqual.call(void 0, _nullishCoalesce(node.attrs.entries, () => ( [])), entries, sameEntry)) {
4550
4550
  tr = _nullishCoalesce(tr, () => ( state.tr));
4551
4551
  tr.setNodeMarkup(pos, void 0, { ...node.attrs, entries });
4552
4552
  }
@@ -4558,7 +4558,7 @@ function syncTableOfContents(state, headingTypes) {
4558
4558
  }
4559
4559
  var TableOfContents = _core.Node.create({
4560
4560
  name: "tableOfContents",
4561
- priority: _chunkMUCYWI6Wcjs.STRUCTURE_PRIORITY - 5,
4561
+ priority: _chunkFEMIVHN3cjs.STRUCTURE_PRIORITY - 5,
4562
4562
  group: "block",
4563
4563
  atom: true,
4564
4564
  selectable: true,
@@ -4669,7 +4669,7 @@ var TableOfContents = _core.Node.create({
4669
4669
  return [
4670
4670
  new (0, _state.Plugin)({
4671
4671
  key: tableOfContentsPluginKey,
4672
- state: _chunkMUCYWI6Wcjs.presenceStateSpec.call(void 0, [this.name]),
4672
+ state: _chunkFEMIVHN3cjs.presenceStateSpec.call(void 0, [this.name]),
4673
4673
  appendTransaction: (transactions, _oldState, newState) => {
4674
4674
  if (!transactions.some((tr) => tr.docChanged)) return null;
4675
4675
  if (!tableOfContentsPluginKey.getState(newState)) return null;
@@ -4693,7 +4693,7 @@ var TableOfContents = _core.Node.create({
4693
4693
  );
4694
4694
  view.focus();
4695
4695
  }
4696
- _chunkMUCYWI6Wcjs.scrollDomAtPos.call(void 0, view, heading.pos);
4696
+ _chunkFEMIVHN3cjs.scrollDomAtPos.call(void 0, view, heading.pos);
4697
4697
  return true;
4698
4698
  }
4699
4699
  }
@@ -4703,7 +4703,7 @@ var TableOfContents = _core.Node.create({
4703
4703
  },
4704
4704
  onBeforeCreate() {
4705
4705
  const { headingTypes } = this.options;
4706
- _chunkMUCYWI6Wcjs.syncInitialContent.call(void 0, this.editor, (state) => syncTableOfContents(state, headingTypes));
4706
+ _chunkFEMIVHN3cjs.syncInitialContent.call(void 0, this.editor, (state) => syncTableOfContents(state, headingTypes));
4707
4707
  }
4708
4708
  });
4709
4709
 
@@ -4761,7 +4761,7 @@ function syncFootnotes(tr, options = {}) {
4761
4761
  const listType = schema.nodes[LIST];
4762
4762
  const itemType = schema.nodes[ITEM];
4763
4763
  if (!listType || !itemType) return false;
4764
- const generateId = _nullishCoalesce(options.generateId, () => ( (() => _chunkMUCYWI6Wcjs.generateStructureId.call(void 0, "fn"))));
4764
+ const generateId = _nullishCoalesce(options.generateId, () => ( (() => _chunkFEMIVHN3cjs.generateStructureId.call(void 0, "fn"))));
4765
4765
  const refs = [];
4766
4766
  const lists = [];
4767
4767
  const existing = /* @__PURE__ */ new Map();
@@ -4845,7 +4845,7 @@ function findReferences(doc, id) {
4845
4845
  }
4846
4846
  var FootnoteReference = _core.Node.create({
4847
4847
  name: REFERENCE,
4848
- priority: _chunkMUCYWI6Wcjs.STRUCTURE_PRIORITY - 5,
4848
+ priority: _chunkFEMIVHN3cjs.STRUCTURE_PRIORITY - 5,
4849
4849
  group: "inline",
4850
4850
  inline: true,
4851
4851
  atom: true,
@@ -4853,7 +4853,7 @@ var FootnoteReference = _core.Node.create({
4853
4853
  addOptions() {
4854
4854
  return {
4855
4855
  HTMLAttributes: {},
4856
- generateId: () => _chunkMUCYWI6Wcjs.generateStructureId.call(void 0, "fn")
4856
+ generateId: () => _chunkFEMIVHN3cjs.generateStructureId.call(void 0, "fn")
4857
4857
  };
4858
4858
  },
4859
4859
  addAttributes() {
@@ -4964,7 +4964,7 @@ var FootnoteReference = _core.Node.create({
4964
4964
  _state.TextSelection.create(tr.doc, footnote.pos + footnote.node.nodeSize - 2)
4965
4965
  );
4966
4966
  tr.scrollIntoView();
4967
- _chunkMUCYWI6Wcjs.scrollDomAtPos.call(void 0, view, footnote.pos);
4967
+ _chunkFEMIVHN3cjs.scrollDomAtPos.call(void 0, view, footnote.pos);
4968
4968
  }
4969
4969
  return true;
4970
4970
  },
@@ -4974,7 +4974,7 @@ var FootnoteReference = _core.Node.create({
4974
4974
  if (dispatch) {
4975
4975
  tr.setSelection(_state.NodeSelection.create(tr.doc, ref.pos));
4976
4976
  tr.scrollIntoView();
4977
- _chunkMUCYWI6Wcjs.scrollDomAtPos.call(void 0, view, ref.pos);
4977
+ _chunkFEMIVHN3cjs.scrollDomAtPos.call(void 0, view, ref.pos);
4978
4978
  }
4979
4979
  return true;
4980
4980
  }
@@ -4986,7 +4986,7 @@ var FootnoteReference = _core.Node.create({
4986
4986
  return [
4987
4987
  new (0, _state.Plugin)({
4988
4988
  key: footnotesPluginKey,
4989
- state: _chunkMUCYWI6Wcjs.presenceStateSpec.call(void 0, [REFERENCE, LIST]),
4989
+ state: _chunkFEMIVHN3cjs.presenceStateSpec.call(void 0, [REFERENCE, LIST]),
4990
4990
  appendTransaction: (transactions, _oldState, newState) => {
4991
4991
  if (!transactions.some((tr2) => tr2.docChanged)) return null;
4992
4992
  if (!footnotesPluginKey.getState(newState)) return null;
@@ -5007,7 +5007,7 @@ var FootnoteReference = _core.Node.create({
5007
5007
  },
5008
5008
  onBeforeCreate() {
5009
5009
  const { generateId } = this.options;
5010
- _chunkMUCYWI6Wcjs.syncInitialContent.call(void 0, this.editor, (state) => {
5010
+ _chunkFEMIVHN3cjs.syncInitialContent.call(void 0, this.editor, (state) => {
5011
5011
  const tr = state.tr;
5012
5012
  return syncFootnotes(tr, { generateId }) ? tr : null;
5013
5013
  });
@@ -5147,7 +5147,7 @@ var Bookmark = _core.Mark.create({
5147
5147
  addOptions() {
5148
5148
  return {
5149
5149
  HTMLAttributes: {},
5150
- generateId: () => _chunkMUCYWI6Wcjs.generateStructureId.call(void 0, "bm")
5150
+ generateId: () => _chunkFEMIVHN3cjs.generateStructureId.call(void 0, "bm")
5151
5151
  };
5152
5152
  },
5153
5153
  addAttributes() {
@@ -5232,7 +5232,7 @@ var Bookmark = _core.Mark.create({
5232
5232
  tr.setSelection(_state.TextSelection.create(tr.doc, bookmark.from, bookmark.to));
5233
5233
  tr.scrollIntoView();
5234
5234
  const domPos = state.doc.resolve(bookmark.from);
5235
- _chunkMUCYWI6Wcjs.scrollDomAtPos.call(void 0, view, domPos.before(domPos.depth));
5235
+ _chunkFEMIVHN3cjs.scrollDomAtPos.call(void 0, view, domPos.before(domPos.depth));
5236
5236
  }
5237
5237
  return true;
5238
5238
  }
@@ -5297,7 +5297,7 @@ function syncCrossReferences(state, headingTypes) {
5297
5297
  }
5298
5298
  var CrossReference = _core.Node.create({
5299
5299
  name: NAME,
5300
- priority: _chunkMUCYWI6Wcjs.STRUCTURE_PRIORITY - 5,
5300
+ priority: _chunkFEMIVHN3cjs.STRUCTURE_PRIORITY - 5,
5301
5301
  group: "inline",
5302
5302
  inline: true,
5303
5303
  atom: true,
@@ -5399,7 +5399,7 @@ var CrossReference = _core.Node.create({
5399
5399
  if (dispatch) {
5400
5400
  tr.setSelection(_state.TextSelection.create(tr.doc, range.from, range.to));
5401
5401
  tr.scrollIntoView();
5402
- _chunkMUCYWI6Wcjs.scrollDomAtPos.call(void 0, view, range.blockPos);
5402
+ _chunkFEMIVHN3cjs.scrollDomAtPos.call(void 0, view, range.blockPos);
5403
5403
  }
5404
5404
  return true;
5405
5405
  }
@@ -5411,7 +5411,7 @@ var CrossReference = _core.Node.create({
5411
5411
  return [
5412
5412
  new (0, _state.Plugin)({
5413
5413
  key: crossReferencePluginKey,
5414
- state: _chunkMUCYWI6Wcjs.presenceStateSpec.call(void 0, [NAME]),
5414
+ state: _chunkFEMIVHN3cjs.presenceStateSpec.call(void 0, [NAME]),
5415
5415
  appendTransaction: (transactions, _oldState, newState) => {
5416
5416
  if (!transactions.some((tr) => tr.docChanged)) return null;
5417
5417
  if (!crossReferencePluginKey.getState(newState)) return null;
@@ -5430,7 +5430,7 @@ var CrossReference = _core.Node.create({
5430
5430
  },
5431
5431
  onBeforeCreate() {
5432
5432
  const { headingTypes } = this.options;
5433
- _chunkMUCYWI6Wcjs.syncInitialContent.call(void 0, this.editor, (state) => syncCrossReferences(state, headingTypes));
5433
+ _chunkFEMIVHN3cjs.syncInitialContent.call(void 0, this.editor, (state) => syncCrossReferences(state, headingTypes));
5434
5434
  }
5435
5435
  });
5436
5436
 
@@ -5685,7 +5685,7 @@ var FindReplace = _core.Extension.create({
5685
5685
  if (!s || !s.active || s.currentIndex < 0 || !s.matches[s.currentIndex]) return false;
5686
5686
  if (dispatch) {
5687
5687
  _history.closeHistory.call(void 0, tr);
5688
- const [end] = _chunkMUCYWI6Wcjs.applyReplacements.call(void 0, tr, [s.matches[s.currentIndex]]);
5688
+ const [end] = _chunkFEMIVHN3cjs.applyReplacements.call(void 0, tr, [s.matches[s.currentIndex]]);
5689
5689
  tr.setSelection(_state.TextSelection.create(tr.doc, end)).scrollIntoView();
5690
5690
  meta(tr, { type: "replaced", anchor: end, count: 1 });
5691
5691
  }
@@ -5696,7 +5696,7 @@ var FindReplace = _core.Extension.create({
5696
5696
  if (!s || !s.active || !s.matches.length) return false;
5697
5697
  if (dispatch) {
5698
5698
  _history.closeHistory.call(void 0, tr);
5699
- const ends = _chunkMUCYWI6Wcjs.applyReplacements.call(void 0, tr, s.matches);
5699
+ const ends = _chunkFEMIVHN3cjs.applyReplacements.call(void 0, tr, s.matches);
5700
5700
  meta(tr, { type: "replaced", anchor: ends[ends.length - 1], count: s.matches.length });
5701
5701
  }
5702
5702
  return true;
@@ -5728,7 +5728,7 @@ var FindReplace = _core.Extension.create({
5728
5728
  if (!s.active || !s.query) {
5729
5729
  return { ...s, matches: [], currentIndex: -1, error: null, truncated: false };
5730
5730
  }
5731
- const result = _chunkMUCYWI6Wcjs.searchDocument.call(void 0, doc, s.query, s.options, {
5731
+ const result = _chunkFEMIVHN3cjs.searchDocument.call(void 0, doc, s.query, s.options, {
5732
5732
  replacement: s.replacement,
5733
5733
  clipboardText: safeClipboard(options.getClipboardText),
5734
5734
  timeLimitMs: options.timeLimitMs,
@@ -6315,7 +6315,7 @@ function createRichTextPreset(options = {}) {
6315
6315
  })
6316
6316
  ];
6317
6317
  if (options.table !== false) {
6318
- extensions2.push(..._chunkMUCYWI6Wcjs.createTableExtensions.call(void 0, optionObject(options.table)));
6318
+ extensions2.push(..._chunkFEMIVHN3cjs.createTableExtensions.call(void 0, optionObject(options.table)));
6319
6319
  }
6320
6320
  if (characterLimit) {
6321
6321
  extensions2.push(
@@ -6422,8 +6422,8 @@ function createRichTextPreset(options = {}) {
6422
6422
  }
6423
6423
  if (options.chart) {
6424
6424
  const { sparkline = true, ...chartOptions } = optionObject(options.chart);
6425
- extensions2.push(_chunkMUCYWI6Wcjs.Chart.configure(chartOptions));
6426
- if (sparkline) extensions2.push(_chunkMUCYWI6Wcjs.Sparkline.configure(optionObject(sparkline)));
6425
+ extensions2.push(_chunkFEMIVHN3cjs.Chart.configure(chartOptions));
6426
+ if (sparkline) extensions2.push(_chunkFEMIVHN3cjs.Sparkline.configure(optionObject(sparkline)));
6427
6427
  }
6428
6428
  if (options.paragraphStyles) {
6429
6429
  extensions2.push(ParagraphStyles.configure(optionObject(options.paragraphStyles)));
@@ -6564,7 +6564,7 @@ function createFindReplaceCommands(editor, options = {}) {
6564
6564
  ];
6565
6565
  }
6566
6566
  function validateFindPattern(query, options = {}) {
6567
- const result = _chunkMUCYWI6Wcjs.compileFindPattern.call(void 0, query, options);
6567
+ const result = _chunkFEMIVHN3cjs.compileFindPattern.call(void 0, query, options);
6568
6568
  return result.ok ? null : result.error;
6569
6569
  }
6570
6570
 
@@ -6573,8 +6573,8 @@ var PARAMS = {
6573
6573
  insertTable: {
6574
6574
  type: "object",
6575
6575
  properties: {
6576
- rows: { type: "integer", minimum: 1, maximum: _chunkMUCYWI6Wcjs.MAX_TABLE_ROWS, description: "Rows (default 3)." },
6577
- cols: { type: "integer", minimum: 1, maximum: _chunkMUCYWI6Wcjs.MAX_TABLE_COLUMNS, description: "Columns (default 3)." },
6576
+ rows: { type: "integer", minimum: 1, maximum: _chunkFEMIVHN3cjs.MAX_TABLE_ROWS, description: "Rows (default 3)." },
6577
+ cols: { type: "integer", minimum: 1, maximum: _chunkFEMIVHN3cjs.MAX_TABLE_COLUMNS, description: "Columns (default 3)." },
6578
6578
  withHeaderRow: { type: "boolean", description: "Make the first row a header row (default true)." }
6579
6579
  },
6580
6580
  additionalProperties: false
@@ -6605,7 +6605,7 @@ function createTableCommands(editor, options = {}) {
6605
6605
  const group = _nullishCoalesce(options.group, () => ( "Table"));
6606
6606
  const scope = options.scope ? { scope: options.scope } : {};
6607
6607
  const focus = _nullishCoalesce(options.focus, () => ( true));
6608
- return _chunkMUCYWI6Wcjs.TABLE_ACTIONS.map(({ action, label, description, keywords }) => {
6608
+ return _chunkFEMIVHN3cjs.TABLE_ACTIONS.map(({ action, label, description, keywords }) => {
6609
6609
  const params = PARAMS[action];
6610
6610
  return {
6611
6611
  id: `${prefix}${action}`,
@@ -6615,13 +6615,13 @@ function createTableCommands(editor, options = {}) {
6615
6615
  description,
6616
6616
  ...params ? { params } : {},
6617
6617
  ...scope,
6618
- enabled: (_ctx, p) => _chunkMUCYWI6Wcjs.getTableActionState.call(void 0, editor, action, _nullishCoalesce(p, () => ( {}))),
6618
+ enabled: (_ctx, p) => _chunkFEMIVHN3cjs.getTableActionState.call(void 0, editor, action, _nullishCoalesce(p, () => ( {}))),
6619
6619
  run: (_ctx, p) => {
6620
- if (!_chunkMUCYWI6Wcjs.runTableAction.call(void 0, editor, action, _nullishCoalesce(p, () => ( {})), { focus })) {
6621
- const reason = _chunkMUCYWI6Wcjs.getTableActionState.call(void 0, editor, action, _nullishCoalesce(p, () => ( {})));
6620
+ if (!_chunkFEMIVHN3cjs.runTableAction.call(void 0, editor, action, _nullishCoalesce(p, () => ( {})), { focus })) {
6621
+ const reason = _chunkFEMIVHN3cjs.getTableActionState.call(void 0, editor, action, _nullishCoalesce(p, () => ( {})));
6622
6622
  throw new Error(reason === true ? `${label} did not change the document.` : reason);
6623
6623
  }
6624
- const state = _chunkMUCYWI6Wcjs.getTableState.call(void 0, editor);
6624
+ const state = _chunkFEMIVHN3cjs.getTableState.call(void 0, editor);
6625
6625
  return {
6626
6626
  done: true,
6627
6627
  table: state.inTable ? { rows: state.rows, columns: state.columns, row: state.row, column: state.column } : null
@@ -6753,4 +6753,4 @@ function createTableCommands(editor, options = {}) {
6753
6753
 
6754
6754
 
6755
6755
  exports.GradientText = GradientText; exports.SlashCommands = SlashCommands; exports.TemplateSuggestions = TemplateSuggestions; exports.LoadingNode = LoadingNode; exports.SMILIE_REPLACEMENTS = SMILIE_REPLACEMENTS; exports.smilieAutocorrectRules = smilieAutocorrectRules; exports.SmilieReplacer = SmilieReplacer; exports.findHexColors = findHexColors; exports.ColorHighlighter = ColorHighlighter; exports.FontSize = FontSize; exports.Mention = Mention; exports.getMentionNodes = getMentionNodes; exports.setMentionRoleAt = setMentionRoleAt; exports.createMentionExtension = createMentionExtension; exports.Markdown = Markdown2; exports.imagePastePluginKey = imagePastePluginKey; exports.insertImageNode = insertImageNode; exports.updateImageSrc = updateImageSrc; exports.removeImageNode = removeImageNode; exports.handleImageInsertion = handleImageInsertion; exports.Image = Image2; exports.commentsPluginKey = commentsPluginKey; exports.COMMENT_MARK_NAME = COMMENT_MARK_NAME; exports.findCommentRanges = findCommentRanges; exports.getCommentAnchors = getCommentAnchors; exports.getCommentIdsAt = getCommentIdsAt; exports.getCommentStore = getCommentStore; exports.Comments = Comments; exports.getCommentAuthor = getCommentAuthor; exports.compareInEditor = compareInEditor; exports.applyDocumentComparison = applyDocumentComparison; exports.DocumentCompare = DocumentCompare; exports.ImportError = ImportError; exports.createImportContext = createImportContext; exports.ImportAdapterRegistry = ImportAdapterRegistry; exports.DOCX_MIME_TYPES = DOCX_MIME_TYPES; exports.DEFAULT_DOCX_MAX_IMAGE_SIZE = DEFAULT_DOCX_MAX_IMAGE_SIZE; exports.docxToDocumentImport = docxToDocumentImport; exports.createDocxImportAdapter = createDocxImportAdapter; exports.docxImportAdapter = docxImportAdapter; exports.markdownImportAdapter = markdownImportAdapter; exports.htmlImportAdapter = htmlImportAdapter; exports.plainTextImportAdapter = plainTextImportAdapter; exports.rtfImportAdapter = rtfImportAdapter; exports.BUILT_IN_IMPORT_ADAPTERS = BUILT_IN_IMPORT_ADAPTERS; exports.createImportAdapterRegistry = createImportAdapterRegistry; exports.defaultImportRegistry = defaultImportRegistry; exports.registerImportAdapter = registerImportAdapter; exports.unregisterImportAdapter = unregisterImportAdapter; exports.findImportAdapter = findImportAdapter; exports.importFile = importFile; exports.getImportAccept = getImportAccept; exports.htmlToSlice = htmlToSlice; exports.insertImportedDocument = insertImportedDocument; exports.applyImportedReviewData = applyImportedReviewData; exports.importFilesIntoEditor = importFilesIntoEditor; exports.fileImportPluginKey = fileImportPluginKey; exports.FileImport = FileImport; exports.richClipboardPluginKey = richClipboardPluginKey; exports.writeRichClipboard = writeRichClipboard; exports.RichClipboard = RichClipboard; exports.smartQuoteRules = smartQuoteRules; exports.symbolRules = symbolRules; exports.fractionRules = fractionRules; exports.capitalizeSentenceRules = capitalizeSentenceRules; exports.twoInitialCapitalsRules = twoInitialCapitalsRules; exports.defaultAutocorrectRules = defaultAutocorrectRules; exports.DEFAULT_AUTOCORRECT_EXCEPTIONS = DEFAULT_AUTOCORRECT_EXCEPTIONS; exports.autocorrectPluginKey = autocorrectPluginKey; exports.findAutocorrection = findAutocorrection; exports.isInsidePromptToken = isInsidePromptToken; exports.Autocorrect = Autocorrect; exports.outlinePluginKey = outlinePluginKey; exports.computeOutline = computeOutline; exports.buildOutlineTree = buildOutlineTree; exports.getOutline = getOutline; exports.getActiveHeading = getActiveHeading; exports.createOutlineStore = createOutlineStore; exports.navigateToHeading = navigateToHeading; exports.Outline = Outline; exports.tableOfContentsMarkdownIt = tableOfContentsMarkdownIt; exports.footnotesMarkdownIt = footnotesMarkdownIt; exports.tableOfContentsPluginKey = tableOfContentsPluginKey; exports.getTableOfContentsEntries = getTableOfContentsEntries; exports.TableOfContents = TableOfContents; exports.footnotesPluginKey = footnotesPluginKey; exports.getFootnotes = getFootnotes; exports.syncFootnotes = syncFootnotes; exports.FootnoteReference = FootnoteReference; exports.Footnotes = Footnotes; exports.Footnote = Footnote; exports.getBookmarks = getBookmarks; exports.Bookmark = Bookmark; exports.crossReferencePluginKey = crossReferencePluginKey; exports.getCrossReferenceTargets = getCrossReferenceTargets; exports.CrossReference = CrossReference; exports.documentStructureCommandItems = documentStructureCommandItems; exports.getDocumentStructureCommandItems = getDocumentStructureCommandItems; exports.EMPTY_FIND_REPLACE_SNAPSHOT = EMPTY_FIND_REPLACE_SNAPSHOT; exports.FindReplaceStore = FindReplaceStore; exports.findReplacePluginKey = findReplacePluginKey; exports.getFindReplaceState = getFindReplaceState; exports.getFindReplaceStore = getFindReplaceStore; exports.FIND_OPTION_TOGGLES = FIND_OPTION_TOGGLES; exports.formatFindStatus = formatFindStatus; exports.FindReplace = FindReplace; exports.STYLE_ID_ATTRIBUTE = STYLE_ID_ATTRIBUTE; exports.CHARACTER_STYLE_MARK_NAME = CHARACTER_STYLE_MARK_NAME; exports.paragraphStylesPluginKey = paragraphStylesPluginKey; exports.getStyleRegistry = getStyleRegistry; exports.isParagraphStyleAvailable = isParagraphStyleAvailable; exports.getParagraphStyleAt = getParagraphStyleAt; exports.captureSelectionFormat = captureSelectionFormat; exports.CharacterStyle = CharacterStyle; exports.ParagraphStyles = ParagraphStyles; exports.createParagraphStylesStore = createParagraphStylesStore; exports.createRichTextPreset = createRichTextPreset; exports.createFindReplaceCommands = createFindReplaceCommands; exports.validateFindPattern = validateFindPattern; exports.createTableCommands = createTableCommands;
6756
- //# sourceMappingURL=chunk-WXEHCVJQ.cjs.map
6756
+ //# sourceMappingURL=chunk-LNKZPIQD.cjs.map