endset_three_editor 0.10.14 → 0.10.15

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.
@@ -533,20 +533,20 @@ class Qo extends Fn {
533
533
  const i = new ir();
534
534
  this._plane = i, n.add(i);
535
535
  const o = this;
536
- function a(f, h) {
537
- let v = h;
538
- Object.defineProperty(o, f, {
536
+ function a(h, f) {
537
+ let v = f;
538
+ Object.defineProperty(o, h, {
539
539
  get: function() {
540
- return v !== void 0 ? v : h;
540
+ return v !== void 0 ? v : f;
541
541
  },
542
542
  set: function(D) {
543
- v !== D && (v = D, i[f] = D, s[f] = D, o.dispatchEvent({ type: f + "-changed", value: D }), o.dispatchEvent(xs));
543
+ v !== D && (v = D, i[h] = D, s[h] = D, o.dispatchEvent({ type: h + "-changed", value: D }), o.dispatchEvent(xs));
544
544
  }
545
- }), o[f] = h, i[f] = h, s[f] = h;
545
+ }), o[h] = f, i[h] = f, s[h] = f;
546
546
  }
547
547
  a("camera", e), a("object", void 0), a("enabled", !0), a("axis", null), a("mode", "translate"), a("translationSnap", null), a("rotationSnap", null), a("scaleSnap", null), a("space", "world"), a("size", 1), a("dragging", !1), a("showX", !0), a("showY", !0), a("showZ", !0), a("showXY", !0), a("showYZ", !0), a("showXZ", !0), a("minX", -1 / 0), a("maxX", 1 / 0), a("minY", -1 / 0), a("maxY", 1 / 0), a("minZ", -1 / 0), a("maxZ", 1 / 0);
548
- const l = new P(), c = new P(), d = new Ae(), u = new Ae(), g = new P(), p = new Ae(), b = new P(), m = new P(), A = new P(), I = 0, w = new P();
549
- a("worldPosition", l), a("worldPositionStart", c), a("worldQuaternion", d), a("worldQuaternionStart", u), a("cameraPosition", g), a("cameraQuaternion", p), a("pointStart", b), a("pointEnd", m), a("rotationAxis", A), a("rotationAngle", I), a("eye", w), this._offset = new P(), this._startNorm = new P(), this._endNorm = new P(), this._cameraScale = new P(), this._parentPosition = new P(), this._parentQuaternion = new Ae(), this._parentQuaternionInv = new Ae(), this._parentScale = new P(), this._worldScaleStart = new P(), this._worldQuaternionInv = new Ae(), this._worldScale = new P(), this._positionStart = new P(), this._quaternionStart = new Ae(), this._scaleStart = new P(), this._getPointer = Jo.bind(this), this._onPointerDown = $o.bind(this), this._onPointerHover = _o.bind(this), this._onPointerMove = er.bind(this), this._onPointerUp = tr.bind(this), t !== null && this.connect(t);
548
+ const l = new P(), c = new P(), d = new Ae(), u = new Ae(), g = new P(), A = new Ae(), b = new P(), m = new P(), p = new P(), I = 0, w = new P();
549
+ a("worldPosition", l), a("worldPositionStart", c), a("worldQuaternion", d), a("worldQuaternionStart", u), a("cameraPosition", g), a("cameraQuaternion", A), a("pointStart", b), a("pointEnd", m), a("rotationAxis", p), a("rotationAngle", I), a("eye", w), this._offset = new P(), this._startNorm = new P(), this._endNorm = new P(), this._cameraScale = new P(), this._parentPosition = new P(), this._parentQuaternion = new Ae(), this._parentQuaternionInv = new Ae(), this._parentScale = new P(), this._worldScaleStart = new P(), this._worldQuaternionInv = new Ae(), this._worldScale = new P(), this._positionStart = new P(), this._quaternionStart = new Ae(), this._scaleStart = new P(), this._getPointer = Jo.bind(this), this._onPointerDown = $o.bind(this), this._onPointerHover = _o.bind(this), this._onPointerMove = er.bind(this), this._onPointerUp = tr.bind(this), t !== null && this.connect(t);
550
550
  }
551
551
  connect(e) {
552
552
  super.connect(e), this.domElement.addEventListener("pointerdown", this._onPointerDown), this.domElement.addEventListener("pointermove", this._onPointerHover), this.domElement.addEventListener("pointerup", this._onPointerUp), this.domElement.style.touchAction = "none";
@@ -800,14 +800,14 @@ class nr extends mt {
800
800
  u.opacity = 0.25;
801
801
  const g = e.clone();
802
802
  g.color.setHex(16776960), g.opacity = 0.25;
803
- const p = e.clone();
804
- p.color.setHex(16776960);
803
+ const A = e.clone();
804
+ A.color.setHex(16776960);
805
805
  const b = e.clone();
806
806
  b.color.setHex(7895160), this.materialLib = {
807
807
  xAxis: i,
808
808
  yAxis: o,
809
809
  zAxis: a,
810
- active: p,
810
+ active: A,
811
811
  xAxisTransparent: l,
812
812
  yAxisTransparent: c,
813
813
  zAxisTransparent: d,
@@ -815,17 +815,17 @@ class nr extends mt {
815
815
  };
816
816
  const m = new ge(0, 0.04, 0.1, 12);
817
817
  m.translate(0, 0.05, 0);
818
- const A = new pe(0.08, 0.08, 0.08);
819
- A.translate(0, 0.04, 0);
818
+ const p = new pe(0.08, 0.08, 0.08);
819
+ p.translate(0, 0.04, 0);
820
820
  const I = new rt();
821
821
  I.setAttribute("position", new ke([0, 0, 0, 1, 0, 0], 3));
822
822
  const w = new ge(75e-4, 75e-4, 0.5, 3);
823
823
  w.translate(0, 0.25, 0);
824
- function f(N, U) {
824
+ function h(N, U) {
825
825
  const z = new gt(N, 75e-4, 3, 64, U * Math.PI * 2);
826
826
  return z.rotateY(Math.PI / 2), z.rotateX(Math.PI / 2), z;
827
827
  }
828
- function h() {
828
+ function f() {
829
829
  const N = new rt();
830
830
  return N.setAttribute("position", new ke([0, 0, 0, 1, 1, 1], 3)), N;
831
831
  }
@@ -890,7 +890,7 @@ class nr extends mt {
890
890
  [new L(new Ft(0.01, 2), s), null, null, null, "helper"]
891
891
  ],
892
892
  DELTA: [
893
- [new We(h(), s), null, null, null, "helper"]
893
+ [new We(f(), s), null, null, null, "helper"]
894
894
  ],
895
895
  X: [
896
896
  [new We(I, s), [-1e3, 0, 0], null, [1e6, 1, 1], "helper"]
@@ -903,19 +903,19 @@ class nr extends mt {
903
903
  ]
904
904
  }, T = {
905
905
  XYZE: [
906
- [new L(f(0.5, 1), b), null, [0, Math.PI / 2, 0]]
906
+ [new L(h(0.5, 1), b), null, [0, Math.PI / 2, 0]]
907
907
  ],
908
908
  X: [
909
- [new L(f(0.5, 0.5), i)]
909
+ [new L(h(0.5, 0.5), i)]
910
910
  ],
911
911
  Y: [
912
- [new L(f(0.5, 0.5), o), null, [0, 0, -Math.PI / 2]]
912
+ [new L(h(0.5, 0.5), o), null, [0, 0, -Math.PI / 2]]
913
913
  ],
914
914
  Z: [
915
- [new L(f(0.5, 0.5), a), null, [0, Math.PI / 2, 0]]
915
+ [new L(h(0.5, 0.5), a), null, [0, Math.PI / 2, 0]]
916
916
  ],
917
917
  E: [
918
- [new L(f(0.75, 1), g), null, [0, Math.PI / 2, 0]]
918
+ [new L(h(0.75, 1), g), null, [0, Math.PI / 2, 0]]
919
919
  ]
920
920
  }, Y = {
921
921
  AXIS: [
@@ -939,19 +939,19 @@ class nr extends mt {
939
939
  ]
940
940
  }, se = {
941
941
  X: [
942
- [new L(A, i), [0.5, 0, 0], [0, 0, -Math.PI / 2]],
942
+ [new L(p, i), [0.5, 0, 0], [0, 0, -Math.PI / 2]],
943
943
  [new L(w, i), [0, 0, 0], [0, 0, -Math.PI / 2]],
944
- [new L(A, i), [-0.5, 0, 0], [0, 0, Math.PI / 2]]
944
+ [new L(p, i), [-0.5, 0, 0], [0, 0, Math.PI / 2]]
945
945
  ],
946
946
  Y: [
947
- [new L(A, o), [0, 0.5, 0]],
947
+ [new L(p, o), [0, 0.5, 0]],
948
948
  [new L(w, o)],
949
- [new L(A, o), [0, -0.5, 0], [0, 0, Math.PI]]
949
+ [new L(p, o), [0, -0.5, 0], [0, 0, Math.PI]]
950
950
  ],
951
951
  Z: [
952
- [new L(A, a), [0, 0, 0.5], [Math.PI / 2, 0, 0]],
952
+ [new L(p, a), [0, 0, 0.5], [Math.PI / 2, 0, 0]],
953
953
  [new L(w, a), [0, 0, 0], [Math.PI / 2, 0, 0]],
954
- [new L(A, a), [0, 0, -0.5], [-Math.PI / 2, 0, 0]]
954
+ [new L(p, a), [0, 0, -0.5], [-Math.PI / 2, 0, 0]]
955
955
  ],
956
956
  XY: [
957
957
  [new L(new pe(0.15, 0.15, 0.01), d), [0.15, 0.15, 0]]
@@ -1609,50 +1609,50 @@ class Ar {
1609
1609
  height: s
1610
1610
  };
1611
1611
  }, this.render = function(b, m) {
1612
- b.matrixWorldAutoUpdate === !0 && b.updateMatrixWorld(), m.parent === null && m.matrixWorldAutoUpdate === !0 && m.updateMatrixWorld(), mn.copy(m.matrixWorldInverse), gn.multiplyMatrices(m.projectionMatrix, mn), d(b, b, m), this.sortObjects && p(b);
1612
+ b.matrixWorldAutoUpdate === !0 && b.updateMatrixWorld(), m.parent === null && m.matrixWorldAutoUpdate === !0 && m.updateMatrixWorld(), mn.copy(m.matrixWorldInverse), gn.multiplyMatrices(m.projectionMatrix, mn), d(b, b, m), this.sortObjects && A(b);
1613
1613
  }, this.setSize = function(b, m) {
1614
1614
  n = b, s = m, i = n / 2, o = s / 2, l.style.width = b + "px", l.style.height = m + "px";
1615
1615
  };
1616
1616
  function c(b) {
1617
1617
  b.isCSS2DObject && (b.element.style.display = "none");
1618
- for (let m = 0, A = b.children.length; m < A; m++)
1618
+ for (let m = 0, p = b.children.length; m < p; m++)
1619
1619
  c(b.children[m]);
1620
1620
  }
1621
- function d(b, m, A) {
1621
+ function d(b, m, p) {
1622
1622
  if (b.visible === !1) {
1623
1623
  c(b);
1624
1624
  return;
1625
1625
  }
1626
1626
  if (b.isCSS2DObject) {
1627
1627
  ct.setFromMatrixPosition(b.matrixWorld), ct.applyMatrix4(gn);
1628
- const I = ct.z >= -1 && ct.z <= 1 && b.layers.test(A.layers) === !0, w = b.element;
1629
- w.style.display = I === !0 ? "" : "none", I === !0 && (b.onBeforeRender(t, m, A), w.style.transform = "translate(" + -100 * b.center.x + "%," + -100 * b.center.y + "%)translate(" + (ct.x * i + i) + "px," + (-ct.y * o + o) + "px)", w.parentNode !== l && l.appendChild(w), b.onAfterRender(t, m, A));
1630
- const f = {
1631
- distanceToCameraSquared: u(A, b)
1628
+ const I = ct.z >= -1 && ct.z <= 1 && b.layers.test(p.layers) === !0, w = b.element;
1629
+ w.style.display = I === !0 ? "" : "none", I === !0 && (b.onBeforeRender(t, m, p), w.style.transform = "translate(" + -100 * b.center.x + "%," + -100 * b.center.y + "%)translate(" + (ct.x * i + i) + "px," + (-ct.y * o + o) + "px)", w.parentNode !== l && l.appendChild(w), b.onAfterRender(t, m, p));
1630
+ const h = {
1631
+ distanceToCameraSquared: u(p, b)
1632
1632
  };
1633
- a.objects.set(b, f);
1633
+ a.objects.set(b, h);
1634
1634
  }
1635
1635
  for (let I = 0, w = b.children.length; I < w; I++)
1636
- d(b.children[I], m, A);
1636
+ d(b.children[I], m, p);
1637
1637
  }
1638
1638
  function u(b, m) {
1639
1639
  return yn.setFromMatrixPosition(b.matrixWorld), bn.setFromMatrixPosition(m.matrixWorld), yn.distanceToSquared(bn);
1640
1640
  }
1641
1641
  function g(b) {
1642
1642
  const m = [];
1643
- return b.traverseVisible(function(A) {
1644
- A.isCSS2DObject && m.push(A);
1643
+ return b.traverseVisible(function(p) {
1644
+ p.isCSS2DObject && m.push(p);
1645
1645
  }), m;
1646
1646
  }
1647
- function p(b) {
1647
+ function A(b) {
1648
1648
  const m = g(b).sort(function(I, w) {
1649
1649
  if (I.renderOrder !== w.renderOrder)
1650
1650
  return w.renderOrder - I.renderOrder;
1651
- const f = a.objects.get(I).distanceToCameraSquared, h = a.objects.get(w).distanceToCameraSquared;
1652
- return f - h;
1653
- }), A = m.length;
1651
+ const h = a.objects.get(I).distanceToCameraSquared, f = a.objects.get(w).distanceToCameraSquared;
1652
+ return h - f;
1653
+ }), p = m.length;
1654
1654
  for (let I = 0, w = m.length; I < w; I++)
1655
- m[I].element.style.zIndex = A - I;
1655
+ m[I].element.style.zIndex = p - I;
1656
1656
  }
1657
1657
  }
1658
1658
  }
@@ -1966,8 +1966,8 @@ function Dr() {
1966
1966
  u.position.set(14.904, 12.198, -1.832), u.scale.set(0.15, 4.265, 6.331), r.add(u);
1967
1967
  const g = new O.Mesh(e, l(43));
1968
1968
  g.position.set(-0.462, 8.89, 14.52), g.scale.set(4.38, 5.441, 0.088), r.add(g);
1969
- const p = new O.Mesh(e, l(20));
1970
- p.position.set(3.235, 11.486, -12.541), p.scale.set(2.5, 2, 0.1), r.add(p);
1969
+ const A = new O.Mesh(e, l(20));
1970
+ A.position.set(3.235, 11.486, -12.541), A.scale.set(2.5, 2, 0.1), r.add(A);
1971
1971
  const b = new O.Mesh(e, l(100));
1972
1972
  return b.position.set(0, 20, 0), b.scale.set(1, 0.1, 1), r.add(b), r;
1973
1973
  }
@@ -2243,30 +2243,30 @@ class Fr {
2243
2243
  if (d.length > 0 && (o.extensionsUsed = d), u.length > 0 && (o.extensionsRequired = u), o.buffers && o.buffers.length > 0 && (o.buffers[0].byteLength = c.size), n.binary === !0) {
2244
2244
  const g = new FileReader();
2245
2245
  g.readAsArrayBuffer(c), g.onloadend = function() {
2246
- const p = ws(g.result), b = new DataView(new ArrayBuffer(wn));
2247
- b.setUint32(0, p.byteLength, !0), b.setUint32(4, Lr, !0);
2248
- const m = ws(Nr(JSON.stringify(o)), 32), A = new DataView(new ArrayBuffer(wn));
2249
- A.setUint32(0, m.byteLength, !0), A.setUint32(4, Sr, !0);
2246
+ const A = ws(g.result), b = new DataView(new ArrayBuffer(wn));
2247
+ b.setUint32(0, A.byteLength, !0), b.setUint32(4, Lr, !0);
2248
+ const m = ws(Nr(JSON.stringify(o)), 32), p = new DataView(new ArrayBuffer(wn));
2249
+ p.setUint32(0, m.byteLength, !0), p.setUint32(4, Sr, !0);
2250
2250
  const I = new ArrayBuffer(Cn), w = new DataView(I);
2251
2251
  w.setUint32(0, Rr, !0), w.setUint32(4, Pr, !0);
2252
- const f = Cn + A.byteLength + m.byteLength + b.byteLength + p.byteLength;
2253
- w.setUint32(8, f, !0);
2254
- const h = new Blob([
2252
+ const h = Cn + p.byteLength + m.byteLength + b.byteLength + A.byteLength;
2253
+ w.setUint32(8, h, !0);
2254
+ const f = new Blob([
2255
2255
  I,
2256
- A,
2256
+ p,
2257
2257
  m,
2258
2258
  b,
2259
- p
2259
+ A
2260
2260
  ], { type: "application/octet-stream" }), v = new FileReader();
2261
- v.readAsArrayBuffer(h), v.onloadend = function() {
2261
+ v.readAsArrayBuffer(f), v.onloadend = function() {
2262
2262
  t(v.result);
2263
2263
  };
2264
2264
  };
2265
2265
  } else if (o.buffers && o.buffers.length > 0) {
2266
2266
  const g = new FileReader();
2267
2267
  g.readAsDataURL(c), g.onloadend = function() {
2268
- const p = g.result;
2269
- o.buffers[0].uri = p, t(o);
2268
+ const A = g.result;
2269
+ o.buffers[0].uri = A, t(o);
2270
2270
  };
2271
2271
  } else
2272
2272
  t(o);
@@ -2349,8 +2349,8 @@ class Fr {
2349
2349
  }
2350
2350
  async buildMetalRoughTextureAsync(e, t) {
2351
2351
  if (e === t) return e;
2352
- function n(p) {
2353
- return p.colorSpace === je ? function(m) {
2352
+ function n(A) {
2353
+ return A.colorSpace === je ? function(m) {
2354
2354
  return m < 0.04045 ? m * 0.0773993808 : Math.pow(m * 0.9478672986 + 0.0521327014, 2.4);
2355
2355
  } : function(m) {
2356
2356
  return m;
@@ -2366,15 +2366,15 @@ class Fr {
2366
2366
  const d = c.getImageData(0, 0, o, a);
2367
2367
  if (s) {
2368
2368
  c.drawImage(s, 0, 0, o, a);
2369
- const p = n(e), b = c.getImageData(0, 0, o, a).data;
2369
+ const A = n(e), b = c.getImageData(0, 0, o, a).data;
2370
2370
  for (let m = 2; m < b.length; m += 4)
2371
- d.data[m] = p(b[m] / 256) * 256;
2371
+ d.data[m] = A(b[m] / 256) * 256;
2372
2372
  }
2373
2373
  if (i) {
2374
2374
  c.drawImage(i, 0, 0, o, a);
2375
- const p = n(t), b = c.getImageData(0, 0, o, a).data;
2375
+ const A = n(t), b = c.getImageData(0, 0, o, a).data;
2376
2376
  for (let m = 1; m < b.length; m += 4)
2377
- d.data[m] = p(b[m] / 256) * 256;
2377
+ d.data[m] = A(b[m] / 256) * 256;
2378
2378
  }
2379
2379
  c.putImageData(d, 0, 0);
2380
2380
  const g = (e || t).clone();
@@ -2425,8 +2425,8 @@ class Fr {
2425
2425
  let u = 0;
2426
2426
  for (let b = n; b < n + s; b++) {
2427
2427
  for (let m = 0; m < e.itemSize; m++) {
2428
- let A;
2429
- e.itemSize > 4 ? A = e.array[b * e.itemSize + m] : (m === 0 ? A = e.getX(b) : m === 1 ? A = e.getY(b) : m === 2 ? A = e.getZ(b) : m === 3 && (A = e.getW(b)), e.normalized === !0 && (A = Pt.normalize(A, e.array))), t === q.FLOAT ? d.setFloat32(u, A, !0) : t === q.INT ? d.setInt32(u, A, !0) : t === q.UNSIGNED_INT ? d.setUint32(u, A, !0) : t === q.SHORT ? d.setInt16(u, A, !0) : t === q.UNSIGNED_SHORT ? d.setUint16(u, A, !0) : t === q.BYTE ? d.setInt8(u, A) : t === q.UNSIGNED_BYTE && d.setUint8(u, A), u += a;
2428
+ let p;
2429
+ e.itemSize > 4 ? p = e.array[b * e.itemSize + m] : (m === 0 ? p = e.getX(b) : m === 1 ? p = e.getY(b) : m === 2 ? p = e.getZ(b) : m === 3 && (p = e.getW(b)), e.normalized === !0 && (p = Pt.normalize(p, e.array))), t === q.FLOAT ? d.setFloat32(u, p, !0) : t === q.INT ? d.setInt32(u, p, !0) : t === q.UNSIGNED_INT ? d.setUint32(u, p, !0) : t === q.SHORT ? d.setInt16(u, p, !0) : t === q.UNSIGNED_SHORT ? d.setUint16(u, p, !0) : t === q.BYTE ? d.setInt8(u, p) : t === q.UNSIGNED_BYTE && d.setUint8(u, p), u += a;
2430
2430
  }
2431
2431
  u % l !== 0 && (u += l - u % l);
2432
2432
  }
@@ -2523,26 +2523,26 @@ class Fr {
2523
2523
  const d = o.images.get(e), u = s + ":flipY/" + n.toString();
2524
2524
  if (d[u] !== void 0) return d[u];
2525
2525
  a.images || (a.images = []);
2526
- const g = { mimeType: s }, p = vn();
2527
- p.width = Math.min(e.width, l.maxTextureSize), p.height = Math.min(e.height, l.maxTextureSize);
2528
- const b = p.getContext("2d", {
2526
+ const g = { mimeType: s }, A = vn();
2527
+ A.width = Math.min(e.width, l.maxTextureSize), A.height = Math.min(e.height, l.maxTextureSize);
2528
+ const b = A.getContext("2d", {
2529
2529
  willReadFrequently: !0
2530
2530
  });
2531
- if (n === !0 && (b.translate(0, p.height), b.scale(1, -1)), e.data !== void 0) {
2531
+ if (n === !0 && (b.translate(0, A.height), b.scale(1, -1)), e.data !== void 0) {
2532
2532
  t !== yo && console.error("GLTFExporter: Only RGBAFormat is supported.", t), (e.width > l.maxTextureSize || e.height > l.maxTextureSize) && console.warn("GLTFExporter: Image size is bigger than maxTextureSize", e);
2533
- const A = new Uint8ClampedArray(e.height * e.width * 4);
2534
- for (let I = 0; I < A.length; I += 4)
2535
- A[I + 0] = e.data[I + 0], A[I + 1] = e.data[I + 1], A[I + 2] = e.data[I + 2], A[I + 3] = e.data[I + 3];
2536
- b.putImageData(new ImageData(A, e.width, e.height), 0, 0);
2533
+ const p = new Uint8ClampedArray(e.height * e.width * 4);
2534
+ for (let I = 0; I < p.length; I += 4)
2535
+ p[I + 0] = e.data[I + 0], p[I + 1] = e.data[I + 1], p[I + 2] = e.data[I + 2], p[I + 3] = e.data[I + 3];
2536
+ b.putImageData(new ImageData(p, e.width, e.height), 0, 0);
2537
2537
  } else if (typeof HTMLImageElement < "u" && e instanceof HTMLImageElement || typeof HTMLCanvasElement < "u" && e instanceof HTMLCanvasElement || typeof ImageBitmap < "u" && e instanceof ImageBitmap || typeof OffscreenCanvas < "u" && e instanceof OffscreenCanvas)
2538
- b.drawImage(e, 0, 0, p.width, p.height);
2538
+ b.drawImage(e, 0, 0, A.width, A.height);
2539
2539
  else
2540
2540
  throw new Error("THREE.GLTFExporter: Invalid image type. Use HTMLImageElement, HTMLCanvasElement, ImageBitmap or OffscreenCanvas.");
2541
2541
  l.binary === !0 ? c.push(
2542
- jr(p, s).then((A) => i.processBufferViewImage(A)).then((A) => {
2543
- g.bufferView = A;
2542
+ jr(A, s).then((p) => i.processBufferViewImage(p)).then((p) => {
2543
+ g.bufferView = p;
2544
2544
  })
2545
- ) : g.uri = bo.getDataURL(p, s);
2545
+ ) : g.uri = bo.getDataURL(A, s);
2546
2546
  const m = a.images.push(g) - 1;
2547
2547
  return d[u] = m, m;
2548
2548
  } else
@@ -2650,8 +2650,8 @@ class Fr {
2650
2650
  async processMeshAsync(e) {
2651
2651
  const t = this.cache, n = this.json, s = [e.geometry.uuid];
2652
2652
  if (Array.isArray(e.material))
2653
- for (let h = 0, v = e.material.length; h < v; h++)
2654
- s.push(e.material[h].uuid);
2653
+ for (let f = 0, v = e.material.length; f < v; f++)
2654
+ s.push(e.material[f].uuid);
2655
2655
  else
2656
2656
  s.push(e.material.uuid);
2657
2657
  const i = s.join(":");
@@ -2667,25 +2667,25 @@ class Fr {
2667
2667
  color: "COLOR_0",
2668
2668
  skinWeight: "WEIGHTS_0",
2669
2669
  skinIndex: "JOINTS_0"
2670
- }, p = o.getAttribute("normal");
2671
- p !== void 0 && !this.isNormalizedNormalAttribute(p) && (console.warn("THREE.GLTFExporter: Creating normalized normal attribute from the non-normalized one."), o.setAttribute("normal", this.createNormalizedNormalAttribute(p)));
2670
+ }, A = o.getAttribute("normal");
2671
+ A !== void 0 && !this.isNormalizedNormalAttribute(A) && (console.warn("THREE.GLTFExporter: Creating normalized normal attribute from the non-normalized one."), o.setAttribute("normal", this.createNormalizedNormalAttribute(A)));
2672
2672
  let b = null;
2673
- for (let h in o.attributes) {
2674
- if (h.slice(0, 5) === "morph") continue;
2675
- const v = o.attributes[h];
2676
- if (h = g[h] || h.toUpperCase(), !/^(POSITION|NORMAL|TANGENT|TEXCOORD_\d+|COLOR_\d+|JOINTS_\d+|WEIGHTS_\d+)$/.test(h) && !h.startsWith("_") && (h = "_" + h), t.attributes.has(this.getUID(v))) {
2677
- c[h] = t.attributes.get(this.getUID(v));
2673
+ for (let f in o.attributes) {
2674
+ if (f.slice(0, 5) === "morph") continue;
2675
+ const v = o.attributes[f];
2676
+ if (f = g[f] || f.toUpperCase(), !/^(POSITION|NORMAL|TANGENT|TEXCOORD_\d+|COLOR_\d+|JOINTS_\d+|WEIGHTS_\d+)$/.test(f) && !f.startsWith("_") && (f = "_" + f), t.attributes.has(this.getUID(v))) {
2677
+ c[f] = t.attributes.get(this.getUID(v));
2678
2678
  continue;
2679
2679
  }
2680
2680
  b = null;
2681
2681
  const R = v.array;
2682
- h === "JOINTS_0" && !(R instanceof Uint16Array) && !(R instanceof Uint8Array) ? (console.warn('GLTFExporter: Attribute "skinIndex" converted to type UNSIGNED_SHORT.'), b = Dt.Utils.toTypedBufferAttribute(v, Uint16Array)) : (R instanceof Uint32Array || R instanceof Int32Array) && !h.startsWith("_") && (console.warn(`GLTFExporter: Attribute "${h}" converted to type FLOAT.`), b = Dt.Utils.toTypedBufferAttribute(v, Float32Array));
2682
+ f === "JOINTS_0" && !(R instanceof Uint16Array) && !(R instanceof Uint8Array) ? (console.warn('GLTFExporter: Attribute "skinIndex" converted to type UNSIGNED_SHORT.'), b = Dt.Utils.toTypedBufferAttribute(v, Uint16Array)) : (R instanceof Uint32Array || R instanceof Int32Array) && !f.startsWith("_") && (console.warn(`GLTFExporter: Attribute "${f}" converted to type FLOAT.`), b = Dt.Utils.toTypedBufferAttribute(v, Float32Array));
2683
2683
  const T = this.processAccessor(b || v, o);
2684
- T !== null && (h.startsWith("_") || this.detectMeshQuantization(h, v), c[h] = T, t.attributes.set(this.getUID(v), T));
2684
+ T !== null && (f.startsWith("_") || this.detectMeshQuantization(f, v), c[f] = T, t.attributes.set(this.getUID(v), T));
2685
2685
  }
2686
- if (p !== void 0 && o.setAttribute("normal", p), Object.keys(c).length === 0) return null;
2686
+ if (A !== void 0 && o.setAttribute("normal", A), Object.keys(c).length === 0) return null;
2687
2687
  if (e.morphTargetInfluences !== void 0 && e.morphTargetInfluences.length > 0) {
2688
- const h = [], v = [], D = {};
2688
+ const f = [], v = [], D = {};
2689
2689
  if (e.morphTargetDictionary !== void 0)
2690
2690
  for (const R in e.morphTargetDictionary)
2691
2691
  D[e.morphTargetDictionary[R]] = R;
@@ -2709,37 +2709,37 @@ class Fr {
2709
2709
  z === 0 && Z.setX(N, se.getX(N) - J.getX(N)), z === 1 && Z.setY(N, se.getY(N) - J.getY(N)), z === 2 && Z.setZ(N, se.getZ(N) - J.getZ(N)), z === 3 && Z.setW(N, se.getW(N) - J.getW(N));
2710
2710
  T[ne] = this.processAccessor(Z, o), t.attributes.set(this.getUID(J, !0), T[ne]);
2711
2711
  }
2712
- u.push(T), h.push(e.morphTargetInfluences[R]), e.morphTargetDictionary !== void 0 && v.push(D[R]);
2712
+ u.push(T), f.push(e.morphTargetInfluences[R]), e.morphTargetDictionary !== void 0 && v.push(D[R]);
2713
2713
  }
2714
- l.weights = h, v.length > 0 && (l.extras = {}, l.extras.targetNames = v);
2714
+ l.weights = f, v.length > 0 && (l.extras = {}, l.extras.targetNames = v);
2715
2715
  }
2716
2716
  const m = Array.isArray(e.material);
2717
2717
  if (m && o.groups.length === 0) return null;
2718
- let A = !1;
2718
+ let p = !1;
2719
2719
  if (m && o.index === null) {
2720
- const h = [];
2720
+ const f = [];
2721
2721
  for (let v = 0, D = o.attributes.position.count; v < D; v++)
2722
- h[v] = v;
2723
- o.setIndex(h), A = !0;
2722
+ f[v] = v;
2723
+ o.setIndex(f), p = !0;
2724
2724
  }
2725
2725
  const I = m ? e.material : [e.material], w = m ? o.groups : [{ materialIndex: 0, start: void 0, count: void 0 }];
2726
- for (let h = 0, v = w.length; h < v; h++) {
2726
+ for (let f = 0, v = w.length; f < v; f++) {
2727
2727
  const D = {
2728
2728
  mode: a,
2729
2729
  attributes: c
2730
2730
  };
2731
2731
  if (this.serializeUserData(o, D), u.length > 0 && (D.targets = u), o.index !== null) {
2732
2732
  let T = this.getUID(o.index);
2733
- (w[h].start !== void 0 || w[h].count !== void 0) && (T += ":" + w[h].start + ":" + w[h].count), t.attributes.has(T) ? D.indices = t.attributes.get(T) : (D.indices = this.processAccessor(o.index, o, w[h].start, w[h].count), t.attributes.set(T, D.indices)), D.indices === null && delete D.indices;
2733
+ (w[f].start !== void 0 || w[f].count !== void 0) && (T += ":" + w[f].start + ":" + w[f].count), t.attributes.has(T) ? D.indices = t.attributes.get(T) : (D.indices = this.processAccessor(o.index, o, w[f].start, w[f].count), t.attributes.set(T, D.indices)), D.indices === null && delete D.indices;
2734
2734
  }
2735
- const R = await this.processMaterialAsync(I[w[h].materialIndex]);
2735
+ const R = await this.processMaterialAsync(I[w[f].materialIndex]);
2736
2736
  R !== null && (D.material = R), d.push(D);
2737
2737
  }
2738
- A === !0 && o.setIndex(null), l.primitives = d, n.meshes || (n.meshes = []), await this._invokeAllAsync(function(h) {
2739
- h.writeMesh && h.writeMesh(e, l);
2738
+ p === !0 && o.setIndex(null), l.primitives = d, n.meshes || (n.meshes = []), await this._invokeAllAsync(function(f) {
2739
+ f.writeMesh && f.writeMesh(e, l);
2740
2740
  });
2741
- const f = n.meshes.push(l) - 1;
2742
- return t.meshes.set(i, f), f;
2741
+ const h = n.meshes.push(l) - 1;
2742
+ return t.meshes.set(i, h), h;
2743
2743
  }
2744
2744
  /**
2745
2745
  * If a vertex attribute with a
@@ -2815,24 +2815,24 @@ class Fr {
2815
2815
  for (let c = 0; c < i.length; ++c) {
2816
2816
  const d = i[c], u = St.parseTrackName(d.name);
2817
2817
  let g = St.findNode(t, u.nodeName);
2818
- const p = In[u.propertyName];
2819
- if (u.objectName === "bones" && (g.isSkinnedMesh === !0 ? g = g.skeleton.getBoneByName(u.objectIndex) : g = void 0), !g || !p) {
2818
+ const A = In[u.propertyName];
2819
+ if (u.objectName === "bones" && (g.isSkinnedMesh === !0 ? g = g.skeleton.getBoneByName(u.objectIndex) : g = void 0), !g || !A) {
2820
2820
  console.warn('THREE.GLTFExporter: Could not export animation track "%s".', d.name);
2821
2821
  continue;
2822
2822
  }
2823
2823
  const b = 1;
2824
2824
  let m = d.values.length / d.times.length;
2825
- p === In.morphTargetInfluences && (m /= g.morphTargetInfluences.length);
2826
- let A;
2827
- d.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline === !0 ? (A = "CUBICSPLINE", m /= 3) : d.getInterpolation() === Bn ? A = "STEP" : A = "LINEAR", a.push({
2825
+ A === In.morphTargetInfluences && (m /= g.morphTargetInfluences.length);
2826
+ let p;
2827
+ d.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline === !0 ? (p = "CUBICSPLINE", m /= 3) : d.getInterpolation() === Bn ? p = "STEP" : p = "LINEAR", a.push({
2828
2828
  input: this.processAccessor(new De(d.times, b)),
2829
2829
  output: this.processAccessor(new De(d.values, m)),
2830
- interpolation: A
2830
+ interpolation: p
2831
2831
  }), o.push({
2832
2832
  sampler: a.length - 1,
2833
2833
  target: {
2834
2834
  node: s.get(g),
2835
- path: p
2835
+ path: A
2836
2836
  }
2837
2837
  });
2838
2838
  }
@@ -2920,11 +2920,11 @@ class Fr {
2920
2920
  const b = [t.nodes.push(u) - 1];
2921
2921
  if (e.children.length > 0) {
2922
2922
  const m = [];
2923
- for (let A = 0, I = e.children.length; A < I; A++) {
2924
- const w = e.children[A];
2923
+ for (let p = 0, I = e.children.length; p < I; p++) {
2924
+ const w = e.children[p];
2925
2925
  if (w.visible || n.onlyVisible === !1) {
2926
- const f = await this.processNodeAsync(w);
2927
- f !== null && m.push(f);
2926
+ const h = await this.processNodeAsync(w);
2927
+ h !== null && m.push(h);
2928
2928
  }
2929
2929
  }
2930
2930
  m.length > 0 && (u.children = m);
@@ -3207,8 +3207,8 @@ let zr = class {
3207
3207
  writeNode(e, t) {
3208
3208
  if (!e.isInstancedMesh) return;
3209
3209
  const n = this.writer, s = e, i = new Float32Array(s.count * 3), o = new Float32Array(s.count * 4), a = new Float32Array(s.count * 3), l = new Ce(), c = new P(), d = new Ae(), u = new P();
3210
- for (let p = 0; p < s.count; p++)
3211
- s.getMatrixAt(p, l), l.decompose(c, d, u), c.toArray(i, p * 3), d.toArray(o, p * 4), u.toArray(a, p * 3);
3210
+ for (let A = 0; A < s.count; A++)
3211
+ s.getMatrixAt(A, l), l.decompose(c, d, u), c.toArray(i, A * 3), d.toArray(o, A * 4), u.toArray(a, A * 3);
3212
3212
  const g = {
3213
3213
  TRANSLATION: n.processAccessor(new De(i, 3)),
3214
3214
  ROTATION: n.processAccessor(new De(o, 4)),
@@ -3263,19 +3263,19 @@ Dt.Utils = {
3263
3263
  let u;
3264
3264
  if (n[l.uuid] === void 0) {
3265
3265
  u = o.clone();
3266
- const p = new u.ValueBufferType(c * u.times.length);
3266
+ const A = new u.ValueBufferType(c * u.times.length);
3267
3267
  for (let b = 0; b < u.times.length; b++)
3268
- p[b * c + d] = u.values[b];
3269
- u.name = (a.nodeName || "") + ".morphTargetInfluences", u.values = p, n[l.uuid] = u, t.push(u);
3268
+ A[b * c + d] = u.values[b];
3269
+ u.name = (a.nodeName || "") + ".morphTargetInfluences", u.values = A, n[l.uuid] = u, t.push(u);
3270
3270
  continue;
3271
3271
  }
3272
3272
  const g = o.createInterpolant(new o.ValueBufferType(1));
3273
3273
  u = n[l.uuid];
3274
- for (let p = 0; p < u.times.length; p++)
3275
- u.values[p * c + d] = g.evaluate(u.times[p]);
3276
- for (let p = 0; p < o.times.length; p++) {
3277
- const b = this.insertKeyframe(u, o.times[p]);
3278
- u.values[b * c + d] = o.values[p];
3274
+ for (let A = 0; A < u.times.length; A++)
3275
+ u.values[A * c + d] = g.evaluate(u.times[A]);
3276
+ for (let A = 0; A < o.times.length; A++) {
3277
+ const b = this.insertKeyframe(u, o.times[A]);
3278
+ u.values[b * c + d] = o.values[A];
3279
3279
  }
3280
3280
  }
3281
3281
  return r.tracks = t, r;
@@ -3878,11 +3878,11 @@ class Tn {
3878
3878
  }
3879
3879
  return i.then(function(a) {
3880
3880
  const l = s.byteOffset || 0, c = s.byteLength || 0, d = s.count, u = s.byteStride, g = new Uint8Array(a, l, c);
3881
- return o.decodeGltfBufferAsync ? o.decodeGltfBufferAsync(d, u, g, s.mode, s.filter).then(function(p) {
3882
- return p.buffer;
3881
+ return o.decodeGltfBufferAsync ? o.decodeGltfBufferAsync(d, u, g, s.mode, s.filter).then(function(A) {
3882
+ return A.buffer;
3883
3883
  }) : o.ready.then(function() {
3884
- const p = new ArrayBuffer(d * u);
3885
- return o.decodeGltfBuffer(new Uint8Array(p), d, u, g, s.mode, s.filter), p;
3884
+ const A = new ArrayBuffer(d * u);
3885
+ return o.decodeGltfBuffer(new Uint8Array(A), d, u, g, s.mode, s.filter), A;
3886
3886
  });
3887
3887
  });
3888
3888
  } else
@@ -3905,19 +3905,19 @@ class ga {
3905
3905
  for (const c in o)
3906
3906
  a.push(this.parser.getDependency("accessor", o[c]).then((d) => (l[c] = d, l[c])));
3907
3907
  return a.length < 1 ? null : (a.push(this.parser.createNodeMesh(e)), Promise.all(a).then((c) => {
3908
- const d = c.pop(), u = d.isGroup ? d.children : [d], g = c[0].count, p = [];
3908
+ const d = c.pop(), u = d.isGroup ? d.children : [d], g = c[0].count, A = [];
3909
3909
  for (const b of u) {
3910
- const m = new Ce(), A = new P(), I = new Ae(), w = new P(1, 1, 1), f = new vo(b.geometry, b.material, g);
3911
- for (let h = 0; h < g; h++)
3912
- l.TRANSLATION && A.fromBufferAttribute(l.TRANSLATION, h), l.ROTATION && I.fromBufferAttribute(l.ROTATION, h), l.SCALE && w.fromBufferAttribute(l.SCALE, h), f.setMatrixAt(h, m.compose(A, I, w));
3913
- for (const h in l)
3914
- if (h === "_COLOR_0") {
3915
- const v = l[h];
3916
- f.instanceColor = new Mo(v.array, v.itemSize, v.normalized);
3917
- } else h !== "TRANSLATION" && h !== "ROTATION" && h !== "SCALE" && b.geometry.setAttribute(h, l[h]);
3918
- mt.prototype.copy.call(f, b), this.parser.assignFinalMaterial(f), p.push(f);
3910
+ const m = new Ce(), p = new P(), I = new Ae(), w = new P(1, 1, 1), h = new vo(b.geometry, b.material, g);
3911
+ for (let f = 0; f < g; f++)
3912
+ l.TRANSLATION && p.fromBufferAttribute(l.TRANSLATION, f), l.ROTATION && I.fromBufferAttribute(l.ROTATION, f), l.SCALE && w.fromBufferAttribute(l.SCALE, f), h.setMatrixAt(f, m.compose(p, I, w));
3913
+ for (const f in l)
3914
+ if (f === "_COLOR_0") {
3915
+ const v = l[f];
3916
+ h.instanceColor = new Mo(v.array, v.itemSize, v.normalized);
3917
+ } else f !== "TRANSLATION" && f !== "ROTATION" && f !== "SCALE" && b.geometry.setAttribute(f, l[f]);
3918
+ mt.prototype.copy.call(h, b), this.parser.assignFinalMaterial(h), A.push(h);
3919
3919
  }
3920
- return d.isGroup ? (d.clear(), d.add(...p), d) : p[0];
3920
+ return d.isGroup ? (d.clear(), d.add(...A), d) : A[0];
3921
3921
  }));
3922
3922
  }
3923
3923
  }
@@ -3968,18 +3968,18 @@ class ba {
3968
3968
  for (const d in e.attributes) {
3969
3969
  const u = Ls[d] || d.toLowerCase();
3970
3970
  if (o[d] !== void 0) {
3971
- const g = n.accessors[e.attributes[d]], p = pt[g.componentType];
3972
- c[u] = p.name, l[u] = g.normalized === !0;
3971
+ const g = n.accessors[e.attributes[d]], A = pt[g.componentType];
3972
+ c[u] = A.name, l[u] = g.normalized === !0;
3973
3973
  }
3974
3974
  }
3975
3975
  return t.getDependency("bufferView", i).then(function(d) {
3976
3976
  return new Promise(function(u, g) {
3977
- s.decodeDracoFile(d, function(p) {
3978
- for (const b in p.attributes) {
3979
- const m = p.attributes[b], A = l[b];
3980
- A !== void 0 && (m.normalized = A);
3977
+ s.decodeDracoFile(d, function(A) {
3978
+ for (const b in A.attributes) {
3979
+ const m = A.attributes[b], p = l[b];
3980
+ p !== void 0 && (m.normalized = p);
3981
3981
  }
3982
- u(p);
3982
+ u(A);
3983
3983
  }, a, c, Fe, g);
3984
3984
  });
3985
3985
  });
@@ -4009,10 +4009,10 @@ class ci extends So {
4009
4009
  return t;
4010
4010
  }
4011
4011
  interpolate_(e, t, n, s) {
4012
- const i = this.resultBuffer, o = this.sampleValues, a = this.valueSize, l = a * 2, c = a * 3, d = s - t, u = (n - t) / d, g = u * u, p = g * u, b = e * c, m = b - c, A = -2 * p + 3 * g, I = p - g, w = 1 - A, f = I - g + u;
4013
- for (let h = 0; h !== a; h++) {
4014
- const v = o[m + h + a], D = o[m + h + l] * d, R = o[b + h + a], T = o[b + h] * d;
4015
- i[h] = w * v + f * D + A * R + I * T;
4012
+ const i = this.resultBuffer, o = this.sampleValues, a = this.valueSize, l = a * 2, c = a * 3, d = s - t, u = (n - t) / d, g = u * u, A = g * u, b = e * c, m = b - c, p = -2 * A + 3 * g, I = A - g, w = 1 - p, h = I - g + u;
4013
+ for (let f = 0; f !== a; f++) {
4014
+ const v = o[m + f + a], D = o[m + f + l] * d, R = o[b + f + a], T = o[b + f] * d;
4015
+ i[f] = w * v + h * D + p * R + I * T;
4016
4016
  }
4017
4017
  return i;
4018
4018
  }
@@ -4437,24 +4437,24 @@ class Pa {
4437
4437
  }
4438
4438
  const i = [];
4439
4439
  return s.bufferView !== void 0 ? i.push(this.getDependency("bufferView", s.bufferView)) : i.push(null), s.sparse !== void 0 && (i.push(this.getDependency("bufferView", s.sparse.indices.bufferView)), i.push(this.getDependency("bufferView", s.sparse.values.bufferView))), Promise.all(i).then(function(o) {
4440
- const a = o[0], l = vs[s.type], c = pt[s.componentType], d = c.BYTES_PER_ELEMENT, u = d * l, g = s.byteOffset || 0, p = s.bufferView !== void 0 ? n.bufferViews[s.bufferView].byteStride : void 0, b = s.normalized === !0;
4441
- let m, A;
4442
- if (p && p !== u) {
4443
- const I = Math.floor(g / p), w = "InterleavedBuffer:" + s.bufferView + ":" + s.componentType + ":" + I + ":" + s.count;
4444
- let f = t.cache.get(w);
4445
- f || (m = new c(a, I * p, s.count * p / d), f = new Qn(m, p / d), t.cache.add(w, f)), A = new Jn(f, l, g % p / d, b);
4440
+ const a = o[0], l = vs[s.type], c = pt[s.componentType], d = c.BYTES_PER_ELEMENT, u = d * l, g = s.byteOffset || 0, A = s.bufferView !== void 0 ? n.bufferViews[s.bufferView].byteStride : void 0, b = s.normalized === !0;
4441
+ let m, p;
4442
+ if (A && A !== u) {
4443
+ const I = Math.floor(g / A), w = "InterleavedBuffer:" + s.bufferView + ":" + s.componentType + ":" + I + ":" + s.count;
4444
+ let h = t.cache.get(w);
4445
+ h || (m = new c(a, I * A, s.count * A / d), h = new Qn(m, A / d), t.cache.add(w, h)), p = new Jn(h, l, g % A / d, b);
4446
4446
  } else
4447
- a === null ? m = new c(s.count * l) : m = new c(a, g, s.count * l), A = new De(m, l, b);
4447
+ a === null ? m = new c(s.count * l) : m = new c(a, g, s.count * l), p = new De(m, l, b);
4448
4448
  if (s.sparse !== void 0) {
4449
- const I = vs.SCALAR, w = pt[s.sparse.indices.componentType], f = s.sparse.indices.byteOffset || 0, h = s.sparse.values.byteOffset || 0, v = new w(o[1], f, s.sparse.count * I), D = new c(o[2], h, s.sparse.count * l);
4450
- a !== null && (A = new De(A.array.slice(), A.itemSize, A.normalized)), A.normalized = !1;
4449
+ const I = vs.SCALAR, w = pt[s.sparse.indices.componentType], h = s.sparse.indices.byteOffset || 0, f = s.sparse.values.byteOffset || 0, v = new w(o[1], h, s.sparse.count * I), D = new c(o[2], f, s.sparse.count * l);
4450
+ a !== null && (p = new De(p.array.slice(), p.itemSize, p.normalized)), p.normalized = !1;
4451
4451
  for (let R = 0, T = v.length; R < T; R++) {
4452
4452
  const Y = v[R];
4453
- if (A.setX(Y, D[R * l]), l >= 2 && A.setY(Y, D[R * l + 1]), l >= 3 && A.setZ(Y, D[R * l + 2]), l >= 4 && A.setW(Y, D[R * l + 3]), l >= 5) throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.");
4453
+ if (p.setX(Y, D[R * l]), l >= 2 && p.setY(Y, D[R * l + 1]), l >= 3 && p.setZ(Y, D[R * l + 2]), l >= 4 && p.setW(Y, D[R * l + 3]), l >= 5) throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.");
4454
4454
  }
4455
- A.normalized = b;
4455
+ p.normalized = b;
4456
4456
  }
4457
- return A;
4457
+ return p;
4458
4458
  });
4459
4459
  }
4460
4460
  /**
@@ -4501,12 +4501,12 @@ class Pa {
4501
4501
  else if (o.uri === void 0)
4502
4502
  throw new Error("THREE.GLTFLoader: Image " + e + " is missing URI and bufferView");
4503
4503
  const d = Promise.resolve(l).then(function(u) {
4504
- return new Promise(function(g, p) {
4504
+ return new Promise(function(g, A) {
4505
4505
  let b = g;
4506
4506
  t.isImageBitmapLoader === !0 && (b = function(m) {
4507
- const A = new $s(m);
4508
- A.needsUpdate = !0, g(A);
4509
- }), t.load(Tt.resolveURL(u, i.path), b, void 0, p);
4507
+ const p = new $s(m);
4508
+ p.needsUpdate = !0, g(p);
4509
+ }), t.load(Tt.resolveURL(u, i.path), b, void 0, A);
4510
4510
  });
4511
4511
  }).then(function(u) {
4512
4512
  return c === !0 && a.revokeObjectURL(l), He(u, o), u.userData.mimeType = o.mimeType || Oa(o.uri), u;
@@ -4668,35 +4668,35 @@ class Pa {
4668
4668
  }
4669
4669
  return a.push(t.loadGeometries(o)), Promise.all(a).then(function(l) {
4670
4670
  const c = l.slice(0, l.length - 1), d = l[l.length - 1], u = [];
4671
- for (let p = 0, b = d.length; p < b; p++) {
4672
- const m = d[p], A = o[p];
4671
+ for (let A = 0, b = d.length; A < b; A++) {
4672
+ const m = d[A], p = o[A];
4673
4673
  let I;
4674
- const w = c[p];
4675
- if (A.mode === ve.TRIANGLES || A.mode === ve.TRIANGLE_STRIP || A.mode === ve.TRIANGLE_FAN || A.mode === void 0)
4676
- I = i.isSkinnedMesh === !0 ? new Eo(m, w) : new L(m, w), I.isSkinnedMesh === !0 && I.normalizeSkinWeights(), A.mode === ve.TRIANGLE_STRIP ? I.geometry = Mn(I.geometry, Zn) : A.mode === ve.TRIANGLE_FAN && (I.geometry = Mn(I.geometry, Ps));
4677
- else if (A.mode === ve.LINES)
4674
+ const w = c[A];
4675
+ if (p.mode === ve.TRIANGLES || p.mode === ve.TRIANGLE_STRIP || p.mode === ve.TRIANGLE_FAN || p.mode === void 0)
4676
+ I = i.isSkinnedMesh === !0 ? new Eo(m, w) : new L(m, w), I.isSkinnedMesh === !0 && I.normalizeSkinWeights(), p.mode === ve.TRIANGLE_STRIP ? I.geometry = Mn(I.geometry, Zn) : p.mode === ve.TRIANGLE_FAN && (I.geometry = Mn(I.geometry, Ps));
4677
+ else if (p.mode === ve.LINES)
4678
4678
  I = new Ss(m, w);
4679
- else if (A.mode === ve.LINE_STRIP)
4679
+ else if (p.mode === ve.LINE_STRIP)
4680
4680
  I = new We(m, w);
4681
- else if (A.mode === ve.LINE_LOOP)
4681
+ else if (p.mode === ve.LINE_LOOP)
4682
4682
  I = new Do(m, w);
4683
- else if (A.mode === ve.POINTS)
4683
+ else if (p.mode === ve.POINTS)
4684
4684
  I = new Kt(m, w);
4685
4685
  else
4686
- throw new Error("THREE.GLTFLoader: Primitive mode unsupported: " + A.mode);
4687
- Object.keys(I.geometry.morphAttributes).length > 0 && Ea(I, i), I.name = t.createUniqueName(i.name || "mesh_" + e), He(I, i), A.extensions && $e(s, I, A), t.assignFinalMaterial(I), u.push(I);
4686
+ throw new Error("THREE.GLTFLoader: Primitive mode unsupported: " + p.mode);
4687
+ Object.keys(I.geometry.morphAttributes).length > 0 && Ea(I, i), I.name = t.createUniqueName(i.name || "mesh_" + e), He(I, i), p.extensions && $e(s, I, p), t.assignFinalMaterial(I), u.push(I);
4688
4688
  }
4689
- for (let p = 0, b = u.length; p < b; p++)
4690
- t.associations.set(u[p], {
4689
+ for (let A = 0, b = u.length; A < b; A++)
4690
+ t.associations.set(u[A], {
4691
4691
  meshes: e,
4692
- primitives: p
4692
+ primitives: A
4693
4693
  });
4694
4694
  if (u.length === 1)
4695
4695
  return i.extensions && $e(s, u[0], i), u[0];
4696
4696
  const g = new Zt();
4697
4697
  i.extensions && $e(s, g, i), t.associations.set(g, { meshes: e });
4698
- for (let p = 0, b = u.length; p < b; p++)
4699
- g.add(u[p]);
4698
+ for (let A = 0, b = u.length; A < b; A++)
4699
+ g.add(u[A]);
4700
4700
  return g;
4701
4701
  });
4702
4702
  }
@@ -4751,8 +4751,8 @@ class Pa {
4751
4751
  loadAnimation(e) {
4752
4752
  const t = this.json, n = this, s = t.animations[e], i = s.name ? s.name : "animation_" + e, o = [], a = [], l = [], c = [], d = [];
4753
4753
  for (let u = 0, g = s.channels.length; u < g; u++) {
4754
- const p = s.channels[u], b = s.samplers[p.sampler], m = p.target, A = m.node, I = s.parameters !== void 0 ? s.parameters[b.input] : b.input, w = s.parameters !== void 0 ? s.parameters[b.output] : b.output;
4755
- m.node !== void 0 && (o.push(this.getDependency("node", A)), a.push(this.getDependency("accessor", I)), l.push(this.getDependency("accessor", w)), c.push(b), d.push(m));
4754
+ const A = s.channels[u], b = s.samplers[A.sampler], m = A.target, p = m.node, I = s.parameters !== void 0 ? s.parameters[b.input] : b.input, w = s.parameters !== void 0 ? s.parameters[b.output] : b.output;
4755
+ m.node !== void 0 && (o.push(this.getDependency("node", p)), a.push(this.getDependency("accessor", I)), l.push(this.getDependency("accessor", w)), c.push(b), d.push(m));
4756
4756
  }
4757
4757
  return Promise.all([
4758
4758
  Promise.all(o),
@@ -4761,9 +4761,9 @@ class Pa {
4761
4761
  Promise.all(c),
4762
4762
  Promise.all(d)
4763
4763
  ]).then(function(u) {
4764
- const g = u[0], p = u[1], b = u[2], m = u[3], A = u[4], I = [];
4765
- for (let f = 0, h = g.length; f < h; f++) {
4766
- const v = g[f], D = p[f], R = b[f], T = m[f], Y = A[f];
4764
+ const g = u[0], A = u[1], b = u[2], m = u[3], p = u[4], I = [];
4765
+ for (let h = 0, f = g.length; h < f; h++) {
4766
+ const v = g[h], D = A[h], R = b[h], T = m[h], Y = p[h];
4767
4767
  if (v === void 0) continue;
4768
4768
  v.updateMatrix && v.updateMatrix();
4769
4769
  const $ = n._createAnimationTracks(v, D, R, T, Y);
@@ -4804,14 +4804,14 @@ class Pa {
4804
4804
  l
4805
4805
  ]).then(function(c) {
4806
4806
  const d = c[0], u = c[1], g = c[2];
4807
- g !== null && d.traverse(function(p) {
4808
- p.isSkinnedMesh && p.bind(g, Ra);
4807
+ g !== null && d.traverse(function(A) {
4808
+ A.isSkinnedMesh && A.bind(g, Ra);
4809
4809
  });
4810
- for (let p = 0, b = u.length; p < b; p++)
4811
- d.add(u[p]);
4810
+ for (let A = 0, b = u.length; A < b; A++)
4811
+ d.add(u[A]);
4812
4812
  if (d.userData.pivot !== void 0 && u.length > 0) {
4813
- const p = d.userData.pivot, b = u[0];
4814
- d.pivot = new P().fromArray(p), d.position.x -= p[0], d.position.y -= p[1], d.position.z -= p[2], b.position.set(0, 0, 0), delete d.userData.pivot;
4813
+ const A = d.userData.pivot, b = u[0];
4814
+ d.pivot = new P().fromArray(A), d.position.x -= A[0], d.position.y -= A[1], d.position.z -= A[2], b.position.set(0, 0, 0), delete d.userData.pivot;
4815
4815
  }
4816
4816
  return d;
4817
4817
  });
@@ -4870,11 +4870,11 @@ class Pa {
4870
4870
  }
4871
4871
  const c = (d) => {
4872
4872
  const u = /* @__PURE__ */ new Map();
4873
- for (const [g, p] of s.associations)
4874
- (g instanceof Et || g instanceof $s) && u.set(g, p);
4873
+ for (const [g, A] of s.associations)
4874
+ (g instanceof Et || g instanceof $s) && u.set(g, A);
4875
4875
  return d.traverse((g) => {
4876
- const p = s.associations.get(g);
4877
- p != null && u.set(g, p);
4876
+ const A = s.associations.get(g);
4877
+ A != null && u.set(g, A);
4878
4878
  }), u;
4879
4879
  };
4880
4880
  return s.associations = c(i), i;
@@ -4882,8 +4882,8 @@ class Pa {
4882
4882
  }
4883
4883
  _createAnimationTracks(e, t, n, s, i) {
4884
4884
  const o = [], a = e.name ? e.name : e.uuid, l = [];
4885
- function c(p) {
4886
- p.morphTargetInfluences && l.push(p.name ? p.name : p.uuid);
4885
+ function c(A) {
4886
+ A.morphTargetInfluences && l.push(A.name ? A.name : A.uuid);
4887
4887
  }
4888
4888
  qe[i.path] === qe.weights ? (c(e), e.isGroup && e.children.forEach(c)) : l.push(a);
4889
4889
  let d;
@@ -4912,9 +4912,9 @@ class Pa {
4912
4912
  break;
4913
4913
  }
4914
4914
  const u = s.interpolation !== void 0 ? va[s.interpolation] : Bs, g = this._getArrayFromAccessor(n);
4915
- for (let p = 0, b = l.length; p < b; p++) {
4915
+ for (let A = 0, b = l.length; A < b; A++) {
4916
4916
  const m = new d(
4917
- l[p] + "." + qe[i.path],
4917
+ l[A] + "." + qe[i.path],
4918
4918
  t.array,
4919
4919
  g,
4920
4920
  u
@@ -4964,9 +4964,9 @@ function Sa(r, e, t) {
4964
4964
  for (let c = 0, d = i.length; c < d; c++) {
4965
4965
  const u = i[c];
4966
4966
  if (u.POSITION !== void 0) {
4967
- const g = t.json.accessors[u.POSITION], p = g.min, b = g.max;
4968
- if (p !== void 0 && b !== void 0) {
4969
- if (l.setX(Math.max(Math.abs(p[0]), Math.abs(b[0]))), l.setY(Math.max(Math.abs(p[1]), Math.abs(b[1]))), l.setZ(Math.max(Math.abs(p[2]), Math.abs(b[2]))), g.normalized) {
4967
+ const g = t.json.accessors[u.POSITION], A = g.min, b = g.max;
4968
+ if (A !== void 0 && b !== void 0) {
4969
+ if (l.setX(Math.max(Math.abs(A[0]), Math.abs(b[0]))), l.setY(Math.max(Math.abs(A[1]), Math.abs(b[1]))), l.setZ(Math.max(Math.abs(A[2]), Math.abs(b[2]))), g.normalized) {
4970
4970
  const m = Ns(pt[g.componentType]);
4971
4971
  l.multiplyScalar(m);
4972
4972
  }
@@ -5549,26 +5549,26 @@ function ml(r, e, t = 1e3, n, s) {
5549
5549
  if (!r)
5550
5550
  return console.warn("[脚本动画] 目标对象为空,无法执行透明度动画"), null;
5551
5551
  const i = /* @__PURE__ */ new Set();
5552
- if (r.traverse((p) => {
5553
- const b = p.material;
5552
+ if (r.traverse((A) => {
5553
+ const b = A.material;
5554
5554
  if (!b) return;
5555
- (Array.isArray(b) ? b : [b]).forEach((A) => A && i.add(A));
5555
+ (Array.isArray(b) ? b : [b]).forEach((p) => p && i.add(p));
5556
5556
  }), i.size === 0)
5557
5557
  return console.warn("[脚本动画] 目标及其子节点没有材质,无法执行透明度动画:", r.name), null;
5558
5558
  const o = t ?? 1e3, a = vi[n ?? "quad.inout"] ?? de.Easing.Quadratic.InOut, l = Math.min(1, Math.max(0, e)), c = l <= 0.01;
5559
5559
  c || (r.visible = !0), Ys(r, ["opacity"]);
5560
5560
  const d = [...i];
5561
- d.forEach((p) => {
5562
- p.transparent = !0, p.needsUpdate = !0;
5561
+ d.forEach((A) => {
5562
+ A.transparent = !0, A.needsUpdate = !0;
5563
5563
  }), C.renderer && C.scene && C.camera && C.renderer.render(C.scene, C.camera);
5564
- const u = Mi(r), g = d.map((p) => {
5565
- const b = new de.Tween(p).to({ opacity: l }, o).easing(a).start();
5564
+ const u = Mi(r), g = d.map((A) => {
5565
+ const b = new de.Tween(A).to({ opacity: l }, o).easing(a).start();
5566
5566
  return u.opacity.add(b), b;
5567
5567
  });
5568
- return g.forEach((p, b) => {
5569
- b === 0 ? p.onComplete(() => {
5570
- u.opacity.delete(p), c && (r.visible = !1), s == null || s(), r === C.selectedObject && (Te == null || Te(r));
5571
- }) : p.onComplete(() => u.opacity.delete(p)), p.onStop(() => u.opacity.delete(p));
5568
+ return g.forEach((A, b) => {
5569
+ b === 0 ? A.onComplete(() => {
5570
+ u.opacity.delete(A), c && (r.visible = !1), s == null || s(), r === C.selectedObject && (Te == null || Te(r));
5571
+ }) : A.onComplete(() => u.opacity.delete(A)), A.onStop(() => u.opacity.delete(A));
5572
5572
  }), g[0] ?? null;
5573
5573
  }
5574
5574
  function gl() {
@@ -5651,7 +5651,7 @@ function yl() {
5651
5651
  }
5652
5652
  const bl = 16777215, xl = 1;
5653
5653
  async function Il() {
5654
- var h, v, D, R;
5654
+ var f, v, D, R;
5655
5655
  xe == null || xe(!0), await new Promise((T) => setTimeout(T, 50)), qs();
5656
5656
  const r = C.scene;
5657
5657
  if (!r)
@@ -5747,7 +5747,7 @@ async function Il() {
5747
5747
  }
5748
5748
  }
5749
5749
  }), e.forEach((T) => r.remove(T));
5750
- const c = (h = C.transformControls) == null ? void 0 : h.getHelper(), d = (c == null ? void 0 : c.parent) ?? null;
5750
+ const c = (f = C.transformControls) == null ? void 0 : f.getHelper(), d = (c == null ? void 0 : c.parent) ?? null;
5751
5751
  c && c.parent && c.parent.remove(c);
5752
5752
  const u = /* @__PURE__ */ new Map();
5753
5753
  for (const T of l)
@@ -5761,16 +5761,16 @@ async function Il() {
5761
5761
  });
5762
5762
  for (const T of g)
5763
5763
  r.remove(T);
5764
- const p = /* @__PURE__ */ new Map();
5764
+ const A = /* @__PURE__ */ new Map();
5765
5765
  for (const T of o)
5766
- p.set(T, T.parent), T.parent && T.parent.remove(T);
5766
+ A.set(T, T.parent), T.parent && T.parent.remove(T);
5767
5767
  const b = r.clone();
5768
5768
  b.children = b.children.filter(
5769
5769
  (T) => T.userData.type !== "initFloor"
5770
5770
  ), b.traverse((T) => {
5771
5771
  T.name && T.name.startsWith("DataPanel_") && T.parent && T.parent.remove(T);
5772
5772
  });
5773
- const A = await new Dt().parseAsync(b, {
5773
+ const p = await new Dt().parseAsync(b, {
5774
5774
  binary: !0,
5775
5775
  onlyVisible: !1,
5776
5776
  embedImages: !0
@@ -5783,7 +5783,7 @@ async function Il() {
5783
5783
  for (const T of g)
5784
5784
  r.add(T);
5785
5785
  for (const T of o) {
5786
- const Y = p.get(T);
5786
+ const Y = A.get(T);
5787
5787
  Y ? Y.add(T) : r.add(T);
5788
5788
  }
5789
5789
  t.forEach((T, Y) => {
@@ -5799,8 +5799,8 @@ async function Il() {
5799
5799
  n.forEach((T, Y) => {
5800
5800
  w[Y] = T;
5801
5801
  });
5802
- const f = {
5803
- scene: A,
5802
+ const h = {
5803
+ scene: p,
5804
5804
  camera: I,
5805
5805
  dataPanels: w,
5806
5806
  waters: i,
@@ -5812,7 +5812,7 @@ async function Il() {
5812
5812
  code: T.code
5813
5813
  }))
5814
5814
  };
5815
- return xe == null || xe(!1), f;
5815
+ return xe == null || xe(!1), h;
5816
5816
  }
5817
5817
  function Cl(r) {
5818
5818
  if (r instanceof ArrayBuffer || ArrayBuffer.isView(r)) {
@@ -5838,30 +5838,45 @@ function Cl(r) {
5838
5838
  return r && typeof r == "object" && r.type === "Buffer" && Array.isArray(r.data) ? new Uint8Array(r.data).buffer : null;
5839
5839
  }
5840
5840
  async function wl(r, e = "edit", t, n, s, i, o) {
5841
- var l, c, d, u, g, p, b;
5841
+ var l, c, d, u, g, A, b;
5842
5842
  const a = Cl(r);
5843
5843
  if (a) {
5844
- const m = await new ai().parseAsync(a, ""), A = m.scene || ((l = m.scenes) == null ? void 0 : l[0]), I = (c = C.scene) == null ? void 0 : c.environment;
5845
- if (C.scene = A, !A.children.some((w) => w.type === "AmbientLight"))
5844
+ const m = await new ai().parseAsync(a, ""), p = m.scene || ((l = m.scenes) == null ? void 0 : l[0]), I = (c = C.scene) == null ? void 0 : c.environment;
5845
+ if (C.scene = p, !p.children.some((f) => f.type === "AmbientLight"))
5846
5846
  if (i) {
5847
- const w = new O.AmbientLight(i.color, i.intensity);
5848
- w.name = i.name || "环境光", w.visible = i.visible ?? !0, i.position && w.position.fromArray(i.position), A.add(w);
5847
+ const f = new O.AmbientLight(i.color, i.intensity);
5848
+ f.name = i.name || "环境光", f.visible = i.visible ?? !0, i.position && f.position.fromArray(i.position), p.add(f);
5849
5849
  } else
5850
- hi(A);
5850
+ hi(p);
5851
5851
  if (I)
5852
5852
  C.scene.environment = I, C.scene.environmentIntensity = 1;
5853
5853
  else if (C.renderer) {
5854
- const w = Jt(C.renderer);
5855
- w && (C.scene.environment = w, C.scene.environmentIntensity = 1);
5854
+ const f = Jt(C.renderer);
5855
+ f && (C.scene.environment = f, C.scene.environmentIntensity = 1);
5856
5856
  }
5857
5857
  if (!C.scene.environment && C.renderer) {
5858
- const w = Jt(C.renderer);
5859
- w ? (C.scene.environment = w, C.scene.environmentIntensity = 1, console.warn("[导入] 原环境贴图不可用,已重新生成")) : console.error("[导入] 环境贴图生成失败,场景将没有 IBL 间接光照,模型会偏暗");
5858
+ const f = Jt(C.renderer);
5859
+ f ? (C.scene.environment = f, C.scene.environmentIntensity = 1, console.warn("[导入] 原环境贴图不可用,已重新生成")) : console.error("[导入] 环境贴图生成失败,场景将没有 IBL 间接光照,模型会偏暗");
5860
5860
  }
5861
- bi(A), A.traverse((w) => {
5862
- const f = w.material;
5863
- w.userData.isWater && f && !f.uniforms && !w.userData.waterSpeed && (w.userData.waterSpeed = { x: 5e-4, y: 5e-4 });
5864
- });
5861
+ bi(p);
5862
+ const w = p.children.find(
5863
+ (f) => f.type === "Group" && f.name === "sl_scene"
5864
+ );
5865
+ if (w) {
5866
+ w.updateMatrixWorld();
5867
+ const f = w.matrixWorld.clone();
5868
+ [...w.children].forEach((v) => {
5869
+ w.remove(v), v.applyMatrix4(f), p.add(v);
5870
+ }), p.remove(w);
5871
+ }
5872
+ const h = (f) => {
5873
+ if (f.isTransformControlsRoot || f.isGridHelper || f.type === "Line" || f.type === "LineSegments" || f.type === "AmbientLight" || f.userData.type === "lightHelper" || f.userData.type === "initFloor")
5874
+ return;
5875
+ f.userData.isMovable = !0;
5876
+ const v = f.material;
5877
+ f.userData.isWater && v && !v.uniforms && !f.userData.waterSpeed && (f.userData.waterSpeed = { x: 5e-4, y: 5e-4 }), f.children.forEach(h);
5878
+ };
5879
+ h(p);
5865
5880
  } else {
5866
5881
  const m = typeof r == "string" ? JSON.parse(r) : r, I = new O.ObjectLoader().parse(m);
5867
5882
  if (I.type === "Scene") {
@@ -5869,14 +5884,14 @@ async function wl(r, e = "edit", t, n, s, i, o) {
5869
5884
  if (C.scene = I, w)
5870
5885
  C.scene.environment = w, C.scene.environmentIntensity = 1;
5871
5886
  else if (C.renderer) {
5872
- const f = Jt(C.renderer);
5873
- f && (C.scene.environment = f, C.scene.environmentIntensity = 1);
5887
+ const h = Jt(C.renderer);
5888
+ h && (C.scene.environment = h, C.scene.environmentIntensity = 1);
5874
5889
  }
5875
5890
  } else
5876
5891
  (u = C.scene) == null || u.add(I);
5877
5892
  }
5878
5893
  if (t && ((g = C.scene) == null || g.traverse((m) => {
5879
- const A = m.userData.id || m.userData._sourceUuid || m.uuid, I = t[A];
5894
+ const p = m.userData.id || m.userData._sourceUuid || m.uuid, I = t[p];
5880
5895
  if (I && m.userData.isMovable) {
5881
5896
  tl(m);
5882
5897
  const w = new as({
@@ -5885,61 +5900,61 @@ async function wl(r, e = "edit", t, n, s, i, o) {
5885
5900
  });
5886
5901
  w.attachTo(m), w.visible = !1, I.width && w.setWidth(I.width), I.fontSize && w.setFontSize(I.fontSize), I.offsetY !== void 0 && w.setOffsetY(I.offsetY), I.offsetX !== void 0 && w.setOffsetX(I.offsetX), I.offsetZ !== void 0 && w.setOffsetZ(I.offsetZ), ni(m, w);
5887
5902
  }
5888
- })), n && n.length > 0 && Promise.resolve().then(() => Nl).then(({ addWater: m, addWaterCylinder: A }) => {
5903
+ })), n && n.length > 0 && Promise.resolve().then(() => Nl).then(({ addWater: m, addWaterCylinder: p }) => {
5889
5904
  for (const I of n) {
5890
5905
  const w = I.geometryType || "box";
5891
- let f;
5892
- w === "cylinder" ? f = A({
5906
+ let h;
5907
+ w === "cylinder" ? h = p({
5893
5908
  radiusTop: I.cylinderRadiusTop ?? 5,
5894
5909
  radiusBottom: I.cylinderRadiusBottom ?? 5,
5895
5910
  radialSegments: I.cylinderRadialSegments ?? 32,
5896
5911
  height: 0.8,
5897
5912
  color: I.color,
5898
5913
  scale: 4
5899
- }) : f = m({
5914
+ }) : h = m({
5900
5915
  width: I.boxWidth ?? 10,
5901
5916
  height: I.boxDepth ?? 10,
5902
5917
  color: I.color,
5903
5918
  scale: 4
5904
- }), f.position.fromArray(I.position), f.rotation.set(I.rotation[0], I.rotation[1], I.rotation[2]), f.scale.fromArray(I.scale), f.name = I.name, f.userData.waterTimeScale = I.timeScale ?? 0.05, f.userData.isWater = !0, f.userData.isMovable = !0, I.alpha !== void 0 && f.material.uniforms && f.material.uniforms.alpha && (f.material.uniforms.alpha.value = I.alpha), Nt = !0;
5919
+ }), h.position.fromArray(I.position), h.rotation.set(I.rotation[0], I.rotation[1], I.rotation[2]), h.scale.fromArray(I.scale), h.name = I.name, h.userData.waterTimeScale = I.timeScale ?? 0.05, h.userData.isWater = !0, h.userData.isMovable = !0, I.alpha !== void 0 && h.material.uniforms && h.material.uniforms.alpha && (h.material.uniforms.alpha.value = I.alpha), Nt = !0;
5905
5920
  }
5906
5921
  Ci();
5907
5922
  }), s) {
5908
5923
  const m = new O.TextureLoader();
5909
- (p = C.scene) == null || p.traverse((A) => {
5910
- if (A.type === "Mesh") {
5911
- const I = A, w = Array.isArray(I.material) ? I.material : [I.material];
5912
- for (const f of w)
5913
- if (f && f.uuid && s[f.uuid]) {
5914
- const h = s[f.uuid];
5915
- if (h.mapDataUrl) {
5916
- const v = m.load(h.mapDataUrl);
5917
- v.wrapS = v.wrapT = O.RepeatWrapping, v.repeat.set(1, 1), f.map = v, f.userData = f.userData || {}, f.userData._mapDataUrl = h.mapDataUrl, f.userData._mapFileName = h.mapFileName;
5924
+ (A = C.scene) == null || A.traverse((p) => {
5925
+ if (p.type === "Mesh") {
5926
+ const I = p, w = Array.isArray(I.material) ? I.material : [I.material];
5927
+ for (const h of w)
5928
+ if (h && h.uuid && s[h.uuid]) {
5929
+ const f = s[h.uuid];
5930
+ if (f.mapDataUrl) {
5931
+ const v = m.load(f.mapDataUrl);
5932
+ v.wrapS = v.wrapT = O.RepeatWrapping, v.repeat.set(1, 1), h.map = v, h.userData = h.userData || {}, h.userData._mapDataUrl = f.mapDataUrl, h.userData._mapFileName = f.mapFileName;
5918
5933
  }
5919
- if (h.normalMapDataUrl) {
5920
- const v = m.load(h.normalMapDataUrl);
5921
- v.wrapS = v.wrapT = O.RepeatWrapping, v.repeat.set(1, 1), f.normalMap = v, f.normalScale = new O.Vector2(
5922
- h.normalScale ?? 1,
5923
- h.normalScale ?? 1
5924
- ), f.userData = f.userData || {}, f.userData._normalMapDataUrl = h.normalMapDataUrl, f.userData._normalMapFileName = h.normalMapFileName;
5934
+ if (f.normalMapDataUrl) {
5935
+ const v = m.load(f.normalMapDataUrl);
5936
+ v.wrapS = v.wrapT = O.RepeatWrapping, v.repeat.set(1, 1), h.normalMap = v, h.normalScale = new O.Vector2(
5937
+ f.normalScale ?? 1,
5938
+ f.normalScale ?? 1
5939
+ ), h.userData = h.userData || {}, h.userData._normalMapDataUrl = f.normalMapDataUrl, h.userData._normalMapFileName = f.normalMapFileName;
5925
5940
  }
5926
- if (h.aoMapDataUrl) {
5927
- const v = m.load(h.aoMapDataUrl);
5928
- v.wrapS = v.wrapT = O.RepeatWrapping, v.repeat.set(1, 1), f.aoMap = v, f.aoMapIntensity = h.aoMapIntensity ?? 1, f.userData = f.userData || {}, f.userData._aoMapDataUrl = h.aoMapDataUrl, f.userData._aoMapFileName = h.aoMapFileName;
5941
+ if (f.aoMapDataUrl) {
5942
+ const v = m.load(f.aoMapDataUrl);
5943
+ v.wrapS = v.wrapT = O.RepeatWrapping, v.repeat.set(1, 1), h.aoMap = v, h.aoMapIntensity = f.aoMapIntensity ?? 1, h.userData = h.userData || {}, h.userData._aoMapDataUrl = f.aoMapDataUrl, h.userData._aoMapFileName = f.aoMapFileName;
5929
5944
  }
5930
- f.needsUpdate = !0;
5945
+ h.needsUpdate = !0;
5931
5946
  }
5932
5947
  }
5933
5948
  });
5934
5949
  }
5935
5950
  o && ka(o), e === "edit" && ((b = C.scene) == null || b.traverse((m) => {
5936
- var A, I;
5951
+ var p, I;
5937
5952
  if (m.type === "DirectionalLight") {
5938
5953
  const w = m;
5939
5954
  if (!w.userData.helper) {
5940
- w.target.parent !== C.scene && (w.target.parent && w.target.parent.remove(w.target), w.target.position.set(0, 0, 0), (A = C.scene) == null || A.add(w.target));
5941
- const f = new O.DirectionalLightHelper(w, 1);
5942
- f.userData.type = "lightHelper", w.userData.helper = f, f.update(), (I = C.scene) == null || I.add(f);
5955
+ w.target.parent !== C.scene && (w.target.parent && w.target.parent.remove(w.target), w.target.position.set(0, 0, 0), (p = C.scene) == null || p.add(w.target));
5956
+ const h = new O.DirectionalLightHelper(w, 1);
5957
+ h.userData.type = "lightHelper", w.userData.helper = h, h.update(), (I = C.scene) == null || I.add(h);
5943
5958
  }
5944
5959
  }
5945
5960
  }));
@@ -6089,15 +6104,15 @@ function Ol() {
6089
6104
  },
6090
6105
  addFace: function(e, t, n, s, i, o, a, l, c) {
6091
6106
  const d = this.vertices.length;
6092
- let u = this.parseVertexIndex(e, d), g = this.parseVertexIndex(t, d), p = this.parseVertexIndex(n, d);
6093
- if (this.addVertex(u, g, p), this.addColor(u, g, p), a !== void 0 && a !== "") {
6107
+ let u = this.parseVertexIndex(e, d), g = this.parseVertexIndex(t, d), A = this.parseVertexIndex(n, d);
6108
+ if (this.addVertex(u, g, A), this.addColor(u, g, A), a !== void 0 && a !== "") {
6094
6109
  const b = this.normals.length;
6095
- u = this.parseNormalIndex(a, b), g = this.parseNormalIndex(l, b), p = this.parseNormalIndex(c, b), this.addNormal(u, g, p);
6110
+ u = this.parseNormalIndex(a, b), g = this.parseNormalIndex(l, b), A = this.parseNormalIndex(c, b), this.addNormal(u, g, A);
6096
6111
  } else
6097
- this.addFaceNormal(u, g, p);
6112
+ this.addFaceNormal(u, g, A);
6098
6113
  if (s !== void 0 && s !== "") {
6099
6114
  const b = this.uvs.length;
6100
- u = this.parseUVIndex(s, b), g = this.parseUVIndex(i, b), p = this.parseUVIndex(o, b), this.addUV(u, g, p), this.object.geometry.hasUVIndices = !0;
6115
+ u = this.parseUVIndex(s, b), g = this.parseUVIndex(i, b), A = this.parseUVIndex(o, b), this.addUV(u, g, A), this.object.geometry.hasUVIndices = !0;
6101
6116
  } else
6102
6117
  this.addDefaultUV();
6103
6118
  },
@@ -6207,17 +6222,17 @@ class Rl extends Xs {
6207
6222
  break;
6208
6223
  }
6209
6224
  } else if (d === "f") {
6210
- const g = c.slice(1).trim().split(Nn), p = [];
6211
- for (let m = 0, A = g.length; m < A; m++) {
6225
+ const g = c.slice(1).trim().split(Nn), A = [];
6226
+ for (let m = 0, p = g.length; m < p; m++) {
6212
6227
  const I = g[m];
6213
6228
  if (I.length > 0) {
6214
6229
  const w = I.split("/");
6215
- p.push(w);
6230
+ A.push(w);
6216
6231
  }
6217
6232
  }
6218
- const b = p[0];
6219
- for (let m = 1, A = p.length - 1; m < A; m++) {
6220
- const I = p[m], w = p[m + 1];
6233
+ const b = A[0];
6234
+ for (let m = 1, p = A.length - 1; m < p; m++) {
6235
+ const I = A[m], w = A[m + 1];
6221
6236
  t.addFace(
6222
6237
  b[0],
6223
6238
  I[0],
@@ -6233,15 +6248,15 @@ class Rl extends Xs {
6233
6248
  } else if (d === "l") {
6234
6249
  const u = c.substring(1).trim().split(" ");
6235
6250
  let g = [];
6236
- const p = [];
6251
+ const A = [];
6237
6252
  if (c.indexOf("/") === -1)
6238
6253
  g = u;
6239
6254
  else
6240
6255
  for (let b = 0, m = u.length; b < m; b++) {
6241
- const A = u[b].split("/");
6242
- A[0] !== "" && g.push(A[0]), A[1] !== "" && p.push(A[1]);
6256
+ const p = u[b].split("/");
6257
+ p[0] !== "" && g.push(p[0]), p[1] !== "" && A.push(p[1]);
6243
6258
  }
6244
- t.addLineGeometry(g, p);
6259
+ t.addLineGeometry(g, A);
6245
6260
  } else if (d === "p") {
6246
6261
  const g = c.slice(1).trim().split(" ");
6247
6262
  t.addPointGeometry(g);
@@ -6271,35 +6286,35 @@ class Rl extends Xs {
6271
6286
  const i = new Zt();
6272
6287
  if (i.materialLibraries = [].concat(t.materialLibraries), !(t.objects.length === 1 && t.objects[0].geometry.vertices.length === 0) === !0)
6273
6288
  for (let a = 0, l = t.objects.length; a < l; a++) {
6274
- const c = t.objects[a], d = c.geometry, u = c.materials, g = d.type === "Line", p = d.type === "Points";
6289
+ const c = t.objects[a], d = c.geometry, u = c.materials, g = d.type === "Line", A = d.type === "Points";
6275
6290
  let b = !1;
6276
6291
  if (d.vertices.length === 0) continue;
6277
6292
  const m = new rt();
6278
6293
  m.setAttribute("position", new ke(d.vertices, 3)), d.normals.length > 0 && m.setAttribute("normal", new ke(d.normals, 3)), d.colors.length > 0 && (b = !0, m.setAttribute("color", new ke(d.colors, 3))), d.hasUVIndices === !0 && m.setAttribute("uv", new ke(d.uvs, 2));
6279
- const A = [];
6280
- for (let w = 0, f = u.length; w < f; w++) {
6281
- const h = u[w], v = h.name + "_" + h.smooth + "_" + b;
6294
+ const p = [];
6295
+ for (let w = 0, h = u.length; w < h; w++) {
6296
+ const f = u[w], v = f.name + "_" + f.smooth + "_" + b;
6282
6297
  let D = t.materials[v];
6283
6298
  if (this.materials !== null) {
6284
- if (D = this.materials.create(h.name), g && D && !(D instanceof Mt)) {
6299
+ if (D = this.materials.create(f.name), g && D && !(D instanceof Mt)) {
6285
6300
  const R = new Mt();
6286
6301
  Et.prototype.copy.call(R, D), R.color.copy(D.color), D = R;
6287
- } else if (p && D && !(D instanceof It)) {
6302
+ } else if (A && D && !(D instanceof It)) {
6288
6303
  const R = new It({ size: 10, sizeAttenuation: !1 });
6289
6304
  Et.prototype.copy.call(R, D), R.color.copy(D.color), R.map = D.map, D = R;
6290
6305
  }
6291
6306
  }
6292
- D === void 0 && (g ? D = new Mt() : p ? D = new It({ size: 1, sizeAttenuation: !1 }) : D = new Ho(), D.name = h.name, D.flatShading = !h.smooth, D.vertexColors = b, t.materials[v] = D), A.push(D);
6307
+ D === void 0 && (g ? D = new Mt() : A ? D = new It({ size: 1, sizeAttenuation: !1 }) : D = new Ho(), D.name = f.name, D.flatShading = !f.smooth, D.vertexColors = b, t.materials[v] = D), p.push(D);
6293
6308
  }
6294
6309
  let I;
6295
- if (A.length > 1) {
6296
- for (let w = 0, f = u.length; w < f; w++) {
6297
- const h = u[w];
6298
- m.addGroup(h.groupStart, h.groupCount, w);
6310
+ if (p.length > 1) {
6311
+ for (let w = 0, h = u.length; w < h; w++) {
6312
+ const f = u[w];
6313
+ m.addGroup(f.groupStart, f.groupCount, w);
6299
6314
  }
6300
- g ? I = new Ss(m, A) : p ? I = new Kt(m, A) : I = new L(m, A);
6315
+ g ? I = new Ss(m, p) : A ? I = new Kt(m, p) : I = new L(m, p);
6301
6316
  } else
6302
- g ? I = new Ss(m, A[0]) : p ? I = new Kt(m, A[0]) : I = new L(m, A[0]);
6317
+ g ? I = new Ss(m, p[0]) : A ? I = new Kt(m, p[0]) : I = new L(m, p[0]);
6303
6318
  I.name = c.name, i.add(I);
6304
6319
  }
6305
6320
  else if (t.vertices.length > 0) {
@@ -6520,10 +6535,10 @@ function Sl() {
6520
6535
  e.then((d) => {
6521
6536
  const u = d.draco, g = new u.Decoder();
6522
6537
  try {
6523
- const p = t(u, g, new Int8Array(l), c), b = p.attributes.map((m) => m.array.buffer);
6524
- p.index && b.push(p.index.array.buffer), self.postMessage({ type: "decode", id: a.id, geometry: p }, b);
6525
- } catch (p) {
6526
- console.error(p), self.postMessage({ type: "error", id: a.id, error: p.message });
6538
+ const A = t(u, g, new Int8Array(l), c), b = A.attributes.map((m) => m.array.buffer);
6539
+ A.index && b.push(A.index.array.buffer), self.postMessage({ type: "decode", id: a.id, geometry: A }, b);
6540
+ } catch (A) {
6541
+ console.error(A), self.postMessage({ type: "error", id: a.id, error: A.message });
6527
6542
  } finally {
6528
6543
  u.destroy(g);
6529
6544
  }
@@ -6533,57 +6548,57 @@ function Sl() {
6533
6548
  };
6534
6549
  function t(o, a, l, c) {
6535
6550
  const d = c.attributeIDs, u = c.attributeTypes;
6536
- let g, p;
6551
+ let g, A;
6537
6552
  const b = a.GetEncodedGeometryType(l);
6538
6553
  if (b === o.TRIANGULAR_MESH)
6539
- g = new o.Mesh(), p = a.DecodeArrayToMesh(l, l.byteLength, g);
6554
+ g = new o.Mesh(), A = a.DecodeArrayToMesh(l, l.byteLength, g);
6540
6555
  else if (b === o.POINT_CLOUD)
6541
- g = new o.PointCloud(), p = a.DecodeArrayToPointCloud(l, l.byteLength, g);
6556
+ g = new o.PointCloud(), A = a.DecodeArrayToPointCloud(l, l.byteLength, g);
6542
6557
  else
6543
6558
  throw new Error("THREE.DRACOLoader: Unexpected geometry type.");
6544
- if (!p.ok() || g.ptr === 0)
6545
- throw new Error("THREE.DRACOLoader: Decoding failed: " + p.error_msg());
6559
+ if (!A.ok() || g.ptr === 0)
6560
+ throw new Error("THREE.DRACOLoader: Decoding failed: " + A.error_msg());
6546
6561
  const m = { index: null, attributes: [] };
6547
- for (const A in d) {
6548
- const I = self[u[A]];
6549
- let w, f;
6562
+ for (const p in d) {
6563
+ const I = self[u[p]];
6564
+ let w, h;
6550
6565
  if (c.useUniqueIDs)
6551
- f = d[A], w = a.GetAttributeByUniqueId(g, f);
6566
+ h = d[p], w = a.GetAttributeByUniqueId(g, h);
6552
6567
  else {
6553
- if (f = a.GetAttributeId(g, o[d[A]]), f === -1) continue;
6554
- w = a.GetAttribute(g, f);
6568
+ if (h = a.GetAttributeId(g, o[d[p]]), h === -1) continue;
6569
+ w = a.GetAttribute(g, h);
6555
6570
  }
6556
- const h = s(o, a, g, A, I, w);
6557
- A === "color" && (h.vertexColorSpace = c.vertexColorSpace), m.attributes.push(h);
6571
+ const f = s(o, a, g, p, I, w);
6572
+ p === "color" && (f.vertexColorSpace = c.vertexColorSpace), m.attributes.push(f);
6558
6573
  }
6559
6574
  return b === o.TRIANGULAR_MESH && (m.index = n(o, a, g)), o.destroy(g), m;
6560
6575
  }
6561
6576
  function n(o, a, l) {
6562
6577
  const d = l.num_faces() * 3, u = d * 4, g = o._malloc(u);
6563
6578
  a.GetTrianglesUInt32Array(l, u, g);
6564
- const p = new Uint32Array(o.HEAPF32.buffer, g, d).slice();
6565
- return o._free(g), { array: p, itemSize: 1 };
6579
+ const A = new Uint32Array(o.HEAPF32.buffer, g, d).slice();
6580
+ return o._free(g), { array: A, itemSize: 1 };
6566
6581
  }
6567
6582
  function s(o, a, l, c, d, u) {
6568
- const g = l.num_points(), p = u.num_components(), b = i(o, d), m = p * d.BYTES_PER_ELEMENT, A = Math.ceil(m / 4) * 4, I = A / d.BYTES_PER_ELEMENT, w = g * m, f = g * A, h = o._malloc(w);
6569
- a.GetAttributeDataArrayForAllPoints(l, u, b, w, h);
6570
- const v = new d(o.HEAPF32.buffer, h, w / d.BYTES_PER_ELEMENT);
6583
+ const g = l.num_points(), A = u.num_components(), b = i(o, d), m = A * d.BYTES_PER_ELEMENT, p = Math.ceil(m / 4) * 4, I = p / d.BYTES_PER_ELEMENT, w = g * m, h = g * p, f = o._malloc(w);
6584
+ a.GetAttributeDataArrayForAllPoints(l, u, b, w, f);
6585
+ const v = new d(o.HEAPF32.buffer, f, w / d.BYTES_PER_ELEMENT);
6571
6586
  let D;
6572
- if (m === A)
6587
+ if (m === p)
6573
6588
  D = v.slice();
6574
6589
  else {
6575
- D = new d(f / d.BYTES_PER_ELEMENT);
6590
+ D = new d(h / d.BYTES_PER_ELEMENT);
6576
6591
  let R = 0;
6577
6592
  for (let T = 0, Y = v.length; T < Y; T++) {
6578
- for (let $ = 0; $ < p; $++)
6579
- D[R + $] = v[T * p + $];
6593
+ for (let $ = 0; $ < A; $++)
6594
+ D[R + $] = v[T * A + $];
6580
6595
  R += I;
6581
6596
  }
6582
6597
  }
6583
- return o._free(h), {
6598
+ return o._free(f), {
6584
6599
  name: c,
6585
6600
  count: g,
6586
- itemSize: p,
6601
+ itemSize: A,
6587
6602
  array: D,
6588
6603
  stride: I
6589
6604
  };
@@ -6616,7 +6631,7 @@ class Ll extends L {
6616
6631
  */
6617
6632
  constructor(e, t = {}) {
6618
6633
  super(e), this.isWater = !0;
6619
- const n = this, s = t.textureWidth !== void 0 ? t.textureWidth : 512, i = t.textureHeight !== void 0 ? t.textureHeight : 512, o = t.clipBias !== void 0 ? t.clipBias : 0, a = t.alpha !== void 0 ? t.alpha : 1, l = t.time !== void 0 ? t.time : 0, c = t.waterNormals !== void 0 ? t.waterNormals : null, d = t.sunDirection !== void 0 ? t.sunDirection : new P(0.70707, 0.70707, 0), u = new le(t.sunColor !== void 0 ? t.sunColor : 16777215), g = new le(t.waterColor !== void 0 ? t.waterColor : 8355711), p = t.eye !== void 0 ? t.eye : new P(0, 0, 0), b = t.distortionScale !== void 0 ? t.distortionScale : 20, m = t.side !== void 0 ? t.side : ei, A = t.fog !== void 0 ? t.fog : !1, I = new Un(), w = new P(), f = new P(), h = new P(), v = new Ce(), D = new P(0, 0, -1), R = new nn(), T = new P(), Y = new P(), $ = new nn(), se = new Ce(), ne = new $n(), J = new Wn(s, i, { type: Gn }), Z = {
6634
+ const n = this, s = t.textureWidth !== void 0 ? t.textureWidth : 512, i = t.textureHeight !== void 0 ? t.textureHeight : 512, o = t.clipBias !== void 0 ? t.clipBias : 0, a = t.alpha !== void 0 ? t.alpha : 1, l = t.time !== void 0 ? t.time : 0, c = t.waterNormals !== void 0 ? t.waterNormals : null, d = t.sunDirection !== void 0 ? t.sunDirection : new P(0.70707, 0.70707, 0), u = new le(t.sunColor !== void 0 ? t.sunColor : 16777215), g = new le(t.waterColor !== void 0 ? t.waterColor : 8355711), A = t.eye !== void 0 ? t.eye : new P(0, 0, 0), b = t.distortionScale !== void 0 ? t.distortionScale : 20, m = t.side !== void 0 ? t.side : ei, p = t.fog !== void 0 ? t.fog : !1, I = new Un(), w = new P(), h = new P(), f = new P(), v = new Ce(), D = new P(0, 0, -1), R = new nn(), T = new P(), Y = new P(), $ = new nn(), se = new Ce(), ne = new $n(), J = new Wn(s, i, { type: Gn }), Z = {
6620
6635
  name: "MirrorShader",
6621
6636
  uniforms: is.merge([
6622
6637
  on.fog,
@@ -6746,11 +6761,11 @@ class Ll extends L {
6746
6761
  fragmentShader: Z.fragmentShader,
6747
6762
  lights: !0,
6748
6763
  side: m,
6749
- fog: A
6764
+ fog: p
6750
6765
  });
6751
- N.uniforms.mirrorSampler.value = J.texture, N.uniforms.textureMatrix.value = se, N.uniforms.alpha.value = a, N.uniforms.time.value = l, N.uniforms.normalSampler.value = c, N.uniforms.sunColor.value = u, N.uniforms.waterColor.value = g, N.uniforms.sunDirection.value = d, N.uniforms.distortionScale.value = b, N.uniforms.eye.value = p, n.material = N, n.onBeforeRender = function(U, z, _) {
6752
- if (f.setFromMatrixPosition(n.matrixWorld), h.setFromMatrixPosition(_.matrixWorld), v.extractRotation(n.matrixWorld), w.set(0, 0, 1), w.applyMatrix4(v), T.subVectors(f, h), T.dot(w) > 0) return;
6753
- T.reflect(w).negate(), T.add(f), v.extractRotation(_.matrixWorld), D.set(0, 0, -1), D.applyMatrix4(v), D.add(h), Y.subVectors(f, D), Y.reflect(w).negate(), Y.add(f), ne.position.copy(T), ne.up.set(0, 1, 0), ne.up.applyMatrix4(v), ne.up.reflect(w), ne.lookAt(Y), ne.far = _.far, ne.updateMatrixWorld(), ne.projectionMatrix.copy(_.projectionMatrix), se.set(
6766
+ N.uniforms.mirrorSampler.value = J.texture, N.uniforms.textureMatrix.value = se, N.uniforms.alpha.value = a, N.uniforms.time.value = l, N.uniforms.normalSampler.value = c, N.uniforms.sunColor.value = u, N.uniforms.waterColor.value = g, N.uniforms.sunDirection.value = d, N.uniforms.distortionScale.value = b, N.uniforms.eye.value = A, n.material = N, n.onBeforeRender = function(U, z, _) {
6767
+ if (h.setFromMatrixPosition(n.matrixWorld), f.setFromMatrixPosition(_.matrixWorld), v.extractRotation(n.matrixWorld), w.set(0, 0, 1), w.applyMatrix4(v), T.subVectors(h, f), T.dot(w) > 0) return;
6768
+ T.reflect(w).negate(), T.add(h), v.extractRotation(_.matrixWorld), D.set(0, 0, -1), D.applyMatrix4(v), D.add(f), Y.subVectors(h, D), Y.reflect(w).negate(), Y.add(h), ne.position.copy(T), ne.up.set(0, 1, 0), ne.up.applyMatrix4(v), ne.up.reflect(w), ne.lookAt(Y), ne.far = _.far, ne.updateMatrixWorld(), ne.projectionMatrix.copy(_.projectionMatrix), se.set(
6754
6769
  0.5,
6755
6770
  0,
6756
6771
  0,
@@ -6767,9 +6782,9 @@ class Ll extends L {
6767
6782
  0,
6768
6783
  0,
6769
6784
  1
6770
- ), se.multiply(ne.projectionMatrix), se.multiply(ne.matrixWorldInverse), I.setFromNormalAndCoplanarPoint(w, f), I.applyMatrix4(ne.matrixWorldInverse), R.set(I.normal.x, I.normal.y, I.normal.z, I.constant);
6785
+ ), se.multiply(ne.projectionMatrix), se.multiply(ne.matrixWorldInverse), I.setFromNormalAndCoplanarPoint(w, h), I.applyMatrix4(ne.matrixWorldInverse), R.set(I.normal.x, I.normal.y, I.normal.z, I.constant);
6771
6786
  const B = ne.projectionMatrix;
6772
- $.x = (Math.sign(R.x) + B.elements[8]) / B.elements[0], $.y = (Math.sign(R.y) + B.elements[9]) / B.elements[5], $.z = -1, $.w = (1 + B.elements[10]) / B.elements[14], R.multiplyScalar(2 / R.dot($)), B.elements[2] = R.x, B.elements[6] = R.y, B.elements[10] = R.z + 1 - o, B.elements[14] = R.w, p.setFromMatrixPosition(_.matrixWorld);
6787
+ $.x = (Math.sign(R.x) + B.elements[8]) / B.elements[0], $.y = (Math.sign(R.y) + B.elements[9]) / B.elements[5], $.z = -1, $.w = (1 + B.elements[10]) / B.elements[14], R.multiplyScalar(2 / R.dot($)), B.elements[2] = R.x, B.elements[6] = R.y, B.elements[10] = R.z + 1 - o, B.elements[14] = R.w, A.setFromMatrixPosition(_.matrixWorld);
6773
6788
  const be = U.getRenderTarget(), Oe = U.xr.enabled, Re = U.shadowMap.autoUpdate;
6774
6789
  n.visible = !1, U.xr.enabled = !1, U.shadowMap.autoUpdate = !1, U.setRenderTarget(J), U.state.buffers.depth.setMask(!0), U.autoClear === !1 && U.clear(), U.render(z, ne), n.visible = !0, U.xr.enabled = Oe, U.shadowMap.autoUpdate = Re, U.setRenderTarget(be);
6775
6790
  const Xe = _.viewport;
@@ -6843,13 +6858,13 @@ function Hi(r) {
6843
6858
  repeatY: l = 4,
6844
6859
  speedX: c = 5e-4,
6845
6860
  speedY: d = 5e-4
6846
- } = r || {}, u = new O.PlaneGeometry(e, t), p = new O.TextureLoader().load(Di, (A) => {
6847
- A.wrapS = A.wrapT = O.RepeatWrapping, A.repeat.set(a, l), A.generateMipmaps = !1, A.minFilter = O.LinearFilter, A.magFilter = O.LinearFilter;
6861
+ } = r || {}, u = new O.PlaneGeometry(e, t), A = new O.TextureLoader().load(Di, (p) => {
6862
+ p.wrapS = p.wrapT = O.RepeatWrapping, p.repeat.set(a, l), p.generateMipmaps = !1, p.minFilter = O.LinearFilter, p.magFilter = O.LinearFilter;
6848
6863
  }), b = new O.MeshStandardMaterial({
6849
6864
  color: n,
6850
6865
  roughness: s,
6851
6866
  metalness: i,
6852
- normalMap: p,
6867
+ normalMap: A,
6853
6868
  normalScale: new O.Vector2(o, o),
6854
6869
  side: O.DoubleSide,
6855
6870
  // 双面渲染,避免从侧面或底部看到黑色
@@ -6986,8 +7001,8 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
6986
7001
  m.stopPropagation(), n("select", t.node);
6987
7002
  }, g = (m) => {
6988
7003
  m.stopPropagation(), n("delete", t.node);
6989
- }, p = (m) => m.type === "Mesh" || m.type === "Sprite" ? "🟦" : m.type === "Light" ? "💡" : "📦", b = (m) => m.name || `${m.type} (${m.id})`;
6990
- return (m, A) => {
7004
+ }, A = (m) => m.type === "Mesh" || m.type === "Sprite" ? "🟦" : m.type === "Light" ? "💡" : "📦", b = (m) => m.name || `${m.type} (${m.id})`;
7005
+ return (m, p) => {
6991
7006
  const I = qi("TreeItem", !0);
6992
7007
  return H(), k("div", {
6993
7008
  class: "tree-node",
@@ -7001,9 +7016,9 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
7001
7016
  l.value ? (H(), k("span", {
7002
7017
  key: 0,
7003
7018
  class: "toggle-icon",
7004
- onClick: A[0] || (A[0] = ss((w) => ns(o)(m.node.uuid), ["stop"]))
7019
+ onClick: p[0] || (p[0] = ss((w) => ns(o)(m.node.uuid), ["stop"]))
7005
7020
  }, fe(a.value ? "▼" : "▶"), 1)) : (H(), k("span", Hl)),
7006
- y("span", kl, fe(p(m.node)), 1),
7021
+ y("span", kl, fe(A(m.node)), 1),
7007
7022
  y("span", jl, fe(b(m.node)), 1),
7008
7023
  y("button", {
7009
7024
  class: "tree-delete",
@@ -7016,8 +7031,8 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
7016
7031
  node: w,
7017
7032
  "selected-object": m.selectedObject,
7018
7033
  version: m.version,
7019
- onSelect: A[1] || (A[1] = (f) => n("select", f)),
7020
- onDelete: A[2] || (A[2] = (f) => n("delete", f))
7034
+ onSelect: p[1] || (p[1] = (h) => n("select", h)),
7035
+ onDelete: p[2] || (p[2] = (h) => n("delete", h))
7021
7036
  }, null, 8, ["node", "selected-object", "version"]))), 128))
7022
7037
  ])) : re("", !0)
7023
7038
  ], 512);
@@ -7085,16 +7100,16 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
7085
7100
  }), o = G("#ffffff"), a = G(!1), l = G(!1), c = G("");
7086
7101
  let d = null;
7087
7102
  const u = G(!1), g = G("");
7088
- let p = null;
7089
- const b = G(!1), m = G("");
7090
7103
  let A = null;
7104
+ const b = G(!1), m = G("");
7105
+ let p = null;
7091
7106
  const I = ts({
7092
7107
  intensity: 1
7093
7108
  });
7094
7109
  function w() {
7095
7110
  t.selectedObject && t.selectedObject.type === "DirectionalLight" && (t.selectedObject.intensity = I.intensity);
7096
7111
  }
7097
- function f(E) {
7112
+ function h(E) {
7098
7113
  let x = null;
7099
7114
  return E.traverse((M) => {
7100
7115
  if (M.type === "Mesh" && !x) {
@@ -7107,7 +7122,7 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
7107
7122
  }
7108
7123
  }), x;
7109
7124
  }
7110
- function h(E) {
7125
+ function f(E) {
7111
7126
  let x = null;
7112
7127
  return E.traverse((M) => {
7113
7128
  if (M.type === "Mesh" && !x) {
@@ -7162,7 +7177,7 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
7162
7177
  }
7163
7178
  function Y(E) {
7164
7179
  var M, S;
7165
- const x = f(E);
7180
+ const x = h(E);
7166
7181
  x && x.normalMap ? (l.value = !0, d = x.normalMap, c.value = ((M = x.userData) == null ? void 0 : M._normalMapFileName) || "法线贴图", i.normalScale = ((S = x.normalScale) == null ? void 0 : S.x) ?? 1) : (l.value = !1, d = null, c.value = "", i.normalScale = 1);
7167
7182
  }
7168
7183
  function $(E) {
@@ -7208,8 +7223,8 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
7208
7223
  }
7209
7224
  function Z(E) {
7210
7225
  var M;
7211
- const x = f(E);
7212
- x && x.map ? (u.value = !0, p = x.map, g.value = ((M = x.userData) == null ? void 0 : M._mapFileName) || "模型贴图") : (u.value = !1, p = null, g.value = "");
7226
+ const x = h(E);
7227
+ x && x.map ? (u.value = !0, A = x.map, g.value = ((M = x.userData) == null ? void 0 : M._mapFileName) || "模型贴图") : (u.value = !1, A = null, g.value = "");
7213
7228
  }
7214
7229
  function N(E) {
7215
7230
  var F;
@@ -7230,7 +7245,7 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
7230
7245
  for (const X of me)
7231
7246
  X && (X.type === "MeshStandardMaterial" || X.type === "MeshPhongMaterial" || X.type === "MeshBasicMaterial" || X.type === "MeshLambertMaterial" || X.type === "MeshToonMaterial" || X.type === "MeshPhysicalMaterial") && (X.map = F, X.userData = X.userData || {}, X.userData._mapDataUrl = x, X.userData._mapFileName = M, X.needsUpdate = !0);
7232
7247
  }
7233
- }), p = F, u.value = !0, g.value = M;
7248
+ }), A = F, u.value = !0, g.value = M;
7234
7249
  }
7235
7250
  function z() {
7236
7251
  t.selectedObject && (t.selectedObject.traverse((E) => {
@@ -7239,12 +7254,12 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
7239
7254
  for (const S of M)
7240
7255
  S.map && (S.map = null, S.userData && (delete S.userData._mapDataUrl, delete S.userData._mapFileName), S.needsUpdate = !0);
7241
7256
  }
7242
- }), p && (p.dispose(), p = null), u.value = !1, g.value = "");
7257
+ }), A && (A.dispose(), A = null), u.value = !1, g.value = "");
7243
7258
  }
7244
7259
  function _(E) {
7245
7260
  var M;
7246
- const x = f(E);
7247
- x && x.aoMap ? (b.value = !0, A = x.aoMap, m.value = ((M = x.userData) == null ? void 0 : M._aoMapFileName) || "AO 贴图", i.aoIntensity = x.aoMapIntensity ?? 1) : (b.value = !1, A = null, m.value = "", i.aoIntensity = 1);
7261
+ const x = h(E);
7262
+ x && x.aoMap ? (b.value = !0, p = x.aoMap, m.value = ((M = x.userData) == null ? void 0 : M._aoMapFileName) || "AO 贴图", i.aoIntensity = x.aoMapIntensity ?? 1) : (b.value = !1, p = null, m.value = "", i.aoIntensity = 1);
7248
7263
  }
7249
7264
  function B(E) {
7250
7265
  var F;
@@ -7265,7 +7280,7 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
7265
7280
  for (const X of me)
7266
7281
  X && (X.type === "MeshStandardMaterial" || X.type === "MeshPhongMaterial" || X.type === "MeshToonMaterial" || X.type === "MeshPhysicalMaterial") && (X.aoMap = F, X.aoMapIntensity = i.aoIntensity, X.userData = X.userData || {}, X.userData._aoMapDataUrl = x, X.userData._aoMapFileName = M, X.needsUpdate = !0);
7267
7282
  }
7268
- }), A = F, b.value = !0, m.value = M;
7283
+ }), p = F, b.value = !0, m.value = M;
7269
7284
  }
7270
7285
  function Oe() {
7271
7286
  t.selectedObject && (t.selectedObject.traverse((E) => {
@@ -7274,7 +7289,7 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
7274
7289
  for (const S of M)
7275
7290
  S.aoMap && (S.aoMap = null, S.userData && (delete S.userData._aoMapDataUrl, delete S.userData._aoMapFileName), S.needsUpdate = !0);
7276
7291
  }
7277
- }), A && (A.dispose(), A = null), b.value = !1, m.value = "");
7292
+ }), p && (p.dispose(), p = null), b.value = !1, m.value = "");
7278
7293
  }
7279
7294
  function Re() {
7280
7295
  if (!t.selectedObject) return;
@@ -7349,7 +7364,7 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
7349
7364
  () => t.selectedObject,
7350
7365
  (E) => {
7351
7366
  if (E) {
7352
- const x = h(E);
7367
+ const x = f(E);
7353
7368
  x ? (i.color = x.color, i.metalness = x.metalness, i.roughness = x.roughness, i.opacity = x.opacity, o.value = "#" + new le(x.color).getHexString(), a.value = !0) : (i.color = 16777215, i.metalness = 0, i.roughness = 0.5, i.opacity = 1, o.value = "#ffffff", a.value = !1), Y(E), Z(E), _(E), E.type === "DirectionalLight" && (I.intensity = E.intensity ?? 1), ps(E), As(E);
7354
7369
  } else
7355
7370
  i.color = 16777215, i.metalness = 0, i.roughness = 0.5, i.opacity = 1, o.value = "#ffffff", a.value = !1, l.value = !1, c.value = "", u.value = !1, g.value = "", b.value = !1, m.value = "";
@@ -7815,61 +7830,61 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
7815
7830
  },
7816
7831
  setup(r) {
7817
7832
  const e = r, t = G(""), n = G(""), s = G(null), i = G(""), o = G(null), a = G([]);
7818
- function l(f) {
7819
- if (f === null) return "null";
7820
- if (f === void 0) return "undefined";
7821
- if (Array.isArray(f)) return "array";
7822
- const h = typeof f;
7823
- return h === "object" ? "object" : h === "number" ? "number" : h === "boolean" ? "boolean" : "string";
7824
- }
7825
- function c(f) {
7826
- const h = [];
7827
- if (f.userData)
7828
- for (const [v, D] of Object.entries(f.userData))
7829
- typeof v == "string" && !v.startsWith("_") && h.push({
7833
+ function l(h) {
7834
+ if (h === null) return "null";
7835
+ if (h === void 0) return "undefined";
7836
+ if (Array.isArray(h)) return "array";
7837
+ const f = typeof h;
7838
+ return f === "object" ? "object" : f === "number" ? "number" : f === "boolean" ? "boolean" : "string";
7839
+ }
7840
+ function c(h) {
7841
+ const f = [];
7842
+ if (h.userData)
7843
+ for (const [v, D] of Object.entries(h.userData))
7844
+ typeof v == "string" && !v.startsWith("_") && f.push({
7830
7845
  key: v,
7831
7846
  value: typeof D == "object" ? JSON.stringify(D) : String(D),
7832
7847
  rawType: l(D)
7833
7848
  });
7834
- a.value = h;
7835
- }
7836
- function d(f) {
7837
- const h = f.trim();
7838
- if (h === "true") return !0;
7839
- if (h === "false") return !1;
7840
- if (h === "null") return null;
7841
- if (h === "undefined") return;
7842
- const v = Number(h);
7843
- if (h !== "" && !isNaN(v))
7844
- return String(v) !== h ? h : v;
7845
- if (h.startsWith("{") && h.endsWith("}") || h.startsWith("[") && h.endsWith("]"))
7849
+ a.value = f;
7850
+ }
7851
+ function d(h) {
7852
+ const f = h.trim();
7853
+ if (f === "true") return !0;
7854
+ if (f === "false") return !1;
7855
+ if (f === "null") return null;
7856
+ if (f === "undefined") return;
7857
+ const v = Number(f);
7858
+ if (f !== "" && !isNaN(v))
7859
+ return String(v) !== f ? f : v;
7860
+ if (f.startsWith("{") && f.endsWith("}") || f.startsWith("[") && f.endsWith("]"))
7846
7861
  try {
7847
- return JSON.parse(h);
7862
+ return JSON.parse(f);
7848
7863
  } catch {
7849
7864
  }
7850
- return h;
7865
+ return f;
7851
7866
  }
7852
7867
  function u() {
7853
7868
  if (!e.selectedObject || !t.value.trim()) return;
7854
- const f = t.value.trim();
7855
- if (f === "isMovable") {
7869
+ const h = t.value.trim();
7870
+ if (h === "isMovable") {
7856
7871
  t.value = "";
7857
7872
  return;
7858
7873
  }
7859
- const h = d(n.value);
7860
- e.selectedObject.userData[f] = h, c(e.selectedObject), t.value = "", n.value = "";
7874
+ const f = d(n.value);
7875
+ e.selectedObject.userData[h] = f, c(e.selectedObject), t.value = "", n.value = "";
7861
7876
  }
7862
- function g(f, h) {
7863
- e.selectedObject && (delete e.selectedObject.userData[f], c(e.selectedObject));
7877
+ function g(h, f) {
7878
+ e.selectedObject && (delete e.selectedObject.userData[h], c(e.selectedObject));
7864
7879
  }
7865
- function p(f) {
7866
- return f.length <= 28 ? f : f.substring(0, 28) + "…";
7880
+ function A(h) {
7881
+ return h.length <= 28 ? h : h.substring(0, 28) + "…";
7867
7882
  }
7868
- function b(f) {
7869
- s.value = f;
7870
- const h = e.selectedObject;
7871
- if (!h) return;
7872
- const v = h.userData[f];
7883
+ function b(h) {
7884
+ s.value = h;
7885
+ const f = e.selectedObject;
7886
+ if (!f) return;
7887
+ const v = f.userData[h];
7873
7888
  try {
7874
7889
  i.value = JSON.stringify(v, null, 2);
7875
7890
  } catch {
@@ -7878,58 +7893,58 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
7878
7893
  m();
7879
7894
  }
7880
7895
  function m() {
7881
- const f = i.value.trim();
7882
- if (!f) {
7896
+ const h = i.value.trim();
7897
+ if (!h) {
7883
7898
  o.value = null;
7884
7899
  return;
7885
7900
  }
7886
- if (!f.startsWith("{") && !f.startsWith("[")) {
7901
+ if (!h.startsWith("{") && !h.startsWith("[")) {
7887
7902
  o.value = "提示:当前输入不是 JSON 格式,将作为普通字符串保存";
7888
7903
  return;
7889
7904
  }
7890
7905
  try {
7891
- JSON.parse(f), o.value = null;
7892
- } catch (h) {
7893
- o.value = "JSON 格式错误:" + h.message;
7906
+ JSON.parse(h), o.value = null;
7907
+ } catch (f) {
7908
+ o.value = "JSON 格式错误:" + f.message;
7894
7909
  }
7895
7910
  }
7896
- function A(f) {
7897
- const h = e.selectedObject;
7898
- if (!h) return;
7911
+ function p(h) {
7912
+ const f = e.selectedObject;
7913
+ if (!f) return;
7899
7914
  const v = i.value.trim();
7900
7915
  try {
7901
7916
  const D = JSON.parse(v);
7902
- h.userData[f] = D, c(h), s.value = null, i.value = "";
7917
+ f.userData[h] = D, c(f), s.value = null, i.value = "";
7903
7918
  } catch {
7904
- h.userData[f] = v, c(h), s.value = null, i.value = "";
7919
+ f.userData[h] = v, c(f), s.value = null, i.value = "";
7905
7920
  }
7906
7921
  }
7907
7922
  function I() {
7908
7923
  s.value = null, i.value = "";
7909
7924
  }
7910
7925
  function w() {
7911
- const f = e.selectedObject;
7912
- if (!f) return;
7913
- const h = Fs();
7914
- h && (f.userData.closeUpView = {
7915
- x: h.position.x,
7916
- y: h.position.y,
7917
- z: h.position.z
7918
- }, c(f));
7926
+ const h = e.selectedObject;
7927
+ if (!h) return;
7928
+ const f = Fs();
7929
+ f && (h.userData.closeUpView = {
7930
+ x: f.position.x,
7931
+ y: f.position.y,
7932
+ z: f.position.z
7933
+ }, c(h));
7919
7934
  }
7920
7935
  return Me(
7921
7936
  () => e.selectedObject,
7922
- (f) => {
7923
- f ? c(f) : a.value = [], s.value = null, i.value = "";
7937
+ (h) => {
7938
+ h ? c(h) : a.value = [], s.value = null, i.value = "";
7924
7939
  },
7925
7940
  { immediate: !0 }
7926
- ), (f, h) => (H(), k("div", Sc, [
7941
+ ), (h, f) => (H(), k("div", Sc, [
7927
7942
  y("div", Lc, [
7928
- h[3] || (h[3] = y("label", null, "userData 属性", -1)),
7943
+ f[3] || (f[3] = y("label", null, "userData 属性", -1)),
7929
7944
  y("div", Nc, [
7930
7945
  j(y("input", {
7931
7946
  type: "text",
7932
- "onUpdate:modelValue": h[0] || (h[0] = (v) => t.value = v),
7947
+ "onUpdate:modelValue": f[0] || (f[0] = (v) => t.value = v),
7933
7948
  placeholder: "属性名",
7934
7949
  class: "ud-input",
7935
7950
  onKeyup: ut(u, ["enter"])
@@ -7937,7 +7952,7 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
7937
7952
  [W, t.value]
7938
7953
  ]),
7939
7954
  j(y("textarea", {
7940
- "onUpdate:modelValue": h[1] || (h[1] = (v) => n.value = v),
7955
+ "onUpdate:modelValue": f[1] || (f[1] = (v) => n.value = v),
7941
7956
  placeholder: "值",
7942
7957
  class: "ud-input ud-textarea",
7943
7958
  onKeyup: ut(ss(u, ["prevent"]), ["enter"])
@@ -7961,7 +7976,7 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
7961
7976
  y("span", jc, fe(v.key), 1),
7962
7977
  v.key === "isMovable" ? (H(), k("span", Fc, fe(String(v.value)) + " 🔒 ", 1)) : v.key !== "isMovable" ? (H(), k(Ee, { key: 1 }, [
7963
7978
  s.value !== v.key ? (H(), k(Ee, { key: 0 }, [
7964
- y("span", Uc, fe(p(v.value)), 1),
7979
+ y("span", Uc, fe(A(v.value)), 1),
7965
7980
  y("button", {
7966
7981
  class: "ud-btn edit-json-btn",
7967
7982
  title: "编辑对象",
@@ -7970,7 +7985,7 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
7970
7985
  ], 64)) : (H(), k(Ee, { key: 1 }, [
7971
7986
  o.value ? (H(), k("div", Wc, " ⚠ " + fe(o.value), 1)) : re("", !0),
7972
7987
  j(y("textarea", {
7973
- "onUpdate:modelValue": h[2] || (h[2] = (R) => i.value = R),
7988
+ "onUpdate:modelValue": f[2] || (f[2] = (R) => i.value = R),
7974
7989
  class: Pe(["ud-json-textarea", { "has-error": o.value }]),
7975
7990
  rows: "3",
7976
7991
  onInput: m
@@ -7981,7 +7996,7 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
7981
7996
  y("button", {
7982
7997
  class: "ud-btn apply-btn",
7983
7998
  title: "应用修改",
7984
- onClick: (R) => A(v.key)
7999
+ onClick: (R) => p(v.key)
7985
8000
  }, " ✓ ", 8, Bc),
7986
8001
  y("button", {
7987
8002
  class: "ud-btn cancel-btn",
@@ -8013,28 +8028,28 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
8013
8028
  },
8014
8029
  setup(r) {
8015
8030
  const e = r, t = G(""), n = G([]), s = G(!0), i = G(0.1), o = G(0), a = G(0), l = G(20), c = G(""), d = G(""), u = G(""), g = G("");
8016
- let p = m(), b = !1;
8031
+ let A = m(), b = !1;
8017
8032
  function m() {
8018
- const f = e.selectedObject;
8019
- return f ? jt(us(f)) : null;
8020
- }
8021
- Me(s, (f) => {
8022
- b || !p || (p.visible = f);
8023
- }), Me(l, (f) => {
8024
- b || !p || p.setWidth(`${f}em`);
8025
- }), Me(o, (f) => {
8026
- b || !p || p.setOffsetX(f);
8027
- }), Me(i, (f) => {
8028
- b || !p || p.setOffsetY(f);
8029
- }), Me(a, (f) => {
8030
- b || !p || p.setOffsetZ(f);
8033
+ const h = e.selectedObject;
8034
+ return h ? jt(us(h)) : null;
8035
+ }
8036
+ Me(s, (h) => {
8037
+ b || !A || (A.visible = h);
8038
+ }), Me(l, (h) => {
8039
+ b || !A || A.setWidth(`${h}em`);
8040
+ }), Me(o, (h) => {
8041
+ b || !A || A.setOffsetX(h);
8042
+ }), Me(i, (h) => {
8043
+ b || !A || A.setOffsetY(h);
8044
+ }), Me(a, (h) => {
8045
+ b || !A || A.setOffsetZ(h);
8031
8046
  });
8032
- function A() {
8033
- b || !p || (p.setTitle(t.value), p.setItems([...n.value]));
8047
+ function p() {
8048
+ b || !A || (A.setTitle(t.value), A.setItems([...n.value]));
8034
8049
  }
8035
- Me(t, () => A()), Me(n, () => A(), { deep: !0 });
8036
- function I(f) {
8037
- n.value = n.value.filter((h, v) => v !== f), A();
8050
+ Me(t, () => p()), Me(n, () => p(), { deep: !0 });
8051
+ function I(h) {
8052
+ n.value = n.value.filter((f, v) => v !== h), p();
8038
8053
  }
8039
8054
  function w() {
8040
8055
  !c.value.trim() || !d.value.trim() || (n.value = [
@@ -8045,56 +8060,56 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
8045
8060
  unit: u.value.trim() || void 0,
8046
8061
  code: g.value.trim() || void 0
8047
8062
  }
8048
- ], A(), c.value = "", d.value = "", u.value = "", g.value = "");
8063
+ ], p(), c.value = "", d.value = "", u.value = "", g.value = "");
8049
8064
  }
8050
8065
  return Me(
8051
8066
  () => e.selectedObject,
8052
8067
  () => {
8053
- b = !0, p = m(), p ? (t.value = p.getTitle(), n.value = p.getItems(), s.value = p.visible, i.value = p.getOffsetY(), o.value = p.getOffsetX(), a.value = p.getOffsetZ(), l.value = parseFloat(p.getWidth()) || 20) : (t.value = "", n.value = [], s.value = !0, i.value = 0.1, o.value = 0, a.value = 0, l.value = 20), c.value = "", d.value = "", u.value = "", g.value = "", setTimeout(() => {
8068
+ b = !0, A = m(), A ? (t.value = A.getTitle(), n.value = A.getItems(), s.value = A.visible, i.value = A.getOffsetY(), o.value = A.getOffsetX(), a.value = A.getOffsetZ(), l.value = parseFloat(A.getWidth()) || 20) : (t.value = "", n.value = [], s.value = !0, i.value = 0.1, o.value = 0, a.value = 0, l.value = 20), c.value = "", d.value = "", u.value = "", g.value = "", setTimeout(() => {
8054
8069
  b = !1;
8055
8070
  }, 0);
8056
8071
  },
8057
8072
  { immediate: !0 }
8058
- ), (f, h) => (H(), k("div", Kc, [
8073
+ ), (h, f) => (H(), k("div", Kc, [
8059
8074
  y("div", Zc, [
8060
- h[29] || (h[29] = y("label", null, "📊 数据面板", -1)),
8075
+ f[29] || (f[29] = y("label", null, "📊 数据面板", -1)),
8061
8076
  y("div", Qc, [
8062
- h[14] || (h[14] = y("span", { class: "dp-label-sm" }, "可见性", -1)),
8077
+ f[14] || (f[14] = y("span", { class: "dp-label-sm" }, "可见性", -1)),
8063
8078
  y("div", Jc, [
8064
8079
  y("label", _c, [
8065
8080
  j(y("input", {
8066
8081
  type: "checkbox",
8067
- "onUpdate:modelValue": h[0] || (h[0] = (v) => s.value = v)
8082
+ "onUpdate:modelValue": f[0] || (f[0] = (v) => s.value = v)
8068
8083
  }, null, 512), [
8069
8084
  [Yi, s.value]
8070
8085
  ]),
8071
- h[13] || (h[13] = y("span", { class: "dp-toggle-slider" }, null, -1))
8086
+ f[13] || (f[13] = y("span", { class: "dp-toggle-slider" }, null, -1))
8072
8087
  ]),
8073
8088
  y("span", $c, fe(s.value ? "显示中" : "已隐藏"), 1)
8074
8089
  ])
8075
8090
  ]),
8076
8091
  y("div", eu, [
8077
- h[15] || (h[15] = y("span", { class: "dp-label-sm" }, "标题", -1)),
8092
+ f[15] || (f[15] = y("span", { class: "dp-label-sm" }, "标题", -1)),
8078
8093
  j(y("input", {
8079
8094
  type: "text",
8080
8095
  class: "dp-input",
8081
- "onUpdate:modelValue": h[1] || (h[1] = (v) => t.value = v),
8096
+ "onUpdate:modelValue": f[1] || (f[1] = (v) => t.value = v),
8082
8097
  placeholder: "面板标题"
8083
8098
  }, null, 512), [
8084
8099
  [W, t.value]
8085
8100
  ])
8086
8101
  ]),
8087
8102
  y("div", tu, [
8088
- h[18] || (h[18] = y("span", { class: "dp-label-sm" }, "面板宽度", -1)),
8103
+ f[18] || (f[18] = y("span", { class: "dp-label-sm" }, "面板宽度", -1)),
8089
8104
  y("div", su, [
8090
- h[16] || (h[16] = y("span", { class: "dp-range-label" }, "窄", -1)),
8105
+ f[16] || (f[16] = y("span", { class: "dp-range-label" }, "窄", -1)),
8091
8106
  j(y("input", {
8092
8107
  type: "range",
8093
8108
  class: "dp-range",
8094
8109
  min: "10",
8095
8110
  max: "40",
8096
8111
  step: "1",
8097
- "onUpdate:modelValue": h[2] || (h[2] = (v) => l.value = v)
8112
+ "onUpdate:modelValue": f[2] || (f[2] = (v) => l.value = v)
8098
8113
  }, null, 512), [
8099
8114
  [
8100
8115
  W,
@@ -8103,21 +8118,21 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
8103
8118
  { number: !0 }
8104
8119
  ]
8105
8120
  ]),
8106
- h[17] || (h[17] = y("span", { class: "dp-range-label" }, "宽", -1)),
8121
+ f[17] || (f[17] = y("span", { class: "dp-range-label" }, "宽", -1)),
8107
8122
  y("span", nu, fe(l.value) + "em", 1)
8108
8123
  ])
8109
8124
  ]),
8110
8125
  y("div", iu, [
8111
- h[21] || (h[21] = y("span", { class: "dp-label-sm" }, "面板左右位置", -1)),
8126
+ f[21] || (f[21] = y("span", { class: "dp-label-sm" }, "面板左右位置", -1)),
8112
8127
  y("div", ou, [
8113
- h[19] || (h[19] = y("span", { class: "dp-range-label" }, "偏左", -1)),
8128
+ f[19] || (f[19] = y("span", { class: "dp-range-label" }, "偏左", -1)),
8114
8129
  j(y("input", {
8115
8130
  type: "range",
8116
8131
  class: "dp-range",
8117
8132
  min: "-5",
8118
8133
  max: "5",
8119
8134
  step: "0.01",
8120
- "onUpdate:modelValue": h[3] || (h[3] = (v) => o.value = v)
8135
+ "onUpdate:modelValue": f[3] || (f[3] = (v) => o.value = v)
8121
8136
  }, null, 512), [
8122
8137
  [
8123
8138
  W,
@@ -8126,11 +8141,11 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
8126
8141
  { number: !0 }
8127
8142
  ]
8128
8143
  ]),
8129
- h[20] || (h[20] = y("span", { class: "dp-range-label" }, "偏右", -1)),
8144
+ f[20] || (f[20] = y("span", { class: "dp-range-label" }, "偏右", -1)),
8130
8145
  j(y("input", {
8131
8146
  type: "number",
8132
8147
  class: "dp-input dp-input-number",
8133
- "onUpdate:modelValue": h[4] || (h[4] = (v) => o.value = v),
8148
+ "onUpdate:modelValue": f[4] || (f[4] = (v) => o.value = v),
8134
8149
  step: "0.01"
8135
8150
  }, null, 512), [
8136
8151
  [
@@ -8143,16 +8158,16 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
8143
8158
  ])
8144
8159
  ]),
8145
8160
  y("div", ru, [
8146
- h[24] || (h[24] = y("span", { class: "dp-label-sm" }, "面板上下位置", -1)),
8161
+ f[24] || (f[24] = y("span", { class: "dp-label-sm" }, "面板上下位置", -1)),
8147
8162
  y("div", au, [
8148
- h[22] || (h[22] = y("span", { class: "dp-range-label" }, "偏下", -1)),
8163
+ f[22] || (f[22] = y("span", { class: "dp-range-label" }, "偏下", -1)),
8149
8164
  j(y("input", {
8150
8165
  type: "range",
8151
8166
  class: "dp-range",
8152
8167
  min: "-5",
8153
8168
  max: "5",
8154
8169
  step: "0.01",
8155
- "onUpdate:modelValue": h[5] || (h[5] = (v) => i.value = v)
8170
+ "onUpdate:modelValue": f[5] || (f[5] = (v) => i.value = v)
8156
8171
  }, null, 512), [
8157
8172
  [
8158
8173
  W,
@@ -8161,11 +8176,11 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
8161
8176
  { number: !0 }
8162
8177
  ]
8163
8178
  ]),
8164
- h[23] || (h[23] = y("span", { class: "dp-range-label" }, "偏上", -1)),
8179
+ f[23] || (f[23] = y("span", { class: "dp-range-label" }, "偏上", -1)),
8165
8180
  j(y("input", {
8166
8181
  type: "number",
8167
8182
  class: "dp-input dp-input-number",
8168
- "onUpdate:modelValue": h[6] || (h[6] = (v) => i.value = v),
8183
+ "onUpdate:modelValue": f[6] || (f[6] = (v) => i.value = v),
8169
8184
  step: "0.01"
8170
8185
  }, null, 512), [
8171
8186
  [
@@ -8178,16 +8193,16 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
8178
8193
  ])
8179
8194
  ]),
8180
8195
  y("div", lu, [
8181
- h[27] || (h[27] = y("span", { class: "dp-label-sm" }, "面板前后位置", -1)),
8196
+ f[27] || (f[27] = y("span", { class: "dp-label-sm" }, "面板前后位置", -1)),
8182
8197
  y("div", cu, [
8183
- h[25] || (h[25] = y("span", { class: "dp-range-label" }, "近", -1)),
8198
+ f[25] || (f[25] = y("span", { class: "dp-range-label" }, "近", -1)),
8184
8199
  j(y("input", {
8185
8200
  type: "range",
8186
8201
  class: "dp-range",
8187
8202
  min: "-5",
8188
8203
  max: "5",
8189
8204
  step: "0.01",
8190
- "onUpdate:modelValue": h[7] || (h[7] = (v) => a.value = v)
8205
+ "onUpdate:modelValue": f[7] || (f[7] = (v) => a.value = v)
8191
8206
  }, null, 512), [
8192
8207
  [
8193
8208
  W,
@@ -8196,11 +8211,11 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
8196
8211
  { number: !0 }
8197
8212
  ]
8198
8213
  ]),
8199
- h[26] || (h[26] = y("span", { class: "dp-range-label" }, "远", -1)),
8214
+ f[26] || (f[26] = y("span", { class: "dp-range-label" }, "远", -1)),
8200
8215
  j(y("input", {
8201
8216
  type: "number",
8202
8217
  class: "dp-input dp-input-number",
8203
- "onUpdate:modelValue": h[8] || (h[8] = (v) => a.value = v),
8218
+ "onUpdate:modelValue": f[8] || (f[8] = (v) => a.value = v),
8204
8219
  step: "0.01"
8205
8220
  }, null, 512), [
8206
8221
  [
@@ -8213,7 +8228,7 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
8213
8228
  ])
8214
8229
  ]),
8215
8230
  y("div", uu, [
8216
- h[28] || (h[28] = y("span", { class: "dp-label-sm" }, "数据项", -1)),
8231
+ f[28] || (f[28] = y("span", { class: "dp-label-sm" }, "数据项", -1)),
8217
8232
  y("div", du, [
8218
8233
  (H(!0), k(Ee, null, At(n.value, (v, D) => (H(), k("div", {
8219
8234
  key: D,
@@ -8262,7 +8277,7 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
8262
8277
  j(y("input", {
8263
8278
  type: "text",
8264
8279
  class: "dp-input dp-input-sm",
8265
- "onUpdate:modelValue": h[9] || (h[9] = (v) => c.value = v),
8280
+ "onUpdate:modelValue": f[9] || (f[9] = (v) => c.value = v),
8266
8281
  placeholder: "标签",
8267
8282
  onKeyup: ut(w, ["enter"])
8268
8283
  }, null, 544), [
@@ -8271,7 +8286,7 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
8271
8286
  j(y("input", {
8272
8287
  type: "text",
8273
8288
  class: "dp-input dp-input-sm",
8274
- "onUpdate:modelValue": h[10] || (h[10] = (v) => d.value = v),
8289
+ "onUpdate:modelValue": f[10] || (f[10] = (v) => d.value = v),
8275
8290
  placeholder: "值",
8276
8291
  onKeyup: ut(w, ["enter"])
8277
8292
  }, null, 544), [
@@ -8280,7 +8295,7 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
8280
8295
  j(y("input", {
8281
8296
  type: "text",
8282
8297
  class: "dp-input dp-input-xs",
8283
- "onUpdate:modelValue": h[11] || (h[11] = (v) => u.value = v),
8298
+ "onUpdate:modelValue": f[11] || (f[11] = (v) => u.value = v),
8284
8299
  placeholder: "单位",
8285
8300
  onKeyup: ut(w, ["enter"])
8286
8301
  }, null, 544), [
@@ -8289,7 +8304,7 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
8289
8304
  j(y("input", {
8290
8305
  type: "text",
8291
8306
  class: "dp-input dp-input-xs",
8292
- "onUpdate:modelValue": h[12] || (h[12] = (v) => g.value = v),
8307
+ "onUpdate:modelValue": f[12] || (f[12] = (v) => g.value = v),
8293
8308
  placeholder: "编码",
8294
8309
  onKeyup: ut(w, ["enter"])
8295
8310
  }, null, 544), [
@@ -8365,7 +8380,7 @@ const Iu = {
8365
8380
  return !!(t.selectedObject && ((w = t.selectedObject.userData) != null && w._hasDataPanel));
8366
8381
  }), c = G(0), d = Ki(t, "selectedObject"), { expandedSet: u, toggleExpand: g } = xu(d);
8367
8382
  Zi("treeExpand", { expandedSet: u, toggleExpand: g });
8368
- const p = (w) => {
8383
+ const A = (w) => {
8369
8384
  c.value++, n("treeDelete", w);
8370
8385
  }, b = () => {
8371
8386
  Na({
@@ -8376,83 +8391,83 @@ if (selectedObject) {
8376
8391
  moveTo(selectedObject, { x: 0, y: 2, z: 0 }, 1000);
8377
8392
  }`
8378
8393
  });
8379
- }, m = (w) => Ha(w), A = G("");
8394
+ }, m = (w) => Ha(w), p = G("");
8380
8395
  Me(
8381
8396
  () => t.selectedObject,
8382
8397
  (w) => {
8383
- A.value = (w == null ? void 0 : w.name) ?? "";
8398
+ p.value = (w == null ? void 0 : w.name) ?? "";
8384
8399
  },
8385
8400
  { immediate: !0 }
8386
8401
  );
8387
8402
  const I = () => {
8388
8403
  if (!t.selectedObject) return;
8389
- const w = A.value.trim();
8390
- t.selectedObject.name = w || "未命名", A.value = t.selectedObject.name, c.value++;
8404
+ const w = p.value.trim();
8405
+ t.selectedObject.name = w || "未命名", p.value = t.selectedObject.name, c.value++;
8391
8406
  };
8392
- return (w, f) => w.transform ? (H(), k("div", Iu, [
8407
+ return (w, h) => w.transform ? (H(), k("div", Iu, [
8393
8408
  y("div", Cu, [
8394
- f[8] || (f[8] = y("label", null, "场景物体", -1)),
8409
+ h[8] || (h[8] = y("label", null, "场景物体", -1)),
8395
8410
  y("div", wu, [
8396
- (H(!0), k(Ee, null, At(w.treeData, (h) => (H(), vt(zl, {
8397
- key: h.uuid,
8398
- node: h,
8411
+ (H(!0), k(Ee, null, At(w.treeData, (f) => (H(), vt(zl, {
8412
+ key: f.uuid,
8413
+ node: f,
8399
8414
  "selected-object": w.selectedObject,
8400
8415
  version: c.value,
8401
- onSelect: f[0] || (f[0] = (v) => n("treeSelect", v)),
8402
- onDelete: p
8416
+ onSelect: h[0] || (h[0] = (v) => n("treeSelect", v)),
8417
+ onDelete: A
8403
8418
  }, null, 8, ["node", "selected-object", "version"]))), 128)),
8404
8419
  w.treeData.length === 0 ? (H(), k("div", vu, "暂无物体")) : re("", !0)
8405
8420
  ])
8406
8421
  ]),
8407
8422
  y("div", Mu, [
8408
- f[10] || (f[10] = y("label", null, "全局属性", -1)),
8423
+ h[10] || (h[10] = y("label", null, "全局属性", -1)),
8409
8424
  y("div", Tu, [
8410
8425
  y("button", {
8411
8426
  class: Pe(["mode-btn", { active: s.value === "translate" }]),
8412
8427
  title: "移动 (W)",
8413
- onClick: f[1] || (f[1] = (h) => i("translate"))
8428
+ onClick: h[1] || (h[1] = (f) => i("translate"))
8414
8429
  }, " ↕ 移动 ", 2),
8415
8430
  y("button", {
8416
8431
  class: Pe(["mode-btn", { active: s.value === "rotate" }]),
8417
8432
  title: "旋转 (E)",
8418
- onClick: f[2] || (f[2] = (h) => i("rotate"))
8433
+ onClick: h[2] || (h[2] = (f) => i("rotate"))
8419
8434
  }, " ↻ 旋转 ", 2),
8420
8435
  y("button", {
8421
8436
  class: Pe(["mode-btn", { active: s.value === "scale" }]),
8422
8437
  title: "缩放 (R)",
8423
- onClick: f[3] || (f[3] = (h) => i("scale"))
8438
+ onClick: h[3] || (h[3] = (f) => i("scale"))
8424
8439
  }, " ⤡ 缩放 ", 2)
8425
8440
  ]),
8426
8441
  y("div", Eu, [
8427
8442
  y("div", { class: "script-editor-header" }, [
8428
- f[9] || (f[9] = y("span", { class: "script-title" }, "脚本(按钮显示在画布底部)", -1)),
8443
+ h[9] || (h[9] = y("span", { class: "script-title" }, "脚本(按钮显示在画布底部)", -1)),
8429
8444
  y("button", {
8430
8445
  class: "add-script-btn",
8431
8446
  onClick: b,
8432
8447
  title: "新增一个脚本"
8433
8448
  }, " + 添加脚本 ")
8434
8449
  ]),
8435
- (H(!0), k(Ee, null, At(ns(Se).scripts, (h) => (H(), k("div", {
8436
- key: h.id,
8450
+ (H(!0), k(Ee, null, At(ns(Se).scripts, (f) => (H(), k("div", {
8451
+ key: f.id,
8437
8452
  class: "script-item"
8438
8453
  }, [
8439
8454
  y("div", Du, [
8440
8455
  j(y("input", {
8441
- "onUpdate:modelValue": (v) => h.name = v,
8456
+ "onUpdate:modelValue": (v) => f.name = v,
8442
8457
  class: "script-name-input",
8443
8458
  placeholder: "函数名称(按钮显示文字)",
8444
8459
  spellcheck: "false"
8445
8460
  }, null, 8, Ou), [
8446
- [W, h.name]
8461
+ [W, f.name]
8447
8462
  ]),
8448
8463
  y("button", {
8449
8464
  class: "script-del-btn",
8450
8465
  title: "删除该脚本",
8451
- onClick: (v) => m(h.id)
8466
+ onClick: (v) => m(f.id)
8452
8467
  }, "✕", 8, Ru)
8453
8468
  ]),
8454
8469
  j(y("textarea", {
8455
- "onUpdate:modelValue": (v) => h.code = v,
8470
+ "onUpdate:modelValue": (v) => f.code = v,
8456
8471
  class: "script-code-input",
8457
8472
  rows: "6",
8458
8473
  spellcheck: "false",
@@ -8480,37 +8495,37 @@ function myFunc() {
8480
8495
  动画 API:animateTo / moveTo / rotateTo / scaleTo / fadeTo / stopAnimations / degToRad
8481
8496
  其他:addModel/removeModel/selectObject 等编辑器 API`
8482
8497
  }, null, 8, Pu), [
8483
- [W, h.code]
8498
+ [W, f.code]
8484
8499
  ])
8485
8500
  ]))), 128)),
8486
8501
  ns(Se).scripts.length === 0 ? (H(), k("div", Su, " 暂无脚本,点击“+ 添加脚本”创建(画布底部会为每个脚本生成一个触发按钮) ")) : re("", !0)
8487
8502
  ])
8488
8503
  ]),
8489
8504
  w.selectedObject ? (H(), k("div", Lu, [
8490
- f[11] || (f[11] = y("label", null, "物体名称", -1)),
8505
+ h[11] || (h[11] = y("label", null, "物体名称", -1)),
8491
8506
  j(y("input", {
8492
- "onUpdate:modelValue": f[4] || (f[4] = (h) => A.value = h),
8507
+ "onUpdate:modelValue": h[4] || (h[4] = (f) => p.value = f),
8493
8508
  class: "object-name-input",
8494
8509
  placeholder: "输入名称,脚本中可用 scene.getObjectByName() 查找",
8495
8510
  spellcheck: "false",
8496
8511
  onChange: I
8497
8512
  }, null, 544), [
8498
- [W, A.value]
8513
+ [W, p.value]
8499
8514
  ])
8500
8515
  ])) : re("", !0),
8501
8516
  w.selectedObject ? (H(), k("div", Nu, [
8502
8517
  y("button", {
8503
8518
  class: Pe(["tab-btn", { active: a.value === "transform" }]),
8504
- onClick: f[5] || (f[5] = (h) => a.value = "transform")
8519
+ onClick: h[5] || (h[5] = (f) => a.value = "transform")
8505
8520
  }, " 🔄 变换 ", 2),
8506
8521
  y("button", {
8507
8522
  class: Pe(["tab-btn", { active: a.value === "userdata" }]),
8508
- onClick: f[6] || (f[6] = (h) => a.value = "userdata")
8523
+ onClick: h[6] || (h[6] = (f) => a.value = "userdata")
8509
8524
  }, " 📋 自定义数据 ", 2),
8510
8525
  l.value ? (H(), k("button", {
8511
8526
  key: 0,
8512
8527
  class: Pe(["tab-btn", { active: a.value === "datapanel" }]),
8513
- onClick: f[7] || (f[7] = (h) => a.value = "datapanel")
8528
+ onClick: h[7] || (h[7] = (f) => a.value = "datapanel")
8514
8529
  }, " 📊 数据面板 ", 2)) : re("", !0)
8515
8530
  ])) : re("", !0),
8516
8531
  w.selectedObject ? (H(), k("div", Hu, [
@@ -8528,7 +8543,7 @@ function myFunc() {
8528
8543
  [st, a.value === "datapanel"]
8529
8544
  ])
8530
8545
  ])) : re("", !0)
8531
- ])) : (H(), k("div", ku, f[12] || (f[12] = [
8546
+ ])) : (H(), k("div", ku, h[12] || (h[12] = [
8532
8547
  y("p", null, "未选中任何模型", -1)
8533
8548
  ])));
8534
8549
  }
@@ -8540,23 +8555,23 @@ function myFunc() {
8540
8555
  var m;
8541
8556
  return (m = a.value) == null ? void 0 : m.click();
8542
8557
  }, c = (m) => {
8543
- const A = m.target;
8544
- A.files && A.files.length > 0 && (o("importModel", A.files[0]), A.value = "");
8558
+ const p = m.target;
8559
+ p.files && p.files.length > 0 && (o("importModel", p.files[0]), p.value = "");
8545
8560
  }, d = () => console.log("撤销"), u = () => console.log("删除物体"), g = async () => {
8546
8561
  const m = await Il();
8547
8562
  console.log("scene GLB 字节数:", m.scene.byteLength), console.log("camera:", m.camera), console.log("dataPanels:", m.dataPanels), console.log("waters:", m.waters), console.log("textures:", m.textures), console.log("ambientLight:", m.ambientLight);
8548
- }, p = () => {
8563
+ }, A = () => {
8549
8564
  if (!localStorage.getItem("test_id")) return localStorage.setItem("test_id", "123");
8550
8565
  gi(localStorage.getItem("test_id"));
8551
8566
  }, b = () => fi();
8552
- return (m, A) => (H(), k("div", Uu, [
8567
+ return (m, p) => (H(), k("div", Uu, [
8553
8568
  y("div", zu, [
8554
8569
  y("div", {
8555
8570
  class: "dropdown-wrapper",
8556
- onMouseenter: A[11] || (A[11] = (I) => n.value = !0),
8557
- onMouseleave: A[12] || (A[12] = (I) => n.value = !1)
8571
+ onMouseenter: p[11] || (p[11] = (I) => n.value = !0),
8572
+ onMouseleave: p[12] || (p[12] = (I) => n.value = !1)
8558
8573
  }, [
8559
- A[17] || (A[17] = y("button", { class: "menu-btn" }, "添加", -1)),
8574
+ p[17] || (p[17] = y("button", { class: "menu-btn" }, "添加", -1)),
8560
8575
  j(y("div", Wu, [
8561
8576
  y("div", {
8562
8577
  class: "menu-item",
@@ -8564,30 +8579,30 @@ function myFunc() {
8564
8579
  }, "组"),
8565
8580
  y("div", {
8566
8581
  class: "menu-item dropdown-wrapper sub-trigger",
8567
- onMouseenter: A[5] || (A[5] = (I) => s.value = !0),
8568
- onMouseleave: A[6] || (A[6] = (I) => s.value = !1)
8582
+ onMouseenter: p[5] || (p[5] = (I) => s.value = !0),
8583
+ onMouseleave: p[6] || (p[6] = (I) => s.value = !1)
8569
8584
  }, [
8570
- A[15] || (A[15] = y("span", null, "网格", -1)),
8585
+ p[15] || (p[15] = y("span", null, "网格", -1)),
8571
8586
  j(y("div", Gu, [
8572
8587
  y("div", {
8573
8588
  class: "menu-item",
8574
- onClick: A[0] || (A[0] = (I) => o("addModel", "box"))
8589
+ onClick: p[0] || (p[0] = (I) => o("addModel", "box"))
8575
8590
  }, " 正方体 "),
8576
8591
  y("div", {
8577
8592
  class: "menu-item",
8578
- onClick: A[1] || (A[1] = (I) => o("addModel", "sphere"))
8593
+ onClick: p[1] || (p[1] = (I) => o("addModel", "sphere"))
8579
8594
  }, " 球体 "),
8580
8595
  y("div", {
8581
8596
  class: "menu-item",
8582
- onClick: A[2] || (A[2] = (I) => o("addModel", "water"))
8597
+ onClick: p[2] || (p[2] = (I) => o("addModel", "water"))
8583
8598
  }, " 水体(Water.js) "),
8584
8599
  y("div", {
8585
8600
  class: "menu-item",
8586
- onClick: A[3] || (A[3] = (I) => o("addModel", "waterCylinder"))
8601
+ onClick: p[3] || (p[3] = (I) => o("addModel", "waterCylinder"))
8587
8602
  }, " 水体(圆柱) "),
8588
8603
  y("div", {
8589
8604
  class: "menu-item",
8590
- onClick: A[4] || (A[4] = (I) => o("addModel", "waterPlane"))
8605
+ onClick: p[4] || (p[4] = (I) => o("addModel", "waterPlane"))
8591
8606
  }, " 水面(标准材质) "),
8592
8607
  y("div", {
8593
8608
  class: "menu-item",
@@ -8599,14 +8614,14 @@ function myFunc() {
8599
8614
  ], 32),
8600
8615
  y("div", {
8601
8616
  class: "menu-item dropdown-wrapper sub-trigger",
8602
- onMouseenter: A[8] || (A[8] = (I) => i.value = !0),
8603
- onMouseleave: A[9] || (A[9] = (I) => i.value = !1)
8617
+ onMouseenter: p[8] || (p[8] = (I) => i.value = !0),
8618
+ onMouseleave: p[9] || (p[9] = (I) => i.value = !1)
8604
8619
  }, [
8605
- A[16] || (A[16] = y("span", null, "光源", -1)),
8620
+ p[16] || (p[16] = y("span", null, "光源", -1)),
8606
8621
  j(y("div", Bu, [
8607
8622
  y("div", {
8608
8623
  class: "menu-item",
8609
- onClick: A[7] || (A[7] = (I) => o("addModel", "directionalLight"))
8624
+ onClick: p[7] || (p[7] = (I) => o("addModel", "directionalLight"))
8610
8625
  }, " 平行光 ")
8611
8626
  ], 512), [
8612
8627
  [st, i.value]
@@ -8618,7 +8633,7 @@ function myFunc() {
8618
8633
  }, "摄像机"),
8619
8634
  y("div", {
8620
8635
  class: "menu-item",
8621
- onClick: A[10] || (A[10] = (I) => o("addModel", "dataPanel"))
8636
+ onClick: p[10] || (p[10] = (I) => o("addModel", "dataPanel"))
8622
8637
  }, " 数据面板 ")
8623
8638
  ], 512), [
8624
8639
  [st, n.value]
@@ -8626,10 +8641,10 @@ function myFunc() {
8626
8641
  ], 32),
8627
8642
  y("div", {
8628
8643
  class: "dropdown-wrapper",
8629
- onMouseenter: A[13] || (A[13] = (I) => t.value = !0),
8630
- onMouseleave: A[14] || (A[14] = (I) => t.value = !1)
8644
+ onMouseenter: p[13] || (p[13] = (I) => t.value = !0),
8645
+ onMouseleave: p[14] || (p[14] = (I) => t.value = !1)
8631
8646
  }, [
8632
- A[19] || (A[19] = y("button", { class: "menu-btn" }, "帮助", -1)),
8647
+ p[19] || (p[19] = y("button", { class: "menu-btn" }, "帮助", -1)),
8633
8648
  j(y("div", Xu, [
8634
8649
  y("div", {
8635
8650
  class: "menu-item",
@@ -8637,19 +8652,19 @@ function myFunc() {
8637
8652
  }, "获取场景"),
8638
8653
  y("div", {
8639
8654
  class: "menu-item",
8640
- onClick: p
8655
+ onClick: A
8641
8656
  }, "镜头拉近"),
8642
8657
  y("div", {
8643
8658
  class: "menu-item",
8644
8659
  onClick: b
8645
8660
  }, " 重置相机位置 "),
8646
- A[18] || (A[18] = y("div", { class: "menu-divider" }, null, -1))
8661
+ p[18] || (p[18] = y("div", { class: "menu-divider" }, null, -1))
8647
8662
  ], 512), [
8648
8663
  [st, t.value]
8649
8664
  ])
8650
8665
  ], 32)
8651
8666
  ]),
8652
- A[20] || (A[20] = y("div", { class: "right-section" }, [
8667
+ p[20] || (p[20] = y("div", { class: "right-section" }, [
8653
8668
  y("span", { class: "app-title" }, "3D 模型编辑器")
8654
8669
  ], -1)),
8655
8670
  y("input", {
@@ -8688,53 +8703,53 @@ function myFunc() {
8688
8703
  },
8689
8704
  setup(r) {
8690
8705
  const e = r, t = G(!1);
8691
- _a((f) => {
8692
- t.value = f;
8706
+ _a((h) => {
8707
+ t.value = h;
8693
8708
  });
8694
8709
  const n = Qs(null), s = ts({
8695
8710
  position: { x: 0, y: 0, z: 0 },
8696
8711
  rotation: { x: 0, y: 0, z: 0 },
8697
8712
  scale: { x: 1, y: 1, z: 1 }
8698
- }), i = (f) => {
8699
- s.position.x = Number(f.position.x.toFixed(3)), s.position.y = Number(f.position.y.toFixed(3)), s.position.z = Number(f.position.z.toFixed(3)), s.rotation.x = Number(f.rotation.x.toFixed(3)), s.rotation.y = Number(f.rotation.y.toFixed(3)), s.rotation.z = Number(f.rotation.z.toFixed(3)), s.scale.x = Number(f.scale.x.toFixed(3)), s.scale.y = Number(f.scale.y.toFixed(3)), s.scale.z = Number(f.scale.z.toFixed(3));
8700
- }, o = (f) => {
8701
- f.position.set(
8713
+ }), i = (h) => {
8714
+ s.position.x = Number(h.position.x.toFixed(3)), s.position.y = Number(h.position.y.toFixed(3)), s.position.z = Number(h.position.z.toFixed(3)), s.rotation.x = Number(h.rotation.x.toFixed(3)), s.rotation.y = Number(h.rotation.y.toFixed(3)), s.rotation.z = Number(h.rotation.z.toFixed(3)), s.scale.x = Number(h.scale.x.toFixed(3)), s.scale.y = Number(h.scale.y.toFixed(3)), s.scale.z = Number(h.scale.z.toFixed(3));
8715
+ }, o = (h) => {
8716
+ h.position.set(
8702
8717
  s.position.x,
8703
8718
  s.position.y,
8704
8719
  s.position.z
8705
- ), f.rotation.set(
8720
+ ), h.rotation.set(
8706
8721
  s.rotation.x,
8707
8722
  s.rotation.y,
8708
8723
  s.rotation.z
8709
- ), f.scale.set(s.scale.x, s.scale.y, s.scale.z);
8724
+ ), h.scale.set(s.scale.x, s.scale.y, s.scale.z);
8710
8725
  };
8711
- al((f) => {
8712
- n.value = f, f && i(f);
8713
- }), ll((f) => {
8714
- i(f);
8726
+ al((h) => {
8727
+ n.value = h, h && i(h);
8728
+ }), ll((h) => {
8729
+ i(h);
8715
8730
  });
8716
8731
  const a = () => {
8717
8732
  if (n.value && (o(n.value), n.value.type === "DirectionalLight")) {
8718
- const f = n.value.userData.helper;
8719
- f && typeof f.update == "function" && f.update();
8733
+ const h = n.value.userData.helper;
8734
+ h && typeof h.update == "function" && h.update();
8720
8735
  }
8721
- }, l = (f) => Fi(f), c = async (f) => {
8736
+ }, l = (h) => Fi(h), c = async (h) => {
8722
8737
  try {
8723
- await ji(f);
8724
- } catch (h) {
8725
- console.error("导入失败:", h), alert("导入失败:" + h.message);
8738
+ await ji(h);
8739
+ } catch (f) {
8740
+ console.error("导入失败:", f), alert("导入失败:" + f.message);
8726
8741
  }
8727
8742
  }, d = Qs([]);
8728
- cl((f) => {
8729
- d.value = f;
8743
+ cl((h) => {
8744
+ d.value = h;
8730
8745
  });
8731
8746
  const u = () => {
8732
- const f = wi();
8733
- f && (d.value = f);
8734
- }, g = (f) => ds(f), p = (f) => Ii(f.uuid), b = (f) => {
8735
- Ai(f);
8736
- }, m = (f) => Fa(f), A = tt(
8737
- () => Se.scripts.filter((f) => !di(f))
8747
+ const h = wi();
8748
+ h && (d.value = h);
8749
+ }, g = (h) => ds(h), A = (h) => Ii(h.uuid), b = (h) => {
8750
+ Ai(h);
8751
+ }, m = (h) => Fa(h), p = tt(
8752
+ () => Se.scripts.filter((h) => !di(h))
8738
8753
  ), I = G(null), w = async () => {
8739
8754
  I.value && await Wa(I.value, e.mode, e.sceneData), u();
8740
8755
  };
@@ -8742,26 +8757,26 @@ function myFunc() {
8742
8757
  w(), I.value && vr(I.value);
8743
8758
  }), Ji(() => {
8744
8759
  console.log("endset_three_editor destroy"), vl();
8745
- }), (f, h) => (H(), k("div", Qu, [
8746
- t.value ? (H(), k("div", Ju, h[0] || (h[0] = [
8760
+ }), (h, f) => (H(), k("div", Qu, [
8761
+ t.value ? (H(), k("div", Ju, f[0] || (f[0] = [
8747
8762
  y("div", { class: "loading-spinner" }, null, -1),
8748
8763
  y("div", { class: "loading-text" }, "加载中...", -1)
8749
8764
  ]))) : re("", !0),
8750
- f.mode === "edit" ? (H(), vt(qu, {
8765
+ h.mode === "edit" ? (H(), vt(qu, {
8751
8766
  key: 1,
8752
8767
  onAddModel: l,
8753
8768
  onImportModel: c
8754
8769
  })) : re("", !0),
8755
8770
  y("div", {
8756
- class: Pe(`editor-container editor-container-mode-${f.mode}`)
8771
+ class: Pe(`editor-container editor-container-mode-${h.mode}`)
8757
8772
  }, [
8758
8773
  y("div", {
8759
- class: Pe(`canvas canvas-mode-${f.mode}`),
8774
+ class: Pe(`canvas canvas-mode-${h.mode}`),
8760
8775
  ref_key: "containerRef",
8761
8776
  ref: I
8762
8777
  }, [
8763
- A.value.length > 0 ? (H(), k("div", _u, [
8764
- (H(!0), k(Ee, null, At(A.value, (v, D) => (H(), k("button", {
8778
+ p.value.length > 0 ? (H(), k("div", _u, [
8779
+ (H(!0), k(Ee, null, At(p.value, (v, D) => (H(), k("button", {
8765
8780
  key: v.id,
8766
8781
  class: "script-trigger-btn",
8767
8782
  title: v.code,
@@ -8769,18 +8784,18 @@ function myFunc() {
8769
8784
  }, " ▶ " + fe(ns(Ua)(v, D)), 9, $u))), 128))
8770
8785
  ])) : re("", !0)
8771
8786
  ], 2),
8772
- f.mode === "edit" ? (H(), vt(Fu, {
8787
+ h.mode === "edit" ? (H(), vt(Fu, {
8773
8788
  key: 0,
8774
8789
  transform: s,
8775
8790
  "tree-data": d.value,
8776
8791
  "selected-object": n.value,
8777
8792
  onPropertyChange: a,
8778
8793
  onTreeSelect: g,
8779
- onTreeDelete: p,
8794
+ onTreeDelete: A,
8780
8795
  onTransformModeChange: b
8781
8796
  }, null, 8, ["transform", "tree-data", "selected-object"])) : re("", !0)
8782
8797
  ], 2),
8783
- f.mode === "edit" ? (H(), vt(Zu, { key: 2 })) : re("", !0)
8798
+ h.mode === "edit" ? (H(), vt(Zu, { key: 2 })) : re("", !0)
8784
8799
  ]));
8785
8800
  }
8786
8801
  }), bd = /* @__PURE__ */ Qe(ed, [["__scopeId", "data-v-1237aaa7"]]);