cool-globe 0.1.0 → 0.1.1
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 +96 -82
- package/dist/cool-globe.cjs +4 -9
- package/dist/cool-globe.js +734 -993
- package/package.json +64 -64
package/dist/cool-globe.js
CHANGED
|
@@ -1,317 +1,58 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
function Ot() {
|
|
6
|
-
if (Ke) return fe;
|
|
7
|
-
Ke = 1;
|
|
8
|
-
var t = /* @__PURE__ */ Symbol.for("react.transitional.element"), e = /* @__PURE__ */ Symbol.for("react.fragment");
|
|
9
|
-
function r(n, i, o) {
|
|
10
|
-
var s = null;
|
|
11
|
-
if (o !== void 0 && (s = "" + o), i.key !== void 0 && (s = "" + i.key), "key" in i) {
|
|
12
|
-
o = {};
|
|
13
|
-
for (var a in i)
|
|
14
|
-
a !== "key" && (o[a] = i[a]);
|
|
15
|
-
} else o = i;
|
|
16
|
-
return i = o.ref, {
|
|
17
|
-
$$typeof: t,
|
|
18
|
-
type: n,
|
|
19
|
-
key: s,
|
|
20
|
-
ref: i !== void 0 ? i : null,
|
|
21
|
-
props: o
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
return fe.Fragment = e, fe.jsx = r, fe.jsxs = r, fe;
|
|
25
|
-
}
|
|
26
|
-
var he = {};
|
|
27
|
-
var et;
|
|
28
|
-
function Bt() {
|
|
29
|
-
return et || (et = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
30
|
-
function t(c) {
|
|
31
|
-
if (c == null) return null;
|
|
32
|
-
if (typeof c == "function")
|
|
33
|
-
return c.$$typeof === Q ? null : c.displayName || c.name || null;
|
|
34
|
-
if (typeof c == "string") return c;
|
|
35
|
-
switch (c) {
|
|
36
|
-
case A:
|
|
37
|
-
return "Fragment";
|
|
38
|
-
case I:
|
|
39
|
-
return "Profiler";
|
|
40
|
-
case T:
|
|
41
|
-
return "StrictMode";
|
|
42
|
-
case _:
|
|
43
|
-
return "Suspense";
|
|
44
|
-
case P:
|
|
45
|
-
return "SuspenseList";
|
|
46
|
-
case ie:
|
|
47
|
-
return "Activity";
|
|
48
|
-
}
|
|
49
|
-
if (typeof c == "object")
|
|
50
|
-
switch (typeof c.tag == "number" && console.error(
|
|
51
|
-
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
52
|
-
), c.$$typeof) {
|
|
53
|
-
case v:
|
|
54
|
-
return "Portal";
|
|
55
|
-
case R:
|
|
56
|
-
return c.displayName || "Context";
|
|
57
|
-
case B:
|
|
58
|
-
return (c._context.displayName || "Context") + ".Consumer";
|
|
59
|
-
case q:
|
|
60
|
-
var w = c.render;
|
|
61
|
-
return c = c.displayName, c || (c = w.displayName || w.name || "", c = c !== "" ? "ForwardRef(" + c + ")" : "ForwardRef"), c;
|
|
62
|
-
case ne:
|
|
63
|
-
return w = c.displayName || null, w !== null ? w : t(c.type) || "Memo";
|
|
64
|
-
case X:
|
|
65
|
-
w = c._payload, c = c._init;
|
|
66
|
-
try {
|
|
67
|
-
return t(c(w));
|
|
68
|
-
} catch {
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
return null;
|
|
72
|
-
}
|
|
73
|
-
function e(c) {
|
|
74
|
-
return "" + c;
|
|
75
|
-
}
|
|
76
|
-
function r(c) {
|
|
77
|
-
try {
|
|
78
|
-
e(c);
|
|
79
|
-
var w = !1;
|
|
80
|
-
} catch {
|
|
81
|
-
w = !0;
|
|
82
|
-
}
|
|
83
|
-
if (w) {
|
|
84
|
-
w = console;
|
|
85
|
-
var k = w.error, M = typeof Symbol == "function" && Symbol.toStringTag && c[Symbol.toStringTag] || c.constructor.name || "Object";
|
|
86
|
-
return k.call(
|
|
87
|
-
w,
|
|
88
|
-
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
89
|
-
M
|
|
90
|
-
), e(c);
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
function n(c) {
|
|
94
|
-
if (c === A) return "<>";
|
|
95
|
-
if (typeof c == "object" && c !== null && c.$$typeof === X)
|
|
96
|
-
return "<...>";
|
|
97
|
-
try {
|
|
98
|
-
var w = t(c);
|
|
99
|
-
return w ? "<" + w + ">" : "<...>";
|
|
100
|
-
} catch {
|
|
101
|
-
return "<...>";
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
function i() {
|
|
105
|
-
var c = y.A;
|
|
106
|
-
return c === null ? null : c.getOwner();
|
|
107
|
-
}
|
|
108
|
-
function o() {
|
|
109
|
-
return Error("react-stack-top-frame");
|
|
110
|
-
}
|
|
111
|
-
function s(c) {
|
|
112
|
-
if (j.call(c, "key")) {
|
|
113
|
-
var w = Object.getOwnPropertyDescriptor(c, "key").get;
|
|
114
|
-
if (w && w.isReactWarning) return !1;
|
|
115
|
-
}
|
|
116
|
-
return c.key !== void 0;
|
|
117
|
-
}
|
|
118
|
-
function a(c, w) {
|
|
119
|
-
function k() {
|
|
120
|
-
Z || (Z = !0, console.error(
|
|
121
|
-
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
122
|
-
w
|
|
123
|
-
));
|
|
124
|
-
}
|
|
125
|
-
k.isReactWarning = !0, Object.defineProperty(c, "key", {
|
|
126
|
-
get: k,
|
|
127
|
-
configurable: !0
|
|
128
|
-
});
|
|
129
|
-
}
|
|
130
|
-
function l() {
|
|
131
|
-
var c = t(this.type);
|
|
132
|
-
return W[c] || (W[c] = !0, console.error(
|
|
133
|
-
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
134
|
-
)), c = this.props.ref, c !== void 0 ? c : null;
|
|
135
|
-
}
|
|
136
|
-
function u(c, w, k, M, d, m) {
|
|
137
|
-
var x = k.ref;
|
|
138
|
-
return c = {
|
|
139
|
-
$$typeof: E,
|
|
140
|
-
type: c,
|
|
141
|
-
key: w,
|
|
142
|
-
props: k,
|
|
143
|
-
_owner: M
|
|
144
|
-
}, (x !== void 0 ? x : null) !== null ? Object.defineProperty(c, "ref", {
|
|
145
|
-
enumerable: !1,
|
|
146
|
-
get: l
|
|
147
|
-
}) : Object.defineProperty(c, "ref", { enumerable: !1, value: null }), c._store = {}, Object.defineProperty(c._store, "validated", {
|
|
148
|
-
configurable: !1,
|
|
149
|
-
enumerable: !1,
|
|
150
|
-
writable: !0,
|
|
151
|
-
value: 0
|
|
152
|
-
}), Object.defineProperty(c, "_debugInfo", {
|
|
153
|
-
configurable: !1,
|
|
154
|
-
enumerable: !1,
|
|
155
|
-
writable: !0,
|
|
156
|
-
value: null
|
|
157
|
-
}), Object.defineProperty(c, "_debugStack", {
|
|
158
|
-
configurable: !1,
|
|
159
|
-
enumerable: !1,
|
|
160
|
-
writable: !0,
|
|
161
|
-
value: d
|
|
162
|
-
}), Object.defineProperty(c, "_debugTask", {
|
|
163
|
-
configurable: !1,
|
|
164
|
-
enumerable: !1,
|
|
165
|
-
writable: !0,
|
|
166
|
-
value: m
|
|
167
|
-
}), Object.freeze && (Object.freeze(c.props), Object.freeze(c)), c;
|
|
168
|
-
}
|
|
169
|
-
function f(c, w, k, M, d, m) {
|
|
170
|
-
var x = w.children;
|
|
171
|
-
if (x !== void 0)
|
|
172
|
-
if (M)
|
|
173
|
-
if (N(x)) {
|
|
174
|
-
for (M = 0; M < x.length; M++)
|
|
175
|
-
h(x[M]);
|
|
176
|
-
Object.freeze && Object.freeze(x);
|
|
177
|
-
} else
|
|
178
|
-
console.error(
|
|
179
|
-
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
180
|
-
);
|
|
181
|
-
else h(x);
|
|
182
|
-
if (j.call(w, "key")) {
|
|
183
|
-
x = t(c);
|
|
184
|
-
var p = Object.keys(w).filter(function(C) {
|
|
185
|
-
return C !== "key";
|
|
186
|
-
});
|
|
187
|
-
M = 0 < p.length ? "{key: someKey, " + p.join(": ..., ") + ": ...}" : "{key: someKey}", L[x + M] || (p = 0 < p.length ? "{" + p.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
188
|
-
`A props object containing a "key" prop is being spread into JSX:
|
|
189
|
-
let props = %s;
|
|
190
|
-
<%s {...props} />
|
|
191
|
-
React keys must be passed directly to JSX without using spread:
|
|
192
|
-
let props = %s;
|
|
193
|
-
<%s key={someKey} {...props} />`,
|
|
194
|
-
M,
|
|
195
|
-
x,
|
|
196
|
-
p,
|
|
197
|
-
x
|
|
198
|
-
), L[x + M] = !0);
|
|
199
|
-
}
|
|
200
|
-
if (x = null, k !== void 0 && (r(k), x = "" + k), s(w) && (r(w.key), x = "" + w.key), "key" in w) {
|
|
201
|
-
k = {};
|
|
202
|
-
for (var b in w)
|
|
203
|
-
b !== "key" && (k[b] = w[b]);
|
|
204
|
-
} else k = w;
|
|
205
|
-
return x && a(
|
|
206
|
-
k,
|
|
207
|
-
typeof c == "function" ? c.displayName || c.name || "Unknown" : c
|
|
208
|
-
), u(
|
|
209
|
-
c,
|
|
210
|
-
x,
|
|
211
|
-
k,
|
|
212
|
-
i(),
|
|
213
|
-
d,
|
|
214
|
-
m
|
|
215
|
-
);
|
|
216
|
-
}
|
|
217
|
-
function h(c) {
|
|
218
|
-
g(c) ? c._store && (c._store.validated = 1) : typeof c == "object" && c !== null && c.$$typeof === X && (c._payload.status === "fulfilled" ? g(c._payload.value) && c._payload.value._store && (c._payload.value._store.validated = 1) : c._store && (c._store.validated = 1));
|
|
219
|
-
}
|
|
220
|
-
function g(c) {
|
|
221
|
-
return typeof c == "object" && c !== null && c.$$typeof === E;
|
|
222
|
-
}
|
|
223
|
-
var F = Lt, E = /* @__PURE__ */ Symbol.for("react.transitional.element"), v = /* @__PURE__ */ Symbol.for("react.portal"), A = /* @__PURE__ */ Symbol.for("react.fragment"), T = /* @__PURE__ */ Symbol.for("react.strict_mode"), I = /* @__PURE__ */ Symbol.for("react.profiler"), B = /* @__PURE__ */ Symbol.for("react.consumer"), R = /* @__PURE__ */ Symbol.for("react.context"), q = /* @__PURE__ */ Symbol.for("react.forward_ref"), _ = /* @__PURE__ */ Symbol.for("react.suspense"), P = /* @__PURE__ */ Symbol.for("react.suspense_list"), ne = /* @__PURE__ */ Symbol.for("react.memo"), X = /* @__PURE__ */ Symbol.for("react.lazy"), ie = /* @__PURE__ */ Symbol.for("react.activity"), Q = /* @__PURE__ */ Symbol.for("react.client.reference"), y = F.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, j = Object.prototype.hasOwnProperty, N = Array.isArray, $ = console.createTask ? console.createTask : function() {
|
|
224
|
-
return null;
|
|
225
|
-
};
|
|
226
|
-
F = {
|
|
227
|
-
react_stack_bottom_frame: function(c) {
|
|
228
|
-
return c();
|
|
229
|
-
}
|
|
230
|
-
};
|
|
231
|
-
var Z, W = {}, z = F.react_stack_bottom_frame.bind(
|
|
232
|
-
F,
|
|
233
|
-
o
|
|
234
|
-
)(), U = $(n(o)), L = {};
|
|
235
|
-
he.Fragment = A, he.jsx = function(c, w, k) {
|
|
236
|
-
var M = 1e4 > y.recentlyCreatedOwnerStacks++;
|
|
237
|
-
return f(
|
|
238
|
-
c,
|
|
239
|
-
w,
|
|
240
|
-
k,
|
|
241
|
-
!1,
|
|
242
|
-
M ? Error("react-stack-top-frame") : z,
|
|
243
|
-
M ? $(n(c)) : U
|
|
244
|
-
);
|
|
245
|
-
}, he.jsxs = function(c, w, k) {
|
|
246
|
-
var M = 1e4 > y.recentlyCreatedOwnerStacks++;
|
|
247
|
-
return f(
|
|
248
|
-
c,
|
|
249
|
-
w,
|
|
250
|
-
k,
|
|
251
|
-
!0,
|
|
252
|
-
M ? Error("react-stack-top-frame") : z,
|
|
253
|
-
M ? $(n(c)) : U
|
|
254
|
-
);
|
|
255
|
-
};
|
|
256
|
-
})()), he;
|
|
257
|
-
}
|
|
258
|
-
var tt;
|
|
259
|
-
function Pt() {
|
|
260
|
-
return tt || (tt = 1, process.env.NODE_ENV === "production" ? Ee.exports = Ot() : Ee.exports = Bt()), Ee.exports;
|
|
261
|
-
}
|
|
262
|
-
var rt = Pt();
|
|
263
|
-
function jt(t) {
|
|
1
|
+
import { jsx as Ze } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as W, useState as U, useMemo as me, useEffect as V } from "react";
|
|
3
|
+
import At from "react-globe.gl";
|
|
4
|
+
function _t(t) {
|
|
264
5
|
return t;
|
|
265
6
|
}
|
|
266
|
-
function
|
|
267
|
-
if (t == null) return
|
|
268
|
-
var e,
|
|
269
|
-
return function(a,
|
|
270
|
-
|
|
271
|
-
var u = 2, f = a.length,
|
|
272
|
-
for (
|
|
273
|
-
return
|
|
7
|
+
function St(t) {
|
|
8
|
+
if (t == null) return _t;
|
|
9
|
+
var e, n, r = t.scale[0], i = t.scale[1], o = t.translate[0], s = t.translate[1];
|
|
10
|
+
return function(a, c) {
|
|
11
|
+
c || (e = n = 0);
|
|
12
|
+
var u = 2, f = a.length, l = new Array(f);
|
|
13
|
+
for (l[0] = (e += a[0]) * r + o, l[1] = (n += a[1]) * i + s; u < f; ) l[u] = a[u], ++u;
|
|
14
|
+
return l;
|
|
274
15
|
};
|
|
275
16
|
}
|
|
276
|
-
function
|
|
277
|
-
for (var
|
|
17
|
+
function Rt(t, e) {
|
|
18
|
+
for (var n, r = t.length, i = r - e; i < --r; ) n = t[i], t[i++] = t[r], t[r] = n;
|
|
278
19
|
}
|
|
279
|
-
function
|
|
280
|
-
return typeof e == "string" && (e = t.objects[e]), e.type === "GeometryCollection" ? { type: "FeatureCollection", features: e.geometries.map(function(
|
|
281
|
-
return
|
|
282
|
-
}) } :
|
|
20
|
+
function Lt(t, e) {
|
|
21
|
+
return typeof e == "string" && (e = t.objects[e]), e.type === "GeometryCollection" ? { type: "FeatureCollection", features: e.geometries.map(function(n) {
|
|
22
|
+
return Ye(t, n);
|
|
23
|
+
}) } : Ye(t, e);
|
|
283
24
|
}
|
|
284
|
-
function
|
|
285
|
-
var
|
|
286
|
-
return
|
|
25
|
+
function Ye(t, e) {
|
|
26
|
+
var n = e.id, r = e.bbox, i = e.properties == null ? {} : e.properties, o = Bt(t, e);
|
|
27
|
+
return n == null && r == null ? { type: "Feature", properties: i, geometry: o } : r == null ? { type: "Feature", id: n, properties: i, geometry: o } : { type: "Feature", id: n, bbox: r, properties: i, geometry: o };
|
|
287
28
|
}
|
|
288
|
-
function
|
|
289
|
-
var
|
|
290
|
-
function i(f,
|
|
291
|
-
|
|
292
|
-
for (var g =
|
|
293
|
-
|
|
294
|
-
f < 0 &&
|
|
29
|
+
function Bt(t, e) {
|
|
30
|
+
var n = St(t.transform), r = t.arcs;
|
|
31
|
+
function i(f, l) {
|
|
32
|
+
l.length && l.pop();
|
|
33
|
+
for (var g = r[f < 0 ? ~f : f], w = 0, y = g.length; w < y; ++w)
|
|
34
|
+
l.push(n(g[w], w));
|
|
35
|
+
f < 0 && Rt(l, y);
|
|
295
36
|
}
|
|
296
37
|
function o(f) {
|
|
297
|
-
return
|
|
38
|
+
return n(f);
|
|
298
39
|
}
|
|
299
40
|
function s(f) {
|
|
300
|
-
for (var
|
|
301
|
-
return
|
|
41
|
+
for (var l = [], g = 0, w = f.length; g < w; ++g) i(f[g], l);
|
|
42
|
+
return l.length < 2 && l.push(l[0]), l;
|
|
302
43
|
}
|
|
303
44
|
function a(f) {
|
|
304
|
-
for (var
|
|
305
|
-
return
|
|
45
|
+
for (var l = s(f); l.length < 4; ) l.push(l[0]);
|
|
46
|
+
return l;
|
|
306
47
|
}
|
|
307
|
-
function
|
|
48
|
+
function c(f) {
|
|
308
49
|
return f.map(a);
|
|
309
50
|
}
|
|
310
51
|
function u(f) {
|
|
311
|
-
var
|
|
312
|
-
switch (
|
|
52
|
+
var l = f.type, g;
|
|
53
|
+
switch (l) {
|
|
313
54
|
case "GeometryCollection":
|
|
314
|
-
return { type:
|
|
55
|
+
return { type: l, geometries: f.geometries.map(u) };
|
|
315
56
|
case "Point":
|
|
316
57
|
g = o(f.coordinates);
|
|
317
58
|
break;
|
|
@@ -325,29 +66,29 @@ function Yt(t, e) {
|
|
|
325
66
|
g = f.arcs.map(s);
|
|
326
67
|
break;
|
|
327
68
|
case "Polygon":
|
|
328
|
-
g =
|
|
69
|
+
g = c(f.arcs);
|
|
329
70
|
break;
|
|
330
71
|
case "MultiPolygon":
|
|
331
|
-
g = f.arcs.map(
|
|
72
|
+
g = f.arcs.map(c);
|
|
332
73
|
break;
|
|
333
74
|
default:
|
|
334
75
|
return null;
|
|
335
76
|
}
|
|
336
|
-
return { type:
|
|
77
|
+
return { type: l, coordinates: g };
|
|
337
78
|
}
|
|
338
79
|
return u(e);
|
|
339
80
|
}
|
|
340
|
-
const
|
|
341
|
-
function
|
|
342
|
-
return Math.max(e, Math.min(
|
|
81
|
+
const xt = "180", $t = "", B = "srgb", Xe = "srgb-linear", We = "linear", _e = "srgb";
|
|
82
|
+
function ie(t, e, n) {
|
|
83
|
+
return Math.max(e, Math.min(n, t));
|
|
343
84
|
}
|
|
344
|
-
function
|
|
85
|
+
function Dt(t, e) {
|
|
345
86
|
return (t % e + e) % e;
|
|
346
87
|
}
|
|
347
|
-
function
|
|
348
|
-
return (1 -
|
|
88
|
+
function Se(t, e, n) {
|
|
89
|
+
return (1 - n) * t + n * e;
|
|
349
90
|
}
|
|
350
|
-
class
|
|
91
|
+
class ce {
|
|
351
92
|
/**
|
|
352
93
|
* Constructs a new 3x3 matrix. The arguments are supposed to be
|
|
353
94
|
* in row-major order. If no arguments are provided, the constructor
|
|
@@ -363,8 +104,8 @@ class be {
|
|
|
363
104
|
* @param {number} [n32] - 3-2 matrix element.
|
|
364
105
|
* @param {number} [n33] - 3-3 matrix element.
|
|
365
106
|
*/
|
|
366
|
-
constructor(e,
|
|
367
|
-
|
|
107
|
+
constructor(e, n, r, i, o, s, a, c, u) {
|
|
108
|
+
ce.prototype.isMatrix3 = !0, this.elements = [
|
|
368
109
|
1,
|
|
369
110
|
0,
|
|
370
111
|
0,
|
|
@@ -374,7 +115,7 @@ class be {
|
|
|
374
115
|
0,
|
|
375
116
|
0,
|
|
376
117
|
1
|
|
377
|
-
], e !== void 0 && this.set(e,
|
|
118
|
+
], e !== void 0 && this.set(e, n, r, i, o, s, a, c, u);
|
|
378
119
|
}
|
|
379
120
|
/**
|
|
380
121
|
* Sets the elements of the matrix.The arguments are supposed to be
|
|
@@ -391,9 +132,9 @@ class be {
|
|
|
391
132
|
* @param {number} [n33] - 3-3 matrix element.
|
|
392
133
|
* @return {Matrix3} A reference to this matrix.
|
|
393
134
|
*/
|
|
394
|
-
set(e,
|
|
135
|
+
set(e, n, r, i, o, s, a, c, u) {
|
|
395
136
|
const f = this.elements;
|
|
396
|
-
return f[0] = e, f[1] = i, f[2] = a, f[3] =
|
|
137
|
+
return f[0] = e, f[1] = i, f[2] = a, f[3] = n, f[4] = o, f[5] = c, f[6] = r, f[7] = s, f[8] = u, this;
|
|
397
138
|
}
|
|
398
139
|
/**
|
|
399
140
|
* Sets this matrix to the 3x3 identity matrix.
|
|
@@ -420,8 +161,8 @@ class be {
|
|
|
420
161
|
* @return {Matrix3} A reference to this matrix.
|
|
421
162
|
*/
|
|
422
163
|
copy(e) {
|
|
423
|
-
const
|
|
424
|
-
return
|
|
164
|
+
const n = this.elements, r = e.elements;
|
|
165
|
+
return n[0] = r[0], n[1] = r[1], n[2] = r[2], n[3] = r[3], n[4] = r[4], n[5] = r[5], n[6] = r[6], n[7] = r[7], n[8] = r[8], this;
|
|
425
166
|
}
|
|
426
167
|
/**
|
|
427
168
|
* Extracts the basis of this matrix into the three axis vectors provided.
|
|
@@ -431,8 +172,8 @@ class be {
|
|
|
431
172
|
* @param {Vector3} zAxis - The basis's z axis.
|
|
432
173
|
* @return {Matrix3} A reference to this matrix.
|
|
433
174
|
*/
|
|
434
|
-
extractBasis(e,
|
|
435
|
-
return e.setFromMatrix3Column(this, 0),
|
|
175
|
+
extractBasis(e, n, r) {
|
|
176
|
+
return e.setFromMatrix3Column(this, 0), n.setFromMatrix3Column(this, 1), r.setFromMatrix3Column(this, 2), this;
|
|
436
177
|
}
|
|
437
178
|
/**
|
|
438
179
|
* Set this matrix to the upper 3x3 matrix of the given 4x4 matrix.
|
|
@@ -441,17 +182,17 @@ class be {
|
|
|
441
182
|
* @return {Matrix3} A reference to this matrix.
|
|
442
183
|
*/
|
|
443
184
|
setFromMatrix4(e) {
|
|
444
|
-
const
|
|
185
|
+
const n = e.elements;
|
|
445
186
|
return this.set(
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
187
|
+
n[0],
|
|
188
|
+
n[4],
|
|
189
|
+
n[8],
|
|
190
|
+
n[1],
|
|
191
|
+
n[5],
|
|
192
|
+
n[9],
|
|
193
|
+
n[2],
|
|
194
|
+
n[6],
|
|
195
|
+
n[10]
|
|
455
196
|
), this;
|
|
456
197
|
}
|
|
457
198
|
/**
|
|
@@ -480,9 +221,9 @@ class be {
|
|
|
480
221
|
* @param {Matrix3} b - The second matrix.
|
|
481
222
|
* @return {Matrix3} A reference to this matrix.
|
|
482
223
|
*/
|
|
483
|
-
multiplyMatrices(e,
|
|
484
|
-
const
|
|
485
|
-
return o[0] = s *
|
|
224
|
+
multiplyMatrices(e, n) {
|
|
225
|
+
const r = e.elements, i = n.elements, o = this.elements, s = r[0], a = r[3], c = r[6], u = r[1], f = r[4], l = r[7], g = r[2], w = r[5], y = r[8], F = i[0], S = i[3], _ = i[6], O = i[1], D = i[4], v = i[7], j = i[2], M = i[5], T = i[8];
|
|
226
|
+
return o[0] = s * F + a * O + c * j, o[3] = s * S + a * D + c * M, o[6] = s * _ + a * v + c * T, o[1] = u * F + f * O + l * j, o[4] = u * S + f * D + l * M, o[7] = u * _ + f * v + l * T, o[2] = g * F + w * O + y * j, o[5] = g * S + w * D + y * M, o[8] = g * _ + w * v + y * T, this;
|
|
486
227
|
}
|
|
487
228
|
/**
|
|
488
229
|
* Multiplies every component of the matrix by the given scalar.
|
|
@@ -491,8 +232,8 @@ class be {
|
|
|
491
232
|
* @return {Matrix3} A reference to this matrix.
|
|
492
233
|
*/
|
|
493
234
|
multiplyScalar(e) {
|
|
494
|
-
const
|
|
495
|
-
return
|
|
235
|
+
const n = this.elements;
|
|
236
|
+
return n[0] *= e, n[3] *= e, n[6] *= e, n[1] *= e, n[4] *= e, n[7] *= e, n[2] *= e, n[5] *= e, n[8] *= e, this;
|
|
496
237
|
}
|
|
497
238
|
/**
|
|
498
239
|
* Computes and returns the determinant of this matrix.
|
|
@@ -500,8 +241,8 @@ class be {
|
|
|
500
241
|
* @return {number} The determinant.
|
|
501
242
|
*/
|
|
502
243
|
determinant() {
|
|
503
|
-
const e = this.elements,
|
|
504
|
-
return
|
|
244
|
+
const e = this.elements, n = e[0], r = e[1], i = e[2], o = e[3], s = e[4], a = e[5], c = e[6], u = e[7], f = e[8];
|
|
245
|
+
return n * s * f - n * a * u - r * o * f + r * a * c + i * o * u - i * s * c;
|
|
505
246
|
}
|
|
506
247
|
/**
|
|
507
248
|
* Inverts this matrix, using the [analytic method]{@link https://en.wikipedia.org/wiki/Invertible_matrix#Analytic_solution}.
|
|
@@ -511,10 +252,10 @@ class be {
|
|
|
511
252
|
* @return {Matrix3} A reference to this matrix.
|
|
512
253
|
*/
|
|
513
254
|
invert() {
|
|
514
|
-
const e = this.elements,
|
|
515
|
-
if (
|
|
516
|
-
const
|
|
517
|
-
return e[0] =
|
|
255
|
+
const e = this.elements, n = e[0], r = e[1], i = e[2], o = e[3], s = e[4], a = e[5], c = e[6], u = e[7], f = e[8], l = f * s - a * u, g = a * c - f * o, w = u * o - s * c, y = n * l + r * g + i * w;
|
|
256
|
+
if (y === 0) return this.set(0, 0, 0, 0, 0, 0, 0, 0, 0);
|
|
257
|
+
const F = 1 / y;
|
|
258
|
+
return e[0] = l * F, e[1] = (i * u - f * r) * F, e[2] = (a * r - i * s) * F, e[3] = g * F, e[4] = (f * n - i * c) * F, e[5] = (i * o - a * n) * F, e[6] = w * F, e[7] = (r * c - u * n) * F, e[8] = (s * n - r * o) * F, this;
|
|
518
259
|
}
|
|
519
260
|
/**
|
|
520
261
|
* Transposes this matrix in place.
|
|
@@ -523,8 +264,8 @@ class be {
|
|
|
523
264
|
*/
|
|
524
265
|
transpose() {
|
|
525
266
|
let e;
|
|
526
|
-
const
|
|
527
|
-
return e =
|
|
267
|
+
const n = this.elements;
|
|
268
|
+
return e = n[1], n[1] = n[3], n[3] = e, e = n[2], n[2] = n[6], n[6] = e, e = n[5], n[5] = n[7], n[7] = e, this;
|
|
528
269
|
}
|
|
529
270
|
/**
|
|
530
271
|
* Computes the normal matrix which is the inverse transpose of the upper
|
|
@@ -543,8 +284,8 @@ class be {
|
|
|
543
284
|
* @return {Matrix3} A reference to this matrix.
|
|
544
285
|
*/
|
|
545
286
|
transposeIntoArray(e) {
|
|
546
|
-
const
|
|
547
|
-
return e[0] =
|
|
287
|
+
const n = this.elements;
|
|
288
|
+
return e[0] = n[0], e[1] = n[3], e[2] = n[6], e[3] = n[1], e[4] = n[4], e[5] = n[7], e[6] = n[2], e[7] = n[5], e[8] = n[8], this;
|
|
548
289
|
}
|
|
549
290
|
/**
|
|
550
291
|
* Sets the UV transform matrix from offset, repeat, rotation, and center.
|
|
@@ -558,15 +299,15 @@ class be {
|
|
|
558
299
|
* @param {number} cy - Center y of rotation
|
|
559
300
|
* @return {Matrix3} A reference to this matrix.
|
|
560
301
|
*/
|
|
561
|
-
setUvTransform(e,
|
|
562
|
-
const
|
|
302
|
+
setUvTransform(e, n, r, i, o, s, a) {
|
|
303
|
+
const c = Math.cos(o), u = Math.sin(o);
|
|
563
304
|
return this.set(
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
-
|
|
305
|
+
r * c,
|
|
306
|
+
r * u,
|
|
307
|
+
-r * (c * s + u * a) + s + e,
|
|
567
308
|
-i * u,
|
|
568
|
-
i *
|
|
569
|
-
-i * (-u * s +
|
|
309
|
+
i * c,
|
|
310
|
+
-i * (-u * s + c * a) + a + n,
|
|
570
311
|
0,
|
|
571
312
|
0,
|
|
572
313
|
1
|
|
@@ -579,8 +320,8 @@ class be {
|
|
|
579
320
|
* @param {number} sy - The amount to scale in the Y axis.
|
|
580
321
|
* @return {Matrix3} A reference to this matrix.
|
|
581
322
|
*/
|
|
582
|
-
scale(e,
|
|
583
|
-
return this.premultiply(
|
|
323
|
+
scale(e, n) {
|
|
324
|
+
return this.premultiply(Re.makeScale(e, n)), this;
|
|
584
325
|
}
|
|
585
326
|
/**
|
|
586
327
|
* Rotates this matrix by the given angle.
|
|
@@ -589,7 +330,7 @@ class be {
|
|
|
589
330
|
* @return {Matrix3} A reference to this matrix.
|
|
590
331
|
*/
|
|
591
332
|
rotate(e) {
|
|
592
|
-
return this.premultiply(
|
|
333
|
+
return this.premultiply(Re.makeRotation(-e)), this;
|
|
593
334
|
}
|
|
594
335
|
/**
|
|
595
336
|
* Translates this matrix by the given scalar values.
|
|
@@ -598,8 +339,8 @@ class be {
|
|
|
598
339
|
* @param {number} ty - The amount to translate in the Y axis.
|
|
599
340
|
* @return {Matrix3} A reference to this matrix.
|
|
600
341
|
*/
|
|
601
|
-
translate(e,
|
|
602
|
-
return this.premultiply(
|
|
342
|
+
translate(e, n) {
|
|
343
|
+
return this.premultiply(Re.makeTranslation(e, n)), this;
|
|
603
344
|
}
|
|
604
345
|
// for 2D Transforms
|
|
605
346
|
/**
|
|
@@ -609,7 +350,7 @@ class be {
|
|
|
609
350
|
* @param {number} y - The amount to translate in the Y axis.
|
|
610
351
|
* @return {Matrix3} A reference to this matrix.
|
|
611
352
|
*/
|
|
612
|
-
makeTranslation(e,
|
|
353
|
+
makeTranslation(e, n) {
|
|
613
354
|
return e.isVector2 ? this.set(
|
|
614
355
|
1,
|
|
615
356
|
0,
|
|
@@ -626,7 +367,7 @@ class be {
|
|
|
626
367
|
e,
|
|
627
368
|
0,
|
|
628
369
|
1,
|
|
629
|
-
|
|
370
|
+
n,
|
|
630
371
|
0,
|
|
631
372
|
0,
|
|
632
373
|
1
|
|
@@ -639,13 +380,13 @@ class be {
|
|
|
639
380
|
* @return {Matrix3} A reference to this matrix.
|
|
640
381
|
*/
|
|
641
382
|
makeRotation(e) {
|
|
642
|
-
const
|
|
383
|
+
const n = Math.cos(e), r = Math.sin(e);
|
|
643
384
|
return this.set(
|
|
644
|
-
r,
|
|
645
|
-
-n,
|
|
646
|
-
0,
|
|
647
385
|
n,
|
|
386
|
+
-r,
|
|
387
|
+
0,
|
|
648
388
|
r,
|
|
389
|
+
n,
|
|
649
390
|
0,
|
|
650
391
|
0,
|
|
651
392
|
0,
|
|
@@ -659,13 +400,13 @@ class be {
|
|
|
659
400
|
* @param {number} y - The amount to scale in the Y axis.
|
|
660
401
|
* @return {Matrix3} A reference to this matrix.
|
|
661
402
|
*/
|
|
662
|
-
makeScale(e,
|
|
403
|
+
makeScale(e, n) {
|
|
663
404
|
return this.set(
|
|
664
405
|
e,
|
|
665
406
|
0,
|
|
666
407
|
0,
|
|
667
408
|
0,
|
|
668
|
-
|
|
409
|
+
n,
|
|
669
410
|
0,
|
|
670
411
|
0,
|
|
671
412
|
0,
|
|
@@ -679,9 +420,9 @@ class be {
|
|
|
679
420
|
* @return {boolean} Whether this matrix is equal with the given one.
|
|
680
421
|
*/
|
|
681
422
|
equals(e) {
|
|
682
|
-
const
|
|
423
|
+
const n = this.elements, r = e.elements;
|
|
683
424
|
for (let i = 0; i < 9; i++)
|
|
684
|
-
if (
|
|
425
|
+
if (n[i] !== r[i]) return !1;
|
|
685
426
|
return !0;
|
|
686
427
|
}
|
|
687
428
|
/**
|
|
@@ -691,9 +432,9 @@ class be {
|
|
|
691
432
|
* @param {number} [offset=0] - Index of the first element in the array.
|
|
692
433
|
* @return {Matrix3} A reference to this matrix.
|
|
693
434
|
*/
|
|
694
|
-
fromArray(e,
|
|
695
|
-
for (let
|
|
696
|
-
this.elements[
|
|
435
|
+
fromArray(e, n = 0) {
|
|
436
|
+
for (let r = 0; r < 9; r++)
|
|
437
|
+
this.elements[r] = e[r + n];
|
|
697
438
|
return this;
|
|
698
439
|
}
|
|
699
440
|
/**
|
|
@@ -704,9 +445,9 @@ class be {
|
|
|
704
445
|
* @param {number} [offset=0] - Index of the first element in the array.
|
|
705
446
|
* @return {Array<number>} The matrix elements in column-major order.
|
|
706
447
|
*/
|
|
707
|
-
toArray(e = [],
|
|
708
|
-
const
|
|
709
|
-
return e[
|
|
448
|
+
toArray(e = [], n = 0) {
|
|
449
|
+
const r = this.elements;
|
|
450
|
+
return e[n] = r[0], e[n + 1] = r[1], e[n + 2] = r[2], e[n + 3] = r[3], e[n + 4] = r[4], e[n + 5] = r[5], e[n + 6] = r[6], e[n + 7] = r[7], e[n + 8] = r[8], e;
|
|
710
451
|
}
|
|
711
452
|
/**
|
|
712
453
|
* Returns a matrix with copied values from this instance.
|
|
@@ -717,11 +458,11 @@ class be {
|
|
|
717
458
|
return new this.constructor().fromArray(this.elements);
|
|
718
459
|
}
|
|
719
460
|
}
|
|
720
|
-
const
|
|
721
|
-
function
|
|
722
|
-
t in
|
|
461
|
+
const Re = /* @__PURE__ */ new ce(), Je = {};
|
|
462
|
+
function Qe(t) {
|
|
463
|
+
t in Je || (Je[t] = !0, console.warn(t));
|
|
723
464
|
}
|
|
724
|
-
const
|
|
465
|
+
const Ke = /* @__PURE__ */ new ce().set(
|
|
725
466
|
0.4123908,
|
|
726
467
|
0.3575843,
|
|
727
468
|
0.1804808,
|
|
@@ -731,7 +472,7 @@ const ut = /* @__PURE__ */ new be().set(
|
|
|
731
472
|
0.0193308,
|
|
732
473
|
0.1191948,
|
|
733
474
|
0.9505322
|
|
734
|
-
),
|
|
475
|
+
), et = /* @__PURE__ */ new ce().set(
|
|
735
476
|
3.2409699,
|
|
736
477
|
-1.5373832,
|
|
737
478
|
-0.4986108,
|
|
@@ -742,10 +483,10 @@ const ut = /* @__PURE__ */ new be().set(
|
|
|
742
483
|
-0.203977,
|
|
743
484
|
1.0569715
|
|
744
485
|
);
|
|
745
|
-
function
|
|
486
|
+
function Tt() {
|
|
746
487
|
const t = {
|
|
747
488
|
enabled: !0,
|
|
748
|
-
workingColorSpace:
|
|
489
|
+
workingColorSpace: Xe,
|
|
749
490
|
/**
|
|
750
491
|
* Implementations of supported color spaces.
|
|
751
492
|
*
|
|
@@ -766,7 +507,7 @@ function Ut() {
|
|
|
766
507
|
*/
|
|
767
508
|
spaces: {},
|
|
768
509
|
convert: function(i, o, s) {
|
|
769
|
-
return this.enabled === !1 || o === s || !o || !s || (this.spaces[o].transfer ===
|
|
510
|
+
return this.enabled === !1 || o === s || !o || !s || (this.spaces[o].transfer === _e && (i.r = Q(i.r), i.g = Q(i.g), i.b = Q(i.b)), this.spaces[o].primaries !== this.spaces[s].primaries && (i.applyMatrix3(this.spaces[o].toXYZ), i.applyMatrix3(this.spaces[s].fromXYZ)), this.spaces[s].transfer === _e && (i.r = K(i.r), i.g = K(i.g), i.b = K(i.b))), i;
|
|
770
511
|
},
|
|
771
512
|
workingToColorSpace: function(i, o) {
|
|
772
513
|
return this.convert(i, this.workingColorSpace, o);
|
|
@@ -778,7 +519,7 @@ function Ut() {
|
|
|
778
519
|
return this.spaces[i].primaries;
|
|
779
520
|
},
|
|
780
521
|
getTransfer: function(i) {
|
|
781
|
-
return i ===
|
|
522
|
+
return i === $t ? We : this.spaces[i].transfer;
|
|
782
523
|
},
|
|
783
524
|
getToneMappingMode: function(i) {
|
|
784
525
|
return this.spaces[i].outputColorSpaceConfig.toneMappingMode || "standard";
|
|
@@ -801,42 +542,42 @@ function Ut() {
|
|
|
801
542
|
},
|
|
802
543
|
// Deprecated
|
|
803
544
|
fromWorkingColorSpace: function(i, o) {
|
|
804
|
-
return
|
|
545
|
+
return Qe("THREE.ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."), t.workingToColorSpace(i, o);
|
|
805
546
|
},
|
|
806
547
|
toWorkingColorSpace: function(i, o) {
|
|
807
|
-
return
|
|
548
|
+
return Qe("THREE.ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking()."), t.colorSpaceToWorking(i, o);
|
|
808
549
|
}
|
|
809
|
-
}, e = [0.64, 0.33, 0.3, 0.6, 0.15, 0.06],
|
|
550
|
+
}, e = [0.64, 0.33, 0.3, 0.6, 0.15, 0.06], n = [0.2126, 0.7152, 0.0722], r = [0.3127, 0.329];
|
|
810
551
|
return t.define({
|
|
811
|
-
[
|
|
552
|
+
[Xe]: {
|
|
812
553
|
primaries: e,
|
|
813
|
-
whitePoint:
|
|
814
|
-
transfer:
|
|
815
|
-
toXYZ:
|
|
816
|
-
fromXYZ:
|
|
817
|
-
luminanceCoefficients:
|
|
818
|
-
workingColorSpaceConfig: { unpackColorSpace:
|
|
819
|
-
outputColorSpaceConfig: { drawingBufferColorSpace:
|
|
554
|
+
whitePoint: r,
|
|
555
|
+
transfer: We,
|
|
556
|
+
toXYZ: Ke,
|
|
557
|
+
fromXYZ: et,
|
|
558
|
+
luminanceCoefficients: n,
|
|
559
|
+
workingColorSpaceConfig: { unpackColorSpace: B },
|
|
560
|
+
outputColorSpaceConfig: { drawingBufferColorSpace: B }
|
|
820
561
|
},
|
|
821
|
-
[
|
|
562
|
+
[B]: {
|
|
822
563
|
primaries: e,
|
|
823
|
-
whitePoint:
|
|
824
|
-
transfer:
|
|
825
|
-
toXYZ:
|
|
826
|
-
fromXYZ:
|
|
827
|
-
luminanceCoefficients:
|
|
828
|
-
outputColorSpaceConfig: { drawingBufferColorSpace:
|
|
564
|
+
whitePoint: r,
|
|
565
|
+
transfer: _e,
|
|
566
|
+
toXYZ: Ke,
|
|
567
|
+
fromXYZ: et,
|
|
568
|
+
luminanceCoefficients: n,
|
|
569
|
+
outputColorSpaceConfig: { drawingBufferColorSpace: B }
|
|
829
570
|
}
|
|
830
571
|
}), t;
|
|
831
572
|
}
|
|
832
|
-
const
|
|
833
|
-
function
|
|
573
|
+
const L = /* @__PURE__ */ Tt();
|
|
574
|
+
function Q(t) {
|
|
834
575
|
return t < 0.04045 ? t * 0.0773993808 : Math.pow(t * 0.9478672986 + 0.0521327014, 2.4);
|
|
835
576
|
}
|
|
836
|
-
function
|
|
577
|
+
function K(t) {
|
|
837
578
|
return t < 31308e-7 ? t * 12.92 : 1.055 * Math.pow(t, 0.41666) - 0.055;
|
|
838
579
|
}
|
|
839
|
-
const
|
|
580
|
+
const pt = {
|
|
840
581
|
aliceblue: 15792383,
|
|
841
582
|
antiquewhite: 16444375,
|
|
842
583
|
aqua: 65535,
|
|
@@ -985,11 +726,11 @@ const _t = {
|
|
|
985
726
|
whitesmoke: 16119285,
|
|
986
727
|
yellow: 16776960,
|
|
987
728
|
yellowgreen: 10145074
|
|
988
|
-
},
|
|
989
|
-
function
|
|
990
|
-
return
|
|
729
|
+
}, G = { h: 0, s: 0, l: 0 }, xe = { h: 0, s: 0, l: 0 };
|
|
730
|
+
function Le(t, e, n) {
|
|
731
|
+
return n < 0 && (n += 1), n > 1 && (n -= 1), n < 1 / 6 ? t + (e - t) * 6 * n : n < 1 / 2 ? e : n < 2 / 3 ? t + (e - t) * 6 * (2 / 3 - n) : t;
|
|
991
732
|
}
|
|
992
|
-
let
|
|
733
|
+
let oe = class {
|
|
993
734
|
/**
|
|
994
735
|
* Constructs a new color.
|
|
995
736
|
*
|
|
@@ -1001,8 +742,8 @@ let ge = class {
|
|
|
1001
742
|
* @param {number} [g] - The green component.
|
|
1002
743
|
* @param {number} [b] - The blue component.
|
|
1003
744
|
*/
|
|
1004
|
-
constructor(e,
|
|
1005
|
-
return this.isColor = !0, this.r = 1, this.g = 1, this.b = 1, this.set(e,
|
|
745
|
+
constructor(e, n, r) {
|
|
746
|
+
return this.isColor = !0, this.r = 1, this.g = 1, this.b = 1, this.set(e, n, r);
|
|
1006
747
|
}
|
|
1007
748
|
/**
|
|
1008
749
|
* Sets the colors's components from the given values.
|
|
@@ -1013,12 +754,12 @@ let ge = class {
|
|
|
1013
754
|
* @param {number} [b] - The blue component.
|
|
1014
755
|
* @return {Color} A reference to this color.
|
|
1015
756
|
*/
|
|
1016
|
-
set(e,
|
|
1017
|
-
if (
|
|
757
|
+
set(e, n, r) {
|
|
758
|
+
if (n === void 0 && r === void 0) {
|
|
1018
759
|
const i = e;
|
|
1019
760
|
i && i.isColor ? this.copy(i) : typeof i == "number" ? this.setHex(i) : typeof i == "string" && this.setStyle(i);
|
|
1020
761
|
} else
|
|
1021
|
-
this.setRGB(e,
|
|
762
|
+
this.setRGB(e, n, r);
|
|
1022
763
|
return this;
|
|
1023
764
|
}
|
|
1024
765
|
/**
|
|
@@ -1037,8 +778,8 @@ let ge = class {
|
|
|
1037
778
|
* @param {string} [colorSpace=SRGBColorSpace] - The color space.
|
|
1038
779
|
* @return {Color} A reference to this color.
|
|
1039
780
|
*/
|
|
1040
|
-
setHex(e,
|
|
1041
|
-
return e = Math.floor(e), this.r = (e >> 16 & 255) / 255, this.g = (e >> 8 & 255) / 255, this.b = (e & 255) / 255,
|
|
781
|
+
setHex(e, n = B) {
|
|
782
|
+
return e = Math.floor(e), this.r = (e >> 16 & 255) / 255, this.g = (e >> 8 & 255) / 255, this.b = (e & 255) / 255, L.colorSpaceToWorking(this, n), this;
|
|
1042
783
|
}
|
|
1043
784
|
/**
|
|
1044
785
|
* Sets this color from RGB values.
|
|
@@ -1049,8 +790,8 @@ let ge = class {
|
|
|
1049
790
|
* @param {string} [colorSpace=ColorManagement.workingColorSpace] - The color space.
|
|
1050
791
|
* @return {Color} A reference to this color.
|
|
1051
792
|
*/
|
|
1052
|
-
setRGB(e,
|
|
1053
|
-
return this.r = e, this.g =
|
|
793
|
+
setRGB(e, n, r, i = L.workingColorSpace) {
|
|
794
|
+
return this.r = e, this.g = n, this.b = r, L.colorSpaceToWorking(this, i), this;
|
|
1054
795
|
}
|
|
1055
796
|
/**
|
|
1056
797
|
* Sets this color from RGB values.
|
|
@@ -1061,14 +802,14 @@ let ge = class {
|
|
|
1061
802
|
* @param {string} [colorSpace=ColorManagement.workingColorSpace] - The color space.
|
|
1062
803
|
* @return {Color} A reference to this color.
|
|
1063
804
|
*/
|
|
1064
|
-
setHSL(e,
|
|
1065
|
-
if (e =
|
|
1066
|
-
this.r = this.g = this.b =
|
|
805
|
+
setHSL(e, n, r, i = L.workingColorSpace) {
|
|
806
|
+
if (e = Dt(e, 1), n = ie(n, 0, 1), r = ie(r, 0, 1), n === 0)
|
|
807
|
+
this.r = this.g = this.b = r;
|
|
1067
808
|
else {
|
|
1068
|
-
const o =
|
|
1069
|
-
this.r =
|
|
809
|
+
const o = r <= 0.5 ? r * (1 + n) : r + n - r * n, s = 2 * r - o;
|
|
810
|
+
this.r = Le(s, o, e + 1 / 3), this.g = Le(s, o, e), this.b = Le(s, o, e - 1 / 3);
|
|
1070
811
|
}
|
|
1071
|
-
return
|
|
812
|
+
return L.colorSpaceToWorking(this, i), this;
|
|
1072
813
|
}
|
|
1073
814
|
/**
|
|
1074
815
|
* Sets this color from a CSS-style string. For example, `rgb(250, 0,0)`,
|
|
@@ -1080,8 +821,8 @@ let ge = class {
|
|
|
1080
821
|
* @param {string} [colorSpace=SRGBColorSpace] - The color space.
|
|
1081
822
|
* @return {Color} A reference to this color.
|
|
1082
823
|
*/
|
|
1083
|
-
setStyle(e,
|
|
1084
|
-
function
|
|
824
|
+
setStyle(e, n = B) {
|
|
825
|
+
function r(o) {
|
|
1085
826
|
o !== void 0 && parseFloat(o) < 1 && console.warn("THREE.Color: Alpha component of " + e + " will be ignored.");
|
|
1086
827
|
}
|
|
1087
828
|
let i;
|
|
@@ -1092,28 +833,28 @@ let ge = class {
|
|
|
1092
833
|
case "rgb":
|
|
1093
834
|
case "rgba":
|
|
1094
835
|
if (o = /^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))
|
|
1095
|
-
return
|
|
836
|
+
return r(o[4]), this.setRGB(
|
|
1096
837
|
Math.min(255, parseInt(o[1], 10)) / 255,
|
|
1097
838
|
Math.min(255, parseInt(o[2], 10)) / 255,
|
|
1098
839
|
Math.min(255, parseInt(o[3], 10)) / 255,
|
|
1099
|
-
|
|
840
|
+
n
|
|
1100
841
|
);
|
|
1101
842
|
if (o = /^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))
|
|
1102
|
-
return
|
|
843
|
+
return r(o[4]), this.setRGB(
|
|
1103
844
|
Math.min(100, parseInt(o[1], 10)) / 100,
|
|
1104
845
|
Math.min(100, parseInt(o[2], 10)) / 100,
|
|
1105
846
|
Math.min(100, parseInt(o[3], 10)) / 100,
|
|
1106
|
-
|
|
847
|
+
n
|
|
1107
848
|
);
|
|
1108
849
|
break;
|
|
1109
850
|
case "hsl":
|
|
1110
851
|
case "hsla":
|
|
1111
852
|
if (o = /^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))
|
|
1112
|
-
return
|
|
853
|
+
return r(o[4]), this.setHSL(
|
|
1113
854
|
parseFloat(o[1]) / 360,
|
|
1114
855
|
parseFloat(o[2]) / 100,
|
|
1115
856
|
parseFloat(o[3]) / 100,
|
|
1116
|
-
|
|
857
|
+
n
|
|
1117
858
|
);
|
|
1118
859
|
break;
|
|
1119
860
|
default:
|
|
@@ -1126,13 +867,13 @@ let ge = class {
|
|
|
1126
867
|
parseInt(o.charAt(0), 16) / 15,
|
|
1127
868
|
parseInt(o.charAt(1), 16) / 15,
|
|
1128
869
|
parseInt(o.charAt(2), 16) / 15,
|
|
1129
|
-
|
|
870
|
+
n
|
|
1130
871
|
);
|
|
1131
872
|
if (s === 6)
|
|
1132
|
-
return this.setHex(parseInt(o, 16),
|
|
873
|
+
return this.setHex(parseInt(o, 16), n);
|
|
1133
874
|
console.warn("THREE.Color: Invalid hex color " + e);
|
|
1134
875
|
} else if (e && e.length > 0)
|
|
1135
|
-
return this.setColorName(e,
|
|
876
|
+
return this.setColorName(e, n);
|
|
1136
877
|
return this;
|
|
1137
878
|
}
|
|
1138
879
|
/**
|
|
@@ -1148,9 +889,9 @@ let ge = class {
|
|
|
1148
889
|
* @param {string} [colorSpace=SRGBColorSpace] - The color space.
|
|
1149
890
|
* @return {Color} A reference to this color.
|
|
1150
891
|
*/
|
|
1151
|
-
setColorName(e,
|
|
1152
|
-
const
|
|
1153
|
-
return
|
|
892
|
+
setColorName(e, n = B) {
|
|
893
|
+
const r = pt[e.toLowerCase()];
|
|
894
|
+
return r !== void 0 ? this.setHex(r, n) : console.warn("THREE.Color: Unknown color " + e), this;
|
|
1154
895
|
}
|
|
1155
896
|
/**
|
|
1156
897
|
* Returns a new color with copied values from this instance.
|
|
@@ -1177,7 +918,7 @@ let ge = class {
|
|
|
1177
918
|
* @return {Color} A reference to this color.
|
|
1178
919
|
*/
|
|
1179
920
|
copySRGBToLinear(e) {
|
|
1180
|
-
return this.r =
|
|
921
|
+
return this.r = Q(e.r), this.g = Q(e.g), this.b = Q(e.b), this;
|
|
1181
922
|
}
|
|
1182
923
|
/**
|
|
1183
924
|
* Copies the given color into this color, and then converts this color from
|
|
@@ -1187,7 +928,7 @@ let ge = class {
|
|
|
1187
928
|
* @return {Color} A reference to this color.
|
|
1188
929
|
*/
|
|
1189
930
|
copyLinearToSRGB(e) {
|
|
1190
|
-
return this.r =
|
|
931
|
+
return this.r = K(e.r), this.g = K(e.g), this.b = K(e.b), this;
|
|
1191
932
|
}
|
|
1192
933
|
/**
|
|
1193
934
|
* Converts this color from `SRGBColorSpace` to `LinearSRGBColorSpace`.
|
|
@@ -1211,8 +952,8 @@ let ge = class {
|
|
|
1211
952
|
* @param {string} [colorSpace=SRGBColorSpace] - The color space.
|
|
1212
953
|
* @return {number} The hexadecimal value.
|
|
1213
954
|
*/
|
|
1214
|
-
getHex(e =
|
|
1215
|
-
return
|
|
955
|
+
getHex(e = B) {
|
|
956
|
+
return L.workingToColorSpace(k.copy(this), e), Math.round(ie(k.r * 255, 0, 255)) * 65536 + Math.round(ie(k.g * 255, 0, 255)) * 256 + Math.round(ie(k.b * 255, 0, 255));
|
|
1216
957
|
}
|
|
1217
958
|
/**
|
|
1218
959
|
* Returns the hexadecimal value of this color as a string (for example, 'FFFFFF').
|
|
@@ -1220,7 +961,7 @@ let ge = class {
|
|
|
1220
961
|
* @param {string} [colorSpace=SRGBColorSpace] - The color space.
|
|
1221
962
|
* @return {string} The hexadecimal value as a string.
|
|
1222
963
|
*/
|
|
1223
|
-
getHexString(e =
|
|
964
|
+
getHexString(e = B) {
|
|
1224
965
|
return ("000000" + this.getHex(e).toString(16)).slice(-6);
|
|
1225
966
|
}
|
|
1226
967
|
/**
|
|
@@ -1231,29 +972,29 @@ let ge = class {
|
|
|
1231
972
|
* @param {string} [colorSpace=ColorManagement.workingColorSpace] - The color space.
|
|
1232
973
|
* @return {{h:number,s:number,l:number}} The HSL representation of this color.
|
|
1233
974
|
*/
|
|
1234
|
-
getHSL(e,
|
|
1235
|
-
|
|
1236
|
-
const
|
|
1237
|
-
let
|
|
975
|
+
getHSL(e, n = L.workingColorSpace) {
|
|
976
|
+
L.workingToColorSpace(k.copy(this), n);
|
|
977
|
+
const r = k.r, i = k.g, o = k.b, s = Math.max(r, i, o), a = Math.min(r, i, o);
|
|
978
|
+
let c, u;
|
|
1238
979
|
const f = (a + s) / 2;
|
|
1239
980
|
if (a === s)
|
|
1240
|
-
|
|
981
|
+
c = 0, u = 0;
|
|
1241
982
|
else {
|
|
1242
|
-
const
|
|
1243
|
-
switch (u = f <= 0.5 ?
|
|
1244
|
-
case
|
|
1245
|
-
|
|
983
|
+
const l = s - a;
|
|
984
|
+
switch (u = f <= 0.5 ? l / (s + a) : l / (2 - s - a), s) {
|
|
985
|
+
case r:
|
|
986
|
+
c = (i - o) / l + (i < o ? 6 : 0);
|
|
1246
987
|
break;
|
|
1247
988
|
case i:
|
|
1248
|
-
|
|
989
|
+
c = (o - r) / l + 2;
|
|
1249
990
|
break;
|
|
1250
991
|
case o:
|
|
1251
|
-
|
|
992
|
+
c = (r - i) / l + 4;
|
|
1252
993
|
break;
|
|
1253
994
|
}
|
|
1254
|
-
|
|
995
|
+
c /= 6;
|
|
1255
996
|
}
|
|
1256
|
-
return e.h =
|
|
997
|
+
return e.h = c, e.s = u, e.l = f, e;
|
|
1257
998
|
}
|
|
1258
999
|
/**
|
|
1259
1000
|
* Returns the RGB values of this color and stores them into the given target object.
|
|
@@ -1262,8 +1003,8 @@ let ge = class {
|
|
|
1262
1003
|
* @param {string} [colorSpace=ColorManagement.workingColorSpace] - The color space.
|
|
1263
1004
|
* @return {Color} The RGB representation of this color.
|
|
1264
1005
|
*/
|
|
1265
|
-
getRGB(e,
|
|
1266
|
-
return
|
|
1006
|
+
getRGB(e, n = L.workingColorSpace) {
|
|
1007
|
+
return L.workingToColorSpace(k.copy(this), n), e.r = k.r, e.g = k.g, e.b = k.b, e;
|
|
1267
1008
|
}
|
|
1268
1009
|
/**
|
|
1269
1010
|
* Returns the value of this color as a CSS style string. Example: `rgb(255,0,0)`.
|
|
@@ -1271,10 +1012,10 @@ let ge = class {
|
|
|
1271
1012
|
* @param {string} [colorSpace=SRGBColorSpace] - The color space.
|
|
1272
1013
|
* @return {string} The CSS representation of this color.
|
|
1273
1014
|
*/
|
|
1274
|
-
getStyle(e =
|
|
1275
|
-
|
|
1276
|
-
const
|
|
1277
|
-
return e !==
|
|
1015
|
+
getStyle(e = B) {
|
|
1016
|
+
L.workingToColorSpace(k.copy(this), e);
|
|
1017
|
+
const n = k.r, r = k.g, i = k.b;
|
|
1018
|
+
return e !== B ? `color(${e} ${n.toFixed(3)} ${r.toFixed(3)} ${i.toFixed(3)})` : `rgb(${Math.round(n * 255)},${Math.round(r * 255)},${Math.round(i * 255)})`;
|
|
1278
1019
|
}
|
|
1279
1020
|
/**
|
|
1280
1021
|
* Adds the given HSL values to this color's values.
|
|
@@ -1286,8 +1027,8 @@ let ge = class {
|
|
|
1286
1027
|
* @param {number} l - Lightness value between `0.0` and `1.0`.
|
|
1287
1028
|
* @return {Color} A reference to this color.
|
|
1288
1029
|
*/
|
|
1289
|
-
offsetHSL(e,
|
|
1290
|
-
return this.getHSL(
|
|
1030
|
+
offsetHSL(e, n, r) {
|
|
1031
|
+
return this.getHSL(G), this.setHSL(G.h + e, G.s + n, G.l + r);
|
|
1291
1032
|
}
|
|
1292
1033
|
/**
|
|
1293
1034
|
* Adds the RGB values of the given color to the RGB values of this color.
|
|
@@ -1305,8 +1046,8 @@ let ge = class {
|
|
|
1305
1046
|
* @param {Color} color2 - The second color.
|
|
1306
1047
|
* @return {Color} A reference to this color.
|
|
1307
1048
|
*/
|
|
1308
|
-
addColors(e,
|
|
1309
|
-
return this.r = e.r +
|
|
1049
|
+
addColors(e, n) {
|
|
1050
|
+
return this.r = e.r + n.r, this.g = e.g + n.g, this.b = e.b + n.b, this;
|
|
1310
1051
|
}
|
|
1311
1052
|
/**
|
|
1312
1053
|
* Adds the given scalar value to the RGB values of this color.
|
|
@@ -1353,8 +1094,8 @@ let ge = class {
|
|
|
1353
1094
|
* @param {number} alpha - The interpolation factor in the closed interval `[0,1]`.
|
|
1354
1095
|
* @return {Color} A reference to this color.
|
|
1355
1096
|
*/
|
|
1356
|
-
lerp(e,
|
|
1357
|
-
return this.r += (e.r - this.r) *
|
|
1097
|
+
lerp(e, n) {
|
|
1098
|
+
return this.r += (e.r - this.r) * n, this.g += (e.g - this.g) * n, this.b += (e.b - this.b) * n, this;
|
|
1358
1099
|
}
|
|
1359
1100
|
/**
|
|
1360
1101
|
* Linearly interpolates between the given colors and stores the result in this instance.
|
|
@@ -1366,8 +1107,8 @@ let ge = class {
|
|
|
1366
1107
|
* @param {number} alpha - The interpolation factor in the closed interval `[0,1]`.
|
|
1367
1108
|
* @return {Color} A reference to this color.
|
|
1368
1109
|
*/
|
|
1369
|
-
lerpColors(e,
|
|
1370
|
-
return this.r = e.r + (
|
|
1110
|
+
lerpColors(e, n, r) {
|
|
1111
|
+
return this.r = e.r + (n.r - e.r) * r, this.g = e.g + (n.g - e.g) * r, this.b = e.b + (n.b - e.b) * r, this;
|
|
1371
1112
|
}
|
|
1372
1113
|
/**
|
|
1373
1114
|
* Linearly interpolates this color's HSL values toward the HSL values of the
|
|
@@ -1380,10 +1121,10 @@ let ge = class {
|
|
|
1380
1121
|
* @param {number} alpha - The interpolation factor in the closed interval `[0,1]`.
|
|
1381
1122
|
* @return {Color} A reference to this color.
|
|
1382
1123
|
*/
|
|
1383
|
-
lerpHSL(e,
|
|
1384
|
-
this.getHSL(
|
|
1385
|
-
const
|
|
1386
|
-
return this.setHSL(
|
|
1124
|
+
lerpHSL(e, n) {
|
|
1125
|
+
this.getHSL(G), e.getHSL(xe);
|
|
1126
|
+
const r = Se(G.h, xe.h, n), i = Se(G.s, xe.s, n), o = Se(G.l, xe.l, n);
|
|
1127
|
+
return this.setHSL(r, i, o), this;
|
|
1387
1128
|
}
|
|
1388
1129
|
/**
|
|
1389
1130
|
* Sets the color's RGB components from the given 3D vector.
|
|
@@ -1401,8 +1142,8 @@ let ge = class {
|
|
|
1401
1142
|
* @return {Color} A reference to this color.
|
|
1402
1143
|
*/
|
|
1403
1144
|
applyMatrix3(e) {
|
|
1404
|
-
const
|
|
1405
|
-
return this.r = o[0] *
|
|
1145
|
+
const n = this.r, r = this.g, i = this.b, o = e.elements;
|
|
1146
|
+
return this.r = o[0] * n + o[3] * r + o[6] * i, this.g = o[1] * n + o[4] * r + o[7] * i, this.b = o[2] * n + o[5] * r + o[8] * i, this;
|
|
1406
1147
|
}
|
|
1407
1148
|
/**
|
|
1408
1149
|
* Returns `true` if this color is equal with the given one.
|
|
@@ -1420,8 +1161,8 @@ let ge = class {
|
|
|
1420
1161
|
* @param {number} [offset=0] - The offset into the array.
|
|
1421
1162
|
* @return {Color} A reference to this color.
|
|
1422
1163
|
*/
|
|
1423
|
-
fromArray(e,
|
|
1424
|
-
return this.r = e[
|
|
1164
|
+
fromArray(e, n = 0) {
|
|
1165
|
+
return this.r = e[n], this.g = e[n + 1], this.b = e[n + 2], this;
|
|
1425
1166
|
}
|
|
1426
1167
|
/**
|
|
1427
1168
|
* Writes the RGB components of this color to the given array. If no array is provided,
|
|
@@ -1431,8 +1172,8 @@ let ge = class {
|
|
|
1431
1172
|
* @param {number} [offset=0] - Index of the first element in the array.
|
|
1432
1173
|
* @return {Array<number>} The color components.
|
|
1433
1174
|
*/
|
|
1434
|
-
toArray(e = [],
|
|
1435
|
-
return e[
|
|
1175
|
+
toArray(e = [], n = 0) {
|
|
1176
|
+
return e[n] = this.r, e[n + 1] = this.g, e[n + 2] = this.b, e;
|
|
1436
1177
|
}
|
|
1437
1178
|
/**
|
|
1438
1179
|
* Sets the components of this color from the given buffer attribute.
|
|
@@ -1441,8 +1182,8 @@ let ge = class {
|
|
|
1441
1182
|
* @param {number} index - The index into the attribute.
|
|
1442
1183
|
* @return {Color} A reference to this color.
|
|
1443
1184
|
*/
|
|
1444
|
-
fromBufferAttribute(e,
|
|
1445
|
-
return this.r = e.getX(
|
|
1185
|
+
fromBufferAttribute(e, n) {
|
|
1186
|
+
return this.r = e.getX(n), this.g = e.getY(n), this.b = e.getZ(n), this;
|
|
1446
1187
|
}
|
|
1447
1188
|
/**
|
|
1448
1189
|
* This methods defines the serialization result of this class. Returns the color
|
|
@@ -1457,27 +1198,27 @@ let ge = class {
|
|
|
1457
1198
|
yield this.r, yield this.g, yield this.b;
|
|
1458
1199
|
}
|
|
1459
1200
|
};
|
|
1460
|
-
const
|
|
1461
|
-
|
|
1201
|
+
const k = /* @__PURE__ */ new oe();
|
|
1202
|
+
oe.NAMES = pt;
|
|
1462
1203
|
typeof __THREE_DEVTOOLS__ < "u" && __THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register", { detail: {
|
|
1463
|
-
revision:
|
|
1204
|
+
revision: xt
|
|
1464
1205
|
} }));
|
|
1465
|
-
typeof window < "u" && (window.__THREE__ ? console.warn("WARNING: Multiple instances of Three.js being imported.") : window.__THREE__ =
|
|
1466
|
-
const
|
|
1206
|
+
typeof window < "u" && (window.__THREE__ ? console.warn("WARNING: Multiple instances of Three.js being imported.") : window.__THREE__ = xt);
|
|
1207
|
+
const It = "https://raw.githubusercontent.com/nvkelso/natural-earth-vector/master/geojson/ne_110m_admin_0_countries.geojson", Ht = "https://cdn.jsdelivr.net/npm/world-atlas@2/countries-110m.json", Ot = "https://raw.githubusercontent.com/nvkelso/natural-earth-vector/master/geojson/ne_10m_admin_1_states_provinces.geojson", Pt = "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>", jt = {
|
|
1467
1208
|
minColor: "#f8fafc",
|
|
1468
1209
|
maxColor: "#e5e7eb"
|
|
1469
1210
|
};
|
|
1470
|
-
function
|
|
1471
|
-
t.prototype = e.prototype =
|
|
1211
|
+
function je(t, e, n) {
|
|
1212
|
+
t.prototype = e.prototype = n, n.constructor = t;
|
|
1472
1213
|
}
|
|
1473
|
-
function
|
|
1474
|
-
var
|
|
1475
|
-
for (var
|
|
1476
|
-
return
|
|
1214
|
+
function bt(t, e) {
|
|
1215
|
+
var n = Object.create(t.prototype);
|
|
1216
|
+
for (var r in e) n[r] = e[r];
|
|
1217
|
+
return n;
|
|
1477
1218
|
}
|
|
1478
|
-
function
|
|
1219
|
+
function fe() {
|
|
1479
1220
|
}
|
|
1480
|
-
var
|
|
1221
|
+
var se = 0.7, Fe = 1 / se, ee = "\\s*([+-]?\\d+)\\s*", ae = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*", H = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*", Gt = /^#([0-9a-f]{3,8})$/, qt = new RegExp(`^rgb\\(${ee},${ee},${ee}\\)$`), zt = new RegExp(`^rgb\\(${H},${H},${H}\\)$`), Ut = new RegExp(`^rgba\\(${ee},${ee},${ee},${ae}\\)$`), Vt = new RegExp(`^rgba\\(${H},${H},${H},${ae}\\)$`), Zt = new RegExp(`^hsl\\(${ae},${H},${H}\\)$`), Yt = new RegExp(`^hsla\\(${ae},${H},${H},${ae}\\)$`), tt = {
|
|
1481
1222
|
aliceblue: 15792383,
|
|
1482
1223
|
antiquewhite: 16444375,
|
|
1483
1224
|
aqua: 65535,
|
|
@@ -1627,318 +1368,318 @@ var me = 0.7, Re = 1 / me, ce = "\\s*([+-]?\\d+)\\s*", xe = "\\s*([+-]?(?:\\d*\\
|
|
|
1627
1368
|
yellow: 16776960,
|
|
1628
1369
|
yellowgreen: 10145074
|
|
1629
1370
|
};
|
|
1630
|
-
|
|
1371
|
+
je(fe, ue, {
|
|
1631
1372
|
copy(t) {
|
|
1632
1373
|
return Object.assign(new this.constructor(), this, t);
|
|
1633
1374
|
},
|
|
1634
1375
|
displayable() {
|
|
1635
1376
|
return this.rgb().displayable();
|
|
1636
1377
|
},
|
|
1637
|
-
hex:
|
|
1378
|
+
hex: nt,
|
|
1638
1379
|
// Deprecated! Use color.formatHex.
|
|
1639
|
-
formatHex:
|
|
1640
|
-
formatHex8:
|
|
1641
|
-
formatHsl:
|
|
1642
|
-
formatRgb:
|
|
1643
|
-
toString:
|
|
1380
|
+
formatHex: nt,
|
|
1381
|
+
formatHex8: Xt,
|
|
1382
|
+
formatHsl: Wt,
|
|
1383
|
+
formatRgb: rt,
|
|
1384
|
+
toString: rt
|
|
1644
1385
|
});
|
|
1645
|
-
function
|
|
1386
|
+
function nt() {
|
|
1646
1387
|
return this.rgb().formatHex();
|
|
1647
1388
|
}
|
|
1648
|
-
function
|
|
1389
|
+
function Xt() {
|
|
1649
1390
|
return this.rgb().formatHex8();
|
|
1650
1391
|
}
|
|
1651
|
-
function
|
|
1652
|
-
return
|
|
1392
|
+
function Wt() {
|
|
1393
|
+
return wt(this).formatHsl();
|
|
1653
1394
|
}
|
|
1654
|
-
function
|
|
1395
|
+
function rt() {
|
|
1655
1396
|
return this.rgb().formatRgb();
|
|
1656
1397
|
}
|
|
1657
|
-
function
|
|
1658
|
-
var e,
|
|
1659
|
-
return t = (t + "").trim().toLowerCase(), (e =
|
|
1398
|
+
function ue(t) {
|
|
1399
|
+
var e, n;
|
|
1400
|
+
return t = (t + "").trim().toLowerCase(), (e = Gt.exec(t)) ? (n = e[1].length, e = parseInt(e[1], 16), n === 6 ? it(e) : n === 3 ? new A(e >> 8 & 15 | e >> 4 & 240, e >> 4 & 15 | e & 240, (e & 15) << 4 | e & 15, 1) : n === 8 ? pe(e >> 24 & 255, e >> 16 & 255, e >> 8 & 255, (e & 255) / 255) : n === 4 ? pe(e >> 12 & 15 | e >> 8 & 240, e >> 8 & 15 | e >> 4 & 240, e >> 4 & 15 | e & 240, ((e & 15) << 4 | e & 15) / 255) : null) : (e = qt.exec(t)) ? new A(e[1], e[2], e[3], 1) : (e = zt.exec(t)) ? new A(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, 1) : (e = Ut.exec(t)) ? pe(e[1], e[2], e[3], e[4]) : (e = Vt.exec(t)) ? pe(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, e[4]) : (e = Zt.exec(t)) ? at(e[1], e[2] / 100, e[3] / 100, 1) : (e = Yt.exec(t)) ? at(e[1], e[2] / 100, e[3] / 100, e[4]) : tt.hasOwnProperty(t) ? it(tt[t]) : t === "transparent" ? new A(NaN, NaN, NaN, 0) : null;
|
|
1660
1401
|
}
|
|
1661
|
-
function
|
|
1662
|
-
return new
|
|
1402
|
+
function it(t) {
|
|
1403
|
+
return new A(t >> 16 & 255, t >> 8 & 255, t & 255, 1);
|
|
1663
1404
|
}
|
|
1664
|
-
function
|
|
1665
|
-
return
|
|
1405
|
+
function pe(t, e, n, r) {
|
|
1406
|
+
return r <= 0 && (t = e = n = NaN), new A(t, e, n, r);
|
|
1666
1407
|
}
|
|
1667
|
-
function
|
|
1668
|
-
return t instanceof
|
|
1408
|
+
function Jt(t) {
|
|
1409
|
+
return t instanceof fe || (t = ue(t)), t ? (t = t.rgb(), new A(t.r, t.g, t.b, t.opacity)) : new A();
|
|
1669
1410
|
}
|
|
1670
|
-
function
|
|
1671
|
-
return arguments.length === 1 ?
|
|
1411
|
+
function Te(t, e, n, r) {
|
|
1412
|
+
return arguments.length === 1 ? Jt(t) : new A(t, e, n, r ?? 1);
|
|
1672
1413
|
}
|
|
1673
|
-
function
|
|
1674
|
-
this.r = +t, this.g = +e, this.b = +
|
|
1414
|
+
function A(t, e, n, r) {
|
|
1415
|
+
this.r = +t, this.g = +e, this.b = +n, this.opacity = +r;
|
|
1675
1416
|
}
|
|
1676
|
-
|
|
1417
|
+
je(A, Te, bt(fe, {
|
|
1677
1418
|
brighter(t) {
|
|
1678
|
-
return t = t == null ?
|
|
1419
|
+
return t = t == null ? Fe : Math.pow(Fe, t), new A(this.r * t, this.g * t, this.b * t, this.opacity);
|
|
1679
1420
|
},
|
|
1680
1421
|
darker(t) {
|
|
1681
|
-
return t = t == null ?
|
|
1422
|
+
return t = t == null ? se : Math.pow(se, t), new A(this.r * t, this.g * t, this.b * t, this.opacity);
|
|
1682
1423
|
},
|
|
1683
1424
|
rgb() {
|
|
1684
1425
|
return this;
|
|
1685
1426
|
},
|
|
1686
1427
|
clamp() {
|
|
1687
|
-
return new
|
|
1428
|
+
return new A(Y(this.r), Y(this.g), Y(this.b), Ce(this.opacity));
|
|
1688
1429
|
},
|
|
1689
1430
|
displayable() {
|
|
1690
1431
|
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;
|
|
1691
1432
|
},
|
|
1692
|
-
hex:
|
|
1433
|
+
hex: ot,
|
|
1693
1434
|
// Deprecated! Use color.formatHex.
|
|
1694
|
-
formatHex:
|
|
1695
|
-
formatHex8:
|
|
1696
|
-
formatRgb:
|
|
1697
|
-
toString:
|
|
1435
|
+
formatHex: ot,
|
|
1436
|
+
formatHex8: Qt,
|
|
1437
|
+
formatRgb: st,
|
|
1438
|
+
toString: st
|
|
1698
1439
|
}));
|
|
1699
|
-
function
|
|
1700
|
-
return `#${
|
|
1440
|
+
function ot() {
|
|
1441
|
+
return `#${Z(this.r)}${Z(this.g)}${Z(this.b)}`;
|
|
1701
1442
|
}
|
|
1702
|
-
function
|
|
1703
|
-
return `#${
|
|
1443
|
+
function Qt() {
|
|
1444
|
+
return `#${Z(this.r)}${Z(this.g)}${Z(this.b)}${Z((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`;
|
|
1704
1445
|
}
|
|
1705
|
-
function
|
|
1706
|
-
const t =
|
|
1707
|
-
return `${t === 1 ? "rgb(" : "rgba("}${
|
|
1446
|
+
function st() {
|
|
1447
|
+
const t = Ce(this.opacity);
|
|
1448
|
+
return `${t === 1 ? "rgb(" : "rgba("}${Y(this.r)}, ${Y(this.g)}, ${Y(this.b)}${t === 1 ? ")" : `, ${t})`}`;
|
|
1708
1449
|
}
|
|
1709
|
-
function
|
|
1450
|
+
function Ce(t) {
|
|
1710
1451
|
return isNaN(t) ? 1 : Math.max(0, Math.min(1, t));
|
|
1711
1452
|
}
|
|
1712
|
-
function
|
|
1453
|
+
function Y(t) {
|
|
1713
1454
|
return Math.max(0, Math.min(255, Math.round(t) || 0));
|
|
1714
1455
|
}
|
|
1715
|
-
function
|
|
1716
|
-
return t =
|
|
1456
|
+
function Z(t) {
|
|
1457
|
+
return t = Y(t), (t < 16 ? "0" : "") + t.toString(16);
|
|
1717
1458
|
}
|
|
1718
|
-
function
|
|
1719
|
-
return
|
|
1459
|
+
function at(t, e, n, r) {
|
|
1460
|
+
return r <= 0 ? t = e = n = NaN : n <= 0 || n >= 1 ? t = e = NaN : e <= 0 && (t = NaN), new $(t, e, n, r);
|
|
1720
1461
|
}
|
|
1721
|
-
function
|
|
1722
|
-
if (t instanceof
|
|
1723
|
-
if (t instanceof
|
|
1724
|
-
if (t instanceof
|
|
1462
|
+
function wt(t) {
|
|
1463
|
+
if (t instanceof $) return new $(t.h, t.s, t.l, t.opacity);
|
|
1464
|
+
if (t instanceof fe || (t = ue(t)), !t) return new $();
|
|
1465
|
+
if (t instanceof $) return t;
|
|
1725
1466
|
t = t.rgb();
|
|
1726
|
-
var e = t.r / 255,
|
|
1727
|
-
return a ? (e === o ? s = (
|
|
1467
|
+
var e = t.r / 255, n = t.g / 255, r = t.b / 255, i = Math.min(e, n, r), o = Math.max(e, n, r), s = NaN, a = o - i, c = (o + i) / 2;
|
|
1468
|
+
return a ? (e === o ? s = (n - r) / a + (n < r) * 6 : n === o ? s = (r - e) / a + 2 : s = (e - n) / a + 4, a /= c < 0.5 ? o + i : 2 - o - i, s *= 60) : a = c > 0 && c < 1 ? 0 : s, new $(s, a, c, t.opacity);
|
|
1728
1469
|
}
|
|
1729
|
-
function
|
|
1730
|
-
return arguments.length === 1 ?
|
|
1470
|
+
function Kt(t, e, n, r) {
|
|
1471
|
+
return arguments.length === 1 ? wt(t) : new $(t, e, n, r ?? 1);
|
|
1731
1472
|
}
|
|
1732
|
-
function
|
|
1733
|
-
this.h = +t, this.s = +e, this.l = +
|
|
1473
|
+
function $(t, e, n, r) {
|
|
1474
|
+
this.h = +t, this.s = +e, this.l = +n, this.opacity = +r;
|
|
1734
1475
|
}
|
|
1735
|
-
|
|
1476
|
+
je($, Kt, bt(fe, {
|
|
1736
1477
|
brighter(t) {
|
|
1737
|
-
return t = t == null ?
|
|
1478
|
+
return t = t == null ? Fe : Math.pow(Fe, t), new $(this.h, this.s, this.l * t, this.opacity);
|
|
1738
1479
|
},
|
|
1739
1480
|
darker(t) {
|
|
1740
|
-
return t = t == null ?
|
|
1481
|
+
return t = t == null ? se : Math.pow(se, t), new $(this.h, this.s, this.l * t, this.opacity);
|
|
1741
1482
|
},
|
|
1742
1483
|
rgb() {
|
|
1743
|
-
var t = this.h % 360 + (this.h < 0) * 360, e = isNaN(t) || isNaN(this.s) ? 0 : this.s,
|
|
1744
|
-
return new
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1484
|
+
var t = this.h % 360 + (this.h < 0) * 360, e = isNaN(t) || isNaN(this.s) ? 0 : this.s, n = this.l, r = n + (n < 0.5 ? n : 1 - n) * e, i = 2 * n - r;
|
|
1485
|
+
return new A(
|
|
1486
|
+
Be(t >= 240 ? t - 240 : t + 120, i, r),
|
|
1487
|
+
Be(t, i, r),
|
|
1488
|
+
Be(t < 120 ? t + 240 : t - 120, i, r),
|
|
1748
1489
|
this.opacity
|
|
1749
1490
|
);
|
|
1750
1491
|
},
|
|
1751
1492
|
clamp() {
|
|
1752
|
-
return new
|
|
1493
|
+
return new $(ut(this.h), be(this.s), be(this.l), Ce(this.opacity));
|
|
1753
1494
|
},
|
|
1754
1495
|
displayable() {
|
|
1755
1496
|
return (0 <= this.s && this.s <= 1 || isNaN(this.s)) && 0 <= this.l && this.l <= 1 && 0 <= this.opacity && this.opacity <= 1;
|
|
1756
1497
|
},
|
|
1757
1498
|
formatHsl() {
|
|
1758
|
-
const t =
|
|
1759
|
-
return `${t === 1 ? "hsl(" : "hsla("}${
|
|
1499
|
+
const t = Ce(this.opacity);
|
|
1500
|
+
return `${t === 1 ? "hsl(" : "hsla("}${ut(this.h)}, ${be(this.s) * 100}%, ${be(this.l) * 100}%${t === 1 ? ")" : `, ${t})`}`;
|
|
1760
1501
|
}
|
|
1761
1502
|
}));
|
|
1762
|
-
function
|
|
1503
|
+
function ut(t) {
|
|
1763
1504
|
return t = (t || 0) % 360, t < 0 ? t + 360 : t;
|
|
1764
1505
|
}
|
|
1765
|
-
function
|
|
1506
|
+
function be(t) {
|
|
1766
1507
|
return Math.max(0, Math.min(1, t || 0));
|
|
1767
1508
|
}
|
|
1768
|
-
function
|
|
1769
|
-
return (t < 60 ? e + (
|
|
1509
|
+
function Be(t, e, n) {
|
|
1510
|
+
return (t < 60 ? e + (n - e) * t / 60 : t < 180 ? n : t < 240 ? e + (n - e) * (240 - t) / 60 : e) * 255;
|
|
1770
1511
|
}
|
|
1771
|
-
const
|
|
1772
|
-
function
|
|
1773
|
-
return function(
|
|
1774
|
-
return t +
|
|
1512
|
+
const Ge = (t) => () => t;
|
|
1513
|
+
function en(t, e) {
|
|
1514
|
+
return function(n) {
|
|
1515
|
+
return t + n * e;
|
|
1775
1516
|
};
|
|
1776
1517
|
}
|
|
1777
|
-
function
|
|
1778
|
-
return t = Math.pow(t,
|
|
1779
|
-
return Math.pow(t +
|
|
1518
|
+
function tn(t, e, n) {
|
|
1519
|
+
return t = Math.pow(t, n), e = Math.pow(e, n) - t, n = 1 / n, function(r) {
|
|
1520
|
+
return Math.pow(t + r * e, n);
|
|
1780
1521
|
};
|
|
1781
1522
|
}
|
|
1782
|
-
function
|
|
1783
|
-
return (t = +t) == 1 ?
|
|
1784
|
-
return
|
|
1523
|
+
function nn(t) {
|
|
1524
|
+
return (t = +t) == 1 ? yt : function(e, n) {
|
|
1525
|
+
return n - e ? tn(e, n, t) : Ge(isNaN(e) ? n : e);
|
|
1785
1526
|
};
|
|
1786
1527
|
}
|
|
1787
|
-
function
|
|
1788
|
-
var
|
|
1789
|
-
return
|
|
1528
|
+
function yt(t, e) {
|
|
1529
|
+
var n = e - t;
|
|
1530
|
+
return n ? en(t, n) : Ge(isNaN(t) ? e : t);
|
|
1790
1531
|
}
|
|
1791
|
-
const
|
|
1792
|
-
var
|
|
1793
|
-
function
|
|
1794
|
-
var s =
|
|
1532
|
+
const Ie = (function t(e) {
|
|
1533
|
+
var n = nn(e);
|
|
1534
|
+
function r(i, o) {
|
|
1535
|
+
var s = n((i = Te(i)).r, (o = Te(o)).r), a = n(i.g, o.g), c = n(i.b, o.b), u = yt(i.opacity, o.opacity);
|
|
1795
1536
|
return function(f) {
|
|
1796
|
-
return i.r = s(f), i.g = a(f), i.b =
|
|
1537
|
+
return i.r = s(f), i.g = a(f), i.b = c(f), i.opacity = u(f), i + "";
|
|
1797
1538
|
};
|
|
1798
1539
|
}
|
|
1799
|
-
return
|
|
1540
|
+
return r.gamma = t, r;
|
|
1800
1541
|
})(1);
|
|
1801
|
-
function
|
|
1542
|
+
function rn(t, e) {
|
|
1802
1543
|
e || (e = []);
|
|
1803
|
-
var
|
|
1544
|
+
var n = t ? Math.min(e.length, t.length) : 0, r = e.slice(), i;
|
|
1804
1545
|
return function(o) {
|
|
1805
|
-
for (i = 0; i <
|
|
1806
|
-
return
|
|
1546
|
+
for (i = 0; i < n; ++i) r[i] = t[i] * (1 - o) + e[i] * o;
|
|
1547
|
+
return r;
|
|
1807
1548
|
};
|
|
1808
1549
|
}
|
|
1809
|
-
function
|
|
1550
|
+
function on(t) {
|
|
1810
1551
|
return ArrayBuffer.isView(t) && !(t instanceof DataView);
|
|
1811
1552
|
}
|
|
1812
|
-
function
|
|
1813
|
-
var
|
|
1814
|
-
for (s = 0; s <
|
|
1815
|
-
for (; s <
|
|
1553
|
+
function sn(t, e) {
|
|
1554
|
+
var n = e ? e.length : 0, r = t ? Math.min(n, t.length) : 0, i = new Array(r), o = new Array(n), s;
|
|
1555
|
+
for (s = 0; s < r; ++s) i[s] = qe(t[s], e[s]);
|
|
1556
|
+
for (; s < n; ++s) o[s] = e[s];
|
|
1816
1557
|
return function(a) {
|
|
1817
|
-
for (s = 0; s <
|
|
1558
|
+
for (s = 0; s < r; ++s) o[s] = i[s](a);
|
|
1818
1559
|
return o;
|
|
1819
1560
|
};
|
|
1820
1561
|
}
|
|
1821
|
-
function
|
|
1822
|
-
var
|
|
1823
|
-
return t = +t, e = +e, function(
|
|
1824
|
-
return
|
|
1562
|
+
function an(t, e) {
|
|
1563
|
+
var n = /* @__PURE__ */ new Date();
|
|
1564
|
+
return t = +t, e = +e, function(r) {
|
|
1565
|
+
return n.setTime(t * (1 - r) + e * r), n;
|
|
1825
1566
|
};
|
|
1826
1567
|
}
|
|
1827
|
-
function
|
|
1828
|
-
return t = +t, e = +e, function(
|
|
1829
|
-
return t * (1 -
|
|
1568
|
+
function Me(t, e) {
|
|
1569
|
+
return t = +t, e = +e, function(n) {
|
|
1570
|
+
return t * (1 - n) + e * n;
|
|
1830
1571
|
};
|
|
1831
1572
|
}
|
|
1832
|
-
function
|
|
1833
|
-
var
|
|
1573
|
+
function un(t, e) {
|
|
1574
|
+
var n = {}, r = {}, i;
|
|
1834
1575
|
(t === null || typeof t != "object") && (t = {}), (e === null || typeof e != "object") && (e = {});
|
|
1835
1576
|
for (i in e)
|
|
1836
|
-
i in t ?
|
|
1577
|
+
i in t ? n[i] = qe(t[i], e[i]) : r[i] = e[i];
|
|
1837
1578
|
return function(o) {
|
|
1838
|
-
for (i in
|
|
1839
|
-
return
|
|
1579
|
+
for (i in n) r[i] = n[i](o);
|
|
1580
|
+
return r;
|
|
1840
1581
|
};
|
|
1841
1582
|
}
|
|
1842
|
-
var
|
|
1843
|
-
function
|
|
1583
|
+
var He = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, $e = new RegExp(He.source, "g");
|
|
1584
|
+
function cn(t) {
|
|
1844
1585
|
return function() {
|
|
1845
1586
|
return t;
|
|
1846
1587
|
};
|
|
1847
1588
|
}
|
|
1848
|
-
function
|
|
1589
|
+
function fn(t) {
|
|
1849
1590
|
return function(e) {
|
|
1850
1591
|
return t(e) + "";
|
|
1851
1592
|
};
|
|
1852
1593
|
}
|
|
1853
|
-
function
|
|
1854
|
-
var
|
|
1855
|
-
for (t = t + "", e = e + ""; (
|
|
1856
|
-
(o = i.index) >
|
|
1857
|
-
return
|
|
1858
|
-
for (var f = 0,
|
|
1594
|
+
function ln(t, e) {
|
|
1595
|
+
var n = He.lastIndex = $e.lastIndex = 0, r, i, o, s = -1, a = [], c = [];
|
|
1596
|
+
for (t = t + "", e = e + ""; (r = He.exec(t)) && (i = $e.exec(e)); )
|
|
1597
|
+
(o = i.index) > n && (o = e.slice(n, 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, c.push({ i: s, x: Me(r, i) })), n = $e.lastIndex;
|
|
1598
|
+
return n < e.length && (o = e.slice(n), a[s] ? a[s] += o : a[++s] = o), a.length < 2 ? c[0] ? fn(c[0].x) : cn(e) : (e = c.length, function(u) {
|
|
1599
|
+
for (var f = 0, l; f < e; ++f) a[(l = c[f]).i] = l.x(u);
|
|
1859
1600
|
return a.join("");
|
|
1860
1601
|
});
|
|
1861
1602
|
}
|
|
1862
|
-
function
|
|
1863
|
-
var
|
|
1864
|
-
return e == null ||
|
|
1603
|
+
function qe(t, e) {
|
|
1604
|
+
var n = typeof e, r;
|
|
1605
|
+
return e == null || n === "boolean" ? Ge(e) : (n === "number" ? Me : n === "string" ? (r = ue(e)) ? (e = r, Ie) : ln : e instanceof ue ? Ie : e instanceof Date ? an : on(e) ? rn : Array.isArray(e) ? sn : typeof e.valueOf != "function" && typeof e.toString != "function" || isNaN(e) ? un : Me)(t, e);
|
|
1865
1606
|
}
|
|
1866
|
-
function
|
|
1867
|
-
return t = +t, e = +e, function(
|
|
1868
|
-
return Math.round(t * (1 -
|
|
1607
|
+
function hn(t, e) {
|
|
1608
|
+
return t = +t, e = +e, function(n) {
|
|
1609
|
+
return Math.round(t * (1 - n) + e * n);
|
|
1869
1610
|
};
|
|
1870
1611
|
}
|
|
1871
|
-
function
|
|
1612
|
+
function ye(t, e) {
|
|
1872
1613
|
return t == null || e == null ? NaN : t < e ? -1 : t > e ? 1 : t >= e ? 0 : NaN;
|
|
1873
1614
|
}
|
|
1874
|
-
function
|
|
1615
|
+
function gn(t, e) {
|
|
1875
1616
|
return t == null || e == null ? NaN : e < t ? -1 : e > t ? 1 : e >= t ? 0 : NaN;
|
|
1876
1617
|
}
|
|
1877
|
-
function
|
|
1878
|
-
let e,
|
|
1879
|
-
t.length !== 2 ? (e =
|
|
1880
|
-
function i(a,
|
|
1618
|
+
function Ft(t) {
|
|
1619
|
+
let e, n, r;
|
|
1620
|
+
t.length !== 2 ? (e = ye, n = (a, c) => ye(t(a), c), r = (a, c) => t(a) - c) : (e = t === ye || t === gn ? t : dn, n = t, r = t);
|
|
1621
|
+
function i(a, c, u = 0, f = a.length) {
|
|
1881
1622
|
if (u < f) {
|
|
1882
|
-
if (e(
|
|
1623
|
+
if (e(c, c) !== 0) return f;
|
|
1883
1624
|
do {
|
|
1884
|
-
const
|
|
1885
|
-
|
|
1625
|
+
const l = u + f >>> 1;
|
|
1626
|
+
n(a[l], c) < 0 ? u = l + 1 : f = l;
|
|
1886
1627
|
} while (u < f);
|
|
1887
1628
|
}
|
|
1888
1629
|
return u;
|
|
1889
1630
|
}
|
|
1890
|
-
function o(a,
|
|
1631
|
+
function o(a, c, u = 0, f = a.length) {
|
|
1891
1632
|
if (u < f) {
|
|
1892
|
-
if (e(
|
|
1633
|
+
if (e(c, c) !== 0) return f;
|
|
1893
1634
|
do {
|
|
1894
|
-
const
|
|
1895
|
-
|
|
1635
|
+
const l = u + f >>> 1;
|
|
1636
|
+
n(a[l], c) <= 0 ? u = l + 1 : f = l;
|
|
1896
1637
|
} while (u < f);
|
|
1897
1638
|
}
|
|
1898
1639
|
return u;
|
|
1899
1640
|
}
|
|
1900
|
-
function s(a,
|
|
1901
|
-
const
|
|
1902
|
-
return
|
|
1641
|
+
function s(a, c, u = 0, f = a.length) {
|
|
1642
|
+
const l = i(a, c, u, f - 1);
|
|
1643
|
+
return l > u && r(a[l - 1], c) > -r(a[l], c) ? l - 1 : l;
|
|
1903
1644
|
}
|
|
1904
1645
|
return { left: i, center: s, right: o };
|
|
1905
1646
|
}
|
|
1906
|
-
function
|
|
1647
|
+
function dn() {
|
|
1907
1648
|
return 0;
|
|
1908
1649
|
}
|
|
1909
|
-
function
|
|
1650
|
+
function mn(t) {
|
|
1910
1651
|
return t === null ? NaN : +t;
|
|
1911
1652
|
}
|
|
1912
|
-
const
|
|
1913
|
-
|
|
1914
|
-
const
|
|
1915
|
-
function
|
|
1916
|
-
const
|
|
1917
|
-
let a,
|
|
1918
|
-
return i < 0 ? (u = Math.pow(10, -i) / s, a = Math.round(t * u),
|
|
1653
|
+
const xn = Ft(ye), pn = xn.right;
|
|
1654
|
+
Ft(mn).center;
|
|
1655
|
+
const bn = Math.sqrt(50), wn = Math.sqrt(10), yn = Math.sqrt(2);
|
|
1656
|
+
function ke(t, e, n) {
|
|
1657
|
+
const r = (e - t) / Math.max(0, n), i = Math.floor(Math.log10(r)), o = r / Math.pow(10, i), s = o >= bn ? 10 : o >= wn ? 5 : o >= yn ? 2 : 1;
|
|
1658
|
+
let a, c, u;
|
|
1659
|
+
return i < 0 ? (u = Math.pow(10, -i) / s, a = Math.round(t * u), c = Math.round(e * u), a / u < t && ++a, c / u > e && --c, u = -u) : (u = Math.pow(10, i) * s, a = Math.round(t / u), c = Math.round(e / u), a * u < t && ++a, c * u > e && --c), c < a && 0.5 <= n && n < 2 ? ke(t, e, n * 2) : [a, c, u];
|
|
1919
1660
|
}
|
|
1920
|
-
function
|
|
1921
|
-
if (e = +e, t = +t,
|
|
1661
|
+
function Fn(t, e, n) {
|
|
1662
|
+
if (e = +e, t = +t, n = +n, !(n > 0)) return [];
|
|
1922
1663
|
if (t === e) return [t];
|
|
1923
|
-
const
|
|
1664
|
+
const r = e < t, [i, o, s] = r ? ke(e, t, n) : ke(t, e, n);
|
|
1924
1665
|
if (!(o >= i)) return [];
|
|
1925
|
-
const a = o - i + 1,
|
|
1926
|
-
if (
|
|
1927
|
-
if (s < 0) for (let u = 0; u < a; ++u)
|
|
1928
|
-
else for (let u = 0; u < a; ++u)
|
|
1929
|
-
else if (s < 0) for (let u = 0; u < a; ++u)
|
|
1930
|
-
else for (let u = 0; u < a; ++u)
|
|
1931
|
-
return
|
|
1932
|
-
}
|
|
1933
|
-
function
|
|
1934
|
-
return e = +e, t = +t,
|
|
1935
|
-
}
|
|
1936
|
-
function
|
|
1937
|
-
e = +e, t = +t,
|
|
1938
|
-
const
|
|
1939
|
-
return (
|
|
1940
|
-
}
|
|
1941
|
-
function
|
|
1666
|
+
const a = o - i + 1, c = new Array(a);
|
|
1667
|
+
if (r)
|
|
1668
|
+
if (s < 0) for (let u = 0; u < a; ++u) c[u] = (o - u) / -s;
|
|
1669
|
+
else for (let u = 0; u < a; ++u) c[u] = (o - u) * s;
|
|
1670
|
+
else if (s < 0) for (let u = 0; u < a; ++u) c[u] = (i + u) / -s;
|
|
1671
|
+
else for (let u = 0; u < a; ++u) c[u] = (i + u) * s;
|
|
1672
|
+
return c;
|
|
1673
|
+
}
|
|
1674
|
+
function Oe(t, e, n) {
|
|
1675
|
+
return e = +e, t = +t, n = +n, ke(t, e, n)[2];
|
|
1676
|
+
}
|
|
1677
|
+
function Cn(t, e, n) {
|
|
1678
|
+
e = +e, t = +t, n = +n;
|
|
1679
|
+
const r = e < t, i = r ? Oe(e, t, n) : Oe(t, e, n);
|
|
1680
|
+
return (r ? -1 : 1) * (i < 0 ? 1 / -i : i);
|
|
1681
|
+
}
|
|
1682
|
+
function Mn(t, e) {
|
|
1942
1683
|
switch (arguments.length) {
|
|
1943
1684
|
case 0:
|
|
1944
1685
|
break;
|
|
@@ -1951,110 +1692,110 @@ function Tr(t, e) {
|
|
|
1951
1692
|
}
|
|
1952
1693
|
return this;
|
|
1953
1694
|
}
|
|
1954
|
-
function
|
|
1695
|
+
function kn(t) {
|
|
1955
1696
|
return function() {
|
|
1956
1697
|
return t;
|
|
1957
1698
|
};
|
|
1958
1699
|
}
|
|
1959
|
-
function
|
|
1700
|
+
function vn(t) {
|
|
1960
1701
|
return +t;
|
|
1961
1702
|
}
|
|
1962
|
-
var
|
|
1963
|
-
function
|
|
1703
|
+
var ct = [0, 1];
|
|
1704
|
+
function J(t) {
|
|
1964
1705
|
return t;
|
|
1965
1706
|
}
|
|
1966
|
-
function
|
|
1967
|
-
return (e -= t = +t) ? function(
|
|
1968
|
-
return (
|
|
1969
|
-
} :
|
|
1707
|
+
function Pe(t, e) {
|
|
1708
|
+
return (e -= t = +t) ? function(n) {
|
|
1709
|
+
return (n - t) / e;
|
|
1710
|
+
} : kn(isNaN(e) ? NaN : 0.5);
|
|
1970
1711
|
}
|
|
1971
|
-
function
|
|
1972
|
-
var
|
|
1973
|
-
return t > e && (
|
|
1974
|
-
return Math.max(t, Math.min(e,
|
|
1712
|
+
function En(t, e) {
|
|
1713
|
+
var n;
|
|
1714
|
+
return t > e && (n = t, t = e, e = n), function(r) {
|
|
1715
|
+
return Math.max(t, Math.min(e, r));
|
|
1975
1716
|
};
|
|
1976
1717
|
}
|
|
1977
|
-
function
|
|
1978
|
-
var
|
|
1979
|
-
return i <
|
|
1980
|
-
return o(
|
|
1718
|
+
function Nn(t, e, n) {
|
|
1719
|
+
var r = t[0], i = t[1], o = e[0], s = e[1];
|
|
1720
|
+
return i < r ? (r = Pe(i, r), o = n(s, o)) : (r = Pe(r, i), o = n(o, s)), function(a) {
|
|
1721
|
+
return o(r(a));
|
|
1981
1722
|
};
|
|
1982
1723
|
}
|
|
1983
|
-
function
|
|
1984
|
-
var
|
|
1985
|
-
for (t[
|
|
1986
|
-
i[s] =
|
|
1724
|
+
function An(t, e, n) {
|
|
1725
|
+
var r = Math.min(t.length, e.length) - 1, i = new Array(r), o = new Array(r), s = -1;
|
|
1726
|
+
for (t[r] < t[0] && (t = t.slice().reverse(), e = e.slice().reverse()); ++s < r; )
|
|
1727
|
+
i[s] = Pe(t[s], t[s + 1]), o[s] = n(e[s], e[s + 1]);
|
|
1987
1728
|
return function(a) {
|
|
1988
|
-
var
|
|
1989
|
-
return o[
|
|
1729
|
+
var c = pn(t, a, 1, r) - 1;
|
|
1730
|
+
return o[c](i[c](a));
|
|
1990
1731
|
};
|
|
1991
1732
|
}
|
|
1992
|
-
function
|
|
1733
|
+
function _n(t, e) {
|
|
1993
1734
|
return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown());
|
|
1994
1735
|
}
|
|
1995
|
-
function
|
|
1996
|
-
var t =
|
|
1736
|
+
function Sn() {
|
|
1737
|
+
var t = ct, e = ct, n = qe, r, i, o, s = J, a, c, u;
|
|
1997
1738
|
function f() {
|
|
1998
1739
|
var g = Math.min(t.length, e.length);
|
|
1999
|
-
return s !==
|
|
1740
|
+
return s !== J && (s = En(t[0], t[g - 1])), a = g > 2 ? An : Nn, c = u = null, l;
|
|
2000
1741
|
}
|
|
2001
|
-
function
|
|
2002
|
-
return g == null || isNaN(g = +g) ? o : (
|
|
1742
|
+
function l(g) {
|
|
1743
|
+
return g == null || isNaN(g = +g) ? o : (c || (c = a(t.map(r), e, n)))(r(s(g)));
|
|
2003
1744
|
}
|
|
2004
|
-
return
|
|
2005
|
-
return s(i((u || (u = a(e, t.map(
|
|
2006
|
-
},
|
|
2007
|
-
return arguments.length ? (t = Array.from(g,
|
|
2008
|
-
},
|
|
1745
|
+
return l.invert = function(g) {
|
|
1746
|
+
return s(i((u || (u = a(e, t.map(r), Me)))(g)));
|
|
1747
|
+
}, l.domain = function(g) {
|
|
1748
|
+
return arguments.length ? (t = Array.from(g, vn), f()) : t.slice();
|
|
1749
|
+
}, l.range = function(g) {
|
|
2009
1750
|
return arguments.length ? (e = Array.from(g), f()) : e.slice();
|
|
2010
|
-
},
|
|
2011
|
-
return e = Array.from(g),
|
|
2012
|
-
},
|
|
2013
|
-
return arguments.length ? (s = g ? !0 :
|
|
2014
|
-
},
|
|
2015
|
-
return arguments.length ? (
|
|
2016
|
-
},
|
|
2017
|
-
return arguments.length ? (o = g,
|
|
2018
|
-
}, function(g,
|
|
2019
|
-
return
|
|
1751
|
+
}, l.rangeRound = function(g) {
|
|
1752
|
+
return e = Array.from(g), n = hn, f();
|
|
1753
|
+
}, l.clamp = function(g) {
|
|
1754
|
+
return arguments.length ? (s = g ? !0 : J, f()) : s !== J;
|
|
1755
|
+
}, l.interpolate = function(g) {
|
|
1756
|
+
return arguments.length ? (n = g, f()) : n;
|
|
1757
|
+
}, l.unknown = function(g) {
|
|
1758
|
+
return arguments.length ? (o = g, l) : o;
|
|
1759
|
+
}, function(g, w) {
|
|
1760
|
+
return r = g, i = w, f();
|
|
2020
1761
|
};
|
|
2021
1762
|
}
|
|
2022
|
-
function
|
|
2023
|
-
return
|
|
1763
|
+
function Rn() {
|
|
1764
|
+
return Sn()(J, J);
|
|
2024
1765
|
}
|
|
2025
|
-
function
|
|
1766
|
+
function Ln(t) {
|
|
2026
1767
|
return Math.abs(t = Math.round(t)) >= 1e21 ? t.toLocaleString("en").replace(/,/g, "") : t.toString(10);
|
|
2027
1768
|
}
|
|
2028
|
-
function
|
|
1769
|
+
function ve(t, e) {
|
|
2029
1770
|
if (!isFinite(t) || t === 0) return null;
|
|
2030
|
-
var
|
|
1771
|
+
var n = (t = e ? t.toExponential(e - 1) : t.toExponential()).indexOf("e"), r = t.slice(0, n);
|
|
2031
1772
|
return [
|
|
2032
|
-
|
|
2033
|
-
+t.slice(
|
|
1773
|
+
r.length > 1 ? r[0] + r.slice(2) : r,
|
|
1774
|
+
+t.slice(n + 1)
|
|
2034
1775
|
];
|
|
2035
1776
|
}
|
|
2036
|
-
function
|
|
2037
|
-
return t =
|
|
1777
|
+
function te(t) {
|
|
1778
|
+
return t = ve(Math.abs(t)), t ? t[1] : NaN;
|
|
2038
1779
|
}
|
|
2039
|
-
function
|
|
2040
|
-
return function(
|
|
2041
|
-
for (var i =
|
|
1780
|
+
function Bn(t, e) {
|
|
1781
|
+
return function(n, r) {
|
|
1782
|
+
for (var i = n.length, o = [], s = 0, a = t[0], c = 0; i > 0 && a > 0 && (c + a + 1 > r && (a = Math.max(1, r - c)), o.push(n.substring(i -= a, i + a)), !((c += a + 1) > r)); )
|
|
2042
1783
|
a = t[s = (s + 1) % t.length];
|
|
2043
1784
|
return o.reverse().join(e);
|
|
2044
1785
|
};
|
|
2045
1786
|
}
|
|
2046
|
-
function
|
|
1787
|
+
function $n(t) {
|
|
2047
1788
|
return function(e) {
|
|
2048
|
-
return e.replace(/[0-9]/g, function(
|
|
2049
|
-
return t[+
|
|
1789
|
+
return e.replace(/[0-9]/g, function(n) {
|
|
1790
|
+
return t[+n];
|
|
2050
1791
|
});
|
|
2051
1792
|
};
|
|
2052
1793
|
}
|
|
2053
|
-
var
|
|
2054
|
-
function
|
|
2055
|
-
if (!(e =
|
|
1794
|
+
var Dn = /^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;
|
|
1795
|
+
function Ee(t) {
|
|
1796
|
+
if (!(e = Dn.exec(t))) throw new Error("invalid format: " + t);
|
|
2056
1797
|
var e;
|
|
2057
|
-
return new
|
|
1798
|
+
return new ze({
|
|
2058
1799
|
fill: e[1],
|
|
2059
1800
|
align: e[2],
|
|
2060
1801
|
sign: e[3],
|
|
@@ -2067,110 +1808,110 @@ function $e(t) {
|
|
|
2067
1808
|
type: e[10]
|
|
2068
1809
|
});
|
|
2069
1810
|
}
|
|
2070
|
-
|
|
2071
|
-
function
|
|
1811
|
+
Ee.prototype = ze.prototype;
|
|
1812
|
+
function ze(t) {
|
|
2072
1813
|
this.fill = t.fill === void 0 ? " " : t.fill + "", this.align = t.align === void 0 ? ">" : t.align + "", this.sign = t.sign === void 0 ? "-" : t.sign + "", this.symbol = t.symbol === void 0 ? "" : t.symbol + "", this.zero = !!t.zero, this.width = t.width === void 0 ? void 0 : +t.width, this.comma = !!t.comma, this.precision = t.precision === void 0 ? void 0 : +t.precision, this.trim = !!t.trim, this.type = t.type === void 0 ? "" : t.type + "";
|
|
2073
1814
|
}
|
|
2074
|
-
|
|
1815
|
+
ze.prototype.toString = function() {
|
|
2075
1816
|
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;
|
|
2076
1817
|
};
|
|
2077
|
-
function
|
|
2078
|
-
e: for (var e = t.length,
|
|
2079
|
-
switch (t[
|
|
1818
|
+
function Tn(t) {
|
|
1819
|
+
e: for (var e = t.length, n = 1, r = -1, i; n < e; ++n)
|
|
1820
|
+
switch (t[n]) {
|
|
2080
1821
|
case ".":
|
|
2081
|
-
|
|
1822
|
+
r = i = n;
|
|
2082
1823
|
break;
|
|
2083
1824
|
case "0":
|
|
2084
|
-
|
|
1825
|
+
r === 0 && (r = n), i = n;
|
|
2085
1826
|
break;
|
|
2086
1827
|
default:
|
|
2087
|
-
if (!+t[
|
|
2088
|
-
|
|
1828
|
+
if (!+t[n]) break e;
|
|
1829
|
+
r > 0 && (r = 0);
|
|
2089
1830
|
break;
|
|
2090
1831
|
}
|
|
2091
|
-
return
|
|
2092
|
-
}
|
|
2093
|
-
var
|
|
2094
|
-
function
|
|
2095
|
-
var
|
|
2096
|
-
if (!
|
|
2097
|
-
var
|
|
2098
|
-
return o === s ?
|
|
2099
|
-
}
|
|
2100
|
-
function
|
|
2101
|
-
var
|
|
2102
|
-
if (!
|
|
2103
|
-
var
|
|
2104
|
-
return i < 0 ? "0." + new Array(-i).join("0") +
|
|
2105
|
-
}
|
|
2106
|
-
const
|
|
1832
|
+
return r > 0 ? t.slice(0, r) + t.slice(i + 1) : t;
|
|
1833
|
+
}
|
|
1834
|
+
var Ne;
|
|
1835
|
+
function In(t, e) {
|
|
1836
|
+
var n = ve(t, e);
|
|
1837
|
+
if (!n) return Ne = void 0, t.toPrecision(e);
|
|
1838
|
+
var r = n[0], i = n[1], o = i - (Ne = Math.max(-8, Math.min(8, Math.floor(i / 3))) * 3) + 1, s = r.length;
|
|
1839
|
+
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") + ve(t, Math.max(0, e + o - 1))[0];
|
|
1840
|
+
}
|
|
1841
|
+
function ft(t, e) {
|
|
1842
|
+
var n = ve(t, e);
|
|
1843
|
+
if (!n) return t + "";
|
|
1844
|
+
var r = n[0], i = n[1];
|
|
1845
|
+
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");
|
|
1846
|
+
}
|
|
1847
|
+
const lt = {
|
|
2107
1848
|
"%": (t, e) => (t * 100).toFixed(e),
|
|
2108
1849
|
b: (t) => Math.round(t).toString(2),
|
|
2109
1850
|
c: (t) => t + "",
|
|
2110
|
-
d:
|
|
1851
|
+
d: Ln,
|
|
2111
1852
|
e: (t, e) => t.toExponential(e),
|
|
2112
1853
|
f: (t, e) => t.toFixed(e),
|
|
2113
1854
|
g: (t, e) => t.toPrecision(e),
|
|
2114
1855
|
o: (t) => Math.round(t).toString(8),
|
|
2115
|
-
p: (t, e) =>
|
|
2116
|
-
r:
|
|
2117
|
-
s:
|
|
1856
|
+
p: (t, e) => ft(t * 100, e),
|
|
1857
|
+
r: ft,
|
|
1858
|
+
s: In,
|
|
2118
1859
|
X: (t) => Math.round(t).toString(16).toUpperCase(),
|
|
2119
1860
|
x: (t) => Math.round(t).toString(16)
|
|
2120
1861
|
};
|
|
2121
|
-
function
|
|
1862
|
+
function ht(t) {
|
|
2122
1863
|
return t;
|
|
2123
1864
|
}
|
|
2124
|
-
var
|
|
2125
|
-
function
|
|
2126
|
-
var e = t.grouping === void 0 || t.thousands === void 0 ?
|
|
2127
|
-
function u(
|
|
2128
|
-
|
|
2129
|
-
var
|
|
2130
|
-
|
|
2131
|
-
var
|
|
2132
|
-
|
|
2133
|
-
function
|
|
2134
|
-
var
|
|
2135
|
-
if (
|
|
2136
|
-
|
|
1865
|
+
var gt = Array.prototype.map, dt = ["y", "z", "a", "f", "p", "n", "µ", "m", "", "k", "M", "G", "T", "P", "E", "Z", "Y"];
|
|
1866
|
+
function Hn(t) {
|
|
1867
|
+
var e = t.grouping === void 0 || t.thousands === void 0 ? ht : Bn(gt.call(t.grouping, Number), t.thousands + ""), n = t.currency === void 0 ? "" : t.currency[0] + "", r = t.currency === void 0 ? "" : t.currency[1] + "", i = t.decimal === void 0 ? "." : t.decimal + "", o = t.numerals === void 0 ? ht : $n(gt.call(t.numerals, String)), s = t.percent === void 0 ? "%" : t.percent + "", a = t.minus === void 0 ? "−" : t.minus + "", c = t.nan === void 0 ? "NaN" : t.nan + "";
|
|
1868
|
+
function u(l, g) {
|
|
1869
|
+
l = Ee(l);
|
|
1870
|
+
var w = l.fill, y = l.align, F = l.sign, S = l.symbol, _ = l.zero, O = l.width, D = l.comma, v = l.precision, j = l.trim, M = l.type;
|
|
1871
|
+
M === "n" ? (D = !0, M = "g") : lt[M] || (v === void 0 && (v = 12), j = !0, M = "g"), (_ || w === "0" && y === "=") && (_ = !0, w = "0", y = "=");
|
|
1872
|
+
var T = (g && g.prefix !== void 0 ? g.prefix : "") + (S === "$" ? n : S === "#" && /[boxX]/.test(M) ? "0" + M.toLowerCase() : ""), le = (S === "$" ? r : /[%p]/.test(M) ? s : "") + (g && g.suffix !== void 0 ? g.suffix : ""), he = lt[M], ge = /[defgprs%]/.test(M);
|
|
1873
|
+
v = v === void 0 ? 6 : /[gprs]/.test(M) ? Math.max(1, Math.min(21, v)) : Math.max(0, Math.min(20, v));
|
|
1874
|
+
function ne(p) {
|
|
1875
|
+
var P = T, E = le, I, re, X;
|
|
1876
|
+
if (M === "c")
|
|
1877
|
+
E = he(p) + E, p = "";
|
|
2137
1878
|
else {
|
|
2138
|
-
|
|
2139
|
-
var
|
|
2140
|
-
if (
|
|
2141
|
-
for (
|
|
2142
|
-
if (
|
|
2143
|
-
|
|
1879
|
+
p = +p;
|
|
1880
|
+
var q = p < 0 || 1 / p < 0;
|
|
1881
|
+
if (p = isNaN(p) ? c : he(Math.abs(p), v), j && (p = Tn(p)), q && +p == 0 && F !== "+" && (q = !1), P = (q ? F === "(" ? F : a : F === "-" || F === "(" ? "" : F) + P, E = (M === "s" && !isNaN(p) && Ne !== void 0 ? dt[8 + Ne / 3] : "") + E + (q && F === "(" ? ")" : ""), ge) {
|
|
1882
|
+
for (I = -1, re = p.length; ++I < re; )
|
|
1883
|
+
if (X = p.charCodeAt(I), 48 > X || X > 57) {
|
|
1884
|
+
E = (X === 46 ? i + p.slice(I + 1) : p.slice(I)) + E, p = p.slice(0, I);
|
|
2144
1885
|
break;
|
|
2145
1886
|
}
|
|
2146
1887
|
}
|
|
2147
1888
|
}
|
|
2148
|
-
|
|
2149
|
-
var
|
|
2150
|
-
switch (
|
|
1889
|
+
D && !_ && (p = e(p, 1 / 0));
|
|
1890
|
+
var z = P.length + p.length + E.length, R = z < O ? new Array(O - z + 1).join(w) : "";
|
|
1891
|
+
switch (D && _ && (p = e(R + p, R.length ? O - E.length : 1 / 0), R = ""), y) {
|
|
2151
1892
|
case "<":
|
|
2152
|
-
|
|
1893
|
+
p = P + p + E + R;
|
|
2153
1894
|
break;
|
|
2154
1895
|
case "=":
|
|
2155
|
-
|
|
1896
|
+
p = P + R + p + E;
|
|
2156
1897
|
break;
|
|
2157
1898
|
case "^":
|
|
2158
|
-
|
|
1899
|
+
p = R.slice(0, z = R.length >> 1) + P + p + E + R.slice(z);
|
|
2159
1900
|
break;
|
|
2160
1901
|
default:
|
|
2161
|
-
|
|
1902
|
+
p = R + P + p + E;
|
|
2162
1903
|
break;
|
|
2163
1904
|
}
|
|
2164
|
-
return o(
|
|
1905
|
+
return o(p);
|
|
2165
1906
|
}
|
|
2166
|
-
return
|
|
2167
|
-
return
|
|
2168
|
-
},
|
|
2169
|
-
}
|
|
2170
|
-
function f(
|
|
2171
|
-
var
|
|
2172
|
-
return function(
|
|
2173
|
-
return
|
|
1907
|
+
return ne.toString = function() {
|
|
1908
|
+
return l + "";
|
|
1909
|
+
}, ne;
|
|
1910
|
+
}
|
|
1911
|
+
function f(l, g) {
|
|
1912
|
+
var w = Math.max(-8, Math.min(8, Math.floor(te(g) / 3))) * 3, y = Math.pow(10, -w), F = u((l = Ee(l), l.type = "f", l), { suffix: dt[8 + w / 3] });
|
|
1913
|
+
return function(S) {
|
|
1914
|
+
return F(y * S);
|
|
2174
1915
|
};
|
|
2175
1916
|
}
|
|
2176
1917
|
return {
|
|
@@ -2178,230 +1919,230 @@ function Vr(t) {
|
|
|
2178
1919
|
formatPrefix: f
|
|
2179
1920
|
};
|
|
2180
1921
|
}
|
|
2181
|
-
var
|
|
2182
|
-
|
|
1922
|
+
var we, Ct, Mt;
|
|
1923
|
+
On({
|
|
2183
1924
|
thousands: ",",
|
|
2184
1925
|
grouping: [3],
|
|
2185
1926
|
currency: ["$", ""]
|
|
2186
1927
|
});
|
|
2187
|
-
function
|
|
2188
|
-
return
|
|
1928
|
+
function On(t) {
|
|
1929
|
+
return we = Hn(t), Ct = we.format, Mt = we.formatPrefix, we;
|
|
2189
1930
|
}
|
|
2190
|
-
function
|
|
2191
|
-
return Math.max(0, -
|
|
1931
|
+
function Pn(t) {
|
|
1932
|
+
return Math.max(0, -te(Math.abs(t)));
|
|
2192
1933
|
}
|
|
2193
|
-
function
|
|
2194
|
-
return Math.max(0, Math.max(-8, Math.min(8, Math.floor(
|
|
1934
|
+
function jn(t, e) {
|
|
1935
|
+
return Math.max(0, Math.max(-8, Math.min(8, Math.floor(te(e) / 3))) * 3 - te(Math.abs(t)));
|
|
2195
1936
|
}
|
|
2196
|
-
function
|
|
2197
|
-
return t = Math.abs(t), e = Math.abs(e) - t, Math.max(0,
|
|
1937
|
+
function Gn(t, e) {
|
|
1938
|
+
return t = Math.abs(t), e = Math.abs(e) - t, Math.max(0, te(e) - te(t)) + 1;
|
|
2198
1939
|
}
|
|
2199
|
-
function
|
|
2200
|
-
var i =
|
|
2201
|
-
switch (
|
|
1940
|
+
function qn(t, e, n, r) {
|
|
1941
|
+
var i = Cn(t, e, n), o;
|
|
1942
|
+
switch (r = Ee(r ?? ",f"), r.type) {
|
|
2202
1943
|
case "s": {
|
|
2203
1944
|
var s = Math.max(Math.abs(t), Math.abs(e));
|
|
2204
|
-
return
|
|
1945
|
+
return r.precision == null && !isNaN(o = jn(i, s)) && (r.precision = o), Mt(r, s);
|
|
2205
1946
|
}
|
|
2206
1947
|
case "":
|
|
2207
1948
|
case "e":
|
|
2208
1949
|
case "g":
|
|
2209
1950
|
case "p":
|
|
2210
1951
|
case "r": {
|
|
2211
|
-
|
|
1952
|
+
r.precision == null && !isNaN(o = Gn(i, Math.max(Math.abs(t), Math.abs(e)))) && (r.precision = o - (r.type === "e"));
|
|
2212
1953
|
break;
|
|
2213
1954
|
}
|
|
2214
1955
|
case "f":
|
|
2215
1956
|
case "%": {
|
|
2216
|
-
|
|
1957
|
+
r.precision == null && !isNaN(o = Pn(i)) && (r.precision = o - (r.type === "%") * 2);
|
|
2217
1958
|
break;
|
|
2218
1959
|
}
|
|
2219
1960
|
}
|
|
2220
|
-
return
|
|
1961
|
+
return Ct(r);
|
|
2221
1962
|
}
|
|
2222
|
-
function
|
|
1963
|
+
function zn(t) {
|
|
2223
1964
|
var e = t.domain;
|
|
2224
|
-
return t.ticks = function(
|
|
2225
|
-
var
|
|
2226
|
-
return
|
|
2227
|
-
}, t.tickFormat = function(
|
|
1965
|
+
return t.ticks = function(n) {
|
|
1966
|
+
var r = e();
|
|
1967
|
+
return Fn(r[0], r[r.length - 1], n ?? 10);
|
|
1968
|
+
}, t.tickFormat = function(n, r) {
|
|
2228
1969
|
var i = e();
|
|
2229
|
-
return
|
|
2230
|
-
}, t.nice = function(
|
|
2231
|
-
|
|
2232
|
-
var
|
|
1970
|
+
return qn(i[0], i[i.length - 1], n ?? 10, r);
|
|
1971
|
+
}, t.nice = function(n) {
|
|
1972
|
+
n == null && (n = 10);
|
|
1973
|
+
var r = e(), i = 0, o = r.length - 1, s = r[i], a = r[o], c, u, f = 10;
|
|
2233
1974
|
for (a < s && (u = s, s = a, a = u, u = i, i = o, o = u); f-- > 0; ) {
|
|
2234
|
-
if (u =
|
|
2235
|
-
return
|
|
1975
|
+
if (u = Oe(s, a, n), u === c)
|
|
1976
|
+
return r[i] = s, r[o] = a, e(r);
|
|
2236
1977
|
if (u > 0)
|
|
2237
1978
|
s = Math.floor(s / u) * u, a = Math.ceil(a / u) * u;
|
|
2238
1979
|
else if (u < 0)
|
|
2239
1980
|
s = Math.ceil(s * u) / u, a = Math.floor(a * u) / u;
|
|
2240
1981
|
else
|
|
2241
1982
|
break;
|
|
2242
|
-
|
|
1983
|
+
c = u;
|
|
2243
1984
|
}
|
|
2244
1985
|
return t;
|
|
2245
1986
|
}, t;
|
|
2246
1987
|
}
|
|
2247
|
-
function
|
|
2248
|
-
var t =
|
|
1988
|
+
function kt() {
|
|
1989
|
+
var t = Rn();
|
|
2249
1990
|
return t.copy = function() {
|
|
2250
|
-
return
|
|
2251
|
-
},
|
|
1991
|
+
return _n(t, kt());
|
|
1992
|
+
}, Mn.apply(t, arguments), zn(t);
|
|
2252
1993
|
}
|
|
2253
|
-
const
|
|
2254
|
-
const
|
|
2255
|
-
return typeof
|
|
2256
|
-
},
|
|
1994
|
+
const De = (t, e) => {
|
|
1995
|
+
const n = t?.[e];
|
|
1996
|
+
return typeof n == "number" ? n : 0;
|
|
1997
|
+
}, mt = (t, e) => {
|
|
2257
1998
|
if (!t.length) return () => e.minColor;
|
|
2258
|
-
const
|
|
2259
|
-
if (
|
|
2260
|
-
const i =
|
|
1999
|
+
const n = Math.min(...t), r = Math.max(...t);
|
|
2000
|
+
if (n === r) return () => e.maxColor;
|
|
2001
|
+
const i = kt().domain([n, r]).range([0, 1]), o = Ie(e.minColor, e.maxColor);
|
|
2261
2002
|
return (s) => o(i(s));
|
|
2262
|
-
},
|
|
2003
|
+
}, Un = (t) => t <= 1.35 ? 2 : t <= 2.1 ? 1 : 0, Vn = (t) => new Intl.NumberFormat("en-US", { maximumFractionDigits: 0 }).format(t), Jn = ({
|
|
2263
2004
|
statisticsData: t,
|
|
2264
2005
|
resetSignal: e,
|
|
2265
|
-
countryNumericToIsoMap:
|
|
2266
|
-
countryNameToIsoMap:
|
|
2006
|
+
countryNumericToIsoMap: n = {},
|
|
2007
|
+
countryNameToIsoMap: r = {},
|
|
2267
2008
|
primaryMetric: i = "visits",
|
|
2268
|
-
colorScale: o =
|
|
2009
|
+
colorScale: o = jt
|
|
2269
2010
|
}) => {
|
|
2270
|
-
const s =
|
|
2011
|
+
const s = W(null), a = W(null), c = W(void 0), u = W({}), f = W(null), l = W(e), [g, w] = U(0), [y, F] = U(), [S, _] = U(), [O, D] = U(null), [v, j] = U([]), [M, T] = U([]), [le, he] = U({
|
|
2271
2012
|
width: 900,
|
|
2272
2013
|
height: 760
|
|
2273
|
-
}),
|
|
2014
|
+
}), ge = me(
|
|
2274
2015
|
() => Object.values(t.countries).map(
|
|
2275
|
-
(
|
|
2016
|
+
(h) => De(h, i)
|
|
2276
2017
|
),
|
|
2277
2018
|
[i, t.countries]
|
|
2278
|
-
),
|
|
2279
|
-
(
|
|
2280
|
-
) : [], [
|
|
2281
|
-
() =>
|
|
2282
|
-
[
|
|
2283
|
-
),
|
|
2284
|
-
() =>
|
|
2285
|
-
[
|
|
2019
|
+
), ne = me(() => y ? Object.values(t.regions[y] ?? {}).map(
|
|
2020
|
+
(h) => De(h, i)
|
|
2021
|
+
) : [], [y, i, t.regions]), p = me(
|
|
2022
|
+
() => mt(ge, o),
|
|
2023
|
+
[ge, o]
|
|
2024
|
+
), P = me(
|
|
2025
|
+
() => mt(ne, o),
|
|
2026
|
+
[ne, o]
|
|
2286
2027
|
);
|
|
2287
|
-
|
|
2028
|
+
V(() => {
|
|
2288
2029
|
(async () => {
|
|
2289
|
-
let
|
|
2030
|
+
let d = [];
|
|
2290
2031
|
try {
|
|
2291
|
-
|
|
2032
|
+
d = (await (await fetch(It)).json()).features;
|
|
2292
2033
|
} catch {
|
|
2293
|
-
const
|
|
2294
|
-
|
|
2034
|
+
const m = await (await fetch(Ht)).json(), C = m.objects.countries, N = Lt(
|
|
2035
|
+
m,
|
|
2295
2036
|
C
|
|
2296
2037
|
);
|
|
2297
|
-
|
|
2038
|
+
d = N.type === "FeatureCollection" ? N.features : [N];
|
|
2298
2039
|
}
|
|
2299
|
-
const
|
|
2300
|
-
const
|
|
2040
|
+
const b = d.map((x) => {
|
|
2041
|
+
const m = String(x.id ?? ""), C = x.properties ?? {}, N = String(
|
|
2301
2042
|
C.name ?? C.NAME ?? C.name_en ?? C.ADMIN ?? ""
|
|
2302
|
-
).trim() || `Country ${
|
|
2043
|
+
).trim() || `Country ${m}`, Ae = N.toLowerCase(), de = String(
|
|
2303
2044
|
C.iso_a2 ?? C.ISO_A2 ?? C.iso_a2_eh ?? ""
|
|
2304
|
-
).trim().toUpperCase(),
|
|
2045
|
+
).trim().toUpperCase(), Ve = n[m] ?? r[Ae] ?? (de && de !== "-99" ? de : void 0) ?? (m.length === 2 ? m.toUpperCase() : m);
|
|
2305
2046
|
return {
|
|
2306
|
-
...
|
|
2047
|
+
...x,
|
|
2307
2048
|
properties: {
|
|
2308
2049
|
...C,
|
|
2309
|
-
__isoA2:
|
|
2310
|
-
name:
|
|
2050
|
+
__isoA2: Ve,
|
|
2051
|
+
name: N || Ve || `Country ${m}`
|
|
2311
2052
|
}
|
|
2312
2053
|
};
|
|
2313
2054
|
});
|
|
2314
|
-
|
|
2055
|
+
j(b);
|
|
2315
2056
|
})();
|
|
2316
|
-
}, []),
|
|
2057
|
+
}, []), V(() => {
|
|
2317
2058
|
if (!a.current) return;
|
|
2318
|
-
const
|
|
2319
|
-
const
|
|
2320
|
-
|
|
2321
|
-
width: Math.max(360, Math.floor(
|
|
2322
|
-
height: Math.max(520, Math.floor(
|
|
2059
|
+
const h = new ResizeObserver((d) => {
|
|
2060
|
+
const b = d[0];
|
|
2061
|
+
b && he({
|
|
2062
|
+
width: Math.max(360, Math.floor(b.contentRect.width)),
|
|
2063
|
+
height: Math.max(520, Math.floor(b.contentRect.height))
|
|
2323
2064
|
});
|
|
2324
2065
|
});
|
|
2325
|
-
return
|
|
2326
|
-
}, []),
|
|
2327
|
-
if (!
|
|
2328
|
-
|
|
2066
|
+
return h.observe(a.current), () => h.disconnect();
|
|
2067
|
+
}, []), V(() => {
|
|
2068
|
+
if (!y) {
|
|
2069
|
+
T([]);
|
|
2329
2070
|
return;
|
|
2330
2071
|
}
|
|
2331
|
-
const
|
|
2332
|
-
if (
|
|
2333
|
-
|
|
2072
|
+
const h = u.current[y];
|
|
2073
|
+
if (h) {
|
|
2074
|
+
T(h);
|
|
2334
2075
|
return;
|
|
2335
2076
|
}
|
|
2336
2077
|
(async () => {
|
|
2337
2078
|
if (!f.current) {
|
|
2338
|
-
const C = await (await fetch(
|
|
2079
|
+
const C = await (await fetch(Ot)).json();
|
|
2339
2080
|
f.current = C.features;
|
|
2340
2081
|
}
|
|
2341
|
-
const
|
|
2342
|
-
(
|
|
2343
|
-
).map((
|
|
2344
|
-
const C =
|
|
2082
|
+
const x = (f.current ?? []).filter(
|
|
2083
|
+
(m) => (m.properties ?? {}).iso_a2 === y
|
|
2084
|
+
).map((m) => {
|
|
2085
|
+
const C = m.properties ?? {}, N = String(C.name ?? "").trim();
|
|
2345
2086
|
return {
|
|
2346
|
-
...
|
|
2087
|
+
...m,
|
|
2347
2088
|
properties: {
|
|
2348
2089
|
...C,
|
|
2349
|
-
__countryCode:
|
|
2350
|
-
__regionName:
|
|
2351
|
-
name:
|
|
2090
|
+
__countryCode: y,
|
|
2091
|
+
__regionName: N,
|
|
2092
|
+
name: N
|
|
2352
2093
|
}
|
|
2353
2094
|
};
|
|
2354
2095
|
});
|
|
2355
|
-
u.current[
|
|
2096
|
+
u.current[y] = x, T(x);
|
|
2356
2097
|
})();
|
|
2357
|
-
}, [
|
|
2358
|
-
if (
|
|
2359
|
-
|
|
2360
|
-
}, [
|
|
2361
|
-
const
|
|
2362
|
-
if (!
|
|
2363
|
-
|
|
2364
|
-
const
|
|
2365
|
-
|
|
2366
|
-
}, []),
|
|
2367
|
-
const
|
|
2368
|
-
|
|
2369
|
-
}, [
|
|
2370
|
-
if (e ===
|
|
2371
|
-
|
|
2372
|
-
const
|
|
2373
|
-
|
|
2098
|
+
}, [y]), V(() => {
|
|
2099
|
+
if (S && g < 2) return void w(2);
|
|
2100
|
+
y && g < 1 && w(1);
|
|
2101
|
+
}, [y, S, g]), V(() => {
|
|
2102
|
+
const h = s.current?.controls?.();
|
|
2103
|
+
if (!h) return;
|
|
2104
|
+
h.autoRotate = !0, h.autoRotateSpeed = 0.45, h.enablePan = !1, h.enableZoom = !0;
|
|
2105
|
+
const d = s.current?.renderer?.();
|
|
2106
|
+
d && d.setPixelRatio(Math.min(window.devicePixelRatio, 1.5));
|
|
2107
|
+
}, []), V(() => {
|
|
2108
|
+
const h = s.current?.controls?.();
|
|
2109
|
+
h && (h.autoRotate = !y && g === 0);
|
|
2110
|
+
}, [y, g]), V(() => {
|
|
2111
|
+
if (e === l.current) return;
|
|
2112
|
+
l.current = e, w(0), F(void 0), _(void 0), D(null), T([]);
|
|
2113
|
+
const h = s.current?.controls?.();
|
|
2114
|
+
h && (h.autoRotate = !0), s.current?.pointOfView({ lat: 20, lng: 15, altitude: 2.6 }, 650);
|
|
2374
2115
|
}, [e]);
|
|
2375
|
-
const
|
|
2376
|
-
const
|
|
2377
|
-
|
|
2378
|
-
},
|
|
2379
|
-
s.current?.pointOfView({ lat:
|
|
2380
|
-
},
|
|
2381
|
-
const
|
|
2382
|
-
|
|
2383
|
-
},
|
|
2384
|
-
if (typeof
|
|
2116
|
+
const E = () => {
|
|
2117
|
+
const h = s.current?.globeMaterial?.();
|
|
2118
|
+
h && (h.map = null, h.color = new oe("#f5f5f5"), h.emissive = new oe("#ffffff"), h.emissiveIntensity = 0.35, h.specular = new oe("#d4d4d8"), h.shininess = 3, h.needsUpdate = !0);
|
|
2119
|
+
}, I = (h, d, b) => {
|
|
2120
|
+
s.current?.pointOfView({ lat: h, lng: d, altitude: b }, 650);
|
|
2121
|
+
}, re = () => {
|
|
2122
|
+
const h = s.current?.controls?.();
|
|
2123
|
+
h && (h.autoRotate = !1);
|
|
2124
|
+
}, X = (h) => {
|
|
2125
|
+
if (typeof h != "object" || h === null || !("coordinates" in h))
|
|
2385
2126
|
return [];
|
|
2386
|
-
const
|
|
2387
|
-
if (Array.isArray(
|
|
2388
|
-
if (
|
|
2389
|
-
|
|
2127
|
+
const d = h.coordinates, b = [], x = (m) => {
|
|
2128
|
+
if (Array.isArray(m)) {
|
|
2129
|
+
if (m.length >= 2 && typeof m[0] == "number" && typeof m[1] == "number") {
|
|
2130
|
+
b.push([m[0], m[1]]);
|
|
2390
2131
|
return;
|
|
2391
2132
|
}
|
|
2392
|
-
|
|
2133
|
+
m.forEach(x);
|
|
2393
2134
|
}
|
|
2394
2135
|
};
|
|
2395
|
-
return
|
|
2396
|
-
},
|
|
2397
|
-
const
|
|
2398
|
-
if (!
|
|
2399
|
-
const
|
|
2400
|
-
(
|
|
2401
|
-
minLat: Math.min(
|
|
2402
|
-
maxLat: Math.max(
|
|
2403
|
-
minLng: Math.min(
|
|
2404
|
-
maxLng: Math.max(
|
|
2136
|
+
return x(d), b;
|
|
2137
|
+
}, q = (h) => {
|
|
2138
|
+
const d = X(h.geometry);
|
|
2139
|
+
if (!d.length) return;
|
|
2140
|
+
const b = d.reduce(
|
|
2141
|
+
(x, [m, C]) => ({
|
|
2142
|
+
minLat: Math.min(x.minLat, C),
|
|
2143
|
+
maxLat: Math.max(x.maxLat, C),
|
|
2144
|
+
minLng: Math.min(x.minLng, m),
|
|
2145
|
+
maxLng: Math.max(x.maxLng, m)
|
|
2405
2146
|
}),
|
|
2406
2147
|
{
|
|
2407
2148
|
minLat: Number.POSITIVE_INFINITY,
|
|
@@ -2410,62 +2151,62 @@ const Ge = (t, e) => {
|
|
|
2410
2151
|
maxLng: Number.NEGATIVE_INFINITY
|
|
2411
2152
|
}
|
|
2412
2153
|
);
|
|
2413
|
-
if (!(!Number.isFinite(
|
|
2414
|
-
return
|
|
2415
|
-
},
|
|
2416
|
-
const
|
|
2417
|
-
return Math.min(0.9, Math.max(0.14,
|
|
2418
|
-
},
|
|
2419
|
-
|
|
2420
|
-
const
|
|
2421
|
-
|
|
2154
|
+
if (!(!Number.isFinite(b.minLat) || !Number.isFinite(b.minLng)))
|
|
2155
|
+
return b;
|
|
2156
|
+
}, z = (h) => {
|
|
2157
|
+
const d = Math.max(0.1, h.maxLat - h.minLat), b = Math.max(0.1, h.maxLng - h.minLng), m = Math.max(d, b) / 112;
|
|
2158
|
+
return Math.min(0.9, Math.max(0.14, m));
|
|
2159
|
+
}, R = () => {
|
|
2160
|
+
c.current && window.clearTimeout(c.current), c.current = window.setTimeout(() => {
|
|
2161
|
+
const h = s.current?.pointOfView?.().altitude ?? 2.4, d = Un(h);
|
|
2162
|
+
w(d), d <= 0 && _(void 0);
|
|
2422
2163
|
}, 120);
|
|
2423
|
-
},
|
|
2424
|
-
const
|
|
2164
|
+
}, vt = (h) => {
|
|
2165
|
+
const d = h.properties ?? {};
|
|
2425
2166
|
if (g === 0) {
|
|
2426
|
-
const
|
|
2427
|
-
if (!
|
|
2428
|
-
|
|
2429
|
-
const
|
|
2430
|
-
if (
|
|
2431
|
-
|
|
2432
|
-
(
|
|
2433
|
-
(
|
|
2434
|
-
|
|
2167
|
+
const b = r[String(d.name ?? "").toLowerCase()], x = d.__isoA2 ?? (typeof d.iso_a2 == "string" ? d.iso_a2.toUpperCase() : void 0) ?? b;
|
|
2168
|
+
if (!x) return;
|
|
2169
|
+
re(), w(1), F(x), _(void 0);
|
|
2170
|
+
const m = q(h);
|
|
2171
|
+
if (m) {
|
|
2172
|
+
I(
|
|
2173
|
+
(m.minLat + m.maxLat) / 2,
|
|
2174
|
+
(m.minLng + m.maxLng) / 2,
|
|
2175
|
+
z(m)
|
|
2435
2176
|
);
|
|
2436
2177
|
return;
|
|
2437
2178
|
}
|
|
2438
2179
|
return;
|
|
2439
2180
|
}
|
|
2440
2181
|
if (g >= 1) {
|
|
2441
|
-
const
|
|
2442
|
-
if (!
|
|
2443
|
-
|
|
2444
|
-
const
|
|
2445
|
-
if (
|
|
2446
|
-
|
|
2447
|
-
(
|
|
2448
|
-
(
|
|
2449
|
-
Math.max(0.2,
|
|
2182
|
+
const b = d.__regionName;
|
|
2183
|
+
if (!b) return;
|
|
2184
|
+
re(), w(2), _(b);
|
|
2185
|
+
const x = q(h);
|
|
2186
|
+
if (x) {
|
|
2187
|
+
I(
|
|
2188
|
+
(x.minLat + x.maxLat) / 2,
|
|
2189
|
+
(x.minLng + x.maxLng) / 2,
|
|
2190
|
+
Math.max(0.2, z(x) * 0.52)
|
|
2450
2191
|
);
|
|
2451
2192
|
return;
|
|
2452
2193
|
}
|
|
2453
2194
|
}
|
|
2454
|
-
},
|
|
2455
|
-
if (
|
|
2456
|
-
return t.regions[
|
|
2457
|
-
if (
|
|
2458
|
-
},
|
|
2459
|
-
if (!
|
|
2195
|
+
}, Et = g === 0 ? v : M.length ? [...v, ...M] : v, Ue = (h, d) => {
|
|
2196
|
+
if (d && h)
|
|
2197
|
+
return t.regions[h]?.[d];
|
|
2198
|
+
if (h) return t.countries[h];
|
|
2199
|
+
}, Nt = (h) => {
|
|
2200
|
+
if (!h)
|
|
2460
2201
|
return "<div>No data</div>";
|
|
2461
|
-
const
|
|
2462
|
-
([,
|
|
2202
|
+
const d = Object.entries(h).filter(
|
|
2203
|
+
([, b]) => typeof b == "number" && Number.isFinite(b)
|
|
2463
2204
|
);
|
|
2464
|
-
return
|
|
2465
|
-
([
|
|
2205
|
+
return d.length ? (d.sort(([b], [x]) => b === i ? -1 : x === i ? 1 : b.localeCompare(x)), d.map(
|
|
2206
|
+
([b, x]) => `<div>${b}: ${Vn(x)}</div>`
|
|
2466
2207
|
).join("")) : "<div>No data</div>";
|
|
2467
2208
|
};
|
|
2468
|
-
return /* @__PURE__ */
|
|
2209
|
+
return /* @__PURE__ */ Ze(
|
|
2469
2210
|
"div",
|
|
2470
2211
|
{
|
|
2471
2212
|
ref: a,
|
|
@@ -2475,52 +2216,52 @@ const Ge = (t, e) => {
|
|
|
2475
2216
|
overflow: "hidden",
|
|
2476
2217
|
background: "white"
|
|
2477
2218
|
},
|
|
2478
|
-
children: /* @__PURE__ */
|
|
2479
|
-
|
|
2219
|
+
children: /* @__PURE__ */ Ze(
|
|
2220
|
+
At,
|
|
2480
2221
|
{
|
|
2481
2222
|
ref: s,
|
|
2482
|
-
globeImageUrl:
|
|
2223
|
+
globeImageUrl: Pt,
|
|
2483
2224
|
backgroundColor: "#ffffff",
|
|
2484
|
-
polygonsData:
|
|
2225
|
+
polygonsData: Et,
|
|
2485
2226
|
polygonAltitude: 0.01,
|
|
2486
2227
|
polygonsTransitionDuration: 180,
|
|
2487
|
-
polygonCapColor: (
|
|
2488
|
-
const
|
|
2489
|
-
if (g > 0 && !
|
|
2228
|
+
polygonCapColor: (h) => {
|
|
2229
|
+
const d = h.properties ?? {}, b = !!d.__regionName;
|
|
2230
|
+
if (g > 0 && !b)
|
|
2490
2231
|
return "rgba(148,163,184,0.027)";
|
|
2491
|
-
const
|
|
2492
|
-
return
|
|
2232
|
+
const x = g === 0 ? d.__isoA2 : d.__countryCode, m = d.__regionName, C = Ue(x, m), N = De(C, i), Ae = g === 0 ? p(N) : P(N);
|
|
2233
|
+
return O === h ? "#60a5fa" : Ae;
|
|
2493
2234
|
},
|
|
2494
|
-
polygonSideColor: (
|
|
2495
|
-
const
|
|
2496
|
-
return g > 0 && !
|
|
2235
|
+
polygonSideColor: (h) => {
|
|
2236
|
+
const d = h.properties ?? {};
|
|
2237
|
+
return g > 0 && !d.__regionName ? "rgba(148,163,184,0.027)" : d.__regionName ? "rgba(148,163,184,0.22)" : "rgba(226,232,240,0.45)";
|
|
2497
2238
|
},
|
|
2498
|
-
polygonStrokeColor: (
|
|
2499
|
-
const
|
|
2500
|
-
return g > 0 && !
|
|
2239
|
+
polygonStrokeColor: (h) => {
|
|
2240
|
+
const d = h.properties ?? {};
|
|
2241
|
+
return g > 0 && !d.__regionName ? "rgba(100,116,139,0.067)" : d.__regionName ? "rgba(51,65,85,0.98)" : "rgba(156,163,175,0.95)";
|
|
2501
2242
|
},
|
|
2502
|
-
polygonLabel: (
|
|
2503
|
-
const
|
|
2243
|
+
polygonLabel: (h) => {
|
|
2244
|
+
const d = h.properties ?? {}, b = g === 0 ? d.__isoA2 : d.__countryCode, x = d.__regionName, m = x ?? d.name ?? "Unknown", C = Ue(b, x), N = Nt(C);
|
|
2504
2245
|
return `<div style="padding:6px 8px; font-size:12px; background:#111827; color:#f9fafb; border-radius:6px;">
|
|
2505
|
-
<div style="font-weight:700;">${
|
|
2506
|
-
${
|
|
2246
|
+
<div style="font-weight:700;">${m}</div>
|
|
2247
|
+
${N}
|
|
2507
2248
|
</div>`;
|
|
2508
2249
|
},
|
|
2509
|
-
onPolygonHover: (
|
|
2510
|
-
|
|
2250
|
+
onPolygonHover: (h) => {
|
|
2251
|
+
D(h ?? null);
|
|
2511
2252
|
},
|
|
2512
|
-
onPolygonClick: (
|
|
2513
|
-
onZoom:
|
|
2253
|
+
onPolygonClick: (h) => vt(h),
|
|
2254
|
+
onZoom: R,
|
|
2514
2255
|
onGlobeReady: () => {
|
|
2515
|
-
|
|
2256
|
+
E(), I(20, 15, 2.6);
|
|
2516
2257
|
},
|
|
2517
2258
|
onGlobeClick: () => {
|
|
2518
|
-
const
|
|
2519
|
-
|
|
2259
|
+
const h = s.current?.controls?.();
|
|
2260
|
+
h && (h.autoRotate = !1);
|
|
2520
2261
|
},
|
|
2521
2262
|
lineHoverPrecision: 0,
|
|
2522
|
-
width:
|
|
2523
|
-
height:
|
|
2263
|
+
width: le.width,
|
|
2264
|
+
height: le.height,
|
|
2524
2265
|
showAtmosphere: !1
|
|
2525
2266
|
}
|
|
2526
2267
|
)
|
|
@@ -2528,5 +2269,5 @@ const Ge = (t, e) => {
|
|
|
2528
2269
|
);
|
|
2529
2270
|
};
|
|
2530
2271
|
export {
|
|
2531
|
-
|
|
2272
|
+
Jn as CoolGlobe
|
|
2532
2273
|
};
|