@cloudflare/kumo 2.7.0 → 2.8.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 (62) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/ai/component-registry.json +1164 -149
  3. package/ai/component-registry.md +1325 -114
  4. package/ai/schemas.ts +136 -7
  5. package/dist/.build-complete +1 -1
  6. package/dist/ai/schemas.d.ts +259 -22
  7. package/dist/ai/schemas.d.ts.map +1 -1
  8. package/dist/ai/schemas.js +1515 -1298
  9. package/dist/ai/schemas.js.map +1 -1
  10. package/dist/chunks/Maps-imwfwgb7do9lr3i5.js +2448 -0
  11. package/dist/chunks/Maps-imwfwgb7do9lr3i5.js.map +1 -0
  12. package/dist/chunks/input-area-sg518xu4pyg4m0km.js +144 -0
  13. package/dist/chunks/input-area-sg518xu4pyg4m0km.js.map +1 -0
  14. package/dist/chunks/{sidebar-ctd980heycmxsux1.js → sidebar-7whsl7qwrw5b6ip8.js} +306 -306
  15. package/dist/chunks/sidebar-7whsl7qwrw5b6ip8.js.map +1 -0
  16. package/dist/components/chart.js +1 -1
  17. package/dist/components/flow.js +2306 -2350
  18. package/dist/components/flow.js.map +1 -1
  19. package/dist/components/input.js +1 -1
  20. package/dist/components/sidebar.js +1 -1
  21. package/dist/index.js +3 -3
  22. package/dist/src/components/chart/TimeseriesChart.d.ts +8 -0
  23. package/dist/src/components/chart/TimeseriesChart.d.ts.map +1 -1
  24. package/dist/src/components/chart/index.d.ts +1 -1
  25. package/dist/src/components/chart/index.d.ts.map +1 -1
  26. package/dist/src/components/chart/timeseries-markers.d.ts +107 -0
  27. package/dist/src/components/chart/timeseries-markers.d.ts.map +1 -0
  28. package/dist/src/components/chart/timeseries-thresholds.d.ts +61 -0
  29. package/dist/src/components/chart/timeseries-thresholds.d.ts.map +1 -0
  30. package/dist/src/components/chart/timeseries-tooltip.d.ts +28 -0
  31. package/dist/src/components/chart/timeseries-tooltip.d.ts.map +1 -0
  32. package/dist/src/components/flow/connectors.d.ts +18 -0
  33. package/dist/src/components/flow/connectors.d.ts.map +1 -1
  34. package/dist/src/components/flow/diagram.d.ts +48 -41
  35. package/dist/src/components/flow/diagram.d.ts.map +1 -1
  36. package/dist/src/components/flow/flow-layout.d.ts +77 -0
  37. package/dist/src/components/flow/flow-layout.d.ts.map +1 -0
  38. package/dist/src/components/flow/node.d.ts.map +1 -1
  39. package/dist/src/components/flow/parallel.d.ts +3 -7
  40. package/dist/src/components/flow/parallel.d.ts.map +1 -1
  41. package/dist/src/components/flow/use-children.d.ts +0 -60
  42. package/dist/src/components/flow/use-children.d.ts.map +1 -1
  43. package/dist/src/components/input/input-area.d.ts +18 -0
  44. package/dist/src/components/input/input-area.d.ts.map +1 -1
  45. package/dist/src/components/sidebar/sidebar.d.ts +2 -0
  46. package/dist/src/components/sidebar/sidebar.d.ts.map +1 -1
  47. package/dist/src/primitives/index.d.ts +1 -1
  48. package/dist/src/primitives/index.d.ts.map +1 -1
  49. package/dist/src/primitives/otp-field.d.ts +1 -1
  50. package/dist/src/primitives/otp-field.d.ts.map +1 -1
  51. package/dist/styles/kumo-standalone.css +1 -1
  52. package/package.json +1 -1
  53. package/scripts/component-registry/discovery.ts +87 -0
  54. package/scripts/component-registry/index.test.ts +89 -1
  55. package/scripts/component-registry/index.ts +27 -2
  56. package/scripts/component-registry/sub-components.ts +34 -21
  57. package/scripts/generate-primitives.ts +1 -1
  58. package/dist/chunks/Maps-fkiyllhs5w0qzw1y.js +0 -2155
  59. package/dist/chunks/Maps-fkiyllhs5w0qzw1y.js.map +0 -1
  60. package/dist/chunks/input-area-ixtj4e8eny58nbf9.js +0 -78
  61. package/dist/chunks/input-area-ixtj4e8eny58nbf9.js.map +0 -1
  62. package/dist/chunks/sidebar-ctd980heycmxsux1.js.map +0 -1
@@ -0,0 +1,2448 @@
1
+ "use client";
2
+ import { jsx as P, jsxs as un, Fragment as lt } from "react/jsx-runtime";
3
+ import { forwardRef as Un, useRef as nn, useEffect as pn, memo as Jt, useCallback as mn, useState as ne, useMemo as en, useLayoutEffect as te } from "react";
4
+ import { W as ee, X as re, Y as oe, Z as ie, _ as le } from "./vendor-base-ui-elpbzr8xeffrz4h2.js";
5
+ import { c as dn } from "./vendor-styling-ofvnbcuht98q88oo.js";
6
+ var Ot = /* @__PURE__ */ ((n) => (n.Attention = "#FC574A", n.Warning = "#F8A054", n.Success = "#00A63E", n.Neutral = "#B9D6FF", n.Disabled = "#CBCBCB", n.Skeleton = "#DDDDDD", n))(Ot || {}), Bt = /* @__PURE__ */ ((n) => (n.Attention = "#FC574A", n.Warning = "#F8A054", n.Success = "#00A63E", n.Neutral = "#8EC5FF", n.Disabled = "#878787", n.Skeleton = "#5C5C5C", n))(Bt || {});
7
+ const ae = {
8
+ blues: ["#E1EAF4", "#8EBCF6", "#4290F0", "#0E58B4", "#03254F"]
9
+ }, ue = {
10
+ blues: ["#03254F", "#0E58B4", "#4290F0", "#A6BFDD", "#E1EAF4"]
11
+ }, se = {
12
+ light: "#E5E7EB",
13
+ dark: "#2B2C31"
14
+ }, ce = {
15
+ light: ["#C8DEFB", "#8FBDF6", "#4290F0", "#1E60BE", "#0A3A7A"],
16
+ dark: ["#26456C", "#2C68BE", "#4290F0", "#79AEF4", "#BBD6FA"]
17
+ }, jn = [
18
+ "#4290F0",
19
+ "#F5B647",
20
+ "#E8649D",
21
+ "#8D58EE",
22
+ "#50C3B6",
23
+ "#D37536"
24
+ /* Orange */
25
+ ], Jn = [
26
+ "#4290F0",
27
+ "#EEB720",
28
+ "#E8649D",
29
+ "#8D58EE",
30
+ "#50C3B6",
31
+ "#D37536"
32
+ /* Orange */
33
+ ];
34
+ var gn;
35
+ ((n) => {
36
+ function t(a, s = !1) {
37
+ return s ? Bt[a] : Ot[a];
38
+ }
39
+ n.semantic = t;
40
+ function r(a, s = !1) {
41
+ return s ? Jn[a % Jn.length] : jn[a % jn.length];
42
+ }
43
+ n.categorical = r;
44
+ function e(a, s = !1) {
45
+ return s ? [...ue[a]] : [...ae[a]];
46
+ }
47
+ n.sequential = e;
48
+ function o(a, s = !1) {
49
+ const h = {
50
+ light: { primary: "#6B7280", secondary: "#9CA3AF" },
51
+ dark: { primary: "#9CA3AF", secondary: "#6B7280" }
52
+ };
53
+ return s ? h.dark[a] : h.light[a];
54
+ }
55
+ n.text = o;
56
+ function l(a = !1) {
57
+ const s = a ? "dark" : "light";
58
+ return {
59
+ area: se[s],
60
+ bubble: r(0, a),
61
+ scale: [...ce[s]]
62
+ };
63
+ }
64
+ n.mapColors = l;
65
+ })(gn || (gn = {}));
66
+ const pt = (n) => {
67
+ const { dangerousHtmlFormatter: t, ...r } = n;
68
+ return {
69
+ ...r,
70
+ formatter: t
71
+ };
72
+ }, fe = ({
73
+ options: n,
74
+ isDarkMode: t
75
+ }) => {
76
+ const r = {
77
+ backgroundColor: "transparent",
78
+ color: t ? Jn : jn,
79
+ ...n
80
+ };
81
+ return r.tooltip ? {
82
+ ...r,
83
+ tooltip: Array.isArray(r.tooltip) ? r.tooltip.map(pt) : pt(r.tooltip)
84
+ } : r;
85
+ }, Ln = Un(function({
86
+ echarts: t,
87
+ options: r,
88
+ optionUpdateBehavior: e,
89
+ className: o,
90
+ isDarkMode: l,
91
+ height: a = 350,
92
+ aspectRatio: s,
93
+ onEvents: h
94
+ }, p) {
95
+ const i = nn(null), u = nn(null), c = nn({}), m = nn({}), d = nn(/* @__PURE__ */ new Set());
96
+ return pn(() => {
97
+ if (!i.current) return;
98
+ const S = t.init(i.current, l ? "dark" : void 0);
99
+ return u.current = S, typeof p == "function" ? p(S) : p && (p.current = S), () => {
100
+ for (const v of d.current) {
101
+ const w = m.current[v];
102
+ w && S.off(v, w);
103
+ }
104
+ d.current.clear(), typeof p == "function" ? p(null) : p && (p.current = null), u.current = null, S.dispose();
105
+ };
106
+ }, [i, l]), pn(() => {
107
+ const S = u.current;
108
+ S && S.setOption(fe({ options: r, isDarkMode: l }), {
109
+ notMerge: !1,
110
+ lazyUpdate: !0,
111
+ ...e
112
+ });
113
+ }, [l, e, r]), pn(() => {
114
+ c.current = h ?? {};
115
+ }, [h]), pn(() => {
116
+ const S = u.current;
117
+ if (!S) return;
118
+ const v = /* @__PURE__ */ new Set();
119
+ for (const [w, y] of Object.entries(h ?? {}))
120
+ typeof y == "function" && (v.add(w), m.current[w] || (m.current[w] = (M) => {
121
+ c.current[w]?.(M);
122
+ }), d.current.has(w) || S.on(w, m.current[w]));
123
+ for (const w of d.current) {
124
+ if (v.has(w)) continue;
125
+ const y = m.current[w];
126
+ y && S.off(w, y);
127
+ }
128
+ d.current = v;
129
+ }, [t, l, h]), pn(() => {
130
+ const S = u.current, v = i.current;
131
+ if (!S || !v) return;
132
+ let w = !0;
133
+ const y = new ResizeObserver(() => {
134
+ if (w) {
135
+ w = !1;
136
+ return;
137
+ }
138
+ S.resize();
139
+ });
140
+ return y.observe(v), () => y.disconnect();
141
+ }, []), /* @__PURE__ */ P(
142
+ "div",
143
+ {
144
+ ref: i,
145
+ className: dn("w-full", o),
146
+ style: s !== void 0 ? { aspectRatio: String(s) } : { height: a },
147
+ tabIndex: r.aria?.enabled ? 0 : void 0,
148
+ role: r.aria?.enabled ? "img" : void 0
149
+ }
150
+ );
151
+ });
152
+ Ln.displayName = "Chart";
153
+ function pe(n, t) {
154
+ if (n.length === 0) return;
155
+ const r = {
156
+ backgroundColor: t.labelBackgroundColor,
157
+ padding: [2, 4],
158
+ borderRadius: 6,
159
+ shadowBlur: 8,
160
+ shadowColor: t.labelBackgroundColor
161
+ };
162
+ return {
163
+ markLine: {
164
+ symbol: "none",
165
+ silent: !1,
166
+ animation: !1,
167
+ z: 10,
168
+ lineStyle: {
169
+ type: "dashed",
170
+ color: t.color,
171
+ width: 1
172
+ },
173
+ emphasis: {
174
+ lineStyle: { width: 2 }
175
+ },
176
+ blur: {
177
+ lineStyle: { opacity: 1 },
178
+ label: { opacity: 1 }
179
+ },
180
+ label: {
181
+ show: !0,
182
+ formatter: (e) => e.name ?? "",
183
+ position: "insideEndTop",
184
+ color: t.color,
185
+ ...r
186
+ },
187
+ data: n.map((e) => ({
188
+ name: e.label,
189
+ xAxis: e.timestamp,
190
+ lineStyle: {
191
+ type: e.lineStyle ?? "dashed",
192
+ color: e.color ?? t.color,
193
+ width: 1
194
+ },
195
+ emphasis: {
196
+ lineStyle: { width: 2 }
197
+ },
198
+ blur: {
199
+ lineStyle: { opacity: 1 },
200
+ label: { opacity: 1 }
201
+ },
202
+ label: {
203
+ show: !!e.label,
204
+ color: e.color ?? t.color,
205
+ ...r
206
+ },
207
+ tooltip: { marker: e }
208
+ }))
209
+ }
210
+ };
211
+ }
212
+ function de(n, t) {
213
+ if (!n?.length) return [];
214
+ const r = [...n].sort((o, l) => o.timestamp - l.timestamp), e = [];
215
+ for (const o of r) {
216
+ const l = e.at(-1);
217
+ l && o.timestamp - l[l.length - 1].timestamp <= t ? l.push(o) : e.push([o]);
218
+ }
219
+ return e.map((o) => {
220
+ const l = o[0];
221
+ return {
222
+ timestamp: l.timestamp,
223
+ label: o.length === 1 ? l.label : `${o.length} changes`,
224
+ color: l.color,
225
+ lineStyle: l.lineStyle,
226
+ markers: o
227
+ };
228
+ });
229
+ }
230
+ function me(n, t) {
231
+ return n.length < 2 ? 0 : (Math.max(...n) - Math.min(...n)) / t;
232
+ }
233
+ function dt(n) {
234
+ if (n.componentType === "markLine")
235
+ return n.data?.tooltip?.marker;
236
+ }
237
+ const he = Jt(function({
238
+ state: t,
239
+ formatValue: r,
240
+ formatTimestamp: e
241
+ }) {
242
+ return t.type === "marker" ? /* @__PURE__ */ P(
243
+ ge,
244
+ {
245
+ state: t,
246
+ formatValue: r,
247
+ formatTimestamp: e
248
+ }
249
+ ) : /* @__PURE__ */ un(lt, { children: [
250
+ /* @__PURE__ */ P("div", { className: "text-xs font-semibold text-kumo-default mb-1", children: e(t.ts) }),
251
+ /* @__PURE__ */ P(
252
+ Pt,
253
+ {
254
+ rows: t.rows,
255
+ hiddenCount: t.hiddenCount,
256
+ formatValue: r
257
+ }
258
+ )
259
+ ] });
260
+ });
261
+ function ge({
262
+ state: n,
263
+ formatValue: t,
264
+ formatTimestamp: r
265
+ }) {
266
+ return /* @__PURE__ */ un(lt, { children: [
267
+ n.markers.length === 1 && /* @__PURE__ */ P("div", { className: "text-xs font-semibold text-kumo-default mb-1", children: r(n.markers[0].timestamp) }),
268
+ /* @__PURE__ */ P("div", { className: "space-y-1", children: n.markers.map((e, o) => /* @__PURE__ */ un("div", { children: [
269
+ /* @__PURE__ */ un("div", { className: "flex items-center gap-2 text-xs text-kumo-default", children: [
270
+ /* @__PURE__ */ P(
271
+ "span",
272
+ {
273
+ className: "w-3 h-3 rounded-full shrink-0",
274
+ style: { backgroundColor: e.color ?? n.color }
275
+ }
276
+ ),
277
+ /* @__PURE__ */ P("span", { className: "font-medium", children: e.label ?? "Reference marker" }),
278
+ n.markers.length > 1 && /* @__PURE__ */ P("span", { className: "text-kumo-subtle", children: r(e.timestamp) })
279
+ ] }),
280
+ e.description && /* @__PURE__ */ P("div", { className: "text-xs text-kumo-default mt-0.5 ml-5", children: e.description })
281
+ ] }, `${e.timestamp}-${e.label}-${o}`)) }),
282
+ n.rows.length > 0 && /* @__PURE__ */ P("div", { className: "border-t border-kumo-line mt-2 pt-2", children: /* @__PURE__ */ P(
283
+ Pt,
284
+ {
285
+ rows: n.rows,
286
+ hiddenCount: n.hiddenCount,
287
+ formatValue: t
288
+ }
289
+ ) })
290
+ ] });
291
+ }
292
+ function Pt({
293
+ rows: n,
294
+ hiddenCount: t,
295
+ formatValue: r
296
+ }) {
297
+ return /* @__PURE__ */ un(lt, { children: [
298
+ n.map((e) => /* @__PURE__ */ un(
299
+ "div",
300
+ {
301
+ className: "flex items-center justify-between gap-4 py-0.5",
302
+ children: [
303
+ /* @__PURE__ */ un("div", { className: "flex items-center gap-2 min-w-0", children: [
304
+ /* @__PURE__ */ P(
305
+ "span",
306
+ {
307
+ className: "w-3 h-3 rounded-full shrink-0",
308
+ style: { backgroundColor: e.color }
309
+ }
310
+ ),
311
+ /* @__PURE__ */ P(
312
+ "span",
313
+ {
314
+ className: "text-xs font-medium text-kumo-default truncate",
315
+ title: e.name,
316
+ children: e.name
317
+ }
318
+ )
319
+ ] }),
320
+ /* @__PURE__ */ P("span", { className: "text-xs font-semibold text-kumo-default shrink-0", children: r ? r(e.value) : ye(e.value) })
321
+ ]
322
+ },
323
+ e.name
324
+ )),
325
+ t > 0 && /* @__PURE__ */ un("div", { className: "text-xs text-kumo-subtle mt-1", children: [
326
+ "+",
327
+ t,
328
+ " more"
329
+ ] })
330
+ ] });
331
+ }
332
+ const ve = new Intl.NumberFormat(void 0, {
333
+ maximumFractionDigits: 3
334
+ });
335
+ function ye(n) {
336
+ return Number.isInteger(n) ? String(n) : ve.format(n);
337
+ }
338
+ function Se(n) {
339
+ if (n?.length)
340
+ return {
341
+ markLine: {
342
+ symbol: "none",
343
+ silent: !0,
344
+ animation: !1,
345
+ z: 9,
346
+ lineStyle: {
347
+ type: "dashed",
348
+ width: 1
349
+ },
350
+ blur: {
351
+ lineStyle: { opacity: 1 },
352
+ label: { opacity: 1 }
353
+ },
354
+ label: {
355
+ show: !0,
356
+ position: "insideEndTop",
357
+ formatter: (t) => t.name ?? ""
358
+ },
359
+ data: n.map((t) => ({
360
+ name: t.label,
361
+ yAxis: t.value,
362
+ lineStyle: {
363
+ color: t.color,
364
+ width: 1,
365
+ type: "dashed"
366
+ },
367
+ blur: {
368
+ lineStyle: { opacity: 1 },
369
+ label: { opacity: 1 }
370
+ },
371
+ label: {
372
+ show: !!t.label,
373
+ color: t.color
374
+ }
375
+ }))
376
+ }
377
+ };
378
+ }
379
+ function xe(n) {
380
+ if (!n?.length) return;
381
+ const t = n.map((r) => r.value);
382
+ return {
383
+ min: Math.min(...t),
384
+ max: Math.max(...t)
385
+ };
386
+ }
387
+ const mt = 5, we = Un(function({
388
+ echarts: t,
389
+ type: r = "line",
390
+ data: e,
391
+ markers: o,
392
+ thresholds: l,
393
+ xAxisName: a,
394
+ xAxisTickCount: s,
395
+ xAxisTickFormat: h,
396
+ yAxisTickFormat: p,
397
+ yAxisTickLabelFormat: i,
398
+ yAxisName: u,
399
+ yAxisTickCount: c,
400
+ tooltipValueFormat: m,
401
+ onTimeRangeChange: d,
402
+ height: S = 350,
403
+ incomplete: v,
404
+ enableLegendSelection: w = !1,
405
+ isDarkMode: y,
406
+ gradient: M,
407
+ loading: E,
408
+ ariaDescription: b,
409
+ optionUpdateBehavior: C,
410
+ tooltipMode: L = "all",
411
+ tooltipMaxItems: A = 10,
412
+ tooltipFollowCursor: $ = "both",
413
+ tooltipBoundary: N
414
+ }, x) {
415
+ const B = nn(null), I = nn(null), T = mn(
416
+ (O) => {
417
+ B.current = O, typeof x == "function" ? x(O) : x && (x.current = O);
418
+ },
419
+ [x]
420
+ ), f = nn(e);
421
+ f.current = e;
422
+ const g = nn(null);
423
+ pn(() => {
424
+ g.current = null;
425
+ }, [w, y]);
426
+ const R = nn(!1), k = nn(null), F = nn(L);
427
+ F.current = L;
428
+ const K = nn(A);
429
+ K.current = A;
430
+ const [Q, V] = ne(null), Y = nn({ x: 0, y: 0 });
431
+ pn(() => {
432
+ const O = I.current;
433
+ if (!O) return;
434
+ const D = (X) => {
435
+ const J = O.getBoundingClientRect();
436
+ Y.current = {
437
+ x: X.clientX - J.left,
438
+ y: X.clientY - J.top
439
+ };
440
+ };
441
+ return O.addEventListener("mousemove", D), () => O.removeEventListener("mousemove", D);
442
+ }, []);
443
+ const tn = v?.before, W = v?.after, ln = gn.text("primary", y), rn = y ? "rgba(0, 0, 0, 0.5)" : "rgba(255, 255, 255, 0.5)", on = en(() => {
444
+ const O = [], D = r === "bar" ? { type: "bar", stack: "total" } : { type: "line", showSymbol: !1 }, X = Se(l), J = xe(l), hn = de(
445
+ o,
446
+ me(
447
+ Me(e, o),
448
+ s ?? mt
449
+ )
450
+ ), wn = pe(hn, {
451
+ color: ln,
452
+ labelBackgroundColor: rn
453
+ });
454
+ for (const _ of e) {
455
+ const vn = tn && r === "line" ? _.data.filter((Kn) => Kn[0] <= tn) : [], Cn = W && r === "line" ? _.data.filter((Kn) => Kn[0] >= W) : [], Fn = vn.length > 0 || Cn.length > 0 ? _.data.slice(
456
+ Math.max(0, vn.length - 1),
457
+ Math.max(0, _.data.length - Cn.length + 1)
458
+ ) : _.data, Nn = M && r === "line" ? {
459
+ color: new t.graphic.LinearGradient(0, 0, 0, 1, [
460
+ { offset: 0, color: ht(_.color, 0.4) },
461
+ { offset: 1, color: ht(_.color, 0) }
462
+ ])
463
+ } : void 0;
464
+ O.push({
465
+ data: Fn,
466
+ color: _.color,
467
+ name: _.name,
468
+ emphasis: { focus: "series" },
469
+ ...Nn ? { areaStyle: Nn } : {},
470
+ ...D
471
+ });
472
+ const ft = {
473
+ color: _.color,
474
+ name: _.name,
475
+ type: "line",
476
+ lineStyle: { type: "dashed" },
477
+ showSymbol: !1,
478
+ emphasis: { focus: "series" }
479
+ };
480
+ vn.length > 0 && O.push({
481
+ ...ft,
482
+ data: vn
483
+ }), Cn.length > 0 && O.push({
484
+ ...ft,
485
+ data: Cn
486
+ });
487
+ }
488
+ return wn && O.push({
489
+ data: [],
490
+ name: "Markers",
491
+ type: r === "bar" ? "bar" : "line",
492
+ animation: !1,
493
+ markLine: wn.markLine
494
+ }), X && O.push({
495
+ data: [],
496
+ name: "Thresholds",
497
+ type: r === "bar" ? "bar" : "line",
498
+ animation: !1,
499
+ markLine: X.markLine
500
+ }), {
501
+ aria: {
502
+ enabled: !0,
503
+ ...b && { label: { description: b } }
504
+ },
505
+ brush: {
506
+ xAxisIndex: "all",
507
+ brushType: "lineX",
508
+ brushMode: "single",
509
+ outOfBrush: {
510
+ colorAlpha: 0.3
511
+ },
512
+ brushStyle: {
513
+ borderWidth: 1,
514
+ color: "rgba(120,140,180,0.3)",
515
+ borderColor: "rgba(120,140,180,0.8)"
516
+ }
517
+ },
518
+ tooltip: {
519
+ trigger: "axis",
520
+ showContent: !1,
521
+ axisPointer: { type: "shadow" }
522
+ },
523
+ backgroundColor: "transparent",
524
+ toolbox: { show: !1 },
525
+ ...w ? { legend: { show: !1 } } : {},
526
+ xAxis: {
527
+ name: a,
528
+ nameLocation: "middle",
529
+ nameGap: 30,
530
+ type: "time",
531
+ splitLine: {
532
+ show: !1
533
+ },
534
+ axisLine: { show: !1 },
535
+ splitNumber: s ?? mt,
536
+ ...h && {
537
+ axisLabel: {
538
+ formatter: (_) => h(_)
539
+ }
540
+ }
541
+ },
542
+ yAxis: {
543
+ name: u,
544
+ nameLocation: "middle",
545
+ nameGap: 40,
546
+ type: "value",
547
+ axisTick: { show: !0 },
548
+ axisLabel: {
549
+ margin: 15,
550
+ ...p && {
551
+ formatter: (_) => p(_)
552
+ }
553
+ },
554
+ splitLine: {
555
+ show: !0,
556
+ lineStyle: { type: "dashed", width: 1 }
557
+ },
558
+ splitNumber: c,
559
+ ...J && {
560
+ min: (_) => Math.min(_.min, J.min),
561
+ max: (_) => Math.max(_.max, J.max)
562
+ }
563
+ },
564
+ grid: {
565
+ left: u ? 30 : 24,
566
+ right: 24,
567
+ top: 24,
568
+ bottom: a ? 30 : 24
569
+ },
570
+ series: O
571
+ };
572
+ }, [
573
+ e,
574
+ a,
575
+ s,
576
+ h,
577
+ p,
578
+ u,
579
+ c,
580
+ tn,
581
+ W,
582
+ r,
583
+ M,
584
+ w,
585
+ t,
586
+ b,
587
+ o,
588
+ l,
589
+ ln,
590
+ rn
591
+ ]), Sn = en(() => ({
592
+ updateaxispointer: (O) => {
593
+ if (R.current) return;
594
+ const D = O?.axesInfo?.[0]?.value;
595
+ if (D == null) return;
596
+ const X = zt(
597
+ f.current,
598
+ D,
599
+ g.current
600
+ );
601
+ let J, hn = 0;
602
+ if (F.current === "single") {
603
+ const _ = B.current, vn = _ ? _.convertFromPixel("grid", [0, Y.current.y])?.[1] : null;
604
+ vn != null && X.length > 0 ? J = [X.reduce(
605
+ (Fn, Nn) => Math.abs(Nn.value - vn) < Math.abs(Fn.value - vn) ? Nn : Fn
606
+ )] : J = X.slice(0, 1);
607
+ } else
608
+ ({ rows: J, hiddenCount: hn } = Dt(
609
+ X,
610
+ K.current
611
+ ));
612
+ const wn = {
613
+ type: "series",
614
+ ts: D,
615
+ rows: J,
616
+ hiddenCount: hn
617
+ };
618
+ V((_) => Ne(_, wn) ? _ : wn);
619
+ },
620
+ mouseover: (O) => {
621
+ const D = dt(O);
622
+ if (!D) return;
623
+ const X = `${D.timestamp}-${D.label ?? ""}`;
624
+ if (k.current === X) return;
625
+ k.current = X, R.current = !0, B.current?.dispatchAction({ type: "hideTip" }), B.current?.dispatchAction({
626
+ type: "updateAxisPointer",
627
+ currTrigger: "leave"
628
+ });
629
+ const { rows: J, hiddenCount: hn } = be(
630
+ f.current,
631
+ D.timestamp,
632
+ g.current,
633
+ K.current
634
+ );
635
+ V({
636
+ type: "marker",
637
+ ts: D.timestamp,
638
+ color: D.color ?? ln,
639
+ markers: D.markers,
640
+ rows: J,
641
+ hiddenCount: hn
642
+ });
643
+ },
644
+ mouseout: (O) => {
645
+ dt(O) && (k.current = null, R.current = !1, V(null));
646
+ },
647
+ globalout: () => {
648
+ k.current = null, R.current = !1, V(null);
649
+ },
650
+ // Keep the tooltip in sync with legend selection. Each action fires a
651
+ // different event — `legendToggleSelect` → `legendselectchanged`,
652
+ // `legendSelect` → `legendselected`, `legendUnSelect` → `legendunselected`
653
+ // — and all three carry the full `selected` map, so we listen to all of
654
+ // them (params type inferred from `ChartEvents`).
655
+ legendselectchanged: (O) => {
656
+ g.current = O.selected;
657
+ },
658
+ legendselected: (O) => {
659
+ g.current = O.selected;
660
+ },
661
+ legendunselected: (O) => {
662
+ g.current = O.selected;
663
+ },
664
+ ...d && {
665
+ brushend: (O) => {
666
+ const D = O.areas[0].coordRange;
667
+ d(D[0], D[1]), B.current?.dispatchAction({ type: "brush", areas: [] });
668
+ }
669
+ }
670
+ }), [d, ln]), xn = !!d;
671
+ pn(() => {
672
+ const O = B.current;
673
+ if (O && xn)
674
+ return O.dispatchAction({
675
+ type: "takeGlobalCursor",
676
+ key: "brush",
677
+ brushOption: {
678
+ brushType: "lineX",
679
+ brushMode: "single"
680
+ }
681
+ }), () => {
682
+ O.dispatchAction({
683
+ type: "takeGlobalCursor",
684
+ key: "brush",
685
+ brushOption: {
686
+ brushType: !1
687
+ }
688
+ });
689
+ };
690
+ }, [B, xn, E]);
691
+ const j = m ?? i, an = Q !== null;
692
+ return /* @__PURE__ */ un(
693
+ ee,
694
+ {
695
+ open: an,
696
+ trackCursorAxis: $,
697
+ children: [
698
+ /* @__PURE__ */ un(
699
+ re,
700
+ {
701
+ render: /* @__PURE__ */ P(
702
+ "div",
703
+ {
704
+ ref: I,
705
+ className: "relative w-full",
706
+ style: { height: S }
707
+ }
708
+ ),
709
+ children: [
710
+ E && /* @__PURE__ */ P(Ae, { height: S, isDarkMode: y }),
711
+ !E && /* @__PURE__ */ P(
712
+ Ln,
713
+ {
714
+ echarts: t,
715
+ ref: T,
716
+ options: on,
717
+ height: S,
718
+ isDarkMode: y,
719
+ onEvents: Sn,
720
+ optionUpdateBehavior: C
721
+ }
722
+ )
723
+ ]
724
+ }
725
+ ),
726
+ an && /* @__PURE__ */ P(oe, { children: /* @__PURE__ */ P(
727
+ ie,
728
+ {
729
+ side: "right",
730
+ align: "start",
731
+ sideOffset: 12,
732
+ collisionAvoidance: { side: "flip", align: "shift" },
733
+ collisionBoundary: N,
734
+ collisionPadding: 8,
735
+ children: /* @__PURE__ */ P(
736
+ le,
737
+ {
738
+ "data-mode": y ? "dark" : "light",
739
+ className: "bg-kumo-base rounded-lg shadow-lg shadow-kumo-tip-shadow outline outline-1 outline-kumo-fill p-2 min-w-[150px] max-w-xs",
740
+ children: /* @__PURE__ */ P(
741
+ he,
742
+ {
743
+ state: Q,
744
+ formatValue: j,
745
+ formatTimestamp: Re
746
+ }
747
+ )
748
+ }
749
+ )
750
+ }
751
+ ) })
752
+ ]
753
+ }
754
+ );
755
+ });
756
+ we.displayName = "TimeseriesChart";
757
+ function Ee(n, t) {
758
+ if (n.length === 0) return null;
759
+ let r = 0, e = n.length - 1;
760
+ for (; r < e; ) {
761
+ const o = r + e >> 1;
762
+ n[o][0] < t ? r = o + 1 : e = o;
763
+ }
764
+ return r > 0 && Math.abs(n[r - 1][0] - t) < Math.abs(n[r][0] - t) && r--, n[r][1];
765
+ }
766
+ function Me(n, t) {
767
+ return [
768
+ ...n.flatMap((r) => r.data.map(([e]) => e)),
769
+ ...t?.map((r) => r.timestamp) ?? []
770
+ ];
771
+ }
772
+ function zt(n, t, r) {
773
+ const e = /* @__PURE__ */ new Set(), o = [];
774
+ for (const l of n) {
775
+ if (e.has(l.name) || r && r[l.name] === !1) continue;
776
+ e.add(l.name);
777
+ const a = Ee(l.data, t);
778
+ a != null && o.push({ name: l.name, value: a, color: l.color });
779
+ }
780
+ return o.sort((l, a) => a.value - l.value);
781
+ }
782
+ function Dt(n, t) {
783
+ return {
784
+ rows: n.slice(0, t),
785
+ hiddenCount: Math.max(0, n.length - t)
786
+ };
787
+ }
788
+ function be(n, t, r, e) {
789
+ return Dt(
790
+ zt(n, t, r),
791
+ e
792
+ );
793
+ }
794
+ function Ce(n, t) {
795
+ return n.ts === t.ts && n.color === t.color && n.hiddenCount === t.hiddenCount && n.rows.length === t.rows.length && _t(n.rows, t.rows) && n.markers.length === t.markers.length && n.markers.every((r, e) => {
796
+ const o = t.markers[e];
797
+ return r.timestamp === o.timestamp && r.label === o.label && r.description === o.description && r.color === o.color && r.lineStyle === o.lineStyle;
798
+ });
799
+ }
800
+ function Ne(n, t) {
801
+ return !n || n.type !== t.type ? !1 : n.type === "marker" && t.type === "marker" ? Ce(n, t) : n.type !== "series" || t.type !== "series" || n.ts !== t.ts || n.hiddenCount !== t.hiddenCount || n.rows.length !== t.rows.length ? !1 : _t(n.rows, t.rows);
802
+ }
803
+ function _t(n, t) {
804
+ return n.every((r, e) => {
805
+ const o = t[e];
806
+ return r.name === o.name && r.value === o.value && r.color === o.color;
807
+ });
808
+ }
809
+ function Ae({
810
+ height: n,
811
+ isDarkMode: t
812
+ }) {
813
+ const r = n / 2, e = Math.min(n * 0.12, 28), o = 400, l = 120, a = [];
814
+ for (let p = 0; p <= l; p++) {
815
+ const i = -o + p / l * o * 3, u = r + Math.sin(p / l * 2 * Math.PI * 3) * e;
816
+ a.push(`${p === 0 ? "M" : "L"}${i.toFixed(2)},${u.toFixed(2)}`);
817
+ }
818
+ const s = a.join(" "), h = t ? "rgba(255,255,255,0.5)" : "rgba(0,0,0,0.2)";
819
+ return /* @__PURE__ */ P(
820
+ "div",
821
+ {
822
+ "aria-hidden": "true",
823
+ className: "absolute inset-0 overflow-hidden",
824
+ style: { height: n },
825
+ children: /* @__PURE__ */ P(
826
+ "svg",
827
+ {
828
+ width: "100%",
829
+ height: n,
830
+ viewBox: `0 0 ${o} ${n}`,
831
+ preserveAspectRatio: "none",
832
+ className: "w-full animate-pulse",
833
+ children: /* @__PURE__ */ P(
834
+ "path",
835
+ {
836
+ d: s,
837
+ fill: "none",
838
+ stroke: h,
839
+ strokeWidth: "2",
840
+ style: {
841
+ animation: "kumo-chart-wave 2.4s linear infinite",
842
+ transformOrigin: "0 0"
843
+ }
844
+ }
845
+ )
846
+ }
847
+ )
848
+ }
849
+ );
850
+ }
851
+ function ht(n, t) {
852
+ const r = Math.max(0, Math.min(1, t)), e = n.match(
853
+ /rgba?\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)/i
854
+ );
855
+ if (e)
856
+ return `rgba(${e[1]}, ${e[2]}, ${e[3]}, ${r})`;
857
+ let o = n.replace(/^#/, "");
858
+ o.length === 3 && (o = o[0] + o[0] + o[1] + o[1] + o[2] + o[2]), o.length === 8 && (o = o.slice(0, 6));
859
+ const l = parseInt(o.slice(0, 2), 16), a = parseInt(o.slice(2, 4), 16), s = parseInt(o.slice(4, 6), 16);
860
+ return `rgba(${l}, ${a}, ${s}, ${r})`;
861
+ }
862
+ const Te = new Intl.DateTimeFormat(void 0, {
863
+ month: "short",
864
+ day: "numeric",
865
+ hour: "2-digit",
866
+ minute: "2-digit",
867
+ second: "2-digit",
868
+ hour12: !1
869
+ });
870
+ function Re(n) {
871
+ return Te.format(new Date(n));
872
+ }
873
+ const Gt = (n) => {
874
+ n.key !== "Enter" && n.key !== " " || (n.preventDefault(), n.currentTarget.click());
875
+ };
876
+ function $e({
877
+ color: n,
878
+ value: t,
879
+ name: r,
880
+ unit: e,
881
+ inactive: o,
882
+ onPointerEnter: l,
883
+ onPointerLeave: a,
884
+ onClick: s,
885
+ className: h
886
+ }) {
887
+ return /* @__PURE__ */ un(
888
+ "div",
889
+ {
890
+ role: "button",
891
+ tabIndex: s ? 0 : -1,
892
+ className: dn(
893
+ "inline-flex flex-col gap-2 min-w-42 py-2",
894
+ { "cursor-pointer": !!s },
895
+ h
896
+ ),
897
+ onPointerEnter: l,
898
+ onPointerLeave: a,
899
+ onClick: s,
900
+ onKeyDown: s ? Gt : void 0,
901
+ children: [
902
+ /* @__PURE__ */ un("div", { className: "flex items-center gap-2", children: [
903
+ /* @__PURE__ */ P(
904
+ "span",
905
+ {
906
+ className: dn("size-2 rounded-full inline-block", {
907
+ "opacity-50": o
908
+ }),
909
+ style: { backgroundColor: n }
910
+ }
911
+ ),
912
+ /* @__PURE__ */ P("span", { className: dn("text-xs", { "opacity-50": o }), children: r })
913
+ ] }),
914
+ /* @__PURE__ */ un("div", { className: "flex items-baseline gap-0.5", children: [
915
+ /* @__PURE__ */ P(
916
+ "span",
917
+ {
918
+ className: dn("text-lg font-medium leading-none", {
919
+ "opacity-50": o
920
+ }),
921
+ children: t
922
+ }
923
+ ),
924
+ e && /* @__PURE__ */ P(
925
+ "span",
926
+ {
927
+ className: dn("text-xs text-kumo-subtle leading-none", {
928
+ "opacity-50": o
929
+ }),
930
+ children: e
931
+ }
932
+ )
933
+ ] })
934
+ ]
935
+ }
936
+ );
937
+ }
938
+ function Ie({
939
+ color: n,
940
+ value: t,
941
+ name: r,
942
+ inactive: e,
943
+ onPointerEnter: o,
944
+ onPointerLeave: l,
945
+ onClick: a,
946
+ className: s
947
+ }) {
948
+ return /* @__PURE__ */ un(
949
+ "div",
950
+ {
951
+ role: "button",
952
+ tabIndex: a ? 0 : -1,
953
+ className: dn(
954
+ "inline-flex items-center gap-2",
955
+ { "cursor-pointer": !!a },
956
+ s
957
+ ),
958
+ onPointerEnter: o,
959
+ onPointerLeave: l,
960
+ onClick: a,
961
+ onKeyDown: a ? Gt : void 0,
962
+ children: [
963
+ /* @__PURE__ */ P(
964
+ "span",
965
+ {
966
+ className: dn("size-2 rounded-full inline-block", {
967
+ "opacity-50": e
968
+ }),
969
+ style: { backgroundColor: n }
970
+ }
971
+ ),
972
+ /* @__PURE__ */ P("span", { className: dn("text-xs", { "opacity-50": e }), children: r }),
973
+ /* @__PURE__ */ P("span", { className: dn("text-xs font-medium", { "opacity-50": e }), children: t })
974
+ ]
975
+ }
976
+ );
977
+ }
978
+ const Cr = {
979
+ SmallItem: Ie,
980
+ LargeItem: $e
981
+ }, at = (n) => n.toLocaleString(), yn = (n) => n.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;");
982
+ function ke(n) {
983
+ return typeof n == "object" && n !== null;
984
+ }
985
+ const gt = (n) => n.replace(/[{}|]/g, (t) => `\\${t}`), Vn = (n) => {
986
+ const t = "#666";
987
+ return !n || typeof n != "string" ? t : /^#(?:[0-9a-f]{3}|[0-9a-f]{6}|[0-9a-f]{8})$/i.test(n) || /^rgba?\(\s*\d{1,3}\s*,\s*\d{1,3}\s*,\s*\d{1,3}\s*(?:,\s*[\d.]+\s*)?\)$/i.test(
988
+ n
989
+ ) || /^hsla?\(\s*\d{1,3}\s*,\s*\d{1,3}%\s*,\s*\d{1,3}%\s*(?:,\s*[\d.]+\s*)?\)$/i.test(
990
+ n
991
+ ) || /^[a-z]{3,20}$/i.test(n) ? n : t;
992
+ };
993
+ function Le({
994
+ echarts: n,
995
+ nodes: t,
996
+ links: r,
997
+ height: e = 400,
998
+ nodeWidth: o = 8,
999
+ nodePadding: l = 10,
1000
+ showTooltip: a = !0,
1001
+ showNodeValues: s,
1002
+ nodeLabelLayout: h = "stacked",
1003
+ formatValue: p = at,
1004
+ tooltipFormatter: i,
1005
+ defaultNodeColor: u,
1006
+ left: c,
1007
+ right: m,
1008
+ linkColor: d = "gradient",
1009
+ linkOpacity: S = 0.5,
1010
+ className: v,
1011
+ isDarkMode: w,
1012
+ onNodeClick: y,
1013
+ onLinkClick: M
1014
+ }) {
1015
+ const E = t.some((N) => N.value !== void 0), b = s ?? E, C = h === "inline", L = en(() => {
1016
+ const N = gn.text("primary", w), x = gn.text("secondary", w), B = t.map(
1017
+ (g, R) => g.color ?? u ?? gn.categorical(R, w)
1018
+ ), I = new Map(
1019
+ t.map((g, R) => [g.name, { ...g, computedColor: B[R] }])
1020
+ ), T = t.map((g, R) => ({
1021
+ name: g.name,
1022
+ value: g.value,
1023
+ itemStyle: {
1024
+ color: B[R]
1025
+ }
1026
+ })), f = r.map((g) => ({
1027
+ source: t[g.source]?.name ?? "",
1028
+ target: t[g.target]?.name ?? "",
1029
+ value: g.value
1030
+ }));
1031
+ return {
1032
+ backgroundColor: "transparent",
1033
+ animation: !0,
1034
+ animationDuration: 500,
1035
+ animationDurationUpdate: 300,
1036
+ animationEasingUpdate: "cubicInOut",
1037
+ tooltip: a ? {
1038
+ trigger: "item",
1039
+ triggerOn: "mousemove",
1040
+ dangerousHtmlFormatter: (g) => {
1041
+ if (!ke(g)) return "";
1042
+ if (g.dataType === "node" && g.name) {
1043
+ const R = I.get(g.name), k = Vn(
1044
+ R?.computedColor ?? g.color ?? "#666"
1045
+ );
1046
+ if (i)
1047
+ return i({
1048
+ type: "node",
1049
+ name: g.name,
1050
+ node: R,
1051
+ color: k
1052
+ });
1053
+ const F = yn(g.name);
1054
+ return `<div style="display:flex;align-items:center;gap:6px;"><span style="display:inline-block;width:10px;height:10px;border-radius:50%;background:${k}"></span><strong>${F}</strong></div>`;
1055
+ }
1056
+ if (g.dataType === "edge" && g.data) {
1057
+ const { source: R, target: k, value: F } = g.data;
1058
+ if (i)
1059
+ return i({
1060
+ type: "link",
1061
+ name: `${R} → ${k}`,
1062
+ link: {
1063
+ source: R ?? "",
1064
+ target: k ?? "",
1065
+ value: F ?? 0
1066
+ }
1067
+ });
1068
+ const K = I.get(R ?? ""), Q = I.get(k ?? ""), V = Vn(
1069
+ K?.computedColor ?? "#666"
1070
+ ), Y = Vn(
1071
+ Q?.computedColor ?? "#666"
1072
+ ), tn = yn(R ?? ""), W = yn(k ?? "");
1073
+ return `<div style="display:flex;align-items:center;gap:6px;margin-bottom:4px;">
1074
+ <span style="display:inline-block;width:10px;height:10px;border-radius:50%;background:${V}"></span>
1075
+ <strong>${tn}</strong>
1076
+ <span style="color:${x}">→</span>
1077
+ <span style="display:inline-block;width:10px;height:10px;border-radius:50%;background:${Y}"></span>
1078
+ <strong>${W}</strong>
1079
+ </div>
1080
+ <strong>${F !== void 0 ? yn(p(F)) : ""}</strong>`;
1081
+ }
1082
+ return "";
1083
+ }
1084
+ } : void 0,
1085
+ series: [
1086
+ {
1087
+ type: "sankey",
1088
+ ...c !== void 0 && { left: c },
1089
+ ...m !== void 0 && { right: m },
1090
+ data: T,
1091
+ links: f,
1092
+ draggable: !1,
1093
+ emphasis: {
1094
+ focus: "adjacency"
1095
+ },
1096
+ nodeWidth: o,
1097
+ nodeGap: l,
1098
+ lineStyle: {
1099
+ color: d === "gradient" ? "source" : "#d1d5db",
1100
+ opacity: d === "gradient" ? S : 0.4,
1101
+ curveness: 0.5
1102
+ },
1103
+ label: {
1104
+ show: !0,
1105
+ color: N,
1106
+ fontSize: 12,
1107
+ formatter: b ? (g) => {
1108
+ const R = g.name ?? "", k = I.get(R), F = gt(R);
1109
+ if (k?.value !== void 0) {
1110
+ const K = gt(
1111
+ p(k.value)
1112
+ );
1113
+ return C ? `{name|${F}} {value|${K}}` : `{value|${K}}
1114
+ {name|${F}}`;
1115
+ }
1116
+ return F;
1117
+ } : void 0,
1118
+ rich: b ? {
1119
+ value: {
1120
+ fontSize: 11,
1121
+ color: N,
1122
+ lineHeight: C ? void 0 : 16
1123
+ },
1124
+ name: {
1125
+ fontSize: 12,
1126
+ color: N,
1127
+ fontWeight: 700
1128
+ }
1129
+ } : void 0
1130
+ }
1131
+ }
1132
+ ]
1133
+ };
1134
+ }, [
1135
+ t,
1136
+ r,
1137
+ a,
1138
+ o,
1139
+ l,
1140
+ u,
1141
+ c,
1142
+ m,
1143
+ w,
1144
+ d,
1145
+ S,
1146
+ b,
1147
+ C,
1148
+ p,
1149
+ i
1150
+ ]), A = mn(
1151
+ (N) => {
1152
+ if (N.dataType === "node" && y && N.name) {
1153
+ const x = t.findIndex((T) => T.name === N.name), I = {
1154
+ ...x >= 0 ? t[x] : null,
1155
+ name: N.name
1156
+ };
1157
+ y(I);
1158
+ } else if (N.dataType === "edge" && M && N.data) {
1159
+ const x = N.data, B = typeof x == "object" && x !== null && "source" in x ? String(x.source) : "", I = typeof x == "object" && x !== null && "target" in x ? String(x.target) : "", T = t.findIndex((F) => F.name === B), f = t.findIndex((F) => F.name === I);
1160
+ if (T === -1 || f === -1) return;
1161
+ const g = N.value, R = typeof g == "number" ? g : Array.isArray(g) && typeof g[0] == "number" ? g[0] : 0, k = r.find(
1162
+ (F) => F.source === T && F.target === f
1163
+ );
1164
+ M({
1165
+ ...k,
1166
+ source: T,
1167
+ target: f,
1168
+ value: R
1169
+ });
1170
+ }
1171
+ },
1172
+ [t, r, y, M]
1173
+ ), $ = en(
1174
+ () => ({
1175
+ click: A
1176
+ }),
1177
+ [A]
1178
+ );
1179
+ return /* @__PURE__ */ P(
1180
+ Ln,
1181
+ {
1182
+ echarts: n,
1183
+ options: L,
1184
+ className: v,
1185
+ isDarkMode: w,
1186
+ height: e,
1187
+ onEvents: $
1188
+ }
1189
+ );
1190
+ }
1191
+ Le.displayName = "SankeyChart";
1192
+ class Fe {
1193
+ constructor() {
1194
+ this._partials = new Float64Array(32), this._n = 0;
1195
+ }
1196
+ add(t) {
1197
+ const r = this._partials;
1198
+ let e = 0;
1199
+ for (let o = 0; o < this._n && o < 32; o++) {
1200
+ const l = r[o], a = t + l, s = Math.abs(t) < Math.abs(l) ? t - (a - l) : l - (a - t);
1201
+ s && (r[e++] = s), t = a;
1202
+ }
1203
+ return r[e] = t, this._n = e + 1, this;
1204
+ }
1205
+ valueOf() {
1206
+ const t = this._partials;
1207
+ let r = this._n, e, o, l, a = 0;
1208
+ if (r > 0) {
1209
+ for (a = t[--r]; r > 0 && (e = a, o = t[--r], a = e + o, l = o - (a - e), !l); )
1210
+ ;
1211
+ r > 0 && (l < 0 && t[r - 1] < 0 || l > 0 && t[r - 1] > 0) && (o = l * 2, e = a + o, o == e - a && (a = e));
1212
+ }
1213
+ return a;
1214
+ }
1215
+ }
1216
+ function* Oe(n) {
1217
+ for (const t of n)
1218
+ yield* t;
1219
+ }
1220
+ function Wt(n) {
1221
+ return Array.from(Oe(n));
1222
+ }
1223
+ var G = 1e-6, z = Math.PI, sn = z / 2, vt = z / 4, fn = z * 2, cn = 180 / z, Z = z / 180, q = Math.abs, Xt = Math.atan, $n = Math.atan2, U = Math.cos, Be = Math.exp, Pe = Math.log, H = Math.sin, ze = Math.sign || function(n) {
1224
+ return n > 0 ? 1 : n < 0 ? -1 : 0;
1225
+ }, Hn = Math.sqrt, De = Math.tan;
1226
+ function _e(n) {
1227
+ return n > 1 ? 0 : n < -1 ? z : Math.acos(n);
1228
+ }
1229
+ function In(n) {
1230
+ return n > 1 ? sn : n < -1 ? -sn : Math.asin(n);
1231
+ }
1232
+ function An() {
1233
+ }
1234
+ function _n(n, t) {
1235
+ n && St.hasOwnProperty(n.type) && St[n.type](n, t);
1236
+ }
1237
+ var yt = {
1238
+ Feature: function(n, t) {
1239
+ _n(n.geometry, t);
1240
+ },
1241
+ FeatureCollection: function(n, t) {
1242
+ for (var r = n.features, e = -1, o = r.length; ++e < o; ) _n(r[e].geometry, t);
1243
+ }
1244
+ }, St = {
1245
+ Sphere: function(n, t) {
1246
+ t.sphere();
1247
+ },
1248
+ Point: function(n, t) {
1249
+ n = n.coordinates, t.point(n[0], n[1], n[2]);
1250
+ },
1251
+ MultiPoint: function(n, t) {
1252
+ for (var r = n.coordinates, e = -1, o = r.length; ++e < o; ) n = r[e], t.point(n[0], n[1], n[2]);
1253
+ },
1254
+ LineString: function(n, t) {
1255
+ nt(n.coordinates, t, 0);
1256
+ },
1257
+ MultiLineString: function(n, t) {
1258
+ for (var r = n.coordinates, e = -1, o = r.length; ++e < o; ) nt(r[e], t, 0);
1259
+ },
1260
+ Polygon: function(n, t) {
1261
+ xt(n.coordinates, t);
1262
+ },
1263
+ MultiPolygon: function(n, t) {
1264
+ for (var r = n.coordinates, e = -1, o = r.length; ++e < o; ) xt(r[e], t);
1265
+ },
1266
+ GeometryCollection: function(n, t) {
1267
+ for (var r = n.geometries, e = -1, o = r.length; ++e < o; ) _n(r[e], t);
1268
+ }
1269
+ };
1270
+ function nt(n, t, r) {
1271
+ var e = -1, o = n.length - r, l;
1272
+ for (t.lineStart(); ++e < o; ) l = n[e], t.point(l[0], l[1], l[2]);
1273
+ t.lineEnd();
1274
+ }
1275
+ function xt(n, t) {
1276
+ var r = -1, e = n.length;
1277
+ for (t.polygonStart(); ++r < e; ) nt(n[r], t, 1);
1278
+ t.polygonEnd();
1279
+ }
1280
+ function Ge(n, t) {
1281
+ n && yt.hasOwnProperty(n.type) ? yt[n.type](n, t) : _n(n, t);
1282
+ }
1283
+ function tt(n) {
1284
+ return [$n(n[1], n[0]), In(n[2])];
1285
+ }
1286
+ function Mn(n) {
1287
+ var t = n[0], r = n[1], e = U(r);
1288
+ return [e * U(t), e * H(t), H(r)];
1289
+ }
1290
+ function On(n, t) {
1291
+ return n[0] * t[0] + n[1] * t[1] + n[2] * t[2];
1292
+ }
1293
+ function Gn(n, t) {
1294
+ return [n[1] * t[2] - n[2] * t[1], n[2] * t[0] - n[0] * t[2], n[0] * t[1] - n[1] * t[0]];
1295
+ }
1296
+ function Yn(n, t) {
1297
+ n[0] += t[0], n[1] += t[1], n[2] += t[2];
1298
+ }
1299
+ function Bn(n, t) {
1300
+ return [n[0] * t, n[1] * t, n[2] * t];
1301
+ }
1302
+ function et(n) {
1303
+ var t = Hn(n[0] * n[0] + n[1] * n[1] + n[2] * n[2]);
1304
+ n[0] /= t, n[1] /= t, n[2] /= t;
1305
+ }
1306
+ function rt(n, t) {
1307
+ function r(e, o) {
1308
+ return e = n(e, o), t(e[0], e[1]);
1309
+ }
1310
+ return n.invert && t.invert && (r.invert = function(e, o) {
1311
+ return e = t.invert(e, o), e && n.invert(e[0], e[1]);
1312
+ }), r;
1313
+ }
1314
+ function ot(n, t) {
1315
+ return q(n) > z && (n -= Math.round(n / fn) * fn), [n, t];
1316
+ }
1317
+ ot.invert = ot;
1318
+ function qt(n, t, r) {
1319
+ return (n %= fn) ? t || r ? rt(Et(n), Mt(t, r)) : Et(n) : t || r ? Mt(t, r) : ot;
1320
+ }
1321
+ function wt(n) {
1322
+ return function(t, r) {
1323
+ return t += n, q(t) > z && (t -= Math.round(t / fn) * fn), [t, r];
1324
+ };
1325
+ }
1326
+ function Et(n) {
1327
+ var t = wt(n);
1328
+ return t.invert = wt(-n), t;
1329
+ }
1330
+ function Mt(n, t) {
1331
+ var r = U(n), e = H(n), o = U(t), l = H(t);
1332
+ function a(s, h) {
1333
+ var p = U(h), i = U(s) * p, u = H(s) * p, c = H(h), m = c * r + i * e;
1334
+ return [
1335
+ $n(u * o - m * l, i * r - c * e),
1336
+ In(m * o + u * l)
1337
+ ];
1338
+ }
1339
+ return a.invert = function(s, h) {
1340
+ var p = U(h), i = U(s) * p, u = H(s) * p, c = H(h), m = c * o - u * l;
1341
+ return [
1342
+ $n(u * o + c * l, i * r + m * e),
1343
+ In(m * r - i * e)
1344
+ ];
1345
+ }, a;
1346
+ }
1347
+ function We(n) {
1348
+ n = qt(n[0] * Z, n[1] * Z, n.length > 2 ? n[2] * Z : 0);
1349
+ function t(r) {
1350
+ return r = n(r[0] * Z, r[1] * Z), r[0] *= cn, r[1] *= cn, r;
1351
+ }
1352
+ return t.invert = function(r) {
1353
+ return r = n.invert(r[0] * Z, r[1] * Z), r[0] *= cn, r[1] *= cn, r;
1354
+ }, t;
1355
+ }
1356
+ function Xe(n, t, r, e, o, l) {
1357
+ if (r) {
1358
+ var a = U(t), s = H(t), h = e * r;
1359
+ o == null ? (o = t + e * fn, l = t - h / 2) : (o = bt(a, o), l = bt(a, l), (e > 0 ? o < l : o > l) && (o += e * fn));
1360
+ for (var p, i = o; e > 0 ? i > l : i < l; i -= h)
1361
+ p = tt([a, -s * U(i), -s * H(i)]), n.point(p[0], p[1]);
1362
+ }
1363
+ }
1364
+ function bt(n, t) {
1365
+ t = Mn(t), t[0] -= n, et(t);
1366
+ var r = _e(-t[1]);
1367
+ return ((-t[2] < 0 ? -r : r) + fn - G) % fn;
1368
+ }
1369
+ function Ut() {
1370
+ var n = [], t;
1371
+ return {
1372
+ point: function(r, e, o) {
1373
+ t.push([r, e, o]);
1374
+ },
1375
+ lineStart: function() {
1376
+ n.push(t = []);
1377
+ },
1378
+ lineEnd: An,
1379
+ rejoin: function() {
1380
+ n.length > 1 && n.push(n.pop().concat(n.shift()));
1381
+ },
1382
+ result: function() {
1383
+ var r = n;
1384
+ return n = [], t = null, r;
1385
+ }
1386
+ };
1387
+ }
1388
+ function Dn(n, t) {
1389
+ return q(n[0] - t[0]) < G && q(n[1] - t[1]) < G;
1390
+ }
1391
+ function Pn(n, t, r, e) {
1392
+ this.x = n, this.z = t, this.o = r, this.e = e, this.v = !1, this.n = this.p = null;
1393
+ }
1394
+ function Ht(n, t, r, e, o) {
1395
+ var l = [], a = [], s, h;
1396
+ if (n.forEach(function(d) {
1397
+ if (!((S = d.length - 1) <= 0)) {
1398
+ var S, v = d[0], w = d[S], y;
1399
+ if (Dn(v, w)) {
1400
+ if (!v[2] && !w[2]) {
1401
+ for (o.lineStart(), s = 0; s < S; ++s) o.point((v = d[s])[0], v[1]);
1402
+ o.lineEnd();
1403
+ return;
1404
+ }
1405
+ w[0] += 2 * G;
1406
+ }
1407
+ l.push(y = new Pn(v, d, null, !0)), a.push(y.o = new Pn(v, null, y, !1)), l.push(y = new Pn(w, d, null, !1)), a.push(y.o = new Pn(w, null, y, !0));
1408
+ }
1409
+ }), !!l.length) {
1410
+ for (a.sort(t), Ct(l), Ct(a), s = 0, h = a.length; s < h; ++s)
1411
+ a[s].e = r = !r;
1412
+ for (var p = l[0], i, u; ; ) {
1413
+ for (var c = p, m = !0; c.v; ) if ((c = c.n) === p) return;
1414
+ i = c.z, o.lineStart();
1415
+ do {
1416
+ if (c.v = c.o.v = !0, c.e) {
1417
+ if (m)
1418
+ for (s = 0, h = i.length; s < h; ++s) o.point((u = i[s])[0], u[1]);
1419
+ else
1420
+ e(c.x, c.n.x, 1, o);
1421
+ c = c.n;
1422
+ } else {
1423
+ if (m)
1424
+ for (i = c.p.z, s = i.length - 1; s >= 0; --s) o.point((u = i[s])[0], u[1]);
1425
+ else
1426
+ e(c.x, c.p.x, -1, o);
1427
+ c = c.p;
1428
+ }
1429
+ c = c.o, i = c.z, m = !m;
1430
+ } while (!c.v);
1431
+ o.lineEnd();
1432
+ }
1433
+ }
1434
+ }
1435
+ function Ct(n) {
1436
+ if (t = n.length) {
1437
+ for (var t, r = 0, e = n[0], o; ++r < t; )
1438
+ e.n = o = n[r], o.p = e, e = o;
1439
+ e.n = o = n[0], o.p = e;
1440
+ }
1441
+ }
1442
+ function Zn(n) {
1443
+ return q(n[0]) <= z ? n[0] : ze(n[0]) * ((q(n[0]) + z) % fn - z);
1444
+ }
1445
+ function qe(n, t) {
1446
+ var r = Zn(t), e = t[1], o = H(e), l = [H(r), -U(r), 0], a = 0, s = 0, h = new Fe();
1447
+ o === 1 ? e = sn + G : o === -1 && (e = -sn - G);
1448
+ for (var p = 0, i = n.length; p < i; ++p)
1449
+ if (c = (u = n[p]).length)
1450
+ for (var u, c, m = u[c - 1], d = Zn(m), S = m[1] / 2 + vt, v = H(S), w = U(S), y = 0; y < c; ++y, d = E, v = C, w = L, m = M) {
1451
+ var M = u[y], E = Zn(M), b = M[1] / 2 + vt, C = H(b), L = U(b), A = E - d, $ = A >= 0 ? 1 : -1, N = $ * A, x = N > z, B = v * C;
1452
+ if (h.add($n(B * $ * H(N), w * L + B * U(N))), a += x ? A + $ * fn : A, x ^ d >= r ^ E >= r) {
1453
+ var I = Gn(Mn(m), Mn(M));
1454
+ et(I);
1455
+ var T = Gn(l, I);
1456
+ et(T);
1457
+ var f = (x ^ A >= 0 ? -1 : 1) * In(T[2]);
1458
+ (e > f || e === f && (I[0] || I[1])) && (s += x ^ A >= 0 ? 1 : -1);
1459
+ }
1460
+ }
1461
+ return (a < -G || a < G && h < -1e-12) ^ s & 1;
1462
+ }
1463
+ function Kt(n, t, r, e) {
1464
+ return function(o) {
1465
+ var l = t(o), a = Ut(), s = t(a), h = !1, p, i, u, c = {
1466
+ point: m,
1467
+ lineStart: S,
1468
+ lineEnd: v,
1469
+ polygonStart: function() {
1470
+ c.point = w, c.lineStart = y, c.lineEnd = M, i = [], p = [];
1471
+ },
1472
+ polygonEnd: function() {
1473
+ c.point = m, c.lineStart = S, c.lineEnd = v, i = Wt(i);
1474
+ var E = qe(p, e);
1475
+ i.length ? (h || (o.polygonStart(), h = !0), Ht(i, He, E, r, o)) : E && (h || (o.polygonStart(), h = !0), o.lineStart(), r(null, null, 1, o), o.lineEnd()), h && (o.polygonEnd(), h = !1), i = p = null;
1476
+ },
1477
+ sphere: function() {
1478
+ o.polygonStart(), o.lineStart(), r(null, null, 1, o), o.lineEnd(), o.polygonEnd();
1479
+ }
1480
+ };
1481
+ function m(E, b) {
1482
+ n(E, b) && o.point(E, b);
1483
+ }
1484
+ function d(E, b) {
1485
+ l.point(E, b);
1486
+ }
1487
+ function S() {
1488
+ c.point = d, l.lineStart();
1489
+ }
1490
+ function v() {
1491
+ c.point = m, l.lineEnd();
1492
+ }
1493
+ function w(E, b) {
1494
+ u.push([E, b]), s.point(E, b);
1495
+ }
1496
+ function y() {
1497
+ s.lineStart(), u = [];
1498
+ }
1499
+ function M() {
1500
+ w(u[0][0], u[0][1]), s.lineEnd();
1501
+ var E = s.clean(), b = a.result(), C, L = b.length, A, $, N;
1502
+ if (u.pop(), p.push(u), u = null, !!L) {
1503
+ if (E & 1) {
1504
+ if ($ = b[0], (A = $.length - 1) > 0) {
1505
+ for (h || (o.polygonStart(), h = !0), o.lineStart(), C = 0; C < A; ++C) o.point((N = $[C])[0], N[1]);
1506
+ o.lineEnd();
1507
+ }
1508
+ return;
1509
+ }
1510
+ L > 1 && E & 2 && b.push(b.pop().concat(b.shift())), i.push(b.filter(Ue));
1511
+ }
1512
+ }
1513
+ return c;
1514
+ };
1515
+ }
1516
+ function Ue(n) {
1517
+ return n.length > 1;
1518
+ }
1519
+ function He(n, t) {
1520
+ return ((n = n.x)[0] < 0 ? n[1] - sn - G : sn - n[1]) - ((t = t.x)[0] < 0 ? t[1] - sn - G : sn - t[1]);
1521
+ }
1522
+ const Nt = Kt(
1523
+ function() {
1524
+ return !0;
1525
+ },
1526
+ Ke,
1527
+ Ye,
1528
+ [-z, -sn]
1529
+ );
1530
+ function Ke(n) {
1531
+ var t = NaN, r = NaN, e = NaN, o;
1532
+ return {
1533
+ lineStart: function() {
1534
+ n.lineStart(), o = 1;
1535
+ },
1536
+ point: function(l, a) {
1537
+ var s = l > 0 ? z : -z, h = q(l - t);
1538
+ q(h - z) < G ? (n.point(t, r = (r + a) / 2 > 0 ? sn : -sn), n.point(e, r), n.lineEnd(), n.lineStart(), n.point(s, r), n.point(l, r), o = 0) : e !== s && h >= z && (q(t - e) < G && (t -= e * G), q(l - s) < G && (l -= s * G), r = Ve(t, r, l, a), n.point(e, r), n.lineEnd(), n.lineStart(), n.point(s, r), o = 0), n.point(t = l, r = a), e = s;
1539
+ },
1540
+ lineEnd: function() {
1541
+ n.lineEnd(), t = r = NaN;
1542
+ },
1543
+ clean: function() {
1544
+ return 2 - o;
1545
+ }
1546
+ };
1547
+ }
1548
+ function Ve(n, t, r, e) {
1549
+ var o, l, a = H(n - r);
1550
+ return q(a) > G ? Xt((H(t) * (l = U(e)) * H(r) - H(e) * (o = U(t)) * H(n)) / (o * l * a)) : (t + e) / 2;
1551
+ }
1552
+ function Ye(n, t, r, e) {
1553
+ var o;
1554
+ if (n == null)
1555
+ o = r * sn, e.point(-z, o), e.point(0, o), e.point(z, o), e.point(z, 0), e.point(z, -o), e.point(0, -o), e.point(-z, -o), e.point(-z, 0), e.point(-z, o);
1556
+ else if (q(n[0] - t[0]) > G) {
1557
+ var l = n[0] < t[0] ? z : -z;
1558
+ o = r * l / 2, e.point(-l, o), e.point(0, o), e.point(l, o);
1559
+ } else
1560
+ e.point(t[0], t[1]);
1561
+ }
1562
+ function Ze(n) {
1563
+ var t = U(n), r = 2 * Z, e = t > 0, o = q(t) > G;
1564
+ function l(i, u, c, m) {
1565
+ Xe(m, n, r, c, i, u);
1566
+ }
1567
+ function a(i, u) {
1568
+ return U(i) * U(u) > t;
1569
+ }
1570
+ function s(i) {
1571
+ var u, c, m, d, S;
1572
+ return {
1573
+ lineStart: function() {
1574
+ d = m = !1, S = 1;
1575
+ },
1576
+ point: function(v, w) {
1577
+ var y = [v, w], M, E = a(v, w), b = e ? E ? 0 : p(v, w) : E ? p(v + (v < 0 ? z : -z), w) : 0;
1578
+ if (!u && (d = m = E) && i.lineStart(), E !== m && (M = h(u, y), (!M || Dn(u, M) || Dn(y, M)) && (y[2] = 1)), E !== m)
1579
+ S = 0, E ? (i.lineStart(), M = h(y, u), i.point(M[0], M[1])) : (M = h(u, y), i.point(M[0], M[1], 2), i.lineEnd()), u = M;
1580
+ else if (o && u && e ^ E) {
1581
+ var C;
1582
+ !(b & c) && (C = h(y, u, !0)) && (S = 0, e ? (i.lineStart(), i.point(C[0][0], C[0][1]), i.point(C[1][0], C[1][1]), i.lineEnd()) : (i.point(C[1][0], C[1][1]), i.lineEnd(), i.lineStart(), i.point(C[0][0], C[0][1], 3)));
1583
+ }
1584
+ E && (!u || !Dn(u, y)) && i.point(y[0], y[1]), u = y, m = E, c = b;
1585
+ },
1586
+ lineEnd: function() {
1587
+ m && i.lineEnd(), u = null;
1588
+ },
1589
+ // Rejoin first and last segments if there were intersections and the first
1590
+ // and last points were visible.
1591
+ clean: function() {
1592
+ return S | (d && m) << 1;
1593
+ }
1594
+ };
1595
+ }
1596
+ function h(i, u, c) {
1597
+ var m = Mn(i), d = Mn(u), S = [1, 0, 0], v = Gn(m, d), w = On(v, v), y = v[0], M = w - y * y;
1598
+ if (!M) return !c && i;
1599
+ var E = t * w / M, b = -t * y / M, C = Gn(S, v), L = Bn(S, E), A = Bn(v, b);
1600
+ Yn(L, A);
1601
+ var $ = C, N = On(L, $), x = On($, $), B = N * N - x * (On(L, L) - 1);
1602
+ if (!(B < 0)) {
1603
+ var I = Hn(B), T = Bn($, (-N - I) / x);
1604
+ if (Yn(T, L), T = tt(T), !c) return T;
1605
+ var f = i[0], g = u[0], R = i[1], k = u[1], F;
1606
+ g < f && (F = f, f = g, g = F);
1607
+ var K = g - f, Q = q(K - z) < G, V = Q || K < G;
1608
+ if (!Q && k < R && (F = R, R = k, k = F), V ? Q ? R + k > 0 ^ T[1] < (q(T[0] - f) < G ? R : k) : R <= T[1] && T[1] <= k : K > z ^ (f <= T[0] && T[0] <= g)) {
1609
+ var Y = Bn($, (-N + I) / x);
1610
+ return Yn(Y, L), [T, tt(Y)];
1611
+ }
1612
+ }
1613
+ }
1614
+ function p(i, u) {
1615
+ var c = e ? n : z - n, m = 0;
1616
+ return i < -c ? m |= 1 : i > c && (m |= 2), u < -c ? m |= 4 : u > c && (m |= 8), m;
1617
+ }
1618
+ return Kt(a, s, l, e ? [0, -n] : [-z, n - z]);
1619
+ }
1620
+ function Qe(n, t, r, e, o, l) {
1621
+ var a = n[0], s = n[1], h = t[0], p = t[1], i = 0, u = 1, c = h - a, m = p - s, d;
1622
+ if (d = r - a, !(!c && d > 0)) {
1623
+ if (d /= c, c < 0) {
1624
+ if (d < i) return;
1625
+ d < u && (u = d);
1626
+ } else if (c > 0) {
1627
+ if (d > u) return;
1628
+ d > i && (i = d);
1629
+ }
1630
+ if (d = o - a, !(!c && d < 0)) {
1631
+ if (d /= c, c < 0) {
1632
+ if (d > u) return;
1633
+ d > i && (i = d);
1634
+ } else if (c > 0) {
1635
+ if (d < i) return;
1636
+ d < u && (u = d);
1637
+ }
1638
+ if (d = e - s, !(!m && d > 0)) {
1639
+ if (d /= m, m < 0) {
1640
+ if (d < i) return;
1641
+ d < u && (u = d);
1642
+ } else if (m > 0) {
1643
+ if (d > u) return;
1644
+ d > i && (i = d);
1645
+ }
1646
+ if (d = l - s, !(!m && d < 0)) {
1647
+ if (d /= m, m < 0) {
1648
+ if (d > u) return;
1649
+ d > i && (i = d);
1650
+ } else if (m > 0) {
1651
+ if (d < i) return;
1652
+ d < u && (u = d);
1653
+ }
1654
+ return i > 0 && (n[0] = a + i * c, n[1] = s + i * m), u < 1 && (t[0] = a + u * c, t[1] = s + u * m), !0;
1655
+ }
1656
+ }
1657
+ }
1658
+ }
1659
+ }
1660
+ var Tn = 1e9, zn = -Tn;
1661
+ function je(n, t, r, e) {
1662
+ function o(p, i) {
1663
+ return n <= p && p <= r && t <= i && i <= e;
1664
+ }
1665
+ function l(p, i, u, c) {
1666
+ var m = 0, d = 0;
1667
+ if (p == null || (m = a(p, u)) !== (d = a(i, u)) || h(p, i) < 0 ^ u > 0)
1668
+ do
1669
+ c.point(m === 0 || m === 3 ? n : r, m > 1 ? e : t);
1670
+ while ((m = (m + u + 4) % 4) !== d);
1671
+ else
1672
+ c.point(i[0], i[1]);
1673
+ }
1674
+ function a(p, i) {
1675
+ return q(p[0] - n) < G ? i > 0 ? 0 : 3 : q(p[0] - r) < G ? i > 0 ? 2 : 1 : q(p[1] - t) < G ? i > 0 ? 1 : 0 : i > 0 ? 3 : 2;
1676
+ }
1677
+ function s(p, i) {
1678
+ return h(p.x, i.x);
1679
+ }
1680
+ function h(p, i) {
1681
+ var u = a(p, 1), c = a(i, 1);
1682
+ return u !== c ? u - c : u === 0 ? i[1] - p[1] : u === 1 ? p[0] - i[0] : u === 2 ? p[1] - i[1] : i[0] - p[0];
1683
+ }
1684
+ return function(p) {
1685
+ var i = p, u = Ut(), c, m, d, S, v, w, y, M, E, b, C, L = {
1686
+ point: A,
1687
+ lineStart: B,
1688
+ lineEnd: I,
1689
+ polygonStart: N,
1690
+ polygonEnd: x
1691
+ };
1692
+ function A(f, g) {
1693
+ o(f, g) && i.point(f, g);
1694
+ }
1695
+ function $() {
1696
+ for (var f = 0, g = 0, R = m.length; g < R; ++g)
1697
+ for (var k = m[g], F = 1, K = k.length, Q = k[0], V, Y, tn = Q[0], W = Q[1]; F < K; ++F)
1698
+ V = tn, Y = W, Q = k[F], tn = Q[0], W = Q[1], Y <= e ? W > e && (tn - V) * (e - Y) > (W - Y) * (n - V) && ++f : W <= e && (tn - V) * (e - Y) < (W - Y) * (n - V) && --f;
1699
+ return f;
1700
+ }
1701
+ function N() {
1702
+ i = u, c = [], m = [], C = !0;
1703
+ }
1704
+ function x() {
1705
+ var f = $(), g = C && f, R = (c = Wt(c)).length;
1706
+ (g || R) && (p.polygonStart(), g && (p.lineStart(), l(null, null, 1, p), p.lineEnd()), R && Ht(c, s, f, l, p), p.polygonEnd()), i = p, c = m = d = null;
1707
+ }
1708
+ function B() {
1709
+ L.point = T, m && m.push(d = []), b = !0, E = !1, y = M = NaN;
1710
+ }
1711
+ function I() {
1712
+ c && (T(S, v), w && E && u.rejoin(), c.push(u.result())), L.point = A, E && i.lineEnd();
1713
+ }
1714
+ function T(f, g) {
1715
+ var R = o(f, g);
1716
+ if (m && d.push([f, g]), b)
1717
+ S = f, v = g, w = R, b = !1, R && (i.lineStart(), i.point(f, g));
1718
+ else if (R && E) i.point(f, g);
1719
+ else {
1720
+ var k = [y = Math.max(zn, Math.min(Tn, y)), M = Math.max(zn, Math.min(Tn, M))], F = [f = Math.max(zn, Math.min(Tn, f)), g = Math.max(zn, Math.min(Tn, g))];
1721
+ Qe(k, F, n, t, r, e) ? (E || (i.lineStart(), i.point(k[0], k[1])), i.point(F[0], F[1]), R || i.lineEnd(), C = !1) : R && (i.lineStart(), i.point(f, g), C = !1);
1722
+ }
1723
+ y = f, M = g, E = R;
1724
+ }
1725
+ return L;
1726
+ };
1727
+ }
1728
+ const At = (n) => n;
1729
+ var bn = 1 / 0, Wn = bn, kn = -bn, Xn = kn, Tt = {
1730
+ point: Je,
1731
+ lineStart: An,
1732
+ lineEnd: An,
1733
+ polygonStart: An,
1734
+ polygonEnd: An,
1735
+ result: function() {
1736
+ var n = [[bn, Wn], [kn, Xn]];
1737
+ return kn = Xn = -(Wn = bn = 1 / 0), n;
1738
+ }
1739
+ };
1740
+ function Je(n, t) {
1741
+ n < bn && (bn = n), n > kn && (kn = n), t < Wn && (Wn = t), t > Xn && (Xn = t);
1742
+ }
1743
+ function ut(n) {
1744
+ return function(t) {
1745
+ var r = new it();
1746
+ for (var e in n) r[e] = n[e];
1747
+ return r.stream = t, r;
1748
+ };
1749
+ }
1750
+ function it() {
1751
+ }
1752
+ it.prototype = {
1753
+ constructor: it,
1754
+ point: function(n, t) {
1755
+ this.stream.point(n, t);
1756
+ },
1757
+ sphere: function() {
1758
+ this.stream.sphere();
1759
+ },
1760
+ lineStart: function() {
1761
+ this.stream.lineStart();
1762
+ },
1763
+ lineEnd: function() {
1764
+ this.stream.lineEnd();
1765
+ },
1766
+ polygonStart: function() {
1767
+ this.stream.polygonStart();
1768
+ },
1769
+ polygonEnd: function() {
1770
+ this.stream.polygonEnd();
1771
+ }
1772
+ };
1773
+ function st(n, t, r) {
1774
+ var e = n.clipExtent && n.clipExtent();
1775
+ return n.scale(150).translate([0, 0]), e != null && n.clipExtent(null), Ge(r, n.stream(Tt)), t(Tt.result()), e != null && n.clipExtent(e), n;
1776
+ }
1777
+ function Vt(n, t, r) {
1778
+ return st(n, function(e) {
1779
+ var o = t[1][0] - t[0][0], l = t[1][1] - t[0][1], a = Math.min(o / (e[1][0] - e[0][0]), l / (e[1][1] - e[0][1])), s = +t[0][0] + (o - a * (e[1][0] + e[0][0])) / 2, h = +t[0][1] + (l - a * (e[1][1] + e[0][1])) / 2;
1780
+ n.scale(150 * a).translate([s, h]);
1781
+ }, r);
1782
+ }
1783
+ function nr(n, t, r) {
1784
+ return Vt(n, [[0, 0], t], r);
1785
+ }
1786
+ function tr(n, t, r) {
1787
+ return st(n, function(e) {
1788
+ var o = +t, l = o / (e[1][0] - e[0][0]), a = (o - l * (e[1][0] + e[0][0])) / 2, s = -l * e[0][1];
1789
+ n.scale(150 * l).translate([a, s]);
1790
+ }, r);
1791
+ }
1792
+ function er(n, t, r) {
1793
+ return st(n, function(e) {
1794
+ var o = +t, l = o / (e[1][1] - e[0][1]), a = -l * e[0][0], s = (o - l * (e[1][1] + e[0][1])) / 2;
1795
+ n.scale(150 * l).translate([a, s]);
1796
+ }, r);
1797
+ }
1798
+ var Rt = 16, rr = U(30 * Z);
1799
+ function $t(n, t) {
1800
+ return +t ? ir(n, t) : or(n);
1801
+ }
1802
+ function or(n) {
1803
+ return ut({
1804
+ point: function(t, r) {
1805
+ t = n(t, r), this.stream.point(t[0], t[1]);
1806
+ }
1807
+ });
1808
+ }
1809
+ function ir(n, t) {
1810
+ function r(e, o, l, a, s, h, p, i, u, c, m, d, S, v) {
1811
+ var w = p - e, y = i - o, M = w * w + y * y;
1812
+ if (M > 4 * t && S--) {
1813
+ var E = a + c, b = s + m, C = h + d, L = Hn(E * E + b * b + C * C), A = In(C /= L), $ = q(q(C) - 1) < G || q(l - u) < G ? (l + u) / 2 : $n(b, E), N = n($, A), x = N[0], B = N[1], I = x - e, T = B - o, f = y * I - w * T;
1814
+ (f * f / M > t || q((w * I + y * T) / M - 0.5) > 0.3 || a * c + s * m + h * d < rr) && (r(e, o, l, a, s, h, x, B, $, E /= L, b /= L, C, S, v), v.point(x, B), r(x, B, $, E, b, C, p, i, u, c, m, d, S, v));
1815
+ }
1816
+ }
1817
+ return function(e) {
1818
+ var o, l, a, s, h, p, i, u, c, m, d, S, v = {
1819
+ point: w,
1820
+ lineStart: y,
1821
+ lineEnd: E,
1822
+ polygonStart: function() {
1823
+ e.polygonStart(), v.lineStart = b;
1824
+ },
1825
+ polygonEnd: function() {
1826
+ e.polygonEnd(), v.lineStart = y;
1827
+ }
1828
+ };
1829
+ function w(A, $) {
1830
+ A = n(A, $), e.point(A[0], A[1]);
1831
+ }
1832
+ function y() {
1833
+ u = NaN, v.point = M, e.lineStart();
1834
+ }
1835
+ function M(A, $) {
1836
+ var N = Mn([A, $]), x = n(A, $);
1837
+ r(u, c, i, m, d, S, u = x[0], c = x[1], i = A, m = N[0], d = N[1], S = N[2], Rt, e), e.point(u, c);
1838
+ }
1839
+ function E() {
1840
+ v.point = w, e.lineEnd();
1841
+ }
1842
+ function b() {
1843
+ y(), v.point = C, v.lineEnd = L;
1844
+ }
1845
+ function C(A, $) {
1846
+ M(o = A, $), l = u, a = c, s = m, h = d, p = S, v.point = M;
1847
+ }
1848
+ function L() {
1849
+ r(u, c, i, m, d, S, l, a, o, s, h, p, Rt, e), v.lineEnd = E, E();
1850
+ }
1851
+ return v;
1852
+ };
1853
+ }
1854
+ var lr = ut({
1855
+ point: function(n, t) {
1856
+ this.stream.point(n * Z, t * Z);
1857
+ }
1858
+ });
1859
+ function ar(n) {
1860
+ return ut({
1861
+ point: function(t, r) {
1862
+ var e = n(t, r);
1863
+ return this.stream.point(e[0], e[1]);
1864
+ }
1865
+ });
1866
+ }
1867
+ function ur(n, t, r, e, o) {
1868
+ function l(a, s) {
1869
+ return a *= e, s *= o, [t + n * a, r - n * s];
1870
+ }
1871
+ return l.invert = function(a, s) {
1872
+ return [(a - t) / n * e, (r - s) / n * o];
1873
+ }, l;
1874
+ }
1875
+ function It(n, t, r, e, o, l) {
1876
+ if (!l) return ur(n, t, r, e, o);
1877
+ var a = U(l), s = H(l), h = a * n, p = s * n, i = a / n, u = s / n, c = (s * r - a * t) / n, m = (s * t + a * r) / n;
1878
+ function d(S, v) {
1879
+ return S *= e, v *= o, [h * S - p * v + t, r - p * S - h * v];
1880
+ }
1881
+ return d.invert = function(S, v) {
1882
+ return [e * (i * S - u * v + c), o * (m - u * S - i * v)];
1883
+ }, d;
1884
+ }
1885
+ function sr(n) {
1886
+ return cr(function() {
1887
+ return n;
1888
+ })();
1889
+ }
1890
+ function cr(n) {
1891
+ var t, r = 150, e = 480, o = 250, l = 0, a = 0, s = 0, h = 0, p = 0, i, u = 0, c = 1, m = 1, d = null, S = Nt, v = null, w, y, M, E = At, b = 0.5, C, L, A, $, N;
1892
+ function x(f) {
1893
+ return A(f[0] * Z, f[1] * Z);
1894
+ }
1895
+ function B(f) {
1896
+ return f = A.invert(f[0], f[1]), f && [f[0] * cn, f[1] * cn];
1897
+ }
1898
+ x.stream = function(f) {
1899
+ return $ && N === f ? $ : $ = lr(ar(i)(S(C(E(N = f)))));
1900
+ }, x.preclip = function(f) {
1901
+ return arguments.length ? (S = f, d = void 0, T()) : S;
1902
+ }, x.postclip = function(f) {
1903
+ return arguments.length ? (E = f, v = w = y = M = null, T()) : E;
1904
+ }, x.clipAngle = function(f) {
1905
+ return arguments.length ? (S = +f ? Ze(d = f * Z) : (d = null, Nt), T()) : d * cn;
1906
+ }, x.clipExtent = function(f) {
1907
+ return arguments.length ? (E = f == null ? (v = w = y = M = null, At) : je(v = +f[0][0], w = +f[0][1], y = +f[1][0], M = +f[1][1]), T()) : v == null ? null : [[v, w], [y, M]];
1908
+ }, x.scale = function(f) {
1909
+ return arguments.length ? (r = +f, I()) : r;
1910
+ }, x.translate = function(f) {
1911
+ return arguments.length ? (e = +f[0], o = +f[1], I()) : [e, o];
1912
+ }, x.center = function(f) {
1913
+ return arguments.length ? (l = f[0] % 360 * Z, a = f[1] % 360 * Z, I()) : [l * cn, a * cn];
1914
+ }, x.rotate = function(f) {
1915
+ return arguments.length ? (s = f[0] % 360 * Z, h = f[1] % 360 * Z, p = f.length > 2 ? f[2] % 360 * Z : 0, I()) : [s * cn, h * cn, p * cn];
1916
+ }, x.angle = function(f) {
1917
+ return arguments.length ? (u = f % 360 * Z, I()) : u * cn;
1918
+ }, x.reflectX = function(f) {
1919
+ return arguments.length ? (c = f ? -1 : 1, I()) : c < 0;
1920
+ }, x.reflectY = function(f) {
1921
+ return arguments.length ? (m = f ? -1 : 1, I()) : m < 0;
1922
+ }, x.precision = function(f) {
1923
+ return arguments.length ? (C = $t(L, b = f * f), T()) : Hn(b);
1924
+ }, x.fitExtent = function(f, g) {
1925
+ return Vt(x, f, g);
1926
+ }, x.fitSize = function(f, g) {
1927
+ return nr(x, f, g);
1928
+ }, x.fitWidth = function(f, g) {
1929
+ return tr(x, f, g);
1930
+ }, x.fitHeight = function(f, g) {
1931
+ return er(x, f, g);
1932
+ };
1933
+ function I() {
1934
+ var f = It(r, 0, 0, c, m, u).apply(null, t(l, a)), g = It(r, e - f[0], o - f[1], c, m, u);
1935
+ return i = qt(s, h, p), L = rt(t, g), A = rt(i, L), C = $t(L, b), T();
1936
+ }
1937
+ function T() {
1938
+ return $ = N = null, x;
1939
+ }
1940
+ return function() {
1941
+ return t = n.apply(this, arguments), x.invert = t.invert && B, I();
1942
+ };
1943
+ }
1944
+ function ct(n, t) {
1945
+ return [n, Pe(De((sn + t) / 2))];
1946
+ }
1947
+ ct.invert = function(n, t) {
1948
+ return [n, 2 * Xt(Be(t)) - sn];
1949
+ };
1950
+ function fr() {
1951
+ return pr(ct).scale(961 / fn);
1952
+ }
1953
+ function pr(n) {
1954
+ var t = sr(n), r = t.center, e = t.scale, o = t.translate, l = t.clipExtent, a = null, s, h, p;
1955
+ t.scale = function(u) {
1956
+ return arguments.length ? (e(u), i()) : e();
1957
+ }, t.translate = function(u) {
1958
+ return arguments.length ? (o(u), i()) : o();
1959
+ }, t.center = function(u) {
1960
+ return arguments.length ? (r(u), i()) : r();
1961
+ }, t.clipExtent = function(u) {
1962
+ return arguments.length ? (u == null ? a = s = h = p = null : (a = +u[0][0], s = +u[0][1], h = +u[1][0], p = +u[1][1]), i()) : a == null ? null : [[a, s], [h, p]];
1963
+ };
1964
+ function i() {
1965
+ var u = z * e(), c = t(We(t.rotate()).invert([0, 0]));
1966
+ return l(a == null ? [[c[0] - u, c[1] - u], [c[0] + u, c[1] + u]] : n === ct ? [[Math.max(c[0] - u, a), s], [Math.min(c[0] + u, h), p]] : [[a, Math.max(c[1] - u, s)], [h, Math.min(c[1] + u, p)]]);
1967
+ }
1968
+ return i();
1969
+ }
1970
+ function En(n, t) {
1971
+ return typeof t == "function" ? t(n) : n[t];
1972
+ }
1973
+ function Qn(n, t) {
1974
+ return typeof t == "function" ? t(n) : t;
1975
+ }
1976
+ const kt = 85.0511, Lt = fr(), dr = {
1977
+ project: (n) => {
1978
+ const t = Math.max(
1979
+ -kt,
1980
+ Math.min(kt, n[1])
1981
+ );
1982
+ return Lt([n[0], t]) ?? [0, 0];
1983
+ },
1984
+ unproject: (n) => Lt.invert?.(n) ?? [0, 0]
1985
+ }, qn = [
1986
+ [-180, 80],
1987
+ [180, -58]
1988
+ ];
1989
+ function Rn(n) {
1990
+ if (n !== null)
1991
+ return n ?? dr;
1992
+ }
1993
+ function Yt(n, [[t, r], [e, o]]) {
1994
+ const l = n ? n.project : (p) => p, a = Math.min(r, Math.max(o, 0)), s = Math.abs(l([e, a])[0] - l([t, a])[0]), h = Math.abs(l([0, r])[1] - l([0, o])[1]);
1995
+ return s > 0 && h > 0 ? s / h : 16 / 9;
1996
+ }
1997
+ const Zt = 8, Ft = /* @__PURE__ */ new WeakMap();
1998
+ function mr(n) {
1999
+ return n.replace(/[^a-zA-Z0-9_-]/g, "-");
2000
+ }
2001
+ function hr(n) {
2002
+ let t = 0;
2003
+ for (let r = 0; r < n.length; r++)
2004
+ t = Math.imul(31, t) + n.charCodeAt(r);
2005
+ return (t >>> 0).toString(36);
2006
+ }
2007
+ function Qt(n, t) {
2008
+ if (t) return mr(t);
2009
+ const r = Ft.get(n);
2010
+ if (r) return r;
2011
+ const e = `kumo-map-${hr(JSON.stringify(n))}`;
2012
+ return Ft.set(n, e), e;
2013
+ }
2014
+ function gr(n) {
2015
+ return {
2016
+ map: n.mapName,
2017
+ nameProperty: "name",
2018
+ roam: n.roam,
2019
+ // Prevent zooming far out into empty space while still allowing users to
2020
+ // zoom back to the lesser of ECharts' base scale and the configured zoom.
2021
+ ...n.roam ? {
2022
+ scaleLimit: {
2023
+ min: Math.min(1, n.zoom),
2024
+ max: n.zoom * Zt
2025
+ }
2026
+ } : {},
2027
+ center: n.center,
2028
+ zoom: n.zoom,
2029
+ // Crop empty poles / Antarctica so land fills the container.
2030
+ boundingCoords: qn,
2031
+ ...n.projection ? { projection: n.projection } : { aspectScale: 1 },
2032
+ silent: !0,
2033
+ itemStyle: {
2034
+ areaColor: n.areaColor,
2035
+ borderColor: n.areaColor,
2036
+ borderWidth: 0.5
2037
+ },
2038
+ emphasis: { disabled: !0 }
2039
+ };
2040
+ }
2041
+ function vr({
2042
+ echarts: n,
2043
+ geoJson: t,
2044
+ mapName: r,
2045
+ data: e,
2046
+ lng: o,
2047
+ lat: l,
2048
+ value: a,
2049
+ name: s,
2050
+ minRadius: h = 6,
2051
+ maxRadius: p = 26,
2052
+ bubbleSize: i,
2053
+ bubbleColor: u,
2054
+ bubbleBorderColor: c = "transparent",
2055
+ bubbleBorderWidth: m = 0,
2056
+ center: d,
2057
+ zoom: S = 1.25,
2058
+ roam: v = !1,
2059
+ projection: w,
2060
+ showTooltip: y = !0,
2061
+ valueFormat: M = at,
2062
+ tooltipFormatter: E,
2063
+ onBubbleHover: b,
2064
+ onBubbleClick: C,
2065
+ aspectRatio: L,
2066
+ height: A,
2067
+ className: $,
2068
+ isDarkMode: N
2069
+ }, x) {
2070
+ const B = en(
2071
+ () => Qt(t, r),
2072
+ [t, r]
2073
+ );
2074
+ jt(n, B, t);
2075
+ const I = en(
2076
+ () => gn.mapColors(N),
2077
+ [N]
2078
+ ), T = d?.[0], f = d?.[1], g = en(
2079
+ () => gr({
2080
+ mapName: B,
2081
+ areaColor: I.area,
2082
+ center: T !== void 0 && f !== void 0 ? [T, f] : void 0,
2083
+ zoom: S,
2084
+ roam: v,
2085
+ projection: Rn(w)
2086
+ }),
2087
+ [B, t, I, T, f, S, v, w]
2088
+ ), R = en(() => {
2089
+ if (A === void 0)
2090
+ return L ?? Yt(Rn(w), qn);
2091
+ }, [L, A, w]), k = nn(void 0), F = k.current !== g;
2092
+ pn(() => {
2093
+ k.current = g;
2094
+ }, [g]);
2095
+ const K = nn(b);
2096
+ K.current = b;
2097
+ const Q = mn(
2098
+ (rn) => {
2099
+ typeof x == "function" ? x(rn) : x && (x.current = rn);
2100
+ },
2101
+ [x]
2102
+ ), V = en(() => {
2103
+ const rn = e.map((j) => En(j, a)), on = rn.length ? Math.max(...rn) : 1, Sn = (j) => {
2104
+ if (i) return i(j);
2105
+ if (on <= 0) return h;
2106
+ const an = Math.sqrt(Math.max(0, j) / on);
2107
+ return h + an * (p - h);
2108
+ }, xn = e.map((j) => {
2109
+ const an = En(j, a);
2110
+ return {
2111
+ name: s ? En(j, s) : void 0,
2112
+ value: [En(j, o), En(j, l), an],
2113
+ symbolSize: Sn(an),
2114
+ itemStyle: {
2115
+ color: u ? Qn(j, u) : I.bubble,
2116
+ borderColor: Qn(j, c),
2117
+ borderWidth: Qn(j, m)
2118
+ },
2119
+ datum: j
2120
+ };
2121
+ });
2122
+ return {
2123
+ backgroundColor: "transparent",
2124
+ animation: !0,
2125
+ animationDuration: 500,
2126
+ animationDurationUpdate: 0,
2127
+ ...F ? { geo: g } : {},
2128
+ tooltip: y ? {
2129
+ trigger: "item",
2130
+ triggerOn: "mousemove",
2131
+ backgroundColor: "var(--color-kumo-base)",
2132
+ borderColor: "var(--color-kumo-line)",
2133
+ borderWidth: 1,
2134
+ padding: 8,
2135
+ textStyle: {
2136
+ color: "var(--text-color-kumo-default)",
2137
+ fontSize: 13
2138
+ },
2139
+ extraCssText: "border-radius: 0.5rem;",
2140
+ dangerousHtmlFormatter: (j) => {
2141
+ const an = j, O = an.data?.datum;
2142
+ if (E && O !== void 0)
2143
+ return E(O);
2144
+ const D = an.value?.[2], X = an.name ? `<strong>${yn(an.name)}</strong>` : "", J = D !== void 0 ? `<span style="color:var(--text-color-kumo-subtle)">${yn(M(D))}</span>` : "";
2145
+ return `<div style="display:flex;flex-direction:column;gap:2px;">${X}${J}</div>`;
2146
+ }
2147
+ } : void 0,
2148
+ series: [
2149
+ {
2150
+ id: "bubbles",
2151
+ type: "scatter",
2152
+ coordinateSystem: "geo",
2153
+ data: xn,
2154
+ itemStyle: { opacity: 0.8 },
2155
+ emphasis: { scale: 1.2, itemStyle: { opacity: 1 } },
2156
+ z: 3
2157
+ }
2158
+ ]
2159
+ };
2160
+ }, [
2161
+ I,
2162
+ g,
2163
+ F,
2164
+ e,
2165
+ o,
2166
+ l,
2167
+ a,
2168
+ s,
2169
+ h,
2170
+ p,
2171
+ i,
2172
+ u,
2173
+ c,
2174
+ m,
2175
+ y,
2176
+ E,
2177
+ M
2178
+ ]), Y = mn(
2179
+ (rn) => {
2180
+ const on = rn.data?.datum;
2181
+ on !== void 0 && K.current?.(on);
2182
+ },
2183
+ []
2184
+ ), tn = mn(() => {
2185
+ K.current?.(void 0);
2186
+ }, []), W = mn(
2187
+ (rn) => {
2188
+ const on = rn.data?.datum;
2189
+ on !== void 0 && C?.(on);
2190
+ },
2191
+ [C]
2192
+ ), ln = en(
2193
+ () => ({
2194
+ ...b ? {
2195
+ mouseover: Y,
2196
+ mouseout: tn,
2197
+ globalout: tn
2198
+ } : {},
2199
+ ...C ? { click: W } : {}
2200
+ }),
2201
+ [
2202
+ b,
2203
+ Y,
2204
+ tn,
2205
+ W,
2206
+ C
2207
+ ]
2208
+ );
2209
+ return /* @__PURE__ */ P(
2210
+ Ln,
2211
+ {
2212
+ echarts: n,
2213
+ ref: Q,
2214
+ options: V,
2215
+ className: $,
2216
+ isDarkMode: N,
2217
+ height: A,
2218
+ aspectRatio: R,
2219
+ onEvents: ln
2220
+ }
2221
+ );
2222
+ }
2223
+ const yr = Un(vr);
2224
+ yr.displayName = "BubbleMap";
2225
+ function Sr({
2226
+ echarts: n,
2227
+ geoJson: t,
2228
+ mapName: r,
2229
+ data: e,
2230
+ name: o,
2231
+ value: l,
2232
+ nameProperty: a = "name",
2233
+ colorRange: s,
2234
+ min: h,
2235
+ max: p,
2236
+ noDataColor: i,
2237
+ showLegend: u = !1,
2238
+ showTooltip: c = !0,
2239
+ valueFormat: m = at,
2240
+ tooltipFormatter: d,
2241
+ onRegionHover: S,
2242
+ onRegionClick: v,
2243
+ center: w,
2244
+ zoom: y = 1.25,
2245
+ roam: M = !1,
2246
+ projection: E,
2247
+ aspectRatio: b,
2248
+ height: C,
2249
+ className: L,
2250
+ isDarkMode: A
2251
+ }, $) {
2252
+ const N = en(
2253
+ () => Qt(t, r),
2254
+ [t, r]
2255
+ );
2256
+ jt(n, N, t);
2257
+ const x = en(
2258
+ () => gn.mapColors(A),
2259
+ [A]
2260
+ ), B = w?.[0], I = w?.[1], T = en(
2261
+ () => ({
2262
+ roam: M,
2263
+ ...M ? {
2264
+ scaleLimit: {
2265
+ min: Math.min(1, y),
2266
+ max: y * Zt
2267
+ }
2268
+ } : {},
2269
+ center: B !== void 0 && I !== void 0 ? [B, I] : void 0,
2270
+ zoom: y,
2271
+ // Crop empty poles / Antarctica so land fills the container.
2272
+ boundingCoords: qn,
2273
+ ...Rn(E) ? { projection: Rn(E) } : { aspectScale: 1 }
2274
+ }),
2275
+ [B, I, y, M, A, E]
2276
+ ), f = en(() => {
2277
+ if (C === void 0)
2278
+ return b ?? Yt(Rn(E), qn);
2279
+ }, [b, C, E]), g = nn(void 0), R = g.current !== T;
2280
+ pn(() => {
2281
+ g.current = T;
2282
+ }, [T]);
2283
+ const k = nn(S);
2284
+ k.current = S;
2285
+ const F = mn(
2286
+ (W) => {
2287
+ typeof $ == "function" ? $(W) : $ && ($.current = W);
2288
+ },
2289
+ [$]
2290
+ ), K = en(() => {
2291
+ const W = s ?? x.scale, ln = i ?? x.area, rn = e.map((D) => ({
2292
+ name: En(D, o),
2293
+ value: En(D, l),
2294
+ datum: D
2295
+ })), on = rn.map((D) => D.value), Sn = on.length ? Math.min(...on) : 0, xn = on.length ? Math.max(...on) : 1, j = h ?? Sn, an = p ?? (xn > Sn ? xn : Sn + 1);
2296
+ return {
2297
+ backgroundColor: "transparent",
2298
+ animation: !0,
2299
+ animationDuration: 500,
2300
+ animationDurationUpdate: 0,
2301
+ visualMap: {
2302
+ type: "continuous",
2303
+ show: u,
2304
+ min: j,
2305
+ max: an,
2306
+ calculable: !1,
2307
+ hoverLink: !1,
2308
+ inRange: { color: W },
2309
+ orient: "horizontal",
2310
+ text: ["High", "Low"],
2311
+ left: 0,
2312
+ bottom: 8,
2313
+ textStyle: {
2314
+ color: gn.text("primary", A),
2315
+ fontSize: 11
2316
+ }
2317
+ },
2318
+ tooltip: c ? {
2319
+ trigger: "item",
2320
+ triggerOn: "mousemove",
2321
+ backgroundColor: "var(--color-kumo-base)",
2322
+ borderColor: "var(--color-kumo-line)",
2323
+ borderWidth: 1,
2324
+ padding: 8,
2325
+ textStyle: {
2326
+ color: "var(--text-color-kumo-default)",
2327
+ fontSize: 13
2328
+ },
2329
+ extraCssText: "border-radius: 0.5rem;",
2330
+ dangerousHtmlFormatter: (D) => {
2331
+ const X = D, J = X.data?.datum;
2332
+ if (J === void 0) return "";
2333
+ if (d) return d(J);
2334
+ const hn = typeof X.value == "number" && !Number.isNaN(X.value) ? X.value : void 0, wn = X.name ? `<strong>${yn(X.name)}</strong>` : "", _ = hn !== void 0 ? `<span style="color:var(--text-color-kumo-subtle)">${yn(m(hn))}</span>` : "";
2335
+ return `<div style="display:flex;flex-direction:column;gap:2px;">${wn}${_}</div>`;
2336
+ }
2337
+ } : void 0,
2338
+ series: [
2339
+ {
2340
+ id: "regions",
2341
+ type: "map",
2342
+ map: N,
2343
+ nameProperty: a,
2344
+ ...R ? T : {},
2345
+ data: rn,
2346
+ itemStyle: {
2347
+ areaColor: ln,
2348
+ borderColor: "transparent",
2349
+ borderWidth: 0
2350
+ },
2351
+ label: { show: !1 },
2352
+ emphasis: {
2353
+ focus: "self",
2354
+ label: { show: !1 },
2355
+ itemStyle: {
2356
+ areaColor: "inherit"
2357
+ }
2358
+ },
2359
+ blur: {
2360
+ label: { show: !1 },
2361
+ itemStyle: { opacity: 0.45 }
2362
+ },
2363
+ select: { disabled: !0 },
2364
+ z: 1
2365
+ }
2366
+ ]
2367
+ };
2368
+ }, [
2369
+ A,
2370
+ x,
2371
+ t,
2372
+ N,
2373
+ T,
2374
+ R,
2375
+ e,
2376
+ o,
2377
+ l,
2378
+ a,
2379
+ s,
2380
+ h,
2381
+ p,
2382
+ i,
2383
+ u,
2384
+ c,
2385
+ d,
2386
+ m
2387
+ ]), Q = mn(
2388
+ (W) => {
2389
+ const ln = W.data?.datum;
2390
+ ln !== void 0 && k.current?.(ln);
2391
+ },
2392
+ []
2393
+ ), V = mn(() => {
2394
+ k.current?.(void 0);
2395
+ }, []), Y = mn(
2396
+ (W) => {
2397
+ const ln = W.data?.datum;
2398
+ ln !== void 0 && v?.(ln);
2399
+ },
2400
+ [v]
2401
+ ), tn = en(
2402
+ () => ({
2403
+ ...S ? {
2404
+ mouseover: Q,
2405
+ mouseout: V,
2406
+ globalout: V
2407
+ } : {},
2408
+ ...v ? { click: Y } : {}
2409
+ }),
2410
+ [
2411
+ S,
2412
+ Q,
2413
+ V,
2414
+ Y,
2415
+ v
2416
+ ]
2417
+ );
2418
+ return /* @__PURE__ */ P(
2419
+ Ln,
2420
+ {
2421
+ echarts: n,
2422
+ ref: F,
2423
+ options: K,
2424
+ className: L,
2425
+ isDarkMode: A,
2426
+ height: C,
2427
+ aspectRatio: f,
2428
+ onEvents: tn
2429
+ }
2430
+ );
2431
+ }
2432
+ const xr = Un(Sr);
2433
+ xr.displayName = "ChoroplethMap";
2434
+ function jt(n, t, r) {
2435
+ te(() => {
2436
+ n.registerMap(t, r);
2437
+ }, [n, t, r]);
2438
+ }
2439
+ export {
2440
+ yr as B,
2441
+ Ln as C,
2442
+ Le as S,
2443
+ we as T,
2444
+ Cr as a,
2445
+ xr as b,
2446
+ gn as c
2447
+ };
2448
+ //# sourceMappingURL=Maps-imwfwgb7do9lr3i5.js.map