@genome-spy/app 1.1.0 → 1.2.0

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.
Files changed (47) hide show
  1. package/dist/{agentApi-BgZUOeB-.js → agentApi-8hMSlqAQ.js} +8459 -6960
  2. package/dist/agentApi.es.js +5609 -4236
  3. package/dist/agentShared.es.js +9 -9
  4. package/dist/{canvas2d-DiPQvNtZ.js → canvas2d-Bd8H8MMo.js} +149 -134
  5. package/dist/{canvas2d-t_N10CeW.js → canvas2d-D6VYooRf.js} +136 -122
  6. package/dist/{clipOptions-Cba4I0AO.js → clipOptions-DElJ8dTZ.js} +2274 -2080
  7. package/dist/{clipOptions-B5PibDq3.js → clipOptions-D_wBNhzs.js} +2121 -1957
  8. package/dist/{viewIdentityRegistry-BW415b3o.js → containerView-CRJSc4bM.js} +24 -31
  9. package/dist/{viewIdentityRegistry-_F0E7nkA.js → containerView-aEVmYmkA.js} +24 -31
  10. package/dist/{debug-DP4WzTNo.js → debug-CQ0agCrd.js} +9 -9
  11. package/dist/{debug-CVAlrcZt.js → debug-DkIMiGdW.js} +10 -10
  12. package/dist/index.es.js +1133 -1115
  13. package/dist/index.js +757 -513
  14. package/dist/{indexer-En7gpvLN.js → indexer-DDC0YRGn.js} +1 -1
  15. package/dist/{indexer-DbFTKGlm.js → indexer-DOYMJ-Md.js} +1 -1
  16. package/dist/markUtils-CvLDz744.js +75 -0
  17. package/dist/{metadataChannels-DV62inJh.js → metadataChannels-DLSmx7kU.js} +6 -3
  18. package/dist/{order-R043xTpC.js → order-BVvkjDRT.js} +369 -316
  19. package/dist/{order-BkYCnwD7.js → order-DmMoZsi1.js} +360 -308
  20. package/dist/{rasterExport-C_FcNBkC.js → rasterExport-DxvowWjH.js} +4 -4
  21. package/dist/{rasterExport-Z7gs5346.js → rasterExport-jeRVq6kY.js} +4 -4
  22. package/dist/rasterization-CFogVB3B.js +50 -0
  23. package/dist/rasterization-DFj3Cvx4.js +67 -0
  24. package/dist/{rectangle-DE98gIxF.js → rectangle-DZTR6NFQ.js} +10 -1
  25. package/dist/rectangle-Dl4Dy0hS.js +191 -0
  26. package/dist/{renderCanvas2D-DK1c9TFK.js → renderCanvas2D-Bfm1NHFu.js} +99 -94
  27. package/dist/{renderCanvas2D-IM-A9DYG.js → renderCanvas2D-DVjhp834.js} +101 -96
  28. package/dist/scalePosition-0aeqp_kz.js +18 -0
  29. package/dist/schema.json +27198 -13709
  30. package/dist/style.css +1 -1
  31. package/dist/{svg-DW3tfUmm.js → svg-Bm2zxBPu.js} +316 -317
  32. package/dist/{svg-PabUdcDi.js → svg-CkfuhONt.js} +290 -291
  33. package/dist/{svgRasterizer-B6YtWLJs.js → svgRasterizer-DoRQEqFA.js} +3 -3
  34. package/dist/{svgRasterizer-BEVDyyS3.js → svgRasterizer-raDDhBF-.js} +3 -3
  35. package/dist/{vega-scale-Byaw1K8O.js → vega-scale-BoGHANI7.js} +90 -90
  36. package/dist/{vega-scale-Ctz_wa3z.js → vega-scale-o9TRyzYH.js} +699 -699
  37. package/dist/viewError-BkJeVYXA.js +33 -0
  38. package/dist/viewError-IYqyluc7.js +33 -0
  39. package/dist/{viewSelectors-KtD-QSN0.js → viewSelectors-7LyasQN-.js} +572 -478
  40. package/dist/{viewSelectors-DYz-PhTO.js → viewSelectors-CbmkSQRT.js} +624 -530
  41. package/dist/{viewUtils-BZGPseMx.js → viewUtils-DuddMNNw.js} +2146 -2016
  42. package/dist/{webgl-tdKf9SlZ.js → webgl-CQfvgnxo.js} +1247 -1137
  43. package/dist/{webgl-BKSGqHaz.js → webgl-DVYkXtiZ.js} +1495 -1386
  44. package/package.json +4 -4
  45. package/src/spec/view.d.ts +44 -5
  46. package/dist/rasterization-_-9JmSas.js +0 -63
  47. package/dist/viewError-BiR9VCgL.js +0 -29
@@ -1,83 +1,87 @@
1
- import { $t as e, Ot as t, St as n, Tt as r, V as i, an as a, b as o, cn as s, ft as c, gn as l, k as u, ln as d, o as f, pt as p, t as m, u as ee, un as te, wt as ne, xt as h } from "./clipOptions-Cba4I0AO.js";
2
- import { a as g, n as re, r as ie, t as _ } from "./viewError-BiR9VCgL.js";
3
- import { H as ae, m as oe, y as v } from "./vega-scale-Byaw1K8O.js";
4
- import { t as se } from "./warning-CpIIpk8e.js";
1
+ import { At as e, B as t, Bt as n, Dt as r, It as i, Lt as a, Nt as o, O as s, On as c, Pt as l, Sn as u, _n as d, bn as f, dn as p, ft as m, l as ee, o as te, pt as ne, t as re, xn as ie, y as h } from "./clipOptions-D_wBNhzs.js";
2
+ import { a as g, n as ae, r as oe, t as _ } from "./viewError-IYqyluc7.js";
3
+ import { H as se, m as v, y } from "./vega-scale-BoGHANI7.js";
4
+ import { t as ce } from "./warning-CpIIpk8e.js";
5
5
  //#region ../core/src/view/layout/flexLayout.js
6
- function ce(e, t, { spacing: n, devicePixelRatio: r, offset: i, reverse: a } = {}) {
7
- n ||= 0, i ||= 0;
8
- let o = ge(e, t, n), s = 0, c = 0;
9
- for (let t = 0; t < e.length; t++) s += o[t], S(e[t]) || c++;
10
- let l = s + Math.max(0, c - 1) * n, u = r === void 0 ? (e) => e : (e) => Math.round(e * r) / r, d = 0, f = [], p = (e) => {
6
+ function le(e, t, n = {}) {
7
+ let { sizes: r } = ve(e, t, n.spacing || 0);
8
+ return b(e, r, t, n);
9
+ }
10
+ function b(e, t, n, { spacing: r, devicePixelRatio: i, offset: a, reverse: o } = {}) {
11
+ r ||= 0, a ||= 0;
12
+ let s = 0, c = 0;
13
+ for (let n = 0; n < e.length; n++) s += t[n], C(e[n]) || c++;
14
+ let l = s + Math.max(0, c - 1) * r, u = i === void 0 ? (e) => e : (e) => Math.round(e * i) / i, d = 0, f = [], p = (e) => {
11
15
  let t = d;
12
16
  if (!t) return;
13
- let r = (e ? n : 0) * (a ? -1 : 1);
14
- m -= r;
17
+ let n = (e ? r : 0) * (o ? -1 : 1);
18
+ m -= n;
15
19
  for (let e = 0; e < t; e++) f.push({
16
- location: m + (e + 1) / (t + 1) * r,
20
+ location: m + (e + 1) / (t + 1) * n,
17
21
  size: 0
18
22
  });
19
- m += r, d = 0;
20
- }, m = a ? Math.max(t, l) : 0 + i;
21
- if (e.length == 1 && S(e[0])) return [{
23
+ m += n, d = 0;
24
+ }, m = o ? Math.max(n, l) : 0 + a;
25
+ if (e.length == 1 && C(e[0])) return [{
22
26
  location: m,
23
27
  size: 0
24
28
  }];
25
- for (let t = 0; t < e.length; t++) {
26
- let r = e[t];
27
- if (S(r)) d++;
29
+ for (let n = 0; n < e.length; n++) {
30
+ let i = e[n];
31
+ if (C(i)) d++;
28
32
  else {
29
33
  p(f.length > 0);
30
- let e = o[t];
31
- a && (m -= e), f.push({
34
+ let e = t[n];
35
+ o && (m -= e), f.push({
32
36
  location: u(m),
33
37
  size: u(e)
34
- }), a ? m -= n : m += e + n;
38
+ }), o ? m -= r : m += e + r;
35
39
  }
36
40
  }
37
- return m += a ? n : -n, p(!1), f;
41
+ return m += o ? r : -r, p(!1), f;
38
42
  }
39
- function le(e, { spacing: t } = { spacing: 0 }) {
43
+ function ue(e, { spacing: t } = { spacing: 0 }) {
40
44
  let n = 0;
41
- for (let r of e) n += E(r) + (S(r) ? 0 : t);
45
+ for (let r of e) n += E(r) + (C(r) ? 0 : t);
42
46
  return Math.max(0, n - t);
43
47
  }
44
- function ue(e, t, { spacing: n = 0 } = {}) {
48
+ function de(e, t, { spacing: n = 0 } = {}) {
45
49
  let r = [], i = [], a = 0, o = 0;
46
50
  for (let [s, c] of e.entries()) {
47
- let e = E(c), l = !S(c), u = o && l ? n : 0;
51
+ let e = E(c), l = !C(c), u = o && l ? n : 0;
48
52
  i.length && a + u + e > t && (r.push(i), i = [], a = 0, o = 0), i.push(s), a += (o && l ? n : 0) + e, o += +!!l;
49
53
  }
50
54
  return i.length && r.push(i), r;
51
55
  }
52
- function de(e) {
56
+ function fe(e) {
53
57
  let t = 0, n = 0, r = 0, i, a = !0;
54
58
  for (let o of e) {
55
59
  t = Math.max(t, o.px ?? 0), n = Math.max(n, o.grow ?? 0), r = Math.max(r, E(o));
56
60
  let e = D(o);
57
61
  e === void 0 ? a = !1 : i = i === void 0 ? e : Math.max(i, e);
58
62
  }
59
- return O({
63
+ return A({
60
64
  px: t,
61
65
  grow: n,
62
66
  minPx: r,
63
67
  maxPx: a ? i : void 0
64
68
  });
65
69
  }
66
- function fe(e) {
67
- let t = {
68
- px: 0,
69
- grow: 0,
70
- minPx: 0,
71
- maxPx: 0
72
- }, n = !0;
73
- for (let r of e) {
74
- t.px += C(r.px), t.grow += C(r.grow), t.minPx += E(r);
75
- let e = D(r);
76
- e === void 0 ? n = !1 : t.maxPx += e;
77
- }
78
- return n || delete t.maxPx, O(t);
79
- }
80
- var y = class e {
70
+ function pe(e, t = 0, n = 0) {
71
+ let r = Math.max(0, e.length - 1) * t, i = {
72
+ px: r,
73
+ grow: e.length ? 0 : n,
74
+ minPx: r,
75
+ maxPx: r
76
+ }, a = e.length > 0;
77
+ for (let t of e) {
78
+ i.px += w(t.px), i.grow += w(t.grow), i.minPx += E(t);
79
+ let e = D(t);
80
+ e === void 0 ? a = !1 : i.maxPx += e;
81
+ }
82
+ return a || delete i.maxPx, A(i);
83
+ }
84
+ var x = class e {
81
85
  constructor(e, t) {
82
86
  this.width = e, this.height = t;
83
87
  }
@@ -88,31 +92,31 @@ var y = class e {
88
92
  return this.#e(-e.width, -e.height);
89
93
  }
90
94
  #e(t, n) {
91
- return new e(ye(this.width, t), ye(this.height, n));
95
+ return new e(k(this.width, t), k(this.height, n));
92
96
  }
93
97
  isGrowing() {
94
98
  return !!(this.width.grow || this.height.grow);
95
99
  }
96
- }, b = Object.freeze({
100
+ }, me = Object.freeze({
97
101
  px: 0,
98
102
  grow: 0
99
- }), x = new y(b, b);
100
- function S(e) {
103
+ }), S = new x(me, me);
104
+ function C(e) {
101
105
  return !e.px && !e.grow && !e.minPx;
102
106
  }
103
- function pe(e, t) {
107
+ function he(e, t) {
104
108
  return !e || !t ? !1 : e.px === t.px && e.grow === t.grow && e.minPx === t.minPx && e.maxPx === t.maxPx;
105
109
  }
106
- function C(e) {
110
+ function w(e) {
107
111
  return e || 0;
108
112
  }
109
- function me(e) {
110
- return e && (s(e.px) || s(e.grow) || s(e.minPx) || s(e.maxPx));
113
+ function ge(e) {
114
+ return e && (f(e.px) || f(e.grow) || f(e.minPx) || f(e.maxPx));
111
115
  }
112
- function he(e) {
113
- if (J(e)) throw Error("parseSizeDef does not accept step-based sizes.");
114
- if (me(e)) return w(e), O(e);
115
- if (s(e)) return {
116
+ function _e(e) {
117
+ if (q(e)) throw Error("parseSizeDef does not accept step-based sizes.");
118
+ if (ge(e)) return be(e), A(e);
119
+ if (f(e)) return {
116
120
  px: e,
117
121
  grow: 0
118
122
  };
@@ -122,80 +126,89 @@ function he(e) {
122
126
  };
123
127
  throw Error(`Invalid sizeDef: ${e}`);
124
128
  }
125
- function ge(e, t, n) {
129
+ function ve(e, t, n = 0) {
126
130
  let r = !1;
127
- for (let t of e) w(t), r ||= ve(t);
128
- if (!r) return _e(e, t, n);
131
+ for (let t of e) be(t), r ||= O(t);
132
+ if (!r) return ye(e, t, n);
129
133
  let i = Array(e.length).fill(0), a = [];
130
- for (let t = 0; t < e.length; t++) S(e[t]) || a.push(t);
134
+ for (let t = 0; t < e.length; t++) C(e[t]) || a.push(t);
131
135
  let o = Math.max(0, a.length - 1) * n, s = Math.max(0, t - o), c = /* @__PURE__ */ new Set();
132
136
  for (let t of a) {
133
137
  let n = e[t];
134
- C(n.grow) || (i[t] = T(C(n.px), n), c.add(t));
138
+ w(n.grow) || (i[t] = T(w(n.px), n), c.add(t));
135
139
  }
140
+ let l = 0;
136
141
  for (;;) {
137
142
  let t = 0, n = 0, r = 0;
138
- for (let o of a) c.has(o) ? r += i[o] : (t += C(e[o].px), n += C(e[o].grow));
143
+ for (let o of a) c.has(o) ? r += i[o] : (t += w(e[o].px), n += w(e[o].grow));
139
144
  if (!n) {
140
- for (let t of a) c.has(t) || (i[t] = T(C(e[t].px), e[t]), c.add(t));
145
+ for (let t of a) c.has(t) || (i[t] = T(w(e[t].px), e[t]), c.add(t));
141
146
  break;
142
147
  }
143
- let o = Math.max(0, s - r - t), l = 0, u = [], d = [];
148
+ let o = Math.max(0, s - r - t);
149
+ l = o / n;
150
+ let u = 0, d = [], f = [];
144
151
  for (let t of a) {
145
152
  if (c.has(t)) continue;
146
- let r = e[t], a = C(r.px) + C(r.grow) / n * o, s = T(a, r);
153
+ let r = e[t], a = w(r.px) + w(r.grow) / n * o, s = T(a, r);
147
154
  i[t] = s;
148
- let f = s - a;
149
- l += f, f > 0 ? u.push(t) : f < 0 && d.push(t);
155
+ let l = s - a;
156
+ u += l, l > 0 ? d.push(t) : l < 0 && f.push(t);
150
157
  }
151
- if (!u.length && !d.length) break;
152
- if (l > 0) for (let e of u) c.add(e);
153
- else if (l < 0) for (let e of d) c.add(e);
158
+ if (!d.length && !f.length) break;
159
+ if (u > 0) for (let e of d) c.add(e);
160
+ else if (u < 0) for (let e of f) c.add(e);
154
161
  else for (let e of a) c.add(e);
155
162
  }
156
- return i;
163
+ return {
164
+ sizes: i,
165
+ growth: l
166
+ };
157
167
  }
158
- function _e(e, t, n) {
168
+ function ye(e, t, n) {
159
169
  let r = 0, i = 0;
160
- for (let t of e) r += C(t.px) + (S(t) ? 0 : n), i += C(t.grow);
170
+ for (let t of e) r += w(t.px) + (C(t) ? 0 : n), i += w(t.grow);
161
171
  r -= n;
162
172
  let a = Math.max(0, t - r), o = Array(e.length);
163
173
  for (let t = 0; t < e.length; t++) {
164
174
  let n = e[t];
165
- o[t] = S(n) ? 0 : C(n.px) + (i ? C(n.grow) / i * a : 0);
175
+ o[t] = C(n) ? 0 : w(n.px) + (i ? w(n.grow) / i * a : 0);
166
176
  }
167
- return o;
177
+ return {
178
+ sizes: o,
179
+ growth: i ? a / i : 0
180
+ };
168
181
  }
169
- function w(e) {
182
+ function be(e) {
170
183
  if (e.minPx !== void 0 && e.maxPx !== void 0 && e.minPx > e.maxPx) throw Error("SizeDef minPx cannot be greater than maxPx.");
171
184
  }
172
185
  function T(e, t) {
173
186
  return Math.min(Math.max(e, t.minPx ?? 0), t.maxPx ?? Infinity);
174
187
  }
175
188
  function E(e) {
176
- return T(C(e.px), e);
189
+ return T(w(e.px), e);
177
190
  }
178
191
  function D(e) {
179
- return e.maxPx ?? (C(e.grow) ? void 0 : E(e));
192
+ return e.maxPx ?? (w(e.grow) ? void 0 : E(e));
180
193
  }
181
- function ve(e) {
194
+ function O(e) {
182
195
  return e.minPx !== void 0 || e.maxPx !== void 0;
183
196
  }
184
- function ye(e, t) {
185
- return O({
197
+ function k(e, t) {
198
+ return A({
186
199
  px: (e.px ?? 0) + t,
187
200
  grow: e.grow,
188
201
  minPx: e.minPx === void 0 ? void 0 : Math.max(0, e.minPx + t),
189
202
  maxPx: e.maxPx === void 0 ? void 0 : Math.max(0, e.maxPx + t)
190
203
  });
191
204
  }
192
- function O(e) {
193
- let t = {}, n = e.px !== void 0, r = e.grow !== void 0, i = ve(e);
194
- return e.px ? t.px = e.px : e.px === 0 && (t.px = 0), e.grow ? t.grow = e.grow : e.grow === 0 ? t.grow = 0 : !n && !r && i && (t.grow = 1), e.minPx && e.minPx > C(e.px) && (t.minPx = e.minPx), e.maxPx !== void 0 && (C(t.grow) || e.maxPx < C(e.px)) && (t.maxPx = e.maxPx), t;
205
+ function A(e) {
206
+ let t = {}, n = e.px !== void 0, r = e.grow !== void 0, i = O(e);
207
+ return e.px ? t.px = e.px : e.px === 0 && (t.px = 0), e.grow ? t.grow = e.grow : e.grow === 0 ? t.grow = 0 : !n && !r && i && (t.grow = 1), e.minPx && e.minPx > w(e.px) && (t.minPx = e.minPx), e.maxPx !== void 0 && (w(t.grow) || e.maxPx < w(e.px)) && (t.maxPx = e.maxPx), t;
195
208
  }
196
209
  //#endregion
197
210
  //#region ../core/src/view/layout/padding.js
198
- var k = class e {
211
+ var j = class e {
199
212
  constructor(e, t, n, r) {
200
213
  this.top = e || 0, this.right = t || 0, this.bottom = n || 0, this.left = r || 0;
201
214
  }
@@ -230,35 +243,35 @@ var k = class e {
230
243
  return this.top + this.bottom;
231
244
  }
232
245
  static createFromConfig(e) {
233
- return typeof e == "number" ? this.createUniformPadding(e) : e ? this.createFromRecord(e) : A;
246
+ return typeof e == "number" ? this.createUniformPadding(e) : e ? this.createFromRecord(e) : M;
234
247
  }
235
248
  static createFromRecord(t) {
236
249
  return new e(t.top, t.right, t.bottom, t.left);
237
250
  }
238
251
  static zero() {
239
- return A;
252
+ return M;
240
253
  }
241
254
  static createUniformPadding(t) {
242
255
  return new e(t, t, t, t);
243
256
  }
244
257
  };
245
- function be(e, t) {
246
- return t ? new k(t.top === !1 ? 0 : e.top, t.right === !1 ? 0 : e.right, t.bottom === !1 ? 0 : e.bottom, t.left === !1 ? 0 : e.left) : e;
258
+ function xe(e, t, n = j.zero()) {
259
+ return t ? new j(t.top === !1 ? n.top : e.top, t.right === !1 ? n.right : e.right, t.bottom === !1 ? n.bottom : e.bottom, t.left === !1 ? n.left : e.left) : e;
247
260
  }
248
- var A = k.createUniformPadding(0);
249
- Object.freeze(A);
261
+ var M = j.createUniformPadding(0);
262
+ Object.freeze(M);
250
263
  //#endregion
251
264
  //#region ../core/src/utils/url.js
252
- var xe = /^([A-Za-z]+:)?\/\//;
253
- function j(e, t) {
254
- if (t && xe.test(t)) return t;
265
+ var Se = /^([A-Za-z]+:)?\/\//;
266
+ function N(e, t) {
267
+ if (t && Se.test(t)) return t;
255
268
  let n = typeof e == "function" ? e() : e;
256
269
  if (!n) return t;
257
270
  if (!t) return n;
258
271
  if (/[#?]/.test(n)) throw Error(`Cannot append to a url with query or hash. Append: ${t}, base: ${n}`);
259
- return M(n) + t;
272
+ return P(n) + t;
260
273
  }
261
- function Se(e, t, n = Ce()) {
274
+ function Ce(e, t, n = we()) {
262
275
  let r = typeof e == "function" ? e() : e;
263
276
  if (!t) return r;
264
277
  try {
@@ -268,19 +281,19 @@ function Se(e, t, n = Ce()) {
268
281
  }
269
282
  if (n) return new URL(t, n).href;
270
283
  } catch {}
271
- return j(r, t);
284
+ return N(r, t);
272
285
  }
273
- function M(e) {
286
+ function P(e) {
274
287
  let t = e.replace(/[^/]*$/, "");
275
288
  return t === "" ? void 0 : t.endsWith("://") ? e + "/" : t;
276
289
  }
277
- function Ce() {
290
+ function we() {
278
291
  if (typeof document < "u" && document.baseURI) return document.baseURI;
279
292
  if (typeof window < "u" && window.location?.href) return window.location.href;
280
293
  }
281
294
  //#endregion
282
295
  //#region ../../node_modules/flatqueue/index.js
283
- var N = class {
296
+ var F = class {
284
297
  constructor(e = Infinity, t = Float64Array, n = Uint32Array) {
285
298
  let r = e !== Infinity;
286
299
  this.ids = r ? new n(e) : [], this.values = r ? new t(e) : [], this.capacity = e, this.length = 0;
@@ -321,11 +334,11 @@ var N = class {
321
334
  shrink() {
322
335
  Array.isArray(this.ids) && (this.ids.length = this.length), Array.isArray(this.values) && (this.values.length = this.length);
323
336
  }
324
- }, P = Symbol("runtimeNode"), F = 1e6;
325
- function we(e) {
337
+ }, I = Symbol("runtimeNode"), L = 1e6;
338
+ function Te(e) {
326
339
  return e ? (t, n) => e.addDisposer(t, n) : () => () => void 0;
327
340
  }
328
- function I(e, t, n = !0) {
341
+ function R(e, t, n = !0) {
329
342
  let r = {
330
343
  id: e.id,
331
344
  name: e.name,
@@ -340,7 +353,7 @@ function I(e, t, n = !0) {
340
353
  };
341
354
  }
342
355
  };
343
- return Object.defineProperty(r, P, {
356
+ return Object.defineProperty(r, I, {
344
357
  enumerable: !1,
345
358
  configurable: !1,
346
359
  writable: !1,
@@ -349,18 +362,18 @@ function I(e, t, n = !0) {
349
362
  t(e);
350
363
  } }) : r;
351
364
  }
352
- function Te(e) {
353
- let t = e[P];
365
+ function Ee(e) {
366
+ let t = e[I];
354
367
  if (!t) throw Error("ParamRef is not bound to this graph runtime. Expected runtime-created ref.");
355
368
  return t;
356
369
  }
357
- function Ee(e) {
358
- return typeof e.rank == "number" ? e.rank : Te(e).rank;
359
- }
360
370
  function De(e) {
371
+ return typeof e.rank == "number" ? e.rank : Ee(e).rank;
372
+ }
373
+ function Oe(e) {
361
374
  for (let t of e) t();
362
375
  }
363
- var Oe = class {
376
+ var ke = class {
364
377
  #e = 1;
365
378
  #t = 1;
366
379
  #n = 0;
@@ -374,12 +387,13 @@ var Oe = class {
374
387
  #u = /* @__PURE__ */ new Map();
375
388
  #d = /* @__PURE__ */ new Set();
376
389
  #f = /* @__PURE__ */ new Set();
377
- #p = new N();
378
- #m = new N();
390
+ #p = new F();
391
+ #m = new F();
379
392
  #h = /* @__PURE__ */ new Set();
380
393
  #g;
394
+ #_;
381
395
  constructor(e = {}) {
382
- this.#g = we(e.lifecycleRegistry);
396
+ this.#g = Te(e.lifecycleRegistry), this.#_ = e.onError;
383
397
  }
384
398
  createWritable(e, t, n, r, i = {}) {
385
399
  let a = "n" + this.#e++, o = i.notify ?? !0, s = {
@@ -397,20 +411,20 @@ var Oe = class {
397
411
  }
398
412
  }, c = (e) => {
399
413
  if (s.disposed) throw Error("Cannot set disposed parameter \"" + t + "\" (" + a + ").");
400
- e !== s.value && (s.value = e, o && this.#v(s.listeners));
414
+ e !== s.value && (s.value = e, o && this.#y(s.listeners));
401
415
  }, l = () => {
402
416
  s.disposed = !0, s.listeners.clear(), u();
403
417
  }, u = this.#g(e, l);
404
- return Object.assign(I(s, c, o), { dispose: l });
418
+ return Object.assign(R(s, c, o), { dispose: l });
405
419
  }
406
420
  computed(e, t, n, r, i = {}) {
407
- return this.#_(e, t, n, r, i);
421
+ return this.#v(e, t, n, r, i);
408
422
  }
409
423
  operation(e, t, n, r, i, a = {}) {
410
- return this.#_(e, t, n, r, a, i);
424
+ return this.#v(e, t, n, r, a, i);
411
425
  }
412
- #_(e, t, n, r, i, a) {
413
- let o = this.#b(() => s.dependencies), s = {
426
+ #v(e, t, n, r, i, a) {
427
+ let o = this.#S(() => s.dependencies), s = {
414
428
  id: "n" + this.#e++,
415
429
  name: t,
416
430
  kind: "derived",
@@ -432,31 +446,31 @@ var Oe = class {
432
446
  };
433
447
  a?.(s.value);
434
448
  let c = () => s.dependencies.map((e) => e.subscribe(() => {
435
- s.disposed || (this.#x(s), e.propagation === "sync" && this.flushNow());
449
+ s.disposed || (this.#C(s), e.propagation === "sync" && this.flushNow());
436
450
  })), l = c(), u = () => {
437
451
  s.disposed || (s.disposed = !0, d(), l.forEach((e) => e()), s.listeners.clear(), this.#d.delete(s));
438
452
  }, d = this.#g(e, u);
439
- return Object.assign(I(s), {
453
+ return Object.assign(R(s), {
440
454
  dispose: u,
441
455
  rebind: (e, n) => {
442
456
  if (s.disposed) throw Error("Cannot rebind disposed operation: " + t);
443
457
  let r = /* @__PURE__ */ new Set(), i = (e) => {
444
- let n = e[P];
458
+ let n = e[I];
445
459
  if (n === s) throw Error("Reactive dependency cycle: " + t);
446
460
  if (!r.has(n)) {
447
461
  r.add(n);
448
462
  for (let e of n?.dependencies ?? []) i(e);
449
463
  }
450
464
  };
451
- e.forEach(i), l.forEach((e) => e()), s.dependencies = e, s.fn = n, this.#n++, l = c(), this.#x(s), this.#p.clear();
452
- for (let e of this.#d) this.#p.push(e, this.#C(e.rank));
465
+ e.forEach(i), l.forEach((e) => e()), s.dependencies = e, s.fn = n, this.#n++, l = c(), this.#C(s), this.#p.clear();
466
+ for (let e of this.#d) this.#p.push(e, this.#T(e.rank));
453
467
  this.#m.clear();
454
- for (let e of this.#f) this.#m.push(e, this.#C(e.rank));
468
+ for (let e of this.#f) this.#m.push(e, this.#T(e.rank));
455
469
  }
456
470
  });
457
471
  }
458
472
  effect(e, t, n) {
459
- let r = this.#b(() => t), i = {
473
+ let r = this.#S(() => t), i = {
460
474
  id: "n" + this.#e++,
461
475
  get rank() {
462
476
  return r();
@@ -464,7 +478,7 @@ var Oe = class {
464
478
  disposed: !1,
465
479
  fn: n
466
480
  }, a = t.map((e) => e.subscribe(() => {
467
- i.disposed || (this.#S(i), e.propagation === "sync" && this.flushNow());
481
+ i.disposed || (this.#w(i), e.propagation === "sync" && this.flushNow());
468
482
  })), o = () => {
469
483
  i.disposed || (i.disposed = !0, s(), a.forEach((e) => e()), this.#f.delete(i));
470
484
  }, s = this.#g(e, o);
@@ -472,10 +486,12 @@ var Oe = class {
472
486
  }
473
487
  runInTransaction(e) {
474
488
  this.#r += 1;
489
+ let t = !1;
475
490
  try {
476
- return e();
491
+ let n = e();
492
+ return t = !0, n;
477
493
  } finally {
478
- --this.#r, this.#r === 0 && (this.#i ? (this.#i = !1, this.flushNow()) : this.#w());
494
+ --this.#r, this.#r === 0 && (t ? this.#i ? (this.#i = !1, this.flushNow()) : this.#E() : this.#i = !1);
479
495
  }
480
496
  }
481
497
  flushNow({ afterTransaction: e = !1 } = {}) {
@@ -491,14 +507,14 @@ var Oe = class {
491
507
  for (; this.#p.length;) {
492
508
  let e = this.#p.pop();
493
509
  if (this.#d.delete(e), e.disposed) continue;
494
- this.#y(e, e.name);
510
+ this.#x(e, e.name);
495
511
  let t, n;
496
512
  try {
497
513
  t = e.fn(), n = !e.equals(t, e.value), n && e.apply?.(t);
498
514
  } catch (t) {
499
- throw this.#x(e), t;
515
+ throw this.#C(e), t;
500
516
  }
501
- n && (e.value = t, this.#v(e.listeners));
517
+ n && (e.value = t, this.#y(e.listeners));
502
518
  }
503
519
  if (this.#l.size) {
504
520
  let e = Infinity, n;
@@ -515,20 +531,16 @@ var Oe = class {
515
531
  if (!e) break;
516
532
  n = e;
517
533
  }
518
- t = this.#l.get(n).onError, this.#l.delete(n), this.#y(n, "streaming update"), n(), t = void 0;
534
+ t = this.#l.get(n).onError, this.#l.delete(n), this.#x(n, "streaming update"), n(), t = void 0;
519
535
  } else if (this.#m.length) {
520
536
  let e = this.#m.pop();
521
- this.#f.delete(e), e.disposed || (this.#y(e, "effect " + e.id), e.fn());
537
+ this.#f.delete(e), e.disposed || (this.#x(e, "effect " + e.id), e.fn());
522
538
  }
523
539
  }
524
540
  } catch (e) {
525
- let n = Array.from(this.#l.values());
526
- this.#l.clear(), t?.(e);
527
- for (let t of n) t.onError?.(e);
528
- for (let t of this.#h) t.reject(e);
529
- throw this.#h.clear(), e;
541
+ throw this.#b(e, t), e;
530
542
  } finally {
531
- this.#u.clear(), this.#o = !1, this.#E();
543
+ this.#u.clear(), this.#o = !1, this.#O();
532
544
  }
533
545
  }
534
546
  requestUpdate(e, t = 0, n, r) {
@@ -536,26 +548,41 @@ var Oe = class {
536
548
  rank: t,
537
549
  onError: n,
538
550
  prerequisites: r
539
- }), this.#w();
551
+ }), this.#E();
540
552
  }
541
553
  cancelUpdate(e) {
542
554
  this.#l.delete(e);
543
555
  }
544
- #v(e) {
556
+ #y(e) {
545
557
  this.#s++;
546
558
  try {
547
- De(e);
559
+ Oe(e);
560
+ } catch (e) {
561
+ throw this.#c = !1, !this.#o && this.#s === 1 && this.#b(e), e;
548
562
  } finally {
549
563
  this.#s--, !this.#s && this.#c && (this.#c = !1, this.flushNow());
550
564
  }
551
565
  }
552
- #y(e, t) {
566
+ #b(e, t) {
567
+ this.#a = !1;
568
+ let n = Array.from(this.#l.values());
569
+ this.#l.clear(), t?.(e);
570
+ for (let t of n) t.onError?.(e);
571
+ for (let t of this.#h) t.reject(e);
572
+ this.#h.clear();
573
+ try {
574
+ this.#_?.(e);
575
+ } catch (e) {
576
+ console.error(e);
577
+ }
578
+ }
579
+ #x(e, t) {
553
580
  let n = (this.#u.get(e) ?? 0) + 1;
554
581
  if (n > 100) throw Error("Reactive propagation did not settle: " + t);
555
582
  this.#u.set(e, n);
556
583
  }
557
584
  whenPropagated(e = {}) {
558
- if (this.#T()) return Promise.resolve();
585
+ if (this.#D()) return Promise.resolve();
559
586
  let { signal: t, timeoutMs: n } = e;
560
587
  return t?.aborted ? Promise.reject(/* @__PURE__ */ Error("whenPropagated aborted")) : new Promise((e, r) => {
561
588
  let i, a = () => {
@@ -571,43 +598,43 @@ var Oe = class {
571
598
  t?.addEventListener("abort", s, { once: !0 }), n != null && (i = setTimeout(() => o.reject(/* @__PURE__ */ Error("whenPropagated timeout after " + n + " ms")), n)), this.#h.add(o);
572
599
  });
573
600
  }
574
- #b(e) {
601
+ #S(e) {
575
602
  let t = -1, n = 0;
576
- return () => (t !== this.#n && (n = 1 + e().reduce((e, t) => Math.max(e, Ee(t)), 0), t = this.#n), n);
603
+ return () => (t !== this.#n && (n = 1 + e().reduce((e, t) => Math.max(e, De(t)), 0), t = this.#n), n);
577
604
  }
578
- #x(e) {
605
+ #C(e) {
579
606
  if (this.#d.has(e)) {
580
- this.#w();
607
+ this.#E();
581
608
  return;
582
609
  }
583
- this.#d.add(e), this.#p.push(e, this.#C(e.rank)), this.#w();
610
+ this.#d.add(e), this.#p.push(e, this.#T(e.rank)), this.#E();
584
611
  }
585
- #S(e) {
612
+ #w(e) {
586
613
  if (this.#f.has(e)) {
587
- this.#w();
614
+ this.#E();
588
615
  return;
589
616
  }
590
- this.#f.add(e), this.#m.push(e, this.#C(e.rank)), this.#w();
617
+ this.#f.add(e), this.#m.push(e, this.#T(e.rank)), this.#E();
591
618
  }
592
- #C(e) {
593
- let t = this.#t % F;
594
- return this.#t += 1, e * F + t;
619
+ #T(e) {
620
+ let t = this.#t % L;
621
+ return this.#t += 1, e * L + t;
595
622
  }
596
- #w() {
623
+ #E() {
597
624
  this.#r > 0 || this.#a || this.#o || (this.#a = !0, queueMicrotask(() => {
598
625
  this.#a && this.flushNow();
599
626
  }));
600
627
  }
601
- #T() {
628
+ #D() {
602
629
  return this.#r === 0 && !this.#a && !this.#o && this.#p.length === 0 && this.#m.length === 0 && this.#d.size === 0 && this.#f.size === 0 && this.#l.size === 0;
603
630
  }
604
- #E() {
605
- if (this.#T()) {
631
+ #O() {
632
+ if (this.#D()) {
606
633
  for (let e of this.#h) e.resolve();
607
634
  this.#h.clear();
608
635
  }
609
636
  }
610
- }, ke = class {
637
+ }, Ae = class {
611
638
  #e = 1;
612
639
  #t = /* @__PURE__ */ new Map();
613
640
  createOwner(e, t) {
@@ -628,7 +655,7 @@ var Oe = class {
628
655
  t.clear(), this.#t.delete(e);
629
656
  }
630
657
  }
631
- }, Ae = class {
658
+ }, je = class {
632
659
  #e = 1;
633
660
  #t = /* @__PURE__ */ new Map();
634
661
  createRootScope(e) {
@@ -659,41 +686,41 @@ var Oe = class {
659
686
  if (!t) throw Error("Unknown scope: " + e);
660
687
  t.params.clear(), t.initializers.clear();
661
688
  }
662
- registerInitializer(e, n, r) {
663
- t(n);
689
+ registerInitializer(e, t, r) {
690
+ n(t);
664
691
  let i = this.#t.get(e);
665
692
  if (!i) throw Error("Unknown scope: " + e);
666
- if (i.params.has(n) || i.initializers.has(n)) throw Error(`Parameter "${n}" already exists in scope ${e}`);
667
- i.initializers.set(n, {
693
+ if (i.params.has(t) || i.initializers.has(t)) throw Error(`Parameter "${t}" already exists in scope ${e}`);
694
+ i.initializers.set(t, {
668
695
  initialize: r,
669
696
  initializing: !1
670
697
  });
671
698
  }
672
- register(e, n, r) {
673
- t(n);
699
+ register(e, t, r) {
700
+ n(t);
674
701
  let i = this.#t.get(e);
675
702
  if (!i) throw Error("Unknown scope: " + e);
676
- if (i.params.has(n) || i.initializers.get(n)?.initializing === !1) throw Error("Parameter \"" + n + "\" already exists in scope " + e);
677
- return i.params.set(n, r), r;
703
+ if (i.params.has(t) || i.initializers.get(t)?.initializing === !1) throw Error("Parameter \"" + t + "\" already exists in scope " + e);
704
+ return i.params.set(t, r), r;
678
705
  }
679
- resolve(e, n) {
680
- t(n);
706
+ resolve(e, t) {
707
+ n(t);
681
708
  let r = e;
682
709
  for (; r;) {
683
710
  let e = this.#t.get(r);
684
711
  if (!e) throw Error("Unknown scope: " + r);
685
- let t = e.initializers.get(n);
686
- if (t) {
687
- if (t.initializing) throw Error(`Parameter dependency cycle while initializing "${n}" in ${r}.`);
688
- t.initializing = !0;
712
+ let n = e.initializers.get(t);
713
+ if (n) {
714
+ if (n.initializing) throw Error(`Parameter dependency cycle while initializing "${t}" in ${r}.`);
715
+ n.initializing = !0;
689
716
  try {
690
- if (t.initialize(), !e.params.has(n)) throw Error(`Initializer did not register parameter "${n}".`);
691
- e.initializers.delete(n);
717
+ if (n.initialize(), !e.params.has(t)) throw Error(`Initializer did not register parameter "${t}".`);
718
+ e.initializers.delete(t);
692
719
  } finally {
693
- t.initializing = !1;
720
+ n.initializing = !1;
694
721
  }
695
722
  }
696
- let i = e.params.get(n);
723
+ let i = e.params.get(t);
697
724
  if (i) return i;
698
725
  r = e.parentScope;
699
726
  }
@@ -701,58 +728,68 @@ var Oe = class {
701
728
  };
702
729
  //#endregion
703
730
  //#region ../core/src/paramRuntime/expressionCompiler.js
704
- function je(e, t = {}, n = {}) {
705
- return p(e, t, n);
731
+ function Me(e, t = {}, n = {}) {
732
+ return ne(e, t, n);
706
733
  }
707
734
  //#endregion
708
735
  //#region ../core/src/paramRuntime/expressionRef.js
709
- function Me(e, t, n = {}) {
710
- let r = {}, i = je(e, r, n), a = /* @__PURE__ */ new Map();
711
- for (let n of i.globals) {
712
- if (a.has(n)) continue;
713
- let i = t(n);
714
- if (!i) throw Error("Unknown variable \"" + n + "\" in expression: " + e);
715
- a.set(n, i), Object.defineProperty(r, n, {
716
- enumerable: !0,
717
- get() {
718
- return i.get();
719
- }
720
- });
736
+ function z(t, n, r = {}) {
737
+ let i = {}, a = Me(t, i, r), o = /* @__PURE__ */ new Map();
738
+ try {
739
+ for (let e of a.globals) {
740
+ if (o.has(e)) continue;
741
+ let r = n(e);
742
+ if (!r) throw Error("Unknown variable \"" + e + "\" in expression: " + t);
743
+ o.set(e, r), Object.defineProperty(i, e, {
744
+ enumerable: !0,
745
+ get() {
746
+ return r.get();
747
+ }
748
+ });
749
+ }
750
+ } catch (t) {
751
+ throw e(t, r.specLocation);
721
752
  }
722
- let o = /* @__PURE__ */ new Set();
723
- return i.subscribe = (e) => {
753
+ let s = /* @__PURE__ */ new Set();
754
+ return a.subscribe = (e) => {
724
755
  let t = [];
725
- for (let n of a.values()) t.push(n.subscribe(e));
726
- for (let n of i.scaleDependencies ?? []) t.push(n.subscribe(e));
756
+ for (let n of o.values()) t.push(n.subscribe(e));
757
+ for (let n of a.scaleDependencies ?? []) t.push(n.subscribe(e));
727
758
  let n = !0, r = () => {
728
- n && (n = !1, o.delete(r), t.forEach((e) => e()));
759
+ n && (n = !1, s.delete(r), t.forEach((e) => e()));
729
760
  };
730
- return o.add(r), r;
731
- }, i.invalidate = () => {
732
- for (let e of o) e();
733
- o.clear();
734
- }, i.createSnapshotEvaluator = () => {
761
+ return s.add(r), r;
762
+ }, a.invalidate = () => {
763
+ for (let e of s) e();
764
+ s.clear();
765
+ }, a.createSnapshotEvaluator = () => {
735
766
  let e = {};
736
- for (let t of Object.keys(r)) a.has(t) || (e[t] = r[t]);
737
- for (let [t, n] of a) n.batchStable || Object.defineProperty(e, t, {
767
+ for (let t of Object.keys(i)) o.has(t) || (e[t] = i[t]);
768
+ for (let [t, n] of o) n.batchStable || Object.defineProperty(e, t, {
738
769
  enumerable: !0,
739
770
  get: () => n.get()
740
771
  });
741
- let t = Object.assign(i.createEvaluator(e), { refresh() {
742
- for (let [t, n] of a) n.batchStable && (e[t] = n.get());
772
+ let t = Object.assign(a.createEvaluator(e), { refresh() {
773
+ for (let [t, n] of o) n.batchStable && (e[t] = n.get());
743
774
  } });
744
775
  return t.refresh(), t;
745
- }, i.identifier = () => i.code + "|" + Array.from(a.values()).map((e) => e.id).concat((i.scaleDependencies ?? []).map((e) => e.id)).join(","), i.dependencies = Array.from(a.values()).concat(i.scaleDependencies ?? []), {
746
- expression: i,
747
- dependencies: i.dependencies
776
+ }, a.identifier = () => a.code + "|" + Array.from(o.values()).map((e) => e.id).concat((a.scaleDependencies ?? []).map((e) => e.id)).join(","), a.dependencies = Array.from(o.values()).concat(a.scaleDependencies ?? []), {
777
+ expression: a,
778
+ dependencies: a.dependencies
748
779
  };
749
780
  }
750
781
  //#endregion
751
782
  //#region ../core/src/paramRuntime/paramRuntime.js
752
783
  var Ne = class {
753
- #e = new ke();
754
- #t = new Oe({ lifecycleRegistry: this.#e });
755
- #n = new Ae();
784
+ #e = new Ae();
785
+ #t;
786
+ #n = new je();
787
+ constructor(e = {}) {
788
+ this.#t = new ke({
789
+ lifecycleRegistry: this.#e,
790
+ onError: e.onError
791
+ });
792
+ }
756
793
  createScope(e) {
757
794
  let t = this.#e.createOwner("scope", e ?? "root");
758
795
  return e ? this.#n.createChildScope(t, e) : this.#n.createRootScope(t);
@@ -777,11 +814,11 @@ var Ne = class {
777
814
  return this.#n.register(e, t, a);
778
815
  }
779
816
  registerDerived(e, t, n, r) {
780
- let { expression: i, dependencies: a } = Me(n, (t) => this.resolve(r?.expressionScope ?? e, t), r), o = this.#n.getOwnerId(e), s = this.#t.computed(o, t, a, () => i(null));
817
+ let { expression: i, dependencies: a } = z(n, (t) => this.resolve(r?.expressionScope ?? e, t), r), o = this.#n.getOwnerId(e), s = this.#t.computed(o, t, a, () => i(null));
781
818
  return this.#n.register(e, t, s);
782
819
  }
783
820
  createExpression(e, t, n) {
784
- let { expression: r } = Me(t, (t) => this.resolve(e, t), n);
821
+ let { expression: r } = z(t, (t) => this.resolve(e, t), n);
785
822
  return r;
786
823
  }
787
824
  resolve(e, t) {
@@ -836,8 +873,8 @@ function Ie(e) {
836
873
  //#endregion
837
874
  //#region ../core/src/utils/animator.js
838
875
  var Le = class {
839
- constructor(e) {
840
- this._renderCallback = e, this._renderRequested = !1, this._finalized = !1, this._warn = !1, this._animationFrameRequest = void 0, this.transitions = [], this.transitionsEnabled = !0;
876
+ constructor(e, t) {
877
+ this._renderCallback = e, this._onError = t, this._renderRequested = !1, this._finalized = !1, this._warn = !1, this._animationFrameRequest = void 0, this.transitions = [], this.transitionsEnabled = !0;
841
878
  }
842
879
  requestTransition(e) {
843
880
  this._finalized || (this.cancelTransition(e), this.transitions.push(e), this.requestRender());
@@ -852,9 +889,14 @@ var Le = class {
852
889
  this._renderRequested = !1;
853
890
  let t = this.transitions;
854
891
  this.transitions = [];
855
- let n;
856
- for (; n = t.shift();) n(e);
857
- this._finalized || this._renderCallback(e);
892
+ try {
893
+ let n;
894
+ for (; n = t.shift();) n(e);
895
+ this._finalized || this._renderCallback(e);
896
+ } catch (e) {
897
+ if (!this._onError) throw e;
898
+ this._onError(e);
899
+ }
858
900
  })));
859
901
  }
860
902
  finalize() {
@@ -900,7 +942,7 @@ function ze() {
900
942
  }
901
943
  //#endregion
902
944
  //#region ../core/src/paramRuntime/viewParamRuntime.js
903
- var Be = class {
945
+ var B = class {
904
946
  #e;
905
947
  #t;
906
948
  #n = /* @__PURE__ */ new Map();
@@ -916,11 +958,12 @@ var Be = class {
916
958
  #f;
917
959
  #p;
918
960
  #m;
919
- #h = !1;
961
+ #h;
962
+ #g = !1;
920
963
  constructor(e, t, n, r = {}) {
921
- this.#d = e ?? (() => void 0), this.#f = t ?? (() => void 0), this.#p = n, this.#m = r.settleTemporalUpdatesImmediately ?? !1;
964
+ this.#d = e ?? (() => void 0), this.#f = t ?? (() => void 0), this.#p = n, this.#h = r.getSpecOrigin, this.#m = r.settleTemporalUpdatesImmediately ?? !1;
922
965
  let i = this.#d();
923
- i ? (this.#e = i.#e, this.#t = this.#e.createScope(i.#t)) : (this.#e = new Ne(), this.#t = this.#e.createScope());
966
+ i ? (this.#e = i.#e, this.#t = this.#e.createScope(i.#t)) : (this.#e = new Ne({ onError: r.onError }), this.#t = this.#e.createScope());
924
967
  }
925
968
  setSelectionSource(e) {
926
969
  this.#s = e;
@@ -939,38 +982,46 @@ var Be = class {
939
982
  if (o) throw Error(`Conflicting selection declarations for "${e}" in "${i.location}" and "${o.location}".`);
940
983
  return i;
941
984
  }
942
- #g(e) {
985
+ #_(e) {
943
986
  if (!("select" in e)) return;
944
- let t = i(e.select), n = t.type === "interval" ? "interval" : t.toggle ? "multi" : "single", r = t.type === "interval" ? Array.from(new Set(t.encodings)).sort() : [], a = e.push === "outer" ? this.findRuntimeForParam(e.name) : this, o = {
945
- kind: n,
946
- components: r,
987
+ let n = t(e.select), r = n.type === "interval" ? "interval" : n.toggle ? "multi" : "single", i = n.type === "interval" ? Array.from(new Set(n.encodings)).sort() : [], a = e.push === "outer" ? this.findRuntimeForParam(e.name) : this, o = {
988
+ kind: r,
989
+ components: i,
947
990
  source: this.#s
948
991
  }, s = a.#c.get(e.name) ?? /* @__PURE__ */ new Set(), c = s.values().next().value;
949
- if (c && (c.kind !== n || JSON.stringify(c.components) !== JSON.stringify(r))) throw Error(`Conflicting selection declarations for "${e.name}" in "${c.source?.name ?? e.name}" and "${this.#s?.name ?? e.name}".`);
992
+ if (c && (c.kind !== r || JSON.stringify(c.components) !== JSON.stringify(i))) throw Error(`Conflicting selection declarations for "${e.name}" in "${c.source?.name ?? e.name}" and "${this.#s?.name ?? e.name}".`);
950
993
  s.add(o), a.#c.set(e.name, s), this.#e.addScopeDisposer(this.#t, () => {
951
994
  s.delete(o);
952
995
  });
953
996
  }
954
- get #_() {
955
- return { resolveScaleResolution: this.#f };
956
- }
957
- registerParam(e, n = {}) {
958
- let r = e.name;
959
- if (t(r), this.#i.has(r) || this.#a.has(r)) throw Error("Parameter \"" + r + "\" already registered in this scope.");
960
- if (He(e), n.defer) {
961
- if (!("expr" in e)) throw Error("Only expression parameters can be deferred.");
962
- return this.#e.registerInitializer(this.#t, r, () => {
963
- this.#v(e);
964
- }), this.#i.set(r, e), () => {
965
- throw Error("Cannot set derived parameter \"" + r + "\".");
997
+ #v(e) {
998
+ return {
999
+ resolveScaleResolution: this.#f,
1000
+ specLocation: this.getSpecLocation(e, ["expr"])
1001
+ };
1002
+ }
1003
+ registerParam(t, r = {}) {
1004
+ let i = t.name;
1005
+ try {
1006
+ n(i);
1007
+ } catch (n) {
1008
+ throw e(n, this.getSpecLocation(t, ["name"]));
1009
+ }
1010
+ if (this.#i.has(i) || this.#a.has(i)) throw e(/* @__PURE__ */ Error("Parameter \"" + i + "\" already registered in this scope."), this.getSpecLocation(t, ["name"]));
1011
+ if (Ve(t), r.defer) {
1012
+ if (!("expr" in t)) throw Error("Only expression parameters can be deferred.");
1013
+ return this.#e.registerInitializer(this.#t, i, () => {
1014
+ this.#y(t);
1015
+ }), this.#i.set(i, t), () => {
1016
+ throw Error("Cannot set derived parameter \"" + i + "\".");
966
1017
  };
967
1018
  }
968
- return this.#v(e);
1019
+ return this.#y(t);
969
1020
  }
970
1021
  registerLazyExpression(e, t, n) {
971
1022
  this.#e.registerInitializer(this.#t, e, () => {
972
1023
  n?.();
973
- let r = this.#e.registerDerived(this.#t, e, t, this.#_);
1024
+ let r = this.#e.registerDerived(this.#t, e, t, this.#v());
974
1025
  this.#r.set(e, r);
975
1026
  }), this.#a.add(e);
976
1027
  }
@@ -980,7 +1031,7 @@ var Be = class {
980
1031
  this.#e.registerInitializer(this.#t, e, () => {
981
1032
  let r = this.#e.registerDerived(this.#t, e, t, {
982
1033
  expressionScope: n.#t,
983
- ...n.#_
1034
+ ...n.#v()
984
1035
  });
985
1036
  this.#r.set(e, r);
986
1037
  }), this.#i.set(e, {
@@ -988,65 +1039,65 @@ var Be = class {
988
1039
  expr: t
989
1040
  });
990
1041
  }
991
- #v(e) {
992
- let t = e.name, n, r;
993
- if (e.push == "outer") {
994
- let i = this.findRuntimeForParam(t);
995
- if (!i) throw Error(`Parameter "${t}" not found in outer scope!`);
996
- let a = i.paramConfigs.get(t);
997
- if (!a) throw Error(`Outer parameter "${t}" exists as a value but has no registered config.`);
998
- if ("expr" in a || "select" in a || "ruler" in a) throw Error(`The outer parameter "${t}" must not have expr, select, or ruler properties!`);
999
- n = (e) => {
1000
- i.setValue(t, e);
1001
- }, this.#n.set(t, n), "ruler" in e && (r = h(e, this), n(r));
1002
- } else if ("value" in e) r = h(e, this), n = "transition" in e ? this.#b(t, r, e.transition) : this.#y(t, r);
1003
- else if ("expr" in e) {
1004
- if ("transition" in e) this.#x(t, e.expr, e.transition);
1005
- else if ("debounce" in e) this.#S(t, e.expr, e.debounce);
1042
+ #y(t) {
1043
+ let n = t.name, r, i;
1044
+ if (t.push == "outer") {
1045
+ let a = this.findRuntimeForParam(n);
1046
+ if (!a) throw e(/* @__PURE__ */ Error(`Parameter "${n}" not found in outer scope!`), this.getSpecLocation(t, ["name"]));
1047
+ let s = a.paramConfigs.get(n);
1048
+ if (!s) throw Error(`Outer parameter "${n}" exists as a value but has no registered config.`);
1049
+ if ("expr" in s || "select" in s || "ruler" in s) throw Error(`The outer parameter "${n}" must not have expr, select, or ruler properties!`);
1050
+ r = (e) => {
1051
+ a.setValue(n, e);
1052
+ }, this.#n.set(n, r), "ruler" in t && (i = o(t, this), r(i));
1053
+ } else if ("value" in t) i = o(t, this), r = "transition" in t ? this.#x(n, i, t.transition) : this.#b(n, i);
1054
+ else if (l(t)) {
1055
+ if ("transition" in t) this.#S(n, t, t.transition);
1056
+ else if ("debounce" in t) this.#C(n, t, t.debounce);
1006
1057
  else {
1007
- let n = this.#e.registerDerived(this.#t, t, e.expr, this.#_);
1008
- this.#r.set(t, n);
1058
+ let e = this.#e.registerDerived(this.#t, n, t.expr, this.#v(t));
1059
+ this.#r.set(n, e);
1009
1060
  }
1010
- n = () => {
1011
- throw Error("Cannot set derived parameter \"" + t + "\".");
1061
+ r = () => {
1062
+ throw Error("Cannot set derived parameter \"" + n + "\".");
1012
1063
  };
1013
- } else r = h(e, this), n = this.#y(t, r);
1014
- if ("select" in e) {
1015
- if (r ??= h(e, this), !this.#n.has(t)) {
1016
- let e = this.#e.registerSelection(this.#t, t, r);
1017
- this.#r.set(t, e), this.#n.set(t, (t) => {
1064
+ } else i = o(t, this), r = this.#b(n, i);
1065
+ if ("select" in t) {
1066
+ if (i ??= o(t, this), !this.#n.has(n)) {
1067
+ let e = this.#e.registerSelection(this.#t, n, i);
1068
+ this.#r.set(n, e), this.#n.set(n, (t) => {
1018
1069
  e.set(t), this.#e.flushNow();
1019
- }), n = this.#n.get(t);
1070
+ }), r = this.#n.get(n);
1020
1071
  }
1021
- n(r);
1072
+ r(i);
1022
1073
  }
1023
- return this.#i.set(t, e), this.#g(e), n;
1074
+ return this.#i.set(n, t), this.#_(t), r;
1024
1075
  }
1025
- allocateSetter(e, n, r = !1) {
1026
- if (t(e), this.#n.has(e)) throw Error("Setter already allocated for parameter: " + e);
1027
- let i = this.#e.registerBase(this.#t, e, n, { notify: !r });
1076
+ allocateSetter(e, t, r = !1) {
1077
+ if (n(e), this.#n.has(e)) throw Error("Setter already allocated for parameter: " + e);
1078
+ let i = this.#e.registerBase(this.#t, e, t, { notify: !r });
1028
1079
  this.#r.set(e, i);
1029
1080
  let a = (e) => {
1030
1081
  i.set(e), this.#e.flushNow();
1031
1082
  };
1032
1083
  return this.#n.set(e, a), a;
1033
1084
  }
1034
- setValue(e, n, r) {
1035
- t(e);
1085
+ setValue(e, t, r) {
1086
+ n(e);
1036
1087
  let i = this.#n.get(e);
1037
1088
  if (!i) throw Error("Writable parameter not found in this scope: " + e);
1038
- i(n, r);
1089
+ i(t, r);
1039
1090
  }
1040
1091
  getValue(e) {
1041
1092
  return !this.#r.has(e) && this.hasLocalParam(e) && this.#e.resolve(this.#t, e), this.#r.get(e)?.get();
1042
1093
  }
1043
1094
  getParamRef(e) {
1044
- t(e);
1045
- let n = this.findRuntimeForParam(e);
1046
- if (n) return n.#r.has(e) || n.#e.resolve(n.#t, e), n.#r.get(e);
1095
+ n(e);
1096
+ let t = this.findRuntimeForParam(e);
1097
+ if (t) return t.#r.has(e) || t.#e.resolve(t.#t, e), t.#r.get(e);
1047
1098
  }
1048
1099
  getTargetValue(e) {
1049
- return t(e), this.#l.get(e)?.target ?? this.#u.get(e)?.target ?? this.getValue(e);
1100
+ return n(e), this.#l.get(e)?.target ?? this.#u.get(e)?.target ?? this.getValue(e);
1050
1101
  }
1051
1102
  subscribe(e, t) {
1052
1103
  let n = this.getParamRef(e);
@@ -1063,16 +1114,16 @@ var Be = class {
1063
1114
  return this.#i;
1064
1115
  }
1065
1116
  hasLocalParam(e) {
1066
- t(e);
1067
- let n = this.#i.get(e);
1068
- return this.#r.has(e) || this.#a.has(e) || n !== void 0 && "expr" in n;
1117
+ n(e);
1118
+ let t = this.#i.get(e);
1119
+ return this.#r.has(e) || this.#a.has(e) || t !== void 0 && "expr" in t;
1069
1120
  }
1070
1121
  isPendingParam(e) {
1071
1122
  let t = this.findRuntimeForParam(e);
1072
1123
  return t !== void 0 && !t.#r.has(e);
1073
1124
  }
1074
1125
  hasConfiguredParamInScopeChain(e) {
1075
- return t(e), this.#i.has(e) ? !0 : this.#d()?.hasConfiguredParamInScopeChain(e) ?? !1;
1126
+ return n(e), this.#i.has(e) ? !0 : this.#d()?.hasConfiguredParamInScopeChain(e) ?? !1;
1076
1127
  }
1077
1128
  findRuntimeForParam(e) {
1078
1129
  return this.hasLocalParam(e) ? this : this.#d()?.findRuntimeForParam(e);
@@ -1103,7 +1154,7 @@ var Be = class {
1103
1154
  let r = this.#i.get(t);
1104
1155
  e.push({
1105
1156
  name: t,
1106
- kind: Ve(r),
1157
+ kind: Be(r),
1107
1158
  value: n.get(),
1108
1159
  writable: this.#n.has(t),
1109
1160
  configured: !!r,
@@ -1113,12 +1164,15 @@ var Be = class {
1113
1164
  }
1114
1165
  return {
1115
1166
  scopeId: this.#t,
1116
- disposed: this.#h,
1167
+ disposed: this.#g,
1117
1168
  params: e
1118
1169
  };
1119
1170
  }
1171
+ getSpecLocation(e, t) {
1172
+ return ee(e, this.#h, t);
1173
+ }
1120
1174
  createExpression(e) {
1121
- return this.#e.createExpression(this.#t, e, this.#_);
1175
+ return this.#e.createExpression(this.#t, typeof e == "string" ? e : e.expr, this.#v(typeof e == "string" ? void 0 : e));
1122
1176
  }
1123
1177
  watchExpression(e, t, n = {}) {
1124
1178
  let r = this.createExpression(e), i = r.subscribe(t);
@@ -1145,7 +1199,7 @@ var Be = class {
1145
1199
  cancelUpdate(e) {
1146
1200
  this.#e.cancelUpdate(e);
1147
1201
  }
1148
- #y(e, t) {
1202
+ #b(e, t) {
1149
1203
  let n = this.#e.registerBase(this.#t, e, t);
1150
1204
  this.#r.set(e, n);
1151
1205
  let r = (e) => {
@@ -1153,19 +1207,19 @@ var Be = class {
1153
1207
  };
1154
1208
  return this.#n.set(e, r), r;
1155
1209
  }
1156
- #b(e, t, n) {
1157
- let r = this.#C(e, t, n), i = (t, n) => {
1158
- this.#w(e, r, t, n);
1210
+ #x(e, t, n) {
1211
+ let r = this.#w(e, t, n), i = (t, n) => {
1212
+ this.#T(e, r, t, n);
1159
1213
  };
1160
1214
  return this.#n.set(e, i), i;
1161
1215
  }
1162
- #x(e, t, n) {
1163
- let r = this.createExpression(t), i = this.#C(e, r(null), n), a = r.subscribe(() => {
1164
- this.#w(e, i, r(null), { animate: !this.#m });
1216
+ #S(e, t, n) {
1217
+ let r = this.createExpression(t), i = this.#w(e, r(null), n), a = r.subscribe(() => {
1218
+ this.#T(e, i, r(null), { animate: !this.#m });
1165
1219
  });
1166
1220
  this.#e.addScopeDisposer(this.#t, a);
1167
1221
  }
1168
- #S(e, t, n) {
1222
+ #C(e, t, n) {
1169
1223
  let r = this.createExpression(t), i = r(null), a = this.#e.registerBase(this.#t, e, i);
1170
1224
  this.#r.set(e, a);
1171
1225
  let o = {
@@ -1180,8 +1234,8 @@ var Be = class {
1180
1234
  clearTimeout(o.timeout), c(), this.#u.delete(e);
1181
1235
  });
1182
1236
  }
1183
- #C(e, t, n) {
1184
- let r = Ue(e, t), i = this.#e.registerBase(this.#t, e, r);
1237
+ #w(e, t, n) {
1238
+ let r = He(e, t), i = this.#e.registerBase(this.#t, e, r);
1185
1239
  this.#r.set(e, i);
1186
1240
  let a = this.#p;
1187
1241
  if (!a) throw Error(`The parameter "${e}" uses transition but no animator is available.`);
@@ -1196,8 +1250,8 @@ var Be = class {
1196
1250
  };
1197
1251
  return this.#l.set(e, s), this.#e.addScopeDisposer(this.#t, s.dispose), s;
1198
1252
  }
1199
- #w(e, t, n, r = {}) {
1200
- let i = Ue(e, n);
1253
+ #T(e, t, n, r = {}) {
1254
+ let i = He(e, n);
1201
1255
  t.target = i, r.animate === !1 ? t.smoother.snap({ value: i }) : t.smoother({ value: i });
1202
1256
  }
1203
1257
  evaluateAndGet(e) {
@@ -1216,22 +1270,17 @@ var Be = class {
1216
1270
  this.#m = !1;
1217
1271
  }
1218
1272
  dispose() {
1219
- this.#h || (this.#h = !0, this.#e.disposeScope(this.#t), this.#n.clear(), this.#r.clear(), this.#i.clear(), this.#a.clear(), this.#o.clear(), this.#l.clear(), this.#u.clear());
1220
- }
1221
- hasPointSelections() {
1222
- for (let e of this.#i.values()) if (ne(e)) {
1223
- let t = e.select;
1224
- if (te(t)) {
1225
- if (t == "point") return !0;
1226
- } else if (t.type == "point") return !0;
1227
- }
1273
+ this.#g || (this.#g = !0, this.#e.disposeScope(this.#t), this.#n.clear(), this.#r.clear(), this.#i.clear(), this.#a.clear(), this.#o.clear(), this.#l.clear(), this.#u.clear());
1274
+ }
1275
+ hasPointSelections({ inherited: e = !1 } = {}) {
1276
+ for (let t = this; t; t = e ? t.#d() : void 0) for (let n of t.#i.values()) if (i(n) && (n.select === "point" || typeof n.select == "object" && n.select.type === "point") && (!e || this.findConfiguredParam(n.name).config === n)) return !0;
1228
1277
  return !1;
1229
1278
  }
1230
1279
  };
1231
- function Ve(e) {
1280
+ function Be(e) {
1232
1281
  return e ? e.push === "outer" ? "push" : "select" in e ? "selection" : "ruler" in e ? "ruler" : "expr" in e ? "derived" : "base" : "auto";
1233
1282
  }
1234
- function He(e) {
1283
+ function Ve(e) {
1235
1284
  let t = e.name;
1236
1285
  if ("value" in e && "expr" in e) throw Error(`The parameter "${t}" must not have both value and expr properties!`);
1237
1286
  if ("expr" in e && "bind" in e) throw Error(`The parameter "${t}" must not have both expr and bind properties!`);
@@ -1249,62 +1298,62 @@ function He(e) {
1249
1298
  if (n.halfLife != null && (!Number.isFinite(n.halfLife) || n.halfLife <= 0)) throw Error(`The transition halfLife for parameter "${t}" must be a positive finite number.`);
1250
1299
  if (n.epsilon != null && (!Number.isFinite(n.epsilon) || n.epsilon < 0)) throw Error(`The transition epsilon for parameter "${t}" must be a non-negative finite number.`);
1251
1300
  }
1252
- function Ue(e, t) {
1301
+ function He(e, t) {
1253
1302
  if (typeof t != "number" || !Number.isFinite(t)) throw Error(`Transitioned parameter "${e}" must have a finite numeric value.`);
1254
1303
  return t;
1255
1304
  }
1256
1305
  //#endregion
1257
1306
  //#region ../core/src/utils/addBaseUrl.js
1258
- function We(e, t) {
1307
+ function Ue(e, t) {
1259
1308
  return !t || /^(data:|([A-Za-z]+:)?\/\/)/.test(e) || e.startsWith("/") ? e : (t.endsWith("/") || (t += "/"), t + e);
1260
1309
  }
1261
- function Ge(e) {
1310
+ function We(e) {
1262
1311
  if (!e) return e;
1263
1312
  if (/[?#]/.test(e)) throw Error(`Invalid base URL: ${e} - cannot contain query or hash.`);
1264
1313
  return e.endsWith("/") ? e : e + "/";
1265
1314
  }
1266
1315
  //#endregion
1267
1316
  //#region ../core/src/config/mergeConfig.js
1268
- function L(e) {
1269
- return d(e) && !Array.isArray(e);
1317
+ function V(e) {
1318
+ return ie(e) && !Array.isArray(e) && !("expr" in e && typeof e.expr == "string");
1270
1319
  }
1271
- function Ke(e) {
1320
+ function Ge(e) {
1272
1321
  let t = {};
1273
- for (let [n, r] of Object.entries(e)) t[n] = R(r);
1322
+ for (let [n, r] of Object.entries(e)) t[n] = H(r);
1274
1323
  return t;
1275
1324
  }
1276
- function R(e) {
1277
- return Array.isArray(e) ? e.map(R) : L(e) ? Ke(e) : e;
1325
+ function H(e) {
1326
+ return Array.isArray(e) ? e.map(H) : V(e) ? Ge(e) : e;
1278
1327
  }
1279
- function z(e, t) {
1328
+ function Ke(e, t) {
1280
1329
  for (let [n, r] of Object.entries(t)) {
1281
1330
  if (r === void 0) continue;
1282
1331
  let t = e[n];
1283
- L(r) && L(t) ? z(t, r) : e[n] = R(r);
1332
+ V(r) && V(t) ? Ke(t, r) : e[n] = H(r);
1284
1333
  }
1285
1334
  return e;
1286
1335
  }
1287
- function B(e) {
1336
+ function qe(e) {
1288
1337
  let t = {};
1289
- for (let n of e) n && z(t, n);
1338
+ for (let n of e) n && Ke(t, n);
1290
1339
  return t;
1291
1340
  }
1292
1341
  //#endregion
1293
1342
  //#region ../core/src/view/viewChrome.js
1294
- var V = /* @__PURE__ */ new WeakMap();
1295
- function qe(e, t) {
1296
- V.set(e, t);
1343
+ var U = /* @__PURE__ */ new WeakMap();
1344
+ function Je(e, t) {
1345
+ U.set(e, t);
1297
1346
  }
1298
- function Je(e) {
1299
- return V.get(e);
1347
+ function Ye(e) {
1348
+ return U.get(e);
1300
1349
  }
1301
- function H(e) {
1302
- return V.has(e);
1350
+ function Xe(e) {
1351
+ return U.has(e);
1303
1352
  }
1304
- function U(e) {
1353
+ function Ze(e) {
1305
1354
  let t = e;
1306
1355
  for (; t;) {
1307
- let n = V.get(t);
1356
+ let n = U.get(t);
1308
1357
  if (n === "excludeSubtree" || t === e && n === "exclude") return !0;
1309
1358
  t = t.layoutParent;
1310
1359
  }
@@ -1312,16 +1361,16 @@ function U(e) {
1312
1361
  }
1313
1362
  //#endregion
1314
1363
  //#region ../core/src/view/postScaleParams.js
1315
- var W = /* @__PURE__ */ new WeakMap();
1316
- function Ye(e, t) {
1317
- W.set(e, t);
1364
+ var Qe = /* @__PURE__ */ new WeakMap();
1365
+ function $e(e, t) {
1366
+ Qe.set(e, t);
1318
1367
  }
1319
- function Xe(e) {
1320
- return W.get(e);
1368
+ function et(e) {
1369
+ return Qe.get(e);
1321
1370
  }
1322
1371
  //#endregion
1323
1372
  //#region ../core/src/data/namedDataScope.js
1324
- var Ze = class {
1373
+ var tt = class {
1325
1374
  name;
1326
1375
  owner;
1327
1376
  getDefaultData;
@@ -1359,13 +1408,13 @@ var Ze = class {
1359
1408
  dispose() {
1360
1409
  this.#e = void 0, this.#t = !1, this.#n++, this.#r = !0;
1361
1410
  }
1362
- }, Qe = class {
1411
+ }, nt = class {
1363
1412
  view;
1364
1413
  #e = /* @__PURE__ */ new Map();
1365
1414
  #t = /* @__PURE__ */ new Map();
1366
1415
  constructor(e) {
1367
1416
  this.view = e;
1368
- for (let [t, n] of Object.entries(e.spec.datasets ?? {})) this.#e.set(t, new Ze(t, e, () => n));
1417
+ for (let [t, n] of Object.entries(e.spec.datasets ?? {})) this.#e.set(t, new tt(t, e, () => n));
1369
1418
  }
1370
1419
  getLocalBinding(e) {
1371
1420
  return this.#e.get(e);
@@ -1379,7 +1428,7 @@ var Ze = class {
1379
1428
  let n = this.view.dataParent?.namedDataScope;
1380
1429
  if (n) return n.resolve(e);
1381
1430
  let r = this.#t.get(e);
1382
- return r || (r = new Ze(e, void 0, () => this.view.context.getNamedDataFromProvider(e)), this.#t.set(e, r)), r;
1431
+ return r || (r = new tt(e, void 0, () => this.view.context.getNamedDataFromProvider(e)), this.#t.set(e, r)), r;
1383
1432
  }
1384
1433
  dispose() {
1385
1434
  for (let e of this.#e.values()) e.dispose();
@@ -1387,7 +1436,7 @@ var Ze = class {
1387
1436
  for (let e of this.#t.values()) e.dispose();
1388
1437
  this.#t.clear();
1389
1438
  }
1390
- }, G = "VISIT_SKIP", K = "VISIT_STOP", q = (e) => e, $e = class {
1439
+ }, W = "VISIT_SKIP", G = "VISIT_STOP", K = (e) => e, rt = class {
1391
1440
  spec;
1392
1441
  namedDataScope;
1393
1442
  #e;
@@ -1402,31 +1451,36 @@ var Ze = class {
1402
1451
  #l = void 0;
1403
1452
  #u = !1;
1404
1453
  #d = [];
1405
- opacityFunction = q;
1454
+ opacityFunction = K;
1406
1455
  #f = [];
1407
1456
  #p = "none";
1408
1457
  #m = /* @__PURE__ */ new Map();
1409
- facetCoords = new e([], JSON.stringify);
1458
+ facetCoords = new p([], JSON.stringify);
1459
+ layoutCoords;
1410
1460
  constructor(e, t, n, r, i, a = {}) {
1411
1461
  if (!e) throw Error("View spec must be defined!");
1412
- if (this.context = t, this.layoutParent = n, this.dataParent = r, this.#t = i, this.spec = e, this.namedDataScope = new Qe(this), r && e.theme !== void 0) throw Error("\"theme\" is only supported at the root specification. Use \"config\" and \"style\" for subtree customization.");
1462
+ if (this.context = t, this.layoutParent = n, this.dataParent = r, a.chrome && Je(this, "excludeSubtree"), this.#t = i, this.spec = e, this.namedDataScope = new nt(this), r && e.theme !== void 0) throw Error("\"theme\" is only supported at the root specification. Use \"config\" and \"style\" for subtree customization.");
1413
1463
  let o = r ? r.getConfigScopes() : [t.getBaseConfig()], s = e.config;
1414
1464
  this.#e = [...o, s].filter((e) => !!e), this.resolutions = {
1415
1465
  scale: {},
1416
1466
  axis: {},
1417
1467
  legend: {}
1418
- }, ie(this), this.options = {
1468
+ }, oe(this), this.options = {
1419
1469
  inheritEncoding: !1,
1420
1470
  layoutSizeParams: "own",
1421
1471
  ...a
1422
1472
  }, this.flowHandle = void 0, this.needsAxes = {
1423
1473
  x: !1,
1424
1474
  y: !1
1425
- }, this.paramRuntime = new Be(() => this.dataParent?.paramRuntime, (e) => this.getScaleResolution(e), t.animator, { settleTemporalUpdatesImmediately: !0 }), this.paramRuntime.setSelectionSource(this), "mark" in e && this.paramRuntime.registerLazyExpression("zoomLevel", "zoomLevel()", () => se("The automatic zoomLevel parameter is deprecated. Use zoomLevel() or an explicit channel such as zoomLevel(\"x\") instead."));
1426
- let l = [...e.params ?? [], ...Xe(e) ?? []];
1427
- for (let e of l) {
1475
+ }, this.paramRuntime = new B(() => this.dataParent?.paramRuntime, (e) => this.getScaleResolution(e), t.animator, {
1476
+ settleTemporalUpdatesImmediately: !0,
1477
+ onError: t.reportError,
1478
+ getSpecOrigin: t.getSpecOrigin
1479
+ }), this.paramRuntime.setSelectionSource(this), "mark" in e && this.paramRuntime.registerLazyExpression("zoomLevel", "zoomLevel()", () => ce("The automatic zoomLevel parameter is deprecated. Use zoomLevel() or an explicit channel such as zoomLevel(\"x\") instead."));
1480
+ let c = [...e.params ?? [], ...et(e) ?? []];
1481
+ for (let e of c) {
1428
1482
  if ("expr" in e) {
1429
- let { usesScaleHelper: t, globals: n } = c(e.expr), r = n.some((e) => this.paramRuntime.isPendingParam(e));
1483
+ let { usesScaleHelper: t, globals: n } = m(e.expr, this.paramRuntime.getSpecLocation(e, ["expr"])), r = n.some((e) => this.paramRuntime.isPendingParam(e));
1430
1484
  if (t || r) {
1431
1485
  this.paramRuntime.registerParam(e, { defer: !0 }), this.#d.push(e.name);
1432
1486
  continue;
@@ -1452,18 +1506,18 @@ var Ze = class {
1452
1506
  return this.#t;
1453
1507
  }
1454
1508
  getConfig() {
1455
- return B(this.#e);
1509
+ return qe(this.#e);
1456
1510
  }
1457
1511
  getCursorSpec() {
1458
1512
  return this.spec.cursor;
1459
1513
  }
1460
1514
  getCursor() {
1461
1515
  let e = this.getCursorSpec();
1462
- return n(e) ? this.paramRuntime.evaluateAndGet(e.expr) : e;
1516
+ return l(e) ? this.paramRuntime.evaluateAndGet(e) : e;
1463
1517
  }
1464
1518
  watchCursor(e, t) {
1465
- let r = this.getCursorSpec();
1466
- n(r) && this.paramRuntime.watchExpression(r.expr, e, {
1519
+ let n = this.getCursorSpec();
1520
+ l(n) && this.paramRuntime.watchExpression(n, e, {
1467
1521
  scopeOwned: !1,
1468
1522
  registerDisposer: t
1469
1523
  });
@@ -1475,45 +1529,73 @@ var Ze = class {
1475
1529
  return this.facetCoords.values().next().value;
1476
1530
  }
1477
1531
  getPadding() {
1478
- return this._cache("size/padding", () => k.createFromConfig(this.spec.padding));
1532
+ return this._cache("size/padding", () => j.createFromConfig(this.spec.padding));
1479
1533
  }
1480
1534
  getOverhang() {
1481
- return k.zero();
1535
+ return j.zero();
1536
+ }
1537
+ getStructuralOverhang() {
1538
+ return j.zero();
1539
+ }
1540
+ getStructuralSizeDefs(e) {
1541
+ let t = this.getStructuralOverhang();
1542
+ return {
1543
+ before: { px: t[e === "x" ? "left" : "top"] },
1544
+ after: { px: t[e === "x" ? "right" : "bottom"] }
1545
+ };
1546
+ }
1547
+ getAlignment(e) {
1548
+ let t = e === "x" ? "width" : "height";
1549
+ return {
1550
+ size: this.getViewportSize().subtractPadding(this.getOverhang())[t],
1551
+ before: 0,
1552
+ after: 0
1553
+ };
1554
+ }
1555
+ getAlignmentCoords(e) {
1556
+ return this.coords.shrink(this.getOverhang());
1557
+ }
1558
+ getLayoutFootprints() {
1559
+ return [{
1560
+ view: this,
1561
+ coords: this.coords.shrink(this.getOverhang()),
1562
+ chrome: !1
1563
+ }];
1482
1564
  }
1483
1565
  isScrollable() {
1484
1566
  return this.spec.viewportWidth != null || this.spec.viewportHeight != null;
1485
1567
  }
1486
1568
  getSize() {
1487
- return this._cache("size/size", () => this.isConfiguredVisible() ? new y(this.#g("width"), this.#g("height")) : x);
1569
+ return this._cache("size/size", () => this.isConfiguredVisible() ? new x(this.#g("width"), this.#g("height")) : S);
1488
1570
  }
1489
1571
  getViewportSize() {
1490
1572
  if (!this.isScrollable()) return this.getSize();
1491
- if (!this.isConfiguredVisible()) return x;
1573
+ if (!this.isConfiguredVisible()) return S;
1492
1574
  let e = this.getSize();
1493
- return new y(this.#g("viewportWidth") ?? e.width, this.#g("viewportHeight") ?? e.height);
1575
+ return new x(this.#g("viewportWidth") ?? e.width, this.#g("viewportHeight") ?? e.height);
1494
1576
  }
1495
1577
  #g(e) {
1496
- let { value: t, implicit: n } = this.#_(e), r = this.resolveSizeValue(e, t), i = J(r), a = e == "viewportWidth" || e == "viewportHeight";
1497
- if (i) {
1498
- if (a) throw new _(`Cannot use step-based size with "${e}"!`, this);
1499
- let t = this.#x(e, r), i = this.getScaleResolution(e == "width" ? "x" : "y")?.getScale();
1500
- if (i) {
1578
+ let { value: t, implicit: n } = this.#_(e), i = this.resolveSizeValue(e, t), a = q(i), o = e == "viewportWidth" || e == "viewportHeight";
1579
+ if (a) {
1580
+ if (o) throw new _(`Cannot use step-based size with "${e}"!`, this);
1581
+ let t = this.#x(e, i), a = this.getScaleResolution(e == "width" ? "x" : "y")?.getScale();
1582
+ if (a) {
1501
1583
  let n;
1502
- if (v(i.type)) n = i.domain().length;
1503
- else if (["locus", "index"].includes(i.type)) {
1504
- let e = i.domain();
1505
- n = ee(e) - e[0];
1506
- } else throw new _(`Cannot use step-based size with "${i.type}" scale!`, this);
1507
- let a = i;
1508
- n = oe(n, a.paddingInner(), a.paddingOuter());
1509
- let o = e == "width" ? "xOffset" : "yOffset", s = this.getScaleResolution(o)?.getScale(), c = r.for ?? (s && v(s.type) ? "offset" : "position"), l = t;
1510
- if (c == "offset") {
1511
- if (!s || !v(s.type)) throw new _(`Cannot use ${e}.step.for = "offset" without a discrete ${o} scale!`, this);
1512
- let t = s, n = oe(s.domain().length, t.paddingInner(), t.paddingOuter());
1513
- l *= n / (1 - a.paddingInner());
1584
+ if (y(a.type)) n = a.domain().length;
1585
+ else if (["locus", "index"].includes(a.type)) {
1586
+ let e = a.domain();
1587
+ n = r(e) - e[0];
1588
+ } else throw new _(`Cannot use step-based size with "${a.type}" scale!`, this);
1589
+ let o = a;
1590
+ n = v(n, o.paddingInner(), o.paddingOuter());
1591
+ let s = e == "width" ? "xOffset" : "yOffset", c = this.getScaleResolution(s)?.getScale(), l = i.for ?? (c && y(c.type) ? "offset" : "position"), u = t;
1592
+ if (l == "offset") {
1593
+ if (!c || !y(c.type)) throw new _(`Cannot use ${e}.step.for = "offset" without a discrete ${s} scale!`, this);
1594
+ let t = c, n = v(c.domain().length, t.paddingInner(), t.paddingOuter());
1595
+ u *= n / (1 - o.paddingInner());
1514
1596
  }
1515
1597
  return {
1516
- px: n * l,
1598
+ px: n * u,
1517
1599
  grow: 0
1518
1600
  };
1519
1601
  }
@@ -1523,7 +1605,7 @@ var Ze = class {
1523
1605
  };
1524
1606
  throw new _(`Cannot use step-based size with "${e}"!`, this);
1525
1607
  }
1526
- return (r && he(r)) ?? (a ? void 0 : {
1608
+ return (i && _e(i)) ?? (o ? void 0 : {
1527
1609
  px: 0,
1528
1610
  grow: 1
1529
1611
  });
@@ -1539,16 +1621,16 @@ var Ze = class {
1539
1621
  };
1540
1622
  }
1541
1623
  #v(e) {
1542
- if (U(this)) return;
1624
+ if (Ze(this)) return;
1543
1625
  let t = this.getConfig().view;
1544
1626
  if (!t) return;
1545
1627
  let n = e == "width" ? "x" : "y", r = this.getScaleResolution(n)?.getResolvedScaleType();
1546
- return r && !v(r) ? e == "width" ? t.continuousWidth : t.continuousHeight : (e == "width" ? t.discreteWidth : t.discreteHeight) ?? (t.step === void 0 ? void 0 : { step: t.step });
1628
+ return r && !y(r) ? e == "width" ? t.continuousWidth : t.continuousHeight : (e == "width" ? t.discreteWidth : t.discreteHeight) ?? (t.step === void 0 ? void 0 : { step: t.step });
1547
1629
  }
1548
1630
  resolveSizeValue(e, t) {
1549
- if (!n(t)) return t;
1550
- let r = this.#C(e)();
1551
- if (it(r) || r === "container") return r;
1631
+ if (!l(t)) return t;
1632
+ let n = this.#C(e)();
1633
+ if (ct(n) || n === "container") return n;
1552
1634
  throw new _(`"${e}" ExprRef must resolve to a finite number or "container"!`, this);
1553
1635
  }
1554
1636
  registerSizeInvalidation() {
@@ -1556,7 +1638,7 @@ var Ze = class {
1556
1638
  }
1557
1639
  #y(e, t) {
1558
1640
  let { value: n, implicit: r } = this.#_(e);
1559
- if (!J(n)) return;
1641
+ if (!q(n)) return;
1560
1642
  let i = this.getScaleResolution(t);
1561
1643
  if (!i) {
1562
1644
  if (r) return;
@@ -1566,20 +1648,20 @@ var Ze = class {
1566
1648
  let t = this.getSize()[e];
1567
1649
  this.invalidateSizeCache();
1568
1650
  let n = this.getSize()[e];
1569
- pe(t, n) || this.context.requestLayoutReflow();
1651
+ he(t, n) || this.context.requestLayoutReflow();
1570
1652
  };
1571
1653
  if (i.addEventListener("domain", a), this.registerDisposer(() => i.removeEventListener("domain", a)), n.for != "position") {
1572
1654
  let t = e == "width" ? "xOffset" : "yOffset", n = this.getScaleResolution(t);
1573
- n && v(n.getResolvedScaleType()) && (n.addEventListener("domain", a), this.registerDisposer(() => n.removeEventListener("domain", a)));
1655
+ n && y(n.getResolvedScaleType()) && (n.addEventListener("domain", a), this.registerDisposer(() => n.removeEventListener("domain", a)));
1574
1656
  }
1575
1657
  }
1576
1658
  #b(e) {
1577
1659
  let { value: t } = this.#_(e);
1578
- n(t) ? this.#S(e, t.expr) : J(t) && n(t.step) && this.#S(e + ".step", t.step.expr);
1660
+ l(t) ? this.#S(e, t) : q(t) && l(t.step) && this.#S(e + ".step", t.step);
1579
1661
  }
1580
1662
  #x(e, t) {
1581
- let r = n(t.step) ? this.#C(e + ".step")() : t.step;
1582
- if (it(r)) return r;
1663
+ let n = l(t.step) ? this.#C(e + ".step")() : t.step;
1664
+ if (ct(n)) return n;
1583
1665
  throw new _(`"${e}.step" ExprRef must resolve to a finite number!`, this);
1584
1666
  }
1585
1667
  #S(e, t) {
@@ -1625,7 +1707,7 @@ var Ze = class {
1625
1707
  return this.opacityFunction(1);
1626
1708
  }
1627
1709
  hasLocalOpacity() {
1628
- return this.opacityFunction !== q;
1710
+ return this.opacityFunction !== K;
1629
1711
  }
1630
1712
  getPathString() {
1631
1713
  return this.getLayoutAncestors().map((e) => e.name).reverse().join("/");
@@ -1656,7 +1738,7 @@ var Ze = class {
1656
1738
  };
1657
1739
  }
1658
1740
  handleInteraction(e, t) {
1659
- t && e.type === "mousemove" && e.pointedViews.add(this);
1741
+ t && e.type === "mousemove" && e.pointedViews.set(this, e.facetId);
1660
1742
  let n = t ? this.#r : this.#i;
1661
1743
  for (let t of n[e.type] || []) t(e);
1662
1744
  }
@@ -1689,13 +1771,15 @@ var Ze = class {
1689
1771
  for (let e of this.#f) e();
1690
1772
  this.#f.length = 0;
1691
1773
  let e = this.flowHandle;
1692
- e?.collector && (this.context.dataFlow.pruneCollectorBranch(e.collector), this.context.dataFlow.removeCollector(e.collector)), e?.dataSource && e.dataSource.view === this && !e.dataSource.shareKey && this.context.dataFlow.removeDataSource(e.dataSource), this.paramRuntime.dispose(), this.namedDataScope.dispose(), this.context.dataFlow.loadingStatusRegistry.delete(this), this.flowHandle = void 0;
1774
+ e?.collector && (this.context.dataFlow.pruneCollectorBranch(e.collector), this.context.dataFlow.removeCollector(e.collector)), e?.dataSource && e.dataSource.view === this && !e.dataSource.shareKey && this.context.dataFlow.removeDataSource(e.dataSource), this.paramRuntime.dispose(), this.namedDataScope.dispose(), this.flowHandle = void 0, this.context.dataFlow.loadingStatusRegistry.delete(this);
1693
1775
  }
1694
1776
  registerDisposer(e) {
1695
1777
  this.#f.push(e);
1696
1778
  }
1697
1779
  disposeSubtree() {
1698
- let e = () => void 0;
1780
+ let e = (e) => {
1781
+ for (let t of Object.values(e.resolutions.scale)) t.dispose();
1782
+ };
1699
1783
  e.postOrder = (e) => {
1700
1784
  e.dispose();
1701
1785
  }, this.visit(e);
@@ -1711,7 +1795,7 @@ var Ze = class {
1711
1795
  }
1712
1796
  }
1713
1797
  configureViewOpacity() {
1714
- (!this.opacityFunction || this.opacityFunction === q) && (this.opacityFunction = tt(this));
1798
+ (!this.opacityFunction || this.opacityFunction === K) && (this.opacityFunction = at(this));
1715
1799
  }
1716
1800
  finalizeParamRuntimeInitialization() {
1717
1801
  this.#l === void 0 ? this.paramRuntime.finalizeInitialization() : this.#T();
@@ -1723,8 +1807,10 @@ var Ze = class {
1723
1807
  return this.#s;
1724
1808
  }
1725
1809
  arrange(e, t, n = {}) {
1726
- if (n.firstFacet && this.facetCoords.clear(), this.facetCoords.set(n.facetId, m(t, f(n))), this.#a || this.#o) {
1727
- let e = this.getOverhang(), n = this.layoutParent ? k.zero() : this.getPadding();
1810
+ if (this.layoutParent || this.visit((e) => {
1811
+ e.layoutCoords = void 0;
1812
+ }), this.layoutCoords = t, n.firstFacet && this.facetCoords.clear(), this.facetCoords.set(n.facetId, re(t, te(n))), this.#a || this.#o) {
1813
+ let e = this.getOverhang(), n = this.layoutParent ? j.zero() : this.getPadding();
1728
1814
  this.#a?.(t.width - e.width - n.width), this.#o?.(t.height - e.height - n.height);
1729
1815
  }
1730
1816
  this.#c = !0, this.#T();
@@ -1745,7 +1831,7 @@ var Ze = class {
1745
1831
  }
1746
1832
  getFacetFields(e) {
1747
1833
  let t = this.getEncoding().sample;
1748
- return u(t) ? [t.field] : this.options.inheritEncoding ? this.layoutParent?.getFacetFields(this) : [];
1834
+ return s(t) ? [t.field] : this.options.inheritEncoding ? this.layoutParent?.getFacetFields(this) : [];
1749
1835
  }
1750
1836
  usesSampleFacetRendering() {
1751
1837
  return this.layoutParent?.usesSampleFacetRendering() ?? !1;
@@ -1757,15 +1843,23 @@ var Ze = class {
1757
1843
  };
1758
1844
  }
1759
1845
  getScaleResolution(e) {
1760
- let t = o(e);
1761
- return this.getDataAncestors().map((e) => e.resolutions.scale[t]).find((e) => e);
1846
+ return this.#E(e, "scale");
1762
1847
  }
1763
1848
  getAxisResolution(e) {
1764
- let t = o(e);
1765
- return this.getDataAncestors().map((e) => e.resolutions.axis[t]).find((e) => e);
1849
+ return this.#E(e, "axis");
1850
+ }
1851
+ #E(e, t) {
1852
+ let n = h(e);
1853
+ for (let e of this.getDataAncestors()) {
1854
+ let r = e.resolutions[t][n];
1855
+ if (r || e.isResolutionBoundary(n)) return r;
1856
+ }
1857
+ }
1858
+ isResolutionBoundary(e) {
1859
+ return this.options.resolutionBoundaryChannels?.some((t) => t === h(e)) ?? !1;
1766
1860
  }
1767
1861
  getLegendResolution(e) {
1768
- let t = o(e);
1862
+ let t = h(e);
1769
1863
  return this.getDataAncestors().map((e) => e.resolutions.legend[t]).find((e) => e);
1770
1864
  }
1771
1865
  getConfiguredResolution(e, t) {
@@ -1778,17 +1872,17 @@ var Ze = class {
1778
1872
  return "independent";
1779
1873
  }
1780
1874
  getBaseUrl() {
1781
- return j(() => this.dataParent?.getBaseUrl(), Ge(this.spec.baseUrl));
1875
+ return N(() => this.dataParent?.getBaseUrl(), We(this.spec.baseUrl));
1782
1876
  }
1783
1877
  isPickingSupported() {
1784
1878
  return !0;
1785
1879
  }
1786
1880
  getTitleText() {
1787
1881
  let e = this.spec.title;
1788
- if (e) return te(e) ? e : n(e.text) ? this.paramRuntime.evaluateAndGet(e.text.expr) : e.text;
1882
+ if (e) return u(e) ? e : l(e.text) ? this.paramRuntime.evaluateAndGet(e.text) : e.text;
1789
1883
  }
1790
1884
  _cache(e, t) {
1791
- return re(this, e, t);
1885
+ return ae(this, e, t);
1792
1886
  }
1793
1887
  _invalidateCacheByPrefix(e, t = "self") {
1794
1888
  switch (t) {
@@ -1806,15 +1900,15 @@ var Ze = class {
1806
1900
  }
1807
1901
  propagateInteraction(e) {}
1808
1902
  };
1809
- function et(e) {
1903
+ function it(e) {
1810
1904
  return "unitsPerPixel" in e;
1811
1905
  }
1812
- function tt(e) {
1906
+ function at(e) {
1813
1907
  let t = "opacity" in e.spec ? e.spec.opacity : void 0;
1814
1908
  if (t !== void 0) {
1815
- if (s(t)) return (e) => e * t;
1816
- if (et(t)) {
1817
- let r = (t) => {
1909
+ if (f(t)) return (e) => e * t;
1910
+ if (it(t)) {
1911
+ let n = (t) => {
1818
1912
  let n = e.getScaleResolution(t), r = n?.getScale();
1819
1913
  if ([
1820
1914
  "linear",
@@ -1824,46 +1918,46 @@ function tt(e) {
1824
1918
  scale: r,
1825
1919
  scaleResolution: n
1826
1920
  };
1827
- }, i = rt(t.values, "opacity.values", e);
1828
- if (!a(t.unitsPerPixel)) throw new _("\"opacity.unitsPerPixel\" must be an array.", e);
1829
- let o = () => 1, s = [], c = () => {
1830
- let t = nt(rt(s.map((e) => e()), "opacity.unitsPerPixel", e), i, e), n = ae().domain(t.unitsPerPixel).range(t.values).clamp(!0);
1831
- o = (e) => n(e);
1921
+ }, r = st(t.values, "opacity.values", e);
1922
+ if (!d(t.unitsPerPixel)) throw new _("\"opacity.unitsPerPixel\" must be an array.", e);
1923
+ let i = () => 1, a = [], o = () => {
1924
+ let t = ot(st(a.map((e) => e()), "opacity.unitsPerPixel", e), r, e), n = se().domain(t.unitsPerPixel).range(t.values).clamp(!0);
1925
+ i = (e) => n(e);
1832
1926
  };
1833
- s = t.unitsPerPixel.map((t) => {
1834
- if (n(t)) {
1835
- let n = e.paramRuntime.watchExpression(t.expr, () => {
1836
- c(), e.context.animator.requestRender();
1927
+ a = t.unitsPerPixel.map((t) => {
1928
+ if (l(t)) {
1929
+ let n = e.paramRuntime.watchExpression(t, () => {
1930
+ o(), e.context.animator.requestRender();
1837
1931
  });
1838
1932
  return () => n(null);
1839
1933
  }
1840
1934
  return () => t;
1841
- }), c();
1842
- let u = (e) => {
1935
+ }), o();
1936
+ let s = (e) => {
1843
1937
  let t = e.scaleResolution.getAxisLength() || 1e3;
1844
- return l(e.scale.domain()) / t;
1845
- }, d;
1938
+ return c(e.scale.domain()) / t;
1939
+ }, u;
1846
1940
  if (t.channel === "auto") {
1847
- let t = r("x"), n = r("y");
1848
- if (t && n) d = () => (u(t) + u(n)) / 2;
1849
- else if (t) d = () => u(t);
1850
- else if (n) d = () => u(n);
1941
+ let t = n("x"), r = n("y");
1942
+ if (t && r) u = () => (s(t) + s(r)) / 2;
1943
+ else if (t) u = () => s(t);
1944
+ else if (r) u = () => s(r);
1851
1945
  else throw new _("Cannot find a resolved quantitative x or y scale for dynamic opacity!", e);
1852
1946
  } else {
1853
- let n = t.channel ? r(t.channel) : r("x") ?? r("y");
1854
- if (!n) throw new _("Cannot find a resolved quantitative scale for dynamic opacity!", e);
1855
- d = () => u(n);
1947
+ let r = t.channel ? n(t.channel) : n("x") ?? n("y");
1948
+ if (!r) throw new _("Cannot find a resolved quantitative scale for dynamic opacity!", e);
1949
+ u = () => s(r);
1856
1950
  }
1857
- return (e) => o(d()) * e;
1951
+ return (e) => i(u()) * e;
1858
1952
  }
1859
- if (n(t)) {
1860
- let n = e.paramRuntime.watchExpression(t.expr, () => e.context.animator.requestRender());
1953
+ if (l(t)) {
1954
+ let n = e.paramRuntime.watchExpression(t, () => e.context.animator.requestRender());
1861
1955
  return (e) => n(null) * e;
1862
1956
  }
1863
1957
  }
1864
- return q;
1958
+ return K;
1865
1959
  }
1866
- function nt(e, t, n) {
1960
+ function ot(e, t, n) {
1867
1961
  if (!e.length) throw new _("\"opacity.unitsPerPixel\" must contain at least one stop.", n);
1868
1962
  if (e.length !== t.length) throw new _("\"opacity.unitsPerPixel\" and \"opacity.values\" must have the same length.", n);
1869
1963
  e.forEach((e, t) => {
@@ -1881,155 +1975,155 @@ function nt(e, t, n) {
1881
1975
  values: a
1882
1976
  };
1883
1977
  }
1884
- function rt(e, t, n) {
1885
- if (!a(e)) throw new _("\"" + t + "\" must evaluate to an array.", n);
1978
+ function st(e, t, n) {
1979
+ if (!d(e)) throw new _("\"" + t + "\" must evaluate to an array.", n);
1886
1980
  return e.map((e, r) => {
1887
- if (!s(e) || !Number.isFinite(e)) throw new _("Invalid " + t + " value at index " + r + ". Expected a finite number.", n);
1981
+ if (!f(e) || !Number.isFinite(e)) throw new _("Invalid " + t + " value at index " + r + ". Expected a finite number.", n);
1888
1982
  return e;
1889
1983
  });
1890
1984
  }
1891
- var J = (e) => !!e && typeof e == "object" && "step" in e;
1892
- function it(e) {
1985
+ var q = (e) => !!e && typeof e == "object" && "step" in e;
1986
+ function ct(e) {
1893
1987
  return typeof e == "number" && Number.isFinite(e);
1894
1988
  }
1895
- var Y = /* @__PURE__ */ new WeakMap(), X = /* @__PURE__ */ new WeakMap();
1896
- function at(e, t) {
1897
- st(e, t, "Import");
1989
+ var J = /* @__PURE__ */ new WeakMap(), Y = /* @__PURE__ */ new WeakMap();
1990
+ function lt(e, t) {
1991
+ dt(e, t, "Import");
1898
1992
  }
1899
- function ot(e, t) {
1900
- st(e, t, "View");
1993
+ function ut(e, t) {
1994
+ dt(e, t, "View");
1901
1995
  }
1902
- function st(e, t, n) {
1996
+ function dt(e, t, n) {
1903
1997
  if (t !== null && typeof t != "string") throw Error(n + " scope name must be a string or null.");
1904
- Y.set(e, { name: t });
1998
+ J.set(e, { name: t });
1905
1999
  }
1906
- function ct(e) {
1907
- return Y.get(e);
2000
+ function ft(e) {
2001
+ return J.get(e);
1908
2002
  }
1909
- function lt(e, t = {}) {
2003
+ function pt(e, t = {}) {
1910
2004
  let n = t.skipSubtree ?? !1 ? "excludeSubtree" : "exclude";
1911
- X.set(e, n);
2005
+ Y.set(e, n);
1912
2006
  }
1913
- function ut(e, t = {}) {
1914
- qe(e, t.skipSubtree ?? !1 ? "excludeSubtree" : "exclude");
2007
+ function mt(e, t = {}) {
2008
+ Je(e, t.skipSubtree ?? !1 ? "excludeSubtree" : "exclude");
1915
2009
  }
1916
- function dt(e) {
1917
- return e.getLayoutAncestors().some(H);
2010
+ function ht(e) {
2011
+ return e.getLayoutAncestors().some(Xe);
1918
2012
  }
1919
- function Z(e) {
2013
+ function X(e) {
1920
2014
  let t = e.getDataAncestors(), n = [];
1921
2015
  for (let e = t.length - 1; e >= 0; --e) {
1922
- let r = Y.get(t[e]);
2016
+ let r = J.get(t[e]);
1923
2017
  r && typeof r.name == "string" && n.push(r.name);
1924
2018
  }
1925
2019
  return n;
1926
2020
  }
1927
- function ft(e) {
2021
+ function gt(e) {
1928
2022
  let t = e.explicitName;
1929
2023
  if (!t) throw Error("Cannot build a selector for a view without a name.");
1930
2024
  return {
1931
- scope: Z(e),
2025
+ scope: X(e),
1932
2026
  view: t
1933
2027
  };
1934
2028
  }
1935
- function pt(e, t) {
2029
+ function _t(e, t) {
1936
2030
  if (!t) throw Error("Cannot build a selector for a parameter without a name.");
1937
2031
  return {
1938
- scope: Z(e),
2032
+ scope: X(e),
1939
2033
  param: t
1940
2034
  };
1941
2035
  }
1942
- function mt(e) {
1943
- return St(e), "p:" + JSON.stringify({
2036
+ function vt(e) {
2037
+ return Et(e), "p:" + JSON.stringify({
1944
2038
  scope: e.scope,
1945
2039
  param: e.param
1946
2040
  });
1947
2041
  }
1948
- function ht(e, t) {
2042
+ function yt(e, t) {
1949
2043
  e.visit((e) => {
1950
- let n = Je(e);
1951
- if (n === "excludeSubtree") return G;
2044
+ let n = Ye(e);
2045
+ if (n === "excludeSubtree") return W;
1952
2046
  if (n !== "exclude") return t(e);
1953
2047
  });
1954
2048
  }
1955
- function gt(e, t) {
2049
+ function bt(e, t) {
1956
2050
  e.visit((e) => {
1957
- let n = X.get(e);
1958
- if (n === "excludeSubtree") return G;
2051
+ let n = Y.get(e);
2052
+ if (n === "excludeSubtree") return W;
1959
2053
  if (n !== "exclude") return t(e);
1960
2054
  });
1961
2055
  }
1962
- function _t(e, t) {
1963
- if (Ct(t), !jt(e, t.scope)) return;
2056
+ function xt(e, t) {
2057
+ if (Dt(t), !Ft(e, t.scope)) return;
1964
2058
  let n = [];
1965
- if ($(e, t.scope, (e) => {
2059
+ if (Q(e, t.scope, (e) => {
1966
2060
  e.explicitName === t.view && n.push(e);
1967
2061
  }, { includeNamedImportRoots: !0 }), n.length === 1) return n[0];
1968
2062
  if (n.length !== 0) throw Error("View selector is ambiguous for view \"" + t.view + "\" in scope " + JSON.stringify(t.scope));
1969
2063
  }
1970
- function vt(e, t) {
1971
- if (St(t), !jt(e, t.scope)) return;
2064
+ function St(e, t) {
2065
+ if (Et(t), !Ft(e, t.scope)) return;
1972
2066
  let n = [];
1973
- if ($(e, t.scope, (e) => {
1974
- for (let [r, i] of e.paramRuntime.paramConfigs) r === t.param && Q(i) && n.push({
2067
+ if (Q(e, t.scope, (e) => {
2068
+ for (let [r, i] of e.paramRuntime.paramConfigs) r === t.param && Z(i) && n.push({
1975
2069
  view: e,
1976
2070
  param: i
1977
2071
  });
1978
2072
  }), n.length === 1) return n[0];
1979
2073
  if (n.length !== 0) throw Error("Param selector is ambiguous for param \"" + t.param + "\" in scope " + JSON.stringify(t.scope));
1980
2074
  }
1981
- function yt(e, t) {
2075
+ function Ct(e, t) {
1982
2076
  e.visit((e) => {
1983
- let n = X.get(e);
1984
- if (n === "excludeSubtree") return G;
1985
- if (n !== "exclude") for (let [n, r] of e.paramRuntime.paramConfigs) Q(r) && t({
2077
+ let n = Y.get(e);
2078
+ if (n === "excludeSubtree") return W;
2079
+ if (n !== "exclude") for (let [n, r] of e.paramRuntime.paramConfigs) Z(r) && t({
1986
2080
  view: e,
1987
2081
  param: r,
1988
- selector: pt(e, n)
2082
+ selector: _t(e, n)
1989
2083
  });
1990
2084
  });
1991
2085
  }
1992
- function bt(e) {
2086
+ function wt(e) {
1993
2087
  let t = [];
1994
- return yt(e, (e) => t.push(e)), t;
2088
+ return Ct(e, (e) => t.push(e)), t;
1995
2089
  }
1996
- function xt(e) {
2090
+ function Tt(e) {
1997
2091
  let t = [];
1998
- for (let n of wt(e)) {
1999
- let r = Tt(n);
2000
- Dt(e, r, t), Ot(e, r, t);
2092
+ for (let n of Ot(e)) {
2093
+ let r = kt(n);
2094
+ jt(e, r, t), Mt(e, r, t);
2001
2095
  }
2002
2096
  return t;
2003
2097
  }
2004
- function St(e) {
2098
+ function Et(e) {
2005
2099
  if (!e || !Array.isArray(e.scope)) throw Error("Param selector scope must be an array.");
2006
2100
  if (typeof e.param != "string" || !e.param.length) throw Error("Param selector param must be a non-empty string.");
2007
2101
  }
2008
- function Ct(e) {
2102
+ function Dt(e) {
2009
2103
  if (!e || !Array.isArray(e.scope)) throw Error("View selector scope must be an array.");
2010
2104
  if (typeof e.view != "string" || !e.view.length) throw Error("View selector view must be a non-empty string.");
2011
2105
  }
2012
- function Q(e) {
2013
- return e.persist === !1 ? !1 : ne(e) ? !0 : r(e) ? !!e.bind : !1;
2106
+ function Z(e) {
2107
+ return e.persist === !1 ? !1 : i(e) ? !0 : a(e) ? !!e.bind : !1;
2014
2108
  }
2015
- function wt(e) {
2109
+ function Ot(e) {
2016
2110
  let t = /* @__PURE__ */ new Set([e]);
2017
2111
  return e.visit((e) => {
2018
- let n = Y.get(e);
2112
+ let n = J.get(e);
2019
2113
  n && typeof n.name == "string" && t.add(e);
2020
2114
  }), Array.from(t);
2021
2115
  }
2022
- function Tt(e) {
2023
- return Z(e);
2116
+ function kt(e) {
2117
+ return X(e);
2024
2118
  }
2025
- function Et(e) {
2119
+ function At(e) {
2026
2120
  return e.length ? "import scope [" + e.join(" / ") + "]" : "import scope (root)";
2027
2121
  }
2028
- function Dt(e, t, n) {
2122
+ function jt(e, t, n) {
2029
2123
  let r = /* @__PURE__ */ new Map();
2030
- $(e, t, (e) => {
2124
+ Q(e, t, (e) => {
2031
2125
  for (let [t, n] of e.paramRuntime.paramConfigs) {
2032
- if (!Q(n)) continue;
2126
+ if (!Z(n)) continue;
2033
2127
  let i = r.get(t);
2034
2128
  i ? i.push(e) : r.set(t, [e]);
2035
2129
  }
@@ -2038,53 +2132,53 @@ function Dt(e, t, n) {
2038
2132
  if (i.length <= 1) continue;
2039
2133
  let r = i.map((e) => e.getPathString()).join(", ");
2040
2134
  n.push({
2041
- message: "Bookmarkable parameter \"" + e + "\" is not unique within " + Et(t) + ". Found in: " + r + ".",
2135
+ message: "Bookmarkable parameter \"" + e + "\" is not unique within " + At(t) + ". Found in: " + r + ".",
2042
2136
  scope: t
2043
2137
  });
2044
2138
  }
2045
2139
  }
2046
- function Ot(e, t, n) {
2047
- let r = kt(e, t);
2140
+ function Mt(e, t, n) {
2141
+ let r = Nt(e, t);
2048
2142
  if (!r.length) return;
2049
- let i = r.filter((e) => At(e));
2143
+ let i = r.filter((e) => Pt(e));
2050
2144
  if (i.length <= 1) return;
2051
2145
  let a = /* @__PURE__ */ new Map();
2052
2146
  for (let e of i) {
2053
- let t = Y.get(e), n = t ? t.name : void 0;
2147
+ let t = J.get(e), n = t ? t.name : void 0;
2054
2148
  typeof n == "string" && n.length && a.set(n, (a.get(n) ?? 0) + 1);
2055
2149
  }
2056
2150
  for (let [e, r] of a) r > 1 && n.push({
2057
- message: "Import instance name \"" + e + "\" is used multiple times for addressable instances in " + Et(t) + ".",
2151
+ message: "Import instance name \"" + e + "\" is used multiple times for addressable instances in " + At(t) + ".",
2058
2152
  scope: t
2059
2153
  });
2060
2154
  }
2061
- function kt(e, t) {
2155
+ function Nt(e, t) {
2062
2156
  let n = [];
2063
- return $(e, t, (e) => {
2064
- if (Z(e).length !== t.length + 1) return;
2065
- let r = Y.get(e);
2157
+ return Q(e, t, (e) => {
2158
+ if (X(e).length !== t.length + 1) return;
2159
+ let r = J.get(e);
2066
2160
  r && typeof r.name == "string" && n.push(e);
2067
2161
  }, { includeNamedImportRoots: !0 }), n;
2068
2162
  }
2069
- function At(e) {
2163
+ function Pt(e) {
2070
2164
  let t = !1;
2071
2165
  return e.visit((e) => {
2072
- let n = X.get(e);
2073
- if (n === "excludeSubtree") return G;
2166
+ let n = Y.get(e);
2167
+ if (n === "excludeSubtree") return W;
2074
2168
  if (n !== "exclude") {
2075
- for (let n of e.paramRuntime.paramConfigs.values()) if (Q(n)) return t = !0, K;
2169
+ for (let n of e.paramRuntime.paramConfigs.values()) if (Z(n)) return t = !0, G;
2076
2170
  }
2077
2171
  }), t;
2078
2172
  }
2079
- function jt(e, t) {
2173
+ function Ft(e, t) {
2080
2174
  let n = e, r = [];
2081
2175
  for (let i of t) {
2082
2176
  if (typeof i != "string" || !i.length) throw Error("Scope names must be non-empty strings.");
2083
2177
  let t, a = !1;
2084
- if ($(e, r, (e) => {
2085
- let n = Y.get(e);
2086
- if (n && n.name === i && Z(e).length === r.length + 1) {
2087
- if (t) return a = !0, K;
2178
+ if (Q(e, r, (e) => {
2179
+ let n = J.get(e);
2180
+ if (n && n.name === i && X(e).length === r.length + 1) {
2181
+ if (t) return a = !0, G;
2088
2182
  t = e;
2089
2183
  }
2090
2184
  }, { includeNamedImportRoots: !0 }), a) throw Error("Multiple import instances named \"" + i + "\" in scope.");
@@ -2093,25 +2187,25 @@ function jt(e, t) {
2093
2187
  }
2094
2188
  return n;
2095
2189
  }
2096
- function $(e, t, n, r = {}) {
2190
+ function Q(e, t, n, r = {}) {
2097
2191
  let i = r.includeNamedImportRoots ?? !1;
2098
2192
  e.visit((e) => {
2099
- let r = Y.get(e), a = X.get(e);
2100
- if (a === "excludeSubtree") return G;
2101
- if (a !== "exclude" && Mt(e, t, r, i)) return n(e);
2193
+ let r = J.get(e), a = Y.get(e);
2194
+ if (a === "excludeSubtree") return W;
2195
+ if (a !== "exclude" && It(e, t, r, i)) return n(e);
2102
2196
  });
2103
2197
  }
2104
- function Mt(e, t, n, r) {
2105
- let i = Z(e);
2106
- return Nt(i, t) ? !0 : !r || !n || typeof n.name != "string" || i.length !== t.length + 1 ? !1 : Pt(t, i);
2198
+ function It(e, t, n, r) {
2199
+ let i = X(e);
2200
+ return Lt(i, t) ? !0 : !r || !n || typeof n.name != "string" || i.length !== t.length + 1 ? !1 : $(t, i);
2107
2201
  }
2108
- function Nt(e, t) {
2109
- return e.length === t.length && Pt(e, t);
2202
+ function Lt(e, t) {
2203
+ return e.length === t.length && $(e, t);
2110
2204
  }
2111
- function Pt(e, t) {
2205
+ function $(e, t) {
2112
2206
  if (e.length > t.length) return !1;
2113
2207
  for (let n = 0; n < e.length; n++) if (e[n] !== t[n]) return !1;
2114
2208
  return !0;
2115
2209
  }
2116
2210
  //#endregion
2117
- export { M as A, ce as B, We as C, Fe as D, Re as E, b as F, fe as H, de as I, le as L, k as M, be as N, N as O, y as P, D as R, B as S, Le as T, ue as U, he as V, K as _, dt as a, H as b, lt as c, vt as d, _t as f, G as g, ht as h, ft as i, Se as j, j as k, at as l, gt as m, ct as n, mt as o, xt as p, Z as r, ut as s, bt as t, ot as u, $e as v, Be as w, U as x, Ye as y, E as z };
2211
+ export { P as A, D as B, Ue as C, Fe as D, Re as E, S as F, ve as G, le as H, k as I, pe as K, T as L, j as M, xe as N, F as O, x as P, fe as R, qe as S, Le as T, _e as U, E as V, b as W, G as _, ht as a, Xe as b, pt as c, St as d, xt as f, W as g, yt as h, gt as i, Ce as j, N as k, lt as l, bt as m, ft as n, vt as o, Tt as p, de as q, X as r, mt as s, wt as t, ut as u, rt as v, B as w, Ze as x, $e as y, ue as z };