@liquidcars/atlas 0.1.32 → 0.1.34

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.
@@ -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 P(e, t, n) {
45
+ function ee(e, t, n) {
46
46
  return e === t ? 0 : (n - e) / (t - e);
47
47
  }
48
- function F(e, t, n) {
48
+ function P(e, t, n) {
49
49
  return (1 - n) * e + n * t;
50
50
  }
51
- function I(e, t, n, r) {
52
- return F(e, t, 1 - Math.exp(-n * r));
51
+ function F(e, t, n, r) {
52
+ return P(e, t, 1 - Math.exp(-n * r));
53
53
  }
54
- function ee(e, t = 1) {
54
+ function te(e, t = 1) {
55
55
  return t - Math.abs(M(e, t * 2) - t);
56
56
  }
57
- function te(e, t, n) {
57
+ function ne(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 L(e, t, n) {
60
+ function I(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 ne(e, t) {
63
+ function re(e, t) {
64
64
  return e + Math.floor(Math.random() * (t - e + 1));
65
65
  }
66
- function re(e, t) {
66
+ function ie(e, t) {
67
67
  return e + Math.random() * (t - e);
68
68
  }
69
- function ie(e) {
69
+ function ae(e) {
70
70
  return e * (.5 - Math.random());
71
71
  }
72
- function R(e) {
72
+ function L(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 z(e) {
77
+ function R(e) {
78
78
  return e * O;
79
79
  }
80
- function ae(e) {
80
+ function oe(e) {
81
81
  return e * k;
82
82
  }
83
- function oe(e) {
83
+ function se(e) {
84
84
  return !(e & e - 1) && e !== 0;
85
85
  }
86
- function se(e) {
86
+ function ce(e) {
87
87
  return 2 ** Math.ceil(Math.log(e) / Math.LN2);
88
88
  }
89
- function ce(e) {
89
+ function le(e) {
90
90
  return 2 ** Math.floor(Math.log(e) / Math.LN2);
91
91
  }
92
- function le(e, t, n, r, i) {
92
+ function ue(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 ue(e, t) {
116
+ function z(e, t) {
117
117
  switch (t.constructor) {
118
118
  case Float32Array: return e;
119
119
  case Uint32Array: return e / 4294967295;
@@ -144,24 +144,24 @@ var de = {
144
144
  clamp: j,
145
145
  euclideanModulo: M,
146
146
  mapLinear: N,
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: ie,
156
- seededRandom: R,
157
- degToRad: z,
158
- radToDeg: ae,
159
- isPowerOfTwo: oe,
160
- ceilPowerOfTwo: se,
161
- floorPowerOfTwo: ce,
162
- setQuaternionFromProperEuler: le,
147
+ inverseLerp: ee,
148
+ lerp: P,
149
+ damp: F,
150
+ pingpong: te,
151
+ smoothstep: ne,
152
+ smootherstep: I,
153
+ randInt: re,
154
+ randFloat: ie,
155
+ randFloatSpread: ae,
156
+ seededRandom: L,
157
+ degToRad: R,
158
+ radToDeg: oe,
159
+ isPowerOfTwo: se,
160
+ ceilPowerOfTwo: ce,
161
+ floorPowerOfTwo: le,
162
+ setQuaternionFromProperEuler: ue,
163
163
  normalize: B,
164
- denormalize: ue
164
+ denormalize: z
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], 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;
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], ee = r[7], P = r[11], F = r[15];
1979
+ return i[0] = a * x + o * T + s * k + c * N, i[4] = a * S + o * E + s * A + c * ee, i[8] = a * C + o * D + s * j + c * P, i[12] = a * w + o * O + s * M + c * F, i[1] = l * x + u * T + d * k + f * N, i[5] = l * S + u * E + d * A + f * ee, i[9] = l * C + u * D + d * j + f * P, i[13] = l * w + u * O + d * M + f * F, i[2] = p * x + m * T + h * k + g * N, i[6] = p * S + m * E + h * A + g * ee, i[10] = p * C + m * D + h * j + g * P, i[14] = p * w + m * O + h * M + g * F, i[3] = _ * x + v * T + y * k + b * N, i[7] = _ * S + v * E + y * A + b * ee, i[11] = _ * C + v * D + y * j + b * P, i[15] = _ * w + v * O + y * M + b * F, 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 = F(Zt.h, Qt.h, t), r = F(Zt.s, Qt.s, t), i = F(Zt.l, Qt.l, t);
2857
+ let n = P(Zt.h, Qt.h, t), r = P(Zt.s, Qt.s, t), i = P(Zt.l, Qt.l, t);
2858
2858
  return this.setHSL(n, r, i), this;
2859
2859
  }
2860
2860
  setFromVector3(e) {
@@ -3020,35 +3020,35 @@ 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 = ue(n, this.array)), n;
3023
+ return this.normalized && (n = z(n, this.array)), n;
3024
3024
  }
3025
3025
  setComponent(e, t, n) {
3026
3026
  return this.normalized && (n = B(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 = ue(t, this.array)), t;
3030
+ return this.normalized && (t = z(t, this.array)), t;
3031
3031
  }
3032
3032
  setX(e, t) {
3033
3033
  return this.normalized && (t = B(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 = ue(t, this.array)), t;
3037
+ return this.normalized && (t = z(t, this.array)), t;
3038
3038
  }
3039
3039
  setY(e, t) {
3040
3040
  return this.normalized && (t = B(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 = ue(t, this.array)), t;
3044
+ return this.normalized && (t = z(t, this.array)), t;
3045
3045
  }
3046
3046
  setZ(e, t) {
3047
3047
  return this.normalized && (t = B(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 = ue(t, this.array)), t;
3051
+ return this.normalized && (t = z(t, this.array)), t;
3052
3052
  }
3053
3053
  setW(e, t) {
3054
3054
  return this.normalized && (t = B(t, this.array)), this.array[e * this.itemSize + 3] = t, 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, P = j.concat();
5389
+ let M = [], N, ee = 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), P = P.concat(N);
5394
+ M.push(N), ee = ee.concat(N);
5395
5395
  }
5396
- let F;
5397
- if (p === 0) F = Gi.triangulateShape(D, w);
5396
+ let P;
5397
+ if (p === 0) P = 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
- re(n.x, n.y, -i), r === 0 && e.push(n);
5404
+ ie(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
- re(t.x, t.y, -i), r === 0 && o.push(t);
5412
+ ie(t.x, t.y, -i), r === 0 && o.push(t);
5413
5413
  }
5414
5414
  r === 0 && t.push(o);
5415
5415
  }
5416
5416
  }
5417
- F = Gi.triangulateShape(e, t);
5417
+ P = Gi.triangulateShape(e, t);
5418
5418
  }
5419
- let I = F.length, ee = d + f;
5419
+ let F = P.length, te = d + f;
5420
5420
  for (let e = 0; e < k; e++) {
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);
5421
+ let t = l ? O(C[e], ee[e], te) : 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), ie(x.x, x.y, x.z)) : ie(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], 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);
5425
+ let n = l ? O(C[t], ee[t], te) : 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), ie(x.x, x.y, x.z)) : ie(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
- re(t.x, t.y, c + n);
5432
+ ie(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
- _ ? re(i.x, i.y + g[s - 1].y, g[s - 1].x + n) : re(i.x, i.y, c + n);
5439
+ _ ? ie(i.x, i.y + g[s - 1].y, g[s - 1].x + n) : ie(i.x, i.y, c + n);
5440
5440
  }
5441
5441
  }
5442
5442
  }
5443
- te(), L();
5444
- function te() {
5443
+ ne(), I();
5444
+ function ne() {
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 < I; e++) {
5449
- let n = F[e];
5450
- ie(n[2] + t, n[1] + t, n[0] + t);
5448
+ for (let e = 0; e < F; e++) {
5449
+ let n = P[e];
5450
+ ae(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 < I; e++) {
5454
- let n = F[e];
5455
- ie(n[0] + t, n[1] + t, n[2] + t);
5453
+ for (let e = 0; e < F; e++) {
5454
+ let n = P[e];
5455
+ ae(n[0] + t, n[1] + t, n[2] + t);
5456
5456
  }
5457
5457
  } else {
5458
- for (let e = 0; e < I; e++) {
5459
- let t = F[e];
5460
- ie(t[2], t[1], t[0]);
5458
+ for (let e = 0; e < F; e++) {
5459
+ let t = P[e];
5460
+ ae(t[2], t[1], t[0]);
5461
5461
  }
5462
- for (let e = 0; e < I; e++) {
5463
- let t = F[e];
5464
- ie(t[0] + k * s, t[1] + k * s, t[2] + k * s);
5462
+ for (let e = 0; e < F; e++) {
5463
+ let t = P[e];
5464
+ ae(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 L() {
5469
+ function I() {
5470
5470
  let e = r.length / 3, t = 0;
5471
- ne(D, t), t += D.length;
5471
+ re(D, t), t += D.length;
5472
5472
  for (let e = 0, n = w.length; e < n; e++) {
5473
5473
  let n = w[e];
5474
- ne(n, t), t += n.length;
5474
+ re(n, t), t += n.length;
5475
5475
  }
5476
5476
  n.addGroup(e, r.length / 3 - e, 1);
5477
5477
  }
5478
- function ne(e, t) {
5478
+ function re(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
- R(t + r + n, t + i + n, t + i + a, t + r + a);
5485
+ L(t + r + n, t + i + n, t + i + a, t + r + a);
5486
5486
  }
5487
5487
  }
5488
5488
  }
5489
- function re(e, t, n) {
5489
+ function ie(e, t, n) {
5490
5490
  a.push(e), a.push(t), a.push(n);
5491
5491
  }
5492
- function ie(e, t, i) {
5493
- z(e), z(t), z(i);
5492
+ function ae(e, t, i) {
5493
+ R(e), R(t), R(i);
5494
5494
  let a = r.length / 3, o = h.generateTopUV(n, r, a - 3, a - 2, a - 1);
5495
- ae(o[0]), ae(o[1]), ae(o[2]);
5495
+ oe(o[0]), oe(o[1]), oe(o[2]);
5496
5496
  }
5497
- function R(e, t, i, a) {
5498
- z(e), z(t), z(a), z(t), z(i), z(a);
5497
+ function L(e, t, i, a) {
5498
+ R(e), R(t), R(a), R(t), R(i), R(a);
5499
5499
  let o = r.length / 3, s = h.generateSideWallUV(n, r, o - 6, o - 3, o - 2, o - 1);
5500
- ae(s[0]), ae(s[1]), ae(s[3]), ae(s[1]), ae(s[2]), ae(s[3]);
5500
+ oe(s[0]), oe(s[1]), oe(s[3]), oe(s[1]), oe(s[2]), oe(s[3]);
5501
5501
  }
5502
- function z(e) {
5502
+ function R(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 ae(e) {
5505
+ function oe(e) {
5506
5506
  i.push(e.x), i.push(e.y);
5507
5507
  }
5508
5508
  }
@@ -9243,7 +9243,7 @@ function Cc(e, t, n, r, i, a, o) {
9243
9243
  let e = Za[w];
9244
9244
  O = e.vertexShader, k = e.fragmentShader;
9245
9245
  } else O = a.vertexShader, k = a.fragmentShader, c.update(a), A = c.getVertexShaderID(a), j = c.getFragmentShaderID(a);
9246
- 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, ie = !!a.normalMap, R = !!a.displacementMap, z = !!a.emissiveMap, ae = !!a.metalnessMap, oe = !!a.roughnessMap, se = a.anisotropy > 0, ce = a.clearcoat > 0, le = a.dispersion > 0, ue = a.iridescence > 0, B = a.sheen > 0, de = a.transmission > 0, V = se && !!a.anisotropyMap, H = ce && !!a.clearcoatMap, U = ce && !!a.clearcoatNormalMap, fe = ce && !!a.clearcoatRoughnessMap, W = ue && !!a.iridescenceMap, G = ue && !!a.iridescenceThicknessMap, K = B && !!a.sheenColorMap, pe = B && !!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;
9246
+ let M = e.getRenderTarget(), N = e.state.buffers.depth.getReversed(), ee = _.isInstancedMesh === !0, P = _.isBatchedMesh === !0, F = !!a.map, te = !!a.matcap, ne = !!S, I = !!a.aoMap, re = !!a.lightMap, ie = !!a.bumpMap, ae = !!a.normalMap, L = !!a.displacementMap, R = !!a.emissiveMap, oe = !!a.metalnessMap, se = !!a.roughnessMap, ce = a.anisotropy > 0, le = a.clearcoat > 0, ue = a.dispersion > 0, z = a.iridescence > 0, B = a.sheen > 0, de = a.transmission > 0, V = ce && !!a.anisotropyMap, H = le && !!a.clearcoatMap, U = le && !!a.clearcoatNormalMap, fe = le && !!a.clearcoatRoughnessMap, W = z && !!a.iridescenceMap, G = z && !!a.iridescenceThicknessMap, K = B && !!a.sheenColorMap, pe = B && !!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;
9247
9247
  a.toneMapped && (M === null || M.isXRRenderTarget === !0) && (Se = e.toneMapping);
9248
9248
  let Ce = {
9249
9249
  shaderID: w,
@@ -9257,37 +9257,37 @@ function Cc(e, t, n, r, i, a, o) {
9257
9257
  isRawShaderMaterial: a.isRawShaderMaterial === !0,
9258
9258
  glslVersion: a.glslVersion,
9259
9259
  precision: p,
9260
- batching: F,
9261
- batchingColor: F && _._colorsTexture !== null,
9262
- instancing: P,
9263
- instancingColor: P && _.instanceColor !== null,
9264
- instancingMorph: P && _.morphTexture !== null,
9260
+ batching: P,
9261
+ batchingColor: P && _._colorsTexture !== null,
9262
+ instancing: ee,
9263
+ instancingColor: ee && _.instanceColor !== null,
9264
+ instancingMorph: ee && _.morphTexture !== null,
9265
9265
  supportsVertexTextures: f,
9266
9266
  outputColorSpace: M === null ? e.outputColorSpace : M.isXRRenderTarget === !0 ? M.texture.colorSpace : b,
9267
9267
  alphaToCoverage: !!a.alphaToCoverage,
9268
- map: I,
9269
- matcap: ee,
9270
- envMap: te,
9271
- envMapMode: te && S.mapping,
9268
+ map: F,
9269
+ matcap: te,
9270
+ envMap: ne,
9271
+ envMapMode: ne && S.mapping,
9272
9272
  envMapCubeUVHeight: C,
9273
- aoMap: L,
9274
- lightMap: ne,
9275
- bumpMap: re,
9276
- normalMap: ie,
9277
- displacementMap: f && R,
9278
- emissiveMap: z,
9279
- normalMapObjectSpace: ie && a.normalMapType === 1,
9280
- normalMapTangentSpace: ie && a.normalMapType === 0,
9281
- metalnessMap: ae,
9282
- roughnessMap: oe,
9283
- anisotropy: se,
9273
+ aoMap: I,
9274
+ lightMap: re,
9275
+ bumpMap: ie,
9276
+ normalMap: ae,
9277
+ displacementMap: f && L,
9278
+ emissiveMap: R,
9279
+ normalMapObjectSpace: ae && a.normalMapType === 1,
9280
+ normalMapTangentSpace: ae && a.normalMapType === 0,
9281
+ metalnessMap: oe,
9282
+ roughnessMap: se,
9283
+ anisotropy: ce,
9284
9284
  anisotropyMap: V,
9285
- clearcoat: ce,
9285
+ clearcoat: le,
9286
9286
  clearcoatMap: H,
9287
9287
  clearcoatNormalMap: U,
9288
9288
  clearcoatRoughnessMap: fe,
9289
- dispersion: le,
9290
- iridescence: ue,
9289
+ dispersion: ue,
9290
+ iridescence: z,
9291
9291
  iridescenceMap: W,
9292
9292
  iridescenceThicknessMap: G,
9293
9293
  sheen: B,
@@ -9305,15 +9305,15 @@ function Cc(e, t, n, r, i, a, o) {
9305
9305
  alphaTest: ye,
9306
9306
  alphaHash: be,
9307
9307
  combine: a.combine,
9308
- mapUv: I && h(a.map.channel),
9309
- aoMapUv: L && h(a.aoMap.channel),
9310
- lightMapUv: ne && h(a.lightMap.channel),
9311
- bumpMapUv: re && h(a.bumpMap.channel),
9312
- normalMapUv: ie && h(a.normalMap.channel),
9313
- displacementMapUv: R && h(a.displacementMap.channel),
9314
- emissiveMapUv: z && h(a.emissiveMap.channel),
9315
- metalnessMapUv: ae && h(a.metalnessMap.channel),
9316
- roughnessMapUv: oe && h(a.roughnessMap.channel),
9308
+ mapUv: F && h(a.map.channel),
9309
+ aoMapUv: I && h(a.aoMap.channel),
9310
+ lightMapUv: re && h(a.lightMap.channel),
9311
+ bumpMapUv: ie && h(a.bumpMap.channel),
9312
+ normalMapUv: ae && h(a.normalMap.channel),
9313
+ displacementMapUv: L && h(a.displacementMap.channel),
9314
+ emissiveMapUv: R && h(a.emissiveMap.channel),
9315
+ metalnessMapUv: oe && h(a.metalnessMap.channel),
9316
+ roughnessMapUv: se && h(a.roughnessMap.channel),
9317
9317
  anisotropyMapUv: V && h(a.anisotropyMap.channel),
9318
9318
  clearcoatMapUv: H && h(a.clearcoatMap.channel),
9319
9319
  clearcoatNormalMapUv: U && h(a.clearcoatNormalMap.channel),
@@ -9328,10 +9328,10 @@ function Cc(e, t, n, r, i, a, o) {
9328
9328
  transmissionMapUv: he && h(a.transmissionMap.channel),
9329
9329
  thicknessMapUv: ge && h(a.thicknessMap.channel),
9330
9330
  alphaMapUv: ve && h(a.alphaMap.channel),
9331
- vertexTangents: !!y.attributes.tangent && (ie || se),
9331
+ vertexTangents: !!y.attributes.tangent && (ae || ce),
9332
9332
  vertexColors: a.vertexColors,
9333
9333
  vertexAlphas: a.vertexColors === !0 && !!y.attributes.color && y.attributes.color.itemSize === 4,
9334
- pointsUvs: _.isPoints === !0 && !!y.attributes.uv && (I || ve),
9334
+ pointsUvs: _.isPoints === !0 && !!y.attributes.uv && (F || ve),
9335
9335
  fog: !!v,
9336
9336
  useFog: a.fog === !0,
9337
9337
  fogExp2: !!v && v.isFogExp2,
@@ -9362,8 +9362,8 @@ function Cc(e, t, n, r, i, a, o) {
9362
9362
  shadowMapEnabled: e.shadowMap.enabled && u.length > 0,
9363
9363
  shadowMapType: e.shadowMap.type,
9364
9364
  toneMapping: Se,
9365
- decodeVideoTexture: I && a.map.isVideoTexture === !0 && Y.getTransfer(a.map.colorSpace) === "srgb",
9366
- decodeVideoTextureEmissive: z && a.emissiveMap.isVideoTexture === !0 && Y.getTransfer(a.emissiveMap.colorSpace) === "srgb",
9365
+ decodeVideoTexture: F && a.map.isVideoTexture === !0 && Y.getTransfer(a.map.colorSpace) === "srgb",
9366
+ decodeVideoTextureEmissive: R && a.emissiveMap.isVideoTexture === !0 && Y.getTransfer(a.emissiveMap.colorSpace) === "srgb",
9367
9367
  premultipliedAlpha: a.premultipliedAlpha,
9368
9368
  doubleSided: a.side === 2,
9369
9369
  flipSided: a.side === 1,
@@ -9371,7 +9371,7 @@ function Cc(e, t, n, r, i, a, o) {
9371
9371
  depthPacking: a.depthPacking || 0,
9372
9372
  index0AttributeName: a.index0AttributeName,
9373
9373
  extensionClipCullDistance: xe && a.extensions.clipCullDistance === !0 && r.has("WEBGL_clip_cull_distance"),
9374
- extensionMultiDraw: (xe && a.extensions.multiDraw === !0 || F) && r.has("WEBGL_multi_draw"),
9374
+ extensionMultiDraw: (xe && a.extensions.multiDraw === !0 || P) && r.has("WEBGL_multi_draw"),
9375
9375
  rendererExtensionParallelShaderCompile: r.has("KHR_parallel_shader_compile"),
9376
9376
  customProgramCacheKey: a.customProgramCacheKey()
9377
9377
  };
@@ -9931,7 +9931,7 @@ function Bc(e, t) {
9931
9931
  return r;
9932
9932
  },
9933
9933
  setTest: function(t) {
9934
- t ? R(e.DEPTH_TEST) : z(e.DEPTH_TEST);
9934
+ t ? L(e.DEPTH_TEST) : R(e.DEPTH_TEST);
9935
9935
  },
9936
9936
  setMask: function(t) {
9937
9937
  i !== t && !n && (e.depthMask(t), i = t);
@@ -9983,7 +9983,7 @@ function Bc(e, t) {
9983
9983
  let t = !1, n = null, r = null, i = null, a = null, o = null, s = null, c = null, l = null;
9984
9984
  return {
9985
9985
  setTest: function(n) {
9986
- t || (n ? R(e.STENCIL_TEST) : z(e.STENCIL_TEST));
9986
+ t || (n ? L(e.STENCIL_TEST) : R(e.STENCIL_TEST));
9987
9987
  },
9988
9988
  setMask: function(r) {
9989
9989
  n !== r && !t && (e.stencilMask(r), n = r);
@@ -10005,27 +10005,27 @@ function Bc(e, t) {
10005
10005
  }
10006
10006
  };
10007
10007
  }
10008
- 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);
10009
- 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);
10010
- 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);
10011
- function re(t, n, r, i) {
10008
+ 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, ee = e.getParameter(e.VERSION);
10009
+ ee.indexOf("WebGL") === -1 ? ee.indexOf("OpenGL ES") !== -1 && (N = parseFloat(/^OpenGL ES (\d)/.exec(ee)[1]), M = N >= 2) : (N = parseFloat(/^WebGL (\d)/.exec(ee)[1]), M = N >= 1);
10010
+ let P = null, F = {}, te = e.getParameter(e.SCISSOR_BOX), ne = e.getParameter(e.VIEWPORT), I = new Ae().fromArray(te), re = new Ae().fromArray(ne);
10011
+ function ie(t, n, r, i) {
10012
10012
  let a = /* @__PURE__ */ new Uint8Array(4), o = e.createTexture();
10013
10013
  e.bindTexture(t, o), e.texParameteri(t, e.TEXTURE_MIN_FILTER, e.NEAREST), e.texParameteri(t, e.TEXTURE_MAG_FILTER, e.NEAREST);
10014
10014
  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);
10015
10015
  return o;
10016
10016
  }
10017
- let ie = {};
10018
- ie[e.TEXTURE_2D] = re(e.TEXTURE_2D, e.TEXTURE_2D, 1), ie[e.TEXTURE_CUBE_MAP] = re(e.TEXTURE_CUBE_MAP, e.TEXTURE_CUBE_MAP_POSITIVE_X, 6), ie[e.TEXTURE_2D_ARRAY] = re(e.TEXTURE_2D_ARRAY, e.TEXTURE_2D_ARRAY, 1, 1), ie[e.TEXTURE_3D] = re(e.TEXTURE_3D, e.TEXTURE_3D, 1, 1), a.setClear(0, 0, 0, 1), o.setClear(1), s.setClear(0), R(e.DEPTH_TEST), o.setFunc(3), de(!1), V(1), R(e.CULL_FACE), ue(0);
10019
- function R(t) {
10017
+ let ae = {};
10018
+ ae[e.TEXTURE_2D] = ie(e.TEXTURE_2D, e.TEXTURE_2D, 1), ae[e.TEXTURE_CUBE_MAP] = ie(e.TEXTURE_CUBE_MAP, e.TEXTURE_CUBE_MAP_POSITIVE_X, 6), ae[e.TEXTURE_2D_ARRAY] = ie(e.TEXTURE_2D_ARRAY, e.TEXTURE_2D_ARRAY, 1, 1), ae[e.TEXTURE_3D] = ie(e.TEXTURE_3D, e.TEXTURE_3D, 1, 1), a.setClear(0, 0, 0, 1), o.setClear(1), s.setClear(0), L(e.DEPTH_TEST), o.setFunc(3), de(!1), V(1), L(e.CULL_FACE), z(0);
10019
+ function L(t) {
10020
10020
  u[t] !== !0 && (e.enable(t), u[t] = !0);
10021
10021
  }
10022
- function z(t) {
10022
+ function R(t) {
10023
10023
  u[t] !== !1 && (e.disable(t), u[t] = !1);
10024
10024
  }
10025
- function ae(t, n) {
10025
+ function oe(t, n) {
10026
10026
  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);
10027
10027
  }
10028
- function oe(t, n) {
10028
+ function se(t, n) {
10029
10029
  let r = p, i = !1;
10030
10030
  if (t) {
10031
10031
  r = f.get(n), r === void 0 && (r = [], f.set(n, r));
@@ -10037,16 +10037,16 @@ function Bc(e, t) {
10037
10037
  } else r[0] !== e.BACK && (r[0] = e.BACK, i = !0);
10038
10038
  i && e.drawBuffers(r);
10039
10039
  }
10040
- function se(t) {
10040
+ function ce(t) {
10041
10041
  return m !== t && (e.useProgram(t), m = t, !0);
10042
10042
  }
10043
- let ce = {
10043
+ let le = {
10044
10044
  100: e.FUNC_ADD,
10045
10045
  101: e.FUNC_SUBTRACT,
10046
10046
  102: e.FUNC_REVERSE_SUBTRACT
10047
10047
  };
10048
- ce[103] = e.MIN, ce[104] = e.MAX;
10049
- let le = {
10048
+ le[103] = e.MIN, le[104] = e.MAX;
10049
+ let ue = {
10050
10050
  200: e.ZERO,
10051
10051
  201: e.ONE,
10052
10052
  202: e.SRC_COLOR,
@@ -10063,12 +10063,12 @@ function Bc(e, t) {
10063
10063
  213: e.CONSTANT_ALPHA,
10064
10064
  214: e.ONE_MINUS_CONSTANT_ALPHA
10065
10065
  };
10066
- function ue(t, n, r, i, a, o, s, c, l, u) {
10066
+ function z(t, n, r, i, a, o, s, c, l, u) {
10067
10067
  if (t === 0) {
10068
- h === !0 && (z(e.BLEND), h = !1);
10068
+ h === !0 && (R(e.BLEND), h = !1);
10069
10069
  return;
10070
10070
  }
10071
- if (h === !1 && (R(e.BLEND), h = !0), t !== 5) {
10071
+ if (h === !1 && (L(e.BLEND), h = !0), t !== 5) {
10072
10072
  if (t !== g || u !== T) {
10073
10073
  if ((_ !== 100 || b !== 100) && (e.blendEquation(e.FUNC_ADD), _ = 100, b = 100), u) switch (t) {
10074
10074
  case 1:
@@ -10104,43 +10104,43 @@ function Bc(e, t) {
10104
10104
  }
10105
10105
  return;
10106
10106
  }
10107
- a ||= n, o ||= r, s ||= i, (n !== _ || a !== b) && (e.blendEquationSeparate(ce[n], ce[a]), _ = n, b = a), (r !== v || i !== y || o !== x || s !== S) && (e.blendFuncSeparate(le[r], le[i], le[o], le[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;
10107
+ a ||= n, o ||= r, s ||= i, (n !== _ || a !== b) && (e.blendEquationSeparate(le[n], le[a]), _ = n, b = a), (r !== v || i !== y || o !== x || s !== S) && (e.blendFuncSeparate(ue[r], ue[i], ue[o], ue[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;
10108
10108
  }
10109
10109
  function B(t, n) {
10110
- t.side === 2 ? z(e.CULL_FACE) : R(e.CULL_FACE);
10110
+ t.side === 2 ? R(e.CULL_FACE) : L(e.CULL_FACE);
10111
10111
  let r = t.side === 1;
10112
- n && (r = !r), de(r), t.blending === 1 && t.transparent === !1 ? ue(0) : ue(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);
10112
+ n && (r = !r), de(r), t.blending === 1 && t.transparent === !1 ? z(0) : z(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);
10113
10113
  let i = t.stencilWrite;
10114
- 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 ? R(e.SAMPLE_ALPHA_TO_COVERAGE) : z(e.SAMPLE_ALPHA_TO_COVERAGE);
10114
+ 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 ? L(e.SAMPLE_ALPHA_TO_COVERAGE) : R(e.SAMPLE_ALPHA_TO_COVERAGE);
10115
10115
  }
10116
10116
  function de(t) {
10117
10117
  E !== t && (t ? e.frontFace(e.CW) : e.frontFace(e.CCW), E = t);
10118
10118
  }
10119
10119
  function V(t) {
10120
- t === 0 ? z(e.CULL_FACE) : (R(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;
10120
+ t === 0 ? R(e.CULL_FACE) : (L(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;
10121
10121
  }
10122
10122
  function H(t) {
10123
10123
  t !== O && (M && e.lineWidth(t), O = t);
10124
10124
  }
10125
10125
  function U(t, n, r) {
10126
- t ? (R(e.POLYGON_OFFSET_FILL), (k !== n || A !== r) && (e.polygonOffset(n, r), k = n, A = r)) : z(e.POLYGON_OFFSET_FILL);
10126
+ t ? (L(e.POLYGON_OFFSET_FILL), (k !== n || A !== r) && (e.polygonOffset(n, r), k = n, A = r)) : R(e.POLYGON_OFFSET_FILL);
10127
10127
  }
10128
10128
  function fe(t) {
10129
- t ? R(e.SCISSOR_TEST) : z(e.SCISSOR_TEST);
10129
+ t ? L(e.SCISSOR_TEST) : R(e.SCISSOR_TEST);
10130
10130
  }
10131
10131
  function W(t) {
10132
- t === void 0 && (t = e.TEXTURE0 + j - 1), F !== t && (e.activeTexture(t), F = t);
10132
+ t === void 0 && (t = e.TEXTURE0 + j - 1), P !== t && (e.activeTexture(t), P = t);
10133
10133
  }
10134
10134
  function G(t, n, r) {
10135
- r === void 0 && (r = F === null ? e.TEXTURE0 + j - 1 : F);
10136
- let i = I[r];
10135
+ r === void 0 && (r = P === null ? e.TEXTURE0 + j - 1 : P);
10136
+ let i = F[r];
10137
10137
  i === void 0 && (i = {
10138
10138
  type: void 0,
10139
10139
  texture: void 0
10140
- }, I[r] = i), (i.type !== t || i.texture !== n) && (F !== r && (e.activeTexture(r), F = r), e.bindTexture(t, n || ie[t]), i.type = t, i.texture = n);
10140
+ }, F[r] = i), (i.type !== t || i.texture !== n) && (P !== r && (e.activeTexture(r), P = r), e.bindTexture(t, n || ae[t]), i.type = t, i.texture = n);
10141
10141
  }
10142
10142
  function K() {
10143
- let t = I[F];
10143
+ let t = F[P];
10144
10144
  t !== void 0 && t.type !== void 0 && (e.bindTexture(t.type, null), t.type = void 0, t.texture = void 0);
10145
10145
  }
10146
10146
  function pe() {
@@ -10214,10 +10214,10 @@ function Bc(e, t) {
10214
10214
  }
10215
10215
  }
10216
10216
  function be(t) {
10217
- L.equals(t) === !1 && (e.scissor(t.x, t.y, t.z, t.w), L.copy(t));
10217
+ I.equals(t) === !1 && (e.scissor(t.x, t.y, t.z, t.w), I.copy(t));
10218
10218
  }
10219
10219
  function xe(t) {
10220
- ne.equals(t) === !1 && (e.viewport(t.x, t.y, t.z, t.w), ne.copy(t));
10220
+ re.equals(t) === !1 && (e.viewport(t.x, t.y, t.z, t.w), re.copy(t));
10221
10221
  }
10222
10222
  function Se(t, n) {
10223
10223
  let r = l.get(n);
@@ -10230,7 +10230,7 @@ function Bc(e, t) {
10230
10230
  c.get(n) !== r && (e.uniformBlockBinding(n, r, t.__bindingPointIndex), c.set(n, r));
10231
10231
  }
10232
10232
  function we() {
10233
- 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();
10233
+ 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 = {}, P = null, F = {}, 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, I.set(0, 0, e.canvas.width, e.canvas.height), re.set(0, 0, e.canvas.width, e.canvas.height), a.reset(), o.reset(), s.reset();
10234
10234
  }
10235
10235
  return {
10236
10236
  buffers: {
@@ -10238,12 +10238,12 @@ function Bc(e, t) {
10238
10238
  depth: o,
10239
10239
  stencil: s
10240
10240
  },
10241
- enable: R,
10242
- disable: z,
10243
- bindFramebuffer: ae,
10244
- drawBuffers: oe,
10245
- useProgram: se,
10246
- setBlending: ue,
10241
+ enable: L,
10242
+ disable: R,
10243
+ bindFramebuffer: oe,
10244
+ drawBuffers: se,
10245
+ useProgram: ce,
10246
+ setBlending: z,
10247
10247
  setMaterial: B,
10248
10248
  setFlipSided: de,
10249
10249
  setCullFace: V,
@@ -10325,7 +10325,7 @@ function Vc(o, s, c, l, u, d, p) {
10325
10325
  }
10326
10326
  function j(e) {
10327
10327
  let t = e.target;
10328
- t.removeEventListener("dispose", j), P(t);
10328
+ t.removeEventListener("dispose", j), ee(t);
10329
10329
  }
10330
10330
  function M(e) {
10331
10331
  let t = l.get(e);
@@ -10343,7 +10343,7 @@ function Vc(o, s, c, l, u, d, p) {
10343
10343
  let n = e.source, r = y.get(n);
10344
10344
  delete r[t.__cacheKey], p.memory.textures--;
10345
10345
  }
10346
- function P(e) {
10346
+ function ee(e) {
10347
10347
  let t = l.get(e);
10348
10348
  if (e.depthTexture && (e.depthTexture.dispose(), l.remove(e.depthTexture)), e.isWebGLCubeRenderTarget) for (let e = 0; e < 6; e++) {
10349
10349
  if (Array.isArray(t.__webglFramebuffer[e])) for (let n = 0; n < t.__webglFramebuffer[e].length; n++) o.deleteFramebuffer(t.__webglFramebuffer[e][n]);
@@ -10363,48 +10363,48 @@ function Vc(o, s, c, l, u, d, p) {
10363
10363
  }
10364
10364
  l.remove(e);
10365
10365
  }
10366
- let F = 0;
10367
- function I() {
10368
- F = 0;
10366
+ let P = 0;
10367
+ function F() {
10368
+ P = 0;
10369
10369
  }
10370
- function ee() {
10371
- let e = F;
10372
- return e >= u.maxTextures && console.warn("THREE.WebGLTextures: Trying to use " + e + " texture units while this GPU supports only " + u.maxTextures), F += 1, e;
10370
+ function te() {
10371
+ let e = P;
10372
+ return e >= u.maxTextures && console.warn("THREE.WebGLTextures: Trying to use " + e + " texture units while this GPU supports only " + u.maxTextures), P += 1, e;
10373
10373
  }
10374
- function te(e) {
10374
+ function ne(e) {
10375
10375
  let t = [];
10376
10376
  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();
10377
10377
  }
10378
- function L(e, t) {
10378
+ function I(e, t) {
10379
10379
  let n = l.get(e);
10380
10380
  if (e.isVideoTexture && _e(e), e.isRenderTargetTexture === !1 && e.isExternalTexture !== !0 && e.version > 0 && n.__version !== e.version) {
10381
10381
  let r = e.image;
10382
10382
  if (r === null) console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");
10383
10383
  else if (r.complete === !1) console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");
10384
10384
  else {
10385
- ue(n, e, t);
10385
+ z(n, e, t);
10386
10386
  return;
10387
10387
  }
10388
10388
  } else e.isExternalTexture && (n.__webglTexture = e.sourceTexture ? e.sourceTexture : null);
10389
10389
  c.bindTexture(o.TEXTURE_2D, n.__webglTexture, o.TEXTURE0 + t);
10390
10390
  }
10391
- function ne(e, t) {
10391
+ function re(e, t) {
10392
10392
  let n = l.get(e);
10393
10393
  if (e.isRenderTargetTexture === !1 && e.version > 0 && n.__version !== e.version) {
10394
- ue(n, e, t);
10394
+ z(n, e, t);
10395
10395
  return;
10396
10396
  }
10397
10397
  c.bindTexture(o.TEXTURE_2D_ARRAY, n.__webglTexture, o.TEXTURE0 + t);
10398
10398
  }
10399
- function re(e, t) {
10399
+ function ie(e, t) {
10400
10400
  let n = l.get(e);
10401
10401
  if (e.isRenderTargetTexture === !1 && e.version > 0 && n.__version !== e.version) {
10402
- ue(n, e, t);
10402
+ z(n, e, t);
10403
10403
  return;
10404
10404
  }
10405
10405
  c.bindTexture(o.TEXTURE_3D, n.__webglTexture, o.TEXTURE0 + t);
10406
10406
  }
10407
- function ie(e, t) {
10407
+ function ae(e, t) {
10408
10408
  let n = l.get(e);
10409
10409
  if (e.version > 0 && n.__version !== e.version) {
10410
10410
  B(n, e, t);
@@ -10412,18 +10412,18 @@ function Vc(o, s, c, l, u, d, p) {
10412
10412
  }
10413
10413
  c.bindTexture(o.TEXTURE_CUBE_MAP, n.__webglTexture, o.TEXTURE0 + t);
10414
10414
  }
10415
- let R = {
10415
+ let L = {
10416
10416
  [e]: o.REPEAT,
10417
10417
  [t]: o.CLAMP_TO_EDGE,
10418
10418
  [n]: o.MIRRORED_REPEAT
10419
- }, z = {
10419
+ }, R = {
10420
10420
  [r]: o.NEAREST,
10421
10421
  1004: o.NEAREST_MIPMAP_NEAREST,
10422
10422
  1005: o.NEAREST_MIPMAP_LINEAR,
10423
10423
  [i]: o.LINEAR,
10424
10424
  1007: o.LINEAR_MIPMAP_NEAREST,
10425
10425
  [a]: o.LINEAR_MIPMAP_LINEAR
10426
- }, ae = {
10426
+ }, oe = {
10427
10427
  512: o.NEVER,
10428
10428
  519: o.ALWAYS,
10429
10429
  513: o.LESS,
@@ -10433,8 +10433,8 @@ function Vc(o, s, c, l, u, d, p) {
10433
10433
  516: o.GREATER,
10434
10434
  517: o.NOTEQUAL
10435
10435
  };
10436
- function oe(e, t) {
10437
- 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, R[t.wrapS]), o.texParameteri(e, o.TEXTURE_WRAP_T, R[t.wrapT]), (e === o.TEXTURE_3D || e === o.TEXTURE_2D_ARRAY) && o.texParameteri(e, o.TEXTURE_WRAP_R, R[t.wrapR]), o.texParameteri(e, o.TEXTURE_MAG_FILTER, z[t.magFilter]), o.texParameteri(e, o.TEXTURE_MIN_FILTER, z[t.minFilter]), t.compareFunction && (o.texParameteri(e, o.TEXTURE_COMPARE_MODE, o.COMPARE_REF_TO_TEXTURE), o.texParameteri(e, o.TEXTURE_COMPARE_FUNC, ae[t.compareFunction])), s.has("EXT_texture_filter_anisotropic") === !0) {
10436
+ function se(e, t) {
10437
+ 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, L[t.wrapS]), o.texParameteri(e, o.TEXTURE_WRAP_T, L[t.wrapT]), (e === o.TEXTURE_3D || e === o.TEXTURE_2D_ARRAY) && o.texParameteri(e, o.TEXTURE_WRAP_R, L[t.wrapR]), o.texParameteri(e, o.TEXTURE_MAG_FILTER, R[t.magFilter]), o.texParameteri(e, o.TEXTURE_MIN_FILTER, R[t.minFilter]), t.compareFunction && (o.texParameteri(e, o.TEXTURE_COMPARE_MODE, o.COMPARE_REF_TO_TEXTURE), o.texParameteri(e, o.TEXTURE_COMPARE_FUNC, oe[t.compareFunction])), s.has("EXT_texture_filter_anisotropic") === !0) {
10438
10438
  if (t.magFilter === 1003 || t.minFilter !== 1005 && t.minFilter !== 1008 || t.type === 1015 && s.has("OES_texture_float_linear") === !1) return;
10439
10439
  if (t.anisotropy > 1 || l.get(t).__currentAnisotropy) {
10440
10440
  let n = s.get("EXT_texture_filter_anisotropic");
@@ -10442,12 +10442,12 @@ function Vc(o, s, c, l, u, d, p) {
10442
10442
  }
10443
10443
  }
10444
10444
  }
10445
- function se(e, t) {
10445
+ function ce(e, t) {
10446
10446
  let n = !1;
10447
10447
  e.__webglInit === void 0 && (e.__webglInit = !0, t.addEventListener("dispose", A));
10448
10448
  let r = t.source, i = y.get(r);
10449
10449
  i === void 0 && (i = {}, y.set(r, i));
10450
- let a = te(t);
10450
+ let a = ne(t);
10451
10451
  if (a !== e.__cacheKey) {
10452
10452
  i[a] === void 0 && (i[a] = {
10453
10453
  texture: o.createTexture(),
@@ -10458,18 +10458,18 @@ function Vc(o, s, c, l, u, d, p) {
10458
10458
  }
10459
10459
  return n;
10460
10460
  }
10461
- function ce(e, t, n) {
10461
+ function le(e, t, n) {
10462
10462
  return Math.floor(Math.floor(e / n) / t);
10463
10463
  }
10464
- function le(e, t, n, r) {
10464
+ function ue(e, t, n, r) {
10465
10465
  let i = e.updateRanges;
10466
10466
  if (i.length === 0) c.texSubImage2D(o.TEXTURE_2D, 0, 0, 0, t.width, t.height, n, r, t.data);
10467
10467
  else {
10468
10468
  i.sort((e, t) => e.start - t.start);
10469
10469
  let a = 0;
10470
10470
  for (let e = 1; e < i.length; e++) {
10471
- let n = i[a], r = i[e], o = n.start + n.count, s = ce(r.start, t.width, 4), c = ce(n.start, t.width, 4);
10472
- r.start <= o + 1 && s === c && ce(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);
10471
+ let n = i[a], r = i[e], o = n.start + n.count, s = le(r.start, t.width, 4), c = le(n.start, t.width, 4);
10472
+ r.start <= o + 1 && s === c && le(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);
10473
10473
  }
10474
10474
  i.length = a + 1;
10475
10475
  let s = o.getParameter(o.UNPACK_ROW_LENGTH), l = o.getParameter(o.UNPACK_SKIP_PIXELS), u = o.getParameter(o.UNPACK_SKIP_ROWS);
@@ -10481,10 +10481,10 @@ function Vc(o, s, c, l, u, d, p) {
10481
10481
  e.clearUpdateRanges(), o.pixelStorei(o.UNPACK_ROW_LENGTH, s), o.pixelStorei(o.UNPACK_SKIP_PIXELS, l), o.pixelStorei(o.UNPACK_SKIP_ROWS, u);
10482
10482
  }
10483
10483
  }
10484
- function ue(e, t, n) {
10484
+ function z(e, t, n) {
10485
10485
  let r = o.TEXTURE_2D;
10486
10486
  (t.isDataArrayTexture || t.isCompressedArrayTexture) && (r = o.TEXTURE_2D_ARRAY), t.isData3DTexture && (r = o.TEXTURE_3D);
10487
- let i = se(e, t), a = t.source;
10487
+ let i = ce(e, t), a = t.source;
10488
10488
  c.bindTexture(r, e.__webglTexture, o.TEXTURE0 + n);
10489
10489
  let s = l.get(a);
10490
10490
  if (a.version !== s.__version || i === !0) {
@@ -10494,7 +10494,7 @@ function Vc(o, s, c, l, u, d, p) {
10494
10494
  let m = C(t.image, !1, u.maxTextureSize);
10495
10495
  m = ve(t, m);
10496
10496
  let h = d.convert(t.format, t.colorSpace), g = d.convert(t.type), _ = D(t.internalFormat, h, g, t.colorSpace, t.isVideoTexture);
10497
- oe(r, t);
10497
+ se(r, t);
10498
10498
  let v, y = t.mipmaps, b = t.isVideoTexture !== !0, x = s.__version === void 0 || i === !0, S = a.dataReady, E = k(t, m);
10499
10499
  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));
10500
10500
  else if (t.isDataTexture) {
@@ -10502,7 +10502,7 @@ function Vc(o, s, c, l, u, d, p) {
10502
10502
  b && x && c.texStorage2D(o.TEXTURE_2D, E, _, y[0].width, y[0].height);
10503
10503
  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);
10504
10504
  t.generateMipmaps = !1;
10505
- } else b ? (x && c.texStorage2D(o.TEXTURE_2D, E, _, m.width, m.height), S && le(t, m, h, g)) : c.texImage2D(o.TEXTURE_2D, 0, _, m.width, m.height, 0, h, g, m.data);
10505
+ } else b ? (x && c.texStorage2D(o.TEXTURE_2D, E, _, m.width, m.height), S && ue(t, m, h, g)) : c.texImage2D(o.TEXTURE_2D, 0, _, m.width, m.height, 0, h, g, m.data);
10506
10506
  } else if (t.isCompressedTexture) {
10507
10507
  if (t.isCompressedArrayTexture) {
10508
10508
  b && x && c.texStorage3D(o.TEXTURE_2D_ARRAY, E, _, y[0].width, y[0].height, m.depth);
@@ -10568,7 +10568,7 @@ function Vc(o, s, c, l, u, d, p) {
10568
10568
  }
10569
10569
  function B(e, t, n) {
10570
10570
  if (t.image.length !== 6) return;
10571
- let r = se(e, t), i = t.source;
10571
+ let r = ce(e, t), i = t.source;
10572
10572
  c.bindTexture(o.TEXTURE_CUBE_MAP, e.__webglTexture, o.TEXTURE0 + n);
10573
10573
  let a = l.get(i);
10574
10574
  if (i.version !== a.__version || r === !0) {
@@ -10578,7 +10578,7 @@ function Vc(o, s, c, l, u, d, p) {
10578
10578
  let f = t.isCompressedTexture || t.image[0].isCompressedTexture, p = t.image[0] && t.image[0].isDataTexture, m = [];
10579
10579
  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]);
10580
10580
  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);
10581
- oe(o.TEXTURE_CUBE_MAP, t);
10581
+ se(o.TEXTURE_CUBE_MAP, t);
10582
10582
  let E;
10583
10583
  if (f) {
10584
10584
  y && b && c.texStorage2D(o.TEXTURE_CUBE_MAP, S, v, h.width, h.height);
@@ -10638,7 +10638,7 @@ function Vc(o, s, c, l, u, d, p) {
10638
10638
  if (t && t.isWebGLCubeRenderTarget) throw Error("Depth Texture with cube render targets is not supported");
10639
10639
  if (c.bindFramebuffer(o.FRAMEBUFFER, e), !(t.depthTexture && t.depthTexture.isDepthTexture)) throw Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");
10640
10640
  let n = l.get(t.depthTexture);
10641
- 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);
10641
+ 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), I(t.depthTexture, 0);
10642
10642
  let r = n.__webglTexture, i = he(t);
10643
10643
  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);
10644
10644
  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);
@@ -10712,19 +10712,19 @@ function Vc(o, s, c, l, u, d, p) {
10712
10712
  }
10713
10713
  }
10714
10714
  if (a) {
10715
- c.bindTexture(o.TEXTURE_CUBE_MAP, r.__webglTexture), oe(o.TEXTURE_CUBE_MAP, t);
10715
+ c.bindTexture(o.TEXTURE_CUBE_MAP, r.__webglTexture), se(o.TEXTURE_CUBE_MAP, t);
10716
10716
  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);
10717
10717
  else de(n.__webglFramebuffer[r], e, t, o.COLOR_ATTACHMENT0, o.TEXTURE_CUBE_MAP_POSITIVE_X + r, 0);
10718
10718
  w(t) && T(o.TEXTURE_CUBE_MAP), c.unbindTexture();
10719
10719
  } else if (s) {
10720
10720
  for (let t = 0, r = i.length; t < r; t++) {
10721
10721
  let r = i[t], a = l.get(r), s = o.TEXTURE_2D;
10722
- (e.isWebGL3DRenderTarget || e.isWebGLArrayRenderTarget) && (s = e.isWebGL3DRenderTarget ? o.TEXTURE_3D : o.TEXTURE_2D_ARRAY), c.bindTexture(s, a.__webglTexture), oe(s, r), de(n.__webglFramebuffer, e, r, o.COLOR_ATTACHMENT0 + t, s, 0), w(r) && T(s);
10722
+ (e.isWebGL3DRenderTarget || e.isWebGLArrayRenderTarget) && (s = e.isWebGL3DRenderTarget ? o.TEXTURE_3D : o.TEXTURE_2D_ARRAY), c.bindTexture(s, a.__webglTexture), se(s, r), de(n.__webglFramebuffer, e, r, o.COLOR_ATTACHMENT0 + t, s, 0), w(r) && T(s);
10723
10723
  }
10724
10724
  c.unbindTexture();
10725
10725
  } else {
10726
10726
  let i = o.TEXTURE_2D;
10727
- if ((e.isWebGL3DRenderTarget || e.isWebGLArrayRenderTarget) && (i = e.isWebGL3DRenderTarget ? o.TEXTURE_3D : o.TEXTURE_2D_ARRAY), c.bindTexture(i, r.__webglTexture), oe(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);
10727
+ if ((e.isWebGL3DRenderTarget || e.isWebGLArrayRenderTarget) && (i = e.isWebGL3DRenderTarget ? o.TEXTURE_3D : o.TEXTURE_2D_ARRAY), c.bindTexture(i, r.__webglTexture), se(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);
10728
10728
  else de(n.__webglFramebuffer, e, t, o.COLOR_ATTACHMENT0, i, 0);
10729
10729
  w(t) && T(i), c.unbindTexture();
10730
10730
  }
@@ -10787,7 +10787,7 @@ function Vc(o, s, c, l, u, d, p) {
10787
10787
  function ye(e) {
10788
10788
  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;
10789
10789
  }
10790
- this.allocateTextureUnit = ee, this.resetTextureUnits = I, this.setTexture2D = L, this.setTexture2DArray = ne, this.setTexture3D = re, this.setTextureCube = ie, this.rebindTextures = W, this.setupRenderTarget = G, this.updateRenderTargetMipmap = K, this.updateMultisampleRenderTarget = J, this.setupDepthRenderbuffer = fe, this.setupFrameBufferTexture = de, this.useMultisampledRTT = ge;
10790
+ this.allocateTextureUnit = te, this.resetTextureUnits = F, this.setTexture2D = I, this.setTexture2DArray = re, this.setTexture3D = ie, this.setTextureCube = ae, this.rebindTextures = W, this.setupRenderTarget = G, this.updateRenderTargetMipmap = K, this.updateMultisampleRenderTarget = J, this.setupDepthRenderbuffer = fe, this.setupFrameBufferTexture = de, this.useMultisampledRTT = ge;
10791
10791
  }
10792
10792
  function Hc(e, t) {
10793
10793
  function n(n, r = "") {
@@ -10918,7 +10918,7 @@ var Uc = "\nvoid main() {\n\n gl_Position = vec4( position, 1.0 );\n\n}", Wc = "
10918
10918
  A.viewport = new Ae();
10919
10919
  let j = new Kn();
10920
10920
  j.viewport = new Ae();
10921
- let M = [A, j], N = new Aa(), P = null, F = null;
10921
+ let M = [A, j], N = new Aa(), ee = null, P = null;
10922
10922
  this.cameraAutoUpdate = !0, this.enabled = !1, this.isPresenting = !1, this.getController = function(e) {
10923
10923
  let t = T[e];
10924
10924
  return t === void 0 && (t = new er(), T[e] = t), t.getTargetRaySpace();
@@ -10929,7 +10929,7 @@ var Uc = "\nvoid main() {\n\n gl_Position = vec4( position, 1.0 );\n\n}", Wc = "
10929
10929
  let t = T[e];
10930
10930
  return t === void 0 && (t = new er(), T[e] = t), t.getHandSpace();
10931
10931
  };
10932
- function I(e) {
10932
+ function F(e) {
10933
10933
  let t = E.indexOf(e.inputSource);
10934
10934
  if (t === -1) return;
10935
10935
  let n = T[t];
@@ -10938,15 +10938,15 @@ var Uc = "\nvoid main() {\n\n gl_Position = vec4( position, 1.0 );\n\n}", Wc = "
10938
10938
  data: e.inputSource
10939
10939
  }));
10940
10940
  }
10941
- function ee() {
10942
- 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);
10941
+ function te() {
10942
+ r.removeEventListener("select", F), r.removeEventListener("selectstart", F), r.removeEventListener("selectend", F), r.removeEventListener("squeeze", F), r.removeEventListener("squeezestart", F), r.removeEventListener("squeezeend", F), r.removeEventListener("end", te), r.removeEventListener("inputsourceschange", ne);
10943
10943
  for (let e = 0; e < T.length; e++) {
10944
10944
  let t = E[e];
10945
10945
  t !== null && (E[e] = null, T[e].disconnect(t));
10946
10946
  }
10947
- P = null, F = null, b.reset();
10947
+ ee = null, P = null, b.reset();
10948
10948
  for (let e in x) delete x[e];
10949
- e.setRenderTarget(C), _ = null, g = null, h = null, r = null, w = null, oe.stop(), n.isPresenting = !1, e.setPixelRatio(O), e.setSize(D.width, D.height, !1), n.dispatchEvent({ type: "sessionend" });
10949
+ e.setRenderTarget(C), _ = null, g = null, h = null, r = null, w = null, se.stop(), n.isPresenting = !1, e.setPixelRatio(O), e.setSize(D.width, D.height, !1), n.dispatchEvent({ type: "sessionend" });
10950
10950
  }
10951
10951
  this.setFramebufferScaleFactor = function(e) {
10952
10952
  i = e, n.isPresenting === !0 && console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.");
@@ -10966,7 +10966,7 @@ var Uc = "\nvoid main() {\n\n gl_Position = vec4( position, 1.0 );\n\n}", Wc = "
10966
10966
  return r;
10967
10967
  }, this.setSession = async function(m) {
10968
10968
  if (r = m, r !== null) {
10969
- 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) {
10969
+ if (C = e.getRenderTarget(), r.addEventListener("select", F), r.addEventListener("selectstart", F), r.addEventListener("selectend", F), r.addEventListener("squeeze", F), r.addEventListener("squeezestart", F), r.addEventListener("squeezeend", F), r.addEventListener("end", te), r.addEventListener("inputsourceschange", ne), S.xrCompatible !== !0 && await t.makeXRCompatible(), O = e.getPixelRatio(), e.getSize(D), y && "createProjectionLayer" in XRWebGLBinding.prototype) {
10970
10970
  let n = null, a = null, c = null;
10971
10971
  S.depth && (c = S.stencil ? t.DEPTH24_STENCIL8 : t.DEPTH_COMPONENT24, n = S.stencil ? f : d, a = S.stencil ? 1020 : s);
10972
10972
  let l = {
@@ -11001,14 +11001,14 @@ var Uc = "\nvoid main() {\n\n gl_Position = vec4( position, 1.0 );\n\n}", Wc = "
11001
11001
  resolveStencilBuffer: _.ignoreDepthValues === !1
11002
11002
  });
11003
11003
  }
11004
- w.isXRRenderTarget = !0, this.setFoveation(l), p = null, a = await r.requestReferenceSpace(c), oe.setContext(r), oe.start(), n.isPresenting = !0, n.dispatchEvent({ type: "sessionstart" });
11004
+ w.isXRRenderTarget = !0, this.setFoveation(l), p = null, a = await r.requestReferenceSpace(c), se.setContext(r), se.start(), n.isPresenting = !0, n.dispatchEvent({ type: "sessionstart" });
11005
11005
  }
11006
11006
  }, this.getEnvironmentBlendMode = function() {
11007
11007
  if (r !== null) return r.environmentBlendMode;
11008
11008
  }, this.getDepthTexture = function() {
11009
11009
  return b.getDepthTexture();
11010
11010
  };
11011
- function te(e) {
11011
+ function ne(e) {
11012
11012
  for (let t = 0; t < e.removed.length; t++) {
11013
11013
  let n = e.removed[t], r = E.indexOf(n);
11014
11014
  r >= 0 && (E[r] = null, T[r].disconnect(n));
@@ -11029,32 +11029,32 @@ var Uc = "\nvoid main() {\n\n gl_Position = vec4( position, 1.0 );\n\n}", Wc = "
11029
11029
  i && i.connect(n);
11030
11030
  }
11031
11031
  }
11032
- let L = new U(), ne = new U();
11033
- function re(e, t, n) {
11034
- L.setFromMatrixPosition(t.matrixWorld), ne.setFromMatrixPosition(n.matrixWorld);
11035
- 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;
11032
+ let I = new U(), re = new U();
11033
+ function ie(e, t, n) {
11034
+ I.setFromMatrixPosition(t.matrixWorld), re.setFromMatrixPosition(n.matrixWorld);
11035
+ let r = I.distanceTo(re), 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;
11036
11036
  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);
11037
11037
  else {
11038
11038
  let t = o + m, n = s + m, i = f - h, a = p + (r - h), u = c * s / n * t, d = l * s / n * t;
11039
11039
  e.projectionMatrix.makePerspective(i, a, u, d, t, n), e.projectionMatrixInverse.copy(e.projectionMatrix).invert();
11040
11040
  }
11041
11041
  }
11042
- function ie(e, t) {
11042
+ function ae(e, t) {
11043
11043
  t === null ? e.matrixWorld.copy(e.matrix) : e.matrixWorld.multiplyMatrices(t.matrixWorld, e.matrix), e.matrixWorldInverse.copy(e.matrixWorld).invert();
11044
11044
  }
11045
11045
  this.updateCamera = function(e) {
11046
11046
  if (r === null) return;
11047
11047
  let t = e.near, n = e.far;
11048
- 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({
11048
+ 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, (ee !== N.near || P !== N.far) && (r.updateRenderState({
11049
11049
  depthNear: N.near,
11050
11050
  depthFar: N.far
11051
- }), 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;
11051
+ }), ee = N.near, P = N.far), N.layers.mask = e.layers.mask | 6, A.layers.mask = N.layers.mask & 3, j.layers.mask = N.layers.mask & 5;
11052
11052
  let i = e.parent, a = N.cameras;
11053
- ie(N, i);
11054
- for (let e = 0; e < a.length; e++) ie(a[e], i);
11055
- a.length === 2 ? re(N, A, j) : N.projectionMatrix.copy(A.projectionMatrix), R(e, N, i);
11053
+ ae(N, i);
11054
+ for (let e = 0; e < a.length; e++) ae(a[e], i);
11055
+ a.length === 2 ? ie(N, A, j) : N.projectionMatrix.copy(A.projectionMatrix), L(e, N, i);
11056
11056
  };
11057
- function R(e, t, n) {
11057
+ function L(e, t, n) {
11058
11058
  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);
11059
11059
  }
11060
11060
  this.getCamera = function() {
@@ -11070,8 +11070,8 @@ var Uc = "\nvoid main() {\n\n gl_Position = vec4( position, 1.0 );\n\n}", Wc = "
11070
11070
  }, this.getCameraTexture = function(e) {
11071
11071
  return x[e];
11072
11072
  };
11073
- let z = null;
11074
- function ae(t, i) {
11073
+ let R = null;
11074
+ function oe(t, i) {
11075
11075
  if (m = i.getViewerPose(p || a), v = i, m !== null) {
11076
11076
  let t = m.views;
11077
11077
  _ !== null && (e.setRenderTargetFramebuffer(w, _.framebuffer), e.setRenderTarget(w));
@@ -11110,14 +11110,14 @@ var Uc = "\nvoid main() {\n\n gl_Position = vec4( position, 1.0 );\n\n}", Wc = "
11110
11110
  let t = E[e], n = T[e];
11111
11111
  t !== null && n !== void 0 && n.update(t, i, p || a);
11112
11112
  }
11113
- z && z(t, i), i.detectedPlanes && n.dispatchEvent({
11113
+ R && R(t, i), i.detectedPlanes && n.dispatchEvent({
11114
11114
  type: "planesdetected",
11115
11115
  data: i
11116
11116
  }), v = null;
11117
11117
  }
11118
- let oe = new Ya();
11119
- oe.setAnimationLoop(ae), this.setAnimationLoop = function(e) {
11120
- z = e;
11118
+ let se = new Ya();
11119
+ se.setAnimationLoop(oe), this.setAnimationLoop = function(e) {
11120
+ R = e;
11121
11121
  }, this.dispose = function() {};
11122
11122
  }
11123
11123
  }, qc = /*@__PURE__*/ new vt(), Jc = /*@__PURE__*/ new ct();
@@ -11280,7 +11280,7 @@ var Zc = class {
11280
11280
  }, 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;
11281
11281
  let T = this, E = !1;
11282
11282
  this._outputColorSpace = y;
11283
- 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, ie = new Ae(0, 0, ee, te), R = new Ae(0, 0, ee, te), z = !1, ae = new lr(), oe = !1, se = !1, ce = new ct(), le = new U(), ue = new Ae(), B = {
11283
+ let D = 0, O = 0, k = null, A = -1, j = null, M = new Ae(), N = new Ae(), ee = null, P = new X(0), F = 0, te = t.width, ne = t.height, I = 1, re = null, ie = null, ae = new Ae(0, 0, te, ne), L = new Ae(0, 0, te, ne), R = !1, oe = new lr(), se = !1, ce = !1, le = new ct(), ue = new U(), z = new Ae(), B = {
11284
11284
  background: null,
11285
11285
  fog: null,
11286
11286
  environment: null,
@@ -11288,7 +11288,7 @@ var Zc = class {
11288
11288
  isScene: !0
11289
11289
  }, de = !1;
11290
11290
  function V() {
11291
- return k === null ? L : 1;
11291
+ return k === null ? I : 1;
11292
11292
  }
11293
11293
  let H = n;
11294
11294
  function fe(e, n) {
@@ -11329,39 +11329,39 @@ var Zc = class {
11329
11329
  let e = W.get("WEBGL_lose_context");
11330
11330
  e && e.restoreContext();
11331
11331
  }, this.getPixelRatio = function() {
11332
- return L;
11332
+ return I;
11333
11333
  }, this.setPixelRatio = function(e) {
11334
- e !== void 0 && (L = e, this.setSize(ee, te, !1));
11334
+ e !== void 0 && (I = e, this.setSize(te, ne, !1));
11335
11335
  }, this.getSize = function(e) {
11336
- return e.set(ee, te);
11336
+ return e.set(te, ne);
11337
11337
  }, this.setSize = function(e, n, r = !0) {
11338
11338
  if (Re.isPresenting) {
11339
11339
  console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");
11340
11340
  return;
11341
11341
  }
11342
- 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);
11342
+ te = e, ne = n, t.width = Math.floor(e * I), t.height = Math.floor(n * I), r === !0 && (t.style.width = e + "px", t.style.height = n + "px"), this.setViewport(0, 0, e, n);
11343
11343
  }, this.getDrawingBufferSize = function(e) {
11344
- return e.set(ee * L, te * L).floor();
11344
+ return e.set(te * I, ne * I).floor();
11345
11345
  }, this.setDrawingBufferSize = function(e, n, r) {
11346
- ee = e, te = n, L = r, t.width = Math.floor(e * r), t.height = Math.floor(n * r), this.setViewport(0, 0, e, n);
11346
+ te = e, ne = n, I = r, t.width = Math.floor(e * r), t.height = Math.floor(n * r), this.setViewport(0, 0, e, n);
11347
11347
  }, this.getCurrentViewport = function(e) {
11348
11348
  return e.copy(M);
11349
11349
  }, this.getViewport = function(e) {
11350
- return e.copy(ie);
11350
+ return e.copy(ae);
11351
11351
  }, this.setViewport = function(e, t, n, r) {
11352
- e.isVector4 ? ie.set(e.x, e.y, e.z, e.w) : ie.set(e, t, n, r), K.viewport(M.copy(ie).multiplyScalar(L).round());
11352
+ e.isVector4 ? ae.set(e.x, e.y, e.z, e.w) : ae.set(e, t, n, r), K.viewport(M.copy(ae).multiplyScalar(I).round());
11353
11353
  }, this.getScissor = function(e) {
11354
- return e.copy(R);
11354
+ return e.copy(L);
11355
11355
  }, this.setScissor = function(e, t, n, r) {
11356
- e.isVector4 ? R.set(e.x, e.y, e.z, e.w) : R.set(e, t, n, r), K.scissor(N.copy(R).multiplyScalar(L).round());
11356
+ e.isVector4 ? L.set(e.x, e.y, e.z, e.w) : L.set(e, t, n, r), K.scissor(N.copy(L).multiplyScalar(I).round());
11357
11357
  }, this.getScissorTest = function() {
11358
- return z;
11358
+ return R;
11359
11359
  }, this.setScissorTest = function(e) {
11360
- K.setScissorTest(z = e);
11360
+ K.setScissorTest(R = e);
11361
11361
  }, this.setOpaqueSort = function(e) {
11362
- ne = e;
11363
- }, this.setTransparentSort = function(e) {
11364
11362
  re = e;
11363
+ }, this.setTransparentSort = function(e) {
11364
+ ie = e;
11365
11365
  }, this.getClearColor = function(e) {
11366
11366
  return e.copy(Oe.getClearColor());
11367
11367
  }, this.setClearColor = function() {
@@ -11505,13 +11505,13 @@ var Zc = class {
11505
11505
  return;
11506
11506
  }
11507
11507
  if (E === !0) return;
11508
- 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), ce.multiplyMatrices(t.projectionMatrix, t.matrixWorldInverse), ae.setFromProjectionMatrix(ce, w, t.reversedDepth), se = this.localClippingEnabled, oe = Ee.init(this.clippingPlanes, se), v = we.get(e, S.length), v.init(), S.push(v), Re.enabled === !0 && Re.isPresenting === !0) {
11508
+ 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), le.multiplyMatrices(t.projectionMatrix, t.matrixWorldInverse), oe.setFromProjectionMatrix(le, w, t.reversedDepth), ce = this.localClippingEnabled, se = Ee.init(this.clippingPlanes, ce), v = we.get(e, S.length), v.init(), S.push(v), Re.enabled === !0 && Re.isPresenting === !0) {
11509
11509
  let e = T.xr.getDepthSensingMesh();
11510
11510
  e !== null && Ze(e, t, -Infinity, T.sortObjects);
11511
11511
  }
11512
- 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++, oe === !0 && Ee.beginShadows();
11512
+ Ze(e, t, 0, T.sortObjects), v.finish(), T.sortObjects === !0 && v.sort(re, ie), de = Re.enabled === !1 || Re.isPresenting === !1 || Re.hasDepthSensing() === !1, de && Oe.addToRenderList(v, e), this.info.render.frame++, se === !0 && Ee.beginShadows();
11513
11513
  let n = x.state.shadowsArray;
11514
- De.render(n, e, t), oe === !0 && Ee.endShadows(), this.info.autoReset === !0 && this.info.reset();
11514
+ De.render(n, e, t), se === !0 && Ee.endShadows(), this.info.autoReset === !0 && this.info.reset();
11515
11515
  let r = v.opaque, i = v.transmissive;
11516
11516
  if (x.setupLights(), t.isArrayCamera) {
11517
11517
  let n = t.cameras;
@@ -11525,7 +11525,7 @@ var Zc = class {
11525
11525
  Qe(v, e, r, r.viewport);
11526
11526
  }
11527
11527
  } else i.length > 0 && $e(r, i, e, t), de && Oe.render(e), Qe(v, e, t);
11528
- 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], oe === !0 && Ee.setGlobalState(T.clippingPlanes, x.state.camera)) : x = null, S.pop(), v = S.length > 0 ? S[S.length - 1] : null;
11528
+ 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], se === !0 && Ee.setGlobalState(T.clippingPlanes, x.state.camera)) : x = null, S.pop(), v = S.length > 0 ? S[S.length - 1] : null;
11529
11529
  };
11530
11530
  function Ze(e, t, n, r) {
11531
11531
  if (e.visible === !1) return;
@@ -11534,20 +11534,20 @@ var Zc = class {
11534
11534
  else if (e.isLOD) e.autoUpdate === !0 && e.update(t);
11535
11535
  else if (e.isLight) x.pushLight(e), e.castShadow && x.pushShadow(e);
11536
11536
  else if (e.isSprite) {
11537
- if (!e.frustumCulled || ae.intersectsSprite(e)) {
11538
- r && ue.setFromMatrixPosition(e.matrixWorld).applyMatrix4(ce);
11537
+ if (!e.frustumCulled || oe.intersectsSprite(e)) {
11538
+ r && z.setFromMatrixPosition(e.matrixWorld).applyMatrix4(le);
11539
11539
  let t = xe.update(e), i = e.material;
11540
- i.visible && v.push(e, t, i, n, ue.z, null);
11540
+ i.visible && v.push(e, t, i, n, z.z, null);
11541
11541
  }
11542
- } else if ((e.isMesh || e.isLine || e.isPoints) && (!e.frustumCulled || ae.intersectsObject(e))) {
11542
+ } else if ((e.isMesh || e.isLine || e.isPoints) && (!e.frustumCulled || oe.intersectsObject(e))) {
11543
11543
  let t = xe.update(e), i = e.material;
11544
- if (r && (e.boundingSphere === void 0 ? (t.boundingSphere === null && t.computeBoundingSphere(), ue.copy(t.boundingSphere.center)) : (e.boundingSphere === null && e.computeBoundingSphere(), ue.copy(e.boundingSphere.center)), ue.applyMatrix4(e.matrixWorld).applyMatrix4(ce)), Array.isArray(i)) {
11544
+ if (r && (e.boundingSphere === void 0 ? (t.boundingSphere === null && t.computeBoundingSphere(), z.copy(t.boundingSphere.center)) : (e.boundingSphere === null && e.computeBoundingSphere(), z.copy(e.boundingSphere.center)), z.applyMatrix4(e.matrixWorld).applyMatrix4(le)), Array.isArray(i)) {
11545
11545
  let r = t.groups;
11546
11546
  for (let a = 0, o = r.length; a < o; a++) {
11547
11547
  let o = r[a], s = i[o.materialIndex];
11548
- s && s.visible && v.push(e, t, s, n, ue.z, o);
11548
+ s && s.visible && v.push(e, t, s, n, z.z, o);
11549
11549
  }
11550
- } else i.visible && v.push(e, t, i, n, ue.z, null);
11550
+ } else i.visible && v.push(e, t, i, n, z.z, null);
11551
11551
  }
11552
11552
  }
11553
11553
  let i = e.children;
@@ -11555,7 +11555,7 @@ var Zc = class {
11555
11555
  }
11556
11556
  function Qe(e, t, n, r) {
11557
11557
  let i = e.opaque, a = e.transmissive, o = e.transparent;
11558
- x.setupLightsView(n), oe === !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);
11558
+ x.setupLightsView(n), se === !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);
11559
11559
  }
11560
11560
  function $e(e, t, n, r) {
11561
11561
  if ((n.isScene === !0 ? n.overrideMaterial : null) !== null) return;
@@ -11572,11 +11572,11 @@ var Zc = class {
11572
11572
  let s = x.state.transmissionRenderTarget[r.id], c = r.viewport || M;
11573
11573
  s.setSize(c.z * T.transmissionResolutionScale, c.w * T.transmissionResolutionScale);
11574
11574
  let u = T.getRenderTarget(), d = T.getActiveCubeFace(), f = T.getActiveMipmapLevel();
11575
- T.setRenderTarget(s), T.getClearColor(F), I = T.getClearAlpha(), I < 1 && T.setClearColor(16777215, .5), T.clear(), de && Oe.render(n);
11575
+ T.setRenderTarget(s), T.getClearColor(P), F = T.getClearAlpha(), F < 1 && T.setClearColor(16777215, .5), T.clear(), de && Oe.render(n);
11576
11576
  let p = T.toneMapping;
11577
11577
  T.toneMapping = 0;
11578
11578
  let m = r.viewport;
11579
- if (r.viewport !== void 0 && (r.viewport = void 0), x.setupLightsView(r), oe === !0 && Ee.setGlobalState(T.clippingPlanes, r), et(e, n, r), J.updateMultisampleRenderTarget(s), J.updateRenderTargetMipmap(s), W.has("WEBGL_multisampled_render_to_texture") === !1) {
11579
+ if (r.viewport !== void 0 && (r.viewport = void 0), x.setupLightsView(r), se === !0 && Ee.setGlobalState(T.clippingPlanes, r), et(e, n, r), J.updateMultisampleRenderTarget(s), J.updateRenderTargetMipmap(s), W.has("WEBGL_multisampled_render_to_texture") === !1) {
11580
11580
  let e = !1;
11581
11581
  for (let i = 0, a = t.length; i < a; i++) {
11582
11582
  let a = t[i], o = a.object, s = a.geometry, c = a.material, l = a.group;
@@ -11587,7 +11587,7 @@ var Zc = class {
11587
11587
  }
11588
11588
  e === !0 && (J.updateMultisampleRenderTarget(s), J.updateRenderTargetMipmap(s));
11589
11589
  }
11590
- T.setRenderTarget(u, d, f), T.setClearColor(F, I), m !== void 0 && (r.viewport = m), T.toneMapping = p;
11590
+ T.setRenderTarget(u, d, f), T.setClearColor(P, F), m !== void 0 && (r.viewport = m), T.toneMapping = p;
11591
11591
  }
11592
11592
  function et(e, t, n) {
11593
11593
  let r = t.isScene === !0 ? t.overrideMaterial : null;
@@ -11626,7 +11626,7 @@ var Zc = class {
11626
11626
  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;
11627
11627
  r.toneMapped && (k === null || k.isXRRenderTarget === !0) && (m = T.toneMapping);
11628
11628
  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;
11629
- if (oe === !0 && (se === !0 || e !== j)) {
11629
+ if (se === !0 && (ce === !0 || e !== j)) {
11630
11630
  let t = e === j && r.id === A;
11631
11631
  Ee.setState(r, e, t);
11632
11632
  }
@@ -11638,7 +11638,7 @@ var Zc = class {
11638
11638
  if (K.useProgram(S.program) && (C = !0, w = !0, E = !0), r.id !== A && (A = r.id, w = !0), C || j !== e) {
11639
11639
  K.buffers.depth.getReversed() && e.reversedDepth !== !0 && (e._reversedDepth = !0, e.updateProjectionMatrix()), D.setValue(H, "projectionMatrix", e.projectionMatrix), D.setValue(H, "viewMatrix", e.matrixWorldInverse);
11640
11640
  let t = D.map.cameraPosition;
11641
- t !== void 0 && t.setValue(H, le.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);
11641
+ t !== void 0 && t.setValue(H, ue.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);
11642
11642
  }
11643
11643
  if (i.isSkinnedMesh) {
11644
11644
  D.setOptional(H, i, "bindMatrix"), D.setOptional(H, i, "bindMatrixInverse");
@@ -11647,7 +11647,7 @@ var Zc = class {
11647
11647
  }
11648
11648
  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));
11649
11649
  let M = n.morphAttributes;
11650
- 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]), Hs.upload(H, rt(_), O, J)), r.isShaderMaterial && r.uniformsNeedUpdate === !0 && (Hs.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) {
11650
+ 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, I, ne, x.state.transmissionRenderTarget[e.id]), Hs.upload(H, rt(_), O, J)), r.isShaderMaterial && r.uniformsNeedUpdate === !0 && (Hs.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) {
11651
11651
  let e = r.uniformsGroups;
11652
11652
  for (let t = 0, n = e.length; t < n; t++) {
11653
11653
  let n = e[t];
@@ -11694,9 +11694,9 @@ var Zc = class {
11694
11694
  let c = e.texture;
11695
11695
  (c.isData3DTexture || c.isDataArrayTexture || c.isCompressedArrayTexture) && (o = !0);
11696
11696
  let l = q.get(e).__webglFramebuffer;
11697
- 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;
11698
- } else M.copy(ie).multiplyScalar(L).floor(), N.copy(R).multiplyScalar(L).floor(), P = z;
11699
- 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) {
11697
+ 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), ee = e.scissorTest;
11698
+ } else M.copy(ae).multiplyScalar(I).floor(), N.copy(L).multiplyScalar(I).floor(), ee = R;
11699
+ if (n !== 0 && (i = lt), K.bindFramebuffer(H.FRAMEBUFFER, i) && r && K.drawBuffers(e, i), K.viewport(M), K.scissor(N), K.setScissorTest(ee), a) {
11700
11700
  let r = q.get(e.texture);
11701
11701
  H.framebufferTexture2D(H.FRAMEBUFFER, H.COLOR_ATTACHMENT0, H.TEXTURE_CUBE_MAP_POSITIVE_X + t, r.__webglTexture, n);
11702
11702
  } else if (o) {
@@ -12004,17 +12004,26 @@ function ml(e) {
12004
12004
  "failed"
12005
12005
  ].includes(t) ? "broken" : "directed";
12006
12006
  }
12007
- var hl = [":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 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(""), gl = (e, t = "0 0 24 24") => `<svg viewBox="${t}" aria-hidden="true">${e}</svg>`, _l = {
12008
- minus: gl("<path d=\"M6 12h12\"/>"),
12009
- plus: gl("<path d=\"M12 6v12M6 12h12\"/>"),
12010
- fit: gl("<path d=\"M9 4H4v5M15 4h5v5M20 15v5h-5M4 15v5h5\"/><circle cx=\"12\" cy=\"12\" r=\"2.5\"/>"),
12011
- front: gl("<rect x=\"4\" y=\"5\" width=\"16\" height=\"14\" rx=\"1.5\"/><path d=\"M8 16h8\"/>"),
12012
- view: gl("<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\"/>"),
12013
- relations: gl("<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\"/>"),
12014
- focus: gl("<circle cx=\"12\" cy=\"12\" r=\"7\"/><circle cx=\"12\" cy=\"12\" r=\"2.5\"/><path d=\"M12 2v3M12 19v3M2 12h3M19 12h3\"/>"),
12015
- chevron: gl("<path d=\"m8 10 4 4 4-4\"/>")
12016
- }, vl = (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>`, yl = (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>${_l.chevron}</summary><div class="toolbar-popover" role="menu"><div class="toolbar-popover-title">${n}</div>${i}</div></details>`, bl = `<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">${_l.minus}</button><button class="toolbar-icon" data-action="plus" aria-label="Acercar" title="Acercar">${_l.plus}</button><button class="toolbar-icon" data-action="fit" aria-label="Encuadrar todo el modelo" title="Encuadrar todo el modelo">${_l.fit}</button><button class="toolbar-icon" data-action="front" aria-label="Vista frontal" title="Vista frontal">${_l.front}</button></div><div class="toolbar-group" data-toolbar-group="view">${yl("view", _l.view, "Vista", "Vista", vl("labels", "Etiquetas", !0) + vl("panel", "Información", !0) + "<div class=\"toolbar-option-separator\"></div>" + vl("open-all", "Abrir todos") + vl("close-all", "Cerrar todos"))}</div><div class="toolbar-group" data-toolbar-group="relations">${yl("relations", _l.relations, "Relaciones", "Selección", vl("relations-all", "Todas") + vl("relations-selected", "Selección", !0) + vl("relations-none", "Ocultar"))}</div><div class="toolbar-group" data-toolbar-group="focus">${yl("focus", _l.focus, "Foco", "Todo", vl("focus-all", "Todo", !0) + vl("focus-dim", "Conectados") + vl("focus-hide", "Aislar") + "<div class=\"toolbar-option-separator\"></div>" + vl("focus-layout", "Reorganizar visibles"))}</div></div><div class="hint">Gira: arrastra · Pan: ⇧+arrastra / 2 dedos · Zoom: rueda o pellizco · Selecciona: clic</div></section><aside class="panel" aria-live="polite"></aside></div>`;
12017
- function xl(e) {
12007
+ var hl = [":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 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(""), gl = ".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}}", _l = [
12008
+ ".viewport>.atlas-print-snapshot{display:none!important}",
12009
+ "@media print{",
12010
+ ":host{-webkit-print-color-adjust:exact;print-color-adjust:exact;break-inside:avoid;page-break-inside:avoid}",
12011
+ ".toolbar,.panel,.hint{display:none!important}",
12012
+ ".atlas{grid-template-columns:1fr!important}",
12013
+ ":host([data-lc-print-ready]) .viewport>canvas:not(.atlas-print-snapshot){display:none!important}",
12014
+ ":host([data-lc-print-ready]) .viewport>.atlas-print-snapshot{display:block!important;width:100%;height:100%}",
12015
+ "}"
12016
+ ].join(""), vl = (e, t = "0 0 24 24") => `<svg viewBox="${t}" aria-hidden="true">${e}</svg>`, yl = {
12017
+ minus: vl("<path d=\"M6 12h12\"/>"),
12018
+ plus: vl("<path d=\"M12 6v12M6 12h12\"/>"),
12019
+ fit: vl("<path d=\"M9 4H4v5M15 4h5v5M20 15v5h-5M4 15v5h5\"/><circle cx=\"12\" cy=\"12\" r=\"2.5\"/>"),
12020
+ front: vl("<rect x=\"4\" y=\"5\" width=\"16\" height=\"14\" rx=\"1.5\"/><path d=\"M8 16h8\"/>"),
12021
+ view: vl("<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\"/>"),
12022
+ relations: vl("<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\"/>"),
12023
+ focus: vl("<circle cx=\"12\" cy=\"12\" r=\"7\"/><circle cx=\"12\" cy=\"12\" r=\"2.5\"/><path d=\"M12 2v3M12 19v3M2 12h3M19 12h3\"/>"),
12024
+ chevron: vl("<path d=\"m8 10 4 4 4-4\"/>")
12025
+ }, 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>`, xl = (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>${yl.chevron}</summary><div class="toolbar-popover" role="menu"><div class="toolbar-popover-title">${n}</div>${i}</div></details>`, Sl = `<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">${yl.minus}</button><button class="toolbar-icon" data-action="plus" aria-label="Acercar" title="Acercar">${yl.plus}</button><button class="toolbar-icon" data-action="fit" aria-label="Encuadrar todo el modelo" title="Encuadrar todo el modelo">${yl.fit}</button><button class="toolbar-icon" data-action="front" aria-label="Vista frontal" title="Vista frontal">${yl.front}</button></div><div class="toolbar-group" data-toolbar-group="view">${xl("view", yl.view, "Vista", "Vista", bl("labels", "Etiquetas", !0) + bl("panel", "Información", !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">${xl("relations", yl.relations, "Relaciones", "Selección", bl("relations-all", "Todas") + bl("relations-selected", "Selección", !0) + bl("relations-none", "Ocultar"))}</div><div class="toolbar-group" data-toolbar-group="focus">${xl("focus", yl.focus, "Foco", "Todo", bl("focus-all", "Todo", !0) + bl("focus-dim", "Conectados") + bl("focus-hide", "Aislar") + "<div class=\"toolbar-option-separator\"></div>" + bl("focus-layout", "Reorganizar visibles"))}</div></div><div class="hint">Gira: arrastra · Pan: ⇧+arrastra / 2 dedos · Zoom: rueda o pellizco · Selecciona: clic</div></section><aside class="panel" aria-live="polite"></aside></div>`;
12026
+ function Cl(e) {
12018
12027
  return String(e ?? "").replace(/[&<>"']/g, (e) => ({
12019
12028
  "&": "&amp;",
12020
12029
  "<": "&lt;",
@@ -12023,17 +12032,17 @@ function xl(e) {
12023
12032
  "'": "&#39;"
12024
12033
  })[e]);
12025
12034
  }
12026
- function Sl(e) {
12035
+ function wl(e) {
12027
12036
  let t = String(e ?? "").trim();
12028
12037
  if (!t) return "";
12029
12038
  try {
12030
12039
  let e = new URL(t, globalThis.location?.href);
12031
- return ["http:", "https:"].includes(e.protocol) ? "<a class=\"external-link\" href=\"" + xl(e.href) + "\" target=\"_blank\" rel=\"noopener noreferrer\">Open documentation ↗</a>" : "";
12040
+ return ["http:", "https:"].includes(e.protocol) ? "<a class=\"external-link\" href=\"" + Cl(e.href) + "\" target=\"_blank\" rel=\"noopener noreferrer\">Open documentation ↗</a>" : "";
12032
12041
  } catch {
12033
12042
  return "";
12034
12043
  }
12035
12044
  }
12036
- function Cl(e) {
12045
+ function Tl(e) {
12037
12046
  let t = e && typeof e == "object" ? e : {}, n = Array.isArray(t.entities) ? t.entities.map((e) => ({
12038
12047
  ...e,
12039
12048
  p: Array.isArray(e.p) ? e.p : [
@@ -12071,7 +12080,7 @@ function Cl(e) {
12071
12080
  relations: r
12072
12081
  };
12073
12082
  }
12074
- function wl(e, t, n = [
12083
+ function El(e, t, n = [
12075
12084
  1,
12076
12085
  1,
12077
12086
  1
@@ -12090,7 +12099,7 @@ function wl(e, t, n = [
12090
12099
  });
12091
12100
  return s.center(), s;
12092
12101
  }
12093
- function Tl(e, t, n) {
12102
+ function Dl(e, t, n) {
12094
12103
  let r = new ui();
12095
12104
  for (let t = 0; t < e; t++) {
12096
12105
  let n = Math.PI / 2 + t * Math.PI * 2 / e, i = new V(Math.cos(n) * .5, Math.sin(n) * .5);
@@ -12107,7 +12116,7 @@ function Tl(e, t, n) {
12107
12116
  });
12108
12117
  return i.rotateX(Math.PI / 2), i.center(), i;
12109
12118
  }
12110
- function El(e, t, n, r) {
12119
+ function Ol(e, t, n, r) {
12111
12120
  let i = Math.min(.22, Math.max(0, Number(n) || 0));
12112
12121
  if (!i) return new Er(t, e, 1, 32);
12113
12122
  let a = [new V(0, -.5)];
@@ -12124,7 +12133,7 @@ function El(e, t, n, r) {
12124
12133
  }
12125
12134
  return a.push(new V(0, .5)), new Qi(a, 32);
12126
12135
  }
12127
- function Dl(e, t) {
12136
+ function kl(e, t) {
12128
12137
  if (!t) return e;
12129
12138
  let n = Math.min(.72, Math.max(0, Number(t) * 3)), r = e.attributes.position;
12130
12139
  for (let e = 0; e < r.count; e++) {
@@ -12133,36 +12142,36 @@ function Dl(e, t) {
12133
12142
  }
12134
12143
  return r.needsUpdate = !0, e.computeVertexNormals(), e;
12135
12144
  }
12136
- function Ol(e, t = 0, n = 4, r = [
12145
+ function Al(e, t = 0, n = 4, r = [
12137
12146
  1,
12138
12147
  1,
12139
12148
  1
12140
12149
  ]) {
12141
12150
  let i = Number(t) || 0, a = Math.max(2, Math.round(Number(n) || 4));
12142
12151
  switch (e) {
12143
- case "cylinder": return i ? El(.5, .5, i, a) : new Er(.5, .5, 1, 32);
12144
- case "cone": return i ? El(0, .5, i, a) : new Dr(.5, 1, 32);
12152
+ case "cylinder": return i ? Ol(.5, .5, i, a) : new Er(.5, .5, 1, 32);
12153
+ case "cone": return i ? Ol(0, .5, i, a) : new Dr(.5, 1, 32);
12145
12154
  case "frustum-cone":
12146
- case "truncated-cone": return i ? El(.28, .5, i, a) : new Er(.28, .5, 1, 32);
12155
+ case "truncated-cone": return i ? Ol(.28, .5, i, a) : new Er(.28, .5, 1, 32);
12147
12156
  case "frustum-pyramid":
12148
12157
  case "truncated-pyramid": return new Er(.28, .5, 1, 4);
12149
12158
  case "frustum-triangle": return new Er(.28, .5, 1, 3);
12150
- case "prism": return i ? Tl(6, i, a) : new Er(.5, .5, 1, 6);
12151
- case "pyramid-square": return i ? Dl(new Dr(.5, 1, 4), i) : new Dr(.5, 1, 4);
12152
- case "pyramid-triangle": return i ? Dl(new Dr(.5, 1, 3), i) : new Dr(.5, 1, 3);
12159
+ case "prism": return i ? Dl(6, i, a) : new Er(.5, .5, 1, 6);
12160
+ case "pyramid-square": return i ? kl(new Dr(.5, 1, 4), i) : new Dr(.5, 1, 4);
12161
+ case "pyramid-triangle": return i ? kl(new Dr(.5, 1, 3), i) : new Dr(.5, 1, 3);
12153
12162
  case "sphere": return new ta(.5, 24, 16);
12154
- case "octahedron": return Dl(new $i(.5), i);
12155
- case "dodecahedron": return Dl(new kr(.5), i);
12156
- case "icosahedron": return Dl(new Zi(.5), i);
12157
- default: return i ? wl(i, a, r) : new Nn(1, 1, 1);
12163
+ case "octahedron": return kl(new $i(.5), i);
12164
+ case "dodecahedron": return kl(new kr(.5), i);
12165
+ case "icosahedron": return kl(new Zi(.5), i);
12166
+ default: return i ? El(i, a, r) : new Nn(1, 1, 1);
12158
12167
  }
12159
12168
  }
12160
- function kl(e) {
12169
+ function jl(e) {
12161
12170
  e.computeBoundingBox();
12162
12171
  let t = e.boundingBox?.getSize(new U());
12163
12172
  return !t || !t.x || !t.y || !t.z ? e : (e.scale(1 / t.x, 1 / t.y, 1 / t.z), e.computeBoundingBox(), e);
12164
12173
  }
12165
- function Al(e, t) {
12174
+ function Ml(e, t) {
12166
12175
  let n = e.geometryOptions || e.geometry_options || e.parameters || {}, r = {};
12167
12176
  for (let [e, n] of Object.entries(t?.parameters || {})) n && Object.hasOwn(n, "default") && (r[e] = n.default);
12168
12177
  return {
@@ -12170,10 +12179,10 @@ function Al(e, t) {
12170
12179
  ...n && typeof n == "object" ? n : {}
12171
12180
  };
12172
12181
  }
12173
- function jl(e, t, n) {
12182
+ function Nl(e, t, n) {
12174
12183
  return typeof e != "string" || !e ? n : t[e] || e;
12175
12184
  }
12176
- function Ml(e, t = "#ffffff", n = "transparent") {
12185
+ function Pl(e, t = "#ffffff", n = "transparent") {
12177
12186
  let r = document.createElement("canvas");
12178
12187
  r.width = 256, r.height = 256;
12179
12188
  let i = r.getContext("2d");
@@ -12181,11 +12190,11 @@ function Ml(e, t = "#ffffff", n = "transparent") {
12181
12190
  let a = new Cr(r);
12182
12191
  return a.colorSpace = y, a;
12183
12192
  }
12184
- function Nl(e) {
12185
- return e.shape === "plane" ? new ea(1, 1) : Ol(e.shape || e.geometry || "box", e.radius, e.segments, e.size);
12193
+ function Fl(e) {
12194
+ return e.shape === "plane" ? new ea(1, 1) : Al(e.shape || e.geometry || "box", e.radius, e.segments, e.size);
12186
12195
  }
12187
- function Pl(e, t, n, r, i) {
12188
- let a = Al(t, e), o = {
12196
+ function Il(e, t, n, r, i) {
12197
+ let a = Ml(t, e), o = {
12189
12198
  ...n,
12190
12199
  ...e.palette || {},
12191
12200
  ...t.geometryPalette || t.geometry_palette || {}
@@ -12199,9 +12208,9 @@ function Pl(e, t, n, r, i) {
12199
12208
  if (!c.length) throw Error(`Geometry '${e.id}' did not produce any parts.`);
12200
12209
  let l = new Qn(), u = [], d = [];
12201
12210
  for (let a of c) {
12202
- let s = Nl(a);
12203
- kl(s);
12204
- let c = a.color || "component", f = jl(c, o, n.component || Qc.component), p = new ia({
12211
+ let s = Fl(a);
12212
+ jl(s);
12213
+ let c = a.color || "component", f = Nl(c, o, n.component || Qc.component), p = new ia({
12205
12214
  color: f,
12206
12215
  roughness: Number.isFinite(Number(a.roughness)) ? Number(a.roughness) : .72,
12207
12216
  metalness: Number.isFinite(Number(a.metalness)) ? Number(a.metalness) : .06,
@@ -12272,7 +12281,7 @@ function Pl(e, t, n, r, i) {
12272
12281
  n.src = g;
12273
12282
  }
12274
12283
  })(), p.map.colorSpace = y, p.needsUpdate = !0;
12275
- } else h != null && h !== "" && (p.map = Ml(h, jl(a.iconColor || "#ffffff", o, "#ffffff"), jl(a.iconBackground || "transparent", o, "transparent")), p.transparent = !0, p.needsUpdate = !0);
12284
+ } else h != null && h !== "" && (p.map = Pl(h, Nl(a.iconColor || "#ffffff", o, "#ffffff"), Nl(a.iconBackground || "transparent", o, "transparent")), p.transparent = !0, p.needsUpdate = !0);
12276
12285
  if (m = new An(s, p), m.position.fromArray(Array.isArray(a.position) ? a.position : [
12277
12286
  0,
12278
12287
  0,
@@ -12308,7 +12317,7 @@ function Pl(e, t, n, r, i) {
12308
12317
  descriptor: s
12309
12318
  };
12310
12319
  }
12311
- function Fl(e, t, n, r = "", i = !0) {
12320
+ function Ll(e, t, n, r = "", i = !0) {
12312
12321
  let a = document.createElement("canvas"), o = a.getContext("2d"), s = n.x * .88, c = Math.min(.82, n.y * .64);
12313
12322
  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);
12314
12323
  let l = a.height * .62;
@@ -12353,7 +12362,29 @@ function Fl(e, t, n, r = "", i = !0) {
12353
12362
  ]) e.renderOrder = 20, e.frustumCulled = !1, e.material.depthTest = !0, e.material.depthWrite = !1, e.material.transparent = !0;
12354
12363
  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;
12355
12364
  }
12356
- var Il = class extends HTMLElement {
12365
+ function Rl(e, t, n, r = globalThis.document) {
12366
+ if (!e || !t || !n || !r?.createElement) return null;
12367
+ try {
12368
+ e.render(t, n);
12369
+ let i = e.getContext?.(), a = i?.drawingBufferWidth || e.domElement?.width || 0, o = i?.drawingBufferHeight || e.domElement?.height || 0;
12370
+ if (!i?.readPixels || !a || !o) return null;
12371
+ let s = new Uint8Array(a * o * 4);
12372
+ i.readPixels(0, 0, a, o, i.RGBA, i.UNSIGNED_BYTE, s);
12373
+ let c = r.createElement("canvas");
12374
+ c.className = "atlas-print-snapshot", c.width = a, c.height = o, c.setAttribute("aria-hidden", "true");
12375
+ let l = c.getContext?.("2d");
12376
+ if (!l) return null;
12377
+ let u = l.createImageData(a, o), d = a * 4;
12378
+ for (let e = 0; e < o; e += 1) {
12379
+ let t = o - e - 1;
12380
+ u.data.set(s.subarray(t * d, (t + 1) * d), e * d);
12381
+ }
12382
+ return l.putImageData(u, 0, 0), c;
12383
+ } catch {
12384
+ return null;
12385
+ }
12386
+ }
12387
+ var zl = class extends HTMLElement {
12357
12388
  static get observedAttributes() {
12358
12389
  return [
12359
12390
  "height",
@@ -12377,19 +12408,19 @@ var Il = class extends HTMLElement {
12377
12408
  return ol();
12378
12409
  }
12379
12410
  constructor() {
12380
- super(), this.attachShadow({ mode: "open" }), this.shadowRoot.innerHTML = "<style>" + hl + ".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}}</style>" + bl, 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.selected = null, this.selectedRelationIndex = null, this.modelData = null, this._loading = !1, this._pendingSelection = null, this.theme = pl(), this.relationMode = this.getAttribute("relation-mode") || "selected", this.focusFilter = ll({
12411
+ super(), this.attachShadow({ mode: "open" }), this.shadowRoot.innerHTML = "<style>" + hl + gl + _l + "</style>" + Sl, 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 = pl(), this.relationMode = this.getAttribute("relation-mode") || "selected", this.focusFilter = ll({
12381
12412
  mode: this.getAttribute("focus-mode"),
12382
12413
  effect: this.getAttribute("focus-effect"),
12383
12414
  layout: this.getAttribute("focus-layout")
12384
- }), this.selectionMode = ["internal", "event"].includes(this.getAttribute("selection-mode")) ? this.getAttribute("selection-mode") : "internal", 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._geometryRegistryListener = () => {
12415
+ }), this.selectionMode = ["internal", "event"].includes(this.getAttribute("selection-mode")) ? this.getAttribute("selection-mode") : "internal", 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 = () => {
12385
12416
  this.ready && this.modelData && this._build();
12386
12417
  }, this._bindControls(), this._syncFocusToolbar(), this._syncRelationToolbar(), this._syncLabelsToolbar(), this._syncPanelToolbar(), this.resizeObserver = new ResizeObserver(() => this.resize()), this.resizeObserver.observe(this.canvas);
12387
12418
  }
12388
12419
  connectedCallback() {
12389
- globalThis.addEventListener?.("lc-geometry-registry-change", this._geometryRegistryListener), this.resizeObserver.observe(this.canvas), this.hasAttribute("height") && this.style.setProperty("--lc-height", this.getAttribute("height")), this._loadInitial();
12420
+ globalThis.addEventListener?.("lc-geometry-registry-change", this._geometryRegistryListener), globalThis.addEventListener?.("beforeprint", this._beforePrintListener), globalThis.addEventListener?.("afterprint", this._afterPrintListener), typeof this._printMedia?.addEventListener == "function" ? this._printMedia.addEventListener("change", this._printMediaListener) : this._printMedia?.addListener?.(this._printMediaListener), this.resizeObserver.observe(this.canvas), this.hasAttribute("height") && this.style.setProperty("--lc-height", this.getAttribute("height")), this._loadInitial();
12390
12421
  }
12391
12422
  disconnectedCallback() {
12392
- globalThis.removeEventListener?.("lc-geometry-registry-change", this._geometryRegistryListener), this.resizeObserver.disconnect(), this.animationFrame && cancelAnimationFrame(this.animationFrame), this._clearObjects(), this.renderer &&= (this.renderer.dispose(), this.renderer.forceContextLoss?.(), null), this.ready = !1, this.dispatchEvent(new CustomEvent("lc-disconnect"));
12423
+ globalThis.removeEventListener?.("lc-geometry-registry-change", this._geometryRegistryListener), globalThis.removeEventListener?.("beforeprint", this._beforePrintListener), globalThis.removeEventListener?.("afterprint", this._afterPrintListener), typeof this._printMedia?.removeEventListener == "function" ? this._printMedia.removeEventListener("change", this._printMediaListener) : this._printMedia?.removeListener?.(this._printMediaListener), this.restoreAfterPrint(), this.resizeObserver.disconnect(), this.animationFrame && cancelAnimationFrame(this.animationFrame), this._clearObjects(), this.renderer &&= (this.renderer.dispose(), this.renderer.forceContextLoss?.(), null), this.ready = !1, this.dispatchEvent(new CustomEvent("lc-disconnect"));
12393
12424
  }
12394
12425
  attributeChangedCallback(e, t, n) {
12395
12426
  if (t !== n) {
@@ -12435,6 +12466,41 @@ var Il = class extends HTMLElement {
12435
12466
  set palette(e) {
12436
12467
  this.setPalette(e);
12437
12468
  }
12469
+ captureFrame() {
12470
+ return Rl(this.renderer, this.scene, this.camera, this.ownerDocument);
12471
+ }
12472
+ prepareForPrint() {
12473
+ if (this._printState) return this;
12474
+ let e = this.captureFrame(), t = Object.fromEntries([
12475
+ "height",
12476
+ "min-height",
12477
+ "aspect-ratio",
12478
+ "--lc-height",
12479
+ "--lc-print-aspect"
12480
+ ].map((e) => [e, {
12481
+ value: this.style.getPropertyValue(e),
12482
+ priority: this.style.getPropertyPriority(e)
12483
+ }])), n = this.toolbar ? {
12484
+ value: this.toolbar.style.getPropertyValue("display"),
12485
+ priority: this.toolbar.style.getPropertyPriority("display")
12486
+ } : null, r = e ? e.width + " / " + e.height : null;
12487
+ return this._printState = {
12488
+ snapshot: e,
12489
+ styles: t,
12490
+ toolbarDisplay: n
12491
+ }, this.toolbar?.style.setProperty("display", "none", "important"), e ? (this.shadowRoot.querySelector(".viewport")?.appendChild(e), this.style.setProperty("height", "auto", "important"), this.style.setProperty("min-height", "0", "important"), this.style.setProperty("aspect-ratio", r, "important"), this.style.setProperty("--lc-height", "auto"), this.style.setProperty("--lc-print-aspect", r), this.setAttribute("data-lc-print-ready", "true"), this._emit("lc-print-ready", {
12492
+ width: e.width,
12493
+ height: e.height,
12494
+ aspect: r
12495
+ })) : this._emit("lc-print-error", { message: "No se pudo capturar el framebuffer WebGL." }), this;
12496
+ }
12497
+ restoreAfterPrint() {
12498
+ let e = this._printState;
12499
+ if (!e) return this;
12500
+ e.snapshot?.remove();
12501
+ for (let [t, n] of Object.entries(e.styles)) n.value ? this.style.setProperty(t, n.value, n.priority) : this.style.removeProperty(t);
12502
+ return this.toolbar && e.toolbarDisplay && (e.toolbarDisplay.value ? this.toolbar.style.setProperty("display", e.toolbarDisplay.value, e.toolbarDisplay.priority) : this.toolbar.style.removeProperty("display")), this.removeAttribute("data-lc-print-ready"), this._printState = null, this.resize(), this._emit("lc-print-restored"), this;
12503
+ }
12438
12504
  getRenderStats() {
12439
12505
  let e = this.renderer?.info, t = this._focusedEntityIds();
12440
12506
  return {
@@ -12605,6 +12671,40 @@ var Il = class extends HTMLElement {
12605
12671
  composed: !0
12606
12672
  }));
12607
12673
  }
12674
+ _containerEntityIds() {
12675
+ return (this.modelData?.entities || []).filter((e) => cl(e.type)).map((e) => e.id);
12676
+ }
12677
+ _declaredOpenContainerIds() {
12678
+ return (this.modelData?.entities || []).filter((e) => cl(e.type) && e.open === !0).map((e) => e.id);
12679
+ }
12680
+ _emitContainerStateChange(e, t = {}) {
12681
+ if (!e?.changed || t.emit === !1) return;
12682
+ let n = t.changedContainer || (e.changedContainers.length === 1 ? e.changedContainers[0] : null);
12683
+ this._emit("lc-container-state-change", {
12684
+ openContainers: [...e.current],
12685
+ changedContainers: [...e.changedContainers],
12686
+ changedContainer: n,
12687
+ open: typeof t.open == "boolean" ? t.open : n ? e.current.includes(n) : null,
12688
+ source: t.source || "api"
12689
+ });
12690
+ }
12691
+ _replaceOpenContainers(e, t = {}) {
12692
+ let n = new Set(e || []), r = this._containerEntityIds(), i = [...this.open], a = r.filter((e) => n.has(e)), o = new Set(i), s = new Set(a), c = [...i.filter((e) => !s.has(e)), ...a.filter((e) => !o.has(e))], l = {
12693
+ changed: c.length > 0,
12694
+ previous: i,
12695
+ current: a,
12696
+ changedContainers: c
12697
+ };
12698
+ return l.changed && (this.open = s), (l.changed || t.forceRefresh) && t.refresh !== !1 && (this._renderPanel?.(), this._rebuildRelations?.(), this.invalidate?.()), this._emitContainerStateChange(l, t), l;
12699
+ }
12700
+ _syncInitialContainerState(e = {}) {
12701
+ let t = this._initialOpenContainers || /* @__PURE__ */ new Set(), n = new Set(this._declaredOpenContainerIds()), r = e.force ? new Set(n) : new Set(this.open);
12702
+ if (!e.force) {
12703
+ for (let e of t) n.has(e) || r.delete(e);
12704
+ for (let e of n) t.has(e) || r.add(e);
12705
+ }
12706
+ return this._initialOpenContainers = n, this._replaceOpenContainers(r, e);
12707
+ }
12608
12708
  _publicEntity(e) {
12609
12709
  let t = this.modelData?.entities?.find((t) => t.id === e);
12610
12710
  return t ? {
@@ -12633,10 +12733,16 @@ var Il = class extends HTMLElement {
12633
12733
  }
12634
12734
  _commitModelChange(e, t = {}, n = {}) {
12635
12735
  let r = n.preserveSelection === !1 ? null : this.selected?.id, i = n.preserveSelection === !1 ? null : this._publicRelation(this.selectedRelationIndex), a = i?.id ?? i?.index ?? null;
12636
- return this.modelData = Cl(this.modelData), this._build({
12736
+ this.modelData = Tl(this.modelData);
12737
+ let o = this._syncInitialContainerState({
12738
+ refresh: !1,
12739
+ emit: !1,
12740
+ source: "model"
12741
+ });
12742
+ return this._build({
12637
12743
  preserveSelection: r,
12638
12744
  preserveRelation: a
12639
- }), this._emit("lc-model-change", {
12745
+ }), this._emitContainerStateChange(o, { source: "model" }), this._emit("lc-model-change", {
12640
12746
  kind: e,
12641
12747
  model: this.modelData,
12642
12748
  ...t
@@ -12644,7 +12750,7 @@ var Il = class extends HTMLElement {
12644
12750
  }
12645
12751
  updateModel(e = {}, t = {}) {
12646
12752
  if (!e || typeof e != "object" || Array.isArray(e)) throw TypeError("El parche del modelo debe ser un objeto.");
12647
- let n = this.modelData || Cl({}), r = JSON.stringify(n.render?.camera || null), i = {
12753
+ let n = this.modelData || Tl({}), r = JSON.stringify(n.render?.camera || null), i = {
12648
12754
  ...n,
12649
12755
  ...e,
12650
12756
  palette: e.palette ? {
@@ -12655,11 +12761,11 @@ var Il = class extends HTMLElement {
12655
12761
  entities: Array.isArray(e.entities) ? e.entities : n.entities,
12656
12762
  relations: Array.isArray(e.relations) ? e.relations : n.relations
12657
12763
  };
12658
- return this.modelData = Cl(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;
12764
+ return this.modelData = Tl(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;
12659
12765
  }
12660
12766
  addEntity(e, t = {}) {
12661
12767
  if (!e || typeof e != "object" || !e.id) throw TypeError("La entidad debe incluir un id.");
12662
- if (this.modelData ||= Cl({}), this.modelData.entities.some((t) => t.id === e.id)) throw Error(`Ya existe una entidad con id "${e.id}".`);
12768
+ if (this.modelData ||= Tl({}), this.modelData.entities.some((t) => t.id === e.id)) throw Error(`Ya existe una entidad con id "${e.id}".`);
12663
12769
  if (e.parent && !this.modelData.entities.some((t) => t.id === e.parent)) throw Error(`No existe el contenedor padre "${e.parent}".`);
12664
12770
  return this.modelData.entities = [...this.modelData.entities, { ...e }], this._commitModelChange("entity-add", { entity: this._publicEntity(e.id) }, t);
12665
12771
  }
@@ -12694,9 +12800,7 @@ var Il = class extends HTMLElement {
12694
12800
  let i = this.modelData.relations[this.selectedRelationIndex];
12695
12801
  this.modelData.entities = this.modelData.entities.filter((e) => !r.has(e.id)), this.modelData.relations = this.modelData.relations.filter((e) => !r.has(e.from) && !r.has(e.to));
12696
12802
  let a = i ? this.modelData.relations.indexOf(i) : -1;
12697
- this.selectedRelationIndex = a >= 0 ? a : null;
12698
- for (let e of r) this.open.delete(e);
12699
- return this.selected && r.has(this.selected.id) && (this.selected = null), this._commitModelChange("entity-remove", {
12803
+ return this.selectedRelationIndex = a >= 0 ? a : null, this.selected && r.has(this.selected.id) && (this.selected = null), this._commitModelChange("entity-remove", {
12700
12804
  id: e,
12701
12805
  removed: [...r]
12702
12806
  });
@@ -12806,12 +12910,55 @@ var Il = class extends HTMLElement {
12806
12910
  toggleShellLabels() {
12807
12911
  return this.setShellLabels(!this.showShellLabels);
12808
12912
  }
12809
- openAllContainers() {
12810
- for (let e of this.nodes.values()) cl(e.type) && this.open.add(e.id);
12811
- return this._renderPanel(), this._rebuildRelations(), this.invalidate(), this;
12913
+ isContainerOpen(e) {
12914
+ return this._containerEntityIds().includes(e) && this.open.has(e);
12915
+ }
12916
+ getOpenContainerIds() {
12917
+ return this._containerEntityIds().filter((e) => this.open.has(e));
12918
+ }
12919
+ setOpenContainers(e, t = {}) {
12920
+ if (e == null || typeof e == "string" || typeof e[Symbol.iterator] != "function") throw TypeError("Los contenedores abiertos deben indicarse mediante un iterable de ids.");
12921
+ return this._replaceOpenContainers(e, t), this;
12922
+ }
12923
+ setContainerOpen(e, t = !0, n = {}) {
12924
+ let r = this.modelData?.entities?.find((t) => t.id === e);
12925
+ if (!r) throw Error(`No existe una entidad con id "${e}".`);
12926
+ if (!cl(r.type)) throw TypeError(`La entidad "${e}" no es un contenedor.`);
12927
+ let i = new Set(this.open);
12928
+ if (t) i.add(e);
12929
+ else if (i.delete(e), n.closeDescendants !== !1) for (let t of this.modelData.entities) {
12930
+ let n = t.parent, r = /* @__PURE__ */ new Set();
12931
+ for (; n && !r.has(n);) {
12932
+ if (r.add(n), n === e) {
12933
+ cl(t.type) && i.delete(t.id);
12934
+ break;
12935
+ }
12936
+ n = this.modelData.entities.find((e) => e.id === n)?.parent || null;
12937
+ }
12938
+ }
12939
+ return this._replaceOpenContainers(i, {
12940
+ ...n,
12941
+ changedContainer: e,
12942
+ open: !!t
12943
+ }), this;
12944
+ }
12945
+ toggleContainer(e, t = {}) {
12946
+ return this.setContainerOpen(e, !this.isContainerOpen(e), t);
12812
12947
  }
12813
- closeAllContainers() {
12814
- return this.open.clear(), this.selected = null, this._renderPanel(), this._rebuildRelations(), this.invalidate(), this;
12948
+ restoreInitialContainerState(e = {}) {
12949
+ return this._replaceOpenContainers(this._initialOpenContainers, {
12950
+ ...e,
12951
+ source: e.source || "restore"
12952
+ }), this;
12953
+ }
12954
+ openAllContainers(e = {}) {
12955
+ return this.setOpenContainers(this._containerEntityIds(), e);
12956
+ }
12957
+ closeAllContainers(e = {}) {
12958
+ return this.selected = null, this.setOpenContainers([], {
12959
+ ...e,
12960
+ forceRefresh: !0
12961
+ });
12815
12962
  }
12816
12963
  get styles() {
12817
12964
  return this.theme;
@@ -12857,10 +13004,14 @@ var Il = class extends HTMLElement {
12857
13004
  this._loading = !0, this._pendingSelection = null;
12858
13005
  try {
12859
13006
  let t = typeof e == "string" ? await fetch(e).then((e) => e.json()) : e;
12860
- this.modelData = Cl(t), this.selected = null, this.selectedRelationIndex = null, this.open.clear(), this._pendingPalette &&= (this.modelData.palette = {
13007
+ this.modelData = Tl(t), this.selected = null, this.selectedRelationIndex = null, this.open.clear(), this._initialOpenContainers.clear(), this._pendingPalette &&= (this.modelData.palette = {
12861
13008
  ...this.modelData.palette,
12862
13009
  ...this._pendingPalette
12863
- }, null), this.theme = this.modelData.theme, this._applyTheme(), this._build(), this._applyModelRenderOptions(), this.modelData.render?.camera && this.setCameraView(this.modelData.render.camera, { animate: !1 }), this.dispatchEvent(new CustomEvent("lc-ready", { detail: { model: this.modelData } })), this.dispatchEvent(new CustomEvent("lc-model-change", { detail: { model: this.modelData } }));
13010
+ }, null), this.theme = this.modelData.theme, this._applyTheme(), this._syncInitialContainerState({
13011
+ force: !0,
13012
+ refresh: !1,
13013
+ emit: !1
13014
+ }), this._build(), this._applyModelRenderOptions(), this.modelData.render?.camera && this.setCameraView(this.modelData.render.camera, { animate: !1 }), this.dispatchEvent(new CustomEvent("lc-ready", { detail: { model: this.modelData } })), this.dispatchEvent(new CustomEvent("lc-model-change", { detail: { model: this.modelData } }));
12864
13015
  let n = this._pendingSelection;
12865
13016
  return this._pendingSelection = null, this._loading = !1, n?.kind === "relation" ? this.selectRelation(n.index, n.options) : n?.kind === "entity" && this.select(n.id, n.options), this;
12866
13017
  } catch (e) {
@@ -12923,7 +13074,7 @@ var Il = class extends HTMLElement {
12923
13074
  ...e.geometryPalette || {},
12924
13075
  ...e.geometryPaletteOverrides || {}
12925
13076
  };
12926
- n.material.color.set(jl(n.value, r, t));
13077
+ n.material.color.set(Nl(n.value, r, t));
12927
13078
  }
12928
13079
  }
12929
13080
  }
@@ -12948,7 +13099,7 @@ var Il = class extends HTMLElement {
12948
13099
  ...e.ports || {}
12949
13100
  }, s) {
12950
13101
  try {
12951
- let n = Pl(r, e, this.modelData.palette, () => this.invalidate(), (e) => this.dispatchEvent(new CustomEvent("lc-warning", { detail: e })));
13102
+ let n = Il(r, e, this.modelData.palette, () => this.invalidate(), (e) => this.dispatchEvent(new CustomEvent("lc-warning", { detail: e })));
12952
13103
  n.root.scale.multiply(new U().fromArray(e.s)), t.appearanceMaterials = [], n.root.traverse((e) => {
12953
13104
  if (!(e.isMesh || e.isLine || e.isLineSegments || e.isSprite)) return;
12954
13105
  e.userData.node = t;
@@ -12969,7 +13120,7 @@ var Il = class extends HTMLElement {
12969
13120
  entityId: e.id,
12970
13121
  error: r
12971
13122
  } }));
12972
- let i = kl(Ol("box"));
13123
+ let i = jl(Al("box"));
12973
13124
  t.material = new ia({
12974
13125
  color: "#ed8f98",
12975
13126
  roughness: .72,
@@ -12978,8 +13129,8 @@ var Il = class extends HTMLElement {
12978
13129
  }
12979
13130
  t.labelSize = new U().fromArray(e.s);
12980
13131
  } else {
12981
- let n = o === "box" && Number(e.radius) > 0, r = Ol(o, e.radius, e.segments, e.s);
12982
- n || kl(r), t.material = new ia({
13132
+ let n = o === "box" && Number(e.radius) > 0, r = Al(o, e.radius, e.segments, e.s);
13133
+ n || jl(r), t.material = new ia({
12983
13134
  color: a,
12984
13135
  roughness: .72,
12985
13136
  metalness: .06,
@@ -12999,7 +13150,7 @@ var Il = class extends HTMLElement {
12999
13150
  1
13000
13151
  ] : e.s), t.group.add(t.edge);
13001
13152
  }
13002
- t.label = Fl(e.name, a, t.labelSize, e.type, this.showShellLabels), t.label.userData.node = t, t.label.traverse((e) => {
13153
+ t.label = Ll(e.name, a, t.labelSize, e.type, this.showShellLabels), t.label.userData.node = t, t.label.traverse((e) => {
13003
13154
  e.userData.node = t;
13004
13155
  }), t.group.add(t.label), this.scene.add(t.group);
13005
13156
  }
@@ -13096,8 +13247,8 @@ var Il = class extends HTMLElement {
13096
13247
  if (!this.modelData) return;
13097
13248
  let e = this.selectedRelationIndex === null ? null : this.relations[this.selectedRelationIndex];
13098
13249
  if (e) {
13099
- let t = ml(e), n = e.text ? "<p>" + xl(e.text) + "</p>" : "", r = Sl(e.url);
13100
- this.panel.innerHTML = "<button class=\"back\" data-action=\"overview\">← Vista de conjunto</button><div class=\"eyebrow\">RELACIÓN</div><h2>" + xl(e.label || `${e.from} → ${e.to}`) + "</h2><div class=\"sub\">" + xl(e.from) + " → " + xl(e.to) + "</div>" + n + r + "<h3>MODO</h3><p>" + xl(t) + "</p>", this.panel.querySelector("[data-action=\"overview\"]")?.addEventListener("click", () => this.reset()), this._applyTheme();
13250
+ let t = ml(e), n = e.text ? "<p>" + Cl(e.text) + "</p>" : "", r = wl(e.url);
13251
+ this.panel.innerHTML = "<button class=\"back\" data-action=\"overview\">← Vista de conjunto</button><div class=\"eyebrow\">RELACIÓN</div><h2>" + Cl(e.label || `${e.from} → ${e.to}`) + "</h2><div class=\"sub\">" + Cl(e.from) + " → " + Cl(e.to) + "</div>" + n + r + "<h3>MODO</h3><p>" + Cl(t) + "</p>", this.panel.querySelector("[data-action=\"overview\"]")?.addEventListener("click", () => this.reset()), this._applyTheme();
13101
13252
  return;
13102
13253
  }
13103
13254
  let t = this.selected;
@@ -13107,33 +13258,23 @@ var Il = class extends HTMLElement {
13107
13258
  }
13108
13259
  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;
13109
13260
  for (; o && !a.has(o.id);) a.add(o.id), i.unshift(o), o = o.parent ? this.nodes.get(o.parent) : null;
13110
- 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=\"" + xl(e.id) + "\" class=\"" + (t === i.length - 1 ? "current" : "") + "\">" + xl(e.name) + "</button>").join("") + "</nav>", c = n.map((e) => {
13111
- let n = this.relations.indexOf(e), r = e.text ? "<small>" + xl(e.text) + "</small>" : "";
13112
- return "<button class=\"relation\" data-action=\"relation\" data-relation-index=\"" + n + "\"><strong>" + xl(e.label || (e.from === t.id ? e.to : e.from)) + "</strong><small>" + xl(e.from) + " → " + xl(e.to) + "</small>" + r + "</button>";
13261
+ 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=\"" + Cl(e.id) + "\" class=\"" + (t === i.length - 1 ? "current" : "") + "\">" + Cl(e.name) + "</button>").join("") + "</nav>", c = n.map((e) => {
13262
+ let n = this.relations.indexOf(e), r = e.text ? "<small>" + Cl(e.text) + "</small>" : "";
13263
+ return "<button class=\"relation\" data-action=\"relation\" data-relation-index=\"" + n + "\"><strong>" + Cl(e.label || (e.from === t.id ? e.to : e.from)) + "</strong><small>" + Cl(e.from) + " → " + Cl(e.to) + "</small>" + r + "</button>";
13113
13264
  }).join("");
13114
- this.panel.innerHTML = "<button class=\"back\" data-action=\"overview\">← Vista de conjunto</button>" + s + "<div class=\"eyebrow\">" + xl(cl(t.type) ? "CONTENEDOR" : t.type === "actor" ? "ACTOR EXTERNO" : "COMPONENTE") + "</div><h2>" + xl(t.name) + "</h2><div class=\"sub\">" + xl(t.sub || "") + "</div><p>" + xl(t.text || "") + "</p>" + Sl(t.url) + (cl(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=\"toggle-shell\"]")?.addEventListener("click", () => {
13115
- if (this.open.has(t.id)) {
13116
- this.open.delete(t.id);
13117
- for (let e of this.nodes.values()) {
13118
- let n = e.parent ? this.nodes.get(e.parent) : null;
13119
- for (; n;) {
13120
- if (n.id === t.id) {
13121
- this.open.delete(e.id);
13122
- break;
13123
- }
13124
- n = n.parent ? this.nodes.get(n.parent) : null;
13125
- }
13126
- }
13127
- } else this.open.add(t.id);
13128
- this._renderPanel(), this._rebuildRelations(), this.invalidate();
13265
+ this.panel.innerHTML = "<button class=\"back\" data-action=\"overview\">← Vista de conjunto</button>" + s + "<div class=\"eyebrow\">" + Cl(cl(t.type) ? "CONTENEDOR" : t.type === "actor" ? "ACTOR EXTERNO" : "COMPONENTE") + "</div><h2>" + Cl(t.name) + "</h2><div class=\"sub\">" + Cl(t.sub || "") + "</div><p>" + Cl(t.text || "") + "</p>" + wl(t.url) + (cl(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=\"toggle-shell\"]")?.addEventListener("click", () => {
13266
+ this.toggleContainer(t.id, { source: "panel" });
13129
13267
  }), this._applyTheme();
13130
13268
  }
13131
13269
  select(e, t = {}) {
13132
13270
  let n = this.nodes.get(e);
13133
13271
  if (!n) return this;
13134
- let r = n.parent ? this.nodes.get(n.parent) : null;
13135
- for (; r;) this.open.add(r.id), r = r.parent ? this.nodes.get(r.parent) : null;
13136
- return this.selected = n, this.selectedRelationIndex = null, cl(n.type) && this.open.add(n.id), this.targetFocus.copy(this._worldPosition(n)), this.targetZoom = n.parent ? 1.35 : 1.1, this._renderPanel(), this._rebuildRelations(), this.invalidate(), t.focusEvent !== !1 && this._emitFocusChange(t.source || "api"), t.emit !== !1 && this._emit("lc-select", {
13272
+ let r = new Set(this.open), i = n.parent ? this.nodes.get(n.parent) : null;
13273
+ for (; i;) r.add(i.id), i = i.parent ? this.nodes.get(i.parent) : null;
13274
+ return this.selected = n, this.selectedRelationIndex = null, cl(n.type) && r.add(n.id), this._replaceOpenContainers(r, {
13275
+ refresh: !1,
13276
+ source: t.source || "api"
13277
+ }), this.targetFocus.copy(this._worldPosition(n)), this.targetZoom = n.parent ? 1.35 : 1.1, this._renderPanel(), this._rebuildRelations(), this.invalidate(), t.focusEvent !== !1 && this._emitFocusChange(t.source || "api"), t.emit !== !1 && this._emit("lc-select", {
13137
13278
  kind: "entity",
13138
13279
  id: e,
13139
13280
  index: null,
@@ -13146,12 +13287,17 @@ var Il = class extends HTMLElement {
13146
13287
  let n = this._relationIndex(e), r = this._publicRelation(n);
13147
13288
  if (!r) return this;
13148
13289
  this.selected = null, this.selectedRelationIndex = n;
13290
+ let i = new Set(this.open);
13149
13291
  for (let e of [r.from, r.to]) {
13150
13292
  let t = this.nodes.get(e)?.parent ? this.nodes.get(this.nodes.get(e).parent) : null;
13151
- for (; t;) this.open.add(t.id), t = t.parent ? this.nodes.get(t.parent) : null;
13293
+ for (; t;) i.add(t.id), t = t.parent ? this.nodes.get(t.parent) : null;
13152
13294
  }
13153
- let i = this.nodes.get(r.from), a = this.nodes.get(r.to);
13154
- return i && a && this.targetFocus.copy(this._worldPosition(i).add(this._worldPosition(a)).multiplyScalar(.5)), this.targetZoom = 1.22, this._renderPanel(), this._rebuildRelations(), this.invalidate(), t.focusEvent !== !1 && this._emitFocusChange(t.source || "api"), t.emit !== !1 && this._emit("lc-select", {
13295
+ this._replaceOpenContainers(i, {
13296
+ refresh: !1,
13297
+ source: t.source || "api"
13298
+ });
13299
+ let a = this.nodes.get(r.from), o = this.nodes.get(r.to);
13300
+ return a && o && this.targetFocus.copy(this._worldPosition(a).add(this._worldPosition(o)).multiplyScalar(.5)), this.targetZoom = 1.22, this._renderPanel(), this._rebuildRelations(), this.invalidate(), t.focusEvent !== !1 && this._emitFocusChange(t.source || "api"), t.emit !== !1 && this._emit("lc-select", {
13155
13301
  kind: "relation",
13156
13302
  id: r.id || null,
13157
13303
  index: n,
@@ -13168,7 +13314,10 @@ var Il = class extends HTMLElement {
13168
13314
  ].includes(e) ? e : "selected", this.setAttribute("relation-mode", this.relationMode), this._syncRelationToolbar(), this._rebuildRelations(), this.invalidate(), this.dispatchEvent(new CustomEvent("lc-relation-mode", { detail: { mode: this.relationMode } }));
13169
13315
  }
13170
13316
  reset() {
13171
- this.selected = null, this.selectedRelationIndex = null, this.open.clear(), this.relationMode = "selected", this.setAttribute("relation-mode", "selected"), this._syncRelationToolbar(), this.restoreInitialCamera({ animate: !1 }), this._renderPanel(), this._rebuildRelations(), this.invalidate(), this._emitFocusChange("reset");
13317
+ this.selected = null, this.selectedRelationIndex = null, this.restoreInitialContainerState({
13318
+ refresh: !1,
13319
+ source: "reset"
13320
+ }), this.relationMode = "selected", this.setAttribute("relation-mode", "selected"), this._syncRelationToolbar(), this.restoreInitialCamera({ animate: !1 }), this._renderPanel(), this._rebuildRelations(), this.invalidate(), this._emitFocusChange("reset");
13172
13321
  }
13173
13322
  resize() {
13174
13323
  if (!this.renderer) return;
@@ -13248,7 +13397,7 @@ var Il = class extends HTMLElement {
13248
13397
  e.key === "Escape" && (this._closeToolbarMenus(), this.canvas.focus({ preventScroll: !0 }));
13249
13398
  }), this.shadowRoot.addEventListener("click", (e) => {
13250
13399
  let t = e.target.closest?.("[data-action]"), n = t?.dataset.action;
13251
- 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 === "open-all" && this.openAllContainers(), n === "close-all" && this.closeAllContainers(), n === "relations-all" && this.setRelationMode("all"), n === "relations-selected" && this.setRelationMode("selected"), n === "relations-none" && this.setRelationMode("none"), n === "focus-all" && this.setFocusFilter({ mode: "all" }, { source: "toolbar" }), n === "focus-dim" && this.setFocusFilter({
13400
+ 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 === "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-none" && this.setRelationMode("none"), n === "focus-all" && this.setFocusFilter({ mode: "all" }, { source: "toolbar" }), n === "focus-dim" && this.setFocusFilter({
13252
13401
  mode: "connected",
13253
13402
  effect: "dim"
13254
13403
  }, { source: "toolbar" }), n === "focus-hide" && this.setFocusFilter({
@@ -13358,11 +13507,11 @@ var Il = class extends HTMLElement {
13358
13507
  }
13359
13508
  _showError(e) {
13360
13509
  let t = this.shadowRoot.querySelector(".viewport"), n = t.querySelector(".error");
13361
- n ? n.textContent = e : t.insertAdjacentHTML("beforeend", "<div class=\"error\" role=\"alert\">" + xl(e) + "</div>");
13510
+ n ? n.textContent = e : t.insertAdjacentHTML("beforeend", "<div class=\"error\" role=\"alert\">" + Cl(e) + "</div>");
13362
13511
  }
13363
13512
  };
13364
- customElements.get("liquidcars-atlas") || customElements.define("liquidcars-atlas", Il);
13513
+ customElements.get("liquidcars-atlas") || customElements.define("liquidcars-atlas", zl);
13365
13514
  //#endregion
13366
- export { Il as LiquidCarsAtlas, ol as getGeometryCatalog, Cl as normalizeModel, il as registerGeometryPack, al as unregisterGeometryPack };
13515
+ export { zl as LiquidCarsAtlas, Rl as captureRendererFrame, ol as getGeometryCatalog, Tl as normalizeModel, il as registerGeometryPack, al as unregisterGeometryPack };
13367
13516
 
13368
13517
  //# sourceMappingURL=liquidcars-atlas.js.map