@graphysdk/react-renderer 1.9.0-beta.1794563106460 → 1.9.0-beta.1794582331101

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,21 +1,21 @@
1
- import { $n as De, $t as qe, An as ee, Bn as Cr, Bt as Lr, Dn as Ge, En as F, Fn as K, G as Dr, Gn as _e, Gt as qr, Hn as ke, I as _r, In as U, Jn as Re, K as kr, Kt as $r, L as Hr, Ln as xr, Lt as Mr, Mn as $e, Nn as Or, O as Ar, On as Br, Ot as Fr, Pn as He, Qn as Kr, Qt as xe, R as Ur, Tn as zr, Tt as Wr, U as Yr, Un as Me, Ut as jr, Vn as Oe, W as Vr, Wn as Xr, Xn as Qr, Yn as Jr, Yt as J, Zn as Zr, _n as en, _t as tn, a as rn, cn as Ae, dn as nn, en as sn, er as Be, fn as on, gt as an, ht as cn, i as ln, in as dn, ir as Z, jn as Ie, jt as un, kn as Fe, kt as mn, l as hn, ln as Ke, n as gn, nn as te, nr as Ue, pn as fn, qn as ze, qt as pn, r as vn, rn as We, sn as yn, t as Ye, tn as Sn, tr as oe, un as bn, wn as Tn, xn as En, y as Gn, yt as Rn, zn as In } from "./history-chords-DCCD82Ej.js";
2
- import { COMPILER_STAGE_KEYS as ie, DEFAULT_LOCALE as je, Geom as Ve, GraphCompilationSession as Xe, areEditTargetsEqual as Qe, buildDiagnostic as de, buildPointSymbolPath as Je, canonicalizeLocale as Ze, createAnchorResolver as et, createCompiler as tt, createDataLabelPlacementResolver as rt, createSpecBuilder as nt, createStyleResolver as we, findAnnotation as st, findIntlLocale as ot, findLayerById as ue, foldGeomCornerRadii as it, isCompilerCachingEnabled as at, isGeometricSymbol as ae, isImageSymbol as ct, resolveDefinition as lt, resolveGeomCornerRadiusPx as me, setCompilerCachingEnabled as dt, toPercent as X } from "@graphysdk/viz-engine";
3
- import { Component as ut, useCallback as f, useEffect as _, useId as mt, useImperativeHandle as ht, useMemo as H, useRef as he, useState as S, useSyncExternalStore as gt } from "react";
1
+ import { $n as Dr, $t as qe, A as Lr, An as ke, At as qr, B as kr, Dn as F, En as _r, Et as $r, Fn as _e, G as Hr, Gn as $e, Hn as xr, In as K, J as Mr, Jt as Ar, K as Or, Kn as Br, Kt as Fr, Ln as ee, Mn as Re, Mt as Kr, Nn as He, On as Ie, Pn as zr, Qn as Ur, R as Wr, Rn as z, Rt as Vr, Sn as Yr, Tn as jr, Un as xe, Vn as Xr, Vt as Jr, Wn as Me, Wt as Qr, Xn as Ne, Xt as Q, Yn as Ae, Zn as Zr, _t as en, a as tn, an as rn, bt as nn, cn as sn, dn as on, en as Oe, er as an, fn as cn, i as ln, in as Be, ir as Fe, jn as te, kn as dn, kt as un, l as mn, ln as Ke, mn as hn, n as gn, nn as pn, nr as ze, or as Z, pn as fn, q as vn, qn as Ue, qt as yn, r as Sn, rn as re, rr as ie, t as We, tn as bn, tr as Ve, un as Ye, vn as Tn, vt as En, y as Gn, yt as Rn, z as In, zn as Nn } from "./history-chords-QvGzISXZ.js";
2
+ import { COMPILER_STAGE_KEYS as ae, DEFAULT_LOCALE as je, Geom as Xe, GraphCompilationSession as Je, areEditTargetsEqual as Qe, buildDiagnostic as ue, buildPointSymbolPath as Ze, canonicalizeLocale as et, createAnchorResolver as tt, createCompiler as rt, createDataLabelPlacementResolver as nt, createSpecBuilder as st, createStyleResolver as we, findAnnotation as ot, findIntlLocale as it, findLayerById as me, foldGeomCornerRadii as at, isCompilerCachingEnabled as ct, isGeometricSymbol as ce, isImageSymbol as lt, resolveDefinition as dt, resolveGeomCornerRadiusPx as he, setCompilerCachingEnabled as ut, toPercent as X } from "@graphysdk/viz-engine";
3
+ import { Component as mt, useCallback as p, useEffect as k, useId as ht, useImperativeHandle as gt, useMemo as H, useRef as ge, useState as S, useSyncExternalStore as pt } from "react";
4
4
  import { Fragment as ft, jsx as c, jsxs as v } from "react/jsx-runtime";
5
- import { useStore as se } from "zustand";
6
- import { motion as re } from "motion/react";
7
- import { createStore as ce } from "zustand/vanilla";
8
- import pt from "clsx";
9
- import './index.css';var vt = "_1a5iqpb0", yt = "_1a5iqpb1";
10
- var St = "_1a5iqpb3", bt = "_1a5iqpb4", Tt = "_1a5iqpb5";
11
- var ge = ({ errors: e }) => {
5
+ import { useStore as oe } from "zustand";
6
+ import { motion as ne } from "motion/react";
7
+ import { createStore as le } from "zustand/vanilla";
8
+ import vt from "clsx";
9
+ import './index.css';var yt = "_1a5iqpb0", St = "_1a5iqpb1";
10
+ var bt = "_1a5iqpb3", Tt = "_1a5iqpb4", Et = "_1a5iqpb5";
11
+ var pe = ({ errors: e }) => {
12
12
  const [t, ...r] = e;
13
13
  return /* @__PURE__ */ v("div", {
14
14
  role: "alert",
15
- className: vt,
15
+ className: yt,
16
16
  children: [
17
17
  /* @__PURE__ */ c("strong", {
18
- className: yt,
18
+ className: St,
19
19
  children: "This chart could not be rendered."
20
20
  }),
21
21
  t && /* @__PURE__ */ c(fe, { diagnostic: t }),
@@ -26,14 +26,14 @@ var ge = ({ errors: e }) => {
26
26
  ]
27
27
  });
28
28
  }, fe = ({ diagnostic: e }) => /* @__PURE__ */ v("div", {
29
- className: St,
29
+ className: bt,
30
30
  children: [
31
31
  /* @__PURE__ */ c("span", {
32
- className: bt,
32
+ className: Tt,
33
33
  children: e.code
34
34
  }),
35
35
  /* @__PURE__ */ c("p", {
36
- className: Tt,
36
+ className: Et,
37
37
  children: e.message
38
38
  }),
39
39
  e.suggestion && /* @__PURE__ */ c("p", {
@@ -42,47 +42,47 @@ var ge = ({ errors: e }) => {
42
42
  })
43
43
  ]
44
44
  });
45
- function Et(e = [], t = []) {
45
+ function Gt(e = [], t = []) {
46
46
  return e.length === t.length && e.every((r, n) => Object.is(r, t[n]));
47
47
  }
48
- var Gt = class extends ut {
48
+ var Rt = class extends mt {
49
49
  constructor(...e) {
50
50
  super(...e), this.state = { caughtDiagnostic: null };
51
51
  }
52
52
  static getDerivedStateFromError(e) {
53
- return { caughtDiagnostic: de(e) };
53
+ return { caughtDiagnostic: ue(e) };
54
54
  }
55
55
  componentDidCatch(e, t) {
56
- const r = de(e);
56
+ const r = ue(e);
57
57
  Z([r]), this.props.onError?.([r]), console.error("Chart render component stack:", t.componentStack);
58
58
  }
59
59
  componentDidUpdate(e) {
60
- this.state.caughtDiagnostic && !Et(e.resetKeys, this.props.resetKeys) && this.setState({ caughtDiagnostic: null });
60
+ this.state.caughtDiagnostic && !Gt(e.resetKeys, this.props.resetKeys) && this.setState({ caughtDiagnostic: null });
61
61
  }
62
62
  render() {
63
63
  const { caughtDiagnostic: e } = this.state;
64
- if (e) return /* @__PURE__ */ c(ge, { errors: [e] });
64
+ if (e) return /* @__PURE__ */ c(pe, { errors: [e] });
65
65
  const { forcedErrors: t, children: r } = this.props;
66
- return t && t.length > 0 ? /* @__PURE__ */ c(ge, { errors: t }) : r;
66
+ return t && t.length > 0 ? /* @__PURE__ */ c(pe, { errors: t }) : r;
67
67
  }
68
- }, Ne = (e) => typeof e == "object" && "geom" in e && "render" in e, Pe = (e) => {
69
- const t = lt(e);
70
- return t instanceof Ve ? t : null;
71
- }, Rt = (e, t) => {
72
- const r = e.filter((n) => It(n, t));
68
+ }, Pe = (e) => typeof e == "object" && "geom" in e && "render" in e, Ce = (e) => {
69
+ const t = dt(e);
70
+ return t instanceof Xe ? t : null;
71
+ }, It = (e, t) => {
72
+ const r = e.filter((n) => Nt(n, t));
73
73
  return r.length === e.length ? e : r;
74
- }, It = (e, t) => e.kind === "annotation" ? st(t.annotations, e.id) !== null : e.kind === "observations" ? ue(t.layers, e.layerId) !== void 0 : e.kind === "layer" && e.layerId !== void 0 ? ue(t.layers, e.layerId) !== void 0 : !0, pe = [], wt = () => ce((e) => ({
75
- selection: pe,
76
- setSelection: (t) => e((r) => Nt(r.selection, t) ? r : { selection: t }),
77
- clearSelection: () => e((t) => t.selection.length === 0 ? t : { selection: pe })
78
- })), Nt = (e, t) => e === t ? !0 : e.length !== t.length ? !1 : e.every((r, n) => {
74
+ }, Nt = (e, t) => e.kind === "annotation" ? ot(t.annotations, e.id) !== null : e.kind === "observations" ? me(t.layers, e.layerId) !== void 0 : e.kind === "layer" && e.layerId !== void 0 ? me(t.layers, e.layerId) !== void 0 : !0, ve = [], wt = () => le((e) => ({
75
+ selection: ve,
76
+ setSelection: (t) => e((r) => Pt(r.selection, t) ? r : { selection: t }),
77
+ clearSelection: () => e((t) => t.selection.length === 0 ? t : { selection: ve })
78
+ })), Pt = (e, t) => e === t ? !0 : e.length !== t.length ? !1 : e.every((r, n) => {
79
79
  const s = t[n];
80
80
  return s !== void 0 && Qe(r, s);
81
- }), Pt = 5, Ct = (e) => {
82
- if (!Re) return {
81
+ }), Ct = 5, Dt = (e) => {
82
+ if (!Ne) return {
83
83
  emit: () => {
84
84
  },
85
- subscribe: () => Dt,
85
+ subscribe: () => qt,
86
86
  getLastTrigger: () => null,
87
87
  getLastCompile: () => null,
88
88
  getCacheStats: () => e.getCacheStats()
@@ -104,7 +104,7 @@ var Gt = class extends ut {
104
104
  getLastCompile: () => e.getLastCompile(),
105
105
  getCacheStats: () => e.getCacheStats()
106
106
  };
107
- }, Lt = () => ce((e) => ({
107
+ }, Lt = () => le((e) => ({
108
108
  lastCompile: null,
109
109
  history: [],
110
110
  nextId: 1,
@@ -113,20 +113,20 @@ var Gt = class extends ut {
113
113
  if (n.lastSnapshot === r) return n;
114
114
  const s = {
115
115
  id: n.nextId,
116
- label: qt(t),
116
+ label: kt(t),
117
117
  stages: r.stages,
118
118
  stageDurationsMs: r.stageDurationsMs,
119
119
  durationMs: r.durationMs
120
120
  };
121
121
  return {
122
122
  lastCompile: s,
123
- history: _t(n.history, s, Pt),
123
+ history: _t(n.history, s, Ct),
124
124
  nextId: n.nextId + 1,
125
125
  lastSnapshot: r
126
126
  };
127
127
  })
128
- })), Dt = () => {
129
- }, qt = (e) => {
128
+ })), qt = () => {
129
+ }, kt = (e) => {
130
130
  switch (e.kind) {
131
131
  case "init":
132
132
  return "init";
@@ -141,10 +141,10 @@ var Gt = class extends ut {
141
141
  const n = e.length >= r ? e.length - (r - 1) : 0;
142
142
  return [...e.slice(n), t];
143
143
  };
144
- function ve(e) {
145
- const t = e.filter(Ne), r = /* @__PURE__ */ new Set([...Object.keys(We), ...t.map((l) => l.geom)]), n = [], s = /* @__PURE__ */ new Set();
144
+ function ye(e) {
145
+ const t = e.filter(Pe), r = /* @__PURE__ */ new Set([...Object.keys(Be), ...t.map((l) => l.geom)]), n = [], s = /* @__PURE__ */ new Set();
146
146
  for (const l of e) {
147
- const d = Pe(l);
147
+ const d = Ce(l);
148
148
  d === null || r.has(d.type) || s.has(d.type) || (s.add(d.type), n.push({
149
149
  kind: "userInput",
150
150
  severity: "error",
@@ -180,12 +180,12 @@ function ve(e) {
180
180
  },
181
181
  suggestion: `Keep a single render-only override for ('${l}', '${d}').`
182
182
  });
183
- return a.push(...Ft(e)), {
183
+ return a.push(...Kt(e)), {
184
184
  errors: n,
185
185
  warnings: a
186
186
  };
187
187
  }
188
- function kt(e, t) {
188
+ function $t(e, t) {
189
189
  const { coordSystem: r, layers: n } = e, s = /* @__PURE__ */ new Set(), i = [];
190
190
  for (const a of n)
191
191
  t(a.geom, r.type) !== null || s.has(a.geom) || (s.add(a.geom), i.push({
@@ -201,12 +201,12 @@ function kt(e, t) {
201
201
  }));
202
202
  return i;
203
203
  }
204
- function $t(e, t) {
204
+ function Ht(e, t) {
205
205
  const { coordSystem: r, layers: n } = e, s = /* @__PURE__ */ new Set(), i = [];
206
206
  for (const a of n) {
207
207
  if (a.interactive === !1 || a.spatialKind !== "renderHitTest" || s.has(a.geom)) continue;
208
208
  const l = t(a.geom, r.type);
209
- l === null || l.hitTest || te(l) || (s.add(a.geom), i.push({
209
+ l === null || l.hitTest || re(l) || (s.add(a.geom), i.push({
210
210
  kind: "userInput",
211
211
  severity: "warning",
212
212
  code: "MISSING_RENDER_HIT_TEST",
@@ -220,7 +220,7 @@ function $t(e, t) {
220
220
  }
221
221
  return i;
222
222
  }
223
- function Ht(e) {
223
+ function xt(e) {
224
224
  const t = /* @__PURE__ */ new Set(), r = [];
225
225
  for (const n of e.layers) {
226
226
  const s = n.identityKey;
@@ -238,12 +238,12 @@ function Ht(e) {
238
238
  }
239
239
  return r;
240
240
  }
241
- function xt(e, t) {
241
+ function Mt(e, t) {
242
242
  const { coordSystem: r, layers: n } = e, s = /* @__PURE__ */ new Set(), i = [];
243
243
  for (const a of n) {
244
244
  if (a.interactive === !1 || a.spatialKind !== "renderHitTest" || s.has(a.geom)) continue;
245
245
  const l = t(a.geom, r.type);
246
- l === null || !l.hitTest || !te(l) || (s.add(a.geom), i.push({
246
+ l === null || !l.hitTest || !re(l) || (s.add(a.geom), i.push({
247
247
  kind: "userInput",
248
248
  severity: "warning",
249
249
  code: "CONFLICTING_RENDER_HIT_TEST",
@@ -257,7 +257,7 @@ function xt(e, t) {
257
257
  }
258
258
  return i;
259
259
  }
260
- function Mt(e, t) {
260
+ function At(e, t) {
261
261
  const r = /* @__PURE__ */ new Set(), n = [];
262
262
  for (const s of e.layers)
263
263
  s.interactive !== !1 && (s.spatialKind !== "renderHitTest" || r.has(s.geom) || t.hasCapability(s.geom) || (r.add(s.geom), n.push({
@@ -278,7 +278,7 @@ function Ot(e, t) {
278
278
  for (const a of n) {
279
279
  if (a.interactive === !1 || a.spatialKind === "renderHitTest" || s.has(a.geom)) continue;
280
280
  const l = t(a.geom, r.type);
281
- l === null || !te(l) || (s.add(a.geom), i.push({
281
+ l === null || !re(l) || (s.add(a.geom), i.push({
282
282
  kind: "userInput",
283
283
  severity: "warning",
284
284
  code: "LIVE_RENDER_REQUIRES_RENDER_HIT_TEST",
@@ -292,9 +292,9 @@ function Ot(e, t) {
292
292
  }
293
293
  return i;
294
294
  }
295
- function At(e, t) {
295
+ function Bt(e, t) {
296
296
  let r;
297
- return e.layers.flatMap((n, s) => te(t(n.geom, e.coordSystem.type)) ? Bt(n) ? (r ??= we().readers(e), (r.geom(n).get("overpaint", void 0, "hovered")?.length ?? 0) === 0 ? [] : [{
297
+ return e.layers.flatMap((n, s) => re(t(n.geom, e.coordSystem.type)) ? Ft(n) ? (r ??= we().readers(e), (r.geom(n).get("overpaint", void 0, "hovered")?.length ?? 0) === 0 ? [] : [{
298
298
  kind: "userInput",
299
299
  severity: "warning",
300
300
  code: "INVALID_STYLE_RULE",
@@ -307,11 +307,11 @@ function At(e, t) {
307
307
  suggestion: "Remove the hovered overpaint, or paint the hover treatment in the geom's live render."
308
308
  }]) : [] : []);
309
309
  }
310
- var Bt = (e) => [e.styles.defaults, e.styles.overrides].some((t) => t.some((r) => r.state === "hovered" && (r.declarations.overpaint?.length ?? 0) > 0));
311
- function Ft(e) {
310
+ var Ft = (e) => [e.styles.defaults, e.styles.overrides].some((t) => t.some((r) => r.state === "hovered" && (r.declarations.overpaint?.length ?? 0) > 0));
311
+ function Kt(e) {
312
312
  const t = /* @__PURE__ */ new Set(), r = [];
313
313
  for (const n of e) {
314
- const s = Pe(n);
314
+ const s = Ce(n);
315
315
  s === null || t.has(s.type) || s.dataLabelCoordTypes.length === 0 || s.getDataLabelPlacements !== void 0 || (t.add(s.type), r.push({
316
316
  kind: "userInput",
317
317
  severity: "warning",
@@ -326,65 +326,65 @@ function Ft(e) {
326
326
  }
327
327
  return r;
328
328
  }
329
- var Kt = (e) => ce((t) => ({
329
+ var zt = (e) => le((t) => ({
330
330
  scene: e,
331
331
  setScene: (r) => t((n) => n.scene === r ? n : { scene: r })
332
332
  })), Ut = ({ spec: e, data: t, colorScheme: r, plugins: n, theme: s, resolveRenderer: i, anchorResolver: a, onSpecChange: l, onError: d, onWarnings: g }) => {
333
- const b = J(l), C = J(d), G = J(g), [{ session: m, compileBus: h, findGeom: T }] = S(() => {
334
- const o = tt({
333
+ const b = Q(l), C = Q(d), G = Q(g), [{ session: m, compileBus: h, findGeom: T }] = S(() => {
334
+ const o = rt({
335
335
  plugins: n,
336
336
  theme: s
337
337
  });
338
338
  return {
339
- session: new Xe(o),
340
- compileBus: Ct(o),
339
+ session: new Je(o),
340
+ compileBus: Dt(o),
341
341
  findGeom: (u) => o.findGeom(u)
342
342
  };
343
- }), [p] = S(() => {
344
- const o = ve(n ?? []), u = ve(s?.plugins ?? []);
343
+ }), [f] = S(() => {
344
+ const o = ye(n ?? []), u = ye(s?.plugins ?? []);
345
345
  return {
346
346
  errors: [...u.errors, ...o.errors],
347
347
  warnings: [...u.warnings, ...o.warnings]
348
348
  };
349
- }), x = he(null), [L] = S(zt), E = he(null), y = f((o) => p.errors.length === 0 ? o : [...p.errors, ...o ?? []], [p]), k = f((o) => {
349
+ }), x = ge(null), [D] = S(Wt), E = ge(null), y = p((o) => f.errors.length === 0 ? o : [...f.errors, ...o ?? []], [f]), _ = p((o) => {
350
350
  if (!o.ok) return o.errors;
351
351
  if (E.current) E.current.getState().setScene(o.scene);
352
352
  else {
353
- const u = Kt(o.scene);
354
- u.subscribe(L.notify), E.current = u, L.notify();
353
+ const u = zt(o.scene);
354
+ u.subscribe(D.notify), E.current = u, D.notify();
355
355
  }
356
356
  return null;
357
- }, [L]), [z, I] = S(() => {
357
+ }, [D]), [U, I] = S(() => {
358
358
  const o = m.compile({
359
359
  spec: e,
360
360
  data: t,
361
361
  colorScheme: r
362
362
  });
363
- return x.current = o, y(k(o));
364
- }), w = f((o) => o.ok ? [
363
+ return x.current = o, y(_(o));
364
+ }), N = p((o) => o.ok ? [
365
365
  ...o.warnings,
366
- ...kt(o.scene, i),
367
366
  ...$t(o.scene, i),
368
- ...Ht(o.scene),
369
- ...xt(o.scene, i),
367
+ ...Ht(o.scene, i),
368
+ ...xt(o.scene),
369
+ ...Mt(o.scene, i),
370
370
  ...Ot(o.scene, i),
371
- ...At(o.scene, i),
372
- ...Mt(o.scene, a)
373
- ] : o.warnings, [i, a]), N = f((o) => {
371
+ ...Bt(o.scene, i),
372
+ ...At(o.scene, a)
373
+ ] : o.warnings, [i, a]), w = p((o) => {
374
374
  o.length !== 0 && (Z(o), C.current?.(o));
375
- }, [C]), P = f((o) => {
375
+ }, [C]), P = p((o) => {
376
376
  o.length !== 0 && (Z(o), G.current?.(o));
377
377
  }, [G]);
378
- _(() => {
378
+ k(() => {
379
379
  const o = x.current;
380
- o && (N([...p.errors, ...o.ok ? [] : o.errors]), P([...p.warnings, ...w(o)]), o.ok && h.emit({ kind: "init" }));
380
+ o && (w([...f.errors, ...o.ok ? [] : o.errors]), P([...f.warnings, ...N(o)]), o.ok && h.emit({ kind: "init" }));
381
381
  }, [
382
382
  h,
383
- N,
383
+ w,
384
384
  P,
385
- p,
386
- w
387
- ]), _(() => {
385
+ f,
386
+ N
387
+ ]), k(() => {
388
388
  const o = m.update({
389
389
  spec: e,
390
390
  data: t,
@@ -392,73 +392,73 @@ var Kt = (e) => ce((t) => ({
392
392
  });
393
393
  if (!o) return;
394
394
  o.committedSpec && b.current?.(o.committedSpec);
395
- const u = k(o.result);
396
- I(y(u)), u && N(u), P(w(o.result)), u || h.emit({ kind: o.hasSpecChange ? "spec" : "data" });
395
+ const u = _(o.result);
396
+ I(y(u)), u && w(u), P(N(o.result)), u || h.emit({ kind: o.hasSpecChange ? "spec" : "data" });
397
397
  }, [
398
398
  e,
399
399
  t,
400
400
  r,
401
401
  m,
402
402
  h,
403
- k,
404
- N,
403
+ _,
404
+ w,
405
405
  P,
406
406
  y,
407
- w,
407
+ N,
408
408
  b
409
409
  ]);
410
- const M = f((o) => {
411
- I((u) => u === null ? u : y(null)), P(w(o));
410
+ const M = p((o) => {
411
+ I((u) => u === null ? u : y(null)), P(N(o));
412
412
  }, [
413
413
  y,
414
414
  P,
415
- w
416
- ]), D = f((o) => {
415
+ N
416
+ ]), L = p((o) => {
417
417
  o.scene && E.current?.getState().setScene(o.scene), o.result && M(o.result), o.command && h.emit({
418
418
  kind: "command",
419
419
  command: o.command
420
- }), o.spec && b.current?.(o.spec), o.errors && N([...o.errors]);
420
+ }), o.spec && b.current?.(o.spec), o.errors && w([...o.errors]);
421
421
  }, [
422
422
  M,
423
423
  h,
424
424
  b,
425
- N
426
- ]), R = f((o) => {
427
- for (const u of o) D(u);
425
+ w
426
+ ]), R = p((o) => {
427
+ for (const u of o) L(u);
428
428
  return o.some((u) => !!u.scene);
429
- }, [D]), W = f((o, u) => {
429
+ }, [L]), W = p((o, u) => {
430
430
  R(m.applyCommand(o, u));
431
- }, [m, R]), Y = f(() => {
431
+ }, [m, R]), V = p(() => {
432
432
  R(m.commit());
433
- }, [m, R]), j = f(() => R(m.undo()), [m, R]), O = f(() => R(m.redo()), [m, R]), $ = f((o) => {
433
+ }, [m, R]), Y = p(() => R(m.undo()), [m, R]), A = p(() => R(m.redo()), [m, R]), $ = p((o) => {
434
434
  const u = m.preview(o).find((Le) => Le.scene)?.scene;
435
435
  return u ? (E.current?.getState().setScene(u), !0) : !1;
436
- }, [m]), V = f(() => {
436
+ }, [m]), j = p(() => {
437
437
  const o = m.scene;
438
438
  o && E.current?.getState().setScene(o);
439
439
  }, [m]), q = H(() => ({
440
440
  stack: m.history,
441
- undo: j,
442
- redo: O
441
+ undo: Y,
442
+ redo: A
443
443
  }), [
444
444
  m,
445
- j,
446
- O
447
- ]), ne = f(() => E.current?.getState().scene ?? null, []);
445
+ Y,
446
+ A
447
+ ]), se = p(() => E.current?.getState().scene ?? null, []);
448
448
  return {
449
449
  store: E.current,
450
450
  dispatch: W,
451
- commit: Y,
451
+ commit: V,
452
452
  paintPreview: $,
453
- clearPreview: V,
453
+ clearPreview: j,
454
454
  history: q,
455
- subscribe: L.subscribe,
456
- getScene: ne,
455
+ subscribe: D.subscribe,
456
+ getScene: se,
457
457
  compileBus: h,
458
- compileErrors: z,
458
+ compileErrors: U,
459
459
  findGeom: T
460
460
  };
461
- }, zt = () => {
461
+ }, Wt = () => {
462
462
  const e = /* @__PURE__ */ new Set();
463
463
  return {
464
464
  subscribe: (t) => (e.add(t), () => {
@@ -466,44 +466,44 @@ var Kt = (e) => ce((t) => ({
466
466
  }),
467
467
  notify: () => e.forEach((t) => t())
468
468
  };
469
- }, Wt = ["cartesian", "polar"], Yt = ({ data: e, spec: t, plugins: r = [], theme: n, glyphs: s, formattingLocale: i, handleRef: a, onSpecChange: l, onError: d, onWarnings: g, colorScheme: b = "light", children: C }) => {
470
- const G = Xt(i, g), [m] = S(() => n), [h] = S(() => _e(n?.glyphs, s)), T = m?.colorScheme ?? b, [p] = S(() => qe([...m?.plugins ?? [], ...r].filter(Ne)));
471
- Vt(p, h);
472
- const x = mt(), [L] = S(() => et(r)), [E] = S(() => rt(r)), [y] = S(() => wt()), [k] = S(() => xe()), z = H(() => we({ colorScheme: T }), [T]), { store: I, dispatch: w, commit: N, paintPreview: P, clearPreview: M, history: D, subscribe: R, getScene: W, compileBus: Y, compileErrors: j, findGeom: O } = Ut({
469
+ }, Vt = ["cartesian", "polar"], Yt = ({ data: e, spec: t, plugins: r = [], theme: n, glyphs: s, formattingLocale: i, handleRef: a, onSpecChange: l, onError: d, onWarnings: g, colorScheme: b = "light", children: C }) => {
470
+ const G = Jt(i, g), [m] = S(() => n), [h] = S(() => Ue(n?.glyphs, s)), T = m?.colorScheme ?? b, [f] = S(() => Oe([...m?.plugins ?? [], ...r].filter(Pe)));
471
+ Xt(f, h);
472
+ const x = ht(), [D] = S(() => tt(r)), [E] = S(() => nt(r)), [y] = S(() => wt()), [_] = S(() => qe()), U = H(() => we({ colorScheme: T }), [T]), { store: I, dispatch: N, commit: w, paintPreview: P, clearPreview: M, history: L, subscribe: R, getScene: W, compileBus: V, compileErrors: Y, findGeom: A } = Ut({
473
473
  spec: t,
474
474
  data: e,
475
475
  colorScheme: T,
476
476
  plugins: r,
477
477
  theme: m,
478
- resolveRenderer: p,
479
- anchorResolver: L,
478
+ resolveRenderer: f,
479
+ anchorResolver: D,
480
480
  onSpecChange: l,
481
481
  onError: d,
482
482
  onWarnings: g
483
483
  });
484
- _(() => {
484
+ k(() => {
485
485
  if (I)
486
- return I.subscribe((q, ne) => {
487
- if (q.scene.spec === ne.scene.spec) return;
486
+ return I.subscribe((q, se) => {
487
+ if (q.scene.spec === se.scene.spec) return;
488
488
  const { selection: o, setSelection: u } = y.getState();
489
- o.length !== 0 && u(Rt(o, q.scene.spec));
489
+ o.length !== 0 && u(It(o, q.scene.spec));
490
490
  });
491
491
  }, [I, y]);
492
492
  const $ = H(() => ({
493
- dispatch: w,
494
- commit: N,
493
+ dispatch: N,
494
+ commit: w,
495
495
  paintPreview: P,
496
496
  clearPreview: M
497
497
  }), [
498
- w,
499
498
  N,
499
+ w,
500
500
  P,
501
501
  M
502
502
  ]);
503
- ht(a, () => ({
503
+ gt(a, () => ({
504
504
  commands: $,
505
- undo: D.undo,
506
- redo: D.redo,
505
+ undo: L.undo,
506
+ redo: L.redo,
507
507
  subscribe: R,
508
508
  getScene: W,
509
509
  formattingLocale: G,
@@ -513,58 +513,58 @@ var Kt = (e) => ce((t) => ({
513
513
  canPlaceDataLabels: E.hasCapability,
514
514
  canFormatDataLabelsAsPercentages: E.hasPercentageFormat,
515
515
  getGlyphs: () => h,
516
- getPointSymbols: (q) => p("point", q)?.symbols
516
+ getPointSymbols: (q) => f("point", q)?.symbols
517
517
  }), [
518
518
  $,
519
- D,
519
+ L,
520
520
  R,
521
521
  W,
522
522
  G,
523
523
  y,
524
524
  E,
525
525
  h,
526
- p
526
+ f
527
527
  ]);
528
- const V = H(() => I ? {
528
+ const j = H(() => I ? {
529
529
  chartId: x,
530
530
  store: I,
531
531
  selectionStore: y,
532
- targetBoundaryStore: k,
532
+ targetBoundaryStore: _,
533
533
  commands: $,
534
- history: D,
534
+ history: L,
535
535
  formattingLocale: G,
536
- compileBus: Y,
536
+ compileBus: V,
537
537
  colorScheme: T,
538
- styleResolver: z,
539
- anchorResolver: L,
540
- findGeom: O
538
+ styleResolver: U,
539
+ anchorResolver: D,
540
+ findGeom: A
541
541
  } : null, [
542
542
  x,
543
543
  I,
544
544
  y,
545
- k,
545
+ _,
546
546
  $,
547
- D,
547
+ L,
548
548
  G,
549
- Y,
549
+ V,
550
550
  T,
551
- z,
552
- L,
553
- O
551
+ U,
552
+ D,
553
+ A
554
554
  ]);
555
- return /* @__PURE__ */ c(Gt, {
556
- forcedErrors: j,
555
+ return /* @__PURE__ */ c(Rt, {
556
+ forcedErrors: Y,
557
557
  onError: d,
558
558
  resetKeys: [t, e],
559
- children: V ? /* @__PURE__ */ c(Be.Provider, {
560
- value: V,
561
- children: /* @__PURE__ */ c(Ae, {
562
- value: p,
563
- children: /* @__PURE__ */ c(Ue, {
559
+ children: j ? /* @__PURE__ */ c(ze.Provider, {
560
+ value: j,
561
+ children: /* @__PURE__ */ c(Ke, {
562
+ value: f,
563
+ children: /* @__PURE__ */ c(Fe, {
564
564
  value: E,
565
565
  children: /* @__PURE__ */ c(F, {
566
566
  shapes: m?.shapes,
567
- children: /* @__PURE__ */ c(Me, {
567
+ children: /* @__PURE__ */ c($e, {
568
568
  glyphs: h,
569
569
  children: C
570
570
  })
@@ -573,16 +573,16 @@ var Kt = (e) => ce((t) => ({
573
573
  })
574
574
  }) : null
575
575
  });
576
- }, jt = (e, t) => (e ?? []).filter((r) => !ae(r) && !t.has(r)), Vt = (e, t) => {
577
- _(() => {
578
- if (!Re) return;
576
+ }, jt = (e, t) => (e ?? []).filter((r) => !ce(r) && !t.has(r)), Xt = (e, t) => {
577
+ k(() => {
578
+ if (!Ne) return;
579
579
  const r = new Set(t.map(({ name: n }) => n));
580
- for (const n of Wt) for (const s of jt(e("point", n)?.symbols, r)) console.warn(`[graphy] The ${n} point renderer lists "${s}", but no glyph has that name. The shape menu offers it, and SymbolFigure draws the first listed symbol in its place.`);
580
+ for (const n of Vt) for (const s of jt(e("point", n)?.symbols, r)) console.warn(`[graphy] The ${n} point renderer lists "${s}", but no glyph has that name. The shape menu offers it, and SymbolFigure draws the first listed symbol in its place.`);
581
581
  }, [e, t]);
582
- }, Xt = (e, t) => {
583
- const r = J(t);
584
- return _(() => {
585
- if (e === void 0 || ot(e) !== void 0) return;
582
+ }, Jt = (e, t) => {
583
+ const r = Q(t);
584
+ return k(() => {
585
+ if (e === void 0 || it(e) !== void 0) return;
586
586
  const n = [{
587
587
  severity: "warning",
588
588
  kind: "userInput",
@@ -590,10 +590,10 @@ var Kt = (e) => ce((t) => ({
590
590
  message: `formattingLocale '${e}' is not a tag Intl can format in, so the chart formats in ${je}.`
591
591
  }];
592
592
  Z(n), r.current?.(n);
593
- }, [e, r]), e === void 0 ? void 0 : Ze(e);
593
+ }, [e, r]), e === void 0 ? void 0 : et(e);
594
594
  };
595
595
  function _n({ theme: e, glyphs: t, ...r } = {}) {
596
- const n = nt(r);
596
+ const n = st(r);
597
597
  return {
598
598
  ...n,
599
599
  GraphProvider: (i) => /* @__PURE__ */ c(Yt, {
@@ -609,7 +609,7 @@ var B = (e, t) => {
609
609
  if (!e.endsWith("%")) return null;
610
610
  const r = Number.parseFloat(e);
611
611
  return Number.isFinite(r) ? r / 100 * t : null;
612
- }, kn = ({ x: e, y: t, width: r, height: n }, s) => {
612
+ }, $n = ({ x: e, y: t, width: r, height: n }, s) => {
613
613
  const i = B(e, s.width), a = B(t, s.height), l = B(r, s.width), d = B(n, s.height);
614
614
  return i === null || a === null || l === null || d === null ? null : {
615
615
  x: i,
@@ -618,8 +618,8 @@ var B = (e, t) => {
618
618
  height: d
619
619
  };
620
620
  }, Qt = ({ animateTransitions: e, cx: t, cy: r, r: n, effects: s, ...i }) => {
621
- const a = U(s);
622
- return e ? /* @__PURE__ */ c(re.circle, {
621
+ const a = z(s);
622
+ return e ? /* @__PURE__ */ c(ne.circle, {
623
623
  initial: !1,
624
624
  animate: {
625
625
  cx: t,
@@ -636,9 +636,9 @@ var B = (e, t) => {
636
636
  style: a,
637
637
  ...i
638
638
  });
639
- }, Jt = ({ animateTransitions: e, x1: t, y1: r, x2: n, y2: s, effects: i, ...a }) => {
640
- const l = U(i);
641
- return e ? /* @__PURE__ */ c(re.line, {
639
+ }, Zt = ({ animateTransitions: e, x1: t, y1: r, x2: n, y2: s, effects: i, ...a }) => {
640
+ const l = z(i);
641
+ return e ? /* @__PURE__ */ c(ne.line, {
642
642
  initial: !1,
643
643
  animate: {
644
644
  x1: t,
@@ -657,9 +657,9 @@ var B = (e, t) => {
657
657
  style: l,
658
658
  ...a
659
659
  });
660
- }, Zt = ({ animateTransitions: e, x: t, y: r, width: n, height: s, rx: i, ry: a, effects: l, ...d }) => {
661
- const g = U(l);
662
- return e ? /* @__PURE__ */ c(re.rect, {
660
+ }, er = ({ animateTransitions: e, x: t, y: r, width: n, height: s, rx: i, ry: a, effects: l, ...d }) => {
661
+ const g = z(l);
662
+ return e ? /* @__PURE__ */ c(ne.rect, {
663
663
  initial: !1,
664
664
  animate: {
665
665
  attrX: t,
@@ -684,9 +684,9 @@ var B = (e, t) => {
684
684
  style: g,
685
685
  ...d
686
686
  });
687
- }, er = ({ animateTransitions: e, d: t, source: r, effects: n, ...s }) => {
688
- const i = U(n);
689
- return e ? /* @__PURE__ */ c(tr, {
687
+ }, tr = ({ animateTransitions: e, d: t, source: r, effects: n, ...s }) => {
688
+ const i = z(n);
689
+ return e ? /* @__PURE__ */ c(rr, {
690
690
  d: t,
691
691
  source: r,
692
692
  style: i,
@@ -696,15 +696,18 @@ var B = (e, t) => {
696
696
  style: i,
697
697
  ...s
698
698
  });
699
- }, $n = (e) => {
700
- const { Circle: t } = ee(), { symbol: r, ...n } = e;
701
- return r !== void 0 && r !== "circle" ? /* @__PURE__ */ c("g", {
702
- style: U(e.effects),
699
+ }, Hn = (e) => {
700
+ const { Circle: t } = te(), { animateTransitions: r } = ee(), { symbol: n, ...s } = e, i = {
701
+ ...s,
702
+ animateTransitions: r
703
+ };
704
+ return n !== void 0 && n !== "circle" ? /* @__PURE__ */ c("g", {
705
+ style: z(e.effects),
703
706
  "data-testid": e["data-testid"],
704
- children: /* @__PURE__ */ c(Oe, {
705
- symbol: r,
706
- cx: ye(e.cx),
707
- cy: ye(e.cy),
707
+ children: /* @__PURE__ */ c(xe, {
708
+ symbol: n,
709
+ cx: Se(e.cx),
710
+ cy: Se(e.cy),
708
711
  size: e.r * 2,
709
712
  fill: e.fill ?? "currentColor",
710
713
  fillOpacity: e.fillOpacity,
@@ -712,62 +715,69 @@ var B = (e, t) => {
712
715
  stroke: e.stroke,
713
716
  strokeOpacity: e.strokeOpacity,
714
717
  strokeWidth: e.strokeWidth,
715
- motion: e.animateTransitions ? {
718
+ motion: r ? {
716
719
  transition: K,
717
720
  intro: !1,
718
721
  fadesIn: !1
719
722
  } : null
720
723
  })
721
- }) : t === void 0 ? Qt(n) : /* @__PURE__ */ c(F, { children: /* @__PURE__ */ c(t, { ...n }) });
722
- }, Hn = (e) => {
723
- const { Line: t } = ee();
724
- return t === void 0 ? Jt(e) : /* @__PURE__ */ c(F, { children: /* @__PURE__ */ c(t, { ...e }) });
725
- }, xn = ({ cornerRadius: e, ...t }) => {
726
- const { Rect: r } = ee(), n = Ie()?.size ?? null, s = Fe(), i = {
724
+ }) : t === void 0 ? Qt(i) : /* @__PURE__ */ c(F, { children: /* @__PURE__ */ c(t, { ...i }) });
725
+ }, xn = (e) => {
726
+ const { Line: t } = te(), { animateTransitions: r } = ee(), n = {
727
+ ...e,
728
+ animateTransitions: r
729
+ };
730
+ return t === void 0 ? Zt(n) : /* @__PURE__ */ c(F, { children: /* @__PURE__ */ c(t, { ...n }) });
731
+ }, Mn = ({ cornerRadius: e, ...t }) => {
732
+ const { Rect: r } = te(), n = Re()?.size ?? null, s = ke(), { animateTransitions: i } = ee(), a = {
727
733
  ...t,
728
- ...rr(e, t, n, s)
734
+ animateTransitions: i,
735
+ ...nr(e, t, n, s)
729
736
  };
730
- return r === void 0 ? Zt(i) : /* @__PURE__ */ c(F, { children: /* @__PURE__ */ c(r, { ...i }) });
731
- }, Mn = (e) => {
732
- const { Path: t } = ee();
733
- return t === void 0 ? er(e) : /* @__PURE__ */ c(F, { children: /* @__PURE__ */ c(t, { ...e }) });
734
- }, ye = (e) => typeof e == "number" ? `${e}px` : e, tr = ({ d: e, source: t, ...r }) => {
735
- const n = He(e, K, t);
736
- return /* @__PURE__ */ c(re.path, {
737
+ return r === void 0 ? er(a) : /* @__PURE__ */ c(F, { children: /* @__PURE__ */ c(r, { ...a }) });
738
+ }, An = (e) => {
739
+ const { Path: t } = te(), { animateTransitions: r } = ee(), n = {
740
+ ...e,
741
+ animateTransitions: r
742
+ };
743
+ return t === void 0 ? tr(n) : /* @__PURE__ */ c(F, { children: /* @__PURE__ */ c(t, { ...n }) });
744
+ }, Se = (e) => typeof e == "number" ? `${e}px` : e, rr = ({ d: e, source: t, ...r }) => {
745
+ const n = _e(e, K, t);
746
+ return /* @__PURE__ */ c(ne.path, {
737
747
  d: n,
738
748
  ...r
739
749
  });
740
- }, rr = (e, t, r, n) => {
750
+ }, nr = (e, t, r, n) => {
741
751
  if (e === void 0) return {};
742
- const s = it(e);
752
+ const s = at(e);
743
753
  if (s === void 0) return {};
744
- const i = nr(t, r, n);
754
+ const i = sr(t, r, n);
745
755
  if (i === null)
746
- return s === "full" ? {} : be(me({ cornerRadius: s }), n);
747
- const a = Math.min(me({
756
+ return s === "full" ? {} : Te(he({ cornerRadius: s }), n);
757
+ const a = Math.min(he({
748
758
  cornerRadius: s,
749
759
  box: i
750
760
  }), Math.min(i.width, i.height) / 2);
751
- return be(a, n);
752
- }, nr = (e, t, r) => {
753
- const n = Se(e.width, t?.width, r.x), s = Se(e.height, t?.height, r.y);
761
+ return Te(a, n);
762
+ }, sr = (e, t, r) => {
763
+ const n = be(e.width, t?.width, r.x), s = be(e.height, t?.height, r.y);
754
764
  return n === null || s === null ? null : {
755
765
  width: n,
756
766
  height: s
757
767
  };
758
- }, Se = (e, t, r) => {
768
+ }, be = (e, t, r) => {
759
769
  if (typeof e == "number") return Number.isFinite(e) ? Math.abs(e) * r : null;
760
770
  if (t === void 0) return null;
761
771
  const n = B(e, t);
762
772
  return n === null ? null : Math.abs(n);
763
- }, be = (e, t) => t.x <= 0 || t.y <= 0 ? {
773
+ }, Te = (e, t) => t.x <= 0 || t.y <= 0 ? {
764
774
  rx: 0,
765
775
  ry: 0
766
776
  } : {
767
777
  rx: e / t.x,
768
778
  ry: e / t.y
769
779
  }, On = ({ symbol: e, size: t, fill: r, fillOpacity: n, stroke: s, strokeOpacity: i, strokeWidth: a }) => {
770
- const l = ze(), d = Ke(), g = De((G) => G.coordSystem.type), b = sr(e, d("point", g)?.symbols ?? [], l), C = {
780
+ const l = Ae(), d = Ye(), g = Ve((G) => G.coordSystem.type), b = or(e, d("point", g)?.symbols ?? [], l), C = {
771
781
  size: t,
772
782
  fill: r,
773
783
  fillOpacity: n,
@@ -775,21 +785,21 @@ var B = (e, t) => {
775
785
  strokeOpacity: i,
776
786
  strokeWidth: a
777
787
  };
778
- return ae(b) ? /* @__PURE__ */ c("path", {
779
- d: Je(b, t),
788
+ return ce(b) ? /* @__PURE__ */ c("path", {
789
+ d: Ze(b, t),
780
790
  fill: r,
781
791
  fillOpacity: n,
782
792
  stroke: s,
783
793
  strokeOpacity: i,
784
794
  strokeWidth: a,
785
795
  strokeLinejoin: "round"
786
- }) : /* @__PURE__ */ c(ke, {
796
+ }) : /* @__PURE__ */ c(Me, {
787
797
  symbol: b,
788
798
  glyphs: l,
789
799
  ...C
790
800
  });
791
- }, sr = (e, t, r) => ct(e) || t.includes(e) || !ae(e) && r.has(e) ? e : t[0] ?? "circle", An = ({ children: e, ...t }) => {
792
- const r = Ie()?.size ?? null;
801
+ }, or = (e, t, r) => lt(e) || t.includes(e) || !ce(e) && r.has(e) ? e : t[0] ?? "circle", Bn = ({ children: e, ...t }) => {
802
+ const r = Re()?.size ?? null;
793
803
  return /* @__PURE__ */ c("svg", {
794
804
  viewBox: "0 0 1 1",
795
805
  preserveAspectRatio: "none",
@@ -797,14 +807,14 @@ var B = (e, t) => {
797
807
  height: "100%",
798
808
  pointerEvents: "none",
799
809
  ...t,
800
- children: /* @__PURE__ */ c(Ge, {
810
+ children: /* @__PURE__ */ c(Ie, {
801
811
  size: r,
802
812
  space: "unit",
803
813
  children: e
804
814
  })
805
815
  });
806
- }, Bn = ({ box: e, children: t }) => {
807
- const r = $e(), n = r === null ? null : r.width * (e.x1 - e.x0), s = r === null ? null : r.height * (e.y1 - e.y0), i = H(() => n === null || s === null ? null : {
816
+ }, Fn = ({ box: e, children: t }) => {
817
+ const r = He(), n = r === null ? null : r.width * (e.x1 - e.x0), s = r === null ? null : r.height * (e.y1 - e.y0), i = H(() => n === null || s === null ? null : {
808
818
  width: n,
809
819
  height: s
810
820
  }, [n, s]);
@@ -815,54 +825,54 @@ var B = (e, t) => {
815
825
  height: X(e.y1 - e.y0),
816
826
  overflow: "hidden",
817
827
  pointerEvents: "none",
818
- children: /* @__PURE__ */ c(Ge, {
828
+ children: /* @__PURE__ */ c(Ie, {
819
829
  size: i,
820
830
  children: t
821
831
  })
822
832
  });
823
- }, or = "drqe3u0", ir = "drqe3u1", ar = "drqe3u2", cr = "drqe3u3", A = "drqe3u4", lr = "drqe3u5", dr = "drqe3u6", ur = "drqe3u7", Q = "drqe3u8", mr = "drqe3u9", hr = "drqe3ua";
824
- var gr = "drqe3uc", fr = "drqe3ud", pr = "drqe3ue", vr = "drqe3uf";
825
- var yr = "drqe3uh", Sr = "drqe3ui", Te = {
833
+ }, ir = "drqe3u0", ar = "drqe3u1", cr = "drqe3u2", lr = "drqe3u3", O = "drqe3u4", dr = "drqe3u5", ur = "drqe3u6", mr = "drqe3u7", J = "drqe3u8", hr = "drqe3u9", gr = "drqe3ua";
834
+ var pr = "drqe3uc", fr = "drqe3ud", vr = "drqe3ue", yr = "drqe3uf";
835
+ var Sr = "drqe3uh", br = "drqe3ui", Ee = {
826
836
  enabled: "drqe3uk drqe3uj",
827
837
  disabled: "drqe3ul drqe3uj"
828
- }, Ee = {
838
+ }, Ge = {
829
839
  ran: "drqe3un drqe3um",
830
840
  dim: "drqe3uo drqe3um"
831
- }, Ce = {
841
+ }, De = {
832
842
  ran: "drqe3uq drqe3up",
833
843
  cached: "drqe3ur drqe3up",
834
844
  untouched: "drqe3us drqe3up"
835
- }, Fn = ({ width: e = 440, style: t, className: r } = {}) => {
836
- const { compileBus: n } = oe(), [s] = S(() => Lt()), [i, a] = S(!1), [l, d] = S(at);
837
- _(() => {
838
- const { recordCompile: h } = s.getState(), T = n.getLastTrigger(), p = n.getLastCompile();
839
- return T && p && h(T, p), n.subscribe(h);
845
+ }, Kn = ({ width: e = 440, style: t, className: r } = {}) => {
846
+ const { compileBus: n } = ie(), [s] = S(() => Lt()), [i, a] = S(!1), [l, d] = S(ct);
847
+ k(() => {
848
+ const { recordCompile: h } = s.getState(), T = n.getLastTrigger(), f = n.getLastCompile();
849
+ return T && f && h(T, f), n.subscribe(h);
840
850
  }, [s, n]);
841
- const g = se(s, (h) => h.lastCompile), b = se(s, (h) => h.history), C = n.getCacheStats(), G = g === null && b.length === 0, m = () => {
851
+ const g = oe(s, (h) => h.lastCompile), b = oe(s, (h) => h.history), C = n.getCacheStats(), G = g === null && b.length === 0, m = () => {
842
852
  d((h) => {
843
853
  const T = !h;
844
- return dt(T), T;
854
+ return ut(T), T;
845
855
  });
846
856
  };
847
857
  return /* @__PURE__ */ v("div", {
848
- className: pt(hr, r),
858
+ className: vt(gr, r),
849
859
  style: {
850
860
  width: e,
851
861
  ...t
852
862
  },
853
863
  children: [
854
864
  /* @__PURE__ */ v("div", {
855
- className: or,
865
+ className: ir,
856
866
  children: [/* @__PURE__ */ v("div", { children: [/* @__PURE__ */ c("div", {
857
- className: ir,
867
+ className: ar,
858
868
  children: "compile cache"
859
869
  }), /* @__PURE__ */ c("div", {
860
- className: pr,
861
- children: G ? "production: stats disabled" : g ? `last: ${g.label} · ${le(g.durationMs)}` : "awaiting first compile…"
870
+ className: vr,
871
+ children: G ? "production: stats disabled" : g ? `last: ${g.label} · ${de(g.durationMs)}` : "awaiting first compile…"
862
872
  })] }), /* @__PURE__ */ c("button", {
863
873
  type: "button",
864
874
  onClick: () => a((h) => !h),
865
- className: vr,
875
+ className: yr,
866
876
  children: i ? "▾" : "▴"
867
877
  })]
868
878
  }),
@@ -871,7 +881,7 @@ var yr = "drqe3uh", Sr = "drqe3ui", Te = {
871
881
  children: [/* @__PURE__ */ v("button", {
872
882
  type: "button",
873
883
  onClick: m,
874
- className: l ? Te.enabled : Te.disabled,
884
+ className: l ? Ee.enabled : Ee.disabled,
875
885
  "aria-pressed": l,
876
886
  children: ["cache ", l ? "enabled" : "disabled"]
877
887
  }), /* @__PURE__ */ c("span", {
@@ -879,53 +889,53 @@ var yr = "drqe3uh", Sr = "drqe3ui", Te = {
879
889
  children: "next compile reflects this toggle"
880
890
  })]
881
891
  }),
882
- !i && !G && /* @__PURE__ */ v(ft, { children: [/* @__PURE__ */ c(br, {
892
+ !i && !G && /* @__PURE__ */ v(ft, { children: [/* @__PURE__ */ c(Tr, {
883
893
  delta: g?.stages,
884
894
  durations: g?.stageDurationsMs,
885
895
  cumulative: C
886
- }), /* @__PURE__ */ c(Tr, { entries: b })] })
896
+ }), /* @__PURE__ */ c(Er, { entries: b })] })
887
897
  ]
888
898
  });
889
- }, br = ({ delta: e, durations: t, cumulative: r }) => /* @__PURE__ */ v("table", {
890
- className: ar,
899
+ }, Tr = ({ delta: e, durations: t, cumulative: r }) => /* @__PURE__ */ v("table", {
900
+ className: cr,
891
901
  children: [/* @__PURE__ */ c("thead", { children: /* @__PURE__ */ v("tr", {
892
- className: yr,
902
+ className: Sr,
893
903
  children: [
894
904
  /* @__PURE__ */ c("th", {
895
- className: cr,
905
+ className: lr,
896
906
  children: "stage"
897
907
  }),
898
908
  /* @__PURE__ */ c("th", {
899
- className: A,
909
+ className: O,
900
910
  children: "time"
901
911
  }),
902
912
  /* @__PURE__ */ c("th", {
903
- className: A,
913
+ className: O,
904
914
  children: "Δ miss"
905
915
  }),
906
916
  /* @__PURE__ */ c("th", {
907
- className: A,
917
+ className: O,
908
918
  children: "Δ hit"
909
919
  }),
910
920
  /* @__PURE__ */ c("th", {
911
- className: A,
921
+ className: O,
912
922
  children: "total miss"
913
923
  }),
914
924
  /* @__PURE__ */ c("th", {
915
- className: A,
925
+ className: O,
916
926
  children: "total hit"
917
927
  })
918
928
  ]
919
- }) }), /* @__PURE__ */ c("tbody", { children: ie.map((n) => {
920
- const s = e?.[n], i = Er(s);
929
+ }) }), /* @__PURE__ */ c("tbody", { children: ae.map((n) => {
930
+ const s = e?.[n], i = Gr(s);
921
931
  return /* @__PURE__ */ v("tr", {
922
- className: gr,
932
+ className: pr,
923
933
  children: [
924
934
  /* @__PURE__ */ v("td", {
925
- className: lr,
935
+ className: dr,
926
936
  children: [
927
937
  /* @__PURE__ */ c("span", {
928
- className: Ce[i],
938
+ className: De[i],
929
939
  "aria-hidden": !0
930
940
  }),
931
941
  " ",
@@ -933,66 +943,66 @@ var yr = "drqe3uh", Sr = "drqe3ui", Te = {
933
943
  ]
934
944
  }),
935
945
  /* @__PURE__ */ c("td", {
936
- className: Q,
937
- children: t === void 0 || i === "untouched" ? "—" : le(t[n])
946
+ className: J,
947
+ children: t === void 0 || i === "untouched" ? "—" : de(t[n])
938
948
  }),
939
949
  /* @__PURE__ */ c("td", {
940
- className: i === "ran" ? Ee.ran : Ee.dim,
950
+ className: i === "ran" ? Ge.ran : Ge.dim,
941
951
  children: s?.misses ?? 0
942
952
  }),
943
953
  /* @__PURE__ */ c("td", {
944
- className: Q,
954
+ className: J,
945
955
  children: s?.hits ?? 0
946
956
  }),
947
957
  /* @__PURE__ */ c("td", {
948
- className: Q,
958
+ className: J,
949
959
  children: r[n].misses
950
960
  }),
951
961
  /* @__PURE__ */ c("td", {
952
- className: Q,
962
+ className: J,
953
963
  children: r[n].hits
954
964
  })
955
965
  ]
956
966
  }, n);
957
967
  }) })]
958
- }), Tr = ({ entries: e }) => e.length === 0 ? null : /* @__PURE__ */ v("div", {
968
+ }), Er = ({ entries: e }) => e.length === 0 ? null : /* @__PURE__ */ v("div", {
959
969
  className: fr,
960
970
  children: [/* @__PURE__ */ c("div", {
961
- className: Sr,
971
+ className: br,
962
972
  children: "recent compiles"
963
973
  }), e.map((t) => {
964
- const r = Gr(t.stages, (i) => i.misses > 0), n = ie.length;
974
+ const r = Rr(t.stages, (i) => i.misses > 0), n = ae.length;
965
975
  return /* @__PURE__ */ v("div", {
966
- className: dr,
976
+ className: ur,
967
977
  children: [
968
978
  /* @__PURE__ */ c("span", {
969
- className: Ce[r === 0 ? "cached" : "ran"],
979
+ className: De[r === 0 ? "cached" : "ran"],
970
980
  "aria-hidden": !0
971
981
  }),
972
982
  /* @__PURE__ */ c("span", {
973
- className: ur,
983
+ className: mr,
974
984
  title: t.label,
975
985
  children: t.label
976
986
  }),
977
987
  /* @__PURE__ */ v("span", {
978
- className: mr,
988
+ className: hr,
979
989
  children: [
980
990
  r,
981
991
  "/",
982
992
  n,
983
993
  " ran · ",
984
- le(t.durationMs)
994
+ de(t.durationMs)
985
995
  ]
986
996
  })
987
997
  ]
988
998
  }, t.id);
989
999
  })]
990
- }), Er = (e) => !e || e.hits === 0 && e.misses === 0 ? "untouched" : e.misses > 0 ? "ran" : "cached", Gr = (e, t) => {
1000
+ }), Gr = (e) => !e || e.hits === 0 && e.misses === 0 ? "untouched" : e.misses > 0 ? "ran" : "cached", Rr = (e, t) => {
991
1001
  let r = 0;
992
- for (const n of ie) t(e[n]) && (r += 1);
1002
+ for (const n of ae) t(e[n]) && (r += 1);
993
1003
  return r;
994
- }, le = (e) => e < 0.1 ? "<0.1ms" : e >= 10 ? `${e.toFixed(0)}ms` : `${e.toFixed(2)}ms`, Kn = () => {
995
- const { history: e } = oe(), { stack: t, undo: r, redo: n } = e, s = f((l) => t.subscribe(l), [t]), i = f(() => t.getSnapshot(), [t]), a = gt(s, i, i);
1004
+ }, de = (e) => e < 0.1 ? "<0.1ms" : e >= 10 ? `${e.toFixed(0)}ms` : `${e.toFixed(2)}ms`, zn = () => {
1005
+ const { history: e } = ie(), { stack: t, undo: r, redo: n } = e, s = p((l) => t.subscribe(l), [t]), i = p(() => t.getSnapshot(), [t]), a = pt(s, i, i);
996
1006
  return H(() => ({
997
1007
  ...a,
998
1008
  undo: r,
@@ -1002,7 +1012,7 @@ var yr = "drqe3uh", Sr = "drqe3ui", Te = {
1002
1012
  r,
1003
1013
  n
1004
1014
  ]);
1005
- }, Rr = /* @__PURE__ */ new Set([
1015
+ }, Ir = /* @__PURE__ */ new Set([
1006
1016
  "button",
1007
1017
  "checkbox",
1008
1018
  "color",
@@ -1015,12 +1025,12 @@ var yr = "drqe3uh", Sr = "drqe3ui", Te = {
1015
1025
  "submit"
1016
1026
  ]), Un = (e, t = {}) => {
1017
1027
  const { target: r, enabled: n = !0 } = t;
1018
- _(() => {
1019
- const s = Ir(r);
1028
+ k(() => {
1029
+ const s = Nr(r);
1020
1030
  if (!n || !s) return;
1021
1031
  const i = (a) => {
1022
- if (!wr(a) || a.defaultPrevented || Nr(a.target)) return;
1023
- const l = Ye(a);
1032
+ if (!wr(a) || a.defaultPrevented || Pr(a.target)) return;
1033
+ const l = We(a);
1024
1034
  if (!l) return;
1025
1035
  const d = e.current;
1026
1036
  d && (l === "undo" ? d.undo() : d.redo()) && a.preventDefault();
@@ -1031,83 +1041,84 @@ var yr = "drqe3uh", Sr = "drqe3ui", Te = {
1031
1041
  r,
1032
1042
  n
1033
1043
  ]);
1034
- }, Ir = (e) => e === void 0 ? window : e !== null && "current" in e ? e.current : e, wr = (e) => "key" in e, Nr = (e) => e instanceof HTMLInputElement ? !Rr.has(e.type) : e instanceof HTMLElement ? e.isContentEditable || e.tagName === "TEXTAREA" : !1, zn = () => {
1035
- const { targetBoundaryStore: e } = oe();
1036
- return se(e, (t) => t.boundary);
1044
+ }, Nr = (e) => e === void 0 ? window : e !== null && "current" in e ? e.current : e, wr = (e) => "key" in e, Pr = (e) => e instanceof HTMLInputElement ? !Ir.has(e.type) : e instanceof HTMLElement ? e.isContentEditable || e.tagName === "TEXTAREA" : !1, Wn = () => {
1045
+ const { targetBoundaryStore: e } = ie();
1046
+ return oe(e, (t) => t.boundary);
1037
1047
  };
1038
1048
  export {
1039
- on as CanvasTextMeasurer,
1040
- Vr as DefaultFooter,
1049
+ fn as CanvasTextMeasurer,
1050
+ Or as DefaultFooter,
1041
1051
  Qt as DefaultGeomCircle,
1042
- Jt as DefaultGeomLine,
1043
- er as DefaultGeomPath,
1044
- Zt as DefaultGeomRect,
1045
- hn as DefaultGrid,
1046
- Yr as DefaultHeader,
1047
- yn as DefaultSwatch,
1048
- tn as DefaultTooltip,
1049
- Fn as DevToolsPanel,
1050
- jr as GRAPH_MODES,
1051
- $n as GeomCircle,
1052
- Hn as GeomLine,
1053
- qr as GeomOverpaint,
1054
- zr as GeomPanelSizeProvider,
1055
- Mn as GeomPath,
1056
- xn as GeomRect,
1057
- Gt as GraphErrorBoundary,
1058
- ge as GraphErrorPanel,
1052
+ Zt as DefaultGeomLine,
1053
+ tr as DefaultGeomPath,
1054
+ er as DefaultGeomRect,
1055
+ mn as DefaultGrid,
1056
+ Hr as DefaultHeader,
1057
+ sn as DefaultSwatch,
1058
+ Rn as DefaultTooltip,
1059
+ Kn as DevToolsPanel,
1060
+ Qr as GRAPH_MODES,
1061
+ Hn as GeomCircle,
1062
+ xn as GeomLine,
1063
+ Fr as GeomOverpaint,
1064
+ _r as GeomPanelSizeProvider,
1065
+ An as GeomPath,
1066
+ Mn as GeomRect,
1067
+ Rt as GraphErrorBoundary,
1068
+ pe as GraphErrorPanel,
1059
1069
  Yt as GraphProvider,
1060
- rn as GraphRenderer,
1061
- Dr as GraphyBadge,
1062
- pn as HoverProvider,
1063
- un as IntlProvider,
1064
- dn as IntroFade,
1065
- Or as IntroWipeClip,
1070
+ tn as GraphRenderer,
1071
+ vn as GraphyBadge,
1072
+ Ar as HoverProvider,
1073
+ Kr as IntlProvider,
1074
+ rn as IntroFade,
1075
+ zr as IntroWipeClip,
1066
1076
  On as SymbolFigure,
1067
- bn as TextMeasurerProvider,
1068
- Wr as ThemeProvider,
1069
- Bn as UnitBoxSvg,
1070
- An as UnitSpaceSvg,
1071
- In as buildDotsEditOutlineShapes,
1077
+ on as TextMeasurerProvider,
1078
+ $r as ThemeProvider,
1079
+ Fn as UnitBoxSvg,
1080
+ Bn as UnitSpaceSvg,
1081
+ Xr as buildDotsEditOutlineShapes,
1072
1082
  _n as createGraphyKit,
1073
- Fr as darkTheme,
1074
- sn as defineGeomRenderer,
1075
- Xr as defineGlyph,
1076
- Sn as getBuiltInEditOutlineShapes,
1077
- mn as lightTheme,
1078
- en as lightenCss,
1079
- Rt as pruneSelection,
1083
+ un as darkTheme,
1084
+ bn as defineGeomRenderer,
1085
+ Br as defineGlyph,
1086
+ pn as getBuiltInEditOutlineShapes,
1087
+ qr as lightTheme,
1088
+ Tn as lightenCss,
1089
+ It as pruneSelection,
1080
1090
  B as readPositionPixels,
1081
- kn as readRectPixels,
1082
- kr as resolveGraphyBadgeVariant,
1083
- xr as resolvePathStroke,
1084
- Cr as scalePointToPanel,
1085
- _r as stampAxisEditTarget,
1086
- Hr as stampGridEditTarget,
1087
- Ur as stampLegendEditTarget,
1088
- Mr as useElementScreenRect,
1089
- cn as useFormattingLocale,
1090
- $r as useGeomHitTest,
1091
- Lr as useGeomHover,
1092
- Br as useGeomPanelSize,
1093
- Jr as useGeomReaderTree,
1094
- Qr as useGeomStyleReader,
1095
- $e as useGeomViewportSize,
1091
+ $n as readRectPixels,
1092
+ Mr as resolveGraphyBadgeVariant,
1093
+ Nn as resolvePathStroke,
1094
+ xr as scalePointToPanel,
1095
+ Wr as stampAxisEditTarget,
1096
+ In as stampGridEditTarget,
1097
+ kr as stampLegendEditTarget,
1098
+ Vr as useElementScreenRect,
1099
+ en as useFormattingLocale,
1100
+ yn as useGeomHitTest,
1101
+ Jr as useGeomHover,
1102
+ dn as useGeomPanelSize,
1103
+ Zr as useGeomReaderTree,
1104
+ Ur as useGeomStyleReader,
1105
+ He as useGeomViewportSize,
1106
+ ee as useGraphAnimation,
1096
1107
  gn as useGraphCommands,
1097
1108
  ln as useGraphHandle,
1098
- Kn as useGraphHistory,
1109
+ zn as useGraphHistory,
1099
1110
  Un as useGraphHistoryShortcuts,
1100
- an as useGraphLocale,
1111
+ En as useGraphLocale,
1101
1112
  Gn as useGraphSelection,
1102
- Ar as useGuidesTakePress,
1103
- vn as useHandleScene,
1104
- Rn as useHoverState,
1105
- Tn as usePaintDefs,
1106
- fn as useResolvedStyle,
1107
- De as useSceneSelector,
1108
- Zr as useStyleReaderTree,
1109
- Kr as useStyleResolver,
1110
- zn as useTargetBoundary,
1111
- nn as useTextMeasurer,
1112
- En as vars
1113
+ Lr as useGuidesTakePress,
1114
+ Sn as useHandleScene,
1115
+ nn as useHoverState,
1116
+ jr as usePaintDefs,
1117
+ hn as useResolvedStyle,
1118
+ Ve as useSceneSelector,
1119
+ Dr as useStyleReaderTree,
1120
+ an as useStyleResolver,
1121
+ Wn as useTargetBoundary,
1122
+ cn as useTextMeasurer,
1123
+ Yr as vars
1113
1124
  };