@graphysdk/react-renderer 1.9.0-beta.1793293011268 → 1.9.0-beta.1793617099519

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