@liquidcars/atlas 0.1.42 → 0.1.44

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