@liquidcars/atlas 0.1.39 → 0.1.40

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.
@@ -6630,8 +6630,94 @@ function Ka(e, t, n, r) {
6630
6630
  for (let e = 0, i = r.length; e < i; e++) Ka(r[e], t, n, !0);
6631
6631
  }
6632
6632
  }
6633
- function qa(e, t, n, r) {
6634
- let i = Ja(r);
6633
+ var qa = class {
6634
+ constructor() {
6635
+ this.type = "ShapePath", this.color = new X(), this.subPaths = [], this.currentPath = null;
6636
+ }
6637
+ moveTo(e, t) {
6638
+ return this.currentPath = new li(), this.subPaths.push(this.currentPath), this.currentPath.moveTo(e, t), this;
6639
+ }
6640
+ lineTo(e, t) {
6641
+ return this.currentPath.lineTo(e, t), this;
6642
+ }
6643
+ quadraticCurveTo(e, t, n, r) {
6644
+ return this.currentPath.quadraticCurveTo(e, t, n, r), this;
6645
+ }
6646
+ bezierCurveTo(e, t, n, r, i, a) {
6647
+ return this.currentPath.bezierCurveTo(e, t, n, r, i, a), this;
6648
+ }
6649
+ splineThru(e) {
6650
+ return this.currentPath.splineThru(e), this;
6651
+ }
6652
+ toShapes(e) {
6653
+ function t(e) {
6654
+ let t = [];
6655
+ for (let n = 0, r = e.length; n < r; n++) {
6656
+ let r = e[n], i = new ui();
6657
+ i.curves = r.curves, t.push(i);
6658
+ }
6659
+ return t;
6660
+ }
6661
+ function n(e, t) {
6662
+ let n = t.length, r = !1;
6663
+ for (let i = n - 1, a = 0; a < n; i = a++) {
6664
+ let n = t[i], o = t[a], s = o.x - n.x, c = o.y - n.y;
6665
+ if (Math.abs(c) > 2 ** -52) {
6666
+ if (c < 0 && (n = t[a], s = -s, o = t[i], c = -c), e.y < n.y || e.y > o.y) continue;
6667
+ if (e.y === n.y) {
6668
+ if (e.x === n.x) return !0;
6669
+ } else {
6670
+ let t = c * (e.x - n.x) - s * (e.y - n.y);
6671
+ if (t === 0) return !0;
6672
+ if (t < 0) continue;
6673
+ r = !r;
6674
+ }
6675
+ } else {
6676
+ if (e.y !== n.y) continue;
6677
+ if (o.x <= e.x && e.x <= n.x || n.x <= e.x && e.x <= o.x) return !0;
6678
+ }
6679
+ }
6680
+ return r;
6681
+ }
6682
+ let r = Gi.isClockWise, i = this.subPaths;
6683
+ if (i.length === 0) return [];
6684
+ let a, o, s, c = [];
6685
+ if (i.length === 1) return o = i[0], s = new ui(), s.curves = o.curves, c.push(s), c;
6686
+ let l = !r(i[0].getPoints());
6687
+ l = e ? !l : l;
6688
+ let u = [], d = [], f = [], p = 0, m;
6689
+ d[p] = void 0, f[p] = [];
6690
+ for (let t = 0, n = i.length; t < n; t++) o = i[t], m = o.getPoints(), a = r(m), a = e ? !a : a, a ? (!l && d[p] && p++, d[p] = {
6691
+ s: new ui(),
6692
+ p: m
6693
+ }, d[p].s.curves = o.curves, l && p++, f[p] = []) : f[p].push({
6694
+ h: o,
6695
+ p: m[0]
6696
+ });
6697
+ if (!d[0]) return t(i);
6698
+ if (d.length > 1) {
6699
+ let e = !1, t = 0;
6700
+ for (let e = 0, t = d.length; e < t; e++) u[e] = [];
6701
+ for (let r = 0, i = d.length; r < i; r++) {
6702
+ let i = f[r];
6703
+ for (let a = 0; a < i.length; a++) {
6704
+ let o = i[a], s = !0;
6705
+ for (let i = 0; i < d.length; i++) n(o.p, d[i].p) && (r !== i && t++, s ? (s = !1, u[i].push(o)) : e = !0);
6706
+ s && u[r].push(o);
6707
+ }
6708
+ }
6709
+ t > 0 && e === !1 && (f = u);
6710
+ }
6711
+ let h;
6712
+ for (let e = 0, t = d.length; e < t; e++) {
6713
+ s = d[e].s, c.push(s), h = f[e];
6714
+ for (let e = 0, t = h.length; e < t; e++) s.holes.push(h[e].h);
6715
+ }
6716
+ return c;
6717
+ }
6718
+ };
6719
+ function Ja(e, t, n, r) {
6720
+ let i = Ya(r);
6635
6721
  switch (n) {
6636
6722
  case 1021: return e * t;
6637
6723
  case 1028: return e * t / i.components * i.byteLength;
@@ -6676,7 +6762,7 @@ function qa(e, t, n, r) {
6676
6762
  }
6677
6763
  throw Error(`Unable to determine texture byte length for ${n} format.`);
6678
6764
  }
6679
- function Ja(e) {
6765
+ function Ya(e) {
6680
6766
  switch (e) {
6681
6767
  case o:
6682
6768
  case 1010: return {
@@ -6711,7 +6797,7 @@ function Ja(e) {
6711
6797
  typeof __THREE_DEVTOOLS__ < "u" && __THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register", { detail: { revision: "180" } })), typeof window < "u" && (window.__THREE__ ? console.warn("WARNING: Multiple instances of Three.js being imported.") : window.__THREE__ = "180");
6712
6798
  //#endregion
6713
6799
  //#region src/three.module.js
6714
- function Ya() {
6800
+ function Xa() {
6715
6801
  let e = null, t = !1, n = null, r = null;
6716
6802
  function i(t, a) {
6717
6803
  n(t, a), r = e.requestAnimationFrame(i);
@@ -6731,7 +6817,7 @@ function Ya() {
6731
6817
  }
6732
6818
  };
6733
6819
  }
6734
- function Xa(e) {
6820
+ function Za(e) {
6735
6821
  let t = /* @__PURE__ */ new WeakMap();
6736
6822
  function n(t, n) {
6737
6823
  let r = t.array, i = t.usage, a = r.byteLength, o = e.createBuffer();
@@ -7127,7 +7213,7 @@ var Q = {
7127
7213
  alphaMapTransform: { value: /*@__PURE__*/ new G() },
7128
7214
  alphaTest: { value: 0 }
7129
7215
  }
7130
- }, Za = {
7216
+ }, Qa = {
7131
7217
  basic: {
7132
7218
  uniforms: /*@__PURE__*/ Fn([
7133
7219
  $.common,
@@ -7332,8 +7418,8 @@ var Q = {
7332
7418
  fragmentShader: Q.shadow_frag
7333
7419
  }
7334
7420
  };
7335
- Za.physical = {
7336
- uniforms: /*@__PURE__*/ Fn([Za.standard.uniforms, {
7421
+ Qa.physical = {
7422
+ uniforms: /*@__PURE__*/ Fn([Qa.standard.uniforms, {
7337
7423
  clearcoat: { value: 0 },
7338
7424
  clearcoatMap: { value: null },
7339
7425
  clearcoatMapTransform: { value: /*@__PURE__*/ new G() },
@@ -7382,12 +7468,12 @@ Za.physical = {
7382
7468
  vertexShader: Q.meshphysical_vert,
7383
7469
  fragmentShader: Q.meshphysical_frag
7384
7470
  };
7385
- var Qa = {
7471
+ var $a = {
7386
7472
  r: 0,
7387
7473
  b: 0,
7388
7474
  g: 0
7389
- }, $a = /*@__PURE__*/ new vt(), eo = /*@__PURE__*/ new ct();
7390
- function to(e, t, n, r, i, a, o) {
7475
+ }, eo = /*@__PURE__*/ new vt(), to = /*@__PURE__*/ new ct();
7476
+ function no(e, t, n, r, i, a, o) {
7391
7477
  let s = new X(0), c = a === !0 ? 0 : 1, l, u, d = null, f = 0, p = null;
7392
7478
  function m(e) {
7393
7479
  let r = e.isScene === !0 ? e.background : null;
@@ -7403,9 +7489,9 @@ function to(e, t, n, r, i, a, o) {
7403
7489
  let r = m(n);
7404
7490
  r && (r.isCubeTexture || r.mapping === 306) ? (u === void 0 && (u = new An(new Nn(1, 1, 1), new Vn({
7405
7491
  name: "BackgroundCubeMaterial",
7406
- uniforms: Pn(Za.backgroundCube.uniforms),
7407
- vertexShader: Za.backgroundCube.vertexShader,
7408
- fragmentShader: Za.backgroundCube.fragmentShader,
7492
+ uniforms: Pn(Qa.backgroundCube.uniforms),
7493
+ vertexShader: Qa.backgroundCube.vertexShader,
7494
+ fragmentShader: Qa.backgroundCube.fragmentShader,
7409
7495
  side: 1,
7410
7496
  depthTest: !1,
7411
7497
  depthWrite: !1,
@@ -7415,11 +7501,11 @@ function to(e, t, n, r, i, a, o) {
7415
7501
  this.matrixWorld.copyPosition(n.matrixWorld);
7416
7502
  }, Object.defineProperty(u.material, "envMap", { get: function() {
7417
7503
  return this.uniforms.envMap.value;
7418
- } }), i.update(u)), $a.copy(n.backgroundRotation), $a.x *= -1, $a.y *= -1, $a.z *= -1, r.isCubeTexture && r.isRenderTargetTexture === !1 && ($a.y *= -1, $a.z *= -1), u.material.uniforms.envMap.value = r, u.material.uniforms.flipEnvMap.value = r.isCubeTexture && r.isRenderTargetTexture === !1 ? -1 : 1, u.material.uniforms.backgroundBlurriness.value = n.backgroundBlurriness, u.material.uniforms.backgroundIntensity.value = n.backgroundIntensity, u.material.uniforms.backgroundRotation.value.setFromMatrix4(eo.makeRotationFromEuler($a)), u.material.toneMapped = Y.getTransfer(r.colorSpace) !== S, (d !== r || f !== r.version || p !== e.toneMapping) && (u.material.needsUpdate = !0, d = r, f = r.version, p = e.toneMapping), u.layers.enableAll(), t.unshift(u, u.geometry, u.material, 0, 0, null)) : r && r.isTexture && (l === void 0 && (l = new An(new ea(2, 2), new Vn({
7504
+ } }), i.update(u)), eo.copy(n.backgroundRotation), eo.x *= -1, eo.y *= -1, eo.z *= -1, r.isCubeTexture && r.isRenderTargetTexture === !1 && (eo.y *= -1, eo.z *= -1), u.material.uniforms.envMap.value = r, u.material.uniforms.flipEnvMap.value = r.isCubeTexture && r.isRenderTargetTexture === !1 ? -1 : 1, u.material.uniforms.backgroundBlurriness.value = n.backgroundBlurriness, u.material.uniforms.backgroundIntensity.value = n.backgroundIntensity, u.material.uniforms.backgroundRotation.value.setFromMatrix4(to.makeRotationFromEuler(eo)), u.material.toneMapped = Y.getTransfer(r.colorSpace) !== S, (d !== r || f !== r.version || p !== e.toneMapping) && (u.material.needsUpdate = !0, d = r, f = r.version, p = e.toneMapping), u.layers.enableAll(), t.unshift(u, u.geometry, u.material, 0, 0, null)) : r && r.isTexture && (l === void 0 && (l = new An(new ea(2, 2), new Vn({
7419
7505
  name: "BackgroundMaterial",
7420
- uniforms: Pn(Za.background.uniforms),
7421
- vertexShader: Za.background.vertexShader,
7422
- fragmentShader: Za.background.fragmentShader,
7506
+ uniforms: Pn(Qa.background.uniforms),
7507
+ vertexShader: Qa.background.vertexShader,
7508
+ fragmentShader: Qa.background.fragmentShader,
7423
7509
  side: 0,
7424
7510
  depthTest: !1,
7425
7511
  depthWrite: !1,
@@ -7430,7 +7516,7 @@ function to(e, t, n, r, i, a, o) {
7430
7516
  } }), i.update(l)), l.material.uniforms.t2D.value = r, l.material.uniforms.backgroundIntensity.value = n.backgroundIntensity, l.material.toneMapped = Y.getTransfer(r.colorSpace) !== S, r.matrixAutoUpdate === !0 && r.updateMatrix(), l.material.uniforms.uvTransform.value.copy(r.matrix), (d !== r || f !== r.version || p !== e.toneMapping) && (l.material.needsUpdate = !0, d = r, f = r.version, p = e.toneMapping), l.layers.enableAll(), t.unshift(l, l.geometry, l.material, 0, 0, null));
7431
7517
  }
7432
7518
  function _(t, n) {
7433
- t.getRGB(Qa, Ln(e)), r.buffers.color.setClear(Qa.r, Qa.g, Qa.b, n, o);
7519
+ t.getRGB($a, Ln(e)), r.buffers.color.setClear($a.r, $a.g, $a.b, n, o);
7434
7520
  }
7435
7521
  function v() {
7436
7522
  u !== void 0 && (u.geometry.dispose(), u.material.dispose(), u = void 0), l !== void 0 && (l.geometry.dispose(), l.material.dispose(), l = void 0);
@@ -7453,7 +7539,7 @@ function to(e, t, n, r, i, a, o) {
7453
7539
  dispose: v
7454
7540
  };
7455
7541
  }
7456
- function no(e, t) {
7542
+ function ro(e, t) {
7457
7543
  let n = e.getParameter(e.MAX_VERTEX_ATTRIBS), r = {}, i = f(null), a = i, o = !1;
7458
7544
  function s(n, r, i, s, c) {
7459
7545
  let u = !1, f = d(s, i, r);
@@ -7623,7 +7709,7 @@ function no(e, t) {
7623
7709
  disableUnusedAttributes: v
7624
7710
  };
7625
7711
  }
7626
- function ro(e, t, n) {
7712
+ function io(e, t, n) {
7627
7713
  let r;
7628
7714
  function i(e) {
7629
7715
  r = e;
@@ -7654,7 +7740,7 @@ function ro(e, t, n) {
7654
7740
  }
7655
7741
  this.setMode = i, this.render = a, this.renderInstances = o, this.renderMultiDraw = s, this.renderMultiDrawInstances = c;
7656
7742
  }
7657
- function io(e, t, n, r) {
7743
+ function ao(e, t, n, r) {
7658
7744
  let i;
7659
7745
  function a() {
7660
7746
  if (i !== void 0) return i;
@@ -7702,7 +7788,7 @@ function io(e, t, n, r) {
7702
7788
  maxSamples: S
7703
7789
  };
7704
7790
  }
7705
- function ao(e) {
7791
+ function oo(e) {
7706
7792
  let t = this, n = null, r = 0, i = !1, a = !1, o = new ar(), s = new G(), c = {
7707
7793
  value: null,
7708
7794
  needsUpdate: !1
@@ -7742,7 +7828,7 @@ function ao(e) {
7742
7828
  return t.numPlanes = a, t.numIntersection = 0, l;
7743
7829
  }
7744
7830
  }
7745
- function oo(e) {
7831
+ function so(e) {
7746
7832
  let t = /* @__PURE__ */ new WeakMap();
7747
7833
  function n(e, t) {
7748
7834
  return t === 303 ? e.mapping = 301 : t === 304 && (e.mapping = 302), e;
@@ -7781,31 +7867,31 @@ function oo(e) {
7781
7867
  dispose: a
7782
7868
  };
7783
7869
  }
7784
- var so = 4, co = [
7870
+ var co = 4, lo = [
7785
7871
  .125,
7786
7872
  .215,
7787
7873
  .35,
7788
7874
  .446,
7789
7875
  .526,
7790
7876
  .582
7791
- ], lo = 20, uo = /*@__PURE__*/ new Da(), fo = /*@__PURE__*/ new X(), po = null, mo = 0, ho = 0, go = !1, _o = (1 + Math.sqrt(5)) / 2, vo = 1 / _o, yo = [
7792
- /*@__PURE__*/ new U(-_o, vo, 0),
7793
- /*@__PURE__*/ new U(_o, vo, 0),
7794
- /*@__PURE__*/ new U(-vo, 0, _o),
7795
- /*@__PURE__*/ new U(vo, 0, _o),
7796
- /*@__PURE__*/ new U(0, _o, -vo),
7797
- /*@__PURE__*/ new U(0, _o, vo),
7877
+ ], uo = 20, fo = /*@__PURE__*/ new Da(), po = /*@__PURE__*/ new X(), mo = null, ho = 0, go = 0, _o = !1, vo = (1 + Math.sqrt(5)) / 2, yo = 1 / vo, bo = [
7878
+ /*@__PURE__*/ new U(-vo, yo, 0),
7879
+ /*@__PURE__*/ new U(vo, yo, 0),
7880
+ /*@__PURE__*/ new U(-yo, 0, vo),
7881
+ /*@__PURE__*/ new U(yo, 0, vo),
7882
+ /*@__PURE__*/ new U(0, vo, -yo),
7883
+ /*@__PURE__*/ new U(0, vo, yo),
7798
7884
  /*@__PURE__*/ new U(-1, 1, -1),
7799
7885
  /*@__PURE__*/ new U(1, 1, -1),
7800
7886
  /*@__PURE__*/ new U(-1, 1, 1),
7801
7887
  /*@__PURE__*/ new U(1, 1, 1)
7802
- ], bo = /*@__PURE__*/ new U(), xo = class {
7888
+ ], xo = /*@__PURE__*/ new U(), So = class {
7803
7889
  constructor(e) {
7804
7890
  this._renderer = e, this._pingPongRenderTarget = null, this._lodMax = 0, this._cubeSize = 0, this._lodPlanes = [], this._sizeLods = [], this._sigmas = [], this._blurMaterial = null, this._cubemapMaterial = null, this._equirectMaterial = null, this._compileMaterial(this._blurMaterial);
7805
7891
  }
7806
7892
  fromScene(e, t = 0, n = .1, r = 100, i = {}) {
7807
- let { size: a = 256, position: o = bo } = i;
7808
- po = this._renderer.getRenderTarget(), mo = this._renderer.getActiveCubeFace(), ho = this._renderer.getActiveMipmapLevel(), go = this._renderer.xr.enabled, this._renderer.xr.enabled = !1, this._setSize(a);
7893
+ let { size: a = 256, position: o = xo } = i;
7894
+ mo = this._renderer.getRenderTarget(), ho = this._renderer.getActiveCubeFace(), go = this._renderer.getActiveMipmapLevel(), _o = this._renderer.xr.enabled, this._renderer.xr.enabled = !1, this._setSize(a);
7809
7895
  let s = this._allocateTargets();
7810
7896
  return s.depthBuffer = !0, this._sceneToCubeUV(e, n, r, s, o), t > 0 && this._blur(s, 0, 0, t), this._applyPMREM(s), this._cleanup(s), s;
7811
7897
  }
@@ -7816,10 +7902,10 @@ var so = 4, co = [
7816
7902
  return this._fromTexture(e, t);
7817
7903
  }
7818
7904
  compileCubemapShader() {
7819
- this._cubemapMaterial === null && (this._cubemapMaterial = Do(), this._compileMaterial(this._cubemapMaterial));
7905
+ this._cubemapMaterial === null && (this._cubemapMaterial = Oo(), this._compileMaterial(this._cubemapMaterial));
7820
7906
  }
7821
7907
  compileEquirectangularShader() {
7822
- this._equirectMaterial === null && (this._equirectMaterial = Eo(), this._compileMaterial(this._equirectMaterial));
7908
+ this._equirectMaterial === null && (this._equirectMaterial = Do(), this._compileMaterial(this._equirectMaterial));
7823
7909
  }
7824
7910
  dispose() {
7825
7911
  this._dispose(), this._cubemapMaterial !== null && this._cubemapMaterial.dispose(), this._equirectMaterial !== null && this._equirectMaterial.dispose();
@@ -7832,10 +7918,10 @@ var so = 4, co = [
7832
7918
  for (let e = 0; e < this._lodPlanes.length; e++) this._lodPlanes[e].dispose();
7833
7919
  }
7834
7920
  _cleanup(e) {
7835
- this._renderer.setRenderTarget(po, mo, ho), this._renderer.xr.enabled = go, e.scissorTest = !1, wo(e, 0, 0, e.width, e.height);
7921
+ this._renderer.setRenderTarget(mo, ho, go), this._renderer.xr.enabled = _o, e.scissorTest = !1, To(e, 0, 0, e.width, e.height);
7836
7922
  }
7837
7923
  _fromTexture(e, t) {
7838
- e.mapping === 301 || e.mapping === 302 ? this._setSize(e.image.length === 0 ? 16 : e.image[0].width || e.image[0].image.width) : this._setSize(e.image.width / 4), po = this._renderer.getRenderTarget(), mo = this._renderer.getActiveCubeFace(), ho = this._renderer.getActiveMipmapLevel(), go = this._renderer.xr.enabled, this._renderer.xr.enabled = !1;
7924
+ e.mapping === 301 || e.mapping === 302 ? this._setSize(e.image.length === 0 ? 16 : e.image[0].width || e.image[0].image.width) : this._setSize(e.image.width / 4), mo = this._renderer.getRenderTarget(), ho = this._renderer.getActiveCubeFace(), go = this._renderer.getActiveMipmapLevel(), _o = this._renderer.xr.enabled, this._renderer.xr.enabled = !1;
7839
7925
  let n = t || this._allocateTargets();
7840
7926
  return this._textureToCubeUV(e, n), this._applyPMREM(n), this._cleanup(n), n;
7841
7927
  }
@@ -7848,17 +7934,17 @@ var so = 4, co = [
7848
7934
  format: u,
7849
7935
  colorSpace: b,
7850
7936
  depthBuffer: !1
7851
- }, r = Co(e, t, n);
7937
+ }, r = wo(e, t, n);
7852
7938
  if (this._pingPongRenderTarget === null || this._pingPongRenderTarget.width !== e || this._pingPongRenderTarget.height !== t) {
7853
- this._pingPongRenderTarget !== null && this._dispose(), this._pingPongRenderTarget = Co(e, t, n);
7939
+ this._pingPongRenderTarget !== null && this._dispose(), this._pingPongRenderTarget = wo(e, t, n);
7854
7940
  let { _lodMax: r } = this;
7855
- ({sizeLods: this._sizeLods, lodPlanes: this._lodPlanes, sigmas: this._sigmas} = So(r)), this._blurMaterial = To(r, e, t);
7941
+ ({sizeLods: this._sizeLods, lodPlanes: this._lodPlanes, sigmas: this._sigmas} = Co(r)), this._blurMaterial = Eo(r, e, t);
7856
7942
  }
7857
7943
  return r;
7858
7944
  }
7859
7945
  _compileMaterial(e) {
7860
7946
  let t = new An(this._lodPlanes[0], e);
7861
- this._renderer.compile(t, uo);
7947
+ this._renderer.compile(t, fo);
7862
7948
  }
7863
7949
  _sceneToCubeUV(e, t, n, r, i) {
7864
7950
  let a = new Kn(90, 1, t, n), o = [
@@ -7876,36 +7962,36 @@ var so = 4, co = [
7876
7962
  -1,
7877
7963
  -1
7878
7964
  ], c = this._renderer, l = c.autoClear, u = c.toneMapping;
7879
- c.getClearColor(fo), c.toneMapping = 0, c.autoClear = !1, c.state.buffers.depth.getReversed() && (c.setRenderTarget(r), c.clearDepth(), c.setRenderTarget(null));
7965
+ c.getClearColor(po), c.toneMapping = 0, c.autoClear = !1, c.state.buffers.depth.getReversed() && (c.setRenderTarget(r), c.clearDepth(), c.setRenderTarget(null));
7880
7966
  let d = new rn({
7881
7967
  name: "PMREM.Background",
7882
7968
  side: 1,
7883
7969
  depthWrite: !1,
7884
7970
  depthTest: !1
7885
7971
  }), f = new An(new Nn(), d), p = !1, m = e.background;
7886
- m ? m.isColor && (d.color.copy(m), e.background = null, p = !0) : (d.color.copy(fo), p = !0);
7972
+ m ? m.isColor && (d.color.copy(m), e.background = null, p = !0) : (d.color.copy(po), p = !0);
7887
7973
  for (let t = 0; t < 6; t++) {
7888
7974
  let n = t % 3;
7889
7975
  n === 0 ? (a.up.set(0, o[t], 0), a.position.set(i.x, i.y, i.z), a.lookAt(i.x + s[t], i.y, i.z)) : n === 1 ? (a.up.set(0, 0, o[t]), a.position.set(i.x, i.y, i.z), a.lookAt(i.x, i.y + s[t], i.z)) : (a.up.set(0, o[t], 0), a.position.set(i.x, i.y, i.z), a.lookAt(i.x, i.y, i.z + s[t]));
7890
7976
  let l = this._cubeSize;
7891
- wo(r, n * l, t > 2 ? l : 0, l, l), c.setRenderTarget(r), p && c.render(f, a), c.render(e, a);
7977
+ To(r, n * l, t > 2 ? l : 0, l, l), c.setRenderTarget(r), p && c.render(f, a), c.render(e, a);
7892
7978
  }
7893
7979
  f.geometry.dispose(), f.material.dispose(), c.toneMapping = u, c.autoClear = l, e.background = m;
7894
7980
  }
7895
7981
  _textureToCubeUV(e, t) {
7896
7982
  let n = this._renderer, r = e.mapping === 301 || e.mapping === 302;
7897
- r ? (this._cubemapMaterial === null && (this._cubemapMaterial = Do()), this._cubemapMaterial.uniforms.flipEnvMap.value = e.isRenderTargetTexture === !1 ? -1 : 1) : this._equirectMaterial === null && (this._equirectMaterial = Eo());
7983
+ r ? (this._cubemapMaterial === null && (this._cubemapMaterial = Oo()), this._cubemapMaterial.uniforms.flipEnvMap.value = e.isRenderTargetTexture === !1 ? -1 : 1) : this._equirectMaterial === null && (this._equirectMaterial = Do());
7898
7984
  let i = r ? this._cubemapMaterial : this._equirectMaterial, a = new An(this._lodPlanes[0], i), o = i.uniforms;
7899
7985
  o.envMap.value = e;
7900
7986
  let s = this._cubeSize;
7901
- wo(t, 0, 0, 3 * s, 2 * s), n.setRenderTarget(t), n.render(a, uo);
7987
+ To(t, 0, 0, 3 * s, 2 * s), n.setRenderTarget(t), n.render(a, fo);
7902
7988
  }
7903
7989
  _applyPMREM(e) {
7904
7990
  let t = this._renderer, n = t.autoClear;
7905
7991
  t.autoClear = !1;
7906
7992
  let r = this._lodPlanes.length;
7907
7993
  for (let t = 1; t < r; t++) {
7908
- let n = Math.sqrt(this._sigmas[t] * this._sigmas[t] - this._sigmas[t - 1] * this._sigmas[t - 1]), i = yo[(r - t - 1) % yo.length];
7994
+ let n = Math.sqrt(this._sigmas[t] * this._sigmas[t] - this._sigmas[t - 1] * this._sigmas[t - 1]), i = bo[(r - t - 1) % bo.length];
7909
7995
  this._blur(e, t - 1, t, n, i);
7910
7996
  }
7911
7997
  t.autoClear = n;
@@ -7917,10 +8003,10 @@ var so = 4, co = [
7917
8003
  _halfBlur(e, t, n, r, i, a, o) {
7918
8004
  let s = this._renderer, c = this._blurMaterial;
7919
8005
  a !== "latitudinal" && a !== "longitudinal" && console.error("blur direction must be either latitudinal or longitudinal!");
7920
- let l = new An(this._lodPlanes[r], c), u = c.uniforms, d = this._sizeLods[n] - 1, f = isFinite(i) ? Math.PI / (2 * d) : 2 * Math.PI / 39, p = i / f, m = isFinite(i) ? 1 + Math.floor(3 * p) : lo;
7921
- m > lo && console.warn(`sigmaRadians, ${i}, is too large and will clip, as it requested ${m} samples when the maximum is set to ${lo}`);
8006
+ let l = new An(this._lodPlanes[r], c), u = c.uniforms, d = this._sizeLods[n] - 1, f = isFinite(i) ? Math.PI / (2 * d) : 2 * Math.PI / 39, p = i / f, m = isFinite(i) ? 1 + Math.floor(3 * p) : uo;
8007
+ m > uo && console.warn(`sigmaRadians, ${i}, is too large and will clip, as it requested ${m} samples when the maximum is set to ${uo}`);
7922
8008
  let h = [], g = 0;
7923
- for (let e = 0; e < lo; ++e) {
8009
+ for (let e = 0; e < uo; ++e) {
7924
8010
  let t = e / p, n = Math.exp(-t * t / 2);
7925
8011
  h.push(n), e === 0 ? g += n : e < m && (g += 2 * n);
7926
8012
  }
@@ -7929,16 +8015,16 @@ var so = 4, co = [
7929
8015
  let { _lodMax: _ } = this;
7930
8016
  u.dTheta.value = f, u.mipInt.value = _ - n;
7931
8017
  let v = this._sizeLods[r];
7932
- wo(t, 3 * v * (r > _ - so ? r - _ + so : 0), 4 * (this._cubeSize - v), 3 * v, 2 * v), s.setRenderTarget(t), s.render(l, uo);
8018
+ To(t, 3 * v * (r > _ - co ? r - _ + co : 0), 4 * (this._cubeSize - v), 3 * v, 2 * v), s.setRenderTarget(t), s.render(l, fo);
7933
8019
  }
7934
8020
  };
7935
- function So(e) {
7936
- let t = [], n = [], r = [], i = e, a = e - so + 1 + co.length;
8021
+ function Co(e) {
8022
+ let t = [], n = [], r = [], i = e, a = e - co + 1 + lo.length;
7937
8023
  for (let o = 0; o < a; o++) {
7938
8024
  let a = 2 ** i;
7939
8025
  n.push(a);
7940
8026
  let s = 1 / a;
7941
- o > e - so ? s = co[o - e + so - 1] : o === 0 && (s = 0), r.push(s);
8027
+ o > e - co ? s = lo[o - e + co - 1] : o === 0 && (s = 0), r.push(s);
7942
8028
  let c = 1 / (a - 2), l = -c, u = 1 + c, d = [
7943
8029
  l,
7944
8030
  l,
@@ -7986,7 +8072,7 @@ function So(e) {
7986
8072
  m.set(i, 6 * e);
7987
8073
  }
7988
8074
  let h = new vn();
7989
- h.setAttribute("position", new cn(f, 3)), h.setAttribute("uv", new cn(p, 2)), h.setAttribute("faceIndex", new cn(m, 1)), t.push(h), i > so && i--;
8075
+ h.setAttribute("position", new cn(f, 3)), h.setAttribute("uv", new cn(p, 2)), h.setAttribute("faceIndex", new cn(m, 1)), t.push(h), i > co && i--;
7990
8076
  }
7991
8077
  return {
7992
8078
  lodPlanes: t,
@@ -7994,19 +8080,19 @@ function So(e) {
7994
8080
  sigmas: r
7995
8081
  };
7996
8082
  }
7997
- function Co(e, t, n) {
8083
+ function wo(e, t, n) {
7998
8084
  let r = new Me(e, t, n);
7999
8085
  return r.texture.mapping = 306, r.texture.name = "PMREM.cubeUv", r.scissorTest = !0, r;
8000
8086
  }
8001
- function wo(e, t, n, r, i) {
8087
+ function To(e, t, n, r, i) {
8002
8088
  e.viewport.set(t, n, r, i), e.scissor.set(t, n, r, i);
8003
8089
  }
8004
- function To(e, t, n) {
8005
- let r = new Float32Array(lo), i = new U(0, 1, 0);
8090
+ function Eo(e, t, n) {
8091
+ let r = new Float32Array(uo), i = new U(0, 1, 0);
8006
8092
  return new Vn({
8007
8093
  name: "SphericalGaussianBlur",
8008
8094
  defines: {
8009
- n: lo,
8095
+ n: uo,
8010
8096
  CUBEUV_TEXEL_WIDTH: 1 / t,
8011
8097
  CUBEUV_TEXEL_HEIGHT: 1 / n,
8012
8098
  CUBEUV_MAX_MIP: `${e}.0`
@@ -8020,53 +8106,53 @@ function To(e, t, n) {
8020
8106
  mipInt: { value: 0 },
8021
8107
  poleAxis: { value: i }
8022
8108
  },
8023
- vertexShader: Oo(),
8109
+ vertexShader: ko(),
8024
8110
  fragmentShader: "\n\n precision mediump float;\n precision mediump int;\n\n varying vec3 vOutputDirection;\n\n uniform sampler2D envMap;\n uniform int samples;\n uniform float weights[ n ];\n uniform bool latitudinal;\n uniform float dTheta;\n uniform float mipInt;\n uniform vec3 poleAxis;\n\n #define ENVMAP_TYPE_CUBE_UV\n #include <cube_uv_reflection_fragment>\n\n vec3 getSample( float theta, vec3 axis ) {\n\n float cosTheta = cos( theta );\n // Rodrigues' axis-angle rotation\n vec3 sampleDirection = vOutputDirection * cosTheta\n + cross( axis, vOutputDirection ) * sin( theta )\n + axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta );\n\n return bilinearCubeUV( envMap, sampleDirection, mipInt );\n\n }\n\n void main() {\n\n vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection );\n\n if ( all( equal( axis, vec3( 0.0 ) ) ) ) {\n\n axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x );\n\n }\n\n axis = normalize( axis );\n\n gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis );\n\n for ( int i = 1; i < n; i++ ) {\n\n if ( i >= samples ) {\n\n break;\n\n }\n\n float theta = dTheta * float( i );\n gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis );\n gl_FragColor.rgb += weights[ i ] * getSample( theta, axis );\n\n }\n\n }\n ",
8025
8111
  blending: 0,
8026
8112
  depthTest: !1,
8027
8113
  depthWrite: !1
8028
8114
  });
8029
8115
  }
8030
- function Eo() {
8116
+ function Do() {
8031
8117
  return new Vn({
8032
8118
  name: "EquirectangularToCubeUV",
8033
8119
  uniforms: { envMap: { value: null } },
8034
- vertexShader: Oo(),
8120
+ vertexShader: ko(),
8035
8121
  fragmentShader: "\n\n precision mediump float;\n precision mediump int;\n\n varying vec3 vOutputDirection;\n\n uniform sampler2D envMap;\n\n #include <common>\n\n void main() {\n\n vec3 outputDirection = normalize( vOutputDirection );\n vec2 uv = equirectUv( outputDirection );\n\n gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 );\n\n }\n ",
8036
8122
  blending: 0,
8037
8123
  depthTest: !1,
8038
8124
  depthWrite: !1
8039
8125
  });
8040
8126
  }
8041
- function Do() {
8127
+ function Oo() {
8042
8128
  return new Vn({
8043
8129
  name: "CubemapToCubeUV",
8044
8130
  uniforms: {
8045
8131
  envMap: { value: null },
8046
8132
  flipEnvMap: { value: -1 }
8047
8133
  },
8048
- vertexShader: Oo(),
8134
+ vertexShader: ko(),
8049
8135
  fragmentShader: "\n\n precision mediump float;\n precision mediump int;\n\n uniform float flipEnvMap;\n\n varying vec3 vOutputDirection;\n\n uniform samplerCube envMap;\n\n void main() {\n\n gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) );\n\n }\n ",
8050
8136
  blending: 0,
8051
8137
  depthTest: !1,
8052
8138
  depthWrite: !1
8053
8139
  });
8054
8140
  }
8055
- function Oo() {
8141
+ function ko() {
8056
8142
  return "\n\n precision mediump float;\n precision mediump int;\n\n attribute float faceIndex;\n\n varying vec3 vOutputDirection;\n\n // RH coordinate system; PMREM face-indexing convention\n vec3 getDirection( vec2 uv, float face ) {\n\n uv = 2.0 * uv - 1.0;\n\n vec3 direction = vec3( uv, 1.0 );\n\n if ( face == 0.0 ) {\n\n direction = direction.zyx; // ( 1, v, u ) pos x\n\n } else if ( face == 1.0 ) {\n\n direction = direction.xzy;\n direction.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n } else if ( face == 2.0 ) {\n\n direction.x *= -1.0; // ( -u, v, 1 ) pos z\n\n } else if ( face == 3.0 ) {\n\n direction = direction.zyx;\n direction.xz *= -1.0; // ( -1, v, -u ) neg x\n\n } else if ( face == 4.0 ) {\n\n direction = direction.xzy;\n direction.xy *= -1.0; // ( -u, -1, v ) neg y\n\n } else if ( face == 5.0 ) {\n\n direction.z *= -1.0; // ( u, v, -1 ) neg z\n\n }\n\n return direction;\n\n }\n\n void main() {\n\n vOutputDirection = getDirection( uv, faceIndex );\n gl_Position = vec4( position, 1.0 );\n\n }\n ";
8057
8143
  }
8058
- function ko(e) {
8144
+ function Ao(e) {
8059
8145
  let t = /* @__PURE__ */ new WeakMap(), n = null;
8060
8146
  function r(r) {
8061
8147
  if (r && r.isTexture) {
8062
8148
  let o = r.mapping, s = o === 303 || o === 304, c = o === 301 || o === 302;
8063
8149
  if (s || c) {
8064
8150
  let o = t.get(r), l = o === void 0 ? 0 : o.texture.pmremVersion;
8065
- if (r.isRenderTargetTexture && r.pmremVersion !== l) return n === null && (n = new xo(e)), o = s ? n.fromEquirectangular(r, o) : n.fromCubemap(r, o), o.texture.pmremVersion = r.pmremVersion, t.set(r, o), o.texture;
8151
+ if (r.isRenderTargetTexture && r.pmremVersion !== l) return n === null && (n = new So(e)), o = s ? n.fromEquirectangular(r, o) : n.fromCubemap(r, o), o.texture.pmremVersion = r.pmremVersion, t.set(r, o), o.texture;
8066
8152
  if (o !== void 0) return o.texture;
8067
8153
  {
8068
8154
  let l = r.image;
8069
- return s && l && l.height > 0 || c && l && i(l) ? (n === null && (n = new xo(e)), o = s ? n.fromEquirectangular(r) : n.fromCubemap(r), o.texture.pmremVersion = r.pmremVersion, t.set(r, o), r.addEventListener("dispose", a), o.texture) : null;
8155
+ return s && l && l.height > 0 || c && l && i(l) ? (n === null && (n = new So(e)), o = s ? n.fromEquirectangular(r) : n.fromCubemap(r), o.texture.pmremVersion = r.pmremVersion, t.set(r, o), r.addEventListener("dispose", a), o.texture) : null;
8070
8156
  }
8071
8157
  }
8072
8158
  }
@@ -8091,7 +8177,7 @@ function ko(e) {
8091
8177
  dispose: o
8092
8178
  };
8093
8179
  }
8094
- function Ao(e) {
8180
+ function jo(e) {
8095
8181
  let t = {};
8096
8182
  function n(n) {
8097
8183
  if (t[n] !== void 0) return t[n];
@@ -8126,7 +8212,7 @@ function Ao(e) {
8126
8212
  }
8127
8213
  };
8128
8214
  }
8129
- function jo(e, t, n, r) {
8215
+ function Mo(e, t, n, r) {
8130
8216
  let i = {}, a = /* @__PURE__ */ new WeakMap();
8131
8217
  function o(e) {
8132
8218
  let s = e.target;
@@ -8179,7 +8265,7 @@ function jo(e, t, n, r) {
8179
8265
  getWireframeAttribute: u
8180
8266
  };
8181
8267
  }
8182
- function Mo(e, t, n) {
8268
+ function No(e, t, n) {
8183
8269
  let r;
8184
8270
  function i(e) {
8185
8271
  r = e;
@@ -8214,7 +8300,7 @@ function Mo(e, t, n) {
8214
8300
  }
8215
8301
  this.setMode = i, this.setIndex = s, this.render = c, this.renderInstances = l, this.renderMultiDraw = u, this.renderMultiDrawInstances = d;
8216
8302
  }
8217
- function No(e) {
8303
+ function Po(e) {
8218
8304
  let t = {
8219
8305
  geometries: 0,
8220
8306
  textures: 0
@@ -8257,7 +8343,7 @@ function No(e) {
8257
8343
  update: r
8258
8344
  };
8259
8345
  }
8260
- function Po(e, t, n) {
8346
+ function Fo(e, t, n) {
8261
8347
  let r = /* @__PURE__ */ new WeakMap(), i = new Ae();
8262
8348
  function a(a, o, s) {
8263
8349
  let l = a.morphTargetInfluences, u = o.morphAttributes.position || o.morphAttributes.normal || o.morphAttributes.color, d = u === void 0 ? 0 : u.length, f = r.get(o);
@@ -8298,7 +8384,7 @@ function Po(e, t, n) {
8298
8384
  }
8299
8385
  return { update: a };
8300
8386
  }
8301
- function Fo(e, t, n, r) {
8387
+ function Io(e, t, n, r) {
8302
8388
  let i = /* @__PURE__ */ new WeakMap();
8303
8389
  function a(a) {
8304
8390
  let o = r.render.frame, c = a.geometry, l = t.get(a, c);
@@ -8320,322 +8406,322 @@ function Fo(e, t, n, r) {
8320
8406
  dispose: o
8321
8407
  };
8322
8408
  }
8323
- var Io = /*@__PURE__*/ new ke(), Lo = /*@__PURE__*/ new wr(1, 1), Ro = /*@__PURE__*/ new Ne(), zo = /*@__PURE__*/ new Pe(), Bo = /*@__PURE__*/ new Xn(), Vo = [], Ho = [], Uo = /* @__PURE__ */ new Float32Array(16), Wo = /* @__PURE__ */ new Float32Array(9), Go = /* @__PURE__ */ new Float32Array(4);
8324
- function Ko(e, t, n) {
8409
+ var Lo = /*@__PURE__*/ new ke(), Ro = /*@__PURE__*/ new wr(1, 1), zo = /*@__PURE__*/ new Ne(), Bo = /*@__PURE__*/ new Pe(), Vo = /*@__PURE__*/ new Xn(), Ho = [], Uo = [], Wo = /* @__PURE__ */ new Float32Array(16), Go = /* @__PURE__ */ new Float32Array(9), Ko = /* @__PURE__ */ new Float32Array(4);
8410
+ function qo(e, t, n) {
8325
8411
  let r = e[0];
8326
8412
  if (r <= 0 || r > 0) return e;
8327
- let i = t * n, a = Vo[i];
8328
- if (a === void 0 && (a = new Float32Array(i), Vo[i] = a), t !== 0) {
8413
+ let i = t * n, a = Ho[i];
8414
+ if (a === void 0 && (a = new Float32Array(i), Ho[i] = a), t !== 0) {
8329
8415
  r.toArray(a, 0);
8330
8416
  for (let r = 1, i = 0; r !== t; ++r) i += n, e[r].toArray(a, i);
8331
8417
  }
8332
8418
  return a;
8333
8419
  }
8334
- function qo(e, t) {
8420
+ function Jo(e, t) {
8335
8421
  if (e.length !== t.length) return !1;
8336
8422
  for (let n = 0, r = e.length; n < r; n++) if (e[n] !== t[n]) return !1;
8337
8423
  return !0;
8338
8424
  }
8339
- function Jo(e, t) {
8425
+ function Yo(e, t) {
8340
8426
  for (let n = 0, r = t.length; n < r; n++) e[n] = t[n];
8341
8427
  }
8342
- function Yo(e, t) {
8343
- let n = Ho[t];
8344
- n === void 0 && (n = new Int32Array(t), Ho[t] = n);
8428
+ function Xo(e, t) {
8429
+ let n = Uo[t];
8430
+ n === void 0 && (n = new Int32Array(t), Uo[t] = n);
8345
8431
  for (let r = 0; r !== t; ++r) n[r] = e.allocateTextureUnit();
8346
8432
  return n;
8347
8433
  }
8348
- function Xo(e, t) {
8434
+ function Zo(e, t) {
8349
8435
  let n = this.cache;
8350
8436
  n[0] !== t && (e.uniform1f(this.addr, t), n[0] = t);
8351
8437
  }
8352
- function Zo(e, t) {
8438
+ function Qo(e, t) {
8353
8439
  let n = this.cache;
8354
8440
  if (t.x !== void 0) (n[0] !== t.x || n[1] !== t.y) && (e.uniform2f(this.addr, t.x, t.y), n[0] = t.x, n[1] = t.y);
8355
8441
  else {
8356
- if (qo(n, t)) return;
8357
- e.uniform2fv(this.addr, t), Jo(n, t);
8442
+ if (Jo(n, t)) return;
8443
+ e.uniform2fv(this.addr, t), Yo(n, t);
8358
8444
  }
8359
8445
  }
8360
- function Qo(e, t) {
8446
+ function $o(e, t) {
8361
8447
  let n = this.cache;
8362
8448
  if (t.x !== void 0) (n[0] !== t.x || n[1] !== t.y || n[2] !== t.z) && (e.uniform3f(this.addr, t.x, t.y, t.z), n[0] = t.x, n[1] = t.y, n[2] = t.z);
8363
8449
  else if (t.r !== void 0) (n[0] !== t.r || n[1] !== t.g || n[2] !== t.b) && (e.uniform3f(this.addr, t.r, t.g, t.b), n[0] = t.r, n[1] = t.g, n[2] = t.b);
8364
8450
  else {
8365
- if (qo(n, t)) return;
8366
- e.uniform3fv(this.addr, t), Jo(n, t);
8451
+ if (Jo(n, t)) return;
8452
+ e.uniform3fv(this.addr, t), Yo(n, t);
8367
8453
  }
8368
8454
  }
8369
- function $o(e, t) {
8455
+ function es(e, t) {
8370
8456
  let n = this.cache;
8371
8457
  if (t.x !== void 0) (n[0] !== t.x || n[1] !== t.y || n[2] !== t.z || n[3] !== t.w) && (e.uniform4f(this.addr, t.x, t.y, t.z, t.w), n[0] = t.x, n[1] = t.y, n[2] = t.z, n[3] = t.w);
8372
8458
  else {
8373
- if (qo(n, t)) return;
8374
- e.uniform4fv(this.addr, t), Jo(n, t);
8459
+ if (Jo(n, t)) return;
8460
+ e.uniform4fv(this.addr, t), Yo(n, t);
8375
8461
  }
8376
8462
  }
8377
- function es(e, t) {
8463
+ function ts(e, t) {
8378
8464
  let n = this.cache, r = t.elements;
8379
8465
  if (r === void 0) {
8380
- if (qo(n, t)) return;
8381
- e.uniformMatrix2fv(this.addr, !1, t), Jo(n, t);
8466
+ if (Jo(n, t)) return;
8467
+ e.uniformMatrix2fv(this.addr, !1, t), Yo(n, t);
8382
8468
  } else {
8383
- if (qo(n, r)) return;
8384
- Go.set(r), e.uniformMatrix2fv(this.addr, !1, Go), Jo(n, r);
8469
+ if (Jo(n, r)) return;
8470
+ Ko.set(r), e.uniformMatrix2fv(this.addr, !1, Ko), Yo(n, r);
8385
8471
  }
8386
8472
  }
8387
- function ts(e, t) {
8473
+ function ns(e, t) {
8388
8474
  let n = this.cache, r = t.elements;
8389
8475
  if (r === void 0) {
8390
- if (qo(n, t)) return;
8391
- e.uniformMatrix3fv(this.addr, !1, t), Jo(n, t);
8476
+ if (Jo(n, t)) return;
8477
+ e.uniformMatrix3fv(this.addr, !1, t), Yo(n, t);
8392
8478
  } else {
8393
- if (qo(n, r)) return;
8394
- Wo.set(r), e.uniformMatrix3fv(this.addr, !1, Wo), Jo(n, r);
8479
+ if (Jo(n, r)) return;
8480
+ Go.set(r), e.uniformMatrix3fv(this.addr, !1, Go), Yo(n, r);
8395
8481
  }
8396
8482
  }
8397
- function ns(e, t) {
8483
+ function rs(e, t) {
8398
8484
  let n = this.cache, r = t.elements;
8399
8485
  if (r === void 0) {
8400
- if (qo(n, t)) return;
8401
- e.uniformMatrix4fv(this.addr, !1, t), Jo(n, t);
8486
+ if (Jo(n, t)) return;
8487
+ e.uniformMatrix4fv(this.addr, !1, t), Yo(n, t);
8402
8488
  } else {
8403
- if (qo(n, r)) return;
8404
- Uo.set(r), e.uniformMatrix4fv(this.addr, !1, Uo), Jo(n, r);
8489
+ if (Jo(n, r)) return;
8490
+ Wo.set(r), e.uniformMatrix4fv(this.addr, !1, Wo), Yo(n, r);
8405
8491
  }
8406
8492
  }
8407
- function rs(e, t) {
8493
+ function is(e, t) {
8408
8494
  let n = this.cache;
8409
8495
  n[0] !== t && (e.uniform1i(this.addr, t), n[0] = t);
8410
8496
  }
8411
- function is(e, t) {
8497
+ function as(e, t) {
8412
8498
  let n = this.cache;
8413
8499
  if (t.x !== void 0) (n[0] !== t.x || n[1] !== t.y) && (e.uniform2i(this.addr, t.x, t.y), n[0] = t.x, n[1] = t.y);
8414
8500
  else {
8415
- if (qo(n, t)) return;
8416
- e.uniform2iv(this.addr, t), Jo(n, t);
8501
+ if (Jo(n, t)) return;
8502
+ e.uniform2iv(this.addr, t), Yo(n, t);
8417
8503
  }
8418
8504
  }
8419
- function as(e, t) {
8505
+ function os(e, t) {
8420
8506
  let n = this.cache;
8421
8507
  if (t.x !== void 0) (n[0] !== t.x || n[1] !== t.y || n[2] !== t.z) && (e.uniform3i(this.addr, t.x, t.y, t.z), n[0] = t.x, n[1] = t.y, n[2] = t.z);
8422
8508
  else {
8423
- if (qo(n, t)) return;
8424
- e.uniform3iv(this.addr, t), Jo(n, t);
8509
+ if (Jo(n, t)) return;
8510
+ e.uniform3iv(this.addr, t), Yo(n, t);
8425
8511
  }
8426
8512
  }
8427
- function os(e, t) {
8513
+ function ss(e, t) {
8428
8514
  let n = this.cache;
8429
8515
  if (t.x !== void 0) (n[0] !== t.x || n[1] !== t.y || n[2] !== t.z || n[3] !== t.w) && (e.uniform4i(this.addr, t.x, t.y, t.z, t.w), n[0] = t.x, n[1] = t.y, n[2] = t.z, n[3] = t.w);
8430
8516
  else {
8431
- if (qo(n, t)) return;
8432
- e.uniform4iv(this.addr, t), Jo(n, t);
8517
+ if (Jo(n, t)) return;
8518
+ e.uniform4iv(this.addr, t), Yo(n, t);
8433
8519
  }
8434
8520
  }
8435
- function ss(e, t) {
8521
+ function cs(e, t) {
8436
8522
  let n = this.cache;
8437
8523
  n[0] !== t && (e.uniform1ui(this.addr, t), n[0] = t);
8438
8524
  }
8439
- function cs(e, t) {
8525
+ function ls(e, t) {
8440
8526
  let n = this.cache;
8441
8527
  if (t.x !== void 0) (n[0] !== t.x || n[1] !== t.y) && (e.uniform2ui(this.addr, t.x, t.y), n[0] = t.x, n[1] = t.y);
8442
8528
  else {
8443
- if (qo(n, t)) return;
8444
- e.uniform2uiv(this.addr, t), Jo(n, t);
8529
+ if (Jo(n, t)) return;
8530
+ e.uniform2uiv(this.addr, t), Yo(n, t);
8445
8531
  }
8446
8532
  }
8447
- function ls(e, t) {
8533
+ function us(e, t) {
8448
8534
  let n = this.cache;
8449
8535
  if (t.x !== void 0) (n[0] !== t.x || n[1] !== t.y || n[2] !== t.z) && (e.uniform3ui(this.addr, t.x, t.y, t.z), n[0] = t.x, n[1] = t.y, n[2] = t.z);
8450
8536
  else {
8451
- if (qo(n, t)) return;
8452
- e.uniform3uiv(this.addr, t), Jo(n, t);
8537
+ if (Jo(n, t)) return;
8538
+ e.uniform3uiv(this.addr, t), Yo(n, t);
8453
8539
  }
8454
8540
  }
8455
- function us(e, t) {
8541
+ function ds(e, t) {
8456
8542
  let n = this.cache;
8457
8543
  if (t.x !== void 0) (n[0] !== t.x || n[1] !== t.y || n[2] !== t.z || n[3] !== t.w) && (e.uniform4ui(this.addr, t.x, t.y, t.z, t.w), n[0] = t.x, n[1] = t.y, n[2] = t.z, n[3] = t.w);
8458
8544
  else {
8459
- if (qo(n, t)) return;
8460
- e.uniform4uiv(this.addr, t), Jo(n, t);
8545
+ if (Jo(n, t)) return;
8546
+ e.uniform4uiv(this.addr, t), Yo(n, t);
8461
8547
  }
8462
8548
  }
8463
- function ds(e, t, n) {
8549
+ function fs(e, t, n) {
8464
8550
  let r = this.cache, i = n.allocateTextureUnit();
8465
8551
  r[0] !== i && (e.uniform1i(this.addr, i), r[0] = i);
8466
8552
  let a;
8467
- this.type === e.SAMPLER_2D_SHADOW ? (Lo.compareFunction = 515, a = Lo) : a = Io, n.setTexture2D(t || a, i);
8468
- }
8469
- function fs(e, t, n) {
8470
- let r = this.cache, i = n.allocateTextureUnit();
8471
- r[0] !== i && (e.uniform1i(this.addr, i), r[0] = i), n.setTexture3D(t || zo, i);
8553
+ this.type === e.SAMPLER_2D_SHADOW ? (Ro.compareFunction = 515, a = Ro) : a = Lo, n.setTexture2D(t || a, i);
8472
8554
  }
8473
8555
  function ps(e, t, n) {
8474
8556
  let r = this.cache, i = n.allocateTextureUnit();
8475
- r[0] !== i && (e.uniform1i(this.addr, i), r[0] = i), n.setTextureCube(t || Bo, i);
8557
+ r[0] !== i && (e.uniform1i(this.addr, i), r[0] = i), n.setTexture3D(t || Bo, i);
8476
8558
  }
8477
8559
  function ms(e, t, n) {
8478
8560
  let r = this.cache, i = n.allocateTextureUnit();
8479
- r[0] !== i && (e.uniform1i(this.addr, i), r[0] = i), n.setTexture2DArray(t || Ro, i);
8561
+ r[0] !== i && (e.uniform1i(this.addr, i), r[0] = i), n.setTextureCube(t || Vo, i);
8562
+ }
8563
+ function hs(e, t, n) {
8564
+ let r = this.cache, i = n.allocateTextureUnit();
8565
+ r[0] !== i && (e.uniform1i(this.addr, i), r[0] = i), n.setTexture2DArray(t || zo, i);
8480
8566
  }
8481
- function hs(e) {
8567
+ function gs(e) {
8482
8568
  switch (e) {
8483
- case 5126: return Xo;
8484
- case 35664: return Zo;
8485
- case 35665: return Qo;
8486
- case 35666: return $o;
8487
- case 35674: return es;
8488
- case 35675: return ts;
8489
- case 35676: return ns;
8569
+ case 5126: return Zo;
8570
+ case 35664: return Qo;
8571
+ case 35665: return $o;
8572
+ case 35666: return es;
8573
+ case 35674: return ts;
8574
+ case 35675: return ns;
8575
+ case 35676: return rs;
8490
8576
  case 5124:
8491
- case 35670: return rs;
8577
+ case 35670: return is;
8492
8578
  case 35667:
8493
- case 35671: return is;
8579
+ case 35671: return as;
8494
8580
  case 35668:
8495
- case 35672: return as;
8581
+ case 35672: return os;
8496
8582
  case 35669:
8497
- case 35673: return os;
8498
- case 5125: return ss;
8499
- case 36294: return cs;
8500
- case 36295: return ls;
8501
- case 36296: return us;
8583
+ case 35673: return ss;
8584
+ case 5125: return cs;
8585
+ case 36294: return ls;
8586
+ case 36295: return us;
8587
+ case 36296: return ds;
8502
8588
  case 35678:
8503
8589
  case 36198:
8504
8590
  case 36298:
8505
8591
  case 36306:
8506
- case 35682: return ds;
8592
+ case 35682: return fs;
8507
8593
  case 35679:
8508
8594
  case 36299:
8509
- case 36307: return fs;
8595
+ case 36307: return ps;
8510
8596
  case 35680:
8511
8597
  case 36300:
8512
8598
  case 36308:
8513
- case 36293: return ps;
8599
+ case 36293: return ms;
8514
8600
  case 36289:
8515
8601
  case 36303:
8516
8602
  case 36311:
8517
- case 36292: return ms;
8603
+ case 36292: return hs;
8518
8604
  }
8519
8605
  }
8520
- function gs(e, t) {
8606
+ function _s(e, t) {
8521
8607
  e.uniform1fv(this.addr, t);
8522
8608
  }
8523
- function _s(e, t) {
8524
- let n = Ko(t, this.size, 2);
8609
+ function vs(e, t) {
8610
+ let n = qo(t, this.size, 2);
8525
8611
  e.uniform2fv(this.addr, n);
8526
8612
  }
8527
- function vs(e, t) {
8528
- let n = Ko(t, this.size, 3);
8613
+ function ys(e, t) {
8614
+ let n = qo(t, this.size, 3);
8529
8615
  e.uniform3fv(this.addr, n);
8530
8616
  }
8531
- function ys(e, t) {
8532
- let n = Ko(t, this.size, 4);
8617
+ function bs(e, t) {
8618
+ let n = qo(t, this.size, 4);
8533
8619
  e.uniform4fv(this.addr, n);
8534
8620
  }
8535
- function bs(e, t) {
8536
- let n = Ko(t, this.size, 4);
8621
+ function xs(e, t) {
8622
+ let n = qo(t, this.size, 4);
8537
8623
  e.uniformMatrix2fv(this.addr, !1, n);
8538
8624
  }
8539
- function xs(e, t) {
8540
- let n = Ko(t, this.size, 9);
8625
+ function Ss(e, t) {
8626
+ let n = qo(t, this.size, 9);
8541
8627
  e.uniformMatrix3fv(this.addr, !1, n);
8542
8628
  }
8543
- function Ss(e, t) {
8544
- let n = Ko(t, this.size, 16);
8629
+ function Cs(e, t) {
8630
+ let n = qo(t, this.size, 16);
8545
8631
  e.uniformMatrix4fv(this.addr, !1, n);
8546
8632
  }
8547
- function Cs(e, t) {
8633
+ function ws(e, t) {
8548
8634
  e.uniform1iv(this.addr, t);
8549
8635
  }
8550
- function ws(e, t) {
8636
+ function Ts(e, t) {
8551
8637
  e.uniform2iv(this.addr, t);
8552
8638
  }
8553
- function Ts(e, t) {
8639
+ function Es(e, t) {
8554
8640
  e.uniform3iv(this.addr, t);
8555
8641
  }
8556
- function Es(e, t) {
8642
+ function Ds(e, t) {
8557
8643
  e.uniform4iv(this.addr, t);
8558
8644
  }
8559
- function Ds(e, t) {
8645
+ function Os(e, t) {
8560
8646
  e.uniform1uiv(this.addr, t);
8561
8647
  }
8562
- function Os(e, t) {
8648
+ function ks(e, t) {
8563
8649
  e.uniform2uiv(this.addr, t);
8564
8650
  }
8565
- function ks(e, t) {
8651
+ function As(e, t) {
8566
8652
  e.uniform3uiv(this.addr, t);
8567
8653
  }
8568
- function As(e, t) {
8654
+ function js(e, t) {
8569
8655
  e.uniform4uiv(this.addr, t);
8570
8656
  }
8571
- function js(e, t, n) {
8572
- let r = this.cache, i = t.length, a = Yo(n, i);
8573
- qo(r, a) || (e.uniform1iv(this.addr, a), Jo(r, a));
8574
- for (let e = 0; e !== i; ++e) n.setTexture2D(t[e] || Io, a[e]);
8575
- }
8576
8657
  function Ms(e, t, n) {
8577
- let r = this.cache, i = t.length, a = Yo(n, i);
8578
- qo(r, a) || (e.uniform1iv(this.addr, a), Jo(r, a));
8579
- for (let e = 0; e !== i; ++e) n.setTexture3D(t[e] || zo, a[e]);
8658
+ let r = this.cache, i = t.length, a = Xo(n, i);
8659
+ Jo(r, a) || (e.uniform1iv(this.addr, a), Yo(r, a));
8660
+ for (let e = 0; e !== i; ++e) n.setTexture2D(t[e] || Lo, a[e]);
8580
8661
  }
8581
8662
  function Ns(e, t, n) {
8582
- let r = this.cache, i = t.length, a = Yo(n, i);
8583
- qo(r, a) || (e.uniform1iv(this.addr, a), Jo(r, a));
8584
- for (let e = 0; e !== i; ++e) n.setTextureCube(t[e] || Bo, a[e]);
8663
+ let r = this.cache, i = t.length, a = Xo(n, i);
8664
+ Jo(r, a) || (e.uniform1iv(this.addr, a), Yo(r, a));
8665
+ for (let e = 0; e !== i; ++e) n.setTexture3D(t[e] || Bo, a[e]);
8585
8666
  }
8586
8667
  function Ps(e, t, n) {
8587
- let r = this.cache, i = t.length, a = Yo(n, i);
8588
- qo(r, a) || (e.uniform1iv(this.addr, a), Jo(r, a));
8589
- for (let e = 0; e !== i; ++e) n.setTexture2DArray(t[e] || Ro, a[e]);
8668
+ let r = this.cache, i = t.length, a = Xo(n, i);
8669
+ Jo(r, a) || (e.uniform1iv(this.addr, a), Yo(r, a));
8670
+ for (let e = 0; e !== i; ++e) n.setTextureCube(t[e] || Vo, a[e]);
8590
8671
  }
8591
- function Fs(e) {
8672
+ function Fs(e, t, n) {
8673
+ let r = this.cache, i = t.length, a = Xo(n, i);
8674
+ Jo(r, a) || (e.uniform1iv(this.addr, a), Yo(r, a));
8675
+ for (let e = 0; e !== i; ++e) n.setTexture2DArray(t[e] || zo, a[e]);
8676
+ }
8677
+ function Is(e) {
8592
8678
  switch (e) {
8593
- case 5126: return gs;
8594
- case 35664: return _s;
8595
- case 35665: return vs;
8596
- case 35666: return ys;
8597
- case 35674: return bs;
8598
- case 35675: return xs;
8599
- case 35676: return Ss;
8679
+ case 5126: return _s;
8680
+ case 35664: return vs;
8681
+ case 35665: return ys;
8682
+ case 35666: return bs;
8683
+ case 35674: return xs;
8684
+ case 35675: return Ss;
8685
+ case 35676: return Cs;
8600
8686
  case 5124:
8601
- case 35670: return Cs;
8687
+ case 35670: return ws;
8602
8688
  case 35667:
8603
- case 35671: return ws;
8689
+ case 35671: return Ts;
8604
8690
  case 35668:
8605
- case 35672: return Ts;
8691
+ case 35672: return Es;
8606
8692
  case 35669:
8607
- case 35673: return Es;
8608
- case 5125: return Ds;
8609
- case 36294: return Os;
8610
- case 36295: return ks;
8611
- case 36296: return As;
8693
+ case 35673: return Ds;
8694
+ case 5125: return Os;
8695
+ case 36294: return ks;
8696
+ case 36295: return As;
8697
+ case 36296: return js;
8612
8698
  case 35678:
8613
8699
  case 36198:
8614
8700
  case 36298:
8615
8701
  case 36306:
8616
- case 35682: return js;
8702
+ case 35682: return Ms;
8617
8703
  case 35679:
8618
8704
  case 36299:
8619
- case 36307: return Ms;
8705
+ case 36307: return Ns;
8620
8706
  case 35680:
8621
8707
  case 36300:
8622
8708
  case 36308:
8623
- case 36293: return Ns;
8709
+ case 36293: return Ps;
8624
8710
  case 36289:
8625
8711
  case 36303:
8626
8712
  case 36311:
8627
- case 36292: return Ps;
8713
+ case 36292: return Fs;
8628
8714
  }
8629
8715
  }
8630
- var Is = class {
8716
+ var Ls = class {
8631
8717
  constructor(e, t, n) {
8632
- this.id = e, this.addr = n, this.cache = [], this.type = t.type, this.setValue = hs(t.type);
8718
+ this.id = e, this.addr = n, this.cache = [], this.type = t.type, this.setValue = gs(t.type);
8633
8719
  }
8634
- }, Ls = class {
8720
+ }, Rs = class {
8635
8721
  constructor(e, t, n) {
8636
- this.id = e, this.addr = n, this.cache = [], this.type = t.type, this.size = t.size, this.setValue = Fs(t.type);
8722
+ this.id = e, this.addr = n, this.cache = [], this.type = t.type, this.size = t.size, this.setValue = Is(t.type);
8637
8723
  }
8638
- }, Rs = class {
8724
+ }, zs = class {
8639
8725
  constructor(e) {
8640
8726
  this.id = e, this.seq = [], this.map = {};
8641
8727
  }
@@ -8646,31 +8732,31 @@ var Is = class {
8646
8732
  a.setValue(e, t[a.id], n);
8647
8733
  }
8648
8734
  }
8649
- }, zs = /(\w+)(\])?(\[|\.)?/g;
8650
- function Bs(e, t) {
8735
+ }, Bs = /(\w+)(\])?(\[|\.)?/g;
8736
+ function Vs(e, t) {
8651
8737
  e.seq.push(t), e.map[t.id] = t;
8652
8738
  }
8653
- function Vs(e, t, n) {
8739
+ function Hs(e, t, n) {
8654
8740
  let r = e.name, i = r.length;
8655
- for (zs.lastIndex = 0;;) {
8656
- let a = zs.exec(r), o = zs.lastIndex, s = a[1], c = a[2] === "]", l = a[3];
8741
+ for (Bs.lastIndex = 0;;) {
8742
+ let a = Bs.exec(r), o = Bs.lastIndex, s = a[1], c = a[2] === "]", l = a[3];
8657
8743
  if (c && (s |= 0), l === void 0 || l === "[" && o + 2 === i) {
8658
- Bs(n, l === void 0 ? new Is(s, e, t) : new Ls(s, e, t));
8744
+ Vs(n, l === void 0 ? new Ls(s, e, t) : new Rs(s, e, t));
8659
8745
  break;
8660
8746
  }
8661
8747
  {
8662
8748
  let e = n.map[s];
8663
- e === void 0 && (e = new Rs(s), Bs(n, e)), n = e;
8749
+ e === void 0 && (e = new zs(s), Vs(n, e)), n = e;
8664
8750
  }
8665
8751
  }
8666
8752
  }
8667
- var Hs = class {
8753
+ var Us = class {
8668
8754
  constructor(e, t) {
8669
8755
  this.seq = [], this.map = {};
8670
8756
  let n = e.getProgramParameter(t, e.ACTIVE_UNIFORMS);
8671
8757
  for (let r = 0; r < n; ++r) {
8672
8758
  let n = e.getActiveUniform(t, r);
8673
- Vs(n, e.getUniformLocation(t, n.name), this);
8759
+ Hs(n, e.getUniformLocation(t, n.name), this);
8674
8760
  }
8675
8761
  }
8676
8762
  setValue(e, t, n, r) {
@@ -8696,12 +8782,12 @@ var Hs = class {
8696
8782
  return n;
8697
8783
  }
8698
8784
  };
8699
- function Us(e, t, n) {
8785
+ function Ws(e, t, n) {
8700
8786
  let r = e.createShader(t);
8701
8787
  return e.shaderSource(r, n), e.compileShader(r), r;
8702
8788
  }
8703
- var Ws = 37297, Gs = 0;
8704
- function Ks(e, t) {
8789
+ var Gs = 37297, Ks = 0;
8790
+ function qs(e, t) {
8705
8791
  let n = e.split("\n"), r = [], i = Math.max(t - 6, 0), a = Math.min(t + 6, n.length);
8706
8792
  for (let e = i; e < a; e++) {
8707
8793
  let i = e + 1;
@@ -8709,35 +8795,35 @@ function Ks(e, t) {
8709
8795
  }
8710
8796
  return r.join("\n");
8711
8797
  }
8712
- var qs = /*@__PURE__*/ new G();
8713
- function Js(e) {
8714
- Y._getMatrix(qs, Y.workingColorSpace, e);
8715
- let t = `mat3( ${qs.elements.map((e) => e.toFixed(4))} )`;
8798
+ var Js = /*@__PURE__*/ new G();
8799
+ function Ys(e) {
8800
+ Y._getMatrix(Js, Y.workingColorSpace, e);
8801
+ let t = `mat3( ${Js.elements.map((e) => e.toFixed(4))} )`;
8716
8802
  switch (Y.getTransfer(e)) {
8717
8803
  case x: return [t, "LinearTransferOETF"];
8718
8804
  case S: return [t, "sRGBTransferOETF"];
8719
8805
  default: return console.warn("THREE.WebGLProgram: Unsupported color space: ", e), [t, "LinearTransferOETF"];
8720
8806
  }
8721
8807
  }
8722
- function Ys(e, t, n) {
8808
+ function Xs(e, t, n) {
8723
8809
  let r = e.getShaderParameter(t, e.COMPILE_STATUS), i = (e.getShaderInfoLog(t) || "").trim();
8724
8810
  if (r && i === "") return "";
8725
8811
  let a = /ERROR: 0:(\d+)/.exec(i);
8726
8812
  if (a) {
8727
8813
  let r = parseInt(a[1]);
8728
- return n.toUpperCase() + "\n\n" + i + "\n\n" + Ks(e.getShaderSource(t), r);
8814
+ return n.toUpperCase() + "\n\n" + i + "\n\n" + qs(e.getShaderSource(t), r);
8729
8815
  }
8730
8816
  return i;
8731
8817
  }
8732
- function Xs(e, t) {
8733
- let n = Js(t);
8818
+ function Zs(e, t) {
8819
+ let n = Ys(t);
8734
8820
  return [
8735
8821
  `vec4 ${e}( vec4 value ) {`,
8736
8822
  ` return ${n[1]}( vec4( value.rgb * ${n[0]}, value.a ) );`,
8737
8823
  "}"
8738
8824
  ].join("\n");
8739
8825
  }
8740
- function Zs(e, t) {
8826
+ function Qs(e, t) {
8741
8827
  let n;
8742
8828
  switch (t) {
8743
8829
  case 1:
@@ -8765,19 +8851,19 @@ function Zs(e, t) {
8765
8851
  }
8766
8852
  return "vec3 " + e + "( vec3 color ) { return " + n + "ToneMapping( color ); }";
8767
8853
  }
8768
- var Qs = /*@__PURE__*/ new U();
8769
- function $s() {
8770
- return Y.getLuminanceCoefficients(Qs), [
8854
+ var $s = /*@__PURE__*/ new U();
8855
+ function ec() {
8856
+ return Y.getLuminanceCoefficients($s), [
8771
8857
  "float luminance( const in vec3 rgb ) {",
8772
- ` const vec3 weights = vec3( ${Qs.x.toFixed(4)}, ${Qs.y.toFixed(4)}, ${Qs.z.toFixed(4)} );`,
8858
+ ` const vec3 weights = vec3( ${$s.x.toFixed(4)}, ${$s.y.toFixed(4)}, ${$s.z.toFixed(4)} );`,
8773
8859
  " return dot( weights, rgb );",
8774
8860
  "}"
8775
8861
  ].join("\n");
8776
8862
  }
8777
- function ec(e) {
8778
- return [e.extensionClipCullDistance ? "#extension GL_ANGLE_clip_cull_distance : require" : "", e.extensionMultiDraw ? "#extension GL_ANGLE_multi_draw : require" : ""].filter(rc).join("\n");
8779
- }
8780
8863
  function tc(e) {
8864
+ return [e.extensionClipCullDistance ? "#extension GL_ANGLE_clip_cull_distance : require" : "", e.extensionMultiDraw ? "#extension GL_ANGLE_multi_draw : require" : ""].filter(ic).join("\n");
8865
+ }
8866
+ function nc(e) {
8781
8867
  let t = [];
8782
8868
  for (let n in e) {
8783
8869
  let r = e[n];
@@ -8785,7 +8871,7 @@ function tc(e) {
8785
8871
  }
8786
8872
  return t.join("\n");
8787
8873
  }
8788
- function nc(e, t) {
8874
+ function rc(e, t) {
8789
8875
  let n = {}, r = e.getProgramParameter(t, e.ACTIVE_ATTRIBUTES);
8790
8876
  for (let i = 0; i < r; i++) {
8791
8877
  let r = e.getActiveAttrib(t, i), a = r.name, o = 1;
@@ -8797,40 +8883,40 @@ function nc(e, t) {
8797
8883
  }
8798
8884
  return n;
8799
8885
  }
8800
- function rc(e) {
8886
+ function ic(e) {
8801
8887
  return e !== "";
8802
8888
  }
8803
- function ic(e, t) {
8889
+ function ac(e, t) {
8804
8890
  let n = t.numSpotLightShadows + t.numSpotLightMaps - t.numSpotLightShadowsWithMaps;
8805
8891
  return e.replace(/NUM_DIR_LIGHTS/g, t.numDirLights).replace(/NUM_SPOT_LIGHTS/g, t.numSpotLights).replace(/NUM_SPOT_LIGHT_MAPS/g, t.numSpotLightMaps).replace(/NUM_SPOT_LIGHT_COORDS/g, n).replace(/NUM_RECT_AREA_LIGHTS/g, t.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g, t.numPointLights).replace(/NUM_HEMI_LIGHTS/g, t.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g, t.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g, t.numSpotLightShadowsWithMaps).replace(/NUM_SPOT_LIGHT_SHADOWS/g, t.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g, t.numPointLightShadows);
8806
8892
  }
8807
- function ac(e, t) {
8893
+ function oc(e, t) {
8808
8894
  return e.replace(/NUM_CLIPPING_PLANES/g, t.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g, t.numClippingPlanes - t.numClipIntersection);
8809
8895
  }
8810
- var oc = /^[ \t]*#include +<([\w\d./]+)>/gm;
8811
- function sc(e) {
8812
- return e.replace(oc, lc);
8896
+ var sc = /^[ \t]*#include +<([\w\d./]+)>/gm;
8897
+ function cc(e) {
8898
+ return e.replace(sc, uc);
8813
8899
  }
8814
- var cc = /* @__PURE__ */ new Map();
8815
- function lc(e, t) {
8900
+ var lc = /* @__PURE__ */ new Map();
8901
+ function uc(e, t) {
8816
8902
  let n = Q[t];
8817
8903
  if (n === void 0) {
8818
- let e = cc.get(t);
8904
+ let e = lc.get(t);
8819
8905
  if (e !== void 0) n = Q[e], console.warn("THREE.WebGLRenderer: Shader chunk \"%s\" has been deprecated. Use \"%s\" instead.", t, e);
8820
8906
  else throw Error("Can not resolve #include <" + t + ">");
8821
8907
  }
8822
- return sc(n);
8908
+ return cc(n);
8823
8909
  }
8824
- var uc = /#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;
8825
- function dc(e) {
8826
- return e.replace(uc, fc);
8910
+ var dc = /#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;
8911
+ function fc(e) {
8912
+ return e.replace(dc, pc);
8827
8913
  }
8828
- function fc(e, t, n, r) {
8914
+ function pc(e, t, n, r) {
8829
8915
  let i = "";
8830
8916
  for (let e = parseInt(t); e < parseInt(n); e++) i += r.replace(/\[\s*i\s*\]/g, "[ " + e + " ]").replace(/UNROLLED_LOOP_INDEX/g, e);
8831
8917
  return i;
8832
8918
  }
8833
- function pc(e) {
8919
+ function mc(e) {
8834
8920
  let t = `precision ${e.precision} float;
8835
8921
  precision ${e.precision} int;
8836
8922
  precision ${e.precision} sampler2D;
@@ -8851,11 +8937,11 @@ function pc(e) {
8851
8937
  `;
8852
8938
  return e.precision === "highp" ? t += "\n#define HIGH_PRECISION" : e.precision === "mediump" ? t += "\n#define MEDIUM_PRECISION" : e.precision === "lowp" && (t += "\n#define LOW_PRECISION"), t;
8853
8939
  }
8854
- function mc(e) {
8940
+ function hc(e) {
8855
8941
  let t = "SHADOWMAP_TYPE_BASIC";
8856
8942
  return e.shadowMapType === 1 ? t = "SHADOWMAP_TYPE_PCF" : e.shadowMapType === 2 ? t = "SHADOWMAP_TYPE_PCF_SOFT" : e.shadowMapType === 3 && (t = "SHADOWMAP_TYPE_VSM"), t;
8857
8943
  }
8858
- function hc(e) {
8944
+ function gc(e) {
8859
8945
  let t = "ENVMAP_TYPE_CUBE";
8860
8946
  if (e.envMap) switch (e.envMapMode) {
8861
8947
  case 301:
@@ -8866,14 +8952,14 @@ function hc(e) {
8866
8952
  }
8867
8953
  return t;
8868
8954
  }
8869
- function gc(e) {
8955
+ function _c(e) {
8870
8956
  let t = "ENVMAP_MODE_REFLECTION";
8871
8957
  if (e.envMap) switch (e.envMapMode) {
8872
8958
  case 302: t = "ENVMAP_MODE_REFRACTION";
8873
8959
  }
8874
8960
  return t;
8875
8961
  }
8876
- function _c(e) {
8962
+ function vc(e) {
8877
8963
  let t = "ENVMAP_BLENDING_NONE";
8878
8964
  if (e.envMap) switch (e.combine) {
8879
8965
  case 0:
@@ -8886,7 +8972,7 @@ function _c(e) {
8886
8972
  }
8887
8973
  return t;
8888
8974
  }
8889
- function vc(e) {
8975
+ function yc(e) {
8890
8976
  let t = e.envMapCubeUVHeight;
8891
8977
  if (t === null) return null;
8892
8978
  let n = Math.log2(t) - 2, r = 1 / t;
@@ -8896,18 +8982,18 @@ function vc(e) {
8896
8982
  maxMip: n
8897
8983
  };
8898
8984
  }
8899
- function yc(e, t, n, r) {
8900
- let i = e.getContext(), a = n.defines, o = n.vertexShader, s = n.fragmentShader, c = mc(n), l = hc(n), u = gc(n), d = _c(n), f = vc(n), p = ec(n), m = tc(a), h = i.createProgram(), g, _, v = n.glslVersion ? "#version " + n.glslVersion + "\n" : "";
8985
+ function bc(e, t, n, r) {
8986
+ let i = e.getContext(), a = n.defines, o = n.vertexShader, s = n.fragmentShader, c = hc(n), l = gc(n), u = _c(n), d = vc(n), f = yc(n), p = tc(n), m = nc(a), h = i.createProgram(), g, _, v = n.glslVersion ? "#version " + n.glslVersion + "\n" : "";
8901
8987
  n.isRawShaderMaterial ? (g = [
8902
8988
  "#define SHADER_TYPE " + n.shaderType,
8903
8989
  "#define SHADER_NAME " + n.shaderName,
8904
8990
  m
8905
- ].filter(rc).join("\n"), g.length > 0 && (g += "\n"), _ = [
8991
+ ].filter(ic).join("\n"), g.length > 0 && (g += "\n"), _ = [
8906
8992
  "#define SHADER_TYPE " + n.shaderType,
8907
8993
  "#define SHADER_NAME " + n.shaderName,
8908
8994
  m
8909
- ].filter(rc).join("\n"), _.length > 0 && (_ += "\n")) : (g = [
8910
- pc(n),
8995
+ ].filter(ic).join("\n"), _.length > 0 && (_ += "\n")) : (g = [
8996
+ mc(n),
8911
8997
  "#define SHADER_TYPE " + n.shaderType,
8912
8998
  "#define SHADER_NAME " + n.shaderName,
8913
8999
  m,
@@ -9035,8 +9121,8 @@ function yc(e, t, n, r) {
9035
9121
  " attribute vec4 skinWeight;",
9036
9122
  "#endif",
9037
9123
  "\n"
9038
- ].filter(rc).join("\n"), _ = [
9039
- pc(n),
9124
+ ].filter(ic).join("\n"), _ = [
9125
+ mc(n),
9040
9126
  "#define SHADER_TYPE " + n.shaderType,
9041
9127
  "#define SHADER_NAME " + n.shaderName,
9042
9128
  m,
@@ -9107,15 +9193,15 @@ function yc(e, t, n, r) {
9107
9193
  "uniform bool isOrthographic;",
9108
9194
  n.toneMapping === 0 ? "" : "#define TONE_MAPPING",
9109
9195
  n.toneMapping === 0 ? "" : Q.tonemapping_pars_fragment,
9110
- n.toneMapping === 0 ? "" : Zs("toneMapping", n.toneMapping),
9196
+ n.toneMapping === 0 ? "" : Qs("toneMapping", n.toneMapping),
9111
9197
  n.dithering ? "#define DITHERING" : "",
9112
9198
  n.opaque ? "#define OPAQUE" : "",
9113
9199
  Q.colorspace_pars_fragment,
9114
- Xs("linearToOutputTexel", n.outputColorSpace),
9115
- $s(),
9200
+ Zs("linearToOutputTexel", n.outputColorSpace),
9201
+ ec(),
9116
9202
  n.useDepthPacking ? "#define DEPTH_PACKING " + n.depthPacking : "",
9117
9203
  "\n"
9118
- ].filter(rc).join("\n")), o = sc(o), o = ic(o, n), o = ac(o, n), s = sc(s), s = ic(s, n), s = ac(s, n), o = dc(o), s = dc(s), n.isRawShaderMaterial !== !0 && (v = "#version 300 es\n", g = [
9204
+ ].filter(ic).join("\n")), o = cc(o), o = ac(o, n), o = oc(o, n), s = cc(s), s = ac(s, n), s = oc(s, n), o = fc(o), s = fc(s), n.isRawShaderMaterial !== !0 && (v = "#version 300 es\n", g = [
9119
9205
  p,
9120
9206
  "#define attribute in",
9121
9207
  "#define varying out",
@@ -9135,7 +9221,7 @@ function yc(e, t, n, r) {
9135
9221
  "#define texture2DProjGradEXT textureProjGrad",
9136
9222
  "#define textureCubeGradEXT textureGrad"
9137
9223
  ].join("\n") + "\n" + _);
9138
- let y = v + g + o, b = v + _ + s, x = Us(i, i.VERTEX_SHADER, y), S = Us(i, i.FRAGMENT_SHADER, b);
9224
+ let y = v + g + o, b = v + _ + s, x = Ws(i, i.VERTEX_SHADER, y), S = Ws(i, i.FRAGMENT_SHADER, b);
9139
9225
  i.attachShader(h, x), i.attachShader(h, S), n.index0AttributeName === void 0 ? n.morphTargets === !0 && i.bindAttribLocation(h, 0, "position") : i.bindAttribLocation(h, 0, n.index0AttributeName), i.linkProgram(h);
9140
9226
  function C(t) {
9141
9227
  if (e.debug.checkShaderErrors) {
@@ -9143,7 +9229,7 @@ function yc(e, t, n, r) {
9143
9229
  if (i.getProgramParameter(h, i.LINK_STATUS) === !1) {
9144
9230
  if (l = !1, typeof e.debug.onShaderError == "function") e.debug.onShaderError(i, h, x, S);
9145
9231
  else {
9146
- let e = Ys(i, x, "vertex"), n = Ys(i, S, "fragment");
9232
+ let e = Xs(i, x, "vertex"), n = Xs(i, S, "fragment");
9147
9233
  console.error("THREE.WebGLProgram: Shader Error " + i.getError() + " - VALIDATE_STATUS " + i.getProgramParameter(h, i.VALIDATE_STATUS) + "\n\nMaterial Name: " + t.name + "\nMaterial Type: " + t.type + "\n\nProgram Info Log: " + o + "\n" + e + "\n" + n);
9148
9234
  }
9149
9235
  } else o === "" ? (s === "" || c === "") && (u = !1) : console.warn("THREE.WebGLProgram: Program Info Log:", o);
@@ -9160,7 +9246,7 @@ function yc(e, t, n, r) {
9160
9246
  }
9161
9247
  });
9162
9248
  }
9163
- i.deleteShader(x), i.deleteShader(S), w = new Hs(i, h), T = nc(i, h);
9249
+ i.deleteShader(x), i.deleteShader(S), w = new Us(i, h), T = rc(i, h);
9164
9250
  }
9165
9251
  let w;
9166
9252
  this.getUniforms = function() {
@@ -9172,12 +9258,12 @@ function yc(e, t, n, r) {
9172
9258
  };
9173
9259
  let E = n.rendererExtensionParallelShaderCompile === !1;
9174
9260
  return this.isReady = function() {
9175
- return E === !1 && (E = i.getProgramParameter(h, Ws)), E;
9261
+ return E === !1 && (E = i.getProgramParameter(h, Gs)), E;
9176
9262
  }, this.destroy = function() {
9177
9263
  r.releaseStatesOfProgram(this), i.deleteProgram(h), this.program = void 0;
9178
- }, this.type = n.shaderType, this.name = n.shaderName, this.id = Gs++, this.cacheKey = t, this.usedTimes = 1, this.program = h, this.vertexShader = x, this.fragmentShader = S, this;
9264
+ }, this.type = n.shaderType, this.name = n.shaderName, this.id = Ks++, this.cacheKey = t, this.usedTimes = 1, this.program = h, this.vertexShader = x, this.fragmentShader = S, this;
9179
9265
  }
9180
- var bc = 0, xc = class {
9266
+ var xc = 0, Sc = class {
9181
9267
  constructor() {
9182
9268
  this.shaderCache = /* @__PURE__ */ new Map(), this.materialCache = /* @__PURE__ */ new Map();
9183
9269
  }
@@ -9205,15 +9291,15 @@ var bc = 0, xc = class {
9205
9291
  }
9206
9292
  _getShaderStage(e) {
9207
9293
  let t = this.shaderCache, n = t.get(e);
9208
- return n === void 0 && (n = new Sc(e), t.set(e, n)), n;
9294
+ return n === void 0 && (n = new Cc(e), t.set(e, n)), n;
9209
9295
  }
9210
- }, Sc = class {
9296
+ }, Cc = class {
9211
9297
  constructor(e) {
9212
- this.id = bc++, this.code = e, this.usedTimes = 0;
9298
+ this.id = xc++, this.code = e, this.usedTimes = 0;
9213
9299
  }
9214
9300
  };
9215
- function Cc(e, t, n, r, i, a, o) {
9216
- let s = new yt(), c = new xc(), l = /* @__PURE__ */ new Set(), u = [], d = i.logarithmicDepthBuffer, f = i.vertexTextures, p = i.precision, m = {
9301
+ function wc(e, t, n, r, i, a, o) {
9302
+ let s = new yt(), c = new Sc(), l = /* @__PURE__ */ new Set(), u = [], d = i.logarithmicDepthBuffer, f = i.vertexTextures, p = i.precision, m = {
9217
9303
  MeshDepthMaterial: "depth",
9218
9304
  MeshDistanceMaterial: "distanceRGBA",
9219
9305
  MeshNormalMaterial: "normal",
@@ -9240,7 +9326,7 @@ function Cc(e, t, n, r, i, a, o) {
9240
9326
  y.morphAttributes.position !== void 0 && (D = 1), y.morphAttributes.normal !== void 0 && (D = 2), y.morphAttributes.color !== void 0 && (D = 3);
9241
9327
  let O, k, A, j;
9242
9328
  if (w) {
9243
- let e = Za[w];
9329
+ let e = Qa[w];
9244
9330
  O = e.vertexShader, k = e.fragmentShader;
9245
9331
  } else O = a.vertexShader, k = a.fragmentShader, c.update(a), A = c.getVertexShaderID(a), j = c.getFragmentShaderID(a);
9246
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, ie = !!a.normalMap, R = !!a.displacementMap, z = !!a.emissiveMap, ae = !!a.metalnessMap, oe = !!a.roughnessMap, se = a.anisotropy > 0, ce = a.clearcoat > 0, le = a.dispersion > 0, B = a.iridescence > 0, ue = a.sheen > 0, de = a.transmission > 0, V = se && !!a.anisotropyMap, H = ce && !!a.clearcoatMap, U = ce && !!a.clearcoatNormalMap, fe = ce && !!a.clearcoatRoughnessMap, W = B && !!a.iridescenceMap, G = B && !!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;
@@ -9391,7 +9477,7 @@ function Cc(e, t, n, r, i, a, o) {
9391
9477
  function x(e) {
9392
9478
  let t = m[e.type], n;
9393
9479
  if (t) {
9394
- let e = Za[t];
9480
+ let e = Qa[t];
9395
9481
  n = Rn.clone(e.uniforms);
9396
9482
  } else n = e.uniforms;
9397
9483
  return n;
@@ -9405,7 +9491,7 @@ function Cc(e, t, n, r, i, a, o) {
9405
9491
  break;
9406
9492
  }
9407
9493
  }
9408
- return r === void 0 && (r = new yc(e, n, t, a), u.push(r)), r;
9494
+ return r === void 0 && (r = new bc(e, n, t, a), u.push(r)), r;
9409
9495
  }
9410
9496
  function C(e) {
9411
9497
  if (--e.usedTimes === 0) {
@@ -9430,7 +9516,7 @@ function Cc(e, t, n, r, i, a, o) {
9430
9516
  dispose: T
9431
9517
  };
9432
9518
  }
9433
- function wc() {
9519
+ function Tc() {
9434
9520
  let e = /* @__PURE__ */ new WeakMap();
9435
9521
  function t(t) {
9436
9522
  return e.has(t);
@@ -9456,13 +9542,13 @@ function wc() {
9456
9542
  dispose: a
9457
9543
  };
9458
9544
  }
9459
- function Tc(e, t) {
9545
+ function Ec(e, t) {
9460
9546
  return e.groupOrder === t.groupOrder ? e.renderOrder === t.renderOrder ? e.material.id === t.material.id ? e.z === t.z ? e.id - t.id : e.z - t.z : e.material.id - t.material.id : e.renderOrder - t.renderOrder : e.groupOrder - t.groupOrder;
9461
9547
  }
9462
- function Ec(e, t) {
9548
+ function Dc(e, t) {
9463
9549
  return e.groupOrder === t.groupOrder ? e.renderOrder === t.renderOrder ? e.z === t.z ? e.id - t.id : t.z - e.z : e.renderOrder - t.renderOrder : e.groupOrder - t.groupOrder;
9464
9550
  }
9465
- function Dc() {
9551
+ function Oc() {
9466
9552
  let e = [], t = 0, n = [], r = [], i = [];
9467
9553
  function a() {
9468
9554
  t = 0, n.length = 0, r.length = 0, i.length = 0;
@@ -9489,7 +9575,7 @@ function Dc() {
9489
9575
  a.transmission > 0 ? r.unshift(u) : a.transparent === !0 ? i.unshift(u) : n.unshift(u);
9490
9576
  }
9491
9577
  function l(e, t) {
9492
- n.length > 1 && n.sort(e || Tc), r.length > 1 && r.sort(t || Ec), i.length > 1 && i.sort(t || Ec);
9578
+ n.length > 1 && n.sort(e || Ec), r.length > 1 && r.sort(t || Dc), i.length > 1 && i.sort(t || Dc);
9493
9579
  }
9494
9580
  function u() {
9495
9581
  for (let n = t, r = e.length; n < r; n++) {
@@ -9509,11 +9595,11 @@ function Dc() {
9509
9595
  sort: l
9510
9596
  };
9511
9597
  }
9512
- function Oc() {
9598
+ function kc() {
9513
9599
  let e = /* @__PURE__ */ new WeakMap();
9514
9600
  function t(t, n) {
9515
9601
  let r = e.get(t), i;
9516
- return r === void 0 ? (i = new Dc(), e.set(t, [i])) : n >= r.length ? (i = new Dc(), r.push(i)) : i = r[n], i;
9602
+ return r === void 0 ? (i = new Oc(), e.set(t, [i])) : n >= r.length ? (i = new Oc(), r.push(i)) : i = r[n], i;
9517
9603
  }
9518
9604
  function n() {
9519
9605
  e = /* @__PURE__ */ new WeakMap();
@@ -9523,7 +9609,7 @@ function Oc() {
9523
9609
  dispose: n
9524
9610
  };
9525
9611
  }
9526
- function kc() {
9612
+ function Ac() {
9527
9613
  let e = {};
9528
9614
  return { get: function(t) {
9529
9615
  if (e[t.id] !== void 0) return e[t.id];
@@ -9571,7 +9657,7 @@ function kc() {
9571
9657
  return e[t.id] = n, n;
9572
9658
  } };
9573
9659
  }
9574
- function Ac() {
9660
+ function jc() {
9575
9661
  let e = {};
9576
9662
  return { get: function(t) {
9577
9663
  if (e[t.id] !== void 0) return e[t.id];
@@ -9608,12 +9694,12 @@ function Ac() {
9608
9694
  return e[t.id] = n, n;
9609
9695
  } };
9610
9696
  }
9611
- var jc = 0;
9612
- function Mc(e, t) {
9697
+ var Mc = 0;
9698
+ function Nc(e, t) {
9613
9699
  return (t.castShadow ? 2 : 0) - (e.castShadow ? 2 : 0) + +!!t.map - !!e.map;
9614
9700
  }
9615
- function Nc(e) {
9616
- let t = new kc(), n = Ac(), r = {
9701
+ function Pc(e) {
9702
+ let t = new Ac(), n = jc(), r = {
9617
9703
  version: 0,
9618
9704
  hash: {
9619
9705
  directionalLength: -1,
@@ -9659,7 +9745,7 @@ function Nc(e) {
9659
9745
  let a = 0, o = 0, s = 0;
9660
9746
  for (let e = 0; e < 9; e++) r.probe[e].set(0, 0, 0);
9661
9747
  let c = 0, l = 0, u = 0, d = 0, f = 0, p = 0, m = 0, h = 0, g = 0, _ = 0, v = 0;
9662
- i.sort(Mc);
9748
+ i.sort(Nc);
9663
9749
  for (let e = 0, y = i.length; e < y; e++) {
9664
9750
  let y = i[e], b = y.color, x = y.intensity, S = y.distance, C = y.shadow && y.shadow.map ? y.shadow.map.texture : null;
9665
9751
  if (y.isAmbientLight) a += b.r * x, o += b.g * x, s += b.b * x;
@@ -9699,7 +9785,7 @@ function Nc(e) {
9699
9785
  }
9700
9786
  d > 0 && (e.has("OES_texture_float_linear") === !0 ? (r.rectAreaLTC1 = $.LTC_FLOAT_1, r.rectAreaLTC2 = $.LTC_FLOAT_2) : (r.rectAreaLTC1 = $.LTC_HALF_1, r.rectAreaLTC2 = $.LTC_HALF_2)), r.ambient[0] = a, r.ambient[1] = o, r.ambient[2] = s;
9701
9787
  let y = r.hash;
9702
- (y.directionalLength !== c || y.pointLength !== l || y.spotLength !== u || y.rectAreaLength !== d || y.hemiLength !== f || y.numDirectionalShadows !== p || y.numPointShadows !== m || y.numSpotShadows !== h || y.numSpotMaps !== g || y.numLightProbes !== v) && (r.directional.length = c, r.spot.length = u, r.rectArea.length = d, r.point.length = l, r.hemi.length = f, r.directionalShadow.length = p, r.directionalShadowMap.length = p, r.pointShadow.length = m, r.pointShadowMap.length = m, r.spotShadow.length = h, r.spotShadowMap.length = h, r.directionalShadowMatrix.length = p, r.pointShadowMatrix.length = m, r.spotLightMatrix.length = h + g - _, r.spotLightMap.length = g, r.numSpotLightShadowsWithMaps = _, r.numLightProbes = v, y.directionalLength = c, y.pointLength = l, y.spotLength = u, y.rectAreaLength = d, y.hemiLength = f, y.numDirectionalShadows = p, y.numPointShadows = m, y.numSpotShadows = h, y.numSpotMaps = g, y.numLightProbes = v, r.version = jc++);
9788
+ (y.directionalLength !== c || y.pointLength !== l || y.spotLength !== u || y.rectAreaLength !== d || y.hemiLength !== f || y.numDirectionalShadows !== p || y.numPointShadows !== m || y.numSpotShadows !== h || y.numSpotMaps !== g || y.numLightProbes !== v) && (r.directional.length = c, r.spot.length = u, r.rectArea.length = d, r.point.length = l, r.hemi.length = f, r.directionalShadow.length = p, r.directionalShadowMap.length = p, r.pointShadow.length = m, r.pointShadowMap.length = m, r.spotShadow.length = h, r.spotShadowMap.length = h, r.directionalShadowMatrix.length = p, r.pointShadowMatrix.length = m, r.spotLightMatrix.length = h + g - _, r.spotLightMap.length = g, r.numSpotLightShadowsWithMaps = _, r.numLightProbes = v, y.directionalLength = c, y.pointLength = l, y.spotLength = u, y.rectAreaLength = d, y.hemiLength = f, y.numDirectionalShadows = p, y.numPointShadows = m, y.numSpotShadows = h, y.numSpotMaps = g, y.numLightProbes = v, r.version = Mc++);
9703
9789
  }
9704
9790
  function c(e, t) {
9705
9791
  let n = 0, s = 0, c = 0, l = 0, u = 0, d = t.matrixWorldInverse;
@@ -9729,8 +9815,8 @@ function Nc(e) {
9729
9815
  state: r
9730
9816
  };
9731
9817
  }
9732
- function Pc(e) {
9733
- let t = new Nc(e), n = [], r = [];
9818
+ function Fc(e) {
9819
+ let t = new Pc(e), n = [], r = [];
9734
9820
  function i(e) {
9735
9821
  l.camera = e, n.length = 0, r.length = 0;
9736
9822
  }
@@ -9762,11 +9848,11 @@ function Pc(e) {
9762
9848
  pushShadow: o
9763
9849
  };
9764
9850
  }
9765
- function Fc(e) {
9851
+ function Ic(e) {
9766
9852
  let t = /* @__PURE__ */ new WeakMap();
9767
9853
  function n(n, r = 0) {
9768
9854
  let i = t.get(n), a;
9769
- return i === void 0 ? (a = new Pc(e), t.set(n, [a])) : r >= i.length ? (a = new Pc(e), i.push(a)) : a = i[r], a;
9855
+ return i === void 0 ? (a = new Fc(e), t.set(n, [a])) : r >= i.length ? (a = new Fc(e), i.push(a)) : a = i[r], a;
9770
9856
  }
9771
9857
  function r() {
9772
9858
  t = /* @__PURE__ */ new WeakMap();
@@ -9776,8 +9862,8 @@ function Fc(e) {
9776
9862
  dispose: r
9777
9863
  };
9778
9864
  }
9779
- var Ic = "void main() {\n gl_Position = vec4( position, 1.0 );\n}", Lc = "uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n#include <packing>\nvoid main() {\n const float samples = float( VSM_SAMPLES );\n float mean = 0.0;\n float squared_mean = 0.0;\n float uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 );\n float uvStart = samples <= 1.0 ? 0.0 : - 1.0;\n for ( float i = 0.0; i < samples; i ++ ) {\n float uvOffset = uvStart + i * uvStride;\n #ifdef HORIZONTAL_PASS\n vec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) );\n mean += distribution.x;\n squared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n #else\n float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) );\n mean += depth;\n squared_mean += depth * depth;\n #endif\n }\n mean = mean / samples;\n squared_mean = squared_mean / samples;\n float std_dev = sqrt( squared_mean - mean * mean );\n gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n}";
9780
- function Rc(e, t, n) {
9865
+ var Lc = "void main() {\n gl_Position = vec4( position, 1.0 );\n}", Rc = "uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n#include <packing>\nvoid main() {\n const float samples = float( VSM_SAMPLES );\n float mean = 0.0;\n float squared_mean = 0.0;\n float uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 );\n float uvStart = samples <= 1.0 ? 0.0 : - 1.0;\n for ( float i = 0.0; i < samples; i ++ ) {\n float uvOffset = uvStart + i * uvStride;\n #ifdef HORIZONTAL_PASS\n vec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) );\n mean += distribution.x;\n squared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n #else\n float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) );\n mean += depth;\n squared_mean += depth * depth;\n #endif\n }\n mean = mean / samples;\n squared_mean = squared_mean / samples;\n float std_dev = sqrt( squared_mean - mean * mean );\n gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n}";
9866
+ function zc(e, t, n) {
9781
9867
  let i = new lr(), a = new V(), o = new V(), s = new Ae(), c = new aa({ depthPacking: 3201 }), l = new oa(), u = {}, d = n.maxTextureSize, f = {
9782
9868
  0: 1,
9783
9869
  1: 0,
@@ -9789,8 +9875,8 @@ function Rc(e, t, n) {
9789
9875
  resolution: { value: new V() },
9790
9876
  radius: { value: 4 }
9791
9877
  },
9792
- vertexShader: Ic,
9793
- fragmentShader: Lc
9878
+ vertexShader: Lc,
9879
+ fragmentShader: Rc
9794
9880
  }), m = p.clone();
9795
9881
  m.defines.HORIZONTAL_PASS = 1;
9796
9882
  let h = new vn();
@@ -9888,7 +9974,7 @@ function Rc(e, t, n) {
9888
9974
  }
9889
9975
  }
9890
9976
  }
9891
- var zc = {
9977
+ var Bc = {
9892
9978
  0: 1,
9893
9979
  2: 6,
9894
9980
  4: 7,
@@ -9898,7 +9984,7 @@ var zc = {
9898
9984
  7: 4,
9899
9985
  5: 3
9900
9986
  };
9901
- function Bc(e, t) {
9987
+ function Vc(e, t) {
9902
9988
  function n() {
9903
9989
  let t = !1, n = new Ae(), r = null, i = new Ae(0, 0, 0, 0);
9904
9990
  return {
@@ -9937,7 +10023,7 @@ function Bc(e, t) {
9937
10023
  i !== t && !n && (e.depthMask(t), i = t);
9938
10024
  },
9939
10025
  setFunc: function(t) {
9940
- if (r && (t = zc[t]), a !== t) {
10026
+ if (r && (t = Bc[t]), a !== t) {
9941
10027
  switch (t) {
9942
10028
  case 0:
9943
10029
  e.depthFunc(e.NEVER);
@@ -10270,7 +10356,7 @@ function Bc(e, t) {
10270
10356
  reset: we
10271
10357
  };
10272
10358
  }
10273
- function Vc(o, s, c, l, u, d, p) {
10359
+ function Hc(o, s, c, l, u, d, p) {
10274
10360
  let m = s.has("WEBGL_multisampled_render_to_texture") ? s.get("WEBGL_multisampled_render_to_texture") : null, h = typeof navigator > "u" ? !1 : /OculusBrowser/g.test(navigator.userAgent), g = new V(), _ = /* @__PURE__ */ new WeakMap(), v, y = /* @__PURE__ */ new WeakMap(), b = !1;
10275
10361
  try {
10276
10362
  b = typeof OffscreenCanvas < "u" && new OffscreenCanvas(1, 1).getContext("2d") !== null;
@@ -10511,7 +10597,7 @@ function Vc(o, s, c, l, u, d, p) {
10511
10597
  if (b) {
10512
10598
  if (S) {
10513
10599
  if (t.layerUpdates.size > 0) {
10514
- let n = qa(v.width, v.height, t.format, t.type);
10600
+ let n = Ja(v.width, v.height, t.format, t.type);
10515
10601
  for (let r of t.layerUpdates) {
10516
10602
  let t = v.data.subarray(r * n / v.data.BYTES_PER_ELEMENT, (r + 1) * n / v.data.BYTES_PER_ELEMENT);
10517
10603
  c.compressedTexSubImage3D(o.TEXTURE_2D_ARRAY, e, 0, 0, r, v.width, v.height, 1, h, t);
@@ -10530,7 +10616,7 @@ function Vc(o, s, c, l, u, d, p) {
10530
10616
  if (b) {
10531
10617
  if (x && c.texStorage3D(o.TEXTURE_2D_ARRAY, E, _, m.width, m.height, m.depth), S) {
10532
10618
  if (t.layerUpdates.size > 0) {
10533
- let e = qa(m.width, m.height, t.format, t.type);
10619
+ let e = Ja(m.width, m.height, t.format, t.type);
10534
10620
  for (let n of t.layerUpdates) {
10535
10621
  let t = m.data.subarray(n * e / m.data.BYTES_PER_ELEMENT, (n + 1) * e / m.data.BYTES_PER_ELEMENT);
10536
10622
  c.texSubImage3D(o.TEXTURE_2D_ARRAY, 0, 0, 0, n, m.width, m.height, 1, h, g, t);
@@ -10789,7 +10875,7 @@ function Vc(o, s, c, l, u, d, p) {
10789
10875
  }
10790
10876
  this.allocateTextureUnit = ee, this.resetTextureUnits = I, this.setTexture2D = L, this.setTexture2DArray = ne, this.setTexture3D = re, this.setTextureCube = ie, this.rebindTextures = W, this.setupRenderTarget = G, this.updateRenderTargetMipmap = K, this.updateMultisampleRenderTarget = J, this.setupDepthRenderbuffer = fe, this.setupFrameBufferTexture = de, this.useMultisampledRTT = ge;
10791
10877
  }
10792
- function Hc(e, t) {
10878
+ function Uc(e, t) {
10793
10879
  function n(n, r = "") {
10794
10880
  let i, a = Y.getTransfer(r);
10795
10881
  if (n === 1009) return e.UNSIGNED_BYTE;
@@ -10880,7 +10966,7 @@ function Hc(e, t) {
10880
10966
  }
10881
10967
  return { convert: n };
10882
10968
  }
10883
- var Uc = "\nvoid main() {\n\n gl_Position = vec4( position, 1.0 );\n\n}", Wc = "\nuniform sampler2DArray depthColor;\nuniform float depthWidth;\nuniform float depthHeight;\n\nvoid main() {\n\n vec2 coord = vec2( gl_FragCoord.x / depthWidth, gl_FragCoord.y / depthHeight );\n\n if ( coord.x >= 1.0 ) {\n\n gl_FragDepth = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r;\n\n } else {\n\n gl_FragDepth = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r;\n\n }\n\n}", Gc = class {
10969
+ var Wc = "\nvoid main() {\n\n gl_Position = vec4( position, 1.0 );\n\n}", Gc = "\nuniform sampler2DArray depthColor;\nuniform float depthWidth;\nuniform float depthHeight;\n\nvoid main() {\n\n vec2 coord = vec2( gl_FragCoord.x / depthWidth, gl_FragCoord.y / depthHeight );\n\n if ( coord.x >= 1.0 ) {\n\n gl_FragDepth = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r;\n\n } else {\n\n gl_FragDepth = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r;\n\n }\n\n}", Kc = class {
10884
10970
  constructor() {
10885
10971
  this.texture = null, this.mesh = null, this.depthNear = 0, this.depthFar = 0;
10886
10972
  }
@@ -10893,8 +10979,8 @@ var Uc = "\nvoid main() {\n\n gl_Position = vec4( position, 1.0 );\n\n}", Wc = "
10893
10979
  getMesh(e) {
10894
10980
  if (this.texture !== null && this.mesh === null) {
10895
10981
  let t = e.cameras[0].viewport, n = new Vn({
10896
- vertexShader: Uc,
10897
- fragmentShader: Wc,
10982
+ vertexShader: Wc,
10983
+ fragmentShader: Gc,
10898
10984
  uniforms: {
10899
10985
  depthColor: { value: this.texture },
10900
10986
  depthWidth: { value: t.z },
@@ -10911,10 +10997,10 @@ var Uc = "\nvoid main() {\n\n gl_Position = vec4( position, 1.0 );\n\n}", Wc = "
10911
10997
  getDepthTexture() {
10912
10998
  return this.texture;
10913
10999
  }
10914
- }, Kc = class extends T {
11000
+ }, qc = class extends T {
10915
11001
  constructor(e, t) {
10916
11002
  super();
10917
- let n = this, r = null, i = 1, a = null, c = "local-floor", l = 1, p = null, m = null, h = null, g = null, _ = null, v = null, y = typeof XRWebGLBinding < "u", b = new Gc(), x = {}, S = t.getContextAttributes(), C = null, w = null, T = [], E = [], D = new V(), O = null, A = new Kn();
11003
+ let n = this, r = null, i = 1, a = null, c = "local-floor", l = 1, p = null, m = null, h = null, g = null, _ = null, v = null, y = typeof XRWebGLBinding < "u", b = new Kc(), x = {}, S = t.getContextAttributes(), C = null, w = null, T = [], E = [], D = new V(), O = null, A = new Kn();
10918
11004
  A.viewport = new Ae();
10919
11005
  let j = new Kn();
10920
11006
  j.viewport = new Ae();
@@ -11115,13 +11201,13 @@ var Uc = "\nvoid main() {\n\n gl_Position = vec4( position, 1.0 );\n\n}", Wc = "
11115
11201
  data: i
11116
11202
  }), v = null;
11117
11203
  }
11118
- let oe = new Ya();
11204
+ let oe = new Xa();
11119
11205
  oe.setAnimationLoop(ae), this.setAnimationLoop = function(e) {
11120
11206
  z = e;
11121
11207
  }, this.dispose = function() {};
11122
11208
  }
11123
- }, qc = /*@__PURE__*/ new vt(), Jc = /*@__PURE__*/ new ct();
11124
- function Yc(e, t) {
11209
+ }, Jc = /*@__PURE__*/ new vt(), Yc = /*@__PURE__*/ new ct();
11210
+ function Xc(e, t) {
11125
11211
  function n(e, t) {
11126
11212
  e.matrixAutoUpdate === !0 && e.updateMatrix(), t.value.copy(e.matrix);
11127
11213
  }
@@ -11134,7 +11220,7 @@ function Yc(e, t) {
11134
11220
  function a(e, r) {
11135
11221
  e.opacity.value = r.opacity, r.color && e.diffuse.value.copy(r.color), r.emissive && e.emissive.value.copy(r.emissive).multiplyScalar(r.emissiveIntensity), r.map && (e.map.value = r.map, n(r.map, e.mapTransform)), r.alphaMap && (e.alphaMap.value = r.alphaMap, n(r.alphaMap, e.alphaMapTransform)), r.bumpMap && (e.bumpMap.value = r.bumpMap, n(r.bumpMap, e.bumpMapTransform), e.bumpScale.value = r.bumpScale, r.side === 1 && (e.bumpScale.value *= -1)), r.normalMap && (e.normalMap.value = r.normalMap, n(r.normalMap, e.normalMapTransform), e.normalScale.value.copy(r.normalScale), r.side === 1 && e.normalScale.value.negate()), r.displacementMap && (e.displacementMap.value = r.displacementMap, n(r.displacementMap, e.displacementMapTransform), e.displacementScale.value = r.displacementScale, e.displacementBias.value = r.displacementBias), r.emissiveMap && (e.emissiveMap.value = r.emissiveMap, n(r.emissiveMap, e.emissiveMapTransform)), r.specularMap && (e.specularMap.value = r.specularMap, n(r.specularMap, e.specularMapTransform)), r.alphaTest > 0 && (e.alphaTest.value = r.alphaTest);
11136
11222
  let i = t.get(r), a = i.envMap, o = i.envMapRotation;
11137
- a && (e.envMap.value = a, qc.copy(o), qc.x *= -1, qc.y *= -1, qc.z *= -1, a.isCubeTexture && a.isRenderTargetTexture === !1 && (qc.y *= -1, qc.z *= -1), e.envMapRotation.value.setFromMatrix4(Jc.makeRotationFromEuler(qc)), e.flipEnvMap.value = a.isCubeTexture && a.isRenderTargetTexture === !1 ? -1 : 1, e.reflectivity.value = r.reflectivity, e.ior.value = r.ior, e.refractionRatio.value = r.refractionRatio), r.lightMap && (e.lightMap.value = r.lightMap, e.lightMapIntensity.value = r.lightMapIntensity, n(r.lightMap, e.lightMapTransform)), r.aoMap && (e.aoMap.value = r.aoMap, e.aoMapIntensity.value = r.aoMapIntensity, n(r.aoMap, e.aoMapTransform));
11223
+ a && (e.envMap.value = a, Jc.copy(o), Jc.x *= -1, Jc.y *= -1, Jc.z *= -1, a.isCubeTexture && a.isRenderTargetTexture === !1 && (Jc.y *= -1, Jc.z *= -1), e.envMapRotation.value.setFromMatrix4(Yc.makeRotationFromEuler(Jc)), e.flipEnvMap.value = a.isCubeTexture && a.isRenderTargetTexture === !1 ? -1 : 1, e.reflectivity.value = r.reflectivity, e.ior.value = r.ior, e.refractionRatio.value = r.refractionRatio), r.lightMap && (e.lightMap.value = r.lightMap, e.lightMapIntensity.value = r.lightMapIntensity, n(r.lightMap, e.lightMapTransform)), r.aoMap && (e.aoMap.value = r.aoMap, e.aoMapIntensity.value = r.aoMapIntensity, n(r.aoMap, e.aoMapTransform));
11138
11224
  }
11139
11225
  function o(e, t) {
11140
11226
  e.diffuse.value.copy(t.color), e.opacity.value = t.opacity, t.map && (e.map.value = t.map, n(t.map, e.mapTransform));
@@ -11172,7 +11258,7 @@ function Yc(e, t) {
11172
11258
  refreshMaterialUniforms: i
11173
11259
  };
11174
11260
  }
11175
- function Xc(e, t, n, r) {
11261
+ function Zc(e, t, n, r) {
11176
11262
  let i = {}, a = {}, o = [], s = e.getParameter(e.MAX_UNIFORM_BUFFER_BINDINGS);
11177
11263
  function c(e, t) {
11178
11264
  let n = t.program;
@@ -11264,7 +11350,7 @@ function Xc(e, t, n, r) {
11264
11350
  dispose: _
11265
11351
  };
11266
11352
  }
11267
- var Zc = class {
11353
+ var Qc = class {
11268
11354
  constructor(e = {}) {
11269
11355
  let { canvas: t = me(), context: n = null, depth: r = !0, stencil: i = !1, alpha: s = !1, antialias: c = !1, premultipliedAlpha: u = !0, preserveDrawingBuffer: d = !1, powerPreference: f = "default", failIfMajorPerformanceCaveat: p = !1, reversedDepthBuffer: m = !1 } = e;
11270
11356
  this.isWebGLRenderer = !0;
@@ -11314,10 +11400,10 @@ var Zc = class {
11314
11400
  }
11315
11401
  let W, G, K, pe, q, J, _e, ve, ye, be, xe, Se, Ce, we, Te, Ee, De, Oe, ke, je, Ne, Pe, Fe, Ie;
11316
11402
  function Le() {
11317
- W = new Ao(H), W.init(), Pe = new Hc(H, W), G = new io(H, W, e, Pe), K = new Bc(H, W), G.reversedDepthBuffer && m && K.buffers.depth.setReversed(!0), pe = new No(H), q = new wc(), J = new Vc(H, W, K, q, G, Pe, pe), _e = new oo(T), ve = new ko(T), ye = new Xa(H), Fe = new no(H, ye), be = new jo(H, ye, pe, Fe), xe = new Fo(H, be, ye, pe), ke = new Po(H, G, J), Ee = new ao(q), Se = new Cc(T, _e, ve, W, G, Fe, Ee), Ce = new Yc(T, q), we = new Oc(), Te = new Fc(W), Oe = new to(T, _e, ve, K, xe, h, u), De = new Rc(T, xe, G), Ie = new Xc(H, pe, G, K), je = new ro(H, W, pe), Ne = new Mo(H, W, pe), pe.programs = Se.programs, T.capabilities = G, T.extensions = W, T.properties = q, T.renderLists = we, T.shadowMap = De, T.state = K, T.info = pe;
11403
+ W = new jo(H), W.init(), Pe = new Uc(H, W), G = new ao(H, W, e, Pe), K = new Vc(H, W), G.reversedDepthBuffer && m && K.buffers.depth.setReversed(!0), pe = new Po(H), q = new Tc(), J = new Hc(H, W, K, q, G, Pe, pe), _e = new so(T), ve = new Ao(T), ye = new Za(H), Fe = new ro(H, ye), be = new Mo(H, ye, pe, Fe), xe = new Io(H, be, ye, pe), ke = new Fo(H, G, J), Ee = new oo(q), Se = new wc(T, _e, ve, W, G, Fe, Ee), Ce = new Xc(T, q), we = new kc(), Te = new Ic(W), Oe = new no(T, _e, ve, K, xe, h, u), De = new zc(T, xe, G), Ie = new Zc(H, pe, G, K), je = new io(H, W, pe), Ne = new No(H, W, pe), pe.programs = Se.programs, T.capabilities = G, T.extensions = W, T.properties = q, T.renderLists = we, T.shadowMap = De, T.state = K, T.info = pe;
11318
11404
  }
11319
11405
  Le();
11320
- let Re = new Kc(T, H);
11406
+ let Re = new qc(T, H);
11321
11407
  this.xr = Re, this.getContext = function() {
11322
11408
  return H;
11323
11409
  }, this.getContextAttributes = function() {
@@ -11496,7 +11582,7 @@ var Zc = class {
11496
11582
  function Ye() {
11497
11583
  Xe.start();
11498
11584
  }
11499
- let Xe = new Ya();
11585
+ let Xe = new Xa();
11500
11586
  Xe.setAnimationLoop(qe), typeof self < "u" && Xe.setContext(self), this.setAnimationLoop = function(e) {
11501
11587
  Ke = e, Re.setAnimationLoop(e), e === null ? Xe.stop() : Xe.start();
11502
11588
  }, Re.addEventListener("sessionstart", Je), Re.addEventListener("sessionend", Ye), this.render = function(e, t) {
@@ -11613,7 +11699,7 @@ var Zc = class {
11613
11699
  function rt(e) {
11614
11700
  if (e.uniformsList === null) {
11615
11701
  let t = e.currentProgram.getUniforms();
11616
- e.uniformsList = Hs.seqWithValue(t.seq, e.uniforms);
11702
+ e.uniformsList = Us.seqWithValue(t.seq, e.uniforms);
11617
11703
  }
11618
11704
  return e.uniformsList;
11619
11705
  }
@@ -11647,7 +11733,7 @@ var Zc = class {
11647
11733
  }
11648
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));
11649
11735
  let M = n.morphAttributes;
11650
- if ((M.position !== void 0 || M.normal !== void 0 || M.color !== void 0) && ke.update(i, n, S), (w || _.receiveShadow !== i.receiveShadow) && (_.receiveShadow = i.receiveShadow, D.setValue(H, "receiveShadow", i.receiveShadow)), r.isMeshGouraudMaterial && r.envMap !== null && (O.envMap.value = c, O.flipEnvMap.value = c.isCubeTexture && c.isRenderTargetTexture === !1 ? -1 : 1), r.isMeshStandardMaterial && r.envMap === null && t.environment !== null && (O.envMapIntensity.value = t.environmentIntensity), w && (D.setValue(H, "toneMappingExposure", T.toneMappingExposure), _.needsLights && ot(O, E), a && r.fog === !0 && Ce.refreshFogUniforms(O, a), Ce.refreshMaterialUniforms(O, r, L, te, x.state.transmissionRenderTarget[e.id]), Hs.upload(H, rt(_), O, J)), r.isShaderMaterial && r.uniformsNeedUpdate === !0 && (Hs.upload(H, rt(_), O, J), r.uniformsNeedUpdate = !1), r.isSpriteMaterial && D.setValue(H, "center", i.center), D.setValue(H, "modelViewMatrix", i.modelViewMatrix), D.setValue(H, "normalMatrix", i.normalMatrix), D.setValue(H, "modelMatrix", i.matrixWorld), r.isShaderMaterial || r.isRawShaderMaterial) {
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) {
11651
11737
  let e = r.uniformsGroups;
11652
11738
  for (let t = 0, n = e.length; t < n; t++) {
11653
11739
  let n = e[t];
@@ -11802,9 +11888,9 @@ var Zc = class {
11802
11888
  let t = this.getContext();
11803
11889
  t.drawingBufferColorSpace = Y._getDrawingBufferColorSpace(e), t.unpackColorSpace = Y._getUnpackColorSpace();
11804
11890
  }
11805
- }, Qc = {
11891
+ }, $c = {
11806
11892
  name: "@liquidcars/atlas",
11807
- version: "0.1.39",
11893
+ version: "0.1.40",
11808
11894
  description: "Reusable 3D conceptual atlas Web Component for LiquidCars-style models",
11809
11895
  type: "module",
11810
11896
  scripts: {
@@ -11838,37 +11924,37 @@ var Zc = class {
11838
11924
  "liquidcars"
11839
11925
  ],
11840
11926
  license: "MIT"
11841
- }.version, $c = {
11927
+ }.version, el = {
11842
11928
  component: "#8ae4d0",
11843
11929
  connection: "#f4edba"
11844
- }, el = .05, tl = 15, nl = /* @__PURE__ */ new Map(), rl = /* @__PURE__ */ new Map(), il = /* @__PURE__ */ new Map();
11845
- function al(e) {
11846
- return Array.isArray(e) ? e.map(al) : !e || typeof e != "object" ? e : Object.fromEntries(Object.entries(e).filter(([, e]) => typeof e != "function" && e !== void 0).map(([e, t]) => [e, al(t)]));
11847
- }
11930
+ }, tl = .05, nl = 15, rl = /* @__PURE__ */ new Map(), il = /* @__PURE__ */ new Map(), al = /* @__PURE__ */ new Map();
11848
11931
  function ol(e) {
11849
- return (e == null ? [] : Array.isArray(e) ? e : [e]).map((e) => typeof e == "string" ? { name: e } : al(e)).filter((e) => e && String(e.name || "").trim()).map((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)]));
11933
+ }
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) => ({
11850
11936
  ...e,
11851
11937
  name: String(e.name).trim()
11852
11938
  }));
11853
11939
  }
11854
- function sl(e) {
11940
+ function cl(e) {
11855
11941
  return [...new Set((e == null ? [] : Array.isArray(e) ? e : [e]).map((e) => String(e || "").trim()).filter(Boolean))];
11856
11942
  }
11857
- function cl(e) {
11858
- return e ? typeof e == "string" ? { spdx: e } : al(e) : null;
11943
+ function ll(e) {
11944
+ return e ? typeof e == "string" ? { spdx: e } : ol(e) : null;
11859
11945
  }
11860
- function ll(e, t) {
11861
- let n = al(e || {}), r = String(n.id || `source-${t + 1}`).trim();
11946
+ function ul(e, t) {
11947
+ let n = ol(e || {}), r = String(n.id || `source-${t + 1}`).trim();
11862
11948
  if (!r) throw TypeError("Geometry pack sources require an id.");
11863
11949
  return {
11864
11950
  ...n,
11865
11951
  id: r,
11866
- authors: ol(n.authors ?? n.author),
11867
- license: cl(n.license)
11952
+ authors: sl(n.authors ?? n.author),
11953
+ license: ll(n.license)
11868
11954
  };
11869
11955
  }
11870
- function ul(e, t, n) {
11871
- let r = al(e || {}), i = String(r.id || "").trim();
11956
+ function dl(e, t, n) {
11957
+ let r = ol(e || {}), i = String(r.id || "").trim();
11872
11958
  if (!i) throw TypeError(`Geometry pack resource at index ${t} requires an id.`);
11873
11959
  let a = r.source == null ? null : String(r.source).trim();
11874
11960
  if (a && !n.has(a)) throw TypeError(`Geometry pack resource '${i}' references unknown source '${a}'.`);
@@ -11877,12 +11963,12 @@ function ul(e, t, n) {
11877
11963
  id: i,
11878
11964
  kind: String(r.kind || r.type || "asset"),
11879
11965
  source: a,
11880
- authors: ol(r.authors ?? r.author),
11881
- license: cl(r.license)
11966
+ authors: sl(r.authors ?? r.author),
11967
+ license: ll(r.license)
11882
11968
  };
11883
11969
  }
11884
- function dl(e, t) {
11885
- let n = (Array.isArray(e.sources) ? e.sources : []).map(ll), r = new Set(n.map((e) => e.id)), i = (Array.isArray(e.resources) ? e.resources : []).map((e, t) => ul(e, t, r));
11970
+ function fl(e, t) {
11971
+ 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));
11886
11972
  if (new Set(i.map((e) => e.id)).size !== i.length) throw TypeError(`Geometry pack '${t}' contains duplicate resource ids.`);
11887
11973
  return {
11888
11974
  namespace: t,
@@ -11891,35 +11977,35 @@ function dl(e, t) {
11891
11977
  description: String(e.description || ""),
11892
11978
  category: String(e.category || e.name || t),
11893
11979
  homepage: e.homepage ? String(e.homepage) : "",
11894
- repository: al(e.repository || null),
11895
- authors: ol(e.authors ?? e.author),
11896
- license: cl(e.license),
11980
+ repository: ol(e.repository || null),
11981
+ authors: sl(e.authors ?? e.author),
11982
+ license: ll(e.license),
11897
11983
  attribution: String(e.attribution || ""),
11898
- collections: al(Array.isArray(e.collections) ? e.collections : []),
11984
+ collections: ol(Array.isArray(e.collections) ? e.collections : []),
11899
11985
  sources: n,
11900
11986
  resources: i,
11901
11987
  geometries: []
11902
11988
  };
11903
11989
  }
11904
- function fl(e) {
11990
+ function pl(e) {
11905
11991
  let { create: t, resourceMap: n, ...r } = e;
11906
11992
  return {
11907
- ...al(r),
11993
+ ...ol(r),
11908
11994
  canonicalSize: [...e.canonicalSize],
11909
- parameters: al(e.parameters),
11910
- palette: al(e.palette),
11911
- anchors: al(e.anchors)
11995
+ parameters: ol(e.parameters),
11996
+ palette: ol(e.palette),
11997
+ anchors: ol(e.anchors)
11912
11998
  };
11913
11999
  }
11914
- function pl(e) {
11915
- return al(e);
11916
- }
11917
12000
  function ml(e) {
12001
+ return ol(e);
12002
+ }
12003
+ function hl(e) {
11918
12004
  if (!e || typeof e != "object") throw TypeError("A geometry pack must be an object.");
11919
12005
  let t = String(e.namespace || "").trim();
11920
12006
  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.");
11921
12007
  if (!Array.isArray(e.geometries) || !e.geometries.length) throw TypeError("A geometry pack requires at least one geometry.");
11922
- let n = dl(e, t), r = Object.freeze(Object.fromEntries(n.resources.map((e) => [e.id, Object.freeze(al(e))]))), i = [];
12008
+ let n = fl(e, t), r = Object.freeze(Object.fromEntries(n.resources.map((e) => [e.id, Object.freeze(ol(e))]))), i = [];
11923
12009
  for (let a of e.geometries) {
11924
12010
  if (!a || typeof a != "object" || !a.id) throw TypeError(`Geometry pack '${t}' contains an invalid geometry.`);
11925
12011
  let o = String(a.id).includes(".") ? String(a.id).split(".").pop() : String(a.id), s = String(a.id).includes(".") ? String(a.id) : `${t}.${o}`;
@@ -11932,8 +12018,8 @@ function ml(e) {
11932
12018
  packVersion: n.version,
11933
12019
  category: a.category || n.category,
11934
12020
  collection: a.collection == null ? "" : String(a.collection).trim(),
11935
- tags: sl(a.tags),
11936
- keywords: sl(a.keywords),
12021
+ tags: cl(a.tags),
12022
+ keywords: cl(a.keywords),
11937
12023
  canonicalSize: Array.isArray(a.canonicalSize) && a.canonicalSize.length === 3 ? a.canonicalSize.map(Number) : [
11938
12024
  2.5,
11939
12025
  1.5,
@@ -11951,41 +12037,41 @@ function ml(e) {
11951
12037
  resourceMap: r
11952
12038
  });
11953
12039
  }
11954
- hl(t);
12040
+ gl(t);
11955
12041
  let a = [];
11956
12042
  for (let e of i) {
11957
- nl.set(e.id, e), rl.set(e.id, e.id);
11958
- for (let t of e.aliases || []) rl.set(String(t), e.id);
12043
+ rl.set(e.id, e), il.set(e.id, e.id);
12044
+ for (let t of e.aliases || []) il.set(String(t), e.id);
11959
12045
  a.push(e.id);
11960
12046
  }
11961
- n.geometries = [...a], il.set(t, n);
11962
- let o = pl(n);
12047
+ n.geometries = [...a], al.set(t, n);
12048
+ let o = ml(n);
11963
12049
  return typeof globalThis.dispatchEvent == "function" && typeof CustomEvent == "function" && globalThis.dispatchEvent(new CustomEvent("lc-geometry-registry-change", { detail: {
11964
12050
  namespace: t,
11965
12051
  geometries: a,
11966
12052
  pack: o
11967
12053
  } })), o;
11968
12054
  }
11969
- function hl(e) {
12055
+ function gl(e) {
11970
12056
  let t = [];
11971
- for (let [n, r] of nl) r.namespace === e && (nl.delete(n), t.push(n));
11972
- for (let [e, n] of rl) t.includes(n) && rl.delete(e);
11973
- return il.delete(e), t;
11974
- }
11975
- function gl() {
11976
- return [...nl.values()].map(fl);
12057
+ for (let [n, r] of rl) r.namespace === e && (rl.delete(n), t.push(n));
12058
+ for (let [e, n] of il) t.includes(n) && il.delete(e);
12059
+ return al.delete(e), t;
11977
12060
  }
11978
12061
  function _l() {
11979
- return [...il.values()].map(pl);
12062
+ return [...rl.values()].map(pl);
11980
12063
  }
11981
- function vl(e) {
11982
- let t = rl.get(e) || e;
11983
- return nl.get(t) || null;
12064
+ function vl() {
12065
+ return [...al.values()].map(ml);
11984
12066
  }
11985
12067
  function yl(e) {
12068
+ let t = il.get(e) || e;
12069
+ return rl.get(t) || null;
12070
+ }
12071
+ function bl(e) {
11986
12072
  return e === "container" || e === "shell";
11987
12073
  }
11988
- function bl(e = {}) {
12074
+ function xl(e = {}) {
11989
12075
  let t = e && typeof e == "object" ? e : {}, n = Number(t.opacity);
11990
12076
  return {
11991
12077
  mode: t.mode === "connected" ? "connected" : "all",
@@ -11994,20 +12080,20 @@ function bl(e = {}) {
11994
12080
  opacity: Number.isFinite(n) ? Math.max(.02, Math.min(.8, n)) : .12
11995
12081
  };
11996
12082
  }
11997
- function xl(e) {
12083
+ function Sl(e) {
11998
12084
  return [
11999
12085
  "preserve",
12000
12086
  "center",
12001
12087
  "fit"
12002
12088
  ].includes(e) ? e : "preserve";
12003
12089
  }
12004
- function Sl(e) {
12090
+ function Cl(e) {
12005
12091
  return e === "model" ? "model" : "camera";
12006
12092
  }
12007
- function Cl(e, t) {
12093
+ function wl(e, t) {
12008
12094
  e && e.transparent !== t && (e.transparent = t, e.needsUpdate = !0);
12009
12095
  }
12010
- ml({
12096
+ hl({
12011
12097
  namespace: "geo",
12012
12098
  name: "Geometric primitives",
12013
12099
  version: "1",
@@ -12064,7 +12150,7 @@ ml({
12064
12150
  } } : {}
12065
12151
  }))
12066
12152
  });
12067
- var wl = {
12153
+ var Tl = {
12068
12154
  background: {
12069
12155
  color: "#0a111a",
12070
12156
  glow: "#1c2b39",
@@ -12109,17 +12195,17 @@ var wl = {
12109
12195
  hint: !0
12110
12196
  }
12111
12197
  };
12112
- function Tl(e, t) {
12198
+ function El(e, t) {
12113
12199
  let n = { ...e };
12114
12200
  if (!t || typeof t != "object") return n;
12115
- for (let [r, i] of Object.entries(t)) n[r] = i && typeof i == "object" && !Array.isArray(i) ? Tl(e?.[r] || {}, i) : i;
12201
+ for (let [r, i] of Object.entries(t)) n[r] = i && typeof i == "object" && !Array.isArray(i) ? El(e?.[r] || {}, i) : i;
12116
12202
  return n;
12117
12203
  }
12118
- function El(e) {
12204
+ function Dl(e) {
12119
12205
  let t = e && typeof e == "object" ? { ...e } : {};
12120
- return typeof e == "string" ? t.background = { color: e } : typeof t.background == "string" && (t.background = { color: t.background }), Tl(wl, t);
12206
+ return typeof e == "string" ? t.background = { color: e } : typeof t.background == "string" && (t.background = { color: t.background }), El(Tl, t);
12121
12207
  }
12122
- function Dl(e) {
12208
+ function Ol(e) {
12123
12209
  if (!e || typeof e != "object") return "directed";
12124
12210
  let t = String(e.mode || e.visual || e.render || e.type || e.direction || "").trim().toLowerCase().replace(/[_\s]+/g, "-");
12125
12211
  return e.bidirectional === !0 || [
@@ -12134,7 +12220,7 @@ function Dl(e) {
12134
12220
  "failed"
12135
12221
  ].includes(t) ? "broken" : "directed";
12136
12222
  }
12137
- var Ol = [":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(""), kl = ".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}}", Al = [
12223
+ var kl = [":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(""), Al = ".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}}", jl = [
12138
12224
  ".viewport>.atlas-print-snapshot{display:none!important}",
12139
12225
  "@media print{",
12140
12226
  ":host{-webkit-print-color-adjust:exact;print-color-adjust:exact;break-inside:avoid;page-break-inside:avoid}",
@@ -12143,17 +12229,17 @@ var Ol = [":host{display:block;position:relative;height:var(--lc-height,680px);m
12143
12229
  ":host([data-lc-print-ready]) .viewport>canvas:not(.atlas-print-snapshot){display:none!important}",
12144
12230
  ":host([data-lc-print-ready]) .viewport>.atlas-print-snapshot{display:block!important;width:100%;height:100%}",
12145
12231
  "}"
12146
- ].join(""), jl = (e, t = "0 0 24 24") => `<svg viewBox="${t}" aria-hidden="true">${e}</svg>`, Ml = {
12147
- minus: jl("<path d=\"M6 12h12\"/>"),
12148
- plus: jl("<path d=\"M12 6v12M6 12h12\"/>"),
12149
- fit: jl("<path d=\"M9 4H4v5M15 4h5v5M20 15v5h-5M4 15v5h5\"/><circle cx=\"12\" cy=\"12\" r=\"2.5\"/>"),
12150
- front: jl("<rect x=\"4\" y=\"5\" width=\"16\" height=\"14\" rx=\"1.5\"/><path d=\"M8 16h8\"/>"),
12151
- view: jl("<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\"/>"),
12152
- relations: jl("<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\"/>"),
12153
- focus: jl("<circle cx=\"12\" cy=\"12\" r=\"7\"/><circle cx=\"12\" cy=\"12\" r=\"2.5\"/><path d=\"M12 2v3M12 19v3M2 12h3M19 12h3\"/>"),
12154
- chevron: jl("<path d=\"m8 10 4 4 4-4\"/>")
12155
- }, Nl = (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>`, Pl = (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>${Ml.chevron}</summary><div class="toolbar-popover" role="menu"><div class="toolbar-popover-title">${n}</div>${i}</div></details>`, Fl = `<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">${Ml.minus}</button><button class="toolbar-icon" data-action="plus" aria-label="Acercar" title="Acercar">${Ml.plus}</button><button class="toolbar-icon" data-action="fit" aria-label="Encuadrar todo el modelo" title="Encuadrar todo el modelo">${Ml.fit}</button><button class="toolbar-icon" data-action="front" aria-label="Vista frontal" title="Vista frontal">${Ml.front}</button></div><div class="toolbar-group" data-toolbar-group="view">${Pl("view", Ml.view, "Vista", "Vista", Nl("labels", "Etiquetas", !0) + Nl("panel", "Información", !0) + Nl("item-facing", "Caras a cámara", !0) + "<div class=\"toolbar-option-separator\"></div>" + Nl("open-all", "Abrir todos") + Nl("close-all", "Cerrar todos"))}</div><div class="toolbar-group" data-toolbar-group="relations">${Pl("relations", Ml.relations, "Relaciones", "Selección", Nl("relations-all", "Todas") + Nl("relations-selected", "Selección", !0) + Nl("relations-none", "Ocultar"))}</div><div class="toolbar-group" data-toolbar-group="focus">${Pl("focus", Ml.focus, "Foco", "Todo", Nl("focus-all", "Todo", !0) + Nl("focus-dim", "Conectados") + Nl("focus-hide", "Aislar") + "<div class=\"toolbar-option-separator\"></div>" + Nl("focus-selection", "Enfocar selección") + Nl("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>`;
12156
- function Il(e) {
12232
+ ].join(""), Ml = (e, t = "0 0 24 24") => `<svg viewBox="${t}" aria-hidden="true">${e}</svg>`, Nl = {
12233
+ minus: Ml("<path d=\"M6 12h12\"/>"),
12234
+ plus: Ml("<path d=\"M12 6v12M6 12h12\"/>"),
12235
+ fit: Ml("<path d=\"M9 4H4v5M15 4h5v5M20 15v5h-5M4 15v5h5\"/><circle cx=\"12\" cy=\"12\" r=\"2.5\"/>"),
12236
+ front: Ml("<rect x=\"4\" y=\"5\" width=\"16\" height=\"14\" rx=\"1.5\"/><path d=\"M8 16h8\"/>"),
12237
+ view: Ml("<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\"/>"),
12238
+ relations: Ml("<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\"/>"),
12239
+ focus: Ml("<circle cx=\"12\" cy=\"12\" r=\"7\"/><circle cx=\"12\" cy=\"12\" r=\"2.5\"/><path d=\"M12 2v3M12 19v3M2 12h3M19 12h3\"/>"),
12240
+ chevron: Ml("<path d=\"m8 10 4 4 4-4\"/>")
12241
+ }, Pl = (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>`, Fl = (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>${Nl.chevron}</summary><div class="toolbar-popover" role="menu"><div class="toolbar-popover-title">${n}</div>${i}</div></details>`, Il = `<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">${Nl.minus}</button><button class="toolbar-icon" data-action="plus" aria-label="Acercar" title="Acercar">${Nl.plus}</button><button class="toolbar-icon" data-action="fit" aria-label="Encuadrar todo el modelo" title="Encuadrar todo el modelo">${Nl.fit}</button><button class="toolbar-icon" data-action="front" aria-label="Vista frontal" title="Vista frontal">${Nl.front}</button></div><div class="toolbar-group" data-toolbar-group="view">${Fl("view", Nl.view, "Vista", "Vista", Pl("labels", "Etiquetas", !0) + Pl("panel", "Información", !0) + Pl("item-facing", "Caras a cámara", !0) + "<div class=\"toolbar-option-separator\"></div>" + Pl("open-all", "Abrir todos") + Pl("close-all", "Cerrar todos"))}</div><div class="toolbar-group" data-toolbar-group="relations">${Fl("relations", Nl.relations, "Relaciones", "Selección", Pl("relations-all", "Todas") + Pl("relations-selected", "Selección", !0) + Pl("relations-none", "Ocultar"))}</div><div class="toolbar-group" data-toolbar-group="focus">${Fl("focus", Nl.focus, "Foco", "Todo", Pl("focus-all", "Todo", !0) + Pl("focus-dim", "Conectados") + Pl("focus-hide", "Aislar") + "<div class=\"toolbar-option-separator\"></div>" + Pl("focus-selection", "Enfocar selección") + Pl("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>`;
12242
+ function Ll(e) {
12157
12243
  return String(e ?? "").replace(/[&<>"']/g, (e) => ({
12158
12244
  "&": "&amp;",
12159
12245
  "<": "&lt;",
@@ -12162,17 +12248,17 @@ function Il(e) {
12162
12248
  "'": "&#39;"
12163
12249
  })[e]);
12164
12250
  }
12165
- function Ll(e) {
12251
+ function Rl(e) {
12166
12252
  let t = String(e ?? "").trim();
12167
12253
  if (!t) return "";
12168
12254
  try {
12169
12255
  let e = new URL(t, globalThis.location?.href);
12170
- return ["http:", "https:"].includes(e.protocol) ? "<a class=\"external-link\" href=\"" + Il(e.href) + "\" target=\"_blank\" rel=\"noopener noreferrer\">Open documentation ↗</a>" : "";
12256
+ return ["http:", "https:"].includes(e.protocol) ? "<a class=\"external-link\" href=\"" + Ll(e.href) + "\" target=\"_blank\" rel=\"noopener noreferrer\">Open documentation ↗</a>" : "";
12171
12257
  } catch {
12172
12258
  return "";
12173
12259
  }
12174
12260
  }
12175
- function Rl(e) {
12261
+ function zl(e) {
12176
12262
  let t = e && typeof e == "object" ? e : {}, n = Array.isArray(t.entities) ? t.entities.map((e) => ({
12177
12263
  ...e,
12178
12264
  p: Array.isArray(e.p) ? e.p : [
@@ -12189,28 +12275,28 @@ function Rl(e) {
12189
12275
  from: e[0],
12190
12276
  to: e[1],
12191
12277
  label: e[2] || "",
12192
- mode: Dl({ mode: e[3] }),
12278
+ mode: Ol({ mode: e[3] }),
12193
12279
  index: t
12194
12280
  } : {
12195
12281
  ...e,
12196
12282
  from: e.from,
12197
12283
  to: e.to,
12198
12284
  label: e.label || "",
12199
- mode: Dl(e),
12285
+ mode: Ol(e),
12200
12286
  index: t
12201
12287
  }) : [];
12202
12288
  return {
12203
12289
  ...t,
12204
12290
  palette: {
12205
- ...$c,
12291
+ ...el,
12206
12292
  ...t.palette || {}
12207
12293
  },
12208
- theme: El(t.theme || t.styles),
12294
+ theme: Dl(t.theme || t.styles),
12209
12295
  entities: n,
12210
12296
  relations: r
12211
12297
  };
12212
12298
  }
12213
- function zl(e, t, n = [
12299
+ function Bl(e, t, n = [
12214
12300
  1,
12215
12301
  1,
12216
12302
  1
@@ -12229,7 +12315,7 @@ function zl(e, t, n = [
12229
12315
  });
12230
12316
  return s.center(), s;
12231
12317
  }
12232
- function Bl(e, t, n) {
12318
+ function Vl(e, t, n) {
12233
12319
  let r = new ui();
12234
12320
  for (let t = 0; t < e; t++) {
12235
12321
  let n = Math.PI / 2 + t * Math.PI * 2 / e, i = new V(Math.cos(n) * .5, Math.sin(n) * .5);
@@ -12246,7 +12332,7 @@ function Bl(e, t, n) {
12246
12332
  });
12247
12333
  return i.rotateX(Math.PI / 2), i.center(), i;
12248
12334
  }
12249
- function Vl(e, t, n, r) {
12335
+ function Hl(e, t, n, r) {
12250
12336
  let i = Math.min(.22, Math.max(0, Number(n) || 0));
12251
12337
  if (!i) return new Er(t, e, 1, 32);
12252
12338
  let a = [new V(0, -.5)];
@@ -12263,7 +12349,7 @@ function Vl(e, t, n, r) {
12263
12349
  }
12264
12350
  return a.push(new V(0, .5)), new Qi(a, 32);
12265
12351
  }
12266
- function Hl(e, t) {
12352
+ function Ul(e, t) {
12267
12353
  if (!t) return e;
12268
12354
  let n = Math.min(.72, Math.max(0, Number(t) * 3)), r = e.attributes.position;
12269
12355
  for (let e = 0; e < r.count; e++) {
@@ -12272,36 +12358,36 @@ function Hl(e, t) {
12272
12358
  }
12273
12359
  return r.needsUpdate = !0, e.computeVertexNormals(), e;
12274
12360
  }
12275
- function Ul(e, t = 0, n = 4, r = [
12361
+ function Wl(e, t = 0, n = 4, r = [
12276
12362
  1,
12277
12363
  1,
12278
12364
  1
12279
12365
  ]) {
12280
12366
  let i = Number(t) || 0, a = Math.max(2, Math.round(Number(n) || 4));
12281
12367
  switch (e) {
12282
- case "cylinder": return i ? Vl(.5, .5, i, a) : new Er(.5, .5, 1, 32);
12283
- case "cone": return i ? Vl(0, .5, i, a) : new Dr(.5, 1, 32);
12368
+ case "cylinder": return i ? Hl(.5, .5, i, a) : new Er(.5, .5, 1, 32);
12369
+ case "cone": return i ? Hl(0, .5, i, a) : new Dr(.5, 1, 32);
12284
12370
  case "frustum-cone":
12285
- case "truncated-cone": return i ? Vl(.28, .5, i, a) : new Er(.28, .5, 1, 32);
12371
+ case "truncated-cone": return i ? Hl(.28, .5, i, a) : new Er(.28, .5, 1, 32);
12286
12372
  case "frustum-pyramid":
12287
12373
  case "truncated-pyramid": return new Er(.28, .5, 1, 4);
12288
12374
  case "frustum-triangle": return new Er(.28, .5, 1, 3);
12289
- case "prism": return i ? Bl(6, i, a) : new Er(.5, .5, 1, 6);
12290
- case "pyramid-square": return i ? Hl(new Dr(.5, 1, 4), i) : new Dr(.5, 1, 4);
12291
- case "pyramid-triangle": return i ? Hl(new Dr(.5, 1, 3), i) : new Dr(.5, 1, 3);
12375
+ case "prism": return i ? Vl(6, i, a) : new Er(.5, .5, 1, 6);
12376
+ case "pyramid-square": return i ? Ul(new Dr(.5, 1, 4), i) : new Dr(.5, 1, 4);
12377
+ case "pyramid-triangle": return i ? Ul(new Dr(.5, 1, 3), i) : new Dr(.5, 1, 3);
12292
12378
  case "sphere": return new ta(.5, 24, 16);
12293
- case "octahedron": return Hl(new $i(.5), i);
12294
- case "dodecahedron": return Hl(new kr(.5), i);
12295
- case "icosahedron": return Hl(new Zi(.5), i);
12296
- default: return i ? zl(i, a, r) : new Nn(1, 1, 1);
12379
+ case "octahedron": return Ul(new $i(.5), i);
12380
+ case "dodecahedron": return Ul(new kr(.5), i);
12381
+ case "icosahedron": return Ul(new Zi(.5), i);
12382
+ default: return i ? Bl(i, a, r) : new Nn(1, 1, 1);
12297
12383
  }
12298
12384
  }
12299
- function Wl(e) {
12385
+ function Gl(e) {
12300
12386
  e.computeBoundingBox();
12301
12387
  let t = e.boundingBox?.getSize(new U());
12302
12388
  return !t || !t.x || !t.y || !t.z ? e : (e.scale(1 / t.x, 1 / t.y, 1 / t.z), e.computeBoundingBox(), e);
12303
12389
  }
12304
- function Gl(e, t) {
12390
+ function Kl(e, t) {
12305
12391
  let n = e.geometryOptions || e.geometry_options || e.parameters || {}, r = {};
12306
12392
  for (let [e, n] of Object.entries(t?.parameters || {})) n && Object.hasOwn(n, "default") && (r[e] = n.default);
12307
12393
  return {
@@ -12309,10 +12395,10 @@ function Gl(e, t) {
12309
12395
  ...n && typeof n == "object" ? n : {}
12310
12396
  };
12311
12397
  }
12312
- function Kl(e, t, n) {
12398
+ function ql(e, t, n) {
12313
12399
  return typeof e != "string" || !e ? n : t[e] || e;
12314
12400
  }
12315
- function ql(e, t = "#ffffff", n = "transparent") {
12401
+ function Jl(e, t = "#ffffff", n = "transparent") {
12316
12402
  let r = document.createElement("canvas");
12317
12403
  r.width = 256, r.height = 256;
12318
12404
  let i = r.getContext("2d");
@@ -12320,11 +12406,101 @@ function ql(e, t = "#ffffff", n = "transparent") {
12320
12406
  let a = new Cr(r);
12321
12407
  return a.colorSpace = y, a;
12322
12408
  }
12323
- function Jl(e) {
12324
- return e.shape === "plane" ? new ea(1, 1) : Ul(e.shape || e.geometry || "box", e.radius, e.segments, e.size);
12409
+ var Yl = /^[AaCcHhLlMmQqSsTtVvZz]$/, Xl = /[-+]?(?:\d*\.\d+|\d+\.?)(?:[eE][-+]?\d+)?|[AaCcHhLlMmQqSsTtVvZz]/g;
12410
+ function Zl(e, t, n, r, i, a, o, s, c) {
12411
+ let l = Math.abs(Number(n)), u = Math.abs(Number(r));
12412
+ if (!l || !u || e === s && t === c) return [[s, c]];
12413
+ 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)));
12414
+ l *= v, u *= v;
12415
+ let y = Math.max(0, l * l * u * u - l * l * _ * _ - u * u * g * g), b = Math.max(2 ** -52, l * l * _ * _ + u * u * g * g), x = (!!a == !!o ? -1 : 1) * Math.sqrt(y / b), S = x * l * _ / u, C = x * -u * g / l, w = f * S - p * C + (e + s) / 2, T = p * S + f * C + (t + c) / 2, E = (e, t, n, r) => {
12416
+ let i = Math.max(2 ** -52, Math.hypot(e, t) * Math.hypot(n, r)), a = Math.acos(Math.max(-1, Math.min(1, (e * n + t * r) / i)));
12417
+ return e * r - t * n < 0 ? -a : a;
12418
+ }, D = (g - S) / l, O = (_ - C) / u, k = (-g - S) / l, A = (-_ - C) / u, j = E(1, 0, D, O), M = E(D, O, k, A);
12419
+ !o && M > 0 && (M -= Math.PI * 2), o && M < 0 && (M += Math.PI * 2);
12420
+ let N = Math.max(6, Math.ceil(Math.abs(M) / (Math.PI / 12)));
12421
+ return Array.from({ length: N }, (e, t) => {
12422
+ let n = j + M * (t + 1) / N, r = Math.cos(n), i = Math.sin(n);
12423
+ return [w + f * l * r - p * u * i, T + p * l * r + f * u * i];
12424
+ });
12425
+ }
12426
+ function Ql(e) {
12427
+ let t = String(e || "").match(Xl) || [], 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 && !Yl.test(t[r]), h = () => Number(t[r++]), g = () => {
12428
+ let e = t[r];
12429
+ return /^[01].+/.test(e) ? (t[r] = e.slice(1), e[0] === "1") : h() !== 0;
12430
+ }, _ = (e, t, n) => [n ? o + e : e, n ? s + t : t];
12431
+ for (; r < t.length && (Yl.test(t[r]) && (i = t[r++]), i);) {
12432
+ let e = i.toLowerCase(), t = i === e;
12433
+ if (e === "z") {
12434
+ n.currentPath?.closePath(), o = c, s = l, a = i, i = "";
12435
+ continue;
12436
+ }
12437
+ if (!m()) break;
12438
+ if (e === "m") {
12439
+ let e = !0;
12440
+ for (; m();) {
12441
+ let [r, i] = _(h(), h(), t);
12442
+ o = r, s = i, e ? (n.moveTo(o, -s), c = o, l = s, e = !1) : n.lineTo(o, -s);
12443
+ }
12444
+ } else if (e === "l") for (; m();) [o, s] = _(h(), h(), t), n.lineTo(o, -s);
12445
+ else if (e === "h") for (; m();) {
12446
+ let e = h();
12447
+ o = t ? o + e : e, n.lineTo(o, -s);
12448
+ }
12449
+ else if (e === "v") for (; m();) {
12450
+ let e = h();
12451
+ s = t ? s + e : e, n.lineTo(o, -s);
12452
+ }
12453
+ else if (e === "c") for (; m();) {
12454
+ let [e, r] = _(h(), h(), t), [c, l] = _(h(), h(), t), [f, p] = _(h(), h(), t);
12455
+ n.currentPath?.bezierCurveTo(e, -r, c, -l, f, -p), o = f, s = p, u = c, d = l, a = i;
12456
+ }
12457
+ else if (e === "s") for (; m();) {
12458
+ let e = ["c", "s"].includes(a.toLowerCase()) ? o * 2 - u : o, r = ["c", "s"].includes(a.toLowerCase()) ? s * 2 - d : s, [c, l] = _(h(), h(), t), [f, p] = _(h(), h(), t);
12459
+ n.currentPath?.bezierCurveTo(e, -r, c, -l, f, -p), o = f, s = p, u = c, d = l, a = i;
12460
+ }
12461
+ else if (e === "q") for (; m();) {
12462
+ let [e, r] = _(h(), h(), t), [c, l] = _(h(), h(), t);
12463
+ n.currentPath?.quadraticCurveTo(e, -r, c, -l), o = c, s = l, f = e, p = r, a = i;
12464
+ }
12465
+ else if (e === "t") for (; m();) {
12466
+ let e = ["q", "t"].includes(a.toLowerCase()) ? o * 2 - f : o, r = ["q", "t"].includes(a.toLowerCase()) ? s * 2 - p : s, [c, l] = _(h(), h(), t);
12467
+ n.currentPath?.quadraticCurveTo(e, -r, c, -l), o = c, s = l, f = e, p = r, a = i;
12468
+ }
12469
+ else if (e === "a") for (; m();) {
12470
+ let e = h(), r = h(), c = h(), l = g(), u = g(), [d, f] = _(h(), h(), t);
12471
+ for (let [t, i] of Zl(o, s, e, r, c, l, u, d, f)) n.lineTo(t, -i);
12472
+ o = d, s = f, a = i;
12473
+ }
12474
+ else break;
12475
+ a = i;
12476
+ }
12477
+ return n;
12478
+ }
12479
+ function $l(e, t = {}) {
12480
+ let n = String(e || "").match(/<path\b[^>]*>/gi) || [], r = [];
12481
+ for (let e of n) {
12482
+ let t = e.match(/\bd\s*=\s*(["'])([\s\S]*?)\1/i);
12483
+ if (!t) continue;
12484
+ let n = Ql(t[2]);
12485
+ r.push(...n.toShapes(!0, !1));
12486
+ }
12487
+ if (!r.length) return new Nn(1, 1, .12);
12488
+ let i = Math.max(0, Math.min(.2, Number(t.bevel) || .055)), a = new Ji(r, {
12489
+ depth: 1,
12490
+ steps: 1,
12491
+ curveSegments: Math.max(2, Math.round(Number(t.curveSegments) || 8)),
12492
+ bevelEnabled: i > 0,
12493
+ bevelSegments: Math.max(1, Math.round(Number(t.bevelSegments) || 2)),
12494
+ bevelSize: i,
12495
+ bevelThickness: i
12496
+ });
12497
+ return a.center(), a;
12325
12498
  }
12326
- function Yl(e, t, n, r, i) {
12327
- let a = Gl(t, e), o = {
12499
+ function eu(e) {
12500
+ return e.shape === "plane" ? new ea(1, 1) : e.shape === "svg-extrude" ? $l(e.svg, e) : Wl(e.shape || e.geometry || "box", e.radius, e.segments, e.size);
12501
+ }
12502
+ function tu(e, t, n, r, i) {
12503
+ let a = Kl(t, e), o = {
12328
12504
  ...n,
12329
12505
  ...e.palette || {},
12330
12506
  ...t.geometryPalette || t.geometry_palette || {}
@@ -12339,25 +12515,27 @@ function Yl(e, t, n, r, i) {
12339
12515
  if (!c.length) throw Error(`Geometry '${e.id}' did not produce any parts.`);
12340
12516
  let l = new Qn(), u = [], d = [];
12341
12517
  for (let a of c) {
12342
- let s = Jl(a);
12343
- Wl(s);
12344
- let c = a.color || "component", f = Kl(c, o, n.component || $c.component), p = new ia({
12518
+ let s = eu(a);
12519
+ Gl(s);
12520
+ let c = a.color || "component", f = ql(c, o, n.component || el.component), p = a.emissive || "#000000", m = new ia({
12345
12521
  color: f,
12522
+ emissive: ql(p, o, "#000000"),
12523
+ emissiveIntensity: Number.isFinite(Number(a.emissiveIntensity)) ? Math.max(0, Number(a.emissiveIntensity)) : 0,
12346
12524
  roughness: Number.isFinite(Number(a.roughness)) ? Number(a.roughness) : .72,
12347
12525
  metalness: Number.isFinite(Number(a.metalness)) ? Number(a.metalness) : .06,
12348
12526
  transparent: a.transparent === !0 || Number(a.opacity) < 1,
12349
12527
  opacity: Number.isFinite(Number(a.opacity)) ? Number(a.opacity) : 1,
12350
12528
  side: a.doubleSided ? 2 : 0
12351
- }), m, h = a.icon, g = a.image;
12352
- if (typeof g == "string" && g) {
12529
+ }), h, g = a.icon, _ = a.image;
12530
+ if (typeof _ == "string" && _) {
12353
12531
  let n = new Image();
12354
- n.crossOrigin = "anonymous", p.map = new ke(n);
12355
- let o = !1, s = null, c = /^\s*<svg(?:\s|>)/i.test(g) || /^data:image\/svg\+xml/i.test(g) || /\.svg(?:[?#]|$)/i.test(g), l = new AbortController(), u = () => {
12532
+ n.crossOrigin = "anonymous", m.map = new ke(n);
12533
+ let o = !1, s = null, c = /^\s*<svg(?:\s|>)/i.test(_) || /^data:image\/svg\+xml/i.test(_) || /\.svg(?:[?#]|$)/i.test(_), l = new AbortController(), u = () => {
12356
12534
  s &&= (URL.revokeObjectURL(s), null);
12357
12535
  }, d = () => {
12358
- n.removeEventListener("load", f), n.removeEventListener("error", h);
12536
+ n.removeEventListener("load", f), n.removeEventListener("error", p);
12359
12537
  }, f = () => {
12360
- if (d(), o || !p.map) {
12538
+ if (d(), o || !m.map) {
12361
12539
  u();
12362
12540
  return;
12363
12541
  }
@@ -12366,64 +12544,65 @@ function Yl(e, t, n, r, i) {
12366
12544
  r.width = e >= 1 ? t : Math.max(1, Math.round(t * e)), r.height = e >= 1 ? Math.max(1, Math.round(t / e)) : t;
12367
12545
  let i = r.getContext("2d");
12368
12546
  if (!i) throw Error("Canvas 2D is unavailable");
12369
- i.clearRect(0, 0, r.width, r.height), i.drawImage(n, 0, 0, r.width, r.height), p.map.image = r;
12547
+ i.clearRect(0, 0, r.width, r.height), i.drawImage(n, 0, 0, r.width, r.height), m.map.image = r;
12370
12548
  } catch (n) {
12371
12549
  i?.({
12372
12550
  code: "SVG_RASTERIZE_FAILED",
12373
12551
  geometry: e.id,
12374
12552
  entityId: t.id,
12375
- image: g,
12553
+ image: _,
12376
12554
  error: n
12377
12555
  });
12378
12556
  }
12379
12557
  u();
12380
- let s = a.imageFit || a.fit || "stretch", l = n.naturalWidth / Math.max(1, n.naturalHeight), f = Math.abs(Number(a.size?.[0])) || 1, h = Math.abs(Number(a.size?.[1])) || 1, _ = f / h;
12381
- s === "cover" ? l > _ ? (p.map.repeat.set(_ / l, 1), p.map.offset.set((1 - p.map.repeat.x) / 2, 0)) : (p.map.repeat.set(1, l / _), p.map.offset.set(0, (1 - p.map.repeat.y) / 2)) : s === "contain" && m && (l > _ ? m.scale.y = f / l : m.scale.x = h * l), p.map.needsUpdate = !0, r?.();
12382
- }, h = () => {
12558
+ let s = a.imageFit || a.fit || "stretch", l = n.naturalWidth / Math.max(1, n.naturalHeight), f = Math.abs(Number(a.size?.[0])) || 1, p = Math.abs(Number(a.size?.[1])) || 1, g = f / p;
12559
+ s === "cover" ? l > g ? (m.map.repeat.set(g / l, 1), m.map.offset.set((1 - m.map.repeat.x) / 2, 0)) : (m.map.repeat.set(1, l / g), m.map.offset.set(0, (1 - m.map.repeat.y) / 2)) : s === "contain" && h && (l > g ? h.scale.y = f / l : h.scale.x = p * l), m.map.needsUpdate = !0, r?.();
12560
+ }, p = () => {
12383
12561
  d(), u(), o || (i?.({
12384
12562
  code: "IMAGE_LOAD_FAILED",
12385
12563
  geometry: e.id,
12386
12564
  entityId: t.id,
12387
- image: g
12565
+ image: _
12388
12566
  }), r?.());
12389
12567
  };
12390
- p.userData.atlasImageCleanup = () => {
12568
+ m.userData.atlasImageCleanup = () => {
12391
12569
  o = !0, l.abort(), d(), u(), n.src = "";
12392
- }, n.addEventListener("load", f), n.addEventListener("error", h), (async () => {
12393
- if (/^\s*<svg(?:\s|>)/i.test(g)) {
12394
- s = URL.createObjectURL(new Blob([g], { type: "image/svg+xml" })), n.src = s;
12570
+ }, n.addEventListener("load", f), n.addEventListener("error", p), (async () => {
12571
+ if (/^\s*<svg(?:\s|>)/i.test(_)) {
12572
+ s = URL.createObjectURL(new Blob([_], { type: "image/svg+xml" })), n.src = s;
12395
12573
  return;
12396
12574
  }
12397
- if (/^(?:data|blob):/i.test(g)) {
12398
- n.src = g;
12575
+ if (/^(?:data|blob):/i.test(_)) {
12576
+ n.src = _;
12399
12577
  return;
12400
12578
  }
12401
12579
  try {
12402
- let e = await fetch(g, {
12580
+ let e = await fetch(_, {
12403
12581
  mode: "cors",
12404
12582
  signal: l.signal
12405
12583
  });
12406
12584
  if (!e.ok) throw Error(`Image request failed with ${e.status}`);
12407
- let t = await e.blob(), r = e.headers.get("content-type") || t.type, i = /image\/svg\+xml/i.test(r) || /\.svg(?:[?#]|$)/i.test(g);
12585
+ let t = await e.blob(), r = e.headers.get("content-type") || t.type, i = /image\/svg\+xml/i.test(r) || /\.svg(?:[?#]|$)/i.test(_);
12408
12586
  if (c ||= i, i && t.type !== "image/svg+xml" && (t = new Blob([await t.text()], { type: "image/svg+xml" })), o) return;
12409
12587
  s = URL.createObjectURL(t), n.src = s;
12410
12588
  } catch (e) {
12411
12589
  if (o || e?.name === "AbortError") return;
12412
- n.src = g;
12590
+ n.src = _;
12413
12591
  }
12414
- })(), p.map.colorSpace = y, p.needsUpdate = !0;
12415
- } else h != null && h !== "" && (p.map = ql(h, Kl(a.iconColor || "#ffffff", o, "#ffffff"), Kl(a.iconBackground || "transparent", o, "transparent")), p.transparent = !0, p.needsUpdate = !0);
12416
- if (m = new An(s, p), m.position.fromArray(Array.isArray(a.position) ? a.position : [
12592
+ })(), m.map.colorSpace = y, m.needsUpdate = !0;
12593
+ } else g != null && g !== "" && (m.map = Jl(g, ql(a.iconColor || "#ffffff", o, "#ffffff"), ql(a.iconBackground || "transparent", o, "transparent")), m.transparent = !0, m.needsUpdate = !0);
12594
+ if (h = new An(s, m), h.position.fromArray(Array.isArray(a.position) ? a.position : [
12417
12595
  0,
12418
12596
  0,
12419
12597
  0
12420
- ]), m.scale.fromArray(Array.isArray(a.size) ? a.size : [
12598
+ ]), h.scale.fromArray(Array.isArray(a.size) ? a.size : [
12421
12599
  1,
12422
12600
  1,
12423
12601
  1
12424
- ]), Array.isArray(a.rotation) && m.rotation.set(...a.rotation.map(Number)), l.add(m), d.push(m), u.push({
12425
- material: p,
12602
+ ]), Array.isArray(a.rotation) && h.rotation.set(...a.rotation.map(Number)), l.add(h), d.push(h), u.push({
12603
+ material: m,
12426
12604
  value: c,
12605
+ emissiveValue: p,
12427
12606
  palette: o
12428
12607
  }), a.edges !== !1 && a.shape !== "plane") {
12429
12608
  let e = new ur({
@@ -12431,7 +12610,7 @@ function Yl(e, t, n, r, i) {
12431
12610
  transparent: !0,
12432
12611
  opacity: Number.isFinite(Number(a.edgeOpacity)) ? Number(a.edgeOpacity) : .55
12433
12612
  }), t = new Sr(new Pr(s, 22), e);
12434
- t.position.copy(m.position), t.rotation.copy(m.rotation), t.scale.copy(m.scale), l.add(t), u.push({
12613
+ t.position.copy(h.position), t.rotation.copy(h.rotation), t.scale.copy(h.scale), l.add(t), u.push({
12435
12614
  material: e,
12436
12615
  value: a.edgeColor || c,
12437
12616
  palette: o
@@ -12448,7 +12627,7 @@ function Yl(e, t, n, r, i) {
12448
12627
  descriptor: s
12449
12628
  };
12450
12629
  }
12451
- function Xl(e, t, n, r = "", i = !0) {
12630
+ function nu(e, t, n, r = "", i = !0) {
12452
12631
  let a = document.createElement("canvas"), o = a.getContext("2d"), s = n.x * .88, c = Math.min(.82, n.y * .64);
12453
12632
  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);
12454
12633
  let l = a.height * .62;
@@ -12485,7 +12664,7 @@ function Xl(e, t, n, r = "", i = !0) {
12485
12664
  let C = new An(b, v);
12486
12665
  C.rotation.y = Math.PI, C.position.set(0, n.y / 2 - .09 - c / 2, -n.z / 2 - .012);
12487
12666
  let w = new An(b, v.clone());
12488
- w.rotation.x = -Math.PI / 2, w.position.set(0, n.y / 2 + .012, 0), w.visible = yl(r), x.add(S, C, w);
12667
+ w.rotation.x = -Math.PI / 2, w.position.set(0, n.y / 2 + .012, 0), w.visible = bl(r), x.add(S, C, w);
12489
12668
  for (let e of [
12490
12669
  S,
12491
12670
  C,
@@ -12493,7 +12672,7 @@ function Xl(e, t, n, r = "", i = !0) {
12493
12672
  ]) e.renderOrder = 20, e.frustumCulled = !1, e.material.depthTest = !0, e.material.depthWrite = !1, e.material.transparent = !0;
12494
12673
  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;
12495
12674
  }
12496
- function Zl(e, t, n, r = globalThis.document) {
12675
+ function ru(e, t, n, r = globalThis.document) {
12497
12676
  if (!e || !t || !n || !r?.createElement) return null;
12498
12677
  try {
12499
12678
  e.render(t, n);
@@ -12515,8 +12694,8 @@ function Zl(e, t, n, r = globalThis.document) {
12515
12694
  return null;
12516
12695
  }
12517
12696
  }
12518
- var Ql = class extends HTMLElement {
12519
- static version = Qc;
12697
+ var iu = class extends HTMLElement {
12698
+ static version = $c;
12520
12699
  static get observedAttributes() {
12521
12700
  return [
12522
12701
  "height",
@@ -12533,23 +12712,23 @@ var Ql = class extends HTMLElement {
12533
12712
  ];
12534
12713
  }
12535
12714
  static registerGeometryPack(e) {
12536
- return ml(e);
12715
+ return hl(e);
12537
12716
  }
12538
12717
  static unregisterGeometryPack(e) {
12539
- return hl(e);
12718
+ return gl(e);
12540
12719
  }
12541
12720
  static getGeometryCatalog() {
12542
- return gl();
12721
+ return _l();
12543
12722
  }
12544
12723
  static getGeometryPackCatalog() {
12545
- return _l();
12724
+ return vl();
12546
12725
  }
12547
12726
  constructor() {
12548
- super(), this.attachShadow({ mode: "open" }), this.shadowRoot.innerHTML = "<style>" + Ol + kl + Al + "</style>" + Fl, 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 = El(), this.relationMode = this.getAttribute("relation-mode") || "selected", this.focusFilter = bl({
12727
+ super(), this.attachShadow({ mode: "open" }), this.shadowRoot.innerHTML = "<style>" + kl + Al + jl + "</style>" + Il, 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 = Dl(), this.relationMode = this.getAttribute("relation-mode") || "selected", this.focusFilter = xl({
12549
12728
  mode: this.getAttribute("focus-mode"),
12550
12729
  effect: this.getAttribute("focus-effect"),
12551
12730
  layout: this.getAttribute("focus-layout")
12552
- }), this.selectionMode = ["internal", "event"].includes(this.getAttribute("selection-mode")) ? this.getAttribute("selection-mode") : "internal", this.selectionNavigation = xl(this.getAttribute("selection-navigation")), this.itemFacing = Sl(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 = () => {
12731
+ }), this.selectionMode = ["internal", "event"].includes(this.getAttribute("selection-mode")) ? this.getAttribute("selection-mode") : "internal", this.selectionNavigation = Sl(this.getAttribute("selection-navigation")), this.itemFacing = Cl(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 = () => {
12553
12732
  this.ready && this.modelData && this._build();
12554
12733
  }, this._bindControls(), this._syncFocusToolbar(), this._syncRelationToolbar(), this._syncLabelsToolbar(), this._syncPanelToolbar(), this._syncItemFacingToolbar(), this.resizeObserver = new ResizeObserver(() => this.resize()), this.resizeObserver.observe(this.canvas);
12555
12734
  }
@@ -12561,7 +12740,7 @@ var Ql = class extends HTMLElement {
12561
12740
  }
12562
12741
  attributeChangedCallback(e, t, n) {
12563
12742
  if (t !== n) {
12564
- 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" && Sl(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) {
12743
+ 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" && Cl(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) {
12565
12744
  let e = n !== "false";
12566
12745
  e !== this.showShellLabels && (this.showShellLabels = e, this._build({
12567
12746
  preserveSelection: this.selected?.id,
@@ -12598,13 +12777,13 @@ var Ql = class extends HTMLElement {
12598
12777
  } : null;
12599
12778
  }
12600
12779
  get palette() {
12601
- return this.modelData?.palette || { ...$c };
12780
+ return this.modelData?.palette || { ...el };
12602
12781
  }
12603
12782
  set palette(e) {
12604
12783
  this.setPalette(e);
12605
12784
  }
12606
12785
  captureFrame() {
12607
- return Zl(this.renderer, this.scene, this.camera, this.ownerDocument);
12786
+ return ru(this.renderer, this.scene, this.camera, this.ownerDocument);
12608
12787
  }
12609
12788
  prepareForPrint() {
12610
12789
  if (this._printState) return this;
@@ -12709,13 +12888,13 @@ var Ql = class extends HTMLElement {
12709
12888
  if (!e.size) return null;
12710
12889
  for (let t of [...e]) {
12711
12890
  let n = this.nodes.get(t);
12712
- n && yl(n.type) && this._descendantIds(t, e);
12891
+ n && bl(n.type) && this._descendantIds(t, e);
12713
12892
  }
12714
12893
  let t = new Set(e);
12715
12894
  for (let n of this.relations) (t.has(n.from) || t.has(n.to)) && (e.add(n.from), e.add(n.to));
12716
12895
  for (let t of [...e]) {
12717
12896
  let n = this.nodes.get(t);
12718
- n && yl(n.type) && this._descendantIds(t, e);
12897
+ n && bl(n.type) && this._descendantIds(t, e);
12719
12898
  }
12720
12899
  for (let t of [...e]) {
12721
12900
  let n = this.nodes.get(t)?.parent ? this.nodes.get(this.nodes.get(t).parent) : null;
@@ -12792,7 +12971,7 @@ var Ql = class extends HTMLElement {
12792
12971
  });
12793
12972
  }
12794
12973
  setFocusFilter(e = {}, t = {}) {
12795
- let n = bl({
12974
+ let n = xl({
12796
12975
  ...this.focusFilter,
12797
12976
  ...e || {}
12798
12977
  }), r = JSON.stringify(n) !== JSON.stringify(this.focusFilter);
@@ -12810,7 +12989,7 @@ var Ql = class extends HTMLElement {
12810
12989
  "none"
12811
12990
  ].includes(e.relationMode) && e.relationMode !== this.relationMode && this.setRelationMode(e.relationMode), Object.hasOwn(e, "selectionMode") && e.selectionMode !== this.selectionMode && this.setSelectionMode(e.selectionMode);
12812
12991
  let t = e.navigation?.onSelect ?? e.selectionNavigation;
12813
- 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") && Sl(e.itemFacing) !== this.itemFacing && this.setItemFacing(e.itemFacing, {
12992
+ 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") && Cl(e.itemFacing) !== this.itemFacing && this.setItemFacing(e.itemFacing, {
12814
12993
  emit: !1,
12815
12994
  source: "model"
12816
12995
  }), e.focus && this.setFocusFilter(e.focus, { emit: !1 }), this;
@@ -12823,10 +13002,10 @@ var Ql = class extends HTMLElement {
12823
13002
  }));
12824
13003
  }
12825
13004
  _containerEntityIds() {
12826
- return (this.modelData?.entities || []).filter((e) => yl(e.type)).map((e) => e.id);
13005
+ return (this.modelData?.entities || []).filter((e) => bl(e.type)).map((e) => e.id);
12827
13006
  }
12828
13007
  _declaredOpenContainerIds() {
12829
- return (this.modelData?.entities || []).filter((e) => yl(e.type) && e.open === !0).map((e) => e.id);
13008
+ return (this.modelData?.entities || []).filter((e) => bl(e.type) && e.open === !0).map((e) => e.id);
12830
13009
  }
12831
13010
  _emitContainerStateChange(e, t = {}) {
12832
13011
  if (!e?.changed || t.emit === !1) return;
@@ -12884,7 +13063,7 @@ var Ql = class extends HTMLElement {
12884
13063
  }
12885
13064
  _commitModelChange(e, t = {}, n = {}) {
12886
13065
  let r = n.preserveSelection === !1 ? null : this.selected?.id, i = n.preserveSelection === !1 ? null : this._publicRelation(this.selectedRelationIndex), a = i?.id ?? i?.index ?? null;
12887
- this.modelData = Rl(this.modelData);
13066
+ this.modelData = zl(this.modelData);
12888
13067
  let o = this._syncInitialContainerState({
12889
13068
  refresh: !1,
12890
13069
  emit: !1,
@@ -12901,7 +13080,7 @@ var Ql = class extends HTMLElement {
12901
13080
  }
12902
13081
  updateModel(e = {}, t = {}) {
12903
13082
  if (!e || typeof e != "object" || Array.isArray(e)) throw TypeError("El parche del modelo debe ser un objeto.");
12904
- let n = this.modelData || Rl({}), r = JSON.stringify(n.render?.camera || null), i = {
13083
+ let n = this.modelData || zl({}), r = JSON.stringify(n.render?.camera || null), i = {
12905
13084
  ...n,
12906
13085
  ...e,
12907
13086
  palette: e.palette ? {
@@ -12912,11 +13091,11 @@ var Ql = class extends HTMLElement {
12912
13091
  entities: Array.isArray(e.entities) ? e.entities : n.entities,
12913
13092
  relations: Array.isArray(e.relations) ? e.relations : n.relations
12914
13093
  };
12915
- return this.modelData = Rl(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;
13094
+ return this.modelData = zl(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;
12916
13095
  }
12917
13096
  addEntity(e, t = {}) {
12918
13097
  if (!e || typeof e != "object" || !e.id) throw TypeError("La entidad debe incluir un id.");
12919
- if (this.modelData ||= Rl({}), this.modelData.entities.some((t) => t.id === e.id)) throw Error(`Ya existe una entidad con id "${e.id}".`);
13098
+ if (this.modelData ||= zl({}), this.modelData.entities.some((t) => t.id === e.id)) throw Error(`Ya existe una entidad con id "${e.id}".`);
12920
13099
  if (e.parent && !this.modelData.entities.some((t) => t.id === e.parent)) throw Error(`No existe el contenedor padre "${e.parent}".`);
12921
13100
  return this.modelData.entities = [...this.modelData.entities, { ...e }], this._commitModelChange("entity-add", { entity: this._publicEntity(e.id) }, t);
12922
13101
  }
@@ -12993,10 +13172,10 @@ var Ql = class extends HTMLElement {
12993
13172
  return this.targetZoom = Math.min(2.8, this.targetZoom * 1.18), this.invalidate(), this;
12994
13173
  }
12995
13174
  zoomOut() {
12996
- return this.targetZoom = Math.max(el, this.targetZoom / 1.18), this.invalidate(), this;
13175
+ return this.targetZoom = Math.max(tl, this.targetZoom / 1.18), this.invalidate(), this;
12997
13176
  }
12998
13177
  setSelectionNavigation(e) {
12999
- let t = xl(e);
13178
+ let t = Sl(e);
13000
13179
  return this.selectionNavigation = t, this.getAttribute("selection-navigation") !== t && this.setAttribute("selection-navigation", t), this;
13001
13180
  }
13002
13181
  focusSelection(e = {}) {
@@ -13009,7 +13188,7 @@ var Ql = class extends HTMLElement {
13009
13188
  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;
13010
13189
  }
13011
13190
  _applySelectionNavigation(e = this.selectionNavigation) {
13012
- let t = xl(e);
13191
+ let t = Sl(e);
13013
13192
  if (t === "preserve") return this;
13014
13193
  let n = this.targetZoom;
13015
13194
  return this.focusSelection(), t === "center" && (this.targetZoom = n), this;
@@ -13034,7 +13213,7 @@ var Ql = class extends HTMLElement {
13034
13213
  return Math.max(29, 39.5 / Math.max(this.camera.aspect, .5));
13035
13214
  }
13036
13215
  getCameraView() {
13037
- let e = this.focus.clone(), t = this._baseCameraDistance() / Math.max(el, 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)));
13216
+ 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)));
13038
13217
  return {
13039
13218
  position: r(n.toArray()),
13040
13219
  target: r(e.toArray()),
@@ -13048,7 +13227,7 @@ var Ql = class extends HTMLElement {
13048
13227
  if (!(a > 1e-6)) return this;
13049
13228
  this.yaw = Math.atan2(i.x, i.z), this.pitch = Math.asin(Math.max(-1, Math.min(1, i.y / a)));
13050
13229
  let o = Number(e.zoom), s = Number.isFinite(o) && o > 0 ? o : this._baseCameraDistance() / a;
13051
- return this.targetFocus.copy(r), this.targetZoom = Math.max(el, Math.min(2.8, s)), t.animate === !1 && (this.focus.copy(this.targetFocus), this.zoom = this.targetZoom), this.invalidate(), this;
13230
+ 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;
13052
13231
  }
13053
13232
  restoreInitialCamera(e = {}) {
13054
13233
  let t = this.modelData?.render?.camera;
@@ -13065,7 +13244,7 @@ var Ql = class extends HTMLElement {
13065
13244
  t.expandByPoint(n.clone().sub(r)), t.expandByPoint(n.clone().add(r));
13066
13245
  }
13067
13246
  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();
13068
- return this.targetZoom = Math.max(el, 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;
13247
+ 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;
13069
13248
  }
13070
13249
  frontView() {
13071
13250
  return this.yaw = 0, this.pitch = 0, this.invalidate(), this;
@@ -13081,7 +13260,7 @@ var Ql = class extends HTMLElement {
13081
13260
  return this.setShellLabels(!this.showShellLabels);
13082
13261
  }
13083
13262
  setItemFacing(e = "camera", t = {}) {
13084
- let n = Sl(e), r = n !== this.itemFacing;
13263
+ let n = Cl(e), r = n !== this.itemFacing;
13085
13264
  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", {
13086
13265
  mode: n,
13087
13266
  source: t.source || "api"
@@ -13091,7 +13270,7 @@ var Ql = class extends HTMLElement {
13091
13270
  return this.setItemFacing(this.itemFacing === "camera" ? "model" : "camera", e);
13092
13271
  }
13093
13272
  _applyItemFacing() {
13094
- if (this.camera) for (let e of this.nodes.values()) e.group && !yl(e.type) && (this.itemFacing === "camera" ? e.group.quaternion.copy(this.camera.quaternion) : e.group.quaternion.identity());
13273
+ if (this.camera) for (let e of this.nodes.values()) e.group && !bl(e.type) && (this.itemFacing === "camera" ? e.group.quaternion.copy(this.camera.quaternion) : e.group.quaternion.identity());
13095
13274
  }
13096
13275
  isContainerOpen(e) {
13097
13276
  return this._containerEntityIds().includes(e) && this.open.has(e);
@@ -13106,14 +13285,14 @@ var Ql = class extends HTMLElement {
13106
13285
  setContainerOpen(e, t = !0, n = {}) {
13107
13286
  let r = this.modelData?.entities?.find((t) => t.id === e);
13108
13287
  if (!r) throw Error(`No existe una entidad con id "${e}".`);
13109
- if (!yl(r.type)) throw TypeError(`La entidad "${e}" no es un contenedor.`);
13288
+ if (!bl(r.type)) throw TypeError(`La entidad "${e}" no es un contenedor.`);
13110
13289
  let i = new Set(this.open);
13111
13290
  if (t) i.add(e);
13112
13291
  else if (i.delete(e), n.closeDescendants !== !1) for (let t of this.modelData.entities) {
13113
13292
  let n = t.parent, r = /* @__PURE__ */ new Set();
13114
13293
  for (; n && !r.has(n);) {
13115
13294
  if (r.add(n), n === e) {
13116
- yl(t.type) && i.delete(t.id);
13295
+ bl(t.type) && i.delete(t.id);
13117
13296
  break;
13118
13297
  }
13119
13298
  n = this.modelData.entities.find((e) => e.id === n)?.parent || null;
@@ -13150,13 +13329,13 @@ var Ql = class extends HTMLElement {
13150
13329
  this.setTheme(e);
13151
13330
  }
13152
13331
  get theme() {
13153
- return this._theme || El();
13332
+ return this._theme || Dl();
13154
13333
  }
13155
13334
  set theme(e) {
13156
- this._theme = El(e), this.shadowRoot && this._applyTheme();
13335
+ this._theme = Dl(e), this.shadowRoot && this._applyTheme();
13157
13336
  }
13158
13337
  setTheme(e = {}) {
13159
- return this.theme = Tl(this.theme, e), this.modelData && (this.modelData.theme = this.theme), this._applyLighting(), this.invalidate(), this;
13338
+ return this.theme = El(this.theme, e), this.modelData && (this.modelData.theme = this.theme), this._applyLighting(), this.invalidate(), this;
13160
13339
  }
13161
13340
  _applyTheme() {
13162
13341
  let e = this.theme, t = this.style;
@@ -13173,7 +13352,7 @@ var Ql = class extends HTMLElement {
13173
13352
  if (e) return this.load(e);
13174
13353
  let t = this.querySelector("script[type=\"application/json\"]");
13175
13354
  if (!t) return this.load({
13176
- palette: $c,
13355
+ palette: el,
13177
13356
  entities: [],
13178
13357
  relations: []
13179
13358
  });
@@ -13187,7 +13366,7 @@ var Ql = class extends HTMLElement {
13187
13366
  this._loading = !0, this._pendingSelection = null;
13188
13367
  try {
13189
13368
  let t = typeof e == "string" ? await fetch(e).then((e) => e.json()) : e;
13190
- this.modelData = Rl(t), this.selected = null, this.selectedRelationIndex = null, this.open.clear(), this._initialOpenContainers.clear(), this._pendingPalette &&= (this.modelData.palette = {
13369
+ this.modelData = zl(t), this.selected = null, this.selectedRelationIndex = null, this.open.clear(), this._initialOpenContainers.clear(), this._pendingPalette &&= (this.modelData.palette = {
13191
13370
  ...this.modelData.palette,
13192
13371
  ...this._pendingPalette
13193
13372
  }, null), this.theme = this.modelData.theme, this._applyTheme(), this._syncInitialContainerState({
@@ -13206,7 +13385,7 @@ var Ql = class extends HTMLElement {
13206
13385
  _ensureRenderer() {
13207
13386
  if (this.renderer) return !0;
13208
13387
  try {
13209
- return this.renderer = new Zc({
13388
+ return this.renderer = new Qc({
13210
13389
  canvas: this.canvas,
13211
13390
  antialias: !0,
13212
13391
  alpha: !0,
@@ -13218,9 +13397,9 @@ var Ql = class extends HTMLElement {
13218
13397
  }
13219
13398
  _applyLighting() {
13220
13399
  if (!this.ambientLight || !this.directionalLight) return;
13221
- let e = this.theme?.lighting || wl.lighting;
13400
+ let e = this.theme?.lighting || Tl.lighting;
13222
13401
  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;
13223
- let t = Array.isArray(e.directionalPosition) ? e.directionalPosition : wl.lighting.directionalPosition;
13402
+ let t = Array.isArray(e.directionalPosition) ? e.directionalPosition : Tl.lighting.directionalPosition;
13224
13403
  this.directionalLight.position.fromArray(t);
13225
13404
  }
13226
13405
  _worldPosition(e, t = /* @__PURE__ */ new Set()) {
@@ -13257,7 +13436,7 @@ var Ql = class extends HTMLElement {
13257
13436
  ...e.geometryPalette || {},
13258
13437
  ...e.geometryPaletteOverrides || {}
13259
13438
  };
13260
- n.material.color.set(Kl(n.value, r, t));
13439
+ n.material.color.set(ql(n.value, r, t)), n.material.emissive && n.emissiveValue && n.material.emissive.set(ql(n.emissiveValue, r, "#000000"));
13261
13440
  }
13262
13441
  }
13263
13442
  }
@@ -13270,19 +13449,19 @@ var Ql = class extends HTMLElement {
13270
13449
  for (let e of this.modelData.entities) {
13271
13450
  let t = this.nodes.get(e.id);
13272
13451
  t.group = new Qn(), t.group.position.copy(this._worldPosition(t));
13273
- let n = e.geometry || "box", r = vl(n), i = !r && n.includes("."), a = i ? "#ed8f98" : this.modelData.palette[e.c] || e.c || this.modelData.palette.component;
13452
+ let n = e.geometry || "box", r = yl(n), i = !r && n.includes("."), a = i ? "#ed8f98" : this.modelData.palette[e.c] || e.c || this.modelData.palette.component;
13274
13453
  i && this.dispatchEvent(new CustomEvent("lc-warning", { detail: {
13275
13454
  code: "GEOMETRY_NOT_REGISTERED",
13276
13455
  geometry: n,
13277
13456
  entityId: e.id
13278
13457
  } }));
13279
- let o = r?.primitive || n, s = r && !r.primitive && !yl(e.type);
13458
+ let o = r?.primitive || n, s = r && !r.primitive && !bl(e.type);
13280
13459
  if (t.geometryDefinition = r || null, t.geometryMissing = i, t.geometryPalette = r?.palette || {}, t.geometryPaletteOverrides = e.geometryPalette || e.geometry_palette || {}, t.ports = {
13281
13460
  ...r?.anchors || {},
13282
13461
  ...e.ports || {}
13283
13462
  }, s) {
13284
13463
  try {
13285
- let n = Yl(r, e, this.modelData.palette, () => this.invalidate(), (e) => this.dispatchEvent(new CustomEvent("lc-warning", { detail: e })));
13464
+ let n = tu(r, e, this.modelData.palette, () => this.invalidate(), (e) => this.dispatchEvent(new CustomEvent("lc-warning", { detail: e })));
13286
13465
  n.root.scale.multiply(new U().fromArray(e.s)), t.appearanceMaterials = [], n.root.traverse((e) => {
13287
13466
  if (!(e.isMesh || e.isLine || e.isLineSegments || e.isSprite)) return;
13288
13467
  e.userData.node = t;
@@ -13303,7 +13482,7 @@ var Ql = class extends HTMLElement {
13303
13482
  entityId: e.id,
13304
13483
  error: r
13305
13484
  } }));
13306
- let i = Wl(Ul("box"));
13485
+ let i = Gl(Wl("box"));
13307
13486
  t.material = new ia({
13308
13487
  color: "#ed8f98",
13309
13488
  roughness: .72,
@@ -13312,13 +13491,13 @@ var Ql = class extends HTMLElement {
13312
13491
  }
13313
13492
  t.labelSize = new U().fromArray(e.s);
13314
13493
  } else {
13315
- let n = o === "box" && Number(e.radius) > 0, r = Ul(o, e.radius, e.segments, e.s);
13316
- n || Wl(r), t.material = new ia({
13494
+ let n = o === "box" && Number(e.radius) > 0, r = Wl(o, e.radius, e.segments, e.s);
13495
+ n || Gl(r), t.material = new ia({
13317
13496
  color: a,
13318
13497
  roughness: .72,
13319
13498
  metalness: .06,
13320
13499
  transparent: !0,
13321
- opacity: yl(e.type) ? .96 : 1
13500
+ opacity: bl(e.type) ? .96 : 1
13322
13501
  }), t.mesh = new An(r, t.material), t.mesh.scale.fromArray(n ? [
13323
13502
  1,
13324
13503
  1,
@@ -13333,7 +13512,7 @@ var Ql = class extends HTMLElement {
13333
13512
  1
13334
13513
  ] : e.s), t.group.add(t.edge);
13335
13514
  }
13336
- t.label = Xl(e.name, a, t.labelSize, e.type, this.showShellLabels), t.label.userData.node = t, t.label.traverse((e) => {
13515
+ t.label = nu(e.name, a, t.labelSize, e.type, this.showShellLabels), t.label.userData.node = t, t.label.traverse((e) => {
13337
13516
  e.userData.node = t;
13338
13517
  }), t.group.add(t.label), this.scene.add(t.group);
13339
13518
  }
@@ -13372,7 +13551,7 @@ var Ql = class extends HTMLElement {
13372
13551
  }
13373
13552
  _rebuildRelations() {
13374
13553
  this._clearRelationGroup();
13375
- let e = this._activeRelationIndexes(), t = this._focusedEntityIds(), n = new X(this.modelData?.palette.connection || $c.connection);
13554
+ let e = this._activeRelationIndexes(), t = this._focusedEntityIds(), n = new X(this.modelData?.palette.connection || el.connection);
13376
13555
  for (let r of e) {
13377
13556
  let e = this.relations[r], i = this.nodes.get(e.from), a = this.nodes.get(e.to);
13378
13557
  if (!i || !a) continue;
@@ -13380,7 +13559,7 @@ var Ql = class extends HTMLElement {
13380
13559
  if (!o && this.focusFilter.effect === "hide") continue;
13381
13560
  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);
13382
13561
  if (u.lengthSq() < .01) continue;
13383
- let d = Dl(e), f = r === this.selectedRelationIndex, p = (e, t = .055, n = .88) => {
13562
+ let d = Ol(e), f = r === this.selectedRelationIndex, p = (e, t = .055, n = .88) => {
13384
13563
  let r = new rn({
13385
13564
  color: e,
13386
13565
  transparent: !0,
@@ -13390,7 +13569,7 @@ var Ql = class extends HTMLElement {
13390
13569
  });
13391
13570
  f && (r.color.lerp(new X(16777215), .28), r.opacity = 1);
13392
13571
  let i = new An(new ra(new ri(c, l), 10, f ? t * 1.45 : t, 6, !1), r);
13393
- return i.renderOrder = tl, this.relationGroup.add(i), i;
13572
+ return i.renderOrder = nl, this.relationGroup.add(i), i;
13394
13573
  }, m = new An(new ra(new ri(c, l), 10, .16, 6, !1), new rn({
13395
13574
  transparent: !0,
13396
13575
  opacity: 0,
@@ -13409,7 +13588,7 @@ var Ql = class extends HTMLElement {
13409
13588
  opacity: (f ? 1 : .9) * s,
13410
13589
  depthWrite: !1
13411
13590
  }));
13412
- 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 = tl, this.relationGroup.add(a);
13591
+ 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);
13413
13592
  }
13414
13593
  continue;
13415
13594
  }
@@ -13422,7 +13601,7 @@ var Ql = class extends HTMLElement {
13422
13601
  opacity: (f ? 1 : .9) * s,
13423
13602
  depthWrite: !1
13424
13603
  }));
13425
- 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 = tl, this.relationGroup.add(t);
13604
+ 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);
13426
13605
  }
13427
13606
  }
13428
13607
  }
@@ -13430,8 +13609,8 @@ var Ql = class extends HTMLElement {
13430
13609
  if (!this.modelData) return;
13431
13610
  let e = this.selectedRelationIndex === null ? null : this.relations[this.selectedRelationIndex];
13432
13611
  if (e) {
13433
- let t = Dl(e), n = e.text ? "<p>" + Il(e.text) + "</p>" : "", r = Ll(e.url);
13434
- 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>" + Il(e.label || `${e.from} → ${e.to}`) + "</h2><div class=\"sub\">" + Il(e.from) + " → " + Il(e.to) + "</div>" + n + r + "<h3>MODO</h3><p>" + Il(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();
13612
+ let t = Ol(e), n = e.text ? "<p>" + Ll(e.text) + "</p>" : "", r = Rl(e.url);
13613
+ 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>" + Ll(e.label || `${e.from} → ${e.to}`) + "</h2><div class=\"sub\">" + Ll(e.from) + " → " + Ll(e.to) + "</div>" + n + r + "<h3>MODO</h3><p>" + Ll(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();
13435
13614
  return;
13436
13615
  }
13437
13616
  let t = this.selected;
@@ -13441,11 +13620,11 @@ var Ql = class extends HTMLElement {
13441
13620
  }
13442
13621
  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;
13443
13622
  for (; o && !a.has(o.id);) a.add(o.id), i.unshift(o), o = o.parent ? this.nodes.get(o.parent) : null;
13444
- 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=\"" + Il(e.id) + "\" class=\"" + (t === i.length - 1 ? "current" : "") + "\">" + Il(e.name) + "</button>").join("") + "</nav>", c = n.map((e) => {
13445
- let n = this.relations.indexOf(e), r = e.text ? "<small>" + Il(e.text) + "</small>" : "";
13446
- return "<button class=\"relation\" data-action=\"relation\" data-relation-index=\"" + n + "\"><strong>" + Il(e.label || (e.from === t.id ? e.to : e.from)) + "</strong><small>" + Il(e.from) + " → " + Il(e.to) + "</small>" + r + "</button>";
13623
+ 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=\"" + Ll(e.id) + "\" class=\"" + (t === i.length - 1 ? "current" : "") + "\">" + Ll(e.name) + "</button>").join("") + "</nav>", c = n.map((e) => {
13624
+ let n = this.relations.indexOf(e), r = e.text ? "<small>" + Ll(e.text) + "</small>" : "";
13625
+ return "<button class=\"relation\" data-action=\"relation\" data-relation-index=\"" + n + "\"><strong>" + Ll(e.label || (e.from === t.id ? e.to : e.from)) + "</strong><small>" + Ll(e.from) + " → " + Ll(e.to) + "</small>" + r + "</button>";
13447
13626
  }).join("");
13448
- 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\">" + Il(yl(t.type) ? "CONTENEDOR" : t.type === "actor" ? "ACTOR EXTERNO" : "COMPONENTE") + "</div><h2>" + Il(t.name) + "</h2><div class=\"sub\">" + Il(t.sub || "") + "</div><p>" + Il(t.text || "") + "</p>" + Ll(t.url) + (yl(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", () => {
13627
+ 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\">" + Ll(bl(t.type) ? "CONTENEDOR" : t.type === "actor" ? "ACTOR EXTERNO" : "COMPONENTE") + "</div><h2>" + Ll(t.name) + "</h2><div class=\"sub\">" + Ll(t.sub || "") + "</div><p>" + Ll(t.text || "") + "</p>" + Rl(t.url) + (bl(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", () => {
13449
13628
  this.toggleContainer(t.id, { source: "panel" });
13450
13629
  }), this._applyTheme();
13451
13630
  }
@@ -13454,7 +13633,7 @@ var Ql = class extends HTMLElement {
13454
13633
  if (!n) return this;
13455
13634
  let r = new Set(this.open), i = n.parent ? this.nodes.get(n.parent) : null;
13456
13635
  for (; i;) r.add(i.id), i = i.parent ? this.nodes.get(i.parent) : null;
13457
- return this.selected = n, this.selectedRelationIndex = null, yl(n.type) && r.add(n.id), this._replaceOpenContainers(r, {
13636
+ return this.selected = n, this.selectedRelationIndex = null, bl(n.type) && r.add(n.id), this._replaceOpenContainers(r, {
13458
13637
  refresh: !1,
13459
13638
  source: t.source || "api"
13460
13639
  }), 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", {
@@ -13518,19 +13697,19 @@ var Ql = class extends HTMLElement {
13518
13697
  for (let e of this.nodes.values()) {
13519
13698
  let t = this._focusAlpha(e, i), n = this._isVisible(e) && t > 0;
13520
13699
  e.group.visible = n;
13521
- let r = yl(e.type) && this.open.has(e.id), a = (r ? .12 : 1) * t;
13522
- if (e.mesh.renderOrder = r ? 10 - !!e.parent : 0, e.material) Cl(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;
13700
+ let r = bl(e.type) && this.open.has(e.id), a = (r ? .12 : 1) * t;
13701
+ if (e.mesh.renderOrder = r ? 10 - !!e.parent : 0, e.material) wl(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;
13523
13702
  else {
13524
- 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), Cl(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;
13703
+ 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), wl(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;
13525
13704
  e._appearanceSelected = e === this.selected;
13526
13705
  }
13527
13706
  e.edge?.material && (e.edge.material.opacity = (e === this.selected ? 1 : .65) * t);
13528
- let o = yl(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;
13707
+ let o = bl(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;
13529
13708
  e.label.userData.textOffsetY;
13530
13709
  let m = e.labelSize || new U().fromArray(e.s);
13531
13710
  e.label.visible = n;
13532
- let h = this._worldPosition(e), g = this.itemFacing === "camera" && !yl(e.type) || this.camera.position.z >= h.z, _ = this.camera.position.y > h.y + .25;
13533
- if (yl(e.type)) {
13711
+ let h = this._worldPosition(e), g = this.itemFacing === "camera" && !bl(e.type) || this.camera.position.z >= h.z, _ = this.camera.position.y > h.y + .25;
13712
+ if (bl(e.type)) {
13534
13713
  c.visible = g && (!o || s), l.visible = !g && (!o || s), u.visible = s && _;
13535
13714
  let e = s ? .52 : 1;
13536
13715
  c.scale.setScalar(e), c.position.x = s ? -m.x / 2 + .18 + f * e / 2 - p * e : 0;
@@ -13549,7 +13728,7 @@ var Ql = class extends HTMLElement {
13549
13728
  let t = this.canvas.getBoundingClientRect();
13550
13729
  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);
13551
13730
  let n = [];
13552
- for (let e of this.nodes.values()) e.group.visible && (yl(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)));
13731
+ for (let e of this.nodes.values()) e.group.visible && (bl(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)));
13553
13732
  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;
13554
13733
  if (r && (!a || r.distance <= a.distance + .12)) {
13555
13734
  let e = r.object;
@@ -13622,7 +13801,7 @@ var Ql = class extends HTMLElement {
13622
13801
  y: e.clientY
13623
13802
  }), e.pointerType === "touch" && this.pointers.size >= 2) {
13624
13803
  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));
13625
- this.drag.mode === "touch-pan" ? (this._panByPixels(n - this.drag.x, r - this.drag.y), this.targetZoom = Math.min(2.8, Math.max(el, this.targetZoom * i / Math.max(1, this.drag.distance))), Object.assign(this.drag, {
13804
+ 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, {
13626
13805
  x: n,
13627
13806
  y: r,
13628
13807
  distance: i,
@@ -13693,16 +13872,16 @@ var Ql = class extends HTMLElement {
13693
13872
  navigation: "fit"
13694
13873
  });
13695
13874
  }), this.canvas.addEventListener("wheel", (e) => {
13696
- e.preventDefault(), this.targetZoom = Math.min(2.8, Math.max(el, this.targetZoom * Math.exp(-e.deltaY * .001))), this.invalidate();
13875
+ e.preventDefault(), this.targetZoom = Math.min(2.8, Math.max(tl, this.targetZoom * Math.exp(-e.deltaY * .001))), this.invalidate();
13697
13876
  }, { passive: !1 });
13698
13877
  }
13699
13878
  _showError(e) {
13700
13879
  let t = this.shadowRoot.querySelector(".viewport"), n = t.querySelector(".error");
13701
- n ? n.textContent = e : t.insertAdjacentHTML("beforeend", "<div class=\"error\" role=\"alert\">" + Il(e) + "</div>");
13880
+ n ? n.textContent = e : t.insertAdjacentHTML("beforeend", "<div class=\"error\" role=\"alert\">" + Ll(e) + "</div>");
13702
13881
  }
13703
13882
  };
13704
- customElements.get("liquidcars-atlas") || customElements.define("liquidcars-atlas", Ql);
13883
+ customElements.get("liquidcars-atlas") || customElements.define("liquidcars-atlas", iu);
13705
13884
  //#endregion
13706
- export { Qc as ATLAS_VERSION, Ql as LiquidCarsAtlas, Zl as captureRendererFrame, gl as getGeometryCatalog, _l as getGeometryPackCatalog, Rl as normalizeModel, ml as registerGeometryPack, hl as unregisterGeometryPack };
13885
+ export { $c as ATLAS_VERSION, iu as LiquidCarsAtlas, ru as captureRendererFrame, $l as createSvgExtrudeGeometry, _l as getGeometryCatalog, vl as getGeometryPackCatalog, zl as normalizeModel, hl as registerGeometryPack, gl as unregisterGeometryPack };
13707
13886
 
13708
13887
  //# sourceMappingURL=liquidcars-atlas.js.map