@graphysdk/react-renderer 1.9.0-beta.1790606620233 → 1.9.0-beta.1790607706146

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,89 +1,89 @@
1
- import { A as xt, At as ge, B as At, Bt, Ct as Ot, Et as F, Ht as Kt, I as Ft, Jt as jt, L as Ut, Lt as Yt, M as Wt, Mt as Y, Nt as he, Pt as Vt, Qt, Rt as pe, Ut as Xt, Vt as zt, a as Jt, an as Zt, cn as er, ct as tr, dn as W, dt as rr, en as ae, fn as fe, gt as nr, h as sr, i as or, in as ar, j as ir, jt as cr, kt as ve, ln as lr, n as dr, nt as ur, on as mr, pn as j, r as gr, rn as hr, rt as pr, s as fr, sn as vr, t as ye, tn as yr, un as Se, ut as Sr, vt as br, w as Er, wt as Tr, yt as Rr, z as Nr } from "./history-chords-sGHetDJP.js";
2
- import { n as qr } from "./theme.contract.css-AyXDNf0F.js";
3
- import { COMPILER_STAGE_KEYS as V, Geom as be, GraphCompilationSession as Ee, areEditTargetsEqual as Te, buildDiagnostic as J, createAnchorResolver as Re, createCompiler as Ne, createDataLabelPlacementResolver as Ce, createSpecBuilder as qe, createStyleResolver as De, findAnnotation as Ge, findLayerById as Z, isCompilerCachingEnabled as Ie, resolveDefinition as we, setCompilerCachingEnabled as ke, toPercent as B } from "@graphysdk/viz-engine";
4
- import { Component as _e, useCallback as f, useEffect as M, useId as Le, useImperativeHandle as Pe, useMemo as H, useRef as ee, useState as b, useSyncExternalStore as $e } from "react";
5
- import { Fragment as He, jsx as c, jsxs as v } from "react/jsx-runtime";
6
- import { useStore as U } from "zustand";
7
- import { motion as ie } from "motion/react";
8
- import { createStore as Q } from "zustand/vanilla";
9
- import Me from "clsx";
10
- import './index.css';var xe = "_1a5iqpb0", Ae = "_1a5iqpb1";
11
- var Be = "_1a5iqpb3", Oe = "_1a5iqpb4", Ke = "_1a5iqpb5";
12
- var te = ({ errors: e }) => {
1
+ import { $t as Bt, A as Ot, At as ge, B as Kt, Bt as Ft, Ct as jt, Et as U, Ht as Ut, I as Yt, Jt as Wt, L as Vt, Lt as Xt, M as Qt, Mt as V, Nt as he, Pt as zt, Qt as Jt, Rt as pe, Ut as Zt, Vt as er, a as tr, an as rr, cn as nr, ct as sr, dn as fe, dt as ar, en as ve, fn as X, gt as or, h as ir, i as cr, in as lr, j as dr, jt as ur, kt as ye, ln as mr, mn as Y, n as gr, nn as hr, nt as pr, on as fr, pn as Se, r as vr, rt as yr, s as Sr, sn as br, t as be, tn as K, tt as Er, un as Tr, ut as Rr, vt as Nr, w as Cr, wt as Gr, yt as qr, z as Dr } from "./history-chords-DtVsr3wh.js";
2
+ import { n as kr } from "./theme.contract.css-AyXDNf0F.js";
3
+ import { COMPILER_STAGE_KEYS as Q, Geom as Ee, GraphCompilationSession as Te, areEditTargetsEqual as Re, buildDiagnostic as ee, createAnchorResolver as Ne, createCompiler as Ce, createDataLabelPlacementResolver as Ge, createSpecBuilder as qe, createStyleResolver as De, findAnnotation as Ie, findLayerById as te, isCompilerCachingEnabled as ke, resolveDefinition as we, setCompilerCachingEnabled as _e, toPercent as B } from "@graphysdk/viz-engine";
4
+ import { Component as Pe, useCallback as f, useEffect as H, useId as Le, useImperativeHandle as $e, useMemo as M, useRef as re, useState as b, useSyncExternalStore as Me } from "react";
5
+ import { Fragment as He, jsx as i, jsxs as v } from "react/jsx-runtime";
6
+ import { useStore as W } from "zustand";
7
+ import { motion as F } from "motion/react";
8
+ import { createStore as z } from "zustand/vanilla";
9
+ import xe from "clsx";
10
+ import './index.css';var Ae = "_1a5iqpb0", Be = "_1a5iqpb1";
11
+ var Oe = "_1a5iqpb3", Ke = "_1a5iqpb4", Fe = "_1a5iqpb5";
12
+ var ne = ({ errors: e }) => {
13
13
  const [t, ...n] = e;
14
14
  return /* @__PURE__ */ v("div", {
15
15
  role: "alert",
16
- className: xe,
16
+ className: Ae,
17
17
  children: [
18
- /* @__PURE__ */ c("strong", {
19
- className: Ae,
18
+ /* @__PURE__ */ i("strong", {
19
+ className: Be,
20
20
  children: "This chart could not be rendered."
21
21
  }),
22
- t && /* @__PURE__ */ c(re, { diagnostic: t }),
23
- n.length > 0 && /* @__PURE__ */ c("ul", {
22
+ t && /* @__PURE__ */ i(se, { diagnostic: t }),
23
+ n.length > 0 && /* @__PURE__ */ i("ul", {
24
24
  className: "_1a5iqpb2",
25
- children: n.map((r, s) => /* @__PURE__ */ c("li", { children: /* @__PURE__ */ c(re, { diagnostic: r }) }, `${r.code}-${s}`))
25
+ children: n.map((r, s) => /* @__PURE__ */ i("li", { children: /* @__PURE__ */ i(se, { diagnostic: r }) }, `${r.code}-${s}`))
26
26
  })
27
27
  ]
28
28
  });
29
- }, re = ({ diagnostic: e }) => /* @__PURE__ */ v("div", {
30
- className: Be,
29
+ }, se = ({ diagnostic: e }) => /* @__PURE__ */ v("div", {
30
+ className: Oe,
31
31
  children: [
32
- /* @__PURE__ */ c("span", {
33
- className: Oe,
32
+ /* @__PURE__ */ i("span", {
33
+ className: Ke,
34
34
  children: e.code
35
35
  }),
36
- /* @__PURE__ */ c("p", {
37
- className: Ke,
36
+ /* @__PURE__ */ i("p", {
37
+ className: Fe,
38
38
  children: e.message
39
39
  }),
40
- e.suggestion && /* @__PURE__ */ c("p", {
40
+ e.suggestion && /* @__PURE__ */ i("p", {
41
41
  className: "_1a5iqpb6",
42
42
  children: e.suggestion
43
43
  })
44
44
  ]
45
45
  });
46
- function Fe(e = [], t = []) {
46
+ function je(e = [], t = []) {
47
47
  return e.length === t.length && e.every((n, r) => Object.is(n, t[r]));
48
48
  }
49
- var je = class extends _e {
49
+ var Ue = class extends Pe {
50
50
  constructor(...e) {
51
51
  super(...e), this.state = { caughtDiagnostic: null };
52
52
  }
53
53
  static getDerivedStateFromError(e) {
54
- return { caughtDiagnostic: J(e) };
54
+ return { caughtDiagnostic: ee(e) };
55
55
  }
56
56
  componentDidCatch(e, t) {
57
- const n = J(e);
58
- j([n]), this.props.onError?.([n]), console.error("Chart render component stack:", t.componentStack);
57
+ const n = ee(e);
58
+ Y([n]), this.props.onError?.([n]), console.error("Chart render component stack:", t.componentStack);
59
59
  }
60
60
  componentDidUpdate(e) {
61
- this.state.caughtDiagnostic && !Fe(e.resetKeys, this.props.resetKeys) && this.setState({ caughtDiagnostic: null });
61
+ this.state.caughtDiagnostic && !je(e.resetKeys, this.props.resetKeys) && this.setState({ caughtDiagnostic: null });
62
62
  }
63
63
  render() {
64
64
  const { caughtDiagnostic: e } = this.state;
65
- if (e) return /* @__PURE__ */ c(te, { errors: [e] });
65
+ if (e) return /* @__PURE__ */ i(ne, { errors: [e] });
66
66
  const { forcedErrors: t, children: n } = this.props;
67
- return t && t.length > 0 ? /* @__PURE__ */ c(te, { errors: t }) : n;
67
+ return t && t.length > 0 ? /* @__PURE__ */ i(ne, { errors: t }) : n;
68
68
  }
69
69
  }, ce = (e) => typeof e == "object" && "geom" in e && "render" in e, le = (e) => {
70
70
  const t = we(e);
71
- return t instanceof be ? t : null;
72
- }, Ue = (e, t) => {
73
- const n = e.filter((r) => Ye(r, t));
71
+ return t instanceof Ee ? t : null;
72
+ }, Ye = (e, t) => {
73
+ const n = e.filter((r) => We(r, t));
74
74
  return n.length === e.length ? e : n;
75
- }, Ye = (e, t) => e.kind === "annotation" ? Ge(t.annotations, e.id) !== null : e.kind === "observations" ? Z(t.layers, e.layerId) !== void 0 : e.kind === "layer" && e.layerId !== void 0 ? Z(t.layers, e.layerId) !== void 0 : !0, ne = [], We = () => Q((e) => ({
76
- selection: ne,
77
- setSelection: (t) => e((n) => Ve(n.selection, t) ? n : { selection: t }),
78
- clearSelection: () => e((t) => t.selection.length === 0 ? t : { selection: ne })
79
- })), Ve = (e, t) => e === t ? !0 : e.length !== t.length ? !1 : e.every((n, r) => {
75
+ }, We = (e, t) => e.kind === "annotation" ? Ie(t.annotations, e.id) !== null : e.kind === "observations" ? te(t.layers, e.layerId) !== void 0 : e.kind === "layer" && e.layerId !== void 0 ? te(t.layers, e.layerId) !== void 0 : !0, ae = [], Ve = () => z((e) => ({
76
+ selection: ae,
77
+ setSelection: (t) => e((n) => Xe(n.selection, t) ? n : { selection: t }),
78
+ clearSelection: () => e((t) => t.selection.length === 0 ? t : { selection: ae })
79
+ })), Xe = (e, t) => e === t ? !0 : e.length !== t.length ? !1 : e.every((n, r) => {
80
80
  const s = t[r];
81
- return s !== void 0 && Te(n, s);
82
- }), Qe = process.env.NODE_ENV !== "production", Xe = 5, ze = (e) => {
81
+ return s !== void 0 && Re(n, s);
82
+ }), Qe = process.env.NODE_ENV !== "production", ze = 5, Je = (e) => {
83
83
  if (!Qe) return {
84
84
  emit: () => {
85
85
  },
86
- subscribe: () => Ze,
86
+ subscribe: () => et,
87
87
  getLastTrigger: () => null,
88
88
  getLastCompile: () => null,
89
89
  getCacheStats: () => e.getCacheStats()
@@ -95,7 +95,7 @@ var je = class extends _e {
95
95
  const s = e.getLastCompile();
96
96
  if (s) {
97
97
  n = r;
98
- for (const i of t) i(r, s);
98
+ for (const c of t) c(r, s);
99
99
  }
100
100
  },
101
101
  subscribe: (r) => (t.add(r), () => {
@@ -105,7 +105,7 @@ var je = class extends _e {
105
105
  getLastCompile: () => e.getLastCompile(),
106
106
  getCacheStats: () => e.getCacheStats()
107
107
  };
108
- }, Je = () => Q((e) => ({
108
+ }, Ze = () => z((e) => ({
109
109
  lastCompile: null,
110
110
  history: [],
111
111
  nextId: 1,
@@ -114,20 +114,20 @@ var je = class extends _e {
114
114
  if (r.lastSnapshot === n) return r;
115
115
  const s = {
116
116
  id: r.nextId,
117
- label: et(t),
117
+ label: tt(t),
118
118
  stages: n.stages,
119
119
  stageDurationsMs: n.stageDurationsMs,
120
120
  durationMs: n.durationMs
121
121
  };
122
122
  return {
123
123
  lastCompile: s,
124
- history: tt(r.history, s, Xe),
124
+ history: rt(r.history, s, ze),
125
125
  nextId: r.nextId + 1,
126
126
  lastSnapshot: n
127
127
  };
128
128
  })
129
- })), Ze = () => {
130
- }, et = (e) => {
129
+ })), et = () => {
130
+ }, tt = (e) => {
131
131
  switch (e.kind) {
132
132
  case "init":
133
133
  return "init";
@@ -138,11 +138,11 @@ var je = class extends _e {
138
138
  case "command":
139
139
  return e.command.metadata.description;
140
140
  }
141
- }, tt = (e, t, n) => {
141
+ }, rt = (e, t, n) => {
142
142
  const r = e.length >= n ? e.length - (n - 1) : 0;
143
143
  return [...e.slice(r), t];
144
144
  };
145
- function rt(e) {
145
+ function nt(e) {
146
146
  const t = e.filter(ce), n = /* @__PURE__ */ new Set([...Object.keys(he), ...t.map((l) => l.geom)]), r = [], s = /* @__PURE__ */ new Set();
147
147
  for (const l of e) {
148
148
  const d = le(l);
@@ -158,19 +158,19 @@ function rt(e) {
158
158
  suggestion: `Add a render half for it: \`defineGeomRenderer(${d.type}Geom, { coord, render })\`, then include it in \`plugins\`.`
159
159
  }));
160
160
  }
161
- const i = /* @__PURE__ */ new Map();
161
+ const c = /* @__PURE__ */ new Map();
162
162
  for (const l of t) {
163
163
  if ("definition" in l) continue;
164
- const d = `${l.geom}|${l.coord}`, g = i.get(d);
165
- g ? g.count += 1 : i.set(d, {
164
+ const d = `${l.geom}|${l.coord}`, g = c.get(d);
165
+ g ? g.count += 1 : c.set(d, {
166
166
  geom: l.geom,
167
167
  coord: l.coord,
168
168
  count: 1
169
169
  });
170
170
  }
171
- const a = [];
172
- for (const { geom: l, coord: d, count: g } of i.values())
173
- g < 2 || a.push({
171
+ const o = [];
172
+ for (const { geom: l, coord: d, count: g } of c.values())
173
+ g < 2 || o.push({
174
174
  kind: "user-input",
175
175
  severity: "warning",
176
176
  code: "DUPLICATE_REGISTERED_TYPE",
@@ -181,45 +181,45 @@ function rt(e) {
181
181
  },
182
182
  suggestion: `Keep a single render-only override for ('${l}', '${d}').`
183
183
  });
184
- return a.push(...lt(e)), {
184
+ return o.push(...dt(e)), {
185
185
  errors: r,
186
- warnings: a
186
+ warnings: o
187
187
  };
188
188
  }
189
- function nt(e, t) {
190
- const { coordSystem: n, layers: r } = e, s = /* @__PURE__ */ new Set(), i = [];
191
- for (const a of r)
192
- t(a.geom, n.type) !== null || s.has(a.geom) || (s.add(a.geom), i.push({
189
+ function st(e, t) {
190
+ const { coordSystem: n, layers: r } = e, s = /* @__PURE__ */ new Set(), c = [];
191
+ for (const o of r)
192
+ t(o.geom, n.type) !== null || s.has(o.geom) || (s.add(o.geom), c.push({
193
193
  kind: "user-input",
194
194
  severity: "warning",
195
195
  code: "MISSING_GEOM_RENDERER",
196
- message: `No renderer for geom '${a.geom}' under ${n.type} coords; the layer is not painted.`,
196
+ message: `No renderer for geom '${o.geom}' under ${n.type} coords; the layer is not painted.`,
197
197
  context: {
198
- requested: a.geom,
198
+ requested: o.geom,
199
199
  kind: "geom-renderer"
200
200
  },
201
- suggestion: `Register a renderer for ('${a.geom}', '${n.type}') via \`defineGeomRenderer\`.`
201
+ suggestion: `Register a renderer for ('${o.geom}', '${n.type}') via \`defineGeomRenderer\`.`
202
202
  }));
203
- return i;
203
+ return c;
204
204
  }
205
- function st(e, t) {
206
- const { coordSystem: n, layers: r } = e, s = /* @__PURE__ */ new Set(), i = [];
207
- for (const a of r) {
208
- if (a.interactive === !1 || a.spatialKind !== "render-hit-test" || s.has(a.geom)) continue;
209
- const l = t(a.geom, n.type);
210
- l === null || l.hitTest || Y(l) || (s.add(a.geom), i.push({
205
+ function at(e, t) {
206
+ const { coordSystem: n, layers: r } = e, s = /* @__PURE__ */ new Set(), c = [];
207
+ for (const o of r) {
208
+ if (o.interactive === !1 || o.spatialKind !== "render-hit-test" || s.has(o.geom)) continue;
209
+ const l = t(o.geom, n.type);
210
+ l === null || l.hitTest || V(l) || (s.add(o.geom), c.push({
211
211
  kind: "user-input",
212
212
  severity: "warning",
213
213
  code: "MISSING_RENDER_HIT_TEST",
214
- message: `Geom '${a.geom}' declares spatialKind 'render-hit-test' but its renderer provides no hit-test; the layer has no hover.`,
214
+ message: `Geom '${o.geom}' declares spatialKind 'render-hit-test' but its renderer provides no hit-test; the layer has no hover.`,
215
215
  context: {
216
- requested: a.geom,
216
+ requested: o.geom,
217
217
  kind: "geom-renderer"
218
218
  },
219
- suggestion: `Add a \`hitTest\` factory (precomputed geometry) or an overlay render (\`{ fn, options: { overlay: true } }\`, live simulation) to the renderer for ('${a.geom}', '${n.type}').`
219
+ suggestion: `Add a \`hitTest\` factory (precomputed geometry) or an overlay render (\`{ fn, options: { overlay: true } }\`, live simulation) to the renderer for ('${o.geom}', '${n.type}').`
220
220
  }));
221
221
  }
222
- return i;
222
+ return c;
223
223
  }
224
224
  function ot(e) {
225
225
  const t = /* @__PURE__ */ new Set(), n = [];
@@ -239,26 +239,26 @@ function ot(e) {
239
239
  }
240
240
  return n;
241
241
  }
242
- function at(e, t) {
243
- const { coordSystem: n, layers: r } = e, s = /* @__PURE__ */ new Set(), i = [];
244
- for (const a of r) {
245
- if (a.interactive === !1 || a.spatialKind !== "render-hit-test" || s.has(a.geom)) continue;
246
- const l = t(a.geom, n.type);
247
- l === null || !l.hitTest || !Y(l) || (s.add(a.geom), i.push({
242
+ function it(e, t) {
243
+ const { coordSystem: n, layers: r } = e, s = /* @__PURE__ */ new Set(), c = [];
244
+ for (const o of r) {
245
+ if (o.interactive === !1 || o.spatialKind !== "render-hit-test" || s.has(o.geom)) continue;
246
+ const l = t(o.geom, n.type);
247
+ l === null || !l.hitTest || !V(l) || (s.add(o.geom), c.push({
248
248
  kind: "user-input",
249
249
  severity: "warning",
250
250
  code: "CONFLICTING_RENDER_HIT_TEST",
251
- message: `Geom '${a.geom}' declares both a \`hitTest\` factory and an overlay render; these are alternatives, so only the overlay is used.`,
251
+ message: `Geom '${o.geom}' declares both a \`hitTest\` factory and an overlay render; these are alternatives, so only the overlay is used.`,
252
252
  context: {
253
- requested: a.geom,
253
+ requested: o.geom,
254
254
  kind: "geom-renderer"
255
255
  },
256
256
  suggestion: "Keep one: a `hitTest` factory for precomputed geometry, OR an overlay render (`{ fn, options: { overlay: true } }`) for a live simulation."
257
257
  }));
258
258
  }
259
- return i;
259
+ return c;
260
260
  }
261
- function it(e, t) {
261
+ function ct(e, t) {
262
262
  const n = /* @__PURE__ */ new Set(), r = [];
263
263
  for (const s of e.layers)
264
264
  s.interactive !== !1 && (s.spatialKind !== "render-hit-test" || n.has(s.geom) || t.hasCapability(s.geom) || (n.add(s.geom), r.push({
@@ -274,26 +274,26 @@ function it(e, t) {
274
274
  })));
275
275
  return r;
276
276
  }
277
- function ct(e, t) {
278
- const { coordSystem: n, layers: r } = e, s = /* @__PURE__ */ new Set(), i = [];
279
- for (const a of r) {
280
- if (a.interactive === !1 || a.spatialKind === "render-hit-test" || s.has(a.geom)) continue;
281
- const l = t(a.geom, n.type);
282
- l === null || !Y(l) || (s.add(a.geom), i.push({
277
+ function lt(e, t) {
278
+ const { coordSystem: n, layers: r } = e, s = /* @__PURE__ */ new Set(), c = [];
279
+ for (const o of r) {
280
+ if (o.interactive === !1 || o.spatialKind === "render-hit-test" || s.has(o.geom)) continue;
281
+ const l = t(o.geom, n.type);
282
+ l === null || !V(l) || (s.add(o.geom), c.push({
283
283
  kind: "user-input",
284
284
  severity: "warning",
285
285
  code: "OVERLAY_REQUIRES_RENDER_HIT_TEST",
286
- message: `Geom '${a.geom}' declares an overlay render but its layer's spatialKind is '${a.spatialKind}', not 'render-hit-test'; the overlay's push-path hover resolves to nothing.`,
286
+ message: `Geom '${o.geom}' declares an overlay render but its layer's spatialKind is '${o.spatialKind}', not 'render-hit-test'; the overlay's push-path hover resolves to nothing.`,
287
287
  context: {
288
- requested: a.geom,
288
+ requested: o.geom,
289
289
  kind: "geom-renderer"
290
290
  },
291
291
  suggestion: "Have the geom's manifest yield spatialKind 'render-hit-test' so the scene layer carries the `byKey` index the overlay's `pushHover` resolves against."
292
292
  }));
293
293
  }
294
- return i;
294
+ return c;
295
295
  }
296
- function lt(e) {
296
+ function dt(e) {
297
297
  const t = /* @__PURE__ */ new Set(), n = [];
298
298
  for (const r of e) {
299
299
  const s = le(r);
@@ -311,65 +311,65 @@ function lt(e) {
311
311
  }
312
312
  return n;
313
313
  }
314
- var dt = (e) => Q((t) => ({
314
+ var ut = (e) => z((t) => ({
315
315
  scene: e,
316
316
  setScene: (n) => t((r) => r.scene === n ? r : { scene: n })
317
- })), ut = ({ spec: e, data: t, customPalettes: n, colorScheme: r, plugins: s, resolveRenderer: i, anchorResolver: a, onSpecChange: l, onError: d, onWarnings: g }) => {
318
- const E = F(l), G = F(d), N = F(g), [{ session: h, compileBus: u }] = b(() => {
319
- const o = Ne({ plugins: s });
317
+ })), mt = ({ spec: e, data: t, customPalettes: n, colorScheme: r, plugins: s, resolveRenderer: c, anchorResolver: o, onSpecChange: l, onError: d, onWarnings: g }) => {
318
+ const E = U(l), D = U(d), N = U(g), [{ session: h, compileBus: u }] = b(() => {
319
+ const a = Ce({ plugins: s });
320
320
  return {
321
- session: new Ee(o),
322
- compileBus: ze(o)
321
+ session: new Te(a),
322
+ compileBus: Je(a)
323
323
  };
324
- }), [m] = b(() => rt(s ?? [])), C = ee(null), [I] = b(mt), y = ee(null), q = f((o) => m.errors.length === 0 ? o : [...m.errors, ...o ?? []], [m]), _ = f((o) => {
325
- if (!o.ok) return o.errors;
326
- if (y.current) y.current.getState().setScene(o.scene);
324
+ }), [m] = b(() => nt(s ?? [])), C = re(null), [I] = b(gt), y = re(null), G = f((a) => m.errors.length === 0 ? a : [...m.errors, ...a ?? []], [m]), _ = f((a) => {
325
+ if (!a.ok) return a.errors;
326
+ if (y.current) y.current.getState().setScene(a.scene);
327
327
  else {
328
- const p = dt(o.scene);
328
+ const p = ut(a.scene);
329
329
  p.subscribe(I.notify), y.current = p, I.notify();
330
330
  }
331
331
  return null;
332
- }, [I]), [w, L] = b(() => {
333
- const o = h.compile({
332
+ }, [I]), [k, P] = b(() => {
333
+ const a = h.compile({
334
334
  spec: e,
335
335
  data: t,
336
336
  customPalettes: n,
337
337
  colorScheme: r
338
338
  });
339
- return C.current = o, q(_(o));
340
- }), T = f((o) => o.ok ? [
341
- ...o.warnings,
342
- ...nt(o.scene, i),
343
- ...st(o.scene, i),
344
- ...ot(o.scene),
345
- ...at(o.scene, i),
346
- ...ct(o.scene, i),
347
- ...it(o.scene, a)
348
- ] : o.warnings, [i, a]), R = f((o) => {
349
- o.length !== 0 && (j(o), G.current?.(o));
350
- }, [G]), D = f((o) => {
351
- o.length !== 0 && (j(o), N.current?.(o));
339
+ return C.current = a, G(_(a));
340
+ }), T = f((a) => a.ok ? [
341
+ ...a.warnings,
342
+ ...st(a.scene, c),
343
+ ...at(a.scene, c),
344
+ ...ot(a.scene),
345
+ ...it(a.scene, c),
346
+ ...lt(a.scene, c),
347
+ ...ct(a.scene, o)
348
+ ] : a.warnings, [c, o]), R = f((a) => {
349
+ a.length !== 0 && (Y(a), D.current?.(a));
350
+ }, [D]), q = f((a) => {
351
+ a.length !== 0 && (Y(a), N.current?.(a));
352
352
  }, [N]);
353
- M(() => {
354
- const o = C.current;
355
- o && (R([...m.errors, ...o.ok ? [] : o.errors]), D([...m.warnings, ...T(o)]), o.ok && u.emit({ kind: "init" }));
353
+ H(() => {
354
+ const a = C.current;
355
+ a && (R([...m.errors, ...a.ok ? [] : a.errors]), q([...m.warnings, ...T(a)]), a.ok && u.emit({ kind: "init" }));
356
356
  }, [
357
357
  u,
358
358
  R,
359
- D,
359
+ q,
360
360
  m,
361
361
  T
362
- ]), M(() => {
363
- const o = h.update({
362
+ ]), H(() => {
363
+ const a = h.update({
364
364
  spec: e,
365
365
  data: t,
366
366
  customPalettes: n,
367
367
  colorScheme: r
368
368
  });
369
- if (!o) return;
370
- o.committedSpec && E.current?.(o.committedSpec);
371
- const p = _(o.result);
372
- L(q(p)), p && R(p), D(T(o.result)), p || u.emit({ kind: o.specChanged ? "spec" : "data" });
369
+ if (!a) return;
370
+ a.committedSpec && E.current?.(a.committedSpec);
371
+ const p = _(a.result);
372
+ P(G(p)), p && R(p), q(T(a.result)), p || u.emit({ kind: a.specChanged ? "spec" : "data" });
373
373
  }, [
374
374
  e,
375
375
  t,
@@ -379,54 +379,54 @@ var dt = (e) => Q((t) => ({
379
379
  u,
380
380
  _,
381
381
  R,
382
- D,
383
382
  q,
383
+ G,
384
384
  T,
385
385
  E
386
386
  ]);
387
- const k = f((o) => {
388
- L((p) => p === null ? p : q(null)), D(T(o));
387
+ const w = f((a) => {
388
+ P((p) => p === null ? p : G(null)), q(T(a));
389
389
  }, [
390
+ G,
390
391
  q,
391
- D,
392
392
  T
393
- ]), P = f((o) => {
394
- o.scene && y.current?.getState().setScene(o.scene), o.result && k(o.result), o.command && u.emit({
393
+ ]), L = f((a) => {
394
+ a.scene && y.current?.getState().setScene(a.scene), a.result && w(a.result), a.command && u.emit({
395
395
  kind: "command",
396
- command: o.command
397
- }), o.spec && E.current?.(o.spec), o.errors && R([...o.errors]);
396
+ command: a.command
397
+ }), a.spec && E.current?.(a.spec), a.errors && R([...a.errors]);
398
398
  }, [
399
- k,
399
+ w,
400
400
  u,
401
401
  E,
402
402
  R
403
- ]), S = f((o) => {
404
- for (const p of o) P(p);
405
- return o.some((p) => !!p.scene);
406
- }, [P]), K = f((o, p) => {
407
- S(h.applyCommand(o, p));
403
+ ]), S = f((a) => {
404
+ for (const p of a) L(p);
405
+ return a.some((p) => !!p.scene);
406
+ }, [L]), j = f((a, p) => {
407
+ S(h.applyCommand(a, p));
408
408
  }, [h, S]), x = f(() => {
409
409
  S(h.commit());
410
- }, [h, S]), A = f(() => S(h.undo()), [h, S]), z = f(() => S(h.redo()), [h, S]), ue = H(() => ({
410
+ }, [h, S]), A = f(() => S(h.undo()), [h, S]), Z = f(() => S(h.redo()), [h, S]), ue = M(() => ({
411
411
  stack: h.history,
412
412
  undo: A,
413
- redo: z
413
+ redo: Z
414
414
  }), [
415
415
  h,
416
416
  A,
417
- z
417
+ Z
418
418
  ]), me = f(() => y.current?.getState().scene ?? null, []);
419
419
  return {
420
420
  store: y.current,
421
- dispatch: K,
421
+ dispatch: j,
422
422
  commit: x,
423
423
  history: ue,
424
424
  subscribe: I.subscribe,
425
425
  getScene: me,
426
426
  compileBus: u,
427
- compileErrors: w
427
+ compileErrors: k
428
428
  };
429
- }, mt = () => {
429
+ }, gt = () => {
430
430
  const e = /* @__PURE__ */ new Set();
431
431
  return {
432
432
  subscribe: (t) => (e.add(t), () => {
@@ -434,36 +434,36 @@ var dt = (e) => Q((t) => ({
434
434
  }),
435
435
  notify: () => e.forEach((t) => t())
436
436
  };
437
- }, gt = ({ data: e, spec: t, plugins: n = [], formattingLocale: r, handleRef: s, onSpecChange: i, onError: a, onWarnings: l, customPalettes: d, colorScheme: g = "light", children: E }) => {
438
- const [G] = b(() => ge(n.filter(ce))), N = Le(), [h] = b(() => Re(n)), [u] = b(() => Ce(n)), [m] = b(() => We()), [C] = b(() => ve()), I = H(() => De({ colorScheme: g }), [g]), { store: y, dispatch: q, commit: _, history: w, subscribe: L, getScene: T, compileBus: R, compileErrors: D } = ut({
437
+ }, ht = ({ data: e, spec: t, plugins: n = [], formattingLocale: r, handleRef: s, onSpecChange: c, onError: o, onWarnings: l, customPalettes: d, colorScheme: g = "light", children: E }) => {
438
+ const [D] = b(() => ge(n.filter(ce))), N = Le(), [h] = b(() => Ne(n)), [u] = b(() => Ge(n)), [m] = b(() => Ve()), [C] = b(() => ye()), I = M(() => De({ colorScheme: g }), [g]), { store: y, dispatch: G, commit: _, history: k, subscribe: P, getScene: T, compileBus: R, compileErrors: q } = mt({
439
439
  spec: t,
440
440
  data: e,
441
441
  customPalettes: d,
442
442
  colorScheme: g,
443
443
  plugins: n,
444
- resolveRenderer: G,
444
+ resolveRenderer: D,
445
445
  anchorResolver: h,
446
- onSpecChange: i,
447
- onError: a,
446
+ onSpecChange: c,
447
+ onError: o,
448
448
  onWarnings: l
449
449
  });
450
- M(() => {
450
+ H(() => {
451
451
  if (y)
452
- return y.subscribe((S, K) => {
453
- if (S.scene.spec === K.scene.spec) return;
452
+ return y.subscribe((S, j) => {
453
+ if (S.scene.spec === j.scene.spec) return;
454
454
  const { selection: x, setSelection: A } = m.getState();
455
- x.length !== 0 && A(Ue(x, S.scene.spec));
455
+ x.length !== 0 && A(Ye(x, S.scene.spec));
456
456
  });
457
457
  }, [y, m]);
458
- const k = H(() => ({
459
- dispatch: q,
458
+ const w = M(() => ({
459
+ dispatch: G,
460
460
  commit: _
461
- }), [q, _]);
462
- Pe(s, () => ({
463
- commands: k,
464
- undo: w.undo,
465
- redo: w.redo,
466
- subscribe: L,
461
+ }), [G, _]);
462
+ $e(s, () => ({
463
+ commands: w,
464
+ undo: k.undo,
465
+ redo: k.redo,
466
+ subscribe: P,
467
467
  getScene: T,
468
468
  getSelection: () => m.getState().selection,
469
469
  setSelection: (S) => m.getState().setSelection(S),
@@ -471,20 +471,20 @@ var dt = (e) => Q((t) => ({
471
471
  canPlaceDataLabels: u.hasCapability,
472
472
  canFormatDataLabelsAsPercentages: u.hasPercentageFormat
473
473
  }), [
474
- k,
475
474
  w,
476
- L,
475
+ k,
476
+ P,
477
477
  T,
478
478
  m,
479
479
  u
480
480
  ]);
481
- const P = H(() => y ? {
481
+ const L = M(() => y ? {
482
482
  chartId: N,
483
483
  store: y,
484
484
  selectionStore: m,
485
485
  targetBoundaryStore: C,
486
- commands: k,
487
- history: w,
486
+ commands: w,
487
+ history: k,
488
488
  formattingLocale: r,
489
489
  compileBus: R,
490
490
  colorScheme: g,
@@ -495,23 +495,23 @@ var dt = (e) => Q((t) => ({
495
495
  y,
496
496
  m,
497
497
  C,
498
- k,
499
498
  w,
499
+ k,
500
500
  r,
501
501
  R,
502
502
  g,
503
503
  I,
504
504
  h
505
505
  ]);
506
- return /* @__PURE__ */ c(je, {
507
- forcedErrors: D,
508
- onError: a,
506
+ return /* @__PURE__ */ i(Ue, {
507
+ forcedErrors: q,
508
+ onError: o,
509
509
  resetKeys: [t, e],
510
- children: P ? /* @__PURE__ */ c(Se.Provider, {
511
- value: P,
512
- children: /* @__PURE__ */ c(pe, {
513
- value: G,
514
- children: /* @__PURE__ */ c(fe, {
510
+ children: L ? /* @__PURE__ */ i(fe.Provider, {
511
+ value: L,
512
+ children: /* @__PURE__ */ i(pe, {
513
+ value: D,
514
+ children: /* @__PURE__ */ i(Se, {
515
515
  value: u,
516
516
  children: E
517
517
  })
@@ -519,31 +519,31 @@ var dt = (e) => Q((t) => ({
519
519
  }) : null
520
520
  });
521
521
  };
522
- function Pr(e) {
522
+ function xr(e) {
523
523
  const t = qe(e);
524
524
  return {
525
525
  ...t,
526
- GraphProvider: (r) => /* @__PURE__ */ c(gt, {
526
+ GraphProvider: (r) => /* @__PURE__ */ i(ht, {
527
527
  ...r,
528
528
  plugins: t.plugins
529
529
  })
530
530
  };
531
531
  }
532
- var $r = ({ shouldAnimateTransitions: e, cx: t, cy: n, r, ...s }) => e ? /* @__PURE__ */ c(ie.circle, {
532
+ var Ar = ({ shouldAnimateTransitions: e, cx: t, cy: n, r, ...s }) => e ? /* @__PURE__ */ i(F.circle, {
533
533
  initial: !1,
534
534
  animate: {
535
535
  cx: t,
536
536
  cy: n,
537
537
  r
538
538
  },
539
- transition: ae,
539
+ transition: K,
540
540
  ...s
541
- }) : /* @__PURE__ */ c("circle", {
541
+ }) : /* @__PURE__ */ i("circle", {
542
542
  cx: t,
543
543
  cy: n,
544
544
  r,
545
545
  ...s
546
- }), Hr = ({ shouldAnimateTransitions: e, x1: t, y1: n, x2: r, y2: s, ...i }) => e ? /* @__PURE__ */ c(ie.line, {
546
+ }), Br = ({ shouldAnimateTransitions: e, x1: t, y1: n, x2: r, y2: s, ...c }) => e ? /* @__PURE__ */ i(F.line, {
547
547
  initial: !1,
548
548
  animate: {
549
549
  x1: t,
@@ -551,15 +551,44 @@ var $r = ({ shouldAnimateTransitions: e, cx: t, cy: n, r, ...s }) => e ? /* @__P
551
551
  x2: r,
552
552
  y2: s
553
553
  },
554
- transition: ae,
555
- ...i
556
- }) : /* @__PURE__ */ c("line", {
554
+ transition: K,
555
+ ...c
556
+ }) : /* @__PURE__ */ i("line", {
557
557
  x1: t,
558
558
  y1: n,
559
559
  x2: r,
560
560
  y2: s,
561
- ...i
562
- }), Mr = ({ children: e, ...t }) => /* @__PURE__ */ c("svg", {
561
+ ...c
562
+ }), Or = ({ shouldAnimateTransitions: e, x: t, y: n, width: r, height: s, ...c }) => e ? /* @__PURE__ */ i(F.rect, {
563
+ initial: !1,
564
+ animate: {
565
+ attrX: t,
566
+ attrY: n,
567
+ width: r,
568
+ height: s
569
+ },
570
+ transition: K,
571
+ ...c
572
+ }) : /* @__PURE__ */ i("rect", {
573
+ x: t,
574
+ y: n,
575
+ width: r,
576
+ height: s,
577
+ ...c
578
+ }), Kr = ({ shouldAnimateTransitions: e, d: t, source: n, ...r }) => e ? /* @__PURE__ */ i(pt, {
579
+ d: t,
580
+ source: n,
581
+ ...r
582
+ }) : /* @__PURE__ */ i("path", {
583
+ d: t,
584
+ ...r
585
+ }), pt = ({ d: e, source: t, ...n }) => {
586
+ const r = ve(e, K, t);
587
+ return /* @__PURE__ */ i(F.path, {
588
+ d: r,
589
+ ...n
590
+ });
591
+ }, Fr = ({ children: e, ...t }) => /* @__PURE__ */ i("svg", {
563
592
  viewBox: "0 0 1 1",
564
593
  preserveAspectRatio: "none",
565
594
  width: "100%",
@@ -567,7 +596,7 @@ var $r = ({ shouldAnimateTransitions: e, cx: t, cy: n, r, ...s }) => e ? /* @__P
567
596
  pointerEvents: "none",
568
597
  ...t,
569
598
  children: e
570
- }), xr = ({ box: e, children: t }) => /* @__PURE__ */ c("svg", {
599
+ }), jr = ({ box: e, children: t }) => /* @__PURE__ */ i("svg", {
571
600
  x: B(e.x0),
572
601
  y: B(e.y0),
573
602
  width: B(e.x1 - e.x0),
@@ -575,189 +604,189 @@ var $r = ({ shouldAnimateTransitions: e, cx: t, cy: n, r, ...s }) => e ? /* @__P
575
604
  overflow: "hidden",
576
605
  pointerEvents: "none",
577
606
  children: t
578
- }), ht = "drqe3u0", pt = "drqe3u1", ft = "drqe3u2", vt = "drqe3u3", $ = "drqe3u4", yt = "drqe3u5", St = "drqe3u6", bt = "drqe3u7", O = "drqe3u8", Et = "drqe3u9", Tt = "drqe3ua";
579
- var Rt = "drqe3uc", Nt = "drqe3ud", Ct = "drqe3ue", qt = "drqe3uf";
580
- var Dt = "drqe3uh", Gt = "drqe3ui", se = {
607
+ }), ft = "drqe3u0", vt = "drqe3u1", yt = "drqe3u2", St = "drqe3u3", $ = "drqe3u4", bt = "drqe3u5", Et = "drqe3u6", Tt = "drqe3u7", O = "drqe3u8", Rt = "drqe3u9", Nt = "drqe3ua";
608
+ var Ct = "drqe3uc", Gt = "drqe3ud", qt = "drqe3ue", Dt = "drqe3uf";
609
+ var It = "drqe3uh", kt = "drqe3ui", oe = {
581
610
  enabled: "drqe3uk drqe3uj",
582
611
  disabled: "drqe3ul drqe3uj"
583
- }, oe = {
612
+ }, ie = {
584
613
  ran: "drqe3un drqe3um",
585
614
  dim: "drqe3uo drqe3um"
586
615
  }, de = {
587
616
  ran: "drqe3uq drqe3up",
588
617
  cached: "drqe3ur drqe3up",
589
618
  untouched: "drqe3us drqe3up"
590
- }, Ar = ({ width: e = 440, style: t, className: n } = {}) => {
591
- const { compileBus: r } = W(), [s] = b(() => Je()), [i, a] = b(!1), [l, d] = b(Ie);
592
- M(() => {
619
+ }, Ur = ({ width: e = 440, style: t, className: n } = {}) => {
620
+ const { compileBus: r } = X(), [s] = b(() => Ze()), [c, o] = b(!1), [l, d] = b(ke);
621
+ H(() => {
593
622
  const { recordCompile: u } = s.getState(), m = r.getLastTrigger(), C = r.getLastCompile();
594
623
  return m && C && u(m, C), r.subscribe(u);
595
624
  }, [s, r]);
596
- const g = U(s, (u) => u.lastCompile), E = U(s, (u) => u.history), G = r.getCacheStats(), N = g === null && E.length === 0, h = () => {
625
+ const g = W(s, (u) => u.lastCompile), E = W(s, (u) => u.history), D = r.getCacheStats(), N = g === null && E.length === 0, h = () => {
597
626
  d((u) => {
598
627
  const m = !u;
599
- return ke(m), m;
628
+ return _e(m), m;
600
629
  });
601
630
  };
602
631
  return /* @__PURE__ */ v("div", {
603
- className: Me(Tt, n),
632
+ className: xe(Nt, n),
604
633
  style: {
605
634
  width: e,
606
635
  ...t
607
636
  },
608
637
  children: [
609
638
  /* @__PURE__ */ v("div", {
610
- className: ht,
611
- children: [/* @__PURE__ */ v("div", { children: [/* @__PURE__ */ c("div", {
612
- className: pt,
639
+ className: ft,
640
+ children: [/* @__PURE__ */ v("div", { children: [/* @__PURE__ */ i("div", {
641
+ className: vt,
613
642
  children: "compile cache"
614
- }), /* @__PURE__ */ c("div", {
615
- className: Ct,
616
- children: N ? "production: stats disabled" : g ? `last: ${g.label} · ${X(g.durationMs)}` : "awaiting first compile…"
617
- })] }), /* @__PURE__ */ c("button", {
618
- type: "button",
619
- onClick: () => a((u) => !u),
643
+ }), /* @__PURE__ */ i("div", {
620
644
  className: qt,
621
- children: i ? "▾" : "▴"
645
+ children: N ? "production: stats disabled" : g ? `last: ${g.label} · ${J(g.durationMs)}` : "awaiting first compile…"
646
+ })] }), /* @__PURE__ */ i("button", {
647
+ type: "button",
648
+ onClick: () => o((u) => !u),
649
+ className: Dt,
650
+ children: c ? "▾" : "▴"
622
651
  })]
623
652
  }),
624
- !i && /* @__PURE__ */ v("div", {
653
+ !c && /* @__PURE__ */ v("div", {
625
654
  className: "drqe3ub",
626
655
  children: [/* @__PURE__ */ v("button", {
627
656
  type: "button",
628
657
  onClick: h,
629
- className: l ? se.enabled : se.disabled,
658
+ className: l ? oe.enabled : oe.disabled,
630
659
  "aria-pressed": l,
631
660
  children: ["cache ", l ? "enabled" : "disabled"]
632
- }), /* @__PURE__ */ c("span", {
661
+ }), /* @__PURE__ */ i("span", {
633
662
  className: "drqe3ug",
634
663
  children: "next compile reflects this toggle"
635
664
  })]
636
665
  }),
637
- !i && !N && /* @__PURE__ */ v(He, { children: [/* @__PURE__ */ c(It, {
666
+ !c && !N && /* @__PURE__ */ v(He, { children: [/* @__PURE__ */ i(wt, {
638
667
  delta: g?.stages,
639
668
  durations: g?.stageDurationsMs,
640
- cumulative: G
641
- }), /* @__PURE__ */ c(wt, { entries: E })] })
669
+ cumulative: D
670
+ }), /* @__PURE__ */ i(_t, { entries: E })] })
642
671
  ]
643
672
  });
644
- }, It = ({ delta: e, durations: t, cumulative: n }) => /* @__PURE__ */ v("table", {
645
- className: ft,
646
- children: [/* @__PURE__ */ c("thead", { children: /* @__PURE__ */ v("tr", {
647
- className: Dt,
673
+ }, wt = ({ delta: e, durations: t, cumulative: n }) => /* @__PURE__ */ v("table", {
674
+ className: yt,
675
+ children: [/* @__PURE__ */ i("thead", { children: /* @__PURE__ */ v("tr", {
676
+ className: It,
648
677
  children: [
649
- /* @__PURE__ */ c("th", {
650
- className: vt,
678
+ /* @__PURE__ */ i("th", {
679
+ className: St,
651
680
  children: "stage"
652
681
  }),
653
- /* @__PURE__ */ c("th", {
682
+ /* @__PURE__ */ i("th", {
654
683
  className: $,
655
684
  children: "time"
656
685
  }),
657
- /* @__PURE__ */ c("th", {
686
+ /* @__PURE__ */ i("th", {
658
687
  className: $,
659
688
  children: "Δ miss"
660
689
  }),
661
- /* @__PURE__ */ c("th", {
690
+ /* @__PURE__ */ i("th", {
662
691
  className: $,
663
692
  children: "Δ hit"
664
693
  }),
665
- /* @__PURE__ */ c("th", {
694
+ /* @__PURE__ */ i("th", {
666
695
  className: $,
667
696
  children: "total miss"
668
697
  }),
669
- /* @__PURE__ */ c("th", {
698
+ /* @__PURE__ */ i("th", {
670
699
  className: $,
671
700
  children: "total hit"
672
701
  })
673
702
  ]
674
- }) }), /* @__PURE__ */ c("tbody", { children: V.map((r) => {
675
- const s = e?.[r], i = kt(s);
703
+ }) }), /* @__PURE__ */ i("tbody", { children: Q.map((r) => {
704
+ const s = e?.[r], c = Pt(s);
676
705
  return /* @__PURE__ */ v("tr", {
677
- className: Rt,
706
+ className: Ct,
678
707
  children: [
679
708
  /* @__PURE__ */ v("td", {
680
- className: yt,
709
+ className: bt,
681
710
  children: [
682
- /* @__PURE__ */ c("span", {
683
- className: de[i],
711
+ /* @__PURE__ */ i("span", {
712
+ className: de[c],
684
713
  "aria-hidden": !0
685
714
  }),
686
715
  " ",
687
716
  r
688
717
  ]
689
718
  }),
690
- /* @__PURE__ */ c("td", {
719
+ /* @__PURE__ */ i("td", {
691
720
  className: O,
692
- children: t === void 0 || i === "untouched" ? "—" : X(t[r])
721
+ children: t === void 0 || c === "untouched" ? "—" : J(t[r])
693
722
  }),
694
- /* @__PURE__ */ c("td", {
695
- className: i === "ran" ? oe.ran : oe.dim,
723
+ /* @__PURE__ */ i("td", {
724
+ className: c === "ran" ? ie.ran : ie.dim,
696
725
  children: s?.misses ?? 0
697
726
  }),
698
- /* @__PURE__ */ c("td", {
727
+ /* @__PURE__ */ i("td", {
699
728
  className: O,
700
729
  children: s?.hits ?? 0
701
730
  }),
702
- /* @__PURE__ */ c("td", {
731
+ /* @__PURE__ */ i("td", {
703
732
  className: O,
704
733
  children: n[r].misses
705
734
  }),
706
- /* @__PURE__ */ c("td", {
735
+ /* @__PURE__ */ i("td", {
707
736
  className: O,
708
737
  children: n[r].hits
709
738
  })
710
739
  ]
711
740
  }, r);
712
741
  }) })]
713
- }), wt = ({ entries: e }) => e.length === 0 ? null : /* @__PURE__ */ v("div", {
714
- className: Nt,
715
- children: [/* @__PURE__ */ c("div", {
716
- className: Gt,
742
+ }), _t = ({ entries: e }) => e.length === 0 ? null : /* @__PURE__ */ v("div", {
743
+ className: Gt,
744
+ children: [/* @__PURE__ */ i("div", {
745
+ className: kt,
717
746
  children: "recent compiles"
718
747
  }), e.map((t) => {
719
- const n = _t(t.stages, (i) => i.misses > 0), r = V.length;
748
+ const n = Lt(t.stages, (c) => c.misses > 0), r = Q.length;
720
749
  return /* @__PURE__ */ v("div", {
721
- className: St,
750
+ className: Et,
722
751
  children: [
723
- /* @__PURE__ */ c("span", {
752
+ /* @__PURE__ */ i("span", {
724
753
  className: de[n === 0 ? "cached" : "ran"],
725
754
  "aria-hidden": !0
726
755
  }),
727
- /* @__PURE__ */ c("span", {
728
- className: bt,
756
+ /* @__PURE__ */ i("span", {
757
+ className: Tt,
729
758
  title: t.label,
730
759
  children: t.label
731
760
  }),
732
761
  /* @__PURE__ */ v("span", {
733
- className: Et,
762
+ className: Rt,
734
763
  children: [
735
764
  n,
736
765
  "/",
737
766
  r,
738
767
  " ran · ",
739
- X(t.durationMs)
768
+ J(t.durationMs)
740
769
  ]
741
770
  })
742
771
  ]
743
772
  }, t.id);
744
773
  })]
745
- }), kt = (e) => !e || e.hits === 0 && e.misses === 0 ? "untouched" : e.misses > 0 ? "ran" : "cached", _t = (e, t) => {
774
+ }), Pt = (e) => !e || e.hits === 0 && e.misses === 0 ? "untouched" : e.misses > 0 ? "ran" : "cached", Lt = (e, t) => {
746
775
  let n = 0;
747
- for (const r of V) t(e[r]) && (n += 1);
776
+ for (const r of Q) t(e[r]) && (n += 1);
748
777
  return n;
749
- }, X = (e) => e < 0.1 ? "<0.1ms" : e >= 10 ? `${e.toFixed(0)}ms` : `${e.toFixed(2)}ms`, Br = () => {
750
- const { history: e } = W(), { stack: t, undo: n, redo: r } = e, s = f((l) => t.subscribe(l), [t]), i = f(() => t.getSnapshot(), [t]), a = $e(s, i, i);
751
- return H(() => ({
752
- ...a,
778
+ }, J = (e) => e < 0.1 ? "<0.1ms" : e >= 10 ? `${e.toFixed(0)}ms` : `${e.toFixed(2)}ms`, Yr = () => {
779
+ const { history: e } = X(), { stack: t, undo: n, redo: r } = e, s = f((l) => t.subscribe(l), [t]), c = f(() => t.getSnapshot(), [t]), o = Me(s, c, c);
780
+ return M(() => ({
781
+ ...o,
753
782
  undo: n,
754
783
  redo: r
755
784
  }), [
756
- a,
785
+ o,
757
786
  n,
758
787
  r
759
788
  ]);
760
- }, Lt = /* @__PURE__ */ new Set([
789
+ }, $t = /* @__PURE__ */ new Set([
761
790
  "button",
762
791
  "checkbox",
763
792
  "color",
@@ -768,82 +797,86 @@ var Dt = "drqe3uh", Gt = "drqe3ui", se = {
768
797
  "range",
769
798
  "reset",
770
799
  "submit"
771
- ]), Or = (e, t = {}) => {
800
+ ]), Wr = (e, t = {}) => {
772
801
  const { target: n, enabled: r = !0 } = t;
773
- M(() => {
774
- const s = Pt(n);
802
+ H(() => {
803
+ const s = Mt(n);
775
804
  if (!r || !s) return;
776
- const i = (a) => {
777
- if (!$t(a) || a.defaultPrevented || Ht(a.target)) return;
778
- const l = ye(a);
805
+ const c = (o) => {
806
+ if (!Ht(o) || o.defaultPrevented || xt(o.target)) return;
807
+ const l = be(o);
779
808
  if (!l) return;
780
809
  const d = e.current;
781
- d && (l === "undo" ? d.undo() : d.redo()) && a.preventDefault();
810
+ d && (l === "undo" ? d.undo() : d.redo()) && o.preventDefault();
782
811
  };
783
- return s.addEventListener("keydown", i), () => s.removeEventListener("keydown", i);
812
+ return s.addEventListener("keydown", c), () => s.removeEventListener("keydown", c);
784
813
  }, [
785
814
  e,
786
815
  n,
787
816
  r
788
817
  ]);
789
- }, Pt = (e) => e === void 0 ? window : e !== null && "current" in e ? e.current : e, $t = (e) => "key" in e, Ht = (e) => e instanceof HTMLInputElement ? !Lt.has(e.type) : e instanceof HTMLElement ? e.isContentEditable || e.tagName === "TEXTAREA" : !1, Kr = () => {
790
- const { targetBoundaryStore: e } = W();
791
- return U(e, (t) => t.boundary);
818
+ }, Mt = (e) => e === void 0 ? window : e !== null && "current" in e ? e.current : e, Ht = (e) => "key" in e, xt = (e) => e instanceof HTMLInputElement ? !$t.has(e.type) : e instanceof HTMLElement ? e.isContentEditable || e.tagName === "TEXTAREA" : !1, Vr = () => {
819
+ const { targetBoundaryStore: e } = X();
820
+ return W(e, (t) => t.boundary);
792
821
  };
793
822
  export {
794
- Nr as BrandMark,
795
- Kt as CanvasTextMeasurer,
796
- Ut as DefaultFooter,
797
- fr as DefaultGrid,
798
- Ft as DefaultHeader,
799
- Yt as DefaultSwatch,
800
- ur as DefaultTooltip,
801
- Ar as DevToolsPanel,
802
- nr as GRAPH_MODES,
803
- $r as GeomCircle,
804
- Hr as GeomLine,
805
- je as GraphErrorBoundary,
806
- te as GraphErrorPanel,
807
- gt as GraphProvider,
808
- Jt as GraphRenderer,
809
- Tr as HoverProvider,
810
- Vt as IntroFade,
811
- Qt as IntroWipeClip,
812
- Bt as TextMeasurerProvider,
813
- tr as ThemeProvider,
814
- xr as UnitBoxSvg,
815
- Mr as UnitSpaceSvg,
816
- yr as buildDotsEditOutlineShapes,
817
- Pr as createGraphyKit,
818
- Sr as darkTheme,
819
- cr as defineGeomRenderer,
820
- rr as lightTheme,
821
- jt as lightenCss,
822
- ar as projectPointCartesian,
823
- Ue as pruneSelection,
824
- At as resolveBrandMarkVisual,
825
- hr as scalePointToPanel,
826
- xt as stampAxisEditTarget,
827
- ir as stampGridEditTarget,
828
- Wt as stampLegendEditTarget,
829
- Rr as useElementScreenRect,
830
- Ot as useGeomHitTest,
831
- br as useGeomHover,
832
- Zt as useGeomReaderTree,
833
- mr as useGeomStyleReader,
834
- dr as useGraphCommands,
835
- or as useGraphHandle,
836
- Br as useGraphHistory,
837
- Or as useGraphHistoryShortcuts,
838
- sr as useGraphSelection,
839
- Er as useGuidesTakePress,
840
- gr as useHandleScene,
841
- pr as useHoverState,
842
- Xt as useResolvedStyle,
843
- lr as useSceneSelector,
844
- vr as useStyleReaderTree,
845
- er as useStyleResolver,
846
- Kr as useTargetBoundary,
847
- zt as useTextMeasurer,
848
- qr as vars
823
+ Dr as BrandMark,
824
+ Ut as CanvasTextMeasurer,
825
+ Vt as DefaultFooter,
826
+ Sr as DefaultGrid,
827
+ Yt as DefaultHeader,
828
+ Xt as DefaultSwatch,
829
+ pr as DefaultTooltip,
830
+ Ur as DevToolsPanel,
831
+ or as GRAPH_MODES,
832
+ Ar as GeomCircle,
833
+ Br as GeomLine,
834
+ Kr as GeomPath,
835
+ Or as GeomRect,
836
+ Ue as GraphErrorBoundary,
837
+ ne as GraphErrorPanel,
838
+ ht as GraphProvider,
839
+ tr as GraphRenderer,
840
+ Gr as HoverProvider,
841
+ zt as IntroFade,
842
+ Bt as IntroWipeClip,
843
+ Ft as TextMeasurerProvider,
844
+ sr as ThemeProvider,
845
+ jr as UnitBoxSvg,
846
+ Fr as UnitSpaceSvg,
847
+ hr as buildDotsEditOutlineShapes,
848
+ xr as createGraphyKit,
849
+ Rr as darkTheme,
850
+ ur as defineGeomRenderer,
851
+ ar as lightTheme,
852
+ Wt as lightenCss,
853
+ rr as projectPointCartesian,
854
+ Ye as pruneSelection,
855
+ Kt as resolveBrandMarkVisual,
856
+ lr as scalePointToPanel,
857
+ Ot as stampAxisEditTarget,
858
+ dr as stampGridEditTarget,
859
+ Qt as stampLegendEditTarget,
860
+ qr as useElementScreenRect,
861
+ jt as useGeomHitTest,
862
+ Nr as useGeomHover,
863
+ fr as useGeomReaderTree,
864
+ br as useGeomStyleReader,
865
+ gr as useGraphCommands,
866
+ cr as useGraphHandle,
867
+ Yr as useGraphHistory,
868
+ Wr as useGraphHistoryShortcuts,
869
+ Er as useGraphLocale,
870
+ ir as useGraphSelection,
871
+ Cr as useGuidesTakePress,
872
+ vr as useHandleScene,
873
+ yr as useHoverState,
874
+ Jt as usePaintDefs,
875
+ Zt as useResolvedStyle,
876
+ Tr as useSceneSelector,
877
+ nr as useStyleReaderTree,
878
+ mr as useStyleResolver,
879
+ Vr as useTargetBoundary,
880
+ er as useTextMeasurer,
881
+ kr as vars
849
882
  };