@photon-ai/pho-ui 4.16.1 → 4.17.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 (44) hide show
  1. package/dist/chunks/{bar-chart-By5gWQqP.js → bar-chart-B-c6dujU.js} +2 -2
  2. package/dist/chunks/{bar-chart-By5gWQqP.js.map → bar-chart-B-c6dujU.js.map} +1 -1
  3. package/dist/chunks/{basic-page-C0C8NDjG.js → basic-page-DS1YIheB.js} +4 -4
  4. package/dist/chunks/{basic-page-C0C8NDjG.js.map → basic-page-DS1YIheB.js.map} +1 -1
  5. package/dist/chunks/{chart-Dx3rjeFn.js → chart-PPuzbeXN.js} +478 -438
  6. package/dist/chunks/chart-PPuzbeXN.js.map +1 -0
  7. package/dist/chunks/{code-block-CbcE994O.js → code-block-DMiZkEWS.js} +2 -2
  8. package/dist/chunks/{code-block-CbcE994O.js.map → code-block-DMiZkEWS.js.map} +1 -1
  9. package/dist/chunks/copy-button-CHYc_cvM.js +76 -0
  10. package/dist/chunks/copy-button-CHYc_cvM.js.map +1 -0
  11. package/dist/chunks/description-list-SIlI9ZHs.js +60 -0
  12. package/dist/chunks/description-list-SIlI9ZHs.js.map +1 -0
  13. package/dist/chunks/{filter-bar-yEcG2pBm.js → filter-bar-BCiaO1gO.js} +2 -2
  14. package/dist/chunks/{filter-bar-yEcG2pBm.js.map → filter-bar-BCiaO1gO.js.map} +1 -1
  15. package/dist/chunks/{line-chart-CAe09fqr.js → line-chart-CNvnFb-M.js} +2 -2
  16. package/dist/chunks/{line-chart-CAe09fqr.js.map → line-chart-CNvnFb-M.js.map} +1 -1
  17. package/dist/chunks/menu-CoMrYnd1.js +264 -0
  18. package/dist/chunks/menu-CoMrYnd1.js.map +1 -0
  19. package/dist/components/bar-chart.js +1 -1
  20. package/dist/components/chart.js +1 -1
  21. package/dist/components/code-block.js +1 -1
  22. package/dist/components/context-menu.js +38 -37
  23. package/dist/components/context-menu.js.map +1 -1
  24. package/dist/components/copy-button.js +1 -1
  25. package/dist/components/description-list.js +1 -1
  26. package/dist/components/filter-bar.js +1 -1
  27. package/dist/components/line-chart.js +1 -1
  28. package/dist/components/menu.js +5 -4
  29. package/dist/components/scope.js +88 -84
  30. package/dist/components/scope.js.map +1 -1
  31. package/dist/index.js +8 -8
  32. package/dist/sections/basic-page.js +1 -1
  33. package/dist/src/components/copy-button/copy-button.d.ts +15 -4
  34. package/dist/src/components/description-list/description-list.d.ts +3 -2
  35. package/dist/src/components/menu/index.d.ts +1 -1
  36. package/dist/src/components/menu/menu-pending.d.ts +26 -0
  37. package/package.json +1 -1
  38. package/dist/chunks/chart-Dx3rjeFn.js.map +0 -1
  39. package/dist/chunks/copy-button-D8XyP0oR.js +0 -56
  40. package/dist/chunks/copy-button-D8XyP0oR.js.map +0 -1
  41. package/dist/chunks/description-list-8qm83WZB.js +0 -59
  42. package/dist/chunks/description-list-8qm83WZB.js.map +0 -1
  43. package/dist/chunks/menu-BQeprfxB.js +0 -208
  44. package/dist/chunks/menu-BQeprfxB.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chart-PPuzbeXN.js","names":[],"sources":["../../../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/curve/linear.js","../../../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/curve/monotone.js","../../src/components/chart/color.ts","../../src/components/chart/format.ts","../../src/components/chart/legend.tsx","../../../../node_modules/.pnpm/d3-array@3.2.4/node_modules/d3-array/src/ascending.js","../../../../node_modules/.pnpm/d3-array@3.2.4/node_modules/d3-array/src/descending.js","../../../../node_modules/.pnpm/d3-array@3.2.4/node_modules/d3-array/src/bisector.js","../../../../node_modules/.pnpm/d3-array@3.2.4/node_modules/d3-array/src/ticks.js","../../../../node_modules/.pnpm/d3-time@3.1.0/node_modules/d3-time/src/interval.js","../../../../node_modules/.pnpm/d3-time@3.1.0/node_modules/d3-time/src/millisecond.js","../../../../node_modules/.pnpm/d3-time@3.1.0/node_modules/d3-time/src/duration.js","../../../../node_modules/.pnpm/d3-time@3.1.0/node_modules/d3-time/src/second.js","../../../../node_modules/.pnpm/d3-time@3.1.0/node_modules/d3-time/src/minute.js","../../../../node_modules/.pnpm/d3-time@3.1.0/node_modules/d3-time/src/hour.js","../../../../node_modules/.pnpm/d3-time@3.1.0/node_modules/d3-time/src/day.js","../../../../node_modules/.pnpm/d3-time@3.1.0/node_modules/d3-time/src/week.js","../../../../node_modules/.pnpm/d3-time@3.1.0/node_modules/d3-time/src/month.js","../../../../node_modules/.pnpm/d3-time@3.1.0/node_modules/d3-time/src/year.js","../../../../node_modules/.pnpm/d3-time@3.1.0/node_modules/d3-time/src/ticks.js","../../src/components/chart/scale.ts","../../src/components/chart/shell.tsx","../../src/components/chart/skeleton.tsx","../../src/components/chart/theme.ts","../../src/components/chart/tooltip.tsx","../../src/components/chart/use-measure.ts","../../src/components/chart/chart.tsx"],"sourcesContent":["function Linear(context) {\n this._context = context;\n}\n\nLinear.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._point = 0;\n },\n lineEnd: function() {\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; // falls through\n default: this._context.lineTo(x, y); break;\n }\n }\n};\n\nexport default function(context) {\n return new Linear(context);\n}\n","function sign(x) {\n return x < 0 ? -1 : 1;\n}\n\n// Calculate the slopes of the tangents (Hermite-type interpolation) based on\n// the following paper: Steffen, M. 1990. A Simple Method for Monotonic\n// Interpolation in One Dimension. Astronomy and Astrophysics, Vol. 239, NO.\n// NOV(II), P. 443, 1990.\nfunction slope3(that, x2, y2) {\n var h0 = that._x1 - that._x0,\n h1 = x2 - that._x1,\n s0 = (that._y1 - that._y0) / (h0 || h1 < 0 && -0),\n s1 = (y2 - that._y1) / (h1 || h0 < 0 && -0),\n p = (s0 * h1 + s1 * h0) / (h0 + h1);\n return (sign(s0) + sign(s1)) * Math.min(Math.abs(s0), Math.abs(s1), 0.5 * Math.abs(p)) || 0;\n}\n\n// Calculate a one-sided slope.\nfunction slope2(that, t) {\n var h = that._x1 - that._x0;\n return h ? (3 * (that._y1 - that._y0) / h - t) / 2 : t;\n}\n\n// According to https://en.wikipedia.org/wiki/Cubic_Hermite_spline#Representations\n// \"you can express cubic Hermite interpolation in terms of cubic Bézier curves\n// with respect to the four values p0, p0 + m0 / 3, p1 - m1 / 3, p1\".\nfunction point(that, t0, t1) {\n var x0 = that._x0,\n y0 = that._y0,\n x1 = that._x1,\n y1 = that._y1,\n dx = (x1 - x0) / 3;\n that._context.bezierCurveTo(x0 + dx, y0 + dx * t0, x1 - dx, y1 - dx * t1, x1, y1);\n}\n\nfunction MonotoneX(context) {\n this._context = context;\n}\n\nMonotoneX.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 =\n this._y0 = this._y1 =\n this._t0 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 2: this._context.lineTo(this._x1, this._y1); break;\n case 3: point(this, this._t0, slope2(this, this._t0)); break;\n }\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n var t1 = NaN;\n\n x = +x, y = +y;\n if (x === this._x1 && y === this._y1) return; // Ignore coincident points.\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; point(this, slope2(this, t1 = slope3(this, x, y)), t1); break;\n default: point(this, this._t0, t1 = slope3(this, x, y)); break;\n }\n\n this._x0 = this._x1, this._x1 = x;\n this._y0 = this._y1, this._y1 = y;\n this._t0 = t1;\n }\n}\n\nfunction MonotoneY(context) {\n this._context = new ReflectContext(context);\n}\n\n(MonotoneY.prototype = Object.create(MonotoneX.prototype)).point = function(x, y) {\n MonotoneX.prototype.point.call(this, y, x);\n};\n\nfunction ReflectContext(context) {\n this._context = context;\n}\n\nReflectContext.prototype = {\n moveTo: function(x, y) { this._context.moveTo(y, x); },\n closePath: function() { this._context.closePath(); },\n lineTo: function(x, y) { this._context.lineTo(y, x); },\n bezierCurveTo: function(x1, y1, x2, y2, x, y) { this._context.bezierCurveTo(y1, x1, y2, x2, y, x); }\n};\n\nexport function monotoneX(context) {\n return new MonotoneX(context);\n}\n\nexport function monotoneY(context) {\n return new MonotoneY(context);\n}\n","import type { ChartColor } from \"./types\";\n\n/** The categorical slots, in the order series take them. */\nexport const CHART_SLOTS = [\n \"chart-1\",\n \"chart-2\",\n \"chart-3\",\n \"chart-4\",\n \"chart-5\",\n \"chart-6\",\n] as const satisfies ReadonlyArray<ChartColor>;\n\n/**\n * The CSS value for a series colour: the named colour, or the categorical\n * slot at `index` when the series names none. Slots are an ordered,\n * validated set — a seventh series wraps, so fold a long tail into\n * \"Other\" before it gets there.\n */\nexport function chartColor(\n color: ChartColor | undefined,\n index: number,\n): string {\n const name = color ?? CHART_SLOTS[index % CHART_SLOTS.length]!;\n const token = name.startsWith(\"chart-\") ? name : `chart-${name}`;\n return `var(--color-pho-${token})`;\n}\n","import type { ChartDatum } from \"./types\";\n\n/**\n * The default number format: grouped digits for a value someone reads\n * (\"12,001\"), compact for an axis tick (\"12K\") where room is short.\n */\nexport function numberFormatter(\n locale: string | undefined,\n compact = false,\n): (value: number) => string {\n const format = new Intl.NumberFormat(\n locale,\n compact\n ? { notation: \"compact\", maximumFractionDigits: 1 }\n : { maximumFractionDigits: 2 },\n );\n return (value) => format.format(value);\n}\n\n/** A number under a series key, or nothing: missing, null, or not a number. */\nexport function readValue(datum: object, key: string): number | null {\n const value = (datum as Record<string, unknown>)[key];\n return typeof value === \"number\" && Number.isFinite(value) ? value : null;\n}\n\n/** \"Inbound and outbound\", \"p50, p90 and p99\". */\nexport function joinNames(names: ReadonlyArray<string>): string {\n if (names.length <= 1) return names[0] ?? \"\";\n return `${names.slice(0, -1).join(\", \")} and ${names[names.length - 1]}`;\n}\n\nexport interface DescribedSeries {\n key: string;\n label: string;\n /** Bars sum to a total; lines run between a low and a high. */\n kind: \"bar\" | \"line\";\n}\n\ninterface DescribeOptions<T extends ChartDatum> {\n data: ReadonlyArray<T>;\n series: ReadonlyArray<DescribedSeries>;\n valueFormat: (value: number) => string;\n timeFormat: (date: Date) => string;\n}\n\n/**\n * What the figure says about itself to assistive tech: which series, over\n * what range, and for each one the total (bars) or the low and high\n * (lines), plus where it peaked.\n */\nexport function describeChart<T extends ChartDatum>({\n data,\n series,\n valueFormat,\n timeFormat,\n}: DescribeOptions<T>): string {\n if (data.length === 0) return \"No data to show.\";\n const first = data[0]!;\n const last = data[data.length - 1]!;\n const range =\n data.length > 1\n ? `${timeFormat(new Date(first.x))} to ${timeFormat(new Date(last.x))}`\n : timeFormat(new Date(first.x));\n const parts = [`${joinNames(series.map((s) => s.label))}, ${range}.`];\n for (const s of series) {\n let total = 0;\n let min = Infinity;\n let max = -Infinity;\n let peakAt: Date | null = null;\n let seen = 0;\n for (const datum of data) {\n const value = readValue(datum, s.key);\n if (value == null) continue;\n seen++;\n total += value;\n if (value < min) min = value;\n if (value > max) {\n max = value;\n peakAt = new Date(datum.x);\n }\n }\n if (seen === 0) {\n parts.push(`${s.label}: no values.`);\n continue;\n }\n const peak = peakAt\n ? `, peak ${valueFormat(max)} at ${timeFormat(peakAt)}`\n : \"\";\n parts.push(\n s.kind === \"bar\"\n ? `${s.label}: ${valueFormat(total)} in total${peak}.`\n : `${s.label}: from ${valueFormat(min)} to ${valueFormat(max)}${peak}.`,\n );\n }\n return parts.join(\" \");\n}\n","import { type ComponentProps } from \"react\";\nimport { cn } from \"../../utils/cn\";\n\n/** A legend or tooltip key mirrors its mark: a square for a bar, a stroke for a line. */\nexport type ChartSwatchKind = \"rect\" | \"line\";\n\nexport interface ChartSwatchProps {\n /** A CSS colour value — what `chartColor` returns. */\n color: string;\n kind?: ChartSwatchKind;\n dashed?: boolean;\n}\n\nexport function ChartSwatch({\n color,\n kind = \"rect\",\n dashed,\n}: ChartSwatchProps) {\n if (kind === \"line\") {\n return (\n <svg aria-hidden width=\"14\" height=\"6\" className=\"shrink-0\">\n <line\n x1=\"1\"\n x2=\"13\"\n y1=\"3\"\n y2=\"3\"\n stroke={color}\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeDasharray={dashed ? \"3 3\" : undefined}\n />\n </svg>\n );\n }\n return (\n <span\n aria-hidden\n className=\"inline-block size-2 shrink-0 rounded-[2px]\"\n style={{ background: color }}\n />\n );\n}\n\nexport interface ChartLegendItem {\n label: string;\n /** A CSS colour value — what `chartColor` returns. */\n color: string;\n kind?: ChartSwatchKind;\n dashed?: boolean;\n}\n\nexport interface ChartLegendProps extends Omit<\n ComponentProps<\"ul\">,\n \"children\"\n> {\n items: ReadonlyArray<ChartLegendItem>;\n}\n\n/**\n * The legend a chart of two or more series carries below the plot: a key\n * per series, in series order, wrapping when the row runs out. Text stays\n * in the UI ink; the swatch alone carries the colour.\n */\nexport function ChartLegend({ items, className, ...props }: ChartLegendProps) {\n return (\n <ul\n className={cn(\n \"text-pho-secondary flex flex-wrap gap-x-4 gap-y-1 text-xs\",\n className,\n )}\n {...props}\n >\n {items.map((item) => (\n <li key={item.label} className=\"flex items-center gap-1.5\">\n <ChartSwatch\n color={item.color}\n kind={item.kind}\n dashed={item.dashed}\n />\n {item.label}\n </li>\n ))}\n </ul>\n );\n}\n","export default function ascending(a, b) {\n return a == null || b == null ? NaN : a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN;\n}\n","export default function descending(a, b) {\n return a == null || b == null ? NaN\n : b < a ? -1\n : b > a ? 1\n : b >= a ? 0\n : NaN;\n}\n","import ascending from \"./ascending.js\";\nimport descending from \"./descending.js\";\n\nexport default function bisector(f) {\n let compare1, compare2, delta;\n\n // If an accessor is specified, promote it to a comparator. In this case we\n // can test whether the search value is (self-) comparable. We can’t do this\n // for a comparator (except for specific, known comparators) because we can’t\n // tell if the comparator is symmetric, and an asymmetric comparator can’t be\n // used to test whether a single value is comparable.\n if (f.length !== 2) {\n compare1 = ascending;\n compare2 = (d, x) => ascending(f(d), x);\n delta = (d, x) => f(d) - x;\n } else {\n compare1 = f === ascending || f === descending ? f : zero;\n compare2 = f;\n delta = f;\n }\n\n function left(a, x, lo = 0, hi = a.length) {\n if (lo < hi) {\n if (compare1(x, x) !== 0) return hi;\n do {\n const mid = (lo + hi) >>> 1;\n if (compare2(a[mid], x) < 0) lo = mid + 1;\n else hi = mid;\n } while (lo < hi);\n }\n return lo;\n }\n\n function right(a, x, lo = 0, hi = a.length) {\n if (lo < hi) {\n if (compare1(x, x) !== 0) return hi;\n do {\n const mid = (lo + hi) >>> 1;\n if (compare2(a[mid], x) <= 0) lo = mid + 1;\n else hi = mid;\n } while (lo < hi);\n }\n return lo;\n }\n\n function center(a, x, lo = 0, hi = a.length) {\n const i = left(a, x, lo, hi - 1);\n return i > lo && delta(a[i - 1], x) > -delta(a[i], x) ? i - 1 : i;\n }\n\n return {left, center, right};\n}\n\nfunction zero() {\n return 0;\n}\n","const e10 = Math.sqrt(50),\n e5 = Math.sqrt(10),\n e2 = Math.sqrt(2);\n\nfunction tickSpec(start, stop, count) {\n const step = (stop - start) / Math.max(0, count),\n power = Math.floor(Math.log10(step)),\n error = step / Math.pow(10, power),\n factor = error >= e10 ? 10 : error >= e5 ? 5 : error >= e2 ? 2 : 1;\n let i1, i2, inc;\n if (power < 0) {\n inc = Math.pow(10, -power) / factor;\n i1 = Math.round(start * inc);\n i2 = Math.round(stop * inc);\n if (i1 / inc < start) ++i1;\n if (i2 / inc > stop) --i2;\n inc = -inc;\n } else {\n inc = Math.pow(10, power) * factor;\n i1 = Math.round(start / inc);\n i2 = Math.round(stop / inc);\n if (i1 * inc < start) ++i1;\n if (i2 * inc > stop) --i2;\n }\n if (i2 < i1 && 0.5 <= count && count < 2) return tickSpec(start, stop, count * 2);\n return [i1, i2, inc];\n}\n\nexport default function ticks(start, stop, count) {\n stop = +stop, start = +start, count = +count;\n if (!(count > 0)) return [];\n if (start === stop) return [start];\n const reverse = stop < start, [i1, i2, inc] = reverse ? tickSpec(stop, start, count) : tickSpec(start, stop, count);\n if (!(i2 >= i1)) return [];\n const n = i2 - i1 + 1, ticks = new Array(n);\n if (reverse) {\n if (inc < 0) for (let i = 0; i < n; ++i) ticks[i] = (i2 - i) / -inc;\n else for (let i = 0; i < n; ++i) ticks[i] = (i2 - i) * inc;\n } else {\n if (inc < 0) for (let i = 0; i < n; ++i) ticks[i] = (i1 + i) / -inc;\n else for (let i = 0; i < n; ++i) ticks[i] = (i1 + i) * inc;\n }\n return ticks;\n}\n\nexport function tickIncrement(start, stop, count) {\n stop = +stop, start = +start, count = +count;\n return tickSpec(start, stop, count)[2];\n}\n\nexport function tickStep(start, stop, count) {\n stop = +stop, start = +start, count = +count;\n const reverse = stop < start, inc = reverse ? tickIncrement(stop, start, count) : tickIncrement(start, stop, count);\n return (reverse ? -1 : 1) * (inc < 0 ? 1 / -inc : inc);\n}\n","const t0 = new Date, t1 = new Date;\n\nexport function timeInterval(floori, offseti, count, field) {\n\n function interval(date) {\n return floori(date = arguments.length === 0 ? new Date : new Date(+date)), date;\n }\n\n interval.floor = (date) => {\n return floori(date = new Date(+date)), date;\n };\n\n interval.ceil = (date) => {\n return floori(date = new Date(date - 1)), offseti(date, 1), floori(date), date;\n };\n\n interval.round = (date) => {\n const d0 = interval(date), d1 = interval.ceil(date);\n return date - d0 < d1 - date ? d0 : d1;\n };\n\n interval.offset = (date, step) => {\n return offseti(date = new Date(+date), step == null ? 1 : Math.floor(step)), date;\n };\n\n interval.range = (start, stop, step) => {\n const range = [];\n start = interval.ceil(start);\n step = step == null ? 1 : Math.floor(step);\n if (!(start < stop) || !(step > 0)) return range; // also handles Invalid Date\n let previous;\n do range.push(previous = new Date(+start)), offseti(start, step), floori(start);\n while (previous < start && start < stop);\n return range;\n };\n\n interval.filter = (test) => {\n return timeInterval((date) => {\n if (date >= date) while (floori(date), !test(date)) date.setTime(date - 1);\n }, (date, step) => {\n if (date >= date) {\n if (step < 0) while (++step <= 0) {\n while (offseti(date, -1), !test(date)) {} // eslint-disable-line no-empty\n } else while (--step >= 0) {\n while (offseti(date, +1), !test(date)) {} // eslint-disable-line no-empty\n }\n }\n });\n };\n\n if (count) {\n interval.count = (start, end) => {\n t0.setTime(+start), t1.setTime(+end);\n floori(t0), floori(t1);\n return Math.floor(count(t0, t1));\n };\n\n interval.every = (step) => {\n step = Math.floor(step);\n return !isFinite(step) || !(step > 0) ? null\n : !(step > 1) ? interval\n : interval.filter(field\n ? (d) => field(d) % step === 0\n : (d) => interval.count(0, d) % step === 0);\n };\n }\n\n return interval;\n}\n","import {timeInterval} from \"./interval.js\";\n\nexport const millisecond = timeInterval(() => {\n // noop\n}, (date, step) => {\n date.setTime(+date + step);\n}, (start, end) => {\n return end - start;\n});\n\n// An optimized implementation for this simple case.\nmillisecond.every = (k) => {\n k = Math.floor(k);\n if (!isFinite(k) || !(k > 0)) return null;\n if (!(k > 1)) return millisecond;\n return timeInterval((date) => {\n date.setTime(Math.floor(date / k) * k);\n }, (date, step) => {\n date.setTime(+date + step * k);\n }, (start, end) => {\n return (end - start) / k;\n });\n};\n\nexport const milliseconds = millisecond.range;\n","export const durationSecond = 1000;\nexport const durationMinute = durationSecond * 60;\nexport const durationHour = durationMinute * 60;\nexport const durationDay = durationHour * 24;\nexport const durationWeek = durationDay * 7;\nexport const durationMonth = durationDay * 30;\nexport const durationYear = durationDay * 365;\n","import {timeInterval} from \"./interval.js\";\nimport {durationSecond} from \"./duration.js\";\n\nexport const second = timeInterval((date) => {\n date.setTime(date - date.getMilliseconds());\n}, (date, step) => {\n date.setTime(+date + step * durationSecond);\n}, (start, end) => {\n return (end - start) / durationSecond;\n}, (date) => {\n return date.getUTCSeconds();\n});\n\nexport const seconds = second.range;\n","import {timeInterval} from \"./interval.js\";\nimport {durationMinute, durationSecond} from \"./duration.js\";\n\nexport const timeMinute = timeInterval((date) => {\n date.setTime(date - date.getMilliseconds() - date.getSeconds() * durationSecond);\n}, (date, step) => {\n date.setTime(+date + step * durationMinute);\n}, (start, end) => {\n return (end - start) / durationMinute;\n}, (date) => {\n return date.getMinutes();\n});\n\nexport const timeMinutes = timeMinute.range;\n\nexport const utcMinute = timeInterval((date) => {\n date.setUTCSeconds(0, 0);\n}, (date, step) => {\n date.setTime(+date + step * durationMinute);\n}, (start, end) => {\n return (end - start) / durationMinute;\n}, (date) => {\n return date.getUTCMinutes();\n});\n\nexport const utcMinutes = utcMinute.range;\n","import {timeInterval} from \"./interval.js\";\nimport {durationHour, durationMinute, durationSecond} from \"./duration.js\";\n\nexport const timeHour = timeInterval((date) => {\n date.setTime(date - date.getMilliseconds() - date.getSeconds() * durationSecond - date.getMinutes() * durationMinute);\n}, (date, step) => {\n date.setTime(+date + step * durationHour);\n}, (start, end) => {\n return (end - start) / durationHour;\n}, (date) => {\n return date.getHours();\n});\n\nexport const timeHours = timeHour.range;\n\nexport const utcHour = timeInterval((date) => {\n date.setUTCMinutes(0, 0, 0);\n}, (date, step) => {\n date.setTime(+date + step * durationHour);\n}, (start, end) => {\n return (end - start) / durationHour;\n}, (date) => {\n return date.getUTCHours();\n});\n\nexport const utcHours = utcHour.range;\n","import {timeInterval} from \"./interval.js\";\nimport {durationDay, durationMinute} from \"./duration.js\";\n\nexport const timeDay = timeInterval(\n date => date.setHours(0, 0, 0, 0),\n (date, step) => date.setDate(date.getDate() + step),\n (start, end) => (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * durationMinute) / durationDay,\n date => date.getDate() - 1\n);\n\nexport const timeDays = timeDay.range;\n\nexport const utcDay = timeInterval((date) => {\n date.setUTCHours(0, 0, 0, 0);\n}, (date, step) => {\n date.setUTCDate(date.getUTCDate() + step);\n}, (start, end) => {\n return (end - start) / durationDay;\n}, (date) => {\n return date.getUTCDate() - 1;\n});\n\nexport const utcDays = utcDay.range;\n\nexport const unixDay = timeInterval((date) => {\n date.setUTCHours(0, 0, 0, 0);\n}, (date, step) => {\n date.setUTCDate(date.getUTCDate() + step);\n}, (start, end) => {\n return (end - start) / durationDay;\n}, (date) => {\n return Math.floor(date / durationDay);\n});\n\nexport const unixDays = unixDay.range;\n","import {timeInterval} from \"./interval.js\";\nimport {durationMinute, durationWeek} from \"./duration.js\";\n\nfunction timeWeekday(i) {\n return timeInterval((date) => {\n date.setDate(date.getDate() - (date.getDay() + 7 - i) % 7);\n date.setHours(0, 0, 0, 0);\n }, (date, step) => {\n date.setDate(date.getDate() + step * 7);\n }, (start, end) => {\n return (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * durationMinute) / durationWeek;\n });\n}\n\nexport const timeSunday = timeWeekday(0);\nexport const timeMonday = timeWeekday(1);\nexport const timeTuesday = timeWeekday(2);\nexport const timeWednesday = timeWeekday(3);\nexport const timeThursday = timeWeekday(4);\nexport const timeFriday = timeWeekday(5);\nexport const timeSaturday = timeWeekday(6);\n\nexport const timeSundays = timeSunday.range;\nexport const timeMondays = timeMonday.range;\nexport const timeTuesdays = timeTuesday.range;\nexport const timeWednesdays = timeWednesday.range;\nexport const timeThursdays = timeThursday.range;\nexport const timeFridays = timeFriday.range;\nexport const timeSaturdays = timeSaturday.range;\n\nfunction utcWeekday(i) {\n return timeInterval((date) => {\n date.setUTCDate(date.getUTCDate() - (date.getUTCDay() + 7 - i) % 7);\n date.setUTCHours(0, 0, 0, 0);\n }, (date, step) => {\n date.setUTCDate(date.getUTCDate() + step * 7);\n }, (start, end) => {\n return (end - start) / durationWeek;\n });\n}\n\nexport const utcSunday = utcWeekday(0);\nexport const utcMonday = utcWeekday(1);\nexport const utcTuesday = utcWeekday(2);\nexport const utcWednesday = utcWeekday(3);\nexport const utcThursday = utcWeekday(4);\nexport const utcFriday = utcWeekday(5);\nexport const utcSaturday = utcWeekday(6);\n\nexport const utcSundays = utcSunday.range;\nexport const utcMondays = utcMonday.range;\nexport const utcTuesdays = utcTuesday.range;\nexport const utcWednesdays = utcWednesday.range;\nexport const utcThursdays = utcThursday.range;\nexport const utcFridays = utcFriday.range;\nexport const utcSaturdays = utcSaturday.range;\n","import {timeInterval} from \"./interval.js\";\n\nexport const timeMonth = timeInterval((date) => {\n date.setDate(1);\n date.setHours(0, 0, 0, 0);\n}, (date, step) => {\n date.setMonth(date.getMonth() + step);\n}, (start, end) => {\n return end.getMonth() - start.getMonth() + (end.getFullYear() - start.getFullYear()) * 12;\n}, (date) => {\n return date.getMonth();\n});\n\nexport const timeMonths = timeMonth.range;\n\nexport const utcMonth = timeInterval((date) => {\n date.setUTCDate(1);\n date.setUTCHours(0, 0, 0, 0);\n}, (date, step) => {\n date.setUTCMonth(date.getUTCMonth() + step);\n}, (start, end) => {\n return end.getUTCMonth() - start.getUTCMonth() + (end.getUTCFullYear() - start.getUTCFullYear()) * 12;\n}, (date) => {\n return date.getUTCMonth();\n});\n\nexport const utcMonths = utcMonth.range;\n","import {timeInterval} from \"./interval.js\";\n\nexport const timeYear = timeInterval((date) => {\n date.setMonth(0, 1);\n date.setHours(0, 0, 0, 0);\n}, (date, step) => {\n date.setFullYear(date.getFullYear() + step);\n}, (start, end) => {\n return end.getFullYear() - start.getFullYear();\n}, (date) => {\n return date.getFullYear();\n});\n\n// An optimized implementation for this simple case.\ntimeYear.every = (k) => {\n return !isFinite(k = Math.floor(k)) || !(k > 0) ? null : timeInterval((date) => {\n date.setFullYear(Math.floor(date.getFullYear() / k) * k);\n date.setMonth(0, 1);\n date.setHours(0, 0, 0, 0);\n }, (date, step) => {\n date.setFullYear(date.getFullYear() + step * k);\n });\n};\n\nexport const timeYears = timeYear.range;\n\nexport const utcYear = timeInterval((date) => {\n date.setUTCMonth(0, 1);\n date.setUTCHours(0, 0, 0, 0);\n}, (date, step) => {\n date.setUTCFullYear(date.getUTCFullYear() + step);\n}, (start, end) => {\n return end.getUTCFullYear() - start.getUTCFullYear();\n}, (date) => {\n return date.getUTCFullYear();\n});\n\n// An optimized implementation for this simple case.\nutcYear.every = (k) => {\n return !isFinite(k = Math.floor(k)) || !(k > 0) ? null : timeInterval((date) => {\n date.setUTCFullYear(Math.floor(date.getUTCFullYear() / k) * k);\n date.setUTCMonth(0, 1);\n date.setUTCHours(0, 0, 0, 0);\n }, (date, step) => {\n date.setUTCFullYear(date.getUTCFullYear() + step * k);\n });\n};\n\nexport const utcYears = utcYear.range;\n","import {bisector, tickStep} from \"d3-array\";\nimport {durationDay, durationHour, durationMinute, durationMonth, durationSecond, durationWeek, durationYear} from \"./duration.js\";\nimport {millisecond} from \"./millisecond.js\";\nimport {second} from \"./second.js\";\nimport {timeMinute, utcMinute} from \"./minute.js\";\nimport {timeHour, utcHour} from \"./hour.js\";\nimport {timeDay, unixDay} from \"./day.js\";\nimport {timeSunday, utcSunday} from \"./week.js\";\nimport {timeMonth, utcMonth} from \"./month.js\";\nimport {timeYear, utcYear} from \"./year.js\";\n\nfunction ticker(year, month, week, day, hour, minute) {\n\n const tickIntervals = [\n [second, 1, durationSecond],\n [second, 5, 5 * durationSecond],\n [second, 15, 15 * durationSecond],\n [second, 30, 30 * durationSecond],\n [minute, 1, durationMinute],\n [minute, 5, 5 * durationMinute],\n [minute, 15, 15 * durationMinute],\n [minute, 30, 30 * durationMinute],\n [ hour, 1, durationHour ],\n [ hour, 3, 3 * durationHour ],\n [ hour, 6, 6 * durationHour ],\n [ hour, 12, 12 * durationHour ],\n [ day, 1, durationDay ],\n [ day, 2, 2 * durationDay ],\n [ week, 1, durationWeek ],\n [ month, 1, durationMonth ],\n [ month, 3, 3 * durationMonth ],\n [ year, 1, durationYear ]\n ];\n\n function ticks(start, stop, count) {\n const reverse = stop < start;\n if (reverse) [start, stop] = [stop, start];\n const interval = count && typeof count.range === \"function\" ? count : tickInterval(start, stop, count);\n const ticks = interval ? interval.range(start, +stop + 1) : []; // inclusive stop\n return reverse ? ticks.reverse() : ticks;\n }\n\n function tickInterval(start, stop, count) {\n const target = Math.abs(stop - start) / count;\n const i = bisector(([,, step]) => step).right(tickIntervals, target);\n if (i === tickIntervals.length) return year.every(tickStep(start / durationYear, stop / durationYear, count));\n if (i === 0) return millisecond.every(Math.max(tickStep(start, stop, count), 1));\n const [t, step] = tickIntervals[target / tickIntervals[i - 1][2] < tickIntervals[i][2] / target ? i - 1 : i];\n return t.every(step);\n }\n\n return [ticks, tickInterval];\n}\n\nconst [utcTicks, utcTickInterval] = ticker(utcYear, utcMonth, utcSunday, unixDay, utcHour, utcMinute);\nconst [timeTicks, timeTickInterval] = ticker(timeYear, timeMonth, timeSunday, timeDay, timeHour, timeMinute);\n\nexport {utcTicks, utcTickInterval, timeTicks, timeTickInterval};\n","import { tickStep, ticks } from \"d3-array\";\nimport { timeDay, timeTicks, timeYear } from \"d3-time\";\n\n/** Epoch milliseconds for a datum's `x`. */\nexport function toTime(x: Date | number): number {\n return typeof x === \"number\" ? x : x.getTime();\n}\n\n/**\n * A y domain on round numbers with three to five ticks, the last tick on\n * or above the data's high end so the top of the plot is labelled.\n * `count` is the tick count that produced them, for a scale's `.ticks()`.\n *\n * When `integer` is set — or when both ends are whole numbers — the step\n * stays ≥ 1 so a count axis never labels 0.5 / 1.5.\n */\nexport function niceLinearDomain(\n min: number,\n max: number,\n options?: { integer?: boolean },\n): { domain: [number, number]; ticks: number[]; count: number } {\n if (!Number.isFinite(min) || !Number.isFinite(max)) {\n return { domain: [0, 1], ticks: [0, 1], count: 1 };\n }\n if (min > max) [min, max] = [max, min];\n const integer =\n options?.integer ?? (Number.isInteger(min) && Number.isInteger(max));\n if (min === max) {\n // A flat series still needs room to sit in.\n if (max === 0) {\n return integer\n ? { domain: [0, 1], ticks: [0, 1], count: 1 }\n : { domain: [0, 1], ticks: [0, 0.5, 1], count: 2 };\n }\n if (max > 0) min = 0;\n else max = 0;\n }\n for (let count = 4; count >= 2; count--) {\n const step = integer\n ? wholeTickStep(min, max, count)\n : tickStep(min, max, count);\n const lo = Math.floor(min / step) * step;\n const hi = Math.ceil(max / step) * step;\n const values = integer ? rangeTicks(lo, hi, step) : ticks(lo, hi, count);\n if (values.length <= 5 || count === 2) {\n // A whole-number step can differ from d3's own for `count`; the\n // interval count asks a scale for the same lines back.\n return {\n domain: [lo, hi],\n ticks: values,\n count: integer ? Math.max(1, values.length - 1) : count,\n };\n }\n }\n return { domain: [min, max], ticks: [min, max], count: 1 };\n}\n\n/** A 1-2-5 step that is never a fraction. */\nfunction wholeTickStep(min: number, max: number, count: number): number {\n const raw = tickStep(min, max, count);\n if (raw <= 1) return 1;\n if (Number.isInteger(raw)) return raw;\n const exp = Math.floor(Math.log10(raw));\n const mag = 10 ** exp;\n const n = raw / mag;\n const nice = n <= 1 ? 1 : n <= 2 ? 2 : n <= 5 ? 5 : 10;\n return nice * mag;\n}\n\nfunction rangeTicks(lo: number, hi: number, step: number): number[] {\n const values: number[] = [];\n for (let at = lo; at <= hi + step / 2; at += step) values.push(at);\n return values;\n}\n\n/** The gap between buckets, in ms — the median step, so one hole doesn't skew it. */\nexport function bucketSpan(times: ReadonlyArray<number>): number {\n if (times.length < 2) return 0;\n const steps = [];\n for (let i = 1; i < times.length; i++) steps.push(times[i]! - times[i - 1]!);\n steps.sort((a, b) => a - b);\n return steps[Math.floor(steps.length / 2)]!;\n}\n\nconst DAY = 86_400_000;\n\n/**\n * Time ticks for a plot `width` px wide: one every ~96px, on the round\n * boundaries d3-time picks (5 minutes, an hour, a day, a month…).\n */\nexport function timeAxisTicks(\n start: number,\n stop: number,\n width: number,\n): Date[] {\n if (stop <= start || width <= 0) return [new Date(start)];\n const count = Math.max(2, Math.floor(width / 96));\n const chosen = timeTicks(new Date(start), new Date(stop), count);\n // d3's every-nth-day interval counts from the first of the month, so a\n // two-day step reads Aug 29, Aug 31, Sep 1, Sep 3. Re-step multi-day\n // ticks evenly from the first one instead.\n if (chosen.length > 2 && chosen.every((t) => isMidnight(t))) {\n const gaps = chosen.slice(1).map((t, i) => timeDay.count(chosen[i]!, t));\n const step = Math.max(...gaps);\n if (step > 1 && gaps.some((gap) => gap !== step)) {\n return timeDay.range(chosen[0]!, new Date(stop + 1), step);\n }\n }\n return chosen;\n}\n\nfunction isMidnight(date: Date): boolean {\n return timeDay(date).getTime() === date.getTime();\n}\n\n/**\n * Labels a tick by the boundary it sits on: a time within a day, a date at\n * midnight, month and year at a new year. `Intl` does the wording, so the\n * labels follow the locale.\n */\nexport function timeTickFormatter(locale?: string): (date: Date) => string {\n const time = new Intl.DateTimeFormat(locale, {\n hour: \"numeric\",\n minute: \"2-digit\",\n });\n const day = new Intl.DateTimeFormat(locale, {\n month: \"short\",\n day: \"numeric\",\n });\n const year = new Intl.DateTimeFormat(locale, {\n month: \"short\",\n year: \"numeric\",\n });\n return (date) => {\n if (timeDay(date).getTime() < date.getTime()) return time.format(date);\n if (timeYear(date).getTime() < date.getTime()) return day.format(date);\n return year.format(date);\n };\n}\n\n/**\n * The tooltip's heading for a bucket: the date alone when buckets are a\n * day or longer, date and time below that.\n */\nexport function bucketTimeFormatter(\n locale: string | undefined,\n span: number,\n): (date: Date) => string {\n const format = new Intl.DateTimeFormat(\n locale,\n span >= DAY\n ? { month: \"short\", day: \"numeric\" }\n : { month: \"short\", day: \"numeric\", hour: \"numeric\", minute: \"2-digit\" },\n );\n return (date) => format.format(date);\n}\n\n/** Estimated width of a tick label at the axis's 11px, with breathing room. */\nfunction labelWidth(label: string): number {\n return label.length * 6.5 + 16;\n}\n\n/** Keep every nth tick so the labels fit the width without touching. */\nexport function thinTicks<T>(\n values: ReadonlyArray<T>,\n labelOf: (value: T) => string,\n width: number,\n): T[] {\n if (values.length < 2) return [...values];\n const widest = Math.max(...values.map((value) => labelWidth(labelOf(value))));\n const fit = Math.max(1, Math.floor(width / widest));\n const every = Math.ceil(values.length / fit);\n if (every <= 1) return [...values];\n return values.filter((_, index) => index % every === 0);\n}\n\n/** The index of the position nearest `px` in an ascending list. */\nexport function nearestIndex(positions: ReadonlyArray<number>, px: number) {\n if (positions.length === 0) return -1;\n let lo = 0;\n let hi = positions.length - 1;\n while (lo < hi) {\n const mid = (lo + hi) >> 1;\n if (positions[mid]! < px) lo = mid + 1;\n else hi = mid;\n }\n if (lo > 0 && px - positions[lo - 1]! < positions[lo]! - px) return lo - 1;\n return lo;\n}\n","import {\n useId,\n type ComponentProps,\n type CSSProperties,\n type ReactNode,\n type RefObject,\n} from \"react\";\nimport { cn } from \"../../utils/cn\";\n\n/** The bands around the plot, and the inner box the marks draw in. */\nexport interface ChartLayout {\n width: number;\n height: number;\n left: number;\n top: number;\n right: number;\n bottom: number;\n innerWidth: number;\n innerHeight: number;\n /** The same bands in the shape visx takes. */\n margin: { top: number; right: number; bottom: number; left: number };\n}\n\nconst TOP = 8;\nconst RIGHT = 8;\nconst X_AXIS = 22;\n\n/** The plot's box for a measured width and the y-axis labels it must fit. */\nexport function chartLayout(\n width: number,\n height: number,\n yLabels: ReadonlyArray<string>,\n): ChartLayout {\n const widest = yLabels.reduce((max, label) => Math.max(max, label.length), 0);\n const left = Math.ceil(widest * 6.5) + 10;\n const bottom = height - X_AXIS;\n return {\n width,\n height,\n left,\n top: TOP,\n right: width - RIGHT,\n bottom,\n innerWidth: Math.max(0, width - left - RIGHT),\n innerHeight: Math.max(0, bottom - TOP),\n margin: { top: TOP, right: RIGHT, bottom: X_AXIS, left },\n };\n}\n\n/**\n * The surface a stacked segment's gap is cut in: the nearest registered\n * surface, the card by default. Read once here so the stroke below and\n * the hover rings agree.\n */\nconst SURFACE_STYLE = {\n \"--pho-chart-surface\":\n \"var(--pho-surface, var(--background-color-pho-primary))\",\n} as CSSProperties;\n\nexport interface ChartShellProps extends Omit<\n ComponentProps<\"div\">,\n \"children\"\n> {\n /** The figure's `aria-label`. */\n label: string;\n /** The figure's spoken summary. */\n description: string;\n height: number;\n containerRef: RefObject<HTMLDivElement | null>;\n legend?: ReactNode;\n loading?: boolean;\n empty?: ReactNode;\n /** The frame says `empty` instead of drawing. */\n showEmpty?: boolean;\n /** What stands in for the plot while the first data is on its way. */\n placeholder?: ReactNode;\n /**\n * The figure itself — the svg and its tooltip. Presentational to\n * assistive tech: the frame's label and description speak for it.\n */\n children?: ReactNode;\n}\n\n/**\n * The frame every chart draws in: a fixed-height plot box holding the\n * figure (`role=\"img\"`, labelled and described for assistive tech), the\n * legend on its own line below. Width comes from the parent; `height`\n * covers the plot and the x-axis band, so a card never grows a nested\n * scroll.\n */\nexport function ChartShell({\n label,\n description,\n height,\n containerRef,\n legend,\n loading,\n empty,\n showEmpty,\n placeholder,\n className,\n children,\n ...props\n}: ChartShellProps) {\n const descriptionId = useId();\n return (\n <div\n data-chart=\"\"\n className={cn(\"flex w-full min-w-0 flex-col gap-3\", className)}\n {...props}\n >\n <div\n ref={containerRef}\n aria-busy={loading || undefined}\n className={cn(\n \"relative w-full transition-opacity duration-150 ease-out\",\n loading && \"opacity-50\",\n )}\n style={{ height }}\n >\n <div\n // A drawn figure is `role=\"img\"`; there is no <img> to reach\n // for, and the svg is visx's, so the role sits on its box.\n // oxlint-disable-next-line jsx-a11y/prefer-tag-over-role\n role=\"img\"\n aria-label={label}\n aria-describedby={descriptionId}\n // The 2px gap between stacked segments is a stroke in the\n // surface colour on every segment: one pixel shaved off each\n // side of a boundary, and nothing drawn that isn't surface.\n className=\"animate-pho-chart-in relative size-full select-none [&_.visx-bar-stack_.visx-bar]:stroke-(--pho-chart-surface) [&_.visx-bar-stack_.visx-bar]:stroke-2 [&_svg]:block [&_svg]:overflow-visible\"\n style={SURFACE_STYLE}\n >\n {children}\n </div>\n <p id={descriptionId} className=\"sr-only\">\n {description}\n </p>\n {placeholder}\n {showEmpty && (\n <div className=\"text-pho-description absolute inset-0 flex items-center justify-center text-xs\">\n {empty}\n </div>\n )}\n </div>\n {legend}\n </div>\n );\n}\n","import { Skeleton } from \"../skeleton\";\nimport { cn } from \"../../utils/cn\";\nimport type { ChartLayout } from \"./shell\";\n\n/**\n * Heights for the column bones, as a share of the plot: a made-up week\n * or two that reads as a chart without pretending to be one. Fixed, so\n * the placeholder is the same on the server and the browser.\n */\nconst BARS = [\n 0.42, 0.58, 0.5, 0.7, 0.62, 0.8, 0.66, 0.9, 0.72, 0.56, 0.76, 0.64,\n];\n\n/** The grid rows, as a share of the plot from the top; the last is the baseline. */\nconst ROWS = [0, 1 / 3, 2 / 3, 1];\n\n/** Time labels along the bottom band. */\nconst X_LABELS = 5;\n\n/**\n * Bones in the shape of a chart, for a first load with nothing to hold:\n * the frame's own coordinate system — hairline rows, a baseline, a label\n * bone at every row on the left and a few along the bottom — with a\n * dozen columns standing on the baseline in the plot's box. A refetch\n * never shows this; the chart keeps its last render at half opacity.\n */\nexport function ChartSkeleton({ layout }: { layout: ChartLayout }) {\n const { margin } = layout;\n return (\n <div\n aria-hidden\n data-chart-skeleton=\"\"\n className=\"absolute inset-0 grid\"\n style={{\n gridTemplateColumns: `${margin.left}px 1fr ${margin.right}px`,\n gridTemplateRows: `${margin.top}px 1fr ${margin.bottom}px`,\n }}\n >\n <div className=\"relative col-start-1 row-start-2\">\n {ROWS.map((share) => (\n <Skeleton\n key={share}\n data-bone=\"y\"\n className=\"absolute right-2 h-2.5 w-4 -translate-y-1/2\"\n style={{ top: `${share * 100}%` }}\n />\n ))}\n </div>\n <div className=\"relative col-start-2 row-start-2\">\n {ROWS.map((share, index) => (\n <div\n key={share}\n data-bone={index === ROWS.length - 1 ? \"baseline\" : \"grid\"}\n className={cn(\n \"absolute inset-x-0 border-t\",\n index === ROWS.length - 1\n ? \"border-pho-chart-crosshair\"\n : \"border-pho-chart-grid\",\n )}\n style={{ top: `${share * 100}%` }}\n />\n ))}\n <div className=\"absolute inset-0 flex items-end justify-between gap-2\">\n {BARS.map((share, index) => (\n <Skeleton\n key={index}\n data-bone=\"bar\"\n className=\"w-full max-w-6 rounded-t-[4px] rounded-b-none\"\n style={{ height: `${share * 100}%` }}\n />\n ))}\n </div>\n </div>\n <div className=\"col-start-2 row-start-3 flex items-center justify-between px-1\">\n {Array.from({ length: X_LABELS }, (_, index) => (\n <Skeleton key={index} data-bone=\"x\" className=\"h-2.5 w-8\" />\n ))}\n </div>\n </div>\n );\n}\n","import { buildChartTheme, type XYChartTheme } from \"@visx/xychart\";\n\n/**\n * The tick label: the axis's 11px in description ink, tabular so a column\n * of numbers lines up, in the page's own font rather than visx's stack.\n */\nconst LABEL = {\n fontFamily: \"inherit\",\n fontSize: 11,\n fontWeight: 400,\n letterSpacing: 0,\n fill: \"var(--text-color-pho-description)\",\n style: { fontVariantNumeric: \"tabular-nums\" },\n} as const;\n\n/**\n * The visx theme for a chart's furniture: gridlines one step off the\n * surface, description-ink ticks, and the series colours in part order\n * as the fallback palette. Everything is a CSS custom property, so the\n * theme follows light and dark without a second copy.\n */\nexport function buildPhoTheme(colors: ReadonlyArray<string>): XYChartTheme {\n return buildChartTheme({\n backgroundColor: \"var(--pho-surface, var(--background-color-pho-primary))\",\n colors: [...colors],\n gridColor: \"var(--color-pho-chart-grid)\",\n gridColorDark: \"var(--color-pho-chart-crosshair)\",\n // Labels hang this far off the plot; the tick lines themselves are hidden.\n tickLength: 4,\n svgLabelSmall: LABEL,\n svgLabelBig: LABEL,\n htmlLabel: {\n fontFamily: \"inherit\",\n fontSize: 11,\n fontWeight: 400,\n letterSpacing: 0,\n color: \"var(--text-color-pho-description)\",\n },\n });\n}\n","import { type ReactNode } from \"react\";\nimport { ChartSwatch, type ChartSwatchKind } from \"./legend\";\nimport type { ChartBreakdownItem } from \"./types\";\n\nexport interface ChartTooltipRow {\n label: string;\n value: string;\n color: string;\n kind?: ChartSwatchKind;\n dashed?: boolean;\n}\n\nexport interface ChartTooltipProps {\n /** The snapped x of the hovered bucket, in container px. */\n x: number;\n /** The container's width — the tooltip flips to the left past the middle. */\n width: number;\n /** Where the tooltip's top sits — the plot's top. */\n top: number;\n heading: string;\n rows: ReadonlyArray<ChartTooltipRow>;\n breakdown?: ReadonlyArray<ChartBreakdownItem>;\n breakdownTitle?: ReactNode;\n valueFormat: (value: number) => string;\n /** Said in place of the rows when no series has a value in this bucket. */\n empty?: ReactNode;\n}\n\n/**\n * The readout for one bucket: its time, then every series' value (values\n * lead, in primary ink; labels follow), then the bucket's breakdown when\n * it carries one, or `empty` when there is no value to list. Presentational — the figure's description already\n * speaks the data — and it never takes the pointer.\n */\nexport function ChartTooltip({\n x,\n width,\n top,\n heading,\n rows,\n breakdown,\n breakdownTitle,\n valueFormat,\n empty,\n}: ChartTooltipProps) {\n const flip = x > width / 2;\n return (\n <div\n aria-hidden\n data-chart-tooltip=\"\"\n className=\"bg-pho-primary shadow-pho-lg ring-pho-secondary rounded-base pointer-events-none absolute z-10 max-w-72 min-w-40 px-3 py-2 text-xs ring-1 ring-inset\"\n style={flip ? { right: width - x + 12, top } : { left: x + 12, top }}\n >\n <div className=\"text-pho-primary font-medium\">{heading}</div>\n {rows.length === 0 && empty != null && (\n <div className=\"text-pho-description mt-1\">{empty}</div>\n )}\n <ul className=\"mt-1 flex flex-col gap-0.5\">\n {rows.map((row) => (\n <li\n key={row.label}\n className=\"flex items-center justify-between gap-4\"\n >\n <span className=\"text-pho-secondary flex min-w-0 items-center gap-1.5\">\n <ChartSwatch\n color={row.color}\n kind={row.kind}\n dashed={row.dashed}\n />\n <span className=\"truncate\">{row.label}</span>\n </span>\n <span className=\"text-pho-primary font-medium tabular-nums\">\n {row.value}\n </span>\n </li>\n ))}\n </ul>\n {breakdown != null && breakdown.length > 0 && (\n <div className=\"border-pho-secondary mt-2 border-t pt-2\">\n {breakdownTitle != null && (\n <div className=\"text-pho-description mb-1\">{breakdownTitle}</div>\n )}\n <ul className=\"flex flex-col gap-0.5\">\n {breakdown.map((item) => (\n <li\n key={item.label}\n className=\"flex items-center justify-between gap-4\"\n >\n <span className=\"text-pho-secondary truncate\">\n {item.label}\n </span>\n <span className=\"text-pho-primary tabular-nums\">\n {valueFormat(item.value)}\n </span>\n </li>\n ))}\n </ul>\n </div>\n )}\n </div>\n );\n}\n","import {\n useEffect,\n useLayoutEffect,\n useRef,\n useState,\n type RefObject,\n} from \"react\";\n\n// React 18 warns that useLayoutEffect does nothing on the server (19 dropped\n// the warning); a plain effect there keeps a server render quiet.\nexport const useIsomorphicLayoutEffect =\n typeof window === \"undefined\" ? useEffect : useLayoutEffect;\n\n/**\n * The width of the element the ref lands on, kept current through a\n * ResizeObserver. Nothing runs on the server: the first render is 0 wide\n * and the plot fills in once the browser has measured. A `fixed` width\n * skips measuring altogether.\n */\nexport function useMeasuredWidth<T extends HTMLElement>(\n fixed?: number,\n): [RefObject<T | null>, number] {\n const ref = useRef<T>(null);\n const [width, setWidth] = useState(0);\n useIsomorphicLayoutEffect(() => {\n if (fixed != null) return;\n const element = ref.current;\n if (element == null) return;\n setWidth(element.getBoundingClientRect().width);\n if (typeof ResizeObserver === \"undefined\") return;\n const observer = new ResizeObserver((entries) => {\n const next = entries[0]?.contentRect.width;\n if (next != null) setWidth(next);\n });\n observer.observe(element);\n return () => observer.disconnect();\n }, [fixed]);\n return [ref, fixed ?? width];\n}\n","import {\n Children,\n Fragment,\n isValidElement,\n useCallback,\n useContext,\n useId,\n useMemo,\n useRef,\n type ReactNode,\n} from \"react\";\nimport { curveLinear, curveMonotoneX } from \"d3-shape\";\nimport { useAnimate, useReducedMotion } from \"motion/react\";\nimport {\n AreaSeries,\n Axis,\n BarGroup,\n BarSeries,\n BarStack,\n DataContext,\n DataProvider,\n Grid,\n LineSeries,\n TooltipContext,\n TooltipProvider,\n XYChart,\n} from \"@visx/xychart\";\nimport {\n FADE_ENTRANCE,\n RISE_PX,\n SPAN_SCALE,\n SPRING_ENTRANCE,\n} from \"../../motion\";\nimport { chartColor } from \"./color\";\nimport { describeChart, numberFormatter, readValue } from \"./format\";\nimport { ChartLegend } from \"./legend\";\nimport {\n bucketSpan,\n bucketTimeFormatter,\n nearestIndex,\n niceLinearDomain,\n thinTicks,\n timeAxisTicks,\n timeTickFormatter,\n toTime,\n} from \"./scale\";\nimport { ChartShell, chartLayout, type ChartLayout } from \"./shell\";\nimport { ChartSkeleton } from \"./skeleton\";\nimport { buildPhoTheme } from \"./theme\";\nimport { ChartTooltip, type ChartTooltipRow } from \"./tooltip\";\nimport type {\n ChartBarProps,\n ChartColor,\n ChartCurve,\n ChartDatum,\n ChartGaps,\n ChartLineProps,\n ChartProps,\n} from \"./types\";\nimport { useIsomorphicLayoutEffect, useMeasuredWidth } from \"./use-measure\";\n\n/**\n * Chart — buckets over time, drawn as the parts it is given: `Chart.Bar`\n * for columns, `Chart.Line` for lines, mixed when a page wants a daily\n * count under its rolling average. The root owns everything the parts\n * share: the frame, the scales, the axes and grid, the tooltip, the\n * legend and the figure's spoken summary. Built on @visx/xychart.\n *\n * Design notes:\n * - Bars are thin: a column never fills its band and never runs past\n * 24px; the leftover is air. The data end is rounded (4px), the\n * baseline end square — in a stack only the column's top gets the\n * corners, whichever series has a value on top in that bucket (a clip,\n * see `StackClip`), and a 2px stroke in the surface colour separates\n * segments instead of a border. Side by side, bars sit 2px apart inside\n * the same slot.\n * - Lines are 2px with round joins, straight by default: a curve invents\n * values between samples, so `curve=\"monotone\"` is a choice the page\n * makes for a smooth-by-nature quantity. `area` washes the surface\n * under a line at 10%. A bucket with no value breaks the line, unless\n * the part asks for `gaps=\"connect\"`: then the line joins its\n * neighbours across the hole, for a measure with no reading there\n * rather than a reading of nothing (a percentile in an hour with no\n * requests). Hover still lands on the hole, and `emptyBucket` names it.\n * A reading no line reaches — a hole on each side, or a connected\n * series with one bucket in the window — is a dot of its own, not the\n * stroke's round cap.\n * - Charts with bars run on a band scale, buckets centred in equal bands;\n * lines alone run edge to edge on a time scale. Either way the x-axis\n * labels the round times that fit, and the y-axis three to five round\n * numbers with a hairline grid.\n * - Hover snaps to the nearest bucket: bars lift it with the ghost wash,\n * lines get a crosshair and a surface-ringed point per series, and one\n * tooltip lists every part with a value plus the bucket's `breakdown`.\n * - Data arrives the way a page section does, on the entrance spring and\n * fade `Reveal` uses. A chart that mounts with data rises from its\n * base; data that follows the bones slides in from the left, the same\n * reveal turned along the time axis. A range switch follows the range:\n * a wider span opens outward from inside the plot, a narrower one\n * closes inward from outside it (clipped to the plot); the same span\n * slides in again. A first load with nothing to hold shows bones in\n * the chart's shape, coordinate system included; a refetch keeps the\n * last render at half opacity. Reduced motion makes every arrival\n * static.\n * - The figure is `role=\"img\"` with the `label` and a spoken summary; the\n * legend is real text below the plot, present for two or more parts.\n * Marks register with visx after mount, so a server render carries the\n * frame, the legend and the summary, and the plot fills on hydration.\n */\n\nconst BAR_MAX = 24;\nconst RADIUS = 4;\n/** The surface stroke between stacked segments (`stroke-2` in `ChartShell`); half of it falls inside each segment. */\nconst SEGMENT_INSET = 1;\nconst LINE_WIDTH = 2;\nconst POINT_RADIUS = 4;\nconst LONE_RADIUS = 3;\nconst SURFACE = \"var(--pho-chart-surface)\";\nconst WASH = \"var(--background-color-pho-ghost-hover)\";\nconst CROSSHAIR = \"var(--color-pho-chart-crosshair)\";\n\n/* ---------------------------------- parts --------------------------------- */\n\n/**\n * `Chart.Bar` — one bar series. Renders nothing itself: the root reads\n * its props and draws the columns among the other parts.\n */\nexport function ChartBar(_props: ChartBarProps): null {\n return null;\n}\nChartBar.displayName = \"Chart.Bar\";\nChartBar.chartPart = \"bar\" as const;\n\n/**\n * `Chart.Line` — one line series. Renders nothing itself: the root reads\n * its props and draws the line among the other parts.\n */\nexport function ChartLine(_props: ChartLineProps): null {\n return null;\n}\nChartLine.displayName = \"Chart.Line\";\nChartLine.chartPart = \"line\" as const;\n\ninterface Part {\n kind: \"bar\" | \"line\";\n dataKey: string;\n label: string;\n color?: ChartColor;\n dashed?: boolean;\n curve: ChartCurve;\n area?: boolean;\n gaps?: ChartGaps;\n}\n\n/** What a part element is, by the marker on its component rather than its identity: a hot reload or a second copy of the library must not lose the parts. */\nfunction partKind(type: unknown): \"bar\" | \"line\" | undefined {\n return (type as { chartPart?: \"bar\" | \"line\" } | null)?.chartPart;\n}\n\n/** The parts among `children`, in order; fragments are looked through. */\nfunction collectParts(children: ReactNode, into: Part[] = []): Part[] {\n Children.forEach(children, (child) => {\n if (!isValidElement(child)) return;\n const kind = partKind(child.type);\n if (child.type === Fragment) {\n collectParts((child.props as { children?: ReactNode }).children, into);\n } else if (kind === \"bar\") {\n const p = child.props as ChartBarProps;\n into.push({\n kind: \"bar\",\n dataKey: p.dataKey,\n label: p.label,\n color: p.color,\n curve: \"linear\",\n });\n } else if (kind === \"line\") {\n const p = child.props as ChartLineProps;\n into.push({\n kind: \"line\",\n dataKey: p.dataKey,\n label: p.label,\n color: p.color,\n dashed: p.dashed,\n curve: p.curve ?? \"linear\",\n area: p.area,\n gaps: p.gaps ?? \"break\",\n });\n }\n });\n return into;\n}\n\n/* -------------------------------- accessors ------------------------------- */\n// visx registers a series again whenever an accessor's identity changes,\n// so these are made once per key and shared.\n\ntype Datum = object;\ntype Accessor = (d: Datum) => number;\n\nconst xAccessor: Accessor = (d) => toTime((d as ChartDatum).x);\n\nconst barAccessors = new Map<string, Accessor>();\n/** A bar's value; a hole reads as zero so the segments above still stack. */\nfunction barAccessor(key: string): Accessor {\n let fn = barAccessors.get(key);\n if (fn == null) {\n fn = (d) => readValue(d, key) ?? 0;\n barAccessors.set(key, fn);\n }\n return fn;\n}\n\nconst lineAccessors = new Map<string, Accessor>();\n/** A line's value; a hole reads as NaN so the line breaks there. */\nfunction lineAccessor(key: string): Accessor {\n let fn = lineAccessors.get(key);\n if (fn == null) {\n fn = (d) => readValue(d, key) ?? NaN;\n lineAccessors.set(key, fn);\n }\n return fn;\n}\n\nconst fillAccessors = new Map<string, (d: Datum) => string>();\n/** A bar's fill: its colour, or nothing for an empty bucket so no sliver shows. */\nfunction fillAccessor(key: string, color: string): (d: Datum) => string {\n const id = `${key} ${color}`;\n let fn = fillAccessors.get(id);\n if (fn == null) {\n fn = (d) => (readValue(d, key) ? color : \"transparent\");\n fillAccessors.set(id, fn);\n }\n return fn;\n}\n\n/* --------------------------------- scales --------------------------------- */\n\ntype Positioner = (value: number | Date) => number | undefined;\n\n/** A value's x: the middle of its band, or its point on the time scale. */\nfunction xPositioner(scale: unknown): Positioner {\n const s = scale as ((v: number | Date) => number | undefined) & {\n bandwidth?: () => number;\n };\n const half = typeof s.bandwidth === \"function\" ? s.bandwidth() / 2 : 0;\n return (value) => {\n const x = s(value);\n return typeof x === \"number\" && Number.isFinite(x) ? x + half : undefined;\n };\n}\n\nfunction yPositioner(scale: unknown): Positioner {\n const s = scale as (v: number) => number | undefined;\n return (value) => {\n const y = s(Number(value));\n return typeof y === \"number\" && Number.isFinite(y) ? y : undefined;\n };\n}\n\n/** A band scale's step; a continuous scale has none. */\nfunction stepOf(scale: unknown): number {\n const s = scale as { step?: () => number };\n return typeof s.step === \"function\" ? s.step() : 0;\n}\n\ninterface BandLayout {\n /** The bands' padding: what keeps a bar thin and, in a group, apart. */\n paddingInner: number;\n paddingOuter: number;\n /** The padding inside a group of bars, for visx's group scale. */\n groupPadding: number;\n}\n\n/**\n * How much of each band the bars take. Buckets are centred in equal\n * bands (`paddingOuter` is half the inner padding, so every step is the\n * same width and the tooltip's snapping matches the marks). The bar slot\n * is capped at 24px with a 2px gap; a group spends 2px between its bars,\n * a stack 2px on its surface stroke, so the visible mark stays in the\n * slot.\n */\nfunction bandLayout(\n innerWidth: number,\n count: number,\n groups: number,\n stacked: boolean,\n): BandLayout {\n const step = count > 0 ? innerWidth / count : 0;\n const gap = step >= 6 ? 2 : step >= 3 ? 1 : 0;\n const slot = Math.max(1, Math.min(BAR_MAX, step - gap));\n const inner = Math.min(2, gap);\n const target = stacked ? slot + inner : groups > 1 ? slot + 2 * inner : slot;\n const bandwidth = Math.min(step, target);\n const paddingInner = step > 0 ? 1 - bandwidth / step : 0;\n // A group's band scale pads inside and outside alike; this keeps the\n // gaps between bars at `inner` px.\n const groupPadding =\n groups > 1 && bandwidth > inner\n ? Math.min(0.5, (inner * groups) / (bandwidth - inner))\n : 0;\n return { paddingInner, paddingOuter: paddingInner / 2, groupPadding };\n}\n\n/* --------------------------------- layers --------------------------------- */\n\n/**\n * visx makes its scales once a series has registered, and hands out a\n * placeholder before that: nothing is drawn against it, on the server or\n * in the first client frame.\n */\nfunction Registered({ children }: { children: ReactNode }) {\n const { dataRegistry } = useContext(DataContext);\n const ready =\n dataRegistry?.entries().some((entry) => entry.data.length > 0) ?? false;\n return ready ? <>{children}</> : null;\n}\n\n/**\n * The hovered bucket's index, when visx has one and it still exists.\n *\n * Without a `gaps=\"connect\"` line, every registered series shares the same\n * unfiltered array, so visx's own `nearestDatum.index` already is the\n * bucket's place in `data` — used as-is, bounds-checked against the\n * current length so a hover from before the data shrank can't outlive it.\n *\n * A connect line is registered under its own filtered (holes removed)\n * array instead, so that bounds-check alone isn't enough: visx compares x\n * *and* y distance across series to pick the nearest one, so a hole —\n * nothing is registered there — can lose to a neighbouring visible point\n * whenever the pointer sits far from that point's height, not only near\n * the boundary between them. Once any line connects, the bucket is found\n * by x position alone instead, against every bucket in the full data —\n * the same read `HoverWash`'s wash and `HoverMarks`' crosshair already do\n * in the other direction. A bucket is a bucket, hole or not, and the\n * nearest one by x is always the right one.\n */\nfunction useHoveredIndex(\n data: ReadonlyArray<ChartDatum>,\n xScale: unknown,\n hasConnectedLines: boolean,\n): number | null {\n const tooltip = useContext(TooltipContext);\n if (!tooltip?.tooltipOpen) return null;\n if (hasConnectedLines) {\n const left = tooltip.tooltipLeft;\n if (left == null || xScale == null || data.length === 0) return null;\n const positioner = xPositioner(xScale);\n const positions: number[] = [];\n for (const d of data) {\n const x = positioner(toTime(d.x));\n if (x == null) return null;\n positions.push(x);\n }\n return nearestIndex(positions, left);\n }\n const index = tooltip.tooltipData?.nearestDatum?.index;\n return index != null && index >= 0 && index < data.length ? index : null;\n}\n\ninterface LayerProps {\n data: ReadonlyArray<ChartDatum>;\n layout: ChartLayout;\n /** See `useHoveredIndex`. */\n hasConnectedLines: boolean;\n}\n\n/** The time labels along the bottom; the end labels tuck inside the plot. */\nfunction BottomAxis({\n values,\n format,\n layout,\n}: {\n values: ReadonlyArray<number | Date>;\n format: (value: number | Date) => string;\n layout: ChartLayout;\n}) {\n const { xScale } = useContext(DataContext);\n const tickLabelProps = useCallback(\n (raw: unknown) => {\n const value = raw as number | Date;\n const x = xPositioner(xScale)(value) ?? layout.left;\n const half = (format(value).length * 6.5) / 2;\n const textAnchor =\n x - half < layout.left\n ? \"start\"\n : x + half > layout.right\n ? \"end\"\n : \"middle\";\n return { textAnchor } as const;\n },\n [xScale, format, layout.left, layout.right],\n );\n return (\n <Axis\n orientation=\"bottom\"\n tickValues={[...values]}\n tickFormat={(value: unknown) => format(value as number | Date)}\n hideAxisLine\n hideTicks\n tickLabelProps={tickLabelProps}\n />\n );\n}\n\n/** The ghost wash under the hovered bucket's column. */\nfunction HoverWash({ data, layout, hasConnectedLines }: LayerProps) {\n const { xScale } = useContext(DataContext);\n const index = useHoveredIndex(data, xScale, hasConnectedLines);\n if (index == null || xScale == null) return null;\n const cx = xPositioner(xScale)(toTime(data[index]!.x));\n const step = stepOf(xScale);\n if (cx == null) return null;\n return (\n <rect\n data-hover-wash=\"\"\n x={cx - step / 2}\n y={layout.top}\n width={step}\n height={layout.innerHeight}\n fill={WASH}\n />\n );\n}\n\n/** The bars' baseline, a touch stronger than the grid so they stand on something. */\nfunction ZeroLine({ layout }: { layout: ChartLayout }) {\n const { yScale } = useContext(DataContext);\n const y = yScale ? yPositioner(yScale)(0) : undefined;\n if (y == null) return null;\n return (\n <line\n data-zero=\"\"\n x1={layout.left}\n x2={layout.right}\n y1={y}\n y2={y}\n stroke={CROSSHAIR}\n />\n );\n}\n\n/** The crosshair on a line chart, and a surface-ringed point per line at the hovered bucket. */\nfunction HoverMarks({\n data,\n layout,\n lines,\n crosshair,\n hasConnectedLines,\n}: LayerProps & {\n lines: ReadonlyArray<{ dataKey: string; color: string }>;\n crosshair: boolean;\n}) {\n const { xScale, yScale } = useContext(DataContext);\n const index = useHoveredIndex(data, xScale, hasConnectedLines);\n if (index == null || xScale == null || yScale == null) return null;\n const datum = data[index]!;\n const cx = xPositioner(xScale)(toTime(datum.x));\n if (cx == null) return null;\n const y = yPositioner(yScale);\n return (\n <g data-hover=\"\">\n {crosshair && (\n <line\n x1={cx}\n x2={cx}\n y1={layout.top}\n y2={layout.bottom}\n stroke={CROSSHAIR}\n />\n )}\n {lines.length > 0 && (\n <g data-points=\"\">\n {lines.map((line) => {\n const value = readValue(datum, line.dataKey);\n const cy = value == null ? undefined : y(value);\n if (cy == null) return null;\n return (\n <circle\n key={line.dataKey}\n cx={cx}\n cy={cy}\n r={POINT_RADIUS}\n fill={line.color}\n // The surface ring keeps a dot legible where lines cross.\n stroke={SURFACE}\n strokeWidth={2}\n />\n );\n })}\n </g>\n )}\n </g>\n );\n}\n\ninterface LoneLine {\n dataKey: string;\n color: string;\n /** The readings with nothing either side of them. */\n points: ReadonlyArray<{ x: Date | number; value: number }>;\n}\n\n/**\n * The dots under readings no line reaches. visx rounds a line's cap so a\n * datum between two holes is visible at all, but at 2px that is a speck,\n * and a `gaps=\"connect\"` series with one bucket in the window is nothing\n * else. Those readings get a real dot instead — the hovered point's\n * surface ring, so they stay legible where series cross, one step under\n * its radius so hover is still the emphasis. The ring paints under the\n * fill: centred on the edge it would cover the outer third of a dot this\n * small, and a 6px reading would arrive as 4.\n */\nfunction LoneMarks({ lines }: { lines: ReadonlyArray<LoneLine> }) {\n const { xScale, yScale } = useContext(DataContext);\n if (lines.length === 0 || xScale == null || yScale == null) return null;\n const x = xPositioner(xScale);\n const y = yPositioner(yScale);\n return (\n <g data-lone-points=\"\">\n {lines.map((line) =>\n line.points.map((point, i) => {\n const cx = x(toTime(point.x));\n const cy = y(point.value);\n if (cx == null || cy == null) return null;\n return (\n <circle\n key={`${line.dataKey} ${i}`}\n cx={cx}\n cy={cy}\n r={LONE_RADIUS}\n fill={line.color}\n stroke={SURFACE}\n strokeWidth={2}\n paintOrder=\"stroke\"\n />\n );\n }),\n )}\n </g>\n );\n}\n\n/**\n * The marks' arrival, on `SPRING_ENTRANCE` and `FADE_ENTRANCE` like a\n * `Reveal`. A chart that mounts with data rises from its base (scaleY\n * from 0 at the bottom of what it draws). Data that follows an empty\n * plot — the bones, or a cleared range — slides in from the left by the\n * reveal's own distance, the arrival turned along the time axis. From\n * there a change follows what the range did: a wider span opens outward\n * (scaleX from `SPAN_SCALE` about the middle), a narrower one closes\n * inward (from its inverse, clipped to the plot so nothing crosses the\n * axes), the same span slides in again. A refetch that lands mid-flight\n * restarts it. The layout effect sets the first frame before paint, so\n * new marks never flash at full size first. Static under reduced motion.\n */\nfunction Rise({\n data,\n range,\n layout,\n children,\n}: {\n data: ReadonlyArray<unknown>;\n /** The span of time the data covers, in ms; 0 with no data. */\n range: number;\n layout: ChartLayout;\n children: ReactNode;\n}) {\n const reduceMotion = useReducedMotion();\n const [scope, animate] = useAnimate<SVGGElement>();\n const clipId = useId();\n // The span last shown, 0 for an empty plot; nothing before the mount.\n const shown = useRef<number | null>(null);\n useIsomorphicLayoutEffect(() => {\n const node = scope.current;\n const previous = shown.current;\n shown.current = range;\n if (data.length === 0 || reduceMotion || node == null) return;\n const fade = { opacity: FADE_ENTRANCE };\n const controls =\n previous == null\n ? animate(\n node,\n { scaleY: [0, 1], scaleX: 1, x: 0, opacity: [0, 1], originY: 1 },\n { scaleY: SPRING_ENTRANCE, ...fade },\n )\n : previous === 0 || range === previous\n ? animate(\n node,\n { x: [-RISE_PX, 0], scaleX: 1, scaleY: 1, opacity: [0, 1] },\n { x: SPRING_ENTRANCE, ...fade },\n )\n : animate(\n node,\n {\n scaleX: [range > previous ? SPAN_SCALE : 1 / SPAN_SCALE, 1],\n scaleY: 1,\n x: 0,\n opacity: [0, 1],\n originX: 0.5,\n },\n { scaleX: SPRING_ENTRANCE, ...fade },\n );\n return () => controls.stop();\n }, [data, range, reduceMotion]);\n // A breath of room so a stroke on the plot's edge is never shaved.\n const pad = 4;\n return (\n <g clipPath={`url(#${clipId})`}>\n <defs>\n <clipPath id={clipId}>\n <rect\n x={layout.left - pad}\n y={layout.top - pad}\n width={layout.innerWidth + 2 * pad}\n height={layout.innerHeight + 2 * pad}\n />\n </clipPath>\n </defs>\n <g ref={scope} data-marks=\"\">\n {children}\n </g>\n </g>\n );\n}\n\n/**\n * The rounded tops of a stack. visx rounds a whole series, not the\n * segment that happens to be on top in a bucket, so a stack draws every\n * segment square and is clipped instead: one rect per bucket, the bar's\n * own band (`xScale(x)`, `bandwidth()`) from the top of its positive\n * total down past the plot's bottom, its corners rounded. Only the top\n * two land on the plot, so the column's data end is rounded whichever\n * series is on top there, and its baseline end stays square.\n *\n * Each segment wears a 2px stroke in the surface colour, half of it over\n * the segment's own edge, so the colour starts 1px inside the geometry.\n * The clip is inset by that pixel on the top and the sides: its 4px\n * corners then land on the colour itself (at the geometry they would\n * round only the stroke, and the colour would stay all but square), and\n * no surface-coloured rim is left outside the column.\n *\n * The positive total is summed in part order, a hole as zero, exactly as\n * d3's stack (and visx's diverging offset, once any value is negative)\n * accumulates it, so the clip's edge is the top segment's own y. A\n * bucket with nothing above zero gets a square rect from the baseline\n * down: it rounds nothing, and its negative segments, if any, still show\n * square at both ends. The radius is clamped to half the visible\n * column's width and height, as visx clamps a rounded bar.\n *\n * The clip lives inside the marks group, so it rides the arrival's\n * transforms with the bars and never cuts one mid-flight. The bars stay\n * mounted while visx registers them: before the scales exist the clip is\n * simply empty, and so is the plot.\n */\nfunction StackClip({\n data,\n keys,\n children,\n}: {\n data: ReadonlyArray<ChartDatum>;\n keys: ReadonlyArray<string>;\n children: ReactNode;\n}) {\n const { xScale, yScale } = useContext(DataContext);\n const clipId = useId();\n const columns: ReactNode[] = [];\n const s = xScale as\n | (((v: number) => number | undefined) & { bandwidth?: () => number })\n | undefined;\n const y = yScale as\n | (((v: number) => number | undefined) & { range: () => number[] })\n | undefined;\n if (s != null && y != null && typeof s.bandwidth === \"function\") {\n const width = Math.max(0, s.bandwidth() - 2 * SEGMENT_INSET);\n const zero = y(0);\n // Past the plot's bottom by a corner and the segment stroke, so the\n // lower corners never reach anything drawn.\n const floor = Math.max(...y.range()) + 2 * RADIUS + 2;\n for (const [index, d] of data.entries()) {\n const x = s(toTime(d.x));\n let total = 0;\n for (const key of keys) {\n const value = readValue(d, key) ?? 0;\n if (value >= 0) total += value;\n }\n const end = total > 0 ? y(total) : zero;\n if (x == null || end == null || zero == null) continue;\n if (!Number.isFinite(x) || !Number.isFinite(end)) continue;\n const top = total > 0 ? end + SEGMENT_INSET : end;\n const corner =\n total > 0\n ? Math.max(0, Math.min(RADIUS, width / 2, (zero - top) / 2))\n : 0;\n columns.push(\n <rect\n key={index}\n data-stack-top={index}\n x={x + SEGMENT_INSET}\n y={top}\n width={width}\n height={Math.max(0, floor - top)}\n rx={corner}\n ry={corner}\n />,\n );\n }\n }\n return (\n <g data-stack-clip=\"\">\n <defs>\n <clipPath id={clipId}>{columns}</clipPath>\n </defs>\n <g clipPath={`url(#${clipId})`}>{children}</g>\n </g>\n );\n}\n\n/** The readout beside the hovered bucket: finite part values, then the breakdown. */\nfunction HoverTooltip({\n data,\n layout,\n parts,\n colors,\n width,\n headingFormat,\n valueFormat,\n breakdownTitle,\n emptyBucket,\n hasConnectedLines,\n}: LayerProps & {\n parts: ReadonlyArray<Part>;\n colors: ReadonlyArray<string>;\n width: number;\n headingFormat: (date: Date) => string;\n valueFormat: (value: number) => string;\n breakdownTitle?: ReactNode;\n emptyBucket?: ReactNode;\n}) {\n const { xScale } = useContext(DataContext);\n const index = useHoveredIndex(data, xScale, hasConnectedLines);\n if (index == null || xScale == null) return null;\n const datum = data[index]!;\n const x = xPositioner(xScale)(toTime(datum.x));\n if (x == null) return null;\n return (\n <ChartTooltip\n x={x}\n width={width}\n top={layout.top}\n heading={headingFormat(new Date(datum.x))}\n rows={parts.flatMap<ChartTooltipRow>((part, i) => {\n const value = readValue(datum, part.dataKey);\n return value == null\n ? []\n : [\n {\n label: part.label,\n value: valueFormat(value),\n color: colors[i]!,\n kind: part.kind === \"bar\" ? \"rect\" : \"line\",\n dashed: part.dashed,\n },\n ];\n })}\n breakdown={datum.breakdown}\n breakdownTitle={breakdownTitle}\n valueFormat={valueFormat}\n empty={emptyBucket}\n />\n );\n}\n\n/* ---------------------------------- root ---------------------------------- */\n\n// visx wraps a left label to the margin's width; the margin is sized to\n// the labels here, so a label never wraps.\nconst LEFT_TICK_LABEL = {\n dx: \"-0.35em\",\n dy: \"0.35em\",\n width: undefined,\n} as const;\n\nexport function Chart<T extends ChartDatum>({\n data,\n children,\n label,\n description,\n height = 200,\n width: fixedWidth,\n valueFormat,\n timeFormat,\n locale,\n legend,\n baseline = \"zero\",\n stacked = false,\n breakdownTitle,\n loading,\n empty = \"Nothing here yet.\",\n emptyBucket,\n className,\n ...props\n}: ChartProps<T>) {\n const [containerRef, width] = useMeasuredWidth<HTMLDivElement>(fixedWidth);\n const parts = useMemo(() => collectParts(children), [children]);\n\n const model = useMemo(() => {\n const times = data.map((d) => toTime(d.x));\n const span = bucketSpan(times);\n const axisFormat = valueFormat ?? numberFormatter(locale, true);\n const fullFormat = valueFormat ?? numberFormatter(locale);\n const headingFormat = timeFormat ?? bucketTimeFormatter(locale, span);\n const colors = parts.map((part, index) => chartColor(part.color, index));\n const bars = parts.filter((part) => part.kind === \"bar\");\n const lines = parts\n .map((part, index) => ({ ...part, color: colors[index]! }))\n .filter((part) => part.kind === \"line\");\n let min = Infinity;\n let max = -Infinity;\n const consider = (value: number) => {\n if (value < min) min = value;\n if (value > max) max = value;\n };\n if (stacked && bars.length > 1) {\n for (const d of data) {\n let positive = 0;\n let negative = 0;\n for (const bar of bars) {\n const value = readValue(d, bar.dataKey);\n if (value == null) continue;\n if (value > 0) positive += value;\n else negative += value;\n }\n consider(positive);\n consider(negative);\n }\n } else {\n for (const bar of bars) {\n for (const d of data) {\n const value = readValue(d, bar.dataKey);\n if (value != null) consider(value);\n }\n }\n }\n for (const line of lines) {\n for (const d of data) {\n const value = readValue(d, line.dataKey);\n if (value != null) consider(value);\n }\n }\n if (min === Infinity) {\n min = 0;\n max = 0;\n }\n // Columns rise from zero, so a chart with bars always keeps it.\n if (baseline === \"zero\" || bars.length > 0) {\n min = Math.min(0, min);\n max = Math.max(0, max);\n }\n const y = niceLinearDomain(min, max);\n return {\n times,\n span,\n colors,\n bars,\n lines,\n hasBars: bars.length > 0,\n axisFormat,\n fullFormat,\n headingFormat,\n y,\n yLabels: y.ticks.map(axisFormat),\n described:\n description ??\n describeChart({\n data,\n series: parts.map((part) => ({\n key: part.dataKey,\n label: part.label,\n kind: part.kind,\n })),\n valueFormat: fullFormat,\n timeFormat: headingFormat,\n }),\n };\n }, [\n data,\n parts,\n stacked,\n baseline,\n valueFormat,\n timeFormat,\n locale,\n description,\n ]);\n\n const n = data.length;\n const t0 = model.times[0] ?? 0;\n const t1 = model.times[n - 1] ?? 0;\n // The span the buckets cover: their spread plus the last bucket itself.\n const range = n > 0 ? t1 - t0 + model.span : 0;\n const layout = useMemo(\n () => chartLayout(width, height, model.yLabels),\n [width, height, model.yLabels],\n );\n const band = useMemo(\n () => bandLayout(layout.innerWidth, n, model.bars.length, stacked),\n [layout.innerWidth, n, model.bars.length, stacked],\n );\n\n // Bars need a band; lines alone run edge to edge on time.\n const xScale = useMemo(\n () =>\n model.hasBars\n ? {\n type: \"band\" as const,\n domain: model.times,\n paddingInner: band.paddingInner,\n paddingOuter: band.paddingOuter,\n }\n : {\n type: \"time\" as const,\n domain: t1 > t0 ? [t0, t1] : [t0 - 1, t0 + 1],\n },\n [model.hasBars, model.times, band.paddingInner, band.paddingOuter, t0, t1],\n );\n const yScale = useMemo(\n () => ({\n type: \"linear\" as const,\n domain: model.y.domain,\n zero: false,\n nice: false,\n }),\n [model.y.domain],\n );\n const theme = useMemo(() => buildPhoTheme(model.colors), [model.colors]);\n\n const xTicks = useMemo(() => {\n const format = timeTickFormatter(locale);\n if (n === 0 || layout.innerWidth <= 0) {\n return { values: [] as Array<number | Date>, format: () => \"\" };\n }\n const ticks = thinTicks(\n timeAxisTicks(t0, t1, layout.innerWidth),\n format,\n layout.innerWidth,\n );\n if (!model.hasBars) {\n return {\n values: ticks as Array<number | Date>,\n format: (value: number | Date) => format(new Date(value)),\n };\n }\n // A band takes only its own values: each round tick lands on the\n // nearest bucket, and keeps the round time as its label.\n const labels = new Map<number, string>();\n for (const tick of ticks) {\n const at = model.times[nearestIndex(model.times, tick.getTime())]!;\n if (!labels.has(at)) labels.set(at, format(tick));\n }\n return {\n values: [...labels.keys()] as Array<number | Date>,\n format: (value: number | Date) =>\n labels.get(toTime(value)) ?? format(new Date(value)),\n };\n }, [n, t0, t1, layout.innerWidth, locale, model.hasBars, model.times]);\n\n const showLegend = legend ?? parts.length > 1;\n const showEmpty = n === 0 && !loading;\n // Bones only when there is no last render to hold.\n const showSkeleton = n === 0 && loading === true;\n const zeroAtEdge = model.y.domain[0] >= 0 || model.y.domain[1] <= 0;\n const series = data as T[];\n // A connecting line is handed only the buckets it has a value for, so\n // the path runs straight across the holes; hover and the tooltip keep\n // the full data, and land on a hole like any other bucket.\n const lineData = useMemo(() => {\n const out = new Map<string, T[]>();\n for (const line of model.lines) {\n if (line.gaps === \"connect\") {\n out.set(\n line.dataKey,\n series.filter((d) => readValue(d, line.dataKey) != null),\n );\n }\n }\n return out;\n }, [model.lines, series]);\n const hasConnectedLines = lineData.size > 0;\n\n const barMarks = (() => {\n const { bars } = model;\n if (bars.length === 0) return null;\n // A stack's segments are square; `StackClip` rounds each column's top.\n const rounded = !stacked || bars.length === 1;\n const marks = bars.map((bar) => {\n const color = model.colors[parts.indexOf(bar)]!;\n return (\n <BarSeries\n key={bar.dataKey}\n dataKey={bar.dataKey}\n data={series}\n xAccessor={xAccessor}\n yAccessor={barAccessor(bar.dataKey)}\n colorAccessor={fillAccessor(bar.dataKey, color)}\n radius={rounded ? RADIUS : undefined}\n radiusTop={rounded}\n data-series={bar.dataKey}\n />\n );\n });\n if (bars.length === 1) return marks;\n return stacked ? (\n <StackClip data={series} keys={bars.map((bar) => bar.dataKey)}>\n <BarStack>{marks}</BarStack>\n </StackClip>\n ) : (\n <BarGroup padding={band.groupPadding}>{marks}</BarGroup>\n );\n })();\n\n const lineMarks = model.lines.map((line) => {\n const curve = line.curve === \"monotone\" ? curveMonotoneX : curveLinear;\n const dash = line.dashed ? \"4 4\" : undefined;\n const points = lineData.get(line.dataKey) ?? series;\n return line.area ? (\n <AreaSeries\n key={line.dataKey}\n dataKey={line.dataKey}\n data={points}\n xAccessor={xAccessor}\n yAccessor={lineAccessor(line.dataKey)}\n curve={curve}\n fill={line.color}\n fillOpacity={0.1}\n lineProps={{\n stroke: line.color,\n strokeWidth: LINE_WIDTH,\n strokeLinejoin: \"round\",\n strokeDasharray: dash,\n }}\n data-series={line.dataKey}\n />\n ) : (\n <LineSeries\n key={line.dataKey}\n dataKey={line.dataKey}\n data={points}\n xAccessor={xAccessor}\n yAccessor={lineAccessor(line.dataKey)}\n curve={curve}\n stroke={line.color}\n strokeWidth={LINE_WIDTH}\n strokeLinejoin=\"round\"\n strokeDasharray={dash}\n data-series={line.dataKey}\n />\n );\n });\n\n // Which readings stand alone, over the very array the line is drawn\n // from: a value with nothing either side of it. With `gaps=\"connect\"`\n // that array is already filtered, so a series with one bucket in the\n // window is the whole of it.\n const loneLines = model.lines.flatMap<LoneLine>((line) => {\n const points = lineData.get(line.dataKey) ?? series;\n const lone = points.flatMap((d, i) => {\n const value = readValue(d, line.dataKey);\n const before = points[i - 1];\n const after = points[i + 1];\n return value == null ||\n (before != null && readValue(before, line.dataKey) != null) ||\n (after != null && readValue(after, line.dataKey) != null)\n ? []\n : [{ x: d.x, value }];\n });\n return lone.length === 0\n ? []\n : [{ dataKey: line.dataKey, color: line.color, points: lone }];\n });\n\n return (\n <ChartShell\n label={label}\n description={model.described}\n height={height}\n containerRef={containerRef}\n loading={loading}\n empty={empty}\n showEmpty={showEmpty}\n placeholder={showSkeleton ? <ChartSkeleton layout={layout} /> : null}\n className={className}\n legend={\n showLegend ? (\n <ChartLegend\n items={parts.map((part, index) => ({\n label: part.label,\n color: model.colors[index]!,\n kind: part.kind === \"bar\" ? \"rect\" : \"line\",\n dashed: part.dashed,\n }))}\n />\n ) : null\n }\n {...props}\n >\n {width > 0 && !showEmpty && (\n <DataProvider\n xScale={xScale}\n yScale={yScale}\n theme={theme}\n initialDimensions={{ width, height, margin: layout.margin }}\n >\n <TooltipProvider hideTooltipDebounceMs={0}>\n <XYChart\n width={width}\n height={height}\n margin={layout.margin}\n accessibilityLabel={label}\n >\n <Registered>\n <Grid rows columns={false} numTicks={model.y.count} />\n </Registered>\n <Axis\n orientation=\"left\"\n tickValues={model.y.ticks}\n tickFormat={(value: unknown) => model.axisFormat(Number(value))}\n hideAxisLine\n hideTicks\n tickLabelProps={LEFT_TICK_LABEL}\n />\n <BottomAxis\n values={xTicks.values}\n format={xTicks.format}\n layout={layout}\n />\n {model.hasBars && (\n <HoverWash\n data={data}\n layout={layout}\n hasConnectedLines={hasConnectedLines}\n />\n )}\n <Rise data={data} range={range} layout={layout}>\n {barMarks}\n {lineMarks}\n <Registered>\n <LoneMarks lines={loneLines} />\n </Registered>\n </Rise>\n {model.hasBars && zeroAtEdge && (\n <Registered>\n <ZeroLine layout={layout} />\n </Registered>\n )}\n <HoverMarks\n data={data}\n layout={layout}\n lines={model.lines}\n crosshair={!model.hasBars}\n hasConnectedLines={hasConnectedLines}\n />\n </XYChart>\n <HoverTooltip\n data={data}\n layout={layout}\n parts={parts}\n colors={model.colors}\n width={width}\n headingFormat={model.headingFormat}\n valueFormat={model.fullFormat}\n breakdownTitle={breakdownTitle}\n emptyBucket={emptyBucket}\n hasConnectedLines={hasConnectedLines}\n />\n </TooltipProvider>\n </DataProvider>\n )}\n </ChartShell>\n );\n}\n\nChart.displayName = \"Chart\";\nChart.Bar = ChartBar;\nChart.Line = ChartLine;\n"],"x_google_ignoreList":[0,1,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19],"mappings":";;;;;;;;AAAA,SAAS,GAAO,GAAS;AACvB,OAAK,WAAW;AAClB;AAEA,GAAO,YAAY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YACpB,CAAA;AAAA,YAEH,gBAAA,EAAC,IAAD;AAAA,cAAY,MAAA;AAAA,cAAa,OAAA;AAAA,cAAe,QAAA;AAAA,cAAxC,UAAA;AAAA,gBACG;AAAA,gBACA;AAAA,gBACD,gBAAA,EAAC,IAAD,EAAA,UACE,gBAAA,EAAC,IAAD,EAAW,OAAO,GAAY,CAAA,EACpB,CAAA;AAAA,cACR;AAAA;YACL,EAAM,WAAW,MAChB,gBAAA,EAAC,IAAD,EAAA,UACE,gBAAA,EAAC,IAAD,EAAkB,QAAA,EAAS,CAAA,EACjB,CAAA;AAAA,YAEd,gBAAA,EAAC,IAAD;AAAA,cACQ,MAAA;AAAA,cACE,QAAA;AAAA,cACR,OAAO,EAAM;AAAA,cACb,WAAW,CAAC,EAAM;AAAA,cACC,mBAAA;AAAA,YACpB,CAAA;AAAA,UACM;AAAA,QACT,CAAA,GAAA,gBAAA,EAAC,IAAD;AAAA,UACQ,MAAA;AAAA,UACE,QAAA;AAAA,UACD,OAAA;AAAA,UACP,QAAQ,EAAM;AAAA,UACP,OAAA;AAAA,UACP,eAAe,EAAM;AAAA,UACrB,aAAa,EAAM;AAAA,UACH,gBAAA;AAAA,UACH,aAAA;AAAA,UACM,mBAAA;AAAA,QACpB,CAAA,CACc;AAAA;IACL,CAAA;AAAA,EAEN,CAAA;AAEhB;AAEA,GAAM,cAAc;AACpB,GAAM,MAAM;AACZ,GAAM,OAAO"}
@@ -4,7 +4,7 @@ import { a as de } from "./button-C9VqBBIr.js";
4
4
  import { t as z } from "./createReactComponent-BqCmnqfX.js";
5
5
  import { t as me } from "./IconChevronDown-CZilB71T.js";
6
6
  import { t as he } from "./IconChevronUp-CrpWSgIl.js";
7
- import { n as fe } from "./copy-button-D8XyP0oR.js";
7
+ import { n as fe } from "./copy-button-CHYc_cvM.js";
8
8
  import { t as d } from "./scroll-area-DSwD9th7.js";
9
9
  import { n as ye } from "./toggle-o84tawXy.js";
10
10
  import { t as g } from "./tooltip-BTF7GChl.js";
@@ -513,4 +513,4 @@ export {
513
513
  K as u
514
514
  };
515
515
 
516
- //# sourceMappingURL=code-block-CbcE994O.js.map
516
+ //# sourceMappingURL=code-block-DMiZkEWS.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"code-block-CbcE994O.js","names":["__iconNode","__iconNode"],"sources":["../../../../node_modules/.pnpm/@tabler+icons-react@3.46.0_react@19.2.8/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowsMaximize.mjs","../../../../node_modules/.pnpm/@tabler+icons-react@3.46.0_react@19.2.8/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowsMinimize.mjs","../../../../node_modules/.pnpm/@tabler+icons-react@3.46.0_react@19.2.8/node_modules/@tabler/icons-react/dist/esm/icons/IconTextWrap.mjs","../../src/components/code-block/languages.ts","../../src/components/code-block/tokens.ts","../../src/components/code-block/pho-theme.ts","../../src/components/code-block/highlight.ts","../../src/components/code-block/tokenize-json.ts","../../src/components/code-block/code-block.tsx"],"sourcesContent":["/**\n * @license @tabler/icons-react v3.46.0 - MIT\n *\n * This source code is licensed under the MIT license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createReactComponent from '../createReactComponent.mjs';\n\nconst __iconNode = [[\"path\", { \"d\": \"M16 4l4 0l0 4\", \"key\": \"svg-0\" }], [\"path\", { \"d\": \"M14 10l6 -6\", \"key\": \"svg-1\" }], [\"path\", { \"d\": \"M8 20l-4 0l0 -4\", \"key\": \"svg-2\" }], [\"path\", { \"d\": \"M4 20l6 -6\", \"key\": \"svg-3\" }], [\"path\", { \"d\": \"M16 20l4 0l0 -4\", \"key\": \"svg-4\" }], [\"path\", { \"d\": \"M14 14l6 6\", \"key\": \"svg-5\" }], [\"path\", { \"d\": \"M8 4l-4 0l0 4\", \"key\": \"svg-6\" }], [\"path\", { \"d\": \"M4 4l6 6\", \"key\": \"svg-7\" }]];\nconst IconArrowsMaximize = createReactComponent(\"outline\", \"arrows-maximize\", \"ArrowsMaximize\", __iconNode);\n\nexport { __iconNode, IconArrowsMaximize as default };\n//# sourceMappingURL=IconArrowsMaximize.mjs.map\n","/**\n * @license @tabler/icons-react v3.46.0 - MIT\n *\n * This source code is licensed under the MIT license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createReactComponent from '../createReactComponent.mjs';\n\nconst __iconNode = [[\"path\", { \"d\": \"M5 9l4 0l0 -4\", \"key\": \"svg-0\" }], [\"path\", { \"d\": \"M3 3l6 6\", \"key\": \"svg-1\" }], [\"path\", { \"d\": \"M5 15l4 0l0 4\", \"key\": \"svg-2\" }], [\"path\", { \"d\": \"M3 21l6 -6\", \"key\": \"svg-3\" }], [\"path\", { \"d\": \"M19 9l-4 0l0 -4\", \"key\": \"svg-4\" }], [\"path\", { \"d\": \"M15 9l6 -6\", \"key\": \"svg-5\" }], [\"path\", { \"d\": \"M19 15l-4 0l0 4\", \"key\": \"svg-6\" }], [\"path\", { \"d\": \"M15 15l6 6\", \"key\": \"svg-7\" }]];\nconst IconArrowsMinimize = createReactComponent(\"outline\", \"arrows-minimize\", \"ArrowsMinimize\", __iconNode);\n\nexport { __iconNode, IconArrowsMinimize as default };\n//# sourceMappingURL=IconArrowsMinimize.mjs.map\n","/**\n * @license @tabler/icons-react v3.46.0 - MIT\n *\n * This source code is licensed under the MIT license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createReactComponent from '../createReactComponent.mjs';\n\nconst __iconNode = [[\"path\", { \"d\": \"M4 6l16 0\", \"key\": \"svg-0\" }], [\"path\", { \"d\": \"M4 18l5 0\", \"key\": \"svg-1\" }], [\"path\", { \"d\": \"M4 12h13a3 3 0 0 1 0 6h-4l2 -2m0 4l-2 -2\", \"key\": \"svg-2\" }]];\nconst IconTextWrap = createReactComponent(\"outline\", \"text-wrap\", \"TextWrap\", __iconNode);\n\nexport { __iconNode, IconTextWrap as default };\n//# sourceMappingURL=IconTextWrap.mjs.map\n","import type { LanguageRegistration } from \"shiki/core\";\n\n/**\n * The languages a code panel can color, each a grammar fetched on first\n * use — a page that shows JSON never downloads the TypeScript grammar.\n * Keyed by the name Shiki knows the grammar by; `LANGUAGE_ALIASES` lets a\n * panel say `ts` or `sh`.\n */\nexport const CODE_GRAMMARS = {\n json: () => import(\"@shikijs/langs/json\"),\n jsonc: () => import(\"@shikijs/langs/jsonc\"),\n javascript: () => import(\"@shikijs/langs/javascript\"),\n typescript: () => import(\"@shikijs/langs/typescript\"),\n jsx: () => import(\"@shikijs/langs/jsx\"),\n tsx: () => import(\"@shikijs/langs/tsx\"),\n shellscript: () => import(\"@shikijs/langs/shellscript\"),\n python: () => import(\"@shikijs/langs/python\"),\n swift: () => import(\"@shikijs/langs/swift\"),\n go: () => import(\"@shikijs/langs/go\"),\n ruby: () => import(\"@shikijs/langs/ruby\"),\n php: () => import(\"@shikijs/langs/php\"),\n java: () => import(\"@shikijs/langs/java\"),\n kotlin: () => import(\"@shikijs/langs/kotlin\"),\n csharp: () => import(\"@shikijs/langs/csharp\"),\n rust: () => import(\"@shikijs/langs/rust\"),\n html: () => import(\"@shikijs/langs/html\"),\n css: () => import(\"@shikijs/langs/css\"),\n xml: () => import(\"@shikijs/langs/xml\"),\n yaml: () => import(\"@shikijs/langs/yaml\"),\n toml: () => import(\"@shikijs/langs/toml\"),\n dotenv: () => import(\"@shikijs/langs/dotenv\"),\n sql: () => import(\"@shikijs/langs/sql\"),\n graphql: () => import(\"@shikijs/langs/graphql\"),\n http: () => import(\"@shikijs/langs/http\"),\n markdown: () => import(\"@shikijs/langs/markdown\"),\n diff: () => import(\"@shikijs/langs/diff\"),\n} satisfies Record<string, () => Promise<{ default: LanguageRegistration[] }>>;\n\nexport type CodeGrammar = keyof typeof CODE_GRAMMARS;\n\n/** Shorter names, and the ones people reach for first. */\nexport const LANGUAGE_ALIASES = {\n js: \"javascript\",\n ts: \"typescript\",\n bash: \"shellscript\",\n sh: \"shellscript\",\n shell: \"shellscript\",\n zsh: \"shellscript\",\n py: \"python\",\n rb: \"ruby\",\n kt: \"kotlin\",\n cs: \"csharp\",\n rs: \"rust\",\n yml: \"yaml\",\n md: \"markdown\",\n htm: \"html\",\n} as const satisfies Record<string, CodeGrammar>;\n\nexport type CodeLanguageAlias = keyof typeof LANGUAGE_ALIASES;\n\n/**\n * What `language` accepts: a grammar, an alias, or `text` for none. Plain\n * text is the default — a panel colors only what it is told the shape of.\n */\nexport type CodeBlockLanguage = \"text\" | CodeGrammar | CodeLanguageAlias;\n\n/**\n * The grammar behind a `language`, or `null` for plain text and names the\n * panel does not know (which read as text instead of throwing).\n */\nexport function resolveGrammar(language: string): CodeGrammar | null {\n // Own keys only: `in` would take \"toString\" for a grammar.\n if (Object.hasOwn(LANGUAGE_ALIASES, language)) {\n return LANGUAGE_ALIASES[language as CodeLanguageAlias];\n }\n return Object.hasOwn(CODE_GRAMMARS, language)\n ? (language as CodeGrammar)\n : null;\n}\n","/**\n * The token vocabulary a code panel colors with — one class per kind, on\n * the `--color-pho-code-*` tokens, which carry light and dark. The JSON\n * tokenizer speaks the first five; Shiki's grammars reach the rest.\n */\n\nexport type CodeTokenType =\n | \"key\"\n | \"string\"\n | \"number\"\n | \"keyword\"\n | \"punctuation\"\n | \"comment\"\n | \"function\"\n | \"type\"\n | \"plain\";\n\nexport interface CodeToken {\n type: CodeTokenType;\n text: string;\n}\n\n/** One line of a highlighted body. */\nexport type CodeLine = CodeToken[];\n\n/** The class a token kind wears; `plain` wears the panel's own ink. */\nexport const CODE_TOKEN_CLASS: Record<CodeTokenType, string | undefined> = {\n key: \"text-pho-code-key\",\n string: \"text-pho-code-string\",\n number: \"text-pho-code-number\",\n keyword: \"text-pho-code-keyword\",\n punctuation: \"text-pho-code-punctuation\",\n comment: \"text-pho-code-comment\",\n function: \"text-pho-code-function\",\n type: \"text-pho-code-type\",\n plain: undefined,\n};\n","import type { ThemeRegistrationRaw } from \"shiki/core\";\nimport { CODE_TOKEN_CLASS, type CodeTokenType } from \"./tokens\";\n\n/**\n * Pho's Shiki theme — not a palette but a routing table. Every TextMate\n * scope resolves to one of the panel's token kinds, and each kind's\n * \"color\" is the design token's own variable, so the theme has no light\n * and dark of its own: the `--color-pho-code-*` tokens carry both, and\n * the renderer turns each color back into the kind's class. Only the\n * kinds a body needs to read — keys, strings, numbers, keywords,\n * punctuation, comments, calls, types. Operators, variables, and\n * everything else stay in the panel's ink.\n */\n\nexport const PHO_THEME_NAME = \"pho\";\n\n/** The color a token kind \"has\" in the theme: its token's variable. */\nexport function tokenColor(type: Exclude<CodeTokenType, \"plain\">): string {\n return `var(--color-pho-code-${type})`;\n}\n\n/** The token kind behind a Shiki color, or `plain` for the panel's ink. */\nexport function tokenTypeOf(color: string | undefined): CodeTokenType {\n const match = color?.match(/^var\\(--color-pho-code-([a-z]+)\\)$/);\n const kind = match?.[1];\n return kind != null && kind in CODE_TOKEN_CLASS && kind !== \"plain\"\n ? (kind as CodeTokenType)\n : \"plain\";\n}\n\nconst rule = (\n type: Exclude<CodeTokenType, \"plain\"> | \"plain\",\n scope: string[],\n) => ({\n scope,\n settings: {\n foreground:\n type === \"plain\" ? \"var(--color-pho-code-fg)\" : tokenColor(type),\n },\n});\n\nexport const phoTheme: ThemeRegistrationRaw = {\n name: PHO_THEME_NAME,\n type: \"light\",\n fg: \"var(--color-pho-code-fg)\",\n bg: \"var(--color-pho-code-bg)\",\n settings: [\n rule(\"comment\", [\"comment\", \"punctuation.definition.comment\"]),\n rule(\"string\", [\n \"string\",\n \"markup.inserted\",\n \"meta.diff.header.to-file\",\n \"punctuation.definition.inserted\",\n ]),\n // A template's `${…}` and any embedded code read as code again.\n rule(\"plain\", [\"meta.template.expression\", \"meta.embedded\"]),\n rule(\"key\", [\n \"support.type.property-name\",\n \"meta.object-literal.key\",\n \"entity.other.attribute-name\",\n \"entity.name.tag.yaml\",\n \"keyword.key.toml\",\n \"variable.other.env\",\n ]),\n rule(\"number\", [\n \"constant.numeric\",\n \"markup.deleted\",\n \"meta.diff.header.from-file\",\n \"punctuation.definition.deleted\",\n ]),\n rule(\"keyword\", [\n \"keyword\",\n \"storage\",\n \"constant.language\",\n \"variable.language\",\n ]),\n // Symbolic operators sit in the ink: `=`, `+`, `=>`, `&&` are shape,\n // not vocabulary. The word-shaped ones above stay keywords.\n rule(\"plain\", [\"keyword.operator\"]),\n rule(\"keyword\", [\n \"keyword.operator.expression\",\n \"keyword.operator.new\",\n \"keyword.operator.logical.python\",\n \"keyword.operator.wordlike\",\n ]),\n rule(\"function\", [\n \"entity.name.function\",\n \"support.function\",\n \"entity.name.command\",\n \"meta.function-call.generic\",\n ]),\n rule(\"type\", [\n \"entity.name.type\",\n \"entity.name.class\",\n \"entity.name.tag\",\n \"entity.other.inherited-class\",\n \"support.type\",\n \"support.class\",\n \"storage.type.primitive\",\n ]),\n // A property name is a key even though it is a `support.type`.\n rule(\"key\", [\"support.type.property-name\"]),\n rule(\"punctuation\", [\n \"punctuation.separator\",\n \"punctuation.terminator\",\n \"punctuation.accessor\",\n \"punctuation.section\",\n \"punctuation.definition.array\",\n \"punctuation.definition.dictionary\",\n \"punctuation.definition.block\",\n \"punctuation.definition.parameters\",\n \"punctuation.definition.arguments\",\n \"punctuation.definition.tag\",\n \"punctuation.definition.typeparameters\",\n \"meta.brace\",\n ]),\n ],\n};\n","import { useEffect, useSyncExternalStore } from \"react\";\nimport type { HighlighterCore, ThemedToken } from \"shiki/core\";\nimport { CODE_GRAMMARS, resolveGrammar, type CodeGrammar } from \"./languages\";\nimport { phoTheme, PHO_THEME_NAME, tokenTypeOf } from \"./pho-theme\";\nimport type { CodeLine } from \"./tokens\";\n\n/**\n * Highlighting, on Shiki — one highlighter for the whole app, made on\n * the first panel that asks and kept; grammars fetched on demand and\n * kept too. Bodies are tokenized once per (grammar, text) and remembered,\n * so a wrap toggle or a fold never re-runs a grammar.\n *\n * The result is lines of `CodeToken`s in the panel's own vocabulary\n * (`tokens.ts`), never Shiki's HTML: the panel keeps rendering its own\n * lines (the fold, `data-line`) and its own classes (the design tokens).\n *\n * Nothing here runs on the server. `useHighlight` reports `null` until a\n * body is highlighted, and a panel shows its synchronous face meanwhile —\n * plain text, or the JSON tokenizer's colors — so a page prerendered and\n * a page hydrated agree, and the colors settle in a frame later.\n */\n\nlet core: HighlighterCore | null = null;\nlet corePromise: Promise<HighlighterCore> | null = null;\nconst loadedGrammars = new Set<CodeGrammar>();\nconst loadingGrammars = new Map<CodeGrammar, Promise<void>>();\n\n/**\n * Shiki itself arrives with the first body that needs it — a page of\n * cards and rows never loads the engine — and stays for the rest.\n */\nfunction getCore(): Promise<HighlighterCore> {\n corePromise ??= Promise.all([\n import(\"shiki/core\"),\n import(\"shiki/engine/javascript\"),\n ])\n .then(([{ createHighlighterCore }, { createJavaScriptRegexEngine }]) =>\n createHighlighterCore({\n themes: [phoTheme],\n langs: [],\n // Shiki's JavaScript engine: no WebAssembly to fetch or allow, and\n // `forgiving` degrades a grammar's exotic pattern instead of\n // failing the whole body.\n engine: createJavaScriptRegexEngine({ forgiving: true }),\n }),\n )\n .then((highlighter) => {\n core = highlighter;\n return highlighter;\n });\n return corePromise;\n}\n\n/** Fetch a language's grammar ahead of the first body that needs it. */\nexport function preloadLanguage(language: string): Promise<void> {\n const grammar = resolveGrammar(language);\n if (grammar == null || loadedGrammars.has(grammar)) return Promise.resolve();\n let loading = loadingGrammars.get(grammar);\n if (loading == null) {\n loading = Promise.all([getCore(), CODE_GRAMMARS[grammar]()])\n .then(([highlighter, module]) =>\n highlighter.loadLanguage(...module.default),\n )\n .then(() => {\n loadedGrammars.add(grammar);\n })\n .finally(() => {\n loadingGrammars.delete(grammar);\n });\n loadingGrammars.set(grammar, loading);\n }\n return loading;\n}\n\n/** Whether `language` can be tokenized right now, without waiting. */\nexport function isLanguageReady(language: string): boolean {\n const grammar = resolveGrammar(language);\n return grammar != null && core != null && loadedGrammars.has(grammar);\n}\n\nfunction toLines(tokens: ThemedToken[][]): CodeLine[] {\n return tokens.map((line) => {\n const out: CodeLine = [];\n for (const token of line) {\n const type = tokenTypeOf(token.color);\n const last = out[out.length - 1];\n // Neighbors of one kind collapse into one span.\n if (last != null && last.type === type) last.text += token.content;\n else out.push({ type, text: token.content });\n }\n return out;\n });\n}\n\n/**\n * Tokenize a body with a grammar that is already loaded. `null` when the\n * language is plain text or its grammar is not here yet — see\n * `preloadLanguage` / `highlight`.\n */\nexport function highlightSync(\n code: string,\n language: string,\n): CodeLine[] | null {\n const grammar = resolveGrammar(language);\n if (grammar == null || core == null || !loadedGrammars.has(grammar)) {\n return null;\n }\n return toLines(\n core.codeToTokensBase(code, { lang: grammar, theme: PHO_THEME_NAME }),\n );\n}\n\n/** Plain lines — what a body reads as with no grammar. */\nexport function plainLines(code: string): CodeLine[] {\n return code.split(\"\\n\").map((text) => [{ type: \"plain\", text }]);\n}\n\n/**\n * Tokenize a body, fetching the highlighter and the grammar first if\n * need be. A language the panel does not know resolves to plain lines.\n */\nexport async function highlight(\n code: string,\n language: string,\n): Promise<CodeLine[]> {\n if (resolveGrammar(language) == null) return plainLines(code);\n await preloadLanguage(language);\n return highlightSync(code, language) ?? plainLines(code);\n}\n\n/* --------------------------------- store --------------------------------- */\n\n/** How many highlighted bodies to keep. A page's worth, several times. */\nconst CACHE_LIMIT = 200;\nconst cache = new Map<string, CodeLine[]>();\nconst listeners = new Set<() => void>();\n\nfunction remember(key: string, lines: CodeLine[]): CodeLine[] {\n const known = cache.get(key);\n if (known != null) return known;\n if (cache.size >= CACHE_LIMIT) {\n const oldest = cache.keys().next().value;\n if (oldest != null) cache.delete(oldest);\n }\n cache.set(key, lines);\n return lines;\n}\n\nfunction subscribe(listener: () => void) {\n listeners.add(listener);\n return () => {\n listeners.delete(listener);\n };\n}\n\nfunction notify() {\n for (const listener of listeners) listener();\n}\n\nfunction cacheKey(grammar: CodeGrammar, code: string) {\n return `${grammar}\u0000${code}`;\n}\n\n/**\n * The highlighted lines of a body, or `null` while its grammar is on the\n * way (and always for plain text). A grammar already here highlights in\n * the same render, no flash.\n */\nexport function useHighlight(\n code: string,\n language: string,\n): CodeLine[] | null {\n const grammar = resolveGrammar(language);\n const key = grammar != null ? cacheKey(grammar, code) : null;\n const lines = useSyncExternalStore(\n subscribe,\n () => {\n if (key == null) return null;\n const known = cache.get(key);\n if (known != null) return known;\n const now = highlightSync(code, language);\n return now != null ? remember(key, now) : null;\n },\n // Prerendered markup is the synchronous face; hydration agrees with it\n // and the colors settle in the render after.\n () => null,\n );\n useEffect(() => {\n if (key == null || cache.has(key)) return;\n // Remembered even if this panel is gone by then: the next one with the\n // same body reads it in its first render.\n highlight(code, language).then(\n (result) => {\n remember(key, result);\n notify();\n },\n () => {\n // A grammar that would not load: the panel keeps its plain face.\n },\n );\n }, [key, code, language]);\n return lines;\n}\n","/**\n * A tokenizer for JSON, and nothing else: keys, strings, numbers, the\n * three keywords, and punctuation. Runs one line at a time (a JSON\n * string never spans lines) so a panel can show its first N lines and\n * stop. Text that isn't JSON comes back as it is, in plain tokens.\n */\n\nexport type JsonTokenType =\n \"key\" | \"string\" | \"number\" | \"keyword\" | \"punctuation\" | \"plain\";\n\nexport interface JsonToken {\n type: JsonTokenType;\n text: string;\n}\n\n// One pass, left to right: a string (a key when a colon follows), a\n// number, a keyword, a bracket or a comma. Anything between is plain.\nconst TOKEN =\n /(\"(?:[^\"\\\\]|\\\\.)*\")(\\s*:)?|(-?\\d+(?:\\.\\d+)?(?:[eE][+-]?\\d+)?)|\\b(true|false|null)\\b|([{}[\\]:,])/g;\n\nexport function tokenizeJson(line: string): JsonToken[] {\n const tokens: JsonToken[] = [];\n let last = 0;\n TOKEN.lastIndex = 0;\n for (let match = TOKEN.exec(line); match != null; match = TOKEN.exec(line)) {\n if (match.index > last) {\n tokens.push({ type: \"plain\", text: line.slice(last, match.index) });\n }\n const [, string, colon, number, keyword, punctuation] = match;\n if (string != null) {\n tokens.push({ type: colon != null ? \"key\" : \"string\", text: string });\n if (colon != null) tokens.push({ type: \"punctuation\", text: colon });\n } else if (number != null) {\n tokens.push({ type: \"number\", text: number });\n } else if (keyword != null) {\n tokens.push({ type: \"keyword\", text: keyword });\n } else if (punctuation != null) {\n tokens.push({ type: \"punctuation\", text: punctuation });\n }\n last = match.index + match[0].length;\n }\n if (last < line.length) {\n tokens.push({ type: \"plain\", text: line.slice(last) });\n }\n return tokens;\n}\n","import {\n useMemo,\n useState,\n type ComponentProps,\n type ReactNode,\n type Ref,\n} from \"react\";\nimport {\n IconArrowsMaximize,\n IconArrowsMinimize,\n IconChevronDown,\n IconChevronUp,\n IconTextWrap,\n} from \"@tabler/icons-react\";\nimport { Button } from \"../button\";\nimport { CopyButton } from \"../copy-button\";\nimport { ScrollArea } from \"../scroll-area\";\nimport { Toggle } from \"../toggle\";\nimport { Tooltip } from \"../tooltip\";\nimport { cn } from \"../../utils/cn\";\nimport { plainLines, useHighlight } from \"./highlight\";\nimport type { CodeBlockLanguage } from \"./languages\";\nimport { tokenizeJson } from \"./tokenize-json\";\nimport { CODE_TOKEN_CLASS, type CodeLine } from \"./tokens\";\n\n/**\n * Code Block — a read-only panel for a request body, a response, an\n * event's JSON, an install command. Mono text on the code surface, a title row with expand,\n * wrap, and copy controls. Past `maxLines` the body either scrolls\n * inside that height (`overflow=\"scroll\"`, the default) or folds with a\n * footer button (`overflow=\"expand\"`).\n *\n * Design notes:\n * - Wide lines scroll sideways inside the panel; the page never does.\n * Wrapping is a toggle (`wrap` / `defaultWrap`), off by default so a\n * body reads the way it was sent.\n * - `language` colors the text with Shiki's grammar for it, fetched on\n * first use, on the `--color-pho-code-*` tokens, which carry light and\n * dark. JSON has a synchronous face too — a built-in tokenizer paints\n * it in the first render, and the grammar agrees with it — so a body\n * never flashes plain. Other languages read plain for the frame their\n * grammar takes to arrive.\n * - Without a `title` there is no title row: the controls float over the\n * panel's top-right corner, the way a snippet on a page wears a copy\n * button.\n * - A body that isn't a string (an object) is pretty-printed as JSON.\n */\n\nexport type CodeBlockOverflow = \"scroll\" | \"expand\";\n\n/** The panel's chrome — the card hairline around the code surface. */\nconst CODE_BLOCK_SURFACE =\n \"rounded-base border border-pho-secondary bg-pho-code-bg text-pho-code-fg\";\n\n/** One code line is `leading-5` / `min-h-5`; the pre pads `py-3`. */\nconst LINE_H = \"1.25rem\";\nconst PAD_Y = \"0.75rem\";\n\nexport interface CodeBlockProps extends Omit<\n ComponentProps<\"div\">,\n \"title\" | \"children\"\n> {\n /** The text. An object is pretty-printed as JSON (two-space indent). */\n code?: string | object | null;\n /**\n * What the text is, so the panel can color it: `json`, `typescript`,\n * `bash`, `python`, … or `text` for none. @default \"text\"\n */\n language?: CodeBlockLanguage;\n /**\n * The title row's words — \"Request body\", \"Response\". Without one the\n * row goes and the controls float over the top-right corner.\n */\n title?: ReactNode;\n /** Past this many lines the panel folds or clips. @default 30 */\n maxLines?: number;\n /**\n * How a long body is shown past `maxLines`. `scroll` clips to that\n * height and scrolls inside, with an expand toggle in the title row.\n * `expand` folds and shows a footer button.\n * @default \"scroll\"\n */\n overflow?: CodeBlockOverflow;\n /** Wrap long lines (controlled). */\n wrap?: boolean;\n /** Wrap long lines at first (uncontrolled). @default false */\n defaultWrap?: boolean;\n onWrapChange?: (wrap: boolean) => void;\n /** The expand toggle when `overflow` is `scroll`. @default true */\n expandToggle?: boolean;\n /** The wrap toggle. @default true */\n wrapToggle?: boolean;\n /**\n * A gutter of line numbers. Off by default; turn on for a long\n * payload (about twenty lines or more).\n * @default false\n */\n lineNumbers?: boolean;\n /** The copy control. @default true */\n copy?: boolean;\n /** What the panel says with no code. @default \"Nothing to show.\" */\n empty?: ReactNode;\n /** More controls beside the built-in ones, before them. */\n actions?: ReactNode;\n ref?: Ref<HTMLDivElement>;\n}\n\nfunction toText(code: CodeBlockProps[\"code\"]): string {\n if (code == null) return \"\";\n if (typeof code === \"string\") return code;\n try {\n return JSON.stringify(code, null, 2) ?? \"\";\n } catch {\n return String(code);\n }\n}\n\n/** The face a body has before (or without) its grammar. */\nfunction syncLines(text: string, language: CodeBlockLanguage): CodeLine[] {\n if (language === \"json\" || language === \"jsonc\") {\n return text.split(\"\\n\").map((line) => tokenizeJson(line));\n }\n return plainLines(text);\n}\n\n/** Room on the first lines for the floating controls, by how many show. */\nconst FLOATING_ROOM = [undefined, \"pr-12\", \"pr-20\", \"pr-28\"] as const;\n\nfunction HeaderToggle({\n label,\n pressed,\n onPressedChange,\n children,\n}: {\n label: string;\n pressed: boolean;\n onPressedChange: (next: boolean) => void;\n children: ReactNode;\n}) {\n return (\n <Tooltip.Root>\n <Tooltip.Trigger\n render={\n <Toggle\n size=\"sm\"\n pressed={pressed}\n onPressedChange={onPressedChange}\n aria-label={label}\n className=\"rounded-sm\"\n >\n {children}\n </Toggle>\n }\n />\n <Tooltip.Portal>\n <Tooltip.Positioner>\n <Tooltip.Popup>{label}</Tooltip.Popup>\n </Tooltip.Positioner>\n </Tooltip.Portal>\n </Tooltip.Root>\n );\n}\n\nfunction CodeLines({\n lines,\n lineNumbers,\n digits,\n wrap,\n}: {\n lines: CodeLine[];\n lineNumbers: boolean;\n digits: number;\n wrap: boolean;\n}) {\n return (\n <code>\n {lines.map((line, index) => (\n <span\n key={index}\n data-line=\"\"\n className={cn(\n \"min-h-5\",\n lineNumbers ? \"flex items-start\" : \"block\",\n lineNumbers && !wrap && \"min-w-max\",\n )}\n >\n {lineNumbers ? (\n <span\n data-line-number=\"\"\n aria-hidden\n className=\"text-pho-placeholder bg-pho-code-bg sticky left-0 z-[1] box-content shrink-0 pr-3 pl-3 text-right font-mono text-xs leading-5 tabular-nums select-none\"\n style={{ width: `${digits}ch` }}\n >\n {index + 1}\n </span>\n ) : null}\n <span className={lineNumbers ? \"min-w-0 flex-1\" : undefined}>\n {line.map((token, at) =>\n token.type === \"plain\" ? (\n token.text\n ) : (\n <span key={at} className={CODE_TOKEN_CLASS[token.type]}>\n {token.text}\n </span>\n ),\n )}\n </span>\n </span>\n ))}\n </code>\n );\n}\n\nexport function CodeBlock({\n code,\n language = \"text\",\n title,\n maxLines = 30,\n overflow = \"scroll\",\n wrap: wrapProp,\n defaultWrap = false,\n onWrapChange,\n expandToggle = true,\n wrapToggle = true,\n lineNumbers = false,\n copy = true,\n empty = \"Nothing to show.\",\n actions,\n className,\n ...props\n}: CodeBlockProps) {\n const text = useMemo(() => toText(code), [code]);\n const highlighted = useHighlight(text, language);\n const lines = useMemo(() => {\n const sync = syncLines(text, language);\n // The grammar and the split must agree on where lines are; where\n // they don't, the synchronous face stands.\n return highlighted != null && highlighted.length === sync.length\n ? highlighted\n : sync;\n }, [text, language, highlighted]);\n const [ownWrap, setOwnWrap] = useState(defaultWrap);\n const wrap = wrapProp ?? ownWrap;\n const setWrap = (next: boolean) => {\n if (wrapProp == null) setOwnWrap(next);\n onWrapChange?.(next);\n };\n const [expanded, setExpanded] = useState(false);\n const folds = lines.length > maxLines;\n const scrolling = overflow === \"scroll\" && folds && !expanded;\n const shown =\n overflow === \"expand\" && folds && !expanded\n ? lines.slice(0, maxLines)\n : lines;\n const isEmpty = text === \"\";\n const showExpandToggle =\n overflow === \"scroll\" && expandToggle && folds && !isEmpty;\n const showWrapToggle = wrapToggle && !isEmpty;\n const showCopy = copy && !isEmpty;\n const hasTitle = title != null;\n const builtIns =\n Number(showExpandToggle) + Number(showWrapToggle) + Number(showCopy);\n const hasControls = actions != null || builtIns > 0;\n const copyLabel = typeof title === \"string\" ? title.toLowerCase() : \"code\";\n const scrollLabel = typeof title === \"string\" ? title : \"Code\";\n const expandLabel = expanded\n ? `Collapse to ${maxLines} lines`\n : `Show all ${lines.length} lines`;\n const lineNoDigits = String(Math.max(lines.length, 1)).length;\n const controls = (\n <>\n {actions}\n <Tooltip.Provider>\n {showExpandToggle ? (\n <HeaderToggle\n label={expandLabel}\n pressed={expanded}\n onPressedChange={setExpanded}\n >\n {expanded ? (\n <IconArrowsMinimize aria-hidden />\n ) : (\n <IconArrowsMaximize aria-hidden />\n )}\n </HeaderToggle>\n ) : null}\n {showWrapToggle ? (\n <HeaderToggle\n label=\"Wrap long lines\"\n pressed={wrap}\n onPressedChange={setWrap}\n >\n <IconTextWrap aria-hidden />\n </HeaderToggle>\n ) : null}\n </Tooltip.Provider>\n {showCopy ? (\n <CopyButton value={text} label={copyLabel} size=\"md\" />\n ) : null}\n </>\n );\n const body = (\n <pre\n className={cn(\n \"m-0 min-w-0 py-3 font-mono text-xs leading-5\",\n lineNumbers ? \"pr-3 pl-0\" : \"px-3\",\n // Room for the floating controls on the first lines.\n !hasTitle &&\n FLOATING_ROOM[Math.min(builtIns + (actions != null ? 1 : 0), 3)],\n wrap\n ? \"[overflow-wrap:anywhere] whitespace-pre-wrap\"\n : scrolling\n ? \"w-max min-w-full whitespace-pre\"\n : \"max-w-full overflow-x-auto whitespace-pre\",\n )}\n >\n <CodeLines\n lines={shown}\n lineNumbers={lineNumbers}\n digits={lineNoDigits}\n wrap={wrap}\n />\n </pre>\n );\n return (\n <div\n data-code-block=\"\"\n data-language={language}\n data-overflow={overflow}\n data-highlighted={\n highlighted != null && lines === highlighted ? \"\" : undefined\n }\n className={cn(\n CODE_BLOCK_SURFACE,\n \"relative flex w-full min-w-0 flex-col overflow-hidden\",\n className,\n )}\n {...props}\n >\n {hasTitle ? (\n <div className=\"border-pho-secondary flex min-h-10 items-center gap-2 border-b py-1 pr-1.5 pl-3\">\n <div className=\"text-pho-secondary min-w-0 flex-1 truncate text-xs font-medium\">\n {title}\n </div>\n {controls}\n </div>\n ) : hasControls ? (\n // No title row: the controls float over the corner, on the code\n // surface so scrolled text passes under them.\n <div className=\"bg-pho-code-bg absolute top-1 right-1.5 z-10 flex items-center gap-2 rounded-sm\">\n {controls}\n </div>\n ) : null}\n {isEmpty ? (\n <p className=\"text-pho-description m-0 px-3 py-3 text-base\">{empty}</p>\n ) : scrolling ? (\n <section className=\"min-w-0\">\n <ScrollArea.Root\n fade={false}\n data-code-scroll=\"\"\n className=\"min-w-0 rounded-b-[inherit]\"\n style={{ height: `calc(${maxLines} * ${LINE_H} + ${PAD_Y} * 2)` }}\n >\n <ScrollArea.Viewport tabIndex={0} aria-label={scrollLabel}>\n <ScrollArea.Content>{body}</ScrollArea.Content>\n </ScrollArea.Viewport>\n <ScrollArea.Scrollbar>\n <ScrollArea.Thumb />\n </ScrollArea.Scrollbar>\n {wrap ? null : (\n <ScrollArea.Scrollbar orientation=\"horizontal\">\n <ScrollArea.Thumb />\n </ScrollArea.Scrollbar>\n )}\n </ScrollArea.Root>\n </section>\n ) : (\n body\n )}\n {overflow === \"expand\" && folds ? (\n <div className=\"border-pho-secondary flex items-center border-t px-1.5 py-1\">\n <Button\n variant=\"ghost\"\n size=\"sm\"\n aria-expanded={expanded}\n prefix={expanded ? IconChevronUp : IconChevronDown}\n onClick={() => setExpanded((prev) => !prev)}\n >\n {expanded ? \"Show less\" : `Show all ${lines.length} lines`}\n </Button>\n </div>\n ) : null}\n </div>\n );\n}\n\nCodeBlock.displayName = \"CodeBlock\";\n"],"x_google_ignoreList":[0,1,2],"mappings":";;;;;;;;;;;;AASA,IAAMA,KAAa;AAAA,EAAC,CAAC,QAAQ;AAAA,IAAE,GAAK;AAAA,IAAiB,KAAO;AAAA,EAAQ,CAAC;AAAA,EAAG,CAAC,QAAQ;AAAA,IAAE,GAAK;AAAA,IAAe,KAAO;AAAA,EAAQ,CAAC;AAAA,EAAG,CAAC,QAAQ;AAAA,IAAE,GAAK;AAAA,IAAmB,KAAO;AAAA,EAAQ,CAAC;AAAA,EAAG,CAAC,QAAQ;AAAA,IAAE,GAAK;AAAA,IAAc,KAAO;AAAA,EAAQ,CAAC;AAAA,EAAG,CAAC,QAAQ;AAAA,IAAE,GAAK;AAAA,IAAmB,KAAO;AAAA,EAAQ,CAAC;AAAA,EAAG,CAAC,QAAQ;AAAA,IAAE,GAAK;AAAA,IAAc,KAAO;AAAA,EAAQ,CAAC;AAAA,EAAG,CAAC,QAAQ;AAAA,IAAE,GAAK;AAAA,IAAiB,KAAO;AAAA,EAAQ,CAAC;AAAA,EAAG,CAAC,QAAQ;AAAA,IAAE,GAAK;AAAA,IAAY,KAAO;AAAA,EAAQ,CAAC;AAAC,GACna,KAAqB,EAAqB,WAAW,mBAAmB,kBAAkBA,EA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gBAAA,EAAC,EAAW,OAAZ,CAAmB,CAAA;AAAA,YACC,CAAA;AAAA,UAET;AAAA;MACV,CAAA,IAET;AAAA,MAED,MAAa,YAAY,IACxB,gBAAA,EAAC,OAAD;AAAA,QAAK,WAAU;AAAA,QACb,UAAA,gBAAA,EAAC,IAAD;AAAA,UACE,SAAQ;AAAA,UACR,MAAK;AAAA,UACL,iBAAe;AAAA,UACf,QAAQ,IAAW,KAAgB;AAAA,UACnC,SAAA,MAAe,EAAA,CAAa,MAAS,CAAC,CAAI;AAAA,UAEzC,UAAA,IAAW,cAAc,YAAY,EAAM,MAAA;AAAA,QACtC,CAAA;AAAA,MACL,CAAA,IACH;AAAA,IACD;AAAA;AAET;AAEA,GAAU,cAAc"}
1
+ {"version":3,"file":"code-block-DMiZkEWS.js","names":["__iconNode","__iconNode"],"sources":["../../../../node_modules/.pnpm/@tabler+icons-react@3.46.0_react@19.2.8/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowsMaximize.mjs","../../../../node_modules/.pnpm/@tabler+icons-react@3.46.0_react@19.2.8/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowsMinimize.mjs","../../../../node_modules/.pnpm/@tabler+icons-react@3.46.0_react@19.2.8/node_modules/@tabler/icons-react/dist/esm/icons/IconTextWrap.mjs","../../src/components/code-block/languages.ts","../../src/components/code-block/tokens.ts","../../src/components/code-block/pho-theme.ts","../../src/components/code-block/highlight.ts","../../src/components/code-block/tokenize-json.ts","../../src/components/code-block/code-block.tsx"],"sourcesContent":["/**\n * @license @tabler/icons-react v3.46.0 - MIT\n *\n * This source code is licensed under the MIT license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createReactComponent from '../createReactComponent.mjs';\n\nconst __iconNode = [[\"path\", { \"d\": \"M16 4l4 0l0 4\", \"key\": \"svg-0\" }], [\"path\", { \"d\": \"M14 10l6 -6\", \"key\": \"svg-1\" }], [\"path\", { \"d\": \"M8 20l-4 0l0 -4\", \"key\": \"svg-2\" }], [\"path\", { \"d\": \"M4 20l6 -6\", \"key\": \"svg-3\" }], [\"path\", { \"d\": \"M16 20l4 0l0 -4\", \"key\": \"svg-4\" }], [\"path\", { \"d\": \"M14 14l6 6\", \"key\": \"svg-5\" }], [\"path\", { \"d\": \"M8 4l-4 0l0 4\", \"key\": \"svg-6\" }], [\"path\", { \"d\": \"M4 4l6 6\", \"key\": \"svg-7\" }]];\nconst IconArrowsMaximize = createReactComponent(\"outline\", \"arrows-maximize\", \"ArrowsMaximize\", __iconNode);\n\nexport { __iconNode, IconArrowsMaximize as default };\n//# sourceMappingURL=IconArrowsMaximize.mjs.map\n","/**\n * @license @tabler/icons-react v3.46.0 - MIT\n *\n * This source code is licensed under the MIT license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createReactComponent from '../createReactComponent.mjs';\n\nconst __iconNode = [[\"path\", { \"d\": \"M5 9l4 0l0 -4\", \"key\": \"svg-0\" }], [\"path\", { \"d\": \"M3 3l6 6\", \"key\": \"svg-1\" }], [\"path\", { \"d\": \"M5 15l4 0l0 4\", \"key\": \"svg-2\" }], [\"path\", { \"d\": \"M3 21l6 -6\", \"key\": \"svg-3\" }], [\"path\", { \"d\": \"M19 9l-4 0l0 -4\", \"key\": \"svg-4\" }], [\"path\", { \"d\": \"M15 9l6 -6\", \"key\": \"svg-5\" }], [\"path\", { \"d\": \"M19 15l-4 0l0 4\", \"key\": \"svg-6\" }], [\"path\", { \"d\": \"M15 15l6 6\", \"key\": \"svg-7\" }]];\nconst IconArrowsMinimize = createReactComponent(\"outline\", \"arrows-minimize\", \"ArrowsMinimize\", __iconNode);\n\nexport { __iconNode, IconArrowsMinimize as default };\n//# sourceMappingURL=IconArrowsMinimize.mjs.map\n","/**\n * @license @tabler/icons-react v3.46.0 - MIT\n *\n * This source code is licensed under the MIT license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createReactComponent from '../createReactComponent.mjs';\n\nconst __iconNode = [[\"path\", { \"d\": \"M4 6l16 0\", \"key\": \"svg-0\" }], [\"path\", { \"d\": \"M4 18l5 0\", \"key\": \"svg-1\" }], [\"path\", { \"d\": \"M4 12h13a3 3 0 0 1 0 6h-4l2 -2m0 4l-2 -2\", \"key\": \"svg-2\" }]];\nconst IconTextWrap = createReactComponent(\"outline\", \"text-wrap\", \"TextWrap\", __iconNode);\n\nexport { __iconNode, IconTextWrap as default };\n//# sourceMappingURL=IconTextWrap.mjs.map\n","import type { LanguageRegistration } from \"shiki/core\";\n\n/**\n * The languages a code panel can color, each a grammar fetched on first\n * use — a page that shows JSON never downloads the TypeScript grammar.\n * Keyed by the name Shiki knows the grammar by; `LANGUAGE_ALIASES` lets a\n * panel say `ts` or `sh`.\n */\nexport const CODE_GRAMMARS = {\n json: () => import(\"@shikijs/langs/json\"),\n jsonc: () => import(\"@shikijs/langs/jsonc\"),\n javascript: () => import(\"@shikijs/langs/javascript\"),\n typescript: () => import(\"@shikijs/langs/typescript\"),\n jsx: () => import(\"@shikijs/langs/jsx\"),\n tsx: () => import(\"@shikijs/langs/tsx\"),\n shellscript: () => import(\"@shikijs/langs/shellscript\"),\n python: () => import(\"@shikijs/langs/python\"),\n swift: () => import(\"@shikijs/langs/swift\"),\n go: () => import(\"@shikijs/langs/go\"),\n ruby: () => import(\"@shikijs/langs/ruby\"),\n php: () => import(\"@shikijs/langs/php\"),\n java: () => import(\"@shikijs/langs/java\"),\n kotlin: () => import(\"@shikijs/langs/kotlin\"),\n csharp: () => import(\"@shikijs/langs/csharp\"),\n rust: () => import(\"@shikijs/langs/rust\"),\n html: () => import(\"@shikijs/langs/html\"),\n css: () => import(\"@shikijs/langs/css\"),\n xml: () => import(\"@shikijs/langs/xml\"),\n yaml: () => import(\"@shikijs/langs/yaml\"),\n toml: () => import(\"@shikijs/langs/toml\"),\n dotenv: () => import(\"@shikijs/langs/dotenv\"),\n sql: () => import(\"@shikijs/langs/sql\"),\n graphql: () => import(\"@shikijs/langs/graphql\"),\n http: () => import(\"@shikijs/langs/http\"),\n markdown: () => import(\"@shikijs/langs/markdown\"),\n diff: () => import(\"@shikijs/langs/diff\"),\n} satisfies Record<string, () => Promise<{ default: LanguageRegistration[] }>>;\n\nexport type CodeGrammar = keyof typeof CODE_GRAMMARS;\n\n/** Shorter names, and the ones people reach for first. */\nexport const LANGUAGE_ALIASES = {\n js: \"javascript\",\n ts: \"typescript\",\n bash: \"shellscript\",\n sh: \"shellscript\",\n shell: \"shellscript\",\n zsh: \"shellscript\",\n py: \"python\",\n rb: \"ruby\",\n kt: \"kotlin\",\n cs: \"csharp\",\n rs: \"rust\",\n yml: \"yaml\",\n md: \"markdown\",\n htm: \"html\",\n} as const satisfies Record<string, CodeGrammar>;\n\nexport type CodeLanguageAlias = keyof typeof LANGUAGE_ALIASES;\n\n/**\n * What `language` accepts: a grammar, an alias, or `text` for none. Plain\n * text is the default — a panel colors only what it is told the shape of.\n */\nexport type CodeBlockLanguage = \"text\" | CodeGrammar | CodeLanguageAlias;\n\n/**\n * The grammar behind a `language`, or `null` for plain text and names the\n * panel does not know (which read as text instead of throwing).\n */\nexport function resolveGrammar(language: string): CodeGrammar | null {\n // Own keys only: `in` would take \"toString\" for a grammar.\n if (Object.hasOwn(LANGUAGE_ALIASES, language)) {\n return LANGUAGE_ALIASES[language as CodeLanguageAlias];\n }\n return Object.hasOwn(CODE_GRAMMARS, language)\n ? (language as CodeGrammar)\n : null;\n}\n","/**\n * The token vocabulary a code panel colors with — one class per kind, on\n * the `--color-pho-code-*` tokens, which carry light and dark. The JSON\n * tokenizer speaks the first five; Shiki's grammars reach the rest.\n */\n\nexport type CodeTokenType =\n | \"key\"\n | \"string\"\n | \"number\"\n | \"keyword\"\n | \"punctuation\"\n | \"comment\"\n | \"function\"\n | \"type\"\n | \"plain\";\n\nexport interface CodeToken {\n type: CodeTokenType;\n text: string;\n}\n\n/** One line of a highlighted body. */\nexport type CodeLine = CodeToken[];\n\n/** The class a token kind wears; `plain` wears the panel's own ink. */\nexport const CODE_TOKEN_CLASS: Record<CodeTokenType, string | undefined> = {\n key: \"text-pho-code-key\",\n string: \"text-pho-code-string\",\n number: \"text-pho-code-number\",\n keyword: \"text-pho-code-keyword\",\n punctuation: \"text-pho-code-punctuation\",\n comment: \"text-pho-code-comment\",\n function: \"text-pho-code-function\",\n type: \"text-pho-code-type\",\n plain: undefined,\n};\n","import type { ThemeRegistrationRaw } from \"shiki/core\";\nimport { CODE_TOKEN_CLASS, type CodeTokenType } from \"./tokens\";\n\n/**\n * Pho's Shiki theme — not a palette but a routing table. Every TextMate\n * scope resolves to one of the panel's token kinds, and each kind's\n * \"color\" is the design token's own variable, so the theme has no light\n * and dark of its own: the `--color-pho-code-*` tokens carry both, and\n * the renderer turns each color back into the kind's class. Only the\n * kinds a body needs to read — keys, strings, numbers, keywords,\n * punctuation, comments, calls, types. Operators, variables, and\n * everything else stay in the panel's ink.\n */\n\nexport const PHO_THEME_NAME = \"pho\";\n\n/** The color a token kind \"has\" in the theme: its token's variable. */\nexport function tokenColor(type: Exclude<CodeTokenType, \"plain\">): string {\n return `var(--color-pho-code-${type})`;\n}\n\n/** The token kind behind a Shiki color, or `plain` for the panel's ink. */\nexport function tokenTypeOf(color: string | undefined): CodeTokenType {\n const match = color?.match(/^var\\(--color-pho-code-([a-z]+)\\)$/);\n const kind = match?.[1];\n return kind != null && kind in CODE_TOKEN_CLASS && kind !== \"plain\"\n ? (kind as CodeTokenType)\n : \"plain\";\n}\n\nconst rule = (\n type: Exclude<CodeTokenType, \"plain\"> | \"plain\",\n scope: string[],\n) => ({\n scope,\n settings: {\n foreground:\n type === \"plain\" ? \"var(--color-pho-code-fg)\" : tokenColor(type),\n },\n});\n\nexport const phoTheme: ThemeRegistrationRaw = {\n name: PHO_THEME_NAME,\n type: \"light\",\n fg: \"var(--color-pho-code-fg)\",\n bg: \"var(--color-pho-code-bg)\",\n settings: [\n rule(\"comment\", [\"comment\", \"punctuation.definition.comment\"]),\n rule(\"string\", [\n \"string\",\n \"markup.inserted\",\n \"meta.diff.header.to-file\",\n \"punctuation.definition.inserted\",\n ]),\n // A template's `${…}` and any embedded code read as code again.\n rule(\"plain\", [\"meta.template.expression\", \"meta.embedded\"]),\n rule(\"key\", [\n \"support.type.property-name\",\n \"meta.object-literal.key\",\n \"entity.other.attribute-name\",\n \"entity.name.tag.yaml\",\n \"keyword.key.toml\",\n \"variable.other.env\",\n ]),\n rule(\"number\", [\n \"constant.numeric\",\n \"markup.deleted\",\n \"meta.diff.header.from-file\",\n \"punctuation.definition.deleted\",\n ]),\n rule(\"keyword\", [\n \"keyword\",\n \"storage\",\n \"constant.language\",\n \"variable.language\",\n ]),\n // Symbolic operators sit in the ink: `=`, `+`, `=>`, `&&` are shape,\n // not vocabulary. The word-shaped ones above stay keywords.\n rule(\"plain\", [\"keyword.operator\"]),\n rule(\"keyword\", [\n \"keyword.operator.expression\",\n \"keyword.operator.new\",\n \"keyword.operator.logical.python\",\n \"keyword.operator.wordlike\",\n ]),\n rule(\"function\", [\n \"entity.name.function\",\n \"support.function\",\n \"entity.name.command\",\n \"meta.function-call.generic\",\n ]),\n rule(\"type\", [\n \"entity.name.type\",\n \"entity.name.class\",\n \"entity.name.tag\",\n \"entity.other.inherited-class\",\n \"support.type\",\n \"support.class\",\n \"storage.type.primitive\",\n ]),\n // A property name is a key even though it is a `support.type`.\n rule(\"key\", [\"support.type.property-name\"]),\n rule(\"punctuation\", [\n \"punctuation.separator\",\n \"punctuation.terminator\",\n \"punctuation.accessor\",\n \"punctuation.section\",\n \"punctuation.definition.array\",\n \"punctuation.definition.dictionary\",\n \"punctuation.definition.block\",\n \"punctuation.definition.parameters\",\n \"punctuation.definition.arguments\",\n \"punctuation.definition.tag\",\n \"punctuation.definition.typeparameters\",\n \"meta.brace\",\n ]),\n ],\n};\n","import { useEffect, useSyncExternalStore } from \"react\";\nimport type { HighlighterCore, ThemedToken } from \"shiki/core\";\nimport { CODE_GRAMMARS, resolveGrammar, type CodeGrammar } from \"./languages\";\nimport { phoTheme, PHO_THEME_NAME, tokenTypeOf } from \"./pho-theme\";\nimport type { CodeLine } from \"./tokens\";\n\n/**\n * Highlighting, on Shiki — one highlighter for the whole app, made on\n * the first panel that asks and kept; grammars fetched on demand and\n * kept too. Bodies are tokenized once per (grammar, text) and remembered,\n * so a wrap toggle or a fold never re-runs a grammar.\n *\n * The result is lines of `CodeToken`s in the panel's own vocabulary\n * (`tokens.ts`), never Shiki's HTML: the panel keeps rendering its own\n * lines (the fold, `data-line`) and its own classes (the design tokens).\n *\n * Nothing here runs on the server. `useHighlight` reports `null` until a\n * body is highlighted, and a panel shows its synchronous face meanwhile —\n * plain text, or the JSON tokenizer's colors — so a page prerendered and\n * a page hydrated agree, and the colors settle in a frame later.\n */\n\nlet core: HighlighterCore | null = null;\nlet corePromise: Promise<HighlighterCore> | null = null;\nconst loadedGrammars = new Set<CodeGrammar>();\nconst loadingGrammars = new Map<CodeGrammar, Promise<void>>();\n\n/**\n * Shiki itself arrives with the first body that needs it — a page of\n * cards and rows never loads the engine — and stays for the rest.\n */\nfunction getCore(): Promise<HighlighterCore> {\n corePromise ??= Promise.all([\n import(\"shiki/core\"),\n import(\"shiki/engine/javascript\"),\n ])\n .then(([{ createHighlighterCore }, { createJavaScriptRegexEngine }]) =>\n createHighlighterCore({\n themes: [phoTheme],\n langs: [],\n // Shiki's JavaScript engine: no WebAssembly to fetch or allow, and\n // `forgiving` degrades a grammar's exotic pattern instead of\n // failing the whole body.\n engine: createJavaScriptRegexEngine({ forgiving: true }),\n }),\n )\n .then((highlighter) => {\n core = highlighter;\n return highlighter;\n });\n return corePromise;\n}\n\n/** Fetch a language's grammar ahead of the first body that needs it. */\nexport function preloadLanguage(language: string): Promise<void> {\n const grammar = resolveGrammar(language);\n if (grammar == null || loadedGrammars.has(grammar)) return Promise.resolve();\n let loading = loadingGrammars.get(grammar);\n if (loading == null) {\n loading = Promise.all([getCore(), CODE_GRAMMARS[grammar]()])\n .then(([highlighter, module]) =>\n highlighter.loadLanguage(...module.default),\n )\n .then(() => {\n loadedGrammars.add(grammar);\n })\n .finally(() => {\n loadingGrammars.delete(grammar);\n });\n loadingGrammars.set(grammar, loading);\n }\n return loading;\n}\n\n/** Whether `language` can be tokenized right now, without waiting. */\nexport function isLanguageReady(language: string): boolean {\n const grammar = resolveGrammar(language);\n return grammar != null && core != null && loadedGrammars.has(grammar);\n}\n\nfunction toLines(tokens: ThemedToken[][]): CodeLine[] {\n return tokens.map((line) => {\n const out: CodeLine = [];\n for (const token of line) {\n const type = tokenTypeOf(token.color);\n const last = out[out.length - 1];\n // Neighbors of one kind collapse into one span.\n if (last != null && last.type === type) last.text += token.content;\n else out.push({ type, text: token.content });\n }\n return out;\n });\n}\n\n/**\n * Tokenize a body with a grammar that is already loaded. `null` when the\n * language is plain text or its grammar is not here yet — see\n * `preloadLanguage` / `highlight`.\n */\nexport function highlightSync(\n code: string,\n language: string,\n): CodeLine[] | null {\n const grammar = resolveGrammar(language);\n if (grammar == null || core == null || !loadedGrammars.has(grammar)) {\n return null;\n }\n return toLines(\n core.codeToTokensBase(code, { lang: grammar, theme: PHO_THEME_NAME }),\n );\n}\n\n/** Plain lines — what a body reads as with no grammar. */\nexport function plainLines(code: string): CodeLine[] {\n return code.split(\"\\n\").map((text) => [{ type: \"plain\", text }]);\n}\n\n/**\n * Tokenize a body, fetching the highlighter and the grammar first if\n * need be. A language the panel does not know resolves to plain lines.\n */\nexport async function highlight(\n code: string,\n language: string,\n): Promise<CodeLine[]> {\n if (resolveGrammar(language) == null) return plainLines(code);\n await preloadLanguage(language);\n return highlightSync(code, language) ?? plainLines(code);\n}\n\n/* --------------------------------- store --------------------------------- */\n\n/** How many highlighted bodies to keep. A page's worth, several times. */\nconst CACHE_LIMIT = 200;\nconst cache = new Map<string, CodeLine[]>();\nconst listeners = new Set<() => void>();\n\nfunction remember(key: string, lines: CodeLine[]): CodeLine[] {\n const known = cache.get(key);\n if (known != null) return known;\n if (cache.size >= CACHE_LIMIT) {\n const oldest = cache.keys().next().value;\n if (oldest != null) cache.delete(oldest);\n }\n cache.set(key, lines);\n return lines;\n}\n\nfunction subscribe(listener: () => void) {\n listeners.add(listener);\n return () => {\n listeners.delete(listener);\n };\n}\n\nfunction notify() {\n for (const listener of listeners) listener();\n}\n\nfunction cacheKey(grammar: CodeGrammar, code: string) {\n return `${grammar}\u0000${code}`;\n}\n\n/**\n * The highlighted lines of a body, or `null` while its grammar is on the\n * way (and always for plain text). A grammar already here highlights in\n * the same render, no flash.\n */\nexport function useHighlight(\n code: string,\n language: string,\n): CodeLine[] | null {\n const grammar = resolveGrammar(language);\n const key = grammar != null ? cacheKey(grammar, code) : null;\n const lines = useSyncExternalStore(\n subscribe,\n () => {\n if (key == null) return null;\n const known = cache.get(key);\n if (known != null) return known;\n const now = highlightSync(code, language);\n return now != null ? remember(key, now) : null;\n },\n // Prerendered markup is the synchronous face; hydration agrees with it\n // and the colors settle in the render after.\n () => null,\n );\n useEffect(() => {\n if (key == null || cache.has(key)) return;\n // Remembered even if this panel is gone by then: the next one with the\n // same body reads it in its first render.\n highlight(code, language).then(\n (result) => {\n remember(key, result);\n notify();\n },\n () => {\n // A grammar that would not load: the panel keeps its plain face.\n },\n );\n }, [key, code, language]);\n return lines;\n}\n","/**\n * A tokenizer for JSON, and nothing else: keys, strings, numbers, the\n * three keywords, and punctuation. Runs one line at a time (a JSON\n * string never spans lines) so a panel can show its first N lines and\n * stop. Text that isn't JSON comes back as it is, in plain tokens.\n */\n\nexport type JsonTokenType =\n \"key\" | \"string\" | \"number\" | \"keyword\" | \"punctuation\" | \"plain\";\n\nexport interface JsonToken {\n type: JsonTokenType;\n text: string;\n}\n\n// One pass, left to right: a string (a key when a colon follows), a\n// number, a keyword, a bracket or a comma. Anything between is plain.\nconst TOKEN =\n /(\"(?:[^\"\\\\]|\\\\.)*\")(\\s*:)?|(-?\\d+(?:\\.\\d+)?(?:[eE][+-]?\\d+)?)|\\b(true|false|null)\\b|([{}[\\]:,])/g;\n\nexport function tokenizeJson(line: string): JsonToken[] {\n const tokens: JsonToken[] = [];\n let last = 0;\n TOKEN.lastIndex = 0;\n for (let match = TOKEN.exec(line); match != null; match = TOKEN.exec(line)) {\n if (match.index > last) {\n tokens.push({ type: \"plain\", text: line.slice(last, match.index) });\n }\n const [, string, colon, number, keyword, punctuation] = match;\n if (string != null) {\n tokens.push({ type: colon != null ? \"key\" : \"string\", text: string });\n if (colon != null) tokens.push({ type: \"punctuation\", text: colon });\n } else if (number != null) {\n tokens.push({ type: \"number\", text: number });\n } else if (keyword != null) {\n tokens.push({ type: \"keyword\", text: keyword });\n } else if (punctuation != null) {\n tokens.push({ type: \"punctuation\", text: punctuation });\n }\n last = match.index + match[0].length;\n }\n if (last < line.length) {\n tokens.push({ type: \"plain\", text: line.slice(last) });\n }\n return tokens;\n}\n","import {\n useMemo,\n useState,\n type ComponentProps,\n type ReactNode,\n type Ref,\n} from \"react\";\nimport {\n IconArrowsMaximize,\n IconArrowsMinimize,\n IconChevronDown,\n IconChevronUp,\n IconTextWrap,\n} from \"@tabler/icons-react\";\nimport { Button } from \"../button\";\nimport { CopyButton } from \"../copy-button\";\nimport { ScrollArea } from \"../scroll-area\";\nimport { Toggle } from \"../toggle\";\nimport { Tooltip } from \"../tooltip\";\nimport { cn } from \"../../utils/cn\";\nimport { plainLines, useHighlight } from \"./highlight\";\nimport type { CodeBlockLanguage } from \"./languages\";\nimport { tokenizeJson } from \"./tokenize-json\";\nimport { CODE_TOKEN_CLASS, type CodeLine } from \"./tokens\";\n\n/**\n * Code Block — a read-only panel for a request body, a response, an\n * event's JSON, an install command. Mono text on the code surface, a title row with expand,\n * wrap, and copy controls. Past `maxLines` the body either scrolls\n * inside that height (`overflow=\"scroll\"`, the default) or folds with a\n * footer button (`overflow=\"expand\"`).\n *\n * Design notes:\n * - Wide lines scroll sideways inside the panel; the page never does.\n * Wrapping is a toggle (`wrap` / `defaultWrap`), off by default so a\n * body reads the way it was sent.\n * - `language` colors the text with Shiki's grammar for it, fetched on\n * first use, on the `--color-pho-code-*` tokens, which carry light and\n * dark. JSON has a synchronous face too — a built-in tokenizer paints\n * it in the first render, and the grammar agrees with it — so a body\n * never flashes plain. Other languages read plain for the frame their\n * grammar takes to arrive.\n * - Without a `title` there is no title row: the controls float over the\n * panel's top-right corner, the way a snippet on a page wears a copy\n * button.\n * - A body that isn't a string (an object) is pretty-printed as JSON.\n */\n\nexport type CodeBlockOverflow = \"scroll\" | \"expand\";\n\n/** The panel's chrome — the card hairline around the code surface. */\nconst CODE_BLOCK_SURFACE =\n \"rounded-base border border-pho-secondary bg-pho-code-bg text-pho-code-fg\";\n\n/** One code line is `leading-5` / `min-h-5`; the pre pads `py-3`. */\nconst LINE_H = \"1.25rem\";\nconst PAD_Y = \"0.75rem\";\n\nexport interface CodeBlockProps extends Omit<\n ComponentProps<\"div\">,\n \"title\" | \"children\"\n> {\n /** The text. An object is pretty-printed as JSON (two-space indent). */\n code?: string | object | null;\n /**\n * What the text is, so the panel can color it: `json`, `typescript`,\n * `bash`, `python`, … or `text` for none. @default \"text\"\n */\n language?: CodeBlockLanguage;\n /**\n * The title row's words — \"Request body\", \"Response\". Without one the\n * row goes and the controls float over the top-right corner.\n */\n title?: ReactNode;\n /** Past this many lines the panel folds or clips. @default 30 */\n maxLines?: number;\n /**\n * How a long body is shown past `maxLines`. `scroll` clips to that\n * height and scrolls inside, with an expand toggle in the title row.\n * `expand` folds and shows a footer button.\n * @default \"scroll\"\n */\n overflow?: CodeBlockOverflow;\n /** Wrap long lines (controlled). */\n wrap?: boolean;\n /** Wrap long lines at first (uncontrolled). @default false */\n defaultWrap?: boolean;\n onWrapChange?: (wrap: boolean) => void;\n /** The expand toggle when `overflow` is `scroll`. @default true */\n expandToggle?: boolean;\n /** The wrap toggle. @default true */\n wrapToggle?: boolean;\n /**\n * A gutter of line numbers. Off by default; turn on for a long\n * payload (about twenty lines or more).\n * @default false\n */\n lineNumbers?: boolean;\n /** The copy control. @default true */\n copy?: boolean;\n /** What the panel says with no code. @default \"Nothing to show.\" */\n empty?: ReactNode;\n /** More controls beside the built-in ones, before them. */\n actions?: ReactNode;\n ref?: Ref<HTMLDivElement>;\n}\n\nfunction toText(code: CodeBlockProps[\"code\"]): string {\n if (code == null) return \"\";\n if (typeof code === \"string\") return code;\n try {\n return JSON.stringify(code, null, 2) ?? \"\";\n } catch {\n return String(code);\n }\n}\n\n/** The face a body has before (or without) its grammar. */\nfunction syncLines(text: string, language: CodeBlockLanguage): CodeLine[] {\n if (language === \"json\" || language === \"jsonc\") {\n return text.split(\"\\n\").map((line) => tokenizeJson(line));\n }\n return plainLines(text);\n}\n\n/** Room on the first lines for the floating controls, by how many show. */\nconst FLOATING_ROOM = [undefined, \"pr-12\", \"pr-20\", \"pr-28\"] as const;\n\nfunction HeaderToggle({\n label,\n pressed,\n onPressedChange,\n children,\n}: {\n label: string;\n pressed: boolean;\n onPressedChange: (next: boolean) => void;\n children: ReactNode;\n}) {\n return (\n <Tooltip.Root>\n <Tooltip.Trigger\n render={\n <Toggle\n size=\"sm\"\n pressed={pressed}\n onPressedChange={onPressedChange}\n aria-label={label}\n className=\"rounded-sm\"\n >\n {children}\n </Toggle>\n }\n />\n <Tooltip.Portal>\n <Tooltip.Positioner>\n <Tooltip.Popup>{label}</Tooltip.Popup>\n </Tooltip.Positioner>\n </Tooltip.Portal>\n </Tooltip.Root>\n );\n}\n\nfunction CodeLines({\n lines,\n lineNumbers,\n digits,\n wrap,\n}: {\n lines: CodeLine[];\n lineNumbers: boolean;\n digits: number;\n wrap: boolean;\n}) {\n return (\n <code>\n {lines.map((line, index) => (\n <span\n key={index}\n data-line=\"\"\n className={cn(\n \"min-h-5\",\n lineNumbers ? \"flex items-start\" : \"block\",\n lineNumbers && !wrap && \"min-w-max\",\n )}\n >\n {lineNumbers ? (\n <span\n data-line-number=\"\"\n aria-hidden\n className=\"text-pho-placeholder bg-pho-code-bg sticky left-0 z-[1] box-content shrink-0 pr-3 pl-3 text-right font-mono text-xs leading-5 tabular-nums select-none\"\n style={{ width: `${digits}ch` }}\n >\n {index + 1}\n </span>\n ) : null}\n <span className={lineNumbers ? \"min-w-0 flex-1\" : undefined}>\n {line.map((token, at) =>\n token.type === \"plain\" ? (\n token.text\n ) : (\n <span key={at} className={CODE_TOKEN_CLASS[token.type]}>\n {token.text}\n </span>\n ),\n )}\n </span>\n </span>\n ))}\n </code>\n );\n}\n\nexport function CodeBlock({\n code,\n language = \"text\",\n title,\n maxLines = 30,\n overflow = \"scroll\",\n wrap: wrapProp,\n defaultWrap = false,\n onWrapChange,\n expandToggle = true,\n wrapToggle = true,\n lineNumbers = false,\n copy = true,\n empty = \"Nothing to show.\",\n actions,\n className,\n ...props\n}: CodeBlockProps) {\n const text = useMemo(() => toText(code), [code]);\n const highlighted = useHighlight(text, language);\n const lines = useMemo(() => {\n const sync = syncLines(text, language);\n // The grammar and the split must agree on where lines are; where\n // they don't, the synchronous face stands.\n return highlighted != null && highlighted.length === sync.length\n ? highlighted\n : sync;\n }, [text, language, highlighted]);\n const [ownWrap, setOwnWrap] = useState(defaultWrap);\n const wrap = wrapProp ?? ownWrap;\n const setWrap = (next: boolean) => {\n if (wrapProp == null) setOwnWrap(next);\n onWrapChange?.(next);\n };\n const [expanded, setExpanded] = useState(false);\n const folds = lines.length > maxLines;\n const scrolling = overflow === \"scroll\" && folds && !expanded;\n const shown =\n overflow === \"expand\" && folds && !expanded\n ? lines.slice(0, maxLines)\n : lines;\n const isEmpty = text === \"\";\n const showExpandToggle =\n overflow === \"scroll\" && expandToggle && folds && !isEmpty;\n const showWrapToggle = wrapToggle && !isEmpty;\n const showCopy = copy && !isEmpty;\n const hasTitle = title != null;\n const builtIns =\n Number(showExpandToggle) + Number(showWrapToggle) + Number(showCopy);\n const hasControls = actions != null || builtIns > 0;\n const copyLabel = typeof title === \"string\" ? title.toLowerCase() : \"code\";\n const scrollLabel = typeof title === \"string\" ? title : \"Code\";\n const expandLabel = expanded\n ? `Collapse to ${maxLines} lines`\n : `Show all ${lines.length} lines`;\n const lineNoDigits = String(Math.max(lines.length, 1)).length;\n const controls = (\n <>\n {actions}\n <Tooltip.Provider>\n {showExpandToggle ? (\n <HeaderToggle\n label={expandLabel}\n pressed={expanded}\n onPressedChange={setExpanded}\n >\n {expanded ? (\n <IconArrowsMinimize aria-hidden />\n ) : (\n <IconArrowsMaximize aria-hidden />\n )}\n </HeaderToggle>\n ) : null}\n {showWrapToggle ? (\n <HeaderToggle\n label=\"Wrap long lines\"\n pressed={wrap}\n onPressedChange={setWrap}\n >\n <IconTextWrap aria-hidden />\n </HeaderToggle>\n ) : null}\n </Tooltip.Provider>\n {showCopy ? (\n <CopyButton value={text} label={copyLabel} size=\"md\" />\n ) : null}\n </>\n );\n const body = (\n <pre\n className={cn(\n \"m-0 min-w-0 py-3 font-mono text-xs leading-5\",\n lineNumbers ? \"pr-3 pl-0\" : \"px-3\",\n // Room for the floating controls on the first lines.\n !hasTitle &&\n FLOATING_ROOM[Math.min(builtIns + (actions != null ? 1 : 0), 3)],\n wrap\n ? \"[overflow-wrap:anywhere] whitespace-pre-wrap\"\n : scrolling\n ? \"w-max min-w-full whitespace-pre\"\n : \"max-w-full overflow-x-auto whitespace-pre\",\n )}\n >\n <CodeLines\n lines={shown}\n lineNumbers={lineNumbers}\n digits={lineNoDigits}\n wrap={wrap}\n />\n </pre>\n );\n return (\n <div\n data-code-block=\"\"\n data-language={language}\n data-overflow={overflow}\n data-highlighted={\n highlighted != null && lines === highlighted ? \"\" : undefined\n }\n className={cn(\n CODE_BLOCK_SURFACE,\n \"relative flex w-full min-w-0 flex-col overflow-hidden\",\n className,\n )}\n {...props}\n >\n {hasTitle ? (\n <div className=\"border-pho-secondary flex min-h-10 items-center gap-2 border-b py-1 pr-1.5 pl-3\">\n <div className=\"text-pho-secondary min-w-0 flex-1 truncate text-xs font-medium\">\n {title}\n </div>\n {controls}\n </div>\n ) : hasControls ? (\n // No title row: the controls float over the corner, on the code\n // surface so scrolled text passes under them.\n <div className=\"bg-pho-code-bg absolute top-1 right-1.5 z-10 flex items-center gap-2 rounded-sm\">\n {controls}\n </div>\n ) : null}\n {isEmpty ? (\n <p className=\"text-pho-description m-0 px-3 py-3 text-base\">{empty}</p>\n ) : scrolling ? (\n <section className=\"min-w-0\">\n <ScrollArea.Root\n fade={false}\n data-code-scroll=\"\"\n className=\"min-w-0 rounded-b-[inherit]\"\n style={{ height: `calc(${maxLines} * ${LINE_H} + ${PAD_Y} * 2)` }}\n >\n <ScrollArea.Viewport tabIndex={0} aria-label={scrollLabel}>\n <ScrollArea.Content>{body}</ScrollArea.Content>\n </ScrollArea.Viewport>\n <ScrollArea.Scrollbar>\n <ScrollArea.Thumb />\n </ScrollArea.Scrollbar>\n {wrap ? null : (\n <ScrollArea.Scrollbar orientation=\"horizontal\">\n <ScrollArea.Thumb />\n </ScrollArea.Scrollbar>\n )}\n </ScrollArea.Root>\n </section>\n ) : (\n body\n )}\n {overflow === \"expand\" && folds ? (\n <div className=\"border-pho-secondary flex items-center border-t px-1.5 py-1\">\n <Button\n variant=\"ghost\"\n size=\"sm\"\n aria-expanded={expanded}\n prefix={expanded ? IconChevronUp : IconChevronDown}\n onClick={() => setExpanded((prev) => !prev)}\n >\n {expanded ? \"Show less\" : `Show all ${lines.length} lines`}\n </Button>\n </div>\n ) : null}\n </div>\n );\n}\n\nCodeBlock.displayName = \"CodeBlock\";\n"],"x_google_ignoreList":[0,1,2],"mappings":";;;;;;;;;;;;AASA,IAAMA,KAAa;AAAA,EAAC,CAAC,QAAQ;AAAA,IAAE,GAAK;AAAA,IAAiB,KAAO;AAAA,EAAQ,CAAC;AAAA,EAAG,CAAC,QAAQ;AAAA,IAAE,GAAK;AAAA,IAAe,KAAO;AAAA,EAAQ,CAAC;AAAA,EAAG,CAAC,QAAQ;AAAA,IAAE,GAAK;AAAA,IAAmB,KAAO;AAAA,EAAQ,CAAC;AAAA,EAAG,CAAC,QAAQ;AAAA,IAAE,GAAK;AAAA,IAAc,KAAO;AAAA,EAAQ,CAAC;AAAA,EAAG,CAAC,QAAQ;AAAA,IAAE,GAAK;AAAA,I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