@urban-toolkit/autk-grammar 0.1.2 → 0.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.
@@ -1,83 +1,126 @@
1
- import { NormalizationMode as De, createEngine as qe } from "@urban-toolkit/the-urban-grammar";
2
- import { ColorMapInterpolator as ga, NormalizationMode as ya } from "@urban-toolkit/the-urban-grammar";
3
- import { AutkDb as Ge, DEFAULT_WORKSPACE_COORDINATE_FORMAT as Te } from "@urban-toolkit/autk-db";
4
- import { AutkMap as Je, MapStyle as Ue, MapEvent as Xe } from "@urban-toolkit/autk-map";
5
- import { AutkPlot as We } from "@urban-toolkit/autk-plot";
6
- import { AutkComputeEngine as Ve } from "@urban-toolkit/autk-compute";
7
- function Ke(e, f) {
8
- function a(d, c) {
9
- if (!c || !c.db)
1
+ import { AutkDb as L, DEFAULT_WORKSPACE_COORDINATE_FORMAT as P } from "@urban-toolkit/autk-db";
2
+ import { AutkMap as T, MapEvent as b } from "@urban-toolkit/autk-map";
3
+ import { AutkPlot as I, PlotEvent as _ } from "@urban-toolkit/autk-plot";
4
+ import { ColorMapDomainStrategy as E } from "@urban-toolkit/autk-core";
5
+ import { AutkComputeEngine as v } from "@urban-toolkit/autk-compute";
6
+ function B(t) {
7
+ const { spec: a, adapters: e } = t;
8
+ let n;
9
+ async function s() {
10
+ let p;
11
+ if (a.data)
12
+ for (const r of a.data)
13
+ p = await e.db.resolveSource(p, r);
14
+ if (a.compute)
15
+ for (const r of a.compute)
16
+ p = await e.compute.resolveCompute(p, r);
17
+ if (a.map)
18
+ if (Array.isArray(a.map))
19
+ for (let r = 0; r < a.map.length; r++) {
20
+ let u = a.map[r];
21
+ await e.map.resolveMap(p, u, r);
22
+ }
23
+ else
24
+ await e.map.resolveMap(p, a.map);
25
+ if (a.plot)
26
+ if (Array.isArray(a.plot))
27
+ for (const r of a.plot)
28
+ await e.plot.resolvePlot(p, r);
29
+ else
30
+ await e.plot.resolvePlot(p, a.plot);
31
+ n = p;
32
+ }
33
+ function o(p) {
34
+ return console.log("Spec to update", p), new Promise((r) => {
35
+ r();
36
+ });
37
+ }
38
+ function i() {
39
+ console.log("Function not implemented yet");
40
+ }
41
+ return { run: s, updatedSpec: o, destroy: i, get context() {
42
+ return n;
43
+ } };
44
+ }
45
+ var N = /* @__PURE__ */ ((t) => (t.CAT_ACCENT = "schemeAccent", t.CAT_DARK2 = "schemeDark2", t.CAT_CATEGORY10 = "schemeCategory10", t.CAT_OBSERVABLE10 = "schemeObservable10", t.CAT_PAIRED = "schemePaired", t.CAT_PASTEL1 = "schemePastel1", t.CAT_PASTEL2 = "schemePastel2", t.CAT_SET1 = "schemeSet1", t.CAT_SET2 = "schemeSet2", t.CAT_SET3 = "schemeSet3", t.CAT_TABLEAU10 = "schemeTableau10", t.SEQ_REDS = "interpolateReds", t.SEQ_BLUES = "interpolateBlues", t.SEQ_GREENS = "interpolateGreens", t.SEQ_GREYS = "interpolateGreys", t.SEQ_ORANGES = "interpolateOranges", t.SEQ_PURPLES = "interpolatePurples", t.SEQ_TURBO = "interpolateTurbo", t.SEQ_VIRIDIS = "interpolateViridis", t.SEQ_INFERNO = "interpolateInferno", t.SEQ_MAGMA = "interpolateMagma", t.SEQ_PLASMA = "interpolatePlasma", t.SEQ_CIVIDIS = "interpolateCividis", t.SEQ_WARM = "interpolateWarm", t.SEQ_COOL = "interpolateCool", t.SEQ_BU_GN = "interpolateBuGn", t.SEQ_BU_PU = "interpolateBuPu", t.SEQ_GN_BU = "interpolateGnBu", t.SEQ_OR_RD = "interpolateOrRd", t.SEQ_PU_BU = "interpolatePuBu", t.SEQ_PU_RD = "interpolatePuRd", t.SEQ_RD_PU = "interpolateRdPu", t.SEQ_YL_GN = "interpolateYlGn", t.SEQ_YL_OR_BR = "interpolateYlOrBr", t.SEQ_YL_OR_RD = "interpolateYlOrRd", t.DIV_BR_BG = "interpolateBrBG", t.DIV_PR_GN = "interpolatePRGn", t.DIV_PI_YG = "interpolatePiYG", t.DIV_PU_OR = "interpolatePuOr", t.DIV_RED_BLUE = "interpolateRdBu", t.DIV_RED_GREY = "interpolateRdGy", t.DIV_RED_YELLOW_BLUE = "interpolateRdYlBu", t.DIV_RED_YELLOW_GREEN = "interpolateRdYlGn", t.DIV_SPECTRAL = "interpolateSpectral", t))(N || {}), M = /* @__PURE__ */ ((t) => (t.MIN_MAX = "minMax", t.PERCENTILE = "percentile", t))(M || {});
46
+ function G(t) {
47
+ const { autoLoadLayers: a, ...e } = t;
48
+ return { ...e, autoLoadLayers: { layers: a?.layers ?? [] } };
49
+ }
50
+ function D(t, a) {
51
+ function e(n, s) {
52
+ if (!s || !s.db)
10
53
  return;
11
- const t = document.getElementById(c.db);
12
- if (t) {
13
- const n = d.tables;
14
- t.innerHTML += "<ul>";
15
- for (const r of n)
16
- t.innerHTML += `<li>${r.name}: (${r.source}, ${r.type}) </li>`;
17
- t.innerHTML += "</ul>", t.innerHTML += `<p>Number of tables: ${n.length}</p>`;
54
+ const o = document.getElementById(s.db);
55
+ if (o) {
56
+ const i = n.getTablesMetadata();
57
+ o.innerHTML += "<ul>";
58
+ for (const p of i)
59
+ o.innerHTML += `<li>${p.name}: (${p.source}, ${p.type}) </li>`;
60
+ o.innerHTML += "</ul>", o.innerHTML += `<p>Number of tables: ${i.length}</p>`;
18
61
  }
19
62
  }
20
63
  return {
21
- async resolveSource(d, c) {
22
- let t = d;
23
- t || (t = new Ge(), await t.init());
24
- let { type: n, ...r } = c;
25
- switch (n) {
64
+ async resolveSource(n, s) {
65
+ let o = n;
66
+ o || (o = new L(), await o.init());
67
+ let { type: i, ...p } = s;
68
+ switch (i) {
26
69
  case "osm":
27
- return await t.loadOsm(r), a(t, e), t;
70
+ return await o.loadOsm(G(p)), e(o, t), o;
28
71
  case "csv":
29
- return await t.loadCsv(r), a(t, e), t;
72
+ return await o.loadCsv(p), e(o, t), o;
30
73
  case "json":
31
- return await t.loadJson(r), a(t, e), t;
74
+ return await o.loadJson(p), e(o, t), o;
32
75
  case "geojson": {
33
- const b = r;
34
- let l;
35
- b.geojsonFileUrl ? l = await (await fetch(b.geojsonFileUrl)).json() : l = b.geojsonObject, f && l && f.set(b.outputTableName, l);
36
- const u = l ? (() => {
37
- const i = { ...b, geojsonObject: l };
38
- return delete i.geojsonFileUrl, i;
39
- })() : b;
76
+ const r = p;
77
+ let u;
78
+ r.geojsonFileUrl ? u = await (await fetch(r.geojsonFileUrl)).json() : u = r.geojsonObject, a && u && a.set(r.outputTableName, u);
79
+ const c = u ? (() => {
80
+ const l = { ...r, geojsonObject: u };
81
+ return delete l.geojsonFileUrl, l;
82
+ })() : r;
40
83
  try {
41
- await t.loadGeojson(u);
42
- } catch (i) {
43
- const p = u.coordinateFormat ? `coordinateFormat is set to "${u.coordinateFormat}"` : "no coordinateFormat was specified — defaulting to EPSG:4326 (WGS84 per RFC 7946)";
84
+ await o.loadGeojson(c);
85
+ } catch (l) {
86
+ const m = c.coordinateFormat ? `coordinateFormat is set to "${c.coordinateFormat}"` : "no coordinateFormat was specified — defaulting to EPSG:4326 (WGS84 per RFC 7946)";
44
87
  throw new Error(
45
- `Failed to load GeoJSON layer "${u.outputTableName}": ${i instanceof Error ? i.message : String(i)}. ${p}. Verify that coordinateFormat matches the actual CRS of the input data.`
88
+ `Failed to load GeoJSON layer "${c.outputTableName}": ${l instanceof Error ? l.message : String(l)}. ${m}. Verify that coordinateFormat matches the actual CRS of the input data.`
46
89
  );
47
90
  }
48
91
  try {
49
- const i = await t.getBoundingBoxFromLayer(u.outputTableName), p = 25e6;
50
- if (!isFinite(i.minLon) || !isFinite(i.minLat) || !isFinite(i.maxLon) || !isFinite(i.maxLat) || Math.abs(i.minLon) > p || Math.abs(i.maxLon) > p || Math.abs(i.minLat) > p || Math.abs(i.maxLat) > p)
92
+ const l = await o.getBoundingBoxFromLayer(c.outputTableName), m = 25e6;
93
+ if (!isFinite(l.minLon) || !isFinite(l.minLat) || !isFinite(l.maxLon) || !isFinite(l.maxLat) || Math.abs(l.minLon) > m || Math.abs(l.maxLon) > m || Math.abs(l.minLat) > m || Math.abs(l.maxLat) > m)
51
94
  throw new Error(
52
- `Geometry bounding box after transform is invalid for layer "${u.outputTableName}" (bbox: [${i.minLon}, ${i.minLat}, ${i.maxLon}, ${i.maxLat}]). Verify that coordinateFormat matches the actual CRS of the input data. The workspace uses ${Te}; input is expected in EPSG:4326 by default.`
95
+ `Geometry bounding box after transform is invalid for layer "${c.outputTableName}" (bbox: [${l.minLon}, ${l.minLat}, ${l.maxLon}, ${l.maxLat}]). Verify that coordinateFormat matches the actual CRS of the input data. The workspace uses ${P}; input is expected in EPSG:4326 by default.`
53
96
  );
54
- } catch (i) {
55
- if (i instanceof Error && i.message.includes("bounding box after transform")) throw i;
97
+ } catch (l) {
98
+ if (l instanceof Error && l.message.includes("bounding box after transform")) throw l;
56
99
  }
57
- return a(t, e), t;
100
+ return e(o, t), o;
58
101
  }
59
102
  case "heatmap": {
60
- const b = r;
61
- return await t.buildHeatmap({
62
- tableJoinName: b.tableJoinName,
63
- near: { distance: b.near.distance },
64
- outputTableName: b.outputTableName,
65
- grid: b.grid,
66
- ...b.groupBy && { groupBy: b.groupBy }
67
- }), a(t, e), t;
103
+ const r = p;
104
+ return await o.buildHeatmap({
105
+ tableJoinName: r.tableJoinName,
106
+ near: { distance: r.near.distance },
107
+ outputTableName: r.outputTableName,
108
+ grid: r.grid,
109
+ ...r.groupBy && { groupBy: r.groupBy }
110
+ }), e(o, t), o;
68
111
  }
69
112
  case "join": {
70
- const b = r;
71
- if (await t.spatialQuery({
72
- tableRootName: b.tableRootName,
73
- tableJoinName: b.tableJoinName,
74
- ...b.near && { near: b.near },
75
- ...b.groupBy && { groupBy: b.groupBy }
76
- }), f) {
77
- const l = await t.getLayer(b.tableRootName);
78
- f.set(b.tableRootName, l);
113
+ const r = p;
114
+ if (await o.spatialQuery({
115
+ tableRootName: r.tableRootName,
116
+ tableJoinName: r.tableJoinName,
117
+ ...r.near && { near: r.near },
118
+ ...r.groupBy && { groupBy: r.groupBy }
119
+ }), a) {
120
+ const u = await o.getLayer(r.tableRootName);
121
+ a.set(r.tableRootName, u);
79
122
  }
80
- return a(t, e), t;
123
+ return e(o, t), o;
81
124
  }
82
125
  default:
83
126
  return;
@@ -85,1060 +128,85 @@ function Ke(e, f) {
85
128
  }
86
129
  };
87
130
  }
88
- var W = /* @__PURE__ */ (function(e) {
89
- return e.USER = "user", e.MIN_MAX = "minMax", e.PERCENTILE = "percentile", e;
90
- })({});
91
- function fe(e, f, a) {
92
- e.prototype = f.prototype = a, a.constructor = e;
93
- }
94
- function be(e, f) {
95
- var a = Object.create(e.prototype);
96
- for (var d in f) a[d] = f[d];
97
- return a;
98
- }
99
- function z() {
100
- }
101
- var F = 0.7, B = 1 / F, H = "\\s*([+-]?\\d+)\\s*", D = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*", k = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*", Qe = /^#([0-9a-f]{3,8})$/, Ze = RegExp(`^rgb\\(${H},${H},${H}\\)$`), Ye = RegExp(`^rgb\\(${k},${k},${k}\\)$`), ef = RegExp(`^rgba\\(${H},${H},${H},${D}\\)$`), ff = RegExp(`^rgba\\(${k},${k},${k},${D}\\)$`), af = RegExp(`^hsl\\(${D},${k},${k}\\)$`), df = RegExp(`^hsla\\(${D},${k},${k},${D}\\)$`), me = {
102
- aliceblue: 15792383,
103
- antiquewhite: 16444375,
104
- aqua: 65535,
105
- aquamarine: 8388564,
106
- azure: 15794175,
107
- beige: 16119260,
108
- bisque: 16770244,
109
- black: 0,
110
- blanchedalmond: 16772045,
111
- blue: 255,
112
- blueviolet: 9055202,
113
- brown: 10824234,
114
- burlywood: 14596231,
115
- cadetblue: 6266528,
116
- chartreuse: 8388352,
117
- chocolate: 13789470,
118
- coral: 16744272,
119
- cornflowerblue: 6591981,
120
- cornsilk: 16775388,
121
- crimson: 14423100,
122
- cyan: 65535,
123
- darkblue: 139,
124
- darkcyan: 35723,
125
- darkgoldenrod: 12092939,
126
- darkgray: 11119017,
127
- darkgreen: 25600,
128
- darkgrey: 11119017,
129
- darkkhaki: 12433259,
130
- darkmagenta: 9109643,
131
- darkolivegreen: 5597999,
132
- darkorange: 16747520,
133
- darkorchid: 10040012,
134
- darkred: 9109504,
135
- darksalmon: 15308410,
136
- darkseagreen: 9419919,
137
- darkslateblue: 4734347,
138
- darkslategray: 3100495,
139
- darkslategrey: 3100495,
140
- darkturquoise: 52945,
141
- darkviolet: 9699539,
142
- deeppink: 16716947,
143
- deepskyblue: 49151,
144
- dimgray: 6908265,
145
- dimgrey: 6908265,
146
- dodgerblue: 2003199,
147
- firebrick: 11674146,
148
- floralwhite: 16775920,
149
- forestgreen: 2263842,
150
- fuchsia: 16711935,
151
- gainsboro: 14474460,
152
- ghostwhite: 16316671,
153
- gold: 16766720,
154
- goldenrod: 14329120,
155
- gray: 8421504,
156
- green: 32768,
157
- greenyellow: 11403055,
158
- grey: 8421504,
159
- honeydew: 15794160,
160
- hotpink: 16738740,
161
- indianred: 13458524,
162
- indigo: 4915330,
163
- ivory: 16777200,
164
- khaki: 15787660,
165
- lavender: 15132410,
166
- lavenderblush: 16773365,
167
- lawngreen: 8190976,
168
- lemonchiffon: 16775885,
169
- lightblue: 11393254,
170
- lightcoral: 15761536,
171
- lightcyan: 14745599,
172
- lightgoldenrodyellow: 16448210,
173
- lightgray: 13882323,
174
- lightgreen: 9498256,
175
- lightgrey: 13882323,
176
- lightpink: 16758465,
177
- lightsalmon: 16752762,
178
- lightseagreen: 2142890,
179
- lightskyblue: 8900346,
180
- lightslategray: 7833753,
181
- lightslategrey: 7833753,
182
- lightsteelblue: 11584734,
183
- lightyellow: 16777184,
184
- lime: 65280,
185
- limegreen: 3329330,
186
- linen: 16445670,
187
- magenta: 16711935,
188
- maroon: 8388608,
189
- mediumaquamarine: 6737322,
190
- mediumblue: 205,
191
- mediumorchid: 12211667,
192
- mediumpurple: 9662683,
193
- mediumseagreen: 3978097,
194
- mediumslateblue: 8087790,
195
- mediumspringgreen: 64154,
196
- mediumturquoise: 4772300,
197
- mediumvioletred: 13047173,
198
- midnightblue: 1644912,
199
- mintcream: 16121850,
200
- mistyrose: 16770273,
201
- moccasin: 16770229,
202
- navajowhite: 16768685,
203
- navy: 128,
204
- oldlace: 16643558,
205
- olive: 8421376,
206
- olivedrab: 7048739,
207
- orange: 16753920,
208
- orangered: 16729344,
209
- orchid: 14315734,
210
- palegoldenrod: 15657130,
211
- palegreen: 10025880,
212
- paleturquoise: 11529966,
213
- palevioletred: 14381203,
214
- papayawhip: 16773077,
215
- peachpuff: 16767673,
216
- peru: 13468991,
217
- pink: 16761035,
218
- plum: 14524637,
219
- powderblue: 11591910,
220
- purple: 8388736,
221
- rebeccapurple: 6697881,
222
- red: 16711680,
223
- rosybrown: 12357519,
224
- royalblue: 4286945,
225
- saddlebrown: 9127187,
226
- salmon: 16416882,
227
- sandybrown: 16032864,
228
- seagreen: 3050327,
229
- seashell: 16774638,
230
- sienna: 10506797,
231
- silver: 12632256,
232
- skyblue: 8900331,
233
- slateblue: 6970061,
234
- slategray: 7372944,
235
- slategrey: 7372944,
236
- snow: 16775930,
237
- springgreen: 65407,
238
- steelblue: 4620980,
239
- tan: 13808780,
240
- teal: 32896,
241
- thistle: 14204888,
242
- tomato: 16737095,
243
- turquoise: 4251856,
244
- violet: 15631086,
245
- wheat: 16113331,
246
- white: 16777215,
247
- whitesmoke: 16119285,
248
- yellow: 16776960,
249
- yellowgreen: 10145074
250
- };
251
- fe(z, re, {
252
- copy(e) {
253
- return Object.assign(new this.constructor(), this, e);
254
- },
255
- displayable() {
256
- return this.rgb().displayable();
257
- },
258
- hex: ge,
259
- formatHex: ge,
260
- formatHex8: cf,
261
- formatHsl: tf,
262
- formatRgb: ye,
263
- toString: ye
264
- });
265
- function ge() {
266
- return this.rgb().formatHex();
267
- }
268
- function cf() {
269
- return this.rgb().formatHex8();
270
- }
271
- function tf() {
272
- return Fe(this).formatHsl();
273
- }
274
- function ye() {
275
- return this.rgb().formatRgb();
276
- }
277
- function re(e) {
278
- var f, a;
279
- return e = (e + "").trim().toLowerCase(), (f = Qe.exec(e)) ? (a = f[1].length, f = parseInt(f[1], 16), a === 6 ? ve(f) : a === 3 ? new m(f >> 8 & 15 | f >> 4 & 240, f >> 4 & 15 | f & 240, (f & 15) << 4 | f & 15, 1) : a === 8 ? V(f >> 24 & 255, f >> 16 & 255, f >> 8 & 255, (f & 255) / 255) : a === 4 ? V(f >> 12 & 15 | f >> 8 & 240, f >> 8 & 15 | f >> 4 & 240, f >> 4 & 15 | f & 240, ((f & 15) << 4 | f & 15) / 255) : null) : (f = Ze.exec(e)) ? new m(f[1], f[2], f[3], 1) : (f = Ye.exec(e)) ? new m(f[1] * 255 / 100, f[2] * 255 / 100, f[3] * 255 / 100, 1) : (f = ef.exec(e)) ? V(f[1], f[2], f[3], f[4]) : (f = ff.exec(e)) ? V(f[1] * 255 / 100, f[2] * 255 / 100, f[3] * 255 / 100, f[4]) : (f = af.exec(e)) ? Ne(f[1], f[2] / 100, f[3] / 100, 1) : (f = df.exec(e)) ? Ne(f[1], f[2] / 100, f[3] / 100, f[4]) : me.hasOwnProperty(e) ? ve(me[e]) : e === "transparent" ? new m(NaN, NaN, NaN, 0) : null;
280
- }
281
- function ve(e) {
282
- return new m(e >> 16 & 255, e >> 8 & 255, e & 255, 1);
283
- }
284
- function V(e, f, a, d) {
285
- return d <= 0 && (e = f = a = NaN), new m(e, f, a, d);
286
- }
287
- function je(e) {
288
- return e instanceof z || (e = re(e)), e ? (e = e.rgb(), new m(e.r, e.g, e.b, e.opacity)) : new m();
289
- }
290
- function q(e, f, a, d) {
291
- return arguments.length === 1 ? je(e) : new m(e, f, a, d ?? 1);
292
- }
293
- function m(e, f, a, d) {
294
- this.r = +e, this.g = +f, this.b = +a, this.opacity = +d;
295
- }
296
- fe(m, q, be(z, {
297
- brighter(e) {
298
- return e = e == null ? B : B ** +e, new m(this.r * e, this.g * e, this.b * e, this.opacity);
299
- },
300
- darker(e) {
301
- return e = e == null ? F : F ** +e, new m(this.r * e, this.g * e, this.b * e, this.opacity);
302
- },
303
- rgb() {
304
- return this;
305
- },
306
- clamp() {
307
- return new m(T(this.r), T(this.g), T(this.b), Z(this.opacity));
308
- },
309
- displayable() {
310
- return -0.5 <= this.r && this.r < 255.5 && -0.5 <= this.g && this.g < 255.5 && -0.5 <= this.b && this.b < 255.5 && 0 <= this.opacity && this.opacity <= 1;
311
- },
312
- hex: we,
313
- formatHex: we,
314
- formatHex8: bf,
315
- formatRgb: Me,
316
- toString: Me
317
- }));
318
- function we() {
319
- return `#${L(this.r)}${L(this.g)}${L(this.b)}`;
320
- }
321
- function bf() {
322
- return `#${L(this.r)}${L(this.g)}${L(this.b)}${L((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`;
323
- }
324
- function Me() {
325
- let e = Z(this.opacity);
326
- return `${e === 1 ? "rgb(" : "rgba("}${T(this.r)}, ${T(this.g)}, ${T(this.b)}${e === 1 ? ")" : `, ${e})`}`;
327
- }
328
- function Z(e) {
329
- return isNaN(e) ? 1 : Math.max(0, Math.min(1, e));
330
- }
331
- function T(e) {
332
- return Math.max(0, Math.min(255, Math.round(e) || 0));
333
- }
334
- function L(e) {
335
- return e = T(e), (e < 16 ? "0" : "") + e.toString(16);
336
- }
337
- function Ne(e, f, a, d) {
338
- return d <= 0 ? e = f = a = NaN : a <= 0 || a >= 1 ? e = f = NaN : f <= 0 && (e = NaN), new N(e, f, a, d);
339
- }
340
- function Fe(e) {
341
- if (e instanceof N) return new N(e.h, e.s, e.l, e.opacity);
342
- if (e instanceof z || (e = re(e)), !e) return new N();
343
- if (e instanceof N) return e;
344
- e = e.rgb();
345
- var f = e.r / 255, a = e.g / 255, d = e.b / 255, c = Math.min(f, a, d), t = Math.max(f, a, d), n = NaN, r = t - c, b = (t + c) / 2;
346
- return r ? (n = f === t ? (a - d) / r + (a < d) * 6 : a === t ? (d - f) / r + 2 : (f - a) / r + 4, r /= b < 0.5 ? t + c : 2 - t - c, n *= 60) : r = b > 0 && b < 1 ? 0 : n, new N(n, r, b, e.opacity);
347
- }
348
- function rf(e, f, a, d) {
349
- return arguments.length === 1 ? Fe(e) : new N(e, f, a, d ?? 1);
350
- }
351
- function N(e, f, a, d) {
352
- this.h = +e, this.s = +f, this.l = +a, this.opacity = +d;
353
- }
354
- fe(N, rf, be(z, {
355
- brighter(e) {
356
- return e = e == null ? B : B ** +e, new N(this.h, this.s, this.l * e, this.opacity);
357
- },
358
- darker(e) {
359
- return e = e == null ? F : F ** +e, new N(this.h, this.s, this.l * e, this.opacity);
360
- },
361
- rgb() {
362
- var e = this.h % 360 + (this.h < 0) * 360, f = isNaN(e) || isNaN(this.s) ? 0 : this.s, a = this.l, d = a + (a < 0.5 ? a : 1 - a) * f, c = 2 * a - d;
363
- return new m(ce(e >= 240 ? e - 240 : e + 120, c, d), ce(e, c, d), ce(e < 120 ? e + 240 : e - 120, c, d), this.opacity);
364
- },
365
- clamp() {
366
- return new N(xe(this.h), K(this.s), K(this.l), Z(this.opacity));
367
- },
368
- displayable() {
369
- return (0 <= this.s && this.s <= 1 || isNaN(this.s)) && 0 <= this.l && this.l <= 1 && 0 <= this.opacity && this.opacity <= 1;
370
- },
371
- formatHsl() {
372
- let e = Z(this.opacity);
373
- return `${e === 1 ? "hsl(" : "hsla("}${xe(this.h)}, ${K(this.s) * 100}%, ${K(this.l) * 100}%${e === 1 ? ")" : `, ${e})`}`;
374
- }
375
- }));
376
- function xe(e) {
377
- return e = (e || 0) % 360, e < 0 ? e + 360 : e;
378
- }
379
- function K(e) {
380
- return Math.max(0, Math.min(1, e || 0));
381
- }
382
- function ce(e, f, a) {
383
- return (e < 60 ? f + (a - f) * e / 60 : e < 180 ? a : e < 240 ? f + (a - f) * (240 - e) / 60 : f) * 255;
384
- }
385
- var nf = Math.PI / 180, of = 180 / Math.PI, Ie = -0.14861, ne = 1.78277, ie = -0.29227, ae = -0.90649, G = 1.97294, $e = G * ae, ke = G * ne, Ee = ne * ie - ae * Ie;
386
- function sf(e) {
387
- if (e instanceof j) return new j(e.h, e.s, e.l, e.opacity);
388
- e instanceof m || (e = je(e));
389
- var f = e.r / 255, a = e.g / 255, d = e.b / 255, c = (Ee * d + $e * f - ke * a) / (Ee + $e - ke), t = d - c, n = (G * (a - c) - ie * t) / ae, r = Math.sqrt(n * n + t * t) / (G * c * (1 - c)), b = r ? Math.atan2(n, t) * of - 120 : NaN;
390
- return new j(b < 0 ? b + 360 : b, r, c, e.opacity);
391
- }
392
- function E(e, f, a, d) {
393
- return arguments.length === 1 ? sf(e) : new j(e, f, a, d ?? 1);
394
- }
395
- function j(e, f, a, d) {
396
- this.h = +e, this.s = +f, this.l = +a, this.opacity = +d;
397
- }
398
- fe(j, E, be(z, {
399
- brighter(e) {
400
- return e = e == null ? B : B ** +e, new j(this.h, this.s, this.l * e, this.opacity);
401
- },
402
- darker(e) {
403
- return e = e == null ? F : F ** +e, new j(this.h, this.s, this.l * e, this.opacity);
404
- },
405
- rgb() {
406
- var e = isNaN(this.h) ? 0 : (this.h + 120) * nf, f = +this.l, a = isNaN(this.s) ? 0 : this.s * f * (1 - f), d = Math.cos(e), c = Math.sin(e);
407
- return new m(255 * (f + a * (Ie * d + ne * c)), 255 * (f + a * (ie * d + ae * c)), 255 * (f + G * d * a), this.opacity);
408
- }
409
- }));
410
- function lf(e) {
411
- return Math.abs(e = Math.round(e)) >= 1e21 ? e.toLocaleString("en").replace(/,/g, "") : e.toString(10);
412
- }
413
- function Y(e, f) {
414
- if (!isFinite(e) || e === 0) return null;
415
- var a = (e = f ? e.toExponential(f - 1) : e.toExponential()).indexOf("e"), d = e.slice(0, a);
416
- return [d.length > 1 ? d[0] + d.slice(2) : d, +e.slice(a + 1)];
417
- }
418
- function uf(e) {
419
- return e = Y(Math.abs(e)), e ? e[1] : NaN;
420
- }
421
- function hf(e, f) {
422
- return function(a, d) {
423
- for (var c = a.length, t = [], n = 0, r = e[0], b = 0; c > 0 && r > 0 && (b + r + 1 > d && (r = Math.max(1, d - b)), t.push(a.substring(c -= r, c + r)), !((b += r + 1) > d)); ) r = e[n = (n + 1) % e.length];
424
- return t.reverse().join(f);
425
- };
426
- }
427
- function pf(e) {
428
- return function(f) {
429
- return f.replace(/[0-9]/g, function(a) {
430
- return e[+a];
431
- });
432
- };
433
- }
434
- var mf = /^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;
435
- function te(e) {
436
- if (!(f = mf.exec(e))) throw Error("invalid format: " + e);
437
- var f;
438
- return new oe({
439
- fill: f[1],
440
- align: f[2],
441
- sign: f[3],
442
- symbol: f[4],
443
- zero: f[5],
444
- width: f[6],
445
- comma: f[7],
446
- precision: f[8] && f[8].slice(1),
447
- trim: f[9],
448
- type: f[10]
449
- });
450
- }
451
- te.prototype = oe.prototype;
452
- function oe(e) {
453
- 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 + "";
454
- }
455
- oe.prototype.toString = function() {
456
- 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;
457
- };
458
- function gf(e) {
459
- e: for (var f = e.length, a = 1, d = -1, c; a < f; ++a) switch (e[a]) {
460
- case ".":
461
- d = c = a;
462
- break;
463
- case "0":
464
- d === 0 && (d = a), c = a;
465
- break;
466
- default:
467
- if (!+e[a]) break e;
468
- d > 0 && (d = 0);
469
- break;
470
- }
471
- return d > 0 ? e.slice(0, d) + e.slice(c + 1) : e;
472
- }
473
- var ee;
474
- function yf(e, f) {
475
- var a = Y(e, f);
476
- if (!a) return ee = void 0, e.toPrecision(f);
477
- var d = a[0], c = a[1], t = c - (ee = Math.max(-8, Math.min(8, Math.floor(c / 3))) * 3) + 1, n = d.length;
478
- return t === n ? d : t > n ? d + Array(t - n + 1).join("0") : t > 0 ? d.slice(0, t) + "." + d.slice(t) : "0." + Array(1 - t).join("0") + Y(e, Math.max(0, f + t - 1))[0];
479
- }
480
- function Ae(e, f) {
481
- var a = Y(e, f);
482
- if (!a) return e + "";
483
- var d = a[0], c = a[1];
484
- return c < 0 ? "0." + Array(-c).join("0") + d : d.length > c + 1 ? d.slice(0, c + 1) + "." + d.slice(c + 1) : d + Array(c - d.length + 2).join("0");
485
- }
486
- var Re = {
487
- "%": (e, f) => (e * 100).toFixed(f),
488
- b: (e) => Math.round(e).toString(2),
489
- c: (e) => e + "",
490
- d: lf,
491
- e: (e, f) => e.toExponential(f),
492
- f: (e, f) => e.toFixed(f),
493
- g: (e, f) => e.toPrecision(f),
494
- o: (e) => Math.round(e).toString(8),
495
- p: (e, f) => Ae(e * 100, f),
496
- r: Ae,
497
- s: yf,
498
- X: (e) => Math.round(e).toString(16).toUpperCase(),
499
- x: (e) => Math.round(e).toString(16)
500
- };
501
- function Ce(e) {
502
- return e;
503
- }
504
- var Pe = Array.prototype.map, Se = [
505
- "y",
506
- "z",
507
- "a",
508
- "f",
509
- "p",
510
- "n",
511
- "µ",
512
- "m",
513
- "",
514
- "k",
515
- "M",
516
- "G",
517
- "T",
518
- "P",
519
- "E",
520
- "Z",
521
- "Y"
522
- ];
523
- function vf(e) {
524
- var f = e.grouping === void 0 || e.thousands === void 0 ? Ce : hf(Pe.call(e.grouping, Number), e.thousands + ""), a = e.currency === void 0 ? "" : e.currency[0] + "", d = e.currency === void 0 ? "" : e.currency[1] + "", c = e.decimal === void 0 ? "." : e.decimal + "", t = e.numerals === void 0 ? Ce : pf(Pe.call(e.numerals, String)), n = e.percent === void 0 ? "%" : e.percent + "", r = e.minus === void 0 ? "−" : e.minus + "", b = e.nan === void 0 ? "NaN" : e.nan + "";
525
- function l(i, p) {
526
- i = te(i);
527
- var y = i.fill, x = i.align, g = i.sign, R = i.symbol, C = i.zero, v = i.width, P = i.comma, $ = i.precision, I = i.trim, w = i.type;
528
- w === "n" ? (P = !0, w = "g") : Re[w] || ($ === void 0 && ($ = 12), I = !0, w = "g"), (C || y === "0" && x === "=") && (C = !0, y = "0", x = "=");
529
- var Oe = (p && p.prefix !== void 0 ? p.prefix : "") + (R === "$" ? a : R === "#" && /[boxX]/.test(w) ? "0" + w.toLowerCase() : ""), Be = (R === "$" ? d : /[%p]/.test(w) ? n : "") + (p && p.suffix !== void 0 ? p.suffix : ""), ue = Re[w], ze = /[defgprs%]/.test(w);
530
- $ = $ === void 0 ? 6 : /[gprs]/.test(w) ? Math.max(1, Math.min(21, $)) : Math.max(0, Math.min(20, $));
531
- function he(s) {
532
- var S = Oe, M = Be, _, pe, J;
533
- if (w === "c") M = ue(s) + M, s = "";
534
- else {
535
- s = +s;
536
- var U = s < 0 || 1 / s < 0;
537
- if (s = isNaN(s) ? b : ue(Math.abs(s), $), I && (s = gf(s)), U && +s == 0 && g !== "+" && (U = !1), S = (U ? g === "(" ? g : r : g === "-" || g === "(" ? "" : g) + S, M = (w === "s" && !isNaN(s) && ee !== void 0 ? Se[8 + ee / 3] : "") + M + (U && g === "(" ? ")" : ""), ze) {
538
- for (_ = -1, pe = s.length; ++_ < pe; ) if (J = s.charCodeAt(_), 48 > J || J > 57) {
539
- M = (J === 46 ? c + s.slice(_ + 1) : s.slice(_)) + M, s = s.slice(0, _);
540
- break;
541
- }
542
- }
543
- }
544
- P && !C && (s = f(s, 1 / 0));
545
- var X = S.length + s.length + M.length, A = X < v ? Array(v - X + 1).join(y) : "";
546
- switch (P && C && (s = f(A + s, A.length ? v - M.length : 1 / 0), A = ""), x) {
547
- case "<":
548
- s = S + s + M + A;
549
- break;
550
- case "=":
551
- s = S + A + s + M;
552
- break;
553
- case "^":
554
- s = A.slice(0, X = A.length >> 1) + S + s + M + A.slice(X);
555
- break;
556
- default:
557
- s = A + S + s + M;
558
- break;
559
- }
560
- return t(s);
561
- }
562
- return he.toString = function() {
563
- return i + "";
564
- }, he;
565
- }
566
- function u(i, p) {
567
- var y = Math.max(-8, Math.min(8, Math.floor(uf(p) / 3))) * 3, x = 10 ** -y, g = l((i = te(i), i.type = "f", i), { suffix: Se[8 + y / 3] });
568
- return function(R) {
569
- return g(x * R);
570
- };
571
- }
572
- return {
573
- format: l,
574
- formatPrefix: u
575
- };
576
- }
577
- var Q;
578
- wf({
579
- thousands: ",",
580
- grouping: [3],
581
- currency: ["$", ""]
582
- });
583
- function wf(e) {
584
- return Q = vf(e), Q.format, Q.formatPrefix, Q;
585
- }
586
- function Mf(e, f, a, d, c) {
587
- var t = e * e, n = t * e;
588
- return ((1 - 3 * e + 3 * t - n) * f + (4 - 6 * t + 3 * n) * a + (1 + 3 * e + 3 * t - 3 * n) * d + n * c) / 6;
589
- }
590
- function Nf(e) {
591
- var f = e.length - 1;
592
- return function(a) {
593
- var d = a <= 0 ? a = 0 : a >= 1 ? (a = 1, f - 1) : Math.floor(a * f), c = e[d], t = e[d + 1], n = d > 0 ? e[d - 1] : 2 * c - t, r = d < f - 1 ? e[d + 2] : 2 * t - c;
594
- return Mf((a - d / f) * f, n, c, t, r);
595
- };
596
- }
597
- var se = (e) => () => e;
598
- function _e(e, f) {
599
- return function(a) {
600
- return e + a * f;
601
- };
602
- }
603
- function xf(e, f, a) {
604
- return e **= +a, f = f ** +a - e, a = 1 / a, function(d) {
605
- return (e + d * f) ** +a;
606
- };
607
- }
608
- function $f(e, f) {
609
- var a = f - e;
610
- return a ? _e(e, a > 180 || a < -180 ? a - 360 * Math.round(a / 360) : a) : se(isNaN(e) ? f : e);
611
- }
612
- function kf(e) {
613
- return (e = +e) == 1 ? O : function(f, a) {
614
- return a - f ? xf(f, a, e) : se(isNaN(f) ? a : f);
615
- };
616
- }
617
- function O(e, f) {
618
- var a = f - e;
619
- return a ? _e(e, a) : se(isNaN(e) ? f : e);
620
- }
621
- (function e(f) {
622
- var a = kf(f);
623
- function d(c, t) {
624
- var n = a((c = q(c)).r, (t = q(t)).r), r = a(c.g, t.g), b = a(c.b, t.b), l = O(c.opacity, t.opacity);
625
- return function(u) {
626
- return c.r = n(u), c.g = r(u), c.b = b(u), c.opacity = l(u), c + "";
627
- };
628
- }
629
- return d.gamma = e, d;
630
- })(1);
631
- function Ef(e) {
632
- return function(f) {
633
- var a = f.length, d = Array(a), c = Array(a), t = Array(a), n, r;
634
- for (n = 0; n < a; ++n) r = q(f[n]), d[n] = r.r || 0, c[n] = r.g || 0, t[n] = r.b || 0;
635
- return d = e(d), c = e(c), t = e(t), r.opacity = 1, function(b) {
636
- return r.r = d(b), r.g = c(b), r.b = t(b), r + "";
637
- };
638
- };
639
- }
640
- var Af = Ef(Nf);
641
- function He(e) {
642
- return (function f(a) {
643
- a = +a;
644
- function d(c, t) {
645
- var n = e((c = E(c)).h, (t = E(t)).h), r = O(c.s, t.s), b = O(c.l, t.l), l = O(c.opacity, t.opacity);
646
- return function(u) {
647
- return c.h = n(u), c.s = r(u), c.l = b(u ** +a), c.opacity = l(u), c + "";
648
- };
649
- }
650
- return d.gamma = f, d;
651
- })(1);
652
- }
653
- He($f);
654
- var le = He(O);
655
- function o(e) {
656
- for (var f = e.length / 6 | 0, a = Array(f), d = 0; d < f; ) a[d] = "#" + e.slice(d * 6, ++d * 6);
657
- return a;
658
- }
659
- o("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf");
660
- o("7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666");
661
- o("1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666");
662
- o("4269d0efb118ff725c6cc5b03ca951ff8ab7a463f297bbf59c6b4e9498a0");
663
- o("a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928");
664
- o("fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2");
665
- o("b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc");
666
- o("e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999");
667
- o("66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3");
668
- o("8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f");
669
- o("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab");
670
- var h = (e) => Af(e[e.length - 1]), Rf = [
671
- ,
672
- ,
673
- ,
674
- "d8b365f5f5f55ab4ac",
675
- "a6611adfc27d80cdc1018571",
676
- "a6611adfc27df5f5f580cdc1018571",
677
- "8c510ad8b365f6e8c3c7eae55ab4ac01665e",
678
- "8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e",
679
- "8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e",
680
- "8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e",
681
- "5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30",
682
- "5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30"
683
- ].map(o);
684
- h(Rf);
685
- var Cf = [
686
- ,
687
- ,
688
- ,
689
- "af8dc3f7f7f77fbf7b",
690
- "7b3294c2a5cfa6dba0008837",
691
- "7b3294c2a5cff7f7f7a6dba0008837",
692
- "762a83af8dc3e7d4e8d9f0d37fbf7b1b7837",
693
- "762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837",
694
- "762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837",
695
- "762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837",
696
- "40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b",
697
- "40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b"
698
- ].map(o);
699
- h(Cf);
700
- var Pf = [
701
- ,
702
- ,
703
- ,
704
- "e9a3c9f7f7f7a1d76a",
705
- "d01c8bf1b6dab8e1864dac26",
706
- "d01c8bf1b6daf7f7f7b8e1864dac26",
707
- "c51b7de9a3c9fde0efe6f5d0a1d76a4d9221",
708
- "c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221",
709
- "c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221",
710
- "c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221",
711
- "8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419",
712
- "8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419"
713
- ].map(o);
714
- h(Pf);
715
- var Sf = [
716
- ,
717
- ,
718
- ,
719
- "998ec3f7f7f7f1a340",
720
- "5e3c99b2abd2fdb863e66101",
721
- "5e3c99b2abd2f7f7f7fdb863e66101",
722
- "542788998ec3d8daebfee0b6f1a340b35806",
723
- "542788998ec3d8daebf7f7f7fee0b6f1a340b35806",
724
- "5427888073acb2abd2d8daebfee0b6fdb863e08214b35806",
725
- "5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806",
726
- "2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08",
727
- "2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08"
728
- ].map(o);
729
- h(Sf);
730
- var Lf = [
731
- ,
732
- ,
733
- ,
734
- "ef8a62f7f7f767a9cf",
735
- "ca0020f4a58292c5de0571b0",
736
- "ca0020f4a582f7f7f792c5de0571b0",
737
- "b2182bef8a62fddbc7d1e5f067a9cf2166ac",
738
- "b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac",
739
- "b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac",
740
- "b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac",
741
- "67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061",
742
- "67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061"
743
- ].map(o);
744
- h(Lf);
745
- var Tf = [
746
- ,
747
- ,
748
- ,
749
- "ef8a62ffffff999999",
750
- "ca0020f4a582bababa404040",
751
- "ca0020f4a582ffffffbababa404040",
752
- "b2182bef8a62fddbc7e0e0e09999994d4d4d",
753
- "b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d",
754
- "b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d",
755
- "b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d",
756
- "67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a",
757
- "67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a"
758
- ].map(o);
759
- h(Tf);
760
- var jf = [
761
- ,
762
- ,
763
- ,
764
- "fc8d59ffffbf91bfdb",
765
- "d7191cfdae61abd9e92c7bb6",
766
- "d7191cfdae61ffffbfabd9e92c7bb6",
767
- "d73027fc8d59fee090e0f3f891bfdb4575b4",
768
- "d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4",
769
- "d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4",
770
- "d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4",
771
- "a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695",
772
- "a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695"
773
- ].map(o);
774
- h(jf);
775
- var Ff = [
776
- ,
777
- ,
778
- ,
779
- "fc8d59ffffbf91cf60",
780
- "d7191cfdae61a6d96a1a9641",
781
- "d7191cfdae61ffffbfa6d96a1a9641",
782
- "d73027fc8d59fee08bd9ef8b91cf601a9850",
783
- "d73027fc8d59fee08bffffbfd9ef8b91cf601a9850",
784
- "d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850",
785
- "d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850",
786
- "a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837",
787
- "a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837"
788
- ].map(o);
789
- h(Ff);
790
- var If = [
791
- ,
792
- ,
793
- ,
794
- "fc8d59ffffbf99d594",
795
- "d7191cfdae61abdda42b83ba",
796
- "d7191cfdae61ffffbfabdda42b83ba",
797
- "d53e4ffc8d59fee08be6f59899d5943288bd",
798
- "d53e4ffc8d59fee08bffffbfe6f59899d5943288bd",
799
- "d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd",
800
- "d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd",
801
- "9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2",
802
- "9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2"
803
- ].map(o);
804
- h(If);
805
- var _f = [
806
- ,
807
- ,
808
- ,
809
- "e5f5f999d8c92ca25f",
810
- "edf8fbb2e2e266c2a4238b45",
811
- "edf8fbb2e2e266c2a42ca25f006d2c",
812
- "edf8fbccece699d8c966c2a42ca25f006d2c",
813
- "edf8fbccece699d8c966c2a441ae76238b45005824",
814
- "f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824",
815
- "f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b"
816
- ].map(o);
817
- h(_f);
818
- var Hf = [
819
- ,
820
- ,
821
- ,
822
- "e0ecf49ebcda8856a7",
823
- "edf8fbb3cde38c96c688419d",
824
- "edf8fbb3cde38c96c68856a7810f7c",
825
- "edf8fbbfd3e69ebcda8c96c68856a7810f7c",
826
- "edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b",
827
- "f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b",
828
- "f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b"
829
- ].map(o);
830
- h(Hf);
831
- var Of = [
832
- ,
833
- ,
834
- ,
835
- "e0f3dba8ddb543a2ca",
836
- "f0f9e8bae4bc7bccc42b8cbe",
837
- "f0f9e8bae4bc7bccc443a2ca0868ac",
838
- "f0f9e8ccebc5a8ddb57bccc443a2ca0868ac",
839
- "f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e",
840
- "f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e",
841
- "f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081"
842
- ].map(o);
843
- h(Of);
844
- var Bf = [
845
- ,
846
- ,
847
- ,
848
- "fee8c8fdbb84e34a33",
849
- "fef0d9fdcc8afc8d59d7301f",
850
- "fef0d9fdcc8afc8d59e34a33b30000",
851
- "fef0d9fdd49efdbb84fc8d59e34a33b30000",
852
- "fef0d9fdd49efdbb84fc8d59ef6548d7301f990000",
853
- "fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000",
854
- "fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000"
855
- ].map(o);
856
- h(Bf);
857
- var zf = [
858
- ,
859
- ,
860
- ,
861
- "ece2f0a6bddb1c9099",
862
- "f6eff7bdc9e167a9cf02818a",
863
- "f6eff7bdc9e167a9cf1c9099016c59",
864
- "f6eff7d0d1e6a6bddb67a9cf1c9099016c59",
865
- "f6eff7d0d1e6a6bddb67a9cf3690c002818a016450",
866
- "fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450",
867
- "fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636"
868
- ].map(o);
869
- h(zf);
870
- var Df = [
871
- ,
872
- ,
873
- ,
874
- "ece7f2a6bddb2b8cbe",
875
- "f1eef6bdc9e174a9cf0570b0",
876
- "f1eef6bdc9e174a9cf2b8cbe045a8d",
877
- "f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d",
878
- "f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b",
879
- "fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b",
880
- "fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858"
881
- ].map(o);
882
- h(Df);
883
- var qf = [
884
- ,
885
- ,
886
- ,
887
- "e7e1efc994c7dd1c77",
888
- "f1eef6d7b5d8df65b0ce1256",
889
- "f1eef6d7b5d8df65b0dd1c77980043",
890
- "f1eef6d4b9dac994c7df65b0dd1c77980043",
891
- "f1eef6d4b9dac994c7df65b0e7298ace125691003f",
892
- "f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f",
893
- "f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f"
894
- ].map(o);
895
- h(qf);
896
- var Gf = [
897
- ,
898
- ,
899
- ,
900
- "fde0ddfa9fb5c51b8a",
901
- "feebe2fbb4b9f768a1ae017e",
902
- "feebe2fbb4b9f768a1c51b8a7a0177",
903
- "feebe2fcc5c0fa9fb5f768a1c51b8a7a0177",
904
- "feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177",
905
- "fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177",
906
- "fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a"
907
- ].map(o);
908
- h(Gf);
909
- var Jf = [
910
- ,
911
- ,
912
- ,
913
- "edf8b17fcdbb2c7fb8",
914
- "ffffcca1dab441b6c4225ea8",
915
- "ffffcca1dab441b6c42c7fb8253494",
916
- "ffffccc7e9b47fcdbb41b6c42c7fb8253494",
917
- "ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84",
918
- "ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84",
919
- "ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58"
920
- ].map(o);
921
- h(Jf);
922
- var Uf = [
923
- ,
924
- ,
925
- ,
926
- "f7fcb9addd8e31a354",
927
- "ffffccc2e69978c679238443",
928
- "ffffccc2e69978c67931a354006837",
929
- "ffffccd9f0a3addd8e78c67931a354006837",
930
- "ffffccd9f0a3addd8e78c67941ab5d238443005a32",
931
- "ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32",
932
- "ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529"
933
- ].map(o);
934
- h(Uf);
935
- var Xf = [
936
- ,
937
- ,
938
- ,
939
- "fff7bcfec44fd95f0e",
940
- "ffffd4fed98efe9929cc4c02",
941
- "ffffd4fed98efe9929d95f0e993404",
942
- "ffffd4fee391fec44ffe9929d95f0e993404",
943
- "ffffd4fee391fec44ffe9929ec7014cc4c028c2d04",
944
- "ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04",
945
- "ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506"
946
- ].map(o);
947
- h(Xf);
948
- var Wf = [
949
- ,
950
- ,
951
- ,
952
- "ffeda0feb24cf03b20",
953
- "ffffb2fecc5cfd8d3ce31a1c",
954
- "ffffb2fecc5cfd8d3cf03b20bd0026",
955
- "ffffb2fed976feb24cfd8d3cf03b20bd0026",
956
- "ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026",
957
- "ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026",
958
- "ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026"
959
- ].map(o);
960
- h(Wf);
961
- var Vf = [
962
- ,
963
- ,
964
- ,
965
- "deebf79ecae13182bd",
966
- "eff3ffbdd7e76baed62171b5",
967
- "eff3ffbdd7e76baed63182bd08519c",
968
- "eff3ffc6dbef9ecae16baed63182bd08519c",
969
- "eff3ffc6dbef9ecae16baed64292c62171b5084594",
970
- "f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594",
971
- "f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b"
972
- ].map(o);
973
- h(Vf);
974
- var Kf = [
975
- ,
976
- ,
977
- ,
978
- "e5f5e0a1d99b31a354",
979
- "edf8e9bae4b374c476238b45",
980
- "edf8e9bae4b374c47631a354006d2c",
981
- "edf8e9c7e9c0a1d99b74c47631a354006d2c",
982
- "edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32",
983
- "f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32",
984
- "f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b"
985
- ].map(o);
986
- h(Kf);
987
- var Qf = [
988
- ,
989
- ,
990
- ,
991
- "f0f0f0bdbdbd636363",
992
- "f7f7f7cccccc969696525252",
993
- "f7f7f7cccccc969696636363252525",
994
- "f7f7f7d9d9d9bdbdbd969696636363252525",
995
- "f7f7f7d9d9d9bdbdbd969696737373525252252525",
996
- "fffffff0f0f0d9d9d9bdbdbd969696737373525252252525",
997
- "fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000"
998
- ].map(o);
999
- h(Qf);
1000
- var Zf = [
1001
- ,
1002
- ,
1003
- ,
1004
- "efedf5bcbddc756bb1",
1005
- "f2f0f7cbc9e29e9ac86a51a3",
1006
- "f2f0f7cbc9e29e9ac8756bb154278f",
1007
- "f2f0f7dadaebbcbddc9e9ac8756bb154278f",
1008
- "f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486",
1009
- "fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486",
1010
- "fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d"
1011
- ].map(o);
1012
- h(Zf);
1013
- var Yf = [
1014
- ,
1015
- ,
1016
- ,
1017
- "fee0d2fc9272de2d26",
1018
- "fee5d9fcae91fb6a4acb181d",
1019
- "fee5d9fcae91fb6a4ade2d26a50f15",
1020
- "fee5d9fcbba1fc9272fb6a4ade2d26a50f15",
1021
- "fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d",
1022
- "fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d",
1023
- "fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d"
1024
- ].map(o);
1025
- h(Yf);
1026
- var ea = [
1027
- ,
1028
- ,
1029
- ,
1030
- "fee6cefdae6be6550d",
1031
- "feeddefdbe85fd8d3cd94701",
1032
- "feeddefdbe85fd8d3ce6550da63603",
1033
- "feeddefdd0a2fdae6bfd8d3ce6550da63603",
1034
- "feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04",
1035
- "fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04",
1036
- "fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704"
1037
- ].map(o);
1038
- h(ea);
1039
- le(E(300, 0.5, 0), E(-240, 0.5, 1));
1040
- le(E(-100, 0.75, 0.35), E(80, 1.5, 0.8));
1041
- le(E(260, 0.75, 0.35), E(80, 1.5, 0.8));
1042
- E();
1043
- q();
1044
- function de(e) {
1045
- var f = e.length;
1046
- return function(a) {
1047
- return e[Math.max(0, Math.min(f - 1, Math.floor(a * f)))];
1048
- };
1049
- }
1050
- de(o("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725"));
1051
- de(o("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf"));
1052
- de(o("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4"));
1053
- de(o("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921"));
1054
- var Le = typeof Float32Array < "u" ? Float32Array : Array;
1055
- function fa() {
1056
- var e = new Le(3);
1057
- return Le != Float32Array && (e[0] = 0, e[1] = 0, e[2] = 0), e;
1058
- }
1059
- (function() {
1060
- var e = fa();
1061
- return function(f, a, d, c, t, n) {
1062
- var r, b;
1063
- for (a ||= 3, d ||= 0, b = c ? Math.min(c * a + d, f.length) : f.length, r = d; r < b; r += a) e[0] = f[r], e[1] = f[r + 1], e[2] = f[r + 2], t(e, e, n), f[r] = e[0], f[r + 1] = e[1], f[r + 2] = e[2];
1064
- return f;
1065
- };
1066
- })();
1067
- function aa(e, f) {
1068
- return f && f.length > 0 ? { type: W.USER, params: f } : e?.mode === De.PERCENTILE ? e.lowerPercentile !== void 0 || e.upperPercentile !== void 0 ? {
1069
- type: W.PERCENTILE,
1070
- params: [e.lowerPercentile ?? 0, e.upperPercentile ?? 100]
1071
- } : { type: W.PERCENTILE } : { type: W.MIN_MAX };
1072
- }
1073
- function da(e, f) {
1074
- return f.split(".").reduce((a, d) => {
1075
- if (!(a == null || typeof a != "object"))
1076
- return a[d];
1077
- }, e);
1078
- }
1079
- function ca(e, f, a) {
1080
- const d = f.split("."), c = { ...e };
1081
- let t = c;
1082
- for (let n = 0; n < d.length - 1; n++)
1083
- t[d[n]] = { ...t[d[n]] ?? {} }, t = t[d[n]];
1084
- return t[d[d.length - 1]] = a, c;
1085
- }
1086
- function ta(e, f, a) {
1087
- async function d(c, t, n) {
1088
- let r = {};
1089
- for (const b of t.tables)
1090
- b.type !== void 0 && (r[b.name] = b.type);
1091
- for (const b of n.layerRefs) {
1092
- const l = b.dataRef, u = r[l], i = b.getFnv, p = a?.get(l) ?? await t.getLayer(l), y = {
1093
- ...p,
1094
- features: (p.features ?? []).filter((v) => v.geometry != null)
131
+ function O(t, a) {
132
+ return a && a.length > 0 ? { type: E.USER, params: a } : t?.mode === M.PERCENTILE ? t.lowerPercentile !== void 0 || t.upperPercentile !== void 0 ? {
133
+ type: E.PERCENTILE,
134
+ params: [t.lowerPercentile ?? 0, t.upperPercentile ?? 100]
135
+ } : { type: E.PERCENTILE } : { type: E.MIN_MAX };
136
+ }
137
+ function k(t, a) {
138
+ return a.split(".").reduce((e, n) => {
139
+ if (!(e == null || typeof e != "object"))
140
+ return e[n];
141
+ }, t);
142
+ }
143
+ function Q(t, a, e) {
144
+ const n = a.split("."), s = { ...t };
145
+ let o = s;
146
+ for (let i = 0; i < n.length - 1; i++)
147
+ o[n[i]] = { ...o[n[i]] ?? {} }, o = o[n[i]];
148
+ return o[n[n.length - 1]] = e, s;
149
+ }
150
+ function x(t, a) {
151
+ const n = t.features?.[0]?.properties?.bands ?? [];
152
+ return n.find((o) => o.id === a || o.label === a?.replace(/\./g, "_"))?.id ?? n[0]?.id ?? a ?? "";
153
+ }
154
+ function U(t, a, e) {
155
+ async function n(s, o, i) {
156
+ let p = {};
157
+ for (const r of o.getTablesMetadata())
158
+ r.type !== void 0 && (p[r.name] = r.type);
159
+ for (const r of i.layerRefs) {
160
+ const u = r.dataRef, c = p[u], l = r.getFnv, m = e?.get(u) ?? await o.getLayer(u), d = c === "raster" ? m : {
161
+ ...m,
162
+ features: (m.features ?? []).filter((f) => f.geometry != null)
1095
163
  };
1096
- u === "raster" ? c.loadCollection(l, { collection: y, type: "raster", property: i ?? "" }) : c.loadCollection(l, { collection: y, type: u }), b.opacity != null && c.updateRenderInfo(l, { opacity: b.opacity }), b.isColorMap && c.updateRenderInfo(l, { isColorMap: !0 }), b.isPick && c.updateRenderInfo(l, { isPick: !0 }), b.isSkip && c.updateRenderInfo(l, { isSkip: !0 });
1097
- const { catchAllCategory: x, colorMapDomain: g } = b;
1098
- let R = y, C = g;
1099
- if (i && x && g?.length) {
1100
- const v = new Set(g);
1101
- R = {
1102
- ...y,
1103
- features: y.features.map((P) => {
1104
- const $ = P.properties, I = da($, i);
1105
- return I == null || !v.has(String(I)) ? { ...P, properties: ca($, i, x) } : P;
164
+ c === "raster" ? s.loadCollection(u, { collection: d, type: "raster", property: x(d, l) }) : s.loadCollection(u, { collection: d, type: c }), r.opacity != null && s.updateRenderInfo(u, { opacity: r.opacity }), (r.isColorMap ?? (l != null && c !== "raster")) && s.updateRenderInfo(u, { isColorMap: !0 }), r.isPick && s.updateRenderInfo(u, { isPick: !0 }), r.isSkip && s.updateRenderInfo(u, { isSkip: !0 });
165
+ const { catchAllCategory: g, colorMapDomain: h } = r;
166
+ let S = d, A = h;
167
+ if (l && g && h?.length) {
168
+ const f = new Set(h);
169
+ S = {
170
+ ...d,
171
+ features: d.features.map((R) => {
172
+ const C = R.properties, y = k(C, l);
173
+ return y == null || !f.has(String(y)) ? { ...R, properties: Q(C, l, g) } : R;
1106
174
  })
1107
- }, C = v.has(x) ? g : [...g, x];
175
+ }, A = f.has(g) ? h : [...h, g];
1108
176
  }
1109
- if (b.colorMapInterpolator) {
1110
- const v = {
177
+ if (r.colorMapInterpolator) {
178
+ const f = {
1111
179
  // urban-grammar ColorMapInterpolator values are string-compatible
1112
180
  // with autk-core ColorMapInterpolator at runtime
1113
- interpolator: b.colorMapInterpolator,
1114
- domainSpec: aa(b.normalization, C)
181
+ interpolator: r.colorMapInterpolator,
182
+ domainSpec: O(r.normalization, A)
1115
183
  };
1116
- c.updateRenderInfo(l, { colormap: { config: v }, isColorMap: !0 });
184
+ s.updateRenderInfo(u, { colormap: { config: f }, isColorMap: !0 });
1117
185
  }
1118
- if (i && u !== "raster") {
1119
- const v = i.startsWith("properties.") ? i : `properties.${i}`;
1120
- c.updateThematic(l, { collection: R, property: v });
186
+ if (l && c !== "raster") {
187
+ const f = l.startsWith("properties.") ? l : `properties.${l}`;
188
+ s.updateThematic(u, { collection: S, property: f });
1121
189
  }
1122
190
  }
1123
191
  }
1124
192
  return {
1125
- async resolveMap(c, t, n = 0) {
1126
- if (e && e.map && c) {
1127
- let r;
1128
- if (Array.isArray(e.map) ? r = document.getElementById(e.map[n]) : r = document.getElementById(e.map), !r)
1129
- throw new Error("Could not find rendering target for map: " + e.map);
1130
- if (!(r instanceof HTMLCanvasElement))
1131
- throw new Error("Target for map is not a canvas: " + e.map);
1132
- const b = new Je(r);
1133
- if (t.style && Ue.setPredefinedStyle(t.style), await b.init(), await d(b, c, t), f)
1134
- for (const l of t.layerRefs)
1135
- f.set(l.dataRef, b);
1136
- b.draw();
193
+ async resolveMap(s, o, i = 0) {
194
+ if (t && t.map && s) {
195
+ let p;
196
+ if (Array.isArray(t.map) ? p = document.getElementById(t.map[i]) : p = document.getElementById(t.map), !p)
197
+ throw new Error("Could not find rendering target for map: " + t.map);
198
+ if (!(p instanceof HTMLCanvasElement))
199
+ throw new Error("Target for map is not a canvas: " + t.map);
200
+ const r = new T(p);
201
+ if (o.style && r.style.setPredefinedStyle(o.style), await r.init(), await n(r, s, o), a)
202
+ for (const u of o.layerRefs)
203
+ a.set(u.dataRef, r);
204
+ r.draw();
1137
205
  }
1138
206
  }
1139
207
  };
1140
208
  }
1141
- function ba(e) {
209
+ function F(t) {
1142
210
  return {
1143
211
  scatter: "scatterplot",
1144
212
  bar: "barchart",
@@ -1147,64 +215,76 @@ function ba(e) {
1147
215
  "parallel-coordinates": "parallel-coordinates",
1148
216
  table: "table",
1149
217
  heatmatrix: "heatmatrix"
1150
- }[e];
218
+ }[t];
1151
219
  }
1152
- function ra(e, f, a) {
220
+ function j(t, a, e, n, s) {
1153
221
  return {
1154
- async resolvePlot(d, c) {
1155
- if (!e || !e.plot) return;
1156
- const t = document.getElementById(e.plot);
1157
- if (!t) throw new Error(`Could not find plot target: ${e.plot}`);
1158
- const n = d;
1159
- if (!n) throw new Error("No data context available for plot.");
1160
- const r = a?.get(c.dataRef) ?? await n.getLayer(c.dataRef), b = c.events ?? [], l = new We(t, {
1161
- type: ba(c.mark),
1162
- collection: r,
1163
- attributes: { axis: c.axis, ...c.color && { color: c.color } },
1164
- labels: { axis: c.axis, title: c.title },
1165
- events: b,
1166
- ...c.width && { width: c.width },
1167
- ...c.height && { height: c.height },
1168
- ...c.margins && { margins: c.margins },
1169
- ...c.transform && { transform: c.transform }
222
+ async resolvePlot(o, i) {
223
+ if (!t || !t.plot) return;
224
+ const p = document.getElementById(t.plot);
225
+ if (!p) throw new Error(`Could not find plot target: ${t.plot}`);
226
+ const r = o;
227
+ if (!r) throw new Error("No data context available for plot.");
228
+ const u = s?.get(i.dataRef) ?? await r.getLayer(i.dataRef), c = i.events ?? [], l = new I(p, {
229
+ type: F(i.mark),
230
+ collection: u,
231
+ attributes: { axis: i.axis, ...i.color && { color: i.color } },
232
+ labels: { axis: i.axis, title: i.title },
233
+ events: c,
234
+ ...i.width && { width: i.width },
235
+ ...i.height && { height: i.height },
236
+ ...i.margins && { margins: i.margins },
237
+ ...i.transform && { transform: i.transform }
1170
238
  });
1171
- if (c.mapRef && f) {
1172
- const u = f.get(c.mapRef);
1173
- if (u) {
1174
- u.updateRenderInfo(c.mapRef, { isPick: !0 }), u.events.on(Xe.PICKING, ({ selection: i }) => {
1175
- l.setSelection(i);
239
+ if (e?.set(i.dataRef, l), i.mapRef && n?.set(i.dataRef, i.mapRef), i.mapRef && a) {
240
+ const m = a.get(i.mapRef);
241
+ if (m) {
242
+ m.updateRenderInfo(i.mapRef, { isPick: !0 }), m.events.on(b.PICKING, ({ selection: d }) => {
243
+ l.setSelection(d);
1176
244
  });
1177
- for (const i of b)
1178
- l.events.on(i, ({ selection: p }) => {
1179
- u.setHighlightedIds(c.mapRef, p);
245
+ for (const d of c)
246
+ l.events.on(d, ({ selection: w }) => {
247
+ m.setHighlightedIds(i.mapRef, w);
1180
248
  });
1181
249
  }
1182
250
  }
1183
251
  }
1184
252
  };
1185
253
  }
1186
- function na(e) {
254
+ function H(t) {
1187
255
  return {
1188
- async resolveCompute(f, a) {
1189
- if (f) {
1190
- const d = await f.getLayer(a.dataRef), t = await new Ve().gpgpuPipeline({
1191
- collection: d,
1192
- variableMapping: a.attributes,
1193
- wgslBody: a.wglsFunction,
1194
- ...a.outputColumnName && { resultField: a.outputColumnName },
1195
- ...a.outputColumns && { outputColumns: a.outputColumns },
1196
- ...a.attributeArrays && { attributeArrays: a.attributeArrays },
1197
- ...a.attributeMatrices && { attributeMatrices: a.attributeMatrices },
1198
- ...a.uniforms && { uniforms: a.uniforms },
1199
- ...a.uniformArrays && { uniformArrays: a.uniformArrays },
1200
- ...a.uniformMatrices && { uniformMatrices: a.uniformMatrices }
256
+ async resolveCompute(a, e) {
257
+ if (a) {
258
+ const n = await a.getLayer(e.dataRef), o = await new v().gpgpuPipeline({
259
+ collection: n,
260
+ variableMapping: e.attributes,
261
+ wgslBody: e.wglsFunction,
262
+ ...e.outputColumnName && { resultField: e.outputColumnName },
263
+ ...e.outputColumns && { outputColumns: e.outputColumns },
264
+ ...e.attributeArrays && { attributeArrays: e.attributeArrays },
265
+ ...e.attributeMatrices && { attributeMatrices: e.attributeMatrices },
266
+ ...e.uniforms && { uniforms: e.uniforms },
267
+ ...e.uniformArrays && { uniformArrays: e.uniformArrays },
268
+ ...e.uniformMatrices && { uniformMatrices: e.uniformMatrices }
1201
269
  });
1202
- return e && e.set(a.dataRef, t), f;
270
+ return t && t.set(e.dataRef, o), a;
1203
271
  }
1204
272
  }
1205
273
  };
1206
274
  }
1207
- class ha {
275
+ class V {
276
+ _listeners = /* @__PURE__ */ new Map();
277
+ on(a, e) {
278
+ this._listeners.has(a) || this._listeners.set(a, /* @__PURE__ */ new Set());
279
+ const n = this._listeners.get(a);
280
+ return n.add(e), () => n.delete(e);
281
+ }
282
+ /** @internal */
283
+ emit(a, e) {
284
+ this._listeners.get(a)?.forEach((n) => n(e));
285
+ }
286
+ }
287
+ class X {
1208
288
  dataAdapter;
1209
289
  mapAdapter;
1210
290
  plotAdapter;
@@ -1212,9 +292,14 @@ class ha {
1212
292
  grammarEngine;
1213
293
  _computeCache = /* @__PURE__ */ new Map();
1214
294
  _data = {};
1215
- constructor(f) {
1216
- const a = /* @__PURE__ */ new Map(), d = /* @__PURE__ */ new Map();
1217
- this.dataAdapter = Ke(f, d), this.mapAdapter = ta(f, a, this._computeCache), this.plotAdapter = ra(f, a, d), this.computeAdapter = na(this._computeCache);
295
+ _mapRegistry = /* @__PURE__ */ new Map();
296
+ _plotRegistry = /* @__PURE__ */ new Map();
297
+ _fwdCleanups = [];
298
+ _plotMapLinks = /* @__PURE__ */ new Map();
299
+ interactions = new V();
300
+ constructor(a) {
301
+ const e = /* @__PURE__ */ new Map();
302
+ this.dataAdapter = D(a, e), this.mapAdapter = U(a, this._mapRegistry, this._computeCache), this.plotAdapter = j(a, this._mapRegistry, this._plotRegistry, this._plotMapLinks, e), this.computeAdapter = H(this._computeCache);
1218
303
  }
1219
304
  /**
1220
305
  * The coordinate reference system used internally by the autk workspace.
@@ -1225,12 +310,12 @@ class ha {
1225
310
  * instead of hard-coding a CRS string.
1226
311
  */
1227
312
  get workspaceCrs() {
1228
- return Te;
313
+ return P;
1229
314
  }
1230
315
  get data() {
1231
316
  return this._data;
1232
317
  }
1233
- async run(f) {
318
+ async run(a) {
1234
319
  if (!this.dataAdapter)
1235
320
  throw new Error("Database adapter not initialized. Please call the constructor first.");
1236
321
  if (!this.mapAdapter)
@@ -1239,36 +324,98 @@ class ha {
1239
324
  throw new Error("Plot adapter not initialized. Please call the constructor first.");
1240
325
  if (!this.computeAdapter)
1241
326
  throw new Error("Compute adapter not initialized. Please call the constructor first.");
1242
- this.grammarEngine = qe({
1243
- spec: f,
327
+ this._mapRegistry.clear(), this._plotRegistry.clear(), this._plotMapLinks.clear(), this.grammarEngine = B({
328
+ spec: a,
1244
329
  adapters: {
1245
330
  db: this.dataAdapter,
1246
331
  map: this.mapAdapter,
1247
332
  plot: this.plotAdapter,
1248
333
  compute: this.computeAdapter
1249
334
  }
1250
- }), await this.grammarEngine.run();
1251
- const a = this.grammarEngine.context;
1252
- if (!a) {
335
+ }), await this.grammarEngine.run(), this._rewireInteractions();
336
+ const e = this.grammarEngine.context;
337
+ if (!e) {
1253
338
  console.warn("Grammar engine produced no data context."), this._data = {};
1254
339
  return;
1255
340
  }
1256
- const d = {};
1257
- for (const c of a.getLayerTables())
1258
- Object.defineProperty(d, c.name, {
341
+ const n = {};
342
+ for (const s of e.getLayersMetadata())
343
+ Object.defineProperty(n, s.name, {
1259
344
  get: () => {
1260
- const t = this._computeCache.get(c.name);
1261
- return t ? Promise.resolve(t) : a.getLayer(c.name);
345
+ const o = this._computeCache.get(s.name);
346
+ return o ? Promise.resolve(o) : e.getLayer(s.name);
1262
347
  },
1263
348
  enumerable: !0,
1264
349
  configurable: !0
1265
350
  });
1266
- this._data = d;
351
+ this._data = n;
352
+ }
353
+ /**
354
+ * Highlights features on the map layer identified by `layerId`.
355
+ * If that layer is linked to a plot via `mapRef`, the plot selection is updated too.
356
+ */
357
+ highlightOnMap(a, e) {
358
+ this._mapRegistry.get(a)?.setHighlightedIds(a, e);
359
+ for (const [n, s] of this._plotMapLinks)
360
+ s === a && this._plotRegistry.get(n)?.setSelection(e);
361
+ }
362
+ /**
363
+ * Clears highlighted features on the map layer identified by `layerId`.
364
+ * If that layer is linked to a plot via `mapRef`, the plot selection is cleared too.
365
+ */
366
+ clearHighlightOnMap(a) {
367
+ this._mapRegistry.get(a)?.clearHighlightedIds(a);
368
+ for (const [e, n] of this._plotMapLinks)
369
+ n === a && this._plotRegistry.get(e)?.setSelection([]);
370
+ }
371
+ /**
372
+ * Clears the selection on the plot identified by `plotId` (its dataRef).
373
+ * If that plot is linked to a map via `mapRef`, the map highlight is cleared too.
374
+ */
375
+ clearHighlightOnPlot(a) {
376
+ this._plotRegistry.get(a)?.setSelection([]);
377
+ const e = this._plotMapLinks.get(a);
378
+ e && this._mapRegistry.get(e)?.clearHighlightedIds(e);
379
+ }
380
+ /**
381
+ * Applies a selection to the plot identified by `plotId` (its dataRef).
382
+ * If that plot is linked to a map via `mapRef`, the map highlight is updated too.
383
+ */
384
+ setPlotSelection(a, e) {
385
+ this._plotRegistry.get(a)?.setSelection(e);
386
+ const n = this._plotMapLinks.get(a);
387
+ n && this._mapRegistry.get(n)?.setHighlightedIds(n, e);
388
+ }
389
+ _rewireInteractions() {
390
+ for (const e of this._fwdCleanups) e();
391
+ this._fwdCleanups = [];
392
+ const a = /* @__PURE__ */ new Set();
393
+ for (const [e, n] of this._mapRegistry) {
394
+ if (a.has(n)) continue;
395
+ a.add(n);
396
+ const s = ({ selection: o }) => {
397
+ this.interactions.emit("map:picking", { layerId: e, selection: o });
398
+ };
399
+ n.events.on(b.PICKING, s), this._fwdCleanups.push(() => n.events.off(b.PICKING, s));
400
+ }
401
+ for (const [e, n] of this._plotRegistry)
402
+ for (const s of [_.CLICK, _.BRUSH, _.BRUSH_X, _.BRUSH_Y]) {
403
+ const o = ({ selection: i }) => {
404
+ this.interactions.emit("plot:selection", {
405
+ plotId: e,
406
+ event: s,
407
+ selection: i
408
+ });
409
+ };
410
+ n.events.on(s, o), this._fwdCleanups.push(() => n.events.off(s, o));
411
+ }
1267
412
  }
1268
413
  }
1269
414
  export {
1270
- ha as AutkGrammar,
1271
- ga as ColorMapInterpolator,
1272
- ya as NormalizationMode
415
+ X as AutkGrammar,
416
+ N as ColorMapInterpolator,
417
+ V as GrammarEventEmitter,
418
+ M as NormalizationMode,
419
+ B as createEngine
1273
420
  };
1274
421
  //# sourceMappingURL=autk-grammar.js.map