@graphysdk/react-renderer 1.9.0-beta.1790263076123 → 1.9.0-beta.1790336418293

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