cool-globe 0.1.3 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -2
- package/dist/cool-globe.cjs +5 -5
- package/dist/cool-globe.js +585 -543
- package/dist/lib/CoolGlobe.d.ts +1 -1
- package/dist/lib/dashboardGlobe.utils.d.ts +7 -0
- package/dist/lib/types.d.ts +2 -0
- package/package.json +1 -1
package/dist/cool-globe.js
CHANGED
|
@@ -1,99 +1,99 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useRef as
|
|
3
|
-
import
|
|
4
|
-
import { Color as
|
|
5
|
-
function
|
|
1
|
+
import { jsx as Oe } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as V, useState as G, useEffect as z, useMemo as se, useCallback as ve } from "react";
|
|
3
|
+
import xn from "react-globe.gl";
|
|
4
|
+
import { Color as Ne } from "three";
|
|
5
|
+
function bn(e) {
|
|
6
6
|
return e;
|
|
7
7
|
}
|
|
8
|
-
function
|
|
9
|
-
if (e == null) return
|
|
10
|
-
var n, t, r = e.scale[0], i = e.scale[1],
|
|
11
|
-
return function(
|
|
8
|
+
function yn(e) {
|
|
9
|
+
if (e == null) return bn;
|
|
10
|
+
var n, t, r = e.scale[0], i = e.scale[1], o = e.translate[0], s = e.translate[1];
|
|
11
|
+
return function(a, l) {
|
|
12
12
|
l || (n = t = 0);
|
|
13
|
-
var f = 2,
|
|
14
|
-
for (
|
|
15
|
-
return
|
|
13
|
+
var f = 2, d = a.length, c = new Array(d);
|
|
14
|
+
for (c[0] = (n += a[0]) * r + o, c[1] = (t += a[1]) * i + s; f < d; ) c[f] = a[f], ++f;
|
|
15
|
+
return c;
|
|
16
16
|
};
|
|
17
17
|
}
|
|
18
|
-
function
|
|
18
|
+
function wn(e, n) {
|
|
19
19
|
for (var t, r = e.length, i = r - n; i < --r; ) t = e[i], e[i++] = e[r], e[r] = t;
|
|
20
20
|
}
|
|
21
|
-
function
|
|
21
|
+
function vn(e, n) {
|
|
22
22
|
return typeof n == "string" && (n = e.objects[n]), n.type === "GeometryCollection" ? { type: "FeatureCollection", features: n.geometries.map(function(t) {
|
|
23
|
-
return
|
|
24
|
-
}) } :
|
|
25
|
-
}
|
|
26
|
-
function
|
|
27
|
-
var t = n.id, r = n.bbox, i = n.properties == null ? {} : n.properties,
|
|
28
|
-
return t == null && r == null ? { type: "Feature", properties: i, geometry:
|
|
29
|
-
}
|
|
30
|
-
function
|
|
31
|
-
var t =
|
|
32
|
-
function i(
|
|
33
|
-
|
|
34
|
-
for (var
|
|
35
|
-
|
|
36
|
-
|
|
23
|
+
return ze(e, t);
|
|
24
|
+
}) } : ze(e, n);
|
|
25
|
+
}
|
|
26
|
+
function ze(e, n) {
|
|
27
|
+
var t = n.id, r = n.bbox, i = n.properties == null ? {} : n.properties, o = Nn(e, n);
|
|
28
|
+
return t == null && r == null ? { type: "Feature", properties: i, geometry: o } : r == null ? { type: "Feature", id: t, properties: i, geometry: o } : { type: "Feature", id: t, bbox: r, properties: i, geometry: o };
|
|
29
|
+
}
|
|
30
|
+
function Nn(e, n) {
|
|
31
|
+
var t = yn(e.transform), r = e.arcs;
|
|
32
|
+
function i(d, c) {
|
|
33
|
+
c.length && c.pop();
|
|
34
|
+
for (var h = r[d < 0 ? ~d : d], N = 0, k = h.length; N < k; ++N)
|
|
35
|
+
c.push(t(h[N], N));
|
|
36
|
+
d < 0 && wn(c, k);
|
|
37
37
|
}
|
|
38
|
-
function
|
|
39
|
-
return t(
|
|
38
|
+
function o(d) {
|
|
39
|
+
return t(d);
|
|
40
40
|
}
|
|
41
|
-
function
|
|
42
|
-
for (var
|
|
43
|
-
return
|
|
41
|
+
function s(d) {
|
|
42
|
+
for (var c = [], h = 0, N = d.length; h < N; ++h) i(d[h], c);
|
|
43
|
+
return c.length < 2 && c.push(c[0]), c;
|
|
44
44
|
}
|
|
45
|
-
function
|
|
46
|
-
for (var
|
|
47
|
-
return
|
|
45
|
+
function a(d) {
|
|
46
|
+
for (var c = s(d); c.length < 4; ) c.push(c[0]);
|
|
47
|
+
return c;
|
|
48
48
|
}
|
|
49
|
-
function l(
|
|
50
|
-
return
|
|
49
|
+
function l(d) {
|
|
50
|
+
return d.map(a);
|
|
51
51
|
}
|
|
52
|
-
function f(
|
|
53
|
-
var
|
|
54
|
-
switch (
|
|
52
|
+
function f(d) {
|
|
53
|
+
var c = d.type, h;
|
|
54
|
+
switch (c) {
|
|
55
55
|
case "GeometryCollection":
|
|
56
|
-
return { type:
|
|
56
|
+
return { type: c, geometries: d.geometries.map(f) };
|
|
57
57
|
case "Point":
|
|
58
|
-
|
|
58
|
+
h = o(d.coordinates);
|
|
59
59
|
break;
|
|
60
60
|
case "MultiPoint":
|
|
61
|
-
|
|
61
|
+
h = d.coordinates.map(o);
|
|
62
62
|
break;
|
|
63
63
|
case "LineString":
|
|
64
|
-
|
|
64
|
+
h = s(d.arcs);
|
|
65
65
|
break;
|
|
66
66
|
case "MultiLineString":
|
|
67
|
-
|
|
67
|
+
h = d.arcs.map(s);
|
|
68
68
|
break;
|
|
69
69
|
case "Polygon":
|
|
70
|
-
|
|
70
|
+
h = l(d.arcs);
|
|
71
71
|
break;
|
|
72
72
|
case "MultiPolygon":
|
|
73
|
-
|
|
73
|
+
h = d.arcs.map(l);
|
|
74
74
|
break;
|
|
75
75
|
default:
|
|
76
76
|
return null;
|
|
77
77
|
}
|
|
78
|
-
return { type:
|
|
78
|
+
return { type: c, coordinates: h };
|
|
79
79
|
}
|
|
80
80
|
return f(n);
|
|
81
81
|
}
|
|
82
|
-
const
|
|
82
|
+
const Mn = "https://raw.githubusercontent.com/nvkelso/natural-earth-vector/master/geojson/ne_110m_admin_0_countries.geojson", _n = "https://cdn.jsdelivr.net/npm/world-atlas@2/countries-110m.json", $n = "https://raw.githubusercontent.com/nvkelso/natural-earth-vector/master/geojson/ne_10m_admin_1_states_provinces.geojson", Rn = "data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='4' height='4'><rect width='4' height='4' fill='%23f5f5f5'/></svg>", Cn = {
|
|
83
83
|
minColor: "#f8fafc",
|
|
84
84
|
maxColor: "#e5e7eb"
|
|
85
85
|
};
|
|
86
|
-
function
|
|
86
|
+
function Ee(e, n, t) {
|
|
87
87
|
e.prototype = n.prototype = t, t.constructor = e;
|
|
88
88
|
}
|
|
89
|
-
function
|
|
89
|
+
function on(e, n) {
|
|
90
90
|
var t = Object.create(e.prototype);
|
|
91
91
|
for (var r in n) t[r] = n[r];
|
|
92
92
|
return t;
|
|
93
93
|
}
|
|
94
94
|
function te() {
|
|
95
95
|
}
|
|
96
|
-
var Q = 0.7,
|
|
96
|
+
var Q = 0.7, me = 1 / Q, X = "\\s*([+-]?\\d+)\\s*", ee = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*", j = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*", kn = /^#([0-9a-f]{3,8})$/, Ln = new RegExp(`^rgb\\(${X},${X},${X}\\)$`), An = new RegExp(`^rgb\\(${j},${j},${j}\\)$`), Sn = new RegExp(`^rgba\\(${X},${X},${X},${ee}\\)$`), En = new RegExp(`^rgba\\(${j},${j},${j},${ee}\\)$`), In = new RegExp(`^hsl\\(${ee},${j},${j}\\)$`), Fn = new RegExp(`^hsla\\(${ee},${j},${j},${ee}\\)$`), He = {
|
|
97
97
|
aliceblue: 15792383,
|
|
98
98
|
antiquewhite: 16444375,
|
|
99
99
|
aqua: 65535,
|
|
@@ -243,243 +243,243 @@ var Q = 0.7, de = 1 / Q, J = "\\s*([+-]?\\d+)\\s*", ee = "\\s*([+-]?(?:\\d*\\.)?
|
|
|
243
243
|
yellow: 16776960,
|
|
244
244
|
yellowgreen: 10145074
|
|
245
245
|
};
|
|
246
|
-
|
|
246
|
+
Ee(te, ne, {
|
|
247
247
|
copy(e) {
|
|
248
248
|
return Object.assign(new this.constructor(), this, e);
|
|
249
249
|
},
|
|
250
250
|
displayable() {
|
|
251
251
|
return this.rgb().displayable();
|
|
252
252
|
},
|
|
253
|
-
hex:
|
|
253
|
+
hex: Te,
|
|
254
254
|
// Deprecated! Use color.formatHex.
|
|
255
|
-
formatHex:
|
|
256
|
-
formatHex8:
|
|
257
|
-
formatHsl:
|
|
258
|
-
formatRgb:
|
|
259
|
-
toString:
|
|
255
|
+
formatHex: Te,
|
|
256
|
+
formatHex8: jn,
|
|
257
|
+
formatHsl: Pn,
|
|
258
|
+
formatRgb: Ge,
|
|
259
|
+
toString: Ge
|
|
260
260
|
});
|
|
261
|
-
function
|
|
261
|
+
function Te() {
|
|
262
262
|
return this.rgb().formatHex();
|
|
263
263
|
}
|
|
264
|
-
function
|
|
264
|
+
function jn() {
|
|
265
265
|
return this.rgb().formatHex8();
|
|
266
266
|
}
|
|
267
|
-
function
|
|
268
|
-
return
|
|
267
|
+
function Pn() {
|
|
268
|
+
return an(this).formatHsl();
|
|
269
269
|
}
|
|
270
|
-
function
|
|
270
|
+
function Ge() {
|
|
271
271
|
return this.rgb().formatRgb();
|
|
272
272
|
}
|
|
273
273
|
function ne(e) {
|
|
274
274
|
var n, t;
|
|
275
|
-
return e = (e + "").trim().toLowerCase(), (n =
|
|
275
|
+
return e = (e + "").trim().toLowerCase(), (n = kn.exec(e)) ? (t = n[1].length, n = parseInt(n[1], 16), t === 6 ? Ue(n) : t === 3 ? new C(n >> 8 & 15 | n >> 4 & 240, n >> 4 & 15 | n & 240, (n & 15) << 4 | n & 15, 1) : t === 8 ? fe(n >> 24 & 255, n >> 16 & 255, n >> 8 & 255, (n & 255) / 255) : t === 4 ? fe(n >> 12 & 15 | n >> 8 & 240, n >> 8 & 15 | n >> 4 & 240, n >> 4 & 15 | n & 240, ((n & 15) << 4 | n & 15) / 255) : null) : (n = Ln.exec(e)) ? new C(n[1], n[2], n[3], 1) : (n = An.exec(e)) ? new C(n[1] * 255 / 100, n[2] * 255 / 100, n[3] * 255 / 100, 1) : (n = Sn.exec(e)) ? fe(n[1], n[2], n[3], n[4]) : (n = En.exec(e)) ? fe(n[1] * 255 / 100, n[2] * 255 / 100, n[3] * 255 / 100, n[4]) : (n = In.exec(e)) ? Ve(n[1], n[2] / 100, n[3] / 100, 1) : (n = Fn.exec(e)) ? Ve(n[1], n[2] / 100, n[3] / 100, n[4]) : He.hasOwnProperty(e) ? Ue(He[e]) : e === "transparent" ? new C(NaN, NaN, NaN, 0) : null;
|
|
276
276
|
}
|
|
277
|
-
function
|
|
278
|
-
return new
|
|
277
|
+
function Ue(e) {
|
|
278
|
+
return new C(e >> 16 & 255, e >> 8 & 255, e & 255, 1);
|
|
279
279
|
}
|
|
280
280
|
function fe(e, n, t, r) {
|
|
281
|
-
return r <= 0 && (e = n = t = NaN), new
|
|
281
|
+
return r <= 0 && (e = n = t = NaN), new C(e, n, t, r);
|
|
282
282
|
}
|
|
283
|
-
function
|
|
284
|
-
return e instanceof te || (e = ne(e)), e ? (e = e.rgb(), new
|
|
283
|
+
function On(e) {
|
|
284
|
+
return e instanceof te || (e = ne(e)), e ? (e = e.rgb(), new C(e.r, e.g, e.b, e.opacity)) : new C();
|
|
285
285
|
}
|
|
286
|
-
function
|
|
287
|
-
return arguments.length === 1 ?
|
|
286
|
+
function Ce(e, n, t, r) {
|
|
287
|
+
return arguments.length === 1 ? On(e) : new C(e, n, t, r ?? 1);
|
|
288
288
|
}
|
|
289
|
-
function
|
|
289
|
+
function C(e, n, t, r) {
|
|
290
290
|
this.r = +e, this.g = +n, this.b = +t, this.opacity = +r;
|
|
291
291
|
}
|
|
292
|
-
|
|
292
|
+
Ee(C, Ce, on(te, {
|
|
293
293
|
brighter(e) {
|
|
294
|
-
return e = e == null ?
|
|
294
|
+
return e = e == null ? me : Math.pow(me, e), new C(this.r * e, this.g * e, this.b * e, this.opacity);
|
|
295
295
|
},
|
|
296
296
|
darker(e) {
|
|
297
|
-
return e = e == null ? Q : Math.pow(Q, e), new
|
|
297
|
+
return e = e == null ? Q : Math.pow(Q, e), new C(this.r * e, this.g * e, this.b * e, this.opacity);
|
|
298
298
|
},
|
|
299
299
|
rgb() {
|
|
300
300
|
return this;
|
|
301
301
|
},
|
|
302
302
|
clamp() {
|
|
303
|
-
return new
|
|
303
|
+
return new C(Z(this.r), Z(this.g), Z(this.b), he(this.opacity));
|
|
304
304
|
},
|
|
305
305
|
displayable() {
|
|
306
306
|
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;
|
|
307
307
|
},
|
|
308
|
-
hex:
|
|
308
|
+
hex: De,
|
|
309
309
|
// Deprecated! Use color.formatHex.
|
|
310
|
-
formatHex:
|
|
311
|
-
formatHex8:
|
|
312
|
-
formatRgb:
|
|
313
|
-
toString:
|
|
310
|
+
formatHex: De,
|
|
311
|
+
formatHex8: zn,
|
|
312
|
+
formatRgb: qe,
|
|
313
|
+
toString: qe
|
|
314
314
|
}));
|
|
315
|
-
function
|
|
316
|
-
return `#${
|
|
315
|
+
function De() {
|
|
316
|
+
return `#${B(this.r)}${B(this.g)}${B(this.b)}`;
|
|
317
317
|
}
|
|
318
|
-
function
|
|
319
|
-
return `#${
|
|
318
|
+
function zn() {
|
|
319
|
+
return `#${B(this.r)}${B(this.g)}${B(this.b)}${B((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`;
|
|
320
320
|
}
|
|
321
|
-
function
|
|
321
|
+
function qe() {
|
|
322
322
|
const e = he(this.opacity);
|
|
323
|
-
return `${e === 1 ? "rgb(" : "rgba("}${
|
|
323
|
+
return `${e === 1 ? "rgb(" : "rgba("}${Z(this.r)}, ${Z(this.g)}, ${Z(this.b)}${e === 1 ? ")" : `, ${e})`}`;
|
|
324
324
|
}
|
|
325
325
|
function he(e) {
|
|
326
326
|
return isNaN(e) ? 1 : Math.max(0, Math.min(1, e));
|
|
327
327
|
}
|
|
328
|
-
function
|
|
328
|
+
function Z(e) {
|
|
329
329
|
return Math.max(0, Math.min(255, Math.round(e) || 0));
|
|
330
330
|
}
|
|
331
|
-
function
|
|
332
|
-
return e =
|
|
331
|
+
function B(e) {
|
|
332
|
+
return e = Z(e), (e < 16 ? "0" : "") + e.toString(16);
|
|
333
333
|
}
|
|
334
|
-
function
|
|
335
|
-
return r <= 0 ? e = n = t = NaN : t <= 0 || t >= 1 ? e = n = NaN : n <= 0 && (e = NaN), new
|
|
334
|
+
function Ve(e, n, t, r) {
|
|
335
|
+
return r <= 0 ? e = n = t = NaN : t <= 0 || t >= 1 ? e = n = NaN : n <= 0 && (e = NaN), new E(e, n, t, r);
|
|
336
336
|
}
|
|
337
|
-
function
|
|
338
|
-
if (e instanceof
|
|
339
|
-
if (e instanceof te || (e = ne(e)), !e) return new
|
|
340
|
-
if (e instanceof
|
|
337
|
+
function an(e) {
|
|
338
|
+
if (e instanceof E) return new E(e.h, e.s, e.l, e.opacity);
|
|
339
|
+
if (e instanceof te || (e = ne(e)), !e) return new E();
|
|
340
|
+
if (e instanceof E) return e;
|
|
341
341
|
e = e.rgb();
|
|
342
|
-
var n = e.r / 255, t = e.g / 255, r = e.b / 255, i = Math.min(n, t, r),
|
|
343
|
-
return
|
|
342
|
+
var n = e.r / 255, t = e.g / 255, r = e.b / 255, i = Math.min(n, t, r), o = Math.max(n, t, r), s = NaN, a = o - i, l = (o + i) / 2;
|
|
343
|
+
return a ? (n === o ? s = (t - r) / a + (t < r) * 6 : t === o ? s = (r - n) / a + 2 : s = (n - t) / a + 4, a /= l < 0.5 ? o + i : 2 - o - i, s *= 60) : a = l > 0 && l < 1 ? 0 : s, new E(s, a, l, e.opacity);
|
|
344
344
|
}
|
|
345
|
-
function
|
|
346
|
-
return arguments.length === 1 ?
|
|
345
|
+
function Hn(e, n, t, r) {
|
|
346
|
+
return arguments.length === 1 ? an(e) : new E(e, n, t, r ?? 1);
|
|
347
347
|
}
|
|
348
|
-
function
|
|
348
|
+
function E(e, n, t, r) {
|
|
349
349
|
this.h = +e, this.s = +n, this.l = +t, this.opacity = +r;
|
|
350
350
|
}
|
|
351
|
-
|
|
351
|
+
Ee(E, Hn, on(te, {
|
|
352
352
|
brighter(e) {
|
|
353
|
-
return e = e == null ?
|
|
353
|
+
return e = e == null ? me : Math.pow(me, e), new E(this.h, this.s, this.l * e, this.opacity);
|
|
354
354
|
},
|
|
355
355
|
darker(e) {
|
|
356
|
-
return e = e == null ? Q : Math.pow(Q, e), new
|
|
356
|
+
return e = e == null ? Q : Math.pow(Q, e), new E(this.h, this.s, this.l * e, this.opacity);
|
|
357
357
|
},
|
|
358
358
|
rgb() {
|
|
359
359
|
var e = this.h % 360 + (this.h < 0) * 360, n = isNaN(e) || isNaN(this.s) ? 0 : this.s, t = this.l, r = t + (t < 0.5 ? t : 1 - t) * n, i = 2 * t - r;
|
|
360
|
-
return new
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
360
|
+
return new C(
|
|
361
|
+
Me(e >= 240 ? e - 240 : e + 120, i, r),
|
|
362
|
+
Me(e, i, r),
|
|
363
|
+
Me(e < 120 ? e + 240 : e - 120, i, r),
|
|
364
364
|
this.opacity
|
|
365
365
|
);
|
|
366
366
|
},
|
|
367
367
|
clamp() {
|
|
368
|
-
return new
|
|
368
|
+
return new E(Be(this.h), ce(this.s), ce(this.l), he(this.opacity));
|
|
369
369
|
},
|
|
370
370
|
displayable() {
|
|
371
371
|
return (0 <= this.s && this.s <= 1 || isNaN(this.s)) && 0 <= this.l && this.l <= 1 && 0 <= this.opacity && this.opacity <= 1;
|
|
372
372
|
},
|
|
373
373
|
formatHsl() {
|
|
374
374
|
const e = he(this.opacity);
|
|
375
|
-
return `${e === 1 ? "hsl(" : "hsla("}${
|
|
375
|
+
return `${e === 1 ? "hsl(" : "hsla("}${Be(this.h)}, ${ce(this.s) * 100}%, ${ce(this.l) * 100}%${e === 1 ? ")" : `, ${e})`}`;
|
|
376
376
|
}
|
|
377
377
|
}));
|
|
378
|
-
function
|
|
378
|
+
function Be(e) {
|
|
379
379
|
return e = (e || 0) % 360, e < 0 ? e + 360 : e;
|
|
380
380
|
}
|
|
381
381
|
function ce(e) {
|
|
382
382
|
return Math.max(0, Math.min(1, e || 0));
|
|
383
383
|
}
|
|
384
|
-
function
|
|
384
|
+
function Me(e, n, t) {
|
|
385
385
|
return (e < 60 ? n + (t - n) * e / 60 : e < 180 ? t : e < 240 ? n + (t - n) * (240 - e) / 60 : n) * 255;
|
|
386
386
|
}
|
|
387
|
-
const
|
|
388
|
-
function
|
|
387
|
+
const Ie = (e) => () => e;
|
|
388
|
+
function Tn(e, n) {
|
|
389
389
|
return function(t) {
|
|
390
390
|
return e + t * n;
|
|
391
391
|
};
|
|
392
392
|
}
|
|
393
|
-
function
|
|
393
|
+
function Gn(e, n, t) {
|
|
394
394
|
return e = Math.pow(e, t), n = Math.pow(n, t) - e, t = 1 / t, function(r) {
|
|
395
395
|
return Math.pow(e + r * n, t);
|
|
396
396
|
};
|
|
397
397
|
}
|
|
398
|
-
function
|
|
399
|
-
return (e = +e) == 1 ?
|
|
400
|
-
return t - n ?
|
|
398
|
+
function Un(e) {
|
|
399
|
+
return (e = +e) == 1 ? sn : function(n, t) {
|
|
400
|
+
return t - n ? Gn(n, t, e) : Ie(isNaN(n) ? t : n);
|
|
401
401
|
};
|
|
402
402
|
}
|
|
403
|
-
function
|
|
403
|
+
function sn(e, n) {
|
|
404
404
|
var t = n - e;
|
|
405
|
-
return t ?
|
|
406
|
-
}
|
|
407
|
-
const
|
|
408
|
-
var t =
|
|
409
|
-
function r(i,
|
|
410
|
-
var
|
|
411
|
-
return function(
|
|
412
|
-
return i.r =
|
|
405
|
+
return t ? Tn(e, t) : Ie(isNaN(e) ? n : e);
|
|
406
|
+
}
|
|
407
|
+
const ke = (function e(n) {
|
|
408
|
+
var t = Un(n);
|
|
409
|
+
function r(i, o) {
|
|
410
|
+
var s = t((i = Ce(i)).r, (o = Ce(o)).r), a = t(i.g, o.g), l = t(i.b, o.b), f = sn(i.opacity, o.opacity);
|
|
411
|
+
return function(d) {
|
|
412
|
+
return i.r = s(d), i.g = a(d), i.b = l(d), i.opacity = f(d), i + "";
|
|
413
413
|
};
|
|
414
414
|
}
|
|
415
415
|
return r.gamma = e, r;
|
|
416
416
|
})(1);
|
|
417
|
-
function
|
|
417
|
+
function Dn(e, n) {
|
|
418
418
|
n || (n = []);
|
|
419
419
|
var t = e ? Math.min(n.length, e.length) : 0, r = n.slice(), i;
|
|
420
|
-
return function(
|
|
421
|
-
for (i = 0; i < t; ++i) r[i] = e[i] * (1 -
|
|
420
|
+
return function(o) {
|
|
421
|
+
for (i = 0; i < t; ++i) r[i] = e[i] * (1 - o) + n[i] * o;
|
|
422
422
|
return r;
|
|
423
423
|
};
|
|
424
424
|
}
|
|
425
|
-
function
|
|
425
|
+
function qn(e) {
|
|
426
426
|
return ArrayBuffer.isView(e) && !(e instanceof DataView);
|
|
427
427
|
}
|
|
428
|
-
function
|
|
429
|
-
var t = n ? n.length : 0, r = e ? Math.min(t, e.length) : 0, i = new Array(r),
|
|
430
|
-
for (
|
|
431
|
-
for (;
|
|
432
|
-
return function(
|
|
433
|
-
for (
|
|
434
|
-
return
|
|
428
|
+
function Vn(e, n) {
|
|
429
|
+
var t = n ? n.length : 0, r = e ? Math.min(t, e.length) : 0, i = new Array(r), o = new Array(t), s;
|
|
430
|
+
for (s = 0; s < r; ++s) i[s] = Fe(e[s], n[s]);
|
|
431
|
+
for (; s < t; ++s) o[s] = n[s];
|
|
432
|
+
return function(a) {
|
|
433
|
+
for (s = 0; s < r; ++s) o[s] = i[s](a);
|
|
434
|
+
return o;
|
|
435
435
|
};
|
|
436
436
|
}
|
|
437
|
-
function
|
|
437
|
+
function Bn(e, n) {
|
|
438
438
|
var t = /* @__PURE__ */ new Date();
|
|
439
439
|
return e = +e, n = +n, function(r) {
|
|
440
440
|
return t.setTime(e * (1 - r) + n * r), t;
|
|
441
441
|
};
|
|
442
442
|
}
|
|
443
|
-
function
|
|
443
|
+
function ge(e, n) {
|
|
444
444
|
return e = +e, n = +n, function(t) {
|
|
445
445
|
return e * (1 - t) + n * t;
|
|
446
446
|
};
|
|
447
447
|
}
|
|
448
|
-
function
|
|
448
|
+
function Zn(e, n) {
|
|
449
449
|
var t = {}, r = {}, i;
|
|
450
450
|
(e === null || typeof e != "object") && (e = {}), (n === null || typeof n != "object") && (n = {});
|
|
451
451
|
for (i in n)
|
|
452
|
-
i in e ? t[i] =
|
|
453
|
-
return function(
|
|
454
|
-
for (i in t) r[i] = t[i](
|
|
452
|
+
i in e ? t[i] = Fe(e[i], n[i]) : r[i] = n[i];
|
|
453
|
+
return function(o) {
|
|
454
|
+
for (i in t) r[i] = t[i](o);
|
|
455
455
|
return r;
|
|
456
456
|
};
|
|
457
457
|
}
|
|
458
|
-
var
|
|
459
|
-
function
|
|
458
|
+
var Le = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, _e = new RegExp(Le.source, "g");
|
|
459
|
+
function Jn(e) {
|
|
460
460
|
return function() {
|
|
461
461
|
return e;
|
|
462
462
|
};
|
|
463
463
|
}
|
|
464
|
-
function
|
|
464
|
+
function Kn(e) {
|
|
465
465
|
return function(n) {
|
|
466
466
|
return e(n) + "";
|
|
467
467
|
};
|
|
468
468
|
}
|
|
469
|
-
function
|
|
470
|
-
var t =
|
|
471
|
-
for (e = e + "", n = n + ""; (r =
|
|
472
|
-
(
|
|
473
|
-
return t < n.length && (
|
|
474
|
-
for (var
|
|
475
|
-
return
|
|
469
|
+
function Yn(e, n) {
|
|
470
|
+
var t = Le.lastIndex = _e.lastIndex = 0, r, i, o, s = -1, a = [], l = [];
|
|
471
|
+
for (e = e + "", n = n + ""; (r = Le.exec(e)) && (i = _e.exec(n)); )
|
|
472
|
+
(o = i.index) > t && (o = n.slice(t, o), a[s] ? a[s] += o : a[++s] = o), (r = r[0]) === (i = i[0]) ? a[s] ? a[s] += i : a[++s] = i : (a[++s] = null, l.push({ i: s, x: ge(r, i) })), t = _e.lastIndex;
|
|
473
|
+
return t < n.length && (o = n.slice(t), a[s] ? a[s] += o : a[++s] = o), a.length < 2 ? l[0] ? Kn(l[0].x) : Jn(n) : (n = l.length, function(f) {
|
|
474
|
+
for (var d = 0, c; d < n; ++d) a[(c = l[d]).i] = c.x(f);
|
|
475
|
+
return a.join("");
|
|
476
476
|
});
|
|
477
477
|
}
|
|
478
|
-
function
|
|
478
|
+
function Fe(e, n) {
|
|
479
479
|
var t = typeof n, r;
|
|
480
|
-
return n == null || t === "boolean" ?
|
|
480
|
+
return n == null || t === "boolean" ? Ie(n) : (t === "number" ? ge : t === "string" ? (r = ne(n)) ? (n = r, ke) : Yn : n instanceof ne ? ke : n instanceof Date ? Bn : qn(n) ? Dn : Array.isArray(n) ? Vn : typeof n.valueOf != "function" && typeof n.toString != "function" || isNaN(n) ? Zn : ge)(e, n);
|
|
481
481
|
}
|
|
482
|
-
function
|
|
482
|
+
function Xn(e, n) {
|
|
483
483
|
return e = +e, n = +n, function(t) {
|
|
484
484
|
return Math.round(e * (1 - t) + n * t);
|
|
485
485
|
};
|
|
@@ -487,74 +487,74 @@ function Vn(e, n) {
|
|
|
487
487
|
function le(e, n) {
|
|
488
488
|
return e == null || n == null ? NaN : e < n ? -1 : e > n ? 1 : e >= n ? 0 : NaN;
|
|
489
489
|
}
|
|
490
|
-
function
|
|
490
|
+
function Wn(e, n) {
|
|
491
491
|
return e == null || n == null ? NaN : n < e ? -1 : n > e ? 1 : n >= e ? 0 : NaN;
|
|
492
492
|
}
|
|
493
|
-
function
|
|
493
|
+
function fn(e) {
|
|
494
494
|
let n, t, r;
|
|
495
|
-
e.length !== 2 ? (n = le, t = (
|
|
496
|
-
function i(
|
|
497
|
-
if (f <
|
|
498
|
-
if (n(l, l) !== 0) return
|
|
495
|
+
e.length !== 2 ? (n = le, t = (a, l) => le(e(a), l), r = (a, l) => e(a) - l) : (n = e === le || e === Wn ? e : Qn, t = e, r = e);
|
|
496
|
+
function i(a, l, f = 0, d = a.length) {
|
|
497
|
+
if (f < d) {
|
|
498
|
+
if (n(l, l) !== 0) return d;
|
|
499
499
|
do {
|
|
500
|
-
const
|
|
501
|
-
t(
|
|
502
|
-
} while (f <
|
|
500
|
+
const c = f + d >>> 1;
|
|
501
|
+
t(a[c], l) < 0 ? f = c + 1 : d = c;
|
|
502
|
+
} while (f < d);
|
|
503
503
|
}
|
|
504
504
|
return f;
|
|
505
505
|
}
|
|
506
|
-
function a
|
|
507
|
-
if (f <
|
|
508
|
-
if (n(l, l) !== 0) return
|
|
506
|
+
function o(a, l, f = 0, d = a.length) {
|
|
507
|
+
if (f < d) {
|
|
508
|
+
if (n(l, l) !== 0) return d;
|
|
509
509
|
do {
|
|
510
|
-
const
|
|
511
|
-
t(
|
|
512
|
-
} while (f <
|
|
510
|
+
const c = f + d >>> 1;
|
|
511
|
+
t(a[c], l) <= 0 ? f = c + 1 : d = c;
|
|
512
|
+
} while (f < d);
|
|
513
513
|
}
|
|
514
514
|
return f;
|
|
515
515
|
}
|
|
516
|
-
function
|
|
517
|
-
const
|
|
518
|
-
return
|
|
516
|
+
function s(a, l, f = 0, d = a.length) {
|
|
517
|
+
const c = i(a, l, f, d - 1);
|
|
518
|
+
return c > f && r(a[c - 1], l) > -r(a[c], l) ? c - 1 : c;
|
|
519
519
|
}
|
|
520
|
-
return { left: i, center:
|
|
520
|
+
return { left: i, center: s, right: o };
|
|
521
521
|
}
|
|
522
|
-
function
|
|
522
|
+
function Qn() {
|
|
523
523
|
return 0;
|
|
524
524
|
}
|
|
525
|
-
function
|
|
525
|
+
function et(e) {
|
|
526
526
|
return e === null ? NaN : +e;
|
|
527
527
|
}
|
|
528
|
-
const
|
|
529
|
-
|
|
530
|
-
const
|
|
531
|
-
function
|
|
532
|
-
const r = (n - e) / Math.max(0, t), i = Math.floor(Math.log10(r)),
|
|
533
|
-
let
|
|
534
|
-
return i < 0 ? (f = Math.pow(10, -i) /
|
|
528
|
+
const nt = fn(le), tt = nt.right;
|
|
529
|
+
fn(et).center;
|
|
530
|
+
const rt = Math.sqrt(50), it = Math.sqrt(10), ot = Math.sqrt(2);
|
|
531
|
+
function pe(e, n, t) {
|
|
532
|
+
const r = (n - e) / Math.max(0, t), i = Math.floor(Math.log10(r)), o = r / Math.pow(10, i), s = o >= rt ? 10 : o >= it ? 5 : o >= ot ? 2 : 1;
|
|
533
|
+
let a, l, f;
|
|
534
|
+
return i < 0 ? (f = Math.pow(10, -i) / s, a = Math.round(e * f), l = Math.round(n * f), a / f < e && ++a, l / f > n && --l, f = -f) : (f = Math.pow(10, i) * s, a = Math.round(e / f), l = Math.round(n / f), a * f < e && ++a, l * f > n && --l), l < a && 0.5 <= t && t < 2 ? pe(e, n, t * 2) : [a, l, f];
|
|
535
535
|
}
|
|
536
|
-
function
|
|
536
|
+
function at(e, n, t) {
|
|
537
537
|
if (n = +n, e = +e, t = +t, !(t > 0)) return [];
|
|
538
538
|
if (e === n) return [e];
|
|
539
|
-
const r = n < e, [i,
|
|
540
|
-
if (!(
|
|
541
|
-
const
|
|
539
|
+
const r = n < e, [i, o, s] = r ? pe(n, e, t) : pe(e, n, t);
|
|
540
|
+
if (!(o >= i)) return [];
|
|
541
|
+
const a = o - i + 1, l = new Array(a);
|
|
542
542
|
if (r)
|
|
543
|
-
if (
|
|
544
|
-
else for (let f = 0; f <
|
|
545
|
-
else if (
|
|
546
|
-
else for (let f = 0; f <
|
|
543
|
+
if (s < 0) for (let f = 0; f < a; ++f) l[f] = (o - f) / -s;
|
|
544
|
+
else for (let f = 0; f < a; ++f) l[f] = (o - f) * s;
|
|
545
|
+
else if (s < 0) for (let f = 0; f < a; ++f) l[f] = (i + f) / -s;
|
|
546
|
+
else for (let f = 0; f < a; ++f) l[f] = (i + f) * s;
|
|
547
547
|
return l;
|
|
548
548
|
}
|
|
549
|
-
function
|
|
550
|
-
return n = +n, e = +e, t = +t,
|
|
549
|
+
function Ae(e, n, t) {
|
|
550
|
+
return n = +n, e = +e, t = +t, pe(e, n, t)[2];
|
|
551
551
|
}
|
|
552
|
-
function
|
|
552
|
+
function st(e, n, t) {
|
|
553
553
|
n = +n, e = +e, t = +t;
|
|
554
|
-
const r = n < e, i = r ?
|
|
554
|
+
const r = n < e, i = r ? Ae(n, e, t) : Ae(e, n, t);
|
|
555
555
|
return (r ? -1 : 1) * (i < 0 ? 1 / -i : i);
|
|
556
556
|
}
|
|
557
|
-
function
|
|
557
|
+
function ft(e, n) {
|
|
558
558
|
switch (arguments.length) {
|
|
559
559
|
case 0:
|
|
560
560
|
break;
|
|
@@ -567,81 +567,81 @@ function nt(e, n) {
|
|
|
567
567
|
}
|
|
568
568
|
return this;
|
|
569
569
|
}
|
|
570
|
-
function
|
|
570
|
+
function ct(e) {
|
|
571
571
|
return function() {
|
|
572
572
|
return e;
|
|
573
573
|
};
|
|
574
574
|
}
|
|
575
|
-
function
|
|
575
|
+
function ut(e) {
|
|
576
576
|
return +e;
|
|
577
577
|
}
|
|
578
|
-
var
|
|
579
|
-
function
|
|
578
|
+
var Ze = [0, 1];
|
|
579
|
+
function Y(e) {
|
|
580
580
|
return e;
|
|
581
581
|
}
|
|
582
|
-
function
|
|
582
|
+
function Se(e, n) {
|
|
583
583
|
return (n -= e = +e) ? function(t) {
|
|
584
584
|
return (t - e) / n;
|
|
585
|
-
} :
|
|
585
|
+
} : ct(isNaN(n) ? NaN : 0.5);
|
|
586
586
|
}
|
|
587
|
-
function
|
|
587
|
+
function lt(e, n) {
|
|
588
588
|
var t;
|
|
589
589
|
return e > n && (t = e, e = n, n = t), function(r) {
|
|
590
590
|
return Math.max(e, Math.min(n, r));
|
|
591
591
|
};
|
|
592
592
|
}
|
|
593
|
-
function
|
|
594
|
-
var r = e[0], i = e[1],
|
|
595
|
-
return i < r ? (r =
|
|
596
|
-
return
|
|
593
|
+
function dt(e, n, t) {
|
|
594
|
+
var r = e[0], i = e[1], o = n[0], s = n[1];
|
|
595
|
+
return i < r ? (r = Se(i, r), o = t(s, o)) : (r = Se(r, i), o = t(o, s)), function(a) {
|
|
596
|
+
return o(r(a));
|
|
597
597
|
};
|
|
598
598
|
}
|
|
599
|
-
function
|
|
600
|
-
var r = Math.min(e.length, n.length) - 1, i = new Array(r),
|
|
601
|
-
for (e[r] < e[0] && (e = e.slice().reverse(), n = n.slice().reverse()); ++
|
|
602
|
-
i[
|
|
603
|
-
return function(
|
|
604
|
-
var l =
|
|
605
|
-
return
|
|
599
|
+
function mt(e, n, t) {
|
|
600
|
+
var r = Math.min(e.length, n.length) - 1, i = new Array(r), o = new Array(r), s = -1;
|
|
601
|
+
for (e[r] < e[0] && (e = e.slice().reverse(), n = n.slice().reverse()); ++s < r; )
|
|
602
|
+
i[s] = Se(e[s], e[s + 1]), o[s] = t(n[s], n[s + 1]);
|
|
603
|
+
return function(a) {
|
|
604
|
+
var l = tt(e, a, 1, r) - 1;
|
|
605
|
+
return o[l](i[l](a));
|
|
606
606
|
};
|
|
607
607
|
}
|
|
608
|
-
function
|
|
608
|
+
function ht(e, n) {
|
|
609
609
|
return n.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown());
|
|
610
610
|
}
|
|
611
|
-
function
|
|
612
|
-
var e =
|
|
613
|
-
function
|
|
614
|
-
var
|
|
615
|
-
return
|
|
611
|
+
function gt() {
|
|
612
|
+
var e = Ze, n = Ze, t = Fe, r, i, o, s = Y, a, l, f;
|
|
613
|
+
function d() {
|
|
614
|
+
var h = Math.min(e.length, n.length);
|
|
615
|
+
return s !== Y && (s = lt(e[0], e[h - 1])), a = h > 2 ? mt : dt, l = f = null, c;
|
|
616
616
|
}
|
|
617
|
-
function
|
|
618
|
-
return
|
|
617
|
+
function c(h) {
|
|
618
|
+
return h == null || isNaN(h = +h) ? o : (l || (l = a(e.map(r), n, t)))(r(s(h)));
|
|
619
619
|
}
|
|
620
|
-
return
|
|
621
|
-
return
|
|
622
|
-
},
|
|
623
|
-
return arguments.length ? (e = Array.from(
|
|
624
|
-
},
|
|
625
|
-
return arguments.length ? (n = Array.from(
|
|
626
|
-
},
|
|
627
|
-
return n = Array.from(
|
|
628
|
-
},
|
|
629
|
-
return arguments.length ? (
|
|
630
|
-
},
|
|
631
|
-
return arguments.length ? (t =
|
|
632
|
-
},
|
|
633
|
-
return arguments.length ? (
|
|
634
|
-
}, function(
|
|
635
|
-
return r =
|
|
620
|
+
return c.invert = function(h) {
|
|
621
|
+
return s(i((f || (f = a(n, e.map(r), ge)))(h)));
|
|
622
|
+
}, c.domain = function(h) {
|
|
623
|
+
return arguments.length ? (e = Array.from(h, ut), d()) : e.slice();
|
|
624
|
+
}, c.range = function(h) {
|
|
625
|
+
return arguments.length ? (n = Array.from(h), d()) : n.slice();
|
|
626
|
+
}, c.rangeRound = function(h) {
|
|
627
|
+
return n = Array.from(h), t = Xn, d();
|
|
628
|
+
}, c.clamp = function(h) {
|
|
629
|
+
return arguments.length ? (s = h ? !0 : Y, d()) : s !== Y;
|
|
630
|
+
}, c.interpolate = function(h) {
|
|
631
|
+
return arguments.length ? (t = h, d()) : t;
|
|
632
|
+
}, c.unknown = function(h) {
|
|
633
|
+
return arguments.length ? (o = h, c) : o;
|
|
634
|
+
}, function(h, N) {
|
|
635
|
+
return r = h, i = N, d();
|
|
636
636
|
};
|
|
637
637
|
}
|
|
638
|
-
function
|
|
639
|
-
return
|
|
638
|
+
function pt() {
|
|
639
|
+
return gt()(Y, Y);
|
|
640
640
|
}
|
|
641
|
-
function
|
|
641
|
+
function xt(e) {
|
|
642
642
|
return Math.abs(e = Math.round(e)) >= 1e21 ? e.toLocaleString("en").replace(/,/g, "") : e.toString(10);
|
|
643
643
|
}
|
|
644
|
-
function
|
|
644
|
+
function xe(e, n) {
|
|
645
645
|
if (!isFinite(e) || e === 0) return null;
|
|
646
646
|
var t = (e = n ? e.toExponential(n - 1) : e.toExponential()).indexOf("e"), r = e.slice(0, t);
|
|
647
647
|
return [
|
|
@@ -649,28 +649,28 @@ function pe(e, n) {
|
|
|
649
649
|
+e.slice(t + 1)
|
|
650
650
|
];
|
|
651
651
|
}
|
|
652
|
-
function
|
|
653
|
-
return e =
|
|
652
|
+
function W(e) {
|
|
653
|
+
return e = xe(Math.abs(e)), e ? e[1] : NaN;
|
|
654
654
|
}
|
|
655
|
-
function
|
|
655
|
+
function bt(e, n) {
|
|
656
656
|
return function(t, r) {
|
|
657
|
-
for (var i = t.length,
|
|
658
|
-
|
|
659
|
-
return
|
|
657
|
+
for (var i = t.length, o = [], s = 0, a = e[0], l = 0; i > 0 && a > 0 && (l + a + 1 > r && (a = Math.max(1, r - l)), o.push(t.substring(i -= a, i + a)), !((l += a + 1) > r)); )
|
|
658
|
+
a = e[s = (s + 1) % e.length];
|
|
659
|
+
return o.reverse().join(n);
|
|
660
660
|
};
|
|
661
661
|
}
|
|
662
|
-
function
|
|
662
|
+
function yt(e) {
|
|
663
663
|
return function(n) {
|
|
664
664
|
return n.replace(/[0-9]/g, function(t) {
|
|
665
665
|
return e[+t];
|
|
666
666
|
});
|
|
667
667
|
};
|
|
668
668
|
}
|
|
669
|
-
var
|
|
670
|
-
function
|
|
671
|
-
if (!(n =
|
|
669
|
+
var wt = /^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;
|
|
670
|
+
function be(e) {
|
|
671
|
+
if (!(n = wt.exec(e))) throw new Error("invalid format: " + e);
|
|
672
672
|
var n;
|
|
673
|
-
return new
|
|
673
|
+
return new je({
|
|
674
674
|
fill: n[1],
|
|
675
675
|
align: n[2],
|
|
676
676
|
sign: n[3],
|
|
@@ -683,14 +683,14 @@ function xe(e) {
|
|
|
683
683
|
type: n[10]
|
|
684
684
|
});
|
|
685
685
|
}
|
|
686
|
-
|
|
687
|
-
function
|
|
686
|
+
be.prototype = je.prototype;
|
|
687
|
+
function je(e) {
|
|
688
688
|
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 + "";
|
|
689
689
|
}
|
|
690
|
-
|
|
690
|
+
je.prototype.toString = function() {
|
|
691
691
|
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;
|
|
692
692
|
};
|
|
693
|
-
function
|
|
693
|
+
function vt(e) {
|
|
694
694
|
e: for (var n = e.length, t = 1, r = -1, i; t < n; ++t)
|
|
695
695
|
switch (e[t]) {
|
|
696
696
|
case ".":
|
|
@@ -706,153 +706,153 @@ function mt(e) {
|
|
|
706
706
|
}
|
|
707
707
|
return r > 0 ? e.slice(0, r) + e.slice(i + 1) : e;
|
|
708
708
|
}
|
|
709
|
-
var
|
|
710
|
-
function
|
|
711
|
-
var t =
|
|
712
|
-
if (!t) return
|
|
713
|
-
var r = t[0], i = t[1],
|
|
714
|
-
return
|
|
709
|
+
var ye;
|
|
710
|
+
function Nt(e, n) {
|
|
711
|
+
var t = xe(e, n);
|
|
712
|
+
if (!t) return ye = void 0, e.toPrecision(n);
|
|
713
|
+
var r = t[0], i = t[1], o = i - (ye = Math.max(-8, Math.min(8, Math.floor(i / 3))) * 3) + 1, s = r.length;
|
|
714
|
+
return o === s ? r : o > s ? r + new Array(o - s + 1).join("0") : o > 0 ? r.slice(0, o) + "." + r.slice(o) : "0." + new Array(1 - o).join("0") + xe(e, Math.max(0, n + o - 1))[0];
|
|
715
715
|
}
|
|
716
|
-
function
|
|
717
|
-
var t =
|
|
716
|
+
function Je(e, n) {
|
|
717
|
+
var t = xe(e, n);
|
|
718
718
|
if (!t) return e + "";
|
|
719
719
|
var r = t[0], i = t[1];
|
|
720
720
|
return i < 0 ? "0." + new Array(-i).join("0") + r : r.length > i + 1 ? r.slice(0, i + 1) + "." + r.slice(i + 1) : r + new Array(i - r.length + 2).join("0");
|
|
721
721
|
}
|
|
722
|
-
const
|
|
722
|
+
const Ke = {
|
|
723
723
|
"%": (e, n) => (e * 100).toFixed(n),
|
|
724
724
|
b: (e) => Math.round(e).toString(2),
|
|
725
725
|
c: (e) => e + "",
|
|
726
|
-
d:
|
|
726
|
+
d: xt,
|
|
727
727
|
e: (e, n) => e.toExponential(n),
|
|
728
728
|
f: (e, n) => e.toFixed(n),
|
|
729
729
|
g: (e, n) => e.toPrecision(n),
|
|
730
730
|
o: (e) => Math.round(e).toString(8),
|
|
731
|
-
p: (e, n) =>
|
|
732
|
-
r:
|
|
733
|
-
s:
|
|
731
|
+
p: (e, n) => Je(e * 100, n),
|
|
732
|
+
r: Je,
|
|
733
|
+
s: Nt,
|
|
734
734
|
X: (e) => Math.round(e).toString(16).toUpperCase(),
|
|
735
735
|
x: (e) => Math.round(e).toString(16)
|
|
736
736
|
};
|
|
737
|
-
function
|
|
737
|
+
function Ye(e) {
|
|
738
738
|
return e;
|
|
739
739
|
}
|
|
740
|
-
var
|
|
741
|
-
function
|
|
742
|
-
var n = e.grouping === void 0 || e.thousands === void 0 ?
|
|
743
|
-
function f(
|
|
744
|
-
|
|
745
|
-
var
|
|
746
|
-
|
|
747
|
-
var
|
|
748
|
-
|
|
749
|
-
function
|
|
750
|
-
var
|
|
751
|
-
if (
|
|
752
|
-
_ =
|
|
740
|
+
var Xe = Array.prototype.map, We = ["y", "z", "a", "f", "p", "n", "µ", "m", "", "k", "M", "G", "T", "P", "E", "Z", "Y"];
|
|
741
|
+
function Mt(e) {
|
|
742
|
+
var n = e.grouping === void 0 || e.thousands === void 0 ? Ye : bt(Xe.call(e.grouping, Number), e.thousands + ""), t = e.currency === void 0 ? "" : e.currency[0] + "", r = e.currency === void 0 ? "" : e.currency[1] + "", i = e.decimal === void 0 ? "." : e.decimal + "", o = e.numerals === void 0 ? Ye : yt(Xe.call(e.numerals, String)), s = e.percent === void 0 ? "%" : e.percent + "", a = e.minus === void 0 ? "−" : e.minus + "", l = e.nan === void 0 ? "NaN" : e.nan + "";
|
|
743
|
+
function f(c, h) {
|
|
744
|
+
c = be(c);
|
|
745
|
+
var N = c.fill, k = c.align, L = c.sign, w = c.symbol, A = c.zero, M = c.width, J = c.comma, I = c.precision, U = c.trim, R = c.type;
|
|
746
|
+
R === "n" ? (J = !0, R = "g") : Ke[R] || (I === void 0 && (I = 12), U = !0, R = "g"), (A || N === "0" && k === "=") && (A = !0, N = "0", k = "=");
|
|
747
|
+
var re = (h && h.prefix !== void 0 ? h.prefix : "") + (w === "$" ? t : w === "#" && /[boxX]/.test(R) ? "0" + R.toLowerCase() : ""), F = (w === "$" ? r : /[%p]/.test(R) ? s : "") + (h && h.suffix !== void 0 ? h.suffix : ""), ie = Ke[R], oe = /[defgprs%]/.test(R);
|
|
748
|
+
I = I === void 0 ? 6 : /[gprs]/.test(R) ? Math.max(1, Math.min(21, I)) : Math.max(0, Math.min(20, I));
|
|
749
|
+
function D(g) {
|
|
750
|
+
var P = re, _ = F, O, ae, K;
|
|
751
|
+
if (R === "c")
|
|
752
|
+
_ = ie(g) + _, g = "";
|
|
753
753
|
else {
|
|
754
|
-
|
|
755
|
-
var
|
|
756
|
-
if (
|
|
757
|
-
for (
|
|
758
|
-
if (
|
|
759
|
-
_ = (
|
|
754
|
+
g = +g;
|
|
755
|
+
var S = g < 0 || 1 / g < 0;
|
|
756
|
+
if (g = isNaN(g) ? l : ie(Math.abs(g), I), U && (g = vt(g)), S && +g == 0 && L !== "+" && (S = !1), P = (S ? L === "(" ? L : a : L === "-" || L === "(" ? "" : L) + P, _ = (R === "s" && !isNaN(g) && ye !== void 0 ? We[8 + ye / 3] : "") + _ + (S && L === "(" ? ")" : ""), oe) {
|
|
757
|
+
for (O = -1, ae = g.length; ++O < ae; )
|
|
758
|
+
if (K = g.charCodeAt(O), 48 > K || K > 57) {
|
|
759
|
+
_ = (K === 46 ? i + g.slice(O + 1) : g.slice(O)) + _, g = g.slice(0, O);
|
|
760
760
|
break;
|
|
761
761
|
}
|
|
762
762
|
}
|
|
763
763
|
}
|
|
764
|
-
|
|
765
|
-
var
|
|
766
|
-
switch (
|
|
764
|
+
J && !A && (g = n(g, 1 / 0));
|
|
765
|
+
var H = P.length + g.length + _.length, $ = H < M ? new Array(M - H + 1).join(N) : "";
|
|
766
|
+
switch (J && A && (g = n($ + g, $.length ? M - _.length : 1 / 0), $ = ""), k) {
|
|
767
767
|
case "<":
|
|
768
|
-
|
|
768
|
+
g = P + g + _ + $;
|
|
769
769
|
break;
|
|
770
770
|
case "=":
|
|
771
|
-
|
|
771
|
+
g = P + $ + g + _;
|
|
772
772
|
break;
|
|
773
773
|
case "^":
|
|
774
|
-
|
|
774
|
+
g = $.slice(0, H = $.length >> 1) + P + g + _ + $.slice(H);
|
|
775
775
|
break;
|
|
776
776
|
default:
|
|
777
|
-
|
|
777
|
+
g = $ + P + g + _;
|
|
778
778
|
break;
|
|
779
779
|
}
|
|
780
|
-
return
|
|
780
|
+
return o(g);
|
|
781
781
|
}
|
|
782
|
-
return
|
|
783
|
-
return
|
|
784
|
-
},
|
|
782
|
+
return D.toString = function() {
|
|
783
|
+
return c + "";
|
|
784
|
+
}, D;
|
|
785
785
|
}
|
|
786
|
-
function
|
|
787
|
-
var
|
|
788
|
-
return function(
|
|
789
|
-
return
|
|
786
|
+
function d(c, h) {
|
|
787
|
+
var N = Math.max(-8, Math.min(8, Math.floor(W(h) / 3))) * 3, k = Math.pow(10, -N), L = f((c = be(c), c.type = "f", c), { suffix: We[8 + N / 3] });
|
|
788
|
+
return function(w) {
|
|
789
|
+
return L(k * w);
|
|
790
790
|
};
|
|
791
791
|
}
|
|
792
792
|
return {
|
|
793
793
|
format: f,
|
|
794
|
-
formatPrefix:
|
|
794
|
+
formatPrefix: d
|
|
795
795
|
};
|
|
796
796
|
}
|
|
797
|
-
var ue,
|
|
798
|
-
|
|
797
|
+
var ue, cn, un;
|
|
798
|
+
_t({
|
|
799
799
|
thousands: ",",
|
|
800
800
|
grouping: [3],
|
|
801
801
|
currency: ["$", ""]
|
|
802
802
|
});
|
|
803
|
-
function
|
|
804
|
-
return ue =
|
|
803
|
+
function _t(e) {
|
|
804
|
+
return ue = Mt(e), cn = ue.format, un = ue.formatPrefix, ue;
|
|
805
805
|
}
|
|
806
|
-
function
|
|
807
|
-
return Math.max(0, -
|
|
806
|
+
function $t(e) {
|
|
807
|
+
return Math.max(0, -W(Math.abs(e)));
|
|
808
808
|
}
|
|
809
|
-
function
|
|
810
|
-
return Math.max(0, Math.max(-8, Math.min(8, Math.floor(
|
|
809
|
+
function Rt(e, n) {
|
|
810
|
+
return Math.max(0, Math.max(-8, Math.min(8, Math.floor(W(n) / 3))) * 3 - W(Math.abs(e)));
|
|
811
811
|
}
|
|
812
|
-
function
|
|
813
|
-
return e = Math.abs(e), n = Math.abs(n) - e, Math.max(0,
|
|
812
|
+
function Ct(e, n) {
|
|
813
|
+
return e = Math.abs(e), n = Math.abs(n) - e, Math.max(0, W(n) - W(e)) + 1;
|
|
814
814
|
}
|
|
815
|
-
function
|
|
816
|
-
var i =
|
|
817
|
-
switch (r =
|
|
815
|
+
function kt(e, n, t, r) {
|
|
816
|
+
var i = st(e, n, t), o;
|
|
817
|
+
switch (r = be(r ?? ",f"), r.type) {
|
|
818
818
|
case "s": {
|
|
819
|
-
var
|
|
820
|
-
return r.precision == null && !isNaN(
|
|
819
|
+
var s = Math.max(Math.abs(e), Math.abs(n));
|
|
820
|
+
return r.precision == null && !isNaN(o = Rt(i, s)) && (r.precision = o), un(r, s);
|
|
821
821
|
}
|
|
822
822
|
case "":
|
|
823
823
|
case "e":
|
|
824
824
|
case "g":
|
|
825
825
|
case "p":
|
|
826
826
|
case "r": {
|
|
827
|
-
r.precision == null && !isNaN(
|
|
827
|
+
r.precision == null && !isNaN(o = Ct(i, Math.max(Math.abs(e), Math.abs(n)))) && (r.precision = o - (r.type === "e"));
|
|
828
828
|
break;
|
|
829
829
|
}
|
|
830
830
|
case "f":
|
|
831
831
|
case "%": {
|
|
832
|
-
r.precision == null && !isNaN(
|
|
832
|
+
r.precision == null && !isNaN(o = $t(i)) && (r.precision = o - (r.type === "%") * 2);
|
|
833
833
|
break;
|
|
834
834
|
}
|
|
835
835
|
}
|
|
836
|
-
return
|
|
836
|
+
return cn(r);
|
|
837
837
|
}
|
|
838
|
-
function
|
|
838
|
+
function Lt(e) {
|
|
839
839
|
var n = e.domain;
|
|
840
840
|
return e.ticks = function(t) {
|
|
841
841
|
var r = n();
|
|
842
|
-
return
|
|
842
|
+
return at(r[0], r[r.length - 1], t ?? 10);
|
|
843
843
|
}, e.tickFormat = function(t, r) {
|
|
844
844
|
var i = n();
|
|
845
|
-
return
|
|
845
|
+
return kt(i[0], i[i.length - 1], t ?? 10, r);
|
|
846
846
|
}, e.nice = function(t) {
|
|
847
847
|
t == null && (t = 10);
|
|
848
|
-
var r = n(), i = 0,
|
|
849
|
-
for (
|
|
850
|
-
if (f =
|
|
851
|
-
return r[i] =
|
|
848
|
+
var r = n(), i = 0, o = r.length - 1, s = r[i], a = r[o], l, f, d = 10;
|
|
849
|
+
for (a < s && (f = s, s = a, a = f, f = i, i = o, o = f); d-- > 0; ) {
|
|
850
|
+
if (f = Ae(s, a, t), f === l)
|
|
851
|
+
return r[i] = s, r[o] = a, n(r);
|
|
852
852
|
if (f > 0)
|
|
853
|
-
|
|
853
|
+
s = Math.floor(s / f) * f, a = Math.ceil(a / f) * f;
|
|
854
854
|
else if (f < 0)
|
|
855
|
-
|
|
855
|
+
s = Math.ceil(s * f) / f, a = Math.floor(a * f) / f;
|
|
856
856
|
else
|
|
857
857
|
break;
|
|
858
858
|
l = f;
|
|
@@ -860,42 +860,85 @@ function Nt(e) {
|
|
|
860
860
|
return e;
|
|
861
861
|
}, e;
|
|
862
862
|
}
|
|
863
|
-
function
|
|
864
|
-
var e =
|
|
863
|
+
function ln() {
|
|
864
|
+
var e = pt();
|
|
865
865
|
return e.copy = function() {
|
|
866
|
-
return
|
|
867
|
-
},
|
|
868
|
-
}
|
|
869
|
-
const
|
|
866
|
+
return ht(e, ln());
|
|
867
|
+
}, ft.apply(e, arguments), Lt(e);
|
|
868
|
+
}
|
|
869
|
+
const de = (e) => e.trim().toUpperCase(), Qe = (e, n, t = {}) => {
|
|
870
|
+
const r = de(n);
|
|
871
|
+
return e.find((i) => {
|
|
872
|
+
const o = i.properties ?? {};
|
|
873
|
+
if ((o.__isoA2 ?? (typeof o.iso_a2 == "string" ? o.iso_a2.toUpperCase() : void 0)) === r) return !0;
|
|
874
|
+
const a = String(o.name ?? "").toLowerCase();
|
|
875
|
+
return t[a] === r;
|
|
876
|
+
});
|
|
877
|
+
}, At = (e) => {
|
|
878
|
+
if (typeof e != "object" || e === null || !("coordinates" in e))
|
|
879
|
+
return [];
|
|
880
|
+
const n = e.coordinates, t = [], r = (i) => {
|
|
881
|
+
if (Array.isArray(i)) {
|
|
882
|
+
if (i.length >= 2 && typeof i[0] == "number" && typeof i[1] == "number") {
|
|
883
|
+
t.push([i[0], i[1]]);
|
|
884
|
+
return;
|
|
885
|
+
}
|
|
886
|
+
i.forEach(r);
|
|
887
|
+
}
|
|
888
|
+
};
|
|
889
|
+
return r(n), t;
|
|
890
|
+
}, en = (e) => {
|
|
891
|
+
const n = At(e.geometry);
|
|
892
|
+
if (!n.length) return;
|
|
893
|
+
const t = n.reduce(
|
|
894
|
+
(r, [i, o]) => ({
|
|
895
|
+
minLat: Math.min(r.minLat, o),
|
|
896
|
+
maxLat: Math.max(r.maxLat, o),
|
|
897
|
+
minLng: Math.min(r.minLng, i),
|
|
898
|
+
maxLng: Math.max(r.maxLng, i)
|
|
899
|
+
}),
|
|
900
|
+
{
|
|
901
|
+
minLat: Number.POSITIVE_INFINITY,
|
|
902
|
+
maxLat: Number.NEGATIVE_INFINITY,
|
|
903
|
+
minLng: Number.POSITIVE_INFINITY,
|
|
904
|
+
maxLng: Number.NEGATIVE_INFINITY
|
|
905
|
+
}
|
|
906
|
+
);
|
|
907
|
+
if (!(!Number.isFinite(t.minLat) || !Number.isFinite(t.minLng)))
|
|
908
|
+
return t;
|
|
909
|
+
}, nn = (e) => {
|
|
910
|
+
const n = Math.max(0.1, e.maxLat - e.minLat), t = Math.max(0.1, e.maxLng - e.minLng), i = Math.max(n, t) / 112;
|
|
911
|
+
return Math.min(0.9, Math.max(0.14, i));
|
|
912
|
+
}, $e = (e, n) => {
|
|
870
913
|
const t = e?.[n];
|
|
871
914
|
return typeof t == "number" ? t : 0;
|
|
872
|
-
},
|
|
915
|
+
}, tn = (e, n) => {
|
|
873
916
|
if (!e.length) return () => n.minColor;
|
|
874
917
|
const t = Math.min(...e), r = Math.max(...e);
|
|
875
918
|
if (t === r) return () => n.maxColor;
|
|
876
|
-
const i =
|
|
877
|
-
return (
|
|
878
|
-
},
|
|
919
|
+
const i = ln().domain([t, r]).range([0, 1]), o = ke(n.minColor, n.maxColor);
|
|
920
|
+
return (s) => o(i(s));
|
|
921
|
+
}, St = (e) => e <= 1.35 ? 2 : e <= 2.1 ? 1 : 0, Et = (e) => new Intl.NumberFormat("en-US", { maximumFractionDigits: 0 }).format(e), Re = (e) => e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'"), It = (e, n) => {
|
|
879
922
|
let t = e.trim();
|
|
880
923
|
if (!t) return t;
|
|
881
924
|
const r = n?.trim().toUpperCase();
|
|
882
925
|
return r && /^[A-Z]{2}$/.test(r) && (t = t.replace(new RegExp(`\\s*\\(${r}\\)`, "gi"), "").replace(new RegExp(`\\s*\\[${r}\\]`, "gi"), "").replace(new RegExp(`\\s*[-–—]\\s*${r}\\s*$`, "i"), "").replace(new RegExp(`\\s+${r}\\s*$`, "i"), "")), t.trim() || e.trim();
|
|
883
|
-
},
|
|
926
|
+
}, Ft = (e) => e.replace(/_/g, " ").replace(/\b\w/g, (t) => t.toUpperCase()), jt = /* @__PURE__ */ new Set([
|
|
884
927
|
"countrycode",
|
|
885
928
|
"country_code",
|
|
886
929
|
"iso_a2",
|
|
887
930
|
"iso",
|
|
888
931
|
"adm0_a3",
|
|
889
932
|
"iso_3166_1"
|
|
890
|
-
]),
|
|
933
|
+
]), Pt = (e) => jt.has(e.toLowerCase()), Ot = (e, n) => e.toLowerCase() === "revenue" ? new Intl.NumberFormat("en-US", {
|
|
891
934
|
style: "currency",
|
|
892
935
|
currency: "USD",
|
|
893
936
|
notation: "compact",
|
|
894
937
|
maximumFractionDigits: 1
|
|
895
|
-
}).format(n) :
|
|
896
|
-
if (typeof document > "u" || document.getElementById(
|
|
938
|
+
}).format(n) : Et(n), rn = "cool-globe-float-tooltip-override", zt = () => {
|
|
939
|
+
if (typeof document > "u" || document.getElementById(rn)) return;
|
|
897
940
|
const e = document.createElement("style");
|
|
898
|
-
e.id =
|
|
941
|
+
e.id = rn, e.textContent = `
|
|
899
942
|
.cool-globe-host .float-tooltip-kap {
|
|
900
943
|
background: transparent !important;
|
|
901
944
|
background-color: transparent !important;
|
|
@@ -908,227 +951,226 @@ const Me = (e, n) => {
|
|
|
908
951
|
color: transparent !important;
|
|
909
952
|
}
|
|
910
953
|
`, document.head.appendChild(e);
|
|
911
|
-
},
|
|
954
|
+
}, Dt = ({
|
|
912
955
|
statisticsData: e,
|
|
913
956
|
resetSignal: n,
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
957
|
+
preselectedCountry: t,
|
|
958
|
+
countryNumericToIsoMap: r = {},
|
|
959
|
+
countryNameToIsoMap: i = {},
|
|
960
|
+
primaryMetric: o = "visits",
|
|
961
|
+
colorScale: s = Cn
|
|
918
962
|
}) => {
|
|
919
|
-
const
|
|
963
|
+
const a = V(null), l = V(null), f = V(void 0), d = V({}), c = V(null), h = V(n), N = V(void 0), [k, L] = G(!1), [w, A] = G(0), [M, J] = G(), [I, U] = G(), [R, re] = G(null), [F, ie] = G([]), [oe, D] = G([]), [g, P] = G({
|
|
920
964
|
width: 900,
|
|
921
965
|
height: 760
|
|
922
966
|
});
|
|
923
|
-
|
|
924
|
-
|
|
967
|
+
z(() => {
|
|
968
|
+
zt();
|
|
925
969
|
}, []);
|
|
926
|
-
const
|
|
970
|
+
const _ = se(
|
|
927
971
|
() => Object.values(e.countries).map(
|
|
928
|
-
(
|
|
972
|
+
(u) => $e(u, o)
|
|
929
973
|
),
|
|
930
|
-
[
|
|
931
|
-
),
|
|
932
|
-
(
|
|
933
|
-
) : [], [
|
|
934
|
-
() =>
|
|
935
|
-
[
|
|
936
|
-
),
|
|
937
|
-
() =>
|
|
938
|
-
[
|
|
974
|
+
[o, e.countries]
|
|
975
|
+
), O = se(() => M ? Object.values(e.regions[M] ?? {}).map(
|
|
976
|
+
(u) => $e(u, o)
|
|
977
|
+
) : [], [M, o, e.regions]), ae = se(
|
|
978
|
+
() => tn(_, s),
|
|
979
|
+
[_, s]
|
|
980
|
+
), K = se(
|
|
981
|
+
() => tn(O, s),
|
|
982
|
+
[O, s]
|
|
939
983
|
);
|
|
940
|
-
|
|
984
|
+
z(() => {
|
|
941
985
|
(async () => {
|
|
942
986
|
let m = [];
|
|
943
987
|
try {
|
|
944
|
-
m = (await (await fetch(
|
|
988
|
+
m = (await (await fetch(Mn)).json()).features;
|
|
945
989
|
} catch {
|
|
946
|
-
const
|
|
947
|
-
|
|
948
|
-
|
|
990
|
+
const b = await (await fetch(_n)).json(), p = b.objects.countries, v = vn(
|
|
991
|
+
b,
|
|
992
|
+
p
|
|
949
993
|
);
|
|
950
|
-
m =
|
|
994
|
+
m = v.type === "FeatureCollection" ? v.features : [v];
|
|
951
995
|
}
|
|
952
996
|
const y = m.map((x) => {
|
|
953
|
-
const
|
|
954
|
-
|
|
955
|
-
).trim() || `Country ${
|
|
956
|
-
|
|
957
|
-
).trim().toUpperCase(),
|
|
997
|
+
const b = String(x.id ?? ""), p = x.properties ?? {}, v = String(
|
|
998
|
+
p.name ?? p.NAME ?? p.name_en ?? p.ADMIN ?? ""
|
|
999
|
+
).trim() || `Country ${b}`, q = v.toLowerCase(), T = String(
|
|
1000
|
+
p.iso_a2 ?? p.ISO_A2 ?? p.iso_a2_eh ?? ""
|
|
1001
|
+
).trim().toUpperCase(), we = r[b] ?? i[q] ?? (T && T !== "-99" ? T : void 0) ?? (b.length === 2 ? b.toUpperCase() : b);
|
|
958
1002
|
return {
|
|
959
1003
|
...x,
|
|
960
1004
|
properties: {
|
|
961
|
-
...
|
|
962
|
-
__isoA2:
|
|
963
|
-
name:
|
|
1005
|
+
...p,
|
|
1006
|
+
__isoA2: we,
|
|
1007
|
+
name: v || we || `Country ${b}`
|
|
964
1008
|
}
|
|
965
1009
|
};
|
|
966
1010
|
});
|
|
967
|
-
|
|
1011
|
+
ie(y);
|
|
968
1012
|
})();
|
|
969
|
-
}, []),
|
|
970
|
-
if (!
|
|
971
|
-
const
|
|
1013
|
+
}, []), z(() => {
|
|
1014
|
+
if (!l.current) return;
|
|
1015
|
+
const u = new ResizeObserver((m) => {
|
|
972
1016
|
const y = m[0];
|
|
973
|
-
y &&
|
|
1017
|
+
y && P({
|
|
974
1018
|
width: Math.max(360, Math.floor(y.contentRect.width)),
|
|
975
1019
|
height: Math.max(520, Math.floor(y.contentRect.height))
|
|
976
1020
|
});
|
|
977
1021
|
});
|
|
978
|
-
return
|
|
979
|
-
}, []),
|
|
980
|
-
if (!
|
|
981
|
-
|
|
1022
|
+
return u.observe(l.current), () => u.disconnect();
|
|
1023
|
+
}, []), z(() => {
|
|
1024
|
+
if (!M) {
|
|
1025
|
+
D([]);
|
|
982
1026
|
return;
|
|
983
1027
|
}
|
|
984
|
-
const
|
|
985
|
-
if (
|
|
986
|
-
|
|
1028
|
+
const u = d.current[M];
|
|
1029
|
+
if (u) {
|
|
1030
|
+
D(u);
|
|
987
1031
|
return;
|
|
988
1032
|
}
|
|
989
1033
|
(async () => {
|
|
990
|
-
if (!
|
|
991
|
-
const
|
|
992
|
-
|
|
1034
|
+
if (!c.current) {
|
|
1035
|
+
const p = await (await fetch($n)).json();
|
|
1036
|
+
c.current = p.features;
|
|
993
1037
|
}
|
|
994
|
-
const x = (
|
|
995
|
-
(
|
|
996
|
-
).map((
|
|
997
|
-
const
|
|
1038
|
+
const x = (c.current ?? []).filter(
|
|
1039
|
+
(b) => (b.properties ?? {}).iso_a2 === M
|
|
1040
|
+
).map((b) => {
|
|
1041
|
+
const p = b.properties ?? {}, v = String(p.name ?? "").trim();
|
|
998
1042
|
return {
|
|
999
|
-
...
|
|
1043
|
+
...b,
|
|
1000
1044
|
properties: {
|
|
1001
|
-
...
|
|
1002
|
-
__countryCode:
|
|
1003
|
-
__regionName:
|
|
1004
|
-
name:
|
|
1045
|
+
...p,
|
|
1046
|
+
__countryCode: M,
|
|
1047
|
+
__regionName: v,
|
|
1048
|
+
name: v
|
|
1005
1049
|
}
|
|
1006
1050
|
};
|
|
1007
1051
|
});
|
|
1008
|
-
|
|
1052
|
+
d.current[M] = x, D(x);
|
|
1009
1053
|
})();
|
|
1010
|
-
}, [
|
|
1011
|
-
if (
|
|
1012
|
-
|
|
1013
|
-
}, [
|
|
1014
|
-
const
|
|
1015
|
-
if (!
|
|
1016
|
-
|
|
1017
|
-
const m =
|
|
1054
|
+
}, [M]), z(() => {
|
|
1055
|
+
if (I && w < 2) return void A(2);
|
|
1056
|
+
M && w < 1 && A(1);
|
|
1057
|
+
}, [M, I, w]), z(() => {
|
|
1058
|
+
const u = a.current?.controls?.();
|
|
1059
|
+
if (!u) return;
|
|
1060
|
+
u.autoRotate = !0, u.autoRotateSpeed = 0.45, u.enablePan = !1, u.enableZoom = !0;
|
|
1061
|
+
const m = a.current?.renderer?.();
|
|
1018
1062
|
m && m.setPixelRatio(Math.min(window.devicePixelRatio, 1.5));
|
|
1019
|
-
}, []),
|
|
1020
|
-
const
|
|
1021
|
-
|
|
1022
|
-
}, [
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1063
|
+
}, []), z(() => {
|
|
1064
|
+
const u = a.current?.controls?.();
|
|
1065
|
+
u && (u.autoRotate = !M && w === 0);
|
|
1066
|
+
}, [M, w]);
|
|
1067
|
+
const S = ve((u, m, y) => {
|
|
1068
|
+
a.current?.pointOfView({ lat: u, lng: m, altitude: y }, 650);
|
|
1069
|
+
}, []), H = ve(() => {
|
|
1070
|
+
const u = a.current?.controls?.();
|
|
1071
|
+
u && (u.autoRotate = !1);
|
|
1072
|
+
}, []), $ = ve(
|
|
1073
|
+
(u, m, y) => {
|
|
1074
|
+
const x = de(u);
|
|
1075
|
+
if (!x || (H(), A(1), J(x), U(void 0), y?.focusCamera === !1)) return;
|
|
1076
|
+
const b = m ?? Qe(
|
|
1077
|
+
F,
|
|
1078
|
+
x,
|
|
1079
|
+
i
|
|
1080
|
+
), p = b ? en(b) : void 0;
|
|
1081
|
+
p && S(
|
|
1082
|
+
(p.minLat + p.maxLat) / 2,
|
|
1083
|
+
(p.minLng + p.maxLng) / 2,
|
|
1084
|
+
nn(p)
|
|
1085
|
+
);
|
|
1086
|
+
},
|
|
1087
|
+
[F, i, S, H]
|
|
1088
|
+
);
|
|
1089
|
+
z(() => {
|
|
1090
|
+
if (n === h.current) return;
|
|
1091
|
+
h.current = n, U(void 0), re(null), N.current = void 0;
|
|
1092
|
+
const u = t?.trim() ? de(t) : void 0;
|
|
1093
|
+
if (u) {
|
|
1094
|
+
$(u);
|
|
1095
|
+
return;
|
|
1096
|
+
}
|
|
1097
|
+
A(0), J(void 0), D([]);
|
|
1098
|
+
const m = a.current?.controls?.();
|
|
1099
|
+
m && (m.autoRotate = !0), S(20, 15, 2.6);
|
|
1100
|
+
}, [S, t, n, $]), z(() => {
|
|
1101
|
+
const u = t?.trim() ? de(t) : void 0;
|
|
1102
|
+
if (!u || !k || !F.length) return;
|
|
1103
|
+
const m = `${u}:${String(n ?? "")}`;
|
|
1104
|
+
if (N.current === m) return;
|
|
1105
|
+
const y = Qe(
|
|
1106
|
+
F,
|
|
1107
|
+
u,
|
|
1108
|
+
i
|
|
1065
1109
|
);
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1110
|
+
$(u, y), N.current = m;
|
|
1111
|
+
}, [
|
|
1112
|
+
F,
|
|
1113
|
+
i,
|
|
1114
|
+
k,
|
|
1115
|
+
t,
|
|
1116
|
+
n,
|
|
1117
|
+
$
|
|
1118
|
+
]);
|
|
1119
|
+
const dn = () => {
|
|
1120
|
+
const u = a.current?.globeMaterial?.();
|
|
1121
|
+
u && (u.map = null, u.color = new Ne("#f5f5f5"), u.emissive = new Ne("#ffffff"), u.emissiveIntensity = 0.35, u.specular = new Ne("#d4d4d8"), u.shininess = 3, u.needsUpdate = !0);
|
|
1122
|
+
}, mn = () => {
|
|
1123
|
+
f.current && window.clearTimeout(f.current), f.current = window.setTimeout(() => {
|
|
1124
|
+
const u = a.current?.pointOfView?.().altitude ?? 2.4, m = St(u);
|
|
1125
|
+
A(m), m <= 0 && U(void 0);
|
|
1075
1126
|
}, 120);
|
|
1076
|
-
},
|
|
1077
|
-
const m =
|
|
1078
|
-
if (
|
|
1079
|
-
const y =
|
|
1127
|
+
}, hn = (u) => {
|
|
1128
|
+
const m = u.properties ?? {};
|
|
1129
|
+
if (w === 0) {
|
|
1130
|
+
const y = i[String(m.name ?? "").toLowerCase()], x = m.__isoA2 ?? (typeof m.iso_a2 == "string" ? m.iso_a2.toUpperCase() : void 0) ?? y;
|
|
1080
1131
|
if (!x) return;
|
|
1081
|
-
|
|
1082
|
-
const g = O(c);
|
|
1083
|
-
if (g) {
|
|
1084
|
-
A(
|
|
1085
|
-
(g.minLat + g.maxLat) / 2,
|
|
1086
|
-
(g.minLng + g.maxLng) / 2,
|
|
1087
|
-
z(g)
|
|
1088
|
-
);
|
|
1089
|
-
return;
|
|
1090
|
-
}
|
|
1132
|
+
$(x, u);
|
|
1091
1133
|
return;
|
|
1092
1134
|
}
|
|
1093
|
-
if (
|
|
1135
|
+
if (w >= 1) {
|
|
1094
1136
|
const y = m.__regionName;
|
|
1095
1137
|
if (!y) return;
|
|
1096
|
-
|
|
1097
|
-
const x =
|
|
1138
|
+
H(), A(2), U(y);
|
|
1139
|
+
const x = en(u);
|
|
1098
1140
|
if (x) {
|
|
1099
|
-
|
|
1141
|
+
S(
|
|
1100
1142
|
(x.minLat + x.maxLat) / 2,
|
|
1101
1143
|
(x.minLng + x.maxLng) / 2,
|
|
1102
|
-
Math.max(0.2,
|
|
1144
|
+
Math.max(0.2, nn(x) * 0.52)
|
|
1103
1145
|
);
|
|
1104
1146
|
return;
|
|
1105
1147
|
}
|
|
1106
1148
|
}
|
|
1107
|
-
},
|
|
1108
|
-
if (m &&
|
|
1109
|
-
return e.regions[
|
|
1110
|
-
if (
|
|
1111
|
-
},
|
|
1112
|
-
if (!
|
|
1149
|
+
}, gn = w === 0 ? F : oe.length ? [...F, ...oe] : F, Pe = (u, m) => {
|
|
1150
|
+
if (m && u)
|
|
1151
|
+
return e.regions[u]?.[m];
|
|
1152
|
+
if (u) return e.countries[u];
|
|
1153
|
+
}, pn = (u) => {
|
|
1154
|
+
if (!u)
|
|
1113
1155
|
return '<div style="color:#697386;font-weight:500;font-size:15px;">No data available</div>';
|
|
1114
|
-
const m = Object.entries(
|
|
1115
|
-
([
|
|
1156
|
+
const m = Object.entries(u).filter(
|
|
1157
|
+
([p, v]) => !Pt(p) && typeof v == "number" && Number.isFinite(v)
|
|
1116
1158
|
);
|
|
1117
1159
|
if (!m.length)
|
|
1118
1160
|
return '<div style="color:#697386;font-weight:500;font-size:15px;">No data available</div>';
|
|
1119
|
-
m.sort(([
|
|
1120
|
-
const y = "display:flex;justify-content:space-between;align-items:center;gap:24px;padding:6px 0;", x = "font-weight:500;color:#697386;font-size:15px;",
|
|
1121
|
-
return m.map(([
|
|
1122
|
-
const
|
|
1123
|
-
|
|
1161
|
+
m.sort(([p], [v]) => p === o ? -1 : v === o ? 1 : p.localeCompare(v));
|
|
1162
|
+
const y = "display:flex;justify-content:space-between;align-items:center;gap:24px;padding:6px 0;", x = "font-weight:500;color:#697386;font-size:15px;", b = "font-weight:600;color:#1A1F36;font-size:15px;font-variant-numeric:tabular-nums;white-space:nowrap;";
|
|
1163
|
+
return m.map(([p, v]) => {
|
|
1164
|
+
const q = Re(Ft(p)), T = Re(
|
|
1165
|
+
Ot(p, v)
|
|
1124
1166
|
);
|
|
1125
|
-
return `<div style="${y}"><span style="${x}">${
|
|
1167
|
+
return `<div style="${y}"><span style="${x}">${q}</span><span style="${b}">${T}</span></div>`;
|
|
1126
1168
|
}).join("");
|
|
1127
1169
|
};
|
|
1128
|
-
return /* @__PURE__ */
|
|
1170
|
+
return /* @__PURE__ */ Oe(
|
|
1129
1171
|
"div",
|
|
1130
1172
|
{
|
|
1131
|
-
ref:
|
|
1173
|
+
ref: l,
|
|
1132
1174
|
className: "cool-globe-host",
|
|
1133
1175
|
style: {
|
|
1134
1176
|
position: "relative",
|
|
@@ -1136,58 +1178,58 @@ const Me = (e, n) => {
|
|
|
1136
1178
|
overflow: "hidden",
|
|
1137
1179
|
background: "white"
|
|
1138
1180
|
},
|
|
1139
|
-
children: /* @__PURE__ */
|
|
1140
|
-
|
|
1181
|
+
children: /* @__PURE__ */ Oe(
|
|
1182
|
+
xn,
|
|
1141
1183
|
{
|
|
1142
|
-
ref:
|
|
1143
|
-
globeImageUrl:
|
|
1184
|
+
ref: a,
|
|
1185
|
+
globeImageUrl: Rn,
|
|
1144
1186
|
backgroundColor: "#ffffff",
|
|
1145
|
-
polygonsData:
|
|
1187
|
+
polygonsData: gn,
|
|
1146
1188
|
polygonAltitude: 0.01,
|
|
1147
1189
|
polygonsTransitionDuration: 180,
|
|
1148
|
-
polygonCapColor: (
|
|
1149
|
-
const m =
|
|
1150
|
-
if (
|
|
1190
|
+
polygonCapColor: (u) => {
|
|
1191
|
+
const m = u.properties ?? {}, y = !!m.__regionName;
|
|
1192
|
+
if (w > 0 && !y)
|
|
1151
1193
|
return "rgba(148,163,184,0.027)";
|
|
1152
|
-
const x =
|
|
1153
|
-
return
|
|
1194
|
+
const x = w === 0 ? m.__isoA2 : m.__countryCode, b = m.__regionName, p = Pe(x, b), v = $e(p, o), q = w === 0 ? ae(v) : K(v);
|
|
1195
|
+
return R === u ? "#60a5fa" : q;
|
|
1154
1196
|
},
|
|
1155
|
-
polygonSideColor: (
|
|
1156
|
-
const m =
|
|
1157
|
-
return
|
|
1197
|
+
polygonSideColor: (u) => {
|
|
1198
|
+
const m = u.properties ?? {};
|
|
1199
|
+
return w > 0 && !m.__regionName ? "rgba(148,163,184,0.027)" : m.__regionName ? "rgba(148,163,184,0.22)" : "rgba(226,232,240,0.45)";
|
|
1158
1200
|
},
|
|
1159
|
-
polygonStrokeColor: (
|
|
1160
|
-
const m =
|
|
1161
|
-
return
|
|
1201
|
+
polygonStrokeColor: (u) => {
|
|
1202
|
+
const m = u.properties ?? {};
|
|
1203
|
+
return w > 0 && !m.__regionName ? "rgba(100,116,139,0.067)" : m.__regionName ? "rgba(51,65,85,0.98)" : "rgba(156,163,175,0.95)";
|
|
1162
1204
|
},
|
|
1163
|
-
polygonLabel: (
|
|
1164
|
-
const m =
|
|
1165
|
-
if (
|
|
1205
|
+
polygonLabel: (u) => {
|
|
1206
|
+
const m = u.properties ?? {};
|
|
1207
|
+
if (w > 0 && !m.__regionName)
|
|
1166
1208
|
return "";
|
|
1167
|
-
const y =
|
|
1168
|
-
String(
|
|
1169
|
-
|
|
1170
|
-
),
|
|
1209
|
+
const y = w === 0 ? m.__isoA2 : m.__countryCode, x = m.__regionName, b = x ?? m.name ?? "Unknown", p = w === 0 ? m.__isoA2 : m.__countryCode ?? m.__isoA2, v = It(
|
|
1210
|
+
String(b),
|
|
1211
|
+
p
|
|
1212
|
+
), q = Pe(y, x), T = pn(q);
|
|
1171
1213
|
return `<div style="font-family:system-ui,-apple-system,'Segoe UI',Roboto,Inter,sans-serif;min-width:272px;max-width:320px;padding:20px;background:#ffffff;color:#1A1F36;border-radius:14px;box-shadow:0 8px 24px rgba(15,23,42,0.12);">
|
|
1172
|
-
<div style="font-size:17px;font-weight:600;color:#1A1F36;line-height:1.25;margin-bottom:4px;">${
|
|
1173
|
-
<div style="margin-top:8px;">${
|
|
1214
|
+
<div style="font-size:17px;font-weight:600;color:#1A1F36;line-height:1.25;margin-bottom:4px;">${Re(v)}</div>
|
|
1215
|
+
<div style="margin-top:8px;">${T}</div>
|
|
1174
1216
|
</div>`;
|
|
1175
1217
|
},
|
|
1176
|
-
onPolygonHover: (
|
|
1177
|
-
|
|
1218
|
+
onPolygonHover: (u) => {
|
|
1219
|
+
re(u ?? null);
|
|
1178
1220
|
},
|
|
1179
|
-
onPolygonClick: (
|
|
1180
|
-
onZoom:
|
|
1221
|
+
onPolygonClick: (u) => hn(u),
|
|
1222
|
+
onZoom: mn,
|
|
1181
1223
|
onGlobeReady: () => {
|
|
1182
|
-
|
|
1224
|
+
dn(), L(!0), t?.trim() || S(20, 15, 2.6);
|
|
1183
1225
|
},
|
|
1184
1226
|
onGlobeClick: () => {
|
|
1185
|
-
const
|
|
1186
|
-
|
|
1227
|
+
const u = a.current?.controls?.();
|
|
1228
|
+
u && (u.autoRotate = !1);
|
|
1187
1229
|
},
|
|
1188
1230
|
lineHoverPrecision: 0,
|
|
1189
|
-
width:
|
|
1190
|
-
height:
|
|
1231
|
+
width: g.width,
|
|
1232
|
+
height: g.height,
|
|
1191
1233
|
showAtmosphere: !1
|
|
1192
1234
|
}
|
|
1193
1235
|
)
|
|
@@ -1195,5 +1237,5 @@ const Me = (e, n) => {
|
|
|
1195
1237
|
);
|
|
1196
1238
|
};
|
|
1197
1239
|
export {
|
|
1198
|
-
|
|
1240
|
+
Dt as CoolGlobe
|
|
1199
1241
|
};
|