@genome-spy/app 1.1.1 → 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 (45) hide show
  1. package/dist/{agentApi-sPuuT0KS.js → agentApi-8hMSlqAQ.js} +8307 -6861
  2. package/dist/agentApi.es.js +5569 -4250
  3. package/dist/agentShared.es.js +9 -9
  4. package/dist/{canvas2d-iDK4BC5j.js → canvas2d-Bd8H8MMo.js} +149 -134
  5. package/dist/{canvas2d-MXaFeZnP.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-BDKkEjXl.js → containerView-CRJSc4bM.js} +24 -31
  9. package/dist/{viewIdentityRegistry-BIYd4TE0.js → containerView-aEVmYmkA.js} +24 -31
  10. package/dist/{debug-DbigmdrK.js → debug-CQ0agCrd.js} +9 -9
  11. package/dist/{debug-BlqDxTw3.js → debug-DkIMiGdW.js} +10 -10
  12. package/dist/index.es.js +3582 -3566
  13. package/dist/index.js +698 -454
  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-B4uR9Q04.js → order-BVvkjDRT.js} +369 -316
  19. package/dist/{order-BSPy5DI8.js → order-DmMoZsi1.js} +360 -308
  20. package/dist/{rasterExport-DQH3hVg_.js → rasterExport-DxvowWjH.js} +3 -3
  21. package/dist/{rasterExport-B62RmAK1.js → rasterExport-jeRVq6kY.js} +4 -4
  22. package/dist/{rasterization-B05bDo5e.js → rasterization-DFj3Cvx4.js} +26 -19
  23. package/dist/{rectangle-DE98gIxF.js → rectangle-DZTR6NFQ.js} +10 -1
  24. package/dist/rectangle-Dl4Dy0hS.js +191 -0
  25. package/dist/{renderCanvas2D-Bdv-B4wj.js → renderCanvas2D-Bfm1NHFu.js} +96 -91
  26. package/dist/{renderCanvas2D-ChdoHGrU.js → renderCanvas2D-DVjhp834.js} +98 -93
  27. package/dist/{scalePosition-ByvlXaML.js → scalePosition-0aeqp_kz.js} +8 -1
  28. package/dist/schema.json +27198 -13709
  29. package/dist/style.css +1 -1
  30. package/dist/{svg-N3tj05-e.js → svg-Bm2zxBPu.js} +315 -316
  31. package/dist/{svg-DHsq1RpV.js → svg-CkfuhONt.js} +290 -291
  32. package/dist/{svgRasterizer-CYVDlt5z.js → svgRasterizer-DoRQEqFA.js} +2 -2
  33. package/dist/{svgRasterizer-CvCBlxLj.js → svgRasterizer-raDDhBF-.js} +3 -3
  34. package/dist/{vega-scale-Byaw1K8O.js → vega-scale-BoGHANI7.js} +90 -90
  35. package/dist/{vega-scale-Ctz_wa3z.js → vega-scale-o9TRyzYH.js} +699 -699
  36. package/dist/viewError-BkJeVYXA.js +33 -0
  37. package/dist/viewError-IYqyluc7.js +33 -0
  38. package/dist/{viewSelectors-DDLW-byr.js → viewSelectors-7LyasQN-.js} +498 -434
  39. package/dist/{viewSelectors-j-F9XwsE.js → viewSelectors-CbmkSQRT.js} +549 -485
  40. package/dist/{viewUtils-JX6CMEYH.js → viewUtils-DuddMNNw.js} +2138 -2009
  41. package/dist/{webgl-Dw8xqZpX.js → webgl-CQfvgnxo.js} +1229 -1140
  42. package/dist/{webgl-DdmOwEH0.js → webgl-DVYkXtiZ.js} +1477 -1389
  43. package/package.json +4 -4
  44. package/src/spec/view.d.ts +44 -5
  45. package/dist/viewError-BiR9VCgL.js +0 -29
@@ -52,146 +52,146 @@ function f(e) {
52
52
  function p(e) {
53
53
  return e == null || e === "" ? null : +e;
54
54
  }
55
- var m = (e) => (t) => e * Math.exp(t), ee = (e) => (t) => Math.log(e * t), te = (e) => (t) => Math.sign(t) * Math.log1p(Math.abs(t / e)), h = (e) => (t) => Math.sign(t) * Math.expm1(Math.abs(t)) * e, g = (e) => (t) => t < 0 ? -((-t) ** +e) : t ** +e;
56
- function _(e, t, n, r) {
55
+ var m = (e) => (t) => e * Math.exp(t), h = (e) => (t) => Math.log(e * t), g = (e) => (t) => Math.sign(t) * Math.log1p(Math.abs(t / e)), _ = (e) => (t) => Math.sign(t) * Math.expm1(Math.abs(t)) * e, v = (e) => (t) => t < 0 ? -((-t) ** +e) : t ** +e;
56
+ function y(e, t, n, r) {
57
57
  let i = n(e[0]), a = n(f(e)), o = (a - i) * t;
58
58
  return [r(i - o), r(a - o)];
59
59
  }
60
- function ne(e, t) {
61
- return _(e, t, p, l);
60
+ function b(e, t) {
61
+ return y(e, t, p, l);
62
62
  }
63
- function re(e, t) {
63
+ function ee(e, t) {
64
64
  var n = Math.sign(e[0]);
65
- return _(e, t, ee(n), m(n));
65
+ return y(e, t, h(n), m(n));
66
66
  }
67
- function ie(e, t, n) {
68
- return _(e, t, g(n), g(1 / n));
67
+ function te(e, t, n) {
68
+ return y(e, t, v(n), v(1 / n));
69
69
  }
70
- function ae(e, t, n, r, i) {
70
+ function ne(e, t, n, r, i) {
71
71
  let a = r(e[0]), o = r(f(e)), s = t == null ? (a + o) / 2 : r(t);
72
72
  return [i(s + (a - s) * n), i(s + (o - s) * n)];
73
73
  }
74
- function v(e, t, n) {
75
- return ae(e, t, n, p, l);
74
+ function x(e, t, n) {
75
+ return ne(e, t, n, p, l);
76
76
  }
77
- function oe(e, t, n) {
77
+ function re(e, t, n) {
78
78
  let r = Math.sign(e[0]);
79
- return ae(e, t, n, ee(r), m(r));
79
+ return ne(e, t, n, h(r), m(r));
80
80
  }
81
- function y(e, t, n, r) {
82
- return ae(e, t, n, g(r), g(1 / r));
81
+ function S(e, t, n, r) {
82
+ return ne(e, t, n, v(r), v(1 / r));
83
83
  }
84
- function se(e, t, n, r) {
85
- return ae(e, t, n, te(r), h(r));
84
+ function ie(e, t, n, r) {
85
+ return ne(e, t, n, g(r), _(r));
86
86
  }
87
- function ce(e) {
87
+ function ae(e) {
88
88
  return e == null ? [] : u(e) ? e : [e];
89
89
  }
90
- function le(e, t, n) {
90
+ function oe(e, t, n) {
91
91
  let r = e[0], i = e[1], a;
92
92
  return i < r && (a = i, i = r, r = a), a = i - r, a >= n - t ? [t, n] : [r = Math.min(Math.max(r, t), n - a), r + a];
93
93
  }
94
- function ue(e) {
94
+ function se(e) {
95
95
  return typeof e == "function";
96
96
  }
97
- var de = "descending";
98
- function fe(t, r, i) {
99
- i ||= {}, r = ce(r) || [];
100
- let a = [], o = [], s = {}, l = i.comparator || me;
101
- return ce(t).forEach((e, t) => {
102
- e != null && (a.push(r[t] === de ? -1 : 1), o.push(e = ue(e) ? e : c(e, null, i)), (n(e) || []).forEach((e) => s[e] = 1));
97
+ var ce = "descending";
98
+ function le(t, r, i) {
99
+ i ||= {}, r = ae(r) || [];
100
+ let a = [], o = [], s = {}, l = i.comparator || de;
101
+ return ae(t).forEach((e, t) => {
102
+ e != null && (a.push(r[t] === ce ? -1 : 1), o.push(e = se(e) ? e : c(e, null, i)), (n(e) || []).forEach((e) => s[e] = 1));
103
103
  }), o.length === 0 ? null : e(l(o, a), Object.keys(s));
104
104
  }
105
- var pe = (e, t) => (e < t || e == null) && t != null ? -1 : (e > t || t == null) && e != null ? 1 : (t = t instanceof Date ? +t : t, (e = e instanceof Date ? +e : e) !== e && t === t ? -1 : +(t !== t && e === e)), me = (e, t) => e.length === 1 ? he(e[0], t[0]) : ge(e, t, e.length), he = (e, t) => function(n, r) {
106
- return pe(e(n), e(r)) * t;
107
- }, ge = (e, t, n) => (t.push(0), function(r, i) {
105
+ var ue = (e, t) => (e < t || e == null) && t != null ? -1 : (e > t || t == null) && e != null ? 1 : (t = t instanceof Date ? +t : t, (e = e instanceof Date ? +e : e) !== e && t === t ? -1 : +(t !== t && e === e)), de = (e, t) => e.length === 1 ? fe(e[0], t[0]) : pe(e, t, e.length), fe = (e, t) => function(n, r) {
106
+ return ue(e(n), e(r)) * t;
107
+ }, pe = (e, t, n) => (t.push(0), function(r, i) {
108
108
  let a, o = 0, s = -1;
109
- for (; o === 0 && ++s < n;) a = e[s], o = pe(a(r), a(i));
109
+ for (; o === 0 && ++s < n;) a = e[s], o = ue(a(r), a(i));
110
110
  return o * t[s];
111
111
  });
112
- function _e(e, t, n, r) {
112
+ function me(e, t, n, r) {
113
113
  let i = t[0], a = t[t.length - 1], o;
114
114
  return i > a && (o = i, i = a, a = o), n = n === void 0 || n, r = r === void 0 || r, (n ? i <= e : i < e) && (r ? e <= a : e < a);
115
115
  }
116
- function ve(e) {
116
+ function he(e) {
117
117
  return typeof e == "boolean";
118
118
  }
119
- function ye(e) {
119
+ function ge(e) {
120
120
  return typeof e == "number";
121
121
  }
122
- function be(e) {
122
+ function _e(e) {
123
123
  return Object.prototype.toString.call(e) === "[object RegExp]";
124
124
  }
125
- function b(e) {
125
+ function C(e) {
126
126
  return typeof e == "string";
127
127
  }
128
- function xe(e, t) {
128
+ function ve(e, t) {
129
129
  let n = e[0], r = f(e), i = +t;
130
130
  return i ? i === 1 ? r : n + i * (r - n) : n;
131
131
  }
132
- function Se(e) {
132
+ function ye(e) {
133
133
  return e && f(e) - e[0] || 0;
134
134
  }
135
- function Ce(e) {
136
- return u(e) ? `[${e.map((e) => e === null ? "null" : Ce(e))}]` : d(e) || b(e) ? JSON.stringify(e).replaceAll("\u2028", "\\u2028").replaceAll("\u2029", "\\u2029") : e;
135
+ function be(e) {
136
+ return u(e) ? `[${e.map((e) => e === null ? "null" : be(e))}]` : d(e) || C(e) ? JSON.stringify(e).replaceAll("\u2028", "\\u2028").replaceAll("\u2029", "\\u2029") : e;
137
137
  }
138
- function we(e) {
138
+ function xe(e) {
139
139
  let t = {}, n = e.length;
140
140
  for (let r = 0; r < n; ++r) t[e[r]] = !0;
141
141
  return t;
142
142
  }
143
143
  //#endregion
144
144
  //#region ../../node_modules/internmap/src/index.js
145
- var Te = class extends Map {
146
- constructor(e, t = ke) {
145
+ var Se = class extends Map {
146
+ constructor(e, t = Ee) {
147
147
  if (super(), Object.defineProperties(this, {
148
148
  _intern: { value: /* @__PURE__ */ new Map() },
149
149
  _key: { value: t }
150
150
  }), e != null) for (let [t, n] of e) this.set(t, n);
151
151
  }
152
152
  get(e) {
153
- return super.get(Ee(this, e));
153
+ return super.get(Ce(this, e));
154
154
  }
155
155
  has(e) {
156
- return super.has(Ee(this, e));
156
+ return super.has(Ce(this, e));
157
157
  }
158
158
  set(e, t) {
159
- return super.set(De(this, e), t);
159
+ return super.set(we(this, e), t);
160
160
  }
161
161
  delete(e) {
162
- return super.delete(Oe(this, e));
162
+ return super.delete(Te(this, e));
163
163
  }
164
164
  };
165
- function Ee({ _intern: e, _key: t }, n) {
165
+ function Ce({ _intern: e, _key: t }, n) {
166
166
  let r = t(n);
167
167
  return e.has(r) ? e.get(r) : n;
168
168
  }
169
- function De({ _intern: e, _key: t }, n) {
169
+ function we({ _intern: e, _key: t }, n) {
170
170
  let r = t(n);
171
171
  return e.has(r) ? e.get(r) : (e.set(r, n), n);
172
172
  }
173
- function Oe({ _intern: e, _key: t }, n) {
173
+ function Te({ _intern: e, _key: t }, n) {
174
174
  let r = t(n);
175
175
  return e.has(r) && (n = e.get(r), e.delete(r)), n;
176
176
  }
177
- function ke(e) {
177
+ function Ee(e) {
178
178
  return typeof e == "object" && e ? e.valueOf() : e;
179
179
  }
180
180
  //#endregion
181
181
  //#region ../../node_modules/d3-array/src/ticks.js
182
- var Ae = Math.sqrt(50), je = Math.sqrt(10), Me = Math.sqrt(2);
183
- function Ne(e, t, n) {
184
- let r = (t - e) / Math.max(0, n), i = Math.floor(Math.log10(r)), a = r / 10 ** i, o = a >= Ae ? 10 : a >= je ? 5 : a >= Me ? 2 : 1, s, c, l;
185
- return i < 0 ? (l = 10 ** -i / o, s = Math.round(e * l), c = Math.round(t * l), s / l < e && ++s, c / l > t && --c, l = -l) : (l = 10 ** i * o, s = Math.round(e / l), c = Math.round(t / l), s * l < e && ++s, c * l > t && --c), c < s && .5 <= n && n < 2 ? Ne(e, t, n * 2) : [
182
+ var De = Math.sqrt(50), Oe = Math.sqrt(10), ke = Math.sqrt(2);
183
+ function Ae(e, t, n) {
184
+ let r = (t - e) / Math.max(0, n), i = Math.floor(Math.log10(r)), a = r / 10 ** i, o = a >= De ? 10 : a >= Oe ? 5 : a >= ke ? 2 : 1, s, c, l;
185
+ return i < 0 ? (l = 10 ** -i / o, s = Math.round(e * l), c = Math.round(t * l), s / l < e && ++s, c / l > t && --c, l = -l) : (l = 10 ** i * o, s = Math.round(e / l), c = Math.round(t / l), s * l < e && ++s, c * l > t && --c), c < s && .5 <= n && n < 2 ? Ae(e, t, n * 2) : [
186
186
  s,
187
187
  c,
188
188
  l
189
189
  ];
190
190
  }
191
- function Pe(e, t, n) {
191
+ function je(e, t, n) {
192
192
  if (t = +t, e = +e, n = +n, !(n > 0)) return [];
193
193
  if (e === t) return [e];
194
- let r = t < e, [i, a, o] = r ? Ne(t, e, n) : Ne(e, t, n);
194
+ let r = t < e, [i, a, o] = r ? Ae(t, e, n) : Ae(e, t, n);
195
195
  if (!(a >= i)) return [];
196
196
  let s = a - i + 1, c = Array(s);
197
197
  if (r) {
@@ -201,39 +201,336 @@ function Pe(e, t, n) {
201
201
  else for (let e = 0; e < s; ++e) c[e] = (i + e) * o;
202
202
  return c;
203
203
  }
204
- function Fe(e, t, n) {
205
- return t = +t, e = +e, n = +n, Ne(e, t, n)[2];
204
+ function Me(e, t, n) {
205
+ return t = +t, e = +e, n = +n, Ae(e, t, n)[2];
206
206
  }
207
- function Ie(e, t, n) {
207
+ function Ne(e, t, n) {
208
208
  t = +t, e = +e, n = +n;
209
- let r = t < e, i = r ? Fe(t, e, n) : Fe(e, t, n);
209
+ let r = t < e, i = r ? Me(t, e, n) : Me(e, t, n);
210
210
  return (r ? -1 : 1) * (i < 0 ? 1 / -i : i);
211
211
  }
212
212
  //#endregion
213
213
  //#region ../../node_modules/d3-array/src/range.js
214
- function Le(e, t, n) {
214
+ function Pe(e, t, n) {
215
215
  e = +e, t = +t, n = (i = arguments.length) < 2 ? (t = e, e = 0, 1) : i < 3 ? 1 : +n;
216
216
  for (var r = -1, i = Math.max(0, Math.ceil((t - e) / n)) | 0, a = Array(i); ++r < i;) a[r] = e + r * n;
217
217
  return a;
218
218
  }
219
219
  //#endregion
220
+ //#region ../../node_modules/d3-color/src/define.js
221
+ function Fe(e, t, n) {
222
+ e.prototype = t.prototype = n, n.constructor = e;
223
+ }
224
+ function Ie(e, t) {
225
+ var n = Object.create(e.prototype);
226
+ for (var r in t) n[r] = t[r];
227
+ return n;
228
+ }
229
+ //#endregion
230
+ //#region ../../node_modules/d3-color/src/color.js
231
+ function w() {}
232
+ var T = .7, Le = 1 / T, E = "\\s*([+-]?\\d+)\\s*", Re = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*", D = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*", ze = /^#([0-9a-f]{3,8})$/, Be = RegExp(`^rgb\\(${E},${E},${E}\\)$`), Ve = RegExp(`^rgb\\(${D},${D},${D}\\)$`), He = RegExp(`^rgba\\(${E},${E},${E},${Re}\\)$`), Ue = RegExp(`^rgba\\(${D},${D},${D},${Re}\\)$`), We = RegExp(`^hsl\\(${Re},${D},${D}\\)$`), Ge = RegExp(`^hsla\\(${Re},${D},${D},${Re}\\)$`), Ke = {
233
+ aliceblue: 15792383,
234
+ antiquewhite: 16444375,
235
+ aqua: 65535,
236
+ aquamarine: 8388564,
237
+ azure: 15794175,
238
+ beige: 16119260,
239
+ bisque: 16770244,
240
+ black: 0,
241
+ blanchedalmond: 16772045,
242
+ blue: 255,
243
+ blueviolet: 9055202,
244
+ brown: 10824234,
245
+ burlywood: 14596231,
246
+ cadetblue: 6266528,
247
+ chartreuse: 8388352,
248
+ chocolate: 13789470,
249
+ coral: 16744272,
250
+ cornflowerblue: 6591981,
251
+ cornsilk: 16775388,
252
+ crimson: 14423100,
253
+ cyan: 65535,
254
+ darkblue: 139,
255
+ darkcyan: 35723,
256
+ darkgoldenrod: 12092939,
257
+ darkgray: 11119017,
258
+ darkgreen: 25600,
259
+ darkgrey: 11119017,
260
+ darkkhaki: 12433259,
261
+ darkmagenta: 9109643,
262
+ darkolivegreen: 5597999,
263
+ darkorange: 16747520,
264
+ darkorchid: 10040012,
265
+ darkred: 9109504,
266
+ darksalmon: 15308410,
267
+ darkseagreen: 9419919,
268
+ darkslateblue: 4734347,
269
+ darkslategray: 3100495,
270
+ darkslategrey: 3100495,
271
+ darkturquoise: 52945,
272
+ darkviolet: 9699539,
273
+ deeppink: 16716947,
274
+ deepskyblue: 49151,
275
+ dimgray: 6908265,
276
+ dimgrey: 6908265,
277
+ dodgerblue: 2003199,
278
+ firebrick: 11674146,
279
+ floralwhite: 16775920,
280
+ forestgreen: 2263842,
281
+ fuchsia: 16711935,
282
+ gainsboro: 14474460,
283
+ ghostwhite: 16316671,
284
+ gold: 16766720,
285
+ goldenrod: 14329120,
286
+ gray: 8421504,
287
+ green: 32768,
288
+ greenyellow: 11403055,
289
+ grey: 8421504,
290
+ honeydew: 15794160,
291
+ hotpink: 16738740,
292
+ indianred: 13458524,
293
+ indigo: 4915330,
294
+ ivory: 16777200,
295
+ khaki: 15787660,
296
+ lavender: 15132410,
297
+ lavenderblush: 16773365,
298
+ lawngreen: 8190976,
299
+ lemonchiffon: 16775885,
300
+ lightblue: 11393254,
301
+ lightcoral: 15761536,
302
+ lightcyan: 14745599,
303
+ lightgoldenrodyellow: 16448210,
304
+ lightgray: 13882323,
305
+ lightgreen: 9498256,
306
+ lightgrey: 13882323,
307
+ lightpink: 16758465,
308
+ lightsalmon: 16752762,
309
+ lightseagreen: 2142890,
310
+ lightskyblue: 8900346,
311
+ lightslategray: 7833753,
312
+ lightslategrey: 7833753,
313
+ lightsteelblue: 11584734,
314
+ lightyellow: 16777184,
315
+ lime: 65280,
316
+ limegreen: 3329330,
317
+ linen: 16445670,
318
+ magenta: 16711935,
319
+ maroon: 8388608,
320
+ mediumaquamarine: 6737322,
321
+ mediumblue: 205,
322
+ mediumorchid: 12211667,
323
+ mediumpurple: 9662683,
324
+ mediumseagreen: 3978097,
325
+ mediumslateblue: 8087790,
326
+ mediumspringgreen: 64154,
327
+ mediumturquoise: 4772300,
328
+ mediumvioletred: 13047173,
329
+ midnightblue: 1644912,
330
+ mintcream: 16121850,
331
+ mistyrose: 16770273,
332
+ moccasin: 16770229,
333
+ navajowhite: 16768685,
334
+ navy: 128,
335
+ oldlace: 16643558,
336
+ olive: 8421376,
337
+ olivedrab: 7048739,
338
+ orange: 16753920,
339
+ orangered: 16729344,
340
+ orchid: 14315734,
341
+ palegoldenrod: 15657130,
342
+ palegreen: 10025880,
343
+ paleturquoise: 11529966,
344
+ palevioletred: 14381203,
345
+ papayawhip: 16773077,
346
+ peachpuff: 16767673,
347
+ peru: 13468991,
348
+ pink: 16761035,
349
+ plum: 14524637,
350
+ powderblue: 11591910,
351
+ purple: 8388736,
352
+ rebeccapurple: 6697881,
353
+ red: 16711680,
354
+ rosybrown: 12357519,
355
+ royalblue: 4286945,
356
+ saddlebrown: 9127187,
357
+ salmon: 16416882,
358
+ sandybrown: 16032864,
359
+ seagreen: 3050327,
360
+ seashell: 16774638,
361
+ sienna: 10506797,
362
+ silver: 12632256,
363
+ skyblue: 8900331,
364
+ slateblue: 6970061,
365
+ slategray: 7372944,
366
+ slategrey: 7372944,
367
+ snow: 16775930,
368
+ springgreen: 65407,
369
+ steelblue: 4620980,
370
+ tan: 13808780,
371
+ teal: 32896,
372
+ thistle: 14204888,
373
+ tomato: 16737095,
374
+ turquoise: 4251856,
375
+ violet: 15631086,
376
+ wheat: 16113331,
377
+ white: 16777215,
378
+ whitesmoke: 16119285,
379
+ yellow: 16776960,
380
+ yellowgreen: 10145074
381
+ };
382
+ Fe(w, Ze, {
383
+ copy(e) {
384
+ return Object.assign(new this.constructor(), this, e);
385
+ },
386
+ displayable() {
387
+ return this.rgb().displayable();
388
+ },
389
+ hex: qe,
390
+ formatHex: qe,
391
+ formatHex8: Je,
392
+ formatHsl: Ye,
393
+ formatRgb: Xe,
394
+ toString: Xe
395
+ });
396
+ function qe() {
397
+ return this.rgb().formatHex();
398
+ }
399
+ function Je() {
400
+ return this.rgb().formatHex8();
401
+ }
402
+ function Ye() {
403
+ return st(this).formatHsl();
404
+ }
405
+ function Xe() {
406
+ return this.rgb().formatRgb();
407
+ }
408
+ function Ze(e) {
409
+ var t, n;
410
+ return e = (e + "").trim().toLowerCase(), (t = ze.exec(e)) ? (n = t[1].length, t = parseInt(t[1], 16), n === 6 ? Qe(t) : n === 3 ? new O(t >> 8 & 15 | t >> 4 & 240, t >> 4 & 15 | t & 240, (t & 15) << 4 | t & 15, 1) : n === 8 ? $e(t >> 24 & 255, t >> 16 & 255, t >> 8 & 255, (t & 255) / 255) : n === 4 ? $e(t >> 12 & 15 | t >> 8 & 240, t >> 8 & 15 | t >> 4 & 240, t >> 4 & 15 | t & 240, ((t & 15) << 4 | t & 15) / 255) : null) : (t = Be.exec(e)) ? new O(t[1], t[2], t[3], 1) : (t = Ve.exec(e)) ? new O(t[1] * 255 / 100, t[2] * 255 / 100, t[3] * 255 / 100, 1) : (t = He.exec(e)) ? $e(t[1], t[2], t[3], t[4]) : (t = Ue.exec(e)) ? $e(t[1] * 255 / 100, t[2] * 255 / 100, t[3] * 255 / 100, t[4]) : (t = We.exec(e)) ? ot(t[1], t[2] / 100, t[3] / 100, 1) : (t = Ge.exec(e)) ? ot(t[1], t[2] / 100, t[3] / 100, t[4]) : Ke.hasOwnProperty(e) ? Qe(Ke[e]) : e === "transparent" ? new O(NaN, NaN, NaN, 0) : null;
411
+ }
412
+ function Qe(e) {
413
+ return new O(e >> 16 & 255, e >> 8 & 255, e & 255, 1);
414
+ }
415
+ function $e(e, t, n, r) {
416
+ return r <= 0 && (e = t = n = NaN), new O(e, t, n, r);
417
+ }
418
+ function et(e) {
419
+ return e instanceof w || (e = Ze(e)), e ? (e = e.rgb(), new O(e.r, e.g, e.b, e.opacity)) : new O();
420
+ }
421
+ function tt(e, t, n, r) {
422
+ return arguments.length === 1 ? et(e) : new O(e, t, n, r ?? 1);
423
+ }
424
+ function O(e, t, n, r) {
425
+ this.r = +e, this.g = +t, this.b = +n, this.opacity = +r;
426
+ }
427
+ Fe(O, tt, Ie(w, {
428
+ brighter(e) {
429
+ return e = e == null ? Le : Le ** +e, new O(this.r * e, this.g * e, this.b * e, this.opacity);
430
+ },
431
+ darker(e) {
432
+ return e = e == null ? T : T ** +e, new O(this.r * e, this.g * e, this.b * e, this.opacity);
433
+ },
434
+ rgb() {
435
+ return this;
436
+ },
437
+ clamp() {
438
+ return new O(k(this.r), k(this.g), k(this.b), at(this.opacity));
439
+ },
440
+ displayable() {
441
+ return -.5 <= this.r && this.r < 255.5 && -.5 <= this.g && this.g < 255.5 && -.5 <= this.b && this.b < 255.5 && 0 <= this.opacity && this.opacity <= 1;
442
+ },
443
+ hex: nt,
444
+ formatHex: nt,
445
+ formatHex8: rt,
446
+ formatRgb: it,
447
+ toString: it
448
+ }));
449
+ function nt() {
450
+ return `#${A(this.r)}${A(this.g)}${A(this.b)}`;
451
+ }
452
+ function rt() {
453
+ return `#${A(this.r)}${A(this.g)}${A(this.b)}${A((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`;
454
+ }
455
+ function it() {
456
+ let e = at(this.opacity);
457
+ return `${e === 1 ? "rgb(" : "rgba("}${k(this.r)}, ${k(this.g)}, ${k(this.b)}${e === 1 ? ")" : `, ${e})`}`;
458
+ }
459
+ function at(e) {
460
+ return isNaN(e) ? 1 : Math.max(0, Math.min(1, e));
461
+ }
462
+ function k(e) {
463
+ return Math.max(0, Math.min(255, Math.round(e) || 0));
464
+ }
465
+ function A(e) {
466
+ return e = k(e), (e < 16 ? "0" : "") + e.toString(16);
467
+ }
468
+ function ot(e, t, n, r) {
469
+ return r <= 0 ? e = t = n = NaN : n <= 0 || n >= 1 ? e = t = NaN : t <= 0 && (e = NaN), new j(e, t, n, r);
470
+ }
471
+ function st(e) {
472
+ if (e instanceof j) return new j(e.h, e.s, e.l, e.opacity);
473
+ if (e instanceof w || (e = Ze(e)), !e) return new j();
474
+ if (e instanceof j) return e;
475
+ e = e.rgb();
476
+ var t = e.r / 255, n = e.g / 255, r = e.b / 255, i = Math.min(t, n, r), a = Math.max(t, n, r), o = NaN, s = a - i, c = (a + i) / 2;
477
+ return s ? (o = t === a ? (n - r) / s + (n < r) * 6 : n === a ? (r - t) / s + 2 : (t - n) / s + 4, s /= c < .5 ? a + i : 2 - a - i, o *= 60) : s = c > 0 && c < 1 ? 0 : o, new j(o, s, c, e.opacity);
478
+ }
479
+ function ct(e, t, n, r) {
480
+ return arguments.length === 1 ? st(e) : new j(e, t, n, r ?? 1);
481
+ }
482
+ function j(e, t, n, r) {
483
+ this.h = +e, this.s = +t, this.l = +n, this.opacity = +r;
484
+ }
485
+ Fe(j, ct, Ie(w, {
486
+ brighter(e) {
487
+ return e = e == null ? Le : Le ** +e, new j(this.h, this.s, this.l * e, this.opacity);
488
+ },
489
+ darker(e) {
490
+ return e = e == null ? T : T ** +e, new j(this.h, this.s, this.l * e, this.opacity);
491
+ },
492
+ rgb() {
493
+ var e = this.h % 360 + (this.h < 0) * 360, t = isNaN(e) || isNaN(this.s) ? 0 : this.s, n = this.l, r = n + (n < .5 ? n : 1 - n) * t, i = 2 * n - r;
494
+ return new O(dt(e >= 240 ? e - 240 : e + 120, i, r), dt(e, i, r), dt(e < 120 ? e + 240 : e - 120, i, r), this.opacity);
495
+ },
496
+ clamp() {
497
+ return new j(lt(this.h), ut(this.s), ut(this.l), at(this.opacity));
498
+ },
499
+ displayable() {
500
+ return (0 <= this.s && this.s <= 1 || isNaN(this.s)) && 0 <= this.l && this.l <= 1 && 0 <= this.opacity && this.opacity <= 1;
501
+ },
502
+ formatHsl() {
503
+ let e = at(this.opacity);
504
+ return `${e === 1 ? "hsl(" : "hsla("}${lt(this.h)}, ${ut(this.s) * 100}%, ${ut(this.l) * 100}%${e === 1 ? ")" : `, ${e})`}`;
505
+ }
506
+ }));
507
+ function lt(e) {
508
+ return e = (e || 0) % 360, e < 0 ? e + 360 : e;
509
+ }
510
+ function ut(e) {
511
+ return Math.max(0, Math.min(1, e || 0));
512
+ }
513
+ function dt(e, t, n) {
514
+ return (e < 60 ? t + (n - t) * e / 60 : e < 180 ? n : e < 240 ? t + (n - t) * (240 - e) / 60 : t) * 255;
515
+ }
516
+ //#endregion
220
517
  //#region ../../node_modules/d3-format/src/formatDecimal.js
221
- function Re(e) {
518
+ function ft(e) {
222
519
  return Math.abs(e = Math.round(e)) >= 1e21 ? e.toLocaleString("en").replace(/,/g, "") : e.toString(10);
223
520
  }
224
- function ze(e, t) {
521
+ function pt(e, t) {
225
522
  if (!isFinite(e) || e === 0) return null;
226
523
  var n = (e = t ? e.toExponential(t - 1) : e.toExponential()).indexOf("e"), r = e.slice(0, n);
227
524
  return [r.length > 1 ? r[0] + r.slice(2) : r, +e.slice(n + 1)];
228
525
  }
229
526
  //#endregion
230
527
  //#region ../../node_modules/d3-format/src/exponent.js
231
- function Be(e) {
232
- return e = ze(Math.abs(e)), e ? e[1] : NaN;
528
+ function mt(e) {
529
+ return e = pt(Math.abs(e)), e ? e[1] : NaN;
233
530
  }
234
531
  //#endregion
235
532
  //#region ../../node_modules/d3-format/src/formatGroup.js
236
- function Ve(e, t) {
533
+ function ht(e, t) {
237
534
  return function(n, r) {
238
535
  for (var i = n.length, a = [], o = 0, s = e[0], c = 0; i > 0 && s > 0 && (c + s + 1 > r && (s = Math.max(1, r - c)), a.push(n.substring(i -= s, i + s)), !((c += s + 1) > r));) s = e[o = (o + 1) % e.length];
239
536
  return a.reverse().join(t);
@@ -241,7 +538,7 @@ function Ve(e, t) {
241
538
  }
242
539
  //#endregion
243
540
  //#region ../../node_modules/d3-format/src/formatNumerals.js
244
- function He(e) {
541
+ function gt(e) {
245
542
  return function(t) {
246
543
  return t.replace(/[0-9]/g, function(t) {
247
544
  return e[+t];
@@ -250,11 +547,11 @@ function He(e) {
250
547
  }
251
548
  //#endregion
252
549
  //#region ../../node_modules/d3-format/src/formatSpecifier.js
253
- var Ue = /^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;
254
- function We(e) {
255
- if (!(t = Ue.exec(e))) throw Error("invalid format: " + e);
550
+ var _t = /^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;
551
+ function vt(e) {
552
+ if (!(t = _t.exec(e))) throw Error("invalid format: " + e);
256
553
  var t;
257
- return new Ge({
554
+ return new yt({
258
555
  fill: t[1],
259
556
  align: t[2],
260
557
  sign: t[3],
@@ -267,16 +564,16 @@ function We(e) {
267
564
  type: t[10]
268
565
  });
269
566
  }
270
- We.prototype = Ge.prototype;
271
- function Ge(e) {
567
+ vt.prototype = yt.prototype;
568
+ function yt(e) {
272
569
  this.fill = e.fill === void 0 ? " " : e.fill + "", this.align = e.align === void 0 ? ">" : e.align + "", this.sign = e.sign === void 0 ? "-" : e.sign + "", this.symbol = e.symbol === void 0 ? "" : e.symbol + "", this.zero = !!e.zero, this.width = e.width === void 0 ? void 0 : +e.width, this.comma = !!e.comma, this.precision = e.precision === void 0 ? void 0 : +e.precision, this.trim = !!e.trim, this.type = e.type === void 0 ? "" : e.type + "";
273
570
  }
274
- Ge.prototype.toString = function() {
571
+ yt.prototype.toString = function() {
275
572
  return this.fill + this.align + this.sign + this.symbol + (this.zero ? "0" : "") + (this.width === void 0 ? "" : Math.max(1, this.width | 0)) + (this.comma ? "," : "") + (this.precision === void 0 ? "" : "." + Math.max(0, this.precision | 0)) + (this.trim ? "~" : "") + this.type;
276
573
  };
277
574
  //#endregion
278
575
  //#region ../../node_modules/d3-format/src/formatTrim.js
279
- function Ke(e) {
576
+ function bt(e) {
280
577
  out: for (var t = e.length, n = 1, r = -1, i; n < t; ++n) switch (e[n]) {
281
578
  case ".":
282
579
  r = i = n;
@@ -292,46 +589,46 @@ function Ke(e) {
292
589
  }
293
590
  //#endregion
294
591
  //#region ../../node_modules/d3-format/src/formatPrefixAuto.js
295
- var qe;
296
- function Je(e, t) {
297
- var n = ze(e, t);
298
- if (!n) return qe = void 0, e.toPrecision(t);
299
- var r = n[0], i = n[1], a = i - (qe = Math.max(-8, Math.min(8, Math.floor(i / 3))) * 3) + 1, o = r.length;
300
- return a === o ? r : a > o ? r + Array(a - o + 1).join("0") : a > 0 ? r.slice(0, a) + "." + r.slice(a) : "0." + Array(1 - a).join("0") + ze(e, Math.max(0, t + a - 1))[0];
592
+ var xt;
593
+ function St(e, t) {
594
+ var n = pt(e, t);
595
+ if (!n) return xt = void 0, e.toPrecision(t);
596
+ var r = n[0], i = n[1], a = i - (xt = Math.max(-8, Math.min(8, Math.floor(i / 3))) * 3) + 1, o = r.length;
597
+ return a === o ? r : a > o ? r + Array(a - o + 1).join("0") : a > 0 ? r.slice(0, a) + "." + r.slice(a) : "0." + Array(1 - a).join("0") + pt(e, Math.max(0, t + a - 1))[0];
301
598
  }
302
599
  //#endregion
303
600
  //#region ../../node_modules/d3-format/src/formatRounded.js
304
- function Ye(e, t) {
305
- var n = ze(e, t);
601
+ function Ct(e, t) {
602
+ var n = pt(e, t);
306
603
  if (!n) return e + "";
307
604
  var r = n[0], i = n[1];
308
605
  return i < 0 ? "0." + Array(-i).join("0") + r : r.length > i + 1 ? r.slice(0, i + 1) + "." + r.slice(i + 1) : r + Array(i - r.length + 2).join("0");
309
606
  }
310
607
  //#endregion
311
608
  //#region ../../node_modules/d3-format/src/formatTypes.js
312
- var Xe = {
609
+ var wt = {
313
610
  "%": (e, t) => (e * 100).toFixed(t),
314
611
  b: (e) => Math.round(e).toString(2),
315
612
  c: (e) => e + "",
316
- d: Re,
613
+ d: ft,
317
614
  e: (e, t) => e.toExponential(t),
318
615
  f: (e, t) => e.toFixed(t),
319
616
  g: (e, t) => e.toPrecision(t),
320
617
  o: (e) => Math.round(e).toString(8),
321
- p: (e, t) => Ye(e * 100, t),
322
- r: Ye,
323
- s: Je,
618
+ p: (e, t) => Ct(e * 100, t),
619
+ r: Ct,
620
+ s: St,
324
621
  X: (e) => Math.round(e).toString(16).toUpperCase(),
325
622
  x: (e) => Math.round(e).toString(16)
326
623
  };
327
624
  //#endregion
328
625
  //#region ../../node_modules/d3-format/src/identity.js
329
- function Ze(e) {
626
+ function Tt(e) {
330
627
  return e;
331
628
  }
332
629
  //#endregion
333
630
  //#region ../../node_modules/d3-format/src/locale.js
334
- var Qe = Array.prototype.map, $e = [
631
+ var Et = Array.prototype.map, Dt = [
335
632
  "y",
336
633
  "z",
337
634
  "a",
@@ -350,49 +647,49 @@ var Qe = Array.prototype.map, $e = [
350
647
  "Z",
351
648
  "Y"
352
649
  ];
353
- function et(e) {
354
- var t = e.grouping === void 0 || e.thousands === void 0 ? Ze : Ve(Qe.call(e.grouping, Number), e.thousands + ""), n = e.currency === void 0 ? "" : e.currency[0] + "", r = e.currency === void 0 ? "" : e.currency[1] + "", i = e.decimal === void 0 ? "." : e.decimal + "", a = e.numerals === void 0 ? Ze : He(Qe.call(e.numerals, String)), o = e.percent === void 0 ? "%" : e.percent + "", s = e.minus === void 0 ? "−" : e.minus + "", c = e.nan === void 0 ? "NaN" : e.nan + "";
650
+ function Ot(e) {
651
+ var t = e.grouping === void 0 || e.thousands === void 0 ? Tt : ht(Et.call(e.grouping, Number), e.thousands + ""), n = e.currency === void 0 ? "" : e.currency[0] + "", r = e.currency === void 0 ? "" : e.currency[1] + "", i = e.decimal === void 0 ? "." : e.decimal + "", a = e.numerals === void 0 ? Tt : gt(Et.call(e.numerals, String)), o = e.percent === void 0 ? "%" : e.percent + "", s = e.minus === void 0 ? "−" : e.minus + "", c = e.nan === void 0 ? "NaN" : e.nan + "";
355
652
  function l(e, l) {
356
- e = We(e);
357
- var u = e.fill, d = e.align, f = e.sign, p = e.symbol, m = e.zero, ee = e.width, te = e.comma, h = e.precision, g = e.trim, _ = e.type;
358
- _ === "n" ? (te = !0, _ = "g") : Xe[_] || (h === void 0 && (h = 12), g = !0, _ = "g"), (m || u === "0" && d === "=") && (m = !0, u = "0", d = "=");
359
- var ne = (l && l.prefix !== void 0 ? l.prefix : "") + (p === "$" ? n : p === "#" && /[boxX]/.test(_) ? "0" + _.toLowerCase() : ""), re = (p === "$" ? r : /[%p]/.test(_) ? o : "") + (l && l.suffix !== void 0 ? l.suffix : ""), ie = Xe[_], ae = /[defgprs%]/.test(_);
360
- h = h === void 0 ? 6 : /[gprs]/.test(_) ? Math.max(1, Math.min(21, h)) : Math.max(0, Math.min(20, h));
361
- function v(e) {
362
- var n = ne, r = re, o, l, p;
363
- if (_ === "c") r = ie(e) + r, e = "";
653
+ e = vt(e);
654
+ var u = e.fill, d = e.align, f = e.sign, p = e.symbol, m = e.zero, h = e.width, g = e.comma, _ = e.precision, v = e.trim, y = e.type;
655
+ y === "n" ? (g = !0, y = "g") : wt[y] || (_ === void 0 && (_ = 12), v = !0, y = "g"), (m || u === "0" && d === "=") && (m = !0, u = "0", d = "=");
656
+ var b = (l && l.prefix !== void 0 ? l.prefix : "") + (p === "$" ? n : p === "#" && /[boxX]/.test(y) ? "0" + y.toLowerCase() : ""), ee = (p === "$" ? r : /[%p]/.test(y) ? o : "") + (l && l.suffix !== void 0 ? l.suffix : ""), te = wt[y], ne = /[defgprs%]/.test(y);
657
+ _ = _ === void 0 ? 6 : /[gprs]/.test(y) ? Math.max(1, Math.min(21, _)) : Math.max(0, Math.min(20, _));
658
+ function x(e) {
659
+ var n = b, r = ee, o, l, p;
660
+ if (y === "c") r = te(e) + r, e = "";
364
661
  else {
365
662
  e = +e;
366
- var v = e < 0 || 1 / e < 0;
367
- if (e = isNaN(e) ? c : ie(Math.abs(e), h), g && (e = Ke(e)), v && +e == 0 && f !== "+" && (v = !1), n = (v ? f === "(" ? f : s : f === "-" || f === "(" ? "" : f) + n, r = (_ === "s" && !isNaN(e) && qe !== void 0 ? $e[8 + qe / 3] : "") + r + (v && f === "(" ? ")" : ""), ae) {
663
+ var x = e < 0 || 1 / e < 0;
664
+ if (e = isNaN(e) ? c : te(Math.abs(e), _), v && (e = bt(e)), x && +e == 0 && f !== "+" && (x = !1), n = (x ? f === "(" ? f : s : f === "-" || f === "(" ? "" : f) + n, r = (y === "s" && !isNaN(e) && xt !== void 0 ? Dt[8 + xt / 3] : "") + r + (x && f === "(" ? ")" : ""), ne) {
368
665
  for (o = -1, l = e.length; ++o < l;) if (p = e.charCodeAt(o), 48 > p || p > 57) {
369
666
  r = (p === 46 ? i + e.slice(o + 1) : e.slice(o)) + r, e = e.slice(0, o);
370
667
  break;
371
668
  }
372
669
  }
373
670
  }
374
- te && !m && (e = t(e, Infinity));
375
- var oe = n.length + e.length + r.length, y = oe < ee ? Array(ee - oe + 1).join(u) : "";
376
- switch (te && m && (e = t(y + e, y.length ? ee - r.length : Infinity), y = ""), d) {
671
+ g && !m && (e = t(e, Infinity));
672
+ var re = n.length + e.length + r.length, S = re < h ? Array(h - re + 1).join(u) : "";
673
+ switch (g && m && (e = t(S + e, S.length ? h - r.length : Infinity), S = ""), d) {
377
674
  case "<":
378
- e = n + e + r + y;
675
+ e = n + e + r + S;
379
676
  break;
380
677
  case "=":
381
- e = n + y + e + r;
678
+ e = n + S + e + r;
382
679
  break;
383
680
  case "^":
384
- e = y.slice(0, oe = y.length >> 1) + n + e + r + y.slice(oe);
681
+ e = S.slice(0, re = S.length >> 1) + n + e + r + S.slice(re);
385
682
  break;
386
- default: e = y + n + e + r;
683
+ default: e = S + n + e + r;
387
684
  }
388
685
  return a(e);
389
686
  }
390
- return v.toString = function() {
687
+ return x.toString = function() {
391
688
  return e + "";
392
- }, v;
689
+ }, x;
393
690
  }
394
691
  function u(e, t) {
395
- var n = Math.max(-8, Math.min(8, Math.floor(Be(t) / 3))) * 3, r = 10 ** -n, i = l((e = We(e), e.type = "f", e), { suffix: $e[8 + n / 3] });
692
+ var n = Math.max(-8, Math.min(8, Math.floor(mt(t) / 3))) * 3, r = 10 ** -n, i = l((e = vt(e), e.type = "f", e), { suffix: Dt[8 + n / 3] });
396
693
  return function(e) {
397
694
  return i(r * e);
398
695
  };
@@ -404,35 +701,18 @@ function et(e) {
404
701
  }
405
702
  //#endregion
406
703
  //#region ../../node_modules/d3-format/src/defaultLocale.js
407
- var tt, nt, rt;
408
- it({
704
+ var kt, At, jt;
705
+ Mt({
409
706
  thousands: ",",
410
707
  grouping: [3],
411
708
  currency: ["$", ""]
412
709
  });
413
- function it(e) {
414
- return tt = et(e), nt = tt.format, rt = tt.formatPrefix, tt;
415
- }
416
- //#endregion
417
- //#region ../core/src/utils/arrayUtils.js
418
- function at(e, t) {
419
- return e.length == t.length && e.every((n, r) => e[r] === t[r]);
420
- }
421
- function ot(e) {
422
- return Array.isArray(e) ? e : e === void 0 ? [] : [e];
423
- }
424
- function st(e) {
425
- return e[e.length - 1];
426
- }
427
- function ct(e, t, n) {
428
- if (t < 0 || t >= e.length) throw Error("Source index out of range.");
429
- if (n < 0 || n > e.length - 1) throw Error("Destination index out of range.");
430
- let [r] = e.splice(t, 1);
431
- e.splice(n, 0, r);
710
+ function Mt(e) {
711
+ return kt = Ot(e), At = kt.format, jt = kt.formatPrefix, kt;
432
712
  }
433
713
  //#endregion
434
714
  //#region ../core/src/data/sideInputBinding.js
435
- var lt = class {
715
+ var Nt = class {
436
716
  #e;
437
717
  #t;
438
718
  #n = !1;
@@ -468,7 +748,7 @@ var lt = class {
468
748
  isReady() {
469
749
  return this.#r && this.#n && this.#e.areDataDependenciesAvailable() && this.#t.every(({ collector: e, consumed: t }) => e.dataRevision === t);
470
750
  }
471
- }, ut = class {
751
+ }, Pt = class {
472
752
  stats = {
473
753
  count: 0,
474
754
  first: null
@@ -482,6 +762,9 @@ var lt = class {
482
762
  get behavior() {
483
763
  return 0;
484
764
  }
765
+ get createsNewIdentity() {
766
+ return !1;
767
+ }
485
768
  get domainSensitiveScaleChannels() {
486
769
  return [];
487
770
  }
@@ -520,7 +803,7 @@ var lt = class {
520
803
  initialized: this.#e,
521
804
  disposed: this.#t,
522
805
  params: "params" in e ? structuredClone(e.params) : void 0,
523
- view: dt(e, this.paramRuntimeProvider),
806
+ view: Ft(e, this.paramRuntimeProvider),
524
807
  domainSensitiveScaleChannels: this.domainSensitiveScaleChannels
525
808
  };
526
809
  }
@@ -531,15 +814,15 @@ var lt = class {
531
814
  }
532
815
  initialize() {}
533
816
  initializeOnce() {
534
- this.#e ||= (this.dataDependencies.length && (this.#i = new lt(this)), this.initialize(), !0);
817
+ this.#e ||= (this.dataDependencies.length && (this.#i = new Nt(this)), this.initialize(), !0);
535
818
  }
536
819
  #a() {
537
- this._propagate = Function("children", "stats", Le(this.children.length).map((e) => `const child${e} = children[${e}];`).join("\n") + `return function propagate(datum) {
820
+ this._propagate = Function("children", "stats", Pe(this.children.length).map((e) => `const child${e} = children[${e}];`).join("\n") + `return function propagate(datum) {
538
821
  if (stats.count === 0) {
539
822
  stats.first = structuredClone(datum);
540
823
  }
541
824
  stats.count++;
542
- ${Le(this.children.length).map((e) => `child${e}.handle(datum);`).join("\n")}
825
+ ${Pe(this.children.length).map((e) => `child${e}.handle(datum);`).join("\n")}
543
826
  };`)(this.children, this.stats);
544
827
  }
545
828
  setParent(e) {
@@ -651,11 +934,11 @@ var lt = class {
651
934
  }
652
935
  _propagate(e) {}
653
936
  };
654
- function dt(e, t) {
937
+ function Ft(e, t) {
655
938
  if ("view" in e) return e.view;
656
939
  if (t && "getPathString" in t) return t;
657
940
  }
658
- function ft(e) {
941
+ function It(e) {
659
942
  let t = /* @__PURE__ */ new Set();
660
943
  for (; e;) {
661
944
  for (let n of e.domainSensitiveScaleChannels) t.add(n);
@@ -663,15 +946,174 @@ function ft(e) {
663
946
  }
664
947
  return t;
665
948
  }
666
- function pt(e) {
949
+ function Lt(e) {
667
950
  return e.type == "file";
668
951
  }
669
- function mt(e) {
952
+ function Rt(e) {
670
953
  return e.type == "facet";
671
954
  }
672
955
  //#endregion
956
+ //#region ../core/src/ruler/rulerValue.js
957
+ function zt(e = ["x"], t = {}) {
958
+ let n = {};
959
+ for (let r of e) n[r] = t[r] ?? null;
960
+ return {
961
+ type: "ruler",
962
+ values: n
963
+ };
964
+ }
965
+ //#endregion
966
+ //#region ../core/src/paramRuntime/paramUtils.js
967
+ function M(e) {
968
+ return typeof e == "object" && !!e && "expr" in e && C(e.expr);
969
+ }
970
+ function Bt(e) {
971
+ if (M(e)) throw Error("ExprRef " + JSON.stringify(e) + " not allowed here. Expected a scalar value.");
972
+ return e;
973
+ }
974
+ function Vt(e) {
975
+ return ("expr" in e || "bind" in e) && !("select" in e) && !("ruler" in e);
976
+ }
977
+ function Ht(e) {
978
+ return !("expr" in e || "bind" in e) && "select" in e;
979
+ }
980
+ function Ut(e) {
981
+ return !("expr" in e || "bind" in e || "select" in e) && "ruler" in e;
982
+ }
983
+ function Wt(e) {
984
+ if (!/^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(e)) throw Error("Invalid parameter name: " + e + ". Must be a valid JavaScript identifier.");
985
+ return e;
986
+ }
987
+ function Gt(e, t, n) {
988
+ if ("select" in e) {
989
+ let t = sa(e.select);
990
+ if (ca(t)) return t.toggle ? Xi() : Yi(null);
991
+ if (la(t)) {
992
+ if (!t.encodings) throw Error("Interval selection \"" + e.name + "\" must have encodings defined!");
993
+ return Qi(t.encodings);
994
+ }
995
+ throw Error("Unknown selection config for parameter \"" + e.name + "\".");
996
+ }
997
+ if ("ruler" in e) return zt(e.ruler.encodings, e.value);
998
+ if ("expr" in e) {
999
+ let r = n ?? t?.createExpression(e);
1000
+ if (!r) throw Error("Cannot evaluate expression for parameter \"" + e.name + "\".");
1001
+ return r(null);
1002
+ }
1003
+ return "value" in e ? e.value : null;
1004
+ }
1005
+ function Kt(e, t, n, r, i = []) {
1006
+ let a = { ...t }, o = [];
1007
+ for (let [r, i] of Object.entries(t)) if (M(i)) {
1008
+ let t = e.createExpression(i), s = o.push({
1009
+ key: r,
1010
+ fn: t
1011
+ }) - 1;
1012
+ Object.defineProperty(a, r, {
1013
+ enumerable: !0,
1014
+ get: n ? () => c.get()[s] : () => t(null)
1015
+ });
1016
+ } else a[r] = i;
1017
+ if (!n) return a;
1018
+ for (let { key: t, expr: n } of i) o.push({
1019
+ key: t,
1020
+ fn: e.createExpression(n)
1021
+ });
1022
+ if (!o.length) return a;
1023
+ let s = Array.from(new Set(o.flatMap(({ fn: e }) => e.dependencies))), c = e.computed("expression properties", s, () => o.map(({ fn: e }) => e(null)), { equals: qt }), l = c.get(), u = e.effect([c], () => {
1024
+ let e = c.get(), t = new Set(o.filter((t, n) => l[n] !== e[n]).map(({ key: e }) => e));
1025
+ l = e, n(t);
1026
+ });
1027
+ return r?.(c.dispose), r?.(u), a;
1028
+ }
1029
+ function qt(e, t) {
1030
+ return e.every((e, n) => e === t[n]);
1031
+ }
1032
+ function Jt(e, t, n, r) {
1033
+ if (!M(t)) return t;
1034
+ let i = () => {
1035
+ throw Error(n);
1036
+ }, a = e.watchExpression ? e.watchExpression(t, i, {
1037
+ scopeOwned: !1,
1038
+ registerDisposer: r
1039
+ }) : e.createExpression(t);
1040
+ if (!e.watchExpression) {
1041
+ let e = a.subscribe(i);
1042
+ r?.(e);
1043
+ }
1044
+ return a();
1045
+ }
1046
+ function Yt(e) {
1047
+ return Object.assign(() => e, {
1048
+ dependencies: [],
1049
+ subscribe: () => () => void 0,
1050
+ invalidate: () => void 0,
1051
+ identifier: () => "constant",
1052
+ fields: [],
1053
+ globals: [],
1054
+ code: JSON.stringify(e)
1055
+ });
1056
+ }
1057
+ //#endregion
1058
+ //#region ../core/src/utils/specError.js
1059
+ function Xt(e) {
1060
+ let t = /* @__PURE__ */ new Set();
1061
+ for (; e instanceof Error && !t.has(e);) {
1062
+ t.add(e);
1063
+ let n = e.specLocation;
1064
+ if (n) return n;
1065
+ e = e.cause;
1066
+ }
1067
+ }
1068
+ function Zt(e, t) {
1069
+ return e instanceof Error && t && !Xt(e) && Object.assign(e, { specLocation: t }), e;
1070
+ }
1071
+ //#endregion
1072
+ //#region ../core/src/utils/compileDatumAccessor.js
1073
+ var Qt = 0;
1074
+ function $t(e, t, n, r) {
1075
+ let i = Array.from(t, (e) => {
1076
+ let t = JSON.stringify(e);
1077
+ return `if (!(${t} in datum)) missingField(datum, ${t});`;
1078
+ }).join("\n");
1079
+ return Function("missingField", "context", `"use strict";
1080
+ return function createAccessor(globalObject) {
1081
+ // accessor ${Qt++}
1082
+ return function accessDatum(datum) {
1083
+ ${i}
1084
+ ${e}
1085
+ }${r ? ".bind(context)" : ""};
1086
+ };`)((e, t) => {
1087
+ throw Zt(/* @__PURE__ */ Error(`Invalid field "${t}". Available fields or properties: ${Object.keys(e).join(", ")}`), n);
1088
+ }, r);
1089
+ }
1090
+ //#endregion
1091
+ //#region ../core/src/utils/field.js
1092
+ function en(t, n, r) {
1093
+ let i = s(t), a = i.length === 1 ? i[0] : t;
1094
+ return e($t(`return datum${i.map((e) => `[${JSON.stringify(e)}]`).join("")};`, i.length === 1 ? i : [], r)(), [a], n ?? a);
1095
+ }
1096
+ //#endregion
1097
+ //#region ../core/src/utils/arrayUtils.js
1098
+ function tn(e, t) {
1099
+ return e.length == t.length && e.every((n, r) => e[r] === t[r]);
1100
+ }
1101
+ function nn(e) {
1102
+ return Array.isArray(e) ? e : e === void 0 ? [] : [e];
1103
+ }
1104
+ function rn(e) {
1105
+ return e[e.length - 1];
1106
+ }
1107
+ function an(e, t, n) {
1108
+ if (t < 0 || t >= e.length) throw Error("Source index out of range.");
1109
+ if (n < 0 || n > e.length - 1) throw Error("Destination index out of range.");
1110
+ let [r] = e.splice(t, 1);
1111
+ e.splice(n, 0, r);
1112
+ }
1113
+ //#endregion
673
1114
  //#region ../core/src/data/transforms/transform.js
674
- var ht = class extends ut {
1115
+ var on = class extends Pt {
1116
+ inFacet = !1;
675
1117
  #e;
676
1118
  #t;
677
1119
  #n = 0;
@@ -691,10 +1133,10 @@ var ht = class extends ut {
691
1133
  super.complete(), this.#r = e, e == this.#n && (clearTimeout(this.#i), this.#i = void 0);
692
1134
  }
693
1135
  reset() {
694
- this.#s(), super.reset();
1136
+ this.#s(), this.inFacet = !1, super.reset();
695
1137
  }
696
1138
  beginBatch(e) {
697
- this.#s(), super.beginBatch(e);
1139
+ e.type == "facet" && (this.inFacet = !0), this.#s(), super.beginBatch(e);
698
1140
  }
699
1141
  requestReactiveRepropagate() {
700
1142
  if (this.#n++, this.#t === void 0) {
@@ -709,10 +1151,17 @@ var ht = class extends ut {
709
1151
  get label() {
710
1152
  return this.#e;
711
1153
  }
1154
+ createFieldAccessor(e, t, { index: n, defaultValue: r } = {}) {
1155
+ let i = e[t], a = Array.isArray(i), o = this.paramRuntimeProvider?.paramRuntime;
1156
+ return en(a ? i[n] : i ?? r, void 0, o?.getSpecLocation(e, i == null ? [] : a ? [t, n] : [t]));
1157
+ }
1158
+ createFieldAccessors(e, t) {
1159
+ return nn(e[t]).map((n, r) => this.createFieldAccessor(e, t, { index: r }));
1160
+ }
712
1161
  watchExprRef(e, t) {
713
- if (W(e)) {
1162
+ if (M(e)) {
714
1163
  let n = e;
715
- return this.paramRuntime.watchExpression(n.expr, t, {
1164
+ return this.paramRuntime.watchExpression(n, t, {
716
1165
  scopeOwned: !1,
717
1166
  registerDisposer: (e) => this.registerDisposer(e)
718
1167
  });
@@ -731,7 +1180,7 @@ var ht = class extends ut {
731
1180
  #s() {
732
1181
  for (let e of this.#a) e();
733
1182
  }
734
- }, x = "__uniqueId", gt = 1e4, _t = [null], vt = class extends ht {
1183
+ }, N = "__uniqueId", sn = 1e4, cn = [null], ln = class extends on {
735
1184
  get behavior() {
736
1185
  return 2;
737
1186
  }
@@ -743,1483 +1192,1048 @@ var ht = class extends ut {
743
1192
  super.reset(), this._usedBlocks = 0, this._id = -1;
744
1193
  }
745
1194
  handle(e) {
746
- e[x] = this.#e(), this._propagate(e);
1195
+ e[N] = this.#e(), this._propagate(e);
747
1196
  }
748
1197
  #e() {
749
- return ++this._id % 1e4 == 0 && (this._id = this.#t() * gt), this._id;
1198
+ return ++this._id % 1e4 == 0 && (this._id = this.#t() * sn), this._id;
750
1199
  }
751
1200
  #t() {
752
1201
  return this._usedBlocks < this._blocks.length ? this._blocks[this._usedBlocks++] : this.#n();
753
1202
  }
754
1203
  #n() {
755
- let e = _t.length;
756
- return _t[e] = this, this._blocks.push(e), this._usedBlocks++, e;
1204
+ let e = cn.length;
1205
+ return cn[e] = this, this._blocks.push(e), this._usedBlocks++, e;
757
1206
  }
758
1207
  };
759
1208
  //#endregion
760
- //#region ../core/src/utils/field.js
761
- function yt(t, n = t) {
762
- return /^[A-Za-z0-9_]+$/.test(t) ? e(Function("validator", `
763
- let validated = !validator;
764
- return function accessField(datum) {
765
- if (!validated) {
766
- validator(datum);
767
- validated = true;
768
- }
769
- return datum[${JSON.stringify(t)}];
770
- }`)(function(e) {
771
- t in e || bt(e, t);
772
- }), [t], n) : c(t);
773
- }
774
- function bt(e, t) {
775
- throw Error(`Invalid field "${t}". Available fields or properties: ${Object.keys(e).join(", ")}`);
1209
+ //#region ../../node_modules/vega-expression/node_modules/vega-util/build/accessor.js
1210
+ function P(e, t, n) {
1211
+ return Object.assign(e, {
1212
+ fields: t || [],
1213
+ fname: n
1214
+ });
776
1215
  }
777
1216
  //#endregion
778
- //#region ../core/src/selection/selectionPredicateTree.js
779
- function xt(e, t) {
780
- if (!("test" in e) || !("ref" in e.test)) return e;
781
- let n = e.test.ref;
782
- if (!Object.hasOwn(t, n)) throw Error(`Unknown predicate "${n}" in unit view.`);
783
- return {
784
- ...e,
785
- test: t[n]
786
- };
1217
+ //#region ../../node_modules/vega-expression/node_modules/vega-util/build/getter.js
1218
+ function un(e) {
1219
+ return e.length === 1 ? dn(e[0]) : fn(e);
787
1220
  }
788
- function St(e) {
789
- let t = "test" in e ? e.test : {
790
- param: e.param,
791
- ...e.empty === void 0 ? {} : { empty: e.empty },
792
- ...e.project === void 0 ? {} : { project: e.project }
793
- }, n = (e) => {
794
- if (!e || typeof e != "object" || Array.isArray(e)) throw Error("Selection predicate must be an object.");
795
- let t = e, r = [
796
- "param",
797
- "and",
798
- "or",
799
- "not"
800
- ].filter((e) => e in t);
801
- if (r.length !== 1) throw Error("Selection predicate must have exactly one operator.");
802
- let i = r[0];
803
- if (i === "param") {
804
- if (typeof t.param == "string") {
805
- if (Object.keys(t).some((e) => ![
806
- "param",
807
- "empty",
808
- "project"
809
- ].includes(e)) || typeof (t.empty ?? !0) != "boolean") throw Error("Invalid selection parameter predicate.");
810
- if (t.project !== void 0) {
811
- let e = t.project;
812
- if (!e || typeof e != "object" || Array.isArray(e) || Object.keys(e).length === 0 || Object.entries(e).some(([e, t]) => !["x", "y"].includes(e) || t !== e && t !== e + "2")) throw Error("Invalid interval selection projection.");
813
- }
814
- return {
815
- param: pa(t.param),
816
- empty: t.empty ?? !0,
817
- ...t.project ? { project: { ...t.project } } : {}
818
- };
819
- }
820
- if (!t.param || typeof t.param != "object" || Object.keys(t.param).length !== 1 || !Array.isArray(t.param.or) || Object.keys(t).some((e) => !["param", "empty"].includes(e)) || typeof (t.empty ?? !0) != "boolean") throw Error("Invalid flat selection union.");
821
- if (t.param.or.length === 0) throw Error("Selection test \"or\" must be a nonempty array.");
822
- let e = Array.from(new Set(t.param.or.map(pa))), n = e.map((e) => ({ selectionActive: e })), r = e.map((e, t) => ({ all: [{
823
- param: e,
824
- empty: !0
825
- }, n[t]] }));
826
- return { any: t.empty === !1 ? r : [...r, { not: { any: n } }] };
827
- }
828
- if (Object.keys(t).length !== 1) throw Error("Selection predicate operators cannot be mixed.");
829
- if (i === "not") return { not: n(t.not) };
830
- let a = t[i];
831
- if (!Array.isArray(a) || a.length === 0) throw Error(`Selection test "${i}" must be a nonempty array.`);
832
- let o = a.map(n);
833
- return i === "and" ? { all: o } : { any: o };
1221
+ var dn = (e) => function(t) {
1222
+ return t[e];
1223
+ }, fn = (e) => {
1224
+ let t = e.length;
1225
+ return function(n) {
1226
+ for (let r = 0; r < t; ++r) n = n[e[r]];
1227
+ return n;
834
1228
  };
835
- return n(t);
1229
+ };
1230
+ //#endregion
1231
+ //#region ../../node_modules/vega-expression/node_modules/vega-util/build/error.js
1232
+ function F(e) {
1233
+ throw Error(e);
836
1234
  }
837
- function Ct(e) {
838
- let t = /* @__PURE__ */ new Set(), n = (e) => {
839
- if ("param" in e) t.add(e.param);
840
- else if ("selectionActive" in e) t.add(typeof e.selectionActive == "string" ? e.selectionActive : e.selectionActive.param);
841
- else if ("not" in e) n(e.not);
842
- else for (let t of "all" in e ? e.all : e.any) n(t);
843
- };
844
- return n(e), Array.from(t);
1235
+ //#endregion
1236
+ //#region ../../node_modules/vega-expression/node_modules/vega-util/build/splitAccessPath.js
1237
+ function pn(e) {
1238
+ let t = [], n = e.length, r = null, i = 0, a = "", o, s, c;
1239
+ e += "";
1240
+ function l() {
1241
+ t.push(a + e.substring(o, s)), a = "", o = s + 1;
1242
+ }
1243
+ for (o = s = 0; s < n; ++s) if (c = e[s], c === "\\") a += e.substring(o, s++), o = s;
1244
+ else if (c === r) l(), r = null, i = -1;
1245
+ else if (r) continue;
1246
+ else o === i && c === "\"" || o === i && c === "'" ? (o = s + 1, r = c) : c === "." && !i ? s > o ? l() : o = s + 1 : c === "[" ? (s > o && l(), i = o = s + 1) : c === "]" && (i || F("Access path missing open bracket: " + e), i > 0 && l(), i = 0, o = s + 1);
1247
+ return i && F("Access path missing closing bracket: " + e), r && F("Access path missing closing quote: " + e), s > o && (s++, l()), t;
845
1248
  }
846
- function wt(e) {
847
- let t = /* @__PURE__ */ new Map(), n = (e) => {
848
- if ("param" in e) t.set(e.param, { selectionActive: {
849
- param: e.param,
850
- type: e.type,
851
- components: e.projections?.map(({ component: e }) => e) ?? []
852
- } });
853
- else if ("selectionActive" in e) t.set(e.selectionActive.param, e);
854
- else if ("not" in e) n(e.not);
855
- else for (let t of "all" in e ? e.all : e.any) n(t);
856
- };
857
- return n(e), { all: [e, { any: Array.from(t.values()) }] };
1249
+ //#endregion
1250
+ //#region ../../node_modules/vega-expression/node_modules/vega-util/build/field.js
1251
+ function mn(e, t, n) {
1252
+ let r = pn(e), i = r.length === 1 ? r[0] : e;
1253
+ return P((n && n.get || un)(r), [i], t || i);
858
1254
  }
859
- function Tt(e) {
860
- if ("param" in e) return e.empty;
861
- if ("selectionActive" in e) return !1;
862
- if ("not" in e) return !Tt(e.not);
863
- let t = "all" in e ? e.all : e.any;
864
- return "all" in e ? t.every(Tt) : t.some(Tt);
1255
+ mn("id"), P((e) => e, [], "identity"), P(() => 0, [], "zero"), P(() => 1, [], "one"), P(() => !0, [], "true"), P(() => !1, [], "false");
1256
+ //#endregion
1257
+ //#region ../../node_modules/vega-expression/node_modules/vega-util/build/interpreter.js
1258
+ var hn = /* @__PURE__ */ new Set([
1259
+ ...Object.getOwnPropertyNames(Object.prototype).filter((e) => typeof Object.prototype[e] == "function"),
1260
+ "__proto__",
1261
+ "then"
1262
+ ]);
1263
+ Array.isArray;
1264
+ //#endregion
1265
+ //#region ../../node_modules/vega-expression/node_modules/vega-util/build/isFunction.js
1266
+ function gn(e) {
1267
+ return typeof e == "function";
865
1268
  }
866
- function Et(e, t, n, r, i) {
867
- let a = (e) => {
868
- let t = n.findSelectionCapability?.(e);
869
- if (t) return t;
870
- let r = n.findValue(e);
871
- if (!r || ![
872
- "single",
873
- "multi",
874
- "interval"
875
- ].includes(r.type)) throw Error(`Selection parameter "${e}" was not found.`);
876
- return {
877
- type: r.type,
878
- components: r.type === "interval" ? Object.keys(r.intervals).map((e) => ({ component: e })) : []
879
- };
880
- }, o = t, s = (e) => {
881
- let t = o[e];
882
- if (t && "field" in t) return t.field;
883
- if (t && "condition" in t) return (Array.isArray(t.condition) ? t.condition : [t.condition]).find((e) => "field" in e)?.field;
884
- }, c = (e) => {
885
- if ("all" in e) return { all: e.all.map(c) };
886
- if ("any" in e) return { any: e.any.map(c) };
887
- if ("not" in e) return { not: c(e.not) };
888
- let t = "param" in e ? e.param : e.selectionActive, n = a(t);
889
- if ("selectionActive" in e) return { selectionActive: {
890
- param: t,
891
- type: n.type,
892
- components: n.components.map(({ component: e }) => e)
893
- } };
894
- if (e.project && n.type !== "interval") throw Error(`Selection "${t}" is not an interval selection; project is invalid.`);
895
- if (n.type !== "interval") return {
896
- param: t,
897
- type: n.type,
898
- empty: e.empty
899
- };
900
- let l = n.components.map(({ component: e }) => e);
901
- if (e.project && (Object.keys(e.project).length !== l.length || l.some((t) => !(t in e.project)))) throw Error(`Selection "${t}" project must cover its declared components: ${l.join(", ")}.`);
902
- let u = n.components.map(({ component: n, type: a }) => {
903
- let c = e.project?.[n] ?? n;
904
- if (![
905
- "x",
906
- "x2",
907
- "y",
908
- "y2"
909
- ].includes(c)) throw Error(`Selection "${t}" has unsupported component "${n}".`);
910
- let l = o[c];
911
- if (e.project && (!l || !("field" in l))) throw Error(`Selection "${t}" project target "${c}" must be an unconditional field encoding.`);
912
- let u = s(c);
913
- if (!u) throw Error(`Selection "${t}" has no field for "${c}".`);
914
- if (e.project) {
915
- let e = i?.(c) ?? ("type" in l ? l.type : void 0) ?? ("type" in o[n] ? o[n].type : void 0);
916
- if (![
917
- "quantitative",
918
- "index",
919
- "locus"
920
- ].includes(a) || e !== a) throw Error(`Selection "${t}" project target "${c}" must have matching quantitative, index, or locus type (${a} vs ${e}).`);
921
- }
922
- let d = n + "2", f = e.project ? void 0 : s(d);
923
- return {
924
- component: n,
925
- input: c,
926
- field: u,
927
- ...f && f !== u ? {
928
- secondaryInput: d,
929
- secondaryField: f,
930
- hitTest: r
931
- } : {}
932
- };
933
- });
934
- return {
935
- param: t,
936
- type: "interval",
937
- empty: e.empty,
938
- projections: u
939
- };
940
- };
941
- return c(e);
1269
+ //#endregion
1270
+ //#region ../../node_modules/vega-expression/node_modules/vega-util/build/hasOwnProperty.js
1271
+ function _n(e, t) {
1272
+ return Object.hasOwn(e, t);
942
1273
  }
943
- function Dt(e, t) {
944
- if ("all" in e || "any" in e) {
945
- let n = ("all" in e ? e.all : e.any).map((e) => Dt(e, t));
946
- return "all" in e ? (e) => n.every((t) => t(e)) : (e) => n.some((t) => t(e));
947
- }
948
- if ("not" in e) {
949
- let n = Dt(e.not, t);
950
- return (e) => !n(e);
951
- }
952
- if ("selectionActive" in e) {
953
- let { param: n } = e.selectionActive;
954
- return () => Ot(t(n));
955
- }
956
- let { param: n, type: r, empty: i } = e;
957
- if (r === "single") return (e) => {
958
- let r = t(n);
959
- return r.uniqueId == null ? i : r.uniqueId === e[x];
960
- };
961
- if (r === "multi") return (e) => {
962
- let r = t(n);
963
- return r.data.size === 0 ? i : r.data.has(e[x]);
964
- };
965
- let a = e.projections.map((e) => ({
966
- ...e,
967
- read: yt(e.field),
968
- readSecondary: e.secondaryField ? yt(e.secondaryField) : void 0
969
- }));
970
- return (e) => {
971
- let r = t(n);
972
- if (!Ot(r)) return i;
973
- for (let t of a) {
974
- let n = r.intervals[t.component], i = t.read(e), a = t.readSecondary?.(e), [o, s] = n;
975
- if (!(a === void 0 ? o <= i && i < s : t.hitTest === "endpoints" ? o <= i && i < s || o <= a && a < s : t.hitTest === "encloses" ? o <= Math.min(i, a) && Math.max(i, a) <= s : o < Math.max(i, a) && Math.min(i, a) < s)) return !1;
976
- }
977
- return !0;
978
- };
1274
+ //#endregion
1275
+ //#region ../../node_modules/vega-expression/node_modules/vega-util/build/isString.js
1276
+ function vn(e) {
1277
+ return typeof e == "string";
979
1278
  }
980
- function Ot(e) {
981
- if (e.type === "single") return e.uniqueId != null;
982
- if (e.type === "multi") return e.data.size !== 0;
983
- if (e.type === "interval") return Object.values(e.intervals).every((e) => !!e);
984
- throw Error(`Unsupported selection type: ${e.type}`);
1279
+ //#endregion
1280
+ //#region ../../node_modules/vega-expression/node_modules/vega-util/build/toSet.js
1281
+ function yn(e) {
1282
+ let t = {}, n = e.length;
1283
+ for (let r = 0; r < n; ++r) t[e[r] + ""] = !0;
1284
+ return t;
985
1285
  }
986
1286
  //#endregion
987
- //#region ../core/src/encoder/accessor.js
988
- function kt(e, t, n) {
989
- if (!e) throw Error("Cannot create an accessor without a channel.");
990
- function r(n) {
991
- let r = n;
992
- return r.fields ??= [], r.constant = r.fields.length === 0, r.channelDef = t, r.channel = e, r.sourceKey = Mt(t), r.scaleChannel = ((Kt(t) && t.resolutionChannel) ?? (_n(e) && e)) || void 0, r.scaleChannel !== void 0 && (r.domainKeyBase = Nt({
993
- scaleChannel: r.scaleChannel,
994
- source: jt(t)
995
- }).domainKeyBase), r.equals = (e) => e ? r === e || r.sourceKey !== void 0 && r.sourceKey === e.sourceKey : !1, r.asNumberAccessor = () => r, r;
996
- }
997
- function i(e) {
998
- if (W(e)) {
999
- let t = r(n.createExpression(e.expr));
1000
- if (t.fields.length > 0) throw Error("Expression in DatumDef/ValueDef cannot access data fields: " + e.expr);
1001
- return t;
1002
- }
1003
- {
1004
- let t = e;
1005
- return r(() => t);
1006
- }
1007
- }
1008
- if (S(t)) try {
1009
- return r(yt(t.field));
1010
- } catch (e) {
1011
- throw Error(`Invalid field definition: ${e.message}`, { cause: e });
1287
+ //#region ../../node_modules/vega-expression/build/vega-expression.js
1288
+ var bn = "RawCode", xn = "Literal", Sn = "Property", Cn = "Identifier", wn = "ArrayExpression", Tn = "BinaryExpression", En = "CallExpression", Dn = "ConditionalExpression", On = "LogicalExpression", kn = "MemberExpression", An = "ObjectExpression", jn = "UnaryExpression";
1289
+ function I(e) {
1290
+ this.type = e;
1291
+ }
1292
+ I.prototype.visit = function(e) {
1293
+ let t, n, r;
1294
+ if (e(this)) return 1;
1295
+ for (t = Mn(this), n = 0, r = t.length; n < r; ++n) if (t[n].visit(e)) return 1;
1296
+ };
1297
+ function Mn(e) {
1298
+ switch (e.type) {
1299
+ case wn: return e.elements;
1300
+ case Tn:
1301
+ case On: return [e.left, e.right];
1302
+ case En: return [e.callee].concat(e.arguments);
1303
+ case Dn: return [
1304
+ e.test,
1305
+ e.consequent,
1306
+ e.alternate
1307
+ ];
1308
+ case kn: return [e.object, e.property];
1309
+ case An: return e.properties;
1310
+ case Sn: return [e.key, e.value];
1311
+ case jn: return [e.argument];
1312
+ case Cn:
1313
+ case xn:
1314
+ case bn:
1315
+ default: return [];
1012
1316
  }
1013
- if (Zt(t)) return r(n.createExpression(t.expr));
1014
- if (C(t)) return i(t.datum);
1015
- if (Gt(t)) return i(t.value);
1016
- throw Error(`Invalid channel definition: "${e}": ${JSON.stringify(t)}! The channel definition must contain one of the following properties: "field", "datum", "value" or "expr".`);
1017
1317
  }
1018
- function At(e) {
1019
- return e.scaleChannel !== void 0;
1318
+ var L, R, z, B, V, Nn = 1, Pn = 2, H = 3, U = 4, Fn = 5, W = 6, G = 7, In = 8, Ln = 9;
1319
+ L = {}, L[Nn] = "Boolean", L[Pn] = "<end>", L[H] = "Identifier", L[U] = "Keyword", L[Fn] = "Null", L[W] = "Numeric", L[G] = "Punctuator", L[In] = "String", L[Ln] = "RegularExpression";
1320
+ var Rn = "ArrayExpression", zn = "BinaryExpression", Bn = "CallExpression", Vn = "ConditionalExpression", Hn = "Identifier", Un = "Literal", Wn = "LogicalExpression", Gn = "MemberExpression", Kn = "ObjectExpression", qn = "Property", Jn = "UnaryExpression", K = "Unexpected token %0", Yn = "Unexpected number", Xn = "Unexpected string", Zn = "Unexpected identifier", Qn = "Unexpected reserved word", $n = "Unexpected end of input", er = "Invalid regular expression", tr = "Invalid regular expression: missing /", nr = "Octal literals are not allowed in strict mode.", rr = "Duplicate data property in object literal not allowed in strict mode", q = "ILLEGAL", ir = "Disabled.", ar = /* @__PURE__ */ RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0-\\u08B2\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58\\u0C59\\u0C60\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D60\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19C1-\\u19C7\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6EF\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]"), or = /* @__PURE__ */ RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0300-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u0483-\\u0487\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0610-\\u061A\\u0620-\\u0669\\u066E-\\u06D3\\u06D5-\\u06DC\\u06DF-\\u06E8\\u06EA-\\u06FC\\u06FF\\u0710-\\u074A\\u074D-\\u07B1\\u07C0-\\u07F5\\u07FA\\u0800-\\u082D\\u0840-\\u085B\\u08A0-\\u08B2\\u08E4-\\u0963\\u0966-\\u096F\\u0971-\\u0983\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BC-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CE\\u09D7\\u09DC\\u09DD\\u09DF-\\u09E3\\u09E6-\\u09F1\\u0A01-\\u0A03\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A59-\\u0A5C\\u0A5E\\u0A66-\\u0A75\\u0A81-\\u0A83\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABC-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AD0\\u0AE0-\\u0AE3\\u0AE6-\\u0AEF\\u0B01-\\u0B03\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3C-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B5C\\u0B5D\\u0B5F-\\u0B63\\u0B66-\\u0B6F\\u0B71\\u0B82\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD0\\u0BD7\\u0BE6-\\u0BEF\\u0C00-\\u0C03\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C58\\u0C59\\u0C60-\\u0C63\\u0C66-\\u0C6F\\u0C81-\\u0C83\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBC-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CDE\\u0CE0-\\u0CE3\\u0CE6-\\u0CEF\\u0CF1\\u0CF2\\u0D01-\\u0D03\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4E\\u0D57\\u0D60-\\u0D63\\u0D66-\\u0D6F\\u0D7A-\\u0D7F\\u0D82\\u0D83\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DE6-\\u0DEF\\u0DF2\\u0DF3\\u0E01-\\u0E3A\\u0E40-\\u0E4E\\u0E50-\\u0E59\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB9\\u0EBB-\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EC8-\\u0ECD\\u0ED0-\\u0ED9\\u0EDC-\\u0EDF\\u0F00\\u0F18\\u0F19\\u0F20-\\u0F29\\u0F35\\u0F37\\u0F39\\u0F3E-\\u0F47\\u0F49-\\u0F6C\\u0F71-\\u0F84\\u0F86-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u1000-\\u1049\\u1050-\\u109D\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u135D-\\u135F\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1714\\u1720-\\u1734\\u1740-\\u1753\\u1760-\\u176C\\u176E-\\u1770\\u1772\\u1773\\u1780-\\u17D3\\u17D7\\u17DC\\u17DD\\u17E0-\\u17E9\\u180B-\\u180D\\u1810-\\u1819\\u1820-\\u1877\\u1880-\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1920-\\u192B\\u1930-\\u193B\\u1946-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u19D0-\\u19D9\\u1A00-\\u1A1B\\u1A20-\\u1A5E\\u1A60-\\u1A7C\\u1A7F-\\u1A89\\u1A90-\\u1A99\\u1AA7\\u1AB0-\\u1ABD\\u1B00-\\u1B4B\\u1B50-\\u1B59\\u1B6B-\\u1B73\\u1B80-\\u1BF3\\u1C00-\\u1C37\\u1C40-\\u1C49\\u1C4D-\\u1C7D\\u1CD0-\\u1CD2\\u1CD4-\\u1CF6\\u1CF8\\u1CF9\\u1D00-\\u1DF5\\u1DFC-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u200C\\u200D\\u203F\\u2040\\u2054\\u2071\\u207F\\u2090-\\u209C\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D7F-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2DE0-\\u2DFF\\u2E2F\\u3005-\\u3007\\u3021-\\u302F\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u3099\\u309A\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA62B\\uA640-\\uA66F\\uA674-\\uA67D\\uA67F-\\uA69D\\uA69F-\\uA6F1\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA827\\uA840-\\uA873\\uA880-\\uA8C4\\uA8D0-\\uA8D9\\uA8E0-\\uA8F7\\uA8FB\\uA900-\\uA92D\\uA930-\\uA953\\uA960-\\uA97C\\uA980-\\uA9C0\\uA9CF-\\uA9D9\\uA9E0-\\uA9FE\\uAA00-\\uAA36\\uAA40-\\uAA4D\\uAA50-\\uAA59\\uAA60-\\uAA76\\uAA7A-\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEF\\uAAF2-\\uAAF6\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABEA\\uABEC\\uABED\\uABF0-\\uABF9\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE00-\\uFE0F\\uFE20-\\uFE2D\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF10-\\uFF19\\uFF21-\\uFF3A\\uFF3F\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]");
1321
+ function sr(e, t) {
1322
+ /* istanbul ignore next */
1323
+ if (!e) throw Error("ASSERT: " + t);
1020
1324
  }
1021
- function jt(e) {
1022
- if (S(e)) return {
1023
- kind: "field",
1024
- value: e.field
1025
- };
1026
- if (Zt(e)) return {
1027
- kind: "expr",
1028
- value: e.expr
1029
- };
1030
- if (C(e)) return {
1031
- kind: "datum",
1032
- value: e.datum
1033
- };
1034
- if (Gt(e)) return {
1035
- kind: "value",
1036
- value: e.value
1037
- };
1038
- throw Error("Cannot derive a domain key from channel definition: " + JSON.stringify(e));
1325
+ function J(e) {
1326
+ return e >= 48 && e <= 57;
1039
1327
  }
1040
- function Mt(e) {
1041
- let t = jt(e);
1042
- return t.kind === "datum" || t.kind === "value" ? "constant|" + It(t.value) : t.kind + "|" + Ft(t);
1328
+ function cr(e) {
1329
+ return "0123456789abcdefABCDEF".includes(e);
1043
1330
  }
1044
- function Nt({ scaleChannel: e, source: t, type: n }) {
1045
- if (!e) throw Error("Cannot build a domain key without a scale channel.");
1046
- let r = e + "|" + t.kind + "|" + Ft(t);
1047
- return {
1048
- domainKeyBase: r,
1049
- domainKey: n ? n + "|" + r : void 0
1050
- };
1331
+ function lr(e) {
1332
+ return "01234567".includes(e);
1051
1333
  }
1052
- function Pt(e, t) {
1053
- let { domainKey: n, domainKeyBase: r } = Nt({
1054
- scaleChannel: e.scaleChannel,
1055
- source: jt(e.channelDef),
1056
- type: t
1057
- });
1058
- if (!n) throw Error("Cannot finalize a domain key without a resolved type.");
1059
- return e.domainKeyBase = r, e.domainKey = n, n;
1334
+ function ur(e) {
1335
+ return e === 32 || e === 9 || e === 11 || e === 12 || e === 160 || e >= 5760 && [
1336
+ 5760,
1337
+ 6158,
1338
+ 8192,
1339
+ 8193,
1340
+ 8194,
1341
+ 8195,
1342
+ 8196,
1343
+ 8197,
1344
+ 8198,
1345
+ 8199,
1346
+ 8200,
1347
+ 8201,
1348
+ 8202,
1349
+ 8239,
1350
+ 8287,
1351
+ 12288,
1352
+ 65279
1353
+ ].includes(e);
1060
1354
  }
1061
- function Ft(e) {
1062
- switch (e.kind) {
1063
- case "field":
1064
- case "expr": return e.value;
1065
- case "datum":
1066
- case "value": return It(e.value);
1067
- default: throw Error("Unknown domain key source.");
1355
+ function dr(e) {
1356
+ return e === 10 || e === 13 || e === 8232 || e === 8233;
1357
+ }
1358
+ function fr(e) {
1359
+ return e === 36 || e === 95 || e >= 65 && e <= 90 || e >= 97 && e <= 122 || e === 92 || e >= 128 && ar.test(String.fromCharCode(e));
1360
+ }
1361
+ function pr(e) {
1362
+ return e === 36 || e === 95 || e >= 65 && e <= 90 || e >= 97 && e <= 122 || e >= 48 && e <= 57 || e === 92 || e >= 128 && or.test(String.fromCharCode(e));
1363
+ }
1364
+ var mr = {
1365
+ if: 1,
1366
+ in: 1,
1367
+ do: 1,
1368
+ var: 1,
1369
+ for: 1,
1370
+ new: 1,
1371
+ try: 1,
1372
+ let: 1,
1373
+ this: 1,
1374
+ else: 1,
1375
+ case: 1,
1376
+ void: 1,
1377
+ with: 1,
1378
+ enum: 1,
1379
+ while: 1,
1380
+ break: 1,
1381
+ catch: 1,
1382
+ throw: 1,
1383
+ const: 1,
1384
+ yield: 1,
1385
+ class: 1,
1386
+ super: 1,
1387
+ return: 1,
1388
+ typeof: 1,
1389
+ delete: 1,
1390
+ switch: 1,
1391
+ export: 1,
1392
+ import: 1,
1393
+ public: 1,
1394
+ static: 1,
1395
+ default: 1,
1396
+ finally: 1,
1397
+ extends: 1,
1398
+ package: 1,
1399
+ private: 1,
1400
+ function: 1,
1401
+ continue: 1,
1402
+ debugger: 1,
1403
+ interface: 1,
1404
+ protected: 1,
1405
+ instanceof: 1,
1406
+ implements: 1
1407
+ };
1408
+ function hr() {
1409
+ for (; z < B;) {
1410
+ let e = R.charCodeAt(z);
1411
+ if (ur(e) || dr(e)) ++z;
1412
+ else break;
1068
1413
  }
1069
1414
  }
1070
- function It(e) {
1071
- return W(e) ? "expr:" + e.expr : e === void 0 ? "undefined" : JSON.stringify(e);
1415
+ function gr(e) {
1416
+ var t, n, r, i = 0;
1417
+ for (n = e === "u" ? 4 : 2, t = 0; t < n; ++t) z < B && cr(R[z]) ? (r = R[z++], i = i * 16 + "0123456789abcdef".indexOf(r.toLowerCase())) : X({}, K, q);
1418
+ return String.fromCharCode(i);
1072
1419
  }
1073
- //#endregion
1074
- //#region ../core/src/encoder/encoder.js
1075
- function Lt(e, t, n, r = "intersects", i) {
1076
- let a, o, s = Ct(e), c = () => (a ??= Et(e, t, n, r, i), a);
1077
- return s.every((e) => n.findValue(e)) && c(), Object.defineProperty((e) => !s.some((e) => !n.findValue(e)) && (o ??= Dt(c(), (e) => n.findValue(e)), o(e)), "selection", { get: c });
1420
+ function _r() {
1421
+ var e = R[z], t = 0, n, r;
1422
+ for (e === "}" && X({}, K, q); z < B && (e = R[z++], cr(e));) t = t * 16 + "0123456789abcdef".indexOf(e.toLowerCase());
1423
+ return (t > 1114111 || e !== "}") && X({}, K, q), t <= 65535 ? String.fromCharCode(t) : (n = (t - 65536 >> 10) + 55296, r = (t - 65536 & 1023) + 56320, String.fromCharCode(n, r));
1078
1424
  }
1079
- function Rt(e, t, n, r, i = "intersects", a) {
1080
- let o = Qt(t) || $t(t) ? Array.isArray(t.condition) ? t.condition : [t.condition] : [], s = [...o, t], c = s.map((t, c) => {
1081
- let l = o[c], u = kt(e, t, r), d = l ? Xi(l) : void 0;
1082
- return {
1083
- accessor: u,
1084
- predicate: d ? Lt(d, n, r, i, a) : va(c === s.length - 1)
1085
- };
1086
- });
1087
- if (c.filter((e) => !e.accessor.constant).length > 1) throw Error("Only one accessor can be non-constant. Channel: " + e);
1088
- return c;
1425
+ function vr() {
1426
+ var e = R.charCodeAt(z++), t = String.fromCharCode(e);
1427
+ for (e === 92 && (R.charCodeAt(z) !== 117 && X({}, K, q), ++z, e = gr("u"), (!e || e === "\\" || !fr(e.charCodeAt(0))) && X({}, K, q), t = e); z < B && (e = R.charCodeAt(z), pr(e));) ++z, t += String.fromCharCode(e), e === 92 && (t = t.substr(0, t.length - 1), R.charCodeAt(z) !== 117 && X({}, K, q), ++z, e = gr("u"), (!e || e === "\\" || !pr(e.charCodeAt(0))) && X({}, K, q), t += e);
1428
+ return t;
1089
1429
  }
1090
- function zt(e, t) {
1091
- let n = {}, r = (t) => e.getScaleResolution(t)?.getScale(), i = (t, n) => {
1092
- let r = e.getScaleResolution(t);
1093
- e.paramRuntime.operation("encoder scale", [r.getMappingRef()], () => r.getScale(), n);
1094
- };
1095
- for (let [a, o] of Object.entries(t)) {
1096
- if (!o) continue;
1097
- let s = a;
1098
- Bt(s) || (n[s] = Ut(Rt(s, o, t, e.paramRuntime, e.mark.defaultHitTestMode, (t) => e.getScaleResolution(t)?.type), r, i));
1430
+ function yr() {
1431
+ for (var e = z++, t; z < B;) {
1432
+ if (t = R.charCodeAt(z), t === 92) return z = e, vr();
1433
+ if (pr(t)) ++z;
1434
+ else break;
1099
1435
  }
1100
- return n;
1436
+ return R.slice(e, z);
1101
1437
  }
1102
- function Bt(e) {
1103
- return e === "key" || e === "search" || e === "tooltip" || e === "order";
1438
+ function br() {
1439
+ var e = z, t = R.charCodeAt(z) === 92 ? vr() : yr();
1440
+ return {
1441
+ type: t.length === 1 ? H : mr.hasOwnProperty(t) ? U : t === "null" ? Fn : t === "true" || t === "false" ? Nn : H,
1442
+ value: t,
1443
+ start: e,
1444
+ end: z
1445
+ };
1104
1446
  }
1105
- function Vt(e) {
1106
- return e.branches.map((e) => e.accessor);
1447
+ function xr() {
1448
+ var e = z, t = R.charCodeAt(z), n, r = R[z], i, a, o;
1449
+ switch (t) {
1450
+ case 46:
1451
+ case 40:
1452
+ case 41:
1453
+ case 59:
1454
+ case 44:
1455
+ case 123:
1456
+ case 125:
1457
+ case 91:
1458
+ case 93:
1459
+ case 58:
1460
+ case 63:
1461
+ case 126: return ++z, {
1462
+ type: G,
1463
+ value: String.fromCharCode(t),
1464
+ start: e,
1465
+ end: z
1466
+ };
1467
+ default: if (n = R.charCodeAt(z + 1), n === 61) switch (t) {
1468
+ case 43:
1469
+ case 45:
1470
+ case 47:
1471
+ case 60:
1472
+ case 62:
1473
+ case 94:
1474
+ case 124:
1475
+ case 37:
1476
+ case 38:
1477
+ case 42: return z += 2, {
1478
+ type: G,
1479
+ value: String.fromCharCode(t) + String.fromCharCode(n),
1480
+ start: e,
1481
+ end: z
1482
+ };
1483
+ case 33:
1484
+ case 61: return z += 2, R.charCodeAt(z) === 61 && ++z, {
1485
+ type: G,
1486
+ value: R.slice(e, z),
1487
+ start: e,
1488
+ end: z
1489
+ };
1490
+ }
1491
+ }
1492
+ if (o = R.substr(z, 4), o === ">>>=") return z += 4, {
1493
+ type: G,
1494
+ value: o,
1495
+ start: e,
1496
+ end: z
1497
+ };
1498
+ if (a = o.substr(0, 3), a === ">>>" || a === "<<=" || a === ">>=") return z += 3, {
1499
+ type: G,
1500
+ value: a,
1501
+ start: e,
1502
+ end: z
1503
+ };
1504
+ if (i = a.substr(0, 2), r === i[1] && "+-<>&|".includes(r) || i === "=>") return z += 2, {
1505
+ type: G,
1506
+ value: i,
1507
+ start: e,
1508
+ end: z
1509
+ };
1510
+ if (i === "//" && X({}, K, q), "<>=!+-*%&|^/".includes(r)) return ++z, {
1511
+ type: G,
1512
+ value: r,
1513
+ start: e,
1514
+ end: z
1515
+ };
1516
+ X({}, K, q);
1107
1517
  }
1108
- function Ht(e) {
1109
- return e.branches.find((e) => !e.accessor.constant)?.accessor;
1518
+ function Sr(e) {
1519
+ let t = "";
1520
+ for (; z < B && cr(R[z]);) t += R[z++];
1521
+ return t.length === 0 && X({}, K, q), fr(R.charCodeAt(z)) && X({}, K, q), {
1522
+ type: W,
1523
+ value: parseInt("0x" + t, 16),
1524
+ start: e,
1525
+ end: z
1526
+ };
1110
1527
  }
1111
- function Ut(e, t, n) {
1112
- if (e.length === 1) {
1113
- let r = Wt(e[0].accessor, t, n);
1114
- return Object.assign(r, { branches: e });
1528
+ function Cr(e) {
1529
+ let t = "0" + R[z++];
1530
+ for (; z < B && lr(R[z]);) t += R[z++];
1531
+ return (fr(R.charCodeAt(z)) || J(R.charCodeAt(z))) && X({}, K, q), {
1532
+ type: W,
1533
+ value: parseInt(t, 8),
1534
+ octal: !0,
1535
+ start: e,
1536
+ end: z
1537
+ };
1538
+ }
1539
+ function wr() {
1540
+ var e, t, n = R[z];
1541
+ if (sr(J(n.charCodeAt(0)) || n === ".", "Numeric literal must start with a decimal digit or a decimal point"), t = z, e = "", n !== ".") {
1542
+ if (e = R[z++], n = R[z], e === "0") {
1543
+ if (n === "x" || n === "X") return ++z, Sr(t);
1544
+ if (lr(n)) return Cr(t);
1545
+ n && J(n.charCodeAt(0)) && X({}, K, q);
1546
+ }
1547
+ for (; J(R.charCodeAt(z));) e += R[z++];
1548
+ n = R[z];
1115
1549
  }
1116
- let r = e.map((e) => e.predicate), i = e.map((e) => Wt(e.accessor, t, n)), a = Object.assign((e) => {
1117
- for (let t = 0; t < i.length; t++) if (r[t](e)) return i[t](e);
1118
- }, {
1119
- constant: !1,
1120
- branches: e,
1121
- channelDef: e.at(-1).accessor.channelDef
1122
- });
1123
- return Object.defineProperty(a, "scale", {
1124
- enumerable: !0,
1125
- get: () => i.find((e) => e.scale)?.scale
1126
- });
1550
+ if (n === ".") {
1551
+ for (e += R[z++]; J(R.charCodeAt(z));) e += R[z++];
1552
+ n = R[z];
1553
+ }
1554
+ if (n === "e" || n === "E") {
1555
+ if (e += R[z++], n = R[z], (n === "+" || n === "-") && (e += R[z++]), J(R.charCodeAt(z))) for (; J(R.charCodeAt(z));) e += R[z++];
1556
+ else X({}, K, q);
1557
+ }
1558
+ return fr(R.charCodeAt(z)) && X({}, K, q), {
1559
+ type: W,
1560
+ value: parseFloat(e),
1561
+ start: t,
1562
+ end: z
1563
+ };
1127
1564
  }
1128
- function Wt(e, t, n) {
1129
- let { channel: r, scaleChannel: i, channelDef: a } = e, o = e.scaleChannel ? t(i) : void 0;
1130
- if (i && !o) throw Error(`Missing scale! "${r}": ${JSON.stringify(a)}`);
1131
- let s = Object.assign(o ? (t) => o(e(t)) : (t) => e(t), {
1132
- scale: o,
1133
- constant: e.constant,
1134
- branches: [{
1135
- accessor: e,
1136
- predicate: va(!0)
1137
- }],
1138
- channelDef: a
1139
- });
1140
- return o && n?.(i, (e) => {
1141
- o = e, s.scale = e;
1142
- }), s;
1565
+ function Tr() {
1566
+ var e = "", t, n, r, i, a = !1;
1567
+ for (t = R[z], sr(t === "'" || t === "\"", "String literal must starts with a quote"), n = z, ++z; z < B;) {
1568
+ if (r = R[z++], r === t) {
1569
+ t = "";
1570
+ break;
1571
+ }
1572
+ if (r === "\\") {
1573
+ if (r = R[z++], !r || !dr(r.charCodeAt(0))) switch (r) {
1574
+ case "u":
1575
+ case "x":
1576
+ R[z] === "{" ? (++z, e += _r()) : e += gr(r);
1577
+ break;
1578
+ case "n":
1579
+ e += "\n";
1580
+ break;
1581
+ case "r":
1582
+ e += "\r";
1583
+ break;
1584
+ case "t":
1585
+ e += " ";
1586
+ break;
1587
+ case "b":
1588
+ e += "\b";
1589
+ break;
1590
+ case "f":
1591
+ e += "\f";
1592
+ break;
1593
+ case "v":
1594
+ e += "\v";
1595
+ break;
1596
+ default: lr(r) ? (i = "01234567".indexOf(r), i !== 0 && (a = !0), z < B && lr(R[z]) && (a = !0, i = i * 8 + "01234567".indexOf(R[z++]), "0123".includes(r) && z < B && lr(R[z]) && (i = i * 8 + "01234567".indexOf(R[z++]))), e += String.fromCharCode(i)) : e += r;
1597
+ }
1598
+ else r === "\r" && R[z] === "\n" && ++z;
1599
+ } else if (dr(r.charCodeAt(0))) break;
1600
+ else e += r;
1601
+ }
1602
+ return t !== "" && X({}, K, q), {
1603
+ type: In,
1604
+ value: e,
1605
+ octal: a,
1606
+ start: n,
1607
+ end: z
1608
+ };
1143
1609
  }
1144
- function Gt(e) {
1145
- return e && "value" in e;
1610
+ function Er(e, t) {
1611
+ let n = e;
1612
+ t.includes("u") && (n = n.replace(/\\u\{([0-9a-fA-F]+)\}/g, (e, t) => {
1613
+ if (parseInt(t, 16) <= 1114111) return "x";
1614
+ X({}, er);
1615
+ }).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g, "x"));
1616
+ try {
1617
+ new RegExp(n);
1618
+ } catch {
1619
+ X({}, er);
1620
+ }
1621
+ try {
1622
+ return new RegExp(e, t);
1623
+ } catch {
1624
+ return null;
1625
+ }
1146
1626
  }
1147
- function S(e) {
1148
- return e && "field" in e;
1627
+ function Dr() {
1628
+ var e = R[z], t, n, r, i;
1629
+ for (sr(e === "/", "Regular expression literal must start with a slash"), t = R[z++], n = !1, r = !1; z < B;) if (e = R[z++], t += e, e === "\\") e = R[z++], dr(e.charCodeAt(0)) && X({}, tr), t += e;
1630
+ else if (dr(e.charCodeAt(0))) X({}, tr);
1631
+ else if (n) e === "]" && (n = !1);
1632
+ else if (e === "/") {
1633
+ r = !0;
1634
+ break;
1635
+ } else e === "[" && (n = !0);
1636
+ return r || X({}, tr), i = t.substr(1, t.length - 2), {
1637
+ value: i,
1638
+ literal: t
1639
+ };
1149
1640
  }
1150
- function C(e) {
1151
- return e && "datum" in e;
1641
+ function Or() {
1642
+ for (var e, t = "", n = ""; z < B && (e = R[z], pr(e.charCodeAt(0)));) ++z, e === "\\" && z < B ? X({}, K, q) : (n += e, t += e);
1643
+ return n.search(/[^gimuy]/g) >= 0 && X({}, er, n), {
1644
+ value: n,
1645
+ literal: t
1646
+ };
1152
1647
  }
1153
- function Kt(e) {
1154
- return S(e) || C(e) || Zt(e) || Xt(e);
1648
+ function kr() {
1649
+ var e, t, n, r;
1650
+ return V = null, hr(), e = z, t = Dr(), n = Or(), r = Er(t.value, n.value), {
1651
+ literal: t.literal + n.literal,
1652
+ value: r,
1653
+ regex: {
1654
+ pattern: t.value,
1655
+ flags: n.value
1656
+ },
1657
+ start: e,
1658
+ end: z
1659
+ };
1155
1660
  }
1156
- function qt(e) {
1157
- if ($t(e)) {
1158
- let t = e.condition;
1159
- return (Array.isArray(t) ? t : [t]).find((e) => Kt(e));
1160
- }
1161
- if (Kt(e)) return e;
1661
+ function Ar(e) {
1662
+ return e.type === H || e.type === U || e.type === Nn || e.type === Fn;
1162
1663
  }
1163
- function Jt(e) {
1164
- let t = e && qt(e);
1165
- return t != null && t.type != "quantitative" && t.scale !== null;
1664
+ function jr() {
1665
+ if (hr(), z >= B) return {
1666
+ type: Pn,
1667
+ start: z,
1668
+ end: z
1669
+ };
1670
+ let e = R.charCodeAt(z);
1671
+ return fr(e) ? br() : e === 40 || e === 41 || e === 59 ? xr() : e === 39 || e === 34 ? Tr() : e === 46 ? J(R.charCodeAt(z + 1)) ? wr() : xr() : J(e) ? wr() : xr();
1166
1672
  }
1167
- function Yt(e, t) {
1168
- let n = e.mark.encoding[t];
1169
- if (Array.isArray(n)) throw Error("Not a channel def with scale!");
1170
- {
1171
- let e = qt(n);
1172
- if (e) return e;
1173
- }
1174
- throw Error("Not a channel def with scale!");
1673
+ function Y() {
1674
+ let e = V;
1675
+ return z = e.end, V = jr(), z = e.end, e;
1175
1676
  }
1176
- function Xt(e) {
1177
- return e && "chrom" in e;
1677
+ function Mr() {
1678
+ let e = z;
1679
+ V = jr(), z = e;
1178
1680
  }
1179
- function Zt(e) {
1180
- return e && "expr" in e;
1681
+ function Nr(e) {
1682
+ let t = new I(Rn);
1683
+ return t.elements = e, t;
1181
1684
  }
1182
- function Qt(e) {
1183
- return (S(e) || C(e)) && "condition" in e;
1685
+ function Pr(e, t, n) {
1686
+ let r = new I(e === "||" || e === "&&" ? Wn : zn);
1687
+ return r.operator = e, r.left = t, r.right = n, r;
1184
1688
  }
1185
- function $t(e) {
1186
- return Gt(e) && "condition" in e;
1689
+ function Fr(e, t) {
1690
+ let n = new I(Bn);
1691
+ return n.callee = e, n.arguments = t, n;
1187
1692
  }
1188
- var en = ["x", "y"], tn = ["x2", "y2"], nn = ["xOffset", "yOffset"], rn = [...en, ...tn];
1189
- function an(e) {
1190
- return en.includes(e);
1693
+ function Ir(e, t, n) {
1694
+ let r = new I(Vn);
1695
+ return r.test = e, r.consequent = t, r.alternate = n, r;
1191
1696
  }
1192
- function on(e) {
1193
- return rn.includes(e);
1697
+ function Lr(e) {
1698
+ let t = new I(Hn);
1699
+ return t.name = e, t;
1194
1700
  }
1195
- function sn(e) {
1196
- return nn.includes(e);
1701
+ function Rr(e) {
1702
+ let t = new I(Un);
1703
+ return t.value = e.value, t.raw = R.slice(e.start, e.end), e.regex && (t.raw === "//" && (t.raw = "/(?:)/"), t.regex = e.regex), t;
1197
1704
  }
1198
- function cn(e) {
1199
- return mn(e) == "x" ? "xOffset" : "yOffset";
1705
+ function zr(e, t, n) {
1706
+ let r = new I(Gn);
1707
+ return r.computed = e === "[", r.object = t, r.property = n, r.computed || (n.member = !0), r;
1200
1708
  }
1201
- function ln(e, t, n) {
1202
- return t ?? (n ? 0 : e);
1709
+ function Br(e) {
1710
+ let t = new I(Kn);
1711
+ return t.properties = e, t;
1203
1712
  }
1204
- var un = {
1205
- x: "x2",
1206
- y: "y2"
1207
- }, dn = Object.fromEntries(Object.entries(un).map((e) => [e[1], e[0]]));
1208
- function fn(e) {
1209
- return e in dn;
1713
+ function Vr(e, t, n) {
1714
+ let r = new I(qn);
1715
+ return r.key = t, r.value = n, r.kind = e, r;
1210
1716
  }
1211
- function pn(e) {
1212
- let t = un[e];
1213
- if (t) return t;
1214
- throw Error(`${e} has no secondary channel!`);
1717
+ function Hr(e, t) {
1718
+ let n = new I(Jn);
1719
+ return n.operator = e, n.argument = t, n.prefix = !0, n;
1215
1720
  }
1216
- function mn(e) {
1217
- return dn[e] ?? e;
1721
+ function X(e, t) {
1722
+ var n, r = Array.prototype.slice.call(arguments, 2), i = t.replace(/%(\d)/g, (e, t) => (sr(t < r.length, "Message reference must be in range"), r[t]));
1723
+ throw n = Error(i), n.index = z, n.description = i, n;
1218
1724
  }
1219
- function hn(e) {
1220
- return [
1221
- "color",
1222
- "fill",
1223
- "stroke"
1224
- ].includes(mn(e));
1725
+ function Ur(e) {
1726
+ e.type === Pn && X(e, $n), e.type === W && X(e, Yn), e.type === In && X(e, Xn), e.type === H && X(e, Zn), e.type === U && X(e, Qn), X(e, K, e.value);
1225
1727
  }
1226
- function gn(e) {
1227
- return ["shape", "direction"].includes(e);
1728
+ function Z(e) {
1729
+ let t = Y();
1730
+ (t.type !== G || t.value !== e) && Ur(t);
1228
1731
  }
1229
- function _n(e) {
1230
- return [
1231
- "x",
1232
- "y",
1233
- "x2",
1234
- "y2",
1235
- "xOffset",
1236
- "yOffset",
1237
- "color",
1238
- "fill",
1239
- "stroke",
1240
- "opacity",
1241
- "fillOpacity",
1242
- "strokeOpacity",
1243
- "strokeWidth",
1244
- "size",
1245
- "shape",
1246
- "direction",
1247
- "angle",
1248
- "dx",
1249
- "dy",
1250
- "sample"
1251
- ].includes(e);
1732
+ function Q(e) {
1733
+ return V.type === G && V.value === e;
1252
1734
  }
1253
- function vn(e) {
1254
- switch (e) {
1255
- case "shape": return [
1256
- "circle",
1257
- "square",
1258
- "cross",
1259
- "diamond",
1260
- "triangle-up",
1261
- "triangle-right",
1262
- "triangle-down",
1263
- "triangle-left",
1264
- "tick-up",
1265
- "tick-right",
1266
- "tick-down",
1267
- "tick-left",
1268
- "x",
1269
- "+"
1270
- ];
1271
- case "direction": return [
1272
- "forward",
1273
- "reverse",
1274
- "both"
1275
- ];
1276
- }
1277
- }
1278
- function yn(e) {
1279
- if (!gn(e)) throw Error("Not a discrete channel: " + e);
1280
- let t = new Map(vn(e).map((e, t) => [e, t]));
1281
- return (n) => {
1282
- let r = t.get(n);
1283
- if (r !== void 0) return r;
1284
- throw Error(`Invalid value for "${e}" channel: ${n}`);
1285
- };
1286
- }
1287
- //#endregion
1288
- //#region ../../node_modules/vega-expression/node_modules/vega-util/build/accessor.js
1289
- function w(e, t, n) {
1290
- return Object.assign(e, {
1291
- fields: t || [],
1292
- fname: n
1293
- });
1294
- }
1295
- //#endregion
1296
- //#region ../../node_modules/vega-expression/node_modules/vega-util/build/getter.js
1297
- function bn(e) {
1298
- return e.length === 1 ? xn(e[0]) : Sn(e);
1299
- }
1300
- var xn = (e) => function(t) {
1301
- return t[e];
1302
- }, Sn = (e) => {
1303
- let t = e.length;
1304
- return function(n) {
1305
- for (let r = 0; r < t; ++r) n = n[e[r]];
1306
- return n;
1307
- };
1308
- };
1309
- //#endregion
1310
- //#region ../../node_modules/vega-expression/node_modules/vega-util/build/error.js
1311
- function T(e) {
1312
- throw Error(e);
1313
- }
1314
- //#endregion
1315
- //#region ../../node_modules/vega-expression/node_modules/vega-util/build/splitAccessPath.js
1316
- function Cn(e) {
1317
- let t = [], n = e.length, r = null, i = 0, a = "", o, s, c;
1318
- e += "";
1319
- function l() {
1320
- t.push(a + e.substring(o, s)), a = "", o = s + 1;
1321
- }
1322
- for (o = s = 0; s < n; ++s) if (c = e[s], c === "\\") a += e.substring(o, s++), o = s;
1323
- else if (c === r) l(), r = null, i = -1;
1324
- else if (r) continue;
1325
- else o === i && c === "\"" || o === i && c === "'" ? (o = s + 1, r = c) : c === "." && !i ? s > o ? l() : o = s + 1 : c === "[" ? (s > o && l(), i = o = s + 1) : c === "]" && (i || T("Access path missing open bracket: " + e), i > 0 && l(), i = 0, o = s + 1);
1326
- return i && T("Access path missing closing bracket: " + e), r && T("Access path missing closing quote: " + e), s > o && (s++, l()), t;
1735
+ function Wr(e) {
1736
+ return V.type === U && V.value === e;
1327
1737
  }
1328
- //#endregion
1329
- //#region ../../node_modules/vega-expression/node_modules/vega-util/build/field.js
1330
- function wn(e, t, n) {
1331
- let r = Cn(e), i = r.length === 1 ? r[0] : e;
1332
- return w((n && n.get || bn)(r), [i], t || i);
1333
- }
1334
- wn("id"), w((e) => e, [], "identity"), w(() => 0, [], "zero"), w(() => 1, [], "one"), w(() => !0, [], "true"), w(() => !1, [], "false");
1335
- //#endregion
1336
- //#region ../../node_modules/vega-expression/node_modules/vega-util/build/interpreter.js
1337
- var Tn = /* @__PURE__ */ new Set([
1338
- ...Object.getOwnPropertyNames(Object.prototype).filter((e) => typeof Object.prototype[e] == "function"),
1339
- "__proto__",
1340
- "then"
1341
- ]);
1342
- Array.isArray;
1343
- //#endregion
1344
- //#region ../../node_modules/vega-expression/node_modules/vega-util/build/isFunction.js
1345
- function En(e) {
1346
- return typeof e == "function";
1738
+ function Gr() {
1739
+ let e = [];
1740
+ for (z = V.start, Z("["); !Q("]");) Q(",") ? (Y(), e.push(null)) : (e.push($()), Q("]") || Z(","));
1741
+ return Y(), Nr(e);
1347
1742
  }
1348
- //#endregion
1349
- //#region ../../node_modules/vega-expression/node_modules/vega-util/build/hasOwnProperty.js
1350
- function Dn(e, t) {
1351
- return Object.hasOwn(e, t);
1743
+ function Kr() {
1744
+ z = V.start;
1745
+ let e = Y();
1746
+ return e.type === In || e.type === W ? (e.octal && X(e, nr), Rr(e)) : Lr(e.value);
1352
1747
  }
1353
- //#endregion
1354
- //#region ../../node_modules/vega-expression/node_modules/vega-util/build/isString.js
1355
- function On(e) {
1356
- return typeof e == "string";
1748
+ function qr() {
1749
+ var e, t, n, r;
1750
+ if (z = V.start, e = V, e.type === H) return n = Kr(), Z(":"), r = $(), Vr("init", n, r);
1751
+ if (e.type === Pn || e.type === G) Ur(e);
1752
+ else return t = Kr(), Z(":"), r = $(), Vr("init", t, r);
1357
1753
  }
1358
- //#endregion
1359
- //#region ../../node_modules/vega-expression/node_modules/vega-util/build/toSet.js
1360
- function kn(e) {
1361
- let t = {}, n = e.length;
1362
- for (let r = 0; r < n; ++r) t[e[r] + ""] = !0;
1363
- return t;
1754
+ function Jr() {
1755
+ var e = [], t, n, r, i = {}, a = String;
1756
+ for (z = V.start, Z("{"); !Q("}");) t = qr(), n = t.key.type === Hn ? t.key.name : a(t.key.value), r = "$" + n, Object.prototype.hasOwnProperty.call(i, r) ? X({}, rr) : i[r] = !0, e.push(t), Q("}") || Z(",");
1757
+ return Z("}"), Br(e);
1364
1758
  }
1365
- //#endregion
1366
- //#region ../../node_modules/vega-expression/build/vega-expression.js
1367
- var An = "RawCode", jn = "Literal", Mn = "Property", Nn = "Identifier", Pn = "ArrayExpression", Fn = "BinaryExpression", In = "CallExpression", Ln = "ConditionalExpression", Rn = "LogicalExpression", zn = "MemberExpression", Bn = "ObjectExpression", Vn = "UnaryExpression";
1368
- function E(e) {
1369
- this.type = e;
1759
+ function Yr() {
1760
+ Z("(");
1761
+ let e = si();
1762
+ return Z(")"), e;
1370
1763
  }
1371
- E.prototype.visit = function(e) {
1372
- let t, n, r;
1373
- if (e(this)) return 1;
1374
- for (t = Hn(this), n = 0, r = t.length; n < r; ++n) if (t[n].visit(e)) return 1;
1375
- };
1376
- function Hn(e) {
1377
- switch (e.type) {
1378
- case Pn: return e.elements;
1379
- case Fn:
1380
- case Rn: return [e.left, e.right];
1381
- case In: return [e.callee].concat(e.arguments);
1382
- case Ln: return [
1383
- e.test,
1384
- e.consequent,
1385
- e.alternate
1386
- ];
1387
- case zn: return [e.object, e.property];
1388
- case Bn: return e.properties;
1389
- case Mn: return [e.key, e.value];
1390
- case Vn: return [e.argument];
1391
- case Nn:
1392
- case jn:
1393
- case An:
1394
- default: return [];
1395
- }
1764
+ var Xr = { if: 1 };
1765
+ function Zr() {
1766
+ var e, t, n;
1767
+ if (Q("(")) return Yr();
1768
+ if (Q("[")) return Gr();
1769
+ if (Q("{")) return Jr();
1770
+ if (e = V.type, z = V.start, e === H || Xr[V.value]) n = Lr(Y().value);
1771
+ else if (e === In || e === W) V.octal && X(V, nr), n = Rr(Y());
1772
+ else if (e === U) throw Error(ir);
1773
+ else e === Nn ? (t = Y(), t.value = t.value === "true", n = Rr(t)) : e === Fn ? (t = Y(), t.value = null, n = Rr(t)) : Q("/") || Q("/=") ? (n = Rr(kr()), Mr()) : Ur(Y());
1774
+ return n;
1396
1775
  }
1397
- var D, O, k, A, j, Un = 1, Wn = 2, M = 3, N = 4, Gn = 5, P = 6, F = 7, Kn = 8, qn = 9;
1398
- D = {}, D[Un] = "Boolean", D[Wn] = "<end>", D[M] = "Identifier", D[N] = "Keyword", D[Gn] = "Null", D[P] = "Numeric", D[F] = "Punctuator", D[Kn] = "String", D[qn] = "RegularExpression";
1399
- var Jn = "ArrayExpression", Yn = "BinaryExpression", Xn = "CallExpression", Zn = "ConditionalExpression", Qn = "Identifier", $n = "Literal", er = "LogicalExpression", tr = "MemberExpression", nr = "ObjectExpression", rr = "Property", ir = "UnaryExpression", I = "Unexpected token %0", ar = "Unexpected number", or = "Unexpected string", sr = "Unexpected identifier", cr = "Unexpected reserved word", lr = "Unexpected end of input", ur = "Invalid regular expression", dr = "Invalid regular expression: missing /", fr = "Octal literals are not allowed in strict mode.", pr = "Duplicate data property in object literal not allowed in strict mode", L = "ILLEGAL", mr = "Disabled.", hr = /* @__PURE__ */ RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0-\\u08B2\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58\\u0C59\\u0C60\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D60\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19C1-\\u19C7\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6EF\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]"), gr = /* @__PURE__ */ RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0300-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u0483-\\u0487\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0610-\\u061A\\u0620-\\u0669\\u066E-\\u06D3\\u06D5-\\u06DC\\u06DF-\\u06E8\\u06EA-\\u06FC\\u06FF\\u0710-\\u074A\\u074D-\\u07B1\\u07C0-\\u07F5\\u07FA\\u0800-\\u082D\\u0840-\\u085B\\u08A0-\\u08B2\\u08E4-\\u0963\\u0966-\\u096F\\u0971-\\u0983\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BC-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CE\\u09D7\\u09DC\\u09DD\\u09DF-\\u09E3\\u09E6-\\u09F1\\u0A01-\\u0A03\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A59-\\u0A5C\\u0A5E\\u0A66-\\u0A75\\u0A81-\\u0A83\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABC-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AD0\\u0AE0-\\u0AE3\\u0AE6-\\u0AEF\\u0B01-\\u0B03\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3C-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B5C\\u0B5D\\u0B5F-\\u0B63\\u0B66-\\u0B6F\\u0B71\\u0B82\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD0\\u0BD7\\u0BE6-\\u0BEF\\u0C00-\\u0C03\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C58\\u0C59\\u0C60-\\u0C63\\u0C66-\\u0C6F\\u0C81-\\u0C83\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBC-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CDE\\u0CE0-\\u0CE3\\u0CE6-\\u0CEF\\u0CF1\\u0CF2\\u0D01-\\u0D03\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4E\\u0D57\\u0D60-\\u0D63\\u0D66-\\u0D6F\\u0D7A-\\u0D7F\\u0D82\\u0D83\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DE6-\\u0DEF\\u0DF2\\u0DF3\\u0E01-\\u0E3A\\u0E40-\\u0E4E\\u0E50-\\u0E59\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB9\\u0EBB-\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EC8-\\u0ECD\\u0ED0-\\u0ED9\\u0EDC-\\u0EDF\\u0F00\\u0F18\\u0F19\\u0F20-\\u0F29\\u0F35\\u0F37\\u0F39\\u0F3E-\\u0F47\\u0F49-\\u0F6C\\u0F71-\\u0F84\\u0F86-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u1000-\\u1049\\u1050-\\u109D\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u135D-\\u135F\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1714\\u1720-\\u1734\\u1740-\\u1753\\u1760-\\u176C\\u176E-\\u1770\\u1772\\u1773\\u1780-\\u17D3\\u17D7\\u17DC\\u17DD\\u17E0-\\u17E9\\u180B-\\u180D\\u1810-\\u1819\\u1820-\\u1877\\u1880-\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1920-\\u192B\\u1930-\\u193B\\u1946-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u19D0-\\u19D9\\u1A00-\\u1A1B\\u1A20-\\u1A5E\\u1A60-\\u1A7C\\u1A7F-\\u1A89\\u1A90-\\u1A99\\u1AA7\\u1AB0-\\u1ABD\\u1B00-\\u1B4B\\u1B50-\\u1B59\\u1B6B-\\u1B73\\u1B80-\\u1BF3\\u1C00-\\u1C37\\u1C40-\\u1C49\\u1C4D-\\u1C7D\\u1CD0-\\u1CD2\\u1CD4-\\u1CF6\\u1CF8\\u1CF9\\u1D00-\\u1DF5\\u1DFC-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u200C\\u200D\\u203F\\u2040\\u2054\\u2071\\u207F\\u2090-\\u209C\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D7F-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2DE0-\\u2DFF\\u2E2F\\u3005-\\u3007\\u3021-\\u302F\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u3099\\u309A\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA62B\\uA640-\\uA66F\\uA674-\\uA67D\\uA67F-\\uA69D\\uA69F-\\uA6F1\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA827\\uA840-\\uA873\\uA880-\\uA8C4\\uA8D0-\\uA8D9\\uA8E0-\\uA8F7\\uA8FB\\uA900-\\uA92D\\uA930-\\uA953\\uA960-\\uA97C\\uA980-\\uA9C0\\uA9CF-\\uA9D9\\uA9E0-\\uA9FE\\uAA00-\\uAA36\\uAA40-\\uAA4D\\uAA50-\\uAA59\\uAA60-\\uAA76\\uAA7A-\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEF\\uAAF2-\\uAAF6\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABEA\\uABEC\\uABED\\uABF0-\\uABF9\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE00-\\uFE0F\\uFE20-\\uFE2D\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF10-\\uFF19\\uFF21-\\uFF3A\\uFF3F\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]");
1400
- function _r(e, t) {
1401
- /* istanbul ignore next */
1402
- if (!e) throw Error("ASSERT: " + t);
1776
+ function Qr() {
1777
+ let e = [];
1778
+ if (Z("("), !Q(")")) for (; z < B && (e.push($()), !Q(")"));) Z(",");
1779
+ return Z(")"), e;
1403
1780
  }
1404
- function R(e) {
1405
- return e >= 48 && e <= 57;
1781
+ function $r() {
1782
+ z = V.start;
1783
+ let e = Y();
1784
+ return Ar(e) || Ur(e), Lr(e.value);
1406
1785
  }
1407
- function vr(e) {
1408
- return "0123456789abcdefABCDEF".includes(e);
1786
+ function ei() {
1787
+ return Z("."), $r();
1409
1788
  }
1410
- function yr(e) {
1411
- return "01234567".includes(e);
1789
+ function ti() {
1790
+ Z("[");
1791
+ let e = si();
1792
+ return Z("]"), e;
1412
1793
  }
1413
- function br(e) {
1414
- return e === 32 || e === 9 || e === 11 || e === 12 || e === 160 || e >= 5760 && [
1415
- 5760,
1416
- 6158,
1417
- 8192,
1418
- 8193,
1419
- 8194,
1420
- 8195,
1421
- 8196,
1422
- 8197,
1423
- 8198,
1424
- 8199,
1425
- 8200,
1426
- 8201,
1427
- 8202,
1428
- 8239,
1429
- 8287,
1430
- 12288,
1431
- 65279
1432
- ].includes(e);
1794
+ function ni() {
1795
+ for (var e = Zr(), t, n;;) if (Q(".")) n = ei(), e = zr(".", e, n);
1796
+ else if (Q("(")) t = Qr(), e = Fr(e, t);
1797
+ else if (Q("[")) n = ti(), e = zr("[", e, n);
1798
+ else break;
1799
+ return e;
1433
1800
  }
1434
- function xr(e) {
1435
- return e === 10 || e === 13 || e === 8232 || e === 8233;
1801
+ function ri() {
1802
+ let e = ni();
1803
+ if (V.type === G && (Q("++") || Q("--"))) throw Error(ir);
1804
+ return e;
1436
1805
  }
1437
- function Sr(e) {
1438
- return e === 36 || e === 95 || e >= 65 && e <= 90 || e >= 97 && e <= 122 || e === 92 || e >= 128 && hr.test(String.fromCharCode(e));
1806
+ function ii() {
1807
+ var e, t;
1808
+ if (V.type !== G && V.type !== U) t = ri();
1809
+ else if (Q("++") || Q("--")) throw Error(ir);
1810
+ else if (Q("+") || Q("-") || Q("~") || Q("!")) e = Y(), t = ii(), t = Hr(e.value, t);
1811
+ else if (Wr("delete") || Wr("void") || Wr("typeof")) throw Error(ir);
1812
+ else t = ri();
1813
+ return t;
1439
1814
  }
1440
- function Cr(e) {
1441
- return e === 36 || e === 95 || e >= 65 && e <= 90 || e >= 97 && e <= 122 || e >= 48 && e <= 57 || e === 92 || e >= 128 && gr.test(String.fromCharCode(e));
1815
+ function ai(e) {
1816
+ let t = 0;
1817
+ if (e.type !== G && e.type !== U) return 0;
1818
+ switch (e.value) {
1819
+ case "||":
1820
+ t = 1;
1821
+ break;
1822
+ case "&&":
1823
+ t = 2;
1824
+ break;
1825
+ case "|":
1826
+ t = 3;
1827
+ break;
1828
+ case "^":
1829
+ t = 4;
1830
+ break;
1831
+ case "&":
1832
+ t = 5;
1833
+ break;
1834
+ case "==":
1835
+ case "!=":
1836
+ case "===":
1837
+ case "!==":
1838
+ t = 6;
1839
+ break;
1840
+ case "<":
1841
+ case ">":
1842
+ case "<=":
1843
+ case ">=":
1844
+ case "instanceof":
1845
+ case "in":
1846
+ t = 7;
1847
+ break;
1848
+ case "<<":
1849
+ case ">>":
1850
+ case ">>>":
1851
+ t = 8;
1852
+ break;
1853
+ case "+":
1854
+ case "-":
1855
+ t = 9;
1856
+ break;
1857
+ case "*":
1858
+ case "/":
1859
+ case "%": t = 11;
1860
+ }
1861
+ return t;
1442
1862
  }
1443
- var wr = {
1444
- if: 1,
1445
- in: 1,
1446
- do: 1,
1447
- var: 1,
1448
- for: 1,
1449
- new: 1,
1450
- try: 1,
1451
- let: 1,
1452
- this: 1,
1453
- else: 1,
1454
- case: 1,
1455
- void: 1,
1456
- with: 1,
1457
- enum: 1,
1458
- while: 1,
1459
- break: 1,
1460
- catch: 1,
1461
- throw: 1,
1462
- const: 1,
1463
- yield: 1,
1464
- class: 1,
1465
- super: 1,
1466
- return: 1,
1467
- typeof: 1,
1468
- delete: 1,
1469
- switch: 1,
1470
- export: 1,
1471
- import: 1,
1472
- public: 1,
1473
- static: 1,
1474
- default: 1,
1475
- finally: 1,
1476
- extends: 1,
1477
- package: 1,
1478
- private: 1,
1479
- function: 1,
1480
- continue: 1,
1481
- debugger: 1,
1482
- interface: 1,
1483
- protected: 1,
1484
- instanceof: 1,
1485
- implements: 1
1486
- };
1487
- function Tr() {
1488
- for (; k < A;) {
1489
- let e = O.charCodeAt(k);
1490
- if (br(e) || xr(e)) ++k;
1491
- else break;
1863
+ function oi() {
1864
+ var e = V, t, n, r, i, a, o, s, c = ii(), l;
1865
+ if (r = V, i = ai(r), i === 0) return c;
1866
+ for (r.prec = i, Y(), t = [e, V], o = ii(), a = [
1867
+ c,
1868
+ r,
1869
+ o
1870
+ ]; (i = ai(V)) > 0;) {
1871
+ for (; a.length > 2 && i <= a[a.length - 2].prec;) o = a.pop(), s = a.pop().value, c = a.pop(), t.pop(), n = Pr(s, c, o), a.push(n);
1872
+ r = Y(), r.prec = i, a.push(r), t.push(V), n = ii(), a.push(n);
1492
1873
  }
1874
+ for (l = a.length - 1, n = a[l], t.pop(); l > 1;) t.pop(), n = Pr(a[l - 1].value, a[l - 2], n), l -= 2;
1875
+ return n;
1493
1876
  }
1494
- function Er(e) {
1495
- var t, n, r, i = 0;
1496
- for (n = e === "u" ? 4 : 2, t = 0; t < n; ++t) k < A && vr(O[k]) ? (r = O[k++], i = i * 16 + "0123456789abcdef".indexOf(r.toLowerCase())) : B({}, I, L);
1497
- return String.fromCharCode(i);
1877
+ function $() {
1878
+ var e = oi(), t, n;
1879
+ return Q("?") && (Y(), t = $(), Z(":"), n = $(), e = Ir(e, t, n)), e;
1498
1880
  }
1499
- function Dr() {
1500
- var e = O[k], t = 0, n, r;
1501
- for (e === "}" && B({}, I, L); k < A && (e = O[k++], vr(e));) t = t * 16 + "0123456789abcdef".indexOf(e.toLowerCase());
1502
- return (t > 1114111 || e !== "}") && B({}, I, L), t <= 65535 ? String.fromCharCode(t) : (n = (t - 65536 >> 10) + 55296, r = (t - 65536 & 1023) + 56320, String.fromCharCode(n, r));
1881
+ function si() {
1882
+ let e = $();
1883
+ if (Q(",")) throw Error(ir);
1884
+ return e;
1503
1885
  }
1504
- function Or() {
1505
- var e = O.charCodeAt(k++), t = String.fromCharCode(e);
1506
- for (e === 92 && (O.charCodeAt(k) !== 117 && B({}, I, L), ++k, e = Er("u"), (!e || e === "\\" || !Sr(e.charCodeAt(0))) && B({}, I, L), t = e); k < A && (e = O.charCodeAt(k), Cr(e));) ++k, t += String.fromCharCode(e), e === 92 && (t = t.substr(0, t.length - 1), O.charCodeAt(k) !== 117 && B({}, I, L), ++k, e = Er("u"), (!e || e === "\\" || !Cr(e.charCodeAt(0))) && B({}, I, L), t += e);
1886
+ function ci(e) {
1887
+ R = e, z = 0, B = R.length, V = null, Mr();
1888
+ let t = si();
1889
+ if (V.type !== Pn) throw Error("Unexpect token after expression.");
1507
1890
  return t;
1508
1891
  }
1509
- function kr() {
1510
- for (var e = k++, t; k < A;) {
1511
- if (t = O.charCodeAt(k), t === 92) return k = e, Or();
1512
- if (Cr(t)) ++k;
1513
- else break;
1892
+ var li = {
1893
+ NaN: "NaN",
1894
+ E: "Math.E",
1895
+ LN2: "Math.LN2",
1896
+ LN10: "Math.LN10",
1897
+ LOG2E: "Math.LOG2E",
1898
+ LOG10E: "Math.LOG10E",
1899
+ PI: "Math.PI",
1900
+ SQRT1_2: "Math.SQRT1_2",
1901
+ SQRT2: "Math.SQRT2",
1902
+ MIN_VALUE: "Number.MIN_VALUE",
1903
+ MAX_VALUE: "Number.MAX_VALUE"
1904
+ };
1905
+ function ui(e) {
1906
+ function t(t, n, r, i) {
1907
+ let a = e(n[0]);
1908
+ return r && (a = r + "(" + a + ")", r.lastIndexOf("new ", 0) === 0 && (a = "(" + a + ")")), a + "." + t + (i < 0 ? "" : i === 0 ? "()" : "(" + n.slice(1).map(e).join(",") + ")");
1514
1909
  }
1515
- return O.slice(e, k);
1516
- }
1517
- function Ar() {
1518
- var e = k, t = O.charCodeAt(k) === 92 ? Or() : kr();
1910
+ function n(e, n, r) {
1911
+ return (i) => t(e, i, n, r);
1912
+ }
1913
+ let r = "new Date", i = "String", a = "RegExp";
1519
1914
  return {
1520
- type: t.length === 1 ? M : wr.hasOwnProperty(t) ? N : t === "null" ? Gn : t === "true" || t === "false" ? Un : M,
1521
- value: t,
1522
- start: e,
1523
- end: k
1524
- };
1525
- }
1526
- function jr() {
1527
- var e = k, t = O.charCodeAt(k), n, r = O[k], i, a, o;
1528
- switch (t) {
1529
- case 46:
1530
- case 40:
1531
- case 41:
1532
- case 59:
1533
- case 44:
1534
- case 123:
1535
- case 125:
1536
- case 91:
1537
- case 93:
1538
- case 58:
1539
- case 63:
1540
- case 126: return ++k, {
1541
- type: F,
1542
- value: String.fromCharCode(t),
1543
- start: e,
1544
- end: k
1545
- };
1546
- default: if (n = O.charCodeAt(k + 1), n === 61) switch (t) {
1547
- case 43:
1548
- case 45:
1549
- case 47:
1550
- case 60:
1551
- case 62:
1552
- case 94:
1553
- case 124:
1554
- case 37:
1555
- case 38:
1556
- case 42: return k += 2, {
1557
- type: F,
1558
- value: String.fromCharCode(t) + String.fromCharCode(n),
1559
- start: e,
1560
- end: k
1561
- };
1562
- case 33:
1563
- case 61: return k += 2, O.charCodeAt(k) === 61 && ++k, {
1564
- type: F,
1565
- value: O.slice(e, k),
1566
- start: e,
1567
- end: k
1568
- };
1915
+ isNaN: "Number.isNaN",
1916
+ isFinite: "Number.isFinite",
1917
+ abs: "Math.abs",
1918
+ acos: "Math.acos",
1919
+ asin: "Math.asin",
1920
+ atan: "Math.atan",
1921
+ atan2: "Math.atan2",
1922
+ ceil: "Math.ceil",
1923
+ cos: "Math.cos",
1924
+ exp: "Math.exp",
1925
+ floor: "Math.floor",
1926
+ hypot: "Math.hypot",
1927
+ log: "Math.log",
1928
+ max: "Math.max",
1929
+ min: "Math.min",
1930
+ pow: "Math.pow",
1931
+ random: "Math.random",
1932
+ round: "Math.round",
1933
+ sin: "Math.sin",
1934
+ sqrt: "Math.sqrt",
1935
+ tan: "Math.tan",
1936
+ clamp: function(t) {
1937
+ t.length < 3 && F("Missing arguments to clamp function."), t.length > 3 && F("Too many arguments to clamp function.");
1938
+ let n = t.map(e);
1939
+ return "Math.max(" + n[1] + ", Math.min(" + n[2] + "," + n[0] + "))";
1940
+ },
1941
+ now: "Date.now",
1942
+ utc: "Date.UTC",
1943
+ datetime: r,
1944
+ date: n("getDate", r, 0),
1945
+ day: n("getDay", r, 0),
1946
+ year: n("getFullYear", r, 0),
1947
+ month: n("getMonth", r, 0),
1948
+ hours: n("getHours", r, 0),
1949
+ minutes: n("getMinutes", r, 0),
1950
+ seconds: n("getSeconds", r, 0),
1951
+ milliseconds: n("getMilliseconds", r, 0),
1952
+ time: n("getTime", r, 0),
1953
+ timezoneoffset: n("getTimezoneOffset", r, 0),
1954
+ utcdate: n("getUTCDate", r, 0),
1955
+ utcday: n("getUTCDay", r, 0),
1956
+ utcyear: n("getUTCFullYear", r, 0),
1957
+ utcmonth: n("getUTCMonth", r, 0),
1958
+ utchours: n("getUTCHours", r, 0),
1959
+ utcminutes: n("getUTCMinutes", r, 0),
1960
+ utcseconds: n("getUTCSeconds", r, 0),
1961
+ utcmilliseconds: n("getUTCMilliseconds", r, 0),
1962
+ length: n("length", null, -1),
1963
+ parseFloat: "parseFloat",
1964
+ parseInt: "parseInt",
1965
+ upper: n("toUpperCase", i, 0),
1966
+ lower: n("toLowerCase", i, 0),
1967
+ substring: n("substring", i),
1968
+ split: n("split", i),
1969
+ trim: n("trim", i, 0),
1970
+ btoa: "btoa",
1971
+ atob: "atob",
1972
+ encodeURIComponent: "encodeURIComponent",
1973
+ regexp: a,
1974
+ test: n("test", a),
1975
+ if: function(t) {
1976
+ t.length < 3 && F("Missing arguments to if function."), t.length > 3 && F("Too many arguments to if function.");
1977
+ let n = t.map(e);
1978
+ return "(" + n[0] + "?" + n[1] + ":" + n[2] + ")";
1569
1979
  }
1570
- }
1571
- if (o = O.substr(k, 4), o === ">>>=") return k += 4, {
1572
- type: F,
1573
- value: o,
1574
- start: e,
1575
- end: k
1576
- };
1577
- if (a = o.substr(0, 3), a === ">>>" || a === "<<=" || a === ">>=") return k += 3, {
1578
- type: F,
1579
- value: a,
1580
- start: e,
1581
- end: k
1582
- };
1583
- if (i = a.substr(0, 2), r === i[1] && "+-<>&|".includes(r) || i === "=>") return k += 2, {
1584
- type: F,
1585
- value: i,
1586
- start: e,
1587
- end: k
1588
- };
1589
- if (i === "//" && B({}, I, L), "<>=!+-*%&|^/".includes(r)) return ++k, {
1590
- type: F,
1591
- value: r,
1592
- start: e,
1593
- end: k
1594
- };
1595
- B({}, I, L);
1596
- }
1597
- function Mr(e) {
1598
- let t = "";
1599
- for (; k < A && vr(O[k]);) t += O[k++];
1600
- return t.length === 0 && B({}, I, L), Sr(O.charCodeAt(k)) && B({}, I, L), {
1601
- type: P,
1602
- value: parseInt("0x" + t, 16),
1603
- start: e,
1604
- end: k
1605
1980
  };
1606
1981
  }
1607
- function Nr(e) {
1608
- let t = "0" + O[k++];
1609
- for (; k < A && yr(O[k]);) t += O[k++];
1610
- return (Sr(O.charCodeAt(k)) || R(O.charCodeAt(k))) && B({}, I, L), {
1611
- type: P,
1612
- value: parseInt(t, 8),
1613
- octal: !0,
1614
- start: e,
1615
- end: k
1616
- };
1982
+ function di(e) {
1983
+ let t = e && e.length - 1;
1984
+ return t && (e[0] === "\"" && e[t] === "\"" || e[0] === "'" && e[t] === "'") ? e.slice(1, -1) : e;
1617
1985
  }
1618
- function Pr() {
1619
- var e, t, n = O[k];
1620
- if (_r(R(n.charCodeAt(0)) || n === ".", "Numeric literal must start with a decimal digit or a decimal point"), t = k, e = "", n !== ".") {
1621
- if (e = O[k++], n = O[k], e === "0") {
1622
- if (n === "x" || n === "X") return ++k, Mr(t);
1623
- if (yr(n)) return Nr(t);
1624
- n && R(n.charCodeAt(0)) && B({}, I, L);
1625
- }
1626
- for (; R(O.charCodeAt(k));) e += O[k++];
1627
- n = O[k];
1628
- }
1629
- if (n === ".") {
1630
- for (e += O[k++]; R(O.charCodeAt(k));) e += O[k++];
1631
- n = O[k];
1632
- }
1633
- if (n === "e" || n === "E") {
1634
- if (e += O[k++], n = O[k], (n === "+" || n === "-") && (e += O[k++]), R(O.charCodeAt(k))) for (; R(O.charCodeAt(k));) e += O[k++];
1635
- else B({}, I, L);
1986
+ function fi(e) {
1987
+ e ||= {};
1988
+ let t = e.allowed ? yn(e.allowed) : {}, n = e.forbidden ? yn(e.forbidden) : {}, r = e.constants || li, i = (e.functions || ui)(d), a = e.globalvar, o = e.fieldvar, s = gn(a) ? a : (e) => `${a}["${e}"]`, c = {}, l = {}, u = 0;
1989
+ function d(e) {
1990
+ if (vn(e)) return e;
1991
+ let t = f[e.type];
1992
+ return t ?? F("Unsupported type: " + e.type), t(e);
1636
1993
  }
1637
- return Sr(O.charCodeAt(k)) && B({}, I, L), {
1638
- type: P,
1639
- value: parseFloat(e),
1640
- start: t,
1641
- end: k
1642
- };
1643
- }
1644
- function Fr() {
1645
- var e = "", t, n, r, i, a = !1;
1646
- for (t = O[k], _r(t === "'" || t === "\"", "String literal must starts with a quote"), n = k, ++k; k < A;) {
1647
- if (r = O[k++], r === t) {
1648
- t = "";
1649
- break;
1650
- }
1651
- if (r === "\\") {
1652
- if (r = O[k++], !r || !xr(r.charCodeAt(0))) switch (r) {
1653
- case "u":
1654
- case "x":
1655
- O[k] === "{" ? (++k, e += Dr()) : e += Er(r);
1656
- break;
1657
- case "n":
1658
- e += "\n";
1659
- break;
1660
- case "r":
1661
- e += "\r";
1662
- break;
1663
- case "t":
1664
- e += " ";
1665
- break;
1666
- case "b":
1667
- e += "\b";
1668
- break;
1669
- case "f":
1670
- e += "\f";
1671
- break;
1672
- case "v":
1673
- e += "\v";
1674
- break;
1675
- default: yr(r) ? (i = "01234567".indexOf(r), i !== 0 && (a = !0), k < A && yr(O[k]) && (a = !0, i = i * 8 + "01234567".indexOf(O[k++]), "0123".includes(r) && k < A && yr(O[k]) && (i = i * 8 + "01234567".indexOf(O[k++]))), e += String.fromCharCode(i)) : e += r;
1994
+ let f = {
1995
+ Literal: (e) => e.raw,
1996
+ Identifier: (e) => {
1997
+ let i = e.name;
1998
+ return u > 0 ? i : _n(n, i) ? F("Illegal identifier: " + i) : _n(r, i) ? r[i] : _n(t, i) ? i : (c[i] = 1, s(i));
1999
+ },
2000
+ MemberExpression: (e) => {
2001
+ let t = !e.computed, n = d(e.object);
2002
+ t && (u += 1);
2003
+ let r = d(e.property);
2004
+ return n === o && (l[di(r)] = 1), t && --u, n + (t ? "." + r : "[" + r + "]");
2005
+ },
2006
+ CallExpression: (e) => {
2007
+ e.callee.type !== "Identifier" && F("Illegal callee type: " + e.callee.type);
2008
+ let t = e.callee.name, n = e.arguments, r = _n(i, t) && i[t];
2009
+ return r || F("Unrecognized function: " + t), gn(r) ? r(n) : r + "(" + n.map(d).join(",") + ")";
2010
+ },
2011
+ ArrayExpression: (e) => "[" + e.elements.map(d).join(",") + "]",
2012
+ BinaryExpression: (e) => "(" + d(e.left) + " " + e.operator + " " + d(e.right) + ")",
2013
+ UnaryExpression: (e) => "(" + e.operator + d(e.argument) + ")",
2014
+ ConditionalExpression: (e) => "(" + d(e.test) + "?" + d(e.consequent) + ":" + d(e.alternate) + ")",
2015
+ LogicalExpression: (e) => "(" + d(e.left) + e.operator + d(e.right) + ")",
2016
+ ObjectExpression: (e) => {
2017
+ for (let t of e.properties) {
2018
+ let e = t.key.type === "Literal" ? String(t.key.value) : t.key.name;
2019
+ hn.has(e) && F("Illegal property: " + e);
1676
2020
  }
1677
- else r === "\r" && O[k] === "\n" && ++k;
1678
- } else if (xr(r.charCodeAt(0))) break;
1679
- else e += r;
1680
- }
1681
- return t !== "" && B({}, I, L), {
1682
- type: Kn,
1683
- value: e,
1684
- octal: a,
1685
- start: n,
1686
- end: k
2021
+ return "{" + e.properties.map(d).join(",") + "}";
2022
+ },
2023
+ Property: (e) => {
2024
+ u += 1;
2025
+ let t = d(e.key);
2026
+ return --u, t + ":" + d(e.value);
2027
+ }
1687
2028
  };
1688
- }
1689
- function Ir(e, t) {
1690
- let n = e;
1691
- t.includes("u") && (n = n.replace(/\\u\{([0-9a-fA-F]+)\}/g, (e, t) => {
1692
- if (parseInt(t, 16) <= 1114111) return "x";
1693
- B({}, ur);
1694
- }).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g, "x"));
1695
- try {
1696
- new RegExp(n);
1697
- } catch {
1698
- B({}, ur);
1699
- }
1700
- try {
1701
- return new RegExp(e, t);
1702
- } catch {
1703
- return null;
2029
+ function p(e) {
2030
+ let t = {
2031
+ code: d(e),
2032
+ globals: Object.keys(c),
2033
+ fields: Object.keys(l)
2034
+ };
2035
+ return c = {}, l = {}, t;
1704
2036
  }
2037
+ return p.functions = i, p.constants = r, p;
1705
2038
  }
1706
- function Lr() {
1707
- var e = O[k], t, n, r, i;
1708
- for (_r(e === "/", "Regular expression literal must start with a slash"), t = O[k++], n = !1, r = !1; k < A;) if (e = O[k++], t += e, e === "\\") e = O[k++], xr(e.charCodeAt(0)) && B({}, dr), t += e;
1709
- else if (xr(e.charCodeAt(0))) B({}, dr);
1710
- else if (n) e === "]" && (n = !1);
1711
- else if (e === "/") {
1712
- r = !0;
1713
- break;
1714
- } else e === "[" && (n = !0);
1715
- return r || B({}, dr), i = t.substr(1, t.length - 2), {
1716
- value: i,
1717
- literal: t
1718
- };
1719
- }
1720
- function Rr() {
1721
- for (var e, t = "", n = ""; k < A && (e = O[k], Cr(e.charCodeAt(0)));) ++k, e === "\\" && k < A ? B({}, I, L) : (n += e, t += e);
1722
- return n.search(/[^gimuy]/g) >= 0 && B({}, ur, n), {
1723
- value: n,
1724
- literal: t
1725
- };
2039
+ //#endregion
2040
+ //#region ../core/src/utils/smoothstep.js
2041
+ function pi(e, t, n) {
2042
+ return n = (n - e) / (t - e), n = Math.max(0, Math.min(1, n)), n * n * (3 - 2 * n);
1726
2043
  }
1727
- function zr() {
1728
- var e, t, n, r;
1729
- return j = null, Tr(), e = k, t = Lr(), n = Rr(), r = Ir(t.value, n.value), {
1730
- literal: t.literal + n.literal,
1731
- value: r,
1732
- regex: {
1733
- pattern: t.value,
1734
- flags: n.value
1735
- },
1736
- start: e,
1737
- end: k
1738
- };
2044
+ //#endregion
2045
+ //#region ../core/src/utils/clamp.js
2046
+ function mi(e, t = 0, n = 1) {
2047
+ return Math.max(t, Math.min(n, e));
1739
2048
  }
1740
- function Br(e) {
1741
- return e.type === M || e.type === N || e.type === Un || e.type === Gn;
2049
+ //#endregion
2050
+ //#region ../core/src/utils/linearstep.js
2051
+ function hi(e, t, n) {
2052
+ return mi((n - e) / (t - e), 0, 1);
1742
2053
  }
1743
- function Vr() {
1744
- if (Tr(), k >= A) return {
1745
- type: Wn,
1746
- start: k,
1747
- end: k
1748
- };
1749
- let e = O.charCodeAt(k);
1750
- return Sr(e) ? Ar() : e === 40 || e === 41 || e === 59 ? jr() : e === 39 || e === 34 ? Fr() : e === 46 ? R(O.charCodeAt(k + 1)) ? Pr() : jr() : R(e) ? Pr() : jr();
2054
+ //#endregion
2055
+ //#region ../core/src/genome/indexGapMapping.js
2056
+ function gi(e, t, n = !1) {
2057
+ let r = 0, i = e.length;
2058
+ for (; r < i;) {
2059
+ let a = r + i >>> 1;
2060
+ e[a] < t || !n && e[a] === t ? r = a + 1 : i = a;
2061
+ }
2062
+ return r;
1751
2063
  }
1752
- function z() {
1753
- let e = j;
1754
- return k = e.end, j = Vr(), k = e.end, e;
2064
+ var _i = /* @__PURE__ */ new WeakSet();
2065
+ function vi(e) {
2066
+ if (e && _i.has(e)) return e;
2067
+ let t = Array.from(new Set(e ?? [])).sort((e, t) => e - t);
2068
+ if (t.some((e) => !Number.isSafeInteger(e) || e < 0 || e >= 2 ** 44)) throw Error("Gap positions must be integers in [0, 2^44).");
2069
+ return _i.add(t), Object.freeze(t);
1755
2070
  }
1756
- function Hr() {
1757
- let e = k;
1758
- j = Vr(), k = e;
2071
+ function yi(e = {}) {
2072
+ return e.gapWidth !== 0 && e.gapWidth !== null && e.gapPositions != null && !(Array.isArray(e.gapPositions) && e.gapPositions.length === 0);
1759
2073
  }
1760
- function Ur(e) {
1761
- let t = new E(Jn);
1762
- return t.elements = e, t;
2074
+ function bi(e) {
2075
+ return e.gapWidth > 0 && e.gapPositions.length > 0;
1763
2076
  }
1764
- function Wr(e, t, n) {
1765
- let r = new E(e === "||" || e === "&&" ? er : Yn);
1766
- return r.operator = e, r.left = t, r.right = n, r;
2077
+ function xi(e) {
2078
+ let t = (t) => {
2079
+ let n = e[t]?.scale;
2080
+ return !!n && yi(n.props);
2081
+ };
2082
+ return Number(t("x")) | Number(t("y")) << 1;
2083
+ }
2084
+ function Si({ domain: e, range: t, cuts: n, width: r, ranks: i, paddingInner: a, paddingOuter: o, align: s }) {
2085
+ let c = e[1] - e[0], l = t[1] - t[0], u = Math.sign(l), d = i?.[0] ?? gi(n, e[0]), f = i?.[1] ?? gi(n, e[1], !0), p = Math.abs(l) > r * (f - d), m = p ? r : 0, h = m * u, g = l - h * (f - d), _ = g / Math.max(i ? 2 ** -52 : 1, c - a + 2 * o), v = t[0] + (g - _ * (c - a)) * s;
2086
+ function y(t, r = 0, i = !1) {
2087
+ if (!p) return NaN;
2088
+ let o = Math.floor(t);
2089
+ return v + (o - e[0]) * _ + h * (gi(n, o, i) - d) + _ * (1 - a) * r;
2090
+ }
2091
+ function b(t, r = _, i = v) {
2092
+ let a = (t - i) * u, o = r * u;
2093
+ if (o === 0) return {
2094
+ value: e[0],
2095
+ rank: d
2096
+ };
2097
+ let s = 0, c = n.length;
2098
+ for (; s < c;) {
2099
+ let t = s + c >>> 1;
2100
+ (n[t] - e[0]) * o + m * (t + 1 - d) < a ? s = t + 1 : c = t;
2101
+ }
2102
+ if (s < n.length && m > 0) {
2103
+ let t = (n[s] - e[0]) * o + m * (s - d);
2104
+ if (a >= t) return {
2105
+ value: n[s],
2106
+ rank: s + (a - t) / m
2107
+ };
2108
+ }
2109
+ return {
2110
+ value: e[0] + (a - m * (s - d)) / o,
2111
+ rank: s
2112
+ };
2113
+ }
2114
+ function ee(t, n, r) {
2115
+ let i = b(n), s = Math.abs(l) / Math.max(1, 1 - a + 2 * o), c = u * Math.min(s, Math.abs(_) / t);
2116
+ return te(c, n - c * (i.value - e[0]) - h * (i.rank - d) + r * l);
2117
+ }
2118
+ function te(e, n) {
2119
+ let r = b(t[0] + e * 2 * o * s, e, n), i = b(t[1] + e * (a - 2 * o * (1 - s)), e, n);
2120
+ return {
2121
+ domain: [r.value, i.value],
2122
+ ranks: [r.rank, i.rank]
2123
+ };
2124
+ }
2125
+ function ne(t, n) {
2126
+ let r = Math.log(t.step / _), i = _ * Math.exp(n * r), a = r === 0 ? n : Math.expm1(n * r) / Math.expm1(r), o = t.start + (e[0] - t.domainStart) * t.step + h * (d - t.firstRank);
2127
+ return te(i, v + a * (o - v));
2128
+ }
2129
+ return {
2130
+ fits: p,
2131
+ position: y,
2132
+ invertPoint: b,
2133
+ navigate: ee,
2134
+ interpolate: ne,
2135
+ domainStart: e[0],
2136
+ step: _,
2137
+ start: v,
2138
+ firstRank: d,
2139
+ lastRank: f,
2140
+ gap: h
2141
+ };
1767
2142
  }
1768
- function Gr(e, t) {
1769
- let n = new E(Xn);
1770
- return n.callee = e, n.arguments = t, n;
2143
+ //#endregion
2144
+ //#region ../core/src/utils/expression.js
2145
+ function Ci(e) {
2146
+ return u(e) || ArrayBuffer.isView(e) ? e : null;
1771
2147
  }
1772
- function Kr(e, t, n) {
1773
- let r = new E(Zn);
1774
- return r.test = e, r.consequent = t, r.alternate = n, r;
2148
+ function wi(e) {
2149
+ return Ci(e) || (C(e) ? e : null);
1775
2150
  }
1776
- function qr(e) {
1777
- let t = new E(Qn);
1778
- return t.name = e, t;
1779
- }
1780
- function Jr(e) {
1781
- let t = new E($n);
1782
- return t.value = e.value, t.raw = O.slice(e.start, e.end), e.regex && (t.raw === "//" && (t.raw = "/(?:)/"), t.regex = e.regex), t;
1783
- }
1784
- function Yr(e, t, n) {
1785
- let r = new E(tr);
1786
- return r.computed = e === "[", r.object = t, r.property = n, r.computed || (n.member = !0), r;
1787
- }
1788
- function Xr(e) {
1789
- let t = new E(nr);
1790
- return t.properties = e, t;
1791
- }
1792
- function Zr(e, t, n) {
1793
- let r = new E(rr);
1794
- return r.key = t, r.value = n, r.kind = e, r;
1795
- }
1796
- function Qr(e, t) {
1797
- let n = new E(ir);
1798
- return n.operator = e, n.argument = t, n.prefix = !0, n;
1799
- }
1800
- function B(e, t) {
1801
- var n, r = Array.prototype.slice.call(arguments, 2), i = t.replace(/%(\d)/g, (e, t) => (_r(t < r.length, "Message reference must be in range"), r[t]));
1802
- throw n = Error(i), n.index = k, n.description = i, n;
1803
- }
1804
- function $r(e) {
1805
- e.type === Wn && B(e, lr), e.type === P && B(e, ar), e.type === Kn && B(e, or), e.type === M && B(e, sr), e.type === N && B(e, cr), B(e, I, e.value);
1806
- }
1807
- function V(e) {
1808
- let t = z();
1809
- (t.type !== F || t.value !== e) && $r(t);
1810
- }
1811
- function H(e) {
1812
- return j.type === F && j.value === e;
1813
- }
1814
- function ei(e) {
1815
- return j.type === N && j.value === e;
1816
- }
1817
- function ti() {
1818
- let e = [];
1819
- for (k = j.start, V("["); !H("]");) H(",") ? (z(), e.push(null)) : (e.push(U()), H("]") || V(","));
1820
- return z(), Ur(e);
1821
- }
1822
- function ni() {
1823
- k = j.start;
1824
- let e = z();
1825
- return e.type === Kn || e.type === P ? (e.octal && B(e, fr), Jr(e)) : qr(e.value);
1826
- }
1827
- function ri() {
1828
- var e, t, n, r;
1829
- if (k = j.start, e = j, e.type === M) return n = ni(), V(":"), r = U(), Zr("init", n, r);
1830
- if (e.type === Wn || e.type === F) $r(e);
1831
- else return t = ni(), V(":"), r = U(), Zr("init", t, r);
1832
- }
1833
- function ii() {
1834
- var e = [], t, n, r, i = {}, a = String;
1835
- for (k = j.start, V("{"); !H("}");) t = ri(), n = t.key.type === Qn ? t.key.name : a(t.key.value), r = "$" + n, Object.prototype.hasOwnProperty.call(i, r) ? B({}, pr) : i[r] = !0, e.push(t), H("}") || V(",");
1836
- return V("}"), Xr(e);
1837
- }
1838
- function ai() {
1839
- V("(");
1840
- let e = _i();
1841
- return V(")"), e;
1842
- }
1843
- var oi = { if: 1 };
1844
- function si() {
1845
- var e, t, n;
1846
- if (H("(")) return ai();
1847
- if (H("[")) return ti();
1848
- if (H("{")) return ii();
1849
- if (e = j.type, k = j.start, e === M || oi[j.value]) n = qr(z().value);
1850
- else if (e === Kn || e === P) j.octal && B(j, fr), n = Jr(z());
1851
- else if (e === N) throw Error(mr);
1852
- else e === Un ? (t = z(), t.value = t.value === "true", n = Jr(t)) : e === Gn ? (t = z(), t.value = null, n = Jr(t)) : H("/") || H("/=") ? (n = Jr(zr()), Hr()) : $r(z());
1853
- return n;
1854
- }
1855
- function ci() {
1856
- let e = [];
1857
- if (V("("), !H(")")) for (; k < A && (e.push(U()), !H(")"));) V(",");
1858
- return V(")"), e;
1859
- }
1860
- function li() {
1861
- k = j.start;
1862
- let e = z();
1863
- return Br(e) || $r(e), qr(e.value);
1864
- }
1865
- function ui() {
1866
- return V("."), li();
1867
- }
1868
- function di() {
1869
- V("[");
1870
- let e = _i();
1871
- return V("]"), e;
1872
- }
1873
- function fi() {
1874
- for (var e = si(), t, n;;) if (H(".")) n = ui(), e = Yr(".", e, n);
1875
- else if (H("(")) t = ci(), e = Gr(e, t);
1876
- else if (H("[")) n = di(), e = Yr("[", e, n);
1877
- else break;
1878
- return e;
1879
- }
1880
- function pi() {
1881
- let e = fi();
1882
- if (j.type === F && (H("++") || H("--"))) throw Error(mr);
1883
- return e;
1884
- }
1885
- function mi() {
1886
- var e, t;
1887
- if (j.type !== F && j.type !== N) t = pi();
1888
- else if (H("++") || H("--")) throw Error(mr);
1889
- else if (H("+") || H("-") || H("~") || H("!")) e = z(), t = mi(), t = Qr(e.value, t);
1890
- else if (ei("delete") || ei("void") || ei("typeof")) throw Error(mr);
1891
- else t = pi();
1892
- return t;
1893
- }
1894
- function hi(e) {
1895
- let t = 0;
1896
- if (e.type !== F && e.type !== N) return 0;
1897
- switch (e.value) {
1898
- case "||":
1899
- t = 1;
1900
- break;
1901
- case "&&":
1902
- t = 2;
1903
- break;
1904
- case "|":
1905
- t = 3;
1906
- break;
1907
- case "^":
1908
- t = 4;
1909
- break;
1910
- case "&":
1911
- t = 5;
1912
- break;
1913
- case "==":
1914
- case "!=":
1915
- case "===":
1916
- case "!==":
1917
- t = 6;
1918
- break;
1919
- case "<":
1920
- case ">":
1921
- case "<=":
1922
- case ">=":
1923
- case "instanceof":
1924
- case "in":
1925
- t = 7;
1926
- break;
1927
- case "<<":
1928
- case ">>":
1929
- case ">>>":
1930
- t = 8;
1931
- break;
1932
- case "+":
1933
- case "-":
1934
- t = 9;
1935
- break;
1936
- case "*":
1937
- case "/":
1938
- case "%": t = 11;
1939
- }
1940
- return t;
1941
- }
1942
- function gi() {
1943
- var e = j, t, n, r, i, a, o, s, c = mi(), l;
1944
- if (r = j, i = hi(r), i === 0) return c;
1945
- for (r.prec = i, z(), t = [e, j], o = mi(), a = [
1946
- c,
1947
- r,
1948
- o
1949
- ]; (i = hi(j)) > 0;) {
1950
- for (; a.length > 2 && i <= a[a.length - 2].prec;) o = a.pop(), s = a.pop().value, c = a.pop(), t.pop(), n = Wr(s, c, o), a.push(n);
1951
- r = z(), r.prec = i, a.push(r), t.push(j), n = mi(), a.push(n);
1952
- }
1953
- for (l = a.length - 1, n = a[l], t.pop(); l > 1;) t.pop(), n = Wr(a[l - 1].value, a[l - 2], n), l -= 2;
1954
- return n;
1955
- }
1956
- function U() {
1957
- var e = gi(), t, n;
1958
- return H("?") && (z(), t = U(), V(":"), n = U(), e = Kr(e, t, n)), e;
1959
- }
1960
- function _i() {
1961
- let e = U();
1962
- if (H(",")) throw Error(mr);
1963
- return e;
1964
- }
1965
- function vi(e) {
1966
- O = e, k = 0, A = O.length, j = null, Hr();
1967
- let t = _i();
1968
- if (j.type !== Wn) throw Error("Unexpect token after expression.");
1969
- return t;
1970
- }
1971
- var yi = {
1972
- NaN: "NaN",
1973
- E: "Math.E",
1974
- LN2: "Math.LN2",
1975
- LN10: "Math.LN10",
1976
- LOG2E: "Math.LOG2E",
1977
- LOG10E: "Math.LOG10E",
1978
- PI: "Math.PI",
1979
- SQRT1_2: "Math.SQRT1_2",
1980
- SQRT2: "Math.SQRT2",
1981
- MIN_VALUE: "Number.MIN_VALUE",
1982
- MAX_VALUE: "Number.MAX_VALUE"
1983
- };
1984
- function bi(e) {
1985
- function t(t, n, r, i) {
1986
- let a = e(n[0]);
1987
- return r && (a = r + "(" + a + ")", r.lastIndexOf("new ", 0) === 0 && (a = "(" + a + ")")), a + "." + t + (i < 0 ? "" : i === 0 ? "()" : "(" + n.slice(1).map(e).join(",") + ")");
1988
- }
1989
- function n(e, n, r) {
1990
- return (i) => t(e, i, n, r);
1991
- }
1992
- let r = "new Date", i = "String", a = "RegExp";
1993
- return {
1994
- isNaN: "Number.isNaN",
1995
- isFinite: "Number.isFinite",
1996
- abs: "Math.abs",
1997
- acos: "Math.acos",
1998
- asin: "Math.asin",
1999
- atan: "Math.atan",
2000
- atan2: "Math.atan2",
2001
- ceil: "Math.ceil",
2002
- cos: "Math.cos",
2003
- exp: "Math.exp",
2004
- floor: "Math.floor",
2005
- hypot: "Math.hypot",
2006
- log: "Math.log",
2007
- max: "Math.max",
2008
- min: "Math.min",
2009
- pow: "Math.pow",
2010
- random: "Math.random",
2011
- round: "Math.round",
2012
- sin: "Math.sin",
2013
- sqrt: "Math.sqrt",
2014
- tan: "Math.tan",
2015
- clamp: function(t) {
2016
- t.length < 3 && T("Missing arguments to clamp function."), t.length > 3 && T("Too many arguments to clamp function.");
2017
- let n = t.map(e);
2018
- return "Math.max(" + n[1] + ", Math.min(" + n[2] + "," + n[0] + "))";
2019
- },
2020
- now: "Date.now",
2021
- utc: "Date.UTC",
2022
- datetime: r,
2023
- date: n("getDate", r, 0),
2024
- day: n("getDay", r, 0),
2025
- year: n("getFullYear", r, 0),
2026
- month: n("getMonth", r, 0),
2027
- hours: n("getHours", r, 0),
2028
- minutes: n("getMinutes", r, 0),
2029
- seconds: n("getSeconds", r, 0),
2030
- milliseconds: n("getMilliseconds", r, 0),
2031
- time: n("getTime", r, 0),
2032
- timezoneoffset: n("getTimezoneOffset", r, 0),
2033
- utcdate: n("getUTCDate", r, 0),
2034
- utcday: n("getUTCDay", r, 0),
2035
- utcyear: n("getUTCFullYear", r, 0),
2036
- utcmonth: n("getUTCMonth", r, 0),
2037
- utchours: n("getUTCHours", r, 0),
2038
- utcminutes: n("getUTCMinutes", r, 0),
2039
- utcseconds: n("getUTCSeconds", r, 0),
2040
- utcmilliseconds: n("getUTCMilliseconds", r, 0),
2041
- length: n("length", null, -1),
2042
- parseFloat: "parseFloat",
2043
- parseInt: "parseInt",
2044
- upper: n("toUpperCase", i, 0),
2045
- lower: n("toLowerCase", i, 0),
2046
- substring: n("substring", i),
2047
- split: n("split", i),
2048
- trim: n("trim", i, 0),
2049
- btoa: "btoa",
2050
- atob: "atob",
2051
- encodeURIComponent: "encodeURIComponent",
2052
- regexp: a,
2053
- test: n("test", a),
2054
- if: function(t) {
2055
- t.length < 3 && T("Missing arguments to if function."), t.length > 3 && T("Too many arguments to if function.");
2056
- let n = t.map(e);
2057
- return "(" + n[0] + "?" + n[1] + ":" + n[2] + ")";
2058
- }
2059
- };
2060
- }
2061
- function xi(e) {
2062
- let t = e && e.length - 1;
2063
- return t && (e[0] === "\"" && e[t] === "\"" || e[0] === "'" && e[t] === "'") ? e.slice(1, -1) : e;
2064
- }
2065
- function Si(e) {
2066
- e ||= {};
2067
- let t = e.allowed ? kn(e.allowed) : {}, n = e.forbidden ? kn(e.forbidden) : {}, r = e.constants || yi, i = (e.functions || bi)(d), a = e.globalvar, o = e.fieldvar, s = En(a) ? a : (e) => `${a}["${e}"]`, c = {}, l = {}, u = 0;
2068
- function d(e) {
2069
- if (On(e)) return e;
2070
- let t = f[e.type];
2071
- return t ?? T("Unsupported type: " + e.type), t(e);
2072
- }
2073
- let f = {
2074
- Literal: (e) => e.raw,
2075
- Identifier: (e) => {
2076
- let i = e.name;
2077
- return u > 0 ? i : Dn(n, i) ? T("Illegal identifier: " + i) : Dn(r, i) ? r[i] : Dn(t, i) ? i : (c[i] = 1, s(i));
2078
- },
2079
- MemberExpression: (e) => {
2080
- let t = !e.computed, n = d(e.object);
2081
- t && (u += 1);
2082
- let r = d(e.property);
2083
- return n === o && (l[xi(r)] = 1), t && --u, n + (t ? "." + r : "[" + r + "]");
2084
- },
2085
- CallExpression: (e) => {
2086
- e.callee.type !== "Identifier" && T("Illegal callee type: " + e.callee.type);
2087
- let t = e.callee.name, n = e.arguments, r = Dn(i, t) && i[t];
2088
- return r || T("Unrecognized function: " + t), En(r) ? r(n) : r + "(" + n.map(d).join(",") + ")";
2089
- },
2090
- ArrayExpression: (e) => "[" + e.elements.map(d).join(",") + "]",
2091
- BinaryExpression: (e) => "(" + d(e.left) + " " + e.operator + " " + d(e.right) + ")",
2092
- UnaryExpression: (e) => "(" + e.operator + d(e.argument) + ")",
2093
- ConditionalExpression: (e) => "(" + d(e.test) + "?" + d(e.consequent) + ":" + d(e.alternate) + ")",
2094
- LogicalExpression: (e) => "(" + d(e.left) + e.operator + d(e.right) + ")",
2095
- ObjectExpression: (e) => {
2096
- for (let t of e.properties) {
2097
- let e = t.key.type === "Literal" ? String(t.key.value) : t.key.name;
2098
- Tn.has(e) && T("Illegal property: " + e);
2099
- }
2100
- return "{" + e.properties.map(d).join(",") + "}";
2101
- },
2102
- Property: (e) => {
2103
- u += 1;
2104
- let t = d(e.key);
2105
- return --u, t + ":" + d(e.value);
2106
- }
2107
- };
2108
- function p(e) {
2109
- let t = {
2110
- code: d(e),
2111
- globals: Object.keys(c),
2112
- fields: Object.keys(l)
2113
- };
2114
- return c = {}, l = {}, t;
2115
- }
2116
- return p.functions = i, p.constants = r, p;
2117
- }
2118
- //#endregion
2119
- //#region ../core/src/utils/smoothstep.js
2120
- function Ci(e, t, n) {
2121
- return n = (n - e) / (t - e), n = Math.max(0, Math.min(1, n)), n * n * (3 - 2 * n);
2122
- }
2123
- //#endregion
2124
- //#region ../core/src/utils/clamp.js
2125
- function wi(e, t = 0, n = 1) {
2126
- return Math.max(t, Math.min(n, e));
2127
- }
2128
- //#endregion
2129
- //#region ../core/src/utils/linearstep.js
2130
- function Ti(e, t, n) {
2131
- return wi((n - e) / (t - e), 0, 1);
2132
- }
2133
- //#endregion
2134
- //#region ../core/src/utils/expression.js
2135
- function Ei(e) {
2136
- return u(e) || ArrayBuffer.isView(e) ? e : null;
2137
- }
2138
- function Di(e) {
2139
- return Ei(e) || (b(e) ? e : null);
2140
- }
2141
- var Oi = {
2142
- clamp: wi,
2143
- tickStep: Ie,
2151
+ var Ti = {
2152
+ clamp: mi,
2153
+ tickStep: Ne,
2144
2154
  format(e, t) {
2145
- return nt(t)(e);
2155
+ return At(t)(e);
2146
2156
  },
2147
2157
  join(e, t) {
2148
- return Ei(e).join(t);
2158
+ return Ci(e).join(t);
2149
2159
  },
2150
2160
  indexof(e, t, n) {
2151
- return Di(e).indexOf(t, n);
2161
+ return wi(e).indexOf(t, n);
2152
2162
  },
2153
- inrange: _e,
2163
+ inrange: me,
2154
2164
  lastindexof(e, t, n) {
2155
- return Di(e).lastIndexOf(t, n);
2165
+ return wi(e).lastIndexOf(t, n);
2156
2166
  },
2157
2167
  reverse(e) {
2158
- return b(e) ? Array.from(e).reverse().join("") : Ei(e).slice().reverse();
2168
+ return C(e) ? Array.from(e).reverse().join("") : Ci(e).slice().reverse();
2159
2169
  },
2160
2170
  slice(e, t, n) {
2161
- return Di(e).slice(t, n);
2171
+ return wi(e).slice(t, n);
2162
2172
  },
2163
2173
  mapHasKey(e, t) {
2164
2174
  return e.has(t);
2165
2175
  },
2166
2176
  isArray: u,
2167
- isBoolean: ve,
2177
+ isBoolean: he,
2168
2178
  isDefined(e) {
2169
2179
  return e !== void 0;
2170
2180
  },
2171
- isNumber: ye,
2181
+ isNumber: ge,
2172
2182
  isObject: d,
2173
- isRegExp: be,
2174
- isString: b,
2183
+ isRegExp: _e,
2184
+ isString: C,
2175
2185
  isValid(e) {
2176
2186
  return e != null && e === e;
2177
2187
  },
2178
- lerp: xe,
2179
- linearstep: Ti,
2188
+ lerp: ve,
2189
+ linearstep: hi,
2180
2190
  replace(e, t, n) {
2181
2191
  return String(e).replace(t, n);
2182
2192
  },
2183
2193
  sort(e) {
2184
- return Ei(e).slice().sort(pe);
2194
+ return Ci(e).slice().sort(ue);
2185
2195
  },
2186
2196
  center(e) {
2187
- let t = Ei(e);
2197
+ let t = Ci(e);
2188
2198
  return (t[0] + t[t.length - 1]) / 2;
2189
2199
  },
2190
2200
  span(e) {
2191
- return Se(e);
2201
+ return ye(e);
2192
2202
  },
2193
- smoothstep: Ci
2203
+ smoothstep: pi
2194
2204
  };
2195
- function ki(e) {
2196
- let t = !1, n = Li(e, {}, { resolveScaleResolution: () => (t = !0, {
2197
- channel: "analysis",
2198
- getDomainRef: () => void 0,
2199
- getMappingRef: () => void 0,
2200
- getConfigurationRef: () => void 0,
2201
- getZoomLevelRef: () => void 0
2202
- }) });
2205
+ function Ei(e, t) {
2206
+ let n = !1, r = Pi(e, {}, {
2207
+ specLocation: t,
2208
+ resolveScaleResolution: () => (n = !0, {
2209
+ channel: "analysis",
2210
+ getDomainRef: () => void 0,
2211
+ getMappingRef: () => void 0,
2212
+ getConfigurationRef: () => void 0,
2213
+ getZoomLevelRef: () => void 0
2214
+ })
2215
+ });
2203
2216
  return {
2204
- usesScaleHelper: t,
2205
- globals: n.globals
2217
+ usesScaleHelper: n,
2218
+ globals: r.globals
2206
2219
  };
2207
2220
  }
2208
- function Ai(e, t) {
2209
- let n = bi(e);
2210
- for (let e in Oi) n[e] = `this.${e}`;
2221
+ function Di(e, t) {
2222
+ let n = ui(e);
2223
+ for (let e in Ti) n[e] = `this.${e}`;
2211
2224
  for (let r of [
2212
2225
  "scale",
2213
2226
  "invert",
2214
2227
  "domain",
2215
2228
  "range",
2216
2229
  "bandwidth",
2230
+ "bandstep",
2217
2231
  "linearize",
2218
2232
  "zoomLevel"
2219
- ]) n[r] = (n) => ji(e, t, r, n);
2233
+ ]) n[r] = (n) => Oi(e, t, r, n);
2220
2234
  return n;
2221
2235
  }
2222
- function ji(e, t, n, r) {
2236
+ function Oi(e, t, n, r) {
2223
2237
  if (n === "zoomLevel" && r.length === 0) {
2224
2238
  let e = [];
2225
2239
  for (let r of ["x", "y"]) {
@@ -2234,18 +2248,19 @@ function ji(e, t, n, r) {
2234
2248
  if (r.length === 0) throw Error(`Scale helper "${n}" requires a literal channel name.`);
2235
2249
  if ((n === "scale" || n === "invert" || n === "linearize") && r.length < 2) throw Error(`Scale helper "${n}" requires a channel name and a value.`);
2236
2250
  if (n === "zoomLevel" && r.length > 1) throw Error("Scale helper \"zoomLevel\" accepts zero arguments or one literal channel name.");
2237
- let i = Mi(r[0]);
2251
+ if (n === "bandstep" && r.length > 2) throw Error("Scale helper \"bandstep\" accepts a channel and an optional pixel extent.");
2252
+ let i = ki(r[0]);
2238
2253
  if (!i) throw Error(`Scale helper "${n}" requires a literal channel name.`);
2239
2254
  let a = t.resolveScaleResolution?.(i);
2240
2255
  if (!a) throw Error(`Unknown scale channel "${i}" in expression helper "${n}".`);
2241
2256
  let o = t.getScaleHelper(n, i, a), s = r.slice(1).map((t) => e(t)).join(",");
2242
2257
  return `${t.globalvar}["${o.codeName}"](${s})`;
2243
2258
  }
2244
- function Mi(e) {
2259
+ function ki(e) {
2245
2260
  return e?.type === "Literal" && typeof e.value == "string" ? e.value : void 0;
2246
2261
  }
2247
- function Ni(e, t) {
2248
- let n = (n) => Fi(t, e, n);
2262
+ function Ai(e, t) {
2263
+ let n = (n) => Mi(t, e, n);
2249
2264
  if (e === "domain") return () => n(() => t.getDomain());
2250
2265
  if (e === "range") return () => n(() => t.getScale().range());
2251
2266
  if (e === "bandwidth") return () => n(() => {
@@ -2253,26 +2268,35 @@ function Ni(e, t) {
2253
2268
  if (typeof e.bandwidth != "function") throw Error(`Scale channel "${t.channel}" does not support bandwidth().`);
2254
2269
  return e.bandwidth();
2255
2270
  });
2271
+ if (e === "bandstep") return (e) => n(() => {
2272
+ let n = t.getScale();
2273
+ if (typeof n.step != "function") throw Error(`Scale channel "${t.channel}" does not support bandstep().`);
2274
+ if (e !== void 0 && (!Number.isFinite(e) || e < 0)) throw Error("bandstep() extent must be finite and nonnegative.");
2275
+ if (yi(n.props) && e === void 0) throw Error("bandstep() requires a pixel extent for a scale with grouping gaps.");
2276
+ if (e === 0) return 0;
2277
+ let r = n.gapMapping?.(e)?.step ?? n.step(), i = n.range();
2278
+ return Math.sign(i[i.length - 1] - i[0]) * Math.abs(r);
2279
+ });
2256
2280
  if (e === "scale") return (e) => n(() => t.getScale()(e));
2257
2281
  if (e === "invert") return (e) => n(() => t.getScale().invert(e));
2258
2282
  if (e === "linearize") return (e) => n(() => e == null ? null : typeof t.fromComplex == "function" ? t.fromComplex(e) : e);
2259
2283
  if (e === "zoomLevel") return () => n(() => t.getZoomLevel());
2260
2284
  throw Error("Unknown scale helper: " + e);
2261
2285
  }
2262
- var Pi = /* @__PURE__ */ new WeakSet();
2263
- function Fi(e, t, n) {
2264
- if (Pi.has(e)) throw Error(`Scale helper cycle detected while evaluating ${t}("${e.channel}").`);
2265
- Pi.add(e);
2286
+ var ji = /* @__PURE__ */ new WeakSet();
2287
+ function Mi(e, t, n) {
2288
+ if (ji.has(e)) throw Error(`Scale helper cycle detected while evaluating ${t}("${e.channel}").`);
2289
+ ji.add(e);
2266
2290
  try {
2267
2291
  return n();
2268
2292
  } finally {
2269
- Pi.delete(e);
2293
+ ji.delete(e);
2270
2294
  }
2271
2295
  }
2272
- function Ii(e, t) {
2296
+ function Ni(e, t) {
2273
2297
  return e === "domain" ? t.getDomainRef() : e === "linearize" ? t.getConfigurationRef() : e === "zoomLevel" ? t.getZoomLevelRef() : t.getMappingRef();
2274
2298
  }
2275
- function Li(e, t = {}, n = {}) {
2299
+ function Pi(e, t = {}, n = {}) {
2276
2300
  try {
2277
2301
  let r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Set(), o = 1, s = {
2278
2302
  ...n,
@@ -2282,51 +2306,54 @@ function Li(e, t = {}, n = {}) {
2282
2306
  let c = e + ":" + n, l = i.get(c);
2283
2307
  if (l) return l;
2284
2308
  let u = r.get(c);
2285
- u || (u = Ii(e, s), r.set(c, u));
2309
+ u || (u = Ni(e, s), r.set(c, u));
2286
2310
  let d = "__scale_helper_" + o++, f = {
2287
2311
  codeName: d,
2288
2312
  dependency: u
2289
2313
  };
2290
- return i.set(c, f), e === "zoomLevel" && a.add(s), t[d] = Ni(e, s), f;
2314
+ return i.set(c, f), e === "zoomLevel" && a.add(s), t[d] = Ai(e, s), f;
2291
2315
  }
2292
- }, c = Si({
2316
+ }, c = fi({
2293
2317
  forbidden: [],
2294
2318
  allowed: ["datum", "undefined"],
2295
2319
  globalvar: "globalObject",
2296
2320
  fieldvar: "datum",
2297
- functions: (e) => Ai(e, s)
2298
- })(vi(e)), l = Function("datum", "globalObject", `"use strict";
2299
- try {
2300
- return (${c.code});
2321
+ functions: (e) => Di(e, s)
2322
+ }), l = ci(e), u = /* @__PURE__ */ new Set();
2323
+ l.visit((e) => {
2324
+ e.type === "MemberExpression" && e.object.type === "Identifier" && e.object.name === "datum" && (!e.computed && e.property.type === "Identifier" ? u.add(e.property.name) : e.computed && e.property.type === "Literal" && (typeof e.property.value == "string" || typeof e.property.value == "number") && u.add(String(e.property.value)));
2325
+ });
2326
+ let d = c(l), f = $t(`try {
2327
+ return (${d.code});
2301
2328
  } catch (e) {
2302
2329
  throw new Error("Error evaluating expression: " + ${JSON.stringify(e)} + ", " + e.message, e);
2303
- }`).bind(Oi), u = (e) => l(e, t);
2304
- return u.createEvaluator = (e) => (t) => l(t, e), u.fields = c.fields, u.globals = c.globals, u.code = c.code, u.scaleDependencies = Array.from(new Set(r.values())), u.zoomLevelResolutions = Array.from(a), u;
2330
+ }`, u, n.specLocation, Ti), p = f(t);
2331
+ return p.createEvaluator = f, p.fields = d.fields, p.globals = d.globals, p.code = d.code, p.scaleDependencies = Array.from(new Set(r.values())), p.zoomLevelResolutions = Array.from(a), p;
2305
2332
  } catch (t) {
2306
- throw Error(`Invalid expression: ${e}, ${t.message}`, { cause: t });
2333
+ throw Zt(Error(`Invalid expression: ${e}, ${t.message}`, { cause: t }), n.specLocation);
2307
2334
  }
2308
2335
  }
2309
- var Ri = Si({
2336
+ var Fi = fi({
2310
2337
  forbidden: [],
2311
2338
  allowed: ["event"],
2312
2339
  globalvar: "globalObject"
2313
2340
  });
2314
- function zi(e) {
2341
+ function Ii(e, t) {
2315
2342
  try {
2316
- let t = Ri(vi(e));
2343
+ let t = Fi(ci(e));
2317
2344
  return Function("event", "globalObject", `"use strict";
2318
2345
  try {
2319
2346
  return !!(${t.code});
2320
2347
  } catch (e) {
2321
2348
  throw new Error("Error evaluating expression: " + ${JSON.stringify(e)} + ", " + e.message, e);
2322
2349
  }`);
2323
- } catch (t) {
2324
- throw Error(`Invalid expression: ${e}, ${t.message}`, { cause: t });
2350
+ } catch (n) {
2351
+ throw Zt(Error(`Invalid expression: ${e}, ${n.message}`, { cause: n }), t);
2325
2352
  }
2326
2353
  }
2327
2354
  //#endregion
2328
2355
  //#region ../core/src/utils/interactionConfig.js
2329
- function Bi(e) {
2356
+ function Li(e) {
2330
2357
  if (typeof e == "string") {
2331
2358
  let t = e.match(/^([a-zA-Z]+)(?:\[(.+)\])?$/);
2332
2359
  if (!t) throw Error(`Invalid event type string: ${e}`);
@@ -2335,36 +2362,241 @@ function Bi(e) {
2335
2362
  }
2336
2363
  return e;
2337
2364
  }
2338
- function Vi(e) {
2339
- return e?.filter ? zi(e.filter) : () => !0;
2365
+ function Ri(e, t) {
2366
+ return e?.filter ? Ii(e.filter, t) : () => !0;
2340
2367
  }
2341
- function Hi(e, t, n) {
2368
+ function zi(e, t, n) {
2369
+ return e.getSpecLocation(t, [n, ...typeof t?.[n] == "object" ? ["filter"] : []]);
2370
+ }
2371
+ function Bi(e, t, n) {
2342
2372
  if (!t.includes(e.type)) throw Error(n);
2343
2373
  return e;
2344
2374
  }
2345
2375
  //#endregion
2346
- //#region ../core/src/selection/selection.js
2376
+ //#region ../core/src/selection/selectionPredicateTree.js
2377
+ function Vi(e, t) {
2378
+ if (!("test" in e) || !("ref" in e.test)) return e;
2379
+ let n = e.test.ref;
2380
+ if (!Object.hasOwn(t, n)) throw Error(`Unknown predicate "${n}" in unit view.`);
2381
+ return {
2382
+ ...e,
2383
+ test: t[n]
2384
+ };
2385
+ }
2386
+ function Hi(e) {
2387
+ let t = "test" in e ? e.test : {
2388
+ param: e.param,
2389
+ ...e.empty === void 0 ? {} : { empty: e.empty },
2390
+ ...e.project === void 0 ? {} : { project: e.project }
2391
+ }, n = (e) => {
2392
+ if (!e || typeof e != "object" || Array.isArray(e)) throw Error("Selection predicate must be an object.");
2393
+ let t = e, r = [
2394
+ "param",
2395
+ "and",
2396
+ "or",
2397
+ "not"
2398
+ ].filter((e) => e in t);
2399
+ if (r.length !== 1) throw Error("Selection predicate must have exactly one operator.");
2400
+ let i = r[0];
2401
+ if (i === "param") {
2402
+ if (typeof t.param == "string") {
2403
+ if (Object.keys(t).some((e) => ![
2404
+ "param",
2405
+ "empty",
2406
+ "project"
2407
+ ].includes(e)) || typeof (t.empty ?? !0) != "boolean") throw Error("Invalid selection parameter predicate.");
2408
+ if (t.project !== void 0) {
2409
+ let e = t.project;
2410
+ if (!e || typeof e != "object" || Array.isArray(e) || Object.keys(e).length === 0 || Object.entries(e).some(([e, t]) => !["x", "y"].includes(e) || t !== e && t !== e + "2")) throw Error("Invalid interval selection projection.");
2411
+ }
2412
+ return {
2413
+ param: Wt(t.param),
2414
+ empty: t.empty ?? !0,
2415
+ ...t.project ? { project: { ...t.project } } : {}
2416
+ };
2417
+ }
2418
+ if (!t.param || typeof t.param != "object" || Object.keys(t.param).length !== 1 || !Array.isArray(t.param.or) || Object.keys(t).some((e) => !["param", "empty"].includes(e)) || typeof (t.empty ?? !0) != "boolean") throw Error("Invalid flat selection union.");
2419
+ if (t.param.or.length === 0) throw Error("Selection test \"or\" must be a nonempty array.");
2420
+ let e = Array.from(new Set(t.param.or.map(Wt))), n = e.map((e) => ({ selectionActive: e })), r = e.map((e, t) => ({ all: [{
2421
+ param: e,
2422
+ empty: !0
2423
+ }, n[t]] }));
2424
+ return { any: t.empty === !1 ? r : [...r, { not: { any: n } }] };
2425
+ }
2426
+ if (Object.keys(t).length !== 1) throw Error("Selection predicate operators cannot be mixed.");
2427
+ if (i === "not") return { not: n(t.not) };
2428
+ let a = t[i];
2429
+ if (!Array.isArray(a) || a.length === 0) throw Error(`Selection test "${i}" must be a nonempty array.`);
2430
+ let o = a.map(n);
2431
+ return i === "and" ? { all: o } : { any: o };
2432
+ };
2433
+ return n(t);
2434
+ }
2347
2435
  function Ui(e) {
2436
+ let t = /* @__PURE__ */ new Set(), n = (e) => {
2437
+ if ("param" in e) t.add(e.param);
2438
+ else if ("selectionActive" in e) t.add(typeof e.selectionActive == "string" ? e.selectionActive : e.selectionActive.param);
2439
+ else if ("not" in e) n(e.not);
2440
+ else for (let t of "all" in e ? e.all : e.any) n(t);
2441
+ };
2442
+ return n(e), Array.from(t);
2443
+ }
2444
+ function Wi(e) {
2445
+ let t = /* @__PURE__ */ new Map(), n = (e) => {
2446
+ if ("param" in e) t.set(e.param, { selectionActive: {
2447
+ param: e.param,
2448
+ type: e.type,
2449
+ components: e.projections?.map(({ component: e }) => e) ?? []
2450
+ } });
2451
+ else if ("selectionActive" in e) t.set(e.selectionActive.param, e);
2452
+ else if ("not" in e) n(e.not);
2453
+ else for (let t of "all" in e ? e.all : e.any) n(t);
2454
+ };
2455
+ return n(e), { all: [e, { any: Array.from(t.values()) }] };
2456
+ }
2457
+ function Gi(e) {
2458
+ if ("param" in e) return e.empty;
2459
+ if ("selectionActive" in e) return !1;
2460
+ if ("not" in e) return !Gi(e.not);
2461
+ let t = "all" in e ? e.all : e.any;
2462
+ return "all" in e ? t.every(Gi) : t.some(Gi);
2463
+ }
2464
+ function Ki(e, t, n, r, i) {
2465
+ let a = (e) => {
2466
+ let t = n.findSelectionCapability?.(e);
2467
+ if (t) return t;
2468
+ let r = n.findValue(e);
2469
+ if (!r || ![
2470
+ "single",
2471
+ "multi",
2472
+ "interval"
2473
+ ].includes(r.type)) throw Error(`Selection parameter "${e}" was not found.`);
2474
+ return {
2475
+ type: r.type,
2476
+ components: r.type === "interval" ? Object.keys(r.intervals).map((e) => ({ component: e })) : []
2477
+ };
2478
+ }, o = t, s = (e) => {
2479
+ let t = o[e];
2480
+ if (t && "field" in t) return t.field;
2481
+ if (t && "condition" in t) return (Array.isArray(t.condition) ? t.condition : [t.condition]).find((e) => "field" in e)?.field;
2482
+ }, c = (e) => {
2483
+ if ("all" in e) return { all: e.all.map(c) };
2484
+ if ("any" in e) return { any: e.any.map(c) };
2485
+ if ("not" in e) return { not: c(e.not) };
2486
+ let t = "param" in e ? e.param : e.selectionActive, n = a(t);
2487
+ if ("selectionActive" in e) return { selectionActive: {
2488
+ param: t,
2489
+ type: n.type,
2490
+ components: n.components.map(({ component: e }) => e)
2491
+ } };
2492
+ if (e.project && n.type !== "interval") throw Error(`Selection "${t}" is not an interval selection; project is invalid.`);
2493
+ if (n.type !== "interval") return {
2494
+ param: t,
2495
+ type: n.type,
2496
+ empty: e.empty
2497
+ };
2498
+ let l = n.components.map(({ component: e }) => e);
2499
+ if (e.project && (Object.keys(e.project).length !== l.length || l.some((t) => !(t in e.project)))) throw Error(`Selection "${t}" project must cover its declared components: ${l.join(", ")}.`);
2500
+ let u = n.components.map(({ component: n, type: a }) => {
2501
+ let c = e.project?.[n] ?? n;
2502
+ if (![
2503
+ "x",
2504
+ "x2",
2505
+ "y",
2506
+ "y2"
2507
+ ].includes(c)) throw Error(`Selection "${t}" has unsupported component "${n}".`);
2508
+ let l = o[c];
2509
+ if (e.project && (!l || !("field" in l))) throw Error(`Selection "${t}" project target "${c}" must be an unconditional field encoding.`);
2510
+ let u = s(c);
2511
+ if (!u) throw Error(`Selection "${t}" has no field for "${c}".`);
2512
+ if (e.project) {
2513
+ let e = i?.(c) ?? ("type" in l ? l.type : void 0) ?? ("type" in o[n] ? o[n].type : void 0);
2514
+ if (![
2515
+ "quantitative",
2516
+ "index",
2517
+ "locus"
2518
+ ].includes(a) || e !== a) throw Error(`Selection "${t}" project target "${c}" must have matching quantitative, index, or locus type (${a} vs ${e}).`);
2519
+ }
2520
+ let d = n + "2", f = e.project ? void 0 : s(d);
2521
+ return {
2522
+ component: n,
2523
+ input: c,
2524
+ field: u,
2525
+ ...f && f !== u ? {
2526
+ secondaryInput: d,
2527
+ secondaryField: f,
2528
+ hitTest: r
2529
+ } : {}
2530
+ };
2531
+ });
2532
+ return {
2533
+ param: t,
2534
+ type: "interval",
2535
+ empty: e.empty,
2536
+ projections: u
2537
+ };
2538
+ };
2539
+ return c(e);
2540
+ }
2541
+ function qi(e, t) {
2542
+ if ("all" in e || "any" in e) {
2543
+ let n = ("all" in e ? e.all : e.any).map((e) => qi(e, t));
2544
+ return "all" in e ? (e) => n.every((t) => t(e)) : (e) => n.some((t) => t(e));
2545
+ }
2546
+ if ("not" in e) {
2547
+ let n = qi(e.not, t);
2548
+ return (e) => !n(e);
2549
+ }
2550
+ if ("selectionActive" in e) {
2551
+ let { param: n } = e.selectionActive;
2552
+ return () => Ji(t(n));
2553
+ }
2554
+ let { param: n, type: r, empty: i } = e;
2555
+ if (r === "single") return (e) => {
2556
+ let r = t(n);
2557
+ return r.uniqueId == null ? i : r.uniqueId === e[N];
2558
+ };
2559
+ if (r === "multi") return (e) => {
2560
+ let r = t(n);
2561
+ return r.data.size === 0 ? i : r.data.has(e[N]);
2562
+ };
2563
+ let a = e.projections.map((e) => ({
2564
+ ...e,
2565
+ read: en(e.field),
2566
+ readSecondary: e.secondaryField ? en(e.secondaryField) : void 0
2567
+ }));
2568
+ return (e) => {
2569
+ let r = t(n);
2570
+ if (!Ji(r)) return i;
2571
+ for (let t of a) {
2572
+ let n = r.intervals[t.component], i = t.read(e), a = t.readSecondary?.(e), [o, s] = n;
2573
+ if (o === s || !(a === void 0 ? o <= i && i < s : t.hitTest === "endpoints" ? o <= i && i < s || o <= a && a < s : t.hitTest === "encloses" ? o <= Math.min(i, a) && Math.max(i, a) <= s : o < Math.max(i, a) && Math.min(i, a) < s)) return !1;
2574
+ }
2575
+ return !0;
2576
+ };
2577
+ }
2578
+ function Ji(e) {
2579
+ if (e.type === "single") return e.uniqueId != null;
2580
+ if (e.type === "multi") return e.data.size !== 0;
2581
+ if (e.type === "interval") return Object.values(e.intervals).every((e) => !!e);
2582
+ throw Error(`Unsupported selection type: ${e.type}`);
2583
+ }
2584
+ //#endregion
2585
+ //#region ../core/src/selection/selection.js
2586
+ function Yi(e) {
2348
2587
  return {
2349
2588
  type: "single",
2350
2589
  datum: e,
2351
- uniqueId: e?.[x]
2590
+ uniqueId: e?.[N]
2352
2591
  };
2353
2592
  }
2354
- function Wi(e) {
2593
+ function Xi(e) {
2355
2594
  return e ??= [], {
2356
2595
  type: "multi",
2357
- data: new Map(e.map((e) => [e[x], e]))
2596
+ data: new Map(e.map((e) => [e[N], e]))
2358
2597
  };
2359
2598
  }
2360
- function Gi(e, t) {
2361
- if (!t || t.length === 0) return;
2362
- let n = t.map((e) => yt(e)), r = (e) => n.map((t) => t(e));
2363
- if (ea(e)) return e.datum ? [r(e.datum)] : [];
2364
- if (ta(e)) return [...e.data.values()].map(r);
2365
- throw Error(`Expected a point selection, got: ${JSON.stringify(e)}`);
2366
- }
2367
- function Ki(e, t, n, r) {
2599
+ function Zi(e, t, n, r) {
2368
2600
  if (!t || t.length === 0) return;
2369
2601
  if (e === "single" && n.length > 1) throw Error("Single point selections expect at most one key tuple.");
2370
2602
  let i = [], a = [];
@@ -2373,22 +2605,22 @@ function Ki(e, t, n, r) {
2373
2605
  n ? i.push(n) : a.push(e);
2374
2606
  }
2375
2607
  return {
2376
- selection: e === "single" ? Ui(i[0] ?? null) : Wi(i),
2608
+ selection: e === "single" ? Yi(i[0] ?? null) : Xi(i),
2377
2609
  unresolved: a
2378
2610
  };
2379
2611
  }
2380
- function qi(e) {
2612
+ function Qi(e) {
2381
2613
  return {
2382
2614
  type: "interval",
2383
2615
  intervals: Object.fromEntries(e.map((e) => [e, null]))
2384
2616
  };
2385
2617
  }
2386
- function Ji(e, { add: t, remove: n, toggle: r }) {
2618
+ function $i(e, { add: t, remove: n, toggle: r }) {
2387
2619
  let i = e.data;
2388
- for (let e of t ?? []) i.set(e[x], e);
2389
- for (let e of n ?? []) i.delete(e[x]);
2620
+ for (let e of t ?? []) i.set(e[N], e);
2621
+ for (let e of n ?? []) i.delete(e[N]);
2390
2622
  for (let e of r ?? []) {
2391
- let t = e[x];
2623
+ let t = e[N];
2392
2624
  i.has(t) ? i.delete(t) : i.set(t, e);
2393
2625
  }
2394
2626
  return {
@@ -2396,468 +2628,406 @@ function Ji(e, { add: t, remove: n, toggle: r }) {
2396
2628
  data: i
2397
2629
  };
2398
2630
  }
2399
- function Yi(e, t) {
2400
- let n = !!(e.empty ?? !0), r = pa(e.param), i = e.fields ?? {};
2401
- if (ea(t)) return `${r}.uniqueId == null ? ${n} : ${r}.uniqueId === datum[${JSON.stringify(x)}]`;
2402
- if (ta(t)) return `${r}.data.size == 0 ? ${n} : mapHasKey(${r}.data, datum[${JSON.stringify(x)}])`;
2403
- if ($i(t)) {
2404
- let a = Object.keys(t.intervals), o = Object.keys(i).filter(an);
2631
+ function ea(e, t) {
2632
+ let n = !!(e.empty ?? !0), r = Wt(e.param), i = e.fields ?? {};
2633
+ if (aa(t)) return `${r}.uniqueId == null ? ${n} : ${r}.uniqueId === datum[${JSON.stringify(N)}]`;
2634
+ if (oa(t)) return `${r}.data.size == 0 ? ${n} : mapHasKey(${r}.data, datum[${JSON.stringify(N)}])`;
2635
+ if (ia(t)) {
2636
+ let a = Object.keys(t.intervals), o = Object.keys(i).filter(Ua);
2405
2637
  if (o.length === 0) throw Error("Filtering using interval selections requires at least one primary positional channel in the config! " + JSON.stringify(e));
2406
2638
  if (o.some((e) => !a.includes(e))) throw Error(`Selection channels (${a.join(", ")}) do not match the fields: ${JSON.stringify(e)}!`);
2407
2639
  let s = (e) => `datum[${JSON.stringify(e)}]`;
2408
2640
  return a.map((e) => {
2409
- let t = pn(e), a = i[e], o = i[t] ?? i[e], c = `${r}.intervals.${e}[0] <= ${s(o)}`, l = `${s(a)} <= ${r}.intervals.${e}[1]`;
2410
- return `(${r}.intervals.${e} ? (${c} && ${l}) : ${n})`;
2641
+ let t = Za(e), a = i[e], o = i[t] ?? i[e], c = `${r}.intervals.${e}[0] <= ${s(o)}`, l = `${s(a)} <= ${r}.intervals.${e}[1]`, u = `${r}.intervals.${e}[0] < ${r}.intervals.${e}[1]`;
2642
+ return `(${r}.intervals.${e} ? (${u} && ${c} && ${l}) : ${n})`;
2411
2643
  }).join(" && ");
2412
2644
  }
2413
2645
  throw Error(`Unrecognized selection type : ${JSON.stringify(t)}`);
2414
2646
  }
2415
- function Xi(e) {
2416
- if ("param" in e || "test" in e) return St(e);
2647
+ function ta(e) {
2648
+ if ("param" in e || "test" in e) return Hi(e);
2417
2649
  }
2418
- function Zi(e) {
2419
- return e?.selection ? Ct(e.selection) : [];
2650
+ function na(e) {
2651
+ return e?.selection ? Ui(e.selection) : [];
2420
2652
  }
2421
- function Qi(e) {
2653
+ function ra(e) {
2422
2654
  let t = Object.values(e).flatMap((e) => e.branches.flatMap(({ predicate: e }) => e.selection ? [e.selection] : [])), n = /* @__PURE__ */ new Set();
2423
2655
  return t.filter((e) => {
2424
2656
  let t = JSON.stringify(e);
2425
2657
  return !n.has(t) && (n.add(t), !0);
2426
2658
  });
2427
2659
  }
2428
- function $i(e) {
2660
+ function ia(e) {
2429
2661
  return e.type === "interval";
2430
2662
  }
2431
- function ea(e) {
2663
+ function aa(e) {
2432
2664
  return e.type === "single";
2433
2665
  }
2434
- function ta(e) {
2666
+ function oa(e) {
2435
2667
  return e.type === "multi";
2436
2668
  }
2437
- function na(e) {
2669
+ function sa(e) {
2438
2670
  let t = typeof e == "string" ? { type: e } : { ...e };
2439
- return t.on = t.on ? Bi(t.on) : ra(t) ? { type: "click" } : void 0, t.clear = t.clear === !1 ? void 0 : t.clear === !0 || t.clear == null ? { type: "dblclick" } : Bi(t.clear), ra(t) && t.on.type === "click" && t.toggle === void 0 && (t.toggle = !0), t;
2671
+ return t.on = t.on ? Li(t.on) : ca(t) ? { type: "click" } : void 0, t.clear = t.clear === !1 ? void 0 : t.clear === !0 || t.clear == null ? { type: "dblclick" } : Li(t.clear), ca(t) && t.on.type === "click" && t.toggle === void 0 && (t.toggle = !0), t;
2440
2672
  }
2441
- function ra(e) {
2673
+ function ca(e) {
2442
2674
  return e && e.type == "point";
2443
2675
  }
2444
- function ia(e) {
2445
- return e && e.type == "interval";
2446
- }
2447
- function aa(e) {
2448
- if (ea(e)) return e.uniqueId != null;
2449
- if (ta(e)) return e.data.size > 0;
2450
- if ($i(e)) return oa(e);
2451
- throw Error(`Unsupported selection type: ${e.type}`);
2452
- }
2453
- function oa(e) {
2454
- return Object.values(e.intervals).some((e) => e && e.length === 2);
2455
- }
2456
- function sa(e, t) {
2457
- return Object.entries(e.intervals).every(([e, n]) => (e == "x" || e == "y") && n && n[0] <= t[e] && n[1] >= t[e]);
2458
- }
2459
- //#endregion
2460
- //#region ../core/src/ruler/rulerValue.js
2461
- function ca(e = ["x"], t = {}) {
2462
- let n = {};
2463
- for (let r of e) n[r] = t[r] ?? null;
2464
- return {
2465
- type: "ruler",
2466
- values: n
2467
- };
2468
- }
2469
- //#endregion
2470
- //#region ../core/src/paramRuntime/paramUtils.js
2471
- function W(e) {
2472
- return typeof e == "object" && !!e && "expr" in e && b(e.expr);
2473
- }
2474
2676
  function la(e) {
2475
- if (W(e)) throw Error("ExprRef " + JSON.stringify(e) + " not allowed here. Expected a scalar value.");
2476
- return e;
2477
- }
2478
- function ua(e) {
2479
- return ("expr" in e || "bind" in e) && !("select" in e) && !("ruler" in e);
2480
- }
2481
- function da(e) {
2482
- return !("expr" in e || "bind" in e) && "select" in e;
2483
- }
2484
- function fa(e) {
2485
- return !("expr" in e || "bind" in e || "select" in e) && "ruler" in e;
2486
- }
2487
- function pa(e) {
2488
- if (!/^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(e)) throw Error("Invalid parameter name: " + e + ". Must be a valid JavaScript identifier.");
2489
- return e;
2490
- }
2491
- function ma(e, t, n) {
2492
- if ("select" in e) {
2493
- let t = na(e.select);
2494
- if (ra(t)) return t.toggle ? Wi() : Ui(null);
2495
- if (ia(t)) {
2496
- if (!t.encodings) throw Error("Interval selection \"" + e.name + "\" must have encodings defined!");
2497
- return qi(t.encodings);
2498
- }
2499
- throw Error("Unknown selection config for parameter \"" + e.name + "\".");
2500
- }
2501
- if ("ruler" in e) return ca(e.ruler.encodings, e.value);
2502
- if ("expr" in e) {
2503
- let r = n ?? t?.createExpression(e.expr);
2504
- if (!r) throw Error("Cannot evaluate expression for parameter \"" + e.name + "\".");
2505
- return r(null);
2506
- }
2507
- return "value" in e ? e.value : null;
2508
- }
2509
- function ha(e, t, n, r, i = []) {
2510
- let a = { ...t }, o = [];
2511
- for (let [r, i] of Object.entries(t)) if (W(i)) {
2512
- let t = e.createExpression(i.expr), s = o.push({
2513
- key: r,
2514
- fn: t
2515
- }) - 1;
2516
- Object.defineProperty(a, r, {
2517
- enumerable: !0,
2518
- get: n ? () => c.get()[s] : () => t(null)
2519
- });
2520
- } else a[r] = i;
2521
- if (!n) return a;
2522
- for (let { key: t, expr: n } of i) o.push({
2523
- key: t,
2524
- fn: e.createExpression(n.expr)
2525
- });
2526
- if (!o.length) return a;
2527
- let s = Array.from(new Set(o.flatMap(({ fn: e }) => e.dependencies))), c = e.computed("expression properties", s, () => o.map(({ fn: e }) => e(null)), { equals: ga }), l = c.get(), u = e.effect([c], () => {
2528
- let e = c.get(), t = new Set(o.filter((t, n) => l[n] !== e[n]).map(({ key: e }) => e));
2529
- l = e, n(t);
2530
- });
2531
- return r?.(c.dispose), r?.(u), a;
2532
- }
2533
- function ga(e, t) {
2534
- return e.every((e, n) => e === t[n]);
2535
- }
2536
- function _a(e, t, n, r) {
2537
- if (!W(t)) return t;
2538
- let i = () => {
2539
- throw Error(n);
2540
- }, a = e.watchExpression ? e.watchExpression(t.expr, i, {
2541
- scopeOwned: !1,
2542
- registerDisposer: r
2543
- }) : e.createExpression(t.expr);
2544
- if (!e.watchExpression) {
2545
- let e = a.subscribe(i);
2546
- r?.(e);
2547
- }
2548
- return a();
2549
- }
2550
- function va(e) {
2551
- return Object.assign(() => e, {
2552
- dependencies: [],
2553
- subscribe: () => () => void 0,
2554
- invalidate: () => void 0,
2555
- identifier: () => "constant",
2556
- fields: [],
2557
- globals: [],
2558
- code: JSON.stringify(e)
2559
- });
2560
- }
2561
- //#endregion
2562
- //#region ../../node_modules/d3-color/src/define.js
2563
- function ya(e, t, n) {
2564
- e.prototype = t.prototype = n, n.constructor = e;
2565
- }
2566
- function ba(e, t) {
2567
- var n = Object.create(e.prototype);
2568
- for (var r in t) n[r] = t[r];
2569
- return n;
2570
- }
2571
- //#endregion
2572
- //#region ../../node_modules/d3-color/src/color.js
2573
- function G() {}
2574
- var K = .7, xa = 1 / K, q = "\\s*([+-]?\\d+)\\s*", Sa = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*", J = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*", Ca = /^#([0-9a-f]{3,8})$/, wa = RegExp(`^rgb\\(${q},${q},${q}\\)$`), Ta = RegExp(`^rgb\\(${J},${J},${J}\\)$`), Ea = RegExp(`^rgba\\(${q},${q},${q},${Sa}\\)$`), Da = RegExp(`^rgba\\(${J},${J},${J},${Sa}\\)$`), Oa = RegExp(`^hsl\\(${Sa},${J},${J}\\)$`), ka = RegExp(`^hsla\\(${Sa},${J},${J},${Sa}\\)$`), Aa = {
2575
- aliceblue: 15792383,
2576
- antiquewhite: 16444375,
2577
- aqua: 65535,
2578
- aquamarine: 8388564,
2579
- azure: 15794175,
2580
- beige: 16119260,
2581
- bisque: 16770244,
2582
- black: 0,
2583
- blanchedalmond: 16772045,
2584
- blue: 255,
2585
- blueviolet: 9055202,
2586
- brown: 10824234,
2587
- burlywood: 14596231,
2588
- cadetblue: 6266528,
2589
- chartreuse: 8388352,
2590
- chocolate: 13789470,
2591
- coral: 16744272,
2592
- cornflowerblue: 6591981,
2593
- cornsilk: 16775388,
2594
- crimson: 14423100,
2595
- cyan: 65535,
2596
- darkblue: 139,
2597
- darkcyan: 35723,
2598
- darkgoldenrod: 12092939,
2599
- darkgray: 11119017,
2600
- darkgreen: 25600,
2601
- darkgrey: 11119017,
2602
- darkkhaki: 12433259,
2603
- darkmagenta: 9109643,
2604
- darkolivegreen: 5597999,
2605
- darkorange: 16747520,
2606
- darkorchid: 10040012,
2607
- darkred: 9109504,
2608
- darksalmon: 15308410,
2609
- darkseagreen: 9419919,
2610
- darkslateblue: 4734347,
2611
- darkslategray: 3100495,
2612
- darkslategrey: 3100495,
2613
- darkturquoise: 52945,
2614
- darkviolet: 9699539,
2615
- deeppink: 16716947,
2616
- deepskyblue: 49151,
2617
- dimgray: 6908265,
2618
- dimgrey: 6908265,
2619
- dodgerblue: 2003199,
2620
- firebrick: 11674146,
2621
- floralwhite: 16775920,
2622
- forestgreen: 2263842,
2623
- fuchsia: 16711935,
2624
- gainsboro: 14474460,
2625
- ghostwhite: 16316671,
2626
- gold: 16766720,
2627
- goldenrod: 14329120,
2628
- gray: 8421504,
2629
- green: 32768,
2630
- greenyellow: 11403055,
2631
- grey: 8421504,
2632
- honeydew: 15794160,
2633
- hotpink: 16738740,
2634
- indianred: 13458524,
2635
- indigo: 4915330,
2636
- ivory: 16777200,
2637
- khaki: 15787660,
2638
- lavender: 15132410,
2639
- lavenderblush: 16773365,
2640
- lawngreen: 8190976,
2641
- lemonchiffon: 16775885,
2642
- lightblue: 11393254,
2643
- lightcoral: 15761536,
2644
- lightcyan: 14745599,
2645
- lightgoldenrodyellow: 16448210,
2646
- lightgray: 13882323,
2647
- lightgreen: 9498256,
2648
- lightgrey: 13882323,
2649
- lightpink: 16758465,
2650
- lightsalmon: 16752762,
2651
- lightseagreen: 2142890,
2652
- lightskyblue: 8900346,
2653
- lightslategray: 7833753,
2654
- lightslategrey: 7833753,
2655
- lightsteelblue: 11584734,
2656
- lightyellow: 16777184,
2657
- lime: 65280,
2658
- limegreen: 3329330,
2659
- linen: 16445670,
2660
- magenta: 16711935,
2661
- maroon: 8388608,
2662
- mediumaquamarine: 6737322,
2663
- mediumblue: 205,
2664
- mediumorchid: 12211667,
2665
- mediumpurple: 9662683,
2666
- mediumseagreen: 3978097,
2667
- mediumslateblue: 8087790,
2668
- mediumspringgreen: 64154,
2669
- mediumturquoise: 4772300,
2670
- mediumvioletred: 13047173,
2671
- midnightblue: 1644912,
2672
- mintcream: 16121850,
2673
- mistyrose: 16770273,
2674
- moccasin: 16770229,
2675
- navajowhite: 16768685,
2676
- navy: 128,
2677
- oldlace: 16643558,
2678
- olive: 8421376,
2679
- olivedrab: 7048739,
2680
- orange: 16753920,
2681
- orangered: 16729344,
2682
- orchid: 14315734,
2683
- palegoldenrod: 15657130,
2684
- palegreen: 10025880,
2685
- paleturquoise: 11529966,
2686
- palevioletred: 14381203,
2687
- papayawhip: 16773077,
2688
- peachpuff: 16767673,
2689
- peru: 13468991,
2690
- pink: 16761035,
2691
- plum: 14524637,
2692
- powderblue: 11591910,
2693
- purple: 8388736,
2694
- rebeccapurple: 6697881,
2695
- red: 16711680,
2696
- rosybrown: 12357519,
2697
- royalblue: 4286945,
2698
- saddlebrown: 9127187,
2699
- salmon: 16416882,
2700
- sandybrown: 16032864,
2701
- seagreen: 3050327,
2702
- seashell: 16774638,
2703
- sienna: 10506797,
2704
- silver: 12632256,
2705
- skyblue: 8900331,
2706
- slateblue: 6970061,
2707
- slategray: 7372944,
2708
- slategrey: 7372944,
2709
- snow: 16775930,
2710
- springgreen: 65407,
2711
- steelblue: 4620980,
2712
- tan: 13808780,
2713
- teal: 32896,
2714
- thistle: 14204888,
2715
- tomato: 16737095,
2716
- turquoise: 4251856,
2717
- violet: 15631086,
2718
- wheat: 16113331,
2719
- white: 16777215,
2720
- whitesmoke: 16119285,
2721
- yellow: 16776960,
2722
- yellowgreen: 10145074
2723
- };
2724
- ya(G, Fa, {
2725
- copy(e) {
2726
- return Object.assign(new this.constructor(), this, e);
2727
- },
2728
- displayable() {
2729
- return this.rgb().displayable();
2730
- },
2731
- hex: ja,
2732
- formatHex: ja,
2733
- formatHex8: Ma,
2734
- formatHsl: Na,
2735
- formatRgb: Pa,
2736
- toString: Pa
2737
- });
2738
- function ja() {
2739
- return this.rgb().formatHex();
2677
+ return e && e.type == "interval";
2740
2678
  }
2741
- function Ma() {
2742
- return this.rgb().formatHex8();
2679
+ function ua(e) {
2680
+ if (aa(e)) return e.uniqueId != null;
2681
+ if (oa(e)) return e.data.size > 0;
2682
+ if (ia(e)) return da(e);
2683
+ throw Error(`Unsupported selection type: ${e.type}`);
2743
2684
  }
2744
- function Na() {
2745
- return Ga(this).formatHsl();
2685
+ function da(e) {
2686
+ return Object.values(e.intervals).some((e) => e && e.length === 2);
2746
2687
  }
2747
- function Pa() {
2748
- return this.rgb().formatRgb();
2688
+ //#endregion
2689
+ //#region ../core/src/encoder/accessor.js
2690
+ function fa(e, t, n) {
2691
+ if (!e) throw Error("Cannot create an accessor without a channel.");
2692
+ function r(n) {
2693
+ let r = n;
2694
+ return r.fields ??= [], r.constant = r.fields.length === 0, r.channelDef = t, r.channel = e, r.sourceKey = ha(t), r.scaleChannel = ((ja(t) && t.resolutionChannel) ?? (to(e) && e)) || void 0, r.scaleChannel !== void 0 && (r.domainKeyBase = ga({
2695
+ scaleChannel: r.scaleChannel,
2696
+ source: ma(t)
2697
+ }).domainKeyBase), r.equals = (e) => e ? r === e || r.sourceKey !== void 0 && r.sourceKey === e.sourceKey : !1, r.asNumberAccessor = () => r, r;
2698
+ }
2699
+ function i(e) {
2700
+ if (M(e)) {
2701
+ let t = r(n.createExpression(e));
2702
+ if (t.fields.length > 0) throw Error("Expression in DatumDef/ValueDef cannot access data fields: " + e.expr);
2703
+ return t;
2704
+ }
2705
+ {
2706
+ let t = e;
2707
+ return r(() => t);
2708
+ }
2709
+ }
2710
+ if (ka(t)) try {
2711
+ return r(en(t.field, void 0, n?.getSpecLocation?.(t, ["field"])));
2712
+ } catch (e) {
2713
+ throw Error(`Invalid field definition: ${e.message}`, { cause: e });
2714
+ }
2715
+ if (Ia(t)) return r(n.createExpression(t));
2716
+ if (Aa(t)) return i(t.datum);
2717
+ if (Oa(t)) return i(t.value);
2718
+ throw Error(`Invalid channel definition: "${e}": ${JSON.stringify(t)}! The channel definition must contain one of the following properties: "field", "datum", "value" or "expr".`);
2719
+ }
2720
+ function pa(e) {
2721
+ return e.scaleChannel !== void 0;
2722
+ }
2723
+ function ma(e) {
2724
+ if (ka(e)) return {
2725
+ kind: "field",
2726
+ value: e.field
2727
+ };
2728
+ if (Ia(e)) return {
2729
+ kind: "expr",
2730
+ value: e.expr
2731
+ };
2732
+ if (Aa(e)) return {
2733
+ kind: "datum",
2734
+ value: e.datum
2735
+ };
2736
+ if (Oa(e)) return {
2737
+ kind: "value",
2738
+ value: e.value
2739
+ };
2740
+ throw Error("Cannot derive a domain key from channel definition: " + JSON.stringify(e));
2741
+ }
2742
+ function ha(e) {
2743
+ let t = ma(e);
2744
+ return t.kind === "datum" || t.kind === "value" ? "constant|" + ya(t.value) : t.kind + "|" + va(t);
2745
+ }
2746
+ function ga({ scaleChannel: e, source: t, type: n }) {
2747
+ if (!e) throw Error("Cannot build a domain key without a scale channel.");
2748
+ let r = e + "|" + t.kind + "|" + va(t);
2749
+ return {
2750
+ domainKeyBase: r,
2751
+ domainKey: n ? n + "|" + r : void 0
2752
+ };
2753
+ }
2754
+ function _a(e, t) {
2755
+ let { domainKey: n, domainKeyBase: r } = ga({
2756
+ scaleChannel: e.scaleChannel,
2757
+ source: ma(e.channelDef),
2758
+ type: t
2759
+ });
2760
+ if (!n) throw Error("Cannot finalize a domain key without a resolved type.");
2761
+ return e.domainKeyBase = r, e.domainKey = n, n;
2762
+ }
2763
+ function va(e) {
2764
+ switch (e.kind) {
2765
+ case "field":
2766
+ case "expr": return e.value;
2767
+ case "datum":
2768
+ case "value": return ya(e.value);
2769
+ default: throw Error("Unknown domain key source.");
2770
+ }
2771
+ }
2772
+ function ya(e) {
2773
+ return M(e) ? "expr:" + e.expr : e === void 0 ? "undefined" : JSON.stringify(e);
2774
+ }
2775
+ //#endregion
2776
+ //#region ../core/src/encoder/encoder.js
2777
+ function ba(e, t, n, r = "intersects", i) {
2778
+ let a, o, s = Ui(e), c = () => (a ??= Ki(e, t, n, r, i), a);
2779
+ return s.every((e) => n.findValue(e)) && c(), Object.defineProperty((e) => !s.some((e) => !n.findValue(e)) && (o ??= qi(c(), (e) => n.findValue(e)), o(e)), "selection", { get: c });
2780
+ }
2781
+ function xa(e, t, n, r, i = "intersects", a) {
2782
+ let o = La(t) || Ra(t) ? Array.isArray(t.condition) ? t.condition : [t.condition] : [], s = [...o, t], c = s.map((t, c) => {
2783
+ let l = o[c], u = fa(e, t, r);
2784
+ if ($a(e) && Oa(t)) {
2785
+ let e = t.value;
2786
+ if (e !== null && !M(e) && (typeof e != "string" || !Ze(e))) throw Zt(/* @__PURE__ */ Error("Invalid color: " + JSON.stringify(e)), r.getSpecLocation?.(t, ["value"]));
2787
+ }
2788
+ let d = l ? ta(l) : void 0;
2789
+ return {
2790
+ accessor: u,
2791
+ predicate: d ? ba(d, n, r, i, a) : Yt(c === s.length - 1)
2792
+ };
2793
+ });
2794
+ if (c.filter((e) => !e.accessor.constant).length > 1) throw Error("Only one accessor can be non-constant. Channel: " + e);
2795
+ return c;
2796
+ }
2797
+ function Sa(e, t) {
2798
+ let n = {}, r = (t) => e.getScaleResolution(t)?.getScale(), i = (t, n) => {
2799
+ let r = e.getScaleResolution(t);
2800
+ e.paramRuntime.operation("encoder scale", [r.getMappingRef()], () => r.getScale(), n);
2801
+ };
2802
+ for (let [a, o] of Object.entries(t)) {
2803
+ if (!o) continue;
2804
+ let s = a;
2805
+ Ca(s) || (n[s] = Ea(xa(s, o, t, e.paramRuntime, e.mark.defaultHitTestMode, (t) => e.getScaleResolution(t)?.type), r, i));
2806
+ }
2807
+ return n;
2808
+ }
2809
+ function Ca(e) {
2810
+ return e === "key" || e === "search" || e === "tooltip" || e === "order";
2811
+ }
2812
+ function wa(e) {
2813
+ return e.branches.map((e) => e.accessor);
2814
+ }
2815
+ function Ta(e) {
2816
+ return e.branches.find((e) => !e.accessor.constant)?.accessor;
2817
+ }
2818
+ function Ea(e, t, n) {
2819
+ if (e.length === 1) {
2820
+ let r = Da(e[0].accessor, t, n);
2821
+ return Object.assign(r, { branches: e });
2822
+ }
2823
+ let r = e.map((e) => e.predicate), i = e.map((e) => Da(e.accessor, t, n)), a = Object.assign((e) => {
2824
+ for (let t = 0; t < i.length; t++) if (r[t](e)) return i[t](e);
2825
+ }, {
2826
+ constant: !1,
2827
+ branches: e,
2828
+ channelDef: e.at(-1).accessor.channelDef
2829
+ });
2830
+ return Object.defineProperty(a, "scale", {
2831
+ enumerable: !0,
2832
+ get: () => i.find((e) => e.scale)?.scale
2833
+ });
2834
+ }
2835
+ function Da(e, t, n) {
2836
+ let { channel: r, scaleChannel: i, channelDef: a } = e, o = e.scaleChannel ? t(i) : void 0;
2837
+ if (i && !o) throw Error(`Missing scale! "${r}": ${JSON.stringify(a)}`);
2838
+ let s = Object.assign(o ? (t) => o(e(t)) : (t) => e(t), {
2839
+ scale: o,
2840
+ constant: e.constant,
2841
+ branches: [{
2842
+ accessor: e,
2843
+ predicate: Yt(!0)
2844
+ }],
2845
+ channelDef: a
2846
+ });
2847
+ return o && n?.(i, (e) => {
2848
+ o = e, s.scale = e;
2849
+ }), s;
2850
+ }
2851
+ function Oa(e) {
2852
+ return e && "value" in e;
2853
+ }
2854
+ function ka(e) {
2855
+ return e && "field" in e;
2856
+ }
2857
+ function Aa(e) {
2858
+ return e && "datum" in e;
2859
+ }
2860
+ function ja(e) {
2861
+ return ka(e) || Aa(e) || Ia(e) || Fa(e);
2862
+ }
2863
+ function Ma(e) {
2864
+ if (Ra(e)) {
2865
+ let t = e.condition;
2866
+ return (Array.isArray(t) ? t : [t]).find((e) => ja(e));
2867
+ }
2868
+ if (ja(e)) return e;
2869
+ }
2870
+ function Na(e) {
2871
+ let t = e && Ma(e);
2872
+ return t != null && t.type != "quantitative" && t.scale !== null;
2873
+ }
2874
+ function Pa(e, t) {
2875
+ let n = e.mark.encoding[t];
2876
+ if (Array.isArray(n)) throw Error("Not a channel def with scale!");
2877
+ {
2878
+ let e = Ma(n);
2879
+ if (e) return e;
2880
+ }
2881
+ throw Error("Not a channel def with scale!");
2749
2882
  }
2750
2883
  function Fa(e) {
2751
- var t, n;
2752
- return e = (e + "").trim().toLowerCase(), (t = Ca.exec(e)) ? (n = t[1].length, t = parseInt(t[1], 16), n === 6 ? Ia(t) : n === 3 ? new Y(t >> 8 & 15 | t >> 4 & 240, t >> 4 & 15 | t & 240, (t & 15) << 4 | t & 15, 1) : n === 8 ? La(t >> 24 & 255, t >> 16 & 255, t >> 8 & 255, (t & 255) / 255) : n === 4 ? La(t >> 12 & 15 | t >> 8 & 240, t >> 8 & 15 | t >> 4 & 240, t >> 4 & 15 | t & 240, ((t & 15) << 4 | t & 15) / 255) : null) : (t = wa.exec(e)) ? new Y(t[1], t[2], t[3], 1) : (t = Ta.exec(e)) ? new Y(t[1] * 255 / 100, t[2] * 255 / 100, t[3] * 255 / 100, 1) : (t = Ea.exec(e)) ? La(t[1], t[2], t[3], t[4]) : (t = Da.exec(e)) ? La(t[1] * 255 / 100, t[2] * 255 / 100, t[3] * 255 / 100, t[4]) : (t = Oa.exec(e)) ? Wa(t[1], t[2] / 100, t[3] / 100, 1) : (t = ka.exec(e)) ? Wa(t[1], t[2] / 100, t[3] / 100, t[4]) : Aa.hasOwnProperty(e) ? Ia(Aa[e]) : e === "transparent" ? new Y(NaN, NaN, NaN, 0) : null;
2884
+ return e && "chrom" in e;
2753
2885
  }
2754
2886
  function Ia(e) {
2755
- return new Y(e >> 16 & 255, e >> 8 & 255, e & 255, 1);
2887
+ return e && "expr" in e;
2756
2888
  }
2757
- function La(e, t, n, r) {
2758
- return r <= 0 && (e = t = n = NaN), new Y(e, t, n, r);
2889
+ function La(e) {
2890
+ return (ka(e) || Aa(e)) && "condition" in e;
2759
2891
  }
2760
2892
  function Ra(e) {
2761
- return e instanceof G || (e = Fa(e)), e ? (e = e.rgb(), new Y(e.r, e.g, e.b, e.opacity)) : new Y();
2762
- }
2763
- function za(e, t, n, r) {
2764
- return arguments.length === 1 ? Ra(e) : new Y(e, t, n, r ?? 1);
2893
+ return Oa(e) && "condition" in e;
2765
2894
  }
2766
- function Y(e, t, n, r) {
2767
- this.r = +e, this.g = +t, this.b = +n, this.opacity = +r;
2895
+ var za = ["x", "y"], Ba = ["x2", "y2"], Va = ["xOffset", "yOffset"], Ha = [...za, ...Ba];
2896
+ function Ua(e) {
2897
+ return za.includes(e);
2768
2898
  }
2769
- ya(Y, za, ba(G, {
2770
- brighter(e) {
2771
- return e = e == null ? xa : xa ** +e, new Y(this.r * e, this.g * e, this.b * e, this.opacity);
2772
- },
2773
- darker(e) {
2774
- return e = e == null ? K : K ** +e, new Y(this.r * e, this.g * e, this.b * e, this.opacity);
2775
- },
2776
- rgb() {
2777
- return this;
2778
- },
2779
- clamp() {
2780
- return new Y(X(this.r), X(this.g), X(this.b), Ua(this.opacity));
2781
- },
2782
- displayable() {
2783
- return -.5 <= this.r && this.r < 255.5 && -.5 <= this.g && this.g < 255.5 && -.5 <= this.b && this.b < 255.5 && 0 <= this.opacity && this.opacity <= 1;
2784
- },
2785
- hex: Ba,
2786
- formatHex: Ba,
2787
- formatHex8: Va,
2788
- formatRgb: Ha,
2789
- toString: Ha
2790
- }));
2791
- function Ba() {
2792
- return `#${Z(this.r)}${Z(this.g)}${Z(this.b)}`;
2899
+ function Wa(e) {
2900
+ return Ha.includes(e);
2793
2901
  }
2794
- function Va() {
2795
- return `#${Z(this.r)}${Z(this.g)}${Z(this.b)}${Z((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`;
2902
+ function Ga(e) {
2903
+ return Va.includes(e);
2796
2904
  }
2797
- function Ha() {
2798
- let e = Ua(this.opacity);
2799
- return `${e === 1 ? "rgb(" : "rgba("}${X(this.r)}, ${X(this.g)}, ${X(this.b)}${e === 1 ? ")" : `, ${e})`}`;
2905
+ function Ka(e) {
2906
+ return Qa(e) == "x" ? "xOffset" : "yOffset";
2800
2907
  }
2801
- function Ua(e) {
2802
- return isNaN(e) ? 1 : Math.max(0, Math.min(1, e));
2908
+ function qa(e, t, n) {
2909
+ return t ?? (n ? 0 : e);
2803
2910
  }
2804
- function X(e) {
2805
- return Math.max(0, Math.min(255, Math.round(e) || 0));
2911
+ var Ja = {
2912
+ x: "x2",
2913
+ y: "y2"
2914
+ }, Ya = Object.fromEntries([
2915
+ ...Object.entries(Ja),
2916
+ ["xOffset", "x2Offset"],
2917
+ ["yOffset", "y2Offset"]
2918
+ ].map((e) => [e[1], e[0]]));
2919
+ function Xa(e) {
2920
+ return e in Ya;
2806
2921
  }
2807
- function Z(e) {
2808
- return e = X(e), (e < 16 ? "0" : "") + e.toString(16);
2922
+ function Za(e) {
2923
+ let t = Ja[e];
2924
+ if (t) return t;
2925
+ throw Error(`${e} has no secondary channel!`);
2809
2926
  }
2810
- function Wa(e, t, n, r) {
2811
- return r <= 0 ? e = t = n = NaN : n <= 0 || n >= 1 ? e = t = NaN : t <= 0 && (e = NaN), new Q(e, t, n, r);
2927
+ function Qa(e) {
2928
+ return Ya[e] ?? e;
2812
2929
  }
2813
- function Ga(e) {
2814
- if (e instanceof Q) return new Q(e.h, e.s, e.l, e.opacity);
2815
- if (e instanceof G || (e = Fa(e)), !e) return new Q();
2816
- if (e instanceof Q) return e;
2817
- e = e.rgb();
2818
- var t = e.r / 255, n = e.g / 255, r = e.b / 255, i = Math.min(t, n, r), a = Math.max(t, n, r), o = NaN, s = a - i, c = (a + i) / 2;
2819
- return s ? (o = t === a ? (n - r) / s + (n < r) * 6 : n === a ? (r - t) / s + 2 : (t - n) / s + 4, s /= c < .5 ? a + i : 2 - a - i, o *= 60) : s = c > 0 && c < 1 ? 0 : o, new Q(o, s, c, e.opacity);
2930
+ function $a(e) {
2931
+ return [
2932
+ "color",
2933
+ "fill",
2934
+ "stroke"
2935
+ ].includes(Qa(e));
2820
2936
  }
2821
- function Ka(e, t, n, r) {
2822
- return arguments.length === 1 ? Ga(e) : new Q(e, t, n, r ?? 1);
2937
+ function eo(e) {
2938
+ return ["shape", "direction"].includes(e);
2823
2939
  }
2824
- function Q(e, t, n, r) {
2825
- this.h = +e, this.s = +t, this.l = +n, this.opacity = +r;
2940
+ function to(e) {
2941
+ return [
2942
+ "x",
2943
+ "y",
2944
+ "x2",
2945
+ "y2",
2946
+ "xOffset",
2947
+ "yOffset",
2948
+ "x2Offset",
2949
+ "y2Offset",
2950
+ "color",
2951
+ "fill",
2952
+ "stroke",
2953
+ "opacity",
2954
+ "fillOpacity",
2955
+ "strokeOpacity",
2956
+ "strokeWidth",
2957
+ "size",
2958
+ "shape",
2959
+ "direction",
2960
+ "angle",
2961
+ "dx",
2962
+ "dy",
2963
+ "sample"
2964
+ ].includes(e);
2826
2965
  }
2827
- ya(Q, Ka, ba(G, {
2828
- brighter(e) {
2829
- return e = e == null ? xa : xa ** +e, new Q(this.h, this.s, this.l * e, this.opacity);
2830
- },
2831
- darker(e) {
2832
- return e = e == null ? K : K ** +e, new Q(this.h, this.s, this.l * e, this.opacity);
2833
- },
2834
- rgb() {
2835
- var e = this.h % 360 + (this.h < 0) * 360, t = isNaN(e) || isNaN(this.s) ? 0 : this.s, n = this.l, r = n + (n < .5 ? n : 1 - n) * t, i = 2 * n - r;
2836
- return new Y(Ya(e >= 240 ? e - 240 : e + 120, i, r), Ya(e, i, r), Ya(e < 120 ? e + 240 : e - 120, i, r), this.opacity);
2837
- },
2838
- clamp() {
2839
- return new Q(qa(this.h), Ja(this.s), Ja(this.l), Ua(this.opacity));
2840
- },
2841
- displayable() {
2842
- return (0 <= this.s && this.s <= 1 || isNaN(this.s)) && 0 <= this.l && this.l <= 1 && 0 <= this.opacity && this.opacity <= 1;
2843
- },
2844
- formatHsl() {
2845
- let e = Ua(this.opacity);
2846
- return `${e === 1 ? "hsl(" : "hsla("}${qa(this.h)}, ${Ja(this.s) * 100}%, ${Ja(this.l) * 100}%${e === 1 ? ")" : `, ${e})`}`;
2966
+ function no(e) {
2967
+ switch (e) {
2968
+ case "shape": return [
2969
+ "circle",
2970
+ "square",
2971
+ "cross",
2972
+ "diamond",
2973
+ "triangle-up",
2974
+ "triangle-right",
2975
+ "triangle-down",
2976
+ "triangle-left",
2977
+ "tick-up",
2978
+ "tick-right",
2979
+ "tick-down",
2980
+ "tick-left",
2981
+ "x",
2982
+ "+"
2983
+ ];
2984
+ case "direction": return [
2985
+ "forward",
2986
+ "reverse",
2987
+ "both"
2988
+ ];
2847
2989
  }
2848
- }));
2849
- function qa(e) {
2850
- return e = (e || 0) % 360, e < 0 ? e + 360 : e;
2851
2990
  }
2852
- function Ja(e) {
2853
- return Math.max(0, Math.min(1, e || 0));
2991
+ function ro(e) {
2992
+ if (!eo(e)) throw Error("Not a discrete channel: " + e);
2993
+ let t = new Map(no(e).map((e, t) => [e, t]));
2994
+ return (n) => {
2995
+ let r = t.get(n);
2996
+ if (r !== void 0) return r;
2997
+ throw Error(`Invalid value for "${e}" channel: ${n}`);
2998
+ };
2854
2999
  }
2855
- function Ya(e, t, n) {
2856
- return (e < 60 ? t + (n - t) * e / 60 : e < 180 ? n : e < 240 ? t + (n - t) * (240 - e) / 60 : t) * 255;
3000
+ //#endregion
3001
+ //#region ../core/src/utils/specOrigin.js
3002
+ var io = /* @__PURE__ */ new WeakMap();
3003
+ function ao(e, t, n) {
3004
+ let r = io.get(e);
3005
+ return io.set(t, {
3006
+ source: r?.source ?? e,
3007
+ path: n ?? r?.path
3008
+ }), t;
3009
+ }
3010
+ function oo(e) {
3011
+ let t = structuredClone(e);
3012
+ function n(e, t) {
3013
+ if (e && typeof e == "object" && !io.has(t)) {
3014
+ ao(e, t);
3015
+ for (let r of Object.keys(e)) n(e[r], t[r]);
3016
+ }
3017
+ }
3018
+ return n(e, t), t;
3019
+ }
3020
+ function so(e, t, n) {
3021
+ if (!e || !t) return;
3022
+ let r = io.get(e), i = t(r?.source ?? e);
3023
+ return i === void 0 ? void 0 : {
3024
+ origin: i,
3025
+ path: r?.path ?? n
3026
+ };
2857
3027
  }
2858
3028
  //#endregion
2859
3029
  //#region ../core/src/view/renderingContext/clipOptions.js
2860
- function Xa(e) {
3030
+ function co(e) {
2861
3031
  if (e.clip) return e.clip;
2862
3032
  if (e.clipRect) return {
2863
3033
  rect: e.clipRect,
@@ -2865,59 +3035,53 @@ function Xa(e) {
2865
3035
  clipY: !0
2866
3036
  };
2867
3037
  }
2868
- function Za(e, t) {
3038
+ function lo(e, t) {
2869
3039
  return e === t ? !0 : !e || !t ? !1 : e.clipX === t.clipX && e.clipY === t.clipY && e.rect.equals(t.rect);
2870
3040
  }
2871
- function $(e, t, n) {
3041
+ function uo(e, t, n) {
2872
3042
  return t || n ? {
2873
3043
  rect: e,
2874
3044
  clipX: t,
2875
3045
  clipY: n
2876
3046
  } : void 0;
2877
3047
  }
2878
- function Qa(e, t) {
3048
+ function fo(e, t) {
2879
3049
  return t ? t.clipX && t.clipY ? e.intersect(t.rect) : t.clipX ? e.intersectX(t.rect) : t.clipY ? e.intersectY(t.rect) : e : e;
2880
3050
  }
2881
- function $a(e, t) {
3051
+ function po(e, t) {
2882
3052
  if (!e) return t;
2883
3053
  if (!t) return e;
2884
3054
  let n = e.clipX || t.clipX, r = e.clipY || t.clipY, i = e.clipX && t.clipX ? e.rect.intersectX(t.rect) : t.clipX ? t.rect : e.rect, a = e.clipY && t.clipY ? e.rect.intersectY(t.rect) : t.clipY ? t.rect : e.rect;
2885
- return $(e.rect.modify({
3055
+ return uo(e.rect.modify({
2886
3056
  x: () => i.x,
2887
3057
  y: () => a.y,
2888
3058
  width: () => i.width,
2889
3059
  height: () => a.height
2890
3060
  }), n, r);
2891
3061
  }
2892
- function eo(e, t) {
2893
- if (e === !0) return $(t, !0, !0);
2894
- if (e === "x") return $(t, !0, !1);
2895
- if (e === "y") return $(t, !1, !0);
3062
+ function mo(e, t) {
3063
+ if (e === !0) return uo(t, !0, !0);
3064
+ if (e === "x") return uo(t, !0, !1);
3065
+ if (e === "y") return uo(t, !1, !0);
2896
3066
  }
2897
- function to(e) {
2898
- let t = e.mark;
2899
- if (t) {
2900
- let e = t.properties.clip;
2901
- return {
2902
- clipX: e === !0 || e === "x",
2903
- clipY: e === !0 || e === "y"
2904
- };
2905
- }
2906
- let n = !1, r = !0, i = !0;
3067
+ function ho(e) {
3068
+ let t = !1, n = !0, r = !0, i = !1;
2907
3069
  return e.visit((e) => {
2908
- let t = e.mark;
2909
- if (t) {
2910
- n = !0;
2911
- let e = t.properties.clip;
2912
- r &&= e === !0 || e === "x", i &&= e === !0 || e === "y";
3070
+ let a = e.mark;
3071
+ if (a) {
3072
+ t = !0;
3073
+ let e = a.properties.clip;
3074
+ n &&= e === !0 || e === "x", r &&= e === !0 || e === "y", i ||= e === !0 || e === "x" || e === "y";
2913
3075
  }
2914
3076
  }), {
2915
- clipX: n && r,
2916
- clipY: n && i
3077
+ clipX: t && n,
3078
+ clipY: t && r,
3079
+ all: n && r,
3080
+ any: i
2917
3081
  };
2918
3082
  }
2919
- function no(e, t, n) {
2920
- if (t !== "never") return $a(e, eo(t, n));
3083
+ function go(e, t, n) {
3084
+ if (t !== "never") return po(e, mo(t, n));
2921
3085
  }
2922
3086
  //#endregion
2923
- export { Ti as $, Fe as $t, Qi as A, At, ra as B, ut as Bt, ua as C, oe as Cn, an as Ct, la as D, ln as Dt, pa as E, en as Et, Zi as F, Tt as Ft, Ki as G, ct as Gt, ea as H, mt as Ht, oa as I, yt as It, Bi as J, nt as Jt, sa as K, st as Kt, $i as L, vt as Lt, Wi as M, xt as Mt, Ui as N, Ct as Nt, ca as O, kt as Ot, Gi as P, St as Pt, Li as Q, Le as Qt, ia as R, x as Rt, da as S, v as Sn, on as St, _a as T, se as Tn, Gt as Tt, Yi as U, pt as Ut, aa as V, ft as Vt, Xi as W, ot as Wt, Hi as X, We as Xt, Vi as Y, rt as Yt, ki as Z, Be as Zt, ba as _, ie as _n, gn as _t, to as a, le as an, Yt as at, W as b, s as bn, Jt as bt, G as c, u as cn, Ht as ct, Fa as d, ye as dn, pn as dt, Ie as en, wi as et, K as f, d as fn, Kt as ft, ya as g, re as gn, C as gt, Ra as h, ne as hn, hn as ht, $ as i, t as in, qt as it, qi as j, wt as jt, na as k, Pt as kt, Y as l, ve as ln, cn as lt, za as m, xe as mn, Xt as mt, Za as n, Te as nn, zt as nt, Xa as o, fe as on, yn as ot, Ka as p, b as pn, _n as pt, Ji as q, at as qt, $a as r, Ce as rn, Lt as rt, no as s, o as sn, Vt as st, Qa as t, Pe as tn, Ci as tt, xa as u, ue as un, mn as ut, ha as v, f as vn, Zt as vt, va as w, y as wn, fn as wt, fa as x, we as xn, sn as xt, ma as y, Se as yn, S as yt, ta as z, ht as zt };
3087
+ export { ea as $, Le as $t, Ga as A, xe as An, Zt as At, sa as B, Wt as Bt, Fa as C, ve as Cn, N as Ct, Ia as D, f as Dn, rn as Dt, eo as E, te as En, an as Et, za as F, Ut as Ft, na as G, Rt as Gt, Qi as H, zt as Ht, qa as I, Ht as It, la as J, jt as Jt, da as K, Lt as Kt, fa as L, Vt as Lt, Ua as M, re as Mn, Kt as Mt, Xa as N, S as Nn, Gt as Nt, ka as O, ye as On, tn as Ot, Oa as P, ie as Pn, M as Pt, aa as Q, O as Qt, _a as R, Yt as Rt, to as S, C as Sn, ln as St, Aa as T, ee as Tn, nn as Tt, Xi as U, Pt as Ut, ra as V, Bt as Vt, Yi as W, It as Wt, ca as X, mt as Xt, oa as Y, vt as Yt, ua as Z, w as Zt, Ta as _, u as _n, bi as _t, ho as a, Fe as an, Ui as at, Za as b, ge as bn, hi as bt, oo as c, Me as cn, Li as ct, Sa as d, Se as dn, Bi as dt, Ze as en, ta as et, ba as f, be as fn, Ei as ft, wa as g, o as gn, xi as gt, ro as h, le as hn, gi as ht, uo as i, et as in, Vi as it, Wa as j, x as jn, Xt as jt, Na as k, s as kn, en as kt, so as l, Ne as ln, Ri as lt, Pa as m, oe as mn, Si as mt, lo as n, ct as nn, $i as nt, co as o, Ie as on, Hi as ot, Ma as p, t as pn, Pi as pt, ia as q, At as qt, po as r, tt as rn, Wi as rt, go as s, Pe as sn, Gi as st, fo as t, T as tn, Zi as tt, ao as u, je as un, zi as ut, Ka as v, he as vn, yi as vt, $a as w, b as wn, on as wt, ja as x, d as xn, mi as xt, Qa as y, se as yn, vi as yt, pa as z, Jt as zt };