@liquidcars/atlas 0.1.43 → 0.1.45
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 +19 -6
- package/dist/liquidcars-atlas.js +756 -557
- package/dist/liquidcars-atlas.js.map +1 -1
- package/package.json +1 -1
- package/src/liquidcars-atlas.js +358 -41
package/dist/liquidcars-atlas.js
CHANGED
|
@@ -42,54 +42,54 @@ function M(e, t) {
|
|
|
42
42
|
function N(e, t, n, r, i) {
|
|
43
43
|
return r + (e - t) * (i - r) / (n - t);
|
|
44
44
|
}
|
|
45
|
-
function
|
|
45
|
+
function P(e, t, n) {
|
|
46
46
|
return e === t ? 0 : (n - e) / (t - e);
|
|
47
47
|
}
|
|
48
|
-
function
|
|
48
|
+
function F(e, t, n) {
|
|
49
49
|
return (1 - n) * e + n * t;
|
|
50
50
|
}
|
|
51
|
-
function
|
|
52
|
-
return
|
|
51
|
+
function I(e, t, n, r) {
|
|
52
|
+
return F(e, t, 1 - Math.exp(-n * r));
|
|
53
53
|
}
|
|
54
|
-
function
|
|
54
|
+
function ee(e, t = 1) {
|
|
55
55
|
return t - Math.abs(M(e, t * 2) - t);
|
|
56
56
|
}
|
|
57
|
-
function
|
|
57
|
+
function te(e, t, n) {
|
|
58
58
|
return e <= t ? 0 : e >= n ? 1 : (e = (e - t) / (n - t), e * e * (3 - 2 * e));
|
|
59
59
|
}
|
|
60
|
-
function
|
|
60
|
+
function L(e, t, n) {
|
|
61
61
|
return e <= t ? 0 : e >= n ? 1 : (e = (e - t) / (n - t), e * e * e * (e * (e * 6 - 15) + 10));
|
|
62
62
|
}
|
|
63
|
-
function
|
|
63
|
+
function ne(e, t) {
|
|
64
64
|
return e + Math.floor(Math.random() * (t - e + 1));
|
|
65
65
|
}
|
|
66
|
-
function
|
|
66
|
+
function re(e, t) {
|
|
67
67
|
return e + Math.random() * (t - e);
|
|
68
68
|
}
|
|
69
|
-
function
|
|
69
|
+
function R(e) {
|
|
70
70
|
return e * (.5 - Math.random());
|
|
71
71
|
}
|
|
72
|
-
function
|
|
72
|
+
function z(e) {
|
|
73
73
|
e !== void 0 && (D = e);
|
|
74
74
|
let t = D += 1831565813;
|
|
75
75
|
return t = Math.imul(t ^ t >>> 15, t | 1), t ^= t + Math.imul(t ^ t >>> 7, t | 61), ((t ^ t >>> 14) >>> 0) / 4294967296;
|
|
76
76
|
}
|
|
77
|
-
function
|
|
77
|
+
function B(e) {
|
|
78
78
|
return e * O;
|
|
79
79
|
}
|
|
80
|
-
function
|
|
80
|
+
function ie(e) {
|
|
81
81
|
return e * k;
|
|
82
82
|
}
|
|
83
|
-
function
|
|
83
|
+
function ae(e) {
|
|
84
84
|
return !(e & e - 1) && e !== 0;
|
|
85
85
|
}
|
|
86
|
-
function
|
|
86
|
+
function oe(e) {
|
|
87
87
|
return 2 ** Math.ceil(Math.log(e) / Math.LN2);
|
|
88
88
|
}
|
|
89
|
-
function
|
|
89
|
+
function se(e) {
|
|
90
90
|
return 2 ** Math.floor(Math.log(e) / Math.LN2);
|
|
91
91
|
}
|
|
92
|
-
function
|
|
92
|
+
function ce(e, t, n, r, i) {
|
|
93
93
|
let a = Math.cos, o = Math.sin, s = a(n / 2), c = o(n / 2), l = a((t + r) / 2), u = o((t + r) / 2), d = a((t - r) / 2), f = o((t - r) / 2), p = a((r - t) / 2), m = o((r - t) / 2);
|
|
94
94
|
switch (i) {
|
|
95
95
|
case "XYX":
|
|
@@ -113,7 +113,7 @@ function le(e, t, n, r, i) {
|
|
|
113
113
|
default: console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: " + i);
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
|
-
function
|
|
116
|
+
function le(e, t) {
|
|
117
117
|
switch (t.constructor) {
|
|
118
118
|
case Float32Array: return e;
|
|
119
119
|
case Uint32Array: return e / 4294967295;
|
|
@@ -125,7 +125,7 @@ function ue(e, t) {
|
|
|
125
125
|
default: throw Error("Invalid component type.");
|
|
126
126
|
}
|
|
127
127
|
}
|
|
128
|
-
function
|
|
128
|
+
function ue(e, t) {
|
|
129
129
|
switch (t.constructor) {
|
|
130
130
|
case Float32Array: return e;
|
|
131
131
|
case Uint32Array: return Math.round(e * 4294967295);
|
|
@@ -144,24 +144,24 @@ var de = {
|
|
|
144
144
|
clamp: j,
|
|
145
145
|
euclideanModulo: M,
|
|
146
146
|
mapLinear: N,
|
|
147
|
-
inverseLerp:
|
|
148
|
-
lerp:
|
|
149
|
-
damp:
|
|
150
|
-
pingpong:
|
|
151
|
-
smoothstep:
|
|
152
|
-
smootherstep:
|
|
153
|
-
randInt:
|
|
154
|
-
randFloat:
|
|
155
|
-
randFloatSpread:
|
|
156
|
-
seededRandom:
|
|
157
|
-
degToRad:
|
|
158
|
-
radToDeg:
|
|
159
|
-
isPowerOfTwo:
|
|
160
|
-
ceilPowerOfTwo:
|
|
161
|
-
floorPowerOfTwo:
|
|
162
|
-
setQuaternionFromProperEuler:
|
|
163
|
-
normalize:
|
|
164
|
-
denormalize:
|
|
147
|
+
inverseLerp: P,
|
|
148
|
+
lerp: F,
|
|
149
|
+
damp: I,
|
|
150
|
+
pingpong: ee,
|
|
151
|
+
smoothstep: te,
|
|
152
|
+
smootherstep: L,
|
|
153
|
+
randInt: ne,
|
|
154
|
+
randFloat: re,
|
|
155
|
+
randFloatSpread: R,
|
|
156
|
+
seededRandom: z,
|
|
157
|
+
degToRad: B,
|
|
158
|
+
radToDeg: ie,
|
|
159
|
+
isPowerOfTwo: ae,
|
|
160
|
+
ceilPowerOfTwo: oe,
|
|
161
|
+
floorPowerOfTwo: se,
|
|
162
|
+
setQuaternionFromProperEuler: ce,
|
|
163
|
+
normalize: ue,
|
|
164
|
+
denormalize: le
|
|
165
165
|
}, V = class e {
|
|
166
166
|
constructor(t = 0, n = 0) {
|
|
167
167
|
e.prototype.isVector2 = !0, this.x = t, this.y = n;
|
|
@@ -1975,8 +1975,8 @@ var Xe = /*@__PURE__*/ new Fe(), Ze = /*@__PURE__*/ new U(), Qe = /*@__PURE__*/
|
|
|
1975
1975
|
return this.multiplyMatrices(e, this);
|
|
1976
1976
|
}
|
|
1977
1977
|
multiplyMatrices(e, t) {
|
|
1978
|
-
let n = e.elements, r = t.elements, i = this.elements, a = n[0], o = n[4], s = n[8], c = n[12], l = n[1], u = n[5], d = n[9], f = n[13], p = n[2], m = n[6], h = n[10], g = n[14], _ = n[3], v = n[7], y = n[11], b = n[15], x = r[0], S = r[4], C = r[8], w = r[12], T = r[1], E = r[5], D = r[9], O = r[13], k = r[2], A = r[6], j = r[10], M = r[14], N = r[3],
|
|
1979
|
-
return i[0] = a * x + o * T + s * k + c * N, i[4] = a * S + o * E + s * A + c *
|
|
1978
|
+
let n = e.elements, r = t.elements, i = this.elements, a = n[0], o = n[4], s = n[8], c = n[12], l = n[1], u = n[5], d = n[9], f = n[13], p = n[2], m = n[6], h = n[10], g = n[14], _ = n[3], v = n[7], y = n[11], b = n[15], x = r[0], S = r[4], C = r[8], w = r[12], T = r[1], E = r[5], D = r[9], O = r[13], k = r[2], A = r[6], j = r[10], M = r[14], N = r[3], P = r[7], F = r[11], I = r[15];
|
|
1979
|
+
return i[0] = a * x + o * T + s * k + c * N, i[4] = a * S + o * E + s * A + c * P, i[8] = a * C + o * D + s * j + c * F, i[12] = a * w + o * O + s * M + c * I, i[1] = l * x + u * T + d * k + f * N, i[5] = l * S + u * E + d * A + f * P, i[9] = l * C + u * D + d * j + f * F, i[13] = l * w + u * O + d * M + f * I, i[2] = p * x + m * T + h * k + g * N, i[6] = p * S + m * E + h * A + g * P, i[10] = p * C + m * D + h * j + g * F, i[14] = p * w + m * O + h * M + g * I, i[3] = _ * x + v * T + y * k + b * N, i[7] = _ * S + v * E + y * A + b * P, i[11] = _ * C + v * D + y * j + b * F, i[15] = _ * w + v * O + y * M + b * I, this;
|
|
1980
1980
|
}
|
|
1981
1981
|
multiplyScalar(e) {
|
|
1982
1982
|
let t = this.elements;
|
|
@@ -2854,7 +2854,7 @@ var X = class {
|
|
|
2854
2854
|
}
|
|
2855
2855
|
lerpHSL(e, t) {
|
|
2856
2856
|
this.getHSL(Zt), e.getHSL(Qt);
|
|
2857
|
-
let n =
|
|
2857
|
+
let n = F(Zt.h, Qt.h, t), r = F(Zt.s, Qt.s, t), i = F(Zt.l, Qt.l, t);
|
|
2858
2858
|
return this.setHSL(n, r, i), this;
|
|
2859
2859
|
}
|
|
2860
2860
|
setFromVector3(e) {
|
|
@@ -3020,47 +3020,47 @@ var tn = 0, nn = class extends T {
|
|
|
3020
3020
|
}
|
|
3021
3021
|
getComponent(e, t) {
|
|
3022
3022
|
let n = this.array[e * this.itemSize + t];
|
|
3023
|
-
return this.normalized && (n =
|
|
3023
|
+
return this.normalized && (n = le(n, this.array)), n;
|
|
3024
3024
|
}
|
|
3025
3025
|
setComponent(e, t, n) {
|
|
3026
|
-
return this.normalized && (n =
|
|
3026
|
+
return this.normalized && (n = ue(n, this.array)), this.array[e * this.itemSize + t] = n, this;
|
|
3027
3027
|
}
|
|
3028
3028
|
getX(e) {
|
|
3029
3029
|
let t = this.array[e * this.itemSize];
|
|
3030
|
-
return this.normalized && (t =
|
|
3030
|
+
return this.normalized && (t = le(t, this.array)), t;
|
|
3031
3031
|
}
|
|
3032
3032
|
setX(e, t) {
|
|
3033
|
-
return this.normalized && (t =
|
|
3033
|
+
return this.normalized && (t = ue(t, this.array)), this.array[e * this.itemSize] = t, this;
|
|
3034
3034
|
}
|
|
3035
3035
|
getY(e) {
|
|
3036
3036
|
let t = this.array[e * this.itemSize + 1];
|
|
3037
|
-
return this.normalized && (t =
|
|
3037
|
+
return this.normalized && (t = le(t, this.array)), t;
|
|
3038
3038
|
}
|
|
3039
3039
|
setY(e, t) {
|
|
3040
|
-
return this.normalized && (t =
|
|
3040
|
+
return this.normalized && (t = ue(t, this.array)), this.array[e * this.itemSize + 1] = t, this;
|
|
3041
3041
|
}
|
|
3042
3042
|
getZ(e) {
|
|
3043
3043
|
let t = this.array[e * this.itemSize + 2];
|
|
3044
|
-
return this.normalized && (t =
|
|
3044
|
+
return this.normalized && (t = le(t, this.array)), t;
|
|
3045
3045
|
}
|
|
3046
3046
|
setZ(e, t) {
|
|
3047
|
-
return this.normalized && (t =
|
|
3047
|
+
return this.normalized && (t = ue(t, this.array)), this.array[e * this.itemSize + 2] = t, this;
|
|
3048
3048
|
}
|
|
3049
3049
|
getW(e) {
|
|
3050
3050
|
let t = this.array[e * this.itemSize + 3];
|
|
3051
|
-
return this.normalized && (t =
|
|
3051
|
+
return this.normalized && (t = le(t, this.array)), t;
|
|
3052
3052
|
}
|
|
3053
3053
|
setW(e, t) {
|
|
3054
|
-
return this.normalized && (t =
|
|
3054
|
+
return this.normalized && (t = ue(t, this.array)), this.array[e * this.itemSize + 3] = t, this;
|
|
3055
3055
|
}
|
|
3056
3056
|
setXY(e, t, n) {
|
|
3057
|
-
return e *= this.itemSize, this.normalized && (t =
|
|
3057
|
+
return e *= this.itemSize, this.normalized && (t = ue(t, this.array), n = ue(n, this.array)), this.array[e + 0] = t, this.array[e + 1] = n, this;
|
|
3058
3058
|
}
|
|
3059
3059
|
setXYZ(e, t, n, r) {
|
|
3060
|
-
return e *= this.itemSize, this.normalized && (t =
|
|
3060
|
+
return e *= this.itemSize, this.normalized && (t = ue(t, this.array), n = ue(n, this.array), r = ue(r, this.array)), this.array[e + 0] = t, this.array[e + 1] = n, this.array[e + 2] = r, this;
|
|
3061
3061
|
}
|
|
3062
3062
|
setXYZW(e, t, n, r, i) {
|
|
3063
|
-
return e *= this.itemSize, this.normalized && (t =
|
|
3063
|
+
return e *= this.itemSize, this.normalized && (t = ue(t, this.array), n = ue(n, this.array), r = ue(r, this.array), i = ue(i, this.array)), this.array[e + 0] = t, this.array[e + 1] = n, this.array[e + 2] = r, this.array[e + 3] = i, this;
|
|
3064
3064
|
}
|
|
3065
3065
|
onUpload(e) {
|
|
3066
3066
|
return this.onUploadCallback = e, this;
|
|
@@ -5386,22 +5386,22 @@ var Ji = class e extends vn {
|
|
|
5386
5386
|
}
|
|
5387
5387
|
let j = [];
|
|
5388
5388
|
for (let e = 0, t = D.length, n = t - 1, r = e + 1; e < t; e++, n++, r++) n === t && (n = 0), r === t && (r = 0), j[e] = A(D[e], D[n], D[r]);
|
|
5389
|
-
let M = [], N,
|
|
5389
|
+
let M = [], N, P = j.concat();
|
|
5390
5390
|
for (let e = 0, t = E; e < t; e++) {
|
|
5391
5391
|
let t = w[e];
|
|
5392
5392
|
N = [];
|
|
5393
5393
|
for (let e = 0, n = t.length, r = n - 1, i = e + 1; e < n; e++, r++, i++) r === n && (r = 0), i === n && (i = 0), N[e] = A(t[e], t[r], t[i]);
|
|
5394
|
-
M.push(N),
|
|
5394
|
+
M.push(N), P = P.concat(N);
|
|
5395
5395
|
}
|
|
5396
|
-
let
|
|
5397
|
-
if (p === 0)
|
|
5396
|
+
let F;
|
|
5397
|
+
if (p === 0) F = Gi.triangulateShape(D, w);
|
|
5398
5398
|
else {
|
|
5399
5399
|
let e = [], t = [];
|
|
5400
5400
|
for (let n = 0; n < p; n++) {
|
|
5401
5401
|
let r = n / p, i = u * Math.cos(r * Math.PI / 2), a = d * Math.sin(r * Math.PI / 2) + f;
|
|
5402
5402
|
for (let t = 0, n = D.length; t < n; t++) {
|
|
5403
5403
|
let n = O(D[t], j[t], a);
|
|
5404
|
-
|
|
5404
|
+
re(n.x, n.y, -i), r === 0 && e.push(n);
|
|
5405
5405
|
}
|
|
5406
5406
|
for (let e = 0, n = E; e < n; e++) {
|
|
5407
5407
|
let n = w[e];
|
|
@@ -5409,100 +5409,100 @@ var Ji = class e extends vn {
|
|
|
5409
5409
|
let o = [];
|
|
5410
5410
|
for (let e = 0, t = n.length; e < t; e++) {
|
|
5411
5411
|
let t = O(n[e], N[e], a);
|
|
5412
|
-
|
|
5412
|
+
re(t.x, t.y, -i), r === 0 && o.push(t);
|
|
5413
5413
|
}
|
|
5414
5414
|
r === 0 && t.push(o);
|
|
5415
5415
|
}
|
|
5416
5416
|
}
|
|
5417
|
-
|
|
5417
|
+
F = Gi.triangulateShape(e, t);
|
|
5418
5418
|
}
|
|
5419
|
-
let
|
|
5419
|
+
let I = F.length, ee = d + f;
|
|
5420
5420
|
for (let e = 0; e < k; e++) {
|
|
5421
|
-
let t = l ? O(C[e],
|
|
5422
|
-
_ ? (b.copy(v.normals[0]).multiplyScalar(t.x), y.copy(v.binormals[0]).multiplyScalar(t.y), x.copy(g[0]).add(b).add(y),
|
|
5421
|
+
let t = l ? O(C[e], P[e], ee) : C[e];
|
|
5422
|
+
_ ? (b.copy(v.normals[0]).multiplyScalar(t.x), y.copy(v.binormals[0]).multiplyScalar(t.y), x.copy(g[0]).add(b).add(y), re(x.x, x.y, x.z)) : re(t.x, t.y, 0);
|
|
5423
5423
|
}
|
|
5424
5424
|
for (let e = 1; e <= s; e++) for (let t = 0; t < k; t++) {
|
|
5425
|
-
let n = l ? O(C[t],
|
|
5426
|
-
_ ? (b.copy(v.normals[e]).multiplyScalar(n.x), y.copy(v.binormals[e]).multiplyScalar(n.y), x.copy(g[e]).add(b).add(y),
|
|
5425
|
+
let n = l ? O(C[t], P[t], ee) : C[t];
|
|
5426
|
+
_ ? (b.copy(v.normals[e]).multiplyScalar(n.x), y.copy(v.binormals[e]).multiplyScalar(n.y), x.copy(g[e]).add(b).add(y), re(x.x, x.y, x.z)) : re(n.x, n.y, c / s * e);
|
|
5427
5427
|
}
|
|
5428
5428
|
for (let e = p - 1; e >= 0; e--) {
|
|
5429
5429
|
let t = e / p, n = u * Math.cos(t * Math.PI / 2), r = d * Math.sin(t * Math.PI / 2) + f;
|
|
5430
5430
|
for (let e = 0, t = D.length; e < t; e++) {
|
|
5431
5431
|
let t = O(D[e], j[e], r);
|
|
5432
|
-
|
|
5432
|
+
re(t.x, t.y, c + n);
|
|
5433
5433
|
}
|
|
5434
5434
|
for (let e = 0, t = w.length; e < t; e++) {
|
|
5435
5435
|
let t = w[e];
|
|
5436
5436
|
N = M[e];
|
|
5437
5437
|
for (let e = 0, i = t.length; e < i; e++) {
|
|
5438
5438
|
let i = O(t[e], N[e], r);
|
|
5439
|
-
_ ?
|
|
5439
|
+
_ ? re(i.x, i.y + g[s - 1].y, g[s - 1].x + n) : re(i.x, i.y, c + n);
|
|
5440
5440
|
}
|
|
5441
5441
|
}
|
|
5442
5442
|
}
|
|
5443
|
-
|
|
5444
|
-
function
|
|
5443
|
+
te(), L();
|
|
5444
|
+
function te() {
|
|
5445
5445
|
let e = r.length / 3;
|
|
5446
5446
|
if (l) {
|
|
5447
5447
|
let e = 0, t = k * e;
|
|
5448
|
-
for (let e = 0; e <
|
|
5449
|
-
let n =
|
|
5450
|
-
|
|
5448
|
+
for (let e = 0; e < I; e++) {
|
|
5449
|
+
let n = F[e];
|
|
5450
|
+
R(n[2] + t, n[1] + t, n[0] + t);
|
|
5451
5451
|
}
|
|
5452
5452
|
e = s + p * 2, t = k * e;
|
|
5453
|
-
for (let e = 0; e <
|
|
5454
|
-
let n =
|
|
5455
|
-
|
|
5453
|
+
for (let e = 0; e < I; e++) {
|
|
5454
|
+
let n = F[e];
|
|
5455
|
+
R(n[0] + t, n[1] + t, n[2] + t);
|
|
5456
5456
|
}
|
|
5457
5457
|
} else {
|
|
5458
|
-
for (let e = 0; e <
|
|
5459
|
-
let t =
|
|
5460
|
-
|
|
5458
|
+
for (let e = 0; e < I; e++) {
|
|
5459
|
+
let t = F[e];
|
|
5460
|
+
R(t[2], t[1], t[0]);
|
|
5461
5461
|
}
|
|
5462
|
-
for (let e = 0; e <
|
|
5463
|
-
let t =
|
|
5464
|
-
|
|
5462
|
+
for (let e = 0; e < I; e++) {
|
|
5463
|
+
let t = F[e];
|
|
5464
|
+
R(t[0] + k * s, t[1] + k * s, t[2] + k * s);
|
|
5465
5465
|
}
|
|
5466
5466
|
}
|
|
5467
5467
|
n.addGroup(e, r.length / 3 - e, 0);
|
|
5468
5468
|
}
|
|
5469
|
-
function
|
|
5469
|
+
function L() {
|
|
5470
5470
|
let e = r.length / 3, t = 0;
|
|
5471
|
-
|
|
5471
|
+
ne(D, t), t += D.length;
|
|
5472
5472
|
for (let e = 0, n = w.length; e < n; e++) {
|
|
5473
5473
|
let n = w[e];
|
|
5474
|
-
|
|
5474
|
+
ne(n, t), t += n.length;
|
|
5475
5475
|
}
|
|
5476
5476
|
n.addGroup(e, r.length / 3 - e, 1);
|
|
5477
5477
|
}
|
|
5478
|
-
function
|
|
5478
|
+
function ne(e, t) {
|
|
5479
5479
|
let n = e.length;
|
|
5480
5480
|
for (; --n >= 0;) {
|
|
5481
5481
|
let r = n, i = n - 1;
|
|
5482
5482
|
i < 0 && (i = e.length - 1);
|
|
5483
5483
|
for (let e = 0, n = s + p * 2; e < n; e++) {
|
|
5484
5484
|
let n = k * e, a = k * (e + 1);
|
|
5485
|
-
|
|
5485
|
+
z(t + r + n, t + i + n, t + i + a, t + r + a);
|
|
5486
5486
|
}
|
|
5487
5487
|
}
|
|
5488
5488
|
}
|
|
5489
|
-
function
|
|
5489
|
+
function re(e, t, n) {
|
|
5490
5490
|
a.push(e), a.push(t), a.push(n);
|
|
5491
5491
|
}
|
|
5492
|
-
function
|
|
5493
|
-
|
|
5492
|
+
function R(e, t, i) {
|
|
5493
|
+
B(e), B(t), B(i);
|
|
5494
5494
|
let a = r.length / 3, o = h.generateTopUV(n, r, a - 3, a - 2, a - 1);
|
|
5495
|
-
|
|
5495
|
+
ie(o[0]), ie(o[1]), ie(o[2]);
|
|
5496
5496
|
}
|
|
5497
|
-
function
|
|
5498
|
-
|
|
5497
|
+
function z(e, t, i, a) {
|
|
5498
|
+
B(e), B(t), B(a), B(t), B(i), B(a);
|
|
5499
5499
|
let o = r.length / 3, s = h.generateSideWallUV(n, r, o - 6, o - 3, o - 2, o - 1);
|
|
5500
|
-
|
|
5500
|
+
ie(s[0]), ie(s[1]), ie(s[3]), ie(s[1]), ie(s[2]), ie(s[3]);
|
|
5501
5501
|
}
|
|
5502
|
-
function
|
|
5502
|
+
function B(e) {
|
|
5503
5503
|
r.push(a[e * 3 + 0]), r.push(a[e * 3 + 1]), r.push(a[e * 3 + 2]);
|
|
5504
5504
|
}
|
|
5505
|
-
function
|
|
5505
|
+
function ie(e) {
|
|
5506
5506
|
i.push(e.x), i.push(e.y);
|
|
5507
5507
|
}
|
|
5508
5508
|
}
|
|
@@ -9329,7 +9329,7 @@ function wc(e, t, n, r, i, a, o) {
|
|
|
9329
9329
|
let e = Qa[w];
|
|
9330
9330
|
O = e.vertexShader, k = e.fragmentShader;
|
|
9331
9331
|
} else O = a.vertexShader, k = a.fragmentShader, c.update(a), A = c.getVertexShaderID(a), j = c.getFragmentShaderID(a);
|
|
9332
|
-
let M = e.getRenderTarget(), N = e.state.buffers.depth.getReversed(),
|
|
9332
|
+
let M = e.getRenderTarget(), N = e.state.buffers.depth.getReversed(), P = _.isInstancedMesh === !0, F = _.isBatchedMesh === !0, I = !!a.map, ee = !!a.matcap, te = !!S, L = !!a.aoMap, ne = !!a.lightMap, re = !!a.bumpMap, R = !!a.normalMap, z = !!a.displacementMap, B = !!a.emissiveMap, ie = !!a.metalnessMap, ae = !!a.roughnessMap, oe = a.anisotropy > 0, se = a.clearcoat > 0, ce = a.dispersion > 0, le = a.iridescence > 0, ue = a.sheen > 0, de = a.transmission > 0, V = oe && !!a.anisotropyMap, H = se && !!a.clearcoatMap, U = se && !!a.clearcoatNormalMap, fe = se && !!a.clearcoatRoughnessMap, W = le && !!a.iridescenceMap, G = le && !!a.iridescenceThicknessMap, K = ue && !!a.sheenColorMap, pe = ue && !!a.sheenRoughnessMap, q = !!a.specularMap, me = !!a.specularColorMap, J = !!a.specularIntensityMap, he = de && !!a.transmissionMap, ge = de && !!a.thicknessMap, _e = !!a.gradientMap, ve = !!a.alphaMap, ye = a.alphaTest > 0, be = !!a.alphaHash, xe = !!a.extensions, Se = 0;
|
|
9333
9333
|
a.toneMapped && (M === null || M.isXRRenderTarget === !0) && (Se = e.toneMapping);
|
|
9334
9334
|
let Ce = {
|
|
9335
9335
|
shaderID: w,
|
|
@@ -9343,40 +9343,40 @@ function wc(e, t, n, r, i, a, o) {
|
|
|
9343
9343
|
isRawShaderMaterial: a.isRawShaderMaterial === !0,
|
|
9344
9344
|
glslVersion: a.glslVersion,
|
|
9345
9345
|
precision: p,
|
|
9346
|
-
batching:
|
|
9347
|
-
batchingColor:
|
|
9348
|
-
instancing:
|
|
9349
|
-
instancingColor:
|
|
9350
|
-
instancingMorph:
|
|
9346
|
+
batching: F,
|
|
9347
|
+
batchingColor: F && _._colorsTexture !== null,
|
|
9348
|
+
instancing: P,
|
|
9349
|
+
instancingColor: P && _.instanceColor !== null,
|
|
9350
|
+
instancingMorph: P && _.morphTexture !== null,
|
|
9351
9351
|
supportsVertexTextures: f,
|
|
9352
9352
|
outputColorSpace: M === null ? e.outputColorSpace : M.isXRRenderTarget === !0 ? M.texture.colorSpace : b,
|
|
9353
9353
|
alphaToCoverage: !!a.alphaToCoverage,
|
|
9354
|
-
map:
|
|
9355
|
-
matcap:
|
|
9356
|
-
envMap:
|
|
9357
|
-
envMapMode:
|
|
9354
|
+
map: I,
|
|
9355
|
+
matcap: ee,
|
|
9356
|
+
envMap: te,
|
|
9357
|
+
envMapMode: te && S.mapping,
|
|
9358
9358
|
envMapCubeUVHeight: C,
|
|
9359
|
-
aoMap:
|
|
9360
|
-
lightMap:
|
|
9361
|
-
bumpMap:
|
|
9362
|
-
normalMap:
|
|
9363
|
-
displacementMap: f &&
|
|
9364
|
-
emissiveMap:
|
|
9365
|
-
normalMapObjectSpace:
|
|
9366
|
-
normalMapTangentSpace:
|
|
9367
|
-
metalnessMap:
|
|
9368
|
-
roughnessMap:
|
|
9369
|
-
anisotropy:
|
|
9359
|
+
aoMap: L,
|
|
9360
|
+
lightMap: ne,
|
|
9361
|
+
bumpMap: re,
|
|
9362
|
+
normalMap: R,
|
|
9363
|
+
displacementMap: f && z,
|
|
9364
|
+
emissiveMap: B,
|
|
9365
|
+
normalMapObjectSpace: R && a.normalMapType === 1,
|
|
9366
|
+
normalMapTangentSpace: R && a.normalMapType === 0,
|
|
9367
|
+
metalnessMap: ie,
|
|
9368
|
+
roughnessMap: ae,
|
|
9369
|
+
anisotropy: oe,
|
|
9370
9370
|
anisotropyMap: V,
|
|
9371
|
-
clearcoat:
|
|
9371
|
+
clearcoat: se,
|
|
9372
9372
|
clearcoatMap: H,
|
|
9373
9373
|
clearcoatNormalMap: U,
|
|
9374
9374
|
clearcoatRoughnessMap: fe,
|
|
9375
|
-
dispersion:
|
|
9376
|
-
iridescence:
|
|
9375
|
+
dispersion: ce,
|
|
9376
|
+
iridescence: le,
|
|
9377
9377
|
iridescenceMap: W,
|
|
9378
9378
|
iridescenceThicknessMap: G,
|
|
9379
|
-
sheen:
|
|
9379
|
+
sheen: ue,
|
|
9380
9380
|
sheenColorMap: K,
|
|
9381
9381
|
sheenRoughnessMap: pe,
|
|
9382
9382
|
specularMap: q,
|
|
@@ -9391,15 +9391,15 @@ function wc(e, t, n, r, i, a, o) {
|
|
|
9391
9391
|
alphaTest: ye,
|
|
9392
9392
|
alphaHash: be,
|
|
9393
9393
|
combine: a.combine,
|
|
9394
|
-
mapUv:
|
|
9395
|
-
aoMapUv:
|
|
9396
|
-
lightMapUv:
|
|
9397
|
-
bumpMapUv:
|
|
9398
|
-
normalMapUv:
|
|
9399
|
-
displacementMapUv:
|
|
9400
|
-
emissiveMapUv:
|
|
9401
|
-
metalnessMapUv:
|
|
9402
|
-
roughnessMapUv:
|
|
9394
|
+
mapUv: I && h(a.map.channel),
|
|
9395
|
+
aoMapUv: L && h(a.aoMap.channel),
|
|
9396
|
+
lightMapUv: ne && h(a.lightMap.channel),
|
|
9397
|
+
bumpMapUv: re && h(a.bumpMap.channel),
|
|
9398
|
+
normalMapUv: R && h(a.normalMap.channel),
|
|
9399
|
+
displacementMapUv: z && h(a.displacementMap.channel),
|
|
9400
|
+
emissiveMapUv: B && h(a.emissiveMap.channel),
|
|
9401
|
+
metalnessMapUv: ie && h(a.metalnessMap.channel),
|
|
9402
|
+
roughnessMapUv: ae && h(a.roughnessMap.channel),
|
|
9403
9403
|
anisotropyMapUv: V && h(a.anisotropyMap.channel),
|
|
9404
9404
|
clearcoatMapUv: H && h(a.clearcoatMap.channel),
|
|
9405
9405
|
clearcoatNormalMapUv: U && h(a.clearcoatNormalMap.channel),
|
|
@@ -9414,10 +9414,10 @@ function wc(e, t, n, r, i, a, o) {
|
|
|
9414
9414
|
transmissionMapUv: he && h(a.transmissionMap.channel),
|
|
9415
9415
|
thicknessMapUv: ge && h(a.thicknessMap.channel),
|
|
9416
9416
|
alphaMapUv: ve && h(a.alphaMap.channel),
|
|
9417
|
-
vertexTangents: !!y.attributes.tangent && (
|
|
9417
|
+
vertexTangents: !!y.attributes.tangent && (R || oe),
|
|
9418
9418
|
vertexColors: a.vertexColors,
|
|
9419
9419
|
vertexAlphas: a.vertexColors === !0 && !!y.attributes.color && y.attributes.color.itemSize === 4,
|
|
9420
|
-
pointsUvs: _.isPoints === !0 && !!y.attributes.uv && (
|
|
9420
|
+
pointsUvs: _.isPoints === !0 && !!y.attributes.uv && (I || ve),
|
|
9421
9421
|
fog: !!v,
|
|
9422
9422
|
useFog: a.fog === !0,
|
|
9423
9423
|
fogExp2: !!v && v.isFogExp2,
|
|
@@ -9448,8 +9448,8 @@ function wc(e, t, n, r, i, a, o) {
|
|
|
9448
9448
|
shadowMapEnabled: e.shadowMap.enabled && u.length > 0,
|
|
9449
9449
|
shadowMapType: e.shadowMap.type,
|
|
9450
9450
|
toneMapping: Se,
|
|
9451
|
-
decodeVideoTexture:
|
|
9452
|
-
decodeVideoTextureEmissive:
|
|
9451
|
+
decodeVideoTexture: I && a.map.isVideoTexture === !0 && Y.getTransfer(a.map.colorSpace) === "srgb",
|
|
9452
|
+
decodeVideoTextureEmissive: B && a.emissiveMap.isVideoTexture === !0 && Y.getTransfer(a.emissiveMap.colorSpace) === "srgb",
|
|
9453
9453
|
premultipliedAlpha: a.premultipliedAlpha,
|
|
9454
9454
|
doubleSided: a.side === 2,
|
|
9455
9455
|
flipSided: a.side === 1,
|
|
@@ -9457,7 +9457,7 @@ function wc(e, t, n, r, i, a, o) {
|
|
|
9457
9457
|
depthPacking: a.depthPacking || 0,
|
|
9458
9458
|
index0AttributeName: a.index0AttributeName,
|
|
9459
9459
|
extensionClipCullDistance: xe && a.extensions.clipCullDistance === !0 && r.has("WEBGL_clip_cull_distance"),
|
|
9460
|
-
extensionMultiDraw: (xe && a.extensions.multiDraw === !0 ||
|
|
9460
|
+
extensionMultiDraw: (xe && a.extensions.multiDraw === !0 || F) && r.has("WEBGL_multi_draw"),
|
|
9461
9461
|
rendererExtensionParallelShaderCompile: r.has("KHR_parallel_shader_compile"),
|
|
9462
9462
|
customProgramCacheKey: a.customProgramCacheKey()
|
|
9463
9463
|
};
|
|
@@ -10017,7 +10017,7 @@ function Vc(e, t) {
|
|
|
10017
10017
|
return r;
|
|
10018
10018
|
},
|
|
10019
10019
|
setTest: function(t) {
|
|
10020
|
-
t ?
|
|
10020
|
+
t ? z(e.DEPTH_TEST) : B(e.DEPTH_TEST);
|
|
10021
10021
|
},
|
|
10022
10022
|
setMask: function(t) {
|
|
10023
10023
|
i !== t && !n && (e.depthMask(t), i = t);
|
|
@@ -10069,7 +10069,7 @@ function Vc(e, t) {
|
|
|
10069
10069
|
let t = !1, n = null, r = null, i = null, a = null, o = null, s = null, c = null, l = null;
|
|
10070
10070
|
return {
|
|
10071
10071
|
setTest: function(n) {
|
|
10072
|
-
t || (n ?
|
|
10072
|
+
t || (n ? z(e.STENCIL_TEST) : B(e.STENCIL_TEST));
|
|
10073
10073
|
},
|
|
10074
10074
|
setMask: function(r) {
|
|
10075
10075
|
n !== r && !t && (e.stencilMask(r), n = r);
|
|
@@ -10091,27 +10091,27 @@ function Vc(e, t) {
|
|
|
10091
10091
|
}
|
|
10092
10092
|
};
|
|
10093
10093
|
}
|
|
10094
|
-
let a = new n(), o = new r(), s = new i(), c = /* @__PURE__ */ new WeakMap(), l = /* @__PURE__ */ new WeakMap(), u = {}, d = {}, f = /* @__PURE__ */ new WeakMap(), p = [], m = null, h = !1, g = null, _ = null, v = null, y = null, b = null, x = null, S = null, C = new X(0, 0, 0), w = 0, T = !1, E = null, D = null, O = null, k = null, A = null, j = e.getParameter(e.MAX_COMBINED_TEXTURE_IMAGE_UNITS), M = !1, N = 0,
|
|
10095
|
-
|
|
10096
|
-
let
|
|
10097
|
-
function
|
|
10094
|
+
let a = new n(), o = new r(), s = new i(), c = /* @__PURE__ */ new WeakMap(), l = /* @__PURE__ */ new WeakMap(), u = {}, d = {}, f = /* @__PURE__ */ new WeakMap(), p = [], m = null, h = !1, g = null, _ = null, v = null, y = null, b = null, x = null, S = null, C = new X(0, 0, 0), w = 0, T = !1, E = null, D = null, O = null, k = null, A = null, j = e.getParameter(e.MAX_COMBINED_TEXTURE_IMAGE_UNITS), M = !1, N = 0, P = e.getParameter(e.VERSION);
|
|
10095
|
+
P.indexOf("WebGL") === -1 ? P.indexOf("OpenGL ES") !== -1 && (N = parseFloat(/^OpenGL ES (\d)/.exec(P)[1]), M = N >= 2) : (N = parseFloat(/^WebGL (\d)/.exec(P)[1]), M = N >= 1);
|
|
10096
|
+
let F = null, I = {}, ee = e.getParameter(e.SCISSOR_BOX), te = e.getParameter(e.VIEWPORT), L = new Ae().fromArray(ee), ne = new Ae().fromArray(te);
|
|
10097
|
+
function re(t, n, r, i) {
|
|
10098
10098
|
let a = /* @__PURE__ */ new Uint8Array(4), o = e.createTexture();
|
|
10099
10099
|
e.bindTexture(t, o), e.texParameteri(t, e.TEXTURE_MIN_FILTER, e.NEAREST), e.texParameteri(t, e.TEXTURE_MAG_FILTER, e.NEAREST);
|
|
10100
10100
|
for (let o = 0; o < r; o++) t === e.TEXTURE_3D || t === e.TEXTURE_2D_ARRAY ? e.texImage3D(n, 0, e.RGBA, 1, 1, i, 0, e.RGBA, e.UNSIGNED_BYTE, a) : e.texImage2D(n + o, 0, e.RGBA, 1, 1, 0, e.RGBA, e.UNSIGNED_BYTE, a);
|
|
10101
10101
|
return o;
|
|
10102
10102
|
}
|
|
10103
|
-
let
|
|
10104
|
-
|
|
10105
|
-
function
|
|
10103
|
+
let R = {};
|
|
10104
|
+
R[e.TEXTURE_2D] = re(e.TEXTURE_2D, e.TEXTURE_2D, 1), R[e.TEXTURE_CUBE_MAP] = re(e.TEXTURE_CUBE_MAP, e.TEXTURE_CUBE_MAP_POSITIVE_X, 6), R[e.TEXTURE_2D_ARRAY] = re(e.TEXTURE_2D_ARRAY, e.TEXTURE_2D_ARRAY, 1, 1), R[e.TEXTURE_3D] = re(e.TEXTURE_3D, e.TEXTURE_3D, 1, 1), a.setClear(0, 0, 0, 1), o.setClear(1), s.setClear(0), z(e.DEPTH_TEST), o.setFunc(3), de(!1), V(1), z(e.CULL_FACE), le(0);
|
|
10105
|
+
function z(t) {
|
|
10106
10106
|
u[t] !== !0 && (e.enable(t), u[t] = !0);
|
|
10107
10107
|
}
|
|
10108
|
-
function
|
|
10108
|
+
function B(t) {
|
|
10109
10109
|
u[t] !== !1 && (e.disable(t), u[t] = !1);
|
|
10110
10110
|
}
|
|
10111
|
-
function
|
|
10111
|
+
function ie(t, n) {
|
|
10112
10112
|
return d[t] !== n && (e.bindFramebuffer(t, n), d[t] = n, t === e.DRAW_FRAMEBUFFER && (d[e.FRAMEBUFFER] = n), t === e.FRAMEBUFFER && (d[e.DRAW_FRAMEBUFFER] = n), !0);
|
|
10113
10113
|
}
|
|
10114
|
-
function
|
|
10114
|
+
function ae(t, n) {
|
|
10115
10115
|
let r = p, i = !1;
|
|
10116
10116
|
if (t) {
|
|
10117
10117
|
r = f.get(n), r === void 0 && (r = [], f.set(n, r));
|
|
@@ -10123,16 +10123,16 @@ function Vc(e, t) {
|
|
|
10123
10123
|
} else r[0] !== e.BACK && (r[0] = e.BACK, i = !0);
|
|
10124
10124
|
i && e.drawBuffers(r);
|
|
10125
10125
|
}
|
|
10126
|
-
function
|
|
10126
|
+
function oe(t) {
|
|
10127
10127
|
return m !== t && (e.useProgram(t), m = t, !0);
|
|
10128
10128
|
}
|
|
10129
|
-
let
|
|
10129
|
+
let se = {
|
|
10130
10130
|
100: e.FUNC_ADD,
|
|
10131
10131
|
101: e.FUNC_SUBTRACT,
|
|
10132
10132
|
102: e.FUNC_REVERSE_SUBTRACT
|
|
10133
10133
|
};
|
|
10134
|
-
|
|
10135
|
-
let
|
|
10134
|
+
se[103] = e.MIN, se[104] = e.MAX;
|
|
10135
|
+
let ce = {
|
|
10136
10136
|
200: e.ZERO,
|
|
10137
10137
|
201: e.ONE,
|
|
10138
10138
|
202: e.SRC_COLOR,
|
|
@@ -10149,12 +10149,12 @@ function Vc(e, t) {
|
|
|
10149
10149
|
213: e.CONSTANT_ALPHA,
|
|
10150
10150
|
214: e.ONE_MINUS_CONSTANT_ALPHA
|
|
10151
10151
|
};
|
|
10152
|
-
function
|
|
10152
|
+
function le(t, n, r, i, a, o, s, c, l, u) {
|
|
10153
10153
|
if (t === 0) {
|
|
10154
|
-
h === !0 && (
|
|
10154
|
+
h === !0 && (B(e.BLEND), h = !1);
|
|
10155
10155
|
return;
|
|
10156
10156
|
}
|
|
10157
|
-
if (h === !1 && (
|
|
10157
|
+
if (h === !1 && (z(e.BLEND), h = !0), t !== 5) {
|
|
10158
10158
|
if (t !== g || u !== T) {
|
|
10159
10159
|
if ((_ !== 100 || b !== 100) && (e.blendEquation(e.FUNC_ADD), _ = 100, b = 100), u) switch (t) {
|
|
10160
10160
|
case 1:
|
|
@@ -10190,43 +10190,43 @@ function Vc(e, t) {
|
|
|
10190
10190
|
}
|
|
10191
10191
|
return;
|
|
10192
10192
|
}
|
|
10193
|
-
a ||= n, o ||= r, s ||= i, (n !== _ || a !== b) && (e.blendEquationSeparate(
|
|
10193
|
+
a ||= n, o ||= r, s ||= i, (n !== _ || a !== b) && (e.blendEquationSeparate(se[n], se[a]), _ = n, b = a), (r !== v || i !== y || o !== x || s !== S) && (e.blendFuncSeparate(ce[r], ce[i], ce[o], ce[s]), v = r, y = i, x = o, S = s), (c.equals(C) === !1 || l !== w) && (e.blendColor(c.r, c.g, c.b, l), C.copy(c), w = l), g = t, T = !1;
|
|
10194
10194
|
}
|
|
10195
|
-
function
|
|
10196
|
-
t.side === 2 ?
|
|
10195
|
+
function ue(t, n) {
|
|
10196
|
+
t.side === 2 ? B(e.CULL_FACE) : z(e.CULL_FACE);
|
|
10197
10197
|
let r = t.side === 1;
|
|
10198
|
-
n && (r = !r), de(r), t.blending === 1 && t.transparent === !1 ?
|
|
10198
|
+
n && (r = !r), de(r), t.blending === 1 && t.transparent === !1 ? le(0) : le(t.blending, t.blendEquation, t.blendSrc, t.blendDst, t.blendEquationAlpha, t.blendSrcAlpha, t.blendDstAlpha, t.blendColor, t.blendAlpha, t.premultipliedAlpha), o.setFunc(t.depthFunc), o.setTest(t.depthTest), o.setMask(t.depthWrite), a.setMask(t.colorWrite);
|
|
10199
10199
|
let i = t.stencilWrite;
|
|
10200
|
-
s.setTest(i), i && (s.setMask(t.stencilWriteMask), s.setFunc(t.stencilFunc, t.stencilRef, t.stencilFuncMask), s.setOp(t.stencilFail, t.stencilZFail, t.stencilZPass)), U(t.polygonOffset, t.polygonOffsetFactor, t.polygonOffsetUnits), t.alphaToCoverage === !0 ?
|
|
10200
|
+
s.setTest(i), i && (s.setMask(t.stencilWriteMask), s.setFunc(t.stencilFunc, t.stencilRef, t.stencilFuncMask), s.setOp(t.stencilFail, t.stencilZFail, t.stencilZPass)), U(t.polygonOffset, t.polygonOffsetFactor, t.polygonOffsetUnits), t.alphaToCoverage === !0 ? z(e.SAMPLE_ALPHA_TO_COVERAGE) : B(e.SAMPLE_ALPHA_TO_COVERAGE);
|
|
10201
10201
|
}
|
|
10202
10202
|
function de(t) {
|
|
10203
10203
|
E !== t && (t ? e.frontFace(e.CW) : e.frontFace(e.CCW), E = t);
|
|
10204
10204
|
}
|
|
10205
10205
|
function V(t) {
|
|
10206
|
-
t === 0 ?
|
|
10206
|
+
t === 0 ? B(e.CULL_FACE) : (z(e.CULL_FACE), t !== D && (t === 1 ? e.cullFace(e.BACK) : t === 2 ? e.cullFace(e.FRONT) : e.cullFace(e.FRONT_AND_BACK))), D = t;
|
|
10207
10207
|
}
|
|
10208
10208
|
function H(t) {
|
|
10209
10209
|
t !== O && (M && e.lineWidth(t), O = t);
|
|
10210
10210
|
}
|
|
10211
10211
|
function U(t, n, r) {
|
|
10212
|
-
t ? (
|
|
10212
|
+
t ? (z(e.POLYGON_OFFSET_FILL), (k !== n || A !== r) && (e.polygonOffset(n, r), k = n, A = r)) : B(e.POLYGON_OFFSET_FILL);
|
|
10213
10213
|
}
|
|
10214
10214
|
function fe(t) {
|
|
10215
|
-
t ?
|
|
10215
|
+
t ? z(e.SCISSOR_TEST) : B(e.SCISSOR_TEST);
|
|
10216
10216
|
}
|
|
10217
10217
|
function W(t) {
|
|
10218
|
-
t === void 0 && (t = e.TEXTURE0 + j - 1),
|
|
10218
|
+
t === void 0 && (t = e.TEXTURE0 + j - 1), F !== t && (e.activeTexture(t), F = t);
|
|
10219
10219
|
}
|
|
10220
10220
|
function G(t, n, r) {
|
|
10221
|
-
r === void 0 && (r =
|
|
10222
|
-
let i =
|
|
10221
|
+
r === void 0 && (r = F === null ? e.TEXTURE0 + j - 1 : F);
|
|
10222
|
+
let i = I[r];
|
|
10223
10223
|
i === void 0 && (i = {
|
|
10224
10224
|
type: void 0,
|
|
10225
10225
|
texture: void 0
|
|
10226
|
-
},
|
|
10226
|
+
}, I[r] = i), (i.type !== t || i.texture !== n) && (F !== r && (e.activeTexture(r), F = r), e.bindTexture(t, n || R[t]), i.type = t, i.texture = n);
|
|
10227
10227
|
}
|
|
10228
10228
|
function K() {
|
|
10229
|
-
let t = F
|
|
10229
|
+
let t = I[F];
|
|
10230
10230
|
t !== void 0 && t.type !== void 0 && (e.bindTexture(t.type, null), t.type = void 0, t.texture = void 0);
|
|
10231
10231
|
}
|
|
10232
10232
|
function pe() {
|
|
@@ -10300,10 +10300,10 @@ function Vc(e, t) {
|
|
|
10300
10300
|
}
|
|
10301
10301
|
}
|
|
10302
10302
|
function be(t) {
|
|
10303
|
-
|
|
10303
|
+
L.equals(t) === !1 && (e.scissor(t.x, t.y, t.z, t.w), L.copy(t));
|
|
10304
10304
|
}
|
|
10305
10305
|
function xe(t) {
|
|
10306
|
-
|
|
10306
|
+
ne.equals(t) === !1 && (e.viewport(t.x, t.y, t.z, t.w), ne.copy(t));
|
|
10307
10307
|
}
|
|
10308
10308
|
function Se(t, n) {
|
|
10309
10309
|
let r = l.get(n);
|
|
@@ -10316,7 +10316,7 @@ function Vc(e, t) {
|
|
|
10316
10316
|
c.get(n) !== r && (e.uniformBlockBinding(n, r, t.__bindingPointIndex), c.set(n, r));
|
|
10317
10317
|
}
|
|
10318
10318
|
function we() {
|
|
10319
|
-
e.disable(e.BLEND), e.disable(e.CULL_FACE), e.disable(e.DEPTH_TEST), e.disable(e.POLYGON_OFFSET_FILL), e.disable(e.SCISSOR_TEST), e.disable(e.STENCIL_TEST), e.disable(e.SAMPLE_ALPHA_TO_COVERAGE), e.blendEquation(e.FUNC_ADD), e.blendFunc(e.ONE, e.ZERO), e.blendFuncSeparate(e.ONE, e.ZERO, e.ONE, e.ZERO), e.blendColor(0, 0, 0, 0), e.colorMask(!0, !0, !0, !0), e.clearColor(0, 0, 0, 0), e.depthMask(!0), e.depthFunc(e.LESS), o.setReversed(!1), e.clearDepth(1), e.stencilMask(4294967295), e.stencilFunc(e.ALWAYS, 0, 4294967295), e.stencilOp(e.KEEP, e.KEEP, e.KEEP), e.clearStencil(0), e.cullFace(e.BACK), e.frontFace(e.CCW), e.polygonOffset(0, 0), e.activeTexture(e.TEXTURE0), e.bindFramebuffer(e.FRAMEBUFFER, null), e.bindFramebuffer(e.DRAW_FRAMEBUFFER, null), e.bindFramebuffer(e.READ_FRAMEBUFFER, null), e.useProgram(null), e.lineWidth(1), e.scissor(0, 0, e.canvas.width, e.canvas.height), e.viewport(0, 0, e.canvas.width, e.canvas.height), u = {},
|
|
10319
|
+
e.disable(e.BLEND), e.disable(e.CULL_FACE), e.disable(e.DEPTH_TEST), e.disable(e.POLYGON_OFFSET_FILL), e.disable(e.SCISSOR_TEST), e.disable(e.STENCIL_TEST), e.disable(e.SAMPLE_ALPHA_TO_COVERAGE), e.blendEquation(e.FUNC_ADD), e.blendFunc(e.ONE, e.ZERO), e.blendFuncSeparate(e.ONE, e.ZERO, e.ONE, e.ZERO), e.blendColor(0, 0, 0, 0), e.colorMask(!0, !0, !0, !0), e.clearColor(0, 0, 0, 0), e.depthMask(!0), e.depthFunc(e.LESS), o.setReversed(!1), e.clearDepth(1), e.stencilMask(4294967295), e.stencilFunc(e.ALWAYS, 0, 4294967295), e.stencilOp(e.KEEP, e.KEEP, e.KEEP), e.clearStencil(0), e.cullFace(e.BACK), e.frontFace(e.CCW), e.polygonOffset(0, 0), e.activeTexture(e.TEXTURE0), e.bindFramebuffer(e.FRAMEBUFFER, null), e.bindFramebuffer(e.DRAW_FRAMEBUFFER, null), e.bindFramebuffer(e.READ_FRAMEBUFFER, null), e.useProgram(null), e.lineWidth(1), e.scissor(0, 0, e.canvas.width, e.canvas.height), e.viewport(0, 0, e.canvas.width, e.canvas.height), u = {}, F = null, I = {}, d = {}, f = /* @__PURE__ */ new WeakMap(), p = [], m = null, h = !1, g = null, _ = null, v = null, y = null, b = null, x = null, S = null, C = new X(0, 0, 0), w = 0, T = !1, E = null, D = null, O = null, k = null, A = null, L.set(0, 0, e.canvas.width, e.canvas.height), ne.set(0, 0, e.canvas.width, e.canvas.height), a.reset(), o.reset(), s.reset();
|
|
10320
10320
|
}
|
|
10321
10321
|
return {
|
|
10322
10322
|
buffers: {
|
|
@@ -10324,13 +10324,13 @@ function Vc(e, t) {
|
|
|
10324
10324
|
depth: o,
|
|
10325
10325
|
stencil: s
|
|
10326
10326
|
},
|
|
10327
|
-
enable:
|
|
10328
|
-
disable:
|
|
10329
|
-
bindFramebuffer:
|
|
10330
|
-
drawBuffers:
|
|
10331
|
-
useProgram:
|
|
10332
|
-
setBlending:
|
|
10333
|
-
setMaterial:
|
|
10327
|
+
enable: z,
|
|
10328
|
+
disable: B,
|
|
10329
|
+
bindFramebuffer: ie,
|
|
10330
|
+
drawBuffers: ae,
|
|
10331
|
+
useProgram: oe,
|
|
10332
|
+
setBlending: le,
|
|
10333
|
+
setMaterial: ue,
|
|
10334
10334
|
setFlipSided: de,
|
|
10335
10335
|
setCullFace: V,
|
|
10336
10336
|
setLineWidth: H,
|
|
@@ -10411,7 +10411,7 @@ function Hc(o, s, c, l, u, d, p) {
|
|
|
10411
10411
|
}
|
|
10412
10412
|
function j(e) {
|
|
10413
10413
|
let t = e.target;
|
|
10414
|
-
t.removeEventListener("dispose", j),
|
|
10414
|
+
t.removeEventListener("dispose", j), P(t);
|
|
10415
10415
|
}
|
|
10416
10416
|
function M(e) {
|
|
10417
10417
|
let t = l.get(e);
|
|
@@ -10429,7 +10429,7 @@ function Hc(o, s, c, l, u, d, p) {
|
|
|
10429
10429
|
let n = e.source, r = y.get(n);
|
|
10430
10430
|
delete r[t.__cacheKey], p.memory.textures--;
|
|
10431
10431
|
}
|
|
10432
|
-
function
|
|
10432
|
+
function P(e) {
|
|
10433
10433
|
let t = l.get(e);
|
|
10434
10434
|
if (e.depthTexture && (e.depthTexture.dispose(), l.remove(e.depthTexture)), e.isWebGLCubeRenderTarget) for (let e = 0; e < 6; e++) {
|
|
10435
10435
|
if (Array.isArray(t.__webglFramebuffer[e])) for (let n = 0; n < t.__webglFramebuffer[e].length; n++) o.deleteFramebuffer(t.__webglFramebuffer[e][n]);
|
|
@@ -10449,67 +10449,67 @@ function Hc(o, s, c, l, u, d, p) {
|
|
|
10449
10449
|
}
|
|
10450
10450
|
l.remove(e);
|
|
10451
10451
|
}
|
|
10452
|
-
let
|
|
10453
|
-
function
|
|
10454
|
-
|
|
10452
|
+
let F = 0;
|
|
10453
|
+
function I() {
|
|
10454
|
+
F = 0;
|
|
10455
10455
|
}
|
|
10456
|
-
function
|
|
10457
|
-
let e =
|
|
10458
|
-
return e >= u.maxTextures && console.warn("THREE.WebGLTextures: Trying to use " + e + " texture units while this GPU supports only " + u.maxTextures),
|
|
10456
|
+
function ee() {
|
|
10457
|
+
let e = F;
|
|
10458
|
+
return e >= u.maxTextures && console.warn("THREE.WebGLTextures: Trying to use " + e + " texture units while this GPU supports only " + u.maxTextures), F += 1, e;
|
|
10459
10459
|
}
|
|
10460
|
-
function
|
|
10460
|
+
function te(e) {
|
|
10461
10461
|
let t = [];
|
|
10462
10462
|
return t.push(e.wrapS), t.push(e.wrapT), t.push(e.wrapR || 0), t.push(e.magFilter), t.push(e.minFilter), t.push(e.anisotropy), t.push(e.internalFormat), t.push(e.format), t.push(e.type), t.push(e.generateMipmaps), t.push(e.premultiplyAlpha), t.push(e.flipY), t.push(e.unpackAlignment), t.push(e.colorSpace), t.join();
|
|
10463
10463
|
}
|
|
10464
|
-
function
|
|
10464
|
+
function L(e, t) {
|
|
10465
10465
|
let n = l.get(e);
|
|
10466
10466
|
if (e.isVideoTexture && _e(e), e.isRenderTargetTexture === !1 && e.isExternalTexture !== !0 && e.version > 0 && n.__version !== e.version) {
|
|
10467
10467
|
let r = e.image;
|
|
10468
10468
|
if (r === null) console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");
|
|
10469
10469
|
else if (r.complete === !1) console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");
|
|
10470
10470
|
else {
|
|
10471
|
-
|
|
10471
|
+
le(n, e, t);
|
|
10472
10472
|
return;
|
|
10473
10473
|
}
|
|
10474
10474
|
} else e.isExternalTexture && (n.__webglTexture = e.sourceTexture ? e.sourceTexture : null);
|
|
10475
10475
|
c.bindTexture(o.TEXTURE_2D, n.__webglTexture, o.TEXTURE0 + t);
|
|
10476
10476
|
}
|
|
10477
|
-
function
|
|
10477
|
+
function ne(e, t) {
|
|
10478
10478
|
let n = l.get(e);
|
|
10479
10479
|
if (e.isRenderTargetTexture === !1 && e.version > 0 && n.__version !== e.version) {
|
|
10480
|
-
|
|
10480
|
+
le(n, e, t);
|
|
10481
10481
|
return;
|
|
10482
10482
|
}
|
|
10483
10483
|
c.bindTexture(o.TEXTURE_2D_ARRAY, n.__webglTexture, o.TEXTURE0 + t);
|
|
10484
10484
|
}
|
|
10485
|
-
function
|
|
10485
|
+
function re(e, t) {
|
|
10486
10486
|
let n = l.get(e);
|
|
10487
10487
|
if (e.isRenderTargetTexture === !1 && e.version > 0 && n.__version !== e.version) {
|
|
10488
|
-
|
|
10488
|
+
le(n, e, t);
|
|
10489
10489
|
return;
|
|
10490
10490
|
}
|
|
10491
10491
|
c.bindTexture(o.TEXTURE_3D, n.__webglTexture, o.TEXTURE0 + t);
|
|
10492
10492
|
}
|
|
10493
|
-
function
|
|
10493
|
+
function R(e, t) {
|
|
10494
10494
|
let n = l.get(e);
|
|
10495
10495
|
if (e.version > 0 && n.__version !== e.version) {
|
|
10496
|
-
|
|
10496
|
+
ue(n, e, t);
|
|
10497
10497
|
return;
|
|
10498
10498
|
}
|
|
10499
10499
|
c.bindTexture(o.TEXTURE_CUBE_MAP, n.__webglTexture, o.TEXTURE0 + t);
|
|
10500
10500
|
}
|
|
10501
|
-
let
|
|
10501
|
+
let z = {
|
|
10502
10502
|
[e]: o.REPEAT,
|
|
10503
10503
|
[t]: o.CLAMP_TO_EDGE,
|
|
10504
10504
|
[n]: o.MIRRORED_REPEAT
|
|
10505
|
-
},
|
|
10505
|
+
}, B = {
|
|
10506
10506
|
[r]: o.NEAREST,
|
|
10507
10507
|
1004: o.NEAREST_MIPMAP_NEAREST,
|
|
10508
10508
|
1005: o.NEAREST_MIPMAP_LINEAR,
|
|
10509
10509
|
[i]: o.LINEAR,
|
|
10510
10510
|
1007: o.LINEAR_MIPMAP_NEAREST,
|
|
10511
10511
|
[a]: o.LINEAR_MIPMAP_LINEAR
|
|
10512
|
-
},
|
|
10512
|
+
}, ie = {
|
|
10513
10513
|
512: o.NEVER,
|
|
10514
10514
|
519: o.ALWAYS,
|
|
10515
10515
|
513: o.LESS,
|
|
@@ -10519,8 +10519,8 @@ function Hc(o, s, c, l, u, d, p) {
|
|
|
10519
10519
|
516: o.GREATER,
|
|
10520
10520
|
517: o.NOTEQUAL
|
|
10521
10521
|
};
|
|
10522
|
-
function
|
|
10523
|
-
if (t.type === 1015 && s.has("OES_texture_float_linear") === !1 && (t.magFilter === 1006 || t.magFilter === 1007 || t.magFilter === 1005 || t.magFilter === 1008 || t.minFilter === 1006 || t.minFilter === 1007 || t.minFilter === 1005 || t.minFilter === 1008) && console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."), o.texParameteri(e, o.TEXTURE_WRAP_S,
|
|
10522
|
+
function ae(e, t) {
|
|
10523
|
+
if (t.type === 1015 && s.has("OES_texture_float_linear") === !1 && (t.magFilter === 1006 || t.magFilter === 1007 || t.magFilter === 1005 || t.magFilter === 1008 || t.minFilter === 1006 || t.minFilter === 1007 || t.minFilter === 1005 || t.minFilter === 1008) && console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."), o.texParameteri(e, o.TEXTURE_WRAP_S, z[t.wrapS]), o.texParameteri(e, o.TEXTURE_WRAP_T, z[t.wrapT]), (e === o.TEXTURE_3D || e === o.TEXTURE_2D_ARRAY) && o.texParameteri(e, o.TEXTURE_WRAP_R, z[t.wrapR]), o.texParameteri(e, o.TEXTURE_MAG_FILTER, B[t.magFilter]), o.texParameteri(e, o.TEXTURE_MIN_FILTER, B[t.minFilter]), t.compareFunction && (o.texParameteri(e, o.TEXTURE_COMPARE_MODE, o.COMPARE_REF_TO_TEXTURE), o.texParameteri(e, o.TEXTURE_COMPARE_FUNC, ie[t.compareFunction])), s.has("EXT_texture_filter_anisotropic") === !0) {
|
|
10524
10524
|
if (t.magFilter === 1003 || t.minFilter !== 1005 && t.minFilter !== 1008 || t.type === 1015 && s.has("OES_texture_float_linear") === !1) return;
|
|
10525
10525
|
if (t.anisotropy > 1 || l.get(t).__currentAnisotropy) {
|
|
10526
10526
|
let n = s.get("EXT_texture_filter_anisotropic");
|
|
@@ -10528,12 +10528,12 @@ function Hc(o, s, c, l, u, d, p) {
|
|
|
10528
10528
|
}
|
|
10529
10529
|
}
|
|
10530
10530
|
}
|
|
10531
|
-
function
|
|
10531
|
+
function oe(e, t) {
|
|
10532
10532
|
let n = !1;
|
|
10533
10533
|
e.__webglInit === void 0 && (e.__webglInit = !0, t.addEventListener("dispose", A));
|
|
10534
10534
|
let r = t.source, i = y.get(r);
|
|
10535
10535
|
i === void 0 && (i = {}, y.set(r, i));
|
|
10536
|
-
let a =
|
|
10536
|
+
let a = te(t);
|
|
10537
10537
|
if (a !== e.__cacheKey) {
|
|
10538
10538
|
i[a] === void 0 && (i[a] = {
|
|
10539
10539
|
texture: o.createTexture(),
|
|
@@ -10544,18 +10544,18 @@ function Hc(o, s, c, l, u, d, p) {
|
|
|
10544
10544
|
}
|
|
10545
10545
|
return n;
|
|
10546
10546
|
}
|
|
10547
|
-
function
|
|
10547
|
+
function se(e, t, n) {
|
|
10548
10548
|
return Math.floor(Math.floor(e / n) / t);
|
|
10549
10549
|
}
|
|
10550
|
-
function
|
|
10550
|
+
function ce(e, t, n, r) {
|
|
10551
10551
|
let i = e.updateRanges;
|
|
10552
10552
|
if (i.length === 0) c.texSubImage2D(o.TEXTURE_2D, 0, 0, 0, t.width, t.height, n, r, t.data);
|
|
10553
10553
|
else {
|
|
10554
10554
|
i.sort((e, t) => e.start - t.start);
|
|
10555
10555
|
let a = 0;
|
|
10556
10556
|
for (let e = 1; e < i.length; e++) {
|
|
10557
|
-
let n = i[a], r = i[e], o = n.start + n.count, s =
|
|
10558
|
-
r.start <= o + 1 && s === c &&
|
|
10557
|
+
let n = i[a], r = i[e], o = n.start + n.count, s = se(r.start, t.width, 4), c = se(n.start, t.width, 4);
|
|
10558
|
+
r.start <= o + 1 && s === c && se(r.start + r.count - 1, t.width, 4) === s ? n.count = Math.max(n.count, r.start + r.count - n.start) : (++a, i[a] = r);
|
|
10559
10559
|
}
|
|
10560
10560
|
i.length = a + 1;
|
|
10561
10561
|
let s = o.getParameter(o.UNPACK_ROW_LENGTH), l = o.getParameter(o.UNPACK_SKIP_PIXELS), u = o.getParameter(o.UNPACK_SKIP_ROWS);
|
|
@@ -10567,10 +10567,10 @@ function Hc(o, s, c, l, u, d, p) {
|
|
|
10567
10567
|
e.clearUpdateRanges(), o.pixelStorei(o.UNPACK_ROW_LENGTH, s), o.pixelStorei(o.UNPACK_SKIP_PIXELS, l), o.pixelStorei(o.UNPACK_SKIP_ROWS, u);
|
|
10568
10568
|
}
|
|
10569
10569
|
}
|
|
10570
|
-
function
|
|
10570
|
+
function le(e, t, n) {
|
|
10571
10571
|
let r = o.TEXTURE_2D;
|
|
10572
10572
|
(t.isDataArrayTexture || t.isCompressedArrayTexture) && (r = o.TEXTURE_2D_ARRAY), t.isData3DTexture && (r = o.TEXTURE_3D);
|
|
10573
|
-
let i =
|
|
10573
|
+
let i = oe(e, t), a = t.source;
|
|
10574
10574
|
c.bindTexture(r, e.__webglTexture, o.TEXTURE0 + n);
|
|
10575
10575
|
let s = l.get(a);
|
|
10576
10576
|
if (a.version !== s.__version || i === !0) {
|
|
@@ -10580,7 +10580,7 @@ function Hc(o, s, c, l, u, d, p) {
|
|
|
10580
10580
|
let m = C(t.image, !1, u.maxTextureSize);
|
|
10581
10581
|
m = ve(t, m);
|
|
10582
10582
|
let h = d.convert(t.format, t.colorSpace), g = d.convert(t.type), _ = D(t.internalFormat, h, g, t.colorSpace, t.isVideoTexture);
|
|
10583
|
-
|
|
10583
|
+
ae(r, t);
|
|
10584
10584
|
let v, y = t.mipmaps, b = t.isVideoTexture !== !0, x = s.__version === void 0 || i === !0, S = a.dataReady, E = k(t, m);
|
|
10585
10585
|
if (t.isDepthTexture) _ = O(t.format === f, t.type), x && (b ? c.texStorage2D(o.TEXTURE_2D, 1, _, m.width, m.height) : c.texImage2D(o.TEXTURE_2D, 0, _, m.width, m.height, 0, h, g, null));
|
|
10586
10586
|
else if (t.isDataTexture) {
|
|
@@ -10588,7 +10588,7 @@ function Hc(o, s, c, l, u, d, p) {
|
|
|
10588
10588
|
b && x && c.texStorage2D(o.TEXTURE_2D, E, _, y[0].width, y[0].height);
|
|
10589
10589
|
for (let e = 0, t = y.length; e < t; e++) v = y[e], b ? S && c.texSubImage2D(o.TEXTURE_2D, e, 0, 0, v.width, v.height, h, g, v.data) : c.texImage2D(o.TEXTURE_2D, e, _, v.width, v.height, 0, h, g, v.data);
|
|
10590
10590
|
t.generateMipmaps = !1;
|
|
10591
|
-
} else b ? (x && c.texStorage2D(o.TEXTURE_2D, E, _, m.width, m.height), S &&
|
|
10591
|
+
} else b ? (x && c.texStorage2D(o.TEXTURE_2D, E, _, m.width, m.height), S && ce(t, m, h, g)) : c.texImage2D(o.TEXTURE_2D, 0, _, m.width, m.height, 0, h, g, m.data);
|
|
10592
10592
|
} else if (t.isCompressedTexture) {
|
|
10593
10593
|
if (t.isCompressedArrayTexture) {
|
|
10594
10594
|
b && x && c.texStorage3D(o.TEXTURE_2D_ARRAY, E, _, y[0].width, y[0].height, m.depth);
|
|
@@ -10652,9 +10652,9 @@ function Hc(o, s, c, l, u, d, p) {
|
|
|
10652
10652
|
}
|
|
10653
10653
|
e.__version = t.version;
|
|
10654
10654
|
}
|
|
10655
|
-
function
|
|
10655
|
+
function ue(e, t, n) {
|
|
10656
10656
|
if (t.image.length !== 6) return;
|
|
10657
|
-
let r =
|
|
10657
|
+
let r = oe(e, t), i = t.source;
|
|
10658
10658
|
c.bindTexture(o.TEXTURE_CUBE_MAP, e.__webglTexture, o.TEXTURE0 + n);
|
|
10659
10659
|
let a = l.get(i);
|
|
10660
10660
|
if (i.version !== a.__version || r === !0) {
|
|
@@ -10664,7 +10664,7 @@ function Hc(o, s, c, l, u, d, p) {
|
|
|
10664
10664
|
let f = t.isCompressedTexture || t.image[0].isCompressedTexture, p = t.image[0] && t.image[0].isDataTexture, m = [];
|
|
10665
10665
|
for (let e = 0; e < 6; e++) !f && !p ? m[e] = C(t.image[e], !0, u.maxCubemapSize) : m[e] = p ? t.image[e].image : t.image[e], m[e] = ve(t, m[e]);
|
|
10666
10666
|
let h = m[0], g = d.convert(t.format, t.colorSpace), _ = d.convert(t.type), v = D(t.internalFormat, g, _, t.colorSpace), y = t.isVideoTexture !== !0, b = a.__version === void 0 || r === !0, x = i.dataReady, S = k(t, h);
|
|
10667
|
-
|
|
10667
|
+
ae(o.TEXTURE_CUBE_MAP, t);
|
|
10668
10668
|
let E;
|
|
10669
10669
|
if (f) {
|
|
10670
10670
|
y && b && c.texStorage2D(o.TEXTURE_CUBE_MAP, S, v, h.width, h.height);
|
|
@@ -10724,7 +10724,7 @@ function Hc(o, s, c, l, u, d, p) {
|
|
|
10724
10724
|
if (t && t.isWebGLCubeRenderTarget) throw Error("Depth Texture with cube render targets is not supported");
|
|
10725
10725
|
if (c.bindFramebuffer(o.FRAMEBUFFER, e), !(t.depthTexture && t.depthTexture.isDepthTexture)) throw Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");
|
|
10726
10726
|
let n = l.get(t.depthTexture);
|
|
10727
|
-
n.__renderTarget = t, (!n.__webglTexture || t.depthTexture.image.width !== t.width || t.depthTexture.image.height !== t.height) && (t.depthTexture.image.width = t.width, t.depthTexture.image.height = t.height, t.depthTexture.needsUpdate = !0),
|
|
10727
|
+
n.__renderTarget = t, (!n.__webglTexture || t.depthTexture.image.width !== t.width || t.depthTexture.image.height !== t.height) && (t.depthTexture.image.width = t.width, t.depthTexture.image.height = t.height, t.depthTexture.needsUpdate = !0), L(t.depthTexture, 0);
|
|
10728
10728
|
let r = n.__webglTexture, i = he(t);
|
|
10729
10729
|
if (t.depthTexture.format === 1026) ge(t) ? m.framebufferTexture2DMultisampleEXT(o.FRAMEBUFFER, o.DEPTH_ATTACHMENT, o.TEXTURE_2D, r, 0, i) : o.framebufferTexture2D(o.FRAMEBUFFER, o.DEPTH_ATTACHMENT, o.TEXTURE_2D, r, 0);
|
|
10730
10730
|
else if (t.depthTexture.format === 1027) ge(t) ? m.framebufferTexture2DMultisampleEXT(o.FRAMEBUFFER, o.DEPTH_STENCIL_ATTACHMENT, o.TEXTURE_2D, r, 0, i) : o.framebufferTexture2D(o.FRAMEBUFFER, o.DEPTH_STENCIL_ATTACHMENT, o.TEXTURE_2D, r, 0);
|
|
@@ -10798,19 +10798,19 @@ function Hc(o, s, c, l, u, d, p) {
|
|
|
10798
10798
|
}
|
|
10799
10799
|
}
|
|
10800
10800
|
if (a) {
|
|
10801
|
-
c.bindTexture(o.TEXTURE_CUBE_MAP, r.__webglTexture),
|
|
10801
|
+
c.bindTexture(o.TEXTURE_CUBE_MAP, r.__webglTexture), ae(o.TEXTURE_CUBE_MAP, t);
|
|
10802
10802
|
for (let r = 0; r < 6; r++) if (t.mipmaps && t.mipmaps.length > 0) for (let i = 0; i < t.mipmaps.length; i++) de(n.__webglFramebuffer[r][i], e, t, o.COLOR_ATTACHMENT0, o.TEXTURE_CUBE_MAP_POSITIVE_X + r, i);
|
|
10803
10803
|
else de(n.__webglFramebuffer[r], e, t, o.COLOR_ATTACHMENT0, o.TEXTURE_CUBE_MAP_POSITIVE_X + r, 0);
|
|
10804
10804
|
w(t) && T(o.TEXTURE_CUBE_MAP), c.unbindTexture();
|
|
10805
10805
|
} else if (s) {
|
|
10806
10806
|
for (let t = 0, r = i.length; t < r; t++) {
|
|
10807
10807
|
let r = i[t], a = l.get(r), s = o.TEXTURE_2D;
|
|
10808
|
-
(e.isWebGL3DRenderTarget || e.isWebGLArrayRenderTarget) && (s = e.isWebGL3DRenderTarget ? o.TEXTURE_3D : o.TEXTURE_2D_ARRAY), c.bindTexture(s, a.__webglTexture),
|
|
10808
|
+
(e.isWebGL3DRenderTarget || e.isWebGLArrayRenderTarget) && (s = e.isWebGL3DRenderTarget ? o.TEXTURE_3D : o.TEXTURE_2D_ARRAY), c.bindTexture(s, a.__webglTexture), ae(s, r), de(n.__webglFramebuffer, e, r, o.COLOR_ATTACHMENT0 + t, s, 0), w(r) && T(s);
|
|
10809
10809
|
}
|
|
10810
10810
|
c.unbindTexture();
|
|
10811
10811
|
} else {
|
|
10812
10812
|
let i = o.TEXTURE_2D;
|
|
10813
|
-
if ((e.isWebGL3DRenderTarget || e.isWebGLArrayRenderTarget) && (i = e.isWebGL3DRenderTarget ? o.TEXTURE_3D : o.TEXTURE_2D_ARRAY), c.bindTexture(i, r.__webglTexture),
|
|
10813
|
+
if ((e.isWebGL3DRenderTarget || e.isWebGLArrayRenderTarget) && (i = e.isWebGL3DRenderTarget ? o.TEXTURE_3D : o.TEXTURE_2D_ARRAY), c.bindTexture(i, r.__webglTexture), ae(i, t), t.mipmaps && t.mipmaps.length > 0) for (let r = 0; r < t.mipmaps.length; r++) de(n.__webglFramebuffer[r], e, t, o.COLOR_ATTACHMENT0, i, r);
|
|
10814
10814
|
else de(n.__webglFramebuffer, e, t, o.COLOR_ATTACHMENT0, i, 0);
|
|
10815
10815
|
w(t) && T(i), c.unbindTexture();
|
|
10816
10816
|
}
|
|
@@ -10873,7 +10873,7 @@ function Hc(o, s, c, l, u, d, p) {
|
|
|
10873
10873
|
function ye(e) {
|
|
10874
10874
|
return typeof HTMLImageElement < "u" && e instanceof HTMLImageElement ? (g.width = e.naturalWidth || e.width, g.height = e.naturalHeight || e.height) : typeof VideoFrame < "u" && e instanceof VideoFrame ? (g.width = e.displayWidth, g.height = e.displayHeight) : (g.width = e.width, g.height = e.height), g;
|
|
10875
10875
|
}
|
|
10876
|
-
this.allocateTextureUnit =
|
|
10876
|
+
this.allocateTextureUnit = ee, this.resetTextureUnits = I, this.setTexture2D = L, this.setTexture2DArray = ne, this.setTexture3D = re, this.setTextureCube = R, this.rebindTextures = W, this.setupRenderTarget = G, this.updateRenderTargetMipmap = K, this.updateMultisampleRenderTarget = J, this.setupDepthRenderbuffer = fe, this.setupFrameBufferTexture = de, this.useMultisampledRTT = ge;
|
|
10877
10877
|
}
|
|
10878
10878
|
function Uc(e, t) {
|
|
10879
10879
|
function n(n, r = "") {
|
|
@@ -11004,7 +11004,7 @@ var Wc = "\nvoid main() {\n\n gl_Position = vec4( position, 1.0 );\n\n}", Gc = "
|
|
|
11004
11004
|
A.viewport = new Ae();
|
|
11005
11005
|
let j = new Kn();
|
|
11006
11006
|
j.viewport = new Ae();
|
|
11007
|
-
let M = [A, j], N = new Aa(),
|
|
11007
|
+
let M = [A, j], N = new Aa(), P = null, F = null;
|
|
11008
11008
|
this.cameraAutoUpdate = !0, this.enabled = !1, this.isPresenting = !1, this.getController = function(e) {
|
|
11009
11009
|
let t = T[e];
|
|
11010
11010
|
return t === void 0 && (t = new er(), T[e] = t), t.getTargetRaySpace();
|
|
@@ -11015,7 +11015,7 @@ var Wc = "\nvoid main() {\n\n gl_Position = vec4( position, 1.0 );\n\n}", Gc = "
|
|
|
11015
11015
|
let t = T[e];
|
|
11016
11016
|
return t === void 0 && (t = new er(), T[e] = t), t.getHandSpace();
|
|
11017
11017
|
};
|
|
11018
|
-
function
|
|
11018
|
+
function I(e) {
|
|
11019
11019
|
let t = E.indexOf(e.inputSource);
|
|
11020
11020
|
if (t === -1) return;
|
|
11021
11021
|
let n = T[t];
|
|
@@ -11024,15 +11024,15 @@ var Wc = "\nvoid main() {\n\n gl_Position = vec4( position, 1.0 );\n\n}", Gc = "
|
|
|
11024
11024
|
data: e.inputSource
|
|
11025
11025
|
}));
|
|
11026
11026
|
}
|
|
11027
|
-
function
|
|
11028
|
-
r.removeEventListener("select",
|
|
11027
|
+
function ee() {
|
|
11028
|
+
r.removeEventListener("select", I), r.removeEventListener("selectstart", I), r.removeEventListener("selectend", I), r.removeEventListener("squeeze", I), r.removeEventListener("squeezestart", I), r.removeEventListener("squeezeend", I), r.removeEventListener("end", ee), r.removeEventListener("inputsourceschange", te);
|
|
11029
11029
|
for (let e = 0; e < T.length; e++) {
|
|
11030
11030
|
let t = E[e];
|
|
11031
11031
|
t !== null && (E[e] = null, T[e].disconnect(t));
|
|
11032
11032
|
}
|
|
11033
|
-
|
|
11033
|
+
P = null, F = null, b.reset();
|
|
11034
11034
|
for (let e in x) delete x[e];
|
|
11035
|
-
e.setRenderTarget(C), _ = null, g = null, h = null, r = null, w = null,
|
|
11035
|
+
e.setRenderTarget(C), _ = null, g = null, h = null, r = null, w = null, ae.stop(), n.isPresenting = !1, e.setPixelRatio(O), e.setSize(D.width, D.height, !1), n.dispatchEvent({ type: "sessionend" });
|
|
11036
11036
|
}
|
|
11037
11037
|
this.setFramebufferScaleFactor = function(e) {
|
|
11038
11038
|
i = e, n.isPresenting === !0 && console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.");
|
|
@@ -11052,7 +11052,7 @@ var Wc = "\nvoid main() {\n\n gl_Position = vec4( position, 1.0 );\n\n}", Gc = "
|
|
|
11052
11052
|
return r;
|
|
11053
11053
|
}, this.setSession = async function(m) {
|
|
11054
11054
|
if (r = m, r !== null) {
|
|
11055
|
-
if (C = e.getRenderTarget(), r.addEventListener("select",
|
|
11055
|
+
if (C = e.getRenderTarget(), r.addEventListener("select", I), r.addEventListener("selectstart", I), r.addEventListener("selectend", I), r.addEventListener("squeeze", I), r.addEventListener("squeezestart", I), r.addEventListener("squeezeend", I), r.addEventListener("end", ee), r.addEventListener("inputsourceschange", te), S.xrCompatible !== !0 && await t.makeXRCompatible(), O = e.getPixelRatio(), e.getSize(D), y && "createProjectionLayer" in XRWebGLBinding.prototype) {
|
|
11056
11056
|
let n = null, a = null, c = null;
|
|
11057
11057
|
S.depth && (c = S.stencil ? t.DEPTH24_STENCIL8 : t.DEPTH_COMPONENT24, n = S.stencil ? f : d, a = S.stencil ? 1020 : s);
|
|
11058
11058
|
let l = {
|
|
@@ -11087,14 +11087,14 @@ var Wc = "\nvoid main() {\n\n gl_Position = vec4( position, 1.0 );\n\n}", Gc = "
|
|
|
11087
11087
|
resolveStencilBuffer: _.ignoreDepthValues === !1
|
|
11088
11088
|
});
|
|
11089
11089
|
}
|
|
11090
|
-
w.isXRRenderTarget = !0, this.setFoveation(l), p = null, a = await r.requestReferenceSpace(c),
|
|
11090
|
+
w.isXRRenderTarget = !0, this.setFoveation(l), p = null, a = await r.requestReferenceSpace(c), ae.setContext(r), ae.start(), n.isPresenting = !0, n.dispatchEvent({ type: "sessionstart" });
|
|
11091
11091
|
}
|
|
11092
11092
|
}, this.getEnvironmentBlendMode = function() {
|
|
11093
11093
|
if (r !== null) return r.environmentBlendMode;
|
|
11094
11094
|
}, this.getDepthTexture = function() {
|
|
11095
11095
|
return b.getDepthTexture();
|
|
11096
11096
|
};
|
|
11097
|
-
function
|
|
11097
|
+
function te(e) {
|
|
11098
11098
|
for (let t = 0; t < e.removed.length; t++) {
|
|
11099
11099
|
let n = e.removed[t], r = E.indexOf(n);
|
|
11100
11100
|
r >= 0 && (E[r] = null, T[r].disconnect(n));
|
|
@@ -11115,32 +11115,32 @@ var Wc = "\nvoid main() {\n\n gl_Position = vec4( position, 1.0 );\n\n}", Gc = "
|
|
|
11115
11115
|
i && i.connect(n);
|
|
11116
11116
|
}
|
|
11117
11117
|
}
|
|
11118
|
-
let
|
|
11119
|
-
function
|
|
11120
|
-
|
|
11121
|
-
let r =
|
|
11118
|
+
let L = new U(), ne = new U();
|
|
11119
|
+
function re(e, t, n) {
|
|
11120
|
+
L.setFromMatrixPosition(t.matrixWorld), ne.setFromMatrixPosition(n.matrixWorld);
|
|
11121
|
+
let r = L.distanceTo(ne), i = t.projectionMatrix.elements, a = n.projectionMatrix.elements, o = i[14] / (i[10] - 1), s = i[14] / (i[10] + 1), c = (i[9] + 1) / i[5], l = (i[9] - 1) / i[5], u = (i[8] - 1) / i[0], d = (a[8] + 1) / a[0], f = o * u, p = o * d, m = r / (-u + d), h = m * -u;
|
|
11122
11122
|
if (t.matrixWorld.decompose(e.position, e.quaternion, e.scale), e.translateX(h), e.translateZ(m), e.matrixWorld.compose(e.position, e.quaternion, e.scale), e.matrixWorldInverse.copy(e.matrixWorld).invert(), i[10] === -1) e.projectionMatrix.copy(t.projectionMatrix), e.projectionMatrixInverse.copy(t.projectionMatrixInverse);
|
|
11123
11123
|
else {
|
|
11124
11124
|
let t = o + m, n = s + m, i = f - h, a = p + (r - h), u = c * s / n * t, d = l * s / n * t;
|
|
11125
11125
|
e.projectionMatrix.makePerspective(i, a, u, d, t, n), e.projectionMatrixInverse.copy(e.projectionMatrix).invert();
|
|
11126
11126
|
}
|
|
11127
11127
|
}
|
|
11128
|
-
function
|
|
11128
|
+
function R(e, t) {
|
|
11129
11129
|
t === null ? e.matrixWorld.copy(e.matrix) : e.matrixWorld.multiplyMatrices(t.matrixWorld, e.matrix), e.matrixWorldInverse.copy(e.matrixWorld).invert();
|
|
11130
11130
|
}
|
|
11131
11131
|
this.updateCamera = function(e) {
|
|
11132
11132
|
if (r === null) return;
|
|
11133
11133
|
let t = e.near, n = e.far;
|
|
11134
|
-
b.texture !== null && (b.depthNear > 0 && (t = b.depthNear), b.depthFar > 0 && (n = b.depthFar)), N.near = j.near = A.near = t, N.far = j.far = A.far = n, (
|
|
11134
|
+
b.texture !== null && (b.depthNear > 0 && (t = b.depthNear), b.depthFar > 0 && (n = b.depthFar)), N.near = j.near = A.near = t, N.far = j.far = A.far = n, (P !== N.near || F !== N.far) && (r.updateRenderState({
|
|
11135
11135
|
depthNear: N.near,
|
|
11136
11136
|
depthFar: N.far
|
|
11137
|
-
}),
|
|
11137
|
+
}), P = N.near, F = N.far), N.layers.mask = e.layers.mask | 6, A.layers.mask = N.layers.mask & 3, j.layers.mask = N.layers.mask & 5;
|
|
11138
11138
|
let i = e.parent, a = N.cameras;
|
|
11139
|
-
|
|
11140
|
-
for (let e = 0; e < a.length; e++)
|
|
11141
|
-
a.length === 2 ?
|
|
11139
|
+
R(N, i);
|
|
11140
|
+
for (let e = 0; e < a.length; e++) R(a[e], i);
|
|
11141
|
+
a.length === 2 ? re(N, A, j) : N.projectionMatrix.copy(A.projectionMatrix), z(e, N, i);
|
|
11142
11142
|
};
|
|
11143
|
-
function
|
|
11143
|
+
function z(e, t, n) {
|
|
11144
11144
|
n === null ? e.matrix.copy(t.matrixWorld) : (e.matrix.copy(n.matrixWorld), e.matrix.invert(), e.matrix.multiply(t.matrixWorld)), e.matrix.decompose(e.position, e.quaternion, e.scale), e.updateMatrixWorld(!0), e.projectionMatrix.copy(t.projectionMatrix), e.projectionMatrixInverse.copy(t.projectionMatrixInverse), e.isPerspectiveCamera && (e.fov = k * 2 * Math.atan(1 / e.projectionMatrix.elements[5]), e.zoom = 1);
|
|
11145
11145
|
}
|
|
11146
11146
|
this.getCamera = function() {
|
|
@@ -11156,8 +11156,8 @@ var Wc = "\nvoid main() {\n\n gl_Position = vec4( position, 1.0 );\n\n}", Gc = "
|
|
|
11156
11156
|
}, this.getCameraTexture = function(e) {
|
|
11157
11157
|
return x[e];
|
|
11158
11158
|
};
|
|
11159
|
-
let
|
|
11160
|
-
function
|
|
11159
|
+
let B = null;
|
|
11160
|
+
function ie(t, i) {
|
|
11161
11161
|
if (m = i.getViewerPose(p || a), v = i, m !== null) {
|
|
11162
11162
|
let t = m.views;
|
|
11163
11163
|
_ !== null && (e.setRenderTargetFramebuffer(w, _.framebuffer), e.setRenderTarget(w));
|
|
@@ -11196,14 +11196,14 @@ var Wc = "\nvoid main() {\n\n gl_Position = vec4( position, 1.0 );\n\n}", Gc = "
|
|
|
11196
11196
|
let t = E[e], n = T[e];
|
|
11197
11197
|
t !== null && n !== void 0 && n.update(t, i, p || a);
|
|
11198
11198
|
}
|
|
11199
|
-
|
|
11199
|
+
B && B(t, i), i.detectedPlanes && n.dispatchEvent({
|
|
11200
11200
|
type: "planesdetected",
|
|
11201
11201
|
data: i
|
|
11202
11202
|
}), v = null;
|
|
11203
11203
|
}
|
|
11204
|
-
let
|
|
11205
|
-
|
|
11206
|
-
|
|
11204
|
+
let ae = new Xa();
|
|
11205
|
+
ae.setAnimationLoop(ie), this.setAnimationLoop = function(e) {
|
|
11206
|
+
B = e;
|
|
11207
11207
|
}, this.dispose = function() {};
|
|
11208
11208
|
}
|
|
11209
11209
|
}, Jc = /*@__PURE__*/ new vt(), Yc = /*@__PURE__*/ new ct();
|
|
@@ -11366,7 +11366,7 @@ var Qc = class {
|
|
|
11366
11366
|
}, this.autoClear = !0, this.autoClearColor = !0, this.autoClearDepth = !0, this.autoClearStencil = !0, this.sortObjects = !0, this.clippingPlanes = [], this.localClippingEnabled = !1, this.toneMapping = 0, this.toneMappingExposure = 1, this.transmissionResolutionScale = 1;
|
|
11367
11367
|
let T = this, E = !1;
|
|
11368
11368
|
this._outputColorSpace = y;
|
|
11369
|
-
let D = 0, O = 0, k = null, A = -1, j = null, M = new Ae(), N = new Ae(),
|
|
11369
|
+
let D = 0, O = 0, k = null, A = -1, j = null, M = new Ae(), N = new Ae(), P = null, F = new X(0), I = 0, ee = t.width, te = t.height, L = 1, ne = null, re = null, R = new Ae(0, 0, ee, te), z = new Ae(0, 0, ee, te), B = !1, ie = new lr(), ae = !1, oe = !1, se = new ct(), ce = new U(), le = new Ae(), ue = {
|
|
11370
11370
|
background: null,
|
|
11371
11371
|
fog: null,
|
|
11372
11372
|
environment: null,
|
|
@@ -11374,7 +11374,7 @@ var Qc = class {
|
|
|
11374
11374
|
isScene: !0
|
|
11375
11375
|
}, de = !1;
|
|
11376
11376
|
function V() {
|
|
11377
|
-
return k === null ?
|
|
11377
|
+
return k === null ? L : 1;
|
|
11378
11378
|
}
|
|
11379
11379
|
let H = n;
|
|
11380
11380
|
function fe(e, n) {
|
|
@@ -11415,39 +11415,39 @@ var Qc = class {
|
|
|
11415
11415
|
let e = W.get("WEBGL_lose_context");
|
|
11416
11416
|
e && e.restoreContext();
|
|
11417
11417
|
}, this.getPixelRatio = function() {
|
|
11418
|
-
return
|
|
11418
|
+
return L;
|
|
11419
11419
|
}, this.setPixelRatio = function(e) {
|
|
11420
|
-
e !== void 0 && (
|
|
11420
|
+
e !== void 0 && (L = e, this.setSize(ee, te, !1));
|
|
11421
11421
|
}, this.getSize = function(e) {
|
|
11422
|
-
return e.set(
|
|
11422
|
+
return e.set(ee, te);
|
|
11423
11423
|
}, this.setSize = function(e, n, r = !0) {
|
|
11424
11424
|
if (Re.isPresenting) {
|
|
11425
11425
|
console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");
|
|
11426
11426
|
return;
|
|
11427
11427
|
}
|
|
11428
|
-
|
|
11428
|
+
ee = e, te = n, t.width = Math.floor(e * L), t.height = Math.floor(n * L), r === !0 && (t.style.width = e + "px", t.style.height = n + "px"), this.setViewport(0, 0, e, n);
|
|
11429
11429
|
}, this.getDrawingBufferSize = function(e) {
|
|
11430
|
-
return e.set(
|
|
11430
|
+
return e.set(ee * L, te * L).floor();
|
|
11431
11431
|
}, this.setDrawingBufferSize = function(e, n, r) {
|
|
11432
|
-
|
|
11432
|
+
ee = e, te = n, L = r, t.width = Math.floor(e * r), t.height = Math.floor(n * r), this.setViewport(0, 0, e, n);
|
|
11433
11433
|
}, this.getCurrentViewport = function(e) {
|
|
11434
11434
|
return e.copy(M);
|
|
11435
11435
|
}, this.getViewport = function(e) {
|
|
11436
|
-
return e.copy(
|
|
11436
|
+
return e.copy(R);
|
|
11437
11437
|
}, this.setViewport = function(e, t, n, r) {
|
|
11438
|
-
e.isVector4 ?
|
|
11438
|
+
e.isVector4 ? R.set(e.x, e.y, e.z, e.w) : R.set(e, t, n, r), K.viewport(M.copy(R).multiplyScalar(L).round());
|
|
11439
11439
|
}, this.getScissor = function(e) {
|
|
11440
|
-
return e.copy(
|
|
11440
|
+
return e.copy(z);
|
|
11441
11441
|
}, this.setScissor = function(e, t, n, r) {
|
|
11442
|
-
e.isVector4 ?
|
|
11442
|
+
e.isVector4 ? z.set(e.x, e.y, e.z, e.w) : z.set(e, t, n, r), K.scissor(N.copy(z).multiplyScalar(L).round());
|
|
11443
11443
|
}, this.getScissorTest = function() {
|
|
11444
|
-
return
|
|
11444
|
+
return B;
|
|
11445
11445
|
}, this.setScissorTest = function(e) {
|
|
11446
|
-
K.setScissorTest(
|
|
11446
|
+
K.setScissorTest(B = e);
|
|
11447
11447
|
}, this.setOpaqueSort = function(e) {
|
|
11448
|
-
|
|
11448
|
+
ne = e;
|
|
11449
11449
|
}, this.setTransparentSort = function(e) {
|
|
11450
|
-
|
|
11450
|
+
re = e;
|
|
11451
11451
|
}, this.getClearColor = function(e) {
|
|
11452
11452
|
return e.copy(Oe.getClearColor());
|
|
11453
11453
|
}, this.setClearColor = function() {
|
|
@@ -11504,7 +11504,7 @@ var Qc = class {
|
|
|
11504
11504
|
}), e.isShaderMaterial && Se.releaseShaderCache(e));
|
|
11505
11505
|
}
|
|
11506
11506
|
this.renderBufferDirect = function(e, t, n, r, i, a) {
|
|
11507
|
-
t === null && (t =
|
|
11507
|
+
t === null && (t = ue);
|
|
11508
11508
|
let o = i.isMesh && i.matrixWorld.determinant() < 0, s = at(e, t, n, r, i);
|
|
11509
11509
|
K.setMaterial(r, o);
|
|
11510
11510
|
let c = n.index, l = 1;
|
|
@@ -11591,13 +11591,13 @@ var Qc = class {
|
|
|
11591
11591
|
return;
|
|
11592
11592
|
}
|
|
11593
11593
|
if (E === !0) return;
|
|
11594
|
-
if (e.matrixWorldAutoUpdate === !0 && e.updateMatrixWorld(), t.parent === null && t.matrixWorldAutoUpdate === !0 && t.updateMatrixWorld(), Re.enabled === !0 && Re.isPresenting === !0 && (Re.cameraAutoUpdate === !0 && Re.updateCamera(t), t = Re.getCamera()), e.isScene === !0 && e.onBeforeRender(T, e, t, k), x = Te.get(e, C.length), x.init(t), C.push(x),
|
|
11594
|
+
if (e.matrixWorldAutoUpdate === !0 && e.updateMatrixWorld(), t.parent === null && t.matrixWorldAutoUpdate === !0 && t.updateMatrixWorld(), Re.enabled === !0 && Re.isPresenting === !0 && (Re.cameraAutoUpdate === !0 && Re.updateCamera(t), t = Re.getCamera()), e.isScene === !0 && e.onBeforeRender(T, e, t, k), x = Te.get(e, C.length), x.init(t), C.push(x), se.multiplyMatrices(t.projectionMatrix, t.matrixWorldInverse), ie.setFromProjectionMatrix(se, w, t.reversedDepth), oe = this.localClippingEnabled, ae = Ee.init(this.clippingPlanes, oe), v = we.get(e, S.length), v.init(), S.push(v), Re.enabled === !0 && Re.isPresenting === !0) {
|
|
11595
11595
|
let e = T.xr.getDepthSensingMesh();
|
|
11596
11596
|
e !== null && Ze(e, t, -Infinity, T.sortObjects);
|
|
11597
11597
|
}
|
|
11598
|
-
Ze(e, t, 0, T.sortObjects), v.finish(), T.sortObjects === !0 && v.sort(
|
|
11598
|
+
Ze(e, t, 0, T.sortObjects), v.finish(), T.sortObjects === !0 && v.sort(ne, re), de = Re.enabled === !1 || Re.isPresenting === !1 || Re.hasDepthSensing() === !1, de && Oe.addToRenderList(v, e), this.info.render.frame++, ae === !0 && Ee.beginShadows();
|
|
11599
11599
|
let n = x.state.shadowsArray;
|
|
11600
|
-
De.render(n, e, t),
|
|
11600
|
+
De.render(n, e, t), ae === !0 && Ee.endShadows(), this.info.autoReset === !0 && this.info.reset();
|
|
11601
11601
|
let r = v.opaque, i = v.transmissive;
|
|
11602
11602
|
if (x.setupLights(), t.isArrayCamera) {
|
|
11603
11603
|
let n = t.cameras;
|
|
@@ -11611,7 +11611,7 @@ var Qc = class {
|
|
|
11611
11611
|
Qe(v, e, r, r.viewport);
|
|
11612
11612
|
}
|
|
11613
11613
|
} else i.length > 0 && $e(r, i, e, t), de && Oe.render(e), Qe(v, e, t);
|
|
11614
|
-
k !== null && O === 0 && (J.updateMultisampleRenderTarget(k), J.updateRenderTargetMipmap(k)), e.isScene === !0 && e.onAfterRender(T, e, t), Fe.resetDefaultState(), A = -1, j = null, C.pop(), C.length > 0 ? (x = C[C.length - 1],
|
|
11614
|
+
k !== null && O === 0 && (J.updateMultisampleRenderTarget(k), J.updateRenderTargetMipmap(k)), e.isScene === !0 && e.onAfterRender(T, e, t), Fe.resetDefaultState(), A = -1, j = null, C.pop(), C.length > 0 ? (x = C[C.length - 1], ae === !0 && Ee.setGlobalState(T.clippingPlanes, x.state.camera)) : x = null, S.pop(), v = S.length > 0 ? S[S.length - 1] : null;
|
|
11615
11615
|
};
|
|
11616
11616
|
function Ze(e, t, n, r) {
|
|
11617
11617
|
if (e.visible === !1) return;
|
|
@@ -11620,20 +11620,20 @@ var Qc = class {
|
|
|
11620
11620
|
else if (e.isLOD) e.autoUpdate === !0 && e.update(t);
|
|
11621
11621
|
else if (e.isLight) x.pushLight(e), e.castShadow && x.pushShadow(e);
|
|
11622
11622
|
else if (e.isSprite) {
|
|
11623
|
-
if (!e.frustumCulled ||
|
|
11624
|
-
r &&
|
|
11623
|
+
if (!e.frustumCulled || ie.intersectsSprite(e)) {
|
|
11624
|
+
r && le.setFromMatrixPosition(e.matrixWorld).applyMatrix4(se);
|
|
11625
11625
|
let t = xe.update(e), i = e.material;
|
|
11626
|
-
i.visible && v.push(e, t, i, n,
|
|
11626
|
+
i.visible && v.push(e, t, i, n, le.z, null);
|
|
11627
11627
|
}
|
|
11628
|
-
} else if ((e.isMesh || e.isLine || e.isPoints) && (!e.frustumCulled ||
|
|
11628
|
+
} else if ((e.isMesh || e.isLine || e.isPoints) && (!e.frustumCulled || ie.intersectsObject(e))) {
|
|
11629
11629
|
let t = xe.update(e), i = e.material;
|
|
11630
|
-
if (r && (e.boundingSphere === void 0 ? (t.boundingSphere === null && t.computeBoundingSphere(),
|
|
11630
|
+
if (r && (e.boundingSphere === void 0 ? (t.boundingSphere === null && t.computeBoundingSphere(), le.copy(t.boundingSphere.center)) : (e.boundingSphere === null && e.computeBoundingSphere(), le.copy(e.boundingSphere.center)), le.applyMatrix4(e.matrixWorld).applyMatrix4(se)), Array.isArray(i)) {
|
|
11631
11631
|
let r = t.groups;
|
|
11632
11632
|
for (let a = 0, o = r.length; a < o; a++) {
|
|
11633
11633
|
let o = r[a], s = i[o.materialIndex];
|
|
11634
|
-
s && s.visible && v.push(e, t, s, n,
|
|
11634
|
+
s && s.visible && v.push(e, t, s, n, le.z, o);
|
|
11635
11635
|
}
|
|
11636
|
-
} else i.visible && v.push(e, t, i, n,
|
|
11636
|
+
} else i.visible && v.push(e, t, i, n, le.z, null);
|
|
11637
11637
|
}
|
|
11638
11638
|
}
|
|
11639
11639
|
let i = e.children;
|
|
@@ -11641,7 +11641,7 @@ var Qc = class {
|
|
|
11641
11641
|
}
|
|
11642
11642
|
function Qe(e, t, n, r) {
|
|
11643
11643
|
let i = e.opaque, a = e.transmissive, o = e.transparent;
|
|
11644
|
-
x.setupLightsView(n),
|
|
11644
|
+
x.setupLightsView(n), ae === !0 && Ee.setGlobalState(T.clippingPlanes, n), r && K.viewport(M.copy(r)), i.length > 0 && et(i, t, n), a.length > 0 && et(a, t, n), o.length > 0 && et(o, t, n), K.buffers.depth.setTest(!0), K.buffers.depth.setMask(!0), K.buffers.color.setMask(!0), K.setPolygonOffset(!1);
|
|
11645
11645
|
}
|
|
11646
11646
|
function $e(e, t, n, r) {
|
|
11647
11647
|
if ((n.isScene === !0 ? n.overrideMaterial : null) !== null) return;
|
|
@@ -11658,11 +11658,11 @@ var Qc = class {
|
|
|
11658
11658
|
let s = x.state.transmissionRenderTarget[r.id], c = r.viewport || M;
|
|
11659
11659
|
s.setSize(c.z * T.transmissionResolutionScale, c.w * T.transmissionResolutionScale);
|
|
11660
11660
|
let u = T.getRenderTarget(), d = T.getActiveCubeFace(), f = T.getActiveMipmapLevel();
|
|
11661
|
-
T.setRenderTarget(s), T.getClearColor(
|
|
11661
|
+
T.setRenderTarget(s), T.getClearColor(F), I = T.getClearAlpha(), I < 1 && T.setClearColor(16777215, .5), T.clear(), de && Oe.render(n);
|
|
11662
11662
|
let p = T.toneMapping;
|
|
11663
11663
|
T.toneMapping = 0;
|
|
11664
11664
|
let m = r.viewport;
|
|
11665
|
-
if (r.viewport !== void 0 && (r.viewport = void 0), x.setupLightsView(r),
|
|
11665
|
+
if (r.viewport !== void 0 && (r.viewport = void 0), x.setupLightsView(r), ae === !0 && Ee.setGlobalState(T.clippingPlanes, r), et(e, n, r), J.updateMultisampleRenderTarget(s), J.updateRenderTargetMipmap(s), W.has("WEBGL_multisampled_render_to_texture") === !1) {
|
|
11666
11666
|
let e = !1;
|
|
11667
11667
|
for (let i = 0, a = t.length; i < a; i++) {
|
|
11668
11668
|
let a = t[i], o = a.object, s = a.geometry, c = a.material, l = a.group;
|
|
@@ -11673,7 +11673,7 @@ var Qc = class {
|
|
|
11673
11673
|
}
|
|
11674
11674
|
e === !0 && (J.updateMultisampleRenderTarget(s), J.updateRenderTargetMipmap(s));
|
|
11675
11675
|
}
|
|
11676
|
-
T.setRenderTarget(u, d, f), T.setClearColor(
|
|
11676
|
+
T.setRenderTarget(u, d, f), T.setClearColor(F, I), m !== void 0 && (r.viewport = m), T.toneMapping = p;
|
|
11677
11677
|
}
|
|
11678
11678
|
function et(e, t, n) {
|
|
11679
11679
|
let r = t.isScene === !0 ? t.overrideMaterial : null;
|
|
@@ -11686,7 +11686,7 @@ var Qc = class {
|
|
|
11686
11686
|
e.onBeforeRender(T, t, n, r, i, a), e.modelViewMatrix.multiplyMatrices(n.matrixWorldInverse, e.matrixWorld), e.normalMatrix.getNormalMatrix(e.modelViewMatrix), i.onBeforeRender(T, t, n, r, e, a), i.transparent === !0 && i.side === 2 && i.forceSinglePass === !1 ? (i.side = 1, i.needsUpdate = !0, T.renderBufferDirect(n, t, r, i, e, a), i.side = 0, i.needsUpdate = !0, T.renderBufferDirect(n, t, r, i, e, a), i.side = 2) : T.renderBufferDirect(n, t, r, i, e, a), e.onAfterRender(T, t, n, r, i, a);
|
|
11687
11687
|
}
|
|
11688
11688
|
function nt(e, t, n) {
|
|
11689
|
-
t.isScene !== !0 && (t =
|
|
11689
|
+
t.isScene !== !0 && (t = ue);
|
|
11690
11690
|
let r = q.get(e), i = x.state.lights, a = x.state.shadowsArray, o = i.state.version, s = Se.getParameters(e, i.state, a, t, n), c = Se.getProgramCacheKey(s), l = r.programs;
|
|
11691
11691
|
r.environment = e.isMeshStandardMaterial ? t.environment : null, r.fog = t.fog, r.envMap = (e.isMeshStandardMaterial ? ve : _e).get(e.envMap || r.environment), r.envMapRotation = r.environment !== null && e.envMap === null ? t.environmentRotation : e.envMapRotation, l === void 0 && (e.addEventListener("dispose", He), l = /* @__PURE__ */ new Map(), r.programs = l);
|
|
11692
11692
|
let u = l.get(c);
|
|
@@ -11708,11 +11708,11 @@ var Qc = class {
|
|
|
11708
11708
|
n.outputColorSpace = t.outputColorSpace, n.batching = t.batching, n.batchingColor = t.batchingColor, n.instancing = t.instancing, n.instancingColor = t.instancingColor, n.instancingMorph = t.instancingMorph, n.skinning = t.skinning, n.morphTargets = t.morphTargets, n.morphNormals = t.morphNormals, n.morphColors = t.morphColors, n.morphTargetsCount = t.morphTargetsCount, n.numClippingPlanes = t.numClippingPlanes, n.numIntersection = t.numClipIntersection, n.vertexAlphas = t.vertexAlphas, n.vertexTangents = t.vertexTangents, n.toneMapping = t.toneMapping;
|
|
11709
11709
|
}
|
|
11710
11710
|
function at(e, t, n, r, i) {
|
|
11711
|
-
t.isScene !== !0 && (t =
|
|
11711
|
+
t.isScene !== !0 && (t = ue), J.resetTextureUnits();
|
|
11712
11712
|
let a = t.fog, o = r.isMeshStandardMaterial ? t.environment : null, s = k === null ? T.outputColorSpace : k.isXRRenderTarget === !0 ? k.texture.colorSpace : b, c = (r.isMeshStandardMaterial ? ve : _e).get(r.envMap || o), l = r.vertexColors === !0 && !!n.attributes.color && n.attributes.color.itemSize === 4, u = !!n.attributes.tangent && (!!r.normalMap || r.anisotropy > 0), d = !!n.morphAttributes.position, f = !!n.morphAttributes.normal, p = !!n.morphAttributes.color, m = 0;
|
|
11713
11713
|
r.toneMapped && (k === null || k.isXRRenderTarget === !0) && (m = T.toneMapping);
|
|
11714
11714
|
let h = n.morphAttributes.position || n.morphAttributes.normal || n.morphAttributes.color, g = h === void 0 ? 0 : h.length, _ = q.get(r), v = x.state.lights;
|
|
11715
|
-
if (
|
|
11715
|
+
if (ae === !0 && (oe === !0 || e !== j)) {
|
|
11716
11716
|
let t = e === j && r.id === A;
|
|
11717
11717
|
Ee.setState(r, e, t);
|
|
11718
11718
|
}
|
|
@@ -11724,7 +11724,7 @@ var Qc = class {
|
|
|
11724
11724
|
if (K.useProgram(S.program) && (C = !0, w = !0, E = !0), r.id !== A && (A = r.id, w = !0), C || j !== e) {
|
|
11725
11725
|
K.buffers.depth.getReversed() && e.reversedDepth !== !0 && (e._reversedDepth = !0, e.updateProjectionMatrix()), D.setValue(H, "projectionMatrix", e.projectionMatrix), D.setValue(H, "viewMatrix", e.matrixWorldInverse);
|
|
11726
11726
|
let t = D.map.cameraPosition;
|
|
11727
|
-
t !== void 0 && t.setValue(H,
|
|
11727
|
+
t !== void 0 && t.setValue(H, ce.setFromMatrixPosition(e.matrixWorld)), G.logarithmicDepthBuffer && D.setValue(H, "logDepthBufFC", 2 / (Math.log(e.far + 1) / Math.LN2)), (r.isMeshPhongMaterial || r.isMeshToonMaterial || r.isMeshLambertMaterial || r.isMeshBasicMaterial || r.isMeshStandardMaterial || r.isShaderMaterial) && D.setValue(H, "isOrthographic", e.isOrthographicCamera === !0), j !== e && (j = e, w = !0, E = !0);
|
|
11728
11728
|
}
|
|
11729
11729
|
if (i.isSkinnedMesh) {
|
|
11730
11730
|
D.setOptional(H, i, "bindMatrix"), D.setOptional(H, i, "bindMatrixInverse");
|
|
@@ -11733,7 +11733,7 @@ var Qc = class {
|
|
|
11733
11733
|
}
|
|
11734
11734
|
i.isBatchedMesh && (D.setOptional(H, i, "batchingTexture"), D.setValue(H, "batchingTexture", i._matricesTexture, J), D.setOptional(H, i, "batchingIdTexture"), D.setValue(H, "batchingIdTexture", i._indirectTexture, J), D.setOptional(H, i, "batchingColorTexture"), i._colorsTexture !== null && D.setValue(H, "batchingColorTexture", i._colorsTexture, J));
|
|
11735
11735
|
let M = n.morphAttributes;
|
|
11736
|
-
if ((M.position !== void 0 || M.normal !== void 0 || M.color !== void 0) && ke.update(i, n, S), (w || _.receiveShadow !== i.receiveShadow) && (_.receiveShadow = i.receiveShadow, D.setValue(H, "receiveShadow", i.receiveShadow)), r.isMeshGouraudMaterial && r.envMap !== null && (O.envMap.value = c, O.flipEnvMap.value = c.isCubeTexture && c.isRenderTargetTexture === !1 ? -1 : 1), r.isMeshStandardMaterial && r.envMap === null && t.environment !== null && (O.envMapIntensity.value = t.environmentIntensity), w && (D.setValue(H, "toneMappingExposure", T.toneMappingExposure), _.needsLights && ot(O, E), a && r.fog === !0 && Ce.refreshFogUniforms(O, a), Ce.refreshMaterialUniforms(O, r,
|
|
11736
|
+
if ((M.position !== void 0 || M.normal !== void 0 || M.color !== void 0) && ke.update(i, n, S), (w || _.receiveShadow !== i.receiveShadow) && (_.receiveShadow = i.receiveShadow, D.setValue(H, "receiveShadow", i.receiveShadow)), r.isMeshGouraudMaterial && r.envMap !== null && (O.envMap.value = c, O.flipEnvMap.value = c.isCubeTexture && c.isRenderTargetTexture === !1 ? -1 : 1), r.isMeshStandardMaterial && r.envMap === null && t.environment !== null && (O.envMapIntensity.value = t.environmentIntensity), w && (D.setValue(H, "toneMappingExposure", T.toneMappingExposure), _.needsLights && ot(O, E), a && r.fog === !0 && Ce.refreshFogUniforms(O, a), Ce.refreshMaterialUniforms(O, r, L, te, x.state.transmissionRenderTarget[e.id]), Us.upload(H, rt(_), O, J)), r.isShaderMaterial && r.uniformsNeedUpdate === !0 && (Us.upload(H, rt(_), O, J), r.uniformsNeedUpdate = !1), r.isSpriteMaterial && D.setValue(H, "center", i.center), D.setValue(H, "modelViewMatrix", i.modelViewMatrix), D.setValue(H, "normalMatrix", i.normalMatrix), D.setValue(H, "modelMatrix", i.matrixWorld), r.isShaderMaterial || r.isRawShaderMaterial) {
|
|
11737
11737
|
let e = r.uniformsGroups;
|
|
11738
11738
|
for (let t = 0, n = e.length; t < n; t++) {
|
|
11739
11739
|
let n = e[t];
|
|
@@ -11780,9 +11780,9 @@ var Qc = class {
|
|
|
11780
11780
|
let c = e.texture;
|
|
11781
11781
|
(c.isData3DTexture || c.isDataArrayTexture || c.isCompressedArrayTexture) && (o = !0);
|
|
11782
11782
|
let l = q.get(e).__webglFramebuffer;
|
|
11783
|
-
e.isWebGLCubeRenderTarget ? (i = Array.isArray(l[t]) ? l[t][n] : l[t], a = !0) : i = e.samples > 0 && J.useMultisampledRTT(e) === !1 ? q.get(e).__webglMultisampledFramebuffer : Array.isArray(l) ? l[n] : l, M.copy(e.viewport), N.copy(e.scissor),
|
|
11784
|
-
} else M.copy(
|
|
11785
|
-
if (n !== 0 && (i = lt), K.bindFramebuffer(H.FRAMEBUFFER, i) && r && K.drawBuffers(e, i), K.viewport(M), K.scissor(N), K.setScissorTest(
|
|
11783
|
+
e.isWebGLCubeRenderTarget ? (i = Array.isArray(l[t]) ? l[t][n] : l[t], a = !0) : i = e.samples > 0 && J.useMultisampledRTT(e) === !1 ? q.get(e).__webglMultisampledFramebuffer : Array.isArray(l) ? l[n] : l, M.copy(e.viewport), N.copy(e.scissor), P = e.scissorTest;
|
|
11784
|
+
} else M.copy(R).multiplyScalar(L).floor(), N.copy(z).multiplyScalar(L).floor(), P = B;
|
|
11785
|
+
if (n !== 0 && (i = lt), K.bindFramebuffer(H.FRAMEBUFFER, i) && r && K.drawBuffers(e, i), K.viewport(M), K.scissor(N), K.setScissorTest(P), a) {
|
|
11786
11786
|
let r = q.get(e.texture);
|
|
11787
11787
|
H.framebufferTexture2D(H.FRAMEBUFFER, H.COLOR_ATTACHMENT0, H.TEXTURE_CUBE_MAP_POSITIVE_X + t, r.__webglTexture, n);
|
|
11788
11788
|
} else if (o) {
|
|
@@ -11890,7 +11890,7 @@ var Qc = class {
|
|
|
11890
11890
|
}
|
|
11891
11891
|
}, $c = {
|
|
11892
11892
|
name: "@liquidcars/atlas",
|
|
11893
|
-
version: "0.1.
|
|
11893
|
+
version: "0.1.45",
|
|
11894
11894
|
description: "Reusable 3D conceptual atlas Web Component for LiquidCars-style models",
|
|
11895
11895
|
type: "module",
|
|
11896
11896
|
scripts: {
|
|
@@ -11933,34 +11933,34 @@ var Qc = class {
|
|
|
11933
11933
|
"callers",
|
|
11934
11934
|
"called",
|
|
11935
11935
|
"none"
|
|
11936
|
-
]), rl = .05, il =
|
|
11937
|
-
function cl(e) {
|
|
11938
|
-
return Array.isArray(e) ? e.map(cl) : !e || typeof e != "object" ? e : Object.fromEntries(Object.entries(e).filter(([, e]) => typeof e != "function" && e !== void 0).map(([e, t]) => [e, cl(t)]));
|
|
11939
|
-
}
|
|
11936
|
+
]), rl = .05, il = 6, al = 15, ol = /* @__PURE__ */ new Map(), sl = /* @__PURE__ */ new Map(), cl = /* @__PURE__ */ new Map();
|
|
11940
11937
|
function ll(e) {
|
|
11941
|
-
return
|
|
11938
|
+
return Array.isArray(e) ? e.map(ll) : !e || typeof e != "object" ? e : Object.fromEntries(Object.entries(e).filter(([, e]) => typeof e != "function" && e !== void 0).map(([e, t]) => [e, ll(t)]));
|
|
11939
|
+
}
|
|
11940
|
+
function ul(e) {
|
|
11941
|
+
return (e == null ? [] : Array.isArray(e) ? e : [e]).map((e) => typeof e == "string" ? { name: e } : ll(e)).filter((e) => e && String(e.name || "").trim()).map((e) => ({
|
|
11942
11942
|
...e,
|
|
11943
11943
|
name: String(e.name).trim()
|
|
11944
11944
|
}));
|
|
11945
11945
|
}
|
|
11946
|
-
function
|
|
11946
|
+
function dl(e) {
|
|
11947
11947
|
return [...new Set((e == null ? [] : Array.isArray(e) ? e : [e]).map((e) => String(e || "").trim()).filter(Boolean))];
|
|
11948
11948
|
}
|
|
11949
|
-
function
|
|
11950
|
-
return e ? typeof e == "string" ? { spdx: e } :
|
|
11949
|
+
function fl(e) {
|
|
11950
|
+
return e ? typeof e == "string" ? { spdx: e } : ll(e) : null;
|
|
11951
11951
|
}
|
|
11952
|
-
function
|
|
11953
|
-
let n =
|
|
11952
|
+
function pl(e, t) {
|
|
11953
|
+
let n = ll(e || {}), r = String(n.id || `source-${t + 1}`).trim();
|
|
11954
11954
|
if (!r) throw TypeError("Geometry pack sources require an id.");
|
|
11955
11955
|
return {
|
|
11956
11956
|
...n,
|
|
11957
11957
|
id: r,
|
|
11958
|
-
authors:
|
|
11959
|
-
license:
|
|
11958
|
+
authors: ul(n.authors ?? n.author),
|
|
11959
|
+
license: fl(n.license)
|
|
11960
11960
|
};
|
|
11961
11961
|
}
|
|
11962
|
-
function
|
|
11963
|
-
let r =
|
|
11962
|
+
function ml(e, t, n) {
|
|
11963
|
+
let r = ll(e || {}), i = String(r.id || "").trim();
|
|
11964
11964
|
if (!i) throw TypeError(`Geometry pack resource at index ${t} requires an id.`);
|
|
11965
11965
|
let a = r.source == null ? null : String(r.source).trim();
|
|
11966
11966
|
if (a && !n.has(a)) throw TypeError(`Geometry pack resource '${i}' references unknown source '${a}'.`);
|
|
@@ -11969,13 +11969,13 @@ function pl(e, t, n) {
|
|
|
11969
11969
|
id: i,
|
|
11970
11970
|
kind: String(r.kind || r.type || "asset"),
|
|
11971
11971
|
source: a,
|
|
11972
|
-
authors:
|
|
11973
|
-
license:
|
|
11972
|
+
authors: ul(r.authors ?? r.author),
|
|
11973
|
+
license: fl(r.license)
|
|
11974
11974
|
};
|
|
11975
11975
|
}
|
|
11976
|
-
function
|
|
11976
|
+
function hl(e, t) {
|
|
11977
11977
|
if (!e.showcase || typeof e.showcase != "object") return null;
|
|
11978
|
-
let n =
|
|
11978
|
+
let n = ll(e.showcase), r = Array.isArray(n.groups) ? n.groups : [], i = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Set(), o = r.map((e, n) => {
|
|
11979
11979
|
let r = e && typeof e == "object" ? e : {}, o = String(r.id || `group-${n + 1}`).trim();
|
|
11980
11980
|
if (!o || i.has(o)) throw TypeError(`Geometry pack '${t}' showcase contains a duplicate or empty group id.`);
|
|
11981
11981
|
i.add(o);
|
|
@@ -11993,8 +11993,8 @@ function ml(e, t) {
|
|
|
11993
11993
|
...r,
|
|
11994
11994
|
id: s,
|
|
11995
11995
|
geometry: i.includes(".") ? i : `${t}.${i}`,
|
|
11996
|
-
geometryOptions:
|
|
11997
|
-
geometryPalette:
|
|
11996
|
+
geometryOptions: ll(r.geometryOptions || r.options || r.parameters || {}),
|
|
11997
|
+
geometryPalette: ll(r.geometryPalette || r.palette || {})
|
|
11998
11998
|
};
|
|
11999
11999
|
})
|
|
12000
12000
|
};
|
|
@@ -12004,11 +12004,11 @@ function ml(e, t) {
|
|
|
12004
12004
|
title: String(n.title || e.name || t),
|
|
12005
12005
|
description: String(n.description || ""),
|
|
12006
12006
|
groups: o,
|
|
12007
|
-
relations:
|
|
12007
|
+
relations: ll(Array.isArray(n.relations) ? n.relations : [])
|
|
12008
12008
|
};
|
|
12009
12009
|
}
|
|
12010
|
-
function
|
|
12011
|
-
let n = (Array.isArray(e.sources) ? e.sources : []).map(
|
|
12010
|
+
function gl(e, t) {
|
|
12011
|
+
let n = (Array.isArray(e.sources) ? e.sources : []).map(pl), r = new Set(n.map((e) => e.id)), i = (Array.isArray(e.resources) ? e.resources : []).map((e, t) => ml(e, t, r));
|
|
12012
12012
|
if (new Set(i.map((e) => e.id)).size !== i.length) throw TypeError(`Geometry pack '${t}' contains duplicate resource ids.`);
|
|
12013
12013
|
return {
|
|
12014
12014
|
namespace: t,
|
|
@@ -12017,36 +12017,36 @@ function hl(e, t) {
|
|
|
12017
12017
|
description: String(e.description || ""),
|
|
12018
12018
|
category: String(e.category || e.name || t),
|
|
12019
12019
|
homepage: e.homepage ? String(e.homepage) : "",
|
|
12020
|
-
repository:
|
|
12021
|
-
authors:
|
|
12022
|
-
license:
|
|
12020
|
+
repository: ll(e.repository || null),
|
|
12021
|
+
authors: ul(e.authors ?? e.author),
|
|
12022
|
+
license: fl(e.license),
|
|
12023
12023
|
attribution: String(e.attribution || ""),
|
|
12024
|
-
collections:
|
|
12025
|
-
showcase:
|
|
12024
|
+
collections: ll(Array.isArray(e.collections) ? e.collections : []),
|
|
12025
|
+
showcase: hl(e, t),
|
|
12026
12026
|
sources: n,
|
|
12027
12027
|
resources: i,
|
|
12028
12028
|
geometries: []
|
|
12029
12029
|
};
|
|
12030
12030
|
}
|
|
12031
|
-
function
|
|
12031
|
+
function _l(e) {
|
|
12032
12032
|
let { create: t, resourceMap: n, ...r } = e;
|
|
12033
12033
|
return {
|
|
12034
|
-
...
|
|
12034
|
+
...ll(r),
|
|
12035
12035
|
canonicalSize: [...e.canonicalSize],
|
|
12036
|
-
parameters:
|
|
12037
|
-
palette:
|
|
12038
|
-
anchors:
|
|
12036
|
+
parameters: ll(e.parameters),
|
|
12037
|
+
palette: ll(e.palette),
|
|
12038
|
+
anchors: ll(e.anchors)
|
|
12039
12039
|
};
|
|
12040
12040
|
}
|
|
12041
|
-
function _l(e) {
|
|
12042
|
-
return cl(e);
|
|
12043
|
-
}
|
|
12044
12041
|
function vl(e) {
|
|
12042
|
+
return ll(e);
|
|
12043
|
+
}
|
|
12044
|
+
function yl(e) {
|
|
12045
12045
|
if (!e || typeof e != "object") throw TypeError("A geometry pack must be an object.");
|
|
12046
12046
|
let t = String(e.namespace || "").trim();
|
|
12047
12047
|
if (!/^[a-z][a-z0-9-]*(?:\.[a-z][a-z0-9-]*)*$/i.test(t)) throw TypeError("A geometry pack requires a valid dot-separated namespace.");
|
|
12048
12048
|
if (!Array.isArray(e.geometries) || !e.geometries.length) throw TypeError("A geometry pack requires at least one geometry.");
|
|
12049
|
-
let n =
|
|
12049
|
+
let n = gl(e, t), r = Object.freeze(Object.fromEntries(n.resources.map((e) => [e.id, Object.freeze(ll(e))]))), i = [];
|
|
12050
12050
|
for (let a of e.geometries) {
|
|
12051
12051
|
if (!a || typeof a != "object" || !a.id) throw TypeError(`Geometry pack '${t}' contains an invalid geometry.`);
|
|
12052
12052
|
let o = String(a.id).includes(".") ? String(a.id).split(".").pop() : String(a.id), s = String(a.id).includes(".") ? String(a.id) : `${t}.${o}`;
|
|
@@ -12059,8 +12059,8 @@ function vl(e) {
|
|
|
12059
12059
|
packVersion: n.version,
|
|
12060
12060
|
category: a.category || n.category,
|
|
12061
12061
|
collection: a.collection == null ? "" : String(a.collection).trim(),
|
|
12062
|
-
tags:
|
|
12063
|
-
keywords:
|
|
12062
|
+
tags: dl(a.tags),
|
|
12063
|
+
keywords: dl(a.keywords),
|
|
12064
12064
|
canonicalSize: Array.isArray(a.canonicalSize) && a.canonicalSize.length === 3 ? a.canonicalSize.map(Number) : [
|
|
12065
12065
|
2.5,
|
|
12066
12066
|
1.5,
|
|
@@ -12078,41 +12078,41 @@ function vl(e) {
|
|
|
12078
12078
|
resourceMap: r
|
|
12079
12079
|
});
|
|
12080
12080
|
}
|
|
12081
|
-
|
|
12081
|
+
bl(t);
|
|
12082
12082
|
let a = [];
|
|
12083
12083
|
for (let e of i) {
|
|
12084
|
-
|
|
12085
|
-
for (let t of e.aliases || [])
|
|
12084
|
+
ol.set(e.id, e), sl.set(e.id, e.id);
|
|
12085
|
+
for (let t of e.aliases || []) sl.set(String(t), e.id);
|
|
12086
12086
|
a.push(e.id);
|
|
12087
12087
|
}
|
|
12088
|
-
n.geometries = [...a],
|
|
12089
|
-
let o =
|
|
12088
|
+
n.geometries = [...a], cl.set(t, n);
|
|
12089
|
+
let o = vl(n);
|
|
12090
12090
|
return typeof globalThis.dispatchEvent == "function" && typeof CustomEvent == "function" && globalThis.dispatchEvent(new CustomEvent("lc-geometry-registry-change", { detail: {
|
|
12091
12091
|
namespace: t,
|
|
12092
12092
|
geometries: a,
|
|
12093
12093
|
pack: o
|
|
12094
12094
|
} })), o;
|
|
12095
12095
|
}
|
|
12096
|
-
function
|
|
12096
|
+
function bl(e) {
|
|
12097
12097
|
let t = [];
|
|
12098
|
-
for (let [n, r] of
|
|
12099
|
-
for (let [e, n] of
|
|
12100
|
-
return
|
|
12101
|
-
}
|
|
12102
|
-
function bl() {
|
|
12103
|
-
return [...al.values()].map(gl);
|
|
12098
|
+
for (let [n, r] of ol) r.namespace === e && (ol.delete(n), t.push(n));
|
|
12099
|
+
for (let [e, n] of sl) t.includes(n) && sl.delete(e);
|
|
12100
|
+
return cl.delete(e), t;
|
|
12104
12101
|
}
|
|
12105
12102
|
function xl() {
|
|
12106
|
-
return [...
|
|
12103
|
+
return [...ol.values()].map(_l);
|
|
12107
12104
|
}
|
|
12108
|
-
function Sl(
|
|
12109
|
-
|
|
12110
|
-
return al.get(t) || null;
|
|
12105
|
+
function Sl() {
|
|
12106
|
+
return [...cl.values()].map(vl);
|
|
12111
12107
|
}
|
|
12112
12108
|
function Cl(e) {
|
|
12109
|
+
let t = sl.get(e) || e;
|
|
12110
|
+
return ol.get(t) || null;
|
|
12111
|
+
}
|
|
12112
|
+
function wl(e) {
|
|
12113
12113
|
return e === "container" || e === "shell";
|
|
12114
12114
|
}
|
|
12115
|
-
function
|
|
12115
|
+
function Tl(e = {}) {
|
|
12116
12116
|
let t = e && typeof e == "object" ? e : {}, n = Number(t.opacity);
|
|
12117
12117
|
return {
|
|
12118
12118
|
mode: t.mode === "connected" ? "connected" : "all",
|
|
@@ -12121,26 +12121,26 @@ function wl(e = {}) {
|
|
|
12121
12121
|
opacity: Number.isFinite(n) ? Math.max(.02, Math.min(.8, n)) : .12
|
|
12122
12122
|
};
|
|
12123
12123
|
}
|
|
12124
|
-
function
|
|
12124
|
+
function El(e) {
|
|
12125
12125
|
return [
|
|
12126
12126
|
"preserve",
|
|
12127
12127
|
"center",
|
|
12128
12128
|
"fit"
|
|
12129
12129
|
].includes(e) ? e : "preserve";
|
|
12130
12130
|
}
|
|
12131
|
-
function
|
|
12131
|
+
function Dl(e) {
|
|
12132
12132
|
return e === "model" ? "model" : "camera";
|
|
12133
12133
|
}
|
|
12134
|
-
function
|
|
12134
|
+
function Ol(e) {
|
|
12135
12135
|
return e === "ring" ? "ring" : tl;
|
|
12136
12136
|
}
|
|
12137
|
-
function
|
|
12137
|
+
function kl(e) {
|
|
12138
12138
|
return nl.includes(e) ? e : "selected";
|
|
12139
12139
|
}
|
|
12140
|
-
function
|
|
12140
|
+
function Al(e, t) {
|
|
12141
12141
|
e && e.transparent !== t && (e.transparent = t, e.needsUpdate = !0);
|
|
12142
12142
|
}
|
|
12143
|
-
|
|
12143
|
+
yl({
|
|
12144
12144
|
namespace: "geo",
|
|
12145
12145
|
name: "Geometric primitives",
|
|
12146
12146
|
version: "1",
|
|
@@ -12197,7 +12197,7 @@ vl({
|
|
|
12197
12197
|
} } : {}
|
|
12198
12198
|
}))
|
|
12199
12199
|
});
|
|
12200
|
-
var
|
|
12200
|
+
var jl = {
|
|
12201
12201
|
background: {
|
|
12202
12202
|
color: "#0a111a",
|
|
12203
12203
|
glow: "#1c2b39",
|
|
@@ -12242,17 +12242,17 @@ var Al = {
|
|
|
12242
12242
|
hint: !0
|
|
12243
12243
|
}
|
|
12244
12244
|
};
|
|
12245
|
-
function
|
|
12245
|
+
function Ml(e, t) {
|
|
12246
12246
|
let n = { ...e };
|
|
12247
12247
|
if (!t || typeof t != "object") return n;
|
|
12248
|
-
for (let [r, i] of Object.entries(t)) n[r] = i && typeof i == "object" && !Array.isArray(i) ?
|
|
12248
|
+
for (let [r, i] of Object.entries(t)) n[r] = i && typeof i == "object" && !Array.isArray(i) ? Ml(e?.[r] || {}, i) : i;
|
|
12249
12249
|
return n;
|
|
12250
12250
|
}
|
|
12251
|
-
function
|
|
12251
|
+
function Nl(e) {
|
|
12252
12252
|
let t = e && typeof e == "object" ? { ...e } : {};
|
|
12253
|
-
return typeof e == "string" ? t.background = { color: e } : typeof t.background == "string" && (t.background = { color: t.background }), jl
|
|
12253
|
+
return typeof e == "string" ? t.background = { color: e } : typeof t.background == "string" && (t.background = { color: t.background }), Ml(jl, t);
|
|
12254
12254
|
}
|
|
12255
|
-
function
|
|
12255
|
+
function Pl(e) {
|
|
12256
12256
|
if (!e || typeof e != "object") return "directed";
|
|
12257
12257
|
let t = String(e.mode || e.visual || e.render || e.type || e.direction || "").trim().toLowerCase().replace(/[_\s]+/g, "-");
|
|
12258
12258
|
return e.bidirectional === !0 || [
|
|
@@ -12267,7 +12267,7 @@ function Nl(e) {
|
|
|
12267
12267
|
"failed"
|
|
12268
12268
|
].includes(t) ? "broken" : "directed";
|
|
12269
12269
|
}
|
|
12270
|
-
var
|
|
12270
|
+
var Fl = [":host{display:block;position:relative;height:var(--lc-height,680px);min-height:420px;color:var(--lc-panel-title,#e9f0f5);font:14px Inter,system-ui,-apple-system,sans-serif;background:var(--lc-bg,#0a111a);border:1px solid #294252;border-radius:12px;overflow:hidden;contain:content}", "*{box-sizing:border-box}.atlas{display:grid;grid-template-columns:minmax(0,1fr) 300px;height:100%}.atlas[data-panel=hidden]{grid-template-columns:1fr}.viewport{position:relative;min-width:0;overflow:hidden;background:radial-gradient(ellipse at 50% 45%,var(--lc-bg-glow,#1c2b39),var(--lc-bg-fade,#0a111a) 82%)}canvas{display:block;width:100%;height:100%;cursor:grab;touch-action:none}.toolbar{position:absolute;z-index:10;bottom:28px;left:50%;transform:translateX(-50%);display:flex;gap:3px;padding:6px;background:var(--lc-toolbar-bg,#15232fe8);border:1px solid var(--lc-toolbar-border,#3a5062);border-radius:8px;white-space:nowrap}.toolbar[data-hidden=true],.toolbar[hidden],.panel[data-hidden=true],.panel[hidden],.crumbs[data-hidden=true],.crumbs[hidden],.hint[data-hidden=true],.hint[hidden]{display:none!important}.toolbar button{height:30px;padding:0 9px;border:0;border-radius:5px;background:none;color:var(--lc-toolbar-text,#dbe7ec);cursor:pointer}.toolbar button:hover,.toolbar button.active{background:var(--lc-toolbar-active,#1f3d4b);color:var(--lc-toolbar-active-text,#c5f2e9)}.toolbar i{display:block;width:1px;margin:2px 3px;background:#38515f}.hint{position:absolute;z-index:9;top:8px;bottom:auto;left:0;right:0;text-align:center;padding:2px 8px;font-size:11px;line-height:16px;color:var(--lc-hint,#8da6b8);pointer-events:none}.panel{overflow:auto;padding:24px 20px;background:var(--lc-panel-bg,linear-gradient(140deg,#182633,#0e1925 65%));border-left:1px solid var(--lc-panel-border,#2a3a48)}.panel h2{font-size:26px;line-height:1.12;font-weight:470;margin:12px 0;color:var(--lc-panel-title,#e9f0f5)}.panel h3{font-size:11px;letter-spacing:1.4px;color:#91aabd;margin:24px 0 10px}.panel p{font-size:14px;line-height:1.55;color:var(--lc-panel-text,#b5c6d2)}.panel .eyebrow{font-size:11px;letter-spacing:1.7px;color:#6ad7c0}.panel .sub{font-size:13px;color:#8fa8bd;margin-bottom:16px}.panel .external-link{display:inline-flex;align-items:center;gap:6px;margin:2px 0 12px;color:#6ad7c0;font-size:13px;font-weight:600;text-decoration:none}.panel .external-link:hover{text-decoration:underline}.panel button{display:block;width:100%;padding:10px 0;text-align:left;background:none;border:0;border-bottom:1px solid var(--lc-panel-border,#2a3a48);color:#d9e7eb;cursor:pointer}.panel button:hover{color:#6ad7c0}.panel .relation{padding:10px 0;border-bottom:1px solid var(--lc-panel-border,#2a3a48)}.panel .relation.selected{padding-left:9px;border-left:2px solid #6ad7c0;background:#18343f}.panel .relation strong{display:block;font-weight:550}.panel .relation small{display:block;color:#86a6b9;font-size:12px;margin-top:4px}.panel .back{color:#9db7c8;font-size:13px}.panel .crumbs{display:flex;flex-wrap:wrap;gap:5px;align-items:center;margin:0 0 12px}.panel .crumbs button{display:inline;width:auto;padding:3px 7px;border:0;border-radius:4px;background:var(--lc-crumb-bg,#142733);color:var(--lc-crumb-text,#91b6c7);font-size:12px}.panel .crumbs button.current{background:var(--lc-crumb-active,#1c4a4d);color:var(--lc-crumb-active-text,#c5f2e9)}.panel .note{border-top:1px solid var(--lc-panel-border,#2a3a48);padding-top:16px;margin-top:22px;font-size:12px;color:#7692a6}.error{position:absolute;inset:20%;padding:18px;background:#172b3b;border:1px solid #7896a9;line-height:1.5;z-index:4}@media(max-width:900px){.toolbar{gap:0}.toolbar button{padding:0 6px;font-size:12px}}@media(max-width:760px){:host{height:680px}.atlas{grid-template-columns:1fr;grid-template-rows:minmax(420px,1fr) auto}.panel{max-height:250px;border-left:0;border-top:1px solid var(--lc-panel-border,#2a3a48);padding:18px}.toolbar{bottom:24px}.hint{top:8px;bottom:auto;display:block}}"].join(""), Il = ".toolbar{max-width:calc(100% - 16px);overflow:visible}.toolbar-group{display:flex;align-items:center;gap:2px}.toolbar-group+.toolbar-group{padding-left:6px;border-left:1px solid #38515f}.toolbar .toolbar-icon{display:grid;width:30px;padding:0;place-items:center}.toolbar-icon svg,.toolbar-menu>summary svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}.toolbar-menu{position:relative}.toolbar-menu>summary{display:flex;align-items:center;height:30px;padding:0 8px;gap:6px;border-radius:5px;color:var(--lc-toolbar-text,#dbe7ec);cursor:pointer;list-style:none;user-select:none}.toolbar-menu>summary::-webkit-details-marker{display:none}.toolbar-menu>summary:hover,.toolbar-menu[open]>summary{background:var(--lc-toolbar-active,#1f3d4b);color:var(--lc-toolbar-active-text,#c5f2e9)}.toolbar-menu-status{max-width:92px;overflow:hidden;font-size:11px;text-overflow:ellipsis;white-space:nowrap}.toolbar-menu-chevron{width:10px;height:10px!important;transition:transform .16s ease}.toolbar-menu[open] .toolbar-menu-chevron{transform:rotate(180deg)}.toolbar-popover{position:absolute;right:0;bottom:calc(100% + 8px);display:grid;min-width:218px;padding:6px;border:1px solid var(--lc-toolbar-border,#3a5062);border-radius:9px;background:var(--lc-toolbar-bg,#15232ff7);box-shadow:0 14px 36px #0009}.toolbar-popover-title{padding:7px 9px 5px;color:var(--lc-hint,#8da6b8);font-size:9px;font-weight:700;letter-spacing:.1em;text-transform:uppercase}.toolbar .toolbar-option{display:grid;grid-template-columns:minmax(0,1fr) 18px;align-items:center;width:100%;height:auto;min-height:34px;padding:7px 9px;text-align:left}.toolbar-option span:first-child{overflow:hidden;text-overflow:ellipsis}.toolbar-option-check{color:var(--lc-toolbar-active-text,#c5f2e9);font-weight:700;text-align:center;visibility:hidden}.toolbar-option.active .toolbar-option-check{visibility:visible}.toolbar-option-separator{height:1px;margin:5px 7px;background:#38515f}.toolbar button[disabled]{opacity:.42;cursor:not-allowed}@media(max-width:620px){.toolbar-menu-status{display:none}.toolbar-menu>summary{width:30px;padding:0;justify-content:center}.toolbar-menu-chevron{display:none}.toolbar-group+.toolbar-group{padding-left:3px}.toolbar-popover{right:-4px}}", Ll = [
|
|
12271
12271
|
".viewport>.atlas-print-snapshot{display:none!important}",
|
|
12272
12272
|
"@media print{",
|
|
12273
12273
|
":host{-webkit-print-color-adjust:exact;print-color-adjust:exact;break-inside:avoid;page-break-inside:avoid}",
|
|
@@ -12276,17 +12276,17 @@ var Pl = [":host{display:block;position:relative;height:var(--lc-height,680px);m
|
|
|
12276
12276
|
":host([data-lc-print-ready]) .viewport>canvas:not(.atlas-print-snapshot){display:none!important}",
|
|
12277
12277
|
":host([data-lc-print-ready]) .viewport>.atlas-print-snapshot{display:block!important;width:100%;height:100%}",
|
|
12278
12278
|
"}"
|
|
12279
|
-
].join(""),
|
|
12280
|
-
minus:
|
|
12281
|
-
plus:
|
|
12282
|
-
fit:
|
|
12283
|
-
front:
|
|
12284
|
-
view:
|
|
12285
|
-
relations:
|
|
12286
|
-
focus:
|
|
12287
|
-
chevron:
|
|
12288
|
-
},
|
|
12289
|
-
function
|
|
12279
|
+
].join(""), Rl = (e, t = "0 0 24 24") => `<svg viewBox="${t}" aria-hidden="true">${e}</svg>`, zl = {
|
|
12280
|
+
minus: Rl("<path d=\"M6 12h12\"/>"),
|
|
12281
|
+
plus: Rl("<path d=\"M12 6v12M6 12h12\"/>"),
|
|
12282
|
+
fit: Rl("<path d=\"M9 4H4v5M15 4h5v5M20 15v5h-5M4 15v5h5\"/><circle cx=\"12\" cy=\"12\" r=\"2.5\"/>"),
|
|
12283
|
+
front: Rl("<rect x=\"4\" y=\"5\" width=\"16\" height=\"14\" rx=\"1.5\"/><path d=\"M8 16h8\"/>"),
|
|
12284
|
+
view: Rl("<path d=\"M2.5 12s3.5-5 9.5-5 9.5 5 9.5 5-3.5 5-9.5 5-9.5-5-9.5-5Z\"/><circle cx=\"12\" cy=\"12\" r=\"2.5\"/>"),
|
|
12285
|
+
relations: Rl("<circle cx=\"5\" cy=\"6\" r=\"2\"/><circle cx=\"19\" cy=\"7\" r=\"2\"/><circle cx=\"12\" cy=\"18\" r=\"2\"/><path d=\"m6.8 6.3 10.2.5M6.2 7.7l4.6 8.6m6.8-7.5-4.4 7.5\"/>"),
|
|
12286
|
+
focus: Rl("<circle cx=\"12\" cy=\"12\" r=\"7\"/><circle cx=\"12\" cy=\"12\" r=\"2.5\"/><path d=\"M12 2v3M12 19v3M2 12h3M19 12h3\"/>"),
|
|
12287
|
+
chevron: Rl("<path d=\"m8 10 4 4 4-4\"/>")
|
|
12288
|
+
}, Bl = (e, t, n = !1) => `<button class="toolbar-option${n ? " active" : ""}" data-action="${e}" aria-pressed="${n}"><span>${t}</span><span class="toolbar-option-check" aria-hidden="true">✓</span></button>`, Vl = (e, t, n, r, i) => `<details class="toolbar-menu" data-toolbar-menu="${e}"><summary aria-label="${n}" title="${n}">${t}<span class="toolbar-menu-status" data-toolbar-status="${e}">${r}</span>${zl.chevron}</summary><div class="toolbar-popover" role="menu"><div class="toolbar-popover-title">${n}</div>${i}</div></details>`, Hl = `<div class="atlas"><section class="viewport"><canvas tabindex="0" aria-label="Modelo 3D interactivo"></canvas><div class="toolbar" role="toolbar" aria-label="Controles de la vista"><div class="toolbar-group" data-toolbar-group="camera"><button class="toolbar-icon" data-action="minus" aria-label="Alejar" title="Alejar">${zl.minus}</button><button class="toolbar-icon" data-action="plus" aria-label="Acercar" title="Acercar">${zl.plus}</button><button class="toolbar-icon" data-action="fit" aria-label="Encuadrar todo el modelo" title="Encuadrar todo el modelo">${zl.fit}</button><button class="toolbar-icon" data-action="front" aria-label="Vista frontal" title="Vista frontal">${zl.front}</button></div><div class="toolbar-group" data-toolbar-group="view">${Vl("view", zl.view, "Vista", "Vista", Bl("labels", "Etiquetas", !0) + Bl("panel", "Información", !0) + Bl("item-facing", "Caras a cámara", !0) + "<div class=\"toolbar-option-separator\"></div>" + Bl("open-all", "Abrir todos") + Bl("close-all", "Cerrar todos"))}</div><div class="toolbar-group" data-toolbar-group="relations">${Vl("relations", zl.relations, "Relaciones", "Selección", Bl("relations-all", "Todas") + Bl("relations-selected", "Selección", !0) + Bl("relations-callers", "All callers") + Bl("relations-called", "All called") + Bl("relations-none", "Ocultar") + "<div data-relation-groups-section hidden><div class=\"toolbar-option-separator\"></div><div class=\"toolbar-popover-title\">Grupos</div><div data-relation-groups></div></div>")}</div><div class="toolbar-group" data-toolbar-group="focus">${Vl("focus", zl.focus, "Foco", "Todo", Bl("focus-all", "Todo", !0) + Bl("focus-dim", "Conectados") + Bl("focus-hide", "Aislar") + "<div class=\"toolbar-option-separator\"></div>" + Bl("focus-selection", "Enfocar selección") + Bl("focus-layout", "Reorganizar visibles"))}</div></div><div class="hint">Gira: arrastra · Pan: botón derecho / ⇧+arrastra / 2 dedos · Zoom: rueda o pellizco · Selecciona: clic · Enfoca: doble clic</div></section><aside class="panel" aria-live="polite"></aside></div>`;
|
|
12289
|
+
function Ul(e) {
|
|
12290
12290
|
return String(e ?? "").replace(/[&<>"']/g, (e) => ({
|
|
12291
12291
|
"&": "&",
|
|
12292
12292
|
"<": "<",
|
|
@@ -12295,17 +12295,39 @@ function Hl(e) {
|
|
|
12295
12295
|
"'": "'"
|
|
12296
12296
|
})[e]);
|
|
12297
12297
|
}
|
|
12298
|
-
function
|
|
12298
|
+
function Wl(e) {
|
|
12299
12299
|
let t = String(e ?? "").trim();
|
|
12300
12300
|
if (!t) return "";
|
|
12301
12301
|
try {
|
|
12302
12302
|
let e = new URL(t, globalThis.location?.href);
|
|
12303
|
-
return ["http:", "https:"].includes(e.protocol) ? "<a class=\"external-link\" href=\"" +
|
|
12303
|
+
return ["http:", "https:"].includes(e.protocol) ? "<a class=\"external-link\" href=\"" + Ul(e.href) + "\" target=\"_blank\" rel=\"noopener noreferrer\">Open documentation ↗</a>" : "";
|
|
12304
12304
|
} catch {
|
|
12305
12305
|
return "";
|
|
12306
12306
|
}
|
|
12307
12307
|
}
|
|
12308
|
-
function
|
|
12308
|
+
function Gl(e, t = "connection") {
|
|
12309
|
+
return String(e || t).normalize("NFKD").replace(/[\u0300-\u036f]/g, "").toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "") || t;
|
|
12310
|
+
}
|
|
12311
|
+
function Kl(e) {
|
|
12312
|
+
let t = Array.isArray(e) ? e : e && typeof e == "object" ? Object.entries(e).map(([e, t]) => typeof t == "string" ? {
|
|
12313
|
+
id: e,
|
|
12314
|
+
label: t
|
|
12315
|
+
} : {
|
|
12316
|
+
id: e,
|
|
12317
|
+
...t || {}
|
|
12318
|
+
}) : [], n = /* @__PURE__ */ new Set();
|
|
12319
|
+
return t.flatMap((e, t) => {
|
|
12320
|
+
let r = String(e?.id || "").trim();
|
|
12321
|
+
return !r || n.has(r) ? [] : (n.add(r), [{
|
|
12322
|
+
...e,
|
|
12323
|
+
id: r,
|
|
12324
|
+
label: String(e.label || e.name || r),
|
|
12325
|
+
...e.color == null ? {} : { color: String(e.color) },
|
|
12326
|
+
...e.description == null ? {} : { description: String(e.description) }
|
|
12327
|
+
}]);
|
|
12328
|
+
});
|
|
12329
|
+
}
|
|
12330
|
+
function ql(e) {
|
|
12309
12331
|
let t = e && typeof e == "object" ? e : {}, n = t.render && typeof t.render == "object" ? t.render : {}, r = Array.isArray(t.entities) ? t.entities.map((e) => ({
|
|
12310
12332
|
...e,
|
|
12311
12333
|
p: Array.isArray(e.p) ? e.p : [
|
|
@@ -12318,19 +12340,35 @@ function Wl(e) {
|
|
|
12318
12340
|
1,
|
|
12319
12341
|
1
|
|
12320
12342
|
]
|
|
12321
|
-
})) : [], i =
|
|
12322
|
-
|
|
12323
|
-
|
|
12324
|
-
|
|
12325
|
-
|
|
12326
|
-
|
|
12327
|
-
|
|
12328
|
-
|
|
12329
|
-
|
|
12330
|
-
|
|
12331
|
-
|
|
12332
|
-
|
|
12333
|
-
|
|
12343
|
+
})) : [], i = /* @__PURE__ */ new Set(), a = (e) => {
|
|
12344
|
+
let t = (e.id == null ? "" : String(e.id).trim()) || [
|
|
12345
|
+
"relation",
|
|
12346
|
+
Gl(e.from, "source"),
|
|
12347
|
+
Gl(e.to, "target"),
|
|
12348
|
+
e.label ? Gl(e.label) : ""
|
|
12349
|
+
].filter(Boolean).join("-"), n = t || "relation", r = 2;
|
|
12350
|
+
for (; i.has(n);) n = `${t || "relation"}-${r++}`;
|
|
12351
|
+
return i.add(n), n;
|
|
12352
|
+
}, o = Array.isArray(t.relations) ? t.relations.map((e, t) => {
|
|
12353
|
+
if (Array.isArray(e)) {
|
|
12354
|
+
let n = {
|
|
12355
|
+
from: e[0],
|
|
12356
|
+
to: e[1],
|
|
12357
|
+
label: e[2] || "",
|
|
12358
|
+
mode: Pl({ mode: e[3] }),
|
|
12359
|
+
index: t
|
|
12360
|
+
};
|
|
12361
|
+
return n.id = a(n), n;
|
|
12362
|
+
}
|
|
12363
|
+
let n = {
|
|
12364
|
+
...e,
|
|
12365
|
+
from: e.from,
|
|
12366
|
+
to: e.to,
|
|
12367
|
+
label: e.label || "",
|
|
12368
|
+
mode: Pl(e),
|
|
12369
|
+
index: t
|
|
12370
|
+
};
|
|
12371
|
+
return n.id = a(n), n.group != null && (n.group = String(n.group).trim() || void 0), n;
|
|
12334
12372
|
}) : [];
|
|
12335
12373
|
return {
|
|
12336
12374
|
...t,
|
|
@@ -12338,16 +12376,17 @@ function Wl(e) {
|
|
|
12338
12376
|
...el,
|
|
12339
12377
|
...t.palette || {}
|
|
12340
12378
|
},
|
|
12341
|
-
theme:
|
|
12379
|
+
theme: Nl(t.theme || t.styles),
|
|
12342
12380
|
render: {
|
|
12343
12381
|
...n,
|
|
12344
|
-
relationMarker:
|
|
12382
|
+
relationMarker: Ol(n.relationMarker)
|
|
12345
12383
|
},
|
|
12384
|
+
relationGroups: Kl(t.relationGroups),
|
|
12346
12385
|
entities: r,
|
|
12347
|
-
relations:
|
|
12386
|
+
relations: o
|
|
12348
12387
|
};
|
|
12349
12388
|
}
|
|
12350
|
-
function
|
|
12389
|
+
function Jl(e, t, n = [
|
|
12351
12390
|
1,
|
|
12352
12391
|
1,
|
|
12353
12392
|
1
|
|
@@ -12366,7 +12405,7 @@ function Gl(e, t, n = [
|
|
|
12366
12405
|
});
|
|
12367
12406
|
return s.center(), s;
|
|
12368
12407
|
}
|
|
12369
|
-
function
|
|
12408
|
+
function Yl(e, t, n) {
|
|
12370
12409
|
let r = new ui();
|
|
12371
12410
|
for (let t = 0; t < e; t++) {
|
|
12372
12411
|
let n = Math.PI / 2 + t * Math.PI * 2 / e, i = new V(Math.cos(n) * .5, Math.sin(n) * .5);
|
|
@@ -12383,7 +12422,7 @@ function Kl(e, t, n) {
|
|
|
12383
12422
|
});
|
|
12384
12423
|
return i.rotateX(Math.PI / 2), i.center(), i;
|
|
12385
12424
|
}
|
|
12386
|
-
function
|
|
12425
|
+
function Xl(e, t, n, r) {
|
|
12387
12426
|
let i = Math.min(.22, Math.max(0, Number(n) || 0));
|
|
12388
12427
|
if (!i) return new Er(t, e, 1, 32);
|
|
12389
12428
|
let a = [new V(0, -.5)];
|
|
@@ -12400,7 +12439,7 @@ function ql(e, t, n, r) {
|
|
|
12400
12439
|
}
|
|
12401
12440
|
return a.push(new V(0, .5)), new Qi(a, 32);
|
|
12402
12441
|
}
|
|
12403
|
-
function
|
|
12442
|
+
function Zl(e, t) {
|
|
12404
12443
|
if (!t) return e;
|
|
12405
12444
|
let n = Math.min(.72, Math.max(0, Number(t) * 3)), r = e.attributes.position;
|
|
12406
12445
|
for (let e = 0; e < r.count; e++) {
|
|
@@ -12409,36 +12448,36 @@ function Jl(e, t) {
|
|
|
12409
12448
|
}
|
|
12410
12449
|
return r.needsUpdate = !0, e.computeVertexNormals(), e;
|
|
12411
12450
|
}
|
|
12412
|
-
function
|
|
12451
|
+
function Ql(e, t = 0, n = 4, r = [
|
|
12413
12452
|
1,
|
|
12414
12453
|
1,
|
|
12415
12454
|
1
|
|
12416
12455
|
]) {
|
|
12417
12456
|
let i = Number(t) || 0, a = Math.max(2, Math.round(Number(n) || 4));
|
|
12418
12457
|
switch (e) {
|
|
12419
|
-
case "cylinder": return i ?
|
|
12420
|
-
case "cone": return i ?
|
|
12458
|
+
case "cylinder": return i ? Xl(.5, .5, i, a) : new Er(.5, .5, 1, 32);
|
|
12459
|
+
case "cone": return i ? Xl(0, .5, i, a) : new Dr(.5, 1, 32);
|
|
12421
12460
|
case "frustum-cone":
|
|
12422
|
-
case "truncated-cone": return i ?
|
|
12461
|
+
case "truncated-cone": return i ? Xl(.28, .5, i, a) : new Er(.28, .5, 1, 32);
|
|
12423
12462
|
case "frustum-pyramid":
|
|
12424
12463
|
case "truncated-pyramid": return new Er(.28, .5, 1, 4);
|
|
12425
12464
|
case "frustum-triangle": return new Er(.28, .5, 1, 3);
|
|
12426
|
-
case "prism": return i ?
|
|
12427
|
-
case "pyramid-square": return i ?
|
|
12428
|
-
case "pyramid-triangle": return i ?
|
|
12465
|
+
case "prism": return i ? Yl(6, i, a) : new Er(.5, .5, 1, 6);
|
|
12466
|
+
case "pyramid-square": return i ? Zl(new Dr(.5, 1, 4), i) : new Dr(.5, 1, 4);
|
|
12467
|
+
case "pyramid-triangle": return i ? Zl(new Dr(.5, 1, 3), i) : new Dr(.5, 1, 3);
|
|
12429
12468
|
case "sphere": return new ta(.5, 24, 16);
|
|
12430
|
-
case "octahedron": return
|
|
12431
|
-
case "dodecahedron": return
|
|
12432
|
-
case "icosahedron": return
|
|
12433
|
-
default: return i ?
|
|
12469
|
+
case "octahedron": return Zl(new $i(.5), i);
|
|
12470
|
+
case "dodecahedron": return Zl(new kr(.5), i);
|
|
12471
|
+
case "icosahedron": return Zl(new Zi(.5), i);
|
|
12472
|
+
default: return i ? Jl(i, a, r) : new Nn(1, 1, 1);
|
|
12434
12473
|
}
|
|
12435
12474
|
}
|
|
12436
|
-
function
|
|
12475
|
+
function $l(e) {
|
|
12437
12476
|
e.computeBoundingBox();
|
|
12438
12477
|
let t = e.boundingBox?.getSize(new U());
|
|
12439
12478
|
return !t || !t.x || !t.y || !t.z ? e : (e.scale(1 / t.x, 1 / t.y, 1 / t.z), e.computeBoundingBox(), e);
|
|
12440
12479
|
}
|
|
12441
|
-
function
|
|
12480
|
+
function eu(e, t) {
|
|
12442
12481
|
let n = e.geometryOptions || e.geometry_options || e.parameters || {}, r = {};
|
|
12443
12482
|
for (let [e, n] of Object.entries(t?.parameters || {})) n && Object.hasOwn(n, "default") && (r[e] = n.default);
|
|
12444
12483
|
return {
|
|
@@ -12446,10 +12485,10 @@ function Zl(e, t) {
|
|
|
12446
12485
|
...n && typeof n == "object" ? n : {}
|
|
12447
12486
|
};
|
|
12448
12487
|
}
|
|
12449
|
-
function
|
|
12488
|
+
function tu(e, t, n) {
|
|
12450
12489
|
return typeof e != "string" || !e ? n : t[e] || e;
|
|
12451
12490
|
}
|
|
12452
|
-
function
|
|
12491
|
+
function nu(e, t = "#ffffff", n = "transparent") {
|
|
12453
12492
|
let r = document.createElement("canvas");
|
|
12454
12493
|
r.width = 256, r.height = 256;
|
|
12455
12494
|
let i = r.getContext("2d");
|
|
@@ -12457,8 +12496,8 @@ function $l(e, t = "#ffffff", n = "transparent") {
|
|
|
12457
12496
|
let a = new Cr(r);
|
|
12458
12497
|
return a.colorSpace = y, a;
|
|
12459
12498
|
}
|
|
12460
|
-
var
|
|
12461
|
-
function
|
|
12499
|
+
var ru = /^[AaCcHhLlMmQqSsTtVvZz]$/, iu = /[-+]?(?:\d*\.\d+|\d+\.?)(?:[eE][-+]?\d+)?|[AaCcHhLlMmQqSsTtVvZz]/g;
|
|
12500
|
+
function au(e, t, n, r, i, a, o, s, c) {
|
|
12462
12501
|
let l = Math.abs(Number(n)), u = Math.abs(Number(r));
|
|
12463
12502
|
if (!l || !u || e === s && t === c) return [[s, c]];
|
|
12464
12503
|
let d = Number(i || 0) * Math.PI / 180, f = Math.cos(d), p = Math.sin(d), m = (e - s) / 2, h = (t - c) / 2, g = f * m + p * h, _ = -p * m + f * h, v = Math.sqrt(Math.max(1, g * g / (l * l) + _ * _ / (u * u)));
|
|
@@ -12474,12 +12513,12 @@ function nu(e, t, n, r, i, a, o, s, c) {
|
|
|
12474
12513
|
return [w + f * l * r - p * u * i, T + p * l * r + f * u * i];
|
|
12475
12514
|
});
|
|
12476
12515
|
}
|
|
12477
|
-
function
|
|
12478
|
-
let t = String(e || "").match(
|
|
12516
|
+
function ou(e) {
|
|
12517
|
+
let t = String(e || "").match(iu) || [], n = new qa(), r = 0, i = "", a = "", o = 0, s = 0, c = 0, l = 0, u = 0, d = 0, f = 0, p = 0, m = () => r < t.length && !ru.test(t[r]), h = () => Number(t[r++]), g = () => {
|
|
12479
12518
|
let e = t[r];
|
|
12480
12519
|
return /^[01].+/.test(e) ? (t[r] = e.slice(1), e[0] === "1") : h() !== 0;
|
|
12481
12520
|
}, _ = (e, t, n) => [n ? o + e : e, n ? s + t : t];
|
|
12482
|
-
for (; r < t.length && (
|
|
12521
|
+
for (; r < t.length && (ru.test(t[r]) && (i = t[r++]), i);) {
|
|
12483
12522
|
let e = i.toLowerCase(), t = i === e;
|
|
12484
12523
|
if (e === "z") {
|
|
12485
12524
|
n.currentPath?.closePath(), o = c, s = l, a = i, i = "";
|
|
@@ -12519,7 +12558,7 @@ function ru(e) {
|
|
|
12519
12558
|
}
|
|
12520
12559
|
else if (e === "a") for (; m();) {
|
|
12521
12560
|
let e = h(), r = h(), c = h(), l = g(), u = g(), [d, f] = _(h(), h(), t);
|
|
12522
|
-
for (let [t, i] of
|
|
12561
|
+
for (let [t, i] of au(o, s, e, r, c, l, u, d, f)) n.lineTo(t, -i);
|
|
12523
12562
|
o = d, s = f, a = i;
|
|
12524
12563
|
}
|
|
12525
12564
|
else break;
|
|
@@ -12527,12 +12566,12 @@ function ru(e) {
|
|
|
12527
12566
|
}
|
|
12528
12567
|
return n;
|
|
12529
12568
|
}
|
|
12530
|
-
function
|
|
12569
|
+
function su(e, t = {}) {
|
|
12531
12570
|
let n = String(e || "").match(/<path\b[^>]*>/gi) || [], r = [];
|
|
12532
12571
|
for (let e of n) {
|
|
12533
12572
|
let t = e.match(/\bd\s*=\s*(["'])([\s\S]*?)\1/i);
|
|
12534
12573
|
if (!t) continue;
|
|
12535
|
-
let n =
|
|
12574
|
+
let n = ou(t[2]);
|
|
12536
12575
|
r.push(...n.toShapes(!0, !1));
|
|
12537
12576
|
}
|
|
12538
12577
|
if (!r.length) return new Nn(1, 1, .12);
|
|
@@ -12547,11 +12586,11 @@ function iu(e, t = {}) {
|
|
|
12547
12586
|
});
|
|
12548
12587
|
return a.center(), a;
|
|
12549
12588
|
}
|
|
12550
|
-
function
|
|
12551
|
-
return e.shape === "plane" ? new ea(1, 1) : e.shape === "svg-extrude" ?
|
|
12589
|
+
function cu(e) {
|
|
12590
|
+
return e.shape === "plane" ? new ea(1, 1) : e.shape === "svg-extrude" ? su(e.svg, e) : Ql(e.shape || e.geometry || "box", e.radius, e.segments, e.size);
|
|
12552
12591
|
}
|
|
12553
|
-
function
|
|
12554
|
-
let a =
|
|
12592
|
+
function lu(e, t, n, r, i) {
|
|
12593
|
+
let a = eu(t, e), o = {
|
|
12555
12594
|
...n,
|
|
12556
12595
|
...e.palette || {},
|
|
12557
12596
|
...t.geometryPalette || t.geometry_palette || {}
|
|
@@ -12566,11 +12605,11 @@ function ou(e, t, n, r, i) {
|
|
|
12566
12605
|
if (!c.length) throw Error(`Geometry '${e.id}' did not produce any parts.`);
|
|
12567
12606
|
let l = new Qn(), u = [], d = [];
|
|
12568
12607
|
for (let a of c) {
|
|
12569
|
-
let s =
|
|
12570
|
-
|
|
12571
|
-
let c = a.color || "component", f =
|
|
12608
|
+
let s = cu(a);
|
|
12609
|
+
$l(s);
|
|
12610
|
+
let c = a.color || "component", f = tu(c, o, n.component || el.component), p = a.emissive || "#000000", m = new ia({
|
|
12572
12611
|
color: f,
|
|
12573
|
-
emissive:
|
|
12612
|
+
emissive: tu(p, o, "#000000"),
|
|
12574
12613
|
emissiveIntensity: Number.isFinite(Number(a.emissiveIntensity)) ? Math.max(0, Number(a.emissiveIntensity)) : 0,
|
|
12575
12614
|
roughness: Number.isFinite(Number(a.roughness)) ? Number(a.roughness) : .72,
|
|
12576
12615
|
metalness: Number.isFinite(Number(a.metalness)) ? Number(a.metalness) : .06,
|
|
@@ -12641,7 +12680,7 @@ function ou(e, t, n, r, i) {
|
|
|
12641
12680
|
n.src = _;
|
|
12642
12681
|
}
|
|
12643
12682
|
})(), m.map.colorSpace = y, m.needsUpdate = !0;
|
|
12644
|
-
} else g != null && g !== "" && (m.map =
|
|
12683
|
+
} else g != null && g !== "" && (m.map = nu(g, tu(a.iconColor || "#ffffff", o, "#ffffff"), tu(a.iconBackground || "transparent", o, "transparent")), m.transparent = !0, m.needsUpdate = !0);
|
|
12645
12684
|
if (h = new An(s, m), h.position.fromArray(Array.isArray(a.position) ? a.position : [
|
|
12646
12685
|
0,
|
|
12647
12686
|
0,
|
|
@@ -12678,23 +12717,23 @@ function ou(e, t, n, r, i) {
|
|
|
12678
12717
|
descriptor: s
|
|
12679
12718
|
};
|
|
12680
12719
|
}
|
|
12681
|
-
var
|
|
12720
|
+
var uu = Object.freeze([
|
|
12682
12721
|
"auto",
|
|
12683
12722
|
"top",
|
|
12684
12723
|
"bottom",
|
|
12685
12724
|
"left",
|
|
12686
12725
|
"right"
|
|
12687
12726
|
]);
|
|
12688
|
-
function
|
|
12727
|
+
function du(e) {
|
|
12689
12728
|
let t = String(e || "auto").trim().toLowerCase();
|
|
12690
|
-
return
|
|
12729
|
+
return uu.includes(t) ? t : "auto";
|
|
12691
12730
|
}
|
|
12692
|
-
function
|
|
12693
|
-
let n = e.style?.label?.anchor ?? e.labelAnchor ?? e.label_anchor, r =
|
|
12694
|
-
return
|
|
12731
|
+
function fu(e = {}, t = {}) {
|
|
12732
|
+
let n = e.style?.label?.anchor ?? e.labelAnchor ?? e.label_anchor, r = wl(e.type) ? "auto" : t?.label?.anchor ?? "bottom";
|
|
12733
|
+
return du(n ?? r);
|
|
12695
12734
|
}
|
|
12696
|
-
function
|
|
12697
|
-
let a =
|
|
12735
|
+
function pu(e, t, n, r, i = .025) {
|
|
12736
|
+
let a = du(e);
|
|
12698
12737
|
if (a === "auto") return null;
|
|
12699
12738
|
let o = Math.max(0, Number(t?.x) || 0), s = Math.max(0, Number(t?.y) || 0);
|
|
12700
12739
|
Math.max(0, Number(n) || 0);
|
|
@@ -12721,7 +12760,23 @@ function uu(e, t, n, r, i = .025) {
|
|
|
12721
12760
|
backRotation: Math.PI / 2
|
|
12722
12761
|
};
|
|
12723
12762
|
}
|
|
12724
|
-
function
|
|
12763
|
+
function mu(e, t, n = null, r = .08) {
|
|
12764
|
+
let i = (Number(e?.x) || 0) - (Number(t?.x) || 0), a = (Number(e?.y) || 0) - (Number(t?.y) || 0), o = (Number(e?.z) || 0) - (Number(t?.z) || 0), s = Math.hypot(i, a, o), c = [
|
|
12765
|
+
"front",
|
|
12766
|
+
"back",
|
|
12767
|
+
"top"
|
|
12768
|
+
];
|
|
12769
|
+
if (!s) return c.includes(n) ? n : "front";
|
|
12770
|
+
let l = {
|
|
12771
|
+
front: o / s,
|
|
12772
|
+
back: -o / s,
|
|
12773
|
+
top: a / s
|
|
12774
|
+
}, u = "front";
|
|
12775
|
+
for (let e of c.slice(1)) l[e] > l[u] && (u = e);
|
|
12776
|
+
let d = Math.max(0, Math.min(.5, Number(r) || 0));
|
|
12777
|
+
return c.includes(n) && l[n] > 0 && l[n] + d >= l[u] ? n : l[u] > 0 ? u : c.includes(n) ? n : "front";
|
|
12778
|
+
}
|
|
12779
|
+
function hu(e, t, n, r = "", i = !0) {
|
|
12725
12780
|
let a = document.createElement("canvas"), o = a.getContext("2d"), s = n.x * .88, c = Math.min(.82, n.y * .64);
|
|
12726
12781
|
a.width = Math.ceil(s * 320), a.height = Math.ceil(c * 320), o.imageSmoothingEnabled = !0, o.imageSmoothingQuality = "high", o.clearRect(0, 0, a.width, a.height);
|
|
12727
12782
|
let l = a.height * .62;
|
|
@@ -12758,7 +12813,7 @@ function du(e, t, n, r = "", i = !0) {
|
|
|
12758
12813
|
let C = new An(b, v);
|
|
12759
12814
|
C.rotation.y = Math.PI, C.position.set(0, n.y / 2 - .09 - c / 2, -n.z / 2 - .012);
|
|
12760
12815
|
let w = new An(b, v.clone());
|
|
12761
|
-
w.rotation.x = -Math.PI / 2, w.position.set(0, n.y / 2 + .012, 0), w.visible =
|
|
12816
|
+
w.rotation.x = -Math.PI / 2, w.position.set(0, n.y / 2 + .012, 0), w.visible = wl(r), x.add(S, C, w);
|
|
12762
12817
|
for (let e of [
|
|
12763
12818
|
S,
|
|
12764
12819
|
C,
|
|
@@ -12766,29 +12821,69 @@ function du(e, t, n, r = "", i = !0) {
|
|
|
12766
12821
|
]) e.renderOrder = 20, e.frustumCulled = !1, e.material.depthTest = !0, e.material.depthWrite = !1, e.material.transparent = !0;
|
|
12767
12822
|
return x.renderOrder = 20, x.frustumCulled = !1, x.userData.front = S, x.userData.back = C, x.userData.top = w, x.userData.height = c, x.userData.width = s, x.userData.textOffsetX = h, x.userData.textOffsetY = g, x.userData.nodeLabel = !0, x;
|
|
12768
12823
|
}
|
|
12769
|
-
function
|
|
12824
|
+
function gu(e, t, n, r) {
|
|
12825
|
+
if (!r || r === "transparent" || !e?.fillRect) return;
|
|
12826
|
+
let i = typeof r == "string" ? { color: r } : r, a = i.fade || i.color || "#0a111a", o = i.glow || a;
|
|
12827
|
+
if (e.save?.(), e.globalCompositeOperation = "destination-over", o !== a && e.createRadialGradient && e.scale) {
|
|
12828
|
+
e.scale(t, n);
|
|
12829
|
+
let r = e.createRadialGradient(.5, .45, 0, .5, .45, .75);
|
|
12830
|
+
r.addColorStop(0, o), r.addColorStop(.82, a), r.addColorStop(1, a), e.fillStyle = r, e.fillRect(0, 0, 1, 1);
|
|
12831
|
+
} else e.fillStyle = a, e.fillRect(0, 0, t, n);
|
|
12832
|
+
e.restore?.();
|
|
12833
|
+
}
|
|
12834
|
+
function _u(e) {
|
|
12835
|
+
for (let t = 0; t < e.length; t += 4) {
|
|
12836
|
+
let n = e[t + 3];
|
|
12837
|
+
if (!n || n === 255) continue;
|
|
12838
|
+
let r = 255 / n;
|
|
12839
|
+
e[t] = Math.min(255, Math.round(e[t] * r)), e[t + 1] = Math.min(255, Math.round(e[t + 1] * r)), e[t + 2] = Math.min(255, Math.round(e[t + 2] * r));
|
|
12840
|
+
}
|
|
12841
|
+
}
|
|
12842
|
+
function vu(e, t, n, r = 8192) {
|
|
12843
|
+
let i = Math.max(1, Math.min(4, Number(n) || 1));
|
|
12844
|
+
if (i === 1 || !e?.getPixelRatio || !e?.getSize || !e?.setPixelRatio || !e?.setSize) return null;
|
|
12845
|
+
let a = e.getPixelRatio(), o = {
|
|
12846
|
+
x: 0,
|
|
12847
|
+
y: 0,
|
|
12848
|
+
set(e, t) {
|
|
12849
|
+
return this.x = e, this.y = t, this;
|
|
12850
|
+
}
|
|
12851
|
+
};
|
|
12852
|
+
if (e.getSize(o), !o.x || !o.y) return null;
|
|
12853
|
+
let s = t?.getParameter && t?.MAX_RENDERBUFFER_SIZE ? Number(t.getParameter(t.MAX_RENDERBUFFER_SIZE)) : 0, c = Math.max(1, Math.min(Number(r) || 8192, s || Infinity)), l = t?.drawingBufferWidth || o.x * a, u = t?.drawingBufferHeight || o.y * a, d = Math.max(1, Math.min(i, c / l, c / u));
|
|
12854
|
+
return d <= 1 ? null : (e.setPixelRatio(a * d), e.setSize(o.x, o.y, !1), () => {
|
|
12855
|
+
e.setPixelRatio(a), e.setSize(o.x, o.y, !1);
|
|
12856
|
+
});
|
|
12857
|
+
}
|
|
12858
|
+
function yu(e, t, n, r = globalThis.document, i = {}) {
|
|
12770
12859
|
if (!e || !t || !n || !r?.createElement) return null;
|
|
12860
|
+
let a = null;
|
|
12771
12861
|
try {
|
|
12772
|
-
e.
|
|
12773
|
-
|
|
12774
|
-
|
|
12775
|
-
|
|
12776
|
-
|
|
12777
|
-
|
|
12778
|
-
|
|
12779
|
-
|
|
12780
|
-
|
|
12781
|
-
|
|
12782
|
-
|
|
12783
|
-
|
|
12784
|
-
|
|
12785
|
-
|
|
12786
|
-
|
|
12862
|
+
let o = e.getContext?.();
|
|
12863
|
+
a = vu(e, o, i.scale, i.maximumDimension), e.render(t, n);
|
|
12864
|
+
let s = e.getContext?.(), c = s?.drawingBufferWidth || e.domElement?.width || 0, l = s?.drawingBufferHeight || e.domElement?.height || 0;
|
|
12865
|
+
if (!s?.readPixels || !c || !l) return null;
|
|
12866
|
+
let u = new Uint8Array(c * l * 4);
|
|
12867
|
+
s.readPixels(0, 0, c, l, s.RGBA, s.UNSIGNED_BYTE, u);
|
|
12868
|
+
let d = r.createElement("canvas");
|
|
12869
|
+
d.className = "atlas-print-snapshot", d.width = c, d.height = l, d.setAttribute("aria-hidden", "true");
|
|
12870
|
+
let f = d.getContext?.("2d");
|
|
12871
|
+
if (!f) return null;
|
|
12872
|
+
let p = f.createImageData(c, l), m = c * 4;
|
|
12873
|
+
for (let e = 0; e < l; e += 1) {
|
|
12874
|
+
let t = l - e - 1;
|
|
12875
|
+
p.data.set(u.subarray(t * m, (t + 1) * m), e * m);
|
|
12876
|
+
}
|
|
12877
|
+
return s.getContextAttributes?.().premultipliedAlpha !== !1 && _u(p.data), f.putImageData(p, 0, 0), gu(f, c, l, i.background), d;
|
|
12787
12878
|
} catch {
|
|
12788
12879
|
return null;
|
|
12880
|
+
} finally {
|
|
12881
|
+
if (a) try {
|
|
12882
|
+
a(), e.render(t, n);
|
|
12883
|
+
} catch {}
|
|
12789
12884
|
}
|
|
12790
12885
|
}
|
|
12791
|
-
var
|
|
12886
|
+
var bu = class extends HTMLElement {
|
|
12792
12887
|
static version = $c;
|
|
12793
12888
|
static get observedAttributes() {
|
|
12794
12889
|
return [
|
|
@@ -12807,23 +12902,23 @@ var pu = class extends HTMLElement {
|
|
|
12807
12902
|
];
|
|
12808
12903
|
}
|
|
12809
12904
|
static registerGeometryPack(e) {
|
|
12810
|
-
return
|
|
12905
|
+
return yl(e);
|
|
12811
12906
|
}
|
|
12812
12907
|
static unregisterGeometryPack(e) {
|
|
12813
|
-
return
|
|
12908
|
+
return bl(e);
|
|
12814
12909
|
}
|
|
12815
12910
|
static getGeometryCatalog() {
|
|
12816
|
-
return
|
|
12911
|
+
return xl();
|
|
12817
12912
|
}
|
|
12818
12913
|
static getGeometryPackCatalog() {
|
|
12819
|
-
return
|
|
12914
|
+
return Sl();
|
|
12820
12915
|
}
|
|
12821
12916
|
constructor() {
|
|
12822
|
-
super(), this.attachShadow({ mode: "open" }), this.shadowRoot.innerHTML = "<style>" +
|
|
12917
|
+
super(), this.attachShadow({ mode: "open" }), this.shadowRoot.innerHTML = "<style>" + Fl + Il + Ll + "</style>" + Hl, this.canvas = this.shadowRoot.querySelector("canvas"), this.panel = this.shadowRoot.querySelector(".panel"), this.scene = new tr(), this.camera = new Kn(30, 1, .1, 2e3), this.cameraPosition = new U(), this.cameraTarget = new U(), this.raycaster = new Wa(), this.pointer = new V(), this.nodes = /* @__PURE__ */ new Map(), this.open = /* @__PURE__ */ new Set(), this._initialOpenContainers = /* @__PURE__ */ new Set(), this.selected = null, this.selectedRelationIndex = null, this.modelData = null, this._loading = !1, this._pendingSelection = null, this._theme = Nl(), this.relationMode = kl(this.getAttribute("relation-mode")), this.relationMarker = Ol(this.getAttribute("relation-marker")), this.visibleRelationGroups = null, this.focusFilter = Tl({
|
|
12823
12918
|
mode: this.getAttribute("focus-mode"),
|
|
12824
12919
|
effect: this.getAttribute("focus-effect"),
|
|
12825
12920
|
layout: this.getAttribute("focus-layout")
|
|
12826
|
-
}), this.selectionMode = ["internal", "event"].includes(this.getAttribute("selection-mode")) ? this.getAttribute("selection-mode") : "internal", this.selectionNavigation =
|
|
12921
|
+
}), this.selectionMode = ["internal", "event"].includes(this.getAttribute("selection-mode")) ? this.getAttribute("selection-mode") : "internal", this.selectionNavigation = El(this.getAttribute("selection-navigation")), this.itemFacing = Dl(this.getAttribute("item-facing")), this.showShellLabels = this.getAttribute("shell-labels") !== "false", this.yaw = .37, this.pitch = .22, this.zoom = 1, this.targetZoom = 1, this.focus = new U(), this.targetFocus = new U(), this.drag = null, this.pointers = /* @__PURE__ */ new Map(), this.relationGroup = new Qn(), this.scene.add(this.relationGroup), this.relations = [], this.animationFrame = 0, this.ready = !1, this._toolbarVisible = this.getAttribute("toolbar") !== "off", this._panelVisible = this.getAttribute("panel") !== "off", this.toolbar = this.shadowRoot.querySelector(".toolbar"), this._printState = null, this._beforePrintListener = () => this.prepareForPrint(), this._afterPrintListener = () => this.restoreAfterPrint(), this._printMedia = globalThis.matchMedia?.("print") || null, this._printMediaListener = (e) => e.matches ? this.prepareForPrint() : this.restoreAfterPrint(), this._geometryRegistryListener = () => {
|
|
12827
12922
|
this.ready && this.modelData && this._build();
|
|
12828
12923
|
}, this._bindControls(), this._syncFocusToolbar(), this._syncRelationToolbar(), this._syncLabelsToolbar(), this._syncPanelToolbar(), this._syncItemFacingToolbar(), this.resizeObserver = new ResizeObserver(() => this.resize()), this.resizeObserver.observe(this.canvas);
|
|
12829
12924
|
}
|
|
@@ -12835,7 +12930,7 @@ var pu = class extends HTMLElement {
|
|
|
12835
12930
|
}
|
|
12836
12931
|
attributeChangedCallback(e, t, n) {
|
|
12837
12932
|
if (t !== n) {
|
|
12838
|
-
if (e === "height" && this.style.setProperty("--lc-height", n || "680px"), e === "relation-mode" && this.ready && this.setRelationMode(n || "selected"), e === "relation-marker" &&
|
|
12933
|
+
if (e === "height" && this.style.setProperty("--lc-height", n || "680px"), e === "relation-mode" && this.ready && this.setRelationMode(n || "selected"), e === "relation-marker" && Ol(n) !== this.relationMarker && this.setRelationMarker(n, { source: "attribute" }), e === "selection-mode" && this.setSelectionMode(n || "internal"), e === "selection-navigation" && this.setSelectionNavigation(n), e === "item-facing" && Dl(n) !== this.itemFacing && this.setItemFacing(n, { source: "attribute" }), e === "focus-mode" && n !== this.focusFilter.mode && this.setFocusFilter({ mode: n }), e === "focus-effect" && n !== this.focusFilter.effect && this.setFocusFilter({ effect: n }), e === "focus-layout" && n !== this.focusFilter.layout && this.setFocusFilter({ layout: n }), e === "shell-labels" && this.ready) {
|
|
12839
12934
|
let e = n !== "false";
|
|
12840
12935
|
e !== this.showShellLabels && (this.showShellLabels = e, this._build({
|
|
12841
12936
|
preserveSelection: this.selected?.id,
|
|
@@ -12877,8 +12972,12 @@ var pu = class extends HTMLElement {
|
|
|
12877
12972
|
set palette(e) {
|
|
12878
12973
|
this.setPalette(e);
|
|
12879
12974
|
}
|
|
12880
|
-
captureFrame() {
|
|
12881
|
-
|
|
12975
|
+
captureFrame(e = {}) {
|
|
12976
|
+
let t = e.background === "theme" ? this.theme?.background || jl.background : e.background;
|
|
12977
|
+
return yu(this.renderer, this.scene, this.camera, this.ownerDocument, {
|
|
12978
|
+
...e,
|
|
12979
|
+
background: t
|
|
12980
|
+
});
|
|
12882
12981
|
}
|
|
12883
12982
|
prepareForPrint() {
|
|
12884
12983
|
if (this._printState) return this;
|
|
@@ -12983,13 +13082,13 @@ var pu = class extends HTMLElement {
|
|
|
12983
13082
|
if (!e.size) return null;
|
|
12984
13083
|
for (let t of [...e]) {
|
|
12985
13084
|
let n = this.nodes.get(t);
|
|
12986
|
-
n &&
|
|
13085
|
+
n && wl(n.type) && this._descendantIds(t, e);
|
|
12987
13086
|
}
|
|
12988
13087
|
let t = new Set(e);
|
|
12989
13088
|
for (let n of this.relations) (t.has(n.from) || t.has(n.to)) && (e.add(n.from), e.add(n.to));
|
|
12990
13089
|
for (let t of [...e]) {
|
|
12991
13090
|
let n = this.nodes.get(t);
|
|
12992
|
-
n &&
|
|
13091
|
+
n && wl(n.type) && this._descendantIds(t, e);
|
|
12993
13092
|
}
|
|
12994
13093
|
for (let t of [...e]) {
|
|
12995
13094
|
let n = this.nodes.get(t)?.parent ? this.nodes.get(this.nodes.get(t).parent) : null;
|
|
@@ -13050,6 +13149,11 @@ var pu = class extends HTMLElement {
|
|
|
13050
13149
|
called: "All called",
|
|
13051
13150
|
none: "Ocultar"
|
|
13052
13151
|
}[this.relationMode]);
|
|
13152
|
+
let t = this.modelData?.relationGroups || [], n = this.shadowRoot.querySelector("[data-relation-groups-section]"), r = this.shadowRoot.querySelector("[data-relation-groups]");
|
|
13153
|
+
n && (n.hidden = t.length === 0), r && (r.innerHTML = t.map((e) => {
|
|
13154
|
+
let t = !this.visibleRelationGroups || this.visibleRelationGroups.has(e.id);
|
|
13155
|
+
return Bl("relation-group-toggle", Ul(e.label || e.id), t).replace("data-action=\"relation-group-toggle\"", `data-action="relation-group-toggle" data-relation-group="${Ul(e.id)}"`);
|
|
13156
|
+
}).join(""));
|
|
13053
13157
|
}
|
|
13054
13158
|
_syncPanelToolbar() {
|
|
13055
13159
|
let e = this.shadowRoot?.querySelector("[data-action=\"panel\"]");
|
|
@@ -13073,7 +13177,7 @@ var pu = class extends HTMLElement {
|
|
|
13073
13177
|
});
|
|
13074
13178
|
}
|
|
13075
13179
|
setFocusFilter(e = {}, t = {}) {
|
|
13076
|
-
let n =
|
|
13180
|
+
let n = Tl({
|
|
13077
13181
|
...this.focusFilter,
|
|
13078
13182
|
...e || {}
|
|
13079
13183
|
}), r = JSON.stringify(n) !== JSON.stringify(this.focusFilter);
|
|
@@ -13085,12 +13189,18 @@ var pu = class extends HTMLElement {
|
|
|
13085
13189
|
_applyModelRenderOptions() {
|
|
13086
13190
|
let e = this.modelData?.render;
|
|
13087
13191
|
if (!e || typeof e != "object") return this;
|
|
13088
|
-
nl.includes(e.relationMode) && e.relationMode !== this.relationMode && this.setRelationMode(e.relationMode),
|
|
13192
|
+
nl.includes(e.relationMode) && e.relationMode !== this.relationMode && this.setRelationMode(e.relationMode), Ol(e.relationMarker) !== this.relationMarker && this.setRelationMarker(e.relationMarker, {
|
|
13193
|
+
emit: !1,
|
|
13194
|
+
source: "model"
|
|
13195
|
+
}), Array.isArray(e.visibleRelationGroups) ? this.setVisibleRelationGroups(e.visibleRelationGroups, {
|
|
13196
|
+
emit: !1,
|
|
13197
|
+
source: "model"
|
|
13198
|
+
}) : this.visibleRelationGroups && this.setVisibleRelationGroups(null, {
|
|
13089
13199
|
emit: !1,
|
|
13090
13200
|
source: "model"
|
|
13091
13201
|
}), Object.hasOwn(e, "selectionMode") && e.selectionMode !== this.selectionMode && this.setSelectionMode(e.selectionMode);
|
|
13092
13202
|
let t = e.navigation?.onSelect ?? e.selectionNavigation;
|
|
13093
|
-
return t != null && t !== this.selectionNavigation && this.setSelectionNavigation(t), Object.hasOwn(e, "toolbar") && e.toolbar !== !1 !== this.toolbarVisible && this.setToolbarVisible(e.toolbar !== !1), Object.hasOwn(e, "shellLabels") && e.shellLabels !== !1 !== this.showShellLabels && this.setShellLabels(e.shellLabels !== !1), Object.hasOwn(e, "itemFacing") &&
|
|
13203
|
+
return t != null && t !== this.selectionNavigation && this.setSelectionNavigation(t), Object.hasOwn(e, "toolbar") && e.toolbar !== !1 !== this.toolbarVisible && this.setToolbarVisible(e.toolbar !== !1), Object.hasOwn(e, "shellLabels") && e.shellLabels !== !1 !== this.showShellLabels && this.setShellLabels(e.shellLabels !== !1), Object.hasOwn(e, "itemFacing") && Dl(e.itemFacing) !== this.itemFacing && this.setItemFacing(e.itemFacing, {
|
|
13094
13204
|
emit: !1,
|
|
13095
13205
|
source: "model"
|
|
13096
13206
|
}), e.focus && this.setFocusFilter(e.focus, { emit: !1 }), this;
|
|
@@ -13103,10 +13213,10 @@ var pu = class extends HTMLElement {
|
|
|
13103
13213
|
}));
|
|
13104
13214
|
}
|
|
13105
13215
|
_containerEntityIds() {
|
|
13106
|
-
return (this.modelData?.entities || []).filter((e) =>
|
|
13216
|
+
return (this.modelData?.entities || []).filter((e) => wl(e.type)).map((e) => e.id);
|
|
13107
13217
|
}
|
|
13108
13218
|
_declaredOpenContainerIds() {
|
|
13109
|
-
return (this.modelData?.entities || []).filter((e) =>
|
|
13219
|
+
return (this.modelData?.entities || []).filter((e) => wl(e.type) && e.open === !0).map((e) => e.id);
|
|
13110
13220
|
}
|
|
13111
13221
|
_emitContainerStateChange(e, t = {}) {
|
|
13112
13222
|
if (!e?.changed || t.emit === !1) return;
|
|
@@ -13164,7 +13274,7 @@ var pu = class extends HTMLElement {
|
|
|
13164
13274
|
}
|
|
13165
13275
|
_commitModelChange(e, t = {}, n = {}) {
|
|
13166
13276
|
let r = n.preserveSelection === !1 ? null : this.selected?.id, i = n.preserveSelection === !1 ? null : this._publicRelation(this.selectedRelationIndex), a = i?.id ?? i?.index ?? null;
|
|
13167
|
-
this.modelData =
|
|
13277
|
+
this.modelData = ql(this.modelData);
|
|
13168
13278
|
let o = this._syncInitialContainerState({
|
|
13169
13279
|
refresh: !1,
|
|
13170
13280
|
emit: !1,
|
|
@@ -13181,7 +13291,7 @@ var pu = class extends HTMLElement {
|
|
|
13181
13291
|
}
|
|
13182
13292
|
updateModel(e = {}, t = {}) {
|
|
13183
13293
|
if (!e || typeof e != "object" || Array.isArray(e)) throw TypeError("El parche del modelo debe ser un objeto.");
|
|
13184
|
-
let n = this.modelData ||
|
|
13294
|
+
let n = this.modelData || ql({}), r = JSON.stringify(n.render?.camera || null), i = {
|
|
13185
13295
|
...n,
|
|
13186
13296
|
...e,
|
|
13187
13297
|
palette: e.palette ? {
|
|
@@ -13192,11 +13302,11 @@ var pu = class extends HTMLElement {
|
|
|
13192
13302
|
entities: Array.isArray(e.entities) ? e.entities : n.entities,
|
|
13193
13303
|
relations: Array.isArray(e.relations) ? e.relations : n.relations
|
|
13194
13304
|
};
|
|
13195
|
-
return this.modelData =
|
|
13305
|
+
return this.modelData = ql(i), this.theme = this.modelData.theme, this._commitModelChange("model-update", { patch: e }, t), this._applyModelRenderOptions(), JSON.stringify(this.modelData.render?.camera || null) !== r && this.modelData.render?.camera && this.setCameraView(this.modelData.render.camera, { animate: t.animateCamera !== !1 }), this;
|
|
13196
13306
|
}
|
|
13197
13307
|
addEntity(e, t = {}) {
|
|
13198
13308
|
if (!e || typeof e != "object" || !e.id) throw TypeError("La entidad debe incluir un id.");
|
|
13199
|
-
if (this.modelData ||=
|
|
13309
|
+
if (this.modelData ||= ql({}), this.modelData.entities.some((t) => t.id === e.id)) throw Error(`Ya existe una entidad con id "${e.id}".`);
|
|
13200
13310
|
if (e.parent && !this.modelData.entities.some((t) => t.id === e.parent)) throw Error(`No existe el contenedor padre "${e.parent}".`);
|
|
13201
13311
|
return this.modelData.entities = [...this.modelData.entities, { ...e }], this._commitModelChange("entity-add", { entity: this._publicEntity(e.id) }, t);
|
|
13202
13312
|
}
|
|
@@ -13270,13 +13380,13 @@ var pu = class extends HTMLElement {
|
|
|
13270
13380
|
}, t);
|
|
13271
13381
|
}
|
|
13272
13382
|
zoomIn() {
|
|
13273
|
-
return this.targetZoom = Math.min(
|
|
13383
|
+
return this.targetZoom = Math.min(il, this.targetZoom * 1.18), this.invalidate(), this;
|
|
13274
13384
|
}
|
|
13275
13385
|
zoomOut() {
|
|
13276
13386
|
return this.targetZoom = Math.max(rl, this.targetZoom / 1.18), this.invalidate(), this;
|
|
13277
13387
|
}
|
|
13278
13388
|
setSelectionNavigation(e) {
|
|
13279
|
-
let t =
|
|
13389
|
+
let t = El(e);
|
|
13280
13390
|
return this.selectionNavigation = t, this.getAttribute("selection-navigation") !== t && this.setAttribute("selection-navigation", t), this;
|
|
13281
13391
|
}
|
|
13282
13392
|
focusSelection(e = {}) {
|
|
@@ -13289,7 +13399,7 @@ var pu = class extends HTMLElement {
|
|
|
13289
13399
|
return t ? (this.targetFocus.copy(t), this.targetZoom = n, e.animate === !1 && (this.focus.copy(this.targetFocus), this.zoom = this.targetZoom), this.invalidate(), this) : this;
|
|
13290
13400
|
}
|
|
13291
13401
|
_applySelectionNavigation(e = this.selectionNavigation) {
|
|
13292
|
-
let t =
|
|
13402
|
+
let t = El(e);
|
|
13293
13403
|
if (t === "preserve") return this;
|
|
13294
13404
|
let n = this.targetZoom;
|
|
13295
13405
|
return this.focusSelection(), t === "center" && (this.targetZoom = n), this;
|
|
@@ -13328,7 +13438,7 @@ var pu = class extends HTMLElement {
|
|
|
13328
13438
|
if (!(a > 1e-6)) return this;
|
|
13329
13439
|
this.yaw = Math.atan2(i.x, i.z), this.pitch = Math.asin(Math.max(-1, Math.min(1, i.y / a)));
|
|
13330
13440
|
let o = Number(e.zoom), s = Number.isFinite(o) && o > 0 ? o : this._baseCameraDistance() / a;
|
|
13331
|
-
return this.targetFocus.copy(r), this.targetZoom = Math.max(rl, Math.min(
|
|
13441
|
+
return this.targetFocus.copy(r), this.targetZoom = Math.max(rl, Math.min(il, s)), t.animate === !1 && (this.focus.copy(this.targetFocus), this.zoom = this.targetZoom), this.invalidate(), this;
|
|
13332
13442
|
}
|
|
13333
13443
|
restoreInitialCamera(e = {}) {
|
|
13334
13444
|
let t = this.modelData?.render?.camera;
|
|
@@ -13345,7 +13455,7 @@ var pu = class extends HTMLElement {
|
|
|
13345
13455
|
t.expandByPoint(n.clone().sub(r)), t.expandByPoint(n.clone().add(r));
|
|
13346
13456
|
}
|
|
13347
13457
|
let n = t.isEmpty() ? new U() : t.getCenter(new U()), r = t.isEmpty() ? new U(1, 1, 1) : t.getSize(new U()), i = Math.max(1, r.length() / 2), a = de.degToRad(this.camera.fov), o = i / Math.sin(a / 2) * 1.12, s = this._baseCameraDistance();
|
|
13348
|
-
return this.targetZoom = Math.max(rl, Math.min(
|
|
13458
|
+
return this.targetZoom = Math.max(rl, Math.min(il, s / o)), this.targetFocus.copy(n), e.animate === !1 && (this.zoom = this.targetZoom, this.focus.copy(this.targetFocus)), this.invalidate(), this;
|
|
13349
13459
|
}
|
|
13350
13460
|
frontView() {
|
|
13351
13461
|
return this.yaw = 0, this.pitch = 0, this.invalidate(), this;
|
|
@@ -13361,7 +13471,7 @@ var pu = class extends HTMLElement {
|
|
|
13361
13471
|
return this.setShellLabels(!this.showShellLabels);
|
|
13362
13472
|
}
|
|
13363
13473
|
setItemFacing(e = "camera", t = {}) {
|
|
13364
|
-
let n =
|
|
13474
|
+
let n = Dl(e), r = n !== this.itemFacing;
|
|
13365
13475
|
return this.itemFacing = n, this.getAttribute("item-facing") !== n && this.setAttribute("item-facing", n), this._syncItemFacingToolbar(), this._applyItemFacing(), this.invalidate(), r && t.emit !== !1 && this._emit("lc-item-facing-change", {
|
|
13366
13476
|
mode: n,
|
|
13367
13477
|
source: t.source || "api"
|
|
@@ -13371,7 +13481,7 @@ var pu = class extends HTMLElement {
|
|
|
13371
13481
|
return this.setItemFacing(this.itemFacing === "camera" ? "model" : "camera", e);
|
|
13372
13482
|
}
|
|
13373
13483
|
_applyItemFacing() {
|
|
13374
|
-
if (this.camera) for (let e of this.nodes.values()) e.group && !
|
|
13484
|
+
if (this.camera) for (let e of this.nodes.values()) e.group && !wl(e.type) && (this.itemFacing === "camera" ? e.group.quaternion.copy(this.camera.quaternion) : e.group.quaternion.identity());
|
|
13375
13485
|
}
|
|
13376
13486
|
isContainerOpen(e) {
|
|
13377
13487
|
return this._containerEntityIds().includes(e) && this.open.has(e);
|
|
@@ -13386,14 +13496,14 @@ var pu = class extends HTMLElement {
|
|
|
13386
13496
|
setContainerOpen(e, t = !0, n = {}) {
|
|
13387
13497
|
let r = this.modelData?.entities?.find((t) => t.id === e);
|
|
13388
13498
|
if (!r) throw Error(`No existe una entidad con id "${e}".`);
|
|
13389
|
-
if (!
|
|
13499
|
+
if (!wl(r.type)) throw TypeError(`La entidad "${e}" no es un contenedor.`);
|
|
13390
13500
|
let i = new Set(this.open);
|
|
13391
13501
|
if (t) i.add(e);
|
|
13392
13502
|
else if (i.delete(e), n.closeDescendants !== !1) for (let t of this.modelData.entities) {
|
|
13393
13503
|
let n = t.parent, r = /* @__PURE__ */ new Set();
|
|
13394
13504
|
for (; n && !r.has(n);) {
|
|
13395
13505
|
if (r.add(n), n === e) {
|
|
13396
|
-
|
|
13506
|
+
wl(t.type) && i.delete(t.id);
|
|
13397
13507
|
break;
|
|
13398
13508
|
}
|
|
13399
13509
|
n = this.modelData.entities.find((e) => e.id === n)?.parent || null;
|
|
@@ -13430,13 +13540,13 @@ var pu = class extends HTMLElement {
|
|
|
13430
13540
|
this.setTheme(e);
|
|
13431
13541
|
}
|
|
13432
13542
|
get theme() {
|
|
13433
|
-
return this._theme ||
|
|
13543
|
+
return this._theme || Nl();
|
|
13434
13544
|
}
|
|
13435
13545
|
set theme(e) {
|
|
13436
|
-
this._theme =
|
|
13546
|
+
this._theme = Nl(e), this.shadowRoot && this._applyTheme();
|
|
13437
13547
|
}
|
|
13438
13548
|
setTheme(e = {}) {
|
|
13439
|
-
return this.theme =
|
|
13549
|
+
return this.theme = Ml(this.theme, e), this.modelData && (this.modelData.theme = this.theme), this._applyLighting(), this.invalidate(), this;
|
|
13440
13550
|
}
|
|
13441
13551
|
_applyTheme() {
|
|
13442
13552
|
let e = this.theme, t = this.style;
|
|
@@ -13467,7 +13577,7 @@ var pu = class extends HTMLElement {
|
|
|
13467
13577
|
this._loading = !0, this._pendingSelection = null;
|
|
13468
13578
|
try {
|
|
13469
13579
|
let t = typeof e == "string" ? await fetch(e).then((e) => e.json()) : e;
|
|
13470
|
-
this.modelData =
|
|
13580
|
+
this.modelData = ql(t), this.selected = null, this.selectedRelationIndex = null, this.open.clear(), this._initialOpenContainers.clear(), this._pendingPalette &&= (this.modelData.palette = {
|
|
13471
13581
|
...this.modelData.palette,
|
|
13472
13582
|
...this._pendingPalette
|
|
13473
13583
|
}, null), this.theme = this.modelData.theme, this._applyTheme(), this._syncInitialContainerState({
|
|
@@ -13498,9 +13608,9 @@ var pu = class extends HTMLElement {
|
|
|
13498
13608
|
}
|
|
13499
13609
|
_applyLighting() {
|
|
13500
13610
|
if (!this.ambientLight || !this.directionalLight) return;
|
|
13501
|
-
let e = this.theme?.lighting ||
|
|
13611
|
+
let e = this.theme?.lighting || jl.lighting;
|
|
13502
13612
|
this.ambientLight.color.set(e.ambientSky), this.ambientLight.groundColor.set(e.ambientGround), this.ambientLight.intensity = Number(e.ambient) || 0, this.directionalLight.color.set(e.directionalColor), this.directionalLight.intensity = Number(e.directional) || 0;
|
|
13503
|
-
let t = Array.isArray(e.directionalPosition) ? e.directionalPosition :
|
|
13613
|
+
let t = Array.isArray(e.directionalPosition) ? e.directionalPosition : jl.lighting.directionalPosition;
|
|
13504
13614
|
this.directionalLight.position.fromArray(t);
|
|
13505
13615
|
}
|
|
13506
13616
|
_worldPosition(e, t = /* @__PURE__ */ new Set()) {
|
|
@@ -13537,7 +13647,7 @@ var pu = class extends HTMLElement {
|
|
|
13537
13647
|
...e.geometryPalette || {},
|
|
13538
13648
|
...e.geometryPaletteOverrides || {}
|
|
13539
13649
|
};
|
|
13540
|
-
n.material.color.set(
|
|
13650
|
+
n.material.color.set(tu(n.value, r, t)), n.material.emissive && n.emissiveValue && n.material.emissive.set(tu(n.emissiveValue, r, "#000000"));
|
|
13541
13651
|
}
|
|
13542
13652
|
}
|
|
13543
13653
|
}
|
|
@@ -13550,19 +13660,19 @@ var pu = class extends HTMLElement {
|
|
|
13550
13660
|
for (let e of this.modelData.entities) {
|
|
13551
13661
|
let t = this.nodes.get(e.id);
|
|
13552
13662
|
t.group = new Qn(), t.group.position.copy(this._worldPosition(t));
|
|
13553
|
-
let n = e.geometry || "box", r =
|
|
13663
|
+
let n = e.geometry || "box", r = Cl(n), i = !r && n.includes("."), a = i ? "#ed8f98" : this.modelData.palette[e.c] || e.c || this.modelData.palette.component;
|
|
13554
13664
|
i && this.dispatchEvent(new CustomEvent("lc-warning", { detail: {
|
|
13555
13665
|
code: "GEOMETRY_NOT_REGISTERED",
|
|
13556
13666
|
geometry: n,
|
|
13557
13667
|
entityId: e.id
|
|
13558
13668
|
} }));
|
|
13559
|
-
let o = r?.primitive || n, s = r && !r.primitive && !
|
|
13669
|
+
let o = r?.primitive || n, s = r && !r.primitive && !wl(e.type);
|
|
13560
13670
|
if (t.geometryDefinition = r || null, t.geometryMissing = i, t.geometryPalette = r?.palette || {}, t.geometryPaletteOverrides = e.geometryPalette || e.geometry_palette || {}, t.ports = {
|
|
13561
13671
|
...r?.anchors || {},
|
|
13562
13672
|
...e.ports || {}
|
|
13563
13673
|
}, s) {
|
|
13564
13674
|
try {
|
|
13565
|
-
let n =
|
|
13675
|
+
let n = lu(r, e, this.modelData.palette, () => this.invalidate(), (e) => this.dispatchEvent(new CustomEvent("lc-warning", { detail: e })));
|
|
13566
13676
|
n.root.scale.multiply(new U().fromArray(e.s)), t.appearanceMaterials = [], n.root.traverse((e) => {
|
|
13567
13677
|
if (!(e.isMesh || e.isLine || e.isLineSegments || e.isSprite)) return;
|
|
13568
13678
|
e.userData.node = t;
|
|
@@ -13583,7 +13693,7 @@ var pu = class extends HTMLElement {
|
|
|
13583
13693
|
entityId: e.id,
|
|
13584
13694
|
error: r
|
|
13585
13695
|
} }));
|
|
13586
|
-
let i =
|
|
13696
|
+
let i = $l(Ql("box"));
|
|
13587
13697
|
t.material = new ia({
|
|
13588
13698
|
color: "#ed8f98",
|
|
13589
13699
|
roughness: .72,
|
|
@@ -13592,13 +13702,13 @@ var pu = class extends HTMLElement {
|
|
|
13592
13702
|
}
|
|
13593
13703
|
t.labelSize = new U().fromArray(e.s);
|
|
13594
13704
|
} else {
|
|
13595
|
-
let n = o === "box" && Number(e.radius) > 0, r =
|
|
13596
|
-
n ||
|
|
13705
|
+
let n = o === "box" && Number(e.radius) > 0, r = Ql(o, e.radius, e.segments, e.s);
|
|
13706
|
+
n || $l(r), t.material = new ia({
|
|
13597
13707
|
color: a,
|
|
13598
13708
|
roughness: .72,
|
|
13599
13709
|
metalness: .06,
|
|
13600
13710
|
transparent: !0,
|
|
13601
|
-
opacity:
|
|
13711
|
+
opacity: wl(e.type) ? .96 : 1
|
|
13602
13712
|
}), t.mesh = new An(r, t.material), t.mesh.scale.fromArray(n ? [
|
|
13603
13713
|
1,
|
|
13604
13714
|
1,
|
|
@@ -13613,7 +13723,7 @@ var pu = class extends HTMLElement {
|
|
|
13613
13723
|
1
|
|
13614
13724
|
] : e.s), t.group.add(t.edge);
|
|
13615
13725
|
}
|
|
13616
|
-
t.label =
|
|
13726
|
+
t.label = hu(e.name, a, t.labelSize, e.type, this.showShellLabels), t.labelAnchor = fu(e, this.modelData.style), t.label.userData.node = t, t.label.traverse((e) => {
|
|
13617
13727
|
e.userData.node = t;
|
|
13618
13728
|
}), t.group.add(t.label), this.scene.add(t.group);
|
|
13619
13729
|
}
|
|
@@ -13648,36 +13758,68 @@ var pu = class extends HTMLElement {
|
|
|
13648
13758
|
return i.add(s.multiplyScalar(u));
|
|
13649
13759
|
}
|
|
13650
13760
|
_activeRelationIndexes() {
|
|
13651
|
-
|
|
13652
|
-
|
|
13653
|
-
|
|
13761
|
+
let e = (e) => e.filter((e) => {
|
|
13762
|
+
let t = this.relations[e]?.group;
|
|
13763
|
+
return !t || !this.visibleRelationGroups || this.visibleRelationGroups.has(t);
|
|
13764
|
+
});
|
|
13765
|
+
if (this.relationMode === "all") return e(this.relations.map((e, t) => t));
|
|
13766
|
+
if (this.selectedRelationIndex !== null && this.relationMode === "selected") return e([this.selectedRelationIndex]);
|
|
13767
|
+
if (this.relationMode === "selected") return this.selected ? e(this.relations.map((e, t) => e.from === this.selected.id || e.to === this.selected.id ? t : -1).filter((e) => e >= 0)) : [];
|
|
13654
13768
|
if (!["callers", "called"].includes(this.relationMode)) return [];
|
|
13655
|
-
let
|
|
13656
|
-
return
|
|
13769
|
+
let t = this.selectedRelationIndex === null ? null : this.relations[this.selectedRelationIndex], n = this.selected?.id || (this.relationMode === "callers" ? t?.to : t?.from);
|
|
13770
|
+
return n ? e(this._recursiveRelationIndexes(n, this.relationMode)) : [];
|
|
13657
13771
|
}
|
|
13658
13772
|
_recursiveRelationIndexes(e, t) {
|
|
13659
13773
|
let n = [e], r = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set();
|
|
13660
13774
|
for (; n.length;) {
|
|
13661
13775
|
let e = n.shift();
|
|
13662
13776
|
e && !r.has(e) && (r.add(e), this.relations.forEach((a, o) => {
|
|
13663
|
-
let s =
|
|
13777
|
+
let s = Pl(a) === "bidirectional", c = null;
|
|
13664
13778
|
t === "callers" ? a.to === e ? c = a.from : s && a.from === e && (c = a.to) : a.from === e ? c = a.to : s && a.to === e && (c = a.from), c && (i.add(o), r.has(c) || n.push(c));
|
|
13665
13779
|
}));
|
|
13666
13780
|
}
|
|
13667
13781
|
return [...i].sort((e, t) => e - t);
|
|
13668
13782
|
}
|
|
13669
13783
|
_createRelationMarker(e, t, n, r = this.relationMarker) {
|
|
13670
|
-
let i =
|
|
13784
|
+
let i = Ol(r), a = new An(i === "ring" ? new na(.068, .018, 8, 20) : new Dr(.09, .22, 12), new rn({
|
|
13671
13785
|
color: e,
|
|
13672
13786
|
transparent: !0,
|
|
13673
13787
|
opacity: t,
|
|
13674
13788
|
depthWrite: !1
|
|
13675
13789
|
})), o = i === "ring" ? new U(0, 0, 1) : new U(0, 1, 0);
|
|
13676
|
-
return a.quaternion.setFromUnitVectors(o, n), a.userData.relationMarker = i, a;
|
|
13790
|
+
return a.quaternion.setFromUnitVectors(o, n), a.userData.relationMarker = i, a.userData.markerAxis = o, a;
|
|
13791
|
+
}
|
|
13792
|
+
_relationColor(e) {
|
|
13793
|
+
let t = this.modelData?.palette || el, n = (this.modelData?.relationGroups || []).find((t) => t.id === e.group)?.color;
|
|
13794
|
+
return new X(t[n] || n || t.connection || el.connection);
|
|
13795
|
+
}
|
|
13796
|
+
_relationBundleIndexes(e = this.selectedRelationIndex) {
|
|
13797
|
+
let t = this._relationIndex(e), n = this.relations[t];
|
|
13798
|
+
if (!n) return [];
|
|
13799
|
+
let r = [n.from, n.to].sort().join("\0");
|
|
13800
|
+
return this.relations.map((e, t) => [e, t]).filter(([e]) => [e.from, e.to].sort().join("\0") === r).map(([, e]) => e);
|
|
13801
|
+
}
|
|
13802
|
+
getRelationBundle(e = this.selectedRelationIndex) {
|
|
13803
|
+
return this._relationBundleIndexes(e).map((e) => ({
|
|
13804
|
+
index: e,
|
|
13805
|
+
relation: this._publicRelation(e)
|
|
13806
|
+
}));
|
|
13807
|
+
}
|
|
13808
|
+
_relationCurve(e, t, n = 0, r = 1) {
|
|
13809
|
+
if (r < 2) return new ri(e, t);
|
|
13810
|
+
let i = t.clone().sub(e), a = i.length(), o = i.clone().normalize(), s = Math.abs(o.y) < .88 ? new U(0, 1, 0) : new U(1, 0, 0), c = o.clone().cross(s).normalize(), l = o.clone().cross(c).normalize(), u = n / r * Math.PI * 2, d = Math.min(.15, .055 + Math.min(r, 8) * .011), f = c.multiplyScalar(Math.cos(u) * d).add(l.multiplyScalar(Math.sin(u) * d)), p = Math.min(.22, Math.max(.12, .65 / Math.max(a, .01)));
|
|
13811
|
+
return new Ur([
|
|
13812
|
+
e.clone(),
|
|
13813
|
+
e.clone().lerp(t, p),
|
|
13814
|
+
e.clone().lerp(t, .38).add(f),
|
|
13815
|
+
e.clone().lerp(t, .62).add(f),
|
|
13816
|
+
e.clone().lerp(t, 1 - p),
|
|
13817
|
+
t.clone()
|
|
13818
|
+
]);
|
|
13677
13819
|
}
|
|
13678
13820
|
_rebuildRelations() {
|
|
13679
13821
|
this._clearRelationGroup();
|
|
13680
|
-
let e = this._activeRelationIndexes(), t = this._focusedEntityIds(), n = new
|
|
13822
|
+
let e = this._activeRelationIndexes(), t = this._focusedEntityIds(), n = /* @__PURE__ */ new Map();
|
|
13681
13823
|
for (let r of e) {
|
|
13682
13824
|
let e = this.relations[r], i = this.nodes.get(e.from), a = this.nodes.get(e.to);
|
|
13683
13825
|
if (!i || !a) continue;
|
|
@@ -13685,48 +13827,79 @@ var pu = class extends HTMLElement {
|
|
|
13685
13827
|
if (!o && this.focusFilter.effect === "hide") continue;
|
|
13686
13828
|
let s = o ? 1 : this.focusFilter.opacity, c = this._endpoint(i, a, !0, e), l = this._endpoint(a, i, !1, e), u = l.clone().sub(c);
|
|
13687
13829
|
if (u.lengthSq() < .01) continue;
|
|
13688
|
-
let d =
|
|
13689
|
-
|
|
13690
|
-
|
|
13830
|
+
let d = [e.from, e.to].sort().join("\0");
|
|
13831
|
+
n.has(d) || n.set(d, []), n.get(d).push({
|
|
13832
|
+
index: r,
|
|
13833
|
+
relation: e,
|
|
13834
|
+
start: c,
|
|
13835
|
+
end: l,
|
|
13836
|
+
delta: u,
|
|
13837
|
+
focusAlpha: s
|
|
13838
|
+
});
|
|
13839
|
+
}
|
|
13840
|
+
for (let e of n.values()) {
|
|
13841
|
+
e.sort((e, t) => e.index - t.index);
|
|
13842
|
+
let t = e.length > 1;
|
|
13843
|
+
if (t) {
|
|
13844
|
+
let { start: t, end: n, focusAlpha: r } = e[0], i = e.some((e) => e.index === this.selectedRelationIndex), a = new X(this.modelData?.palette.relation_bundle || "#7693a3");
|
|
13845
|
+
i && a.lerp(new X(16777215), .25);
|
|
13846
|
+
let o = new An(new ra(new ri(t, n), 12, .095 + Math.min(.07, e.length * .012), 10, !1), new rn({
|
|
13847
|
+
color: a,
|
|
13691
13848
|
transparent: !0,
|
|
13692
|
-
opacity:
|
|
13849
|
+
opacity: (i ? .34 : .22) * r,
|
|
13693
13850
|
depthTest: !0,
|
|
13694
|
-
depthWrite: !1
|
|
13695
|
-
|
|
13696
|
-
|
|
13697
|
-
|
|
13698
|
-
return i.renderOrder = il, this.relationGroup.add(i), i;
|
|
13699
|
-
}, m = new An(new ra(new ri(c, l), 10, .16, 6, !1), new rn({
|
|
13700
|
-
transparent: !0,
|
|
13701
|
-
opacity: 0,
|
|
13702
|
-
colorWrite: !1,
|
|
13703
|
-
depthTest: !1,
|
|
13704
|
-
depthWrite: !1,
|
|
13705
|
-
side: 2
|
|
13706
|
-
}));
|
|
13707
|
-
if (m.userData.relationIndex = r, m.userData.relationPick = !0, m.frustumCulled = !1, this.relationGroup.add(m), d === "broken") {
|
|
13708
|
-
p(14965603);
|
|
13709
|
-
let e = u.clone().normalize(), t = Math.min(.18, Math.max(.07, u.length() * .018));
|
|
13710
|
-
for (let n = 0; n < 3; n++) {
|
|
13711
|
-
let i = c.clone().lerp(l, (n + 1) / 4), a = this._createRelationMarker(14965603, (f ? 1 : .9) * s, e);
|
|
13712
|
-
a.userData.relationIndex = r, a.userData.phase = n / 3, a.userData.oscillate = !0, a.userData.start = i.clone().sub(e.clone().multiplyScalar(t)), a.userData.end = i.clone().add(e.clone().multiplyScalar(t)), a.renderOrder = il, this.relationGroup.add(a);
|
|
13713
|
-
}
|
|
13714
|
-
continue;
|
|
13715
|
-
}
|
|
13716
|
-
p(n);
|
|
13717
|
-
let h = u.clone().normalize();
|
|
13718
|
-
for (let e = 0; e < 4; e++) {
|
|
13719
|
-
let t = d === "bidirectional" && e % 2 ? -1 : 1, i = this._createRelationMarker(n, (f ? 1 : .9) * s, h.clone().multiplyScalar(t));
|
|
13720
|
-
i.userData.relationIndex = r, i.userData.phase = e / 4, i.userData.direction = t, i.userData.start = c.clone(), i.userData.end = l.clone(), i.renderOrder = il, this.relationGroup.add(i);
|
|
13851
|
+
depthWrite: !1,
|
|
13852
|
+
side: 2
|
|
13853
|
+
}));
|
|
13854
|
+
o.userData.relationBundle = e.map((e) => e.index), o.renderOrder = 14, this.relationGroup.add(o);
|
|
13721
13855
|
}
|
|
13856
|
+
e.forEach((n, r) => {
|
|
13857
|
+
let { index: i, relation: a, start: o, end: s, delta: c, focusAlpha: l } = n, u = Pl(a), d = i === this.selectedRelationIndex, f = this._relationCurve(o, s, r, e.length), p = u === "broken" ? new X(14965603) : this._relationColor(a), m = (e, n = .055, r = .88) => {
|
|
13858
|
+
let a = new rn({
|
|
13859
|
+
color: e,
|
|
13860
|
+
transparent: !0,
|
|
13861
|
+
opacity: r * l,
|
|
13862
|
+
depthTest: !0,
|
|
13863
|
+
depthWrite: !1
|
|
13864
|
+
});
|
|
13865
|
+
d && (a.color.lerp(new X(16777215), .28), a.opacity = 1);
|
|
13866
|
+
let o = new An(new ra(f, t ? 20 : 10, d ? n * 1.45 : n, 6, !1), a);
|
|
13867
|
+
return o.renderOrder = al, o.userData.relationIndex = i, o.userData.relationConductor = t, this.relationGroup.add(o), o;
|
|
13868
|
+
}, h = new An(new ra(f, t ? 20 : 10, t ? .095 : .16, 6, !1), new rn({
|
|
13869
|
+
transparent: !0,
|
|
13870
|
+
opacity: 0,
|
|
13871
|
+
colorWrite: !1,
|
|
13872
|
+
depthTest: !1,
|
|
13873
|
+
depthWrite: !1,
|
|
13874
|
+
side: 2
|
|
13875
|
+
}));
|
|
13876
|
+
if (h.userData.relationIndex = i, h.userData.relationPick = !0, h.frustumCulled = !1, this.relationGroup.add(h), u === "broken") {
|
|
13877
|
+
m(p, t ? .038 : .055);
|
|
13878
|
+
let e = Math.min(.18, Math.max(.07, c.length() * .018)), n = t ? 1 : 3;
|
|
13879
|
+
for (let t = 0; t < n; t++) {
|
|
13880
|
+
let r = (t + 1) / (n + 1), a = f.getPoint(r), o = f.getTangent(r).normalize(), s = this._createRelationMarker(p, (d ? 1 : .9) * l, o);
|
|
13881
|
+
s.userData.relationIndex = i, s.userData.phase = t / n, s.userData.oscillate = !0, s.userData.start = a.clone().sub(o.clone().multiplyScalar(e)), s.userData.end = a.clone().add(o.clone().multiplyScalar(e)), s.renderOrder = al, this.relationGroup.add(s);
|
|
13882
|
+
}
|
|
13883
|
+
return;
|
|
13884
|
+
}
|
|
13885
|
+
m(p, t ? .038 : .055);
|
|
13886
|
+
let g = t ? u === "bidirectional" ? 2 : 1 : 4;
|
|
13887
|
+
for (let e = 0; e < g; e++) {
|
|
13888
|
+
let t = u === "bidirectional" && e % 2 ? -1 : 1, n = (e + 1) / (g + 1), r = f.getTangent(n).normalize(), a = this._createRelationMarker(p, (d ? 1 : .9) * l, r.clone().multiplyScalar(t));
|
|
13889
|
+
a.userData.relationIndex = i, a.userData.phase = e / g, a.userData.direction = t, a.userData.start = o.clone(), a.userData.end = s.clone(), a.userData.curve = f, a.renderOrder = al, this.relationGroup.add(a);
|
|
13890
|
+
}
|
|
13891
|
+
});
|
|
13722
13892
|
}
|
|
13723
13893
|
}
|
|
13724
13894
|
_renderPanel() {
|
|
13725
13895
|
if (!this.modelData) return;
|
|
13726
13896
|
let e = this.selectedRelationIndex === null ? null : this.relations[this.selectedRelationIndex];
|
|
13727
13897
|
if (e) {
|
|
13728
|
-
let t =
|
|
13729
|
-
|
|
13898
|
+
let t = Pl(e), n = (this.modelData.relationGroups || []).find((t) => t.id === e.group), r = new Map((this.modelData.relationGroups || []).map((e) => [e.id, e])), i = this.getRelationBundle(this.selectedRelationIndex), a = e.text ? "<p>" + Ul(e.text) + "</p>" : "", o = Wl(e.url), s = n ? "<h3>GRUPO</h3><p>" + Ul(n.label || n.id) + "</p>" : "", c = i.map(({ index: e, relation: t }) => {
|
|
13899
|
+
let n = r.get(t.group), i = [n?.label || n?.id || "Sin grupo", Pl(t)].join(" · ");
|
|
13900
|
+
return "<button class=\"relation" + (e === this.selectedRelationIndex ? " selected" : "") + "\" data-action=\"relation\" data-relation-index=\"" + e + "\"><strong>" + Ul(t.label || `${t.from} → ${t.to}`) + "</strong><small>" + Ul(i) + "</small></button>";
|
|
13901
|
+
}).join(""), l = i.length === 1 ? "1 conexión" : `${i.length} conexiones`;
|
|
13902
|
+
this.panel.innerHTML = "<button class=\"back\" data-action=\"overview\">← Vista de conjunto</button><button data-action=\"focus-selection\">◎ Enfocar selección</button><div class=\"eyebrow\">RELACIÓN</div><h2>" + Ul(e.label || `${e.from} → ${e.to}`) + "</h2><div class=\"sub\">" + Ul(e.from) + " → " + Ul(e.to) + "</div>" + a + o + s + "<h3>MODO</h3><p>" + Ul(t) + "</p><h3>TUBO VIRTUAL</h3><p>" + Ul(`${e.from} ↔ ${e.to} · ${l}`) + "</p>" + c, this.panel.querySelector("[data-action=\"overview\"]")?.addEventListener("click", () => this.reset()), this.panel.querySelector("[data-action=\"focus-selection\"]")?.addEventListener("click", () => this.focusSelection()), this.panel.querySelectorAll("[data-action=\"relation\"]").forEach((e) => e.addEventListener("click", () => this.selectRelation(Number(e.dataset.relationIndex), { source: "panel" }))), this._applyTheme();
|
|
13730
13903
|
return;
|
|
13731
13904
|
}
|
|
13732
13905
|
let t = this.selected;
|
|
@@ -13736,11 +13909,11 @@ var pu = class extends HTMLElement {
|
|
|
13736
13909
|
}
|
|
13737
13910
|
let n = this.relations.filter((e) => e.from === t.id || e.to === t.id), r = this.modelData.entities.filter((e) => e.parent === t.id), i = [], a = /* @__PURE__ */ new Set(), o = t;
|
|
13738
13911
|
for (; o && !a.has(o.id);) a.add(o.id), i.unshift(o), o = o.parent ? this.nodes.get(o.parent) : null;
|
|
13739
|
-
let s = "<nav class=\"crumbs\" aria-label=\"Ruta del modelo\"><button data-action=\"overview\">Modelo</button>" + i.map((e, t) => "<span>/</span><button data-action=\"path\" data-id=\"" +
|
|
13740
|
-
let n = this.relations.indexOf(e), r = e.text ? "<small>" +
|
|
13741
|
-
return "<button class=\"relation\" data-action=\"relation\" data-relation-index=\"" + n + "\"><strong>" +
|
|
13912
|
+
let s = "<nav class=\"crumbs\" aria-label=\"Ruta del modelo\"><button data-action=\"overview\">Modelo</button>" + i.map((e, t) => "<span>/</span><button data-action=\"path\" data-id=\"" + Ul(e.id) + "\" class=\"" + (t === i.length - 1 ? "current" : "") + "\">" + Ul(e.name) + "</button>").join("") + "</nav>", c = n.map((e) => {
|
|
13913
|
+
let n = this.relations.indexOf(e), r = e.text ? "<small>" + Ul(e.text) + "</small>" : "";
|
|
13914
|
+
return "<button class=\"relation\" data-action=\"relation\" data-relation-index=\"" + n + "\"><strong>" + Ul(e.label || (e.from === t.id ? e.to : e.from)) + "</strong><small>" + Ul(e.from) + " → " + Ul(e.to) + "</small>" + r + "</button>";
|
|
13742
13915
|
}).join("");
|
|
13743
|
-
this.panel.innerHTML = "<button class=\"back\" data-action=\"overview\">← Vista de conjunto</button>" + s + "<button data-action=\"focus-selection\">◎ Enfocar selección</button><div class=\"eyebrow\">" +
|
|
13916
|
+
this.panel.innerHTML = "<button class=\"back\" data-action=\"overview\">← Vista de conjunto</button>" + s + "<button data-action=\"focus-selection\">◎ Enfocar selección</button><div class=\"eyebrow\">" + Ul(wl(t.type) ? "CONTENEDOR" : t.type === "actor" ? "ACTOR EXTERNO" : "COMPONENTE") + "</div><h2>" + Ul(t.name) + "</h2><div class=\"sub\">" + Ul(t.sub || "") + "</div><p>" + Ul(t.text || "") + "</p>" + Wl(t.url) + (wl(t.type) ? "<button data-action=\"toggle-shell\">" + (this.open.has(t.id) ? "Cerrar bloque" : "Abrir bloque") + "</button>" : "") + (r.length ? "<h3>CONTIENE</h3><p>" + r.length + " pieza(s) interna(s).</p>" : "") + "<h3>RELACIONES</h3>" + (c || "<p>No hay relaciones directas.</p>"), this.panel.querySelectorAll("[data-action=\"overview\"]").forEach((e) => e.addEventListener("click", () => this.reset())), this.panel.querySelectorAll("[data-action=\"path\"]").forEach((e) => e.addEventListener("click", () => this.select(e.dataset.id))), this.panel.querySelectorAll("[data-action=\"relation\"]").forEach((e) => e.addEventListener("click", () => this.selectRelation(Number(e.dataset.relationIndex), { source: "panel" }))), this.panel.querySelector("[data-action=\"focus-selection\"]")?.addEventListener("click", () => this.focusSelection()), this.panel.querySelector("[data-action=\"toggle-shell\"]")?.addEventListener("click", () => {
|
|
13744
13917
|
this.toggleContainer(t.id, { source: "panel" });
|
|
13745
13918
|
}), this._applyTheme();
|
|
13746
13919
|
}
|
|
@@ -13749,7 +13922,7 @@ var pu = class extends HTMLElement {
|
|
|
13749
13922
|
if (!n) return this;
|
|
13750
13923
|
let r = new Set(this.open), i = n.parent ? this.nodes.get(n.parent) : null;
|
|
13751
13924
|
for (; i;) r.add(i.id), i = i.parent ? this.nodes.get(i.parent) : null;
|
|
13752
|
-
return this.selected = n, this.selectedRelationIndex = null,
|
|
13925
|
+
return this.selected = n, this.selectedRelationIndex = null, wl(n.type) && r.add(n.id), this._replaceOpenContainers(r, {
|
|
13753
13926
|
refresh: !1,
|
|
13754
13927
|
source: t.source || "api"
|
|
13755
13928
|
}), this._applySelectionNavigation(t.navigation), this._renderPanel(), this._rebuildRelations(), this._syncRelationToolbar(), this._syncFocusToolbar(), this.invalidate(), t.focusEvent !== !1 && this._emitFocusChange(t.source || "api"), t.emit !== !1 && this._emit("lc-select", {
|
|
@@ -13783,10 +13956,23 @@ var pu = class extends HTMLElement {
|
|
|
13783
13956
|
}), this;
|
|
13784
13957
|
}
|
|
13785
13958
|
setRelationMode(e) {
|
|
13786
|
-
this.relationMode =
|
|
13959
|
+
this.relationMode = kl(e), this.setAttribute("relation-mode", this.relationMode), this._syncRelationToolbar(), this._syncFocusToolbar(), this._rebuildRelations(), this.invalidate(), this.dispatchEvent(new CustomEvent("lc-relation-mode", { detail: { mode: this.relationMode } }));
|
|
13960
|
+
}
|
|
13961
|
+
setVisibleRelationGroups(e = null, t = {}) {
|
|
13962
|
+
let n = new Set((this.modelData?.relationGroups || []).map((e) => e.id)), r = e == null ? null : new Set(Array.from(e).map((e) => String(e)).filter((e) => n.has(e))), i = r && n.size > 0 && r.size === n.size ? null : r, a = this.visibleRelationGroups ? [...this.visibleRelationGroups].sort() : null, o = i ? [...i].sort() : null, s = JSON.stringify(a) !== JSON.stringify(o);
|
|
13963
|
+
return this.visibleRelationGroups = i, this._syncRelationToolbar(), s && this.ready !== !1 && (this._rebuildRelations(), this.invalidate()), s && t.emit !== !1 && this._emit("lc-relation-groups-change", {
|
|
13964
|
+
groups: o,
|
|
13965
|
+
source: t.source || "api"
|
|
13966
|
+
}), this;
|
|
13967
|
+
}
|
|
13968
|
+
toggleRelationGroup(e, t = {}) {
|
|
13969
|
+
let n = (this.modelData?.relationGroups || []).map((e) => e.id);
|
|
13970
|
+
if (!n.includes(e)) return this;
|
|
13971
|
+
let r = new Set(this.visibleRelationGroups || n);
|
|
13972
|
+
return r.has(e) ? r.delete(e) : r.add(e), this.setVisibleRelationGroups(r, t);
|
|
13787
13973
|
}
|
|
13788
13974
|
setRelationMarker(e, t = {}) {
|
|
13789
|
-
let n =
|
|
13975
|
+
let n = Ol(e), r = n !== this.relationMarker;
|
|
13790
13976
|
return this.relationMarker = n, this.getAttribute?.("relation-marker") !== n && this.setAttribute?.("relation-marker", n), r && this.ready && (this._rebuildRelations(), this.invalidate()), r && t.emit !== !1 && this._emit("lc-relation-marker-change", {
|
|
13791
13977
|
marker: n,
|
|
13792
13978
|
source: t.source || "api"
|
|
@@ -13816,21 +14002,21 @@ var pu = class extends HTMLElement {
|
|
|
13816
14002
|
for (let e of this.nodes.values()) {
|
|
13817
14003
|
let t = this._focusAlpha(e, i), n = this._isVisible(e) && t > 0;
|
|
13818
14004
|
e.group.visible = n;
|
|
13819
|
-
let r =
|
|
13820
|
-
if (e.mesh.renderOrder = r ? 10 - !!e.parent : 0, e.material)
|
|
14005
|
+
let r = wl(e.type) && this.open.has(e.id), a = (r ? .12 : 1) * t;
|
|
14006
|
+
if (e.mesh.renderOrder = r ? 10 - !!e.parent : 0, e.material) Al(e.material, !0), e.material.opacity = a, e.material.depthWrite = !r, e.material.emissive?.set(e === this.selected ? e.material.color : 0), e.material.emissiveIntensity = e === this.selected ? .15 : 0;
|
|
13821
14007
|
else {
|
|
13822
|
-
for (let n of e.appearanceMaterials || []) Object.hasOwn(n.userData, "atlasBaseOpacity") || (n.userData.atlasBaseOpacity = n.opacity ?? 1), Object.hasOwn(n.userData, "atlasBaseTransparent") || (n.userData.atlasBaseTransparent = n.transparent), Object.hasOwn(n.userData, "atlasBaseDepthWrite") || (n.userData.atlasBaseDepthWrite = n.depthWrite),
|
|
14008
|
+
for (let n of e.appearanceMaterials || []) Object.hasOwn(n.userData, "atlasBaseOpacity") || (n.userData.atlasBaseOpacity = n.opacity ?? 1), Object.hasOwn(n.userData, "atlasBaseTransparent") || (n.userData.atlasBaseTransparent = n.transparent), Object.hasOwn(n.userData, "atlasBaseDepthWrite") || (n.userData.atlasBaseDepthWrite = n.depthWrite), Al(n, n.userData.atlasBaseTransparent || t < 1), n.depthWrite = n.userData.atlasBaseDepthWrite, n.opacity = n.userData.atlasBaseOpacity * t, n.emissive?.set(e === this.selected ? n.color : 0), n.emissiveIntensity = e === this.selected ? .15 : 0;
|
|
13823
14009
|
e._appearanceSelected = e === this.selected;
|
|
13824
14010
|
}
|
|
13825
14011
|
e.edge?.material && (e.edge.material.opacity = (e === this.selected ? 1 : .65) * t);
|
|
13826
|
-
let o =
|
|
14012
|
+
let o = wl(e.type) && r, s = o, c = e.label.userData.front, l = e.label.userData.back, u = e.label.userData.top, d = e.label.userData.height, f = e.label.userData.width, p = e.label.userData.textOffsetX || 0;
|
|
13827
14013
|
e.label.userData.textOffsetY;
|
|
13828
|
-
let m = e.labelSize || new U().fromArray(e.s), h =
|
|
14014
|
+
let m = e.labelSize || new U().fromArray(e.s), h = pu(e.labelAnchor, m, f, d);
|
|
13829
14015
|
e.label.visible = n;
|
|
13830
|
-
let g = this._worldPosition(e), _ = this.itemFacing === "camera" && !
|
|
13831
|
-
if (h) c.visible = _, l.visible = !_, u.visible = !1, c.scale.setScalar(1), l.scale.setScalar(1), c.position.set(h.x, h.y, m.z / 2 + .025), l.position.set(h.x, h.y, -m.z / 2 - .025), c.rotation.z = h.frontRotation, l.rotation.z = h.backRotation, c.material.color.set(15923964), l.material.color.set(15923964), c.material.opacity = t, l.material.opacity = t;
|
|
13832
|
-
else if (
|
|
13833
|
-
c.rotation.z = 0, l.rotation.z = 0, c.visible =
|
|
14016
|
+
let g = this._worldPosition(e), _ = this.itemFacing === "camera" && !wl(e.type) || this.camera.position.z >= g.z, v = e.label.userData.visibleFace || (_ ? "front" : "back"), y = o ? mu(this.camera.position, g, v) : null;
|
|
14017
|
+
if (y && (e.label.userData.visibleFace = y), h) c.visible = _, l.visible = !_, u.visible = !1, c.scale.setScalar(1), l.scale.setScalar(1), c.position.set(h.x, h.y, m.z / 2 + .025), l.position.set(h.x, h.y, -m.z / 2 - .025), c.rotation.z = h.frontRotation, l.rotation.z = h.backRotation, c.material.color.set(15923964), l.material.color.set(15923964), c.material.opacity = t, l.material.opacity = t;
|
|
14018
|
+
else if (wl(e.type)) {
|
|
14019
|
+
c.rotation.z = 0, l.rotation.z = 0, c.visible = o ? y === "front" : _, l.visible = o ? y === "back" : !_, u.visible = s && y === "top";
|
|
13834
14020
|
let e = s ? .52 : 1;
|
|
13835
14021
|
c.scale.setScalar(e), c.position.x = s ? -m.x / 2 + .18 + f * e / 2 - p * e : 0;
|
|
13836
14022
|
let n = .18;
|
|
@@ -13840,7 +14026,12 @@ var pu = class extends HTMLElement {
|
|
|
13840
14026
|
for (let t of this.relationGroup.children) {
|
|
13841
14027
|
if (!t.userData.start) continue;
|
|
13842
14028
|
let n = t.userData.phase || 0, r = t.userData.direction || 1, i = t.userData.oscillate ? .5 + .5 * Math.sin(e * .004 + n * Math.PI * 2) : ((e * 22e-5 * r + n) % 1 + 1) % 1;
|
|
13843
|
-
|
|
14029
|
+
if (t.userData.curve) {
|
|
14030
|
+
let e = i;
|
|
14031
|
+
t.position.copy(t.userData.curve.getPoint(e));
|
|
14032
|
+
let n = t.userData.curve.getTangent(e).normalize().multiplyScalar(r);
|
|
14033
|
+
t.quaternion.setFromUnitVectors(t.userData.markerAxis, n);
|
|
14034
|
+
} else t.position.lerpVectors(t.userData.start, t.userData.end, i);
|
|
13844
14035
|
}
|
|
13845
14036
|
this.renderer.render(this.scene, this.camera), (t > .001 || n > .001 || this.relationGroup.children.length || this.drag) && this.invalidate();
|
|
13846
14037
|
}
|
|
@@ -13848,8 +14039,8 @@ var pu = class extends HTMLElement {
|
|
|
13848
14039
|
let t = this.canvas.getBoundingClientRect();
|
|
13849
14040
|
this.pointer.set((e.clientX - t.left) / t.width * 2 - 1, -(e.clientY - t.top) / t.height * 2 + 1), this.raycaster.setFromCamera(this.pointer, this.camera);
|
|
13850
14041
|
let n = [];
|
|
13851
|
-
for (let e of this.nodes.values()) e.group.visible && (
|
|
13852
|
-
let r = this.raycaster.intersectObjects(n, !0)[0] || null, i = this.relationMode === "none" ? [] : this.relationGroup.children.filter((e) => e.userData?.relationPick), a = this.raycaster.intersectObjects(i, !1)[0] || null;
|
|
14042
|
+
for (let e of this.nodes.values()) e.group.visible && (wl(e.type) && this.open.has(e.id) || n.push(e.pickMesh || e.mesh), e.label?.visible && n.push(...e.label.children.filter((e) => e.visible)));
|
|
14043
|
+
let r = this.raycaster.intersectObjects(n, !0)[0] || null, i = this.relationMode === "none" ? [] : this.relationGroup.children.filter((e) => e.userData?.relationPick || e.userData?.relationBundle), a = this.raycaster.intersectObjects(i, !1)[0] || null;
|
|
13853
14044
|
if (r && (!a || r.distance <= a.distance + .12)) {
|
|
13854
14045
|
let e = r.object;
|
|
13855
14046
|
for (; e;) {
|
|
@@ -13860,6 +14051,14 @@ var pu = class extends HTMLElement {
|
|
|
13860
14051
|
e = e.parent;
|
|
13861
14052
|
}
|
|
13862
14053
|
}
|
|
14054
|
+
if (a?.object.userData?.relationBundle) {
|
|
14055
|
+
let e = a.object.userData.relationBundle;
|
|
14056
|
+
return {
|
|
14057
|
+
kind: "relation",
|
|
14058
|
+
index: e[(e.indexOf(this.selectedRelationIndex) + 1) % e.length],
|
|
14059
|
+
bundle: [...e]
|
|
14060
|
+
};
|
|
14061
|
+
}
|
|
13863
14062
|
return a ? {
|
|
13864
14063
|
kind: "relation",
|
|
13865
14064
|
index: a.object.userData.relationIndex
|
|
@@ -13877,13 +14076,13 @@ var pu = class extends HTMLElement {
|
|
|
13877
14076
|
e.key === "Escape" && (this._closeToolbarMenus(), this.canvas.focus({ preventScroll: !0 }));
|
|
13878
14077
|
}), this.shadowRoot.addEventListener("click", (e) => {
|
|
13879
14078
|
let t = e.target.closest?.("[data-action]"), n = t?.dataset.action;
|
|
13880
|
-
e.target.closest?.(".toolbar-menu") || this._closeToolbarMenus(), n === "minus" && this.zoomOut(), n === "plus" && this.zoomIn(), n === "fit" && this.fit(), n === "front" && this.frontView(), n === "labels" && this.toggleShellLabels(), n === "panel" && this.setPanelVisible(!this.panelVisible), n === "item-facing" && this.toggleItemFacing({ source: "toolbar" }), n === "open-all" && this.openAllContainers({ source: "toolbar" }), n === "close-all" && this.closeAllContainers({ source: "toolbar" }), n === "relations-all" && this.setRelationMode("all"), n === "relations-selected" && this.setRelationMode("selected"), n === "relations-callers" && this.setRelationMode("callers"), n === "relations-called" && this.setRelationMode("called"), n === "relations-none" && this.setRelationMode("none"), n === "focus-all" && this.setFocusFilter({ mode: "all" }, { source: "toolbar" }), n === "focus-dim" && this.setFocusFilter({
|
|
14079
|
+
e.target.closest?.(".toolbar-menu") || this._closeToolbarMenus(), n === "minus" && this.zoomOut(), n === "plus" && this.zoomIn(), n === "fit" && this.fit(), n === "front" && this.frontView(), n === "labels" && this.toggleShellLabels(), n === "panel" && this.setPanelVisible(!this.panelVisible), n === "item-facing" && this.toggleItemFacing({ source: "toolbar" }), n === "open-all" && this.openAllContainers({ source: "toolbar" }), n === "close-all" && this.closeAllContainers({ source: "toolbar" }), n === "relations-all" && this.setRelationMode("all"), n === "relations-selected" && this.setRelationMode("selected"), n === "relations-callers" && this.setRelationMode("callers"), n === "relations-called" && this.setRelationMode("called"), n === "relations-none" && this.setRelationMode("none"), n === "relation-group-toggle" && this.toggleRelationGroup(t.dataset.relationGroup, { source: "toolbar" }), n === "focus-all" && this.setFocusFilter({ mode: "all" }, { source: "toolbar" }), n === "focus-dim" && this.setFocusFilter({
|
|
13881
14080
|
mode: "connected",
|
|
13882
14081
|
effect: "dim"
|
|
13883
14082
|
}, { source: "toolbar" }), n === "focus-hide" && this.setFocusFilter({
|
|
13884
14083
|
mode: "connected",
|
|
13885
14084
|
effect: "hide"
|
|
13886
|
-
}, { source: "toolbar" }), n === "focus-selection" && this.focusSelection(), n === "focus-layout" && this.setFocusFilter({ layout: this.focusFilter.layout === "reflow" ? "preserve" : "reflow" }, { source: "toolbar" }), t?.closest?.(".toolbar-popover") && this._closeToolbarMenus(), n && this.invalidate();
|
|
14085
|
+
}, { source: "toolbar" }), n === "focus-selection" && this.focusSelection(), n === "focus-layout" && this.setFocusFilter({ layout: this.focusFilter.layout === "reflow" ? "preserve" : "reflow" }, { source: "toolbar" }), t?.closest?.(".toolbar-popover") && n !== "relation-group-toggle" && this._closeToolbarMenus(), n && this.invalidate();
|
|
13887
14086
|
}), this.canvas.addEventListener("contextmenu", (e) => e.preventDefault()), this.canvas.addEventListener("pointerdown", (e) => {
|
|
13888
14087
|
if (e.pointerType !== "touch" && ![
|
|
13889
14088
|
0,
|
|
@@ -13921,7 +14120,7 @@ var pu = class extends HTMLElement {
|
|
|
13921
14120
|
y: e.clientY
|
|
13922
14121
|
}), e.pointerType === "touch" && this.pointers.size >= 2) {
|
|
13923
14122
|
let [e, t] = [...this.pointers.values()], n = (e.x + t.x) / 2, r = (e.y + t.y) / 2, i = Math.max(1, Math.hypot(e.x - t.x, e.y - t.y));
|
|
13924
|
-
this.drag.mode === "touch-pan" ? (this._panByPixels(n - this.drag.x, r - this.drag.y), this.targetZoom = Math.min(
|
|
14123
|
+
this.drag.mode === "touch-pan" ? (this._panByPixels(n - this.drag.x, r - this.drag.y), this.targetZoom = Math.min(il, Math.max(rl, this.targetZoom * i / Math.max(1, this.drag.distance))), Object.assign(this.drag, {
|
|
13925
14124
|
x: n,
|
|
13926
14125
|
y: r,
|
|
13927
14126
|
distance: i,
|
|
@@ -13992,16 +14191,16 @@ var pu = class extends HTMLElement {
|
|
|
13992
14191
|
navigation: "fit"
|
|
13993
14192
|
});
|
|
13994
14193
|
}), this.canvas.addEventListener("wheel", (e) => {
|
|
13995
|
-
e.preventDefault(), this.targetZoom = Math.min(
|
|
14194
|
+
e.preventDefault(), this.targetZoom = Math.min(il, Math.max(rl, this.targetZoom * Math.exp(-e.deltaY * .001))), this.invalidate();
|
|
13996
14195
|
}, { passive: !1 });
|
|
13997
14196
|
}
|
|
13998
14197
|
_showError(e) {
|
|
13999
14198
|
let t = this.shadowRoot.querySelector(".viewport"), n = t.querySelector(".error");
|
|
14000
|
-
n ? n.textContent = e : t.insertAdjacentHTML("beforeend", "<div class=\"error\" role=\"alert\">" +
|
|
14199
|
+
n ? n.textContent = e : t.insertAdjacentHTML("beforeend", "<div class=\"error\" role=\"alert\">" + Ul(e) + "</div>");
|
|
14001
14200
|
}
|
|
14002
14201
|
};
|
|
14003
|
-
customElements.get("liquidcars-atlas") || customElements.define("liquidcars-atlas",
|
|
14202
|
+
customElements.get("liquidcars-atlas") || customElements.define("liquidcars-atlas", bu);
|
|
14004
14203
|
//#endregion
|
|
14005
|
-
export { $c as ATLAS_VERSION, tl as DEFAULT_RELATION_MARKER,
|
|
14204
|
+
export { $c as ATLAS_VERSION, tl as DEFAULT_RELATION_MARKER, bu as LiquidCarsAtlas, nl as RELATION_DISPLAY_MODES, yu as captureRendererFrame, su as createSvgExtrudeGeometry, xl as getGeometryCatalog, Sl as getGeometryPackCatalog, pu as labelPlacementForAnchor, du as normalizeLabelAnchor, ql as normalizeModel, mu as preferredContainerLabelFace, yl as registerGeometryPack, fu as resolveEntityLabelAnchor, bl as unregisterGeometryPack };
|
|
14006
14205
|
|
|
14007
14206
|
//# sourceMappingURL=liquidcars-atlas.js.map
|