@graphysdk/react-renderer 1.9.0-beta.1793272487821 → 1.9.0-beta.1793288163741

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,39 +1,39 @@
1
- import { $t as or, An as Ne, At as ar, B as ir, Bt as cr, Cn as lr, Dn as dr, Dt as ur, En as mr, Ft as J, Ht as W, Jt as Ge, M as hr, Mn as Ce, Mt as gr, N as pr, Nt as vr, On as fr, Pn as Z, Qt as yr, R as Sr, Rt as Ie, Sn as br, Tn as Er, Tt as Tr, Ut as De, V as Rr, Vt as Nr, Wt as Gr, Xt as Cr, Zt as Ir, _n as we, _t as Dr, a as wr, at as Pr, bn as qr, ct as _r, dn as B, fn as fe, gn as kr, h as Lr, hn as z, i as Hr, j as $r, jn as te, jt as Mr, kn as xr, ln as Br, mn as Pe, mt as Ar, n as Or, on as Kr, ot as Fr, pn as qe, qt as jr, r as Ur, rn as Wr, s as zr, t as _e, un as ye, vn as Y, vt as Yr, w as Vr, wn as Xr, yn as V, z as Qr, zt as ke } from "./history-chords-Dhts8KCW.js";
2
- import { COMPILER_STAGE_KEYS as re, Geom as Le, GraphCompilationSession as He, areEditTargetsEqual as $e, buildDiagnostic as oe, createAnchorResolver as Me, createCompiler as xe, createDataLabelPlacementResolver as Be, createSpecBuilder as Ae, createStyleResolver as Se, findAnnotation as Oe, findLayerById as ae, isCompilerCachingEnabled as Ke, resolveDefinition as Fe, resolveGeomCornerRadiusPx as ie, setCompilerCachingEnabled as je, toPercent as j } from "@graphysdk/viz-engine";
3
- import { Component as Ue, useCallback as v, useEffect as x, useId as We, useImperativeHandle as ze, useMemo as _, useRef as ce, useState as b, useSyncExternalStore as Ye } from "react";
4
- import { Fragment as Ve, jsx as c, jsxs as f } from "react/jsx-runtime";
5
- import { useStore as ee } from "zustand";
6
- import { motion as X } from "motion/react";
7
- import { createStore as ne } from "zustand/vanilla";
8
- import Xe from "clsx";
9
- import './index.css';var Qe = "_1a5iqpb0", Je = "_1a5iqpb1";
10
- var Ze = "_1a5iqpb3", et = "_1a5iqpb4", tt = "_1a5iqpb5";
11
- var le = ({ errors: e }) => {
1
+ import { $t as ar, An as Ne, At as ir, B as cr, Bt as lr, Cn as dr, Dn as ur, Dt as mr, En as hr, Ft as Z, Ht as z, Jt as Ce, M as gr, Mn as Ie, Mt as pr, N as fr, Nt as vr, On as yr, Pn as ee, Qt as Sr, R as br, Rt as De, Sn as Er, Tn as Tr, Tt as Rr, Ut as we, V as Gr, Vt as Nr, Wt as Cr, Xt as Ir, Zt as Dr, _n as Pe, _t as wr, a as Pr, at as qr, bn as _r, ct as kr, dn as A, fn as ye, gn as Lr, h as Hr, hn as Y, i as $r, j as Mr, jn as re, jt as xr, kn as Br, ln as Ar, mn as qe, mt as Or, n as Kr, on as Fr, ot as jr, pn as _e, qt as Ur, r as Wr, rn as zr, s as Yr, t as ke, un as Se, vn as V, vt as Vr, w as Xr, wn as Qr, yn as X, z as Jr, zt as Le } from "./history-chords-CaoYNtzG.js";
2
+ import { COMPILER_STAGE_KEYS as ne, Geom as He, GraphCompilationSession as $e, areEditTargetsEqual as Me, buildDiagnostic as ae, createAnchorResolver as xe, createCompiler as Be, createDataLabelPlacementResolver as Ae, createSpecBuilder as Oe, createStyleResolver as be, findAnnotation as Ke, findLayerById as ie, isCompilerCachingEnabled as Fe, resolveDefinition as je, resolveGeomCornerRadiusPx as ce, setCompilerCachingEnabled as Ue, toPercent as U } from "@graphysdk/viz-engine";
3
+ import { Component as We, useCallback as p, useEffect as B, useId as ze, useImperativeHandle as Ye, useMemo as L, useRef as le, useState as S, useSyncExternalStore as Ve } from "react";
4
+ import { Fragment as Xe, jsx as c, jsxs as f } from "react/jsx-runtime";
5
+ import { useStore as te } from "zustand";
6
+ import { motion as Q } from "motion/react";
7
+ import { createStore as se } from "zustand/vanilla";
8
+ import Qe from "clsx";
9
+ import './index.css';var Je = "_1a5iqpb0", Ze = "_1a5iqpb1";
10
+ var et = "_1a5iqpb3", tt = "_1a5iqpb4", rt = "_1a5iqpb5";
11
+ var de = ({ errors: e }) => {
12
12
  const [t, ...r] = e;
13
13
  return /* @__PURE__ */ f("div", {
14
14
  role: "alert",
15
- className: Qe,
15
+ className: Je,
16
16
  children: [
17
17
  /* @__PURE__ */ c("strong", {
18
- className: Je,
18
+ className: Ze,
19
19
  children: "This chart could not be rendered."
20
20
  }),
21
- t && /* @__PURE__ */ c(de, { diagnostic: t }),
21
+ t && /* @__PURE__ */ c(ue, { diagnostic: t }),
22
22
  r.length > 0 && /* @__PURE__ */ c("ul", {
23
23
  className: "_1a5iqpb2",
24
- children: r.map((n, s) => /* @__PURE__ */ c("li", { children: /* @__PURE__ */ c(de, { diagnostic: n }) }, `${n.code}-${s}`))
24
+ children: r.map((n, s) => /* @__PURE__ */ c("li", { children: /* @__PURE__ */ c(ue, { diagnostic: n }) }, `${n.code}-${s}`))
25
25
  })
26
26
  ]
27
27
  });
28
- }, de = ({ diagnostic: e }) => /* @__PURE__ */ f("div", {
29
- className: Ze,
28
+ }, ue = ({ diagnostic: e }) => /* @__PURE__ */ f("div", {
29
+ className: et,
30
30
  children: [
31
31
  /* @__PURE__ */ c("span", {
32
- className: et,
32
+ className: tt,
33
33
  children: e.code
34
34
  }),
35
35
  /* @__PURE__ */ c("p", {
36
- className: tt,
36
+ className: rt,
37
37
  children: e.message
38
38
  }),
39
39
  e.suggestion && /* @__PURE__ */ c("p", {
@@ -42,47 +42,47 @@ var le = ({ errors: e }) => {
42
42
  })
43
43
  ]
44
44
  });
45
- function rt(e = [], t = []) {
45
+ function nt(e = [], t = []) {
46
46
  return e.length === t.length && e.every((r, n) => Object.is(r, t[n]));
47
47
  }
48
- var nt = class extends Ue {
48
+ var st = class extends We {
49
49
  constructor(...e) {
50
50
  super(...e), this.state = { caughtDiagnostic: null };
51
51
  }
52
52
  static getDerivedStateFromError(e) {
53
- return { caughtDiagnostic: oe(e) };
53
+ return { caughtDiagnostic: ae(e) };
54
54
  }
55
55
  componentDidCatch(e, t) {
56
- const r = oe(e);
57
- Z([r]), this.props.onError?.([r]), console.error("Chart render component stack:", t.componentStack);
56
+ const r = ae(e);
57
+ ee([r]), this.props.onError?.([r]), console.error("Chart render component stack:", t.componentStack);
58
58
  }
59
59
  componentDidUpdate(e) {
60
- this.state.caughtDiagnostic && !rt(e.resetKeys, this.props.resetKeys) && this.setState({ caughtDiagnostic: null });
60
+ this.state.caughtDiagnostic && !nt(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(le, { errors: [e] });
64
+ if (e) return /* @__PURE__ */ c(de, { errors: [e] });
65
65
  const { forcedErrors: t, children: r } = this.props;
66
- return t && t.length > 0 ? /* @__PURE__ */ c(le, { errors: t }) : r;
66
+ return t && t.length > 0 ? /* @__PURE__ */ c(de, { errors: t }) : r;
67
67
  }
68
- }, be = (e) => typeof e == "object" && "geom" in e && "render" in e, Ee = (e) => {
69
- const t = Fe(e);
70
- return t instanceof Le ? t : null;
71
- }, st = (e, t) => {
72
- const r = e.filter((n) => ot(n, t));
68
+ }, Ee = (e) => typeof e == "object" && "geom" in e && "render" in e, Te = (e) => {
69
+ const t = je(e);
70
+ return t instanceof He ? t : null;
71
+ }, ot = (e, t) => {
72
+ const r = e.filter((n) => at(n, t));
73
73
  return r.length === e.length ? e : r;
74
- }, ot = (e, t) => e.kind === "annotation" ? Oe(t.annotations, e.id) !== null : e.kind === "observations" ? ae(t.layers, e.layerId) !== void 0 : e.kind === "layer" && e.layerId !== void 0 ? ae(t.layers, e.layerId) !== void 0 : !0, ue = [], at = () => ne((e) => ({
75
- selection: ue,
76
- setSelection: (t) => e((r) => it(r.selection, t) ? r : { selection: t }),
77
- clearSelection: () => e((t) => t.selection.length === 0 ? t : { selection: ue })
78
- })), it = (e, t) => e === t ? !0 : e.length !== t.length ? !1 : e.every((r, n) => {
74
+ }, at = (e, t) => e.kind === "annotation" ? Ke(t.annotations, e.id) !== null : e.kind === "observations" ? ie(t.layers, e.layerId) !== void 0 : e.kind === "layer" && e.layerId !== void 0 ? ie(t.layers, e.layerId) !== void 0 : !0, me = [], it = () => se((e) => ({
75
+ selection: me,
76
+ setSelection: (t) => e((r) => ct(r.selection, t) ? r : { selection: t }),
77
+ clearSelection: () => e((t) => t.selection.length === 0 ? t : { selection: me })
78
+ })), ct = (e, t) => e === t ? !0 : e.length !== t.length ? !1 : e.every((r, n) => {
79
79
  const s = t[n];
80
- return s !== void 0 && $e(r, s);
81
- }), ct = process.env.NODE_ENV !== "production", lt = 5, dt = (e) => {
82
- if (!ct) return {
80
+ return s !== void 0 && Me(r, s);
81
+ }), lt = process.env.NODE_ENV !== "production", dt = 5, ut = (e) => {
82
+ if (!lt) return {
83
83
  emit: () => {
84
84
  },
85
- subscribe: () => mt,
85
+ subscribe: () => ht,
86
86
  getLastTrigger: () => null,
87
87
  getLastCompile: () => null,
88
88
  getCacheStats: () => e.getCacheStats()
@@ -104,7 +104,7 @@ var nt = class extends Ue {
104
104
  getLastCompile: () => e.getLastCompile(),
105
105
  getCacheStats: () => e.getCacheStats()
106
106
  };
107
- }, ut = () => ne((e) => ({
107
+ }, mt = () => se((e) => ({
108
108
  lastCompile: null,
109
109
  history: [],
110
110
  nextId: 1,
@@ -113,20 +113,20 @@ var nt = class extends Ue {
113
113
  if (n.lastSnapshot === r) return n;
114
114
  const s = {
115
115
  id: n.nextId,
116
- label: ht(t),
116
+ label: gt(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: gt(n.history, s, lt),
123
+ history: pt(n.history, s, dt),
124
124
  nextId: n.nextId + 1,
125
125
  lastSnapshot: r
126
126
  };
127
127
  })
128
- })), mt = () => {
129
- }, ht = (e) => {
128
+ })), ht = () => {
129
+ }, gt = (e) => {
130
130
  switch (e.kind) {
131
131
  case "init":
132
132
  return "init";
@@ -137,14 +137,14 @@ var nt = class extends Ue {
137
137
  case "command":
138
138
  return e.command.metadata.description;
139
139
  }
140
- }, gt = (e, t, r) => {
140
+ }, pt = (e, t, r) => {
141
141
  const n = e.length >= r ? e.length - (r - 1) : 0;
142
142
  return [...e.slice(n), t];
143
143
  };
144
- function me(e) {
145
- const t = e.filter(be), r = /* @__PURE__ */ new Set([...Object.keys(De), ...t.map((l) => l.geom)]), n = [], s = /* @__PURE__ */ new Set();
144
+ function he(e) {
145
+ const t = e.filter(Ee), r = /* @__PURE__ */ new Set([...Object.keys(we), ...t.map((l) => l.geom)]), n = [], s = /* @__PURE__ */ new Set();
146
146
  for (const l of e) {
147
- const d = Ee(l);
147
+ const d = Te(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",
@@ -160,32 +160,32 @@ function me(e) {
160
160
  const i = /* @__PURE__ */ new Map();
161
161
  for (const l of t) {
162
162
  if ("definition" in l) continue;
163
- const d = `${l.geom}|${l.coord}`, m = i.get(d);
164
- m ? m.count += 1 : i.set(d, {
163
+ const d = `${l.geom}|${l.coord}`, h = i.get(d);
164
+ h ? h.count += 1 : i.set(d, {
165
165
  geom: l.geom,
166
166
  coord: l.coord,
167
167
  count: 1
168
168
  });
169
169
  }
170
170
  const a = [];
171
- for (const { geom: l, coord: d, count: m } of i.values())
172
- m < 2 || a.push({
171
+ for (const { geom: l, coord: d, count: h } of i.values())
172
+ h < 2 || a.push({
173
173
  kind: "userInput",
174
174
  severity: "warning",
175
175
  code: "DUPLICATE_REGISTERED_TYPE",
176
- message: `Multiple render-only overrides register ('${l}', '${d}') (${m} entries); the last in the array wins.`,
176
+ message: `Multiple render-only overrides register ('${l}', '${d}') (${h} entries); the last in the array wins.`,
177
177
  context: {
178
178
  requested: `${l}@${d}`,
179
179
  kind: "geom-renderer"
180
180
  },
181
181
  suggestion: `Keep a single render-only override for ('${l}', '${d}').`
182
182
  });
183
- return a.push(...Rt(e)), {
183
+ return a.push(...Gt(e)), {
184
184
  errors: n,
185
185
  warnings: a
186
186
  };
187
187
  }
188
- function pt(e, t) {
188
+ function ft(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({
@@ -206,7 +206,7 @@ function vt(e, t) {
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 || W(l) || (s.add(a.geom), i.push({
209
+ l === null || l.hitTest || z(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 vt(e, t) {
220
220
  }
221
221
  return i;
222
222
  }
223
- function ft(e) {
223
+ function yt(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 ft(e) {
238
238
  }
239
239
  return r;
240
240
  }
241
- function yt(e, t) {
241
+ function St(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 || !W(l) || (s.add(a.geom), i.push({
246
+ l === null || !l.hitTest || !z(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 yt(e, t) {
257
257
  }
258
258
  return i;
259
259
  }
260
- function St(e, t) {
260
+ function bt(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({
@@ -273,12 +273,12 @@ function St(e, t) {
273
273
  })));
274
274
  return n;
275
275
  }
276
- function bt(e, t) {
276
+ function Et(e, t) {
277
277
  const { coordSystem: r, layers: n } = e, s = /* @__PURE__ */ new Set(), i = [];
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 || !W(l) || (s.add(a.geom), i.push({
281
+ l === null || !z(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 bt(e, t) {
292
292
  }
293
293
  return i;
294
294
  }
295
- function Et(e, t) {
295
+ function Tt(e, t) {
296
296
  let r;
297
- return e.layers.flatMap((n, s) => W(t(n.geom, e.coordSystem.type)) ? Tt(n) ? (r ??= Se().readers(e), (r.geom(n).get("overpaint", void 0, "hovered")?.length ?? 0) === 0 ? [] : [{
297
+ return e.layers.flatMap((n, s) => z(t(n.geom, e.coordSystem.type)) ? Rt(n) ? (r ??= be().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 Et(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 Tt = (e) => [e.styles.defaults, e.styles.overrides].some((t) => t.some((r) => r.state === "hovered" && (r.declarations.overpaint?.length ?? 0) > 0));
311
- function Rt(e) {
310
+ var Rt = (e) => [e.styles.defaults, e.styles.overrides].some((t) => t.some((r) => r.state === "hovered" && (r.declarations.overpaint?.length ?? 0) > 0));
311
+ function Gt(e) {
312
312
  const t = /* @__PURE__ */ new Set(), r = [];
313
313
  for (const n of e) {
314
- const s = Ee(n);
314
+ const s = Te(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,64 +326,65 @@ function Rt(e) {
326
326
  }
327
327
  return r;
328
328
  }
329
- var Nt = (e) => ne((t) => ({
329
+ var Nt = (e) => se((t) => ({
330
330
  scene: e,
331
331
  setScene: (r) => t((n) => n.scene === r ? n : { scene: r })
332
- })), Gt = ({ spec: e, data: t, colorScheme: r, plugins: n, theme: s, resolveRenderer: i, anchorResolver: a, onSpecChange: l, onError: d, onWarnings: m }) => {
333
- const G = J(l), C = J(d), T = J(m), [{ session: g, compileBus: u }] = b(() => {
334
- const o = xe({
332
+ })), Ct = ({ spec: e, data: t, colorScheme: r, plugins: n, theme: s, resolveRenderer: i, anchorResolver: a, onSpecChange: l, onError: d, onWarnings: h }) => {
333
+ const G = Z(l), N = Z(d), E = Z(h), [{ session: g, compileBus: u, findGeom: T }] = S(() => {
334
+ const o = Be({
335
335
  plugins: n,
336
336
  theme: s
337
337
  });
338
338
  return {
339
- session: new He(o),
340
- compileBus: dt(o)
339
+ session: new $e(o),
340
+ compileBus: ut(o),
341
+ findGeom: (m) => o.findGeom(m)
341
342
  };
342
- }), [p] = b(() => {
343
- const o = me(n ?? []), h = me(s?.plugins ?? []);
343
+ }), [v] = S(() => {
344
+ const o = he(n ?? []), m = he(s?.plugins ?? []);
344
345
  return {
345
- errors: [...h.errors, ...o.errors],
346
- warnings: [...h.warnings, ...o.warnings]
346
+ errors: [...m.errors, ...o.errors],
347
+ warnings: [...m.warnings, ...o.warnings]
347
348
  };
348
- }), R = ce(null), [y] = b(Ct), I = ce(null), P = v((o) => p.errors.length === 0 ? o : [...p.errors, ...o ?? []], [p]), N = v((o) => {
349
+ }), R = le(null), [q] = S(It), C = le(null), b = p((o) => v.errors.length === 0 ? o : [...v.errors, ...o ?? []], [v]), _ = p((o) => {
349
350
  if (!o.ok) return o.errors;
350
- if (I.current) I.current.getState().setScene(o.scene);
351
+ if (C.current) C.current.getState().setScene(o.scene);
351
352
  else {
352
- const h = Nt(o.scene);
353
- h.subscribe(y.notify), I.current = h, y.notify();
353
+ const m = Nt(o.scene);
354
+ m.subscribe(q.notify), C.current = m, q.notify();
354
355
  }
355
356
  return null;
356
- }, [y]), [A, k] = b(() => {
357
+ }, [q]), [O, P] = S(() => {
357
358
  const o = g.compile({
358
359
  spec: e,
359
360
  data: t,
360
361
  colorScheme: r
361
362
  });
362
- return R.current = o, P(N(o));
363
- }), E = v((o) => o.ok ? [
363
+ return R.current = o, b(_(o));
364
+ }), I = p((o) => o.ok ? [
364
365
  ...o.warnings,
365
- ...pt(o.scene, i),
366
+ ...ft(o.scene, i),
366
367
  ...vt(o.scene, i),
367
- ...ft(o.scene),
368
- ...yt(o.scene, i),
369
- ...bt(o.scene, i),
368
+ ...yt(o.scene),
369
+ ...St(o.scene, i),
370
370
  ...Et(o.scene, i),
371
- ...St(o.scene, a)
372
- ] : o.warnings, [i, a]), D = v((o) => {
373
- o.length !== 0 && (Z(o), C.current?.(o));
374
- }, [C]), w = v((o) => {
375
- o.length !== 0 && (Z(o), T.current?.(o));
376
- }, [T]);
377
- x(() => {
371
+ ...Tt(o.scene, i),
372
+ ...bt(o.scene, a)
373
+ ] : o.warnings, [i, a]), D = p((o) => {
374
+ o.length !== 0 && (ee(o), N.current?.(o));
375
+ }, [N]), w = p((o) => {
376
+ o.length !== 0 && (ee(o), E.current?.(o));
377
+ }, [E]);
378
+ B(() => {
378
379
  const o = R.current;
379
- o && (D([...p.errors, ...o.ok ? [] : o.errors]), w([...p.warnings, ...E(o)]), o.ok && u.emit({ kind: "init" }));
380
+ o && (D([...v.errors, ...o.ok ? [] : o.errors]), w([...v.warnings, ...I(o)]), o.ok && u.emit({ kind: "init" }));
380
381
  }, [
381
382
  u,
382
383
  D,
383
384
  w,
384
- p,
385
- E
386
- ]), x(() => {
385
+ v,
386
+ I
387
+ ]), B(() => {
387
388
  const o = g.update({
388
389
  spec: e,
389
390
  data: t,
@@ -391,64 +392,65 @@ var Nt = (e) => ne((t) => ({
391
392
  });
392
393
  if (!o) return;
393
394
  o.committedSpec && G.current?.(o.committedSpec);
394
- const h = N(o.result);
395
- k(P(h)), h && D(h), w(E(o.result)), h || u.emit({ kind: o.hasSpecChange ? "spec" : "data" });
395
+ const m = _(o.result);
396
+ P(b(m)), m && D(m), w(I(o.result)), m || u.emit({ kind: o.hasSpecChange ? "spec" : "data" });
396
397
  }, [
397
398
  e,
398
399
  t,
399
400
  r,
400
401
  g,
401
402
  u,
402
- N,
403
+ _,
403
404
  D,
404
405
  w,
405
- P,
406
- E,
406
+ b,
407
+ I,
407
408
  G
408
409
  ]);
409
- const L = v((o) => {
410
- k((h) => h === null ? h : P(null)), w(E(o));
410
+ const K = p((o) => {
411
+ P((m) => m === null ? m : b(null)), w(I(o));
411
412
  }, [
412
- P,
413
+ b,
413
414
  w,
414
- E
415
- ]), O = v((o) => {
416
- o.scene && I.current?.getState().setScene(o.scene), o.result && L(o.result), o.command && u.emit({
415
+ I
416
+ ]), H = p((o) => {
417
+ o.scene && C.current?.getState().setScene(o.scene), o.result && K(o.result), o.command && u.emit({
417
418
  kind: "command",
418
419
  command: o.command
419
420
  }), o.spec && G.current?.(o.spec), o.errors && D([...o.errors]);
420
421
  }, [
421
- L,
422
+ K,
422
423
  u,
423
424
  G,
424
425
  D
425
- ]), S = v((o) => {
426
- for (const h of o) O(h);
427
- return o.some((h) => !!h.scene);
428
- }, [O]), K = v((o, h) => {
429
- S(g.applyCommand(o, h));
430
- }, [g, S]), q = v(() => {
431
- S(g.commit());
432
- }, [g, S]), F = v(() => S(g.undo()), [g, S]), H = v(() => S(g.redo()), [g, S]), Q = _(() => ({
426
+ ]), y = p((o) => {
427
+ for (const m of o) H(m);
428
+ return o.some((m) => !!m.scene);
429
+ }, [H]), F = p((o, m) => {
430
+ y(g.applyCommand(o, m));
431
+ }, [g, y]), k = p(() => {
432
+ y(g.commit());
433
+ }, [g, y]), j = p(() => y(g.undo()), [g, y]), $ = p(() => y(g.redo()), [g, y]), J = L(() => ({
433
434
  stack: g.history,
434
- undo: F,
435
- redo: H
435
+ undo: j,
436
+ redo: $
436
437
  }), [
437
438
  g,
438
- F,
439
- H
440
- ]), Re = v(() => I.current?.getState().scene ?? null, []);
439
+ j,
440
+ $
441
+ ]), Ge = p(() => C.current?.getState().scene ?? null, []);
441
442
  return {
442
- store: I.current,
443
- dispatch: K,
444
- commit: q,
445
- history: Q,
446
- subscribe: y.subscribe,
447
- getScene: Re,
443
+ store: C.current,
444
+ dispatch: F,
445
+ commit: k,
446
+ history: J,
447
+ subscribe: q.subscribe,
448
+ getScene: Ge,
448
449
  compileBus: u,
449
- compileErrors: A
450
+ compileErrors: O,
451
+ findGeom: T
450
452
  };
451
- }, Ct = () => {
453
+ }, It = () => {
452
454
  const e = /* @__PURE__ */ new Set();
453
455
  return {
454
456
  subscribe: (t) => (e.add(t), () => {
@@ -456,87 +458,89 @@ var Nt = (e) => ne((t) => ({
456
458
  }),
457
459
  notify: () => e.forEach((t) => t())
458
460
  };
459
- }, It = ({ data: e, spec: t, plugins: r = [], theme: n, formattingLocale: s, handleRef: i, onSpecChange: a, onError: l, onWarnings: d, colorScheme: m = "light", children: G }) => {
460
- const [C] = b(() => n), T = C?.colorScheme ?? m, [g] = b(() => ke([...C?.plugins ?? [], ...r].filter(be))), u = We(), [p] = b(() => Me(r)), [R] = b(() => Be(r)), [y] = b(() => at()), [I] = b(() => Ie()), P = _(() => Se({ colorScheme: T }), [T]), { store: N, dispatch: A, commit: k, history: E, subscribe: D, getScene: w, compileBus: L, compileErrors: O } = Gt({
461
+ }, Dt = ({ data: e, spec: t, plugins: r = [], theme: n, formattingLocale: s, handleRef: i, onSpecChange: a, onError: l, onWarnings: d, colorScheme: h = "light", children: G }) => {
462
+ const [N] = S(() => n), E = N?.colorScheme ?? h, [g] = S(() => Le([...N?.plugins ?? [], ...r].filter(Ee))), u = ze(), [T] = S(() => xe(r)), [v] = S(() => Ae(r)), [R] = S(() => it()), [q] = S(() => De()), C = L(() => be({ colorScheme: E }), [E]), { store: b, dispatch: _, commit: O, history: P, subscribe: I, getScene: D, compileBus: w, compileErrors: K, findGeom: H } = Ct({
461
463
  spec: t,
462
464
  data: e,
463
- colorScheme: T,
465
+ colorScheme: E,
464
466
  plugins: r,
465
- theme: C,
467
+ theme: N,
466
468
  resolveRenderer: g,
467
- anchorResolver: p,
469
+ anchorResolver: T,
468
470
  onSpecChange: a,
469
471
  onError: l,
470
472
  onWarnings: d
471
473
  });
472
- x(() => {
473
- if (N)
474
- return N.subscribe((q, F) => {
475
- if (q.scene.spec === F.scene.spec) return;
476
- const { selection: H, setSelection: Q } = y.getState();
477
- H.length !== 0 && Q(st(H, q.scene.spec));
474
+ B(() => {
475
+ if (b)
476
+ return b.subscribe((k, j) => {
477
+ if (k.scene.spec === j.scene.spec) return;
478
+ const { selection: $, setSelection: J } = R.getState();
479
+ $.length !== 0 && J(ot($, k.scene.spec));
478
480
  });
479
- }, [N, y]);
480
- const S = _(() => ({
481
- dispatch: A,
482
- commit: k
483
- }), [A, k]);
484
- ze(i, () => ({
485
- commands: S,
486
- undo: E.undo,
487
- redo: E.redo,
488
- subscribe: D,
489
- getScene: w,
490
- getSelection: () => y.getState().selection,
491
- setSelection: (q) => y.getState().setSelection(q),
492
- subscribeSelection: y.subscribe,
493
- canPlaceDataLabels: R.hasCapability,
494
- canFormatDataLabelsAsPercentages: R.hasPercentageFormat
481
+ }, [b, R]);
482
+ const y = L(() => ({
483
+ dispatch: _,
484
+ commit: O
485
+ }), [_, O]);
486
+ Ye(i, () => ({
487
+ commands: y,
488
+ undo: P.undo,
489
+ redo: P.redo,
490
+ subscribe: I,
491
+ getScene: D,
492
+ getSelection: () => R.getState().selection,
493
+ setSelection: (k) => R.getState().setSelection(k),
494
+ subscribeSelection: R.subscribe,
495
+ canPlaceDataLabels: v.hasCapability,
496
+ canFormatDataLabelsAsPercentages: v.hasPercentageFormat
495
497
  }), [
496
- S,
497
- E,
498
- D,
499
- w,
500
498
  y,
501
- R
499
+ P,
500
+ I,
501
+ D,
502
+ R,
503
+ v
502
504
  ]);
503
- const K = _(() => N ? {
505
+ const F = L(() => b ? {
504
506
  chartId: u,
505
- store: N,
506
- selectionStore: y,
507
- targetBoundaryStore: I,
508
- commands: S,
509
- history: E,
507
+ store: b,
508
+ selectionStore: R,
509
+ targetBoundaryStore: q,
510
+ commands: y,
511
+ history: P,
510
512
  formattingLocale: s,
511
- compileBus: L,
512
- colorScheme: T,
513
- styleResolver: P,
514
- anchorResolver: p
513
+ compileBus: w,
514
+ colorScheme: E,
515
+ styleResolver: C,
516
+ anchorResolver: T,
517
+ findGeom: H
515
518
  } : null, [
516
519
  u,
517
- N,
520
+ b,
521
+ R,
522
+ q,
518
523
  y,
519
- I,
520
- S,
521
- E,
524
+ P,
522
525
  s,
523
- L,
526
+ w,
527
+ E,
528
+ C,
524
529
  T,
525
- P,
526
- p
530
+ H
527
531
  ]);
528
- return /* @__PURE__ */ c(nt, {
529
- forcedErrors: O,
532
+ return /* @__PURE__ */ c(st, {
533
+ forcedErrors: K,
530
534
  onError: l,
531
535
  resetKeys: [t, e],
532
- children: K ? /* @__PURE__ */ c(Ne.Provider, {
533
- value: K,
534
- children: /* @__PURE__ */ c(Ge, {
536
+ children: F ? /* @__PURE__ */ c(Ne.Provider, {
537
+ value: F,
538
+ children: /* @__PURE__ */ c(Ce, {
535
539
  value: g,
536
- children: /* @__PURE__ */ c(Ce, {
537
- value: R,
538
- children: /* @__PURE__ */ c(B, {
539
- shapes: C?.shapes,
540
+ children: /* @__PURE__ */ c(Ie, {
541
+ value: v,
542
+ children: /* @__PURE__ */ c(A, {
543
+ shapes: N?.shapes,
540
544
  children: G
541
545
  })
542
546
  })
@@ -544,40 +548,40 @@ var Nt = (e) => ne((t) => ({
544
548
  }) : null
545
549
  });
546
550
  };
547
- function on({ theme: e, ...t } = {}) {
548
- const r = Ae(t);
551
+ function an({ theme: e, ...t } = {}) {
552
+ const r = Oe(t);
549
553
  return {
550
554
  ...r,
551
- GraphProvider: (s) => /* @__PURE__ */ c(It, {
555
+ GraphProvider: (s) => /* @__PURE__ */ c(Dt, {
552
556
  ...s,
553
557
  plugins: r.plugins,
554
558
  theme: e
555
559
  })
556
560
  };
557
561
  }
558
- var M = (e, t) => {
562
+ var x = (e, t) => {
559
563
  if (typeof e == "number") return Number.isFinite(e) ? e : null;
560
564
  if (!e.endsWith("%")) return null;
561
565
  const r = Number.parseFloat(e);
562
566
  return Number.isFinite(r) ? r / 100 * t : null;
563
- }, an = ({ x: e, y: t, width: r, height: n }, s) => {
564
- const i = M(e, s.width), a = M(t, s.height), l = M(r, s.width), d = M(n, s.height);
567
+ }, cn = ({ x: e, y: t, width: r, height: n }, s) => {
568
+ const i = x(e, s.width), a = x(t, s.height), l = x(r, s.width), d = x(n, s.height);
565
569
  return i === null || a === null || l === null || d === null ? null : {
566
570
  x: i,
567
571
  y: a,
568
572
  width: l,
569
573
  height: d
570
574
  };
571
- }, Dt = ({ animateTransitions: e, cx: t, cy: r, r: n, effects: s, ...i }) => {
572
- const a = V(s);
573
- return e ? /* @__PURE__ */ c(X.circle, {
575
+ }, wt = ({ animateTransitions: e, cx: t, cy: r, r: n, effects: s, ...i }) => {
576
+ const a = X(s);
577
+ return e ? /* @__PURE__ */ c(Q.circle, {
574
578
  initial: !1,
575
579
  animate: {
576
580
  cx: t,
577
581
  cy: r,
578
582
  r: n
579
583
  },
580
- transition: Y,
584
+ transition: V,
581
585
  style: a,
582
586
  ...i
583
587
  }) : /* @__PURE__ */ c("circle", {
@@ -587,9 +591,9 @@ var M = (e, t) => {
587
591
  style: a,
588
592
  ...i
589
593
  });
590
- }, wt = ({ animateTransitions: e, x1: t, y1: r, x2: n, y2: s, effects: i, ...a }) => {
591
- const l = V(i);
592
- return e ? /* @__PURE__ */ c(X.line, {
594
+ }, Pt = ({ animateTransitions: e, x1: t, y1: r, x2: n, y2: s, effects: i, ...a }) => {
595
+ const l = X(i);
596
+ return e ? /* @__PURE__ */ c(Q.line, {
593
597
  initial: !1,
594
598
  animate: {
595
599
  x1: t,
@@ -597,7 +601,7 @@ var M = (e, t) => {
597
601
  x2: n,
598
602
  y2: s
599
603
  },
600
- transition: Y,
604
+ transition: V,
601
605
  style: l,
602
606
  ...a
603
607
  }) : /* @__PURE__ */ c("line", {
@@ -608,9 +612,9 @@ var M = (e, t) => {
608
612
  style: l,
609
613
  ...a
610
614
  });
611
- }, Pt = ({ animateTransitions: e, x: t, y: r, width: n, height: s, rx: i, ry: a, effects: l, ...d }) => {
612
- const m = V(l);
613
- return e ? /* @__PURE__ */ c(X.rect, {
615
+ }, qt = ({ animateTransitions: e, x: t, y: r, width: n, height: s, rx: i, ry: a, effects: l, ...d }) => {
616
+ const h = X(l);
617
+ return e ? /* @__PURE__ */ c(Q.rect, {
614
618
  initial: !1,
615
619
  animate: {
616
620
  attrX: t,
@@ -622,8 +626,8 @@ var M = (e, t) => {
622
626
  ry: a
623
627
  } : {}
624
628
  },
625
- transition: Y,
626
- style: m,
629
+ transition: V,
630
+ style: h,
627
631
  ...d
628
632
  }) : /* @__PURE__ */ c("rect", {
629
633
  x: t,
@@ -632,12 +636,12 @@ var M = (e, t) => {
632
636
  height: s,
633
637
  rx: i,
634
638
  ry: a,
635
- style: m,
639
+ style: h,
636
640
  ...d
637
641
  });
638
- }, qt = ({ animateTransitions: e, d: t, source: r, effects: n, ...s }) => {
639
- const i = V(n);
640
- return e ? /* @__PURE__ */ c(_t, {
642
+ }, _t = ({ animateTransitions: e, d: t, source: r, effects: n, ...s }) => {
643
+ const i = X(n);
644
+ return e ? /* @__PURE__ */ c(kt, {
641
645
  d: t,
642
646
  source: r,
643
647
  style: i,
@@ -647,56 +651,56 @@ var M = (e, t) => {
647
651
  style: i,
648
652
  ...s
649
653
  });
650
- }, cn = (e) => {
651
- const { Circle: t } = z();
652
- return t === void 0 ? Dt(e) : /* @__PURE__ */ c(B, { children: /* @__PURE__ */ c(t, { ...e }) });
653
654
  }, ln = (e) => {
654
- const { Line: t } = z();
655
- return t === void 0 ? wt(e) : /* @__PURE__ */ c(B, { children: /* @__PURE__ */ c(t, { ...e }) });
656
- }, dn = ({ cornerRadius: e, ...t }) => {
657
- const { Rect: r } = z(), n = fe(), s = Pe(), i = {
655
+ const { Circle: t } = Y();
656
+ return t === void 0 ? wt(e) : /* @__PURE__ */ c(A, { children: /* @__PURE__ */ c(t, { ...e }) });
657
+ }, dn = (e) => {
658
+ const { Line: t } = Y();
659
+ return t === void 0 ? Pt(e) : /* @__PURE__ */ c(A, { children: /* @__PURE__ */ c(t, { ...e }) });
660
+ }, un = ({ cornerRadius: e, ...t }) => {
661
+ const { Rect: r } = Y(), n = ye(), s = qe(), i = {
658
662
  ...t,
659
- ...kt(e, t, n, s)
663
+ ...Lt(e, t, n, s)
660
664
  };
661
- return r === void 0 ? Pt(i) : /* @__PURE__ */ c(B, { children: /* @__PURE__ */ c(r, { ...i }) });
662
- }, un = (e) => {
663
- const { Path: t } = z();
664
- return t === void 0 ? qt(e) : /* @__PURE__ */ c(B, { children: /* @__PURE__ */ c(t, { ...e }) });
665
- }, _t = ({ d: e, source: t, ...r }) => {
666
- const n = we(e, Y, t);
667
- return /* @__PURE__ */ c(X.path, {
665
+ return r === void 0 ? qt(i) : /* @__PURE__ */ c(A, { children: /* @__PURE__ */ c(r, { ...i }) });
666
+ }, mn = (e) => {
667
+ const { Path: t } = Y();
668
+ return t === void 0 ? _t(e) : /* @__PURE__ */ c(A, { children: /* @__PURE__ */ c(t, { ...e }) });
669
+ }, kt = ({ d: e, source: t, ...r }) => {
670
+ const n = Pe(e, V, t);
671
+ return /* @__PURE__ */ c(Q.path, {
668
672
  d: n,
669
673
  ...r
670
674
  });
671
- }, kt = (e, t, r, n) => {
675
+ }, Lt = (e, t, r, n) => {
672
676
  if (e === void 0) return {};
673
- const s = Lt(t, r, n);
677
+ const s = Ht(t, r, n);
674
678
  if (s === null)
675
- return e === "full" ? {} : ge(ie({ cornerRadius: e }), n);
676
- const i = Math.min(ie({
679
+ return e === "full" ? {} : pe(ce({ cornerRadius: e }), n);
680
+ const i = Math.min(ce({
677
681
  cornerRadius: e,
678
682
  box: s
679
683
  }), Math.min(s.width, s.height) / 2);
680
- return ge(i, n);
681
- }, Lt = (e, t, r) => {
682
- const n = he(e.width, t?.width, r.x), s = he(e.height, t?.height, r.y);
684
+ return pe(i, n);
685
+ }, Ht = (e, t, r) => {
686
+ const n = ge(e.width, t?.width, r.x), s = ge(e.height, t?.height, r.y);
683
687
  return n === null || s === null ? null : {
684
688
  width: n,
685
689
  height: s
686
690
  };
687
- }, he = (e, t, r) => {
691
+ }, ge = (e, t, r) => {
688
692
  if (typeof e == "number") return Number.isFinite(e) ? Math.abs(e) * r : null;
689
693
  if (t === void 0) return null;
690
- const n = M(e, t);
694
+ const n = x(e, t);
691
695
  return n === null ? null : Math.abs(n);
692
- }, ge = (e, t) => t.x <= 0 || t.y <= 0 ? {
696
+ }, pe = (e, t) => t.x <= 0 || t.y <= 0 ? {
693
697
  rx: 0,
694
698
  ry: 0
695
699
  } : {
696
700
  rx: e / t.x,
697
701
  ry: e / t.y
698
- }, mn = ({ children: e, ...t }) => {
699
- const r = fe();
702
+ }, hn = ({ children: e, ...t }) => {
703
+ const r = ye();
700
704
  return /* @__PURE__ */ c("svg", {
701
705
  viewBox: "0 0 1 1",
702
706
  preserveAspectRatio: "none",
@@ -704,72 +708,72 @@ var M = (e, t) => {
704
708
  height: "100%",
705
709
  pointerEvents: "none",
706
710
  ...t,
707
- children: /* @__PURE__ */ c(ye, {
711
+ children: /* @__PURE__ */ c(Se, {
708
712
  size: r,
709
713
  space: "unit",
710
714
  children: e
711
715
  })
712
716
  });
713
- }, hn = ({ box: e, children: t }) => {
714
- const r = qe(), n = r === null ? null : r.width * (e.x1 - e.x0), s = r === null ? null : r.height * (e.y1 - e.y0), i = _(() => n === null || s === null ? null : {
717
+ }, gn = ({ box: e, children: t }) => {
718
+ const r = _e(), n = r === null ? null : r.width * (e.x1 - e.x0), s = r === null ? null : r.height * (e.y1 - e.y0), i = L(() => n === null || s === null ? null : {
715
719
  width: n,
716
720
  height: s
717
721
  }, [n, s]);
718
722
  return /* @__PURE__ */ c("svg", {
719
- x: j(e.x0),
720
- y: j(e.y0),
721
- width: j(e.x1 - e.x0),
722
- height: j(e.y1 - e.y0),
723
+ x: U(e.x0),
724
+ y: U(e.y0),
725
+ width: U(e.x1 - e.x0),
726
+ height: U(e.y1 - e.y0),
723
727
  overflow: "hidden",
724
728
  pointerEvents: "none",
725
- children: /* @__PURE__ */ c(ye, {
729
+ children: /* @__PURE__ */ c(Se, {
726
730
  size: i,
727
731
  children: t
728
732
  })
729
733
  });
730
- }, Ht = "drqe3u0", $t = "drqe3u1", Mt = "drqe3u2", xt = "drqe3u3", $ = "drqe3u4", Bt = "drqe3u5", At = "drqe3u6", Ot = "drqe3u7", U = "drqe3u8", Kt = "drqe3u9", Ft = "drqe3ua";
731
- var jt = "drqe3uc", Ut = "drqe3ud", Wt = "drqe3ue", zt = "drqe3uf";
732
- var Yt = "drqe3uh", Vt = "drqe3ui", pe = {
734
+ }, $t = "drqe3u0", Mt = "drqe3u1", xt = "drqe3u2", Bt = "drqe3u3", M = "drqe3u4", At = "drqe3u5", Ot = "drqe3u6", Kt = "drqe3u7", W = "drqe3u8", Ft = "drqe3u9", jt = "drqe3ua";
735
+ var Ut = "drqe3uc", Wt = "drqe3ud", zt = "drqe3ue", Yt = "drqe3uf";
736
+ var Vt = "drqe3uh", Xt = "drqe3ui", fe = {
733
737
  enabled: "drqe3uk drqe3uj",
734
738
  disabled: "drqe3ul drqe3uj"
735
739
  }, ve = {
736
740
  ran: "drqe3un drqe3um",
737
741
  dim: "drqe3uo drqe3um"
738
- }, Te = {
742
+ }, Re = {
739
743
  ran: "drqe3uq drqe3up",
740
744
  cached: "drqe3ur drqe3up",
741
745
  untouched: "drqe3us drqe3up"
742
- }, gn = ({ width: e = 440, style: t, className: r } = {}) => {
743
- const { compileBus: n } = te(), [s] = b(() => ut()), [i, a] = b(!1), [l, d] = b(Ke);
744
- x(() => {
745
- const { recordCompile: u } = s.getState(), p = n.getLastTrigger(), R = n.getLastCompile();
746
- return p && R && u(p, R), n.subscribe(u);
746
+ }, pn = ({ width: e = 440, style: t, className: r } = {}) => {
747
+ const { compileBus: n } = re(), [s] = S(() => mt()), [i, a] = S(!1), [l, d] = S(Fe);
748
+ B(() => {
749
+ const { recordCompile: u } = s.getState(), T = n.getLastTrigger(), v = n.getLastCompile();
750
+ return T && v && u(T, v), n.subscribe(u);
747
751
  }, [s, n]);
748
- const m = ee(s, (u) => u.lastCompile), G = ee(s, (u) => u.history), C = n.getCacheStats(), T = m === null && G.length === 0, g = () => {
752
+ const h = te(s, (u) => u.lastCompile), G = te(s, (u) => u.history), N = n.getCacheStats(), E = h === null && G.length === 0, g = () => {
749
753
  d((u) => {
750
- const p = !u;
751
- return je(p), p;
754
+ const T = !u;
755
+ return Ue(T), T;
752
756
  });
753
757
  };
754
758
  return /* @__PURE__ */ f("div", {
755
- className: Xe(Ft, r),
759
+ className: Qe(jt, r),
756
760
  style: {
757
761
  width: e,
758
762
  ...t
759
763
  },
760
764
  children: [
761
765
  /* @__PURE__ */ f("div", {
762
- className: Ht,
766
+ className: $t,
763
767
  children: [/* @__PURE__ */ f("div", { children: [/* @__PURE__ */ c("div", {
764
- className: $t,
768
+ className: Mt,
765
769
  children: "compile cache"
766
770
  }), /* @__PURE__ */ c("div", {
767
- className: Wt,
768
- children: T ? "production: stats disabled" : m ? `last: ${m.label} · ${se(m.durationMs)}` : "awaiting first compile…"
771
+ className: zt,
772
+ children: E ? "production: stats disabled" : h ? `last: ${h.label} · ${oe(h.durationMs)}` : "awaiting first compile…"
769
773
  })] }), /* @__PURE__ */ c("button", {
770
774
  type: "button",
771
775
  onClick: () => a((u) => !u),
772
- className: zt,
776
+ className: Yt,
773
777
  children: i ? "▾" : "▴"
774
778
  })]
775
779
  }),
@@ -778,7 +782,7 @@ var Yt = "drqe3uh", Vt = "drqe3ui", pe = {
778
782
  children: [/* @__PURE__ */ f("button", {
779
783
  type: "button",
780
784
  onClick: g,
781
- className: l ? pe.enabled : pe.disabled,
785
+ className: l ? fe.enabled : fe.disabled,
782
786
  "aria-pressed": l,
783
787
  children: ["cache ", l ? "enabled" : "disabled"]
784
788
  }), /* @__PURE__ */ c("span", {
@@ -786,53 +790,53 @@ var Yt = "drqe3uh", Vt = "drqe3ui", pe = {
786
790
  children: "next compile reflects this toggle"
787
791
  })]
788
792
  }),
789
- !i && !T && /* @__PURE__ */ f(Ve, { children: [/* @__PURE__ */ c(Xt, {
790
- delta: m?.stages,
791
- durations: m?.stageDurationsMs,
792
- cumulative: C
793
- }), /* @__PURE__ */ c(Qt, { entries: G })] })
793
+ !i && !E && /* @__PURE__ */ f(Xe, { children: [/* @__PURE__ */ c(Qt, {
794
+ delta: h?.stages,
795
+ durations: h?.stageDurationsMs,
796
+ cumulative: N
797
+ }), /* @__PURE__ */ c(Jt, { entries: G })] })
794
798
  ]
795
799
  });
796
- }, Xt = ({ delta: e, durations: t, cumulative: r }) => /* @__PURE__ */ f("table", {
797
- className: Mt,
800
+ }, Qt = ({ delta: e, durations: t, cumulative: r }) => /* @__PURE__ */ f("table", {
801
+ className: xt,
798
802
  children: [/* @__PURE__ */ c("thead", { children: /* @__PURE__ */ f("tr", {
799
- className: Yt,
803
+ className: Vt,
800
804
  children: [
801
805
  /* @__PURE__ */ c("th", {
802
- className: xt,
806
+ className: Bt,
803
807
  children: "stage"
804
808
  }),
805
809
  /* @__PURE__ */ c("th", {
806
- className: $,
810
+ className: M,
807
811
  children: "time"
808
812
  }),
809
813
  /* @__PURE__ */ c("th", {
810
- className: $,
814
+ className: M,
811
815
  children: "Δ miss"
812
816
  }),
813
817
  /* @__PURE__ */ c("th", {
814
- className: $,
818
+ className: M,
815
819
  children: "Δ hit"
816
820
  }),
817
821
  /* @__PURE__ */ c("th", {
818
- className: $,
822
+ className: M,
819
823
  children: "total miss"
820
824
  }),
821
825
  /* @__PURE__ */ c("th", {
822
- className: $,
826
+ className: M,
823
827
  children: "total hit"
824
828
  })
825
829
  ]
826
- }) }), /* @__PURE__ */ c("tbody", { children: re.map((n) => {
827
- const s = e?.[n], i = Jt(s);
830
+ }) }), /* @__PURE__ */ c("tbody", { children: ne.map((n) => {
831
+ const s = e?.[n], i = Zt(s);
828
832
  return /* @__PURE__ */ f("tr", {
829
- className: jt,
833
+ className: Ut,
830
834
  children: [
831
835
  /* @__PURE__ */ f("td", {
832
- className: Bt,
836
+ className: At,
833
837
  children: [
834
838
  /* @__PURE__ */ c("span", {
835
- className: Te[i],
839
+ className: Re[i],
836
840
  "aria-hidden": !0
837
841
  }),
838
842
  " ",
@@ -840,67 +844,67 @@ var Yt = "drqe3uh", Vt = "drqe3ui", pe = {
840
844
  ]
841
845
  }),
842
846
  /* @__PURE__ */ c("td", {
843
- className: U,
844
- children: t === void 0 || i === "untouched" ? "—" : se(t[n])
847
+ className: W,
848
+ children: t === void 0 || i === "untouched" ? "—" : oe(t[n])
845
849
  }),
846
850
  /* @__PURE__ */ c("td", {
847
851
  className: i === "ran" ? ve.ran : ve.dim,
848
852
  children: s?.misses ?? 0
849
853
  }),
850
854
  /* @__PURE__ */ c("td", {
851
- className: U,
855
+ className: W,
852
856
  children: s?.hits ?? 0
853
857
  }),
854
858
  /* @__PURE__ */ c("td", {
855
- className: U,
859
+ className: W,
856
860
  children: r[n].misses
857
861
  }),
858
862
  /* @__PURE__ */ c("td", {
859
- className: U,
863
+ className: W,
860
864
  children: r[n].hits
861
865
  })
862
866
  ]
863
867
  }, n);
864
868
  }) })]
865
- }), Qt = ({ entries: e }) => e.length === 0 ? null : /* @__PURE__ */ f("div", {
866
- className: Ut,
869
+ }), Jt = ({ entries: e }) => e.length === 0 ? null : /* @__PURE__ */ f("div", {
870
+ className: Wt,
867
871
  children: [/* @__PURE__ */ c("div", {
868
- className: Vt,
872
+ className: Xt,
869
873
  children: "recent compiles"
870
874
  }), e.map((t) => {
871
- const r = Zt(t.stages, (i) => i.misses > 0), n = re.length;
875
+ const r = er(t.stages, (i) => i.misses > 0), n = ne.length;
872
876
  return /* @__PURE__ */ f("div", {
873
- className: At,
877
+ className: Ot,
874
878
  children: [
875
879
  /* @__PURE__ */ c("span", {
876
- className: Te[r === 0 ? "cached" : "ran"],
880
+ className: Re[r === 0 ? "cached" : "ran"],
877
881
  "aria-hidden": !0
878
882
  }),
879
883
  /* @__PURE__ */ c("span", {
880
- className: Ot,
884
+ className: Kt,
881
885
  title: t.label,
882
886
  children: t.label
883
887
  }),
884
888
  /* @__PURE__ */ f("span", {
885
- className: Kt,
889
+ className: Ft,
886
890
  children: [
887
891
  r,
888
892
  "/",
889
893
  n,
890
894
  " ran · ",
891
- se(t.durationMs)
895
+ oe(t.durationMs)
892
896
  ]
893
897
  })
894
898
  ]
895
899
  }, t.id);
896
900
  })]
897
- }), Jt = (e) => !e || e.hits === 0 && e.misses === 0 ? "untouched" : e.misses > 0 ? "ran" : "cached", Zt = (e, t) => {
901
+ }), Zt = (e) => !e || e.hits === 0 && e.misses === 0 ? "untouched" : e.misses > 0 ? "ran" : "cached", er = (e, t) => {
898
902
  let r = 0;
899
- for (const n of re) t(e[n]) && (r += 1);
903
+ for (const n of ne) t(e[n]) && (r += 1);
900
904
  return r;
901
- }, se = (e) => e < 0.1 ? "<0.1ms" : e >= 10 ? `${e.toFixed(0)}ms` : `${e.toFixed(2)}ms`, pn = () => {
902
- const { history: e } = te(), { stack: t, undo: r, redo: n } = e, s = v((l) => t.subscribe(l), [t]), i = v(() => t.getSnapshot(), [t]), a = Ye(s, i, i);
903
- return _(() => ({
905
+ }, oe = (e) => e < 0.1 ? "<0.1ms" : e >= 10 ? `${e.toFixed(0)}ms` : `${e.toFixed(2)}ms`, fn = () => {
906
+ const { history: e } = re(), { stack: t, undo: r, redo: n } = e, s = p((l) => t.subscribe(l), [t]), i = p(() => t.getSnapshot(), [t]), a = Ve(s, i, i);
907
+ return L(() => ({
904
908
  ...a,
905
909
  undo: r,
906
910
  redo: n
@@ -909,7 +913,7 @@ var Yt = "drqe3uh", Vt = "drqe3ui", pe = {
909
913
  r,
910
914
  n
911
915
  ]);
912
- }, er = /* @__PURE__ */ new Set([
916
+ }, tr = /* @__PURE__ */ new Set([
913
917
  "button",
914
918
  "checkbox",
915
919
  "color",
@@ -922,12 +926,12 @@ var Yt = "drqe3uh", Vt = "drqe3ui", pe = {
922
926
  "submit"
923
927
  ]), vn = (e, t = {}) => {
924
928
  const { target: r, enabled: n = !0 } = t;
925
- x(() => {
926
- const s = tr(r);
929
+ B(() => {
930
+ const s = rr(r);
927
931
  if (!n || !s) return;
928
932
  const i = (a) => {
929
- if (!rr(a) || a.defaultPrevented || nr(a.target)) return;
930
- const l = _e(a);
933
+ if (!nr(a) || a.defaultPrevented || sr(a.target)) return;
934
+ const l = ke(a);
931
935
  if (!l) return;
932
936
  const d = e.current;
933
937
  d && (l === "undo" ? d.undo() : d.redo()) && a.preventDefault();
@@ -938,78 +942,78 @@ var Yt = "drqe3uh", Vt = "drqe3ui", pe = {
938
942
  r,
939
943
  n
940
944
  ]);
941
- }, tr = (e) => e === void 0 ? window : e !== null && "current" in e ? e.current : e, rr = (e) => "key" in e, nr = (e) => e instanceof HTMLInputElement ? !er.has(e.type) : e instanceof HTMLElement ? e.isContentEditable || e.tagName === "TEXTAREA" : !1, fn = () => {
942
- const { targetBoundaryStore: e } = te();
943
- return ee(e, (t) => t.boundary);
945
+ }, rr = (e) => e === void 0 ? window : e !== null && "current" in e ? e.current : e, nr = (e) => "key" in e, sr = (e) => e instanceof HTMLInputElement ? !tr.has(e.type) : e instanceof HTMLElement ? e.isContentEditable || e.tagName === "TEXTAREA" : !1, yn = () => {
946
+ const { targetBoundaryStore: e } = re();
947
+ return te(e, (t) => t.boundary);
944
948
  };
945
949
  export {
946
- yr as CanvasTextMeasurer,
947
- Qr as DefaultFooter,
948
- Dt as DefaultGeomCircle,
949
- wt as DefaultGeomLine,
950
- qt as DefaultGeomPath,
951
- Pt as DefaultGeomRect,
952
- zr as DefaultGrid,
953
- Sr as DefaultHeader,
954
- jr as DefaultSwatch,
955
- Fr as DefaultTooltip,
956
- gn as DevToolsPanel,
957
- Tr as GRAPH_MODES,
958
- cn as GeomCircle,
959
- ln as GeomLine,
960
- Mr as GeomOverpaint,
961
- un as GeomPath,
962
- dn as GeomRect,
963
- nt as GraphErrorBoundary,
964
- le as GraphErrorPanel,
965
- It as GraphProvider,
966
- wr as GraphRenderer,
967
- ir as GraphyBadge,
950
+ Sr as CanvasTextMeasurer,
951
+ Jr as DefaultFooter,
952
+ wt as DefaultGeomCircle,
953
+ Pt as DefaultGeomLine,
954
+ _t as DefaultGeomPath,
955
+ qt as DefaultGeomRect,
956
+ Yr as DefaultGrid,
957
+ br as DefaultHeader,
958
+ Ur as DefaultSwatch,
959
+ jr as DefaultTooltip,
960
+ pn as DevToolsPanel,
961
+ Rr as GRAPH_MODES,
962
+ ln as GeomCircle,
963
+ dn as GeomLine,
964
+ xr as GeomOverpaint,
965
+ mn as GeomPath,
966
+ un as GeomRect,
967
+ st as GraphErrorBoundary,
968
+ de as GraphErrorPanel,
969
+ Dt as GraphProvider,
970
+ Pr as GraphRenderer,
971
+ cr as GraphyBadge,
968
972
  vr as HoverProvider,
969
- Gr as IntroFade,
970
- kr as IntroWipeClip,
971
- Cr as TextMeasurerProvider,
972
- Ar as ThemeProvider,
973
- hn as UnitBoxSvg,
974
- mn as UnitSpaceSvg,
975
- br as buildDotsEditOutlineShapes,
976
- on as createGraphyKit,
977
- Dr as darkTheme,
978
- cr as defineGeomRenderer,
973
+ Cr as IntroFade,
974
+ Lr as IntroWipeClip,
975
+ Ir as TextMeasurerProvider,
976
+ Or as ThemeProvider,
977
+ gn as UnitBoxSvg,
978
+ hn as UnitSpaceSvg,
979
+ Er as buildDotsEditOutlineShapes,
980
+ an as createGraphyKit,
981
+ wr as darkTheme,
982
+ lr as defineGeomRenderer,
979
983
  Nr as getBuiltInEditOutlineShapes,
980
- Yr as lightTheme,
981
- Wr as lightenCss,
982
- Xr as projectPointCartesian,
983
- st as pruneSelection,
984
- M as readPositionPixels,
985
- an as readRectPixels,
986
- Rr as resolveGraphyBadgeVariant,
987
- qr as resolvePathStroke,
988
- lr as scalePointToPanel,
989
- $r as stampAxisEditTarget,
990
- hr as stampGridEditTarget,
991
- pr as stampLegendEditTarget,
992
- ur as useElementScreenRect,
993
- gr as useGeomHitTest,
994
- ar as useGeomHover,
995
- qe as useGeomPanelSize,
996
- Er as useGeomReaderTree,
997
- mr as useGeomStyleReader,
998
- Or as useGraphCommands,
999
- Hr as useGraphHandle,
1000
- pn as useGraphHistory,
984
+ Vr as lightTheme,
985
+ zr as lightenCss,
986
+ Qr as projectPointCartesian,
987
+ ot as pruneSelection,
988
+ x as readPositionPixels,
989
+ cn as readRectPixels,
990
+ Gr as resolveGraphyBadgeVariant,
991
+ _r as resolvePathStroke,
992
+ dr as scalePointToPanel,
993
+ Mr as stampAxisEditTarget,
994
+ gr as stampGridEditTarget,
995
+ fr as stampLegendEditTarget,
996
+ mr as useElementScreenRect,
997
+ pr as useGeomHitTest,
998
+ ir as useGeomHover,
999
+ _e as useGeomPanelSize,
1000
+ Tr as useGeomReaderTree,
1001
+ hr as useGeomStyleReader,
1002
+ Kr as useGraphCommands,
1003
+ $r as useGraphHandle,
1004
+ fn as useGraphHistory,
1001
1005
  vn as useGraphHistoryShortcuts,
1002
- Pr as useGraphLocale,
1003
- Lr as useGraphSelection,
1004
- Vr as useGuidesTakePress,
1005
- Ur as useHandleScene,
1006
- _r as useHoverState,
1007
- Br as usePaintDefs,
1008
- or as useResolvedStyle,
1009
- xr as useSceneSelector,
1010
- dr as useStyleReaderTree,
1011
- fr as useStyleResolver,
1012
- fn as useTargetBoundary,
1013
- Ir as useTextMeasurer,
1014
- Kr as vars
1006
+ qr as useGraphLocale,
1007
+ Hr as useGraphSelection,
1008
+ Xr as useGuidesTakePress,
1009
+ Wr as useHandleScene,
1010
+ kr as useHoverState,
1011
+ Ar as usePaintDefs,
1012
+ ar as useResolvedStyle,
1013
+ Br as useSceneSelector,
1014
+ ur as useStyleReaderTree,
1015
+ yr as useStyleResolver,
1016
+ yn as useTargetBoundary,
1017
+ Dr as useTextMeasurer,
1018
+ Fr as vars
1015
1019
  };