gralobe 1.0.33 → 1.0.35
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/dist/gralobe.js +255 -137
- package/dist/gralobe.js.map +1 -1
- package/dist/gralobe.umd.cjs +2 -2
- package/dist/gralobe.umd.cjs.map +1 -1
- package/dist/index.d.ts +13 -0
- package/package.json +1 -1
package/dist/gralobe.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as A from "three";
|
|
2
|
-
import { Controls as
|
|
2
|
+
import { Controls as Ur, Vector3 as oe, MOUSE as nt, TOUCH as Je, Quaternion as Zi, Spherical as Ki, Vector2 as fe, Ray as zr, Plane as Nr, MathUtils as Br, Matrix4 as Mn, Object3D as $r } from "three";
|
|
3
3
|
function Ce(a) {
|
|
4
4
|
if (a === void 0)
|
|
5
5
|
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
@@ -35,8 +35,8 @@ var ue = {
|
|
|
35
35
|
return typeof window < "u";
|
|
36
36
|
}, Rt = function(e) {
|
|
37
37
|
return G(e) || K(e);
|
|
38
|
-
},
|
|
39
|
-
}, q = Array.isArray, hi = /(?:-?\.?\d|\.)+/gi, In = /[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g, et = /[-+=.]*\d+[.e-]*\d*[a-z%]*/g, Xt = /[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,
|
|
38
|
+
}, Ln = typeof ArrayBuffer == "function" && ArrayBuffer.isView || function() {
|
|
39
|
+
}, q = Array.isArray, hi = /(?:-?\.?\d|\.)+/gi, In = /[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g, et = /[-+=.]*\d+[.e-]*\d*[a-z%]*/g, Xt = /[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi, On = /[+-]=-?[.\d]+/, kn = /[^,'"\[\]\s]+/gi, Yr = /^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i, N, xe, ci, Si, de = {}, Bt = {}, Fn, Un = function(e) {
|
|
40
40
|
return (Bt = lt(e, de)) && ae;
|
|
41
41
|
}, Mi = function(e, t) {
|
|
42
42
|
return console.warn("Invalid property", e, "set to", t, "Missing plugin? gsap.registerPlugin()");
|
|
@@ -50,23 +50,23 @@ var ue = {
|
|
|
50
50
|
suppressEvents: !0,
|
|
51
51
|
isStart: !0,
|
|
52
52
|
kill: !1
|
|
53
|
-
},
|
|
53
|
+
}, Ft = {
|
|
54
54
|
suppressEvents: !0,
|
|
55
55
|
kill: !1
|
|
56
56
|
}, Kr = {
|
|
57
57
|
suppressEvents: !0
|
|
58
|
-
}, Di = {}, Ie = [], ui = {}, Nn, le = {}, qt = {}, Wi = 30,
|
|
58
|
+
}, Di = {}, Ie = [], ui = {}, Nn, le = {}, qt = {}, Wi = 30, Ut = [], Ri = "", Li = function(e) {
|
|
59
59
|
var t = e[0], i, n;
|
|
60
60
|
if (we(t) || G(t) || (e = [e]), !(i = (t._gsap || {}).harness)) {
|
|
61
|
-
for (n =
|
|
61
|
+
for (n = Ut.length; n-- && !Ut[n].targetTest(t); )
|
|
62
62
|
;
|
|
63
|
-
i =
|
|
63
|
+
i = Ut[n];
|
|
64
64
|
}
|
|
65
65
|
for (n = e.length; n--; )
|
|
66
66
|
e[n] && (e[n]._gsap || (e[n]._gsap = new hr(e[n], i))) || e.splice(n, 1);
|
|
67
67
|
return e;
|
|
68
68
|
}, He = function(e) {
|
|
69
|
-
return e._gsap ||
|
|
69
|
+
return e._gsap || Li(_e(e))[0]._gsap;
|
|
70
70
|
}, Bn = function(e, t, i) {
|
|
71
71
|
return (i = e[t]) && G(i) ? e[t]() : Ai(i) && e.getAttribute && e.getAttribute(t) || i;
|
|
72
72
|
}, ne = function(e, t) {
|
|
@@ -149,7 +149,7 @@ var ue = {
|
|
|
149
149
|
t._dirty = 1, t.totalDuration(), t = t.parent;
|
|
150
150
|
return e;
|
|
151
151
|
}, di = function(e, t, i, n) {
|
|
152
|
-
return e._startAt && (W ? e._startAt.revert(
|
|
152
|
+
return e._startAt && (W ? e._startAt.revert(Ft) : e.vars.immediateRender && !e.vars.autoRevert || e._startAt.render(t, !0, n));
|
|
153
153
|
}, Jr = function a(e) {
|
|
154
154
|
return !e || e._ts && a(e.parent);
|
|
155
155
|
}, qi = function(e) {
|
|
@@ -230,14 +230,14 @@ var ue = {
|
|
|
230
230
|
s.immediateRender = ie(o.immediateRender), e < 2 ? s.runBackwards = 1 : s.startAt = t[r - 1];
|
|
231
231
|
}
|
|
232
232
|
return new j(t[0], s, t[r + 1]);
|
|
233
|
-
},
|
|
233
|
+
}, Ue = function(e, t) {
|
|
234
234
|
return e || e === 0 ? t(e) : t;
|
|
235
235
|
}, Dt = function(e, t, i) {
|
|
236
236
|
return i < e ? e : i > t ? t : i;
|
|
237
237
|
}, X = function(e, t) {
|
|
238
238
|
return !K(e) || !(t = Yr.exec(e)) ? "" : t[1];
|
|
239
239
|
}, rs = function(e, t, i) {
|
|
240
|
-
return
|
|
240
|
+
return Ue(i, function(n) {
|
|
241
241
|
return Dt(e, t, n);
|
|
242
242
|
});
|
|
243
243
|
}, fi = [].slice, Kn = function(e, t) {
|
|
@@ -290,7 +290,7 @@ var ue = {
|
|
|
290
290
|
};
|
|
291
291
|
}, qn = function(e, t) {
|
|
292
292
|
var i = q(e), n, r;
|
|
293
|
-
return !i && we(e) && (n = i = e.radius || ge, e.values ? (e = _e(e.values), (r = !Te(e[0])) && (n *= n)) : e = gi(e.increment)),
|
|
293
|
+
return !i && we(e) && (n = i = e.radius || ge, e.values ? (e = _e(e.values), (r = !Te(e[0])) && (n *= n)) : e = gi(e.increment)), Ue(t, i ? G(e) ? function(s) {
|
|
294
294
|
return r = e(s), Math.abs(r - s) <= n ? r : s;
|
|
295
295
|
} : function(s) {
|
|
296
296
|
for (var o = parseFloat(r ? s.x : s), l = parseFloat(r ? s.y : 0), h = ge, c = 0, u = e.length, f, g; u--; )
|
|
@@ -298,7 +298,7 @@ var ue = {
|
|
|
298
298
|
return c = !n || h <= n ? e[c] : s, r || c === s || Te(s) ? c : c + X(s);
|
|
299
299
|
} : gi(e));
|
|
300
300
|
}, Qn = function(e, t, i, n) {
|
|
301
|
-
return
|
|
301
|
+
return Ue(q(e) ? !t : i === !0 ? !!(i = 0) : !n, function() {
|
|
302
302
|
return q(e) ? e[~~(Math.random() * e.length)] : (i = i || 1e-5) && (n = i < 1 ? Math.pow(10, (i + "").length - 2) : 1) && Math.floor(Math.round((e - i / 2 + Math.random() * (t - e + i * 0.99)) / i) * i * n) / n;
|
|
303
303
|
});
|
|
304
304
|
}, as = function() {
|
|
@@ -316,17 +316,17 @@ var ue = {
|
|
|
316
316
|
}, ls = function(e, t, i) {
|
|
317
317
|
return er(e, t, 0, 1, i);
|
|
318
318
|
}, Jn = function(e, t, i) {
|
|
319
|
-
return
|
|
319
|
+
return Ue(i, function(n) {
|
|
320
320
|
return e[~~t(n)];
|
|
321
321
|
});
|
|
322
322
|
}, hs = function a(e, t, i) {
|
|
323
323
|
var n = t - e;
|
|
324
|
-
return q(e) ? Jn(e, a(0, e.length), t) :
|
|
324
|
+
return q(e) ? Jn(e, a(0, e.length), t) : Ue(i, function(r) {
|
|
325
325
|
return (n + (r - e) % n) % n + e;
|
|
326
326
|
});
|
|
327
327
|
}, cs = function a(e, t, i) {
|
|
328
328
|
var n = t - e, r = n * 2;
|
|
329
|
-
return q(e) ? Jn(e, a(0, e.length - 1), t) :
|
|
329
|
+
return q(e) ? Jn(e, a(0, e.length - 1), t) : Ue(i, function(s) {
|
|
330
330
|
return s = (r + (s - e) % r) % r || 0, e + (s > n ? r - s : s);
|
|
331
331
|
});
|
|
332
332
|
}, Pt = function(e) {
|
|
@@ -335,7 +335,7 @@ var ue = {
|
|
|
335
335
|
return i + e.substr(t, e.length - t);
|
|
336
336
|
}, er = function(e, t, i, n, r) {
|
|
337
337
|
var s = t - e, o = n - i;
|
|
338
|
-
return
|
|
338
|
+
return Ue(r, function(l) {
|
|
339
339
|
return i + ((l - e) / s * o || 0);
|
|
340
340
|
});
|
|
341
341
|
}, us = function a(e, t, i, n) {
|
|
@@ -361,13 +361,13 @@ var ue = {
|
|
|
361
361
|
} else n || (e = lt(q(e) ? [] : {}, e));
|
|
362
362
|
if (!c) {
|
|
363
363
|
for (l in t)
|
|
364
|
-
|
|
364
|
+
Oi.call(o, e, l, "get", t[l]);
|
|
365
365
|
r = function(p) {
|
|
366
366
|
return zi(p, o) || (s ? e.p : e);
|
|
367
367
|
};
|
|
368
368
|
}
|
|
369
369
|
}
|
|
370
|
-
return
|
|
370
|
+
return Ue(i, r);
|
|
371
371
|
}, Ji = function(e, t, i) {
|
|
372
372
|
var n = e.labels, r = ge, s, o, l;
|
|
373
373
|
for (s in n)
|
|
@@ -387,56 +387,56 @@ var ue = {
|
|
|
387
387
|
} : e, r = {
|
|
388
388
|
init: wt,
|
|
389
389
|
render: zi,
|
|
390
|
-
add:
|
|
390
|
+
add: Oi,
|
|
391
391
|
kill: Ts,
|
|
392
392
|
modifier: As,
|
|
393
393
|
rawVars: 0
|
|
394
394
|
}, s = {
|
|
395
395
|
targetTest: 0,
|
|
396
396
|
get: 0,
|
|
397
|
-
getSetter:
|
|
397
|
+
getSetter: Ui,
|
|
398
398
|
aliases: {},
|
|
399
399
|
register: 0
|
|
400
400
|
};
|
|
401
401
|
if (ut(), e !== n) {
|
|
402
402
|
if (le[t])
|
|
403
403
|
return;
|
|
404
|
-
pe(n, pe(Gt(e, r), s)), lt(n.prototype, lt(r, Gt(e, s))), le[n.prop = t] = n, e.targetTest && (
|
|
404
|
+
pe(n, pe(Gt(e, r), s)), lt(n.prototype, lt(r, Gt(e, s))), le[n.prop = t] = n, e.targetTest && (Ut.push(n), Di[t] = 1), t = (t === "css" ? "CSS" : t.charAt(0).toUpperCase() + t.substr(1)) + "Plugin";
|
|
405
405
|
}
|
|
406
406
|
zn(t, n), e.register && e.register(ae, n, re);
|
|
407
407
|
} else
|
|
408
408
|
tr.push(e);
|
|
409
|
-
},
|
|
410
|
-
aqua: [0,
|
|
411
|
-
lime: [0,
|
|
409
|
+
}, O = 255, yt = {
|
|
410
|
+
aqua: [0, O, O],
|
|
411
|
+
lime: [0, O, 0],
|
|
412
412
|
silver: [192, 192, 192],
|
|
413
413
|
black: [0, 0, 0],
|
|
414
414
|
maroon: [128, 0, 0],
|
|
415
415
|
teal: [0, 128, 128],
|
|
416
|
-
blue: [0, 0,
|
|
416
|
+
blue: [0, 0, O],
|
|
417
417
|
navy: [0, 0, 128],
|
|
418
|
-
white: [
|
|
418
|
+
white: [O, O, O],
|
|
419
419
|
olive: [128, 128, 0],
|
|
420
|
-
yellow: [
|
|
421
|
-
orange: [
|
|
420
|
+
yellow: [O, O, 0],
|
|
421
|
+
orange: [O, 165, 0],
|
|
422
422
|
gray: [128, 128, 128],
|
|
423
423
|
purple: [128, 0, 128],
|
|
424
424
|
green: [0, 128, 0],
|
|
425
|
-
red: [
|
|
426
|
-
pink: [
|
|
427
|
-
cyan: [0,
|
|
428
|
-
transparent: [
|
|
425
|
+
red: [O, 0, 0],
|
|
426
|
+
pink: [O, 192, 203],
|
|
427
|
+
cyan: [0, O, O],
|
|
428
|
+
transparent: [O, O, O, 0]
|
|
429
429
|
}, Qt = function(e, t, i) {
|
|
430
|
-
return e += e < 0 ? 1 : e > 1 ? -1 : 0, (e * 6 < 1 ? t + (i - t) * e * 6 : e < 0.5 ? i : e * 3 < 2 ? t + (i - t) * (2 / 3 - e) * 6 : t) *
|
|
430
|
+
return e += e < 0 ? 1 : e > 1 ? -1 : 0, (e * 6 < 1 ? t + (i - t) * e * 6 : e < 0.5 ? i : e * 3 < 2 ? t + (i - t) * (2 / 3 - e) * 6 : t) * O + 0.5 | 0;
|
|
431
431
|
}, nr = function(e, t, i) {
|
|
432
|
-
var n = e ? Te(e) ? [e >> 16, e >> 8 &
|
|
432
|
+
var n = e ? Te(e) ? [e >> 16, e >> 8 & O, e & O] : 0 : yt.black, r, s, o, l, h, c, u, f, g, p;
|
|
433
433
|
if (!n) {
|
|
434
434
|
if (e.substr(-1) === "," && (e = e.substr(0, e.length - 1)), yt[e])
|
|
435
435
|
n = yt[e];
|
|
436
436
|
else if (e.charAt(0) === "#") {
|
|
437
437
|
if (e.length < 6 && (r = e.charAt(1), s = e.charAt(2), o = e.charAt(3), e = "#" + r + r + s + s + o + o + (e.length === 5 ? e.charAt(4) + e.charAt(4) : "")), e.length === 9)
|
|
438
|
-
return n = parseInt(e.substr(1, 6), 16), [n >> 16, n >> 8 &
|
|
439
|
-
e = parseInt(e.substr(1), 16), n = [e >> 16, e >> 8 &
|
|
438
|
+
return n = parseInt(e.substr(1, 6), 16), [n >> 16, n >> 8 & O, n & O, parseInt(e.substr(7), 16) / 255];
|
|
439
|
+
e = parseInt(e.substr(1), 16), n = [e >> 16, e >> 8 & O, e & O];
|
|
440
440
|
} else if (e.substr(0, 3) === "hsl") {
|
|
441
441
|
if (n = p = e.match(hi), !t)
|
|
442
442
|
l = +n[0] % 360 / 360, h = +n[1] / 100, c = +n[2] / 100, s = c <= 0.5 ? c * (h + 1) : c + h - c * h, r = c * 2 - s, n.length > 3 && (n[3] *= 1), n[0] = Qt(l + 1 / 3, r, s), n[1] = Qt(l, r, s), n[2] = Qt(l - 1 / 3, r, s);
|
|
@@ -446,34 +446,34 @@ var ue = {
|
|
|
446
446
|
n = e.match(hi) || yt.transparent;
|
|
447
447
|
n = n.map(Number);
|
|
448
448
|
}
|
|
449
|
-
return t && !p && (r = n[0] /
|
|
449
|
+
return t && !p && (r = n[0] / O, s = n[1] / O, o = n[2] / O, u = Math.max(r, s, o), f = Math.min(r, s, o), c = (u + f) / 2, u === f ? l = h = 0 : (g = u - f, h = c > 0.5 ? g / (2 - u - f) : g / (u + f), l = u === r ? (s - o) / g + (s < o ? 6 : 0) : u === s ? (o - r) / g + 2 : (r - s) / g + 4, l *= 60), n[0] = ~~(l + 0.5), n[1] = ~~(h * 100 + 0.5), n[2] = ~~(c * 100 + 0.5)), i && n.length < 4 && (n[3] = 1), n;
|
|
450
450
|
}, rr = function(e) {
|
|
451
451
|
var t = [], i = [], n = -1;
|
|
452
|
-
return e.split(
|
|
452
|
+
return e.split(Oe).forEach(function(r) {
|
|
453
453
|
var s = r.match(et) || [];
|
|
454
454
|
t.push.apply(t, s), i.push(n += s.length + 1);
|
|
455
455
|
}), t.c = i, t;
|
|
456
456
|
}, en = function(e, t, i) {
|
|
457
|
-
var n = "", r = (e + n).match(
|
|
457
|
+
var n = "", r = (e + n).match(Oe), s = t ? "hsla(" : "rgba(", o = 0, l, h, c, u;
|
|
458
458
|
if (!r)
|
|
459
459
|
return e;
|
|
460
460
|
if (r = r.map(function(f) {
|
|
461
461
|
return (f = nr(f, t, 1)) && s + (t ? f[0] + "," + f[1] + "%," + f[2] + "%," + f[3] : f.join(",")) + ")";
|
|
462
462
|
}), i && (c = rr(e), l = i.c, l.join(n) !== c.c.join(n)))
|
|
463
|
-
for (h = e.replace(
|
|
463
|
+
for (h = e.replace(Oe, "1").split(et), u = h.length - 1; o < u; o++)
|
|
464
464
|
n += h[o] + (~l.indexOf(o) ? r.shift() || s + "0,0,0,0)" : (c.length ? c : r.length ? r : i).shift());
|
|
465
465
|
if (!h)
|
|
466
|
-
for (h = e.split(
|
|
466
|
+
for (h = e.split(Oe), u = h.length - 1; o < u; o++)
|
|
467
467
|
n += h[o] + r[o];
|
|
468
468
|
return n + h[u];
|
|
469
|
-
},
|
|
469
|
+
}, Oe = (function() {
|
|
470
470
|
var a = "(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3,4}){1,2}\\b", e;
|
|
471
471
|
for (e in yt)
|
|
472
472
|
a += "|" + e + "\\b";
|
|
473
473
|
return new RegExp(a + ")", "gi");
|
|
474
474
|
})(), ds = /hsl[a]?\(/, sr = function(e) {
|
|
475
475
|
var t = e.join(" "), i;
|
|
476
|
-
if (
|
|
476
|
+
if (Oe.lastIndex = 0, Oe.test(t))
|
|
477
477
|
return i = ds.test(t), e[1] = en(e[1], i), e[0] = en(e[0], i, rr(e[1])), !0;
|
|
478
478
|
}, Ct, he = (function() {
|
|
479
479
|
var a = Date.now, e = 500, t = 33, i = a(), n = i, r = 1e3 / 240, s = r, o = [], l, h, c, u, f, g, p = function d(m) {
|
|
@@ -492,7 +492,7 @@ var ue = {
|
|
|
492
492
|
return f / (1e3 / (m || 60));
|
|
493
493
|
},
|
|
494
494
|
wake: function() {
|
|
495
|
-
|
|
495
|
+
Fn && (!ci && Ti() && (xe = ci = window, Si = xe.document || {}, de.gsap = ae, (xe.gsapVersions || (xe.gsapVersions = [])).push(ae.version), Un(Bt || xe.GreenSockGlobals || !xe.gsap && xe || {}), tr.forEach(ir)), c = typeof requestAnimationFrame < "u" && requestAnimationFrame, l && u.sleep(), h = c || function(m) {
|
|
496
496
|
return setTimeout(m, s - u.time * 1e3 + 1 | 0);
|
|
497
497
|
}, Ct = 1, p(2));
|
|
498
498
|
},
|
|
@@ -623,7 +623,7 @@ ne("onComplete,onUpdate,onStart,onRepeat,onReverseComplete,onInterrupt", functio
|
|
|
623
623
|
return Ri += a + "," + a + "Params,";
|
|
624
624
|
});
|
|
625
625
|
var hr = function(e, t) {
|
|
626
|
-
this.id = Vr++, e._gsap = this, this.target = e, this.harness = t, this.get = t ? t.get : Bn, this.set = t ? t.getSetter :
|
|
626
|
+
this.id = Vr++, e._gsap = this, this.target = e, this.harness = t, this.get = t ? t.get : Bn, this.set = t ? t.getSetter : Ui;
|
|
627
627
|
}, At = /* @__PURE__ */ (function() {
|
|
628
628
|
function a(t) {
|
|
629
629
|
this.vars = t, this._delay = +t.delay || 0, (this._repeat = t.repeat === 1 / 0 ? -2 : t.repeat || 0) && (this._rDelay = t.repeatDelay || 0, this._yoyo = !!t.yoyo || !!t.yoyoEase), this._ts = 1, ct(this, +t.duration, 1, 1), this.data = t.data, z && (this._ctx = z, z.data.push(this)), Ct || he.wake();
|
|
@@ -954,14 +954,14 @@ var ys = function(e, t, i, n, r, s, o) {
|
|
|
954
954
|
c: p.charAt(1) === "=" ? rt(m, p) - m : parseFloat(p) - m,
|
|
955
955
|
m: g && g < 4 ? Math.round : 0
|
|
956
956
|
}, h = Xt.lastIndex);
|
|
957
|
-
return l.c = h < n.length ? n.substring(h, n.length) : "", l.fp = o, (
|
|
958
|
-
},
|
|
957
|
+
return l.c = h < n.length ? n.substring(h, n.length) : "", l.fp = o, (On.test(n) || _) && (l.e = 0), this._pt = l, l;
|
|
958
|
+
}, Oi = function(e, t, i, n, r, s, o, l, h, c) {
|
|
959
959
|
G(n) && (n = n(r || 0, e, s));
|
|
960
|
-
var u = e[t], f = i !== "get" ? i : G(u) ? h ? e[t.indexOf("set") || !G(e["get" + t.substr(3)]) ? t : "get" + t.substr(3)](h) : e[t]() : u, g = G(u) ? h ? ws : pr :
|
|
960
|
+
var u = e[t], f = i !== "get" ? i : G(u) ? h ? e[t.indexOf("set") || !G(e["get" + t.substr(3)]) ? t : "get" + t.substr(3)](h) : e[t]() : u, g = G(u) ? h ? ws : pr : Fi, p;
|
|
961
961
|
if (K(n) && (~n.indexOf("random(") && (n = Pt(n)), n.charAt(1) === "=" && (p = rt(f, n) + (X(f) || 0), (p || p === 0) && (n = p))), !c || f !== n || _i)
|
|
962
962
|
return !isNaN(f * n) && n !== "" ? (p = new re(this._pt, e, t, +f || 0, n - (f || 0), typeof u == "boolean" ? Cs : fr, 0, g), h && (p.fp = h), o && p.modifier(o, this, e), this._pt = p) : (!u && !(t in e) && Mi(t, n), ys.call(this, e, t, f, n, g, l || ue.stringFilter, h));
|
|
963
963
|
}, xs = function(e, t, i, n, r) {
|
|
964
|
-
if (G(e) && (e = vt(e, r, t, i, n)), !we(e) || e.style && e.nodeType || q(e) ||
|
|
964
|
+
if (G(e) && (e = vt(e, r, t, i, n)), !we(e) || e.style && e.nodeType || q(e) || Ln(e))
|
|
965
965
|
return K(e) ? vt(e, r, t, i, n) : e;
|
|
966
966
|
var s = {}, o;
|
|
967
967
|
for (o in e)
|
|
@@ -974,9 +974,9 @@ var ys = function(e, t, i, n, r, s, o) {
|
|
|
974
974
|
h[o._props[c]] = l;
|
|
975
975
|
return o;
|
|
976
976
|
}, Me, _i, ki = function a(e, t, i) {
|
|
977
|
-
var n = e.vars, r = n.ease, s = n.startAt, o = n.immediateRender, l = n.lazy, h = n.onUpdate, c = n.runBackwards, u = n.yoyoEase, f = n.keyframes, g = n.autoRevert, p = e._dur, d = e._startAt, m = e._targets, _ = e.parent, y = _ && _.data === "nested" ? _.vars.targets : m, x = e._overwrite === "auto" && !Ci, b = e.timeline, v, P, E, C, w, S, D, T, R,
|
|
977
|
+
var n = e.vars, r = n.ease, s = n.startAt, o = n.immediateRender, l = n.lazy, h = n.onUpdate, c = n.runBackwards, u = n.yoyoEase, f = n.keyframes, g = n.autoRevert, p = e._dur, d = e._startAt, m = e._targets, _ = e.parent, y = _ && _.data === "nested" ? _.vars.targets : m, x = e._overwrite === "auto" && !Ci, b = e.timeline, v, P, E, C, w, S, D, T, R, L, $, U, F;
|
|
978
978
|
if (b && (!f || !r) && (r = "none"), e._ease = Ze(r, ot.ease), e._yEase = u ? ar(Ze(u === !0 ? r : u, ot.ease)) : 0, u && e._yoyo && !e._repeat && (u = e._yEase, e._yEase = e._ease, e._ease = u), e._from = !b && !!n.runBackwards, !b || f && !n.stagger) {
|
|
979
|
-
if (T = m[0] ? He(m[0]).harness : 0,
|
|
979
|
+
if (T = m[0] ? He(m[0]).harness : 0, U = T && n[T.prop], v = Gt(n, Di), d && (d._zTime < 0 && d.progress(1), t < 0 && c && o && !g ? d.render(-1, !0) : d.revert(c && p ? Ft : Zr), d._lazy = 0), s) {
|
|
980
980
|
if (ke(e._startAt = j.set(m, pe({
|
|
981
981
|
data: "isStart",
|
|
982
982
|
overwrite: !1,
|
|
@@ -989,7 +989,7 @@ var ys = function(e, t, i, n, r, s, o) {
|
|
|
989
989
|
return ce(e, "onUpdate");
|
|
990
990
|
},
|
|
991
991
|
stagger: 0
|
|
992
|
-
}, s))), e._startAt._dp = 0, e._startAt._sat = e, t < 0 && (W || !o && !g) && e._startAt.revert(
|
|
992
|
+
}, s))), e._startAt._dp = 0, e._startAt._sat = e, t < 0 && (W || !o && !g) && e._startAt.revert(Ft), o && p && t <= 0 && i <= 0) {
|
|
993
993
|
t && (e._zTime = t);
|
|
994
994
|
return;
|
|
995
995
|
}
|
|
@@ -1004,22 +1004,22 @@ var ys = function(e, t, i, n, r, s, o) {
|
|
|
1004
1004
|
stagger: 0,
|
|
1005
1005
|
parent: _
|
|
1006
1006
|
//ensures that nested tweens that had a stagger are handled properly, like gsap.from(".class", {y: gsap.utils.wrap([-100,100]), stagger: 0.5})
|
|
1007
|
-
}, v),
|
|
1007
|
+
}, v), U && (E[T.prop] = U), ke(e._startAt = j.set(m, E)), e._startAt._dp = 0, e._startAt._sat = e, t < 0 && (W ? e._startAt.revert(Ft) : e._startAt.render(-1, !0)), e._zTime = t, !o)
|
|
1008
1008
|
a(e._startAt, k, k);
|
|
1009
1009
|
else if (!t)
|
|
1010
1010
|
return;
|
|
1011
1011
|
}
|
|
1012
1012
|
for (e._pt = e._ptCache = 0, l = p && ie(l) || l && !p, P = 0; P < m.length; P++) {
|
|
1013
|
-
if (w = m[P], D = w._gsap ||
|
|
1014
|
-
|
|
1015
|
-
}), R.priority && (S = 1)), !T ||
|
|
1013
|
+
if (w = m[P], D = w._gsap || Li(m)[P]._gsap, e._ptLookup[P] = L = {}, ui[D.id] && Ie.length && $t(), $ = y === m ? P : y.indexOf(w), T && (R = new T()).init(w, U || v, e, $, y) !== !1 && (e._pt = C = new re(e._pt, w, R.name, 0, 1, R.render, R, 0, R.priority), R._props.forEach(function(ee) {
|
|
1014
|
+
L[ee] = C;
|
|
1015
|
+
}), R.priority && (S = 1)), !T || U)
|
|
1016
1016
|
for (E in v)
|
|
1017
|
-
le[E] && (R = cr(E, v, e, $, w, y)) ? R.priority && (S = 1) :
|
|
1018
|
-
e._op && e._op[P] && e.kill(w, e._op[P]), x && e._pt && (Me = e, N.killTweensOf(w,
|
|
1017
|
+
le[E] && (R = cr(E, v, e, $, w, y)) ? R.priority && (S = 1) : L[E] = C = Oi.call(e, w, E, "get", v[E], $, y, 0, n.stringFilter);
|
|
1018
|
+
e._op && e._op[P] && e.kill(w, e._op[P]), x && e._pt && (Me = e, N.killTweensOf(w, L, e.globalTime(t)), F = !e.parent, Me = 0), e._pt && l && (ui[D.id] = 1);
|
|
1019
1019
|
}
|
|
1020
1020
|
S && gr(e), e._onInit && e._onInit(e);
|
|
1021
1021
|
}
|
|
1022
|
-
e._onUpdate = h, e._initted = (!e._op || e._pt) && !
|
|
1022
|
+
e._onUpdate = h, e._initted = (!e._op || e._pt) && !F, f && t <= 0 && b.render(ge, !0, !0);
|
|
1023
1023
|
}, bs = function(e, t, i, n, r, s, o, l) {
|
|
1024
1024
|
var h = (e._pt && e._ptCache || (e._ptCache = {}))[t], c, u, f, g;
|
|
1025
1025
|
if (!h)
|
|
@@ -1071,8 +1071,8 @@ var j = /* @__PURE__ */ (function(a) {
|
|
|
1071
1071
|
function e(i, n, r, s) {
|
|
1072
1072
|
var o;
|
|
1073
1073
|
typeof n == "number" && (r.duration = n, n = r, r = null), o = a.call(this, s ? n : xt(n)) || this;
|
|
1074
|
-
var l = o.vars, h = l.duration, c = l.delay, u = l.immediateRender, f = l.stagger, g = l.overwrite, p = l.keyframes, d = l.defaults, m = l.scrollTrigger, _ = l.yoyoEase, y = n.parent || N, x = (q(i) ||
|
|
1075
|
-
if (o._targets = x.length ?
|
|
1074
|
+
var l = o.vars, h = l.duration, c = l.delay, u = l.immediateRender, f = l.stagger, g = l.overwrite, p = l.keyframes, d = l.defaults, m = l.scrollTrigger, _ = l.yoyoEase, y = n.parent || N, x = (q(i) || Ln(i) ? Te(i[0]) : "length" in n) ? [i] : _e(i), b, v, P, E, C, w, S, D;
|
|
1075
|
+
if (o._targets = x.length ? Li(x) : Et("GSAP target " + i + " not found. https://gsap.com", !ue.nullTargetWarn) || [], o._ptLookup = [], o._overwrite = g, p || f || Rt(h) || Rt(c)) {
|
|
1076
1076
|
if (n = o.vars, b = o.timeline = new J({
|
|
1077
1077
|
data: "nested",
|
|
1078
1078
|
defaults: d || {},
|
|
@@ -1088,23 +1088,23 @@ var j = /* @__PURE__ */ (function(a) {
|
|
|
1088
1088
|
xt(pe(b.vars.defaults, {
|
|
1089
1089
|
ease: "none"
|
|
1090
1090
|
})), b._ease = Ze(p.ease || n.ease || "none");
|
|
1091
|
-
var T = 0, R,
|
|
1091
|
+
var T = 0, R, L, $;
|
|
1092
1092
|
if (q(p))
|
|
1093
|
-
p.forEach(function(
|
|
1094
|
-
return b.to(x,
|
|
1093
|
+
p.forEach(function(U) {
|
|
1094
|
+
return b.to(x, U, ">");
|
|
1095
1095
|
}), b.duration();
|
|
1096
1096
|
else {
|
|
1097
1097
|
P = {};
|
|
1098
1098
|
for (C in p)
|
|
1099
1099
|
C === "ease" || C === "easeEach" || Es(C, p[C], P, p.easeEach);
|
|
1100
1100
|
for (C in P)
|
|
1101
|
-
for (R = P[C].sort(function(
|
|
1102
|
-
return
|
|
1101
|
+
for (R = P[C].sort(function(U, F) {
|
|
1102
|
+
return U.t - F.t;
|
|
1103
1103
|
}), T = 0, v = 0; v < R.length; v++)
|
|
1104
|
-
|
|
1105
|
-
ease:
|
|
1106
|
-
duration: (
|
|
1107
|
-
}, $[C] =
|
|
1104
|
+
L = R[v], $ = {
|
|
1105
|
+
ease: L.e,
|
|
1106
|
+
duration: (L.t - (v ? R[v - 1].t : 0)) / 100 * h
|
|
1107
|
+
}, $[C] = L.v, b.to(x, $, T), T += $.duration;
|
|
1108
1108
|
b.duration() < h && b.to({}, {
|
|
1109
1109
|
duration: h - b.duration()
|
|
1110
1110
|
});
|
|
@@ -1207,7 +1207,7 @@ ne("staggerTo,staggerFrom,staggerFromTo", function(a) {
|
|
|
1207
1207
|
return t.splice(a === "staggerFromTo" ? 5 : 4, 0, 0), e[a].apply(e, t);
|
|
1208
1208
|
};
|
|
1209
1209
|
});
|
|
1210
|
-
var
|
|
1210
|
+
var Fi = function(e, t, i) {
|
|
1211
1211
|
return e[t] = i;
|
|
1212
1212
|
}, pr = function(e, t, i) {
|
|
1213
1213
|
return e[t](i);
|
|
@@ -1215,8 +1215,8 @@ var Ui = function(e, t, i) {
|
|
|
1215
1215
|
return e[t](n.fp, i);
|
|
1216
1216
|
}, Ps = function(e, t, i) {
|
|
1217
1217
|
return e.setAttribute(t, i);
|
|
1218
|
-
},
|
|
1219
|
-
return G(e[t]) ? pr : Ai(e[t]) && e.setAttribute ? Ps :
|
|
1218
|
+
}, Ui = function(e, t) {
|
|
1219
|
+
return G(e[t]) ? pr : Ai(e[t]) && e.setAttribute ? Ps : Fi;
|
|
1220
1220
|
}, fr = function(e, t) {
|
|
1221
1221
|
return t.set(t.t, t.p, Math.round((t.s + t.c * e) * 1e6) / 1e6, t);
|
|
1222
1222
|
}, Cs = function(e, t) {
|
|
@@ -1254,7 +1254,7 @@ var Ui = function(e, t, i) {
|
|
|
1254
1254
|
e._pt = r;
|
|
1255
1255
|
}, re = /* @__PURE__ */ (function() {
|
|
1256
1256
|
function a(t, i, n, r, s, o, l, h, c) {
|
|
1257
|
-
this.t = i, this.s = r, this.c = s, this.p = n, this.r = o || fr, this.d = l || this, this.set = h ||
|
|
1257
|
+
this.t = i, this.s = r, this.c = s, this.p = n, this.r = o || fr, this.d = l || this, this.set = h || Fi, this.pr = c || 0, this._next = t, t && (t._prev = this);
|
|
1258
1258
|
}
|
|
1259
1259
|
var e = a.prototype;
|
|
1260
1260
|
return e.modifier = function(i, n, r) {
|
|
@@ -1487,7 +1487,7 @@ var Ke = [], zt = {}, Ms = [], tn = 0, Ds = 0, ti = function(e) {
|
|
|
1487
1487
|
interpolate: us,
|
|
1488
1488
|
shuffle: Wn
|
|
1489
1489
|
},
|
|
1490
|
-
install:
|
|
1490
|
+
install: Un,
|
|
1491
1491
|
effects: qt,
|
|
1492
1492
|
ticker: he,
|
|
1493
1493
|
updateRoot: J.updateRoot,
|
|
@@ -1519,7 +1519,7 @@ he.add(J.updateRoot);
|
|
|
1519
1519
|
tt = jt.to({}, {
|
|
1520
1520
|
duration: 0
|
|
1521
1521
|
});
|
|
1522
|
-
var
|
|
1522
|
+
var Ls = function(e, t) {
|
|
1523
1523
|
for (var i = e._pt; i && i.p !== t && i.op !== t && i.fp !== t; )
|
|
1524
1524
|
i = i._next;
|
|
1525
1525
|
return i;
|
|
@@ -1527,7 +1527,7 @@ var Os = function(e, t) {
|
|
|
1527
1527
|
var i = e._targets, n, r, s;
|
|
1528
1528
|
for (n in t)
|
|
1529
1529
|
for (r = i.length; r--; )
|
|
1530
|
-
s = e._ptLookup[r][n], s && (s = s.d) && (s._pt && (s =
|
|
1530
|
+
s = e._ptLookup[r][n], s && (s = s.d) && (s._pt && (s = Ls(s, n)), s && s.modifier && s.modifier(t[n], e, i[r], n));
|
|
1531
1531
|
}, ii = function(e, t) {
|
|
1532
1532
|
return {
|
|
1533
1533
|
name: e,
|
|
@@ -1570,7 +1570,7 @@ var Os = function(e, t) {
|
|
|
1570
1570
|
}
|
|
1571
1571
|
}, ii("roundProps", gi), ii("modifiers"), ii("snap", qn)) || jt;
|
|
1572
1572
|
j.version = J.version = ae.version = "3.13.0";
|
|
1573
|
-
|
|
1573
|
+
Fn = 1;
|
|
1574
1574
|
Ti() && ut();
|
|
1575
1575
|
M.Power0;
|
|
1576
1576
|
M.Power1;
|
|
@@ -1590,15 +1590,15 @@ M.Bounce;
|
|
|
1590
1590
|
M.Sine;
|
|
1591
1591
|
M.Expo;
|
|
1592
1592
|
M.Circ;
|
|
1593
|
-
var nn, De, st, Ni, Ve, rn, Bi,
|
|
1593
|
+
var nn, De, st, Ni, Ve, rn, Bi, Os = function() {
|
|
1594
1594
|
return typeof window < "u";
|
|
1595
|
-
}, Se = {}, Ge = 180 / Math.PI, at = Math.PI / 180, qe = Math.atan2, sn = 1e8, $i = /([A-Z])/g, ks = /(left|right|width|margin|padding|x)/i,
|
|
1595
|
+
}, Se = {}, Ge = 180 / Math.PI, at = Math.PI / 180, qe = Math.atan2, sn = 1e8, $i = /([A-Z])/g, ks = /(left|right|width|margin|padding|x)/i, Fs = /[\s,\(]\S/, ve = {
|
|
1596
1596
|
autoAlpha: "opacity,visibility",
|
|
1597
1597
|
scale: "scaleX,scaleY",
|
|
1598
1598
|
alpha: "opacity"
|
|
1599
1599
|
}, xi = function(e, t) {
|
|
1600
1600
|
return t.set(t.t, t.p, Math.round((t.s + t.c * e) * 1e4) / 1e4 + t.u, t);
|
|
1601
|
-
},
|
|
1601
|
+
}, Us = function(e, t) {
|
|
1602
1602
|
return t.set(t.t, t.p, e === 1 ? t.e : Math.round((t.s + t.c * e) * 1e4) / 1e4 + t.u, t);
|
|
1603
1603
|
}, zs = function(e, t) {
|
|
1604
1604
|
return t.set(t.t, t.p, e ? Math.round((t.s + t.c * e) * 1e4) / 1e4 + t.u : t.b, t);
|
|
@@ -1674,7 +1674,7 @@ var nn, De, st, Ni, Ve, rn, Bi, Ls = function() {
|
|
|
1674
1674
|
;
|
|
1675
1675
|
return s < 0 ? null : (s === 3 ? "ms" : s >= 0 ? an[s] : "") + e;
|
|
1676
1676
|
}, vi = function() {
|
|
1677
|
-
|
|
1677
|
+
Os() && window.document && (nn = window, De = nn.document, st = De.documentElement, Ve = bi("div") || {
|
|
1678
1678
|
style: {}
|
|
1679
1679
|
}, bi("div"), B = dt(B), se = B + "Origin", Ve.style.cssText = "border-width:0;line-height:0;position:absolute;padding:0", Er = !!dt("perspective"), Bi = ae.core.reverting, Ni = 1);
|
|
1680
1680
|
}, on = function(e) {
|
|
@@ -1719,7 +1719,7 @@ var nn, De, st, Ni, Ve, rn, Bi, Ls = function() {
|
|
|
1719
1719
|
}, Ks = {
|
|
1720
1720
|
grid: 1,
|
|
1721
1721
|
flex: 1
|
|
1722
|
-
},
|
|
1722
|
+
}, Fe = function a(e, t, i, n) {
|
|
1723
1723
|
var r = parseFloat(i) || 0, s = (i + "").trim().substr((r + "").length) || "px", o = Ve.style, l = ks.test(t), h = e.tagName.toLowerCase() === "svg", c = (h ? "client" : "offset") + (l ? "Width" : "Height"), u = 100, f = n === "px", g = n === "%", p, d, m, _;
|
|
1724
1724
|
if (n === s || !r || hn[n] || hn[s])
|
|
1725
1725
|
return r;
|
|
@@ -1735,7 +1735,7 @@ var nn, De, st, Ni, Ve, rn, Bi, Ls = function() {
|
|
|
1735
1735
|
return l && g && (m = He(d), m.time = he.time, m.width = d[c]), V(f ? p * r / u : p && r ? u / p * r : 0);
|
|
1736
1736
|
}, Ae = function(e, t, i, n) {
|
|
1737
1737
|
var r;
|
|
1738
|
-
return Ni || vi(), t in ve && t !== "transform" && (t = ve[t], ~t.indexOf(",") && (t = t.split(",")[0])), Se[t] && t !== "transform" ? (r = St(e, n), r = t !== "transformOrigin" ? r[t] : r.svg ? r.origin : Yt(ye(e, se)) + " " + r.zOrigin + "px") : (r = e.style[t], (!r || r === "auto" || n || ~(r + "").indexOf("calc(")) && (r = Ht[t] && Ht[t](e, t, i) || ye(e, t) || Bn(e, t) || (t === "opacity" ? 1 : 0))), i && !~(r + "").trim().indexOf(" ") ?
|
|
1738
|
+
return Ni || vi(), t in ve && t !== "transform" && (t = ve[t], ~t.indexOf(",") && (t = t.split(",")[0])), Se[t] && t !== "transform" ? (r = St(e, n), r = t !== "transformOrigin" ? r[t] : r.svg ? r.origin : Yt(ye(e, se)) + " " + r.zOrigin + "px") : (r = e.style[t], (!r || r === "auto" || n || ~(r + "").indexOf("calc(")) && (r = Ht[t] && Ht[t](e, t, i) || ye(e, t) || Bn(e, t) || (t === "opacity" ? 1 : 0))), i && !~(r + "").trim().indexOf(" ") ? Fe(e, t, r, i) + i : r;
|
|
1739
1739
|
}, Ws = function(e, t, i, n) {
|
|
1740
1740
|
if (!i || i === "none") {
|
|
1741
1741
|
var r = dt(t, e, 1), s = r && ye(e, r, 1);
|
|
@@ -1744,7 +1744,7 @@ var nn, De, st, Ni, Ve, rn, Bi, Ls = function() {
|
|
|
1744
1744
|
var o = new re(this._pt, e.style, t, 0, 1, mr), l = 0, h = 0, c, u, f, g, p, d, m, _, y, x, b, v;
|
|
1745
1745
|
if (o.b = i, o.e = n, i += "", n += "", n.substring(0, 6) === "var(--" && (n = ye(e, n.substring(4, n.indexOf(")")))), n === "auto" && (d = e.style[t], e.style[t] = n, n = ye(e, t) || n, d ? e.style[t] = d : We(e, t)), c = [i, n], sr(c), i = c[0], n = c[1], f = i.match(et) || [], v = n.match(et) || [], v.length) {
|
|
1746
1746
|
for (; u = et.exec(n); )
|
|
1747
|
-
m = u[0], y = n.substring(l, u.index), p ? p = (p + 1) % 5 : (y.substr(-5) === "rgba(" || y.substr(-5) === "hsla(") && (p = 1), m !== (d = f[h++] || "") && (g = parseFloat(d) || 0, b = d.substr((g + "").length), m.charAt(1) === "=" && (m = rt(g, m) + b), _ = parseFloat(m), x = m.substr((_ + "").length), l = et.lastIndex - x.length, x || (x = x || ue.units[t] || b, l === n.length && (n += x, o.e += x)), b !== x && (g =
|
|
1747
|
+
m = u[0], y = n.substring(l, u.index), p ? p = (p + 1) % 5 : (y.substr(-5) === "rgba(" || y.substr(-5) === "hsla(") && (p = 1), m !== (d = f[h++] || "") && (g = parseFloat(d) || 0, b = d.substr((g + "").length), m.charAt(1) === "=" && (m = rt(g, m) + b), _ = parseFloat(m), x = m.substr((_ + "").length), l = et.lastIndex - x.length, x || (x = x || ue.units[t] || b, l === n.length && (n += x, o.e += x)), b !== x && (g = Fe(e, t, d, x) || 0), o._pt = {
|
|
1748
1748
|
_next: o._pt,
|
|
1749
1749
|
p: y || h === 1 ? y : ",",
|
|
1750
1750
|
//note: SVG spec allows omission of comma/space when a negative sign is wedged between two numbers, like 2.5-5.3 instead of 2.5,-5.3 but when tweening, the negative value may switch to positive, so we insert the comma just in case.
|
|
@@ -1755,7 +1755,7 @@ var nn, De, st, Ni, Ve, rn, Bi, Ls = function() {
|
|
|
1755
1755
|
o.c = l < n.length ? n.substring(l, n.length) : "";
|
|
1756
1756
|
} else
|
|
1757
1757
|
o.r = t === "display" && n === "none" ? xr : yr;
|
|
1758
|
-
return
|
|
1758
|
+
return On.test(n) && (o.e = 0), this._pt = o, o;
|
|
1759
1759
|
}, cn = {
|
|
1760
1760
|
top: "0%",
|
|
1761
1761
|
bottom: "100%",
|
|
@@ -1860,13 +1860,13 @@ var nn, De, st, Ni, Ve, rn, Bi, Ls = function() {
|
|
|
1860
1860
|
var i = e._gsap || new hr(e);
|
|
1861
1861
|
if ("x" in i && !t && !i.uncache)
|
|
1862
1862
|
return i;
|
|
1863
|
-
var n = e.style, r = i.scaleX < 0, s = "px", o = "deg", l = getComputedStyle(e), h = ye(e, se) || "0", c, u, f, g, p, d, m, _, y, x, b, v, P, E, C, w, S, D, T, R,
|
|
1864
|
-
return c = u = f = d = m = _ = y = x = b = 0, g = p = 1, i.svg = !!(e.getCTM && Pr(e)), l.translate && ((l.translate !== "none" || l.scale !== "none" || l.rotate !== "none") && (n[B] = (l.translate !== "none" ? "translate3d(" + (l.translate + " 0 0").split(" ").slice(0, 3).join(", ") + ") " : "") + (l.rotate !== "none" ? "rotate(" + l.rotate + ") " : "") + (l.scale !== "none" ? "scale(" + l.scale.split(" ").join(",") + ") " : "") + (l[B] !== "none" ? l[B] : "")), n.scale = n.rotate = n.translate = "none"), E = Gi(e, i.svg), i.svg && (i.uncache ? (ee = e.getBBox(), h = i.xOrigin - ee.x + "px " + (i.yOrigin - ee.y) + "px",
|
|
1863
|
+
var n = e.style, r = i.scaleX < 0, s = "px", o = "deg", l = getComputedStyle(e), h = ye(e, se) || "0", c, u, f, g, p, d, m, _, y, x, b, v, P, E, C, w, S, D, T, R, L, $, U, F, ee, pt, ft, mt, ze, Yi, Pe, Ne;
|
|
1864
|
+
return c = u = f = d = m = _ = y = x = b = 0, g = p = 1, i.svg = !!(e.getCTM && Pr(e)), l.translate && ((l.translate !== "none" || l.scale !== "none" || l.rotate !== "none") && (n[B] = (l.translate !== "none" ? "translate3d(" + (l.translate + " 0 0").split(" ").slice(0, 3).join(", ") + ") " : "") + (l.rotate !== "none" ? "rotate(" + l.rotate + ") " : "") + (l.scale !== "none" ? "scale(" + l.scale.split(" ").join(",") + ") " : "") + (l[B] !== "none" ? l[B] : "")), n.scale = n.rotate = n.translate = "none"), E = Gi(e, i.svg), i.svg && (i.uncache ? (ee = e.getBBox(), h = i.xOrigin - ee.x + "px " + (i.yOrigin - ee.y) + "px", F = "") : F = !t && e.getAttribute("data-svg-origin"), Ei(e, F || h, !!F || i.originIsAbsolute, i.smooth !== !1, E)), v = i.xOrigin || 0, P = i.yOrigin || 0, E !== Tt && (D = E[0], T = E[1], R = E[2], L = E[3], c = $ = E[4], u = U = E[5], E.length === 6 ? (g = Math.sqrt(D * D + T * T), p = Math.sqrt(L * L + R * R), d = D || T ? qe(T, D) * Ge : 0, y = R || L ? qe(R, L) * Ge + d : 0, y && (p *= Math.abs(Math.cos(y * at))), i.svg && (c -= v - (v * D + P * R), u -= P - (v * T + P * L))) : (Ne = E[6], Yi = E[7], ft = E[8], mt = E[9], ze = E[10], Pe = E[11], c = E[12], u = E[13], f = E[14], C = qe(Ne, ze), m = C * Ge, C && (w = Math.cos(-C), S = Math.sin(-C), F = $ * w + ft * S, ee = U * w + mt * S, pt = Ne * w + ze * S, ft = $ * -S + ft * w, mt = U * -S + mt * w, ze = Ne * -S + ze * w, Pe = Yi * -S + Pe * w, $ = F, U = ee, Ne = pt), C = qe(-R, ze), _ = C * Ge, C && (w = Math.cos(-C), S = Math.sin(-C), F = D * w - ft * S, ee = T * w - mt * S, pt = R * w - ze * S, Pe = L * S + Pe * w, D = F, T = ee, R = pt), C = qe(T, D), d = C * Ge, C && (w = Math.cos(C), S = Math.sin(C), F = D * w + T * S, ee = $ * w + U * S, T = T * w - D * S, U = U * w - $ * S, D = F, $ = ee), m && Math.abs(m) + Math.abs(d) > 359.9 && (m = d = 0, _ = 180 - _), g = V(Math.sqrt(D * D + T * T + R * R)), p = V(Math.sqrt(U * U + Ne * Ne)), C = qe($, U), y = Math.abs(C) > 2e-4 ? C * Ge : 0, b = Pe ? 1 / (Pe < 0 ? -Pe : Pe) : 0), i.svg && (F = e.getAttribute("transform"), i.forceCSS = e.setAttribute("transform", "") || !Ar(ye(e, B)), F && e.setAttribute("transform", F))), Math.abs(y) > 90 && Math.abs(y) < 270 && (r ? (g *= -1, y += d <= 0 ? 180 : -180, d += d <= 0 ? 180 : -180) : (p *= -1, y += y <= 0 ? 180 : -180)), t = t || i.uncache, i.x = c - ((i.xPercent = c && (!t && i.xPercent || (Math.round(e.offsetWidth / 2) === Math.round(-c) ? -50 : 0))) ? e.offsetWidth * i.xPercent / 100 : 0) + s, i.y = u - ((i.yPercent = u && (!t && i.yPercent || (Math.round(e.offsetHeight / 2) === Math.round(-u) ? -50 : 0))) ? e.offsetHeight * i.yPercent / 100 : 0) + s, i.z = f + s, i.scaleX = V(g), i.scaleY = V(p), i.rotation = V(d) + o, i.rotationX = V(m) + o, i.rotationY = V(_) + o, i.skewX = y + o, i.skewY = x + o, i.transformPerspective = b + s, (i.zOrigin = parseFloat(h.split(" ")[2]) || !t && i.zOrigin || 0) && (n[se] = Yt(h)), i.xOffset = i.yOffset = 0, i.force3D = ue.force3D, i.renderTransform = i.svg ? Js : Er ? Tr : Qs, i.uncache = 0, i;
|
|
1865
1865
|
}, Yt = function(e) {
|
|
1866
1866
|
return (e = e.split(" "))[0] + " " + e[1];
|
|
1867
1867
|
}, ni = function(e, t, i) {
|
|
1868
1868
|
var n = X(t);
|
|
1869
|
-
return V(parseFloat(t) + parseFloat(
|
|
1869
|
+
return V(parseFloat(t) + parseFloat(Fe(e, "x", i + "px", n))) + n;
|
|
1870
1870
|
}, Qs = function(e, t) {
|
|
1871
1871
|
t.z = "0px", t.rotationY = t.rotationX = "0deg", t.force3D = 0, Tr(e, t);
|
|
1872
1872
|
}, Be = "0deg", gt = "0px", $e = ") ", Tr = function(e, t) {
|
|
@@ -1878,10 +1878,10 @@ var nn, De, st, Ni, Ve, rn, Bi, Ls = function() {
|
|
|
1878
1878
|
m !== gt && (b += "perspective(" + m + $e), (n || r) && (b += "translate(" + n + "%, " + r + "%) "), (v || s !== gt || o !== gt || l !== gt) && (b += l !== gt || v ? "translate3d(" + s + ", " + o + ", " + l + ") " : "translate(" + s + ", " + o + $e), h !== Be && (b += "rotate(" + h + $e), c !== Be && (b += "rotateY(" + c + $e), u !== Be && (b += "rotateX(" + u + $e), (f !== Be || g !== Be) && (b += "skew(" + f + ", " + g + $e), (p !== 1 || d !== 1) && (b += "scale(" + p + ", " + d + $e), y.style[B] = b || "translate(0, 0)";
|
|
1879
1879
|
}, Js = function(e, t) {
|
|
1880
1880
|
var i = t || this, n = i.xPercent, r = i.yPercent, s = i.x, o = i.y, l = i.rotation, h = i.skewX, c = i.skewY, u = i.scaleX, f = i.scaleY, g = i.target, p = i.xOrigin, d = i.yOrigin, m = i.xOffset, _ = i.yOffset, y = i.forceCSS, x = parseFloat(s), b = parseFloat(o), v, P, E, C, w;
|
|
1881
|
-
l = parseFloat(l), h = parseFloat(h), c = parseFloat(c), c && (c = parseFloat(c), h += c, l += c), l || h ? (l *= at, h *= at, v = Math.cos(l) * u, P = Math.sin(l) * u, E = Math.sin(l - h) * -f, C = Math.cos(l - h) * f, h && (c *= at, w = Math.tan(h - c), w = Math.sqrt(1 + w * w), E *= w, C *= w, c && (w = Math.tan(c), w = Math.sqrt(1 + w * w), v *= w, P *= w)), v = V(v), P = V(P), E = V(E), C = V(C)) : (v = u, C = f, P = E = 0), (x && !~(s + "").indexOf("px") || b && !~(o + "").indexOf("px")) && (x =
|
|
1881
|
+
l = parseFloat(l), h = parseFloat(h), c = parseFloat(c), c && (c = parseFloat(c), h += c, l += c), l || h ? (l *= at, h *= at, v = Math.cos(l) * u, P = Math.sin(l) * u, E = Math.sin(l - h) * -f, C = Math.cos(l - h) * f, h && (c *= at, w = Math.tan(h - c), w = Math.sqrt(1 + w * w), E *= w, C *= w, c && (w = Math.tan(c), w = Math.sqrt(1 + w * w), v *= w, P *= w)), v = V(v), P = V(P), E = V(E), C = V(C)) : (v = u, C = f, P = E = 0), (x && !~(s + "").indexOf("px") || b && !~(o + "").indexOf("px")) && (x = Fe(g, "x", s, "px"), b = Fe(g, "y", o, "px")), (p || d || m || _) && (x = V(x + p - (p * v + d * E) + m), b = V(b + d - (p * P + d * C) + _)), (n || r) && (w = g.getBBox(), x = V(x + n / 100 * w.width), b = V(b + r / 100 * w.height)), w = "matrix(" + v + "," + P + "," + E + "," + C + "," + x + "," + b + ")", g.setAttribute("transform", w), y && (g.style[B] = w);
|
|
1882
1882
|
}, ea = function(e, t, i, n, r) {
|
|
1883
1883
|
var s = 360, o = K(r), l = parseFloat(r) * (o && ~r.indexOf("rad") ? Ge : 1), h = l - n, c = n + h + "deg", u, f;
|
|
1884
|
-
return o && (u = r.split("_")[1], u === "short" && (h %= s, h !== h % (s / 2) && (h += h < 0 ? s : -s)), u === "cw" && h < 0 ? h = (h + s * sn) % s - ~~(h / s) * s : u === "ccw" && h > 0 && (h = (h - s * sn) % s - ~~(h / s) * s)), e._pt = f = new re(e._pt, t, i, n, h,
|
|
1884
|
+
return o && (u = r.split("_")[1], u === "short" && (h %= s, h !== h % (s / 2) && (h += h < 0 ? s : -s)), u === "cw" && h < 0 ? h = (h + s * sn) % s - ~~(h / s) * s : u === "ccw" && h > 0 && (h = (h - s * sn) % s - ~~(h / s) * s)), e._pt = f = new re(e._pt, t, i, n, h, Us), f.e = c, f.u = "deg", e._props.push(i), f;
|
|
1885
1885
|
}, dn = function(e, t) {
|
|
1886
1886
|
for (var i in t)
|
|
1887
1887
|
e[i] = t[i];
|
|
@@ -1890,7 +1890,7 @@ var nn, De, st, Ni, Ve, rn, Bi, Ls = function() {
|
|
|
1890
1890
|
var n = dn({}, i._gsap), r = "perspective,force3D,transformOrigin,svgOrigin", s = i.style, o, l, h, c, u, f, g, p;
|
|
1891
1891
|
n.svg ? (h = i.getAttribute("transform"), i.setAttribute("transform", ""), s[B] = t, o = St(i, 1), We(i, B), i.setAttribute("transform", h)) : (h = getComputedStyle(i)[B], s[B] = t, o = St(i, 1), s[B] = h);
|
|
1892
1892
|
for (l in Se)
|
|
1893
|
-
h = n[l], c = o[l], h !== c && r.indexOf(l) < 0 && (g = X(h), p = X(c), u = g !== p ?
|
|
1893
|
+
h = n[l], c = o[l], h !== c && r.indexOf(l) < 0 && (g = X(h), p = X(c), u = g !== p ? Fe(i, l, h, p) : parseFloat(h), f = parseFloat(c), e._pt = new re(e._pt, o, l, u, f - u, xi), e._pt.u = p || 0, e._props.push(l));
|
|
1894
1894
|
dn(o, n);
|
|
1895
1895
|
};
|
|
1896
1896
|
ne("padding,margin,Width,Radius", function(a, e) {
|
|
@@ -1922,7 +1922,7 @@ var Sr = {
|
|
|
1922
1922
|
if (g = typeof c, p = Ht[d], g === "function" && (c = c.call(i, n, e, r), g = typeof c), g === "string" && ~c.indexOf("random(") && (c = Pt(c)), p)
|
|
1923
1923
|
p(this, e, d, c, i) && (E = 1);
|
|
1924
1924
|
else if (d.substr(0, 2) === "--")
|
|
1925
|
-
h = (getComputedStyle(e).getPropertyValue(d) + "").trim(), c += "",
|
|
1925
|
+
h = (getComputedStyle(e).getPropertyValue(d) + "").trim(), c += "", Oe.lastIndex = 0, Oe.test(h) || (m = X(h), _ = X(c)), _ ? m !== _ && (h = Fe(e, d, h, _) + _) : m && (c += m), this.add(o, "setProperty", h, c, n, r, 0, 0, d), s.push(d), C.push(d, 0, o[d]);
|
|
1926
1926
|
else if (g !== "undefined") {
|
|
1927
1927
|
if (l && d in l ? (h = typeof l[d] == "function" ? l[d].call(i, n, e, r) : l[d], K(h) && ~h.indexOf("random(") && (h = Pt(h)), X(h + "") || h === "auto" || (h += ue.units[d] || X(Ae(e, d)) || ""), (h + "").charAt(1) === "=" && (h = Ae(e, d))) : h = Ae(e, d), f = parseFloat(h), y = g === "string" && c.charAt(1) === "=" && c.substr(0, 2), y && (c = c.substr(2)), u = parseFloat(c), d in ve && (d === "autoAlpha" && (f === 1 && Ae(e, "visibility") === "hidden" && u && (f = 0), C.push("visibility", 0, o.visibility), Re(this, o, "visibility", f ? "inherit" : "hidden", u ? "inherit" : "hidden", !u)), d !== "scale" && d !== "transform" && (d = ve[d], ~d.indexOf(",") && (d = d.split(",")[0]))), x = d in Se, x) {
|
|
1928
1928
|
if (this.styles.save(d), g === "string" && c.substring(0, 6) === "var(--" && (c = ye(e, c.substring(4, c.indexOf(")"))), u = parseFloat(c)), b || (v = e._gsap, v.renderTransform && !t.parseTransform || St(e, t.parseTransform), P = t.smoothOrigin !== !1 && v.smooth, b = this._pt = new re(this._pt, o, B, 0, 1, v.renderTransform, v, 0, -1), b.dep = 1), d === "scale")
|
|
@@ -1947,8 +1947,8 @@ var Sr = {
|
|
|
1947
1947
|
continue;
|
|
1948
1948
|
}
|
|
1949
1949
|
} else d in o || (d = dt(d) || d);
|
|
1950
|
-
if (x || (u || u === 0) && (f || f === 0) && !
|
|
1951
|
-
m = (h + "").substr((f + "").length), u || (u = 0), _ = X(c) || (d in ue.units ? ue.units[d] : m), m !== _ && (f =
|
|
1950
|
+
if (x || (u || u === 0) && (f || f === 0) && !Fs.test(c) && d in o)
|
|
1951
|
+
m = (h + "").substr((f + "").length), u || (u = 0), _ = X(c) || (d in ue.units ? ue.units[d] : m), m !== _ && (f = Fe(e, d, h, _)), this._pt = new re(this._pt, x ? v : o, d, f, (y ? rt(f, y + u) : u) - f, !x && (_ === "px" || d === "zIndex") && t.autoRound !== !1 ? Ns : xi), this._pt.u = _ || 0, m !== _ && _ !== "%" && (this._pt.b = h, this._pt.r = zs);
|
|
1952
1952
|
else if (d in o)
|
|
1953
1953
|
Ws.call(this, e, d, h, y ? y + c : c);
|
|
1954
1954
|
else if (d in e)
|
|
@@ -1973,7 +1973,7 @@ var Sr = {
|
|
|
1973
1973
|
aliases: ve,
|
|
1974
1974
|
getSetter: function(e, t, i) {
|
|
1975
1975
|
var n = ve[t];
|
|
1976
|
-
return n && n.indexOf(",") < 0 && (t = n), t in Se && t !== se && (e._gsap.x || Ae(e, "x")) ? i && rn === i ? t === "scale" ? Vs : Gs : (rn = i || {}) && (t === "scale" ? js : Hs) : e.style && !Ai(e.style[t]) ? Bs : ~t.indexOf("-") ? $s :
|
|
1976
|
+
return n && n.indexOf(",") < 0 && (t = n), t in Se && t !== se && (e._gsap.x || Ae(e, "x")) ? i && rn === i ? t === "scale" ? Vs : Gs : (rn = i || {}) && (t === "scale" ? js : Hs) : e.style && !Ai(e.style[t]) ? Bs : ~t.indexOf("-") ? $s : Ui(e, t);
|
|
1977
1977
|
},
|
|
1978
1978
|
core: {
|
|
1979
1979
|
_removeProperty: We,
|
|
@@ -3251,7 +3251,7 @@ class Vi {
|
|
|
3251
3251
|
}), e;
|
|
3252
3252
|
}
|
|
3253
3253
|
}
|
|
3254
|
-
const fn = { type: "change" }, ji = { type: "start" }, Mr = { type: "end" },
|
|
3254
|
+
const fn = { type: "change" }, ji = { type: "start" }, Mr = { type: "end" }, Lt = new zr(), mn = new Nr(), fa = Math.cos(70 * Br.DEG2RAD), Y = new oe(), te = 2 * Math.PI, I = {
|
|
3255
3255
|
NONE: -1,
|
|
3256
3256
|
ROTATE: 0,
|
|
3257
3257
|
DOLLY: 1,
|
|
@@ -3261,7 +3261,7 @@ const fn = { type: "change" }, ji = { type: "start" }, Mr = { type: "end" }, Ot
|
|
|
3261
3261
|
TOUCH_DOLLY_PAN: 5,
|
|
3262
3262
|
TOUCH_DOLLY_ROTATE: 6
|
|
3263
3263
|
}, si = 1e-6;
|
|
3264
|
-
class ma extends
|
|
3264
|
+
class ma extends Ur {
|
|
3265
3265
|
/**
|
|
3266
3266
|
* Constructs a new controls instance.
|
|
3267
3267
|
*
|
|
@@ -3360,7 +3360,7 @@ class ma extends Fr {
|
|
|
3360
3360
|
h.unproject(this.object), this.object.position.sub(h).add(o), this.object.updateMatrixWorld(), s = Y.length();
|
|
3361
3361
|
} else
|
|
3362
3362
|
console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."), this.zoomToCursor = !1;
|
|
3363
|
-
s !== null && (this.screenSpacePanning ? this.target.set(0, 0, -1).transformDirection(this.object.matrix).multiplyScalar(s).add(this.object.position) : (
|
|
3363
|
+
s !== null && (this.screenSpacePanning ? this.target.set(0, 0, -1).transformDirection(this.object.matrix).multiplyScalar(s).add(this.object.position) : (Lt.origin.copy(this.object.position), Lt.direction.set(0, 0, -1).transformDirection(this.object.matrix), Math.abs(this.object.up.dot(Lt.direction)) < fa ? this.object.lookAt(this.target) : (mn.setFromNormalAndCoplanarPoint(this.object.up, this.target), Lt.intersectPlane(mn, this.target))));
|
|
3364
3364
|
} else if (this.object.isOrthographicCamera) {
|
|
3365
3365
|
const s = this.object.zoom;
|
|
3366
3366
|
this.object.zoom = Math.max(this.minZoom, Math.min(this.maxZoom, this.object.zoom / this._scale)), s !== this.object.zoom && (this.object.updateProjectionMatrix(), r = !0);
|
|
@@ -4121,7 +4121,7 @@ function Ra(a) {
|
|
|
4121
4121
|
e[gn(t)] = i;
|
|
4122
4122
|
}), e;
|
|
4123
4123
|
}
|
|
4124
|
-
const It = 4096,
|
|
4124
|
+
const It = 4096, Ot = 2048, La = `
|
|
4125
4125
|
importScripts('https://unpkg.com/topojson-client@3.1.0/dist/topojson-client.min.js');
|
|
4126
4126
|
|
|
4127
4127
|
self.onmessage = async (e) => {
|
|
@@ -4196,7 +4196,7 @@ class it {
|
|
|
4196
4196
|
// Static cache to share loaded topology data across instances
|
|
4197
4197
|
static cache = /* @__PURE__ */ new Map();
|
|
4198
4198
|
constructor(e, t, i) {
|
|
4199
|
-
this.canvas = document.createElement("canvas"), this.canvas.width = It, this.canvas.height =
|
|
4199
|
+
this.canvas = document.createElement("canvas"), this.canvas.width = It, this.canvas.height = Ot, this.ctx = this.canvas.getContext("2d", { willReadFrequently: !0 }), this.onProgress = t, this.onTextureUpdate = i, this.topologyConfig = {
|
|
4200
4200
|
url: e?.url || "https://cdn.jsdelivr.net/npm/world-atlas@2/countries-110m.json",
|
|
4201
4201
|
objectName: e?.objectName || "countries",
|
|
4202
4202
|
disableNormalization: e?.disableNormalization || !1,
|
|
@@ -4244,7 +4244,7 @@ class it {
|
|
|
4244
4244
|
*/
|
|
4245
4245
|
loadInWorker(e, t, i) {
|
|
4246
4246
|
return new Promise((n, r) => {
|
|
4247
|
-
const s = new Blob([
|
|
4247
|
+
const s = new Blob([La], { type: "application/javascript" }), o = URL.createObjectURL(s), l = new Worker(o);
|
|
4248
4248
|
l.onmessage = (h) => {
|
|
4249
4249
|
URL.revokeObjectURL(o), l.terminate(), h.data.success ? n(h.data.features) : r(new Error(h.data.error));
|
|
4250
4250
|
}, l.onerror = (h) => {
|
|
@@ -4259,6 +4259,14 @@ class it {
|
|
|
4259
4259
|
for (; !this.loaded; )
|
|
4260
4260
|
await new Promise((e) => setTimeout(e, 100));
|
|
4261
4261
|
}
|
|
4262
|
+
/**
|
|
4263
|
+
* manually set features (e.g. for Urban Mapper)
|
|
4264
|
+
*/
|
|
4265
|
+
setFeatures(e) {
|
|
4266
|
+
e.forEach((t) => {
|
|
4267
|
+
t.path || (t.path = this.createPath(t));
|
|
4268
|
+
}), this.countries = e, this.loaded = !0;
|
|
4269
|
+
}
|
|
4262
4270
|
/**
|
|
4263
4271
|
* Render a choropleth texture for the given statistic
|
|
4264
4272
|
* Now supporting Progressive Rendering to prevent UI freezes
|
|
@@ -4266,7 +4274,7 @@ class it {
|
|
|
4266
4274
|
renderTexture(e) {
|
|
4267
4275
|
this.currentRenderId++;
|
|
4268
4276
|
const t = this.currentRenderId;
|
|
4269
|
-
if (this.ctx.fillStyle = "rgba(10, 20, 30, 0.9)", this.ctx.fillRect(0, 0, It,
|
|
4277
|
+
if (this.ctx.fillStyle = "rgba(10, 20, 30, 0.9)", this.ctx.fillRect(0, 0, It, Ot), this.onTextureUpdate?.(), !this.loaded)
|
|
4270
4278
|
return this.canvas;
|
|
4271
4279
|
const i = this.countries.length < 1500;
|
|
4272
4280
|
this.ctx.lineWidth = 0.5, this.ctx.strokeStyle = "rgba(0, 0, 0, 0.3)";
|
|
@@ -4318,7 +4326,7 @@ class it {
|
|
|
4318
4326
|
});
|
|
4319
4327
|
}
|
|
4320
4328
|
projectPoint(e, t) {
|
|
4321
|
-
const i = (e + 180) / 360 * It, n = (90 - t) / 180 *
|
|
4329
|
+
const i = (e + 180) / 360 * It, n = (90 - t) / 180 * Ot;
|
|
4322
4330
|
return [i, n];
|
|
4323
4331
|
}
|
|
4324
4332
|
interpolateColor(e, t) {
|
|
@@ -4343,7 +4351,7 @@ class it {
|
|
|
4343
4351
|
renderCustomTexture(e, t, i) {
|
|
4344
4352
|
this.currentRenderId++;
|
|
4345
4353
|
const n = this.currentRenderId;
|
|
4346
|
-
if (this.ctx.fillStyle = "rgba(10, 20, 30, 0.9)", this.ctx.fillRect(0, 0, It,
|
|
4354
|
+
if (this.ctx.fillStyle = "rgba(10, 20, 30, 0.9)", this.ctx.fillRect(0, 0, It, Ot), this.onTextureUpdate?.(), !this.loaded)
|
|
4347
4355
|
return this.canvas;
|
|
4348
4356
|
const r = this.topologyConfig?.disableNormalization ? e instanceof Map ? Object.fromEntries(e) : e : Ra(e), s = this.countries.length < 1500;
|
|
4349
4357
|
this.ctx.lineWidth = 0.5, this.ctx.strokeStyle = "rgba(0, 0, 0, 0.3)";
|
|
@@ -4418,7 +4426,7 @@ class Ia extends $r {
|
|
|
4418
4426
|
}
|
|
4419
4427
|
}
|
|
4420
4428
|
const Qe = new oe(), _n = new Mn(), yn = new Mn(), xn = new oe(), bn = new oe();
|
|
4421
|
-
class
|
|
4429
|
+
class Oa {
|
|
4422
4430
|
/**
|
|
4423
4431
|
* Constructs a new CSS2D renderer.
|
|
4424
4432
|
*
|
|
@@ -4582,7 +4590,7 @@ const ka = {
|
|
|
4582
4590
|
UY: [-33, -56],
|
|
4583
4591
|
CR: [10, -84],
|
|
4584
4592
|
PA: [9, -80]
|
|
4585
|
-
},
|
|
4593
|
+
}, Fa = /* @__PURE__ */ new Set([
|
|
4586
4594
|
"CN",
|
|
4587
4595
|
"IN",
|
|
4588
4596
|
"US",
|
|
@@ -4613,7 +4621,7 @@ const ka = {
|
|
|
4613
4621
|
"PK",
|
|
4614
4622
|
"BD",
|
|
4615
4623
|
"VN"
|
|
4616
|
-
]),
|
|
4624
|
+
]), Ua = /* @__PURE__ */ new Set(["CN", "IN", "US", "BR", "RU", "AU", "CA"]), za = /* @__PURE__ */ new Set(["RU", "CA", "US", "CN", "BR", "AU"]), Na = /* @__PURE__ */ new Set([
|
|
4617
4625
|
"IN",
|
|
4618
4626
|
"AR",
|
|
4619
4627
|
"KZ",
|
|
@@ -4696,7 +4704,7 @@ class $a {
|
|
|
4696
4704
|
globe = null;
|
|
4697
4705
|
camera = null;
|
|
4698
4706
|
constructor(e, t) {
|
|
4699
|
-
this.sphereRadius = t, this.labelRenderer = new
|
|
4707
|
+
this.sphereRadius = t, this.labelRenderer = new Oa();
|
|
4700
4708
|
const i = e.clientWidth || 800, n = e.clientHeight || 600;
|
|
4701
4709
|
this.labelRenderer.setSize(i, n), this.labelRenderer.domElement.style.position = "absolute", this.labelRenderer.domElement.style.top = "0", this.labelRenderer.domElement.style.left = "0", this.labelRenderer.domElement.style.pointerEvents = "none", this.labelRenderer.domElement.style.zIndex = "5", e.appendChild(this.labelRenderer.domElement), this.labelGroup = new A.Group(), this.injectStyles(), this.createLabels();
|
|
4702
4710
|
}
|
|
@@ -4847,10 +4855,10 @@ class $a {
|
|
|
4847
4855
|
n = !1;
|
|
4848
4856
|
break;
|
|
4849
4857
|
case "minimal":
|
|
4850
|
-
n =
|
|
4858
|
+
n = Ua.has(i);
|
|
4851
4859
|
break;
|
|
4852
4860
|
case "major":
|
|
4853
|
-
n =
|
|
4861
|
+
n = Fa.has(i);
|
|
4854
4862
|
break;
|
|
4855
4863
|
case "all":
|
|
4856
4864
|
case "capitals":
|
|
@@ -4992,13 +5000,13 @@ function ja(a, e, t, i, n = Rr(512), r = new Uint8Array(256), s = new Int32Array
|
|
|
4992
5000
|
}
|
|
4993
5001
|
}
|
|
4994
5002
|
var Ha = ja;
|
|
4995
|
-
function
|
|
5003
|
+
function Lr(a, e, t) {
|
|
4996
5004
|
return a << 8 & 63488 | e << 2 & 992 | t >> 3;
|
|
4997
5005
|
}
|
|
4998
5006
|
function Ir(a, e, t, i) {
|
|
4999
5007
|
return a >> 4 | e & 240 | (t & 240) << 4 | (i & 240) << 8;
|
|
5000
5008
|
}
|
|
5001
|
-
function
|
|
5009
|
+
function Or(a, e, t) {
|
|
5002
5010
|
return a >> 4 << 8 | e & 240 | t >> 4;
|
|
5003
5011
|
}
|
|
5004
5012
|
function kt(a, e, t) {
|
|
@@ -5031,11 +5039,11 @@ function Ya(a, e) {
|
|
|
5031
5039
|
f.rc += c, f.gc += h, f.bc += l, f.ac += o, f.cnt++;
|
|
5032
5040
|
}
|
|
5033
5041
|
else if (e === "rgb444") for (let r = 0; r < n; ++r) {
|
|
5034
|
-
let s = a[r], o = s >> 16 & 255, l = s >> 8 & 255, h = s & 255, c =
|
|
5042
|
+
let s = a[r], o = s >> 16 & 255, l = s >> 8 & 255, h = s & 255, c = Or(h, l, o), u = c in i ? i[c] : i[c] = oi();
|
|
5035
5043
|
u.rc += h, u.gc += l, u.bc += o, u.cnt++;
|
|
5036
5044
|
}
|
|
5037
5045
|
else for (let r = 0; r < n; ++r) {
|
|
5038
|
-
let s = a[r], o = s >> 16 & 255, l = s >> 8 & 255, h = s & 255, c =
|
|
5046
|
+
let s = a[r], o = s >> 16 & 255, l = s >> 8 & 255, h = s & 255, c = Lr(h, l, o), u = c in i ? i[c] : i[c] = oi();
|
|
5039
5047
|
u.rc += h, u.gc += l, u.bc += o, u.cnt++;
|
|
5040
5048
|
}
|
|
5041
5049
|
return i;
|
|
@@ -5046,10 +5054,10 @@ function Za(a, e, t = {}) {
|
|
|
5046
5054
|
if (!(a instanceof Uint8Array) && !(a instanceof Uint8ClampedArray)) throw new Error("quantize() expected RGBA Uint8Array data");
|
|
5047
5055
|
let l = new Uint32Array(a.buffer), h = t.useSqrt !== !1, c = i === "rgba4444", u = Ya(l, i), f = u.length, g = f - 1, p = new Uint32Array(f + 1);
|
|
5048
5056
|
for (var d = 0, m = 0; m < f; ++m) {
|
|
5049
|
-
let
|
|
5050
|
-
if (
|
|
5051
|
-
var _ = 1 /
|
|
5052
|
-
c && (
|
|
5057
|
+
let L = u[m];
|
|
5058
|
+
if (L != null) {
|
|
5059
|
+
var _ = 1 / L.cnt;
|
|
5060
|
+
c && (L.ac *= _), L.rc *= _, L.gc *= _, L.bc *= _, u[d++] = L;
|
|
5053
5061
|
}
|
|
5054
5062
|
}
|
|
5055
5063
|
Nt(e) / d < 0.022 && (h = !1);
|
|
@@ -5078,9 +5086,9 @@ function Za(a, e, t = {}) {
|
|
|
5078
5086
|
let T = [];
|
|
5079
5087
|
var R = 0;
|
|
5080
5088
|
for (m = 0; ; ++R) {
|
|
5081
|
-
let
|
|
5082
|
-
c && (
|
|
5083
|
-
let ee = c ? [
|
|
5089
|
+
let L = kt(Math.round(u[m].rc), 0, 255), $ = kt(Math.round(u[m].gc), 0, 255), U = kt(Math.round(u[m].bc), 0, 255), F = 255;
|
|
5090
|
+
c && (F = kt(Math.round(u[m].ac), 0, 255), o && (F = F <= (typeof o == "number" ? o : 127) ? 0 : 255), n && F <= s && (L = $ = U = r, F = 0));
|
|
5091
|
+
let ee = c ? [L, $, U, F] : [L, $, U];
|
|
5084
5092
|
if (Ka(T, ee) || T.push(ee), (m = u[m].fw) == 0) break;
|
|
5085
5093
|
}
|
|
5086
5094
|
return T;
|
|
@@ -5102,7 +5110,7 @@ function Wa(a, e, t = "rgb565") {
|
|
|
5102
5110
|
s[l] = d;
|
|
5103
5111
|
}
|
|
5104
5112
|
else {
|
|
5105
|
-
let l = t === "rgb444" ?
|
|
5113
|
+
let l = t === "rgb444" ? Or : Lr;
|
|
5106
5114
|
for (let h = 0; h < n; h++) {
|
|
5107
5115
|
let c = i[h], u = c >> 16 & 255, f = c >> 8 & 255, g = c & 255, p = l(g, f, u), d = p in o ? o[p] : o[p] = qa(g, f, u, e);
|
|
5108
5116
|
s[h] = d;
|
|
@@ -5171,14 +5179,14 @@ function Qa(a = {}) {
|
|
|
5171
5179
|
function Ja(a, e, t, i, n) {
|
|
5172
5180
|
a.writeByte(33), a.writeByte(249), a.writeByte(4), n < 0 && (n = 0, i = !1);
|
|
5173
5181
|
var r, s;
|
|
5174
|
-
i ? (r = 1, s = 2) : (r = 0, s = 0), e >= 0 && (s = e & 7), s <<= 2, a.writeByte(0 | s | 0 | r),
|
|
5182
|
+
i ? (r = 1, s = 2) : (r = 0, s = 0), e >= 0 && (s = e & 7), s <<= 2, a.writeByte(0 | s | 0 | r), Le(a, t), a.writeByte(n || 0), a.writeByte(0);
|
|
5175
5183
|
}
|
|
5176
5184
|
function eo(a, e, t, i, n = 8) {
|
|
5177
5185
|
let r = 1, s = 0, o = Hi(i.length) - 1, l = r << 7 | n - 1 << 4 | s << 3 | o;
|
|
5178
|
-
|
|
5186
|
+
Le(a, e), Le(a, t), a.writeBytes([l, 0, 0]);
|
|
5179
5187
|
}
|
|
5180
5188
|
function to(a, e) {
|
|
5181
|
-
a.writeByte(33), a.writeByte(255), a.writeByte(11), kr(a, "NETSCAPE2.0"), a.writeByte(3), a.writeByte(1),
|
|
5189
|
+
a.writeByte(33), a.writeByte(255), a.writeByte(11), kr(a, "NETSCAPE2.0"), a.writeByte(3), a.writeByte(1), Le(a, e), a.writeByte(0);
|
|
5182
5190
|
}
|
|
5183
5191
|
function wn(a, e) {
|
|
5184
5192
|
let t = 1 << Hi(e.length);
|
|
@@ -5188,7 +5196,7 @@ function wn(a, e) {
|
|
|
5188
5196
|
}
|
|
5189
5197
|
}
|
|
5190
5198
|
function io(a, e, t, i) {
|
|
5191
|
-
if (a.writeByte(44),
|
|
5199
|
+
if (a.writeByte(44), Le(a, 0), Le(a, 0), Le(a, e), Le(a, t), i) {
|
|
5192
5200
|
let n = 0, r = 0, s = Hi(i.length) - 1;
|
|
5193
5201
|
a.writeByte(128 | n | r | 0 | s);
|
|
5194
5202
|
} else a.writeByte(0);
|
|
@@ -5196,7 +5204,7 @@ function io(a, e, t, i) {
|
|
|
5196
5204
|
function no(a, e, t, i, n = 8, r, s, o) {
|
|
5197
5205
|
Ha(t, i, e, n, a, r, s, o);
|
|
5198
5206
|
}
|
|
5199
|
-
function
|
|
5207
|
+
function Le(a, e) {
|
|
5200
5208
|
a.writeByte(e & 255), a.writeByte(e >> 8 & 255);
|
|
5201
5209
|
}
|
|
5202
5210
|
function kr(a, e) {
|
|
@@ -5449,14 +5457,14 @@ const Pn = {
|
|
|
5449
5457
|
index: (a) => a.toFixed(3),
|
|
5450
5458
|
"": (a) => a.toFixed(3)
|
|
5451
5459
|
}, so = ["per capita", "per 100", "per 1000"];
|
|
5452
|
-
function
|
|
5460
|
+
function Fr(a) {
|
|
5453
5461
|
return Pn[a] ? Pn[a] : so.some((e) => a.includes(e)) ? (e) => `${e.toFixed(1)}` : (e) => {
|
|
5454
5462
|
const t = Number.isInteger(e) ? e.toLocaleString() : e.toFixed(1);
|
|
5455
5463
|
return a ? `${t} ${a}` : t;
|
|
5456
5464
|
};
|
|
5457
5465
|
}
|
|
5458
|
-
function
|
|
5459
|
-
return (t ??
|
|
5466
|
+
function Eo(a, e, t) {
|
|
5467
|
+
return (t ?? Fr(e))(a);
|
|
5460
5468
|
}
|
|
5461
5469
|
let Cn = !1;
|
|
5462
5470
|
function ao() {
|
|
@@ -5627,7 +5635,7 @@ class oo {
|
|
|
5627
5635
|
t.textContent = e.name, s.textContent = e.description;
|
|
5628
5636
|
const [o, l, h] = e.colorScale;
|
|
5629
5637
|
i.style.background = `linear-gradient(to right, ${o}, ${l}, ${h})`;
|
|
5630
|
-
const c = e.format ??
|
|
5638
|
+
const c = e.format ?? Fr(e.unit);
|
|
5631
5639
|
n.textContent = c(e.domain[0]), r.textContent = c(e.domain[1]), this.element.classList.add("visible"), this.visible = !0;
|
|
5632
5640
|
}
|
|
5633
5641
|
hide() {
|
|
@@ -6487,6 +6495,102 @@ const Pi = {
|
|
|
6487
6495
|
}
|
|
6488
6496
|
};
|
|
6489
6497
|
Pi.lifeExpectancy;
|
|
6498
|
+
const xo = "https://raw.githubusercontent.com/nvkelso/natural-earth-vector/master/geojson/ne_10m_urban_areas.geojson";
|
|
6499
|
+
class bo {
|
|
6500
|
+
static urbanFeatures = null;
|
|
6501
|
+
static isLoading = !1;
|
|
6502
|
+
static loadPromise = null;
|
|
6503
|
+
/**
|
|
6504
|
+
* Load the base urban areas topology
|
|
6505
|
+
*/
|
|
6506
|
+
static async loadBaseTopology() {
|
|
6507
|
+
return this.urbanFeatures ? this.urbanFeatures : this.loadPromise ? this.loadPromise : (this.isLoading = !0, this.loadPromise = (async () => {
|
|
6508
|
+
try {
|
|
6509
|
+
const e = await fetch(xo);
|
|
6510
|
+
if (!e.ok) throw new Error("Failed to load urban areas");
|
|
6511
|
+
const t = await e.json();
|
|
6512
|
+
return this.urbanFeatures = t.features, this.urbanFeatures || [];
|
|
6513
|
+
} catch (e) {
|
|
6514
|
+
return console.error("UrbanMapper load error:", e), [];
|
|
6515
|
+
} finally {
|
|
6516
|
+
this.isLoading = !1;
|
|
6517
|
+
}
|
|
6518
|
+
})(), this.loadPromise);
|
|
6519
|
+
}
|
|
6520
|
+
/**
|
|
6521
|
+
* Generate a synthetic circular polygon (approximate) for a point
|
|
6522
|
+
* @param lat Latitude
|
|
6523
|
+
* @param lon Longitude
|
|
6524
|
+
* @param radiusKm Radius in km (default 5km)
|
|
6525
|
+
*/
|
|
6526
|
+
static generateSyntheticBoundary(e, t, i = 20) {
|
|
6527
|
+
const r = [], o = i / 6371 * (180 / Math.PI), l = o / Math.cos(e * Math.PI / 180);
|
|
6528
|
+
for (let h = 0; h <= 16; h++) {
|
|
6529
|
+
const c = h / 16 * 2 * Math.PI, u = e + o * Math.sin(c), f = t + l * Math.cos(c);
|
|
6530
|
+
r.push([f, u]);
|
|
6531
|
+
}
|
|
6532
|
+
return {
|
|
6533
|
+
type: "Feature",
|
|
6534
|
+
id: `synthetic_${e.toFixed(4)}_${t.toFixed(4)}`,
|
|
6535
|
+
properties: {
|
|
6536
|
+
name: "Unknown City",
|
|
6537
|
+
featurecla: "Synthetic Urban Area"
|
|
6538
|
+
},
|
|
6539
|
+
geometry: {
|
|
6540
|
+
type: "Polygon",
|
|
6541
|
+
coordinates: [r]
|
|
6542
|
+
}
|
|
6543
|
+
};
|
|
6544
|
+
}
|
|
6545
|
+
/**
|
|
6546
|
+
* Map points to urban areas or generate synthetic ones
|
|
6547
|
+
*/
|
|
6548
|
+
static async mapPointsToTopology(e) {
|
|
6549
|
+
const t = await this.loadBaseTopology(), i = [], n = {}, r = /* @__PURE__ */ new Set();
|
|
6550
|
+
for (const s of e) {
|
|
6551
|
+
let o = null;
|
|
6552
|
+
for (const l of t)
|
|
6553
|
+
if (this.isPointInFeature(s, l)) {
|
|
6554
|
+
o = l;
|
|
6555
|
+
break;
|
|
6556
|
+
}
|
|
6557
|
+
if (o) {
|
|
6558
|
+
const l = o.properties.name_conve || o.properties.name || `ua_${Math.random()}`, h = r.has(l) ? null : JSON.parse(JSON.stringify(o));
|
|
6559
|
+
h && (h.id = l, i.push(h), r.add(l)), n[l] = (n[l] || 0) + s.value;
|
|
6560
|
+
} else {
|
|
6561
|
+
const l = this.generateSyntheticBoundary(s.lat, s.lon);
|
|
6562
|
+
s.id && (l.id = s.id), i.push(l), n[l.id] = s.value;
|
|
6563
|
+
}
|
|
6564
|
+
}
|
|
6565
|
+
return {
|
|
6566
|
+
features: i,
|
|
6567
|
+
statistics: n
|
|
6568
|
+
};
|
|
6569
|
+
}
|
|
6570
|
+
// Minimal Ray-Casting algorithm for Polygon/MultiPolygon
|
|
6571
|
+
static isPointInFeature(e, t) {
|
|
6572
|
+
const { lat: i, lon: n } = e, r = t.geometry;
|
|
6573
|
+
if (!r) return !1;
|
|
6574
|
+
const s = r.coordinates;
|
|
6575
|
+
if (r.type === "Polygon")
|
|
6576
|
+
return this.pointInPolygon([n, i], s);
|
|
6577
|
+
if (r.type === "MultiPolygon") {
|
|
6578
|
+
for (const o of s)
|
|
6579
|
+
if (this.pointInPolygon([n, i], o)) return !0;
|
|
6580
|
+
}
|
|
6581
|
+
return !1;
|
|
6582
|
+
}
|
|
6583
|
+
static pointInPolygon(e, t) {
|
|
6584
|
+
const i = e[0], n = e[1];
|
|
6585
|
+
let r = !1;
|
|
6586
|
+
const s = t[0];
|
|
6587
|
+
for (let o = 0, l = s.length - 1; o < s.length; l = o++) {
|
|
6588
|
+
const h = s[o][0], c = s[o][1], u = s[l][0], f = s[l][1];
|
|
6589
|
+
c > n != f > n && i < (u - h) * (n - c) / (f - c) + h && (r = !r);
|
|
6590
|
+
}
|
|
6591
|
+
return r;
|
|
6592
|
+
}
|
|
6593
|
+
}
|
|
6490
6594
|
const Tn = {
|
|
6491
6595
|
satellite: "https://raw.githubusercontent.com/mrdoob/three.js/dev/examples/textures/planets/earth_atmos_2048.jpg",
|
|
6492
6596
|
natural: "https://raw.githubusercontent.com/mrdoob/three.js/dev/examples/textures/planets/earth_day_4096.jpg",
|
|
@@ -6510,7 +6614,7 @@ const Tn = {
|
|
|
6510
6614
|
},
|
|
6511
6615
|
extrudeHeight: !1
|
|
6512
6616
|
};
|
|
6513
|
-
class
|
|
6617
|
+
class wo {
|
|
6514
6618
|
container;
|
|
6515
6619
|
config;
|
|
6516
6620
|
// Three.js core
|
|
@@ -6946,6 +7050,20 @@ class vo {
|
|
|
6946
7050
|
setMarkers(e, t) {
|
|
6947
7051
|
this.markerLayer ? t && this.markerLayer.setConfig(t) : (this.markerLayer = new yo(t), this.scene.add(this.markerLayer.getGroup()), this.markerLayer.setMorph(this.morph)), this.markerLayer.setMarkers(e);
|
|
6948
7052
|
}
|
|
7053
|
+
async setUrbanData(e) {
|
|
7054
|
+
if (!this.choropleth) return;
|
|
7055
|
+
const t = await bo.mapPointsToTopology(e);
|
|
7056
|
+
this.choropleth.setFeatures(t.features);
|
|
7057
|
+
const i = [
|
|
7058
|
+
"#ffffb2",
|
|
7059
|
+
"#fd8d3c",
|
|
7060
|
+
"#bd0026"
|
|
7061
|
+
], n = Object.values(t.statistics), r = Math.max(...n, 1);
|
|
7062
|
+
this.choropleth.renderCustomTexture(t.statistics, i, [
|
|
7063
|
+
0,
|
|
7064
|
+
r
|
|
7065
|
+
]), this.material && (this.material.uniforms.uCityLights.value = 1, this.config.effects.cityLights = !0), this.countryLabels && (this.countryLabels.getGroup().visible = !1);
|
|
7066
|
+
}
|
|
6949
7067
|
resize(e, t) {
|
|
6950
7068
|
this.config.width = e, this.config.height = t, this.handleResize();
|
|
6951
7069
|
}
|
|
@@ -6964,10 +7082,10 @@ class vo {
|
|
|
6964
7082
|
}
|
|
6965
7083
|
export {
|
|
6966
7084
|
Pi as BUILT_IN_STATISTICS,
|
|
6967
|
-
|
|
7085
|
+
wo as GlobeViz,
|
|
6968
7086
|
Dr as WORLD_STATISTICS,
|
|
6969
|
-
|
|
6970
|
-
|
|
7087
|
+
Fr as createFormatter,
|
|
7088
|
+
Eo as formatValue,
|
|
6971
7089
|
Ra as normalizeCountryValues,
|
|
6972
7090
|
gn as toNumericCode
|
|
6973
7091
|
};
|